iobroker.eos-admin 8.0.0 → 8.0.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.
- package/NEXOWATT_EOS_BUILD_INFO.json +7 -6
- package/NEXOWATT_EOS_PREBUILT_MANIFEST.json +133 -51
- package/START_HERE_8.0.1.md +36 -0
- package/adminWww/.vite/manifest.json +39 -39
- package/adminWww/NEXOWATT_EOS_FRONTEND_MANIFEST.json +107 -107
- package/adminWww/assets/{AdapterUpdateDialog-B3y8RL_5.js → AdapterUpdateDialog-D3y2bGHM.js} +1 -1
- package/adminWww/assets/{Adapters-BDxfhfGe.js → Adapters-WMGNQt7g.js} +1 -1
- package/adminWww/assets/{ConfigManager-CFuOc_kb.js → ConfigManager-BMdQoiCg.js} +1 -1
- package/adminWww/assets/{Enums-CSzSzWm7.js → Enums-CHm2sGa-.js} +1 -1
- package/adminWww/assets/{Fields-DnckPMA8.js → Fields-Df7Llf6U.js} +1 -1
- package/adminWww/assets/{Files-CwUHx0pF.js → Files-Bwbw17Fb.js} +1 -1
- package/adminWww/assets/{Hosts-QkyuASJy.js → Hosts-BR0g-Wxo.js} +1 -1
- package/adminWww/assets/{Instances-BaWBemTT.js → Instances-BKydFSdw.js} +1 -1
- package/adminWww/assets/{Intro-DsfrPrWv.js → Intro-Dt2GzmtW.js} +1 -1
- package/adminWww/assets/{Logs-Cngy2Opt.js → Logs-hbcdBDN3.js} +1 -1
- package/adminWww/assets/{Objects-DY8KS7zK.js → Objects-HPx0yuOk.js} +1 -1
- package/adminWww/assets/{Overview-WwP6FjK-.js → Overview-CDvnM655.js} +1 -1
- package/adminWww/assets/{State-vP1o2BCL.js → State-Cc-tyuqB.js} +1 -1
- package/adminWww/assets/{UsedResources-CMTzFOX3.js → UsedResources-BIdU7UPm.js} +1 -1
- package/adminWww/assets/{Users-BjTGOjzL.js → Users-BruHA-yU.js} +1 -1
- package/adminWww/assets/{bootstrap-Bs4TZ7iA.js → bootstrap-D-7xcwTc.js} +3 -3
- package/adminWww/assets/{hostInit-2xIZYDSq.js → hostInit-huY-0clu.js} +1 -1
- package/adminWww/assets/{icons-material-BLgrEUSv.js → icons-material-Bu1f45BT.js} +1 -1
- package/adminWww/assets/{index-BZifaJHi.js → index-D8vmzGp8.js} +2 -2
- package/adminWww/assets/{installSVGRenderer-Pe6-VnD2.js → installSVGRenderer-BkdptYag.js} +1 -1
- package/adminWww/assets/{mf-entry-bootstrap-0-a6a54377.js → mf-entry-bootstrap-0-f6098d8b.js} +2 -2
- package/adminWww/index.html +21 -21
- package/adminWww/mf-manifest.json +1 -1
- package/adminWww/mf-stats.json +1 -1
- package/adminWww/{remoteEntry-eos-8.0.0.js → remoteEntry-eos-8.0.1.js} +1 -1
- package/adminWww/remoteEntry.js +1 -1
- package/build/lib/eosSessionSecurity.js +12 -4
- package/build/lib/eosSessionSecurity.js.map +1 -1
- package/build/lib/vendor/webserver/LICENSE +21 -0
- package/build/lib/vendor/webserver/README.md +506 -0
- package/build/lib/vendor/webserver/build/index.d.ts +9 -0
- package/build/lib/vendor/webserver/build/index.js +42 -0
- package/build/lib/vendor/webserver/build/index.js.map +1 -0
- package/build/lib/vendor/webserver/build/lib/acmeChallenge.d.ts +65 -0
- package/build/lib/vendor/webserver/build/lib/acmeChallenge.js +149 -0
- package/build/lib/vendor/webserver/build/lib/acmeChallenge.js.map +1 -0
- package/build/lib/vendor/webserver/build/lib/certificateManager.d.ts +60 -0
- package/build/lib/vendor/webserver/build/lib/certificateManager.js +128 -0
- package/build/lib/vendor/webserver/build/lib/certificateManager.js.map +1 -0
- package/build/lib/vendor/webserver/build/lib/http2Compat.d.ts +21 -0
- package/build/lib/vendor/webserver/build/lib/http2Compat.js +109 -0
- package/build/lib/vendor/webserver/build/lib/http2Compat.js.map +1 -0
- package/build/lib/vendor/webserver/build/lib/oauth2-authcode.d.ts +167 -0
- package/build/lib/vendor/webserver/build/lib/oauth2-authcode.js +619 -0
- package/build/lib/vendor/webserver/build/lib/oauth2-authcode.js.map +1 -0
- package/build/lib/vendor/webserver/build/lib/oauth2-clients.d.ts +92 -0
- package/build/lib/vendor/webserver/build/lib/oauth2-clients.js +230 -0
- package/build/lib/vendor/webserver/build/lib/oauth2-clients.js.map +1 -0
- package/build/lib/vendor/webserver/build/lib/oauth2-model.d.ts +84 -0
- package/build/lib/vendor/webserver/build/lib/oauth2-model.js +388 -0
- package/build/lib/vendor/webserver/build/lib/oauth2-model.js.map +1 -0
- package/build/lib/vendor/webserver/build/lib/oauth2.d.ts +75 -0
- package/build/lib/vendor/webserver/build/lib/oauth2.js +625 -0
- package/build/lib/vendor/webserver/build/lib/oauth2.js.map +1 -0
- package/build/lib/vendor/webserver/build/lib/securityChecker.d.ts +6 -0
- package/build/lib/vendor/webserver/build/lib/securityChecker.js +96 -0
- package/build/lib/vendor/webserver/build/lib/securityChecker.js.map +1 -0
- package/build/lib/vendor/webserver/build/lib/usedResources.d.ts +62 -0
- package/build/lib/vendor/webserver/build/lib/usedResources.js +231 -0
- package/build/lib/vendor/webserver/build/lib/usedResources.js.map +1 -0
- package/build/lib/vendor/webserver/build/lib/utils.d.ts +35 -0
- package/build/lib/vendor/webserver/build/lib/utils.js +110 -0
- package/build/lib/vendor/webserver/build/lib/utils.js.map +1 -0
- package/build/lib/vendor/webserver/build/lib/webServer.d.ts +164 -0
- package/build/lib/vendor/webserver/build/lib/webServer.js +454 -0
- package/build/lib/vendor/webserver/build/lib/webServer.js.map +1 -0
- package/build/lib/vendor/webserver/package.json +63 -0
- package/build/lib/web.js +1 -1
- package/build/lib/web.js.map +1 -1
- package/docs/ADMIN8_MIGRATION_8.0.0_DE.md +2 -0
- package/docs/cra/CRA_IEC_GAP_ANALYSIS_2026-09-30.md +5 -0
- package/docs/security/admin8-2026-11-04/development-1.log +3 -3
- package/docs/security/admin8-2026-11-04/development-2.log +248 -233
- package/docs/security/admin8-2026-11-05/copy-update/evidence-sha256.json +0 -5
- package/docs/security/admin8-2026-11-05/login-fix/BACKEND_DIAGNOSE_DE.md +48 -0
- package/docs/security/admin8-2026-11-05/login-fix/REPORT_DE.md +47 -0
- package/docs/security/admin8-2026-11-05/login-fix/REVIEW_DE.md +7 -0
- package/docs/security/admin8-2026-11-05/login-fix/controller-adapter-api.ts.txt +122 -0
- package/docs/security/admin8-2026-11-05/login-fix/controller-file-view.ts.txt +75 -0
- package/docs/security/admin8-2026-11-05/login-fix/controller-redis-view.ts.txt +471 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/LICENSE-webserver-3.4.0 +21 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/REPORT_DE.md +41 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/evidence-sha256.json +116 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/http-consumer-check.cjs +58 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/README_DE.md +9 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/REJECTED-webserver-3.4.0-eos-oauth.provenance.json +263 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/REJECTED-webserver-3.4.0-eos-oauth.tgz +0 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/admission.log +16 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/consumer-audit-stderr.log +1 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/consumer-audit.json +22 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/consumer-fixture-1.0.0.tgz +0 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/consumer-fixture-package.json +11 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/consumer-npm10-package-lock.json +387 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/consumer-npm11-package-lock.json +387 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/evidence-sha256.json +85 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/http-consumer-npm10-node22.json +11 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/http-consumer-npm11-node24.json +11 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/local-tests.json +38 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/tests-node22.log +168 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/rejected-file-dependency/tests-node24.log +36 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/source-vendor-tests-node22.log +224 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/source-vendor-tests-node24.log +42 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/source-vendor-tests.json +31 -0
- package/docs/security/admin8-2026-11-05/login-fix/dependency/webserver-3.4.0-upstream.tgz +0 -0
- package/docs/security/admin8-2026-11-05/login-fix/eos-session-8.0.0.js.txt +385 -0
- package/docs/security/admin8-2026-11-05/login-fix/evidence-sha256.json +59 -0
- package/docs/security/admin8-2026-11-05/login-fix/path-budget.json +6 -0
- package/docs/security/admin8-2026-11-05/login-fix/provenance.json +51 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/admission.log +21 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/archive-scan.json +13 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/artifacts.log +6 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/backend-build.log +5 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/consumer-package-lock.json +3258 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/copy-update-journal.json +165 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/development.log +365 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/frontend-build.log +149 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/full-consumer-audit.json +22 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/full-consumer-audit.stderr +2 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/full-consumer-final-install-node22.log +9 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/full-consumer-http-node22.json +15 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/full-consumer-http-node22.stderr +2 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/full-consumer-http-node24.json +15 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/full-consumer-http-node24.stderr +0 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/inventory.log +8 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/npm-pack-final.json +7809 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/npm-pack-final.stderr +6 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/overlay-final-publish-node22.json +10213 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/overlay-final-publish-node22.stderr +282 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/pipeline.json +72 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/seal.log +6 -0
- package/docs/security/admin8-2026-11-05/login-fix/release/vendor-final-review-node24.log +18 -0
- package/docs/security/admin8-2026-11-05/login-fix/reproduce.cjs +79 -0
- package/docs/security/admin8-2026-11-05/login-fix/reproduction.json +80 -0
- package/docs/security/admin8-2026-11-05/login-fix/upstream-LICENSE.txt +22 -0
- package/docs/security/admin8-2026-11-05/login-fix/validation.json +85 -0
- package/docs/third-party/admin8/NOTICE-PROVENANCE.json +3 -3
- package/io-package.json +9 -10
- package/package.json +9 -4
- package/release-manifests/admin8-development-validation.json +114 -31
- package/reports/security/artifact-inventory.json +462 -227
- package/reports/security/inventory-summary.json +39 -17
- package/reports/security/sbom-backend-lock.cdx.json +108 -111
- package/reports/security/sbom-frontend-lock.cdx.json +5 -5
- package/reports/security/source-runtime-manifest.json +455 -65
- package/tools/nexowatt-artifact-inventory.cjs +8 -1
- package/tools/nexowatt-installer-ems-selftest.cjs +1 -1
- package/tools/nexowatt-lock-provenance-check.cjs +8 -3
- package/tools/nexowatt-repair-lock-metadata.cjs +3 -3
- package/tools/nexowatt-security-inventory.cjs +22 -1
- package/tools/nexowatt-user-area-selftest.cjs +1 -1
- package/tools/nexowatt-v7109-clean-core-selftest.cjs +1 -1
- package/tools/nexowatt-vendored-webserver.cjs +69 -0
- package/tools/vendor/eos-retired-release-files.json +73 -1
- package/tools/vendor/webserver-3.4.0-source.provenance.json +244 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{Do as e,Ds as t,Es as n,Fr as r,Hs as i,Ir as a,Lr as o,Oo as s,So as c,Ts as l,Us as u,Vs as d,Zo as f,_o as p,bo as m,br as h,ho as g,mo as _,qo as v,qs as y,tc as b,vo as x}from"./loadShare-eager-CRNcc8D7.js";import{t as S}from"./Extension-DU1jqvic.js";import{n as ee,t as C}from"./Timeline-IQCnSLiw.js";import{t as w}from"./Storage-COo2RkS1.js";import{n as T,t as E}from"./UnfoldMore-Du7-8wYn.js";import{t as D}from"./AdminUtils-DDT_kD8H.js";import{ot as te}from"./bootstrap-
|
|
1
|
+
import{Do as e,Ds as t,Es as n,Fr as r,Hs as i,Ir as a,Lr as o,Oo as s,So as c,Ts as l,Us as u,Vs as d,Zo as f,_o as p,bo as m,br as h,ho as g,mo as _,qo as v,qs as y,tc as b,vo as x}from"./loadShare-eager-CRNcc8D7.js";import{t as S}from"./Extension-DU1jqvic.js";import{n as ee,t as C}from"./Timeline-IQCnSLiw.js";import{t as w}from"./Storage-COo2RkS1.js";import{n as T,t as E}from"./UnfoldMore-Du7-8wYn.js";import{t as D}from"./AdminUtils-DDT_kD8H.js";import{ot as te}from"./bootstrap-D-7xcwTc.js";import{$ as ne,$t as O,A as re,C as ie,D as k,Dt as A,Jt as ae,L as oe,M as j,N as se,Nt as ce,O as le,Pt as ue,Qt as de,R as fe,V as pe,W as me,Xt as M,Y as he,Yt as ge,Zt as N,_n as P,ct as _e,dn as ve,en as ye,ft as be,gn as xe,i as Se,in as F,it as I,j as Ce,k as L,l as R,ln as z,mn as we,n as Te,nn as Ee,nt as B,o as De,on as Oe,q as ke,r as Ae,rn as je,rt as V,s as Me,sn as Ne,t as Pe,tn as Fe,un as Ie,v as Le,y as Re,z as ze}from"./installSVGRenderer-BkdptYag.js";var Be=function(e,t){if(t===`all`)return{type:`all`,title:e.getLocaleModel().get([`legend`,`selector`,`all`])};if(t===`inverse`)return{type:`inverse`,title:e.getLocaleModel().get([`legend`,`selector`,`inverse`])}},H=function(e){P(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode={type:`box`,ignoreSize:!0},n}return t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),e.selected=e.selected||{},this._updateSelector(e)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),this._updateSelector(t)},t.prototype._updateSelector=function(e){var t=e.selector,n=this.ecModel;t===!0&&(t=e.selector=[`all`,`inverse`]),F(t)&&O(t,function(e,r){z(e)&&(e={type:e}),t[r]=ve(e,Be(n,e.type))})},t.prototype.optionUpdated=function(){this._updateData(this.ecModel);var e=this._data;if(e[0]&&this.get(`selectedMode`)===`single`){for(var t=!1,n=0;n<e.length;n++){var r=e[n].get(`name`);if(this.isSelected(r)){this.select(r),t=!0;break}}!t&&this.select(e[0].get(`name`))}},t.prototype._updateData=function(e){var t=[],n=[];e.eachRawSeries(function(r){var i=r.name;n.push(i);var a;if(r.legendVisualProvider){var o=r.legendVisualProvider.getAllNames();e.isSeriesFiltered(r)||(n=n.concat(o)),o.length?t=t.concat(o):a=!0}else a=!0;a&&be(r)&&t.push(r.name)}),this._availableNames=n;var r=this.get(`data`)||t,i=M(),a=Ie(r,function(e){return(z(e)||Ne(e))&&(e={name:e}),i.get(e.name)?null:(i.set(e.name,!0),new fe(e,this,this.ecModel))},this);this._data=Fe(a,function(e){return!!e})},t.prototype.getData=function(){return this._data},t.prototype.select=function(e){var t=this.option.selected;if(this.get(`selectedMode`)===`single`){var n=this._data;O(n,function(e){t[e.get(`name`)]=!1})}t[e]=!0},t.prototype.unSelect=function(e){this.get(`selectedMode`)!==`single`&&(this.option.selected[e]=!1)},t.prototype.toggleSelected=function(e){var t=this.option.selected;t.hasOwnProperty(e)||(t[e]=!0),this[t[e]?`unSelect`:`select`](e)},t.prototype.allSelect=function(){var e=this._data,t=this.option.selected;O(e,function(e){t[e.get(`name`,!0)]=!0})},t.prototype.inverseSelect=function(){var e=this._data,t=this.option.selected;O(e,function(e){var n=e.get(`name`,!0);t.hasOwnProperty(n)||(t[n]=!0),t[n]=!t[n]})},t.prototype.isSelected=function(e){var t=this.option.selected;return!(t.hasOwnProperty(e)&&!t[e])&&je(this._availableNames,e)>=0},t.prototype.getOrient=function(){return this.get(`orient`)===`vertical`?{index:1,name:`vertical`}:{index:0,name:`horizontal`}},t.type=`legend.plain`,t.dependencies=[`series`],t.defaultOption={z:4,show:!0,orient:`horizontal`,left:`center`,bottom:k.size.m,align:`auto`,backgroundColor:k.color.transparent,borderColor:k.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:`inherit`,symbolKeepAspect:!0,inactiveColor:k.color.disabled,inactiveBorderColor:k.color.disabled,inactiveBorderWidth:`auto`,itemStyle:{color:`inherit`,opacity:`inherit`,borderColor:`inherit`,borderWidth:`auto`,borderCap:`inherit`,borderJoin:`inherit`,borderDashOffset:`inherit`,borderMiterLimit:`inherit`},lineStyle:{width:`auto`,color:`inherit`,inactiveColor:k.color.disabled,inactiveWidth:2,opacity:`inherit`,type:`inherit`,cap:`inherit`,join:`inherit`,dashOffset:`inherit`,miterLimit:`inherit`},textStyle:{color:k.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:`sans-serif`,color:k.color.tertiary,borderWidth:1,borderColor:k.color.border},emphasis:{selectorLabel:{show:!0,color:k.color.quaternary}},selectorPosition:`auto`,selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},t}(le),U=N,W=O,G=A,K=function(e){P(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!1,n}return t.prototype.init=function(){this.group.add(this._contentGroup=new G),this.group.add(this._selectorGroup=new G),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(e,t,n){var r=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get(`show`,!0)){var i=e.get(`align`),a=e.get(`orient`);i&&i!==`auto`||(i=e.get(`left`)===`right`&&a===`vertical`?`right`:`left`);var o=e.get(`selector`,!0),s=e.get(`selectorPosition`,!0);o&&(!s||s===`auto`)&&(s=a===`horizontal`?`end`:`start`),this.renderInner(i,e,t,n,o,a,s);var c=re(e,n).refContainer,l=e.getBoxLayoutParams(),u=e.get(`padding`),d=j(l,c,u),f=this.layoutInner(e,i,d,r,o,s),p=j(de({width:f.width,height:f.height},l),c,u);this.group.x=p.x-f.x,this.group.y=p.y-f.y,this.group.markRedraw(),this.group.add(this._backgroundEl=Ae(f,e))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(e,t,n,r,i,a,o){var s=this.getContentGroup(),c=M(),l=t.get(`selectedMode`),u=t.get(`triggerEvent`),d=[];n.eachRawSeries(function(e){!e.get(`legendHoverLink`)&&d.push(e.id)}),W(t.getData(),function(i,a){var o=this,f=i.get(`name`);if(!this.newlineDisabled&&(f===``||f===`
|
|
2
2
|
`)){var p=new G;p.newline=!0,s.add(p)}else{var m=n.getSeriesByName(f)[0];if(!c.get(f)){if(m){var h=m.getData(),g=h.getVisual(`legendLineStyle`)||{},_=h.getVisual(`legendIcon`),v=h.getVisual(`style`),y=this._createItem(m,f,a,i,t,e,g,v,_,l,r);y.on(`click`,U(q,f,null,r,d)).on(`mouseover`,U(J,m.name,null,r,d)).on(`mouseout`,U(Y,m.name,null,r,d)),n.ssr&&y.eachChild(function(e){var t=B(e);t.seriesIndex=m.seriesIndex,t.dataIndex=a,t.ssrType=`legend`}),u&&y.eachChild(function(e){o.packEventData(e,t,m,a,f)}),c.set(f,!0)}else n.eachRawSeries(function(o){var s=this;if(!c.get(f)&&o.legendVisualProvider){var p=o.legendVisualProvider;if(!p.containName(f))return;var m=p.indexOfName(f),h=p.getItemVisual(m,`style`),g=p.getItemVisual(m,`legendIcon`),_=ce(h.fill);_&&_[3]===0&&(_[3]=.2,h=ye(ye({},h),{fill:ue(_,`rgba`)}));var v=this._createItem(o,f,a,i,t,e,{},h,g,l,r);v.on(`click`,U(q,null,f,r,d)).on(`mouseover`,U(J,null,f,r,d)).on(`mouseout`,U(Y,null,f,r,d)),n.ssr&&v.eachChild(function(e){var t=B(e);t.seriesIndex=o.seriesIndex,t.dataIndex=a,t.ssrType=`legend`}),u&&v.eachChild(function(e){s.packEventData(e,t,o,a,f)}),c.set(f,!0)}},this)}}},this),i&&this._createSelector(i,t,r,a,o)},t.prototype.packEventData=function(e,t,n,r,i){var a={componentType:`legend`,componentIndex:t.componentIndex,dataIndex:r,value:i,seriesIndex:n.seriesIndex};B(e).eventData=a},t.prototype._createSelector=function(e,t,n,r,i){var a=this.getSelectorGroup();W(e,function(e){var r=e.type,i=new V({style:{x:0,y:0,align:`center`,verticalAlign:`middle`},onclick:function(){n.dispatchAction({type:r===`all`?`legendAllSelect`:`legendInverseSelect`,legendId:t.id})}});a.add(i);var o=t.getModel(`selectorLabel`),s=t.getModel([`emphasis`,`selectorLabel`]);pe(i,{normal:o,emphasis:s},{defaultText:e.title}),ne(i)})},t.prototype._createItem=function(e,t,n,r,i,a,o,s,c,l,u){var d=e.visualDrawType,f=i.get(`itemWidth`),p=i.get(`itemHeight`),m=i.isSelected(t),h=r.get(`symbolRotate`),g=r.get(`symbolKeepAspect`),_=r.get(`icon`);c=_||c||`roundRect`;var v=Ve(c,r,o,s,d,m,u),y=new G,b=r.getModel(`textStyle`);if(Oe(e.getLegendIcon)&&(!_||_===`inherit`))y.add(e.getLegendIcon({itemWidth:f,itemHeight:p,icon:c,iconRotate:h,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}));else{var x=_===`inherit`&&e.getData().getVisual(`symbol`)?h===`inherit`?e.getData().getVisual(`symbolRotate`):h:0;y.add(He({itemWidth:f,itemHeight:p,icon:c,iconRotate:x,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}))}var S=a===`left`?f+5:-5,ee=a,C=i.get(`formatter`),w=t;z(C)&&C?w=C.replace(`{name}`,t??``):Oe(C)&&(w=C(t));var T=m?b.getTextColor():r.get(`inactiveColor`);y.add(new V({style:ze(b,{text:w,x:S,y:p/2,fill:T,align:ee,verticalAlign:`middle`},{inheritColor:T})}));var E=new I({shape:y.getBoundingRect(),style:{fill:`transparent`}}),D=r.getModel(`tooltip`);return D.get(`show`)&&ke({el:E,componentModel:i,itemName:t,itemTooltipOption:D.option}),y.add(E),y.eachChild(function(e){e.silent=!0}),E.silent=!l,this.getContentGroup().add(y),ne(y),y.__legendDataIndex=n,y},t.prototype.layoutInner=function(e,t,n,r,i,a){var o=this.getContentGroup(),s=this.getSelectorGroup();L(e.get(`orient`),o,e.get(`itemGap`),n.width,n.height);var c=o.getBoundingRect(),l=[-c.x,-c.y];if(s.markRedraw(),o.markRedraw(),i){L(`horizontal`,s,e.get(`selectorItemGap`,!0));var u=s.getBoundingRect(),d=[-u.x,-u.y],f=e.get(`selectorButtonGap`,!0),p=e.getOrient().index,m=p===0?`width`:`height`,h=p===0?`height`:`width`,g=p===0?`y`:`x`;a===`end`?d[p]+=c[m]+f:l[p]+=u[m]+f,d[1-p]+=c[h]/2-u[h]/2,s.x=d[0],s.y=d[1],o.x=l[0],o.y=l[1];var _={x:0,y:0};return _[m]=c[m]+f+u[m],_[h]=Math.max(c[h],u[h]),_[g]=Math.min(0,u[g]+d[1-p]),_}return o.x=l[0],o.y=l[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type=`legend.plain`,t}(ie);function Ve(e,t,n,r,i,a,o){function s(e,t){e.lineWidth===`auto`&&(e.lineWidth=t.lineWidth>0?2:0),W(e,function(n,r){e[r]===`inherit`&&(e[r]=t[r])})}var c=t.getModel(`itemStyle`),l=c.getItemStyle(),u=e.lastIndexOf(`empty`,0)===0?`fill`:`stroke`,d=c.getShallow(`decal`);l.decal=!d||d===`inherit`?r.decal:Le(d,o),l.fill===`inherit`&&(l.fill=r[i]),l.stroke===`inherit`&&(l.stroke=r[u]),l.opacity===`inherit`&&(l.opacity=(i===`fill`?r:n).opacity),s(l,r);var f=t.getModel(`lineStyle`),p=f.getLineStyle();if(s(p,n),l.fill===`auto`&&(l.fill=r.fill),l.stroke===`auto`&&(l.stroke=r.fill),p.stroke===`auto`&&(p.stroke=r.fill),!a){var m=t.get(`inactiveBorderWidth`),h=l[u];l.lineWidth=m===`auto`?r.lineWidth>0&&h?2:0:l.lineWidth,l.fill=t.get(`inactiveColor`),l.stroke=t.get(`inactiveBorderColor`),p.stroke=f.get(`inactiveColor`),p.lineWidth=f.get(`inactiveWidth`)}return{itemStyle:l,lineStyle:p}}function He(e){var t=e.icon||`roundRect`,n=Re(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill,e.symbolKeepAspect);return n.setStyle(e.itemStyle),n.rotation=(e.iconRotate||0)*Math.PI/180,n.setOrigin([e.itemWidth/2,e.itemHeight/2]),t.indexOf(`empty`)>-1&&(n.style.stroke=n.style.fill,n.style.fill=k.color.neutral00,n.style.lineWidth=2),n}function q(e,t,n,r){Y(e,t,n,r),n.dispatchAction({type:`legendToggleSelect`,name:e??t}),J(e,t,n,r)}function J(e,t,n,r){n.usingTHL()||n.dispatchAction({type:`highlight`,seriesName:e,name:t,excludeSeriesId:r})}function Y(e,t,n,r){n.usingTHL()||n.dispatchAction({type:`downplay`,seriesName:e,name:t,excludeSeriesId:r})}function X(e,t,n){var r=e===`allSelect`||e===`inverseSelect`,i={},a=[];n.eachComponent({mainType:`legend`,query:t},function(n){r?n[e]():n[e](t.name),Ue(n,i),a.push(n.componentIndex)});var o={};return n.eachComponent(`legend`,function(e){O(i,function(t,n){e[t?`select`:`unSelect`](n)}),Ue(e,o)}),r?{selected:o,legendIndex:a}:{name:t.name,selected:o}}function Ue(e,t){var n=t||{};return O(e.getData(),function(t){var r=t.get(`name`);if(r!==`
|
|
3
3
|
`&&r!==``){var i=e.isSelected(r);n[r]=Ee(n,r)?n[r]&&i:i}}),n}function We(e){e.registerAction(`legendToggleSelect`,`legendselectchanged`,N(X,`toggleSelected`)),e.registerAction(`legendAllSelect`,`legendselectall`,N(X,`allSelect`)),e.registerAction(`legendInverseSelect`,`legendinverseselect`,N(X,`inverseSelect`)),e.registerAction(`legendSelect`,`legendselected`,N(X,`select`)),e.registerAction(`legendUnSelect`,`legendunselected`,N(X,`unSelect`))}var Ge=_e(Ke);function Ke(e){var t=e.findComponents({mainType:`legend`});t&&t.length&&e.filterSeries(function(e){for(var n=0;n<t.length;n++)if(!t[n].isSelected(e.name))return!1;return!0})}function qe(e){e.registerComponentModel(H),e.registerComponentView(K),e.registerProcessor(e.PRIORITY.PROCESSOR.SERIES_FILTER,Ge),e.registerSubTypeDefaulter(`legend`,function(){return`plain`}),We(e)}var Je=function(e){P(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.setScrollDataIndex=function(e){this.option.scrollDataIndex=e},t.prototype.init=function(t,n,r){var i=Ce(t);e.prototype.init.call(this,t,n,r),Ye(this,t,i)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),Ye(this,this.option,t)},t.type=`legend.scroll`,t.defaultOption=oe(H.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:`end`,pageFormatter:`{current}/{total}`,pageIcons:{horizontal:[`M0,0L12,-10L12,10z`,`M0,0L-12,-10L-12,10z`],vertical:[`M0,0L20,0L10,-20z`,`M0,0L20,0L10,20z`]},pageIconColor:k.color.accent50,pageIconInactiveColor:k.color.accent10,pageIconSize:15,pageTextStyle:{color:k.color.tertiary},animationDurationUpdate:800}),t}(H);function Ye(e,t,n){var r=e.getOrient(),i=[1,1];i[r.index]=0,se(t,n,{type:`box`,ignoreSize:!!i})}var Xe=A,Z=[`width`,`height`],Q=[`x`,`y`],Ze=function(e){P(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!0,n._currentIndex=0,n}return t.prototype.init=function(){e.prototype.init.call(this),this.group.add(this._containerGroup=new Xe),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new Xe)},t.prototype.resetInner=function(){e.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},t.prototype.renderInner=function(t,n,r,i,a,o,s){var c=this;e.prototype.renderInner.call(this,t,n,r,i,a,o,s);var l=this._controllerGroup,u=n.get(`pageIconSize`,!0),d=F(u)?u:[u,u];p(`pagePrev`,0);var f=n.getModel(`pageTextStyle`);l.add(new V({name:`pageText`,style:{text:`xx/xx`,fill:f.getTextColor(),font:f.getFont(),verticalAlign:`middle`,align:`center`},silent:!0})),p(`pageNext`,1);function p(e,t){var r=e+`DataIndex`,a=me(n.get(`pageIcons`,!0)[n.getOrient().name][t],{onclick:ae(c._pageGo,c,r,n,i)},{x:-d[0]/2,y:-d[1]/2,width:d[0],height:d[1]});a.name=e,l.add(a)}},t.prototype.layoutInner=function(e,t,n,r,i,a){var o=this.getSelectorGroup(),s=e.getOrient().index,c=Z[s],l=Q[s],u=Z[1-s],d=Q[1-s];i&&L(`horizontal`,o,e.get(`selectorItemGap`,!0));var f=e.get(`selectorButtonGap`,!0),p=o.getBoundingRect(),m=[-p.x,-p.y],h=ge(n);i&&(h[c]=n[c]-p[c]-f);var g=this._layoutContentAndController(e,r,h,s,c,u,d,l);if(i){if(a===`end`)m[s]+=g[c]+f;else{var _=p[c]+f;m[s]-=_,g[l]-=_}g[c]+=p[c]+f,m[1-s]+=g[d]+g[u]/2-p[u]/2,g[u]=Math.max(g[u],p[u]),g[d]=Math.min(g[d],p[d]+m[1-s]),o.x=m[0],o.y=m[1],o.markRedraw()}return g},t.prototype._layoutContentAndController=function(e,t,n,r,i,a,o,s){var c=this.getContentGroup(),l=this._containerGroup,u=this._controllerGroup;L(e.get(`orient`),c,e.get(`itemGap`),r?n.width:null,r?null:n.height),L(`horizontal`,u,e.get(`pageButtonItemGap`,!0));var d=c.getBoundingRect(),f=u.getBoundingRect(),p=this._showController=d[i]>n[i],m=[-d.x,-d.y];t||(m[r]=c[s]);var h=[0,0],g=[-f.x,-f.y],_=we(e.get(`pageButtonGap`,!0),e.get(`itemGap`,!0));p&&(e.get(`pageButtonPosition`,!0)===`end`?g[r]+=n[i]-f[i]:h[r]+=f[i]+_),g[1-r]+=d[a]/2-f[a]/2,c.setPosition(m),l.setPosition(h),u.setPosition(g);var v={x:0,y:0};if(v[i]=p?n[i]:d[i],v[a]=Math.max(d[a],f[a]),v[o]=Math.min(0,f[o]+g[1-r]),l.__rectSize=n[i],p){var y={x:0,y:0};y[i]=Math.max(n[i]-f[i]-_,0),y[a]=v[a],l.setClipPath(new I({shape:y})),l.__rectSize=y[i]}else u.eachChild(function(e){e.attr({invisible:!0,silent:!0})});var b=this._getPageInfo(e);return b.pageIndex!=null&&he(c,{x:b.contentPosition[0],y:b.contentPosition[1]},p?e:null),this._updatePageInfoView(e,b),v},t.prototype._pageGo=function(e,t,n){var r=this._getPageInfo(t)[e];r!=null&&n.dispatchAction({type:`legendScroll`,scrollDataIndex:r,legendId:t.id})},t.prototype._updatePageInfoView=function(e,t){var n=this._controllerGroup;O([`pagePrev`,`pageNext`],function(r){var i=t[r+`DataIndex`]!=null,a=n.childOfName(r);a&&(a.setStyle(`fill`,i?e.get(`pageIconColor`,!0):e.get(`pageIconInactiveColor`,!0)),a.cursor=i?`pointer`:`default`)});var r=n.childOfName(`pageText`),i=e.get(`pageFormatter`),a=t.pageIndex,o=a==null?0:a+1,s=t.pageCount;r&&i&&r.setStyle(`text`,z(i)?i.replace(`{current}`,o==null?``:o+``).replace(`{total}`,s==null?``:s+``):i({current:o,total:s}))},t.prototype._getPageInfo=function(e){var t=e.get(`scrollDataIndex`,!0),n=this.getContentGroup(),r=this._containerGroup.__rectSize,i=e.getOrient().index,a=Z[i],o=Q[i],s=this._findTargetItemIndex(t),c=n.children(),l=c[s],u=c.length,d=+!!u,f={contentPosition:[n.x,n.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!l)return f;var p=v(l);f.contentPosition[i]=-p.s;for(var m=s+1,h=p,g=p,_=null;m<=u;++m)_=v(c[m]),(!_&&g.e>h.s+r||_&&!y(_,h.s))&&(h=g.i>h.i?g:_,h&&(f.pageNextDataIndex??=h.i,++f.pageCount)),g=_;for(var m=s-1,h=p,g=p,_=null;m>=-1;--m)_=v(c[m]),(!_||!y(g,_.s))&&h.i<g.i&&(g=h,f.pagePrevDataIndex??=h.i,++f.pageCount,++f.pageIndex),h=_;return f;function v(e){if(e){var t=e.getBoundingRect(),n=t[o]+e[o];return{s:n,e:n+t[a],i:e.__legendDataIndex}}}function y(e,t){return e.e>=t&&e.s<=t+r}},t.prototype._findTargetItemIndex=function(e){if(!this._showController)return 0;var t,n=this.getContentGroup(),r;return n.eachChild(function(n,i){var a=n.__legendDataIndex;r==null&&a!=null&&(r=i),a===e&&(t=i)}),t??r},t.type=`legend.scroll`,t}(K);function Qe(e){e.registerAction(`legendScroll`,`legendscroll`,function(e,t){var n=e.scrollDataIndex;n!=null&&t.eachComponent({mainType:`legend`,subType:`scroll`,query:e},function(e){e.setScrollDataIndex(n)})})}function $e(e){R(qe),e.registerComponentModel(Je),e.registerComponentView(Ze),Qe(e)}function et(e){R(qe),R($e)}var tt=t(u(d,{children:[i(`g`,{transform:`translate(-1.4 -1) scale(0.8)`,children:i(`path`,{d:`M20.5 11H19V7c0-1.1-.9-2-2-2h-4V3.5C13 2.12 11.88 1 10.5 1S8 2.12 8 3.5V5H4c-1.1 0-1.99.9-1.99 2v3.8H3.5c1.49 0 2.7 1.21 2.7 2.7s-1.21 2.7-2.7 2.7H2V20c0 1.1.9 2 2 2h3.8v-1.5c0-1.49 1.21-2.7 2.7-2.7s2.7 1.21 2.7 2.7V22H17c1.1 0 2-.9 2-2v-4h1.5c1.38 0 2.5-1.12 2.5-2.5S21.88 11 20.5 11`})}),i(`circle`,{cx:`19.2`,cy:`19.2`,r:`4.4`})]}),`Instance`);n(),R([De,Se,et,Te,Pe]);var nt=36e5,rt=3e4,it=class extends b{constructor(e){super(e),l(this,`refreshTimer`,null),this.state={historyInstance:``,blocker:null,loading:!0,enabling:!1,cpu:[],mem:[],error:``}}componentDidMount(){this.props.paused||(this.detectAndLoad(),this.startTimer())}componentDidUpdate(e){e.currentHost!==this.props.currentHost&&this.setState({loading:!0,cpu:[],mem:[]},()=>void this.detectAndLoad()),e.paused!==this.props.paused&&(this.props.paused?this.stopTimer():(this.detectAndLoad(),this.startTimer()))}componentWillUnmount(){this.stopTimer()}startTimer(){this.stopTimer(),this.refreshTimer=setInterval(()=>{this.state.blocker?this.detectAndLoad():this.readData()},rt)}stopTimer(){this.refreshTimer&&=(clearInterval(this.refreshTimer),null)}getIds(){return{cpu:`${this.props.currentHost}.cpu`,mem:`${this.props.currentHost}.mem`}}async detectAndLoad(){try{var e,t,n,r,i,a,o;let d=await this.props.socket.getCompactSystemConfig(),f=(d==null||(e=d.common)==null?void 0:e.defaultHistory)||``;if(!f){var s,c;this.setState({historyInstance:``,blocker:`noDefaultHistory`,loading:!1}),(s=(c=this.props).onAvailabilityChange)==null||s.call(c,!1);return}let p=await this.props.socket.getState(`system.adapter.${f}.alive`);if(!(p!=null&&p.val)){var l,u;this.setState({historyInstance:f,blocker:`historyNotAlive`,loading:!1}),(l=(u=this.props).onAvailabilityChange)==null||l.call(u,!1);return}(t=(n=this.props).onAvailabilityChange)==null||t.call(n,!0);let m=this.getIds(),[h,g]=await Promise.all([this.props.socket.getObject(m.cpu),this.props.socket.getObject(m.mem)]),_=!!(h!=null&&(r=h.common)!=null&&(r=r.custom)!=null&&(r=r[f])!=null&&r.enabled)&&!!(g!=null&&(i=g.common)!=null&&(i=i.custom)!=null&&(i=i[f])!=null&&i.enabled);if((a=(o=this.props).onRecordingChange)==null||a.call(o,_),!_){this.setState({historyInstance:f,blocker:`notRecorded`,loading:!1});return}this.setState({historyInstance:f,blocker:null},()=>void this.readData())}catch(e){this.setState({error:e.toString(),loading:!1})}}async enableRecording(){return this.setRecording(!0)}async stopRecording(){return this.setRecording(!1)}async setRecording(e){this.setState({enabling:!0});try{let t=this.getIds();for(let n of[t.cpu,t.mem]){let t=await this.props.socket.getObject(n);t&&(t.common.custom||={},t.common.custom[this.state.historyInstance]={...t.common.custom[this.state.historyInstance]||{},enabled:e},await this.props.socket.setObject(n,t))}this.setState({enabling:!1,loading:!0},()=>void this.detectAndLoad())}catch(e){this.setState({enabling:!1,error:e.toString()})}}async readData(){let e=this.getIds(),t=Date.now(),n=t-nt,r={instance:this.state.historyInstance,start:n,end:t,step:6e4,aggregate:`average`,from:!1,ack:!1,q:!1,addId:!1};try{let[t,n]=await Promise.all([this.props.socket.getHistory(e.cpu,r),this.props.socket.getHistory(e.mem,r)]),i=e=>(e||[]).filter(e=>e.val!==null&&e.val!==void 0).map(e=>[e.ts,Math.round(Number(e.val)*100)/100]);this.setState({cpu:i(t),mem:i(n),loading:!1})}catch(e){this.setState({error:e.toString(),loading:!1})}}renderBlocker(){let{t:e}=this.props;return u(p,{sx:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:2,height:260,color:`text.secondary`,textAlign:`center`,px:2},children:[i(C,{sx:{fontSize:40,opacity:.4}}),i(g,{variant:`body2`,children:e(`CPU and RAM of this host are not recorded by %s yet`,this.state.historyInstance)}),this.state.blocker===`notRecorded`?i(m,{variant:`contained`,disabled:this.state.enabling,startIcon:this.state.enabling?i(s,{size:16}):null,onClick:()=>void this.enableRecording(),children:e(`Record CPU and RAM`)}):null]})}renderChart(){let{theme:e,themeType:t,t:n}=this.props,r=t===`dark`?`#96A2B4`:`#5C6675`,a={backgroundColor:`transparent`,grid:{left:45,right:45,top:40,bottom:30},tooltip:{trigger:`axis`},legend:{data:[n(`CPU (%)`),n(`Memory (%)`)],textStyle:{color:r},top:0},xAxis:{type:`time`,axisLabel:{color:r},axisLine:{lineStyle:{color:r}},splitLine:{show:!1}},yAxis:[{type:`value`,name:`%`,min:0,max:100,nameTextStyle:{color:r},axisLabel:{color:r},splitLine:{lineStyle:{color:e.palette.divider}}}],series:[{name:n(`CPU (%)`),type:`line`,showSymbol:!1,smooth:!0,lineStyle:{width:2,color:e.palette.primary.main},itemStyle:{color:e.palette.primary.main},data:this.state.cpu},{name:n(`Memory (%)`),type:`line`,showSymbol:!1,smooth:!0,lineStyle:{width:2,color:e.palette.secondary.main},itemStyle:{color:e.palette.secondary.main},data:this.state.mem}]};return i(xe,{echarts:Me,option:a,style:{height:260,width:`100%`},opts:{renderer:`svg`},notMerge:!0})}render(){return this.state.blocker===`noDefaultHistory`||this.state.blocker===`historyNotAlive`?null:this.state.error?i(p,{sx:{height:260,display:`flex`,alignItems:`center`,justifyContent:`center`},children:i(g,{variant:`body2`,color:`error`,children:this.state.error})}):this.state.loading?i(p,{sx:{height:260,display:`flex`,alignItems:`center`,justifyContent:`center`},children:i(s,{})}):this.state.blocker?this.renderBlocker():!this.state.cpu.length&&!this.state.mem.length?u(p,{sx:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:2,height:260,color:`text.secondary`,textAlign:`center`,px:2},children:[i(C,{sx:{fontSize:40,opacity:.4}}),i(g,{variant:`body2`,children:this.props.t(`Recording is active, but there is no data for the last hour yet`)})]}):this.renderChart()}};n();var at=3e4,ot=5e3,st=6,ct=16,lt=`App.overviewChartMinimized`,ut=5,$=`--`,dt=class t extends b{constructor(e){super(e),l(this,`refreshTimer`,null),l(this,`chartRef`,y.createRef()),l(this,`objectsTimer`,null),l(this,`mounted`,!1),l(this,`subscribedHost`,``),l(this,`onCpu`,(e,t)=>{this.mounted&&this.setState({cpu:(t==null?void 0:t.val)===null||(t==null?void 0:t.val)===void 0?null:Number(t.val)})}),l(this,`onMem`,(e,t)=>{this.mounted&&this.setState({mem:(t==null?void 0:t.val)===null||(t==null?void 0:t.val)===void 0?null:Number(t.val)})}),l(this,`onLogs`,e=>{this.mounted&&this.setState(t=>({logs:[...t.logs,...e].slice(-16)}))}),l(this,`onChartButton`,()=>{if(!this.state.chartMinimized&&this.state.chartRecording){var e;(e=this.chartRef.current)==null||e.stopRecording();return}let t=!this.state.chartMinimized;(window._localStorage||window.localStorage).setItem(lt,t?`true`:`false`),this.setState({chartMinimized:t})}),this.state={loaded:!1,objectsLoaded:!1,hostAlive:!1,adaptersTotal:0,adaptersActive:0,instancesTotal:0,instancesAlive:0,objectsCount:0,statesCount:0,hostInfo:null,adapters:[],logs:[],cpu:null,mem:null,chartAvailable:!0,chartRecording:!0,chartMinimized:(window._localStorage||window.localStorage).getItem(lt)===`true`}}componentDidMount(){this.mounted=!0,this.readAll(),this.objectsTimer=setTimeout(()=>{this.objectsTimer=null,this.readObjects()},ot),this.subscribeHost(),this.refreshTimer=setInterval(()=>void this.readAll(),at),this.props.logsWorker.registerHandler(this.onLogs)}async readObjects(){let e,t=0;try{let n=await this.props.socket.getObjectsCount();e=n.total,t=n.byType.state||0}catch(r){console.warn(`Cannot count the objects on the server, reading them all: ${r.message}`);let i=await this.props.objectsWorker.getObjects()||{};e=Object.keys(i).length;for(let e of Object.keys(i)){var n;((n=i[e])==null?void 0:n.type)===`state`&&t++}}this.mounted&&this.setState({objectsCount:e,statesCount:t,objectsLoaded:!0})}componentDidUpdate(e){e.currentHost!==this.props.currentHost&&(this.setState({loaded:!1,cpu:null,mem:null,hostInfo:null}),this.subscribeHost(),this.readAll())}componentWillUnmount(){this.mounted=!1,this.refreshTimer&&=(clearInterval(this.refreshTimer),null),this.objectsTimer&&=(clearTimeout(this.objectsTimer),null),this.unsubscribeHost(),this.props.logsWorker.unregisterHandler(this.onLogs)}subscribeHost(){this.unsubscribeHost(),this.subscribedHost=this.props.currentHost,this.subscribedHost&&(this.props.socket.subscribeState(`${this.subscribedHost}.cpu`,this.onCpu),this.props.socket.subscribeState(`${this.subscribedHost}.mem`,this.onMem))}unsubscribeHost(){this.subscribedHost&&=(this.props.socket.unsubscribeState(`${this.subscribedHost}.cpu`,this.onCpu),this.props.socket.unsubscribeState(`${this.subscribedHost}.mem`,this.onMem),``)}async readAll(){let{socket:e,currentHost:t}=this.props,[n,r,i,a]=await Promise.all([this.props.instancesWorker.getObjects(),e.getForeignStates(`system.adapter.*.alive`).catch(()=>({})),e.getState(`${t}.alive`).catch(()=>null),this.props.logsWorker.getLogs().catch(()=>({logs:[],logSize:0}))]);if(!this.mounted)return;let o=Object.values(n||{}).filter(e=>{var t;return(e==null||(t=e.common)==null?void 0:t.host)===this.hostName()}),s=new Set,c=new Set,l=[],u=0;for(let e of o){var d;let t=e._id.replace(`system.adapter.`,``).split(`.`)[0];if(s.add(t),(d=r[`${e._id}.alive`])!=null&&d.val){u++,c.add(t);let n=l.find(e=>e.name===t);if(n)n.instances++;else{var f,p;l.push({name:t,version:((f=e.common)==null?void 0:f.version)||``,instances:1,icon:(p=e.common)!=null&&p.icon?`adapter/${t}/${e.common.icon}`:``})}}}l.sort((e,t)=>e.name.localeCompare(t.name));let m=this.state.hostInfo;try{m=await this.props.socket.getHostInfo(t)}catch{}this.mounted&&this.setState({loaded:!0,hostAlive:!!(i!=null&&i.val),adaptersTotal:s.size,adaptersActive:c.size,instancesTotal:o.length,instancesAlive:u,hostInfo:m,adapters:l,logs:(a.logs||[]).slice(-16)})}static logText(e){return typeof e.message==`string`?e.message:e.message.original}hostName(){return this.props.currentHostName||this.props.currentHost.replace(`system.host.`,``)}static renderGaugeRow(e,t,n){return u(p,{sx:{display:`flex`,alignItems:`center`,gap:2,py:1},children:[i(g,{variant:`body2`,color:`text.secondary`,sx:{width:80},children:e}),i(f,{variant:`determinate`,value:Math.max(0,Math.min(100,t??0)),sx:{flex:1,maxWidth:160}}),i(g,{variant:`body2`,sx:{flex:1,textAlign:`right`},children:n})]},e)}renderSystemInfo(){let{t:e}=this.props,n=this.state.hostInfo,r=n!=null&&n.RAM?Number(n.RAM)/1024/1024/1024:0,s=this.state.mem!==null&&r?r*this.state.mem/100:null;return u(c,{sx:{flex:`1 1 340px`,p:2.5},children:[i(a,{title:e(`System information`)}),n?u(d,{children:[i(o,{name:e(`Platform`),value:String(n.Platform??`-`)}),i(o,{name:e(`Architecture`),value:String(n.Architecture??`-`)}),i(o,{name:`Node.js`,value:String(n[`Node.js`]??`-`)}),i(o,{name:`NPM`,value:String(n.NPM??`-`)}),i(o,{name:e(`System uptime`),value:D.formatSeconds(Number(n[`System uptime`]??0),e)}),t.renderGaugeRow(e(`RAM`),this.state.mem,s===null?`-`:`${s.toFixed(1)} GB / ${r==null?void 0:r.toFixed(1)} GB (${Math.round(this.state.mem??0)}%)`),t.renderGaugeRow(`CPU`,this.state.cpu,this.state.cpu===null?`-`:`${Math.round(this.state.cpu)}%`)]}):i(f,{})]})}renderAdapters(){let{t,theme:n}=this.props;return u(c,{sx:{flex:`1 1 340px`,p:2.5},children:[i(a,{title:t(`Running adapters`),action:{text:t(`Show all`),onClick:()=>this.props.handleNavigation(`tab-instances`)}}),this.state.adapters.length?this.state.adapters.slice(0,ut).map(r=>u(p,{sx:{display:`flex`,alignItems:`center`,gap:1.5,py:1,borderTop:`1px solid`,borderColor:`divider`},children:[i(p,{sx:{width:26,height:26,borderRadius:`50%`,flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`center`,backgroundColor:x(n.palette.success.main,.2),border:`1px solid ${x(n.palette.success.main,.5)}`},children:r.icon?i(h,{src:r.icon,alt:r.name,style:{width:18,height:18,borderRadius:`50%`}}):null}),i(g,{variant:`body2`,sx:{flex:1},children:r.name}),u(g,{variant:`caption`,color:`text.secondary`,children:[`v`,r.version]}),i(e,{size:`small`,color:`success`,variant:`outlined`,label:r.instances>1?t(`%s instances`,r.instances):t(`active`)})]},r.name)):i(g,{variant:`body2`,color:`text.secondary`,children:t(`No running adapters`)})]})}renderChartButton(){let{t:e}=this.props,t,n;return this.state.chartMinimized?(t=i(E,{}),n=e(`Maximize`)):this.state.chartRecording?(t=i(ee,{}),n=e(`Stop recording`)):(t=i(T,{}),n=e(`Minimize`)),i(_,{title:n,children:i(v,{size:`small`,onClick:this.onChartButton,"aria-label":n,children:t})})}renderLog(){let{t:e,theme:n}=this.props,r={error:n.palette.error.main,warn:n.palette.warning.main};return u(c,{sx:{flex:`2 1 460px`,p:2.5,minWidth:0},children:[i(a,{title:e(`System log`),action:{text:e(`Show all`),onClick:()=>this.props.handleNavigation(`tab-logs`)}}),this.state.logs.length?this.state.logs.slice(-(this.state.chartMinimized?ct:st)).map((e,a)=>u(p,{sx:{display:`flex`,alignItems:`center`,gap:1.5,py:1,borderTop:`1px solid`,borderColor:`divider`,minWidth:0},children:[i(p,{sx:{width:8,height:8,borderRadius:`50%`,flexShrink:0,backgroundColor:r[e.severity]||n.palette.success.main}}),i(g,{variant:`caption`,color:`text.secondary`,sx:{whiteSpace:`nowrap`},children:new Date(e.ts).toLocaleTimeString()}),i(g,{variant:`caption`,sx:{color:r[e.severity]||`text.secondary`,width:34,flexShrink:0},children:e.severity}),i(g,{variant:`caption`,sx:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:t.logText(e)})]},`${e.key??e.ts}_${a}`)):i(g,{variant:`body2`,color:`text.secondary`,children:e(`No messages`)})]})}render(){let{t,theme:n}=this.props,o=this.state.hostAlive,s=this.state.loaded,l=D.countAdapterUpdates(this.props.installed,this.props.repository);return u(p,{sx:{height:`100%`,overflow:`auto`,p:3,pt:0},children:[u(p,{sx:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,mb:2,gap:2},children:[this.props.menuButtonSpace?i(p,{sx:{width:40,flexShrink:0}}):null,u(p,{children:[i(g,{sx:{fontSize:`1.5rem`,fontWeight:700},children:t(`Overview`)}),i(g,{variant:`body2`,color:`text.secondary`,children:t(`System overview and status`)})]}),u(p,{sx:{display:`flex`,alignItems:`center`,gap:1.5},children:[s?i(e,{size:`small`,label:t(o?`online`:`offline`),color:o?`success`:`error`}):null,i(p,{sx:{ml:`auto`,pl:1},children:this.props.hostSelector})]})]}),u(p,{sx:{display:`flex`,gap:2,flexWrap:`wrap`,mb:2},children:[i(r,{title:t(`System status`),value:s?t(o?`OK`:`Offline`):$,valueColor:s?o?n.palette.success.main:n.palette.error.main:void 0,hint:t(s?o?`ioBroker is running`:`Host does not answer`:`Loading...`),color:s?o?n.palette.success.main:n.palette.error.main:n.palette.text.secondary,icon:i(te,{}),onClick:()=>this.props.handleNavigation(`tab-hosts`)}),i(r,{title:t(`Adapters`),value:s?String(this.state.adaptersTotal):$,hint:s?t(`%s active / %s inactive`,this.state.adaptersActive,this.state.adaptersTotal-this.state.adaptersActive):t(`Loading...`),chip:l?{label:l===1?t(`1 update`):t(`%s updates`,l),color:`warning`}:void 0,color:n.palette.primary.main,icon:i(S,{}),onClick:()=>this.props.handleNavigation(`tab-adapters`)}),i(r,{title:t(`Instances`),value:s?String(this.state.instancesTotal):$,hint:s?t(`%s active / %s inactive`,this.state.instancesAlive,this.state.instancesTotal-this.state.instancesAlive):t(`Loading...`),color:n.palette.secondary.main,icon:i(tt,{}),onClick:()=>this.props.handleNavigation(`tab-instances`)}),i(r,{title:t(`Objects`),value:this.state.objectsLoaded?this.state.objectsCount.toLocaleString(this.props.lang):$,hint:this.state.objectsLoaded?t(`%s states`,this.state.statesCount.toLocaleString(this.props.lang)):t(`Loading...`),color:n.palette.warning.main,icon:i(w,{}),onClick:()=>this.props.handleNavigation(`tab-objects`)})]}),u(p,{sx:{display:`flex`,gap:2,flexWrap:`wrap`,mb:2},children:[this.renderSystemInfo(),u(c,{sx:{flex:`2 1 460px`,p:2.5,minWidth:0,alignSelf:this.state.chartMinimized?`flex-start`:void 0,display:this.state.chartAvailable?void 0:`none`},children:[i(a,{title:t(`Resource usage`),actions:this.renderChartButton()}),i(p,{sx:{display:this.state.chartMinimized?`none`:void 0},children:i(it,{ref:this.chartRef,socket:this.props.socket,currentHost:this.props.currentHost,theme:this.props.theme,themeType:this.props.themeType,t,paused:this.state.chartMinimized,onAvailabilityChange:e=>{e!==this.state.chartAvailable&&this.setState({chartAvailable:e})},onRecordingChange:e=>{e!==this.state.chartRecording&&this.setState({chartRecording:e})}})})]})]}),u(p,{sx:{display:`flex`,gap:2,flexWrap:`wrap`},children:[this.renderAdapters(),this.renderLog()]})]})}};export{dt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Go as e,Hs as t,Ls as n,Us as r,ei as i,ho as a,zs as o}from"./loadShare-eager-CRNcc8D7.js";import{yt as s}from"./bootstrap-
|
|
1
|
+
import{Go as e,Hs as t,Ls as n,Us as r,ei as i,ho as a,zs as o}from"./loadShare-eager-CRNcc8D7.js";import{yt as s}from"./bootstrap-D-7xcwTc.js";var c={checkIcon:{color:n[700]},cancelIcon:{color:o[700]},wrapperContent:{display:`flex`,flexFlow:`nowrap`,alignItems:`inherit`}};function l(n){return r(e,{container:!0,style:c.wrapperContent,direction:`row`,spacing:1,sx:{alignItems:`center`},children:[t(e,{children:n.state?t(s,{style:c.checkIcon}):t(i,{style:c.cancelIcon})}),t(e,{children:t(a,{children:n.children})})]})}export{l as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{An as e,Do as t,Hs as n,Qt as r,Us as i,Vt as a,_o as o,eo as s,ho as c,io as l,mo as u,no as d,oo as f,pc as p,sc as m,si as h,to as g}from"./loadShare-eager-CRNcc8D7.js";import{n as _,r as v,t as y}from"./Usb-Ca47vqRv.js";import{o as b}from"./AdminUtils-DDT_kD8H.js";import{ot as x}from"./bootstrap-
|
|
1
|
+
import{An as e,Do as t,Hs as n,Qt as r,Us as i,Vt as a,_o as o,eo as s,ho as c,io as l,mo as u,no as d,oo as f,pc as p,sc as m,si as h,to as g}from"./loadShare-eager-CRNcc8D7.js";import{n as _,r as v,t as y}from"./Usb-Ca47vqRv.js";import{o as b}from"./AdminUtils-DDT_kD8H.js";import{ot as x}from"./bootstrap-D-7xcwTc.js";var S=`system.host.*.usedResources.*`,C=`.usedResources.`;function w(e){let t=e.indexOf(C);return e.startsWith(`system.host.`)&&t>0?e.substring(0,t):null}function T(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.type==`string`&&/^[A-Za-z0-9_-]{1,64}$/.test(t.type)&&typeof t.instance==`string`&&!!t.instance&&typeof t.ts==`number`&&typeof t.isBlocked==`boolean`&&typeof t.data==`object`&&t.data!==null&&!Array.isArray(t.data)}function E(e){if(!e||typeof e.val!=`string`||!e.val)return[];try{let t=JSON.parse(e.val);return Array.isArray(t)?t.filter(T):[]}catch{return[]}}var D=new Set([`0.0.0.0`,`::`,`*`,``]);function O(e,t,n){if(e===`tcpPort`||e===`udpPort`){if(t.port!==n.port||t.family!==void 0&&n.family!==void 0&&t.family!==n.family)return!1;if(t.bind===void 0||n.bind===void 0)return!0;let e=String(t.bind).trim(),r=String(n.bind).trim();return D.has(e)||D.has(r)||e===r}if(e===`serialPort`)return(t.device??t.port)===(n.device??n.port);if(e===`usb`)return t.path===n.path;let r=(e,t)=>Object.keys(e).every(n=>e[n]===void 0||e[n]===t[n]);return r(t,n)||r(n,t)}var k={serialPort:`Serial port`,tcpPort:`TCP port`,udpPort:`UDP port`,usb:`USB device`,bluetooth:`Bluetooth`,gpio:`GPIO`};function A(e){return e.flatMap(e=>Object.keys(k).map(t=>`${e}.usedResources.${t}`))}async function j(e,t){let n=A(t),r=t.length===1?`${t[0]}.usedResources.*`:S,[i,a]=await Promise.all([n.length?e.getForeignStates(n).catch(e=>(console.warn(`Cannot read the used resources: ${e}`),{})):Promise.resolve({}),e.getForeignStates(r).catch(e=>(console.warn(`Cannot read ${r}: ${e}`),{}))]),o={...i,...a};for(let e of Object.keys(o))o[e]||delete o[e];return o}function M(e){let t=[];for(let[n,r]of Object.entries(e)){let e=w(n);if(e)for(let n of E(r))t.push({...n,hostId:e,conflicts:[]})}for(let e of t)e.conflicts=t.filter(t=>t.hostId===e.hostId&&t.type===e.type&&t.instance!==e.instance&&O(e.type,e.data,t.data)).map(e=>e.instance);return t.sort((e,t)=>e.hostId.localeCompare(t.hostId)||e.type.localeCompare(t.type)||N(e).localeCompare(N(t),void 0,{numeric:!0})||e.instance.localeCompare(t.instance))}function N(e){let t=e.data,n=[],r;switch(e.type){case`tcpPort`:case`udpPort`:r=String(t.port??``),t.bind!==void 0&&!D.has(String(t.bind).trim())&&n.push(String(t.bind)),t.family!==void 0&&n.push(`IPv${t.family}`);break;case`serialPort`:r=String(t.port??``),t.device!==void 0&&t.device!==t.port&&n.push(`→ ${t.device}`),t.baudRate!==void 0&&n.push(`${t.baudRate} Bd`);break;case`usb`:r=String(t.path??``),(t.vendorId!==void 0||t.productId!==void 0)&&n.push(`${t.vendorId??`?`}:${t.productId??`?`}`);break;case`bluetooth`:r=String(t.hci??``);break;case`gpio`:r=String(t.pin??``),t.chip!==void 0&&n.push(String(t.chip));break;default:r=Object.entries(t).map(([e,t])=>`${e}: ${t}`).join(`, `)}return n.length?`${r} (${n.join(`, `)})`:r}var P={serialPort:n(a,{fontSize:`small`}),tcpPort:n(_,{fontSize:`small`}),udpPort:n(_,{fontSize:`small`}),usb:n(y,{fontSize:`small`}),bluetooth:n(r,{fontSize:`small`}),gpio:n(x,{fontSize:`small`})};function F(e){return P[e]||n(v,{fontSize:`small`})}function I(e,t){return k[e]?t(k[e]):e}function L(e,t){return t(`Also registered by: %s`,e.conflicts.join(`, `))}function R(e,t){let[n,r]=p(null);return m(()=>{let n=`${t}.usedResources.*`,i={},a=!0,o=()=>{a&&r(Object.keys(i).length?M(i):null)},s=(e,t)=>{i={...i,[e]:t},o()};return j(e,[t]).then(e=>{i={...e,...i},o()}),e.subscribeState(n,s),()=>{a=!1,e.unsubscribeState(n,s)}},[e,t]),n}var z={};function B(e){let t=e.instance.split(`.`)[0],[r,i]=p(``);return m(()=>{let n=!0;return z[t]||=e.socket.getObject(`system.adapter.${t}`).then(e=>{var n;return e!=null&&(n=e.common)!=null&&n.icon?b(`adapter/${t}/${e.common.icon}`):``}).catch(()=>``),z[t].then(e=>{n&&i(e)}),()=>{n=!1}},[e.socket,t]),n(o,{sx:{width:20,height:20,flexShrink:0},children:r?n(`img`,{src:r,alt:``,style:{width:20,height:20,objectFit:`contain`}}):null})}function V(e){let{t:r}=e;return i(s,{size:`small`,sx:{"& td, & th":{py:.5}},children:[n(l,{children:i(f,{children:[n(d,{children:r(`Type`)}),n(d,{children:r(`Resource`)}),e.hideInstance?null:n(d,{children:r(`Instance`)}),n(d,{children:r(`Status`)}),n(d,{children:r(`Registered`)})]})}),n(g,{children:e.resources.map(a=>{let s=N(a);return i(f,{children:[n(d,{children:i(o,{sx:{display:`flex`,alignItems:`center`,gap:1,whiteSpace:`nowrap`},children:[F(a.type),I(a.type,r)]})}),n(d,{children:i(o,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[s,a.conflicts.length?n(u,{title:L(a,r),children:n(h,{fontSize:`small`,color:`warning`})}):null]})}),e.hideInstance?null:n(d,{children:i(o,{sx:{display:`flex`,alignItems:`center`,gap:1,whiteSpace:`nowrap`},children:[n(B,{socket:e.socket,instance:a.instance}),a.instance]})}),n(d,{children:n(u,{title:a.isBlocked?r(`The instance runs and holds the resource`):r(`The instance does not run and would take the resource when started`),children:n(t,{size:`small`,variant:a.isBlocked?`filled`:`outlined`,color:a.isBlocked?`success`:`info`,label:a.isBlocked?r(`In use`):r(`Reserved`)})})}),n(d,{sx:{whiteSpace:`nowrap`},children:new Date(a.ts).toLocaleString()})]},`${a.instance}|${a.type}|${s}`)})})]})}function H(r){let a=R(r.socket,r.hostId),[s,l]=p(!1);if(!a)return null;let d=a.filter(e=>e.conflicts.length);return i(o,{sx:{width:`100%`,px:2,pb:1},onClick:e=>e.stopPropagation(),children:[i(o,{sx:e=>({display:`inline-flex`,alignItems:`center`,gap:1,py:.5,pl:.5,pr:1.5,borderRadius:2,cursor:`pointer`,border:`1px solid ${e.palette.divider}`,backgroundColor:e.palette.action.hover,"&:hover":{backgroundColor:e.palette.action.selected}}),onClick:()=>l(!s),children:[n(e,{fontSize:`small`,sx:{transition:`transform 0.2s`,transform:s?`rotate(180deg)`:void 0}}),n(c,{variant:`subtitle2`,sx:{fontWeight:`bold`},children:r.t(`Used resources`)}),n(t,{size:`small`,label:a.length}),d.length?n(u,{title:n(`span`,{style:{whiteSpace:`pre-line`},children:d.map(e=>`${N(e)}: ${L(e,r.t)}`).join(`
|
|
2
2
|
`)}),children:i(o,{sx:{display:`flex`,alignItems:`center`,gap:.5,color:`warning.main`},children:[n(h,{fontSize:`small`,color:`warning`}),d.length]})}):null]}),s?n(o,{sx:{mt:1,maxHeight:400,overflowY:`auto`},children:a.length?n(V,{socket:r.socket,resources:a,t:r.t}):n(c,{variant:`body2`,color:`textSecondary`,children:r.t(`No instance has registered a resource`)})}):null]})}export{S as a,j as c,I as i,L as n,M as o,F as r,N as s,H as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$a as e,$i as t,Eo as n,Es as r,Fo as i,Ga as a,Go as o,Gr as s,Ho as c,Hs as l,Kn as u,Mo as d,No as f,Po as p,Rr as m,Sa as h,So as g,Ts as _,Ua as v,Us as y,Zo as ee,_a as b,_o as x,bo as S,br as C,co as te,fc as w,ho as T,jo as E,qa as D,qn as O,qo as k,sc as ne,tc as A,wo as j,xa as M,xi as N,xr as P,zo as F,zr as re}from"./loadShare-eager-CRNcc8D7.js";import{n as I,r as L,t as R}from"./Pageview-DBITLOzI.js";import{n as ie,r as ae,t as oe}from"./PersonOff-ANdO5Nu4.js";import{t as z}from"./VpnKey-iMA7KrB-.js";import{o as B,t as V}from"./AdminUtils-DDT_kD8H.js";import{B as H,H as U,L as W,R as G,W as K,z as se}from"./bootstrap-Bs4TZ7iA.js";import{n as q,r as ce,t as J}from"./Fields-DnckPMA8.js";var Y=e=>{let r=+!e.isDragging,i=s.getInvertedColor(e.user.common.color,e.themeType,!0),a={cursor:`grab`,opacity:r,overflow:`hidden`,color:i};return e.user.common.color&&(a.backgroundColor=e.user.common.color),l(g,{style:a,sx:e.styles.userGroupCard2,children:y(`div`,{style:e.styles.userCardContent,children:[y(`div`,{style:e.styles.right,children:[l(n,{checked:e.user.common.enabled,style:{color:i},disabled:e.user.common.dontDelete,onChange:()=>{e.socket.extendObject(e.user._id,{common:{enabled:!e.user.common.enabled}}).then(()=>e.updateData())}}),l(k,{size:`small`,onClick:()=>e.showUserEditDialog(e.user,!1),children:l(M,{style:{color:i}})}),l(k,{size:`small`,onClick:()=>e.showUserDeleteDialog(e.user),disabled:e.user.common.dontDelete,children:l(v,{style:e.user.common.dontDelete?void 0:{color:i}})})]}),y(j,{children:[y(T,{gutterBottom:!0,component:`div`,style:e.styles.userGroupTitle,children:[e.user.common.icon?l(C,{style:e.styles.icon,src:e.user.common.icon}):l(O,{style:e.styles.icon}),y(`div`,{children:[y(`div`,{children:[l(`span`,{style:e.styles.userGroupUserName,children:e.getText(e.user.common.name)}),y(`span`,{style:e.styles.userGroupUserID,children:[`[`,e.user._id,`]`]})]}),l(`span`,{children:e.user.common.desc?l(`div`,{style:e.styles.description,children:e.getText(e.user.common.desc)}):null})]})]}),e.groups.find(t=>t.common.members&&t.common.members.includes(e.user._id))?y(`div`,{children:[e.t(`In groups`),`:`]}):null,l(`div`,{children:e.groups.map(n=>{var r,a;if(!n.common.members||!n.common.members.includes(e.user._id))return null;let o=n&&(r=n.common)!=null&&r.color?s.getInvertedColor(n.common.color,e.themeType,!0):i;return y(g,{variant:`outlined`,sx:e.styles.userGroupMember,style:{color:o,borderColor:`${o}80`,background:((a=n.common)==null?void 0:a.color)||`inherit`},children:[n.common.icon?l(C,{style:e.styles.icon,src:n.common.icon}):l(u,{style:e.styles.icon}),e.getText(n.common.name),l(k,{size:`small`,onClick:()=>e.removeUserFromGroup(e.user._id,n._id),children:l(t,{style:{color:o}})})]},n._id)})})]})]})})},le=e=>{let t=w(null),[{isDragging:n},r,i]=U({type:`user`,item:()=>{var n;return{userId:e.user._id,preview:l(`div`,{style:{width:(n=t.current)==null?void 0:n.offsetWidth},children:l(Y,{...e})})}},end:(t,n)=>{let r=n.getDropResult();if(t&&r){var i;(i=e.addUserToGroup)==null||i.call(e,t.userId,r.groupId)}},collect:e=>({isDragging:e.isDragging(),handlerId:e.getHandlerId()})});return ne(()=>{i(se(),{captureDraggingState:!0})},[i]),l(`div`,{ref:e=>{r(e)},children:l(`div`,{ref:t,children:l(Y,{isDragging:n,...e})})})};function ue(e,t){return!t.group.common.members||!t.group.common.members.includes(e.getItem().userId)}var de=e=>{var n;let[{CanDrop:r,isOver:i},a]=H(()=>({accept:`user`,drop:()=>({groupId:e.group._id}),canDrop:(t,n)=>ue(n,e),collect:e=>({isOver:e.isOver(),CanDrop:e.canDrop()})}),[e.group.common.members]),o=.7,c;r&&i?(o=r?1:.125,c=e.styles.userGroupCardSecondary):r&&(o=r?.75:.25);let d=s.getInvertedColor(e.group.common.color,e.themeType,!0),f={opacity:o,overflow:`hidden`,color:d};return e.group.common.color&&(f.backgroundColor=e.group.common.color),y(g,{style:f,ref:e=>{a(e)},sx:s.getStyle(e.theme,e.styles.userGroupCard2,c),children:[y(`div`,{style:e.styles.right,children:[l(k,{size:`small`,onClick:()=>e.showGroupEditDialog(e.group,!1),children:l(M,{style:{color:d}})}),l(k,{size:`small`,onClick:()=>e.showGroupDeleteDialog(e.group),disabled:e.group.common.dontDelete,children:l(v,{style:e.group.common.dontDelete?void 0:{color:d}})})]}),y(j,{children:[y(T,{gutterBottom:!0,component:`div`,style:e.styles.userGroupTitle,children:[e.group.common.icon?l(C,{style:e.styles.icon,src:e.group.common.icon}):l(u,{style:e.styles.icon}),y(`div`,{children:[y(`div`,{children:[l(`span`,{style:e.styles.userGroupUserName,children:e.getText(e.group.common.name)}),y(`span`,{children:[`[`,e.group._id,`]`]})]}),e.group.common.desc?l(`div`,{style:e.styles.description,children:e.getText(e.group.common.desc)}):null]})]}),(n=e.group.common.members)!=null&&n.length?y(`div`,{children:[e.t(`Group members`),`:`]}):null,l(`div`,{children:(e.group.common.members||[]).map((n,r)=>{var i,a;let o=e.users.find(e=>e._id===n),c=o&&(i=o.common)!=null&&i.color?s.getInvertedColor(o.common.color,e.themeType,!0):d;return o?y(g,{variant:`outlined`,sx:e.styles.userGroupMember,style:{color:c,borderColor:`${c}40`,background:((a=o.common)==null?void 0:a.color)||`inherit`},children:[o.common.icon?l(C,{style:e.styles.icon,src:o.common.icon}):l(O,{style:e.styles.icon}),e.getText(o.common.name),l(k,{size:`small`,onClick:()=>e.removeUserFromGroup(n,e.group._id),children:l(t,{style:{color:c}})})]},r):null})})]})]})},X=[new URL(`user1-D1GAYfim.svg`,import.meta.url).href,new URL(`user2-kVvfO6hI.svg`,import.meta.url).href,new URL(`user3-B1MPu8jB.svg`,import.meta.url).href,new URL(`user4-DmVDIOoi.svg`,import.meta.url).href,new URL(`user5-DwFpzcW1.svg`,import.meta.url).href,new URL(`user6-DHgFm0fc.svg`,import.meta.url).href,new URL(`user7-DkJFgUmb.svg`,import.meta.url).href,new URL(`user8-BZA6Afc4.svg`,import.meta.url).href,new URL(`user9-BLdaSIG0.svg`,import.meta.url).href,new URL(`user10-DvWuZ_uc.svg`,import.meta.url).href,new URL(`user11-Ch5DvO34.svg`,import.meta.url).href,new URL(`user12-DEiNnJWd.svg`,import.meta.url).href],fe={contentRoot:{padding:`16px 24px`}},pe=class extends A{constructor(e){super(e),this.state={originalId:e.user._id,passwordRepeat:e.user.common.password,originalData:JSON.stringify(e.user)}}componentDidMount(){if(this.props.isNew){let e=X[Math.round(Math.random()*(X.length-1))];e&&s.getSvg(e).then(e=>{let t=s.clone(this.props.user);t.common.icon=e,this.props.onChange(t)})}}render(){let e=this.props.users.find(e=>e._id===this.props.user._id),t=this.props.user._id!==this.state.originalId,n=e=>e.split(`.`).pop()||``,r=e=>e.replace(s.FORBIDDEN_CHARS,`_`).replace(/\s/g,`_`).replace(/\./g,`_`).replace(/,/g,`_`).replace(/__/g,`_`).replace(/__/g,`_`).toLowerCase(),c=(e,t)=>{let n=e.split(`.`);return n[n.length-1]=t,n.join(`.`)},u=this.props.getText(this.props.user.common.desc),p=this.props.getText(this.props.user.common.name),m=V.checkPassword(this.props.user.common.password),g=V.checkPassword(this.props.user.common.password,this.state.passwordRepeat),_=this.props.isNew||JSON.stringify(this.props.user)!==this.state.originalData,v=this.props.user._id!==`system.user.`&&!m&&!g&&_;return(this.props.isNew&&e||e&&t)&&(v=!1),y(E,{fullWidth:this.props.innerWidth<500,open:!0,onClose:(e,t)=>{t!==`backdropClick`&&t!==`escapeKeyDown`&&this.props.onClose()},children:[l(i,{style:{...this.props.styles.dialogTitle,padding:12},children:this.props.t(`User parameters`)}),y(f,{sx:{"&.MuiDialogContent-root":{...this.props.innerWidth<500?this.props.styles.narrowContent:void 0,...fe.contentRoot}},children:[y(o,{container:!0,spacing:this.props.innerWidth<500?1:4,style:this.props.styles.dialog,children:[l(o,{size:{xs:12,md:6},children:l(q,{label:`Name`,t:this.props.t,value:p,onChange:e=>{let t=s.clone(this.props.user);!this.props.user.common.dontDelete&&r(this.props.getText(t.common.name))===n(t._id)&&(t._id=c(t._id,r(e))),t.common.name=e,this.props.onChange(t)},autoComplete:`new-password`,icon:N,styles:this.props.styles})}),l(o,{size:{xs:12,md:6},children:l(q,{label:`ID edit`,t:this.props.t,disabled:this.props.user.common.dontDelete,value:this.props.user._id.split(`.`)[this.props.user._id.split(`.`).length-1],onChange:e=>{let t=s.clone(this.props.user);t._id=c(t._id,r(e)),this.props.onChange(t)},icon:I,styles:this.props.styles})}),l(o,{size:{xs:12,md:6},children:l(q,{label:`ID preview`,t:this.props.t,disabled:!0,value:this.props.user._id,icon:R,styles:this.props.styles})}),l(o,{size:{xs:12,md:6},children:l(q,{label:`Description`,t:this.props.t,value:u,onChange:e=>{let t=s.clone(this.props.user);t.common.desc=e,this.props.onChange(t)},icon:h,styles:this.props.styles})}),l(o,{size:{xs:12,md:6},children:l(q,{label:`Password`,t:this.props.t,value:this.props.user.common.password,error:m?this.props.t(m):void 0,onChange:e=>{let t=s.clone(this.props.user);t.common.password=e,this.props.onChange(t)},type:`password`,autoComplete:`new-password`,icon:z,styles:this.props.styles})}),l(o,{size:{xs:12,md:6},children:l(q,{label:`Password repeat`,t:this.props.t,value:this.state.passwordRepeat,error:g?this.props.t(g):void 0,onChange:e=>this.setState({passwordRepeat:e}),type:`password`,autoComplete:`new-password`,icon:z,styles:this.props.styles})}),l(o,{size:{xs:12,md:6},children:l(P,{icons:X,label:`Icon`,value:this.props.user.common.icon,onChange:e=>{let t=s.clone(this.props.user);t.common.icon=e,this.props.onChange(t)},previewStyle:this.props.styles.iconPreview,icon:b})}),l(o,{size:{xs:12,md:6},children:l(J,{label:`Color`,t:this.props.t,value:this.props.user.common.color||``,previewStyle:this.props.styles.iconPreview,onChange:e=>{let t=s.clone(this.props.user);t.common.color=e,this.props.onChange(t)},icon:L,style:this.props.styles.colorPicker,styles:this.props.styles})})]}),this.props.isNew?null:this.renderOidcButton()]}),y(d,{children:[l(S,{variant:`contained`,color:`primary`,autoFocus:!0,onClick:()=>this.props.saveData(this.props.isNew?null:this.state.originalId),disabled:!v,startIcon:l(a,{}),children:this.props.t(`Save`)}),l(S,{variant:`contained`,color:`grey`,onClick:this.props.onClose,startIcon:l(D,{}),children:this.props.t(`Cancel`)})]})]})}renderOidcButton(){var e;return window.ssoActive===`true`?(e=this.props.user.common)!=null&&(e=e.externalAuthentication)!=null&&e.oidc?l(S,{variant:`contained`,color:`secondary`,fullWidth:!0,startIcon:l(oe,{}),sx:{marginTop:2},onClick:async()=>{var e;(e=this.props.user.common.externalAuthentication)==null||delete e.oidc,await this.props.saveData(this.state.originalId),window.alert(`Single-Sign On disconnected!`)},children:this.props.t(`Disconnect Single-Sign On`)}):l(S,{variant:`contained`,color:`secondary`,fullWidth:!0,onClick:()=>{window.location.href=B(`sso?redirectUrl=${encodeURIComponent(`${window.origin}${B(`#tab-users`)}`)}&method=register&user=${encodeURIComponent((this.state.originalId||this.props.user._id).replace(/^system\.user\./,``))}`)},startIcon:l(O,{}),sx:{marginTop:2},children:this.props.t(`Add Single-Sign On`)}):null}},Z=[new URL(`group1-CmFsZszo.svg`,import.meta.url).href,new URL(`group2-CuvSswwx.svg`,import.meta.url).href,new URL(`group3-CRAMNPrf.svg`,import.meta.url).href,new URL(`group4-D4IM6-jV.svg`,import.meta.url).href,new URL(`group5-T3CGkJFm.svg`,import.meta.url).href,new URL(`group6-CLVorg7G.svg`,import.meta.url).href,new URL(`group7-D-h4KR6w.svg`,import.meta.url).href,new URL(`group8-BXzJmR7Y.svg`,import.meta.url).href,`data:image/svg+xml,%3csvg%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20461.367%20461.367'%3e%3cpath%20style='fill:%231EA6C6;'%20d='M373.88,367.988c0,0.037,0,0.075,0,0.122c-37.818,34.295-88.019,55.185-143.083,55.185%20c-55.073,0-105.275-20.89-143.092-55.185c0-0.047,0-0.084,0-0.122c0-57.04,33.377-106.277,81.659-129.256%20c18.145,18.098,39.391,27.85,61.434,27.85c22.052,0,43.288-9.752,61.443-27.85C340.521,261.711,373.88,310.947,373.88,367.988z%20'/%3e%3cpath%20style='fill:%23FCD09F;'%20d='M230.797,58.571c43.71,0,79.148,35.429,79.148,79.139c0,43.719-35.438,103.504-79.148,103.504%20s-79.148-59.785-79.148-103.504C151.649,94,187.087,58.571,230.797,58.571z'/%3e%3cpath%20style='fill:%23EF806F;'%20d='M164.094,213.389c2.426,3.457,4.937,6.698,7.532,9.742l-7.897,3.756%20c-26.286,12.506-48.525,32.075-64.328,56.59c-12.853,19.944-20.909,42.427-23.71,65.865%20c-28.562-7.785-54.38-22.22-75.691-41.546v-0.103c0-49.705,29.087-92.609,71.157-112.638%20c15.813,15.775,34.323,24.272,53.527,24.272c12.581,0,24.871-3.644,36.291-10.595%20C161.977,210.307,163.026,211.862,164.094,213.389z'/%3e%3cpath%20style='fill:%23EFC59C;'%20d='M138.539,137.707c0,16.431,4.272,34.511,11.878,51.504c-7.953,5.04-16.637,8.009-25.733,8.009%20c-38.089,0-68.965-52.094-68.965-90.193c0-38.089,30.876-68.956,68.965-68.956c21.124,0,40.038,9.499,52.684,24.459%20C153.883,79.28,138.539,106.737,138.539,137.707z'/%3e%3cpath%20style='fill:%23EF806F;'%20d='M297.273,213.389c-2.426,3.457-4.937,6.698-7.532,9.742l7.897,3.756%20c26.286,12.506,48.525,32.075,64.328,56.59c12.853,19.944,20.909,42.427,23.71,65.865c28.562-7.785,54.38-22.22,75.691-41.546%20v-0.103c0-49.705-29.087-92.609-71.157-112.638c-15.813,15.775-34.323,24.272-53.527,24.272%20c-12.581,0-24.871-3.644-36.291-10.595C299.39,210.307,298.341,211.862,297.273,213.389z'/%3e%3cpath%20style='fill:%23EFC59C;'%20d='M322.828,137.707c0,16.431-4.272,34.511-11.878,51.504c7.953,5.04,16.637,8.009,25.733,8.009%20c38.089,0,68.965-52.094,68.965-90.193c0-38.089-30.876-68.956-68.965-68.956c-21.124,0-40.038,9.499-52.684,24.459%20C307.484,79.28,322.828,106.737,322.828,137.707z'/%3e%3c/svg%3e`,new URL(`group10-Dp9tRs6I.svg`,import.meta.url).href];function me(e){let t=(e,t)=>Object.values(e).map((n,r)=>{let i=Object.keys(e)[r];return t(n,i)}),r=e.group.common.acl||{},i=e=>e,a={...r,object:{read:!0,list:!0,write:!0,delete:!1,create:!1,...i(r.object)},state:{read:!0,list:!0,write:!0,delete:!1,create:!1,...i(r.state)},users:{read:!1,list:!1,write:!1,delete:!1,create:!1,...i(r.users)},other:{http:!1,execute:!1,sendto:!0,...i(r.other)},file:{read:!0,list:!0,write:!1,delete:!1,create:!1,...i(r.file)}};return l(o,{container:!0,spacing:e.innerWidth<500?1:4,style:e.styles.dialog,children:t(a,(r,i)=>y(o,{size:{xs:12,md:12},children:[l(x,{component:`h2`,sx:e.styles.permHeaders,children:e.t(`group_acl_${i}`)}),t(r,(t,r)=>l(c,{control:l(n,{disabled:e.group._id===`system.group.administrator`,checked:t,onChange:t=>{let n=s.clone(e.group);n.common.acl=s.clone(a),n.common.acl[i][r]=t.target.checked,e.onChange(n)}}),label:e.t(`group_acl_${r}`),labelPlacement:`top`},r))]},i))},`PermissionsTab`)}var he={contentRoot:{padding:`16px 24px`}},ge=class extends A{constructor(e){super(e),this.state={tab:0,originalId:e.group._id,originalData:JSON.stringify(e.group)}}componentDidMount(){if(this.props.isNew){let e=Z[Math.round(Math.random()*(Z.length-1))];e&&s.getSvg(e).then(e=>{let t=s.clone(this.props.group);t.common.icon=e,this.props.onChange(t)})}}render(){let t=this.props.groups.find(e=>e._id===this.props.group._id),n=this.props.group._id!==this.state.originalId,r=this.props.isNew||JSON.stringify(this.props.group)!==this.state.originalData,c=this.props.group._id!==`system.group.`&&this.props.group.common.password===this.props.group.common.passwordRepeat&&r,u=e=>e.split(`.`).pop()||``,p=e=>e.replace(s.FORBIDDEN_CHARS,`_`).replace(/\s/g,`_`).replace(/\./g,`_`).toLowerCase(),m=(e,t)=>{let n=e.split(`.`);return n[n.length-1]=t,n.join(`.`)};this.props.isNew?t&&(c=!1):t&&n&&(c=!1);let g=this.props.getText(this.props.group.common.desc),_=this.props.getText(this.props.group.common.name),v=[y(o,{container:!0,spacing:this.props.innerWidth<500?1:4,style:this.props.styles.dialog,children:[l(o,{size:{xs:12,md:6},children:l(q,{label:`Name`,t:this.props.t,value:_,onChange:e=>{let t=s.clone(this.props.group);!this.props.group.common.dontDelete&&p(this.props.getText(t.common.name))===u(t._id)&&(t._id=m(t._id,p(e))),t.common.name=e,this.props.onChange(t)},autoComplete:`off`,icon:N,styles:this.props.styles})}),l(o,{size:{xs:12,md:6},children:l(q,{label:`ID edit`,t:this.props.t,disabled:this.props.group.common.dontDelete,value:this.props.group._id.split(`.`)[this.props.group._id.split(`.`).length-1],onChange:e=>{let t=s.clone(this.props.group);t._id=m(t._id,p(e)),this.props.onChange(t)},icon:I,styles:this.props.styles})}),l(o,{size:{xs:12,md:6},children:l(q,{label:`ID preview`,t:this.props.t,disabled:!0,value:this.props.group._id,icon:R,styles:this.props.styles})}),l(o,{size:{xs:12,md:6},children:l(q,{label:`Description`,t:this.props.t,value:g,onChange:e=>{let t=s.clone(this.props.group);t.common.desc=e,this.props.onChange(t)},icon:h,styles:this.props.styles})}),l(o,{size:{xs:12,md:6},children:l(P,{label:`Icon`,icons:Z,value:this.props.group.common.icon,onChange:e=>{let t=s.clone(this.props.group);t.common.icon=e,this.props.onChange(t)},previewStyle:this.props.styles.iconPreview,icon:b})}),l(o,{size:{xs:12,md:6},children:l(J,{label:`Color`,t:this.props.t,value:this.props.group.common.color||``,previewStyle:this.props.styles.iconPreview,onChange:e=>{let t=s.clone(this.props.group);t.common.color=e,this.props.onChange(t)},icon:L,style:this.props.styles.colorPicker,styles:this.props.styles})})]}),me(this.props)][this.state.tab];return y(E,{open:!0,onClose:(e,t)=>{t!==`backdropClick`&&t!==`escapeKeyDown`&&this.props.onClose()},fullWidth:this.props.innerWidth<500,children:[l(i,{style:this.props.styles.dialogTitle,children:y(te,{variant:`fullWidth`,value:this.state.tab,onChange:(e,t)=>this.setState({tab:t}),children:[l(e,{label:this.props.t(`Main`),value:0}),l(e,{label:this.props.t(`Permissions`),value:1})]})}),l(f,{sx:{"&.MuiDialogContent-root":{...this.props.innerWidth<500?this.props.styles.narrowContent:void 0,...he.contentRoot}},children:v}),y(d,{style:this.props.styles.dialogActions,children:[l(S,{variant:`contained`,color:`primary`,autoFocus:!0,onClick:()=>this.props.saveData(this.props.isNew?null:this.state.originalId),disabled:!c,startIcon:l(a,{}),children:this.props.t(`Save`)}),l(S,{variant:`contained`,color:`grey`,onClick:this.props.onClose,startIcon:l(D,{}),children:this.props.t(`Cancel`)})]})]})}};function _e(e){return y(E,{open:!0,onClose:e.onClose,children:[l(i,{children:e.t(`Please confirm`)}),l(f,{children:l(p,{children:e.t(`Do you want to delete user %s?`,e.getText(e.user.common.name))})}),y(d,{children:[l(S,{variant:`contained`,color:`primary`,onClick:()=>e.deleteUser(e.user._id),startIcon:l(v,{}),children:e.t(`Delete`)}),l(S,{variant:`contained`,color:`grey`,autoFocus:!0,onClick:e.onClose,startIcon:l(D,{}),children:e.t(`Cancel`)})]})]})}function ve(e){return y(E,{open:!0,onClose:e.onClose,children:[l(i,{children:e.t(`Please confirm`)}),l(f,{children:l(p,{children:e.t(`Do you want to delete group %s?`,e.getText(e.group.common.name))})}),y(d,{style:e.styles.dialogActions,children:[l(S,{variant:`contained`,color:`primary`,onClick:()=>e.deleteGroup(e.group._id),startIcon:l(v,{}),children:e.t(`Delete`)}),l(S,{variant:`contained`,color:`grey`,autoFocus:!0,onClick:e.onClose,startIcon:l(D,{}),children:e.t(`Cancel`)})]})]})}r();var Q=`***********`,ye=`0 1px 1px 0 rgba(0, 0, 0, .4),0 6px 6px 0 rgba(0, 0, 0, .2)`,$={mainGridCont:{height:`calc(100% - 55px)`,overflowY:`auto`},childGridCont:{display:`flex`,flexDirection:`column`},childGridContWide:{height:`100%`},canDrop:e=>({backgroundColor:e.palette.background.default}),headContainer:{margin:10},blocksContainer:{overflowY:`auto`,overflowX:`hidden`},userGroupCard2:e=>({border:`1px solid #FFF`,borderColor:e.palette.divider,m:`10px`,minHeight:150,backgroundColor:e.palette.background.default,color:e.palette.text.primary,transition:`all 200ms ease-out`,opacity:1,overflow:`hidden`,"&:hover":{overflowY:`auto`,boxShadow:ye}}),userGroupCardSecondary:e=>({color:e.palette.text.primary,backgroundColor:e.palette.success.light}),permHeaders:e=>({backgroundColor:e.palette.mode===`dark`?e.palette.background.default:e.palette.primary.main,p:`4px`,borderRadius:`2px`,color:`#EEE`}),userCardContent:{height:`100%`,opacity:1},userGroupTitle:{display:`inline-flex`,alignItems:`center`},userGroupUserName:{fontWeight:900,padding:5},userGroupUserID:{opacity:.7,padding:5},description:{fontSize:10,fontStyle:`italic`,marginLeft:5,opacity:.7},userGroupMember:e=>({display:`inline-flex`,m:`4px`,p:`4px`,backgroundColor:`#00000010`,border:`1px solid #FFF`,borderColor:e.palette.text.primary,color:e.palette.text.primary,alignItems:`center`}),icon:{height:32,width:32,marginRight:5,backgroundSize:`cover`,backgroundPosition:`center`},right:{float:`right`},left:{float:`left`,marginRight:10},dialog:{},flex:{display:`flex`},formControl:{display:`flex`,padding:24,flexGrow:1e3},formContainer:{display:`flex`,justifyContent:`center`,alignItems:`center`},formIcon:{margin:10,opacity:.6},descriptionPanel:e=>({width:`100%`,backgroundColor:`transparent`,mb:`20px`,mt:`20px`,ml:`20px`,opacity:.75,border:`none`,display:`flex`,alignItems:`center`,"& a":{pl:`3px`,color:e.palette.mode===`dark`?`#EEE`:`#111`}}),dialogTitle:{borderBottom:`1px solid #00000020`,padding:0,width:`100%`},dialogActions:{borderTop:`1px solid #00000020`,width:`100%`},dialogPaper:{overflowY:`initial`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,width:`calc(100% - 100px)`,height:`calc(100% - 100px)`,maxWidth:800,maxHeight:`100%`},dialogPaperMini:{maxHeight:300},colorPicker:{},iconPreview:{height:40,width:40},mainDescription:{fontSize:`200%`},deleteDialog:{padding:20},narrowContent:{padding:`8px 8px 8px 8px`}},be=()=>{let e=ce();return e.display?l(`div`,{style:e.style,children:e.item.preview}):null},xe={_id:`system.user.`,type:`user`,common:{name:``,password:``,enabled:!0,color:``,desc:``},native:{},enums:{}},Se={_id:``,native:{},type:`group`,common:{name:``,desc:``,members:[],dontDelete:!0,acl:{object:{list:!1,read:!1,write:!1,delete:!1,create:!1},state:{list:!1,read:!1,write:!1,create:!1,delete:!1},users:{list:!1,read:!1,write:!1,create:!1,delete:!1},other:{execute:!1,http:!1,sendto:!1},file:{list:!1,read:!1,write:!1,create:!1,delete:!1}},icon:``,color:``}},Ce=class e extends A{constructor(e){super(e),_(this,`getText`,e=>e&&(typeof e==`object`?e[this.props.lang]||e.en||``:e||``)||``),_(this,`showUserEditDialog`,(e,t)=>{e=s.clone(e),e.common.password=e.common.password?Q:``,this.setState({userEditDialog:e,userEditDialogNew:t})}),_(this,`showGroupEditDialog`,(e,t)=>{e=s.clone(e),this.setState({groupEditDialog:e,groupEditDialogNew:t})}),_(this,`updateData`,()=>{let e;return this.props.socket.getForeignObjects(`system.user.*`,`user`).then(t=>(e=Object.values(t).sort((e,t)=>e._id>t._id?1:-1),e.forEach(e=>{e.common&&e.common.description&&(e.common.desc||(e.common.desc=e.common.description),delete e.common.description)}),this.props.socket.getForeignObjects(`system.group.*`,`group`))).then(t=>{let n=Object.values(t).sort((e,t)=>e._id>t._id?1:-1);n.forEach(e=>{e.common&&e.common.description&&(e.common.desc||(e.common.desc=e.common.description),delete e.common.description)}),this.setState({groups:n,users:e})})}),_(this,`changeUserFormData`,e=>this.setState({userEditDialog:e})),_(this,`changeGroupFormData`,e=>this.setState({groupEditDialog:e})),_(this,`saveUser`,async e=>{var t;let n=s.clone(this.state.userEditDialog),r=(t=this.state.users)==null?void 0:t.find(e=>e._id===n._id),i=n.common.password&&n.common.password!==Q?n.common.password:``;if(r?n.common.password=r.common.password:n.common.password=``,await this.props.socket.setObject(n._id,n),typeof this.state.userEditDialog==`object`&&e&&e!==this.state.userEditDialog._id)try{await this.props.socket.delObject(e);let t=this.state.groups||[];for(let r=0;r<t.length;r++){let i=t[r];if(i.common.members.includes(e)){let t=s.clone(i);t.common.members[t.common.members.indexOf(e)]=n._id,await this.props.socket.setObject(t._id,t)}}}catch(e){window.alert(`Cannot delete user: ${e}`)}if(i)try{await this.props.socket.changePassword(n._id,i)}catch(e){window.alert(`Cannot change password: ${e}`)}this.setState({userEditDialog:!1},()=>this.updateData())}),_(this,`saveGroup`,async e=>{if(typeof this.state.groupEditDialog==`object`){if(await this.props.socket.setObject(this.state.groupEditDialog._id,this.state.groupEditDialog),e&&e!==this.state.groupEditDialog._id)try{await this.props.socket.delObject(e)}catch(e){window.alert(`Cannot delete user: ${e}`)}this.setState({groupEditDialog:!1},()=>this.updateData())}}),_(this,`showUserDeleteDialog`,e=>this.setState({userDeleteDialog:e})),_(this,`showGroupDeleteDialog`,e=>this.setState({groupDeleteDialog:e})),_(this,`deleteUser`,e=>{this.props.socket.delObject(e).then(()=>Promise.all((this.state.groups||[]).map(t=>{if(t.common.members.includes(e)){let n=s.clone(t);return n.common.members.splice(n.common.members.indexOf(e),1),this.props.socket.setObject(n._id,n)}return Promise.resolve(null)}))).catch(e=>window.alert(`Cannot delete user: ${e}`)).then(()=>{this.setState({userDeleteDialog:!1},()=>this.updateData())})}),_(this,`deleteGroup`,e=>this.props.socket.delObject(e).then(()=>this.setState({groupDeleteDialog:!1},()=>this.updateData())).catch(e=>window.alert(`Cannot delete user: ${e}`))),_(this,`addUserToGroup`,(e,t)=>{var n;let r=(n=this.state.groups)==null?void 0:n.find(e=>e._id===t),i=(r==null?void 0:r.common.members)||[];r&&!i.includes(e)&&(i.push(e),this.props.socket.setObject(r._id,r).then(()=>this.updateData()).catch(e=>window.alert(`Cannot delete user: ${e}`)))}),_(this,`removeUserFromGroup`,(e,t)=>{var n;let r=(n=this.state.groups)==null?void 0:n.find(e=>e._id===t),i=(r==null?void 0:r.common.members)||[];r&&i.includes(e)&&(i.splice(i.indexOf(e),1),this.props.socket.setObject(r._id,r).then(()=>this.updateData()))}),this.state={users:null,groups:null,userEditDialog:!1,userEditDialogNew:!1,groupEditDialog:!1,groupEditDialogNew:!1,userDeleteDialog:!1,groupDeleteDialog:!1,innerWidth:0}}componentDidMount(){this.setState({innerWidth:window.innerWidth},()=>this.updateData())}componentDidUpdate(){window.innerWidth!==this.state.innerWidth&&setTimeout(()=>this.setState({innerWidth:window.innerWidth}),100)}static _isUniqueName(e,t,n){return!e.find(e=>e._id===`system.user.${t.toLowerCase()}_${n}`||e.common.name===`${t} ${n}`)}static findNewUniqueName(t,n,r){let i=1;for(;!e._isUniqueName(n,r,i);)i++;return{_id:`system.${t?`group`:`user`}.${r.toLowerCase()}_${i}`,name:`${r} ${i}`}}render(){return!this.state.users||!this.state.groups?l(ee,{}):y(K,{backend:V.isTouchDevice()?W:G,children:[l(be,{}),l(x,{component:`div`,sx:$.descriptionPanel,children:this.props.t(`You can drag users to groups.`)}),y(o,{container:!0,spacing:2,style:$.mainGridCont,children:[y(o,{size:{xs:12,md:6},style:{...$.childGridCont,...this.state.innerWidth>600?$.childGridContWide:void 0},children:[y(`div`,{style:$.headContainer,children:[l(F,{size:`small`,style:$.right,onClick:()=>{let{_id:t,name:n}=e.findNewUniqueName(!0,this.state.groups||[],this.props.t(`Group`)),r=s.clone(Se);r._id=t,r.common.name=n,this.showGroupEditDialog(r,!0)},children:l(ae,{})}),l(T,{gutterBottom:!0,variant:`h4`,component:`h4`,children:this.props.t(`Groups`)})]}),l(`div`,{style:$.blocksContainer,children:this.state.groups.sort((e,t)=>{var n,r;let i=(this.getText(e==null||(n=e.common)==null?void 0:n.name)||e._id).toLowerCase(),a=(this.getText(t==null||(r=t.common)==null?void 0:r.name)||t._id).toLowerCase();return i>a?1:i<a?-1:0}).map(e=>l(de,{group:e,users:this.state.users||[],showGroupEditDialog:this.showGroupEditDialog,showGroupDeleteDialog:this.showGroupDeleteDialog,removeUserFromGroup:this.removeUserFromGroup,getText:this.getText,styles:$,...this.props},e._id))})]}),y(o,{size:{xs:12,md:6},style:{...$.childGridCont,...this.state.innerWidth>600?$.childGridContWide:void 0},children:[y(`div`,{style:$.headContainer,children:[l(F,{size:`small`,style:$.right,onClick:()=>{let{_id:t,name:n}=e.findNewUniqueName(!1,this.state.users||[],this.props.t(`User`)),r=s.clone(xe);r._id=t,r.common.name=n,this.showUserEditDialog(r,!0)},children:l(ie,{})}),l(T,{gutterBottom:!0,variant:`h4`,component:`h4`,children:this.props.t(`Users`)})]}),l(`div`,{style:$.blocksContainer,children:this.state.users.sort((e,t)=>{var n,r;let i=(this.getText(e==null||(n=e.common)==null?void 0:n.name)||e._id).toLowerCase(),a=(this.getText(t==null||(r=t.common)==null?void 0:r.name)||t._id).toLowerCase();return i>a?1:i<a?-1:0}).map(e=>l(le,{user:e,groups:this.state.groups||[],showUserEditDialog:this.showUserEditDialog,showUserDeleteDialog:this.showUserDeleteDialog,updateData:this.updateData,addUserToGroup:this.addUserToGroup,removeUserFromGroup:this.removeUserFromGroup,getText:this.getText,styles:$,...this.props},e._id))})]})]}),this.state.userEditDialog?l(pe,{onClose:()=>this.setState({userEditDialog:!1}),users:this.state.users,user:this.state.userEditDialog,isNew:this.state.userEditDialogNew,t:this.props.t,getText:this.getText,styles:$,onChange:this.changeUserFormData,saveData:this.saveUser,innerWidth:this.state.innerWidth}):null,this.state.groupEditDialog?l(ge,{onClose:()=>this.setState({groupEditDialog:!1}),groups:this.state.groups,group:this.state.groupEditDialog,isNew:this.state.groupEditDialogNew,t:this.props.t,getText:this.getText,styles:$,onChange:this.changeGroupFormData,innerWidth:this.state.innerWidth,saveData:this.saveGroup}):null,this.state.userDeleteDialog?l(_e,{getText:this.getText,onClose:()=>this.setState({userDeleteDialog:!1}),user:this.state.userDeleteDialog,t:this.props.t,deleteUser:this.deleteUser}):null,this.state.groupDeleteDialog?l(ve,{getText:this.getText,onClose:()=>this.setState({groupDeleteDialog:!1}),group:this.state.groupDeleteDialog,t:this.props.t,styles:$,deleteGroup:this.deleteGroup}):null]})}};function we(e){return l(m,{children:l(re,{style:{display:`flex`,flexDirection:`column`,overflow:`auto`},children:l(Ce,{t:e.t,lang:e.lang,socket:e.socket,ready:e.ready,expertMode:e.expertMode,themeType:e.themeType,theme:e.theme})})})}export{we as default};
|
|
1
|
+
import{$a as e,$i as t,Eo as n,Es as r,Fo as i,Ga as a,Go as o,Gr as s,Ho as c,Hs as l,Kn as u,Mo as d,No as f,Po as p,Rr as m,Sa as h,So as g,Ts as _,Ua as v,Us as y,Zo as ee,_a as b,_o as x,bo as S,br as C,co as te,fc as w,ho as T,jo as E,qa as D,qn as O,qo as k,sc as ne,tc as A,wo as j,xa as M,xi as N,xr as P,zo as F,zr as re}from"./loadShare-eager-CRNcc8D7.js";import{n as I,r as L,t as R}from"./Pageview-DBITLOzI.js";import{n as ie,r as ae,t as oe}from"./PersonOff-ANdO5Nu4.js";import{t as z}from"./VpnKey-iMA7KrB-.js";import{o as B,t as V}from"./AdminUtils-DDT_kD8H.js";import{B as H,H as U,L as W,R as G,W as K,z as se}from"./bootstrap-D-7xcwTc.js";import{n as q,r as ce,t as J}from"./Fields-Df7Llf6U.js";var Y=e=>{let r=+!e.isDragging,i=s.getInvertedColor(e.user.common.color,e.themeType,!0),a={cursor:`grab`,opacity:r,overflow:`hidden`,color:i};return e.user.common.color&&(a.backgroundColor=e.user.common.color),l(g,{style:a,sx:e.styles.userGroupCard2,children:y(`div`,{style:e.styles.userCardContent,children:[y(`div`,{style:e.styles.right,children:[l(n,{checked:e.user.common.enabled,style:{color:i},disabled:e.user.common.dontDelete,onChange:()=>{e.socket.extendObject(e.user._id,{common:{enabled:!e.user.common.enabled}}).then(()=>e.updateData())}}),l(k,{size:`small`,onClick:()=>e.showUserEditDialog(e.user,!1),children:l(M,{style:{color:i}})}),l(k,{size:`small`,onClick:()=>e.showUserDeleteDialog(e.user),disabled:e.user.common.dontDelete,children:l(v,{style:e.user.common.dontDelete?void 0:{color:i}})})]}),y(j,{children:[y(T,{gutterBottom:!0,component:`div`,style:e.styles.userGroupTitle,children:[e.user.common.icon?l(C,{style:e.styles.icon,src:e.user.common.icon}):l(O,{style:e.styles.icon}),y(`div`,{children:[y(`div`,{children:[l(`span`,{style:e.styles.userGroupUserName,children:e.getText(e.user.common.name)}),y(`span`,{style:e.styles.userGroupUserID,children:[`[`,e.user._id,`]`]})]}),l(`span`,{children:e.user.common.desc?l(`div`,{style:e.styles.description,children:e.getText(e.user.common.desc)}):null})]})]}),e.groups.find(t=>t.common.members&&t.common.members.includes(e.user._id))?y(`div`,{children:[e.t(`In groups`),`:`]}):null,l(`div`,{children:e.groups.map(n=>{var r,a;if(!n.common.members||!n.common.members.includes(e.user._id))return null;let o=n&&(r=n.common)!=null&&r.color?s.getInvertedColor(n.common.color,e.themeType,!0):i;return y(g,{variant:`outlined`,sx:e.styles.userGroupMember,style:{color:o,borderColor:`${o}80`,background:((a=n.common)==null?void 0:a.color)||`inherit`},children:[n.common.icon?l(C,{style:e.styles.icon,src:n.common.icon}):l(u,{style:e.styles.icon}),e.getText(n.common.name),l(k,{size:`small`,onClick:()=>e.removeUserFromGroup(e.user._id,n._id),children:l(t,{style:{color:o}})})]},n._id)})})]})]})})},le=e=>{let t=w(null),[{isDragging:n},r,i]=U({type:`user`,item:()=>{var n;return{userId:e.user._id,preview:l(`div`,{style:{width:(n=t.current)==null?void 0:n.offsetWidth},children:l(Y,{...e})})}},end:(t,n)=>{let r=n.getDropResult();if(t&&r){var i;(i=e.addUserToGroup)==null||i.call(e,t.userId,r.groupId)}},collect:e=>({isDragging:e.isDragging(),handlerId:e.getHandlerId()})});return ne(()=>{i(se(),{captureDraggingState:!0})},[i]),l(`div`,{ref:e=>{r(e)},children:l(`div`,{ref:t,children:l(Y,{isDragging:n,...e})})})};function ue(e,t){return!t.group.common.members||!t.group.common.members.includes(e.getItem().userId)}var de=e=>{var n;let[{CanDrop:r,isOver:i},a]=H(()=>({accept:`user`,drop:()=>({groupId:e.group._id}),canDrop:(t,n)=>ue(n,e),collect:e=>({isOver:e.isOver(),CanDrop:e.canDrop()})}),[e.group.common.members]),o=.7,c;r&&i?(o=r?1:.125,c=e.styles.userGroupCardSecondary):r&&(o=r?.75:.25);let d=s.getInvertedColor(e.group.common.color,e.themeType,!0),f={opacity:o,overflow:`hidden`,color:d};return e.group.common.color&&(f.backgroundColor=e.group.common.color),y(g,{style:f,ref:e=>{a(e)},sx:s.getStyle(e.theme,e.styles.userGroupCard2,c),children:[y(`div`,{style:e.styles.right,children:[l(k,{size:`small`,onClick:()=>e.showGroupEditDialog(e.group,!1),children:l(M,{style:{color:d}})}),l(k,{size:`small`,onClick:()=>e.showGroupDeleteDialog(e.group),disabled:e.group.common.dontDelete,children:l(v,{style:e.group.common.dontDelete?void 0:{color:d}})})]}),y(j,{children:[y(T,{gutterBottom:!0,component:`div`,style:e.styles.userGroupTitle,children:[e.group.common.icon?l(C,{style:e.styles.icon,src:e.group.common.icon}):l(u,{style:e.styles.icon}),y(`div`,{children:[y(`div`,{children:[l(`span`,{style:e.styles.userGroupUserName,children:e.getText(e.group.common.name)}),y(`span`,{children:[`[`,e.group._id,`]`]})]}),e.group.common.desc?l(`div`,{style:e.styles.description,children:e.getText(e.group.common.desc)}):null]})]}),(n=e.group.common.members)!=null&&n.length?y(`div`,{children:[e.t(`Group members`),`:`]}):null,l(`div`,{children:(e.group.common.members||[]).map((n,r)=>{var i,a;let o=e.users.find(e=>e._id===n),c=o&&(i=o.common)!=null&&i.color?s.getInvertedColor(o.common.color,e.themeType,!0):d;return o?y(g,{variant:`outlined`,sx:e.styles.userGroupMember,style:{color:c,borderColor:`${c}40`,background:((a=o.common)==null?void 0:a.color)||`inherit`},children:[o.common.icon?l(C,{style:e.styles.icon,src:o.common.icon}):l(O,{style:e.styles.icon}),e.getText(o.common.name),l(k,{size:`small`,onClick:()=>e.removeUserFromGroup(n,e.group._id),children:l(t,{style:{color:c}})})]},r):null})})]})]})},X=[new URL(`user1-D1GAYfim.svg`,import.meta.url).href,new URL(`user2-kVvfO6hI.svg`,import.meta.url).href,new URL(`user3-B1MPu8jB.svg`,import.meta.url).href,new URL(`user4-DmVDIOoi.svg`,import.meta.url).href,new URL(`user5-DwFpzcW1.svg`,import.meta.url).href,new URL(`user6-DHgFm0fc.svg`,import.meta.url).href,new URL(`user7-DkJFgUmb.svg`,import.meta.url).href,new URL(`user8-BZA6Afc4.svg`,import.meta.url).href,new URL(`user9-BLdaSIG0.svg`,import.meta.url).href,new URL(`user10-DvWuZ_uc.svg`,import.meta.url).href,new URL(`user11-Ch5DvO34.svg`,import.meta.url).href,new URL(`user12-DEiNnJWd.svg`,import.meta.url).href],fe={contentRoot:{padding:`16px 24px`}},pe=class extends A{constructor(e){super(e),this.state={originalId:e.user._id,passwordRepeat:e.user.common.password,originalData:JSON.stringify(e.user)}}componentDidMount(){if(this.props.isNew){let e=X[Math.round(Math.random()*(X.length-1))];e&&s.getSvg(e).then(e=>{let t=s.clone(this.props.user);t.common.icon=e,this.props.onChange(t)})}}render(){let e=this.props.users.find(e=>e._id===this.props.user._id),t=this.props.user._id!==this.state.originalId,n=e=>e.split(`.`).pop()||``,r=e=>e.replace(s.FORBIDDEN_CHARS,`_`).replace(/\s/g,`_`).replace(/\./g,`_`).replace(/,/g,`_`).replace(/__/g,`_`).replace(/__/g,`_`).toLowerCase(),c=(e,t)=>{let n=e.split(`.`);return n[n.length-1]=t,n.join(`.`)},u=this.props.getText(this.props.user.common.desc),p=this.props.getText(this.props.user.common.name),m=V.checkPassword(this.props.user.common.password),g=V.checkPassword(this.props.user.common.password,this.state.passwordRepeat),_=this.props.isNew||JSON.stringify(this.props.user)!==this.state.originalData,v=this.props.user._id!==`system.user.`&&!m&&!g&&_;return(this.props.isNew&&e||e&&t)&&(v=!1),y(E,{fullWidth:this.props.innerWidth<500,open:!0,onClose:(e,t)=>{t!==`backdropClick`&&t!==`escapeKeyDown`&&this.props.onClose()},children:[l(i,{style:{...this.props.styles.dialogTitle,padding:12},children:this.props.t(`User parameters`)}),y(f,{sx:{"&.MuiDialogContent-root":{...this.props.innerWidth<500?this.props.styles.narrowContent:void 0,...fe.contentRoot}},children:[y(o,{container:!0,spacing:this.props.innerWidth<500?1:4,style:this.props.styles.dialog,children:[l(o,{size:{xs:12,md:6},children:l(q,{label:`Name`,t:this.props.t,value:p,onChange:e=>{let t=s.clone(this.props.user);!this.props.user.common.dontDelete&&r(this.props.getText(t.common.name))===n(t._id)&&(t._id=c(t._id,r(e))),t.common.name=e,this.props.onChange(t)},autoComplete:`new-password`,icon:N,styles:this.props.styles})}),l(o,{size:{xs:12,md:6},children:l(q,{label:`ID edit`,t:this.props.t,disabled:this.props.user.common.dontDelete,value:this.props.user._id.split(`.`)[this.props.user._id.split(`.`).length-1],onChange:e=>{let t=s.clone(this.props.user);t._id=c(t._id,r(e)),this.props.onChange(t)},icon:I,styles:this.props.styles})}),l(o,{size:{xs:12,md:6},children:l(q,{label:`ID preview`,t:this.props.t,disabled:!0,value:this.props.user._id,icon:R,styles:this.props.styles})}),l(o,{size:{xs:12,md:6},children:l(q,{label:`Description`,t:this.props.t,value:u,onChange:e=>{let t=s.clone(this.props.user);t.common.desc=e,this.props.onChange(t)},icon:h,styles:this.props.styles})}),l(o,{size:{xs:12,md:6},children:l(q,{label:`Password`,t:this.props.t,value:this.props.user.common.password,error:m?this.props.t(m):void 0,onChange:e=>{let t=s.clone(this.props.user);t.common.password=e,this.props.onChange(t)},type:`password`,autoComplete:`new-password`,icon:z,styles:this.props.styles})}),l(o,{size:{xs:12,md:6},children:l(q,{label:`Password repeat`,t:this.props.t,value:this.state.passwordRepeat,error:g?this.props.t(g):void 0,onChange:e=>this.setState({passwordRepeat:e}),type:`password`,autoComplete:`new-password`,icon:z,styles:this.props.styles})}),l(o,{size:{xs:12,md:6},children:l(P,{icons:X,label:`Icon`,value:this.props.user.common.icon,onChange:e=>{let t=s.clone(this.props.user);t.common.icon=e,this.props.onChange(t)},previewStyle:this.props.styles.iconPreview,icon:b})}),l(o,{size:{xs:12,md:6},children:l(J,{label:`Color`,t:this.props.t,value:this.props.user.common.color||``,previewStyle:this.props.styles.iconPreview,onChange:e=>{let t=s.clone(this.props.user);t.common.color=e,this.props.onChange(t)},icon:L,style:this.props.styles.colorPicker,styles:this.props.styles})})]}),this.props.isNew?null:this.renderOidcButton()]}),y(d,{children:[l(S,{variant:`contained`,color:`primary`,autoFocus:!0,onClick:()=>this.props.saveData(this.props.isNew?null:this.state.originalId),disabled:!v,startIcon:l(a,{}),children:this.props.t(`Save`)}),l(S,{variant:`contained`,color:`grey`,onClick:this.props.onClose,startIcon:l(D,{}),children:this.props.t(`Cancel`)})]})]})}renderOidcButton(){var e;return window.ssoActive===`true`?(e=this.props.user.common)!=null&&(e=e.externalAuthentication)!=null&&e.oidc?l(S,{variant:`contained`,color:`secondary`,fullWidth:!0,startIcon:l(oe,{}),sx:{marginTop:2},onClick:async()=>{var e;(e=this.props.user.common.externalAuthentication)==null||delete e.oidc,await this.props.saveData(this.state.originalId),window.alert(`Single-Sign On disconnected!`)},children:this.props.t(`Disconnect Single-Sign On`)}):l(S,{variant:`contained`,color:`secondary`,fullWidth:!0,onClick:()=>{window.location.href=B(`sso?redirectUrl=${encodeURIComponent(`${window.origin}${B(`#tab-users`)}`)}&method=register&user=${encodeURIComponent((this.state.originalId||this.props.user._id).replace(/^system\.user\./,``))}`)},startIcon:l(O,{}),sx:{marginTop:2},children:this.props.t(`Add Single-Sign On`)}):null}},Z=[new URL(`group1-CmFsZszo.svg`,import.meta.url).href,new URL(`group2-CuvSswwx.svg`,import.meta.url).href,new URL(`group3-CRAMNPrf.svg`,import.meta.url).href,new URL(`group4-D4IM6-jV.svg`,import.meta.url).href,new URL(`group5-T3CGkJFm.svg`,import.meta.url).href,new URL(`group6-CLVorg7G.svg`,import.meta.url).href,new URL(`group7-D-h4KR6w.svg`,import.meta.url).href,new URL(`group8-BXzJmR7Y.svg`,import.meta.url).href,`data:image/svg+xml,%3csvg%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20461.367%20461.367'%3e%3cpath%20style='fill:%231EA6C6;'%20d='M373.88,367.988c0,0.037,0,0.075,0,0.122c-37.818,34.295-88.019,55.185-143.083,55.185%20c-55.073,0-105.275-20.89-143.092-55.185c0-0.047,0-0.084,0-0.122c0-57.04,33.377-106.277,81.659-129.256%20c18.145,18.098,39.391,27.85,61.434,27.85c22.052,0,43.288-9.752,61.443-27.85C340.521,261.711,373.88,310.947,373.88,367.988z%20'/%3e%3cpath%20style='fill:%23FCD09F;'%20d='M230.797,58.571c43.71,0,79.148,35.429,79.148,79.139c0,43.719-35.438,103.504-79.148,103.504%20s-79.148-59.785-79.148-103.504C151.649,94,187.087,58.571,230.797,58.571z'/%3e%3cpath%20style='fill:%23EF806F;'%20d='M164.094,213.389c2.426,3.457,4.937,6.698,7.532,9.742l-7.897,3.756%20c-26.286,12.506-48.525,32.075-64.328,56.59c-12.853,19.944-20.909,42.427-23.71,65.865%20c-28.562-7.785-54.38-22.22-75.691-41.546v-0.103c0-49.705,29.087-92.609,71.157-112.638%20c15.813,15.775,34.323,24.272,53.527,24.272c12.581,0,24.871-3.644,36.291-10.595%20C161.977,210.307,163.026,211.862,164.094,213.389z'/%3e%3cpath%20style='fill:%23EFC59C;'%20d='M138.539,137.707c0,16.431,4.272,34.511,11.878,51.504c-7.953,5.04-16.637,8.009-25.733,8.009%20c-38.089,0-68.965-52.094-68.965-90.193c0-38.089,30.876-68.956,68.965-68.956c21.124,0,40.038,9.499,52.684,24.459%20C153.883,79.28,138.539,106.737,138.539,137.707z'/%3e%3cpath%20style='fill:%23EF806F;'%20d='M297.273,213.389c-2.426,3.457-4.937,6.698-7.532,9.742l7.897,3.756%20c26.286,12.506,48.525,32.075,64.328,56.59c12.853,19.944,20.909,42.427,23.71,65.865c28.562-7.785,54.38-22.22,75.691-41.546%20v-0.103c0-49.705-29.087-92.609-71.157-112.638c-15.813,15.775-34.323,24.272-53.527,24.272%20c-12.581,0-24.871-3.644-36.291-10.595C299.39,210.307,298.341,211.862,297.273,213.389z'/%3e%3cpath%20style='fill:%23EFC59C;'%20d='M322.828,137.707c0,16.431-4.272,34.511-11.878,51.504c7.953,5.04,16.637,8.009,25.733,8.009%20c38.089,0,68.965-52.094,68.965-90.193c0-38.089-30.876-68.956-68.965-68.956c-21.124,0-40.038,9.499-52.684,24.459%20C307.484,79.28,322.828,106.737,322.828,137.707z'/%3e%3c/svg%3e`,new URL(`group10-Dp9tRs6I.svg`,import.meta.url).href];function me(e){let t=(e,t)=>Object.values(e).map((n,r)=>{let i=Object.keys(e)[r];return t(n,i)}),r=e.group.common.acl||{},i=e=>e,a={...r,object:{read:!0,list:!0,write:!0,delete:!1,create:!1,...i(r.object)},state:{read:!0,list:!0,write:!0,delete:!1,create:!1,...i(r.state)},users:{read:!1,list:!1,write:!1,delete:!1,create:!1,...i(r.users)},other:{http:!1,execute:!1,sendto:!0,...i(r.other)},file:{read:!0,list:!0,write:!1,delete:!1,create:!1,...i(r.file)}};return l(o,{container:!0,spacing:e.innerWidth<500?1:4,style:e.styles.dialog,children:t(a,(r,i)=>y(o,{size:{xs:12,md:12},children:[l(x,{component:`h2`,sx:e.styles.permHeaders,children:e.t(`group_acl_${i}`)}),t(r,(t,r)=>l(c,{control:l(n,{disabled:e.group._id===`system.group.administrator`,checked:t,onChange:t=>{let n=s.clone(e.group);n.common.acl=s.clone(a),n.common.acl[i][r]=t.target.checked,e.onChange(n)}}),label:e.t(`group_acl_${r}`),labelPlacement:`top`},r))]},i))},`PermissionsTab`)}var he={contentRoot:{padding:`16px 24px`}},ge=class extends A{constructor(e){super(e),this.state={tab:0,originalId:e.group._id,originalData:JSON.stringify(e.group)}}componentDidMount(){if(this.props.isNew){let e=Z[Math.round(Math.random()*(Z.length-1))];e&&s.getSvg(e).then(e=>{let t=s.clone(this.props.group);t.common.icon=e,this.props.onChange(t)})}}render(){let t=this.props.groups.find(e=>e._id===this.props.group._id),n=this.props.group._id!==this.state.originalId,r=this.props.isNew||JSON.stringify(this.props.group)!==this.state.originalData,c=this.props.group._id!==`system.group.`&&this.props.group.common.password===this.props.group.common.passwordRepeat&&r,u=e=>e.split(`.`).pop()||``,p=e=>e.replace(s.FORBIDDEN_CHARS,`_`).replace(/\s/g,`_`).replace(/\./g,`_`).toLowerCase(),m=(e,t)=>{let n=e.split(`.`);return n[n.length-1]=t,n.join(`.`)};this.props.isNew?t&&(c=!1):t&&n&&(c=!1);let g=this.props.getText(this.props.group.common.desc),_=this.props.getText(this.props.group.common.name),v=[y(o,{container:!0,spacing:this.props.innerWidth<500?1:4,style:this.props.styles.dialog,children:[l(o,{size:{xs:12,md:6},children:l(q,{label:`Name`,t:this.props.t,value:_,onChange:e=>{let t=s.clone(this.props.group);!this.props.group.common.dontDelete&&p(this.props.getText(t.common.name))===u(t._id)&&(t._id=m(t._id,p(e))),t.common.name=e,this.props.onChange(t)},autoComplete:`off`,icon:N,styles:this.props.styles})}),l(o,{size:{xs:12,md:6},children:l(q,{label:`ID edit`,t:this.props.t,disabled:this.props.group.common.dontDelete,value:this.props.group._id.split(`.`)[this.props.group._id.split(`.`).length-1],onChange:e=>{let t=s.clone(this.props.group);t._id=m(t._id,p(e)),this.props.onChange(t)},icon:I,styles:this.props.styles})}),l(o,{size:{xs:12,md:6},children:l(q,{label:`ID preview`,t:this.props.t,disabled:!0,value:this.props.group._id,icon:R,styles:this.props.styles})}),l(o,{size:{xs:12,md:6},children:l(q,{label:`Description`,t:this.props.t,value:g,onChange:e=>{let t=s.clone(this.props.group);t.common.desc=e,this.props.onChange(t)},icon:h,styles:this.props.styles})}),l(o,{size:{xs:12,md:6},children:l(P,{label:`Icon`,icons:Z,value:this.props.group.common.icon,onChange:e=>{let t=s.clone(this.props.group);t.common.icon=e,this.props.onChange(t)},previewStyle:this.props.styles.iconPreview,icon:b})}),l(o,{size:{xs:12,md:6},children:l(J,{label:`Color`,t:this.props.t,value:this.props.group.common.color||``,previewStyle:this.props.styles.iconPreview,onChange:e=>{let t=s.clone(this.props.group);t.common.color=e,this.props.onChange(t)},icon:L,style:this.props.styles.colorPicker,styles:this.props.styles})})]}),me(this.props)][this.state.tab];return y(E,{open:!0,onClose:(e,t)=>{t!==`backdropClick`&&t!==`escapeKeyDown`&&this.props.onClose()},fullWidth:this.props.innerWidth<500,children:[l(i,{style:this.props.styles.dialogTitle,children:y(te,{variant:`fullWidth`,value:this.state.tab,onChange:(e,t)=>this.setState({tab:t}),children:[l(e,{label:this.props.t(`Main`),value:0}),l(e,{label:this.props.t(`Permissions`),value:1})]})}),l(f,{sx:{"&.MuiDialogContent-root":{...this.props.innerWidth<500?this.props.styles.narrowContent:void 0,...he.contentRoot}},children:v}),y(d,{style:this.props.styles.dialogActions,children:[l(S,{variant:`contained`,color:`primary`,autoFocus:!0,onClick:()=>this.props.saveData(this.props.isNew?null:this.state.originalId),disabled:!c,startIcon:l(a,{}),children:this.props.t(`Save`)}),l(S,{variant:`contained`,color:`grey`,onClick:this.props.onClose,startIcon:l(D,{}),children:this.props.t(`Cancel`)})]})]})}};function _e(e){return y(E,{open:!0,onClose:e.onClose,children:[l(i,{children:e.t(`Please confirm`)}),l(f,{children:l(p,{children:e.t(`Do you want to delete user %s?`,e.getText(e.user.common.name))})}),y(d,{children:[l(S,{variant:`contained`,color:`primary`,onClick:()=>e.deleteUser(e.user._id),startIcon:l(v,{}),children:e.t(`Delete`)}),l(S,{variant:`contained`,color:`grey`,autoFocus:!0,onClick:e.onClose,startIcon:l(D,{}),children:e.t(`Cancel`)})]})]})}function ve(e){return y(E,{open:!0,onClose:e.onClose,children:[l(i,{children:e.t(`Please confirm`)}),l(f,{children:l(p,{children:e.t(`Do you want to delete group %s?`,e.getText(e.group.common.name))})}),y(d,{style:e.styles.dialogActions,children:[l(S,{variant:`contained`,color:`primary`,onClick:()=>e.deleteGroup(e.group._id),startIcon:l(v,{}),children:e.t(`Delete`)}),l(S,{variant:`contained`,color:`grey`,autoFocus:!0,onClick:e.onClose,startIcon:l(D,{}),children:e.t(`Cancel`)})]})]})}r();var Q=`***********`,ye=`0 1px 1px 0 rgba(0, 0, 0, .4),0 6px 6px 0 rgba(0, 0, 0, .2)`,$={mainGridCont:{height:`calc(100% - 55px)`,overflowY:`auto`},childGridCont:{display:`flex`,flexDirection:`column`},childGridContWide:{height:`100%`},canDrop:e=>({backgroundColor:e.palette.background.default}),headContainer:{margin:10},blocksContainer:{overflowY:`auto`,overflowX:`hidden`},userGroupCard2:e=>({border:`1px solid #FFF`,borderColor:e.palette.divider,m:`10px`,minHeight:150,backgroundColor:e.palette.background.default,color:e.palette.text.primary,transition:`all 200ms ease-out`,opacity:1,overflow:`hidden`,"&:hover":{overflowY:`auto`,boxShadow:ye}}),userGroupCardSecondary:e=>({color:e.palette.text.primary,backgroundColor:e.palette.success.light}),permHeaders:e=>({backgroundColor:e.palette.mode===`dark`?e.palette.background.default:e.palette.primary.main,p:`4px`,borderRadius:`2px`,color:`#EEE`}),userCardContent:{height:`100%`,opacity:1},userGroupTitle:{display:`inline-flex`,alignItems:`center`},userGroupUserName:{fontWeight:900,padding:5},userGroupUserID:{opacity:.7,padding:5},description:{fontSize:10,fontStyle:`italic`,marginLeft:5,opacity:.7},userGroupMember:e=>({display:`inline-flex`,m:`4px`,p:`4px`,backgroundColor:`#00000010`,border:`1px solid #FFF`,borderColor:e.palette.text.primary,color:e.palette.text.primary,alignItems:`center`}),icon:{height:32,width:32,marginRight:5,backgroundSize:`cover`,backgroundPosition:`center`},right:{float:`right`},left:{float:`left`,marginRight:10},dialog:{},flex:{display:`flex`},formControl:{display:`flex`,padding:24,flexGrow:1e3},formContainer:{display:`flex`,justifyContent:`center`,alignItems:`center`},formIcon:{margin:10,opacity:.6},descriptionPanel:e=>({width:`100%`,backgroundColor:`transparent`,mb:`20px`,mt:`20px`,ml:`20px`,opacity:.75,border:`none`,display:`flex`,alignItems:`center`,"& a":{pl:`3px`,color:e.palette.mode===`dark`?`#EEE`:`#111`}}),dialogTitle:{borderBottom:`1px solid #00000020`,padding:0,width:`100%`},dialogActions:{borderTop:`1px solid #00000020`,width:`100%`},dialogPaper:{overflowY:`initial`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,width:`calc(100% - 100px)`,height:`calc(100% - 100px)`,maxWidth:800,maxHeight:`100%`},dialogPaperMini:{maxHeight:300},colorPicker:{},iconPreview:{height:40,width:40},mainDescription:{fontSize:`200%`},deleteDialog:{padding:20},narrowContent:{padding:`8px 8px 8px 8px`}},be=()=>{let e=ce();return e.display?l(`div`,{style:e.style,children:e.item.preview}):null},xe={_id:`system.user.`,type:`user`,common:{name:``,password:``,enabled:!0,color:``,desc:``},native:{},enums:{}},Se={_id:``,native:{},type:`group`,common:{name:``,desc:``,members:[],dontDelete:!0,acl:{object:{list:!1,read:!1,write:!1,delete:!1,create:!1},state:{list:!1,read:!1,write:!1,create:!1,delete:!1},users:{list:!1,read:!1,write:!1,create:!1,delete:!1},other:{execute:!1,http:!1,sendto:!1},file:{list:!1,read:!1,write:!1,create:!1,delete:!1}},icon:``,color:``}},Ce=class e extends A{constructor(e){super(e),_(this,`getText`,e=>e&&(typeof e==`object`?e[this.props.lang]||e.en||``:e||``)||``),_(this,`showUserEditDialog`,(e,t)=>{e=s.clone(e),e.common.password=e.common.password?Q:``,this.setState({userEditDialog:e,userEditDialogNew:t})}),_(this,`showGroupEditDialog`,(e,t)=>{e=s.clone(e),this.setState({groupEditDialog:e,groupEditDialogNew:t})}),_(this,`updateData`,()=>{let e;return this.props.socket.getForeignObjects(`system.user.*`,`user`).then(t=>(e=Object.values(t).sort((e,t)=>e._id>t._id?1:-1),e.forEach(e=>{e.common&&e.common.description&&(e.common.desc||(e.common.desc=e.common.description),delete e.common.description)}),this.props.socket.getForeignObjects(`system.group.*`,`group`))).then(t=>{let n=Object.values(t).sort((e,t)=>e._id>t._id?1:-1);n.forEach(e=>{e.common&&e.common.description&&(e.common.desc||(e.common.desc=e.common.description),delete e.common.description)}),this.setState({groups:n,users:e})})}),_(this,`changeUserFormData`,e=>this.setState({userEditDialog:e})),_(this,`changeGroupFormData`,e=>this.setState({groupEditDialog:e})),_(this,`saveUser`,async e=>{var t;let n=s.clone(this.state.userEditDialog),r=(t=this.state.users)==null?void 0:t.find(e=>e._id===n._id),i=n.common.password&&n.common.password!==Q?n.common.password:``;if(r?n.common.password=r.common.password:n.common.password=``,await this.props.socket.setObject(n._id,n),typeof this.state.userEditDialog==`object`&&e&&e!==this.state.userEditDialog._id)try{await this.props.socket.delObject(e);let t=this.state.groups||[];for(let r=0;r<t.length;r++){let i=t[r];if(i.common.members.includes(e)){let t=s.clone(i);t.common.members[t.common.members.indexOf(e)]=n._id,await this.props.socket.setObject(t._id,t)}}}catch(e){window.alert(`Cannot delete user: ${e}`)}if(i)try{await this.props.socket.changePassword(n._id,i)}catch(e){window.alert(`Cannot change password: ${e}`)}this.setState({userEditDialog:!1},()=>this.updateData())}),_(this,`saveGroup`,async e=>{if(typeof this.state.groupEditDialog==`object`){if(await this.props.socket.setObject(this.state.groupEditDialog._id,this.state.groupEditDialog),e&&e!==this.state.groupEditDialog._id)try{await this.props.socket.delObject(e)}catch(e){window.alert(`Cannot delete user: ${e}`)}this.setState({groupEditDialog:!1},()=>this.updateData())}}),_(this,`showUserDeleteDialog`,e=>this.setState({userDeleteDialog:e})),_(this,`showGroupDeleteDialog`,e=>this.setState({groupDeleteDialog:e})),_(this,`deleteUser`,e=>{this.props.socket.delObject(e).then(()=>Promise.all((this.state.groups||[]).map(t=>{if(t.common.members.includes(e)){let n=s.clone(t);return n.common.members.splice(n.common.members.indexOf(e),1),this.props.socket.setObject(n._id,n)}return Promise.resolve(null)}))).catch(e=>window.alert(`Cannot delete user: ${e}`)).then(()=>{this.setState({userDeleteDialog:!1},()=>this.updateData())})}),_(this,`deleteGroup`,e=>this.props.socket.delObject(e).then(()=>this.setState({groupDeleteDialog:!1},()=>this.updateData())).catch(e=>window.alert(`Cannot delete user: ${e}`))),_(this,`addUserToGroup`,(e,t)=>{var n;let r=(n=this.state.groups)==null?void 0:n.find(e=>e._id===t),i=(r==null?void 0:r.common.members)||[];r&&!i.includes(e)&&(i.push(e),this.props.socket.setObject(r._id,r).then(()=>this.updateData()).catch(e=>window.alert(`Cannot delete user: ${e}`)))}),_(this,`removeUserFromGroup`,(e,t)=>{var n;let r=(n=this.state.groups)==null?void 0:n.find(e=>e._id===t),i=(r==null?void 0:r.common.members)||[];r&&i.includes(e)&&(i.splice(i.indexOf(e),1),this.props.socket.setObject(r._id,r).then(()=>this.updateData()))}),this.state={users:null,groups:null,userEditDialog:!1,userEditDialogNew:!1,groupEditDialog:!1,groupEditDialogNew:!1,userDeleteDialog:!1,groupDeleteDialog:!1,innerWidth:0}}componentDidMount(){this.setState({innerWidth:window.innerWidth},()=>this.updateData())}componentDidUpdate(){window.innerWidth!==this.state.innerWidth&&setTimeout(()=>this.setState({innerWidth:window.innerWidth}),100)}static _isUniqueName(e,t,n){return!e.find(e=>e._id===`system.user.${t.toLowerCase()}_${n}`||e.common.name===`${t} ${n}`)}static findNewUniqueName(t,n,r){let i=1;for(;!e._isUniqueName(n,r,i);)i++;return{_id:`system.${t?`group`:`user`}.${r.toLowerCase()}_${i}`,name:`${r} ${i}`}}render(){return!this.state.users||!this.state.groups?l(ee,{}):y(K,{backend:V.isTouchDevice()?W:G,children:[l(be,{}),l(x,{component:`div`,sx:$.descriptionPanel,children:this.props.t(`You can drag users to groups.`)}),y(o,{container:!0,spacing:2,style:$.mainGridCont,children:[y(o,{size:{xs:12,md:6},style:{...$.childGridCont,...this.state.innerWidth>600?$.childGridContWide:void 0},children:[y(`div`,{style:$.headContainer,children:[l(F,{size:`small`,style:$.right,onClick:()=>{let{_id:t,name:n}=e.findNewUniqueName(!0,this.state.groups||[],this.props.t(`Group`)),r=s.clone(Se);r._id=t,r.common.name=n,this.showGroupEditDialog(r,!0)},children:l(ae,{})}),l(T,{gutterBottom:!0,variant:`h4`,component:`h4`,children:this.props.t(`Groups`)})]}),l(`div`,{style:$.blocksContainer,children:this.state.groups.sort((e,t)=>{var n,r;let i=(this.getText(e==null||(n=e.common)==null?void 0:n.name)||e._id).toLowerCase(),a=(this.getText(t==null||(r=t.common)==null?void 0:r.name)||t._id).toLowerCase();return i>a?1:i<a?-1:0}).map(e=>l(de,{group:e,users:this.state.users||[],showGroupEditDialog:this.showGroupEditDialog,showGroupDeleteDialog:this.showGroupDeleteDialog,removeUserFromGroup:this.removeUserFromGroup,getText:this.getText,styles:$,...this.props},e._id))})]}),y(o,{size:{xs:12,md:6},style:{...$.childGridCont,...this.state.innerWidth>600?$.childGridContWide:void 0},children:[y(`div`,{style:$.headContainer,children:[l(F,{size:`small`,style:$.right,onClick:()=>{let{_id:t,name:n}=e.findNewUniqueName(!1,this.state.users||[],this.props.t(`User`)),r=s.clone(xe);r._id=t,r.common.name=n,this.showUserEditDialog(r,!0)},children:l(ie,{})}),l(T,{gutterBottom:!0,variant:`h4`,component:`h4`,children:this.props.t(`Users`)})]}),l(`div`,{style:$.blocksContainer,children:this.state.users.sort((e,t)=>{var n,r;let i=(this.getText(e==null||(n=e.common)==null?void 0:n.name)||e._id).toLowerCase(),a=(this.getText(t==null||(r=t.common)==null?void 0:r.name)||t._id).toLowerCase();return i>a?1:i<a?-1:0}).map(e=>l(le,{user:e,groups:this.state.groups||[],showUserEditDialog:this.showUserEditDialog,showUserDeleteDialog:this.showUserDeleteDialog,updateData:this.updateData,addUserToGroup:this.addUserToGroup,removeUserFromGroup:this.removeUserFromGroup,getText:this.getText,styles:$,...this.props},e._id))})]})]}),this.state.userEditDialog?l(pe,{onClose:()=>this.setState({userEditDialog:!1}),users:this.state.users,user:this.state.userEditDialog,isNew:this.state.userEditDialogNew,t:this.props.t,getText:this.getText,styles:$,onChange:this.changeUserFormData,saveData:this.saveUser,innerWidth:this.state.innerWidth}):null,this.state.groupEditDialog?l(ge,{onClose:()=>this.setState({groupEditDialog:!1}),groups:this.state.groups,group:this.state.groupEditDialog,isNew:this.state.groupEditDialogNew,t:this.props.t,getText:this.getText,styles:$,onChange:this.changeGroupFormData,innerWidth:this.state.innerWidth,saveData:this.saveGroup}):null,this.state.userDeleteDialog?l(_e,{getText:this.getText,onClose:()=>this.setState({userDeleteDialog:!1}),user:this.state.userDeleteDialog,t:this.props.t,deleteUser:this.deleteUser}):null,this.state.groupDeleteDialog?l(ve,{getText:this.getText,onClose:()=>this.setState({groupDeleteDialog:!1}),group:this.state.groupDeleteDialog,t:this.props.t,styles:$,deleteGroup:this.deleteGroup}):null]})}};function we(e){return l(m,{children:l(re,{style:{display:`flex`,flexDirection:`column`,overflow:`auto`},children:l(Ce,{t:e.t,lang:e.lang,socket:e.socket,ready:e.ready,expertMode:e.expertMode,themeType:e.themeType,theme:e.theme})})})}export{we as default};
|