Ride-The-Lightning-RTL/frontend/258.eae6e81d49eb53ef.js
2022-11-16 13:02:43 -08:00

1 line
332 KiB
JavaScript

"use strict";(self.webpackChunkRTLApp=self.webpackChunkRTLApp||[]).push([[258],{7258:(kp,ft,f)=>{f.r(ft),f.d(ft,{ECLModule:()=>Rp});var u=f(9808),x=f(1402),Bt=f(8878),t=f(5e3),m=f(7093),M=f(5899);function Ht(n,a){1&n&&t._UZ(0,"mat-progress-bar",3)}let Ct=(()=>{class n{constructor(e){this.router=e,this.loading=!1,this.router.events.subscribe(i=>{switch(!0){case i instanceof x.OD:this.loading=!0;break;case i instanceof x.m2:case i instanceof x.gk:case i instanceof x.Q3:this.loading=!1}})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-root"]],decls:4,vars:1,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"inner-sidenav-content"],["color","primary","mode","indeterminate",4,"ngIf"],["outlet","outlet"],["color","primary","mode","indeterminate"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.YNc(1,Ht,1,0,"mat-progress-bar",1),t._UZ(2,"router-outlet",null,2),t.qZA()),2&e&&(t.xp6(1),t.Q6J("ngIf",i.loading))},directives:[m.xw,m.yH,m.Wh,u.O5,M.pW,x.lC],styles:[""],data:{animation:[Bt.g]}}),n})();var p=f(7579),_=f(2722),ot=f(1365),xt=f(3396),L=f(2687),l=f(7731),C=f(2501),O=f(5043),w=f(5620),P=f(62),q=f(9546),yt=f(3954),b=f(9224),N=f(7423),st=f(2181),vt=f(5245),Z=f(3322);const Tt=function(n){return{backgroundColor:n}};function zt(n,a){if(1&n&&t._UZ(0,"span",6),2&n){const e=t.oxw();t.Q6J("ngStyle",t.VKq(1,Tt,null==e.information?null:e.information.color))}}function Vt(n,a){if(1&n&&(t.TgZ(0,"div")(1,"h4",1),t._uU(2,"Color"),t.qZA(),t.TgZ(3,"div",2),t._UZ(4,"span",7),t._uU(5),t.ALo(6,"uppercase"),t.qZA()()),2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngStyle",t.VKq(4,Tt,null==e.information?null:e.information.color)),t.xp6(1),t.hij(" ",t.lcZ(6,2,null==e.information?null:e.information.color)," ")}}function Gt(n,a){if(1&n&&(t.TgZ(0,"span",2),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(e)}}let Wt=(()=>{class n{constructor(e){this.commonService=e,this.chains=[""]}ngOnChanges(){this.chains=[],this.chains.push("Bitcoin "+(this.information.network?this.commonService.titleCase(this.information.network):"Testnet"))}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(P.v))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-node-info"]],inputs:{information:"information",showColorFieldSeparately:"showColorFieldSeparately"},features:[t.TTD],decls:17,vars:5,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],[1,"dashboard-info-title"],[1,"overflow-wrap","dashboard-info-value"],["class","dashboard-node-dot dot",3,"ngStyle",4,"ngIf"],[4,"ngIf"],["class","overflow-wrap dashboard-info-value",4,"ngFor","ngForOf"],[1,"dashboard-node-dot","dot",3,"ngStyle"],[1,"dashboard-node-square",3,"ngStyle"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div")(2,"h4",1),t._uU(3,"Alias"),t.qZA(),t.TgZ(4,"div",2),t._uU(5),t.YNc(6,zt,1,3,"span",3),t.qZA()(),t.YNc(7,Vt,7,6,"div",4),t.TgZ(8,"div")(9,"h4",1),t._uU(10,"Implementation"),t.qZA(),t.TgZ(11,"div",2),t._uU(12),t.qZA()(),t.TgZ(13,"div")(14,"h4",1),t._uU(15,"Chain"),t.qZA(),t.YNc(16,Gt,2,1,"span",5),t.qZA()()),2&e&&(t.xp6(5),t.hij(" ",null==i.information?null:i.information.alias," "),t.xp6(1),t.Q6J("ngIf",!i.showColorFieldSeparately),t.xp6(1),t.Q6J("ngIf",i.showColorFieldSeparately),t.xp6(5),t.Oqu(null!=i.information&&i.information.lnImplementation||null!=i.information&&i.information.version?(null==i.information?null:i.information.lnImplementation)+" "+(null==i.information?null:i.information.version):""),t.xp6(4),t.Q6J("ngForOf",i.chains))},directives:[m.xw,m.yH,m.Wh,u.O5,u.PC,Z.Zl,u.sg],pipes:[u.gd],styles:[""]}),n})();function $t(n,a){if(1&n&&(t.TgZ(0,"div",2)(1,"div")(2,"h4",3),t._uU(3,"Lightning"),t.qZA(),t.TgZ(4,"div",4),t._uU(5),t.ALo(6,"number"),t.qZA(),t._UZ(7,"mat-progress-bar",5),t.qZA(),t.TgZ(8,"div")(9,"h4",3),t._uU(10,"On-chain"),t.qZA(),t.TgZ(11,"div",4),t._uU(12),t.ALo(13,"number"),t.qZA(),t._UZ(14,"mat-progress-bar",5),t.qZA(),t.TgZ(15,"div")(16,"h4",3),t._uU(17,"Total"),t.qZA(),t.TgZ(18,"div",4),t._uU(19),t.ALo(20,"number"),t.qZA()()()),2&n){const e=t.oxw();t.xp6(5),t.hij("",t.lcZ(6,5,e.balances.lightning)," Sats"),t.xp6(2),t.s9C("value",e.balances.lightning/e.balances.total*100),t.xp6(5),t.hij("",t.lcZ(13,7,e.balances.onchain)," Sats"),t.xp6(2),t.s9C("value",e.balances.onchain/e.balances.total*100),t.xp6(5),t.hij("",t.lcZ(20,9,e.balances.total)," Sats")}}function Xt(n,a){if(1&n&&(t.TgZ(0,"div",6)(1,"p"),t._uU(2),t.qZA()()),2&n){const e=t.oxw();t.xp6(2),t.Oqu(e.errorMessage)}}let Kt=(()=>{class n{constructor(){this.balances={onchain:0,lightning:0,total:0}}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-balances-info"]],inputs:{balances:"balances",errorMessage:"errorMessage"},decls:3,vars:2,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",4,"ngIf","ngIfElse"],["errorBlock",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayoutAlign","start",1,"dashboard-info-title"],[1,"overflow-wrap","dashboard-info-value"],["mode","determinate",1,"dashboard-progress-bar",3,"value"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(e,i){if(1&e&&(t.YNc(0,$t,21,11,"div",0),t.YNc(1,Xt,3,1,"ng-template",null,1,t.W1O)),2&e){const o=t.MAs(2);t.Q6J("ngIf",""===(null==i.errorMessage?null:i.errorMessage.trim()))("ngIfElse",o)}},directives:[u.O5,m.xw,m.yH,m.Wh,M.pW],pipes:[u.JJ],styles:[""]}),n})();var y=f(7322),$=f(7238),K=f(4834),H=f(8129);const jt=function(){return["../connections/channels/open"]},te=function(n){return{filter:n}};function ee(n,a){if(1&n&&(t.TgZ(0,"div",19)(1,"a",20),t._uU(2),t.ALo(3,"slice"),t.qZA(),t.TgZ(4,"div",6)(5,"mat-hint",21)(6,"strong",8),t._uU(7,"Local:"),t.qZA(),t._uU(8),t.ALo(9,"number"),t.qZA(),t.TgZ(10,"mat-hint",22),t._UZ(11,"fa-icon",23),t._uU(12),t.ALo(13,"number"),t.qZA(),t.TgZ(14,"mat-hint",24)(15,"strong",8),t._uU(16,"Remote:"),t.qZA(),t._uU(17),t.ALo(18,"number"),t.qZA()(),t._UZ(19,"mat-progress-bar",25),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(3);t.xp6(1),t.s9C("matTooltip",e.alias||e.shortChannelId),t.s9C("matTooltipDisabled",(e.alias||e.shortChannelId).length<26),t.Q6J("routerLink",t.DdM(23,jt))("state",t.VKq(24,te,e.channelId)),t.xp6(1),t.AsE(" ",t.Dn7(3,11,(null==e?null:e.alias)||(null==e?null:e.shortChannelId),0,24),"",((null==e?null:e.alias)||(null==e?null:e.shortChannelId)).length>25?"...":""," "),t.xp6(6),t.hij("",t.xi3(9,15,(null==e?null:e.toLocal)||0,"1.0-0")," Sats"),t.xp6(3),t.Q6J("icon",i.faBalanceScale),t.xp6(1),t.hij(" (",t.lcZ(13,18,(null==e?null:e.balancedness)||0),") "),t.xp6(5),t.hij("",t.xi3(18,20,(null==e?null:e.toRemote)||0,"1.0-0")," Sats"),t.xp6(2),t.s9C("value",e.toLocal&&e.toLocal>0?+e.toLocal/(+e.toLocal+ +e.toRemote)*100:0)}}function ne(n,a){if(1&n&&(t.TgZ(0,"div",17),t.YNc(1,ee,20,26,"div",18),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",e.allChannels)}}function ie(n,a){if(1&n&&(t.TgZ(0,"div",3)(1,"div",4)(2,"span",5),t._uU(3,"Total Capacity"),t.qZA(),t.TgZ(4,"div",6)(5,"mat-hint",7)(6,"strong",8),t._uU(7,"Local:"),t.qZA(),t._uU(8),t.ALo(9,"number"),t.qZA(),t.TgZ(10,"mat-hint",9),t._UZ(11,"fa-icon",10),t._uU(12),t.ALo(13,"number"),t.qZA(),t.TgZ(14,"mat-hint",11)(15,"strong",8),t._uU(16,"Remote:"),t.qZA(),t._uU(17),t.ALo(18,"number"),t.qZA()(),t._UZ(19,"mat-progress-bar",12),t.qZA(),t.TgZ(20,"div",13),t._UZ(21,"mat-divider",14),t.qZA(),t.TgZ(22,"div",15),t.YNc(23,ne,2,1,"div",16),t.qZA()()),2&n){const e=t.oxw(),i=t.MAs(2);t.xp6(8),t.hij("",t.xi3(9,7,(null==e.channelBalances?null:e.channelBalances.localBalance)||0,"1.0-0")," Sats"),t.xp6(3),t.Q6J("icon",e.faBalanceScale),t.xp6(1),t.hij(" (",t.lcZ(13,10,(null==e.channelBalances?null:e.channelBalances.balancedness)||0),") "),t.xp6(5),t.hij("",t.xi3(18,12,(null==e.channelBalances?null:e.channelBalances.remoteBalance)||0,"1.0-0")," Sats"),t.xp6(2),t.s9C("value",null!=e.channelBalances&&e.channelBalances.localBalance&&(null==e.channelBalances?null:e.channelBalances.localBalance)>0?+(null==e.channelBalances?null:e.channelBalances.localBalance)/(+(null==e.channelBalances?null:e.channelBalances.localBalance)+ +(null==e.channelBalances?null:e.channelBalances.remoteBalance))*100:0),t.xp6(4),t.Q6J("ngIf",e.allChannels&&(null==e.allChannels?null:e.allChannels.length)>0)("ngIfElse",i)}}function ae(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",26),t._uU(1," No channels available. "),t.TgZ(2,"button",27),t.NdJ("click",function(){return t.CHM(e),t.oxw().goToChannels()}),t._uU(3,"Open Channel"),t.qZA()()}}function oe(n,a){if(1&n&&(t.TgZ(0,"div",28)(1,"p"),t._uU(2),t.qZA()()),2&n){const e=t.oxw();t.xp6(2),t.Oqu(e.errorMessage)}}let se=(()=>{class n{constructor(e){this.router=e,this.faBalanceScale=L.DL8,this.faDumbbell=L.FlN,this.sortBy="Balance Score"}goToChannels(){this.router.navigateByUrl("/ecl/connections")}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-capacity-info"]],inputs:{channelBalances:"channelBalances",allChannels:"allChannels",sortBy:"sortBy",errorMessage:"errorMessage"},decls:5,vars:2,consts:[["fxLayout","column","fxLayoutAlign","space-between stretch","fxFlex","100",4,"ngIf","ngIfElse"],["noChannelBlock",""],["errorBlock",""],["fxLayout","column","fxLayoutAlign","space-between stretch","fxFlex","100"],["fxLayout","column","fxFlex","9","fxLayoutAlign","end start"],[1,"dashboard-capacity-header","this-channel-capacity"],["fxLayout","row","fxLayoutAlign","space-between start",1,"w-100"],["fxFlex","40","fxLayoutAlign","start center",1,"font-size-90"],[1,"font-weight-900","mr-5px"],["fxFlex","20","fxLayoutAlign","center center",1,"font-size-90"],["matTooltip","Balance Score",1,"mr-3px",3,"icon"],["fxFlex","40","fxLayoutAlign","end center",1,"font-size-90"],["mode","determinate","color","accent",1,"dashboard-progress-bar","this-channel-bar",3,"value"],["fxLayout","column","fxFlex","3","fxLayoutAlign","end stretch"],[1,"dashboard-divider"],[1,"channels-capacity-scroll",3,"perfectScrollbar"],["fxLayout","column","fxFlex","100",4,"ngIf","ngIfElse"],["fxLayout","column","fxFlex","100"],["class","mt-2",4,"ngFor","ngForOf"],[1,"mt-2"],[1,"dashboard-capacity-header",3,"routerLink","state","matTooltip","matTooltipDisabled"],["fxFlex","40","fxLayoutAlign","start center",1,"font-size-90","color-primary"],["fxFlex","20","fxLayoutAlign","center center",1,"font-size-90","color-primary"],["matTooltip","Balance Score",1,"color-primary","mr-3px",3,"icon"],["fxFlex","40","fxLayoutAlign","end center",1,"font-size-90","color-primary"],["mode","determinate",1,"dashboard-progress-bar",3,"value"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between start",1,"mt-1","w-100"],["mat-stroked-button","","color","primary","tabindex","1",3,"click"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(e,i){if(1&e&&(t.YNc(0,ie,24,15,"div",0),t.YNc(1,ae,4,0,"ng-template",null,1,t.W1O),t.YNc(3,oe,3,1,"ng-template",null,2,t.W1O)),2&e){const o=t.MAs(4);t.Q6J("ngIf",""===(null==i.errorMessage?null:i.errorMessage.trim()))("ngIfElse",o)}},directives:[u.O5,m.xw,m.Wh,m.yH,y.bx,q.BN,$.gM,M.pW,K.d,H.$V,u.sg,x.yS,N.lW],pipes:[u.JJ,u.OU],styles:[".channels-capacity-scroll[_ngcontent-%COMP%]{width:100%;height:100%;overflow-y:hidden}"]}),n})();function le(n,a){if(1&n&&(t.TgZ(0,"div",2)(1,"div",3)(2,"div")(3,"h4",4),t._uU(4,"Daily"),t.qZA(),t.TgZ(5,"div",5),t._uU(6),t.ALo(7,"number"),t.qZA()(),t.TgZ(8,"div")(9,"h4",4),t._uU(10,"Weekly"),t.qZA(),t.TgZ(11,"div",5),t._uU(12),t.ALo(13,"number"),t.qZA()(),t.TgZ(14,"div")(15,"h4",4),t._uU(16,"Monthly"),t.qZA(),t.TgZ(17,"div",5),t._uU(18),t.ALo(19,"number"),t.qZA()()(),t.TgZ(20,"div",3)(21,"div")(22,"h4",4),t._uU(23,"Transactions"),t.qZA(),t.TgZ(24,"div",5),t._uU(25),t.ALo(26,"number"),t.qZA()(),t.TgZ(27,"div")(28,"h4",4),t._uU(29,"Transactions"),t.qZA(),t.TgZ(30,"div",5),t._uU(31),t.ALo(32,"number"),t.qZA()(),t.TgZ(33,"div")(34,"h4",4),t._uU(35,"Transactions"),t.qZA(),t.TgZ(36,"div",5),t._uU(37),t.ALo(38,"number"),t.qZA()()()()),2&n){const e=t.oxw();t.xp6(6),t.hij("",t.lcZ(7,6,null==e.fees?null:e.fees.daily_fee)," Sats"),t.xp6(6),t.hij("",t.lcZ(13,8,null==e.fees?null:e.fees.weekly_fee)," Sats"),t.xp6(6),t.hij("",t.lcZ(19,10,null==e.fees?null:e.fees.monthly_fee)," Sats"),t.xp6(7),t.Oqu(t.lcZ(26,12,null==e.fees?null:e.fees.daily_txs)),t.xp6(6),t.Oqu(t.lcZ(32,14,null==e.fees?null:e.fees.weekly_txs)),t.xp6(6),t.Oqu(t.lcZ(38,16,null==e.fees?null:e.fees.monthly_txs))}}function re(n,a){if(1&n&&(t.TgZ(0,"div",6)(1,"p"),t._uU(2),t.qZA()()),2&n){const e=t.oxw();t.xp6(2),t.Oqu(e.errorMessage)}}let ce=(()=>{class n{constructor(){this.totalFees=[{name:"Monthly",value:0},{name:"Weekly",value:0},{name:"Daily",value:0}],this.maxFeeValue=100}ngOnChanges(){var e;if(null===(e=this.fees)||void 0===e?void 0:e.monthly_fee){this.totalFees=[{name:"Monthly",value:this.fees.monthly_fee},{name:"Weekly",value:this.fees.weekly_fee||0},{name:"Daily ",value:this.fees.daily_fee||0}];const i=Math.ceil(Math.log(this.fees.monthly_fee+1)/Math.LN10),o=Math.pow(10,i-1);this.maxFeeValue=Math.ceil(this.fees.monthly_fee/o)*o/5||100,Object.assign(this,this.totalFees)}else this.totalFees=[{name:"Monthly",value:0},{name:"Weekly",value:0},{name:"Daily",value:0}],this.maxFeeValue=100,Object.assign(this,this.totalFees)}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-fee-info"]],inputs:{fees:"fees",errorMessage:"errorMessage"},features:[t.TTD],decls:3,vars:2,consts:[["fxLayout","row","fxFlex","100","fxLayoutAlign","start stretch",4,"ngIf","ngIfElse"],["errorBlock",""],["fxLayout","row","fxFlex","100","fxLayoutAlign","start stretch"],["fxLayout","column","fxFlex","50","fxLayoutAlign","space-between stretch"],["fxLayoutAlign","start",1,"dashboard-info-title"],[1,"overflow-wrap","dashboard-info-value"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(e,i){if(1&e&&(t.YNc(0,le,39,18,"div",0),t.YNc(1,re,3,1,"ng-template",null,1,t.W1O)),2&e){const o=t.MAs(2);t.Q6J("ngIf",""===(null==i.errorMessage?null:i.errorMessage.trim()))("ngIfElse",o)}},directives:[u.O5,m.xw,m.yH,m.Wh],pipes:[u.JJ],styles:[""]}),n})();function ue(n,a){if(1&n&&(t.TgZ(0,"div",2)(1,"div",3)(2,"div")(3,"h4",4),t._uU(4,"Active"),t.qZA(),t.TgZ(5,"div",5),t._UZ(6,"span",6),t._uU(7),t.ALo(8,"number"),t.qZA()(),t.TgZ(9,"div")(10,"h4",4),t._uU(11,"Pending"),t.qZA(),t.TgZ(12,"div",5),t._UZ(13,"span",7),t._uU(14),t.ALo(15,"number"),t.qZA()(),t.TgZ(16,"div")(17,"h4",4),t._uU(18,"Inactive"),t.qZA(),t.TgZ(19,"div",5),t._UZ(20,"span",8),t._uU(21),t.ALo(22,"number"),t.qZA()()(),t.TgZ(23,"div",3)(24,"div")(25,"h4",4),t._uU(26,"Capacity"),t.qZA(),t.TgZ(27,"div",5),t._uU(28),t.ALo(29,"number"),t.qZA()(),t.TgZ(30,"div")(31,"h4",4),t._uU(32,"Capacity"),t.qZA(),t.TgZ(33,"div",5),t._uU(34),t.ALo(35,"number"),t.qZA()(),t.TgZ(36,"div")(37,"h4",4),t._uU(38,"Capacity"),t.qZA(),t.TgZ(39,"div",5),t._uU(40),t.ALo(41,"number"),t.qZA()()()()),2&n){const e=t.oxw();t.xp6(7),t.Oqu(t.lcZ(8,6,(null==e.channelsStatus.active?null:e.channelsStatus.active.channels)||0)),t.xp6(7),t.Oqu(t.lcZ(15,8,(null==e.channelsStatus.pending?null:e.channelsStatus.pending.channels)||0)),t.xp6(7),t.Oqu(t.lcZ(22,10,(null==e.channelsStatus.inactive?null:e.channelsStatus.inactive.channels)||0)),t.xp6(7),t.hij("",t.lcZ(29,12,(null==e.channelsStatus.active?null:e.channelsStatus.active.capacity)||0)," Sats"),t.xp6(6),t.hij("",t.lcZ(35,14,(null==e.channelsStatus.pending?null:e.channelsStatus.pending.capacity)||0)," Sats"),t.xp6(6),t.hij("",t.lcZ(41,16,(null==e.channelsStatus.inactive?null:e.channelsStatus.inactive.capacity)||0)," Sats")}}function pe(n,a){if(1&n&&(t.TgZ(0,"div",9)(1,"p"),t._uU(2),t.qZA()()),2&n){const e=t.oxw();t.xp6(2),t.Oqu(e.errorMessage)}}let me=(()=>{class n{constructor(){this.channelsStatus={}}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-status-info"]],inputs:{channelsStatus:"channelsStatus",errorMessage:"errorMessage"},decls:3,vars:2,consts:[["fxLayout","row","fxFlex","100","fxLayoutAlign","start stretch",4,"ngIf","ngIfElse"],["errorBlock",""],["fxLayout","row","fxFlex","100","fxLayoutAlign","start stretch"],["fxLayout","column","fxFlex","50","fxLayoutAlign","space-between stretch"],["fxLayoutAlign","start",1,"dashboard-info-title"],[1,"overflow-wrap","dashboard-info-value"],[1,"dot","tiny-dot","green"],[1,"dot","tiny-dot","yellow"],[1,"dot","tiny-dot","grey"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(e,i){if(1&e&&(t.YNc(0,ue,42,18,"div",0),t.YNc(1,pe,3,1,"ng-template",null,1,t.W1O)),2&e){const o=t.MAs(2);t.Q6J("ngIf",""===(null==i.errorMessage?null:i.errorMessage.trim()))("ngIfElse",o)}},directives:[u.O5,m.xw,m.yH,m.Wh],pipes:[u.JJ],styles:[""]}),n})();function de(n,a){if(1&n&&(t.TgZ(0,"mat-hint",19)(1,"strong",20),t._uU(2,"Capacity: "),t.qZA(),t._uU(3),t.ALo(4,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(3),t.hij("",t.xi3(4,1,e.toRemote||0,"1.0-0")," Sats")}}function he(n,a){if(1&n&&(t.TgZ(0,"mat-hint",19)(1,"strong",20),t._uU(2,"Capacity: "),t.qZA(),t._uU(3),t.ALo(4,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(3),t.hij("",t.xi3(4,1,e.toLocal||0,"1.0-0")," Sats")}}function _e(n,a){if(1&n&&t._UZ(0,"mat-progress-bar",21),2&n){const e=t.oxw().$implicit,i=t.oxw(3);t.s9C("value",i.totalLiquidity>0?(+e.toRemote||0)/i.totalLiquidity*100:0)}}function ge(n,a){if(1&n&&t._UZ(0,"mat-progress-bar",21),2&n){const e=t.oxw().$implicit,i=t.oxw(3);t.s9C("value",i.totalLiquidity>0?(+e.toLocal||0)/i.totalLiquidity*100:0)}}const fe=function(){return["../connections/channels/open"]},Ce=function(n){return{filter:n}};function xe(n,a){if(1&n&&(t.TgZ(0,"div",14)(1,"a",15),t._uU(2),t.ALo(3,"slice"),t.qZA(),t.TgZ(4,"div",16),t.YNc(5,de,5,4,"mat-hint",17),t.YNc(6,he,5,4,"mat-hint",17),t.qZA(),t.YNc(7,_e,1,1,"mat-progress-bar",18),t.YNc(8,ge,1,1,"mat-progress-bar",18),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(3);t.xp6(1),t.s9C("matTooltip",e.alias||e.shortChannelId),t.s9C("matTooltipDisabled",(e.alias||e.shortChannelId).length<26),t.Q6J("routerLink",t.DdM(14,fe))("state",t.VKq(15,Ce,e.channelId)),t.xp6(1),t.AsE(" ",t.Dn7(3,10,e.alias||e.shortChannelId,0,24),"",(e.alias||e.shortChannelId).length>25?"...":""," "),t.xp6(3),t.Q6J("ngIf","In"===i.direction),t.xp6(1),t.Q6J("ngIf","Out"===i.direction),t.xp6(1),t.Q6J("ngIf","In"===i.direction),t.xp6(1),t.Q6J("ngIf","Out"===i.direction)}}function ye(n,a){if(1&n&&(t.TgZ(0,"div",12),t.YNc(1,xe,9,17,"div",13),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",e.allChannels)}}const ve=function(n,a,e){return{"mb-4":n,"mb-2":a,"mb-1":e}};function Te(n,a){if(1&n&&(t.TgZ(0,"div",3)(1,"div",4)(2,"span",5),t._uU(3,"Total Capacity"),t.qZA(),t.TgZ(4,"mat-hint",6),t._uU(5),t.ALo(6,"number"),t.qZA(),t._UZ(7,"mat-progress-bar",7),t.qZA(),t.TgZ(8,"div",8),t._UZ(9,"mat-divider",9),t.qZA(),t.TgZ(10,"div",10),t.YNc(11,ye,2,1,"div",11),t.qZA()()),2&n){const e=t.oxw(),i=t.MAs(2);t.Q6J("ngClass",t.kEZ(7,ve,e.screenSize===e.screenSizeEnum.XS||e.screenSize===e.screenSizeEnum.SM,e.screenSize===e.screenSizeEnum.MD,e.screenSize===e.screenSizeEnum.LG||e.screenSize===e.screenSizeEnum.XL)),t.xp6(5),t.hij("",t.xi3(6,4,e.totalLiquidity,"1.0-0")," Sats"),t.xp6(6),t.Q6J("ngIf",e.allChannels&&e.allChannels.length>0)("ngIfElse",i)}}function Le(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",24),t.NdJ("click",function(){return t.CHM(e),t.oxw(2).goToChannels()}),t._uU(1,"Open Channel"),t.qZA()}}function be(n,a){if(1&n&&(t.TgZ(0,"div",22),t._uU(1," No channels available. "),t.YNc(2,Le,2,0,"button",23),t.qZA()),2&n){const e=t.oxw();t.xp6(2),t.Q6J("ngIf","Out"===e.direction)}}function Se(n,a){if(1&n&&(t.TgZ(0,"div",25)(1,"p"),t._uU(2),t.qZA()()),2&n){const e=t.oxw();t.xp6(2),t.Oqu(e.errorMessage)}}let Ze=(()=>{class n{constructor(e,i){this.router=e,this.commonService=i,this.screenSize="",this.screenSizeEnum=l.cu}ngOnInit(){this.screenSize=this.commonService.getScreenSize()}goToChannels(){this.router.navigateByUrl("/ecl/connections")}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(x.F0),t.Y36(P.v))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-liquidity-info"]],inputs:{direction:"direction",totalLiquidity:"totalLiquidity",allChannels:"allChannels",errorMessage:"errorMessage"},decls:5,vars:2,consts:[["fxLayout","column","fxLayoutAlign","space-between stretch","fxFlex","100",3,"ngClass",4,"ngIf","ngIfElse"],["noChannelBlock",""],["errorBlock",""],["fxLayout","column","fxLayoutAlign","space-between stretch","fxFlex","100",3,"ngClass"],["fxLayout","column","fxFlex","9","fxLayoutAlign","end start"],[1,"dashboard-capacity-header","this-channel-capacity"],[1,"font-size-90"],["mode","determinate","color","accent","value","100",1,"dashboard-progress-bar","this-channel-bar"],["fxLayout","column","fxFlex","3","fxLayoutAlign","end stretch"],[1,"dashboard-divider"],["fxLayout","column","fxFlex.gt-sm","88","fxFlex","84","fxLayoutAlign","start start",3,"perfectScrollbar"],["fxLayout","column","fxFlex","100","class","w-100",4,"ngIf","ngIfElse"],["fxLayout","column","fxFlex","100",1,"w-100"],["class","mt-2",4,"ngFor","ngForOf"],[1,"mt-2"],[1,"dashboard-capacity-header",3,"routerLink","state","matTooltip","matTooltipDisabled"],["fxLayout","row","fxLayoutAlign","space-between start",1,"w-100"],["fxFlex","100","fxLayoutAlign","start center","class","font-size-90 color-primary",4,"ngIf"],["class","dashboard-progress-bar","mode","determinate",3,"value",4,"ngIf"],["fxFlex","100","fxLayoutAlign","start center",1,"font-size-90","color-primary"],[1,"font-weight-900","mr-5px"],["mode","determinate",1,"dashboard-progress-bar",3,"value"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between start",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","1",3,"click",4,"ngIf"],["mat-stroked-button","","color","primary","tabindex","1",3,"click"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(e,i){if(1&e&&(t.YNc(0,Te,12,11,"div",0),t.YNc(1,be,3,1,"ng-template",null,1,t.W1O),t.YNc(3,Se,3,1,"ng-template",null,2,t.W1O)),2&e){const o=t.MAs(4);t.Q6J("ngIf",""===(null==i.errorMessage?null:i.errorMessage.trim()))("ngIfElse",o)}},directives:[u.O5,m.xw,m.Wh,m.yH,u.mk,Z.oO,y.bx,M.pW,K.d,H.$V,u.sg,x.yS,$.gM,N.lW],pipes:[u.JJ,u.OU],styles:[""]}),n})();var R=f(3251),Q=f(9300),A=f(6087),S=f(4847),r=f(2075),J=f(8966),U=f(2994),X=f(6642),d=f(3075),Y=f(7531),j=f(3390),tt=f(6534),k=f(4107),z=f(508);function Ae(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Description is required."),t.qZA())}function Ee(n,a){if(1&n&&(t.TgZ(0,"mat-option",25),t._uU(1),t.ALo(2,"titlecase"),t.qZA()),2&n){const e=a.$implicit;t.Q6J("value",e),t.xp6(1),t.Oqu(t.lcZ(2,2,e))}}function we(n,a){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.invoiceError)}}function Ie(n,a){if(1&n&&(t.TgZ(0,"div",26),t._UZ(1,"fa-icon",27),t.YNc(2,we,2,1,"span",11),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faExclamationTriangle),t.xp6(1),t.Q6J("ngIf",""!==e.invoiceError)}}let Fe=(()=>{class n{constructor(e,i,o,s,c,h){this.dialogRef=e,this.data=i,this.store=o,this.decimalPipe=s,this.commonService=c,this.actions=h,this.faExclamationTriangle=L.eHv,this.selNode={},this.description="",this.invoiceValue=null,this.invoiceValueHint="",this.invoicePaymentReq="",this.information={},this.private=!1,this.expiryStep=100,this.pageSize=l.IV,this.timeUnitEnum=l.Qk,this.timeUnits=l.LO,this.selTimeUnit=l.Qk.SECS,this.invoiceError="",this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.pageSize=this.data.pageSize,this.store.select(C.LR).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e}),this.store.select(C.yD).pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{this.information=e}),this.actions.pipe((0,_.R)(this.unSubs[2]),(0,Q.h)(e=>e.type===l.lr.UPDATE_API_CALL_STATUS_ECL)).subscribe(e=>{e.type===l.lr.UPDATE_API_CALL_STATUS_ECL&&"CreateInvoice"===e.payload.action&&(e.payload.status===l.Bn.ERROR&&(this.invoiceError=e.payload.message),e.payload.status===l.Bn.COMPLETED&&this.dialogRef.close())})}onAddInvoice(e){if(this.invoiceError="",!this.description)return!0;let i=this.expiry?this.expiry:3600;this.expiry&&this.selTimeUnit!==l.Qk.SECS&&(i=this.commonService.convertTime(this.expiry,this.selTimeUnit,l.Qk.SECS));let o=null;o=this.invoiceValue?{description:this.description,expireIn:i,amountMsat:1e3*this.invoiceValue}:{description:this.description,expireIn:i},this.store.dispatch((0,U.Z$)({payload:o}))}resetData(){this.description="",this.invoiceValue=null,this.private=!1,this.expiry=null,this.invoiceValueHint="",this.selTimeUnit=l.Qk.SECS,this.invoiceError=""}onInvoiceValueChange(){this.selNode&&this.selNode.fiatConversion&&this.invoiceValue&&this.invoiceValue>99&&(this.invoiceValueHint="",this.commonService.convertCurrency(this.invoiceValue,l.NT.SATS,l.NT.OTHER,this.selNode.currencyUnits&&this.selNode.currencyUnits.length>2?this.selNode.currencyUnits[2]:"",this.selNode.fiatConversion).pipe((0,_.R)(this.unSubs[3])).subscribe({next:e=>{this.invoiceValueHint="= "+e.symbol+this.decimalPipe.transform(e.OTHER,l.Xz.OTHER)+" "+e.unit},error:e=>{this.invoiceValueHint="Conversion Error: "+e}}))}onTimeUnitChange(e){this.expiry&&this.selTimeUnit!==e.value&&(this.expiry=this.commonService.convertTime(this.expiry,this.selTimeUnit,e.value)),this.selTimeUnit=e.value}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(J.so),t.Y36(J.WI),t.Y36(w.yh),t.Y36(u.JJ),t.Y36(P.v),t.Y36(X.eX))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-create-invoices"]],decls:35,vars:16,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","8","fxFlex","5","fxLayoutAlign","center","default","","mat-button","",1,"btn-close-x","p-0",3,"mat-dialog-close"],[1,"padding-gap-x-large"],["fxLayout","row wrap","fxLayoutAlign","start space-between","fxFlex","100"],["addInvoiceForm","ngForm"],["fxFlex","100","fxLayoutAlign","start end"],["matInput","","autoFocus","","placeholder","Description","tabindex","2","name","description","required","",3,"ngModel","ngModelChange"],[4,"ngIf"],["fxLayout","row","fxLayoutAlign","space-between start","fxFlex","100"],["fxFlex","40"],["matInput","","placeholder","Amount","type","number","tabindex","3","name","invValue",3,"ngModel","step","min","ngModelChange","keyup"],["matSuffix",""],["fxFlex","30"],["matInput","","placeholder","Expiry","type","number","name","exp","tabindex","4",3,"ngModel","step","min","ngModelChange"],["fxFlex","26"],["tabindex","5","name","timeUnit",3,"value","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center",1,"mt-2"],["mat-button","","color","primary","tabindex","7","type","reset",1,"mr-1",3,"click"],["mat-button","","color","primary","tabindex","8",3,"click"],[3,"value"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"]],template:function(e,i){if(1&e){const o=t.EpF();t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-header",2)(3,"div",3)(4,"span",4),t._uU(5,"Create Invoice"),t.qZA()(),t.TgZ(6,"button",5),t._uU(7,"X"),t.qZA()(),t.TgZ(8,"mat-card-content",6)(9,"form",7,8)(11,"mat-form-field",9)(12,"input",10),t.NdJ("ngModelChange",function(c){return i.description=c}),t.qZA(),t.YNc(13,Ae,2,0,"mat-error",11),t.qZA(),t.TgZ(14,"div",12)(15,"mat-form-field",13)(16,"input",14),t.NdJ("ngModelChange",function(c){return i.invoiceValue=c})("keyup",function(){return i.onInvoiceValueChange()}),t.qZA(),t.TgZ(17,"span",15),t._uU(18," Sats "),t.qZA(),t.TgZ(19,"mat-hint"),t._uU(20),t.qZA()(),t.TgZ(21,"mat-form-field",16)(22,"input",17),t.NdJ("ngModelChange",function(c){return i.expiry=c}),t.qZA(),t.TgZ(23,"span",15),t._uU(24),t.ALo(25,"titlecase"),t.qZA()(),t.TgZ(26,"mat-form-field",18)(27,"mat-select",19),t.NdJ("selectionChange",function(c){return i.onTimeUnitChange(c)}),t.YNc(28,Ee,3,4,"mat-option",20),t.qZA()()(),t.YNc(29,Ie,3,2,"div",21),t.TgZ(30,"div",22)(31,"button",23),t.NdJ("click",function(){return i.resetData()}),t._uU(32,"Clear Field"),t.qZA(),t.TgZ(33,"button",24),t.NdJ("click",function(){t.CHM(o);const c=t.MAs(10);return i.onAddInvoice(c)}),t._uU(34,"Create Invoice"),t.qZA()()()()()()}2&e&&(t.xp6(6),t.Q6J("mat-dialog-close",!1),t.xp6(6),t.Q6J("ngModel",i.description),t.xp6(1),t.Q6J("ngIf",!i.description),t.xp6(3),t.Q6J("ngModel",i.invoiceValue)("step",100)("min",1),t.xp6(4),t.Oqu(i.invoiceValueHint),t.xp6(2),t.Q6J("ngModel",i.expiry)("step",i.selTimeUnit===i.timeUnitEnum.SECS?300:i.selTimeUnit===i.timeUnitEnum.MINS?10:i.selTimeUnit===i.timeUnitEnum.HOURS?2:1)("min",1),t.xp6(2),t.hij("",t.lcZ(25,14,i.selTimeUnit)," "),t.xp6(3),t.Q6J("value",i.selTimeUnit),t.xp6(1),t.Q6J("ngForOf",i.timeUnits),t.xp6(1),t.Q6J("ngIf",""!==i.invoiceError))},directives:[m.xw,m.yH,b.dk,m.Wh,N.lW,J.ZT,b.dn,d._Y,d.JL,d.F,y.KE,Y.Nt,d.Fj,j.h,d.Q7,d.JJ,d.On,u.O5,y.TO,d.wV,d.qQ,tt.q,y.R9,y.bx,k.gD,u.sg,z.ey,q.BN],pipes:[u.rS],styles:[""]}),n})();var qe=f(7766),E=f(7861),G=f(9445);function Ne(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Description is required."),t.qZA())}function Oe(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"form",4,5)(2,"mat-form-field",6)(3,"input",7),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().description=o}),t.qZA(),t.YNc(4,Ne,2,0,"mat-error",8),t.qZA(),t.TgZ(5,"mat-form-field",9)(6,"input",10,11),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().invoiceValue=o})("keyup",function(){return t.CHM(e),t.oxw().onInvoiceValueChange()}),t.qZA(),t.TgZ(8,"span",12),t._uU(9," Sats "),t.qZA(),t.TgZ(10,"mat-hint"),t._uU(11),t.qZA()(),t.TgZ(12,"div",13)(13,"button",14),t.NdJ("click",function(){return t.CHM(e),t.oxw().resetData()}),t._uU(14,"Clear Field"),t.qZA(),t.TgZ(15,"button",15),t.NdJ("click",function(){t.CHM(e);const o=t.MAs(1);return t.oxw().onAddInvoice(o)}),t._uU(16,"Create Invoice"),t.qZA()()()}if(2&n){const e=t.oxw();t.xp6(3),t.Q6J("ngModel",e.description),t.xp6(1),t.Q6J("ngIf",!e.description),t.xp6(2),t.Q6J("ngModel",e.invoiceValue)("step",100)("min",1),t.xp6(5),t.Oqu(e.invoiceValueHint)}}function Pe(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",16)(1,"button",17),t.NdJ("click",function(){return t.CHM(e),t.oxw().openCreateInvoiceModal()}),t._uU(2,"Create Invoice"),t.qZA()()}}function Ue(n,a){if(1&n&&(t.TgZ(0,"mat-option",55),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.Q6J("value",e),t.xp6(1),t.Oqu(i.getLabel(e))}}function Re(n,a){1&n&&t._UZ(0,"mat-progress-bar",56)}function ke(n,a){1&n&&t._UZ(0,"th",57)}const lt=function(n){return{"mr-0":n}};function De(n,a){if(1&n&&t._UZ(0,"span",62),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.VKq(1,lt,e.screenSize===e.screenSizeEnum.XS))}}function Je(n,a){if(1&n&&t._UZ(0,"span",63),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.VKq(1,lt,e.screenSize===e.screenSizeEnum.XS))}}function Me(n,a){if(1&n&&t._UZ(0,"span",64),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.VKq(1,lt,e.screenSize===e.screenSizeEnum.XS))}}function Qe(n,a){if(1&n&&(t.TgZ(0,"td",58),t.YNc(1,De,1,3,"span",59),t.YNc(2,Je,1,3,"span",60),t.YNc(3,Me,1,3,"span",61),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Q6J("ngIf","received"===(null==e?null:e.status)),t.xp6(1),t.Q6J("ngIf","unpaid"===(null==e?null:e.status)),t.xp6(1),t.Q6J("ngIf",!(null!=e&&e.status)||"expired"===(null==e?null:e.status)||"unknown"===(null==e?null:e.status))}}function Ye(n,a){1&n&&(t.TgZ(0,"th",65),t._uU(1,"Date Created"),t.qZA())}function Be(n,a){if(1&n&&(t.TgZ(0,"td",58),t._uU(1),t.ALo(2,"date"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,1e3*(null==e?null:e.timestamp),"dd/MMM/y HH:mm"))}}function He(n,a){1&n&&(t.TgZ(0,"th",65),t._uU(1,"Date Expiry"),t.qZA())}function ze(n,a){if(1&n&&(t.TgZ(0,"td",58),t._uU(1),t.ALo(2,"date"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,1e3*(null==e?null:e.expiresAt),"dd/MMM/y HH:mm")||"-")}}function Ve(n,a){1&n&&(t.TgZ(0,"th",65),t._uU(1,"Date Settled"),t.qZA())}function Ge(n,a){if(1&n&&(t.TgZ(0,"td",58),t._uU(1),t.ALo(2,"date"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,1e3*(null==e?null:e.receivedAt),"dd/MMM/y HH:mm")||"-")}}function We(n,a){1&n&&(t.TgZ(0,"th",65),t._uU(1,"Node ID"),t.qZA())}const rt=function(n){return{width:n}};function $e(n,a){if(1&n&&(t.TgZ(0,"td",58)(1,"div",66)(2,"span",67),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,rt,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function Xe(n,a){1&n&&(t.TgZ(0,"th",65),t._uU(1,"Description"),t.qZA())}function Ke(n,a){if(1&n&&(t.TgZ(0,"td",58)(1,"div",66)(2,"span",67),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,rt,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.description)}}function je(n,a){1&n&&(t.TgZ(0,"th",65),t._uU(1,"Payment Hash"),t.qZA())}function tn(n,a){if(1&n&&(t.TgZ(0,"td",58)(1,"div",66)(2,"span",67),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,rt,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.paymentHash)}}function en(n,a){1&n&&(t.TgZ(0,"th",68),t._uU(1,"Amount (Sats)"),t.qZA())}function nn(n,a){if(1&n&&(t.TgZ(0,"td",58)(1,"span",69),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(null!=e&&e.amount?t.xi3(3,1,null==e?null:e.amount,"1.0-0"):"-")}}function an(n,a){1&n&&(t.TgZ(0,"th",70),t._uU(1," Amount Settled (Sats)"),t.qZA())}function on(n,a){if(1&n&&(t.TgZ(0,"td",58)(1,"span",69),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(null!=e&&e.amountSettled?t.xi3(3,1,null==e?null:e.amountSettled,"1.0-0"):"-")}}function sn(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",71)(1,"div",72)(2,"mat-select",73),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",74),t.NdJ("click",function(){return t.CHM(e),t.oxw(2).onDownloadCSV()}),t._uU(5,"Download CSV"),t.qZA()()()()}}function ln(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",75)(1,"div",72)(2,"mat-select",76),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",74),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw(2).onInvoiceClick(s)}),t._uU(5,"View Info"),t.qZA(),t.TgZ(6,"mat-option",74),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw(2).onRefreshInvoice(s)}),t._uU(7,"Refresh"),t.qZA()()()()}}function rn(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No invoice available."),t.qZA())}function cn(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting invoices..."),t.qZA())}function un(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Oqu(e.errorMessage)}}function pn(n,a){if(1&n&&(t.TgZ(0,"td",77),t.YNc(1,rn,2,0,"p",8),t.YNc(2,cn,2,0,"p",8),t.YNc(3,un,2,1,"p",8),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",(!(null!=e.invoices&&e.invoices.data)||(null==e.invoices||null==e.invoices.data?null:e.invoices.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.invoices&&e.invoices.data)||(null==e.invoices||null==e.invoices.data?null:e.invoices.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.invoices&&e.invoices.data)||(null==e.invoices||null==e.invoices.data?null:e.invoices.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const mn=function(n){return{"display-none":n}};function dn(n,a){if(1&n&&t._UZ(0,"tr",78),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,mn,(null==e.invoices?null:e.invoices.data)&&(null==e.invoices||null==e.invoices.data?null:e.invoices.data.length)>0))}}function hn(n,a){1&n&&t._UZ(0,"tr",79)}function _n(n,a){1&n&&t._UZ(0,"tr",80)}const gn=function(){return["all"]},fn=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},Cn=function(){return["no_invoice"]};function xn(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",18)(1,"div",19)(2,"div",20),t._UZ(3,"fa-icon",21),t.TgZ(4,"span",22),t._uU(5,"Invoices History"),t.qZA()(),t.TgZ(6,"div",23)(7,"mat-form-field",24)(8,"mat-select",25),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().selFilterBy=o})("selectionChange",function(){t.CHM(e);const o=t.oxw();return o.selFilter="",o.applyFilter()}),t.YNc(9,Ue,2,2,"mat-option",26),t.qZA()(),t.TgZ(10,"mat-form-field",24)(11,"input",27),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().selFilter=o})("input",function(){return t.CHM(e),t.oxw().applyFilter()})("keyup",function(){return t.CHM(e),t.oxw().applyFilter()}),t.qZA()()()(),t.TgZ(12,"div",28),t.YNc(13,Re,1,0,"mat-progress-bar",29),t.TgZ(14,"table",30,31),t.ynx(16,32),t.YNc(17,ke,1,0,"th",33),t.YNc(18,Qe,4,3,"td",34),t.BQk(),t.ynx(19,35),t.YNc(20,Ye,2,0,"th",36),t.YNc(21,Be,3,4,"td",34),t.BQk(),t.ynx(22,37),t.YNc(23,He,2,0,"th",36),t.YNc(24,ze,3,4,"td",34),t.BQk(),t.ynx(25,38),t.YNc(26,Ve,2,0,"th",36),t.YNc(27,Ge,3,4,"td",34),t.BQk(),t.ynx(28,39),t.YNc(29,We,2,0,"th",36),t.YNc(30,$e,4,4,"td",34),t.BQk(),t.ynx(31,40),t.YNc(32,Xe,2,0,"th",36),t.YNc(33,Ke,4,4,"td",34),t.BQk(),t.ynx(34,41),t.YNc(35,je,2,0,"th",36),t.YNc(36,tn,4,4,"td",34),t.BQk(),t.ynx(37,42),t.YNc(38,en,2,0,"th",43),t.YNc(39,nn,4,4,"td",34),t.BQk(),t.ynx(40,44),t.YNc(41,an,2,0,"th",45),t.YNc(42,on,4,4,"td",34),t.BQk(),t.ynx(43,46),t.YNc(44,sn,6,0,"th",47),t.YNc(45,ln,8,0,"td",48),t.BQk(),t.ynx(46,49),t.YNc(47,pn,4,3,"td",50),t.BQk(),t.YNc(48,dn,1,3,"tr",51),t.YNc(49,hn,1,0,"tr",52),t.YNc(50,_n,1,0,"tr",53),t.qZA()(),t._UZ(51,"mat-paginator",54),t.qZA()}if(2&n){const e=t.oxw();t.xp6(3),t.Q6J("icon",e.faHistory),t.xp6(5),t.Q6J("ngModel",e.selFilterBy),t.xp6(1),t.Q6J("ngForOf",t.DdM(13,gn).concat(e.displayedColumns.slice(0,-1))),t.xp6(2),t.Q6J("ngModel",e.selFilter),t.xp6(2),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",e.invoices)("ngClass",t.VKq(14,fn,""!==e.errorMessage)),t.xp6(34),t.Q6J("matFooterRowDef",t.DdM(16,Cn)),t.xp6(1),t.Q6J("matHeaderRowDef",e.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",e.displayedColumns),t.xp6(1),t.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}let Lt=(()=>{class n{constructor(e,i,o,s,c,h,g){this.logger=e,this.store=i,this.decimalPipe=o,this.commonService=s,this.datePipe=c,this.actions=h,this.camelCaseWithSpaces=g,this.calledFrom="transactions",this.faHistory=L.qO$,this.nodePageDefs=l.Xk,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="transactions",this.tableSetting={tableId:"invoices",recordsPerPage:l.IV,sortBy:"expiresAt",sortOrder:l.Pi.DESCENDING},this.selNode={},this.newlyAddedInvoiceMemo="",this.newlyAddedInvoiceValue=0,this.description="",this.invoiceValue=null,this.invoiceValueHint="",this.displayedColumns=[],this.invoicePaymentReq="",this.invoices=new r.by([]),this.invoiceJSONArr=[],this.information={},this.selFilter="",this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(C.LR).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e}),this.store.select(C.yD).pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{this.information=e}),this.store.select(C.nF).pipe((0,_.R)(this.unSubs[2])).subscribe(e=>{var i,o;this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=(null===(i=e.pageSettings.find(s=>s.pageId===this.PAGE_ID))||void 0===i?void 0:i.tables.find(s=>s.tableId===this.tableSetting.tableId))||(null===(o=l.c3.find(s=>s.pageId===this.PAGE_ID))||void 0===o?void 0:o.tables.find(s=>s.tableId===this.tableSetting.tableId)),this.displayedColumns=this.screenSize===l.cu.XS||this.screenSize===l.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("status"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:l.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(C.Ef).pipe((0,_.R)(this.unSubs[3])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.invoiceJSONArr=e.invoices&&e.invoices.length>0?e.invoices:[],this.invoiceJSONArr&&this.invoiceJSONArr.length>0&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadInvoicesTable(this.invoiceJSONArr),this.logger.info(e)}),this.actions.pipe((0,_.R)(this.unSubs[4]),(0,Q.h)(e=>e.type===l.lr.SET_LOOKUP_ECL||e.type===l.lr.UPDATE_API_CALL_STATUS_ECL)).subscribe(e=>{e.type===l.lr.SET_LOOKUP_ECL&&this.invoiceJSONArr.length>0&&this.sort&&this.paginator&&e.payload&&(this.updateInvoicesData(JSON.parse(JSON.stringify(e.payload))),this.loadInvoicesTable(this.invoiceJSONArr))})}ngAfterViewInit(){this.invoiceJSONArr&&this.invoiceJSONArr.length>0&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadInvoicesTable(this.invoiceJSONArr)}openCreateInvoiceModal(){this.store.dispatch((0,E.qR)({payload:{data:{pageSize:this.pageSize,component:Fe}}}))}onAddInvoice(e){if(!this.description)return!0;const i=this.expiry?this.expiry:3600;this.newlyAddedInvoiceMemo="ulbl"+Math.random().toString(36).slice(2)+Date.now(),this.newlyAddedInvoiceValue=this.invoiceValue;let o=null;o=this.invoiceValue?{description:this.description,expireIn:i,amountMsat:1e3*this.invoiceValue}:{description:this.description,expireIn:i},this.store.dispatch((0,U.Z$)({payload:o})),this.resetData()}onInvoiceClick(e){this.store.dispatch((0,E.qR)({payload:{data:{invoice:e,newlyAdded:!1,component:qe.R}}}))}onRefreshInvoice(e){this.store.dispatch((0,U.n7)({payload:e.paymentHash}))}updateInvoicesData(e){var i;this.invoiceJSONArr=null===(i=this.invoiceJSONArr)||void 0===i?void 0:i.map(o=>o.paymentHash===e.paymentHash?e:o)}applyFilter(){this.invoices.filter=this.selFilter.trim().toLowerCase()}getLabel(e){const i=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(o=>o.column===e);return i?i.label?i.label:this.camelCaseWithSpaces.transform(i.column,"_"):this.commonService.titleCase(e)}setFilterPredicate(){this.invoices.filterPredicate=(e,i)=>{var o,s,c,h;let g="";switch(this.selFilterBy){case"all":g=(e.timestamp?null===(o=this.datePipe.transform(new Date(1e3*e.timestamp),"dd/MMM/y HH:mm"))||void 0===o?void 0:o.toLowerCase():"")+JSON.stringify(e).toLowerCase();break;case"status":g=(null==e?void 0:e.status)&&"expired"!==(null==e?void 0:e.status)&&"unknown"!==(null==e?void 0:e.status)?null===(s=e.status)||void 0===s?void 0:s.toLowerCase():"expired/unknown";break;case"timestamp":case"expiresAt":case"receivedAt":g=(null===(c=this.datePipe.transform(new Date(1e3*(e[this.selFilterBy]||0)),"dd/MMM/y HH:mm"))||void 0===c?void 0:c.toLowerCase())||"";break;case"amount":case"amountSettled":g=(null===(h=e[this.selFilterBy])||void 0===h?void 0:h.toString())||"-";break;default:g=void 0===e[this.selFilterBy]?"":"string"==typeof e[this.selFilterBy]?e[this.selFilterBy].toLowerCase():"boolean"==typeof e[this.selFilterBy]?e[this.selFilterBy]?"yes":"no":e[this.selFilterBy].toString()}return"status"===this.selFilterBy?0===g.indexOf(i):g.includes(i)}}loadInvoicesTable(e){var i;this.invoices=new r.by(e?[...e]:[]),this.invoices.sortingDataAccessor=(o,s)=>o[s]&&isNaN(o[s])?o[s].toLocaleLowerCase():o[s]?+o[s]:null,this.invoices.sort=this.sort,null===(i=this.invoices.sort)||void 0===i||i.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.invoices.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter()}resetData(){this.description="",this.invoiceValue=null,this.expiry=null,this.invoiceValueHint=""}onInvoiceValueChange(){this.selNode&&this.selNode.fiatConversion&&this.invoiceValue&&this.invoiceValue>99&&(this.invoiceValueHint="",this.commonService.convertCurrency(this.invoiceValue,l.NT.SATS,l.NT.OTHER,this.selNode.currencyUnits&&this.selNode.currencyUnits.length>2?this.selNode.currencyUnits[2]:"",this.selNode.fiatConversion).pipe((0,_.R)(this.unSubs[5])).subscribe({next:e=>{this.invoiceValueHint="= "+e.symbol+this.decimalPipe.transform(e.OTHER,l.Xz.OTHER)+" "+e.unit},error:e=>{this.invoiceValueHint="Conversion Error: "+e}}))}onDownloadCSV(){this.invoices.data&&this.invoices.data.length>0&&this.commonService.downloadFile(this.invoices.data,"Invoices")}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(O.mQ),t.Y36(w.yh),t.Y36(u.JJ),t.Y36(P.v),t.Y36(u.uU),t.Y36(X.eX),t.Y36(G.i1))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-lightning-invoices"]],viewQuery:function(e,i){if(1&e&&(t.Gf(S.YE,5),t.Gf(A.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.sort=o.first),t.iGM(o=t.CRH())&&(i.paginator=o.first)}},inputs:{calledFrom:"calledFrom"},features:[t._Bn([{provide:A.ye,useValue:(0,l.pt)("Invoices")}])],decls:4,vars:3,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch"],["fxLayout","row wrap","fxLayoutAlign","stretch start","fxFlex","100",4,"ngIf"],["fxLayout","row",4,"ngIf"],["fxLayout","column","fxLayoutAlign","start stretch",4,"ngIf"],["fxLayout","row wrap","fxLayoutAlign","stretch start","fxFlex","100"],["addInvoiceForm","ngForm"],["fxFlex","100","fxLayoutAlign","space-between stretch"],["matInput","","placeholder","Description","tabindex","2","name","description","required","true",3,"ngModel","ngModelChange"],[4,"ngIf"],["fxFlex","100","fxLayoutAlign","start end"],["matInput","","placeholder","Amount","type","number","tabindex","3","name","invValue",3,"ngModel","step","min","ngModelChange","keyup"],["invcVal","ngModel"],["matSuffix",""],["fxLayout","row",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","9","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","10",3,"click"],["fxLayout","row"],["mat-flat-button","","color","primary","tabindex","8",3,"click"],["fxLayout","column","fxLayoutAlign","start stretch"],["fxLayout","column","fxLayoutAlign","start stretch","fxLayout.gt-sm","row wrap",1,"page-sub-title-container","mt-1"],["fxFlex","70","fxLayoutAlign","start start","fxLayoutAlign.gt-sm","start center"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxFlex","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxFlex","49"],["placeholder","Filter By","tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","status"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","Status",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","timestamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","expiresAt"],["matColumnDef","receivedAt"],["matColumnDef","nodeId"],["matColumnDef","description"],["matColumnDef","paymentHash"],["matColumnDef","amount"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","amountSettled"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","class","p1-3",4,"matHeaderCellDef"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_invoice"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","Status"],["mat-cell",""],["class","dot green","matTooltip","Received","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot yellow","matTooltip","Unpaid","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot red","matTooltip","Expired/Unknown","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["matTooltip","Received","matTooltipPosition","right",1,"dot","green",3,"ngClass"],["matTooltip","Unpaid","matTooltipPosition","right",1,"dot","yellow",3,"ngClass"],["matTooltip","Expired/Unknown","matTooltipPosition","right",1,"dot","red",3,"ngClass"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",1,"p1-3"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["placeholder","Actions","tabindex","4",1,"mr-0"],["mat-footer-cell","","colspan","4"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.YNc(1,Oe,17,6,"form",1),t.YNc(2,Pe,3,0,"div",2),t.YNc(3,xn,52,17,"div",3),t.qZA()),2&e&&(t.xp6(1),t.Q6J("ngIf","home"===i.calledFrom),t.xp6(1),t.Q6J("ngIf","transactions"===i.calledFrom),t.xp6(1),t.Q6J("ngIf","transactions"===i.calledFrom))},directives:[m.xw,m.yH,m.Wh,u.O5,d._Y,d.JL,d.F,y.KE,Y.Nt,d.Fj,d.Q7,d.JJ,d.On,y.TO,d.wV,d.qQ,tt.q,y.R9,y.bx,N.lW,q.BN,k.gD,u.sg,z.ey,H.$V,M.pW,r.BZ,S.YE,u.mk,Z.oO,r.w1,r.fO,r.ge,S.nU,$.gM,r.Dz,r.ev,u.PC,Z.Zl,k.$L,r.mD,r.yh,r.Ke,r.Q2,r.as,r.XQ,r.nj,r.Gk,A.NW],pipes:[u.uU,u.JJ],styles:[".mat-column-status[_ngcontent-%COMP%]{max-width:1.2rem;width:1.2rem}"]}),n})();var W=f(5698),ct=f(3289),bt=f(8104);const yn=["paymentReq"];function vn(n,a){if(1&n&&(t.TgZ(0,"mat-hint"),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Oqu(e.paymentDecodedHint)}}function Tn(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Payment request is required."),t.qZA())}function Ln(n,a){if(1&n&&(t.TgZ(0,"mat-error"),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Oqu(e.paymentDecodedHint)}}function bn(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Payment amount is required."),t.qZA())}function Sn(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mat-form-field",1)(1,"input",17,18),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().paymentAmount=o})("change",function(o){return t.CHM(e),t.oxw().onAmountChange(o)}),t.qZA(),t.TgZ(3,"mat-hint"),t._uU(4,"It is a zero amount invoice, enter amount to be paid."),t.qZA(),t.YNc(5,bn,2,0,"mat-error",11),t.qZA()}if(2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngModel",e.paymentAmount),t.xp6(4),t.Q6J("ngIf",!e.paymentAmount)}}function Zn(n,a){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.paymentError)}}function An(n,a){if(1&n&&(t.TgZ(0,"div",19),t._UZ(1,"fa-icon",20),t.YNc(2,Zn,2,1,"span",11),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faExclamationTriangle),t.xp6(1),t.Q6J("ngIf",""!==e.paymentError)}}let En=(()=>{class n{constructor(e,i,o,s,c,h,g,v){this.dialogRef=e,this.store=i,this.eclEffects=o,this.logger=s,this.commonService=c,this.decimalPipe=h,this.actions=g,this.dataService=v,this.faExclamationTriangle=L.eHv,this.selNode={},this.paymentDecoded={},this.zeroAmtInvoice=!1,this.paymentAmount=null,this.paymentRequest="",this.paymentDecodedHint="",this.selActiveChannel={},this.activeChannels={},this.feeLimit=null,this.selFeeLimitType=l.Vc[0],this.feeLimitTypes=l.Vc,this.paymentError="",this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.store.select(C.LR).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e}),this.store.select(C.Xz).pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{this.activeChannels=e.activeChannels,this.logger.info(e)}),this.actions.pipe((0,_.R)(this.unSubs[1]),(0,Q.h)(e=>e.type===l.lr.UPDATE_API_CALL_STATUS_ECL||e.type===l.lr.SEND_PAYMENT_STATUS_ECL)).subscribe(e=>{e.type===l.lr.SEND_PAYMENT_STATUS_ECL&&this.dialogRef.close(),e.type===l.lr.UPDATE_API_CALL_STATUS_ECL&&e.payload.status===l.Bn.ERROR&&"SendPayment"===e.payload.action&&(delete this.paymentDecoded.amount,this.paymentError=e.payload.message)})}onSendPayment(){if(!this.paymentRequest)return!0;this.paymentDecoded.timestamp?this.sendPayment():(this.paymentAmount=null,this.paymentError="",this.paymentDecodedHint="",this.paymentReq.control.setErrors(null),this.dataService.decodePayment(this.paymentRequest,!0).pipe((0,W.q)(1)).subscribe({next:e=>{this.paymentDecoded=e,this.paymentDecoded.timestamp&&!this.paymentDecoded.amount?(this.paymentDecoded.amount=0,this.zeroAmtInvoice=!0,this.paymentDecodedHint="Zero Amount Invoice | Memo: "+this.paymentDecoded.description):(this.zeroAmtInvoice=!1,this.selNode&&this.selNode.fiatConversion&&this.paymentDecoded.amount?this.commonService.convertCurrency(+this.paymentDecoded.amount,l.NT.SATS,l.NT.OTHER,this.selNode.currencyUnits&&this.selNode.currencyUnits.length>2?this.selNode.currencyUnits[2]:"",this.selNode.fiatConversion).pipe((0,_.R)(this.unSubs[2])).subscribe({next:i=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats ("+i.symbol+this.decimalPipe.transform(i.OTHER?i.OTHER:0,l.Xz.OTHER)+") | Memo: "+this.paymentDecoded.description},error:i=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount/1e3:0)+" Sats | Memo: "+this.paymentDecoded.description+". Unable to convert currency."}}):this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats | Memo: "+this.paymentDecoded.description)},error:e=>{this.logger.error(e),this.paymentDecodedHint="ERROR: "+(e.message?e.message:"string"==typeof e?e:JSON.stringify(e)),this.paymentReq.control.setErrors({decodeError:!0})}}))}sendPayment(){this.store.dispatch((0,U.oV)(this.zeroAmtInvoice&&this.paymentAmount?{payload:{invoice:this.paymentRequest,amountMsat:1e3*this.paymentAmount,fromDialog:!0}}:{payload:{invoice:this.paymentRequest,fromDialog:!0}}))}onPaymentRequestEntry(e){this.paymentRequest=e&&"string"==typeof e?e.trim():e,this.paymentError="",this.paymentDecodedHint="",this.zeroAmtInvoice=!1,this.paymentRequest&&this.paymentRequest.length>100&&(this.paymentReq.control.setErrors(null),this.zeroAmtInvoice=!1,this.dataService.decodePayment(this.paymentRequest,!0).pipe((0,W.q)(1)).subscribe({next:i=>{this.paymentDecoded=i,this.paymentDecoded.timestamp&&!this.paymentDecoded.amount?(this.paymentDecoded.amount=0,this.zeroAmtInvoice=!0,this.paymentDecodedHint="Zero Amount Invoice | Memo: "+this.paymentDecoded.description):(this.zeroAmtInvoice=!1,this.selNode&&this.selNode.fiatConversion&&this.paymentDecoded.amount?this.commonService.convertCurrency(+this.paymentDecoded.amount,l.NT.SATS,l.NT.OTHER,this.selNode.currencyUnits&&this.selNode.currencyUnits.length>2?this.selNode.currencyUnits[2]:"",this.selNode.fiatConversion).pipe((0,_.R)(this.unSubs[3])).subscribe({next:o=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats ("+o.symbol+this.decimalPipe.transform(o.OTHER?o.OTHER:0,l.Xz.OTHER)+") | Memo: "+this.paymentDecoded.description},error:o=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats | Memo: "+this.paymentDecoded.description+". Unable to convert currency."}}):this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats | Memo: "+this.paymentDecoded.description)},error:i=>{this.logger.error(i),this.paymentDecodedHint="ERROR: "+(i.message?i.message:"string"==typeof i?i:JSON.stringify(i)),this.paymentReq.control.setErrors({decodeError:!0})}}))}onAmountChange(e){delete this.paymentDecoded.amount,this.paymentDecoded.amount=e}resetData(){this.paymentDecoded={},this.paymentRequest="",this.selActiveChannel=null,this.feeLimit=null,this.selFeeLimitType=l.Vc[0],this.paymentReq.control.setErrors(null),this.paymentError="",this.paymentDecodedHint="",this.zeroAmtInvoice=!1}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(J.so),t.Y36(w.yh),t.Y36(ct.o),t.Y36(O.mQ),t.Y36(P.v),t.Y36(u.JJ),t.Y36(X.eX),t.Y36(bt.D))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-lightning-send-payments"]],viewQuery:function(e,i){if(1&e&&t.Gf(yn,5),2&e){let o;t.iGM(o=t.CRH())&&(i.paymentReq=o.first)}},decls:24,vars:7,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","8","fxFlex","5","fxLayoutAlign","center","default","","mat-button","",1,"btn-close-x","p-0",3,"mat-dialog-close"],[1,"padding-gap-x-large"],["fxLayoutAlign","space-between stretch","fxLayout","column"],["sendPaymentForm","ngForm"],["autoFocus","","matInput","","placeholder","Payment Request","name","paymentRequest","rows","4","tabindex","1","required","",3,"ngModel","ngModelChange","matTextareaAutosize"],["paymentReq","ngModel"],[4,"ngIf"],["fxFlex","100",4,"ngIf"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center",1,"mt-2"],["mat-button","","color","primary","tabindex","2","type","reset",1,"mr-1",3,"click"],["mat-button","","color","primary","tabindex","3",3,"click"],["matInput","","placeholder","Amount (Sats)","name","amount","tabindex","2","required","",3,"ngModel","ngModelChange","change"],["paymentAmt","ngModel"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"]],template:function(e,i){if(1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-header",2)(3,"div",3)(4,"span",4),t._uU(5,"Send Payment"),t.qZA()(),t.TgZ(6,"button",5),t._uU(7,"X"),t.qZA()(),t.TgZ(8,"mat-card-content",6)(9,"form",7,8)(11,"mat-form-field",1)(12,"textarea",9,10),t.NdJ("ngModelChange",function(s){return i.onPaymentRequestEntry(s)})("matTextareaAutosize",function(){return!0}),t.qZA(),t.YNc(14,vn,2,1,"mat-hint",11),t.YNc(15,Tn,2,0,"mat-error",11),t.YNc(16,Ln,2,1,"mat-error",11),t.qZA(),t.YNc(17,Sn,6,2,"mat-form-field",12),t.YNc(18,An,3,2,"div",13),t.TgZ(19,"div",14)(20,"button",15),t.NdJ("click",function(){return i.resetData()}),t._uU(21,"Clear Fields"),t.qZA(),t.TgZ(22,"button",16),t.NdJ("click",function(){return i.onSendPayment()}),t._uU(23,"Send Payment"),t.qZA()()()()()()),2&e){const o=t.MAs(13);t.xp6(6),t.Q6J("mat-dialog-close",!1),t.xp6(6),t.Q6J("ngModel",i.paymentRequest),t.xp6(2),t.Q6J("ngIf",i.paymentRequest&&""!==i.paymentDecodedHint),t.xp6(1),t.Q6J("ngIf",!i.paymentRequest),t.xp6(1),t.Q6J("ngIf",null==o.errors?null:o.errors.decodeError),t.xp6(1),t.Q6J("ngIf",i.zeroAmtInvoice),t.xp6(1),t.Q6J("ngIf",""!==i.paymentError)}},directives:[m.xw,m.yH,b.dk,m.Wh,N.lW,J.ZT,b.dn,d._Y,d.JL,d.F,y.KE,Y.Nt,d.Fj,j.h,d.Q7,d.JJ,d.On,u.O5,y.bx,y.TO,q.BN],styles:[""]}),n})();var V=f(1125);const wn=["scrollContainer"];function In(n,a){if(1&n&&(t.TgZ(0,"div",9)(1,"div",1)(2,"h4",11),t._uU(3,"Description"),t.qZA(),t.TgZ(4,"span",12),t._uU(5),t.qZA()()()),2&n){const e=t.oxw();t.xp6(5),t.Oqu(e.description)}}function Fn(n,a){1&n&&t._UZ(0,"mat-divider",14)}function qn(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mat-expansion-panel",23),t.NdJ("opened",function(){return t.CHM(e),t.oxw().onExpansionOpen(!0)})("closed",function(){return t.CHM(e),t.oxw().onExpansionOpen(!1)}),t.TgZ(1,"mat-expansion-panel-header")(2,"mat-panel-title")(3,"h4",24),t._uU(4),t.qZA(),t.TgZ(5,"h4",25),t._uU(6),t.ALo(7,"number"),t.qZA()()(),t.TgZ(8,"div",8)(9,"div",9)(10,"div",26)(11,"h4",11),t._uU(12,"Fees (mSats)"),t.qZA(),t.TgZ(13,"span",12),t._uU(14),t.ALo(15,"number"),t.qZA()(),t.TgZ(16,"div",26)(17,"h4",11),t._uU(18,"Date/Time"),t.qZA(),t.TgZ(19,"span",12),t._uU(20),t.ALo(21,"date"),t.qZA()()(),t._UZ(22,"mat-divider",14),t.TgZ(23,"div",9)(24,"div",1)(25,"h4",11),t._uU(26,"ID"),t.qZA(),t.TgZ(27,"span",27),t._uU(28),t.qZA()()(),t._UZ(29,"mat-divider",14),t.TgZ(30,"div",9)(31,"div",1)(32,"h4",11),t._uU(33,"To Channel"),t.qZA(),t.TgZ(34,"span",27),t._uU(35),t.qZA()()()()()}if(2&n){const e=a.$implicit,i=a.index,o=t.oxw();t.Q6J("expanded",o.expansionOpen),t.xp6(4),t.hij("Part ",i+1,""),t.xp6(2),t.hij("",t.lcZ(7,7,e.amount)," (Sats)"),t.xp6(8),t.Oqu(t.lcZ(15,9,e.feesPaid)),t.xp6(6),t.Oqu(t.xi3(21,11,e.timestamp,"dd/MMM/y HH:mm")),t.xp6(8),t.Oqu(e.id),t.xp6(7),t.Oqu(e.toChannelAlias)}}let Nn=(()=>{class n{constructor(e,i){this.dialogRef=e,this.data=i,this.description=null,this.shouldScroll=!0,this.expansionOpen=!0}ngOnInit(){this.payment=this.data.payment,this.data.sentPaymentInfo.length>0&&this.data.sentPaymentInfo[0].paymentRequest&&this.data.sentPaymentInfo[0].paymentRequest.description&&""!==this.data.sentPaymentInfo[0].paymentRequest.description&&(this.description=this.data.sentPaymentInfo[0].paymentRequest.description)}ngAfterViewChecked(){this.shouldScroll=this.scrollContainer.nativeElement.classList.value.includes("ps--active-y")}onScrollDown(){this.scrollContainer.nativeElement.scrollTop=this.scrollContainer.nativeElement.scrollTop+62.6}onExpansionOpen(e){this.expansionOpen=e}onClose(){this.dialogRef.close(!1)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(J.so),t.Y36(J.WI))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-payment-information"]],viewQuery:function(e,i){if(1&e&&t.Gf(wn,5),2&e){let o;t.iGM(o=t.CRH())&&(i.scrollContainer=o.first)}},decls:66,vars:15,consts:[["fxLayout","column","fxLayout.gt-sm","row","fxLayoutAlign","space-between stretch"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","3","fxFlex","5","fxLayoutAlign","center","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"h-40","padding-gap-x-large",3,"perfectScrollbar"],["scrollContainer",""],["fxLayout","column"],["fxLayout","row"],["fxFlex","30"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text"],["fxFlex","70"],[1,"w-100","my-1"],["fxLayout","row",4,"ngIf"],["class","w-100 my-1",4,"ngIf"],["class","flat-expansion-panel my-1",3,"expanded","opened","closed",4,"ngFor","ngForOf"],["fxLayout","row","fxLayoutAlign","start end",1,"btn-sticky-container","padding-gap-x-large"],["mat-mini-fab","","aria-label","Scroll Down","fxLayoutAlign","center center",3,"click"],["fxLayoutAlign","center center"],["fxLayout","row","fxLayoutAlign","end center",1,"padding-gap-x-large","padding-gap-bottom-large"],["fxLayoutAlign","center center","tabindex","1","mat-button","","color","primary","type","button","default","",1,"mr-1",3,"mat-dialog-close"],[1,"flat-expansion-panel","my-1",3,"expanded","opened","closed"],["fxFlex","30","fxLayoutAlign","start",1,"font-bold-500"],["fxFlex","70","fxLayoutAlign","start",1,"font-bold-500"],["fxFlex","50"],[1,"overflow-wrap","foreground-secondary-text"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-header",2)(3,"div",3)(4,"span",4),t._uU(5,"Payment Information"),t.qZA()(),t.TgZ(6,"button",5),t.NdJ("click",function(){return i.onClose()}),t._uU(7,"X"),t.qZA()(),t.TgZ(8,"mat-card-content",6,7)(10,"div",8)(11,"div",9)(12,"div",10)(13,"h4",11),t._uU(14,"Amount (Sats)"),t.qZA(),t.TgZ(15,"span",12),t._uU(16),t.ALo(17,"number"),t.qZA()(),t.TgZ(18,"div",13)(19,"h4",11),t._uU(20,"Date/Time"),t.qZA(),t.TgZ(21,"span",12),t._uU(22),t.ALo(23,"date"),t.qZA()()(),t._UZ(24,"mat-divider",14),t.TgZ(25,"div",9)(26,"div",1)(27,"h4",11),t._uU(28,"ID"),t.qZA(),t.TgZ(29,"span",12),t._uU(30),t.qZA()()(),t._UZ(31,"mat-divider",14),t.TgZ(32,"div",9)(33,"div",1)(34,"h4",11),t._uU(35,"Payment Hash"),t.qZA(),t.TgZ(36,"span",12),t._uU(37),t.qZA()()(),t._UZ(38,"mat-divider",14),t.TgZ(39,"div",9)(40,"div",1)(41,"h4",11),t._uU(42,"Payment Preimage"),t.qZA(),t.TgZ(43,"span",12),t._uU(44),t.qZA()()(),t._UZ(45,"mat-divider",14),t.TgZ(46,"div",9)(47,"div",1)(48,"h4",11),t._uU(49,"Recipient Node"),t.qZA(),t.TgZ(50,"span",12),t._uU(51),t.qZA()()(),t._UZ(52,"mat-divider",14),t.YNc(53,In,6,1,"div",15),t.YNc(54,Fn,1,0,"mat-divider",16),t.TgZ(55,"div",9)(56,"div",1)(57,"mat-accordion"),t.YNc(58,qn,36,14,"mat-expansion-panel",17),t.qZA()()()()(),t.TgZ(59,"div",18)(60,"button",19),t.NdJ("click",function(){return i.onScrollDown()}),t.TgZ(61,"mat-icon",20),t._uU(62,"arrow_downward"),t.qZA()()(),t.TgZ(63,"div",21)(64,"button",22),t._uU(65,"OK"),t.qZA()()()()),2&e&&(t.xp6(16),t.Oqu(t.lcZ(17,10,i.payment.recipientAmount)),t.xp6(6),t.Oqu(t.xi3(23,12,i.payment.firstPartTimestamp,"dd/MMM/y HH:mm")),t.xp6(8),t.Oqu(i.payment.id),t.xp6(7),t.Oqu(i.payment.paymentHash),t.xp6(7),t.Oqu(i.payment.paymentPreimage),t.xp6(7),t.Oqu(i.payment.recipientNodeAlias),t.xp6(2),t.Q6J("ngIf",i.description),t.xp6(1),t.Q6J("ngIf",i.description),t.xp6(4),t.Q6J("ngForOf",i.payment.parts),t.xp6(6),t.Q6J("mat-dialog-close",!1))},directives:[m.xw,m.Wh,m.yH,b.dk,N.lW,b.dn,H.$V,K.d,u.O5,V.pp,u.sg,V.ib,V.yz,V.yK,vt.Hw,J.ZT],pipes:[u.JJ,u.uU],styles:[""]}),n})();var nt=f(3093);const On=["sendPaymentForm"];function Pn(n,a){if(1&n&&(t.TgZ(0,"mat-hint"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.paymentDecodedHint)}}function Un(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Payment request is required."),t.qZA())}function Rn(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"form",4,5)(2,"mat-form-field",6)(3,"textarea",7,8),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().onPaymentRequestEntry(o)})("matTextareaAutosize",function(){return!0}),t.qZA(),t.YNc(5,Pn,2,1,"mat-hint",9),t.YNc(6,Un,2,0,"mat-error",9),t.qZA(),t.TgZ(7,"div",10)(8,"button",11),t.NdJ("click",function(){return t.CHM(e),t.oxw().resetData()}),t._uU(9,"Clear Field"),t.qZA(),t.TgZ(10,"button",12),t.NdJ("click",function(){return t.CHM(e),t.oxw().onSendPayment()}),t._uU(11,"Send Payment"),t.qZA()()()}if(2&n){const e=t.oxw();t.xp6(3),t.Q6J("ngModel",e.paymentRequest),t.xp6(2),t.Q6J("ngIf",e.paymentRequest&&""!==e.paymentDecodedHint),t.xp6(1),t.Q6J("ngIf",!e.paymentRequest)}}function kn(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",13)(1,"button",12),t.NdJ("click",function(){return t.CHM(e),t.oxw().openSendPaymentModal()}),t._uU(2,"Send Payment"),t.qZA()()}}function Dn(n,a){if(1&n&&(t.TgZ(0,"mat-option",59),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.Q6J("value",e),t.xp6(1),t.Oqu(i.getLabel(e))}}function Jn(n,a){1&n&&t._UZ(0,"mat-progress-bar",60)}function Mn(n,a){1&n&&(t.TgZ(0,"th",61),t._uU(1,"Date/Time"),t.qZA())}function Qn(n,a){if(1&n&&(t.TgZ(0,"td",62),t._uU(1),t.ALo(2,"date"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,null==e?null:e.firstPartTimestamp,"dd/MMM/y HH:mm"))}}function Yn(n,a){1&n&&(t.TgZ(0,"th",61),t._uU(1,"ID"),t.qZA())}const D=function(n){return{width:n}};function Bn(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",63)(2,"span",64),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,D,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.id)}}function Hn(n,a){1&n&&(t.TgZ(0,"th",61),t._uU(1,"Destination Node ID"),t.qZA())}function zn(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",63)(2,"span",64),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,D,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.recipientNodeId)}}function Vn(n,a){1&n&&(t.TgZ(0,"th",61),t._uU(1,"Destination"),t.qZA())}function Gn(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",63)(2,"span",64),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,D,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.recipientNodeAlias)}}function Wn(n,a){1&n&&(t.TgZ(0,"th",61),t._uU(1,"Description"),t.qZA())}function $n(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",63)(2,"span",64),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,D,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.description)}}function Xn(n,a){1&n&&(t.TgZ(0,"th",61),t._uU(1,"Payment Hash"),t.qZA())}function Kn(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",63)(2,"span",64),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,D,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.paymentHash)}}function jn(n,a){1&n&&(t.TgZ(0,"th",61),t._uU(1,"Preimage"),t.qZA())}function ti(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",63)(2,"span",64),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,D,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.paymentPreimage)}}function ei(n,a){1&n&&(t.TgZ(0,"th",65),t._uU(1,"Amount (Sats)"),t.qZA())}function ni(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"span",66),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,null==e?null:e.recipientAmount))}}function ii(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",67)(1,"div",68)(2,"mat-select",69),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",70),t.NdJ("click",function(){return t.CHM(e),t.oxw(2).onDownloadCSV()}),t._uU(5,"Download CSV"),t.qZA()()()()}}function ai(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",71)(1,"button",72),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw(2).onPaymentClick(s)}),t._uU(2,"View Info"),t.qZA()()}}function oi(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No payment available."),t.qZA())}function si(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting payments..."),t.qZA())}function li(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Oqu(e.errorMessage)}}function ri(n,a){if(1&n&&(t.TgZ(0,"td",73),t.YNc(1,oi,2,0,"p",9),t.YNc(2,si,2,0,"p",9),t.YNc(3,li,2,1,"p",9),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",(!(null!=e.payments&&e.payments.data)||(null==e.payments||null==e.payments.data?null:e.payments.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.payments&&e.payments.data)||(null==e.payments||null==e.payments.data?null:e.payments.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.payments&&e.payments.data)||(null==e.payments||null==e.payments.data?null:e.payments.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}function ci(n,a){if(1&n&&(t.TgZ(0,"span",74),t._uU(1),t.ALo(2,"date"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.timestamp,"dd/MMM/y HH:mm")," ")}}function ui(n,a){if(1&n&&(t.ynx(0),t.YNc(1,ci,3,4,"span",75),t.BQk()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function pi(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"span",74),t._uU(2),t.qZA(),t.YNc(3,ui,2,1,"ng-container",9),t.qZA()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" Total Attempts: ",(null==e||null==e.parts?null:e.parts.length)||0," "),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function mi(n,a){if(1&n&&(t.TgZ(0,"span",74)(1,"span",76)(2,"span",64),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(4);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,D,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(e.id)}}function di(n,a){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,mi,4,4,"span",75),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function hi(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",76)(2,"span",64),t._uU(3),t.qZA()(),t.YNc(4,di,2,1,"span",9),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(3,D,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.id),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function _i(n,a){if(1&n&&(t.TgZ(0,"span",74)(1,"span",76)(2,"span",64),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(4);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,D,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(e.toChannelId)}}function gi(n,a){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,_i,4,4,"span",75),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function fi(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",76)(2,"span",64),t._uU(3),t.qZA()(),t.YNc(4,gi,2,1,"span",9),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(3,D,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.recipientNodeId),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function Ci(n,a){if(1&n&&(t.TgZ(0,"span",74)(1,"span",76)(2,"span",64),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(4);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,D,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(e.toChannelAlias)}}function xi(n,a){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,Ci,4,4,"span",75),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function yi(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",76)(2,"span",64),t._uU(3),t.qZA()(),t.YNc(4,xi,2,1,"span",9),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(3,D,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.recipientNodeAlias),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function vi(n,a){if(1&n&&(t.TgZ(0,"span",77),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.amount,"1.0-0")," ")}}function Ti(n,a){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,vi,3,4,"span",78),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function Li(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"span",77),t._uU(2),t.ALo(3,"number"),t.qZA(),t.YNc(4,Ti,2,1,"span",9),t.qZA()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.xi3(3,2,null==e?null:e.recipientAmount,"1.0-0")),t.xp6(2),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function bi(n,a){if(1&n&&(t.TgZ(0,"span",74)(1,"span",76)(2,"span",64),t._uU(3),t.ALo(4,"number"),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(4);t.xp6(1),t.Q6J("ngStyle",t.VKq(5,D,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.hij("Fee Paid: ",t.xi3(4,2,e.feesPaid,"1.0-0")," (Sats)")}}function Si(n,a){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,bi,5,7,"span",75),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function Zi(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",76)(2,"span",64),t._uU(3),t.qZA()(),t.YNc(4,Si,2,1,"span",9),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(3,D,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.description),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function Ai(n,a){if(1&n&&(t.TgZ(0,"span",74)(1,"span",76)(2,"span",64),t._uU(3),t.ALo(4,"number"),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(4);t.xp6(1),t.Q6J("ngStyle",t.VKq(5,D,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.hij("Fee Paid: ",t.xi3(4,2,e.feesPaid,"1.0-0")," (Sats)")}}function Ei(n,a){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,Ai,5,7,"span",75),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function wi(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",76)(2,"span",64),t._uU(3),t.qZA()(),t.YNc(4,Ei,2,1,"span",9),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(3,D,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.paymentHash),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function Ii(n,a){if(1&n&&(t.TgZ(0,"span",74)(1,"span",76)(2,"span",64),t._uU(3),t.ALo(4,"number"),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(4);t.xp6(1),t.Q6J("ngStyle",t.VKq(5,D,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.hij("Fee Paid: ",t.xi3(4,2,e.feesPaid,"1.0-0")," (Sats)")}}function Fi(n,a){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,Ii,5,7,"span",75),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function qi(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",76)(2,"span",64),t._uU(3),t.qZA()(),t.YNc(4,Fi,2,1,"span",9),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(3,D,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.paymentPreimage),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function Ni(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",79)(1,"button",82),t.NdJ("click",function(){const s=t.CHM(e).$implicit,c=t.oxw(2).$implicit;return t.oxw(2).onPartClick(s,c)}),t._uU(2),t.qZA()()}if(2&n){const e=a.index;t.xp6(2),t.hij("View ",e+1,"")}}function Oi(n,a){if(1&n&&(t.TgZ(0,"div"),t.YNc(1,Ni,3,1,"div",81),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function Pi(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",62)(1,"span",79)(2,"button",80),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return s.is_expanded=!s.is_expanded}),t._uU(3),t.qZA()(),t.YNc(4,Oi,2,1,"div",9),t.qZA()}if(2&n){const e=a.$implicit;t.xp6(3),t.Oqu(null!=e&&e.is_expanded?"Hide":"Show"),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function Ui(n,a){1&n&&t._UZ(0,"tr",83)}const Ri=function(n){return{"display-none":n}};function ki(n,a){if(1&n&&t._UZ(0,"tr",84),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,Ri,(null==e.payments||null==e.payments.data?null:e.payments.data.length)>0))}}function Di(n,a){1&n&&t._UZ(0,"tr",85)}function Ji(n,a){1&n&&t._UZ(0,"tr",83)}const Mi=function(){return["all"]},Qi=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},Yi=function(){return["no_payment"]};function Bi(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",14)(1,"div",15)(2,"div",16),t._UZ(3,"fa-icon",17),t.TgZ(4,"span",18),t._uU(5,"Payments History"),t.qZA()(),t.TgZ(6,"div",19)(7,"mat-form-field",20)(8,"mat-select",21),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().selFilterBy=o})("selectionChange",function(){t.CHM(e);const o=t.oxw();return o.selFilter="",o.applyFilter()}),t.YNc(9,Dn,2,2,"mat-option",22),t.qZA()(),t.TgZ(10,"mat-form-field",20)(11,"input",23),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().selFilter=o})("input",function(){return t.CHM(e),t.oxw().applyFilter()})("keyup",function(){return t.CHM(e),t.oxw().applyFilter()}),t.qZA()()()(),t.TgZ(12,"div",24)(13,"div",25),t.YNc(14,Jn,1,0,"mat-progress-bar",26),t.TgZ(15,"table",27,28),t.ynx(17,29),t.YNc(18,Mn,2,0,"th",30),t.YNc(19,Qn,3,4,"td",31),t.BQk(),t.ynx(20,32),t.YNc(21,Yn,2,0,"th",30),t.YNc(22,Bn,4,4,"td",31),t.BQk(),t.ynx(23,33),t.YNc(24,Hn,2,0,"th",30),t.YNc(25,zn,4,4,"td",31),t.BQk(),t.ynx(26,34),t.YNc(27,Vn,2,0,"th",30),t.YNc(28,Gn,4,4,"td",31),t.BQk(),t.ynx(29,35),t.YNc(30,Wn,2,0,"th",30),t.YNc(31,$n,4,4,"td",31),t.BQk(),t.ynx(32,36),t.YNc(33,Xn,2,0,"th",30),t.YNc(34,Kn,4,4,"td",31),t.BQk(),t.ynx(35,37),t.YNc(36,jn,2,0,"th",30),t.YNc(37,ti,4,4,"td",31),t.BQk(),t.ynx(38,38),t.YNc(39,ei,2,0,"th",39),t.YNc(40,ni,4,3,"td",31),t.BQk(),t.ynx(41,40),t.YNc(42,ii,6,0,"th",41),t.YNc(43,ai,3,0,"td",42),t.BQk(),t.ynx(44,43),t.YNc(45,ri,4,3,"td",44),t.BQk(),t.ynx(46,45),t.YNc(47,pi,4,2,"td",31),t.BQk(),t.ynx(48,46),t.YNc(49,hi,5,5,"td",31),t.BQk(),t.ynx(50,47),t.YNc(51,fi,5,5,"td",31),t.BQk(),t.ynx(52,48),t.YNc(53,yi,5,5,"td",31),t.BQk(),t.ynx(54,49),t.YNc(55,Li,5,5,"td",31),t.BQk(),t.ynx(56,50),t.YNc(57,Zi,5,5,"td",31),t.BQk(),t.ynx(58,51),t.YNc(59,wi,5,5,"td",31),t.BQk(),t.ynx(60,52),t.YNc(61,qi,5,5,"td",31),t.BQk(),t.ynx(62,53),t.YNc(63,Pi,5,2,"td",31),t.BQk(),t.YNc(64,Ui,1,0,"tr",54),t.YNc(65,ki,1,3,"tr",55),t.YNc(66,Di,1,0,"tr",56),t.YNc(67,Ji,1,0,"tr",57),t.qZA()()(),t._UZ(68,"mat-paginator",58),t.qZA()}if(2&n){const e=t.oxw();t.xp6(3),t.Q6J("icon",e.faHistory),t.xp6(5),t.Q6J("ngModel",e.selFilterBy),t.xp6(1),t.Q6J("ngForOf",t.DdM(15,Mi).concat(e.displayedColumns.slice(0,-1))),t.xp6(2),t.Q6J("ngModel",e.selFilter),t.xp6(3),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",e.payments)("ngClass",t.VKq(16,Qi,""!==e.errorMessage)),t.xp6(49),t.Q6J("matRowDefColumns",e.partColumns)("matRowDefWhen",e.is_group),t.xp6(1),t.Q6J("matFooterRowDef",t.DdM(18,Yi)),t.xp6(1),t.Q6J("matHeaderRowDef",e.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",e.displayedColumns),t.xp6(1),t.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}let St=(()=>{class n{constructor(e,i,o,s,c,h,g,v){this.logger=e,this.commonService=i,this.store=o,this.rtlEffects=s,this.decimalPipe=c,this.dataService=h,this.datePipe=g,this.camelCaseWithSpaces=v,this.calledFrom="transactions",this.nodePageDefs=l.Xk,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="transactions",this.tableSetting={tableId:"payments",recordsPerPage:l.IV,sortBy:"firstPartTimestamp",sortOrder:l.Pi.DESCENDING},this.faHistory=L.qO$,this.newlyAddedPayment="",this.selNode={},this.information={},this.payments=new r.by([]),this.paymentJSONArr=[],this.paymentDecoded={},this.displayedColumns=[],this.partColumns=[],this.paymentRequest="",this.paymentDecodedHint="",this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.selFilter="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(C.LR).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e}),this.store.select(C.yD).pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{this.information=e}),this.store.select(C.nF).pipe((0,_.R)(this.unSubs[2])).subscribe(e=>{var i,o;this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=(null===(i=e.pageSettings.find(s=>s.pageId===this.PAGE_ID))||void 0===i?void 0:i.tables.find(s=>s.tableId===this.tableSetting.tableId))||(null===(o=l.c3.find(s=>s.pageId===this.PAGE_ID))||void 0===o?void 0:o.tables.find(s=>s.tableId===this.tableSetting.tableId)),this.displayedColumns=this.screenSize===l.cu.XS||this.screenSize===l.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.push("actions"),this.partColumns=[],this.displayedColumns.map(s=>this.partColumns.push("group_"+s)),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:l.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(C.PP).pipe((0,_.R)(this.unSubs[3])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.paymentJSONArr=e.payments&&e.payments.sent&&e.payments.sent.length>0?e.payments.sent:[],this.paymentJSONArr.length>0&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadPaymentsTable(this.paymentJSONArr),this.logger.info(e)})}ngAfterViewInit(){this.paymentJSONArr.length>0&&this.loadPaymentsTable(this.paymentJSONArr)}applyFilter(){this.payments.filter=this.selFilter.trim().toLowerCase()}getLabel(e){const i=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(o=>o.column===e);return i?i.label?i.label:this.camelCaseWithSpaces.transform(i.column,"_"):this.commonService.titleCase(e)}setFilterPredicate(){this.payments.filterPredicate=(e,i)=>{var o,s;let c="";switch(this.selFilterBy){case"all":c=(e.firstPartTimestamp?null===(o=this.datePipe.transform(new Date(e.firstPartTimestamp),"dd/MMM/y HH:mm"))||void 0===o?void 0:o.toLowerCase():"")+JSON.stringify(e).toLowerCase();break;case"firstPartTimestamp":c=(null===(s=this.datePipe.transform(new Date(e.firstPartTimestamp||0),"dd/MMM/y HH:mm"))||void 0===s?void 0:s.toLowerCase())||"";break;default:c=void 0===e[this.selFilterBy]?"":"string"==typeof e[this.selFilterBy]?e[this.selFilterBy].toLowerCase():"boolean"==typeof e[this.selFilterBy]?e[this.selFilterBy]?"yes":"no":e[this.selFilterBy].toString()}return c.includes(i)}}loadPaymentsTable(e){var i;this.payments=new r.by(e?[...e]:[]),this.payments.sort=this.sort,this.payments.sortingDataAccessor=(o,s)=>{var c,h,g,v;switch(s){case"firstPartTimestamp":return this.commonService.sortByKey(o.parts,"timestamp","number",null===(c=this.sort)||void 0===c?void 0:c.direction),o.firstPartTimestamp;case"id":return this.commonService.sortByKey(o.parts,"id","string",null===(h=this.sort)||void 0===h?void 0:h.direction),o.id;case"recipientNodeAlias":return this.commonService.sortByKey(o.parts,"toChannelAlias","string",null===(g=this.sort)||void 0===g?void 0:g.direction),o.recipientNodeAlias;case"recipientAmount":return this.commonService.sortByKey(o.parts,"amount","number",null===(v=this.sort)||void 0===v?void 0:v.direction),o.recipientAmount;default:return o[s]&&isNaN(o[s])?o[s].toLocaleLowerCase():o[s]?+o[s]:null}},null===(i=this.payments.sort)||void 0===i||i.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.payments.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter()}onSendPayment(){if(!this.paymentRequest)return!0;this.paymentDecoded.timestamp?this.sendPayment():this.dataService.decodePayment(this.paymentRequest,!1).pipe((0,W.q)(1)).subscribe(e=>{this.paymentDecoded=e,this.paymentDecoded.timestamp?(this.paymentDecoded.amount||(this.paymentDecoded.amount=0),this.sendPayment()):this.resetData()})}sendPayment(){this.newlyAddedPayment=this.paymentDecoded.paymentHash||"",this.paymentDecoded.amount&&0!==this.paymentDecoded.amount?(this.store.dispatch((0,E.c1)({payload:{data:{type:l.n_.CONFIRM,alertTitle:"Confirm Send Payment",noBtnText:"Cancel",yesBtnText:"Send Payment",message:[[{key:"paymentHash",value:this.paymentDecoded.paymentHash,title:"Payment Hash",width:100}],[{key:"nodeId",value:this.paymentDecoded.nodeId,title:"Payee",width:100}],[{key:"description",value:this.paymentDecoded.description,title:"Description",width:100}],[{key:"timestamp",value:this.paymentDecoded.timestamp,title:"Creation Date",width:50,type:l.Gi.DATE_TIME},{key:"amount",value:this.paymentDecoded.amount,title:"Amount (Sats)",width:50,type:l.Gi.NUMBER}],[{key:"expiry",value:this.paymentDecoded.expiry,title:"Expiry",width:50,type:l.Gi.NUMBER},{key:"minFinalCltvExpiry",value:this.paymentDecoded.minFinalCltvExpiry,title:"CLTV Expiry",width:50}]]}}})),this.rtlEffects.closeConfirm.pipe((0,W.q)(1)).subscribe(i=>{i&&(this.store.dispatch((0,U.oV)({payload:{invoice:this.paymentRequest,fromDialog:!1}})),this.resetData())})):(this.store.dispatch((0,E.c1)({payload:{data:{type:l.n_.CONFIRM,alertTitle:"Enter Amount and Confirm Send Payment",message:[[{key:"paymentHash",value:this.paymentDecoded.paymentHash,title:"Payment Hash",width:100}],[{key:"nodeId",value:this.paymentDecoded.nodeId,title:"Payee",width:100}],[{key:"description",value:this.paymentDecoded.description,title:"Description",width:100}],[{key:"timestamp",value:this.paymentDecoded.timestamp,title:"Creation Date",width:40,type:l.Gi.DATE_TIME},{key:"expiry",value:this.paymentDecoded.expiry,title:"Expiry",width:30,type:l.Gi.NUMBER},{key:"minFinalCltvExpiry",value:this.paymentDecoded.minFinalCltvExpiry,title:"CLTV Expiry",width:30}]],noBtnText:"Cancel",yesBtnText:"Send Payment",flgShowInput:!0,titleMessage:"It is a zero amount invoice. Enter the amount (Sats) to pay.",getInputs:[{placeholder:"Amount (Sats)",inputType:l.Gi.NUMBER,inputValue:"",width:30}]}}})),this.rtlEffects.closeConfirm.pipe((0,W.q)(1)).subscribe(o=>{o&&(this.paymentDecoded.amount=o[0].inputValue,this.store.dispatch((0,U.oV)({payload:{invoice:this.paymentRequest,amountMsat:1e3*o[0].inputValue,fromDialog:!1}})),this.resetData())}))}onPaymentRequestEntry(e){this.paymentRequest=e,this.paymentDecodedHint="",this.paymentRequest&&this.paymentRequest.length>100&&this.dataService.decodePayment(this.paymentRequest,!1).pipe((0,W.q)(1)).subscribe(i=>{this.paymentDecoded=i,this.paymentDecoded.amount?this.selNode&&this.selNode.fiatConversion?this.commonService.convertCurrency(+this.paymentDecoded.amount,l.NT.SATS,l.NT.OTHER,this.selNode.currencyUnits&&this.selNode.currencyUnits.length>2?this.selNode.currencyUnits[2]:"",this.selNode.fiatConversion).pipe((0,_.R)(this.unSubs[4])).subscribe({next:o=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats ("+o.symbol+this.decimalPipe.transform(o.OTHER?o.OTHER:0,l.Xz.OTHER)+") | Memo: "+this.paymentDecoded.description},error:o=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats | Memo: "+this.paymentDecoded.description+". Unable to convert currency."}}):this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats | Memo: "+this.paymentDecoded.description:this.paymentDecodedHint="Zero Amount Invoice | Memo: "+this.paymentDecoded.description})}openSendPaymentModal(){this.store.dispatch((0,E.qR)({payload:{data:{component:En}}}))}resetData(){this.paymentDecoded={},this.paymentRequest="",this.form.resetForm()}is_group(e,i){return i.parts&&i.parts.length>1}onPaymentClick(e){e.paymentHash&&""!==e.paymentHash.trim()?this.dataService.decodePayments(e.paymentHash).pipe((0,W.q)(1)).subscribe({next:i=>{setTimeout(()=>{this.showPaymentView(e,i.length&&i.length>0?i[0]:[])},0)},error:i=>{this.showPaymentView(e,[])}}):this.showPaymentView(e,[])}showPaymentView(e,i){this.store.dispatch((0,E.qR)({payload:{data:{sentPaymentInfo:i,payment:e,component:Nn}}}))}onPartClick(e,i){i.paymentHash&&""!==i.paymentHash.trim()?this.dataService.decodePayments(i.paymentHash).pipe((0,W.q)(1)).subscribe({next:o=>{setTimeout(()=>{this.showPartView(e,i,o.length&&o.length>0?o[0]:[])},0)},error:o=>{this.showPartView(e,i,[])}}):this.showPartView(e,i,[])}showPartView(e,i,o){const s=[[{key:"paymentHash",value:i.paymentHash,title:"Payment Hash",width:100,type:l.Gi.STRING}],[{key:"paymentPreimage",value:i.paymentPreimage,title:"Payment Preimage",width:100,type:l.Gi.STRING}],[{key:"toChannelId",value:e.toChannelId,title:"Channel",width:100,type:l.Gi.STRING}],[{key:"id",value:e.id,title:"Part ID",width:50,type:l.Gi.STRING},{key:"timestamp",value:e.timestamp,title:"Time",width:50,type:l.Gi.DATE_TIME}],[{key:"amount",value:e.amount,title:"Amount (Sats)",width:50,type:l.Gi.NUMBER},{key:"feesPaid",value:e.feesPaid,title:"Fee (Sats)",width:50,type:l.Gi.NUMBER}]];o&&o.length>0&&o[0].paymentRequest&&o[0].paymentRequest.description&&""!==o[0].paymentRequest.description&&s.splice(3,0,[{key:"description",value:o[0].paymentRequest.description,title:"Description",width:100,type:l.Gi.STRING}]),this.store.dispatch((0,E.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:"Payment Part Information",message:s}}}))}onDownloadCSV(){if(this.payments.data&&this.payments.data.length>0){const e=JSON.parse(JSON.stringify(this.payments.data)),i=null==e?void 0:e.reduce((o,s)=>(s.paymentHash&&""!==s.paymentHash.trim()&&(o=""===o?s.paymentHash:o+","+s.paymentHash),o),"");this.dataService.decodePayments(i).pipe((0,_.R)(this.unSubs[5])).subscribe(o=>{o.forEach((c,h)=>{c.length>0&&c[0].paymentRequest&&c[0].paymentRequest.description&&""!==c[0].paymentRequest.description&&(e[h].description=c[0].paymentRequest.description)});const s=null==e?void 0:e.reduce((c,h)=>c.concat(h),[]);this.commonService.downloadFile(s,"Payments")})}}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(O.mQ),t.Y36(P.v),t.Y36(w.yh),t.Y36(nt.V),t.Y36(u.JJ),t.Y36(bt.D),t.Y36(u.uU),t.Y36(G.i1))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-lightning-payments"]],viewQuery:function(e,i){if(1&e&&(t.Gf(On,5),t.Gf(S.YE,5),t.Gf(A.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.form=o.first),t.iGM(o=t.CRH())&&(i.sort=o.first),t.iGM(o=t.CRH())&&(i.paginator=o.first)}},inputs:{calledFrom:"calledFrom"},features:[t._Bn([{provide:A.ye,useValue:(0,l.pt)("Payments")}])],decls:4,vars:3,consts:[["fxLayout","column","fxFlex","colWidth","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap",4,"ngIf"],["fxLayout","row",4,"ngIf"],["fxLayout","column","fxLayoutAlign","start stretch",4,"ngIf"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap"],["sendPaymentForm","ngForm"],["fxFlex","colWidth"],["matInput","","placeholder","Payment Request","name","paymentRequest","tabindex","1","required","",3,"perfectScrollbar","ngModel","ngModelChange","matTextareaAutosize"],["paymentReq","ngModel"],[4,"ngIf"],["fxLayout","row",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","2","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","3",3,"click"],["fxLayout","row"],["fxLayout","column","fxLayoutAlign","start stretch"],["fxLayout","column","fxLayoutAlign","start stretch","fxLayout.gt-sm","row wrap",1,"page-sub-title-container","mt-1"],["fxFlex","70","fxLayoutAlign","start start","fxLayoutAlign.gt-sm","start center"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxFlex","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxFlex","49"],["placeholder","Filter By","tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","row","fxLayoutAlign","start start"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","colWidth",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","colWidth","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","firstPartTimestamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","id"],["matColumnDef","recipientNodeId"],["matColumnDef","recipientNodeAlias"],["matColumnDef","description"],["matColumnDef","paymentHash"],["matColumnDef","paymentPreimage"],["matColumnDef","recipientAmount"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_payment"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["matColumnDef","group_firstPartTimestamp"],["matColumnDef","group_id"],["matColumnDef","group_recipientNodeId"],["matColumnDef","group_recipientNodeAlias"],["matColumnDef","group_recipientAmount"],["matColumnDef","group_description"],["matColumnDef","group_paymentHash"],["matColumnDef","group_paymentPreimage"],["matColumnDef","group_actions"],["mat-row","",4,"matRowDef","matRowDefColumns","matRowDefWhen"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","4",1,"table-actions-button",3,"click"],["mat-footer-cell","","colspan","4"],["fxLayoutAlign","start center",1,"part-row-span"],["fxLayoutAlign","start center","class","part-row-span",4,"ngFor","ngForOf"],["fxLayoutAlign","start center",1,"ellipsis-parent","part-row-span",3,"ngStyle"],["fxLayoutAlign","end center",1,"part-row-span"],["fxLayoutAlign","end center","class","part-row-span",4,"ngFor","ngForOf"],["fxLayoutAlign","end start"],["mat-flat-button","","color","primary","type","button","tabindex","5",1,"btn-part-expand",3,"click"],["fxLayoutAlign","end start",4,"ngFor","ngForOf"],["mat-stroked-button","","color","primary","type","button","tabindex","6",1,"btn-part-info",3,"click"],["mat-row",""],["mat-footer-row","",3,"ngClass"],["mat-header-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.YNc(1,Rn,12,3,"form",1),t.YNc(2,kn,3,0,"div",2),t.YNc(3,Bi,69,19,"div",3),t.qZA()),2&e&&(t.xp6(1),t.Q6J("ngIf","home"===i.calledFrom),t.xp6(1),t.Q6J("ngIf","transactions"===i.calledFrom),t.xp6(1),t.Q6J("ngIf","transactions"===i.calledFrom))},directives:[m.xw,m.yH,m.Wh,u.O5,d._Y,d.JL,d.F,y.KE,Y.Nt,d.Fj,d.Q7,H.$V,d.JJ,d.On,y.bx,y.TO,N.lW,q.BN,k.gD,u.sg,z.ey,M.pW,r.BZ,S.YE,u.mk,Z.oO,r.w1,r.fO,r.ge,S.nU,r.Dz,r.ev,u.PC,Z.Zl,k.$L,r.mD,r.yh,r.nj,r.Gk,r.Ke,r.Q2,r.as,r.XQ,A.NW],pipes:[u.uU,u.JJ],styles:[".mat-column-group_actions[_ngcontent-%COMP%]{min-height:4.8rem}.mat-column-group_actions[_ngcontent-%COMP%] .btn-part-expand[_ngcontent-%COMP%]{min-width:10rem;width:10rem}.mat-column-group_actions[_ngcontent-%COMP%] .btn-part-info[_ngcontent-%COMP%]{margin-top:.5rem;min-width:9rem;width:9rem}.mat-column-group_firstPartTimestamp[_ngcontent-%COMP%] .part-row-span[_ngcontent-%COMP%]:not(:first-of-type){padding-left:3rem}.part-row-span[_ngcontent-%COMP%]{min-height:4.2rem;place-content:center flex-start;align-items:center}.mat-column-group_firstPartTimestamp[_ngcontent-%COMP%]{min-width:17rem}"]}),n})();function Hi(n,a){if(1&n&&(t.TgZ(0,"button",26)(1,"mat-icon"),t._uU(2,"more_vert"),t.qZA()()),2&n){t.oxw();const e=t.MAs(11);t.Q6J("matMenuTriggerFor",e)}}function zi(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",27),t.NdJ("click",function(){const s=t.CHM(e).index,c=t.oxw().$implicit;return t.oxw(2).onNavigateTo(c.links[s])}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit;t.xp6(1),t.Oqu(e)}}function Vi(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",27),t.NdJ("click",function(){return t.CHM(e),t.oxw(3).onsortChannelsBy()}),t._uU(1),t.qZA()}if(2&n){const e=t.oxw(3);t.xp6(1),t.hij("Sort By ","Balance Score"===e.sortField?"Capacity":"Balance Score","")}}function Gi(n,a){1&n&&t._UZ(0,"mat-progress-bar",28)}function Wi(n,a){if(1&n&&t._UZ(0,"rtl-ecl-node-info",29),2&n){const e=t.oxw(3);t.Q6J("information",e.information)("showColorFieldSeparately",!1)}}function $i(n,a){if(1&n&&t._UZ(0,"rtl-ecl-balances-info",30),2&n){const e=t.oxw(3);t.Q6J("balances",e.balances)("errorMessage",e.errorMessages[2]+" "+e.errorMessages[3])}}function Xi(n,a){if(1&n&&t._UZ(0,"rtl-ecl-channel-capacity-info",31),2&n){const e=t.oxw(3);t.Q6J("sortBy",e.sortField)("channelBalances",e.channelBalances)("allChannels",e.allChannelsCapacity)("errorMessage",e.errorMessages[2])}}function Ki(n,a){if(1&n&&t._UZ(0,"rtl-ecl-fee-info",32),2&n){const e=t.oxw(3);t.Q6J("fees",e.fees)("errorMessage",e.errorMessages[1])}}function ji(n,a){if(1&n&&t._UZ(0,"rtl-ecl-channel-status-info",33),2&n){const e=t.oxw(3);t.Q6J("channelsStatus",e.channelsStatus)("errorMessage",e.errorMessages[2])}}function ta(n,a){1&n&&(t.TgZ(0,"h3"),t._uU(1,"Error! Unable to find information!"),t.qZA())}const Zt=function(n){return{"dashboard-card-content":!0,"error-border":n}};function ea(n,a){if(1&n&&(t.TgZ(0,"mat-grid-tile",8)(1,"mat-card",9)(2,"mat-card-header")(3,"mat-card-title",10)(4,"div"),t._UZ(5,"fa-icon",11),t.TgZ(6,"span"),t._uU(7),t.qZA()(),t.TgZ(8,"div"),t.YNc(9,Hi,3,1,"button",12),t.TgZ(10,"mat-menu",13,14),t.YNc(12,zi,2,1,"button",15),t.YNc(13,Vi,2,1,"button",16),t.qZA()()()(),t.TgZ(14,"mat-card-content",17),t.YNc(15,Gi,1,0,"mat-progress-bar",18),t.TgZ(16,"div",19),t.YNc(17,Wi,1,2,"rtl-ecl-node-info",20),t.YNc(18,$i,1,2,"rtl-ecl-balances-info",21),t.YNc(19,Xi,1,4,"rtl-ecl-channel-capacity-info",22),t.YNc(20,Ki,1,2,"rtl-ecl-fee-info",23),t.YNc(21,ji,1,2,"rtl-ecl-channel-status-info",24),t.YNc(22,ta,2,0,"h3",25),t.qZA()()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.Q6J("colspan",e.cols)("rowspan",e.rows),t.xp6(5),t.Q6J("icon",e.icon),t.xp6(2),t.Oqu(e.title),t.xp6(2),t.Q6J("ngIf",e.links[0]),t.xp6(3),t.Q6J("ngForOf",e.goToOptions),t.xp6(1),t.Q6J("ngIf","capacity"===e.id),t.xp6(1),t.s9C("fxFlex","capacity"===e.id?90:70),t.Q6J("ngClass",t.VKq(16,Zt,"node"===e.id&&i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.ERROR||"balance"===e.id&&(i.apiCallStatusAllChannels.status===i.apiCallStatusEnum.ERROR||i.apiCallStatusOCBal.status===i.apiCallStatusEnum.ERROR)||("capacity"===e.id||"status"===e.id)&&i.apiCallStatusAllChannels.status===i.apiCallStatusEnum.ERROR||"fee"===e.id&&i.apiCallStatusFees.status===i.apiCallStatusEnum.ERROR)),t.xp6(1),t.Q6J("ngIf","node"===e.id&&i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.INITIATED||"balance"===e.id&&(i.apiCallStatusAllChannels.status===i.apiCallStatusEnum.INITIATED||i.apiCallStatusOCBal.status===i.apiCallStatusEnum.INITIATED)||("capacity"===e.id||"status"===e.id)&&i.apiCallStatusAllChannels.status===i.apiCallStatusEnum.INITIATED||"fee"===e.id&&i.apiCallStatusFees.status===i.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngSwitch",e.id),t.xp6(1),t.Q6J("ngSwitchCase","node"),t.xp6(1),t.Q6J("ngSwitchCase","balance"),t.xp6(1),t.Q6J("ngSwitchCase","capacity"),t.xp6(1),t.Q6J("ngSwitchCase","fee"),t.xp6(1),t.Q6J("ngSwitchCase","status")}}function na(n,a){if(1&n&&(t.TgZ(0,"div",2)(1,"div",3),t._UZ(2,"fa-icon",4),t.TgZ(3,"span",5),t._uU(4),t.qZA()(),t.TgZ(5,"mat-grid-list",6),t.YNc(6,ea,23,18,"mat-grid-tile",7),t.qZA()()),2&n){const e=t.oxw();t.xp6(2),t.Q6J("icon",e.apiCallStatusNodeInfo.status===e.apiCallStatusEnum.ERROR?e.faFrown:e.faSmile),t.xp6(2),t.Oqu(e.apiCallStatusNodeInfo.status===e.apiCallStatusEnum.COMPLETED?"Welcome "+e.information.alias+"! Your node is up and running.":e.apiCallStatusNodeInfo.status===e.apiCallStatusEnum.INITIATED?"Wait! Getting your node information...":"Error! Please check the server connection."),t.xp6(1),t.Q6J("rowHeight",e.operatorCardHeight),t.xp6(1),t.Q6J("ngForOf",e.operatorCards)}}function ia(n,a){if(1&n&&(t.TgZ(0,"button",26)(1,"mat-icon"),t._uU(2,"more_vert"),t.qZA()()),2&n){t.oxw();const e=t.MAs(9);t.Q6J("matMenuTriggerFor",e)}}function aa(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",27),t.NdJ("click",function(){const s=t.CHM(e).index,c=t.oxw(2).$implicit;return t.oxw(2).onNavigateTo(c.links[s])}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit;t.xp6(1),t.Oqu(e)}}function oa(n,a){if(1&n&&(t.TgZ(0,"mat-card-header")(1,"mat-card-title",10)(2,"div"),t._UZ(3,"fa-icon",11),t.TgZ(4,"span"),t._uU(5),t.qZA()(),t.TgZ(6,"div"),t.YNc(7,ia,3,1,"button",12),t.TgZ(8,"mat-menu",13,42),t.YNc(10,aa,2,1,"button",15),t.qZA()()()()),2&n){const e=t.oxw().$implicit;t.xp6(3),t.Q6J("icon",e.icon),t.xp6(2),t.Oqu(e.title),t.xp6(2),t.Q6J("ngIf",e.links[0]),t.xp6(3),t.Q6J("ngForOf",e.goToOptions)}}function sa(n,a){1&n&&t._UZ(0,"mat-progress-bar",28)}function la(n,a){if(1&n&&t._UZ(0,"rtl-ecl-node-info",43),2&n){const e=t.oxw(3);t.Q6J("information",e.information)}}function ra(n,a){if(1&n&&t._UZ(0,"rtl-ecl-balances-info",30),2&n){const e=t.oxw(3);t.Q6J("balances",e.balances)("errorMessage",e.errorMessages[2]+" "+e.errorMessages[3])}}function ca(n,a){if(1&n&&t._UZ(0,"rtl-ecl-channel-liquidity-info",44),2&n){const e=t.oxw(3);t.Q6J("direction","In")("totalLiquidity",e.totalInboundLiquidity)("allChannels",e.allInboundChannels)("errorMessage",e.errorMessages[2])}}function ua(n,a){if(1&n&&t._UZ(0,"rtl-ecl-channel-liquidity-info",44),2&n){const e=t.oxw(3);t.Q6J("direction","Out")("totalLiquidity",e.totalOutboundLiquidity)("allChannels",e.allOutboundChannels)("errorMessage",e.errorMessages[2])}}function pa(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",27),t.NdJ("click",function(){const s=t.CHM(e).index,c=t.oxw(3).$implicit;return t.oxw(2).onNavigateTo(c.links[s])}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit;t.xp6(1),t.Oqu(e)}}function ma(n,a){if(1&n&&(t.TgZ(0,"button",26)(1,"mat-icon"),t._uU(2,"more_vert"),t.qZA()(),t.TgZ(3,"mat-menu",13,53),t.YNc(5,pa,2,1,"button",15),t.qZA()),2&n){const e=t.MAs(4),i=t.oxw(2).$implicit;t.Q6J("matMenuTriggerFor",e),t.xp6(5),t.Q6J("ngForOf",i.goToOptions)}}function da(n,a){1&n&&(t.TgZ(0,"span",45)(1,"mat-tab-group",46)(2,"mat-tab",47),t._UZ(3,"rtl-ecl-lightning-invoices",48),t.qZA(),t.TgZ(4,"mat-tab",49),t._UZ(5,"rtl-ecl-lightning-payments",50),t.qZA(),t.TgZ(6,"mat-tab",51),t.YNc(7,ma,6,2,"ng-template",52),t.qZA()()()),2&n&&(t.xp6(3),t.Q6J("calledFrom","home"),t.xp6(2),t.Q6J("calledFrom","home"),t.xp6(1),t.Q6J("disabled",!0))}function ha(n,a){1&n&&(t.TgZ(0,"h3"),t._uU(1,"Error! Unable to find information!"),t.qZA())}const _a=function(n){return{"p-0":n}};function ga(n,a){if(1&n&&(t.TgZ(0,"mat-grid-tile",8)(1,"mat-card",36),t.YNc(2,oa,11,4,"mat-card-header",37),t.TgZ(3,"mat-card-content",38),t.YNc(4,sa,1,0,"mat-progress-bar",18),t.TgZ(5,"div",19),t.YNc(6,la,1,1,"rtl-ecl-node-info",39),t.YNc(7,ra,1,2,"rtl-ecl-balances-info",21),t.YNc(8,ca,1,4,"rtl-ecl-channel-liquidity-info",40),t.YNc(9,ua,1,4,"rtl-ecl-channel-liquidity-info",40),t.YNc(10,da,8,3,"span",41),t.YNc(11,ha,2,0,"h3",25),t.qZA()()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.Q6J("colspan",e.cols)("rowspan",e.rows),t.xp6(1),t.Q6J("ngClass",t.VKq(13,_a,"transactions"===e.id)),t.xp6(1),t.Q6J("ngIf","transactions"!==e.id),t.xp6(1),t.s9C("fxFlex","transactions"===e.id?100:"balance"===e.id?70:90),t.Q6J("ngClass",t.VKq(15,Zt,"node"===e.id&&i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.ERROR||"balance"===e.id&&(i.apiCallStatusAllChannels.status===i.apiCallStatusEnum.ERROR||i.apiCallStatusOCBal.status===i.apiCallStatusEnum.ERROR)||("inboundLiq"===e.id||"outboundLiq"===e.id)&&i.apiCallStatusAllChannels.status===i.apiCallStatusEnum.ERROR)),t.xp6(1),t.Q6J("ngIf","node"===e.id&&i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.INITIATED||"balance"===e.id&&(i.apiCallStatusAllChannels.status===i.apiCallStatusEnum.INITIATED||i.apiCallStatusOCBal.status===i.apiCallStatusEnum.INITIATED)||("inboundLiq"===e.id||"outboundLiq"===e.id)&&i.apiCallStatusAllChannels.status===i.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngSwitch",e.id),t.xp6(1),t.Q6J("ngSwitchCase","node"),t.xp6(1),t.Q6J("ngSwitchCase","balance"),t.xp6(1),t.Q6J("ngSwitchCase","inboundLiq"),t.xp6(1),t.Q6J("ngSwitchCase","outboundLiq"),t.xp6(1),t.Q6J("ngSwitchCase","transactions")}}function fa(n,a){if(1&n&&(t.TgZ(0,"div",34),t._UZ(1,"fa-icon",4),t.TgZ(2,"span",5),t._uU(3),t.qZA()(),t.TgZ(4,"mat-grid-list",35),t.YNc(5,ga,12,17,"mat-grid-tile",7),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faSmile),t.xp6(2),t.hij("Welcome ",e.information.alias,"! Your node is up and running."),t.xp6(1),t.Q6J("rowHeight",e.merchantCardHeight),t.xp6(1),t.Q6J("ngForOf",e.merchantCards)}}let Ca=(()=>{class n{constructor(e,i,o,s){this.logger=e,this.store=i,this.commonService=o,this.router=s,this.faSmile=xt.ctA,this.faFrown=xt.KfU,this.faAngleDoubleDown=L.Sbq,this.faAngleDoubleUp=L.Vfw,this.faChartPie=L.OS1,this.faBolt=L.BDt,this.faServer=L.xf3,this.faNetworkWired=L.kXW,this.userPersonaEnum=l.ol,this.channelBalances={localBalance:0,remoteBalance:0,balancedness:0},this.selNode={},this.information={},this.channels=[],this.onchainBalance={},this.balances={onchain:-1,lightning:-1,total:0},this.channelsStatus={},this.allChannelsCapacity=[],this.allInboundChannels=[],this.allOutboundChannels=[],this.totalInboundLiquidity=0,this.totalOutboundLiquidity=0,this.operatorCards=[],this.merchantCards=[],this.screenSize="",this.operatorCardHeight="405px",this.merchantCardHeight="65px",this.sortField="Balance Score",this.errorMessages=["","","",""],this.apiCallStatusNodeInfo={status:l.Bn.COMPLETED},this.apiCallStatusFees={status:l.Bn.COMPLETED},this.apiCallStatusOCBal={status:l.Bn.COMPLETED},this.apiCallStatusAllChannels={status:l.Bn.COMPLETED},this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===l.cu.XS?(this.operatorCards=[{id:"node",goToOptions:[],links:[],icon:this.faServer,title:"Node Information",cols:10,rows:1},{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:10,rows:1},{id:"fee",goToOptions:["Routing","Fees Summary"],links:["routing","reports"],icon:this.faBolt,title:"Routing Fee",cols:10,rows:1},{id:"status",goToOptions:["Channels","Inactive Channels"],links:["connections","connections/channels/inactive"],icon:this.faNetworkWired,title:"Channels",cols:10,rows:1},{id:"capacity",goToOptions:["Channels"],links:["connections"],icon:this.faNetworkWired,title:"Channels Capacity",cols:10,rows:2}],this.merchantCards=[{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:6,rows:4},{id:"transactions",goToOptions:["Transactions","Transactions Summary"],links:["transactions","reports/transactions"],title:"",cols:6,rows:4},{id:"inboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:6,rows:8},{id:"outboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:6,rows:8}]):this.screenSize===l.cu.SM||this.screenSize===l.cu.MD?(this.operatorCards=[{id:"node",goToOptions:[],links:[],icon:this.faServer,title:"Node Information",cols:5,rows:1},{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:5,rows:1},{id:"fee",goToOptions:["Routing","Fees Summary"],links:["routing","reports"],icon:this.faBolt,title:"Routing Fee",cols:5,rows:1},{id:"status",goToOptions:["Channels","Inactive Channels"],links:["connections","connections/channels/inactive"],icon:this.faNetworkWired,title:"Channels",cols:5,rows:1},{id:"capacity",goToOptions:["Channels"],links:["connections"],icon:this.faNetworkWired,title:"Channels Capacity",cols:10,rows:2}],this.merchantCards=[{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:3,rows:4},{id:"transactions",goToOptions:["Transactions","Transactions Summary"],links:["transactions","reports/transactions"],title:"",cols:3,rows:4},{id:"inboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:3,rows:8},{id:"outboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:3,rows:8}]):(this.operatorCards=[{id:"node",goToOptions:[],links:[],icon:this.faServer,title:"Node Information",cols:3,rows:1},{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:3,rows:1},{id:"capacity",goToOptions:["Channels"],links:["connections"],icon:this.faNetworkWired,title:"Channels Capacity",cols:4,rows:2},{id:"fee",goToOptions:["Routing","Fees Summary"],links:["routing","reports"],icon:this.faBolt,title:"Routing Fee",cols:3,rows:1},{id:"status",goToOptions:["Channels","Inactive Channels"],links:["connections","connections/channels/inactive"],icon:this.faNetworkWired,title:"Channels",cols:3,rows:1}],this.merchantCards=[{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:2,rows:5},{id:"inboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:2,rows:10},{id:"outboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:2,rows:10},{id:"transactions",goToOptions:["Transactions","Transactions Summary"],links:["transactions","reports/transactions"],title:"",cols:2,rows:5}])}ngOnInit(){this.store.select(C.LR).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e}),this.store.select(C.T$).pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{this.errorMessages[0]="",this.apiCallStatusNodeInfo=e.apiCallStatus,this.apiCallStatusNodeInfo.status===l.Bn.ERROR&&(this.errorMessages[0]="object"==typeof this.apiCallStatusNodeInfo.message?JSON.stringify(this.apiCallStatusNodeInfo.message):this.apiCallStatusNodeInfo.message?this.apiCallStatusNodeInfo.message:""),this.information=e.information}),this.store.select(C.JG).pipe((0,_.R)(this.unSubs[2])).subscribe(e=>{this.errorMessages[1]="",this.apiCallStatusFees=e.apiCallStatus,this.apiCallStatusFees.status===l.Bn.ERROR&&(this.errorMessages[1]="object"==typeof this.apiCallStatusFees.message?JSON.stringify(this.apiCallStatusFees.message):this.apiCallStatusFees.message?this.apiCallStatusFees.message:""),this.fees=e.fees}),this.store.select(C.Xz).pipe((0,_.R)(this.unSubs[3]),(0,ot.M)(this.store.select(C.kY))).subscribe(([e,i])=>{var o,s;this.errorMessages[2]="",this.errorMessages[3]="",this.apiCallStatusAllChannels=e.apiCallStatus,this.apiCallStatusOCBal=i.apiCallStatus,this.apiCallStatusAllChannels.status===l.Bn.ERROR&&(this.errorMessages[2]="object"==typeof this.apiCallStatusAllChannels.message?JSON.stringify(this.apiCallStatusAllChannels.message):this.apiCallStatusAllChannels.message?this.apiCallStatusAllChannels.message:""),this.apiCallStatusOCBal.status===l.Bn.ERROR&&(this.errorMessages[3]="object"==typeof this.apiCallStatusOCBal.message?JSON.stringify(this.apiCallStatusOCBal.message):this.apiCallStatusOCBal.message?this.apiCallStatusOCBal.message:""),this.channels=e.activeChannels,this.onchainBalance=i.onchainBalance,this.balances.onchain=this.onchainBalance.total||0,this.balances.lightning=e.lightningBalance.localBalance,this.balances.total=this.balances.lightning+this.balances.onchain,this.balances=Object.assign({},this.balances);const c=e.lightningBalance.localBalance?+e.lightningBalance.localBalance:0,h=e.lightningBalance.remoteBalance?+e.lightningBalance.remoteBalance:0;this.channelBalances={localBalance:c,remoteBalance:h,balancedness:+(1-Math.abs((c-h)/(c+h))).toFixed(3)},this.channelsStatus=e.channelsStatus,this.totalInboundLiquidity=0,this.totalOutboundLiquidity=0,this.allChannelsCapacity=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.channels,"balancedness"))),this.allInboundChannels=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(null===(o=this.channels)||void 0===o?void 0:o.filter(v=>(v.toRemote||0)>0),"toRemote"))),this.allOutboundChannels=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(null===(s=this.channels)||void 0===s?void 0:s.filter(v=>(v.toLocal||0)>0),"toLocal"))),this.channels.forEach(v=>{this.totalInboundLiquidity=this.totalInboundLiquidity+Math.ceil(v.toRemote||0),this.totalOutboundLiquidity=this.totalOutboundLiquidity+Math.floor(v.toLocal||0)}),this.logger.info(e)})}onNavigateTo(e){this.router.navigateByUrl("/ecl/"+e)}onsortChannelsBy(){"Balance Score"===this.sortField?(this.sortField="Capacity",this.allChannelsCapacity=this.channels.sort((e,i)=>{const o=+(e.toLocal||0)+ +(e.toRemote||0),s=+(i.toLocal||0)+ +(i.toRemote||0);return o>s?-1:o<s?1:0})):(this.sortField="Balance Score",this.allChannelsCapacity=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.channels,"balancedness"))))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(O.mQ),t.Y36(w.yh),t.Y36(P.v),t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-home"]],decls:3,vars:2,consts:[["fxLayout","column",4,"ngIf","ngIfElse"],["merchantDashboard",""],["fxLayout","column"],["fxLayout","row","fxLayoutAlign","start start",1,"page-title-container","mb-2"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["cols","10","gutterSize","20px",3,"rowHeight"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",3,"colspan","rowspan",4,"ngFor","ngForOf"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",3,"colspan","rowspan"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",1,"h-100","dashboard-card"],["fxLayoutAlign","space-between center"],[1,"mr-1",3,"icon"],["mat-icon-button","","class","more-button","aria-label","Toggle menu",3,"matMenuTriggerFor",4,"ngIf"],["xPosition","before",1,"dashboard-vert-menu"],["menuOperator","matMenu"],["mat-menu-item","",3,"click",4,"ngFor","ngForOf"],["mat-menu-item","",3,"click",4,"ngIf"],["fxLayout","column",3,"fxFlex","ngClass"],["mode","indeterminate",4,"ngIf"],["fxLayout","column","fxFlex","100",3,"ngSwitch"],["fxFlex","100",3,"information","showColorFieldSeparately",4,"ngSwitchCase"],["fxFlex","100",3,"balances","errorMessage",4,"ngSwitchCase"],["fxFlex","100",3,"sortBy","channelBalances","allChannels","errorMessage",4,"ngSwitchCase"],["fxFlex","100",3,"fees","errorMessage",4,"ngSwitchCase"],["fxFlex","100",3,"channelsStatus","errorMessage",4,"ngSwitchCase"],[4,"ngSwitchDefault"],["mat-icon-button","","aria-label","Toggle menu",1,"more-button",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click"],["mode","indeterminate"],["fxFlex","100",3,"information","showColorFieldSeparately"],["fxFlex","100",3,"balances","errorMessage"],["fxFlex","100",3,"sortBy","channelBalances","allChannels","errorMessage"],["fxFlex","100",3,"fees","errorMessage"],["fxFlex","100",3,"channelsStatus","errorMessage"],["fxLayout","row","fxLayoutAlign","start end",1,"page-title-container","mb-2"],["cols","6","gutterSize","20px",3,"rowHeight"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",1,"h-100","dashboard-card",3,"ngClass"],[4,"ngIf"],["fxLayout","column","fxLayoutAlign","start stretch",3,"fxFlex","ngClass"],["fxFlex","100",3,"information",4,"ngSwitchCase"],["fxFlex","100",3,"direction","totalLiquidity","allChannels","errorMessage",4,"ngSwitchCase"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between start",4,"ngSwitchCase"],["menuMerchant","matMenu"],["fxFlex","100",3,"information"],["fxFlex","100",3,"direction","totalLiquidity","allChannels","errorMessage"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between start"],["fxLayout","column",1,"w-100","dashboard-tabs-group"],["label","Receive"],[1,"h-100",3,"calledFrom"],["label","Pay"],[3,"calledFrom"],[3,"disabled"],["mat-tab-label",""],["menuTransactions","matMenu"]],template:function(e,i){if(1&e&&(t.YNc(0,na,7,4,"div",0),t.YNc(1,fa,6,4,"ng-template",null,1,t.W1O)),2&e){const o=t.MAs(2);t.Q6J("ngIf",(null==i.selNode?null:i.selNode.userPersona)===i.userPersonaEnum.OPERATOR)("ngIfElse",o)}},directives:[u.O5,m.xw,m.Wh,q.BN,yt.Il,u.sg,yt.DX,m.yH,b.a8,b.dk,b.n5,N.lW,st.p6,vt.Hw,st.VK,st.OP,b.dn,u.mk,Z.oO,M.pW,u.RF,u.n9,Wt,Kt,se,ce,me,u.ED,Ze,R.SP,R.uX,Lt,St,R.uD],styles:[""]}),n})();var xa=f(8377);const ya=["form"];function va(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Bitcoin address is required."),t.qZA())}function Ta(n,a){if(1&n&&(t.TgZ(0,"mat-error"),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Oqu(e.amountError)}}function La(n,a){if(1&n&&(t.TgZ(0,"mat-option",29),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.Q6J("value",e),t.xp6(1),t.Oqu(e)}}function ba(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Target Confirmation Blocks is required."),t.qZA())}function Sa(n,a){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.sendFundError)}}function Za(n,a){if(1&n&&(t.TgZ(0,"div",30),t._UZ(1,"fa-icon",31),t.YNc(2,Sa,2,1,"span",12),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faExclamationTriangle),t.xp6(1),t.Q6J("ngIf",""!==e.sendFundError)}}let At=(()=>{class n{constructor(e,i,o,s,c,h){this.dialogRef=e,this.logger=i,this.store=o,this.commonService=s,this.decimalPipe=c,this.actions=h,this.faExclamationTriangle=L.eHv,this.selNode={},this.addressTypes=[],this.selectedAddress=l._t[1],this.blockchainBalance={},this.information={},this.newAddress="",this.transaction={},this.sendFundError="",this.fiatConversion=!1,this.amountUnits=l.uA,this.selAmountUnit=l.uA[0],this.currConvertorRate={},this.unitConversionValue=0,this.currencyUnitFormats=l.Xz,this.amountError="Amount is Required.",this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.store.select(xa.dT).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{this.fiatConversion=e.settings.fiatConversion,this.amountUnits=e.settings.currencyUnits,this.logger.info(e)}),this.actions.pipe((0,_.R)(this.unSubs[1]),(0,Q.h)(e=>e.type===l.lr.UPDATE_API_CALL_STATUS_ECL||e.type===l.lr.SEND_ONCHAIN_FUNDS_RES_ECL)).subscribe(e=>{e.type===l.lr.SEND_ONCHAIN_FUNDS_RES_ECL&&(this.store.dispatch((0,E.jW)({payload:"Fund Sent Successfully!"})),this.dialogRef.close()),e.type===l.lr.UPDATE_API_CALL_STATUS_ECL&&e.payload.status===l.Bn.ERROR&&"SendOnchainFunds"===e.payload.action&&(this.sendFundError=e.payload.message)})}onSendFunds(){if(this.invalidValues)return!0;this.sendFundError="",this.transaction.amount&&this.selAmountUnit!==l.NT.SATS?this.commonService.convertCurrency(this.transaction.amount,this.selAmountUnit===this.amountUnits[2]?l.NT.OTHER:this.selAmountUnit,l.NT.SATS,this.amountUnits[2],this.fiatConversion).pipe((0,_.R)(this.unSubs[2])).subscribe({next:e=>{this.transaction.amount=parseInt(e[l.NT.SATS]),this.selAmountUnit=l.NT.SATS,this.store.dispatch((0,U.Iy)({payload:this.transaction}))},error:e=>{this.selAmountUnit=l.NT.SATS,this.amountError="Conversion Error: "+e}}):this.store.dispatch((0,U.Iy)({payload:this.transaction}))}get invalidValues(){return!this.transaction.address||""===this.transaction.address||!this.transaction.amount||this.transaction.amount<=0||!this.transaction.blocks||this.transaction.blocks<=0}resetData(){this.sendFundError="",this.transaction={}}onAmountUnitChange(e){const i=this,o=this.selAmountUnit===this.amountUnits[2]?l.NT.OTHER:this.selAmountUnit;let s=e.value===this.amountUnits[2]?l.NT.OTHER:e.value;this.transaction.amount&&this.selAmountUnit!==e.value&&this.commonService.convertCurrency(this.transaction.amount,o,s,this.amountUnits[2],this.fiatConversion).pipe((0,_.R)(this.unSubs[3])).subscribe({next:c=>{this.selAmountUnit=e.value,i.transaction.amount=+i.decimalPipe.transform(c[s],i.currencyUnitFormats[s]).replace(/,/g,"")},error:c=>{this.amountError="Conversion Error: "+c,this.selAmountUnit=o,s=o}})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(J.so),t.Y36(O.mQ),t.Y36(w.yh),t.Y36(P.v),t.Y36(u.JJ),t.Y36(X.eX))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-on-chain-send-modal"]],viewQuery:function(e,i){if(1&e&&t.Gf(ya,7),2&e){let o;t.iGM(o=t.CRH())&&(i.form=o.first)}},decls:36,vars:15,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","8","fxFlex","5","fxLayoutAlign","center","default","","mat-button","",1,"btn-close-x","p-0",3,"mat-dialog-close"],[1,"padding-gap-x-large"],["fxLayout","row wrap","fxFlex","100","fxLayoutAlign","space-between start",1,"overflow-x-hidden",3,"submit","reset"],["form","ngForm"],["fxFlex","55"],["matInput","","autoFocus","","placeholder","Bitcoin Address","tabindex","1","name","addr","required","",3,"ngModel","ngModelChange"],["addrs","ngModel"],[4,"ngIf"],["fxFlex","30"],["matInput","","placeholder","Amount","name","amt","type","number","tabindex","2","required","",3,"ngModel","step","min","ngModelChange"],["amnt","ngModel"],["matSuffix",""],["fxFlex","10","fxLayoutAlign","start end"],["tabindex","3","required","","name","amountUnit",3,"value","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["fxFlex","60","fxLayoutAlign","space-between stretch","fxLayout","row wrap"],["fxFlex","48","fxLayout","row","fxLayoutAlign","start center"],["matInput","","placeholder","Target Confirmation Blocks","type","number","name","blocks","tabindex","8","required","true",3,"ngModel","step","min","ngModelChange"],["blocks","ngModel"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center"],["mat-button","","color","primary","tabindex","7","type","reset",1,"mr-1"],["mat-button","","color","primary","type","submit","tabindex","8"],[3,"value"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-header",2)(3,"div",3)(4,"span",4),t._uU(5,"Send Payment"),t.qZA()(),t.TgZ(6,"button",5),t._uU(7,"X"),t.qZA()(),t.TgZ(8,"mat-card-content",6)(9,"form",7,8),t.NdJ("submit",function(){return i.onSendFunds()})("reset",function(){return i.resetData()}),t.TgZ(11,"mat-form-field",9)(12,"input",10,11),t.NdJ("ngModelChange",function(s){return i.transaction.address=s}),t.qZA(),t.YNc(14,va,2,0,"mat-error",12),t.qZA(),t.TgZ(15,"mat-form-field",13)(16,"input",14,15),t.NdJ("ngModelChange",function(s){return i.transaction.amount=s}),t.qZA(),t.TgZ(18,"span",16),t._uU(19),t.qZA(),t.YNc(20,Ta,2,1,"mat-error",12),t.qZA(),t.TgZ(21,"mat-form-field",17)(22,"mat-select",18),t.NdJ("selectionChange",function(s){return i.onAmountUnitChange(s)}),t.YNc(23,La,2,2,"mat-option",19),t.qZA()(),t.TgZ(24,"div",20)(25,"mat-form-field",21)(26,"input",22,23),t.NdJ("ngModelChange",function(s){return i.transaction.blocks=s}),t.qZA(),t.YNc(28,ba,2,0,"mat-error",12),t.qZA()(),t._UZ(29,"div",24),t.YNc(30,Za,3,2,"div",25),t.TgZ(31,"div",26)(32,"button",27),t._uU(33,"Clear Fields"),t.qZA(),t.TgZ(34,"button",28),t._uU(35,"Send Funds"),t.qZA()()()()()()),2&e&&(t.xp6(6),t.Q6J("mat-dialog-close",!1),t.xp6(6),t.Q6J("ngModel",i.transaction.address),t.xp6(2),t.Q6J("ngIf",!i.transaction.address),t.xp6(2),t.Q6J("ngModel",i.transaction.amount)("step",100)("min",0),t.xp6(3),t.hij("",i.selAmountUnit," "),t.xp6(1),t.Q6J("ngIf",!i.transaction.amount),t.xp6(2),t.Q6J("value",i.selAmountUnit),t.xp6(1),t.Q6J("ngForOf",i.amountUnits),t.xp6(3),t.Q6J("ngModel",i.transaction.blocks)("step",1)("min",0),t.xp6(2),t.Q6J("ngIf",!i.transaction.blocks),t.xp6(2),t.Q6J("ngIf",""!==i.sendFundError))},directives:[m.xw,m.yH,b.dk,m.Wh,N.lW,J.ZT,b.dn,d._Y,d.JL,d.F,y.KE,Y.Nt,d.Fj,j.h,d.Q7,d.JJ,d.On,u.O5,y.TO,d.wV,d.qQ,tt.q,y.R9,k.gD,u.sg,z.ey,q.BN],styles:[""]}),n})();var ut=f(1203);function Aa(n,a){if(1&n&&(t.TgZ(0,"mat-option",34),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw();t.Q6J("value",e),t.xp6(1),t.Oqu(i.getLabel(e))}}function Ea(n,a){1&n&&t._UZ(0,"mat-progress-bar",35)}function wa(n,a){1&n&&(t.TgZ(0,"th",36),t._uU(1,"Date/Time"),t.qZA())}function Ia(n,a){if(1&n&&(t.TgZ(0,"td",37),t._uU(1),t.ALo(2,"date"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,1e3*(null==e?null:e.timestamp),"dd/MMM/y HH:mm"))}}function Fa(n,a){1&n&&(t.TgZ(0,"th",36),t._uU(1,"Address"),t.qZA())}const pt=function(n){return{width:n}};function qa(n,a){if(1&n&&(t.TgZ(0,"td",37)(1,"div",38)(2,"span",39),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,pt,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.address)}}function Na(n,a){1&n&&(t.TgZ(0,"th",36),t._uU(1,"Blockhash"),t.qZA())}function Oa(n,a){if(1&n&&(t.TgZ(0,"td",37)(1,"div",38)(2,"span",39),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,pt,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.blockHash)}}function Pa(n,a){1&n&&(t.TgZ(0,"th",36),t._uU(1,"Transaction ID"),t.qZA())}function Ua(n,a){if(1&n&&(t.TgZ(0,"td",37)(1,"div",38)(2,"span",39),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,pt,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.txid)}}function Ra(n,a){1&n&&(t.TgZ(0,"th",40),t._uU(1,"Amount (Sats)"),t.qZA())}function ka(n,a){if(1&n&&(t.TgZ(0,"span",43),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,null==e?null:e.amount))}}function Da(n,a){if(1&n&&(t.TgZ(0,"span",44),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij("(",t.lcZ(2,1,-1*(null==e?null:e.amount)),")")}}function Ja(n,a){if(1&n&&(t.TgZ(0,"td",37),t.YNc(1,ka,3,3,"span",41),t.YNc(2,Da,3,3,"span",42),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Q6J("ngIf",(null==e?null:e.amount)>0||0===(null==e?null:e.amount)),t.xp6(1),t.Q6J("ngIf",(null==e?null:e.amount)<0)}}function Ma(n,a){1&n&&(t.TgZ(0,"th",40),t._uU(1,"Fees (Sats)"),t.qZA())}function Qa(n,a){if(1&n&&(t.TgZ(0,"td",37)(1,"span",43),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,null==e?null:e.fees))}}function Ya(n,a){1&n&&(t.TgZ(0,"th",40),t._uU(1,"Confirmations"),t.qZA())}function Ba(n,a){if(1&n&&(t.TgZ(0,"td",37)(1,"span",43),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.lcZ(3,1,null==e?null:e.confirmations)," ")}}function Ha(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",45)(1,"div",46)(2,"mat-select",47),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",48),t.NdJ("click",function(){return t.CHM(e),t.oxw().onDownloadCSV()}),t._uU(5,"Download CSV"),t.qZA()()()()}}function za(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",49)(1,"button",50),t.NdJ("click",function(o){const c=t.CHM(e).$implicit;return t.oxw().onTransactionClick(c,o)}),t._uU(2,"View Info"),t.qZA()()}}function Va(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No transaction available."),t.qZA())}function Ga(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting transactions..."),t.qZA())}function Wa(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.errorMessage)}}function $a(n,a){if(1&n&&(t.TgZ(0,"td",51),t.YNc(1,Va,2,0,"p",52),t.YNc(2,Ga,2,0,"p",52),t.YNc(3,Wa,2,1,"p",52),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",(!(null!=e.listTransactions&&e.listTransactions.data)||(null==e.listTransactions||null==e.listTransactions.data?null:e.listTransactions.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.listTransactions&&e.listTransactions.data)||(null==e.listTransactions||null==e.listTransactions.data?null:e.listTransactions.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.listTransactions&&e.listTransactions.data)||(null==e.listTransactions||null==e.listTransactions.data?null:e.listTransactions.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const Xa=function(n){return{"display-none":n}};function Ka(n,a){if(1&n&&t._UZ(0,"tr",53),2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,Xa,(null==e.listTransactions?null:e.listTransactions.data)&&(null==e.listTransactions||null==e.listTransactions.data?null:e.listTransactions.data.length)>0))}}function ja(n,a){1&n&&t._UZ(0,"tr",54)}function to(n,a){1&n&&t._UZ(0,"tr",55)}const eo=function(){return["all"]},no=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},io=function(){return["no_transaction"]};let ao=(()=>{class n{constructor(e,i,o,s,c){this.logger=e,this.commonService=i,this.store=o,this.datePipe=s,this.camelCaseWithSpaces=c,this.faHistory=L.qO$,this.nodePageDefs=l.Xk,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="on_chain",this.tableSetting={tableId:"transaction",recordsPerPage:l.IV,sortBy:"timestamp",sortOrder:l.Pi.DESCENDING},this.displayedColumns=[],this.listTransactions=new r.by([]),this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.selFilter="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.dispatch((0,U.mC)()),this.store.select(C.nF).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{var i,o;this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=(null===(i=e.pageSettings.find(s=>s.pageId===this.PAGE_ID))||void 0===i?void 0:i.tables.find(s=>s.tableId===this.tableSetting.tableId))||(null===(o=l.c3.find(s=>s.pageId===this.PAGE_ID))||void 0===o?void 0:o.tables.find(s=>s.tableId===this.tableSetting.tableId)),this.displayedColumns=this.screenSize===l.cu.XS||this.screenSize===l.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:l.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(C.dx).pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),e.transactions&&this.loadTransactionsTable(e.transactions),this.logger.info(e)})}applyFilter(){this.listTransactions.filter=this.selFilter.trim().toLowerCase()}getLabel(e){const i=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(o=>o.column===e);return i?i.label?i.label:this.camelCaseWithSpaces.transform(i.column,"_"):this.commonService.titleCase(e)}setFilterPredicate(){this.listTransactions.filterPredicate=(e,i)=>{var o,s;let c="";switch(this.selFilterBy){case"all":c=(e.timestamp?null===(o=this.datePipe.transform(new Date(1e3*e.timestamp),"dd/MMM/y HH:mm"))||void 0===o?void 0:o.toLowerCase():"")+JSON.stringify(e).toLowerCase();break;case"timestamp":c=(null===(s=this.datePipe.transform(new Date(1e3*(e[this.selFilterBy]||0)),"dd/MMM/y HH:mm"))||void 0===s?void 0:s.toLowerCase())||"";break;default:c=void 0===e[this.selFilterBy]?"":"string"==typeof e[this.selFilterBy]?e[this.selFilterBy].toLowerCase():"boolean"==typeof e[this.selFilterBy]?e[this.selFilterBy]?"yes":"no":e[this.selFilterBy].toString()}return c.includes(i)}}onTransactionClick(e,i){this.store.dispatch((0,E.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:"Transaction Information",message:[[{key:"blockHash",value:e.blockHash,title:"Block Hash",width:100}],[{key:"txid",value:e.txid,title:"Transaction ID",width:100}],[{key:"timestamp",value:e.timestamp,title:"Date/Time",width:50,type:l.Gi.DATE_TIME},{key:"confirmations",value:e.confirmations,title:"Number of Confirmations",width:50,type:l.Gi.NUMBER}],[{key:"fees",value:e.fees,title:"Fees (Sats)",width:50,type:l.Gi.NUMBER},{key:"amount",value:e.amount,title:"Amount (Sats)",width:50,type:l.Gi.NUMBER}],[{key:"address",value:e.address,title:"Address",width:100,type:l.Gi.STRING}]]}}}))}loadTransactionsTable(e){var i;this.listTransactions=new r.by([...e]),this.listTransactions.sort=this.sort,this.listTransactions.sortingDataAccessor=(o,s)=>o[s]&&isNaN(o[s])?o[s].toLocaleLowerCase():o[s]?+o[s]:null,null===(i=this.listTransactions.sort)||void 0===i||i.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.listTransactions.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter(),this.logger.info(this.listTransactions)}onDownloadCSV(){this.listTransactions.data&&this.listTransactions.data.length>0&&this.commonService.downloadFile(this.listTransactions.data,"Transactions")}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(O.mQ),t.Y36(P.v),t.Y36(w.yh),t.Y36(u.uU),t.Y36(G.i1))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-on-chain-transaction-history"]],viewQuery:function(e,i){if(1&e&&(t.Gf(S.YE,5),t.Gf(A.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.sort=o.first),t.iGM(o=t.CRH())&&(i.paginator=o.first)}},features:[t._Bn([{provide:A.ye,useValue:(0,l.pt)("Transactions")}])],decls:47,vars:17,consts:[["fxLayout","row wrap","fxLayoutAlign","start start","fxLayout.gt-sm","column","fxFlex","100","fxLayoutAlign.gt-sm","start stretch"],["fxLayout","column","fxLayout.gt-xs","row wrap","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxFlex","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxFlex","49"],["placeholder","Filter By","tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","row","fxLayoutAlign","start start"],["fxLayout","column","fxLayoutAlign","start end","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","timestamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","address"],["matColumnDef","blockHash"],["matColumnDef","txid"],["matColumnDef","amount"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","fees"],["matColumnDef","confirmations"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_transaction"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center",4,"ngIf"],["fxLayoutAlign","end center","class","red",4,"ngIf"],["fxLayoutAlign","end center"],["fxLayoutAlign","end center",1,"red"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","4",1,"table-actions-button",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2),t._UZ(3,"fa-icon",3),t.TgZ(4,"span",4),t._uU(5,"Transaction History"),t.qZA()(),t.TgZ(6,"div",5)(7,"mat-form-field",6)(8,"mat-select",7),t.NdJ("ngModelChange",function(s){return i.selFilterBy=s})("selectionChange",function(){return i.selFilter="",i.applyFilter()}),t.YNc(9,Aa,2,2,"mat-option",8),t.qZA()(),t.TgZ(10,"mat-form-field",6)(11,"input",9),t.NdJ("ngModelChange",function(s){return i.selFilter=s})("input",function(){return i.applyFilter()})("keyup",function(){return i.applyFilter()}),t.qZA()()()(),t.TgZ(12,"div",10)(13,"div",11),t.YNc(14,Ea,1,0,"mat-progress-bar",12),t.TgZ(15,"table",13,14),t.ynx(17,15),t.YNc(18,wa,2,0,"th",16),t.YNc(19,Ia,3,4,"td",17),t.BQk(),t.ynx(20,18),t.YNc(21,Fa,2,0,"th",16),t.YNc(22,qa,4,4,"td",17),t.BQk(),t.ynx(23,19),t.YNc(24,Na,2,0,"th",16),t.YNc(25,Oa,4,4,"td",17),t.BQk(),t.ynx(26,20),t.YNc(27,Pa,2,0,"th",16),t.YNc(28,Ua,4,4,"td",17),t.BQk(),t.ynx(29,21),t.YNc(30,Ra,2,0,"th",22),t.YNc(31,Ja,3,2,"td",17),t.BQk(),t.ynx(32,23),t.YNc(33,Ma,2,0,"th",22),t.YNc(34,Qa,4,3,"td",17),t.BQk(),t.ynx(35,24),t.YNc(36,Ya,2,0,"th",22),t.YNc(37,Ba,4,3,"td",17),t.BQk(),t.ynx(38,25),t.YNc(39,Ha,6,0,"th",26),t.YNc(40,za,3,0,"td",27),t.BQk(),t.ynx(41,28),t.YNc(42,$a,4,3,"td",29),t.BQk(),t.YNc(43,Ka,1,3,"tr",30),t.YNc(44,ja,1,0,"tr",31),t.YNc(45,to,1,0,"tr",32),t.qZA(),t._UZ(46,"mat-paginator",33),t.qZA()()()),2&e&&(t.xp6(3),t.Q6J("icon",i.faHistory),t.xp6(5),t.Q6J("ngModel",i.selFilterBy),t.xp6(1),t.Q6J("ngForOf",t.DdM(13,eo).concat(i.displayedColumns.slice(0,-1))),t.xp6(2),t.Q6J("ngModel",i.selFilter),t.xp6(3),t.Q6J("ngIf",i.apiCallStatus.status===i.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",i.listTransactions)("ngClass",t.VKq(14,no,""!==i.errorMessage)),t.xp6(28),t.Q6J("matFooterRowDef",t.DdM(16,io)),t.xp6(1),t.Q6J("matHeaderRowDef",i.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumns),t.xp6(1),t.Q6J("pageSize",i.pageSize)("pageSizeOptions",i.pageSizeOptions)("showFirstLastButtons",i.screenSize!==i.screenSizeEnum.XS))},directives:[m.xw,m.Wh,m.yH,q.BN,y.KE,k.gD,d.JJ,d.On,u.sg,z.ey,Y.Nt,d.Fj,H.$V,u.O5,M.pW,r.BZ,S.YE,u.mk,Z.oO,r.w1,r.fO,r.ge,S.nU,r.Dz,r.ev,u.PC,Z.Zl,k.$L,N.lW,r.mD,r.yh,r.Ke,r.Q2,r.as,r.XQ,r.nj,r.Gk,A.NW],pipes:[u.uU,u.JJ],styles:[""]}),n})();function oo(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",12),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw().activeLink=s.link}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit,i=t.oxw();t.s9C("routerLink",e.link),t.Q6J("active",i.activeLink===e.link),t.xp6(1),t.Oqu(e.name)}}let so=(()=>{class n{constructor(e,i){this.store=e,this.router=i,this.selNode={},this.faExchangeAlt=L.Ssp,this.faChartPie=L.OS1,this.balances=[{title:"Total Balance",dataValue:0},{title:"Confirmed",dataValue:0},{title:"Unconfirmed",dataValue:0}],this.links=[{link:"receive",name:"Receive"},{link:"send",name:"Send"}],this.activeLink=this.links[0].link,this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){const e=this.links.find(i=>this.router.url.includes(i.link));this.activeLink=e?e.link:this.links[0].link,this.router.events.pipe((0,_.R)(this.unSubs[0]),(0,Q.h)(i=>i instanceof x.Av)).subscribe({next:i=>{const o=this.links.find(s=>i.urlAfterRedirects.includes(s.link));this.activeLink=o?o.link:this.links[0].link}}),this.store.select(C.LR).pipe((0,_.R)(this.unSubs[1])).subscribe(i=>{this.selNode=i}),this.store.select(C.kY).pipe((0,_.R)(this.unSubs[2])).subscribe(i=>{this.balances=[{title:"Total Balance",dataValue:i.onchainBalance.total||0},{title:"Confirmed",dataValue:i.onchainBalance.confirmed||0},{title:"Unconfirmed",dataValue:i.onchainBalance.unconfirmed||0}]})}openSendFundsModal(){this.store.dispatch((0,E.qR)({payload:{data:{component:At}}}))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(w.yh),t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-on-chain"]],decls:21,vars:4,consts:[["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x","mb-4"],["fxLayout","column"],[3,"values"],["fxLayout","column",1,"padding-gap-x"],["mat-tab-nav-bar",""],["role","tab","mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x-large","mt-2"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x-large"],["fxLayout","row","fxFlex","100"],["role","tab","mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t._UZ(1,"fa-icon",1),t.TgZ(2,"span",2),t._uU(3,"On-chain Balance"),t.qZA()(),t.TgZ(4,"div",3)(5,"mat-card")(6,"mat-card-content",4),t._UZ(7,"rtl-currency-unit-converter",5),t.qZA()()(),t.TgZ(8,"div",0),t._UZ(9,"fa-icon",1),t.TgZ(10,"span",2),t._uU(11,"On-chain Transactions"),t.qZA()(),t.TgZ(12,"div",6)(13,"mat-card")(14,"mat-card-content",4)(15,"nav",7),t.YNc(16,oo,2,3,"div",8),t.qZA(),t.TgZ(17,"div",9),t._UZ(18,"router-outlet"),t.qZA(),t.TgZ(19,"div",10),t._UZ(20,"rtl-ecl-on-chain-transaction-history",11),t.qZA()()()()),2&e&&(t.xp6(1),t.Q6J("icon",i.faChartPie),t.xp6(6),t.Q6J("values",i.balances),t.xp6(2),t.Q6J("icon",i.faExchangeAlt),t.xp6(7),t.Q6J("ngForOf",i.links))},directives:[m.xw,m.Wh,q.BN,b.a8,b.dn,ut.D,R.BU,u.sg,R.Nj,x.rH,m.yH,x.lC,ao],styles:[""]}),n})();var Et=f(7544);function lo(n,a){if(1&n&&(t.TgZ(0,"span",10),t._uU(1,"Channels"),t.qZA()),2&n){const e=t.oxw();t.s9C("matBadge",e.activeChannels)}}function ro(n,a){if(1&n&&(t.TgZ(0,"span",10),t._uU(1,"Peers"),t.qZA()),2&n){const e=t.oxw();t.s9C("matBadge",e.activePeers)}}let co=(()=>{class n{constructor(e,i){this.store=e,this.router=i,this.activePeers=0,this.activeChannels=0,this.faUsers=L.FVb,this.faChartPie=L.OS1,this.balances=[{title:"Total Balance",dataValue:0},{title:"Confirmed",dataValue:0},{title:"Unconfirmed",dataValue:0}],this.links=[{link:"channels",name:"Channels"},{link:"peers",name:"Peers"}],this.activeLink=0,this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.activeLink=this.links.findIndex(e=>e.link===this.router.url.substring(this.router.url.lastIndexOf("/")+1)),this.router.events.pipe((0,_.R)(this.unSubs[0]),(0,Q.h)(e=>e instanceof x.Av)).subscribe({next:e=>{this.activeLink=this.links.findIndex(i=>i.link===e.urlAfterRedirects.substring(e.urlAfterRedirects.lastIndexOf("/")+1))}}),this.store.select(C.Bo).pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{this.activePeers=e.peers&&e.peers.length?e.peers.length:0}),this.store.select(C.Xz).pipe((0,_.R)(this.unSubs[2])).subscribe(e=>{this.activeChannels=e.channelsStatus&&e.channelsStatus.active&&e.channelsStatus.active.channels?e.channelsStatus.active.channels:0}),this.store.select(C.kY).pipe((0,_.R)(this.unSubs[3])).subscribe(e=>{this.balances=[{title:"Total Balance",dataValue:e.onchainBalance.total||0},{title:"Confirmed",dataValue:e.onchainBalance.confirmed||0},{title:"Unconfirmed",dataValue:e.onchainBalance.unconfirmed||0}]})}onSelectedTabChange(e){this.router.navigateByUrl("/ecl/connections/"+this.links[e.index].link)}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(w.yh),t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-connections"]],decls:22,vars:4,consts:[["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x","mb-4"],["fxLayout","column"],[3,"values"],["fxLayout","column",1,"padding-gap-x"],[3,"selectedIndex","selectedIndexChange","selectedTabChange"],["mat-tab-label",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x-large"],["matBadgeOverlap","false",1,"tab-badge",3,"matBadge"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t._UZ(1,"fa-icon",1),t.TgZ(2,"span",2),t._uU(3,"On-chain Balance"),t.qZA()(),t.TgZ(4,"div",3)(5,"mat-card")(6,"mat-card-content",4),t._UZ(7,"rtl-currency-unit-converter",5),t.qZA()()(),t.TgZ(8,"div",0),t._UZ(9,"fa-icon",1),t.TgZ(10,"span",2),t._uU(11,"Connections"),t.qZA()(),t.TgZ(12,"div",6)(13,"mat-card")(14,"mat-card-content",4)(15,"mat-tab-group",7),t.NdJ("selectedIndexChange",function(s){return i.activeLink=s})("selectedTabChange",function(s){return i.onSelectedTabChange(s)}),t.TgZ(16,"mat-tab"),t.YNc(17,lo,2,1,"ng-template",8),t.qZA(),t.TgZ(18,"mat-tab"),t.YNc(19,ro,2,1,"ng-template",8),t.qZA()(),t.TgZ(20,"div",9),t._UZ(21,"router-outlet"),t.qZA()()()()),2&e&&(t.xp6(1),t.Q6J("icon",i.faChartPie),t.xp6(6),t.Q6J("values",i.balances),t.xp6(2),t.Q6J("icon",i.faUsers),t.xp6(6),t.Q6J("selectedIndex",i.activeLink))},directives:[m.xw,m.Wh,q.BN,b.a8,b.dn,ut.D,R.SP,R.uX,R.uD,Et.k,m.yH,x.lC],styles:[""]}),n})();function uo(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",11),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw().activeLink=s.link}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit,i=t.oxw();t.s9C("routerLink",e.link),t.Q6J("active",i.activeLink===e.link),t.xp6(1),t.Oqu(e.name)}}let po=(()=>{class n{constructor(e,i,o){this.logger=e,this.store=i,this.router=o,this.faExchangeAlt=L.Ssp,this.faChartPie=L.OS1,this.currencyUnits=[],this.balances=[{title:"Local Capacity",dataValue:0,tooltip:"Amount you can send"},{title:"Remote Capacity",dataValue:0,tooltip:"Amount you can receive"}],this.links=[{link:"payments",name:"Payments"},{link:"invoices",name:"Invoices"}],this.activeLink=this.links[0].link,this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){const e=this.links.find(i=>this.router.url.includes(i.link));this.activeLink=e?e.link:this.links[0].link,this.router.events.pipe((0,_.R)(this.unSubs[0]),(0,Q.h)(i=>i instanceof x.Av)).subscribe({next:i=>{const o=this.links.find(s=>i.urlAfterRedirects.includes(s.link));this.activeLink=o?o.link:this.links[0].link}}),this.store.select(C.Xz).pipe((0,_.R)(this.unSubs[1]),(0,ot.M)(this.store.select(C.LR))).subscribe(([i,o])=>{this.currencyUnits=(null==o?void 0:o.currencyUnits)||[],this.balances=o&&o.userPersona===l.ol.OPERATOR?[{title:"Local Capacity",dataValue:i.lightningBalance.localBalance,tooltip:"Amount you can send"},{title:"Remote Capacity",dataValue:i.lightningBalance.remoteBalance,tooltip:"Amount you can receive"}]:[{title:"Outbound Capacity",dataValue:i.lightningBalance.localBalance,tooltip:"Amount you can send"},{title:"Inbound Capacity",dataValue:i.lightningBalance.remoteBalance,tooltip:"Amount you can receive"}],this.logger.info(i)})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(O.mQ),t.Y36(w.yh),t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-transactions"]],decls:19,vars:4,consts:[["fxLayout","row wrap","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x","mb-4"],["fxLayout","column"],[3,"values"],["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],["fxLayout","column",1,"padding-gap-x"],["mat-tab-nav-bar",""],["role","tab","mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"mat-tab-body-wrapper"],["role","tab","mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t._UZ(1,"fa-icon",1),t.TgZ(2,"span",2),t._uU(3,"Lightning Balance"),t.qZA()(),t.TgZ(4,"div",3)(5,"mat-card")(6,"mat-card-content",4),t._UZ(7,"rtl-currency-unit-converter",5),t.qZA()()(),t.TgZ(8,"div",6),t._UZ(9,"fa-icon",1),t.TgZ(10,"span",2),t._uU(11,"Lightning Transactions"),t.qZA()(),t.TgZ(12,"div",7)(13,"mat-card")(14,"mat-card-content",4)(15,"nav",8),t.YNc(16,uo,2,3,"div",9),t.qZA(),t.TgZ(17,"div",10),t._UZ(18,"router-outlet"),t.qZA()()()()),2&e&&(t.xp6(1),t.Q6J("icon",i.faChartPie),t.xp6(6),t.Q6J("values",i.balances),t.xp6(2),t.Q6J("icon",i.faExchangeAlt),t.xp6(7),t.Q6J("ngForOf",i.links))},directives:[m.xw,m.Wh,q.BN,b.a8,b.dn,ut.D,R.BU,u.sg,R.Nj,x.rH,m.yH,x.lC],styles:[""]}),n})();function mo(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",11),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw().activeLink=s.link}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit,i=t.oxw();t.s9C("routerLink",e.link),t.Q6J("active",i.activeLink===e.link),t.xp6(1),t.Oqu(e.name)}}let ho=(()=>{class n{constructor(e){this.router=e,this.faMapSigns=L.SuH,this.events=[],this.flgLoading=[!0],this.errorMessage="",this.links=[{link:"forwardinghistory",name:"Forwarding History"},{link:"peers",name:"Routing Peers"}],this.activeLink=this.links[0].link,this.unSubs=[new p.x,new p.x,new p.x]}ngOnInit(){const e=this.links.find(i=>this.router.url.includes(i.link));this.activeLink=e?e.link:this.links[0].link,this.router.events.pipe((0,_.R)(this.unSubs[0]),(0,Q.h)(i=>i instanceof x.Av)).subscribe({next:i=>{const o=this.links.find(s=>i.urlAfterRedirects.includes(s.link));this.activeLink=o?o.link:this.links[0].link}})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-routing"]],decls:13,vars:2,consts:[["fxLayout","column"],["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start",1,"padding-gap-x"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch"],["fxLayout","row","fxFlex","100"],["mat-tab-nav-bar","","fxFlex","100"],["role","tab","mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"padding-gap-x-large"],["role","tab","mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1),t._UZ(2,"fa-icon",2),t.TgZ(3,"span",3),t._uU(4,"Routing"),t.qZA()(),t.TgZ(5,"div",4)(6,"mat-card",5)(7,"mat-card-content",6)(8,"div",7)(9,"nav",8),t.YNc(10,mo,2,3,"div",9),t.qZA()(),t.TgZ(11,"div",10),t._UZ(12,"router-outlet"),t.qZA()()()()()),2&e&&(t.xp6(2),t.Q6J("icon",i.faMapSigns),t.xp6(8),t.Q6J("ngForOf",i.links))},directives:[m.xw,m.Wh,q.BN,m.yH,b.a8,b.dn,R.BU,u.sg,R.Nj,x.rH,x.lC],styles:[""]}),n})();var it=f(9814),wt=f(7261),It=f(6895);function _o(n,a){if(1&n&&(t.TgZ(0,"span",9)(1,"div"),t._uU(2),t.ALo(3,"titlecase"),t.qZA()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(2),t.AsE("",i.nodeFeaturesEnum[e.key]||e.key,": ",t.lcZ(3,2,e.value),"")}}function go(n,a){1&n&&(t.TgZ(0,"th",23),t._uU(1,"Address"),t.qZA())}function fo(n,a){if(1&n&&(t.TgZ(0,"td",24),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(e)}}function Co(n,a){1&n&&(t.TgZ(0,"th",25)(1,"div",26),t._uU(2,"Actions"),t.qZA()())}function xo(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",24)(1,"span",27)(2,"button",28),t.NdJ("copied",function(o){return t.CHM(e),t.oxw(2).onCopyNodeURI(o)}),t._uU(3,"Copy Node URI"),t.qZA()()()}if(2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(2),t.Q6J("payload",(null==i.lookupResult?null:i.lookupResult.nodeId)+"@"+e)}}function yo(n,a){1&n&&t._UZ(0,"tr",29)}function vo(n,a){1&n&&t._UZ(0,"tr",30)}const To=function(n){return{"background-color":n}};function Lo(n,a){if(1&n&&(t.TgZ(0,"div",1),t._UZ(1,"mat-divider",2),t.TgZ(2,"div",3)(3,"div",4)(4,"h4",5),t._uU(5,"Alias"),t.qZA(),t.TgZ(6,"span",6),t._uU(7),t.TgZ(8,"span",7),t._uU(9),t.qZA()()(),t.TgZ(10,"div",8)(11,"h4",5),t._uU(12,"Pub Key"),t.qZA(),t.TgZ(13,"span",9),t._uU(14),t.qZA()()(),t._UZ(15,"mat-divider",2),t.TgZ(16,"div",3)(17,"div",4)(18,"h4",5),t._uU(19,"Date/Time"),t.qZA(),t.TgZ(20,"span",6),t._uU(21),t.ALo(22,"date"),t.qZA()(),t.TgZ(23,"div",8)(24,"h4",5),t._uU(25,"Features"),t.qZA(),t.YNc(26,_o,4,4,"span",10),t.ALo(27,"keyvalue"),t.qZA()(),t._UZ(28,"mat-divider",2),t.TgZ(29,"div",3)(30,"div",11)(31,"h4",5),t._uU(32,"Signature"),t.qZA(),t.TgZ(33,"span",6),t._uU(34),t.qZA()()(),t._UZ(35,"mat-divider",2),t.TgZ(36,"div",1)(37,"h4",12),t._uU(38,"Addresses"),t.qZA(),t.TgZ(39,"div",13)(40,"table",14,15),t.ynx(42,16),t.YNc(43,go,2,0,"th",17),t.YNc(44,fo,2,1,"td",18),t.BQk(),t.ynx(45,19),t.YNc(46,Co,3,0,"th",20),t.YNc(47,xo,4,1,"td",18),t.BQk(),t.YNc(48,yo,1,0,"tr",21),t.YNc(49,vo,1,0,"tr",22),t.qZA()()()()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("inset",!0),t.xp6(6),t.Oqu(null==e.lookupResult?null:e.lookupResult.alias),t.xp6(1),t.Q6J("ngStyle",t.VKq(19,To,null==e.lookupResult?null:e.lookupResult.rgbColor)),t.xp6(1),t.Oqu(null!=e.lookupResult&&e.lookupResult.rgbColor?null==e.lookupResult?null:e.lookupResult.rgbColor:""),t.xp6(5),t.Oqu(null==e.lookupResult?null:e.lookupResult.nodeId),t.xp6(1),t.Q6J("inset",!0),t.xp6(6),t.Oqu(t.xi3(22,14,1e3*(null==e.lookupResult?null:e.lookupResult.timestamp),"dd/MMM/y HH:mm")),t.xp6(5),t.Q6J("ngForOf",t.lcZ(27,17,null==e.lookupResult?null:e.lookupResult.features.activated)),t.xp6(2),t.Q6J("inset",!0),t.xp6(6),t.Oqu(null==e.lookupResult?null:e.lookupResult.signature),t.xp6(1),t.Q6J("inset",!0),t.xp6(5),t.Q6J("dataSource",e.addresses),t.xp6(8),t.Q6J("matHeaderRowDef",e.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",e.displayedColumns)}}let bo=(()=>{class n{constructor(e,i){this.logger=e,this.snackBar=i,this.lookupResult={},this.addresses=new r.by([]),this.displayedColumns=["address","actions"],this.nodeFeaturesEnum=l.H_}ngOnInit(){this.addresses=new r.by(this.lookupResult.addresses?[...this.lookupResult.addresses]:[]),this.addresses.data=this.lookupResult.addresses||[],this.addresses.sort=this.sort,this.addresses.sortingDataAccessor=(e,i)=>e[i]&&isNaN(e[i])?e[i].toLocaleLowerCase():e[i]?+e[i]:null}onCopyNodeURI(e){this.snackBar.open("Node URI copied."),this.logger.info("Copied Text: "+e)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(O.mQ),t.Y36(wt.ux))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-node-lookup"]],viewQuery:function(e,i){if(1&e&&t.Gf(S.YE,5),2&e){let o;t.iGM(o=t.CRH())&&(i.sort=o.first)}},inputs:{lookupResult:"lookupResult"},decls:1,vars:1,consts:[["fxLayout","column",4,"ngIf"],["fxLayout","column"],[1,"my-1",3,"inset"],["fxLayout","row"],["fxFlex","30"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text"],[1,"ml-2",3,"ngStyle"],["fxFlex","70"],[1,"foreground-secondary-text","w-100"],["class","foreground-secondary-text w-100",4,"ngFor","ngForOf"],["fxFlex","100"],["fxFlex","100","fxLayoutAlign","start",1,"font-bold-500","mb-1"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mat-table","","matSort","",1,"overflow-auto",3,"dataSource"],["table",""],["matColumnDef","address"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select","btn-action"],["fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","1","rtlClipboard","",1,"btn-action-copy",3,"payload","copied"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&t.YNc(0,Lo,50,21,"div",0),2&e&&t.Q6J("ngIf",i.lookupResult)},directives:[u.O5,m.xw,K.d,m.yH,m.Wh,u.PC,Z.Zl,u.sg,H.$V,r.BZ,S.YE,r.w1,r.fO,r.ge,S.nU,r.Dz,r.ev,N.lW,It.y,r.as,r.XQ,r.nj,r.Gk],pipes:[u.uU,u.Nd,u.rS],styles:["div.bordered-box.table-actions-select.btn-action[_ngcontent-%COMP%]{min-width:13rem;width:13rem;min-height:3.6rem}button.mat-stroked-button.btn-action-copy[_ngcontent-%COMP%]{min-width:13rem;width:13rem}"]}),n})();const So=["form"];function Zo(n,a){if(1&n&&(t.TgZ(0,"mat-error"),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.hij("",null==e.lookupFields[e.selectedFieldId]?null:e.lookupFields[e.selectedFieldId].placeholder," is required.")}}function Ao(n,a){if(1&n&&(t.TgZ(0,"mat-error"),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.hij("Invalid ",null==e.lookupFields[e.selectedFieldId]?null:e.lookupFields[e.selectedFieldId].placeholder,".")}}function Eo(n,a){if(1&n&&(t.TgZ(0,"div"),t._UZ(1,"rtl-ecl-node-lookup",25),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Q6J("lookupResult",e.nodeLookupValue)}}function wo(n,a){if(1&n&&(t.TgZ(0,"span",23),t.YNc(1,Eo,2,1,"div",24),t.qZA()),2&n){const e=t.oxw(2),i=t.MAs(21);t.xp6(1),t.Q6J("ngIf",e.nodeLookupValue.nodeId)("ngIfElse",i)}}function Io(n,a){1&n&&(t.TgZ(0,"span",23)(1,"h3"),t._uU(2,"Error! Unable to find details!"),t.qZA()())}function Fo(n,a){if(1&n&&(t.TgZ(0,"div",17)(1,"div",18)(2,"span",19),t._uU(3),t.qZA()(),t.TgZ(4,"div",20),t.YNc(5,wo,2,2,"span",21),t.YNc(6,Io,3,0,"span",22),t.qZA()()),2&n){const e=t.oxw();t.xp6(3),t.hij("",e.lookupFields[e.selectedFieldId].name," Details"),t.xp6(1),t.Q6J("ngSwitch",e.selectedFieldId),t.xp6(1),t.Q6J("ngSwitchCase",0)}}function qo(n,a){1&n&&(t.TgZ(0,"h3"),t._uU(1,"Error! Unable to find details!"),t.qZA())}const No=function(n){return{"mt-1":!0,"mt-2":n}};let Oo=(()=>{class n{constructor(e,i,o,s){this.logger=e,this.commonService=i,this.store=o,this.actions=s,this.lookupKeyCtrl=new d.NI,this.nodeLookupValue={},this.channelLookupValue=[],this.flgSetLookupValue=!1,this.messageObj=[],this.selectedFieldId=0,this.lookupFields=[{id:0,name:"Node",placeholder:"Node ID"},{id:1,name:"Channel",placeholder:"Short Channel ID"}],this.flgLoading=[!0],this.faSearch=L.wn1,this.screenSize="",this.screenSizeEnum=l.cu,this.unSubs=[new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.actions.pipe((0,_.R)(this.unSubs[0]),(0,Q.h)(e=>e.type===l.lr.SET_LOOKUP_ECL||e.type===l.lr.UPDATE_API_CALL_STATUS_ECL)).subscribe(e=>{if(e.type===l.lr.SET_LOOKUP_ECL){switch(this.flgLoading[0]=!0,this.selectedFieldId){case 0:this.nodeLookupValue=e.payload[0]?JSON.parse(JSON.stringify(e.payload[0])):{nodeid:""};break;case 1:this.channelLookupValue=JSON.parse(JSON.stringify(e.payload))||[]}this.flgSetLookupValue=!0,this.logger.info(this.nodeLookupValue),this.logger.info(this.channelLookupValue)}e.type===l.lr.UPDATE_API_CALL_STATUS_ECL&&e.payload.status===l.Bn.ERROR&&"Lookup"===e.payload.action&&(this.flgLoading[0]="error")}),this.lookupKeyCtrl.valueChanges.pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{this.nodeLookupValue={},this.channelLookupValue=[],this.flgSetLookupValue=!1})}onLookup(){return this.lookupKeyCtrl.value?this.lookupKeyCtrl.value&&(this.lookupKeyCtrl.value.includes("@")||this.lookupKeyCtrl.value.includes(","))?(this.lookupKeyCtrl.setErrors({invalid:!0}),!0):void(0===(this.selectedFieldId||(this.selectedFieldId=0),this.flgSetLookupValue=!1,this.nodeLookupValue={},this.channelLookupValue=[],this.selectedFieldId)&&this.store.dispatch((0,U.Sf)({payload:this.lookupKeyCtrl.value.trim()}))):(this.lookupKeyCtrl.setErrors({required:!0}),!0)}onSelectChange(e){this.resetData(),this.selectedFieldId=e.value}resetData(){this.flgSetLookupValue=!1,this.nodeLookupValue={},this.channelLookupValue=[],this.lookupKeyCtrl.setValue(""),this.lookupKeyCtrl.setErrors(null),this.form.resetForm()}clearLookupValue(){this.nodeLookupValue={},this.channelLookupValue=[],this.flgSetLookupValue=!1}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(O.mQ),t.Y36(P.v),t.Y36(w.yh),t.Y36(X.eX))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-lookups"]],viewQuery:function(e,i){if(1&e&&t.Gf(So,7),2&e){let o;t.iGM(o=t.CRH())&&(i.form=o.first)}},decls:22,vars:9,consts:[["fxLayout","column"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start",1,"padding-gap"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxFlex","100","fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign.gt-sm","space-between center","fxLayoutAlign","start space-between",1,"w-100"],["form","ngForm"],["fxFlex","100","fxLayoutAlign","start end"],["color","primary","tabindex","1","name","lookupField"],["checked","",1,"mr-4",3,"value"],["fxFlex","100","fxLayoutAlign","start end",3,"ngClass"],["matInput","","name","lookupKey","tabindex","2","required","",3,"formControl","placeholder"],["key",""],[4,"ngIf"],["fxLayout","row","fxFlex","100",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","3","type","button",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","4","type","submit",3,"click"],["fxFlex","100","fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign.gt-sm","space-between center","fxLayoutAlign","start stretch","class","w-100 mt-2",4,"ngIf"],["errorBlock",""],["fxFlex","100","fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign.gt-sm","space-between center","fxLayoutAlign","start stretch",1,"w-100","mt-2"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start center"],[1,"page-title","font-bold-500"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start center",3,"ngSwitch"],["fxFlex","100",4,"ngSwitchCase"],["fxFlex","100",4,"ngSwitchDefault"],["fxFlex","100"],[4,"ngIf","ngIfElse"],[3,"lookupResult"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-content",2)(3,"form",3,4)(5,"div",5)(6,"mat-radio-group",6)(7,"mat-radio-button",7),t._uU(8,"Node"),t.qZA()()(),t.TgZ(9,"mat-form-field",8),t._UZ(10,"input",9,10),t.YNc(12,Zo,2,1,"mat-error",11),t.YNc(13,Ao,2,1,"mat-error",11),t.qZA(),t.TgZ(14,"div",12)(15,"button",13),t.NdJ("click",function(){return i.resetData()}),t._uU(16,"Clear"),t.qZA(),t.TgZ(17,"button",14),t.NdJ("click",function(){return i.onLookup()}),t._uU(18,"Lookup"),t.qZA()()(),t.YNc(19,Fo,7,3,"div",15),t.qZA()()(),t.YNc(20,qo,2,0,"ng-template",null,16,t.W1O)),2&e&&(t.xp6(7),t.Q6J("value",0),t.xp6(2),t.Q6J("ngClass",t.VKq(7,No,i.screenSize===i.screenSizeEnum.XS||i.screenSize===i.screenSizeEnum.SM)),t.xp6(1),t.Q6J("formControl",i.lookupKeyCtrl)("placeholder",(null==i.lookupFields[i.selectedFieldId]?null:i.lookupFields[i.selectedFieldId].placeholder)||"Lookup Key"),t.xp6(2),t.Q6J("ngIf",null==i.lookupKeyCtrl.errors?null:i.lookupKeyCtrl.errors.required),t.xp6(1),t.Q6J("ngIf",null==i.lookupKeyCtrl.errors?null:i.lookupKeyCtrl.errors.invalid),t.xp6(6),t.Q6J("ngIf",i.flgSetLookupValue))},directives:[m.xw,m.yH,m.Wh,b.dn,d._Y,d.JL,d.F,it.VQ,it.U0,y.KE,u.mk,Z.oO,Y.Nt,d.Fj,d.Q7,d.JJ,d.oH,u.O5,y.TO,N.lW,u.RF,u.n9,bo,u.ED],styles:[".tree-invisible[_ngcontent-%COMP%]{display:none}.lookup-tree[_ngcontent-%COMP%] ul[_ngcontent-%COMP%], .lookup-tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{margin-top:0;margin-bottom:0;list-style-type:none}"]}),n})();var Po=f(9122);let Uo=(()=>{class n{constructor(e,i){this.store=e,this.eclEffects=i,this.newAddress=""}onGenerateAddress(){this.store.dispatch((0,U._E)()),this.eclEffects.setNewAddress.pipe((0,W.q)(1)).subscribe(e=>{this.newAddress=e,setTimeout(()=>{this.store.dispatch((0,E.qR)({payload:{data:{address:this.newAddress,addressType:"",component:Po.n}}}))},0)})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(w.yh),t.Y36(ct.o))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-on-chain-receive"]],decls:4,vars:0,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row"],["mat-flat-button","","color","primary","tabindex","1",3,"click"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"button",2),t.NdJ("click",function(){return i.onGenerateAddress()}),t._uU(3,"Generate Address"),t.qZA()()())},directives:[m.xw,m.yH,m.Wh,N.lW],styles:[""]}),n})(),Ro=(()=>{class n{constructor(e,i){this.store=e,this.activatedRoute=i,this.sweepAll=!1,this.unSubs=[new p.x,new p.x]}ngOnInit(){this.activatedRoute.data.pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{this.sweepAll=e.sweepAll})}openSendFundsModal(){this.store.dispatch((0,E.qR)({payload:{data:{sweepAll:this.sweepAll,component:At}}}))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(w.yh),t.Y36(x.gz))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-on-chain-send"]],decls:4,vars:1,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row"],["mat-flat-button","","color","primary","type","button","tabindex","1",3,"click"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"button",2),t.NdJ("click",function(){return i.openSendFundsModal()}),t._uU(3),t.qZA()()()),2&e&&(t.xp6(3),t.Oqu(i.sweepAll?"Sweep All":"Send Funds"))},directives:[m.xw,m.yH,m.Wh,N.lW],styles:[""]}),n})();var ko=f(8675),Ft=f(4004),qt=f(1079),Do=f(9843),Nt=f(2368);const Jo=["form"];function Mo(n,a){if(1&n&&(t.TgZ(0,"mat-option",35),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.Q6J("value",e),t.xp6(1),t.Oqu(e.alias?e.alias:e.nodeId?e.nodeId:"")}}function Qo(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Peer alias is required."),t.qZA())}function Yo(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Peer not found in the list."),t.qZA())}function Bo(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mat-form-field",1)(1,"input",31),t.NdJ("change",function(){return t.CHM(e),t.oxw().onSelectedPeerChanged()}),t.qZA(),t.TgZ(2,"mat-autocomplete",32,33),t.NdJ("optionSelected",function(){return t.CHM(e),t.oxw().onSelectedPeerChanged()}),t.YNc(4,Mo,2,2,"mat-option",34),t.ALo(5,"async"),t.qZA(),t.YNc(6,Qo,2,0,"mat-error",17),t.YNc(7,Yo,2,0,"mat-error",17),t.qZA()}if(2&n){const e=t.MAs(3),i=t.oxw();t.xp6(1),t.Q6J("formControl",i.selectedPeer)("matAutocomplete",e),t.xp6(1),t.Q6J("displayWith",i.displayFn),t.xp6(2),t.Q6J("ngForOf",t.lcZ(5,6,i.filteredPeers)),t.xp6(2),t.Q6J("ngIf",null==i.selectedPeer.errors?null:i.selectedPeer.errors.required),t.xp6(1),t.Q6J("ngIf",null==i.selectedPeer.errors?null:i.selectedPeer.errors.notfound)}}function Ho(n,a){1&n&&t.GkF(0)}function zo(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Amount is required."),t.qZA())}function Vo(n,a){if(1&n&&(t.TgZ(0,"mat-error"),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.hij("Amount must be less than or equal to ",e.totalBalance,".")}}function Go(n,a){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.channelConnectionError)}}function Wo(n,a){if(1&n&&(t.TgZ(0,"div",36),t._UZ(1,"fa-icon",37),t.YNc(2,Go,2,1,"span",17),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faExclamationTriangle),t.xp6(1),t.Q6J("ngIf",""!==e.channelConnectionError)}}function $o(n,a){if(1&n&&(t.TgZ(0,"mat-expansion-panel",39)(1,"mat-expansion-panel-header")(2,"mat-panel-title")(3,"span"),t._uU(4,"Peer: \xa0"),t.qZA(),t.TgZ(5,"strong",40),t._uU(6),t.qZA()()(),t.TgZ(7,"div",9)(8,"div",0)(9,"div",1)(10,"h4",41),t._uU(11,"Pubkey"),t.qZA(),t.TgZ(12,"span",42),t._uU(13),t.qZA()()(),t._UZ(14,"mat-divider",43),t.TgZ(15,"div",0)(16,"div",44)(17,"h4",41),t._uU(18,"Address"),t.qZA(),t.TgZ(19,"span",45),t._uU(20),t.qZA()(),t.TgZ(21,"div",44)(22,"h4",41),t._uU(23,"State"),t.qZA(),t.TgZ(24,"span",45),t._uU(25),t.ALo(26,"titlecase"),t.qZA()()()()()),2&n){const e=t.oxw(2);t.xp6(6),t.Oqu((null==e.peer?null:e.peer.alias)||(null==e.peer?null:e.peer.nodeId)),t.xp6(7),t.Oqu(e.peer.nodeId),t.xp6(7),t.Oqu(null==e.peer?null:e.peer.address),t.xp6(5),t.Oqu(t.lcZ(26,4,null==e.peer?null:e.peer.state))}}function Xo(n,a){if(1&n&&t.YNc(0,$o,27,6,"mat-expansion-panel",38),2&n){const e=t.oxw();t.Q6J("ngIf",e.peer)}}let Ot=(()=>{class n{constructor(e,i,o,s){this.dialogRef=e,this.data=i,this.store=o,this.actions=s,this.selNode={},this.selectedPeer=new d.NI,this.faExclamationTriangle=L.eHv,this.channelConnectionError="",this.advancedTitle="Advanced Options",this.totalBalance=0,this.selectedPubkey="",this.isPrivate=!1,this.feeRate=null,this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.data.message?(this.information=this.data.message.information,this.totalBalance=this.data.message.balance,this.peer=this.data.message.peer||null,this.peers=this.data.message.peers||[]):(this.information={},this.totalBalance=0,this.peer=null,this.peers=[]),this.alertTitle=this.data.alertTitle||"Alert",this.store.select(C.LR).pipe((0,_.R)(this.unSubs[0])).subscribe(o=>{this.selNode=o,this.isPrivate=!!(null==o?void 0:o.unannouncedChannels)}),this.actions.pipe((0,_.R)(this.unSubs[1]),(0,Q.h)(o=>o.type===l.lr.UPDATE_API_CALL_STATUS_ECL||o.type===l.lr.FETCH_CHANNELS_ECL)).subscribe(o=>{o.type===l.lr.UPDATE_API_CALL_STATUS_ECL&&o.payload.status===l.Bn.ERROR&&"SaveNewChannel"===o.payload.action&&(this.channelConnectionError=o.payload.message),o.type===l.lr.FETCH_CHANNELS_ECL&&this.dialogRef.close()});let e="",i="";this.sortedPeers=this.peers.sort((o,s)=>(e=o.alias?o.alias.toLowerCase():o.nodeId?o.nodeId.toLowerCase():"",i=s.alias?s.alias.toLowerCase():o.nodeId?o.nodeId.toLowerCase():"",e<i?-1:e>i?1:0)),this.filteredPeers=this.selectedPeer.valueChanges.pipe((0,_.R)(this.unSubs[2]),(0,ko.O)(""),(0,Ft.U)(o=>"string"==typeof o?o:o.alias?o.alias:o.nodeId),(0,Ft.U)(o=>o?this.filterPeers(o):this.sortedPeers.slice()))}filterPeers(e){var i;return null===(i=this.sortedPeers)||void 0===i?void 0:i.filter(o=>{var s;return 0===(null===(s=o.alias)||void 0===s?void 0:s.toLowerCase().indexOf(e?e.toLowerCase():""))})}displayFn(e){return e&&e.alias?e.alias:e&&e.nodeId?e.nodeId:""}onSelectedPeerChanged(){var e;if(this.channelConnectionError="",this.selectedPubkey=this.selectedPeer.value&&this.selectedPeer.value.nodeId?this.selectedPeer.value.nodeId:null,"string"==typeof this.selectedPeer.value){const i=null===(e=this.peers)||void 0===e?void 0:e.filter(o=>{var s,c;return(null===(s=o.alias)||void 0===s?void 0:s.length)===this.selectedPeer.value.length&&0===(null===(c=o.alias)||void 0===c?void 0:c.toLowerCase().indexOf(this.selectedPeer.value?this.selectedPeer.value.toLowerCase():""))});1===i.length&&i[0].nodeId&&(this.selectedPubkey=i[0].nodeId)}this.selectedPeer.setErrors(this.selectedPeer.value&&!this.selectedPubkey?{notfound:!0}:null)}onClose(){this.dialogRef.close(!1)}resetData(){var e;this.feeRate=null,this.selectedPeer.setValue(""),this.fundingAmount=null,this.isPrivate=!!(null===(e=this.selNode)||void 0===e?void 0:e.unannouncedChannels),this.channelConnectionError="",this.advancedTitle="Advanced Options",this.form.resetForm()}onAdvancedPanelToggle(e){this.advancedTitle="Advanced Options",e&&this.feeRate&&this.feeRate>0&&(this.advancedTitle=this.advancedTitle+" | Fee (Sats/vByte): "+this.feeRate)}onOpenChannel(){if(!this.peer&&!this.selectedPubkey||!this.fundingAmount||this.totalBalance-this.fundingAmount<0)return!0;const e={nodeId:this.peer&&this.peer.nodeId?this.peer.nodeId:this.selectedPubkey,amount:this.fundingAmount,private:this.isPrivate};this.feeRate&&(e.feeRate=this.feeRate),this.store.dispatch((0,U.YX)({payload:e}))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(J.so),t.Y36(J.WI),t.Y36(w.yh),t.Y36(X.eX))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-open-channel"]],viewQuery:function(e,i){if(1&e&&t.Gf(Jo,7),2&e){let o;t.iGM(o=t.CRH())&&(i.form=o.first)}},decls:48,vars:18,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","11","fxFlex","5","fxLayoutAlign","center","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"padding-gap-x-large"],["fxLayout","column",3,"submit","reset"],["form","ngForm"],["fxLayout","column"],["fxFlex","100",4,"ngIf"],[4,"ngTemplateOutlet"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between center"],["fxFlex","70","fxLayoutAlign","start end"],["matInput","","placeholder","Amount","type","number","tabindex","1","required","","name","amount",3,"ngModel","step","min","max","ngModelChange"],["amount","ngModel"],["matSuffix",""],[4,"ngIf"],["fxFlex","25","fxLayoutAlign","start center"],["tabindex","2","color","primary","name","isPrivate",3,"ngModel","ngModelChange"],["expanded","false",1,"flat-expansion-panel","mt-2",3,"closed","opened"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch"],["fxFlex","100","fxLayout","row","fxLayoutAlign","space-between center"],["fxFlex","49"],["matInput","","placeholder","Fee (Sats/vByte)","type","number","name","fee","tabindex","7",3,"ngModel","step","min","ngModelChange"],["fee","ngModel"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center",1,"mt-2"],["mat-button","","color","primary","tabindex","9","type","reset",1,"mr-1"],["autoFocus","","mat-button","","color","primary","type","submit","tabindex","10"],["peerDetailsExpansionBlock",""],["type","text","placeholder","Peer Alias","aria-label","Peers","matInput","","tabindex","1","required","",3,"formControl","matAutocomplete","change"],[3,"displayWith","optionSelected"],["auto","matAutocomplete"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"],["class","flat-expansion-panel my-1","expanded","false",4,"ngIf"],["expanded","false",1,"flat-expansion-panel","my-1"],[1,"font-weight-900"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text"],[1,"w-100","my-1"],["fxFlex","50"],[1,"overflow-wrap","foreground-secondary-text"]],template:function(e,i){if(1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-header",2)(3,"div",3)(4,"span",4),t._uU(5),t.qZA()(),t.TgZ(6,"button",5),t.NdJ("click",function(){return i.onClose()}),t._uU(7,"X"),t.qZA()(),t.TgZ(8,"mat-card-content",6)(9,"form",7,8),t.NdJ("submit",function(){return i.onOpenChannel()})("reset",function(){return i.resetData()}),t.TgZ(11,"div",9),t.YNc(12,Bo,8,8,"mat-form-field",10),t.qZA(),t.YNc(13,Ho,1,0,"ng-container",11),t.TgZ(14,"div",9)(15,"div",12)(16,"mat-form-field",13)(17,"input",14,15),t.NdJ("ngModelChange",function(s){return i.fundingAmount=s}),t.qZA(),t.TgZ(19,"mat-hint"),t._uU(20),t.ALo(21,"number"),t.qZA(),t.TgZ(22,"span",16),t._uU(23," Sats "),t.qZA(),t.YNc(24,zo,2,0,"mat-error",17),t.YNc(25,Vo,2,1,"mat-error",17),t.qZA(),t.TgZ(26,"div",18)(27,"mat-slide-toggle",19),t.NdJ("ngModelChange",function(s){return i.isPrivate=s}),t._uU(28,"Private Channel"),t.qZA()()(),t.TgZ(29,"mat-expansion-panel",20),t.NdJ("closed",function(){return i.onAdvancedPanelToggle(!0)})("opened",function(){return i.onAdvancedPanelToggle(!1)}),t.TgZ(30,"mat-expansion-panel-header")(31,"mat-panel-title")(32,"span"),t._uU(33),t.qZA()()(),t.TgZ(34,"div",21)(35,"div",12)(36,"div",22)(37,"mat-form-field",23)(38,"input",24,25),t.NdJ("ngModelChange",function(s){return i.feeRate=s}),t.qZA()()()()()()(),t.YNc(40,Wo,3,2,"div",26),t.TgZ(41,"div",27)(42,"button",28),t._uU(43,"Clear Fields"),t.qZA(),t.TgZ(44,"button",29),t._uU(45,"Open Channel"),t.qZA()()()()()(),t.YNc(46,Xo,1,1,"ng-template",null,30,t.W1O)),2&e){const o=t.MAs(18),s=t.MAs(47);t.xp6(5),t.Oqu(i.alertTitle),t.xp6(7),t.Q6J("ngIf",!i.peer&&i.peers&&i.peers.length>0),t.xp6(1),t.Q6J("ngTemplateOutlet",s),t.xp6(4),t.Q6J("ngModel",i.fundingAmount)("step",1e3)("min",1)("max",i.totalBalance),t.xp6(3),t.hij("Remaining Bal: ",t.lcZ(21,16,i.totalBalance-(i.fundingAmount?i.fundingAmount:0)),""),t.xp6(4),t.Q6J("ngIf",null==o.errors?null:o.errors.required),t.xp6(1),t.Q6J("ngIf",null==o.errors?null:o.errors.max),t.xp6(2),t.Q6J("ngModel",i.isPrivate),t.xp6(6),t.Oqu(i.advancedTitle),t.xp6(5),t.Q6J("ngModel",i.feeRate)("step",1)("min",0),t.xp6(2),t.Q6J("ngIf",""!==i.channelConnectionError)}},directives:[m.xw,m.yH,b.dk,m.Wh,N.lW,b.dn,d._Y,d.JL,d.F,u.O5,y.KE,Y.Nt,d.Fj,qt.ZL,d.Q7,d.JJ,d.oH,qt.XC,u.sg,z.ey,y.TO,u.tP,d.wV,d.qQ,d.Fd,tt.q,Do.F,d.On,y.bx,y.R9,Nt.Rr,V.ib,V.yz,V.yK,q.BN,j.h,K.d],pipes:[u.Ov,u.JJ,u.rS],styles:[".open-inputs-box[_ngcontent-%COMP%]{padding:1.2rem 2.4rem .8rem!important}"]}),n})();function Ko(n,a){if(1&n&&(t.TgZ(0,"span",7),t._uU(1,"Open"),t.qZA()),2&n){const e=t.oxw();t.s9C("matBadge",e.numOfOpenChannels)}}function jo(n,a){if(1&n&&(t.TgZ(0,"span",7),t._uU(1,"Pending"),t.qZA()),2&n){const e=t.oxw();t.s9C("matBadge",e.numOfPendingChannels)}}function ts(n,a){if(1&n&&(t.TgZ(0,"span",7),t._uU(1,"Inactive"),t.qZA()),2&n){const e=t.oxw();t.s9C("matBadge",e.numOfInactiveChannels)}}let es=(()=>{class n{constructor(e,i,o){this.logger=e,this.store=i,this.router=o,this.numOfOpenChannels=0,this.numOfPendingChannels=0,this.numOfInactiveChannels=0,this.selNode={},this.information={},this.peers=[],this.totalBalance=0,this.links=[{link:"open",name:"Open"},{link:"pending",name:"Pending"},{link:"inactive",name:"Inactive"}],this.activeLink=0,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.activeLink=this.links.findIndex(e=>e.link===this.router.url.substring(this.router.url.lastIndexOf("/")+1)),this.router.events.pipe((0,_.R)(this.unSubs[0]),(0,Q.h)(e=>e instanceof x.Av)).subscribe({next:e=>{this.activeLink=this.links.findIndex(i=>i.link===e.urlAfterRedirects.substring(e.urlAfterRedirects.lastIndexOf("/")+1))}}),this.store.select(C.Xz).pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{this.numOfOpenChannels=e.channelsStatus&&e.channelsStatus.active&&e.channelsStatus.active.channels?e.channelsStatus.active.channels:0,this.numOfPendingChannels=e.channelsStatus&&e.channelsStatus.pending&&e.channelsStatus.pending.channels?e.channelsStatus.pending.channels:0,this.numOfInactiveChannels=e.channelsStatus&&e.channelsStatus.inactive&&e.channelsStatus.inactive.channels?e.channelsStatus.inactive.channels:0,this.logger.info(e)}),this.store.select(C.LR).pipe((0,_.R)(this.unSubs[2])).subscribe(e=>{this.selNode=e}),this.store.select(C.yD).pipe((0,_.R)(this.unSubs[3])).subscribe(e=>{this.information=e}),this.store.select(C.Bo).pipe((0,_.R)(this.unSubs[4])).subscribe(e=>{this.peers=e.peers}),this.store.select(C.kY).pipe((0,_.R)(this.unSubs[5])).subscribe(e=>{this.totalBalance=e.onchainBalance.total||0})}onOpenChannel(){this.store.dispatch((0,E.qR)({payload:{data:{alertTitle:"Open Channel",message:{peers:this.peers,information:this.information,balance:this.totalBalance},component:Ot}}}))}onSelectedTabChange(e){this.router.navigateByUrl("/ecl/connections/channels/"+this.links[e.index].link)}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(O.mQ),t.Y36(w.yh),t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channels-tables"]],decls:14,vars:1,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row"],["mat-flat-button","","color","primary","type","submit","tabindex","1",3,"click"],["fxLayout","column","fxFlex","100",1,"my-2","bordered-box"],[3,"selectedIndex","selectedIndexChange","selectedTabChange"],["mat-tab-label",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x-large"],["matBadgeOverlap","false",1,"tab-badge",3,"matBadge"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"button",2),t.NdJ("click",function(){return i.onOpenChannel()}),t._uU(3,"Open Channel"),t.qZA()(),t.TgZ(4,"div",3)(5,"mat-tab-group",4),t.NdJ("selectedIndexChange",function(s){return i.activeLink=s})("selectedTabChange",function(s){return i.onSelectedTabChange(s)}),t.TgZ(6,"mat-tab"),t.YNc(7,Ko,2,1,"ng-template",5),t.qZA(),t.TgZ(8,"mat-tab"),t.YNc(9,jo,2,1,"ng-template",5),t.qZA(),t.TgZ(10,"mat-tab"),t.YNc(11,ts,2,1,"ng-template",5),t.qZA()(),t.TgZ(12,"div",6),t._UZ(13,"router-outlet"),t.qZA()()()),2&e&&(t.xp6(5),t.Q6J("selectedIndex",i.activeLink))},directives:[m.xw,m.yH,m.Wh,N.lW,R.SP,R.uX,R.uD,Et.k,x.lC],styles:[""]}),n})();function ns(n,a){if(1&n&&(t.TgZ(0,"div",11)(1,"h4",12),t._uU(2,"Short Channel ID"),t.qZA(),t.TgZ(3,"span",13),t._uU(4),t.qZA()()),2&n){const e=t.oxw();t.xp6(4),t.Oqu(e.channel.shortChannelId)}}function is(n,a){if(1&n&&(t.TgZ(0,"div",11)(1,"h4",12),t._uU(2,"State"),t.qZA(),t.TgZ(3,"span",15),t._uU(4),t.ALo(5,"titlecase"),t.qZA()()),2&n){const e=t.oxw();t.xp6(4),t.Oqu(t.lcZ(5,1,e.channel.state))}}function as(n,a){if(1&n&&(t.TgZ(0,"div")(1,"div",9)(2,"div",11)(3,"h4",12),t._uU(4,"Local Balance (Sats)"),t.qZA(),t.TgZ(5,"span",15),t._uU(6),t.ALo(7,"number"),t.qZA()(),t.TgZ(8,"div",11)(9,"h4",12),t._uU(10,"Remote Balance (Sats)"),t.qZA(),t.TgZ(11,"span",15),t._uU(12),t.ALo(13,"number"),t.qZA()()(),t._UZ(14,"mat-divider",14),t.TgZ(15,"div",9)(16,"div",11)(17,"h4",12),t._uU(18,"Base Fee (mSats)"),t.qZA(),t.TgZ(19,"span",15),t._uU(20),t.ALo(21,"number"),t.qZA()(),t.TgZ(22,"div",11)(23,"h4",12),t._uU(24,"Fee Rate (mili mSats)"),t.qZA(),t.TgZ(25,"span",15),t._uU(26),t.ALo(27,"number"),t.qZA()()(),t._UZ(28,"mat-divider",14),t.qZA()),2&n){const e=t.oxw();t.xp6(6),t.Oqu(t.lcZ(7,6,e.channel.toLocal)),t.xp6(6),t.Oqu(t.lcZ(13,8,e.channel.toRemote)),t.xp6(2),t.Q6J("inset",!0),t.xp6(6),t.Oqu(t.lcZ(21,10,e.channel.feeBaseMsat)),t.xp6(6),t.Oqu(t.lcZ(27,12,e.channel.feeProportionalMillionths)),t.xp6(2),t.Q6J("inset",!0)}}function os(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Show Advanced"),t.qZA())}function ss(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Hide Advanced"),t.qZA())}function ls(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",21),t.NdJ("click",function(){return t.CHM(e),t.oxw().onShowAdvanced()}),t.YNc(1,os,2,0,"p",22),t.YNc(2,ss,2,0,"ng-template",null,23,t.W1O),t.qZA()}if(2&n){const e=t.MAs(3),i=t.oxw();t.xp6(1),t.Q6J("ngIf",!i.showAdvanced)("ngIfElse",e)}}function rs(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",24),t.NdJ("copied",function(o){return t.CHM(e),t.oxw().onCopyChanID(o)}),t._uU(1,"Copy Short Channel ID"),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("payload",e.channel.shortChannelId)}}function cs(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",25),t.NdJ("copied",function(o){return t.CHM(e),t.oxw().onCopyChanID(o)}),t._uU(1,"Copy Channel ID"),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("payload",e.channel.channelId)}}const us=function(n){return{"xs-scroll-y":n}},ps=function(n,a){return{"mt-2":n,"mt-1":a}};let mt=(()=>{class n{constructor(e,i,o,s,c){this.dialogRef=e,this.data=i,this.logger=o,this.commonService=s,this.snackBar=c,this.faReceipt=L.dLy,this.showAdvanced=!1,this.channelsType="open",this.screenSize="",this.screenSizeEnum=l.cu}ngOnInit(){this.channel=this.data.channel,this.channelsType=this.data.channelsType||"",this.screenSize=this.commonService.getScreenSize()}onClose(){this.dialogRef.close(!1)}onShowAdvanced(){this.showAdvanced=!this.showAdvanced}onCopyChanID(e){this.snackBar.open("open"===this.channelsType?"Short channel ID "+e+" copied.":"Channel ID copied."),this.logger.info("Copied Text: "+e)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(J.so),t.Y36(J.WI),t.Y36(O.mQ),t.Y36(P.v),t.Y36(wt.ux))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-information"]],decls:64,vars:28,consts:[["fxLayout","column","fxLayout.gt-sm","row","fxLayoutAlign","space-between stretch"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["tabindex","3","fxFlex","5","fxLayoutAlign","center","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"padding-gap-x-large",3,"ngClass"],["fxLayout","column"],["fxLayout","row"],["fxFlex","50",4,"ngIf"],["fxFlex","50"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text"],[1,"my-1",3,"inset"],[1,"overflow-wrap","foreground-secondary-text"],[4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center","fxFlex","100",3,"ngClass"],["mat-button","","color","primary","type","reset","tabindex","1","class","mr-1",3,"click",4,"ngIf"],["autoFocus","","mat-button","","color","primary","tabindex","2","type","submit","rtlClipboard","",3,"payload","copied",4,"ngIf"],["autoFocus","","mat-button","","color","primary","tabindex","3","type","submit","rtlClipboard","",3,"payload","copied",4,"ngIf"],["mat-button","","color","primary","type","reset","tabindex","1",1,"mr-1",3,"click"],[4,"ngIf","ngIfElse"],["hideAdvancedText",""],["autoFocus","","mat-button","","color","primary","tabindex","2","type","submit","rtlClipboard","",3,"payload","copied"],["autoFocus","","mat-button","","color","primary","tabindex","3","type","submit","rtlClipboard","",3,"payload","copied"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-header",2)(3,"div",3),t._UZ(4,"fa-icon",4),t.TgZ(5,"span",5),t._uU(6,"Channel Information"),t.qZA()(),t.TgZ(7,"button",6),t.NdJ("click",function(){return i.onClose()}),t._uU(8,"X"),t.qZA()(),t.TgZ(9,"mat-card-content",7)(10,"div",8)(11,"div",9),t.YNc(12,ns,5,1,"div",10),t.TgZ(13,"div",11)(14,"h4",12),t._uU(15,"Peer Alias"),t.qZA(),t.TgZ(16,"span",13),t._uU(17),t.qZA()(),t.YNc(18,is,6,3,"div",10),t.qZA(),t._UZ(19,"mat-divider",14),t.TgZ(20,"div",9)(21,"div",1)(22,"h4",12),t._uU(23,"Channel ID"),t.qZA(),t.TgZ(24,"span",13),t._uU(25),t.qZA()()(),t._UZ(26,"mat-divider",14),t.TgZ(27,"div",9)(28,"div",1)(29,"h4",12),t._uU(30,"Peer Public Key"),t.qZA(),t.TgZ(31,"span",13),t._uU(32),t.qZA()()(),t._UZ(33,"mat-divider",14),t.TgZ(34,"div",9)(35,"div",11)(36,"h4",12),t._uU(37,"Private"),t.qZA(),t.TgZ(38,"span",15),t._uU(39),t.qZA()(),t.TgZ(40,"div",11)(41,"h4",12),t._uU(42,"Funder"),t.qZA(),t.TgZ(43,"span",15),t._uU(44),t.qZA()()(),t._UZ(45,"mat-divider",14),t.TgZ(46,"div",9)(47,"div",11)(48,"h4",12),t._uU(49,"State"),t.qZA(),t.TgZ(50,"span",15),t._uU(51),t.ALo(52,"titlecase"),t.qZA()(),t.TgZ(53,"div",11)(54,"h4",12),t._uU(55,"Buried"),t.qZA(),t.TgZ(56,"span",15),t._uU(57),t.qZA()()(),t._UZ(58,"mat-divider",14),t.YNc(59,as,29,14,"div",16),t.TgZ(60,"div",17),t.YNc(61,ls,4,2,"button",18),t.YNc(62,rs,2,1,"button",19),t.YNc(63,cs,2,1,"button",20),t.qZA()()()()()),2&e&&(t.xp6(4),t.Q6J("icon",i.faReceipt),t.xp6(5),t.Q6J("ngClass",t.VKq(23,us,i.screenSize===i.screenSizeEnum.XS)),t.xp6(3),t.Q6J("ngIf","open"===i.channelsType),t.xp6(5),t.Oqu(i.channel.alias),t.xp6(1),t.Q6J("ngIf","open"!==i.channelsType),t.xp6(1),t.Q6J("inset",!0),t.xp6(6),t.Oqu(i.channel.channelId),t.xp6(1),t.Q6J("inset",!0),t.xp6(6),t.Oqu(i.channel.nodeId),t.xp6(1),t.Q6J("inset",!0),t.xp6(6),t.Oqu(i.channel.announceChannel?"No":"Yes"),t.xp6(5),t.Oqu(i.channel.isFunder?"Yes":"No"),t.xp6(1),t.Q6J("inset",!0),t.xp6(6),t.Oqu(t.lcZ(52,21,i.channel.state)),t.xp6(6),t.Oqu(i.channel.buried?"Yes":"No"),t.xp6(1),t.Q6J("inset",!0),t.xp6(1),t.Q6J("ngIf",i.showAdvanced&&"open"===i.channelsType),t.xp6(1),t.Q6J("ngClass",t.WLB(25,ps,!i.showAdvanced,i.showAdvanced)),t.xp6(1),t.Q6J("ngIf","open"===i.channelsType),t.xp6(1),t.Q6J("ngIf","open"===i.channelsType),t.xp6(1),t.Q6J("ngIf","open"!==i.channelsType))},directives:[m.xw,m.Wh,m.yH,b.dk,q.BN,N.lW,b.dn,u.mk,Z.oO,u.O5,K.d,j.h,It.y],pipes:[u.rS,u.JJ],styles:[""]}),n})();function ms(n,a){if(1&n&&(t.TgZ(0,"mat-option",38),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw();t.Q6J("value",e),t.xp6(1),t.Oqu(i.getLabel(e))}}function ds(n,a){1&n&&t._UZ(0,"mat-progress-bar",39)}function hs(n,a){1&n&&t._UZ(0,"th",40)}function _s(n,a){if(1&n&&(t.TgZ(0,"span",44),t._UZ(1,"fa-icon",45),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("icon",e.faEyeSlash)}}function gs(n,a){if(1&n&&(t.TgZ(0,"span",46),t._UZ(1,"fa-icon",45),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("icon",e.faEye)}}function fs(n,a){if(1&n&&(t.TgZ(0,"td",41),t.YNc(1,_s,2,1,"span",42),t.YNc(2,gs,2,1,"span",43),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Q6J("ngIf",!(null!=e&&e.announceChannel)),t.xp6(1),t.Q6J("ngIf",null==e?null:e.announceChannel)}}function Cs(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Short Channel ID"),t.qZA())}function xs(n,a){if(1&n&&(t.TgZ(0,"td",41),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null==e?null:e.shortChannelId)}}function ys(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Channel ID"),t.qZA())}const dt=function(n){return{width:n}};function vs(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,dt,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.channelId)}}function Ts(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Alias"),t.qZA())}function Ls(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,dt,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.alias)}}function bs(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Node ID"),t.qZA())}function Ss(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,dt,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function Zs(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Funder"),t.qZA())}function As(n,a){if(1&n&&(t.TgZ(0,"td",41),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null!=e&&e.isFunder?"Yes":"No")}}function Es(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Buried"),t.qZA())}function ws(n,a){if(1&n&&(t.TgZ(0,"td",41),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null!=e&&e.buried?"Yes":"No")}}function Is(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Base Fee (mSats)"),t.qZA())}function Fs(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.feeBaseMsat,"1.0-0")," ")}}function qs(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Fee Rate (mili mSats)"),t.qZA())}function Ns(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.feeProportionalMillionths,"1.0-0")," ")}}function Os(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Local Balance (Sats)"),t.qZA())}function Ps(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.toLocal,"1.0-0")," ")}}function Us(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Remote Balance (Sats)"),t.qZA())}function Rs(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.toRemote,"1.0-0")," ")}}function ks(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Fee/KW"),t.qZA())}function Ds(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.feeRatePerKw,"1.0-0")," ")}}function Js(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Balance Score"),t.qZA())}function Ms(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"div",52)(2,"mat-hint",53),t._uU(3),t.ALo(4,"number"),t.qZA()(),t._UZ(5,"mat-progress-bar",54),t.qZA()),2&n){const e=a.$implicit;t.xp6(3),t.Oqu(t.lcZ(4,2,(null==e?null:e.balancedness)||0)),t.xp6(2),t.s9C("value",null!=e&&e.toLocal&&(null==e?null:e.toLocal)>0?+(null==e?null:e.toLocal)/(+(null==e?null:e.toLocal)+ +(null==e?null:e.toRemote))*100:0)}}function Qs(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",55)(1,"div",56)(2,"mat-select",57),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",58),t.NdJ("click",function(){return t.CHM(e),t.oxw().onChannelUpdate("all")}),t._uU(5,"Update Fee Policy"),t.qZA(),t.TgZ(6,"mat-option",58),t.NdJ("click",function(){return t.CHM(e),t.oxw().onDownloadCSV()}),t._uU(7,"Download CSV"),t.qZA()()()()}}function Ys(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",59)(1,"div",56)(2,"mat-select",60),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",58),t.NdJ("click",function(o){const c=t.CHM(e).$implicit;return t.oxw().onChannelClick(c,o)}),t._uU(5,"View Info"),t.qZA(),t.TgZ(6,"mat-option",58),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw().onChannelUpdate(s)}),t._uU(7,"Update Fee Policy"),t.qZA(),t.TgZ(8,"mat-option",58),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw().onChannelClose(s,!1)}),t._uU(9,"Close Channel"),t.qZA(),t.TgZ(10,"mat-option",58),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw().onChannelClose(s,!0)}),t._uU(11,"Force Close"),t.qZA()()()()}}function Bs(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No peers connected. Add a peer in order to open a channel?."),t.qZA())}function Hs(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No channel available."),t.qZA())}function zs(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting channels..."),t.qZA())}function Vs(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.errorMessage)}}function Gs(n,a){if(1&n&&(t.TgZ(0,"td",61),t.YNc(1,Bs,2,0,"p",62),t.YNc(2,Hs,2,0,"p",62),t.YNc(3,zs,2,0,"p",62),t.YNc(4,Vs,2,1,"p",62),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",e.numPeers<1&&(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",e.numPeers>0&&(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const Ws=function(n){return{"display-none":n}};function $s(n,a){if(1&n&&t._UZ(0,"tr",63),2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,Ws,e.numPeers>0&&(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function Xs(n,a){1&n&&t._UZ(0,"tr",64)}function Ks(n,a){1&n&&t._UZ(0,"tr",65)}const js=function(){return["all"]},tl=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},el=function(){return["no_peer"]};let nl=(()=>{class n{constructor(e,i,o,s,c,h){var g,v,B,T,F,gt;this.logger=e,this.store=i,this.rtlEffects=o,this.commonService=s,this.router=c,this.camelCaseWithSpaces=h,this.faEye=L.Mdf,this.faEyeSlash=L.Aq,this.nodePageDefs=l.Xk,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="peers_channels",this.tableSetting={tableId:"open_channels",recordsPerPage:l.IV,sortBy:"alias",sortOrder:l.Pi.DESCENDING},this.totalBalance=0,this.displayedColumns=[],this.channels=new r.by([]),this.myChanPolicy={},this.information={},this.numPeers=-1,this.feeRateTypes=l.vn,this.selFilter="",this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.selFilter=(null===(B=null===(v=null===(g=this.router.getCurrentNavigation())||void 0===g?void 0:g.extras)||void 0===v?void 0:v.state)||void 0===B?void 0:B.filter)?null===(gt=null===(F=null===(T=this.router.getCurrentNavigation())||void 0===T?void 0:T.extras)||void 0===F?void 0:F.state)||void 0===gt?void 0:gt.filter:""}ngOnInit(){this.store.select(C.nF).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{var i,o;this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=(null===(i=e.pageSettings.find(s=>s.pageId===this.PAGE_ID))||void 0===i?void 0:i.tables.find(s=>s.tableId===this.tableSetting.tableId))||(null===(o=l.c3.find(s=>s.pageId===this.PAGE_ID))||void 0===o?void 0:o.tables.find(s=>s.tableId===this.tableSetting.tableId)),this.displayedColumns=this.screenSize===l.cu.XS||this.screenSize===l.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("announceChannel"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:l.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(C.Xz).pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.activeChannels=e.activeChannels,this.activeChannels.length>0&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadChannelsTable(),this.logger.info(e)}),this.store.select(C.yD).pipe((0,_.R)(this.unSubs[2])).subscribe(e=>{this.information=e}),this.store.select(C.Bo).pipe((0,_.R)(this.unSubs[3])).subscribe(e=>{this.numPeers=e.peers&&e.peers.length?e.peers.length:0}),this.store.select(C.kY).pipe((0,_.R)(this.unSubs[4])).subscribe(e=>{this.totalBalance=e.onchainBalance.total||0})}ngAfterViewInit(){this.activeChannels.length>0&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadChannelsTable()}onChannelUpdate(e){"all"!==e&&"NORMAL"!==e.state||(this.store.dispatch((0,E.c1)({payload:{data:{type:l.n_.CONFIRM,alertTitle:"Update Fee Policy",noBtnText:"Cancel",yesBtnText:"Update",message:[],titleMessage:"all"===e?"Update fee policy for all channels":"Update fee policy for Channel: "+(e.alias||e.shortChannelId?e.alias&&e.shortChannelId?e.alias+" ("+e.shortChannelId+")":e.alias?e.alias:e.shortChannelId:e.channelId),flgShowInput:!0,getInputs:[{placeholder:"Base Fee (mSats)",inputType:"number",inputValue:e&&void 0!==e.feeBaseMsat?e.feeBaseMsat:1e3,width:48},{placeholder:"Fee Rate (mili mSats)",inputType:"number",inputValue:e&&void 0!==e.feeProportionalMillionths?e.feeProportionalMillionths:100,min:1,width:48,hintFunction:this.percentHintFunction}]}}})),this.rtlEffects.closeConfirm.pipe((0,_.R)(this.unSubs[5])).subscribe(s=>{if(s){const c=s[0].inputValue,h=s[1].inputValue;let g=null;if(this.commonService.isVersionCompatible(this.information.version,"0.6.2")){let v="";"all"===e?(this.activeChannels.forEach(B=>{v=v+","+B.nodeId}),v=v.substring(1),g={baseFeeMsat:c,feeRate:h,nodeIds:v}):g={baseFeeMsat:c,feeRate:h,nodeId:e.nodeId}}else{let v="";"all"===e?(this.activeChannels.forEach(B=>{v=v+","+B.channelId}),v=v.substring(1),g={baseFeeMsat:c,feeRate:h,channelIds:v}):g={baseFeeMsat:c,feeRate:h,channelId:e.channelId}}this.store.dispatch((0,U.pW)({payload:g}))}}),this.applyFilter())}percentHintFunction(e){return(e/1e4).toString()+"%"}onChannelClose(e,i){this.store.dispatch((0,E.c1)({payload:{data:{type:l.n_.CONFIRM,alertTitle:i?"Force Close Channel":"Close Channel",titleMessage:i?"Force closing channel: "+(e.alias||e.shortChannelId?e.alias&&e.shortChannelId?e.alias+" ("+e.shortChannelId+")":e.alias?e.alias:e.shortChannelId:e.channelId):"Closing channel: "+(e.alias||e.shortChannelId?e.alias&&e.shortChannelId?e.alias+" ("+e.shortChannelId+")":e.alias?e.alias:e.shortChannelId:e.channelId),noBtnText:"Cancel",yesBtnText:i?"Force Close":"Close Channel"}}})),this.rtlEffects.closeConfirm.pipe((0,_.R)(this.unSubs[6])).subscribe(h=>{h&&this.store.dispatch((0,U.BL)({payload:{channelId:e.channelId,force:i}}))})}onChannelClick(e,i){this.store.dispatch((0,E.qR)({payload:{data:{channel:e,channelsType:"open",component:mt}}}))}applyFilter(){this.channels.filter=this.selFilter.trim().toLowerCase()}getLabel(e){const i=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(o=>o.column===e);return i?i.label?i.label:this.camelCaseWithSpaces.transform(i.column,"_"):"announceChannel"===e?"Private":this.commonService.titleCase(e)}setFilterPredicate(){this.channels.filterPredicate=(e,i)=>{let o="";switch(this.selFilterBy){case"all":o=JSON.stringify(e).toLowerCase();break;case"announceChannel":o=(null==e?void 0:e.announceChannel)?"public":"private";break;default:o=void 0===e[this.selFilterBy]?"":"string"==typeof e[this.selFilterBy]?e[this.selFilterBy].toLowerCase():"boolean"==typeof e[this.selFilterBy]?e[this.selFilterBy]?"yes":"no":e[this.selFilterBy].toString()}return o.includes(i)}}loadChannelsTable(){var e;this.channels=new r.by([...this.activeChannels]),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(i,o)=>i[o]&&isNaN(i[o])?i[o].toLocaleLowerCase():i[o]?+i[o]:null,null===(e=this.channels.sort)||void 0===e||e.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.channels.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter(),this.logger.info(this.channels)}onDownloadCSV(){this.channels.data&&this.channels.data.length>0&&this.commonService.downloadFile(this.channels.data,"ActiveChannels")}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(O.mQ),t.Y36(w.yh),t.Y36(nt.V),t.Y36(P.v),t.Y36(x.F0),t.Y36(G.i1))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-open-table"]],viewQuery:function(e,i){if(1&e&&(t.Gf(S.YE,5),t.Gf(A.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.sort=o.first),t.iGM(o=t.CRH())&&(i.paginator=o.first)}},features:[t._Bn([{provide:A.ye,useValue:(0,l.pt)("Channels")}])],decls:61,vars:16,consts:[["fxLayout","column",1,"padding-gap"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],["fxFlex","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxFlex","49"],["placeholder","Filter By","tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","announceChannel"],["mat-header-cell","","mat-sort-header","","matTooltip","Private",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","shortChannelId"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","channelId"],["matColumnDef","alias"],["matColumnDef","nodeId"],["matColumnDef","isFunder"],["matColumnDef","buried"],["matColumnDef","feeBaseMsat"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","feeProportionalMillionths"],["matColumnDef","toLocal"],["matColumnDef","toRemote"],["matColumnDef","feeRatePerKw"],["matColumnDef","balancedness"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_peer"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","matTooltip","Private"],["mat-cell",""],["class","mr-1","matTooltip","Private","matTooltipPosition","right",4,"ngIf"],["class","mr-1","matTooltip","Public","matTooltipPosition","right",4,"ngIf"],["matTooltip","Private","matTooltipPosition","right",1,"mr-1"],[3,"icon"],["matTooltip","Public","matTooltipPosition","right",1,"mr-1"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["fxLayout","row"],["fxFlex","100","fxLayoutAlign","center center",1,"font-size-80"],["mode","determinate",3,"value"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["placeholder","Actions","tabindex","2",1,"mr-0"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1),t._UZ(2,"div",2),t.TgZ(3,"div",3)(4,"mat-form-field",4)(5,"mat-select",5),t.NdJ("ngModelChange",function(s){return i.selFilterBy=s})("selectionChange",function(){return i.selFilter="",i.applyFilter()}),t.YNc(6,ms,2,2,"mat-option",6),t.qZA()(),t.TgZ(7,"mat-form-field",4)(8,"input",7),t.NdJ("ngModelChange",function(s){return i.selFilter=s})("input",function(){return i.applyFilter()})("keyup",function(){return i.applyFilter()}),t.qZA()()()(),t.TgZ(9,"div",8),t.YNc(10,ds,1,0,"mat-progress-bar",9),t.TgZ(11,"table",10,11),t.ynx(13,12),t.YNc(14,hs,1,0,"th",13),t.YNc(15,fs,3,2,"td",14),t.BQk(),t.ynx(16,15),t.YNc(17,Cs,2,0,"th",16),t.YNc(18,xs,2,1,"td",14),t.BQk(),t.ynx(19,17),t.YNc(20,ys,2,0,"th",16),t.YNc(21,vs,4,4,"td",14),t.BQk(),t.ynx(22,18),t.YNc(23,Ts,2,0,"th",16),t.YNc(24,Ls,4,4,"td",14),t.BQk(),t.ynx(25,19),t.YNc(26,bs,2,0,"th",16),t.YNc(27,Ss,4,4,"td",14),t.BQk(),t.ynx(28,20),t.YNc(29,Zs,2,0,"th",16),t.YNc(30,As,2,1,"td",14),t.BQk(),t.ynx(31,21),t.YNc(32,Es,2,0,"th",16),t.YNc(33,ws,2,1,"td",14),t.BQk(),t.ynx(34,22),t.YNc(35,Is,2,0,"th",23),t.YNc(36,Fs,4,4,"td",14),t.BQk(),t.ynx(37,24),t.YNc(38,qs,2,0,"th",23),t.YNc(39,Ns,4,4,"td",14),t.BQk(),t.ynx(40,25),t.YNc(41,Os,2,0,"th",23),t.YNc(42,Ps,4,4,"td",14),t.BQk(),t.ynx(43,26),t.YNc(44,Us,2,0,"th",23),t.YNc(45,Rs,4,4,"td",14),t.BQk(),t.ynx(46,27),t.YNc(47,ks,2,0,"th",23),t.YNc(48,Ds,4,4,"td",14),t.BQk(),t.ynx(49,28),t.YNc(50,Js,2,0,"th",16),t.YNc(51,Ms,6,4,"td",14),t.BQk(),t.ynx(52,29),t.YNc(53,Qs,8,0,"th",30),t.YNc(54,Ys,12,0,"td",31),t.BQk(),t.ynx(55,32),t.YNc(56,Gs,5,4,"td",33),t.BQk(),t.YNc(57,$s,1,3,"tr",34),t.YNc(58,Xs,1,0,"tr",35),t.YNc(59,Ks,1,0,"tr",36),t.qZA()(),t._UZ(60,"mat-paginator",37),t.qZA()),2&e&&(t.xp6(5),t.Q6J("ngModel",i.selFilterBy),t.xp6(1),t.Q6J("ngForOf",t.DdM(12,js).concat(i.displayedColumns.slice(0,-1))),t.xp6(2),t.Q6J("ngModel",i.selFilter),t.xp6(2),t.Q6J("ngIf",i.apiCallStatus.status===i.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",i.channels)("ngClass",t.VKq(13,tl,""!==i.errorMessage)),t.xp6(46),t.Q6J("matFooterRowDef",t.DdM(15,el)),t.xp6(1),t.Q6J("matHeaderRowDef",i.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumns),t.xp6(1),t.Q6J("pageSize",i.pageSize)("pageSizeOptions",i.pageSizeOptions)("showFirstLastButtons",i.screenSize!==i.screenSizeEnum.XS))},directives:[m.xw,m.Wh,m.yH,y.KE,k.gD,d.JJ,d.On,u.sg,z.ey,Y.Nt,d.Fj,H.$V,u.O5,M.pW,r.BZ,S.YE,u.mk,Z.oO,r.w1,r.fO,r.ge,S.nU,$.gM,r.Dz,r.ev,q.BN,u.PC,Z.Zl,y.bx,k.$L,r.mD,r.yh,r.Ke,r.Q2,r.as,r.XQ,r.nj,r.Gk,A.NW],pipes:[u.JJ],styles:[".mat-column-announceChannel[_ngcontent-%COMP%]{max-width:1.2rem;width:1.2rem}.mat-column-balancedness[_ngcontent-%COMP%]{padding-left:2rem;min-width:15rem;max-width:30rem}"]}),n})();function il(n,a){if(1&n&&(t.TgZ(0,"mat-option",35),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw();t.Q6J("value",e),t.xp6(1),t.Oqu(i.getLabel(e))}}function al(n,a){1&n&&t._UZ(0,"mat-progress-bar",36)}function ol(n,a){1&n&&t._UZ(0,"th",37)}function sl(n,a){if(1&n&&(t.TgZ(0,"span",41),t._UZ(1,"fa-icon",42),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("icon",e.faEyeSlash)}}function ll(n,a){if(1&n&&(t.TgZ(0,"span",43),t._UZ(1,"fa-icon",42),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("icon",e.faEye)}}function rl(n,a){if(1&n&&(t.TgZ(0,"td",38),t.YNc(1,sl,2,1,"span",39),t.YNc(2,ll,2,1,"span",40),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Q6J("ngIf",!(null!=e&&e.announceChannel)),t.xp6(1),t.Q6J("ngIf",null==e?null:e.announceChannel)}}function cl(n,a){1&n&&(t.TgZ(0,"th",44),t._uU(1,"State"),t.qZA())}function ul(n,a){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.ALo(2,"titlecase"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,null==e?null:e.state))}}function pl(n,a){1&n&&(t.TgZ(0,"th",44),t._uU(1,"Channel ID"),t.qZA())}const Pt=function(n){return{width:n}};function ml(n,a){if(1&n&&(t.TgZ(0,"td",38)(1,"div",45)(2,"span",46),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Pt,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.channelId)}}function dl(n,a){1&n&&(t.TgZ(0,"th",44),t._uU(1,"Alias"),t.qZA())}function hl(n,a){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null==e?null:e.alias)}}function _l(n,a){1&n&&(t.TgZ(0,"th",44),t._uU(1,"Node ID"),t.qZA())}function gl(n,a){if(1&n&&(t.TgZ(0,"td",38)(1,"div",45)(2,"span",46),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Pt,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function fl(n,a){1&n&&(t.TgZ(0,"th",44),t._uU(1,"Funder"),t.qZA())}function Cl(n,a){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null!=e&&e.isFunder?"Yes":"No")}}function xl(n,a){1&n&&(t.TgZ(0,"th",44),t._uU(1,"Buried"),t.qZA())}function yl(n,a){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null!=e&&e.buried?"Yes":"No")}}function vl(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Local Balance (Sats)"),t.qZA())}function Tl(n,a){if(1&n&&(t.TgZ(0,"td",38)(1,"span",48),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.toLocal,"1.0-0")," ")}}function Ll(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Remote Balance (Sats)"),t.qZA())}function bl(n,a){if(1&n&&(t.TgZ(0,"td",38)(1,"span",48),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.toRemote,"1.0-0")," ")}}function Sl(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Fee/KW"),t.qZA())}function Zl(n,a){if(1&n&&(t.TgZ(0,"td",38)(1,"span",48),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.feeRatePerKw,"1.0-0")," ")}}function Al(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",49)(1,"div",50)(2,"mat-select",51),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",52),t.NdJ("click",function(){return t.CHM(e),t.oxw().onDownloadCSV()}),t._uU(5,"Download CSV"),t.qZA()()()()}}function El(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",53)(1,"button",54),t.NdJ("click",function(o){const c=t.CHM(e).$implicit;return t.oxw().onChannelClick(c,o)}),t._uU(2,"View Info"),t.qZA()()}}function wl(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No pending channel available."),t.qZA())}function Il(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting pending channels..."),t.qZA())}function Fl(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.errorMessage)}}function ql(n,a){if(1&n&&(t.TgZ(0,"td",55),t.YNc(1,wl,2,0,"p",56),t.YNc(2,Il,2,0,"p",56),t.YNc(3,Fl,2,1,"p",56),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const Nl=function(n){return{"display-none":n}};function Ol(n,a){if(1&n&&t._UZ(0,"tr",57),2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,Nl,(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function Pl(n,a){1&n&&t._UZ(0,"tr",58)}function Ul(n,a){1&n&&t._UZ(0,"tr",59)}const Rl=function(){return["all"]},kl=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},Dl=function(){return["no_channel"]};let Jl=(()=>{class n{constructor(e,i,o,s){this.logger=e,this.store=i,this.commonService=o,this.camelCaseWithSpaces=s,this.faEye=L.Mdf,this.faEyeSlash=L.Aq,this.nodePageDefs=l.Xk,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="peers_channels",this.tableSetting={tableId:"pending_channels",recordsPerPage:l.IV,sortBy:"alias",sortOrder:l.Pi.DESCENDING},this.totalBalance=0,this.displayedColumns=[],this.channels=new r.by([]),this.myChanPolicy={},this.information={},this.numPeers=-1,this.feeRateTypes=l.vn,this.selFilter="",this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(C.nF).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{var i,o;this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=(null===(i=e.pageSettings.find(s=>s.pageId===this.PAGE_ID))||void 0===i?void 0:i.tables.find(s=>s.tableId===this.tableSetting.tableId))||(null===(o=l.c3.find(s=>s.pageId===this.PAGE_ID))||void 0===o?void 0:o.tables.find(s=>s.tableId===this.tableSetting.tableId)),this.displayedColumns=this.screenSize===l.cu.XS||this.screenSize===l.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("announceChannel"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:l.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(C.Xz).pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.pendingChannels=e.pendingChannels,this.loadChannelsTable(),this.logger.info(e)}),this.store.select(C.yD).pipe((0,_.R)(this.unSubs[2])).subscribe(e=>{this.information=e}),this.store.select(C.Bo).pipe((0,_.R)(this.unSubs[3])).subscribe(e=>{this.numPeers=e.peers&&e.peers.length?e.peers.length:0}),this.store.select(C.kY).pipe((0,_.R)(this.unSubs[4])).subscribe(e=>{this.totalBalance=e.onchainBalance.total||0})}ngAfterViewInit(){this.pendingChannels.length>0&&this.loadChannelsTable()}onChannelClick(e,i){this.store.dispatch((0,E.qR)({payload:{data:{channel:e,channelsType:"pending",component:mt}}}))}applyFilter(){this.channels.filter=this.selFilter.trim().toLowerCase()}getLabel(e){const i=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(o=>o.column===e);return i?i.label?i.label:this.camelCaseWithSpaces.transform(i.column,"_"):"announceChannel"===e?"Private":this.commonService.titleCase(e)}setFilterPredicate(){this.channels.filterPredicate=(e,i)=>{let o="";switch(this.selFilterBy){case"all":o=JSON.stringify(e).toLowerCase();break;case"announceChannel":o=(null==e?void 0:e.announceChannel)?"public":"private";break;default:o=void 0===e[this.selFilterBy]?"":"string"==typeof e[this.selFilterBy]?e[this.selFilterBy].toLowerCase():"boolean"==typeof e[this.selFilterBy]?e[this.selFilterBy]?"yes":"no":e[this.selFilterBy].toString()}return o.includes(i)}}loadChannelsTable(){var e;this.channels=new r.by([...this.pendingChannels]),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(i,o)=>i[o]&&isNaN(i[o])?i[o].toLocaleLowerCase():i[o]?+i[o]:null,null===(e=this.channels.sort)||void 0===e||e.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.channels.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter(),this.logger.info(this.channels)}onDownloadCSV(){this.channels.data&&this.channels.data.length>0&&this.commonService.downloadFile(this.channels.data,"PendingChannels")}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(O.mQ),t.Y36(w.yh),t.Y36(P.v),t.Y36(G.i1))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-pending-table"]],viewQuery:function(e,i){if(1&e&&(t.Gf(S.YE,5),t.Gf(A.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.sort=o.first),t.iGM(o=t.CRH())&&(i.paginator=o.first)}},features:[t._Bn([{provide:A.ye,useValue:(0,l.pt)("Channels")}])],decls:52,vars:16,consts:[["fxLayout","column",1,"padding-gap"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],["fxFlex","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxFlex","49"],["placeholder","Filter By","tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","announceChannel"],["mat-header-cell","","mat-sort-header","","matTooltip","Private",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","state"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","channelId"],["matColumnDef","alias"],["matColumnDef","nodeId"],["matColumnDef","isFunder"],["matColumnDef","buried"],["matColumnDef","toLocal"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","toRemote"],["matColumnDef","feeRatePerKw"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_channel"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","matTooltip","Private"],["mat-cell",""],["class","mr-1","matTooltip","Private","matTooltipPosition","right",4,"ngIf"],["class","mr-1","matTooltip","Public","matTooltipPosition","right",4,"ngIf"],["matTooltip","Private","matTooltipPosition","right",1,"mr-1"],[3,"icon"],["matTooltip","Public","matTooltipPosition","right",1,"mr-1"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","4",1,"table-actions-button",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1),t._UZ(2,"div",2),t.TgZ(3,"div",3)(4,"mat-form-field",4)(5,"mat-select",5),t.NdJ("ngModelChange",function(s){return i.selFilterBy=s})("selectionChange",function(){return i.selFilter="",i.applyFilter()}),t.YNc(6,il,2,2,"mat-option",6),t.qZA()(),t.TgZ(7,"mat-form-field",4)(8,"input",7),t.NdJ("ngModelChange",function(s){return i.selFilter=s})("input",function(){return i.applyFilter()})("keyup",function(){return i.applyFilter()}),t.qZA()()()(),t.TgZ(9,"div",8),t.YNc(10,al,1,0,"mat-progress-bar",9),t.TgZ(11,"table",10,11),t.ynx(13,12),t.YNc(14,ol,1,0,"th",13),t.YNc(15,rl,3,2,"td",14),t.BQk(),t.ynx(16,15),t.YNc(17,cl,2,0,"th",16),t.YNc(18,ul,3,3,"td",14),t.BQk(),t.ynx(19,17),t.YNc(20,pl,2,0,"th",16),t.YNc(21,ml,4,4,"td",14),t.BQk(),t.ynx(22,18),t.YNc(23,dl,2,0,"th",16),t.YNc(24,hl,2,1,"td",14),t.BQk(),t.ynx(25,19),t.YNc(26,_l,2,0,"th",16),t.YNc(27,gl,4,4,"td",14),t.BQk(),t.ynx(28,20),t.YNc(29,fl,2,0,"th",16),t.YNc(30,Cl,2,1,"td",14),t.BQk(),t.ynx(31,21),t.YNc(32,xl,2,0,"th",16),t.YNc(33,yl,2,1,"td",14),t.BQk(),t.ynx(34,22),t.YNc(35,vl,2,0,"th",23),t.YNc(36,Tl,4,4,"td",14),t.BQk(),t.ynx(37,24),t.YNc(38,Ll,2,0,"th",23),t.YNc(39,bl,4,4,"td",14),t.BQk(),t.ynx(40,25),t.YNc(41,Sl,2,0,"th",23),t.YNc(42,Zl,4,4,"td",14),t.BQk(),t.ynx(43,26),t.YNc(44,Al,6,0,"th",27),t.YNc(45,El,3,0,"td",28),t.BQk(),t.ynx(46,29),t.YNc(47,ql,4,3,"td",30),t.BQk(),t.YNc(48,Ol,1,3,"tr",31),t.YNc(49,Pl,1,0,"tr",32),t.YNc(50,Ul,1,0,"tr",33),t.qZA()(),t._UZ(51,"mat-paginator",34),t.qZA()),2&e&&(t.xp6(5),t.Q6J("ngModel",i.selFilterBy),t.xp6(1),t.Q6J("ngForOf",t.DdM(12,Rl).concat(i.displayedColumns.slice(0,-1))),t.xp6(2),t.Q6J("ngModel",i.selFilter),t.xp6(2),t.Q6J("ngIf",i.apiCallStatus.status===i.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",i.channels)("ngClass",t.VKq(13,kl,""!==i.errorMessage)),t.xp6(37),t.Q6J("matFooterRowDef",t.DdM(15,Dl)),t.xp6(1),t.Q6J("matHeaderRowDef",i.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumns),t.xp6(1),t.Q6J("pageSize",i.pageSize)("pageSizeOptions",i.pageSizeOptions)("showFirstLastButtons",i.screenSize!==i.screenSizeEnum.XS))},directives:[m.xw,m.Wh,m.yH,y.KE,k.gD,d.JJ,d.On,u.sg,z.ey,Y.Nt,d.Fj,H.$V,u.O5,M.pW,r.BZ,S.YE,u.mk,Z.oO,r.w1,r.fO,r.ge,S.nU,$.gM,r.Dz,r.ev,q.BN,u.PC,Z.Zl,k.$L,N.lW,r.mD,r.yh,r.Ke,r.Q2,r.as,r.XQ,r.nj,r.Gk,A.NW],pipes:[u.rS,u.JJ],styles:[".mat-column-announceChannel[_ngcontent-%COMP%]{max-width:1.2rem;width:1.2rem}"]}),n})();var ht=f(5615);const Ml=["peersForm"],Ql=["stepper"];function Yl(n,a){if(1&n&&t._uU(0),2&n){const e=t.oxw();t.Oqu(e.peerFormLabel)}}function Bl(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Address is required."),t.qZA())}function Hl(n,a){if(1&n&&(t.TgZ(0,"div",32),t._UZ(1,"fa-icon",33),t.TgZ(2,"span"),t._uU(3),t.qZA()()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faExclamationTriangle),t.xp6(2),t.Oqu(e.peerConnectionError)}}function zl(n,a){if(1&n&&t._uU(0),2&n){const e=t.oxw();t.Oqu(e.channelFormLabel)}}function Vl(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Amount is required."),t.qZA())}function Gl(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Amount must be a positive number."),t.qZA())}function Wl(n,a){if(1&n&&(t.TgZ(0,"mat-error"),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.hij("Amount must be less than or equal to ",e.totalBalance,".")}}function $l(n,a){if(1&n&&(t.TgZ(0,"div",32),t._UZ(1,"fa-icon",33),t.TgZ(2,"span"),t._uU(3),t.qZA()()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faExclamationTriangle),t.xp6(2),t.Oqu(e.channelConnectionError)}}let Xl=(()=>{class n{constructor(e,i,o,s,c,h){this.dialogRef=e,this.data=i,this.store=o,this.formBuilder=s,this.actions=c,this.logger=h,this.faExclamationTriangle=L.eHv,this.selNode={},this.peerAddress="",this.totalBalance=0,this.flgChannelOpened=!1,this.channelOpenStatus=null,this.newlyAddedPeer=null,this.flgEditable=!0,this.peerConnectionError="",this.channelConnectionError="",this.peerFormLabel="Peer Details",this.channelFormLabel="Open Channel (Optional)",this.unSubs=[new p.x,new p.x]}ngOnInit(){var e;this.data.message?(this.totalBalance=this.data.message.balance,this.peerAddress=this.data.message.peer&&this.data.message.peer.nodeId&&this.data.message.peer.address?this.data.message.peer.nodeId+"@"+this.data.message.peer.address:this.data.message.peer&&this.data.message.peer.nodeId&&!this.data.message.peer.address?this.data.message.peer.nodeId:""):(this.totalBalance=0,this.peerAddress=""),this.peerFormGroup=this.formBuilder.group({hiddenAddress:["",[d.kI.required]],peerAddress:[this.peerAddress,[d.kI.required]]}),this.channelFormGroup=this.formBuilder.group({fundingAmount:["",[d.kI.required,d.kI.min(1),d.kI.max(this.totalBalance)]],isPrivate:[!!(null===(e=this.selNode)||void 0===e?void 0:e.unannouncedChannels)],feeRate:[null],hiddenAmount:["",[d.kI.required]]}),this.statusFormGroup=this.formBuilder.group({}),this.store.select(C.LR).pipe((0,_.R)(this.unSubs[0])).subscribe(i=>{this.selNode=i,this.channelFormGroup.controls.isPrivate.setValue(!!(null==i?void 0:i.unannouncedChannels))}),this.actions.pipe((0,_.R)(this.unSubs[1]),(0,Q.h)(i=>i.type===l.lr.NEWLY_ADDED_PEER_ECL||i.type===l.lr.FETCH_CHANNELS_ECL||i.type===l.lr.UPDATE_API_CALL_STATUS_ECL)).subscribe(i=>{i.type===l.lr.NEWLY_ADDED_PEER_ECL&&(this.logger.info(i.payload),this.flgEditable=!1,this.newlyAddedPeer=i.payload.peer,this.peerFormGroup.controls.hiddenAddress.setValue(this.peerFormGroup.controls.peerAddress.value),this.stepper.next()),i.type===l.lr.FETCH_CHANNELS_ECL&&this.dialogRef.close(),i.type===l.lr.UPDATE_API_CALL_STATUS_ECL&&i.payload.status===l.Bn.ERROR&&("SaveNewPeer"===i.payload.action?this.peerConnectionError=i.payload.message:"SaveNewChannel"===i.payload.action&&(this.channelConnectionError=i.payload.message))})}onConnectPeer(){if(!this.peerFormGroup.controls.peerAddress.value)return!0;this.peerConnectionError="",this.store.dispatch((0,U.El)({payload:{id:this.peerFormGroup.controls.peerAddress.value}}))}onOpenChannel(){var e;if(!this.channelFormGroup.controls.fundingAmount.value||this.totalBalance-this.channelFormGroup.controls.fundingAmount.value<0)return!0;this.channelConnectionError="",this.store.dispatch((0,U.YX)({payload:{nodeId:null===(e=this.newlyAddedPeer)||void 0===e?void 0:e.nodeId,amount:this.channelFormGroup.controls.fundingAmount.value,private:this.channelFormGroup.controls.isPrivate.value,feeRate:this.channelFormGroup.controls.feeRate.value}}))}onClose(){this.dialogRef.close(!1)}stepSelectionChanged(e){var i,o,s,c;switch(e.selectedIndex){case 0:default:this.peerFormLabel="Peer Details",this.channelFormLabel="Open Channel (Optional)";break;case 1:this.peerFormLabel=this.peerFormGroup.controls.peerAddress.value?"Peer Added: "+((null===(i=this.newlyAddedPeer)||void 0===i?void 0:i.alias)?this.newlyAddedPeer.alias:null===(o=this.newlyAddedPeer)||void 0===o?void 0:o.nodeId):"Peer Details",this.channelFormLabel="Open Channel (Optional)";break;case 2:this.peerFormLabel=this.peerFormGroup.controls.peerAddress.value?"Peer Added: "+((null===(s=this.newlyAddedPeer)||void 0===s?void 0:s.alias)?this.newlyAddedPeer.alias:null===(c=this.newlyAddedPeer)||void 0===c?void 0:c.nodeId):"Peer Details",this.channelFormLabel=this.channelFormGroup.controls.fundingAmount.value?"Opening Channel for "+this.channelFormGroup.controls.fundingAmount.value+" Sats":"Open Channel (Optional)"}e.selectedIndex<e.previouslySelectedIndex&&(0===e.selectedIndex?this.peerFormGroup.controls.hiddenAddress.setValue(""):1===e.selectedIndex&&this.channelFormGroup.controls.hiddenAmount.setValue(""))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(J.so),t.Y36(J.WI),t.Y36(w.yh),t.Y36(d.qu),t.Y36(X.eX),t.Y36(O.mQ))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-connect-peer"]],viewQuery:function(e,i){if(1&e&&(t.Gf(Ml,5),t.Gf(Ql,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.form=o.first),t.iGM(o=t.CRH())&&(i.stepper=o.first)}},decls:48,vars:20,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","8","fxFlex","5","fxLayoutAlign","center","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"padding-gap-x-large"],["fxLayout","column"],[3,"linear","selectionChange"],["stepper",""],[3,"stepControl","editable"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","start","fxLayoutAlign.gt-sm","space-between",1,"my-1",3,"formGroup"],["matStepLabel",""],["autoFocus","","matInput","","placeholder","Lightning Address (pubkey OR pubkey@ip:port)","formControlName","peerAddress","tabindex","1","required",""],[4,"ngIf"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"mt-2"],["mat-button","","color","primary","tabindex","3","type","button",3,"click"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","start","fxLayoutAlign.gt-sm","space-between",1,"mb-1",3,"formGroup"],["matStepLabel","","disabled","true"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between center"],["fxFlex","30","fxLayoutAlign","start end"],["matInput","","autoFocus","","formControlName","fundingAmount","placeholder","Amount","type","number","tabindex","1","required","",3,"step"],["matSuffix",""],["fxFlex","30"],["matInput","","formControlName","feeRate","placeholder","Fee (Sats/vByte)","type","number","name","feeRate","tabindex","7",3,"step","min"],["fxFlex","35","fxLayoutAlign","start center"],["tabindex","2","color","primary","formControlName","isPrivate","name","isPrivate"],["mat-button","","color","primary","tabindex","8","type","button",3,"click"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center"],["mat-button","","color","primary","tabindex","12","type","button","default","",3,"click"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-header",2)(3,"div",3)(4,"span",4),t._uU(5,"Connect to a new peer"),t.qZA()(),t.TgZ(6,"button",5),t.NdJ("click",function(){return i.onClose()}),t._uU(7,"X"),t.qZA()(),t.TgZ(8,"mat-card-content",6)(9,"div",7)(10,"mat-vertical-stepper",8,9),t.NdJ("selectionChange",function(s){return i.stepSelectionChanged(s)}),t.TgZ(12,"mat-step",10)(13,"form",11),t.YNc(14,Yl,1,1,"ng-template",12),t.TgZ(15,"mat-form-field",1),t._UZ(16,"input",13),t.YNc(17,Bl,2,0,"mat-error",14),t.qZA(),t.YNc(18,Hl,4,2,"div",15),t.TgZ(19,"div",16)(20,"button",17),t.NdJ("click",function(){return i.onConnectPeer()}),t._uU(21),t.qZA()()()(),t.TgZ(22,"mat-step",10)(23,"form",18),t.YNc(24,zl,1,1,"ng-template",19),t.TgZ(25,"div",20)(26,"div",21)(27,"mat-form-field",22),t._UZ(28,"input",23),t.TgZ(29,"mat-hint"),t._uU(30),t.qZA(),t.TgZ(31,"span",24),t._uU(32," Sats "),t.qZA(),t.YNc(33,Vl,2,0,"mat-error",14),t.YNc(34,Gl,2,0,"mat-error",14),t.YNc(35,Wl,2,1,"mat-error",14),t.qZA(),t.TgZ(36,"mat-form-field",25),t._UZ(37,"input",26),t.qZA(),t.TgZ(38,"div",27)(39,"mat-slide-toggle",28),t._uU(40,"Private Channel"),t.qZA()()()(),t.YNc(41,$l,4,2,"div",15),t.TgZ(42,"div",16)(43,"button",29),t.NdJ("click",function(){return i.onOpenChannel()}),t._uU(44),t.qZA()()()()(),t.TgZ(45,"div",30)(46,"button",31),t.NdJ("click",function(){return i.onClose()}),t._uU(47),t.qZA()()()()()()),2&e&&(t.xp6(10),t.Q6J("linear",!0),t.xp6(2),t.Q6J("stepControl",i.peerFormGroup)("editable",i.flgEditable),t.xp6(1),t.Q6J("formGroup",i.peerFormGroup),t.xp6(4),t.Q6J("ngIf",null==i.peerFormGroup.controls.peerAddress.errors?null:i.peerFormGroup.controls.peerAddress.errors.required),t.xp6(1),t.Q6J("ngIf",""!==i.peerConnectionError),t.xp6(3),t.Oqu(""!==i.peerConnectionError?"Retry":"Add Peer"),t.xp6(1),t.Q6J("stepControl",i.channelFormGroup)("editable",i.flgEditable),t.xp6(1),t.Q6J("formGroup",i.channelFormGroup),t.xp6(5),t.Q6J("step",1e3),t.xp6(2),t.hij("Remaining Bal: ",i.totalBalance-(i.channelFormGroup.controls.fundingAmount.value?i.channelFormGroup.controls.fundingAmount.value:0),""),t.xp6(3),t.Q6J("ngIf",null==i.channelFormGroup.controls.fundingAmount.errors?null:i.channelFormGroup.controls.fundingAmount.errors.required),t.xp6(1),t.Q6J("ngIf",null==i.channelFormGroup.controls.fundingAmount.errors?null:i.channelFormGroup.controls.fundingAmount.errors.min),t.xp6(1),t.Q6J("ngIf",null==i.channelFormGroup.controls.fundingAmount.errors?null:i.channelFormGroup.controls.fundingAmount.errors.max),t.xp6(2),t.Q6J("step",1)("min",0),t.xp6(4),t.Q6J("ngIf",""!==i.channelConnectionError),t.xp6(3),t.Oqu(""!==i.channelConnectionError?"Retry":"Open Channel"),t.xp6(3),t.Oqu(null!=i.newlyAddedPeer&&i.newlyAddedPeer.nodeId?"Do It Later":"Close"))},directives:[m.xw,m.yH,b.dk,m.Wh,N.lW,b.dn,ht.Vq,ht.C0,d._Y,d.JL,d.sg,ht.VY,y.KE,Y.Nt,d.Fj,j.h,d.JJ,d.u,d.Q7,u.O5,y.TO,q.BN,d.wV,y.bx,y.R9,d.qQ,tt.q,Nt.Rr],styles:[""]}),n})();function Kl(n,a){if(1&n&&(t.TgZ(0,"mat-option",35),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw();t.Q6J("value",e),t.xp6(1),t.Oqu(i.getLabel(e))}}function jl(n,a){1&n&&t._UZ(0,"mat-progress-bar",36)}function tr(n,a){1&n&&t._UZ(0,"th",37)}const Ut=function(n){return{"mr-0":n}};function er(n,a){if(1&n&&t._UZ(0,"span",41),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,Ut,e.screenSize===e.screenSizeEnum.XS))}}function nr(n,a){if(1&n&&t._UZ(0,"span",42),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,Ut,e.screenSize===e.screenSizeEnum.XS))}}function ir(n,a){if(1&n&&(t.TgZ(0,"td",38),t.YNc(1,er,1,3,"span",39),t.YNc(2,nr,1,3,"span",40),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Q6J("ngIf","CONNECTED"===e.state),t.xp6(1),t.Q6J("ngIf","DISCONNECTED"===e.state)}}function ar(n,a){1&n&&(t.TgZ(0,"th",43),t._uU(1,"Alias"),t.qZA())}const Rt=function(n){return{width:n}};function or(n,a){if(1&n&&(t.TgZ(0,"td",38)(1,"div",44)(2,"span",45),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Rt,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.alias)}}function sr(n,a){1&n&&(t.TgZ(0,"th",43),t._uU(1,"Node ID"),t.qZA())}function lr(n,a){if(1&n&&(t.TgZ(0,"td",38)(1,"div",44)(2,"span",45),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Rt,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function rr(n,a){1&n&&(t.TgZ(0,"th",43),t._uU(1,"Network Address"),t.qZA())}function cr(n,a){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.hij(" ",null==e?null:e.address," ")}}function ur(n,a){1&n&&(t.TgZ(0,"th",43),t._uU(1,"Channels"),t.qZA())}function pr(n,a){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null==e?null:e.channels)}}function mr(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",46)(1,"div",47)(2,"mat-select",48),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",49),t.NdJ("click",function(){return t.CHM(e),t.oxw().onDownloadCSV()}),t._uU(5,"Download CSV"),t.qZA()()()()}}function dr(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mat-option",49),t.NdJ("click",function(){t.CHM(e);const o=t.oxw().$implicit;return t.oxw().onPeerDetach(o)}),t._uU(1,"Disconnect"),t.qZA()}}function hr(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mat-option",49),t.NdJ("click",function(){t.CHM(e);const o=t.oxw().$implicit;return t.oxw().onConnectPeer(o)}),t._uU(1,"Reconnect"),t.qZA()}}function _r(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",50)(1,"div",47)(2,"mat-select",48),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",49),t.NdJ("click",function(o){const c=t.CHM(e).$implicit;return t.oxw().onPeerClick(c,o)}),t._uU(5,"View Info"),t.qZA(),t.TgZ(6,"mat-option",49),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw().onOpenChannel(s)}),t._uU(7,"Open Channel"),t.qZA(),t.YNc(8,dr,2,0,"mat-option",51),t.YNc(9,hr,2,0,"mat-option",51),t.qZA()()()}if(2&n){const e=a.$implicit;t.xp6(8),t.Q6J("ngIf","CONNECTED"===e.state),t.xp6(1),t.Q6J("ngIf","DISCONNECTED"===e.state)}}function gr(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No connected peer."),t.qZA())}function fr(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting peers..."),t.qZA())}function Cr(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.errorMessage)}}function xr(n,a){if(1&n&&(t.TgZ(0,"td",52),t.YNc(1,gr,2,0,"p",53),t.YNc(2,fr,2,0,"p",53),t.YNc(3,Cr,2,1,"p",53),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",(!(null!=e.peers&&e.peers.data)||(null==e.peers||null==e.peers.data?null:e.peers.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.peers&&e.peers.data)||(null==e.peers||null==e.peers.data?null:e.peers.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.peers&&e.peers.data)||(null==e.peers||null==e.peers.data?null:e.peers.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const yr=function(n){return{"display-none":n}};function vr(n,a){if(1&n&&t._UZ(0,"tr",54),2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,yr,(null==e.peers?null:e.peers.data)&&(null==e.peers||null==e.peers.data?null:e.peers.data.length)>0))}}function Tr(n,a){1&n&&t._UZ(0,"tr",55)}function Lr(n,a){1&n&&t._UZ(0,"tr",56)}const br=function(){return["all"]},Sr=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},Zr=function(){return["no_peer"]};let Ar=(()=>{class n{constructor(e,i,o,s,c,h){this.logger=e,this.store=i,this.rtlEffects=o,this.actions=s,this.commonService=c,this.camelCaseWithSpaces=h,this.nodePageDefs=l.Xk,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="peers_channels",this.tableSetting={tableId:"peers",recordsPerPage:l.IV,sortBy:"alias",sortOrder:l.Pi.DESCENDING},this.faUsers=L.FVb,this.newlyAddedPeer="",this.displayedColumns=[],this.peerAddress="",this.peersData=[],this.peers=new r.by([]),this.information={},this.availableBalance=0,this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.selFilter="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(C.yD).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{this.information=e}),this.store.select(C.nF).pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{var i,o;this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=(null===(i=e.pageSettings.find(s=>s.pageId===this.PAGE_ID))||void 0===i?void 0:i.tables.find(s=>s.tableId===this.tableSetting.tableId))||(null===(o=l.c3.find(s=>s.pageId===this.PAGE_ID))||void 0===o?void 0:o.tables.find(s=>s.tableId===this.tableSetting.tableId)),this.displayedColumns=this.screenSize===l.cu.XS||this.screenSize===l.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("state"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:l.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(C.Bo).pipe((0,_.R)(this.unSubs[2])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.peersData=e.peers,this.loadPeersTable(this.peersData),this.logger.info(e)}),this.store.select(C.kY).pipe((0,_.R)(this.unSubs[3])).subscribe(e=>{this.availableBalance=e.onchainBalance.total||0}),this.actions.pipe((0,_.R)(this.unSubs[4]),(0,Q.h)(e=>e.type===l.lr.SET_PEERS_ECL)).subscribe(e=>{this.peerAddress=null})}ngAfterViewInit(){this.peersData.length>0&&this.loadPeersTable(this.peersData)}onPeerClick(e,i){const o=[[{key:"nodeId",value:e.nodeId,title:"Public Key",width:100}],[{key:"address",value:e.address,title:"Address",width:50},{key:"alias",value:e.alias,title:"Alias",width:50}],[{key:"state",value:this.commonService.titleCase(e.state||""),title:"State",width:50},{key:"channels",value:e.channels,title:"Channels",width:50}]];this.store.dispatch((0,E.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:"Peer Information",showQRName:"Public Key",showQRField:e.nodeId,message:o}}}))}onConnectPeer(e){this.store.dispatch((0,E.qR)({payload:{data:{message:{peer:e.nodeId?e:null,information:this.information,balance:this.availableBalance},component:Xl}}}))}onOpenChannel(e){this.store.dispatch((0,E.qR)({payload:{data:{alertTitle:"Open Channel",message:{peer:e,information:this.information,balance:this.availableBalance},newlyAdded:!1,component:Ot}}}))}onPeerDetach(e){this.store.dispatch(e&&e.channels&&e.channels>0?(0,E.qR)({payload:{data:{type:l.n_.ERROR,alertTitle:"Disconnect Not Allowed",titleMessage:"Channel active with this peer."}}}):(0,E.c1)({payload:{data:{type:l.n_.CONFIRM,alertTitle:"Disconnect Peer",titleMessage:"Disconnect peer: "+(e.alias?e.alias:e.nodeId),noBtnText:"Cancel",yesBtnText:"Disconnect"}}})),this.rtlEffects.closeConfirm.pipe((0,_.R)(this.unSubs[5])).subscribe(i=>{i&&this.store.dispatch((0,U.GD)({payload:{nodeId:e.nodeId||""}}))})}applyFilter(){this.peers.filter=this.selFilter.trim().toLowerCase()}getLabel(e){const i=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(o=>o.column===e);return i?i.label?i.label:this.camelCaseWithSpaces.transform(i.column,"_"):this.commonService.titleCase(e)}setFilterPredicate(){this.peers.filterPredicate=(e,i)=>{var o;let s="";switch(this.selFilterBy){case"all":s=JSON.stringify(e).toLowerCase();break;case"state":s=(null===(o=null==e?void 0:e.state)||void 0===o?void 0:o.toLowerCase())||"";break;default:s=void 0===e[this.selFilterBy]?"":"string"==typeof e[this.selFilterBy]?e[this.selFilterBy].toLowerCase():"boolean"==typeof e[this.selFilterBy]?e[this.selFilterBy]?"yes":"no":e[this.selFilterBy].toString()}return"state"===this.selFilterBy?0===s.indexOf(i):s.includes(i)}}loadPeersTable(e){var i;this.peers=new r.by(e?[...e]:[]),this.peers.sort=this.sort,this.peers.sortingDataAccessor=(o,s)=>o[s]&&isNaN(o[s])?o[s].toLocaleLowerCase():o[s]?+o[s]:null,null===(i=this.peers.sort)||void 0===i||i.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.peers.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter()}onDownloadCSV(){this.peers.data&&this.peers.data.length>0&&this.commonService.downloadFile(this.peers.data,"Peers")}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(O.mQ),t.Y36(w.yh),t.Y36(nt.V),t.Y36(X.eX),t.Y36(P.v),t.Y36(G.i1))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-peers"]],viewQuery:function(e,i){if(1&e&&(t.Gf(S.YE,5),t.Gf(A.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.sort=o.first),t.iGM(o=t.CRH())&&(i.paginator=o.first)}},features:[t._Bn([{provide:A.ye,useValue:(0,l.pt)("Peers")}])],decls:45,vars:17,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap"],["peersForm","ngForm"],["mat-flat-button","","color","primary","type","submit","tabindex","1",3,"click"],["fxLayout","column"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxFlex","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxFlex","49"],["placeholder","Filter By","tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","state"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","State",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","alias"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","nodeId"],["matColumnDef","address"],["matColumnDef","channels"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_peer"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","State"],["mat-cell",""],["class","dot green","matTooltip","Connected","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot red","matTooltip","Disconnected","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["matTooltip","Connected","matTooltipPosition","right",1,"dot","green",3,"ngClass"],["matTooltip","Disconnected","matTooltipPosition","right",1,"dot","red",3,"ngClass"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],[3,"click",4,"ngIf"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"form",1,2)(3,"button",3),t.NdJ("click",function(){return i.onConnectPeer({})}),t._uU(4,"Add Peer"),t.qZA()(),t.TgZ(5,"div",4)(6,"div",5)(7,"div",6),t._UZ(8,"fa-icon",7),t.TgZ(9,"span",8),t._uU(10,"Peers"),t.qZA()(),t.TgZ(11,"div",9)(12,"mat-form-field",10)(13,"mat-select",11),t.NdJ("ngModelChange",function(s){return i.selFilterBy=s})("selectionChange",function(){return i.selFilter="",i.applyFilter()}),t.YNc(14,Kl,2,2,"mat-option",12),t.qZA()(),t.TgZ(15,"mat-form-field",10)(16,"input",13),t.NdJ("ngModelChange",function(s){return i.selFilter=s})("input",function(){return i.applyFilter()})("keyup",function(){return i.applyFilter()}),t.qZA()()()(),t.TgZ(17,"div",14),t.YNc(18,jl,1,0,"mat-progress-bar",15),t.TgZ(19,"table",16,17),t.ynx(21,18),t.YNc(22,tr,1,0,"th",19),t.YNc(23,ir,3,2,"td",20),t.BQk(),t.ynx(24,21),t.YNc(25,ar,2,0,"th",22),t.YNc(26,or,4,4,"td",20),t.BQk(),t.ynx(27,23),t.YNc(28,sr,2,0,"th",22),t.YNc(29,lr,4,4,"td",20),t.BQk(),t.ynx(30,24),t.YNc(31,rr,2,0,"th",22),t.YNc(32,cr,2,1,"td",20),t.BQk(),t.ynx(33,25),t.YNc(34,ur,2,0,"th",22),t.YNc(35,pr,2,1,"td",20),t.BQk(),t.ynx(36,26),t.YNc(37,mr,6,0,"th",27),t.YNc(38,_r,10,2,"td",28),t.BQk(),t.ynx(39,29),t.YNc(40,xr,4,3,"td",30),t.BQk(),t.YNc(41,vr,1,3,"tr",31),t.YNc(42,Tr,1,0,"tr",32),t.YNc(43,Lr,1,0,"tr",33),t.qZA()(),t._UZ(44,"mat-paginator",34),t.qZA()()),2&e&&(t.xp6(8),t.Q6J("icon",i.faUsers),t.xp6(5),t.Q6J("ngModel",i.selFilterBy),t.xp6(1),t.Q6J("ngForOf",t.DdM(13,br).concat(i.displayedColumns.slice(0,-1))),t.xp6(2),t.Q6J("ngModel",i.selFilter),t.xp6(2),t.Q6J("ngIf",i.apiCallStatus.status===i.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",i.peers)("ngClass",t.VKq(14,Sr,""!==i.errorMessage)),t.xp6(22),t.Q6J("matFooterRowDef",t.DdM(16,Zr)),t.xp6(1),t.Q6J("matHeaderRowDef",i.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumns),t.xp6(1),t.Q6J("pageSize",i.pageSize)("pageSizeOptions",i.pageSizeOptions)("showFirstLastButtons",i.screenSize!==i.screenSizeEnum.XS))},directives:[m.xw,m.yH,m.Wh,d._Y,d.JL,d.F,N.lW,q.BN,y.KE,k.gD,d.JJ,d.On,u.sg,z.ey,Y.Nt,d.Fj,H.$V,u.O5,M.pW,r.BZ,S.YE,u.mk,Z.oO,r.w1,r.fO,r.ge,S.nU,$.gM,r.Dz,r.ev,u.PC,Z.Zl,k.$L,r.mD,r.yh,r.Ke,r.Q2,r.as,r.XQ,r.nj,r.Gk,A.NW],styles:[".mat-column-state[_ngcontent-%COMP%]{max-width:1.2rem;width:1.2rem}"]}),n})();const Er=["queryRoutesForm"];function wr(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Destination Node ID is required."),t.qZA())}function Ir(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Amount is required."),t.qZA())}function Fr(n,a){1&n&&t._UZ(0,"mat-progress-bar",21)}function qr(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1," Alias"),t.qZA())}const kt=function(n){return{"max-width":n}};function Nr(n,a){if(1&n&&(t.TgZ(0,"td",40)(1,"span",41)(2,"span",42),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,kt,i.screenSize===i.screenSizeEnum.XS?"10rem":"30rem")),t.xp6(2),t.Oqu(null==e?null:e.alias)}}function Or(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1," ID"),t.qZA())}function Pr(n,a){if(1&n&&(t.TgZ(0,"td",40)(1,"span",41)(2,"span",42),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,kt,i.screenSize===i.screenSizeEnum.XS?"10rem":"30rem")),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function Ur(n,a){1&n&&(t.TgZ(0,"th",39)(1,"div",43),t._uU(2,"Actions"),t.qZA()())}function Rr(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",44)(1,"button",45),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw(2).onHopClick(s)}),t._uU(2,"View Info"),t.qZA()()}}function kr(n,a){1&n&&t._UZ(0,"tr",46)}function Dr(n,a){1&n&&t._UZ(0,"tr",47)}const Jr=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}};function Mr(n,a){if(1&n&&(t.TgZ(0,"div",22)(1,"mat-expansion-panel",23)(2,"mat-expansion-panel-header")(3,"mat-panel-title",24)(4,"span",25),t._uU(5),t.qZA(),t.TgZ(6,"span",26),t._uU(7),t.ALo(8,"number"),t.qZA()()(),t.TgZ(9,"mat-panel-description",27)(10,"div",28)(11,"table",29,30),t.ynx(13,31),t.YNc(14,qr,2,0,"th",32),t.YNc(15,Nr,4,4,"td",33),t.BQk(),t.ynx(16,34),t.YNc(17,Or,2,0,"th",32),t.YNc(18,Pr,4,4,"td",33),t.BQk(),t.ynx(19,35),t.YNc(20,Ur,3,0,"th",32),t.YNc(21,Rr,3,0,"td",36),t.BQk(),t.YNc(22,kr,1,0,"tr",37),t.YNc(23,Dr,1,0,"tr",38),t.qZA()()()()()),2&n){const e=a.$implicit,i=a.index,o=t.oxw();t.xp6(5),t.hij("Route ",i+1,""),t.xp6(2),t.Oqu(t.lcZ(8,6,e.amount/1e3)),t.xp6(4),t.Q6J("dataSource",o.qrHops[i])("ngClass",t.VKq(8,Jr,"error"===o.flgLoading[0])),t.xp6(11),t.Q6J("matHeaderRowDef",o.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",o.displayedColumns)}}let Qr=(()=>{class n{constructor(e,i,o){this.store=e,this.eclEffects=i,this.commonService=o,this.allQRoutes=[],this.nodeId="",this.amount=0,this.qrHops=[],this.displayedColumns=["alias","nodeId","actions"],this.flgLoading=[!1],this.faRoute=L.FpQ,this.faExclamationTriangle=L.eHv,this.screenSize="",this.screenSizeEnum=l.cu,this.unSubs=[new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.qrHops[0]=new r.by([]),this.qrHops[0].data=[],this.eclEffects.setQueryRoutes.pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{e&&e.routes&&e.routes.length?(this.flgLoading[0]=!1,this.allQRoutes=e.routes,this.allQRoutes.forEach((i,o)=>{this.qrHops[o]=new r.by([...i.nodeIds])})):(this.flgLoading[0]="error",this.allQRoutes=[],this.qrHops=[])})}onQueryRoutes(){if(!this.nodeId||!this.amount)return!0;this.qrHops=[],this.flgLoading[0]=!0,this.store.dispatch((0,U.WO)({payload:{nodeId:this.nodeId,amount:1e3*this.amount}}))}resetData(){this.allQRoutes=[],this.nodeId="",this.amount=0,this.flgLoading[0]=!1,this.qrHops=[],this.form.resetForm()}onHopClick(e){this.store.dispatch((0,E.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:"Route Information",message:[[{key:"alias",value:e.alias,title:"Alias",width:100,type:l.Gi.STRING}],[{key:"nodeId",value:e.nodeId,title:"Node ID",width:100,type:l.Gi.STRING}]]}}}))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(w.yh),t.Y36(ct.o),t.Y36(P.v))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-query-routes"]],viewQuery:function(e,i){if(1&e&&t.Gf(Er,7),2&e){let o;t.iGM(o=t.CRH())&&(i.form=o.first)}},decls:28,vars:10,consts:[["fxLayout","column","fxFlex","100"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap",3,"ngSubmit"],["queryRoutesForm","ngForm"],["fxFlex","100",1,"alert","alert-warn"],[1,"mr-1","alert-icon",3,"icon"],["fxFlex","69","fxLayoutAlign","start end"],["matInput","","placeholder","Destination Node ID","name","nodeId","tabindex","1","required","",3,"ngModel","ngModelChange"],["destPubkey","ngModel"],[4,"ngIf"],["fxFlex","29","fxLayoutAlign","start end"],["matInput","","placeholder","Amount (Sats)","name","amount","tabindex","2","type","number","required","",3,"ngModel","step","min","ngModelChange"],["fxLayout","row",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","3","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","type","submit","tabindex","4"],["fxLayout","row","fxLayoutAlign","start center",1,"page-sub-title-container","mt-2","mb-1"],["fxFlex","70"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["mode","indeterminate",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start",1,"padding-gap-x"],["fxFlex","100",4,"ngFor","ngForOf"],["mode","indeterminate"],["fxFlex","100"],[1,"flat-expansion-panel","help-expansion","mb-2px"],["fxLayout","row","fxLayoutAlign","space-between start"],["fxFlex","50","fxLayoutAlign","start start"],["fxFlex","50","fxLayoutAlign","end end"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between stretch",1,"table-container","mb-2",3,"perfectScrollbar"],["mat-table","",3,"dataSource","ngClass"],["table[i]",""],["matColumnDef","alias"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","nodeId"],["matColumnDef","actions"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],["fxLayout","row",1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["mat-cell","","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","4",1,"table-actions-button",3,"click"],["mat-header-row",""],["mat-row",""]],template:function(e,i){if(1&e){const o=t.EpF();t.TgZ(0,"div",0)(1,"form",1,2),t.NdJ("ngSubmit",function(){return t.CHM(o),t.MAs(2).form.valid&&i.onQueryRoutes()}),t.TgZ(3,"div",3),t._UZ(4,"fa-icon",4),t.TgZ(5,"span"),t._uU(6,"The actual routing fee on a payment can be different from the fee shown on query routes."),t.qZA()(),t.TgZ(7,"mat-form-field",5)(8,"input",6,7),t.NdJ("ngModelChange",function(c){return i.nodeId=c}),t.qZA(),t.YNc(10,wr,2,0,"mat-error",8),t.qZA(),t.TgZ(11,"mat-form-field",9)(12,"input",10),t.NdJ("ngModelChange",function(c){return i.amount=c}),t.qZA(),t.YNc(13,Ir,2,0,"mat-error",8),t.qZA(),t.TgZ(14,"div",11)(15,"button",12),t.NdJ("click",function(){return i.resetData()}),t._uU(16,"Clear"),t.qZA(),t.TgZ(17,"button",13),t._uU(18,"Query Route"),t.qZA()()(),t.TgZ(19,"div",14)(20,"div",15),t._UZ(21,"fa-icon",16),t.TgZ(22,"span",17),t._uU(23,"Transaction Route"),t.qZA()()(),t.YNc(24,Fr,1,0,"mat-progress-bar",18),t.TgZ(25,"div",19)(26,"div",0),t.YNc(27,Mr,24,10,"div",20),t.qZA()()()}2&e&&(t.xp6(4),t.Q6J("icon",i.faExclamationTriangle),t.xp6(4),t.Q6J("ngModel",i.nodeId),t.xp6(2),t.Q6J("ngIf",!i.nodeId),t.xp6(2),t.Q6J("ngModel",i.amount)("step",1e3)("min",0),t.xp6(1),t.Q6J("ngIf",!i.amount),t.xp6(8),t.Q6J("icon",i.faRoute),t.xp6(3),t.Q6J("ngIf",!0===i.flgLoading[0]),t.xp6(3),t.Q6J("ngForOf",i.allQRoutes))},directives:[m.xw,m.yH,d._Y,d.JL,d.F,m.Wh,q.BN,y.KE,Y.Nt,d.Fj,d.Q7,d.JJ,d.On,u.O5,y.TO,d.wV,d.qQ,tt.q,N.lW,M.pW,u.sg,V.ib,V.yz,V.yK,V.u4,H.$V,r.BZ,u.mk,Z.oO,r.w1,r.fO,r.ge,r.Dz,r.ev,u.PC,Z.Zl,r.as,r.XQ,r.nj,r.Gk],pipes:[u.JJ],styles:[""]}),n})();function Yr(n,a){if(1&n&&(t.TgZ(0,"mat-option",37),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw();t.Q6J("value",e),t.xp6(1),t.Oqu(i.getLabel(e))}}function Br(n,a){1&n&&t._UZ(0,"mat-progress-bar",38)}function Hr(n,a){1&n&&t._UZ(0,"th",39)}function zr(n,a){if(1&n&&(t.TgZ(0,"span",43),t._UZ(1,"fa-icon",44),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("icon",e.faEyeSlash)}}function Vr(n,a){if(1&n&&(t.TgZ(0,"span",45),t._UZ(1,"fa-icon",44),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("icon",e.faEye)}}function Gr(n,a){if(1&n&&(t.TgZ(0,"td",40),t.YNc(1,zr,2,1,"span",41),t.YNc(2,Vr,2,1,"span",42),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Q6J("ngIf",!e.announceChannel),t.xp6(1),t.Q6J("ngIf",e.announceChannel)}}function Wr(n,a){1&n&&(t.TgZ(0,"th",46),t._uU(1,"State"),t.qZA())}function $r(n,a){if(1&n&&(t.TgZ(0,"td",40),t._uU(1),t.ALo(2,"titlecase"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,null==e?null:e.state))}}function Xr(n,a){1&n&&(t.TgZ(0,"th",46),t._uU(1,"Short Channel ID"),t.qZA())}function Kr(n,a){if(1&n&&(t.TgZ(0,"td",40),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null==e?null:e.shortChannelId)}}function jr(n,a){1&n&&(t.TgZ(0,"th",46),t._uU(1,"Channel ID"),t.qZA())}const _t=function(n){return{width:n}};function tc(n,a){if(1&n&&(t.TgZ(0,"td",40)(1,"div",47)(2,"span",48),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,_t,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.channelId)}}function ec(n,a){1&n&&(t.TgZ(0,"th",46),t._uU(1,"Alias"),t.qZA())}function nc(n,a){if(1&n&&(t.TgZ(0,"td",40)(1,"div",47)(2,"span",48),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,_t,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(e.alias)}}function ic(n,a){1&n&&(t.TgZ(0,"th",46),t._uU(1,"Node ID"),t.qZA())}function ac(n,a){if(1&n&&(t.TgZ(0,"td",40)(1,"div",47)(2,"span",48),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,_t,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function oc(n,a){1&n&&(t.TgZ(0,"th",46),t._uU(1,"Funder"),t.qZA())}function sc(n,a){if(1&n&&(t.TgZ(0,"td",40),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null!=e&&e.isFunder?"Yes":"No")}}function lc(n,a){1&n&&(t.TgZ(0,"th",46),t._uU(1,"Buried"),t.qZA())}function rc(n,a){if(1&n&&(t.TgZ(0,"td",40),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null!=e&&e.buried?"Yes":"No")}}function cc(n,a){1&n&&(t.TgZ(0,"th",49),t._uU(1,"Local Balance (Sats)"),t.qZA())}function uc(n,a){if(1&n&&(t.TgZ(0,"td",40)(1,"span",50),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.toLocal,"1.0-0")," ")}}function pc(n,a){1&n&&(t.TgZ(0,"th",49),t._uU(1,"Remote Balance (Sats)"),t.qZA())}function mc(n,a){if(1&n&&(t.TgZ(0,"td",40)(1,"span",50),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.toRemote,"1.0-0")," ")}}function dc(n,a){1&n&&(t.TgZ(0,"th",49),t._uU(1,"Local Fee/KW"),t.qZA())}function hc(n,a){if(1&n&&(t.TgZ(0,"td",40)(1,"span",50),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.feeRatePerKw,"1.0-0")," ")}}function _c(n,a){1&n&&(t.TgZ(0,"th",46),t._uU(1,"Balance Score"),t.qZA())}function gc(n,a){if(1&n&&(t.TgZ(0,"td",40)(1,"div",51)(2,"mat-hint",52),t._uU(3),t.ALo(4,"number"),t.qZA()(),t._UZ(5,"mat-progress-bar",53),t.qZA()),2&n){const e=a.$implicit;t.xp6(3),t.Oqu(t.lcZ(4,2,(null==e?null:e.balancedness)||0)),t.xp6(2),t.s9C("value",e.toLocal&&e.toLocal>0?+e.toLocal/(+e.toLocal+ +e.toRemote)*100:0)}}function fc(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",54)(1,"div",55)(2,"mat-select",56),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",57),t.NdJ("click",function(){return t.CHM(e),t.oxw().onDownloadCSV()}),t._uU(5,"Download CSV"),t.qZA()()()()}}function Cc(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",58)(1,"div",55)(2,"mat-select",59),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",57),t.NdJ("click",function(o){const c=t.CHM(e).$implicit;return t.oxw().onChannelClick(c,o)}),t._uU(5,"View Info"),t.qZA(),t.TgZ(6,"mat-option",57),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw().onChannelClose(s,!0)}),t._uU(7,"Force Close"),t.qZA()()()()}}function xc(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No inactive channel available."),t.qZA())}function yc(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting inactive channels..."),t.qZA())}function vc(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.errorMessage)}}function Tc(n,a){if(1&n&&(t.TgZ(0,"td",60),t.YNc(1,xc,2,0,"p",61),t.YNc(2,yc,2,0,"p",61),t.YNc(3,vc,2,1,"p",61),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const Lc=function(n){return{"display-none":n}};function bc(n,a){if(1&n&&t._UZ(0,"tr",62),2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,Lc,(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function Sc(n,a){1&n&&t._UZ(0,"tr",63)}function Zc(n,a){1&n&&t._UZ(0,"tr",64)}const Ac=function(){return["all"]},Ec=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},wc=function(){return["no_channel"]};let Ic=(()=>{class n{constructor(e,i,o,s,c){this.logger=e,this.store=i,this.rtlEffects=o,this.commonService=s,this.camelCaseWithSpaces=c,this.faEye=L.Mdf,this.faEyeSlash=L.Aq,this.nodePageDefs=l.Xk,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="peers_channels",this.tableSetting={tableId:"inactive_channels",recordsPerPage:l.IV,sortBy:"alias",sortOrder:l.Pi.DESCENDING},this.totalBalance=0,this.displayedColumns=[],this.channels=new r.by([]),this.myChanPolicy={},this.information={},this.numPeers=-1,this.feeRateTypes=l.vn,this.selFilter="",this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(C.nF).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{var i,o;this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=(null===(i=e.pageSettings.find(s=>s.pageId===this.PAGE_ID))||void 0===i?void 0:i.tables.find(s=>s.tableId===this.tableSetting.tableId))||(null===(o=l.c3.find(s=>s.pageId===this.PAGE_ID))||void 0===o?void 0:o.tables.find(s=>s.tableId===this.tableSetting.tableId)),this.displayedColumns=this.screenSize===l.cu.XS||this.screenSize===l.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("announceChannel"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:l.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(C.Xz).pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.inactiveChannels=e.inactiveChannels,this.loadChannelsTable(),this.logger.info(e)}),this.store.select(C.yD).pipe((0,_.R)(this.unSubs[2])).subscribe(e=>{this.information=e}),this.store.select(C.Bo).pipe((0,_.R)(this.unSubs[3])).subscribe(e=>{this.numPeers=e.peers&&e.peers.length?e.peers.length:0}),this.store.select(C.kY).pipe((0,_.R)(this.unSubs[4])).subscribe(e=>{this.totalBalance=e.onchainBalance.total||0})}ngAfterViewInit(){this.inactiveChannels.length>0&&this.loadChannelsTable()}onChannelClose(e,i){this.store.dispatch((0,E.c1)({payload:{data:{type:l.n_.CONFIRM,alertTitle:i?"Force Close Channel":"Close Channel",titleMessage:i?"Force closing channel: "+(e.alias||e.shortChannelId?e.alias&&e.shortChannelId?e.alias+" ("+e.shortChannelId+")":e.alias?e.alias:e.shortChannelId:e.channelId):"Closing channel: "+(e.alias||e.shortChannelId?e.alias&&e.shortChannelId?e.alias+" ("+e.shortChannelId+")":e.alias?e.alias:e.shortChannelId:e.channelId),noBtnText:"Cancel",yesBtnText:i?"Force Close":"Close Channel"}}})),this.rtlEffects.closeConfirm.pipe((0,_.R)(this.unSubs[5])).subscribe(h=>{h&&this.store.dispatch((0,U.BL)({payload:{channelId:e.channelId||"",force:i}}))})}onChannelClick(e,i){this.store.dispatch((0,E.qR)({payload:{data:{channel:e,channelsType:"inactive",component:mt}}}))}applyFilter(){this.channels.filter=this.selFilter.trim().toLocaleLowerCase()}getLabel(e){const i=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(o=>o.column===e);return i?i.label?i.label:this.camelCaseWithSpaces.transform(i.column,"_"):"announceChannel"===e?"Private":this.commonService.titleCase(e)}setFilterPredicate(){this.channels.filterPredicate=(e,i)=>{let o="";switch(this.selFilterBy){case"all":o=JSON.stringify(e).toLowerCase();break;case"announceChannel":o=(null==e?void 0:e.announceChannel)?"public":"private";break;default:o=void 0===e[this.selFilterBy]?"":"string"==typeof e[this.selFilterBy]?e[this.selFilterBy].toLowerCase():"boolean"==typeof e[this.selFilterBy]?e[this.selFilterBy]?"yes":"no":e[this.selFilterBy].toString()}return o.includes(i)}}loadChannelsTable(){var e;this.channels=new r.by([...this.inactiveChannels]),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(i,o)=>i[o]&&isNaN(i[o])?i[o].toLocaleLowerCase():i[o]?+i[o]:null,null===(e=this.channels.sort)||void 0===e||e.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.channels.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter(),this.logger.info(this.channels)}onDownloadCSV(){this.channels.data&&this.channels.data.length>0&&this.commonService.downloadFile(this.channels.data,"InactiveChannels")}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(O.mQ),t.Y36(w.yh),t.Y36(nt.V),t.Y36(P.v),t.Y36(G.i1))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-inactive-table"]],viewQuery:function(e,i){if(1&e&&(t.Gf(S.YE,5),t.Gf(A.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.sort=o.first),t.iGM(o=t.CRH())&&(i.paginator=o.first)}},features:[t._Bn([{provide:A.ye,useValue:(0,l.pt)("Channels")}])],decls:58,vars:16,consts:[["fxLayout","column",1,"padding-gap"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],["fxFlex","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxFlex","49"],["placeholder","Filter By","tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","announceChannel"],["mat-header-cell","","mat-sort-header","","matTooltip","Private",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","state"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","shortChannelId"],["matColumnDef","channelId"],["matColumnDef","alias"],["matColumnDef","nodeId"],["matColumnDef","isFunder"],["matColumnDef","buried"],["matColumnDef","toLocal"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","toRemote"],["matColumnDef","feeRatePerKw"],["matColumnDef","balancedness"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_channel"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","matTooltip","Private"],["mat-cell",""],["class","mr-1","matTooltip","Private","matTooltipPosition","right",4,"ngIf"],["class","mr-1","matTooltip","Public","matTooltipPosition","right",4,"ngIf"],["matTooltip","Private","matTooltipPosition","right",1,"mr-1"],[3,"icon"],["matTooltip","Public","matTooltipPosition","right",1,"mr-1"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["fxLayout","row"],["fxFlex","100","fxLayoutAlign","center center",1,"font-size-80"],["mode","determinate",3,"value"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["placeholder","Actions","tabindex","2",1,"mr-0"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1),t._UZ(2,"div",2),t.TgZ(3,"div",3)(4,"mat-form-field",4)(5,"mat-select",5),t.NdJ("ngModelChange",function(s){return i.selFilterBy=s})("selectionChange",function(){return i.selFilter="",i.applyFilter()}),t.YNc(6,Yr,2,2,"mat-option",6),t.qZA()(),t.TgZ(7,"mat-form-field",4)(8,"input",7),t.NdJ("ngModelChange",function(s){return i.selFilter=s})("input",function(){return i.applyFilter()})("keyup",function(){return i.applyFilter()}),t.qZA()()()(),t.TgZ(9,"div",8),t.YNc(10,Br,1,0,"mat-progress-bar",9),t.TgZ(11,"table",10,11),t.ynx(13,12),t.YNc(14,Hr,1,0,"th",13),t.YNc(15,Gr,3,2,"td",14),t.BQk(),t.ynx(16,15),t.YNc(17,Wr,2,0,"th",16),t.YNc(18,$r,3,3,"td",14),t.BQk(),t.ynx(19,17),t.YNc(20,Xr,2,0,"th",16),t.YNc(21,Kr,2,1,"td",14),t.BQk(),t.ynx(22,18),t.YNc(23,jr,2,0,"th",16),t.YNc(24,tc,4,4,"td",14),t.BQk(),t.ynx(25,19),t.YNc(26,ec,2,0,"th",16),t.YNc(27,nc,4,4,"td",14),t.BQk(),t.ynx(28,20),t.YNc(29,ic,2,0,"th",16),t.YNc(30,ac,4,4,"td",14),t.BQk(),t.ynx(31,21),t.YNc(32,oc,2,0,"th",16),t.YNc(33,sc,2,1,"td",14),t.BQk(),t.ynx(34,22),t.YNc(35,lc,2,0,"th",16),t.YNc(36,rc,2,1,"td",14),t.BQk(),t.ynx(37,23),t.YNc(38,cc,2,0,"th",24),t.YNc(39,uc,4,4,"td",14),t.BQk(),t.ynx(40,25),t.YNc(41,pc,2,0,"th",24),t.YNc(42,mc,4,4,"td",14),t.BQk(),t.ynx(43,26),t.YNc(44,dc,2,0,"th",24),t.YNc(45,hc,4,4,"td",14),t.BQk(),t.ynx(46,27),t.YNc(47,_c,2,0,"th",16),t.YNc(48,gc,6,4,"td",14),t.BQk(),t.ynx(49,28),t.YNc(50,fc,6,0,"th",29),t.YNc(51,Cc,8,0,"td",30),t.BQk(),t.ynx(52,31),t.YNc(53,Tc,4,3,"td",32),t.BQk(),t.YNc(54,bc,1,3,"tr",33),t.YNc(55,Sc,1,0,"tr",34),t.YNc(56,Zc,1,0,"tr",35),t.qZA()(),t._UZ(57,"mat-paginator",36),t.qZA()),2&e&&(t.xp6(5),t.Q6J("ngModel",i.selFilterBy),t.xp6(1),t.Q6J("ngForOf",t.DdM(12,Ac).concat(i.displayedColumns.slice(0,-1))),t.xp6(2),t.Q6J("ngModel",i.selFilter),t.xp6(2),t.Q6J("ngIf",i.apiCallStatus.status===i.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",i.channels)("ngClass",t.VKq(13,Ec,""!==i.errorMessage)),t.xp6(43),t.Q6J("matFooterRowDef",t.DdM(15,wc)),t.xp6(1),t.Q6J("matHeaderRowDef",i.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumns),t.xp6(1),t.Q6J("pageSize",i.pageSize)("pageSizeOptions",i.pageSizeOptions)("showFirstLastButtons",i.screenSize!==i.screenSizeEnum.XS))},directives:[m.xw,m.Wh,m.yH,y.KE,k.gD,d.JJ,d.On,u.sg,z.ey,Y.Nt,d.Fj,H.$V,u.O5,M.pW,r.BZ,S.YE,u.mk,Z.oO,r.w1,r.fO,r.ge,S.nU,$.gM,r.Dz,r.ev,q.BN,u.PC,Z.Zl,y.bx,k.$L,r.mD,r.yh,r.Ke,r.Q2,r.as,r.XQ,r.nj,r.Gk,A.NW],pipes:[u.rS,u.JJ],styles:[".mat-column-announceChannel[_ngcontent-%COMP%]{max-width:1.2rem;width:1.2rem}.mat-column-balancedness[_ngcontent-%COMP%]{padding-left:3rem;min-width:15rem;max-width:30rem}"]}),n})();function Fc(n,a){if(1&n&&(t.TgZ(0,"div",5),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Oqu(e.errorMessage)}}function qc(n,a){if(1&n&&(t.TgZ(0,"mat-option",13),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.Q6J("value",e),t.xp6(1),t.Oqu(i.getLabel(e))}}const Nc=function(){return["all"]};function Oc(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",6),t._UZ(1,"div",7),t.TgZ(2,"div",8)(3,"mat-form-field",9)(4,"mat-select",10),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().selFilterBy=o})("selectionChange",function(){t.CHM(e);const o=t.oxw();return o.selFilter="",o.applyFilter()}),t.YNc(5,qc,2,2,"mat-option",11),t.qZA()(),t.TgZ(6,"mat-form-field",9)(7,"input",12),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().selFilter=o})("input",function(){return t.CHM(e),t.oxw().applyFilter()})("keyup",function(){return t.CHM(e),t.oxw().applyFilter()}),t.qZA()()()()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.selFilterBy),t.xp6(1),t.Q6J("ngForOf",t.DdM(3,Nc).concat(e.displayedColumns.slice(0,-1))),t.xp6(2),t.Q6J("ngModel",e.selFilter)}}function Pc(n,a){1&n&&t._UZ(0,"mat-progress-bar",42)}function Uc(n,a){1&n&&t._UZ(0,"th",43)}const Rc=function(n){return{"ml-0":n}};function kc(n,a){if(1&n&&(t._UZ(0,"span",46),t.ALo(1,"camelcase")),2&n){const e=t.oxw().$implicit,i=t.oxw(2);t.s9C("matTooltip",t.lcZ(1,2,null==e?null:e.type)),t.Q6J("ngClass",t.VKq(4,Rc,i.screenSize===i.screenSizeEnum.XS))}}function Dc(n,a){if(1&n&&(t.TgZ(0,"td",44),t.YNc(1,kc,2,6,"span",45),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Q6J("ngIf","payment-relayed"!==(null==e?null:e.type))}}function Jc(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Date/Time"),t.qZA())}function Mc(n,a){if(1&n&&(t.TgZ(0,"td",44),t._uU(1),t.ALo(2,"date"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,null==e?null:e.timestamp,"dd/MMM/y HH:mm")," ")}}function Qc(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"In Channel ID"),t.qZA())}const et=function(n){return{width:n}};function Yc(n,a){if(1&n&&(t.TgZ(0,"td",44)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,et,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.fromChannelId)}}function Bc(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"In Channel Short ID"),t.qZA())}function Hc(n,a){if(1&n&&(t.TgZ(0,"td",44),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null==e?null:e.fromShortChannelId)}}function zc(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"In Channel"),t.qZA())}function Vc(n,a){if(1&n&&(t.TgZ(0,"td",44)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,et,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.fromChannelAlias)}}function Gc(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Out Channel ID"),t.qZA())}function Wc(n,a){if(1&n&&(t.TgZ(0,"td",44)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,et,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.toChannelId)}}function $c(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Out Channel Short ID"),t.qZA())}function Xc(n,a){if(1&n&&(t.TgZ(0,"td",44),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null==e?null:e.toShortChannelId)}}function Kc(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Out Channel"),t.qZA())}function jc(n,a){if(1&n&&(t.TgZ(0,"td",44)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,et,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.toChannelAlias)}}function tu(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Payment Hash"),t.qZA())}function eu(n,a){if(1&n&&(t.TgZ(0,"td",44)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,et,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.paymentHash)}}function nu(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Amount In (Sats)"),t.qZA())}function iu(n,a){if(1&n&&(t.TgZ(0,"td",44)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,null==e?null:e.amountIn))}}function au(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Amount Out (Sats)"),t.qZA())}function ou(n,a){if(1&n&&(t.TgZ(0,"td",44)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,null==e?null:e.amountOut))}}function su(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Fee Earned (Sats)"),t.qZA())}function lu(n,a){if(1&n&&(t.TgZ(0,"td",44)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,(null==e?null:e.amountIn)-(null==e?null:e.amountOut)))}}function ru(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",52)(1,"div",53)(2,"mat-select",54),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",55),t.NdJ("click",function(){return t.CHM(e),t.oxw(2).onDownloadCSV()}),t._uU(5,"Download CSV"),t.qZA()()()()}}function cu(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",56)(1,"button",57),t.NdJ("click",function(o){const c=t.CHM(e).$implicit;return t.oxw(2).onForwardingEventClick(c,o)}),t._uU(2,"View Info"),t.qZA()()}}function uu(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No forwarding history available."),t.qZA())}function pu(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting forwarding history..."),t.qZA())}function mu(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Oqu(e.errorMessage)}}function du(n,a){if(1&n&&(t.TgZ(0,"td",58),t.YNc(1,uu,2,0,"p",59),t.YNc(2,pu,2,0,"p",59),t.YNc(3,mu,2,1,"p",59),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",(!(null!=e.forwardingHistoryEvents&&e.forwardingHistoryEvents.data)||(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.forwardingHistoryEvents&&e.forwardingHistoryEvents.data)||(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.forwardingHistoryEvents&&e.forwardingHistoryEvents.data)||(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const hu=function(n){return{"display-none":n}};function _u(n,a){if(1&n&&t._UZ(0,"tr",60),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,hu,(null==e.forwardingHistoryEvents?null:e.forwardingHistoryEvents.data)&&(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)>0))}}function gu(n,a){1&n&&t._UZ(0,"tr",61)}function fu(n,a){1&n&&t._UZ(0,"tr",62)}const Cu=function(){return["no_event"]};function xu(n,a){if(1&n&&(t.TgZ(0,"div",14),t.YNc(1,Pc,1,0,"mat-progress-bar",15),t.TgZ(2,"table",16,17),t.ynx(4,18),t.YNc(5,Uc,1,0,"th",19),t.YNc(6,Dc,2,1,"td",20),t.BQk(),t.ynx(7,21),t.YNc(8,Jc,2,0,"th",22),t.YNc(9,Mc,3,4,"td",20),t.BQk(),t.ynx(10,23),t.YNc(11,Qc,2,0,"th",22),t.YNc(12,Yc,4,4,"td",20),t.BQk(),t.ynx(13,24),t.YNc(14,Bc,2,0,"th",22),t.YNc(15,Hc,2,1,"td",20),t.BQk(),t.ynx(16,25),t.YNc(17,zc,2,0,"th",22),t.YNc(18,Vc,4,4,"td",20),t.BQk(),t.ynx(19,26),t.YNc(20,Gc,2,0,"th",22),t.YNc(21,Wc,4,4,"td",20),t.BQk(),t.ynx(22,27),t.YNc(23,$c,2,0,"th",22),t.YNc(24,Xc,2,1,"td",20),t.BQk(),t.ynx(25,28),t.YNc(26,Kc,2,0,"th",22),t.YNc(27,jc,4,4,"td",20),t.BQk(),t.ynx(28,29),t.YNc(29,tu,2,0,"th",22),t.YNc(30,eu,4,4,"td",20),t.BQk(),t.ynx(31,30),t.YNc(32,nu,2,0,"th",31),t.YNc(33,iu,4,3,"td",20),t.BQk(),t.ynx(34,32),t.YNc(35,au,2,0,"th",31),t.YNc(36,ou,4,3,"td",20),t.BQk(),t.ynx(37,33),t.YNc(38,su,2,0,"th",31),t.YNc(39,lu,4,3,"td",20),t.BQk(),t.ynx(40,34),t.YNc(41,ru,6,0,"th",35),t.YNc(42,cu,3,0,"td",36),t.BQk(),t.ynx(43,37),t.YNc(44,du,4,3,"td",38),t.BQk(),t.YNc(45,_u,1,3,"tr",39),t.YNc(46,gu,1,0,"tr",40),t.YNc(47,fu,1,0,"tr",41),t.qZA()()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",e.forwardingHistoryEvents),t.xp6(43),t.Q6J("matFooterRowDef",t.DdM(5,Cu)),t.xp6(1),t.Q6J("matHeaderRowDef",e.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",e.displayedColumns)}}function yu(n,a){if(1&n&&t._UZ(0,"mat-paginator",63),2&n){const e=t.oxw();t.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}let Dt=(()=>{class n{constructor(e,i,o,s,c){this.logger=e,this.commonService=i,this.store=o,this.datePipe=s,this.camelCaseWithSpaces=c,this.pageId="routing",this.tableId="forwarding_history",this.eventsData=[],this.selFilter="",this.nodePageDefs=l.Xk,this.selFilterBy="all",this.colWidth="20rem",this.tableSetting={tableId:"forwarding_history",recordsPerPage:l.IV,sortBy:"timestamp",sortOrder:l.Pi.DESCENDING},this.displayedColumns=[],this.forwardingHistoryEvents=new r.by([]),this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(C.nF).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{var i,o;this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting.tableId=this.tableId,this.tableSetting=(null===(i=e.pageSettings.find(s=>s.pageId===this.pageId))||void 0===i?void 0:i.tables.find(s=>s.tableId===this.tableSetting.tableId))||(null===(o=l.c3.find(s=>s.pageId===this.pageId))||void 0===o?void 0:o.tables.find(s=>s.tableId===this.tableSetting.tableId)),this.displayedColumns=this.screenSize===l.cu.XS||this.screenSize===l.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("type"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:l.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(C.PP).pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{0===this.eventsData.length&&(this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.eventsData=e.payments&&e.payments.relayed?e.payments.relayed:[],this.eventsData.length>0&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadForwardingEventsTable(this.eventsData),this.logger.info(this.eventsData))})}ngAfterViewInit(){this.eventsData.length>0&&this.loadForwardingEventsTable(this.eventsData)}ngOnChanges(e){e.eventsData&&(this.apiCallStatus={status:l.Bn.COMPLETED,action:"FetchPayments"},this.eventsData=e.eventsData.currentValue,e.eventsData.firstChange||this.loadForwardingEventsTable(this.eventsData)),e.selFilter&&!e.selFilter.firstChange&&(this.selFilterBy="all",this.applyFilter())}onForwardingEventClick(e,i){const o=[[{key:"paymentHash",value:e.paymentHash,title:"Payment Hash",width:100,type:l.Gi.STRING}],[{key:"timestamp",value:Math.round((e.timestamp||0)/1e3),title:"Date/Time",width:50,type:l.Gi.DATE_TIME},{key:"fee",value:(e.amountIn||0)-(e.amountOut||0),title:"Fee Earned (Sats)",width:50,type:l.Gi.NUMBER}],[{key:"amountIn",value:e.amountIn,title:"Amount In (Sats)",width:50,type:l.Gi.NUMBER},{key:"amountOut",value:e.amountOut,title:"Amount Out (Sats)",width:50,type:l.Gi.NUMBER}],[{key:"fromChannelAlias",value:e.fromChannelAlias,title:"From Channel Alias",width:50,type:l.Gi.STRING},{key:"fromShortChannelId",value:e.fromShortChannelId,title:"From Short Channel ID",width:50,type:l.Gi.STRING}],[{key:"fromChannelId",value:e.fromChannelId,title:"From Channel ID",width:100,type:l.Gi.STRING}],[{key:"toChannelAlias",value:e.toChannelAlias,title:"To Channel Alias",width:50,type:l.Gi.STRING},{key:"toShortChannelId",value:e.toShortChannelId,title:"To Short Channel ID",width:50,type:l.Gi.STRING}],[{key:"toChannelId",value:e.toChannelId,title:"To Channel ID",width:100,type:l.Gi.STRING}]];"payment-relayed"!==e.type&&(null==o||o.unshift([{key:"type",value:this.commonService.camelCase(e.type),title:"Relay Type",width:100,type:l.Gi.STRING}])),this.store.dispatch((0,E.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:"Event Information",message:o}}}))}applyFilter(){this.forwardingHistoryEvents&&(this.forwardingHistoryEvents.filter=this.selFilter.trim().toLowerCase())}getLabel(e){const i=this.nodePageDefs[this.pageId][this.tableSetting.tableId].allowedColumns.find(o=>o.column===e);return i?i.label?i.label:this.camelCaseWithSpaces.transform(i.column):this.commonService.titleCase(e)}setFilterPredicate(){this.forwardingHistoryEvents.filterPredicate=(e,i)=>{var o,s;let c="";switch(this.selFilterBy){case"all":c=(e.timestamp?null===(o=this.datePipe.transform(new Date(e.timestamp),"dd/MMM/y HH:mm"))||void 0===o?void 0:o.toLowerCase():"")+JSON.stringify(e).toLowerCase();break;case"timestamp":c=(null===(s=this.datePipe.transform(new Date(e.timestamp||0),"dd/MMM/y HH:mm"))||void 0===s?void 0:s.toLowerCase())||"";break;case"fee":c=(e.amountIn-e.amountOut).toString()||"0";break;default:c=void 0===e[this.selFilterBy]?"":"string"==typeof e[this.selFilterBy]?e[this.selFilterBy].toLowerCase():"boolean"==typeof e[this.selFilterBy]?e[this.selFilterBy]?"yes":"no":e[this.selFilterBy].toString()}return c.includes(i)}}loadForwardingEventsTable(e){var i;this.forwardingHistoryEvents=new r.by([...e]),this.forwardingHistoryEvents.sort=this.sort,this.forwardingHistoryEvents.sortingDataAccessor=(o,s)=>"fee"===s?o.amountIn-o.amountOut:o[s]&&isNaN(o[s])?o[s].toLocaleLowerCase():o[s]?+o[s]:null,null===(i=this.forwardingHistoryEvents.sort)||void 0===i||i.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.forwardingHistoryEvents.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter(),this.logger.info(this.forwardingHistoryEvents)}onDownloadCSV(){this.forwardingHistoryEvents&&this.forwardingHistoryEvents.data&&this.forwardingHistoryEvents.data.length>0&&this.commonService.downloadFile(this.forwardingHistoryEvents.data,"Forwarding-history")}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(O.mQ),t.Y36(P.v),t.Y36(w.yh),t.Y36(u.uU),t.Y36(G.i1))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-forwarding-history"]],viewQuery:function(e,i){if(1&e&&(t.Gf(S.YE,5),t.Gf(A.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.sort=o.first),t.iGM(o=t.CRH())&&(i.paginator=o.first)}},inputs:{pageId:"pageId",tableId:"tableId",eventsData:"eventsData",selFilter:"selFilter"},features:[t._Bn([{provide:A.ye,useValue:(0,l.pt)("Events")}]),t.TTD],decls:5,vars:4,consts:[["fxLayout","column","fxLayoutAlign","start stretch",1,"padding-gap-x"],["class","p-2 error-border my-2",4,"ngIf"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch","class","page-sub-title-container",4,"ngIf"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100","class","table-container",3,"perfectScrollbar",4,"ngIf"],["class","mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons",4,"ngIf"],[1,"p-2","error-border","my-2"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],["fxFlex","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxFlex","49"],["placeholder","Filter By","tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","ngModelChange","input","keyup"],[3,"value"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",1,"overflow-auto",3,"dataSource"],["table",""],["matColumnDef","type"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","Type (if not payment relayed)",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","timestamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","fromChannelId"],["matColumnDef","fromShortChannelId"],["matColumnDef","fromChannelAlias"],["matColumnDef","toChannelId"],["matColumnDef","toShortChannelId"],["matColumnDef","toChannelAlias"],["matColumnDef","paymentHash"],["matColumnDef","amountIn"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","amountOut"],["matColumnDef","fee"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_event"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","Type (if not payment relayed)"],["mat-cell",""],["class","dot yellow","matTooltipPosition","right",3,"matTooltip","ngClass",4,"ngIf"],["matTooltipPosition","right",1,"dot","yellow",3,"matTooltip","ngClass"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","4",1,"table-actions-button",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.YNc(1,Fc,2,1,"div",1),t.YNc(2,Oc,8,4,"div",2),t.YNc(3,xu,48,6,"div",3),t.YNc(4,yu,1,3,"mat-paginator",4),t.qZA()),2&e&&(t.xp6(1),t.Q6J("ngIf",""!==i.errorMessage),t.xp6(1),t.Q6J("ngIf",""===i.errorMessage),t.xp6(1),t.Q6J("ngIf",""===i.errorMessage),t.xp6(1),t.Q6J("ngIf",""===i.errorMessage))},directives:[m.xw,m.Wh,u.O5,m.yH,y.KE,k.gD,d.JJ,d.On,u.sg,z.ey,Y.Nt,d.Fj,H.$V,M.pW,r.BZ,S.YE,r.w1,r.fO,r.ge,S.nU,$.gM,r.Dz,r.ev,u.mk,Z.oO,u.PC,Z.Zl,k.$L,N.lW,r.mD,r.yh,r.Ke,r.Q2,r.as,r.XQ,r.nj,r.Gk,A.NW],pipes:[G.h9,u.uU,u.JJ],styles:[".mat-column-type[_ngcontent-%COMP%]{max-width:1.2rem;width:1.2rem}.mat-column-type[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{max-width:1.6rem;width:1.6rem}"]}),n})();const vu=["tableIn"],Tu=["tableOut"],Lu=["paginatorIn"],bu=["paginatorOut"];function Su(n,a){if(1&n&&(t.TgZ(0,"div",3),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Oqu(e.errorMessage)}}function Zu(n,a){1&n&&t._UZ(0,"mat-progress-bar",34)}function Au(n,a){1&n&&(t.TgZ(0,"th",35),t._uU(1,"Channel ID"),t.qZA())}const at=function(n){return{width:n}};function Eu(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"div",37)(2,"span",38),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,at,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.channelId)}}function wu(n,a){1&n&&(t.TgZ(0,"th",35),t._uU(1,"Peer Alias"),t.qZA())}function Iu(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"div",37)(2,"span",38),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,at,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.alias)}}function Fu(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Events"),t.qZA())}function qu(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"span",40),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.events))}}function Nu(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Amount (Sats)"),t.qZA())}function Ou(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"span",40),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.totalAmount))}}function Pu(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Fee (Sats)"),t.qZA())}function Uu(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"span",40),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.totalFee))}}function Ru(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No incoming routing peer available."),t.qZA())}function ku(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting incoming routing peers..."),t.qZA())}function Du(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Oqu(e.errorMessage)}}function Ju(n,a){if(1&n&&(t.TgZ(0,"td",41),t.YNc(1,Ru,2,0,"p",42),t.YNc(2,ku,2,0,"p",42),t.YNc(3,Du,2,1,"p",42),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",(!(null!=e.routingPeersIncoming&&e.routingPeersIncoming.data)||(null==e.routingPeersIncoming||null==e.routingPeersIncoming.data?null:e.routingPeersIncoming.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.routingPeersIncoming&&e.routingPeersIncoming.data)||(null==e.routingPeersIncoming||null==e.routingPeersIncoming.data?null:e.routingPeersIncoming.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.routingPeersIncoming&&e.routingPeersIncoming.data)||(null==e.routingPeersIncoming||null==e.routingPeersIncoming.data?null:e.routingPeersIncoming.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const Jt=function(n){return{"display-none":n}};function Mu(n,a){if(1&n&&t._UZ(0,"tr",43),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,Jt,(null==e.routingPeersIncoming?null:e.routingPeersIncoming.data)&&(null==e.routingPeersIncoming||null==e.routingPeersIncoming.data?null:e.routingPeersIncoming.data.length)>0))}}function Qu(n,a){1&n&&t._UZ(0,"tr",44)}function Yu(n,a){1&n&&t._UZ(0,"tr",45)}function Bu(n,a){1&n&&t._UZ(0,"mat-progress-bar",34)}function Hu(n,a){1&n&&(t.TgZ(0,"th",35),t._uU(1,"Channel ID"),t.qZA())}function zu(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"div",37)(2,"span",38),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,at,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.channelId)}}function Vu(n,a){1&n&&(t.TgZ(0,"th",35),t._uU(1,"Peer Alias"),t.qZA())}function Gu(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"div",37)(2,"span",38),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,at,i.screenSize===i.screenSizeEnum.XS?"10rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.alias)}}function Wu(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Events"),t.qZA())}function $u(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"span",40),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.events))}}function Xu(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Amount (Sats)"),t.qZA())}function Ku(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"span",40),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.totalAmount))}}function ju(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Fee (Sats)"),t.qZA())}function tp(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"span",40),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.totalFee))}}function ep(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No outgoing routing peer available."),t.qZA())}function np(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting outgoing routing peers..."),t.qZA())}function ip(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Oqu(e.errorMessage)}}function ap(n,a){if(1&n&&(t.TgZ(0,"td",41),t.YNc(1,ep,2,0,"p",42),t.YNc(2,np,2,0,"p",42),t.YNc(3,ip,2,1,"p",42),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",(!(null!=e.routingPeersOutgoing&&e.routingPeersOutgoing.data)||(null==e.routingPeersOutgoing||null==e.routingPeersOutgoing.data?null:e.routingPeersOutgoing.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.routingPeersOutgoing&&e.routingPeersOutgoing.data)||(null==e.routingPeersOutgoing||null==e.routingPeersOutgoing.data?null:e.routingPeersOutgoing.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.routingPeersOutgoing&&e.routingPeersOutgoing.data)||(null==e.routingPeersOutgoing||null==e.routingPeersOutgoing.data?null:e.routingPeersOutgoing.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}function op(n,a){if(1&n&&t._UZ(0,"tr",43),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,Jt,(null==e.routingPeersOutgoing?null:e.routingPeersOutgoing.data)&&(null==e.routingPeersOutgoing||null==e.routingPeersOutgoing.data?null:e.routingPeersOutgoing.data.length)>0))}}function sp(n,a){1&n&&t._UZ(0,"tr",44)}function lp(n,a){1&n&&t._UZ(0,"tr",45)}const rp=function(n,a){return{"mt-2":n,"mt-1":a}},cp=function(){return["no_incoming_event"]},up=function(n){return{"mt-2":n}},pp=function(){return["no_outgoing_event"]};function mp(n,a){if(1&n&&(t.TgZ(0,"div",4)(1,"div",5)(2,"div",6)(3,"div",7),t._uU(4,"Incoming"),t.qZA(),t._UZ(5,"div",8),t.qZA(),t.TgZ(6,"div",9),t.YNc(7,Zu,1,0,"mat-progress-bar",10),t.TgZ(8,"table",11,12),t.ynx(10,13),t.YNc(11,Au,2,0,"th",14),t.YNc(12,Eu,4,4,"td",15),t.BQk(),t.ynx(13,16),t.YNc(14,wu,2,0,"th",14),t.YNc(15,Iu,4,4,"td",15),t.BQk(),t.ynx(16,17),t.YNc(17,Fu,2,0,"th",18),t.YNc(18,qu,4,3,"td",15),t.BQk(),t.ynx(19,19),t.YNc(20,Nu,2,0,"th",18),t.YNc(21,Ou,4,3,"td",15),t.BQk(),t.ynx(22,20),t.YNc(23,Pu,2,0,"th",18),t.YNc(24,Uu,4,3,"td",15),t.BQk(),t.ynx(25,21),t.YNc(26,Ju,4,3,"td",22),t.BQk(),t.YNc(27,Mu,1,3,"tr",23),t.YNc(28,Qu,1,0,"tr",24),t.YNc(29,Yu,1,0,"tr",25),t.qZA()(),t._UZ(30,"mat-paginator",26,27),t.qZA(),t.TgZ(32,"div",28)(33,"div",6)(34,"div",7),t._uU(35,"Outgoing"),t.qZA(),t._UZ(36,"div",8),t.qZA(),t.TgZ(37,"div",29),t.YNc(38,Bu,1,0,"mat-progress-bar",10),t.TgZ(39,"table",30,31),t.ynx(41,13),t.YNc(42,Hu,2,0,"th",14),t.YNc(43,zu,4,4,"td",15),t.BQk(),t.ynx(44,16),t.YNc(45,Vu,2,0,"th",14),t.YNc(46,Gu,4,4,"td",15),t.BQk(),t.ynx(47,17),t.YNc(48,Wu,2,0,"th",18),t.YNc(49,$u,4,3,"td",15),t.BQk(),t.ynx(50,19),t.YNc(51,Xu,2,0,"th",18),t.YNc(52,Ku,4,3,"td",15),t.BQk(),t.ynx(53,20),t.YNc(54,ju,2,0,"th",18),t.YNc(55,tp,4,3,"td",15),t.BQk(),t.ynx(56,32),t.YNc(57,ap,4,3,"td",22),t.BQk(),t.YNc(58,op,1,3,"tr",23),t.YNc(59,sp,1,0,"tr",24),t.YNc(60,lp,1,0,"tr",25),t.qZA(),t._UZ(61,"mat-paginator",26,33),t.qZA()()()),2&n){const e=t.oxw();t.xp6(2),t.Q6J("ngClass",t.WLB(18,rp,e.screenSize===e.screenSizeEnum.XS,e.screenSize===e.screenSizeEnum.SM)),t.xp6(5),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",e.routingPeersIncoming),t.xp6(19),t.Q6J("matFooterRowDef",t.DdM(21,cp)),t.xp6(1),t.Q6J("matHeaderRowDef",e.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",e.displayedColumns),t.xp6(1),t.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS),t.xp6(3),t.Q6J("ngClass",t.VKq(22,up,e.screenSize!==e.screenSizeEnum.LG)),t.xp6(5),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",e.routingPeersOutgoing),t.xp6(19),t.Q6J("matFooterRowDef",t.DdM(24,pp)),t.xp6(1),t.Q6J("matHeaderRowDef",e.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",e.displayedColumns),t.xp6(1),t.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}let dp=(()=>{class n{constructor(e,i,o,s){this.logger=e,this.commonService=i,this.store=o,this.camelCaseWithSpaces=s,this.nodePageDefs=l.Xk,this.selFilterByIn="all",this.selFilterByOut="all",this.colWidth="20rem",this.PAGE_ID="routing",this.tableSetting={tableId:"routing_peers",recordsPerPage:l.IV,sortBy:"totalFee",sortOrder:l.Pi.DESCENDING},this.routingPeersData=[],this.displayedColumns=[],this.routingPeersIncoming=new r.by([]),this.routingPeersOutgoing=new r.by([]),this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.filterIn="",this.filterOut="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(C.nF).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{var i,o;this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=(null===(i=e.pageSettings.find(s=>s.pageId===this.PAGE_ID))||void 0===i?void 0:i.tables.find(s=>s.tableId===this.tableSetting.tableId))||(null===(o=l.c3.find(s=>s.pageId===this.PAGE_ID))||void 0===o?void 0:o.tables.find(s=>s.tableId===this.tableSetting.tableId)),this.displayedColumns=this.screenSize===l.cu.XS||this.screenSize===l.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:l.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/(2*this.displayedColumns.length)/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(C.PP).pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.routingPeersData=e.payments&&e.payments.relayed?e.payments.relayed:[],this.routingPeersData.length>0&&this.sortIn&&this.paginatorIn&&this.sortOut&&this.paginatorOut&&this.loadRoutingPeersTable(this.routingPeersData),this.logger.info(e)})}ngAfterViewInit(){this.routingPeersData.length>0&&this.sortIn&&this.paginatorIn&&this.sortOut&&this.paginatorOut&&this.loadRoutingPeersTable(this.routingPeersData)}applyFilterIncoming(){this.routingPeersIncoming.filter=this.filterIn.trim().toLowerCase()}applyFilterOutgoing(){this.routingPeersOutgoing.filter=this.filterOut.trim().toLowerCase()}getLabel(e){const i=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(o=>o.column===e);return i?i.label?i.label:this.camelCaseWithSpaces.transform(i.column,"_"):this.commonService.titleCase(e)}setFilterPredicate(){this.routingPeersIncoming.filterPredicate=(e,i)=>{let o="";return o="all"===this.selFilterByIn?JSON.stringify(e).toLowerCase():"string"==typeof e[this.selFilterByIn]?e[this.selFilterByIn].toLowerCase():"boolean"==typeof e[this.selFilterByIn]?e[this.selFilterByIn]?"yes":"no":e[this.selFilterByIn].toString(),o.includes(i)},this.routingPeersOutgoing.filterPredicate=(e,i)=>{var o;let s="";switch(this.selFilterByOut){case"all":s=JSON.stringify(e).toLowerCase();break;case"total_amount":case"total_fee":s=(null===(o=+(e[this.selFilterByOut]||0)/1e3)||void 0===o?void 0:o.toString())||"";break;default:s="string"==typeof e[this.selFilterByOut]?e[this.selFilterByOut].toLowerCase():"boolean"==typeof e[this.selFilterByOut]?e[this.selFilterByOut]?"yes":"no":e[this.selFilterByOut].toString()}return s.includes(i)}}loadRoutingPeersTable(e){var i,o;if(e.length>0){const s=this.groupRoutingPeers(e);this.routingPeersIncoming=new r.by(s[0]),this.routingPeersIncoming.sort=this.sortIn,null===(i=this.routingPeersIncoming.sort)||void 0===i||i.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.routingPeersIncoming.paginator=this.paginatorIn,this.logger.info(this.routingPeersIncoming),this.routingPeersOutgoing=new r.by(s[1]),this.routingPeersOutgoing.sort=this.sortOut,null===(o=this.routingPeersOutgoing.sort)||void 0===o||o.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.routingPeersOutgoing.paginator=this.paginatorOut,this.logger.info(this.routingPeersOutgoing)}else this.routingPeersIncoming=new r.by([]),this.routingPeersOutgoing=new r.by([]);this.setFilterPredicate(),this.applyFilterIncoming(),this.applyFilterOutgoing()}groupRoutingPeers(e){const i=[],o=[];return e.forEach(s=>{const c=i.find(g=>g.channelId===s.fromChannelId),h=o.find(g=>g.channelId===s.toChannelId);c?(c.events++,c.totalAmount=+c.totalAmount+ +s.amountIn,c.totalFee=s.amountIn-s.amountOut+ +c.totalFee):i.push({channelId:s.fromChannelId,alias:s.fromChannelAlias,events:1,totalAmount:+s.amountIn,totalFee:s.amountIn-s.amountOut}),h?(h.events++,h.totalAmount=+h.totalAmount+ +s.amountOut,h.totalFee=s.amountIn-s.amountOut+ +h.totalFee):o.push({channelId:s.toChannelId,alias:s.toChannelAlias,events:1,totalAmount:+s.amountOut,totalFee:s.amountIn-s.amountOut})}),[this.commonService.sortDescByKey(i,"totalFee"),this.commonService.sortDescByKey(o,"totalFee")]}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(O.mQ),t.Y36(P.v),t.Y36(w.yh),t.Y36(G.i1))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-routing-peers"]],viewQuery:function(e,i){if(1&e&&(t.Gf(vu,5,S.YE),t.Gf(Tu,5,S.YE),t.Gf(Lu,5),t.Gf(bu,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.sortIn=o.first),t.iGM(o=t.CRH())&&(i.sortOut=o.first),t.iGM(o=t.CRH())&&(i.paginatorIn=o.first),t.iGM(o=t.CRH())&&(i.paginatorOut=o.first)}},features:[t._Bn([{provide:A.ye,useValue:(0,l.pt)("Peers")}])],decls:3,vars:2,consts:[["fxLayout","column","fxLayoutAlign","start stretch",1,"padding-gap"],["class","p-2 error-border my-2",4,"ngIf"],["fxLayout","column","fxLayout.gt-md","row","fxFlex","100","fxLayoutAlign","space-between stretch","class","page-sub-title-container mt-2",4,"ngIf"],[1,"p-2","error-border","my-2"],["fxLayout","column","fxLayout.gt-md","row","fxFlex","100","fxLayoutAlign","space-between stretch",1,"page-sub-title-container","mt-2"],["fxLayout","column","fxFlex","49","fxLayoutAlign","start stretch",1,"mb-4"],["fxLayout","column","fxLayout.gt-sm","row","fxLayoutAlign.gt-sm","space-between center","fxLayoutAlign","start stretch",1,"page-sub-title-container","w-100",3,"ngClass"],["fxFlex","70"],["fxFlex","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxLayoutAlign","start start","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","matSort","",1,"overflow-auto","incoming-table",3,"dataSource"],["tableIn",""],["matColumnDef","channelId"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","alias"],["matColumnDef","events"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","totalAmount"],["matColumnDef","totalFee"],["matColumnDef","no_incoming_event"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["paginatorIn",""],["fxLayout","column","fxFlex","49","fxLayoutAlign","end stretch",1,"mb-4"],["fxLayout","column","fxLayoutAlign","start end","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mat-table","","matSort","",1,"overflow-auto","outgoing-table",3,"dataSource"],["tableOut",""],["matColumnDef","no_outgoing_event"],["paginatorOut",""],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.YNc(1,Su,2,1,"div",1),t.YNc(2,mp,63,25,"div",2),t.qZA()),2&e&&(t.xp6(1),t.Q6J("ngIf",""!==i.errorMessage),t.xp6(1),t.Q6J("ngIf",""===i.errorMessage))},directives:[m.xw,m.Wh,u.O5,m.yH,u.mk,Z.oO,H.$V,M.pW,r.BZ,S.YE,r.w1,r.fO,r.ge,S.nU,r.Dz,r.ev,u.PC,Z.Zl,r.mD,r.yh,r.Ke,r.Q2,r.as,r.XQ,r.nj,r.Gk,A.NW],pipes:[u.JJ],styles:[""]}),n})();function hp(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",7),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw().activeLink=s.link}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit,i=t.oxw();t.s9C("routerLink",e.link),t.Q6J("active",i.activeLink===e.link),t.xp6(1),t.Oqu(e.name)}}let _p=(()=>{class n{constructor(e){this.router=e,this.faChartBar=L.koM,this.links=[{link:"routingreport",name:"Routing"},{link:"transactions",name:"Transactions"}],this.activeLink=this.links[0].link,this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){const e=this.links.find(i=>this.router.url.includes(i.link));this.activeLink=e?e.link:this.links[0].link,this.router.events.pipe((0,_.R)(this.unSubs[0]),(0,Q.h)(i=>i instanceof x.Av)).subscribe({next:i=>{const o=this.links.find(s=>i.urlAfterRedirects.includes(s.link));this.activeLink=o?o.link:this.links[0].link}})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-reports"]],decls:10,vars:2,consts:[["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x"],["fxLayout","column"],["mat-tab-nav-bar",""],["role","tab","mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["role","tab","mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t._UZ(1,"fa-icon",1),t.TgZ(2,"span",2),t._uU(3,"Reports"),t.qZA()(),t.TgZ(4,"div",3)(5,"mat-card")(6,"mat-card-content",4)(7,"nav",5),t.YNc(8,hp,2,3,"div",6),t.qZA(),t._UZ(9,"router-outlet"),t.qZA()()()),2&e&&(t.xp6(1),t.Q6J("icon",i.faChartBar),t.xp6(7),t.Q6J("ngForOf",i.links))},directives:[m.xw,m.Wh,q.BN,b.a8,b.dn,R.BU,u.sg,R.Nj,x.rH,x.lC],styles:[""]}),n})();var Mt=f(7772),Qt=f(7671),Yt=f(1210);function gp(n,a){if(1&n&&(t.TgZ(0,"div",13),t._uU(1),t.ALo(2,"number"),t.ALo(3,"number"),t.qZA()),2&n){const e=t.oxw();t.Q6J("@fadeIn",e.totalFeeSat),t.xp6(1),t.AsE("",t.xi3(2,3,e.totalFeeSat||0,"1.0-2")," Sats/",t.lcZ(3,6,e.filteredEventsBySelectedPeriod.length||0)," Events")}}function fp(n,a){1&n&&(t.TgZ(0,"div",14),t._uU(1,"No routing report for the selected period"),t.qZA())}function Cp(n,a){if(1&n&&(t.TgZ(0,"span")(1,"span",17),t._uU(2),t.ALo(3,"number"),t.qZA(),t.TgZ(4,"span",17),t._uU(5),t.ALo(6,"number"),t.qZA()()),2&n){const e=a.model,i=t.oxw(2);t.xp6(2),t.hij("Events: ",t.lcZ(3,2,(i.selReportBy===i.reportBy.EVENTS?e.value:e.extra.totalEvents)||0),""),t.xp6(3),t.hij("Fee: ",t.xi3(6,4,(i.selReportBy===i.reportBy.EVENTS?e.extra.totalFees:e.value)||0,"1.0-2"),"")}}function xp(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"ngx-charts-bar-vertical",15),t.NdJ("select",function(o){return t.CHM(e),t.oxw().onChartBarSelected(o)})("mouseup",function(o){return t.CHM(e),t.oxw().onChartMouseUp(o)}),t.YNc(1,Cp,7,7,"ng-template",null,16,t.W1O),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("view",e.view)("results",e.routingReportData)("gradient",!1)("xAxis",!0)("yAxis",!0)("showXAxisLabel",!0)("showYAxisLabel",e.showYAxisLabel)("xAxisLabel",e.xAxisLabel)("yAxisLabel",e.yAxisLabel)("showGridLines",!1)("showDataLabel",!1)}}function yp(n,a){if(1&n&&t._UZ(0,"rtl-ecl-forwarding-history",18),2&n){const e=t.oxw();t.Q6J("pageId","reports")("tableId","routing")("eventsData",e.filteredEventsBySelectedPeriod)("selFilter",e.eventFilterValue)}}let vp=(()=>{class n{constructor(e,i,o){this.logger=e,this.commonService=i,this.store=o,this.reportPeriod=l.op[0],this.secondsInADay=86400,this.events=[],this.filteredEventsBySelectedPeriod=[],this.eventFilterValue="",this.reportBy=l.Xr,this.selReportBy=l.Xr.FEES,this.totalFeeSat=null,this.today=new Date(Date.now()),this.startDate=new Date(this.today.getFullYear(),this.today.getMonth(),1,0,0,0),this.endDate=new Date(this.today.getFullYear(),this.today.getMonth(),this.getMonthDays(this.today.getMonth(),this.today.getFullYear()),23,59,59),this.routingReportData=[],this.view=[350,350],this.screenPaddingX=100,this.gradient=!0,this.xAxisLabel="Date",this.yAxisLabel="Fee (Sats)",this.showYAxisLabel=!0,this.screenSize="",this.screenSizeEnum=l.cu,this.unSubs=[new p.x,new p.x]}ngOnInit(){this.screenSize=this.commonService.getScreenSize(),this.showYAxisLabel=!(this.screenSize===l.cu.XS||this.screenSize===l.cu.SM),this.store.select(C.PP).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{this.events=e.payments&&e.payments.relayed?e.payments.relayed:[],this.filterForwardingEvents(this.startDate,this.endDate),this.logger.info(e)}),this.commonService.containerSizeUpdated.pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{switch(this.screenSize){case l.cu.MD:this.screenPaddingX=e.width/10;break;case l.cu.LG:this.screenPaddingX=e.width/16;break;default:this.screenPaddingX=e.width/20}this.view=[e.width-this.screenPaddingX,e.height/2.2],this.logger.info("Container Size: "+JSON.stringify(e)),this.logger.info("View: "+JSON.stringify(this.view))})}filterForwardingEvents(e,i){const o=Math.round(e.getTime()/1e3),s=Math.round(i.getTime()/1e3);this.logger.info("Filtering Forwarding Events Starting at "+new Date(Date.now()).toLocaleString()+" From "+e.toLocaleString()+" To "+i.toLocaleString()),this.filteredEventsBySelectedPeriod=[],this.routingReportData=[],this.totalFeeSat=null,this.events&&this.events.length>0&&(this.events.forEach(c=>{Math.floor((c.timestamp||0)/1e3)>=o&&Math.floor((c.timestamp||0)/1e3)<s&&this.filteredEventsBySelectedPeriod.push(c)}),this.routingReportData=this.selReportBy===this.reportBy.EVENTS?this.prepareEventsReport(e):this.prepareFeeReport(e)),this.logger.info("Filtering Forwarding Events Finished at "+new Date(Date.now()).toLocaleString())}onChartMouseUp(e){"svg"===e.srcElement.tagName&&e.srcElement.classList.length>0&&"ngx-charts"===e.srcElement.classList[0]&&(this.eventFilterValue="")}onChartBarSelected(e){this.eventFilterValue=this.reportPeriod===l.op[1]?e.name+"/"+this.startDate.getFullYear():e.name.toString().padStart(2,"0")+"/"+l.gg[this.startDate.getMonth()].name+"/"+this.startDate.getFullYear()}prepareFeeReport(e){var i,o;const s=Math.round(e.getTime()/1e3),c=[];if(this.totalFeeSat=0,this.logger.info("Fee Report Prepare Starting at "+new Date(Date.now()).toLocaleString()+" From "+e.toLocaleString()),this.reportPeriod===l.op[1]){for(let h=0;h<12;h++)c.push({name:l.gg[h].name,value:0,extra:{totalEvents:0}});null===(i=this.filteredEventsBySelectedPeriod)||void 0===i||i.map(h=>{const g=new Date(h.timestamp||0).getMonth();return c[g].value=c[g].value+((h.amountIn||0)-(h.amountOut||0)),c[g].extra.totalEvents=c[g].extra.totalEvents+1,this.totalFeeSat=(this.totalFeeSat?this.totalFeeSat:0)+((h.amountIn||0)-(h.amountOut||0)),this.filteredEventsBySelectedPeriod})}else{for(let h=0;h<this.getMonthDays(e.getMonth(),e.getFullYear());h++)c.push({name:h+1,value:0,extra:{totalEvents:0}});null===(o=this.filteredEventsBySelectedPeriod)||void 0===o||o.map(h=>{const g=Math.floor((Math.floor((h.timestamp||0)/1e3)-s)/this.secondsInADay);return c[g].value=c[g].value+((h.amountIn||0)-(h.amountOut||0)),c[g].extra.totalEvents=c[g].extra.totalEvents+1,this.totalFeeSat=(this.totalFeeSat?this.totalFeeSat:0)+((h.amountIn||0)-(h.amountOut||0)),this.filteredEventsBySelectedPeriod})}return this.logger.info("Fee Report Prepare Finished at "+new Date(Date.now()).toLocaleString()),c}prepareEventsReport(e){var i,o;const s=Math.round(e.getTime()/1e3),c=[];if(this.totalFeeSat=0,this.logger.info("Events Report Prepare Starting at "+new Date(Date.now()).toLocaleString()+" From "+e.toLocaleString()),this.reportPeriod===l.op[1]){for(let h=0;h<12;h++)c.push({name:l.gg[h].name,value:0,extra:{totalFees:0}});null===(i=this.filteredEventsBySelectedPeriod)||void 0===i||i.map(h=>{const g=new Date(h.timestamp||0).getMonth();return c[g].value=c[g].value+1,c[g].extra.totalFees=c[g].extra.totalFees+((h.amountIn||0)-(h.amountOut||0)),this.totalFeeSat=(this.totalFeeSat?this.totalFeeSat:0)+((h.amountIn||0)-(h.amountOut||0)),this.filteredEventsBySelectedPeriod})}else{for(let h=0;h<this.getMonthDays(e.getMonth(),e.getFullYear());h++)c.push({name:h+1,value:0,extra:{totalFees:0}});null===(o=this.filteredEventsBySelectedPeriod)||void 0===o||o.map(h=>{const g=Math.floor((Math.floor((h.timestamp||0)/1e3)-s)/this.secondsInADay);return c[g].value=c[g].value+1,c[g].extra.totalFees=c[g].extra.totalFees+((h.amountIn||0)-(h.amountOut||0)),this.totalFeeSat=(this.totalFeeSat?this.totalFeeSat:0)+((h.amountIn||0)-(h.amountOut||0)),this.filteredEventsBySelectedPeriod})}return this.logger.info("Events Report Prepare Finished at "+new Date(Date.now()).toLocaleString()),c}onSelectionChange(e){const i=e.selDate.getMonth(),o=e.selDate.getFullYear();this.reportPeriod=e.selScrollRange,this.reportPeriod===l.op[1]?(this.startDate=new Date(o,0,1,0,0,0),this.endDate=new Date(o,11,31,23,59,59)):(this.startDate=new Date(o,i,1,0,0,0),this.endDate=new Date(o,i,this.getMonthDays(i,o),23,59,59)),this.filterForwardingEvents(this.startDate,this.endDate),this.eventFilterValue=""}getMonthDays(e,i){return 1===e&&i%4==0?l.gg[e].days+1:l.gg[e].days}onSelReportByChange(){this.yAxisLabel=this.selReportBy===this.reportBy.EVENTS?"Events":"Fee (Sats)",this.routingReportData=this.selReportBy===this.reportBy.EVENTS?this.prepareEventsReport(this.startDate):this.prepareFeeReport(this.startDate)}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(O.mQ),t.Y36(P.v),t.Y36(w.yh))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-routing-report"]],hostBindings:function(e,i){1&e&&t.NdJ("mouseup",function(s){return i.onChartMouseUp(s)})},decls:17,vars:7,consts:[["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"padding-gap-x-large"],[3,"stepChanged"],["fxLayout","column","fxLayoutAlign","center center",1,"padding-gap-x"],["color","primary","name","selReportBy","fxFlex","100","fxLayoutAlign","start start",1,"my-1",3,"ngModel","ngModelChange","change"],[1,"mr-2"],["tabindex","1",1,"mr-2",3,"value"],["tabindex","2",3,"value"],["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"padding-gap-x"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100","class","font-size-120 font-bold-700 mt-1",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100","class","font-size-120 mt-1",4,"ngIf"],[1,"mt-1"],["class","one-color",3,"view","results","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","select","mouseup",4,"ngIf"],[3,"pageId","tableId","eventsData","selFilter",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","font-bold-700","mt-1"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","mt-1"],[1,"one-color",3,"view","results","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","select","mouseup"],["tooltipTemplate",""],[1,"tooltip-label"],[3,"pageId","tableId","eventsData","selFilter"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"rtl-horizontal-scroller",1),t.NdJ("stepChanged",function(s){return i.onSelectionChange(s)}),t.qZA(),t.TgZ(2,"div",2)(3,"mat-radio-group",3),t.NdJ("ngModelChange",function(s){return i.selReportBy=s})("change",function(){return i.onSelReportByChange()}),t.TgZ(4,"span",4),t._uU(5,"Report By: "),t.qZA(),t.TgZ(6,"mat-radio-button",5),t._uU(7,"Fees"),t.qZA(),t.TgZ(8,"mat-radio-button",6),t._uU(9,"Events"),t.qZA()()(),t.TgZ(10,"div",7),t.YNc(11,gp,4,8,"div",8),t.YNc(12,fp,2,0,"div",9),t.TgZ(13,"div",10),t.YNc(14,xp,3,11,"ngx-charts-bar-vertical",11),t.qZA(),t.TgZ(15,"div",10),t.YNc(16,yp,1,4,"rtl-ecl-forwarding-history",12),t.qZA()()()),2&e&&(t.xp6(3),t.Q6J("ngModel",i.selReportBy),t.xp6(3),t.s9C("value",i.reportBy.FEES),t.xp6(2),t.s9C("value",i.reportBy.EVENTS),t.xp6(3),t.Q6J("ngIf",i.routingReportData.length>0&&i.filteredEventsBySelectedPeriod.length>0),t.xp6(1),t.Q6J("ngIf",i.routingReportData.length<=0||i.filteredEventsBySelectedPeriod.length<=0),t.xp6(2),t.Q6J("ngIf",i.routingReportData.length>0&&i.filteredEventsBySelectedPeriod.length>0),t.xp6(2),t.Q6J("ngIf",i.filteredEventsBySelectedPeriod.length>0))},directives:[m.xw,m.Wh,m.yH,Qt.D,it.VQ,d.JJ,d.On,it.U0,u.O5,Yt.K$,Dt],pipes:[u.JJ],styles:[""],data:{animation:[Mt.J]}}),n})();var Tp=f(165);function Lp(n,a){if(1&n&&(t.TgZ(0,"div",10),t._uU(1),t.ALo(2,"number"),t.ALo(3,"number"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.AsE(" Paid ",t.xi3(2,2,e.transactionsReportSummary.amountPaidSelectedPeriod||0,"1.0-2")," Sats/",t.lcZ(3,5,e.transactionsReportSummary.paymentsSelectedPeriod)," Payments ")}}function bp(n,a){if(1&n&&(t.TgZ(0,"div",10),t._uU(1),t.ALo(2,"number"),t.ALo(3,"number"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.AsE(" Received ",t.xi3(2,2,e.transactionsReportSummary.amountReceivedSelectedPeriod||0,"1.0-2")," Sats/",t.lcZ(3,5,e.transactionsReportSummary.invoicesSelectedPeriod)," Invoices ")}}function Sp(n,a){if(1&n&&(t.TgZ(0,"div",8),t.YNc(1,Lp,4,7,"div",9),t.YNc(2,bp,4,7,"div",9),t.qZA()),2&n){const e=t.oxw();t.Q6J("@fadeIn",e.transactionsReportSummary),t.xp6(1),t.Q6J("ngIf",e.transactionsReportSummary.paymentsSelectedPeriod),t.xp6(1),t.Q6J("ngIf",e.transactionsReportSummary.invoicesSelectedPeriod)}}function Zp(n,a){1&n&&(t.TgZ(0,"div",11),t._uU(1,"No transactions report for the selected period"),t.qZA())}function Ap(n,a){if(1&n&&(t.TgZ(0,"span",14),t._uU(1),t.ALo(2,"number"),t.ALo(3,"number"),t.qZA()),2&n){const e=a.model;t.xp6(1),t.HOy("",e.name,": ",t.xi3(2,4,e.value||0,"1.0-2"),"/# ","Paid"===e.name?"Payments":"Invoices",": ",t.lcZ(3,7,(null==e.extra?null:e.extra.total)||0),"")}}function Ep(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"ngx-charts-bar-vertical-2d",12),t.NdJ("select",function(o){return t.CHM(e),t.oxw().onChartBarSelected(o)})("mouseup",function(o){return t.CHM(e),t.oxw().onChartMouseUp(o)}),t.YNc(1,Ap,4,9,"ng-template",null,13,t.W1O),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("view",e.view)("results",e.transactionsReportData)("noBarWhenZero",!1)("gradient",!1)("xAxis",!0)("yAxis",!0)("showXAxisLabel",!0)("showYAxisLabel",e.showYAxisLabel)("xAxisLabel",e.xAxisLabel)("yAxisLabel",e.yAxisLabel)("showGridLines",!1)("showDataLabel",!1)("groupPadding",e.reportPeriod===e.scrollRanges[0]?2:8)}}function wp(n,a){if(1&n&&t._UZ(0,"rtl-transactions-report-table",15),2&n){const e=t.oxw();t.Q6J("displayedColumns",e.displayedColumns)("tableSetting",e.tableSetting)("dataList",e.transactionsNonZeroReportData)("dataRange",e.reportPeriod)("selFilter",e.transactionFilterValue)}}let Ip=(()=>{class n{constructor(e,i,o){this.logger=e,this.commonService=i,this.store=o,this.scrollRanges=l.op,this.reportPeriod=l.op[0],this.secondsInADay=86400,this.payments=[],this.invoices=[],this.colWidth="20rem",this.PAGE_ID="reports",this.tableSetting={tableId:"transactions",recordsPerPage:l.IV,sortBy:"date",sortOrder:l.Pi.DESCENDING},this.displayedColumns=["date","amount_paid","num_payments","amount_received","num_invoices"],this.transactionsReportSummary={paymentsSelectedPeriod:0,invoicesSelectedPeriod:0,amountPaidSelectedPeriod:0,amountReceivedSelectedPeriod:0},this.transactionFilterValue="",this.today=new Date(Date.now()),this.startDate=new Date(this.today.getFullYear(),this.today.getMonth(),1,0,0,0),this.endDate=new Date(this.today.getFullYear(),this.today.getMonth(),this.getMonthDays(this.today.getMonth(),this.today.getFullYear()),23,59,59),this.transactionsReportData=[],this.transactionsNonZeroReportData=[],this.view=[350,350],this.screenPaddingX=100,this.gradient=!0,this.xAxisLabel="Date",this.yAxisLabel="Amount (Sats)",this.showYAxisLabel=!0,this.screenSize="",this.screenSizeEnum=l.cu,this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.screenSize=this.commonService.getScreenSize(),this.showYAxisLabel=!(this.screenSize===l.cu.XS||this.screenSize===l.cu.SM),this.store.select(C.nF).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{var i,o;this.tableSetting=(null===(i=e.pageSettings.find(s=>s.pageId===this.PAGE_ID))||void 0===i?void 0:i.tables.find(s=>s.tableId===this.tableSetting.tableId))||(null===(o=l.c3.find(s=>s.pageId===this.PAGE_ID))||void 0===o?void 0:o.tables.find(s=>s.tableId===this.tableSetting.tableId)),this.displayedColumns=this.screenSize===l.cu.XS||this.screenSize===l.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.push("actions"),this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(C.PP).pipe((0,_.R)(this.unSubs[1]),(0,ot.M)(this.store.select(C.Ef))).subscribe(([e,i])=>{this.payments=e.payments.sent?e.payments.sent:[],this.invoices=i.invoices?i.invoices:[],(this.payments.length>0||this.invoices.length>0)&&(this.transactionsReportData=this.filterTransactionsForSelectedPeriod(this.startDate,this.endDate),this.transactionsNonZeroReportData=this.prepareTableData())}),this.commonService.containerSizeUpdated.pipe((0,_.R)(this.unSubs[2])).subscribe(e=>{switch(this.screenSize){case l.cu.MD:this.screenPaddingX=e.width/10;break;case l.cu.LG:this.screenPaddingX=e.width/16;break;default:this.screenPaddingX=e.width/20}this.view=[e.width-this.screenPaddingX,e.height/2.2],this.logger.info("Container Size: "+JSON.stringify(e)),this.logger.info("View: "+JSON.stringify(this.view))})}onChartMouseUp(e){"svg"===e.srcElement.tagName&&e.srcElement.classList.length>0&&"ngx-charts"===e.srcElement.classList[0]&&(this.transactionFilterValue="")}onChartBarSelected(e){this.transactionFilterValue=this.reportPeriod===l.op[1]?e.series.toString()+"/"+this.startDate.getFullYear():e.series.toString().padStart(2,"0")+"/"+l.gg[this.startDate.getMonth()].name+"/"+this.startDate.getFullYear()}filterTransactionsForSelectedPeriod(e,i){var o,s;const c=Math.round(e.getTime()/1e3),h=Math.round(i.getTime()/1e3),g=[];this.transactionsReportSummary={paymentsSelectedPeriod:0,invoicesSelectedPeriod:0,amountPaidSelectedPeriod:0,amountReceivedSelectedPeriod:0};const v=null===(o=this.payments)||void 0===o?void 0:o.filter(T=>T.firstPartTimestamp&&Math.floor(T.firstPartTimestamp/1e3)>=c&&Math.floor(T.firstPartTimestamp/1e3)<h),B=null===(s=this.invoices)||void 0===s?void 0:s.filter(T=>"received"===T.status&&T.timestamp&&T.timestamp>=c&&T.timestamp<h);if(this.transactionsReportSummary.paymentsSelectedPeriod=v.length,this.transactionsReportSummary.invoicesSelectedPeriod=B.length,this.reportPeriod===l.op[1]){for(let T=0;T<12;T++)g.push({name:l.gg[T].name,date:new Date(e.getFullYear(),T,1,0,0,0,0),series:[{name:"Paid",value:0,extra:{total:0}},{name:"Received",value:0,extra:{total:0}}]});null==v||v.map(T=>{const F=new Date(T.firstPartTimestamp||0).getMonth();return this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+(T.recipientAmount||0),g[F].series[0].value=g[F].series[0].value+T.recipientAmount,g[F].series[0].extra.total=g[F].series[0].extra.total+1,this.transactionsReportSummary}),null==B||B.map(T=>{const F=new Date(1e3*(T.timestamp||0)).getMonth();return this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+(T.amountSettled||0),g[F].series[1].value=g[F].series[1].value+T.amountSettled,g[F].series[1].extra.total=g[F].series[1].extra.total+1,this.transactionsReportSummary})}else{for(let T=0;T<this.getMonthDays(e.getMonth(),e.getFullYear());T++)g.push({name:(T+1).toString(),date:new Date(1e3*(T*this.secondsInADay+c)),series:[{name:"Paid",value:0,extra:{total:0}},{name:"Received",value:0,extra:{total:0}}]});null==v||v.map(T=>{const F=Math.floor((Math.floor((T.firstPartTimestamp||0)/1e3)-c)/this.secondsInADay);return this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+(T.recipientAmount||0),g[F].series[0].value=g[F].series[0].value+T.recipientAmount,g[F].series[0].extra.total=g[F].series[0].extra.total+1,this.transactionsReportSummary}),null==B||B.map(T=>{const F=Math.floor(((T.timestamp||0)-c)/this.secondsInADay);return this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+(T.amountSettled||0),g[F].series[1].value=g[F].series[1].value+T.amountSettled,g[F].series[1].extra.total=g[F].series[1].extra.total+1,this.transactionsReportSummary})}return g}prepareTableData(){var e;return null===(e=this.transactionsReportData)||void 0===e?void 0:e.reduce((i,o)=>o.series[0].extra.total>0||o.series[1].extra.total>0?i.concat({date:o.date,amount_paid:o.series[0].value,num_payments:o.series[0].extra.total,amount_received:o.series[1].value,num_invoices:o.series[1].extra.total}):i,[])}onSelectionChange(e){const i=e.selDate.getMonth(),o=e.selDate.getFullYear();this.reportPeriod=e.selScrollRange,this.reportPeriod===l.op[1]?(this.startDate=new Date(o,0,1,0,0,0),this.endDate=new Date(o,11,31,23,59,59)):(this.startDate=new Date(o,i,1,0,0,0),this.endDate=new Date(o,i,this.getMonthDays(i,o),23,59,59)),this.transactionsReportData=this.filterTransactionsForSelectedPeriod(this.startDate,this.endDate),this.transactionsNonZeroReportData=this.prepareTableData(),this.transactionFilterValue=""}getMonthDays(e,i){return 1===e&&i%4==0?l.gg[e].days+1:l.gg[e].days}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(O.mQ),t.Y36(P.v),t.Y36(w.yh))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-transactions-report"]],hostBindings:function(e,i){1&e&&t.NdJ("mouseup",function(s){return i.onChartMouseUp(s)})},decls:9,vars:4,consts:[["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"padding-gap-x-large"],[3,"stepChanged"],["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"padding-gap-x"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100","class","font-size-120 font-bold-700 mt-1",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100","class","font-size-120 mt-1",4,"ngIf"],[1,"mt-1"],["class","two-color",3,"view","results","noBarWhenZero","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","groupPadding","select","mouseup",4,"ngIf"],[3,"displayedColumns","tableSetting","dataList","dataRange","selFilter",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","font-bold-700","mt-1"],["fxLayout","row","fxLayoutAlign","start stretch","fxFlex","100",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start stretch","fxFlex","100"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","mt-1"],[1,"two-color",3,"view","results","noBarWhenZero","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","groupPadding","select","mouseup"],["tooltipTemplate",""],[1,"tooltip-label"],[3,"displayedColumns","tableSetting","dataList","dataRange","selFilter"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"rtl-horizontal-scroller",1),t.NdJ("stepChanged",function(s){return i.onSelectionChange(s)}),t.qZA(),t.TgZ(2,"div",2),t.YNc(3,Sp,3,3,"div",3),t.YNc(4,Zp,2,0,"div",4),t.TgZ(5,"div",5),t.YNc(6,Ep,3,13,"ngx-charts-bar-vertical-2d",6),t.qZA(),t.TgZ(7,"div",5),t.YNc(8,wp,1,5,"rtl-transactions-report-table",7),t.qZA()()()),2&e&&(t.xp6(3),t.Q6J("ngIf",i.transactionsNonZeroReportData.length>0),t.xp6(1),t.Q6J("ngIf",i.transactionsNonZeroReportData.length<=0),t.xp6(2),t.Q6J("ngIf",i.transactionsNonZeroReportData.length>0),t.xp6(2),t.Q6J("ngIf",i.transactionsNonZeroReportData.length>0))},directives:[m.xw,m.Wh,m.yH,Qt.D,u.O5,Yt.H5,Tp.g],pipes:[u.JJ],styles:[""],data:{animation:[Mt.J]}}),n})();var I=f(1643),Fp=f(9442);function qp(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",8),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw().activeLink=s.link}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit,i=t.oxw();t.s9C("routerLink",e.link),t.Q6J("active",i.activeLink===e.link),t.xp6(1),t.Oqu(e.name)}}const Pp=x.Bz.forChild([{path:"",component:Ct,children:[{path:"",pathMatch:"full",redirectTo:"home"},{path:"home",component:Ca,canActivate:[I.fY]},{path:"onchain",component:so,canActivate:[I.fY],children:[{path:"",pathMatch:"full",redirectTo:"receive"},{path:"receive",component:Uo,canActivate:[I.fY]},{path:"send",component:Ro,canActivate:[I.fY]}]},{path:"connections",component:co,canActivate:[I.fY],children:[{path:"",pathMatch:"full",redirectTo:"channels"},{path:"channels",component:es,canActivate:[I.fY],children:[{path:"",pathMatch:"full",redirectTo:"open"},{path:"open",component:nl,canActivate:[I.fY]},{path:"pending",component:Jl,canActivate:[I.fY]},{path:"inactive",component:Ic,canActivate:[I.fY]}]},{path:"peers",component:Ar,data:{sweepAll:!1},canActivate:[I.fY]}]},{path:"transactions",component:po,canActivate:[I.fY],children:[{path:"",pathMatch:"full",redirectTo:"payments"},{path:"payments",component:St,canActivate:[I.fY]},{path:"invoices",component:Lt,canActivate:[I.fY]}]},{path:"routing",component:ho,canActivate:[I.fY],children:[{path:"",pathMatch:"full",redirectTo:"forwardinghistory"},{path:"forwardinghistory",component:Dt,canActivate:[I.fY]},{path:"peers",component:dp,canActivate:[I.fY]}]},{path:"reports",component:_p,canActivate:[I.fY],children:[{path:"",pathMatch:"full",redirectTo:"routingreport"},{path:"routingreport",component:vp,canActivate:[I.fY]},{path:"transactions",component:Ip,canActivate:[I.fY]}]},{path:"graph",component:(()=>{class n{constructor(e){this.router=e,this.faSearch=L.wn1,this.links=[{link:"lookups",name:"Lookup"},{link:"queryroutes",name:"Query Routes"}],this.activeLink=this.links[0].link,this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){const e=this.links.find(i=>this.router.url.includes(i.link));this.activeLink=e?e.link:this.links[0].link,this.router.events.pipe((0,_.R)(this.unSubs[0]),(0,Q.h)(i=>i instanceof x.Av)).subscribe({next:i=>{const o=this.links.find(s=>i.urlAfterRedirects.includes(s.link));this.activeLink=o?o.link:this.links[0].link}})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-graph"]],decls:11,vars:2,consts:[["fxLayout","row wrap","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x"],["fxLayout","column"],["mat-tab-nav-bar",""],["role","tab","mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"mat-tab-body-wrapper"],["role","tab","mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t._UZ(1,"fa-icon",1),t.TgZ(2,"span",2),t._uU(3,"Graph Lookups"),t.qZA()(),t.TgZ(4,"div",3)(5,"mat-card")(6,"mat-card-content",4)(7,"nav",5),t.YNc(8,qp,2,3,"div",6),t.qZA(),t.TgZ(9,"div",7),t._UZ(10,"router-outlet"),t.qZA()()()()),2&e&&(t.xp6(1),t.Q6J("icon",i.faSearch),t.xp6(7),t.Q6J("ngForOf",i.links))},directives:[m.xw,m.Wh,q.BN,b.a8,b.dn,R.BU,u.sg,R.Nj,x.rH,m.yH,x.lC],styles:[""]}),n})(),canActivate:[I.fY],children:[{path:"",pathMatch:"full",redirectTo:"lookups"},{path:"lookups",component:Oo,canActivate:[I.fY]},{path:"queryroutes",component:Qr,canActivate:[I.fY]}]},{path:"**",component:Fp.w}]}]);var Up=f(8750);let Rp=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n,bootstrap:[Ct]}),n.\u0275inj=t.cJS({providers:[I.fY],imports:[[u.ez,Up.m,Pp]]}),n})()}}]);