import{a as X}from"./chunk-DKIKVTGV.js";import{b as G,e as L}from"./chunk-DR3P2OYP.js";import{J as A,K as U}from"./chunk-KPL7BGNQ.js";import{Aa as d,B as p,Bc as V,Cc as W,Ec as Y,Ka as o,La as _,Lb as v,Ma as m,Oa as g,Rb as P,Sb as T,Tb as b,Ub as y,Vb as k,Wb as x,X as t,Zb as S,_b as O,ac as M,ba as h,bb as r,cb as a,cc as N,gc as B,la as w,ma as I,na as E,nc as H,oc as R,pa as e,pc as D,qa as n,ra as u,uc as F}from"./chunk-IA4I4FFG.js";import"./chunk-TZKEAXTW.js";import{a as j}from"./chunk-LNEQX42T.js";import"./chunk-2AGRZFDF.js";import"./chunk-RJD74PWK.js";import"./chunk-7Y4TN2QM.js";import"./chunk-JJB3Y43V.js";import"./chunk-YUNOCBLG.js";import"./chunk-VGMJM2GZ.js";import"./chunk-2NIBOUWM.js";import"./chunk-I547WOKC.js";import"./chunk-BJ43HUSB.js";import"./chunk-7NPRN4HX.js";import"./chunk-NMFL75IO.js";import{k as C}from"./chunk-24IZEI4V.js";function q(c,s){if(c&1&&(e(0,"ion-item")(1,"span"),o(2),n()()),c&2){let i=s.$implicit;t(2),m("- Error => ",i)}}var $=class c{constructor(){this.modalCtrl=p(D);this.navCtrl=p(v);this.translate=p(V);this.promisesHandler=p(G);this.electron=p(L);j({refresh:U,power:A})}ionViewDidEnter(){this.startCountdown()}presentConfigPasswordModal(){return C(this,null,function*(){this.stopCountdown=!0,(yield this.modalCtrl.create({component:X})).present()})}retry(){this.promisesHandler.activePromises>0?this.countdown=1:this.navCtrl.pop()}exit(){this.electron!==void 0&&this.electron.ipcRenderer.send(this.electron.channels.closeApp)}startCountdown(){return C(this,null,function*(){for(this.countdown=20,this.stopCountdown=!1;this.countdown>0&&(yield this.delay(1e3),!this.stopCountdown);)--this.countdown;!this.stopCountdown&&this.countdown===0&&this.retry()})}delay(s){return new Promise(i=>this.timeout=setTimeout(i,s))}ionViewWillLeave(){this.stopCountdown=!0,this.promisesHandler.promisesErrors=[],this.promisesHandler.error=!1}static{this.\u0275fac=function(i){return new(i||c)}}static{this.\u0275cmp=h({type:c,selectors:[["app-error"]],decls:34,vars:22,consts:[["color","medium",1,"ion-text-center"],[1,"ion-text-center"],["fill","outline","color","dark",3,"click"],[3,"click"],["name","settings"],[1,"retry",3,"click"],["name","refresh"],["color","danger",1,"exit",3,"click"],["name","power"]],template:function(i,l){i&1&&(e(0,"ion-header")(1,"ion-toolbar",0)(2,"ion-title"),o(3),r(4,"translate"),n()()(),e(5,"ion-content")(6,"ion-list"),I(7,q,3,1,"ion-item",null,w),n(),e(9,"ion-card")(10,"ion-card-header",1)(11,"ion-card-title"),o(12),r(13,"translate"),r(14,"translate"),n()(),e(15,"ion-card-content",1)(16,"ion-button",2),d("click",function(){return l.stopCountdown=!0}),o(17),r(18,"translate"),n()()()(),e(19,"ion-footer")(20,"ion-buttons")(21,"ion-button",3),d("click",function(){return l.presentConfigPasswordModal()}),u(22,"ion-icon",4),o(23),r(24,"translate"),n(),e(25,"ion-button",5),d("click",function(){return l.retry()}),u(26,"ion-icon",6),e(27,"span"),o(28),r(29,"translate"),n()(),e(30,"ion-button",7),d("click",function(){return l.exit()}),u(31,"ion-icon",8),o(32),r(33,"translate"),n()()()),i&2&&(t(3),_(a(4,8,"ERROR")),t(4),E(l.promisesHandler.promisesErrors),t(5),g(" ",a(13,10,"RETRYING_CONNECTION"),"",l.countdown," ",a(14,12,"SECONDS")," "),t(5),m(" ",a(18,14,"STOP_COUNTDOWN")," "),t(6),m(" ",a(24,16,"GO_TO_CONFIG")," "),t(5),_(a(29,18,"RETRY")),t(4),m(" ",a(33,20,"EXIT")," "))},dependencies:[N,b,x,k,y,F,T,O,B,S,H,M,R,P,Y,W],styles:["ion-item[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{white-space:normal!important}ion-footer[_ngcontent-%COMP%]   ion-buttons[_ngcontent-%COMP%]{background-color:var(--ion-color-secondary-shade)}"]})}};export{$ as ErrorPage};
