You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
RTL/angular/6.eee0e0f329ec52d3bce7.js

1 line
263 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{YoDt:function(t,e,n){"use strict";n.r(e),n.d(e,"ECLModule",function(){return kl});var a=n("SVse"),i=n("iInd"),o=n("JTFm"),s=n("8Y7J"),c=n("VDRc"),l=n("BTe0");function r(t,e){1&t&&s.Qb(0,"mat-progress-bar",3)}let b=(()=>{class t{constructor(t){this.router=t,this.loading=!1,this.router.events.subscribe(t=>{switch(!0){case t instanceof i.e:this.loading=!0;break;case t instanceof i.c:case t instanceof i.b:case t instanceof i.d:this.loading=!1}})}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(i.g))},t.\u0275cmp=s.Jb({type:t,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(t,e){1&t&&(s.Vb(0,"div",0),s.Ic(1,r,1,0,"mat-progress-bar",1),s.Qb(2,"router-outlet",null,2),s.Ub()),2&t&&(s.Db(1),s.oc("ngIf",e.loading))},directives:[c.c,c.a,c.b,a.o,i.l,l.a],styles:[""],data:{animation:[o.a]}}),t})();var d=n("XNiG"),u=n("1G5W"),h=n("pLZG"),m=n("twK/"),f=n("wHSu"),p=n("7nzP"),g=n("lF6s"),y=n("cpEJ"),x=n("tqRt"),v=n("7bNT"),S=n("7o2P"),w=n("Nv++"),D=n("40+f"),C=n("PDjf"),V=n("rJgo"),U=n("Dxy4"),I=n("Tj54"),L=n("ura0");const A=function(t){return{backgroundColor:t}};function P(t,e){if(1&t&&s.Qb(0,"span",6),2&t){const t=s.hc();s.oc("ngStyle",s.sc(1,A,t.information.color))}}function F(t,e){if(1&t&&(s.Vb(0,"div"),s.Vb(1,"h4",1),s.Kc(2,"Color"),s.Ub(),s.Vb(3,"div",2),s.Qb(4,"span",7),s.Kc(5),s.ic(6,"uppercase"),s.Ub(),s.Ub()),2&t){const t=s.hc();s.Db(4),s.oc("ngStyle",s.sc(4,A,t.information.color)),s.Db(1),s.Mc(" ",s.jc(6,2,t.information.color)," ")}}function k(t,e){if(1&t&&(s.Vb(0,"span",2),s.Kc(1),s.Ub()),2&t){const t=e.$implicit;s.Db(1),s.Lc(t)}}let O=(()=>{class t{constructor(t){this.commonService=t,this.chains=[""]}ngOnChanges(){this.chains=[],this.chains.push("Bitcoin "+(this.information.network?this.commonService.titleCase(this.information.network):"Testnet"))}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(S.a))},t.\u0275cmp=s.Jb({type:t,selectors:[["rtl-ecl-node-info"]],inputs:{information:"information",showColorFieldSeparately:"showColorFieldSeparately"},features:[s.Bb],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(t,e){1&t&&(s.Vb(0,"div",0),s.Vb(1,"div"),s.Vb(2,"h4",1),s.Kc(3,"Alias"),s.Ub(),s.Vb(4,"div",2),s.Kc(5),s.Ic(6,P,1,3,"span",3),s.Ub(),s.Ub(),s.Ic(7,F,7,6,"div",4),s.Vb(8,"div"),s.Vb(9,"h4",1),s.Kc(10,"Implementation"),s.Ub(),s.Vb(11,"div",2),s.Kc(12),s.Ub(),s.Ub(),s.Vb(13,"div"),s.Vb(14,"h4",1),s.Kc(15,"Chain"),s.Ub(),s.Ic(16,k,2,1,"span",5),s.Ub(),s.Ub()),2&t&&(s.Db(5),s.Mc(" ",e.information.alias," "),s.Db(1),s.oc("ngIf",!e.showColorFieldSeparately),s.Db(1),s.oc("ngIf",e.showColorFieldSeparately),s.Db(5),s.Lc(e.information.lnImplementation||e.information.version?e.information.lnImplementation+" "+e.information.version:""),s.Db(4),s.oc("ngForOf",e.chains))},directives:[c.c,c.a,c.b,a.o,a.n,a.p,L.b],pipes:[a.y],styles:[""]}),t})(),T=(()=>{class t{constructor(){this.balances={onchain:0,lightning:0,total:0}}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=s.Jb({type:t,selectors:[["rtl-ecl-balances-info"]],inputs:{balances:"balances"},decls:21,vars:11,consts:[["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"]],template:function(t,e){1&t&&(s.Vb(0,"div",0),s.Vb(1,"div"),s.Vb(2,"h4",1),s.Kc(3,"Lightning"),s.Ub(),s.Vb(4,"div",2),s.Kc(5),s.ic(6,"number"),s.Ub(),s.Qb(7,"mat-progress-bar",3),s.Ub(),s.Vb(8,"div"),s.Vb(9,"h4",1),s.Kc(10,"On-chain"),s.Ub(),s.Vb(11,"div",2),s.Kc(12),s.ic(13,"number"),s.Ub(),s.Qb(14,"mat-progress-bar",3),s.Ub(),s.Vb(15,"div"),s.Vb(16,"h4",1),s.Kc(17,"Total"),s.Ub(),s.Vb(18,"div",2),s.Kc(19),s.ic(20,"number"),s.Ub(),s.Ub(),s.Ub()),2&t&&(s.Db(5),s.Mc("",s.jc(6,5,e.balances.lightning)," Sats"),s.Db(2),s.pc("value",e.balances.lightning/e.balances.total*100),s.Db(5),s.Mc("",s.jc(13,7,e.balances.onchain)," Sats"),s.Db(2),s.pc("value",e.balances.onchain/e.balances.total*100),s.Db(5),s.Mc("",s.jc(20,9,e.balances.total)," Sats"))},directives:[c.c,c.a,c.b,l.a],pipes:[a.f],styles:[""]}),t})();var R=n("Q2Ze"),K=n("ZFy/"),M=n("BSbQ"),z=n("aLe/");function E(t,e){if(1&t&&(s.Vb(0,"div",17),s.Vb(1,"span",18),s.Kc(2),s.ic(3,"slice"),s.Ub(),s.Vb(4,"div",3),s.Vb(5,"mat-hint",19),s.Vb(6,"strong",5),s.Kc(7,"Local:"),s.Ub(),s.Kc(8),s.ic(9,"number"),s.Ub(),s.Vb(10,"mat-hint",20),s.Qb(11,"fa-icon",21),s.Kc(12),s.ic(13,"number"),s.Ub(),s.Vb(14,"mat-hint",22),s.Vb(15,"strong",5),s.Kc(16,"Remote:"),s.Ub(),s.Kc(17),s.ic(18,"number"),s.Ub(),s.Ub(),s.Qb(19,"mat-progress-bar",23),s.Ub()),2&t){const t=e.$implicit,n=s.hc(2);s.Db(1),s.pc("matTooltip",t.alias||t.shortChannelId),s.pc("matTooltipDisabled",(t.alias||t.shortChannelId).length<26),s.Db(1),s.Nc("",s.lc(3,9,(null==t?null:t.alias)||(null==t?null:t.shortChannelId),0,24),"",((null==t?null:t.alias)||(null==t?null:t.shortChannelId)).length>25?"...":"",""),s.Db(6),s.Mc("",s.kc(9,13,(null==t?null:t.toLocal)||0,"1.0-0")," Sats"),s.Db(3),s.oc("icon",n.faBalanceScale),s.Db(1),s.Mc(" (",s.jc(13,16,(null==t?null:t.balancedness)||0),") "),s.Db(5),s.Mc("",s.kc(18,18,(null==t?null:t.toRemote)||0,"1.0-0")," Sats"),s.Db(2),s.pc("value",t.toLocal&&t.toLocal>0?+t.toLocal/(+t.toLocal+ +t.toRemote)*100:0)}}function B(t,e){if(1&t&&(s.Vb(0,"div",15),s.Ic(1,E,20,21,"div",16),s.Ub()),2&t){const t=s.hc();s.Db(1),s.oc("ngForOf",t.allChannels)}}function N(t,e){if(1&t){const t=s.Wb();s.Vb(0,"div",24),s.Kc(1," No channels available. "),s.Vb(2,"button",25),s.dc("click",function(){return s.zc(t),s.hc().goToChannels()}),s.Kc(3,"Open Channel"),s.Ub(),s.Ub()}}let H=(()=>{class t{constructor(t){this.router=t,this.faBalanceScale=f.d,this.faDumbbell=f.l,this.sortBy="Balance Score"}goToChannels(){this.router.navigateByUrl("/ecl/connections")}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(i.g))},t.\u0275cmp=s.Jb({type:t,selectors:[["rtl-ecl-channel-capacity-info"]],inputs:{channelBalances:"channelBalances",allChannels:"allChannels",sortBy:"sortBy"},decls:26,vars:15,consts:[["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"],["noChannelBlock",""],["fxLayout","column","fxFlex","100"],["class","mt-2",4,"ngFor","ngForOf"],[1,"mt-2"],[1,"dashboard-capacity-header",3,"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"]],template:function(t,e){if(1&t&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Vb(2,"span",2),s.Kc(3,"Total Capacity"),s.Ub(),s.Vb(4,"div",3),s.Vb(5,"mat-hint",4),s.Vb(6,"strong",5),s.Kc(7,"Local:"),s.Ub(),s.Kc(8),s.ic(9,"number"),s.Ub(),s.Vb(10,"mat-hint",6),s.Qb(11,"fa-icon",7),s.Kc(12),s.ic(13,"number"),s.Ub(),s.Vb(14,"mat-hint",8),s.Vb(15,"strong",5),s.Kc(16,"Remote:"),s.Ub(),s.Kc(17),s.ic(18,"number"),s.Ub(),s.Ub(),s.Qb(19,"mat-progress-bar",9),s.Ub(),s.Vb(20,"div",10),s.Qb(21,"mat-divider",11),s.Ub(),s.Vb(22,"div",12),s.Ic(23,B,2,1,"div",13),s.Ub(),s.Ub(),s.Ic(24,N,4,0,"ng-template",null,14,s.Jc)),2&t){const t=s.wc(25);s.Db(8),s.Mc("",s.kc(9,7,e.channelBalances.localBalance||0,"1.0-0")," Sats"),s.Db(3),s.oc("icon",e.faBalanceScale),s.Db(1),s.Mc(" (",s.jc(13,10,(null==e.channelBalances?null:e.channelBalances.balancedness)||0),") "),s.Db(5),s.Mc("",s.kc(18,12,e.channelBalances.remoteBalance||0,"1.0-0")," Sats"),s.Db(2),s.pc("value",e.channelBalances.localBalance&&e.channelBalances.localBalance>0?+e.channelBalances.localBalance/(+e.channelBalances.localBalance+ +e.channelBalances.remoteBalance)*100:0),s.Db(4),s.oc("ngIf",e.allChannels&&(null==e.allChannels?null:e.allChannels.length)>0)("ngIfElse",t)}},directives:[c.c,c.b,c.a,R.f,w.a,K.a,l.a,M.a,z.b,a.o,a.n,U.a],pipes:[a.f,a.w],styles:[".channels-capacity-scroll[_ngcontent-%COMP%]{width:100%;height:100%;overflow-y:hidden}"]}),t})(),Q=(()=>{class t{constructor(){this.totalFees=[{name:"Monthly",value:0},{name:"Weekly",value:0},{name:"Daily",value:0}],this.maxFeeValue=100}ngOnChanges(){if(this.fees.monthly_fee){this.totalFees=[{name:"Monthly",value:this.fees.monthly_fee},{name:"Weekly",value:this.fees.weekly_fee},{name:"Daily ",value:this.fees.daily_fee}];let t=Math.ceil(Math.log(this.fees.monthly_fee+1)/Math.LN10),e=Math.pow(10,t-1);this.maxFeeValue=Math.ceil(this.fees.monthly_fee/e)*e/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 t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=s.Jb({type:t,selectors:[["rtl-ecl-fee-info"]],inputs:{fees:"fees"},features:[s.Bb],decls:38,vars:18,consts:[["fxLayout","column","fxFlex","50","fxLayoutAlign","space-between stretch"],["fxLayoutAlign","start",1,"dashboard-info-title"],[1,"overflow-wrap","dashboard-info-value"]],template:function(t,e){1&t&&(s.Vb(0,"div",0),s.Vb(1,"div"),s.Vb(2,"h4",1),s.Kc(3,"Daily"),s.Ub(),s.Vb(4,"div",2),s.Kc(5),s.ic(6,"number"),s.Ub(),s.Ub(),s.Vb(7,"div"),s.Vb(8,"h4",1),s.Kc(9,"Weekly"),s.Ub(),s.Vb(10,"div",2),s.Kc(11),s.ic(12,"number"),s.Ub(),s.Ub(),s.Vb(13,"div"),s.Vb(14,"h4",1),s.Kc(15,"Monthly"),s.Ub(),s.Vb(16,"div",2),s.Kc(17),s.ic(18,"number"),s.Ub(),s.Ub(),s.Ub(),s.Vb(19,"div",0),s.Vb(20,"div"),s.Vb(21,"h4",1),s.Kc(22,"Transactions"),s.Ub(),s.Vb(23,"div",2),s.Kc(24),s.ic(25,"number"),s.Ub(),s.Ub(),s.Vb(26,"div"),s.Vb(27,"h4",1),s.Kc(28,"Transactions"),s.Ub(),s.Vb(29,"div",2),s.Kc(30),s.ic(31,"number"),s.Ub(),s.Ub(),s.Vb(32,"div"),s.Vb(33,"h4",1),s.Kc(34,"Transactions"),s.Ub(),s.Vb(35,"div",2),s.Kc(36),s.ic(37,"number"),s.Ub(),s.Ub(),s.Ub()),2&t&&(s.Db(5),s.Mc("",s.jc(6,6,null==e.fees?null:e.fees.daily_fee)," Sats"),s.Db(6),s.Mc("",s.jc(12,8,null==e.fees?null:e.fees.weekly_fee)," Sats"),s.Db(6),s.Mc("",s.jc(18,10,null==e.fees?null:e.fees.monthly_fee)," Sats"),s.Db(7),s.Lc(s.jc(25,12,null==e.fees?null:e.fees.daily_txs)),s.Db(6),s.Lc(s.jc(31,14,null==e.fees?null:e.fees.weekly_txs)),s.Db(6),s.Lc(s.jc(37,16,null==e.fees?null:e.fees.monthly_txs)))},directives:[c.c,c.a,c.b],pipes:[a.f],styles:[""]}),t})(),q=(()=>{class t{constructor(){this.channelsStatus={}}ngOnChanges(){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=s.Jb({type:t,selectors:[["rtl-ecl-channel-status-info"]],inputs:{channelsStatus:"channelsStatus"},features:[s.Bb],decls:41,vars:18,consts:[["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"]],template:function(t,e){1&t&&(s.Vb(0,"div",0),s.Vb(1,"div"),s.Vb(2,"h4",1),s.Kc(3,"Active"),s.Ub(),s.Vb(4,"div",2),s.Qb(5,"span",3),s.Kc(6),s.ic(7,"number"),s.Ub(),s.Ub(),s.Vb(8,"div"),s.Vb(9,"h4",1),s.Kc(10,"Pending"),s.Ub(),s.Vb(11,"div",2),s.Qb(12,"span",4),s.Kc(13),s.ic(14,"number"),s.Ub(),s.Ub(),s.Vb(15,"div"),s.Vb(16,"h4",1),s.Kc(17,"Inactive"),s.Ub(),s.Vb(18,"div",2),s.Qb(19,"span",5),s.Kc(20),s.ic(21,"number"),s.Ub(),s.Ub(),s.Ub(),s.Vb(22,"div",0),s.Vb(23,"div"),s.Vb(24,"h4",1),s.Kc(25,"Capacity"),s.Ub(),s.Vb(26,"div",2),s.Kc(27),s.ic(28,"number"),s.Ub(),s.Ub(),s.Vb(29,"div"),s.Vb(30,"h4",1),s.Kc(31,"Capacity"),s.Ub(),s.Vb(32,"div",2),s.Kc(33),s.ic(34,"number"),s.Ub(),s.Ub(),s.Vb(35,"div"),s.Vb(36,"h4",1),s.Kc(37,"Capacity"),s.Ub(),s.Vb(38,"div",2),s.Kc(39),s.ic(40,"number"),s.Ub(),s.Ub(),s.Ub()),2&t&&(s.Db(6),s.Lc(s.jc(7,6,(null==e.channelsStatus.active?null:e.channelsStatus.active.channels)||0)),s.Db(7),s.Lc(s.jc(14,8,(null==e.channelsStatus.pending?null:e.channelsStatus.pending.channels)||0)),s.Db(7),s.Lc(s.jc(21,10,(null==e.channelsStatus.inactive?null:e.channelsStatus.inactive.channels)||0)),s.Db(7),s.Mc("",s.jc(28,12,(null==e.channelsStatus.active?null:e.channelsStatus.active.capacity)||0)," Sats"),s.Db(6),s.Mc("",s.jc(34,14,(null==e.channelsStatus.pending?null:e.channelsStatus.pending.capacity)||0)," Sats"),s.Db(6),s.Mc("",s.jc(40,16,(null==e.channelsStatus.inactive?null:e.channelsStatus.inactive.capacity)||0)," Sats"))},directives:[c.c,c.a,c.b],pipes:[a.f],styles:[""]}),t})();function j(t,e){if(1&t&&(s.Vb(0,"mat-hint",17),s.Vb(1,"strong",18),s.Kc(2,"Capacity: "),s.Ub(),s.Kc(3),s.ic(4,"number"),s.Ub()),2&t){const t=s.hc().$implicit;s.Db(3),s.Mc("",s.kc(4,1,t.toRemote||0,"1.0-0")," Sats")}}function _(t,e){if(1&t&&(s.Vb(0,"mat-hint",17),s.Vb(1,"strong",18),s.Kc(2,"Capacity: "),s.Ub(),s.Kc(3),s.ic(4,"number"),s.Ub()),2&t){const t=s.hc().$implicit;s.Db(3),s.Mc("",s.kc(4,1,t.toLocal||0,"1.0-0")," Sats")}}function $(t,e){if(1&t&&s.Qb(0,"mat-progress-bar",19),2&t){const t=s.hc().$implicit,e=s.hc(2);s.pc("value",e.totalLiquidity>0?(+t.toRemote||0)/e.totalLiquidity*100:0)}}function J(t,e){if(1&t&&s.Qb(0,"mat-progress-bar",19),2&t){const t=s.hc().$implicit,e=s.hc(2);s.pc("value",e.totalLiquidity>0?(+t.toLocal||0)/e.totalLiquidity*100:0)}}function G(t,e){if(1&t&&(s.Vb(0,"div",12),s.Vb(1,"span",13),s.Kc(2),s.ic(3,"slice"),s.Ub(),s.Vb(4,"div",14),s.Ic(5,j,5,4,"mat-hint",15),s.Ic(6,_,5,4,"mat-hint",15),s.Ub(),s.Ic(7,$,1,1,"mat-progress-bar",16),s.Ic(8,J,1,1,"mat-progress-bar",16),s.Ub()),2&t){const t=e.$implicit,n=s.hc(2);s.Db(1),s.pc("matTooltip",t.alias||t.shortChannelId),s.pc("matTooltipDisabled",(t.alias||t.shortChannelId).length<26),s.Db(1),s.Nc("",s.lc(3,8,t.alias||t.shortChannelId,0,24),"",(t.alias||t.shortChannelId).length>25?"...":"",""),s.Db(3),s.oc("ngIf","In"===n.direction),s.Db(1),s.oc("ngIf","Out"===n.direction),s.Db(1),s.oc("ngIf","In"===n.direction),s.Db(1),s.oc("ngIf","Out"===n.direction)}}function X(t,e){if(1&t&&(s.Vb(0,"div",10),s.Ic(1,G,9,12,"div",11),s.Ub()),2&t){const t=s.hc();s.Db(1),s.oc("ngForOf",t.allChannels)}}function W(t,e){if(1&t){const t=s.Wb();s.Vb(0,"button",22),s.dc("click",function(){return s.zc(t),s.hc(2).goToChannels()}),s.Kc(1,"Open Channel"),s.Ub()}}function Y(t,e){if(1&t&&(s.Vb(0,"div",20),s.Kc(1," No channels available. "),s.Ic(2,W,2,0,"button",21),s.Ub()),2&t){const t=s.hc();s.Db(2),s.oc("ngIf","Out"===t.direction)}}const Z=function(t,e,n){return{"mb-4":t,"mb-2":e,"mb-1":n}};let tt=(()=>{class t{constructor(t,e){this.router=t,this.commonService=e,this.screenSize="",this.screenSizeEnum=p.s}ngOnInit(){this.screenSize=this.commonService.getScreenSize()}goToChannels(){this.router.navigateByUrl("/ecl/connections")}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(i.g),s.Pb(S.a))},t.\u0275cmp=s.Jb({type:t,selectors:[["rtl-ecl-channel-liquidity-info"]],inputs:{direction:"direction",totalLiquidity:"totalLiquidity",allChannels:"allChannels"},decls:14,vars:11,consts:[["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"],["noChannelBlock",""],["fxLayout","column","fxFlex","100",1,"w-100"],["class","mt-2",4,"ngFor","ngForOf"],[1,"mt-2"],[1,"dashboard-capacity-header",3,"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 center",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","1",3,"click",4,"ngIf"],["mat-stroked-button","","color","primary","tabindex","1",3,"click"]],template:function(t,e){if(1&t&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Vb(2,"span",2),s.Kc(3,"Total Capacity"),s.Ub(),s.Vb(4,"mat-hint",3),s.Kc(5),s.ic(6,"number"),s.Ub(),s.Qb(7,"mat-progress-bar",4),s.Ub(),s.Vb(8,"div",5),s.Qb(9,"mat-divider",6),s.Ub(),s.Vb(10,"div",7),s.Ic(11,X,2,1,"div",8),s.Ub(),s.Ub(),s.Ic(12,Y,3,1,"ng-template",null,9,s.Jc)),2&t){const t=s.wc(13);s.oc("ngClass",s.uc(7,Z,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)),s.Db(5),s.Mc("",s.kc(6,4,e.totalLiquidity,"1.0-0")," Sats"),s.Db(6),s.oc("ngIf",e.allChannels&&e.allChannels.length>0)("ngIfElse",t)}},directives:[c.c,c.b,c.a,a.m,L.a,R.f,l.a,M.a,z.b,a.o,a.n,K.a,U.a],pipes:[a.f,a.w],styles:[""]}),t})();var et=n("M9ds"),nt=n("5QHs"),at=n("LUZP"),it=n("OaSA"),ot=n("iELJ"),st=n("/uX3"),ct=n("s7LF"),lt=n("e6WT"),rt=n("O4ig"),bt=n("B0X+"),dt=n("ZTz/"),ut=n("UhP/");function ht(t,e){1&t&&(s.Vb(0,"mat-error"),s.Kc(1,"Description is required."),s.Ub())}function mt(t,e){if(1&t&&(s.Vb(0,"mat-option",25),s.Kc(1),s.ic(2,"titlecase"),s.Ub()),2&t){const t=e.$implicit;s.oc("value",t),s.Db(1),s.Lc(s.jc(2,2,t))}}function ft(t,e){if(1&t&&(s.Vb(0,"span"),s.Kc(1),s.Ub()),2&t){const t=s.hc(2);s.Db(1),s.Lc(t.invoiceError)}}function pt(t,e){if(1&t&&(s.Vb(0,"div",26),s.Qb(1,"fa-icon",27),s.Ic(2,ft,2,1,"span",11),s.Ub()),2&t){const t=s.hc();s.Db(1),s.oc("icon",t.faExclamationTriangle),s.Db(1),s.oc("ngIf",""!==t.invoiceError)}}let gt=(()=>{class t{constructor(t,e,n,a,i,o){this.dialogRef=t,this.data=e,this.store=n,this.decimalPipe=a,this.commonService=i,this.actions$=o,this.faExclamationTriangle=f.o,this.selNode={},this.description="",this.invoiceValue=null,this.invoiceValueHint="",this.invoicePaymentReq="",this.information={},this.private=!1,this.expiryStep=100,this.pageSize=p.p,this.timeUnitEnum=p.y,this.timeUnits=p.w,this.selTimeUnit=p.y.SECS,this.invoiceError="",this.unSubs=[new d.a,new d.a,new d.a,new d.a,new d.a]}ngOnInit(){this.pageSize=this.data.pageSize,this.store.select("ecl").pipe(Object(u.a)(this.unSubs[0])).subscribe(t=>{this.selNode=t.nodeSettings,this.information=t.information}),this.actions$.pipe(Object(u.a)(this.unSubs[1]),Object(h.a)(t=>t.type===g.j||t.type===g.p)).subscribe(t=>{t.type===g.p&&this.dialogRef.close(),t.type===g.j&&"CreateInvoice"===t.payload.action&&(this.invoiceError=t.payload.message)})}onAddInvoice(t){if(this.invoiceError="",!this.description)return!0;let e=this.expiry?this.expiry:3600;this.selTimeUnit!==p.y.SECS&&(e=this.commonService.convertTime(this.expiry,this.selTimeUnit,p.y.SECS));let n=null;n=this.invoiceValue?{description:this.description,expireIn:e,amountMsat:1e3*this.invoiceValue}:{description:this.description,expireIn:e},this.store.dispatch(new st.G("Creating Invoice...")),this.store.dispatch(new g.g(n))}resetData(){this.description="",this.invoiceValue=null,this.private=!1,this.expiry=void 0,this.invoiceValueHint="",this.selTimeUnit=p.y.SECS,this.invoiceError=""}onInvoiceValueChange(){this.selNode.fiatConversion&&this.invoiceValue>99&&(this.invoiceValueHint="",this.commonService.convertCurrency(this.invoiceValue,p.g.SATS,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe(Object(u.a)(this.unSubs[2])).subscribe(t=>{this.invoiceValueHint="= "+t.symbol+this.decimalPipe.transform(t.OTHER,p.f.OTHER)+" "+t.unit}))}onTimeUnitChange(t){this.expiry&&this.selTimeUnit!==t.value&&(this.expiry=this.commonService.convertTime(this.expiry,this.selTimeUnit,t.value)),this.selTimeUnit=t.value}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(ot.f),s.Pb(ot.a),s.Pb(x.h),s.Pb(a.f),s.Pb(S.a),s.Pb(v.a))},t.\u0275cmp=s.Jb({type:t,selectors:[["rtl-ecl-create-invoices"]],decls:35,vars:17,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-stroked-button","","color","primary","tabindex","7","type","reset",1,"mr-1",3,"click"],["mat-flat-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(t,e){if(1&t){const t=s.Wb();s.Vb(0,"div",0),s.Vb(1,"div",1),s.Vb(2,"mat-card-header",2),s.Vb(3,"div",3),s.Vb(4,"span",4),s.Kc(5,"Create Invoice"),s.Ub(),s.Ub(),s.Vb(6,"button",5),s.Kc(7,"X"),s.Ub(),s.Ub(),s.Vb(8,"mat-card-content",6),s.Vb(9,"form",7,8),s.Vb(11,"mat-form-field",9),s.Vb(12,"input",10),s.dc("ngModelChange",function(t){return e.description=t}),s.Ub(),s.Ic(13,ht,2,0,"mat-error",11),s.Ub(),s.Vb(14,"div",12),s.Vb(15,"mat-form-field",13),s.Vb(16,"input",14),s.dc("ngModelChange",function(t){return e.invoiceValue=t})("keyup",function(){return e.onInvoiceValueChange()}),s.Ub(),s.Vb(17,"span",15),s.Kc(18),s.Ub(),s.Vb(19,"mat-hint"),s.Kc(20),s.Ub(),s.Ub(),s.Vb(21,"mat-form-field",16),s.Vb(22,"input",17),s.dc("ngModelChange",function(t){return e.expiry=t}),s.Ub(),s.Vb(23,"span",15),s.Kc(24),s.ic(25,"titlecase"),s.Ub(),s.Ub(),s.Vb(26,"mat-form-field",18),s.Vb(27,"mat-select",19),s.dc("selectionChange",function(t){return e.onTimeUnitChange(t)}),s.Ic(28,mt,3,4,"mat-option",20),s.Ub(),s.Ub(),s.Ub(),s.Ic(29,pt,3,2,"div",21),s.Vb(30,"div",22),s.Vb(31,"button",23),s.dc("click",function(){return e.resetData()}),s.Kc(32,"Clear Field"),s.Ub(),s.Vb(33,"button",24),s.dc("click",function(){s.zc(t);const n=s.wc(10);return e.onAddInvoice(n)}),s.Kc(34,"Create Invoice"),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub()}2&t&&(s.Db(6),s.oc("mat-dialog-close",!1),s.Db(6),s.oc("ngModel",e.description),s.Db(1),s.oc("ngIf",!e.description),s.Db(3),s.oc("ngModel",e.invoiceValue)("step",100)("min",1),s.Db(2),s.Mc(" ",null==e.information?null:e.information.smaller_currency_unit," "),s.Db(2),s.Lc(e.invoiceValueHint),s.Db(2),s.oc("ngModel",e.expiry)("step",e.selTimeUnit===e.timeUnitEnum.SECS?300:e.selTimeUnit===e.timeUnitEnum.MINS?10:e.selTimeUnit===e.timeUnitEnum.HOURS?2:1)("min",1),s.Db(2),s.Mc(" ",s.jc(25,15,e.selTimeUnit)," "),s.Db(3),s.oc("value",e.selTimeUnit),s.Db(1),s.oc("ngForOf",e.timeUnits),s.Db(1),s.oc("ngIf",""!==e.invoiceError))},directives:[c.c,c.a,C.c,c.b,U.a,ot.d,C.b,ct.u,ct.n,ct.o,R.c,lt.b,ct.c,rt.a,ct.s,ct.m,ct.p,a.o,ct.q,bt.a,R.g,R.f,dt.a,a.n,R.b,ut.m,w.a],pipes:[a.x],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),t})();var yt=n("bdpe"),xt=n("mNcL"),vt=n("X9mX");function St(t,e){1&t&&(s.Vb(0,"mat-error"),s.Kc(1,"Description is required."),s.Ub())}function wt(t,e){if(1&t){const t=s.Wb();s.Vb(0,"form",4,5),s.Vb(2,"mat-form-field",6),s.Vb(3,"input",7),s.dc("ngModelChange",function(e){return s.zc(t),s.hc().description=e}),s.Ub(),s.Ic(4,St,2,0,"mat-error",8),s.Ub(),s.Vb(5,"mat-form-field",9),s.Vb(6,"input",10,11),s.dc("ngModelChange",function(e){return s.zc(t),s.hc().invoiceValue=e})("keyup",function(){return s.zc(t),s.hc().onInvoiceValueChange()}),s.Ub(),s.Vb(8,"span",12),s.Kc(9),s.Ub(),s.Vb(10,"mat-hint"),s.Kc(11),s.Ub(),s.Ub(),s.Vb(12,"div",13),s.Vb(13,"button",14),s.dc("click",function(){return s.zc(t),s.hc().resetData()}),s.Kc(14,"Clear Field"),s.Ub(),s.Vb(15,"button",15),s.dc("click",function(){s.zc(t);const e=s.wc(1);return s.hc().onAddInvoice(e)}),s.Kc(16,"Create Invoice"),s.Ub(),s.Ub(),s.Ub()}if(2&t){const t=s.hc();s.Db(3),s.oc("ngModel",t.description),s.Db(1),s.oc("ngIf",!t.description),s.Db(2),s.oc("ngModel",t.invoiceValue)("step",100)("min",1),s.Db(3),s.Mc(" ",null==t.information?null:t.information.smaller_currency_unit," "),s.Db(2),s.Lc(t.invoiceValueHint)}}function Dt(t,e){if(1&t){const t=s.Wb();s.Vb(0,"div",16),s.Vb(1,"button",17),s.dc("click",function(){return s.zc(t),s.hc().openCreateInvoiceModal()}),s.Kc(2,"Create Invoice"),s.Ub(),s.Ub()}}function Ct(t,e){1&t&&s.Qb(0,"mat-progress-bar",47)}function Vt(t,e){1&t&&(s.Vb(0,"th",48),s.Kc(1," Date Created "),s.Ub())}const Ut=function(t){return{"mr-0":t}};function It(t,e){if(1&t&&s.Qb(0,"span",53),2&t){const t=s.hc(3);s.oc("ngClass",s.sc(1,Ut,t.screenSize===t.screenSizeEnum.XS))}}function Lt(t,e){if(1&t&&s.Qb(0,"span",54),2&t){const t=s.hc(3);s.oc("ngClass",s.sc(1,Ut,t.screenSize===t.screenSizeEnum.XS))}}function At(t,e){if(1&t&&s.Qb(0,"span",55),2&t){const t=s.hc(3);s.oc("ngClass",s.sc(1,Ut,t.screenSize===t.screenSizeEnum.XS))}}function Pt(t,e){if(1&t&&(s.Vb(0,"td",49),s.Ic(1,It,1,3,"span",50),s.Ic(2,Lt,1,3,"span",51),s.Ic(3,At,1,3,"span",52),s.Kc(4),s.Ub()),2&t){const t=e.$implicit;s.Db(1),s.oc("ngIf","received"===t.status),s.Db(1),s.oc("ngIf","unpaid"===t.status),s.Db(1),s.oc("ngIf","expired"===t.status||"unknown"===t.status),s.Db(1),s.Mc(" ",t.timestampStr," ")}}function Ft(t,e){1&t&&(s.Vb(0,"th",48),s.Kc(1," Date Settled "),s.Ub())}function kt(t,e){if(1&t&&(s.Vb(0,"td",49),s.Kc(1),s.Ub()),2&t){const t=e.$implicit;s.Db(1),s.Lc(t.receivedAtStr||"-")}}function Ot(t,e){1&t&&(s.Vb(0,"th",48),s.Kc(1," Description "),s.Ub())}const Tt=function(t){return{"max-width":t}};function Rt(t,e){if(1&t&&(s.Vb(0,"td",49),s.Vb(1,"div",56),s.Vb(2,"span",57),s.Kc(3),s.Ub(),s.Ub(),s.Ub()),2&t){const t=e.$implicit,n=s.hc(2);s.Db(1),s.oc("ngStyle",s.sc(2,Tt,n.screenSize===n.screenSizeEnum.XS?"10rem":"32rem")),s.Db(2),s.Lc(t.description)}}function Kt(t,e){1&t&&(s.Vb(0,"th",58),s.Kc(1," Amount (Sats) "),s.Ub())}function Mt(t,e){if(1&t&&(s.Vb(0,"td",59),s.Vb(1,"span",60),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&t){const t=e.$implicit;s.Db(2),s.Mc(" ",t.amount?s.kc(3,1,t.amount,"1.0-0"):"-","")}}function zt(t,e){1&t&&(s.Vb(0,"th",58),s.Kc(1," Amount Settled (Sats) "),s.Ub())}function Et(t,e){if(1&t&&(s.Vb(0,"td",59),s.Vb(1,"span",60),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&t){const t=e.$implicit;s.Db(2),s.Mc(" ",t.amountSettled?s.kc(3,1,t.amountSettled,"1.0-0"):"-","")}}function Bt(t,e){if(1&t){const t=s.Wb();s.Vb(0,"th",61),s.Vb(1,"div",62),s.Vb(2,"mat-select",63),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",64),s.dc("click",function(){return s.zc(t),s.hc(2).onDownloadCSV()}),s.Kc(5,"Download CSV"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}}const Nt=function(t){return{"px-3":t}};function Ht(t,e){if(1&t){const t=s.Wb();s.Vb(0,"td",65),s.Vb(1,"button",66),s.dc("click",function(n){s.zc(t);const a=e.$implicit;return s.hc(2).onInvoiceClick(a,n)}),s.Kc(2,"View Info"),s.Ub(),s.Ub()}if(2&t){const t=s.hc(2);s.oc("ngClass",s.sc(1,Nt,t.screenSize!==t.screenSizeEnum.XS))}}function Qt(t,e){1&t&&(s.Vb(0,"p"),s.Kc(1,"No invoices available."),s.Ub())}function qt(t,e){if(1&t&&(s.Vb(0,"td",67),s.Ic(1,Qt,2,0,"p",8),s.Ub()),2&t){const t=s.hc(2);s.Db(1),s.oc("ngIf",!(null!=t.invoices&&t.invoices.data)||(null==t.invoices||null==t.invoices.data?null:t.invoices.data.length)<1)}}const jt=function(t){return{"display-none":t}};function _t(t,e){if(1&t&&s.Qb(0,"tr",68),2&t){const t=s.hc(2);s.oc("ngClass",s.sc(1,jt,(null==t.invoices?null:t.invoices.data)&&(null==t.invoices||null==t.invoices.data?null:t.invoices.data.length)>0))}}function $t(t,e){1&t&&s.Qb(0,"tr",69)}function Jt(t,e){if(1&t&&s.Qb(0,"tr",70),2&t){const t=e.$implicit,n=s.hc(2);s.oc("@newlyAddedRowAnimation",t.label==n.newlyAddedInvoiceMemo&&t.value==n.newlyAddedInvoiceValue&&n.flgAnimate?"added":"notAdded")}}const Gt=function(t){return{"overflow-auto error-border":t,"overflow-auto":!0}},Xt=function(){return["no_invoice"]};function Wt(t,e){if(1&t){const t=s.Wb();s.Vb(0,"div",18),s.Vb(1,"div",19),s.Vb(2,"div",20),s.Qb(3,"fa-icon",21),s.Vb(4,"span",22),s.Kc(5,"Invoices History"),s.Ub(),s.Ub(),s.Vb(6,"mat-form-field",23),s.Vb(7,"input",24),s.dc("keyup",function(e){return s.zc(t),s.hc().applyFilter(e.target)}),s.Ub(),s.Ub(),s.Ub(),s.Vb(8,"div",25),s.Ic(9,Ct,1,0,"mat-progress-bar",26),s.Vb(10,"table",27,28),s.Tb(12,29),s.Ic(13,Vt,2,0,"th",30),s.Ic(14,Pt,5,4,"td",31),s.Sb(),s.Tb(15,32),s.Ic(16,Ft,2,0,"th",30),s.Ic(17,kt,2,1,"td",31),s.Sb(),s.Tb(18,33),s.Ic(19,Ot,2,0,"th",30),s.Ic(20,Rt,4,4,"td",31),s.Sb(),s.Tb(21,34),s.Ic(22,Kt,2,0,"th",35),s.Ic(23,Mt,4,4,"td",36),s.Sb(),s.Tb(24,37),s.Ic(25,zt,2,0,"th",35),s.Ic(26,Et,4,4,"td",36),s.Sb(),s.Tb(27,38),s.Ic(28,Bt,6,0,"th",39),s.Ic(29,Ht,3,3,"td",40),s.Sb(),s.Tb(30,41),s.Ic(31,qt,2,1,"td",42),s.Sb(),s.Ic(32,_t,1,3,"tr",43),s.Ic(33,$t,1,0,"tr",44),s.Ic(34,Jt,1,1,"tr",45),s.Ub(),s.Ub(),s.Qb(35,"mat-paginator",46),s.Ub()}if(2&t){const t=s.hc();s.Db(3),s.oc("icon",t.faHistory),s.Db(6),s.oc("ngIf",!0===t.flgLoading[0]),s.Db(1),s.oc("dataSource",t.invoices)("ngClass",s.sc(11,Gt,"error"===t.flgLoading[0])),s.Db(22),s.oc("matFooterRowDef",s.rc(13,Xt)),s.Db(1),s.oc("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),s.Db(1),s.oc("matRowDefColumns",t.displayedColumns),s.Db(1),s.oc("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS)}}let Yt=(()=>{class t{constructor(t,e,n,a,i){this.logger=t,this.store=e,this.decimalPipe=n,this.commonService=a,this.rtlEffects=i,this.calledFrom="transactions",this.faHistory=f.r,this.selNode={},this.newlyAddedInvoiceMemo="",this.newlyAddedInvoiceValue=0,this.flgAnimate=!0,this.description="",this.invoiceValue=null,this.invoiceValueHint="",this.displayedColumns=[],this.invoicePaymentReq="",this.invoiceJSONArr=[],this.information={},this.flgLoading=[!0],this.flgSticky=!1,this.pageSize=p.p,this.pageSizeOptions=p.q,this.screenSize="",this.screenSizeEnum=p.s,this.unSubs=[new d.a,new d.a,new d.a,new d.a,new d.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===p.s.XS?(this.flgSticky=!1,this.displayedColumns=["timestamp","amount","actions"]):this.screenSize===p.s.SM||this.screenSize===p.s.MD?(this.flgSticky=!1,this.displayedColumns=["timestamp","amount","amountSettled","actions"]):(this.flgSticky=!0,this.displayedColumns=["timestamp","receivedAt","description","amount","amountSettled","actions"])}ngOnInit(){this.store.dispatch(new g.x),this.store.select("ecl").pipe(Object(u.a)(this.unSubs[0])).subscribe(t=>{t.effectErrors.forEach(t=>{"FetchInvoices"===t.action&&(this.flgLoading[0]="error")}),this.selNode=t.nodeSettings,this.information=t.information,this.invoiceJSONArr=t.invoices&&t.invoices.length>0?t.invoices:[],this.invoiceJSONArr&&this.invoiceJSONArr.length>0&&this.loadInvoicesTable(this.invoiceJSONArr),setTimeout(()=>{this.flgAnimate=!1},5e3),"error"!==this.flgLoading[0]&&(this.flgLoading[0]=!t.invoices),this.logger.info(t)})}openCreateInvoiceModal(){this.store.dispatch(new st.D({data:{pageSize:this.pageSize,component:gt}}))}onAddInvoice(t){if(!this.description)return!0;let e=this.expiry?this.expiry:3600;this.flgAnimate=!0,this.newlyAddedInvoiceMemo="ulbl"+Math.random().toString(36).slice(2)+Date.now(),this.newlyAddedInvoiceValue=this.invoiceValue;let n=null;n=this.invoiceValue?{description:this.description,expireIn:e,amountMsat:1e3*this.invoiceValue}:{description:this.description,expireIn:e},this.store.dispatch(new st.G("Creating Invoice...")),this.store.dispatch(new g.g(n)),this.resetData()}onInvoiceClick(t,e){this.store.dispatch(new st.D({data:{invoice:t,newlyAdded:!1,component:yt.a}}))}loadInvoicesTable(t){this.invoices=new it.o(t?[...t]:[]),this.invoices.sortingDataAccessor=(t,e)=>t[e]&&isNaN(t[e])?t[e].toLocaleLowerCase():t[e]?+t[e]:null,this.invoices.sort=this.sort,this.invoices.filterPredicate=(t,e)=>JSON.stringify(t).toLowerCase().includes(e),this.invoices.paginator=this.paginator}resetData(){this.description="",this.invoiceValue=null,this.expiry=null,this.invoiceValueHint=""}applyFilter(t){this.invoices.filter=t.value.trim().toLowerCase()}onInvoiceValueChange(){this.selNode.fiatConversion&&this.invoiceValue>99&&(this.invoiceValueHint="",this.commonService.convertCurrency(this.invoiceValue,p.g.SATS,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe(Object(u.a)(this.unSubs[1])).subscribe(t=>{this.invoiceValueHint="= "+t.symbol+this.decimalPipe.transform(t.OTHER,p.f.OTHER)+" "+t.unit}))}onDownloadCSV(){this.invoices.data&&this.invoices.data.length>0&&this.commonService.downloadFile(this.invoices.data,"Invoices")}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(y.b),s.Pb(x.h),s.Pb(a.f),s.Pb(S.a),s.Pb(vt.a))},t.\u0275cmp=s.Jb({type:t,selectors:[["rtl-ecl-lightning-invoices"]],viewQuery:function(t,e){if(1&t&&(s.Pc(at.a,!0),s.Pc(nt.a,!0)),2&t){let t;s.vc(t=s.ec())&&(e.sort=t.first),s.vc(t=s.ec())&&(e.paginator=t.first)}},inputs:{calledFrom:"calledFrom"},features:[s.Cb([{provide:nt.b,useValue:Object(p.B)("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","start end"],["matInput","","placeholder","Filter",3,"keyup"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"table-container","w-100",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","receivedAt"],["matColumnDef","description"],["matColumnDef","amount"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","class","pr-3",4,"matHeaderCellDef"],["mat-cell","","class","pr-3",4,"matCellDef"],["matColumnDef","amountSettled"],["matColumnDef","actions"],["mat-header-cell","","class","px-3",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",3,"ngClass",4,"matCellDef"],["matColumnDef","no_invoice"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["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","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","matTooltipPosition","right",1,"dot","red",3,"ngClass"],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",1,"pr-3"],["mat-cell","",1,"pr-3"],["fxLayoutAlign","end center"],["mat-header-cell","",1,"px-3"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",3,"ngClass"],["mat-stroked-button","","color","primary","type","button","tabindex","4",3,"click"],["mat-footer-cell","","colspan","4"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(t,e){1&t&&(s.Vb(0,"div",0),s.Ic(1,wt,17,7,"form",1),s.Ic(2,Dt,3,0,"div",2),s.Ic(3,Wt,36,14,"div",3),s.Ub()),2&t&&(s.Db(1),s.oc("ngIf","home"===e.calledFrom),s.Db(1),s.oc("ngIf","transactions"===e.calledFrom),s.Db(1),s.oc("ngIf","transactions"===e.calledFrom))},directives:[c.c,c.a,c.b,a.o,ct.u,ct.n,ct.o,R.c,lt.b,ct.c,ct.s,ct.m,ct.p,ct.q,bt.a,R.g,R.f,U.a,R.b,w.a,z.b,it.n,at.a,a.m,L.a,it.c,it.i,it.b,it.e,it.g,it.k,it.m,nt.a,l.a,it.h,at.b,it.a,K.a,a.p,L.b,dt.a,dt.c,ut.m,it.d,it.f,it.j,it.l],pipes:[a.f],styles:[".mat-column-description[_ngcontent-%COMP%]{flex:0 0 15%;width:15%}.mat-column-description[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%]{display:flex}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"],data:{animation:[xt.a]}}),t})();var Zt=n("cp0P"),te=n("IzEk"),ee=n("D9sq"),ne=n("iiaH");const ae=["paymentReq"];function ie(t,e){if(1&t&&(s.Vb(0,"mat-hint"),s.Kc(1),s.Ub()),2&t){const t=s.hc();s.Db(1),s.Lc(t.paymentDecodedHint)}}function oe(t,e){1&t&&(s.Vb(0,"mat-error"),s.Kc(1,"Payment request is required."),s.Ub())}function se(t,e){if(1&t&&(s.Vb(0,"mat-error"),s.Kc(1),s.Ub()),2&t){const t=s.hc();s.Db(1),s.Lc(t.paymentDecodedHint)}}function ce(t,e){1&t&&(s.Vb(0,"mat-error"),s.Kc(1,"Payment amount is required."),s.Ub())}function le(t,e){if(1&t){const t=s.Wb();s.Vb(0,"mat-form-field",1),s.Vb(1,"input",17,18),s.dc("ngModelChange",function(e){return s.zc(t),s.hc().paymentAmount=e})("change",function(e){return s.zc(t),s.hc().onAmountChange(e)}),s.Ub(),s.Vb(3,"mat-hint"),s.Kc(4,"It is a zero amount invoice, enter amount to be paid."),s.Ub(),s.Ic(5,ce,2,0,"mat-error",11),s.Ub()}if(2&t){const t=s.hc();s.Db(1),s.oc("ngModel",t.paymentAmount),s.Db(4),s.oc("ngIf",!t.paymentAmount)}}function re(t,e){if(1&t&&(s.Vb(0,"span"),s.Kc(1),s.Ub()),2&t){const t=s.hc(2);s.Db(1),s.Lc(t.paymentError)}}function be(t,e){if(1&t&&(s.Vb(0,"div",19),s.Qb(1,"fa-icon",20),s.Ic(2,re,2,1,"span",11),s.Ub()),2&t){const t=s.hc();s.Db(1),s.oc("icon",t.faExclamationTriangle),s.Db(1),s.oc("ngIf",""!==t.paymentError)}}let de=(()=>{class t{constructor(t,e,n,a,i,o,s,c){this.dialogRef=t,this.store=e,this.eclEffects=n,this.logger=a,this.commonService=i,this.decimalPipe=o,this.actions$=s,this.dataService=c,this.faExclamationTriangle=f.o,this.selNode={},this.paymentDecoded={},this.zeroAmtInvoice=!1,this.paymentAmount=null,this.paymentRequest="",this.paymentDecodedHint="",this.selActiveChannel={},this.activeChannels={},this.feeLimit=null,this.selFeeLimitType=p.i[0],this.feeLimitTypes=p.i,this.paymentError="",this.unSubs=[new d.a,new d.a,new d.a,new d.a]}ngOnInit(){this.store.select("ecl").pipe(Object(u.a)(this.unSubs[0])).subscribe(t=>{this.selNode=t.nodeSettings,this.activeChannels=t.activeChannels,this.logger.info(t)}),this.actions$.pipe(Object(u.a)(this.unSubs[1]),Object(h.a)(t=>t.type===g.j||t.type===g.S)).subscribe(t=>{t.type===g.S&&this.dialogRef.close(),t.type===g.j&&"SendPayment"===t.payload.action&&(delete this.paymentDecoded.amount,this.paymentError=t.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(Object(te.a)(1)).subscribe(t=>{this.paymentDecoded=t,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.commonService.convertCurrency(+this.paymentDecoded.amount,p.g.SATS,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe(Object(u.a)(this.unSubs[2])).subscribe(t=>{this.paymentDecodedHint=this.selNode.fiatConversion?"Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats ("+t.symbol+this.decimalPipe.transform(t.OTHER?t.OTHER:0,p.f.OTHER)+") | Memo: "+this.paymentDecoded.description:"Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats | Memo: "+this.paymentDecoded.description}))},t=>{this.logger.error(t),this.paymentDecodedHint="ERROR: "+(t.message?t.message:"string"==typeof t?t:JSON.stringify(t)),this.paymentReq.control.setErrors({decodeError:!0})}))}sendPayment(){this.store.dispatch(new st.G("Sending Payment...")),this.store.dispatch(new g.nb(this.zeroAmtInvoice?{invoice:this.paymentRequest,amountMsat:1e3*this.paymentAmount,fromDialog:!0}:{invoice:this.paymentRequest,fromDialog:!0}))}onPaymentRequestEntry(t){this.paymentRequest=t,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(Object(te.a)(1)).subscribe(t=>{this.paymentDecoded=t,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.commonService.convertCurrency(+this.paymentDecoded.amount,p.g.SATS,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe(Object(u.a)(this.unSubs[3])).subscribe(t=>{this.paymentDecodedHint=this.selNode.fiatConversion?"Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats ("+t.symbol+this.decimalPipe.transform(t.OTHER?t.OTHER:0,p.f.OTHER)+") | Memo: "+this.paymentDecoded.description:"Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats | Memo: "+this.paymentDecoded.description}))},t=>{this.logger.error(t),this.paymentDecodedHint="ERROR: "+(t.message?t.message:"string"==typeof t?t:JSON.stringify(t)),this.paymentReq.control.setErrors({decodeError:!0})}))}onAmountChange(t){delete this.paymentDecoded.amount,this.paymentDecoded.amount=t}resetData(){this.paymentDecoded={},this.paymentRequest="",this.selActiveChannel=null,this.feeLimit=null,this.selFeeLimitType=p.i[0],this.paymentReq.control.setErrors(null),this.paymentError="",this.paymentDecodedHint="",this.zeroAmtInvoice=!1}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(ot.f),s.Pb(x.h),s.Pb(ee.a),s.Pb(y.b),s.Pb(S.a),s.Pb(a.f),s.Pb(v.a),s.Pb(ne.a))},t.\u0275cmp=s.Jb({type:t,selectors:[["rtl-ecl-lightning-send-payments"]],viewQuery:function(t,e){if(1&t&&s.Pc(ae,!0),2&t){let t;s.vc(t=s.ec())&&(e.paymentReq=t.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","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-stroked-button","","color","primary","tabindex","2","type","reset",1,"mr-1",3,"click"],["mat-flat-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(t,e){if(1&t&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Vb(2,"mat-card-header",2),s.Vb(3,"div",3),s.Vb(4,"span",4),s.Kc(5,"Send Payment"),s.Ub(),s.Ub(),s.Vb(6,"button",5),s.Kc(7,"X"),s.Ub(),s.Ub(),s.Vb(8,"mat-card-content",6),s.Vb(9,"form",7,8),s.Vb(11,"mat-form-field",1),s.Vb(12,"textarea",9,10),s.dc("ngModelChange",function(t){return e.onPaymentRequestEntry(t)})("matTextareaAutosize",function(){return!0}),s.Ub(),s.Ic(14,ie,2,1,"mat-hint",11),s.Ic(15,oe,2,0,"mat-error",11),s.Ic(16,se,2,1,"mat-error",11),s.Ub(),s.Ic(17,le,6,2,"mat-form-field",12),s.Ic(18,be,3,2,"div",13),s.Vb(19,"div",14),s.Vb(20,"button",15),s.dc("click",function(){return e.resetData()}),s.Kc(21,"Clear Fields"),s.Ub(),s.Vb(22,"button",16),s.dc("click",function(){return e.onSendPayment()}),s.Kc(23,"Send Payment"),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&t){const t=s.wc(13);s.Db(6),s.oc("mat-dialog-close",!1),s.Db(6),s.oc("ngModel",e.paymentRequest),s.Db(2),s.oc("ngIf",e.paymentRequest&&""!==e.paymentDecodedHint),s.Db(1),s.oc("ngIf",!e.paymentRequest),s.Db(1),s.oc("ngIf",null==t.errors?null:t.errors.decodeError),s.Db(1),s.oc("ngIf",e.zeroAmtInvoice),s.Db(1),s.oc("ngIf",""!==e.paymentError)}},directives:[c.c,c.a,C.c,c.b,U.a,ot.d,C.b,ct.u,ct.n,ct.o,R.c,lt.b,ct.c,lt.d,rt.a,ct.s,ct.m,ct.p,a.o,R.f,R.b,w.a],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}.mat-column-payment_hash[_ngcontent-%COMP%]{flex:1 1 20%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),t})();var ue=n("o4Yh");const he=["scrollContainer"];function me(t,e){if(1&t&&(s.Vb(0,"div",9),s.Vb(1,"div",1),s.Vb(2,"h4",11),s.Kc(3,"Description"),s.Ub(),s.Vb(4,"span",12),s.Kc(5),s.Ub(),s.Ub(),s.Ub()),2&t){const t=s.hc();s.Db(5),s.Lc(t.description)}}function fe(t,e){1&t&&s.Qb(0,"mat-divider",14)}function pe(t,e){if(1&t){const t=s.Wb();s.Vb(0,"mat-expansion-panel",23),s.dc("opened",function(){return s.zc(t),s.hc().onExpansionOpen(!0)})("closed",function(){return s.zc(t),s.hc().onExpansionOpen(!1)}),s.Vb(1,"mat-expansion-panel-header"),s.Vb(2,"mat-panel-title"),s.Vb(3,"h4",24),s.Kc(4),s.Ub(),s.Vb(5,"h4",25),s.Kc(6),s.ic(7,"number"),s.Ub(),s.Ub(),s.Ub(),s.Vb(8,"div",8),s.Vb(9,"div",9),s.Vb(10,"div",26),s.Vb(11,"h4",11),s.Kc(12,"Fees (mSats)"),s.Ub(),s.Vb(13,"span",12),s.Kc(14),s.ic(15,"number"),s.Ub(),s.Ub(),s.Vb(16,"div",26),s.Vb(17,"h4",11),s.Kc(18,"Date/Time"),s.Ub(),s.Vb(19,"span",12),s.Kc(20),s.Ub(),s.Ub(),s.Ub(),s.Qb(21,"mat-divider",14),s.Vb(22,"div",9),s.Vb(23,"div",1),s.Vb(24,"h4",11),s.Kc(25,"ID"),s.Ub(),s.Vb(26,"span",27),s.Kc(27),s.Ub(),s.Ub(),s.Ub(),s.Qb(28,"mat-divider",14),s.Vb(29,"div",9),s.Vb(30,"div",1),s.Vb(31,"h4",11),s.Kc(32,"To Channel"),s.Ub(),s.Vb(33,"span",27),s.Kc(34),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub()}if(2&t){const t=e.$implicit,n=e.index,a=s.hc();s.oc("expanded",a.expansionOpen),s.Db(4),s.Mc("Part ",n+1,""),s.Db(2),s.Mc("",s.jc(7,7,t.amount)," (Sats)"),s.Db(8),s.Lc(s.jc(15,9,t.feesPaid)),s.Db(6),s.Lc(t.timestampStr),s.Db(7),s.Lc(t.id),s.Db(7),s.Lc(t.toChannelAlias)}}let ge=(()=>{class t{constructor(t,e){this.dialogRef=t,this.data=e,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(t){this.expansionOpen=t}onClose(){this.dialogRef.close(!1)}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(ot.f),s.Pb(ot.a))},t.\u0275cmp=s.Jb({type:t,selectors:[["rtl-ecl-payment-information"]],viewQuery:function(t,e){if(1&t&&s.Pc(he,!0),2&t){let t;s.vc(t=s.ec())&&(e.scrollContainer=t.first)}},decls:65,vars:12,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-stroked-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(t,e){1&t&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Vb(2,"mat-card-header",2),s.Vb(3,"div",3),s.Vb(4,"span",4),s.Kc(5,"Payment Information"),s.Ub(),s.Ub(),s.Vb(6,"button",5),s.dc("click",function(){return e.onClose()}),s.Kc(7,"X"),s.Ub(),s.Ub(),s.Vb(8,"mat-card-content",6,7),s.Vb(10,"div",8),s.Vb(11,"div",9),s.Vb(12,"div",10),s.Vb(13,"h4",11),s.Kc(14,"Amount (Sats)"),s.Ub(),s.Vb(15,"span",12),s.Kc(16),s.ic(17,"number"),s.Ub(),s.Ub(),s.Vb(18,"div",13),s.Vb(19,"h4",11),s.Kc(20,"Date/Time"),s.Ub(),s.Vb(21,"span",12),s.Kc(22),s.Ub(),s.Ub(),s.Ub(),s.Qb(23,"mat-divider",14),s.Vb(24,"div",9),s.Vb(25,"div",1),s.Vb(26,"h4",11),s.Kc(27,"ID"),s.Ub(),s.Vb(28,"span",12),s.Kc(29),s.Ub(),s.Ub(),s.Ub(),s.Qb(30,"mat-divider",14),s.Vb(31,"div",9),s.Vb(32,"div",1),s.Vb(33,"h4",11),s.Kc(34,"Payment Hash"),s.Ub(),s.Vb(35,"span",12),s.Kc(36),s.Ub(),s.Ub(),s.Ub(),s.Qb(37,"mat-divider",14),s.Vb(38,"div",9),s.Vb(39,"div",1),s.Vb(40,"h4",11),s.Kc(41,"Payment Preimage"),s.Ub(),s.Vb(42,"span",12),s.Kc(43),s.Ub(),s.Ub(),s.Ub(),s.Qb(44,"mat-divider",14),s.Vb(45,"div",9),s.Vb(46,"div",1),s.Vb(47,"h4",11),s.Kc(48,"Recipient Node"),s.Ub(),s.Vb(49,"span",12),s.Kc(50),s.Ub(),s.Ub(),s.Ub(),s.Qb(51,"mat-divider",14),s.Ic(52,me,6,1,"div",15),s.Ic(53,fe,1,0,"mat-divider",16),s.Vb(54,"div",9),s.Vb(55,"div",1),s.Vb(56,"mat-accordion"),s.Ic(57,pe,35,11,"mat-expansion-panel",17),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Vb(58,"div",18),s.Vb(59,"button",19),s.dc("click",function(){return e.onScrollDown()}),s.Vb(60,"mat-icon",20),s.Kc(61,"arrow_downward"),s.Ub(),s.Ub(),s.Ub(),s.Vb(62,"div",21),s.Vb(63,"button",22),s.Kc(64,"OK"),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&t&&(s.Db(16),s.Lc(s.jc(17,10,e.payment.recipientAmount)),s.Db(6),s.Lc(e.payment.firstPartTimestampStr),s.Db(7),s.Lc(e.payment.id),s.Db(7),s.Lc(e.payment.paymentHash),s.Db(7),s.Lc(e.payment.paymentPreimage),s.Db(7),s.Lc(e.payment.recipientNodeAlias),s.Db(2),s.oc("ngIf",e.description),s.Db(1),s.oc("ngIf",e.description),s.Db(4),s.oc("ngForOf",e.payment.parts),s.Db(6),s.oc("mat-dialog-close",!1))},directives:[c.c,c.b,c.a,C.c,U.a,C.b,z.b,M.a,a.o,ue.a,a.n,I.a,ot.d,ue.c,ue.e,ue.f],pipes:[a.f],styles:[""]}),t})();const ye=["sendPaymentForm"];function xe(t,e){if(1&t&&(s.Vb(0,"mat-hint"),s.Kc(1),s.Ub()),2&t){const t=s.hc(2);s.Db(1),s.Lc(t.paymentDecodedHint)}}function ve(t,e){1&t&&(s.Vb(0,"mat-error"),s.Kc(1,"Payment request is required."),s.Ub())}function Se(t,e){if(1&t){const t=s.Wb();s.Vb(0,"form",4,5),s.Vb(2,"mat-form-field",6),s.Vb(3,"textarea",7,8),s.dc("ngModelChange",function(e){return s.zc(t),s.hc().onPaymentRequestEntry(e)})("matTextareaAutosize",function(){return!0}),s.Ub(),s.Ic(5,xe,2,1,"mat-hint",9),s.Ic(6,ve,2,0,"mat-error",9),s.Ub(),s.Vb(7,"div",10),s.Vb(8,"button",11),s.dc("click",function(){return s.zc(t),s.hc().resetData()}),s.Kc(9,"Clear Field"),s.Ub(),s.Vb(10,"button",12),s.dc("click",function(){return s.zc(t),s.hc().onSendPayment()}),s.Kc(11,"Send Payment"),s.Ub(),s.Ub(),s.Ub()}if(2&t){const t=s.hc();s.Db(3),s.oc("ngModel",t.paymentRequest),s.Db(2),s.oc("ngIf",t.paymentRequest&&""!==t.paymentDecodedHint),s.Db(1),s.oc("ngIf",!t.paymentRequest)}}function we(t,e){if(1&t){const t=s.Wb();s.Vb(0,"div",13),s.Vb(1,"button",12),s.dc("click",function(){return s.zc(t),s.hc().openSendPaymentModal()}),s.Kc(2,"Send Payment"),s.Ub(),s.Ub()}}function De(t,e){1&t&&s.Qb(0,"mat-progress-bar",48)}function Ce(t,e){1&t&&(s.Vb(0,"th",49),s.Kc(1,"Date/Time"),s.Ub())}function Ve(t,e){if(1&t&&(s.Vb(0,"td",50),s.Kc(1),s.Ub()),2&t){const t=e.$implicit;s.Db(1),s.Lc(null==t?null:t.firstPartTimestampStr)}}function Ue(t,e){1&t&&(s.Vb(0,"th",49),s.Kc(1,"ID"),s.Ub())}const Ie=function(t){return{"max-width":t}};function Le(t,e){if(1&t&&(s.Vb(0,"td",50),s.Vb(1,"div",51),s.Vb(2,"span",52),s.Kc(3),s.Ub(),s.Ub(),s.Ub()),2&t){const t=e.$implicit,n=s.hc(2);s.Db(1),s.oc("ngStyle",s.sc(2,Ie,n.screenSize===n.screenSizeEnum.XS?"10rem":"22rem")),s.Db(2),s.Lc(t.id)}}function Ae(t,e){1&t&&(s.Vb(0,"th",49),s.Kc(1,"Destination"),s.Ub())}function Pe(t,e){if(1&t&&(s.Vb(0,"td",50),s.Vb(1,"div",51),s.Vb(2,"span",52),s.Kc(3),s.Ub(),s.Ub(),s.Ub()),2&t){const t=e.$implicit,n=s.hc(2);s.Db(1),s.oc("ngStyle",s.sc(2,Ie,n.screenSize===n.screenSizeEnum.XS?"10rem":"22rem")),s.Db(2),s.Lc(t.recipientNodeAlias)}}function Fe(t,e){1&t&&(s.Vb(0,"th",53),s.Kc(1,"Amount (Sats)"),s.Ub())}function ke(t,e){if(1&t&&(s.Vb(0,"td",50),s.Vb(1,"span",54),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&t){const t=e.$implicit;s.Db(2),s.Lc(s.jc(3,1,null==t?null:t.recipientAmount))}}function Oe(t,e){if(1&t){const t=s.Wb();s.Vb(0,"th",55),s.Vb(1,"div",56),s.Vb(2,"mat-select",57),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",58),s.dc("click",function(){return s.zc(t),s.hc(2).onDownloadCSV()}),s.Kc(5,"Download CSV"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}}function Te(t,e){if(1&t){const t=s.Wb();s.Vb(0,"td",59),s.Vb(1,"button",60),s.dc("click",function(){s.zc(t);const n=e.$implicit;return s.hc(2).onPaymentClick(n)}),s.Kc(2,"View Info"),s.Ub(),s.Ub()}}function Re(t,e){1&t&&(s.Vb(0,"p"),s.Kc(1,"No payments available."),s.Ub())}function Ke(t,e){if(1&t&&(s.Vb(0,"td",61),s.Ic(1,Re,2,0,"p",9),s.Ub()),2&t){const t=s.hc(2);s.Db(1),s.oc("ngIf",!(null!=t.payments&&t.payments.data)||(null==t.payments||null==t.payments.data?null:t.payments.data.length)<1)}}function Me(t,e){if(1&t&&(s.Vb(0,"span",64),s.Kc(1),s.Ub()),2&t){const t=e.$implicit;s.Db(1),s.Mc(" ",t.timestampStr," ")}}function ze(t,e){if(1&t&&(s.Tb(0),s.Ic(1,Me,2,1,"span",63),s.Sb()),2&t){const t=s.hc().$implicit;s.Db(1),s.oc("ngForOf",null==t?null:t.parts)}}function Ee(t,e){if(1&t&&(s.Vb(0,"td",50),s.Vb(1,"span",62),s.Kc(2),s.Ub(),s.Ic(3,ze,2,1,"ng-container",9),s.Ub()),2&t){const t=e.$implicit;s.Db(2),s.Mc(" Total Attempts: ",null==t||null==t.parts?null:t.parts.length," "),s.Db(1),s.oc("ngIf",t.is_expanded)}}function Be(t,e){if(1&t&&(s.Vb(0,"span",62),s.Vb(1,"span",65),s.Vb(2,"span",52),s.Kc(3),s.Ub(),s.Ub(),s.Ub()),2&t){const t=e.$implicit,n=s.hc(4);s.Db(1),s.oc("ngStyle",s.sc(2,Ie,n.screenSize===n.screenSizeEnum.XS?"10rem":"22rem")),s.Db(2),s.Lc(t.id)}}function Ne(t,e){if(1&t&&(s.Vb(0,"span"),s.Ic(1,Be,4,4,"span",66),s.Ub()),2&t){const t=s.hc().$implicit;s.Db(1),s.oc("ngForOf",null==t?null:t.parts)}}function He(t,e){if(1&t&&(s.Vb(0,"td",50),s.Vb(1,"div",65),s.Vb(2,"span",52),s.Kc(3),s.Ub(),s.Ub(),s.Ic(4,Ne,2,1,"span",9),s.Ub()),2&t){const t=e.$implicit,n=s.hc(2);s.Db(1),s.oc("ngStyle",s.sc(3,Ie,n.screenSize===n.screenSizeEnum.XS?"10rem":"22rem")),s.Db(2),s.Lc(t.id),s.Db(1),s.oc("ngIf",t.is_expanded)}}function Qe(t,e){if(1&t&&(s.Vb(0,"span",62),s.Vb(1,"span",65),s.Vb(2,"span",52),s.Kc(3),s.Ub(),s.Ub(),s.Ub()),2&t){const t=e.$implicit,n=s.hc(4);s.Db(1),s.oc("ngStyle",s.sc(2,Ie,n.screenSize===n.screenSizeEnum.XS?"10rem":"22rem")),s.Db(2),s.Lc(t.toChannelAlias)}}function qe(t,e){if(1&t&&(s.Vb(0,"span"),s.Ic(1,Qe,4,4,"span",66),s.Ub()),2&t){const t=s.hc().$implicit;s.Db(1),s.oc("ngForOf",null==t?null:t.parts)}}function je(t,e){if(1&t&&(s.Vb(0,"td",50),s.Vb(1,"div",65),s.Vb(2,"span",52),s.Kc(3),s.Ub(),s.Ub(),s.Ic(4,qe,2,1,"span",9),s.Ub()),2&t){const t=e.$implicit,n=s.hc(2);s.Db(1),s.oc("ngStyle",s.sc(3,Ie,n.screenSize===n.screenSizeEnum.XS?"10rem":"22rem")),s.Db(2),s.Lc(null==t?null:t.recipientNodeAlias),s.Db(1),s.oc("ngIf",t.is_expanded)}}function _e(t,e){if(1&t&&(s.Vb(0,"span",67),s.Kc(1),s.ic(2,"number"),s.Ub()),2&t){const t=e.$implicit;s.Db(1),s.Mc(" ",s.kc(2,1,t.amount,"1.0-0")," ")}}function $e(t,e){if(1&t&&(s.Vb(0,"span"),s.Ic(1,_e,3,4,"span",68),s.Ub()),2&t){const t=s.hc().$implicit;s.Db(1),s.oc("ngForOf",null==t?null:t.parts)}}function Je(t,e){if(1&t&&(s.Vb(0,"td",50),s.Vb(1,"span",67),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ic(4,$e,2,1,"span",9),s.Ub()),2&t){const t=e.$implicit;s.Db(2),s.Lc(s.kc(3,2,null==t?null:t.recipientAmount,"1.0-0")),s.Db(2),s.oc("ngIf",t.is_expanded)}}function Ge(t,e){if(1&t){const t=s.Wb();s.Vb(0,"div",70),s.Vb(1,"button",73),s.dc("click",function(){s.zc(t);const n=e.$implicit,a=s.hc(2).$implicit;return s.hc(2).onPartClick(n,a)}),s.Kc(2),s.Ub(),s.Ub()}if(2&t){const t=e.index;s.Db(2),s.Mc("View ",t+1,"")}}function Xe(t,e){if(1&t&&(s.Vb(0,"div"),s.Ic(1,Ge,3,1,"div",72),s.Ub()),2&t){const t=s.hc().$implicit;s.Db(1),s.oc("ngForOf",null==t?null:t.parts)}}function We(t,e){if(1&t&&(s.Vb(0,"td",69),s.Vb(1,"span",70),s.Vb(2,"button",71),s.dc("click",function(){const t=e.$implicit;return t.is_expanded=!t.is_expanded}),s.Kc(3),s.Ub(),s.Ub(),s.Ic(4,Xe,2,1,"div",9),s.Ub()),2&t){const t=e.$implicit;s.Db(3),s.Lc(t.is_expanded?"Hide":"Show"),s.Db(1),s.oc("ngIf",t.is_expanded)}}function Ye(t,e){if(1&t&&s.Qb(0,"tr",74),2&t){const t=e.$implicit,n=s.hc(2);s.oc("@newlyAddedRowAnimation",t.payment_hash===n.newlyAddedPayment&&n.flgAnimate?"added":"notAdded")}}const Ze=function(t){return{"display-none":t}};function tn(t,e){if(1&t&&s.Qb(0,"tr",75),2&t){const t=s.hc(2);s.oc("ngClass",s.sc(1,Ze,(null==t.payments?null:t.payments.data)&&(null==t.payments||null==t.payments.data?null:t.payments.data.length)>0))}}function en(t,e){1&t&&s.Qb(0,"tr",76)}function nn(t,e){if(1&t&&s.Qb(0,"tr",74),2&t){const t=e.$implicit,n=s.hc(2);s.oc("@newlyAddedRowAnimation",t.payment_hash===n.newlyAddedPayment&&n.flgAnimate?"added":"notAdded")}}const an=function(t){return{"overflow-auto error-border":t,"overflow-auto":!0}},on=function(){return["no_payment"]};function sn(t,e){if(1&t){const t=s.Wb();s.Vb(0,"div",14),s.Vb(1,"div",15),s.Vb(2,"div",16),s.Qb(3,"fa-icon",17),s.Vb(4,"span",18),s.Kc(5,"Payments History"),s.Ub(),s.Ub(),s.Vb(6,"mat-form-field",19),s.Vb(7,"input",20),s.dc("keyup",function(e){return s.zc(t),s.hc().applyFilter(e.target)}),s.Ub(),s.Ub(),s.Ub(),s.Vb(8,"div",21),s.Ic(9,De,1,0,"mat-progress-bar",22),s.Vb(10,"table",23,24),s.Tb(12,25),s.Ic(13,Ce,2,0,"th",26),s.Ic(14,Ve,2,1,"td",27),s.Sb(),s.Tb(15,28),s.Ic(16,Ue,2,0,"th",26),s.Ic(17,Le,4,4,"td",27),s.Sb(),s.Tb(18,29),s.Ic(19,Ae,2,0,"th",26),s.Ic(20,Pe,4,4,"td",27),s.Sb(),s.Tb(21,30),s.Ic(22,Fe,2,0,"th",31),s.Ic(23,ke,4,3,"td",27),s.Sb(),s.Tb(24,32),s.Ic(25,Oe,6,0,"th",33),s.Ic(26,Te,3,0,"td",34),s.Sb(),s.Tb(27,35),s.Ic(28,Ke,2,1,"td",36),s.Sb(),s.Tb(29,37),s.Ic(30,Ee,4,2,"td",27),s.Sb(),s.Tb(31,38),s.Ic(32,He,5,5,"td",27),s.Sb(),s.Tb(33,39),s.Ic(34,je,5,5,"td",27),s.Sb(),s.Tb(35,40),s.Ic(36,Je,5,5,"td",27),s.Sb(),s.Tb(37,41),s.Ic(38,We,5,2,"td",42),s.Sb(),s.Ic(39,Ye,1,1,"tr",43),s.Ic(40,tn,1,3,"tr",44),s.Ic(41,en,1,0,"tr",45),s.Ic(42,nn,1,1,"tr",46),s.Ub(),s.Ub(),s.Qb(43,"mat-paginator",47),s.Ub()}if(2&t){const t=s.hc();s.Db(3),s.oc("icon",t.faHistory),s.Db(6),s.oc("ngIf",!0===t.flgLoading[0]),s.Db(1),s.oc("dataSource",t.payments)("ngClass",s.sc(13,an,"error"===t.flgLoading[0])),s.Db(29),s.oc("matRowDefColumns",t.partColumns)("matRowDefWhen",t.is_group),s.Db(1),s.oc("matFooterRowDef",s.rc(15,on)),s.Db(1),s.oc("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),s.Db(1),s.oc("matRowDefColumns",t.displayedColumns),s.Db(1),s.oc("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS)}}let cn=(()=>{class t{constructor(t,e,n,a,i,o,s){this.logger=t,this.commonService=e,this.store=n,this.rtlEffects=a,this.eclEffects=i,this.decimalPipe=o,this.dataService=s,this.calledFrom="transactions",this.faHistory=f.r,this.newlyAddedPayment="",this.flgAnimate=!0,this.selNode={},this.flgLoading=[!0],this.information={},this.paymentJSONArr=[],this.paymentDecoded={},this.displayedColumns=[],this.partColumns=[],this.paymentRequest="",this.paymentDecodedHint="",this.flgSticky=!1,this.pageSize=p.p,this.pageSizeOptions=p.q,this.screenSize="",this.screenSizeEnum=p.s,this.unSubs=[new d.a,new d.a,new d.a,new d.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===p.s.XS?(this.flgSticky=!1,this.displayedColumns=["firstPartTimestamp","actions"],this.partColumns=["groupTotal","groupAction"]):this.screenSize===p.s.SM?(this.flgSticky=!1,this.displayedColumns=["firstPartTimestamp","recipientAmount","actions"],this.partColumns=["groupTotal","groupAmount","groupAction"]):this.screenSize===p.s.MD?(this.flgSticky=!1,this.displayedColumns=["firstPartTimestamp","id","recipientAmount","actions"],this.partColumns=["groupTotal","groupId","groupAmount","groupAction"]):(this.flgSticky=!0,this.displayedColumns=["firstPartTimestamp","id","recipientNodeAlias","recipientAmount","actions"],this.partColumns=["groupTotal","groupId","groupChannelAlias","groupAmount","groupAction"])}ngOnInit(){this.store.select("ecl").pipe(Object(u.a)(this.unSubs[0])).subscribe(t=>{t.effectErrors.forEach(t=>{"FetchPayments"===t.action&&(this.flgLoading[0]="error")}),this.information=t.information,this.selNode=t.nodeSettings,t.payments.sent&&t.payments.sent.map(e=>{let n=t.peers.find(t=>t.nodeId===e.recipientNodeId);e.recipientNodeAlias=n?n.alias:e.recipientNodeId,e.parts&&e.parts.map(e=>{let n=t.activeChannels.find(t=>t.channelId===e.toChannelId);e.toChannelAlias=n?n.alias:e.toChannelId})}),this.paymentJSONArr=t.payments&&t.payments.sent&&t.payments.sent.length>0?t.payments.sent:[],this.loadPaymentsTable(this.paymentJSONArr),setTimeout(()=>{this.flgAnimate=!1},3e3),"error"!==this.flgLoading[0]&&(this.flgLoading[0]=!this.paymentJSONArr),this.logger.info(t)})}ngAfterViewInit(){this.loadPaymentsTable(this.paymentJSONArr)}loadPaymentsTable(t){this.payments=new it.o(t?[...t]:[]),this.payments.sort=this.sort,this.payments.sortingDataAccessor=(t,e)=>{switch(e){case"firstPartTimestamp":return this.commonService.sortByKey(t.parts,"timestamp","number",this.sort.direction),t.firstPartTimestamp;case"id":return this.commonService.sortByKey(t.parts,"id","string",this.sort.direction),t.id;case"recipientNodeAlias":return this.commonService.sortByKey(t.parts,"toChannelAlias","string",this.sort.direction),t.recipientNodeAlias;case"recipientAmount":return this.commonService.sortByKey(t.parts,"amount","number",this.sort.direction),t.recipientAmount;default:return t[e]&&isNaN(t[e])?t[e].toLocaleLowerCase():t[e]?+t[e]:null}},this.payments.filterPredicate=(t,e)=>JSON.stringify(t).toLowerCase().includes(e),this.payments.paginator=this.paginator}onSendPayment(){if(!this.paymentRequest)return!0;this.paymentDecoded.timestamp?this.sendPayment():this.dataService.decodePayment(this.paymentRequest,!1).pipe(Object(te.a)(1)).subscribe(t=>{this.paymentDecoded=t,this.paymentDecoded.timestamp?(this.paymentDecoded.amount||(this.paymentDecoded.amount=0),this.sendPayment()):this.resetData()})}sendPayment(){this.flgAnimate=!0,this.newlyAddedPayment=this.paymentDecoded.paymentHash,this.paymentDecoded.amount&&0!==this.paymentDecoded.amount?(this.store.dispatch(new st.E({data:{type:p.b.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:"timestampStr",value:this.paymentDecoded.timestampStr,title:"Creation Date",width:50},{key:"amount",value:this.paymentDecoded.amount,title:"Amount (Sats)",width:50,type:p.h.NUMBER}],[{key:"expiry",value:this.paymentDecoded.expiry,title:"Expiry",width:50,type:p.h.NUMBER},{key:"minFinalCltvExpiry",value:this.paymentDecoded.minFinalCltvExpiry,title:"CLTV Expiry",width:50}]]}})),this.rtlEffects.closeConfirm.pipe(Object(te.a)(1)).subscribe(t=>{t&&(this.store.dispatch(new st.G("Sending Payment...")),this.store.dispatch(new g.nb({invoice:this.paymentRequest,fromDialog:!1})),this.resetData())})):(this.store.dispatch(new st.E({data:{type:p.b.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:"timestampStr",value:this.paymentDecoded.timestampStr,title:"Creation Date",width:40},{key:"expiry",value:this.paymentDecoded.expiry,title:"Expiry",width:30,type:p.h.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:p.h.NUMBER.toLowerCase(),inputValue:"",width:30}]}})),this.rtlEffects.closeConfirm.pipe(Object(te.a)(1)).subscribe(t=>{t&&(this.paymentDecoded.amount=t[0].inputValue,this.store.dispatch(new st.G("Sending Payment...")),this.store.dispatch(new g.nb({invoice:this.paymentRequest,amountMsat:1e3*t[0].inputValue,fromDialog:!1})),this.resetData())}))}onPaymentRequestEntry(t){this.paymentRequest=t,this.paymentDecodedHint="",this.paymentRequest&&this.paymentRequest.length>100&&this.dataService.decodePayment(this.paymentRequest,!1).pipe(Object(te.a)(1)).subscribe(t=>{this.paymentDecoded=t,this.paymentDecoded.amount?this.commonService.convertCurrency(+this.paymentDecoded.amount,p.g.SATS,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe(Object(u.a)(this.unSubs[1])).subscribe(t=>{this.paymentDecodedHint=this.selNode.fiatConversion?"Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats ("+t.symbol+this.decimalPipe.transform(t.OTHER?t.OTHER:0,p.f.OTHER)+") | Memo: "+this.paymentDecoded.description:"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(new st.D({data:{component:de}}))}resetData(){this.paymentDecoded={},this.paymentRequest="",this.form.resetForm()}is_group(t,e){return e.parts&&e.parts.length>1}onPaymentClick(t){t.paymentHash&&""!==t.paymentHash.trim()?this.dataService.decodePayments(t.paymentHash).pipe(Object(te.a)(1)).subscribe(e=>{this.showPaymentView(t,e.length&&e.length>0?e[0]:[])},e=>{this.showPaymentView(t,[])}):this.showPaymentView(t,[])}showPaymentView(t,e){this.store.dispatch(new st.D({data:{sentPaymentInfo:e,payment:t,component:ge}}))}onPartClick(t,e){e.paymentHash&&""!==e.paymentHash.trim()?this.dataService.decodePayments(e.paymentHash).pipe(Object(te.a)(1)).subscribe(n=>{this.showPartView(t,e,n)},n=>{this.showPartView(t,e,[])}):this.showPartView(t,e,[])}showPartView(t,e,n){const a=[[{key:"paymentHash",value:e.paymentHash,title:"Payment Hash",width:100,type:p.h.STRING}],[{key:"paymentPreimage",value:e.paymentPreimage,title:"Payment Preimage",width:100,type:p.h.STRING}],[{key:"toChannelId",value:t.toChannelId,title:"Channel",width:100,type:p.h.STRING}],[{key:"id",value:t.id,title:"Part ID",width:50,type:p.h.STRING},{key:"timestampStr",value:t.timestampStr,title:"Time",width:50,type:p.h.DATE_TIME}],[{key:"amount",value:t.amount,title:"Amount (Sats)",width:50,type:p.h.NUMBER},{key:"feesPaid",value:t.feesPaid,title:"Fee (Sats)",width:50,type:p.h.NUMBER}]];n.length>0&&n[0].paymentRequest&&n[0].paymentRequest.description&&""!==n[0].paymentRequest.description&&a.splice(3,0,[{key:"description",value:n[0].paymentRequest.description,title:"Description",width:100,type:p.h.STRING}]),this.store.dispatch(new st.D({data:{type:p.b.INFORMATION,alertTitle:"Payment Part Information",message:a}}))}applyFilter(t){this.payments.filter=t.value.trim().toLowerCase()}onDownloadCSV(){if(this.payments.data&&this.payments.data.length>0){let t=JSON.parse(JSON.stringify(this.payments.data)),e=t.reduce((t,e)=>(e.paymentHash&&""!==e.paymentHash.trim()&&(t=""===t?e.paymentHash:t+","+e.paymentHash),t),"");Object(Zt.a)(this.dataService.decodePayments(e).pipe(Object(u.a)(this.unSubs[2])).subscribe(e=>{e.forEach((e,n)=>{e.length>0&&e[0].paymentRequest&&e[0].paymentRequest.description&&""!==e[0].paymentRequest.description&&(t[n].description=e[0].paymentRequest.description)});let n=t.reduce((t,e)=>t.concat(e),[]);this.commonService.downloadFile(n,"Payments")}))}}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(y.b),s.Pb(S.a),s.Pb(x.h),s.Pb(vt.a),s.Pb(ee.a),s.Pb(a.f),s.Pb(ne.a))},t.\u0275cmp=s.Jb({type:t,selectors:[["rtl-ecl-lightning-payments"]],viewQuery:function(t,e){if(1&t&&(s.Pc(ye,!0),s.Pc(at.a,!0),s.Pc(nt.a,!0)),2&t){let t;s.vc(t=s.ec())&&(e.form=t.first),s.vc(t=s.ec())&&(e.sort=t.first),s.vc(t=s.ec())&&(e.paginator=t.first)}},inputs:{calledFrom:"calledFrom"},features:[s.Cb([{provide:nt.b,useValue:Object(p.B)("Payments")}])],decls:4,vars:3,consts:[["fxLayout","column","fxFlex","100","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","100"],["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","start end"],["matInput","","placeholder","Filter",3,"keyup"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"table-container","w-100",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","firstPartTimestamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","id"],["matColumnDef","recipientNodeAlias"],["matColumnDef","recipientAmount"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","actions"],["mat-header-cell","","class","px-3",4,"matHeaderCellDef"],["mat-cell","","class","px-3","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_payment"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["matColumnDef","groupTotal"],["matColumnDef","groupId"],["matColumnDef","groupChannelAlias"],["matColumnDef","groupAmount"],["matColumnDef","groupAction"],["mat-cell","","class","px-3",4,"matCellDef"],["mat-row","",4,"matRowDef","matRowDefColumns","matRowDefWhen"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["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","",1,"px-3"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"px-3"],["mat-stroked-button","","color","primary","type","button","tabindex","4",3,"click"],["mat-footer-cell","","colspan","4"],["fxLayoutAlign","start center",1,"part-row-span"],["fxLayoutAlign","start center","class","part-row-span pl-3",4,"ngFor","ngForOf"],["fxLayoutAlign","start center",1,"part-row-span","pl-3"],["fxLayoutAlign","start center",1,"ellipsis-parent","part-row-span",3,"ngStyle"],["fxLayoutAlign","start center","class","part-row-span",4,"ngFor","ngForOf"],["fxLayoutAlign","end center",1,"part-row-span"],["fxLayoutAlign","end center","class","part-row-span",4,"ngFor","ngForOf"],["mat-cell","",1,"px-3"],["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(t,e){1&t&&(s.Vb(0,"div",0),s.Ic(1,Se,12,3,"form",1),s.Ic(2,we,3,0,"div",2),s.Ic(3,sn,44,16,"div",3),s.Ub()),2&t&&(s.Db(1),s.oc("ngIf","home"===e.calledFrom),s.Db(1),s.oc("ngIf","transactions"===e.calledFrom),s.Db(1),s.oc("ngIf","transactions"===e.calledFrom))},directives:[c.c,c.a,c.b,a.o,ct.u,ct.n,ct.o,R.c,lt.b,ct.c,lt.d,ct.s,z.b,ct.m,ct.p,U.a,R.f,R.b,w.a,it.n,at.a,a.m,L.a,it.c,it.i,it.b,it.e,it.m,it.g,it.k,nt.a,l.a,it.h,at.b,it.a,a.p,L.b,dt.a,dt.c,ut.m,it.d,a.n,it.l,it.f,it.j],pipes:[a.f],styles:[".mat-column-groupChannelAlias[_ngcontent-%COMP%], .mat-column-groupId[_ngcontent-%COMP%], .mat-column-id[_ngcontent-%COMP%], .mat-column-recipientNodeAlias[_ngcontent-%COMP%]{padding:0 1rem;flex:0 0 25%;width:25%}.mat-column-groupChannelAlias[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%], .mat-column-groupId[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%], .mat-column-id[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%], .mat-column-recipientNodeAlias[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%]{display:flex}.mat-column-actions[_ngcontent-%COMP%], .mat-column-groupAction[_ngcontent-%COMP%]{min-height:4.8rem}.mat-column-groupAction[_ngcontent-%COMP%] .btn-part-expand[_ngcontent-%COMP%]{width:9rem}.mat-column-groupAction[_ngcontent-%COMP%] .btn-part-info[_ngcontent-%COMP%]{margin-top:.5rem;width:9rem}.part-row-span[_ngcontent-%COMP%]{min-height:4.2rem;place-content:center flex-start;align-items:center}.mat-column-groupTotal[_ngcontent-%COMP%]{min-width:15rem}"],data:{animation:[xt.a]}}),t})();function ln(t,e){if(1&t&&(s.Vb(0,"button",25),s.Vb(1,"mat-icon"),s.Kc(2,"more_vert"),s.Ub(),s.Ub()),2&t){s.hc();const t=s.wc(11);s.oc("matMenuTriggerFor",t)}}function rn(t,e){if(1&t){const t=s.Wb();s.Vb(0,"button",15),s.dc("click",function(){return s.zc(t),s.hc(3).onNavigateTo("/ecl/reports")}),s.Kc(1,"Fees Summary"),s.Ub()}}function bn(t,e){if(1&t){const t=s.Wb();s.Vb(0,"button",15),s.dc("click",function(){return s.zc(t),s.hc(3).onsortChannelsBy()}),s.Kc(1),s.Ub()}if(2&t){const t=s.hc(3);s.Db(1),s.Mc("Sort By ","Balance Score"===t.sortField?"Capacity":"Balance Score","")}}const dn=function(t){return{"error-border":t}};function un(t,e){if(1&t&&s.Qb(0,"rtl-ecl-node-info",26),2&t){const t=s.hc(3);s.oc("information",t.information)("showColorFieldSeparately",!1)("ngClass",s.sc(3,dn,"error"===t.flgLoading[0]))}}function hn(t,e){if(1&t&&s.Qb(0,"rtl-ecl-balances-info",27),2&t){const t=s.hc(3);s.oc("balances",t.balances)("ngClass",s.sc(2,dn,"error"===t.flgLoading[2]))}}function mn(t,e){if(1&t&&s.Qb(0,"rtl-ecl-channel-capacity-info",28),2&t){const t=s.hc(3);s.oc("sortBy",t.sortField)("channelBalances",t.channelBalances)("allChannels",t.allChannelsCapacity)("ngClass",s.sc(4,dn,"error"===t.flgLoading[5]))}}function fn(t,e){if(1&t&&s.Qb(0,"rtl-ecl-fee-info",29),2&t){const t=s.hc(3);s.oc("fees",t.fees)("ngClass",s.sc(2,dn,"error"===t.flgLoading[1]))}}function pn(t,e){if(1&t&&s.Qb(0,"rtl-ecl-channel-status-info",30),2&t){const t=s.hc(3);s.oc("channelsStatus",t.channelsStatus)("ngClass",s.sc(2,dn,"error"===t.flgLoading[0]))}}function gn(t,e){1&t&&(s.Vb(0,"h3"),s.Kc(1,"Error! Unable to find information!"),s.Ub())}function yn(t,e){if(1&t){const t=s.Wb();s.Vb(0,"mat-grid-tile",8),s.Vb(1,"mat-card",9),s.Vb(2,"mat-card-header"),s.Vb(3,"mat-card-title",10),s.Vb(4,"div"),s.Qb(5,"fa-icon",11),s.Vb(6,"span"),s.Kc(7),s.Ub(),s.Ub(),s.Vb(8,"div"),s.Ic(9,ln,3,1,"button",12),s.Vb(10,"mat-menu",13,14),s.Vb(12,"button",15),s.dc("click",function(){s.zc(t);const n=e.$implicit;return s.hc(2).onNavigateTo(n.link)}),s.Kc(13),s.Ub(),s.Ic(14,rn,2,0,"button",16),s.Ic(15,bn,2,1,"button",16),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Vb(16,"mat-card-content",17),s.Vb(17,"div",18),s.Ic(18,un,1,5,"rtl-ecl-node-info",19),s.Ic(19,hn,1,4,"rtl-ecl-balances-info",20),s.Ic(20,mn,1,6,"rtl-ecl-channel-capacity-info",21),s.Ic(21,fn,1,4,"rtl-ecl-fee-info",22),s.Ic(22,pn,1,4,"rtl-ecl-channel-status-info",23),s.Ic(23,gn,2,0,"h3",24),s.Ub(),s.Ub(),s.Ub(),s.Ub()}if(2&t){const t=e.$implicit;s.oc("colspan",t.cols)("rowspan",t.rows),s.Db(5),s.oc("icon",t.icon),s.Db(2),s.Lc(t.title),s.Db(2),s.oc("ngIf",t.link),s.Db(4),s.Mc("Go To ",t.goTo,""),s.Db(1),s.oc("ngIf","fee"===t.id),s.Db(1),s.oc("ngIf","capacity"===t.id),s.Db(1),s.pc("fxFlex","capacity"===t.id?90:70),s.Db(1),s.oc("ngSwitch",t.id),s.Db(1),s.oc("ngSwitchCase","node"),s.Db(1),s.oc("ngSwitchCase","balance"),s.Db(1),s.oc("ngSwitchCase","capacity"),s.Db(1),s.oc("ngSwitchCase","fee"),s.Db(1),s.oc("ngSwitchCase","status")}}function xn(t,e){if(1&t&&(s.Vb(0,"div",2),s.Vb(1,"div",3),s.Qb(2,"fa-icon",4),s.Vb(3,"span",5),s.Kc(4),s.Ub(),s.Ub(),s.Vb(5,"mat-grid-list",6),s.Ic(6,yn,24,15,"mat-grid-tile",7),s.Ub(),s.Ub()),2&t){const t=s.hc();s.Db(2),s.oc("icon",t.flgLoading[0]?t.faFrown:t.faSmile),s.Db(2),s.Lc(t.flgLoading[0]?"Error! Please check the server connection.":"Welcome "+t.information.alias+"! Your node is up and running."),s.Db(1),s.oc("rowHeight",t.operatorCardHeight),s.Db(1),s.oc("ngForOf",t.operatorCards)}}function vn(t,e){if(1&t&&(s.Vb(0,"button",25),s.Vb(1,"mat-icon"),s.Kc(2,"more_vert"),s.Ub(),s.Ub()),2&t){s.hc();const t=s.wc(9);s.oc("matMenuTriggerFor",t)}}function Sn(t,e){if(1&t){const t=s.Wb();s.Vb(0,"mat-card-header"),s.Vb(1,"mat-card-title",10),s.Vb(2,"div"),s.Qb(3,"fa-icon",11),s.Vb(4,"span"),s.Kc(5),s.Ub(),s.Ub(),s.Vb(6,"div"),s.Ic(7,vn,3,1,"button",12),s.Vb(8,"mat-menu",13,39),s.Vb(10,"button",15),s.dc("click",function(){s.zc(t);const e=s.hc().$implicit;return s.hc(2).onNavigateTo(e.link)}),s.Kc(11),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub()}if(2&t){const t=s.hc().$implicit;s.Db(3),s.oc("icon",t.icon),s.Db(2),s.Lc(t.title),s.Db(2),s.oc("ngIf",t.link),s.Db(4),s.Mc("Go To ",t.goTo,"")}}function wn(t,e){if(1&t&&s.Qb(0,"rtl-ecl-node-info",40),2&t){const t=s.hc(3);s.oc("information",t.information)("ngClass",s.sc(2,dn,"error"===t.flgLoading[0]))}}function Dn(t,e){if(1&t&&s.Qb(0,"rtl-ecl-balances-info",27),2&t){const t=s.hc(3);s.oc("balances",t.balances)("ngClass",s.sc(2,dn,"error"===t.flgLoading[2]))}}function Cn(t,e){if(1&t&&s.Qb(0,"rtl-ecl-channel-liquidity-info",41),2&t){const t=s.hc(3);s.oc("direction","In")("totalLiquidity",t.totalInboundLiquidity)("allChannels",t.allInboundChannels)("ngClass",s.sc(4,dn,"error"===t.flgLoading[5]))}}function Vn(t,e){if(1&t&&s.Qb(0,"rtl-ecl-channel-liquidity-info",41),2&t){const t=s.hc(3);s.oc("direction","Out")("totalLiquidity",t.totalOutboundLiquidity)("allChannels",t.allOutboundChannels)("ngClass",s.sc(4,dn,"error"===t.flgLoading[5]))}}function Un(t,e){if(1&t){const t=s.Wb();s.Vb(0,"button",50),s.Vb(1,"mat-icon"),s.Kc(2,"more_vert"),s.Ub(),s.Ub(),s.Vb(3,"mat-menu",13,51),s.Vb(5,"button",15),s.dc("click",function(){s.zc(t);const e=s.hc(2).$implicit;return s.hc(2).onNavigateTo(e.link)}),s.Kc(6),s.Ub(),s.Vb(7,"button",15),s.dc("click",function(){return s.zc(t),s.hc(4).onNavigateTo("/ecl/reports/transactions")}),s.Kc(8,"Transactions Summary"),s.Ub(),s.Ub()}if(2&t){const t=s.wc(4),e=s.hc(2).$implicit;s.oc("matMenuTriggerFor",t),s.Db(6),s.Mc("Go To ",e.goTo,"")}}function In(t,e){1&t&&(s.Vb(0,"span",42),s.Vb(1,"mat-tab-group",43),s.Vb(2,"mat-tab",44),s.Qb(3,"rtl-ecl-lightning-invoices",45),s.Ub(),s.Vb(4,"mat-tab",46),s.Qb(5,"rtl-ecl-lightning-payments",47),s.Ub(),s.Vb(6,"mat-tab",48),s.Ic(7,Un,9,2,"ng-template",49),s.Ub(),s.Ub(),s.Ub()),2&t&&(s.Db(3),s.oc("calledFrom","home"),s.Db(2),s.oc("calledFrom","home"),s.Db(1),s.oc("disabled",!0))}function Ln(t,e){1&t&&(s.Vb(0,"h3"),s.Kc(1,"Error! Unable to find information!"),s.Ub())}const An=function(t){return{"p-0":t}};function Pn(t,e){if(1&t&&(s.Vb(0,"mat-grid-tile",8),s.Vb(1,"mat-card",33),s.Ic(2,Sn,12,4,"mat-card-header",34),s.Vb(3,"mat-card-content",35),s.Vb(4,"div",18),s.Ic(5,wn,1,4,"rtl-ecl-node-info",36),s.Ic(6,Dn,1,4,"rtl-ecl-balances-info",20),s.Ic(7,Cn,1,6,"rtl-ecl-channel-liquidity-info",37),s.Ic(8,Vn,1,6,"rtl-ecl-channel-liquidity-info",37),s.Ic(9,In,8,3,"span",38),s.Ic(10,Ln,2,0,"h3",24),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&t){const t=e.$implicit;s.oc("colspan",t.cols)("rowspan",t.rows),s.Db(1),s.oc("ngClass",s.sc(11,An,"transactions"===t.id)),s.Db(1),s.oc("ngIf","transactions"!==t.id),s.Db(1),s.pc("fxFlex","transactions"===t.id?100:"balance"===t.id?70:90),s.Db(1),s.oc("ngSwitch",t.id),s.Db(1),s.oc("ngSwitchCase","node"),s.Db(1),s.oc("ngSwitchCase","balance"),s.Db(1),s.oc("ngSwitchCase","inboundLiq"),s.Db(1),s.oc("ngSwitchCase","outboundLiq"),s.Db(1),s.oc("ngSwitchCase","transactions")}}function Fn(t,e){if(1&t&&(s.Vb(0,"div",31),s.Qb(1,"fa-icon",4),s.Vb(2,"span",5),s.Kc(3),s.Ub(),s.Ub(),s.Vb(4,"mat-grid-list",32),s.Ic(5,Pn,11,13,"mat-grid-tile",7),s.Ub()),2&t){const t=s.hc();s.Db(1),s.oc("icon",t.faSmile),s.Db(2),s.Mc("Welcome ",t.information.alias,"! Your node is up and running."),s.Db(1),s.oc("rowHeight",t.merchantCardHeight),s.Db(1),s.oc("ngForOf",t.merchantCards)}}let kn=(()=>{class t{constructor(t,e,n,a,i){this.logger=t,this.store=e,this.actions$=n,this.commonService=a,this.router=i,this.faSmile=m.b,this.faFrown=m.a,this.faAngleDoubleDown=f.a,this.faAngleDoubleUp=f.b,this.faChartPie=f.g,this.faBolt=f.e,this.faServer=f.K,this.faNetworkWired=f.B,this.flgChildInfoUpdated=!1,this.userPersonaEnum=p.z,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="330px",this.merchantCardHeight="65px",this.sortField="Balance Score",this.flgLoading=[!0,!0,!0,!0,!0,!0,!0,!0],this.unSubs=[new d.a,new d.a,new d.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===p.s.XS?(this.operatorCards=[{id:"node",icon:this.faServer,title:"Node Information",cols:10,rows:1},{id:"balance",goTo:"On-Chain",link:"/ecl/onchain",icon:this.faChartPie,title:"Balances",cols:10,rows:1},{id:"fee",goTo:"Routing",link:"/ecl/routing",icon:this.faBolt,title:"Routing Fee",cols:10,rows:1},{id:"status",goTo:"Channels",link:"/ecl/connections",icon:this.faNetworkWired,title:"Channels",cols:10,rows:1},{id:"capacity",goTo:"Channels",link:"/ecl/connections",icon:this.faNetworkWired,title:"Channels Capacity",cols:10,rows:2}],this.merchantCards=[{id:"balance",goTo:"On-Chain",link:"/ecl/onchain",icon:this.faChartPie,title:"Balances",cols:6,rows:4},{id:"transactions",goTo:"Transactions",link:"/ecl/transactions",title:"",cols:6,rows:4},{id:"inboundLiq",goTo:"Channels",link:"/ecl/connections",icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:6,rows:8},{id:"outboundLiq",goTo:"Channels",link:"/ecl/connections",icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:6,rows:8}]):this.screenSize===p.s.SM||this.screenSize===p.s.MD?(this.operatorCards=[{id:"node",icon:this.faServer,title:"Node Information",cols:5,rows:1},{id:"balance",goTo:"On-Chain",link:"/ecl/onchain",icon:this.faChartPie,title:"Balances",cols:5,rows:1},{id:"fee",goTo:"Routing",link:"/ecl/routing",icon:this.faBolt,title:"Routing Fee",cols:5,rows:1},{id:"status",goTo:"Channels",link:"/ecl/connections",icon:this.faNetworkWired,title:"Channels",cols:5,rows:1},{id:"capacity",goTo:"Channels",link:"/ecl/connections",icon:this.faNetworkWired,title:"Channels Capacity",cols:10,rows:2}],this.merchantCards=[{id:"balance",goTo:"On-Chain",link:"/ecl/onchain",icon:this.faChartPie,title:"Balances",cols:3,rows:4},{id:"transactions",goTo:"Transactions",link:"/ecl/transactions",title:"",cols:3,rows:4},{id:"inboundLiq",goTo:"Channels",link:"/ecl/connections",icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:3,rows:8},{id:"outboundLiq",goTo:"Channels",link:"/ecl/connections",icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:3,rows:8}]):(this.operatorCardHeight=(window.screen.height-200)/2+"px",this.merchantCardHeight=(window.screen.height-210)/10+"px",this.operatorCards=[{id:"node",icon:this.faServer,title:"Node Information",cols:3,rows:1},{id:"balance",goTo:"On-Chain",link:"/ecl/onchain",icon:this.faChartPie,title:"Balances",cols:3,rows:1},{id:"capacity",goTo:"Channels",link:"/ecl/connections",icon:this.faNetworkWired,title:"Channels Capacity",cols:4,rows:2},{id:"fee",goTo:"Routing",link:"/ecl/routing",icon:this.faBolt,title:"Routing Fee",cols:3,rows:1},{id:"status",goTo:"Channels",link:"/ecl/connections",icon:this.faNetworkWired,title:"Channels",cols:3,rows:1}],this.merchantCards=[{id:"balance",goTo:"On-Chain",link:"/ecl/onchain",icon:this.faChartPie,title:"Balances",cols:2,rows:5},{id:"inboundLiq",goTo:"Channels",link:"/ecl/connections",icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:2,rows:10},{id:"outboundLiq",goTo:"Channels",link:"/ecl/connections",icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:2,rows:10},{id:"transactions",goTo:"Transactions",link:"/ecl/transactions",title:"",cols:2,rows:5}])}ngOnInit(){this.store.select("ecl").pipe(Object(u.a)(this.unSubs[1])).subscribe(t=>{this.flgLoading=[!0,!0,!0,!0,!0,!0,!0,!0],t.effectErrors.forEach(t=>{"FetchInfo"===t.action&&(this.flgLoading[0]="error"),"FetchFees"===t.action&&(this.flgLoading[1]="error"),"FetchChannels"===t.action&&(this.flgLoading[2]="error")}),this.selNode=t.nodeSettings,this.information=t.information,"error"!==this.flgLoading[0]&&(this.flgLoading[0]=!this.information.nodeId),this.fees=t.fees,"error"!==this.flgLoading[1]&&(this.flgLoading[1]=!this.fees.daily_fee),this.channels=t.activeChannels,this.onchainBalance=t.onchainBalance,this.balances.onchain=this.onchainBalance.total,this.balances.lightning=t.lightningBalance.localBalance,this.balances.total=this.balances.lightning+this.balances.onchain,this.balances=Object.assign({},this.balances);let e=t.lightningBalance.localBalance?+t.lightningBalance.localBalance:0,n=t.lightningBalance.remoteBalance?+t.lightningBalance.remoteBalance:0;this.channelBalances={localBalance:e,remoteBalance:n,balancedness:+(1-Math.abs((e-n)/(e+n))).toFixed(3)},this.channelsStatus=t.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(this.channels.filter(t=>t.toRemote>0),"toRemote"))),this.allOutboundChannels=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.channels.filter(t=>t.toLocal>0),"toLocal"))),this.channels.forEach(t=>{this.totalInboundLiquidity=this.totalInboundLiquidity+Math.ceil(t.toRemote),this.totalOutboundLiquidity=this.totalOutboundLiquidity+Math.floor(t.toLocal)}),"error"!==this.flgLoading[2]&&(this.flgLoading[2]=!this.channels),this.flgChildInfoUpdated=this.balances.lightning>=0&&this.balances.onchain>=0&&this.fees.monthly_fee>=0,this.logger.info(t)}),this.actions$.pipe(Object(u.a)(this.unSubs[2]),Object(h.a)(t=>t.type===g.n||t.type===g.X)).subscribe(t=>{t.type===g.n&&(this.flgChildInfoUpdated=!1),t.type===g.X&&(this.flgChildInfoUpdated=!0)})}onNavigateTo(t){this.router.navigateByUrl(t)}onsortChannelsBy(){"Balance Score"===this.sortField?(this.sortField="Capacity",this.allChannelsCapacity=this.channels.sort(function(t,e){const n=+t.toLocal+ +t.toRemote,a=+e.toLocal+ +e.toRemote;return n>a?-1:n<a?1:0})):(this.sortField="Balance Score",this.allChannelsCapacity=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.channels,"balancedness"))))}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(y.b),s.Pb(x.h),s.Pb(v.a),s.Pb(S.a),s.Pb(i.g))},t.\u0275cmp=s.Jb({type:t,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-0"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["cols","10",3,"rowHeight"],[3,"colspan","rowspan",4,"ngFor","ngForOf"],[3,"colspan","rowspan"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",1,"h-100","dashboard-card","mt-4"],["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"],["mat-menu-item","",3,"click",4,"ngIf"],["fxLayout","column",1,"dashboard-card-content",3,"fxFlex"],["fxLayout","column","fxFlex","100",3,"ngSwitch"],["fxFlex","100",3,"information","showColorFieldSeparately","ngClass",4,"ngSwitchCase"],["fxFlex","100",3,"balances","ngClass",4,"ngSwitchCase"],["fxFlex","100",3,"sortBy","channelBalances","allChannels","ngClass",4,"ngSwitchCase"],["fxFlex","100",3,"fees","ngClass",4,"ngSwitchCase"],["fxFlex","100",3,"channelsStatus","ngClass",4,"ngSwitchCase"],[4,"ngSwitchDefault"],["mat-icon-button","","aria-label","Toggle menu",1,"more-button",3,"matMenuTriggerFor"],["fxFlex","100",3,"information","showColorFieldSeparately","ngClass"],["fxFlex","100",3,"balances","ngClass"],["fxFlex","100",3,"sortBy","channelBalances","allChannels","ngClass"],["fxFlex","100",3,"fees","ngClass"],["fxFlex","100",3,"channelsStatus","ngClass"],["fxLayout","row","fxLayoutAlign","start end",1,"page-title-container","mb-0"],["cols","6",3,"rowHeight"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",1,"h-100","dashboard-card","mt-4",3,"ngClass"],[4,"ngIf"],["fxLayout","column","fxLayoutAlign","start stretch",1,"dashboard-card-content",3,"fxFlex"],["fxFlex","100",3,"information","ngClass",4,"ngSwitchCase"],["fxFlex","100",3,"direction","totalLiquidity","allChannels","ngClass",4,"ngSwitchCase"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between start",4,"ngSwitchCase"],["menuMerchant","matMenu"],["fxFlex","100",3,"information","ngClass"],["fxFlex","100",3,"direction","totalLiquidity","allChannels","ngClass"],["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",""],["mat-icon-button","","aria-label","Toggle menu",1,"more-button",2,"max-width","20px",3,"matMenuTriggerFor"],["menuTransactions","matMenu"]],template:function(t,e){if(1&t&&(s.Ic(0,xn,7,4,"div",0),s.Ic(1,Fn,6,4,"ng-template",null,1,s.Jc)),2&t){const t=s.wc(2);s.oc("ngIf",e.selNode.userPersona===e.userPersonaEnum.OPERATOR)("ngIfElse",t)}},directives:[a.o,c.c,c.b,w.a,D.a,a.n,D.c,C.a,c.a,C.c,C.f,V.a,V.b,C.b,a.q,a.r,a.s,U.a,V.d,I.a,O,a.m,L.a,T,H,Q,q,tt,et.b,et.a,Yt,cn,et.c],styles:[""]}),t})();const On=["form"];function Tn(t,e){1&t&&(s.Vb(0,"mat-error"),s.Kc(1,"Bitcoin address is required."),s.Ub())}function Rn(t,e){1&t&&(s.Vb(0,"mat-error"),s.Kc(1,"Amount is required."),s.Ub())}function Kn(t,e){if(1&t&&(s.Vb(0,"mat-option",29),s.Kc(1),s.Ub()),2&t){const t=e.$implicit;s.oc("value",t),s.Db(1),s.Lc(t)}}function Mn(t,e){1&t&&(s.Vb(0,"mat-error"),s.Kc(1,"Target Confirmation Blocks is required."),s.Ub())}function zn(t,e){if(1&t&&(s.Vb(0,"span"),s.Kc(1),s.Ub()),2&t){const t=s.hc(2);s.Db(1),s.Lc(t.sendFundError)}}function En(t,e){if(1&t&&(s.Vb(0,"div",30),s.Qb(1,"fa-icon",31),s.Ic(2,zn,2,1,"span",12),s.Ub()),2&t){const t=s.hc();s.Db(1),s.oc("icon",t.faExclamationTriangle),s.Db(1),s.oc("ngIf",""!==t.sendFundError)}}let Bn=(()=>{class t{constructor(t,e,n,a,i,o){this.dialogRef=t,this.logger=e,this.store=n,this.commonService=a,this.decimalPipe=i,this.actions$=o,this.faExclamationTriangle=f.o,this.selNode={},this.addressTypes=[],this.flgLoadingWallet=!0,this.selectedAddress=p.a[1],this.blockchainBalance={},this.information={},this.newAddress="",this.transaction={},this.sendFundError="",this.fiatConversion=!1,this.amountUnits=p.e,this.selAmountUnit=p.e[0],this.currConvertorRate={},this.unitConversionValue=0,this.currencyUnitFormats=p.f,this.unSubs=[new d.a,new d.a,new d.a,new d.a,new d.a]}ngOnInit(){this.store.select("root").pipe(Object(u.a)(this.unSubs[0])).subscribe(t=>{this.fiatConversion=t.selNode.settings.fiatConversion,this.amountUnits=t.selNode.settings.currencyUnits,this.appConfig=t.appConfig,this.nodeData=t.nodeData,this.logger.info(t)}),this.actions$.pipe(Object(u.a)(this.unSubs[1]),Object(h.a)(t=>t.type===g.j||t.type===g.Q)).subscribe(t=>{t.type===g.Q&&(this.store.dispatch(new st.F("Fund Sent Successfully!")),this.dialogRef.close()),t.type===g.j&&"SendOnchainFunds"===t.payload.action&&(this.sendFundError=t.payload.message)})}onSendFunds(){if(this.invalidValues)return!0;this.sendFundError="",this.store.dispatch(new st.G("Sending Funds...")),this.transaction.amount&&this.selAmountUnit!==p.g.SATS?this.commonService.convertCurrency(this.transaction.amount,this.selAmountUnit===this.amountUnits[2]?p.g.OTHER:this.selAmountUnit,this.amountUnits[2],this.fiatConversion).pipe(Object(u.a)(this.unSubs[2])).subscribe(t=>{this.transaction.amount=parseInt(t[p.g.SATS]),this.selAmountUnit=p.g.SATS,this.store.dispatch(new g.mb(this.transaction))}):this.store.dispatch(new g.mb(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(t){let e=this,n=t.value===this.amountUnits[2]?p.g.OTHER:t.value;this.transaction.amount&&this.selAmountUnit!==t.value&&this.commonService.convertCurrency(this.transaction.amount,this.selAmountUnit===this.amountUnits[2]?p.g.OTHER:this.selAmountUnit,this.amountUnits[2],this.fiatConversion).pipe(Object(u.a)(this.unSubs[3])).subscribe(t=>{e.transaction.amount=+e.decimalPipe.transform(t[n],e.currencyUnitFormats[n]).replace(/,/g,"")}),this.selAmountUnit=t.value}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(ot.f),s.Pb(y.b),s.Pb(x.h),s.Pb(S.a),s.Pb(a.f),s.Pb(v.a))},t.\u0275cmp=s.Jb({type:t,selectors:[["rtl-ecl-on-chain-send-modal"]],viewQuery:function(t,e){if(1&t&&s.Ec(On,!0),2&t){let t;s.vc(t=s.ec())&&(e.form=t.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-stroked-button","","color","primary","tabindex","7","type","reset",1,"mr-1"],["mat-flat-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(t,e){1&t&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Vb(2,"mat-card-header",2),s.Vb(3,"div",3),s.Vb(4,"span",4),s.Kc(5,"Send Payment"),s.Ub(),s.Ub(),s.Vb(6,"button",5),s.Kc(7,"X"),s.Ub(),s.Ub(),s.Vb(8,"mat-card-content",6),s.Vb(9,"form",7,8),s.dc("submit",function(){return e.onSendFunds()})("reset",function(){return e.resetData()}),s.Vb(11,"mat-form-field",9),s.Vb(12,"input",10,11),s.dc("ngModelChange",function(t){return e.transaction.address=t}),s.Ub(),s.Ic(14,Tn,2,0,"mat-error",12),s.Ub(),s.Vb(15,"mat-form-field",13),s.Vb(16,"input",14,15),s.dc("ngModelChange",function(t){return e.transaction.amount=t}),s.Ub(),s.Vb(18,"span",16),s.Kc(19),s.Ub(),s.Ic(20,Rn,2,0,"mat-error",12),s.Ub(),s.Vb(21,"mat-form-field",17),s.Vb(22,"mat-select",18),s.dc("selectionChange",function(t){return e.onAmountUnitChange(t)}),s.Ic(23,Kn,2,2,"mat-option",19),s.Ub(),s.Ub(),s.Vb(24,"div",20),s.Vb(25,"mat-form-field",21),s.Vb(26,"input",22,23),s.dc("ngModelChange",function(t){return e.transaction.blocks=t}),s.Ub(),s.Ic(28,Mn,2,0,"mat-error",12),s.Ub(),s.Ub(),s.Qb(29,"div",24),s.Ic(30,En,3,2,"div",25),s.Vb(31,"div",26),s.Vb(32,"button",27),s.Kc(33,"Clear Fields"),s.Ub(),s.Vb(34,"button",28),s.Kc(35,"Send Funds"),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&t&&(s.Db(6),s.oc("mat-dialog-close",!1),s.Db(6),s.oc("ngModel",e.transaction.address),s.Db(2),s.oc("ngIf",!e.transaction.address),s.Db(2),s.oc("ngModel",e.transaction.amount)("step",100)("min",0),s.Db(3),s.Mc(" ",e.selAmountUnit," "),s.Db(1),s.oc("ngIf",!e.transaction.amount),s.Db(2),s.oc("value",e.selAmountUnit),s.Db(1),s.oc("ngForOf",e.amountUnits),s.Db(3),s.oc("ngModel",e.transaction.blocks)("step",1)("min",0),s.Db(2),s.oc("ngIf",!e.transaction.blocks),s.Db(2),s.oc("ngIf",""!==e.sendFundError))},directives:[c.c,c.a,C.c,c.b,U.a,ot.d,C.b,ct.u,ct.n,ct.o,R.c,lt.b,ct.c,rt.a,ct.s,ct.m,ct.p,a.o,ct.q,bt.a,R.g,dt.a,a.n,R.b,ut.m,w.a],styles:[""]}),t})();var Nn=n("qmev");function Hn(t,e){1&t&&s.Qb(0,"mat-progress-bar",31)}function Qn(t,e){1&t&&(s.Vb(0,"th",32),s.Kc(1," Date/Time "),s.Ub())}function qn(t,e){if(1&t&&(s.Vb(0,"td",33),s.Kc(1),s.Ub()),2&t){const t=e.$implicit;s.Db(1),s.Lc(t.timestampStr)}}function jn(t,e){1&t&&(s.Vb(0,"th",34),s.Kc(1," Amount (Sats) "),s.Ub())}function _n(t,e){if(1&t&&(s.Vb(0,"span",37),s.Kc(1),s.ic(2,"number"),s.Ub()),2&t){const t=s.hc().$implicit;s.Db(1),s.Lc(s.jc(2,1,t.amount))}}function $n(t,e){if(1&t&&(s.Vb(0,"span",38),s.Kc(1),s.ic(2,"number"),s.Ub()),2&t){const t=s.hc().$implicit;s.Db(1),s.Mc("(",s.jc(2,1,-1*t.amount),")")}}function Jn(t,e){if(1&t&&(s.Vb(0,"td",33),s.Ic(1,_n,3,3,"span",35),s.Ic(2,$n,3,3,"span",36),s.Ub()),2&t){const t=e.$implicit;s.Db(1),s.oc("ngIf",t.amount>0||0===t.amount),s.Db(1),s.oc("ngIf",t.amount<0)}}function Gn(t,e){1&t&&(s.Vb(0,"th",34),s.Kc(1," Fees (Sats) "),s.Ub())}function Xn(t,e){if(1&t&&(s.Vb(0,"td",33),s.Vb(1,"span",37),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&t){const t=e.$implicit;s.Db(2),s.Lc(s.jc(3,1,t.fees))}}function Wn(t,e){1&t&&(s.Vb(0,"th",39),s.Kc(1," Confirmations "),s.Ub())}function Yn(t,e){if(1&t&&(s.Vb(0,"td",40),s.Vb(1,"span",37),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&t){const t=e.$implicit;s.Db(2),s.Mc(" ",s.jc(3,1,null==t?null:t.confirmations)," ")}}function Zn(t,e){1&t&&(s.Vb(0,"th",32),s.Kc(1," Address "),s.Ub())}function ta(t,e){if(1&t&&(s.Vb(0,"td",33),s.Kc(1),s.Ub()),2&t){const t=e.$implicit;s.Db(1),s.Lc(t.address)}}function ea(t,e){if(1&t){const t=s.Wb();s.Vb(0,"th",41),s.Vb(1,"div",42),s.Vb(2,"mat-select",43),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",44),s.dc("click",function(){return s.zc(t),s.hc().onDownloadCSV()}),s.Kc(5,"Download CSV"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}}function na(t,e){if(1&t){const t=s.Wb();s.Vb(0,"td",45),s.Vb(1,"button",46),s.dc("click",function(n){s.zc(t);const a=e.$implicit;return s.hc().onTransactionClick(a,n)}),s.Kc(2,"View Info"),s.Ub(),s.Ub()}}function aa(t,e){1&t&&(s.Vb(0,"p"),s.Kc(1,"No transactions available."),s.Ub())}function ia(t,e){if(1&t&&(s.Vb(0,"td",47),s.Ic(1,aa,2,0,"p",48),s.Ub()),2&t){const t=s.hc();s.Db(1),s.oc("ngIf",!(null!=t.listTransactions&&t.listTransactions.data)||(null==t.listTransactions||null==t.listTransactions.data?null:t.listTransactions.data.length)<1)}}const oa=function(t){return{"display-none":t}};function sa(t,e){if(1&t&&s.Qb(0,"tr",49),2&t){const t=s.hc();s.oc("ngClass",s.sc(1,oa,(null==t.listTransactions?null:t.listTransactions.data)&&(null==t.listTransactions||null==t.listTransactions.data?null:t.listTransactions.data.length)>0))}}function ca(t,e){1&t&&s.Qb(0,"tr",50)}function la(t,e){1&t&&s.Qb(0,"tr",51)}const ra=function(t){return{"overflow-auto error-border":t,"overflow-auto":!0}},ba=function(){return["no_transaction"]};let da=(()=>{class t{constructor(t,e,n,a){this.logger=t,this.commonService=e,this.store=n,this.actions$=a,this.faHistory=f.r,this.displayedColumns=[],this.flgLoading=[!0],this.flgSticky=!1,this.pageSize=p.p,this.pageSizeOptions=p.q,this.screenSize="",this.screenSizeEnum=p.s,this.unsub=[new d.a,new d.a,new d.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===p.s.XS?(this.flgSticky=!1,this.displayedColumns=["timestamp","amount","actions"]):this.screenSize===p.s.SM?(this.flgSticky=!1,this.displayedColumns=["timestamp","amount","confirmations","fees","actions"]):this.screenSize===p.s.MD?(this.flgSticky=!1,this.displayedColumns=["timestamp","amount","fees","confirmations","address","actions"]):(this.flgSticky=!0,this.displayedColumns=["timestamp","amount","fees","confirmations","address","actions"])}ngOnInit(){this.store.dispatch(new g.B),this.store.select("ecl").pipe(Object(u.a)(this.unsub[0])).subscribe(t=>{t.effectErrors.forEach(t=>{"FetchTransactions"===t.action&&(this.flgLoading[0]="error")}),t.transactions&&this.loadTransactionsTable(t.transactions),"error"!==this.flgLoading[0]&&(this.flgLoading[0]=!t.transactions),this.logger.info(t)})}applyFilter(t){this.listTransactions.filter=t.value.trim().toLowerCase()}onTransactionClick(t,e){this.store.dispatch(new st.D({data:{type:p.b.INFORMATION,alertTitle:"Transaction Information",message:[[{key:"blockHash",value:t.blockHash,title:"Block Hash",width:100}],[{key:"txid",value:t.txid,title:"Transaction ID",width:100}],[{key:"timestampStr",value:t.timestampStr,title:"Date/Time",width:50,type:p.h.DATE_TIME},{key:"confirmations",value:t.confirmations,title:"Number of Confirmations",width:50,type:p.h.NUMBER}],[{key:"fees",value:t.fees,title:"Fees (Sats)",width:50,type:p.h.NUMBER},{key:"amount",value:t.amount,title:"Amount (Sats)",width:50,type:p.h.NUMBER}],[{key:"address",value:t.address,title:"Address",width:100,type:p.h.STRING}]]}}))}loadTransactionsTable(t){this.listTransactions=new it.o([...t]),this.listTransactions.sort=this.sort,this.listTransactions.sortingDataAccessor=(t,e)=>t[e]&&isNaN(t[e])?t[e].toLocaleLowerCase():t[e]?+t[e]:null,this.listTransactions.filterPredicate=(t,e)=>JSON.stringify(t).toLowerCase().includes(e),this.listTransactions.paginator=this.paginator,this.logger.info(this.listTransactions)}onDownloadCSV(){this.listTransactions.data&&this.listTransactions.data.length>0&&this.commonService.downloadFile(this.listTransactions.data,"Transactions")}ngOnDestroy(){this.unsub.forEach(t=>{t.next(),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(y.b),s.Pb(S.a),s.Pb(x.h),s.Pb(v.a))},t.\u0275cmp=s.Jb({type:t,selectors:[["rtl-ecl-on-chain-transaction-history"]],viewQuery:function(t,e){if(1&t&&(s.Pc(at.a,!0),s.Pc(nt.a,!0)),2&t){let t;s.vc(t=s.ec())&&(e.sort=t.first),s.vc(t=s.ec())&&(e.paginator=t.first)}},features:[s.Cb([{provide:nt.b,useValue:Object(p.B)("Transactions")}])],decls:37,vars:14,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"],["matInput","","placeholder","Filter",3,"keyup"],["fxLayout","row","fxLayoutAlign","start start"],["fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","timestamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","amount"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","fees"],["matColumnDef","confirmations"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","class","pr-2",4,"matHeaderCellDef"],["mat-cell","","class","pr-2",4,"matCellDef"],["matColumnDef","address"],["matColumnDef","actions"],["mat-header-cell","","class","px-3",4,"matHeaderCellDef"],["mat-cell","","class","pl-3","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","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["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","","mat-sort-header","","arrowPosition","before",1,"pr-2"],["mat-cell","",1,"pr-2"],["mat-header-cell","",1,"px-3"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"pl-3"],["mat-stroked-button","","color","primary","type","button","tabindex","4",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(t,e){1&t&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Vb(2,"div",2),s.Qb(3,"fa-icon",3),s.Vb(4,"span",4),s.Kc(5,"Transaction History"),s.Ub(),s.Ub(),s.Vb(6,"mat-form-field",5),s.Vb(7,"input",6),s.dc("keyup",function(t){return e.applyFilter(t.target)}),s.Ub(),s.Ub(),s.Ub(),s.Vb(8,"div",7),s.Vb(9,"div",8),s.Ic(10,Hn,1,0,"mat-progress-bar",9),s.Vb(11,"table",10,11),s.Tb(13,12),s.Ic(14,Qn,2,0,"th",13),s.Ic(15,qn,2,1,"td",14),s.Sb(),s.Tb(16,15),s.Ic(17,jn,2,0,"th",16),s.Ic(18,Jn,3,2,"td",14),s.Sb(),s.Tb(19,17),s.Ic(20,Gn,2,0,"th",16),s.Ic(21,Xn,4,3,"td",14),s.Sb(),s.Tb(22,18),s.Ic(23,Wn,2,0,"th",19),s.Ic(24,Yn,4,3,"td",20),s.Sb(),s.Tb(25,21),s.Ic(26,Zn,2,0,"th",13),s.Ic(27,ta,2,1,"td",14),s.Sb(),s.Tb(28,22),s.Ic(29,ea,6,0,"th",23),s.Ic(30,na,3,0,"td",24),s.Sb(),s.Tb(31,25),s.Ic(32,ia,2,1,"td",26),s.Sb(),s.Ic(33,sa,1,3,"tr",27),s.Ic(34,ca,1,0,"tr",28),s.Ic(35,la,1,0,"tr",29),s.Ub(),s.Qb(36,"mat-paginator",30),s.Ub(),s.Ub(),s.Ub()),2&t&&(s.Db(3),s.oc("icon",e.faHistory),s.Db(7),s.oc("ngIf",!0===e.flgLoading[0]),s.Db(1),s.oc("dataSource",e.listTransactions)("ngClass",s.sc(11,ra,"error"===e.flgLoading[0])),s.Db(22),s.oc("matFooterRowDef",s.rc(13,ba)),s.Db(1),s.oc("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),s.Db(1),s.oc("matRowDefColumns",e.displayedColumns),s.Db(1),s.oc("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS))},directives:[c.c,c.b,c.a,w.a,R.c,lt.b,z.b,a.o,it.n,at.a,a.m,L.a,it.c,it.i,it.b,it.e,it.g,it.k,it.m,nt.a,l.a,it.h,at.b,it.a,dt.a,dt.c,ut.m,U.a,it.d,it.f,it.j,it.l],pipes:[a.f],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),t})();function ua(t,e){if(1&t){const t=s.Wb();s.Vb(0,"div",12),s.dc("click",function(){s.zc(t);const n=e.$implicit;return s.hc().activeLink=n.link}),s.Kc(1),s.Ub()}if(2&t){const t=e.$implicit,n=s.hc();s.pc("routerLink",t.link),s.oc("active",n.activeLink===t.link),s.Db(1),s.Lc(t.name)}}let ha=(()=>{class t{constructor(t,e){this.store=t,this.router=e,this.selNode={},this.faExchangeAlt=f.n,this.faChartPie=f.g,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 d.a,new d.a,new d.a,new d.a]}ngOnInit(){let t=this.links.find(t=>this.router.url.includes(t.link));this.activeLink=t?t.link:this.links[0].link,this.router.events.pipe(Object(u.a)(this.unSubs[0]),Object(h.a)(t=>t instanceof i.f)).subscribe(t=>{let e=this.links.find(e=>t.urlAfterRedirects.includes(e.link));this.activeLink=e?e.link:this.links[0].link}),this.store.select("ecl").pipe(Object(u.a)(this.unSubs[1])).subscribe(t=>{this.selNode=t.nodeSettings,this.balances=[{title:"Total Balance",dataValue:t.onchainBalance.total||0},{title:"Confirmed",dataValue:t.onchainBalance.confirmed},{title:"Unconfirmed",dataValue:t.onchainBalance.unconfirmed}]})}openSendFundsModal(){this.store.dispatch(new st.D({data:{component:Bn}}))}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(x.h),s.Pb(i.g))},t.\u0275cmp=s.Jb({type:t,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(t,e){1&t&&(s.Vb(0,"div",0),s.Qb(1,"fa-icon",1),s.Vb(2,"span",2),s.Kc(3,"On-chain Balance"),s.Ub(),s.Ub(),s.Vb(4,"div",3),s.Vb(5,"mat-card"),s.Vb(6,"mat-card-content",4),s.Qb(7,"rtl-currency-unit-converter",5),s.Ub(),s.Ub(),s.Ub(),s.Vb(8,"div",0),s.Qb(9,"fa-icon",1),s.Vb(10,"span",2),s.Kc(11,"On-chain Transactions"),s.Ub(),s.Ub(),s.Vb(12,"div",6),s.Vb(13,"mat-card"),s.Vb(14,"mat-card-content",4),s.Vb(15,"nav",7),s.Ic(16,ua,2,3,"div",8),s.Ub(),s.Vb(17,"div",9),s.Qb(18,"router-outlet"),s.Ub(),s.Vb(19,"div",10),s.Qb(20,"rtl-ecl-on-chain-transaction-history",11),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&t&&(s.Db(1),s.oc("icon",e.faChartPie),s.Db(6),s.oc("values",e.balances),s.Db(2),s.oc("icon",e.faExchangeAlt),s.Db(7),s.oc("ngForOf",e.links))},directives:[c.c,c.b,w.a,C.a,C.b,Nn.a,et.e,a.n,c.a,i.l,da,et.d,i.h],styles:[""]}),t})();var ma=n("8Qe2");function fa(t,e){if(1&t&&(s.Vb(0,"span",10),s.Kc(1,"Channels"),s.Ub()),2&t){const t=s.hc();s.pc("matBadge",t.activeChannels)}}function pa(t,e){if(1&t&&(s.Vb(0,"span",10),s.Kc(1,"Peers"),s.Ub()),2&t){const t=s.hc();s.pc("matBadge",t.activePeers)}}let ga=(()=>{class t{constructor(t,e){this.store=t,this.router=e,this.activePeers=0,this.activeChannels=0,this.faUsers=f.T,this.faChartPie=f.g,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 d.a,new d.a,new d.a,new d.a]}ngOnInit(){this.activeLink=this.links.findIndex(t=>t.link===this.router.url.substring(this.router.url.lastIndexOf("/")+1)),this.router.events.pipe(Object(u.a)(this.unSubs[0]),Object(h.a)(t=>t instanceof i.f)).subscribe(t=>{this.activeLink=this.links.findIndex(e=>e.link===t.urlAfterRedirects.substring(t.urlAfterRedirects.lastIndexOf("/")+1))}),this.store.select("ecl").pipe(Object(u.a)(this.unSubs[1])).subscribe(t=>{this.activePeers=t.peers&&t.peers.length?t.peers.length:0,this.activeChannels=t.channelsStatus&&t.channelsStatus.active&&t.channelsStatus.active.channels?t.channelsStatus.active.channels:0,this.balances=[{title:"Total Balance",dataValue:t.onchainBalance.total||0},{title:"Confirmed",dataValue:t.onchainBalance.confirmed},{title:"Unconfirmed",dataValue:t.onchainBalance.unconfirmed}]})}onSelectedTabChange(t){this.router.navigateByUrl("/ecl/connections/"+this.links[t.index].link)}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(x.h),s.Pb(i.g))},t.\u0275cmp=s.Jb({type:t,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(t,e){1&t&&(s.Vb(0,"div",0),s.Qb(1,"fa-icon",1),s.Vb(2,"span",2),s.Kc(3,"On-chain Balance"),s.Ub(),s.Ub(),s.Vb(4,"div",3),s.Vb(5,"mat-card"),s.Vb(6,"mat-card-content",4),s.Qb(7,"rtl-currency-unit-converter",5),s.Ub(),s.Ub(),s.Ub(),s.Vb(8,"div",0),s.Qb(9,"fa-icon",1),s.Vb(10,"span",2),s.Kc(11,"Connections"),s.Ub(),s.Ub(),s.Vb(12,"div",6),s.Vb(13,"mat-card"),s.Vb(14,"mat-card-content",4),s.Vb(15,"mat-tab-group",7),s.dc("selectedIndexChange",function(t){return e.activeLink=t})("selectedTabChange",function(t){return e.onSelectedTabChange(t)}),s.Vb(16,"mat-tab"),s.Ic(17,fa,2,1,"ng-template",8),s.Ub(),s.Vb(18,"mat-tab"),s.Ic(19,pa,2,1,"ng-template",8),s.Ub(),s.Ub(),s.Vb(20,"div",9),s.Qb(21,"router-outlet"),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&t&&(s.Db(1),s.oc("icon",e.faChartPie),s.Db(6),s.oc("values",e.balances),s.Db(2),s.oc("icon",e.faUsers),s.Db(6),s.oc("selectedIndex",e.activeLink))},directives:[c.c,c.b,w.a,C.a,C.b,Nn.a,et.b,et.a,et.c,c.a,i.l,ma.a],styles:[""]}),t})();function ya(t,e){if(1&t){const t=s.Wb();s.Vb(0,"div",11),s.dc("click",function(){s.zc(t);const n=e.$implicit;return s.hc().activeLink=n.link}),s.Kc(1),s.Ub()}if(2&t){const t=e.$implicit,n=s.hc();s.pc("routerLink",t.link),s.oc("active",n.activeLink===t.link),s.Db(1),s.Lc(t.name)}}let xa=(()=>{class t{constructor(t,e,n){this.logger=t,this.store=e,this.router=n,this.faExchangeAlt=f.n,this.faChartPie=f.g,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"},{link:"queryroutes",name:"Query Routes"}],this.activeLink=this.links[0].link,this.unSubs=[new d.a,new d.a,new d.a,new d.a]}ngOnInit(){let t=this.links.find(t=>this.router.url.includes(t.link));this.activeLink=t?t.link:this.links[0].link,this.router.events.pipe(Object(u.a)(this.unSubs[0]),Object(h.a)(t=>t instanceof i.f)).subscribe(t=>{let e=this.links.find(e=>t.urlAfterRedirects.includes(e.link));this.activeLink=e?e.link:this.links[0].link}),this.store.select("ecl").pipe(Object(u.a)(this.unSubs[1])).subscribe(t=>{this.currencyUnits=t.nodeSettings.currencyUnits,this.balances=t.nodeSettings.userPersona===p.z.OPERATOR?[{title:"Local Capacity",dataValue:t.lightningBalance.localBalance,tooltip:"Amount you can send"},{title:"Remote Capacity",dataValue:t.lightningBalance.remoteBalance,tooltip:"Amount you can receive"}]:[{title:"Outbound Capacity",dataValue:t.lightningBalance.localBalance,tooltip:"Amount you can send"},{title:"Inbound Capacity",dataValue:t.lightningBalance.remoteBalance,tooltip:"Amount you can receive"}],this.logger.info(t)})}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(y.b),s.Pb(x.h),s.Pb(i.g))},t.\u0275cmp=s.Jb({type:t,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(t,e){1&t&&(s.Vb(0,"div",0),s.Qb(1,"fa-icon",1),s.Vb(2,"span",2),s.Kc(3,"Lightning Balance"),s.Ub(),s.Ub(),s.Vb(4,"div",3),s.Vb(5,"mat-card"),s.Vb(6,"mat-card-content",4),s.Qb(7,"rtl-currency-unit-converter",5),s.Ub(),s.Ub(),s.Ub(),s.Vb(8,"div",6),s.Qb(9,"fa-icon",1),s.Vb(10,"span",2),s.Kc(11,"Lightning Transactions"),s.Ub(),s.Ub(),s.Vb(12,"div",7),s.Vb(13,"mat-card"),s.Vb(14,"mat-card-content",4),s.Vb(15,"nav",8),s.Ic(16,ya,2,3,"div",9),s.Ub(),s.Vb(17,"div",10),s.Qb(18,"router-outlet"),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&t&&(s.Db(1),s.oc("icon",e.faChartPie),s.Db(6),s.oc("values",e.balances),s.Db(2),s.oc("icon",e.faExchangeAlt),s.Db(7),s.oc("ngForOf",e.links))},directives:[c.c,c.b,w.a,C.a,C.b,Nn.a,et.e,a.n,c.a,i.l,et.d,i.h],styles:[""]}),t})();function va(t,e){if(1&t){const t=s.Wb();s.Vb(0,"div",11),s.dc("click",function(){s.zc(t);const n=e.$implicit;return s.hc().activeLink=n.link}),s.Kc(1),s.Ub()}if(2&t){const t=e.$implicit,n=s.hc();s.pc("routerLink",t.link),s.oc("active",n.activeLink===t.link),s.Db(1),s.Lc(t.name)}}let Sa=(()=>{class t{constructor(t){this.router=t,this.faMapSigns=f.y,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 d.a,new d.a,new d.a]}ngOnInit(){let t=this.links.find(t=>this.router.url.includes(t.link));this.activeLink=t?t.link:this.links[0].link,this.router.events.pipe(Object(u.a)(this.unSubs[0]),Object(h.a)(t=>t instanceof i.f)).subscribe(t=>{let e=this.links.find(e=>t.urlAfterRedirects.includes(e.link));this.activeLink=e?e.link:this.links[0].link})}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(i.g))},t.\u0275cmp=s.Jb({type:t,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(t,e){1&t&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Qb(2,"fa-icon",2),s.Vb(3,"span",3),s.Kc(4,"Routing"),s.Ub(),s.Ub(),s.Vb(5,"div",4),s.Vb(6,"mat-card",5),s.Vb(7,"mat-card-content",6),s.Vb(8,"div",7),s.Vb(9,"nav",8),s.Ic(10,va,2,3,"div",9),s.Ub(),s.Ub(),s.Vb(11,"div",10),s.Qb(12,"router-outlet"),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&t&&(s.Db(2),s.oc("icon",e.faMapSigns),s.Db(8),s.oc("ngForOf",e.links))},directives:[c.c,c.b,w.a,c.a,C.a,C.b,et.e,a.n,i.l,et.d,i.h],styles:[""]}),t})();var wa=n("zQhy"),Da=n("zHaW"),Ca=n("dEYt");function Va(t,e){1&t&&(s.Vb(0,"th",24),s.Kc(1,"Address"),s.Ub())}function Ua(t,e){if(1&t&&(s.Vb(0,"td",25),s.Kc(1),s.Ub()),2&t){const t=e.$implicit;s.Db(1),s.Mc(" ",t," ")}}function Ia(t,e){1&t&&(s.Vb(0,"th",26),s.Vb(1,"span",27),s.Kc(2,"Actions"),s.Ub(),s.Ub())}function La(t,e){if(1&t){const t=s.Wb();s.Vb(0,"td",28),s.Vb(1,"span",27),s.Vb(2,"button",29),s.dc("copied",function(e){return s.zc(t),s.hc(2).onCopyNodeURI(e)}),s.Kc(3,"Copy Node URI"),s.Ub(),s.Ub(),s.Ub()}if(2&t){const t=e.$implicit,n=s.hc(2);s.Db(2),s.oc("payload",n.lookupResult.nodeId+"@"+t)}}function Aa(t,e){1&t&&s.Qb(0,"tr",30)}function Pa(t,e){1&t&&s.Qb(0,"tr",31)}const Fa=function(t){return{"background-color":t}};function ka(t,e){if(1&t&&(s.Vb(0,"div",1),s.Qb(1,"mat-divider",2),s.Vb(2,"div",3),s.Vb(3,"div",4),s.Vb(4,"h4",5),s.Kc(5,"Pub Key"),s.Ub(),s.Vb(6,"span",6),s.Kc(7),s.Ub(),s.Ub(),s.Ub(),s.Qb(8,"mat-divider",7),s.Vb(9,"div",3),s.Vb(10,"div",4),s.Vb(11,"h4",5),s.Kc(12,"Signature"),s.Ub(),s.Vb(13,"span",8),s.Kc(14),s.Ub(),s.Ub(),s.Ub(),s.Qb(15,"mat-divider",7),s.Vb(16,"div",3),s.Vb(17,"div",9),s.Vb(18,"h4",5),s.Kc(19,"Alias"),s.Ub(),s.Vb(20,"span",8),s.Kc(21),s.Vb(22,"span",10),s.Kc(23),s.Ub(),s.Ub(),s.Ub(),s.Vb(24,"div",9),s.Vb(25,"h4",5),s.Kc(26,"Date/Time"),s.Ub(),s.Vb(27,"span",8),s.Kc(28),s.Ub(),s.Ub(),s.Ub(),s.Vb(29,"div",11),s.Vb(30,"h4",12),s.Kc(31,"Addresses"),s.Ub(),s.Vb(32,"div",13),s.Vb(33,"table",14,15),s.Tb(35,16),s.Ic(36,Va,2,0,"th",17),s.Ic(37,Ua,2,1,"td",18),s.Sb(),s.Tb(38,19),s.Ic(39,Ia,3,0,"th",20),s.Ic(40,La,4,1,"td",21),s.Sb(),s.Ic(41,Aa,1,0,"tr",22),s.Ic(42,Pa,1,0,"tr",23),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&t){const t=s.hc();s.Db(1),s.oc("inset",!0),s.Db(6),s.Lc(t.lookupResult.nodeId),s.Db(1),s.oc("inset",!0),s.Db(6),s.Lc(t.lookupResult.signature),s.Db(1),s.oc("inset",!0),s.Db(6),s.Lc(t.lookupResult.alias),s.Db(1),s.oc("ngStyle",s.sc(12,Fa,t.lookupResult.rgbColor)),s.Db(1),s.Lc(t.lookupResult.rgbColor?t.lookupResult.rgbColor:""),s.Db(5),s.Lc(t.lookupResult.timestampStr),s.Db(5),s.oc("dataSource",t.addresses),s.Db(8),s.oc("matHeaderRowDef",t.displayedColumns),s.Db(1),s.oc("matRowDefColumns",t.displayedColumns)}}let Oa=(()=>{class t{constructor(t,e){this.logger=t,this.snackBar=e,this.displayedColumns=["address","actions"]}ngOnInit(){this.addresses=new it.o(this.lookupResult.addresses?[...this.lookupResult.addresses]:[]),this.addresses.data=this.lookupResult.addresses?this.lookupResult.addresses:[],this.addresses.sort=this.sort,this.addresses.sortingDataAccessor=(t,e)=>t[e]&&isNaN(t[e])?t[e].toLocaleLowerCase():t[e]?+t[e]:null}onCopyNodeURI(t){this.snackBar.open("Node URI copied."),this.logger.info("Copied Text: "+t)}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(y.b),s.Pb(Da.b))},t.\u0275cmp=s.Jb({type:t,selectors:[["rtl-ecl-node-lookup"]],viewQuery:function(t,e){if(1&t&&s.Pc(at.a,!0),2&t){let t;s.vc(t=s.ec())&&(e.sort=t.first)}},inputs:{lookupResult:"lookupResult"},decls:1,vars:1,consts:[["fxLayout","column","class","mt-1",4,"ngIf"],["fxLayout","column",1,"mt-1"],[1,"mb-1",3,"inset"],["fxLayout","row"],["fxFlex","100"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text","w-100"],[1,"my-1",3,"inset"],[1,"foreground-secondary-text"],["fxFlex","50"],[1,"ml-2",3,"ngStyle"],["fxLayout","column",1,"mt-2"],["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","","class","pl-1",4,"matHeaderCellDef"],["mat-cell","","class","pl-1",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell","",1,"pl-1"],["fxLayoutAlign","end center"],["mat-cell","",1,"pl-1"],["mat-stroked-button","","color","primary","type","button","tabindex","1","rtlClipboard","",3,"payload","copied"],["mat-header-row",""],["mat-row",""]],template:function(t,e){1&t&&s.Ic(0,ka,43,14,"div",0),2&t&&s.oc("ngIf",e.lookupResult)},directives:[a.o,c.c,M.a,c.a,c.b,a.p,L.b,z.b,it.n,at.a,it.c,it.i,it.b,it.k,it.m,it.h,at.b,it.a,U.a,Ca.a,it.j,it.l],styles:[""]}),t})();const Ta=["form"];function Ra(t,e){if(1&t&&(s.Vb(0,"mat-error"),s.Kc(1),s.Ub()),2&t){const t=s.hc();s.Db(1),s.Mc("",null==t.lookupFields[t.selectedFieldId]?null:t.lookupFields[t.selectedFieldId].placeholder," is required.")}}function Ka(t,e){if(1&t&&(s.Vb(0,"mat-error"),s.Kc(1),s.Ub()),2&t){const t=s.hc();s.Db(1),s.Mc("Invalid ",null==t.lookupFields[t.selectedFieldId]?null:t.lookupFields[t.selectedFieldId].placeholder,".")}}function Ma(t,e){if(1&t&&(s.Vb(0,"div"),s.Qb(1,"rtl-ecl-node-lookup",29),s.Ub()),2&t){const t=s.hc(3);s.Db(1),s.oc("lookupResult",t.nodeLookupValue)}}function za(t,e){if(1&t&&(s.Vb(0,"span",27),s.Ic(1,Ma,2,1,"div",28),s.Ub()),2&t){const t=s.hc(2),e=s.wc(26);s.Db(1),s.oc("ngIf",t.nodeLookupValue.nodeId)("ngIfElse",e)}}function Ea(t,e){1&t&&(s.Vb(0,"span",27),s.Vb(1,"h3"),s.Kc(2,"Error! Unable to find details!"),s.Ub(),s.Ub())}function Ba(t,e){if(1&t&&(s.Vb(0,"div",21),s.Vb(1,"div",22),s.Vb(2,"span",23),s.Kc(3),s.Ub(),s.Ub(),s.Vb(4,"div",24),s.Ic(5,za,2,2,"span",25),s.Ic(6,Ea,3,0,"span",26),s.Ub(),s.Ub()),2&t){const t=s.hc();s.Db(3),s.Mc("",t.lookupFields[t.selectedFieldId].name," Details"),s.Db(1),s.oc("ngSwitch",t.selectedFieldId),s.Db(1),s.oc("ngSwitchCase",0)}}function Na(t,e){1&t&&(s.Vb(0,"h3"),s.Kc(1,"Error! Unable to find details!"),s.Ub())}const Ha=function(t){return{"mt-2":t}};let Qa=(()=>{class t{constructor(t,e,n,a){this.logger=t,this.commonService=e,this.store=n,this.actions$=a,this.lookupKeyCtrl=new ct.e,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=f.J,this.screenSize="",this.screenSizeEnum=p.s,this.unSubs=[new d.a,new d.a],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.actions$.pipe(Object(u.a)(this.unSubs[0]),Object(h.a)(t=>t.type===g.cb||t.type===g.j)).subscribe(t=>{if(t.type===g.cb){switch(this.flgLoading[0]=!0,this.selectedFieldId){case 0:this.nodeLookupValue=t.payload[0]?JSON.parse(JSON.stringify(t.payload[0])):{nodeid:""};break;case 1:this.channelLookupValue=t.payload?JSON.parse(JSON.stringify(t.payload)):[]}this.flgSetLookupValue=!0,this.logger.info(this.nodeLookupValue),this.logger.info(this.channelLookupValue)}t.type===g.j&&"Lookup"===t.payload.action&&(this.flgLoading[0]="error")}),this.lookupKeyCtrl.valueChanges.pipe(Object(u.a)(this.unSubs[1])).subscribe(t=>{this.nodeLookupValue={},this.channelLookupValue=[],this.flgSetLookupValue=!1})}onLookup(){if(!this.lookupKeyCtrl.value)return this.lookupKeyCtrl.setErrors({required:!0}),!0;if(this.lookupKeyCtrl.value&&(this.lookupKeyCtrl.value.includes("@")||this.lookupKeyCtrl.value.includes(",")))return this.lookupKeyCtrl.setErrors({invalid:!0}),!0;switch(this.selectedFieldId||(this.selectedFieldId=0),this.flgSetLookupValue=!1,this.nodeLookupValue={},this.channelLookupValue=[],this.store.dispatch(new st.G("Searching "+this.lookupFields[this.selectedFieldId].name+"...")),this.selectedFieldId){case 0:this.store.dispatch(new g.I(this.lookupKeyCtrl.value.trim()))}}onSelectChange(t){this.resetData(),this.selectedFieldId=t.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(t=>{t.next(),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(y.b),s.Pb(S.a),s.Pb(x.h),s.Pb(v.a))},t.\u0275cmp=s.Jb({type:t,selectors:[["rtl-ecl-lookups"]],viewQuery:function(t,e){if(1&t&&s.Ec(Ta,!0),2&t){let t;s.vc(t=s.ec())&&(e.form=t.first)}},decls:27,vars:10,consts:[["fxLayout","column"],["fxLayout","row","fxLayoutAlign","start end",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"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"card-content-gap","mt-1"],["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","20","fxFlex.gt-md","15","fxLayoutAlign","start end"],["color","primary","tabindex","1","name","lookupField"],["checked","",1,"mr-4",3,"value"],["fxFlex","80","fxFlex.gt-md","85","fxLayoutAlign","start end",3,"ngClass"],["matInput","","name","lookupKey","tabindex","2","required","",3,"formControl","placeholder"],["key",""],[4,"ngIf"],["fxLayout","row",1,"mt-2"],["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(t,e){1&t&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Qb(2,"fa-icon",2),s.Vb(3,"span",3),s.Kc(4,"Graph Lookups"),s.Ub(),s.Ub(),s.Vb(5,"div",4),s.Vb(6,"mat-card",5),s.Vb(7,"mat-card-content",6),s.Vb(8,"form",7,8),s.Vb(10,"div",9),s.Vb(11,"mat-radio-group",10),s.Vb(12,"mat-radio-button",11),s.Kc(13,"Node"),s.Ub(),s.Ub(),s.Ub(),s.Vb(14,"mat-form-field",12),s.Qb(15,"input",13,14),s.Ic(17,Ra,2,1,"mat-error",15),s.Ic(18,Ka,2,1,"mat-error",15),s.Ub(),s.Vb(19,"div",16),s.Vb(20,"button",17),s.dc("click",function(){return e.resetData()}),s.Kc(21,"Clear"),s.Ub(),s.Vb(22,"button",18),s.dc("click",function(){return e.onLookup()}),s.Kc(23,"Lookup"),s.Ub(),s.Ub(),s.Ub(),s.Ic(24,Ba,7,3,"div",19),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ic(25,Na,2,0,"ng-template",null,20,s.Jc)),2&t&&(s.Db(2),s.oc("icon",e.faSearch),s.Db(10),s.oc("value",0),s.Db(2),s.oc("ngClass",s.sc(8,Ha,e.screenSize===e.screenSizeEnum.XS||e.screenSize===e.screenSizeEnum.SM)),s.Db(1),s.oc("formControl",e.lookupKeyCtrl)("placeholder",(null==e.lookupFields[e.selectedFieldId]?null:e.lookupFields[e.selectedFieldId].placeholder)||"Lookup Key"),s.Db(2),s.oc("ngIf",null==e.lookupKeyCtrl.errors?null:e.lookupKeyCtrl.errors.required),s.Db(1),s.oc("ngIf",null==e.lookupKeyCtrl.errors?null:e.lookupKeyCtrl.errors.invalid),s.Db(6),s.oc("ngIf",e.flgSetLookupValue))},directives:[c.c,c.b,w.a,c.a,C.a,C.b,ct.u,ct.n,ct.o,wa.b,wa.a,R.c,a.m,L.a,lt.b,ct.c,ct.s,ct.m,ct.f,a.o,U.a,R.b,a.q,a.r,a.s,Oa],styles:[".tree-invisible[_ngcontent-%COMP%]{display:none}.lookup-tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%], .lookup-tree[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{margin-top:0;margin-bottom:0;list-style-type:none}.pl-3[_ngcontent-%COMP%]{padding-left:3rem}"]}),t})();var qa=n("Ysfc");let ja=(()=>{class t{constructor(t,e){this.store=t,this.eclEffects=e,this.newAddress=""}ngOnInit(){}onGenerateAddress(){this.store.dispatch(new st.G("Getting New Address...")),this.store.dispatch(new g.E),this.eclEffects.setNewAddress.pipe(Object(te.a)(1)).subscribe(t=>{this.newAddress=t,this.store.dispatch(new st.D({width:"58%",data:{address:this.newAddress,addressType:"",component:qa.a}}))})}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(x.h),s.Pb(ee.a))},t.\u0275cmp=s.Jb({type:t,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(t,e){1&t&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Vb(2,"button",2),s.dc("click",function(){return e.onGenerateAddress()}),s.Kc(3,"Generate Address"),s.Ub(),s.Ub(),s.Ub())},directives:[c.c,c.a,c.b,U.a],styles:[""]}),t})(),_a=(()=>{class t{constructor(t,e){this.store=t,this.activatedRoute=e,this.sweepAll=!1,this.unSubs=[new d.a,new d.a]}ngOnInit(){this.activatedRoute.data.pipe(Object(u.a)(this.unSubs[0])).subscribe(t=>this.sweepAll=t.sweepAll)}openSendFundsModal(){this.store.dispatch(new st.D({data:{sweepAll:this.sweepAll,component:Bn}}))}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(x.h),s.Pb(i.a))},t.\u0275cmp=s.Jb({type:t,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(t,e){1&t&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Vb(2,"button",2),s.dc("click",function(){return e.openSendFundsModal()}),s.Kc(3),s.Ub(),s.Ub(),s.Ub()),2&t&&(s.Db(3),s.Lc(e.sweepAll?"Sweep All":"Send Funds"))},directives:[c.c,c.a,c.b,U.a],styles:[""]}),t})();var $a=n("JX91"),Ja=n("lJxs"),Ga=n("hNFU"),Xa=n("jMqV"),Wa=n("vrAh");const Ya=["form"];function Za(t,e){if(1&t&&(s.Vb(0,"mat-option",34),s.Kc(1),s.Ub()),2&t){const t=e.$implicit;s.oc("value",t),s.Db(1),s.Lc(t.alias?t.alias:t.nodeId?t.nodeId:"")}}function ti(t,e){1&t&&(s.Vb(0,"mat-error"),s.Kc(1,"Peer alias is required."),s.Ub())}function ei(t,e){1&t&&(s.Vb(0,"mat-error"),s.Kc(1,"Peer not found in the list."),s.Ub())}function ni(t,e){if(1&t){const t=s.Wb();s.Vb(0,"mat-form-field",1),s.Vb(1,"input",30),s.dc("change",function(){return s.zc(t),s.hc().onSelectedPeerChanged()}),s.Ub(),s.Vb(2,"mat-autocomplete",31,32),s.dc("optionSelected",function(){return s.zc(t),s.hc().onSelectedPeerChanged()}),s.Ic(4,Za,2,2,"mat-option",33),s.ic(5,"async"),s.Ub(),s.Ic(6,ti,2,0,"mat-error",17),s.Ic(7,ei,2,0,"mat-error",17),s.Ub()}if(2&t){const t=s.wc(3),e=s.hc();s.Db(1),s.oc("formControl",e.selectedPeer)("matAutocomplete",t),s.Db(1),s.oc("displayWith",e.displayFn),s.Db(2),s.oc("ngForOf",s.jc(5,6,e.filteredPeers)),s.Db(2),s.oc("ngIf",null==e.selectedPeer.errors?null:e.selectedPeer.errors.required),s.Db(1),s.oc("ngIf",null==e.selectedPeer.errors?null:e.selectedPeer.errors.notfound)}}function ai(t,e){1&t&&s.Rb(0)}function ii(t,e){1&t&&(s.Vb(0,"mat-error"),s.Kc(1,"Amount is required."),s.Ub())}function oi(t,e){if(1&t&&(s.Vb(0,"mat-error"),s.Kc(1),s.Ub()),2&t){const t=s.hc();s.Db(1),s.Mc("Amount must be less than or equal to ",t.totalBalance,".")}}function si(t,e){if(1&t&&(s.Vb(0,"span"),s.Kc(1),s.Ub()),2&t){const t=s.hc(2);s.Db(1),s.Lc(t.channelConnectionError)}}function ci(t,e){if(1&t&&(s.Vb(0,"div",35),s.Qb(1,"fa-icon",36),s.Ic(2,si,2,1,"span",17),s.Ub()),2&t){const t=s.hc();s.Db(1),s.oc("icon",t.faExclamationTriangle),s.Db(1),s.oc("ngIf",""!==t.channelConnectionError)}}function li(t,e){if(1&t&&(s.Vb(0,"mat-expansion-panel",38),s.Vb(1,"mat-expansion-panel-header"),s.Vb(2,"mat-panel-title"),s.Vb(3,"span"),s.Kc(4,"Peer: \xa0"),s.Ub(),s.Vb(5,"strong",39),s.Kc(6),s.Ub(),s.Ub(),s.Ub(),s.Vb(7,"div",9),s.Vb(8,"div",0),s.Vb(9,"div",1),s.Vb(10,"h4",40),s.Kc(11,"Pubkey"),s.Ub(),s.Vb(12,"span",41),s.Kc(13),s.Ub(),s.Ub(),s.Ub(),s.Qb(14,"mat-divider",42),s.Vb(15,"div",0),s.Vb(16,"div",43),s.Vb(17,"h4",40),s.Kc(18,"Address"),s.Ub(),s.Vb(19,"span",44),s.Kc(20),s.Ub(),s.Ub(),s.Vb(21,"div",43),s.Vb(22,"h4",40),s.Kc(23,"State"),s.Ub(),s.Vb(24,"span",44),s.Kc(25),s.ic(26,"titlecase"),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&t){const t=s.hc(2);s.Db(6),s.Lc((null==t.peer?null:t.peer.alias)||(null==t.peer?null:t.peer.nodeId)),s.Db(7),s.Lc(t.peer.nodeId),s.Db(7),s.Lc(null==t.peer?null:t.peer.address),s.Db(5),s.Lc(s.jc(26,4,null==t.peer?null:t.peer.state))}}function ri(t,e){if(1&t&&s.Ic(0,li,27,6,"mat-expansion-panel",37),2&t){const t=s.hc();s.oc("ngIf",t.peer)}}let bi=(()=>{class t{constructor(t,e,n,a){this.dialogRef=t,this.data=e,this.store=n,this.actions$=a,this.selectedPeer=new ct.e,this.faExclamationTriangle=f.o,this.channelConnectionError="",this.advancedTitle="Advanced Options",this.totalBalance=0,this.selectedPubkey="",this.isPrivate=!1,this.feeRate=null,this.unSubs=[new d.a,new d.a]}ngOnInit(){this.information=this.data.message.information,this.totalBalance=this.data.message.balance,this.alertTitle=this.data.alertTitle,this.peer=this.data.message.peer?this.data.message.peer:null,this.peers=this.data.message.peers&&this.data.message.peers.length?this.data.message.peers:[],this.actions$.pipe(Object(u.a)(this.unSubs[0]),Object(h.a)(t=>t.type===g.j||t.type===g.l)).subscribe(t=>{t.type===g.j&&"SaveNewChannel"===t.payload.action&&(this.channelConnectionError=t.payload.message),t.type===g.l&&this.dialogRef.close()});let t="",e="";this.sortedPeers=this.peers.sort((n,a)=>(t=n.alias?n.alias.toLowerCase():n.nodeId?n.nodeId.toLowerCase():"",e=a.alias?a.alias.toLowerCase():n.nodeId.toLowerCase(),t<e?-1:t>e?1:0)),this.filteredPeers=this.selectedPeer.valueChanges.pipe(Object(u.a)(this.unSubs[1]),Object($a.a)(""),Object(Ja.a)(t=>"string"==typeof t?t:t.alias?t.alias:t.nodeId),Object(Ja.a)(t=>t?this.filterPeers(t):this.sortedPeers.slice()))}filterPeers(t){return this.sortedPeers.filter(e=>0===e.alias.toLowerCase().indexOf(t?t.toLowerCase():""))}displayFn(t){return t&&t.alias?t.alias:t&&t.nodeId?t.nodeId:""}onSelectedPeerChanged(){if(this.channelConnectionError="",this.selectedPubkey=this.selectedPeer.value&&this.selectedPeer.value.nodeId?this.selectedPeer.value.nodeId:void 0,"string"==typeof this.selectedPeer.value){let t=this.peers.filter(t=>t.alias.length===this.selectedPeer.value.length&&0===t.alias.toLowerCase().indexOf(this.selectedPeer.value?this.selectedPeer.value.toLowerCase():""));1===t.length&&t[0].nodeId&&(this.selectedPubkey=t[0].nodeId)}this.selectedPeer.setErrors(this.selectedPeer.value&&!this.selectedPubkey?{notfound:!0}:null)}onClose(){this.dialogRef.close(!1)}resetData(){this.feeRate=null,this.selectedPeer.setValue(""),this.fundingAmount=null,this.isPrivate=!1,this.channelConnectionError="",this.advancedTitle="Advanced Options",this.form.resetForm()}onAdvancedPanelToggle(t){this.advancedTitle=t&&this.feeRate&&this.feeRate>0?"Advanced Options | Fee (Sats/Byte): "+this.feeRate:"Advanced Options"}onOpenChannel(){if(!this.peer&&!this.selectedPubkey||!this.fundingAmount||this.totalBalance-this.fundingAmount<0)return!0;this.store.dispatch(new st.G("Opening Channel...")),this.store.dispatch(new g.kb({nodeId:this.peer&&this.peer.nodeId?this.peer.nodeId:this.selectedPubkey,amount:this.fundingAmount,private:this.isPrivate,feeRate:this.feeRate}))}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(ot.f),s.Pb(ot.a),s.Pb(x.h),s.Pb(v.a))},t.\u0275cmp=s.Jb({type:t,selectors:[["rtl-ecl-open-channel"]],viewQuery:function(t,e){if(1&t&&s.Ec(Ya,!0),2&t){let t;s.vc(t=s.ec())&&(e.form=t.first)}},decls:48,vars:19,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,"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","48","fxLayout","row","fxLayoutAlign","start center"],["matInput","","placeholder","Fee (Sats/Byte)","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-stroked-button","","color","primary","tabindex","7","type","reset",1,"mr-1"],["autoFocus","","mat-flat-button","","color","primary","type","submit","tabindex","9"],["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(t,e){if(1&t&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Vb(2,"mat-card-header",2),s.Vb(3,"div",3),s.Vb(4,"span",4),s.Kc(5),s.Ub(),s.Ub(),s.Vb(6,"button",5),s.dc("click",function(){return e.onClose()}),s.Kc(7,"X"),s.Ub(),s.Ub(),s.Vb(8,"mat-card-content",6),s.Vb(9,"form",7,8),s.dc("submit",function(){return e.onOpenChannel()})("reset",function(){return e.resetData()}),s.Vb(11,"div",9),s.Ic(12,ni,8,8,"mat-form-field",10),s.Ub(),s.Ic(13,ai,1,0,"ng-container",11),s.Vb(14,"div",9),s.Vb(15,"div",12),s.Vb(16,"mat-form-field",13),s.Vb(17,"input",14,15),s.dc("ngModelChange",function(t){return e.fundingAmount=t}),s.Ub(),s.Vb(19,"mat-hint"),s.Kc(20),s.ic(21,"number"),s.Ub(),s.Vb(22,"span",16),s.Kc(23),s.Ub(),s.Ic(24,ii,2,0,"mat-error",17),s.Ic(25,oi,2,1,"mat-error",17),s.Ub(),s.Vb(26,"div",18),s.Vb(27,"mat-slide-toggle",19),s.dc("ngModelChange",function(t){return e.isPrivate=t}),s.Kc(28,"Private Channel"),s.Ub(),s.Ub(),s.Ub(),s.Vb(29,"mat-expansion-panel",20),s.dc("closed",function(){return e.onAdvancedPanelToggle(!0)})("opened",function(){return e.onAdvancedPanelToggle(!1)}),s.Vb(30,"mat-expansion-panel-header"),s.Vb(31,"mat-panel-title"),s.Vb(32,"span"),s.Kc(33),s.Ub(),s.Ub(),s.Ub(),s.Vb(34,"div",21),s.Vb(35,"div",12),s.Vb(36,"div",22),s.Vb(37,"mat-form-field",1),s.Vb(38,"input",23,24),s.dc("ngModelChange",function(t){return e.feeRate=t}),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ic(40,ci,3,2,"div",25),s.Vb(41,"div",26),s.Vb(42,"button",27),s.Kc(43,"Clear Fields"),s.Ub(),s.Vb(44,"button",28),s.Kc(45,"Open Channel"),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ic(46,ri,1,1,"ng-template",null,29,s.Jc)),2&t){const t=s.wc(18),n=s.wc(47);s.Db(5),s.Lc(e.alertTitle),s.Db(7),s.oc("ngIf",!e.peer&&e.peers&&e.peers.length>0),s.Db(1),s.oc("ngTemplateOutlet",n),s.Db(4),s.oc("ngModel",e.fundingAmount)("step",1e3)("min",1)("max",e.totalBalance),s.Db(3),s.Mc("Remaining Bal: ",s.jc(21,17,e.totalBalance-(e.fundingAmount?e.fundingAmount:0)),""),s.Db(3),s.Mc(" ",null==e.information?null:e.information.smaller_currency_unit," "),s.Db(1),s.oc("ngIf",null==t.errors?null:t.errors.required),s.Db(1),s.oc("ngIf",null==t.errors?null:t.errors.max),s.Db(2),s.oc("ngModel",e.isPrivate),s.Db(6),s.Lc(e.advancedTitle),s.Db(5),s.oc("ngModel",e.feeRate)("step",1)("min",0),s.Db(2),s.oc("ngIf",""!==e.channelConnectionError)}},directives:[c.c,c.a,C.c,c.b,U.a,C.b,ct.u,ct.n,ct.o,a.o,a.t,R.c,lt.b,ct.q,ct.c,bt.a,Ga.a,ct.s,ct.m,ct.p,R.f,R.g,Xa.a,ue.c,ue.e,ue.f,rt.a,Wa.c,ct.f,Wa.a,a.n,ut.m,R.b,w.a,M.a],pipes:[a.f,a.b,a.x],styles:[".open-inputs-box[_ngcontent-%COMP%]{padding:1.2rem 2.4rem .8rem!important}"]}),t})();function di(t,e){if(1&t&&(s.Vb(0,"span",7),s.Kc(1,"Open"),s.Ub()),2&t){const t=s.hc();s.pc("matBadge",t.numOfOpenChannels)}}function ui(t,e){if(1&t&&(s.Vb(0,"span",7),s.Kc(1,"Pending"),s.Ub()),2&t){const t=s.hc();s.pc("matBadge",t.numOfPendingChannels)}}function hi(t,e){if(1&t&&(s.Vb(0,"span",7),s.Kc(1,"Inactive"),s.Ub()),2&t){const t=s.hc();s.pc("matBadge",t.numOfInactiveChannels)}}let mi=(()=>{class t{constructor(t,e,n){this.logger=t,this.store=e,this.router=n,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 d.a,new d.a]}ngOnInit(){this.activeLink=this.links.findIndex(t=>t.link===this.router.url.substring(this.router.url.lastIndexOf("/")+1)),this.router.events.pipe(Object(u.a)(this.unSubs[0]),Object(h.a)(t=>t instanceof i.f)).subscribe(t=>{this.activeLink=this.links.findIndex(e=>e.link===t.urlAfterRedirects.substring(t.urlAfterRedirects.lastIndexOf("/")+1))}),this.store.select("ecl").pipe(Object(u.a)(this.unSubs[1])).subscribe(t=>{this.numOfOpenChannels=t.channelsStatus&&t.channelsStatus.active&&t.channelsStatus.active.channels?t.channelsStatus.active.channels:0,this.numOfPendingChannels=t.channelsStatus&&t.channelsStatus.pending&&t.channelsStatus.pending.channels?t.channelsStatus.pending.channels:0,this.numOfInactiveChannels=t.channelsStatus&&t.channelsStatus.inactive&&t.channelsStatus.inactive.channels?t.channelsStatus.inactive.channels:0,this.selNode=t.nodeSettings,this.information=t.information,this.peers=t.peers,this.totalBalance=t.onchainBalance.total,console.warn(this.numOfPendingChannels),console.warn(t.channelsStatus.pending),this.logger.info(t)})}onOpenChannel(){this.store.dispatch(new st.D({data:{alertTitle:"Open Channel",message:{peers:this.peers,information:this.information,balance:this.totalBalance},component:bi}}))}onSelectedTabChange(t){this.router.navigateByUrl("/ecl/connections/channels/"+this.links[t.index].link)}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(y.b),s.Pb(x.h),s.Pb(i.g))},t.\u0275cmp=s.Jb({type:t,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(t,e){1&t&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Vb(2,"button",2),s.dc("click",function(){return e.onOpenChannel()}),s.Kc(3,"Open Channel"),s.Ub(),s.Ub(),s.Vb(4,"div",3),s.Vb(5,"mat-tab-group",4),s.dc("selectedIndexChange",function(t){return e.activeLink=t})("selectedTabChange",function(t){return e.onSelectedTabChange(t)}),s.Vb(6,"mat-tab"),s.Ic(7,di,2,1,"ng-template",5),s.Ub(),s.Vb(8,"mat-tab"),s.Ic(9,ui,2,1,"ng-template",5),s.Ub(),s.Vb(10,"mat-tab"),s.Ic(11,hi,2,1,"ng-template",5),s.Ub(),s.Ub(),s.Vb(12,"div",6),s.Qb(13,"router-outlet"),s.Ub(),s.Ub(),s.Ub()),2&t&&(s.Db(5),s.oc("selectedIndex",e.activeLink))},directives:[c.c,c.a,c.b,U.a,et.b,et.a,et.c,i.l,ma.a],styles:[""]}),t})();function fi(t,e){if(1&t&&(s.Vb(0,"div",11),s.Vb(1,"h4",12),s.Kc(2,"Short Channel ID"),s.Ub(),s.Vb(3,"span",13),s.Kc(4),s.Ub(),s.Ub()),2&t){const t=s.hc();s.Db(4),s.Lc(t.channel.shortChannelId)}}function pi(t,e){if(1&t&&(s.Vb(0,"div",11),s.Vb(1,"h4",12),s.Kc(2,"State"),s.Ub(),s.Vb(3,"span",15),s.Kc(4),s.ic(5,"titlecase"),s.Ub(),s.Ub()),2&t){const t=s.hc();s.Db(4),s.Lc(s.jc(5,1,t.channel.state))}}function gi(t,e){if(1&t&&(s.Vb(0,"div"),s.Vb(1,"div",9),s.Vb(2,"div",11),s.Vb(3,"h4",12),s.Kc(4,"Base Fee (mSats)"),s.Ub(),s.Vb(5,"span",15),s.Kc(6),s.ic(7,"number"),s.Ub(),s.Ub(),s.Vb(8,"div",11),s.Vb(9,"h4",12),s.Kc(10,"Fee Rate (mSats)"),s.Ub(),s.Vb(11,"span",15),s.Kc(12),s.Ub(),s.Ub(),s.Ub(),s.Qb(13,"mat-divider",14),s.Ub()),2&t){const t=s.hc();s.Db(6),s.Lc(s.jc(7,3,t.channel.feeBaseMsat)),s.Db(6),s.Lc(t.channel.feeProportionalMillionths),s.Db(1),s.oc("inset",!0)}}function yi(t,e){1&t&&(s.Vb(0,"p"),s.Kc(1,"Show Advanced"),s.Ub())}function xi(t,e){1&t&&(s.Vb(0,"p"),s.Kc(1,"Hide Advanced"),s.Ub())}function vi(t,e){if(1&t){const t=s.Wb();s.Vb(0,"button",21),s.dc("click",function(){return s.zc(t),s.hc().onShowAdvanced()}),s.Ic(1,yi,2,0,"p",22),s.Ic(2,xi,2,0,"ng-template",null,23,s.Jc),s.Ub()}if(2&t){const t=s.wc(3),e=s.hc();s.Db(1),s.oc("ngIf",!e.showAdvanced)("ngIfElse",t)}}function Si(t,e){if(1&t){const t=s.Wb();s.Vb(0,"button",24),s.dc("copied",function(e){return s.zc(t),s.hc().onCopyChanID(e)}),s.Kc(1,"Copy Short Channel ID"),s.Ub()}if(2&t){const t=s.hc();s.oc("payload",t.channel.shortChannelId)}}function wi(t,e){if(1&t){const t=s.Wb();s.Vb(0,"button",25),s.dc("copied",function(e){return s.zc(t),s.hc().onCopyChanID(e)}),s.Kc(1,"Copy Channel ID"),s.Ub()}if(2&t){const t=s.hc();s.oc("payload",t.channel.channelId)}}const Di=function(t){return{"xs-scroll-y":t}},Ci=function(t,e){return{"mt-2":t,"mt-1":e}};let Vi=(()=>{class t{constructor(t,e,n,a,i){this.dialogRef=t,this.data=e,this.logger=n,this.commonService=a,this.snackBar=i,this.faReceipt=f.H,this.showAdvanced=!1,this.channelsType="open",this.screenSize="",this.screenSizeEnum=p.s}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(t){this.snackBar.open("open"===this.channelsType?"Short channel ID "+t+" copied.":"Channel ID copied."),this.logger.info("Copied Text: "+t)}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(ot.f),s.Pb(ot.a),s.Pb(y.b),s.Pb(S.a),s.Pb(Da.b))},t.\u0275cmp=s.Jb({type:t,selectors:[["rtl-ecl-channel-information"]],decls:65,vars:30,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-stroked-button","","color","primary","type","reset","tabindex","1","class","mr-1",3,"click",4,"ngIf"],["autoFocus","","mat-flat-button","","color","primary","tabindex","2","type","submit","rtlClipboard","",3,"payload","copied",4,"ngIf"],["autoFocus","","mat-flat-button","","color","primary","tabindex","3","type","submit","rtlClipboard","",3,"payload","copied",4,"ngIf"],["mat-stroked-button","","color","primary","type","reset","tabindex","1",1,"mr-1",3,"click"],[4,"ngIf","ngIfElse"],["hideAdvancedText",""],["autoFocus","","mat-flat-button","","color","primary","tabindex","2","type","submit","rtlClipboard","",3,"payload","copied"],["autoFocus","","mat-flat-button","","color","primary","tabindex","3","type","submit","rtlClipboard","",3,"payload","copied"]],template:function(t,e){1&t&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Vb(2,"mat-card-header",2),s.Vb(3,"div",3),s.Qb(4,"fa-icon",4),s.Vb(5,"span",5),s.Kc(6,"Channel Information"),s.Ub(),s.Ub(),s.Vb(7,"button",6),s.dc("click",function(){return e.onClose()}),s.Kc(8,"X"),s.Ub(),s.Ub(),s.Vb(9,"mat-card-content",7),s.Vb(10,"div",8),s.Vb(11,"div",9),s.Ic(12,fi,5,1,"div",10),s.Vb(13,"div",11),s.Vb(14,"h4",12),s.Kc(15,"Peer Alias"),s.Ub(),s.Vb(16,"span",13),s.Kc(17),s.Ub(),s.Ub(),s.Ic(18,pi,6,3,"div",10),s.Ub(),s.Qb(19,"mat-divider",14),s.Vb(20,"div",9),s.Vb(21,"div",1),s.Vb(22,"h4",12),s.Kc(23,"Channel ID"),s.Ub(),s.Vb(24,"span",13),s.Kc(25),s.Ub(),s.Ub(),s.Ub(),s.Qb(26,"mat-divider",14),s.Vb(27,"div",9),s.Vb(28,"div",1),s.Vb(29,"h4",12),s.Kc(30,"Peer Public Key"),s.Ub(),s.Vb(31,"span",13),s.Kc(32),s.Ub(),s.Ub(),s.Ub(),s.Qb(33,"mat-divider",14),s.Vb(34,"div",9),s.Vb(35,"div",11),s.Vb(36,"h4",12),s.Kc(37,"Local Balance (Sats)"),s.Ub(),s.Vb(38,"span",15),s.Kc(39),s.ic(40,"number"),s.Ub(),s.Ub(),s.Vb(41,"div",11),s.Vb(42,"h4",12),s.Kc(43,"Remote Balance (Sats)"),s.Ub(),s.Vb(44,"span",15),s.Kc(45),s.ic(46,"number"),s.Ub(),s.Ub(),s.Ub(),s.Qb(47,"mat-divider",14),s.Vb(48,"div",9),s.Vb(49,"div",11),s.Vb(50,"h4",12),s.Kc(51,"Private"),s.Ub(),s.Vb(52,"span",15),s.Kc(53),s.Ub(),s.Ub(),s.Vb(54,"div",11),s.Vb(55,"h4",12),s.Kc(56,"Funder"),s.Ub(),s.Vb(57,"span",15),s.Kc(58),s.Ub(),s.Ub(),s.Ub(),s.Qb(59,"mat-divider",14),s.Ic(60,gi,14,5,"div",16),s.Vb(61,"div",17),s.Ic(62,vi,4,2,"button",18),s.Ic(63,Si,2,1,"button",19),s.Ic(64,wi,2,1,"button",20),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&t&&(s.Db(4),s.oc("icon",e.faReceipt),s.Db(5),s.oc("ngClass",s.sc(25,Di,e.screenSize===e.screenSizeEnum.XS)),s.Db(3),s.oc("ngIf","open"===e.channelsType),s.Db(5),s.Lc(e.channel.alias),s.Db(1),s.oc("ngIf","open"!==e.channelsType),s.Db(1),s.oc("inset",!0),s.Db(6),s.Lc(e.channel.channelId),s.Db(1),s.oc("inset",!0),s.Db(6),s.Lc(e.channel.nodeId),s.Db(1),s.oc("inset",!0),s.Db(6),s.Lc(s.jc(40,21,e.channel.toLocal)),s.Db(6),s.Lc(s.jc(46,23,e.channel.toRemote)),s.Db(2),s.oc("inset",!0),s.Db(6),s.Lc(0===e.channel.channelFlags?"Yes":"No"),s.Db(5),s.Lc(e.channel.isFunder?"Yes":"No"),s.Db(1),s.oc("inset",!0),s.Db(1),s.oc("ngIf",e.showAdvanced&&"open"===e.channelsType),s.Db(1),s.oc("ngClass",s.tc(27,Ci,!e.showAdvanced,e.showAdvanced)),s.Db(1),s.oc("ngIf","open"===e.channelsType),s.Db(1),s.oc("ngIf","open"===e.channelsType),s.Db(1),s.oc("ngIf","open"!==e.channelsType))},directives:[c.c,c.b,c.a,C.c,w.a,U.a,C.b,a.m,L.a,a.o,M.a,rt.a,Ca.a],pipes:[a.f,a.x],styles:[""]}),t})();function Ui(t,e){1&t&&s.Qb(0,"mat-progress-bar",28)}function Ii(t,e){1&t&&(s.Vb(0,"th",29),s.Kc(1," Short Channel ID "),s.Ub())}function Li(t,e){if(1&t&&(s.Vb(0,"span",35),s.Qb(1,"fa-icon",36),s.Ub()),2&t){const t=s.hc(2);s.Db(1),s.oc("icon",t.faEyeSlash)}}function Ai(t,e){if(1&t&&(s.Vb(0,"span",37),s.Qb(1,"fa-icon",36),s.Ub()),2&t){const t=s.hc(2);s.Db(1),s.oc("icon",t.faEye)}}const Pi=function(t){return{"max-width":t}};function Fi(t,e){if(1&t&&(s.Vb(0,"td",30),s.Vb(1,"div",31),s.Ic(2,Li,2,1,"span",32),s.Ic(3,Ai,2,1,"span",33),s.Vb(4,"span",34),s.Kc(5),s.Ub(),s.Ub(),s.Ub()),2&t){const t=e.$implicit,n=s.hc();s.Db(1),s.oc("ngStyle",s.sc(4,Pi,n.screenSize===n.screenSizeEnum.XS?"12rem":"22rem")),s.Db(1),s.oc("ngIf",0===t.channelFlags),s.Db(1),s.oc("ngIf",0!==t.channelFlags),s.Db(2),s.Lc(null==t?null:t.shortChannelId)}}function ki(t,e){1&t&&(s.Vb(0,"th",29),s.Kc(1," Alias "),s.Ub())}function Oi(t,e){if(1&t&&(s.Vb(0,"td",30),s.Vb(1,"div",31),s.Vb(2,"span",34),s.Kc(3),s.Ub(),s.Ub(),s.Ub()),2&t){const t=e.$implicit,n=s.hc();s.Db(1),s.oc("ngStyle",s.sc(2,Pi,n.screenSize===n.screenSizeEnum.XS?"12rem":"22rem")),s.Db(2),s.Lc(t.alias)}}function Ti(t,e){1&t&&(s.Vb(0,"th",38),s.Kc(1," Local Balance (Sats) "),s.Ub())}function Ri(t,e){if(1&t&&(s.Vb(0,"td",30),s.Vb(1,"span",39),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&t){const t=e.$implicit;s.Db(2),s.Mc(" ",s.kc(3,1,null==t?null:t.toLocal,"1.0-0")," ")}}function Ki(t,e){1&t&&(s.Vb(0,"th",38),s.Kc(1," Remote Balance (Sats) "),s.Ub())}function Mi(t,e){if(1&t&&(s.Vb(0,"td",30),s.Vb(1,"span",39),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&t){const t=e.$implicit;s.Db(2),s.Mc(" ",s.kc(3,1,null==t?null:t.toRemote,"1.0-0")," ")}}function zi(t,e){1&t&&(s.Vb(0,"th",40),s.Kc(1,"Balance Score "),s.Ub())}function Ei(t,e){if(1&t&&(s.Vb(0,"td",41),s.Vb(1,"div",42),s.Vb(2,"mat-hint",43),s.Kc(3),s.ic(4,"number"),s.Ub(),s.Ub(),s.Qb(5,"mat-progress-bar",44),s.Ub()),2&t){const t=e.$implicit;s.Db(3),s.Lc(s.jc(4,2,(null==t?null:t.balancedness)||0)),s.Db(2),s.pc("value",t.toLocal&&t.toLocal>0?+t.toLocal/(+t.toLocal+ +t.toRemote)*100:0)}}function Bi(t,e){if(1&t){const t=s.Wb();s.Vb(0,"th",45),s.Vb(1,"div",46),s.Vb(2,"mat-select",47),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",48),s.dc("click",function(){return s.zc(t),s.hc().onChannelUpdate("all")}),s.Kc(5,"Update Fee Policy"),s.Ub(),s.Vb(6,"mat-option",48),s.dc("click",function(){return s.zc(t),s.hc().onDownloadCSV()}),s.Kc(7,"Download CSV"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}}function Ni(t,e){if(1&t){const t=s.Wb();s.Vb(0,"td",49),s.Vb(1,"div",50),s.Vb(2,"mat-select",51),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",48),s.dc("click",function(n){s.zc(t);const a=e.$implicit;return s.hc().onChannelClick(a,n)}),s.Kc(5,"View Info"),s.Ub(),s.Vb(6,"mat-option",48),s.dc("click",function(){s.zc(t);const n=e.$implicit;return s.hc().onChannelUpdate(n)}),s.Kc(7,"Update Fee Policy"),s.Ub(),s.Vb(8,"mat-option",48),s.dc("click",function(){s.zc(t);const n=e.$implicit;return s.hc().onChannelClose(n,!1)}),s.Kc(9,"Close Channel"),s.Ub(),s.Vb(10,"mat-option",48),s.dc("click",function(){s.zc(t);const n=e.$implicit;return s.hc().onChannelClose(n,!0)}),s.Kc(11,"Force Close"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}}function Hi(t,e){1&t&&(s.Vb(0,"p"),s.Kc(1,"No peers connected. Add a peer in order to open a channel."),s.Ub())}function Qi(t,e){1&t&&(s.Vb(0,"p"),s.Kc(1,"No open channels available."),s.Ub())}function qi(t,e){if(1&t&&(s.Vb(0,"td",52),s.Ic(1,Hi,2,0,"p",53),s.Ic(2,Qi,2,0,"p",53),s.Ub()),2&t){const t=s.hc();s.Db(1),s.oc("ngIf",t.numPeers<1&&(!(null!=t.channels&&t.channels.data)||(null==t.channels||null==t.channels.data?null:t.channels.data.length)<1)),s.Db(1),s.oc("ngIf",t.numPeers>0&&(!(null!=t.channels&&t.channels.data)||(null==t.channels||null==t.channels.data?null:t.channels.data.length)<1))}}const ji=function(t){return{"display-none":t}};function _i(t,e){if(1&t&&s.Qb(0,"tr",54),2&t){const t=s.hc();s.oc("ngClass",s.sc(1,ji,t.numPeers>0&&(null==t.channels?null:t.channels.data)&&(null==t.channels||null==t.channels.data?null:t.channels.data.length)>0))}}function $i(t,e){1&t&&s.Qb(0,"tr",55)}function Ji(t,e){1&t&&s.Qb(0,"tr",56)}const Gi=function(t){return{"overflow-auto error-border":t,"overflow-auto":!0}},Xi=function(){return["no_peer"]};let Wi=(()=>{class t{constructor(t,e,n,a,i){this.logger=t,this.store=e,this.rtlEffects=n,this.eclEffects=a,this.commonService=i,this.faEye=f.p,this.faEyeSlash=f.q,this.totalBalance=0,this.displayedColumns=[],this.myChanPolicy={},this.information={},this.numPeers=-1,this.feeRateTypes=p.j,this.flgLoading=[!0],this.selFilter="",this.flgSticky=!1,this.pageSize=p.p,this.pageSizeOptions=p.q,this.screenSize="",this.screenSizeEnum=p.s,this.unSubs=[new d.a,new d.a,new d.a,new d.a,new d.a,new d.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===p.s.XS?(this.flgSticky=!1,this.displayedColumns=["alias","toLocal","toRemote","actions"]):this.screenSize===p.s.SM||this.screenSize===p.s.MD?(this.flgSticky=!1,this.displayedColumns=["shortChannelId","alias","toLocal","toRemote","actions"]):(this.flgSticky=!0,this.displayedColumns=["shortChannelId","alias","toLocal","toRemote","balancedness","actions"])}ngOnInit(){this.store.select("ecl").pipe(Object(u.a)(this.unSubs[0])).subscribe(t=>{t.effectErrors.forEach(t=>{"FetchChannels"===t.action&&(this.flgLoading[0]="error")}),this.information=t.information,this.numPeers=t.peers&&t.peers.length?t.peers.length:0,this.totalBalance=t.onchainBalance.total,this.activeChannels=t.activeChannels,this.activeChannels.length>0&&this.sort&&this.paginator&&this.loadChannelsTable(),"error"!==this.flgLoading[0]&&(this.flgLoading[0]=!t.activeChannels),this.logger.info(t)})}ngAfterViewInit(){this.activeChannels.length>0&&this.sort&&this.paginator&&this.loadChannelsTable()}onChannelUpdate(t){"all"!==t&&"NORMAL"!==t.state||(this.store.dispatch(new st.E({data:{type:p.b.CONFIRM,alertTitle:"Update Fee Policy",noBtnText:"Cancel",yesBtnText:"Update",message:[],titleMessage:"all"===t?"Update fee policy for selected/all channels":"Update fee policy for Channel: "+t.channelId,flgShowInput:!0,getInputs:[{placeholder:"Base Fee (mSats)",inputType:"number",inputValue:t&&t.feeBaseMsat?t.feeBaseMsat:1e3,width:48},{placeholder:"Fee Rate (mili mSats)",inputType:"number",inputValue:t&&t.feeProportionalMillionths?t.feeProportionalMillionths:100,min:1,width:48}]}})),this.rtlEffects.closeConfirm.pipe(Object(u.a)(this.unSubs[1])).subscribe(e=>{if(e){const n=e[0].inputValue,a=e[1].inputValue;let i=null,o="";"all"===t?(this.activeChannels.forEach(t=>{o=o+","+t.channelId}),o=o.substring(1),i={baseFeeMsat:n,feeRate:a,channelIds:o}):i={baseFeeMsat:n,feeRate:a,channelId:t.channelId},this.store.dispatch(new st.G("Updating Channel Policy...")),this.store.dispatch(new g.xb(i))}}),this.applyFilter())}onChannelClose(t,e){this.store.dispatch(new st.E({data:{type:p.b.CONFIRM,alertTitle:e?"Force Close Channel":"Close Channel",titleMessage:e?"Force closing channel: "+t.channelId:"Closing channel: "+t.channelId,noBtnText:"Cancel",yesBtnText:e?"Force Close":"Close Channel"}})),this.rtlEffects.closeConfirm.pipe(Object(u.a)(this.unSubs[3])).subscribe(n=>{n&&(this.store.dispatch(new st.G(e?"Force Closing Channel...":"Closing Channel...")),this.store.dispatch(new g.f({channelId:t.channelId,force:e})))})}applyFilter(){this.channels.filter=this.selFilter.trim().toLowerCase()}onChannelClick(t,e){this.store.dispatch(new st.D({data:{channel:t,channelsType:"open",component:Vi}}))}loadChannelsTable(){this.activeChannels.sort(function(t,e){return t.alias===e.alias?0:e.alias?1:-1}),this.channels=new it.o([...this.activeChannels]),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(t,e)=>t[e]&&isNaN(t[e])?t[e].toLocaleLowerCase():t[e]?+t[e]:null,this.channels.filterPredicate=(t,e)=>JSON.stringify(t).toLowerCase().includes(e),this.channels.paginator=this.paginator,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(t=>{t.next(),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(y.b),s.Pb(x.h),s.Pb(vt.a),s.Pb(ee.a),s.Pb(S.a))},t.\u0275cmp=s.Jb({type:t,selectors:[["rtl-ecl-channel-open-table"]],viewQuery:function(t,e){if(1&t&&(s.Pc(at.a,!0),s.Pc(nt.a,!0)),2&t){let t;s.vc(t=s.ec())&&(e.sort=t.first),s.vc(t=s.ec())&&(e.paginator=t.first)}},features:[s.Cb([{provide:nt.b,useValue:Object(p.B)("Channels")}])],decls:33,vars:14,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"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","keyup","ngModelChange"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"table-container","w-100",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","shortChannelId"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","alias"],["matColumnDef","toLocal"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","toRemote"],["matColumnDef","balancedness"],["mat-header-cell","","mat-sort-header","","class","pl-3",4,"matHeaderCellDef"],["mat-cell","","class","pl-3",4,"matCellDef"],["matColumnDef","actions"],["mat-header-cell","","class","pl-1",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center","class","pl-1",4,"matCellDef"],["matColumnDef","no_peer"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"ellipsis-parent",3,"ngStyle"],["class","mr-1","matTooltip","Private","matTooltipPosition","right",4,"ngIf"],["class","mr-1","matTooltip","Public","matTooltipPosition","right",4,"ngIf"],[1,"ellipsis-child"],["matTooltip","Private","matTooltipPosition","right",1,"mr-1"],[3,"icon"],["matTooltip","Public","matTooltipPosition","right",1,"mr-1"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell","","mat-sort-header","",1,"pl-3"],["mat-cell","",1,"pl-3"],["fxLayout","row"],["fxFlex","100","fxLayoutAlign","center center",1,"font-size-80"],["mode","determinate",3,"value"],["mat-header-cell","",1,"pl-1"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"pl-1"],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["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(t,e){1&t&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Qb(2,"div",2),s.Vb(3,"mat-form-field",3),s.Vb(4,"input",4),s.dc("keyup",function(){return e.applyFilter()})("ngModelChange",function(t){return e.selFilter=t}),s.Ub(),s.Ub(),s.Ub(),s.Vb(5,"div",5),s.Ic(6,Ui,1,0,"mat-progress-bar",6),s.Vb(7,"table",7,8),s.Tb(9,9),s.Ic(10,Ii,2,0,"th",10),s.Ic(11,Fi,6,6,"td",11),s.Sb(),s.Tb(12,12),s.Ic(13,ki,2,0,"th",10),s.Ic(14,Oi,4,4,"td",11),s.Sb(),s.Tb(15,13),s.Ic(16,Ti,2,0,"th",14),s.Ic(17,Ri,4,4,"td",11),s.Sb(),s.Tb(18,15),s.Ic(19,Ki,2,0,"th",14),s.Ic(20,Mi,4,4,"td",11),s.Sb(),s.Tb(21,16),s.Ic(22,zi,2,0,"th",17),s.Ic(23,Ei,6,4,"td",18),s.Sb(),s.Tb(24,19),s.Ic(25,Bi,8,0,"th",20),s.Ic(26,Ni,12,0,"td",21),s.Sb(),s.Tb(27,22),s.Ic(28,qi,3,2,"td",23),s.Sb(),s.Ic(29,_i,1,3,"tr",24),s.Ic(30,$i,1,0,"tr",25),s.Ic(31,Ji,1,0,"tr",26),s.Ub(),s.Ub(),s.Qb(32,"mat-paginator",27),s.Ub()),2&t&&(s.Db(4),s.oc("ngModel",e.selFilter),s.Db(2),s.oc("ngIf",!0===e.flgLoading[0]),s.Db(1),s.oc("dataSource",e.channels)("ngClass",s.sc(11,Gi,"error"===e.flgLoading[0])),s.Db(22),s.oc("matFooterRowDef",s.rc(13,Xi)),s.Db(1),s.oc("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),s.Db(1),s.oc("matRowDefColumns",e.displayedColumns),s.Db(1),s.oc("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS))},directives:[c.c,c.b,c.a,R.c,lt.b,ct.c,ct.m,ct.p,z.b,a.o,it.n,at.a,a.m,L.a,it.c,it.i,it.b,it.e,it.g,it.k,it.m,nt.a,l.a,it.h,at.b,it.a,a.p,L.b,K.a,w.a,R.f,dt.a,dt.c,ut.m,it.d,it.f,it.j,it.l],pipes:[a.f],styles:[".mat-column-shortChannelId[_ngcontent-%COMP%]{flex:0 0 15%;width:15%}.mat-column-shortChannelId[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%]{display:flex}.mat-column-alias[_ngcontent-%COMP%]{flex:0 0 20%;width:20%}.mat-column-alias[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%]{display:flex}.mat-column-balancedness[_ngcontent-%COMP%]{padding-left:3rem;flex:0 0 22%;width:22%}.mat-column-state[_ngcontent-%COMP%], .mat-column-toLocal[_ngcontent-%COMP%], .mat-column-toRemote[_ngcontent-%COMP%]{flex:1 1 15%;width:15%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media only screen and (max-width:37.5em){.mat-column-state[_ngcontent-%COMP%], .mat-column-toLocal[_ngcontent-%COMP%], .mat-column-toRemote[_ngcontent-%COMP%]{white-space:unset}}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}.mat-column-actions[_ngcontent-%COMP%] .bordered-box.table-actions-select[_ngcontent-%COMP%]{flex:0 0 100%}@media only screen and (max-width:37.5em){.mat-column-actions[_ngcontent-%COMP%] .bordered-box.table-actions-select[_ngcontent-%COMP%]{flex:0 0 80%}}"]}),t})();function Yi(t,e){1&t&&s.Qb(0,"mat-progress-bar",25)}function Zi(t,e){1&t&&(s.Vb(0,"th",26),s.Kc(1," State "),s.Ub())}function to(t,e){if(1&t&&(s.Vb(0,"td",27),s.Kc(1),s.ic(2,"titlecase"),s.Ub()),2&t){const t=e.$implicit;s.Db(1),s.Mc(" ",s.jc(2,1,null==t?null:t.state),"")}}function eo(t,e){1&t&&(s.Vb(0,"th",26),s.Kc(1," Alias "),s.Ub())}function no(t,e){if(1&t&&(s.Vb(0,"td",27),s.Kc(1),s.Ub()),2&t){const t=e.$implicit;s.Db(1),s.Lc(null==t?null:t.alias)}}function ao(t,e){1&t&&(s.Vb(0,"th",28),s.Kc(1," Local Balance (Sats) "),s.Ub())}function io(t,e){if(1&t&&(s.Vb(0,"td",27),s.Vb(1,"span",29),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&t){const t=e.$implicit;s.Db(2),s.Mc(" ",s.kc(3,1,null==t?null:t.toLocal,"1.0-0")," ")}}function oo(t,e){1&t&&(s.Vb(0,"th",28),s.Kc(1," Remote Balance (Sats) "),s.Ub())}function so(t,e){if(1&t&&(s.Vb(0,"td",27),s.Vb(1,"span",29),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&t){const t=e.$implicit;s.Db(2),s.Mc(" ",s.kc(3,1,null==t?null:t.toRemote,"1.0-0")," ")}}function co(t,e){if(1&t){const t=s.Wb();s.Vb(0,"th",30),s.Vb(1,"div",31),s.Vb(2,"mat-select",32),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",33),s.dc("click",function(){return s.zc(t),s.hc().onDownloadCSV()}),s.Kc(5,"Download CSV"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}}function lo(t,e){if(1&t){const t=s.Wb();s.Vb(0,"td",34),s.Vb(1,"button",35),s.dc("click",function(n){s.zc(t);const a=e.$implicit;return s.hc().onChannelClick(a,n)}),s.Kc(2,"View Info"),s.Ub(),s.Ub()}}function ro(t,e){1&t&&(s.Vb(0,"p"),s.Kc(1,"No pending channels available."),s.Ub())}function bo(t,e){if(1&t&&(s.Vb(0,"td",36),s.Ic(1,ro,2,0,"p",37),s.Ub()),2&t){const t=s.hc();s.Db(1),s.oc("ngIf",!(null!=t.channels&&t.channels.data)||(null==t.channels||null==t.channels.data?null:t.channels.data.length)<1)}}const uo=function(t){return{"display-none":t}};function ho(t,e){if(1&t&&s.Qb(0,"tr",38),2&t){const t=s.hc();s.oc("ngClass",s.sc(1,uo,(null==t.channels?null:t.channels.data)&&(null==t.channels||null==t.channels.data?null:t.channels.data.length)>0))}}function mo(t,e){1&t&&s.Qb(0,"tr",39)}function fo(t,e){1&t&&s.Qb(0,"tr",40)}const po=function(t){return{"overflow-auto error-border":t,"overflow-auto":!0}},go=function(){return["no_channel"]};let yo=(()=>{class t{constructor(t,e,n,a,i){this.logger=t,this.store=e,this.rtlEffects=n,this.eclEffects=a,this.commonService=i,this.totalBalance=0,this.displayedColumns=[],this.myChanPolicy={},this.information={},this.numPeers=-1,this.feeRateTypes=p.j,this.flgLoading=[!0],this.selFilter="",this.flgSticky=!1,this.pageSize=p.p,this.pageSizeOptions=p.q,this.screenSize="",this.screenSizeEnum=p.s,this.unSubs=[new d.a,new d.a,new d.a,new d.a,new d.a,new d.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===p.s.XS?(this.flgSticky=!1,this.displayedColumns=["state","alias","actions"]):this.screenSize===p.s.SM||this.screenSize===p.s.MD?(this.flgSticky=!1,this.displayedColumns=["state","alias","toLocal","toRemote","actions"]):(this.flgSticky=!0,this.displayedColumns=["state","alias","toLocal","toRemote","actions"])}ngOnInit(){this.store.select("ecl").pipe(Object(u.a)(this.unSubs[0])).subscribe(t=>{t.effectErrors.forEach(t=>{"FetchChannels"===t.action&&(this.flgLoading[0]="error")}),this.information=t.information,this.numPeers=t.peers&&t.peers.length?t.peers.length:0,this.totalBalance=t.onchainBalance.total,this.pendingChannels=t.pendingChannels,this.loadChannelsTable(),"error"!==this.flgLoading[0]&&(this.flgLoading[0]=!t.pendingChannels),this.logger.info(t)})}ngAfterViewInit(){this.pendingChannels.length>0&&this.loadChannelsTable()}applyFilter(){this.channels.filter=this.selFilter.trim().toLowerCase()}onChannelClick(t,e){this.store.dispatch(new st.D({data:{channel:t,channelsType:"pending",component:Vi}}))}loadChannelsTable(){this.pendingChannels.sort(function(t,e){return t.alias===e.alias?0:e.alias?1:-1}),this.channels=new it.o([...this.pendingChannels]),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(t,e)=>t[e]&&isNaN(t[e])?t[e].toLocaleLowerCase():t[e]?+t[e]:null,this.channels.filterPredicate=(t,e)=>JSON.stringify(t).toLowerCase().includes(e),this.channels.paginator=this.paginator,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(t=>{t.next(),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(y.b),s.Pb(x.h),s.Pb(vt.a),s.Pb(ee.a),s.Pb(S.a))},t.\u0275cmp=s.Jb({type:t,selectors:[["rtl-ecl-channel-pending-table"]],viewQuery:function(t,e){if(1&t&&(s.Pc(at.a,!0),s.Pc(nt.a,!0)),2&t){let t;s.vc(t=s.ec())&&(e.sort=t.first),s.vc(t=s.ec())&&(e.paginator=t.first)}},features:[s.Cb([{provide:nt.b,useValue:Object(p.B)("Channels")}])],decls:30,vars:14,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"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","keyup","ngModelChange"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"table-container","w-100",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","state"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","alias"],["matColumnDef","toLocal"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","toRemote"],["matColumnDef","actions"],["mat-header-cell","","class","pl-1",4,"matHeaderCellDef"],["mat-cell","","class","pl-1","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","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell","",1,"pl-1"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"pl-1"],["mat-stroked-button","","color","primary","type","button","tabindex","4",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(t,e){1&t&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Qb(2,"div",2),s.Vb(3,"mat-form-field",3),s.Vb(4,"input",4),s.dc("keyup",function(){return e.applyFilter()})("ngModelChange",function(t){return e.selFilter=t}),s.Ub(),s.Ub(),s.Ub(),s.Vb(5,"div",5),s.Ic(6,Yi,1,0,"mat-progress-bar",6),s.Vb(7,"table",7,8),s.Tb(9,9),s.Ic(10,Zi,2,0,"th",10),s.Ic(11,to,3,3,"td",11),s.Sb(),s.Tb(12,12),s.Ic(13,eo,2,0,"th",10),s.Ic(14,no,2,1,"td",11),s.Sb(),s.Tb(15,13),s.Ic(16,ao,2,0,"th",14),s.Ic(17,io,4,4,"td",11),s.Sb(),s.Tb(18,15),s.Ic(19,oo,2,0,"th",14),s.Ic(20,so,4,4,"td",11),s.Sb(),s.Tb(21,16),s.Ic(22,co,6,0,"th",17),s.Ic(23,lo,3,0,"td",18),s.Sb(),s.Tb(24,19),s.Ic(25,bo,2,1,"td",20),s.Sb(),s.Ic(26,ho,1,3,"tr",21),s.Ic(27,mo,1,0,"tr",22),s.Ic(28,fo,1,0,"tr",23),s.Ub(),s.Ub(),s.Qb(29,"mat-paginator",24),s.Ub()),2&t&&(s.Db(4),s.oc("ngModel",e.selFilter),s.Db(2),s.oc("ngIf",!0===e.flgLoading[0]),s.Db(1),s.oc("dataSource",e.channels)("ngClass",s.sc(11,po,"error"===e.flgLoading[0])),s.Db(19),s.oc("matFooterRowDef",s.rc(13,go)),s.Db(1),s.oc("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),s.Db(1),s.oc("matRowDefColumns",e.displayedColumns),s.Db(1),s.oc("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS))},directives:[c.c,c.b,c.a,R.c,lt.b,ct.c,ct.m,ct.p,z.b,a.o,it.n,at.a,a.m,L.a,it.c,it.i,it.b,it.e,it.g,it.k,it.m,nt.a,l.a,it.h,at.b,it.a,dt.a,dt.c,ut.m,U.a,it.d,it.f,it.j,it.l],pipes:[a.x,a.f],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),t})();var xo=n("hzfI");const vo=["peersForm"],So=["stepper"];function wo(t,e){if(1&t&&s.Kc(0),2&t){const t=s.hc();s.Lc(t.peerFormLabel)}}function Do(t,e){1&t&&(s.Vb(0,"mat-error"),s.Kc(1,"Address is required."),s.Ub())}function Co(t,e){if(1&t&&(s.Vb(0,"div",33),s.Qb(1,"fa-icon",34),s.Vb(2,"span"),s.Kc(3),s.Ub(),s.Ub()),2&t){const t=s.hc();s.Db(1),s.oc("icon",t.faExclamationTriangle),s.Db(2),s.Lc(t.peerConnectionError)}}function Vo(t,e){if(1&t&&s.Kc(0),2&t){const t=s.hc();s.Lc(t.channelFormLabel)}}function Uo(t,e){1&t&&(s.Vb(0,"mat-error"),s.Kc(1,"Amount is required."),s.Ub())}function Io(t,e){1&t&&(s.Vb(0,"mat-error"),s.Kc(1,"Amount must be a positive number."),s.Ub())}function Lo(t,e){if(1&t&&(s.Vb(0,"mat-error"),s.Kc(1),s.Ub()),2&t){const t=s.hc();s.Db(1),s.Mc("Amount must be less than or equal to ",t.totalBalance,".")}}function Ao(t,e){if(1&t&&(s.Vb(0,"div",33),s.Qb(1,"fa-icon",34),s.Vb(2,"span"),s.Kc(3),s.Ub(),s.Ub()),2&t){const t=s.hc();s.Db(1),s.oc("icon",t.faExclamationTriangle),s.Db(2),s.Lc(t.channelConnectionError)}}let Po=(()=>{class t{constructor(t,e,n,a,i,o,s){this.dialogRef=t,this.data=e,this.store=n,this.eclEffects=a,this.formBuilder=i,this.actions$=o,this.logger=s,this.faExclamationTriangle=f.o,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 d.a,new d.a]}ngOnInit(){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.peerFormGroup=this.formBuilder.group({hiddenAddress:["",[ct.t.required]],peerAddress:[this.peerAddress,[ct.t.required]]}),this.channelFormGroup=this.formBuilder.group({fundingAmount:["",[ct.t.required,ct.t.min(1),ct.t.max(this.totalBalance)]],isPrivate:[!1],feeRate:[null],hiddenAmount:["",[ct.t.required]]}),this.statusFormGroup=this.formBuilder.group({}),this.actions$.pipe(Object(u.a)(this.unSubs[1]),Object(h.a)(t=>t.type===g.G||t.type===g.l||t.type===g.j)).subscribe(t=>{t.type===g.G&&(this.logger.info(t.payload),this.flgEditable=!1,this.newlyAddedPeer=t.payload.peer,this.peerFormGroup.controls.hiddenAddress.setValue(this.peerFormGroup.controls.peerAddress.value),this.stepper.next()),t.type===g.l&&this.dialogRef.close(),t.type===g.j&&("SaveNewPeer"===t.payload.action?this.peerConnectionError=t.payload.message:"SaveNewChannel"===t.payload.action&&(this.channelConnectionError=t.payload.message))})}onConnectPeer(){if(!this.peerFormGroup.controls.peerAddress.value)return!0;this.peerConnectionError="",this.store.dispatch(new st.G("Adding Peer...")),this.store.dispatch(new g.lb({id:this.peerFormGroup.controls.peerAddress.value}))}onOpenChannel(){if(!this.channelFormGroup.controls.fundingAmount.value||this.totalBalance-this.channelFormGroup.controls.fundingAmount.value<0)return!0;this.channelConnectionError="",this.store.dispatch(new st.G("Opening Channel...")),this.store.dispatch(new g.kb({nodeId:this.newlyAddedPeer.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(t){switch(t.selectedIndex){case 0:this.peerFormLabel="Peer Details",this.channelFormLabel="Open Channel (Optional)";break;case 1:this.peerFormLabel=this.peerFormGroup.controls.peerAddress.value?"Peer Added: "+(this.newlyAddedPeer.alias?this.newlyAddedPeer.alias:this.newlyAddedPeer.nodeId):"Peer Details",this.channelFormLabel="Open Channel (Optional)";break;case 2:this.peerFormLabel=this.peerFormGroup.controls.peerAddress.value?"Peer Added: "+(this.newlyAddedPeer.alias?this.newlyAddedPeer.alias:this.newlyAddedPeer.nodeId):"Peer Details",this.channelFormLabel=this.channelFormGroup.controls.fundingAmount.value?"Opening Channel for "+this.channelFormGroup.controls.fundingAmount.value+" Sats":"Open Channel (Optional)";break;default:this.peerFormLabel="Peer Details",this.channelFormLabel="Open Channel (Optional)"}t.selectedIndex<t.previouslySelectedIndex&&(0===t.selectedIndex?this.peerFormGroup.controls.hiddenAddress.setValue(""):1===t.selectedIndex&&this.channelFormGroup.controls.hiddenAmount.setValue(""))}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(ot.f),s.Pb(ot.a),s.Pb(x.h),s.Pb(ee.a),s.Pb(ct.d),s.Pb(v.a),s.Pb(y.b))},t.\u0275cmp=s.Jb({type:t,selectors:[["rtl-ecl-connect-peer"]],viewQuery:function(t,e){if(1&t&&(s.Pc(vo,!0),s.Pc(So,!0)),2&t){let t;s.vc(t=s.ec())&&(e.form=t.first),s.vc(t=s.ec())&&(e.stepper=t.first)}},decls:50,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-stroked-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","60","fxLayoutAlign","start end"],["matInput","","autoFocus","","formControlName","fundingAmount","placeholder","Amount","type","number","tabindex","1","required","",3,"step"],["matSuffix",""],["fxFlex","35","fxLayoutAlign","start center"],["tabindex","2","color","primary","formControlName","isPrivate","name","isPrivate"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between center",1,"mt-1"],["fxFlex","48","fxLayout","row","fxLayoutAlign","start center"],["matInput","","formControlName","feeRate","placeholder","Fee (Sats/Byte)","type","number","name","feeRate","tabindex","7",3,"step","min"],["mat-stroked-button","","color","primary","tabindex","8","type","button",3,"click"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center"],["mat-stroked-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(t,e){1&t&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Vb(2,"mat-card-header",2),s.Vb(3,"div",3),s.Vb(4,"span",4),s.Kc(5,"Connect to a new peer"),s.Ub(),s.Ub(),s.Vb(6,"button",5),s.dc("click",function(){return e.onClose()}),s.Kc(7,"X"),s.Ub(),s.Ub(),s.Vb(8,"mat-card-content",6),s.Vb(9,"div",7),s.Vb(10,"mat-vertical-stepper",8,9),s.dc("selectionChange",function(t){return e.stepSelectionChanged(t)}),s.Vb(12,"mat-step",10),s.Vb(13,"form",11),s.Ic(14,wo,1,1,"ng-template",12),s.Vb(15,"mat-form-field",1),s.Qb(16,"input",13),s.Ic(17,Do,2,0,"mat-error",14),s.Ub(),s.Ic(18,Co,4,2,"div",15),s.Vb(19,"div",16),s.Vb(20,"button",17),s.dc("click",function(){return e.onConnectPeer()}),s.Kc(21),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Vb(22,"mat-step",10),s.Vb(23,"form",18),s.Ic(24,Vo,1,1,"ng-template",19),s.Vb(25,"div",20),s.Vb(26,"div",21),s.Vb(27,"mat-form-field",22),s.Qb(28,"input",23),s.Vb(29,"mat-hint"),s.Kc(30),s.Ub(),s.Vb(31,"span",24),s.Kc(32," Sats "),s.Ub(),s.Ic(33,Uo,2,0,"mat-error",14),s.Ic(34,Io,2,0,"mat-error",14),s.Ic(35,Lo,2,1,"mat-error",14),s.Ub(),s.Vb(36,"div",25),s.Vb(37,"mat-slide-toggle",26),s.Kc(38,"Private Channel"),s.Ub(),s.Ub(),s.Ub(),s.Vb(39,"div",27),s.Vb(40,"div",28),s.Vb(41,"mat-form-field",1),s.Qb(42,"input",29),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ic(43,Ao,4,2,"div",15),s.Vb(44,"div",16),s.Vb(45,"button",30),s.dc("click",function(){return e.onOpenChannel()}),s.Kc(46),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Vb(47,"div",31),s.Vb(48,"button",32),s.dc("click",function(){return e.onClose()}),s.Kc(49),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Ub()),2&t&&(s.Db(10),s.oc("linear",!0),s.Db(2),s.oc("stepControl",e.peerFormGroup)("editable",e.flgEditable),s.Db(1),s.oc("formGroup",e.peerFormGroup),s.Db(4),s.oc("ngIf",null==e.peerFormGroup.controls.peerAddress.errors?null:e.peerFormGroup.controls.peerAddress.errors.required),s.Db(1),s.oc("ngIf",""!==e.peerConnectionError),s.Db(3),s.Lc(""!==e.peerConnectionError?"Retry":"Add Peer"),s.Db(1),s.oc("stepControl",e.channelFormGroup)("editable",e.flgEditable),s.Db(1),s.oc("formGroup",e.channelFormGroup),s.Db(5),s.oc("step",1e3),s.Db(2),s.Mc("Remaining Bal: ",e.totalBalance-(e.channelFormGroup.controls.fundingAmount.value?e.channelFormGroup.controls.fundingAmount.value:0),""),s.Db(3),s.oc("ngIf",null==e.channelFormGroup.controls.fundingAmount.errors?null:e.channelFormGroup.controls.fundingAmount.errors.required),s.Db(1),s.oc("ngIf",null==e.channelFormGroup.controls.fundingAmount.errors?null:e.channelFormGroup.controls.fundingAmount.errors.min),s.Db(1),s.oc("ngIf",null==e.channelFormGroup.controls.fundingAmount.errors?null:e.channelFormGroup.controls.fundingAmount.errors.max),s.Db(7),s.oc("step",1)("min",0),s.Db(1),s.oc("ngIf",""!==e.channelConnectionError),s.Db(3),s.Lc(""!==e.channelConnectionError?"Retry":"Open Channel"),s.Db(3),s.Lc(null!=e.newlyAddedPeer&&e.newlyAddedPeer.nodeId?"Do It Later":"Close"))},directives:[c.c,c.a,C.c,c.b,U.a,C.b,xo.h,xo.a,ct.u,ct.n,ct.h,xo.b,R.c,lt.b,ct.c,rt.a,ct.m,ct.g,ct.s,a.o,ct.q,R.f,R.g,Xa.a,bt.a,R.b,w.a],styles:[""]}),t})();function Fo(t,e){1&t&&s.Qb(0,"mat-progress-bar",35)}function ko(t,e){1&t&&(s.Vb(0,"th",36),s.Kc(1," ID "),s.Ub())}const Oo=function(t){return{"max-width":t}};function To(t,e){if(1&t&&(s.Vb(0,"td",37),s.Kc(1),s.Ub()),2&t){const t=e.$implicit,n=s.hc();s.oc("ngStyle",s.sc(2,Oo,n.screenSize===n.screenSizeEnum.XS?"10rem":"30rem")),s.Db(1),s.Mc(" ",null==t?null:t.nodeId," ")}}function Ro(t,e){1&t&&(s.Vb(0,"th",38),s.Kc(1," Alias "),s.Ub())}const Ko=function(t){return{"mr-0":t}};function Mo(t,e){if(1&t&&s.Qb(0,"span",42),2&t){const t=s.hc(2);s.oc("ngClass",s.sc(1,Ko,t.screenSize===t.screenSizeEnum.XS))}}function zo(t,e){if(1&t&&s.Qb(0,"span",43),2&t){const t=s.hc(2);s.oc("ngClass",s.sc(1,Ko,t.screenSize===t.screenSizeEnum.XS))}}function Eo(t,e){if(1&t&&(s.Vb(0,"td",39),s.Ic(1,Mo,1,3,"span",40),s.Ic(2,zo,1,3,"span",41),s.Kc(3),s.Ub()),2&t){const t=e.$implicit,n=s.hc();s.oc("ngStyle",s.sc(4,Oo,n.screenSize===n.screenSizeEnum.XS?"10rem":"25rem")),s.Db(1),s.oc("ngIf","CONNECTED"===t.state),s.Db(1),s.oc("ngIf","DISCONNECTED"===t.state),s.Db(1),s.Mc(" ",null==t?null:t.alias," ")}}function Bo(t,e){1&t&&(s.Vb(0,"th",36),s.Kc(1," State "),s.Ub())}function No(t,e){if(1&t&&(s.Vb(0,"td",44),s.Kc(1),s.Ub()),2&t){const t=e.$implicit;s.Db(1),s.Mc(" ",null==t?null:t.state," ")}}function Ho(t,e){1&t&&(s.Vb(0,"th",36),s.Kc(1," Network Address "),s.Ub())}function Qo(t,e){if(1&t&&(s.Vb(0,"td",44),s.Kc(1),s.Ub()),2&t){const t=e.$implicit;s.Db(1),s.Mc(" ",null==t?null:t.address," ")}}function qo(t,e){1&t&&(s.Vb(0,"th",36),s.Kc(1," Channels "),s.Ub())}function jo(t,e){if(1&t&&(s.Vb(0,"td",44),s.Kc(1),s.Ub()),2&t){const t=e.$implicit;s.Db(1),s.Mc(" ",null==t?null:t.channels," ")}}function _o(t,e){if(1&t){const t=s.Wb();s.Vb(0,"th",45),s.Vb(1,"div",46),s.Vb(2,"mat-select",47),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",48),s.dc("click",function(){return s.zc(t),s.hc().onDownloadCSV()}),s.Kc(5,"Download CSV"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}}function $o(t,e){if(1&t){const t=s.Wb();s.Vb(0,"mat-option",48),s.dc("click",function(){s.zc(t);const e=s.hc().$implicit;return s.hc().onPeerDetach(e)}),s.Kc(1,"Disconnect"),s.Ub()}}function Jo(t,e){if(1&t){const t=s.Wb();s.Vb(0,"mat-option",48),s.dc("click",function(){s.zc(t);const e=s.hc().$implicit;return s.hc().onConnectPeer(e)}),s.Kc(1,"Reconnect"),s.Ub()}}function Go(t,e){if(1&t){const t=s.Wb();s.Vb(0,"td",49),s.Vb(1,"div",46),s.Vb(2,"mat-select",47),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",48),s.dc("click",function(n){s.zc(t);const a=e.$implicit;return s.hc().onPeerClick(a,n)}),s.Kc(5,"View Info"),s.Ub(),s.Vb(6,"mat-option",48),s.dc("click",function(){s.zc(t);const n=e.$implicit;return s.hc().onOpenChannel(n)}),s.Kc(7,"Open Channel"),s.Ub(),s.Ic(8,$o,2,0,"mat-option",50),s.Ic(9,Jo,2,0,"mat-option",50),s.Ub(),s.Ub(),s.Ub()}if(2&t){const t=e.$implicit;s.Db(8),s.oc("ngIf","CONNECTED"===t.state),s.Db(1),s.oc("ngIf","DISCONNECTED"===t.state)}}function Xo(t,e){1&t&&(s.Vb(0,"p"),s.Kc(1,"No connected peers."),s.Ub())}function Wo(t,e){if(1&t&&(s.Vb(0,"td",51),s.Ic(1,Xo,2,0,"p",52),s.Ub()),2&t){const t=s.hc();s.Db(1),s.oc("ngIf",!(null!=t.peers&&t.peers.data)||(null==t.peers||null==t.peers.data?null:t.peers.data.length)<1)}}const Yo=function(t){return{"display-none":t}};function Zo(t,e){if(1&t&&s.Qb(0,"tr",53),2&t){const t=s.hc();s.oc("ngClass",s.sc(1,Yo,(null==t.peers?null:t.peers.data)&&(null==t.peers||null==t.peers.data?null:t.peers.data.length)>0))}}function ts(t,e){1&t&&s.Qb(0,"tr",54)}function es(t,e){if(1&t&&s.Qb(0,"tr",55),2&t){const t=e.$implicit,n=s.hc();s.oc("@newlyAddedRowAnimation",t.pub_key===n.newlyAddedPeer&&n.flgAnimate?"added":"notAdded")}}const ns=function(t){return{"overflow-auto error-border":t,"overflow-auto":!0}},as=function(){return["no_peer"]};let is=(()=>{class t{constructor(t,e,n,a,i,o){this.logger=t,this.store=e,this.rtlEffects=n,this.eclEffects=a,this.actions$=i,this.commonService=o,this.faUsers=f.T,this.newlyAddedPeer="",this.flgAnimate=!0,this.displayedColumns=[],this.peerAddress="",this.peersData=[],this.information={},this.availableBalance=0,this.flgLoading=[!0],this.flgSticky=!1,this.pageSize=p.p,this.pageSizeOptions=p.q,this.screenSize="",this.screenSizeEnum=p.s,this.unSubs=[new d.a,new d.a,new d.a,new d.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===p.s.XS?(this.flgSticky=!1,this.displayedColumns=["alias","actions"]):this.screenSize===p.s.SM?(this.flgSticky=!1,this.displayedColumns=["alias","nodeId","address","actions"]):this.screenSize===p.s.MD?(this.flgSticky=!1,this.displayedColumns=["alias","nodeId","address","channels","actions"]):(this.flgSticky=!0,this.displayedColumns=["alias","nodeId","address","channels","actions"])}ngOnInit(){this.store.select("ecl").pipe(Object(u.a)(this.unSubs[0])).subscribe(t=>{t.effectErrors.forEach(t=>{"FetchPeers"===t.action&&(this.flgLoading[0]="error")}),this.information=t.information,this.availableBalance=t.onchainBalance.total||0,this.peersData=t.peers,this.loadPeersTable(this.peersData),"error"!==this.flgLoading[0]&&(this.flgLoading[0]=!1),setTimeout(()=>{this.flgAnimate=!1},3e3),this.logger.info(t)}),this.actions$.pipe(Object(u.a)(this.unSubs[1]),Object(h.a)(t=>t.type===g.gb)).subscribe(t=>{this.peerAddress=void 0,this.flgAnimate=!0})}ngAfterViewInit(){this.peersData.length>0&&this.loadPeersTable(this.peersData)}onPeerClick(t,e){const n=[[{key:"nodeId",value:t.nodeId,title:"Public Key",width:100}],[{key:"address",value:t.address,title:"Address",width:50},{key:"alias",value:t.alias,title:"Alias",width:50}],[{key:"state",value:this.commonService.titleCase(t.state),title:"State",width:50},{key:"channels",value:t.channels,title:"Channels",width:50}]];this.store.dispatch(new st.D({data:{type:p.b.INFORMATION,alertTitle:"Peer Information",showQRName:"Public Key",showQRField:t.nodeId,message:n}}))}onConnectPeer(t){this.store.dispatch(new st.D({data:{message:{peer:t.nodeId?t:null,information:this.information,balance:this.availableBalance},component:Po}}))}onOpenChannel(t){this.store.dispatch(new st.D({data:{alertTitle:"Open Channel",message:{peer:t,information:this.information,balance:this.availableBalance},newlyAdded:!1,component:bi}}))}onPeerDetach(t){this.store.dispatch(t.channels>0?new st.D({data:{type:p.b.ERROR,alertTitle:"Disconnect Not Allowed",titleMessage:"Channel active with this peer."}}):new st.E({data:{type:p.b.CONFIRM,alertTitle:"Disconnect Peer",titleMessage:"Disconnect peer: "+(t.alias?t.alias:t.nodeId),noBtnText:"Cancel",yesBtnText:"Disconnect"}})),this.rtlEffects.closeConfirm.pipe(Object(u.a)(this.unSubs[3])).subscribe(e=>{e&&(this.store.dispatch(new st.G("Disconnecting Peer...")),this.store.dispatch(new g.i({nodeId:t.nodeId})))})}applyFilter(t){this.peers.filter=t.value.trim().toLowerCase()}loadPeersTable(t){this.peers=new it.o(t?[...t]:[]),this.peers.sort=this.sort,this.peers.sortingDataAccessor=(t,e)=>t[e]&&isNaN(t[e])?t[e].toLocaleLowerCase():t[e]?+t[e]:null,this.peers.filterPredicate=(t,e)=>JSON.stringify(t).toLowerCase().includes(e),this.peers.paginator=this.paginator}onDownloadCSV(){this.peers.data&&this.peers.data.length>0&&this.commonService.downloadFile(this.peers.data,"Peers")}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(y.b),s.Pb(x.h),s.Pb(vt.a),s.Pb(ee.a),s.Pb(v.a),s.Pb(S.a))},t.\u0275cmp=s.Jb({type:t,selectors:[["rtl-ecl-peers"]],viewQuery:function(t,e){if(1&t&&(s.Pc(at.a,!0),s.Pc(nt.a,!0)),2&t){let t;s.vc(t=s.ec())&&(e.sort=t.first),s.vc(t=s.ec())&&(e.paginator=t.first)}},features:[s.Cb([{provide:nt.b,useValue:Object(p.B)("Peers")}])],decls:42,vars:14,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"],["fxLayout","row","fxLayoutAlign","start start"],["matInput","","placeholder","Filter",3,"keyup"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","nodeId"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","alias"],["mat-header-cell","","mat-sort-header","","class","px-3",4,"matHeaderCellDef"],["mat-cell","","class","px-3",3,"ngStyle",4,"matCellDef"],["matColumnDef","state"],["mat-cell","",4,"matCellDef"],["matColumnDef","address"],["matColumnDef","channels"],["matColumnDef","actions"],["mat-header-cell","","class","px-3",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center","class","px-3",4,"matCellDef"],["matColumnDef","no_peer"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell","",3,"ngStyle"],["mat-header-cell","","mat-sort-header","",1,"px-3"],["mat-cell","",1,"px-3",3,"ngStyle"],["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-cell",""],["mat-header-cell","",1,"px-3"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"px-3"],[3,"click",4,"ngIf"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(t,e){1&t&&(s.Vb(0,"div",0),s.Vb(1,"form",1,2),s.Vb(3,"button",3),s.dc("click",function(){return e.onConnectPeer({})}),s.Kc(4,"Add Peer"),s.Ub(),s.Ub(),s.Vb(5,"div",4),s.Vb(6,"div",5),s.Vb(7,"div",6),s.Qb(8,"fa-icon",7),s.Vb(9,"span",8),s.Kc(10,"Peers"),s.Ub(),s.Ub(),s.Vb(11,"mat-form-field",9),s.Vb(12,"div",10),s.Vb(13,"input",11),s.dc("keyup",function(t){return e.applyFilter(t.target)}),s.Ub(),s.Ub(),s.Ub(),s.Ub(),s.Vb(14,"div",12),s.Ic(15,Fo,1,0,"mat-progress-bar",13),s.Vb(16,"table",14,15),s.Tb(18,16),s.Ic(19,ko,2,0,"th",17),s.Ic(20,To,2,4,"td",18),s.Sb(),s.Tb(21,19),s.Ic(22,Ro,2,0,"th",20),s.Ic(23,Eo,4,6,"td",21),s.Sb(),s.Tb(24,22),s.Ic(25,Bo,2,0,"th",17),s.Ic(26,No,2,1,"td",23),s.Sb(),s.Tb(27,24),s.Ic(28,Ho,2,0,"th",17),s.Ic(29,Qo,2,1,"td",23),s.Sb(),s.Tb(30,25),s.Ic(31,qo,2,0,"th",17),s.Ic(32,jo,2,1,"td",23),s.Sb(),s.Tb(33,26),s.Ic(34,_o,6,0,"th",27),s.Ic(35,Go,10,2,"td",28),s.Sb(),s.Tb(36,29),s.Ic(37,Wo,2,1,"td",30),s.Sb(),s.Ic(38,Zo,1,3,"tr",31),s.Ic(39,ts,1,0,"tr",32),s.Ic(40,es,1,1,"tr",33),s.Ub(),s.Ub(),s.Qb(41,"mat-paginator",34),s.Ub(),s.Ub()),2&t&&(s.Db(8),s.oc("icon",e.faUsers),s.Db(7),s.oc("ngIf",!0===e.flgLoading[0]),s.Db(1),s.oc("dataSource",e.peers)("ngClass",s.sc(11,ns,"error"===e.flgLoading[0])),s.Db(22),s.oc("matFooterRowDef",s.rc(13,as)),s.Db(1),s.oc("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),s.Db(1),s.oc("matRowDefColumns",e.displayedColumns),s.Db(1),s.oc("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS))},directives:[c.c,c.a,c.b,ct.u,ct.n,ct.o,U.a,w.a,R.c,lt.b,z.b,a.o,it.n,at.a,a.m,L.a,it.c,it.i,it.b,it.e,it.g,it.k,it.m,nt.a,l.a,it.h,at.b,it.a,a.p,L.b,K.a,dt.a,dt.c,ut.m,it.d,it.f,it.j,it.l],styles:[".mat-column-alias[_ngcontent-%COMP%], .mat-column-nodeId[_ngcontent-%COMP%]{flex:1 1 10%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-column-nodeId[_ngcontent-%COMP%]{padding-right:2rem}.mat-column-address[_ngcontent-%COMP%]{flex:1 1 15%;width:15%}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"],data:{animation:[xt.a]}}),t})();const os=["queryRoutesForm"];function ss(t,e){1&t&&(s.Vb(0,"mat-error"),s.Kc(1,"Destination Node ID is required."),s.Ub())}function cs(t,e){1&t&&(s.Vb(0,"mat-error"),s.Kc(1,"Amount is required."),s.Ub())}function ls(t,e){1&t&&s.Qb(0,"mat-progress-bar",31)}function rs(t,e){1&t&&(s.Vb(0,"th",32),s.Kc(1," Alias "),s.Ub())}function bs(t,e){if(1&t&&(s.Vb(0,"td",33),s.Kc(1),s.Ub()),2&t){const t=e.$implicit;s.Db(1),s.Mc(" ",null==t?null:t.alias," ")}}function ds(t,e){1&t&&(s.Vb(0,"th",32),s.Kc(1," ID "),s.Ub())}function us(t,e){if(1&t&&(s.Vb(0,"td",33),s.Kc(1),s.Ub()),2&t){const t=e.$implicit;s.Db(1),s.Mc(" ",null==t?null:t.nodeId," ")}}function hs(t,e){1&t&&(s.Vb(0,"th",34),s.Vb(1,"span",35),s.Kc(2,"Actions"),s.Ub(),s.Ub())}function ms(t,e){if(1&t){const t=s.Wb();s.Vb(0,"td",36),s.Vb(1,"button",37),s.dc("click",function(n){s.zc(t);const a=e.$implicit;return s.hc().onHopClick(a,n)}),s.Kc(2,"View Info"),s.Ub(),s.Ub()}}function fs(t,e){1&t&&s.Qb(0,"tr",38)}function ps(t,e){1&t&&s.Qb(0,"tr",39)}const gs=function(t){return{"overflow-auto error-border":t,"overflow-auto":!0}};let ys=(()=>{class t{constructor(t,e,n){this.store=t,this.eclEffects=e,this.commonService=n,this.nodeId="",this.amount=0,this.flgSticky=!1,this.displayedColumns=[],this.flgLoading=[!1],this.faRoute=f.I,this.faExclamationTriangle=f.o,this.screenSize="",this.screenSizeEnum=p.s,this.unSubs=[new d.a,new d.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===p.s.XS?(this.flgSticky=!1,this.displayedColumns=["alias","actions"]):this.screenSize===p.s.SM||this.screenSize===p.s.MD?(this.flgSticky=!1,this.displayedColumns=["alias","nodeId","actions"]):(this.flgSticky=!0,this.displayedColumns=["alias","nodeId","actions"])}ngOnInit(){this.qrHops=new it.o([]),this.eclEffects.setQueryRoutes.pipe(Object(u.a)(this.unSubs[1])).subscribe(t=>{this.qrHops.data=[],t?(this.flgLoading[0]=!1,this.qrHops=new it.o([...t]),this.qrHops.data=t):this.flgLoading[0]="error",this.qrHops.sort=this.sort,this.qrHops.sortingDataAccessor=(t,e)=>t[e]&&isNaN(t[e])?t[e].toLocaleLowerCase():t[e]?+t[e]:null})}onQueryRoutes(){if(!this.nodeId||!this.amount)return!0;this.qrHops.data=[],this.flgLoading[0]=!0,this.store.dispatch(new g.F({nodeId:this.nodeId,amount:1e3*this.amount}))}resetData(){this.nodeId="",this.amount=0,this.flgLoading[0]=!1,this.qrHops.data=[],this.form.resetForm()}onHopClick(t,e){this.store.dispatch(new st.D({data:{type:p.b.INFORMATION,alertTitle:"Route Information",message:[[{key:"alias",value:t.alias,title:"Alias",width:100,type:p.h.STRING}],[{key:"nodeId",value:t.nodeId,title:"Node ID",width:100,type:p.h.STRING}]]}}))}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(x.h),s.Pb(ee.a),s.Pb(S.a))},t.\u0275cmp=s.Jb({type:t,selectors:[["rtl-ecl-query-routes"]],viewQuery:function(t,e){if(1&t&&(s.Pc(at.a,!0),s.Ec(os,!0)),2&t){let t;s.vc(t=s.ec())&&(e.sort=t.first),s.vc(t=s.ec())&&(e.form=t.first)}},decls:39,vars:16,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-2"],["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"],[1,"table-container","mb-6",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","alias"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","nodeId"],["matColumnDef","actions"],["mat-header-cell","","class","pl-4 pr-3",4,"matHeaderCellDef"],["mat-cell","","class","pl-4",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell","",1,"pl-4","pr-3"],["fxLayoutAlign","end center"],["mat-cell","",1,"pl-4"],["mat-stroked-button","","color","primary","type","button","tabindex","4",3,"click"],["mat-header-row",""],["mat-row",""]],template:function(t,e){if(1&t){const t=s.Wb();s.Vb(0,"div",0),s.Vb(1,"form",1,2),s.dc("ngSubmit",function(){return s.zc(t),s.wc(2).form.valid&&e.onQueryRoutes()}),s.Vb(3,"div",3),s.Qb(4,"fa-icon",4),s.Vb(5,"span"),s.Kc(6,"The actual routing fee on a payment can be different from the fee shown on query routes."),s.Ub(),s.Ub(),s.Vb(7,"mat-form-field",5),s.Vb(8,"input",6,7),s.dc("ngModelChange",function(t){return e.nodeId=t}),s.Ub(),s.Ic(10,ss,2,0,"mat-error",8),s.Ub(),s.Vb(11,"mat-form-field",9),s.Vb(12,"input",10),s.dc("ngModelChange",function(t){return e.amount=t}),s.Ub(),s.Ic(13,cs,2,0,"mat-error",8),s.Ub(),s.Vb(14,"div",11),s.Vb(15,"button",12),s.dc("click",function(){return e.resetData()}),s.Kc(16,"Clear"),s.Ub(),s.Vb(17,"button",13),s.Kc(18,"Query Route"),s.Ub(),s.Ub(),s.Ub(),s.Vb(19,"div",14),s.Vb(20,"div",15),s.Qb(21,"fa-icon",16),s.Vb(22,"span",17),s.Kc(23,"Transaction Route"),s.Ub(),s.Ub(),s.Ub(),s.Vb(24,"div",18),s.Ic(25,ls,1,0,"mat-progress-bar",19),s.Vb(26,"table",20,21),s.Tb(28,22),s.Ic(29,rs,2,0,"th",23),s.Ic(30,bs,2,1,"td",24),s.Sb(),s.Tb(31,25),s.Ic(32,ds,2,0,"th",23),s.Ic(33,us,2,1,"td",24),s.Sb(),s.Tb(34,26),s.Ic(35,hs,3,0,"th",27),s.Ic(36,ms,3,0,"td",28),s.Sb(),s.Ic(37,fs,1,0,"tr",29),s.Ic(38,ps,1,0,"tr",30),s.Ub(),s.Ub(),s.Ub()}2&t&&(s.Db(4),s.oc("icon",e.faExclamationTriangle),s.Db(4),s.oc("ngModel",e.nodeId),s.Db(2),s.oc("ngIf",!e.nodeId),s.Db(2),s.oc("ngModel",e.amount)("step",1e3)("min",0),s.Db(1),s.oc("ngIf",!e.amount),s.Db(8),s.oc("icon",e.faRoute),s.Db(4),s.oc("ngIf",!0===e.flgLoading[0]),s.Db(1),s.oc("dataSource",e.qrHops)("ngClass",s.sc(14,gs,"error"===e.flgLoading[0])),s.Db(11),s.oc("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),s.Db(1),s.oc("matRowDefColumns",e.displayedColumns))},directives:[c.c,c.a,ct.u,ct.n,ct.o,c.b,w.a,R.c,lt.b,ct.c,ct.s,ct.m,ct.p,a.o,ct.q,bt.a,U.a,z.b,it.n,at.a,a.m,L.a,it.c,it.i,it.b,it.k,it.m,R.b,l.a,it.h,at.b,it.a,it.j,it.l],styles:[".mat-column-actions[_ngcontent-%COMP%]{flex:0 0 5%;width:5%}.mat-column-pubkey_alias[_ngcontent-%COMP%]{flex:1 1 25%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),t})();function xs(t,e){1&t&&s.Qb(0,"mat-progress-bar",29)}function vs(t,e){1&t&&(s.Vb(0,"th",30),s.Kc(1," State "),s.Ub())}function Ss(t,e){if(1&t&&(s.Vb(0,"span",36),s.Qb(1,"fa-icon",37),s.Ub()),2&t){const t=s.hc(2);s.Db(1),s.oc("icon",t.faEyeSlash)}}function ws(t,e){if(1&t&&(s.Vb(0,"span",38),s.Qb(1,"fa-icon",37),s.Ub()),2&t){const t=s.hc(2);s.Db(1),s.oc("icon",t.faEye)}}const Ds=function(t){return{"max-width":t}};function Cs(t,e){if(1&t&&(s.Vb(0,"td",31),s.Vb(1,"div",32),s.Ic(2,Ss,2,1,"span",33),s.Ic(3,ws,2,1,"span",34),s.Vb(4,"span",35),s.Kc(5),s.ic(6,"titlecase"),s.Ub(),s.Ub(),s.Ub()),2&t){const t=e.$implicit,n=s.hc();s.Db(1),s.oc("ngStyle",s.sc(6,Ds,n.screenSize===n.screenSizeEnum.XS?"10rem":"20rem")),s.Db(1),s.oc("ngIf",0===t.channelFlags),s.Db(1),s.oc("ngIf",0!==t.channelFlags),s.Db(2),s.Lc(s.jc(6,4,null==t?null:t.state))}}function Vs(t,e){1&t&&(s.Vb(0,"th",30),s.Kc(1," Short Channel ID "),s.Ub())}function Us(t,e){if(1&t&&(s.Vb(0,"td",31),s.Kc(1),s.Ub()),2&t){const t=e.$implicit;s.Db(1),s.Lc(null==t?null:t.shortChannelId)}}function Is(t,e){1&t&&(s.Vb(0,"th",30),s.Kc(1," Alias "),s.Ub())}function Ls(t,e){if(1&t&&(s.Vb(0,"td",31),s.Vb(1,"div",32),s.Vb(2,"span",35),s.Kc(3),s.Ub(),s.Ub(),s.Ub()),2&t){const t=e.$implicit,n=s.hc();s.Db(1),s.oc("ngStyle",s.sc(2,Ds,n.screenSize===n.screenSizeEnum.XS?"10rem":"20rem")),s.Db(2),s.Lc(t.alias)}}function As(t,e){1&t&&(s.Vb(0,"th",39),s.Kc(1," Local Balance (Sats) "),s.Ub())}function Ps(t,e){if(1&t&&(s.Vb(0,"td",31),s.Vb(1,"span",40),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&t){const t=e.$implicit;s.Db(2),s.Mc(" ",s.kc(3,1,null==t?null:t.toLocal,"1.0-0")," ")}}function Fs(t,e){1&t&&(s.Vb(0,"th",39),s.Kc(1," Remote Balance (Sats) "),s.Ub())}function ks(t,e){if(1&t&&(s.Vb(0,"td",31),s.Vb(1,"span",40),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&t){const t=e.$implicit;s.Db(2),s.Mc(" ",s.kc(3,1,null==t?null:t.toRemote,"1.0-0")," ")}}function Os(t,e){1&t&&(s.Vb(0,"th",41),s.Kc(1,"Balance Score "),s.Ub())}function Ts(t,e){if(1&t&&(s.Vb(0,"td",42),s.Vb(1,"div",43),s.Vb(2,"mat-hint",44),s.Kc(3),s.ic(4,"number"),s.Ub(),s.Ub(),s.Qb(5,"mat-progress-bar",45),s.Ub()),2&t){const t=e.$implicit;s.Db(3),s.Lc(s.jc(4,2,(null==t?null:t.balancedness)||0)),s.Db(2),s.pc("value",t.toLocal&&t.toLocal>0?+t.toLocal/(+t.toLocal+ +t.toRemote)*100:0)}}function Rs(t,e){if(1&t){const t=s.Wb();s.Vb(0,"th",46),s.Vb(1,"div",47),s.Vb(2,"mat-select",48),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",49),s.dc("click",function(){return s.zc(t),s.hc().onDownloadCSV()}),s.Kc(5,"Download CSV"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}}function Ks(t,e){if(1&t){const t=s.Wb();s.Vb(0,"td",50),s.Vb(1,"div",51),s.Vb(2,"mat-select",52),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",49),s.dc("click",function(n){s.zc(t);const a=e.$implicit;return s.hc().onChannelClick(a,n)}),s.Kc(5,"View Info"),s.Ub(),s.Vb(6,"mat-option",49),s.dc("click",function(){s.zc(t);const n=e.$implicit;return s.hc().onChannelClose(n,!0)}),s.Kc(7,"Force Close"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}}function Ms(t,e){1&t&&(s.Vb(0,"p"),s.Kc(1,"No inactive channels available."),s.Ub())}function zs(t,e){if(1&t&&(s.Vb(0,"td",53),s.Ic(1,Ms,2,0,"p",54),s.Ub()),2&t){const t=s.hc();s.Db(1),s.oc("ngIf",!(null!=t.channels&&t.channels.data)||(null==t.channels||null==t.channels.data?null:t.channels.data.length)<1)}}const Es=function(t){return{"display-none":t}};function Bs(t,e){if(1&t&&s.Qb(0,"tr",55),2&t){const t=s.hc();s.oc("ngClass",s.sc(1,Es,(null==t.channels?null:t.channels.data)&&(null==t.channels||null==t.channels.data?null:t.channels.data.length)>0))}}function Ns(t,e){1&t&&s.Qb(0,"tr",56)}function Hs(t,e){1&t&&s.Qb(0,"tr",57)}const Qs=function(t){return{"overflow-auto error-border":t,"overflow-auto":!0}},qs=function(){return["no_channel"]};let js=(()=>{class t{constructor(t,e,n,a,i){this.logger=t,this.store=e,this.rtlEffects=n,this.eclEffects=a,this.commonService=i,this.faEye=f.p,this.faEyeSlash=f.q,this.totalBalance=0,this.displayedColumns=[],this.myChanPolicy={},this.information={},this.numPeers=-1,this.feeRateTypes=p.j,this.flgLoading=[!0],this.selFilter="",this.flgSticky=!1,this.pageSize=p.p,this.pageSizeOptions=p.q,this.screenSize="",this.screenSizeEnum=p.s,this.unSubs=[new d.a,new d.a,new d.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===p.s.XS||this.screenSize===p.s.SM?(this.flgSticky=!1,this.displayedColumns=["state","alias","toLocal","toRemote","actions"]):this.screenSize===p.s.MD?(this.flgSticky=!1,this.displayedColumns=["state","shortChannelId","alias","toLocal","toRemote","actions"]):(this.flgSticky=!0,this.displayedColumns=["state","shortChannelId","alias","toLocal","toRemote","balancedness","actions"])}ngOnInit(){this.store.select("ecl").pipe(Object(u.a)(this.unSubs[0])).subscribe(t=>{t.effectErrors.forEach(t=>{"FetchChannels"===t.action&&(this.flgLoading[0]="error")}),this.information=t.information,this.numPeers=t.peers&&t.peers.length?t.peers.length:0,this.totalBalance=t.onchainBalance.total,this.inactiveChannels=t.inactiveChannels,this.loadChannelsTable(),"error"!==this.flgLoading[0]&&(this.flgLoading[0]=!t.inactiveChannels),this.logger.info(t)})}ngAfterViewInit(){this.inactiveChannels.length>0&&this.loadChannelsTable()}onChannelClose(t,e){this.store.dispatch(new st.E({data:{type:p.b.CONFIRM,alertTitle:e?"Force Close Channel":"Close Channel",titleMessage:e?"Force closing channel: "+t.channelId:"Closing channel: "+t.channelId,noBtnText:"Cancel",yesBtnText:e?"Force Close":"Close Channel"}})),this.rtlEffects.closeConfirm.pipe(Object(u.a)(this.unSubs[1])).subscribe(n=>{n&&(this.store.dispatch(new st.G(e?"Force Closing Channel...":"Closing Channel...")),this.store.dispatch(new g.f({channelId:t.channelId,force:e})))})}applyFilter(){this.channels.filter=this.selFilter.trim().toLocaleLowerCase()}onChannelClick(t,e){this.store.dispatch(new st.D({data:{channel:t,channelsType:"inactive",component:Vi}}))}loadChannelsTable(){this.inactiveChannels.sort(function(t,e){return t.alias===e.alias?0:e.alias?1:-1}),this.channels=new it.o([...this.inactiveChannels]),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(t,e)=>t[e]&&isNaN(t[e])?t[e].toLocaleLowerCase():t[e]?+t[e]:null,this.channels.filterPredicate=(t,e)=>JSON.stringify(t).toLowerCase().includes(e),this.channels.paginator=this.paginator,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(t=>{t.next(),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(y.b),s.Pb(x.h),s.Pb(vt.a),s.Pb(ee.a),s.Pb(S.a))},t.\u0275cmp=s.Jb({type:t,selectors:[["rtl-ecl-channel-inactive-table"]],viewQuery:function(t,e){if(1&t&&(s.Pc(at.a,!0),s.Pc(nt.a,!0)),2&t){let t;s.vc(t=s.ec())&&(e.sort=t.first),s.vc(t=s.ec())&&(e.paginator=t.first)}},features:[s.Cb([{provide:nt.b,useValue:Object(p.B)("Channels")}])],decls:36,vars:14,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"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","keyup","ngModelChange"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"table-container","w-100",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","state"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","shortChannelId"],["matColumnDef","alias"],["matColumnDef","toLocal"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","toRemote"],["matColumnDef","balancedness"],["mat-header-cell","","mat-sort-header","","class","pl-3",4,"matHeaderCellDef"],["mat-cell","","class","pl-3",4,"matCellDef"],["matColumnDef","actions"],["mat-header-cell","","class","pl-1",4,"matHeaderCellDef"],["mat-cell","","class","pl-1","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","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"ellipsis-parent",3,"ngStyle"],["class","mr-1","matTooltip","Private","matTooltipPosition","right",4,"ngIf"],["class","mr-1","matTooltip","Public","matTooltipPosition","right",4,"ngIf"],[1,"ellipsis-child"],["matTooltip","Private","matTooltipPosition","right",1,"mr-1"],[3,"icon"],["matTooltip","Public","matTooltipPosition","right",1,"mr-1"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell","","mat-sort-header","",1,"pl-3"],["mat-cell","",1,"pl-3"],["fxLayout","row"],["fxFlex","100","fxLayoutAlign","center center",1,"font-size-80"],["mode","determinate",3,"value"],["mat-header-cell","",1,"pl-1"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"pl-1"],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["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(t,e){1&t&&(s.Vb(0,"div",0),s.Vb(1,"div",1),s.Qb(2,"div",2),s.Vb(3,"mat-form-field",3),s.Vb(4,"input",4),s.dc("keyup",function(){return e.applyFilter()})("ngModelChange",function(t){return e.selFilter=t}),s.Ub(),s.Ub(),s.Ub(),s.Vb(5,"div",5),s.Ic(6,xs,1,0,"mat-progress-bar",6),s.Vb(7,"table",7,8),s.Tb(9,9),s.Ic(10,vs,2,0,"th",10),s.Ic(11,Cs,7,8,"td",11),s.Sb(),s.Tb(12,12),s.Ic(13,Vs,2,0,"th",10),s.Ic(14,Us,2,1,"td",11),s.Sb(),s.Tb(15,13),s.Ic(16,Is,2,0,"th",10),s.Ic(17,Ls,4,4,"td",11),s.Sb(),s.Tb(18,14),s.Ic(19,As,2,0,"th",15),s.Ic(20,Ps,4,4,"td",11),s.Sb(),s.Tb(21,16),s.Ic(22,Fs,2,0,"th",15),s.Ic(23,ks,4,4,"td",11),s.Sb(),s.Tb(24,17),s.Ic(25,Os,2,0,"th",18),s.Ic(26,Ts,6,4,"td",19),s.Sb(),s.Tb(27,20),s.Ic(28,Rs,6,0,"th",21),s.Ic(29,Ks,8,0,"td",22),s.Sb(),s.Tb(30,23),s.Ic(31,zs,2,1,"td",24),s.Sb(),s.Ic(32,Bs,1,3,"tr",25),s.Ic(33,Ns,1,0,"tr",26),s.Ic(34,Hs,1,0,"tr",27),s.Ub(),s.Ub(),s.Qb(35,"mat-paginator",28),s.Ub()),2&t&&(s.Db(4),s.oc("ngModel",e.selFilter),s.Db(2),s.oc("ngIf",!0===e.flgLoading[0]),s.Db(1),s.oc("dataSource",e.channels)("ngClass",s.sc(11,Qs,"error"===e.flgLoading[0])),s.Db(25),s.oc("matFooterRowDef",s.rc(13,qs)),s.Db(1),s.oc("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),s.Db(1),s.oc("matRowDefColumns",e.displayedColumns),s.Db(1),s.oc("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS))},directives:[c.c,c.b,c.a,R.c,lt.b,ct.c,ct.m,ct.p,z.b,a.o,it.n,at.a,a.m,L.a,it.c,it.i,it.b,it.e,it.g,it.k,it.m,nt.a,l.a,it.h,at.b,it.a,a.p,L.b,K.a,w.a,R.f,dt.a,dt.c,ut.m,it.d,it.f,it.j,it.l],pipes:[a.x,a.f],styles:[".mat-column-state[_ngcontent-%COMP%]{flex:0 0 15%;width:15%}.mat-column-state[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%]{display:flex}.mat-column-alias[_ngcontent-%COMP%]{flex:0 0 15%;width:15%}.mat-column-alias[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%]{display:flex}.mat-column-balancedness[_ngcontent-%COMP%]{padding-left:3rem;flex:0 0 20%;width:20%}.mat-column-shortChannelId[_ngcontent-%COMP%], .mat-column-toLocal[_ngcontent-%COMP%], .mat-column-toRemote[_ngcontent-%COMP%]{flex:1 1 15%;width:15%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media only screen and (max-width:37.5em){.mat-column-shortChannelId[_ngcontent-%COMP%], .mat-column-toLocal[_ngcontent-%COMP%], .mat-column-toRemote[_ngcontent-%COMP%]{white-space:unset}}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}.mat-column-actions[_ngcontent-%COMP%] .bordered-box.table-actions-select[_ngcontent-%COMP%]{flex:0 0 100%}@media only screen and (max-width:37.5em){.mat-column-actions[_ngcontent-%COMP%] .bordered-box.table-actions-select[_ngcontent-%COMP%]{flex:0 0 80%}}"]}),t})();function _s(t,e){if(1&t&&(s.Vb(0,"div",5),s.Kc(1),s.Ub()),2&t){const t=s.hc();s.Db(1),s.Lc(t.errorMessage)}}function $s(t,e){if(1&t){const t=s.Wb();s.Vb(0,"div",6),s.Qb(1,"div",7),s.Vb(2,"mat-form-field",8),s.Vb(3,"input",9),s.dc("ngModelChange",function(e){return s.zc(t),s.hc().filterValue=e})("input",function(){return s.zc(t),s.hc().applyFilter()})("keyup",function(){return s.zc(t),s.hc().applyFilter()}),s.Ub(),s.Ub(),s.Ub()}if(2&t){const t=s.hc();s.Db(3),s.oc("ngModel",t.filterValue)}}function Js(t,e){1&t&&(s.Vb(0,"th",31),s.Kc(1,"Date/Time"),s.Ub())}function Gs(t,e){if(1&t&&(s.Vb(0,"td",32),s.Kc(1),s.Ub()),2&t){const t=e.$implicit;s.Db(1),s.Lc(null==t?null:t.timestampStr)}}function Xs(t,e){1&t&&(s.Vb(0,"th",31),s.Kc(1,"In Channel"),s.Ub())}const Ws=function(t){return{"max-width":t}};function Ys(t,e){if(1&t&&(s.Vb(0,"td",33),s.Kc(1),s.Ub()),2&t){const t=e.$implicit,n=s.hc(2);s.oc("ngStyle",s.sc(2,Ws,n.screenSize===n.screenSizeEnum.XS?"10rem":"20rem")),s.Db(1),s.Lc(null==t?null:t.fromChannelAlias)}}function Zs(t,e){1&t&&(s.Vb(0,"th",31),s.Kc(1,"Out Channel"),s.Ub())}function tc(t,e){if(1&t&&(s.Vb(0,"td",33),s.Kc(1),s.Ub()),2&t){const t=e.$implicit,n=s.hc(2);s.oc("ngStyle",s.sc(2,Ws,n.screenSize===n.screenSizeEnum.XS?"10rem":"20rem")),s.Db(1),s.Lc(null==t?null:t.toChannelAlias)}}function ec(t,e){1&t&&(s.Vb(0,"th",34),s.Kc(1,"Amount In (Sats)"),s.Ub())}function nc(t,e){if(1&t&&(s.Vb(0,"td",32),s.Vb(1,"span",35),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&t){const t=e.$implicit;s.Db(2),s.Lc(s.jc(3,1,null==t?null:t.amountIn))}}function ac(t,e){1&t&&(s.Vb(0,"th",34),s.Kc(1,"Amount Out (Sats)"),s.Ub())}function ic(t,e){if(1&t&&(s.Vb(0,"td",32),s.Vb(1,"span",35),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&t){const t=e.$implicit;s.Db(2),s.Lc(s.jc(3,1,null==t?null:t.amountOut))}}function oc(t,e){1&t&&(s.Vb(0,"th",34),s.Kc(1,"Fee Earned (Sats)"),s.Ub())}function sc(t,e){if(1&t&&(s.Vb(0,"td",32),s.Vb(1,"span",35),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&t){const t=e.$implicit;s.Db(2),s.Lc(s.jc(3,1,(null==t?null:t.amountIn)-(null==t?null:t.amountOut)))}}function cc(t,e){if(1&t){const t=s.Wb();s.Vb(0,"th",36),s.Vb(1,"div",37),s.Vb(2,"mat-select",38),s.Qb(3,"mat-select-trigger"),s.Vb(4,"mat-option",39),s.dc("click",function(){return s.zc(t),s.hc(2).onDownloadCSV()}),s.Kc(5,"Download CSV"),s.Ub(),s.Ub(),s.Ub(),s.Ub()}}function lc(t,e){if(1&t){const t=s.Wb();s.Vb(0,"td",40),s.Vb(1,"button",41),s.dc("click",function(n){s.zc(t);const a=e.$implicit;return s.hc(2).onForwardingEventClick(a,n)}),s.Kc(2,"View Info"),s.Ub(),s.Ub()}}function rc(t,e){1&t&&(s.Vb(0,"p"),s.Kc(1,"No forwarding event available."),s.Ub())}function bc(t,e){if(1&t&&(s.Vb(0,"td",42),s.Ic(1,rc,2,0,"p",43),s.Ub()),2&t){const t=s.hc(2);s.Db(1),s.oc("ngIf",!(null!=t.forwardingHistoryEvents&&t.forwardingHistoryEvents.data)||(null==t.forwardingHistoryEvents||null==t.forwardingHistoryEvents.data?null:t.forwardingHistoryEvents.data.length)<1)}}const dc=function(t){return{"display-none":t}};function uc(t,e){if(1&t&&s.Qb(0,"tr",44),2&t){const t=s.hc(2);s.oc("ngClass",s.sc(1,dc,(null==t.forwardingHistoryEvents?null:t.forwardingHistoryEvents.data)&&(null==t.forwardingHistoryEvents||null==t.forwardingHistoryEvents.data?null:t.forwardingHistoryEvents.data.length)>0))}}function hc(t,e){1&t&&s.Qb(0,"tr",45)}function mc(t,e){1&t&&s.Qb(0,"tr",46)}const fc=function(){return["no_event"]};function pc(t,e){if(1&t&&(s.Vb(0,"div",10),s.Vb(1,"table",11,12),s.Tb(3,13),s.Ic(4,Js,2,0,"th",14),s.Ic(5,Gs,2,1,"td",15),s.Sb(),s.Tb(6,16),s.Ic(7,Xs,2,0,"th",14),s.Ic(8,Ys,2,4,"td",17),s.Sb(),s.Tb(9,18),s.Ic(10,Zs,2,0,"th",14),s.Ic(11,tc,2,4,"td",17),s.Sb(),s.Tb(12,19),s.Ic(13,ec,2,0,"th",20),s.Ic(14,nc,4,3,"td",15),s.Sb(),s.Tb(15,21),s.Ic(16,ac,2,0,"th",20),s.Ic(17,ic,4,3,"td",15),s.Sb(),s.Tb(18,22),s.Ic(19,oc,2,0,"th",20),s.Ic(20,sc,4,3,"td",15),s.Sb(),s.Tb(21,23),s.Ic(22,cc,6,0,"th",24),s.Ic(23,lc,3,0,"td",25),s.Sb(),s.Tb(24,26),s.Ic(25,bc,2,1,"td",27),s.Sb(),s.Ic(26,uc,1,3,"tr",28),s.Ic(27,hc,1,0,"tr",29),s.Ic(28,mc,1,0,"tr",30),s.Ub(),s.Ub()),2&t){const t=s.hc();s.Db(1),s.oc("dataSource",t.forwardingHistoryEvents),s.Db(25),s.oc("matFooterRowDef",s.rc(5,fc)),s.Db(1),s.oc("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),s.Db(1),s.oc("matRowDefColumns",t.displayedColumns)}}const gc=function(t){return{"error-border":t,"padding-gap-x":!0}};let yc=(()=>{class t{constructor(t,e,n){this.logger=t,this.commonService=e,this.store=n,this.eventsData=[],this.filterValue="",this.errorMessage="",this.displayedColumns=[],this.flgSticky=!1,this.pageSize=p.p,this.pageSizeOptions=p.q,this.screenSize="",this.screenSizeEnum=p.s,this.unSubs=[new d.a,new d.a,new d.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===p.s.XS?(this.flgSticky=!1,this.displayedColumns=["timestamp","amountIn","actions"]):this.screenSize===p.s.SM?(this.flgSticky=!1,this.displayedColumns=["timestamp","amountIn","fee","actions"]):this.screenSize===p.s.MD?(this.flgSticky=!1,this.displayedColumns=["timestamp","amountIn","amountOut","fee","actions"]):(this.flgSticky=!0,this.displayedColumns=["timestamp","fromChannelAlias","toChannelAlias","amountIn","amountOut","fee","actions"])}ngOnInit(){this.store.select("ecl").pipe(Object(u.a)(this.unSubs[0])).subscribe(t=>{this.eventsData.length<=0&&(this.errorMessage="",t.effectErrors.forEach(t=>{"FetchPayments"===t.action&&(this.errorMessage="object"==typeof t.message?JSON.stringify(t.message):t.message)}),this.eventsData=t.payments&&t.payments.relayed?t.payments.relayed:[],this.eventsData.length>0&&this.sort&&this.paginator&&this.loadForwardingEventsTable(this.eventsData),this.logger.info(this.eventsData))})}ngAfterViewInit(){this.eventsData.length>0&&this.loadForwardingEventsTable(this.eventsData)}ngOnChanges(t){t.eventsData&&(this.eventsData=t.eventsData.currentValue,this.loadForwardingEventsTable(this.eventsData)),t.filterValue&&this.applyFilter()}onForwardingEventClick(t,e){this.store.dispatch(new st.D({data:{type:p.b.INFORMATION,alertTitle:"Event Information",message:[[{key:"paymentHash",value:t.paymentHash,title:"Payment Hash",width:100,type:p.h.STRING}],[{key:"timestampStr",value:t.timestampStr,title:"Date/Time",width:50,type:p.h.DATE_TIME},{key:"fee",value:t.amountIn-t.amountOut,title:"Fee Earned (Sats)",width:50,type:p.h.NUMBER}],[{key:"amountIn",value:t.amountIn,title:"Amount In (Sats)",width:50,type:p.h.NUMBER},{key:"amountOut",value:t.amountOut,title:"Amount Out (Sats)",width:50,type:p.h.NUMBER}],[{key:"fromChannelAlias",value:t.fromChannelAlias,title:"From Channel Alias",width:50,type:p.h.STRING},{key:"fromShortChannelId",value:t.fromShortChannelId,title:"From Short Channel ID",width:50,type:p.h.STRING}],[{key:"fromChannelId",value:t.fromChannelId,title:"From Channel Id",width:100,type:p.h.STRING}],[{key:"toChannelAlias",value:t.toChannelAlias,title:"To Channel Alias",width:50,type:p.h.STRING},{key:"toShortChannelId",value:t.toShortChannelId,title:"To Short Channel ID",width:50,type:p.h.STRING}],[{key:"toChannelId",value:t.toChannelId,title:"To Channel Id",width:100,type:p.h.STRING}]]}}))}loadForwardingEventsTable(t){this.forwardingHistoryEvents=new it.o([...t]),this.forwardingHistoryEvents.sort=this.sort,this.forwardingHistoryEvents.sortingDataAccessor=(t,e)=>{switch(e){case"fee":return t.amountIn-t.amountOut;default:return t[e]&&isNaN(t[e])?t[e].toLocaleLowerCase():t[e]?+t[e]:null}},this.forwardingHistoryEvents.filterPredicate=(t,e)=>JSON.stringify(t).toLowerCase().includes(e),this.forwardingHistoryEvents.paginator=this.paginator,this.logger.info(this.forwardingHistoryEvents)}onDownloadCSV(){this.forwardingHistoryEvents.data&&this.forwardingHistoryEvents.data.length>0&&this.commonService.downloadFile(this.forwardingHistoryEvents.data,"Forwarding-history")}applyFilter(){this.forwardingHistoryEvents.filter=this.filterValue.trim().toLowerCase()}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(y.b),s.Pb(S.a),s.Pb(x.h))},t.\u0275cmp=s.Jb({type:t,selectors:[["rtl-ecl-forwarding-history"]],viewQuery:function(t,e){if(1&t&&(s.Pc(at.a,!0),s.Pc(nt.a,!0)),2&t){let t;s.vc(t=s.ec())&&(e.sort=t.first),s.vc(t=s.ec())&&(e.paginator=t.first)}},inputs:{eventsData:"eventsData",filterValue:"filterValue"},features:[s.Cb([{provide:nt.b,useValue:Object(p.B)("Events")}]),s.Bb],decls:5,vars:9,consts:[["fxLayout","column","fxLayoutAlign","start stretch",3,"ngClass"],["class","p-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"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[1,"p-2"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],["fxFlex","30"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mat-table","","fxFlex","100","matSort","",1,"overflow-auto",3,"dataSource"],["table",""],["matColumnDef","timestamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","fromChannelAlias"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","toChannelAlias"],["matColumnDef","amountIn"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","amountOut"],["matColumnDef","fee"],["matColumnDef","actions"],["mat-header-cell","","class","px-3",4,"matHeaderCellDef"],["mat-cell","","class","px-3","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","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-cell","",3,"ngStyle"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell","",1,"px-3"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"px-3"],["mat-stroked-button","","color","primary","type","button","tabindex","4",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(t,e){1&t&&(s.Vb(0,"div",0),s.Ic(1,_s,2,1,"div",1),s.Ic(2,$s,4,1,"div",2),s.Ic(3,pc,29,6,"div",3),s.Qb(4,"mat-paginator",4),s.Ub()),2&t&&(s.oc("ngClass",s.sc(7,gc,""!==e.errorMessage)),s.Db(1),s.oc("ngIf",""!==e.errorMessage),s.Db(1),s.oc("ngIf",""===e.errorMessage),s.Db(1),s.oc("ngIf",""===e.errorMessage),s.Db(1),s.oc("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS))},directives:[c.c,c.b,a.m,L.a,a.o,nt.a,c.a,R.c,lt.b,ct.c,ct.m,ct.p,z.b,it.n,at.a,it.c,it.i,it.b,it.e,it.g,it.k,it.m,it.h,at.b,it.a,a.p,L.b,dt.a,dt.c,ut.m,U.a,it.d,it.f,it.j,it.l],pipes:[a.f],styles:[".mat-column-fromAlias[_ngcontent-%COMP%]{padding-left:2rem}.mat-column-fromAlias[_ngcontent-%COMP%], .mat-column-toAlias[_ngcontent-%COMP%]{flex:1 1 20%;width:20%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-column-toAlias[_ngcontent-%COMP%]{padding-left:1rem}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),t})();const xc=["tableOut"],vc=["paginatorIn"],Sc=["paginatorOut"];function wc(t,e){if(1&t&&(s.Vb(0,"div",3),s.Kc(1),s.Ub()),2&t){const t=s.hc();s.Db(1),s.Lc(t.errorMessage)}}function Dc(t,e){1&t&&(s.Vb(0,"th",35),s.Kc(1,"Channel ID"),s.Ub())}const Cc=function(t){return{"max-width":t}};function Vc(t,e){if(1&t&&(s.Vb(0,"td",36),s.Kc(1),s.Ub()),2&t){const t=e.$implicit,n=s.hc(2);s.oc("ngStyle",s.sc(2,Cc,n.screenSize===n.screenSizeEnum.XS?"5rem":"10rem")),s.Db(1),s.Lc(t.channelId)}}function Uc(t,e){1&t&&(s.Vb(0,"th",35),s.Kc(1,"Peer Alias"),s.Ub())}function Ic(t,e){if(1&t&&(s.Vb(0,"td",36),s.Kc(1),s.Ub()),2&t){const t=e.$implicit,n=s.hc(2);s.oc("ngStyle",s.sc(2,Cc,n.screenSize===n.screenSizeEnum.XS?"5rem":"10rem")),s.Db(1),s.Lc(t.alias)}}function Lc(t,e){1&t&&(s.Vb(0,"th",37),s.Kc(1,"Events"),s.Ub())}function Ac(t,e){if(1&t&&(s.Vb(0,"td",38),s.Vb(1,"span",39),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&t){const t=e.$implicit;s.Db(2),s.Lc(s.jc(3,1,t.events))}}function Pc(t,e){1&t&&(s.Vb(0,"th",37),s.Kc(1,"Amount (Sats)"),s.Ub())}function Fc(t,e){if(1&t&&(s.Vb(0,"td",38),s.Vb(1,"span",39),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&t){const t=e.$implicit;s.Db(2),s.Lc(s.jc(3,1,t.totalAmount))}}function kc(t,e){1&t&&(s.Vb(0,"th",37),s.Kc(1,"Fee (Sats)"),s.Ub())}function Oc(t,e){if(1&t&&(s.Vb(0,"td",38),s.Vb(1,"span",39),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&t){const t=e.$implicit;s.Db(2),s.Lc(s.jc(3,1,t.totalFee))}}function Tc(t,e){1&t&&(s.Vb(0,"p"),s.Kc(1,"No incoming routing peer available."),s.Ub())}function Rc(t,e){if(1&t&&(s.Vb(0,"td",40),s.Ic(1,Tc,2,0,"p",41),s.Ub()),2&t){const t=s.hc(2);s.Db(1),s.oc("ngIf",!(null!=t.RoutingPeersIncoming&&t.RoutingPeersIncoming.data)||(null==t.RoutingPeersIncoming||null==t.RoutingPeersIncoming.data?null:t.RoutingPeersIncoming.data.length)<1)}}const Kc=function(t){return{"display-none":t}};function Mc(t,e){if(1&t&&s.Qb(0,"tr",42),2&t){const t=s.hc(2);s.oc("ngClass",s.sc(1,Kc,(null==t.RoutingPeersIncoming?null:t.RoutingPeersIncoming.data)&&(null==t.RoutingPeersIncoming||null==t.RoutingPeersIncoming.data?null:t.RoutingPeersIncoming.data.length)>0))}}function zc(t,e){1&t&&s.Qb(0,"tr",43)}function Ec(t,e){1&t&&s.Qb(0,"tr",44)}function Bc(t,e){1&t&&(s.Vb(0,"th",35),s.Kc(1,"Channel ID"),s.Ub())}function Nc(t,e){if(1&t&&(s.Vb(0,"td",36),s.Kc(1),s.Ub()),2&t){const t=e.$implicit,n=s.hc(2);s.oc("ngStyle",s.sc(2,Cc,n.screenSize===n.screenSizeEnum.XS?"5rem":"10rem")),s.Db(1),s.Lc(t.channelId)}}function Hc(t,e){1&t&&(s.Vb(0,"th",35),s.Kc(1,"Peer Alias"),s.Ub())}function Qc(t,e){if(1&t&&(s.Vb(0,"td",36),s.Kc(1),s.Ub()),2&t){const t=e.$implicit,n=s.hc(2);s.oc("ngStyle",s.sc(2,Cc,n.screenSize===n.screenSizeEnum.XS?"5rem":"10rem")),s.Db(1),s.Lc(t.alias)}}function qc(t,e){1&t&&(s.Vb(0,"th",37),s.Kc(1,"Events"),s.Ub())}function jc(t,e){if(1&t&&(s.Vb(0,"td",38),s.Vb(1,"span",39),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&t){const t=e.$implicit;s.Db(2),s.Lc(s.jc(3,1,t.events))}}function _c(t,e){1&t&&(s.Vb(0,"th",37),s.Kc(1,"Amount (Sats)"),s.Ub())}function $c(t,e){if(1&t&&(s.Vb(0,"td",38),s.Vb(1,"span",39),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&t){const t=e.$implicit;s.Db(2),s.Lc(s.jc(3,1,t.totalAmount))}}function Jc(t,e){1&t&&(s.Vb(0,"th",37),s.Kc(1,"Fee (Sats)"),s.Ub())}function Gc(t,e){if(1&t&&(s.Vb(0,"td",38),s.Vb(1,"span",39),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Ub()),2&t){const t=e.$implicit;s.Db(2),s.Lc(s.jc(3,1,t.totalFee))}}function Xc(t,e){1&t&&(s.Vb(0,"p"),s.Kc(1,"No outgoing routing peer available."),s.Ub())}function Wc(t,e){if(1&t&&(s.Vb(0,"td",40),s.Ic(1,Xc,2,0,"p",41),s.Ub()),2&t){const t=s.hc(2);s.Db(1),s.oc("ngIf",!(null!=t.RoutingPeersOutgoing&&t.RoutingPeersOutgoing.data)||(null==t.RoutingPeersOutgoing||null==t.RoutingPeersOutgoing.data?null:t.RoutingPeersOutgoing.data.length)<1)}}function Yc(t,e){if(1&t&&s.Qb(0,"tr",42),2&t){const t=s.hc(2);s.oc("ngClass",s.sc(1,Kc,(null==t.RoutingPeersOutgoing?null:t.RoutingPeersOutgoing.data)&&(null==t.RoutingPeersOutgoing||null==t.RoutingPeersOutgoing.data?null:t.RoutingPeersOutgoing.data.length)>0))}}function Zc(t,e){1&t&&s.Qb(0,"tr",43)}function tl(t,e){1&t&&s.Qb(0,"tr",44)}const el=function(t,e){return{"mt-2":t,"mt-1":e}},nl=function(){return["no_incoming_event"]},al=function(t){return{"mt-2":t}},il=function(){return["no_outgoing_event"]};function ol(t,e){if(1&t){const t=s.Wb();s.Vb(0,"div",4),s.Vb(1,"div",5),s.Vb(2,"div",6),s.Vb(3,"div",7),s.Kc(4,"Incoming"),s.Ub(),s.Vb(5,"mat-form-field",8),s.Vb(6,"input",9),s.dc("keyup",function(e){return s.zc(t),s.hc().applyIncomingFilter(e.target)}),s.Ub(),s.Ub(),s.Ub(),s.Vb(7,"div",10),s.Vb(8,"table",11,12),s.Tb(10,13),s.Ic(11,Dc,2,0,"th",14),s.Ic(12,Vc,2,4,"td",15),s.Sb(),s.Tb(13,16),s.Ic(14,Uc,2,0,"th",14),s.Ic(15,Ic,2,4,"td",15),s.Sb(),s.Tb(16,17),s.Ic(17,Lc,2,0,"th",18),s.Ic(18,Ac,4,3,"td",19),s.Sb(),s.Tb(19,20),s.Ic(20,Pc,2,0,"th",18),s.Ic(21,Fc,4,3,"td",19),s.Sb(),s.Tb(22,21),s.Ic(23,kc,2,0,"th",18),s.Ic(24,Oc,4,3,"td",19),s.Sb(),s.Tb(25,22),s.Ic(26,Rc,2,1,"td",23),s.Sb(),s.Ic(27,Mc,1,3,"tr",24),s.Ic(28,zc,1,0,"tr",25),s.Ic(29,Ec,1,0,"tr",26),s.Ub(),s.Ub(),s.Qb(30,"mat-paginator",27,28),s.Ub(),s.Vb(32,"div",29),s.Vb(33,"div",6),s.Vb(34,"div",7),s.Kc(35,"Outgoing"),s.Ub(),s.Vb(36,"mat-form-field",8),s.Vb(37,"input",9),s.dc("keyup",function(e){return s.zc(t),s.hc().applyOutgoingFilter(e.target)}),s.Ub(),s.Ub(),s.Ub(),s.Vb(38,"div",30),s.Vb(39,"table",31,32),s.Tb(41,13),s.Ic(42,Bc,2,0,"th",14),s.Ic(43,Nc,2,4,"td",15),s.Sb(),s.Tb(44,16),s.Ic(45,Hc,2,0,"th",14),s.Ic(46,Qc,2,4,"td",15),s.Sb(),s.Tb(47,17),s.Ic(48,qc,2,0,"th",18),s.Ic(49,jc,4,3,"td",19),s.Sb(),s.Tb(50,20),s.Ic(51,_c,2,0,"th",18),s.Ic(52,$c,4,3,"td",19),s.Sb(),s.Tb(53,21),s.Ic(54,Jc,2,0,"th",18),s.Ic(55,Gc,4,3,"td",19),s.Sb(),s.Tb(56,33),s.Ic(57,Wc,2,1,"td",23),s.Sb(),s.Ic(58,Yc,1,3,"tr",24),s.Ic(59,Zc,1,0,"tr",25),s.Ic(60,tl,1,0,"tr",26),s.Ub(),s.Qb(61,"mat-paginator",27,34),s.Ub(),s.Ub(),s.Ub()}if(2&t){const t=s.hc();s.Db(2),s.oc("ngClass",s.tc(18,el,t.screenSize===t.screenSizeEnum.XS,t.screenSize===t.screenSizeEnum.SM)),s.Db(6),s.oc("dataSource",t.RoutingPeersIncoming),s.Db(19),s.oc("matFooterRowDef",s.rc(21,nl)),s.Db(1),s.oc("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),s.Db(1),s.oc("matRowDefColumns",t.displayedColumns),s.Db(1),s.oc("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS),s.Db(3),s.oc("ngClass",s.sc(22,al,t.screenSize!==t.screenSizeEnum.LG)),s.Db(6),s.oc("dataSource",t.RoutingPeersOutgoing),s.Db(19),s.oc("matFooterRowDef",s.rc(24,il)),s.Db(1),s.oc("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),s.Db(1),s.oc("matRowDefColumns",t.displayedColumns),s.Db(1),s.oc("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS)}}const sl=function(t){return{"error-border":t,"padding-gap":!0}};let cl=(()=>{class t{constructor(t,e,n,a){this.logger=t,this.commonService=e,this.store=n,this.actions$=a,this.routingPeersData=[],this.errorMessage="",this.displayedColumns=[],this.flgSticky=!1,this.pageSize=p.p,this.pageSizeOptions=p.q,this.screenSize="",this.screenSizeEnum=p.s,this.unSubs=[new d.a,new d.a,new d.a],this.screenSize=this.commonService.getScreenSize(),this.screenSize===p.s.XS?(this.flgSticky=!1,this.displayedColumns=["alias","totalFee"]):this.screenSize===p.s.SM?(this.flgSticky=!1,this.displayedColumns=["alias","events","totalFee"]):this.screenSize===p.s.MD?(this.flgSticky=!1,this.displayedColumns=["alias","events","totalAmount","totalFee"]):(this.flgSticky=!0,this.displayedColumns=["channelId","alias","events","totalAmount","totalFee"])}ngOnInit(){this.store.select("ecl").pipe(Object(u.a)(this.unSubs[0])).subscribe(t=>{this.errorMessage="",t.effectErrors.forEach(t=>{"FetchPayments"===t.action&&(this.errorMessage="object"==typeof t.message?JSON.stringify(t.message):t.message)}),this.routingPeersData=t.payments&&t.payments.relayed?t.payments.relayed:[],this.routingPeersData.length>0&&this.sortIn&&this.paginatorIn&&this.sortOut&&this.paginatorOut&&this.loadRoutingPeersTable(this.routingPeersData),this.logger.info(t)})}ngAfterViewInit(){this.routingPeersData.length>0&&this.sortIn&&this.paginatorIn&&this.sortOut&&this.paginatorOut&&this.loadRoutingPeersTable(this.routingPeersData)}loadRoutingPeersTable(t){if(t.length>0){const e=this.groupRoutingPeers(t);this.RoutingPeersIncoming=new it.o(e[0]),this.RoutingPeersIncoming.sort=this.sortIn,this.RoutingPeersIncoming.filterPredicate=(t,e)=>JSON.stringify(t).toLowerCase().includes(e),this.RoutingPeersIncoming.paginator=this.paginatorIn,this.logger.info(this.RoutingPeersIncoming),this.RoutingPeersOutgoing=new it.o(e[1]),this.RoutingPeersOutgoing.sort=this.sortOut,this.RoutingPeersOutgoing.filterPredicate=(t,e)=>JSON.stringify(t).toLowerCase().includes(e),this.RoutingPeersOutgoing.paginator=this.paginatorOut,this.logger.info(this.RoutingPeersOutgoing)}else this.RoutingPeersIncoming=new it.o([]),this.RoutingPeersOutgoing=new it.o([])}groupRoutingPeers(t){const e=[],n=[];return t.forEach(t=>{const a=e.find(e=>e.channelId===t.fromChannelId),i=n.find(e=>e.channelId===t.toChannelId);a?(a.events++,a.totalAmount=+a.totalAmount+ +t.amountIn,a.totalFee=t.amountIn-t.amountOut+ +a.totalFee):e.push({channelId:t.fromChannelId,alias:t.fromChannelAlias,events:1,totalAmount:+t.amountIn,totalFee:t.amountIn-t.amountOut}),i?(i.events++,i.totalAmount=+i.totalAmount+ +t.amountOut,i.totalFee=t.amountIn-t.amountOut+ +i.totalFee):n.push({channelId:t.toChannelId,alias:t.toChannelAlias,events:1,totalAmount:+t.amountOut,totalFee:t.amountIn-t.amountOut})}),[this.commonService.sortDescByKey(e,"totalFee"),this.commonService.sortDescByKey(n,"totalFee")]}applyIncomingFilter(t){this.RoutingPeersIncoming.filter=t.value.trim().toLowerCase()}applyOutgoingFilter(t){this.RoutingPeersOutgoing.filter=t.value.trim().toLowerCase()}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(y.b),s.Pb(S.a),s.Pb(x.h),s.Pb(v.a))},t.\u0275cmp=s.Jb({type:t,selectors:[["rtl-ecl-routing-peers"]],viewQuery:function(t,e){if(1&t&&(s.Pc(at.a,!0),s.Pc(xc,!0,at.a),s.Pc(vc,!0),s.Pc(Sc,!0)),2&t){let t;s.vc(t=s.ec())&&(e.sortIn=t.first),s.vc(t=s.ec())&&(e.sortOut=t.first),s.vc(t=s.ec())&&(e.paginatorIn=t.first),s.vc(t=s.ec())&&(e.paginatorOut=t.first)}},features:[s.Cb([{provide:nt.b,useValue:Object(p.B)("Peers")}])],decls:3,vars:5,consts:[["fxLayout","column","fxLayoutAlign","start stretch",3,"ngClass"],["class","p-2",4,"ngIf"],["fxLayout","column","fxLayout.gt-md","row","fxFlex","100","fxLayoutAlign","space-between stretch","class","page-sub-title-container",4,"ngIf"],[1,"p-2"],["fxLayout","column","fxLayout.gt-md","row","fxFlex","100","fxLayoutAlign","space-between stretch",1,"page-sub-title-container"],["fxLayout","column","fxFlex","49","fxLayoutAlign","start end",1,"mb-6"],["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"],["matInput","","placeholder","Filter",3,"keyup"],["fxLayout","row","fxLayoutAlign","start start","fxFlex","100",1,"table-container","w-100",3,"perfectScrollbar"],["mat-table","","matSort","","fxFlex","100",1,"overflow-auto","incoming-table",3,"dataSource"],["tableIn",""],["matColumnDef","channelId"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","alias"],["matColumnDef","events"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["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","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["paginatorIn",""],["fxLayout","column","fxFlex","49","fxLayoutAlign","start start"],["fxLayout","row wrap","fxLayoutAlign","end start","fxFlex","100",1,"table-container","w-100",3,"perfectScrollbar"],["mat-table","","matSort","","fxFlex","100",1,"overflow-auto","outgoing-table",3,"dataSource"],["tableOut",""],["matColumnDef","no_outgoing_event"],["paginatorOut",""],["mat-header-cell","","mat-sort-header",""],["mat-cell","",3,"ngStyle"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["mat-cell",""],["fxLayoutAlign","end center"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(t,e){1&t&&(s.Vb(0,"div",0),s.Ic(1,wc,2,1,"div",1),s.Ic(2,ol,63,25,"div",2),s.Ub()),2&t&&(s.oc("ngClass",s.sc(3,sl,""!==e.errorMessage)),s.Db(1),s.oc("ngIf",""!==e.errorMessage),s.Db(1),s.oc("ngIf",""===e.errorMessage))},directives:[c.c,c.b,a.m,L.a,a.o,c.a,R.c,lt.b,z.b,it.n,at.a,it.c,it.i,it.b,it.e,it.g,it.k,it.m,nt.a,it.h,at.b,it.a,a.p,L.b,it.d,it.f,it.j,it.l],pipes:[a.f],styles:[".mat-column-alias[_ngcontent-%COMP%], .mat-column-channelId[_ngcontent-%COMP%]{flex:1 1 10%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),t})();function ll(t,e){if(1&t){const t=s.Wb();s.Vb(0,"div",7),s.dc("click",function(){s.zc(t);const n=e.$implicit;return s.hc().activeLink=n.link}),s.Kc(1),s.Ub()}if(2&t){const t=e.$implicit,n=s.hc();s.pc("routerLink",t.link),s.oc("active",n.activeLink===t.link),s.Db(1),s.Lc(t.name)}}let rl=(()=>{class t{constructor(t){this.router=t,this.faChartBar=f.f,this.links=[{link:"routingfees",name:"Routing Fees"},{link:"transactions",name:"Transactions"}],this.activeLink=this.links[0].link,this.unSubs=[new d.a,new d.a,new d.a,new d.a]}ngOnInit(){let t=this.links.find(t=>this.router.url.includes(t.link));this.activeLink=t?t.link:this.links[0].link,this.router.events.pipe(Object(u.a)(this.unSubs[0]),Object(h.a)(t=>t instanceof i.f)).subscribe(t=>{let e=this.links.find(e=>t.urlAfterRedirects.includes(e.link));this.activeLink=e?e.link:this.links[0].link})}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(i.g))},t.\u0275cmp=s.Jb({type:t,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(t,e){1&t&&(s.Vb(0,"div",0),s.Qb(1,"fa-icon",1),s.Vb(2,"span",2),s.Kc(3,"Reports"),s.Ub(),s.Ub(),s.Vb(4,"div",3),s.Vb(5,"mat-card"),s.Vb(6,"mat-card-content",4),s.Vb(7,"nav",5),s.Ic(8,ll,2,3,"div",6),s.Ub(),s.Qb(9,"router-outlet"),s.Ub(),s.Ub(),s.Ub()),2&t&&(s.Db(1),s.oc("icon",e.faChartBar),s.Db(7),s.oc("ngForOf",e.links))},directives:[c.c,c.b,w.a,C.a,C.b,et.e,a.n,i.l,et.d,i.h],styles:[""]}),t})();var bl=n("2yzq"),dl=n("LQLF"),ul=n("Lnru");function hl(t,e){if(1&t&&(s.Vb(0,"div",8),s.Kc(1),s.ic(2,"number"),s.ic(3,"number"),s.Ub()),2&t){const t=s.hc();s.oc("@fadeIn",t.totalFeeSat),s.Db(1),s.Nc("",s.kc(2,3,t.totalFeeSat||0,"1.0-0")," Sats/",s.jc(3,6,t.filteredEventsBySelectedPeriod.length||0)," Events")}}function ml(t,e){1&t&&(s.Vb(0,"div",9),s.Kc(1,"No fee report for the selected period"),s.Ub())}function fl(t,e){if(1&t&&(s.Vb(0,"span"),s.Vb(1,"span",12),s.Kc(2),s.ic(3,"number"),s.Ub(),s.Vb(4,"span",12),s.Kc(5),s.ic(6,"number"),s.Ub(),s.Ub()),2&t){const t=e.model;s.Db(2),s.Mc("Events: ",s.jc(3,2,t.extra.totalEvents||0),""),s.Db(3),s.Mc("Fee: ",s.kc(6,4,t.value||0,"1.0-0"),"")}}function pl(t,e){if(1&t){const t=s.Wb();s.Vb(0,"ngx-charts-bar-vertical",10),s.dc("select",function(e){return s.zc(t),s.hc().onChartBarSelected(e)})("mouseup",function(e){return s.zc(t),s.hc().onChartMouseUp(e)}),s.Ic(1,fl,7,7,"ng-template",null,11,s.Jc),s.Ub()}if(2&t){const t=s.hc();s.oc("view",t.view)("results",t.feeReportData)("gradient",!1)("xAxis",!0)("yAxis",!0)("showXAxisLabel",!0)("showYAxisLabel",t.showYAxisLabel)("xAxisLabel",t.xAxisLabel)("yAxisLabel",t.yAxisLabel)("showGridLines",!1)("showDataLabel",!1)}}function gl(t,e){if(1&t&&s.Qb(0,"rtl-ecl-forwarding-history",13),2&t){const t=s.hc();s.oc("eventsData",t.filteredEventsBySelectedPeriod)("filterValue",t.eventFilterValue)}}let yl=(()=>{class t{constructor(t,e,n,a){this.logger=t,this.dataService=e,this.commonService=n,this.store=a,this.reportPeriod=p.r[0],this.secondsInADay=86400,this.events=[],this.filteredEventsBySelectedPeriod=[],this.eventFilterValue="",this.totalFeeSat=null,this.today=new Date(Date.now()),this.timezoneOffset=60*this.today.getTimezoneOffset(),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.feeReportData=[],this.view=[350,350],this.screenPaddingX=100,this.gradient=!0,this.xAxisLabel="Date",this.yAxisLabel="Fee (Sats)",this.showYAxisLabel=!0,this.screenSize="",this.screenSizeEnum=p.s,this.unSubs=[new d.a,new d.a]}ngOnInit(){this.screenSize=this.commonService.getScreenSize(),this.showYAxisLabel=!(this.screenSize===p.s.XS||this.screenSize===p.s.SM),this.store.select("ecl").pipe(Object(u.a)(this.unSubs[0])).subscribe(t=>{this.events=t.payments&&t.payments.relayed?t.payments.relayed:[],this.filterForwardingEvents(this.startDate,this.endDate),this.logger.info(t)})}ngAfterViewInit(){const t=this.commonService.getContainerSize();switch(this.screenSize){case p.s.MD:this.screenPaddingX=t.width/10;break;case p.s.LG:this.screenPaddingX=t.width/16;break;default:this.screenPaddingX=t.width/20}this.view=[t.width-this.screenPaddingX,t.height/2.2]}filterForwardingEvents(t,e){const n=Math.round(t.getTime()/1e3)-this.timezoneOffset,a=Math.round(e.getTime()/1e3)-this.timezoneOffset;this.filteredEventsBySelectedPeriod=[],this.feeReportData=[],this.totalFeeSat=null,this.events&&this.events.length>0&&(this.events.forEach(t=>{Math.floor(t.timestamp/1e3)>=n&&Math.floor(t.timestamp/1e3)<a&&this.filteredEventsBySelectedPeriod.push(t)}),this.feeReportData=this.prepareFeeReport(t))}onChartMouseUp(t){"svg"===t.srcElement.tagName&&t.srcElement.classList.length>0&&"ngx-charts"===t.srcElement.classList[0]&&(this.eventFilterValue="")}onChartBarSelected(t){this.eventFilterValue=this.reportPeriod===p.r[1]?t.name.toUpperCase()+"/"+this.startDate.getFullYear():t.name.toString().padStart(2,"0")+"/"+p.n[this.startDate.getMonth()].name.toUpperCase()+"/"+this.startDate.getFullYear()}prepareFeeReport(t){const e=Math.round(t.getTime()/1e3)-this.timezoneOffset;let n=[];if(this.reportPeriod===p.r[1]){for(let t=0;t<12;t++)n.push({name:p.n[t].name,value:1e-9,extra:{totalEvents:0}});this.filteredEventsBySelectedPeriod.map(t=>{let e=new Date(t.timestamp+1e3*this.timezoneOffset).getMonth();n[e].value=n[e].value+(t.amountIn-t.amountOut),n[e].extra.totalEvents=n[e].extra.totalEvents+1,this.totalFeeSat=(this.totalFeeSat?this.totalFeeSat:0)+(t.amountIn-t.amountOut)})}else{for(let e=0;e<this.getMonthDays(t.getMonth(),t.getFullYear());e++)n.push({name:e+1,value:1e-9,extra:{totalEvents:0}});this.filteredEventsBySelectedPeriod.map(t=>{let a=Math.floor((Math.floor(t.timestamp/1e3)-e)/this.secondsInADay);n[a].value=n[a].value+(t.amountIn-t.amountOut),n[a].extra.totalEvents=n[a].extra.totalEvents+1,this.totalFeeSat=(this.totalFeeSat?this.totalFeeSat:0)+(t.amountIn-t.amountOut)})}return n}onSelectionChange(t){const e=t.selDate.getMonth(),n=t.selDate.getFullYear();this.reportPeriod=t.selScrollRange,this.reportPeriod===p.r[1]?(this.startDate=new Date(n,0,1,0,0,0),this.endDate=new Date(n,11,31,23,59,59)):(this.startDate=new Date(n,e,1,0,0,0),this.endDate=new Date(n,e,this.getMonthDays(e,n),23,59,59)),this.filterForwardingEvents(this.startDate,this.endDate),this.eventFilterValue=""}getMonthDays(t,e){return 1===t&&e%4==0?p.n[t].days+1:p.n[t].days}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(y.b),s.Pb(ne.a),s.Pb(S.a),s.Pb(x.h))},t.\u0275cmp=s.Jb({type:t,selectors:[["rtl-ecl-fee-report"]],hostBindings:function(t,e){1&t&&s.dc("mouseup",function(t){return e.onChartMouseUp(t)})},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","one-color",3,"view","results","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","select","mouseup",4,"ngIf"],[3,"eventsData","filterValue",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,"eventsData","filterValue"]],template:function(t,e){1&t&&(s.Vb(0,"div",0),s.Vb(1,"rtl-horizontal-scroller",1),s.dc("stepChanged",function(t){return e.onSelectionChange(t)}),s.Ub(),s.Vb(2,"div",2),s.Ic(3,hl,4,8,"div",3),s.Ic(4,ml,2,0,"div",4),s.Vb(5,"div",5),s.Ic(6,pl,3,11,"ngx-charts-bar-vertical",6),s.Ub(),s.Vb(7,"div",5),s.Ic(8,gl,1,2,"rtl-ecl-forwarding-history",7),s.Ub(),s.Ub(),s.Ub()),2&t&&(s.Db(3),s.oc("ngIf",e.feeReportData.length>0&&e.filteredEventsBySelectedPeriod.length>0),s.Db(1),s.oc("ngIf",e.feeReportData.length<=0||e.filteredEventsBySelectedPeriod.length<=0),s.Db(2),s.oc("ngIf",e.feeReportData.length>0&&e.filteredEventsBySelectedPeriod.length>0),s.Db(2),s.oc("ngIf",e.filteredEventsBySelectedPeriod.length>0))},directives:[c.c,c.b,c.a,dl.a,a.o,ul.b,yc],pipes:[a.f],styles:[""],data:{animation:[bl.a]}}),t})();var xl=n("d4ms");function vl(t,e){if(1&t&&(s.Vb(0,"div",10),s.Kc(1),s.ic(2,"number"),s.ic(3,"number"),s.Ub()),2&t){const t=s.hc(2);s.Db(1),s.Nc(" Paid ",s.kc(2,2,t.transactionsReportSummary.amountPaidSelectedPeriod||0,"1.0-0")," Sats/",s.jc(3,5,t.transactionsReportSummary.paymentsSelectedPeriod)," Payments ")}}function Sl(t,e){if(1&t&&(s.Vb(0,"div",10),s.Kc(1),s.ic(2,"number"),s.ic(3,"number"),s.Ub()),2&t){const t=s.hc(2);s.Db(1),s.Nc(" Received ",s.kc(2,2,t.transactionsReportSummary.amountReceivedSelectedPeriod||0,"1.0-0")," Sats/",s.jc(3,5,t.transactionsReportSummary.invoicesSelectedPeriod)," Invoices ")}}function wl(t,e){if(1&t&&(s.Vb(0,"div",8),s.Ic(1,vl,4,7,"div",9),s.Ic(2,Sl,4,7,"div",9),s.Ub()),2&t){const t=s.hc();s.oc("@fadeIn",t.transactionsReportSummary),s.Db(1),s.oc("ngIf",t.transactionsReportSummary.paymentsSelectedPeriod),s.Db(1),s.oc("ngIf",t.transactionsReportSummary.invoicesSelectedPeriod)}}function Dl(t,e){1&t&&(s.Vb(0,"div",11),s.Kc(1,"No transactions report for the selected period"),s.Ub())}function Cl(t,e){if(1&t&&(s.Vb(0,"span",14),s.Kc(1),s.ic(2,"number"),s.ic(3,"number"),s.Ub()),2&t){const t=e.model;s.Db(1),s.Oc("",t.name,": ",s.kc(2,4,t.value||0,"1.0-0"),"/# ","Paid"===t.name?"Payments":"Invoices",": ",s.jc(3,7,(null==t.extra?null:t.extra.total)||0),"")}}function Vl(t,e){if(1&t){const t=s.Wb();s.Vb(0,"ngx-charts-bar-vertical-2d",12),s.dc("select",function(e){return s.zc(t),s.hc().onChartBarSelected(e)})("mouseup",function(e){return s.zc(t),s.hc().onChartMouseUp(e)}),s.Ic(1,Cl,4,9,"ng-template",null,13,s.Jc),s.Ub()}if(2&t){const t=s.hc();s.oc("view",t.view)("results",t.transactionsReportData)("noBarWhenZero",!1)("gradient",!1)("xAxis",!0)("yAxis",!0)("showXAxisLabel",!0)("showYAxisLabel",t.showYAxisLabel)("xAxisLabel",t.xAxisLabel)("yAxisLabel",t.yAxisLabel)("showGridLines",!1)("showDataLabel",!1)("groupPadding",t.reportPeriod===t.scrollRanges[0]?2:8)}}function Ul(t,e){if(1&t&&s.Qb(0,"rtl-transactions-report-table",15),2&t){const t=s.hc();s.oc("dataList",t.transactionsNonZeroReportData)("dataRange",t.reportPeriod)("filterValue",t.transactionFilterValue)}}let Il=(()=>{class t{constructor(t,e,n){this.dataService=t,this.commonService=e,this.store=n,this.scrollRanges=p.r,this.reportPeriod=p.r[0],this.secondsInADay=86400,this.payments=[],this.invoices=[],this.transactionsReportSummary={paymentsSelectedPeriod:0,invoicesSelectedPeriod:0,amountPaidSelectedPeriod:0,amountReceivedSelectedPeriod:0},this.transactionFilterValue="",this.today=new Date(Date.now()),this.timezoneOffset=60*this.today.getTimezoneOffset(),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=p.s,this.unSubs=[new d.a,new d.a]}ngOnInit(){this.screenSize=this.commonService.getScreenSize(),this.showYAxisLabel=!(this.screenSize===p.s.XS||this.screenSize===p.s.SM),this.store.select("ecl").pipe(Object(u.a)(this.unSubs[0])).subscribe(t=>{"COMPLETE"===t.initialAPIResponseStatus[0]&&this.dataService.getTransactionsForReport().pipe(Object(u.a)(this.unSubs[1])).subscribe(t=>{this.payments=t.payments.sent,this.invoices=t.invoices,this.transactionsReportData=this.filterTransactionsForSelectedPeriod(this.startDate,this.endDate),this.transactionsNonZeroReportData=this.prepareTableData()})})}ngAfterViewInit(){const t=this.commonService.getContainerSize();switch(this.screenSize){case p.s.MD:this.screenPaddingX=t.width/10;break;case p.s.LG:this.screenPaddingX=t.width/16;break;default:this.screenPaddingX=t.width/20}this.view=[t.width-this.screenPaddingX,t.height/2.2]}onChartMouseUp(t){"svg"===t.srcElement.tagName&&t.srcElement.classList.length>0&&"ngx-charts"===t.srcElement.classList[0]&&(this.transactionFilterValue="")}onChartBarSelected(t){this.transactionFilterValue=this.reportPeriod===p.r[1]?t.series.toUpperCase()+"/"+this.startDate.getFullYear():t.series.toString().padStart(2,"0")+"/"+p.n[this.startDate.getMonth()].name.toUpperCase()+"/"+this.startDate.getFullYear()}filterTransactionsForSelectedPeriod(t,e){const n=Math.round(t.getTime()/1e3)-this.timezoneOffset,a=Math.round(e.getTime()/1e3)-this.timezoneOffset;let i=[];this.transactionsReportSummary={paymentsSelectedPeriod:0,invoicesSelectedPeriod:0,amountPaidSelectedPeriod:0,amountReceivedSelectedPeriod:0};let o=this.payments.filter(t=>Math.floor(t.firstPartTimestamp/1e3)>=n&&Math.floor(t.firstPartTimestamp/1e3)<a),s=this.invoices.filter(t=>"received"===t.status&&t.timestamp>=n&&t.timestamp<a);if(this.transactionsReportSummary.paymentsSelectedPeriod=o.length,this.transactionsReportSummary.invoicesSelectedPeriod=s.length,this.reportPeriod===p.r[1]){for(let e=0;e<12;e++)i.push({name:p.n[e].name,date:new Date(t.getFullYear(),e,1,0,0,0,0),series:[{name:"Paid",value:0,extra:{total:0}},{name:"Received",value:0,extra:{total:0}}]});o.map(t=>{let e=new Date(t.firstPartTimestamp+1e3*this.timezoneOffset).getMonth();this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+t.recipientAmount,i[e].series[0].value=i[e].series[0].value+t.recipientAmount,i[e].series[0].extra.total=i[e].series[0].extra.total+1}),s.map(t=>{let e=new Date(1e3*(t.timestamp+this.timezoneOffset)).getMonth();this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+t.amountSettled,i[e].series[1].value=i[e].series[1].value+t.amountSettled,i[e].series[1].extra.total=i[e].series[1].extra.total+1})}else{for(let e=0;e<this.getMonthDays(t.getMonth(),t.getFullYear());e++)i.push({name:(e+1).toString(),date:new Date(1e3*((e+1)*this.secondsInADay+n)),series:[{name:"Paid",value:0,extra:{total:0}},{name:"Received",value:0,extra:{total:0}}]});o.map(t=>{let e=Math.floor((Math.floor(t.firstPartTimestamp/1e3)-n)/this.secondsInADay);this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+t.recipientAmount,i[e].series[0].value=i[e].series[0].value+t.recipientAmount,i[e].series[0].extra.total=i[e].series[0].extra.total+1}),s.map(t=>{let e=Math.floor((t.timestamp-n)/this.secondsInADay);this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+t.amountSettled,i[e].series[1].value=i[e].series[1].value+t.amountSettled,i[e].series[1].extra.total=i[e].series[1].extra.total+1})}return i}prepareTableData(){return this.transactionsReportData.reduce((t,e)=>e.series[0].value>0||e.series[1].value>0?t.concat({date:e.date,date_str:this.commonService.convertTimestampToDate(e.date.getTime()/1e3),amount_paid:e.series[0].value,num_payments:e.series[0].extra.total,amount_received:e.series[1].value,num_invoices:e.series[1].extra.total}):t,[])}onSelectionChange(t){const e=t.selDate.getMonth(),n=t.selDate.getFullYear();this.reportPeriod=t.selScrollRange,this.reportPeriod===p.r[1]?(this.startDate=new Date(n,0,1,0,0,0),this.endDate=new Date(n,11,31,23,59,59)):(this.startDate=new Date(n,e,1,0,0,0),this.endDate=new Date(n,e,this.getMonthDays(e,n),23,59,59)),this.transactionsReportData=this.filterTransactionsForSelectedPeriod(this.startDate,this.endDate),this.transactionsNonZeroReportData=this.prepareTableData(),this.transactionFilterValue=""}getMonthDays(t,e){return 1===t&&e%4==0?p.n[t].days+1:p.n[t].days}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(),t.complete()})}}return t.\u0275fac=function(e){return new(e||t)(s.Pb(ne.a),s.Pb(S.a),s.Pb(x.h))},t.\u0275cmp=s.Jb({type:t,selectors:[["rtl-ecl-transactions-report"]],hostBindings:function(t,e){1&t&&s.dc("mouseup",function(t){return e.onChartMouseUp(t)})},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,"dataList","dataRange","filterValue",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,"dataList","dataRange","filterValue"]],template:function(t,e){1&t&&(s.Vb(0,"div",0),s.Vb(1,"rtl-horizontal-scroller",1),s.dc("stepChanged",function(t){return e.onSelectionChange(t)}),s.Ub(),s.Vb(2,"div",2),s.Ic(3,wl,3,3,"div",3),s.Ic(4,Dl,2,0,"div",4),s.Vb(5,"div",5),s.Ic(6,Vl,3,13,"ngx-charts-bar-vertical-2d",6),s.Ub(),s.Vb(7,"div",5),s.Ic(8,Ul,1,3,"rtl-transactions-report-table",7),s.Ub(),s.Ub(),s.Ub()),2&t&&(s.Db(3),s.oc("ngIf",e.transactionsNonZeroReportData.length>0),s.Db(1),s.oc("ngIf",e.transactionsNonZeroReportData.length<=0),s.Db(2),s.oc("ngIf",e.transactionsNonZeroReportData.length>0),s.Db(2),s.oc("ngIf",e.transactionsNonZeroReportData.length>0))},directives:[c.c,c.b,c.a,dl.a,a.o,ul.a,xl.a],pipes:[a.f],styles:[""],data:{animation:[bl.a]}}),t})();var Ll=n("2h+y"),Al=n("0dfH");const Pl=i.k.forChild([{path:"",component:b,children:[{path:"",pathMatch:"full",redirectTo:"home"},{path:"home",component:kn,canActivate:[Ll.c]},{path:"onchain",component:ha,canActivate:[Ll.c],children:[{path:"",pathMatch:"full",redirectTo:"receive"},{path:"receive",component:ja,canActivate:[Ll.c]},{path:"send",component:_a,canActivate:[Ll.c]}]},{path:"connections",component:ga,canActivate:[Ll.c],children:[{path:"",pathMatch:"full",redirectTo:"channels"},{path:"channels",component:mi,canActivate:[Ll.c],children:[{path:"",pathMatch:"full",redirectTo:"open"},{path:"open",component:Wi,canActivate:[Ll.c]},{path:"pending",component:yo,canActivate:[Ll.c]},{path:"inactive",component:js,canActivate:[Ll.c]}]},{path:"peers",component:is,data:{sweepAll:!1},canActivate:[Ll.c]}]},{path:"transactions",component:xa,canActivate:[Ll.c],children:[{path:"",pathMatch:"full",redirectTo:"payments"},{path:"payments",component:cn,canActivate:[Ll.c]},{path:"invoices",component:Yt,canActivate:[Ll.c]},{path:"queryroutes",component:ys,canActivate:[Ll.c]}]},{path:"routing",component:Sa,canActivate:[Ll.c],children:[{path:"",pathMatch:"full",redirectTo:"forwardinghistory"},{path:"forwardinghistory",component:yc,canActivate:[Ll.c]},{path:"peers",component:cl,canActivate:[Ll.c]}]},{path:"reports",component:rl,canActivate:[Ll.c],children:[{path:"",pathMatch:"full",redirectTo:"routingfees"},{path:"routingfees",component:yl,canActivate:[Ll.c]},{path:"transactions",component:Il,canActivate:[Ll.c]}]},{path:"lookups",component:Qa,canActivate:[Ll.c]},{path:"**",component:Al.a}]}]);var Fl=n("PCNd");let kl=(()=>{class t{}return t.\u0275mod=s.Nb({type:t,bootstrap:[b]}),t.\u0275inj=s.Mb({factory:function(e){return new(e||t)},providers:[Ll.c],imports:[[a.c,Fl.a,Pl]]}),t})()}}]);