iobroker.javascript 9.0.1 → 9.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -4
- package/admin/assets/{index-BzKS5vx-.js → index-B2hdKtuj.js} +67 -67
- package/admin/assets/{index-tExaxF69.js → index-C3f8WSiz.js} +1 -1
- package/admin/assets/{index-CfuHVX2B.js → index-glyB1sbj.js} +37 -37
- package/admin/custom/assets/{index-DZqbj5K4.js → index-BzS6q3oS.js} +13 -13
- package/admin/custom/assets/{index-BXmu6lpn.js → index-DQRrNJnQ.js} +1 -1
- package/admin/custom/customComponents.js +2 -2
- package/admin/mf-manifest.json +1 -1
- package/admin/remoteEntry.js +2 -2
- package/admin/tab.html +1 -1
- package/build-backend/lib/patternCompareFunctions.js +28 -56
- package/build-backend/lib/patternCompareFunctions.js.map +1 -1
- package/build-backend/lib/protectFs.js +116 -66
- package/build-backend/lib/protectFs.js.map +1 -1
- package/build-backend/lib/scheduler.js +0 -3
- package/build-backend/lib/scheduler.js.map +1 -1
- package/io-package.json +15 -15
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as _e,u as cr,l as ur,a as Nr}from"./createTheme-BwMO3rTt.js";import{C as b,R as a}from"./ConfigCustomJavascriptSet__loadShare__react__loadShare__-CzzIM-HW.js";import{C as g}from"./ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_material__loadShare__-BlV79j8y.js";import{C as m,a as tc,D as un,u as sc}from"./index-B8sZ2j0S.js";import{g as ic}from"./_commonjsHelpers-D6-XlEtG.js";import{u as oc}from"./useTheme-CDtRWagv.js";import"./ConfigCustomJavascriptSet__mf_v__runtimeInit__mf_v__-BaLGCXMi.js";import"./useTheme-MELayQMj.js";import"./useThemeWithoutDefault-C-hl_s0Z.js";import"./defaultTheme-avbtL0lf.js";const Ai=11/23/100;function lr(i){const e={r:0,g:0,b:0};if(i.length===7)e.r=parseInt(i.substring(1,3),16),e.g=parseInt(i.substring(3,5),16),e.b=parseInt(i.substring(5,7),16);else if(i.length===4){const t=i[1],s=i[2],o=i[3];e.r=parseInt(t+t,16),e.g=parseInt(s+s,16),e.b=parseInt(o+o,16)}return e}function rc(i){return`#${Math.round(i.r).toString(16)}${Math.round(i.g).toString(16)}${Math.round(i.b).toString(16)}`}function Mc(i,e,t){const s=lr(i),o=lr(e);return s.r+=o.r*(.05+Ai*(t-1)),s.g+=o.g*(.05+Ai*(t-1)),s.b+=o.b*(.05+Ai*(t-1)),rc(s)}function Lr(i,e){const t={};for(let s=1;s<=24;s++)t[`elevation${s}`]={backgroundColor:Mc(i,e,s)};return t}function nc(i,e){var M,n,u,N,l,c,L,j,T,D,z;let t,s;i==="dark"?(s={MuiAppBar:{colorDefault:{backgroundColor:"#272727"}},MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:_e[200],"&:hover":{color:_e[100]}}},MuiPaper:Lr("#121212","#fff")},t={name:i,palette:{mode:"dark",background:{paper:"#121212",default:"#121212"},primary:{main:"#4dabf5"},secondary:{main:"#436a93"},expert:"#14bb00",text:{primary:"#ffffff",secondary:"#ffffff"}}}):i==="blue"?(s={MuiAppBar:{colorDefault:{backgroundColor:"#3399CC"}},MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:_e[400],"&:hover":{color:_e[300]}}}},t={name:i,palette:{mode:"dark",background:{paper:"#151d21",default:"#151d21"},primary:{main:"#4dabf5"},secondary:{main:"#436a93"},expert:"#14bb00",text:{primary:"#ffffff",secondary:"#ffffff"}}}):i==="colored"?(s={MuiAppBar:{colorDefault:{backgroundColor:"#2a3135"}},MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:_e[200],"&:hover":{color:_e[100]}}},MuiPaper:Lr("#151d21","#fff")},t={name:i,palette:{mode:"light",primary:{main:"#3399CC"},secondary:{main:"#164477"},expert:"#96fc96"}}):i==="PT"?(s={MuiAppBar:{colorDefault:{backgroundColor:"#0F99DE"}},MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:_e[400],"&:hover":{color:_e[300]}}}},t={name:i,palette:{mode:"light",primary:{main:"#0F99DE"},secondary:{main:"#88A536"},expert:"#BD1B24"}}):i==="DX"?(s={MuiAppBar:{colorDefault:{backgroundColor:"#a9a9a9"}},MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:_e[400],"&:hover":{color:_e[300]}}}},t={name:i,palette:{mode:"light",primary:{main:"#F5F5F7"},secondary:{main:"#a9a9a9"},expert:"#BD1B24",text:{primary:"#007AFE",secondary:"#007AFE",disabled:"#007AFEAA"}}}):(s={MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:_e[400],"&:hover":{color:_e[300]}}}},t={name:i,palette:{mode:"light",primary:{main:"#3399CC",dark:"#256c97",light:"#76d0fd"},secondary:{main:"#164477"},expert:"#14bb00"}}),t.toolbar={height:48},t.saveToolbar={background:(n=(M=t.palette)==null?void 0:M.primary)==null?void 0:n.main,button:{borderRadius:3,height:32}},t.palette&&(t.palette.grey={main:cr[300],dark:cr[400]});const o=ur(t),r=o.palette;return ur(o,{...e||void 0,components:{...s,MuiButton:{variants:[{props:{variant:"contained",color:"grey"},style:{backgroundColor:(u=r.grey)==null?void 0:u[300],color:r.getContrastText&&((N=r.grey)!=null&&N[300])?r.getContrastText(r.grey[300]):void 0}},{props:{variant:"outlined",color:"grey"},style:{color:(l=r.text)==null?void 0:l.primary,borderColor:r.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)","&.Mui-disabled":{border:`1px solid ${(c=r.action)==null?void 0:c.disabledBackground}`},"&:hover":{borderColor:r.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)",backgroundColor:Nr(((L=r.text)==null?void 0:L.primary)||"",((j=r.action)==null?void 0:j.hoverOpacity)||.04)}}},{props:{variant:"text",color:"grey"},style:{color:(T=r.text)==null?void 0:T.primary,"&:hover":{backgroundColor:Nr(((D=r.text)==null?void 0:D.primary)||"",((z=r.action)==null?void 0:z.hoverOpacity)||.04)}}}]},...(e==null?void 0:e.components)||void 0}})}function ac(){let i,e;const t=new Promise((s,o)=>{i=s,e=o});return t.resolve=i,t.reject=e,t}function Hi(i){return(i==null?void 0:i.rows.map(e=>e.value).filter(e=>!!e))??[]}function Ke(i){return i!=null&&i.startsWith("system.host.")||(i=`system.host.${i}`),i}function Ms(i){return i!=null&&i.startsWith("system.host.")&&(i=i.substring(12)),i}function jr(i){return new Promise(e=>{setTimeout(e,i)})}function xs(i){i=(i||"").toString();const e=i[0]==="*",t=i[i.length-1]==="*";return i=i.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*"),(e?"":"^")+i+(t?"":"$")}var Re;(function(i){i[i.CONNECTING=0]="CONNECTING",i[i.CONNECTED=1]="CONNECTED",i[i.OBJECTS_LOADED=2]="OBJECTS_LOADED",i[i.READY=3]="READY"})(Re||(Re={}));var ye;(function(i){i.PERMISSION_ERROR="permissionError",i.NOT_CONNECTED="notConnectedError",i.TIMEOUT="timeout",i.NOT_ADMIN="Allowed only in admin",i.NOT_SUPPORTED="Not supported"})(ye||(ye={}));const t4e=ye.PERMISSION_ERROR;ye.NOT_CONNECTED;const cc=["material","echarts","vis"];class je{constructor(e){this.props=this.applyDefaultProps(e),this.connId=`${this.props.name?`${this.props.name}-`:""}${Math.round(Math.random()*1e6).toString().padStart(6,"0")}`,this.waitForSocketLib().then(()=>this.startSocket()).catch(t=>{alert(`Socket connection could not be initialized: ${t}`)})}applyDefaultProps(e){return{...e,protocol:e.protocol||window.location.protocol,host:e.host||window.location.hostname,port:e.port||(window.location.port==="3000"?8081:window.location.port),ioTimeout:Math.max(e.ioTimeout||2e4,2e4),cmdTimeout:Math.max(e.cmdTimeout||5e3,5e3),admin5only:e.admin5only||!1,autoSubscribes:e.autoSubscribes??[],autoSubscribeLog:e.autoSubscribeLog??!1,doNotLoadACL:e.doNotLoadACL??!0,doNotLoadAllObjects:e.doNotLoadAllObjects??!0}}props;connId;lastAccessToken=null;ignoreState="";connected=!1;subscribed=!1;firstConnect=!0;waitForRestart=!1;loaded=!1;simStates={};statesSubscribes={};filesSubscribes={};objectsSubscribes={};objects={};states={};acl=null;isSecure=!1;onReadyDone=!1;onConnectionHandlers=[];onLogHandlers=[];onCmdStdoutHandler;onCmdStderrHandler;onCmdExitHandler;onError(e){(this.props.onError??console.error)(e)}_socket;_waitForSocketPromise;_waitForFirstConnectionPromise=ac();_instanceSubscriptions={};_promises={};_authTimer=null;_refreshTimer=null;_systemConfig;get systemConfig(){return this._systemConfig}systemLang="en";static isWeb(){return window.socketUrl!==void 0}waitForSocketLib(){return this._waitForSocketPromise?this._waitForSocketPromise:(this._waitForSocketPromise=new Promise(async(e,t)=>{if(typeof window.io>"u"&&typeof window.iob>"u")if(typeof window.registerSocketOnLoad=="function")window.registerSocketOnLoad(()=>e());else{for(let s=1;s<=30;s++){if(window.io||window.iob)return e();await jr(100)}t(new Error("Socket library could not be loaded!"))}else e()}),this._waitForSocketPromise)}async startSocket(){if(this._socket)return;let e=this.props.host,t=this.props.port,s=(this.props.protocol||window.location.protocol).replace(":",""),o=window.location.pathname;if(window.location.hostname==="iobroker.net"||window.location.hostname==="iobroker.pro")o="";else{if(window.socketUrl){const n=new URL(window.socketUrl);e=n.hostname,t=n.port,s=n.protocol.replace(":","")}const M=o.lastIndexOf("/");if(M!==-1&&(o=o.substring(0,M+1)),je.isWeb()){const n=o.split("/");n.length>2&&(n.pop(),n.pop(),cc.includes(n[n.length-1])&&n.pop(),o=n.join("/"),o.endsWith("/")||(o+="/"))}}const r=t?`${s}://${e}:${t}`:`${s}://${e}`;return this._socket=(window.io||window.iob).connect(r,{path:o.endsWith("/")?`${o}socket.io`:`${o}/socket.io`,query:"ws=true",name:this.props.name,timeout:this.props.ioTimeout,uuid:this.props.uuid,token:this.props.token}),this._socket.on("connect",M=>{window.addEventListener("storage",this.onAccessTokenUpdated);const n=je.readTokens();if(n&&!n.owner){const u=Date.now();this.saveTokens({access_token:n.access_token,refresh_token:n.refresh_token,expires_in:Math.round((n.expires_in.getTime()-u)/1e3),refresh_token_expires_in:Math.round((n.refresh_token_expires_in.getTime()-u)/1e3),token_type:"Bearer"},n.stayLoggedIn)}this.onReadyDone=!1,M!==!0?(this.connected=!0,setTimeout(()=>this.getVersion().then(u=>{const[N,l,c]=u.version.split(".");parseInt(N,10)*1e4+parseInt(l,10)*100+parseInt(c,10)<40102?(this._authTimer=null,this.onPreConnect(!1,!1)):this._socket.emit("authenticate",(j,T)=>this.onPreConnect(j,T))}).catch(u=>this.onError({message:u.toString(),operation:"getVersion"})),500)):this._socket.emit("authenticate",(u,N)=>{this.onPreConnect(u,N)})}),this._socket.on("reconnect",()=>{var M,n;this.onReadyDone=!1,(n=(M=this.props).onProgress)==null||n.call(M,Re.READY),this.connected=!0,this.waitForRestart?window.location.reload():(this._subscribe(!0),this.onConnectionHandlers.forEach(u=>u(!0)))}),this._socket.on("disconnect",()=>{var M,n;this.onReadyDone=!1,this.connected=!1,this.subscribed=!1,(n=(M=this.props).onProgress)==null||n.call(M,Re.CONNECTING),this.onConnectionHandlers.forEach(u=>u(!1))}),this._socket.on("reauthenticate",()=>this.authenticate()),this._socket.on("log",M=>{var n,u;(u=(n=this.props).onLog)==null||u.call(n,M),this.onLogHandlers.forEach(N=>N(M))}),this._socket.on("error",M=>{let n;M==null?n="":typeof M.toString=="function"?n=M.toString():(n=JSON.stringify(M),console.error(`Received strange error: ${n}`)),n.includes("User not authorized")?this.authenticate():n.includes("websocket error")?(console.error(`Socket Error => reload: ${M}`),window.location.reload()):console.error(`Socket Error: ${M}`)}),this._socket.on("connect_error",M=>console.error(`Connect error: ${M}`)),this._socket.on("permissionError",M=>this.onError({message:"no permission",operation:M.operation,type:M.type,id:M.id||""})),this._socket.on("objectChange",(M,n)=>{setTimeout(()=>this.objectChange(M,n),0)}),this._socket.on("stateChange",(M,n)=>{setTimeout(()=>this.stateChange(M,n),0)}),this._socket.on("im",(M,n,u)=>{setTimeout(()=>this.instanceMessage(M,n,u),0)}),this._socket.on("fileChange",(M,n,u)=>{setTimeout(()=>this.fileChange(M,n,u),0)}),this._socket.on("cmdStdout",(M,n)=>{var u;(u=this.onCmdStdoutHandler)==null||u.call(this,M,n)}),this._socket.on("cmdStderr",(M,n)=>{var u;(u=this.onCmdStderrHandler)==null||u.call(this,M,n)}),this._socket.on("cmdExit",(M,n)=>{var u;(u=this.onCmdExitHandler)==null||u.call(this,M,n)}),Promise.resolve()}onPreConnect(e,t){var s,o;this._authTimer&&(clearTimeout(this._authTimer),this._authTimer=null),this.connected=!0,this.isSecure=t,this.waitForRestart?window.location.reload():(this.firstConnect?this.loadData().catch(r=>console.error(`Cannot load data: ${r}`)):(o=(s=this.props).onProgress)==null||o.call(s,Re.READY),this._subscribe(!0),this.onConnectionHandlers.forEach(r=>r(!0)),this.checkAccessTokenExpire()),this._waitForFirstConnectionPromise.resolve()}static readTokens(){let e=window.sessionStorage.getItem("iob_tokens");const t=!e;if(e||(e=window.localStorage.getItem("iob_tokens")),!e)return null;const[s,o,r,M,n]=e.split(";"),u=new Date(o);return u.getTime()<Date.now()?null:{refresh_token:s,refresh_token_expires_in:u,access_token:r,expires_in:new Date(M),owner:n,stayLoggedIn:t}}static saveTokensStatic(e,t,s){const o=`${e.refresh_token};${new Date(Date.now()+e.refresh_token_expires_in*1e3).toISOString()};${e.access_token};${new Date(Date.now()+e.expires_in*1e3).toISOString()}${s?`;${s}`:""}`;t?window.localStorage.setItem("iob_tokens",o):window.sessionStorage.setItem("iob_tokens",o)}saveTokens(e,t){je.saveTokensStatic(e,t,this.connId)}static deleteTokensStatic(){window.localStorage.removeItem("iob_tokens"),window.sessionStorage.removeItem("iob_tokens")}deleteTokens(e,t){const s=je.readTokens();s&&(t?je.deleteTokensStatic():s.stayLoggedIn===e&&s.owner===this.connId&&(s.stayLoggedIn?window.localStorage.removeItem("iob_tokens"):window.sessionStorage.removeItem("iob_tokens")))}onAccessTokenUpdated=e=>{if(e.key==="iob_tokens"){const t=je.readTokens();t&&(console.log(`Tab ${this.connId} received updated token: ${t.access_token}`),this.updateTokenExpiration(t.access_token))}};updateTokenExpiration(e){this.lastAccessToken!==e&&(this.lastAccessToken=e,this._socket.emit("updateTokenExpiration",e,(t,s)=>{t?(console.error(`[UPDATE/${new Date().toISOString()}] cannot say to server about new token: ${t}`),window.location.reload()):s?console.log(`[UPDATE/${new Date().toISOString()}] server accepted new token: ${e}`):(console.error(`[UPDATE/${new Date().toISOString()}] cannot say to server about new token`),window.location.reload())})),this.checkAccessTokenExpire()}refreshTokens(e,t){if(!e){console.log(`[REFRESH/${new Date().toISOString()}] No token structure found => reloading the page`),setTimeout(()=>window.location.reload(),500);return}t||!e.owner||e.owner===this.connId?(console.log(`[REFRESH/${new Date().toISOString()}] claim ownership of the token`),this.acquireTokenLock()?(console.log(`[REFRESH/${new Date().toISOString()}] refreshing token`),fetch("./oauth/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`grant_type=refresh_token&refresh_token=${e.refresh_token}&client_id=ioBroker&stayloggedin=${e.stayLoggedIn}`}).then(s=>{if(s.ok)return s.json();throw new Error("Cannot refresh access token")}).then(s=>{if(s.access_token)console.log(`[REFRESH/${new Date().toISOString()}] received new token: ${s.access_token}`),this.saveTokens(s,e.stayLoggedIn),this.releaseTokenLock(),this.updateTokenExpiration(s.access_token);else throw new Error("Cannot get access token")}).catch(s=>{console.warn(`[REFRESH/${new Date().toISOString()}] cannot refresh token: ${s}`),this.releaseTokenLock(),this.deleteTokens(e.stayLoggedIn),console.error(s),window.location.reload()})):(console.log(`[REFRESH/${new Date().toISOString()}] Someone else is updating the token, so wait for the next check`),this.checkAccessTokenExpire())):this.lastAccessToken!==e.access_token&&this.updateTokenExpiration(e.access_token)}acquireTokenLock(){const e=Date.now(),t=localStorage.getItem("iob_token_semaphore");if(t)try{const o=JSON.parse(t);if(e<o.expiry)return!1}catch{}const s={connId:this.connId,expiry:e+10*1e3};return localStorage.setItem("iob_token_semaphore",JSON.stringify(s)),!0}releaseTokenLock(){const e=localStorage.getItem("iob_token_semaphore");if(e)try{JSON.parse(e).connId===this.connId&&localStorage.removeItem("iob_token_semaphore")}catch{localStorage.removeItem("iob_token_semaphore")}}checkAccessTokenExpire(){if(this._refreshTimer&&(clearTimeout(this._refreshTimer),this._refreshTimer=null),this.isSecure){const e=je.readTokens();if(e){const t=e.expires_in.getTime();if(t<Date.now()+3e4){const s=t<Date.now()+5500;console.log(`[TOKEN/${new Date().toISOString()}] Updating refresh token ${e.access_token}`),e.refresh_token?e.owner===this.connId||s?(e.owner===this.connId?console.log(`[TOKEN/${new Date().toISOString()}] We are the owner of the token`):console.log(`[TOKEN/${new Date().toISOString()}] We are not the owner of the token, but we will take ownership`),this.props.tokenTimeoutHandler?(console.log(`[TOKEN/${new Date().toISOString()}] Asking GUI if we should prolong the token`),this.props.tokenTimeoutHandler(t).then(o=>{o?(console.log(`[TOKEN/${new Date().toISOString()}] Token will be prolonged`),this.refreshTokens(e,s)):(console.log(`[TOKEN/${new Date().toISOString()}] Token will not be prolonged. Reloading the page`),setTimeout(()=>window.location.reload(),Date.now()>t?500:t-Date.now()))})):(console.log(`[TOKEN/${new Date().toISOString()}] No tokenTimeoutHandler defined. Prolonging the token`),this.refreshTokens(e,s))):this.lastAccessToken!==e.access_token?(console.log(`[TOKEN/${new Date().toISOString()}] We are not the owner of the token, but we will inform the server about new token`),this.refreshTokens(e)):(console.log(`[TOKEN/${new Date().toISOString()}] We are not the owner of the token and the token did not change. Check in 3 seconds if the owner updated the token`),this._refreshTimer=setTimeout(()=>{this._refreshTimer=null,this.checkAccessTokenExpire()},3e3)):(console.log(`[TOKEN/${new Date().toISOString()}] We do not have a refresh token, so we need to reauthenticate`),setTimeout(()=>window.location.reload(),Date.now()>t?500:t-Date.now()))}else this._refreshTimer=setTimeout(()=>{this._refreshTimer=null,this.checkAccessTokenExpire()},t-Date.now()-3e4>12e4?12e4:t-Date.now()-3e4)}}}static isCloud(){return window.location.hostname.includes("amazonaws.com")||window.location.hostname.includes("iobroker.in")?!0:typeof window.socketUrl>"u"?!1:window.socketUrl.includes("iobroker.in")||window.socketUrl.includes("amazonaws")}isConnected(){return this.connected}waitForFirstConnection(){return this._waitForFirstConnectionPromise}async getUserPermissions(){return this.request({commandTimeout:!1,executor:(e,t)=>{this._socket.emit("getUserPermissions",(s,o)=>{s?t(s):e(o||null)})}})}async loadData(){if(this.loaded)return;const e=10;for(let t=1;t<=e;t++){if(this.doLoadData().catch(s=>console.error(`Cannot load data: ${s}`)),this.loaded)return;await jr(je.isCloud()?5e3:1e3)}}async doLoadData(){var e,t,s,o,r,M,n,u,N;if(!this.loaded){if(!this.props.doNotLoadACL)try{this.acl=await this.getUserPermissions()}catch(l){this.onError(`Cannot read user permissions: ${l}`);return}try{this.props.admin5only&&!je.isWeb()&&(!window.vendorPrefix||window.vendorPrefix==="@@vendorPrefix@@")?this._systemConfig=await this.getCompactSystemConfig():this._systemConfig=await this.getSystemConfig()}catch(l){this.onError(`Cannot read system config: ${l}`);return}this._systemConfig&&(this.systemLang=(e=this._systemConfig.common)==null?void 0:e.language,this.systemLang||(this.systemLang=window.navigator.userLanguage||window.navigator.language,/^(en|de|ru|pt|nl|fr|it|es|pl|uk)-?/.test(this.systemLang)?this.systemLang=this.systemLang.substring(0,2):/^(en|de|ru|pt|nl|fr|it|es|pl|uk|zh-cn)$/.test(this.systemLang)||(this.systemLang="en"),this._systemConfig.common.language=this.systemLang)),(s=(t=this.props).onLanguage)==null||s.call(t,this.systemLang),this.loaded=!0,(r=(o=this.props).onProgress)==null||r.call(o,Re.CONNECTED),this.firstConnect=!1,this.props.doNotLoadAllObjects?this.props.admin5only?this.objects={}:this.objects={"system.config":this._systemConfig}:this.objects=await this.getObjects(),(n=(M=this.props).onProgress)==null||n.call(M,Re.READY),this.onReadyDone||(this.onReadyDone=!0,(N=(u=this.props).onReady)==null||N.call(u,this.objects))}}authenticate(){window.location.search.includes("&href=")?window.location.href=`${window.location.protocol}//${window.location.host}${window.location.pathname}${window.location.search}`:window.location.href=`${window.location.protocol}//${window.location.host}${window.location.pathname}?login&href=${encodeURIComponent(window.location.search+window.location.hash)}`}async subscribeState(...e){let t,s,o;e.length===3?[t,s,o]=e:([t,o]=e,s=!1);let r;if(Array.isArray(t)?r=t:r=[t],typeof o!="function")throw new Error("The state change handler must be a function!");const M=[];for(let n=0;n<r.length;n++){const u=r[n];this.statesSubscribes[u]?!this.statesSubscribes[u].cbs.includes(o)&&this.statesSubscribes[u].cbs.push(o):(this.statesSubscribes[u]={reg:new RegExp(xs(u)),cbs:[o]},t!==this.ignoreState&&M.push(u))}if(this.connected)if(M.length&&this._socket.emit("subscribe",M),s){let n;for(let u=0;u<r.length;u++){try{n=await this.getBinaryState(r[u])}catch(N){console.error(`Cannot getBinaryState "${r[u]}": ${JSON.stringify(N)}`),n=void 0}n!=null&&o(r[u],n)}}else if(r.find(n=>n.includes("*"))){let n;for(let u=0;u<r.length;u++){try{n=await this.getForeignStates(r[u])}catch(N){console.error(`Cannot getForeignStates "${r[u]}": ${JSON.stringify(N)}`);return}if(n)for(const[N,l]of Object.entries(n)){const c=o(N,l);c instanceof Promise&&c.catch(L=>console.error(`Cannot call state change handler: ${L}`))}}}else try{const n=await(je.isWeb()?this.getStates(r):this.getForeignStates(r));if(n)for(const[u,N]of Object.entries(n)){const l=o(u,N);l instanceof Promise&&l.catch(c=>console.error(`Cannot call state change handler: ${c}`))}}catch(n){console.error(`Cannot getState "${r.join(", ")}": ${n.message}`);return}}async subscribeStateAsync(e,t){return this.subscribeState(e,t)}unsubscribeState(e,t){var r;let s;Array.isArray(e)?s=e:s=[e];const o=[];for(let M=0;M<s.length;M++){const n=s[M];if(this.statesSubscribes[n]){const u=this.statesSubscribes[n];if(t){const N=u.cbs.indexOf(t);N!==-1&&u.cbs.splice(N,1)}else u.cbs=[];(r=u.cbs)!=null&&r.length||(delete this.statesSubscribes[n],n!==this.ignoreState&&o.push(n))}}this.connected&&o.length&&this._socket.emit("unsubscribe",s)}subscribeObject(e,t){let s;if(Array.isArray(e)?s=e:s=[e],typeof t!="function")throw new Error("The object change handler must be a function!");const o=[];for(let r=0;r<s.length;r++){const M=s[r];this.objectsSubscribes[M]?!this.objectsSubscribes[M].cbs.includes(t)&&this.objectsSubscribes[M].cbs.push(t):(this.objectsSubscribes[M]={reg:new RegExp(xs(M)),cbs:[t]},o.push(M))}return this.connected&&o.length&&this._socket.emit("subscribeObjects",o),Promise.resolve()}unsubscribeObject(e,t){var r;let s;Array.isArray(e)?s=e:s=[e];const o=[];for(let M=0;M<s.length;M++){const n=s[M];if(this.objectsSubscribes[n]){const u=this.objectsSubscribes[n];if(t){const N=u.cbs.indexOf(t);N!==-1&&u.cbs.splice(N,1)}else u.cbs=[];(r=u.cbs)!=null&&r.length||(delete this.objectsSubscribes[n],o.push(n))}}return this.connected&&o.length&&this._socket.emit("unsubscribeObjects",o),Promise.resolve()}objectChange(e,t){var r,M;let s;this.objects[e]&&(s={_id:e,type:this.objects[e].type});let o=!1;t?(t._rev&&this.objects[e]&&(this.objects[e]._rev=t._rev),(!this.objects[e]||JSON.stringify(this.objects[e])!==JSON.stringify(t))&&(this.objects[e]=t,o=!0)):this.objects[e]&&(delete this.objects[e],o=!0);for(const[n,u]of Object.entries(this.objectsSubscribes))(n===e||u.reg.test(e))&&u.cbs.forEach(N=>{try{const l=N(e,t,s);l instanceof Promise&&l.catch(c=>console.error(`Cannot call object change handler: ${c}`))}catch(l){console.error(`Error by callback of objectChange: ${l}`)}});if(o){const n=(M=(r=this.props).onObjectChange)==null?void 0:M.call(r,e,t);n instanceof Promise&&n.catch(u=>console.error(`Cannot call object change handler: ${u}`))}}stateChange(e,t){for(const s of Object.values(this.statesSubscribes))if(s.reg.test(e))for(const o of s.cbs)try{const r=o(e,t??null);r instanceof Promise&&r.catch(M=>console.error(`Cannot call state change handler: ${M}`))}catch(r){console.error(`Error by callback of stateChanged: ${r}`)}}instanceMessage(e,t,s){var o;(o=this._instanceSubscriptions[t])==null||o.forEach(r=>{if(r.messageType===e){const M=r.callback(s,t,e);M instanceof Promise&&M.catch(n=>console.error(`Cannot call instance message handler: ${n}`))}})}fileChange(e,t,s){for(const o of Object.values(this.filesSubscribes))if(o.regId.test(e)&&o.regFilePattern.test(t))for(const r of o.cbs)try{r(e,t,s)}catch(M){console.error(`Error by callback of fileChange: ${M}`)}}async subscribeFiles(e,t,s){if(typeof s!="function")throw new Error("The state change handler must be a function!");let o;Array.isArray(t)?o=t:o=[t];const r=[];for(let M=0;M<o.length;M++){const n=o[M],u=`${e}$%$${n}`;this.filesSubscribes[u]?!this.filesSubscribes[u].cbs.includes(s)&&this.filesSubscribes[u].cbs.push(s):(this.filesSubscribes[u]={regId:new RegExp(xs(e)),regFilePattern:new RegExp(xs(n)),cbs:[s]},r.push(n))}return this.connected&&r.length&&this._socket.emit("subscribeFiles",e,r),Promise.resolve()}unsubscribeFiles(e,t,s){var M;let o;Array.isArray(t)?o=t:o=[t];const r=[];for(let n=0;n<o.length;n++){const u=o[n],N=`${e}$%$${u}`;if(this.filesSubscribes[N]){const l=this.filesSubscribes[N];if(s){const c=l.cbs.indexOf(s);c!==-1&&l.cbs.splice(c,1)}else l.cbs=[];(M=l.cbs)!=null&&M.length||(delete this.filesSubscribes[N],r.push(u))}}this.connected&&r.length&&this._socket.emit("unsubscribeFiles",e,r)}async request({cacheKey:e,forceUpdate:t,commandTimeout:s,onTimeout:o,requireAdmin:r,requireFeatures:M,executor:n}){if(r&&je.isWeb())return Promise.reject(new Error(ye.NOT_ADMIN));if(e&&!t&&e in this._promises)return this._promises[e];if(!this.connected)return Promise.reject(new Error(ye.NOT_CONNECTED));if(M!=null&&M.length){for(const N of M)if(!await this.checkFeatureSupported(N))throw new Error(ye.NOT_SUPPORTED)}const u=new Promise(async(N,l)=>{const c={elapsed:!1,clearTimeout:()=>{}};let L;s!==!1&&(L=setTimeout(()=>{c.elapsed=!0,o==null||o(),e&&this._promises[e]instanceof Promise&&delete this._promises[e],l(new Error(ye.TIMEOUT))},s??this.props.cmdTimeout),c.clearTimeout=()=>{clearTimeout(L)});try{await n(N,l,c)}catch(j){e&&this._promises[e]instanceof Promise&&delete this._promises[e],l(new Error(j.toString()))}});return e&&(this._promises[e]=u),u}resetCache(e,t){t?Object.keys(this._promises).filter(s=>s.startsWith(e)).forEach(s=>{delete this._promises[s]}):delete this._promises[e]}getStates(e){return this.request({commandTimeout:!1,executor:(t,s)=>{this._socket.emit("getStates",e,(o,r)=>{this.states=r??{},o?s(o):t(this.states)})}})}getState(e){return this.request({commandTimeout:!1,executor:(t,s)=>{if(e&&e===this.ignoreState){t(this.simStates[e]||{val:null,ack:!0});return}this._socket.emit("getState",e,(o,r)=>{o?s(o):t(r)})}})}getBinaryState(e){return this.request({commandTimeout:!1,executor:(t,s)=>{this._socket.emit("getBinaryState",e,(o,r)=>{o?s(o):t(r)})}})}setBinaryState(e,t){return this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("setBinaryState",e,t,r=>{r?o(r):s()})}})}setState(e,t,s){return typeof s=="boolean"&&(t={val:t,ack:s}),this.request({commandTimeout:!1,executor:(o,r)=>{if(e&&e===this.ignoreState){let M;if(typeof s=="boolean"||typeof t=="object"&&t.val!==void 0?M=t:M={val:t,ack:!1,ts:Date.now(),lc:Date.now(),from:"system.adapter.vis.0"},this.simStates[e]=M,this.statesSubscribes[e])for(const n of this.statesSubscribes[e].cbs)try{const u=n(e,M);u instanceof Promise&&u.catch(N=>console.error(`Cannot call state change handler: ${N}`))}catch(u){console.error(`Error by callback of stateChanged: ${u}`)}o();return}this._socket.emit("setState",e,t,M=>{M?r(M):o()})}})}getObjects(e,t){return this.request({commandTimeout:!1,executor:(s,o)=>{if(!e&&this.objects){s(this.objects);return}this._socket.emit(je.isWeb()?"getObjects":"getAllObjects",(r,M)=>{var n,u;t||(u=(n=this.props).onProgress)==null||u.call(n,Re.OBJECTS_LOADED),r?o(r):(this.objects=M??{},s(this.objects))})}})}getObjectsById(e){return this.request({commandTimeout:!1,executor:(t,s)=>{this._socket.emit("getObjects",e,(o,r)=>{o?s(o):t(r)})}})}_subscribe(e){var t,s;if(e&&!this.subscribed){this.subscribed=!0,(t=this.props.autoSubscribes)!=null&&t.length&&this._socket.emit("subscribeObjects",this.props.autoSubscribes);const o=Object.keys(this.objectsSubscribes);o.length&&this._socket.emit("subscribeObjects",o),Object.keys(this.objectsSubscribes).forEach(r=>this._socket.emit("subscribeObjects",r)),this.props.autoSubscribeLog&&this._socket.emit("requireLog",!0),Object.keys(this.statesSubscribes).forEach(r=>this._socket.emit("subscribe",r)),Object.keys(this.filesSubscribes).forEach(r=>{const[M,n]=r.split("$%$");this._socket.emit("subscribeFiles",M,n)})}else if(!e&&this.subscribed){this.subscribed=!1,(s=this.props.autoSubscribes)!=null&&s.length&&this._socket.emit("unsubscribeObjects",this.props.autoSubscribes);const o=Object.keys(this.objectsSubscribes);o.length&&this._socket.emit("unsubscribeObjects",o),this.props.autoSubscribeLog&&this._socket.emit("requireLog",!1),Object.keys(this.statesSubscribes).forEach(r=>this._socket.emit("unsubscribe",r)),Object.keys(this.filesSubscribes).forEach(r=>{const[M,n]=r.split("$%$");this._socket.emit("unsubscribeFiles",M,n)})}}requireLog(e){return this.request({commandTimeout:!1,executor:(t,s)=>{this._socket.emit("requireLog",e,o=>{o?s(o):t()})}})}delObject(e,t=!1){return this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("delObject",e,{maintenance:t},r=>{r?o(r):s()})}})}delObjects(e,t){return this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("delObjects",e,{maintenance:t},r=>{r?o(r):s()})}})}setObject(e,t){return t?(t=JSON.parse(JSON.stringify(t)),delete t.from,delete t.user,delete t.ts,this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("setObject",e,t,r=>{r?o(r):s()})}})):Promise.reject(new Error("Null object is not allowed"))}getObject(e){return this.request({commandTimeout:!1,executor:(t,s)=>{if(e&&e===this.ignoreState){t({_id:this.ignoreState,type:"state",common:{name:"ignored state",type:"mixed"}});return}this._socket.emit("getObject",e,(o,r)=>{o?s(o):t(r)})}})}sendTo(e,t,s){return this.request({commandTimeout:!1,executor:o=>{this._socket.emit("sendTo",e,t,s,r=>{o(r)})}})}extendObject(e,t){return t?(t=JSON.parse(JSON.stringify(t)),delete t.from,delete t.user,delete t.ts,this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("extendObject",e,t,r=>{r?o(r):s()})}})):Promise.reject(new Error("Null object is not allowed"))}registerLogHandler(e){this.onLogHandlers.includes(e)||this.onLogHandlers.push(e)}unregisterLogHandler(e){const t=this.onLogHandlers.indexOf(e);t!==-1&&this.onLogHandlers.splice(t,1)}registerConnectionHandler(e){this.onConnectionHandlers.includes(e)||this.onConnectionHandlers.push(e)}unregisterConnectionHandler(e){const t=this.onConnectionHandlers.indexOf(e);t!==-1&&this.onConnectionHandlers.splice(t,1)}registerCmdStdoutHandler(e){this.onCmdStdoutHandler=e}unregisterCmdStdoutHandler(){this.onCmdStdoutHandler=void 0}registerCmdStderrHandler(e){this.onCmdStderrHandler=e}unregisterCmdStderrHandler(){this.onCmdStderrHandler=void 0}registerCmdExitHandler(e){this.onCmdExitHandler=e}unregisterCmdExitHandler(){this.onCmdExitHandler=void 0}getEnums(e,t){return this.request({cacheKey:`enums_${e||"all"}`,forceUpdate:t,commandTimeout:!1,executor:(s,o)=>{this._socket.emit("getObjectView","system","enum",{startkey:`enum.${e||""}`,endkey:e?`enum.${e}.香`:"enum.香"},(r,M)=>{if(r)o(r);else{const n={};if(M)for(let u=0;u<M.rows.length;u++)e&&M.rows[u].id===`enum.${e}`||(n[M.rows[u].id]=M.rows[u].value);s(n)}})}})}getObjectView(e,t,s){return this.getObjectViewCustom("system",s,e,t)}getObjectViewSystem(e,t,s){return this.getObjectViewCustom("system",e,t,s)}getObjectViewCustom(e,t,s,o){return this.request({commandTimeout:!1,executor:(r,M)=>{s=s||"",o=o||"香",this._socket.emit("getObjectView",e,t,{startkey:s,endkey:o},(n,u)=>{if(n)M(n);else{const N={};if(u&&u.rows)for(let l=0;l<u.rows.length;l++)N[u.rows[l].id]=u.rows[l].value;r(N)}})}})}readMetaItems(){return this.request({commandTimeout:!1,executor:(e,t)=>{this._socket.emit("getObjectView","system","meta",{startkey:"",endkey:"香"},(s,o)=>{var r;s?t(s):e((r=o.rows)==null?void 0:r.map(M=>M.value).filter(M=>!!M))})}})}readDir(e,t){return this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("readDir",e,t,(r,M)=>{r?o(r):s(M)})}})}readFile(e,t,s){return this.request({commandTimeout:!1,executor:(o,r)=>{this._socket.emit(s?"readFile64":"readFile",e,t,(M,n,u)=>{M?r(M):o({file:n,mimeType:u})})}})}writeFile64(e,t,s){return this.request({commandTimeout:!1,executor:(o,r)=>{if(typeof s=="string")this._socket.emit("writeFile",e,t,s,M=>{M?r(M):o()});else{const M=btoa(new Uint8Array(s).reduce((n,u)=>n+String.fromCharCode(u),""));this._socket.emit("writeFile64",e,t,M,n=>{n?r(n):o()})}}})}deleteFile(e,t){return this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("deleteFile",e,t,r=>{r?o(r):s()})}})}deleteFolder(e,t){return this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("deleteFolder",e,t,r=>{r?o(r):s()})}})}rename(e,t,s){return this.request({commandTimeout:!1,executor:(o,r)=>{this._socket.emit("rename",e,t,s,M=>{M?r(M):o()})}})}renameFile(e,t,s){return this.request({commandTimeout:!1,executor:(o,r)=>{this._socket.emit("renameFile",e,t,s,M=>{M?r(M):o()})}})}cmdExec(e,t,s,o){return this.request({commandTimeout:o,executor:(r,M,n)=>{e=Ke(e),this._socket.emit("cmdExec",e,s,t,u=>{n.elapsed||(n.clearTimeout(),u?M(u):r())})}})}getSystemConfig(e){return this.request({cacheKey:"systemConfig",forceUpdate:e,commandTimeout:!1,executor:async t=>{let s=await this.getObject("system.config");s??={},s.common??={},s.native??={},t(s)}})}getCompactSystemConfig(e){return this.request({cacheKey:"systemConfigCommon",forceUpdate:e,commandTimeout:!1,requireAdmin:!0,executor:(t,s)=>{this._socket.emit("getCompactSystemConfig",(o,r)=>{o?s(o):(r??={},r.common??={},r.native??={},t(r))})}})}getForeignStates(e){return this.request({commandTimeout:!1,executor:(t,s)=>{this._socket.emit("getForeignStates",e||"*",(o,r)=>{o?s(o):t(r??{})})}})}getForeignObjects(e,t){return this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("getForeignObjects",e||"*",t,(r,M)=>{r?o(r):s(M)})}})}setSystemConfig(e){return this.setObject("system.config",e)}getRawSocket(){return this._socket}getHistory(e,t){return this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("getHistory",e,t,(r,M)=>{r?o(r):s(M)})}})}getHistoryEx(e,t){return this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("getHistory",e,t,(r,M,n,u)=>{r?o(r):s({values:M,sessionId:u,step:n})})}})}getIpAddresses(e,t){return e=Ke(e),this.request({cacheKey:`IPs_${e}`,forceUpdate:t,commandTimeout:!1,executor:async s=>{const o=await this.getObject(e);s((o==null?void 0:o.common.address)??[])}})}getVersion(e){return this.request({cacheKey:"version",forceUpdate:e,commandTimeout:!1,executor:(t,s)=>{this._socket.emit("getVersion",(o,r,M)=>{o&&!r&&typeof o=="string"&&o.match(/\d+\.\d+\.\d+/)?t({version:o,serverName:"socketio"}):o?s(o):t({version:r,serverName:M})})}})}getWebServerName(){return this.request({cacheKey:"webName",commandTimeout:!1,executor:(e,t)=>{this._socket.emit("getAdapterName",(s,o)=>{s?t(s):e(o)})}})}fileExists(e,t){return this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("fileExists",e,t,(r,M)=>{r?o(r):s(!!M)})}})}getCurrentUser(){return this.request({commandTimeout:!1,executor:e=>{this._socket.emit("authEnabled",(t,s)=>{e(s)})}})}getUuid(){return this.request({cacheKey:"uuid",commandTimeout:!1,executor:async e=>{var s;const t=await this.getObject("system.meta.uuid");e((s=t==null?void 0:t.native)==null?void 0:s.uuid)}})}checkFeatureSupported(e,t){return this.request({cacheKey:`supportedFeatures_${e}`,forceUpdate:t,commandTimeout:!1,executor:(s,o)=>{this._socket.emit("checkFeatureSupported",e,(r,M)=>{r?o(r):s(M)})}})}getAdapterInstances(e,t){return typeof e=="boolean"&&(t=e,e=""),e=e||"",this.request({cacheKey:`instances_${e}`,forceUpdate:t,commandTimeout:!1,executor:async s=>{const o=e?`system.adapter.${e}.`:"system.adapter.",r=`${o}香`,M=await this.getObjectViewSystem("instance",o,r),n=Object.values(M);s(e?n.filter(u=>u.common.name===e):n)}})}getAdapters(e,t){return typeof e=="boolean"&&(t=e,e=""),e=e||"",this.request({cacheKey:`adapter_${e}`,forceUpdate:t,commandTimeout:!1,executor:async s=>{const o=await this.getObjectViewSystem("adapter",`system.adapter.${e||""}`,`system.adapter.${e||"香"}`),r=Object.values(o);s(e?r.filter(M=>M.common.name===e):r)}})}getGroups(e){return this.request({cacheKey:"groups",forceUpdate:e,commandTimeout:!1,executor:(t,s)=>{this._socket.emit("getObjectView","system","group",{startkey:"system.group.",endkey:"system.group.香"},(o,r)=>{o?s(o):t(Hi(r))})}})}logout(){return this.request({commandTimeout:!1,executor:(e,t)=>{this._socket.emit("logout",s=>{s?t(s):e(null)})}})}subscribeOnInstance(e,t,s,o){return this.request({commandTimeout:!1,executor:(r,M)=>{this._socket.emit("clientSubscribe",e,t,s,(n,u)=>{n?M(n):u&&(u.error?M(u.error):(e.startsWith("system.adapter.")||(e=`system.adapter.${e}`),this._instanceSubscriptions[e]=this._instanceSubscriptions[e]||[],this._instanceSubscriptions[e].find(N=>N.messageType===t&&N.callback===o)||this._instanceSubscriptions[e].push({messageType:t,callback:o}),r(u)))})}})}unsubscribeFromInstance(e,t,s){var M;e.startsWith("system.adapter.")||(e=`system.adapter.${e}`);let o;const r=[];do{o=!1;const n=(M=this._instanceSubscriptions[e])==null?void 0:M.findIndex(u=>(!t||u.messageType===t)&&(!s||u.callback===s));if(n!=null&&n!==-1){o=!0;const u=this._instanceSubscriptions[e][n].messageType;this._instanceSubscriptions[e].splice(n,1),this._instanceSubscriptions[e].length||delete this._instanceSubscriptions[e],this._instanceSubscriptions[e]&&this._instanceSubscriptions[e].find(l=>l.messageType===u)||r.push(this.request({commandTimeout:!1,executor:(l,c)=>{this._socket.emit("clientUnsubscribe",e,t,(L,j)=>L?c(L):l(j))}}))}}while(o&&(!s||!t));return r.length?Promise.all(r).then(n=>!!n.find(u=>u)):Promise.resolve(!1)}log(e,t){return e?this.request({commandTimeout:!1,executor:s=>(this._socket.emit("log",e,t),s(null))}):Promise.resolve(null)}setStateToIgnore(e){this.ignoreState=e}}function uc(i,e){if(!e)return;let t;if(e.length<700&&(e.indexOf("/")!==-1||e.indexOf("\\")!==-1))if(i.toLowerCase().includes("private"))t="private";else if(e.toLowerCase().includes("private"))t="private";else if(i.toLowerCase().includes("public"))t="public";else if(e.toLowerCase().includes("public"))t="public";else if(i.toLowerCase().includes("chain"))t="chained";else if(e.toLowerCase().includes("chain"))t="chained";else return;else t=e.substring(0,26)==="-----BEGIN RSA PRIVATE KEY"||e.substring(0,22)==="-----BEGIN PRIVATE KEY"?"private":"public",t==="public"&&e.split("-----END CERTIFICATE-----").filter(o=>o.replace(/\r\n|\r|\n/,"").trim()).length>1&&(t="chained");return{name:i,type:t}}function Nc(i){var s,o,r,M;const e=[{name:"[IPv4] 0.0.0.0 - Listen on all IPs",address:"0.0.0.0",family:"ipv4"}],t=[{name:"[IPv6] :: - Listen on all IPs",address:"::",family:"ipv6"}];if((o=(s=i.native)==null?void 0:s.hardware)!=null&&o.networkInterfaces){const n=(M=(r=i.native)==null?void 0:r.hardware)==null?void 0:M.networkInterfaces;Object.keys(n).forEach(u=>{n[u].forEach(N=>{N.family!=="IPv6"?e.push({name:`[${N.family}] ${N.address} - ${u}`,address:N.address,family:"ipv4"}):t.push({name:`[${N.family}] ${N.address} - ${u}`,address:N.address,family:"ipv6"})})})}return{IPs4:e,IPs6:t}}class s4e extends je{constructor(e){super(e)}request(e){return super.request({requireAdmin:!0,...e})}getCertificates(e){return this.request({cacheKey:"cert",forceUpdate:e,commandTimeout:!1,executor:async t=>{var o;const s=await this.getObject("system.certificates");(o=s==null?void 0:s.native)!=null&&o.certificates?t(Object.entries(s.native.certificates).map(([r,M])=>uc(r,M)).filter(r=>!!r)):t([])}})}getLogs(e,t=200){return this.request({commandTimeout:!1,executor:s=>{this._socket.emit("sendToHost",e,"getLogs",t||200,o=>{s(o)})}})}upgradeAdapterWithWebserver(e,t){return this.request({commandTimeout:!1,executor:s=>{this._socket.emit("sendToHost",e,"upgradeAdapterWithWebserver",t,o=>{s(o)})}})}upgradeController(e,t,s){return this.request({commandTimeout:!1,executor:(o,r)=>{this._socket.emit("sendToHost",e,"upgradeController",{version:t,adminInstance:s},M=>{const n=M;n.error?r(n.error):o(n.result)})}})}updateLicenses(e,t){return this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("updateLicenses",e,t,(r,M)=>{r?o(r):s(M)})}})}upgradeOsPackages(e,t,s){return this.request({commandTimeout:!1,executor:o=>{this._socket.emit("sendToHost",e,"upgradeOsPackages",{packages:t,restart:!!s},r=>{o(r)})}})}getLogsFiles(e){return this.request({commandTimeout:!1,executor:(t,s)=>{this._socket.emit("readLogs",e,(o,r)=>{o&&s(o),t(r)})}})}delLogs(e){return this.request({commandTimeout:!1,executor:(t,s)=>{this._socket.emit("sendToHost",e,"delLogs",null,o=>{o&&s(o),t()})}})}deleteFile(e,t){return this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("deleteFile",e,t,r=>{r&&o(r),s()})}})}deleteFolder(e,t){return this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("deleteFolder",e,t,r=>{r&&o(r),s()})}})}rename(e,t,s){return this.request({commandTimeout:!1,executor:(o,r)=>{this._socket.emit("rename",e,t,s,M=>{M&&r(M),o()})}})}renameFile(e,t,s){return this.request({commandTimeout:!1,executor:(o,r)=>{this._socket.emit("renameFile",e,t,s,M=>{M&&r(M),o()})}})}getHosts(e){return this.request({cacheKey:"hosts",forceUpdate:e,commandTimeout:!1,executor:(t,s)=>{this._socket.emit("getObjectView","system","host",{startkey:"system.host.",endkey:"system.host.香"},(o,r)=>{o?s(o):t(Hi(r))})}})}getUsers(e){return this.request({cacheKey:"users",forceUpdate:e,commandTimeout:!1,executor:(t,s)=>{this._socket.emit("getObjectView","system","user",{startkey:"system.user.",endkey:"system.user.香"},(o,r)=>{o?s(o):t(Hi(r))})}})}renameGroup(e,t,s){return this.request({commandTimeout:!1,executor:async o=>{const r=await this.getGroups(!0),M=r.filter(u=>u._id.startsWith(`${e}.`));for(const u of M){const N=u._id,l=t+u._id.substring(e.length);u._id=l,await this.setObject(l,u),await this.delObject(N)}const n=r.find(u=>u._id===e);if(n){const u=n._id;n._id=t,s!==void 0&&(n.common??={},n.common.name=s),await this.setObject(t,n),await this.delObject(u)}o()}})}getHostInfo(e,t,s){return e=Ke(e),this.request({cacheKey:`hostInfo_${e}`,forceUpdate:t,commandTimeout:s,executor:(o,r,M)=>{this._socket.emit("sendToHost",e,"getHostInfo",null,n=>{M.elapsed||(M.clearTimeout(),n===ye.PERMISSION_ERROR?r('May not read "getHostInfo"'):n?o(n):r('Cannot read "getHostInfo"'))})}})}getHostInfoShort(e,t,s){return e=Ke(e),this.request({cacheKey:`hostInfoShort_${e}`,forceUpdate:t,commandTimeout:s,executor:(o,r,M)=>{this._socket.emit("sendToHost",e,"getHostInfoShort",null,n=>{M.elapsed||(M.clearTimeout(),n===ye.PERMISSION_ERROR?r('May not read "getHostInfoShort"'):n?o(n):r('Cannot read "getHostInfoShort"'))})}})}getRepository(e,t,s,o){return this.request({cacheKey:`repository_${e}`,forceUpdate:s,commandTimeout:o,executor:(r,M,n)=>{this._socket.emit("sendToHost",e,"getRepository",t,u=>{n.elapsed||(n.clearTimeout(),u===ye.PERMISSION_ERROR?M('May not read "getRepository"'):u?r(u):M('Cannot read "getRepository"'))})}})}getInstalled(e,t,s){return e=Ke(e),this.request({cacheKey:`installed_${e}`,forceUpdate:t,commandTimeout:s,executor:(o,r,M)=>{this._socket.emit("sendToHost",e,"getInstalled",null,n=>{M.elapsed||(M.clearTimeout(),n===ye.PERMISSION_ERROR?r('May not read "getInstalled"'):n?o(n):r('Cannot read "getInstalled"'))})}})}cmdExec(e,t,s,o){return this.request({commandTimeout:o,executor:(r,M,n)=>{e=Ke(e),this._socket.emit("cmdExec",e,s,t,u=>{n.elapsed||(n.clearTimeout(),u&&M(u),r())})}})}readBaseSettings(e){return e=Ms(e),this.request({requireFeatures:["CONTROLLER_READWRITE_BASE_SETTINGS"],executor:(t,s,o)=>{this._socket.emit("sendToHost",e,"readBaseSettings",null,r=>{o.elapsed||(o.clearTimeout(),r===ye.PERMISSION_ERROR?s('May not read "BaseSettings"'):r?r.error?s(new Error(r.error)):t(r):s('Cannot read "BaseSettings"'))})}})}writeBaseSettings(e,t){return e=Ms(e),this.request({requireFeatures:["CONTROLLER_READWRITE_BASE_SETTINGS"],executor:(s,o,r)=>{this._socket.emit("sendToHost",e,"writeBaseSettings",t,M=>{r.elapsed||(r.clearTimeout(),M===ye.PERMISSION_ERROR?o('May not write "BaseSettings"'):M?s(M):o('Cannot write "BaseSettings"'))})}})}restartController(e){return e=Ms(e),this.request({executor:(t,s,o)=>{this._socket.emit("sendToHost",e,"restartController",null,()=>{o.elapsed||(o.clearTimeout(),t(!0))})}})}getDiagData(e,t){return e=Ms(e),this.request({executor:(s,o,r)=>{this._socket.emit("sendToHost",e,"getDiagData",t,M=>{r.elapsed||(r.clearTimeout(),s(M||null))})}})}changePassword(e,t){return this.request({executor:(s,o,r)=>{this._socket.emit("changePassword",e,t,M=>{r.elapsed||(r.clearTimeout(),M&&o(M),s())})}})}getIpAddresses(e,t){return e=Ke(e),this.request({cacheKey:`IPs_${e}`,forceUpdate:t,commandTimeout:!1,executor:async s=>{const o=await this.getObject(e);s((o==null?void 0:o.common.address)??[])}})}getHostByIp(e,t){return e=Ms(e),this.request({cacheKey:`rIPs_${e}`,forceUpdate:t,executor:(s,o,r)=>{this._socket.emit("getHostByIp",e,(M,n)=>{if(r.elapsed)return;r.clearTimeout();const{IPs4:u,IPs6:N}=Nc(n);s([...u,...N])})}})}encrypt(e){return this.request({executor:(t,s,o)=>{this._socket.emit("encrypt",e,(r,M)=>{o.elapsed||(o.clearTimeout(),r&&s(r),t(M))})}})}decrypt(e){return this.request({executor:(t,s,o)=>{this._socket.emit("decrypt",e,(r,M)=>{o.elapsed||(o.clearTimeout(),r&&s(r),t(M))})}})}chmodFile(e,t,s){return this.request({executor:(o,r,M)=>{this._socket.emit("chmodFile",e,t,s,(n,u)=>{M.elapsed||(M.clearTimeout(),n&&r(n),o(u))})}})}chownFile(e,t,s){return this.request({executor:(o,r,M)=>{this._socket.emit("chownFile",e,t,s,(n,u)=>{M.elapsed||(M.clearTimeout(),n&&r(n),o(u))})}})}getNotifications(e,t){return this.request({executor:(s,o,r)=>{this._socket.emit("sendToHost",e,"getNotifications",{category:t},M=>{r.elapsed||(r.clearTimeout(),s(M))})}})}clearNotifications(e,t){return this.request({executor:(s,o,r)=>{this._socket.emit("sendToHost",e,"clearNotifications",{category:t},M=>{r.elapsed||(r.clearTimeout(),s(M))})}})}getIsEasyModeStrict(){return this.request({executor:(e,t,s)=>{this._socket.emit("getIsEasyModeStrict",(o,r)=>{s.elapsed||(s.clearTimeout(),o&&t(o),e(!!r))})}})}getEasyMode(){return this.request({executor:(e,t,s)=>{this._socket.emit("getEasyMode",(o,r)=>{s.elapsed||(s.clearTimeout(),o?t(new Error(o)):e(r))})}})}getRatings(e){return this.request({executor:(t,s,o)=>{this._socket.emit("getRatings",!!e,(r,M)=>{o.elapsed||(o.clearTimeout(),r?s(new Error(r)):t(M))})}})}getCurrentSession(e){const t=new AbortController;return this.request({commandTimeout:e||5e3,onTimeout:()=>{t.abort()},executor:async(s,o,r)=>{try{const M=await fetch("./session",{signal:t.signal});if(r.elapsed)return;r.clearTimeout();const n=await M.json();s(n)}catch(M){o(`getCurrentSession: ${M}`)}}})}getCurrentInstance(){return this.request({cacheKey:"currentInstance",executor:(e,t,s)=>{this._socket.emit("getCurrentInstance",(o,r)=>{s.elapsed||(s.clearTimeout(),o?t(o):e(r))})}})}getAdapterInstances(e,t){let s;return typeof e=="boolean"?(t=e,s=""):s=e||"",this.request({cacheKey:`instances_${s}`,forceUpdate:t,executor:(o,r,M)=>{this._socket.emit("getAdapterInstances",s,(n,u)=>{M.elapsed||(M.clearTimeout(),n&&r(n),o(u))})}})}getAdapters(e,t){let s;return typeof e=="boolean"?(t=e,s=""):s=e||"",this.request({cacheKey:`adapter_${s}`,forceUpdate:t,executor:(o,r,M)=>{this._socket.emit("getAdapters",s,(n,u)=>{M.elapsed||(M.clearTimeout(),n&&r(n),o(u))})}})}getCompactAdapters(e){return this.request({cacheKey:"compactAdapters",forceUpdate:e,executor:(t,s,o)=>{this._socket.emit("getCompactAdapters",(r,M)=>{o.elapsed||(o.clearTimeout(),r&&s(r),t(M))})}})}getAdaptersResetCache(e){e=e??"",this.resetCache(`adapter_${e}`),this.resetCache("compactAdapters")}getCompactInstances(e){return this.request({cacheKey:"compactInstances",forceUpdate:e,executor:(t,s,o)=>{this._socket.emit("getCompactInstances",(r,M)=>{o.elapsed||(o.clearTimeout(),r&&s(r),t(M))})}})}getAdapterInstancesResetCache(e){e=e??"",this.resetCache(`instances_${e}`),this.resetCache("compactInstances")}getCompactInstalled(e,t,s){return e=Ke(e),this.request({cacheKey:`installedCompact_${e}`,forceUpdate:t,commandTimeout:s,executor:(o,r,M)=>{this._socket.emit("getCompactInstalled",e,n=>{M.elapsed||(M.clearTimeout(),n===ye.PERMISSION_ERROR?r('May not read "getCompactInstalled"'):n?o(n):r('Cannot read "getCompactInstalled"'))})}})}getInstalledResetCache(e){e?(this.resetCache(`installedCompact_${e}`),this.resetCache(`installed_${e}`)):(this.resetCache("installedCompact_",!0),this.resetCache("installed_",!0))}getCompactRepository(e,t,s){return e=Ke(e),this.request({cacheKey:`repositoryCompact_${e}`,forceUpdate:t,commandTimeout:s,executor:(o,r,M)=>{this._socket.emit("getCompactRepository",e,n=>{M.elapsed||(M.clearTimeout(),n===ye.PERMISSION_ERROR?r('May not read "getCompactRepository"'):n?o(n):r('Cannot read "getCompactRepository"'))})}})}getRepositoryResetCache(e){e?(this.resetCache(`repositoryCompact_${e}`),this.resetCache(`repository_${e}`)):(this.resetCache("repositoryCompact_",!0),this.resetCache("repository_",!0))}getCompactHosts(e){return this.request({cacheKey:"hostsCompact",forceUpdate:e,executor:(t,s,o)=>{this._socket.emit("getCompactHosts",(r,M)=>{o.elapsed||(o.clearTimeout(),r&&s(r),t(M))})}})}getCompactSystemRepositories(e){return this.request({cacheKey:"repositoriesCompact",forceUpdate:e,executor:(t,s,o)=>{this._socket.emit("getCompactSystemRepositories",(r,M)=>{o.elapsed||(o.clearTimeout(),r&&s(r),t(M))})}})}}const Z=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Ot="9.25.1",te=globalThis;function Ni(){return li(te),te}function li(i){const e=i.__SENTRY__=i.__SENTRY__||{};return e.version=e.version||Ot,e[Ot]=e[Ot]||{}}function Li(i,e,t=te){const s=t.__SENTRY__=t.__SENTRY__||{},o=s[Ot]=s[Ot]||{};return o[i]||(o[i]=e())}const Nn=Object.prototype.toString;function ko(i){switch(Nn.call(i)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Tt(i,Error)}}function es(i,e){return Nn.call(i)===`[object ${e}]`}function ln(i){return es(i,"ErrorEvent")}function gr(i){return es(i,"DOMError")}function lc(i){return es(i,"DOMException")}function tt(i){return es(i,"String")}function Yo(i){return typeof i=="object"&&i!==null&&"__sentry_template_string__"in i&&"__sentry_template_values__"in i}function Qo(i){return i===null||Yo(i)||typeof i!="object"&&typeof i!="function"}function ds(i){return es(i,"Object")}function ji(i){return typeof Event<"u"&&Tt(i,Event)}function Lc(i){return typeof Element<"u"&&Tt(i,Element)}function jc(i){return es(i,"RegExp")}function gi(i){return!!(i!=null&&i.then&&typeof i.then=="function")}function gc(i){return ds(i)&&"nativeEvent"in i&&"preventDefault"in i&&"stopPropagation"in i}function Tt(i,e){try{return i instanceof e}catch{return!1}}function Ln(i){return!!(typeof i=="object"&&i!==null&&(i.__isVue||i._isVue))}function Tc(i){return typeof Request<"u"&&Tt(i,Request)}const Uo=te,yc=80;function jn(i,e={}){if(!i)return"<unknown>";try{let t=i;const s=5,o=[];let r=0,M=0;const n=" > ",u=n.length;let N;const l=Array.isArray(e)?e:e.keyAttrs,c=!Array.isArray(e)&&e.maxStringLength||yc;for(;t&&r++<s&&(N=Dc(t,l),!(N==="html"||r>1&&M+o.length*u+N.length>=c));)o.push(N),M+=N.length,t=t.parentNode;return o.reverse().join(n)}catch{return"<unknown>"}}function Dc(i,e){const t=i,s=[];if(!(t!=null&&t.tagName))return"";if(Uo.HTMLElement&&t instanceof HTMLElement&&t.dataset){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}s.push(t.tagName.toLowerCase());const o=e!=null&&e.length?e.filter(M=>t.getAttribute(M)).map(M=>[M,t.getAttribute(M)]):null;if(o!=null&&o.length)o.forEach(M=>{s.push(`[${M[0]}="${M[1]}"]`)});else{t.id&&s.push(`#${t.id}`);const M=t.className;if(M&&tt(M)){const n=M.split(/\s+/);for(const u of n)s.push(`.${u}`)}}const r=["aria-label","type","name","title","alt"];for(const M of r){const n=t.getAttribute(M);n&&s.push(`[${M}="${n}"]`)}return s.join("")}function vo(){try{return Uo.document.location.href}catch{return""}}function dc(i){if(!Uo.HTMLElement)return null;let e=i;const t=5;for(let s=0;s<t;s++){if(!e)return null;if(e instanceof HTMLElement){if(e.dataset.sentryComponent)return e.dataset.sentryComponent;if(e.dataset.sentryElement)return e.dataset.sentryElement}e=e.parentNode}return null}const zc="Sentry Logger ",Vi=["debug","info","warn","error","log","assert","trace"],ti={};function ts(i){if(!("console"in te))return i();const e=te.console,t={},s=Object.keys(ti);s.forEach(o=>{const r=ti[o];t[o]=e[o],e[o]=r});try{return i()}finally{s.forEach(o=>{e[o]=t[o]})}}function Ic(){let i=!1;const e={enable:()=>{i=!0},disable:()=>{i=!1},isEnabled:()=>i};return Z?Vi.forEach(t=>{e[t]=(...s)=>{i&&ts(()=>{te.console[t](`${zc}[${t}]:`,...s)})}}):Vi.forEach(t=>{e[t]=()=>{}}),e}const B=Li("logger",Ic);function si(i,e=0){return typeof i!="string"||e===0||i.length<=e?i:`${i.slice(0,e)}...`}function Tr(i,e){if(!Array.isArray(i))return"";const t=[];for(let s=0;s<i.length;s++){const o=i[s];try{Ln(o)?t.push("[VueViewModel]"):t.push(String(o))}catch{t.push("[value cannot be serialized]")}}return t.join(e)}function wc(i,e,t=!1){return tt(i)?jc(e)?e.test(i):tt(e)?t?i===e:i.includes(e):!1:!1}function Ti(i,e=[],t=!1){return e.some(s=>wc(i,s,t))}function Ee(i,e,t){if(!(e in i))return;const s=i[e];if(typeof s!="function")return;const o=t(s);typeof o=="function"&&gn(o,s);try{i[e]=o}catch{Z&&B.log(`Failed to replace method "${e}" in object`,i)}}function Et(i,e,t){try{Object.defineProperty(i,e,{value:t,writable:!0,configurable:!0})}catch{Z&&B.log(`Failed to add non-enumerable property "${e}" to object`,i)}}function gn(i,e){try{const t=e.prototype||{};i.prototype=e.prototype=t,Et(i,"__sentry_original__",e)}catch{}}function bo(i){return i.__sentry_original__}function Tn(i){if(ko(i))return{message:i.message,name:i.name,stack:i.stack,...Dr(i)};if(ji(i)){const e={type:i.type,target:yr(i.target),currentTarget:yr(i.currentTarget),...Dr(i)};return typeof CustomEvent<"u"&&Tt(i,CustomEvent)&&(e.detail=i.detail),e}else return i}function yr(i){try{return Lc(i)?jn(i):Object.prototype.toString.call(i)}catch{return"<unknown>"}}function Dr(i){if(typeof i=="object"&&i!==null){const e={};for(const t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t]);return e}else return{}}function Cc(i,e=40){const t=Object.keys(Tn(i));t.sort();const s=t[0];if(!s)return"[object has no keys]";if(s.length>=e)return si(s,e);for(let o=t.length;o>0;o--){const r=t.slice(0,o).join(", ");if(!(r.length>e))return o===t.length?r:si(r,e)}return""}function hc(){const i=te;return i.crypto||i.msCrypto}function fe(i=hc()){let e=()=>Math.random()*16;try{if(i!=null&&i.randomUUID)return i.randomUUID().replace(/-/g,"");i!=null&&i.getRandomValues&&(e=()=>{const t=new Uint8Array(1);return i.getRandomValues(t),t[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,t=>(t^(e()&15)>>t/4).toString(16))}function yn(i){var e,t;return(t=(e=i.exception)==null?void 0:e.values)==null?void 0:t[0]}function pt(i){const{message:e,event_id:t}=i;if(e)return e;const s=yn(i);return s?s.type&&s.value?`${s.type}: ${s.value}`:s.type||s.value||t||"<unknown>":t||"<unknown>"}function Zi(i,e,t){const s=i.exception=i.exception||{},o=s.values=s.values||[],r=o[0]=o[0]||{};r.value||(r.value=e||""),r.type||(r.type="Error")}function Zt(i,e){const t=yn(i);if(!t)return;const s={type:"generic",handled:!0},o=t.mechanism;if(t.mechanism={...s,...o,...e},e&&"data"in e){const r={...o==null?void 0:o.data,...e.data};t.mechanism.data=r}}function dr(i){if(Ac(i))return!0;try{Et(i,"__sentry_captured__",!0)}catch{}return!1}function Ac(i){try{return i.__sentry_captured__}catch{}}const Dn=1e3;function ps(){return Date.now()/Dn}function pc(){const{performance:i}=te;if(!(i!=null&&i.now))return ps;const e=Date.now()-i.now(),t=i.timeOrigin==null?e:i.timeOrigin;return()=>(t+i.now())/Dn}const st=pc();function mc(i){const e=st(),t={sid:fe(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Ec(t)};return i&&Xt(t,i),t}function Xt(i,e={}){if(e.user&&(!i.ipAddress&&e.user.ip_address&&(i.ipAddress=e.user.ip_address),!i.did&&!e.did&&(i.did=e.user.id||e.user.email||e.user.username)),i.timestamp=e.timestamp||st(),e.abnormal_mechanism&&(i.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(i.ignoreDuration=e.ignoreDuration),e.sid&&(i.sid=e.sid.length===32?e.sid:fe()),e.init!==void 0&&(i.init=e.init),!i.did&&e.did&&(i.did=`${e.did}`),typeof e.started=="number"&&(i.started=e.started),i.ignoreDuration)i.duration=void 0;else if(typeof e.duration=="number")i.duration=e.duration;else{const t=i.timestamp-i.started;i.duration=t>=0?t:0}e.release&&(i.release=e.release),e.environment&&(i.environment=e.environment),!i.ipAddress&&e.ipAddress&&(i.ipAddress=e.ipAddress),!i.userAgent&&e.userAgent&&(i.userAgent=e.userAgent),typeof e.errors=="number"&&(i.errors=e.errors),e.status&&(i.status=e.status)}function Oc(i,e){let t={};i.status==="ok"&&(t={status:"exited"}),Xt(i,t)}function Ec(i){return{sid:`${i.sid}`,init:i.init,started:new Date(i.started*1e3).toISOString(),timestamp:new Date(i.timestamp*1e3).toISOString(),status:i.status,errors:i.errors,did:typeof i.did=="number"||typeof i.did=="string"?`${i.did}`:void 0,duration:i.duration,abnormal_mechanism:i.abnormal_mechanism,attrs:{release:i.release,environment:i.environment,ip_address:i.ipAddress,user_agent:i.userAgent}}}function ms(i,e,t=2){if(!e||typeof e!="object"||t<=0)return e;if(i&&Object.keys(e).length===0)return i;const s={...i};for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(s[o]=ms(s[o],e[o],t-1));return s}const Xi="_sentrySpan";function zr(i,e){e?Et(i,Xi,e):delete i[Xi]}function Ir(i){return i[Xi]}function wr(){return fe()}function dn(){return fe().substring(16)}const _c=100;class it{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:wr(),sampleRand:Math.random()}}clone(){const e=new it;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,zr(e,Ir(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Xt(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return t===null?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t=typeof e=="function"?e(this):e,s=t instanceof it?t.getScopeData():ds(t)?e:void 0,{tags:o,extra:r,user:M,contexts:n,level:u,fingerprint:N=[],propagationContext:l}=s||{};return this._tags={...this._tags,...o},this._extra={...this._extra,...r},this._contexts={...this._contexts,...n},M&&Object.keys(M).length&&(this._user=M),u&&(this._level=u),N.length&&(this._fingerprint=N),l&&(this._propagationContext=l),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,zr(this,void 0),this._attachments=[],this.setPropagationContext({traceId:wr(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){var r;const s=typeof t=="number"?t:_c;if(s<=0)return this;const o={timestamp:ps(),...e,message:e.message?si(e.message,2048):e.message};return this._breadcrumbs.push(o),this._breadcrumbs.length>s&&(this._breadcrumbs=this._breadcrumbs.slice(-s),(r=this._client)==null||r.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Ir(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=ms(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const s=(t==null?void 0:t.event_id)||fe();if(!this._client)return B.warn("No client configured on scope - will not capture exception!"),s;const o=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:o,...t,event_id:s},this),s}captureMessage(e,t,s){const o=(s==null?void 0:s.event_id)||fe();if(!this._client)return B.warn("No client configured on scope - will not capture message!"),o;const r=new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:r,...s,event_id:o},this),o}captureEvent(e,t){const s=(t==null?void 0:t.event_id)||fe();return this._client?(this._client.captureEvent(e,{...t,event_id:s},this),s):(B.warn("No client configured on scope - will not capture event!"),s)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}function Sc(){return Li("defaultCurrentScope",()=>new it)}function xc(){return Li("defaultIsolationScope",()=>new it)}class fc{constructor(e,t){let s;e?s=e:s=new it;let o;t?o=t:o=new it,this._stack=[{scope:s}],this._isolationScope=o}withScope(e){const t=this._pushScope();let s;try{s=e(t)}catch(o){throw this._popScope(),o}return gi(s)?s.then(o=>(this._popScope(),o),o=>{throw this._popScope(),o}):(this._popScope(),s)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function Kt(){const i=Ni(),e=li(i);return e.stack=e.stack||new fc(Sc(),xc())}function kc(i){return Kt().withScope(i)}function Yc(i,e){const t=Kt();return t.withScope(()=>(t.getStackTop().scope=i,e(i)))}function Cr(i){return Kt().withScope(()=>i(Kt().getIsolationScope()))}function Qc(){return{withIsolationScope:Cr,withScope:kc,withSetScope:Yc,withSetIsolationScope:(i,e)=>Cr(e),getCurrentScope:()=>Kt().getScope(),getIsolationScope:()=>Kt().getIsolationScope()}}function $o(i){const e=li(i);return e.acs?e.acs:Qc()}function ot(){const i=Ni();return $o(i).getCurrentScope()}function Os(){const i=Ni();return $o(i).getIsolationScope()}function Uc(){return Li("globalScope",()=>new it)}function vc(...i){const e=Ni(),t=$o(e);if(i.length===2){const[s,o]=i;return s?t.withSetScope(s,o):t.withScope(o)}return t.withScope(i[0])}function we(){return ot().getClient()}function bc(i){const e=i.getPropagationContext(),{traceId:t,parentSpanId:s,propagationSpanId:o}=e,r={trace_id:t,span_id:o||dn()};return s&&(r.parent_span_id=s),r}const $c="sentry.source",Pc="sentry.sample_rate",Wc="sentry.previous_trace_sample_rate",Rc="sentry.op",Jc="sentry.origin",zn="sentry.profile_id",In="sentry.exclusive_time",Bc=0,Fc=1,Gc="_sentryScope",Hc="_sentryIsolationScope";function wn(i){return{scope:i[Gc],isolationScope:i[Hc]}}function Vc(i){if(typeof i=="boolean")return Number(i);const e=typeof i=="string"?parseFloat(i):i;if(!(typeof e!="number"||isNaN(e)||e<0||e>1))return e}const Zc="sentry-",Xc=/^sentry-/;function Kc(i){const e=qc(i);if(!e)return;const t=Object.entries(e).reduce((s,[o,r])=>{if(o.match(Xc)){const M=o.slice(Zc.length);s[M]=r}return s},{});if(Object.keys(t).length>0)return t}function qc(i){if(!(!i||!tt(i)&&!Array.isArray(i)))return Array.isArray(i)?i.reduce((e,t)=>{const s=hr(t);return Object.entries(s).forEach(([o,r])=>{e[o]=r}),e},{}):hr(i)}function hr(i){return i.split(",").map(e=>e.split("=").map(t=>{try{return decodeURIComponent(t.trim())}catch{return}})).reduce((e,[t,s])=>(t&&s&&(e[t]=s),e),{})}const Cn=1;let Ar=!1;function eu(i){const{spanId:e,traceId:t,isRemote:s}=i.spanContext(),o=s?e:Po(i).parent_span_id,r=wn(i).scope,M=s?(r==null?void 0:r.getPropagationContext().propagationSpanId)||dn():e;return{parent_span_id:o,span_id:M,trace_id:t}}function tu(i){if(i&&i.length>0)return i.map(({context:{spanId:e,traceId:t,traceFlags:s,...o},attributes:r})=>({span_id:e,trace_id:t,sampled:s===Cn,attributes:r,...o}))}function pr(i){return typeof i=="number"?mr(i):Array.isArray(i)?i[0]+i[1]/1e9:i instanceof Date?mr(i.getTime()):st()}function mr(i){return i>9999999999?i/1e3:i}function Po(i){var s;if(iu(i))return i.getSpanJSON();const{spanId:e,traceId:t}=i.spanContext();if(su(i)){const{attributes:o,startTime:r,name:M,endTime:n,status:u,links:N}=i,l="parentSpanId"in i?i.parentSpanId:"parentSpanContext"in i?(s=i.parentSpanContext)==null?void 0:s.spanId:void 0;return{span_id:e,trace_id:t,data:o,description:M,parent_span_id:l,start_timestamp:pr(r),timestamp:pr(n)||void 0,status:ru(u),op:o[Rc],origin:o[Jc],links:tu(N)}}return{span_id:e,trace_id:t,start_timestamp:0,data:{}}}function su(i){const e=i;return!!e.attributes&&!!e.startTime&&!!e.name&&!!e.endTime&&!!e.status}function iu(i){return typeof i.getSpanJSON=="function"}function ou(i){const{traceFlags:e}=i.spanContext();return e===Cn}function ru(i){if(!(!i||i.code===Bc))return i.code===Fc?"ok":i.message||"unknown_error"}const Mu="_sentryRootSpan";function hn(i){return i[Mu]||i}function Or(){Ar||(ts(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly.")}),Ar=!0)}const An=50,_t="?",Er=/\(error: (.*)\)/,_r=/captureMessage|captureException/;function pn(...i){const e=i.sort((t,s)=>t[0]-s[0]).map(t=>t[1]);return(t,s=0,o=0)=>{const r=[],M=t.split(`
|
|
1
|
+
import{w as _e,u as cr,l as ur,a as Nr}from"./createTheme-BwMO3rTt.js";import{C as b,R as a}from"./ConfigCustomJavascriptSet__loadShare__react__loadShare__-CzzIM-HW.js";import{C as g}from"./ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_material__loadShare__-BlV79j8y.js";import{C as m,a as tc,D as un,u as sc}from"./index-B8sZ2j0S.js";import{g as ic}from"./_commonjsHelpers-D6-XlEtG.js";import{u as oc}from"./useTheme-CDtRWagv.js";import"./ConfigCustomJavascriptSet__mf_v__runtimeInit__mf_v__-BaLGCXMi.js";import"./useTheme-MELayQMj.js";import"./useThemeWithoutDefault-C-hl_s0Z.js";import"./defaultTheme-avbtL0lf.js";const Ai=11/23/100;function lr(i){const e={r:0,g:0,b:0};if(i.length===7)e.r=parseInt(i.substring(1,3),16),e.g=parseInt(i.substring(3,5),16),e.b=parseInt(i.substring(5,7),16);else if(i.length===4){const t=i[1],s=i[2],o=i[3];e.r=parseInt(t+t,16),e.g=parseInt(s+s,16),e.b=parseInt(o+o,16)}return e}function rc(i){return`#${Math.round(i.r).toString(16)}${Math.round(i.g).toString(16)}${Math.round(i.b).toString(16)}`}function Mc(i,e,t){const s=lr(i),o=lr(e);return s.r+=o.r*(.05+Ai*(t-1)),s.g+=o.g*(.05+Ai*(t-1)),s.b+=o.b*(.05+Ai*(t-1)),rc(s)}function Lr(i,e){const t={};for(let s=1;s<=24;s++)t[`elevation${s}`]={backgroundColor:Mc(i,e,s)};return t}function nc(i,e){var M,n,u,N,l,c,L,j,T,D,z;let t,s;i==="dark"?(s={MuiAppBar:{colorDefault:{backgroundColor:"#272727"}},MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:_e[200],"&:hover":{color:_e[100]}}},MuiPaper:Lr("#121212","#fff")},t={name:i,palette:{mode:"dark",background:{paper:"#121212",default:"#121212"},primary:{main:"#4dabf5"},secondary:{main:"#436a93"},expert:"#14bb00",text:{primary:"#ffffff",secondary:"#ffffff"}}}):i==="blue"?(s={MuiAppBar:{colorDefault:{backgroundColor:"#3399CC"}},MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:_e[400],"&:hover":{color:_e[300]}}}},t={name:i,palette:{mode:"dark",background:{paper:"#151d21",default:"#151d21"},primary:{main:"#4dabf5"},secondary:{main:"#436a93"},expert:"#14bb00",text:{primary:"#ffffff",secondary:"#ffffff"}}}):i==="colored"?(s={MuiAppBar:{colorDefault:{backgroundColor:"#2a3135"}},MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:_e[200],"&:hover":{color:_e[100]}}},MuiPaper:Lr("#151d21","#fff")},t={name:i,palette:{mode:"light",primary:{main:"#3399CC"},secondary:{main:"#164477"},expert:"#96fc96"}}):i==="PT"?(s={MuiAppBar:{colorDefault:{backgroundColor:"#0F99DE"}},MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:_e[400],"&:hover":{color:_e[300]}}}},t={name:i,palette:{mode:"light",primary:{main:"#0F99DE"},secondary:{main:"#88A536"},expert:"#BD1B24"}}):i==="DX"?(s={MuiAppBar:{colorDefault:{backgroundColor:"#a9a9a9"}},MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:_e[400],"&:hover":{color:_e[300]}}}},t={name:i,palette:{mode:"light",primary:{main:"#F5F5F7"},secondary:{main:"#a9a9a9"},expert:"#BD1B24",text:{primary:"#007AFE",secondary:"#007AFE",disabled:"#007AFEAA"}}}):(s={MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:_e[400],"&:hover":{color:_e[300]}}}},t={name:i,palette:{mode:"light",primary:{main:"#3399CC",dark:"#256c97",light:"#76d0fd"},secondary:{main:"#164477"},expert:"#14bb00"}}),t.toolbar={height:48},t.saveToolbar={background:(n=(M=t.palette)==null?void 0:M.primary)==null?void 0:n.main,button:{borderRadius:3,height:32}},t.palette&&(t.palette.grey={main:cr[300],dark:cr[400]});const o=ur(t),r=o.palette;return ur(o,{...e||void 0,components:{...s,MuiButton:{variants:[{props:{variant:"contained",color:"grey"},style:{backgroundColor:(u=r.grey)==null?void 0:u[300],color:r.getContrastText&&((N=r.grey)!=null&&N[300])?r.getContrastText(r.grey[300]):void 0}},{props:{variant:"outlined",color:"grey"},style:{color:(l=r.text)==null?void 0:l.primary,borderColor:r.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)","&.Mui-disabled":{border:`1px solid ${(c=r.action)==null?void 0:c.disabledBackground}`},"&:hover":{borderColor:r.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)",backgroundColor:Nr(((L=r.text)==null?void 0:L.primary)||"",((j=r.action)==null?void 0:j.hoverOpacity)||.04)}}},{props:{variant:"text",color:"grey"},style:{color:(T=r.text)==null?void 0:T.primary,"&:hover":{backgroundColor:Nr(((D=r.text)==null?void 0:D.primary)||"",((z=r.action)==null?void 0:z.hoverOpacity)||.04)}}}]},...(e==null?void 0:e.components)||void 0}})}function ac(){let i,e;const t=new Promise((s,o)=>{i=s,e=o});return t.resolve=i,t.reject=e,t}function Hi(i){return(i==null?void 0:i.rows.map(e=>e.value).filter(e=>!!e))??[]}function Ke(i){return i!=null&&i.startsWith("system.host.")||(i=`system.host.${i}`),i}function Ms(i){return i!=null&&i.startsWith("system.host.")&&(i=i.substring(12)),i}function jr(i){return new Promise(e=>{setTimeout(e,i)})}function xs(i){i=(i||"").toString();const e=i[0]==="*",t=i[i.length-1]==="*";return i=i.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*"),(e?"":"^")+i+(t?"":"$")}var Re;(function(i){i[i.CONNECTING=0]="CONNECTING",i[i.CONNECTED=1]="CONNECTED",i[i.OBJECTS_LOADED=2]="OBJECTS_LOADED",i[i.READY=3]="READY"})(Re||(Re={}));var ye;(function(i){i.PERMISSION_ERROR="permissionError",i.NOT_CONNECTED="notConnectedError",i.TIMEOUT="timeout",i.NOT_ADMIN="Allowed only in admin",i.NOT_SUPPORTED="Not supported"})(ye||(ye={}));const t4e=ye.PERMISSION_ERROR;ye.NOT_CONNECTED;const cc=["material","echarts","vis"];class je{constructor(e){this.props=this.applyDefaultProps(e),this.connId=`${this.props.name?`${this.props.name}-`:""}${Math.round(Math.random()*1e6).toString().padStart(6,"0")}`,this.waitForSocketLib().then(()=>this.startSocket()).catch(t=>{alert(`Socket connection could not be initialized: ${t}`)})}applyDefaultProps(e){return{...e,protocol:e.protocol||window.location.protocol,host:e.host||window.location.hostname,port:e.port||(window.location.port==="3000"?8081:window.location.port),ioTimeout:Math.max(e.ioTimeout||2e4,2e4),cmdTimeout:Math.max(e.cmdTimeout||5e3,5e3),admin5only:e.admin5only||!1,autoSubscribes:e.autoSubscribes??[],autoSubscribeLog:e.autoSubscribeLog??!1,doNotLoadACL:e.doNotLoadACL??!0,doNotLoadAllObjects:e.doNotLoadAllObjects??!0}}props;connId;lastAccessToken=null;ignoreState="";connected=!1;subscribed=!1;firstConnect=!0;waitForRestart=!1;loaded=!1;simStates={};statesSubscribes={};filesSubscribes={};objectsSubscribes={};objects={};states={};acl=null;isSecure=!1;onReadyDone=!1;onConnectionHandlers=[];onLogHandlers=[];onCmdStdoutHandler;onCmdStderrHandler;onCmdExitHandler;onError(e){(this.props.onError??console.error)(e)}_socket;_waitForSocketPromise;_waitForFirstConnectionPromise=ac();_instanceSubscriptions={};_promises={};_authTimer=null;_refreshTimer=null;_systemConfig;get systemConfig(){return this._systemConfig}systemLang="en";static isWeb(){return window.socketUrl!==void 0}waitForSocketLib(){return this._waitForSocketPromise?this._waitForSocketPromise:(this._waitForSocketPromise=new Promise(async(e,t)=>{if(typeof window.io>"u"&&typeof window.iob>"u")if(typeof window.registerSocketOnLoad=="function")window.registerSocketOnLoad(()=>e());else{for(let s=1;s<=30;s++){if(window.io||window.iob)return e();await jr(100)}t(new Error("Socket library could not be loaded!"))}else e()}),this._waitForSocketPromise)}async startSocket(){if(this._socket)return;let e=this.props.host,t=this.props.port,s=(this.props.protocol||window.location.protocol).replace(":",""),o=window.location.pathname;if(window.location.hostname==="iobroker.net"||window.location.hostname==="iobroker.pro")o="";else{if(window.socketUrl){const n=new URL(window.socketUrl);e=n.hostname,t=n.port,s=n.protocol.replace(":","")}const M=o.lastIndexOf("/");if(M!==-1&&(o=o.substring(0,M+1)),je.isWeb()){const n=o.split("/");n.length>2&&(n.pop(),n.pop(),cc.includes(n[n.length-1])&&n.pop(),o=n.join("/"),o.endsWith("/")||(o+="/"))}}const r=t?`${s}://${e}:${t}`:`${s}://${e}`;return this._socket=(window.io||window.iob).connect(r,{path:o.endsWith("/")?`${o}socket.io`:`${o}/socket.io`,query:"ws=true",name:this.props.name,timeout:this.props.ioTimeout,uuid:this.props.uuid,token:this.props.token}),this._socket.on("connect",M=>{window.addEventListener("storage",this.onAccessTokenUpdated);const n=je.readTokens();if(n&&!n.owner){const u=Date.now();this.saveTokens({access_token:n.access_token,refresh_token:n.refresh_token,expires_in:Math.round((n.expires_in.getTime()-u)/1e3),refresh_token_expires_in:Math.round((n.refresh_token_expires_in.getTime()-u)/1e3),token_type:"Bearer"},n.stayLoggedIn)}this.onReadyDone=!1,M!==!0?(this.connected=!0,setTimeout(()=>this.getVersion().then(u=>{const[N,l,c]=u.version.split(".");parseInt(N,10)*1e4+parseInt(l,10)*100+parseInt(c,10)<40102?(this._authTimer=null,this.onPreConnect(!1,!1)):this._socket.emit("authenticate",(j,T)=>this.onPreConnect(j,T))}).catch(u=>this.onError({message:u.toString(),operation:"getVersion"})),500)):this._socket.emit("authenticate",(u,N)=>{this.onPreConnect(u,N)})}),this._socket.on("reconnect",()=>{var M,n;this.onReadyDone=!1,(n=(M=this.props).onProgress)==null||n.call(M,Re.READY),this.connected=!0,this.waitForRestart?window.location.reload():(this._subscribe(!0),this.onConnectionHandlers.forEach(u=>u(!0)))}),this._socket.on("disconnect",()=>{var M,n;this.onReadyDone=!1,this.connected=!1,this.subscribed=!1,(n=(M=this.props).onProgress)==null||n.call(M,Re.CONNECTING),this.onConnectionHandlers.forEach(u=>u(!1))}),this._socket.on("reauthenticate",()=>this.authenticate()),this._socket.on("log",M=>{var n,u;(u=(n=this.props).onLog)==null||u.call(n,M),this.onLogHandlers.forEach(N=>N(M))}),this._socket.on("error",M=>{let n;M==null?n="":typeof M.toString=="function"?n=M.toString():(n=JSON.stringify(M),console.error(`Received strange error: ${n}`)),n.includes("User not authorized")?this.authenticate():n.includes("websocket error")?(console.error(`Socket Error => reload: ${M}`),window.location.reload()):console.error(`Socket Error: ${M}`)}),this._socket.on("connect_error",M=>console.error(`Connect error: ${M}`)),this._socket.on("permissionError",M=>this.onError({message:"no permission",operation:M.operation,type:M.type,id:M.id||""})),this._socket.on("objectChange",(M,n)=>{setTimeout(()=>this.objectChange(M,n),0)}),this._socket.on("stateChange",(M,n)=>{setTimeout(()=>this.stateChange(M,n),0)}),this._socket.on("im",(M,n,u)=>{setTimeout(()=>this.instanceMessage(M,n,u),0)}),this._socket.on("fileChange",(M,n,u)=>{setTimeout(()=>this.fileChange(M,n,u),0)}),this._socket.on("cmdStdout",(M,n)=>{var u;(u=this.onCmdStdoutHandler)==null||u.call(this,M,n)}),this._socket.on("cmdStderr",(M,n)=>{var u;(u=this.onCmdStderrHandler)==null||u.call(this,M,n)}),this._socket.on("cmdExit",(M,n)=>{var u;(u=this.onCmdExitHandler)==null||u.call(this,M,n)}),Promise.resolve()}onPreConnect(e,t){var s,o;this._authTimer&&(clearTimeout(this._authTimer),this._authTimer=null),this.connected=!0,this.isSecure=t,this.waitForRestart?window.location.reload():(this.firstConnect?this.loadData().catch(r=>console.error(`Cannot load data: ${r}`)):(o=(s=this.props).onProgress)==null||o.call(s,Re.READY),this._subscribe(!0),this.onConnectionHandlers.forEach(r=>r(!0)),this.checkAccessTokenExpire()),this._waitForFirstConnectionPromise.resolve()}static readTokens(){let e=window.sessionStorage.getItem("iob_tokens");const t=!e;if(e||(e=window.localStorage.getItem("iob_tokens")),!e)return null;const[s,o,r,M,n]=e.split(";"),u=new Date(o);return u.getTime()<Date.now()?null:{refresh_token:s,refresh_token_expires_in:u,access_token:r,expires_in:new Date(M),owner:n,stayLoggedIn:t}}static saveTokensStatic(e,t,s){const o=`${e.refresh_token};${new Date(Date.now()+e.refresh_token_expires_in*1e3).toISOString()};${e.access_token};${new Date(Date.now()+e.expires_in*1e3).toISOString()}${s?`;${s}`:""}`;t?window.localStorage.setItem("iob_tokens",o):window.sessionStorage.setItem("iob_tokens",o)}saveTokens(e,t){je.saveTokensStatic(e,t,this.connId)}static deleteTokensStatic(){window.localStorage.removeItem("iob_tokens"),window.sessionStorage.removeItem("iob_tokens")}deleteTokens(e,t){const s=je.readTokens();s&&(t?je.deleteTokensStatic():s.stayLoggedIn===e&&s.owner===this.connId&&(s.stayLoggedIn?window.localStorage.removeItem("iob_tokens"):window.sessionStorage.removeItem("iob_tokens")))}onAccessTokenUpdated=e=>{if(e.key==="iob_tokens"){const t=je.readTokens();t&&(console.log(`Tab ${this.connId} received updated token: ${t.access_token}`),this.updateTokenExpiration(t.access_token))}};updateTokenExpiration(e){this.lastAccessToken!==e&&(this.lastAccessToken=e,this._socket.emit("updateTokenExpiration",e,(t,s)=>{t?(console.error(`[UPDATE/${new Date().toISOString()}] cannot say to server about new token: ${t}`),window.location.reload()):s?console.log(`[UPDATE/${new Date().toISOString()}] server accepted new token: ${e}`):(console.error(`[UPDATE/${new Date().toISOString()}] cannot say to server about new token`),window.location.reload())})),this.checkAccessTokenExpire()}refreshTokens(e,t){if(!e){console.log(`[REFRESH/${new Date().toISOString()}] No token structure found => reloading the page`),setTimeout(()=>window.location.reload(),500);return}t||!e.owner||e.owner===this.connId?(console.log(`[REFRESH/${new Date().toISOString()}] claim ownership of the token`),this.acquireTokenLock()?(console.log(`[REFRESH/${new Date().toISOString()}] refreshing token`),fetch("./oauth/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`grant_type=refresh_token&refresh_token=${e.refresh_token}&client_id=ioBroker&stayloggedin=${e.stayLoggedIn}`}).then(s=>{if(s.ok)return s.json();throw new Error("Cannot refresh access token")}).then(s=>{if(s.access_token)console.log(`[REFRESH/${new Date().toISOString()}] received new token: ${s.access_token}`),this.saveTokens(s,e.stayLoggedIn),this.releaseTokenLock(),this.updateTokenExpiration(s.access_token);else throw new Error("Cannot get access token")}).catch(s=>{console.warn(`[REFRESH/${new Date().toISOString()}] cannot refresh token: ${s}`),this.releaseTokenLock(),this.deleteTokens(e.stayLoggedIn),console.error(s),window.location.reload()})):(console.log(`[REFRESH/${new Date().toISOString()}] Someone else is updating the token, so wait for the next check`),this.checkAccessTokenExpire())):this.lastAccessToken!==e.access_token&&this.updateTokenExpiration(e.access_token)}acquireTokenLock(){const e=Date.now(),t=localStorage.getItem("iob_token_semaphore");if(t)try{const o=JSON.parse(t);if(e<o.expiry)return!1}catch{}const s={connId:this.connId,expiry:e+10*1e3};return localStorage.setItem("iob_token_semaphore",JSON.stringify(s)),!0}releaseTokenLock(){const e=localStorage.getItem("iob_token_semaphore");if(e)try{JSON.parse(e).connId===this.connId&&localStorage.removeItem("iob_token_semaphore")}catch{localStorage.removeItem("iob_token_semaphore")}}checkAccessTokenExpire(){if(this._refreshTimer&&(clearTimeout(this._refreshTimer),this._refreshTimer=null),this.isSecure){const e=je.readTokens();if(e){const t=e.expires_in.getTime();if(t<Date.now()+3e4){const s=t<Date.now()+5500;console.log(`[TOKEN/${new Date().toISOString()}] Updating refresh token ${e.access_token}`),e.refresh_token?e.owner===this.connId||s?(e.owner===this.connId?console.log(`[TOKEN/${new Date().toISOString()}] We are the owner of the token`):console.log(`[TOKEN/${new Date().toISOString()}] We are not the owner of the token, but we will take ownership`),this.props.tokenTimeoutHandler?(console.log(`[TOKEN/${new Date().toISOString()}] Asking GUI if we should prolong the token`),this.props.tokenTimeoutHandler(t).then(o=>{o?(console.log(`[TOKEN/${new Date().toISOString()}] Token will be prolonged`),this.refreshTokens(e,s)):(console.log(`[TOKEN/${new Date().toISOString()}] Token will not be prolonged. Reloading the page`),setTimeout(()=>window.location.reload(),Date.now()>t?500:t-Date.now()))})):(console.log(`[TOKEN/${new Date().toISOString()}] No tokenTimeoutHandler defined. Prolonging the token`),this.refreshTokens(e,s))):this.lastAccessToken!==e.access_token?(console.log(`[TOKEN/${new Date().toISOString()}] We are not the owner of the token, but we will inform the server about new token`),this.refreshTokens(e)):(console.log(`[TOKEN/${new Date().toISOString()}] We are not the owner of the token and the token did not change. Check in 3 seconds if the owner updated the token`),this._refreshTimer=setTimeout(()=>{this._refreshTimer=null,this.checkAccessTokenExpire()},3e3)):(console.log(`[TOKEN/${new Date().toISOString()}] We do not have a refresh token, so we need to reauthenticate`),setTimeout(()=>window.location.reload(),Date.now()>t?500:t-Date.now()))}else this._refreshTimer=setTimeout(()=>{this._refreshTimer=null,this.checkAccessTokenExpire()},t-Date.now()-3e4>12e4?12e4:t-Date.now()-3e4)}}}static isCloud(){return window.location.hostname.includes("amazonaws.com")||window.location.hostname.includes("iobroker.in")?!0:typeof window.socketUrl>"u"?!1:window.socketUrl.includes("iobroker.in")||window.socketUrl.includes("amazonaws")}isConnected(){return this.connected}waitForFirstConnection(){return this._waitForFirstConnectionPromise}async getUserPermissions(){return this.request({commandTimeout:!1,executor:(e,t)=>{this._socket.emit("getUserPermissions",(s,o)=>{s?t(s):e(o||null)})}})}async loadData(){if(this.loaded)return;const e=10;for(let t=1;t<=e;t++){if(this.doLoadData().catch(s=>console.error(`Cannot load data: ${s}`)),this.loaded)return;await jr(je.isCloud()?5e3:1e3)}}async doLoadData(){var e,t,s,o,r,M,n,u,N;if(!this.loaded){if(!this.props.doNotLoadACL)try{this.acl=await this.getUserPermissions()}catch(l){this.onError(`Cannot read user permissions: ${l}`);return}try{this.props.admin5only&&!je.isWeb()&&(!window.vendorPrefix||window.vendorPrefix==="@@vendorPrefix@@")?this._systemConfig=await this.getCompactSystemConfig():this._systemConfig=await this.getSystemConfig()}catch(l){this.onError(`Cannot read system config: ${l}`);return}this._systemConfig&&(this.systemLang=(e=this._systemConfig.common)==null?void 0:e.language,this.systemLang||(this.systemLang=window.navigator.userLanguage||window.navigator.language,/^(en|de|ru|pt|nl|fr|it|es|pl|uk)-?/.test(this.systemLang)?this.systemLang=this.systemLang.substring(0,2):/^(en|de|ru|pt|nl|fr|it|es|pl|uk|zh-cn)$/.test(this.systemLang)||(this.systemLang="en"),this._systemConfig.common.language=this.systemLang)),(s=(t=this.props).onLanguage)==null||s.call(t,this.systemLang),this.loaded=!0,(r=(o=this.props).onProgress)==null||r.call(o,Re.CONNECTED),this.firstConnect=!1,this.props.doNotLoadAllObjects?this.props.admin5only?this.objects={}:this.objects={"system.config":this._systemConfig}:this.objects=await this.getObjects(),(n=(M=this.props).onProgress)==null||n.call(M,Re.READY),this.onReadyDone||(this.onReadyDone=!0,(N=(u=this.props).onReady)==null||N.call(u,this.objects))}}authenticate(){window.location.search.includes("&href=")?window.location.href=`${window.location.protocol}//${window.location.host}${window.location.pathname}${window.location.search}`:window.location.href=`${window.location.protocol}//${window.location.host}${window.location.pathname}?login&href=${encodeURIComponent(window.location.search+window.location.hash)}`}async subscribeState(...e){let t,s,o;e.length===3?[t,s,o]=e:([t,o]=e,s=!1);let r;if(Array.isArray(t)?r=t:r=[t],typeof o!="function")throw new Error("The state change handler must be a function!");const M=[];for(let n=0;n<r.length;n++){const u=r[n];this.statesSubscribes[u]?!this.statesSubscribes[u].cbs.includes(o)&&this.statesSubscribes[u].cbs.push(o):(this.statesSubscribes[u]={reg:new RegExp(xs(u)),cbs:[o]},t!==this.ignoreState&&M.push(u))}if(this.connected)if(M.length&&this._socket.emit("subscribe",M),s){let n;for(let u=0;u<r.length;u++){try{n=await this.getBinaryState(r[u])}catch(N){console.error(`Cannot getBinaryState "${r[u]}": ${JSON.stringify(N)}`),n=void 0}n!=null&&o(r[u],n)}}else if(r.find(n=>n.includes("*"))){let n;for(let u=0;u<r.length;u++){try{n=await this.getForeignStates(r[u])}catch(N){console.error(`Cannot getForeignStates "${r[u]}": ${JSON.stringify(N)}`);return}if(n)for(const[N,l]of Object.entries(n)){const c=o(N,l);c instanceof Promise&&c.catch(L=>console.error(`Cannot call state change handler: ${L}`))}}}else try{const n=await(je.isWeb()?this.getStates(r):this.getForeignStates(r));if(n)for(const[u,N]of Object.entries(n)){const l=o(u,N);l instanceof Promise&&l.catch(c=>console.error(`Cannot call state change handler: ${c}`))}}catch(n){console.error(`Cannot getState "${r.join(", ")}": ${n.message}`);return}}async subscribeStateAsync(e,t){return this.subscribeState(e,t)}unsubscribeState(e,t){var r;let s;Array.isArray(e)?s=e:s=[e];const o=[];for(let M=0;M<s.length;M++){const n=s[M];if(this.statesSubscribes[n]){const u=this.statesSubscribes[n];if(t){const N=u.cbs.indexOf(t);N!==-1&&u.cbs.splice(N,1)}else u.cbs=[];(r=u.cbs)!=null&&r.length||(delete this.statesSubscribes[n],n!==this.ignoreState&&o.push(n))}}this.connected&&o.length&&this._socket.emit("unsubscribe",s)}subscribeObject(e,t){let s;if(Array.isArray(e)?s=e:s=[e],typeof t!="function")throw new Error("The object change handler must be a function!");const o=[];for(let r=0;r<s.length;r++){const M=s[r];this.objectsSubscribes[M]?!this.objectsSubscribes[M].cbs.includes(t)&&this.objectsSubscribes[M].cbs.push(t):(this.objectsSubscribes[M]={reg:new RegExp(xs(M)),cbs:[t]},o.push(M))}return this.connected&&o.length&&this._socket.emit("subscribeObjects",o),Promise.resolve()}unsubscribeObject(e,t){var r;let s;Array.isArray(e)?s=e:s=[e];const o=[];for(let M=0;M<s.length;M++){const n=s[M];if(this.objectsSubscribes[n]){const u=this.objectsSubscribes[n];if(t){const N=u.cbs.indexOf(t);N!==-1&&u.cbs.splice(N,1)}else u.cbs=[];(r=u.cbs)!=null&&r.length||(delete this.objectsSubscribes[n],o.push(n))}}return this.connected&&o.length&&this._socket.emit("unsubscribeObjects",o),Promise.resolve()}objectChange(e,t){var r,M;let s;this.objects[e]&&(s={_id:e,type:this.objects[e].type});let o=!1;t?(t._rev&&this.objects[e]&&(this.objects[e]._rev=t._rev),(!this.objects[e]||JSON.stringify(this.objects[e])!==JSON.stringify(t))&&(this.objects[e]=t,o=!0)):this.objects[e]&&(delete this.objects[e],o=!0);for(const[n,u]of Object.entries(this.objectsSubscribes))(n===e||u.reg.test(e))&&u.cbs.forEach(N=>{try{const l=N(e,t,s);l instanceof Promise&&l.catch(c=>console.error(`Cannot call object change handler: ${c}`))}catch(l){console.error(`Error by callback of objectChange: ${l}`)}});if(o){const n=(M=(r=this.props).onObjectChange)==null?void 0:M.call(r,e,t);n instanceof Promise&&n.catch(u=>console.error(`Cannot call object change handler: ${u}`))}}stateChange(e,t){for(const s of Object.values(this.statesSubscribes))if(s.reg.test(e))for(const o of s.cbs)try{const r=o(e,t??null);r instanceof Promise&&r.catch(M=>console.error(`Cannot call state change handler: ${M}`))}catch(r){console.error(`Error by callback of stateChanged: ${r}`)}}instanceMessage(e,t,s){var o;(o=this._instanceSubscriptions[t])==null||o.forEach(r=>{if(r.messageType===e){const M=r.callback(s,t,e);M instanceof Promise&&M.catch(n=>console.error(`Cannot call instance message handler: ${n}`))}})}fileChange(e,t,s){for(const o of Object.values(this.filesSubscribes))if(o.regId.test(e)&&o.regFilePattern.test(t))for(const r of o.cbs)try{r(e,t,s)}catch(M){console.error(`Error by callback of fileChange: ${M}`)}}async subscribeFiles(e,t,s){if(typeof s!="function")throw new Error("The state change handler must be a function!");let o;Array.isArray(t)?o=t:o=[t];const r=[];for(let M=0;M<o.length;M++){const n=o[M],u=`${e}$%$${n}`;this.filesSubscribes[u]?!this.filesSubscribes[u].cbs.includes(s)&&this.filesSubscribes[u].cbs.push(s):(this.filesSubscribes[u]={regId:new RegExp(xs(e)),regFilePattern:new RegExp(xs(n)),cbs:[s]},r.push(n))}return this.connected&&r.length&&this._socket.emit("subscribeFiles",e,r),Promise.resolve()}unsubscribeFiles(e,t,s){var M;let o;Array.isArray(t)?o=t:o=[t];const r=[];for(let n=0;n<o.length;n++){const u=o[n],N=`${e}$%$${u}`;if(this.filesSubscribes[N]){const l=this.filesSubscribes[N];if(s){const c=l.cbs.indexOf(s);c!==-1&&l.cbs.splice(c,1)}else l.cbs=[];(M=l.cbs)!=null&&M.length||(delete this.filesSubscribes[N],r.push(u))}}this.connected&&r.length&&this._socket.emit("unsubscribeFiles",e,r)}async request({cacheKey:e,forceUpdate:t,commandTimeout:s,onTimeout:o,requireAdmin:r,requireFeatures:M,executor:n}){if(r&&je.isWeb())return Promise.reject(new Error(ye.NOT_ADMIN));if(e&&!t&&e in this._promises)return this._promises[e];if(!this.connected)return Promise.reject(new Error(ye.NOT_CONNECTED));if(M!=null&&M.length){for(const N of M)if(!await this.checkFeatureSupported(N))throw new Error(ye.NOT_SUPPORTED)}const u=new Promise(async(N,l)=>{const c={elapsed:!1,clearTimeout:()=>{}};let L;s!==!1&&(L=setTimeout(()=>{c.elapsed=!0,o==null||o(),e&&this._promises[e]instanceof Promise&&delete this._promises[e],l(new Error(ye.TIMEOUT))},s??this.props.cmdTimeout),c.clearTimeout=()=>{clearTimeout(L)});try{await n(N,l,c)}catch(j){e&&this._promises[e]instanceof Promise&&delete this._promises[e],l(new Error(j.toString()))}});return e&&(this._promises[e]=u),u}resetCache(e,t){t?Object.keys(this._promises).filter(s=>s.startsWith(e)).forEach(s=>{delete this._promises[s]}):delete this._promises[e]}getStates(e){return this.request({commandTimeout:!1,executor:(t,s)=>{this._socket.emit("getStates",e,(o,r)=>{this.states=r??{},o?s(o):t(this.states)})}})}getState(e){return this.request({commandTimeout:!1,executor:(t,s)=>{if(e&&e===this.ignoreState){t(this.simStates[e]||{val:null,ack:!0});return}this._socket.emit("getState",e,(o,r)=>{o?s(o):t(r)})}})}getBinaryState(e){return this.request({commandTimeout:!1,executor:(t,s)=>{this._socket.emit("getBinaryState",e,(o,r)=>{o?s(o):t(r)})}})}setBinaryState(e,t){return this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("setBinaryState",e,t,r=>{r?o(r):s()})}})}setState(e,t,s){return typeof s=="boolean"&&(t={val:t,ack:s}),this.request({commandTimeout:!1,executor:(o,r)=>{if(e&&e===this.ignoreState){let M;if(typeof s=="boolean"||typeof t=="object"&&t.val!==void 0?M=t:M={val:t,ack:!1,ts:Date.now(),lc:Date.now(),from:"system.adapter.vis.0"},this.simStates[e]=M,this.statesSubscribes[e])for(const n of this.statesSubscribes[e].cbs)try{const u=n(e,M);u instanceof Promise&&u.catch(N=>console.error(`Cannot call state change handler: ${N}`))}catch(u){console.error(`Error by callback of stateChanged: ${u}`)}o();return}this._socket.emit("setState",e,t,M=>{M?r(M):o()})}})}getObjects(e,t){return this.request({commandTimeout:!1,executor:(s,o)=>{if(!e&&this.objects){s(this.objects);return}this._socket.emit(je.isWeb()?"getObjects":"getAllObjects",(r,M)=>{var n,u;t||(u=(n=this.props).onProgress)==null||u.call(n,Re.OBJECTS_LOADED),r?o(r):(this.objects=M??{},s(this.objects))})}})}getObjectsById(e){return this.request({commandTimeout:!1,executor:(t,s)=>{this._socket.emit("getObjects",e,(o,r)=>{o?s(o):t(r)})}})}_subscribe(e){var t,s;if(e&&!this.subscribed){this.subscribed=!0,(t=this.props.autoSubscribes)!=null&&t.length&&this._socket.emit("subscribeObjects",this.props.autoSubscribes);const o=Object.keys(this.objectsSubscribes);o.length&&this._socket.emit("subscribeObjects",o),Object.keys(this.objectsSubscribes).forEach(r=>this._socket.emit("subscribeObjects",r)),this.props.autoSubscribeLog&&this._socket.emit("requireLog",!0),Object.keys(this.statesSubscribes).forEach(r=>this._socket.emit("subscribe",r)),Object.keys(this.filesSubscribes).forEach(r=>{const[M,n]=r.split("$%$");this._socket.emit("subscribeFiles",M,n)})}else if(!e&&this.subscribed){this.subscribed=!1,(s=this.props.autoSubscribes)!=null&&s.length&&this._socket.emit("unsubscribeObjects",this.props.autoSubscribes);const o=Object.keys(this.objectsSubscribes);o.length&&this._socket.emit("unsubscribeObjects",o),this.props.autoSubscribeLog&&this._socket.emit("requireLog",!1),Object.keys(this.statesSubscribes).forEach(r=>this._socket.emit("unsubscribe",r)),Object.keys(this.filesSubscribes).forEach(r=>{const[M,n]=r.split("$%$");this._socket.emit("unsubscribeFiles",M,n)})}}requireLog(e){return this.request({commandTimeout:!1,executor:(t,s)=>{this._socket.emit("requireLog",e,o=>{o?s(o):t()})}})}delObject(e,t=!1){return this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("delObject",e,{maintenance:t},r=>{r?o(r):s()})}})}delObjects(e,t){return this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("delObjects",e,{maintenance:t},r=>{r?o(r):s()})}})}setObject(e,t){return t?(t=JSON.parse(JSON.stringify(t)),delete t.from,delete t.user,delete t.ts,this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("setObject",e,t,r=>{r?o(r):s()})}})):Promise.reject(new Error("Null object is not allowed"))}getObject(e){return this.request({commandTimeout:!1,executor:(t,s)=>{if(e&&e===this.ignoreState){t({_id:this.ignoreState,type:"state",common:{name:"ignored state",type:"mixed"}});return}this._socket.emit("getObject",e,(o,r)=>{o?s(o):t(r)})}})}sendTo(e,t,s){return this.request({commandTimeout:!1,executor:o=>{this._socket.emit("sendTo",e,t,s,r=>{o(r)})}})}extendObject(e,t){return t?(t=JSON.parse(JSON.stringify(t)),delete t.from,delete t.user,delete t.ts,this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("extendObject",e,t,r=>{r?o(r):s()})}})):Promise.reject(new Error("Null object is not allowed"))}registerLogHandler(e){this.onLogHandlers.includes(e)||this.onLogHandlers.push(e)}unregisterLogHandler(e){const t=this.onLogHandlers.indexOf(e);t!==-1&&this.onLogHandlers.splice(t,1)}registerConnectionHandler(e){this.onConnectionHandlers.includes(e)||this.onConnectionHandlers.push(e)}unregisterConnectionHandler(e){const t=this.onConnectionHandlers.indexOf(e);t!==-1&&this.onConnectionHandlers.splice(t,1)}registerCmdStdoutHandler(e){this.onCmdStdoutHandler=e}unregisterCmdStdoutHandler(){this.onCmdStdoutHandler=void 0}registerCmdStderrHandler(e){this.onCmdStderrHandler=e}unregisterCmdStderrHandler(){this.onCmdStderrHandler=void 0}registerCmdExitHandler(e){this.onCmdExitHandler=e}unregisterCmdExitHandler(){this.onCmdExitHandler=void 0}getEnums(e,t){return this.request({cacheKey:`enums_${e||"all"}`,forceUpdate:t,commandTimeout:!1,executor:(s,o)=>{this._socket.emit("getObjectView","system","enum",{startkey:`enum.${e||""}`,endkey:e?`enum.${e}.香`:"enum.香"},(r,M)=>{if(r)o(r);else{const n={};if(M)for(let u=0;u<M.rows.length;u++)e&&M.rows[u].id===`enum.${e}`||(n[M.rows[u].id]=M.rows[u].value);s(n)}})}})}getObjectView(e,t,s){return this.getObjectViewCustom("system",s,e,t)}getObjectViewSystem(e,t,s){return this.getObjectViewCustom("system",e,t,s)}getObjectViewCustom(e,t,s,o){return this.request({commandTimeout:!1,executor:(r,M)=>{s=s||"",o=o||"香",this._socket.emit("getObjectView",e,t,{startkey:s,endkey:o},(n,u)=>{if(n)M(n);else{const N={};if(u&&u.rows)for(let l=0;l<u.rows.length;l++)N[u.rows[l].id]=u.rows[l].value;r(N)}})}})}readMetaItems(){return this.request({commandTimeout:!1,executor:(e,t)=>{this._socket.emit("getObjectView","system","meta",{startkey:"",endkey:"香"},(s,o)=>{var r;s?t(s):e((r=o.rows)==null?void 0:r.map(M=>M.value).filter(M=>!!M))})}})}readDir(e,t){return this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("readDir",e,t,(r,M)=>{r?o(r):s(M)})}})}readFile(e,t,s){return this.request({commandTimeout:!1,executor:(o,r)=>{this._socket.emit(s?"readFile64":"readFile",e,t,(M,n,u)=>{M?r(M):o({file:n,mimeType:u})})}})}writeFile64(e,t,s){return this.request({commandTimeout:!1,executor:(o,r)=>{if(typeof s=="string")this._socket.emit("writeFile",e,t,s,M=>{M?r(M):o()});else{const M=btoa(new Uint8Array(s).reduce((n,u)=>n+String.fromCharCode(u),""));this._socket.emit("writeFile64",e,t,M,n=>{n?r(n):o()})}}})}deleteFile(e,t){return this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("deleteFile",e,t,r=>{r?o(r):s()})}})}deleteFolder(e,t){return this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("deleteFolder",e,t,r=>{r?o(r):s()})}})}rename(e,t,s){return this.request({commandTimeout:!1,executor:(o,r)=>{this._socket.emit("rename",e,t,s,M=>{M?r(M):o()})}})}renameFile(e,t,s){return this.request({commandTimeout:!1,executor:(o,r)=>{this._socket.emit("renameFile",e,t,s,M=>{M?r(M):o()})}})}cmdExec(e,t,s,o){return this.request({commandTimeout:o,executor:(r,M,n)=>{e=Ke(e),this._socket.emit("cmdExec",e,s,t,u=>{n.elapsed||(n.clearTimeout(),u?M(u):r())})}})}getSystemConfig(e){return this.request({cacheKey:"systemConfig",forceUpdate:e,commandTimeout:!1,executor:async t=>{let s=await this.getObject("system.config");s??={},s.common??={},s.native??={},t(s)}})}getCompactSystemConfig(e){return this.request({cacheKey:"systemConfigCommon",forceUpdate:e,commandTimeout:!1,requireAdmin:!0,executor:(t,s)=>{this._socket.emit("getCompactSystemConfig",(o,r)=>{o?s(o):(r??={},r.common??={},r.native??={},t(r))})}})}getForeignStates(e){return this.request({commandTimeout:!1,executor:(t,s)=>{this._socket.emit("getForeignStates",e||"*",(o,r)=>{o?s(o):t(r??{})})}})}getForeignObjects(e,t){return this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("getForeignObjects",e||"*",t,(r,M)=>{r?o(r):s(M)})}})}setSystemConfig(e){return this.setObject("system.config",e)}getRawSocket(){return this._socket}getHistory(e,t){return this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("getHistory",e,t,(r,M)=>{r?o(r):s(M)})}})}getHistoryEx(e,t){return this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("getHistory",e,t,(r,M,n,u)=>{r?o(r):s({values:M,sessionId:u,step:n})})}})}getIpAddresses(e,t){return e=Ke(e),this.request({cacheKey:`IPs_${e}`,forceUpdate:t,commandTimeout:!1,executor:async s=>{const o=await this.getObject(e);s((o==null?void 0:o.common.address)??[])}})}getVersion(e){return this.request({cacheKey:"version",forceUpdate:e,commandTimeout:!1,executor:(t,s)=>{this._socket.emit("getVersion",(o,r,M)=>{o&&!r&&typeof o=="string"&&o.match(/\d+\.\d+\.\d+/)?t({version:o,serverName:"socketio"}):o?s(o):t({version:r,serverName:M})})}})}getWebServerName(){return this.request({cacheKey:"webName",commandTimeout:!1,executor:(e,t)=>{this._socket.emit("getAdapterName",(s,o)=>{s?t(s):e(o)})}})}fileExists(e,t){return this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("fileExists",e,t,(r,M)=>{r?o(r):s(!!M)})}})}getCurrentUser(){return this.request({commandTimeout:!1,executor:e=>{this._socket.emit("authEnabled",(t,s)=>{e(s)})}})}getUuid(){return this.request({cacheKey:"uuid",commandTimeout:!1,executor:async e=>{var s;const t=await this.getObject("system.meta.uuid");e((s=t==null?void 0:t.native)==null?void 0:s.uuid)}})}checkFeatureSupported(e,t){return this.request({cacheKey:`supportedFeatures_${e}`,forceUpdate:t,commandTimeout:!1,executor:(s,o)=>{this._socket.emit("checkFeatureSupported",e,(r,M)=>{r?o(r):s(M)})}})}getAdapterInstances(e,t){return typeof e=="boolean"&&(t=e,e=""),e=e||"",this.request({cacheKey:`instances_${e}`,forceUpdate:t,commandTimeout:!1,executor:async s=>{const o=e?`system.adapter.${e}.`:"system.adapter.",r=`${o}香`,M=await this.getObjectViewSystem("instance",o,r),n=Object.values(M);s(e?n.filter(u=>u.common.name===e):n)}})}getAdapters(e,t){return typeof e=="boolean"&&(t=e,e=""),e=e||"",this.request({cacheKey:`adapter_${e}`,forceUpdate:t,commandTimeout:!1,executor:async s=>{const o=await this.getObjectViewSystem("adapter",`system.adapter.${e||""}`,`system.adapter.${e||"香"}`),r=Object.values(o);s(e?r.filter(M=>M.common.name===e):r)}})}getGroups(e){return this.request({cacheKey:"groups",forceUpdate:e,commandTimeout:!1,executor:(t,s)=>{this._socket.emit("getObjectView","system","group",{startkey:"system.group.",endkey:"system.group.香"},(o,r)=>{o?s(o):t(Hi(r))})}})}logout(){return this.request({commandTimeout:!1,executor:(e,t)=>{this._socket.emit("logout",s=>{s?t(s):e(null)})}})}subscribeOnInstance(e,t,s,o){return this.request({commandTimeout:!1,executor:(r,M)=>{this._socket.emit("clientSubscribe",e,t,s,(n,u)=>{n?M(n):u&&(u.error?M(u.error):(e.startsWith("system.adapter.")||(e=`system.adapter.${e}`),this._instanceSubscriptions[e]=this._instanceSubscriptions[e]||[],this._instanceSubscriptions[e].find(N=>N.messageType===t&&N.callback===o)||this._instanceSubscriptions[e].push({messageType:t,callback:o}),r(u)))})}})}unsubscribeFromInstance(e,t,s){var M;e.startsWith("system.adapter.")||(e=`system.adapter.${e}`);let o;const r=[];do{o=!1;const n=(M=this._instanceSubscriptions[e])==null?void 0:M.findIndex(u=>(!t||u.messageType===t)&&(!s||u.callback===s));if(n!=null&&n!==-1){o=!0;const u=this._instanceSubscriptions[e][n].messageType;this._instanceSubscriptions[e].splice(n,1),this._instanceSubscriptions[e].length||delete this._instanceSubscriptions[e],this._instanceSubscriptions[e]&&this._instanceSubscriptions[e].find(l=>l.messageType===u)||r.push(this.request({commandTimeout:!1,executor:(l,c)=>{this._socket.emit("clientUnsubscribe",e,t,(L,j)=>L?c(L):l(j))}}))}}while(o&&(!s||!t));return r.length?Promise.all(r).then(n=>!!n.find(u=>u)):Promise.resolve(!1)}log(e,t){return e?this.request({commandTimeout:!1,executor:s=>(this._socket.emit("log",e,t),s(null))}):Promise.resolve(null)}setStateToIgnore(e){this.ignoreState=e}}function uc(i,e){if(!e)return;let t;if(e.length<700&&(e.indexOf("/")!==-1||e.indexOf("\\")!==-1))if(i.toLowerCase().includes("private"))t="private";else if(e.toLowerCase().includes("private"))t="private";else if(i.toLowerCase().includes("public"))t="public";else if(e.toLowerCase().includes("public"))t="public";else if(i.toLowerCase().includes("chain"))t="chained";else if(e.toLowerCase().includes("chain"))t="chained";else return;else t=e.substring(0,26)==="-----BEGIN RSA PRIVATE KEY"||e.substring(0,22)==="-----BEGIN PRIVATE KEY"?"private":"public",t==="public"&&e.split("-----END CERTIFICATE-----").filter(o=>o.replace(/\r\n|\r|\n/,"").trim()).length>1&&(t="chained");return{name:i,type:t}}function Nc(i){var s,o,r,M;const e=[{name:"[IPv4] 0.0.0.0 - Listen on all IPs",address:"0.0.0.0",family:"ipv4"}],t=[{name:"[IPv6] :: - Listen on all IPs",address:"::",family:"ipv6"}];if((o=(s=i.native)==null?void 0:s.hardware)!=null&&o.networkInterfaces){const n=(M=(r=i.native)==null?void 0:r.hardware)==null?void 0:M.networkInterfaces;Object.keys(n).forEach(u=>{n[u].forEach(N=>{N.family!=="IPv6"?e.push({name:`[${N.family}] ${N.address} - ${u}`,address:N.address,family:"ipv4"}):t.push({name:`[${N.family}] ${N.address} - ${u}`,address:N.address,family:"ipv6"})})})}return{IPs4:e,IPs6:t}}class s4e extends je{constructor(e){super(e)}request(e){return super.request({requireAdmin:!0,...e})}getCertificates(e){return this.request({cacheKey:"cert",forceUpdate:e,commandTimeout:!1,executor:async t=>{var o;const s=await this.getObject("system.certificates");(o=s==null?void 0:s.native)!=null&&o.certificates?t(Object.entries(s.native.certificates).map(([r,M])=>uc(r,M)).filter(r=>!!r)):t([])}})}getLogs(e,t=200){return this.request({commandTimeout:!1,executor:s=>{this._socket.emit("sendToHost",e,"getLogs",t||200,o=>{s(o)})}})}upgradeAdapterWithWebserver(e,t){return this.request({commandTimeout:!1,executor:s=>{this._socket.emit("sendToHost",e,"upgradeAdapterWithWebserver",t,o=>{s(o)})}})}upgradeController(e,t,s){return this.request({commandTimeout:!1,executor:(o,r)=>{this._socket.emit("sendToHost",e,"upgradeController",{version:t,adminInstance:s},M=>{const n=M;n.error?r(n.error):o(n.result)})}})}updateLicenses(e,t){return this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("updateLicenses",e,t,(r,M)=>{r?o(r):s(M)})}})}upgradeOsPackages(e,t,s){return this.request({commandTimeout:!1,executor:o=>{this._socket.emit("sendToHost",e,"upgradeOsPackages",{packages:t,restart:!!s},r=>{o(r)})}})}getLogsFiles(e){return this.request({commandTimeout:!1,executor:(t,s)=>{this._socket.emit("readLogs",e,(o,r)=>{o&&s(o),t(r)})}})}delLogs(e){return this.request({commandTimeout:!1,executor:(t,s)=>{this._socket.emit("sendToHost",e,"delLogs",null,o=>{o&&s(o),t()})}})}deleteFile(e,t){return this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("deleteFile",e,t,r=>{r&&o(r),s()})}})}deleteFolder(e,t){return this.request({commandTimeout:!1,executor:(s,o)=>{this._socket.emit("deleteFolder",e,t,r=>{r&&o(r),s()})}})}rename(e,t,s){return this.request({commandTimeout:!1,executor:(o,r)=>{this._socket.emit("rename",e,t,s,M=>{M&&r(M),o()})}})}renameFile(e,t,s){return this.request({commandTimeout:!1,executor:(o,r)=>{this._socket.emit("renameFile",e,t,s,M=>{M&&r(M),o()})}})}getHosts(e){return this.request({cacheKey:"hosts",forceUpdate:e,commandTimeout:!1,executor:(t,s)=>{this._socket.emit("getObjectView","system","host",{startkey:"system.host.",endkey:"system.host.香"},(o,r)=>{o?s(o):t(Hi(r))})}})}getUsers(e){return this.request({cacheKey:"users",forceUpdate:e,commandTimeout:!1,executor:(t,s)=>{this._socket.emit("getObjectView","system","user",{startkey:"system.user.",endkey:"system.user.香"},(o,r)=>{o?s(o):t(Hi(r))})}})}renameGroup(e,t,s){return this.request({commandTimeout:!1,executor:async o=>{const r=await this.getGroups(!0),M=r.filter(u=>u._id.startsWith(`${e}.`));for(const u of M){const N=u._id,l=t+u._id.substring(e.length);u._id=l,await this.setObject(l,u),await this.delObject(N)}const n=r.find(u=>u._id===e);if(n){const u=n._id;n._id=t,s!==void 0&&(n.common??={},n.common.name=s),await this.setObject(t,n),await this.delObject(u)}o()}})}getHostInfo(e,t,s){return e=Ke(e),this.request({cacheKey:`hostInfo_${e}`,forceUpdate:t,commandTimeout:s,executor:(o,r,M)=>{this._socket.emit("sendToHost",e,"getHostInfo",null,n=>{M.elapsed||(M.clearTimeout(),n===ye.PERMISSION_ERROR?r('May not read "getHostInfo"'):n?o(n):r('Cannot read "getHostInfo"'))})}})}getHostInfoShort(e,t,s){return e=Ke(e),this.request({cacheKey:`hostInfoShort_${e}`,forceUpdate:t,commandTimeout:s,executor:(o,r,M)=>{this._socket.emit("sendToHost",e,"getHostInfoShort",null,n=>{M.elapsed||(M.clearTimeout(),n===ye.PERMISSION_ERROR?r('May not read "getHostInfoShort"'):n?o(n):r('Cannot read "getHostInfoShort"'))})}})}getRepository(e,t,s,o){return this.request({cacheKey:`repository_${e}`,forceUpdate:s,commandTimeout:o,executor:(r,M,n)=>{this._socket.emit("sendToHost",e,"getRepository",t,u=>{n.elapsed||(n.clearTimeout(),u===ye.PERMISSION_ERROR?M('May not read "getRepository"'):u?r(u):M('Cannot read "getRepository"'))})}})}getInstalled(e,t,s){return e=Ke(e),this.request({cacheKey:`installed_${e}`,forceUpdate:t,commandTimeout:s,executor:(o,r,M)=>{this._socket.emit("sendToHost",e,"getInstalled",null,n=>{M.elapsed||(M.clearTimeout(),n===ye.PERMISSION_ERROR?r('May not read "getInstalled"'):n?o(n):r('Cannot read "getInstalled"'))})}})}cmdExec(e,t,s,o){return this.request({commandTimeout:o,executor:(r,M,n)=>{e=Ke(e),this._socket.emit("cmdExec",e,s,t,u=>{n.elapsed||(n.clearTimeout(),u&&M(u),r())})}})}readBaseSettings(e){return e=Ms(e),this.request({requireFeatures:["CONTROLLER_READWRITE_BASE_SETTINGS"],executor:(t,s,o)=>{this._socket.emit("sendToHost",e,"readBaseSettings",null,r=>{o.elapsed||(o.clearTimeout(),r===ye.PERMISSION_ERROR?s('May not read "BaseSettings"'):r?r.error?s(new Error(r.error)):t(r):s('Cannot read "BaseSettings"'))})}})}writeBaseSettings(e,t){return e=Ms(e),this.request({requireFeatures:["CONTROLLER_READWRITE_BASE_SETTINGS"],executor:(s,o,r)=>{this._socket.emit("sendToHost",e,"writeBaseSettings",t,M=>{r.elapsed||(r.clearTimeout(),M===ye.PERMISSION_ERROR?o('May not write "BaseSettings"'):M?s(M):o('Cannot write "BaseSettings"'))})}})}restartController(e){return e=Ms(e),this.request({executor:(t,s,o)=>{this._socket.emit("sendToHost",e,"restartController",null,()=>{o.elapsed||(o.clearTimeout(),t(!0))})}})}getDiagData(e,t){return e=Ms(e),this.request({executor:(s,o,r)=>{this._socket.emit("sendToHost",e,"getDiagData",t,M=>{r.elapsed||(r.clearTimeout(),s(M||null))})}})}changePassword(e,t){return this.request({executor:(s,o,r)=>{this._socket.emit("changePassword",e,t,M=>{r.elapsed||(r.clearTimeout(),M&&o(M),s())})}})}getIpAddresses(e,t){return e=Ke(e),this.request({cacheKey:`IPs_${e}`,forceUpdate:t,commandTimeout:!1,executor:async s=>{const o=await this.getObject(e);s((o==null?void 0:o.common.address)??[])}})}getHostByIp(e,t){return e=Ms(e),this.request({cacheKey:`rIPs_${e}`,forceUpdate:t,executor:(s,o,r)=>{this._socket.emit("getHostByIp",e,(M,n)=>{if(r.elapsed)return;r.clearTimeout();const{IPs4:u,IPs6:N}=Nc(n);s([...u,...N])})}})}encrypt(e){return this.request({executor:(t,s,o)=>{this._socket.emit("encrypt",e,(r,M)=>{o.elapsed||(o.clearTimeout(),r&&s(r),t(M))})}})}decrypt(e){return this.request({executor:(t,s,o)=>{this._socket.emit("decrypt",e,(r,M)=>{o.elapsed||(o.clearTimeout(),r&&s(r),t(M))})}})}chmodFile(e,t,s){return this.request({executor:(o,r,M)=>{this._socket.emit("chmodFile",e,t,s,(n,u)=>{M.elapsed||(M.clearTimeout(),n&&r(n),o(u))})}})}chownFile(e,t,s){return this.request({executor:(o,r,M)=>{this._socket.emit("chownFile",e,t,s,(n,u)=>{M.elapsed||(M.clearTimeout(),n&&r(n),o(u))})}})}getNotifications(e,t){return this.request({executor:(s,o,r)=>{this._socket.emit("sendToHost",e,"getNotifications",{category:t},M=>{r.elapsed||(r.clearTimeout(),s(M))})}})}clearNotifications(e,t){return this.request({executor:(s,o,r)=>{this._socket.emit("sendToHost",e,"clearNotifications",{category:t},M=>{r.elapsed||(r.clearTimeout(),s(M))})}})}getIsEasyModeStrict(){return this.request({executor:(e,t,s)=>{this._socket.emit("getIsEasyModeStrict",(o,r)=>{s.elapsed||(s.clearTimeout(),o&&t(o),e(!!r))})}})}getEasyMode(){return this.request({executor:(e,t,s)=>{this._socket.emit("getEasyMode",(o,r)=>{s.elapsed||(s.clearTimeout(),o?t(new Error(o)):e(r))})}})}getRatings(e){return this.request({executor:(t,s,o)=>{this._socket.emit("getRatings",!!e,(r,M)=>{o.elapsed||(o.clearTimeout(),r?s(new Error(r)):t(M))})}})}getCurrentSession(e){const t=new AbortController;return this.request({commandTimeout:e||5e3,onTimeout:()=>{t.abort()},executor:async(s,o,r)=>{try{const M=await fetch("./session",{signal:t.signal});if(r.elapsed)return;r.clearTimeout();const n=await M.json();s(n)}catch(M){o(`getCurrentSession: ${M}`)}}})}getCurrentInstance(){return this.request({cacheKey:"currentInstance",executor:(e,t,s)=>{this._socket.emit("getCurrentInstance",(o,r)=>{s.elapsed||(s.clearTimeout(),o?t(o):e(r))})}})}getAdapterInstances(e,t){let s;return typeof e=="boolean"?(t=e,s=""):s=e||"",this.request({cacheKey:`instances_${s}`,forceUpdate:t,executor:(o,r,M)=>{this._socket.emit("getAdapterInstances",s,(n,u)=>{M.elapsed||(M.clearTimeout(),n&&r(n),o(u))})}})}getAdapters(e,t){let s;return typeof e=="boolean"?(t=e,s=""):s=e||"",this.request({cacheKey:`adapter_${s}`,forceUpdate:t,executor:(o,r,M)=>{this._socket.emit("getAdapters",s,(n,u)=>{M.elapsed||(M.clearTimeout(),n&&r(n),o(u))})}})}getCompactAdapters(e){return this.request({cacheKey:"compactAdapters",forceUpdate:e,executor:(t,s,o)=>{this._socket.emit("getCompactAdapters",(r,M)=>{o.elapsed||(o.clearTimeout(),r&&s(r),t(M))})}})}getAdaptersResetCache(e){e=e??"",this.resetCache(`adapter_${e}`),this.resetCache("compactAdapters")}getCompactInstances(e){return this.request({cacheKey:"compactInstances",forceUpdate:e,executor:(t,s,o)=>{this._socket.emit("getCompactInstances",(r,M)=>{o.elapsed||(o.clearTimeout(),r&&s(r),t(M))})}})}getAdapterInstancesResetCache(e){e=e??"",this.resetCache(`instances_${e}`),this.resetCache("compactInstances")}getCompactInstalled(e,t,s){return e=Ke(e),this.request({cacheKey:`installedCompact_${e}`,forceUpdate:t,commandTimeout:s,executor:(o,r,M)=>{this._socket.emit("getCompactInstalled",e,n=>{M.elapsed||(M.clearTimeout(),n===ye.PERMISSION_ERROR?r('May not read "getCompactInstalled"'):n?o(n):r('Cannot read "getCompactInstalled"'))})}})}getInstalledResetCache(e){e?(this.resetCache(`installedCompact_${e}`),this.resetCache(`installed_${e}`)):(this.resetCache("installedCompact_",!0),this.resetCache("installed_",!0))}getCompactRepository(e,t,s){return e=Ke(e),this.request({cacheKey:`repositoryCompact_${e}`,forceUpdate:t,commandTimeout:s,executor:(o,r,M)=>{this._socket.emit("getCompactRepository",e,n=>{M.elapsed||(M.clearTimeout(),n===ye.PERMISSION_ERROR?r('May not read "getCompactRepository"'):n?o(n):r('Cannot read "getCompactRepository"'))})}})}getRepositoryResetCache(e){e?(this.resetCache(`repositoryCompact_${e}`),this.resetCache(`repository_${e}`)):(this.resetCache("repositoryCompact_",!0),this.resetCache("repository_",!0))}getCompactHosts(e){return this.request({cacheKey:"hostsCompact",forceUpdate:e,executor:(t,s,o)=>{this._socket.emit("getCompactHosts",(r,M)=>{o.elapsed||(o.clearTimeout(),r&&s(r),t(M))})}})}getCompactSystemRepositories(e){return this.request({cacheKey:"repositoriesCompact",forceUpdate:e,executor:(t,s,o)=>{this._socket.emit("getCompactSystemRepositories",(r,M)=>{o.elapsed||(o.clearTimeout(),r&&s(r),t(M))})}})}}const Z=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Ot="9.28.1",te=globalThis;function Ni(){return li(te),te}function li(i){const e=i.__SENTRY__=i.__SENTRY__||{};return e.version=e.version||Ot,e[Ot]=e[Ot]||{}}function Li(i,e,t=te){const s=t.__SENTRY__=t.__SENTRY__||{},o=s[Ot]=s[Ot]||{};return o[i]||(o[i]=e())}const Nn=Object.prototype.toString;function ko(i){switch(Nn.call(i)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Tt(i,Error)}}function es(i,e){return Nn.call(i)===`[object ${e}]`}function ln(i){return es(i,"ErrorEvent")}function gr(i){return es(i,"DOMError")}function lc(i){return es(i,"DOMException")}function tt(i){return es(i,"String")}function Yo(i){return typeof i=="object"&&i!==null&&"__sentry_template_string__"in i&&"__sentry_template_values__"in i}function Qo(i){return i===null||Yo(i)||typeof i!="object"&&typeof i!="function"}function ds(i){return es(i,"Object")}function ji(i){return typeof Event<"u"&&Tt(i,Event)}function Lc(i){return typeof Element<"u"&&Tt(i,Element)}function jc(i){return es(i,"RegExp")}function gi(i){return!!(i!=null&&i.then&&typeof i.then=="function")}function gc(i){return ds(i)&&"nativeEvent"in i&&"preventDefault"in i&&"stopPropagation"in i}function Tt(i,e){try{return i instanceof e}catch{return!1}}function Ln(i){return!!(typeof i=="object"&&i!==null&&(i.__isVue||i._isVue))}function Tc(i){return typeof Request<"u"&&Tt(i,Request)}const Uo=te,yc=80;function jn(i,e={}){if(!i)return"<unknown>";try{let t=i;const s=5,o=[];let r=0,M=0;const n=" > ",u=n.length;let N;const l=Array.isArray(e)?e:e.keyAttrs,c=!Array.isArray(e)&&e.maxStringLength||yc;for(;t&&r++<s&&(N=Dc(t,l),!(N==="html"||r>1&&M+o.length*u+N.length>=c));)o.push(N),M+=N.length,t=t.parentNode;return o.reverse().join(n)}catch{return"<unknown>"}}function Dc(i,e){const t=i,s=[];if(!(t!=null&&t.tagName))return"";if(Uo.HTMLElement&&t instanceof HTMLElement&&t.dataset){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}s.push(t.tagName.toLowerCase());const o=e!=null&&e.length?e.filter(M=>t.getAttribute(M)).map(M=>[M,t.getAttribute(M)]):null;if(o!=null&&o.length)o.forEach(M=>{s.push(`[${M[0]}="${M[1]}"]`)});else{t.id&&s.push(`#${t.id}`);const M=t.className;if(M&&tt(M)){const n=M.split(/\s+/);for(const u of n)s.push(`.${u}`)}}const r=["aria-label","type","name","title","alt"];for(const M of r){const n=t.getAttribute(M);n&&s.push(`[${M}="${n}"]`)}return s.join("")}function vo(){try{return Uo.document.location.href}catch{return""}}function dc(i){if(!Uo.HTMLElement)return null;let e=i;const t=5;for(let s=0;s<t;s++){if(!e)return null;if(e instanceof HTMLElement){if(e.dataset.sentryComponent)return e.dataset.sentryComponent;if(e.dataset.sentryElement)return e.dataset.sentryElement}e=e.parentNode}return null}const zc="Sentry Logger ",Vi=["debug","info","warn","error","log","assert","trace"],ti={};function ts(i){if(!("console"in te))return i();const e=te.console,t={},s=Object.keys(ti);s.forEach(o=>{const r=ti[o];t[o]=e[o],e[o]=r});try{return i()}finally{s.forEach(o=>{e[o]=t[o]})}}function Ic(){let i=!1;const e={enable:()=>{i=!0},disable:()=>{i=!1},isEnabled:()=>i};return Z?Vi.forEach(t=>{e[t]=(...s)=>{i&&ts(()=>{te.console[t](`${zc}[${t}]:`,...s)})}}):Vi.forEach(t=>{e[t]=()=>{}}),e}const B=Li("logger",Ic);function si(i,e=0){return typeof i!="string"||e===0||i.length<=e?i:`${i.slice(0,e)}...`}function Tr(i,e){if(!Array.isArray(i))return"";const t=[];for(let s=0;s<i.length;s++){const o=i[s];try{Ln(o)?t.push("[VueViewModel]"):t.push(String(o))}catch{t.push("[value cannot be serialized]")}}return t.join(e)}function wc(i,e,t=!1){return tt(i)?jc(e)?e.test(i):tt(e)?t?i===e:i.includes(e):!1:!1}function Ti(i,e=[],t=!1){return e.some(s=>wc(i,s,t))}function Ee(i,e,t){if(!(e in i))return;const s=i[e];if(typeof s!="function")return;const o=t(s);typeof o=="function"&&gn(o,s);try{i[e]=o}catch{Z&&B.log(`Failed to replace method "${e}" in object`,i)}}function Et(i,e,t){try{Object.defineProperty(i,e,{value:t,writable:!0,configurable:!0})}catch{Z&&B.log(`Failed to add non-enumerable property "${e}" to object`,i)}}function gn(i,e){try{const t=e.prototype||{};i.prototype=e.prototype=t,Et(i,"__sentry_original__",e)}catch{}}function bo(i){return i.__sentry_original__}function Tn(i){if(ko(i))return{message:i.message,name:i.name,stack:i.stack,...Dr(i)};if(ji(i)){const e={type:i.type,target:yr(i.target),currentTarget:yr(i.currentTarget),...Dr(i)};return typeof CustomEvent<"u"&&Tt(i,CustomEvent)&&(e.detail=i.detail),e}else return i}function yr(i){try{return Lc(i)?jn(i):Object.prototype.toString.call(i)}catch{return"<unknown>"}}function Dr(i){if(typeof i=="object"&&i!==null){const e={};for(const t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t]);return e}else return{}}function Cc(i,e=40){const t=Object.keys(Tn(i));t.sort();const s=t[0];if(!s)return"[object has no keys]";if(s.length>=e)return si(s,e);for(let o=t.length;o>0;o--){const r=t.slice(0,o).join(", ");if(!(r.length>e))return o===t.length?r:si(r,e)}return""}function hc(){const i=te;return i.crypto||i.msCrypto}function fe(i=hc()){let e=()=>Math.random()*16;try{if(i!=null&&i.randomUUID)return i.randomUUID().replace(/-/g,"");i!=null&&i.getRandomValues&&(e=()=>{const t=new Uint8Array(1);return i.getRandomValues(t),t[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,t=>(t^(e()&15)>>t/4).toString(16))}function yn(i){var e,t;return(t=(e=i.exception)==null?void 0:e.values)==null?void 0:t[0]}function pt(i){const{message:e,event_id:t}=i;if(e)return e;const s=yn(i);return s?s.type&&s.value?`${s.type}: ${s.value}`:s.type||s.value||t||"<unknown>":t||"<unknown>"}function Zi(i,e,t){const s=i.exception=i.exception||{},o=s.values=s.values||[],r=o[0]=o[0]||{};r.value||(r.value=e||""),r.type||(r.type="Error")}function Zt(i,e){const t=yn(i);if(!t)return;const s={type:"generic",handled:!0},o=t.mechanism;if(t.mechanism={...s,...o,...e},e&&"data"in e){const r={...o==null?void 0:o.data,...e.data};t.mechanism.data=r}}function dr(i){if(Ac(i))return!0;try{Et(i,"__sentry_captured__",!0)}catch{}return!1}function Ac(i){try{return i.__sentry_captured__}catch{}}const Dn=1e3;function ps(){return Date.now()/Dn}function pc(){const{performance:i}=te;if(!(i!=null&&i.now))return ps;const e=Date.now()-i.now(),t=i.timeOrigin==null?e:i.timeOrigin;return()=>(t+i.now())/Dn}const st=pc();function mc(i){const e=st(),t={sid:fe(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Ec(t)};return i&&Xt(t,i),t}function Xt(i,e={}){if(e.user&&(!i.ipAddress&&e.user.ip_address&&(i.ipAddress=e.user.ip_address),!i.did&&!e.did&&(i.did=e.user.id||e.user.email||e.user.username)),i.timestamp=e.timestamp||st(),e.abnormal_mechanism&&(i.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(i.ignoreDuration=e.ignoreDuration),e.sid&&(i.sid=e.sid.length===32?e.sid:fe()),e.init!==void 0&&(i.init=e.init),!i.did&&e.did&&(i.did=`${e.did}`),typeof e.started=="number"&&(i.started=e.started),i.ignoreDuration)i.duration=void 0;else if(typeof e.duration=="number")i.duration=e.duration;else{const t=i.timestamp-i.started;i.duration=t>=0?t:0}e.release&&(i.release=e.release),e.environment&&(i.environment=e.environment),!i.ipAddress&&e.ipAddress&&(i.ipAddress=e.ipAddress),!i.userAgent&&e.userAgent&&(i.userAgent=e.userAgent),typeof e.errors=="number"&&(i.errors=e.errors),e.status&&(i.status=e.status)}function Oc(i,e){let t={};i.status==="ok"&&(t={status:"exited"}),Xt(i,t)}function Ec(i){return{sid:`${i.sid}`,init:i.init,started:new Date(i.started*1e3).toISOString(),timestamp:new Date(i.timestamp*1e3).toISOString(),status:i.status,errors:i.errors,did:typeof i.did=="number"||typeof i.did=="string"?`${i.did}`:void 0,duration:i.duration,abnormal_mechanism:i.abnormal_mechanism,attrs:{release:i.release,environment:i.environment,ip_address:i.ipAddress,user_agent:i.userAgent}}}function ms(i,e,t=2){if(!e||typeof e!="object"||t<=0)return e;if(i&&Object.keys(e).length===0)return i;const s={...i};for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(s[o]=ms(s[o],e[o],t-1));return s}const Xi="_sentrySpan";function zr(i,e){e?Et(i,Xi,e):delete i[Xi]}function Ir(i){return i[Xi]}function wr(){return fe()}function dn(){return fe().substring(16)}const _c=100;class it{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:wr(),sampleRand:Math.random()}}clone(){const e=new it;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,zr(e,Ir(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Xt(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return t===null?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t=typeof e=="function"?e(this):e,s=t instanceof it?t.getScopeData():ds(t)?e:void 0,{tags:o,extra:r,user:M,contexts:n,level:u,fingerprint:N=[],propagationContext:l}=s||{};return this._tags={...this._tags,...o},this._extra={...this._extra,...r},this._contexts={...this._contexts,...n},M&&Object.keys(M).length&&(this._user=M),u&&(this._level=u),N.length&&(this._fingerprint=N),l&&(this._propagationContext=l),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,zr(this,void 0),this._attachments=[],this.setPropagationContext({traceId:wr(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){var r;const s=typeof t=="number"?t:_c;if(s<=0)return this;const o={timestamp:ps(),...e,message:e.message?si(e.message,2048):e.message};return this._breadcrumbs.push(o),this._breadcrumbs.length>s&&(this._breadcrumbs=this._breadcrumbs.slice(-s),(r=this._client)==null||r.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Ir(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=ms(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const s=(t==null?void 0:t.event_id)||fe();if(!this._client)return B.warn("No client configured on scope - will not capture exception!"),s;const o=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:o,...t,event_id:s},this),s}captureMessage(e,t,s){const o=(s==null?void 0:s.event_id)||fe();if(!this._client)return B.warn("No client configured on scope - will not capture message!"),o;const r=new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:r,...s,event_id:o},this),o}captureEvent(e,t){const s=(t==null?void 0:t.event_id)||fe();return this._client?(this._client.captureEvent(e,{...t,event_id:s},this),s):(B.warn("No client configured on scope - will not capture event!"),s)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}function Sc(){return Li("defaultCurrentScope",()=>new it)}function xc(){return Li("defaultIsolationScope",()=>new it)}class fc{constructor(e,t){let s;e?s=e:s=new it;let o;t?o=t:o=new it,this._stack=[{scope:s}],this._isolationScope=o}withScope(e){const t=this._pushScope();let s;try{s=e(t)}catch(o){throw this._popScope(),o}return gi(s)?s.then(o=>(this._popScope(),o),o=>{throw this._popScope(),o}):(this._popScope(),s)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function Kt(){const i=Ni(),e=li(i);return e.stack=e.stack||new fc(Sc(),xc())}function kc(i){return Kt().withScope(i)}function Yc(i,e){const t=Kt();return t.withScope(()=>(t.getStackTop().scope=i,e(i)))}function Cr(i){return Kt().withScope(()=>i(Kt().getIsolationScope()))}function Qc(){return{withIsolationScope:Cr,withScope:kc,withSetScope:Yc,withSetIsolationScope:(i,e)=>Cr(e),getCurrentScope:()=>Kt().getScope(),getIsolationScope:()=>Kt().getIsolationScope()}}function $o(i){const e=li(i);return e.acs?e.acs:Qc()}function ot(){const i=Ni();return $o(i).getCurrentScope()}function Os(){const i=Ni();return $o(i).getIsolationScope()}function Uc(){return Li("globalScope",()=>new it)}function vc(...i){const e=Ni(),t=$o(e);if(i.length===2){const[s,o]=i;return s?t.withSetScope(s,o):t.withScope(o)}return t.withScope(i[0])}function we(){return ot().getClient()}function bc(i){const e=i.getPropagationContext(),{traceId:t,parentSpanId:s,propagationSpanId:o}=e,r={trace_id:t,span_id:o||dn()};return s&&(r.parent_span_id=s),r}const $c="sentry.source",Pc="sentry.sample_rate",Wc="sentry.previous_trace_sample_rate",Rc="sentry.op",Jc="sentry.origin",zn="sentry.profile_id",In="sentry.exclusive_time",Bc=0,Fc=1,Gc="_sentryScope",Hc="_sentryIsolationScope";function wn(i){return{scope:i[Gc],isolationScope:i[Hc]}}function Vc(i){if(typeof i=="boolean")return Number(i);const e=typeof i=="string"?parseFloat(i):i;if(!(typeof e!="number"||isNaN(e)||e<0||e>1))return e}const Zc="sentry-",Xc=/^sentry-/;function Kc(i){const e=qc(i);if(!e)return;const t=Object.entries(e).reduce((s,[o,r])=>{if(o.match(Xc)){const M=o.slice(Zc.length);s[M]=r}return s},{});if(Object.keys(t).length>0)return t}function qc(i){if(!(!i||!tt(i)&&!Array.isArray(i)))return Array.isArray(i)?i.reduce((e,t)=>{const s=hr(t);return Object.entries(s).forEach(([o,r])=>{e[o]=r}),e},{}):hr(i)}function hr(i){return i.split(",").map(e=>e.split("=").map(t=>{try{return decodeURIComponent(t.trim())}catch{return}})).reduce((e,[t,s])=>(t&&s&&(e[t]=s),e),{})}const Cn=1;let Ar=!1;function eu(i){const{spanId:e,traceId:t,isRemote:s}=i.spanContext(),o=s?e:Po(i).parent_span_id,r=wn(i).scope,M=s?(r==null?void 0:r.getPropagationContext().propagationSpanId)||dn():e;return{parent_span_id:o,span_id:M,trace_id:t}}function tu(i){if(i&&i.length>0)return i.map(({context:{spanId:e,traceId:t,traceFlags:s,...o},attributes:r})=>({span_id:e,trace_id:t,sampled:s===Cn,attributes:r,...o}))}function pr(i){return typeof i=="number"?mr(i):Array.isArray(i)?i[0]+i[1]/1e9:i instanceof Date?mr(i.getTime()):st()}function mr(i){return i>9999999999?i/1e3:i}function Po(i){var s;if(iu(i))return i.getSpanJSON();const{spanId:e,traceId:t}=i.spanContext();if(su(i)){const{attributes:o,startTime:r,name:M,endTime:n,status:u,links:N}=i,l="parentSpanId"in i?i.parentSpanId:"parentSpanContext"in i?(s=i.parentSpanContext)==null?void 0:s.spanId:void 0;return{span_id:e,trace_id:t,data:o,description:M,parent_span_id:l,start_timestamp:pr(r),timestamp:pr(n)||void 0,status:ru(u),op:o[Rc],origin:o[Jc],links:tu(N)}}return{span_id:e,trace_id:t,start_timestamp:0,data:{}}}function su(i){const e=i;return!!e.attributes&&!!e.startTime&&!!e.name&&!!e.endTime&&!!e.status}function iu(i){return typeof i.getSpanJSON=="function"}function ou(i){const{traceFlags:e}=i.spanContext();return e===Cn}function ru(i){if(!(!i||i.code===Bc))return i.code===Fc?"ok":i.message||"unknown_error"}const Mu="_sentryRootSpan";function hn(i){return i[Mu]||i}function Or(){Ar||(ts(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly.")}),Ar=!0)}const An=50,_t="?",Er=/\(error: (.*)\)/,_r=/captureMessage|captureException/;function pn(...i){const e=i.sort((t,s)=>t[0]-s[0]).map(t=>t[1]);return(t,s=0,o=0)=>{const r=[],M=t.split(`
|
|
2
2
|
`);for(let n=s;n<M.length;n++){const u=M[n];if(u.length>1024)continue;const N=Er.test(u)?u.replace(Er,"$1"):u;if(!N.match(/\S*Error: /)){for(const l of e){const c=l(N);if(c){r.push(c);break}}if(r.length>=An+o)break}}return au(r.slice(o))}}function nu(i){return Array.isArray(i)?pn(...i):i}function au(i){if(!i.length)return[];const e=Array.from(i);return/sentryWrapped/.test(fs(e).function||"")&&e.pop(),e.reverse(),_r.test(fs(e).function||"")&&(e.pop(),_r.test(fs(e).function||"")&&e.pop()),e.slice(0,An).map(t=>({...t,filename:t.filename||fs(e).filename,function:t.function||_t}))}function fs(i){return i[i.length-1]||{}}const pi="<anonymous>";function yt(i){try{return!i||typeof i!="function"?pi:i.name||pi}catch{return pi}}function Sr(i){const e=i.exception;if(e){const t=[];try{return e.values.forEach(s=>{s.stacktrace.frames&&t.push(...s.stacktrace.frames)}),t}catch{return}}}const Vs={},xr={};function kt(i,e){Vs[i]=Vs[i]||[],Vs[i].push(e)}function Yt(i,e){if(!xr[i]){xr[i]=!0;try{e()}catch(t){Z&&B.error(`Error while instrumenting ${i}`,t)}}}function ve(i,e){const t=i&&Vs[i];if(t)for(const s of t)try{s(e)}catch(o){Z&&B.error(`Error while triggering instrumentation handler.
|
|
3
3
|
Type: ${i}
|
|
4
4
|
Name: ${yt(s)}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./assets/index-Co3YA5NW.js","./assets/_commonjsHelpers-D6-XlEtG.js","./assets/index-Dbe-II7_.js","./assets/ConfigCustomJavascriptSet__loadShare__react__loadShare__-CzzIM-HW.js","./assets/ConfigCustomJavascriptSet__mf_v__runtimeInit__mf_v__-BaLGCXMi.js","./assets/jsx-runtime-o-xyxrOj.js","./assets/createSvgIcon-BQThUM-f.js","./assets/DefaultPropsProvider-9qubdy-V.js","./assets/defaultTheme-avbtL0lf.js","./assets/createTheme-BwMO3rTt.js","./assets/DefaultPropsProvider-DbEA5uR6.js","./assets/Tabs-CvEv0KOT.js","./assets/useTheme-MELayQMj.js","./assets/useThemeWithoutDefault-C-hl_s0Z.js","./assets/FilledInput-BpuM_GyB.js","./assets/useEnhancedEffect-CdLBzwyA.js","./assets/index-B7G6Jpdl.js","./assets/useTheme-CDtRWagv.js","./assets/ConfigCustomJavascriptSet__loadShare__react_mf_2_dom__loadShare__-DibxNPKw.js","./assets/index-
|
|
2
|
-
import{i as d,C as p}from"./assets/ConfigCustomJavascriptSet__mf_v__runtimeInit__mf_v__-BaLGCXMi.js";import s from"./assets/virtualExposes-BMKIjWrE.js";import{_ as a}from"./assets/preload-helper-Dp1pzeXC.js";const n={react:async()=>await a(()=>import("./assets/index-Co3YA5NW.js").then(t=>t.i),__vite__mapDeps([0,1]),import.meta.url),"@mui/x-date-pickers":async()=>await a(()=>import("./assets/index-Dbe-II7_.js"),__vite__mapDeps([2,3,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]),import.meta.url),"@mui/material":async()=>await a(()=>import("./assets/index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./assets/index-Co3YA5NW.js","./assets/_commonjsHelpers-D6-XlEtG.js","./assets/index-Dbe-II7_.js","./assets/ConfigCustomJavascriptSet__loadShare__react__loadShare__-CzzIM-HW.js","./assets/ConfigCustomJavascriptSet__mf_v__runtimeInit__mf_v__-BaLGCXMi.js","./assets/jsx-runtime-o-xyxrOj.js","./assets/createSvgIcon-BQThUM-f.js","./assets/DefaultPropsProvider-9qubdy-V.js","./assets/defaultTheme-avbtL0lf.js","./assets/createTheme-BwMO3rTt.js","./assets/DefaultPropsProvider-DbEA5uR6.js","./assets/Tabs-CvEv0KOT.js","./assets/useTheme-MELayQMj.js","./assets/useThemeWithoutDefault-C-hl_s0Z.js","./assets/FilledInput-BpuM_GyB.js","./assets/useEnhancedEffect-CdLBzwyA.js","./assets/index-B7G6Jpdl.js","./assets/useTheme-CDtRWagv.js","./assets/ConfigCustomJavascriptSet__loadShare__react_mf_2_dom__loadShare__-DibxNPKw.js","./assets/index-BzS6q3oS.js","./assets/ThemeProvider-DZTpMR8n.js","./assets/index-DQRrNJnQ.js","./assets/ConfigCustomJavascriptSet__loadShare___mf_0_mui_mf_1_material__loadShare__-BlV79j8y.js","./assets/index-B8sZ2j0S.js","./assets/index-sawv1cUe.js","./assets/ConfigCustomJavascriptSet__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__-DAwHgdl6.js","./assets/preload-helper-Dp1pzeXC.js","./assets/index-CWXHfC2L.js","./assets/leaflet-src-A2ZHl6nF.js","./assets/index-DIWNdd4a.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as d,C as p}from"./assets/ConfigCustomJavascriptSet__mf_v__runtimeInit__mf_v__-BaLGCXMi.js";import s from"./assets/virtualExposes-BMKIjWrE.js";import{_ as a}from"./assets/preload-helper-Dp1pzeXC.js";const n={react:async()=>await a(()=>import("./assets/index-Co3YA5NW.js").then(t=>t.i),__vite__mapDeps([0,1]),import.meta.url),"@mui/x-date-pickers":async()=>await a(()=>import("./assets/index-Dbe-II7_.js"),__vite__mapDeps([2,3,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]),import.meta.url),"@mui/material":async()=>await a(()=>import("./assets/index-BzS6q3oS.js"),__vite__mapDeps([19,9,3,1,4,7,8,10,5,11,12,13,14,15,16,17,6,18,20]),import.meta.url),"@iobroker/adapter-react-v5":async()=>await a(()=>import("./assets/index-DQRrNJnQ.js"),__vite__mapDeps([21,9,3,1,4,22,23,12,13,17,8]),import.meta.url),"@iobroker/json-config":async()=>await a(()=>import("./assets/index-sawv1cUe.js"),__vite__mapDeps([24,3,1,4,22,23,12,9,13,25,18,14,7,8,10,5,15,26]),import.meta.url),"react-dom":async()=>await a(()=>import("./assets/index-CWXHfC2L.js").then(t=>t.i),__vite__mapDeps([27,1,3,4]),import.meta.url),leaflet:async()=>await a(()=>import("./assets/leaflet-src-A2ZHl6nF.js").then(t=>t.l),__vite__mapDeps([28,1]),import.meta.url),"@mui/icons-material":async()=>await a(()=>import("./assets/index-DIWNdd4a.js"),__vite__mapDeps([29,5,3,1,4,6,7,8,9,10]),import.meta.url)},o={react:{name:"react",version:"18.3.1",scope:["default"],loaded:!1,from:"ConfigCustomJavascriptSet",async get(){o.react.loaded=!0;const{react:e}=n,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},"@mui/x-date-pickers":{name:"@mui/x-date-pickers",version:"7.29.4",scope:["default"],loaded:!1,from:"ConfigCustomJavascriptSet",async get(){o["@mui/x-date-pickers"].loaded=!0;const{"@mui/x-date-pickers":e}=n,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},"@mui/material":{name:"@mui/material",version:"6.4.12",scope:["default"],loaded:!1,from:"ConfigCustomJavascriptSet",async get(){o["@mui/material"].loaded=!0;const{"@mui/material":e}=n,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},"@iobroker/adapter-react-v5":{name:"@iobroker/adapter-react-v5",version:"7.6.18",scope:["default"],loaded:!1,from:"ConfigCustomJavascriptSet",async get(){o["@iobroker/adapter-react-v5"].loaded=!0;const{"@iobroker/adapter-react-v5":e}=n,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},"@iobroker/json-config":{name:"@iobroker/json-config",version:"7.6.18",scope:["default"],loaded:!1,from:"ConfigCustomJavascriptSet",async get(){o["@iobroker/json-config"].loaded=!0;const{"@iobroker/json-config":e}=n,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},"react-dom":{name:"react-dom",version:"18.3.1",scope:["default"],loaded:!1,from:"ConfigCustomJavascriptSet",async get(){o["react-dom"].loaded=!0;const{"react-dom":e}=n,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},leaflet:{name:"leaflet",version:"1.9.4",scope:["default"],loaded:!1,from:"ConfigCustomJavascriptSet",async get(){o.leaflet.loaded=!0;const{leaflet:e}=n,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},"@mui/icons-material":{name:"@mui/icons-material",version:"6.4.12",scope:["default"],loaded:!1,from:"ConfigCustomJavascriptSet",async get(){o["@mui/icons-material"].loaded=!0;const{"@mui/icons-material":e}=n,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}}},f=[],u={},c="default",l="ConfigCustomJavascriptSet";async function k(e={},t=[]){const r=d.init({name:l,remotes:f,shared:o,plugins:[],shareStrategy:"version-first"});var i=u[c];if(i||(i=u[c]={from:l}),!(t.indexOf(i)>=0)){t.push(i),r.initShareScopeMap("default",e);try{await Promise.all(await r.initializeSharing("default",{strategy:"version-first",from:"build",initScope:t}))}catch(m){console.error(m)}return p.initResolve(r),r}}function y(e){if(!(e in s))throw new Error(`Module ${e} does not exist in container.`);return s[e]().then(t=>()=>t)}export{y as get,k as init};
|
package/admin/mf-manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"iobroker_javascript","name":"iobroker_javascript","metaData":{"name":"iobroker_javascript","type":"app","buildInfo":{"buildVersion":"1.0.0","buildName":"iobroker_javascript"},"remoteEntry":{"name":"remoteEntry.js","path":"","type":"module"},"ssrRemoteEntry":{"name":"remoteEntry.js","path":"","type":"module"},"types":{"path":"","name":""},"globalName":"iobroker_javascript","pluginVersion":"0.2.5","publicPath":"./"},"shared":[{"id":"iobroker_javascript
|
|
1
|
+
{"id":"iobroker_javascript","name":"iobroker_javascript","metaData":{"name":"iobroker_javascript","type":"app","buildInfo":{"buildVersion":"1.0.0","buildName":"iobroker_javascript"},"remoteEntry":{"name":"remoteEntry.js","path":"","type":"module"},"ssrRemoteEntry":{"name":"remoteEntry.js","path":"","type":"module"},"types":{"path":"","name":""},"globalName":"iobroker_javascript","pluginVersion":"0.2.5","publicPath":"./"},"shared":[{"id":"iobroker_javascript:@iobroker/adapter-react-v5","name":"@iobroker/adapter-react-v5","version":"7.6.19","requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/index-C3f8WSiz.js","assets/createSvgIcon-BQT-7-GS.js","assets/iobroker_javascript__loadShare__react__loadShare__-BiJPUKBK.js","assets/_commonjsHelpers-Cpj98o6Y.js","assets/iobroker_javascript__mf_v__runtimeInit__mf_v__-CBQgOKij.js","assets/index-CuCs5aLs.js","assets/useTheme-DF6qfrtI.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:@mui/material","name":"@mui/material","version":"6.4.12","requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/index-glyB1sbj.js","assets/createSvgIcon-BQT-7-GS.js","assets/iobroker_javascript__loadShare__react__loadShare__-BiJPUKBK.js","assets/_commonjsHelpers-Cpj98o6Y.js","assets/iobroker_javascript__mf_v__runtimeInit__mf_v__-CBQgOKij.js","assets/inheritsLoose--KnFDOw1.js","assets/useTheme-DF6qfrtI.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react-dom","name":"react-dom","version":"18.3.1","requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/index-x0m5vR1T.js","assets/_commonjsHelpers-Cpj98o6Y.js","assets/iobroker_javascript__loadShare__react__loadShare__-BiJPUKBK.js","assets/iobroker_javascript__mf_v__runtimeInit__mf_v__-CBQgOKij.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react","name":"react","version":"18.3.1","requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/index-Do-nCdWy.js","assets/_commonjsHelpers-Cpj98o6Y.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:prop-types","name":"prop-types","version":"15.8.1","requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/index-DQiceR5U.js","assets/_commonjsHelpers-Cpj98o6Y.js"]},"css":{"async":[],"sync":[]}}}],"remotes":[],"exposes":[]}
|
package/admin/remoteEntry.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./assets/index-
|
|
2
|
-
import{i as d,a as m}from"./assets/iobroker_javascript__mf_v__runtimeInit__mf_v__-CBQgOKij.js";import s from"./assets/virtualExposes-BIHI7g3E.js";import{_ as a}from"./assets/preload-helper-Dp1pzeXC.js";const i={"react-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./assets/index-C3f8WSiz.js","./assets/createSvgIcon-BQT-7-GS.js","./assets/iobroker_javascript__loadShare__react__loadShare__-BiJPUKBK.js","./assets/_commonjsHelpers-Cpj98o6Y.js","./assets/iobroker_javascript__mf_v__runtimeInit__mf_v__-CBQgOKij.js","./assets/index-CuCs5aLs.js","./assets/useTheme-DF6qfrtI.js","./assets/index-glyB1sbj.js","./assets/inheritsLoose--KnFDOw1.js","./assets/index-x0m5vR1T.js","./assets/index-Do-nCdWy.js","./assets/index-DQiceR5U.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as d,a as m}from"./assets/iobroker_javascript__mf_v__runtimeInit__mf_v__-CBQgOKij.js";import s from"./assets/virtualExposes-BIHI7g3E.js";import{_ as a}from"./assets/preload-helper-Dp1pzeXC.js";const i={"@iobroker/adapter-react-v5":async()=>await a(()=>import("./assets/index-C3f8WSiz.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url),"@mui/material":async()=>await a(()=>import("./assets/index-glyB1sbj.js"),__vite__mapDeps([7,1,2,3,4,8,6]),import.meta.url),"react-dom":async()=>await a(()=>import("./assets/index-x0m5vR1T.js").then(t=>t.i),__vite__mapDeps([9,3,2,4]),import.meta.url),react:async()=>await a(()=>import("./assets/index-Do-nCdWy.js").then(t=>t.i),__vite__mapDeps([10,3]),import.meta.url),"prop-types":async()=>await a(()=>import("./assets/index-DQiceR5U.js").then(t=>t.i),__vite__mapDeps([11,3]),import.meta.url)},o={"@iobroker/adapter-react-v5":{name:"@iobroker/adapter-react-v5",version:"7.6.19",scope:["default"],loaded:!1,from:"iobroker_javascript",async get(){o["@iobroker/adapter-react-v5"].loaded=!0;const{"@iobroker/adapter-react-v5":e}=i,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},"@mui/material":{name:"@mui/material",version:"6.4.12",scope:["default"],loaded:!1,from:"iobroker_javascript",async get(){o["@mui/material"].loaded=!0;const{"@mui/material":e}=i,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},"react-dom":{name:"react-dom",version:"18.3.1",scope:["default"],loaded:!1,from:"iobroker_javascript",async get(){o["react-dom"].loaded=!0;const{"react-dom":e}=i,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},react:{name:"react",version:"18.3.1",scope:["default"],loaded:!1,from:"iobroker_javascript",async get(){o.react.loaded=!0;const{react:e}=i,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}},"prop-types":{name:"prop-types",version:"15.8.1",scope:["default"],loaded:!1,from:"iobroker_javascript",async get(){o["prop-types"].loaded=!0;const{"prop-types":e}=i,r={...await e()};return Object.defineProperty(r,"__esModule",{value:!0,enumerable:!1}),function(){return r}},shareConfig:{singleton:!0,requiredVersion:"*"}}},_=[],u={},p="default",c="iobroker_javascript";async function k(e={},t=[]){const r=d.init({name:c,remotes:_,shared:o,plugins:[],shareStrategy:"version-first"});var n=u[p];if(n||(n=u[p]={from:c}),!(t.indexOf(n)>=0)){t.push(n),r.initShareScopeMap("default",e);try{await Promise.all(await r.initializeSharing("default",{strategy:"version-first",from:"build",initScope:t}))}catch(l){console.error(l)}return m.initResolve(r),r}}function y(e){if(!(e in s))throw new Error(`Module ${e} does not exist in container.`);return s[e]().then(t=>()=>t)}export{y as get,k as init};
|
package/admin/tab.html
CHANGED
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
type="text/javascript"
|
|
116
116
|
src="google-blockly/own/blocks_object.js"
|
|
117
117
|
></script>
|
|
118
|
-
<script type="module" crossorigin src="./assets/index-
|
|
118
|
+
<script type="module" crossorigin src="./assets/index-B2hdKtuj.js"></script>
|
|
119
119
|
<link rel="modulepreload" crossorigin href="./assets/iobroker_javascript__mf_v__runtimeInit__mf_v__-CBQgOKij.js">
|
|
120
120
|
<link rel="modulepreload" crossorigin href="./assets/_commonjsHelpers-Cpj98o6Y.js">
|
|
121
121
|
<link rel="modulepreload" crossorigin href="./assets/iobroker_javascript__loadShare__react__loadShare__-BiJPUKBK.js">
|