From c71aeda7fe4707afd9efc697bf93278ab6e7a0c8 Mon Sep 17 00:00:00 2001 From: GermanBluefox Date: Sun, 9 Feb 2025 16:44:12 +0000 Subject: [PATCH] Made TypeScript migration --- .../{index-C5PAt3CA.js => index-BcH8XfT1.js} | 2 +- admin/index_m.html | 2 +- dist/main.d.ts | 65 + dist/main.js | 2050 ++++++++++++++ dist/main.js.map | 1 + eslint.config.mjs | 2 + lib/socket.js | 48 - main.js | 2220 --------------- package.json | 33 +- src-admin/index.html | 2 +- src-admin/package.json | 2 + src-admin/src/Tabs/Options.jsx | 8 +- src-admin/src/i18n/de.json | 141 +- src-admin/src/i18n/en.json | 141 +- src-admin/src/i18n/es.json | 139 +- src-admin/src/i18n/fr.json | 139 +- src-admin/src/i18n/it.json | 139 +- src-admin/src/i18n/nl.json | 139 +- src-admin/src/i18n/pl.json | 141 +- src-admin/src/i18n/pt.json | 139 +- src-admin/src/i18n/ru.json | 139 +- src-admin/src/i18n/uk.json | 27 +- src-admin/src/i18n/zh-cn.json | 139 +- src-admin/src/{index.jsx => index.tsx} | 6 + src/main.ts | 2477 +++++++++++++++++ src/types.d.ts | 106 + tasks.js | 7 +- tsconfig.build.json | 8 + tsconfig.json | 30 + 29 files changed, 5496 insertions(+), 2996 deletions(-) rename admin/assets/{index-C5PAt3CA.js => index-BcH8XfT1.js} (94%) create mode 100644 dist/main.d.ts create mode 100644 dist/main.js create mode 100644 dist/main.js.map delete mode 100644 lib/socket.js delete mode 100644 main.js rename src-admin/src/{index.jsx => index.tsx} (90%) create mode 100644 src/main.ts create mode 100644 src/types.d.ts create mode 100644 tsconfig.build.json create mode 100644 tsconfig.json diff --git a/admin/assets/index-C5PAt3CA.js b/admin/assets/index-BcH8XfT1.js similarity index 94% rename from admin/assets/index-C5PAt3CA.js rename to admin/assets/index-BcH8XfT1.js index f3ff97a2..bf36e008 100644 --- a/admin/assets/index-C5PAt3CA.js +++ b/admin/assets/index-BcH8XfT1.js @@ -581,4 +581,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * * Date: 2024-04-21T07:43:05.335Z */function qO(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function NN(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r
',EVe=Number.isNaN||Do.isNaN;function mt(t){return typeof t=="number"&&!EVe(t)}var oD=function(e){return e>0&&e<1/0};function Bv(t){return typeof t>"u"}function Ws(t){return Qb(t)==="object"&&t!==null}var TVe=Object.prototype.hasOwnProperty;function dc(t){if(!Ws(t))return!1;try{var e=t.constructor,r=e.prototype;return e&&r&&TVe.call(r,"isPrototypeOf")}catch{return!1}}function rn(t){return typeof t=="function"}var OVe=Array.prototype.slice;function UN(t){return Array.from?Array.from(t):OVe.call(t)}function pr(t,e){return t&&rn(e)&&(Array.isArray(t)||mt(t.length)?UN(t).forEach(function(r,n){e.call(t,r,n,t)}):Ws(t)&&Object.keys(t).forEach(function(r){e.call(t,t[r],r,t)})),t}var Xt=Object.assign||function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o0&&n.forEach(function(a){Ws(a)&&Object.keys(a).forEach(function(i){e[i]=a[i]})}),e},DVe=/\.\d*(?:0|9){12}\d*$/;function _c(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return DVe.test(t)?Math.round(t*e)/e:t}var MVe=/^width|height|left|top|marginLeft|marginTop$/;function Fa(t,e){var r=t.style;pr(e,function(n,o){MVe.test(o)&&mt(n)&&(n="".concat(n,"px")),r[o]=n})}function PVe(t,e){return t.classList?t.classList.contains(e):t.className.indexOf(e)>-1}function xr(t,e){if(e){if(mt(t.length)){pr(t,function(n){xr(n,e)});return}if(t.classList){t.classList.add(e);return}var r=t.className.trim();r?r.indexOf(e)<0&&(t.className="".concat(r," ").concat(e)):t.className=e}}function To(t,e){if(e){if(mt(t.length)){pr(t,function(r){To(r,e)});return}if(t.classList){t.classList.remove(e);return}t.className.indexOf(e)>=0&&(t.className=t.className.replace(e,""))}}function pc(t,e,r){if(e){if(mt(t.length)){pr(t,function(n){pc(n,e,r)});return}r?xr(t,e):To(t,e)}}var NVe=/([a-z\d])([A-Z])/g;function nx(t){return t.replace(NVe,"$1-$2").toLowerCase()}function c0(t,e){return Ws(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(nx(e)))}function wu(t,e,r){Ws(r)?t[e]=r:t.dataset?t.dataset[e]=r:t.setAttribute("data-".concat(nx(e)),r)}function AVe(t,e){if(Ws(t[e]))try{delete t[e]}catch{t[e]=void 0}else if(t.dataset)try{delete t.dataset[e]}catch{t.dataset[e]=void 0}else t.removeAttribute("data-".concat(nx(e)))}var HN=/\s\s*/,qN=function(){var t=!1;if(lh){var e=!1,r=function(){},n=Object.defineProperty({},"once",{get:function(){return t=!0,e},set:function(a){e=a}});Do.addEventListener("test",r,n),Do.removeEventListener("test",r,n)}return t}();function Yn(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=r;e.trim().split(HN).forEach(function(a){if(!qN){var i=t.listeners;i&&i[a]&&i[a][r]&&(o=i[a][r],delete i[a][r],Object.keys(i[a]).length===0&&delete i[a],Object.keys(i).length===0&&delete t.listeners)}t.removeEventListener(a,o,n)})}function Pn(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=r;e.trim().split(HN).forEach(function(a){if(n.once&&!qN){var i=t.listeners,l=i===void 0?{}:i;o=function(){delete l[a][r],t.removeEventListener(a,o,n);for(var f=arguments.length,h=new Array(f),d=0;dMath.abs(r)&&(r=m)})}),r}function Mp(t,e){var r=t.pageX,n=t.pageY,o={endX:r,endY:n};return e?o:NN({startX:r,startY:n},o)}function jVe(t){var e=0,r=0,n=0;return pr(t,function(o){var a=o.startX,i=o.startY;e+=a,r+=i,n+=1}),e/=n,r/=n,{pageX:e,pageY:r}}function Ba(t){var e=t.aspectRatio,r=t.height,n=t.width,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",a=oD(n),i=oD(r);if(a&&i){var l=r*e;o==="contain"&&l>n||o==="cover"&&l90?{width:u,height:l}:{width:l,height:u}}function LVe(t,e,r,n){var o=e.aspectRatio,a=e.naturalWidth,i=e.naturalHeight,l=e.rotate,u=l===void 0?0:l,f=e.scaleX,h=f===void 0?1:f,d=e.scaleY,m=d===void 0?1:d,g=r.aspectRatio,v=r.naturalWidth,w=r.naturalHeight,S=n.fillColor,k=S===void 0?"transparent":S,T=n.imageSmoothingEnabled,E=T===void 0?!0:T,M=n.imageSmoothingQuality,P=M===void 0?"low":M,D=n.maxWidth,A=D===void 0?1/0:D,j=n.maxHeight,F=j===void 0?1/0:j,O=n.minWidth,z=O===void 0?0:O,G=n.minHeight,H=G===void 0?0:G,q=document.createElement("canvas"),U=q.getContext("2d"),Y=Ba({aspectRatio:g,width:A,height:F}),te=Ba({aspectRatio:g,width:z,height:H},"cover"),Z=Math.min(Y.width,Math.max(te.width,v)),J=Math.min(Y.height,Math.max(te.height,w)),re=Ba({aspectRatio:o,width:A,height:F}),L=Ba({aspectRatio:o,width:z,height:H},"cover"),Q=Math.min(re.width,Math.max(L.width,a)),de=Math.min(re.height,Math.max(L.height,i)),fe=[-Q/2,-de/2,Q,de];return q.width=_c(Z),q.height=_c(J),U.fillStyle=k,U.fillRect(0,0,Z,J),U.save(),U.translate(Z/2,J/2),U.rotate(u*Math.PI/180),U.scale(h,m),U.imageSmoothingEnabled=E,U.imageSmoothingQuality=P,U.drawImage.apply(U,[t].concat(RN(fe.map(function(_e){return Math.floor(_c(_e))})))),U.restore(),q}var GN=String.fromCharCode;function FVe(t,e,r){var n="";r+=e;for(var o=e;o0;)r.push(GN.apply(null,UN(o.subarray(0,n)))),o=o.subarray(n);return"data:".concat(e,";base64,").concat(btoa(r.join("")))}function HVe(t){var e=new DataView(t),r;try{var n,o,a;if(e.getUint8(0)===255&&e.getUint8(1)===216)for(var i=e.byteLength,l=2;l+1=8&&(a=f+d)}}}if(a){var m=e.getUint16(a,n),g,v;for(v=0;v=0?a:BN),height:Math.max(n.offsetHeight,i>=0?i:WN)};this.containerData=l,Fa(o,{width:l.width,height:l.height}),xr(e,nn),To(o,nn)},initCanvas:function(){var e=this.containerData,r=this.imageData,n=this.options.viewMode,o=Math.abs(r.rotate)%180===90,a=o?r.naturalHeight:r.naturalWidth,i=o?r.naturalWidth:r.naturalHeight,l=a/i,u=e.width,f=e.height;e.height*l>e.width?n===3?u=e.height*l:f=e.width/l:n===3?f=e.width/l:u=e.height*l;var h={aspectRatio:l,naturalWidth:a,naturalHeight:i,width:u,height:f};this.canvasData=h,this.limited=n===1||n===2,this.limitCanvas(!0,!0),h.width=Math.min(Math.max(h.width,h.minWidth),h.maxWidth),h.height=Math.min(Math.max(h.height,h.minHeight),h.maxHeight),h.left=(e.width-h.width)/2,h.top=(e.height-h.height)/2,h.oldLeft=h.left,h.oldTop=h.top,this.initialCanvasData=Xt({},h)},limitCanvas:function(e,r){var n=this.options,o=this.containerData,a=this.canvasData,i=this.cropBoxData,l=n.viewMode,u=a.aspectRatio,f=this.cropped&&i;if(e){var h=Number(n.minCanvasWidth)||0,d=Number(n.minCanvasHeight)||0;l>1?(h=Math.max(h,o.width),d=Math.max(d,o.height),l===3&&(d*u>h?h=d*u:d=h/u)):l>0&&(h?h=Math.max(h,f?i.width:0):d?d=Math.max(d,f?i.height:0):f&&(h=i.width,d=i.height,d*u>h?h=d*u:d=h/u));var m=Ba({aspectRatio:u,width:h,height:d});h=m.width,d=m.height,a.minWidth=h,a.minHeight=d,a.maxWidth=1/0,a.maxHeight=1/0}if(r)if(l>(f?0:1)){var g=o.width-a.width,v=o.height-a.height;a.minLeft=Math.min(0,g),a.minTop=Math.min(0,v),a.maxLeft=Math.max(0,g),a.maxTop=Math.max(0,v),f&&this.limited&&(a.minLeft=Math.min(i.left,i.left+(i.width-a.width)),a.minTop=Math.min(i.top,i.top+(i.height-a.height)),a.maxLeft=i.left,a.maxTop=i.top,l===2&&(a.width>=o.width&&(a.minLeft=Math.min(0,g),a.maxLeft=Math.max(0,g)),a.height>=o.height&&(a.minTop=Math.min(0,v),a.maxTop=Math.max(0,v))))}else a.minLeft=-a.width,a.minTop=-a.height,a.maxLeft=o.width,a.maxTop=o.height},renderCanvas:function(e,r){var n=this.canvasData,o=this.imageData;if(r){var a=zVe({width:o.naturalWidth*Math.abs(o.scaleX||1),height:o.naturalHeight*Math.abs(o.scaleY||1),degree:o.rotate||0}),i=a.width,l=a.height,u=n.width*(i/n.naturalWidth),f=n.height*(l/n.naturalHeight);n.left-=(u-n.width)/2,n.top-=(f-n.height)/2,n.width=u,n.height=f,n.aspectRatio=i/l,n.naturalWidth=i,n.naturalHeight=l,this.limitCanvas(!0,!1)}(n.width>n.maxWidth||n.widthn.maxHeight||n.heightr.width?a.height=a.width/n:a.width=a.height*n),this.cropBoxData=a,this.limitCropBox(!0,!0),a.width=Math.min(Math.max(a.width,a.minWidth),a.maxWidth),a.height=Math.min(Math.max(a.height,a.minHeight),a.maxHeight),a.width=Math.max(a.minWidth,a.width*o),a.height=Math.max(a.minHeight,a.height*o),a.left=r.left+(r.width-a.width)/2,a.top=r.top+(r.height-a.height)/2,a.oldLeft=a.left,a.oldTop=a.top,this.initialCropBoxData=Xt({},a)},limitCropBox:function(e,r){var n=this.options,o=this.containerData,a=this.canvasData,i=this.cropBoxData,l=this.limited,u=n.aspectRatio;if(e){var f=Number(n.minCropBoxWidth)||0,h=Number(n.minCropBoxHeight)||0,d=l?Math.min(o.width,a.width,a.width+a.left,o.width-a.left):o.width,m=l?Math.min(o.height,a.height,a.height+a.top,o.height-a.top):o.height;f=Math.min(f,o.width),h=Math.min(h,o.height),u&&(f&&h?h*u>f?h=f/u:f=h*u:f?h=f/u:h&&(f=h*u),m*u>d?m=d/u:d=m*u),i.minWidth=Math.min(f,d),i.minHeight=Math.min(h,m),i.maxWidth=d,i.maxHeight=m}r&&(l?(i.minLeft=Math.max(0,a.left),i.minTop=Math.max(0,a.top),i.maxLeft=Math.min(o.width,a.left+a.width)-i.width,i.maxTop=Math.min(o.height,a.top+a.height)-i.height):(i.minLeft=0,i.minTop=0,i.maxLeft=o.width-i.width,i.maxTop=o.height-i.height))},renderCropBox:function(){var e=this.options,r=this.containerData,n=this.cropBoxData;(n.width>n.maxWidth||n.widthn.maxHeight||n.height=r.width&&n.height>=r.height?jN:tx),Fa(this.cropBox,Xt({width:n.width,height:n.height},su({translateX:n.left,translateY:n.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),gc(this.element,n0,this.getData())}},GVe={initPreview:function(){var e=this.element,r=this.crossOrigin,n=this.options.preview,o=r?this.crossOriginUrl:this.url,a=e.alt||"The image to preview",i=document.createElement("img");if(r&&(i.crossOrigin=r),i.src=o,i.alt=a,this.viewBox.appendChild(i),this.viewBoxImage=i,!!n){var l=n;typeof n=="string"?l=e.ownerDocument.querySelectorAll(n):n.querySelector&&(l=[n]),this.previews=l,pr(l,function(u){var f=document.createElement("img");wu(u,Dp,{width:u.offsetWidth,height:u.offsetHeight,html:u.innerHTML}),r&&(f.crossOrigin=r),f.src=o,f.alt=a,f.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',u.innerHTML="",u.appendChild(f)})}},resetPreview:function(){pr(this.previews,function(e){var r=c0(e,Dp);Fa(e,{width:r.width,height:r.height}),e.innerHTML=r.html,AVe(e,Dp)})},preview:function(){var e=this.imageData,r=this.canvasData,n=this.cropBoxData,o=n.width,a=n.height,i=e.width,l=e.height,u=n.left-r.left-e.left,f=n.top-r.top-e.top;!this.cropped||this.disabled||(Fa(this.viewBoxImage,Xt({width:i,height:l},su(Xt({translateX:-u,translateY:-f},e)))),pr(this.previews,function(h){var d=c0(h,Dp),m=d.width,g=d.height,v=m,w=g,S=1;o&&(S=m/o,w=a*S),a&&w>g&&(S=g/a,v=o*S,w=g),Fa(h,{width:v,height:w}),Fa(h.getElementsByTagName("img")[0],Xt({width:i*S,height:l*S},su(Xt({translateX:-u*S,translateY:-f*S},e))))}))}},XVe={bind:function(){var e=this.element,r=this.options,n=this.cropper;rn(r.cropstart)&&Pn(e,s0,r.cropstart),rn(r.cropmove)&&Pn(e,a0,r.cropmove),rn(r.cropend)&&Pn(e,o0,r.cropend),rn(r.crop)&&Pn(e,n0,r.crop),rn(r.zoom)&&Pn(e,i0,r.zoom),Pn(n,YO,this.onCropStart=this.cropStart.bind(this)),r.zoomable&&r.zoomOnWheel&&Pn(n,tD,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),r.toggleDragModeOnDblclick&&Pn(n,JO,this.onDblclick=this.dblclick.bind(this)),Pn(e.ownerDocument,KO,this.onCropMove=this.cropMove.bind(this)),Pn(e.ownerDocument,ZO,this.onCropEnd=this.cropEnd.bind(this)),r.responsive&&Pn(window,eD,this.onResize=this.resize.bind(this))},unbind:function(){var e=this.element,r=this.options,n=this.cropper;rn(r.cropstart)&&Yn(e,s0,r.cropstart),rn(r.cropmove)&&Yn(e,a0,r.cropmove),rn(r.cropend)&&Yn(e,o0,r.cropend),rn(r.crop)&&Yn(e,n0,r.crop),rn(r.zoom)&&Yn(e,i0,r.zoom),Yn(n,YO,this.onCropStart),r.zoomable&&r.zoomOnWheel&&Yn(n,tD,this.onWheel,{passive:!1,capture:!0}),r.toggleDragModeOnDblclick&&Yn(n,JO,this.onDblclick),Yn(e.ownerDocument,KO,this.onCropMove),Yn(e.ownerDocument,ZO,this.onCropEnd),r.responsive&&Yn(window,eD,this.onResize)}},JVe={resize:function(){if(!this.disabled){var e=this.options,r=this.container,n=this.containerData,o=r.offsetWidth/n.width,a=r.offsetHeight/n.height,i=Math.abs(o-1)>Math.abs(a-1)?o:a;if(i!==1){var l,u;e.restore&&(l=this.getCanvasData(),u=this.getCropBoxData()),this.render(),e.restore&&(this.setCanvasData(pr(l,function(f,h){l[h]=f*i})),this.setCropBoxData(pr(u,function(f,h){u[h]=f*i})))}}},dblclick:function(){this.disabled||this.options.dragMode===FN||this.setDragMode(PVe(this.dragBox,t0)?LN:rx)},wheel:function(e){var r=this,n=Number(this.options.wheelZoomRatio)||.1,o=1;this.disabled||(e.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){r.wheeling=!1},50),e.deltaY?o=e.deltaY>0?1:-1:e.wheelDelta?o=-e.wheelDelta/120:e.detail&&(o=e.detail>0?1:-1),this.zoom(-o*n,e)))},cropStart:function(e){var r=e.buttons,n=e.button;if(!(this.disabled||(e.type==="mousedown"||e.type==="pointerdown"&&e.pointerType==="mouse")&&(mt(r)&&r!==1||mt(n)&&n!==0||e.ctrlKey))){var o=this.options,a=this.pointers,i;e.changedTouches?pr(e.changedTouches,function(l){a[l.identifier]=Mp(l)}):a[e.pointerId||0]=Mp(e),Object.keys(a).length>1&&o.zoomable&&o.zoomOnTouch?i=zN:i=c0(e.target,bu),xVe.test(i)&&gc(this.element,s0,{originalEvent:e,action:i})!==!1&&(e.preventDefault(),this.action=i,this.cropping=!1,i===IN&&(this.cropping=!0,xr(this.dragBox,gf)))}},cropMove:function(e){var r=this.action;if(!(this.disabled||!r)){var n=this.pointers;e.preventDefault(),gc(this.element,a0,{originalEvent:e,action:r})!==!1&&(e.changedTouches?pr(e.changedTouches,function(o){Xt(n[o.identifier]||{},Mp(o,!0))}):Xt(n[e.pointerId||0]||{},Mp(e,!0)),this.change(e))}},cropEnd:function(e){if(!this.disabled){var r=this.action,n=this.pointers;e.changedTouches?pr(e.changedTouches,function(o){delete n[o.identifier]}):delete n[e.pointerId||0],r&&(e.preventDefault(),Object.keys(n).length||(this.action=""),this.cropping&&(this.cropping=!1,pc(this.dragBox,gf,this.cropped&&this.options.modal)),gc(this.element,o0,{originalEvent:e,action:r}))}}},YVe={change:function(e){var r=this.options,n=this.canvasData,o=this.containerData,a=this.cropBoxData,i=this.pointers,l=this.action,u=r.aspectRatio,f=a.left,h=a.top,d=a.width,m=a.height,g=f+d,v=h+m,w=0,S=0,k=o.width,T=o.height,E=!0,M;!u&&e.shiftKey&&(u=d&&m?d/m:1),this.limited&&(w=a.minLeft,S=a.minTop,k=w+Math.min(o.width,n.width,n.left+n.width),T=S+Math.min(o.height,n.height,n.top+n.height));var P=i[Object.keys(i)[0]],D={x:P.endX-P.startX,y:P.endY-P.startY},A=function(F){switch(F){case ys:g+D.x>k&&(D.x=k-g);break;case vs:f+D.xT&&(D.y=T-v);break}};switch(l){case tx:f+=D.x,h+=D.y;break;case ys:if(D.x>=0&&(g>=k||u&&(h<=S||v>=T))){E=!1;break}A(ys),d+=D.x,d<0&&(l=vs,d=-d,f-=d),u&&(m=d/u,h+=(a.height-m)/2);break;case Aa:if(D.y<=0&&(h<=S||u&&(f<=w||g>=k))){E=!1;break}A(Aa),m-=D.y,h+=D.y,m<0&&(l=Ui,m=-m,h-=m),u&&(d=m*u,f+=(a.width-d)/2);break;case vs:if(D.x<=0&&(f<=w||u&&(h<=S||v>=T))){E=!1;break}A(vs),d-=D.x,f+=D.x,d<0&&(l=ys,d=-d,f-=d),u&&(m=d/u,h+=(a.height-m)/2);break;case Ui:if(D.y>=0&&(v>=T||u&&(f<=w||g>=k))){E=!1;break}A(Ui),m+=D.y,m<0&&(l=Aa,m=-m,h-=m),u&&(d=m*u,f+=(a.width-d)/2);break;case Il:if(u){if(D.y<=0&&(h<=S||g>=k)){E=!1;break}A(Aa),m-=D.y,h+=D.y,d=m*u}else A(Aa),A(ys),D.x>=0?gS&&(m-=D.y,h+=D.y):(m-=D.y,h+=D.y);d<0&&m<0?(l=Ll,m=-m,d=-d,h-=m,f-=d):d<0?(l=jl,d=-d,f-=d):m<0&&(l=zl,m=-m,h-=m);break;case jl:if(u){if(D.y<=0&&(h<=S||f<=w)){E=!1;break}A(Aa),m-=D.y,h+=D.y,d=m*u,f+=a.width-d}else A(Aa),A(vs),D.x<=0?f>w?(d-=D.x,f+=D.x):D.y<=0&&h<=S&&(E=!1):(d-=D.x,f+=D.x),D.y<=0?h>S&&(m-=D.y,h+=D.y):(m-=D.y,h+=D.y);d<0&&m<0?(l=zl,m=-m,d=-d,h-=m,f-=d):d<0?(l=Il,d=-d,f-=d):m<0&&(l=Ll,m=-m,h-=m);break;case Ll:if(u){if(D.x<=0&&(f<=w||v>=T)){E=!1;break}A(vs),d-=D.x,f+=D.x,m=d/u}else A(Ui),A(vs),D.x<=0?f>w?(d-=D.x,f+=D.x):D.y>=0&&v>=T&&(E=!1):(d-=D.x,f+=D.x),D.y>=0?v=0&&(g>=k||v>=T)){E=!1;break}A(ys),d+=D.x,m=d/u}else A(Ui),A(ys),D.x>=0?g=0&&v>=T&&(E=!1):d+=D.x,D.y>=0?v0?l=D.y>0?zl:Il:D.x<0&&(f-=d,l=D.y>0?Ll:jl),D.y<0&&(h-=m),this.cropped||(To(this.cropBox,nn),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}E&&(a.width=d,a.height=m,a.left=f,a.top=h,this.action=l,this.renderCropBox()),pr(i,function(j){j.startX=j.endX,j.startY=j.endY})}},KVe={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&xr(this.dragBox,gf),To(this.cropBox,nn),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=Xt({},this.initialImageData),this.canvasData=Xt({},this.initialCanvasData),this.cropBoxData=Xt({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(Xt(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),To(this.dragBox,gf),xr(this.cropBox,nn)),this},replace:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&e&&(this.isImg&&(this.element.src=e),r?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,pr(this.previews,function(n){n.getElementsByTagName("img")[0].src=e}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,To(this.cropper,GO)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,xr(this.cropper,GO)),this},destroy:function(){var e=this.element;return e[Vt]?(e[Vt]=void 0,this.isImg&&this.replaced&&(e.src=this.originalUrl),this.uncreate(),this):this},move:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=this.canvasData,o=n.left,a=n.top;return this.moveTo(Bv(e)?e:o+Number(e),Bv(r)?r:a+Number(r))},moveTo:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=this.canvasData,o=!1;return e=Number(e),r=Number(r),this.ready&&!this.disabled&&this.options.movable&&(mt(e)&&(n.left=e,o=!0),mt(r)&&(n.top=r,o=!0),o&&this.renderCanvas(!0)),this},zoom:function(e,r){var n=this.canvasData;return e=Number(e),e<0?e=1/(1-e):e=1+e,this.zoomTo(n.width*e/n.naturalWidth,null,r)},zoomTo:function(e,r,n){var o=this.options,a=this.canvasData,i=a.width,l=a.height,u=a.naturalWidth,f=a.naturalHeight;if(e=Number(e),e>=0&&this.ready&&!this.disabled&&o.zoomable){var h=u*e,d=f*e;if(gc(this.element,i0,{ratio:e,oldRatio:i/u,originalEvent:n})===!1)return this;if(n){var m=this.pointers,g=VN(this.cropper),v=m&&Object.keys(m).length?jVe(m):{pageX:n.pageX,pageY:n.pageY};a.left-=(h-i)*((v.pageX-g.left-a.left)/i),a.top-=(d-l)*((v.pageY-g.top-a.top)/l)}else dc(r)&&mt(r.x)&&mt(r.y)?(a.left-=(h-i)*((r.x-a.left)/i),a.top-=(d-l)*((r.y-a.top)/l)):(a.left-=(h-i)/2,a.top-=(d-l)/2);a.width=h,a.height=d,this.renderCanvas(!0)}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return e=Number(e),mt(e)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=e%360,this.renderCanvas(!0,!0)),this},scaleX:function(e){var r=this.imageData.scaleY;return this.scale(e,mt(r)?r:1)},scaleY:function(e){var r=this.imageData.scaleX;return this.scale(mt(r)?r:1,e)},scale:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=this.imageData,o=!1;return e=Number(e),r=Number(r),this.ready&&!this.disabled&&this.options.scalable&&(mt(e)&&(n.scaleX=e,o=!0),mt(r)&&(n.scaleY=r,o=!0),o&&this.renderCanvas(!0,!0)),this},getData:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=this.options,n=this.imageData,o=this.canvasData,a=this.cropBoxData,i;if(this.ready&&this.cropped){i={x:a.left-o.left,y:a.top-o.top,width:a.width,height:a.height};var l=n.width/n.naturalWidth;if(pr(i,function(h,d){i[d]=h/l}),e){var u=Math.round(i.y+i.height),f=Math.round(i.x+i.width);i.x=Math.round(i.x),i.y=Math.round(i.y),i.width=f-i.x,i.height=u-i.y}}else i={x:0,y:0,width:0,height:0};return r.rotatable&&(i.rotate=n.rotate||0),r.scalable&&(i.scaleX=n.scaleX||1,i.scaleY=n.scaleY||1),i},setData:function(e){var r=this.options,n=this.imageData,o=this.canvasData,a={};if(this.ready&&!this.disabled&&dc(e)){var i=!1;r.rotatable&&mt(e.rotate)&&e.rotate!==n.rotate&&(n.rotate=e.rotate,i=!0),r.scalable&&(mt(e.scaleX)&&e.scaleX!==n.scaleX&&(n.scaleX=e.scaleX,i=!0),mt(e.scaleY)&&e.scaleY!==n.scaleY&&(n.scaleY=e.scaleY,i=!0)),i&&this.renderCanvas(!0,!0);var l=n.width/n.naturalWidth;mt(e.x)&&(a.left=e.x*l+o.left),mt(e.y)&&(a.top=e.y*l+o.top),mt(e.width)&&(a.width=e.width*l),mt(e.height)&&(a.height=e.height*l),this.setCropBoxData(a)}return this},getContainerData:function(){return this.ready?Xt({},this.containerData):{}},getImageData:function(){return this.sized?Xt({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,r={};return this.ready&&pr(["left","top","width","height","naturalWidth","naturalHeight"],function(n){r[n]=e[n]}),r},setCanvasData:function(e){var r=this.canvasData,n=r.aspectRatio;return this.ready&&!this.disabled&&dc(e)&&(mt(e.left)&&(r.left=e.left),mt(e.top)&&(r.top=e.top),mt(e.width)?(r.width=e.width,r.height=e.width/n):mt(e.height)&&(r.height=e.height,r.width=e.height*n),this.renderCanvas(!0)),this},getCropBoxData:function(){var e=this.cropBoxData,r;return this.ready&&this.cropped&&(r={left:e.left,top:e.top,width:e.width,height:e.height}),r||{}},setCropBoxData:function(e){var r=this.cropBoxData,n=this.options.aspectRatio,o,a;return this.ready&&this.cropped&&!this.disabled&&dc(e)&&(mt(e.left)&&(r.left=e.left),mt(e.top)&&(r.top=e.top),mt(e.width)&&e.width!==r.width&&(o=!0,r.width=e.width),mt(e.height)&&e.height!==r.height&&(a=!0,r.height=e.height),n&&(o?r.height=r.width/n:a&&(r.width=r.height*n)),this.renderCropBox()),this},getCroppedCanvas:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var r=this.canvasData,n=LVe(this.image,this.imageData,r,e);if(!this.cropped)return n;var o=this.getData(e.rounded),a=o.x,i=o.y,l=o.width,u=o.height,f=n.width/Math.floor(r.naturalWidth);f!==1&&(a*=f,i*=f,l*=f,u*=f);var h=l/u,d=Ba({aspectRatio:h,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),m=Ba({aspectRatio:h,width:e.minWidth||0,height:e.minHeight||0},"cover"),g=Ba({aspectRatio:h,width:e.width||(f!==1?n.width:l),height:e.height||(f!==1?n.height:u)}),v=g.width,w=g.height;v=Math.min(d.width,Math.max(m.width,v)),w=Math.min(d.height,Math.max(m.height,w));var S=document.createElement("canvas"),k=S.getContext("2d");S.width=_c(v),S.height=_c(w),k.fillStyle=e.fillColor||"transparent",k.fillRect(0,0,v,w);var T=e.imageSmoothingEnabled,E=T===void 0?!0:T,M=e.imageSmoothingQuality;k.imageSmoothingEnabled=E,M&&(k.imageSmoothingQuality=M);var P=n.width,D=n.height,A=a,j=i,F,O,z,G,H,q;A<=-l||A>P?(A=0,F=0,z=0,H=0):A<=0?(z=-A,A=0,F=Math.min(P,l+A),H=F):A<=P&&(z=0,F=Math.min(l,P-A),H=F),F<=0||j<=-u||j>D?(j=0,O=0,G=0,q=0):j<=0?(G=-j,j=0,O=Math.min(D,u+j),q=O):j<=D&&(G=0,O=Math.min(u,D-j),q=O);var U=[A,j,F,O];if(H>0&&q>0){var Y=v/l;U.push(z*Y,G*Y,H*Y,q*Y)}return k.drawImage.apply(k,[n].concat(RN(U.map(function(te){return Math.floor(_c(te))})))),S},setAspectRatio:function(e){var r=this.options;return!this.disabled&&!Bv(e)&&(r.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var r=this.options,n=this.dragBox,o=this.face;if(this.ready&&!this.disabled){var a=e===rx,i=r.movable&&e===LN;e=a||i?e:FN,r.dragMode=e,wu(n,bu,e),pc(n,t0,a),pc(n,r0,i),r.cropBoxMovable||(wu(o,bu,e),pc(o,t0,a),pc(o,r0,i))}return this}},ZVe=Do.Cropper,XN=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(dVe(this,t),!e||!$Ve.test(e.tagName))throw new Error("The first argument is required and must be an or element.");this.element=e,this.options=Xt({},nD,dc(r)&&r),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return pVe(t,[{key:"init",value:function(){var r=this.element,n=r.tagName.toLowerCase(),o;if(!r[Vt]){if(r[Vt]=this,n==="img"){if(this.isImg=!0,o=r.getAttribute("src")||"",this.originalUrl=o,!o)return;o=r.src}else n==="canvas"&&window.HTMLCanvasElement&&(o=r.toDataURL());this.load(o)}}},{key:"load",value:function(r){var n=this;if(r){this.url=r,this.imageData={};var o=this.element,a=this.options;if(!a.rotatable&&!a.scalable&&(a.checkOrientation=!1),!a.checkOrientation||!window.ArrayBuffer){this.clone();return}if(SVe.test(r)){kVe.test(r)?this.read(WVe(r)):this.clone();return}var i=new XMLHttpRequest,l=this.clone.bind(this);this.reloading=!0,this.xhr=i,i.onabort=l,i.onerror=l,i.ontimeout=l,i.onprogress=function(){i.getResponseHeader("content-type")!==rD&&i.abort()},i.onload=function(){n.read(i.response)},i.onloadend=function(){n.reloading=!1,n.xhr=null},a.checkCrossOrigin&&aD(r)&&o.crossOrigin&&(r=sD(r)),i.open("GET",r,!0),i.responseType="arraybuffer",i.withCredentials=o.crossOrigin==="use-credentials",i.send()}}},{key:"read",value:function(r){var n=this.options,o=this.imageData,a=HVe(r),i=0,l=1,u=1;if(a>1){this.url=UVe(r,rD);var f=qVe(a);i=f.rotate,l=f.scaleX,u=f.scaleY}n.rotatable&&(o.rotate=i),n.scalable&&(o.scaleX=l,o.scaleY=u),this.clone()}},{key:"clone",value:function(){var r=this.element,n=this.url,o=r.crossOrigin,a=n;this.options.checkCrossOrigin&&aD(n)&&(o||(o="anonymous"),a=sD(n)),this.crossOrigin=o,this.crossOriginUrl=a;var i=document.createElement("img");o&&(i.crossOrigin=o),i.src=a||n,i.alt=r.alt||"The image to crop",this.image=i,i.onload=this.start.bind(this),i.onerror=this.stop.bind(this),xr(i,XO),r.parentNode.insertBefore(i,r.nextSibling)}},{key:"start",value:function(){var r=this,n=this.image;n.onload=null,n.onerror=null,this.sizing=!0;var o=Do.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(Do.navigator.userAgent),a=function(f,h){Xt(r.imageData,{naturalWidth:f,naturalHeight:h,aspectRatio:f/h}),r.initialImageData=Xt({},r.imageData),r.sizing=!1,r.sized=!0,r.build()};if(n.naturalWidth&&!o){a(n.naturalWidth,n.naturalHeight);return}var i=document.createElement("img"),l=document.body||document.documentElement;this.sizingImage=i,i.onload=function(){a(i.width,i.height),o||l.removeChild(i)},i.src=n.src,o||(i.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",l.appendChild(i))}},{key:"stop",value:function(){var r=this.image;r.onload=null,r.onerror=null,r.parentNode.removeChild(r),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var r=this.element,n=this.options,o=this.image,a=r.parentNode,i=document.createElement("div");i.innerHTML=CVe;var l=i.querySelector(".".concat(Vt,"-container")),u=l.querySelector(".".concat(Vt,"-canvas")),f=l.querySelector(".".concat(Vt,"-drag-box")),h=l.querySelector(".".concat(Vt,"-crop-box")),d=h.querySelector(".".concat(Vt,"-face"));this.container=a,this.cropper=l,this.canvas=u,this.dragBox=f,this.cropBox=h,this.viewBox=l.querySelector(".".concat(Vt,"-view-box")),this.face=d,u.appendChild(o),xr(r,nn),a.insertBefore(l,r.nextSibling),To(o,XO),this.initPreview(),this.bind(),n.initialAspectRatio=Math.max(0,n.initialAspectRatio)||NaN,n.aspectRatio=Math.max(0,n.aspectRatio)||NaN,n.viewMode=Math.max(0,Math.min(3,Math.round(n.viewMode)))||0,xr(h,nn),n.guides||xr(h.getElementsByClassName("".concat(Vt,"-dashed")),nn),n.center||xr(h.getElementsByClassName("".concat(Vt,"-center")),nn),n.background&&xr(l,"".concat(Vt,"-bg")),n.highlight||xr(d,yVe),n.cropBoxMovable&&(xr(d,r0),wu(d,bu,tx)),n.cropBoxResizable||(xr(h.getElementsByClassName("".concat(Vt,"-line")),nn),xr(h.getElementsByClassName("".concat(Vt,"-point")),nn)),this.render(),this.ready=!0,this.setDragMode(n.dragMode),n.autoCrop&&this.crop(),this.setData(n.data),rn(n.ready)&&Pn(r,QO,n.ready,{once:!0}),gc(r,QO)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var r=this.cropper.parentNode;r&&r.removeChild(this.cropper),To(this.element,nn)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=ZVe,t}},{key:"setDefaults",value:function(r){Xt(nD,dc(r)&&r)}}])}();Xt(XN.prototype,VVe,GVe,XVe,JVe,YVe,KVe);var Cs=function(){return Cs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0&&j.zoomTo(te)}(A.currentTarget.cropper,E),S&&S(A)}}));k&&k(D)}return function(){var A,j;(j=(A=M.current)===null||A===void 0?void 0:A.cropper)===null||j===void 0||j.destroy()}},[M]);var P=function(D){return QVe.reduce(function(A,j){var F=A,O=j;return F[O],Uv(F,[typeof O=="symbol"?O:O+""])},D)}(Cs(Cs({},T),{crossOrigin:u,src:a,alt:w}));return y.createElement("div",{style:i,className:l},y.createElement("img",Cs({},P,{style:eGe,ref:M})))});const Ra={mainDiv:{width:"100%",height:"100%",overflow:"auto"},formControl:{margin:0,minWidth:120},formControlMarginRight:{marginRight:5},formControlPaddingTop:{paddingTop:6.2}},tGe={once:"once",interval:"interval",intervalBetween:"intervalBetween",specific:"specific"},zr={seconds:"seconds",minutes:"minutes"},iD=["ra_Sunday","ra_Monday","ra_Tuesday","ra_Wednesday","ra_Thursday","ra_Friday","ra_Saturday","ra_Sunday"];function So(t){return t<10?`0${t}`:`${t}`}const rGe={mode:"interval",interval:{period:1,unit:zr.minutes}};function Up(t){if(t==="*")return[0,1,2,3,4,5,6];const e=t.split(","),r=[];return e.forEach(n=>{const o=n.split("-");if(o.length===2){const a=parseInt(o[0],10),i=parseInt(o[1],10);for(let l=a;l<=i;l++)r.includes(l===7?0:l)||r.push(l===7?0:l)}else{n==="7"&&(n="0");const a=parseInt(n,10);r.includes(a)||r.push(a)}}),r.sort(),r}function JN(t,e){t=t.replace(/['"]/g,"").trim();const r=t.split(" ");let n,o=null;return r.length===6?n={seconds:r[0]||"*",minutes:r[1]||"*",hours:r[2]||"*",date:r[3]||"*",months:r[4]||"*",dow:r[5]||"*"}:n={seconds:null,minutes:r[0]||"*",hours:r[1]||"*",date:r[2]||"*",months:r[3]||"*",dow:r[4]||"*"},n.seconds===null&&n.minutes==="*"&&n.hours==="*"&&n.date==="*"&&n.months==="*"&&(n.dow==="*"||e)&&(o={mode:"interval",interval:{period:1,unit:zr.minutes}}),n.seconds==="*"&&n.minutes==="*"&&n.hours==="*"&&n.date==="*"&&n.months==="*"&&(n.dow==="*"||e)?o={mode:"interval",interval:{period:1,unit:zr.seconds}}:n.seconds===null&&n.minutes.includes("/")&&n.hours==="*"&&n.date==="*"&&n.months==="*"&&(n.dow==="*"||e)?o={mode:"interval",interval:{period:parseInt(n.minutes.split("/")[1],10),unit:zr.minutes}}:n.seconds!==null&&n.seconds.includes("/")&&n.minutes==="*"&&n.hours==="*"&&n.date==="*"&&n.months==="*"&&(n.dow==="*"||e)?o={mode:"interval",interval:{period:parseInt(n.seconds.split("/")[1],10),unit:zr.seconds}}:n.seconds!==null&&n.seconds.includes("/")&&n.minutes==="*"&&n.hours.includes("-")&&n.date==="*"&&n.months==="*"&&(n.dow==="*"||e)?o={mode:"intervalBetween",intervalBetween:{period:parseInt(n.seconds.split("/")[1],10),unit:zr.seconds,timeFrom:parseInt(n.hours.split("-")[0],10),timeTo:parseInt(n.hours.split("-")[1],10),weekdays:Up(n.dow)}}:n.seconds===null&&n.minutes.includes("/")&&n.hours.includes("-")&&n.date==="*"&&n.months==="*"&&(n.dow==="*"||e)?o={mode:"intervalBetween",intervalBetween:{period:parseInt(n.minutes.split("/")[1],10),unit:zr.minutes,timeFrom:parseInt(n.hours.split("-")[0],10),timeTo:parseInt(n.hours.split("-")[1],10),weekdays:Up(n.dow)}}:n.seconds===null&&parseInt(n.minutes,10).toString()===n.minutes&&parseInt(n.hours,10).toString()===n.hours&&n.date==="*"&&n.months==="*"&&(n.dow==="*"||e)?o={mode:"specific",specific:{time:`${So(parseInt(n.hours,10))}:${So(parseInt(n.minutes,10))}`,weekdays:Up(n.dow)}}:n.seconds===null&&parseInt(n.minutes,10).toString()===n.minutes&&parseInt(n.hours,10).toString()===n.hours&&parseInt(n.date,10).toString()===n.date&&parseInt(n.months,10).toString()===n.months&&(n.dow==="*"||e)&&(o={mode:"once",once:{time:`${So(parseInt(n.hours,10))}:${So(parseInt(n.minutes,10))}`,date:`${So(parseInt(n.date,10))}.${So(parseInt(n.months,10))}`}}),o}class xu extends y.Component{constructor(e){super(e);let r=typeof e.cronExpression=="string"?e.cronExpression.replace(/^["']/,"").replace(/["']\n?$/,""):"";r[0]==="{"&&(r="");const n=JN(r||"* * * * *",!0)||rGe;this.state={extended:!1,cron:xu.state2cron(n),mode:"interval",once:{time:"00:00",date:""},interval:{period:1,unit:zr.minutes},intervalBetween:{period:1,unit:zr.minutes,timeFrom:0,timeTo:23,weekdays:[0,1,2,3,4,5,6]},specific:{time:"00:00",weekdays:[0,1,2,3,4,5,6]}},Object.assign(this.state,n),this.state.cron!==e.cronExpression&&setTimeout(()=>e.onChange&&e.onChange(this.state.cron),100)}static periodArray2text(e,r=7){if(r=r||7,e.length===r)return"*";const n=[];let o=null,a=null;if(!e.length)return"_";for(let i=0;i60&&(n.period=60),n.period!==void 0&&n.period<1&&(n.period=1),n.minutes!==void 0&&n.minutes!==null&&n.minutes>60&&(n.minutes=60),n.minutes!==void 0&&n.minutes!==null&&n.minutes<1&&(n.minutes=1),n.hours!==void 0&&n.hours!==null&&n.hours>24&&(n.hours=24),n.hours!==void 0&&n.hours!==null&&n.hours<1&&(n.hours=1),e.extended)r=`${n.minutes!==void 0&&n.minutes!==null&&n.minutes>1?`*/${n.minutes}`:"*"} ${n.hours!==void 0&&n.hours!==null&&n.hours>1?`*/${n.hours}`:"*"} * * *`;else switch(n.unit){case zr.seconds:r=`${n.period>1?`*/${n.period}`:"*"} * * * * *`;break;case zr.minutes:r=`${n.period>1?`*/${n.period}`:"*"} * * * *`;break}}else if(e.mode==="intervalBetween"){const n=e.intervalBetween||{period:1,unit:zr.minutes,timeFrom:0,timeTo:24,weekdays:[0,1,2,3,4,5,6]};let o;switch(n.timeFrom=n.timeFrom||0,n.timeTo=n.timeTo===void 0?24:n.timeTo,n.timeFrom!==0&&n.timeTo===24&&(n.timeTo=23),n.timeFrom===0&&n.timeTo===24?o="*":o=n.timeFrom!==n.timeTo?`${n.timeFrom}-${n.timeTo}`:"*",n.period>60&&(n.period=60),n.period<1&&(n.period=1),n.unit=n.unit||zr.minutes,n.unit){case zr.seconds:r=`${n.period>1?`*/${n.period}`:"*"} * ${o} * * ${this.periodArray2text(n.weekdays)}`;break;case zr.minutes:r=`${n.period>1?`*/${n.period}`:"*"} ${o} * * ${this.periodArray2text(n.weekdays)}`;break}}else if(e.mode==="specific"){const n=e.specific||{time:"00:00",weekdays:[0,1,2,3,4,5,6]},o=(n.time||"00:00").split(":");let a=parseInt(o[1],10)||0;a>59&&(a=59),a<0&&(a=0);let i=parseInt(o[0],10)||0;i>23&&(i=59),i<0&&(i=0),r=`${a} ${i} * * ${this.periodArray2text(n.weekdays||[])}`}else if(e.mode==="once"){const n=e.once||{time:"00:00",date:""};n.date||(n.date=`${new Date().getDate()}.${So(new Date().getMonth()+1)}`);const o=(n.time||"00:00").split(":"),a=n.date.split(".");let i=parseInt(o[1],10)||0;i>59&&(i=59),i<0&&(i=0);let l=parseInt(o[0],10)||0;l>23&&(l=59),l<0&&(l=0);let u=parseInt(a[0],10)||1;u>31&&(u=31),u<1&&(l=1);let f=parseInt(a[1],10)||1;f>12&&(f=12),f<1&&(f=1),r=`${i} ${l} ${u} ${f} *`}return r}recalcCron(){this.onChange(xu.state2cron(this.state))}getControlsWeekdaysElements(e){const r=e==="intervalBetween"?this.state.intervalBetween:this.state.specific;return y.createElement("div",{key:"weekdays",style:{paddingLeft:8,width:"calc(100% - 8px)",maxWidth:600}},y.createElement("h5",null,R.t("ra_On weekdays")),[1,2,3,4,5,6,0].map(n=>y.createElement(lt,{key:iD[n],control:y.createElement(wr,{checked:r.weekdays.includes(n),onChange:o=>{const a=JSON.parse(JSON.stringify(this.state[e])),i=a.weekdays.indexOf(n);o.target.checked?i===-1&&a.weekdays.push(n):i!==-1&&a.weekdays.splice(i,1),a.weekdays.sort(),e==="intervalBetween"?this.setState({intervalBetween:a},()=>this.recalcCron()):this.setState({specific:a},()=>this.recalcCron())},value:n.toString()}),label:R.t(iD[n])})))}getControlsPeriodElements(e){const r=e==="interval"?this.state.interval:this.state.intervalBetween;return this.state.extended?y.createElement("div",{key:"period",style:{paddingLeft:8,display:"inline-block"}},y.createElement("h5",{style:{marginBottom:5}},R.t("sc_period")),y.createElement(dr,{variant:"standard",style:{marginTop:0,marginBottom:0,verticalAlign:"bottom"},key:"value",label:R.t("sc_minutes"),value:r.minutes,onChange:n=>{const o=JSON.parse(JSON.stringify(this.state[e]));o.minutes=parseInt(n.target.value,10),o.minutes<1&&(o.minutes=1),e==="interval"?this.setState({interval:o},()=>this.recalcCron()):this.setState({intervalBetween:o},()=>this.recalcCron())},slotProps:{htmlInput:{min:1,max:60},inputLabel:{shrink:!0}},type:"number",margin:"normal"}),y.createElement(dr,{variant:"standard",style:{marginTop:0,marginBottom:0,verticalAlign:"bottom"},key:"value",label:R.t("sc_hours"),value:r.hours,onChange:n=>{const o=JSON.parse(JSON.stringify(this.state[e]));o.hours=parseInt(n.target.value,10),o.hours<1&&(o.hours=1),e==="interval"?this.setState({interval:o},()=>this.recalcCron()):this.setState({intervalBetween:o},()=>this.recalcCron())},slotProps:{htmlInput:{min:1,max:24},inputLabel:{shrink:!0}},type:"number",margin:"normal"})):y.createElement("div",{key:"period",style:{paddingLeft:8,display:"inline-block"}},y.createElement("h5",{style:{marginBottom:5}},R.t("sc_period")),y.createElement(dr,{variant:"standard",style:{marginTop:0,marginBottom:0,verticalAlign:"bottom"},key:"value",label:R.t("sc_every"),value:r.period,onChange:n=>{const o=JSON.parse(JSON.stringify(this.state[e]));o.period=parseInt(n.target.value,10),o.period<1&&(o.period=1),e==="interval"?this.setState({interval:o},()=>this.recalcCron()):this.setState({intervalBetween:o},()=>this.recalcCron())},slotProps:{htmlInput:{min:1,max:60},inputLabel:{shrink:!0}},type:"number",margin:"normal"}),y.createElement(gn,{variant:"standard",style:{verticalAlign:"bottom"},value:r.unit,onChange:n=>{const o=JSON.parse(JSON.stringify(this.state[e]));o.unit=n.target.value,e==="interval"?this.setState({interval:o},()=>this.recalcCron()):this.setState({intervalBetween:o},()=>this.recalcCron())}},y.createElement(Zt,{value:"seconds"},R.t("sc_seconds")),")",y.createElement(Zt,{value:"minutes"},R.t("sc_minutes")),")"))}getControlsTime(e){const r=e==="once"?this.state.once:this.state.specific;return y.createElement(ta,{variant:"standard",sx:{...Ra.formControl,"&.MuiFormControl-root":Ra.formControlMarginRight}},y.createElement(dr,{variant:"standard",key:"at",label:R.t("sc_time"),value:r.time,type:"time",sx:n=>({'& input[type="time"]::-webkit-calendar-picker-indicator':{filter:n.palette.mode==="dark"?"invert(80%)":void 0}}),onChange:n=>{const o=JSON.parse(JSON.stringify(this.state[e]));o.time=n.target.value,e==="once"?this.setState({once:o},()=>this.recalcCron()):this.setState({specific:o},()=>this.recalcCron())},slotProps:{inputLabel:{shrink:!0}},margin:"normal"}))}getControlsDate(){const e=this.state.once;if(!e.date){const r=new Date;e.date=`${r.getDate()}.${So(r.getMonth()+1)}`}return y.createElement(ta,{variant:"standard",style:Ra.formControl},y.createElement(dr,{variant:"standard",key:"date",label:R.t("sc_date"),value:e.date,type:"text",slotProps:{htmlInput:{style:Ra.formControlPaddingTop},inputLabel:{shrink:!0}},onChange:r=>{const n=JSON.parse(JSON.stringify(this.state.once));n.date=r.target.value,this.setState({once:n},()=>this.recalcCron())},margin:"normal"}))}getOnceElements(){return y.createElement("div",{style:{marginLeft:8}},this.getControlsTime("once"),this.getControlsDate())}getIntervalElements(){return this.getControlsPeriodElements("interval")}getIntervalBetweenElements(){const e=this.state.intervalBetween;return[this.getControlsPeriodElements("intervalBetween"),y.createElement("div",{key:"between",style:{paddingLeft:8,display:"inline-block",verticalAlign:"top"}},y.createElement("h5",{style:{marginBottom:5}},R.t("sc_hours")),y.createElement(ta,{variant:"standard",style:Ra.formControl},y.createElement(ru,{shrink:!0,htmlFor:"age-label-placeholder"},R.t("sc_from")),y.createElement(gn,{variant:"standard",style:{width:100},value:e.timeFrom,onChange:r=>{const n=JSON.parse(JSON.stringify(this.state.intervalBetween));n.timeFrom=parseInt(r.target.value,10),n.timeTo===24&&(n.timeTo=23),this.setState({intervalBetween:n},()=>this.recalcCron())}},[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23].map(r=>y.createElement(Zt,{key:`B_${r}`,value:r},`${So(r)}:00`)))),y.createElement(ta,{variant:"standard",style:Ra.formControl},y.createElement(ru,{shrink:!0,htmlFor:"age-label-placeholder"},R.t("sc_to")),y.createElement(gn,{variant:"standard",style:{width:100},value:e.timeTo,onChange:r=>{const n=JSON.parse(JSON.stringify(this.state.intervalBetween));n.timeTo=parseInt(r.target.value,10),this.setState({intervalBetween:n},()=>this.recalcCron())}},[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23].map(r=>y.createElement(Zt,{key:`A_${r}`,value:r},`${So(r)}:00`)),!e.timeFrom&&y.createElement(Zt,{value:24},"00:00")))),this.getControlsWeekdaysElements("intervalBetween")]}getSpecificTimeElements(){return[y.createElement("div",{key:"time",style:{marginLeft:8}},this.getControlsTime("specific")),this.getControlsWeekdaysElements("specific")]}onModeChange(e){e!==this.state.mode&&this.setState({mode:e},()=>this.recalcCron())}onChange(e){e!==this.state.cron&&(this.setState({cron:e}),this.props.onChange&&this.props.onChange(e))}render(){return y.createElement("div",{style:Ra.mainDiv},y.createElement("div",{style:{paddingLeft:8,width:"calc(100% - 8px)"}},y.createElement(dr,{variant:"standard",style:{width:"100%"},value:this.state.cron,disabled:!0,error:this.state.cron.includes("_")})),y.createElement("div",{style:{paddingLeft:8,width:"calc(100% - 8px)",height:60}},this.state.cron.includes("_")?R.t("sc_invalid_cron"):vN(this.state.cron,this.props.language||"en")),y.createElement("div",null,y.createElement(ta,{variant:"standard",style:{...Ra.formControl,marginLeft:8,marginTop:8}},y.createElement(ru,null,R.t("ra_Repeat")),y.createElement(gn,{variant:"standard",value:this.state.mode,onChange:e=>this.onModeChange(e.target.value),inputProps:{name:"mode",id:"mode"}},y.createElement(Zt,{value:"once"},R.t("sc_once")),y.createElement(Zt,{value:"interval"},R.t("sc_interval")),y.createElement(Zt,{value:"intervalBetween"},R.t("sc_intervalBetween")),y.createElement(Zt,{value:"specific"},R.t("sc_specific"))))),this.state.mode===tGe.once&&this.getOnceElements(),this.state.mode==="interval"&&this.getIntervalElements(),this.state.mode==="intervalBetween"&&this.getIntervalBetweenElements(),this.state.mode==="specific"&&this.getSpecificTimeElements())}}const nGe={headerID:{fontWeight:"bold",fontStyle:"italic"},radio:{display:"inline-block"},dialogPaper:{height:"calc(100% - 96px)"}};class Cst extends y.Component{constructor(e){super(e);let r;this.props.cron&&typeof this.props.cron=="string"&&this.props.cron.replace(/^["']/,"")[0]!=="{"?r=this.props.cron.replace(/['"]/g,"").trim():(r=this.props.cron||"{}",typeof r=="string"&&(r=r.replace(/^["']/,"").replace(/["']\n?$/,""))),this.state={showWarning:"",cron:r}}handleCancel(){this.props.onClose()}handleOk(e){if(!e){const r=La.cron2state(this.state.cron);if(r.seconds==="*"||r.seconds==="*/1"){this.setState({showWarning:"everySecond"});return}if(r.minutes==="*"||r.minutes==="*/1"){this.setState({showWarning:"everyMinute"});return}}this.props.onOk(this.state.cron),this.props.onClose()}renderWarningDialog(){return this.state.showWarning?y.createElement(gP,{title:R.t("ra_Please confirm"),text:R.t(this.state.showWarning==="everySecond"?"ra_The schedule will be executed every second. Are you sure?":"ra_The schedule will be executed every minute. Are you sure?"),onClose:e=>this.setState({showWarning:""},()=>{e&&this.handleOk(!0)})}):null}handleClear(){this.props.onOk(!1),this.props.onClose()}render(){return y.createElement(oo,{onClose:()=>{},maxWidth:"md",fullWidth:!0,sx:{"& .MuiDialog-paper":nGe.dialogPaper},open:!0,"aria-labelledby":"cron-dialog-title"},this.renderWarningDialog(),y.createElement(io,{id:"cron-dialog-title"},this.props.title||R.t("ra_Define schedule...")),y.createElement(so,{style:{height:"100%",overflow:"hidden"}},y.createElement(La,{cronExpression:this.state.cron,onChange:e=>this.setState({cron:e}),language:R.getLanguage()})),y.createElement(ao,null,!!this.props.clearButton&&y.createElement(jt,{color:"grey",variant:"contained",onClick:()=>this.handleClear(),startIcon:y.createElement(nu,null)},this.props.clear||R.t("ra_Clear")),y.createElement(jt,{variant:"contained",onClick:()=>this.handleOk(),color:"primary",startIcon:y.createElement(Ys,null)},this.props.ok||R.t("ra_Ok")),y.createElement(jt,{color:"grey",variant:"contained",onClick:()=>this.handleCancel(),startIcon:y.createElement(Gf,null)},this.props.cancel||R.t("ra_Cancel"))))}}const oGe={dialogPaper:{height:"calc(100% - 96px)"}};class Est extends y.Component{constructor(e){super(e);let r;this.props.cron&&typeof this.props.cron=="string"&&this.props.cron.replace(/^["']/,"")[0]!=="{"?r=this.props.cron.replace(/['"]/g,"").trim():(r=this.props.cron||"{}",typeof r=="string"&&(r=r.replace(/^["']/,"").replace(/["']\n?$/,""))),this.state={cron:r,mode:this.props.simple?"simple":this.props.complex?"complex":(typeof r=="object"||r[0]==="{")&&!this.props.noWizard?"wizard":JN(this.props.cron||"* * * * *")?"simple":"complex"}}handleCancel(){this.props.onClose()}handleOk(){this.props.onOk(this.state.cron),this.props.onClose()}setMode(e){this.setState({mode:e})}render(){return y.createElement(oo,{onClose:()=>{},maxWidth:"md",fullWidth:!0,sx:{"& .MuiDialog-paper":oGe.dialogPaper},open:!0,"aria-labelledby":"cron-dialog-title"},y.createElement(io,{id:"cron-dialog-title"},this.props.title||R.t("ra_Define schedule...")),y.createElement(so,{style:{height:"100%",overflow:"hidden"}},this.props.simple&&this.props.complex||!this.props.simple&&!this.props.complex?y.createElement("div",null,!this.props.simple&&!this.props.complex&&!this.props.noWizard&&y.createElement(y.Fragment,null,y.createElement(Lt,{key:"wizard",checked:this.state.mode==="wizard",onChange:()=>this.setMode("wizard")}),y.createElement("label",{onClick:()=>this.setMode("wizard"),style:this.state.mode!=="wizard"?{color:"lightgrey"}:{}},R.t("sc_wizard"))),(!this.props.simple&&!this.props.complex||this.props.simple)&&y.createElement(y.Fragment,null,y.createElement(Lt,{key:"simple",checked:this.state.mode==="simple",onChange:()=>this.setMode("simple")}),y.createElement("label",{onClick:()=>this.setMode("simple"),style:this.state.mode!=="simple"?{color:"lightgrey"}:{}},R.t("sc_simple"))),(!this.props.simple&&!this.props.complex||this.props.complex)&&y.createElement(y.Fragment,null,y.createElement(Lt,{key:"complex",checked:this.state.mode==="complex",onChange:()=>this.setMode("complex")}),y.createElement("label",{onClick:()=>this.setMode("complex"),style:this.state.mode!=="complex"?{color:"lightgrey"}:{}},R.t("sc_cron")))):null,this.state.mode==="simple"&&y.createElement(xu,{cronExpression:this.state.cron,onChange:e=>this.setState({cron:e}),language:R.getLanguage()}),this.state.mode==="wizard"&&y.createElement(Cr,{theme:this.props.theme,schedule:this.state.cron,onChange:e=>this.setState({cron:e})}),this.state.mode==="complex"&&y.createElement(La,{cronExpression:this.state.cron,onChange:e=>this.setState({cron:e}),language:R.getLanguage()})),y.createElement(ao,null,y.createElement(jt,{variant:"contained",onClick:()=>this.handleOk(),color:"primary",startIcon:y.createElement(Ys,null)},this.props.ok||R.t("ra_Ok")),y.createElement(jt,{variant:"contained",onClick:()=>this.handleCancel(),color:"grey",startIcon:y.createElement(Gf,null)},this.props.cancel||R.t("ra_Cancel"))))}}const bs={headerID:{fontWeight:"bold",fontStyle:"italic"},dialog:{height:"95%"},dialogMobile:{padding:"4px",width:"100%",maxWidth:"100%",maxHeight:"calc(100% - 16px)",height:"100%"},content:{height:"100%",overflow:"hidden"},contentMobile:{padding:"8px 4px"},titleRoot:{whiteSpace:"nowrap",width:"calc(100% - 72px)",overflow:"hidden",display:"inline-block",textOverflow:"ellipsis"}};class Tst extends y.Component{constructor(r){super(r);ue(this,"dialogName");ue(this,"filters");this.dialogName=this.props.dialogName||"default",this.dialogName=`SelectFile.${this.dialogName}`;const n=(window._localStorage||window.localStorage).getItem(this.dialogName)||"{}";try{this.filters=JSON.parse(n)}catch{this.filters={}}r.filters&&(this.filters={...this.filters,...r.filters});let o=this.props.selected||[];typeof o!="object"?o=[o]:o=[...o],o=o.filter(a=>a),this.state={selected:o}}handleCancel(){this.props.onClose()}handleOk(){this.props.onOk(this.props.multiSelect||!Array.isArray(this.state.selected)?this.state.selected:this.state.selected[0]||""),this.props.onClose()}render(){let r;return this.state.selected.length?!Array.isArray(this.state.selected)||this.state.selected.length===1?r=[y.createElement("span",{key:"selected"},R.t("ra_Selected")," "),y.createElement("span",{key:"id",style:bs.headerID},this.state.selected)]:r=[y.createElement("span",{key:"selected"},R.t("ra_Selected")," "),y.createElement("span",{key:"id",style:bs.headerID},R.t("%s items",this.state.selected.length))]:r=this.props.title||R.t("ra_Please select file..."),y.createElement(oo,{onClose:()=>{},maxWidth:!1,sx:{"& .MuiDialog-paper":{...bs.dialog,...bs.dialogMobile}},fullWidth:!0,open:!0,"aria-labelledby":"ar_dialog_selectfile_title"},y.createElement(io,{id:"ar_dialog_selectfile_title",sx:{"&.MuiDialogTitle-root":bs.titleRoot}},r),y.createElement(so,{style:{...bs.content,...bs.contentMobile}},y.createElement(rVe,{ready:!0,imagePrefix:this.props.imagePrefix||this.props.prefix||"../",allowUpload:!!this.props.allowUpload,allowDownload:this.props.allowDownload!==!1,allowCreateFolder:!!this.props.allowCreateFolder,allowDelete:!!this.props.allowDelete,allowView:this.props.allowView!==!1,showViewTypeButton:this.props.showViewTypeButton!==!1,showToolbar:this.props.showToolbar!==!1,limitPath:this.props.limitPath,filterFiles:this.props.filterFiles,filterByType:this.props.filterByType,selected:this.props.selected,restrictToFolder:this.props.restrictToFolder,allowNonRestricted:this.props.allowNonRestricted,onSelect:(n,o,a)=>{this.setState({selected:Array.isArray(n)?n:[n]},()=>o&&(!this.props.selectOnlyFolders||a)&&this.handleOk())},t:this.props.t||R.t,lang:this.props.lang||R.getLanguage(),socket:this.props.socket,themeType:this.props.themeType,themeName:this.props.themeName,theme:this.props.theme,showExpertButton:this.props.showExpertButton,expertMode:this.props.expertMode,showTypeSelector:this.props.showTypeSelector})),y.createElement(ao,null,y.createElement(jt,{variant:"contained",onClick:()=>this.handleOk(),startIcon:y.createElement(Ys,null),disabled:!this.state.selected.length,color:"primary"},this.props.ok||R.t("ra_Ok")),y.createElement(jt,{color:"grey",variant:"contained",onClick:()=>this.handleCancel(),startIcon:y.createElement(Gf,null)},this.props.cancel||R.t("ra_Cancel"))))}}const aGe={dialogPaper:{height:"calc(100% - 96px)"}};class Ost extends y.Component{constructor(e){super(e);let r;this.props.cron&&typeof this.props.cron=="string"&&this.props.cron.replace(/^["']/,"")[0]!=="{"?r=this.props.cron.replace(/['"]/g,"").trim():(r=this.props.cron||"{}",typeof r=="string"&&(r=r.replace(/^["']/,"").replace(/["']\n?$/,""))),this.state={cron:r}}handleCancel(){this.props.onClose()}handleOk(){this.props.onOk(this.state.cron),this.props.onClose()}render(){return y.createElement(oo,{onClose:()=>{},maxWidth:"md",fullWidth:!0,sx:{"& .MuiDialog-paper":aGe.dialogPaper},open:!0,"aria-labelledby":"cron-dialog-title"},y.createElement(io,{id:"cron-dialog-title"},this.props.title||R.t("ra_Define CRON...")),y.createElement(so,{style:{height:"100%",overflow:"hidden"}},y.createElement(xu,{cronExpression:this.state.cron,onChange:e=>this.setState({cron:e}),language:R.getLanguage()})),y.createElement(ao,null,y.createElement(jt,{variant:"contained",disabled:!this.state.cron||this.state.cron.includes("_"),onClick:()=>this.handleOk(),color:"primary",startIcon:y.createElement(Ys,null)},this.props.ok||R.t("ra_Ok")),y.createElement(jt,{variant:"contained",onClick:()=>this.handleCancel(),color:"grey",startIcon:y.createElement(Gf,null)},this.props.cancel||R.t("ra_Cancel"))))}}var YN={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},cD=y.createContext&&y.createContext(YN),sGe=["attr","size","title"];function iGe(t,e){if(t==null)return{};var r=cGe(t,e),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function cGe(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function yf(){return yf=Object.assign?Object.assign.bind():function(t){for(var e=1;ey.createElement(e.tag,vf({key:r},e.attr),KN(e.child)))}function pGe(t){return e=>y.createElement(fGe,yf({attr:vf({},t.attr)},e),KN(t.child))}function fGe(t){var e=r=>{var{attr:n,size:o,title:a}=t,i=iGe(t,sGe),l=o||r.size||"1em",u;return r.className&&(u=r.className),t.className&&(u=(u?u+" ":"")+t.className),y.createElement("svg",yf({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,i,{className:u,style:vf(vf({color:t.color||r.color},r.style),t.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),a&&y.createElement("title",null,a),t.children)};return cD!==void 0?y.createElement(cD.Consumer,null,r=>e(r)):e(YN)}function hGe(t){return pGe({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"},child:[]}]})(t)}const ai=({message:t,onClose:e})=>t?$.jsx(bb,{anchorOrigin:{vertical:"bottom",horizontal:"center"},open:!0,autoHideDuration:6e3,onClose:e,ContentProps:{"aria-describedby":"message-id"},message:$.jsx("span",{id:"message-id",children:R.t(t)}),action:[$.jsx(lr,{"aria-label":"Close",color:"inherit",onClick:e,children:$.jsx(hGe,{})},"close")]}):null;ai.defaultProps={message:"",onClose:()=>{}};ai.propTypes={onClose:V.func,message:V.string};const ox=({open:t,close:e,children:r,titleButton:n,titleButton2:o,buttonClick:a})=>$.jsxs(oo,{open:t,maxWidth:"md",onClose:e,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[$.jsx(io,{id:"alert-dialog-title",children:R.t("Warning")}),$.jsx(so,{children:r}),$.jsxs(ao,{children:[n&&$.jsx(jt,{color:"grey",variant:"contained",onClick:a,children:n}),o&&$.jsx(jt,{variant:"contained",onClick:e,color:"primary",autoFocus:!0,children:o})]})]});ox.defaultProps={open:!1,buttonClick:()=>{},close:()=>{}};ox.propTypes={open:V.bool,close:V.func,children:V.any,titleButton:V.string,titleButton2:V.string,buttonClick:V.func};const Hv={input:{minWidth:300},inputNumber:{minWidth:150},icon:{width:24,height:24,marginRight:8}},ea=({table:t,value:e,title:r,attr:n,options:o,style:a,native:i,onChange:l,noTranslate:u,themeType:f,sx:h})=>$.jsxs(ta,{style:{...Hv.input,paddingTop:5,...a},sx:h,children:[$.jsx(gn,{variant:"standard",value:t?e:i[n]||"_",onChange:d=>{t?l(d.target.value):l(n,d.target.value==="_"?"":d.target.value)},renderValue:d=>{const m=o.find(g=>g.value===d);return m?$.jsxs($.Fragment,{children:[$.jsx(Dc,{src:m.icon||"",style:Hv.icon}),u?m.title:R.t(m.title)]}):d},input:$.jsx(Zn,{name:n,id:`${n}-helper`}),children:o.map(d=>$.jsxs(Zt,{value:d.value||"_",style:d.color?{color:d.color,backgroundColor:tt.getInvertedColor(d.color,f)}:{},children:[$.jsx(Dc,{src:d.icon||"",style:Hv.icon}),u?d.title:R.t(d.title)]},`key-${d.value}`))}),$.jsx(Au,{children:r?R.t(r):""})]});ea.defaultProps={value:"",table:!1};ea.propTypes={title:V.string,attr:V.string,options:V.array.isRequired,style:V.object,sx:V.object,value:V.any,table:V.bool,native:V.object.isRequired,onChange:V.func,noTranslate:V.bool,themeType:V.string};const qv={input:{minWidth:300},inputNumber:{minWidth:150},heightInput:{height:30}},Us=({styleComponentBlock:t,component:e,size:r,variant:n,table:o,value:a,title:i,attr:l,type:u,style:f,native:h,onChange:d})=>$.jsxs(ta,{style:{...u==="number"?qv.inputNumber:qv.input,paddingTop:5,...f},children:[$.jsx(dr,{error:!1,variant:n||"standard",value:o?a:h[l],type:u,helperText:"",style:{...qv.heightInput,...f},onChange:m=>{o?d(m.target.value):d(l,m.target.value)},margin:"normal",size:r}),$.jsxs("div",{style:t,children:[$.jsx(Au,{style:{marginTop:-3},children:i?R.t(i):""}),e]})]});Us.defaultProps={value:"",type:"text",table:!1,native:{},variant:"standard",size:"medium",component:null,styleComponentBlock:null};Us.propTypes={title:V.string,attr:V.string,type:V.string,table:V.bool,value:V.string,variant:V.string,size:V.string,style:V.object,native:V.object,onChange:V.func,component:V.object,styleComponentBlock:V.object};const gr=({title:t,attr:e,style:r,native:n,sx:o,onChange:a,table:i,checked:l,disabled:u,help:f})=>{let h=i?l:n[e];return e==="whiteListEnabled"&&n.socketio&&(h=!1),$.jsxs(Lp,{children:[$.jsx(lt,{style:{paddingTop:5,...r},sx:o,control:$.jsx(wr,{disabled:!!u,checked:!!h,onChange:d=>{i?a(d.target.checked):a(e,!n[e])},color:"primary"}),label:t?R.t(t):""},e),f?$.jsx(Au,{children:f}):null]})};gr.defaultProps={table:!1};gr.propTypes={title:V.string,attr:V.string.isRequired,style:V.object,native:V.object.isRequired,onChange:V.func,table:V.bool,help:V.string};const Jo={blockWrapper:{display:"flex",flexDirection:"column",mr:"20px","@media screen and (max-width: 360px)":{mr:0}},displayNone:{display:"none !important"},tab:{width:"100%",minHeight:"100%"},column:{display:"inline-block",verticalAlign:"top",marginRight:20},columnSettings:{width:"calc(100% - 10px)"},blockWrapperCheckbox:{display:"flex",flexFlow:"wrap"},ipInputStyle:{mt:"10px",width:600,mr:"20px","@media screen and (max-width: 940px)":{width:"100%"}},blockWarning:{background:"#2196f3",color:"#fff",margin:"20px 2px",padding:8,fontSize:20},blockWarningContent:{flexFlow:"wrap",display:"flex",alignItems:"flex-end"}};class ZN extends C.Component{constructor(e){super(e),this.state={toast:"",ipAddressOptions:[],certificatesOptions:[],usersOptions:[],socketioOptions:[{title:R.t("nothing"),value:"none"},{title:R.t("built_in"),value:"_"}],openModal:!1,ready:!1,confirmSocketIO:!1}}componentDidMount(){const{socket:e,common:{host:r}}=this.props,{socketioOptions:n}=this.state;e.getAdapterInstances("socketio").then(async o=>{const a=await e.getAdapterInstances("ws");a&&(o=o.concat(a));const i={ready:!0,socketioOptions:[...n,...o.map(({_id:u,common:{name:f}})=>({title:`${f} [${f}.${u.split(".").pop()}]`,value:u}))]},l=await e.getHostByIp(r);l.forEach(u=>{u.title=u.name,u.title.includes("Listen on all IPs")&&(u.title=u.title.replace("Listen on all IPs",R.t("open_ip"))),u.value=u.address}),i.ipAddressOptions=l,i.certificatesOptions=await e.getCertificates(),i.usersOptions=await e.getUsers(),this.setState(i)})}componentDidUpdate(e){const{native:{auth:r,secure:n}}=e,{native:{defaultUser:o,whiteListSettings:a},onChange:i}=this.props;!this.props.native.auth&&r!==this.props.native.auth?i("whiteListSettings.default.user",o):a&&a.default.user!=="auth"&&r!==this.props.native.auth&&i("whiteListSettings.default.user","auth"),o!==e.native.defaultUser&&i("whiteListSettings.default.user",o),!this.props.native.secure&&this.props.native.auth&&!this.state.openModal&&(r!==this.props.native.auth||n!==this.props.native.secure)&&this.setState({openModal:!0})}renderConfirmDialog(){return $.jsxs(oo,{open:this.state.confirmSocketIO,maxWidth:"md",onClose:()=>this.setState({confirmSocketIO:!1}),"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[$.jsx(io,{id:"alert-dialog-title",children:R.t("Warning")}),$.jsxs(so,{children:[R.t("whitelist_only_with_integrated_socket"),$.jsx("br",{}),R.t("White list will be disabled. Please confirm.")]}),$.jsxs(ao,{children:[$.jsx(jt,{variant:"contained",color:"primary",autoFocus:!0,onClick:()=>{this.props.onChange("whiteListEnabled",!1,()=>this.props.onChange("socketio",this.state.confirmValue,()=>this.setState({confirmSocketIO:!1})))},children:R.t("Ok")}),$.jsx(jt,{color:"grey",variant:"contained",onClick:()=>this.setState({confirmSocketIO:!1}),children:R.t("Cancel")})]})]})}render(){var v;const{instance:e,common:r,native:n,onLoad:o,onChange:a}=this.props,{certificatesOptions:i,ipAddressOptions:l,usersOptions:u,openModal:f,toast:h,socketioOptions:d,ready:m}=this.state;if(!m)return $.jsx($M,{});const g=JSON.parse(JSON.stringify(r));return g.icon=g.extIcon,$.jsxs("form",{style:Jo.tab,children:[$.jsx(ai,{message:h,onClose:()=>this.setState({toast:""})}),this.renderConfirmDialog(),$.jsx(ox,{open:f,buttonClick:()=>{a("auth",!1),this.setState({openModal:!f,toast:"Authentication_deactivated"})},close:()=>this.setState({openModal:!f}),titleButton:R.t("button_title"),titleButton2:R.t("button_title2"),children:$.jsxs("div",{style:Jo.blockWarningContent,children:[$.jsx(xH,{style:{width:32,height:32}}),R.t("modal_title")]})}),$.jsx(Zw,{instance:e,common:g,native:n,onError:w=>console.error(w),onLoad:o}),$.jsxs("div",{style:{...Jo.column,...Jo.columnSettings},children:[$.jsxs("div",{children:[$.jsx(ea,{title:"IP address",attr:"bind",noTranslate:!0,sx:Jo.ipInputStyle,options:l,native:n,onChange:a}),$.jsx(Us,{title:"port",attr:"port",type:"number",style:{marginTop:5},native:n,onChange:a})]}),$.jsxs("div",{style:Jo.blockWrapperCheckbox,children:[$.jsxs(pt,{component:"div",sx:Jo.blockWrapper,children:[$.jsx(gr,{title:"encryption",attr:"secure",style:{marginTop:10},native:n,onChange:a}),$.jsx(gr,{title:"authentication",attr:"auth",style:{marginTop:10},native:n,onChange:a}),n.auth?$.jsx(gr,{title:"basic_authentication",attr:"basicAuth",style:{marginTop:10},native:n,onChange:a}):null,$.jsx(gr,{title:"cache",attr:"cache",style:{marginTop:10},native:n,onChange:a}),$.jsx(ea,{title:"socket",attr:"socketio",noTranslate:!0,options:d,style:{marginTop:10},native:n,onChange:(w,S,k)=>{S&&n.whiteListEnabled?this.setState({confirmSocketIO:!0,confirmValue:S}):a(w,S,k)}}),n.socketio?null:$.jsx(gr,{title:"usePureWebSockets",attr:"usePureWebSockets",style:{marginTop:10},native:n,onChange:a}),(!n.socketio||n.socketio.startsWith("system.adapter.socket"))&&!n.usePureWebSockets?$.jsx(gr,{title:"web_sockets",help:(v=n.socketio)!=null&&v.startsWith("system.adapter.socket")?R.t("Same settings must be set in socketio instance"):"",attr:"forceWebSockets",style:{marginTop:10},native:n,onChange:a}):null]}),$.jsxs(pt,{component:"div",sx:Jo.blockWrapper,children:[n.secure?$.jsxs("div",{style:Jo.blockWrapperCheckbox,children:[$.jsx(ea,{title:"public_certificate",attr:"certPublic",noTranslate:!0,options:[{title:R.t("nothing"),value:""},...i.filter(({type:w})=>!w||w==="public").map(({name:w})=>({title:w,value:w}))],style:{marginTop:10,marginRight:20},native:n,onChange:a}),$.jsx(ea,{title:"private_certificate",attr:"certPrivate",noTranslate:!0,options:[{title:R.t("nothing"),value:""},...i.filter(({type:w})=>!w||w==="private").map(({name:w})=>({title:w,value:w}))],style:{marginTop:10,marginRight:20},native:n,onChange:a}),$.jsx(ea,{title:"chained_certificate",attr:"certChained",noTranslate:!0,options:[{title:R.t("nothing"),value:""},...i.filter(({type:w})=>!w||w==="chained").map(({name:w})=>({title:w,value:w}))],style:{marginTop:10},native:n,onChange:a})]}):null,n.auth?null:$.jsx(ea,{title:"users",attr:"defaultUser",themeType:this.props.themeType,noTranslate:!0,options:u.map(({_id:w,common:{name:S,color:k,icon:T}})=>({title:typeof S=="object"?S[this.props.lang]||S.end||w.replace(/^system\.user\./,""):S,value:w.replace(/^system\.user\./,""),color:k,icon:T})),style:{marginTop:10,width:300},native:n,onChange:a}),n.auth?$.jsx(Us,{title:"time_out",attr:"ttl",type:"number",style:{marginTop:-1,width:300},native:n,onChange:a}):null,$.jsx(gr,{title:"simple_api",attr:"simpleapi",style:{marginTop:10},native:n,onChange:a}),$.jsx(gr,{title:"Do not check if this instance is available from internet",attr:"doNotCheckPublicIP",style:{marginTop:10},native:n,onChange:a})]})]})]})]})}}ZN.propTypes={common:V.object.isRequired,native:V.object.isRequired,instance:V.number.isRequired,onLoad:V.func,onChange:V.func,socket:V.object.isRequired,themeType:V.string};class mGe extends C.Component{render(){return $.jsx("div",{style:{fontSize:20},children:R.t("Use %s adapter to get letsencrypt certificates.","iobroker.acme")})}}const _r={backgroundTheme:t=>({background:t.palette.mode==="dark"?"#3e3838":"#dcdcdc"}),tab:{width:"100%",minHeight:"100%"},button:{marginRight:20,marginBottom:40},column:{display:"inline-block",verticalAlign:"top"},columnSettings:{width:"100%"},table:{minWidth:700,"& td":{p:"2px"},"@media screen and (max-width: 1700px)":{"& th":{p:"2px"}},"@media screen and (max-width: 1280px)":{minWidth:300}},displayNone:{display:"none"},checkBoxStyle:{marginLeft:0,marginRight:0},miniTable:{display:"none","@media screen and (max-width: 1280px)":{display:"block"}},card:{padding:1,margin:"20px 0",border:"1px solid",borderRadius:10,display:"flex",flexDirection:"column",alignItems:"center"},maxTable:{"@media screen and (max-width: 1280px)":{display:"none"}},miniTableSelect:{"@media screen and (max-width: 1280px)":{minWidth:185}},warning:{color:"#FF4040",fontSize:18,display:"inline-block"}},_Ge={user:"admin",object:{read:!0,list:!0,write:!0,delete:!0},state:{read:!0,list:!0,write:!0,create:!0,delete:!0},file:{read:!0,list:!0,write:!0,create:!0,delete:!0}};class Su extends C.Component{constructor(e){if(super(e),this.state={toast:"",usersOptions:[]},e.native.bind&&e.native.bind!=="localhost"&&e.native.bind!=="0.0.0.0"){const r=e.native.bind.split(".");r.pop(),this.ipPrefix=r.join(".")}}componentDidMount(){this.props.socket.getUsers().then(e=>{this.ipPrefix||this.props.socket.getObject(`system.adapter.${this.props.adapterName}.${this.props.instance}`).then(r=>{this.props.socket.getIpAddresses(r.common.host).then(n=>{if(n=n.filter(o=>o.includes(".")),n.length){const o=n[0].split(".");o.pop(),this.ipPrefix=o.join(".")}else this.ipPrefix="192.168.0"})}),this.setState({usersOptions:e})})}static getText(e){return typeof e=="string"?e:e[R.getLanguage()]||e.en}userSelect(e,r){const{native:n,onChange:o}=this.props,{usersOptions:a}=this.state,{whiteListSettings:i}=n;if(e==="default")return i[e].user;const l=i.default.user==="auth"?[{title:"auth",value:"auth"}]:[];return $.jsx(ea,{table:!0,value:i[e].user,options:[...l,...a.map(({_id:u,common:{name:f}})=>({title:Su.getText(f),value:u.replace("system.user.","")}))],native:n,sx:{..._r.miniTableSelect,...r},noTranslate:!0,onChange:u=>{const f=JSON.parse(JSON.stringify(i));f[e].user=u,o("whiteListSettings",f)}})}tableInput(e,r){const{native:n,onChange:o}=this.props,{whiteListSettings:a}=n;return e==="default"?$.jsx("div",{style:{padding:"10px 0"},children:e}):$.jsx(Us,{table:!0,value:e,style:r,onChange:i=>{const l=JSON.parse(JSON.stringify(a)),u={};Object.keys(l).forEach(f=>{f===e?u[i]=l[f]:u[f]=l[f]}),Su.validateIp(i)?o("whiteListSettings",u):this.setState({toast:"incorrect_ip"})}})}buttonAdd(){const{native:e,onChange:r}=this.props,{whiteListSettings:n}=e;return $.jsx(lr,{color:"primary",onClick:()=>{let o=JSON.parse(JSON.stringify(n)),a=1,i=`${this.ipPrefix}.1`;const l=()=>{Object.keys(o).find(u=>u===i)&&(i=`${this.ipPrefix}.${a}`,a+=1,l())};l(),o={[i]:_Ge,...o},r("whiteListSettings",o)},children:$.jsx(eH,{})})}buttonRemove(e){const{native:r,onChange:n}=this.props,{whiteListSettings:o}=r;return $.jsx(lr,{color:"primary",onClick:()=>{const a=JSON.parse(JSON.stringify(o));delete a[e],n("whiteListSettings",a)},style:e==="default"?{display:"none"}:null,"aria-label":"delete",children:$.jsx(nu,{})})}static validateIp(e){return e.indexOf("*")!==-1&&e.lastIndexOf(".")>e.indexOf("*")?!1:/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9-]*[A-Za-z0-9])$|^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/.test(e.replace("*","111"))}render(){const{native:e,onChange:r}=this.props,{whiteListSettings:n}=e,{toast:o}=this.state,a=["to_read","list","write","delete","to_read","list","write","to_create","delete","to_read","list","write","to_create","delete"];return $.jsxs("form",{style:_r.tab,children:[$.jsx(ai,{message:o,onClose:()=>this.setState({toast:""})}),$.jsxs("div",{style:{..._r.column,..._r.columnSettings,position:"relative"},children:[$.jsx(gr,{title:"included",attr:"whiteListEnabled",disabled:this.props.native.socketio,native:e,onChange:(i,l)=>r(i,l,()=>{l&&!e.whiteListSettings&&r("whiteListSettings",{default:{user:"auth"}})})}),this.props.native.socketio?$.jsx("span",{style:_r.warning,children:R.t("whitelist_only_with_integrated_socket")}):null,!this.props.native.socketio&&n?$.jsx("div",{style:e.whiteListEnabled?null:_r.displayNone,children:$.jsxs(t9,{style:{overflowX:"visible"},component:Ha,children:[$.jsxs(g$,{sx:{..._r.table,..._r.maxTable},"aria-label":"spanning table",children:[$.jsxs(w$,{children:[$.jsxs(Ai,{children:[$.jsx(Qr,{align:"center",rowSpan:2,children:this.buttonAdd()}),$.jsx(Qr,{align:"center",rowSpan:2,style:{fontWeight:"bold"},children:"IP"}),$.jsx(Qr,{align:"center",rowSpan:2,style:{fontWeight:"bold"},children:R.t("user")}),$.jsx(Qr,{align:"center",colSpan:4,style:{fontWeight:"bold"},children:R.t("object")}),$.jsx(Qr,{align:"center",colSpan:5,style:{fontWeight:"bold"},children:R.t("status")}),$.jsx(Qr,{align:"center",colSpan:5,style:{fontWeight:"bold"},children:R.t("file")})]}),$.jsx(Ai,{children:a.map((i,l)=>$.jsx(Qr,{align:"center",children:R.t(i)},`${i}_${l}_max`))})]}),$.jsx(v$,{children:Object.keys(n).map((i,l)=>$.jsxs(Ai,{children:[$.jsx(Qr,{sx:_r.backgroundTheme,style:{borderBottom:"1px solid #afafaf"},children:this.buttonRemove(i)}),$.jsx(Qr,{sx:_r.backgroundTheme,style:{borderBottom:"1px solid #afafaf",color:i==="default"?"#006ccd":void 0},title:i==="default"?R.t("If no IP address matches, show authentication dialog"):"",children:this.tableInput(i,{marginTop:0,minWidth:150,paddingTop:0})}),$.jsx(Qr,{sx:_r.backgroundTheme,style:{borderBottom:"1px solid #afafaf"},children:this.userSelect(i,{marginTop:-1})}),["object","state","file"].map((u,f)=>Object.keys(n[i][u]||{}).map(h=>$.jsx(Qr,{sx:f%2?_r.backgroundTheme:void 0,style:{borderBottom:f%2?"1px solid #afafaf":null},align:"center",children:$.jsx(gr,{table:!0,checked:n[i][u][h],attr:h,native:e,style:_r.checkBoxStyle,onChange:d=>{const m=JSON.parse(JSON.stringify(n));m[i][u][h]=d,r("whiteListSettings",m)}})},`${u}_${h}_max`)))]},`${l}_max`))})]}),$.jsxs(pt,{component:"div",sx:_r.miniTable,children:[$.jsx(pt,{component:"div",sx:_r.backgroundTheme,style:{position:"sticky",top:-10,left:12,zIndex:22,borderBottom:"1px solid"},children:this.buttonAdd()}),$.jsx("div",{children:Object.keys(n).map((i,l)=>$.jsxs(pt,{component:"div",sx:tt.getStyle(this.props.theme,_r.card,l%2?_r.backgroundTheme:null),children:[$.jsxs("div",{style:{width:"100%",lineHeight:"30px",textAlign:"center"},children:[$.jsx("span",{children:this.buttonRemove(i)}),$.jsxs("span",{style:{marginLeft:10},children:["IP:",this.tableInput(i,{marginTop:-5,minWidth:150,marginLeft:5,verticalAlign:"middle"})]}),$.jsxs("span",{style:{marginLeft:20},children:[R.t("user"),":"," ",this.userSelect(i,{marginTop:-10,marginLeft:5,verticalAlign:"middle"})]})]}),["object","state","file"].map((u,f)=>{const h=[...a].splice(f===0?0:4,f===0?4:5);return $.jsxs(g$,{sx:_r.table,style:{width:"inherit"},"aria-label":"spanning table",children:[$.jsxs(w$,{children:[$.jsx(Ai,{children:$.jsx(Qr,{style:{background:"#bbbbbb"},align:"center",colSpan:Object.keys(n[i][u]||{}).length,children:R.t(["object","status","file"][f])})}),$.jsx(Ai,{children:h.map((d,m)=>$.jsx(Qr,{align:"center",children:R.t(d)},`${d}_${m}_mini`))})]}),$.jsx(v$,{children:$.jsx(Ai,{children:Object.keys(n[i][u]||{}).map(d=>$.jsx(Qr,{align:"center",children:$.jsx(gr,{table:!0,checked:n[i][u][d],attr:d,native:e,style:_r.checkBoxStyle,onChange:m=>{const g=JSON.parse(JSON.stringify(n));g[i][u][d]=m,r("whiteListSettings",g)}})},`${u}_${d}_mini_check`))})})]},`${f}_mini`)})]},`${l}_wrapper`))})]})]})}):null]})]})}}Su.propTypes={native:V.object.isRequired,instance:V.number.isRequired,adapterName:V.string.isRequired,onChange:V.func,theme:V.object,socket:V.object.isRequired};const uD={root:{"& > *":{m:"8px"}},input:{display:"none"}},gGe=({title:t,onChange:e})=>{const[r,n]=C.useState("");return $.jsxs(pt,{component:"div",sx:uD.root,children:[$.jsx("input",{accept:"image/*",style:uD.input,id:"contained-button-file",multiple:!0,type:"file",onChange:o=>e(o.target.files[0]||o.dataTransfer.files[0],a=>n(a))}),$.jsxs("label",{htmlFor:"contained-button-file",children:[$.jsx(jt,{variant:"contained",color:"primary",component:"span",children:R.t(t)}),$.jsx(dr,{variant:"standard",style:{marginLeft:20},value:r})]})]})},Hi={tab:{width:"100%",minHeight:"100%"},column:{display:"inline-block",verticalAlign:"top",marginRight:20},columnSettings:{width:"calc(100% - 10px)"},dropZone:{mt:"30px",width:600,border:"2px dashed #bbb",borderRadius:"5px",p:"25px",textAlign:"center",fontSize:"20pt",fontWeight:"bold",fontFamily:"Arial",color:"#bbb",minWidth:320,minHeight:200,transition:"background 1s","&:focus":{outline:"inherit"},"@media screen and (max-width: 680px)":{width:"calc(100% - 45px)",minWidth:200,"& img":{width:"100%"}}},dropZoneActive:{background:"#d6d6d69c"},imgStyle:{maxWidth:500,maxHeight:500}};class QN extends C.Component{constructor(e){super(e),this.state={imgSRC:"",toast:""}}componentDidMount(){this.readFile()}readFile(){const{socket:e,instance:r}=this.props;e.getRawSocket().emit("readFile",`web.${r}`,"login-bg.png",(n,o)=>{if(!n&&o){const a=new Uint8Array(o);if(!a.length)this.setState({imgSRC:`../../files/web.${r}/login-bg.png?ts=${Date.now()}`});else{const i=new Blob([a],{type:"image/png"}),u=(window.URL||window.webkitURL).createObjectURL(i);this.setState({imgSRC:u})}}else this.setState({imgSRC:""})})}uploadFile(e,r){const{socket:n,instance:o}=this.props;if(!e)return;if(e.size>5*1024*1024){this.setState({toast:`File ${e.name} is too big. Maximum 5MB`}),this.setState({imgSRC:""}),r&&r("");return}const a=new FileReader;a.onload=({target:{result:i}})=>{n.getRawSocket().emit("writeFile",`web.${o}`,"login-bg.png",i,()=>this.readFile())},r&&r(e.name),a.readAsArrayBuffer(e)}render(){const{native:e,onChange:r}=this.props,{imgSRC:n,toast:o}=this.state;return $.jsxs("form",{style:Hi.tab,children:[$.jsx(ai,{message:o,onClose:()=>this.setState({toast:""})}),$.jsxs("div",{style:{...Hi.column,...Hi.columnSettings},children:[$.jsx("div",{children:$.jsx(Us,{styleComponentBlock:{height:20,display:"flex",justifyContent:"center",alignItems:"center"},component:$.jsx(Us,{attr:"loginBackgroundColorHelper",type:"color",style:{marginTop:-1,marginLeft:10,minWidth:60},native:e,onChange:async(a,i)=>{await r("loginBackgroundColorHelper",i),await r("loginBackgroundColor",i)},variant:"outlined",size:"small"}),title:"color",attr:"loginBackgroundColor",style:{marginTop:-1,marginBottom:20},native:e,onChange:async(a,i)=>{await r("loginBackgroundColorHelper",i),await r("loginBackgroundColor",i)}})}),$.jsx("div",{children:$.jsx(gr,{title:"background_image",attr:"loginBackgroundImage",native:e,onChange:r})}),$.jsxs("div",{style:e.loginBackgroundImage?{display:"block"}:{display:"none"},children:[$.jsx("div",{children:$.jsx(gGe,{title:"upload_image",attr:"files",native:e,onChange:(a,i)=>this.uploadFile(a,i)})}),$.jsx(Uu,{accept:"image/*",onDrop:a=>this.uploadFile(a[0]),children:({getRootProps:a,getInputProps:i,isDragActive:l})=>$.jsx("section",{children:$.jsxs(pt,{component:"div",sx:{...Hi.dropZone,...l?Hi.dropZoneActive:void 0},...a(),children:[$.jsx("input",{...i()}),$.jsx("p",{children:R.t("place_the_files_here")}),n?$.jsx("img",{style:Hi.imgStyle,src:n,alt:"img"}):null]})})})]})]})]})}}QN.propTypes={common:V.object.isRequired,native:V.object.isRequired,instance:V.number.isRequired,adapterName:V.string.isRequired,onError:V.func,onLoad:V.func,onChange:V.func,changed:V.bool,socket:V.object.isRequired};const ws={tab:{width:"100%",minHeight:"100%"},column:{display:"inline-block",verticalAlign:"top",marginRight:20},columnSettings:{width:"calc(100% - 10px)"},fontSize:{"@media screen and (max-width: 460px)":{"& > *":{fontSize:"3.2vw"}}}},yGe=[{value:"",label:"System language",translate:!0},{value:"en",label:"English"},{value:"de",label:"Deutsch"},{value:"ru",label:"русский"},{value:"pt",label:"Portugues"},{value:"nl",label:"Nederlands"},{value:"fr",label:"français"},{value:"it",label:"Italiano"},{value:"es",label:"Espanol"},{value:"pl",label:"Polski"},{value:"uk",label:"Українська мова"},{value:"zh-ch",label:"简体中文"}];class eA extends C.Component{render(){const{native:e,onChange:r}=this.props;return $.jsx("form",{style:ws.tab,children:$.jsxs("div",{style:{...ws.column,...ws.columnSettings},children:[$.jsx("h4",{children:R.t("disable_default")}),$.jsx("p",{children:R.t("warning_incorrectly")}),$.jsx("div",{children:$.jsx(gr,{title:"disable_extensions",attr:"disableExtensions",sx:ws.fontSize,native:e,onChange:r})}),$.jsx("div",{children:$.jsx(gr,{title:"disable_states",attr:"disableStates",sx:ws.fontSize,native:e,onChange:r})}),$.jsx("div",{children:$.jsx(gr,{title:"disable_files",attr:"disableFilesObjects",sx:ws.fontSize,native:e,onChange:r})}),e.disableFilesObjects?null:$.jsx("div",{children:$.jsx(gr,{title:"show_folders",attr:"showFolderIndex",sx:ws.fontSize,native:e,onChange:r})}),$.jsx("h4",{children:R.t("Redirect options")}),$.jsx("div",{children:$.jsx(dr,{variant:"standard",value:e.defaultRedirect||"",onChange:n=>r("defaultRedirect",n.target.value),label:R.t("defaultRedirect"),helperText:R.t("This path will be opened if no path specified")})}),$.jsx("h4",{children:R.t("Cache options")}),$.jsx("div",{children:$.jsx(dr,{variant:"standard",value:e.staticAssetCacheMaxAge,onChange:n=>r("staticAssetCacheMaxAge",n.target.value),label:R.t("staticAssetCacheMaxAge"),helperText:R.t("in seconds")})}),$.jsx("h4",{children:R.t("Language")}),$.jsx("div",{children:$.jsxs(ta,{variant:"standard",style:{width:250},children:[$.jsx(ru,{children:R.t("Overload system language")}),$.jsx(gn,{value:e.language||"",label:R.t("Overload system language"),onChange:n=>r("language",n.target.value),children:yGe.map(n=>$.jsx(Zt,{value:n.value,children:n.translate?R.t(n.label):n.label},n.value))}),$.jsx(Au,{children:R.t("only for this instance")})]})})]})})}}eA.propTypes={native:V.object.isRequired,onChange:V.func};const Vv={tab:{width:"100%",minHeight:"100%"},column:{display:"inline-block",verticalAlign:"top"},columnSettings:{width:"100%"}};let tA=class extends C.Component{constructor(e){super(e),this.state={toast:"",groups:null,users:null},this.lang=R.getLanguage()}async componentDidMount(){const e=await this.props.socket.getUsers(),r=await this.props.socket.getGroups();this.setState({users:e,groups:r})}render(){const{native:e,onChange:r}=this.props,{userListSettings:n}=e,{toast:o}=this.state;return $.jsxs("form",{style:Vv.tab,children:[$.jsx(ai,{message:o,onClose:()=>this.setState({toast:""})}),$.jsxs("div",{style:{...Vv.column,...Vv.columnSettings,position:"relative"},children:[$.jsx(gr,{title:"included",attr:"userListEnabled",native:e,onChange:(a,i)=>r(a,i,()=>{i&&!e.userListSettings&&r("userListSettings",{accessAsUser:"system.user.admin",users:["system.user.admin"],groups:["system.group.administrator"]})})}),n&&this.state.users?$.jsxs("div",{children:[$.jsxs("div",{children:[R.t("Only following users may access web interface as"),$.jsxs(gn,{style:{marginLeft:10,marginRight:10},variant:"standard",value:e.userListSettings.accessAsUser||"_",onChange:a=>{const i=JSON.parse(JSON.stringify(e.userListSettings));i.accessAsUser=a.target.value==="_"||!a.target.value?"":a.target.value,r("userListSettings",i)},renderValue:a=>{if(!a||a==="_")return R.t("logged in user");const i=this.state.users.find(l=>l._id===a);return i?$.jsx(Wi,{value:i,lang:this.lang}):a},children:[$.jsx(Zt,{value:"_",children:R.t("logged in user")}),this.state.users.map(a=>$.jsx(Zt,{value:a._id,children:$.jsx(Wi,{value:a,lang:this.lang})},a._id))]}),R.t("after authentication"),":"]}),$.jsxs("div",{style:{display:"flex",width:"100%",maxWidth:1024,flexDirection:"row"},children:[$.jsxs("div",{style:{display:"flex",width:"calc(50% - 20px)",maxWidth:512,flexDirection:"column"},children:[$.jsx("div",{style:{fontSize:24,fontWeight:"bold",marginLeft:8},children:R.t("Groups")}),this.state.groups.map(a=>$.jsxs(Ha,{style:{width:"calc(100% - 40px)",margin:10,padding:10},children:[$.jsxs("div",{style:{display:"flex"},children:[$.jsx(wr,{disabled:a._id==="system.group.administrator",onChange:()=>{const i=JSON.parse(JSON.stringify(e.userListSettings)),l=i.groups.indexOf(a._id);l!==-1?i.groups.splice(l,1):(i.groups.push(a._id),i.groups.sort()),r("userListSettings",i)},checked:e.userListSettings.groups.includes(a._id)}),$.jsx(Wi,{value:a,lang:this.lang})]}),$.jsxs("div",{style:{display:"flex",marginLeft:12},children:[$.jsx("span",{style:{marginRight:8},children:R.t("Group members:")}),a.common.members.map(i=>{const l=this.state.users.find(u=>u._id===i);return l?$.jsx(Wi,{value:l,lang:this.lang},i):$.jsx("span",{children:i},i)})]})]},a._id))]}),$.jsxs("div",{style:{display:"flex",width:"calc(50% - 20px)",maxWidth:512,flexDirection:"column"},children:[$.jsx("div",{style:{fontSize:24,fontWeight:"bold",marginLeft:8},children:R.t("Users")}),this.state.users.map(a=>{const i=!!e.userListSettings.groups.find(l=>{const u=this.state.groups.find(f=>f._id===l);return u&&u.common.members.includes(a._id)});return $.jsxs(Ha,{style:{width:"calc(100% - 40px)",margin:10,padding:10},children:[$.jsxs("div",{style:{display:"flex"},children:[$.jsx(wr,{disabled:a._id==="system.user.admin"||i,onChange:()=>{const l=JSON.parse(JSON.stringify(e.userListSettings)),u=l.users.indexOf(a._id);u!==-1?l.users.splice(u,1):(l.users.push(a._id),l.users.sort()),r("userListSettings",l)},checked:e.userListSettings.users.includes(a._id)||i}),$.jsx(Wi,{value:a,lang:this.lang})]}),$.jsxs("div",{style:{display:"flex",marginLeft:12},children:[$.jsx("span",{style:{marginRight:8},children:R.t("In groups:")}),this.state.groups.filter(l=>l.common.members.includes(a._id)).map(l=>$.jsx(Wi,{value:l,lang:this.lang},l._id))]})]},a._id)})]})]})]}):null]})]})}};tA.propTypes={native:V.object.isRequired,onChange:V.func,socket:V.object.isRequired};const vGe="Main settings",bGe="Port",wGe="Secure (HTTPS)",xGe="Authentication",SGe="Basic Authentication",kGe="Cache",$Ge="Socket.IO Instance (Optional): (Used by adapters like rickshaw or vis)",CGe="'Public' certificate",EGe="Login timeout (sec)",TGe="Built-in 'Simple-API'",OGe="Force Web-Sockets",DGe="Private certificate",MGe="Chained certificate",PGe="Run as",NGe="itegrated",AGe="none",RGe="Listen on all IPs",IGe="Let`s encrypt certificates",jGe="Use Let's Encrypt certificates",zGe="Use this instance for automatic update",LGe="Port to check the domain",FGe="Click for help",BGe="Access list",WGe="User",UGe="object",HGe="state",qGe="file",VGe="read",GGe="list",XGe="write",JGe="create",YGe="Enabled",KGe="Background",ZGe="Background color of the login screen",QGe="Background image",eXe="Upload image",tXe="place the files here",rXe="Disable authentication",nXe="Ignore warning",oXe="Warning!",aXe="The password will be sent via unsecure connection. To protect your passwords enable the secure connection (HTTPS)!",sXe="Authentication was deactivated",iXe="The provided IP is not valid",cXe="Use Lets Encrypt staging (for testing/debug. Only for developer)",lXe="Advanced",uXe="Disable Default Functions",dXe="Warning: Incorrectly disabling functions use can cause unexpected behaviour.",pXe="Disable extension handling",fXe="Disable states and socket info",hXe="Do not serve web files from ioBroker storage",mXe="Set certificates or load it first in the system settings (right top).",_Xe="Default redirect path",gXe="White list works only with integrated socket-io interface",yXe="Ok",vXe="Cancel",bXe="Use pure web-sockets (iobroker.ws)",wXe="Cache max age for files",xXe="Language",SXe="Show folders content",kXe="User access list",$Xe="Groups",CXe="Users",EXe={main_settings:vGe,port:bGe,encryption:wGe,authentication:xGe,basic_authentication:SGe,cache:kGe,socket:$Ge,public_certificate:CGe,time_out:EGe,simple_api:TGe,web_sockets:OGe,private_certificate:DGe,chained_certificate:MGe,users:PGe,built_in:NGe,nothing:AGe,open_ip:RGe,certificates:IGe,use_certificates:jGe,renew_certificates:zGe,domain_name:LGe,link:FGe,whiteList:BGe,user:WGe,object:UGe,status:HGe,file:qGe,to_read:VGe,list:GGe,write:XGe,to_create:JGe,delete:"delete",included:YGe,background:KGe,color:ZGe,background_image:QGe,upload_image:eXe,place_the_files_here:tXe,button_title:rXe,button_title2:nXe,Warning:oXe,modal_title:aXe,Authentication_deactivated:sXe,incorrect_ip:iXe,use_lets:cXe,additionally:lXe,disable_default:uXe,warning_incorrectly:dXe,disable_extensions:pXe,disable_states:fXe,disable_files:hXe,set_certificates:mXe,"IP address":"Bound IP address","Redirect options":"Redirect options",defaultRedirect:_Xe,"This path will be opened if no path specified":"This path will be opened if no URL path specified",whitelist_only_with_integrated_socket:gXe,"White list will be disabled. Please confirm.":"White list will be disabled. Please confirm.",Ok:yXe,Cancel:vXe,usePureWebSockets:bXe,"If no IP address matches, show authentication dialog":"If no IP address matches, show authentication dialog","Compatibility mode with socket.io@2.x":"Compatibility mode with socket.io@2.x","Same settings must be set in socketio instance":"Same settings must be set in socketio instance",staticAssetCacheMaxAge:wXe,"in seconds":"in seconds","Cache options":"Cache options","Overload system language":"Overload system language","only for this instance":"only for this instance","System language":"System language","Use %s adapter to get letsencrypt certificates.":"Use %s adapter to get letsencrypt certificates.",Language:xXe,show_folders:SXe,"Do not check if this instance is available from internet":"Do not check if this instance is available from internet",UserList:kXe,"Only following users may access web interface as":"Only following users may access web interface as","logged in user":"logged in user","after authentication":"after authentication",Groups:$Xe,"Group members:":"Group members:",Users:CXe,"In groups:":"In groups:"},TXe="Allgemeine Einstellungen",OXe="Port",DXe="Verschlüsselte Verbindung (HTTPS)",MXe="Authentifikation",PXe="Basic-Authentifizierung",NXe="Cache",AXe="socket.io Instanz (Optional): (Wird von Rickshaw oder Vis benutzt)",RXe="Öffentliches Zertifikat",IXe="Anmelde Timeout (Sek.)",jXe="Eingebautes 'Simple-API'",zXe="Web-Sockets erzwingen",LXe="Privates Zertifikat",FXe="Verkettetes Zertifikat",BXe="Ausführen als",WXe="integriert",UXe="keins",HXe="Zugriff von allen IPs zulassen",qXe="Let's Encrypt Zertifikate",VXe="Let's Encrypt Zertifikate verwenden",GXe="Diese Instanz für automatische Updates verwenden",XXe="Port um die Domain zu prüfen",JXe="Anklicken für Hilfe",YXe="Zugangsliste",KXe="Benutzer",ZXe="Objekt",QXe="Zustand",eJe="Datei",tJe="lesen",rJe="auflisten",nJe="schreiben",oJe="erstellen",aJe="Aktiviert",sJe="Hintergrund",iJe="Hintergrundfarbe des Anmeldebildschirms",cJe="Hintergrundbild",lJe="Bild hochladen",uJe="Dateien hier platzieren",dJe="Authentifizierung deaktivieren",pJe="Warnung ignorieren",fJe="Warnung!",hJe="Das Passwort wird über unsichere Verbindung gesendet. Um Ihre Passwörter zu schützen, aktivieren Sie die sichere HTTPS Verbindung!",mJe="Die Authentifizierung wurde deaktiviert",_Je="Die angegebene IP-Adresse ist ungültig",gJe="Lets Encrypt Staging verwenden (nur zum Testen oder Debuggen. Nur für Entwickler)",yJe="Extra",vJe="Standardfunktionen deaktivieren",bJe="Warnung: Das fehlerhafte Deaktivieren von Funktionen kann zu unerwartetem Verhalten führen.",wJe="Erweiterungsbehandlung deaktivieren",xJe="Zustände und Socket Informationen deaktivieren",SJe="Webdateien aus dem ioBroker-Speicherbereich nicht bereitstellen",kJe="Zertifikate wählen bzw. Zertifikate in den Systemeinstellungen (oben rechts) hinterlegen.",$Je="Standardweiterleitungspfad",CJe="Whitelist funktioniert nur mit integrierter Socket-io-Schnittstelle",EJe="Ok",TJe="Abbrechen",OJe="Reine Web-Sockets (iobroker.ws) verwenden",DJe="Cache-Maximalalter für Dateien",MJe="Sprache",PJe="Ordnerinhalt anzeigen",NJe="Benutzerzugriffsliste",AJe="Gruppen",RJe="Benutzer",IJe={main_settings:TXe,port:OXe,encryption:DXe,authentication:MXe,basic_authentication:PXe,cache:NXe,socket:AXe,public_certificate:RXe,time_out:IXe,simple_api:jXe,web_sockets:zXe,private_certificate:LXe,chained_certificate:FXe,users:BXe,built_in:WXe,nothing:UXe,open_ip:HXe,certificates:qXe,use_certificates:VXe,renew_certificates:GXe,domain_name:XXe,link:JXe,whiteList:YXe,user:KXe,object:ZXe,status:QXe,file:eJe,to_read:tJe,list:rJe,write:nJe,to_create:oJe,delete:"Löschen",included:aJe,background:sJe,color:iJe,background_image:cJe,upload_image:lJe,place_the_files_here:uJe,button_title:dJe,button_title2:pJe,Warning:fJe,modal_title:hJe,Authentication_deactivated:mJe,incorrect_ip:_Je,use_lets:gJe,additionally:yJe,disable_default:vJe,warning_incorrectly:bJe,disable_extensions:wJe,disable_states:xJe,disable_files:SJe,set_certificates:kJe,"IP address":"Gebundene IP-Adresse","Redirect options":"Weiterleitungsoptionen",defaultRedirect:$Je,"This path will be opened if no path specified":"Dieser Pfad wird geöffnet, wenn kein URL-Pfad angegeben ist",whitelist_only_with_integrated_socket:CJe,"White list will be disabled. Please confirm.":"Weiße Liste wird deaktiviert. Bitte bestätigen.",Ok:EJe,Cancel:TJe,usePureWebSockets:OJe,"If no IP address matches, show authentication dialog":"Wenn keine IP-Adresse übereinstimmt, Authentifizierungsdialog anzeigen","Compatibility mode with socket.io@2.x":"Kompatibilitätsmodus mit socket.io@2.x","Same settings must be set in socketio instance":"Dieselben Einstellungen müssen in der Socketio-Instanz festgelegt werden",staticAssetCacheMaxAge:DJe,"in seconds":"in Sekunden","Cache options":"Cache-Optionen","Overload system language":"Systemsprache überladen","only for this instance":"nur für diesen Fall","System language":"Systemsprache","Use %s adapter to get letsencrypt certificates.":"Verwenden Sie den %s-Adapter, um letsencrypt-Zertifikate zu erhalten.",Language:MJe,show_folders:PJe,"Do not check if this instance is available from internet":"Nicht überprüfen, ob diese Instanz im Internet verfügbar ist",UserList:NJe,"Only following users may access web interface as":"Nur folgende Benutzer dürfen auf die Weboberfläche zugreifen als","logged in user":"Angemeldeter Benutzer","after authentication":"nach der Authentifizierung",Groups:AJe,"Group members:":"Gruppenmitglieder:",Users:RJe,"In groups:":"In Gruppen:"},jJe="Основные настройки",zJe="Порт",LJe="Шифрование (HTTPS)",FJe="Аутентификация",BJe="Basic-Аутентификация",WJe="Кэш",UJe="Socket.IO экземпляр (опционально): (Используется для Rickshaw или Vis)",HJe="'Public' сертификат",qJe="Тайм-аут входа (сек)",VJe="Встроенный 'Simple-API'",GJe="Только Web-Sockets",XJe="'Private' сертификат",JJe="'Chained' сертификат",YJe="Запустить от пользователя",KJe="встроенный",ZJe="ничего",QJe="Открыть для всех IP адресов",eYe="Let`s encrypt сертификаты",tYe="Использовать сертификаты Let`s Encrypt",rYe="Обновлять сертификаты в этом экземпляре",nYe="Порт для проверки доменного имени",oYe="Перейти по ссылке",aYe="Список доступа",sYe="Пользователь",iYe="объект",cYe="статус",lYe="файл",uYe="читать",dYe="список",pYe="писать",fYe="создать",hYe="Включено",mYe="Фон",_Ye="Цвет фона экрана входа в систему",gYe="Фоновое изображение",yYe="Загрузить изображение",vYe="переместите файлы сюда",bYe="Отключить аутентификацию",wYe="Игнорировать предупреждение",xYe="Внимание!",SYe="Пароль будет отправлен через незащищенное соединение. Для защиты ваших паролей активируйте безопасное соединение (HTTPS)!",kYe="Аутентификация была отключена",$Ye="Неверный IP-адрес",CYe="Используйте Lets Encrypt staging (для тестирования/отладки. Только для разработчиков)",EYe="Дополнительно",TYe="Отключить функции по умолчанию",OYe="Внимание: неправильное отключение использования функций может вызвать непредвиденное поведение.",DYe="Отключить обработку расширений",MYe="Отключить состояния и информацию о сокете",PYe="Не обслуживать веб-файлы из objectDB",NYe="Нужно выбрать сертификаты или сначала загрузить их в системных настройках.",AYe="Путь перенаправления по умолчанию",RYe="Белый список работает только со встроенным интерфейсом socket-io",IYe="Ok",jYe="Отмена",zYe="Использовать чистые веб-сокеты (iobroker.ws)",LYe="Максимальный возраст кэша для файлов",FYe="Язык",BYe="Показать содержимое папок",WYe="Список доступа пользователей",UYe="Группы",HYe="Пользователи",qYe={main_settings:jJe,port:zJe,encryption:LJe,authentication:FJe,basic_authentication:BJe,cache:WJe,socket:UJe,public_certificate:HJe,time_out:qJe,simple_api:VJe,web_sockets:GJe,private_certificate:XJe,chained_certificate:JJe,users:YJe,built_in:KJe,nothing:ZJe,open_ip:QJe,certificates:eYe,use_certificates:tYe,renew_certificates:rYe,domain_name:nYe,link:oYe,whiteList:aYe,user:sYe,object:iYe,status:cYe,file:lYe,to_read:uYe,list:dYe,write:pYe,to_create:fYe,delete:"удалить",included:hYe,background:mYe,color:_Ye,background_image:gYe,upload_image:yYe,place_the_files_here:vYe,button_title:bYe,button_title2:wYe,Warning:xYe,modal_title:SYe,Authentication_deactivated:kYe,incorrect_ip:$Ye,use_lets:CYe,additionally:EYe,disable_default:TYe,warning_incorrectly:OYe,disable_extensions:DYe,disable_states:MYe,disable_files:PYe,set_certificates:NYe,"IP address":"Связанный IP-адрес","Redirect options":"Варианты перенаправления",defaultRedirect:AYe,"This path will be opened if no path specified":"Этот путь будет открыт, если не указан URL-путь",whitelist_only_with_integrated_socket:RYe,"White list will be disabled. Please confirm.":"Белый список будет отключен. Пожалуйста подтвердите.",Ok:IYe,Cancel:jYe,usePureWebSockets:zYe,"If no IP address matches, show authentication dialog":"Если нет совпадений IP-адресов, показать диалоговое окно аутентификации","Compatibility mode with socket.io@2.x":"Режим совместимости с socket.io@2.x","Same settings must be set in socketio instance":"Те же настройки должны быть установлены в экземпляре socketio",staticAssetCacheMaxAge:LYe,"in seconds":"в секундах","Cache options":"Параметры кэша","Overload system language":"Перегрузить системный язык","only for this instance":"только для этого экземпляра","System language":"Язык системы","Use %s adapter to get letsencrypt certificates.":"Используйте адаптер %s для получения сертификатов letsencrypt.",Language:FYe,show_folders:BYe,"Do not check if this instance is available from internet":"Не проверять, доступен ли этот экземпляр из Интернета",UserList:WYe,"Only following users may access web interface as":"Только следующие пользователи могут получить доступ к веб-интерфейсу, как","logged in user":"вошедший в систему пользователь","after authentication":"после аутентификации",Groups:UYe,"Group members:":"Участники группы:",Users:HYe,"In groups:":"В группах:"},VYe="Configurações principais",GYe="Porta",XYe="Seguro (HTTPS)",JYe="Autenticação",YYe="Autenticação Básica",KYe="Cache",ZYe="Socket.IO Instance (Optional): (Usado por adaptadores como rickshaw ou vis)",QYe="Certificado público",eKe="Tempo limite de login (seg)",tKe="Build-in 'Simple-API'",rKe="Forçar Web-Sockets",nKe="Certificado privado",oKe="Certificado acorrentado",aKe="Correr como",sKe="integrado",iKe="ninguna",cKe="Ouça todos os IPs",lKe="Let's Encrypt Certificados",uKe="Use Vamos criptografar certificados",dKe="Use esta instância para atualização automática",pKe="Porta para verificar o domínio",fKe="Clique para ajuda",hKe="Lista de acesso",mKe="Do utilizador",_Ke="objeto",gKe="Estado",yKe="Arquivo",vKe="ler",bKe="Lista",wKe="wrire",xKe="crio",SKe="Ativado",kKe="Fundo",$Ke="Cor de fundo da tela de login",CKe="Imagem de fundo",EKe="Enviar Imagem",TKe="coloque os arquivos aqui",OKe="Desativar autenticação",DKe="Ignorar aviso",MKe="Atenção!",PKe="A senha será enviada por meio de conexão não segura. Para proteger suas senhas, ative a conexão segura (HTTPS)!",NKe="A autenticação foi desativada",AKe="O IP fornecido não é válido",RKe="Use o teste Lets Encrypt (para teste)",IKe="Avançado",jKe="Desativar funções padrão",zKe="Aviso: A desativação incorreta do uso de funções pode causar um comportamento inesperado.",LKe="Desative o manuseio de extensões",FKe="Desative estados e informações de soquete",BKe="Não veicular arquivos da web de objectDB",WKe="Defina certificados ou carregue primeiro nas configurações do sistema (parte superior direita).",UKe="Caminho de redirecionamento padrão",HKe="A lista branca funciona apenas com interface socket-io integrada",qKe="OK",VKe="Cancelar",GKe="Use web-sockets puros (iobroker.ws)",XKe="Idade máxima do cache para arquivos",JKe="Linguagem",YKe="Mostrar o conteúdo das pastas",KKe="Lista de acesso do usuário",ZKe="Grupos",QKe="Usuários",eZe={main_settings:VYe,port:GYe,encryption:XYe,authentication:JYe,basic_authentication:YYe,cache:KYe,socket:ZYe,public_certificate:QYe,time_out:eKe,simple_api:tKe,web_sockets:rKe,private_certificate:nKe,chained_certificate:oKe,users:aKe,built_in:sKe,nothing:iKe,open_ip:cKe,certificates:lKe,use_certificates:uKe,renew_certificates:dKe,domain_name:pKe,link:fKe,whiteList:hKe,user:mKe,object:_Ke,status:gKe,file:yKe,to_read:vKe,list:bKe,write:wKe,to_create:xKe,delete:"excluir",included:SKe,background:kKe,color:$Ke,background_image:CKe,upload_image:EKe,place_the_files_here:TKe,button_title:OKe,button_title2:DKe,Warning:MKe,modal_title:PKe,Authentication_deactivated:NKe,incorrect_ip:AKe,use_lets:RKe,additionally:IKe,disable_default:jKe,warning_incorrectly:zKe,disable_extensions:LKe,disable_states:FKe,disable_files:BKe,set_certificates:WKe,"IP address":"Endereço IP vinculado","Redirect options":"Opções de redirecionamento",defaultRedirect:UKe,"This path will be opened if no path specified":"Este caminho será aberto se nenhum caminho de URL for especificado",whitelist_only_with_integrated_socket:HKe,"White list will be disabled. Please confirm.":"A lista branca será desativada. Por favor confirme.",Ok:qKe,Cancel:VKe,usePureWebSockets:GKe,"If no IP address matches, show authentication dialog":"Se nenhum endereço IP corresponder, mostre a caixa de diálogo de autenticação","Compatibility mode with socket.io@2.x":"Modo de compatibilidade com socket.io@2.x","Same settings must be set in socketio instance":"As mesmas configurações devem ser definidas na instância socketio",staticAssetCacheMaxAge:XKe,"in seconds":"em segundos","Cache options":"Opções de cache","Overload system language":"Sobrecarregar o idioma do sistema","only for this instance":"apenas para esta instância","System language":"Idioma do sistema","Use %s adapter to get letsencrypt certificates.":"Use o adaptador %s para obter certificados letsencrypt.",Language:JKe,show_folders:YKe,"Do not check if this instance is available from internet":"Não verifique se esta instância está disponível na Internet",UserList:KKe,"Only following users may access web interface as":"Somente os seguintes usuários podem acessar a interface web como","logged in user":"usuário logado","after authentication":"após autenticação",Groups:ZKe,"Group members:":"Membros do grupo:",Users:QKe,"In groups:":"Em grupos:"},tZe="Belangrijkste instellingen",rZe="Haven",nZe="Secure (HTTPS)",oZe="Authenticatie",aZe="Basisverificatie",sZe="Cache",iZe="Socket.IO Instance (Optional): (Gebruikt door adapters zoals riksja of vis)",cZe="Openbaar certificaat",lZe="Aanmeld-time-out (sec)",uZe="Ingebouwde 'Simple-API'",dZe="Force Web-Sockets",pZe="Privé certificaat",fZe="Geketend certificaat",hZe="Rennen als",mZe="geïntegreerde",_Ze="geen",gZe="Luister op alle IP's",yZe="Let's Encrypt certificaten",vZe="Gebruik Let's Encrypt-certificaten",bZe="Gebruik deze instantie voor automatische update",wZe="Poort om het domein te controleren",xZe="Klik voor hulp",SZe="Toegangslijst",kZe="Gebruiker",$Ze="voorwerp",CZe="staat",EZe="het dossier",TZe="lezen",OZe="lijst",DZe="wrire",MZe="creëren",PZe="Ingeschakeld",NZe="Achtergrond",AZe="Achtergrondkleur van het inlogscherm",RZe="Achtergrond afbeelding",IZe="Afbeelding uploaden",jZe="plaats de bestanden hier",zZe="Schakel verificatie uit",LZe="Negeer waarschuwing",FZe="Waarschuwing!",BZe="Het wachtwoord wordt verzonden via onbeveiligde verbinding. Ter beveiliging van uw wachtwoorden schakelt u de beveiligde verbinding (HTTPS) in!",WZe="Verificatie was gedeactiveerd",UZe="Het opgegeven IP-adres is niet geldig",HZe="Gebruik Lets Encrypt enscenering (voor testen)",qZe="Geavanceerd",VZe="Schakel standaardfuncties uit",GZe="Waarschuwing: het onjuist uitschakelen van het gebruik van functies kan onverwacht gedrag veroorzaken.",XZe="Verwerking van extensies uitschakelen",JZe="Schakel statussen en socketinformatie uit",YZe="Serveer geen webbestanden vanuit objectDB",KZe="Stel certificaten in of laad het eerst in de systeeminstellingen (rechtsboven).",ZZe="Standaard omleidingspad",QZe="Witte lijst werkt alleen met geïntegreerde socket-io-interface",eQe="OK",tQe="Annuleren",rQe="Gebruik pure web-sockets (iobroker.ws)",nQe="Cache max leeftijd voor bestanden",oQe="Taal",aQe="Inhoud van mappen weergeven",sQe="Lijst met gebruikerstoegang",iQe="Groepen",cQe="Gebruikers",lQe={main_settings:tZe,port:rZe,encryption:nZe,authentication:oZe,basic_authentication:aZe,cache:sZe,socket:iZe,public_certificate:cZe,time_out:lZe,simple_api:uZe,web_sockets:dZe,private_certificate:pZe,chained_certificate:fZe,users:hZe,built_in:mZe,nothing:_Ze,open_ip:gZe,certificates:yZe,use_certificates:vZe,renew_certificates:bZe,domain_name:wZe,link:xZe,whiteList:SZe,user:kZe,object:$Ze,status:CZe,file:EZe,to_read:TZe,list:OZe,write:DZe,to_create:MZe,delete:"verwijderen",included:PZe,background:NZe,color:AZe,background_image:RZe,upload_image:IZe,place_the_files_here:jZe,button_title:zZe,button_title2:LZe,Warning:FZe,modal_title:BZe,Authentication_deactivated:WZe,incorrect_ip:UZe,use_lets:HZe,additionally:qZe,disable_default:VZe,warning_incorrectly:GZe,disable_extensions:XZe,disable_states:JZe,disable_files:YZe,set_certificates:KZe,"IP address":"Gebonden IP-adres","Redirect options":"Omleidingsopties",defaultRedirect:ZZe,"This path will be opened if no path specified":"Dit pad wordt geopend als er geen URL-pad is opgegeven",whitelist_only_with_integrated_socket:QZe,"White list will be disabled. Please confirm.":"Witte lijst wordt uitgeschakeld. Bevestig alstublieft.",Ok:eQe,Cancel:tQe,usePureWebSockets:rQe,"If no IP address matches, show authentication dialog":"Als geen IP-adres overeenkomt, verificatiedialoogvenster weergeven","Compatibility mode with socket.io@2.x":"Compatibiliteitsmodus met socket.io@2.x","Same settings must be set in socketio instance":"Dezelfde instellingen moeten worden ingesteld in de socketio-instantie",staticAssetCacheMaxAge:nQe,"in seconds":"in seconden","Cache options":"Cache-opties","Overload system language":"Systeemtaal overbelasten","only for this instance":"alleen voor dit geval","System language":"Systeemtaal","Use %s adapter to get letsencrypt certificates.":"Gebruik %s adapter om letsencrypt-certificaten te verkrijgen.",Language:oQe,show_folders:aQe,"Do not check if this instance is available from internet":"Controleer niet of dit exemplaar beschikbaar is via internet",UserList:sQe,"Only following users may access web interface as":"Alleen de volgende gebruikers hebben toegang tot de webinterface als","logged in user":"ingelogde gebruiker","after authentication":"na authenticatie",Groups:iQe,"Group members:":"Groepsleden:",Users:cQe,"In groups:":"In groepen:"},uQe="Réglages principaux",dQe="Port",pQe="Sécurisé (HTTPS)",fQe="Authentification",hQe="Authentification de base",mQe="Cache",_Qe="Socket.IO Instance (Optional): (Utilisé par des adaptateurs comme le pousse-pousse ou vis)",gQe="Certificat public",yQe="Délai d'attente de connexion (sec)",vQe="Construire 'Simple-API'",bQe="Forcer les Web-Sockets",wQe="Certificat privé",xQe="Certificat chaîné",SQe="Courir comme",kQe="intégré",$Qe="aucun",CQe="Écoutez sur toutes les adresses IP",EQe="Let's Encrypt Certificats",TQe="Utiliser les certificats Let's Encrypt",OQe="Utilisez cette instance pour la mise à jour automatique",DQe="Port pour vérifier le domaine",MQe="Cliquez pour obtenir de l'aide",PQe="Liste d'accès",NQe="Utilisateur",AQe="objet",RQe="Etat",IQe="fichier",jQe="lis",zQe="liste",LQe="écrire",FQe="créer",BQe="Activée",WQe="Contexte",UQe="Couleur d'arrière-plan de l'écran de connexion",HQe="Image de fond",qQe="Importer une image",VQe="Placez les fichiers ici",GQe="Désactiver l'authentification",XQe="Ignorer l'avertissement",JQe="Attention!",YQe="Le mot de passe sera envoyé via une connexion non sécurisée. Pour protéger vos mots de passe, activez la connexion sécurisée (HTTPS)!",KQe="L'authentification a été désactivée",ZQe="L'adresse IP fournie n'est pas valide",QQe="Utiliser la mise en scène Lets Encrypt (pour les tests)",eet="Avancée",tet="Désactiver les fonctions par défaut",ret="Avertissement: la désactivation incorrecte de l'utilisation des fonctions peut provoquer un comportement inattendu.",net="Désactivez la gestion des extensions",oet="Désactivez les états et les informations de socket",aet="Ne diffusez pas de fichiers Web depuis objectDB",set="Définissez des certificats ou chargez-les d'abord dans les paramètres du système (en haut à droite).",iet="Chemin de redirection par défaut",cet="La liste blanche ne fonctionne qu'avec l'interface socket-io intégrée",uet="D'accord",det="Annuler",pet="Utilisez des sockets Web purs (iobroker.ws)",fet="Âge maximum du cache pour les fichiers",het="Langue",met="Afficher le contenu des dossiers",_et="Liste d'accès des utilisateurs",get="Groupes",yet="Utilisateurs",vet={main_settings:uQe,port:dQe,encryption:pQe,authentication:fQe,basic_authentication:hQe,cache:mQe,socket:_Qe,public_certificate:gQe,time_out:yQe,simple_api:vQe,web_sockets:bQe,private_certificate:wQe,chained_certificate:xQe,users:SQe,built_in:kQe,nothing:$Qe,open_ip:CQe,certificates:EQe,use_certificates:TQe,renew_certificates:OQe,domain_name:DQe,link:MQe,whiteList:PQe,user:NQe,object:AQe,status:RQe,file:IQe,to_read:jQe,list:zQe,write:LQe,to_create:FQe,delete:"effacer",included:BQe,background:WQe,color:UQe,background_image:HQe,upload_image:qQe,place_the_files_here:VQe,button_title:GQe,button_title2:XQe,Warning:JQe,modal_title:YQe,Authentication_deactivated:KQe,incorrect_ip:ZQe,use_lets:QQe,additionally:eet,disable_default:tet,warning_incorrectly:ret,disable_extensions:net,disable_states:oet,disable_files:aet,set_certificates:set,"IP address":"Adresse IP liée","Redirect options":"Options de redirection",defaultRedirect:iet,"This path will be opened if no path specified":"Ce chemin sera ouvert si aucun chemin URL spécifié",whitelist_only_with_integrated_socket:cet,"White list will be disabled. Please confirm.":"La liste blanche sera désactivée. Veuillez confirmer.",Ok:uet,Cancel:det,usePureWebSockets:pet,"If no IP address matches, show authentication dialog":"Si aucune adresse IP ne correspond, affichez la boîte de dialogue d'authentification","Compatibility mode with socket.io@2.x":"Mode de compatibilité avec socket.io@2.x","Same settings must be set in socketio instance":"Les mêmes paramètres doivent être définis dans l'instance socketio",staticAssetCacheMaxAge:fet,"in seconds":"en secondes","Cache options":"Options de cache","Overload system language":"Surcharger la langue du système","only for this instance":"uniquement pour ce cas","System language":"Langue du système","Use %s adapter to get letsencrypt certificates.":"Utilisez l'adaptateur %s pour obtenir les certificats Letsencrypt.",Language:het,show_folders:met,"Do not check if this instance is available from internet":"Ne vérifiez pas si cette instance est disponible sur Internet",UserList:_et,"Only following users may access web interface as":"Seuls les utilisateurs suivants peuvent accéder à l'interface Web en tant que","logged in user":"utilisateur connecté","after authentication":"après authentification",Groups:get,"Group members:":"Les membres du groupe:",Users:yet,"In groups:":"En groupes:"},bet="Impostazioni principali",wet="Porta",xet="Sicuro (HTTPS)",ket="Autenticazione",$et="Autenticazione di base",Cet="nascondiglio",Eet="Socket.IO Instance (Optional): (Utilizzato da adattatori come risciò o vis)",Tet="Certificato pubblico",Oet="Timeout di accesso (sec)",Det="Build-in 'Simple-API'",Met="Force Web-Sockets",Pet="Certificato privato",Net="Certificato incatenato",Aet="Correre come",Ret="integrato",Iet="nessuna",jet="Ascolta su tutti gli IP",zet="Let's Encrypt certificati",Let="Utilizza Let's Encrypt certificates",Fet="Utilizza questa istanza per l'aggiornamento automatico",Bet="Porta per controllare il dominio",Wet="Fai clic per chiedere aiuto",Uet="Elenco di accesso",Het="Utente",qet="oggetto",Vet="stato",Get="file",Xet="leggere",Jet="elenco",Yet="wrire",Ket="creare",Zet="Abilitato",Qet="Sfondo",ett="Colore di sfondo della schermata di accesso",ttt="Immagine di sfondo",rtt="Carica immagine",ntt="posiziona i file qui",ott="Disabilitare l'autenticazione",att="Ignora l'avviso",stt="Avvertimento!",itt="La password verrà inviata tramite connessione non protetta. Per proteggere le tue password abilita la connessione sicura (HTTPS)!",ctt="L'autenticazione è stata disattivata",ltt="L'IP fornito non è valido",utt="Usa Lets Encrypt staging (per test)",dtt="Avanzate",ptt="Disabilita le funzioni predefinite",ftt="Avvertenza: la disabilitazione errata dell'uso delle funzioni può causare comportamenti imprevisti.",htt="Disabilita la gestione delle estensioni",mtt="Disabilita stati e informazioni socket",_tt="Non servire file web da objectDB",gtt="Imposta i certificati o caricali prima nelle impostazioni di sistema (in alto a destra).",ytt="Percorso di reindirizzamento predefinito",vtt="La lista bianca funziona solo con l'interfaccia socket-io integrata",btt="Ok",wtt="Annulla",xtt="Usa socket web puri (iobroker.ws)",Stt="Età massima della cache per i file",ktt="Lingua",$tt="Mostra il contenuto delle cartelle",Ctt="Elenco di accesso degli utenti",Ett="Gruppi",Ttt="Utenti",Ott={main_settings:bet,port:wet,encryption:xet,authentication:ket,basic_authentication:$et,cache:Cet,socket:Eet,public_certificate:Tet,time_out:Oet,simple_api:Det,web_sockets:Met,private_certificate:Pet,chained_certificate:Net,users:Aet,built_in:Ret,nothing:Iet,open_ip:jet,certificates:zet,use_certificates:Let,renew_certificates:Fet,domain_name:Bet,link:Wet,whiteList:Uet,user:Het,object:qet,status:Vet,file:Get,to_read:Xet,list:Jet,write:Yet,to_create:Ket,delete:"Elimina",included:Zet,background:Qet,color:ett,background_image:ttt,upload_image:rtt,place_the_files_here:ntt,button_title:ott,button_title2:att,Warning:stt,modal_title:itt,Authentication_deactivated:ctt,incorrect_ip:ltt,use_lets:utt,additionally:dtt,disable_default:ptt,warning_incorrectly:ftt,disable_extensions:htt,disable_states:mtt,disable_files:_tt,set_certificates:gtt,"IP address":"Indirizzo IP associato","Redirect options":"Opzioni di reindirizzamento",defaultRedirect:ytt,"This path will be opened if no path specified":"Questo percorso verrà aperto se non viene specificato alcun percorso URL",whitelist_only_with_integrated_socket:vtt,"White list will be disabled. Please confirm.":"La lista bianca sarà disabilitata. Si prega di confermare.",Ok:btt,Cancel:wtt,usePureWebSockets:xtt,"If no IP address matches, show authentication dialog":"Se nessun indirizzo IP corrisponde, mostra la finestra di autenticazione","Compatibility mode with socket.io@2.x":"Modalità di compatibilità con socket.io@2.x","Same settings must be set in socketio instance":"Le stesse impostazioni devono essere impostate nell'istanza socketio",staticAssetCacheMaxAge:Stt,"in seconds":"in secondi","Cache options":"Opzioni della cache","Overload system language":"Sovraccarica la lingua del sistema","only for this instance":"solo per questo caso","System language":"Linguaggio di sistema","Use %s adapter to get letsencrypt certificates.":"Usa l'adattatore %s per ottenere i certificati letsencrypt.",Language:ktt,show_folders:$tt,"Do not check if this instance is available from internet":"Non verificare se questa istanza è disponibile da Internet",UserList:Ctt,"Only following users may access web interface as":"Solo i seguenti utenti possono accedere all'interfaccia web come","logged in user":"utente registrato","after authentication":"dopo l'autenticazione",Groups:Ett,"Group members:":"Membri del gruppo:",Users:Ttt,"In groups:":"In gruppi:"},Dtt="Ajustes principales",Mtt="Puerto",Ptt="Seguro (HTTPS)",Ntt="Autenticación",Att="Autenticación básica",Rtt="Cache",Itt="Socket.IO Instance (Optional): (Utilizado por adaptadores como rickshaw o vis)",jtt="Certificado público",ztt="Tiempo de espera de inicio de sesión (sec)",Ltt="Build-in 'Simple-API'",Ftt="Force Web-Sockets",Btt="Certificado privado",Wtt="Certificado encadenado",Utt="Correr como",Htt="integrado",qtt="ninguna",Vtt="Escuchar en todas las direcciones IP",Gtt="Let's Encrypt Certificados",Xtt="Utilice los certificados Let's Encrypt",Jtt="Use esta instancia para la actualización automática",Ytt="Puerto para verificar el dominio",Ktt="Haz clic para obtener ayuda",Ztt="Lista de acceso",Qtt="Usuario",ert="objeto",trt="estado",rrt="archivo",nrt="leer",ort="lista",art="wrire",srt="crear",irt="Habilitado",crt="Fondo",lrt="Color de fondo de la pantalla de inicio de sesión",urt="Imagen de fondo",drt="Cargar imagen",prt="coloca los archivos aquí",frt="Deshabilitar autenticación",hrt="Ignorar advertencia",mrt="¡Advertencia!",_rt="La contraseña se enviará a través de una conexión no segura. Para proteger sus contraseñas, ¡habilite la conexión segura (HTTPS)!",grt="La autenticación fue desactivada",yrt="El IP proporcionado no es válido",vrt="Use Lets Encrypt staging (para pruebas)",brt="Avanzado",wrt="Deshabilitar funciones predeterminadas",xrt="Advertencia: la desactivación incorrecta del uso de funciones puede provocar un comportamiento inesperado.",Srt="Deshabilitar el manejo de extensiones",krt="Deshabilitar estados e información de socket",$rt="No sirva archivos web desde objectDB",Crt="Establezca certificados o cárguelos primero en la configuración del sistema (arriba a la derecha).",Ert="Ruta de redirección predeterminada",Trt="La lista blanca solo funciona con la interfaz socket-io integrada",Ort="OK",Drt="Cancelar",Mrt="Use sockets web puros (iobroker.ws)",Prt="Antigüedad máxima de caché para archivos",Nrt="Idioma",Art="Mostrar el contenido de las carpetas",Rrt="Lista de acceso de usuarios",Irt="Grupos",jrt="Usuarios",zrt={main_settings:Dtt,port:Mtt,encryption:Ptt,authentication:Ntt,basic_authentication:Att,cache:Rtt,socket:Itt,public_certificate:jtt,time_out:ztt,simple_api:Ltt,web_sockets:Ftt,private_certificate:Btt,chained_certificate:Wtt,users:Utt,built_in:Htt,nothing:qtt,open_ip:Vtt,certificates:Gtt,use_certificates:Xtt,renew_certificates:Jtt,domain_name:Ytt,link:Ktt,whiteList:Ztt,user:Qtt,object:ert,status:trt,file:rrt,to_read:nrt,list:ort,write:art,to_create:srt,delete:"borrar",included:irt,background:crt,color:lrt,background_image:urt,upload_image:drt,place_the_files_here:prt,button_title:frt,button_title2:hrt,Warning:mrt,modal_title:_rt,Authentication_deactivated:grt,incorrect_ip:yrt,use_lets:vrt,additionally:brt,disable_default:wrt,warning_incorrectly:xrt,disable_extensions:Srt,disable_states:krt,disable_files:$rt,set_certificates:Crt,"IP address":"Dirección IP vinculada","Redirect options":"Opciones de redireccionamiento",defaultRedirect:Ert,"This path will be opened if no path specified":"Esta ruta se abrirá si no se especifica ninguna ruta URL.",whitelist_only_with_integrated_socket:Trt,"White list will be disabled. Please confirm.":"La lista blanca se desactivará. Por favor confirmar.",Ok:Ort,Cancel:Drt,usePureWebSockets:Mrt,"If no IP address matches, show authentication dialog":"Si ninguna dirección IP coincide, mostrar el cuadro de diálogo de autenticación","Compatibility mode with socket.io@2.x":"Modo de compatibilidad con socket.io@2.x","Same settings must be set in socketio instance":"Se deben establecer las mismas configuraciones en la instancia de socketio",staticAssetCacheMaxAge:Prt,"in seconds":"en segundos","Cache options":"Opciones de caché","Overload system language":"Sobrecargar idioma del sistema","only for this instance":"solo para esta instancia","System language":"Lenguaje del sistema","Use %s adapter to get letsencrypt certificates.":"Use el adaptador %s para obtener certificados de letsencrypt.",Language:Nrt,show_folders:Art,"Do not check if this instance is available from internet":"No verifique si esta instancia está disponible en Internet.",UserList:Rrt,"Only following users may access web interface as":"Sólo los siguientes usuarios pueden acceder a la interfaz web como","logged in user":"usuario registrado","after authentication":"después de la autenticación",Groups:Irt,"Group members:":"Miembros del grupo:",Users:jrt,"In groups:":"En grupos:"},Lrt="Ustawienia główne",Frt="Port",Brt="Bezpieczne (HTTPS)",Wrt="Poświadczenie",Urt="Uwierzytelnianie podstawowe",Hrt="Pamięć podręczna",qrt="Socket.IO Instance (Optional): (Używany przez adaptery takie jak riksza lub vis)",Vrt="Certyfikat publiczny",Grt="Limit czasu logowania (s)",Xrt="Wbuduj 'Proste API'",Jrt="Wymuszaj gniazda internetowe",Yrt="Prywatny certyfikat",Krt="Przykuty certyfikat",Zrt="Uruchom jako",Qrt="zintegrowany",ent="Żaden",tnt="Posłuchaj na wszystkich IP",rnt="Let's Encrypt certyfikaty",nnt="Użyj Let's Encrypt certificates",ont="Użyj tej instancji do automatycznej aktualizacji",ant="Port do sprawdzenia domeny",snt="Kliknij, aby uzyskać pomoc",int="Lista dostępu",cnt="Użytkownik",lnt="obiekt",unt="stan",dnt="plik",pnt="czytać",fnt="lista",hnt="wrire",mnt="Stwórz",_nt="Włączone",gnt="Tło",ynt="Kolor tła ekranu logowania",vnt="Zdjęcie w tle",bnt="Załaduj obrazek",wnt="umieść pliki tutaj",xnt="Wyłącz uwierzytelnianie",Snt="Zignoruj ​​ostrzeżenie",knt="Ostrzeżenie!",$nt="Hasło zostanie wysłane przez połączenie bez zabezpieczeń. Aby chronić swoje hasła, włącz bezpieczne połączenie (HTTPS)!",Cnt="Uwierzytelnianie zostało dezaktywowane",Ent="Podany adres IP jest nieprawidłowy",Tnt="Użyj Lets Encrypt staging (do testowania)",Ont="Zaawansowane",Dnt="Wyłącz funkcje domyślne",Mnt="Ostrzeżenie: Niepoprawne wyłączenie używania funkcji może spowodować nieoczekiwane zachowanie.",Pnt="Wyłącz obsługę rozszerzeń",Nnt="Wyłącz stany i informacje o gnieździe",Ant="Nie udostępniaj plików internetowych z objectDB",Rnt="Ustaw certyfikaty lub załaduj najpierw w ustawieniach systemu (prawy górny).",Int="Domyślna ścieżka przekierowania",jnt="Biała lista działa tylko ze zintegrowanym interfejsem socket-io",znt="Ok",Lnt="Odwołaj",Fnt="Używaj czystych gniazd sieciowych (iobroker.ws)",Bnt="Maksymalny wiek dla plików w pamięci podręcznej",Wnt="Język",Unt="Pokaż zawartość folderów",Hnt="Lista dostępu użytkowników",qnt="Grupy",Vnt="Użytkownicy",Gnt={main_settings:Lrt,port:Frt,encryption:Brt,authentication:Wrt,basic_authentication:Urt,cache:Hrt,socket:qrt,public_certificate:Vrt,time_out:Grt,simple_api:Xrt,web_sockets:Jrt,private_certificate:Yrt,chained_certificate:Krt,users:Zrt,built_in:Qrt,nothing:ent,open_ip:tnt,certificates:rnt,use_certificates:nnt,renew_certificates:ont,domain_name:ant,link:snt,whiteList:int,user:cnt,object:lnt,status:unt,file:dnt,to_read:pnt,list:fnt,write:hnt,to_create:mnt,delete:"kasować",included:_nt,background:gnt,color:ynt,background_image:vnt,upload_image:bnt,place_the_files_here:wnt,button_title:xnt,button_title2:Snt,Warning:knt,modal_title:$nt,Authentication_deactivated:Cnt,incorrect_ip:Ent,use_lets:Tnt,additionally:Ont,disable_default:Dnt,warning_incorrectly:Mnt,disable_extensions:Pnt,disable_states:Nnt,disable_files:Ant,set_certificates:Rnt,"IP address":"Powiązany adres IP","Redirect options":"Opcje przekierowania",defaultRedirect:Int,"This path will be opened if no path specified":"Ta ścieżka zostanie otwarta, jeśli nie określono ścieżki URL",whitelist_only_with_integrated_socket:jnt,"White list will be disabled. Please confirm.":"Biała lista zostanie wyłączona. Proszę potwierdzić.",Ok:znt,Cancel:Lnt,usePureWebSockets:Fnt,"If no IP address matches, show authentication dialog":"Jeśli żaden adres IP nie pasuje, pokaż okno uwierzytelniania","Compatibility mode with socket.io@2.x":"Tryb zgodności z socket.io@2.x","Same settings must be set in socketio instance":"Te same ustawienia muszą być ustawione w instancji socketio",staticAssetCacheMaxAge:Bnt,"in seconds":"w sekundy","Cache options":"Opcje pamięci podręcznej","Overload system language":"Przeciążenie języka systemu","only for this instance":"tylko w tym przypadku","System language":"Język systemu","Use %s adapter to get letsencrypt certificates.":"Użyj adaptera %s, aby uzyskać certyfikaty Letsencrypt.",Language:Wnt,show_folders:Unt,"Do not check if this instance is available from internet":"Nie sprawdzaj, czy ta instancja jest dostępna z Internetu",UserList:Hnt,"Only following users may access web interface as":"Tylko następujący użytkownicy mogą uzyskać dostęp do interfejsu internetowego jako","logged in user":"zalogowany użytkownik","after authentication":"po uwierzytelnieniu",Groups:qnt,"Group members:":"Członkowie grupy:",Users:Vnt,"In groups:":"W grupach:"},Xnt="Автентифікацію було вимкнено",Jnt="Скасувати",Ynt="В порядку",Knt="УВАГА!",Znt="Просунутий",Qnt="Аутентифікація",eot="Фон",tot="Фонове зображення",rot="Базова автентифікація",not="інтегрований",oot="Вимкнути автентифікацію",aot="Ігнорувати попередження",sot="Кеш",iot="Давайте зашифруємо сертифікати",cot="Прикутий сертифікат",lot="Колір фону екрана входу",uot="Шлях переспрямування за умовчанням",dot="Вимкнути функції за замовчуванням",pot="Вимкнути обробку розширень",fot="Не обслуговуйте веб-файли зі сховища ioBroker",hot="Вимкнути інформацію про стани та сокет",mot="Порт для перевірки домену",_ot="Безпечний (HTTPS)",got="файл",yot="Увімкнено",vot="Наданий IP недійсний",bot="Натисніть для допомоги",wot="список",xot="Основні налаштування",Sot="Пароль буде надіслано через незахищене з’єднання. Щоб захистити ваші паролі, увімкніть безпечне з'єднання (HTTPS)!",kot="немає",$ot="об'єкт",Cot="Прослуховування на всіх IP",Eot="розмістіть файли тут",Tot="Порт",Oot="Приватний сертифікат",Dot="«Публічний» сертифікат",Mot="Використовуйте цей екземпляр для автоматичного оновлення",Pot="Спершу встановіть сертифікати або завантажте їх у налаштуваннях системи (справа вгорі).",Not="Вбудований «Simple-API»",Aot="Примірник Socket.IO (необов’язково): (використовується такими адаптерами, як rickshaw або vis)",Rot="Максимальний вік кешу для файлів",Iot="стан",jot="Час очікування входу (с)",zot="створити",Lot="читати",Fot="Завантажити зображення",Bot="Використовуйте чисті веб-сокети (iobroker.ws)",Wot="Використовуйте сертифікати Let's Encrypt",Uot="Використовуйте постановки Lets Encrypt (для тестування/налагодження. Тільки для розробника)",Hot="Користувач",qot="Бігати як",Vot="Попередження: неправильне вимкнення використання функцій може призвести до неочікуваної поведінки.",Got="Force Web-Sockets",Xot="Список доступу",Jot="Білий список працює лише з вбудованим інтерфейсом socket-io",Yot="писати",Kot="Мова",Zot="Показати вміст папок",Qot="Список доступу користувачів",eat="Групи",tat="Користувачі",rat={Authentication_deactivated:Xnt,"Cache options":"Параметри кешу",Cancel:Jnt,"Compatibility mode with socket.io@2.x":"Режим сумісності з socket.io@2.x","IP address":"Прив'язана IP-адреса","If no IP address matches, show authentication dialog":"Якщо жодна IP-адреса не відповідає, відобразити діалогове вікно автентифікації",Ok:Ynt,"Overload system language":"Перевантаження системної мови","Redirect options":"Параметри перенаправлення","Same settings must be set in socketio instance":"Такі ж параметри потрібно встановити в екземплярі socketio","System language":"Системна мова","This path will be opened if no path specified":"Цей шлях буде відкрито, якщо URL-адресу не вказано",Warning:Knt,"White list will be disabled. Please confirm.":"Білий список буде вимкнено. Будь-ласка підтвердіть.",additionally:Znt,authentication:Qnt,background:eot,background_image:tot,basic_authentication:rot,built_in:not,button_title:oot,button_title2:aot,cache:sot,certificates:iot,chained_certificate:cot,color:lot,defaultRedirect:uot,delete:"видалити",disable_default:dot,disable_extensions:pot,disable_files:fot,disable_states:hot,domain_name:mot,encryption:_ot,file:got,"in seconds":"за секунди",included:yot,incorrect_ip:vot,link:bot,list:wot,main_settings:xot,modal_title:Sot,nothing:kot,object:$ot,"only for this instance":"тільки для цього випадку",open_ip:Cot,place_the_files_here:Eot,port:Tot,private_certificate:Oot,public_certificate:Dot,renew_certificates:Mot,set_certificates:Pot,simple_api:Not,socket:Aot,staticAssetCacheMaxAge:Rot,status:Iot,time_out:jot,to_create:zot,to_read:Lot,upload_image:Fot,usePureWebSockets:Bot,use_certificates:Wot,use_lets:Uot,user:Hot,users:qot,warning_incorrectly:Vot,web_sockets:Got,whiteList:Xot,whitelist_only_with_integrated_socket:Jot,write:Yot,"Use %s adapter to get letsencrypt certificates.":"Використовуйте адаптер %s, щоб отримати сертифікати letsencrypt.",Language:Kot,show_folders:Zot,"Do not check if this instance is available from internet":"Не перевіряйте, чи доступний цей екземпляр в Інтернеті",UserList:Qot,"Only following users may access web interface as":"Тільки такі користувачі можуть отримати доступ до веб-інтерфейсу як","logged in user":"авторизований користувач","after authentication":"після аутентифікації",Groups:eat,"Group members:":"Члени групи:",Users:tat,"In groups:":"У групах:"},nat="主要设置",oat="端口",aat="安全访问 (HTTPS)",sat="认证机制",iat="基本身份验证",cat="使能缓存",lat="Socket.IO Instance (Optional): (被rickshaw或vis等适配器使用)",uat="公共证书",dat="登录超时时间(秒)",pat="内置'Simple-API'",fat="强制Web-Sockets",hat="私人证书",mat="链式证书",_at="运行为",gat="集成的",yat="无",vat="监听所有IP",bat="Let's Encrypt证书",wat="使用Let's Encrypt证书",xat="自动更新Let's Encrypt证书",Sat="自动更新证书使用的端口",kat="单击获取帮助",$at="访问列表",Cat="用户",Eat="对象",Tat="状态",Oat="文件",Dat="可读",Mat="可列举",Pat="可写",Nat="可创建",Aat="使能",Rat="背景",Iat="登录界面的背景颜色",jat="背景图片",zat="上传图片",Lat="将文件拖拽到这里",Fat="禁用身份认证机制",Bat="忽略警告",Wat="警告!",Uat="密码将通过不安全的连接发送。 要保护您的密码,请启用安全连接(HTTPS)!",Hat="身份认证机制已停用",qat="提供的IP无效",Vat="使用Lets Encrypt暂存(用于测试)",Gat="高级",Xat="禁用默认功能",Jat="警告:错误地禁用功能使用会导致意外行为。",Yat="禁用扩展处理:",Kat="禁用状态和套接字信息",Zat="不要提供来自objectDB的Web文件",Qat="首先在系统设置中(右上角)设置或加载证书。",est="默认重定向路径",tst="白名单仅适用于集成的 socket-io 接口",rst="好的",nst="取消",ost="使用纯网络套接字 (iobroker.ws)",ast="文件的缓存最大年龄",sst="语言",ist="显示文件夹内容",cst="用户访问列表",lst="团体",ust="用户",dst={main_settings:nat,port:oat,encryption:aat,authentication:sat,basic_authentication:iat,cache:cat,socket:lat,public_certificate:uat,time_out:dat,simple_api:pat,web_sockets:fat,private_certificate:hat,chained_certificate:mat,users:_at,built_in:gat,nothing:yat,open_ip:vat,certificates:bat,use_certificates:wat,renew_certificates:xat,domain_name:Sat,link:kat,whiteList:$at,user:Cat,object:Eat,status:Tat,file:Oat,to_read:Dat,list:Mat,write:Pat,to_create:Nat,delete:"可删除",included:Aat,background:Rat,color:Iat,background_image:jat,upload_image:zat,place_the_files_here:Lat,button_title:Fat,button_title2:Bat,Warning:Wat,modal_title:Uat,Authentication_deactivated:Hat,incorrect_ip:qat,use_lets:Vat,additionally:Gat,disable_default:Xat,warning_incorrectly:Jat,disable_extensions:Yat,disable_states:Kat,disable_files:Zat,set_certificates:Qat,"IP address":"绑定IP地址","Redirect options":"重定向选项",defaultRedirect:est,"This path will be opened if no path specified":"如果未指定 URL 路径,将打开此路径",whitelist_only_with_integrated_socket:tst,"White list will be disabled. Please confirm.":"白名单将被禁用。请确认。",Ok:rst,Cancel:nst,usePureWebSockets:ost,"If no IP address matches, show authentication dialog":"如果没有 IP 地址匹配,则显示身份验证对话框","Compatibility mode with socket.io@2.x":"与 socket.io@2.x 的兼容模式","Same settings must be set in socketio instance":"必须在 socketio 实例中设置相同的设置",staticAssetCacheMaxAge:ast,"in seconds":"片刻之间","Cache options":"缓存选项","Overload system language":"重载系统语言","only for this instance":"仅适用于本例","System language":"系统语言","Use %s adapter to get letsencrypt certificates.":"使用 %s 适配器获取 letsencrypt 证书。",Language:sst,show_folders:ist,"Do not check if this instance is available from internet":"不检查此实例是否可从 Internet 获取",UserList:cst,"Only following users may access web interface as":"只有以下用户可以访问 Web 界面:","logged in user":"登录用户","after authentication":"认证后",Groups:lst,"Group members:":"小组成员:",Users:ust,"In groups:":"在团队中:"},Pp={tabContent:{padding:10,height:"calc(100% - 64px - 48px - 20px)",overflow:"auto"},tabContentIFrame:{padding:10,height:"calc(100% - 64px - 48px - 20px - 38px)",overflow:"auto"},selected:t=>({color:t.palette.mode==="dark"?void 0:"#FFF !important"}),indicator:t=>({backgroundColor:t.palette.mode==="dark"?t.palette.secondary.main:"#FFF"})},Np=[{name:"options",translate:"main_settings",index:0},{name:"certificates",translate:"certificates",index:1},{name:"whiteList",translate:"whiteList",index:2},{name:"userList",translate:"UserList",index:3},{name:"additionally",translate:"additionally",index:4},{name:"background",translate:"background",index:5}];class pst extends ja{constructor(e){const r={...e};r.encryptedFields=["pass"],r.Connection=B9,r.translations={en:EXe,de:IJe,ru:qYe,pt:eZe,nl:lQe,fr:vet,it:Ott,es:zrt,pl:Gnt,uk:rat,"zh-cn":dst},r.sentryDSN=window.sentryDSN,super(e,r)}getSelectedTab(){var n;const{selectedTab:e}=this.state,r=e;return r?this.checkDisabledTabs(r)?0:((n=Np.find(o=>o.name===r))==null?void 0:n.index)||0:0}onPrepareSave(e){super.onPrepareSave(e);const{secure:r,certPublic:n,certPrivate:o}=this.state.native;return r&&(!o||!n)?(this.setState({toast:"set_certificates"}),!1):!0}renderTab(){const{native:e}=this.state;let r=this.state.selectedTab;switch(this.checkDisabledTabs(this.state.selectedTab)&&(r="options"),r){case"certificates":return $.jsx(mGe,{common:this.common,socket:this.socket,native:e,onError:n=>this.setState({errorText:(n||n===0)&&typeof n!="string"?n.toString():n}),instance:this.instance,onChange:(n,o,a)=>this.updateNativeValue(n,o,a),adapterName:this.adapterName},"certificates");case"whiteList":return $.jsx(Su,{theme:this.state.theme,common:this.common,socket:this.socket,native:e,onChange:(n,o,a)=>this.updateNativeValue(n,o,a),onError:n=>this.setState({errorText:(n||n===0)&&typeof n!="string"?n.toString():n}),instance:this.instance,adapterName:this.adapterName},"whiteList");case"userList":return $.jsx(tA,{common:this.common,socket:this.socket,native:e,onChange:(n,o,a)=>this.updateNativeValue(n,o,a),onError:n=>this.setState({errorText:(n||n===0)&&typeof n!="string"?n.toString():n}),instance:this.instance,adapterName:this.adapterName},"userList");case"additionally":return $.jsx(eA,{common:this.common,socket:this.socket,native:e,onChange:(n,o,a)=>this.updateNativeValue(n,o,a),onError:n=>this.setState({errorText:(n||n===0)&&typeof n!="string"?n.toString():n}),instance:this.instance,adapterName:this.adapterName},"additionally");case"background":return $.jsx(QN,{common:this.common,socket:this.socket,native:e,onChange:(n,o,a)=>this.updateNativeValue(n,o,a),onError:n=>this.setState({errorText:(n||n===0)&&typeof n!="string"?n.toString():n}),instance:this.instance,adapterName:this.adapterName},"background");case"options":default:return $.jsx(ZN,{themeType:this.state.themeType,common:this.common,socket:this.socket,native:e,onError:n=>this.setState({errorText:(n||n===0)&&typeof n!="string"?n.toString():n}),instance:this.instance,onChange:(n,o,a)=>this.updateNativeValue(n,o,a),adapterName:this.adapterName,onLoad:n=>this.setState({native:n})},"options")}}checkDisabledTabs(e){const{native:r}=this.state;return!r.auth&&e==="background"||!r.secure&&e==="certificates"||!r.auth&&(e==="whiteList"||e==="userList")}render(){const{loaded:e,theme:r,themeType:n,toast:o}=this.state;return e?$.jsx(sk,{injectFirst:!0,children:$.jsxs(Dk,{theme:this.state.theme,children:[$.jsx(ai,{message:o,onClose:()=>this.setState({toast:""})}),$.jsxs("div",{className:"App",style:{background:r.palette.background.default,color:r.palette.text.primary},children:[$.jsx(cM,{position:"static",children:$.jsx(RM,{value:this.getSelectedTab(),onChange:(a,i)=>{var l;return this.selectTab(((l=Np.find(u=>u.index===i))==null?void 0:l.name)||Np[0].name,i)},scrollButtons:"auto",sx:{"& .MuiTabs-indicator":Pp.indicator},children:Np.map((a,i)=>$.jsx(ks,{sx:{"& .MuiTab-selected":Pp.selected},disabled:this.checkDisabledTabs(a.name),label:R.t(a.translate),"data-name":a.name},`${i}-tab-key`))})}),$.jsx("div",{style:this.isIFrame?Pp.tabContentIFrame:Pp.tabContent,children:this.renderTab()}),this.renderError(),this.renderSaveCloseButtons()]})]})}):$.jsx(sk,{injectFirst:!0,children:$.jsx(Dk,{theme:this.state.theme,children:$.jsx(_P,{theme:n})})})}}window.location.hostname==="localhost"||window.location.hostname==="[::1]"||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/);function fst(){"serviceWorker"in navigator&&navigator.serviceWorker.ready.then(t=>t.unregister())}const hst="web-admin",mst="6.3.1",_st={"@iobroker/adapter-react-v5":"^7.4.19","@mui/icons-material":"^6.4.2","@mui/material":"^6.4.2","@sentry/browser":"^8.52.1","@vitejs/plugin-react":"^4.3.4","babel-eslint":"^10.1.0","prop-types":"^15.8.1",react:"^18.3.1","react-dom":"^18.3.1","react-dropzone":"^14.3.5","react-icons":"^5.4.0"},gst={start:"vite --host",build:"vite build",lint:"eslint -c eslint.config.mjs","check-ts":"tsc --noEmit --checkJS false",tsc:"tsc --project tsconfig.json"},yst={extends:"react-app"},vst=".",bst=[">0.2%","not dead","not ie <= 11","not op_mini all"],wst={name:hst,version:mst,private:!0,dependencies:_st,scripts:gst,eslintConfig:yst,homepage:vst,browserslist:bst};window.adapterName="web";window.sentryDSN="https://5ad729dbed504d15aa8bde423cae9a8e@sentry.iobroker.net/57";console.log(`iobroker.${window.adapterName}@${wst.version}`);const dD=document.getElementById("root");dD&&sI.createRoot(dD).render($.jsx(pst,{}));fst()});export default xst(); +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var lh=typeof window<"u"&&typeof window.document<"u",Do=lh?window:{},Qw=lh&&Do.document.documentElement?"ontouchstart"in Do.document.documentElement:!1,ex=lh?"PointerEvent"in Do:!1,Vt="cropper",tx="all",IN="crop",jN="move",zN="zoom",ys="e",vs="w",Ui="s",Aa="n",Il="ne",jl="nw",zl="se",Ll="sw",t0="".concat(Vt,"-crop"),GO="".concat(Vt,"-disabled"),nn="".concat(Vt,"-hidden"),XO="".concat(Vt,"-hide"),yVe="".concat(Vt,"-invisible"),gf="".concat(Vt,"-modal"),r0="".concat(Vt,"-move"),bu="".concat(Vt,"Action"),Dp="".concat(Vt,"Preview"),rx="crop",LN="move",FN="none",n0="crop",o0="cropend",a0="cropmove",s0="cropstart",JO="dblclick",vVe=Qw?"touchstart":"mousedown",bVe=Qw?"touchmove":"mousemove",wVe=Qw?"touchend touchcancel":"mouseup",YO=ex?"pointerdown":vVe,KO=ex?"pointermove":bVe,ZO=ex?"pointerup pointercancel":wVe,QO="ready",eD="resize",tD="wheel",i0="zoom",rD="image/jpeg",xVe=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,SVe=/^data:/,kVe=/^data:image\/jpeg;base64,/,$Ve=/^img|canvas$/i,BN=200,WN=100,nD={viewMode:0,dragMode:rx,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:BN,minContainerHeight:WN,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},CVe='
',EVe=Number.isNaN||Do.isNaN;function mt(t){return typeof t=="number"&&!EVe(t)}var oD=function(e){return e>0&&e<1/0};function Bv(t){return typeof t>"u"}function Ws(t){return Qb(t)==="object"&&t!==null}var TVe=Object.prototype.hasOwnProperty;function dc(t){if(!Ws(t))return!1;try{var e=t.constructor,r=e.prototype;return e&&r&&TVe.call(r,"isPrototypeOf")}catch{return!1}}function rn(t){return typeof t=="function"}var OVe=Array.prototype.slice;function UN(t){return Array.from?Array.from(t):OVe.call(t)}function pr(t,e){return t&&rn(e)&&(Array.isArray(t)||mt(t.length)?UN(t).forEach(function(r,n){e.call(t,r,n,t)}):Ws(t)&&Object.keys(t).forEach(function(r){e.call(t,t[r],r,t)})),t}var Xt=Object.assign||function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o0&&n.forEach(function(a){Ws(a)&&Object.keys(a).forEach(function(i){e[i]=a[i]})}),e},DVe=/\.\d*(?:0|9){12}\d*$/;function _c(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return DVe.test(t)?Math.round(t*e)/e:t}var MVe=/^width|height|left|top|marginLeft|marginTop$/;function Fa(t,e){var r=t.style;pr(e,function(n,o){MVe.test(o)&&mt(n)&&(n="".concat(n,"px")),r[o]=n})}function PVe(t,e){return t.classList?t.classList.contains(e):t.className.indexOf(e)>-1}function xr(t,e){if(e){if(mt(t.length)){pr(t,function(n){xr(n,e)});return}if(t.classList){t.classList.add(e);return}var r=t.className.trim();r?r.indexOf(e)<0&&(t.className="".concat(r," ").concat(e)):t.className=e}}function To(t,e){if(e){if(mt(t.length)){pr(t,function(r){To(r,e)});return}if(t.classList){t.classList.remove(e);return}t.className.indexOf(e)>=0&&(t.className=t.className.replace(e,""))}}function pc(t,e,r){if(e){if(mt(t.length)){pr(t,function(n){pc(n,e,r)});return}r?xr(t,e):To(t,e)}}var NVe=/([a-z\d])([A-Z])/g;function nx(t){return t.replace(NVe,"$1-$2").toLowerCase()}function c0(t,e){return Ws(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(nx(e)))}function wu(t,e,r){Ws(r)?t[e]=r:t.dataset?t.dataset[e]=r:t.setAttribute("data-".concat(nx(e)),r)}function AVe(t,e){if(Ws(t[e]))try{delete t[e]}catch{t[e]=void 0}else if(t.dataset)try{delete t.dataset[e]}catch{t.dataset[e]=void 0}else t.removeAttribute("data-".concat(nx(e)))}var HN=/\s\s*/,qN=function(){var t=!1;if(lh){var e=!1,r=function(){},n=Object.defineProperty({},"once",{get:function(){return t=!0,e},set:function(a){e=a}});Do.addEventListener("test",r,n),Do.removeEventListener("test",r,n)}return t}();function Yn(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=r;e.trim().split(HN).forEach(function(a){if(!qN){var i=t.listeners;i&&i[a]&&i[a][r]&&(o=i[a][r],delete i[a][r],Object.keys(i[a]).length===0&&delete i[a],Object.keys(i).length===0&&delete t.listeners)}t.removeEventListener(a,o,n)})}function Pn(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=r;e.trim().split(HN).forEach(function(a){if(n.once&&!qN){var i=t.listeners,l=i===void 0?{}:i;o=function(){delete l[a][r],t.removeEventListener(a,o,n);for(var f=arguments.length,h=new Array(f),d=0;dMath.abs(r)&&(r=m)})}),r}function Mp(t,e){var r=t.pageX,n=t.pageY,o={endX:r,endY:n};return e?o:NN({startX:r,startY:n},o)}function jVe(t){var e=0,r=0,n=0;return pr(t,function(o){var a=o.startX,i=o.startY;e+=a,r+=i,n+=1}),e/=n,r/=n,{pageX:e,pageY:r}}function Ba(t){var e=t.aspectRatio,r=t.height,n=t.width,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",a=oD(n),i=oD(r);if(a&&i){var l=r*e;o==="contain"&&l>n||o==="cover"&&l90?{width:u,height:l}:{width:l,height:u}}function LVe(t,e,r,n){var o=e.aspectRatio,a=e.naturalWidth,i=e.naturalHeight,l=e.rotate,u=l===void 0?0:l,f=e.scaleX,h=f===void 0?1:f,d=e.scaleY,m=d===void 0?1:d,g=r.aspectRatio,v=r.naturalWidth,w=r.naturalHeight,S=n.fillColor,k=S===void 0?"transparent":S,T=n.imageSmoothingEnabled,E=T===void 0?!0:T,M=n.imageSmoothingQuality,P=M===void 0?"low":M,D=n.maxWidth,A=D===void 0?1/0:D,j=n.maxHeight,F=j===void 0?1/0:j,O=n.minWidth,z=O===void 0?0:O,G=n.minHeight,H=G===void 0?0:G,q=document.createElement("canvas"),U=q.getContext("2d"),Y=Ba({aspectRatio:g,width:A,height:F}),te=Ba({aspectRatio:g,width:z,height:H},"cover"),Z=Math.min(Y.width,Math.max(te.width,v)),J=Math.min(Y.height,Math.max(te.height,w)),re=Ba({aspectRatio:o,width:A,height:F}),L=Ba({aspectRatio:o,width:z,height:H},"cover"),Q=Math.min(re.width,Math.max(L.width,a)),de=Math.min(re.height,Math.max(L.height,i)),fe=[-Q/2,-de/2,Q,de];return q.width=_c(Z),q.height=_c(J),U.fillStyle=k,U.fillRect(0,0,Z,J),U.save(),U.translate(Z/2,J/2),U.rotate(u*Math.PI/180),U.scale(h,m),U.imageSmoothingEnabled=E,U.imageSmoothingQuality=P,U.drawImage.apply(U,[t].concat(RN(fe.map(function(_e){return Math.floor(_c(_e))})))),U.restore(),q}var GN=String.fromCharCode;function FVe(t,e,r){var n="";r+=e;for(var o=e;o0;)r.push(GN.apply(null,UN(o.subarray(0,n)))),o=o.subarray(n);return"data:".concat(e,";base64,").concat(btoa(r.join("")))}function HVe(t){var e=new DataView(t),r;try{var n,o,a;if(e.getUint8(0)===255&&e.getUint8(1)===216)for(var i=e.byteLength,l=2;l+1=8&&(a=f+d)}}}if(a){var m=e.getUint16(a,n),g,v;for(v=0;v=0?a:BN),height:Math.max(n.offsetHeight,i>=0?i:WN)};this.containerData=l,Fa(o,{width:l.width,height:l.height}),xr(e,nn),To(o,nn)},initCanvas:function(){var e=this.containerData,r=this.imageData,n=this.options.viewMode,o=Math.abs(r.rotate)%180===90,a=o?r.naturalHeight:r.naturalWidth,i=o?r.naturalWidth:r.naturalHeight,l=a/i,u=e.width,f=e.height;e.height*l>e.width?n===3?u=e.height*l:f=e.width/l:n===3?f=e.width/l:u=e.height*l;var h={aspectRatio:l,naturalWidth:a,naturalHeight:i,width:u,height:f};this.canvasData=h,this.limited=n===1||n===2,this.limitCanvas(!0,!0),h.width=Math.min(Math.max(h.width,h.minWidth),h.maxWidth),h.height=Math.min(Math.max(h.height,h.minHeight),h.maxHeight),h.left=(e.width-h.width)/2,h.top=(e.height-h.height)/2,h.oldLeft=h.left,h.oldTop=h.top,this.initialCanvasData=Xt({},h)},limitCanvas:function(e,r){var n=this.options,o=this.containerData,a=this.canvasData,i=this.cropBoxData,l=n.viewMode,u=a.aspectRatio,f=this.cropped&&i;if(e){var h=Number(n.minCanvasWidth)||0,d=Number(n.minCanvasHeight)||0;l>1?(h=Math.max(h,o.width),d=Math.max(d,o.height),l===3&&(d*u>h?h=d*u:d=h/u)):l>0&&(h?h=Math.max(h,f?i.width:0):d?d=Math.max(d,f?i.height:0):f&&(h=i.width,d=i.height,d*u>h?h=d*u:d=h/u));var m=Ba({aspectRatio:u,width:h,height:d});h=m.width,d=m.height,a.minWidth=h,a.minHeight=d,a.maxWidth=1/0,a.maxHeight=1/0}if(r)if(l>(f?0:1)){var g=o.width-a.width,v=o.height-a.height;a.minLeft=Math.min(0,g),a.minTop=Math.min(0,v),a.maxLeft=Math.max(0,g),a.maxTop=Math.max(0,v),f&&this.limited&&(a.minLeft=Math.min(i.left,i.left+(i.width-a.width)),a.minTop=Math.min(i.top,i.top+(i.height-a.height)),a.maxLeft=i.left,a.maxTop=i.top,l===2&&(a.width>=o.width&&(a.minLeft=Math.min(0,g),a.maxLeft=Math.max(0,g)),a.height>=o.height&&(a.minTop=Math.min(0,v),a.maxTop=Math.max(0,v))))}else a.minLeft=-a.width,a.minTop=-a.height,a.maxLeft=o.width,a.maxTop=o.height},renderCanvas:function(e,r){var n=this.canvasData,o=this.imageData;if(r){var a=zVe({width:o.naturalWidth*Math.abs(o.scaleX||1),height:o.naturalHeight*Math.abs(o.scaleY||1),degree:o.rotate||0}),i=a.width,l=a.height,u=n.width*(i/n.naturalWidth),f=n.height*(l/n.naturalHeight);n.left-=(u-n.width)/2,n.top-=(f-n.height)/2,n.width=u,n.height=f,n.aspectRatio=i/l,n.naturalWidth=i,n.naturalHeight=l,this.limitCanvas(!0,!1)}(n.width>n.maxWidth||n.widthn.maxHeight||n.heightr.width?a.height=a.width/n:a.width=a.height*n),this.cropBoxData=a,this.limitCropBox(!0,!0),a.width=Math.min(Math.max(a.width,a.minWidth),a.maxWidth),a.height=Math.min(Math.max(a.height,a.minHeight),a.maxHeight),a.width=Math.max(a.minWidth,a.width*o),a.height=Math.max(a.minHeight,a.height*o),a.left=r.left+(r.width-a.width)/2,a.top=r.top+(r.height-a.height)/2,a.oldLeft=a.left,a.oldTop=a.top,this.initialCropBoxData=Xt({},a)},limitCropBox:function(e,r){var n=this.options,o=this.containerData,a=this.canvasData,i=this.cropBoxData,l=this.limited,u=n.aspectRatio;if(e){var f=Number(n.minCropBoxWidth)||0,h=Number(n.minCropBoxHeight)||0,d=l?Math.min(o.width,a.width,a.width+a.left,o.width-a.left):o.width,m=l?Math.min(o.height,a.height,a.height+a.top,o.height-a.top):o.height;f=Math.min(f,o.width),h=Math.min(h,o.height),u&&(f&&h?h*u>f?h=f/u:f=h*u:f?h=f/u:h&&(f=h*u),m*u>d?m=d/u:d=m*u),i.minWidth=Math.min(f,d),i.minHeight=Math.min(h,m),i.maxWidth=d,i.maxHeight=m}r&&(l?(i.minLeft=Math.max(0,a.left),i.minTop=Math.max(0,a.top),i.maxLeft=Math.min(o.width,a.left+a.width)-i.width,i.maxTop=Math.min(o.height,a.top+a.height)-i.height):(i.minLeft=0,i.minTop=0,i.maxLeft=o.width-i.width,i.maxTop=o.height-i.height))},renderCropBox:function(){var e=this.options,r=this.containerData,n=this.cropBoxData;(n.width>n.maxWidth||n.widthn.maxHeight||n.height=r.width&&n.height>=r.height?jN:tx),Fa(this.cropBox,Xt({width:n.width,height:n.height},su({translateX:n.left,translateY:n.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),gc(this.element,n0,this.getData())}},GVe={initPreview:function(){var e=this.element,r=this.crossOrigin,n=this.options.preview,o=r?this.crossOriginUrl:this.url,a=e.alt||"The image to preview",i=document.createElement("img");if(r&&(i.crossOrigin=r),i.src=o,i.alt=a,this.viewBox.appendChild(i),this.viewBoxImage=i,!!n){var l=n;typeof n=="string"?l=e.ownerDocument.querySelectorAll(n):n.querySelector&&(l=[n]),this.previews=l,pr(l,function(u){var f=document.createElement("img");wu(u,Dp,{width:u.offsetWidth,height:u.offsetHeight,html:u.innerHTML}),r&&(f.crossOrigin=r),f.src=o,f.alt=a,f.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',u.innerHTML="",u.appendChild(f)})}},resetPreview:function(){pr(this.previews,function(e){var r=c0(e,Dp);Fa(e,{width:r.width,height:r.height}),e.innerHTML=r.html,AVe(e,Dp)})},preview:function(){var e=this.imageData,r=this.canvasData,n=this.cropBoxData,o=n.width,a=n.height,i=e.width,l=e.height,u=n.left-r.left-e.left,f=n.top-r.top-e.top;!this.cropped||this.disabled||(Fa(this.viewBoxImage,Xt({width:i,height:l},su(Xt({translateX:-u,translateY:-f},e)))),pr(this.previews,function(h){var d=c0(h,Dp),m=d.width,g=d.height,v=m,w=g,S=1;o&&(S=m/o,w=a*S),a&&w>g&&(S=g/a,v=o*S,w=g),Fa(h,{width:v,height:w}),Fa(h.getElementsByTagName("img")[0],Xt({width:i*S,height:l*S},su(Xt({translateX:-u*S,translateY:-f*S},e))))}))}},XVe={bind:function(){var e=this.element,r=this.options,n=this.cropper;rn(r.cropstart)&&Pn(e,s0,r.cropstart),rn(r.cropmove)&&Pn(e,a0,r.cropmove),rn(r.cropend)&&Pn(e,o0,r.cropend),rn(r.crop)&&Pn(e,n0,r.crop),rn(r.zoom)&&Pn(e,i0,r.zoom),Pn(n,YO,this.onCropStart=this.cropStart.bind(this)),r.zoomable&&r.zoomOnWheel&&Pn(n,tD,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),r.toggleDragModeOnDblclick&&Pn(n,JO,this.onDblclick=this.dblclick.bind(this)),Pn(e.ownerDocument,KO,this.onCropMove=this.cropMove.bind(this)),Pn(e.ownerDocument,ZO,this.onCropEnd=this.cropEnd.bind(this)),r.responsive&&Pn(window,eD,this.onResize=this.resize.bind(this))},unbind:function(){var e=this.element,r=this.options,n=this.cropper;rn(r.cropstart)&&Yn(e,s0,r.cropstart),rn(r.cropmove)&&Yn(e,a0,r.cropmove),rn(r.cropend)&&Yn(e,o0,r.cropend),rn(r.crop)&&Yn(e,n0,r.crop),rn(r.zoom)&&Yn(e,i0,r.zoom),Yn(n,YO,this.onCropStart),r.zoomable&&r.zoomOnWheel&&Yn(n,tD,this.onWheel,{passive:!1,capture:!0}),r.toggleDragModeOnDblclick&&Yn(n,JO,this.onDblclick),Yn(e.ownerDocument,KO,this.onCropMove),Yn(e.ownerDocument,ZO,this.onCropEnd),r.responsive&&Yn(window,eD,this.onResize)}},JVe={resize:function(){if(!this.disabled){var e=this.options,r=this.container,n=this.containerData,o=r.offsetWidth/n.width,a=r.offsetHeight/n.height,i=Math.abs(o-1)>Math.abs(a-1)?o:a;if(i!==1){var l,u;e.restore&&(l=this.getCanvasData(),u=this.getCropBoxData()),this.render(),e.restore&&(this.setCanvasData(pr(l,function(f,h){l[h]=f*i})),this.setCropBoxData(pr(u,function(f,h){u[h]=f*i})))}}},dblclick:function(){this.disabled||this.options.dragMode===FN||this.setDragMode(PVe(this.dragBox,t0)?LN:rx)},wheel:function(e){var r=this,n=Number(this.options.wheelZoomRatio)||.1,o=1;this.disabled||(e.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){r.wheeling=!1},50),e.deltaY?o=e.deltaY>0?1:-1:e.wheelDelta?o=-e.wheelDelta/120:e.detail&&(o=e.detail>0?1:-1),this.zoom(-o*n,e)))},cropStart:function(e){var r=e.buttons,n=e.button;if(!(this.disabled||(e.type==="mousedown"||e.type==="pointerdown"&&e.pointerType==="mouse")&&(mt(r)&&r!==1||mt(n)&&n!==0||e.ctrlKey))){var o=this.options,a=this.pointers,i;e.changedTouches?pr(e.changedTouches,function(l){a[l.identifier]=Mp(l)}):a[e.pointerId||0]=Mp(e),Object.keys(a).length>1&&o.zoomable&&o.zoomOnTouch?i=zN:i=c0(e.target,bu),xVe.test(i)&&gc(this.element,s0,{originalEvent:e,action:i})!==!1&&(e.preventDefault(),this.action=i,this.cropping=!1,i===IN&&(this.cropping=!0,xr(this.dragBox,gf)))}},cropMove:function(e){var r=this.action;if(!(this.disabled||!r)){var n=this.pointers;e.preventDefault(),gc(this.element,a0,{originalEvent:e,action:r})!==!1&&(e.changedTouches?pr(e.changedTouches,function(o){Xt(n[o.identifier]||{},Mp(o,!0))}):Xt(n[e.pointerId||0]||{},Mp(e,!0)),this.change(e))}},cropEnd:function(e){if(!this.disabled){var r=this.action,n=this.pointers;e.changedTouches?pr(e.changedTouches,function(o){delete n[o.identifier]}):delete n[e.pointerId||0],r&&(e.preventDefault(),Object.keys(n).length||(this.action=""),this.cropping&&(this.cropping=!1,pc(this.dragBox,gf,this.cropped&&this.options.modal)),gc(this.element,o0,{originalEvent:e,action:r}))}}},YVe={change:function(e){var r=this.options,n=this.canvasData,o=this.containerData,a=this.cropBoxData,i=this.pointers,l=this.action,u=r.aspectRatio,f=a.left,h=a.top,d=a.width,m=a.height,g=f+d,v=h+m,w=0,S=0,k=o.width,T=o.height,E=!0,M;!u&&e.shiftKey&&(u=d&&m?d/m:1),this.limited&&(w=a.minLeft,S=a.minTop,k=w+Math.min(o.width,n.width,n.left+n.width),T=S+Math.min(o.height,n.height,n.top+n.height));var P=i[Object.keys(i)[0]],D={x:P.endX-P.startX,y:P.endY-P.startY},A=function(F){switch(F){case ys:g+D.x>k&&(D.x=k-g);break;case vs:f+D.xT&&(D.y=T-v);break}};switch(l){case tx:f+=D.x,h+=D.y;break;case ys:if(D.x>=0&&(g>=k||u&&(h<=S||v>=T))){E=!1;break}A(ys),d+=D.x,d<0&&(l=vs,d=-d,f-=d),u&&(m=d/u,h+=(a.height-m)/2);break;case Aa:if(D.y<=0&&(h<=S||u&&(f<=w||g>=k))){E=!1;break}A(Aa),m-=D.y,h+=D.y,m<0&&(l=Ui,m=-m,h-=m),u&&(d=m*u,f+=(a.width-d)/2);break;case vs:if(D.x<=0&&(f<=w||u&&(h<=S||v>=T))){E=!1;break}A(vs),d-=D.x,f+=D.x,d<0&&(l=ys,d=-d,f-=d),u&&(m=d/u,h+=(a.height-m)/2);break;case Ui:if(D.y>=0&&(v>=T||u&&(f<=w||g>=k))){E=!1;break}A(Ui),m+=D.y,m<0&&(l=Aa,m=-m,h-=m),u&&(d=m*u,f+=(a.width-d)/2);break;case Il:if(u){if(D.y<=0&&(h<=S||g>=k)){E=!1;break}A(Aa),m-=D.y,h+=D.y,d=m*u}else A(Aa),A(ys),D.x>=0?gS&&(m-=D.y,h+=D.y):(m-=D.y,h+=D.y);d<0&&m<0?(l=Ll,m=-m,d=-d,h-=m,f-=d):d<0?(l=jl,d=-d,f-=d):m<0&&(l=zl,m=-m,h-=m);break;case jl:if(u){if(D.y<=0&&(h<=S||f<=w)){E=!1;break}A(Aa),m-=D.y,h+=D.y,d=m*u,f+=a.width-d}else A(Aa),A(vs),D.x<=0?f>w?(d-=D.x,f+=D.x):D.y<=0&&h<=S&&(E=!1):(d-=D.x,f+=D.x),D.y<=0?h>S&&(m-=D.y,h+=D.y):(m-=D.y,h+=D.y);d<0&&m<0?(l=zl,m=-m,d=-d,h-=m,f-=d):d<0?(l=Il,d=-d,f-=d):m<0&&(l=Ll,m=-m,h-=m);break;case Ll:if(u){if(D.x<=0&&(f<=w||v>=T)){E=!1;break}A(vs),d-=D.x,f+=D.x,m=d/u}else A(Ui),A(vs),D.x<=0?f>w?(d-=D.x,f+=D.x):D.y>=0&&v>=T&&(E=!1):(d-=D.x,f+=D.x),D.y>=0?v=0&&(g>=k||v>=T)){E=!1;break}A(ys),d+=D.x,m=d/u}else A(Ui),A(ys),D.x>=0?g=0&&v>=T&&(E=!1):d+=D.x,D.y>=0?v0?l=D.y>0?zl:Il:D.x<0&&(f-=d,l=D.y>0?Ll:jl),D.y<0&&(h-=m),this.cropped||(To(this.cropBox,nn),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}E&&(a.width=d,a.height=m,a.left=f,a.top=h,this.action=l,this.renderCropBox()),pr(i,function(j){j.startX=j.endX,j.startY=j.endY})}},KVe={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&xr(this.dragBox,gf),To(this.cropBox,nn),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=Xt({},this.initialImageData),this.canvasData=Xt({},this.initialCanvasData),this.cropBoxData=Xt({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(Xt(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),To(this.dragBox,gf),xr(this.cropBox,nn)),this},replace:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&e&&(this.isImg&&(this.element.src=e),r?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,pr(this.previews,function(n){n.getElementsByTagName("img")[0].src=e}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,To(this.cropper,GO)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,xr(this.cropper,GO)),this},destroy:function(){var e=this.element;return e[Vt]?(e[Vt]=void 0,this.isImg&&this.replaced&&(e.src=this.originalUrl),this.uncreate(),this):this},move:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=this.canvasData,o=n.left,a=n.top;return this.moveTo(Bv(e)?e:o+Number(e),Bv(r)?r:a+Number(r))},moveTo:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=this.canvasData,o=!1;return e=Number(e),r=Number(r),this.ready&&!this.disabled&&this.options.movable&&(mt(e)&&(n.left=e,o=!0),mt(r)&&(n.top=r,o=!0),o&&this.renderCanvas(!0)),this},zoom:function(e,r){var n=this.canvasData;return e=Number(e),e<0?e=1/(1-e):e=1+e,this.zoomTo(n.width*e/n.naturalWidth,null,r)},zoomTo:function(e,r,n){var o=this.options,a=this.canvasData,i=a.width,l=a.height,u=a.naturalWidth,f=a.naturalHeight;if(e=Number(e),e>=0&&this.ready&&!this.disabled&&o.zoomable){var h=u*e,d=f*e;if(gc(this.element,i0,{ratio:e,oldRatio:i/u,originalEvent:n})===!1)return this;if(n){var m=this.pointers,g=VN(this.cropper),v=m&&Object.keys(m).length?jVe(m):{pageX:n.pageX,pageY:n.pageY};a.left-=(h-i)*((v.pageX-g.left-a.left)/i),a.top-=(d-l)*((v.pageY-g.top-a.top)/l)}else dc(r)&&mt(r.x)&&mt(r.y)?(a.left-=(h-i)*((r.x-a.left)/i),a.top-=(d-l)*((r.y-a.top)/l)):(a.left-=(h-i)/2,a.top-=(d-l)/2);a.width=h,a.height=d,this.renderCanvas(!0)}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return e=Number(e),mt(e)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=e%360,this.renderCanvas(!0,!0)),this},scaleX:function(e){var r=this.imageData.scaleY;return this.scale(e,mt(r)?r:1)},scaleY:function(e){var r=this.imageData.scaleX;return this.scale(mt(r)?r:1,e)},scale:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=this.imageData,o=!1;return e=Number(e),r=Number(r),this.ready&&!this.disabled&&this.options.scalable&&(mt(e)&&(n.scaleX=e,o=!0),mt(r)&&(n.scaleY=r,o=!0),o&&this.renderCanvas(!0,!0)),this},getData:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=this.options,n=this.imageData,o=this.canvasData,a=this.cropBoxData,i;if(this.ready&&this.cropped){i={x:a.left-o.left,y:a.top-o.top,width:a.width,height:a.height};var l=n.width/n.naturalWidth;if(pr(i,function(h,d){i[d]=h/l}),e){var u=Math.round(i.y+i.height),f=Math.round(i.x+i.width);i.x=Math.round(i.x),i.y=Math.round(i.y),i.width=f-i.x,i.height=u-i.y}}else i={x:0,y:0,width:0,height:0};return r.rotatable&&(i.rotate=n.rotate||0),r.scalable&&(i.scaleX=n.scaleX||1,i.scaleY=n.scaleY||1),i},setData:function(e){var r=this.options,n=this.imageData,o=this.canvasData,a={};if(this.ready&&!this.disabled&&dc(e)){var i=!1;r.rotatable&&mt(e.rotate)&&e.rotate!==n.rotate&&(n.rotate=e.rotate,i=!0),r.scalable&&(mt(e.scaleX)&&e.scaleX!==n.scaleX&&(n.scaleX=e.scaleX,i=!0),mt(e.scaleY)&&e.scaleY!==n.scaleY&&(n.scaleY=e.scaleY,i=!0)),i&&this.renderCanvas(!0,!0);var l=n.width/n.naturalWidth;mt(e.x)&&(a.left=e.x*l+o.left),mt(e.y)&&(a.top=e.y*l+o.top),mt(e.width)&&(a.width=e.width*l),mt(e.height)&&(a.height=e.height*l),this.setCropBoxData(a)}return this},getContainerData:function(){return this.ready?Xt({},this.containerData):{}},getImageData:function(){return this.sized?Xt({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,r={};return this.ready&&pr(["left","top","width","height","naturalWidth","naturalHeight"],function(n){r[n]=e[n]}),r},setCanvasData:function(e){var r=this.canvasData,n=r.aspectRatio;return this.ready&&!this.disabled&&dc(e)&&(mt(e.left)&&(r.left=e.left),mt(e.top)&&(r.top=e.top),mt(e.width)?(r.width=e.width,r.height=e.width/n):mt(e.height)&&(r.height=e.height,r.width=e.height*n),this.renderCanvas(!0)),this},getCropBoxData:function(){var e=this.cropBoxData,r;return this.ready&&this.cropped&&(r={left:e.left,top:e.top,width:e.width,height:e.height}),r||{}},setCropBoxData:function(e){var r=this.cropBoxData,n=this.options.aspectRatio,o,a;return this.ready&&this.cropped&&!this.disabled&&dc(e)&&(mt(e.left)&&(r.left=e.left),mt(e.top)&&(r.top=e.top),mt(e.width)&&e.width!==r.width&&(o=!0,r.width=e.width),mt(e.height)&&e.height!==r.height&&(a=!0,r.height=e.height),n&&(o?r.height=r.width/n:a&&(r.width=r.height*n)),this.renderCropBox()),this},getCroppedCanvas:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var r=this.canvasData,n=LVe(this.image,this.imageData,r,e);if(!this.cropped)return n;var o=this.getData(e.rounded),a=o.x,i=o.y,l=o.width,u=o.height,f=n.width/Math.floor(r.naturalWidth);f!==1&&(a*=f,i*=f,l*=f,u*=f);var h=l/u,d=Ba({aspectRatio:h,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),m=Ba({aspectRatio:h,width:e.minWidth||0,height:e.minHeight||0},"cover"),g=Ba({aspectRatio:h,width:e.width||(f!==1?n.width:l),height:e.height||(f!==1?n.height:u)}),v=g.width,w=g.height;v=Math.min(d.width,Math.max(m.width,v)),w=Math.min(d.height,Math.max(m.height,w));var S=document.createElement("canvas"),k=S.getContext("2d");S.width=_c(v),S.height=_c(w),k.fillStyle=e.fillColor||"transparent",k.fillRect(0,0,v,w);var T=e.imageSmoothingEnabled,E=T===void 0?!0:T,M=e.imageSmoothingQuality;k.imageSmoothingEnabled=E,M&&(k.imageSmoothingQuality=M);var P=n.width,D=n.height,A=a,j=i,F,O,z,G,H,q;A<=-l||A>P?(A=0,F=0,z=0,H=0):A<=0?(z=-A,A=0,F=Math.min(P,l+A),H=F):A<=P&&(z=0,F=Math.min(l,P-A),H=F),F<=0||j<=-u||j>D?(j=0,O=0,G=0,q=0):j<=0?(G=-j,j=0,O=Math.min(D,u+j),q=O):j<=D&&(G=0,O=Math.min(u,D-j),q=O);var U=[A,j,F,O];if(H>0&&q>0){var Y=v/l;U.push(z*Y,G*Y,H*Y,q*Y)}return k.drawImage.apply(k,[n].concat(RN(U.map(function(te){return Math.floor(_c(te))})))),S},setAspectRatio:function(e){var r=this.options;return!this.disabled&&!Bv(e)&&(r.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var r=this.options,n=this.dragBox,o=this.face;if(this.ready&&!this.disabled){var a=e===rx,i=r.movable&&e===LN;e=a||i?e:FN,r.dragMode=e,wu(n,bu,e),pc(n,t0,a),pc(n,r0,i),r.cropBoxMovable||(wu(o,bu,e),pc(o,t0,a),pc(o,r0,i))}return this}},ZVe=Do.Cropper,XN=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(dVe(this,t),!e||!$Ve.test(e.tagName))throw new Error("The first argument is required and must be an or element.");this.element=e,this.options=Xt({},nD,dc(r)&&r),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return pVe(t,[{key:"init",value:function(){var r=this.element,n=r.tagName.toLowerCase(),o;if(!r[Vt]){if(r[Vt]=this,n==="img"){if(this.isImg=!0,o=r.getAttribute("src")||"",this.originalUrl=o,!o)return;o=r.src}else n==="canvas"&&window.HTMLCanvasElement&&(o=r.toDataURL());this.load(o)}}},{key:"load",value:function(r){var n=this;if(r){this.url=r,this.imageData={};var o=this.element,a=this.options;if(!a.rotatable&&!a.scalable&&(a.checkOrientation=!1),!a.checkOrientation||!window.ArrayBuffer){this.clone();return}if(SVe.test(r)){kVe.test(r)?this.read(WVe(r)):this.clone();return}var i=new XMLHttpRequest,l=this.clone.bind(this);this.reloading=!0,this.xhr=i,i.onabort=l,i.onerror=l,i.ontimeout=l,i.onprogress=function(){i.getResponseHeader("content-type")!==rD&&i.abort()},i.onload=function(){n.read(i.response)},i.onloadend=function(){n.reloading=!1,n.xhr=null},a.checkCrossOrigin&&aD(r)&&o.crossOrigin&&(r=sD(r)),i.open("GET",r,!0),i.responseType="arraybuffer",i.withCredentials=o.crossOrigin==="use-credentials",i.send()}}},{key:"read",value:function(r){var n=this.options,o=this.imageData,a=HVe(r),i=0,l=1,u=1;if(a>1){this.url=UVe(r,rD);var f=qVe(a);i=f.rotate,l=f.scaleX,u=f.scaleY}n.rotatable&&(o.rotate=i),n.scalable&&(o.scaleX=l,o.scaleY=u),this.clone()}},{key:"clone",value:function(){var r=this.element,n=this.url,o=r.crossOrigin,a=n;this.options.checkCrossOrigin&&aD(n)&&(o||(o="anonymous"),a=sD(n)),this.crossOrigin=o,this.crossOriginUrl=a;var i=document.createElement("img");o&&(i.crossOrigin=o),i.src=a||n,i.alt=r.alt||"The image to crop",this.image=i,i.onload=this.start.bind(this),i.onerror=this.stop.bind(this),xr(i,XO),r.parentNode.insertBefore(i,r.nextSibling)}},{key:"start",value:function(){var r=this,n=this.image;n.onload=null,n.onerror=null,this.sizing=!0;var o=Do.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(Do.navigator.userAgent),a=function(f,h){Xt(r.imageData,{naturalWidth:f,naturalHeight:h,aspectRatio:f/h}),r.initialImageData=Xt({},r.imageData),r.sizing=!1,r.sized=!0,r.build()};if(n.naturalWidth&&!o){a(n.naturalWidth,n.naturalHeight);return}var i=document.createElement("img"),l=document.body||document.documentElement;this.sizingImage=i,i.onload=function(){a(i.width,i.height),o||l.removeChild(i)},i.src=n.src,o||(i.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",l.appendChild(i))}},{key:"stop",value:function(){var r=this.image;r.onload=null,r.onerror=null,r.parentNode.removeChild(r),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var r=this.element,n=this.options,o=this.image,a=r.parentNode,i=document.createElement("div");i.innerHTML=CVe;var l=i.querySelector(".".concat(Vt,"-container")),u=l.querySelector(".".concat(Vt,"-canvas")),f=l.querySelector(".".concat(Vt,"-drag-box")),h=l.querySelector(".".concat(Vt,"-crop-box")),d=h.querySelector(".".concat(Vt,"-face"));this.container=a,this.cropper=l,this.canvas=u,this.dragBox=f,this.cropBox=h,this.viewBox=l.querySelector(".".concat(Vt,"-view-box")),this.face=d,u.appendChild(o),xr(r,nn),a.insertBefore(l,r.nextSibling),To(o,XO),this.initPreview(),this.bind(),n.initialAspectRatio=Math.max(0,n.initialAspectRatio)||NaN,n.aspectRatio=Math.max(0,n.aspectRatio)||NaN,n.viewMode=Math.max(0,Math.min(3,Math.round(n.viewMode)))||0,xr(h,nn),n.guides||xr(h.getElementsByClassName("".concat(Vt,"-dashed")),nn),n.center||xr(h.getElementsByClassName("".concat(Vt,"-center")),nn),n.background&&xr(l,"".concat(Vt,"-bg")),n.highlight||xr(d,yVe),n.cropBoxMovable&&(xr(d,r0),wu(d,bu,tx)),n.cropBoxResizable||(xr(h.getElementsByClassName("".concat(Vt,"-line")),nn),xr(h.getElementsByClassName("".concat(Vt,"-point")),nn)),this.render(),this.ready=!0,this.setDragMode(n.dragMode),n.autoCrop&&this.crop(),this.setData(n.data),rn(n.ready)&&Pn(r,QO,n.ready,{once:!0}),gc(r,QO)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var r=this.cropper.parentNode;r&&r.removeChild(this.cropper),To(this.element,nn)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=ZVe,t}},{key:"setDefaults",value:function(r){Xt(nD,dc(r)&&r)}}])}();Xt(XN.prototype,VVe,GVe,XVe,JVe,YVe,KVe);var Cs=function(){return Cs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0&&j.zoomTo(te)}(A.currentTarget.cropper,E),S&&S(A)}}));k&&k(D)}return function(){var A,j;(j=(A=M.current)===null||A===void 0?void 0:A.cropper)===null||j===void 0||j.destroy()}},[M]);var P=function(D){return QVe.reduce(function(A,j){var F=A,O=j;return F[O],Uv(F,[typeof O=="symbol"?O:O+""])},D)}(Cs(Cs({},T),{crossOrigin:u,src:a,alt:w}));return y.createElement("div",{style:i,className:l},y.createElement("img",Cs({},P,{style:eGe,ref:M})))});const Ra={mainDiv:{width:"100%",height:"100%",overflow:"auto"},formControl:{margin:0,minWidth:120},formControlMarginRight:{marginRight:5},formControlPaddingTop:{paddingTop:6.2}},tGe={once:"once",interval:"interval",intervalBetween:"intervalBetween",specific:"specific"},zr={seconds:"seconds",minutes:"minutes"},iD=["ra_Sunday","ra_Monday","ra_Tuesday","ra_Wednesday","ra_Thursday","ra_Friday","ra_Saturday","ra_Sunday"];function So(t){return t<10?`0${t}`:`${t}`}const rGe={mode:"interval",interval:{period:1,unit:zr.minutes}};function Up(t){if(t==="*")return[0,1,2,3,4,5,6];const e=t.split(","),r=[];return e.forEach(n=>{const o=n.split("-");if(o.length===2){const a=parseInt(o[0],10),i=parseInt(o[1],10);for(let l=a;l<=i;l++)r.includes(l===7?0:l)||r.push(l===7?0:l)}else{n==="7"&&(n="0");const a=parseInt(n,10);r.includes(a)||r.push(a)}}),r.sort(),r}function JN(t,e){t=t.replace(/['"]/g,"").trim();const r=t.split(" ");let n,o=null;return r.length===6?n={seconds:r[0]||"*",minutes:r[1]||"*",hours:r[2]||"*",date:r[3]||"*",months:r[4]||"*",dow:r[5]||"*"}:n={seconds:null,minutes:r[0]||"*",hours:r[1]||"*",date:r[2]||"*",months:r[3]||"*",dow:r[4]||"*"},n.seconds===null&&n.minutes==="*"&&n.hours==="*"&&n.date==="*"&&n.months==="*"&&(n.dow==="*"||e)&&(o={mode:"interval",interval:{period:1,unit:zr.minutes}}),n.seconds==="*"&&n.minutes==="*"&&n.hours==="*"&&n.date==="*"&&n.months==="*"&&(n.dow==="*"||e)?o={mode:"interval",interval:{period:1,unit:zr.seconds}}:n.seconds===null&&n.minutes.includes("/")&&n.hours==="*"&&n.date==="*"&&n.months==="*"&&(n.dow==="*"||e)?o={mode:"interval",interval:{period:parseInt(n.minutes.split("/")[1],10),unit:zr.minutes}}:n.seconds!==null&&n.seconds.includes("/")&&n.minutes==="*"&&n.hours==="*"&&n.date==="*"&&n.months==="*"&&(n.dow==="*"||e)?o={mode:"interval",interval:{period:parseInt(n.seconds.split("/")[1],10),unit:zr.seconds}}:n.seconds!==null&&n.seconds.includes("/")&&n.minutes==="*"&&n.hours.includes("-")&&n.date==="*"&&n.months==="*"&&(n.dow==="*"||e)?o={mode:"intervalBetween",intervalBetween:{period:parseInt(n.seconds.split("/")[1],10),unit:zr.seconds,timeFrom:parseInt(n.hours.split("-")[0],10),timeTo:parseInt(n.hours.split("-")[1],10),weekdays:Up(n.dow)}}:n.seconds===null&&n.minutes.includes("/")&&n.hours.includes("-")&&n.date==="*"&&n.months==="*"&&(n.dow==="*"||e)?o={mode:"intervalBetween",intervalBetween:{period:parseInt(n.minutes.split("/")[1],10),unit:zr.minutes,timeFrom:parseInt(n.hours.split("-")[0],10),timeTo:parseInt(n.hours.split("-")[1],10),weekdays:Up(n.dow)}}:n.seconds===null&&parseInt(n.minutes,10).toString()===n.minutes&&parseInt(n.hours,10).toString()===n.hours&&n.date==="*"&&n.months==="*"&&(n.dow==="*"||e)?o={mode:"specific",specific:{time:`${So(parseInt(n.hours,10))}:${So(parseInt(n.minutes,10))}`,weekdays:Up(n.dow)}}:n.seconds===null&&parseInt(n.minutes,10).toString()===n.minutes&&parseInt(n.hours,10).toString()===n.hours&&parseInt(n.date,10).toString()===n.date&&parseInt(n.months,10).toString()===n.months&&(n.dow==="*"||e)&&(o={mode:"once",once:{time:`${So(parseInt(n.hours,10))}:${So(parseInt(n.minutes,10))}`,date:`${So(parseInt(n.date,10))}.${So(parseInt(n.months,10))}`}}),o}class xu extends y.Component{constructor(e){super(e);let r=typeof e.cronExpression=="string"?e.cronExpression.replace(/^["']/,"").replace(/["']\n?$/,""):"";r[0]==="{"&&(r="");const n=JN(r||"* * * * *",!0)||rGe;this.state={extended:!1,cron:xu.state2cron(n),mode:"interval",once:{time:"00:00",date:""},interval:{period:1,unit:zr.minutes},intervalBetween:{period:1,unit:zr.minutes,timeFrom:0,timeTo:23,weekdays:[0,1,2,3,4,5,6]},specific:{time:"00:00",weekdays:[0,1,2,3,4,5,6]}},Object.assign(this.state,n),this.state.cron!==e.cronExpression&&setTimeout(()=>e.onChange&&e.onChange(this.state.cron),100)}static periodArray2text(e,r=7){if(r=r||7,e.length===r)return"*";const n=[];let o=null,a=null;if(!e.length)return"_";for(let i=0;i60&&(n.period=60),n.period!==void 0&&n.period<1&&(n.period=1),n.minutes!==void 0&&n.minutes!==null&&n.minutes>60&&(n.minutes=60),n.minutes!==void 0&&n.minutes!==null&&n.minutes<1&&(n.minutes=1),n.hours!==void 0&&n.hours!==null&&n.hours>24&&(n.hours=24),n.hours!==void 0&&n.hours!==null&&n.hours<1&&(n.hours=1),e.extended)r=`${n.minutes!==void 0&&n.minutes!==null&&n.minutes>1?`*/${n.minutes}`:"*"} ${n.hours!==void 0&&n.hours!==null&&n.hours>1?`*/${n.hours}`:"*"} * * *`;else switch(n.unit){case zr.seconds:r=`${n.period>1?`*/${n.period}`:"*"} * * * * *`;break;case zr.minutes:r=`${n.period>1?`*/${n.period}`:"*"} * * * *`;break}}else if(e.mode==="intervalBetween"){const n=e.intervalBetween||{period:1,unit:zr.minutes,timeFrom:0,timeTo:24,weekdays:[0,1,2,3,4,5,6]};let o;switch(n.timeFrom=n.timeFrom||0,n.timeTo=n.timeTo===void 0?24:n.timeTo,n.timeFrom!==0&&n.timeTo===24&&(n.timeTo=23),n.timeFrom===0&&n.timeTo===24?o="*":o=n.timeFrom!==n.timeTo?`${n.timeFrom}-${n.timeTo}`:"*",n.period>60&&(n.period=60),n.period<1&&(n.period=1),n.unit=n.unit||zr.minutes,n.unit){case zr.seconds:r=`${n.period>1?`*/${n.period}`:"*"} * ${o} * * ${this.periodArray2text(n.weekdays)}`;break;case zr.minutes:r=`${n.period>1?`*/${n.period}`:"*"} ${o} * * ${this.periodArray2text(n.weekdays)}`;break}}else if(e.mode==="specific"){const n=e.specific||{time:"00:00",weekdays:[0,1,2,3,4,5,6]},o=(n.time||"00:00").split(":");let a=parseInt(o[1],10)||0;a>59&&(a=59),a<0&&(a=0);let i=parseInt(o[0],10)||0;i>23&&(i=59),i<0&&(i=0),r=`${a} ${i} * * ${this.periodArray2text(n.weekdays||[])}`}else if(e.mode==="once"){const n=e.once||{time:"00:00",date:""};n.date||(n.date=`${new Date().getDate()}.${So(new Date().getMonth()+1)}`);const o=(n.time||"00:00").split(":"),a=n.date.split(".");let i=parseInt(o[1],10)||0;i>59&&(i=59),i<0&&(i=0);let l=parseInt(o[0],10)||0;l>23&&(l=59),l<0&&(l=0);let u=parseInt(a[0],10)||1;u>31&&(u=31),u<1&&(l=1);let f=parseInt(a[1],10)||1;f>12&&(f=12),f<1&&(f=1),r=`${i} ${l} ${u} ${f} *`}return r}recalcCron(){this.onChange(xu.state2cron(this.state))}getControlsWeekdaysElements(e){const r=e==="intervalBetween"?this.state.intervalBetween:this.state.specific;return y.createElement("div",{key:"weekdays",style:{paddingLeft:8,width:"calc(100% - 8px)",maxWidth:600}},y.createElement("h5",null,R.t("ra_On weekdays")),[1,2,3,4,5,6,0].map(n=>y.createElement(lt,{key:iD[n],control:y.createElement(wr,{checked:r.weekdays.includes(n),onChange:o=>{const a=JSON.parse(JSON.stringify(this.state[e])),i=a.weekdays.indexOf(n);o.target.checked?i===-1&&a.weekdays.push(n):i!==-1&&a.weekdays.splice(i,1),a.weekdays.sort(),e==="intervalBetween"?this.setState({intervalBetween:a},()=>this.recalcCron()):this.setState({specific:a},()=>this.recalcCron())},value:n.toString()}),label:R.t(iD[n])})))}getControlsPeriodElements(e){const r=e==="interval"?this.state.interval:this.state.intervalBetween;return this.state.extended?y.createElement("div",{key:"period",style:{paddingLeft:8,display:"inline-block"}},y.createElement("h5",{style:{marginBottom:5}},R.t("sc_period")),y.createElement(dr,{variant:"standard",style:{marginTop:0,marginBottom:0,verticalAlign:"bottom"},key:"value",label:R.t("sc_minutes"),value:r.minutes,onChange:n=>{const o=JSON.parse(JSON.stringify(this.state[e]));o.minutes=parseInt(n.target.value,10),o.minutes<1&&(o.minutes=1),e==="interval"?this.setState({interval:o},()=>this.recalcCron()):this.setState({intervalBetween:o},()=>this.recalcCron())},slotProps:{htmlInput:{min:1,max:60},inputLabel:{shrink:!0}},type:"number",margin:"normal"}),y.createElement(dr,{variant:"standard",style:{marginTop:0,marginBottom:0,verticalAlign:"bottom"},key:"value",label:R.t("sc_hours"),value:r.hours,onChange:n=>{const o=JSON.parse(JSON.stringify(this.state[e]));o.hours=parseInt(n.target.value,10),o.hours<1&&(o.hours=1),e==="interval"?this.setState({interval:o},()=>this.recalcCron()):this.setState({intervalBetween:o},()=>this.recalcCron())},slotProps:{htmlInput:{min:1,max:24},inputLabel:{shrink:!0}},type:"number",margin:"normal"})):y.createElement("div",{key:"period",style:{paddingLeft:8,display:"inline-block"}},y.createElement("h5",{style:{marginBottom:5}},R.t("sc_period")),y.createElement(dr,{variant:"standard",style:{marginTop:0,marginBottom:0,verticalAlign:"bottom"},key:"value",label:R.t("sc_every"),value:r.period,onChange:n=>{const o=JSON.parse(JSON.stringify(this.state[e]));o.period=parseInt(n.target.value,10),o.period<1&&(o.period=1),e==="interval"?this.setState({interval:o},()=>this.recalcCron()):this.setState({intervalBetween:o},()=>this.recalcCron())},slotProps:{htmlInput:{min:1,max:60},inputLabel:{shrink:!0}},type:"number",margin:"normal"}),y.createElement(gn,{variant:"standard",style:{verticalAlign:"bottom"},value:r.unit,onChange:n=>{const o=JSON.parse(JSON.stringify(this.state[e]));o.unit=n.target.value,e==="interval"?this.setState({interval:o},()=>this.recalcCron()):this.setState({intervalBetween:o},()=>this.recalcCron())}},y.createElement(Zt,{value:"seconds"},R.t("sc_seconds")),")",y.createElement(Zt,{value:"minutes"},R.t("sc_minutes")),")"))}getControlsTime(e){const r=e==="once"?this.state.once:this.state.specific;return y.createElement(ta,{variant:"standard",sx:{...Ra.formControl,"&.MuiFormControl-root":Ra.formControlMarginRight}},y.createElement(dr,{variant:"standard",key:"at",label:R.t("sc_time"),value:r.time,type:"time",sx:n=>({'& input[type="time"]::-webkit-calendar-picker-indicator':{filter:n.palette.mode==="dark"?"invert(80%)":void 0}}),onChange:n=>{const o=JSON.parse(JSON.stringify(this.state[e]));o.time=n.target.value,e==="once"?this.setState({once:o},()=>this.recalcCron()):this.setState({specific:o},()=>this.recalcCron())},slotProps:{inputLabel:{shrink:!0}},margin:"normal"}))}getControlsDate(){const e=this.state.once;if(!e.date){const r=new Date;e.date=`${r.getDate()}.${So(r.getMonth()+1)}`}return y.createElement(ta,{variant:"standard",style:Ra.formControl},y.createElement(dr,{variant:"standard",key:"date",label:R.t("sc_date"),value:e.date,type:"text",slotProps:{htmlInput:{style:Ra.formControlPaddingTop},inputLabel:{shrink:!0}},onChange:r=>{const n=JSON.parse(JSON.stringify(this.state.once));n.date=r.target.value,this.setState({once:n},()=>this.recalcCron())},margin:"normal"}))}getOnceElements(){return y.createElement("div",{style:{marginLeft:8}},this.getControlsTime("once"),this.getControlsDate())}getIntervalElements(){return this.getControlsPeriodElements("interval")}getIntervalBetweenElements(){const e=this.state.intervalBetween;return[this.getControlsPeriodElements("intervalBetween"),y.createElement("div",{key:"between",style:{paddingLeft:8,display:"inline-block",verticalAlign:"top"}},y.createElement("h5",{style:{marginBottom:5}},R.t("sc_hours")),y.createElement(ta,{variant:"standard",style:Ra.formControl},y.createElement(ru,{shrink:!0,htmlFor:"age-label-placeholder"},R.t("sc_from")),y.createElement(gn,{variant:"standard",style:{width:100},value:e.timeFrom,onChange:r=>{const n=JSON.parse(JSON.stringify(this.state.intervalBetween));n.timeFrom=parseInt(r.target.value,10),n.timeTo===24&&(n.timeTo=23),this.setState({intervalBetween:n},()=>this.recalcCron())}},[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23].map(r=>y.createElement(Zt,{key:`B_${r}`,value:r},`${So(r)}:00`)))),y.createElement(ta,{variant:"standard",style:Ra.formControl},y.createElement(ru,{shrink:!0,htmlFor:"age-label-placeholder"},R.t("sc_to")),y.createElement(gn,{variant:"standard",style:{width:100},value:e.timeTo,onChange:r=>{const n=JSON.parse(JSON.stringify(this.state.intervalBetween));n.timeTo=parseInt(r.target.value,10),this.setState({intervalBetween:n},()=>this.recalcCron())}},[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23].map(r=>y.createElement(Zt,{key:`A_${r}`,value:r},`${So(r)}:00`)),!e.timeFrom&&y.createElement(Zt,{value:24},"00:00")))),this.getControlsWeekdaysElements("intervalBetween")]}getSpecificTimeElements(){return[y.createElement("div",{key:"time",style:{marginLeft:8}},this.getControlsTime("specific")),this.getControlsWeekdaysElements("specific")]}onModeChange(e){e!==this.state.mode&&this.setState({mode:e},()=>this.recalcCron())}onChange(e){e!==this.state.cron&&(this.setState({cron:e}),this.props.onChange&&this.props.onChange(e))}render(){return y.createElement("div",{style:Ra.mainDiv},y.createElement("div",{style:{paddingLeft:8,width:"calc(100% - 8px)"}},y.createElement(dr,{variant:"standard",style:{width:"100%"},value:this.state.cron,disabled:!0,error:this.state.cron.includes("_")})),y.createElement("div",{style:{paddingLeft:8,width:"calc(100% - 8px)",height:60}},this.state.cron.includes("_")?R.t("sc_invalid_cron"):vN(this.state.cron,this.props.language||"en")),y.createElement("div",null,y.createElement(ta,{variant:"standard",style:{...Ra.formControl,marginLeft:8,marginTop:8}},y.createElement(ru,null,R.t("ra_Repeat")),y.createElement(gn,{variant:"standard",value:this.state.mode,onChange:e=>this.onModeChange(e.target.value),inputProps:{name:"mode",id:"mode"}},y.createElement(Zt,{value:"once"},R.t("sc_once")),y.createElement(Zt,{value:"interval"},R.t("sc_interval")),y.createElement(Zt,{value:"intervalBetween"},R.t("sc_intervalBetween")),y.createElement(Zt,{value:"specific"},R.t("sc_specific"))))),this.state.mode===tGe.once&&this.getOnceElements(),this.state.mode==="interval"&&this.getIntervalElements(),this.state.mode==="intervalBetween"&&this.getIntervalBetweenElements(),this.state.mode==="specific"&&this.getSpecificTimeElements())}}const nGe={headerID:{fontWeight:"bold",fontStyle:"italic"},radio:{display:"inline-block"},dialogPaper:{height:"calc(100% - 96px)"}};class Cst extends y.Component{constructor(e){super(e);let r;this.props.cron&&typeof this.props.cron=="string"&&this.props.cron.replace(/^["']/,"")[0]!=="{"?r=this.props.cron.replace(/['"]/g,"").trim():(r=this.props.cron||"{}",typeof r=="string"&&(r=r.replace(/^["']/,"").replace(/["']\n?$/,""))),this.state={showWarning:"",cron:r}}handleCancel(){this.props.onClose()}handleOk(e){if(!e){const r=La.cron2state(this.state.cron);if(r.seconds==="*"||r.seconds==="*/1"){this.setState({showWarning:"everySecond"});return}if(r.minutes==="*"||r.minutes==="*/1"){this.setState({showWarning:"everyMinute"});return}}this.props.onOk(this.state.cron),this.props.onClose()}renderWarningDialog(){return this.state.showWarning?y.createElement(gP,{title:R.t("ra_Please confirm"),text:R.t(this.state.showWarning==="everySecond"?"ra_The schedule will be executed every second. Are you sure?":"ra_The schedule will be executed every minute. Are you sure?"),onClose:e=>this.setState({showWarning:""},()=>{e&&this.handleOk(!0)})}):null}handleClear(){this.props.onOk(!1),this.props.onClose()}render(){return y.createElement(oo,{onClose:()=>{},maxWidth:"md",fullWidth:!0,sx:{"& .MuiDialog-paper":nGe.dialogPaper},open:!0,"aria-labelledby":"cron-dialog-title"},this.renderWarningDialog(),y.createElement(io,{id:"cron-dialog-title"},this.props.title||R.t("ra_Define schedule...")),y.createElement(so,{style:{height:"100%",overflow:"hidden"}},y.createElement(La,{cronExpression:this.state.cron,onChange:e=>this.setState({cron:e}),language:R.getLanguage()})),y.createElement(ao,null,!!this.props.clearButton&&y.createElement(jt,{color:"grey",variant:"contained",onClick:()=>this.handleClear(),startIcon:y.createElement(nu,null)},this.props.clear||R.t("ra_Clear")),y.createElement(jt,{variant:"contained",onClick:()=>this.handleOk(),color:"primary",startIcon:y.createElement(Ys,null)},this.props.ok||R.t("ra_Ok")),y.createElement(jt,{color:"grey",variant:"contained",onClick:()=>this.handleCancel(),startIcon:y.createElement(Gf,null)},this.props.cancel||R.t("ra_Cancel"))))}}const oGe={dialogPaper:{height:"calc(100% - 96px)"}};class Est extends y.Component{constructor(e){super(e);let r;this.props.cron&&typeof this.props.cron=="string"&&this.props.cron.replace(/^["']/,"")[0]!=="{"?r=this.props.cron.replace(/['"]/g,"").trim():(r=this.props.cron||"{}",typeof r=="string"&&(r=r.replace(/^["']/,"").replace(/["']\n?$/,""))),this.state={cron:r,mode:this.props.simple?"simple":this.props.complex?"complex":(typeof r=="object"||r[0]==="{")&&!this.props.noWizard?"wizard":JN(this.props.cron||"* * * * *")?"simple":"complex"}}handleCancel(){this.props.onClose()}handleOk(){this.props.onOk(this.state.cron),this.props.onClose()}setMode(e){this.setState({mode:e})}render(){return y.createElement(oo,{onClose:()=>{},maxWidth:"md",fullWidth:!0,sx:{"& .MuiDialog-paper":oGe.dialogPaper},open:!0,"aria-labelledby":"cron-dialog-title"},y.createElement(io,{id:"cron-dialog-title"},this.props.title||R.t("ra_Define schedule...")),y.createElement(so,{style:{height:"100%",overflow:"hidden"}},this.props.simple&&this.props.complex||!this.props.simple&&!this.props.complex?y.createElement("div",null,!this.props.simple&&!this.props.complex&&!this.props.noWizard&&y.createElement(y.Fragment,null,y.createElement(Lt,{key:"wizard",checked:this.state.mode==="wizard",onChange:()=>this.setMode("wizard")}),y.createElement("label",{onClick:()=>this.setMode("wizard"),style:this.state.mode!=="wizard"?{color:"lightgrey"}:{}},R.t("sc_wizard"))),(!this.props.simple&&!this.props.complex||this.props.simple)&&y.createElement(y.Fragment,null,y.createElement(Lt,{key:"simple",checked:this.state.mode==="simple",onChange:()=>this.setMode("simple")}),y.createElement("label",{onClick:()=>this.setMode("simple"),style:this.state.mode!=="simple"?{color:"lightgrey"}:{}},R.t("sc_simple"))),(!this.props.simple&&!this.props.complex||this.props.complex)&&y.createElement(y.Fragment,null,y.createElement(Lt,{key:"complex",checked:this.state.mode==="complex",onChange:()=>this.setMode("complex")}),y.createElement("label",{onClick:()=>this.setMode("complex"),style:this.state.mode!=="complex"?{color:"lightgrey"}:{}},R.t("sc_cron")))):null,this.state.mode==="simple"&&y.createElement(xu,{cronExpression:this.state.cron,onChange:e=>this.setState({cron:e}),language:R.getLanguage()}),this.state.mode==="wizard"&&y.createElement(Cr,{theme:this.props.theme,schedule:this.state.cron,onChange:e=>this.setState({cron:e})}),this.state.mode==="complex"&&y.createElement(La,{cronExpression:this.state.cron,onChange:e=>this.setState({cron:e}),language:R.getLanguage()})),y.createElement(ao,null,y.createElement(jt,{variant:"contained",onClick:()=>this.handleOk(),color:"primary",startIcon:y.createElement(Ys,null)},this.props.ok||R.t("ra_Ok")),y.createElement(jt,{variant:"contained",onClick:()=>this.handleCancel(),color:"grey",startIcon:y.createElement(Gf,null)},this.props.cancel||R.t("ra_Cancel"))))}}const bs={headerID:{fontWeight:"bold",fontStyle:"italic"},dialog:{height:"95%"},dialogMobile:{padding:"4px",width:"100%",maxWidth:"100%",maxHeight:"calc(100% - 16px)",height:"100%"},content:{height:"100%",overflow:"hidden"},contentMobile:{padding:"8px 4px"},titleRoot:{whiteSpace:"nowrap",width:"calc(100% - 72px)",overflow:"hidden",display:"inline-block",textOverflow:"ellipsis"}};class Tst extends y.Component{constructor(r){super(r);ue(this,"dialogName");ue(this,"filters");this.dialogName=this.props.dialogName||"default",this.dialogName=`SelectFile.${this.dialogName}`;const n=(window._localStorage||window.localStorage).getItem(this.dialogName)||"{}";try{this.filters=JSON.parse(n)}catch{this.filters={}}r.filters&&(this.filters={...this.filters,...r.filters});let o=this.props.selected||[];typeof o!="object"?o=[o]:o=[...o],o=o.filter(a=>a),this.state={selected:o}}handleCancel(){this.props.onClose()}handleOk(){this.props.onOk(this.props.multiSelect||!Array.isArray(this.state.selected)?this.state.selected:this.state.selected[0]||""),this.props.onClose()}render(){let r;return this.state.selected.length?!Array.isArray(this.state.selected)||this.state.selected.length===1?r=[y.createElement("span",{key:"selected"},R.t("ra_Selected")," "),y.createElement("span",{key:"id",style:bs.headerID},this.state.selected)]:r=[y.createElement("span",{key:"selected"},R.t("ra_Selected")," "),y.createElement("span",{key:"id",style:bs.headerID},R.t("%s items",this.state.selected.length))]:r=this.props.title||R.t("ra_Please select file..."),y.createElement(oo,{onClose:()=>{},maxWidth:!1,sx:{"& .MuiDialog-paper":{...bs.dialog,...bs.dialogMobile}},fullWidth:!0,open:!0,"aria-labelledby":"ar_dialog_selectfile_title"},y.createElement(io,{id:"ar_dialog_selectfile_title",sx:{"&.MuiDialogTitle-root":bs.titleRoot}},r),y.createElement(so,{style:{...bs.content,...bs.contentMobile}},y.createElement(rVe,{ready:!0,imagePrefix:this.props.imagePrefix||this.props.prefix||"../",allowUpload:!!this.props.allowUpload,allowDownload:this.props.allowDownload!==!1,allowCreateFolder:!!this.props.allowCreateFolder,allowDelete:!!this.props.allowDelete,allowView:this.props.allowView!==!1,showViewTypeButton:this.props.showViewTypeButton!==!1,showToolbar:this.props.showToolbar!==!1,limitPath:this.props.limitPath,filterFiles:this.props.filterFiles,filterByType:this.props.filterByType,selected:this.props.selected,restrictToFolder:this.props.restrictToFolder,allowNonRestricted:this.props.allowNonRestricted,onSelect:(n,o,a)=>{this.setState({selected:Array.isArray(n)?n:[n]},()=>o&&(!this.props.selectOnlyFolders||a)&&this.handleOk())},t:this.props.t||R.t,lang:this.props.lang||R.getLanguage(),socket:this.props.socket,themeType:this.props.themeType,themeName:this.props.themeName,theme:this.props.theme,showExpertButton:this.props.showExpertButton,expertMode:this.props.expertMode,showTypeSelector:this.props.showTypeSelector})),y.createElement(ao,null,y.createElement(jt,{variant:"contained",onClick:()=>this.handleOk(),startIcon:y.createElement(Ys,null),disabled:!this.state.selected.length,color:"primary"},this.props.ok||R.t("ra_Ok")),y.createElement(jt,{color:"grey",variant:"contained",onClick:()=>this.handleCancel(),startIcon:y.createElement(Gf,null)},this.props.cancel||R.t("ra_Cancel"))))}}const aGe={dialogPaper:{height:"calc(100% - 96px)"}};class Ost extends y.Component{constructor(e){super(e);let r;this.props.cron&&typeof this.props.cron=="string"&&this.props.cron.replace(/^["']/,"")[0]!=="{"?r=this.props.cron.replace(/['"]/g,"").trim():(r=this.props.cron||"{}",typeof r=="string"&&(r=r.replace(/^["']/,"").replace(/["']\n?$/,""))),this.state={cron:r}}handleCancel(){this.props.onClose()}handleOk(){this.props.onOk(this.state.cron),this.props.onClose()}render(){return y.createElement(oo,{onClose:()=>{},maxWidth:"md",fullWidth:!0,sx:{"& .MuiDialog-paper":aGe.dialogPaper},open:!0,"aria-labelledby":"cron-dialog-title"},y.createElement(io,{id:"cron-dialog-title"},this.props.title||R.t("ra_Define CRON...")),y.createElement(so,{style:{height:"100%",overflow:"hidden"}},y.createElement(xu,{cronExpression:this.state.cron,onChange:e=>this.setState({cron:e}),language:R.getLanguage()})),y.createElement(ao,null,y.createElement(jt,{variant:"contained",disabled:!this.state.cron||this.state.cron.includes("_"),onClick:()=>this.handleOk(),color:"primary",startIcon:y.createElement(Ys,null)},this.props.ok||R.t("ra_Ok")),y.createElement(jt,{variant:"contained",onClick:()=>this.handleCancel(),color:"grey",startIcon:y.createElement(Gf,null)},this.props.cancel||R.t("ra_Cancel"))))}}var YN={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},cD=y.createContext&&y.createContext(YN),sGe=["attr","size","title"];function iGe(t,e){if(t==null)return{};var r=cGe(t,e),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function cGe(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function yf(){return yf=Object.assign?Object.assign.bind():function(t){for(var e=1;ey.createElement(e.tag,vf({key:r},e.attr),KN(e.child)))}function pGe(t){return e=>y.createElement(fGe,yf({attr:vf({},t.attr)},e),KN(t.child))}function fGe(t){var e=r=>{var{attr:n,size:o,title:a}=t,i=iGe(t,sGe),l=o||r.size||"1em",u;return r.className&&(u=r.className),t.className&&(u=(u?u+" ":"")+t.className),y.createElement("svg",yf({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,i,{className:u,style:vf(vf({color:t.color||r.color},r.style),t.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),a&&y.createElement("title",null,a),t.children)};return cD!==void 0?y.createElement(cD.Consumer,null,r=>e(r)):e(YN)}function hGe(t){return pGe({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"},child:[]}]})(t)}const ai=({message:t,onClose:e})=>t?$.jsx(bb,{anchorOrigin:{vertical:"bottom",horizontal:"center"},open:!0,autoHideDuration:6e3,onClose:e,ContentProps:{"aria-describedby":"message-id"},message:$.jsx("span",{id:"message-id",children:R.t(t)}),action:[$.jsx(lr,{"aria-label":"Close",color:"inherit",onClick:e,children:$.jsx(hGe,{})},"close")]}):null;ai.defaultProps={message:"",onClose:()=>{}};ai.propTypes={onClose:V.func,message:V.string};const ox=({open:t,close:e,children:r,titleButton:n,titleButton2:o,buttonClick:a})=>$.jsxs(oo,{open:t,maxWidth:"md",onClose:e,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[$.jsx(io,{id:"alert-dialog-title",children:R.t("Warning")}),$.jsx(so,{children:r}),$.jsxs(ao,{children:[n&&$.jsx(jt,{color:"grey",variant:"contained",onClick:a,children:n}),o&&$.jsx(jt,{variant:"contained",onClick:e,color:"primary",autoFocus:!0,children:o})]})]});ox.defaultProps={open:!1,buttonClick:()=>{},close:()=>{}};ox.propTypes={open:V.bool,close:V.func,children:V.any,titleButton:V.string,titleButton2:V.string,buttonClick:V.func};const Hv={input:{minWidth:300},inputNumber:{minWidth:150},icon:{width:24,height:24,marginRight:8}},ea=({table:t,value:e,title:r,attr:n,options:o,style:a,native:i,onChange:l,noTranslate:u,themeType:f,sx:h})=>$.jsxs(ta,{style:{...Hv.input,paddingTop:5,...a},sx:h,children:[$.jsx(gn,{variant:"standard",value:t?e:i[n]||"_",onChange:d=>{t?l(d.target.value):l(n,d.target.value==="_"?"":d.target.value)},renderValue:d=>{const m=o.find(g=>g.value===d);return m?$.jsxs($.Fragment,{children:[$.jsx(Dc,{src:m.icon||"",style:Hv.icon}),u?m.title:R.t(m.title)]}):d},input:$.jsx(Zn,{name:n,id:`${n}-helper`}),children:o.map(d=>$.jsxs(Zt,{value:d.value||"_",style:d.color?{color:d.color,backgroundColor:tt.getInvertedColor(d.color,f)}:{},children:[$.jsx(Dc,{src:d.icon||"",style:Hv.icon}),u?d.title:R.t(d.title)]},`key-${d.value}`))}),$.jsx(Au,{children:r?R.t(r):""})]});ea.defaultProps={value:"",table:!1};ea.propTypes={title:V.string,attr:V.string,options:V.array.isRequired,style:V.object,sx:V.object,value:V.any,table:V.bool,native:V.object.isRequired,onChange:V.func,noTranslate:V.bool,themeType:V.string};const qv={input:{minWidth:300},inputNumber:{minWidth:150},heightInput:{height:30}},Us=({styleComponentBlock:t,component:e,size:r,variant:n,table:o,value:a,title:i,attr:l,type:u,style:f,native:h,onChange:d})=>$.jsxs(ta,{style:{...u==="number"?qv.inputNumber:qv.input,paddingTop:5,...f},children:[$.jsx(dr,{error:!1,variant:n||"standard",value:o?a:h[l],type:u,helperText:"",style:{...qv.heightInput,...f},onChange:m=>{o?d(m.target.value):d(l,m.target.value)},margin:"normal",size:r}),$.jsxs("div",{style:t,children:[$.jsx(Au,{style:{marginTop:-3},children:i?R.t(i):""}),e]})]});Us.defaultProps={value:"",type:"text",table:!1,native:{},variant:"standard",size:"medium",component:null,styleComponentBlock:null};Us.propTypes={title:V.string,attr:V.string,type:V.string,table:V.bool,value:V.string,variant:V.string,size:V.string,style:V.object,native:V.object,onChange:V.func,component:V.object,styleComponentBlock:V.object};const gr=({title:t,attr:e,style:r,native:n,sx:o,onChange:a,table:i,checked:l,disabled:u,help:f})=>{let h=i?l:n[e];return e==="whiteListEnabled"&&n.socketio&&(h=!1),$.jsxs(Lp,{children:[$.jsx(lt,{style:{paddingTop:5,...r},sx:o,control:$.jsx(wr,{disabled:!!u,checked:!!h,onChange:d=>{i?a(d.target.checked):a(e,!n[e])},color:"primary"}),label:t?R.t(t):""},e),f?$.jsx(Au,{children:f}):null]})};gr.defaultProps={table:!1};gr.propTypes={title:V.string,attr:V.string.isRequired,style:V.object,native:V.object.isRequired,onChange:V.func,table:V.bool,help:V.string};const Jo={blockWrapper:{display:"flex",flexDirection:"column",mr:"20px","@media screen and (max-width: 360px)":{mr:0}},tab:{width:"100%",minHeight:"100%"},column:{display:"inline-block",verticalAlign:"top",marginRight:20},columnSettings:{width:"calc(100% - 10px)"},blockWrapperCheckbox:{display:"flex",flexFlow:"wrap"},ipInputStyle:{mt:"10px",width:600,mr:"20px","@media screen and (max-width: 940px)":{width:"100%"}},blockWarning:{background:"#2196f3",color:"#fff",margin:"20px 2px",padding:8,fontSize:20},blockWarningContent:{flexFlow:"wrap",display:"flex",alignItems:"flex-end"}};class ZN extends C.Component{constructor(e){super(e),this.state={toast:"",ipAddressOptions:[],certificatesOptions:[],usersOptions:[],socketioOptions:[{title:R.t("nothing"),value:"none"},{title:R.t("built_in"),value:"_"}],openModal:!1,ready:!1,confirmSocketIO:!1}}componentDidMount(){const{socket:e,common:{host:r}}=this.props,{socketioOptions:n}=this.state;e.getAdapterInstances("socketio").then(async o=>{const a=await e.getAdapterInstances("ws");a&&(o=o.concat(a));const i={ready:!0,socketioOptions:[...n,...o.map(({_id:u,common:{name:f}})=>({title:`${f} [${f}.${u.split(".").pop()}]`,value:u}))]},l=await e.getHostByIp(r);l.forEach(u=>{u.title=u.name,u.title.includes("Listen on all IPs")&&(u.title=u.title.replace("Listen on all IPs",R.t("open_ip"))),u.value=u.address}),i.ipAddressOptions=l,i.certificatesOptions=await e.getCertificates(),i.usersOptions=await e.getUsers(),this.setState(i)})}componentDidUpdate(e){const{native:{auth:r,secure:n}}=e,{native:{defaultUser:o,whiteListSettings:a},onChange:i}=this.props;!this.props.native.auth&&r!==this.props.native.auth?i("whiteListSettings.default.user",o):a&&a.default.user!=="auth"&&r!==this.props.native.auth&&i("whiteListSettings.default.user","auth"),o!==e.native.defaultUser&&i("whiteListSettings.default.user",o),!this.props.native.secure&&this.props.native.auth&&!this.state.openModal&&(r!==this.props.native.auth||n!==this.props.native.secure)&&this.setState({openModal:!0})}renderConfirmDialog(){return $.jsxs(oo,{open:this.state.confirmSocketIO,maxWidth:"md",onClose:()=>this.setState({confirmSocketIO:!1}),"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[$.jsx(io,{id:"alert-dialog-title",children:R.t("Warning")}),$.jsxs(so,{children:[R.t("whitelist_only_with_integrated_socket"),$.jsx("br",{}),R.t("White list will be disabled. Please confirm.")]}),$.jsxs(ao,{children:[$.jsx(jt,{variant:"contained",color:"primary",autoFocus:!0,onClick:()=>{this.props.onChange("whiteListEnabled",!1,()=>this.props.onChange("socketio",this.state.confirmValue,()=>this.setState({confirmSocketIO:!1})))},children:R.t("Ok")}),$.jsx(jt,{color:"grey",variant:"contained",onClick:()=>this.setState({confirmSocketIO:!1}),children:R.t("Cancel")})]})]})}render(){var v;const{instance:e,common:r,native:n,onLoad:o,onChange:a}=this.props,{certificatesOptions:i,ipAddressOptions:l,usersOptions:u,openModal:f,toast:h,socketioOptions:d,ready:m}=this.state;if(!m)return $.jsx($M,{});const g=JSON.parse(JSON.stringify(r));return g.icon=g.extIcon,$.jsxs("form",{style:Jo.tab,children:[$.jsx(ai,{message:h,onClose:()=>this.setState({toast:""})}),this.renderConfirmDialog(),$.jsx(ox,{open:f,buttonClick:()=>{a("auth",!1),this.setState({openModal:!f,toast:"Authentication_deactivated"})},close:()=>this.setState({openModal:!f}),titleButton:R.t("button_title"),titleButton2:R.t("button_title2"),children:$.jsxs("div",{style:Jo.blockWarningContent,children:[$.jsx(xH,{style:{width:32,height:32}}),R.t("modal_title")]})}),$.jsx(Zw,{instance:e,common:g,native:n,onError:w=>console.error(w),onLoad:o}),$.jsxs("div",{style:{...Jo.column,...Jo.columnSettings},children:[$.jsxs("div",{children:[$.jsx(ea,{title:"IP address",attr:"bind",noTranslate:!0,sx:Jo.ipInputStyle,options:l,native:n,onChange:a}),$.jsx(Us,{title:"port",attr:"port",type:"number",style:{marginTop:5},native:n,onChange:a})]}),$.jsxs("div",{style:Jo.blockWrapperCheckbox,children:[$.jsxs(pt,{component:"div",sx:Jo.blockWrapper,children:[$.jsx(gr,{title:"encryption",attr:"secure",style:{marginTop:10},native:n,onChange:a}),$.jsx(gr,{title:"authentication",attr:"auth",style:{marginTop:10},native:n,onChange:a}),n.auth?$.jsx(gr,{title:"basic_authentication",attr:"basicAuth",style:{marginTop:10},native:n,onChange:a}):null,$.jsx(gr,{title:"cache",attr:"cache",style:{marginTop:10},native:n,onChange:a}),$.jsx(ea,{title:"socket",attr:"socketio",noTranslate:!0,options:d,style:{marginTop:10},native:n,onChange:(w,S,k)=>{S&&n.whiteListEnabled?this.setState({confirmSocketIO:!0,confirmValue:S}):a(w,S,k)}}),n.socketio?null:$.jsx(gr,{title:"usePureWebSockets",attr:"usePureWebSockets",style:{marginTop:10},native:n,onChange:a}),(!n.socketio||n.socketio.startsWith("system.adapter.socket"))&&!n.usePureWebSockets?$.jsx(gr,{title:"web_sockets",help:(v=n.socketio)!=null&&v.startsWith("system.adapter.socket")?R.t("Same settings must be set in socketio instance"):"",attr:"forceWebSockets",style:{marginTop:10},native:n,onChange:a}):null]}),$.jsxs(pt,{component:"div",sx:Jo.blockWrapper,children:[n.secure?$.jsxs("div",{style:Jo.blockWrapperCheckbox,children:[$.jsx(ea,{title:"public_certificate",attr:"certPublic",noTranslate:!0,options:[{title:R.t("nothing"),value:""},...i.filter(({type:w})=>!w||w==="public").map(({name:w})=>({title:w,value:w}))],style:{marginTop:10,marginRight:20},native:n,onChange:a}),$.jsx(ea,{title:"private_certificate",attr:"certPrivate",noTranslate:!0,options:[{title:R.t("nothing"),value:""},...i.filter(({type:w})=>!w||w==="private").map(({name:w})=>({title:w,value:w}))],style:{marginTop:10,marginRight:20},native:n,onChange:a}),$.jsx(ea,{title:"chained_certificate",attr:"certChained",noTranslate:!0,options:[{title:R.t("nothing"),value:""},...i.filter(({type:w})=>!w||w==="chained").map(({name:w})=>({title:w,value:w}))],style:{marginTop:10},native:n,onChange:a})]}):null,n.auth?null:$.jsx(ea,{title:"users",attr:"defaultUser",themeType:this.props.themeType,noTranslate:!0,options:u.map(({_id:w,common:{name:S,color:k,icon:T}})=>({title:typeof S=="object"?S[this.props.lang]||S.end||w.replace(/^system\.user\./,""):S,value:w.replace(/^system\.user\./,""),color:k,icon:T})),style:{marginTop:10,width:300},native:n,onChange:a}),n.auth?$.jsx(Us,{title:"time_out",attr:"ttl",type:"number",style:{marginTop:-1,width:300},native:n,onChange:a}):null,$.jsx(gr,{title:"simple_api",attr:"simpleapi",style:{marginTop:10},native:n,onChange:a}),$.jsx(gr,{title:"Do not check if this instance is available from internet",attr:"doNotCheckPublicIP",style:{marginTop:10},native:n,onChange:a})]})]})]})]})}}ZN.propTypes={common:V.object.isRequired,native:V.object.isRequired,instance:V.number.isRequired,onLoad:V.func,onChange:V.func,socket:V.object.isRequired,themeType:V.string};class mGe extends C.Component{render(){return $.jsx("div",{style:{fontSize:20},children:R.t("Use %s adapter to get letsencrypt certificates.","iobroker.acme")})}}const _r={backgroundTheme:t=>({background:t.palette.mode==="dark"?"#3e3838":"#dcdcdc"}),tab:{width:"100%",minHeight:"100%"},button:{marginRight:20,marginBottom:40},column:{display:"inline-block",verticalAlign:"top"},columnSettings:{width:"100%"},table:{minWidth:700,"& td":{p:"2px"},"@media screen and (max-width: 1700px)":{"& th":{p:"2px"}},"@media screen and (max-width: 1280px)":{minWidth:300}},displayNone:{display:"none"},checkBoxStyle:{marginLeft:0,marginRight:0},miniTable:{display:"none","@media screen and (max-width: 1280px)":{display:"block"}},card:{padding:1,margin:"20px 0",border:"1px solid",borderRadius:10,display:"flex",flexDirection:"column",alignItems:"center"},maxTable:{"@media screen and (max-width: 1280px)":{display:"none"}},miniTableSelect:{"@media screen and (max-width: 1280px)":{minWidth:185}},warning:{color:"#FF4040",fontSize:18,display:"inline-block"}},_Ge={user:"admin",object:{read:!0,list:!0,write:!0,delete:!0},state:{read:!0,list:!0,write:!0,create:!0,delete:!0},file:{read:!0,list:!0,write:!0,create:!0,delete:!0}};class Su extends C.Component{constructor(e){if(super(e),this.state={toast:"",usersOptions:[]},e.native.bind&&e.native.bind!=="localhost"&&e.native.bind!=="0.0.0.0"){const r=e.native.bind.split(".");r.pop(),this.ipPrefix=r.join(".")}}componentDidMount(){this.props.socket.getUsers().then(e=>{this.ipPrefix||this.props.socket.getObject(`system.adapter.${this.props.adapterName}.${this.props.instance}`).then(r=>{this.props.socket.getIpAddresses(r.common.host).then(n=>{if(n=n.filter(o=>o.includes(".")),n.length){const o=n[0].split(".");o.pop(),this.ipPrefix=o.join(".")}else this.ipPrefix="192.168.0"})}),this.setState({usersOptions:e})})}static getText(e){return typeof e=="string"?e:e[R.getLanguage()]||e.en}userSelect(e,r){const{native:n,onChange:o}=this.props,{usersOptions:a}=this.state,{whiteListSettings:i}=n;if(e==="default")return i[e].user;const l=i.default.user==="auth"?[{title:"auth",value:"auth"}]:[];return $.jsx(ea,{table:!0,value:i[e].user,options:[...l,...a.map(({_id:u,common:{name:f}})=>({title:Su.getText(f),value:u.replace("system.user.","")}))],native:n,sx:{..._r.miniTableSelect,...r},noTranslate:!0,onChange:u=>{const f=JSON.parse(JSON.stringify(i));f[e].user=u,o("whiteListSettings",f)}})}tableInput(e,r){const{native:n,onChange:o}=this.props,{whiteListSettings:a}=n;return e==="default"?$.jsx("div",{style:{padding:"10px 0"},children:e}):$.jsx(Us,{table:!0,value:e,style:r,onChange:i=>{const l=JSON.parse(JSON.stringify(a)),u={};Object.keys(l).forEach(f=>{f===e?u[i]=l[f]:u[f]=l[f]}),Su.validateIp(i)?o("whiteListSettings",u):this.setState({toast:"incorrect_ip"})}})}buttonAdd(){const{native:e,onChange:r}=this.props,{whiteListSettings:n}=e;return $.jsx(lr,{color:"primary",onClick:()=>{let o=JSON.parse(JSON.stringify(n)),a=1,i=`${this.ipPrefix}.1`;const l=()=>{Object.keys(o).find(u=>u===i)&&(i=`${this.ipPrefix}.${a}`,a+=1,l())};l(),o={[i]:_Ge,...o},r("whiteListSettings",o)},children:$.jsx(eH,{})})}buttonRemove(e){const{native:r,onChange:n}=this.props,{whiteListSettings:o}=r;return $.jsx(lr,{color:"primary",onClick:()=>{const a=JSON.parse(JSON.stringify(o));delete a[e],n("whiteListSettings",a)},style:e==="default"?{display:"none"}:null,"aria-label":"delete",children:$.jsx(nu,{})})}static validateIp(e){return e.indexOf("*")!==-1&&e.lastIndexOf(".")>e.indexOf("*")?!1:/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9-]*[A-Za-z0-9])$|^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/.test(e.replace("*","111"))}render(){const{native:e,onChange:r}=this.props,{whiteListSettings:n}=e,{toast:o}=this.state,a=["to_read","list","write","delete","to_read","list","write","to_create","delete","to_read","list","write","to_create","delete"];return $.jsxs("form",{style:_r.tab,children:[$.jsx(ai,{message:o,onClose:()=>this.setState({toast:""})}),$.jsxs("div",{style:{..._r.column,..._r.columnSettings,position:"relative"},children:[$.jsx(gr,{title:"included",attr:"whiteListEnabled",disabled:this.props.native.socketio,native:e,onChange:(i,l)=>r(i,l,()=>{l&&!e.whiteListSettings&&r("whiteListSettings",{default:{user:"auth"}})})}),this.props.native.socketio?$.jsx("span",{style:_r.warning,children:R.t("whitelist_only_with_integrated_socket")}):null,!this.props.native.socketio&&n?$.jsx("div",{style:e.whiteListEnabled?null:_r.displayNone,children:$.jsxs(t9,{style:{overflowX:"visible"},component:Ha,children:[$.jsxs(g$,{sx:{..._r.table,..._r.maxTable},"aria-label":"spanning table",children:[$.jsxs(w$,{children:[$.jsxs(Ai,{children:[$.jsx(Qr,{align:"center",rowSpan:2,children:this.buttonAdd()}),$.jsx(Qr,{align:"center",rowSpan:2,style:{fontWeight:"bold"},children:"IP"}),$.jsx(Qr,{align:"center",rowSpan:2,style:{fontWeight:"bold"},children:R.t("user")}),$.jsx(Qr,{align:"center",colSpan:4,style:{fontWeight:"bold"},children:R.t("object")}),$.jsx(Qr,{align:"center",colSpan:5,style:{fontWeight:"bold"},children:R.t("status")}),$.jsx(Qr,{align:"center",colSpan:5,style:{fontWeight:"bold"},children:R.t("file")})]}),$.jsx(Ai,{children:a.map((i,l)=>$.jsx(Qr,{align:"center",children:R.t(i)},`${i}_${l}_max`))})]}),$.jsx(v$,{children:Object.keys(n).map((i,l)=>$.jsxs(Ai,{children:[$.jsx(Qr,{sx:_r.backgroundTheme,style:{borderBottom:"1px solid #afafaf"},children:this.buttonRemove(i)}),$.jsx(Qr,{sx:_r.backgroundTheme,style:{borderBottom:"1px solid #afafaf",color:i==="default"?"#006ccd":void 0},title:i==="default"?R.t("If no IP address matches, show authentication dialog"):"",children:this.tableInput(i,{marginTop:0,minWidth:150,paddingTop:0})}),$.jsx(Qr,{sx:_r.backgroundTheme,style:{borderBottom:"1px solid #afafaf"},children:this.userSelect(i,{marginTop:-1})}),["object","state","file"].map((u,f)=>Object.keys(n[i][u]||{}).map(h=>$.jsx(Qr,{sx:f%2?_r.backgroundTheme:void 0,style:{borderBottom:f%2?"1px solid #afafaf":null},align:"center",children:$.jsx(gr,{table:!0,checked:n[i][u][h],attr:h,native:e,style:_r.checkBoxStyle,onChange:d=>{const m=JSON.parse(JSON.stringify(n));m[i][u][h]=d,r("whiteListSettings",m)}})},`${u}_${h}_max`)))]},`${l}_max`))})]}),$.jsxs(pt,{component:"div",sx:_r.miniTable,children:[$.jsx(pt,{component:"div",sx:_r.backgroundTheme,style:{position:"sticky",top:-10,left:12,zIndex:22,borderBottom:"1px solid"},children:this.buttonAdd()}),$.jsx("div",{children:Object.keys(n).map((i,l)=>$.jsxs(pt,{component:"div",sx:tt.getStyle(this.props.theme,_r.card,l%2?_r.backgroundTheme:null),children:[$.jsxs("div",{style:{width:"100%",lineHeight:"30px",textAlign:"center"},children:[$.jsx("span",{children:this.buttonRemove(i)}),$.jsxs("span",{style:{marginLeft:10},children:["IP:",this.tableInput(i,{marginTop:-5,minWidth:150,marginLeft:5,verticalAlign:"middle"})]}),$.jsxs("span",{style:{marginLeft:20},children:[R.t("user"),":"," ",this.userSelect(i,{marginTop:-10,marginLeft:5,verticalAlign:"middle"})]})]}),["object","state","file"].map((u,f)=>{const h=[...a].splice(f===0?0:4,f===0?4:5);return $.jsxs(g$,{sx:_r.table,style:{width:"inherit"},"aria-label":"spanning table",children:[$.jsxs(w$,{children:[$.jsx(Ai,{children:$.jsx(Qr,{style:{background:"#bbbbbb"},align:"center",colSpan:Object.keys(n[i][u]||{}).length,children:R.t(["object","status","file"][f])})}),$.jsx(Ai,{children:h.map((d,m)=>$.jsx(Qr,{align:"center",children:R.t(d)},`${d}_${m}_mini`))})]}),$.jsx(v$,{children:$.jsx(Ai,{children:Object.keys(n[i][u]||{}).map(d=>$.jsx(Qr,{align:"center",children:$.jsx(gr,{table:!0,checked:n[i][u][d],attr:d,native:e,style:_r.checkBoxStyle,onChange:m=>{const g=JSON.parse(JSON.stringify(n));g[i][u][d]=m,r("whiteListSettings",g)}})},`${u}_${d}_mini_check`))})})]},`${f}_mini`)})]},`${l}_wrapper`))})]})]})}):null]})]})}}Su.propTypes={native:V.object.isRequired,instance:V.number.isRequired,adapterName:V.string.isRequired,onChange:V.func,theme:V.object,socket:V.object.isRequired};const uD={root:{"& > *":{m:"8px"}},input:{display:"none"}},gGe=({title:t,onChange:e})=>{const[r,n]=C.useState("");return $.jsxs(pt,{component:"div",sx:uD.root,children:[$.jsx("input",{accept:"image/*",style:uD.input,id:"contained-button-file",multiple:!0,type:"file",onChange:o=>e(o.target.files[0]||o.dataTransfer.files[0],a=>n(a))}),$.jsxs("label",{htmlFor:"contained-button-file",children:[$.jsx(jt,{variant:"contained",color:"primary",component:"span",children:R.t(t)}),$.jsx(dr,{variant:"standard",style:{marginLeft:20},value:r})]})]})},Hi={tab:{width:"100%",minHeight:"100%"},column:{display:"inline-block",verticalAlign:"top",marginRight:20},columnSettings:{width:"calc(100% - 10px)"},dropZone:{mt:"30px",width:600,border:"2px dashed #bbb",borderRadius:"5px",p:"25px",textAlign:"center",fontSize:"20pt",fontWeight:"bold",fontFamily:"Arial",color:"#bbb",minWidth:320,minHeight:200,transition:"background 1s","&:focus":{outline:"inherit"},"@media screen and (max-width: 680px)":{width:"calc(100% - 45px)",minWidth:200,"& img":{width:"100%"}}},dropZoneActive:{background:"#d6d6d69c"},imgStyle:{maxWidth:500,maxHeight:500}};class QN extends C.Component{constructor(e){super(e),this.state={imgSRC:"",toast:""}}componentDidMount(){this.readFile()}readFile(){const{socket:e,instance:r}=this.props;e.getRawSocket().emit("readFile",`web.${r}`,"login-bg.png",(n,o)=>{if(!n&&o){const a=new Uint8Array(o);if(!a.length)this.setState({imgSRC:`../../files/web.${r}/login-bg.png?ts=${Date.now()}`});else{const i=new Blob([a],{type:"image/png"}),u=(window.URL||window.webkitURL).createObjectURL(i);this.setState({imgSRC:u})}}else this.setState({imgSRC:""})})}uploadFile(e,r){const{socket:n,instance:o}=this.props;if(!e)return;if(e.size>5*1024*1024){this.setState({toast:`File ${e.name} is too big. Maximum 5MB`}),this.setState({imgSRC:""}),r&&r("");return}const a=new FileReader;a.onload=({target:{result:i}})=>{n.getRawSocket().emit("writeFile",`web.${o}`,"login-bg.png",i,()=>this.readFile())},r&&r(e.name),a.readAsArrayBuffer(e)}render(){const{native:e,onChange:r}=this.props,{imgSRC:n,toast:o}=this.state;return $.jsxs("form",{style:Hi.tab,children:[$.jsx(ai,{message:o,onClose:()=>this.setState({toast:""})}),$.jsxs("div",{style:{...Hi.column,...Hi.columnSettings},children:[$.jsx("div",{children:$.jsx(Us,{styleComponentBlock:{height:20,display:"flex",justifyContent:"center",alignItems:"center"},component:$.jsx(Us,{attr:"loginBackgroundColorHelper",type:"color",style:{marginTop:-1,marginLeft:10,minWidth:60},native:e,onChange:async(a,i)=>{await r("loginBackgroundColorHelper",i),await r("loginBackgroundColor",i)},variant:"outlined",size:"small"}),title:"color",attr:"loginBackgroundColor",style:{marginTop:-1,marginBottom:20},native:e,onChange:async(a,i)=>{await r("loginBackgroundColorHelper",i),await r("loginBackgroundColor",i)}})}),$.jsx("div",{children:$.jsx(gr,{title:"background_image",attr:"loginBackgroundImage",native:e,onChange:r})}),$.jsxs("div",{style:e.loginBackgroundImage?{display:"block"}:{display:"none"},children:[$.jsx("div",{children:$.jsx(gGe,{title:"upload_image",attr:"files",native:e,onChange:(a,i)=>this.uploadFile(a,i)})}),$.jsx(Uu,{accept:"image/*",onDrop:a=>this.uploadFile(a[0]),children:({getRootProps:a,getInputProps:i,isDragActive:l})=>$.jsx("section",{children:$.jsxs(pt,{component:"div",sx:{...Hi.dropZone,...l?Hi.dropZoneActive:void 0},...a(),children:[$.jsx("input",{...i()}),$.jsx("p",{children:R.t("place_the_files_here")}),n?$.jsx("img",{style:Hi.imgStyle,src:n,alt:"img"}):null]})})})]})]})]})}}QN.propTypes={common:V.object.isRequired,native:V.object.isRequired,instance:V.number.isRequired,adapterName:V.string.isRequired,onError:V.func,onLoad:V.func,onChange:V.func,changed:V.bool,socket:V.object.isRequired};const ws={tab:{width:"100%",minHeight:"100%"},column:{display:"inline-block",verticalAlign:"top",marginRight:20},columnSettings:{width:"calc(100% - 10px)"},fontSize:{"@media screen and (max-width: 460px)":{"& > *":{fontSize:"3.2vw"}}}},yGe=[{value:"",label:"System language",translate:!0},{value:"en",label:"English"},{value:"de",label:"Deutsch"},{value:"ru",label:"русский"},{value:"pt",label:"Portugues"},{value:"nl",label:"Nederlands"},{value:"fr",label:"français"},{value:"it",label:"Italiano"},{value:"es",label:"Espanol"},{value:"pl",label:"Polski"},{value:"uk",label:"Українська мова"},{value:"zh-ch",label:"简体中文"}];class eA extends C.Component{render(){const{native:e,onChange:r}=this.props;return $.jsx("form",{style:ws.tab,children:$.jsxs("div",{style:{...ws.column,...ws.columnSettings},children:[$.jsx("h4",{children:R.t("disable_default")}),$.jsx("p",{children:R.t("warning_incorrectly")}),$.jsx("div",{children:$.jsx(gr,{title:"disable_extensions",attr:"disableExtensions",sx:ws.fontSize,native:e,onChange:r})}),$.jsx("div",{children:$.jsx(gr,{title:"disable_states",attr:"disableStates",sx:ws.fontSize,native:e,onChange:r})}),$.jsx("div",{children:$.jsx(gr,{title:"disable_files",attr:"disableFilesObjects",sx:ws.fontSize,native:e,onChange:r})}),e.disableFilesObjects?null:$.jsx("div",{children:$.jsx(gr,{title:"show_folders",attr:"showFolderIndex",sx:ws.fontSize,native:e,onChange:r})}),$.jsx("h4",{children:R.t("Redirect options")}),$.jsx("div",{children:$.jsx(dr,{variant:"standard",value:e.defaultRedirect||"",onChange:n=>r("defaultRedirect",n.target.value),label:R.t("defaultRedirect"),helperText:R.t("This path will be opened if no path specified")})}),$.jsx("h4",{children:R.t("Cache options")}),$.jsx("div",{children:$.jsx(dr,{variant:"standard",value:e.staticAssetCacheMaxAge,onChange:n=>r("staticAssetCacheMaxAge",n.target.value),label:R.t("staticAssetCacheMaxAge"),helperText:R.t("in seconds")})}),$.jsx("h4",{children:R.t("Language")}),$.jsx("div",{children:$.jsxs(ta,{variant:"standard",style:{width:250},children:[$.jsx(ru,{children:R.t("Overload system language")}),$.jsx(gn,{value:e.language||"",label:R.t("Overload system language"),onChange:n=>r("language",n.target.value),children:yGe.map(n=>$.jsx(Zt,{value:n.value,children:n.translate?R.t(n.label):n.label},n.value))}),$.jsx(Au,{children:R.t("only for this instance")})]})})]})})}}eA.propTypes={native:V.object.isRequired,onChange:V.func};const Vv={tab:{width:"100%",minHeight:"100%"},column:{display:"inline-block",verticalAlign:"top"},columnSettings:{width:"100%"}};let tA=class extends C.Component{constructor(e){super(e),this.state={toast:"",groups:null,users:null},this.lang=R.getLanguage()}async componentDidMount(){const e=await this.props.socket.getUsers(),r=await this.props.socket.getGroups();this.setState({users:e,groups:r})}render(){const{native:e,onChange:r}=this.props,{userListSettings:n}=e,{toast:o}=this.state;return $.jsxs("form",{style:Vv.tab,children:[$.jsx(ai,{message:o,onClose:()=>this.setState({toast:""})}),$.jsxs("div",{style:{...Vv.column,...Vv.columnSettings,position:"relative"},children:[$.jsx(gr,{title:"included",attr:"userListEnabled",native:e,onChange:(a,i)=>r(a,i,()=>{i&&!e.userListSettings&&r("userListSettings",{accessAsUser:"system.user.admin",users:["system.user.admin"],groups:["system.group.administrator"]})})}),n&&this.state.users?$.jsxs("div",{children:[$.jsxs("div",{children:[R.t("Only following users may access web interface as"),$.jsxs(gn,{style:{marginLeft:10,marginRight:10},variant:"standard",value:e.userListSettings.accessAsUser||"_",onChange:a=>{const i=JSON.parse(JSON.stringify(e.userListSettings));i.accessAsUser=a.target.value==="_"||!a.target.value?"":a.target.value,r("userListSettings",i)},renderValue:a=>{if(!a||a==="_")return R.t("logged in user");const i=this.state.users.find(l=>l._id===a);return i?$.jsx(Wi,{value:i,lang:this.lang}):a},children:[$.jsx(Zt,{value:"_",children:R.t("logged in user")}),this.state.users.map(a=>$.jsx(Zt,{value:a._id,children:$.jsx(Wi,{value:a,lang:this.lang})},a._id))]}),R.t("after authentication"),":"]}),$.jsxs("div",{style:{display:"flex",width:"100%",maxWidth:1024,flexDirection:"row"},children:[$.jsxs("div",{style:{display:"flex",width:"calc(50% - 20px)",maxWidth:512,flexDirection:"column"},children:[$.jsx("div",{style:{fontSize:24,fontWeight:"bold",marginLeft:8},children:R.t("Groups")}),this.state.groups.map(a=>$.jsxs(Ha,{style:{width:"calc(100% - 40px)",margin:10,padding:10},children:[$.jsxs("div",{style:{display:"flex"},children:[$.jsx(wr,{disabled:a._id==="system.group.administrator",onChange:()=>{const i=JSON.parse(JSON.stringify(e.userListSettings)),l=i.groups.indexOf(a._id);l!==-1?i.groups.splice(l,1):(i.groups.push(a._id),i.groups.sort()),r("userListSettings",i)},checked:e.userListSettings.groups.includes(a._id)}),$.jsx(Wi,{value:a,lang:this.lang})]}),$.jsxs("div",{style:{display:"flex",marginLeft:12},children:[$.jsx("span",{style:{marginRight:8},children:R.t("Group members:")}),a.common.members.map(i=>{const l=this.state.users.find(u=>u._id===i);return l?$.jsx(Wi,{value:l,lang:this.lang},i):$.jsx("span",{children:i},i)})]})]},a._id))]}),$.jsxs("div",{style:{display:"flex",width:"calc(50% - 20px)",maxWidth:512,flexDirection:"column"},children:[$.jsx("div",{style:{fontSize:24,fontWeight:"bold",marginLeft:8},children:R.t("Users")}),this.state.users.map(a=>{const i=!!e.userListSettings.groups.find(l=>{const u=this.state.groups.find(f=>f._id===l);return u&&u.common.members.includes(a._id)});return $.jsxs(Ha,{style:{width:"calc(100% - 40px)",margin:10,padding:10},children:[$.jsxs("div",{style:{display:"flex"},children:[$.jsx(wr,{disabled:a._id==="system.user.admin"||i,onChange:()=>{const l=JSON.parse(JSON.stringify(e.userListSettings)),u=l.users.indexOf(a._id);u!==-1?l.users.splice(u,1):(l.users.push(a._id),l.users.sort()),r("userListSettings",l)},checked:e.userListSettings.users.includes(a._id)||i}),$.jsx(Wi,{value:a,lang:this.lang})]}),$.jsxs("div",{style:{display:"flex",marginLeft:12},children:[$.jsx("span",{style:{marginRight:8},children:R.t("In groups:")}),this.state.groups.filter(l=>l.common.members.includes(a._id)).map(l=>$.jsx(Wi,{value:l,lang:this.lang},l._id))]})]},a._id)})]})]})]}):null]})]})}};tA.propTypes={native:V.object.isRequired,onChange:V.func,socket:V.object.isRequired};const vGe="Main settings",bGe="Port",wGe="Secure (HTTPS)",xGe="Authentication",SGe="Basic Authentication",kGe="Cache",$Ge="Socket.IO Instance (Optional): (Used by adapters like rickshaw or vis)",CGe="'Public' certificate",EGe="Login timeout (sec)",TGe="Built-in 'Simple-API'",OGe="Force Web-Sockets",DGe="Private certificate",MGe="Chained certificate",PGe="Run as",NGe="itegrated",AGe="none",RGe="Listen on all IPs",IGe="Let`s encrypt certificates",jGe="Use Let's Encrypt certificates",zGe="Use this instance for automatic update",LGe="Port to check the domain",FGe="Click for help",BGe="Access list",WGe="User",UGe="object",HGe="state",qGe="file",VGe="read",GGe="list",XGe="write",JGe="create",YGe="Enabled",KGe="Background",ZGe="Background color of the login screen",QGe="Background image",eXe="Upload image",tXe="place the files here",rXe="Disable authentication",nXe="Ignore warning",oXe="Warning!",aXe="The password will be sent via unsecure connection. To protect your passwords enable the secure connection (HTTPS)!",sXe="Authentication was deactivated",iXe="The provided IP is not valid",cXe="Use Lets Encrypt staging (for testing/debug. Only for developer)",lXe="Advanced",uXe="Disable Default Functions",dXe="Warning: Incorrectly disabling functions use can cause unexpected behaviour.",pXe="Disable extension handling",fXe="Disable states and socket info",hXe="Do not serve web files from ioBroker storage",mXe="Set certificates or load it first in the system settings (right top).",_Xe="Default redirect path",gXe="White list works only with integrated socket-io interface",yXe="Ok",vXe="Cancel",bXe="Use pure web-sockets (iobroker.ws)",wXe="Cache max age for files",xXe="Language",SXe="Show folders content",kXe="User access list",$Xe="Groups",CXe="Users",EXe={main_settings:vGe,port:bGe,encryption:wGe,authentication:xGe,basic_authentication:SGe,cache:kGe,socket:$Ge,public_certificate:CGe,time_out:EGe,simple_api:TGe,web_sockets:OGe,private_certificate:DGe,chained_certificate:MGe,users:PGe,built_in:NGe,nothing:AGe,open_ip:RGe,certificates:IGe,use_certificates:jGe,renew_certificates:zGe,domain_name:LGe,link:FGe,whiteList:BGe,user:WGe,object:UGe,status:HGe,file:qGe,to_read:VGe,list:GGe,write:XGe,to_create:JGe,delete:"delete",included:YGe,background:KGe,color:ZGe,background_image:QGe,upload_image:eXe,place_the_files_here:tXe,button_title:rXe,button_title2:nXe,Warning:oXe,modal_title:aXe,Authentication_deactivated:sXe,incorrect_ip:iXe,use_lets:cXe,additionally:lXe,disable_default:uXe,warning_incorrectly:dXe,disable_extensions:pXe,disable_states:fXe,disable_files:hXe,set_certificates:mXe,"IP address":"Bound IP address","Redirect options":"Redirect options",defaultRedirect:_Xe,"This path will be opened if no path specified":"This path will be opened if no URL path specified",whitelist_only_with_integrated_socket:gXe,"White list will be disabled. Please confirm.":"White list will be disabled. Please confirm.",Ok:yXe,Cancel:vXe,usePureWebSockets:bXe,"If no IP address matches, show authentication dialog":"If no IP address matches, show authentication dialog","Compatibility mode with socket.io@2.x":"Compatibility mode with socket.io@2.x","Same settings must be set in socketio instance":"Same settings must be set in socketio instance",staticAssetCacheMaxAge:wXe,"in seconds":"in seconds","Cache options":"Cache options","Overload system language":"Overload system language","only for this instance":"only for this instance","System language":"System language","Use %s adapter to get letsencrypt certificates.":"Use %s adapter to get letsencrypt certificates.",Language:xXe,show_folders:SXe,"Do not check if this instance is available from internet":"Do not check if this instance is available from internet",UserList:kXe,"Only following users may access web interface as":"Only following users may access web interface as","logged in user":"logged in user","after authentication":"after authentication",Groups:$Xe,"Group members:":"Group members:",Users:CXe,"In groups:":"In groups:"},TXe="Allgemeine Einstellungen",OXe="Port",DXe="Verschlüsselte Verbindung (HTTPS)",MXe="Authentifikation",PXe="Basic-Authentifizierung",NXe="Cache",AXe="socket.io Instanz (Optional): (Wird von Rickshaw oder Vis benutzt)",RXe="Öffentliches Zertifikat",IXe="Anmelde Timeout (Sek.)",jXe="Eingebautes 'Simple-API'",zXe="Web-Sockets erzwingen",LXe="Privates Zertifikat",FXe="Verkettetes Zertifikat",BXe="Ausführen als",WXe="integriert",UXe="keins",HXe="Zugriff von allen IPs zulassen",qXe="Let's Encrypt Zertifikate",VXe="Let's Encrypt Zertifikate verwenden",GXe="Diese Instanz für automatische Updates verwenden",XXe="Port um die Domain zu prüfen",JXe="Anklicken für Hilfe",YXe="Zugangsliste",KXe="Benutzer",ZXe="Objekt",QXe="Zustand",eJe="Datei",tJe="lesen",rJe="auflisten",nJe="schreiben",oJe="erstellen",aJe="Aktiviert",sJe="Hintergrund",iJe="Hintergrundfarbe des Anmeldebildschirms",cJe="Hintergrundbild",lJe="Bild hochladen",uJe="Dateien hier platzieren",dJe="Authentifizierung deaktivieren",pJe="Warnung ignorieren",fJe="Warnung!",hJe="Das Passwort wird über unsichere Verbindung gesendet. Um Ihre Passwörter zu schützen, aktivieren Sie die sichere HTTPS Verbindung!",mJe="Die Authentifizierung wurde deaktiviert",_Je="Die angegebene IP-Adresse ist ungültig",gJe="Lets Encrypt Staging verwenden (nur zum Testen oder Debuggen. Nur für Entwickler)",yJe="Extra",vJe="Standardfunktionen deaktivieren",bJe="Warnung: Das fehlerhafte Deaktivieren von Funktionen kann zu unerwartetem Verhalten führen.",wJe="Erweiterungsbehandlung deaktivieren",xJe="Zustände und Socket Informationen deaktivieren",SJe="Webdateien aus dem ioBroker-Speicherbereich nicht bereitstellen",kJe="Zertifikate wählen bzw. Zertifikate in den Systemeinstellungen (oben rechts) hinterlegen.",$Je="Standardweiterleitungspfad",CJe="Whitelist funktioniert nur mit integrierter Socket-io-Schnittstelle",EJe="Ok",TJe="Abbrechen",OJe="Reine Web-Sockets (iobroker.ws) verwenden",DJe="Cache-Maximalalter für Dateien",MJe="Sprache",PJe="Ordnerinhalt anzeigen",NJe="Benutzerzugriffsliste",AJe="Gruppen",RJe="Benutzer",IJe={main_settings:TXe,port:OXe,encryption:DXe,authentication:MXe,basic_authentication:PXe,cache:NXe,socket:AXe,public_certificate:RXe,time_out:IXe,simple_api:jXe,web_sockets:zXe,private_certificate:LXe,chained_certificate:FXe,users:BXe,built_in:WXe,nothing:UXe,open_ip:HXe,certificates:qXe,use_certificates:VXe,renew_certificates:GXe,domain_name:XXe,link:JXe,whiteList:YXe,user:KXe,object:ZXe,status:QXe,file:eJe,to_read:tJe,list:rJe,write:nJe,to_create:oJe,delete:"Löschen",included:aJe,background:sJe,color:iJe,background_image:cJe,upload_image:lJe,place_the_files_here:uJe,button_title:dJe,button_title2:pJe,Warning:fJe,modal_title:hJe,Authentication_deactivated:mJe,incorrect_ip:_Je,use_lets:gJe,additionally:yJe,disable_default:vJe,warning_incorrectly:bJe,disable_extensions:wJe,disable_states:xJe,disable_files:SJe,set_certificates:kJe,"IP address":"Gebundene IP-Adresse","Redirect options":"Weiterleitungsoptionen",defaultRedirect:$Je,"This path will be opened if no path specified":"Dieser Pfad wird geöffnet, wenn kein URL-Pfad angegeben ist",whitelist_only_with_integrated_socket:CJe,"White list will be disabled. Please confirm.":"Weiße Liste wird deaktiviert. Bitte bestätigen.",Ok:EJe,Cancel:TJe,usePureWebSockets:OJe,"If no IP address matches, show authentication dialog":"Wenn keine IP-Adresse übereinstimmt, Authentifizierungsdialog anzeigen","Compatibility mode with socket.io@2.x":"Kompatibilitätsmodus mit socket.io@2.x","Same settings must be set in socketio instance":"Dieselben Einstellungen müssen in der Socketio-Instanz festgelegt werden",staticAssetCacheMaxAge:DJe,"in seconds":"in Sekunden","Cache options":"Cache-Optionen","Overload system language":"Systemsprache überladen","only for this instance":"nur für diesen Fall","System language":"Systemsprache","Use %s adapter to get letsencrypt certificates.":"Verwenden Sie den %s-Adapter, um letsencrypt-Zertifikate zu erhalten.",Language:MJe,show_folders:PJe,"Do not check if this instance is available from internet":"Nicht überprüfen, ob diese Instanz im Internet verfügbar ist",UserList:NJe,"Only following users may access web interface as":"Nur folgende Benutzer dürfen auf die Weboberfläche zugreifen als","logged in user":"Angemeldeter Benutzer","after authentication":"nach der Authentifizierung",Groups:AJe,"Group members:":"Gruppenmitglieder:",Users:RJe,"In groups:":"In Gruppen:"},jJe="Основные настройки",zJe="Порт",LJe="Шифрование (HTTPS)",FJe="Аутентификация",BJe="Basic-Аутентификация",WJe="Кэш",UJe="Socket.IO экземпляр (опционально): (Используется для Rickshaw или Vis)",HJe="'Public' сертификат",qJe="Тайм-аут входа (сек)",VJe="Встроенный 'Simple-API'",GJe="Только Web-Sockets",XJe="'Private' сертификат",JJe="'Chained' сертификат",YJe="Запустить от пользователя",KJe="встроенный",ZJe="ничего",QJe="Открыть для всех IP адресов",eYe="Let`s encrypt сертификаты",tYe="Использовать сертификаты Let`s Encrypt",rYe="Обновлять сертификаты в этом экземпляре",nYe="Порт для проверки доменного имени",oYe="Перейти по ссылке",aYe="Список доступа",sYe="Пользователь",iYe="объект",cYe="статус",lYe="файл",uYe="читать",dYe="список",pYe="писать",fYe="создать",hYe="Включено",mYe="Фон",_Ye="Цвет фона экрана входа в систему",gYe="Фоновое изображение",yYe="Загрузить изображение",vYe="переместите файлы сюда",bYe="Отключить аутентификацию",wYe="Игнорировать предупреждение",xYe="Внимание!",SYe="Пароль будет отправлен через незащищенное соединение. Для защиты ваших паролей активируйте безопасное соединение (HTTPS)!",kYe="Аутентификация была отключена",$Ye="Неверный IP-адрес",CYe="Используйте Lets Encrypt staging (для тестирования/отладки. Только для разработчиков)",EYe="Дополнительно",TYe="Отключить функции по умолчанию",OYe="Внимание: неправильное отключение использования функций может вызвать непредвиденное поведение.",DYe="Отключить обработку расширений",MYe="Отключить состояния и информацию о сокете",PYe="Не обслуживать веб-файлы из objectDB",NYe="Нужно выбрать сертификаты или сначала загрузить их в системных настройках.",AYe="Путь перенаправления по умолчанию",RYe="Белый список работает только со встроенным интерфейсом socket-io",IYe="Ok",jYe="Отмена",zYe="Использовать чистые веб-сокеты (iobroker.ws)",LYe="Максимальный возраст кэша для файлов",FYe="Язык",BYe="Показать содержимое папок",WYe="Список доступа пользователей",UYe="Группы",HYe="Пользователи",qYe={main_settings:jJe,port:zJe,encryption:LJe,authentication:FJe,basic_authentication:BJe,cache:WJe,socket:UJe,public_certificate:HJe,time_out:qJe,simple_api:VJe,web_sockets:GJe,private_certificate:XJe,chained_certificate:JJe,users:YJe,built_in:KJe,nothing:ZJe,open_ip:QJe,certificates:eYe,use_certificates:tYe,renew_certificates:rYe,domain_name:nYe,link:oYe,whiteList:aYe,user:sYe,object:iYe,status:cYe,file:lYe,to_read:uYe,list:dYe,write:pYe,to_create:fYe,delete:"удалить",included:hYe,background:mYe,color:_Ye,background_image:gYe,upload_image:yYe,place_the_files_here:vYe,button_title:bYe,button_title2:wYe,Warning:xYe,modal_title:SYe,Authentication_deactivated:kYe,incorrect_ip:$Ye,use_lets:CYe,additionally:EYe,disable_default:TYe,warning_incorrectly:OYe,disable_extensions:DYe,disable_states:MYe,disable_files:PYe,set_certificates:NYe,"IP address":"Связанный IP-адрес","Redirect options":"Варианты перенаправления",defaultRedirect:AYe,"This path will be opened if no path specified":"Этот путь будет открыт, если не указан URL-путь",whitelist_only_with_integrated_socket:RYe,"White list will be disabled. Please confirm.":"Белый список будет отключен. Пожалуйста подтвердите.",Ok:IYe,Cancel:jYe,usePureWebSockets:zYe,"If no IP address matches, show authentication dialog":"Если нет совпадений IP-адресов, показать диалоговое окно аутентификации","Compatibility mode with socket.io@2.x":"Режим совместимости с socket.io@2.x","Same settings must be set in socketio instance":"Те же настройки должны быть установлены в экземпляре socketio",staticAssetCacheMaxAge:LYe,"in seconds":"в секундах","Cache options":"Параметры кэша","Overload system language":"Перегрузить системный язык","only for this instance":"только для этого экземпляра","System language":"Язык системы","Use %s adapter to get letsencrypt certificates.":"Используйте адаптер %s для получения сертификатов letsencrypt.",Language:FYe,show_folders:BYe,"Do not check if this instance is available from internet":"Не проверять, доступен ли этот экземпляр из Интернета",UserList:WYe,"Only following users may access web interface as":"Только следующие пользователи могут получить доступ к веб-интерфейсу, как","logged in user":"вошедший в систему пользователь","after authentication":"после аутентификации",Groups:UYe,"Group members:":"Участники группы:",Users:HYe,"In groups:":"В группах:"},VYe="Configurações principais",GYe="Porta",XYe="Seguro (HTTPS)",JYe="Autenticação",YYe="Autenticação Básica",KYe="Cache",ZYe="Socket.IO Instance (Optional): (Usado por adaptadores como rickshaw ou vis)",QYe="Certificado público",eKe="Tempo limite de login (seg)",tKe="Build-in 'Simple-API'",rKe="Forçar Web-Sockets",nKe="Certificado privado",oKe="Certificado acorrentado",aKe="Correr como",sKe="integrado",iKe="ninguna",cKe="Ouça todos os IPs",lKe="Let's Encrypt Certificados",uKe="Use Vamos criptografar certificados",dKe="Use esta instância para atualização automática",pKe="Porta para verificar o domínio",fKe="Clique para ajuda",hKe="Lista de acesso",mKe="Do utilizador",_Ke="objeto",gKe="Estado",yKe="Arquivo",vKe="ler",bKe="Lista",wKe="wrire",xKe="crio",SKe="Ativado",kKe="Fundo",$Ke="Cor de fundo da tela de login",CKe="Imagem de fundo",EKe="Enviar Imagem",TKe="coloque os arquivos aqui",OKe="Desativar autenticação",DKe="Ignorar aviso",MKe="Atenção!",PKe="A senha será enviada por meio de conexão não segura. Para proteger suas senhas, ative a conexão segura (HTTPS)!",NKe="A autenticação foi desativada",AKe="O IP fornecido não é válido",RKe="Use o teste Lets Encrypt (para teste)",IKe="Avançado",jKe="Desativar funções padrão",zKe="Aviso: A desativação incorreta do uso de funções pode causar um comportamento inesperado.",LKe="Desative o manuseio de extensões",FKe="Desative estados e informações de soquete",BKe="Não veicular arquivos da web de objectDB",WKe="Defina certificados ou carregue primeiro nas configurações do sistema (parte superior direita).",UKe="Caminho de redirecionamento padrão",HKe="A lista branca funciona apenas com interface socket-io integrada",qKe="OK",VKe="Cancelar",GKe="Use web-sockets puros (iobroker.ws)",XKe="Idade máxima do cache para arquivos",JKe="Linguagem",YKe="Mostrar o conteúdo das pastas",KKe="Lista de acesso do usuário",ZKe="Grupos",QKe="Usuários",eZe={main_settings:VYe,port:GYe,encryption:XYe,authentication:JYe,basic_authentication:YYe,cache:KYe,socket:ZYe,public_certificate:QYe,time_out:eKe,simple_api:tKe,web_sockets:rKe,private_certificate:nKe,chained_certificate:oKe,users:aKe,built_in:sKe,nothing:iKe,open_ip:cKe,certificates:lKe,use_certificates:uKe,renew_certificates:dKe,domain_name:pKe,link:fKe,whiteList:hKe,user:mKe,object:_Ke,status:gKe,file:yKe,to_read:vKe,list:bKe,write:wKe,to_create:xKe,delete:"excluir",included:SKe,background:kKe,color:$Ke,background_image:CKe,upload_image:EKe,place_the_files_here:TKe,button_title:OKe,button_title2:DKe,Warning:MKe,modal_title:PKe,Authentication_deactivated:NKe,incorrect_ip:AKe,use_lets:RKe,additionally:IKe,disable_default:jKe,warning_incorrectly:zKe,disable_extensions:LKe,disable_states:FKe,disable_files:BKe,set_certificates:WKe,"IP address":"Endereço IP vinculado","Redirect options":"Opções de redirecionamento",defaultRedirect:UKe,"This path will be opened if no path specified":"Este caminho será aberto se nenhum caminho de URL for especificado",whitelist_only_with_integrated_socket:HKe,"White list will be disabled. Please confirm.":"A lista branca será desativada. Por favor confirme.",Ok:qKe,Cancel:VKe,usePureWebSockets:GKe,"If no IP address matches, show authentication dialog":"Se nenhum endereço IP corresponder, mostre a caixa de diálogo de autenticação","Compatibility mode with socket.io@2.x":"Modo de compatibilidade com socket.io@2.x","Same settings must be set in socketio instance":"As mesmas configurações devem ser definidas na instância socketio",staticAssetCacheMaxAge:XKe,"in seconds":"em segundos","Cache options":"Opções de cache","Overload system language":"Sobrecarregar o idioma do sistema","only for this instance":"apenas para esta instância","System language":"Idioma do sistema","Use %s adapter to get letsencrypt certificates.":"Use o adaptador %s para obter certificados letsencrypt.",Language:JKe,show_folders:YKe,"Do not check if this instance is available from internet":"Não verifique se esta instância está disponível na Internet",UserList:KKe,"Only following users may access web interface as":"Somente os seguintes usuários podem acessar a interface web como","logged in user":"usuário logado","after authentication":"após autenticação",Groups:ZKe,"Group members:":"Membros do grupo:",Users:QKe,"In groups:":"Em grupos:"},tZe="Belangrijkste instellingen",rZe="Haven",nZe="Secure (HTTPS)",oZe="Authenticatie",aZe="Basisverificatie",sZe="Cache",iZe="Socket.IO Instance (Optional): (Gebruikt door adapters zoals riksja of vis)",cZe="Openbaar certificaat",lZe="Aanmeld-time-out (sec)",uZe="Ingebouwde 'Simple-API'",dZe="Force Web-Sockets",pZe="Privé certificaat",fZe="Geketend certificaat",hZe="Rennen als",mZe="geïntegreerde",_Ze="geen",gZe="Luister op alle IP's",yZe="Let's Encrypt certificaten",vZe="Gebruik Let's Encrypt-certificaten",bZe="Gebruik deze instantie voor automatische update",wZe="Poort om het domein te controleren",xZe="Klik voor hulp",SZe="Toegangslijst",kZe="Gebruiker",$Ze="voorwerp",CZe="staat",EZe="het dossier",TZe="lezen",OZe="lijst",DZe="wrire",MZe="creëren",PZe="Ingeschakeld",NZe="Achtergrond",AZe="Achtergrondkleur van het inlogscherm",RZe="Achtergrond afbeelding",IZe="Afbeelding uploaden",jZe="plaats de bestanden hier",zZe="Schakel verificatie uit",LZe="Negeer waarschuwing",FZe="Waarschuwing!",BZe="Het wachtwoord wordt verzonden via onbeveiligde verbinding. Ter beveiliging van uw wachtwoorden schakelt u de beveiligde verbinding (HTTPS) in!",WZe="Verificatie was gedeactiveerd",UZe="Het opgegeven IP-adres is niet geldig",HZe="Gebruik Lets Encrypt enscenering (voor testen)",qZe="Geavanceerd",VZe="Schakel standaardfuncties uit",GZe="Waarschuwing: het onjuist uitschakelen van het gebruik van functies kan onverwacht gedrag veroorzaken.",XZe="Verwerking van extensies uitschakelen",JZe="Schakel statussen en socketinformatie uit",YZe="Serveer geen webbestanden vanuit objectDB",KZe="Stel certificaten in of laad het eerst in de systeeminstellingen (rechtsboven).",ZZe="Standaard omleidingspad",QZe="Witte lijst werkt alleen met geïntegreerde socket-io-interface",eQe="OK",tQe="Annuleren",rQe="Gebruik pure web-sockets (iobroker.ws)",nQe="Cache max leeftijd voor bestanden",oQe="Taal",aQe="Inhoud van mappen weergeven",sQe="Lijst met gebruikerstoegang",iQe="Groepen",cQe="Gebruikers",lQe={main_settings:tZe,port:rZe,encryption:nZe,authentication:oZe,basic_authentication:aZe,cache:sZe,socket:iZe,public_certificate:cZe,time_out:lZe,simple_api:uZe,web_sockets:dZe,private_certificate:pZe,chained_certificate:fZe,users:hZe,built_in:mZe,nothing:_Ze,open_ip:gZe,certificates:yZe,use_certificates:vZe,renew_certificates:bZe,domain_name:wZe,link:xZe,whiteList:SZe,user:kZe,object:$Ze,status:CZe,file:EZe,to_read:TZe,list:OZe,write:DZe,to_create:MZe,delete:"verwijderen",included:PZe,background:NZe,color:AZe,background_image:RZe,upload_image:IZe,place_the_files_here:jZe,button_title:zZe,button_title2:LZe,Warning:FZe,modal_title:BZe,Authentication_deactivated:WZe,incorrect_ip:UZe,use_lets:HZe,additionally:qZe,disable_default:VZe,warning_incorrectly:GZe,disable_extensions:XZe,disable_states:JZe,disable_files:YZe,set_certificates:KZe,"IP address":"Gebonden IP-adres","Redirect options":"Omleidingsopties",defaultRedirect:ZZe,"This path will be opened if no path specified":"Dit pad wordt geopend als er geen URL-pad is opgegeven",whitelist_only_with_integrated_socket:QZe,"White list will be disabled. Please confirm.":"Witte lijst wordt uitgeschakeld. Bevestig alstublieft.",Ok:eQe,Cancel:tQe,usePureWebSockets:rQe,"If no IP address matches, show authentication dialog":"Als geen IP-adres overeenkomt, verificatiedialoogvenster weergeven","Compatibility mode with socket.io@2.x":"Compatibiliteitsmodus met socket.io@2.x","Same settings must be set in socketio instance":"Dezelfde instellingen moeten worden ingesteld in de socketio-instantie",staticAssetCacheMaxAge:nQe,"in seconds":"in seconden","Cache options":"Cache-opties","Overload system language":"Systeemtaal overbelasten","only for this instance":"alleen voor dit geval","System language":"Systeemtaal","Use %s adapter to get letsencrypt certificates.":"Gebruik %s adapter om letsencrypt-certificaten te verkrijgen.",Language:oQe,show_folders:aQe,"Do not check if this instance is available from internet":"Controleer niet of dit exemplaar beschikbaar is via internet",UserList:sQe,"Only following users may access web interface as":"Alleen de volgende gebruikers hebben toegang tot de webinterface als","logged in user":"ingelogde gebruiker","after authentication":"na authenticatie",Groups:iQe,"Group members:":"Groepsleden:",Users:cQe,"In groups:":"In groepen:"},uQe="Réglages principaux",dQe="Port",pQe="Sécurisé (HTTPS)",fQe="Authentification",hQe="Authentification de base",mQe="Cache",_Qe="Socket.IO Instance (Optional): (Utilisé par des adaptateurs comme le pousse-pousse ou vis)",gQe="Certificat public",yQe="Délai d'attente de connexion (sec)",vQe="Construire 'Simple-API'",bQe="Forcer les Web-Sockets",wQe="Certificat privé",xQe="Certificat chaîné",SQe="Courir comme",kQe="intégré",$Qe="aucun",CQe="Écoutez sur toutes les adresses IP",EQe="Let's Encrypt Certificats",TQe="Utiliser les certificats Let's Encrypt",OQe="Utilisez cette instance pour la mise à jour automatique",DQe="Port pour vérifier le domaine",MQe="Cliquez pour obtenir de l'aide",PQe="Liste d'accès",NQe="Utilisateur",AQe="objet",RQe="Etat",IQe="fichier",jQe="lis",zQe="liste",LQe="écrire",FQe="créer",BQe="Activée",WQe="Contexte",UQe="Couleur d'arrière-plan de l'écran de connexion",HQe="Image de fond",qQe="Importer une image",VQe="Placez les fichiers ici",GQe="Désactiver l'authentification",XQe="Ignorer l'avertissement",JQe="Attention!",YQe="Le mot de passe sera envoyé via une connexion non sécurisée. Pour protéger vos mots de passe, activez la connexion sécurisée (HTTPS)!",KQe="L'authentification a été désactivée",ZQe="L'adresse IP fournie n'est pas valide",QQe="Utiliser la mise en scène Lets Encrypt (pour les tests)",eet="Avancée",tet="Désactiver les fonctions par défaut",ret="Avertissement: la désactivation incorrecte de l'utilisation des fonctions peut provoquer un comportement inattendu.",net="Désactivez la gestion des extensions",oet="Désactivez les états et les informations de socket",aet="Ne diffusez pas de fichiers Web depuis objectDB",set="Définissez des certificats ou chargez-les d'abord dans les paramètres du système (en haut à droite).",iet="Chemin de redirection par défaut",cet="La liste blanche ne fonctionne qu'avec l'interface socket-io intégrée",uet="D'accord",det="Annuler",pet="Utilisez des sockets Web purs (iobroker.ws)",fet="Âge maximum du cache pour les fichiers",het="Langue",met="Afficher le contenu des dossiers",_et="Liste d'accès des utilisateurs",get="Groupes",yet="Utilisateurs",vet={main_settings:uQe,port:dQe,encryption:pQe,authentication:fQe,basic_authentication:hQe,cache:mQe,socket:_Qe,public_certificate:gQe,time_out:yQe,simple_api:vQe,web_sockets:bQe,private_certificate:wQe,chained_certificate:xQe,users:SQe,built_in:kQe,nothing:$Qe,open_ip:CQe,certificates:EQe,use_certificates:TQe,renew_certificates:OQe,domain_name:DQe,link:MQe,whiteList:PQe,user:NQe,object:AQe,status:RQe,file:IQe,to_read:jQe,list:zQe,write:LQe,to_create:FQe,delete:"effacer",included:BQe,background:WQe,color:UQe,background_image:HQe,upload_image:qQe,place_the_files_here:VQe,button_title:GQe,button_title2:XQe,Warning:JQe,modal_title:YQe,Authentication_deactivated:KQe,incorrect_ip:ZQe,use_lets:QQe,additionally:eet,disable_default:tet,warning_incorrectly:ret,disable_extensions:net,disable_states:oet,disable_files:aet,set_certificates:set,"IP address":"Adresse IP liée","Redirect options":"Options de redirection",defaultRedirect:iet,"This path will be opened if no path specified":"Ce chemin sera ouvert si aucun chemin URL spécifié",whitelist_only_with_integrated_socket:cet,"White list will be disabled. Please confirm.":"La liste blanche sera désactivée. Veuillez confirmer.",Ok:uet,Cancel:det,usePureWebSockets:pet,"If no IP address matches, show authentication dialog":"Si aucune adresse IP ne correspond, affichez la boîte de dialogue d'authentification","Compatibility mode with socket.io@2.x":"Mode de compatibilité avec socket.io@2.x","Same settings must be set in socketio instance":"Les mêmes paramètres doivent être définis dans l'instance socketio",staticAssetCacheMaxAge:fet,"in seconds":"en secondes","Cache options":"Options de cache","Overload system language":"Surcharger la langue du système","only for this instance":"uniquement pour ce cas","System language":"Langue du système","Use %s adapter to get letsencrypt certificates.":"Utilisez l'adaptateur %s pour obtenir les certificats Letsencrypt.",Language:het,show_folders:met,"Do not check if this instance is available from internet":"Ne vérifiez pas si cette instance est disponible sur Internet",UserList:_et,"Only following users may access web interface as":"Seuls les utilisateurs suivants peuvent accéder à l'interface Web en tant que","logged in user":"utilisateur connecté","after authentication":"après authentification",Groups:get,"Group members:":"Les membres du groupe:",Users:yet,"In groups:":"En groupes:"},bet="Impostazioni principali",wet="Porta",xet="Sicuro (HTTPS)",ket="Autenticazione",$et="Autenticazione di base",Cet="nascondiglio",Eet="Socket.IO Instance (Optional): (Utilizzato da adattatori come risciò o vis)",Tet="Certificato pubblico",Oet="Timeout di accesso (sec)",Det="Build-in 'Simple-API'",Met="Force Web-Sockets",Pet="Certificato privato",Net="Certificato incatenato",Aet="Correre come",Ret="integrato",Iet="nessuna",jet="Ascolta su tutti gli IP",zet="Let's Encrypt certificati",Let="Utilizza Let's Encrypt certificates",Fet="Utilizza questa istanza per l'aggiornamento automatico",Bet="Porta per controllare il dominio",Wet="Fai clic per chiedere aiuto",Uet="Elenco di accesso",Het="Utente",qet="oggetto",Vet="stato",Get="file",Xet="leggere",Jet="elenco",Yet="wrire",Ket="creare",Zet="Abilitato",Qet="Sfondo",ett="Colore di sfondo della schermata di accesso",ttt="Immagine di sfondo",rtt="Carica immagine",ntt="posiziona i file qui",ott="Disabilitare l'autenticazione",att="Ignora l'avviso",stt="Avvertimento!",itt="La password verrà inviata tramite connessione non protetta. Per proteggere le tue password abilita la connessione sicura (HTTPS)!",ctt="L'autenticazione è stata disattivata",ltt="L'IP fornito non è valido",utt="Usa Lets Encrypt staging (per test)",dtt="Avanzate",ptt="Disabilita le funzioni predefinite",ftt="Avvertenza: la disabilitazione errata dell'uso delle funzioni può causare comportamenti imprevisti.",htt="Disabilita la gestione delle estensioni",mtt="Disabilita stati e informazioni socket",_tt="Non servire file web da objectDB",gtt="Imposta i certificati o caricali prima nelle impostazioni di sistema (in alto a destra).",ytt="Percorso di reindirizzamento predefinito",vtt="La lista bianca funziona solo con l'interfaccia socket-io integrata",btt="Ok",wtt="Annulla",xtt="Usa socket web puri (iobroker.ws)",Stt="Età massima della cache per i file",ktt="Lingua",$tt="Mostra il contenuto delle cartelle",Ctt="Elenco di accesso degli utenti",Ett="Gruppi",Ttt="Utenti",Ott={main_settings:bet,port:wet,encryption:xet,authentication:ket,basic_authentication:$et,cache:Cet,socket:Eet,public_certificate:Tet,time_out:Oet,simple_api:Det,web_sockets:Met,private_certificate:Pet,chained_certificate:Net,users:Aet,built_in:Ret,nothing:Iet,open_ip:jet,certificates:zet,use_certificates:Let,renew_certificates:Fet,domain_name:Bet,link:Wet,whiteList:Uet,user:Het,object:qet,status:Vet,file:Get,to_read:Xet,list:Jet,write:Yet,to_create:Ket,delete:"Elimina",included:Zet,background:Qet,color:ett,background_image:ttt,upload_image:rtt,place_the_files_here:ntt,button_title:ott,button_title2:att,Warning:stt,modal_title:itt,Authentication_deactivated:ctt,incorrect_ip:ltt,use_lets:utt,additionally:dtt,disable_default:ptt,warning_incorrectly:ftt,disable_extensions:htt,disable_states:mtt,disable_files:_tt,set_certificates:gtt,"IP address":"Indirizzo IP associato","Redirect options":"Opzioni di reindirizzamento",defaultRedirect:ytt,"This path will be opened if no path specified":"Questo percorso verrà aperto se non viene specificato alcun percorso URL",whitelist_only_with_integrated_socket:vtt,"White list will be disabled. Please confirm.":"La lista bianca sarà disabilitata. Si prega di confermare.",Ok:btt,Cancel:wtt,usePureWebSockets:xtt,"If no IP address matches, show authentication dialog":"Se nessun indirizzo IP corrisponde, mostra la finestra di autenticazione","Compatibility mode with socket.io@2.x":"Modalità di compatibilità con socket.io@2.x","Same settings must be set in socketio instance":"Le stesse impostazioni devono essere impostate nell'istanza socketio",staticAssetCacheMaxAge:Stt,"in seconds":"in secondi","Cache options":"Opzioni della cache","Overload system language":"Sovraccarica la lingua del sistema","only for this instance":"solo per questo caso","System language":"Linguaggio di sistema","Use %s adapter to get letsencrypt certificates.":"Usa l'adattatore %s per ottenere i certificati letsencrypt.",Language:ktt,show_folders:$tt,"Do not check if this instance is available from internet":"Non verificare se questa istanza è disponibile da Internet",UserList:Ctt,"Only following users may access web interface as":"Solo i seguenti utenti possono accedere all'interfaccia web come","logged in user":"utente registrato","after authentication":"dopo l'autenticazione",Groups:Ett,"Group members:":"Membri del gruppo:",Users:Ttt,"In groups:":"In gruppi:"},Dtt="Ajustes principales",Mtt="Puerto",Ptt="Seguro (HTTPS)",Ntt="Autenticación",Att="Autenticación básica",Rtt="Cache",Itt="Socket.IO Instance (Optional): (Utilizado por adaptadores como rickshaw o vis)",jtt="Certificado público",ztt="Tiempo de espera de inicio de sesión (sec)",Ltt="Build-in 'Simple-API'",Ftt="Force Web-Sockets",Btt="Certificado privado",Wtt="Certificado encadenado",Utt="Correr como",Htt="integrado",qtt="ninguna",Vtt="Escuchar en todas las direcciones IP",Gtt="Let's Encrypt Certificados",Xtt="Utilice los certificados Let's Encrypt",Jtt="Use esta instancia para la actualización automática",Ytt="Puerto para verificar el dominio",Ktt="Haz clic para obtener ayuda",Ztt="Lista de acceso",Qtt="Usuario",ert="objeto",trt="estado",rrt="archivo",nrt="leer",ort="lista",art="wrire",srt="crear",irt="Habilitado",crt="Fondo",lrt="Color de fondo de la pantalla de inicio de sesión",urt="Imagen de fondo",drt="Cargar imagen",prt="coloca los archivos aquí",frt="Deshabilitar autenticación",hrt="Ignorar advertencia",mrt="¡Advertencia!",_rt="La contraseña se enviará a través de una conexión no segura. Para proteger sus contraseñas, ¡habilite la conexión segura (HTTPS)!",grt="La autenticación fue desactivada",yrt="El IP proporcionado no es válido",vrt="Use Lets Encrypt staging (para pruebas)",brt="Avanzado",wrt="Deshabilitar funciones predeterminadas",xrt="Advertencia: la desactivación incorrecta del uso de funciones puede provocar un comportamiento inesperado.",Srt="Deshabilitar el manejo de extensiones",krt="Deshabilitar estados e información de socket",$rt="No sirva archivos web desde objectDB",Crt="Establezca certificados o cárguelos primero en la configuración del sistema (arriba a la derecha).",Ert="Ruta de redirección predeterminada",Trt="La lista blanca solo funciona con la interfaz socket-io integrada",Ort="OK",Drt="Cancelar",Mrt="Use sockets web puros (iobroker.ws)",Prt="Antigüedad máxima de caché para archivos",Nrt="Idioma",Art="Mostrar el contenido de las carpetas",Rrt="Lista de acceso de usuarios",Irt="Grupos",jrt="Usuarios",zrt={main_settings:Dtt,port:Mtt,encryption:Ptt,authentication:Ntt,basic_authentication:Att,cache:Rtt,socket:Itt,public_certificate:jtt,time_out:ztt,simple_api:Ltt,web_sockets:Ftt,private_certificate:Btt,chained_certificate:Wtt,users:Utt,built_in:Htt,nothing:qtt,open_ip:Vtt,certificates:Gtt,use_certificates:Xtt,renew_certificates:Jtt,domain_name:Ytt,link:Ktt,whiteList:Ztt,user:Qtt,object:ert,status:trt,file:rrt,to_read:nrt,list:ort,write:art,to_create:srt,delete:"borrar",included:irt,background:crt,color:lrt,background_image:urt,upload_image:drt,place_the_files_here:prt,button_title:frt,button_title2:hrt,Warning:mrt,modal_title:_rt,Authentication_deactivated:grt,incorrect_ip:yrt,use_lets:vrt,additionally:brt,disable_default:wrt,warning_incorrectly:xrt,disable_extensions:Srt,disable_states:krt,disable_files:$rt,set_certificates:Crt,"IP address":"Dirección IP vinculada","Redirect options":"Opciones de redireccionamiento",defaultRedirect:Ert,"This path will be opened if no path specified":"Esta ruta se abrirá si no se especifica ninguna ruta URL.",whitelist_only_with_integrated_socket:Trt,"White list will be disabled. Please confirm.":"La lista blanca se desactivará. Por favor confirmar.",Ok:Ort,Cancel:Drt,usePureWebSockets:Mrt,"If no IP address matches, show authentication dialog":"Si ninguna dirección IP coincide, mostrar el cuadro de diálogo de autenticación","Compatibility mode with socket.io@2.x":"Modo de compatibilidad con socket.io@2.x","Same settings must be set in socketio instance":"Se deben establecer las mismas configuraciones en la instancia de socketio",staticAssetCacheMaxAge:Prt,"in seconds":"en segundos","Cache options":"Opciones de caché","Overload system language":"Sobrecargar idioma del sistema","only for this instance":"solo para esta instancia","System language":"Lenguaje del sistema","Use %s adapter to get letsencrypt certificates.":"Use el adaptador %s para obtener certificados de letsencrypt.",Language:Nrt,show_folders:Art,"Do not check if this instance is available from internet":"No verifique si esta instancia está disponible en Internet.",UserList:Rrt,"Only following users may access web interface as":"Sólo los siguientes usuarios pueden acceder a la interfaz web como","logged in user":"usuario registrado","after authentication":"después de la autenticación",Groups:Irt,"Group members:":"Miembros del grupo:",Users:jrt,"In groups:":"En grupos:"},Lrt="Ustawienia główne",Frt="Port",Brt="Bezpieczne (HTTPS)",Wrt="Poświadczenie",Urt="Uwierzytelnianie podstawowe",Hrt="Pamięć podręczna",qrt="Socket.IO Instance (Optional): (Używany przez adaptery takie jak riksza lub vis)",Vrt="Certyfikat publiczny",Grt="Limit czasu logowania (s)",Xrt="Wbuduj 'Proste API'",Jrt="Wymuszaj gniazda internetowe",Yrt="Prywatny certyfikat",Krt="Przykuty certyfikat",Zrt="Uruchom jako",Qrt="zintegrowany",ent="Żaden",tnt="Posłuchaj na wszystkich IP",rnt="Let's Encrypt certyfikaty",nnt="Użyj Let's Encrypt certificates",ont="Użyj tej instancji do automatycznej aktualizacji",ant="Port do sprawdzenia domeny",snt="Kliknij, aby uzyskać pomoc",int="Lista dostępu",cnt="Użytkownik",lnt="obiekt",unt="stan",dnt="plik",pnt="czytać",fnt="lista",hnt="wrire",mnt="Stwórz",_nt="Włączone",gnt="Tło",ynt="Kolor tła ekranu logowania",vnt="Zdjęcie w tle",bnt="Załaduj obrazek",wnt="umieść pliki tutaj",xnt="Wyłącz uwierzytelnianie",Snt="Zignoruj ​​ostrzeżenie",knt="Ostrzeżenie!",$nt="Hasło zostanie wysłane przez połączenie bez zabezpieczeń. Aby chronić swoje hasła, włącz bezpieczne połączenie (HTTPS)!",Cnt="Uwierzytelnianie zostało dezaktywowane",Ent="Podany adres IP jest nieprawidłowy",Tnt="Użyj Lets Encrypt staging (do testowania)",Ont="Zaawansowane",Dnt="Wyłącz funkcje domyślne",Mnt="Ostrzeżenie: Niepoprawne wyłączenie używania funkcji może spowodować nieoczekiwane zachowanie.",Pnt="Wyłącz obsługę rozszerzeń",Nnt="Wyłącz stany i informacje o gnieździe",Ant="Nie udostępniaj plików internetowych z objectDB",Rnt="Ustaw certyfikaty lub załaduj najpierw w ustawieniach systemu (prawy górny).",Int="Domyślna ścieżka przekierowania",jnt="Biała lista działa tylko ze zintegrowanym interfejsem socket-io",znt="Ok",Lnt="Odwołaj",Fnt="Używaj czystych gniazd sieciowych (iobroker.ws)",Bnt="Maksymalny wiek dla plików w pamięci podręcznej",Wnt="Język",Unt="Pokaż zawartość folderów",Hnt="Lista dostępu użytkowników",qnt="Grupy",Vnt="Użytkownicy",Gnt={main_settings:Lrt,port:Frt,encryption:Brt,authentication:Wrt,basic_authentication:Urt,cache:Hrt,socket:qrt,public_certificate:Vrt,time_out:Grt,simple_api:Xrt,web_sockets:Jrt,private_certificate:Yrt,chained_certificate:Krt,users:Zrt,built_in:Qrt,nothing:ent,open_ip:tnt,certificates:rnt,use_certificates:nnt,renew_certificates:ont,domain_name:ant,link:snt,whiteList:int,user:cnt,object:lnt,status:unt,file:dnt,to_read:pnt,list:fnt,write:hnt,to_create:mnt,delete:"kasować",included:_nt,background:gnt,color:ynt,background_image:vnt,upload_image:bnt,place_the_files_here:wnt,button_title:xnt,button_title2:Snt,Warning:knt,modal_title:$nt,Authentication_deactivated:Cnt,incorrect_ip:Ent,use_lets:Tnt,additionally:Ont,disable_default:Dnt,warning_incorrectly:Mnt,disable_extensions:Pnt,disable_states:Nnt,disable_files:Ant,set_certificates:Rnt,"IP address":"Powiązany adres IP","Redirect options":"Opcje przekierowania",defaultRedirect:Int,"This path will be opened if no path specified":"Ta ścieżka zostanie otwarta, jeśli nie określono ścieżki URL",whitelist_only_with_integrated_socket:jnt,"White list will be disabled. Please confirm.":"Biała lista zostanie wyłączona. Proszę potwierdzić.",Ok:znt,Cancel:Lnt,usePureWebSockets:Fnt,"If no IP address matches, show authentication dialog":"Jeśli żaden adres IP nie pasuje, pokaż okno uwierzytelniania","Compatibility mode with socket.io@2.x":"Tryb zgodności z socket.io@2.x","Same settings must be set in socketio instance":"Te same ustawienia muszą być ustawione w instancji socketio",staticAssetCacheMaxAge:Bnt,"in seconds":"w sekundy","Cache options":"Opcje pamięci podręcznej","Overload system language":"Przeciążenie języka systemu","only for this instance":"tylko w tym przypadku","System language":"Język systemu","Use %s adapter to get letsencrypt certificates.":"Użyj adaptera %s, aby uzyskać certyfikaty Letsencrypt.",Language:Wnt,show_folders:Unt,"Do not check if this instance is available from internet":"Nie sprawdzaj, czy ta instancja jest dostępna z Internetu",UserList:Hnt,"Only following users may access web interface as":"Tylko następujący użytkownicy mogą uzyskać dostęp do interfejsu internetowego jako","logged in user":"zalogowany użytkownik","after authentication":"po uwierzytelnieniu",Groups:qnt,"Group members:":"Członkowie grupy:",Users:Vnt,"In groups:":"W grupach:"},Xnt="Автентифікацію було вимкнено",Jnt="Скасувати",Ynt="В порядку",Knt="УВАГА!",Znt="Просунутий",Qnt="Аутентифікація",eot="Фон",tot="Фонове зображення",rot="Базова автентифікація",not="інтегрований",oot="Вимкнути автентифікацію",aot="Ігнорувати попередження",sot="Кеш",iot="Давайте зашифруємо сертифікати",cot="Прикутий сертифікат",lot="Колір фону екрана входу",uot="Шлях переспрямування за умовчанням",dot="Вимкнути функції за замовчуванням",pot="Вимкнути обробку розширень",fot="Не обслуговуйте веб-файли зі сховища ioBroker",hot="Вимкнути інформацію про стани та сокет",mot="Порт для перевірки домену",_ot="Безпечний (HTTPS)",got="файл",yot="Увімкнено",vot="Наданий IP недійсний",bot="Натисніть для допомоги",wot="список",xot="Основні налаштування",Sot="Пароль буде надіслано через незахищене з’єднання. Щоб захистити ваші паролі, увімкніть безпечне з'єднання (HTTPS)!",kot="немає",$ot="об'єкт",Cot="Прослуховування на всіх IP",Eot="розмістіть файли тут",Tot="Порт",Oot="Приватний сертифікат",Dot="«Публічний» сертифікат",Mot="Використовуйте цей екземпляр для автоматичного оновлення",Pot="Спершу встановіть сертифікати або завантажте їх у налаштуваннях системи (справа вгорі).",Not="Вбудований «Simple-API»",Aot="Примірник Socket.IO (необов’язково): (використовується такими адаптерами, як rickshaw або vis)",Rot="Максимальний вік кешу для файлів",Iot="стан",jot="Час очікування входу (с)",zot="створити",Lot="читати",Fot="Завантажити зображення",Bot="Використовуйте чисті веб-сокети (iobroker.ws)",Wot="Використовуйте сертифікати Let's Encrypt",Uot="Використовуйте постановки Lets Encrypt (для тестування/налагодження. Тільки для розробника)",Hot="Користувач",qot="Бігати як",Vot="Попередження: неправильне вимкнення використання функцій може призвести до неочікуваної поведінки.",Got="Force Web-Sockets",Xot="Список доступу",Jot="Білий список працює лише з вбудованим інтерфейсом socket-io",Yot="писати",Kot="Мова",Zot="Показати вміст папок",Qot="Список доступу користувачів",eat="Групи",tat="Користувачі",rat={Authentication_deactivated:Xnt,"Cache options":"Параметри кешу",Cancel:Jnt,"Compatibility mode with socket.io@2.x":"Режим сумісності з socket.io@2.x","IP address":"Прив'язана IP-адреса","If no IP address matches, show authentication dialog":"Якщо жодна IP-адреса не відповідає, відобразити діалогове вікно автентифікації",Ok:Ynt,"Overload system language":"Перевантаження системної мови","Redirect options":"Параметри перенаправлення","Same settings must be set in socketio instance":"Такі ж параметри потрібно встановити в екземплярі socketio","System language":"Системна мова","This path will be opened if no path specified":"Цей шлях буде відкрито, якщо URL-адресу не вказано",Warning:Knt,"White list will be disabled. Please confirm.":"Білий список буде вимкнено. Будь-ласка підтвердіть.",additionally:Znt,authentication:Qnt,background:eot,background_image:tot,basic_authentication:rot,built_in:not,button_title:oot,button_title2:aot,cache:sot,certificates:iot,chained_certificate:cot,color:lot,defaultRedirect:uot,delete:"видалити",disable_default:dot,disable_extensions:pot,disable_files:fot,disable_states:hot,domain_name:mot,encryption:_ot,file:got,"in seconds":"за секунди",included:yot,incorrect_ip:vot,link:bot,list:wot,main_settings:xot,modal_title:Sot,nothing:kot,object:$ot,"only for this instance":"тільки для цього випадку",open_ip:Cot,place_the_files_here:Eot,port:Tot,private_certificate:Oot,public_certificate:Dot,renew_certificates:Mot,set_certificates:Pot,simple_api:Not,socket:Aot,staticAssetCacheMaxAge:Rot,status:Iot,time_out:jot,to_create:zot,to_read:Lot,upload_image:Fot,usePureWebSockets:Bot,use_certificates:Wot,use_lets:Uot,user:Hot,users:qot,warning_incorrectly:Vot,web_sockets:Got,whiteList:Xot,whitelist_only_with_integrated_socket:Jot,write:Yot,"Use %s adapter to get letsencrypt certificates.":"Використовуйте адаптер %s, щоб отримати сертифікати letsencrypt.",Language:Kot,show_folders:Zot,"Do not check if this instance is available from internet":"Не перевіряйте, чи доступний цей екземпляр в Інтернеті",UserList:Qot,"Only following users may access web interface as":"Тільки такі користувачі можуть отримати доступ до веб-інтерфейсу як","logged in user":"авторизований користувач","after authentication":"після аутентифікації",Groups:eat,"Group members:":"Члени групи:",Users:tat,"In groups:":"У групах:"},nat="主要设置",oat="端口",aat="安全访问 (HTTPS)",sat="认证机制",iat="基本身份验证",cat="使能缓存",lat="Socket.IO Instance (Optional): (被rickshaw或vis等适配器使用)",uat="公共证书",dat="登录超时时间(秒)",pat="内置'Simple-API'",fat="强制Web-Sockets",hat="私人证书",mat="链式证书",_at="运行为",gat="集成的",yat="无",vat="监听所有IP",bat="Let's Encrypt证书",wat="使用Let's Encrypt证书",xat="自动更新Let's Encrypt证书",Sat="自动更新证书使用的端口",kat="单击获取帮助",$at="访问列表",Cat="用户",Eat="对象",Tat="状态",Oat="文件",Dat="可读",Mat="可列举",Pat="可写",Nat="可创建",Aat="使能",Rat="背景",Iat="登录界面的背景颜色",jat="背景图片",zat="上传图片",Lat="将文件拖拽到这里",Fat="禁用身份认证机制",Bat="忽略警告",Wat="警告!",Uat="密码将通过不安全的连接发送。 要保护您的密码,请启用安全连接(HTTPS)!",Hat="身份认证机制已停用",qat="提供的IP无效",Vat="使用Lets Encrypt暂存(用于测试)",Gat="高级",Xat="禁用默认功能",Jat="警告:错误地禁用功能使用会导致意外行为。",Yat="禁用扩展处理:",Kat="禁用状态和套接字信息",Zat="不要提供来自objectDB的Web文件",Qat="首先在系统设置中(右上角)设置或加载证书。",est="默认重定向路径",tst="白名单仅适用于集成的 socket-io 接口",rst="好的",nst="取消",ost="使用纯网络套接字 (iobroker.ws)",ast="文件的缓存最大年龄",sst="语言",ist="显示文件夹内容",cst="用户访问列表",lst="团体",ust="用户",dst={main_settings:nat,port:oat,encryption:aat,authentication:sat,basic_authentication:iat,cache:cat,socket:lat,public_certificate:uat,time_out:dat,simple_api:pat,web_sockets:fat,private_certificate:hat,chained_certificate:mat,users:_at,built_in:gat,nothing:yat,open_ip:vat,certificates:bat,use_certificates:wat,renew_certificates:xat,domain_name:Sat,link:kat,whiteList:$at,user:Cat,object:Eat,status:Tat,file:Oat,to_read:Dat,list:Mat,write:Pat,to_create:Nat,delete:"可删除",included:Aat,background:Rat,color:Iat,background_image:jat,upload_image:zat,place_the_files_here:Lat,button_title:Fat,button_title2:Bat,Warning:Wat,modal_title:Uat,Authentication_deactivated:Hat,incorrect_ip:qat,use_lets:Vat,additionally:Gat,disable_default:Xat,warning_incorrectly:Jat,disable_extensions:Yat,disable_states:Kat,disable_files:Zat,set_certificates:Qat,"IP address":"绑定IP地址","Redirect options":"重定向选项",defaultRedirect:est,"This path will be opened if no path specified":"如果未指定 URL 路径,将打开此路径",whitelist_only_with_integrated_socket:tst,"White list will be disabled. Please confirm.":"白名单将被禁用。请确认。",Ok:rst,Cancel:nst,usePureWebSockets:ost,"If no IP address matches, show authentication dialog":"如果没有 IP 地址匹配,则显示身份验证对话框","Compatibility mode with socket.io@2.x":"与 socket.io@2.x 的兼容模式","Same settings must be set in socketio instance":"必须在 socketio 实例中设置相同的设置",staticAssetCacheMaxAge:ast,"in seconds":"片刻之间","Cache options":"缓存选项","Overload system language":"重载系统语言","only for this instance":"仅适用于本例","System language":"系统语言","Use %s adapter to get letsencrypt certificates.":"使用 %s 适配器获取 letsencrypt 证书。",Language:sst,show_folders:ist,"Do not check if this instance is available from internet":"不检查此实例是否可从 Internet 获取",UserList:cst,"Only following users may access web interface as":"只有以下用户可以访问 Web 界面:","logged in user":"登录用户","after authentication":"认证后",Groups:lst,"Group members:":"小组成员:",Users:ust,"In groups:":"在团队中:"},Pp={tabContent:{padding:10,height:"calc(100% - 64px - 48px - 20px)",overflow:"auto"},tabContentIFrame:{padding:10,height:"calc(100% - 64px - 48px - 20px - 38px)",overflow:"auto"},selected:t=>({color:t.palette.mode==="dark"?void 0:"#FFF !important"}),indicator:t=>({backgroundColor:t.palette.mode==="dark"?t.palette.secondary.main:"#FFF"})},Np=[{name:"options",translate:"main_settings",index:0},{name:"certificates",translate:"certificates",index:1},{name:"whiteList",translate:"whiteList",index:2},{name:"userList",translate:"UserList",index:3},{name:"additionally",translate:"additionally",index:4},{name:"background",translate:"background",index:5}];class pst extends ja{constructor(e){const r={...e};r.encryptedFields=["pass"],r.Connection=B9,r.translations={en:EXe,de:IJe,ru:qYe,pt:eZe,nl:lQe,fr:vet,it:Ott,es:zrt,pl:Gnt,uk:rat,"zh-cn":dst},r.sentryDSN=window.sentryDSN,super(e,r)}getSelectedTab(){var n;const{selectedTab:e}=this.state,r=e;return r?this.checkDisabledTabs(r)?0:((n=Np.find(o=>o.name===r))==null?void 0:n.index)||0:0}onPrepareSave(e){super.onPrepareSave(e);const{secure:r,certPublic:n,certPrivate:o}=this.state.native;return r&&(!o||!n)?(this.setState({toast:"set_certificates"}),!1):!0}renderTab(){const{native:e}=this.state;let r=this.state.selectedTab;switch(this.checkDisabledTabs(this.state.selectedTab)&&(r="options"),r){case"certificates":return $.jsx(mGe,{common:this.common,socket:this.socket,native:e,onError:n=>this.setState({errorText:(n||n===0)&&typeof n!="string"?n.toString():n}),instance:this.instance,onChange:(n,o,a)=>this.updateNativeValue(n,o,a),adapterName:this.adapterName},"certificates");case"whiteList":return $.jsx(Su,{theme:this.state.theme,common:this.common,socket:this.socket,native:e,onChange:(n,o,a)=>this.updateNativeValue(n,o,a),onError:n=>this.setState({errorText:(n||n===0)&&typeof n!="string"?n.toString():n}),instance:this.instance,adapterName:this.adapterName},"whiteList");case"userList":return $.jsx(tA,{common:this.common,socket:this.socket,native:e,onChange:(n,o,a)=>this.updateNativeValue(n,o,a),onError:n=>this.setState({errorText:(n||n===0)&&typeof n!="string"?n.toString():n}),instance:this.instance,adapterName:this.adapterName},"userList");case"additionally":return $.jsx(eA,{common:this.common,socket:this.socket,native:e,onChange:(n,o,a)=>this.updateNativeValue(n,o,a),onError:n=>this.setState({errorText:(n||n===0)&&typeof n!="string"?n.toString():n}),instance:this.instance,adapterName:this.adapterName},"additionally");case"background":return $.jsx(QN,{common:this.common,socket:this.socket,native:e,onChange:(n,o,a)=>this.updateNativeValue(n,o,a),onError:n=>this.setState({errorText:(n||n===0)&&typeof n!="string"?n.toString():n}),instance:this.instance,adapterName:this.adapterName},"background");case"options":default:return $.jsx(ZN,{themeType:this.state.themeType,common:this.common,socket:this.socket,native:e,onError:n=>this.setState({errorText:(n||n===0)&&typeof n!="string"?n.toString():n}),instance:this.instance,onChange:(n,o,a)=>this.updateNativeValue(n,o,a),adapterName:this.adapterName,onLoad:n=>this.setState({native:n})},"options")}}checkDisabledTabs(e){const{native:r}=this.state;return!r.auth&&e==="background"||!r.secure&&e==="certificates"||!r.auth&&(e==="whiteList"||e==="userList")}render(){const{loaded:e,theme:r,themeType:n,toast:o}=this.state;return e?$.jsx(sk,{injectFirst:!0,children:$.jsxs(Dk,{theme:this.state.theme,children:[$.jsx(ai,{message:o,onClose:()=>this.setState({toast:""})}),$.jsxs("div",{className:"App",style:{background:r.palette.background.default,color:r.palette.text.primary},children:[$.jsx(cM,{position:"static",children:$.jsx(RM,{value:this.getSelectedTab(),onChange:(a,i)=>{var l;return this.selectTab(((l=Np.find(u=>u.index===i))==null?void 0:l.name)||Np[0].name,i)},scrollButtons:"auto",sx:{"& .MuiTabs-indicator":Pp.indicator},children:Np.map((a,i)=>$.jsx(ks,{sx:{"& .MuiTab-selected":Pp.selected},disabled:this.checkDisabledTabs(a.name),label:R.t(a.translate),"data-name":a.name},`${i}-tab-key`))})}),$.jsx("div",{style:this.isIFrame?Pp.tabContentIFrame:Pp.tabContent,children:this.renderTab()}),this.renderError(),this.renderSaveCloseButtons()]})]})}):$.jsx(sk,{injectFirst:!0,children:$.jsx(Dk,{theme:this.state.theme,children:$.jsx(_P,{theme:n})})})}}window.location.hostname==="localhost"||window.location.hostname==="[::1]"||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/);function fst(){"serviceWorker"in navigator&&navigator.serviceWorker.ready.then(t=>t.unregister())}const hst="web-admin",mst="6.3.1",_st={"@iobroker/adapter-react-v5":"^7.4.19","@mui/icons-material":"^6.4.2","@mui/material":"^6.4.2","@sentry/browser":"^8.52.1","@vitejs/plugin-react":"^4.3.4","babel-eslint":"^10.1.0","prop-types":"^15.8.1",react:"^18.3.1","react-dom":"^18.3.1","react-dropzone":"^14.3.5","react-icons":"^5.4.0"},gst={start:"vite --host",build:"vite build",lint:"eslint -c eslint.config.mjs","check-ts":"tsc --noEmit --checkJS false",tsc:"tsc --project tsconfig.json"},yst={extends:"react-app"},vst=".",bst=[">0.2%","not dead","not ie <= 11","not op_mini all"],wst={name:hst,version:mst,private:!0,dependencies:_st,scripts:gst,eslintConfig:yst,homepage:vst,browserslist:bst};window.adapterName="web";window.sentryDSN="https://5ad729dbed504d15aa8bde423cae9a8e@sentry.iobroker.net/57";console.log(`iobroker.${window.adapterName}@${wst.version}`);const dD=document.getElementById("root");dD&&sI.createRoot(dD).render($.jsx(pst,{}));fst()});export default xst(); diff --git a/admin/index_m.html b/admin/index_m.html index 2a3eae64..543f3d26 100644 --- a/admin/index_m.html +++ b/admin/index_m.html @@ -20,7 +20,7 @@ /> ioBroker.web - + diff --git a/dist/main.d.ts b/dist/main.d.ts new file mode 100644 index 00000000..44b79871 --- /dev/null +++ b/dist/main.d.ts @@ -0,0 +1,65 @@ +import type { Server as HttpServer } from 'node:http'; +import type { Server as HttpsServer } from 'node:https'; +import { type NextFunction, type Request, type Response } from 'express'; +import { Adapter, type AdapterOptions } from '@iobroker/adapter-core'; +export type Server = HttpServer | HttpsServer; +export declare class WebAdapter extends Adapter { + private indexHtml; + private webConfig; + private checkTimeout; + private vendorPrefix; + private webServer; + private store; + private secret; + private socketUrl; + private readonly cache; + private ownSocket; + private lang; + private readonly extensions; + private readonly bruteForce; + private socketIoFile; + private readonly webPreSettings; + private readonly webByVersion; + private loginPage; + private ownGroups; + private ownUsers; + constructor(options?: Partial); + onObjectChange(id: string, obj: ioBroker.Object | null | undefined): void; + onStateChange(id: string, state: ioBroker.State | null | undefined): void; + onFileChange(id: string, fileName: string, size: number | null): void; + onMessage(msg: ioBroker.Message): void; + onUnload(callback: () => void): void; + onReady(): Promise; + updatePreSettings(obj: ioBroker.InstanceObject): void; + getExtensionsAndSettings(): Promise; + getListOfAllAdapters(req: Request): Promise; + /** + * Transform pattern like %protocol%://%web.0_bind%:%port into https://192.168.1.1:8081 + * + * @param link Pattern + * @param instanceObj Current instance object + * @param instancesMap All instances + */ + resolveLink(link: string, instanceObj: ioBroker.InstanceObject | undefined, instancesMap: Record): string | { + [instance: `${string}.${number}`]: string; + }; + getInfoJs(): string; + prepareLoginTemplate(): string; + checkUser: (userName: string | undefined, password: string | undefined, cb: (err: Error | null, userName?: string | false) => void) => void; + initAuth(): void; + /** + * Send response to a byte ranges request + * + * @param req - request object + * @param res - response object + * @param buffer - buffer to be sent + */ + sendRange(req: Request, res: Response, buffer: Buffer): void; + getSocketIoFile(req: Request, res: Response, next: NextFunction | true): void; + isInWhiteList(req: Request): string; + getFoldersOfObject(path: string | undefined): Promise; + processReadFolders(req: Request, res: Response): Promise; + getSocketUrl(obj?: ioBroker.InstanceObject): Promise; + initWebServer(): Promise; + main(): Promise; +} diff --git a/dist/main.js b/dist/main.js new file mode 100644 index 00000000..3d29db97 --- /dev/null +++ b/dist/main.js @@ -0,0 +1,2050 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WebAdapter = void 0; +const node_fs_1 = require("node:fs"); +const node_path_1 = require("node:path"); +const express_session_1 = __importDefault(require("express-session")); +const express_1 = __importDefault(require("express")); +const mime_types_1 = require("mime-types"); +const compression_1 = __importDefault(require("compression")); +const cookie_signature_1 = __importDefault(require("cookie-signature")); +const cookie_parser_1 = __importDefault(require("cookie-parser")); +const body_parser_1 = __importDefault(require("body-parser")); +const passport_1 = __importDefault(require("passport")); +const passport_local_1 = require("passport-local"); +const connect_flash_1 = __importDefault(require("connect-flash")); +const adapter_core_1 = require("@iobroker/adapter-core"); // Get common adapter utils +const webserver_1 = require("@iobroker/webserver"); +const ONE_MONTH_SEC = 30 * 24 * 3600; +const LOGIN_PAGE = '/login/index.html'; +const wwwDir = 'www'; +const FORBIDDEN_CHARS = /[\][*,;'"`<>\\\s?]/g; // with space +// copied from here: https://github.com/component/escape-html/blob/master/index.js +const matchHtmlRegExp = /["'&<>]/; +function escapeHtml(str) { + const _str = `${str}`; + const match = matchHtmlRegExp.exec(_str); + if (!match) { + return _str; + } + let escape; + let html = ''; + let index; + let lastIndex = 0; + for (index = match.index; index < _str.length; index++) { + switch (_str.charCodeAt(index)) { + case 34: // " + escape = '"'; + break; + case 38: // & + escape = '&'; + break; + case 39: // ' + escape = '''; + break; + case 60: // < + escape = '<'; + break; + case 62: // > + escape = '>'; + break; + default: + continue; + } + if (lastIndex !== index) { + html += _str.substring(lastIndex, index); + } + lastIndex = index + 1; + html += escape; + } + return lastIndex !== index ? html + _str.substring(lastIndex, index) : html; +} +function getLinkVar(placeHolder, obj, attr, link) { + if (attr === 'protocol') { + attr = 'secure'; + } + if (placeHolder === 'ip') { + link = link.replace(`%${placeHolder}%`, '$host$'); + } + else if (placeHolder === 'instance') { + const instance = obj?._id.split('.').pop() || ''; + link = link.replace(`%${placeHolder}%`, instance); + } + else if (obj) { + // remove "native_" from e.g. "native_port" + if (attr.startsWith('native_')) { + attr = attr.substring(7); + } + let val = obj.native[attr]; + if (placeHolder === 'bind' && (!val || val === '0.0.0.0')) { + val = '$host$'; + } + if (attr === 'secure') { + link = link.replace(`%${placeHolder}%`, val ? 'https' : 'http'); + } + else { + if (!link.includes(`%${placeHolder}%`)) { + link = link.replace(`%native_${placeHolder}%`, val === 0 ? '0' : val?.toString() || ''); + } + else { + link = link.replace(`%${placeHolder}%`, val === 0 ? '0' : val?.toString() || ''); + } + } + } + else { + // No instance object => set empty values + if (attr === 'secure') { + link = link.replace(`%${placeHolder}%`, 'http'); + } + else { + if (!link.includes(`%${placeHolder}%`)) { + link = link.replace(`%native_${placeHolder}%`, ''); + } + else { + link = link.replace(`%${placeHolder}%`, ''); + } + } + } + return link; +} +function processOneWelcome(welcomeScreen, isPro, adapterObj, foundInstanceIDs, list) { + let ws; + if (typeof welcomeScreen === 'string') { + ws = { + link: welcomeScreen, + name: adapterObj.common.name, + color: adapterObj.common.color || '', + img: adapterObj.common.icon || '', + }; + } + else { + ws = welcomeScreen; + } + // disabled for non-pro + if (!isPro && ws.name === 'vis editor') { + return; + } + let localLink; + // If we have localLinks=['_default'] + if (ws.localLinks && typeof ws.localLinks === 'string') { + if (adapterObj.common.localLinks && typeof adapterObj.common.localLinks[ws.localLinks] === 'object') { + localLink = adapterObj.common.localLinks[ws.localLinks].link; + } + else { + localLink = ws.localLinks; + } + } + else if (ws.localLink?.toString() === 'true' && adapterObj.common.localLink) { + // localLink = true + localLink = adapterObj.common.localLink; + } + else if (ws.localLink) { + // localLink = '%protocol%://%bind%:%port%' + localLink = ws.localLink || ''; + } + else { + // link = '%protocol%://%bind%:%port%' + localLink = ws.link; + } + if (ws.localLink) { + if (foundInstanceIDs.length > 1) { + foundInstanceIDs.forEach((id) => { + list.push({ + ...ws, + localLink, + name: ws.name, + color: ws.color, + pro: isPro, + id: foundInstanceIDs[0], + instance: parseInt(id.split('.').pop() || '', 10) || 0, + }); + }); + } + else { + list.push({ ...ws, localLink, pro: isPro, id: foundInstanceIDs[0] }); + } + } + else { + list.push({ ...ws, localLink, pro: isPro }); + } +} +function processWelcome(welcomeScreen, isPro, adapterObj, foundInstanceIDs, list) { + if (welcomeScreen) { + if (Array.isArray(welcomeScreen)) { + for (let w = 0; w < welcomeScreen.length; w++) { + let ws; + if (typeof welcomeScreen[w] === 'string') { + ws = { + link: welcomeScreen[w], + name: adapterObj.common.name, + color: adapterObj.common.color || '', + img: adapterObj.common.icon || '', + }; + } + else { + ws = welcomeScreen[w]; + } + processOneWelcome(ws, isPro, adapterObj, foundInstanceIDs, list); + } + } + else { + let ws; + if (typeof welcomeScreen === 'string') { + ws = { + link: welcomeScreen, + name: adapterObj.common.name, + color: adapterObj.common.color || '', + img: adapterObj.common.icon || '', + }; + } + else { + ws = welcomeScreen; + } + processOneWelcome(ws, isPro, adapterObj, foundInstanceIDs, list); + } + } +} +function getRedirectPage(req) { + let redirect = '../'; + let parts; + const body = req.body || {}; + // const isDev = req.url.includes('?dev&'); + const origin = body.origin || '?href=%2F'; + if (origin) { + parts = origin.split('='); + if (parts.length > 1 && parts[1]) { + redirect = decodeURIComponent(parts[1]); + // if some invalid characters in redirect + if (redirect.match(/[^-_a-zA-Z0-9&%?./]/)) { + redirect = '../'; + } + } + } + return redirect; +} +function extractPreSetting(obj, attr) { + const parts = attr.split('.'); + if (parts.length === 1) { + if ((obj && typeof obj === 'object') || (obj !== null && obj !== undefined)) { + return obj[attr]; + } + return null; + } + attr = parts.shift() || ''; + if (obj[attr] && typeof obj[attr] === 'object') { + return extractPreSetting(obj[attr], parts.join('.')); + } + return null; +} +class WebAdapter extends adapter_core_1.Adapter { + indexHtml = ''; + webConfig; + checkTimeout; + vendorPrefix = ''; + webServer = { + server: null, + io: null, + app: null, + }; + store = null; + secret = 'Zgfr56gFe87jJOM'; // Will be generated by first start + socketUrl = ''; + cache = {}; // cached web files + ownSocket = false; + lang = 'en'; + extensions = {}; + bruteForce = {}; + socketIoFile = false; + webPreSettings = {}; + webByVersion = {}; + loginPage = null; + ownGroups = null; + ownUsers = null; + constructor(options = {}) { + super({ + ...options, + name: 'web', + unload: callback => this.onUnload(callback), + message: obj => this.onMessage(obj), + stateChange: (id, state) => this.onStateChange(id, state), + ready: () => this.main(), + objectChange: (id, obj) => this.onObjectChange(id, obj), + fileChange: (id, fileName, size) => this.onFileChange(id, fileName, size), + }); + this.webConfig = this.config; + } + onObjectChange(id, obj) { + if (this.ownGroups && id.startsWith('system.group.')) { + if (obj) { + this.ownGroups[id] = obj; + } + else { + delete this.ownGroups[id]; + } + } + if (this.ownUsers && id.startsWith('system.user.')) { + if (obj) { + this.ownUsers[id] = obj; + } + else { + delete this.ownUsers[id]; + } + } + if (id.startsWith('system.adapter')) { + if (obj?.common?.webExtension && + obj.native && + (this.extensions[id.substring('system.adapter.'.length)] || + obj.native.webInstance === '*' || + obj.native.webInstance === this.namespace)) { + return this.setForeignState(`system.adapter.${this.namespace}.alive`, false, true, () => this.terminate ? this.terminate(-100) : process.exit(-100)); + } + // 'system.adapter.'.length = 15 + const _id = id.substring(15).replace(/\.\d+$/, ''); + if (obj?.common?.webByVersion) { + this.webByVersion[_id] = obj.common.version; + } + else if (this.webByVersion[_id]) { + delete this.webByVersion[_id]; + } + } + if (obj?.common?.webPreSettings && obj.type === 'instance') { + this.updatePreSettings(obj); + } + if (!this.ownSocket && id === this.webConfig.socketio) { + void this.getSocketUrl(obj).then(() => { + this.log.info(`SocketURL now "${this.socketUrl}"`); + }); + } + // If system language desired => update language + if (id === 'system.config' && !this.webConfig.language) { + this.lang = obj?.common?.language || 'en'; + } + if (this.webServer?.io) { + try { + this.webServer.io.publishAll('objectChange', id, obj); + } + catch (e) { + this.log.error(`Cannot objectChange to io: ${e}`); + } + } + // inform extensions + Object.keys(this.extensions).forEach(instance => { + try { + if (typeof this.extensions[instance].obj?.objectChange === 'function') { + this.extensions[instance].obj.objectChange(id, obj); + } + } + catch (err) { + this.log.error(`Cannot call objectChange for "${instance}": ${err.message}`); + } + }); + } + onStateChange(id, state) { + this.webServer?.io?.publishAll('stateChange', id, state); + // inform extensions + Object.keys(this.extensions).forEach(instance => { + try { + if (typeof this.extensions[instance].obj?.stateChange === 'function') { + this.extensions[instance].obj.stateChange(id, state); + } + } + catch (err) { + this.log.error(`Cannot call stateChange for "${instance}": ${err.message}`); + } + }); + } + onFileChange(id, fileName, size) { + this.webServer?.io?.publishFileAll(id, fileName, size); + // inform extensions + Object.keys(this.extensions).forEach(instance => { + try { + if (typeof this.extensions[instance].obj?.fileChange === 'function') { + this.extensions[instance].obj.fileChange(id, fileName, size); + } + } + catch (err) { + this.log.error(`Cannot call fileChange for "${instance}": ${err.message}`); + } + }); + } + onMessage(msg) { + if (msg?.command === 'getUserByCookie') { + let cookie = (msg.message?.cookie || '').toString(); + // extract cookie + if (cookie && cookie.includes('connect.sid=')) { + const cookies = cookie.split(';'); + const connectSid = cookies.find(cookie => cookie.trim().startsWith('connect.sid=')); + cookie = (connectSid || '').replace('connect.sid=', '').trim(); + } + // decrypt cookie + if (cookie) { + try { + cookie = cookie_signature_1.default.unsign(decodeURIComponent(cookie).slice(2), this.secret); + } + catch (e) { + this.log.warn(`Cannot decrypt cookie: ${e}`); + } + } + // get session by cookie + if (this.store && cookie && msg.callback) { + this.store.get(cookie, (error, session) => { + this.sendTo(msg.from, msg.command, { error, user: session?.passport?.user }, msg.callback); + }); + } + else if (msg.callback) { + this.sendTo(msg.from, msg.command, { error: 'cookie not found' }, msg.callback); + } + } + else if (msg?.command === 'im') { + // if not instance message + if (this.webServer?.io) { + // to make messages shorter, we code the answer as: + // m - message type + // s - socket ID + // d - data + this.webServer.io.publishInstanceMessageAll(msg.from, msg.message.m, msg.message.s, msg.message.d); + } + } + } + onUnload(callback) { + if (this.checkTimeout) { + this.clearTimeout(this.checkTimeout); + this.checkTimeout = null; + } + try { + const promises = []; + if (this.setStateAsync) { + promises.push(this.setStateAsync('info.connected', '', true)); + promises.push(this.setStateAsync('info.connection', false, true)); + } + Object.keys(this.extensions).forEach(instance => { + try { + if (this.extensions?.[instance]?.obj?.unload) { + const promise = this.extensions[instance].obj.unload(); + if (promise instanceof Promise) { + promises.push(promise.catch(e => this?.log?.error(`Cannot unload web extension "${instance}": ${e}`))); + } + } + } + catch (e) { + this?.log?.error(`Cannot unload web extension "${instance}": ${e}`); + } + }); + let timeout; + if (promises.length) { + timeout = this.setTimeout(() => { + timeout = undefined; + this?.log?.warn(`Timeout by termination of web-extensions!`); + this?.log?.debug(`terminating http${this.webConfig.secure ? 's' : ''} server on port ${this.webConfig.port}`); + this.webServer?.io?.close(); + this.webServer?.server?.close(); + this?.log?.info(`terminated http${this.webConfig.secure ? 's' : ''} server on port ${this.webConfig.port}`); + if (callback) { + callback(); + } + }, 500); + } + void Promise.all(promises) + .catch(e => this?.log?.error(`Cannot unload web extensions: ${e}`)) + .then(() => { + if (!promises.length || timeout) { + this.clearTimeout(timeout); + timeout = null; + this?.log?.debug(`terminating http${this.webConfig.secure ? 's' : ''} server on port ${this.webConfig.port}`); + this.webServer?.io?.close(); + this.webServer?.server?.close(); + this?.log?.info(`terminated http${this.webConfig.secure ? 's' : ''} server on port ${this.webConfig.port}`); + if (callback) { + callback(); + } + } + }); + } + catch { + if (callback) { + callback(); + } + } + } + async onReady() { + this.webConfig = this.config; + // Generate secret for session manager + const systemConfig = await this.getForeignObjectAsync('system.config'); + if (systemConfig) { + if (!systemConfig?.native?.secret) { + systemConfig.native = systemConfig.native || {}; + const buf = await new Promise(resolve => require('crypto').randomBytes(24, (_err, buf) => resolve(buf))); + this.secret = buf.toString('hex'); + await this.extendForeignObjectAsync('system.config', { native: { secret: this.secret } }); + } + else { + this.secret = systemConfig.native.secret; + } + } + else { + this.log.error('Cannot find object system.config'); + } + let uuid = null; + try { + uuid = await this.getForeignObjectAsync('system.meta.uuid'); + } + catch (e) { + this.log.warn(`Cannot read UUID: ${e}`); + } + this.vendorPrefix = + systemConfig?.native?.vendor?.uuidPrefix || + (uuid?.native?.uuid?.length > 36 ? uuid.native.uuid.substring(0, 2) : ''); + // information about connected socket.io adapter + if (this.webConfig.socketio?.match(/^system\.adapter\./)) { + await this.getSocketUrl(); + // Listen for changes + await this.subscribeForeignObjectsAsync(this.webConfig.socketio); + } + else { + this.socketUrl = this.webConfig.socketio; + this.ownSocket = this.socketUrl !== 'none'; + } + // Read language + if (this.webConfig.language) { + this.lang = this.webConfig.language; + } + else if (systemConfig?.common) { + this.lang = systemConfig.common.language || 'en'; + } + await this.main(); + } + updatePreSettings(obj) { + if (!obj?.common) { + return; + } + if (obj.common.webPreSettings) { + for (const attr in obj.common.webPreSettings) { + this.webPreSettings[obj._id] ||= {}; + const _attr = attr.replace(/[^\w0-9]/g, '_'); + this.webPreSettings[obj._id][_attr] = extractPreSetting(obj, obj.common.webPreSettings[attr]); + if (typeof this.webPreSettings[obj._id][_attr] === 'object') { + this.webPreSettings[obj._id][_attr] = JSON.stringify(this.webPreSettings[obj._id][_attr]); + } + else { + const val = this.webPreSettings[obj._id][_attr]; + if (typeof val === 'string') { + this.webPreSettings[obj._id][_attr] = val.replace(/"/g, '\\"'); + } + else { + this.webPreSettings[obj._id][_attr] = val; + } + } + } + } + else if (this.webPreSettings[obj._id]) { + delete this.webPreSettings[obj._id]; + } + } + async getExtensionsAndSettings() { + const doc = await this.getObjectViewAsync('system', 'instance', null); + if (!doc.rows?.length) { + return []; + } + const res = []; + for (let i = 0; i < doc.rows.length; i++) { + const instance = doc.rows[i].value; + if (instance?.common) { + if (!this.webConfig.startDisabledExtensions && !instance.common.enabled) { + const alive = await this.getForeignStateAsync(`${instance._id}.alive`); + if (alive?.val) { + // simulate as it is enabled + instance.common.enabled = true; + } + } + if ((this.webConfig.startDisabledExtensions || instance.common.enabled) && + instance.common.webExtension && + (instance.native.webInstance === this.namespace || instance.native.webInstance === '*')) { + // decrypt all native attributes listed in instance.encryptedNative + if (Array.isArray(instance.encryptedNative) && instance.native) { + instance.encryptedNative.forEach(key => { + if (instance.native[key]) { + instance.native[key] = this.decrypt(this.secret, instance.native[key]); + } + }); + } + res.push(instance); + } + if (instance.common.webPreSettings) { + this.updatePreSettings(instance); + } + if (instance.common.webByVersion) { + // 'system.adapter.'.length = 15 + const _id = doc.rows[i].value._id.substring(15).replace(/\.\d+$/, ''); + this.webByVersion[_id] = instance.common.version; + } + } + } + return res; + } + async getListOfAllAdapters(req) { + // read all instances + const instances = await this.getObjectViewAsync('system', 'instance', {}); + const adapters = await this.getObjectViewAsync('system', 'adapter', {}); + const list = []; + const mapInstances = {}; + for (let r = 0; r < instances.rows.length; r++) { + mapInstances[instances.rows[r].id] = instances.rows[r].value; + } + for (let a = 0; a < adapters.rows.length; a++) { + const obj = adapters.rows[a].value; + let found; + if (instances?.rows) { + found = []; + // find if any instance of this adapter exists and started + for (let i = 0; i < instances.rows.length; i++) { + // remove number from instance + const id = instances.rows[i].id.replace(/\.\d+$/, ''); + if (id === obj._id && + instances.rows[i].value.common + // && (true || instances.rows[i].value.common.enabled || instances.rows[i].value.common.onlyWWW) + ) { + found.push(instances.rows[i].id); + } + } + } + if (found?.length) { + // Add from localLinks + if (obj.common.localLinks && typeof obj.common.localLinks === 'object') { + for (const link in obj.common.localLinks) { + if (typeof obj.common.localLinks[link] === 'object') { + let name = obj.common.localLinks[link].name || obj.common.name; + if (typeof name === 'object') { + name = name[this.lang] || name.en; + } + processOneWelcome({ + name, + link: obj.common.localLinks[link].link, + img: obj.common.localLinks[link].icon || obj.common.icon || '', + color: obj.common.localLinks[link].color || obj.common.color || '', + // @ts-expect-error fixed in js-controller + order: obj.common.localLinks[link].order, + }, obj.common.localLinks[link].pro, obj, found, list); + } + } + } + try { + processWelcome(obj.common.welcomeScreen, false, obj, found, list); + processWelcome(obj.common.welcomeScreenPro, true, obj, found, list); + } + catch (e) { + this.log.warn(`Cannot process welcome screen for "${obj._id}": ${e}`); + } + } + } + if (!this.indexHtml && !(0, node_fs_1.existsSync)(`${__dirname}/${wwwDir}/index.html`)) { + return `${__dirname}/${wwwDir}/index.html was not found or no access! Check the file or access rights or start the fixer: "curl -sL https://iobroker.net/fix.sh | bash -"`; + } + this.indexHtml ||= (0, node_fs_1.readFileSync)(`${__dirname}/${wwwDir}/index.html`).toString(); + // Remove duplicated entries + const uniqueList = []; + for (const link of list) { + let found = false; + for (const ul of uniqueList) { + if (ul.localLink === link.localLink && ul.pro === link.pro) { + found = true; + break; + } + } + if (!found) { + uniqueList.push(link); + } + } + // calculate localLinks + for (const listItem of uniqueList) { + if (typeof listItem.localLink === 'string') { + listItem.localLink = this.resolveLink(listItem.localLink, listItem.id ? mapInstances[listItem.id] : undefined, mapInstances); + } + if (!listItem.name) { + // @ts-expect-error deprecated, but could happen + listItem.name = listItem.title; + } + } + // try to find swagger web-extension + // inform extensions + Object.keys(this.extensions).forEach(instance => { + try { + if (typeof this.extensions[instance]?.obj?.welcomePage === 'function') { + uniqueList.push(this.extensions[instance].obj.welcomePage()); + } + } + catch (err) { + this.log.error(`Cannot call welcomePage for "${instance}": ${err.message}`); + } + }); + uniqueList.sort((a, b) => { + const aName = (a.name && typeof a.name === 'object' ? a.name[this.lang] || a.name.en : a.name || '').toLowerCase(); + const bName = (b.name && typeof b.name === 'object' ? b.name[this.lang] || b.name.en : b.name || '').toLowerCase(); + if (a.order === undefined && b.order === undefined) { + if (aName > bName) { + return 1; + } + if (aName < bName) { + return -1; + } + return 0; + } + if (a.order === undefined) { + return -1; + } + if (b.order === undefined) { + return 1; + } + if (a.order > b.order) { + return 1; + } + if (a.order < b.order) { + return -1; + } + if (aName > bName) { + return 1; + } + if (aName < bName) { + return -1; + } + if (a.instance !== undefined && b.instance !== undefined) { + if (a.instance > b.instance) { + return 1; + } + if (a.instance < b.instance) { + return -1; + } + } + return 0; + }); + let text = `systemLang = "${this.lang}";\n`; + text += `list = ${JSON.stringify(uniqueList, null, 2)};\n`; + const whiteListIp = this.isInWhiteList(req); + // if login + text += `let authEnabled = ${this.webConfig.auth && !this.webConfig.basicAuth && !whiteListIp};\n`; + return this.indexHtml.replace('// -- PLACE THE LIST HERE --', text); + } + /** + * Transform pattern like %protocol%://%web.0_bind%:%port into https://192.168.1.1:8081 + * + * @param link Pattern + * @param instanceObj Current instance object + * @param instancesMap All instances + */ + resolveLink(link, instanceObj, instancesMap) { + // Extract all patterns + const vars = link.match(/%(\w+)%/g); + let result; + if (vars) { + // first replace simple patterns + for (let v = vars.length - 1; v >= 0; v--) { + // Remove % at start and end + const _var = vars[v].replace(/%/g, ''); + const [adapterName, variableName] = _var.split('_'); + // like "port" + if (adapterName === 'native' || variableName === undefined) { + link = getLinkVar(_var, instanceObj, _var, link); + vars.splice(v, 1); + } + else if (adapterName.match(/\.\d+$/)) { + // like "web.0_port" + link = getLinkVar(_var, instancesMap[`system.adapter.${adapterName}`], variableName, link); + vars.splice(v, 1); + } + } + const links = {}; + const instances = {}; + // process web_port, as it could have more than one instance + for (const placeHolder of vars) { + const shortPlaceHolder = placeHolder.replace(/%/g, '').replace(/^native_/, ''); + const [adapterName, variableName] = shortPlaceHolder.split('_'); + if (adapterName) { + // collect all instances + instances[adapterName] ||= Object.values(instancesMap) + .map(inst => inst._id.startsWith(`system.adapter.${adapterName}.`) + ? inst._id.replace('system.adapter.', '') + : '') + .filter(inst => inst); + if (!instances[adapterName].length) { + delete instances[adapterName]; + } + else { + for (const instance of instances[adapterName]) { + links[instance] = { + instance, + link: getLinkVar(shortPlaceHolder, instancesMap[`system.adapter.${instance}`], variableName, links[instance]?.link || link), + }; + } + } + } + } + if (instances) { + result = {}; + let count = 0; + let firstLink = ''; + // If we have only one instance, reduce it to string + Object.values(links).forEach(lnk => { + result[lnk.instance] = lnk.link; + firstLink = firstLink || lnk.link; + count++; + }); + if (count < 2) { + link = firstLink; + result = undefined; + } + } + } + return result || link; + } + getInfoJs() { + const result = [ + `var socketUrl = "${this.socketUrl}";`, + `var socketSession = "";`, + `window._authIoBroker = ${this.webConfig.auth};`, + `window.sysLang = "${this.lang}";`, + `window.socketForceWebSockets = ${this.webConfig.forceWebSockets ? 'true' : 'false'};`, + ]; + Object.values(this.webPreSettings).forEach(preSetting => { + if (preSetting) { + for (const attr in preSetting) { + result.push(`window.${attr} = "${preSetting[attr]}";`); + } + } + }); + return result.join(' '); + } + prepareLoginTemplate() { + let def = " font: 13px/20px 'Lucida Grande', Tahoma, Verdana, sans-serif;\n" + + ' color: #404040;\n' + + ' background-color: #0ae;\n' + + ' background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(.5, rgba(255, 255, 255, .2)), color-stop(.5, transparent), to(transparent));\n' + + ' background-image: -webkit-linear-gradient(rgba(255, 255, 255, .2) 50%, transparent 50%, transparent);\n' + + ' background-image: -moz-linear-gradient(rgba(255, 255, 255, .2) 50%, transparent 50%, transparent);\n' + + ' background-image: -ms-linear-gradient(rgba(255, 255, 255, .2) 50%, transparent 50%, transparent);\n' + + ' background-image: -o-linear-gradient(rgba(255, 255, 255, .2) 50%, transparent 50%, transparent);\n' + + ' background-image: linear-gradient(rgba(255, 255, 255, .2) 50%, transparent 50%, transparent);\n' + + ' background-size: 50px 50px;\n'; + const template = (0, node_fs_1.readFileSync)(`${__dirname}/${wwwDir}${LOGIN_PAGE}`).toString('utf8'); + if (this.webConfig.loginBackgroundColor) { + def = `background-color: ${this.webConfig.loginBackgroundColor};\n`; + } + if (this.webConfig.loginBackgroundImage) { + def += ` background-image: url(../${this.namespace}/login-bg.png);\n`; + } + return template.replace('background: black;', def); + } + checkUser = (userName, password, cb) => { + userName = (userName || '') + .toString() + .replace(FORBIDDEN_CHARS, '_') + .replace(/\s/g, '_') + .replace(/\./g, '_') + .toLowerCase(); + if (this.bruteForce[userName] && this.bruteForce[userName].errors > 4) { + let minutes = Date.now() - this.bruteForce[userName].time; + if (this.bruteForce[userName].errors < 7) { + if (Date.now() - this.bruteForce[userName].time < 60000) { + minutes = 1; + } + else { + minutes = 0; + } + } + else if (this.bruteForce[userName].errors < 10) { + if (Date.now() - this.bruteForce[userName].time < 180000) { + minutes = Math.ceil((180000 - minutes) / 60000); + } + else { + minutes = 0; + } + } + else if (this.bruteForce[userName].errors < 15) { + if (Date.now() - this.bruteForce[userName].time < 600000) { + minutes = Math.ceil((600000 - minutes) / 60000); + } + else { + minutes = 0; + } + } + else if (Date.now() - this.bruteForce[userName].time < 3600000) { + minutes = Math.ceil((3600000 - minutes) / 60000); + } + else { + minutes = 0; + } + if (minutes) { + return cb(new Error(`Too many errors. Try again in ${minutes} ${minutes === 1 ? 'minute' : 'minutes'}.`), false); + } + } + void this.checkPassword(userName, password || '', (success) => { + if (!success) { + this.bruteForce[userName] = this.bruteForce[userName] || { errors: 0 }; + this.bruteForce[userName].time = Date.now(); + this.bruteForce[userName].errors++; + } + else if (this.bruteForce[userName]) { + delete this.bruteForce[userName]; + } + if (success) { + return cb(null, userName); + } + return cb(null, false); + }); + }; + initAuth() { + if (!this.webServer.app) { + return; + } + const AdapterStore = adapter_core_1.commonTools.session(express_session_1.default, this.webConfig.ttl); + this.store = new AdapterStore({ adapter: this }); + passport_1.default.use(new passport_local_1.Strategy(this.checkUser)); + passport_1.default.serializeUser((user, done) => + // eslint-disable-next-line @typescript-eslint/no-base-to-string + done(null, user.toString())); + passport_1.default.deserializeUser((serializedUser, done) => done(null, serializedUser)); + this.webServer.app.use((0, cookie_parser_1.default)()); + this.webServer.app.use(body_parser_1.default.urlencoded({ extended: true })); + this.webServer.app.use(body_parser_1.default.json()); + this.webServer.app.use(body_parser_1.default.text()); + this.webServer.app.use((0, express_session_1.default)({ + secret: this.secret, + saveUninitialized: true, + resave: true, + cookie: { maxAge: (parseInt(this.webConfig.ttl, 10) || 3600) * 1000, httpOnly: false }, // default TTL + // @ts-expect-error missing typing + store: this.store, + })); + this.webServer.app.use(passport_1.default.initialize()); + this.webServer.app.use(passport_1.default.session()); + this.webServer.app.use((0, connect_flash_1.default)()); + } + /** + * Send response to a byte ranges request + * + * @param req - request object + * @param res - response object + * @param buffer - buffer to be sent + */ + sendRange(req, res, buffer) { + const ranges = req.range(buffer.length); + if (Array.isArray(ranges) && ranges.length > 1) { + this.log.warn('Multiple ranges currently not supported, sending whole buffer'); + res.status(200).send(buffer); + return; + } + if (!Array.isArray(ranges) || ranges.length === 0) { + res.set('Content-Length', buffer.length.toString()); + res.status(200).send(buffer); + return; + } + // This is for