"use strict";var D=Object.create;var s=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var V=Object.getPrototypeOf;var x=Object.prototype.hasOwnProperty;var v=(o,e)=>s(o,"name",{value:e,configurable:true});var W=(o,e)=>{for(var r in e)s(o,r,{get:e[r],enumerable:true})};var H=(o,e,r,n)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let a of F(e))if(!x.call(o,a)&&a!==r)s(o,a,{get:()=>e[a],enumerable:!(n=b(e,a))||n.enumerable})}return o};var m=(o,e,r)=>(r=o!=null?D(V(o)):{},H(e||!o||!o.__esModule?s(r,"default",{value:o,enumerable:true}):r,o));var O=o=>H(s({},"__esModule",{value:true}),o);var B=(o,e,r,n)=>{var a=n>1?void 0:n?b(e,r):e;for(var i=o.length-1,l;i>=0;i--)if(l=o[i])a=(n?l(e,r,a):l(a))||a;if(n&&a)s(e,r,a);return a};var $={};W($,{default:()=>G});module.exports=O($);var t=require("react/jsx-runtime");var h=require("@mdi/js");var C=require("electron-react-titlebar/renderer");var P=require("mobx-react");var f=require("react");var k=require("react-intl");var y=require("../../api/apiBase");var S=require("../../config");var c=require("../../environment");var w=require("../../features/publishDebugInfo");var E=require("../../helpers/update-helpers");var I=m(require("../../i18n/globalMessages"));var M=m(require("../AppUpdateInfoBar"));var u=m(require("../ui/InfoBar"));var A=m(require("../ui/Link"));var g=m(require("../ui/icon"));let p=class extends f.Component{constructor(e){super(e);this.state={shouldShowAppUpdateInfoBar:true}}render(){const{children:e,error:r,isOnline:n,isAPIHealthy:a,retryHealthCheck:i,isHealthCheckLoading:l,isFullScreen:R,installAppUpdate:T,appUpdateIsDownloaded:_,updateVersion:L,intl:U,isUpdateAvailable:N}=this.props;let d=(0,y.serverName)();d=d==="Custom"?"your Custom Server":d;return(0,t.jsxs)(t.Fragment,{children:[c.isWindows&&!R&&(0,t.jsx)(C.TitleBar,{menu:window["ferdium"].menu.template,icon:"assets/images/logo.svg"}),(0,t.jsxs)("div",{className:"auth",children:[!n&&(0,t.jsxs)(u.default,{type:"warning",children:[(0,t.jsx)(g.default,{icon:h.mdiFlash}),U.formatMessage(I.default.notConnectedToTheInternet)]}),(_||c.isSnap&&N)&&this.state.shouldShowAppUpdateInfoBar&&(0,t.jsx)(M.default,{onInstallUpdate:T,updateVersionParsed:(0,E.updateVersionParse)(L),onHide:()=>{this.setState({shouldShowAppUpdateInfoBar:false})}}),n&&!a&&(0,t.jsxs)(u.default,{type:"danger",ctaLabel:"Try again",ctaLoading:l,sticky:true,onClick:i,children:[(0,t.jsx)(g.default,{icon:h.mdiFlash}),U.formatMessage(I.default.APIUnhealthy,{serverNameParse:d})]}),(0,t.jsx)("div",{className:"auth__layout",children:(0,f.cloneElement)(e,{error:r})}),(0,t.jsx)(A.default,{to:`${S.GITHUB_FERDIUM_URL}/ferdium-app`,className:"auth__adlk",target:"_blank",children:(0,t.jsx)("img",{src:"./assets/images/adlk.svg",alt:""})})]}),(0,t.jsx)(w.Component,{})]})}};v(p,"AuthLayout");p=B([P.observer],p);var G=(0,k.injectIntl)(p);
