iobroker.admin 7.7.2 → 7.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -8
- package/admin/admin.png +0 -0
- package/admin/i18n/de.json +1 -1
- package/admin/i18n/es.json +1 -1
- package/admin/i18n/fr.json +1 -1
- package/admin/i18n/it.json +1 -1
- package/admin/i18n/nl.json +1 -1
- package/admin/i18n/pl.json +1 -1
- package/admin/i18n/pt.json +1 -1
- package/admin/i18n/ru.json +1 -1
- package/admin/i18n/uk.json +1 -1
- package/admin/i18n/zh-cn.json +1 -1
- package/admin/jsonConfig.json5 +1 -2
- package/adminWww/assets/{AdapterUpdateDialog-DHGhgEEq.js → AdapterUpdateDialog-BQUTMe7v.js} +1 -1
- package/adminWww/assets/Adapters-KuMqwfzU.js +9 -0
- package/adminWww/assets/Config-LH40Fzyp.js +1 -0
- package/adminWww/assets/CustomModal-UQ6ICKdg.js +1 -0
- package/adminWww/assets/CustomTab-CE2qvngn.js +1 -0
- package/adminWww/assets/DefaultPropsProvider-BxjOYH1h.js +30 -0
- package/adminWww/assets/EasyMode-XXQKZmWs.js +1 -0
- package/adminWww/assets/{Enums-BSICIhWI.js → Enums-Ddmi-fYo.js} +3 -3
- package/adminWww/assets/{Fields-C3JkTmfP.js → Fields-CQNdUYkd.js} +1 -1
- package/adminWww/assets/{Files-DK85-COY.js → Files-DgOiCRiN.js} +2 -2
- package/adminWww/assets/FilledInput-B9JSi0Ta.js +2 -0
- package/adminWww/assets/Hosts-BgDpLhdl.js +121 -0
- package/adminWww/assets/Instances-DikJwBl0.js +2 -0
- package/adminWww/assets/Intro-vxIHtYzr.js +2 -0
- package/adminWww/assets/Logs-DZUWTbJn.js +1 -0
- package/adminWww/assets/Objects-Dm1_4aGR.js +60 -0
- package/adminWww/assets/{State-BqfD2ABf.js → State-CrcWiBdx.js} +1 -1
- package/adminWww/assets/TextField-j-uewRwI.js +138 -0
- package/adminWww/assets/ThemeProvider-DHntAcOp.js +29 -0
- package/adminWww/assets/Users-GcWjwa7A.js +1 -0
- package/adminWww/assets/ace-1DqSbvTN.js +985 -0
- package/adminWww/assets/{bootstrap-BYQTdf9r.js → bootstrap-B3ZI_-0g.js} +112 -112
- package/adminWww/assets/{createSvgIcon-Bh3KWtyp.js → createSvgIcon-Ds12z7B3.js} +1 -1
- package/adminWww/assets/emotion-cache.browser.esm-BgJfNZJN.js +1 -0
- package/adminWww/assets/emotion-react.browser.esm-CBtpmfsG.js +8 -0
- package/adminWww/assets/emotion-serialize.esm-Q4o_CgeF.js +1 -0
- package/adminWww/assets/emotion-styled.browser.esm-BeD8nBzN.js +1 -0
- package/adminWww/assets/emotion-use-insertion-effect-with-fallbacks.browser.esm-BIy6Leuu.js +1 -0
- package/adminWww/assets/geosearch.module-B6h9BuIR.js +1 -0
- package/adminWww/assets/hostInit-fzxL8JAx.js +1 -1
- package/adminWww/assets/iconBase-BAOnvyiQ.js +1 -0
- package/adminWww/assets/{index-Qa7Q_Dz5.js → index-BOnh7es7.js} +1 -1
- package/adminWww/assets/{index-B1ITPhEY.js → index-BSfwmoAE.js} +3 -3
- package/adminWww/assets/{index-rKfs-rCa.js → index-BVgYaw7t.js} +1 -1
- package/adminWww/assets/{index-D--ojYan.js → index-C9i3HTsG.js} +1 -1
- package/adminWww/assets/{index-wN1ZlPSW.js → index-CELb-gCK.js} +2 -2
- package/adminWww/assets/{index-DPDg2YA0.js → index-CU6eZCem.js} +1 -1
- package/adminWww/assets/{index-DTGUg51P.js → index-DZ0MncEz.js} +2 -2
- package/adminWww/assets/index-Dg-s3k0-.js +10 -0
- package/adminWww/assets/index-tS5iCAF7.js +55 -0
- package/adminWww/assets/{iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-BOKYvG_W.js → iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-CXogaIXO.js} +1 -1
- package/adminWww/assets/{iobroker_admin__loadShare__leaflet__loadShare__-h9SMNPLU.js → iobroker_admin__loadShare__leaflet__loadShare__-DIpcqFbm.js} +1 -1
- package/adminWww/assets/{iobroker_admin__loadShare__prop_mf_2_types__loadShare__-BnsS7SOQ.js → iobroker_admin__loadShare__prop_mf_2_types__loadShare__-pDONiJUe.js} +1 -1
- package/adminWww/assets/{iobroker_admin__loadShare__react__loadShare__-Bis6NHgw.js → iobroker_admin__loadShare__react__loadShare__-CuzHmAOj.js} +1 -1
- package/adminWww/assets/iobroker_admin__mf_v__runtimeInit__mf_v__-CHE4rLsT.js +5 -0
- package/adminWww/assets/leaflet-src-BRBM-1HK.js +4 -0
- package/adminWww/assets/{sentry-H_UdJ2zx.js → sentry-B6yHtsbd.js} +1 -1
- package/adminWww/assets/{zh-cn-vvAC9zpl.js → zh-cn-heTcsLnU.js} +13 -13
- package/adminWww/img/admin.png +0 -0
- package/adminWww/index.html +2 -2
- package/adminWww/mf-manifest.json +1 -1
- package/adminWww/remoteEntry.js +2 -2
- package/build/i18n/de.json +18 -0
- package/build/i18n/es.json +18 -0
- package/build/i18n/fr.json +18 -0
- package/build/i18n/it.json +18 -0
- package/build/i18n/nl.json +18 -0
- package/build/i18n/pl.json +18 -0
- package/build/i18n/pt.json +18 -0
- package/build/i18n/ru.json +18 -0
- package/build/i18n/uk.json +18 -0
- package/build/i18n/zh-cn.json +18 -0
- package/build/lib/DockerManager.js +1315 -0
- package/build/lib/DockerManager.js.map +1 -0
- package/build/lib/dockerManager.types.js +3 -0
- package/build/lib/dockerManager.types.js.map +1 -0
- package/{build-backend → build}/lib/testPassword.js +1 -1
- package/{build-backend → build}/lib/testPassword.js.map +1 -1
- package/{build-backend → build}/lib/translations.js +16 -1
- package/build/lib/translations.js.map +1 -0
- package/{build-backend → build}/main.js +58 -5
- package/build/main.js.map +1 -0
- package/io-package.json +14 -14
- package/package.json +7 -7
- package/adminWww/assets/Adapters-CgSIajcF.js +0 -7
- package/adminWww/assets/Config-BQSl4bfA.js +0 -1
- package/adminWww/assets/CustomModal-DNMTLv4y.js +0 -1
- package/adminWww/assets/CustomTab-Bl8S8QZW.js +0 -1
- package/adminWww/assets/DefaultPropsProvider-u5xB1Fxz.js +0 -30
- package/adminWww/assets/EasyMode-xDbqrply.js +0 -1
- package/adminWww/assets/FilledInput-CysG4ax_.js +0 -2
- package/adminWww/assets/Hosts-qIsB4Gub.js +0 -121
- package/adminWww/assets/Instances-BA_DCzs8.js +0 -2
- package/adminWww/assets/Intro-00oh6SLw.js +0 -2
- package/adminWww/assets/Logs-Cvpgh-zN.js +0 -1
- package/adminWww/assets/Objects-Dp71iotS.js +0 -60
- package/adminWww/assets/Tabs-sxfWgN0b.js +0 -138
- package/adminWww/assets/Users-CDcWqTfZ.js +0 -1
- package/adminWww/assets/ace-BG5WYul1.js +0 -985
- package/adminWww/assets/blueGrey-DYsiMDOn.js +0 -29
- package/adminWww/assets/emotion-cache.browser.esm-B8BFze5o.js +0 -1
- package/adminWww/assets/emotion-react.browser.esm-BCDt9NrH.js +0 -8
- package/adminWww/assets/emotion-serialize.esm-BUa21YfQ.js +0 -1
- package/adminWww/assets/emotion-styled.browser.esm-CyFqGgyG.js +0 -1
- package/adminWww/assets/emotion-utils.browser.esm-pglN4_eI.js +0 -1
- package/adminWww/assets/geosearch.module-DH4NhiPj.js +0 -1
- package/adminWww/assets/iconBase-C3vi24ZE.js +0 -1
- package/adminWww/assets/index-D3IAEXXP.js +0 -10
- package/adminWww/assets/index-qcIeekse.js +0 -55
- package/adminWww/assets/iobroker_admin__mf_v__runtimeInit__mf_v__-CTkuGOOk.js +0 -5
- package/adminWww/assets/leaflet-src-A2ZHl6nF.js +0 -4
- package/build-backend/i18n/de.json +0 -18
- package/build-backend/i18n/es.json +0 -18
- package/build-backend/i18n/fr.json +0 -18
- package/build-backend/i18n/it.json +0 -18
- package/build-backend/i18n/nl.json +0 -18
- package/build-backend/i18n/pl.json +0 -18
- package/build-backend/i18n/pt.json +0 -18
- package/build-backend/i18n/ru.json +0 -18
- package/build-backend/i18n/uk.json +0 -18
- package/build-backend/i18n/zh-cn.json +0 -18
- package/build-backend/lib/translations.js.map +0 -1
- package/build-backend/main.js.map +0 -1
- /package/{build-backend → build}/i18n/en.json +0 -0
- /package/{build-backend → build}/lib/checkLinuxPass.js +0 -0
- /package/{build-backend → build}/lib/checkLinuxPass.js.map +0 -0
- /package/{build-backend → build}/lib/utils.js +0 -0
- /package/{build-backend → build}/lib/utils.js.map +0 -0
- /package/{build-backend → build}/lib/web.js +0 -0
- /package/{build-backend → build}/lib/web.js.map +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as r}from"./DefaultPropsProvider-
|
|
1
|
+
import{j as r}from"./DefaultPropsProvider-BxjOYH1h.js";import{Z as Se,X as Oe,Y as je,f as M,U as H,b as J,a as C,i as p,a2 as Fe,a3 as $e,a4 as He,_ as Ge,a5 as Me,W as Je,a6 as Ue,a7 as Ke,$ as qe,a0 as Ze,a1 as Ye,h as Xe,T as Qe}from"./bootstrap-B3ZI_-0g.js";import{i as S,a as L}from"./iobroker_admin__loadShare__react__loadShare__-CuzHmAOj.js";import{I as se,a as et,b as tt}from"./Fields-CQNdUYkd.js";import{g as Pe,h as Le}from"./index-CU6eZCem.js";import{_ as o}from"./preload-helper-Dp1pzeXC.js";import Te from"./list-C2A06nPE.js";import"./iobroker_admin__loadShare__prop_mf_2_types__loadShare__-pDONiJUe.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./iobroker_admin__mf_v__runtimeInit__mf_v__-CHE4rLsT.js";import"./emotion-serialize.esm-Q4o_CgeF.js";import"./iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-CXogaIXO.js";import"./ace-1DqSbvTN.js";import"./FilledInput-B9JSi0Ta.js";import"./ThemeProvider-DHntAcOp.js";import"./emotion-cache.browser.esm-BgJfNZJN.js";import"./iobroker_admin__loadShare__leaflet__loadShare__-DIpcqFbm.js";import"./extends-CF3RwP-h.js";import"./iconBase-BAOnvyiQ.js";var Re={exports:{}},x={};/** @license React v17.0.2
|
|
2
2
|
* react-is.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -18,7 +18,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
18
18
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
19
19
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
20
20
|
PERFORMANCE OF THIS SOFTWARE.
|
|
21
|
-
***************************************************************************** */function re(e,t,i=[],s={condition:!0}){const{condition:n}=s,a=function(d,u){var m={};for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&u.indexOf(h)<0&&(m[h]=d[h]);if(d!=null&&typeof Object.getOwnPropertySymbols=="function"){var g=0;for(h=Object.getOwnPropertySymbols(d);g<h.length;g++)u.indexOf(h[g])<0&&Object.prototype.propertyIsEnumerable.call(d,h[g])&&(m[h[g]]=d[h[g]])}return m}(s,["condition"]);S.useEffect(()=>(n&&window.addEventListener(e,t,a),()=>{n&&window.removeEventListener(e,t)}),[e,t,n,...i])}(function(e,t){t===void 0&&(t={});var i=t.insertAt;if(typeof document<"u"){var s=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",i==="top"&&s.firstChild?s.insertBefore(n,s.firstChild):s.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}})(`/* === Main Container === */
|
|
21
|
+
***************************************************************************** */function re(e,t,i=[],s={condition:!0}){const{condition:n}=s,a=(function(d,u){var m={};for(var h in d)Object.prototype.hasOwnProperty.call(d,h)&&u.indexOf(h)<0&&(m[h]=d[h]);if(d!=null&&typeof Object.getOwnPropertySymbols=="function"){var g=0;for(h=Object.getOwnPropertySymbols(d);g<h.length;g++)u.indexOf(h[g])<0&&Object.prototype.propertyIsEnumerable.call(d,h[g])&&(m[h[g]]=d[h[g]])}return m})(s,["condition"]);S.useEffect((()=>(n&&window.addEventListener(e,t,a),()=>{n&&window.removeEventListener(e,t)})),[e,t,n,...i])}(function(e,t){t===void 0&&(t={});var i=t.insertAt;if(typeof document<"u"){var s=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",i==="top"&&s.firstChild?s.insertBefore(n,s.firstChild):s.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}})(`/* === Main Container === */
|
|
22
22
|
.__dbk__container {
|
|
23
23
|
height: 100%;
|
|
24
24
|
width: 100%;
|
|
@@ -107,5 +107,5 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
107
107
|
.__dbk__dragger.Dark {
|
|
108
108
|
background: #434252;
|
|
109
109
|
}
|
|
110
|
-
/* ====== */`);const pt=L.forwardRef(({className:e,theme:t,draggerClassName:i,direction:s=b.Vertical,onDragging:n},a)=>{const d=`__dbk__gutter ${s} ${e||t}`,u=`__dbk__dragger ${s} ${i||t}`;return r.jsx("div",Object.assign({className:d,ref:a,dir:s,onMouseDown:n,onTouchStart:oe?n:void 0},{children:r.jsx("div",{className:u},void 0)}),void 0)});var A;function he(e,t,i){let s,n;return t?(s=e/2,n=e):i?(s=e,n=e/2):(s=e,n=e),{aGutterSize:s,bGutterSize:n}}function gt(e,t){switch(t.type){case A.SetIsReadyToCompute:return Object.assign(Object.assign({},e),{isReady:t.payload.isReady});case A.CreatePairs:{const{direction:i,children:s,gutters:n}=t.payload,a=s[0].parentNode;if(!a)throw new Error("Cannot create pairs - parent is undefined.");const d=ae(i,a);if(d===void 0)throw new Error(`Cannot create pairs - parent has undefined or zero size: ${d}.`);const u=[];return s.forEach((m,h)=>{if(h>0){const g=s[h-1],c=s[h],l=n[h-1],_=i===b.Horizontal?g.getBoundingClientRect().left:g.getBoundingClientRect().top,y=i===b.Horizontal?c.getBoundingClientRect().right:c.getBoundingClientRect().bottom,w=i===b.Horizontal?g.getBoundingClientRect().width+l.getBoundingClientRect().width+c.getBoundingClientRect().width:g.getBoundingClientRect().height+l.getBoundingClientRect().height+c.getBoundingClientRect().height,B=i===b.Horizontal?l.getBoundingClientRect().width:l.getBoundingClientRect().height,G={idx:h-1,a:g,b:c,gutter:l,parent:a,start:_,end:y,size:w,gutterSize:B,aSizePct:100/s.length,bSizePct:100/s.length};u.push(G)}}),Object.assign(Object.assign({},e),{pairs:u})}case A.StartDragging:{const{gutterIdx:i}=t.payload;return Object.assign(Object.assign({},e),{isDragging:!0,draggingIdx:i})}case A.StopDragging:return Object.assign(Object.assign({},e),{isDragging:!1});case A.CalculateSizes:{const{direction:i,gutterIdx:s}=t.payload,n=e.pairs[s],a=ae(i,n.parent);if(!a)throw new Error("Cannot calculate sizes - 'pair.parent' has undefined or zero size.");const d=n.gutter[i===b.Horizontal?"clientWidth":"clientHeight"],u=s===0,m=s===e.pairs.length-1,{aGutterSize:h,bGutterSize:g}=he(d,u,m);let c,l,_,y,w;return i===b.Horizontal?(c=n.a.getBoundingClientRect().left,l=n.b.getBoundingClientRect().right,y=(n.a.getBoundingClientRect().width+h)/a*100,w=(n.b.getBoundingClientRect().width+g)/a*100,_=n.a.getBoundingClientRect().width+h+g+n.b.getBoundingClientRect().width):(c=n.a.getBoundingClientRect().top,l=n.b.getBoundingClientRect().bottom,y=(n.a.getBoundingClientRect().height+h)/a*100,w=(n.b.getBoundingClientRect().height+g)/a*100,_=n.a.getBoundingClientRect().height+h+g+n.b.getBoundingClientRect().height),e.pairs[s]=Object.assign(Object.assign({},n),{start:c,end:l,size:_,aSizePct:y,bSizePct:w,gutterSize:d}),Object.assign({},e)}default:return e}}function Ne(e,t=0,i=[]){return S.Children.toArray(e).reduce((s,n,a)=>(ut.isFragment(n)?s.push.apply(s,Ne(n.props.children,t+1,i.concat(n.key||a))):S.isValidElement(n)?s.push(S.cloneElement(n,{key:i.concat(String(n.key)).join(".")})):typeof n!="string"&&typeof n!="number"||s.push(n),s),[])}(function(e){e[e.SetIsReadyToCompute=0]="SetIsReadyToCompute",e[e.CreatePairs=1]="CreatePairs",e[e.CalculateSizes=2]="CalculateSizes",e[e.StartDragging=3]="StartDragging",e[e.StopDragging=4]="StopDragging"})(A||(A={}));const be=e=>"changedTouches"in e;var b,_e;(function(e){e.Horizontal="Horizontal",e.Vertical="Vertical"})(b||(b={})),function(e){e.Light="Light",e.Dark="Dark"}(_e||(_e={}));const oe=typeof window<"u"&&"ontouchstart"in window;function ge(e){return e===b.Horizontal?"col-resize":"row-resize"}const ht={isReady:!1,isDragging:!1,pairs:[]};function _t({direction:e=b.Horizontal,minWidths:t=[],minHeights:i=[],initialSizes:s,gutterTheme:n=_e.Dark,gutterClassName:a,draggerClassName:d,children:u,onResizeStarted:m,onResizeFinished:h,classes:g=[]}){const c=Ne(u),[l,_]=S.useReducer(gt,ht),y=S.useRef(null),w=S.useRef([]),B=S.useRef([]);w.current=[],B.current=[];const G=L.useCallback(f=>{_({type:A.SetIsReadyToCompute,payload:{isReady:f}})},[]),We=L.useCallback((f,E)=>{_({type:A.StartDragging,payload:{gutterIdx:E}});const v=l.pairs[E];m==null||m(v.idx),v.a.style.userSelect="none",v.b.style.userSelect="none",v.gutter.style.cursor=ge(f),v.parent.style.cursor=ge(f),document.body.style.cursor=ge(f)},[l.pairs]),ce=L.useCallback(()=>{_({type:A.StopDragging});const f=[];for(let v=0;v<l.pairs.length;v++){const T=l.pairs[v],P=ae(e,T.parent);if(P===void 0)throw new Error("Cannot call the 'onResizeFinished' callback - parentSize is undefined");if(T.gutterSize===void 0)throw new Error("Cannot call 'onResizeFinished' callback - gutterSize is undefined");const z=v===0,j=v===l.pairs.length-1,F=T.a.getBoundingClientRect()[e===b.Horizontal?"width":"height"],{aGutterSize:N,bGutterSize:W}=he(T.gutterSize,z,j),k=(F+N)/P*100;if(f.push(k),j){const ie=(T.b.getBoundingClientRect()[e===b.Horizontal?"width":"height"]+W)/P*100;f.push(ie)}}if(l.draggingIdx===void 0)throw new Error("Could not reset cursor and user-select because 'state.draggingIdx' is undefined");const E=l.pairs[l.draggingIdx];h==null||h(E.idx,f),E.a.style.userSelect="",E.b.style.userSelect="",E.gutter.style.cursor="",E.parent.style.cursor="",document.body.style.cursor=""},[l.draggingIdx,l.pairs,e]),fe=L.useCallback((f,E)=>{_({type:A.CalculateSizes,payload:{direction:f,gutterIdx:E}})},[]),Ee=L.useCallback((f,E,v)=>{_({type:A.CreatePairs,payload:{direction:f,children:E,gutters:v}})},[]),ue=L.useCallback((f,E,v,T)=>{const P=E[0].parentNode;if(!P)throw new Error("Cannot set initial sizes - parent is undefined");if(ae(f,P)===void 0)throw new Error("Cannot set initial sizes - parent has undefined size");E.forEach((z,j)=>{const F=j===0,N=j===E.length-1;let W,k=0;E.length>1&&(k=v[N?j-1:j].getBoundingClientRect()[f===b.Horizontal?"width":"height"],k=F||N?k/2:k),W=T&&j<T.length?`calc(${T[j]}% - ${k}px)`:`calc(${100/E.length}% - ${k}px)`,f===b.Horizontal?(z.style.width=W,z.style.height="100%"):(z.style.height=W,z.style.width="100%")})},[]),ye=L.useCallback((f,E)=>{if(l.draggingIdx===void 0)throw new Error("Cannot adjust size - 'draggingIdx' is undefined");const v=l.pairs[l.draggingIdx];if(v.size===void 0)throw new Error("Cannot adjust size - 'pair.size' is undefined");if(v.gutterSize===void 0)throw new Error("Cannot adjust size - 'pair.gutterSize' is undefined");const T=v.aSizePct+v.bSizePct,P=E/v.size*T,z=T-E/v.size*T,j=l.draggingIdx===0,F=l.draggingIdx===l.pairs.length-1,{aGutterSize:N,bGutterSize:W}=he(v.gutterSize,j,F),k=`calc(${P}% - ${N}px)`,ie=`calc(${z}% - ${W}px)`;f===b.Horizontal?(v.a.style.width=k,v.b.style.width=ie):(v.a.style.height=k,v.b.style.height=ie)},[l.draggingIdx,l.pairs,e]),pe=L.useCallback((f,E,v)=>{if(!l.isDragging)return;if(l.draggingIdx===void 0)throw new Error("Cannot drag - 'draggingIdx' is undefined");const T=l.pairs[l.draggingIdx];if(T.start===void 0)throw new Error("Cannot drag - 'pair.start' is undefined");if(T.size===void 0)throw new Error("Cannot drag - 'pair.size' is undefined");if(T.gutterSize===void 0)throw new Error("Cannot drag - 'pair.gutterSize' is undefined");let P=function(F,N){const W=be(N)?N.changedTouches[0]:N;return F===b.Horizontal?W.clientX:W.clientY}(E,f)-T.start,z=16,j=16;v.length>l.draggingIdx&&(z=v[l.draggingIdx]),v.length>=l.draggingIdx+1&&(j=v[l.draggingIdx+1]),P<T.gutterSize+z&&(P=T.gutterSize+z),P>=T.size-(T.gutterSize+j)&&(P=T.size-(T.gutterSize+j)),ye(E,P)},[l.isDragging,l.draggingIdx,l.pairs,ye]),De=()=>{if(l.isDragging){if(l.draggingIdx===void 0)throw new Error("Cannot calculate sizes after dragging = 'state.draggingIdx' is undefined");fe(e,l.draggingIdx),ce()}},Ce=f=>{l.isDragging&&(be(f)&&f.preventDefault(),pe(f,e,e===b.Horizontal?t:i))};function xe(f,E){if(!f.current)throw new Error("Can't add element to ref object - ref isn't initialized");E&&!f.current.includes(E)&&f.current.push(E)}return re("mouseup",De,[l.isDragging,ce]),re("mousemove",Ce,[e,l.isDragging,pe,t,i]),re("touchend",De,[l.isDragging,ce],{condition:oe}),re("touchmove",Ce,[e,l.isDragging,pe,t,i],{condition:oe,passive:!oe}),S.useEffect(function(){if(!y.current)return;const f=y.current.parentElement;if(!f)return;const E=new ResizeObserver(()=>{const v=getComputedStyle(f),T=e===b.Horizontal?f.clientWidth:f.clientHeight;G(!!v&&!!T)});return E.observe(f),()=>{E.disconnect()}},[y.current,e]),S.useEffect(function(){if(l.isReady&&(!w.current||w.current[0].offsetParent)){if(!w.current||!B.current)throw new Error("Cannot create pairs - either variable 'childRefs' or 'gutterRefs' is undefined");c.length<=1?ue(e,w.current,B.current,s):(ue(e,w.current,B.current,s),Ee(e,w.current,B.current))}},[u,l.isReady,e,ue,Ee,s]),r.jsx("div",Object.assign({className:`__dbk__container ${e}`,ref:y},{children:l.isReady&&c.map((f,E)=>r.jsxs(L.Fragment,{children:[r.jsx("div",Object.assign({ref:v=>xe(w,v),className:"__dbk__child-wrapper "+(E<g.length?g[E]:"")},{children:f}),void 0),E<c.length-1&&r.jsx(pt,{ref:v=>xe(B,v),className:a,theme:n,draggerClassName:d,direction:e,onDragging:()=>{return fe(e,v=E),void We(e,v);var v}},void 0)]},E))}),void 0)}const vt="0 1px 1px 0 rgba(0, 0, 0, .4),0 6px 6px 0 rgba(0, 0, 0, .2)",D={enumGroupCard:e=>({border:"1px solid #FFF",borderColor:e.palette.divider,m:"10px",backgroundColor:e.palette.background.default,color:e.palette.text.primary,transition:"all 200ms ease-out",opacity:1,overflow:"hidden",position:"relative","&:hover":{overflowY:"auto",boxShadow:vt},minHeight:70}),enumGroupCardExpanded:{minHeight:140},enumUpdating:{opacity:.5,position:"relative","&:before":{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:100,opacity:".3 !important",background:"repeating-linear-gradient(135deg, #333, #333 10px, #888 10px, #888 20px)"}},enumCardContent:{height:"100%",opacity:1},right:{float:"right"},enumGroupTitle:{display:"inline-flex",alignItems:"center",cursor:"pointer"},icon:{height:32,width:32,marginRight:5,cursor:"grab",backgroundSize:"cover",backgroundPosition:"center",display:"inline-block"},enumGroupName:{marginLeft:5},enumGroupEnumName:{fontWeight:900},enumGroupEnumID:{opacity:.7,marginLeft:5,fontSize:12,fontStyle:"italic"},enumName:{fontSize:12,fontWeight:700,opacity:.7,marginTop:-4},enumGroupMember: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",position:"relative"}),secondLine:{fontSize:9,fontStyle:"italic",whiteSpace:"nowrap",opacity:.5},context:{paddingTop:8,paddingLeft:8,paddingRight:8,paddingBottom:"0 !important"},folderDiv:{display:"inline-block",position:"relative",cursor:"pointer"},folder:{width:48,height:48},folderIcon:{position:"absolute",top:18,left:16,width:18,height:18,zIndex:2},folderIconExpanded:{transform:"skew(147deg, 183deg) scale(0.5) translate(6px, 7px)"},bottomButtons:{position:"absolute",right:0,bottom:0},membersNumber:{top:40,left:26,fontSize:18,position:"absolute"},memberNumberFolder:{top:46,left:26}};class ne extends S.Component{constructor(t){var i,s;super(t),this.state={icons:(s=(i=t.enum)==null?void 0:i.common)!=null&&s.members?t.enum.common.members.map(n=>{var a,d;return((d=(a=t.members[n])==null?void 0:a.common)==null?void 0:d.icon)||""}):[]}}async componentDidMount(){var d,u,m,h;const t=[...this.state.icons];let i=!1;const s=(u=(d=this.props.enum)==null?void 0:d.common)==null?void 0:u.members,n=this.props.cachedIcons;try{if(s){for(let g=0;g<t.length;g++)if(!t[g]){const c=H.getParentId(s[g]);if(n[c]!==void 0){n[c]&&(t[g]=n[c],i=!0);continue}if(c&&c.split(".").length>2){const l=await this.props.socket.getObject(c);if(l&&(l.type==="channel"||l.type==="device")){if((m=l.common)!=null&&m.icon)n[c]=l.common.icon,t[g]=l.common.icon,i=!0;else{const _=H.getParentId(c);if(_&&_.split(".").length>2){const y=await this.props.socket.getObject(_);y&&(y.type==="channel"||y.type==="device")&&(h=y.common)!=null&&h.icon&&(n[_]=y.common.icon,n[c]=y.common.icon,t[g]=y.common.icon,i=!0),n[_]=n[_]||null}}n[c]=n[c]||null}}}}}catch(g){window.alert(`Cannot get icons: ${g}`)}const a=".";if(s){const g=this.props.members;for(let c=0;c<t.length;c++){const l=t[c],_=s[c];if(l&&!l.startsWith("data:image/")&&l.includes(".")){let y;g[_]&&(g[_].type==="instance"||g[_].type==="adapter")?t[c]=`${a}/adapter/${this.props.getName(g[_].common.name)}/${l}`:_&&_.startsWith("system.adapter.")?(y=_.split(".",3),l[0]==="/"?y[2]+=l:y[2]+=`/${l}`,t[c]=`${a}/adapter/${y[2]}`):(y=_.split(".",2),l[0]==="/"?y[0]+=l:y[0]+=`/${l}`,t[c]=`${a}/adapter/${y[0]}`),i=!0}}}i&&this.setState({icons:t})}render(){var d,u,m;const t=this.props,i=(d=t.enum)==null?void 0:d.common,s=H.getInvertedColor(i==null?void 0:i.color,t.themeType,!0),n={opacity:this.props.isDragging?0:1,color:s};i!=null&&i.color&&(n.backgroundColor=t.enum.common.color);let a=i!=null&&i.icon?r.jsx(J,{style:{...D.icon,...t.childrenCount?D.folderIcon:void 0,...t.childrenCount&&!t.closed?D.folderIconExpanded:void 0},src:t.enum.common.icon}):r.jsx(C.List,{style:{...D.icon,...t.childrenCount?D.folderIcon:void 0,...t.childrenCount&&!t.closed?D.folderIconExpanded:void 0}});return a=t.childrenCount?r.jsx("div",{style:D.folderDiv,onClick:()=>t.toggleEnum(t.id),children:t.closed?[r.jsx(Pe,{style:D.folder},1),r.jsx("div",{children:a},2)]:[r.jsx(Le,{style:D.folder},1),r.jsx("div",{children:a},2)]}):a,this.props.iconDragRef&&(a=r.jsx("span",{ref:this.props.iconDragRef,children:a})),r.jsxs(p.Card,{style:n,sx:H.getStyle(this.props.theme,D.enumGroupCard,this.props.updating&&D.enumUpdating,!t.collapsed&&D.enumGroupCardExpanded),id:t.id,children:[r.jsxs("div",{style:D.enumCardContent,children:[r.jsxs("div",{style:D.right,children:[t.enum?r.jsx(p.IconButton,{size:"small",onClick:()=>t.showEnumEditDialog(t.enum,!1),children:r.jsx(p.Tooltip,{title:t.t("Edit"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:r.jsx(C.Edit,{style:{color:s}})})}):null,t.enum?r.jsx(p.IconButton,{size:"small",onClick:()=>t.copyEnum(t.id),children:r.jsx(p.Tooltip,{title:t.t("Clone"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:r.jsx(C.FileCopy,{style:{color:s}})})}):null,r.jsx(p.IconButton,{size:"small",onClick:()=>t.showEnumDeleteDialog(t.enum),disabled:i==null?void 0:i.dontDelete,children:r.jsx(p.Tooltip,{title:t.t("Delete"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:r.jsx(C.Delete,{style:i!=null&&i.dontDelete?null:{color:s}})})})]}),r.jsxs(p.CardContent,{style:D.context,children:[r.jsxs(p.Typography,{gutterBottom:!t.collapsed,component:"div",style:D.enumGroupTitle,onClick:()=>t.onCollapse(t.id),children:[a,r.jsxs("div",{style:D.enumGroupName,children:[r.jsx("span",{style:D.enumGroupEnumName,children:t.name||t.getName(i==null?void 0:i.name)||t.id.split(".").pop()}),r.jsx("span",{style:D.enumGroupEnumID,children:t.idText||t.id}),i!=null&&i.desc?r.jsx("div",{style:D.enumName,children:t.getName(i.desc)}):null]})]}),r.jsx("div",{children:!t.collapsed&&(i!=null&&i.members)?t.enum.common.members.map((h,g)=>{var _,y;const c=t.members[h];if(!c)return null;const l=((_=c.common)==null?void 0:_.name)&&t.getName((y=c.common)==null?void 0:y.name);return r.jsxs(p.Card,{title:l?`${t.t("Name: %s",l)}
|
|
110
|
+
/* ====== */`);const pt=L.forwardRef((({className:e,theme:t,draggerClassName:i,direction:s=b.Vertical,onDragging:n},a)=>{const d=`__dbk__gutter ${s} ${e||t}`,u=`__dbk__dragger ${s} ${i||t}`;return r.jsx("div",Object.assign({className:d,ref:a,dir:s,onMouseDown:n,onTouchStart:oe?n:void 0},{children:r.jsx("div",{className:u},void 0)}),void 0)}));var A;function he(e,t,i){let s,n;return t?(s=e/2,n=e):i?(s=e,n=e/2):(s=e,n=e),{aGutterSize:s,bGutterSize:n}}function gt(e,t){switch(t.type){case A.SetIsReadyToCompute:return Object.assign(Object.assign({},e),{isReady:t.payload.isReady});case A.CreatePairs:{const{direction:i,children:s,gutters:n}=t.payload,a=s[0].parentNode;if(!a)throw new Error("Cannot create pairs - parent is undefined.");const d=ae(i,a);if(d===void 0)throw new Error(`Cannot create pairs - parent has undefined or zero size: ${d}.`);const u=[];return s.forEach(((m,h)=>{if(h>0){const g=s[h-1],c=s[h],l=n[h-1],_=i===b.Horizontal?g.getBoundingClientRect().left:g.getBoundingClientRect().top,y=i===b.Horizontal?c.getBoundingClientRect().right:c.getBoundingClientRect().bottom,w=i===b.Horizontal?g.getBoundingClientRect().width+l.getBoundingClientRect().width+c.getBoundingClientRect().width:g.getBoundingClientRect().height+l.getBoundingClientRect().height+c.getBoundingClientRect().height,B=i===b.Horizontal?l.getBoundingClientRect().width:l.getBoundingClientRect().height,G={idx:h-1,a:g,b:c,gutter:l,parent:a,start:_,end:y,size:w,gutterSize:B,aSizePct:100/s.length,bSizePct:100/s.length};u.push(G)}})),Object.assign(Object.assign({},e),{pairs:u})}case A.StartDragging:{const{gutterIdx:i}=t.payload;return Object.assign(Object.assign({},e),{isDragging:!0,draggingIdx:i})}case A.StopDragging:return Object.assign(Object.assign({},e),{isDragging:!1});case A.CalculateSizes:{const{direction:i,gutterIdx:s}=t.payload,n=e.pairs[s],a=ae(i,n.parent);if(!a)throw new Error("Cannot calculate sizes - 'pair.parent' has undefined or zero size.");const d=n.gutter[i===b.Horizontal?"clientWidth":"clientHeight"],u=s===0,m=s===e.pairs.length-1,{aGutterSize:h,bGutterSize:g}=he(d,u,m);let c,l,_,y,w;return i===b.Horizontal?(c=n.a.getBoundingClientRect().left,l=n.b.getBoundingClientRect().right,y=(n.a.getBoundingClientRect().width+h)/a*100,w=(n.b.getBoundingClientRect().width+g)/a*100,_=n.a.getBoundingClientRect().width+h+g+n.b.getBoundingClientRect().width):(c=n.a.getBoundingClientRect().top,l=n.b.getBoundingClientRect().bottom,y=(n.a.getBoundingClientRect().height+h)/a*100,w=(n.b.getBoundingClientRect().height+g)/a*100,_=n.a.getBoundingClientRect().height+h+g+n.b.getBoundingClientRect().height),e.pairs[s]=Object.assign(Object.assign({},n),{start:c,end:l,size:_,aSizePct:y,bSizePct:w,gutterSize:d}),Object.assign({},e)}default:return e}}function Ne(e,t=0,i=[]){return S.Children.toArray(e).reduce(((s,n,a)=>(ut.isFragment(n)?s.push.apply(s,Ne(n.props.children,t+1,i.concat(n.key||a))):S.isValidElement(n)?s.push(S.cloneElement(n,{key:i.concat(String(n.key)).join(".")})):typeof n!="string"&&typeof n!="number"||s.push(n),s)),[])}(function(e){e[e.SetIsReadyToCompute=0]="SetIsReadyToCompute",e[e.CreatePairs=1]="CreatePairs",e[e.CalculateSizes=2]="CalculateSizes",e[e.StartDragging=3]="StartDragging",e[e.StopDragging=4]="StopDragging"})(A||(A={}));const be=e=>"changedTouches"in e;var b,_e;(function(e){e.Horizontal="Horizontal",e.Vertical="Vertical"})(b||(b={})),(function(e){e.Light="Light",e.Dark="Dark"})(_e||(_e={}));const oe=typeof window<"u"&&"ontouchstart"in window;function ge(e){return e===b.Horizontal?"col-resize":"row-resize"}const ht={isReady:!1,isDragging:!1,pairs:[]};function _t({direction:e=b.Horizontal,minWidths:t=[],minHeights:i=[],initialSizes:s,gutterTheme:n=_e.Dark,gutterClassName:a,draggerClassName:d,children:u,onResizeStarted:m,onResizeFinished:h,classes:g=[]}){const c=Ne(u),[l,_]=S.useReducer(gt,ht),y=S.useRef(null),w=S.useRef([]),B=S.useRef([]);w.current=[],B.current=[];const G=L.useCallback((f=>{_({type:A.SetIsReadyToCompute,payload:{isReady:f}})}),[]),We=L.useCallback(((f,E)=>{_({type:A.StartDragging,payload:{gutterIdx:E}});const v=l.pairs[E];m==null||m(v.idx),v.a.style.userSelect="none",v.b.style.userSelect="none",v.gutter.style.cursor=ge(f),v.parent.style.cursor=ge(f),document.body.style.cursor=ge(f)}),[l.pairs]),ce=L.useCallback((()=>{_({type:A.StopDragging});const f=[];for(let v=0;v<l.pairs.length;v++){const T=l.pairs[v],P=ae(e,T.parent);if(P===void 0)throw new Error("Cannot call the 'onResizeFinished' callback - parentSize is undefined");if(T.gutterSize===void 0)throw new Error("Cannot call 'onResizeFinished' callback - gutterSize is undefined");const z=v===0,j=v===l.pairs.length-1,F=T.a.getBoundingClientRect()[e===b.Horizontal?"width":"height"],{aGutterSize:N,bGutterSize:W}=he(T.gutterSize,z,j),k=(F+N)/P*100;if(f.push(k),j){const ie=(T.b.getBoundingClientRect()[e===b.Horizontal?"width":"height"]+W)/P*100;f.push(ie)}}if(l.draggingIdx===void 0)throw new Error("Could not reset cursor and user-select because 'state.draggingIdx' is undefined");const E=l.pairs[l.draggingIdx];h==null||h(E.idx,f),E.a.style.userSelect="",E.b.style.userSelect="",E.gutter.style.cursor="",E.parent.style.cursor="",document.body.style.cursor=""}),[l.draggingIdx,l.pairs,e]),fe=L.useCallback(((f,E)=>{_({type:A.CalculateSizes,payload:{direction:f,gutterIdx:E}})}),[]),Ee=L.useCallback(((f,E,v)=>{_({type:A.CreatePairs,payload:{direction:f,children:E,gutters:v}})}),[]),ue=L.useCallback(((f,E,v,T)=>{const P=E[0].parentNode;if(!P)throw new Error("Cannot set initial sizes - parent is undefined");if(ae(f,P)===void 0)throw new Error("Cannot set initial sizes - parent has undefined size");E.forEach(((z,j)=>{const F=j===0,N=j===E.length-1;let W,k=0;E.length>1&&(k=v[N?j-1:j].getBoundingClientRect()[f===b.Horizontal?"width":"height"],k=F||N?k/2:k),W=T&&j<T.length?`calc(${T[j]}% - ${k}px)`:`calc(${100/E.length}% - ${k}px)`,f===b.Horizontal?(z.style.width=W,z.style.height="100%"):(z.style.height=W,z.style.width="100%")}))}),[]),ye=L.useCallback(((f,E)=>{if(l.draggingIdx===void 0)throw new Error("Cannot adjust size - 'draggingIdx' is undefined");const v=l.pairs[l.draggingIdx];if(v.size===void 0)throw new Error("Cannot adjust size - 'pair.size' is undefined");if(v.gutterSize===void 0)throw new Error("Cannot adjust size - 'pair.gutterSize' is undefined");const T=v.aSizePct+v.bSizePct,P=E/v.size*T,z=T-E/v.size*T,j=l.draggingIdx===0,F=l.draggingIdx===l.pairs.length-1,{aGutterSize:N,bGutterSize:W}=he(v.gutterSize,j,F),k=`calc(${P}% - ${N}px)`,ie=`calc(${z}% - ${W}px)`;f===b.Horizontal?(v.a.style.width=k,v.b.style.width=ie):(v.a.style.height=k,v.b.style.height=ie)}),[l.draggingIdx,l.pairs,e]),pe=L.useCallback(((f,E,v)=>{if(!l.isDragging)return;if(l.draggingIdx===void 0)throw new Error("Cannot drag - 'draggingIdx' is undefined");const T=l.pairs[l.draggingIdx];if(T.start===void 0)throw new Error("Cannot drag - 'pair.start' is undefined");if(T.size===void 0)throw new Error("Cannot drag - 'pair.size' is undefined");if(T.gutterSize===void 0)throw new Error("Cannot drag - 'pair.gutterSize' is undefined");let P=(function(F,N){const W=be(N)?N.changedTouches[0]:N;return F===b.Horizontal?W.clientX:W.clientY})(E,f)-T.start,z=16,j=16;v.length>l.draggingIdx&&(z=v[l.draggingIdx]),v.length>=l.draggingIdx+1&&(j=v[l.draggingIdx+1]),P<T.gutterSize+z&&(P=T.gutterSize+z),P>=T.size-(T.gutterSize+j)&&(P=T.size-(T.gutterSize+j)),ye(E,P)}),[l.isDragging,l.draggingIdx,l.pairs,ye]),De=()=>{if(l.isDragging){if(l.draggingIdx===void 0)throw new Error("Cannot calculate sizes after dragging = 'state.draggingIdx' is undefined");fe(e,l.draggingIdx),ce()}},Ce=f=>{l.isDragging&&(be(f)&&f.preventDefault(),pe(f,e,e===b.Horizontal?t:i))};function xe(f,E){if(!f.current)throw new Error("Can't add element to ref object - ref isn't initialized");E&&!f.current.includes(E)&&f.current.push(E)}return re("mouseup",De,[l.isDragging,ce]),re("mousemove",Ce,[e,l.isDragging,pe,t,i]),re("touchend",De,[l.isDragging,ce],{condition:oe}),re("touchmove",Ce,[e,l.isDragging,pe,t,i],{condition:oe,passive:!oe}),S.useEffect((function(){if(!y.current)return;const f=y.current.parentElement;if(!f)return;const E=new ResizeObserver((()=>{const v=getComputedStyle(f),T=e===b.Horizontal?f.clientWidth:f.clientHeight;G(!!v&&!!T)}));return E.observe(f),()=>{E.disconnect()}}),[y.current,e]),S.useEffect((function(){if(l.isReady&&(!w.current||w.current[0].offsetParent)){if(!w.current||!B.current)throw new Error("Cannot create pairs - either variable 'childRefs' or 'gutterRefs' is undefined");c.length<=1?ue(e,w.current,B.current,s):(ue(e,w.current,B.current,s),Ee(e,w.current,B.current))}}),[u,l.isReady,e,ue,Ee,s]),r.jsx("div",Object.assign({className:`__dbk__container ${e}`,ref:y},{children:l.isReady&&c.map(((f,E)=>r.jsxs(L.Fragment,{children:[r.jsx("div",Object.assign({ref:v=>xe(w,v),className:"__dbk__child-wrapper "+(E<g.length?g[E]:"")},{children:f}),void 0),E<c.length-1&&r.jsx(pt,{ref:v=>xe(B,v),className:a,theme:n,draggerClassName:d,direction:e,onDragging:()=>{return fe(e,v=E),void We(e,v);var v}},void 0)]},E)))}),void 0)}const vt="0 1px 1px 0 rgba(0, 0, 0, .4),0 6px 6px 0 rgba(0, 0, 0, .2)",D={enumGroupCard:e=>({border:"1px solid #FFF",borderColor:e.palette.divider,m:"10px",backgroundColor:e.palette.background.default,color:e.palette.text.primary,transition:"all 200ms ease-out",opacity:1,overflow:"hidden",position:"relative","&:hover":{overflowY:"auto",boxShadow:vt},minHeight:70}),enumGroupCardExpanded:{minHeight:140},enumUpdating:{opacity:.5,position:"relative","&:before":{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:100,opacity:".3 !important",background:"repeating-linear-gradient(135deg, #333, #333 10px, #888 10px, #888 20px)"}},enumCardContent:{height:"100%",opacity:1},right:{float:"right"},enumGroupTitle:{display:"inline-flex",alignItems:"center",cursor:"pointer"},icon:{height:32,width:32,marginRight:5,cursor:"grab",backgroundSize:"cover",backgroundPosition:"center",display:"inline-block"},enumGroupName:{marginLeft:5},enumGroupEnumName:{fontWeight:900},enumGroupEnumID:{opacity:.7,marginLeft:5,fontSize:12,fontStyle:"italic"},enumName:{fontSize:12,fontWeight:700,opacity:.7,marginTop:-4},enumGroupMember: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",position:"relative"}),secondLine:{fontSize:9,fontStyle:"italic",whiteSpace:"nowrap",opacity:.5},context:{paddingTop:8,paddingLeft:8,paddingRight:8,paddingBottom:"0 !important"},folderDiv:{display:"inline-block",position:"relative",cursor:"pointer"},folder:{width:48,height:48},folderIcon:{position:"absolute",top:18,left:16,width:18,height:18,zIndex:2},folderIconExpanded:{transform:"skew(147deg, 183deg) scale(0.5) translate(6px, 7px)"},bottomButtons:{position:"absolute",right:0,bottom:0},membersNumber:{top:40,left:26,fontSize:18,position:"absolute"},memberNumberFolder:{top:46,left:26}};class ne extends S.Component{constructor(t){var i,s;super(t),this.state={icons:(s=(i=t.enum)==null?void 0:i.common)!=null&&s.members?t.enum.common.members.map(n=>{var a,d;return((d=(a=t.members[n])==null?void 0:a.common)==null?void 0:d.icon)||""}):[]}}async componentDidMount(){var d,u,m,h;const t=[...this.state.icons];let i=!1;const s=(u=(d=this.props.enum)==null?void 0:d.common)==null?void 0:u.members,n=this.props.cachedIcons;try{if(s){for(let g=0;g<t.length;g++)if(!t[g]){const c=H.getParentId(s[g]);if(n[c]!==void 0){n[c]&&(t[g]=n[c],i=!0);continue}if(c&&c.split(".").length>2){const l=await this.props.socket.getObject(c);if(l&&(l.type==="channel"||l.type==="device")){if((m=l.common)!=null&&m.icon)n[c]=l.common.icon,t[g]=l.common.icon,i=!0;else{const _=H.getParentId(c);if(_&&_.split(".").length>2){const y=await this.props.socket.getObject(_);y&&(y.type==="channel"||y.type==="device")&&(h=y.common)!=null&&h.icon&&(n[_]=y.common.icon,n[c]=y.common.icon,t[g]=y.common.icon,i=!0),n[_]=n[_]||null}}n[c]=n[c]||null}}}}}catch(g){window.alert(`Cannot get icons: ${g}`)}const a=".";if(s){const g=this.props.members;for(let c=0;c<t.length;c++){const l=t[c],_=s[c];if(l&&!l.startsWith("data:image/")&&l.includes(".")){let y;g[_]&&(g[_].type==="instance"||g[_].type==="adapter")?t[c]=`${a}/adapter/${this.props.getName(g[_].common.name)}/${l}`:_&&_.startsWith("system.adapter.")?(y=_.split(".",3),l[0]==="/"?y[2]+=l:y[2]+=`/${l}`,t[c]=`${a}/adapter/${y[2]}`):(y=_.split(".",2),l[0]==="/"?y[0]+=l:y[0]+=`/${l}`,t[c]=`${a}/adapter/${y[0]}`),i=!0}}}i&&this.setState({icons:t})}render(){var d,u,m;const t=this.props,i=(d=t.enum)==null?void 0:d.common,s=H.getInvertedColor(i==null?void 0:i.color,t.themeType,!0),n={opacity:this.props.isDragging?0:1,color:s};i!=null&&i.color&&(n.backgroundColor=t.enum.common.color);let a=i!=null&&i.icon?r.jsx(J,{style:{...D.icon,...t.childrenCount?D.folderIcon:void 0,...t.childrenCount&&!t.closed?D.folderIconExpanded:void 0},src:t.enum.common.icon}):r.jsx(C.List,{style:{...D.icon,...t.childrenCount?D.folderIcon:void 0,...t.childrenCount&&!t.closed?D.folderIconExpanded:void 0}});return a=t.childrenCount?r.jsx("div",{style:D.folderDiv,onClick:()=>t.toggleEnum(t.id),children:t.closed?[r.jsx(Pe,{style:D.folder},1),r.jsx("div",{children:a},2)]:[r.jsx(Le,{style:D.folder},1),r.jsx("div",{children:a},2)]}):a,this.props.iconDragRef&&(a=r.jsx("span",{ref:this.props.iconDragRef,children:a})),r.jsxs(p.Card,{style:n,sx:H.getStyle(this.props.theme,D.enumGroupCard,this.props.updating&&D.enumUpdating,!t.collapsed&&D.enumGroupCardExpanded),id:t.id,children:[r.jsxs("div",{style:D.enumCardContent,children:[r.jsxs("div",{style:D.right,children:[t.enum?r.jsx(p.IconButton,{size:"small",onClick:()=>t.showEnumEditDialog(t.enum,!1),children:r.jsx(p.Tooltip,{title:t.t("Edit"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:r.jsx(C.Edit,{style:{color:s}})})}):null,t.enum?r.jsx(p.IconButton,{size:"small",onClick:()=>t.copyEnum(t.id),children:r.jsx(p.Tooltip,{title:t.t("Clone"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:r.jsx(C.FileCopy,{style:{color:s}})})}):null,r.jsx(p.IconButton,{size:"small",onClick:()=>t.showEnumDeleteDialog(t.enum),disabled:i==null?void 0:i.dontDelete,children:r.jsx(p.Tooltip,{title:t.t("Delete"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:r.jsx(C.Delete,{style:i!=null&&i.dontDelete?null:{color:s}})})})]}),r.jsxs(p.CardContent,{style:D.context,children:[r.jsxs(p.Typography,{gutterBottom:!t.collapsed,component:"div",style:D.enumGroupTitle,onClick:()=>t.onCollapse(t.id),children:[a,r.jsxs("div",{style:D.enumGroupName,children:[r.jsx("span",{style:D.enumGroupEnumName,children:t.name||t.getName(i==null?void 0:i.name)||t.id.split(".").pop()}),r.jsx("span",{style:D.enumGroupEnumID,children:t.idText||t.id}),i!=null&&i.desc?r.jsx("div",{style:D.enumName,children:t.getName(i.desc)}):null]})]}),r.jsx("div",{children:!t.collapsed&&(i!=null&&i.members)?t.enum.common.members.map((h,g)=>{var _,y;const c=t.members[h];if(!c)return null;const l=((_=c.common)==null?void 0:_.name)&&t.getName((y=c.common)==null?void 0:y.name);return r.jsxs(p.Card,{title:l?`${t.t("Name: %s",l)}
|
|
111
111
|
ID: ${c._id}`:c._id,variant:"outlined",sx:D.enumGroupMember,style:{color:s,borderColor:`${s}80`},children:[this.state.icons[g]?r.jsx(J,{style:D.icon,src:this.state.icons[g]}):c.type==="state"?r.jsx(Fe,{style:D.icon}):c.type==="channel"?r.jsx($e,{style:D.icon}):c.type==="device"?r.jsx(He,{style:D.icon}):r.jsx(C.List,{style:D.icon}),r.jsxs("div",{children:[l||c._id,l?r.jsx("div",{style:D.secondLine,children:c._id}):null]}),r.jsx(p.IconButton,{size:"small",onClick:()=>t.removeMemberFromEnum(c._id,t.id),children:r.jsx(p.Tooltip,{title:t.t("Remove"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:r.jsx(C.Clear,{style:{color:s}})})})]},c._id)}):(u=i==null?void 0:i.members)!=null&&u.length?r.jsx("div",{style:{...D.membersNumber,...t.childrenCount?D.memberNumberFolder:void 0},children:(m=i==null?void 0:i.members)==null?void 0:m.length}):""})]})]}),r.jsxs("div",{style:D.bottomButtons,children:[r.jsx(p.IconButton,{size:"small",onClick:()=>{["functions","rooms"].includes(t.currentCategory)?t.showEnumTemplateDialog(t.id):t.showEnumEditDialog(t.getEnumTemplate(t.id),!0)},children:r.jsx(p.Tooltip,{title:t.t("Add child"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:r.jsx(C.Add,{style:{color:s}})})}),r.jsx(p.IconButton,{size:"small",onClick:()=>t.onCollapse(t.id),children:r.jsx(p.Tooltip,{title:t.collapsed?t.t("Show members"):t.t("Hide members"),placement:"top",children:t.collapsed?r.jsx(C.KeyboardArrowDown,{style:{color:s}}):r.jsx(C.KeyboardArrowUp,{style:{color:s}})})})]})]})}}function ft(e,t){var i;return!e.getItem()||!e.getItem().data?!0:t?(i=t.common)!=null&&i.members?!t.common.members.includes(e.getItem().data.id):!0:!1}const Et=e=>{var m,h;const[{canDrop:t,isOver:i},s]=Se(()=>({accept:["object","enum"],drop:()=>({enumId:e.id}),canDrop:(g,c)=>ft(c,e.enum),collect:g=>({isOver:g.isOver(),canDrop:g.canDrop()})}),[(h=(m=e.enum)==null?void 0:m.common)==null?void 0:h.members]),n=S.useRef(null),[{isDragging:a},d,u]=Oe({type:"enum",item:()=>{var g;return{enumId:e.id,preview:r.jsx("div",{style:{width:((g=n.current)==null?void 0:g.offsetWidth)||50},children:r.jsx(ne,{...e})})}},end:(g,c)=>{const l=c.getDropResult();if(l)e.moveEnum(g.enumId,l.enumId);else{const _=g.enumId.split(".");e.moveEnum(g.enumId,`${_[0]}.${_[1]}`)}},collect:g=>({isDragging:g.isDragging(),handlerId:g.getHandlerId()})});return S.useEffect(()=>{u(je(),{captureDraggingState:!0})},[u]),e.enum?M.isTouchDevice()?r.jsx("div",{ref:s,style:{opacity:t&&i?.5:1},children:r.jsx("div",{ref:n,children:r.jsx(ne,{isDragging:a,iconDragRef:d,...e})})}):r.jsx("div",{ref:s,style:{opacity:t&&i?.5:1},children:r.jsx("div",{ref:d,children:r.jsx("div",{ref:n,children:r.jsx(ne,{isDragging:a,...e})})})}):r.jsx(ne,{isDragging:a,...e})},yt=e=>{const[,t]=Se(()=>({accept:["enum"],drop:()=>({enumId:e.categoryData._id}),collect:s=>({isOver:s.isOver(),canDrop:s.canDrop()})})),i=H.getInvertedColor(e.categoryData.common.color,e.themeType,!0);return r.jsxs("span",{ref:t,style:{...e.styles.categoryTitle,color:i},children:[e.categoryData.common.icon?r.jsx(J,{style:e.styles.icon,src:e.categoryData.common.icon}):null,typeof e.categoryData.common.name=="string"?e.categoryData.common.name:e.categoryData.common.name[e.lang]||e.categoryData.common.name.en,r.jsx(p.IconButton,{size:"small",style:{color:i},onClick:()=>{e.showEnumEditDialog(e.categoryData,!1)},children:r.jsx(p.Tooltip,{title:e.t("Edit"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:r.jsx(C.Edit,{})})}),e.categoryData.common.dontDelete?null:r.jsx(p.IconButton,{size:"small",style:{color:i},onClick:()=>e.showEnumDeleteDialog(e.categoryData),children:r.jsx(p.Tooltip,{title:e.t("Delete"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:r.jsx(C.Delete,{})})})]})},R={contentRoot:{padding:"16px 24px"},dialogTitle:{borderBottom:"1px solid #00000020",padding:0,width:"100%"},dialogActions:{borderTop:"1px solid #00000020",width:"100%"},dialog:{},iconPreview:{height:32,width:32},colorPicker:{},formIcon:{margin:10,opacity:.6},formContainer:{display:"flex",justifyContent:"center",alignItems:"center"},formControl:{display:"flex",padding:"0 0 24px 0",flexGrow:1e3}};function Dt(e){const t=e.enums.find(u=>u._id===e.enum._id);let i=e.enum._id!=="system.enum.";e.isNew&&t&&(i=!1);const s=u=>u.split(".").pop(),n=u=>u.replace(H.FORBIDDEN_CHARS,"_").replace(/\s/g,"_").replace(/\./g,"_").replace(/,/g,"_").replace(/__/g,"_").replace(/__/g,"_"),a=u=>u&&typeof u=="object"?u[e.lang]||u.en:u||"",d=(u,m)=>{const h=u.split(".");return h[h.length-1]=m,h.join(".")};return r.jsxs(p.Dialog,{fullWidth:e.innerWidth<500,open:!0,onClose:(u,m)=>{m!=="backdropClick"&&m!=="escapeKeyDown"&&e.onClose()},children:[r.jsx(p.DialogTitle,{style:{...R.dialogTitle,padding:12},children:e.t("Enum parameters")}),r.jsx(p.DialogContent,{sx:{"&.MuiDialogContent-root":R.contentRoot},children:r.jsxs(p.Grid2,{container:!0,spacing:2,style:R.dialog,children:[r.jsx(p.Grid2,{size:{xs:12,md:6},children:r.jsx(se,{label:"Name",t:e.t,value:e.getName(e.enum.common.name),onChange:u=>{const m=e.enum;!e.enum.common.dontDelete&&n(e.getName(m.common.name))===s(m._id)&&(m._id=d(m._id,n(u))),m.common.name=u,e.onChange(m)},autoComplete:"off",icon:C.TextFields,styles:R})}),r.jsx(p.Grid2,{size:{xs:12,md:6},children:r.jsx(se,{label:"ID edit",t:e.t,disabled:e.enum.common.dontDelete,value:e.enum._id.split(".")[e.enum._id.split(".").length-1],onChange:u=>{const m=JSON.parse(JSON.stringify(e.enum));m._id=d(m._id,n(u)),e.onChange(m)},icon:C.LocalOffer,styles:R})}),r.jsx(p.Grid2,{size:{xs:12,md:6},children:r.jsx(se,{label:"ID preview",t:e.t,disabled:!0,value:e.enum._id,icon:C.Pageview,styles:R})}),r.jsx(p.Grid2,{size:{xs:12,md:6},children:r.jsx(se,{label:"Description",t:e.t,value:a(e.enum.common.desc),onChange:u=>{const m=e.enum;m.common.desc=u,e.onChange(m)},icon:C.Description,styles:R})}),r.jsx(p.Grid2,{size:{xs:12,md:6},children:r.jsx(Ge,{label:"Icon",onlyDevices:e.enum._id.startsWith("enum.functions."),onlyRooms:e.enum._id.startsWith("enum.rooms."),value:e.enum.common.icon,onChange:u=>{const m=e.enum;m.common.icon=u,e.onChange(m)},previewStyle:R.iconPreview,icon:C.Image,customStyles:R})}),r.jsx(p.Grid2,{size:{xs:12,md:6},children:r.jsx(et,{label:"Color",value:e.enum.common.color,previewStyle:R.iconPreview,onChange:u=>{const m=e.enum;m.common.color=u,e.onChange(m)},icon:C.ColorLens,style:R.colorPicker,styles:R,t:e.t})})]})}),r.jsxs(p.DialogActions,{style:R.dialogActions,children:[r.jsx(p.Button,{variant:"contained",color:"primary",autoFocus:!0,onClick:()=>e.saveData(),disabled:!i||!e.changed,startIcon:r.jsx(C.Check,{}),children:e.t("Save")}),r.jsx(p.Button,{variant:"contained",color:"grey",onClick:e.onClose,startIcon:r.jsx(C.Close,{}),children:e.t("Cancel")})]})]})}const we=JSON.parse(`[{"_id":"hood","name":{"en":"Hood","ru":"Вытяжка","de":"Abzugshaube","fr":"Capot","it":"Cappe","nl":"Hood","pl":"Okapy","pt":"Hood","es":"Campana","zh-cn":"抽油烟机"},"icon":"Hoods"},{"_id":"alarm_system","name":{"en":"Alarm System","ru":"Сигнализация","de":"Alarmanlage","fr":"Systèmes D'Alarme","it":"Sistemi Di Allarme","nl":"Alarm Systems","pl":"Systemy Alarmowe","pt":"Sistemas De Alarme","es":"Sistemas De Alarma","zh-cn":"报警系统"},"icon":"Alarm Systems"},{"_id":"battery_status","name":{"en":"Battery Status","ru":"Заряд батареи","de":"Batteriestatus","fr":"État De La Batterie","it":"Stato Della Batteria","nl":"Batterij Status","pl":"Stan Baterii","pt":"Estado Da Bateria","es":"Estado De La Batería","zh-cn":"电池状态"},"icon":"Battery Status"},{"_id":"lighting","name":{"en":"Lighting","ru":"Светильник","de":"Beleuchtung","fr":"Éclairages","it":"Illuminazione","nl":"Verlichting","pl":"Oprawy Oświetleniowe","pt":"Iluminações","es":"Iluminaciones","zh-cn":"照明"},"icon":"Lightings"},{"_id":"shading","name":{"en":"Shading","ru":"Затенение","de":"Beschattungen","fr":"Ombres","it":"Ombreggiatura","nl":"Shading","pl":"Zacienienie","pt":"Shading","es":"Sombreado","zh-cn":"底纹"},"icon":"Shading"},{"_id":"irrigation","name":{"en":"Irrigation","ru":"Орошение","de":"Bewässerung","fr":"Irrigation","it":"Irrigazione","nl":"Irrigatie","pl":"Nawadnianie","pt":"Irrigação","es":"Irrigación","zh-cn":"灌溉"},"icon":"Irrigation"},{"_id":"iron","name":{"en":"Iron","ru":"Утюг","de":"Bügeleisen","fr":"Le Fer","it":"Ferro","nl":"Ijzer","pl":"Żelazo","pt":"Ferro","es":"Hierro","zh-cn":"铁"},"icon":"Iron"},{"_id":"computer","name":{"en":"Computer","ru":"Компьютер","de":"Rechner","fr":"L'Ordinateur","it":"Computer","nl":"Computer","pl":"Komputer","pt":"Computador","es":"Ordenador","zh-cn":"电脑"},"icon":"Computer"},{"_id":"ceiling_spotlight","name":{"en":"Ceiling Spotlight","ru":"Потолочный прожектор","de":"Deckenspot","fr":"Plafond Spotlight","it":"Faretti A Soffitto","nl":"Plafond Spotlight","pl":"Reflektory Sufitowe","pt":"Tecto Foco","es":"Focos De Techo","zh-cn":"天花射灯"},"icon":"Ceiling Spotlights"},{"_id":"printer","name":{"en":"Printer","de":"Drucker","ru":"Принтер","pt":"Impressora","nl":"Printer","fr":"Imprimante","it":"Stampante","es":"Impresora","pl":"Drukarka","zh-cn":"打印机"},"icon":"Printer"},{"_id":"power_consumption","name":{"en":"Power Consumption","ru":"Потребляемая мощность","de":"Stromverbrauch","fr":"Consommation D'Énergie","it":"Consumo Di Energia","nl":"Energieverbruik","pl":"Pobór Energii","pt":"Consumo De Energia","es":"El Consumo De Energía","zh-cn":"能量消耗"},"icon":"Power Consumption"},{"_id":"window","name":{"en":"Window","ru":"Окно","de":"Fenster","fr":"La Fenêtre","it":"Finestra","nl":"Venster","pl":"Okno","pt":"Janela","es":"Ventana","zh-cn":"窗户"},"icon":"Window"},{"_id":"garage_door","name":{"en":"Garage Door","ru":"Гаражные Ворота","de":"Garagentor","fr":"Portes De Garage","it":"Garage Door","nl":"Garage Door","pl":"Bramy Garażowe","pt":"Portas De Garagem","es":"Las Puertas De Garaje","zh-cn":"车库门"},"icon":"Garage Doors"},{"_id":"hairdryer","name":{"en":"Hairdryer","ru":"Фен","de":"Haartrockner","fr":"Sèche-Cheveux","it":"Asciugacapelli","nl":"Haardroger","pl":"Suszarka Do Włosów","pt":"Secador De Cabelo","es":"Secador De Pelo","zh-cn":"电吹风"},"icon":"Hairdryer"},{"_id":"hanging_lamp","name":{"en":"Hanging Lamp","ru":"Подвесной светильник","de":"Hängelampe","fr":"Lampes Suspendues","it":"Lampade A Sospensione","nl":"Opknoping Lampen","pl":"Lampy Wiszące","pt":"Lâmpadas De Suspensão","es":"Lámparas Colgantes","zh-cn":"挂灯"},"icon":"Hanging Lamps"},{"_id":"doorstep","name":{"en":"Enterance","ru":"Входная дверь","de":"Haustür","fr":"Seuil De Porte","it":"Gradino Della Porta","nl":"Drempel","pl":"Próg","pt":"Porta","es":"Peldaño","zh-cn":"门阶"},"icon":"Doorstep"},{"_id":"hot_water","name":{"en":"Hot Water","ru":"Горячая вода","de":"Heißwasser","fr":"Eau Chaude","it":"Acqua Calda","nl":"Heet Water","pl":"Gorąca Woda","pt":"Água Quente","es":"Agua Caliente","zh-cn":"热水"},"icon":"Hot Water"},{"_id":"heating","name":{"en":"Heating","ru":"Отопление","de":"Heizung","fr":"Chauffe-Eau","it":"Riscaldatore","nl":"Verwarmer","pl":"Podgrzewacz","pt":"Aquecedor","es":"Calentador","zh-cn":"加热器"},"icon":"Heater"},{"_id":"stove","name":{"en":"Stove","ru":"Печь","de":"Herd","fr":"Le Fourneau","it":"Stufa","nl":"Fornuis","pl":"Kuchenka","pt":"Forno","es":"Cocina","zh-cn":"火炉"},"icon":"Stove"},{"_id":"louvre","name":{"en":"Louvres","ru":"Жалюзи","de":"Jalousie","fr":"Persienne","it":"Persiana Di Ventilazione","nl":"Louvre","pl":"Żaluzja","pt":"Trapeira","es":"Lumbrera","zh-cn":"卢浮宫"},"icon":"Louvre"},{"_id":"coffee_maker","name":{"en":"Coffee Maker","ru":"Кофеварка","de":"Kaffeemaschine","fr":"Cafetière","it":"Macchine Da Caffè","nl":"Koffie Maker","pl":"Ekspresy Do Kawy","pt":"Cafeteira","es":"Cafetera","zh-cn":"咖啡壶"},"icon":"Coffee Makers"},{"_id":"cold_water","name":{"en":"Cold Water","ru":"Холодная вода","de":"Kaltwasser","fr":"Eau Froide","it":"Acqua Fredda","nl":"Koud Water","pl":"Zimna Woda","pt":"Água Fria","es":"Agua Fría","zh-cn":"冷水"},"icon":"Cold Water"},{"_id":"climate","name":{"en":"Climate","ru":"Климат","de":"Klima","fr":"Climat","it":"Clima","nl":"Klimaat","pl":"Klimat","pt":"Clima","es":"Clima","zh-cn":"气候"},"icon":"Climate"},{"_id":"speaker","name":{"en":"Speaker","ru":"Звуковая система","de":"Lautsprecher","fr":"Orateur","it":"Altoparlante","nl":"Spreker","pl":"Głośnik","pt":"Palestrante","es":"Altavoz","zh-cn":"扬声器"},"icon":"Speaker"},{"_id":"led_strip","name":{"en":"Led Strip","ru":"Светодиодная лента","de":"LED Leiste","fr":"Led Strip","it":"Led Strip","nl":"Loden Strip","pl":"Pasek Ledowy","pt":"Led Faixa","es":"Tira Llevada","zh-cn":"灯带"},"icon":"Led Strip"},{"_id":"light","name":{"en":"Light","ru":"Свет","de":"Licht","fr":"Lumière","it":"Leggero","nl":"Licht","pl":"Lekki","pt":"Luz","es":"Luz","zh-cn":"光"},"icon":"Light"},{"_id":"fan","name":{"en":"Fan","ru":"Вентилятор","de":"Lüfter","fr":"Ventilateur","it":"Fan","nl":"Ventilator","pl":"Wentylator","pt":"Ventilador","es":"Ventilador","zh-cn":"扇子"},"icon":"Fan"},{"_id":"humidity","name":{"en":"Humidity","ru":"Влажность","de":"Luftfeuchtigkeit","fr":"Humidité","it":"Umidità","nl":"Vochtigheid","pl":"Wilgotność","pt":"Umidade","es":"Humedad","zh-cn":"湿度"},"icon":"Humidity"},{"_id":"ventilation","name":{"en":"Ventilation","ru":"Вентиляция","de":"Lüftung","fr":"Ventilation","it":"Ventilazione","nl":"Ventilatie","pl":"Wentylacja","pt":"Ventilação","es":"Ventilación","zh-cn":"通风"},"icon":"Ventilation"},{"_id":"chandelier","name":{"en":"Chandelier","ru":"Люстра","de":"Kronleuchter","fr":"Lustre","it":"Lampadario","nl":"Kroonluchter","pl":"Żyrandol","pt":"Lustre","es":"Candelabro","zh-cn":"枝形吊灯"},"icon":"Chandelier"},{"_id":"awning","name":{"en":"Awning","ru":"Маркиза","de":"Markise","fr":"Auvents","it":"Tende","nl":"Luifels","pl":"Okrycia","pt":"Toldos","es":"Toldos","zh-cn":"遮阳篷"},"icon":"Awnings"},{"_id":"music","name":{"en":"Music","ru":"Музыка","de":"Musik","fr":"Musique","it":"Musica","nl":"Muziek","pl":"Muzyka","pt":"Música","es":"Música","zh-cn":"音乐"},"icon":"Music"},{"_id":"people","name":{"en":"People","ru":"Люди","de":"Personen","fr":"Gens","it":"Persone","nl":"Mensen","pl":"Ludzie","pt":"Pessoas","es":"Personas","zh-cn":"人们"},"icon":"People"},{"_id":"pool","name":{"en":"Pool","ru":"Бассейн","de":"Pool","fr":"Piscine","it":"Piscina","nl":"Zwembad","pl":"Basen","pt":"Piscina","es":"Piscina","zh-cn":"水池"},"icon":"Pool"},{"_id":"pump","name":{"en":"Pump","ru":"Насос","de":"Pumpe","fr":"Pompe","it":"Pompa","nl":"Pomp","pl":"Pompa","pt":"Bombear","es":"Bomba","zh-cn":"泵"},"icon":"Pump"},{"_id":"outdoor_blinds","name":{"en":"Outdoor Blinds","ru":"Внещгте жалюзи","de":"Raffstore","fr":"Volets","it":"Tende Da Esterni","nl":"Outdoor Blinds","pl":"Rolety Zewnętrzne","pt":"Estores Exteriores","es":"Persianas Exteriores","zh-cn":"室外百叶窗"},"icon":"Outdoor Blinds"},{"_id":"mowing_machine","name":{"en":"Mowing Machine","ru":"Газонокосилка","de":"Rasenmäher","fr":"Machine De Fauchage","it":"Macchina Di Falciatura","nl":"Maaimachine","pl":"Kosiarka","pt":"Roçada Máquina","es":"Segadora","zh-cn":"割草机"},"icon":"Mowing Machine"},{"_id":"receiver","name":{"en":"Receiver","ru":"Приставка","de":"Receiver","fr":"Destinataire","it":"Ricevitore","nl":"Ontvanger","pl":"Odbiorca","pt":"Recebedor","es":"Receptor","zh-cn":"接收者"},"icon":"Receiver"},{"_id":"shutters","name":{"en":"Shutters","ru":"Ставни","de":"Rollladen","fr":"Volets","it":"Persiane","nl":"Shutters","pl":"Żaluzje","pt":"Persianas","es":"Persianas","zh-cn":"百叶窗"},"icon":"Shutters"},{"_id":"smoke_detector","name":{"en":"Smoke detector","de":"Rauchmelder","ru":"Детектор дыма","pt":"Detector de fumaça","nl":"Rookdetector","fr":"Détecteur de fumée","it":"Rilevatore di fumo","es":"Detector de humo","pl":"Wykrywacz dymu","zh-cn":"烟雾探测器"},"icon":"SmokeDetector"},{"_id":"lock","name":{"en":"Lock","ru":"Замок","de":"Schloß","fr":"Fermer À Clé","it":"Serratura","nl":"Slot","pl":"Zamek","pt":"Trancar","es":"Cerrar Con Llave","zh-cn":"锁"},"icon":"Lock"},{"_id":"security","name":{"en":"Security","ru":"Безопасность","de":"Sicherheit","fr":"Sécurité","it":"Sicurezza","nl":"Veiligheid","pl":"Bezpieczeństwo","pt":"Segurança","es":"Seguridad","zh-cn":"安全"},"icon":"Security"},{"_id":"dishwasher","name":{"en":"Dishwasher","ru":"Посудомоечная машина","de":"Spülmaschine","fr":"Lave-Vaisselles","it":"Lavastoviglie","nl":"Vaatwassers","pl":"Zmywarki","pt":"Máquinas De Lavar Louça","es":"Lavaplatos","zh-cn":"洗碗机"},"icon":"Dishwashers"},{"_id":"vacuum_cleaner","name":{"en":"Vacuum Cleaner","ru":"Пылесос","de":"Staubsauger","fr":"Aspirateur","it":"Aspirapolvere","nl":"Stofzuiger","pl":"Odkurzacz","pt":"Aspirador De Pó","es":"Aspiradora","zh-cn":"吸尘器"},"icon":"Vacuum Cleaner"},{"_id":"socket","name":{"en":"Socket","ru":"Розетка","de":"Steckdose","fr":"Prise","it":"Socket","nl":"Socket","pl":"Gniazdka","pt":"Tomada","es":"Zócalo","zh-cn":"套接字"},"icon":"Sockets"},{"_id":"floor_lamp","name":{"en":"Floor Lamp","ru":"Торшер","de":"Stehlampe","fr":"Lampes Pour Plancher","it":"Lampade A Stelo","nl":"Vloerlampen","pl":"Lampy Podłogowe","pt":"Lâmpadas Chão","es":"Lámparas De Pie","zh-cn":"落地灯"},"icon":"Floor Lamps"},{"_id":"power_consumption","name":{"en":"Power Consumption","ru":"Потребляемая мощность","de":"Stromverbrauch","fr":"Consommation D'Énergie","it":"Consumo Di Energia","nl":"Energieverbruik","pl":"Pobór Energii","pt":"Consumo De Energia","es":"El Consumo De Energía","zh-cn":"能量消耗"},"icon":"Power Consumption"},{"_id":"temperature_sensor","name":{"en":"Temperature Sensor","ru":"Температурный датчик","de":"Temperatur-Sensor","fr":"Capteur De Température","it":"Sensori Di Temperatura","nl":"Temperatuursensor","pl":"Czujniki Temperatury","pt":"Sensores De Temperatura","es":"Sensores De Temperatura","zh-cn":"温度传感器"},"icon":"Temperature Sensors"},{"_id":"table_lamp","name":{"en":"Table Lamp","ru":"Настольная лампа","de":"Tischlampe","fr":"Lampe De Chevet","it":"Lampade Da Tavolo","nl":"Tafellampen","pl":"Lampy Stołowe","pt":"Lâmpadas De Mesa","es":"Lámparas De Mesa","zh-cn":"台灯"},"icon":"Table Lamps"},{"_id":"gate","name":{"en":"Gate","ru":"Ворота","de":"Tor","fr":"Porte","it":"Gate","nl":"Gate","pl":"Bramy","pt":"Portões","es":"Puertas","zh-cn":"盖茨"},"icon":"Gates"},{"_id":"dryer","name":{"en":"Dryer","ru":"Сушилка","de":"Trockner","fr":"Séchoir","it":"Asciugatrice","nl":"Droger","pl":"Suszarka","pt":"Secador","es":"Secadora","zh-cn":"烘干机"},"icon":"Dryer"},{"_id":"door","name":{"en":"Door","ru":"Дверь","de":"Tür","fr":"Des Portes","it":"Porte","nl":"Deuren","pl":"Drzwi","pt":"Portas","es":"Puertas","zh-cn":"门"},"icon":"Doors"},{"_id":"tv","name":{"en":"Tv","ru":"Телевизор","de":"TV","fr":"La Télé","it":"Tv","nl":"Tv","pl":"Telewizja","pt":"Televisão","es":"Televisor","zh-cn":"电视"},"icon":"Tv"},{"_id":"consumption","name":{"en":"Consumption","ru":"Потребление","de":"Verbrauch","fr":"Consommation","it":"Consumo","nl":"Consumptie","pl":"Konsumpcja","pt":"Consumo","es":"Consumo","zh-cn":"消费"},"icon":"Consumption"},{"_id":"amplifier","name":{"en":"Amplifier","ru":"Усилитель звука","de":"Verstärker","fr":"Amplificateur","it":"Amplificatore","nl":"Versterker","pl":"Wzmacniacz","pt":"Amplificador","es":"Amplificador","zh-cn":"放大器"},"icon":"Amplifier"},{"_id":"curtains","name":{"en":"Curtains","ru":"Шторы","de":"Vorhänge","fr":"Des Rideaux","it":"Le Tende","nl":"Gordijnen","pl":"Zasłony","pt":"Cortinas","es":"Cortinas","zh-cn":"窗帘"},"icon":"Curtains"},{"_id":"sconce","name":{"en":"Sconce","ru":"Настенный светильник","de":"Wandlampe","fr":"Sconce","it":"Sconce","nl":"Sconce","pl":"Kinkiety","pt":"Arandelas","es":"Los Apliques","zh-cn":"壁灯"},"icon":"Sconces"},{"_id":"washing_machine","name":{"en":"Washing Machine","ru":"Стиральная машина","de":"Waschmaschine","fr":"Machines À Laver","it":"Lavatrici","nl":"Wasmachines","pl":"Pralki","pt":"Máquinas De Lavar Roupas","es":"Lavadoras","zh-cn":"洗衣机"},"icon":"Washing Machines"},{"_id":"water","name":{"en":"Water","ru":"Вода","de":"Wasser","fr":"L'Eau","it":"Acqua","nl":"Water","pl":"Woda","pt":"Água","es":"Agua","zh-cn":"水"},"icon":"Water"},{"_id":"water_heater","name":{"en":"Water Heater","ru":"Нагреватель воды","de":"Wasserkocher","fr":"Chauffe-Eau","it":"Scaldabagno","nl":"Waterkoker","pl":"Podgrzewacz Wody","pt":"Aquecedor De Água","es":"Calentador De Agua","zh-cn":"热水器"},"icon":"Water Heater"},{"_id":"water_consumption","name":{"en":"Water Consumption","ru":"Потребление воды","de":"Wasserverbrauch","fr":"Consommation D'Eau","it":"Consumo D'Acqua","nl":"Waterverbruik","pl":"Konsumpcja Wody","pt":"Consumo De Água","es":"Consumo De Agua","zh-cn":"耗水量"},"icon":"Water Consumption"},{"_id":"weather","name":{"en":"Weather","ru":"Погода","de":"Wetter","fr":"La Météo","it":"Tempo Metereologico","nl":"Weer","pl":"Pogoda","pt":"Clima","es":"Tiempo","zh-cn":"天气"},"icon":"Weather"}]`),$={icon:{width:32,height:32},customGroupButton:{},enumTemplateButton:{justifyContent:"end",margin:4,padding:"4px 8px"},enumTemplateLabel:{textAlign:"right",opacity:.4,overflow:"hidden",textOverflow:"ellipsis",flexGrow:1},fullHeight:{height:"calc(100% - 32px)",maxHeight:900},filter:{marginLeft:16,marginTop:0,marginBottom:0},content:{display:"grid",width:"100%",gridTemplateColumns:"repeat(4,1fr)"}};class Ct extends S.Component{constructor(t){super(t),this.state={icons:[],loading:!0,filter:""}}componentDidMount(){this.setState({loading:!0},()=>{const t=this.props.prefix.startsWith("enum.functions")?we:Te,i=[],s=t.map(async(n,a)=>{try{const u=await Me(Object.assign({"../../assets/building-types/Apartment Building.svg":()=>o(()=>import("./Apartment Building-HW0f75vl.js"),[],import.meta.url),"../../assets/building-types/Flat.svg":()=>o(()=>import("./Flat-DIm-i9rK.js"),[],import.meta.url),"../../assets/devices/Alarm Systems.svg":()=>o(()=>import("./Alarm Systems-gR7dS0A2.js"),[],import.meta.url),"../../assets/devices/Amplifier.svg":()=>o(()=>import("./Amplifier-25Guwmsj.js"),[],import.meta.url),"../../assets/devices/Awnings.svg":()=>o(()=>import("./Awnings-Co-hmfUH.js"),[],import.meta.url),"../../assets/devices/Battery Status.svg":()=>o(()=>import("./Battery Status-B87Kvv-I.js"),[],import.meta.url),"../../assets/devices/Ceiling Spotlights.svg":()=>o(()=>import("./Ceiling Spotlights-DtqldpdR.js"),[],import.meta.url),"../../assets/devices/Chandelier.svg":()=>o(()=>import("./Chandelier-Cd8E2Wtu.js"),[],import.meta.url),"../../assets/devices/Climate.svg":()=>o(()=>import("./Climate-D413u9id.js"),[],import.meta.url),"../../assets/devices/Coffee Makers.svg":()=>o(()=>import("./Coffee Makers-KF4ZcNxS.js"),[],import.meta.url),"../../assets/devices/Cold Water.svg":()=>o(()=>import("./Cold Water-CkeFWerW.js"),[],import.meta.url),"../../assets/devices/Computer.svg":()=>o(()=>import("./Computer-BTE1qsMK.js"),[],import.meta.url),"../../assets/devices/Consumption.svg":()=>o(()=>import("./Consumption-kn0jqZNL.js"),[],import.meta.url),"../../assets/devices/Curtains.svg":()=>o(()=>import("./Curtains-CHoQr379.js"),[],import.meta.url),"../../assets/devices/Dishwashers.svg":()=>o(()=>import("./Dishwashers-B-Sw8Agt.js"),[],import.meta.url),"../../assets/devices/Doors.svg":()=>o(()=>import("./Doors-CGplwj0G.js"),[],import.meta.url),"../../assets/devices/Doorstep.svg":()=>o(()=>import("./Doorstep-CDxK6WGU.js"),[],import.meta.url),"../../assets/devices/Dryer.svg":()=>o(()=>import("./Dryer-Cq6roMKB.js"),[],import.meta.url),"../../assets/devices/Fan.svg":()=>o(()=>import("./Fan-JaXmdymA.js"),[],import.meta.url),"../../assets/devices/Floor Lamps.svg":()=>o(()=>import("./Floor Lamps-CRZ476zt.js"),[],import.meta.url),"../../assets/devices/Garage Doors.svg":()=>o(()=>import("./Garage Doors-CkWxHxVX.js"),[],import.meta.url),"../../assets/devices/Gates.svg":()=>o(()=>import("./Gates-C78n8Uvq.js"),[],import.meta.url),"../../assets/devices/Hairdryer.svg":()=>o(()=>import("./Hairdryer-CWFjS2Ij.js"),[],import.meta.url),"../../assets/devices/Handle.svg":()=>o(()=>import("./Handle-wHYWJ26z.js"),[],import.meta.url),"../../assets/devices/Hanging Lamps.svg":()=>o(()=>import("./Hanging Lamps-MotocLIk.js"),[],import.meta.url),"../../assets/devices/Heater.svg":()=>o(()=>import("./Heater-ceSMUh-t.js"),[],import.meta.url),"../../assets/devices/Hoods.svg":()=>o(()=>import("./Hoods-Bz4IVHgt.js"),[],import.meta.url),"../../assets/devices/Hot Water.svg":()=>o(()=>import("./Hot Water-HJAmxfSV.js"),[],import.meta.url),"../../assets/devices/Humidity.svg":()=>o(()=>import("./Humidity-CVLTW-gm.js"),[],import.meta.url),"../../assets/devices/Iron.svg":()=>o(()=>import("./Iron-BmVcdQDM.js"),[],import.meta.url),"../../assets/devices/Irrigation.svg":()=>o(()=>import("./Irrigation-BhJPKg6k.js"),[],import.meta.url),"../../assets/devices/Led Strip.svg":()=>o(()=>import("./Led Strip-BcmH_zbj.js"),[],import.meta.url),"../../assets/devices/Light.svg":()=>o(()=>import("./Light-ChIiCfYD.js"),[],import.meta.url),"../../assets/devices/Lightings.svg":()=>o(()=>import("./Lightings-C0WZ69yF.js"),[],import.meta.url),"../../assets/devices/Lock.svg":()=>o(()=>import("./Lock-BMJY64TO.js"),[],import.meta.url),"../../assets/devices/Louvre.svg":()=>o(()=>import("./Louvre-C5YcNLVm.js"),[],import.meta.url),"../../assets/devices/Mowing Machine.svg":()=>o(()=>import("./Mowing Machine-8EOTsqgg.js"),[],import.meta.url),"../../assets/devices/Music.svg":()=>o(()=>import("./Music-GTFyD3_A.js"),[],import.meta.url),"../../assets/devices/Outdoor Blinds.svg":()=>o(()=>import("./Outdoor Blinds-CXkkQc7j.js"),[],import.meta.url),"../../assets/devices/People.svg":()=>o(()=>import("./People-D60rnvXq.js"),[],import.meta.url),"../../assets/devices/Pool.svg":()=>o(()=>import("./Pool-DLG0SZJN.js"),[],import.meta.url),"../../assets/devices/Power Consumption.svg":()=>o(()=>import("./Power Consumption-CKf-DuPt.js"),[],import.meta.url),"../../assets/devices/Printer.svg":()=>o(()=>import("./Printer-BBdg5KQ0.js"),[],import.meta.url),"../../assets/devices/Pump.svg":()=>o(()=>import("./Pump-qElQ0u4I.js"),[],import.meta.url),"../../assets/devices/Receiver.svg":()=>o(()=>import("./Receiver-CM3as5YE.js"),[],import.meta.url),"../../assets/devices/Sconces.svg":()=>o(()=>import("./Sconces-C-gkKtaK.js"),[],import.meta.url),"../../assets/devices/Security.svg":()=>o(()=>import("./Security-BD-3hOtV.js"),[],import.meta.url),"../../assets/devices/Shading.svg":()=>o(()=>import("./Shading-BYTX3uGs.js"),[],import.meta.url),"../../assets/devices/Shutters.svg":()=>o(()=>import("./Shutters-C0RWQwOf.js"),[],import.meta.url),"../../assets/devices/SmokeDetector.svg":()=>o(()=>import("./SmokeDetector-BI7HtY1L.js"),[],import.meta.url),"../../assets/devices/Sockets.svg":()=>o(()=>import("./Sockets-DGwEYIEX.js"),[],import.meta.url),"../../assets/devices/Speaker.svg":()=>o(()=>import("./Speaker-DYDUjQxp.js"),[],import.meta.url),"../../assets/devices/Stove.svg":()=>o(()=>import("./Stove-C_JAiJBF.js"),[],import.meta.url),"../../assets/devices/Table Lamps.svg":()=>o(()=>import("./Table Lamps-G4idrhKm.js"),[],import.meta.url),"../../assets/devices/Temperature Sensors.svg":()=>o(()=>import("./Temperature Sensors-BzDeIhhc.js"),[],import.meta.url),"../../assets/devices/Tv.svg":()=>o(()=>import("./Tv-GicrNRwV.js"),[],import.meta.url),"../../assets/devices/Vacuum Cleaner.svg":()=>o(()=>import("./Vacuum Cleaner-BazNfd2m.js"),[],import.meta.url),"../../assets/devices/Ventilation.svg":()=>o(()=>import("./Ventilation-D7F0rbZK.js"),[],import.meta.url),"../../assets/devices/Washing Machines.svg":()=>o(()=>import("./Washing Machines-DyIMTxKc.js"),[],import.meta.url),"../../assets/devices/Water Consumption.svg":()=>o(()=>import("./Water Consumption-C0sLvwRF.js"),[],import.meta.url),"../../assets/devices/Water Heater.svg":()=>o(()=>import("./Water Heater-Byq4Q86V.js"),[],import.meta.url),"../../assets/devices/Water.svg":()=>o(()=>import("./Water-Dcu-ZixL.js"),[],import.meta.url),"../../assets/devices/Weather.svg":()=>o(()=>import("./Weather-pQkhBG6o.js"),[],import.meta.url),"../../assets/devices/Window.svg":()=>o(()=>import("./Window-B0emTnKi.js"),[],import.meta.url),"../../assets/groups/group1.svg":()=>o(()=>import("./group1-DBYxcyxq.js"),[],import.meta.url),"../../assets/groups/group10.svg":()=>o(()=>import("./group10-BIcZMfE3.js"),[],import.meta.url),"../../assets/groups/group2.svg":()=>o(()=>import("./group2-BUQSell7.js"),[],import.meta.url),"../../assets/groups/group3.svg":()=>o(()=>import("./group3-B0AdMrOp.js"),[],import.meta.url),"../../assets/groups/group4.svg":()=>o(()=>import("./group4-TeCgDok7.js"),[],import.meta.url),"../../assets/groups/group5.svg":()=>o(()=>import("./group5-CJ_-VPxg.js"),[],import.meta.url),"../../assets/groups/group6.svg":()=>o(()=>import("./group6-JW-nEhw_.js"),[],import.meta.url),"../../assets/groups/group7.svg":()=>o(()=>import("./group7-CWpVuR4T.js"),[],import.meta.url),"../../assets/groups/group8.svg":()=>o(()=>import("./group8-CRGBxCwd.js"),[],import.meta.url),"../../assets/groups/group9.svg":()=>o(()=>import("./group9-BXRQchYG.js"),[],import.meta.url),"../../assets/rooms/Anteroom.svg":()=>o(()=>import("./Anteroom-DPbAOJ_i.js"),[],import.meta.url),"../../assets/rooms/Attic.svg":()=>o(()=>import("./Attic-CGXtMIdp.js"),[],import.meta.url),"../../assets/rooms/Balcony.svg":()=>o(()=>import("./Balcony-DfK6N3aX.js"),[],import.meta.url),"../../assets/rooms/Barn.svg":()=>o(()=>import("./Barn-Lc8i72_q.js"),[],import.meta.url),"../../assets/rooms/Basement.svg":()=>o(()=>import("./Basement-DPN5xOB9.js"),[],import.meta.url),"../../assets/rooms/Bathroom.svg":()=>o(()=>import("./Bathroom-DzUiTIHs.js"),[],import.meta.url),"../../assets/rooms/Bedroom.svg":()=>o(()=>import("./Bedroom-xMBCTCFq.js"),[],import.meta.url),"../../assets/rooms/Boiler Room.svg":()=>o(()=>import("./Boiler Room-Bor2zD5L.js"),[],import.meta.url),"../../assets/rooms/Carport.svg":()=>o(()=>import("./Carport-C8HtrUXH.js"),[],import.meta.url),"../../assets/rooms/Cellar.svg":()=>o(()=>import("./Cellar-DRGc9D6m.js"),[],import.meta.url),"../../assets/rooms/Chamber.svg":()=>o(()=>import("./Chamber-D3f_uF0H.js"),[],import.meta.url),"../../assets/rooms/Corridor.svg":()=>o(()=>import("./Corridor-CasyPy4F.js"),[],import.meta.url),"../../assets/rooms/Dining Area.svg":()=>o(()=>import("./Dining Area-9890E2Je.js"),[],import.meta.url),"../../assets/rooms/Dining Room.svg":()=>o(()=>import("./Dining Room-9890E2Je.js"),[],import.meta.url),"../../assets/rooms/Dining.svg":()=>o(()=>import("./Dining-9890E2Je.js"),[],import.meta.url),"../../assets/rooms/Dressing Room.svg":()=>o(()=>import("./Dressing Room-Dr_mWZjM.js"),[],import.meta.url),"../../assets/rooms/Driveway.svg":()=>o(()=>import("./Driveway-BehcXrKD.js"),[],import.meta.url),"../../assets/rooms/Entrance.svg":()=>o(()=>import("./Entrance-BYqUyt1q.js"),[],import.meta.url),"../../assets/rooms/Equipment Room.svg":()=>o(()=>import("./Equipment Room-B5AsGJCs.js"),[],import.meta.url),"../../assets/rooms/Front Yard.svg":()=>o(()=>import("./Front Yard-CsV9sTio.js"),[],import.meta.url),"../../assets/rooms/Gallery.svg":()=>o(()=>import("./Gallery-Cz16BrQ3.js"),[],import.meta.url),"../../assets/rooms/Garage.svg":()=>o(()=>import("./Garage-BxcK0Mpu.js"),[],import.meta.url),"../../assets/rooms/Garden.svg":()=>o(()=>import("./Garden-C67u1ESp.js"),[],import.meta.url),"../../assets/rooms/Ground Floor.svg":()=>o(()=>import("./Ground Floor-0zPWVd6I.js"),[],import.meta.url),"../../assets/rooms/Guest Bathroom.svg":()=>o(()=>import("./Guest Bathroom-DSAlkwqV.js"),[],import.meta.url),"../../assets/rooms/Guest Room.svg":()=>o(()=>import("./Guest Room-DijMrEih.js"),[],import.meta.url),"../../assets/rooms/Gym.svg":()=>o(()=>import("./Gym-D5EhuzLI.js"),[],import.meta.url),"../../assets/rooms/Hall.svg":()=>o(()=>import("./Hall-BXwSgCh7.js"),[],import.meta.url),"../../assets/rooms/Home Theater.svg":()=>o(()=>import("./Home Theater-BcYqHMU1.js"),[],import.meta.url),"../../assets/rooms/Kitchen.svg":()=>o(()=>import("./Kitchen-CfzTeEPK.js"),[],import.meta.url),"../../assets/rooms/Laundry Room.svg":()=>o(()=>import("./Laundry Room-zhlszIKu.js"),[],import.meta.url),"../../assets/rooms/Living Area.svg":()=>o(()=>import("./Living Area-CqhYSGQI.js"),[],import.meta.url),"../../assets/rooms/Living Room.svg":()=>o(()=>import("./Living Room-C7AE21A_.js"),[],import.meta.url),"../../assets/rooms/Locker Room.svg":()=>o(()=>import("./Locker Room-CyyDtimo.js"),[],import.meta.url),"../../assets/rooms/Nursery.svg":()=>o(()=>import("./Nursery-Cxrv-xmv.js"),[],import.meta.url),"../../assets/rooms/Office.svg":()=>o(()=>import("./Office-CIXVNXkh.js"),[],import.meta.url),"../../assets/rooms/Outdoors.svg":()=>o(()=>import("./Outdoors-BL5-A5jB.js"),[],import.meta.url),"../../assets/rooms/Playroom.svg":()=>o(()=>import("./Playroom-Cq-XMXTL.js"),[],import.meta.url),"../../assets/rooms/Pool.svg":()=>o(()=>import("./Pool-DA49roJI.js"),[],import.meta.url),"../../assets/rooms/Rear Wall.svg":()=>o(()=>import("./Rear Wall-BNvjPc7z.js"),[],import.meta.url),"../../assets/rooms/Second Floor.svg":()=>o(()=>import("./Second Floor-V-mYDL2A.js"),[],import.meta.url),"../../assets/rooms/Shed.svg":()=>o(()=>import("./Shed-liUNwlvT.js"),[],import.meta.url),"../../assets/rooms/Sleeping Area.svg":()=>o(()=>import("./Sleeping Area-41NoHRj5.js"),[],import.meta.url),"../../assets/rooms/Stairway.svg":()=>o(()=>import("./Stairway-DlYPygtf.js"),[],import.meta.url),"../../assets/rooms/Stairwell.svg":()=>o(()=>import("./Stairwell-DbZPzEAa.js"),[],import.meta.url),"../../assets/rooms/Storeroom.svg":()=>o(()=>import("./Storeroom-DVXZ_Y0f.js"),[],import.meta.url),"../../assets/rooms/Summer House.svg":()=>o(()=>import("./Summer House-l_7dnk-K.js"),[],import.meta.url),"../../assets/rooms/Swimming Pool.svg":()=>o(()=>import("./Swimming Pool-CQBR5mIg.js"),[],import.meta.url),"../../assets/rooms/Terrace.svg":()=>o(()=>import("./Terrace-YmL9ugkA.js"),[],import.meta.url),"../../assets/rooms/Toilet.svg":()=>o(()=>import("./Toilet-BKoDvjLo.js"),[],import.meta.url),"../../assets/rooms/Upstairs.svg":()=>o(()=>import("./Upstairs-W8fYn1Q6.js"),[],import.meta.url),"../../assets/rooms/Wardrobe.svg":()=>o(()=>import("./Wardrobe-Bns8F0nU.js"),[],import.meta.url),"../../assets/rooms/Washroom.svg":()=>o(()=>import("./Washroom-BqiNyqrk.js"),[],import.meta.url),"../../assets/rooms/Wc.svg":()=>o(()=>import("./Wc-BKoDvjLo.js"),[],import.meta.url),"../../assets/rooms/Windscreen.svg":()=>o(()=>import("./Windscreen-x8wYPJWL.js"),[],import.meta.url),"../../assets/rooms/Workshop.svg":()=>o(()=>import("./Workshop-CKHcsro_.js"),[],import.meta.url),"../../assets/rooms/Workspace.svg":()=>o(()=>import("./Workspace-DS72Rvmo.js"),[],import.meta.url),"../../assets/users/user1.svg":()=>o(()=>import("./user1-BHHH0LIq.js"),[],import.meta.url),"../../assets/users/user10.svg":()=>o(()=>import("./user10-Dvmqf8l1.js"),[],import.meta.url),"../../assets/users/user11.svg":()=>o(()=>import("./user11-C8ly5pY7.js"),[],import.meta.url),"../../assets/users/user12.svg":()=>o(()=>import("./user12-CHtaF3qG.js"),[],import.meta.url),"../../assets/users/user2.svg":()=>o(()=>import("./user2-BN56rMPt.js"),[],import.meta.url),"../../assets/users/user3.svg":()=>o(()=>import("./user3-Mx6XZSLK.js"),[],import.meta.url),"../../assets/users/user4.svg":()=>o(()=>import("./user4-DpEs_YiD.js"),[],import.meta.url),"../../assets/users/user5.svg":()=>o(()=>import("./user5-CVfrnlXE.js"),[],import.meta.url),"../../assets/users/user6.svg":()=>o(()=>import("./user6-C7HkYnq4.js"),[],import.meta.url),"../../assets/users/user7.svg":()=>o(()=>import("./user7-VAQcubFn.js"),[],import.meta.url),"../../assets/users/user8.svg":()=>o(()=>import("./user8-CwACr_jq.js"),[],import.meta.url),"../../assets/users/user9.svg":()=>o(()=>import("./user9-Dk4Mlhcc.js"),[],import.meta.url)}),`../../assets/${this.props.prefix.startsWith("enum.functions")?"devices":"rooms"}/${n.icon}.svg`,5),m=await H.getSvg(u.default);return i[a]=m}catch{return null}});Promise.all(s).then(()=>this.setState({icons:i,loading:!1}))})}render(){const t=this.props.prefix.startsWith("enum.functions")?we:Te;return r.jsxs(p.Dialog,{maxWidth:"md",fullWidth:!0,sx:{"& .MuiPaper-root":$.fullHeight},open:!0,onClose:this.props.onClose,children:[r.jsxs(p.DialogTitle,{children:[this.props.t(this.props.prefix.startsWith("enum.functions")?"Create new function":"Create new room"),r.jsx(p.TextField,{variant:"standard",style:$.filter,value:this.state.filter,onChange:i=>this.setState({filter:i.target.value.toLowerCase()}),placeholder:this.props.t("Filter"),margin:"dense",slotProps:{input:{endAdornment:this.state.filter?r.jsx(p.IconButton,{tabIndex:-1,size:"small",onClick:()=>this.setState({filter:""}),children:r.jsx(C.Clear,{})}):null}}})]}),r.jsxs(p.DialogContent,{style:{textAlign:"center"},children:[this.state.loading&&r.jsx(p.LinearProgress,{}),r.jsx("div",{style:$.content,children:t.map((i,s)=>{const n=M.getText(i.name,this.props.lang)||i._id;return this.props.enums[`${this.props.prefix}.${i._id}`]?null:!this.state.filter||n.toLowerCase().includes(this.state.filter)?r.jsx(p.Button,{color:"grey",variant:"outlined",onClick:()=>{this.props.onClose(),this.props.createEnumTemplate(this.props.prefix,{_id:`${this.props.prefix}.${i._id}`,type:"enum",common:{name:i.name,icon:this.state.icons[s]},native:{}})},style:$.enumTemplateButton,startIcon:r.jsx(J,{src:this.state.icons[s],style:$.icon}),children:r.jsx("span",{style:$.enumTemplateLabel,children:M.getText(i.name,this.props.lang)||i._id})},s):null})})]}),r.jsxs(p.DialogActions,{children:[r.jsx(p.Button,{variant:"contained",color:"primary",style:$.customGroupButton,onClick:()=>{this.props.onClose(),this.props.showEnumEditDialog(this.props.getEnumTemplate(this.props.prefix),!0)},startIcon:r.jsx(C.Brush,{}),children:this.props.prefix==="enum.rooms"?this.props.t("Custom room"):this.props.prefix==="enum.functions"?this.props.t("Custom function"):this.props.t("Custom enumeration")}),r.jsx(p.Button,{color:"grey",variant:"contained",onClick:this.props.onClose,startIcon:r.jsx(C.Close,{}),children:this.props.t("Cancel")})]})]})}}function xt(e){return r.jsxs(p.Dialog,{open:!0,onClose:e.onClose,children:[r.jsx(p.DialogTitle,{children:e.t("Please confirm")}),r.jsx(p.DialogContent,{children:r.jsx(p.DialogContentText,{children:e.t('Do you want to delete enum "%s"?',e.getName(e.enum.common.name))})}),r.jsxs(p.DialogActions,{children:[r.jsx(p.Button,{variant:"contained",autoFocus:!0,color:"primary",onClick:()=>e.deleteEnum(e.enum._id),startIcon:r.jsx(C.Delete,{}),children:e.t("Delete")}),r.jsx(p.Button,{variant:"contained",color:"grey",onClick:e.onClose,startIcon:r.jsx(C.Close,{}),children:e.t("Cancel")})]})]})}const Tt=e=>{const[t,i]=S.useState({DragWrapper:null}),s=L.useRef(null);return S.useEffect(()=>{i({DragWrapper:a=>{var c,l,_,y;const u={type:"object",end:(w,B)=>{const G=B.getDropResult();w.data&&G&&(w.data.obj?e.addItemToEnum(w.data.obj._id,G.enumId):window.alert(`TODO: Add all direct children of ${w.data.id}`))},item:{data:a.item.data,preview:a.item.data&&a.item.data.obj?r.jsxs(p.Card,{variant:"outlined",style:e.stylesParent.enumGroupMember,children:[(c=a.item.data.obj.common)!=null&&c.icon?r.jsx(J,{style:e.stylesParent.icon,src:s.current?Ke(s.current,a.item.data.obj._id,e.lang):a.item.data.obj.common.icon}):Ue[a.item.data.obj.type]||r.jsx(C.List,{style:e.stylesParent.icon}),r.jsxs("div",{children:[r.jsx("div",{children:(l=a.item.data.obj.common)!=null&&l.name?e.getName((_=a.item.data.obj.common)==null?void 0:_.name):a.item.data.obj._id}),(y=a.item.data.obj.common)!=null&&y.name?r.jsx("div",{style:{fontStyle:"italic",fontSize:"smaller",opacity:.7},children:a.item.data.obj._id}):null]})]},a.item.data.obj._id):null},collect:w=>({isDragging:w.isDragging()})},[{isDragging:m},h,g]=Oe(u);return S.useEffect(()=>{g(je(),{captureDraggingState:!0})},[g]),r.jsx(p.Box,{sx:a.style,ref:h,style:{backgroundColor:m?"rgba(100,152,255,0.1)":void 0},children:a.children},a.item.data.id)}})},[e.stylesParent,e.addItemToEnum,e.getName]),t?r.jsx(Je,{t:e.t,socket:e.socket,types:["state","channel","device"],columns:["name","type","role","room","func"],lang:e.lang,dragEnabled:!0,theme:e.theme,DragWrapper:t.DragWrapper,setObjectsReference:n=>s.current=n,levelPadding:10}):null},I={mainGridCont:{height:"100%",overflowY:"auto"},childGridCont:{display:"flex",flexDirection:"column",height:"100%"},enumGroupMember:{display:"flex",gap:8,alignItems:"center",padding:"8px 16px"},childGridContWide:{height:"100%"},blocksContainer:{overflowY:"auto",overflowX:"hidden"},canDrop:e=>({backgroundColor:e.palette.background.default}),icon:{height:32,width:32,marginRight:5,backgroundSize:"cover",backgroundPosition:"center",display:"inline-block"},categoryTitle:{flexDirection:"row",alignItems:"center",display:"inline-flex"},enumTemplateDialog:{overflowY:"auto",textAlign:"center"},enumTemplate:{display:"inline-flex",padding:10,width:200},toolbarButton:{},filter:{width:"100%",paddingRight:20},topPanel:{display:"flex",flexDirection:"row",alignItems:"center",paddingLeft:20},topPanel2:{display:"flex",flexDirection:"row",alignItems:"center",padding:"4px 20px",justifyContent:"space-between"},searchText:{color:"orange"}},bt=()=>{const e=tt(),t=e.display,{item:i,style:s}=e;return t?r.jsx("div",{style:{...s,zIndex:1e3},children:i.preview}):null},wt={favorites:{_id:"enum.favorites",type:"enum",common:{name:{en:"Favorites",de:"Favoriten",ru:"Избранное",pt:"Favoritos",nl:"Favorieten",fr:"Favoris",it:"Preferiti",es:"Favoritos",pl:"Ulubione",uk:"Обране","zh-cn":"收藏夹"}},native:{}}};function Ie(e,t){return(i,s)=>{var d,u,m,h;let n=t(((u=(d=e[i])==null?void 0:d.common)==null?void 0:u.name)||"")||i.split(".").pop(),a=t(((h=(m=e[s])==null?void 0:m.common)==null?void 0:h.name)||"")||s.split(".").pop();return n=n.toLowerCase(),a=a.toLowerCase(),n>a?1:n<a?-1:0}}const It={_id:"",type:"enum",common:{name:"",color:"",desc:"",members:[]},native:{}};class le extends S.Component{cachedIcons;fastUpdate;refFilter;refClearButton;updateTimeout=null;changeEnums;scrollToItem;searchTimer=null;constructor(t){super(t);const i=window._localStorage||window.localStorage;let s={};try{s=i.getItem("enumsClosed")?JSON.parse(i.getItem("enumsClosed")):{}}catch{}let n=[];try{n=i.getItem("enumsCollapsed")?JSON.parse(i.getItem("enumsCollapsed")):[]}catch{}const a=i.getItem("enumsSplitSizes");let d=[50,50];if(a){try{d=JSON.parse(a)}catch{}(!Array.isArray(d)||d.length!==2)&&(d=[50,50])}this.state={enums:null,enumsTree:null,currentCategory:i.getItem("enumCurrentCategory")||"",search:"",enumEditDialog:null,enumTemplateDialog:null,enumDeleteDialog:null,members:{},categoryPopoverOpen:!1,enumsClosed:s,updating:[],enumsCollapsed:n,innerWidth:0,splitSizes:d},this.cachedIcons={},this.fastUpdate=!1,this.refFilter=L.createRef(),this.refClearButton=L.createRef()}getEnumTemplate=t=>{const i=JSON.parse(JSON.stringify(It)),{_id:s,name:n}=le.findNewUniqueName(t,Object.values(this.state.enums),this.props.t("Enum"));return i._id=s,i.common.name=n,i};scrollToEnum(t){let i=t.split(".");i.pop();let s=!1;const n=JSON.parse(JSON.stringify(this.state.enumsClosed));for(;i.length>2;){const a=i.join(".");n[a]&&(delete n[a],s=!0),i=a.split("."),i.pop()}s?this.setState({enumsClosed:n},()=>{setTimeout(()=>{const a=document.getElementById(t);a==null||a.scrollIntoView(!0)},400)}):setTimeout(()=>{const a=document.getElementById(t);a==null||a.scrollIntoView(!0)},400)}addUpdating(t){if(!this.state.updating.includes(t)){const i=[...this.state.updating];return i.push(t),new Promise(s=>{this.setState({updating:i},()=>s())})}return Promise.resolve()}createEnumTemplate=(t,i)=>{const s=this.getEnumTemplate(t);s._id=i._id,s.common={...s.common,...i.common},this.scrollToItem=s._id,this.addUpdating(s._id).then(()=>this.props.socket.setObject(s._id,s)).catch(n=>window.alert(`Cannot create enum: ${n}`))};async componentDidMount(){await this.updateData(),await this.props.socket.subscribeObject("enum.*",this.onObjectChange)}componentWillUnmount(){this.props.socket.unsubscribeObject("enum.*",this.onObjectChange),this.updateTimeout&&(clearTimeout(this.updateTimeout),this.updateTimeout=null)}onObjectChange=(t,i)=>{let s;if(this.state.enums&&t.startsWith("enum."))if(i){const n=this.changeEnums&&this.changeEnums[t]||this.state.enums&&this.state.enums[t];(!n||n&&JSON.stringify(n)!==JSON.stringify(i))&&(this.changeEnums=this.changeEnums||JSON.parse(JSON.stringify(this.state.enums)),this.changeEnums[t]=i,s=!0)}else(this.changeEnums&&this.changeEnums[t]||!this.changeEnums&&this.state.enums&&this.state.enums[t])&&(this.changeEnums=this.changeEnums||JSON.parse(JSON.stringify(this.state.enums)),delete this.changeEnums[t],s=!0);s&&(this.updateTimeout&&clearTimeout(this.updateTimeout),this.updateTimeout=setTimeout(()=>{this.updateTimeout=null;const n=this.changeEnums;this.changeEnums=null,this.updateData(n).then(()=>{this.scrollToItem&&(this.scrollToEnum(this.scrollToItem),this.scrollToItem=null)}).catch(()=>{})},this.fastUpdate?0:200),this.fastUpdate=!1)};updateData=async t=>{var n;t=t||await this.props.socket.getForeignObjects("enum.*","enum");const i={},s=Object.keys(t);for(let a=0;a<s.length;a++){const d=s[a];if((n=t[d].common)!=null&&n.members)for(let u=0;u<t[d].common.members.length;u++){const m=t[d].common.members[u];if(!i[m])try{i[m]=await this.props.socket.getObject(m)}catch{window.alert(`Cannot read member "${m}"`)}}}this.setState({enums:t,members:i,updating:[]},()=>this.buildTree(t))};buildTree(t){const i={data:null,children:{},id:""},s=Object.keys(t).sort(Ie(t,this.getName));for(let n=0;n<s.length;n++){const a=s[n],d=t[a],u=a.split(".");let m=i;const h=[];for(let g=0;g<u.length;g++){const c=u[g];h.push(c),m.children[c]||(m.children[c]={data:null,children:{},id:h.join(".")}),m=m.children[c]}m.data=d}this.setCurrentCategory(this.state.currentCategory&&i.children.enum.children[this.state.currentCategory]?this.state.currentCategory:Object.keys(i.children.enum.children)[0],()=>this.setState({enumsTree:i}))}setCurrentCategory=(t,i)=>{t!==this.state.currentCategory?(this.setState({currentCategory:t},()=>{i&&i()}),(window._localStorage||window.localStorage).setItem("enumCurrentCategory",t)):i&&i()};addItemToEnum=(t,i)=>{var a;const s=JSON.parse(JSON.stringify(this.state.enums[i]));(a=s.common)!=null&&a.members||(s.common=s.common||{},s.common.members=[]);const n=s.common.members;n.includes(t)||(n.push(t),this.fastUpdate=!0,this.props.socket.setObject(s._id,s).catch(d=>window.alert(`Cannot set enum: ${d}`)))};removeMemberFromEnum=(t,i)=>{const s=JSON.parse(JSON.stringify(this.state.enums[i])),n=s.common.members,a=n.indexOf(t);a!==-1&&(n.splice(a,1),this.fastUpdate=!0,this.props.socket.setObject(s._id,s).catch(d=>window.alert(`Cannot update enum: ${d}`)))};moveEnum=async(t,i)=>{if(i.startsWith(t))return;const s=t.split(".");s.pop();const n=s.join("."),a=i;if(n===a)return;const d=Object.keys(this.state.enums),u=[...this.state.updating];try{for(let m=0;m<d.length;m++){const h=this.state.enums[d[m]];if(d[m].startsWith(t)){const g=d[m].replace(n,a),c=JSON.parse(JSON.stringify(h));c._id=g,u.includes(d[m])||u.push(d[m]),await this.props.socket.setObject(g,h),await this.props.socket.delObject(d[m])}}}catch(m){window.alert(`Cannot move enum: ${m}`)}this.setState({updating:u})};renderTree(t,i,s){var h,g;let n=null;if(!this.state.enumsClosed[t.id]){n=Object.keys(t.children);const c={};for(let l=0;l<n.length;l++){const _=n[l];c[_]=t.children[_].data}n.sort(Ie(c,this.getName))}const a=this.getName((g=(h=t.data)==null?void 0:h.common)==null?void 0:g.name),d=t.id;let u,m;if(this.state.search){const c=this.state.search,l=a.toLowerCase().indexOf(c),_=d.toLowerCase().indexOf(c);if(l===-1&&_===-1)return null;l!==-1&&(u=a?[r.jsx("span",{children:a.substring(0,l)},"0"),r.jsx("span",{style:I.searchText,children:a.substring(l,l+this.state.search.length)},"1"),r.jsx("span",{children:a.substring(l+this.state.search.length)},"2")]:null),_!==-1&&(m=a?[r.jsx("span",{children:d.substring(0,_)},"0"),r.jsx("span",{style:I.searchText,children:d.substring(_,_+this.state.search.length)},"1"),r.jsx("span",{children:d.substring(_+this.state.search.length)},"2")]:null)}return r.jsxs("div",{style:{paddingLeft:s?32:0},children:[r.jsx(Et,{cachedIcons:this.cachedIcons,stylesParent:I,closed:this.state.enumsClosed[t.id],collapsed:this.state.enumsCollapsed.includes(t.id),copyEnum:this.copyEnum,currentCategory:this.state.currentCategory,enum:t.data,getEnumTemplate:this.getEnumTemplate,getName:this.getName,id:t.id,idText:m,members:this.state.members,moveEnum:this.moveEnum,name:u,onCollapse:()=>{const c=[...this.state.enumsCollapsed],l=c.indexOf(t.id);l===-1?c.push(t.id):c.splice(l,1),this.setState({enumsCollapsed:c}),(window._localStorage||window.localStorage).setItem("enumsCollapsed",JSON.stringify(c))},removeMemberFromEnum:this.removeMemberFromEnum,showEnumDeleteDialog:this.showEnumDeleteDialog,showEnumEditDialog:this.showEnumEditDialog,showEnumTemplateDialog:this.showEnumTemplateDialog,socket:this.props.socket,t:this.props.t,themeType:this.props.themeType,theme:this.props.theme,toggleEnum:this.toggleEnum,updating:this.state.updating.includes(t.id),childrenCount:t.children?Object.keys(t.children).length:0}),n?n.map((c,l)=>r.jsx(L.Fragment,{children:this.renderTree(t.children[c],l,s+1)},l)):null]},t.id||i)}showEnumEditDialog=(t,i)=>{const s={changed:!1};s.newItem=JSON.parse(JSON.stringify(t)),s.originalItem=JSON.parse(JSON.stringify(t)),s.isNew=i,this.setState({enumEditDialog:s})};showEnumTemplateDialog=t=>this.setState({enumTemplateDialog:t});showEnumDeleteDialog=t=>this.setState({enumDeleteDialog:t});saveEnum=async()=>{const t=this.state.enumEditDialog.newItem,i=this.state.enumEditDialog.originalItem._id;this.state.enumEditDialog.isNew&&(this.scrollToItem=t._id);const s=[...this.state.updating];if(s.includes(i)||s.push(i),await this.props.socket.setObject(t._id,t),i!==t._id)try{await this.props.socket.delObject(i);const n=Object.keys(this.state.enums);for(let a=0;a<n.length;a++){const d=n[a];if(d.startsWith(`${i}.`)){const u=JSON.parse(JSON.stringify(this.state.enums[d]));u._id=u._id.replace(`${i}.`,`${t._id}.`),s.includes(d)||s.push(d),await this.props.socket.setObject(u._id,u),await this.props.socket.delObject(d)}}}catch(n){window.alert(`Cannot save enum: ${n}`)}this.setState({enumEditDialog:null,updating:s})};deleteEnum=async t=>{const i=[...this.state.updating];try{i.includes(t)||i.push(t),this.state.enums[t]&&await this.props.socket.delObject(t);const s=Object.keys(this.state.enums);for(let n=0;n<s.length;n++){const a=s[n];a.startsWith(`${t}.`)&&(i.includes(a)||i.push(a),this.state.enums[t]&&await this.props.socket.delObject(a))}}catch(s){window.alert(`Cannot delete enum: ${s}`)}this.setState({enumDeleteDialog:null,updating:i})};copyEnum=t=>{const i=JSON.parse(JSON.stringify(this.state.enums[t]));let s,n=1;do s=t+n.toString(),n++;while(this.state.enums[s]);i._id=s,this.props.socket.setObject(s,i).catch(a=>window.alert(`Cannot delete enum: ${a}`))};toggleEnum=t=>{const i=JSON.parse(JSON.stringify(this.state.enumsClosed));i[t]=!i[t],this.setState({enumsClosed:i}),(window._localStorage||window.localStorage).setItem("enumsClosed",JSON.stringify(i))};changeEnumFormData=t=>{const i=JSON.parse(JSON.stringify(this.state.enumEditDialog));i.newItem=JSON.parse(JSON.stringify(t)),i.changed=JSON.stringify(i.newItem)!==JSON.stringify(this.state.enums[i.originalItem]||{}),this.setState({enumEditDialog:i})};getName=t=>M.getText(t,this.props.lang);static _isUniqueName(t,i,s,n){return!i.find(a=>a._id===`${t}.${s.toLowerCase()}_${n}`)}static findNewUniqueName(t,i,s){let n=1;for(;!le._isUniqueName(t,i,s,n);)n++;return{_id:`${t}.${s.toLowerCase()}_${n}`,name:`${s} ${n}`}}onFilterChanged(t,i){this.refClearButton.current&&(t?this.refClearButton.current.style.display="block":this.refClearButton.current.style.display="none"),i&&this.refFilter.current&&(this.refFilter.current.value=""),this.searchTimer&&clearTimeout(this.searchTimer),this.searchTimer=setTimeout(s=>{this.searchTimer=null,this.setState({search:s.toLowerCase()})},i?0:300,t)}renderEditDialog(){return this.state.enumEditDialog?r.jsx(Dt,{onClose:()=>this.setState({enumEditDialog:null}),enums:Object.values(this.state.enums),enum:this.state.enumEditDialog.newItem,getName:this.getName,isNew:this.state.enumEditDialog.isNew,t:this.props.t,lang:this.props.lang,changed:this.state.enumEditDialog.changed,onChange:this.changeEnumFormData,saveData:this.saveEnum,innerWidth:this.state.innerWidth}):null}renderDeleteDialog(){return this.state.enumDeleteDialog?r.jsx(xt,{onClose:()=>this.setState({enumDeleteDialog:null}),enum:this.state.enumDeleteDialog,getName:this.getName,t:this.props.t,deleteEnum:this.deleteEnum}):null}renderTemplateDialog(){return this.state.enumTemplateDialog?r.jsx(Ct,{prefix:this.state.enumTemplateDialog,onClose:()=>this.setState({enumTemplateDialog:null}),t:this.props.t,lang:this.props.lang,createEnumTemplate:this.createEnumTemplate,showEnumEditDialog:this.showEnumEditDialog,enums:this.state.enums,getEnumTemplate:this.getEnumTemplate}):null}render(){if(!this.state.enumsTree)return r.jsx(p.LinearProgress,{});const t=Object.values(this.state.enumsTree.children.enum.children[this.state.currentCategory].children),i=!!t.find(s=>s.children&&Object.keys(s.children).length);return r.jsxs(r.Fragment,{children:[r.jsxs(qe,{backend:M.isTouchDevice()?Ze:Ye,children:[r.jsx(bt,{}),r.jsxs(_t,{direction:b.Horizontal,initialSizes:this.state.splitSizes,minWidths:[450,450],onResizeFinished:(s,n)=>{this.setState({splitSizes:n}),(window._localStorage||window.localStorage).setItem("enumsSplitSizes",JSON.stringify(n))},gutterClassName:this.props.themeType==="dark"?"Dark visGutter":"Light visGutter",children:[r.jsxs("div",{style:{...I.childGridCont,...this.state.innerWidth>600?I.childGridContWide:void 0},children:[r.jsxs("div",{style:I.topPanel,children:[r.jsx(p.Tooltip,{title:this.props.t("Add enum"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:r.jsx(p.IconButton,{id:"categoryPopoverButton",size:"small",style:I.toolbarButton,onClick:()=>this.state.enumsTree.children.enum.children.favorites?this.showEnumEditDialog(this.getEnumTemplate("enum"),!0):this.setState({categoryPopoverOpen:!0}),children:r.jsx(C.Add,{})})}),r.jsx(p.Popover,{open:this.state.categoryPopoverOpen,onClose:()=>this.setState({categoryPopoverOpen:!1}),anchorEl:()=>document.getElementById("categoryPopoverButton"),anchorOrigin:{vertical:"bottom",horizontal:"right"},children:r.jsxs(p.MenuList,{children:[this.state.enumsTree.children.enum.children.favorites?null:r.jsx(p.MenuItem,{onClick:()=>this.createEnumTemplate("enum",wt.favorites),children:this.props.t("Favorites")}),r.jsx(p.MenuItem,{onClick:()=>this.showEnumEditDialog(this.getEnumTemplate("enum"),!0),children:this.props.t("Custom enum")})]})}),r.jsx(p.Tabs,{value:this.state.currentCategory,variant:"scrollable",scrollButtons:"auto",onChange:(s,n)=>this.setCurrentCategory(n),children:Object.keys(this.state.enumsTree.children.enum.children).map((s,n)=>{var d;let a=this.state.enumsTree.children.enum.children[s].data;return a=a||{_id:this.state.enumsTree.children.enum.children[s].id,common:{name:this.state.enumsTree.children.enum.children[s].id.split(".").pop()},type:"enum",native:{}},r.jsx(p.Tab,{component:"span",style:{backgroundColor:((d=a.common)==null?void 0:d.color)||void 0,borderRadius:4},label:r.jsx(yt,{themeType:this.props.themeType,categoryData:a,showEnumEditDialog:this.showEnumEditDialog,showEnumDeleteDialog:this.showEnumDeleteDialog,styles:I,...this.props}),value:s},n)})})]}),r.jsxs("div",{style:I.topPanel2,children:[r.jsx(p.TextField,{variant:"standard",inputRef:this.refFilter,placeholder:this.props.t("Filter"),style:I.filter,slotProps:{inputLabel:{shrink:!0},input:{endAdornment:r.jsx(p.IconButton,{tabIndex:-1,ref:this.refClearButton,style:{display:"none"},size:"small",onClick:()=>this.onFilterChanged("",!0),children:r.jsx(C.Clear,{})})}},onChange:s=>this.onFilterChanged(s.target.value)}),r.jsx(p.Tooltip,{title:this.props.t("Narrow all"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:r.jsx(p.IconButton,{size:"large",style:I.toolbarButton,onClick:()=>{const s=Object.keys(this.state.enums);this.setState({enumsCollapsed:s}),(window._localStorage||window.localStorage).setItem("enumsCollapsed",JSON.stringify(s))},children:r.jsx(C.KeyboardArrowUp,{})})}),r.jsx(p.Tooltip,{title:this.props.t("Wide all"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:r.jsx(p.IconButton,{size:"large",style:I.toolbarButton,onClick:()=>{this.setState({enumsCollapsed:[]}),(window._localStorage||window.localStorage).setItem("enumsCollapsed","[]")},children:r.jsx(C.KeyboardArrowDown,{})})}),i&&r.jsx(p.Tooltip,{title:this.props.t("Collapse all"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:r.jsx(p.IconButton,{size:"large",style:I.toolbarButton,onClick:()=>{const s={};Object.keys(this.state.enums).forEach(n=>s[n]=!0),this.setState({enumsClosed:s}),(window._localStorage||window.localStorage).setItem("enumsClosed",JSON.stringify(s))},children:r.jsx(Pe,{})})}),i&&r.jsx(p.Tooltip,{title:this.props.t("Expand all"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:r.jsx(p.IconButton,{size:"large",style:I.toolbarButton,onClick:()=>{const s={};this.setState({enumsClosed:s}),(window._localStorage||window.localStorage).setItem("enumsClosed",JSON.stringify(s))},children:r.jsx(Le,{})})}),r.jsx(p.Tooltip,{title:this.props.t("Add group"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:r.jsx(p.IconButton,{size:"large",onClick:()=>{["functions","rooms"].includes(this.state.currentCategory)?this.setState({enumTemplateDialog:`enum.${this.state.currentCategory}`}):this.showEnumEditDialog(this.getEnumTemplate(`enum.${this.state.currentCategory}`),!0)},children:r.jsx(C.Add,{})})})]}),r.jsx("div",{style:I.blocksContainer,children:t.map((s,n)=>this.renderTree(s,n,0))})]}),r.jsx("div",{style:{...I.childGridCont,...this.state.innerWidth>600?I.childGridContWide:void 0},children:r.jsx("div",{style:I.blocksContainer,children:r.jsx(Tt,{addItemToEnum:this.addItemToEnum,getName:this.getName,stylesParent:I,t:this.props.t,socket:this.props.socket,lang:this.props.lang,theme:this.props.theme})})})]})]}),this.renderEditDialog(),this.renderDeleteDialog(),this.renderTemplateDialog()]})}}function Ut(e){return r.jsx(Xe,{children:r.jsx(Qe,{style:{display:"flex",flexDirection:"column",overflow:"auto"},children:r.jsx(le,{socket:e.socket,t:e.t,lang:e.lang,themeType:e.themeType,theme:e.theme})})})}export{Ut as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as u}from"./iobroker_admin__loadShare__react__loadShare__-
|
|
1
|
+
import{i as u}from"./iobroker_admin__loadShare__react__loadShare__-CuzHmAOj.js";import{j as a}from"./DefaultPropsProvider-BxjOYH1h.js";import{a8 as c,i as r,a as m,a9 as _}from"./bootstrap-B3ZI_-0g.js";u.createContext(void 0);var o=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),f=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),x=e=>{let t=e.getInitialClientOffset(),n=e.getInitialSourceClientOffset();return t===null||n===null?{x:0,y:0}:o(t,n)},y=(e,t)=>{switch(e){case"left":case"top-start":case"bottom-start":return 0;case"right":case"top-end":case"bottom-end":return t.width;default:return t.width/2}},g=(e,t)=>{switch(e){case"top":case"top-start":case"top-end":return 0;case"bottom":case"bottom-start":case"bottom-end":return t.height;default:return t.height/2}},h=(e,t,n="center",l={x:0,y:0})=>{let i=e.getClientOffset();if(i===null)return null;if(!t.current||!t.current.getBoundingClientRect)return o(i,x(e));let s=t.current.getBoundingClientRect(),d={x:y(n,s),y:g(n,s)};return f(o(i,d),l)},C=e=>{let t=`translate(${e.x.toFixed(1)}px, ${e.y.toFixed(1)}px)`;return{pointerEvents:"none",position:"fixed",top:0,left:0,transform:t,WebkitTransform:t}},j=e=>{let t=u.useRef(null),n=c(l=>({currentOffset:h(l,t,e==null?void 0:e.placement,e==null?void 0:e.padding),isDragging:l.isDragging(),itemType:l.getItemType(),item:l.getItem(),monitor:l}));return!n.isDragging||n.currentOffset===null?{display:!1}:{display:!0,itemType:n.itemType,item:n.item,style:C(n.currentOffset),monitor:n.monitor,ref:t}};function k(e){const t=e.icon;return a.jsxs("div",{style:e.styles.formContainer,children:[t?a.jsx(t,{style:e.styles.formIcon}):null,a.jsx(r.FormControl,{style:e.styles.formControl,variant:"standard",children:a.jsx(r.TextField,{variant:"standard",label:e.t(e.label),autoComplete:e.autoComplete,error:!!e.error,helperText:e.error||"",value:e.value,onChange:n=>e.onChange(n.target.value),disabled:e.disabled,type:e.type,slotProps:{inputLabel:{shrink:!0},input:{readOnly:!1,endAdornment:e.value?a.jsx(r.InputAdornment,{position:"end",children:a.jsx(r.IconButton,{tabIndex:-1,size:"small",onClick:()=>e.onChange(""),children:a.jsx(m.Close,{})})}):null}}})})]})}function O(e){const t=e.icon;return a.jsxs("div",{style:{width:"100%"},children:[t?a.jsx(t,{style:e.previewStyle||e.styles.formIcon}):null,a.jsx(_,{style:{...e.style||void 0,width:t?"calc(100% - 45px)":"100%",display:"inline-block",verticalAlign:"top"},label:e.t(e.label),onChange:e.onChange,value:e.value||""})]})}export{k as I,O as a,j as b};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{j as B}from"./DefaultPropsProvider-
|
|
1
|
+
import{j as B}from"./DefaultPropsProvider-BxjOYH1h.js";import{i as M}from"./iobroker_admin__loadShare__react__loadShare__-CuzHmAOj.js";import{w as Ge,F as $e,E as ve,I as qe,i as ge,k as je,f as Ne,h as He,T as Ve,t as We}from"./bootstrap-B3ZI_-0g.js";import{a as be}from"./ace-1DqSbvTN.js";import{C as Je}from"./CustomModal-UQ6ICKdg.js";import"./iobroker_admin__loadShare__prop_mf_2_types__loadShare__-pDONiJUe.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./iobroker_admin__mf_v__runtimeInit__mf_v__-CHE4rLsT.js";import"./emotion-serialize.esm-Q4o_CgeF.js";import"./iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-CXogaIXO.js";import"./FilledInput-B9JSi0Ta.js";import"./preload-helper-Dp1pzeXC.js";import"./ThemeProvider-DHntAcOp.js";import"./emotion-cache.browser.esm-BgJfNZJN.js";import"./iobroker_admin__loadShare__leaflet__loadShare__-DIpcqFbm.js";import"./extends-CF3RwP-h.js";var De={},Ie={};Ie.byteLength=Xe;Ie.toByteArray=Ke;Ie.fromByteArray=tt;var ee=[],K=[],ze=typeof Uint8Array<"u"?Uint8Array:Array,Te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var de=0,Qe=Te.length;de<Qe;++de)ee[de]=Te[de],K[Te.charCodeAt(de)]=de;K[45]=62;K[95]=63;function Oe(f){var c=f.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var u=f.indexOf("=");u===-1&&(u=c);var d=u===c?0:4-u%4;return[u,d]}function Xe(f){var c=Oe(f),u=c[0],d=c[1];return(u+d)*3/4-d}function Ye(f,c,u){return(c+u)*3/4-u}function Ke(f){var c,u=Oe(f),d=u[0],h=u[1],a=new ze(Ye(f,d,h)),p=0,o=h>0?d-4:d,m;for(m=0;m<o;m+=4)c=K[f.charCodeAt(m)]<<18|K[f.charCodeAt(m+1)]<<12|K[f.charCodeAt(m+2)]<<6|K[f.charCodeAt(m+3)],a[p++]=c>>16&255,a[p++]=c>>8&255,a[p++]=c&255;return h===2&&(c=K[f.charCodeAt(m)]<<2|K[f.charCodeAt(m+1)]>>4,a[p++]=c&255),h===1&&(c=K[f.charCodeAt(m)]<<10|K[f.charCodeAt(m+1)]<<4|K[f.charCodeAt(m+2)]>>2,a[p++]=c>>8&255,a[p++]=c&255),a}function Ze(f){return ee[f>>18&63]+ee[f>>12&63]+ee[f>>6&63]+ee[f&63]}function et(f,c,u){for(var d,h=[],a=c;a<u;a+=3)d=(f[a]<<16&16711680)+(f[a+1]<<8&65280)+(f[a+2]&255),h.push(Ze(d));return h.join("")}function tt(f){for(var c,u=f.length,d=u%3,h=[],a=16383,p=0,o=u-d;p<o;p+=a)h.push(et(f,p,p+a>o?o:p+a));return d===1?(c=f[u-1],h.push(ee[c>>2]+ee[c<<4&63]+"==")):d===2&&(c=(f[u-2]<<8)+f[u-1],h.push(ee[c>>10]+ee[c>>4&63]+ee[c<<2&63]+"=")),h.join("")}var ke={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ke.read=function(f,c,u,d,h){var a,p,o=h*8-d-1,m=(1<<o)-1,S=m>>1,w=-7,g=u?h-1:0,E=u?-1:1,x=f[c+g];for(g+=E,a=x&(1<<-w)-1,x>>=-w,w+=o;w>0;a=a*256+f[c+g],g+=E,w-=8);for(p=a&(1<<-w)-1,a>>=-w,w+=d;w>0;p=p*256+f[c+g],g+=E,w-=8);if(a===0)a=1-S;else{if(a===m)return p?NaN:(x?-1:1)*(1/0);p=p+Math.pow(2,d),a=a-S}return(x?-1:1)*p*Math.pow(2,a-d)};ke.write=function(f,c,u,d,h,a){var p,o,m,S=a*8-h-1,w=(1<<S)-1,g=w>>1,E=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=d?0:a-1,k=d?1:-1,A=c<0||c===0&&1/c<0?1:0;for(c=Math.abs(c),isNaN(c)||c===1/0?(o=isNaN(c)?1:0,p=w):(p=Math.floor(Math.log(c)/Math.LN2),c*(m=Math.pow(2,-p))<1&&(p--,m*=2),p+g>=1?c+=E/m:c+=E*Math.pow(2,1-g),c*m>=2&&(p++,m/=2),p+g>=w?(o=0,p=w):p+g>=1?(o=(c*m-1)*Math.pow(2,h),p=p+g):(o=c*Math.pow(2,g-1)*Math.pow(2,h),p=0));h>=8;f[u+x]=o&255,x+=k,o/=256,h-=8);for(p=p<<h|o,S+=h;S>0;f[u+x]=p&255,x+=k,p/=256,S-=8);f[u+x-k]|=A*128};/*!
|
|
2
2
|
* The buffer module from node.js, for the browser.
|
|
3
3
|
*
|
|
4
4
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
5
5
|
* @license MIT
|
|
6
|
-
*/(function(f){const c=Ie,u=ke,d=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;f.Buffer=o,f.SlowBuffer=se,f.INSPECT_MAX_BYTES=50;const h=2147483647;f.kMaxLength=h,o.TYPED_ARRAY_SUPPORT=a(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{const r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function p(r){if(r>h)throw new RangeError('The value "'+r+'" is invalid for option "size"');const e=new Uint8Array(r);return Object.setPrototypeOf(e,o.prototype),e}function o(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(r)}return m(r,e,t)}o.poolSize=8192;function m(r,e,t){if(typeof r=="string")return E(r,e);if(ArrayBuffer.isView(r))return k(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(O(r,ArrayBuffer)||r&&O(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(O(r,SharedArrayBuffer)||r&&O(r.buffer,SharedArrayBuffer)))return A(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const i=r.valueOf&&r.valueOf();if(i!=null&&i!==r)return o.from(i,e,t);const n=G(r);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return o.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}o.from=function(r,e,t){return m(r,e,t)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function S(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function w(r,e,t){return S(r),r<=0?p(r):e!==void 0?typeof t=="string"?p(r).fill(e,t):p(r).fill(e):p(r)}o.alloc=function(r,e,t){return w(r,e,t)};function g(r){return S(r),p(r<0?0:V(r)|0)}o.allocUnsafe=function(r){return g(r)},o.allocUnsafeSlow=function(r){return g(r)};function E(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!o.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const t=q(r,e)|0;let i=p(t);const n=i.write(r,e);return n!==t&&(i=i.slice(0,n)),i}function x(r){const e=r.length<0?0:V(r.length)|0,t=p(e);for(let i=0;i<e;i+=1)t[i]=r[i]&255;return t}function k(r){if(O(r,Uint8Array)){const e=new Uint8Array(r);return A(e.buffer,e.byteOffset,e.byteLength)}return x(r)}function A(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');let i;return e===void 0&&t===void 0?i=new Uint8Array(r):t===void 0?i=new Uint8Array(r,e):i=new Uint8Array(r,e,t),Object.setPrototypeOf(i,o.prototype),i}function G(r){if(o.isBuffer(r)){const e=V(r.length)|0,t=p(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r.length!="number"||z(r.length)?p(0):x(r);if(r.type==="Buffer"&&Array.isArray(r.data))return x(r.data)}function V(r){if(r>=h)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+h.toString(16)+" bytes");return r|0}function se(r){return+r!=r&&(r=0),o.alloc(+r)}o.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==o.prototype},o.compare=function(e,t){if(O(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),O(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let i=e.length,n=t.length;for(let s=0,l=Math.min(i,n);s<l;++s)if(e[s]!==t[s]){i=e[s],n=t[s];break}return i<n?-1:n<i?1:0},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return o.alloc(0);let i;if(t===void 0)for(t=0,i=0;i<e.length;++i)t+=e[i].length;const n=o.allocUnsafe(t);let s=0;for(i=0;i<e.length;++i){let l=e[i];if(O(l,Uint8Array))s+l.length>n.length?(o.isBuffer(l)||(l=o.from(l)),l.copy(n,s)):Uint8Array.prototype.set.call(n,l,s);else if(o.isBuffer(l))l.copy(n,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=l.length}return n};function q(r,e){if(o.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||O(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);const t=r.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&t===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return ie(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return R(r).length;default:if(n)return i?-1:ie(r).length;e=(""+e).toLowerCase(),n=!0}}o.byteLength=q;function le(r,e,t){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return fe(this,e,t);case"utf8":case"utf-8":return we(this,e,t);case"ascii":return Ae(this,e,t);case"latin1":case"binary":return Ue(this,e,t);case"base64":return ae(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _e(this,e,t);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),i=!0}}o.prototype._isBuffer=!0;function N(r,e,t){const i=r[e];r[e]=r[t],r[t]=i}o.prototype.swap16=function(){const e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)N(this,t,t+1);return this},o.prototype.swap32=function(){const e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)N(this,t,t+3),N(this,t+1,t+2);return this},o.prototype.swap64=function(){const e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)N(this,t,t+7),N(this,t+1,t+6),N(this,t+2,t+5),N(this,t+3,t+4);return this},o.prototype.toString=function(){const e=this.length;return e===0?"":arguments.length===0?we(this,0,e):le.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:o.compare(this,e)===0},o.prototype.inspect=function(){let e="";const t=f.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},d&&(o.prototype[d]=o.prototype.inspect),o.prototype.compare=function(e,t,i,n,s){if(O(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),s===void 0&&(s=this.length),t<0||i>e.length||n<0||s>this.length)throw new RangeError("out of range index");if(n>=s&&t>=i)return 0;if(n>=s)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,n>>>=0,s>>>=0,this===e)return 0;let l=s-n,y=i-t;const U=Math.min(l,y),C=this.slice(n,s),_=e.slice(t,i);for(let F=0;F<U;++F)if(C[F]!==_[F]){l=C[F],y=_[F];break}return l<y?-1:y<l?1:0};function ce(r,e,t,i,n){if(r.length===0)return-1;if(typeof t=="string"?(i=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,z(t)&&(t=n?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(n)return-1;t=r.length-1}else if(t<0)if(n)t=0;else return-1;if(typeof e=="string"&&(e=o.from(e,i)),o.isBuffer(e))return e.length===0?-1:me(r,e,t,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):me(r,[e],t,i,n);throw new TypeError("val must be string, number or Buffer")}function me(r,e,t,i,n){let s=1,l=r.length,y=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(r.length<2||e.length<2)return-1;s=2,l/=2,y/=2,t/=2}function U(_,F){return s===1?_[F]:_.readUInt16BE(F*s)}let C;if(n){let _=-1;for(C=t;C<l;C++)if(U(r,C)===U(e,_===-1?0:C-_)){if(_===-1&&(_=C),C-_+1===y)return _*s}else _!==-1&&(C-=C-_),_=-1}else for(t+y>l&&(t=l-y),C=t;C>=0;C--){let _=!0;for(let F=0;F<y;F++)if(U(r,C+F)!==U(e,F)){_=!1;break}if(_)return C}return-1}o.prototype.includes=function(e,t,i){return this.indexOf(e,t,i)!==-1},o.prototype.indexOf=function(e,t,i){return ce(this,e,t,i,!0)},o.prototype.lastIndexOf=function(e,t,i){return ce(this,e,t,i,!1)};function Se(r,e,t,i){t=Number(t)||0;const n=r.length-t;i?(i=Number(i),i>n&&(i=n)):i=n;const s=e.length;i>s/2&&(i=s/2);let l;for(l=0;l<i;++l){const y=parseInt(e.substr(l*2,2),16);if(z(y))return l;r[t+l]=y}return l}function te(r,e,t,i){return L(ie(e,r.length-t),r,t,i)}function Be(r,e,t,i){return L(he(e),r,t,i)}function ue(r,e,t,i){return L(R(e),r,t,i)}function Ee(r,e,t,i){return L(oe(e,r.length-t),r,t,i)}o.prototype.write=function(e,t,i,n){if(t===void 0)n="utf8",i=this.length,t=0;else if(i===void 0&&typeof t=="string")n=t,i=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const s=this.length-t;if((i===void 0||i>s)&&(i=s),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let l=!1;for(;;)switch(n){case"hex":return Se(this,e,t,i);case"utf8":case"utf-8":return te(this,e,t,i);case"ascii":case"latin1":case"binary":return Be(this,e,t,i);case"base64":return ue(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ee(this,e,t,i);default:if(l)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),l=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ae(r,e,t){return e===0&&t===r.length?c.fromByteArray(r):c.fromByteArray(r.slice(e,t))}function we(r,e,t){t=Math.min(r.length,t);const i=[];let n=e;for(;n<t;){const s=r[n];let l=null,y=s>239?4:s>223?3:s>191?2:1;if(n+y<=t){let U,C,_,F;switch(y){case 1:s<128&&(l=s);break;case 2:U=r[n+1],(U&192)===128&&(F=(s&31)<<6|U&63,F>127&&(l=F));break;case 3:U=r[n+1],C=r[n+2],(U&192)===128&&(C&192)===128&&(F=(s&15)<<12|(U&63)<<6|C&63,F>2047&&(F<55296||F>57343)&&(l=F));break;case 4:U=r[n+1],C=r[n+2],_=r[n+3],(U&192)===128&&(C&192)===128&&(_&192)===128&&(F=(s&15)<<18|(U&63)<<12|(C&63)<<6|_&63,F>65535&&F<1114112&&(l=F))}}l===null?(l=65533,y=1):l>65535&&(l-=65536,i.push(l>>>10&1023|55296),l=56320|l&1023),i.push(l),n+=y}return Ce(i)}const Fe=4096;function Ce(r){const e=r.length;if(e<=Fe)return String.fromCharCode.apply(String,r);let t="",i=0;for(;i<e;)t+=String.fromCharCode.apply(String,r.slice(i,i+=Fe));return t}function Ae(r,e,t){let i="";t=Math.min(r.length,t);for(let n=e;n<t;++n)i+=String.fromCharCode(r[n]&127);return i}function Ue(r,e,t){let i="";t=Math.min(r.length,t);for(let n=e;n<t;++n)i+=String.fromCharCode(r[n]);return i}function fe(r,e,t){const i=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>i)&&(t=i);let n="";for(let s=e;s<t;++s)n+=Z[r[s]];return n}function _e(r,e,t){const i=r.slice(e,t);let n="";for(let s=0;s<i.length-1;s+=2)n+=String.fromCharCode(i[s]+i[s+1]*256);return n}o.prototype.slice=function(e,t){const i=this.length;e=~~e,t=t===void 0?i:~~t,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,o.prototype),n};function b(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(e,t,i){e=e>>>0,t=t>>>0,i||b(e,t,this.length);let n=this[e],s=1,l=0;for(;++l<t&&(s*=256);)n+=this[e+l]*s;return n},o.prototype.readUintBE=o.prototype.readUIntBE=function(e,t,i){e=e>>>0,t=t>>>0,i||b(e,t,this.length);let n=this[e+--t],s=1;for(;t>0&&(s*=256);)n+=this[e+--t]*s;return n},o.prototype.readUint8=o.prototype.readUInt8=function(e,t){return e=e>>>0,t||b(e,1,this.length),this[e]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||b(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||b(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||b(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||b(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readBigUInt64LE=P(function(e){e=e>>>0,J(e,"offset");const t=this[e],i=this[e+7];(t===void 0||i===void 0)&&X(e,this.length-8);const n=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+i*2**24;return BigInt(n)+(BigInt(s)<<BigInt(32))}),o.prototype.readBigUInt64BE=P(function(e){e=e>>>0,J(e,"offset");const t=this[e],i=this[e+7];(t===void 0||i===void 0)&&X(e,this.length-8);const n=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i;return(BigInt(n)<<BigInt(32))+BigInt(s)}),o.prototype.readIntLE=function(e,t,i){e=e>>>0,t=t>>>0,i||b(e,t,this.length);let n=this[e],s=1,l=0;for(;++l<t&&(s*=256);)n+=this[e+l]*s;return s*=128,n>=s&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,i){e=e>>>0,t=t>>>0,i||b(e,t,this.length);let n=t,s=1,l=this[e+--n];for(;n>0&&(s*=256);)l+=this[e+--n]*s;return s*=128,l>=s&&(l-=Math.pow(2,8*t)),l},o.prototype.readInt8=function(e,t){return e=e>>>0,t||b(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},o.prototype.readInt16LE=function(e,t){e=e>>>0,t||b(e,2,this.length);const i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i},o.prototype.readInt16BE=function(e,t){e=e>>>0,t||b(e,2,this.length);const i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i},o.prototype.readInt32LE=function(e,t){return e=e>>>0,t||b(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e=e>>>0,t||b(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readBigInt64LE=P(function(e){e=e>>>0,J(e,"offset");const t=this[e],i=this[e+7];(t===void 0||i===void 0)&&X(e,this.length-8);const n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(i<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),o.prototype.readBigInt64BE=P(function(e){e=e>>>0,J(e,"offset");const t=this[e],i=this[e+7];(t===void 0||i===void 0)&&X(e,this.length-8);const n=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i)}),o.prototype.readFloatLE=function(e,t){return e=e>>>0,t||b(e,4,this.length),u.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e=e>>>0,t||b(e,4,this.length),u.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||b(e,8,this.length),u.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||b(e,8,this.length),u.read(this,e,!1,52,8)};function T(r,e,t,i,n,s){if(!o.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<s)throw new RangeError('"value" argument is out of bounds');if(t+i>r.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(e,t,i,n){if(e=+e,t=t>>>0,i=i>>>0,!n){const y=Math.pow(2,8*i)-1;T(this,e,t,i,y,0)}let s=1,l=0;for(this[t]=e&255;++l<i&&(s*=256);)this[t+l]=e/s&255;return t+i},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(e,t,i,n){if(e=+e,t=t>>>0,i=i>>>0,!n){const y=Math.pow(2,8*i)-1;T(this,e,t,i,y,0)}let s=i-1,l=1;for(this[t+s]=e&255;--s>=0&&(l*=256);)this[t+s]=e/l&255;return t+i},o.prototype.writeUint8=o.prototype.writeUInt8=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,1,255,0),this[t]=e&255,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function re(r,e,t,i,n){v(e,i,n,r,t,7);let s=Number(e&BigInt(4294967295));r[t++]=s,s=s>>8,r[t++]=s,s=s>>8,r[t++]=s,s=s>>8,r[t++]=s;let l=Number(e>>BigInt(32)&BigInt(4294967295));return r[t++]=l,l=l>>8,r[t++]=l,l=l>>8,r[t++]=l,l=l>>8,r[t++]=l,t}function ye(r,e,t,i,n){v(e,i,n,r,t,7);let s=Number(e&BigInt(4294967295));r[t+7]=s,s=s>>8,r[t+6]=s,s=s>>8,r[t+5]=s,s=s>>8,r[t+4]=s;let l=Number(e>>BigInt(32)&BigInt(4294967295));return r[t+3]=l,l=l>>8,r[t+2]=l,l=l>>8,r[t+1]=l,l=l>>8,r[t]=l,t+8}o.prototype.writeBigUInt64LE=P(function(e,t=0){return re(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=P(function(e,t=0){return ye(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(e,t,i,n){if(e=+e,t=t>>>0,!n){const U=Math.pow(2,8*i-1);T(this,e,t,i,U-1,-U)}let s=0,l=1,y=0;for(this[t]=e&255;++s<i&&(l*=256);)e<0&&y===0&&this[t+s-1]!==0&&(y=1),this[t+s]=(e/l>>0)-y&255;return t+i},o.prototype.writeIntBE=function(e,t,i,n){if(e=+e,t=t>>>0,!n){const U=Math.pow(2,8*i-1);T(this,e,t,i,U-1,-U)}let s=i-1,l=1,y=0;for(this[t+s]=e&255;--s>=0&&(l*=256);)e<0&&y===0&&this[t+s+1]!==0&&(y=1),this[t+s]=(e/l>>0)-y&255;return t+i},o.prototype.writeInt8=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},o.prototype.writeInt16LE=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},o.prototype.writeInt32LE=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},o.prototype.writeBigInt64LE=P(function(e,t=0){return re(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=P(function(e,t=0){return ye(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function xe(r,e,t,i,n,s){if(t+i>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function I(r,e,t,i,n){return e=+e,t=t>>>0,n||xe(r,e,t,4),u.write(r,e,t,i,23,4),t+4}o.prototype.writeFloatLE=function(e,t,i){return I(this,e,t,!0,i)},o.prototype.writeFloatBE=function(e,t,i){return I(this,e,t,!1,i)};function Q(r,e,t,i,n){return e=+e,t=t>>>0,n||xe(r,e,t,8),u.write(r,e,t,i,52,8),t+8}o.prototype.writeDoubleLE=function(e,t,i){return Q(this,e,t,!0,i)},o.prototype.writeDoubleBE=function(e,t,i){return Q(this,e,t,!1,i)},o.prototype.copy=function(e,t,i,n){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-i&&(n=e.length-t+i);const s=n-i;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,i,n):Uint8Array.prototype.set.call(e,this.subarray(i,n),t),s},o.prototype.fill=function(e,t,i,n){if(typeof e=="string"){if(typeof t=="string"?(n=t,t=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!o.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){const l=e.charCodeAt(0);(n==="utf8"&&l<128||n==="latin1")&&(e=l)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let s;if(typeof e=="number")for(s=t;s<i;++s)this[s]=e;else{const l=o.isBuffer(e)?e:o.from(e,n),y=l.length;if(y===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<i-t;++s)this[s+t]=l[s%y]}return this};const D={};function W(r,e,t){D[r]=class extends t{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){return r}set code(n){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:n,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}}}W("ERR_BUFFER_OUT_OF_BOUNDS",function(r){return r?`${r} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),W("ERR_INVALID_ARG_TYPE",function(r,e){return`The "${r}" argument must be of type number. Received type ${typeof e}`},TypeError),W("ERR_OUT_OF_RANGE",function(r,e,t){let i=`The value of "${r}" is out of range.`,n=t;return Number.isInteger(t)&&Math.abs(t)>2**32?n=$(String(t)):typeof t=="bigint"&&(n=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(n=$(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);function $(r){let e="",t=r.length;const i=r[0]==="-"?1:0;for(;t>=i+4;t-=3)e=`_${r.slice(t-3,t)}${e}`;return`${r.slice(0,t)}${e}`}function H(r,e,t){J(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&X(e,r.length-(t+1))}function v(r,e,t,i,n,s){if(r>t||r<e){const l=typeof e=="bigint"?"n":"";let y;throw e===0||e===BigInt(0)?y=`>= 0${l} and < 2${l} ** ${(s+1)*8}${l}`:y=`>= -(2${l} ** ${(s+1)*8-1}${l}) and < 2 ** ${(s+1)*8-1}${l}`,new D.ERR_OUT_OF_RANGE("value",y,r)}H(i,n,s)}function J(r,e){if(typeof r!="number")throw new D.ERR_INVALID_ARG_TYPE(e,"number",r)}function X(r,e,t){throw Math.floor(r)!==r?(J(r,t),new D.ERR_OUT_OF_RANGE("offset","an integer",r)):e<0?new D.ERR_BUFFER_OUT_OF_BOUNDS:new D.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${e}`,r)}const ne=/[^+/0-9A-Za-z-_]/g;function pe(r){if(r=r.split("=")[0],r=r.trim().replace(ne,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function ie(r,e){e=e||1/0;let t;const i=r.length;let n=null;const s=[];for(let l=0;l<i;++l){if(t=r.charCodeAt(l),t>55295&&t<57344){if(!n){if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(l+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=t;continue}if(t<56320){(e-=3)>-1&&s.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,t<128){if((e-=1)<0)break;s.push(t)}else if(t<2048){if((e-=2)<0)break;s.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;s.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;s.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}function he(r){const e=[];for(let t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function oe(r,e){let t,i,n;const s=[];for(let l=0;l<r.length&&!((e-=2)<0);++l)t=r.charCodeAt(l),i=t>>8,n=t%256,s.push(n),s.push(i);return s}function R(r){return c.toByteArray(pe(r))}function L(r,e,t,i){let n;for(n=0;n<i&&!(n+t>=e.length||n>=r.length);++n)e[n+t]=r[n];return n}function O(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}function z(r){return r!==r}const Z=function(){const r="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){const i=t*16;for(let n=0;n<16;++n)e[i+n]=r[t]+r[n]}return e}();function P(r){return typeof BigInt>"u"?j:r}function j(){throw new Error("BigInt not supported")}})(De);var rt={exports:{}};(function(f,c){ace.define("ace/ext/modelist",["require","exports","module"],function(u,d,h){var a=[];function p(G){for(var V=w.text,se=G.split(/[\/\\]/).pop(),q=0;q<a.length;q++)if(a[q].supportsFile(se)){V=a[q];break}return V}var o=function(){function G(V,se,q){this.name=V,this.caption=se,this.mode="ace/mode/"+V,this.extensions=q;var le;/\^/.test(q)?le=q.replace(/\|(\^)?/g,function(N,ce){return"$|"+(ce?"^":"^.*\\.")})+"$":le="\\.("+q+")$",this.extRe=new RegExp(le,"gi")}return G.prototype.supportsFile=function(V){return V.match(this.extRe)},G}(),m={ABAP:["abap"],ABC:["abc"],ActionScript:["as"],ADA:["ada|adb"],Alda:["alda"],Apache_Conf:["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],Apex:["apex|cls|trigger|tgr"],AQL:["aql"],AsciiDoc:["asciidoc|adoc"],ASL:["dsl|asl|asl.json"],Assembly_ARM32:["s"],Assembly_x86:["asm|a"],Astro:["astro"],AutoHotKey:["ahk"],Basic:["bas|bak"],BatchFile:["bat|cmd"],BibTeX:["bib"],C_Cpp:["cpp|c|cc|cxx|h|hh|hpp|ino"],C9Search:["c9search_results"],Cirru:["cirru|cr"],Clojure:["clj|cljs"],Clue:["clue"],Cobol:["CBL|COB"],coffee:["coffee|cf|cson|^Cakefile"],ColdFusion:["cfm|cfc"],Crystal:["cr"],CSharp:["cs"],Csound_Document:["csd"],Csound_Orchestra:["orc"],Csound_Score:["sco"],CSS:["css"],CSV:["csv"],Curly:["curly"],Cuttlefish:["conf"],D:["d|di"],Dart:["dart"],Diff:["diff|patch"],Django:["djt|html.djt|dj.html|djhtml"],Dockerfile:["^Dockerfile"],Dot:["dot"],Drools:["drl"],Edifact:["edi"],Eiffel:["e|ge"],EJS:["ejs"],Elixir:["ex|exs"],Elm:["elm"],Erlang:["erl|hrl"],Flix:["flix"],Forth:["frt|fs|ldr|fth|4th"],Fortran:["f|f90"],FSharp:["fsi|fs|ml|mli|fsx|fsscript"],FSL:["fsl"],FTL:["ftl"],Gcode:["gcode"],Gherkin:["feature"],Gitignore:["^.gitignore"],Glsl:["glsl|frag|vert"],Gobstones:["gbs"],golang:["go"],GraphQLSchema:["gql"],Groovy:["groovy"],HAML:["haml"],Handlebars:["hbs|handlebars|tpl|mustache"],Haskell:["hs"],Haskell_Cabal:["cabal"],haXe:["hx"],Hjson:["hjson"],HTML:["html|htm|xhtml|we|wpy"],HTML_Elixir:["eex|html.eex"],HTML_Ruby:["erb|rhtml|html.erb"],INI:["ini|conf|cfg|prefs"],Io:["io"],Ion:["ion"],Jack:["jack"],Jade:["jade|pug"],Java:["java"],JavaScript:["js|jsm|cjs|mjs"],JEXL:["jexl"],JSON:["json"],JSON5:["json5"],JSONiq:["jq"],JSP:["jsp"],JSSM:["jssm|jssm_state"],JSX:["jsx"],Julia:["jl"],Kotlin:["kt|kts"],LaTeX:["tex|latex|ltx|bib"],Latte:["latte"],LESS:["less"],Liquid:["liquid"],Lisp:["lisp"],LiveScript:["ls"],Log:["log"],LogiQL:["logic|lql"],Logtalk:["lgt"],LSL:["lsl"],Lua:["lua"],LuaPage:["lp"],Lucene:["lucene"],Makefile:["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],Markdown:["md|markdown"],Mask:["mask"],MATLAB:["matlab"],Maze:["mz"],MediaWiki:["wiki|mediawiki"],MEL:["mel"],MIPS:["s|asm"],MIXAL:["mixal"],MUSHCode:["mc|mush"],MySQL:["mysql"],Nasal:["nas"],Nginx:["nginx|conf"],Nim:["nim"],Nix:["nix"],NSIS:["nsi|nsh"],Nunjucks:["nunjucks|nunjs|nj|njk"],ObjectiveC:["m|mm"],OCaml:["ml|mli"],Odin:["odin"],PartiQL:["partiql|pql"],Pascal:["pas|p"],Perl:["pl|pm"],pgSQL:["pgsql"],PHP:["php|inc|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],PHP_Laravel_blade:["blade.php"],Pig:["pig"],PLSQL:["plsql"],Powershell:["ps1"],Praat:["praat|praatscript|psc|proc"],Prisma:["prisma"],Prolog:["plg|prolog"],Properties:["properties"],Protobuf:["proto"],PRQL:["prql"],Puppet:["epp|pp"],Python:["py"],QML:["qml"],R:["r"],Raku:["raku|rakumod|rakutest|p6|pl6|pm6"],Razor:["cshtml|asp"],RDoc:["Rd"],Red:["red|reds"],RHTML:["Rhtml"],Robot:["robot|resource"],RST:["rst"],Ruby:["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],Rust:["rs"],SaC:["sac"],SASS:["sass"],SCAD:["scad"],Scala:["scala|sbt"],Scheme:["scm|sm|rkt|oak|scheme"],Scrypt:["scrypt"],SCSS:["scss"],SH:["sh|bash|^.bashrc"],SJS:["sjs"],Slim:["slim|skim"],Smarty:["smarty|tpl"],Smithy:["smithy"],snippets:["snippets"],Soy_Template:["soy"],Space:["space"],SPARQL:["rq"],SQL:["sql"],SQLServer:["sqlserver"],Stylus:["styl|stylus"],SVG:["svg"],Swift:["swift"],Tcl:["tcl"],Terraform:["tf","tfvars","terragrunt"],Tex:["tex"],Text:["txt"],Textile:["textile"],Toml:["toml"],TSV:["tsv"],TSX:["tsx"],Turtle:["ttl"],Twig:["twig|swig"],Typescript:["ts|mts|cts|typescript|str"],Vala:["vala"],VBScript:["vbs|vb"],Velocity:["vm"],Verilog:["v|vh|sv|svh"],VHDL:["vhd|vhdl"],Visualforce:["vfp|component|page"],Vue:["vue"],Wollok:["wlk|wpgm|wtest"],XML:["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],XQuery:["xq"],YAML:["yaml|yml"],Zeek:["zeek|bro"],Zig:["zig"]},S={ObjectiveC:"Objective-C",CSharp:"C#",golang:"Go",C_Cpp:"C and C++",Csound_Document:"Csound Document",Csound_Orchestra:"Csound",Csound_Score:"Csound Score",coffee:"CoffeeScript",HTML_Ruby:"HTML (Ruby)",HTML_Elixir:"HTML (Elixir)",FTL:"FreeMarker",PHP_Laravel_blade:"PHP (Blade Template)",Perl6:"Perl 6",AutoHotKey:"AutoHotkey / AutoIt"},w={};for(var g in m){var E=m[g],x=(S[g]||g).replace(/_/g," "),k=g.toLowerCase(),A=new o(k,x,E[0]);w[k]=A,a.push(A)}d.getModeForPath=p,d.modes=a,d.modesByName=w}),function(){ace.require(["ace/ext/modelist"],function(u){f&&(f.exports=u)})}()})(rt);const it=be.require?be.require("ace/ext/modelist"):be.acequire("ace/ext/modelist");class Re extends $e{constructor(c){super(c),Object.assign(this.state,{editing:!!this.props.formatEditFile||!1})}static getEditFile(c){switch(c){case"json":return"json";case"json5":return"json5";case"js":return"javascript";case"html":return"html";case"txt":return"html";default:return it.getModeForPath(`testFile.${c}`).mode.split("/").pop()}}writeFile64=()=>{const c=this.props.href.split("/"),u=this.state.editingValue;c.splice(0,2);const d=c[0],h=c.splice(1).join("/");this.props.socket.writeFile64(d,h,De.Buffer.from(u).toString("base64")).then(()=>this.props.onClose()).catch(a=>window.alert(`Cannot write file: ${a}`))};getEditorOrViewer(){return B.jsx(ve,{mode:Re.getEditFile(this.props.formatEditFile),themeType:this.props.themeType,value:this.state.editingValue||this.state.code||this.state.text,onChange:this.state.editing?c=>this.setState({editingValue:c,changed:!0}):void 0})}onSave(){this.writeFile64()}}const nt=Ge()(Re),ot=[{Owner:[{name:"read",valueNum:1024,title:"read owner"},{name:"write",valueNum:512,title:"write owner"}]},{Group:[{name:"read",valueNum:64,title:"read group"},{name:"write",valueNum:32,title:"write group"}]},{Everyone:[{name:"read",valueNum:4,title:"read everyone"},{name:"write",valueNum:2,title:"write everyone"}]}],Me=(f,c,u)=>(f|=c&u,f&=c|~u&65535,f),st=({value:f,setValue:c,t:u,differentValues:d,applyToChildren:h,mask:a,setMask:p,disabled:o})=>{M.useEffect(()=>{if(h){let S=0;for(let w=0;w<d.length;w++)S|=f^d[w];p(S)}else p(0)},[d,h,p,f]);let m=f;return B.jsx("div",{style:{display:"flex",width:"fit-content",margin:20,border:"1px solid",borderLeft:0},children:ot.map(S=>{const w=Object.keys(S)[0];return B.jsxs("div",{style:{width:150,height:150,display:"flex",flexDirection:"column",alignItems:"center",borderLeft:"1px solid"},children:[B.jsx("div",{style:{height:50,display:"flex",alignItems:"center",fontSize:18,borderBottom:"1px solid silver",width:"100%",justifyContent:"center"},children:u(w)}),B.jsx("div",{style:{display:"flex",width:"100%"},children:S[w].map((g,E)=>{let x=!1;const k=a&g.valueNum;return m-g.valueNum>=0&&(m-=g.valueNum,x=!0),B.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1,alignItems:"center",borderRight:E===0?"1px solid":0},children:[B.jsx("div",{style:{height:50,borderBottom:"1px solid",width:"100%",justifyContent:"center",display:"flex",alignItems:"center",color:"silver"},children:u(g.name)}),B.jsx("div",{style:{height:50,display:"flex"},children:B.jsx(ge.Checkbox,{disabled:o,checked:x,color:k?"primary":"secondary",indeterminate:!!k,style:k?{opacity:.5}:void 0,onChange:A=>{k&&(a&=~g.valueNum&65535,p(a));let G=f;A.target.checked?G|=g.valueNum:G&=~g.valueNum&65535,c(G)}})})]},g.valueNum)})})]},w)})})};async function Pe(f,c,u){let d=c[f];if(!d){const h=f.split("/"),a=h.length,p=h.shift()||null,o=h.join("/"),m=await u.readDir(p,o);c[f]=[];for(let S=0;S<m.length;S++){const w=m[S],g={id:`${f}/${w.file}`,ext:Ne.getFileExtension(w.file),folder:w.isDir,name:w.file,size:w.stats&&w.stats.size,modified:w.modifiedAt,acl:w.acl,level:a};c[f].push(g)}d=c[f]}for(let h=0;h<d.length;h++){const a=d[h];a.folder&&await Pe(a.id,c,u)}}function lt(f){const c={};return Object.keys(f).forEach(u=>{c[u]={folder:!0,id:u,level:0,name:u},f[u].forEach(d=>{c[d.id]=d})}),c}async function Le(f,c,u,d="",h="",a=0){if(typeof u=="string"&&(u=u.split("/"),a=0,d=u.shift()||"",h=""),!(u.length>=a))if(c[d+h]){if(u.length-1===a){const p=`${d+h}/${u[a]}`,o=c[d+h].find(m=>m.id===p);o&&o.folder&&await Pe(d+h,c,f);return}h+=`/${u[a]}`,await Le(f,c,u,d,h,a+1)}else{const p=await f.readDir(d||null,h);c[d+h]=[],p.forEach(o=>{const m={id:`${h}/${o.file}`,ext:Ne.getFileExtension(o.file),folder:o.isDir,name:o.file,size:o.stats&&o.stats.size,modified:o.modifiedAt,acl:o.acl,level:a};c[d+h].push(m)}),await Le(f,c,u,d,h,a+1)}}const Y="different",ct=({onClose:f,onApply:c,selected:u,applyChangesToObject:d,applyChangesToFile:h,objects:a,t:p,themeType:o,folders:m,socket:S,theme:w})=>{const g=u.substring(0,u.lastIndexOf("/"))||u,E=(u.split("/").length===1?m["/"].find(({id:I})=>I===u):m[g].find(({id:I})=>I===u))||{},[x,k]=M.useState(null),[A,G]=M.useState(null),[V,se]=M.useState([]),[q,le]=M.useState([]),[N,ce]=M.useState(!1),[me,Se]=M.useState(0),[te,Be]=M.useState(null),[ue,Ee]=M.useState(!1),[ae,we]=M.useState(!1),[Fe,Ce]=M.useState([]),[Ae,Ue]=M.useState(0),[fe,_e]=M.useState([]),[b,T]=M.useState(!0),[re,ye]=M.useState(!1),xe=qe.getLanguage();return M.useEffect(()=>{const I=[],Q=E.id;let D=!1,W=!1,$=null,H=null,v=null;const J=[];let X=0;Le(S,m,Q).then(()=>{const ne=lt(m),pe=`${Q}/`;Object.keys(ne).forEach(R=>{var L,O,z,Z,P,j,r,e,t;if(R!=="/"&&(R===Q||R.startsWith(pe))){if(!R.includes("/")&&a[R]){const i=a[R];X++,J.push(i),v===null&&((L=i.acl)==null?void 0:L.file)!==void 0&&(v=i.acl.file),$===null&&((O=i.acl)==null?void 0:O.owner)!==void 0&&($=i.acl.owner),H===null&&((z=i.acl)==null?void 0:z.ownerGroup)!==void 0&&(H=i.acl.ownerGroup),!ue&&$!==((Z=i.acl)==null?void 0:Z.owner)&&((P=i.acl)==null?void 0:P.owner)!==void 0&&(D=!0),!ae&&H!==((j=i.acl)==null?void 0:j.ownerGroup)&&((r=i.acl)==null?void 0:r.ownerGroup)!==void 0&&(W=!0),((e=i.acl)==null?void 0:e.file)!==void 0&&v!==((t=i.acl)==null?void 0:t.file)&&!I.includes(i.acl.file)&&I.push(i.acl.file)}else if(!ne[R].folder){X++;const i=ne[R];J.push(i),v===null&&i.acl.permissions!==void 0&&(v=i.acl.permissions),$===null&&i.acl.owner!==void 0&&($=i.acl.owner),H===null&&i.acl.ownerGroup!==void 0&&(H=i.acl.ownerGroup),!ue&&$!==i.acl.owner&&i.acl.owner!==void 0&&(D=!0),!ae&&H!==i.acl.ownerGroup&&i.acl.ownerGroup!==void 0&&(W=!0),i.acl.permissions!==void 0&&v!==i.acl.permissions&&!I.includes(i.acl.permissions)&&I.push(i.acl.permissions)}}});const ie=[],he=[];Object.keys(a).forEach(R=>{const L=a[R];R.startsWith("system.group.")&&(L==null?void 0:L.type)==="group"?he.push(L):R.startsWith("system.user.")&&(L==null?void 0:L.type)==="user"&&ie.push(L)});const oe=a["system.config"].common.defaultNewAcl;$=$||oe.owner,H=H||oe.ownerGroup,v=v||oe.file,Be(v),k($),G(H),Ee(D),we(W),se(ie),le(he),E!=null&&E.folder&&ce(!0),Se(X),Ce(I),_e(J)})},[a,u]),M.useEffect(()=>{var I,Q,D,W;N?(ue&&x!==Y&&k(Y),ae&&A!==Y&&G(Y)):(x&&x===Y&&k(((Q=(I=a[u])==null?void 0:I.acl)==null?void 0:Q.owner)||null),A&&A===Y&&G(((W=(D=a[u])==null?void 0:D.acl)==null?void 0:W.ownerGroup)||null)),console.log(`stateOwnerUser ${x}`)},[N,x,A,ue,ae]),fe.length?B.jsx(Je,{theme:w,titleButtonApply:"apply",overflowHidden:!0,disableApply:b,progress:re,onClose:f,onApply:()=>{ye(!0),setTimeout(async()=>{var Q,D,W,$,H,v,J,X,ne,pe,ie,he,oe,R,L,O;const I=((D=(Q=a["system.config"].common)==null?void 0:Q.defaultNewAcl)==null?void 0:D.file)||1636;if(N){const z=~Ae&65535;for(let Z=0;Z<fe.length;Z++){const P=fe[Z];let j=!1;const r=P,e=P;if(r._id){const t=Me(((ne=r.acl)==null?void 0:ne.file)||I,te,z);t!==((pe=r.acl)==null?void 0:pe.file)&&(r.acl=r.acl||{},r.acl.file=t,j=!0),x!==Y&&x!==((ie=r.acl)==null?void 0:ie.owner)&&(r.acl=r.acl||{},r.acl.owner=x,j=!0),A!==Y&&A!==((he=r.acl)==null?void 0:he.ownerGroup)&&(r.acl=r.acl||{},r.acl.ownerGroup=A,j=!0);try{j&&await d(r)}catch(i){console.error(i)}}else if(e&&!e.folder){const t={},i=Me(((oe=e.acl)==null?void 0:oe.permissions)||I,te,z);if(i!==((R=e.acl)==null?void 0:R.permissions)&&(t.permissions=i,j=!0),x!==Y&&x!==((L=e.acl)==null?void 0:L.owner)&&(t.owner=x,j=!0),A!==Y&&A!==((O=e.acl)==null?void 0:O.ownerGroup)&&(t.ownerGroup=A,j=!0),j){const n=e.id.split("/"),s=n.shift(),l=n.join("/");try{await h(s,l,t)}catch(y){console.error(y)}}}}}else{const z=E.id.split("/"),Z=z.shift(),P=z.join("/"),j={};let r=!1;if(!E.folder)((W=E.acl)==null?void 0:W.permissions)!==te&&(j.permissions=te,r=!0),(($=E.acl)==null?void 0:$.owner)!==x&&(j.owner=x,r=!0),((H=E.acl)==null?void 0:H.ownerGroup)!==A&&(j.ownerGroup=A,r=!0),r&&await h(Z,P,j);else if(!z.length&&a[E.id]){const e=a[E.id];((v=e.acl)==null?void 0:v.file)!==te&&(e.acl=e.acl||{},e.acl.file=te,r=!0),((J=e.acl)==null?void 0:J.owner)!==x&&(e.acl=e.acl||{},e.acl.owner=x,r=!0),((X=e.acl)==null?void 0:X.ownerGroup)!==A&&(e.acl=e.acl||{},e.acl.ownerGroup=A,r=!0),r&&await d(e)}}ye(!1),c()},200)},children:B.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[B.jsx("div",{style:{margin:10,fontSize:20},children:p("Access control list: %s",u)}),B.jsxs("div",{style:{display:"flex"},children:[B.jsx(je,{fullWidth:!0,style:{marginRight:10},label:p("Owner user"),lang:xe,list:V,t:p,disabled:re,value:x||void 0,themeType:o,different:ue?Y:!1,onChange:I=>{Ee(!1),k(I),T(!1)}}),B.jsx(je,{fullWidth:!0,label:p("Owner group"),lang:xe,list:q,t:p,disabled:re,value:A||void 0,themeType:o,different:ae?Y:!1,onChange:I=>{we(!1),G(I),T(!1)}})]}),B.jsxs("div",{style:{display:"flex",margin:10,alignItems:"center",fontSize:10,marginLeft:0,color:"silver"},children:[B.jsx("div",{style:!E.folder||!N?{color:"green"}:void 0,children:p("to apply one item")}),B.jsx(ge.Switch,{disabled:fe.length===1||re,checked:!a[E.id]&&!!E.folder||N,onChange:I=>{ce(I.target.checked),T(!1)},color:"primary"}),B.jsxs("div",{style:E.folder||N?{color:"green"}:void 0,children:[p("to apply with children")," ",E.folder||me>1?`(${me} ${p("object(s)")})`:""]})]}),re&&B.jsx(ge.LinearProgress,{}),B.jsx("div",{style:{overflowY:"auto"},children:B.jsxs("div",{children:[B.jsx("h2",{children:p("File rights")}),B.jsx(st,{disabled:re,mask:Ae,setMask:Ue,applyToChildren:N,differentValues:Fe,t:p,setValue:I=>{Be(I),T(!1)},value:te})]})})]})}):B.jsx(ge.LinearProgress,{})};class Ct extends M.Component{t;wordCache;objects;constructor(c){super(c),this.t=this.translate,this.wordCache={},this.objects={}}componentDidMount(){this.props.socket.getObjects(!0,!0).then(c=>this.objects=c)}translate=(c,u,d)=>u!==void 0?this.props.t(c,u,d):(this.wordCache[c]||(this.wordCache[c]=this.props.t(c)),this.wordCache[c]);renderAclDialog(c){return B.jsx(ct,{theme:this.props.theme,themeType:this.props.themeType,applyChangesToObject:async u=>{const d=await this.props.socket.getObject(u._id);d.acl=u.acl,await this.props.socket.setObject(d._id,d);const h=d;h!=null&&h.acl&&c.updateItemsAcl([{id:h._id,acl:h.acl,level:0,name:h._id,folder:!1}])},applyChangesToFile:async(u,d,h)=>{let a;if((h.owner||h.ownerGroup)&&h.permissions?(await this.props.socket.chownFile(u,d,{owner:h.owner,ownerGroup:h.ownerGroup}),a=await this.props.socket.chmodFile(u,d,{mode:h.permissions})):h.permissions?a=await this.props.socket.chmodFile(u,d,{mode:h.permissions}):(h.owner||h.ownerGroup)&&(a=await this.props.socket.chownFile(u,d,{owner:h.owner,ownerGroup:h.ownerGroup})),Array.isArray(a))for(let p=0;p<a.length;p++){const o=a[p];o&&o.file&&o.acl&&c.updateItemsAcl([{id:`${u}/${o.path?`${o.path}/`:""}${o.file}`,acl:o.acl,level:0,name:"",folder:!1}])}},selected:c.state.selected,folders:c.state.folders,objects:this.objects,socket:this.props.socket,t:this.t,onClose:()=>c.setState({modalEditOfAccess:!1}),onApply:()=>c.setState({modalEditOfAccess:!1})})}render(){return this.props.ready?B.jsx(He,{children:B.jsx(Ve,{overflow:"auto",children:B.jsx(We,{showViewTypeButton:!0,ready:this.props.ready,socket:this.props.socket,themeType:this.props.themeType,theme:this.props.theme,lang:this.props.lang,t:this.props.t,showToolbar:!0,allowUpload:!0,allowView:!0,allowDownload:!0,allowCreateFolder:!0,allowDelete:!0,expertMode:this.props.expertMode,modalEditOfAccessControl:c=>this.renderAclDialog(c),FileViewer:nt})})}):B.jsx(ge.LinearProgress,{})}}export{Ct as default};
|
|
6
|
+
*/(function(f){const c=Ie,u=ke,d=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;f.Buffer=o,f.SlowBuffer=se,f.INSPECT_MAX_BYTES=50;const h=2147483647;f.kMaxLength=h,o.TYPED_ARRAY_SUPPORT=a(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{const r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function p(r){if(r>h)throw new RangeError('The value "'+r+'" is invalid for option "size"');const e=new Uint8Array(r);return Object.setPrototypeOf(e,o.prototype),e}function o(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(r)}return m(r,e,t)}o.poolSize=8192;function m(r,e,t){if(typeof r=="string")return E(r,e);if(ArrayBuffer.isView(r))return k(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(O(r,ArrayBuffer)||r&&O(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(O(r,SharedArrayBuffer)||r&&O(r.buffer,SharedArrayBuffer)))return A(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const i=r.valueOf&&r.valueOf();if(i!=null&&i!==r)return o.from(i,e,t);const n=G(r);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return o.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}o.from=function(r,e,t){return m(r,e,t)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function S(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function w(r,e,t){return S(r),r<=0?p(r):e!==void 0?typeof t=="string"?p(r).fill(e,t):p(r).fill(e):p(r)}o.alloc=function(r,e,t){return w(r,e,t)};function g(r){return S(r),p(r<0?0:V(r)|0)}o.allocUnsafe=function(r){return g(r)},o.allocUnsafeSlow=function(r){return g(r)};function E(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!o.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const t=q(r,e)|0;let i=p(t);const n=i.write(r,e);return n!==t&&(i=i.slice(0,n)),i}function x(r){const e=r.length<0?0:V(r.length)|0,t=p(e);for(let i=0;i<e;i+=1)t[i]=r[i]&255;return t}function k(r){if(O(r,Uint8Array)){const e=new Uint8Array(r);return A(e.buffer,e.byteOffset,e.byteLength)}return x(r)}function A(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');let i;return e===void 0&&t===void 0?i=new Uint8Array(r):t===void 0?i=new Uint8Array(r,e):i=new Uint8Array(r,e,t),Object.setPrototypeOf(i,o.prototype),i}function G(r){if(o.isBuffer(r)){const e=V(r.length)|0,t=p(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r.length!="number"||z(r.length)?p(0):x(r);if(r.type==="Buffer"&&Array.isArray(r.data))return x(r.data)}function V(r){if(r>=h)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+h.toString(16)+" bytes");return r|0}function se(r){return+r!=r&&(r=0),o.alloc(+r)}o.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==o.prototype},o.compare=function(e,t){if(O(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),O(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let i=e.length,n=t.length;for(let s=0,l=Math.min(i,n);s<l;++s)if(e[s]!==t[s]){i=e[s],n=t[s];break}return i<n?-1:n<i?1:0},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return o.alloc(0);let i;if(t===void 0)for(t=0,i=0;i<e.length;++i)t+=e[i].length;const n=o.allocUnsafe(t);let s=0;for(i=0;i<e.length;++i){let l=e[i];if(O(l,Uint8Array))s+l.length>n.length?(o.isBuffer(l)||(l=o.from(l)),l.copy(n,s)):Uint8Array.prototype.set.call(n,l,s);else if(o.isBuffer(l))l.copy(n,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=l.length}return n};function q(r,e){if(o.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||O(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);const t=r.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&t===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return ie(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return R(r).length;default:if(n)return i?-1:ie(r).length;e=(""+e).toLowerCase(),n=!0}}o.byteLength=q;function le(r,e,t){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return fe(this,e,t);case"utf8":case"utf-8":return we(this,e,t);case"ascii":return Ae(this,e,t);case"latin1":case"binary":return Ue(this,e,t);case"base64":return ae(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _e(this,e,t);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),i=!0}}o.prototype._isBuffer=!0;function N(r,e,t){const i=r[e];r[e]=r[t],r[t]=i}o.prototype.swap16=function(){const e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)N(this,t,t+1);return this},o.prototype.swap32=function(){const e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)N(this,t,t+3),N(this,t+1,t+2);return this},o.prototype.swap64=function(){const e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)N(this,t,t+7),N(this,t+1,t+6),N(this,t+2,t+5),N(this,t+3,t+4);return this},o.prototype.toString=function(){const e=this.length;return e===0?"":arguments.length===0?we(this,0,e):le.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:o.compare(this,e)===0},o.prototype.inspect=function(){let e="";const t=f.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},d&&(o.prototype[d]=o.prototype.inspect),o.prototype.compare=function(e,t,i,n,s){if(O(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),s===void 0&&(s=this.length),t<0||i>e.length||n<0||s>this.length)throw new RangeError("out of range index");if(n>=s&&t>=i)return 0;if(n>=s)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,n>>>=0,s>>>=0,this===e)return 0;let l=s-n,y=i-t;const U=Math.min(l,y),C=this.slice(n,s),_=e.slice(t,i);for(let F=0;F<U;++F)if(C[F]!==_[F]){l=C[F],y=_[F];break}return l<y?-1:y<l?1:0};function ce(r,e,t,i,n){if(r.length===0)return-1;if(typeof t=="string"?(i=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,z(t)&&(t=n?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(n)return-1;t=r.length-1}else if(t<0)if(n)t=0;else return-1;if(typeof e=="string"&&(e=o.from(e,i)),o.isBuffer(e))return e.length===0?-1:me(r,e,t,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):me(r,[e],t,i,n);throw new TypeError("val must be string, number or Buffer")}function me(r,e,t,i,n){let s=1,l=r.length,y=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(r.length<2||e.length<2)return-1;s=2,l/=2,y/=2,t/=2}function U(_,F){return s===1?_[F]:_.readUInt16BE(F*s)}let C;if(n){let _=-1;for(C=t;C<l;C++)if(U(r,C)===U(e,_===-1?0:C-_)){if(_===-1&&(_=C),C-_+1===y)return _*s}else _!==-1&&(C-=C-_),_=-1}else for(t+y>l&&(t=l-y),C=t;C>=0;C--){let _=!0;for(let F=0;F<y;F++)if(U(r,C+F)!==U(e,F)){_=!1;break}if(_)return C}return-1}o.prototype.includes=function(e,t,i){return this.indexOf(e,t,i)!==-1},o.prototype.indexOf=function(e,t,i){return ce(this,e,t,i,!0)},o.prototype.lastIndexOf=function(e,t,i){return ce(this,e,t,i,!1)};function Se(r,e,t,i){t=Number(t)||0;const n=r.length-t;i?(i=Number(i),i>n&&(i=n)):i=n;const s=e.length;i>s/2&&(i=s/2);let l;for(l=0;l<i;++l){const y=parseInt(e.substr(l*2,2),16);if(z(y))return l;r[t+l]=y}return l}function te(r,e,t,i){return L(ie(e,r.length-t),r,t,i)}function Be(r,e,t,i){return L(he(e),r,t,i)}function ue(r,e,t,i){return L(R(e),r,t,i)}function Ee(r,e,t,i){return L(oe(e,r.length-t),r,t,i)}o.prototype.write=function(e,t,i,n){if(t===void 0)n="utf8",i=this.length,t=0;else if(i===void 0&&typeof t=="string")n=t,i=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const s=this.length-t;if((i===void 0||i>s)&&(i=s),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let l=!1;for(;;)switch(n){case"hex":return Se(this,e,t,i);case"utf8":case"utf-8":return te(this,e,t,i);case"ascii":case"latin1":case"binary":return Be(this,e,t,i);case"base64":return ue(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ee(this,e,t,i);default:if(l)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),l=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ae(r,e,t){return e===0&&t===r.length?c.fromByteArray(r):c.fromByteArray(r.slice(e,t))}function we(r,e,t){t=Math.min(r.length,t);const i=[];let n=e;for(;n<t;){const s=r[n];let l=null,y=s>239?4:s>223?3:s>191?2:1;if(n+y<=t){let U,C,_,F;switch(y){case 1:s<128&&(l=s);break;case 2:U=r[n+1],(U&192)===128&&(F=(s&31)<<6|U&63,F>127&&(l=F));break;case 3:U=r[n+1],C=r[n+2],(U&192)===128&&(C&192)===128&&(F=(s&15)<<12|(U&63)<<6|C&63,F>2047&&(F<55296||F>57343)&&(l=F));break;case 4:U=r[n+1],C=r[n+2],_=r[n+3],(U&192)===128&&(C&192)===128&&(_&192)===128&&(F=(s&15)<<18|(U&63)<<12|(C&63)<<6|_&63,F>65535&&F<1114112&&(l=F))}}l===null?(l=65533,y=1):l>65535&&(l-=65536,i.push(l>>>10&1023|55296),l=56320|l&1023),i.push(l),n+=y}return Ce(i)}const Fe=4096;function Ce(r){const e=r.length;if(e<=Fe)return String.fromCharCode.apply(String,r);let t="",i=0;for(;i<e;)t+=String.fromCharCode.apply(String,r.slice(i,i+=Fe));return t}function Ae(r,e,t){let i="";t=Math.min(r.length,t);for(let n=e;n<t;++n)i+=String.fromCharCode(r[n]&127);return i}function Ue(r,e,t){let i="";t=Math.min(r.length,t);for(let n=e;n<t;++n)i+=String.fromCharCode(r[n]);return i}function fe(r,e,t){const i=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>i)&&(t=i);let n="";for(let s=e;s<t;++s)n+=Z[r[s]];return n}function _e(r,e,t){const i=r.slice(e,t);let n="";for(let s=0;s<i.length-1;s+=2)n+=String.fromCharCode(i[s]+i[s+1]*256);return n}o.prototype.slice=function(e,t){const i=this.length;e=~~e,t=t===void 0?i:~~t,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,o.prototype),n};function b(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(e,t,i){e=e>>>0,t=t>>>0,i||b(e,t,this.length);let n=this[e],s=1,l=0;for(;++l<t&&(s*=256);)n+=this[e+l]*s;return n},o.prototype.readUintBE=o.prototype.readUIntBE=function(e,t,i){e=e>>>0,t=t>>>0,i||b(e,t,this.length);let n=this[e+--t],s=1;for(;t>0&&(s*=256);)n+=this[e+--t]*s;return n},o.prototype.readUint8=o.prototype.readUInt8=function(e,t){return e=e>>>0,t||b(e,1,this.length),this[e]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||b(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||b(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||b(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||b(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readBigUInt64LE=P(function(e){e=e>>>0,J(e,"offset");const t=this[e],i=this[e+7];(t===void 0||i===void 0)&&X(e,this.length-8);const n=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+i*2**24;return BigInt(n)+(BigInt(s)<<BigInt(32))}),o.prototype.readBigUInt64BE=P(function(e){e=e>>>0,J(e,"offset");const t=this[e],i=this[e+7];(t===void 0||i===void 0)&&X(e,this.length-8);const n=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i;return(BigInt(n)<<BigInt(32))+BigInt(s)}),o.prototype.readIntLE=function(e,t,i){e=e>>>0,t=t>>>0,i||b(e,t,this.length);let n=this[e],s=1,l=0;for(;++l<t&&(s*=256);)n+=this[e+l]*s;return s*=128,n>=s&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,i){e=e>>>0,t=t>>>0,i||b(e,t,this.length);let n=t,s=1,l=this[e+--n];for(;n>0&&(s*=256);)l+=this[e+--n]*s;return s*=128,l>=s&&(l-=Math.pow(2,8*t)),l},o.prototype.readInt8=function(e,t){return e=e>>>0,t||b(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},o.prototype.readInt16LE=function(e,t){e=e>>>0,t||b(e,2,this.length);const i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i},o.prototype.readInt16BE=function(e,t){e=e>>>0,t||b(e,2,this.length);const i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i},o.prototype.readInt32LE=function(e,t){return e=e>>>0,t||b(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e=e>>>0,t||b(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readBigInt64LE=P(function(e){e=e>>>0,J(e,"offset");const t=this[e],i=this[e+7];(t===void 0||i===void 0)&&X(e,this.length-8);const n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(i<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),o.prototype.readBigInt64BE=P(function(e){e=e>>>0,J(e,"offset");const t=this[e],i=this[e+7];(t===void 0||i===void 0)&&X(e,this.length-8);const n=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i)}),o.prototype.readFloatLE=function(e,t){return e=e>>>0,t||b(e,4,this.length),u.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e=e>>>0,t||b(e,4,this.length),u.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||b(e,8,this.length),u.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||b(e,8,this.length),u.read(this,e,!1,52,8)};function T(r,e,t,i,n,s){if(!o.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<s)throw new RangeError('"value" argument is out of bounds');if(t+i>r.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(e,t,i,n){if(e=+e,t=t>>>0,i=i>>>0,!n){const y=Math.pow(2,8*i)-1;T(this,e,t,i,y,0)}let s=1,l=0;for(this[t]=e&255;++l<i&&(s*=256);)this[t+l]=e/s&255;return t+i},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(e,t,i,n){if(e=+e,t=t>>>0,i=i>>>0,!n){const y=Math.pow(2,8*i)-1;T(this,e,t,i,y,0)}let s=i-1,l=1;for(this[t+s]=e&255;--s>=0&&(l*=256);)this[t+s]=e/l&255;return t+i},o.prototype.writeUint8=o.prototype.writeUInt8=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,1,255,0),this[t]=e&255,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function re(r,e,t,i,n){v(e,i,n,r,t,7);let s=Number(e&BigInt(4294967295));r[t++]=s,s=s>>8,r[t++]=s,s=s>>8,r[t++]=s,s=s>>8,r[t++]=s;let l=Number(e>>BigInt(32)&BigInt(4294967295));return r[t++]=l,l=l>>8,r[t++]=l,l=l>>8,r[t++]=l,l=l>>8,r[t++]=l,t}function ye(r,e,t,i,n){v(e,i,n,r,t,7);let s=Number(e&BigInt(4294967295));r[t+7]=s,s=s>>8,r[t+6]=s,s=s>>8,r[t+5]=s,s=s>>8,r[t+4]=s;let l=Number(e>>BigInt(32)&BigInt(4294967295));return r[t+3]=l,l=l>>8,r[t+2]=l,l=l>>8,r[t+1]=l,l=l>>8,r[t]=l,t+8}o.prototype.writeBigUInt64LE=P(function(e,t=0){return re(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=P(function(e,t=0){return ye(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(e,t,i,n){if(e=+e,t=t>>>0,!n){const U=Math.pow(2,8*i-1);T(this,e,t,i,U-1,-U)}let s=0,l=1,y=0;for(this[t]=e&255;++s<i&&(l*=256);)e<0&&y===0&&this[t+s-1]!==0&&(y=1),this[t+s]=(e/l>>0)-y&255;return t+i},o.prototype.writeIntBE=function(e,t,i,n){if(e=+e,t=t>>>0,!n){const U=Math.pow(2,8*i-1);T(this,e,t,i,U-1,-U)}let s=i-1,l=1,y=0;for(this[t+s]=e&255;--s>=0&&(l*=256);)e<0&&y===0&&this[t+s+1]!==0&&(y=1),this[t+s]=(e/l>>0)-y&255;return t+i},o.prototype.writeInt8=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},o.prototype.writeInt16LE=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},o.prototype.writeInt32LE=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},o.prototype.writeBigInt64LE=P(function(e,t=0){return re(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=P(function(e,t=0){return ye(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function xe(r,e,t,i,n,s){if(t+i>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function I(r,e,t,i,n){return e=+e,t=t>>>0,n||xe(r,e,t,4),u.write(r,e,t,i,23,4),t+4}o.prototype.writeFloatLE=function(e,t,i){return I(this,e,t,!0,i)},o.prototype.writeFloatBE=function(e,t,i){return I(this,e,t,!1,i)};function Q(r,e,t,i,n){return e=+e,t=t>>>0,n||xe(r,e,t,8),u.write(r,e,t,i,52,8),t+8}o.prototype.writeDoubleLE=function(e,t,i){return Q(this,e,t,!0,i)},o.prototype.writeDoubleBE=function(e,t,i){return Q(this,e,t,!1,i)},o.prototype.copy=function(e,t,i,n){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-i&&(n=e.length-t+i);const s=n-i;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,i,n):Uint8Array.prototype.set.call(e,this.subarray(i,n),t),s},o.prototype.fill=function(e,t,i,n){if(typeof e=="string"){if(typeof t=="string"?(n=t,t=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!o.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){const l=e.charCodeAt(0);(n==="utf8"&&l<128||n==="latin1")&&(e=l)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let s;if(typeof e=="number")for(s=t;s<i;++s)this[s]=e;else{const l=o.isBuffer(e)?e:o.from(e,n),y=l.length;if(y===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<i-t;++s)this[s+t]=l[s%y]}return this};const D={};function W(r,e,t){D[r]=class extends t{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){return r}set code(n){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:n,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}}}W("ERR_BUFFER_OUT_OF_BOUNDS",function(r){return r?`${r} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),W("ERR_INVALID_ARG_TYPE",function(r,e){return`The "${r}" argument must be of type number. Received type ${typeof e}`},TypeError),W("ERR_OUT_OF_RANGE",function(r,e,t){let i=`The value of "${r}" is out of range.`,n=t;return Number.isInteger(t)&&Math.abs(t)>2**32?n=$(String(t)):typeof t=="bigint"&&(n=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(n=$(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);function $(r){let e="",t=r.length;const i=r[0]==="-"?1:0;for(;t>=i+4;t-=3)e=`_${r.slice(t-3,t)}${e}`;return`${r.slice(0,t)}${e}`}function H(r,e,t){J(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&X(e,r.length-(t+1))}function v(r,e,t,i,n,s){if(r>t||r<e){const l=typeof e=="bigint"?"n":"";let y;throw e===0||e===BigInt(0)?y=`>= 0${l} and < 2${l} ** ${(s+1)*8}${l}`:y=`>= -(2${l} ** ${(s+1)*8-1}${l}) and < 2 ** ${(s+1)*8-1}${l}`,new D.ERR_OUT_OF_RANGE("value",y,r)}H(i,n,s)}function J(r,e){if(typeof r!="number")throw new D.ERR_INVALID_ARG_TYPE(e,"number",r)}function X(r,e,t){throw Math.floor(r)!==r?(J(r,t),new D.ERR_OUT_OF_RANGE("offset","an integer",r)):e<0?new D.ERR_BUFFER_OUT_OF_BOUNDS:new D.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${e}`,r)}const ne=/[^+/0-9A-Za-z-_]/g;function pe(r){if(r=r.split("=")[0],r=r.trim().replace(ne,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function ie(r,e){e=e||1/0;let t;const i=r.length;let n=null;const s=[];for(let l=0;l<i;++l){if(t=r.charCodeAt(l),t>55295&&t<57344){if(!n){if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(l+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=t;continue}if(t<56320){(e-=3)>-1&&s.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,t<128){if((e-=1)<0)break;s.push(t)}else if(t<2048){if((e-=2)<0)break;s.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;s.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;s.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}function he(r){const e=[];for(let t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function oe(r,e){let t,i,n;const s=[];for(let l=0;l<r.length&&!((e-=2)<0);++l)t=r.charCodeAt(l),i=t>>8,n=t%256,s.push(n),s.push(i);return s}function R(r){return c.toByteArray(pe(r))}function L(r,e,t,i){let n;for(n=0;n<i&&!(n+t>=e.length||n>=r.length);++n)e[n+t]=r[n];return n}function O(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}function z(r){return r!==r}const Z=(function(){const r="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){const i=t*16;for(let n=0;n<16;++n)e[i+n]=r[t]+r[n]}return e})();function P(r){return typeof BigInt>"u"?j:r}function j(){throw new Error("BigInt not supported")}})(De);var rt={exports:{}};(function(f,c){ace.define("ace/ext/modelist",["require","exports","module"],function(u,d,h){var a=[];function p(G){for(var V=w.text,se=G.split(/[\/\\]/).pop(),q=0;q<a.length;q++)if(a[q].supportsFile(se)){V=a[q];break}return V}var o=(function(){function G(V,se,q){this.name=V,this.caption=se,this.mode="ace/mode/"+V,this.extensions=q;var le;/\^/.test(q)?le=q.replace(/\|(\^)?/g,function(N,ce){return"$|"+(ce?"^":"^.*\\.")})+"$":le="\\.("+q+")$",this.extRe=new RegExp(le,"gi")}return G.prototype.supportsFile=function(V){return V.match(this.extRe)},G})(),m={ABAP:["abap"],ABC:["abc"],ActionScript:["as"],ADA:["ada|adb"],Alda:["alda"],Apache_Conf:["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],Apex:["apex|cls|trigger|tgr"],AQL:["aql"],AsciiDoc:["asciidoc|adoc"],ASL:["dsl|asl|asl.json"],Assembly_ARM32:["s"],Assembly_x86:["asm|a"],Astro:["astro"],AutoHotKey:["ahk"],Basic:["bas|bak"],BatchFile:["bat|cmd"],BibTeX:["bib"],C_Cpp:["cpp|c|cc|cxx|h|hh|hpp|ino"],C9Search:["c9search_results"],Cirru:["cirru|cr"],Clojure:["clj|cljs"],Clue:["clue"],Cobol:["CBL|COB"],coffee:["coffee|cf|cson|^Cakefile"],ColdFusion:["cfm|cfc"],Crystal:["cr"],CSharp:["cs"],Csound_Document:["csd"],Csound_Orchestra:["orc"],Csound_Score:["sco"],CSS:["css"],CSV:["csv"],Curly:["curly"],Cuttlefish:["conf"],D:["d|di"],Dart:["dart"],Diff:["diff|patch"],Django:["djt|html.djt|dj.html|djhtml"],Dockerfile:["^Dockerfile"],Dot:["dot"],Drools:["drl"],Edifact:["edi"],Eiffel:["e|ge"],EJS:["ejs"],Elixir:["ex|exs"],Elm:["elm"],Erlang:["erl|hrl"],Flix:["flix"],Forth:["frt|fs|ldr|fth|4th"],Fortran:["f|f90"],FSharp:["fsi|fs|ml|mli|fsx|fsscript"],FSL:["fsl"],FTL:["ftl"],Gcode:["gcode"],Gherkin:["feature"],Gitignore:["^.gitignore"],Glsl:["glsl|frag|vert"],Gobstones:["gbs"],golang:["go"],GraphQLSchema:["gql"],Groovy:["groovy"],HAML:["haml"],Handlebars:["hbs|handlebars|tpl|mustache"],Haskell:["hs"],Haskell_Cabal:["cabal"],haXe:["hx"],Hjson:["hjson"],HTML:["html|htm|xhtml|we|wpy"],HTML_Elixir:["eex|html.eex"],HTML_Ruby:["erb|rhtml|html.erb"],INI:["ini|conf|cfg|prefs"],Io:["io"],Ion:["ion"],Jack:["jack"],Jade:["jade|pug"],Java:["java"],JavaScript:["js|jsm|cjs|mjs"],JEXL:["jexl"],JSON:["json"],JSON5:["json5"],JSONiq:["jq"],JSP:["jsp"],JSSM:["jssm|jssm_state"],JSX:["jsx"],Julia:["jl"],Kotlin:["kt|kts"],LaTeX:["tex|latex|ltx|bib"],Latte:["latte"],LESS:["less"],Liquid:["liquid"],Lisp:["lisp"],LiveScript:["ls"],Log:["log"],LogiQL:["logic|lql"],Logtalk:["lgt"],LSL:["lsl"],Lua:["lua"],LuaPage:["lp"],Lucene:["lucene"],Makefile:["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],Markdown:["md|markdown"],Mask:["mask"],MATLAB:["matlab"],Maze:["mz"],MediaWiki:["wiki|mediawiki"],MEL:["mel"],MIPS:["s|asm"],MIXAL:["mixal"],MUSHCode:["mc|mush"],MySQL:["mysql"],Nasal:["nas"],Nginx:["nginx|conf"],Nim:["nim"],Nix:["nix"],NSIS:["nsi|nsh"],Nunjucks:["nunjucks|nunjs|nj|njk"],ObjectiveC:["m|mm"],OCaml:["ml|mli"],Odin:["odin"],PartiQL:["partiql|pql"],Pascal:["pas|p"],Perl:["pl|pm"],pgSQL:["pgsql"],PHP:["php|inc|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],PHP_Laravel_blade:["blade.php"],Pig:["pig"],PLSQL:["plsql"],Powershell:["ps1"],Praat:["praat|praatscript|psc|proc"],Prisma:["prisma"],Prolog:["plg|prolog"],Properties:["properties"],Protobuf:["proto"],PRQL:["prql"],Puppet:["epp|pp"],Python:["py"],QML:["qml"],R:["r"],Raku:["raku|rakumod|rakutest|p6|pl6|pm6"],Razor:["cshtml|asp"],RDoc:["Rd"],Red:["red|reds"],RHTML:["Rhtml"],Robot:["robot|resource"],RST:["rst"],Ruby:["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],Rust:["rs"],SaC:["sac"],SASS:["sass"],SCAD:["scad"],Scala:["scala|sbt"],Scheme:["scm|sm|rkt|oak|scheme"],Scrypt:["scrypt"],SCSS:["scss"],SH:["sh|bash|^.bashrc"],SJS:["sjs"],Slim:["slim|skim"],Smarty:["smarty|tpl"],Smithy:["smithy"],snippets:["snippets"],Soy_Template:["soy"],Space:["space"],SPARQL:["rq"],SQL:["sql"],SQLServer:["sqlserver"],Stylus:["styl|stylus"],SVG:["svg"],Swift:["swift"],Tcl:["tcl"],Terraform:["tf","tfvars","terragrunt"],Tex:["tex"],Text:["txt"],Textile:["textile"],Toml:["toml"],TSV:["tsv"],TSX:["tsx"],Turtle:["ttl"],Twig:["twig|swig"],Typescript:["ts|mts|cts|typescript|str"],Vala:["vala"],VBScript:["vbs|vb"],Velocity:["vm"],Verilog:["v|vh|sv|svh"],VHDL:["vhd|vhdl"],Visualforce:["vfp|component|page"],Vue:["vue"],Wollok:["wlk|wpgm|wtest"],XML:["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],XQuery:["xq"],YAML:["yaml|yml"],Zeek:["zeek|bro"],Zig:["zig"]},S={ObjectiveC:"Objective-C",CSharp:"C#",golang:"Go",C_Cpp:"C and C++",Csound_Document:"Csound Document",Csound_Orchestra:"Csound",Csound_Score:"Csound Score",coffee:"CoffeeScript",HTML_Ruby:"HTML (Ruby)",HTML_Elixir:"HTML (Elixir)",FTL:"FreeMarker",PHP_Laravel_blade:"PHP (Blade Template)",Perl6:"Perl 6",AutoHotKey:"AutoHotkey / AutoIt"},w={};for(var g in m){var E=m[g],x=(S[g]||g).replace(/_/g," "),k=g.toLowerCase(),A=new o(k,x,E[0]);w[k]=A,a.push(A)}d.getModeForPath=p,d.modes=a,d.modesByName=w}),(function(){ace.require(["ace/ext/modelist"],function(u){f&&(f.exports=u)})})()})(rt);const it=be.require?be.require("ace/ext/modelist"):be.acequire("ace/ext/modelist");class Re extends $e{constructor(c){super(c),Object.assign(this.state,{editing:!!this.props.formatEditFile||!1})}static getEditFile(c){switch(c){case"json":return"json";case"json5":return"json5";case"js":return"javascript";case"html":return"html";case"txt":return"html";default:return it.getModeForPath(`testFile.${c}`).mode.split("/").pop()}}writeFile64=()=>{const c=this.props.href.split("/"),u=this.state.editingValue;c.splice(0,2);const d=c[0],h=c.splice(1).join("/");this.props.socket.writeFile64(d,h,De.Buffer.from(u).toString("base64")).then(()=>this.props.onClose()).catch(a=>window.alert(`Cannot write file: ${a}`))};getEditorOrViewer(){return B.jsx(ve,{mode:Re.getEditFile(this.props.formatEditFile),themeType:this.props.themeType,value:this.state.editingValue||this.state.code||this.state.text,onChange:this.state.editing?c=>this.setState({editingValue:c,changed:!0}):void 0})}onSave(){this.writeFile64()}}const nt=Ge()(Re),ot=[{Owner:[{name:"read",valueNum:1024,title:"read owner"},{name:"write",valueNum:512,title:"write owner"}]},{Group:[{name:"read",valueNum:64,title:"read group"},{name:"write",valueNum:32,title:"write group"}]},{Everyone:[{name:"read",valueNum:4,title:"read everyone"},{name:"write",valueNum:2,title:"write everyone"}]}],Me=(f,c,u)=>(f|=c&u,f&=c|~u&65535,f),st=({value:f,setValue:c,t:u,differentValues:d,applyToChildren:h,mask:a,setMask:p,disabled:o})=>{M.useEffect(()=>{if(h){let S=0;for(let w=0;w<d.length;w++)S|=f^d[w];p(S)}else p(0)},[d,h,p,f]);let m=f;return B.jsx("div",{style:{display:"flex",width:"fit-content",margin:20,border:"1px solid",borderLeft:0},children:ot.map(S=>{const w=Object.keys(S)[0];return B.jsxs("div",{style:{width:150,height:150,display:"flex",flexDirection:"column",alignItems:"center",borderLeft:"1px solid"},children:[B.jsx("div",{style:{height:50,display:"flex",alignItems:"center",fontSize:18,borderBottom:"1px solid silver",width:"100%",justifyContent:"center"},children:u(w)}),B.jsx("div",{style:{display:"flex",width:"100%"},children:S[w].map((g,E)=>{let x=!1;const k=a&g.valueNum;return m-g.valueNum>=0&&(m-=g.valueNum,x=!0),B.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1,alignItems:"center",borderRight:E===0?"1px solid":0},children:[B.jsx("div",{style:{height:50,borderBottom:"1px solid",width:"100%",justifyContent:"center",display:"flex",alignItems:"center",color:"silver"},children:u(g.name)}),B.jsx("div",{style:{height:50,display:"flex"},children:B.jsx(ge.Checkbox,{disabled:o,checked:x,color:k?"primary":"secondary",indeterminate:!!k,style:k?{opacity:.5}:void 0,onChange:A=>{k&&(a&=~g.valueNum&65535,p(a));let G=f;A.target.checked?G|=g.valueNum:G&=~g.valueNum&65535,c(G)}})})]},g.valueNum)})})]},w)})})};async function Pe(f,c,u){let d=c[f];if(!d){const h=f.split("/"),a=h.length,p=h.shift()||null,o=h.join("/"),m=await u.readDir(p,o);c[f]=[];for(let S=0;S<m.length;S++){const w=m[S],g={id:`${f}/${w.file}`,ext:Ne.getFileExtension(w.file),folder:w.isDir,name:w.file,size:w.stats&&w.stats.size,modified:w.modifiedAt,acl:w.acl,level:a};c[f].push(g)}d=c[f]}for(let h=0;h<d.length;h++){const a=d[h];a.folder&&await Pe(a.id,c,u)}}function lt(f){const c={};return Object.keys(f).forEach(u=>{c[u]={folder:!0,id:u,level:0,name:u},f[u].forEach(d=>{c[d.id]=d})}),c}async function Le(f,c,u,d="",h="",a=0){if(typeof u=="string"&&(u=u.split("/"),a=0,d=u.shift()||"",h=""),!(u.length>=a))if(c[d+h]){if(u.length-1===a){const p=`${d+h}/${u[a]}`,o=c[d+h].find(m=>m.id===p);o&&o.folder&&await Pe(d+h,c,f);return}h+=`/${u[a]}`,await Le(f,c,u,d,h,a+1)}else{const p=await f.readDir(d||null,h);c[d+h]=[],p.forEach(o=>{const m={id:`${h}/${o.file}`,ext:Ne.getFileExtension(o.file),folder:o.isDir,name:o.file,size:o.stats&&o.stats.size,modified:o.modifiedAt,acl:o.acl,level:a};c[d+h].push(m)}),await Le(f,c,u,d,h,a+1)}}const Y="different",ct=({onClose:f,onApply:c,selected:u,applyChangesToObject:d,applyChangesToFile:h,objects:a,t:p,themeType:o,folders:m,socket:S,theme:w})=>{const g=u.substring(0,u.lastIndexOf("/"))||u,E=(u.split("/").length===1?m["/"].find(({id:I})=>I===u):m[g].find(({id:I})=>I===u))||{},[x,k]=M.useState(null),[A,G]=M.useState(null),[V,se]=M.useState([]),[q,le]=M.useState([]),[N,ce]=M.useState(!1),[me,Se]=M.useState(0),[te,Be]=M.useState(null),[ue,Ee]=M.useState(!1),[ae,we]=M.useState(!1),[Fe,Ce]=M.useState([]),[Ae,Ue]=M.useState(0),[fe,_e]=M.useState([]),[b,T]=M.useState(!0),[re,ye]=M.useState(!1),xe=qe.getLanguage();return M.useEffect(()=>{const I=[],Q=E.id;let D=!1,W=!1,$=null,H=null,v=null;const J=[];let X=0;Le(S,m,Q).then(()=>{const ne=lt(m),pe=`${Q}/`;Object.keys(ne).forEach(R=>{var L,O,z,Z,P,j,r,e,t;if(R!=="/"&&(R===Q||R.startsWith(pe))){if(!R.includes("/")&&a[R]){const i=a[R];X++,J.push(i),v===null&&((L=i.acl)==null?void 0:L.file)!==void 0&&(v=i.acl.file),$===null&&((O=i.acl)==null?void 0:O.owner)!==void 0&&($=i.acl.owner),H===null&&((z=i.acl)==null?void 0:z.ownerGroup)!==void 0&&(H=i.acl.ownerGroup),!ue&&$!==((Z=i.acl)==null?void 0:Z.owner)&&((P=i.acl)==null?void 0:P.owner)!==void 0&&(D=!0),!ae&&H!==((j=i.acl)==null?void 0:j.ownerGroup)&&((r=i.acl)==null?void 0:r.ownerGroup)!==void 0&&(W=!0),((e=i.acl)==null?void 0:e.file)!==void 0&&v!==((t=i.acl)==null?void 0:t.file)&&!I.includes(i.acl.file)&&I.push(i.acl.file)}else if(!ne[R].folder){X++;const i=ne[R];J.push(i),v===null&&i.acl.permissions!==void 0&&(v=i.acl.permissions),$===null&&i.acl.owner!==void 0&&($=i.acl.owner),H===null&&i.acl.ownerGroup!==void 0&&(H=i.acl.ownerGroup),!ue&&$!==i.acl.owner&&i.acl.owner!==void 0&&(D=!0),!ae&&H!==i.acl.ownerGroup&&i.acl.ownerGroup!==void 0&&(W=!0),i.acl.permissions!==void 0&&v!==i.acl.permissions&&!I.includes(i.acl.permissions)&&I.push(i.acl.permissions)}}});const ie=[],he=[];Object.keys(a).forEach(R=>{const L=a[R];R.startsWith("system.group.")&&(L==null?void 0:L.type)==="group"?he.push(L):R.startsWith("system.user.")&&(L==null?void 0:L.type)==="user"&&ie.push(L)});const oe=a["system.config"].common.defaultNewAcl;$=$||oe.owner,H=H||oe.ownerGroup,v=v||oe.file,Be(v),k($),G(H),Ee(D),we(W),se(ie),le(he),E!=null&&E.folder&&ce(!0),Se(X),Ce(I),_e(J)})},[a,u]),M.useEffect(()=>{var I,Q,D,W;N?(ue&&x!==Y&&k(Y),ae&&A!==Y&&G(Y)):(x&&x===Y&&k(((Q=(I=a[u])==null?void 0:I.acl)==null?void 0:Q.owner)||null),A&&A===Y&&G(((W=(D=a[u])==null?void 0:D.acl)==null?void 0:W.ownerGroup)||null)),console.log(`stateOwnerUser ${x}`)},[N,x,A,ue,ae]),fe.length?B.jsx(Je,{theme:w,titleButtonApply:"apply",overflowHidden:!0,disableApply:b,progress:re,onClose:f,onApply:()=>{ye(!0),setTimeout(async()=>{var Q,D,W,$,H,v,J,X,ne,pe,ie,he,oe,R,L,O;const I=((D=(Q=a["system.config"].common)==null?void 0:Q.defaultNewAcl)==null?void 0:D.file)||1636;if(N){const z=~Ae&65535;for(let Z=0;Z<fe.length;Z++){const P=fe[Z];let j=!1;const r=P,e=P;if(r._id){const t=Me(((ne=r.acl)==null?void 0:ne.file)||I,te,z);t!==((pe=r.acl)==null?void 0:pe.file)&&(r.acl=r.acl||{},r.acl.file=t,j=!0),x!==Y&&x!==((ie=r.acl)==null?void 0:ie.owner)&&(r.acl=r.acl||{},r.acl.owner=x,j=!0),A!==Y&&A!==((he=r.acl)==null?void 0:he.ownerGroup)&&(r.acl=r.acl||{},r.acl.ownerGroup=A,j=!0);try{j&&await d(r)}catch(i){console.error(i)}}else if(e&&!e.folder){const t={},i=Me(((oe=e.acl)==null?void 0:oe.permissions)||I,te,z);if(i!==((R=e.acl)==null?void 0:R.permissions)&&(t.permissions=i,j=!0),x!==Y&&x!==((L=e.acl)==null?void 0:L.owner)&&(t.owner=x,j=!0),A!==Y&&A!==((O=e.acl)==null?void 0:O.ownerGroup)&&(t.ownerGroup=A,j=!0),j){const n=e.id.split("/"),s=n.shift(),l=n.join("/");try{await h(s,l,t)}catch(y){console.error(y)}}}}}else{const z=E.id.split("/"),Z=z.shift(),P=z.join("/"),j={};let r=!1;if(!E.folder)((W=E.acl)==null?void 0:W.permissions)!==te&&(j.permissions=te,r=!0),(($=E.acl)==null?void 0:$.owner)!==x&&(j.owner=x,r=!0),((H=E.acl)==null?void 0:H.ownerGroup)!==A&&(j.ownerGroup=A,r=!0),r&&await h(Z,P,j);else if(!z.length&&a[E.id]){const e=a[E.id];((v=e.acl)==null?void 0:v.file)!==te&&(e.acl=e.acl||{},e.acl.file=te,r=!0),((J=e.acl)==null?void 0:J.owner)!==x&&(e.acl=e.acl||{},e.acl.owner=x,r=!0),((X=e.acl)==null?void 0:X.ownerGroup)!==A&&(e.acl=e.acl||{},e.acl.ownerGroup=A,r=!0),r&&await d(e)}}ye(!1),c()},200)},children:B.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[B.jsx("div",{style:{margin:10,fontSize:20},children:p("Access control list: %s",u)}),B.jsxs("div",{style:{display:"flex"},children:[B.jsx(je,{fullWidth:!0,style:{marginRight:10},label:p("Owner user"),lang:xe,list:V,t:p,disabled:re,value:x||void 0,themeType:o,different:ue?Y:!1,onChange:I=>{Ee(!1),k(I),T(!1)}}),B.jsx(je,{fullWidth:!0,label:p("Owner group"),lang:xe,list:q,t:p,disabled:re,value:A||void 0,themeType:o,different:ae?Y:!1,onChange:I=>{we(!1),G(I),T(!1)}})]}),B.jsxs("div",{style:{display:"flex",margin:10,alignItems:"center",fontSize:10,marginLeft:0,color:"silver"},children:[B.jsx("div",{style:!E.folder||!N?{color:"green"}:void 0,children:p("to apply one item")}),B.jsx(ge.Switch,{disabled:fe.length===1||re,checked:!a[E.id]&&!!E.folder||N,onChange:I=>{ce(I.target.checked),T(!1)},color:"primary"}),B.jsxs("div",{style:E.folder||N?{color:"green"}:void 0,children:[p("to apply with children")," ",E.folder||me>1?`(${me} ${p("object(s)")})`:""]})]}),re&&B.jsx(ge.LinearProgress,{}),B.jsx("div",{style:{overflowY:"auto"},children:B.jsxs("div",{children:[B.jsx("h2",{children:p("File rights")}),B.jsx(st,{disabled:re,mask:Ae,setMask:Ue,applyToChildren:N,differentValues:Fe,t:p,setValue:I=>{Be(I),T(!1)},value:te})]})})]})}):B.jsx(ge.LinearProgress,{})};class Ct extends M.Component{t;wordCache;objects;constructor(c){super(c),this.t=this.translate,this.wordCache={},this.objects={}}componentDidMount(){this.props.socket.getObjects(!0,!0).then(c=>this.objects=c)}translate=(c,u,d)=>u!==void 0?this.props.t(c,u,d):(this.wordCache[c]||(this.wordCache[c]=this.props.t(c)),this.wordCache[c]);renderAclDialog(c){return B.jsx(ct,{theme:this.props.theme,themeType:this.props.themeType,applyChangesToObject:async u=>{const d=await this.props.socket.getObject(u._id);d.acl=u.acl,await this.props.socket.setObject(d._id,d);const h=d;h!=null&&h.acl&&c.updateItemsAcl([{id:h._id,acl:h.acl,level:0,name:h._id,folder:!1}])},applyChangesToFile:async(u,d,h)=>{let a;if((h.owner||h.ownerGroup)&&h.permissions?(await this.props.socket.chownFile(u,d,{owner:h.owner,ownerGroup:h.ownerGroup}),a=await this.props.socket.chmodFile(u,d,{mode:h.permissions})):h.permissions?a=await this.props.socket.chmodFile(u,d,{mode:h.permissions}):(h.owner||h.ownerGroup)&&(a=await this.props.socket.chownFile(u,d,{owner:h.owner,ownerGroup:h.ownerGroup})),Array.isArray(a))for(let p=0;p<a.length;p++){const o=a[p];o&&o.file&&o.acl&&c.updateItemsAcl([{id:`${u}/${o.path?`${o.path}/`:""}${o.file}`,acl:o.acl,level:0,name:"",folder:!1}])}},selected:c.state.selected,folders:c.state.folders,objects:this.objects,socket:this.props.socket,t:this.t,onClose:()=>c.setState({modalEditOfAccess:!1}),onApply:()=>c.setState({modalEditOfAccess:!1})})}render(){return this.props.ready?B.jsx(He,{children:B.jsx(Ve,{overflow:"auto",children:B.jsx(We,{showViewTypeButton:!0,ready:this.props.ready,socket:this.props.socket,themeType:this.props.themeType,theme:this.props.theme,lang:this.props.lang,t:this.props.t,showToolbar:!0,allowUpload:!0,allowView:!0,allowDownload:!0,allowCreateFolder:!0,allowDelete:!0,expertMode:this.props.expertMode,modalEditOfAccessControl:c=>this.renderAclDialog(c),FileViewer:nt})})}):B.jsx(ge.LinearProgress,{})}}export{Ct as default};
|