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/frontend/258.b942aa0687c5b72c.js

1 line
336 KiB
JavaScript

"use strict";(self.webpackChunkRTLApp=self.webpackChunkRTLApp||[]).push([[258],{7258:(Rp,ft,f)=>{f.r(ft),f.d(ft,{ECLModule:()=>Up});var u=f(6895),y=f(9116),Bt=f(8878),t=f(4650),m=f(1576),Q=f(3162);function Ht(n,a){1&n&&t._UZ(0,"mat-progress-bar",3)}let Ct=(()=>{class n{constructor(e){this.router=e,this.loading=!1,this.router.events.subscribe(i=>{switch(!0){case i instanceof y.OD:this.loading=!0;break;case i instanceof y.m2:case i instanceof y.gk:case i instanceof y.Q3:this.loading=!1}})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(y.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-root"]],decls:4,vars:1,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"inner-sidenav-content"],["color","primary","mode","indeterminate",4,"ngIf"],["outlet","outlet"],["color","primary","mode","indeterminate"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.YNc(1,Ht,1,0,"mat-progress-bar",1),t._UZ(2,"router-outlet",null,2),t.qZA()),2&e&&(t.xp6(1),t.Q6J("ngIf",i.loading))},dependencies:[u.O5,m.xw,m.Wh,m.yH,Q.pW,y.lC],data:{animation:[Bt.g]}}),n})();var p=f(7579),_=f(2722),ot=f(1365),xt=f(3396),T=f(2687),l=f(7731),C=f(2501),R=f(5043),I=f(9653),k=f(62),P=f(2216),Z=f(5829),F=f(4859),b=f(3546),yt=f(782),vt=f(7392),st=f(8255),q=f(3848);const Tt=function(n){return{backgroundColor:n}};function zt(n,a){if(1&n&&t._UZ(0,"span",6),2&n){const e=t.oxw();t.Q6J("ngStyle",t.VKq(1,Tt,null==e.information?null:e.information.color))}}function Vt(n,a){if(1&n&&(t.TgZ(0,"div")(1,"h4",1),t._uU(2,"Color"),t.qZA(),t.TgZ(3,"div",2),t._UZ(4,"span",7),t._uU(5),t.ALo(6,"uppercase"),t.qZA()()),2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngStyle",t.VKq(4,Tt,null==e.information?null:e.information.color)),t.xp6(1),t.hij(" ",t.lcZ(6,2,null==e.information?null:e.information.color)," ")}}function Gt(n,a){if(1&n&&(t.TgZ(0,"span",2),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(e)}}let Kt=(()=>{class n{constructor(e){this.commonService=e,this.chains=[""]}ngOnChanges(){this.chains=[],this.chains.push("Bitcoin "+(this.information.network?this.commonService.titleCase(this.information.network):"Testnet"))}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(k.v))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-node-info"]],inputs:{information:"information",showColorFieldSeparately:"showColorFieldSeparately"},features:[t.TTD],decls:17,vars:5,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],[1,"dashboard-info-title"],[1,"overflow-wrap","dashboard-info-value"],["class","dashboard-node-dot dot",3,"ngStyle",4,"ngIf"],[4,"ngIf"],["class","overflow-wrap dashboard-info-value",4,"ngFor","ngForOf"],[1,"dashboard-node-dot","dot",3,"ngStyle"],[1,"dashboard-node-square",3,"ngStyle"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div")(2,"h4",1),t._uU(3,"Alias"),t.qZA(),t.TgZ(4,"div",2),t._uU(5),t.YNc(6,zt,1,3,"span",3),t.qZA()(),t.YNc(7,Vt,7,6,"div",4),t.TgZ(8,"div")(9,"h4",1),t._uU(10,"Implementation"),t.qZA(),t.TgZ(11,"div",2),t._uU(12),t.qZA()(),t.TgZ(13,"div")(14,"h4",1),t._uU(15,"Chain"),t.qZA(),t.YNc(16,Gt,2,1,"span",5),t.qZA()()),2&e&&(t.xp6(5),t.hij(" ",null==i.information?null:i.information.alias," "),t.xp6(1),t.Q6J("ngIf",!i.showColorFieldSeparately),t.xp6(1),t.Q6J("ngIf",i.showColorFieldSeparately),t.xp6(5),t.Oqu(null!=i.information&&i.information.lnImplementation||null!=i.information&&i.information.version?(null==i.information?null:i.information.lnImplementation)+" "+(null==i.information?null:i.information.version):""),t.xp6(4),t.Q6J("ngForOf",i.chains))},dependencies:[u.sg,u.O5,u.PC,m.xw,m.Wh,m.yH,Z.Zl,u.gd]}),n})();function Wt(n,a){if(1&n&&(t.TgZ(0,"div",2)(1,"div")(2,"h4",3),t._uU(3,"Lightning"),t.qZA(),t.TgZ(4,"div",4),t._uU(5),t.ALo(6,"number"),t.qZA(),t._UZ(7,"mat-progress-bar",5),t.qZA(),t.TgZ(8,"div")(9,"h4",3),t._uU(10,"On-chain"),t.qZA(),t.TgZ(11,"div",4),t._uU(12),t.ALo(13,"number"),t.qZA(),t._UZ(14,"mat-progress-bar",5),t.qZA(),t.TgZ(15,"div")(16,"h4",3),t._uU(17,"Total"),t.qZA(),t.TgZ(18,"div",4),t._uU(19),t.ALo(20,"number"),t.qZA()()()),2&n){const e=t.oxw();t.xp6(5),t.hij("",t.lcZ(6,5,e.balances.lightning)," Sats"),t.xp6(2),t.s9C("value",e.balances.lightning/e.balances.total*100),t.xp6(5),t.hij("",t.lcZ(13,7,e.balances.onchain)," Sats"),t.xp6(2),t.s9C("value",e.balances.onchain/e.balances.total*100),t.xp6(5),t.hij("",t.lcZ(20,9,e.balances.total)," Sats")}}function $t(n,a){if(1&n&&(t.TgZ(0,"div",6)(1,"p"),t._uU(2),t.qZA()()),2&n){const e=t.oxw();t.xp6(2),t.Oqu(e.errorMessage)}}let Xt=(()=>{class n{constructor(){this.balances={onchain:0,lightning:0,total:0}}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-balances-info"]],inputs:{balances:"balances",errorMessage:"errorMessage"},decls:3,vars:2,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",4,"ngIf","ngIfElse"],["errorBlock",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayoutAlign","start",1,"dashboard-info-title"],[1,"overflow-wrap","dashboard-info-value"],["mode","determinate",1,"dashboard-progress-bar",3,"value"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(e,i){if(1&e&&(t.YNc(0,Wt,21,11,"div",0),t.YNc(1,$t,3,1,"ng-template",null,1,t.W1O)),2&e){const o=t.MAs(2);t.Q6J("ngIf",""===(null==i.errorMessage?null:i.errorMessage.trim()))("ngIfElse",o)}},dependencies:[u.O5,m.xw,m.Wh,m.yH,Q.pW,u.JJ]}),n})();function jt(n,a){if(1&n&&(t.TgZ(0,"div",2)(1,"div",3)(2,"div")(3,"h4",4),t._uU(4,"Daily"),t.qZA(),t.TgZ(5,"div",5),t._uU(6),t.ALo(7,"number"),t.qZA()(),t.TgZ(8,"div")(9,"h4",4),t._uU(10,"Weekly"),t.qZA(),t.TgZ(11,"div",5),t._uU(12),t.ALo(13,"number"),t.qZA()(),t.TgZ(14,"div")(15,"h4",4),t._uU(16,"Monthly"),t.qZA(),t.TgZ(17,"div",5),t._uU(18),t.ALo(19,"number"),t.qZA()()(),t.TgZ(20,"div",3)(21,"div")(22,"h4",4),t._uU(23,"Transactions"),t.qZA(),t.TgZ(24,"div",5),t._uU(25),t.ALo(26,"number"),t.qZA()(),t.TgZ(27,"div")(28,"h4",4),t._uU(29,"Transactions"),t.qZA(),t.TgZ(30,"div",5),t._uU(31),t.ALo(32,"number"),t.qZA()(),t.TgZ(33,"div")(34,"h4",4),t._uU(35,"Transactions"),t.qZA(),t.TgZ(36,"div",5),t._uU(37),t.ALo(38,"number"),t.qZA()()()()),2&n){const e=t.oxw();t.xp6(6),t.hij("",t.lcZ(7,6,null==e.fees?null:e.fees.daily_fee)," Sats"),t.xp6(6),t.hij("",t.lcZ(13,8,null==e.fees?null:e.fees.weekly_fee)," Sats"),t.xp6(6),t.hij("",t.lcZ(19,10,null==e.fees?null:e.fees.monthly_fee)," Sats"),t.xp6(7),t.Oqu(t.lcZ(26,12,null==e.fees?null:e.fees.daily_txs)),t.xp6(6),t.Oqu(t.lcZ(32,14,null==e.fees?null:e.fees.weekly_txs)),t.xp6(6),t.Oqu(t.lcZ(38,16,null==e.fees?null:e.fees.monthly_txs))}}function te(n,a){if(1&n&&(t.TgZ(0,"div",6)(1,"p"),t._uU(2),t.qZA()()),2&n){const e=t.oxw();t.xp6(2),t.Oqu(e.errorMessage)}}let ee=(()=>{class n{constructor(){this.totalFees=[{name:"Monthly",value:0},{name:"Weekly",value:0},{name:"Daily",value:0}],this.maxFeeValue=100}ngOnChanges(){var e;if(null!==(e=this.fees)&&void 0!==e&&e.monthly_fee){this.totalFees=[{name:"Monthly",value:this.fees.monthly_fee},{name:"Weekly",value:this.fees.weekly_fee||0},{name:"Daily ",value:this.fees.daily_fee||0}];const i=Math.ceil(Math.log(this.fees.monthly_fee+1)/Math.LN10),o=Math.pow(10,i-1);this.maxFeeValue=Math.ceil(this.fees.monthly_fee/o)*o/5||100,Object.assign(this,this.totalFees)}else this.totalFees=[{name:"Monthly",value:0},{name:"Weekly",value:0},{name:"Daily",value:0}],this.maxFeeValue=100,Object.assign(this,this.totalFees)}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-fee-info"]],inputs:{fees:"fees",errorMessage:"errorMessage"},features:[t.TTD],decls:3,vars:2,consts:[["fxLayout","row","fxFlex","100","fxLayoutAlign","start stretch",4,"ngIf","ngIfElse"],["errorBlock",""],["fxLayout","row","fxFlex","100","fxLayoutAlign","start stretch"],["fxLayout","column","fxFlex","50","fxLayoutAlign","space-between stretch"],["fxLayoutAlign","start",1,"dashboard-info-title"],[1,"overflow-wrap","dashboard-info-value"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(e,i){if(1&e&&(t.YNc(0,jt,39,18,"div",0),t.YNc(1,te,3,1,"ng-template",null,1,t.W1O)),2&e){const o=t.MAs(2);t.Q6J("ngIf",""===(null==i.errorMessage?null:i.errorMessage.trim()))("ngIfElse",o)}},dependencies:[u.O5,m.xw,m.Wh,m.yH,u.JJ]}),n})();function ne(n,a){if(1&n&&(t.TgZ(0,"div",2)(1,"div",3)(2,"div")(3,"h4",4),t._uU(4,"Active"),t.qZA(),t.TgZ(5,"div",5),t._UZ(6,"span",6),t._uU(7),t.ALo(8,"number"),t.qZA()(),t.TgZ(9,"div")(10,"h4",4),t._uU(11,"Pending"),t.qZA(),t.TgZ(12,"div",5),t._UZ(13,"span",7),t._uU(14),t.ALo(15,"number"),t.qZA()(),t.TgZ(16,"div")(17,"h4",4),t._uU(18,"Inactive"),t.qZA(),t.TgZ(19,"div",5),t._UZ(20,"span",8),t._uU(21),t.ALo(22,"number"),t.qZA()()(),t.TgZ(23,"div",3)(24,"div")(25,"h4",4),t._uU(26,"Capacity"),t.qZA(),t.TgZ(27,"div",5),t._uU(28),t.ALo(29,"number"),t.qZA()(),t.TgZ(30,"div")(31,"h4",4),t._uU(32,"Capacity"),t.qZA(),t.TgZ(33,"div",5),t._uU(34),t.ALo(35,"number"),t.qZA()(),t.TgZ(36,"div")(37,"h4",4),t._uU(38,"Capacity"),t.qZA(),t.TgZ(39,"div",5),t._uU(40),t.ALo(41,"number"),t.qZA()()()()),2&n){const e=t.oxw();t.xp6(7),t.Oqu(t.lcZ(8,6,(null==e.channelsStatus.active?null:e.channelsStatus.active.channels)||0)),t.xp6(7),t.Oqu(t.lcZ(15,8,(null==e.channelsStatus.pending?null:e.channelsStatus.pending.channels)||0)),t.xp6(7),t.Oqu(t.lcZ(22,10,(null==e.channelsStatus.inactive?null:e.channelsStatus.inactive.channels)||0)),t.xp6(7),t.hij("",t.lcZ(29,12,(null==e.channelsStatus.active?null:e.channelsStatus.active.capacity)||0)," Sats"),t.xp6(6),t.hij("",t.lcZ(35,14,(null==e.channelsStatus.pending?null:e.channelsStatus.pending.capacity)||0)," Sats"),t.xp6(6),t.hij("",t.lcZ(41,16,(null==e.channelsStatus.inactive?null:e.channelsStatus.inactive.capacity)||0)," Sats")}}function ie(n,a){if(1&n&&(t.TgZ(0,"div",9)(1,"p"),t._uU(2),t.qZA()()),2&n){const e=t.oxw();t.xp6(2),t.Oqu(e.errorMessage)}}let ae=(()=>{class n{constructor(){this.channelsStatus={}}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-status-info"]],inputs:{channelsStatus:"channelsStatus",errorMessage:"errorMessage"},decls:3,vars:2,consts:[["fxLayout","row","fxFlex","100","fxLayoutAlign","start stretch",4,"ngIf","ngIfElse"],["errorBlock",""],["fxLayout","row","fxFlex","100","fxLayoutAlign","start stretch"],["fxLayout","column","fxFlex","50","fxLayoutAlign","space-between stretch"],["fxLayoutAlign","start",1,"dashboard-info-title"],[1,"overflow-wrap","dashboard-info-value"],[1,"dot","tiny-dot","green"],[1,"dot","tiny-dot","yellow"],[1,"dot","tiny-dot","grey"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(e,i){if(1&e&&(t.YNc(0,ne,42,18,"div",0),t.YNc(1,ie,3,1,"ng-template",null,1,t.W1O)),2&e){const o=t.MAs(2);t.Q6J("ngIf",""===(null==i.errorMessage?null:i.errorMessage.trim()))("ngIfElse",o)}},dependencies:[u.O5,m.xw,m.Wh,m.yH,u.JJ]}),n})();var x=f(9549),X=f(4850),W=f(266),U=f(6839);const oe=function(){return["../connections/channels/open"]},se=function(n){return{filter:n}};function le(n,a){if(1&n&&(t.TgZ(0,"div",19)(1,"a",20),t._uU(2),t.ALo(3,"slice"),t.qZA(),t.TgZ(4,"div",6)(5,"mat-hint",21)(6,"strong",8),t._uU(7,"Local:"),t.qZA(),t._uU(8),t.ALo(9,"number"),t.qZA(),t.TgZ(10,"mat-hint",22),t._UZ(11,"fa-icon",23),t._uU(12),t.ALo(13,"number"),t.qZA(),t.TgZ(14,"mat-hint",24)(15,"strong",8),t._uU(16,"Remote:"),t.qZA(),t._uU(17),t.ALo(18,"number"),t.qZA()(),t._UZ(19,"mat-progress-bar",25),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(3);t.xp6(1),t.s9C("matTooltip",e.alias||e.shortChannelId),t.s9C("matTooltipDisabled",(e.alias||e.shortChannelId).length<26),t.Q6J("routerLink",t.DdM(23,oe))("state",t.VKq(24,se,e.channelId)),t.xp6(1),t.AsE(" ",t.Dn7(3,11,(null==e?null:e.alias)||(null==e?null:e.shortChannelId),0,24),"",((null==e?null:e.alias)||(null==e?null:e.shortChannelId)).length>25?"...":""," "),t.xp6(6),t.hij("",t.xi3(9,15,(null==e?null:e.toLocal)||0,"1.0-0")," Sats"),t.xp6(3),t.Q6J("icon",i.faBalanceScale),t.xp6(1),t.hij(" (",t.lcZ(13,18,(null==e?null:e.balancedness)||0),") "),t.xp6(5),t.hij("",t.xi3(18,20,(null==e?null:e.toRemote)||0,"1.0-0")," Sats"),t.xp6(2),t.s9C("value",e.toLocal&&e.toLocal>0?+e.toLocal/(+e.toLocal+ +e.toRemote)*100:0)}}function re(n,a){if(1&n&&(t.TgZ(0,"div",17),t.YNc(1,le,20,26,"div",18),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",e.allChannels)}}function ce(n,a){if(1&n&&(t.TgZ(0,"div",3)(1,"div",4)(2,"span",5),t._uU(3,"Total Capacity"),t.qZA(),t.TgZ(4,"div",6)(5,"mat-hint",7)(6,"strong",8),t._uU(7,"Local:"),t.qZA(),t._uU(8),t.ALo(9,"number"),t.qZA(),t.TgZ(10,"mat-hint",9),t._UZ(11,"fa-icon",10),t._uU(12),t.ALo(13,"number"),t.qZA(),t.TgZ(14,"mat-hint",11)(15,"strong",8),t._uU(16,"Remote:"),t.qZA(),t._uU(17),t.ALo(18,"number"),t.qZA()(),t._UZ(19,"mat-progress-bar",12),t.qZA(),t.TgZ(20,"div",13),t._UZ(21,"mat-divider",14),t.qZA(),t.TgZ(22,"div",15),t.YNc(23,re,2,1,"div",16),t.qZA()()),2&n){const e=t.oxw(),i=t.MAs(2);t.xp6(8),t.hij("",t.xi3(9,7,(null==e.channelBalances?null:e.channelBalances.localBalance)||0,"1.0-0")," Sats"),t.xp6(3),t.Q6J("icon",e.faBalanceScale),t.xp6(1),t.hij(" (",t.lcZ(13,10,(null==e.channelBalances?null:e.channelBalances.balancedness)||0),") "),t.xp6(5),t.hij("",t.xi3(18,12,(null==e.channelBalances?null:e.channelBalances.remoteBalance)||0,"1.0-0")," Sats"),t.xp6(2),t.s9C("value",null!=e.channelBalances&&e.channelBalances.localBalance&&(null==e.channelBalances?null:e.channelBalances.localBalance)>0?+(null==e.channelBalances?null:e.channelBalances.localBalance)/(+(null==e.channelBalances?null:e.channelBalances.localBalance)+ +(null==e.channelBalances?null:e.channelBalances.remoteBalance))*100:0),t.xp6(4),t.Q6J("ngIf",e.allChannels&&(null==e.allChannels?null:e.allChannels.length)>0)("ngIfElse",i)}}function ue(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",26),t._uU(1," No channels available. "),t.TgZ(2,"button",27),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.goToChannels())}),t._uU(3,"Open Channel"),t.qZA()()}}function pe(n,a){if(1&n&&(t.TgZ(0,"div",28)(1,"p"),t._uU(2),t.qZA()()),2&n){const e=t.oxw();t.xp6(2),t.Oqu(e.errorMessage)}}let me=(()=>{class n{constructor(e){this.router=e,this.faBalanceScale=T.DL8,this.faDumbbell=T.FlN,this.sortBy="Balance Score"}goToChannels(){this.router.navigateByUrl("/ecl/connections")}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(y.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-capacity-info"]],inputs:{channelBalances:"channelBalances",allChannels:"allChannels",sortBy:"sortBy",errorMessage:"errorMessage"},decls:5,vars:2,consts:[["fxLayout","column","fxLayoutAlign","space-between stretch","fxFlex","100",4,"ngIf","ngIfElse"],["noChannelBlock",""],["errorBlock",""],["fxLayout","column","fxLayoutAlign","space-between stretch","fxFlex","100"],["fxLayout","column","fxFlex","8","fxLayoutAlign","end start"],[1,"dashboard-capacity-header","this-channel-capacity"],["fxLayout","row","fxLayoutAlign","space-between start",1,"w-100"],["fxFlex","40","fxLayoutAlign","start center",1,"font-size-90"],[1,"font-weight-900","mr-5px"],["fxFlex","20","fxLayoutAlign","center center",1,"font-size-90"],["matTooltip","Balance Score",1,"mr-3px",3,"icon"],["fxFlex","40","fxLayoutAlign","end center",1,"font-size-90"],["mode","determinate","color","accent",1,"dashboard-progress-bar","this-channel-bar",3,"value"],["fxLayout","column","fxFlex","3","fxLayoutAlign","end stretch"],[1,"dashboard-divider"],[1,"channels-capacity-scroll",3,"perfectScrollbar"],["fxLayout","column","fxFlex","100",4,"ngIf","ngIfElse"],["fxLayout","column","fxFlex","100"],["class","mt-2",4,"ngFor","ngForOf"],[1,"mt-2"],[1,"dashboard-capacity-header",3,"routerLink","state","matTooltip","matTooltipDisabled"],["fxFlex","40","fxLayoutAlign","start center",1,"font-size-90","color-primary"],["fxFlex","20","fxLayoutAlign","center center",1,"font-size-90","color-primary"],["matTooltip","Balance Score",1,"color-primary","mr-3px",3,"icon"],["fxFlex","40","fxLayoutAlign","end center",1,"font-size-90","color-primary"],["mode","determinate",1,"dashboard-progress-bar",3,"value"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between start",1,"mt-1","w-100"],["mat-stroked-button","","color","primary","tabindex","1",3,"click"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(e,i){if(1&e&&(t.YNc(0,ce,24,15,"div",0),t.YNc(1,ue,4,0,"ng-template",null,1,t.W1O),t.YNc(3,pe,3,1,"ng-template",null,2,t.W1O)),2&e){const o=t.MAs(4);t.Q6J("ngIf",""===(null==i.errorMessage?null:i.errorMessage.trim()))("ngIfElse",o)}},dependencies:[u.sg,u.O5,P.BN,m.xw,m.Wh,m.yH,F.lW,x.bx,X.d,Q.pW,W.gM,U.$V,y.rH,u.OU,u.JJ],styles:[".channels-capacity-scroll[_ngcontent-%COMP%]{width:100%;height:100%;overflow-y:hidden}"]}),n})();function de(n,a){if(1&n&&(t.TgZ(0,"mat-hint",19)(1,"strong",20),t._uU(2,"Capacity: "),t.qZA(),t._uU(3),t.ALo(4,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(3),t.hij("",t.xi3(4,1,e.toRemote||0,"1.0-0")," Sats")}}function he(n,a){if(1&n&&(t.TgZ(0,"mat-hint",19)(1,"strong",20),t._uU(2,"Capacity: "),t.qZA(),t._uU(3),t.ALo(4,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(3),t.hij("",t.xi3(4,1,e.toLocal||0,"1.0-0")," Sats")}}function _e(n,a){if(1&n&&t._UZ(0,"mat-progress-bar",21),2&n){const e=t.oxw().$implicit,i=t.oxw(3);t.s9C("value",i.totalLiquidity>0?(+e.toRemote||0)/i.totalLiquidity*100:0)}}function ge(n,a){if(1&n&&t._UZ(0,"mat-progress-bar",21),2&n){const e=t.oxw().$implicit,i=t.oxw(3);t.s9C("value",i.totalLiquidity>0?(+e.toLocal||0)/i.totalLiquidity*100:0)}}const fe=function(){return["../connections/channels/open"]},Ce=function(n){return{filter:n}};function xe(n,a){if(1&n&&(t.TgZ(0,"div",14)(1,"a",15),t._uU(2),t.ALo(3,"slice"),t.qZA(),t.TgZ(4,"div",16),t.YNc(5,de,5,4,"mat-hint",17),t.YNc(6,he,5,4,"mat-hint",17),t.qZA(),t.YNc(7,_e,1,1,"mat-progress-bar",18),t.YNc(8,ge,1,1,"mat-progress-bar",18),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(3);t.xp6(1),t.s9C("matTooltip",e.alias||e.shortChannelId),t.s9C("matTooltipDisabled",(e.alias||e.shortChannelId).length<26),t.Q6J("routerLink",t.DdM(14,fe))("state",t.VKq(15,Ce,e.channelId)),t.xp6(1),t.AsE(" ",t.Dn7(3,10,e.alias||e.shortChannelId,0,24),"",(e.alias||e.shortChannelId).length>25?"...":""," "),t.xp6(3),t.Q6J("ngIf","In"===i.direction),t.xp6(1),t.Q6J("ngIf","Out"===i.direction),t.xp6(1),t.Q6J("ngIf","In"===i.direction),t.xp6(1),t.Q6J("ngIf","Out"===i.direction)}}function ye(n,a){if(1&n&&(t.TgZ(0,"div",12),t.YNc(1,xe,9,17,"div",13),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",e.allChannels)}}const ve=function(n,a,e){return{"mb-4":n,"mb-2":a,"mb-1":e}};function Te(n,a){if(1&n&&(t.TgZ(0,"div",3)(1,"div",4)(2,"span",5),t._uU(3,"Total Capacity"),t.qZA(),t.TgZ(4,"mat-hint",6),t._uU(5),t.ALo(6,"number"),t.qZA(),t._UZ(7,"mat-progress-bar",7),t.qZA(),t.TgZ(8,"div",8),t._UZ(9,"mat-divider",9),t.qZA(),t.TgZ(10,"div",10),t.YNc(11,ye,2,1,"div",11),t.qZA()()),2&n){const e=t.oxw(),i=t.MAs(2);t.Q6J("ngClass",t.kEZ(7,ve,e.screenSize===e.screenSizeEnum.XS||e.screenSize===e.screenSizeEnum.SM,e.screenSize===e.screenSizeEnum.MD,e.screenSize===e.screenSizeEnum.LG||e.screenSize===e.screenSizeEnum.XL)),t.xp6(5),t.hij("",t.xi3(6,4,e.totalLiquidity,"1.0-0")," Sats"),t.xp6(6),t.Q6J("ngIf",e.allChannels&&e.allChannels.length>0)("ngIfElse",i)}}function Le(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",24),t.NdJ("click",function(){t.CHM(e);const o=t.oxw(2);return t.KtG(o.goToChannels())}),t._uU(1,"Open Channel"),t.qZA()}}function be(n,a){if(1&n&&(t.TgZ(0,"div",22),t._uU(1," No channels available. "),t.YNc(2,Le,2,0,"button",23),t.qZA()),2&n){const e=t.oxw();t.xp6(2),t.Q6J("ngIf","Out"===e.direction)}}function Se(n,a){if(1&n&&(t.TgZ(0,"div",25)(1,"p"),t._uU(2),t.qZA()()),2&n){const e=t.oxw();t.xp6(2),t.Oqu(e.errorMessage)}}let Ze=(()=>{class n{constructor(e,i){this.router=e,this.commonService=i,this.screenSize="",this.screenSizeEnum=l.cu}ngOnInit(){this.screenSize=this.commonService.getScreenSize()}goToChannels(){this.router.navigateByUrl("/ecl/connections")}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(y.F0),t.Y36(k.v))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-liquidity-info"]],inputs:{direction:"direction",totalLiquidity:"totalLiquidity",allChannels:"allChannels",errorMessage:"errorMessage"},decls:5,vars:2,consts:[["fxLayout","column","fxLayoutAlign","space-between stretch","fxFlex","100",3,"ngClass",4,"ngIf","ngIfElse"],["noChannelBlock",""],["errorBlock",""],["fxLayout","column","fxLayoutAlign","space-between stretch","fxFlex","100",3,"ngClass"],["fxLayout","column","fxFlex","8","fxLayoutAlign","end start"],[1,"dashboard-capacity-header","this-channel-capacity"],[1,"font-size-90"],["mode","determinate","color","accent","value","100",1,"dashboard-progress-bar","this-channel-bar"],["fxLayout","column","fxFlex","3","fxLayoutAlign","end stretch"],[1,"dashboard-divider"],["fxLayout","column","fxFlex.gt-sm","88","fxFlex","84","fxLayoutAlign","start start",3,"perfectScrollbar"],["fxLayout","column","fxFlex","100","class","w-100",4,"ngIf","ngIfElse"],["fxLayout","column","fxFlex","100",1,"w-100"],["class","mt-2",4,"ngFor","ngForOf"],[1,"mt-2"],[1,"dashboard-capacity-header",3,"routerLink","state","matTooltip","matTooltipDisabled"],["fxLayout","row","fxLayoutAlign","space-between start",1,"w-100"],["fxFlex","100","fxLayoutAlign","start center","class","font-size-90 color-primary",4,"ngIf"],["class","dashboard-progress-bar","mode","determinate",3,"value",4,"ngIf"],["fxFlex","100","fxLayoutAlign","start center",1,"font-size-90","color-primary"],[1,"font-weight-900","mr-5px"],["mode","determinate",1,"dashboard-progress-bar",3,"value"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between start",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","1",3,"click",4,"ngIf"],["mat-stroked-button","","color","primary","tabindex","1",3,"click"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(e,i){if(1&e&&(t.YNc(0,Te,12,11,"div",0),t.YNc(1,be,3,1,"ng-template",null,1,t.W1O),t.YNc(3,Se,3,1,"ng-template",null,2,t.W1O)),2&e){const o=t.MAs(4);t.Q6J("ngIf",""===(null==i.errorMessage?null:i.errorMessage.trim()))("ngIfElse",o)}},dependencies:[u.mk,u.sg,u.O5,m.xw,m.Wh,m.yH,Z.oO,F.lW,x.bx,X.d,Q.pW,W.gM,U.$V,y.rH,u.OU,u.JJ]}),n})();var K=f(5698),A=f(8739),S=f(6308),c=f(671),Y=f(9300),D=f(2994),M=f(7274),lt=f(3289),$=f(493),Lt=f(8104),h=f(4006),B=f(4144),j=f(3390);const Ae=["paymentReq"];function Ee(n,a){if(1&n&&(t.TgZ(0,"mat-hint"),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Oqu(e.paymentDecodedHint)}}function we(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Payment request is required."),t.qZA())}function Ie(n,a){if(1&n&&(t.TgZ(0,"mat-error"),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Oqu(e.paymentDecodedHint)}}function Fe(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Payment amount is required."),t.qZA())}function qe(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mat-form-field",1)(1,"mat-label"),t._uU(2,"Amount (Sats)"),t.qZA(),t.TgZ(3,"input",18,19),t.NdJ("ngModelChange",function(o){t.CHM(e);const s=t.oxw();return t.KtG(s.paymentAmount=o)})("change",function(o){t.CHM(e);const s=t.oxw();return t.KtG(s.onAmountChange(o))}),t.qZA(),t.TgZ(5,"mat-hint"),t._uU(6,"It is a zero amount invoice, enter amount to be paid."),t.qZA(),t.YNc(7,Fe,2,0,"mat-error",12),t.qZA()}if(2&n){const e=t.oxw();t.xp6(3),t.Q6J("ngModel",e.paymentAmount),t.xp6(4),t.Q6J("ngIf",!e.paymentAmount)}}function Ne(n,a){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.paymentError)}}function Oe(n,a){if(1&n&&(t.TgZ(0,"div",20),t._UZ(1,"fa-icon",21),t.YNc(2,Ne,2,1,"span",12),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faExclamationTriangle),t.xp6(1),t.Q6J("ngIf",""!==e.paymentError)}}let Pe=(()=>{class n{constructor(e,i,o,s,r,d,g,L){this.dialogRef=e,this.store=i,this.eclEffects=o,this.logger=s,this.commonService=r,this.decimalPipe=d,this.actions=g,this.dataService=L,this.faExclamationTriangle=T.eHv,this.selNode={},this.paymentDecoded={},this.zeroAmtInvoice=!1,this.paymentAmount=null,this.paymentRequest="",this.paymentDecodedHint="",this.selActiveChannel={},this.activeChannels={},this.feeLimit=null,this.selFeeLimitType=l.Vc[0],this.feeLimitTypes=l.Vc,this.paymentError="",this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.store.select(C.LR).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e}),this.store.select(C.Xz).pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{this.activeChannels=e.activeChannels,this.logger.info(e)}),this.actions.pipe((0,_.R)(this.unSubs[1]),(0,Y.h)(e=>e.type===l.lr.UPDATE_API_CALL_STATUS_ECL||e.type===l.lr.SEND_PAYMENT_STATUS_ECL)).subscribe(e=>{e.type===l.lr.SEND_PAYMENT_STATUS_ECL&&this.dialogRef.close(),e.type===l.lr.UPDATE_API_CALL_STATUS_ECL&&e.payload.status===l.Bn.ERROR&&"SendPayment"===e.payload.action&&(delete this.paymentDecoded.amount,this.paymentError=e.payload.message)})}onSendPayment(){if(!this.paymentRequest)return!0;this.paymentDecoded.timestamp?this.sendPayment():(this.paymentAmount=null,this.paymentError="",this.paymentDecodedHint="",this.paymentReq.control.setErrors(null),this.dataService.decodePayment(this.paymentRequest,!0).pipe((0,K.q)(1)).subscribe({next:e=>{this.paymentDecoded=e,this.paymentDecoded.timestamp&&!this.paymentDecoded.amount?(this.paymentDecoded.amount=0,this.zeroAmtInvoice=!0,this.paymentDecodedHint="Zero Amount Invoice | Memo: "+this.paymentDecoded.description):(this.zeroAmtInvoice=!1,this.selNode&&this.selNode.fiatConversion&&this.paymentDecoded.amount?this.commonService.convertCurrency(+this.paymentDecoded.amount,l.NT.SATS,l.NT.OTHER,this.selNode.currencyUnits&&this.selNode.currencyUnits.length>2?this.selNode.currencyUnits[2]:"",this.selNode.fiatConversion).pipe((0,_.R)(this.unSubs[2])).subscribe({next:i=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats ("+i.symbol+this.decimalPipe.transform(i.OTHER?i.OTHER:0,l.Xz.OTHER)+") | Memo: "+this.paymentDecoded.description},error:i=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount/1e3:0)+" Sats | Memo: "+this.paymentDecoded.description+". Unable to convert currency."}}):this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats | Memo: "+this.paymentDecoded.description)},error:e=>{this.logger.error(e),this.paymentDecodedHint="ERROR: "+(e.message?e.message:"string"==typeof e?e:JSON.stringify(e)),this.paymentReq.control.setErrors({decodeError:!0})}}))}sendPayment(){this.store.dispatch((0,D.oV)(this.zeroAmtInvoice&&this.paymentAmount?{payload:{invoice:this.paymentRequest,amountMsat:1e3*this.paymentAmount,fromDialog:!0}}:{payload:{invoice:this.paymentRequest,fromDialog:!0}}))}onPaymentRequestEntry(e){this.paymentRequest=e&&"string"==typeof e?e.trim():e,this.paymentError="",this.paymentDecodedHint="",this.zeroAmtInvoice=!1,this.paymentRequest&&this.paymentRequest.length>100&&(this.paymentReq.control.setErrors(null),this.zeroAmtInvoice=!1,this.dataService.decodePayment(this.paymentRequest,!0).pipe((0,K.q)(1)).subscribe({next:i=>{this.paymentDecoded=i,this.paymentDecoded.timestamp&&!this.paymentDecoded.amount?(this.paymentDecoded.amount=0,this.zeroAmtInvoice=!0,this.paymentDecodedHint="Zero Amount Invoice | Memo: "+this.paymentDecoded.description):(this.zeroAmtInvoice=!1,this.selNode&&this.selNode.fiatConversion&&this.paymentDecoded.amount?this.commonService.convertCurrency(+this.paymentDecoded.amount,l.NT.SATS,l.NT.OTHER,this.selNode.currencyUnits&&this.selNode.currencyUnits.length>2?this.selNode.currencyUnits[2]:"",this.selNode.fiatConversion).pipe((0,_.R)(this.unSubs[3])).subscribe({next:o=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats ("+o.symbol+this.decimalPipe.transform(o.OTHER?o.OTHER:0,l.Xz.OTHER)+") | Memo: "+this.paymentDecoded.description},error:o=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats | Memo: "+this.paymentDecoded.description+". Unable to convert currency."}}):this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats | Memo: "+this.paymentDecoded.description)},error:i=>{this.logger.error(i),this.paymentDecodedHint="ERROR: "+(i.message?i.message:"string"==typeof i?i:JSON.stringify(i)),this.paymentReq.control.setErrors({decodeError:!0})}}))}onAmountChange(e){delete this.paymentDecoded.amount,this.paymentDecoded.amount=e}resetData(){this.paymentDecoded={},this.paymentRequest="",this.selActiveChannel=null,this.feeLimit=null,this.selFeeLimitType=l.Vc[0],this.paymentReq.control.setErrors(null),this.paymentError="",this.paymentDecodedHint="",this.zeroAmtInvoice=!1}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(M.so),t.Y36(I.yh),t.Y36(lt.o),t.Y36(R.mQ),t.Y36(k.v),t.Y36(u.JJ),t.Y36($.eX),t.Y36(Lt.D))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-lightning-send-payments"]],viewQuery:function(e,i){if(1&e&&t.Gf(Ae,5),2&e){let o;t.iGM(o=t.CRH())&&(i.paymentReq=o.first)}},decls:26,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 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"],["fxLayout","column","fxFlex","100"],["autoFocus","","matInput","","name","paymentRequest","rows","4","tabindex","1","required","",3,"ngModel","ngModelChange","matTextareaAutosize"],["paymentReq","ngModel"],[4,"ngIf"],["fxFlex","100",4,"ngIf"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center",1,"mt-2"],["mat-button","","color","primary","tabindex","2","type","reset",1,"mr-1",3,"click"],["mat-button","","color","primary","tabindex","3",3,"click"],["matInput","","name","amount","tabindex","2","required","",3,"ngModel","ngModelChange","change"],["paymentAmt","ngModel"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"]],template:function(e,i){if(1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-header",2)(3,"div",3)(4,"span",4),t._uU(5,"Send Payment"),t.qZA()(),t.TgZ(6,"button",5),t._uU(7,"X"),t.qZA()(),t.TgZ(8,"mat-card-content",6)(9,"form",7,8)(11,"mat-form-field",9)(12,"mat-label"),t._uU(13,"Payment Request"),t.qZA(),t.TgZ(14,"textarea",10,11),t.NdJ("ngModelChange",function(s){return i.onPaymentRequestEntry(s)})("matTextareaAutosize",function(){return!0}),t.qZA(),t.YNc(16,Ee,2,1,"mat-hint",12),t.YNc(17,we,2,0,"mat-error",12),t.YNc(18,Ie,2,1,"mat-error",12),t.qZA(),t.YNc(19,qe,8,2,"mat-form-field",13),t.YNc(20,Oe,3,2,"div",14),t.TgZ(21,"div",15)(22,"button",16),t.NdJ("click",function(){return i.resetData()}),t._uU(23,"Clear Fields"),t.qZA(),t.TgZ(24,"button",17),t.NdJ("click",function(){return i.onSendPayment()}),t._uU(25,"Send Payment"),t.qZA()()()()()()),2&e){const o=t.MAs(15);t.xp6(6),t.Q6J("mat-dialog-close",!1),t.xp6(8),t.Q6J("ngModel",i.paymentRequest),t.xp6(2),t.Q6J("ngIf",i.paymentRequest&&""!==i.paymentDecodedHint),t.xp6(1),t.Q6J("ngIf",!i.paymentRequest),t.xp6(1),t.Q6J("ngIf",null==o.errors?null:o.errors.decodeError),t.xp6(1),t.Q6J("ngIf",i.zeroAmtInvoice),t.xp6(1),t.Q6J("ngIf",""!==i.paymentError)}},dependencies:[u.O5,h._Y,h.Fj,h.JJ,h.JL,h.Q7,h.On,h.F,P.BN,m.xw,m.Wh,m.yH,M.ZT,F.lW,b.dn,b.dk,B.Nt,x.KE,x.hX,x.bx,x.TO,j.h]}),n})();var z=f(752);const Ue=["scrollContainer"];function Re(n,a){if(1&n&&(t.TgZ(0,"div",9)(1,"div",1)(2,"h4",11),t._uU(3,"Description"),t.qZA(),t.TgZ(4,"span",12),t._uU(5),t.qZA()()()),2&n){const e=t.oxw();t.xp6(5),t.Oqu(e.description)}}function ke(n,a){1&n&&t._UZ(0,"mat-divider",14)}function De(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mat-expansion-panel",23),t.NdJ("opened",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onExpansionOpen(!0))})("closed",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onExpansionOpen(!1))}),t.TgZ(1,"mat-expansion-panel-header")(2,"mat-panel-title")(3,"h4",24),t._uU(4),t.qZA(),t.TgZ(5,"h4",25),t._uU(6),t.ALo(7,"number"),t.qZA()()(),t.TgZ(8,"div",8)(9,"div",9)(10,"div",26)(11,"h4",11),t._uU(12,"Fees (mSats)"),t.qZA(),t.TgZ(13,"span",12),t._uU(14),t.ALo(15,"number"),t.qZA()(),t.TgZ(16,"div",26)(17,"h4",11),t._uU(18,"Date/Time"),t.qZA(),t.TgZ(19,"span",12),t._uU(20),t.ALo(21,"date"),t.qZA()()(),t._UZ(22,"mat-divider",14),t.TgZ(23,"div",9)(24,"div",1)(25,"h4",11),t._uU(26,"ID"),t.qZA(),t.TgZ(27,"span",27),t._uU(28),t.qZA()()(),t._UZ(29,"mat-divider",14),t.TgZ(30,"div",9)(31,"div",1)(32,"h4",11),t._uU(33,"To Channel"),t.qZA(),t.TgZ(34,"span",27),t._uU(35),t.qZA()()()()()}if(2&n){const e=a.$implicit,i=a.index,o=t.oxw();t.Q6J("expanded",o.expansionOpen),t.xp6(4),t.hij("Part ",i+1,""),t.xp6(2),t.hij("",t.lcZ(7,7,e.amount)," (Sats)"),t.xp6(8),t.Oqu(t.lcZ(15,9,e.feesPaid)),t.xp6(6),t.Oqu(t.xi3(21,11,e.timestamp,"dd/MMM/y HH:mm")),t.xp6(8),t.Oqu(e.id),t.xp6(7),t.Oqu(e.toChannelAlias)}}let Je=(()=>{class n{constructor(e,i){this.dialogRef=e,this.data=i,this.description=null,this.shouldScroll=!0,this.expansionOpen=!0}ngOnInit(){this.payment=this.data.payment,this.data.sentPaymentInfo.length>0&&this.data.sentPaymentInfo[0].paymentRequest&&this.data.sentPaymentInfo[0].paymentRequest.description&&""!==this.data.sentPaymentInfo[0].paymentRequest.description&&(this.description=this.data.sentPaymentInfo[0].paymentRequest.description)}ngAfterViewChecked(){this.shouldScroll=this.scrollContainer.nativeElement.classList.value.includes("ps--active-y")}onScrollDown(){this.scrollContainer.nativeElement.scrollTop=this.scrollContainer.nativeElement.scrollTop+62.6}onExpansionOpen(e){this.expansionOpen=e}onClose(){this.dialogRef.close(!1)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(M.so),t.Y36(M.WI))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-payment-information"]],viewQuery:function(e,i){if(1&e&&t.Gf(Ue,5),2&e){let o;t.iGM(o=t.CRH())&&(i.scrollContainer=o.first)}},decls:66,vars:15,consts:[["fxLayout","column","fxLayout.gt-sm","row","fxLayoutAlign","space-between stretch"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","3","fxFlex","5","fxLayoutAlign","center center","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"h-40","padding-gap-x-large",3,"perfectScrollbar"],["scrollContainer",""],["fxLayout","column"],["fxLayout","row"],["fxFlex","30"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text"],["fxFlex","70"],[1,"w-100","my-1"],["fxLayout","row",4,"ngIf"],["class","w-100 my-1",4,"ngIf"],["class","flat-expansion-panel my-1",3,"expanded","opened","closed",4,"ngFor","ngForOf"],["fxLayout","row","fxLayoutAlign","start end",1,"btn-sticky-container","padding-gap-x-large"],["mat-mini-fab","","aria-label","Scroll Down","fxLayoutAlign","center center",3,"click"],["fxLayoutAlign","center center"],["fxLayout","row","fxLayoutAlign","end center",1,"padding-gap-x-large","padding-gap-bottom-large"],["fxLayoutAlign","center center","tabindex","1","mat-button","","color","primary","type","button","default","",1,"mr-1",3,"mat-dialog-close"],[1,"flat-expansion-panel","my-1",3,"expanded","opened","closed"],["fxFlex","30","fxLayoutAlign","start",1,"font-bold-500"],["fxFlex","70","fxLayoutAlign","start",1,"font-bold-500"],["fxFlex","50"],[1,"overflow-wrap","foreground-secondary-text"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-header",2)(3,"div",3)(4,"span",4),t._uU(5,"Payment Information"),t.qZA()(),t.TgZ(6,"button",5),t.NdJ("click",function(){return i.onClose()}),t._uU(7,"X"),t.qZA()(),t.TgZ(8,"mat-card-content",6,7)(10,"div",8)(11,"div",9)(12,"div",10)(13,"h4",11),t._uU(14,"Amount (Sats)"),t.qZA(),t.TgZ(15,"span",12),t._uU(16),t.ALo(17,"number"),t.qZA()(),t.TgZ(18,"div",13)(19,"h4",11),t._uU(20,"Date/Time"),t.qZA(),t.TgZ(21,"span",12),t._uU(22),t.ALo(23,"date"),t.qZA()()(),t._UZ(24,"mat-divider",14),t.TgZ(25,"div",9)(26,"div",1)(27,"h4",11),t._uU(28,"ID"),t.qZA(),t.TgZ(29,"span",12),t._uU(30),t.qZA()()(),t._UZ(31,"mat-divider",14),t.TgZ(32,"div",9)(33,"div",1)(34,"h4",11),t._uU(35,"Payment Hash"),t.qZA(),t.TgZ(36,"span",12),t._uU(37),t.qZA()()(),t._UZ(38,"mat-divider",14),t.TgZ(39,"div",9)(40,"div",1)(41,"h4",11),t._uU(42,"Payment Preimage"),t.qZA(),t.TgZ(43,"span",12),t._uU(44),t.qZA()()(),t._UZ(45,"mat-divider",14),t.TgZ(46,"div",9)(47,"div",1)(48,"h4",11),t._uU(49,"Recipient Node"),t.qZA(),t.TgZ(50,"span",12),t._uU(51),t.qZA()()(),t._UZ(52,"mat-divider",14),t.YNc(53,Re,6,1,"div",15),t.YNc(54,ke,1,0,"mat-divider",16),t.TgZ(55,"div",9)(56,"div",1)(57,"mat-accordion"),t.YNc(58,De,36,14,"mat-expansion-panel",17),t.qZA()()()()(),t.TgZ(59,"div",18)(60,"button",19),t.NdJ("click",function(){return i.onScrollDown()}),t.TgZ(61,"mat-icon",20),t._uU(62,"arrow_downward"),t.qZA()()(),t.TgZ(63,"div",21)(64,"button",22),t._uU(65,"OK"),t.qZA()()()()),2&e&&(t.xp6(16),t.Oqu(t.lcZ(17,10,i.payment.recipientAmount)),t.xp6(6),t.Oqu(t.xi3(23,12,i.payment.firstPartTimestamp,"dd/MMM/y HH:mm")),t.xp6(8),t.Oqu(i.payment.id),t.xp6(7),t.Oqu(i.payment.paymentHash),t.xp6(7),t.Oqu(i.payment.paymentPreimage),t.xp6(7),t.Oqu(i.payment.recipientNodeAlias),t.xp6(2),t.Q6J("ngIf",i.description),t.xp6(1),t.Q6J("ngIf",i.description),t.xp6(4),t.Q6J("ngForOf",i.payment.parts),t.xp6(6),t.Q6J("mat-dialog-close",!1))},dependencies:[u.sg,u.O5,m.xw,m.Wh,m.yH,M.ZT,F.lW,F.nh,b.dn,b.dk,z.pp,z.ib,z.yz,z.yK,vt.Hw,X.d,U.$V,u.JJ,u.uU]}),n})();var E=f(7861),w=f(4385),nt=f(3093),G=f(9445),V=f(3238);const Me=["sendPaymentForm"];function Qe(n,a){if(1&n&&(t.TgZ(0,"mat-hint"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.paymentDecodedHint)}}function Ye(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Payment request is required."),t.qZA())}function Be(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"form",4,5)(2,"mat-form-field",6)(3,"mat-label"),t._uU(4,"Payment Request"),t.qZA(),t.TgZ(5,"textarea",7,8),t.NdJ("ngModelChange",function(o){t.CHM(e);const s=t.oxw();return t.KtG(s.onPaymentRequestEntry(o))})("matTextareaAutosize",function(){return!0}),t.qZA(),t.YNc(7,Qe,2,1,"mat-hint",9),t.YNc(8,Ye,2,0,"mat-error",9),t.qZA(),t.TgZ(9,"div",10)(10,"button",11),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.resetData())}),t._uU(11,"Clear Field"),t.qZA(),t.TgZ(12,"button",12),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onSendPayment())}),t._uU(13,"Send Payment"),t.qZA()()()}if(2&n){const e=t.oxw();t.xp6(5),t.Q6J("ngModel",e.paymentRequest),t.xp6(2),t.Q6J("ngIf",e.paymentRequest&&""!==e.paymentDecodedHint),t.xp6(1),t.Q6J("ngIf",!e.paymentRequest)}}function He(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",13)(1,"button",12),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.openSendPaymentModal())}),t._uU(2,"Send Payment"),t.qZA()()}}function ze(n,a){if(1&n&&(t.TgZ(0,"mat-option",59),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.Q6J("value",e),t.xp6(1),t.Oqu(i.getLabel(e))}}function Ve(n,a){1&n&&t._UZ(0,"mat-progress-bar",60)}function Ge(n,a){1&n&&(t.TgZ(0,"th",61),t._uU(1,"Date/Time"),t.qZA())}function Ke(n,a){if(1&n&&(t.TgZ(0,"td",62),t._uU(1),t.ALo(2,"date"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,null==e?null:e.firstPartTimestamp,"dd/MMM/y HH:mm"))}}function We(n,a){1&n&&(t.TgZ(0,"th",61),t._uU(1,"ID"),t.qZA())}const J=function(n){return{width:n}};function $e(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",63)(2,"span",64),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,J,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.id)}}function Xe(n,a){1&n&&(t.TgZ(0,"th",61),t._uU(1,"Destination Node ID"),t.qZA())}function je(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",63)(2,"span",64),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,J,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.recipientNodeId)}}function tn(n,a){1&n&&(t.TgZ(0,"th",61),t._uU(1,"Destination"),t.qZA())}function en(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",63)(2,"span",64),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,J,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.recipientNodeAlias)}}function nn(n,a){1&n&&(t.TgZ(0,"th",61),t._uU(1,"Description"),t.qZA())}function an(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",63)(2,"span",64),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,J,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.description)}}function on(n,a){1&n&&(t.TgZ(0,"th",61),t._uU(1,"Payment Hash"),t.qZA())}function sn(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",63)(2,"span",64),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,J,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.paymentHash)}}function ln(n,a){1&n&&(t.TgZ(0,"th",61),t._uU(1,"Preimage"),t.qZA())}function rn(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",63)(2,"span",64),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,J,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.paymentPreimage)}}function cn(n,a){1&n&&(t.TgZ(0,"th",65),t._uU(1,"Amount (Sats)"),t.qZA())}function un(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"span",66),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,null==e?null:e.recipientAmount))}}function pn(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",67)(1,"div",68)(2,"mat-select",69),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",70),t.NdJ("click",function(){t.CHM(e);const o=t.oxw(2);return t.KtG(o.onDownloadCSV())}),t._uU(5,"Download CSV"),t.qZA()()()()}}function mn(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",71)(1,"button",72),t.NdJ("click",function(){const s=t.CHM(e).$implicit,r=t.oxw(2);return t.KtG(r.onPaymentClick(s))}),t._uU(2,"View Info"),t.qZA()()}}function dn(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No payment available."),t.qZA())}function hn(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting payments..."),t.qZA())}function _n(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Oqu(e.errorMessage)}}function gn(n,a){if(1&n&&(t.TgZ(0,"td",73),t.YNc(1,dn,2,0,"p",9),t.YNc(2,hn,2,0,"p",9),t.YNc(3,_n,2,1,"p",9),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",(!(null!=e.payments&&e.payments.data)||(null==e.payments||null==e.payments.data?null:e.payments.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.payments&&e.payments.data)||(null==e.payments||null==e.payments.data?null:e.payments.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.payments&&e.payments.data)||(null==e.payments||null==e.payments.data?null:e.payments.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}function fn(n,a){if(1&n&&(t.TgZ(0,"span",74),t._uU(1),t.ALo(2,"date"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.timestamp,"dd/MMM/y HH:mm")," ")}}function Cn(n,a){if(1&n&&(t.ynx(0),t.YNc(1,fn,3,4,"span",75),t.BQk()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function xn(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"span",74),t._uU(2),t.qZA(),t.YNc(3,Cn,2,1,"ng-container",9),t.qZA()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" Total Attempts: ",(null==e||null==e.parts?null:e.parts.length)||0," "),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function yn(n,a){if(1&n&&(t.TgZ(0,"span",74)(1,"span",76)(2,"span",64),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(4);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,J,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(e.id)}}function vn(n,a){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,yn,4,4,"span",75),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function Tn(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",76)(2,"span",64),t._uU(3),t.qZA()(),t.YNc(4,vn,2,1,"span",9),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(3,J,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.id),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function Ln(n,a){if(1&n&&(t.TgZ(0,"span",74)(1,"span",76)(2,"span",64),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(4);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,J,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(e.toChannelId)}}function bn(n,a){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,Ln,4,4,"span",75),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function Sn(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",76)(2,"span",64),t._uU(3),t.qZA()(),t.YNc(4,bn,2,1,"span",9),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(3,J,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.recipientNodeId),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function Zn(n,a){if(1&n&&(t.TgZ(0,"span",74)(1,"span",76)(2,"span",64),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(4);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,J,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(e.toChannelAlias)}}function An(n,a){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,Zn,4,4,"span",75),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function En(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",76)(2,"span",64),t._uU(3),t.qZA()(),t.YNc(4,An,2,1,"span",9),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(3,J,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.recipientNodeAlias),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function wn(n,a){if(1&n&&(t.TgZ(0,"span",77),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.amount,"1.0-0")," ")}}function In(n,a){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,wn,3,4,"span",78),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function Fn(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"span",77),t._uU(2),t.ALo(3,"number"),t.qZA(),t.YNc(4,In,2,1,"span",9),t.qZA()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.xi3(3,2,null==e?null:e.recipientAmount,"1.0-0")),t.xp6(2),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function qn(n,a){if(1&n&&(t.TgZ(0,"span",74)(1,"span",76)(2,"span",64),t._uU(3),t.ALo(4,"number"),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(4);t.xp6(1),t.Q6J("ngStyle",t.VKq(5,J,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.hij("Fee Paid: ",t.xi3(4,2,e.feesPaid,"1.0-0")," (Sats)")}}function Nn(n,a){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,qn,5,7,"span",75),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function On(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",76)(2,"span",64),t._uU(3),t.qZA()(),t.YNc(4,Nn,2,1,"span",9),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(3,J,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.description),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function Pn(n,a){if(1&n&&(t.TgZ(0,"span",74)(1,"span",76)(2,"span",64),t._uU(3),t.ALo(4,"number"),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(4);t.xp6(1),t.Q6J("ngStyle",t.VKq(5,J,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.hij("Fee Paid: ",t.xi3(4,2,e.feesPaid,"1.0-0")," (Sats)")}}function Un(n,a){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,Pn,5,7,"span",75),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function Rn(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",76)(2,"span",64),t._uU(3),t.qZA()(),t.YNc(4,Un,2,1,"span",9),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(3,J,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.paymentHash),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function kn(n,a){if(1&n&&(t.TgZ(0,"span",74)(1,"span",76)(2,"span",64),t._uU(3),t.ALo(4,"number"),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(4);t.xp6(1),t.Q6J("ngStyle",t.VKq(5,J,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.hij("Fee Paid: ",t.xi3(4,2,e.feesPaid,"1.0-0")," (Sats)")}}function Dn(n,a){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,kn,5,7,"span",75),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function Jn(n,a){if(1&n&&(t.TgZ(0,"td",62)(1,"div",76)(2,"span",64),t._uU(3),t.qZA()(),t.YNc(4,Dn,2,1,"span",9),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(3,J,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.paymentPreimage),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function Mn(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",82)(1,"button",83),t.NdJ("click",function(){const s=t.CHM(e).$implicit,r=t.oxw(2).$implicit,d=t.oxw(2);return t.KtG(d.onPartClick(s,r))}),t._uU(2),t.qZA()()}if(2&n){const e=a.index;t.xp6(2),t.hij("View ",e+1,"")}}function Qn(n,a){if(1&n&&(t.TgZ(0,"div"),t.YNc(1,Mn,3,1,"div",81),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function Yn(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",62)(1,"span",79)(2,"button",80),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.KtG(s.is_expanded=!s.is_expanded)}),t._uU(3),t.qZA()(),t.YNc(4,Qn,2,1,"div",9),t.qZA()}if(2&n){const e=a.$implicit;t.xp6(3),t.Oqu(null!=e&&e.is_expanded?"Hide":"Show"),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function Bn(n,a){1&n&&t._UZ(0,"tr",84)}const Hn=function(n){return{"display-none":n}};function zn(n,a){if(1&n&&t._UZ(0,"tr",85),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,Hn,(null==e.payments||null==e.payments.data?null:e.payments.data.length)>0))}}function Vn(n,a){1&n&&t._UZ(0,"tr",86)}function Gn(n,a){1&n&&t._UZ(0,"tr",84)}const Kn=function(){return["all"]},Wn=function(n){return{"error-border":n}},$n=function(){return["no_payment"]};function Xn(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",14)(1,"div",15)(2,"div",16),t._UZ(3,"fa-icon",17),t.TgZ(4,"span",18),t._uU(5,"Payments History"),t.qZA()(),t.TgZ(6,"div",19)(7,"mat-form-field",20)(8,"mat-label"),t._uU(9,"Filter By"),t.qZA(),t.TgZ(10,"mat-select",21),t.NdJ("ngModelChange",function(o){t.CHM(e);const s=t.oxw();return t.KtG(s.selFilterBy=o)})("selectionChange",function(){t.CHM(e);const o=t.oxw();return o.selFilter="",t.KtG(o.applyFilter())}),t.TgZ(11,"perfect-scrollbar"),t.YNc(12,ze,2,2,"mat-option",22),t.qZA()()(),t.TgZ(13,"mat-form-field",20)(14,"mat-label"),t._uU(15,"Filter"),t.qZA(),t.TgZ(16,"input",23),t.NdJ("ngModelChange",function(o){t.CHM(e);const s=t.oxw();return t.KtG(s.selFilter=o)})("input",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.applyFilter())})("keyup",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.applyFilter())}),t.qZA()()()(),t.TgZ(17,"div",24)(18,"div",25),t.YNc(19,Ve,1,0,"mat-progress-bar",26),t.TgZ(20,"table",27,28),t.ynx(22,29),t.YNc(23,Ge,2,0,"th",30),t.YNc(24,Ke,3,4,"td",31),t.BQk(),t.ynx(25,32),t.YNc(26,We,2,0,"th",30),t.YNc(27,$e,4,4,"td",31),t.BQk(),t.ynx(28,33),t.YNc(29,Xe,2,0,"th",30),t.YNc(30,je,4,4,"td",31),t.BQk(),t.ynx(31,34),t.YNc(32,tn,2,0,"th",30),t.YNc(33,en,4,4,"td",31),t.BQk(),t.ynx(34,35),t.YNc(35,nn,2,0,"th",30),t.YNc(36,an,4,4,"td",31),t.BQk(),t.ynx(37,36),t.YNc(38,on,2,0,"th",30),t.YNc(39,sn,4,4,"td",31),t.BQk(),t.ynx(40,37),t.YNc(41,ln,2,0,"th",30),t.YNc(42,rn,4,4,"td",31),t.BQk(),t.ynx(43,38),t.YNc(44,cn,2,0,"th",39),t.YNc(45,un,4,3,"td",31),t.BQk(),t.ynx(46,40),t.YNc(47,pn,6,0,"th",41),t.YNc(48,mn,3,0,"td",42),t.BQk(),t.ynx(49,43),t.YNc(50,gn,4,3,"td",44),t.BQk(),t.ynx(51,45),t.YNc(52,xn,4,2,"td",31),t.BQk(),t.ynx(53,46),t.YNc(54,Tn,5,5,"td",31),t.BQk(),t.ynx(55,47),t.YNc(56,Sn,5,5,"td",31),t.BQk(),t.ynx(57,48),t.YNc(58,En,5,5,"td",31),t.BQk(),t.ynx(59,49),t.YNc(60,Fn,5,5,"td",31),t.BQk(),t.ynx(61,50),t.YNc(62,On,5,5,"td",31),t.BQk(),t.ynx(63,51),t.YNc(64,Rn,5,5,"td",31),t.BQk(),t.ynx(65,52),t.YNc(66,Jn,5,5,"td",31),t.BQk(),t.ynx(67,53),t.YNc(68,Yn,5,2,"td",31),t.BQk(),t.YNc(69,Bn,1,0,"tr",54),t.YNc(70,zn,1,3,"tr",55),t.YNc(71,Vn,1,0,"tr",56),t.YNc(72,Gn,1,0,"tr",57),t.qZA()()(),t._UZ(73,"mat-paginator",58),t.qZA()}if(2&n){const e=t.oxw();t.xp6(3),t.Q6J("icon",e.faHistory),t.xp6(7),t.Q6J("ngModel",e.selFilterBy),t.xp6(2),t.Q6J("ngForOf",t.DdM(17,Kn).concat(e.displayedColumns.slice(0,-1))),t.xp6(4),t.Q6J("ngModel",e.selFilter),t.xp6(3),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("matSortActive",e.tableSetting.sortBy)("matSortDirection",e.tableSetting.sortOrder)("dataSource",e.payments)("ngClass",t.VKq(18,Wn,""!==e.errorMessage)),t.xp6(49),t.Q6J("matRowDefColumns",e.partColumns)("matRowDefWhen",e.is_group),t.xp6(1),t.Q6J("matFooterRowDef",t.DdM(20,$n)),t.xp6(1),t.Q6J("matHeaderRowDef",e.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",e.displayedColumns),t.xp6(1),t.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}let bt=(()=>{class n{constructor(e,i,o,s,r,d,g,L){this.logger=e,this.commonService=i,this.store=o,this.rtlEffects=s,this.decimalPipe=r,this.dataService=d,this.datePipe=g,this.camelCaseWithSpaces=L,this.calledFrom="transactions",this.nodePageDefs=l.Xk,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="transactions",this.tableSetting={tableId:"payments",recordsPerPage:l.IV,sortBy:"firstPartTimestamp",sortOrder:l.Pi.DESCENDING},this.faHistory=T.qO$,this.newlyAddedPayment="",this.selNode={},this.information={},this.payments=new c.by([]),this.paymentJSONArr=[],this.paymentDecoded={},this.displayedColumns=[],this.partColumns=[],this.paymentRequest="",this.paymentDecodedHint="",this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.selFilter="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(C.LR).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e}),this.store.select(C.yD).pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{this.information=e}),this.store.select(C.nF).pipe((0,_.R)(this.unSubs[2])).subscribe(e=>{var i,o;this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=(null===(i=e.pageSettings.find(s=>s.pageId===this.PAGE_ID))||void 0===i?void 0:i.tables.find(s=>s.tableId===this.tableSetting.tableId))||(null===(o=l.c3.find(s=>s.pageId===this.PAGE_ID))||void 0===o?void 0:o.tables.find(s=>s.tableId===this.tableSetting.tableId)),this.displayedColumns=this.screenSize===l.cu.XS||this.screenSize===l.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.push("actions"),this.partColumns=[],this.displayedColumns.map(s=>this.partColumns.push("group_"+s)),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:l.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/14+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(C.PP).pipe((0,_.R)(this.unSubs[3])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.paymentJSONArr=e.payments&&e.payments.sent&&e.payments.sent.length>0?e.payments.sent:[],this.paymentJSONArr.length>0&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadPaymentsTable(this.paymentJSONArr),this.logger.info(e)})}ngAfterViewInit(){this.paymentJSONArr.length>0&&this.loadPaymentsTable(this.paymentJSONArr)}applyFilter(){this.payments.filter=this.selFilter.trim().toLowerCase()}getLabel(e){const i=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(o=>o.column===e);return i?i.label?i.label:this.camelCaseWithSpaces.transform(i.column,"_"):this.commonService.titleCase(e)}setFilterPredicate(){this.payments.filterPredicate=(e,i)=>{var o,s;let r="";switch(this.selFilterBy){case"all":r=(e.firstPartTimestamp?null===(o=this.datePipe.transform(new Date(e.firstPartTimestamp),"dd/MMM/y HH:mm"))||void 0===o?void 0:o.toLowerCase():"")+JSON.stringify(e).toLowerCase();break;case"firstPartTimestamp":r=(null===(s=this.datePipe.transform(new Date(e.firstPartTimestamp||0),"dd/MMM/y HH:mm"))||void 0===s?void 0:s.toLowerCase())||"";break;default:r=typeof e[this.selFilterBy]>"u"?"":"string"==typeof e[this.selFilterBy]?e[this.selFilterBy].toLowerCase():"boolean"==typeof e[this.selFilterBy]?e[this.selFilterBy]?"yes":"no":e[this.selFilterBy].toString()}return r.includes(i)}}loadPaymentsTable(e){this.payments=new c.by(e?[...e]:[]),this.payments.sort=this.sort,this.payments.sortingDataAccessor=(i,o)=>{var s,r,d,g;switch(o){case"firstPartTimestamp":return this.commonService.sortByKey(i.parts,"timestamp","number",null===(s=this.sort)||void 0===s?void 0:s.direction),i.firstPartTimestamp;case"id":return this.commonService.sortByKey(i.parts,"id","string",null===(r=this.sort)||void 0===r?void 0:r.direction),i.id;case"recipientNodeAlias":return this.commonService.sortByKey(i.parts,"toChannelAlias","string",null===(d=this.sort)||void 0===d?void 0:d.direction),i.recipientNodeAlias;case"recipientAmount":return this.commonService.sortByKey(i.parts,"amount","number",null===(g=this.sort)||void 0===g?void 0:g.direction),i.recipientAmount;default:return i[o]&&isNaN(i[o])?i[o].toLocaleLowerCase():i[o]?+i[o]:null}},this.payments.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter()}onSendPayment(){if(!this.paymentRequest)return!0;this.paymentDecoded.timestamp?this.sendPayment():this.dataService.decodePayment(this.paymentRequest,!1).pipe((0,K.q)(1)).subscribe(e=>{this.paymentDecoded=e,this.paymentDecoded.timestamp?(this.paymentDecoded.amount||(this.paymentDecoded.amount=0),this.sendPayment()):this.resetData()})}sendPayment(){this.newlyAddedPayment=this.paymentDecoded.paymentHash||"",this.paymentDecoded.amount&&0!==this.paymentDecoded.amount?(this.store.dispatch((0,E.c1)({payload:{data:{type:l.n_.CONFIRM,alertTitle:"Confirm Send Payment",noBtnText:"Cancel",yesBtnText:"Send Payment",message:[[{key:"paymentHash",value:this.paymentDecoded.paymentHash,title:"Payment Hash",width:100}],[{key:"nodeId",value:this.paymentDecoded.nodeId,title:"Payee",width:100}],[{key:"description",value:this.paymentDecoded.description,title:"Description",width:100}],[{key:"timestamp",value:this.paymentDecoded.timestamp,title:"Creation Date",width:50,type:l.Gi.DATE_TIME},{key:"amount",value:this.paymentDecoded.amount,title:"Amount (Sats)",width:50,type:l.Gi.NUMBER}],[{key:"expiry",value:this.paymentDecoded.expiry,title:"Expiry",width:50,type:l.Gi.NUMBER},{key:"minFinalCltvExpiry",value:this.paymentDecoded.minFinalCltvExpiry,title:"CLTV Expiry",width:50}]]}}})),this.rtlEffects.closeConfirm.pipe((0,K.q)(1)).subscribe(i=>{i&&(this.store.dispatch((0,D.oV)({payload:{invoice:this.paymentRequest,fromDialog:!1}})),this.resetData())})):(this.store.dispatch((0,E.c1)({payload:{data:{type:l.n_.CONFIRM,alertTitle:"Enter Amount and Confirm Send Payment",message:[[{key:"paymentHash",value:this.paymentDecoded.paymentHash,title:"Payment Hash",width:100}],[{key:"nodeId",value:this.paymentDecoded.nodeId,title:"Payee",width:100}],[{key:"description",value:this.paymentDecoded.description,title:"Description",width:100}],[{key:"timestamp",value:this.paymentDecoded.timestamp,title:"Creation Date",width:40,type:l.Gi.DATE_TIME},{key:"expiry",value:this.paymentDecoded.expiry,title:"Expiry",width:30,type:l.Gi.NUMBER},{key:"minFinalCltvExpiry",value:this.paymentDecoded.minFinalCltvExpiry,title:"CLTV Expiry",width:30}]],noBtnText:"Cancel",yesBtnText:"Send Payment",flgShowInput:!0,titleMessage:"It is a zero amount invoice. Enter the amount (Sats) to pay.",getInputs:[{placeholder:"Amount (Sats)",inputType:l.Gi.NUMBER,inputValue:"",width:30}]}}})),this.rtlEffects.closeConfirm.pipe((0,K.q)(1)).subscribe(o=>{o&&(this.paymentDecoded.amount=o[0].inputValue,this.store.dispatch((0,D.oV)({payload:{invoice:this.paymentRequest,amountMsat:1e3*o[0].inputValue,fromDialog:!1}})),this.resetData())}))}onPaymentRequestEntry(e){this.paymentRequest=e,this.paymentDecodedHint="",this.paymentRequest&&this.paymentRequest.length>100&&this.dataService.decodePayment(this.paymentRequest,!1).pipe((0,K.q)(1)).subscribe(i=>{this.paymentDecoded=i,this.paymentDecoded.amount?this.selNode&&this.selNode.fiatConversion?this.commonService.convertCurrency(+this.paymentDecoded.amount,l.NT.SATS,l.NT.OTHER,this.selNode.currencyUnits&&this.selNode.currencyUnits.length>2?this.selNode.currencyUnits[2]:"",this.selNode.fiatConversion).pipe((0,_.R)(this.unSubs[4])).subscribe({next:o=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats ("+o.symbol+this.decimalPipe.transform(o.OTHER?o.OTHER:0,l.Xz.OTHER)+") | Memo: "+this.paymentDecoded.description},error:o=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats | Memo: "+this.paymentDecoded.description+". Unable to convert currency."}}):this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats | Memo: "+this.paymentDecoded.description:this.paymentDecodedHint="Zero Amount Invoice | Memo: "+this.paymentDecoded.description})}openSendPaymentModal(){this.store.dispatch((0,E.qR)({payload:{data:{component:Pe}}}))}resetData(){this.paymentDecoded={},this.paymentRequest="",this.form.resetForm()}is_group(e,i){return i.parts&&i.parts.length>1}onPaymentClick(e){e.paymentHash&&""!==e.paymentHash.trim()?this.dataService.decodePayments(e.paymentHash).pipe((0,K.q)(1)).subscribe({next:i=>{setTimeout(()=>{this.showPaymentView(e,i.length&&i.length>0?i[0]:[])},0)},error:i=>{this.showPaymentView(e,[])}}):this.showPaymentView(e,[])}showPaymentView(e,i){this.store.dispatch((0,E.qR)({payload:{data:{sentPaymentInfo:i,payment:e,component:Je}}}))}onPartClick(e,i){i.paymentHash&&""!==i.paymentHash.trim()?this.dataService.decodePayments(i.paymentHash).pipe((0,K.q)(1)).subscribe({next:o=>{setTimeout(()=>{this.showPartView(e,i,o.length&&o.length>0?o[0]:[])},0)},error:o=>{this.showPartView(e,i,[])}}):this.showPartView(e,i,[])}showPartView(e,i,o){const s=[[{key:"paymentHash",value:i.paymentHash,title:"Payment Hash",width:100,type:l.Gi.STRING}],[{key:"paymentPreimage",value:i.paymentPreimage,title:"Payment Preimage",width:100,type:l.Gi.STRING}],[{key:"toChannelId",value:e.toChannelId,title:"Channel",width:100,type:l.Gi.STRING}],[{key:"id",value:e.id,title:"Part ID",width:50,type:l.Gi.STRING},{key:"timestamp",value:e.timestamp,title:"Time",width:50,type:l.Gi.DATE_TIME}],[{key:"amount",value:e.amount,title:"Amount (Sats)",width:50,type:l.Gi.NUMBER},{key:"feesPaid",value:e.feesPaid,title:"Fee (Sats)",width:50,type:l.Gi.NUMBER}]];o&&o.length>0&&o[0].paymentRequest&&o[0].paymentRequest.description&&""!==o[0].paymentRequest.description&&s.splice(3,0,[{key:"description",value:o[0].paymentRequest.description,title:"Description",width:100,type:l.Gi.STRING}]),this.store.dispatch((0,E.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:"Payment Part Information",message:s}}}))}onDownloadCSV(){if(this.payments.data&&this.payments.data.length>0){const e=JSON.parse(JSON.stringify(this.payments.data)),i=e?.reduce((o,s)=>(s.paymentHash&&""!==s.paymentHash.trim()&&(o=""===o?s.paymentHash:o+","+s.paymentHash),o),"");this.dataService.decodePayments(i).pipe((0,_.R)(this.unSubs[5])).subscribe(o=>{o.forEach((r,d)=>{r.length>0&&r[0].paymentRequest&&r[0].paymentRequest.description&&""!==r[0].paymentRequest.description&&(e[d].description=r[0].paymentRequest.description)});const s=e?.reduce((r,d)=>r.concat(d),[]);this.commonService.downloadFile(s,"Payments")})}}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(R.mQ),t.Y36(k.v),t.Y36(I.yh),t.Y36(nt.V),t.Y36(u.JJ),t.Y36(Lt.D),t.Y36(u.uU),t.Y36(G.i1))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-lightning-payments"]],viewQuery:function(e,i){if(1&e&&(t.Gf(Me,5),t.Gf(S.YE,5),t.Gf(A.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.form=o.first),t.iGM(o=t.CRH())&&(i.sort=o.first),t.iGM(o=t.CRH())&&(i.paginator=o.first)}},inputs:{calledFrom:"calledFrom"},features:[t._Bn([{provide:w.PG,useValue:{overlayPanelClass:"rtl-select-overlay"}},{provide:A.ye,useValue:(0,l.pt)("Payments")}])],decls:4,vars:3,consts:[["fxLayout","column","fxFlex","colWidth","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap",4,"ngIf"],["fxLayout","row",4,"ngIf"],["fxLayout","column","fxLayoutAlign","start stretch",4,"ngIf"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap"],["sendPaymentForm","ngForm"],["fxLayout","column","fxFlex","100"],["matInput","","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.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","row","fxLayoutAlign","start start"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","colWidth",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","colWidth","matSort","",3,"matSortActive","matSortDirection","dataSource","ngClass"],["table",""],["matColumnDef","firstPartTimestamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","id"],["matColumnDef","recipientNodeId"],["matColumnDef","recipientNodeAlias"],["matColumnDef","description"],["matColumnDef","paymentHash"],["matColumnDef","paymentPreimage"],["matColumnDef","recipientAmount"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_payment"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["matColumnDef","group_firstPartTimestamp"],["matColumnDef","group_id"],["matColumnDef","group_recipientNodeId"],["matColumnDef","group_recipientNodeAlias"],["matColumnDef","group_recipientAmount"],["matColumnDef","group_description"],["matColumnDef","group_paymentHash"],["matColumnDef","group_paymentPreimage"],["matColumnDef","group_actions"],["mat-row","",4,"matRowDef","matRowDefColumns","matRowDefWhen"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","4",1,"table-actions-button",3,"click"],["mat-footer-cell","","colspan","4"],["fxLayoutAlign","start center",1,"part-row-span"],["fxLayoutAlign","start center","class","part-row-span",4,"ngFor","ngForOf"],["fxLayoutAlign","start center",1,"ellipsis-parent","part-row-span",3,"ngStyle"],["fxLayoutAlign","end center",1,"part-row-span"],["fxLayoutAlign","end center","class","part-row-span",4,"ngFor","ngForOf"],["fxLayoutAlign","end center",1,"part-group-head"],["mat-flat-button","","color","primary","type","button","tabindex","5",1,"btn-part-expand",3,"click"],["class","part-group-details","fxLayoutAlign","end center",4,"ngFor","ngForOf"],["fxLayoutAlign","end center",1,"part-group-details"],["mat-stroked-button","","color","primary","type","button","tabindex","6",1,"btn-part-info",3,"click"],["mat-row",""],["mat-footer-row","",3,"ngClass"],["mat-header-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.YNc(1,Be,14,3,"form",1),t.YNc(2,He,3,0,"div",2),t.YNc(3,Xn,74,21,"div",3),t.qZA()),2&e&&(t.xp6(1),t.Q6J("ngIf","home"===i.calledFrom),t.xp6(1),t.Q6J("ngIf","transactions"===i.calledFrom),t.xp6(1),t.Q6J("ngIf","transactions"===i.calledFrom))},dependencies:[u.mk,u.sg,u.O5,u.PC,h._Y,h.Fj,h.JJ,h.JL,h.Q7,h.On,h.F,P.BN,m.xw,m.Wh,m.yH,Z.oO,Z.Zl,F.lW,B.Nt,x.KE,x.hX,x.bx,x.TO,Q.pW,w.gD,w.$L,V.ey,S.YE,S.nU,c.BZ,c.fO,c.as,c.w1,c.Dz,c.nj,c.mD,c.Ke,c.ge,c.ev,c.yh,c.XQ,c.Gk,c.Q2,A.NW,U.Vv,U.$V,u.JJ,u.uU],styles:[".mat-column-group_actions[_ngcontent-%COMP%] .part-group-head[_ngcontent-%COMP%], .mat-column-group_actions[_ngcontent-%COMP%] .part-group-details[_ngcontent-%COMP%]{min-height:3rem}.mat-column-group_actions[_ngcontent-%COMP%] .btn-part-expand[_ngcontent-%COMP%]{min-width:7rem;width:7rem;margin:0}.mat-column-group_actions[_ngcontent-%COMP%] .btn-part-info[_ngcontent-%COMP%]{min-width:6rem;margin:0}.mat-column-group_firstPartTimestamp[_ngcontent-%COMP%] .part-row-span[_ngcontent-%COMP%]:not(:first-of-type){padding-left:2rem}.part-row-span[_ngcontent-%COMP%]{min-height:3rem}.mat-column-group_firstPartTimestamp[_ngcontent-%COMP%]{min-width:11rem}"]}),n})();var tt=f(6534);function jn(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Description is required."),t.qZA())}function ti(n,a){if(1&n&&(t.TgZ(0,"mat-option",25),t._uU(1),t.ALo(2,"titlecase"),t.qZA()),2&n){const e=a.$implicit;t.Q6J("value",e),t.xp6(1),t.Oqu(t.lcZ(2,2,e))}}function ei(n,a){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.invoiceError)}}function ni(n,a){if(1&n&&(t.TgZ(0,"div",26),t._UZ(1,"fa-icon",27),t.YNc(2,ei,2,1,"span",11),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faExclamationTriangle),t.xp6(1),t.Q6J("ngIf",""!==e.invoiceError)}}let ii=(()=>{class n{constructor(e,i,o,s,r,d){this.dialogRef=e,this.data=i,this.store=o,this.decimalPipe=s,this.commonService=r,this.actions=d,this.faExclamationTriangle=T.eHv,this.selNode={},this.description="",this.invoiceValue=null,this.invoiceValueHint="",this.invoicePaymentReq="",this.information={},this.private=!1,this.expiryStep=100,this.pageSize=l.IV,this.timeUnitEnum=l.Qk,this.timeUnits=l.LO,this.selTimeUnit=l.Qk.SECS,this.invoiceError="",this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.pageSize=this.data.pageSize,this.store.select(C.LR).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e}),this.store.select(C.yD).pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{this.information=e}),this.actions.pipe((0,_.R)(this.unSubs[2]),(0,Y.h)(e=>e.type===l.lr.UPDATE_API_CALL_STATUS_ECL)).subscribe(e=>{e.type===l.lr.UPDATE_API_CALL_STATUS_ECL&&"CreateInvoice"===e.payload.action&&(e.payload.status===l.Bn.ERROR&&(this.invoiceError=e.payload.message),e.payload.status===l.Bn.COMPLETED&&this.dialogRef.close())})}onAddInvoice(e){if(this.invoiceError="",!this.description)return!0;let i=this.expiry?this.expiry:3600;this.expiry&&this.selTimeUnit!==l.Qk.SECS&&(i=this.commonService.convertTime(this.expiry,this.selTimeUnit,l.Qk.SECS));let o=null;o=this.invoiceValue?{description:this.description,expireIn:i,amountMsat:1e3*this.invoiceValue}:{description:this.description,expireIn:i},this.store.dispatch((0,D.Z$)({payload:o}))}resetData(){this.description="",this.invoiceValue=null,this.private=!1,this.expiry=null,this.invoiceValueHint="",this.selTimeUnit=l.Qk.SECS,this.invoiceError=""}onInvoiceValueChange(){this.selNode&&this.selNode.fiatConversion&&this.invoiceValue&&this.invoiceValue>99&&(this.invoiceValueHint="",this.commonService.convertCurrency(this.invoiceValue,l.NT.SATS,l.NT.OTHER,this.selNode.currencyUnits&&this.selNode.currencyUnits.length>2?this.selNode.currencyUnits[2]:"",this.selNode.fiatConversion).pipe((0,_.R)(this.unSubs[3])).subscribe({next:e=>{this.invoiceValueHint="= "+e.symbol+this.decimalPipe.transform(e.OTHER,l.Xz.OTHER)+" "+e.unit},error:e=>{this.invoiceValueHint="Conversion Error: "+e}}))}onTimeUnitChange(e){this.expiry&&this.selTimeUnit!==e.value&&(this.expiry=this.commonService.convertTime(this.expiry,this.selTimeUnit,e.value)),this.selTimeUnit=e.value}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(M.so),t.Y36(M.WI),t.Y36(I.yh),t.Y36(u.JJ),t.Y36(k.v),t.Y36($.eX))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-create-invoices"]],decls:41,vars:16,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","8","fxFlex","5","fxLayoutAlign","center 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"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start end"],["matInput","","autoFocus","","tabindex","2","name","description","required","",3,"ngModel","ngModelChange"],[4,"ngIf"],["fxLayout","row","fxLayoutAlign","space-between start","fxFlex","100"],["fxLayout","column","fxFlex","40"],["matInput","","type","number","tabindex","3","name","invValue",3,"step","min","ngModel","ngModelChange","keyup"],["matSuffix",""],["fxLayout","column","fxFlex","30"],["matInput","","type","number","name","exp","tabindex","4",3,"step","min","ngModel","ngModelChange"],["fxLayout","column","fxFlex","26"],["tabindex","5","name","timeUnit",3,"value","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center",1,"mt-2"],["mat-button","","color","primary","tabindex","7","type","reset",1,"mr-1",3,"click"],["mat-button","","color","primary","tabindex","8",3,"click"],[3,"value"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"]],template:function(e,i){if(1&e){const o=t.EpF();t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-header",2)(3,"div",3)(4,"span",4),t._uU(5,"Create Invoice"),t.qZA()(),t.TgZ(6,"button",5),t._uU(7,"X"),t.qZA()(),t.TgZ(8,"mat-card-content",6)(9,"form",7,8)(11,"mat-form-field",9)(12,"mat-label"),t._uU(13,"Description"),t.qZA(),t.TgZ(14,"input",10),t.NdJ("ngModelChange",function(r){return i.description=r}),t.qZA(),t.YNc(15,jn,2,0,"mat-error",11),t.qZA(),t.TgZ(16,"div",12)(17,"mat-form-field",13)(18,"mat-label"),t._uU(19,"Amount"),t.qZA(),t.TgZ(20,"input",14),t.NdJ("ngModelChange",function(r){return i.invoiceValue=r})("keyup",function(){return i.onInvoiceValueChange()}),t.qZA(),t.TgZ(21,"span",15),t._uU(22," Sats "),t.qZA(),t.TgZ(23,"mat-hint"),t._uU(24),t.qZA()(),t.TgZ(25,"mat-form-field",16)(26,"mat-label"),t._uU(27,"Expiry"),t.qZA(),t.TgZ(28,"input",17),t.NdJ("ngModelChange",function(r){return i.expiry=r}),t.qZA(),t.TgZ(29,"span",15),t._uU(30),t.ALo(31,"titlecase"),t.qZA()(),t.TgZ(32,"mat-form-field",18)(33,"mat-select",19),t.NdJ("selectionChange",function(r){return i.onTimeUnitChange(r)}),t.YNc(34,ti,3,4,"mat-option",20),t.qZA()()(),t.YNc(35,ni,3,2,"div",21),t.TgZ(36,"div",22)(37,"button",23),t.NdJ("click",function(){return i.resetData()}),t._uU(38,"Clear Field"),t.qZA(),t.TgZ(39,"button",24),t.NdJ("click",function(){t.CHM(o);const r=t.MAs(10);return t.KtG(i.onAddInvoice(r))}),t._uU(40,"Create Invoice"),t.qZA()()()()()()}2&e&&(t.xp6(6),t.Q6J("mat-dialog-close",!1),t.xp6(8),t.Q6J("ngModel",i.description),t.xp6(1),t.Q6J("ngIf",!i.description),t.xp6(5),t.Q6J("step",100)("min",1)("ngModel",i.invoiceValue),t.xp6(4),t.Oqu(i.invoiceValueHint),t.xp6(4),t.Q6J("step",i.selTimeUnit===i.timeUnitEnum.SECS?300:i.selTimeUnit===i.timeUnitEnum.MINS?10:i.selTimeUnit===i.timeUnitEnum.HOURS?2:1)("min",1)("ngModel",i.expiry),t.xp6(2),t.hij("",t.lcZ(31,14,i.selTimeUnit)," "),t.xp6(3),t.Q6J("value",i.selTimeUnit),t.xp6(1),t.Q6J("ngForOf",i.timeUnits),t.xp6(1),t.Q6J("ngIf",""!==i.invoiceError))},dependencies:[u.sg,u.O5,h._Y,h.Fj,h.wV,h.JJ,h.JL,h.Q7,h.qQ,h.On,h.F,P.BN,m.xw,m.Wh,m.yH,M.ZT,F.lW,b.dn,b.dk,B.Nt,x.KE,x.hX,x.bx,x.TO,x.R9,w.gD,V.ey,j.h,tt.q,u.rS]}),n})();var ai=f(7766);function oi(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Description is required."),t.qZA())}function si(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"form",4,5)(2,"mat-form-field",6)(3,"mat-label"),t._uU(4,"Description"),t.qZA(),t.TgZ(5,"input",7),t.NdJ("ngModelChange",function(o){t.CHM(e);const s=t.oxw();return t.KtG(s.description=o)}),t.qZA(),t.YNc(6,oi,2,0,"mat-error",8),t.qZA(),t.TgZ(7,"mat-form-field",9)(8,"mat-label"),t._uU(9,"Amount"),t.qZA(),t.TgZ(10,"input",10,11),t.NdJ("ngModelChange",function(o){t.CHM(e);const s=t.oxw();return t.KtG(s.invoiceValue=o)})("keyup",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onInvoiceValueChange())}),t.qZA(),t.TgZ(12,"span",12),t._uU(13," Sats "),t.qZA(),t.TgZ(14,"mat-hint"),t._uU(15),t.qZA()(),t.TgZ(16,"div",13)(17,"button",14),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.resetData())}),t._uU(18,"Clear Field"),t.qZA(),t.TgZ(19,"button",15),t.NdJ("click",function(){t.CHM(e);const o=t.MAs(1),s=t.oxw();return t.KtG(s.onAddInvoice(o))}),t._uU(20,"Create Invoice"),t.qZA()()()}if(2&n){const e=t.oxw();t.xp6(5),t.Q6J("ngModel",e.description),t.xp6(1),t.Q6J("ngIf",!e.description),t.xp6(4),t.Q6J("step",100)("min",1)("ngModel",e.invoiceValue),t.xp6(5),t.Oqu(e.invoiceValueHint)}}function li(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",16)(1,"button",17),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.openCreateInvoiceModal())}),t._uU(2,"Create Invoice"),t.qZA()()}}function ri(n,a){if(1&n&&(t.TgZ(0,"mat-option",55),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.Q6J("value",e),t.xp6(1),t.Oqu(i.getLabel(e))}}function ci(n,a){1&n&&t._UZ(0,"mat-progress-bar",56)}function ui(n,a){1&n&&t._UZ(0,"th",57)}const rt=function(n){return{"mr-0":n}};function pi(n,a){if(1&n&&t._UZ(0,"span",62),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.VKq(1,rt,e.screenSize===e.screenSizeEnum.XS))}}function mi(n,a){if(1&n&&t._UZ(0,"span",63),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.VKq(1,rt,e.screenSize===e.screenSizeEnum.XS))}}function di(n,a){if(1&n&&t._UZ(0,"span",64),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.VKq(1,rt,e.screenSize===e.screenSizeEnum.XS))}}function hi(n,a){if(1&n&&(t.TgZ(0,"td",58),t.YNc(1,pi,1,3,"span",59),t.YNc(2,mi,1,3,"span",60),t.YNc(3,di,1,3,"span",61),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Q6J("ngIf","received"===(null==e?null:e.status)),t.xp6(1),t.Q6J("ngIf","unpaid"===(null==e?null:e.status)),t.xp6(1),t.Q6J("ngIf",!(null!=e&&e.status)||"expired"===(null==e?null:e.status)||"unknown"===(null==e?null:e.status))}}function _i(n,a){1&n&&(t.TgZ(0,"th",65),t._uU(1,"Date Created"),t.qZA())}function gi(n,a){if(1&n&&(t.TgZ(0,"td",58),t._uU(1),t.ALo(2,"date"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,1e3*(null==e?null:e.timestamp),"dd/MMM/y HH:mm"))}}function fi(n,a){1&n&&(t.TgZ(0,"th",65),t._uU(1,"Date Expiry"),t.qZA())}function Ci(n,a){if(1&n&&(t.TgZ(0,"td",58),t._uU(1),t.ALo(2,"date"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,1e3*(null==e?null:e.expiresAt),"dd/MMM/y HH:mm")||"-")}}function xi(n,a){1&n&&(t.TgZ(0,"th",65),t._uU(1,"Date Settled"),t.qZA())}function yi(n,a){if(1&n&&(t.TgZ(0,"td",58),t._uU(1),t.ALo(2,"date"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,1e3*(null==e?null:e.receivedAt),"dd/MMM/y HH:mm")||"-")}}function vi(n,a){1&n&&(t.TgZ(0,"th",65),t._uU(1,"Node ID"),t.qZA())}const ct=function(n){return{width:n}};function Ti(n,a){if(1&n&&(t.TgZ(0,"td",58)(1,"div",66)(2,"span",67),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,ct,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function Li(n,a){1&n&&(t.TgZ(0,"th",65),t._uU(1,"Description"),t.qZA())}function bi(n,a){if(1&n&&(t.TgZ(0,"td",58)(1,"div",66)(2,"span",67),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,ct,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.description)}}function Si(n,a){1&n&&(t.TgZ(0,"th",65),t._uU(1,"Payment Hash"),t.qZA())}function Zi(n,a){if(1&n&&(t.TgZ(0,"td",58)(1,"div",66)(2,"span",67),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,ct,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.paymentHash)}}function Ai(n,a){1&n&&(t.TgZ(0,"th",68),t._uU(1,"Amount (Sats)"),t.qZA())}function Ei(n,a){if(1&n&&(t.TgZ(0,"td",58)(1,"span",69),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(null!=e&&e.amount?t.xi3(3,1,null==e?null:e.amount,"1.0-0"):"-")}}function wi(n,a){1&n&&(t.TgZ(0,"th",70),t._uU(1," Amount Settled (Sats)"),t.qZA())}function Ii(n,a){if(1&n&&(t.TgZ(0,"td",58)(1,"span",69),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(null!=e&&e.amountSettled?t.xi3(3,1,null==e?null:e.amountSettled,"1.0-0"):"-")}}function Fi(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",71)(1,"div",72)(2,"mat-select",73),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",74),t.NdJ("click",function(){t.CHM(e);const o=t.oxw(2);return t.KtG(o.onDownloadCSV())}),t._uU(5,"Download CSV"),t.qZA()()()()}}function qi(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",75)(1,"div",72)(2,"mat-select",76),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",74),t.NdJ("click",function(){const s=t.CHM(e).$implicit,r=t.oxw(2);return t.KtG(r.onInvoiceClick(s))}),t._uU(5,"View Info"),t.qZA(),t.TgZ(6,"mat-option",74),t.NdJ("click",function(){const s=t.CHM(e).$implicit,r=t.oxw(2);return t.KtG(r.onRefreshInvoice(s))}),t._uU(7,"Refresh"),t.qZA()()()()}}function Ni(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No invoice available."),t.qZA())}function Oi(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting invoices..."),t.qZA())}function Pi(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Oqu(e.errorMessage)}}function Ui(n,a){if(1&n&&(t.TgZ(0,"td",77),t.YNc(1,Ni,2,0,"p",8),t.YNc(2,Oi,2,0,"p",8),t.YNc(3,Pi,2,1,"p",8),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",(!(null!=e.invoices&&e.invoices.data)||(null==e.invoices||null==e.invoices.data?null:e.invoices.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.invoices&&e.invoices.data)||(null==e.invoices||null==e.invoices.data?null:e.invoices.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.invoices&&e.invoices.data)||(null==e.invoices||null==e.invoices.data?null:e.invoices.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const Ri=function(n){return{"display-none":n}};function ki(n,a){if(1&n&&t._UZ(0,"tr",78),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,Ri,(null==e.invoices?null:e.invoices.data)&&(null==e.invoices||null==e.invoices.data?null:e.invoices.data.length)>0))}}function Di(n,a){1&n&&t._UZ(0,"tr",79)}function Ji(n,a){1&n&&t._UZ(0,"tr",80)}const Mi=function(){return["all"]},Qi=function(n){return{"error-border":n}},Yi=function(){return["no_invoice"]};function Bi(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",18)(1,"div",19)(2,"div",20),t._UZ(3,"fa-icon",21),t.TgZ(4,"span",22),t._uU(5,"Invoices History"),t.qZA()(),t.TgZ(6,"div",23)(7,"mat-form-field",24)(8,"mat-label"),t._uU(9,"Filter By"),t.qZA(),t.TgZ(10,"mat-select",25),t.NdJ("ngModelChange",function(o){t.CHM(e);const s=t.oxw();return t.KtG(s.selFilterBy=o)})("selectionChange",function(){t.CHM(e);const o=t.oxw();return o.selFilter="",t.KtG(o.applyFilter())}),t.TgZ(11,"perfect-scrollbar"),t.YNc(12,ri,2,2,"mat-option",26),t.qZA()()(),t.TgZ(13,"mat-form-field",24)(14,"mat-label"),t._uU(15,"Filter"),t.qZA(),t.TgZ(16,"input",27),t.NdJ("ngModelChange",function(o){t.CHM(e);const s=t.oxw();return t.KtG(s.selFilter=o)})("input",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.applyFilter())})("keyup",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.applyFilter())}),t.qZA()()()(),t.TgZ(17,"div",28),t.YNc(18,ci,1,0,"mat-progress-bar",29),t.TgZ(19,"table",30,31),t.ynx(21,32),t.YNc(22,ui,1,0,"th",33),t.YNc(23,hi,4,3,"td",34),t.BQk(),t.ynx(24,35),t.YNc(25,_i,2,0,"th",36),t.YNc(26,gi,3,4,"td",34),t.BQk(),t.ynx(27,37),t.YNc(28,fi,2,0,"th",36),t.YNc(29,Ci,3,4,"td",34),t.BQk(),t.ynx(30,38),t.YNc(31,xi,2,0,"th",36),t.YNc(32,yi,3,4,"td",34),t.BQk(),t.ynx(33,39),t.YNc(34,vi,2,0,"th",36),t.YNc(35,Ti,4,4,"td",34),t.BQk(),t.ynx(36,40),t.YNc(37,Li,2,0,"th",36),t.YNc(38,bi,4,4,"td",34),t.BQk(),t.ynx(39,41),t.YNc(40,Si,2,0,"th",36),t.YNc(41,Zi,4,4,"td",34),t.BQk(),t.ynx(42,42),t.YNc(43,Ai,2,0,"th",43),t.YNc(44,Ei,4,4,"td",34),t.BQk(),t.ynx(45,44),t.YNc(46,wi,2,0,"th",45),t.YNc(47,Ii,4,4,"td",34),t.BQk(),t.ynx(48,46),t.YNc(49,Fi,6,0,"th",47),t.YNc(50,qi,8,0,"td",48),t.BQk(),t.ynx(51,49),t.YNc(52,Ui,4,3,"td",50),t.BQk(),t.YNc(53,ki,1,3,"tr",51),t.YNc(54,Di,1,0,"tr",52),t.YNc(55,Ji,1,0,"tr",53),t.qZA()(),t._UZ(56,"mat-paginator",54),t.qZA()}if(2&n){const e=t.oxw();t.xp6(3),t.Q6J("icon",e.faHistory),t.xp6(7),t.Q6J("ngModel",e.selFilterBy),t.xp6(2),t.Q6J("ngForOf",t.DdM(15,Mi).concat(e.displayedColumns.slice(0,-1))),t.xp6(4),t.Q6J("ngModel",e.selFilter),t.xp6(2),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("matSortActive",e.tableSetting.sortBy)("matSortDirection",e.tableSetting.sortOrder)("dataSource",e.invoices)("ngClass",t.VKq(16,Qi,""!==e.errorMessage)),t.xp6(34),t.Q6J("matFooterRowDef",t.DdM(18,Yi)),t.xp6(1),t.Q6J("matHeaderRowDef",e.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",e.displayedColumns),t.xp6(1),t.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}let St=(()=>{class n{constructor(e,i,o,s,r,d,g){this.logger=e,this.store=i,this.decimalPipe=o,this.commonService=s,this.datePipe=r,this.actions=d,this.camelCaseWithSpaces=g,this.calledFrom="transactions",this.faHistory=T.qO$,this.nodePageDefs=l.Xk,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="transactions",this.tableSetting={tableId:"invoices",recordsPerPage:l.IV,sortBy:"expiresAt",sortOrder:l.Pi.DESCENDING},this.selNode={},this.newlyAddedInvoiceMemo="",this.newlyAddedInvoiceValue=0,this.description="",this.invoiceValue=null,this.invoiceValueHint="",this.displayedColumns=[],this.invoicePaymentReq="",this.invoices=new c.by([]),this.invoiceJSONArr=[],this.information={},this.selFilter="",this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(C.LR).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e}),this.store.select(C.yD).pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{this.information=e}),this.store.select(C.nF).pipe((0,_.R)(this.unSubs[2])).subscribe(e=>{var i,o;this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=(null===(i=e.pageSettings.find(s=>s.pageId===this.PAGE_ID))||void 0===i?void 0:i.tables.find(s=>s.tableId===this.tableSetting.tableId))||(null===(o=l.c3.find(s=>s.pageId===this.PAGE_ID))||void 0===o?void 0:o.tables.find(s=>s.tableId===this.tableSetting.tableId)),this.displayedColumns=this.screenSize===l.cu.XS||this.screenSize===l.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("status"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:l.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/14+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(C.Ef).pipe((0,_.R)(this.unSubs[3])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.invoiceJSONArr=e.invoices&&e.invoices.length>0?e.invoices:[],this.invoiceJSONArr&&this.invoiceJSONArr.length>0&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadInvoicesTable(this.invoiceJSONArr),this.logger.info(e)}),this.actions.pipe((0,_.R)(this.unSubs[4]),(0,Y.h)(e=>e.type===l.lr.SET_LOOKUP_ECL||e.type===l.lr.UPDATE_API_CALL_STATUS_ECL)).subscribe(e=>{e.type===l.lr.SET_LOOKUP_ECL&&this.invoiceJSONArr.length>0&&this.sort&&this.paginator&&e.payload&&(this.updateInvoicesData(JSON.parse(JSON.stringify(e.payload))),this.loadInvoicesTable(this.invoiceJSONArr))})}ngAfterViewInit(){this.invoiceJSONArr&&this.invoiceJSONArr.length>0&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadInvoicesTable(this.invoiceJSONArr)}openCreateInvoiceModal(){this.store.dispatch((0,E.qR)({payload:{data:{pageSize:this.pageSize,component:ii}}}))}onAddInvoice(e){if(!this.description)return!0;const i=this.expiry?this.expiry:3600;this.newlyAddedInvoiceMemo="ulbl"+Math.random().toString(36).slice(2)+Date.now(),this.newlyAddedInvoiceValue=this.invoiceValue;let o=null;o=this.invoiceValue?{description:this.description,expireIn:i,amountMsat:1e3*this.invoiceValue}:{description:this.description,expireIn:i},this.store.dispatch((0,D.Z$)({payload:o})),this.resetData()}onInvoiceClick(e){this.store.dispatch((0,E.qR)({payload:{data:{invoice:e,newlyAdded:!1,component:ai.R}}}))}onRefreshInvoice(e){this.store.dispatch((0,D.n7)({payload:e.paymentHash}))}updateInvoicesData(e){var i;this.invoiceJSONArr=null===(i=this.invoiceJSONArr)||void 0===i?void 0:i.map(o=>o.paymentHash===e.paymentHash?e:o)}applyFilter(){this.invoices.filter=this.selFilter.trim().toLowerCase()}getLabel(e){const i=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(o=>o.column===e);return i?i.label?i.label:this.camelCaseWithSpaces.transform(i.column,"_"):this.commonService.titleCase(e)}setFilterPredicate(){this.invoices.filterPredicate=(e,i)=>{var o,s,r,d;let g="";switch(this.selFilterBy){case"all":g=(e.timestamp?null===(o=this.datePipe.transform(new Date(1e3*e.timestamp),"dd/MMM/y HH:mm"))||void 0===o?void 0:o.toLowerCase():"")+JSON.stringify(e).toLowerCase();break;case"status":g=e?.status&&"expired"!==e?.status&&"unknown"!==e?.status?null===(s=e.status)||void 0===s?void 0:s.toLowerCase():"expired/unknown";break;case"timestamp":case"expiresAt":case"receivedAt":g=(null===(r=this.datePipe.transform(new Date(1e3*(e[this.selFilterBy]||0)),"dd/MMM/y HH:mm"))||void 0===r?void 0:r.toLowerCase())||"";break;case"amount":case"amountSettled":g=(null===(d=e[this.selFilterBy])||void 0===d?void 0:d.toString())||"-";break;default:g=typeof e[this.selFilterBy]>"u"?"":"string"==typeof e[this.selFilterBy]?e[this.selFilterBy].toLowerCase():"boolean"==typeof e[this.selFilterBy]?e[this.selFilterBy]?"yes":"no":e[this.selFilterBy].toString()}return"status"===this.selFilterBy?0===g.indexOf(i):g.includes(i)}}loadInvoicesTable(e){this.invoices=new c.by(e?[...e]:[]),this.invoices.sort=this.sort,this.invoices.sortingDataAccessor=(i,o)=>i[o]&&isNaN(i[o])?i[o].toLocaleLowerCase():i[o]?+i[o]:null,this.invoices.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter()}resetData(){this.description="",this.invoiceValue=null,this.expiry=null,this.invoiceValueHint=""}onInvoiceValueChange(){this.selNode&&this.selNode.fiatConversion&&this.invoiceValue&&this.invoiceValue>99&&(this.invoiceValueHint="",this.commonService.convertCurrency(this.invoiceValue,l.NT.SATS,l.NT.OTHER,this.selNode.currencyUnits&&this.selNode.currencyUnits.length>2?this.selNode.currencyUnits[2]:"",this.selNode.fiatConversion).pipe((0,_.R)(this.unSubs[5])).subscribe({next:e=>{this.invoiceValueHint="= "+e.symbol+this.decimalPipe.transform(e.OTHER,l.Xz.OTHER)+" "+e.unit},error:e=>{this.invoiceValueHint="Conversion Error: "+e}}))}onDownloadCSV(){this.invoices.data&&this.invoices.data.length>0&&this.commonService.downloadFile(this.invoices.data,"Invoices")}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(R.mQ),t.Y36(I.yh),t.Y36(u.JJ),t.Y36(k.v),t.Y36(u.uU),t.Y36($.eX),t.Y36(G.i1))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-lightning-invoices"]],viewQuery:function(e,i){if(1&e&&(t.Gf(S.YE,5),t.Gf(A.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.sort=o.first),t.iGM(o=t.CRH())&&(i.paginator=o.first)}},inputs:{calledFrom:"calledFrom"},features:[t._Bn([{provide:w.PG,useValue:{overlayPanelClass:"rtl-select-overlay"}},{provide:A.ye,useValue:(0,l.pt)("Invoices")}])],decls:4,vars:3,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch"],["fxLayout","row wrap","fxLayoutAlign","stretch start","fxFlex","100",4,"ngIf"],["fxLayout","row",4,"ngIf"],["fxLayout","column","fxLayoutAlign","start stretch",4,"ngIf"],["fxLayout","row wrap","fxLayoutAlign","stretch start","fxFlex","100"],["addInvoiceForm","ngForm"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["matInput","","tabindex","2","name","description","required","true",3,"ngModel","ngModelChange"],[4,"ngIf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start end"],["matInput","","type","number","tabindex","3","name","invValue",3,"step","min","ngModel","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.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","column","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"matSortActive","matSortDirection","dataSource","ngClass"],["table",""],["matColumnDef","status"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","Status",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","timestamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","expiresAt"],["matColumnDef","receivedAt"],["matColumnDef","nodeId"],["matColumnDef","description"],["matColumnDef","paymentHash"],["matColumnDef","amount"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","amountSettled"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","class","p1-3",4,"matHeaderCellDef"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_invoice"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","Status"],["mat-cell",""],["class","dot green","matTooltip","Received","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot yellow","matTooltip","Unpaid","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot red","matTooltip","Expired/Unknown","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["matTooltip","Received","matTooltipPosition","right",1,"dot","green",3,"ngClass"],["matTooltip","Unpaid","matTooltipPosition","right",1,"dot","yellow",3,"ngClass"],["matTooltip","Expired/Unknown","matTooltipPosition","right",1,"dot","red",3,"ngClass"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",1,"p1-3"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["placeholder","Actions","tabindex","4",1,"mr-0"],["mat-footer-cell","","colspan","4"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.YNc(1,si,21,6,"form",1),t.YNc(2,li,3,0,"div",2),t.YNc(3,Bi,57,19,"div",3),t.qZA()),2&e&&(t.xp6(1),t.Q6J("ngIf","home"===i.calledFrom),t.xp6(1),t.Q6J("ngIf","transactions"===i.calledFrom),t.xp6(1),t.Q6J("ngIf","transactions"===i.calledFrom))},dependencies:[u.mk,u.sg,u.O5,u.PC,h._Y,h.Fj,h.wV,h.JJ,h.JL,h.Q7,h.qQ,h.On,h.F,P.BN,m.xw,m.Wh,m.yH,Z.oO,Z.Zl,F.lW,B.Nt,x.KE,x.hX,x.bx,x.TO,x.R9,Q.pW,w.gD,w.$L,V.ey,S.YE,S.nU,c.BZ,c.fO,c.as,c.w1,c.Dz,c.nj,c.mD,c.Ke,c.ge,c.ev,c.yh,c.XQ,c.Gk,c.Q2,W.gM,A.NW,U.Vv,U.$V,tt.q,u.JJ,u.uU],styles:[".mat-column-status[_ngcontent-%COMP%]{max-width:2.2rem;width:2.2rem;text-overflow:unset}"]}),n})();function Hi(n,a){if(1&n&&(t.TgZ(0,"button",26)(1,"mat-icon"),t._uU(2,"more_vert"),t.qZA()()),2&n){t.oxw();const e=t.MAs(11);t.Q6J("matMenuTriggerFor",e)}}function zi(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",27),t.NdJ("click",function(){const s=t.CHM(e).index,r=t.oxw().$implicit,d=t.oxw(2);return t.KtG(d.onNavigateTo(r.links[s]))}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit;t.xp6(1),t.Oqu(e)}}function Vi(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",27),t.NdJ("click",function(){t.CHM(e);const o=t.oxw(3);return t.KtG(o.onsortChannelsBy())}),t._uU(1),t.qZA()}if(2&n){const e=t.oxw(3);t.xp6(1),t.hij("Sort By ","Balance Score"===e.sortField?"Capacity":"Balance Score","")}}function Gi(n,a){1&n&&t._UZ(0,"mat-progress-bar",28)}function Ki(n,a){if(1&n&&t._UZ(0,"rtl-ecl-node-info",29),2&n){const e=t.oxw(3);t.Q6J("information",e.information)("showColorFieldSeparately",!1)}}function Wi(n,a){if(1&n&&t._UZ(0,"rtl-ecl-balances-info",30),2&n){const e=t.oxw(3);t.Q6J("balances",e.balances)("errorMessage",e.errorMessages[2]+" "+e.errorMessages[3])}}function $i(n,a){if(1&n&&t._UZ(0,"rtl-ecl-channel-capacity-info",31),2&n){const e=t.oxw(3);t.Q6J("sortBy",e.sortField)("channelBalances",e.channelBalances)("allChannels",e.allChannelsCapacity)("errorMessage",e.errorMessages[2])}}function Xi(n,a){if(1&n&&t._UZ(0,"rtl-ecl-fee-info",32),2&n){const e=t.oxw(3);t.Q6J("fees",e.fees)("errorMessage",e.errorMessages[1])}}function ji(n,a){if(1&n&&t._UZ(0,"rtl-ecl-channel-status-info",33),2&n){const e=t.oxw(3);t.Q6J("channelsStatus",e.channelsStatus)("errorMessage",e.errorMessages[2])}}function ta(n,a){1&n&&(t.TgZ(0,"h3"),t._uU(1,"Error! Unable to find information!"),t.qZA())}const Zt=function(n){return{"dashboard-card-content":!0,"error-border":n}};function ea(n,a){if(1&n&&(t.TgZ(0,"mat-grid-tile",8)(1,"mat-card",9)(2,"mat-card-header")(3,"mat-card-title",10)(4,"div"),t._UZ(5,"fa-icon",11),t.TgZ(6,"span"),t._uU(7),t.qZA()(),t.TgZ(8,"div"),t.YNc(9,Hi,3,1,"button",12),t.TgZ(10,"mat-menu",13,14),t.YNc(12,zi,2,1,"button",15),t.YNc(13,Vi,2,1,"button",16),t.qZA()()()(),t.TgZ(14,"mat-card-content",17),t.YNc(15,Gi,1,0,"mat-progress-bar",18),t.TgZ(16,"div",19),t.YNc(17,Ki,1,2,"rtl-ecl-node-info",20),t.YNc(18,Wi,1,2,"rtl-ecl-balances-info",21),t.YNc(19,$i,1,4,"rtl-ecl-channel-capacity-info",22),t.YNc(20,Xi,1,2,"rtl-ecl-fee-info",23),t.YNc(21,ji,1,2,"rtl-ecl-channel-status-info",24),t.YNc(22,ta,2,0,"h3",25),t.qZA()()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.Q6J("colspan",e.cols)("rowspan",e.rows),t.xp6(5),t.Q6J("icon",e.icon),t.xp6(2),t.Oqu(e.title),t.xp6(2),t.Q6J("ngIf",e.links[0]),t.xp6(3),t.Q6J("ngForOf",e.goToOptions),t.xp6(1),t.Q6J("ngIf","capacity"===e.id),t.xp6(1),t.s9C("fxFlex","capacity"===e.id?90:70),t.Q6J("ngClass",t.VKq(16,Zt,"node"===e.id&&i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.ERROR||"balance"===e.id&&(i.apiCallStatusAllChannels.status===i.apiCallStatusEnum.ERROR||i.apiCallStatusOCBal.status===i.apiCallStatusEnum.ERROR)||("capacity"===e.id||"status"===e.id)&&i.apiCallStatusAllChannels.status===i.apiCallStatusEnum.ERROR||"fee"===e.id&&i.apiCallStatusFees.status===i.apiCallStatusEnum.ERROR)),t.xp6(1),t.Q6J("ngIf","node"===e.id&&i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.INITIATED||"balance"===e.id&&(i.apiCallStatusAllChannels.status===i.apiCallStatusEnum.INITIATED||i.apiCallStatusOCBal.status===i.apiCallStatusEnum.INITIATED)||("capacity"===e.id||"status"===e.id)&&i.apiCallStatusAllChannels.status===i.apiCallStatusEnum.INITIATED||"fee"===e.id&&i.apiCallStatusFees.status===i.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngSwitch",e.id),t.xp6(1),t.Q6J("ngSwitchCase","node"),t.xp6(1),t.Q6J("ngSwitchCase","balance"),t.xp6(1),t.Q6J("ngSwitchCase","capacity"),t.xp6(1),t.Q6J("ngSwitchCase","fee"),t.xp6(1),t.Q6J("ngSwitchCase","status")}}function na(n,a){if(1&n&&(t.TgZ(0,"div",2)(1,"div",3),t._UZ(2,"fa-icon",4),t.TgZ(3,"span",5),t._uU(4),t.qZA()(),t.TgZ(5,"mat-grid-list",6),t.YNc(6,ea,23,18,"mat-grid-tile",7),t.qZA()()),2&n){const e=t.oxw();t.xp6(2),t.Q6J("icon",e.apiCallStatusNodeInfo.status===e.apiCallStatusEnum.ERROR?e.faFrown:e.faSmile),t.xp6(2),t.Oqu(e.apiCallStatusNodeInfo.status===e.apiCallStatusEnum.COMPLETED?"Welcome "+e.information.alias+"! Your node is up and running.":e.apiCallStatusNodeInfo.status===e.apiCallStatusEnum.INITIATED?"Wait! Getting your node information...":"Error! Please check the server connection."),t.xp6(1),t.Q6J("rowHeight",e.operatorCardHeight),t.xp6(1),t.Q6J("ngForOf",e.operatorCards)}}function ia(n,a){if(1&n&&(t.TgZ(0,"button",26)(1,"mat-icon"),t._uU(2,"more_vert"),t.qZA()()),2&n){t.oxw();const e=t.MAs(9);t.Q6J("matMenuTriggerFor",e)}}function aa(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",27),t.NdJ("click",function(){const s=t.CHM(e).index,r=t.oxw(2).$implicit,d=t.oxw(2);return t.KtG(d.onNavigateTo(r.links[s]))}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit;t.xp6(1),t.Oqu(e)}}function oa(n,a){if(1&n&&(t.TgZ(0,"mat-card-header")(1,"mat-card-title",10)(2,"div"),t._UZ(3,"fa-icon",11),t.TgZ(4,"span"),t._uU(5),t.qZA()(),t.TgZ(6,"div"),t.YNc(7,ia,3,1,"button",12),t.TgZ(8,"mat-menu",13,42),t.YNc(10,aa,2,1,"button",15),t.qZA()()()()),2&n){const e=t.oxw().$implicit;t.xp6(3),t.Q6J("icon",e.icon),t.xp6(2),t.Oqu(e.title),t.xp6(2),t.Q6J("ngIf",e.links[0]),t.xp6(3),t.Q6J("ngForOf",e.goToOptions)}}function sa(n,a){1&n&&t._UZ(0,"mat-progress-bar",28)}function la(n,a){if(1&n&&t._UZ(0,"rtl-ecl-node-info",43),2&n){const e=t.oxw(3);t.Q6J("information",e.information)}}function ra(n,a){if(1&n&&t._UZ(0,"rtl-ecl-balances-info",30),2&n){const e=t.oxw(3);t.Q6J("balances",e.balances)("errorMessage",e.errorMessages[2]+" "+e.errorMessages[3])}}function ca(n,a){if(1&n&&t._UZ(0,"rtl-ecl-channel-liquidity-info",44),2&n){const e=t.oxw(3);t.Q6J("direction","In")("totalLiquidity",e.totalInboundLiquidity)("allChannels",e.allInboundChannels)("errorMessage",e.errorMessages[2])}}function ua(n,a){if(1&n&&t._UZ(0,"rtl-ecl-channel-liquidity-info",44),2&n){const e=t.oxw(3);t.Q6J("direction","Out")("totalLiquidity",e.totalOutboundLiquidity)("allChannels",e.allOutboundChannels)("errorMessage",e.errorMessages[2])}}function pa(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",27),t.NdJ("click",function(){const s=t.CHM(e).index,r=t.oxw(2).$implicit,d=t.oxw(2);return t.KtG(d.onNavigateTo(r.links[s]))}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit;t.xp6(1),t.Oqu(e)}}function ma(n,a){if(1&n&&(t.TgZ(0,"span",45)(1,"mat-tab-group",46)(2,"mat-tab",47),t._UZ(3,"rtl-ecl-lightning-invoices",48),t.qZA(),t.TgZ(4,"mat-tab",49),t._UZ(5,"rtl-ecl-lightning-payments",50),t.qZA()(),t.TgZ(6,"div",51)(7,"button",26)(8,"mat-icon"),t._uU(9,"more_vert"),t.qZA()(),t.TgZ(10,"mat-menu",13,52),t.YNc(12,pa,2,1,"button",15),t.qZA()()()),2&n){const e=t.MAs(11),i=t.oxw().$implicit;t.xp6(3),t.Q6J("calledFrom","home"),t.xp6(2),t.Q6J("calledFrom","home"),t.xp6(2),t.Q6J("matMenuTriggerFor",e),t.xp6(5),t.Q6J("ngForOf",i.goToOptions)}}function da(n,a){1&n&&(t.TgZ(0,"h3"),t._uU(1,"Error! Unable to find information!"),t.qZA())}const ha=function(n){return{"p-0":n}};function _a(n,a){if(1&n&&(t.TgZ(0,"mat-grid-tile",8)(1,"mat-card",36),t.YNc(2,oa,11,4,"mat-card-header",37),t.TgZ(3,"mat-card-content",38),t.YNc(4,sa,1,0,"mat-progress-bar",18),t.TgZ(5,"div",19),t.YNc(6,la,1,1,"rtl-ecl-node-info",39),t.YNc(7,ra,1,2,"rtl-ecl-balances-info",21),t.YNc(8,ca,1,4,"rtl-ecl-channel-liquidity-info",40),t.YNc(9,ua,1,4,"rtl-ecl-channel-liquidity-info",40),t.YNc(10,ma,13,4,"span",41),t.YNc(11,da,2,0,"h3",25),t.qZA()()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.Q6J("colspan",e.cols)("rowspan",e.rows),t.xp6(1),t.Q6J("ngClass",t.VKq(13,ha,"transactions"===e.id)),t.xp6(1),t.Q6J("ngIf","transactions"!==e.id),t.xp6(1),t.s9C("fxFlex","transactions"===e.id?100:"balance"===e.id?70:90),t.Q6J("ngClass",t.VKq(15,Zt,"node"===e.id&&i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.ERROR||"balance"===e.id&&(i.apiCallStatusAllChannels.status===i.apiCallStatusEnum.ERROR||i.apiCallStatusOCBal.status===i.apiCallStatusEnum.ERROR)||("inboundLiq"===e.id||"outboundLiq"===e.id)&&i.apiCallStatusAllChannels.status===i.apiCallStatusEnum.ERROR)),t.xp6(1),t.Q6J("ngIf","node"===e.id&&i.apiCallStatusNodeInfo.status===i.apiCallStatusEnum.INITIATED||"balance"===e.id&&(i.apiCallStatusAllChannels.status===i.apiCallStatusEnum.INITIATED||i.apiCallStatusOCBal.status===i.apiCallStatusEnum.INITIATED)||("inboundLiq"===e.id||"outboundLiq"===e.id)&&i.apiCallStatusAllChannels.status===i.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngSwitch",e.id),t.xp6(1),t.Q6J("ngSwitchCase","node"),t.xp6(1),t.Q6J("ngSwitchCase","balance"),t.xp6(1),t.Q6J("ngSwitchCase","inboundLiq"),t.xp6(1),t.Q6J("ngSwitchCase","outboundLiq"),t.xp6(1),t.Q6J("ngSwitchCase","transactions")}}function ga(n,a){if(1&n&&(t.TgZ(0,"div",34),t._UZ(1,"fa-icon",4),t.TgZ(2,"span",5),t._uU(3),t.qZA()(),t.TgZ(4,"mat-grid-list",35),t.YNc(5,_a,12,17,"mat-grid-tile",7),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faSmile),t.xp6(2),t.hij("Welcome ",e.information.alias,"! Your node is up and running."),t.xp6(1),t.Q6J("rowHeight",e.merchantCardHeight),t.xp6(1),t.Q6J("ngForOf",e.merchantCards)}}let fa=(()=>{class n{constructor(e,i,o,s){this.logger=e,this.store=i,this.commonService=o,this.router=s,this.faSmile=xt.ctA,this.faFrown=xt.KfU,this.faAngleDoubleDown=T.Sbq,this.faAngleDoubleUp=T.Vfw,this.faChartPie=T.OS1,this.faBolt=T.BDt,this.faServer=T.xf3,this.faNetworkWired=T.kXW,this.userPersonaEnum=l.ol,this.channelBalances={localBalance:0,remoteBalance:0,balancedness:0},this.selNode={},this.information={},this.channels=[],this.onchainBalance={},this.balances={onchain:-1,lightning:-1,total:0},this.channelsStatus={},this.allChannelsCapacity=[],this.allInboundChannels=[],this.allOutboundChannels=[],this.totalInboundLiquidity=0,this.totalOutboundLiquidity=0,this.operatorCards=[],this.merchantCards=[],this.screenSize="",this.operatorCardHeight="390px",this.merchantCardHeight="62px",this.sortField="Balance Score",this.errorMessages=["","","",""],this.apiCallStatusNodeInfo={status:l.Bn.COMPLETED},this.apiCallStatusFees={status:l.Bn.COMPLETED},this.apiCallStatusOCBal={status:l.Bn.COMPLETED},this.apiCallStatusAllChannels={status:l.Bn.COMPLETED},this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===l.cu.XS?(this.operatorCards=[{id:"node",goToOptions:[],links:[],icon:this.faServer,title:"Node Information",cols:10,rows:1},{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:10,rows:1},{id:"fee",goToOptions:["Routing","Fees Summary"],links:["routing","reports"],icon:this.faBolt,title:"Routing Fee",cols:10,rows:1},{id:"status",goToOptions:["Channels","Inactive Channels"],links:["connections","connections/channels/inactive"],icon:this.faNetworkWired,title:"Channels",cols:10,rows:1},{id:"capacity",goToOptions:["Channels"],links:["connections"],icon:this.faNetworkWired,title:"Channels Capacity",cols:10,rows:2}],this.merchantCards=[{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:6,rows:4},{id:"transactions",goToOptions:["Transactions","Transactions Summary"],links:["transactions","reports/transactions"],title:"",cols:6,rows:4},{id:"inboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:6,rows:8},{id:"outboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:6,rows:8}]):this.screenSize===l.cu.SM||this.screenSize===l.cu.MD?(this.operatorCards=[{id:"node",goToOptions:[],links:[],icon:this.faServer,title:"Node Information",cols:5,rows:1},{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:5,rows:1},{id:"fee",goToOptions:["Routing","Fees Summary"],links:["routing","reports"],icon:this.faBolt,title:"Routing Fee",cols:5,rows:1},{id:"status",goToOptions:["Channels","Inactive Channels"],links:["connections","connections/channels/inactive"],icon:this.faNetworkWired,title:"Channels",cols:5,rows:1},{id:"capacity",goToOptions:["Channels"],links:["connections"],icon:this.faNetworkWired,title:"Channels Capacity",cols:10,rows:2}],this.merchantCards=[{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:3,rows:4},{id:"transactions",goToOptions:["Transactions","Transactions Summary"],links:["transactions","reports/transactions"],title:"",cols:3,rows:4},{id:"inboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:3,rows:8},{id:"outboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:3,rows:8}]):(this.operatorCards=[{id:"node",goToOptions:[],links:[],icon:this.faServer,title:"Node Information",cols:3,rows:1},{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:3,rows:1},{id:"capacity",goToOptions:["Channels"],links:["connections"],icon:this.faNetworkWired,title:"Channels Capacity",cols:4,rows:2},{id:"fee",goToOptions:["Routing","Fees Summary"],links:["routing","reports"],icon:this.faBolt,title:"Routing Fee",cols:3,rows:1},{id:"status",goToOptions:["Channels","Inactive Channels"],links:["connections","connections/channels/inactive"],icon:this.faNetworkWired,title:"Channels",cols:3,rows:1}],this.merchantCards=[{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:2,rows:5},{id:"inboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:2,rows:10},{id:"outboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:2,rows:10},{id:"transactions",goToOptions:["Transactions","Transactions Summary"],links:["transactions","reports/transactions"],title:"",cols:2,rows:5}])}ngOnInit(){this.store.select(C.LR).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e}),this.store.select(C.T$).pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{this.errorMessages[0]="",this.apiCallStatusNodeInfo=e.apiCallStatus,this.apiCallStatusNodeInfo.status===l.Bn.ERROR&&(this.errorMessages[0]="object"==typeof this.apiCallStatusNodeInfo.message?JSON.stringify(this.apiCallStatusNodeInfo.message):this.apiCallStatusNodeInfo.message?this.apiCallStatusNodeInfo.message:""),this.information=e.information}),this.store.select(C.JG).pipe((0,_.R)(this.unSubs[2])).subscribe(e=>{this.errorMessages[1]="",this.apiCallStatusFees=e.apiCallStatus,this.apiCallStatusFees.status===l.Bn.ERROR&&(this.errorMessages[1]="object"==typeof this.apiCallStatusFees.message?JSON.stringify(this.apiCallStatusFees.message):this.apiCallStatusFees.message?this.apiCallStatusFees.message:""),this.fees=e.fees}),this.store.select(C.Xz).pipe((0,_.R)(this.unSubs[3]),(0,ot.M)(this.store.select(C.kY))).subscribe(([e,i])=>{var o,s;this.errorMessages[2]="",this.errorMessages[3]="",this.apiCallStatusAllChannels=e.apiCallStatus,this.apiCallStatusOCBal=i.apiCallStatus,this.apiCallStatusAllChannels.status===l.Bn.ERROR&&(this.errorMessages[2]="object"==typeof this.apiCallStatusAllChannels.message?JSON.stringify(this.apiCallStatusAllChannels.message):this.apiCallStatusAllChannels.message?this.apiCallStatusAllChannels.message:""),this.apiCallStatusOCBal.status===l.Bn.ERROR&&(this.errorMessages[3]="object"==typeof this.apiCallStatusOCBal.message?JSON.stringify(this.apiCallStatusOCBal.message):this.apiCallStatusOCBal.message?this.apiCallStatusOCBal.message:""),this.channels=e.activeChannels,this.onchainBalance=i.onchainBalance,this.balances.onchain=this.onchainBalance.total||0,this.balances.lightning=e.lightningBalance.localBalance,this.balances.total=this.balances.lightning+this.balances.onchain,this.balances=Object.assign({},this.balances);const r=e.lightningBalance.localBalance?+e.lightningBalance.localBalance:0,d=e.lightningBalance.remoteBalance?+e.lightningBalance.remoteBalance:0;this.channelBalances={localBalance:r,remoteBalance:d,balancedness:+(1-Math.abs((r-d)/(r+d))).toFixed(3)},this.channelsStatus=e.channelsStatus,this.totalInboundLiquidity=0,this.totalOutboundLiquidity=0,this.allChannelsCapacity=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.channels,"balancedness"))),this.allInboundChannels=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(null===(o=this.channels)||void 0===o?void 0:o.filter(L=>(L.toRemote||0)>0),"toRemote"))),this.allOutboundChannels=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(null===(s=this.channels)||void 0===s?void 0:s.filter(L=>(L.toLocal||0)>0),"toLocal"))),this.channels.forEach(L=>{this.totalInboundLiquidity=this.totalInboundLiquidity+Math.ceil(L.toRemote||0),this.totalOutboundLiquidity=this.totalOutboundLiquidity+Math.floor(L.toLocal||0)}),this.logger.info(e)})}onNavigateTo(e){this.router.navigateByUrl("/ecl/"+e)}onsortChannelsBy(){"Balance Score"===this.sortField?(this.sortField="Capacity",this.allChannelsCapacity=this.channels.sort((e,i)=>{const o=+(e.toLocal||0)+ +(e.toRemote||0),s=+(i.toLocal||0)+ +(i.toRemote||0);return o>s?-1:o<s?1:0})):(this.sortField="Balance Score",this.allChannelsCapacity=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.channels,"balancedness"))))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(R.mQ),t.Y36(I.yh),t.Y36(k.v),t.Y36(y.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-home"]],decls:3,vars:2,consts:[["fxLayout","column",4,"ngIf","ngIfElse"],["merchantDashboard",""],["fxLayout","column"],["fxLayout","row","fxLayoutAlign","start start",1,"page-title-container","mb-2"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["cols","10","gutterSize","20px",3,"rowHeight"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",3,"colspan","rowspan",4,"ngFor","ngForOf"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",3,"colspan","rowspan"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",1,"h-100","dashboard-card"],["fxLayoutAlign","space-between center"],[1,"mr-1",3,"icon"],["mat-icon-button","","class","more-button","aria-label","Toggle menu",3,"matMenuTriggerFor",4,"ngIf"],["xPosition","before",1,"dashboard-vert-menu"],["menuOperator","matMenu"],["mat-menu-item","",3,"click",4,"ngFor","ngForOf"],["mat-menu-item","",3,"click",4,"ngIf"],["fxLayout","column",3,"fxFlex","ngClass"],["mode","indeterminate",4,"ngIf"],["fxLayout","column","fxFlex","100",3,"ngSwitch"],["fxFlex","100",3,"information","showColorFieldSeparately",4,"ngSwitchCase"],["fxFlex","100",3,"balances","errorMessage",4,"ngSwitchCase"],["fxFlex","100",3,"sortBy","channelBalances","allChannels","errorMessage",4,"ngSwitchCase"],["fxFlex","100",3,"fees","errorMessage",4,"ngSwitchCase"],["fxFlex","100",3,"channelsStatus","errorMessage",4,"ngSwitchCase"],[4,"ngSwitchDefault"],["mat-icon-button","","aria-label","Toggle menu",1,"more-button",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click"],["mode","indeterminate"],["fxFlex","100",3,"information","showColorFieldSeparately"],["fxFlex","100",3,"balances","errorMessage"],["fxFlex","100",3,"sortBy","channelBalances","allChannels","errorMessage"],["fxFlex","100",3,"fees","errorMessage"],["fxFlex","100",3,"channelsStatus","errorMessage"],["fxLayout","row","fxLayoutAlign","start end",1,"page-title-container","mb-2"],["cols","6","gutterSize","20px",3,"rowHeight"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",1,"h-100","dashboard-card",3,"ngClass"],[4,"ngIf"],["fxLayout","column","fxLayoutAlign","start stretch",3,"fxFlex","ngClass"],["fxFlex","100",3,"information",4,"ngSwitchCase"],["fxFlex","100",3,"direction","totalLiquidity","allChannels","errorMessage",4,"ngSwitchCase"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between start",4,"ngSwitchCase"],["menuMerchant","matMenu"],["fxFlex","100",3,"information"],["fxFlex","100",3,"direction","totalLiquidity","allChannels","errorMessage"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between start"],["mat-stretch-tabs","false","mat-align-tabs","start","fxLayout","column",1,"dashboard-tabs-group"],["label","Receive"],[1,"h-100",3,"calledFrom"],["label","Pay"],[3,"calledFrom"],[1,"underline"],["menuTransactions","matMenu"]],template:function(e,i){if(1&e&&(t.YNc(0,na,7,4,"div",0),t.YNc(1,ga,6,4,"ng-template",null,1,t.W1O)),2&e){const o=t.MAs(2);t.Q6J("ngIf",(null==i.selNode?null:i.selNode.userPersona)===i.userPersonaEnum.OPERATOR)("ngIfElse",o)}},dependencies:[u.mk,u.sg,u.O5,u.RF,u.n9,u.ED,P.BN,m.xw,m.Wh,m.yH,Z.oO,F.RK,b.a8,b.dn,b.dk,b.n5,yt.Il,yt.DX,vt.Hw,st.VK,st.OP,st.p6,Q.pW,q.uX,q.SP,Kt,Xt,ee,ae,me,Ze,bt,St]}),n})();var Ca=f(8377);const xa=["form"];function ya(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Bitcoin address is required."),t.qZA())}function va(n,a){if(1&n&&(t.TgZ(0,"mat-error"),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Oqu(e.amountError)}}function Ta(n,a){if(1&n&&(t.TgZ(0,"mat-option",29),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.Q6J("value",e),t.xp6(1),t.Oqu(e)}}function La(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Target Confirmation Blocks is required."),t.qZA())}function ba(n,a){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.sendFundError)}}function Sa(n,a){if(1&n&&(t.TgZ(0,"div",30),t._UZ(1,"fa-icon",31),t.YNc(2,ba,2,1,"span",12),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faExclamationTriangle),t.xp6(1),t.Q6J("ngIf",""!==e.sendFundError)}}let At=(()=>{class n{constructor(e,i,o,s,r,d){this.dialogRef=e,this.logger=i,this.store=o,this.commonService=s,this.decimalPipe=r,this.actions=d,this.faExclamationTriangle=T.eHv,this.selNode={},this.addressTypes=[],this.selectedAddress=l._t[1],this.blockchainBalance={},this.information={},this.newAddress="",this.transaction={},this.sendFundError="",this.fiatConversion=!1,this.amountUnits=l.uA,this.selAmountUnit=l.uA[0],this.currConvertorRate={},this.unitConversionValue=0,this.currencyUnitFormats=l.Xz,this.amountError="Amount is Required.",this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.store.select(Ca.dT).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{this.fiatConversion=e.settings.fiatConversion,this.amountUnits=e.settings.currencyUnits,this.logger.info(e)}),this.actions.pipe((0,_.R)(this.unSubs[1]),(0,Y.h)(e=>e.type===l.lr.UPDATE_API_CALL_STATUS_ECL||e.type===l.lr.SEND_ONCHAIN_FUNDS_RES_ECL)).subscribe(e=>{e.type===l.lr.SEND_ONCHAIN_FUNDS_RES_ECL&&(this.store.dispatch((0,E.jW)({payload:"Fund Sent Successfully!"})),this.dialogRef.close()),e.type===l.lr.UPDATE_API_CALL_STATUS_ECL&&e.payload.status===l.Bn.ERROR&&"SendOnchainFunds"===e.payload.action&&(this.sendFundError=e.payload.message)})}onSendFunds(){if(this.invalidValues)return!0;this.sendFundError="",this.transaction.amount&&this.selAmountUnit!==l.NT.SATS?this.commonService.convertCurrency(this.transaction.amount,this.selAmountUnit===this.amountUnits[2]?l.NT.OTHER:this.selAmountUnit,l.NT.SATS,this.amountUnits[2],this.fiatConversion).pipe((0,_.R)(this.unSubs[2])).subscribe({next:e=>{this.transaction.amount=parseInt(e[l.NT.SATS]),this.selAmountUnit=l.NT.SATS,this.store.dispatch((0,D.Iy)({payload:this.transaction}))},error:e=>{this.selAmountUnit=l.NT.SATS,this.amountError="Conversion Error: "+e}}):this.store.dispatch((0,D.Iy)({payload:this.transaction}))}get invalidValues(){return!this.transaction.address||""===this.transaction.address||!this.transaction.amount||this.transaction.amount<=0||!this.transaction.blocks||this.transaction.blocks<=0}resetData(){this.sendFundError="",this.transaction={}}onAmountUnitChange(e){const i=this,o=this.selAmountUnit===this.amountUnits[2]?l.NT.OTHER:this.selAmountUnit;let s=e.value===this.amountUnits[2]?l.NT.OTHER:e.value;this.transaction.amount&&this.selAmountUnit!==e.value&&this.commonService.convertCurrency(this.transaction.amount,o,s,this.amountUnits[2],this.fiatConversion).pipe((0,_.R)(this.unSubs[3])).subscribe({next:r=>{this.selAmountUnit=e.value,i.transaction.amount=+i.decimalPipe.transform(r[s],i.currencyUnitFormats[s]).replace(/,/g,"")},error:r=>{this.amountError="Conversion Error: "+r,this.selAmountUnit=o,s=o}})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(M.so),t.Y36(R.mQ),t.Y36(I.yh),t.Y36(k.v),t.Y36(u.JJ),t.Y36($.eX))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-on-chain-send-modal"]],viewQuery:function(e,i){if(1&e&&t.Gf(xa,7),2&e){let o;t.iGM(o=t.CRH())&&(i.form=o.first)}},decls:42,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 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"],["fxLayout","column","fxFlex","55"],["matInput","","autoFocus","","tabindex","1","name","addr","required","",3,"ngModel","ngModelChange"],["addrs","ngModel"],[4,"ngIf"],["fxLayout","column","fxFlex","30"],["matInput","","name","amt","type","number","tabindex","2","required","",3,"step","min","ngModel","ngModelChange"],["amnt","ngModel"],["matSuffix",""],["fxLayout","column","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"],["fxLayout","column","fxFlex","48","fxLayoutAlign","start center"],["matInput","","type","number","name","blocks","tabindex","8","required","true",3,"step","min","ngModel","ngModelChange"],["blocks","ngModel"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center"],["mat-button","","color","primary","tabindex","7","type","reset",1,"mr-1"],["mat-button","","color","primary","type","submit","tabindex","8"],[3,"value"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-header",2)(3,"div",3)(4,"span",4),t._uU(5,"Send Payment"),t.qZA()(),t.TgZ(6,"button",5),t._uU(7,"X"),t.qZA()(),t.TgZ(8,"mat-card-content",6)(9,"form",7,8),t.NdJ("submit",function(){return i.onSendFunds()})("reset",function(){return i.resetData()}),t.TgZ(11,"mat-form-field",9)(12,"mat-label"),t._uU(13,"Bitcoin Address"),t.qZA(),t.TgZ(14,"input",10,11),t.NdJ("ngModelChange",function(s){return i.transaction.address=s}),t.qZA(),t.YNc(16,ya,2,0,"mat-error",12),t.qZA(),t.TgZ(17,"mat-form-field",13)(18,"mat-label"),t._uU(19,"Amount"),t.qZA(),t.TgZ(20,"input",14,15),t.NdJ("ngModelChange",function(s){return i.transaction.amount=s}),t.qZA(),t.TgZ(22,"span",16),t._uU(23),t.qZA(),t.YNc(24,va,2,1,"mat-error",12),t.qZA(),t.TgZ(25,"mat-form-field",17)(26,"mat-select",18),t.NdJ("selectionChange",function(s){return i.onAmountUnitChange(s)}),t.YNc(27,Ta,2,2,"mat-option",19),t.qZA()(),t.TgZ(28,"div",20)(29,"mat-form-field",21)(30,"mat-label"),t._uU(31,"Target Confirmation Blocks"),t.qZA(),t.TgZ(32,"input",22,23),t.NdJ("ngModelChange",function(s){return i.transaction.blocks=s}),t.qZA(),t.YNc(34,La,2,0,"mat-error",12),t.qZA()(),t._UZ(35,"div",24),t.YNc(36,Sa,3,2,"div",25),t.TgZ(37,"div",26)(38,"button",27),t._uU(39,"Clear Fields"),t.qZA(),t.TgZ(40,"button",28),t._uU(41,"Send Funds"),t.qZA()()()()()()),2&e&&(t.xp6(6),t.Q6J("mat-dialog-close",!1),t.xp6(8),t.Q6J("ngModel",i.transaction.address),t.xp6(2),t.Q6J("ngIf",!i.transaction.address),t.xp6(4),t.Q6J("step",100)("min",0)("ngModel",i.transaction.amount),t.xp6(3),t.hij("",i.selAmountUnit," "),t.xp6(1),t.Q6J("ngIf",!i.transaction.amount),t.xp6(2),t.Q6J("value",i.selAmountUnit),t.xp6(1),t.Q6J("ngForOf",i.amountUnits),t.xp6(5),t.Q6J("step",1)("min",0)("ngModel",i.transaction.blocks),t.xp6(2),t.Q6J("ngIf",!i.transaction.blocks),t.xp6(2),t.Q6J("ngIf",""!==i.sendFundError))},dependencies:[u.sg,u.O5,h._Y,h.Fj,h.wV,h.JJ,h.JL,h.Q7,h.qQ,h.On,h.F,P.BN,m.xw,m.Wh,m.yH,M.ZT,F.lW,b.dn,b.dk,B.Nt,x.KE,x.hX,x.TO,x.R9,w.gD,V.ey,j.h,tt.q]}),n})();var ut=f(1203);function Za(n,a){if(1&n&&(t.TgZ(0,"mat-option",34),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw();t.Q6J("value",e),t.xp6(1),t.Oqu(i.getLabel(e))}}function Aa(n,a){1&n&&t._UZ(0,"mat-progress-bar",35)}function Ea(n,a){1&n&&(t.TgZ(0,"th",36),t._uU(1,"Date/Time"),t.qZA())}function wa(n,a){if(1&n&&(t.TgZ(0,"td",37),t._uU(1),t.ALo(2,"date"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,1e3*(null==e?null:e.timestamp),"dd/MMM/y HH:mm"))}}function Ia(n,a){1&n&&(t.TgZ(0,"th",36),t._uU(1,"Address"),t.qZA())}const pt=function(n){return{width:n}};function Fa(n,a){if(1&n&&(t.TgZ(0,"td",37)(1,"div",38)(2,"span",39),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,pt,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.address)}}function qa(n,a){1&n&&(t.TgZ(0,"th",36),t._uU(1,"Blockhash"),t.qZA())}function Na(n,a){if(1&n&&(t.TgZ(0,"td",37)(1,"div",38)(2,"span",39),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,pt,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.blockHash)}}function Oa(n,a){1&n&&(t.TgZ(0,"th",36),t._uU(1,"Transaction ID"),t.qZA())}function Pa(n,a){if(1&n&&(t.TgZ(0,"td",37)(1,"div",38)(2,"span",39),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,pt,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.txid)}}function Ua(n,a){1&n&&(t.TgZ(0,"th",40),t._uU(1,"Amount (Sats)"),t.qZA())}function Ra(n,a){if(1&n&&(t.TgZ(0,"span",43),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,null==e?null:e.amount))}}function ka(n,a){if(1&n&&(t.TgZ(0,"span",44),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij("(",t.lcZ(2,1,-1*(null==e?null:e.amount)),")")}}function Da(n,a){if(1&n&&(t.TgZ(0,"td",37),t.YNc(1,Ra,3,3,"span",41),t.YNc(2,ka,3,3,"span",42),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Q6J("ngIf",(null==e?null:e.amount)>0||0===(null==e?null:e.amount)),t.xp6(1),t.Q6J("ngIf",(null==e?null:e.amount)<0)}}function Ja(n,a){1&n&&(t.TgZ(0,"th",40),t._uU(1,"Fees (Sats)"),t.qZA())}function Ma(n,a){if(1&n&&(t.TgZ(0,"td",37)(1,"span",43),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,null==e?null:e.fees))}}function Qa(n,a){1&n&&(t.TgZ(0,"th",40),t._uU(1,"Confirmations"),t.qZA())}function Ya(n,a){if(1&n&&(t.TgZ(0,"td",37)(1,"span",43),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.lcZ(3,1,null==e?null:e.confirmations)," ")}}function Ba(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",45)(1,"div",46)(2,"mat-select",47),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",48),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onDownloadCSV())}),t._uU(5,"Download CSV"),t.qZA()()()()}}function Ha(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",49)(1,"button",50),t.NdJ("click",function(o){const r=t.CHM(e).$implicit,d=t.oxw();return t.KtG(d.onTransactionClick(r,o))}),t._uU(2,"View Info"),t.qZA()()}}function za(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No transaction available."),t.qZA())}function Va(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting transactions..."),t.qZA())}function Ga(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.errorMessage)}}function Ka(n,a){if(1&n&&(t.TgZ(0,"td",51),t.YNc(1,za,2,0,"p",52),t.YNc(2,Va,2,0,"p",52),t.YNc(3,Ga,2,1,"p",52),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",(!(null!=e.listTransactions&&e.listTransactions.data)||(null==e.listTransactions||null==e.listTransactions.data?null:e.listTransactions.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.listTransactions&&e.listTransactions.data)||(null==e.listTransactions||null==e.listTransactions.data?null:e.listTransactions.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.listTransactions&&e.listTransactions.data)||(null==e.listTransactions||null==e.listTransactions.data?null:e.listTransactions.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const Wa=function(n){return{"display-none":n}};function $a(n,a){if(1&n&&t._UZ(0,"tr",53),2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,Wa,(null==e.listTransactions?null:e.listTransactions.data)&&(null==e.listTransactions||null==e.listTransactions.data?null:e.listTransactions.data.length)>0))}}function Xa(n,a){1&n&&t._UZ(0,"tr",54)}function ja(n,a){1&n&&t._UZ(0,"tr",55)}const to=function(){return["all"]},eo=function(n){return{"error-border":n}},no=function(){return["no_transaction"]};let io=(()=>{class n{constructor(e,i,o,s,r){this.logger=e,this.commonService=i,this.store=o,this.datePipe=s,this.camelCaseWithSpaces=r,this.faHistory=T.qO$,this.nodePageDefs=l.Xk,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="on_chain",this.tableSetting={tableId:"transaction",recordsPerPage:l.IV,sortBy:"timestamp",sortOrder:l.Pi.DESCENDING},this.displayedColumns=[],this.listTransactions=new c.by([]),this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.selFilter="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.dispatch((0,D.mC)()),this.store.select(C.nF).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{var i,o;this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=(null===(i=e.pageSettings.find(s=>s.pageId===this.PAGE_ID))||void 0===i?void 0:i.tables.find(s=>s.tableId===this.tableSetting.tableId))||(null===(o=l.c3.find(s=>s.pageId===this.PAGE_ID))||void 0===o?void 0:o.tables.find(s=>s.tableId===this.tableSetting.tableId)),this.displayedColumns=this.screenSize===l.cu.XS||this.screenSize===l.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:l.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/14+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(C.dx).pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),e.transactions&&this.sort&&this.paginator&&this.loadTransactionsTable(e.transactions),this.logger.info(e)})}applyFilter(){this.listTransactions.filter=this.selFilter.trim().toLowerCase()}getLabel(e){const i=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(o=>o.column===e);return i?i.label?i.label:this.camelCaseWithSpaces.transform(i.column,"_"):this.commonService.titleCase(e)}setFilterPredicate(){this.listTransactions.filterPredicate=(e,i)=>{var o,s;let r="";switch(this.selFilterBy){case"all":r=(e.timestamp?null===(o=this.datePipe.transform(new Date(1e3*e.timestamp),"dd/MMM/y HH:mm"))||void 0===o?void 0:o.toLowerCase():"")+JSON.stringify(e).toLowerCase();break;case"timestamp":r=(null===(s=this.datePipe.transform(new Date(1e3*(e[this.selFilterBy]||0)),"dd/MMM/y HH:mm"))||void 0===s?void 0:s.toLowerCase())||"";break;default:r=typeof e[this.selFilterBy]>"u"?"":"string"==typeof e[this.selFilterBy]?e[this.selFilterBy].toLowerCase():"boolean"==typeof e[this.selFilterBy]?e[this.selFilterBy]?"yes":"no":e[this.selFilterBy].toString()}return r.includes(i)}}onTransactionClick(e,i){this.store.dispatch((0,E.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:"Transaction Information",message:[[{key:"blockHash",value:e.blockHash,title:"Block Hash",width:100}],[{key:"txid",value:e.txid,title:"Transaction ID",width:100}],[{key:"timestamp",value:e.timestamp,title:"Date/Time",width:50,type:l.Gi.DATE_TIME},{key:"confirmations",value:e.confirmations,title:"Number of Confirmations",width:50,type:l.Gi.NUMBER}],[{key:"fees",value:e.fees,title:"Fees (Sats)",width:50,type:l.Gi.NUMBER},{key:"amount",value:e.amount,title:"Amount (Sats)",width:50,type:l.Gi.NUMBER}],[{key:"address",value:e.address,title:"Address",width:100,type:l.Gi.STRING}]]}}}))}loadTransactionsTable(e){this.listTransactions=new c.by([...e]),this.listTransactions.sort=this.sort,this.listTransactions.sortingDataAccessor=(i,o)=>i[o]&&isNaN(i[o])?i[o].toLocaleLowerCase():i[o]?+i[o]:null,this.listTransactions.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter(),this.logger.info(this.listTransactions)}onDownloadCSV(){this.listTransactions.data&&this.listTransactions.data.length>0&&this.commonService.downloadFile(this.listTransactions.data,"Transactions")}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(R.mQ),t.Y36(k.v),t.Y36(I.yh),t.Y36(u.uU),t.Y36(G.i1))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-on-chain-transaction-history"]],viewQuery:function(e,i){if(1&e&&(t.Gf(S.YE,5),t.Gf(A.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.sort=o.first),t.iGM(o=t.CRH())&&(i.paginator=o.first)}},features:[t._Bn([{provide:w.PG,useValue:{overlayPanelClass:"rtl-select-overlay"}},{provide:A.ye,useValue:(0,l.pt)("Transactions")}])],decls:52,vars:19,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.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","row","fxLayoutAlign","start start"],["fxLayout","column","fxLayoutAlign","start end","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"matSortActive","matSortDirection","dataSource","ngClass"],["table",""],["matColumnDef","timestamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","address"],["matColumnDef","blockHash"],["matColumnDef","txid"],["matColumnDef","amount"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","fees"],["matColumnDef","confirmations"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_transaction"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center",4,"ngIf"],["fxLayoutAlign","end center","class","red",4,"ngIf"],["fxLayoutAlign","end center"],["fxLayoutAlign","end center",1,"red"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","4",1,"table-actions-button",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2),t._UZ(3,"fa-icon",3),t.TgZ(4,"span",4),t._uU(5,"Transaction History"),t.qZA()(),t.TgZ(6,"div",5)(7,"mat-form-field",6)(8,"mat-label"),t._uU(9,"Filter By"),t.qZA(),t.TgZ(10,"mat-select",7),t.NdJ("ngModelChange",function(s){return i.selFilterBy=s})("selectionChange",function(){return i.selFilter="",i.applyFilter()}),t.TgZ(11,"perfect-scrollbar"),t.YNc(12,Za,2,2,"mat-option",8),t.qZA()()(),t.TgZ(13,"mat-form-field",6)(14,"mat-label"),t._uU(15,"Filter"),t.qZA(),t.TgZ(16,"input",9),t.NdJ("ngModelChange",function(s){return i.selFilter=s})("input",function(){return i.applyFilter()})("keyup",function(){return i.applyFilter()}),t.qZA()()()(),t.TgZ(17,"div",10)(18,"div",11),t.YNc(19,Aa,1,0,"mat-progress-bar",12),t.TgZ(20,"table",13,14),t.ynx(22,15),t.YNc(23,Ea,2,0,"th",16),t.YNc(24,wa,3,4,"td",17),t.BQk(),t.ynx(25,18),t.YNc(26,Ia,2,0,"th",16),t.YNc(27,Fa,4,4,"td",17),t.BQk(),t.ynx(28,19),t.YNc(29,qa,2,0,"th",16),t.YNc(30,Na,4,4,"td",17),t.BQk(),t.ynx(31,20),t.YNc(32,Oa,2,0,"th",16),t.YNc(33,Pa,4,4,"td",17),t.BQk(),t.ynx(34,21),t.YNc(35,Ua,2,0,"th",22),t.YNc(36,Da,3,2,"td",17),t.BQk(),t.ynx(37,23),t.YNc(38,Ja,2,0,"th",22),t.YNc(39,Ma,4,3,"td",17),t.BQk(),t.ynx(40,24),t.YNc(41,Qa,2,0,"th",22),t.YNc(42,Ya,4,3,"td",17),t.BQk(),t.ynx(43,25),t.YNc(44,Ba,6,0,"th",26),t.YNc(45,Ha,3,0,"td",27),t.BQk(),t.ynx(46,28),t.YNc(47,Ka,4,3,"td",29),t.BQk(),t.YNc(48,$a,1,3,"tr",30),t.YNc(49,Xa,1,0,"tr",31),t.YNc(50,ja,1,0,"tr",32),t.qZA(),t._UZ(51,"mat-paginator",33),t.qZA()()()),2&e&&(t.xp6(3),t.Q6J("icon",i.faHistory),t.xp6(7),t.Q6J("ngModel",i.selFilterBy),t.xp6(2),t.Q6J("ngForOf",t.DdM(15,to).concat(i.displayedColumns.slice(0,-1))),t.xp6(4),t.Q6J("ngModel",i.selFilter),t.xp6(3),t.Q6J("ngIf",i.apiCallStatus.status===i.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("matSortActive",i.tableSetting.sortBy)("matSortDirection",i.tableSetting.sortOrder)("dataSource",i.listTransactions)("ngClass",t.VKq(16,eo,""!==i.errorMessage)),t.xp6(28),t.Q6J("matFooterRowDef",t.DdM(18,no)),t.xp6(1),t.Q6J("matHeaderRowDef",i.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumns),t.xp6(1),t.Q6J("pageSize",i.pageSize)("pageSizeOptions",i.pageSizeOptions)("showFirstLastButtons",i.screenSize!==i.screenSizeEnum.XS))},dependencies:[u.mk,u.sg,u.O5,u.PC,h.Fj,h.JJ,h.On,P.BN,m.xw,m.Wh,m.yH,Z.oO,Z.Zl,F.lW,B.Nt,x.KE,x.hX,Q.pW,w.gD,w.$L,V.ey,S.YE,S.nU,c.BZ,c.fO,c.as,c.w1,c.Dz,c.nj,c.mD,c.Ke,c.ge,c.ev,c.yh,c.XQ,c.Gk,c.Q2,A.NW,U.Vv,U.$V,u.JJ,u.uU]}),n})();function ao(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",12),t.NdJ("click",function(){const s=t.CHM(e).$implicit,r=t.oxw();return t.KtG(r.activeLink=s.link)}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit,i=t.oxw();t.s9C("routerLink",e.link),t.Q6J("active",i.activeLink===e.link),t.xp6(1),t.Oqu(e.name)}}let oo=(()=>{class n{constructor(e,i){this.store=e,this.router=i,this.selNode={},this.faExchangeAlt=T.Ssp,this.faChartPie=T.OS1,this.balances=[{title:"Total Balance",dataValue:0},{title:"Confirmed",dataValue:0},{title:"Unconfirmed",dataValue:0}],this.links=[{link:"receive",name:"Receive"},{link:"send",name:"Send"}],this.activeLink=this.links[0].link,this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){const e=this.links.find(i=>this.router.url.includes(i.link));this.activeLink=e?e.link:this.links[0].link,this.router.events.pipe((0,_.R)(this.unSubs[0]),(0,Y.h)(i=>i instanceof y.Av)).subscribe({next:i=>{const o=this.links.find(s=>i.urlAfterRedirects.includes(s.link));this.activeLink=o?o.link:this.links[0].link}}),this.store.select(C.LR).pipe((0,_.R)(this.unSubs[1])).subscribe(i=>{this.selNode=i}),this.store.select(C.kY).pipe((0,_.R)(this.unSubs[2])).subscribe(i=>{this.balances=[{title:"Total Balance",dataValue:i.onchainBalance.total||0},{title:"Confirmed",dataValue:i.onchainBalance.confirmed||0},{title:"Unconfirmed",dataValue:i.onchainBalance.unconfirmed||0}]})}openSendFundsModal(){this.store.dispatch((0,E.qR)({payload:{data:{component:At}}}))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(I.yh),t.Y36(y.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-on-chain"]],decls:23,vars:5,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","","mat-stretch-tabs","false","mat-align-tabs","start",3,"tabPanel"],["mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["tabPanel",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x-large"],["fxLayout","row","fxFlex","100"],["mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(e,i){if(1&e&&(t.TgZ(0,"div",0),t._UZ(1,"fa-icon",1),t.TgZ(2,"span",2),t._uU(3,"On-chain Balance"),t.qZA()(),t.TgZ(4,"div",3)(5,"mat-card")(6,"mat-card-content",4),t._UZ(7,"rtl-currency-unit-converter",5),t.qZA()()(),t.TgZ(8,"div",0),t._UZ(9,"fa-icon",1),t.TgZ(10,"span",2),t._uU(11,"On-chain Transactions"),t.qZA()(),t.TgZ(12,"div",6)(13,"mat-card")(14,"mat-card-content",4)(15,"nav",7),t.YNc(16,ao,2,3,"div",8),t.qZA(),t._UZ(17,"mat-tab-nav-panel",null,9),t.TgZ(19,"div",10),t._UZ(20,"router-outlet"),t.qZA(),t.TgZ(21,"div",10),t._UZ(22,"rtl-ecl-on-chain-transaction-history",11),t.qZA()()()()),2&e){const o=t.MAs(18);t.xp6(1),t.Q6J("icon",i.faChartPie),t.xp6(6),t.Q6J("values",i.balances),t.xp6(2),t.Q6J("icon",i.faExchangeAlt),t.xp6(6),t.Q6J("tabPanel",o),t.xp6(1),t.Q6J("ngForOf",i.links)}},dependencies:[u.sg,P.BN,m.xw,m.Wh,m.yH,b.a8,b.dn,q.BU,q.sW,q.Nj,ut.D,y.lC,y.rH,io]}),n})();var Et=f(2673);function so(n,a){if(1&n&&(t.TgZ(0,"span",10),t._uU(1,"Channels"),t.qZA()),2&n){const e=t.oxw();t.s9C("matBadge",e.activeChannels)}}function lo(n,a){if(1&n&&(t.TgZ(0,"span",10),t._uU(1,"Peers"),t.qZA()),2&n){const e=t.oxw();t.s9C("matBadge",e.activePeers)}}let ro=(()=>{class n{constructor(e,i){this.store=e,this.router=i,this.activePeers=0,this.activeChannels=0,this.faUsers=T.FVb,this.faChartPie=T.OS1,this.balances=[{title:"Total Balance",dataValue:0},{title:"Confirmed",dataValue:0},{title:"Unconfirmed",dataValue:0}],this.links=[{link:"channels",name:"Channels"},{link:"peers",name:"Peers"}],this.activeLink=0,this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.activeLink=this.links.findIndex(e=>e.link===this.router.url.substring(this.router.url.lastIndexOf("/")+1)),this.router.events.pipe((0,_.R)(this.unSubs[0]),(0,Y.h)(e=>e instanceof y.Av)).subscribe({next:e=>{this.activeLink=this.links.findIndex(i=>i.link===e.urlAfterRedirects.substring(e.urlAfterRedirects.lastIndexOf("/")+1))}}),this.store.select(C.Bo).pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{this.activePeers=e.peers&&e.peers.length?e.peers.length:0}),this.store.select(C.Xz).pipe((0,_.R)(this.unSubs[2])).subscribe(e=>{this.activeChannels=e.channelsStatus&&e.channelsStatus.active&&e.channelsStatus.active.channels?e.channelsStatus.active.channels:0}),this.store.select(C.kY).pipe((0,_.R)(this.unSubs[3])).subscribe(e=>{this.balances=[{title:"Total Balance",dataValue:e.onchainBalance.total||0},{title:"Confirmed",dataValue:e.onchainBalance.confirmed||0},{title:"Unconfirmed",dataValue:e.onchainBalance.unconfirmed||0}]})}onSelectedTabChange(e){this.router.navigateByUrl("/ecl/connections/"+this.links[e.index].link)}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(I.yh),t.Y36(y.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-connections"]],decls:22,vars:4,consts:[["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x","mb-4"],["fxLayout","column"],[3,"values"],["fxLayout","column",1,"padding-gap-x"],["mat-stretch-tabs","false","mat-align-tabs","start",3,"selectedIndex","selectedIndexChange","selectedTabChange"],["mat-tab-label",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x-large"],["matBadgeOverlap","false",1,"tab-badge",3,"matBadge"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t._UZ(1,"fa-icon",1),t.TgZ(2,"span",2),t._uU(3,"On-chain Balance"),t.qZA()(),t.TgZ(4,"div",3)(5,"mat-card")(6,"mat-card-content",4),t._UZ(7,"rtl-currency-unit-converter",5),t.qZA()()(),t.TgZ(8,"div",0),t._UZ(9,"fa-icon",1),t.TgZ(10,"span",2),t._uU(11,"Connections"),t.qZA()(),t.TgZ(12,"div",6)(13,"mat-card")(14,"mat-card-content",4)(15,"mat-tab-group",7),t.NdJ("selectedIndexChange",function(s){return i.activeLink=s})("selectedTabChange",function(s){return i.onSelectedTabChange(s)}),t.TgZ(16,"mat-tab"),t.YNc(17,so,2,1,"ng-template",8),t.qZA(),t.TgZ(18,"mat-tab"),t.YNc(19,lo,2,1,"ng-template",8),t.qZA()(),t.TgZ(20,"div",9),t._UZ(21,"router-outlet"),t.qZA()()()()),2&e&&(t.xp6(1),t.Q6J("icon",i.faChartPie),t.xp6(6),t.Q6J("values",i.balances),t.xp6(2),t.Q6J("icon",i.faUsers),t.xp6(6),t.Q6J("selectedIndex",i.activeLink))},dependencies:[P.BN,m.xw,m.Wh,m.yH,b.a8,b.dn,Et.k,q.uD,q.uX,q.SP,ut.D,y.lC]}),n})();function co(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",12),t.NdJ("click",function(){const s=t.CHM(e).$implicit,r=t.oxw();return t.KtG(r.activeLink=s.link)}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit,i=t.oxw();t.s9C("routerLink",e.link),t.Q6J("active",i.activeLink===e.link),t.xp6(1),t.Oqu(e.name)}}let uo=(()=>{class n{constructor(e,i,o){this.logger=e,this.store=i,this.router=o,this.faExchangeAlt=T.Ssp,this.faChartPie=T.OS1,this.currencyUnits=[],this.balances=[{title:"Local Capacity",dataValue:0,tooltip:"Amount you can send"},{title:"Remote Capacity",dataValue:0,tooltip:"Amount you can receive"}],this.links=[{link:"payments",name:"Payments"},{link:"invoices",name:"Invoices"}],this.activeLink=this.links[0].link,this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){const e=this.links.find(i=>this.router.url.includes(i.link));this.activeLink=e?e.link:this.links[0].link,this.router.events.pipe((0,_.R)(this.unSubs[0]),(0,Y.h)(i=>i instanceof y.Av)).subscribe({next:i=>{const o=this.links.find(s=>i.urlAfterRedirects.includes(s.link));this.activeLink=o?o.link:this.links[0].link}}),this.store.select(C.Xz).pipe((0,_.R)(this.unSubs[1]),(0,ot.M)(this.store.select(C.LR))).subscribe(([i,o])=>{this.currencyUnits=o?.currencyUnits||[],this.balances=o&&o.userPersona===l.ol.OPERATOR?[{title:"Local Capacity",dataValue:i.lightningBalance.localBalance,tooltip:"Amount you can send"},{title:"Remote Capacity",dataValue:i.lightningBalance.remoteBalance,tooltip:"Amount you can receive"}]:[{title:"Outbound Capacity",dataValue:i.lightningBalance.localBalance,tooltip:"Amount you can send"},{title:"Inbound Capacity",dataValue:i.lightningBalance.remoteBalance,tooltip:"Amount you can receive"}],this.logger.info(i)})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(R.mQ),t.Y36(I.yh),t.Y36(y.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-transactions"]],decls:21,vars:5,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","","mat-stretch-tabs","false","mat-align-tabs","start",3,"tabPanel"],["mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["tabPanel",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"mat-tab-body-wrapper"],["mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(e,i){if(1&e&&(t.TgZ(0,"div",0),t._UZ(1,"fa-icon",1),t.TgZ(2,"span",2),t._uU(3,"Lightning Balance"),t.qZA()(),t.TgZ(4,"div",3)(5,"mat-card")(6,"mat-card-content",4),t._UZ(7,"rtl-currency-unit-converter",5),t.qZA()()(),t.TgZ(8,"div",6),t._UZ(9,"fa-icon",1),t.TgZ(10,"span",2),t._uU(11,"Lightning Transactions"),t.qZA()(),t.TgZ(12,"div",7)(13,"mat-card")(14,"mat-card-content",4)(15,"nav",8),t.YNc(16,co,2,3,"div",9),t.qZA(),t._UZ(17,"mat-tab-nav-panel",null,10),t.TgZ(19,"div",11),t._UZ(20,"router-outlet"),t.qZA()()()()),2&e){const o=t.MAs(18);t.xp6(1),t.Q6J("icon",i.faChartPie),t.xp6(6),t.Q6J("values",i.balances),t.xp6(2),t.Q6J("icon",i.faExchangeAlt),t.xp6(6),t.Q6J("tabPanel",o),t.xp6(1),t.Q6J("ngForOf",i.links)}},dependencies:[u.sg,P.BN,m.xw,m.Wh,m.yH,b.a8,b.dn,q.BU,q.sW,q.Nj,ut.D,y.lC,y.rH]}),n})();function po(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",12),t.NdJ("click",function(){const s=t.CHM(e).$implicit,r=t.oxw();return t.KtG(r.activeLink=s.link)}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit,i=t.oxw();t.s9C("routerLink",e.link),t.Q6J("active",i.activeLink===e.link),t.xp6(1),t.Oqu(e.name)}}let mo=(()=>{class n{constructor(e){this.router=e,this.faMapSigns=T.SuH,this.events=[],this.flgLoading=[!0],this.errorMessage="",this.links=[{link:"forwardinghistory",name:"Forwarding History"},{link:"peers",name:"Routing Peers"}],this.activeLink=this.links[0].link,this.unSubs=[new p.x,new p.x,new p.x]}ngOnInit(){const e=this.links.find(i=>this.router.url.includes(i.link));this.activeLink=e?e.link:this.links[0].link,this.router.events.pipe((0,_.R)(this.unSubs[0]),(0,Y.h)(i=>i instanceof y.Av)).subscribe({next:i=>{const o=this.links.find(s=>i.urlAfterRedirects.includes(s.link));this.activeLink=o?o.link:this.links[0].link}})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(y.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-routing"]],decls:15,vars:3,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","","mat-stretch-tabs","false","mat-align-tabs","start","fxFlex","100",3,"tabPanel"],["mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["tabPanel",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"padding-gap-x-large"],["mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(e,i){if(1&e&&(t.TgZ(0,"div",0)(1,"div",1),t._UZ(2,"fa-icon",2),t.TgZ(3,"span",3),t._uU(4,"Routing"),t.qZA()(),t.TgZ(5,"div",4)(6,"mat-card",5)(7,"mat-card-content",6)(8,"div",7)(9,"nav",8),t.YNc(10,po,2,3,"div",9),t.qZA(),t._UZ(11,"mat-tab-nav-panel",null,10),t.qZA(),t.TgZ(13,"div",11),t._UZ(14,"router-outlet"),t.qZA()()()()()),2&e){const o=t.MAs(12);t.xp6(2),t.Q6J("icon",i.faMapSigns),t.xp6(7),t.Q6J("tabPanel",o),t.xp6(1),t.Q6J("ngForOf",i.links)}},dependencies:[u.sg,P.BN,m.xw,m.Wh,m.yH,b.a8,b.dn,q.BU,q.sW,q.Nj,y.lC,y.rH]}),n})();var it=f(1948),wt=f(7009),It=f(5199);function ho(n,a){if(1&n&&(t.TgZ(0,"span",9)(1,"div"),t._uU(2),t.ALo(3,"titlecase"),t.qZA()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(2),t.AsE("",i.nodeFeaturesEnum[e.key]||e.key,": ",t.lcZ(3,2,e.value),"")}}function _o(n,a){1&n&&(t.TgZ(0,"th",23),t._uU(1,"Address"),t.qZA())}function go(n,a){if(1&n&&(t.TgZ(0,"td",24),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(e)}}function fo(n,a){1&n&&(t.TgZ(0,"th",25)(1,"div",26),t._uU(2,"Actions"),t.qZA()())}function Co(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",24)(1,"span",27)(2,"button",28),t.NdJ("copied",function(o){t.CHM(e);const s=t.oxw(2);return t.KtG(s.onCopyNodeURI(o))}),t._uU(3,"Copy Node URI"),t.qZA()()()}if(2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(2),t.Q6J("payload",(null==i.lookupResult?null:i.lookupResult.nodeId)+"@"+e)}}function xo(n,a){1&n&&t._UZ(0,"tr",29)}function yo(n,a){1&n&&t._UZ(0,"tr",30)}const vo=function(n){return{"background-color":n}};function To(n,a){if(1&n&&(t.TgZ(0,"div",1),t._UZ(1,"mat-divider",2),t.TgZ(2,"div",3)(3,"div",4)(4,"h4",5),t._uU(5,"Alias"),t.qZA(),t.TgZ(6,"span",6),t._uU(7),t.TgZ(8,"span",7),t._uU(9),t.qZA()()(),t.TgZ(10,"div",8)(11,"h4",5),t._uU(12,"Pub Key"),t.qZA(),t.TgZ(13,"span",9),t._uU(14),t.qZA()()(),t._UZ(15,"mat-divider",2),t.TgZ(16,"div",3)(17,"div",4)(18,"h4",5),t._uU(19,"Date/Time"),t.qZA(),t.TgZ(20,"span",6),t._uU(21),t.ALo(22,"date"),t.qZA()(),t.TgZ(23,"div",8)(24,"h4",5),t._uU(25,"Features"),t.qZA(),t.YNc(26,ho,4,4,"span",10),t.ALo(27,"keyvalue"),t.qZA()(),t._UZ(28,"mat-divider",2),t.TgZ(29,"div",3)(30,"div",11)(31,"h4",5),t._uU(32,"Signature"),t.qZA(),t.TgZ(33,"span",6),t._uU(34),t.qZA()()(),t._UZ(35,"mat-divider",2),t.TgZ(36,"div",1)(37,"h4",12),t._uU(38,"Addresses"),t.qZA(),t.TgZ(39,"div",13)(40,"table",14,15),t.ynx(42,16),t.YNc(43,_o,2,0,"th",17),t.YNc(44,go,2,1,"td",18),t.BQk(),t.ynx(45,19),t.YNc(46,fo,3,0,"th",20),t.YNc(47,Co,4,1,"td",18),t.BQk(),t.YNc(48,xo,1,0,"tr",21),t.YNc(49,yo,1,0,"tr",22),t.qZA()()()()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("inset",!0),t.xp6(6),t.Oqu(null==e.lookupResult?null:e.lookupResult.alias),t.xp6(1),t.Q6J("ngStyle",t.VKq(19,vo,null==e.lookupResult?null:e.lookupResult.rgbColor)),t.xp6(1),t.Oqu(null!=e.lookupResult&&e.lookupResult.rgbColor?null==e.lookupResult?null:e.lookupResult.rgbColor:""),t.xp6(5),t.Oqu(null==e.lookupResult?null:e.lookupResult.nodeId),t.xp6(1),t.Q6J("inset",!0),t.xp6(6),t.Oqu(t.xi3(22,14,1e3*(null==e.lookupResult?null:e.lookupResult.timestamp),"dd/MMM/y HH:mm")),t.xp6(5),t.Q6J("ngForOf",t.lcZ(27,17,null==e.lookupResult?null:e.lookupResult.features.activated)),t.xp6(2),t.Q6J("inset",!0),t.xp6(6),t.Oqu(null==e.lookupResult?null:e.lookupResult.signature),t.xp6(1),t.Q6J("inset",!0),t.xp6(5),t.Q6J("dataSource",e.addresses),t.xp6(8),t.Q6J("matHeaderRowDef",e.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",e.displayedColumns)}}let Lo=(()=>{class n{constructor(e,i){this.logger=e,this.snackBar=i,this.lookupResult={},this.addresses=new c.by([]),this.displayedColumns=["address","actions"],this.nodeFeaturesEnum=l.H_}ngOnInit(){this.addresses=new c.by(this.lookupResult.addresses?[...this.lookupResult.addresses]:[]),this.addresses.data=this.lookupResult.addresses||[],this.addresses.sort=this.sort,this.addresses.sortingDataAccessor=(e,i)=>e[i]&&isNaN(e[i])?e[i].toLocaleLowerCase():e[i]?+e[i]:null}onCopyNodeURI(e){this.snackBar.open("Node URI copied."),this.logger.info("Copied Text: "+e)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(R.mQ),t.Y36(wt.ux))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-node-lookup"]],viewQuery:function(e,i){if(1&e&&t.Gf(S.YE,5),2&e){let o;t.iGM(o=t.CRH())&&(i.sort=o.first)}},inputs:{lookupResult:"lookupResult"},decls:1,vars:1,consts:[["fxLayout","column",4,"ngIf"],["fxLayout","column"],[1,"my-1",3,"inset"],["fxLayout","row"],["fxFlex","30"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text"],[1,"ml-2",3,"ngStyle"],["fxFlex","70"],[1,"foreground-secondary-text","w-100"],["class","foreground-secondary-text w-100",4,"ngFor","ngForOf"],["fxFlex","100"],["fxFlex","100","fxLayoutAlign","start",1,"font-bold-500","mb-1"],["fxLayout","row","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mat-table","","matSort","",1,"overflow-auto",3,"dataSource"],["table",""],["matColumnDef","address"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select","btn-action"],["fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","1","rtlClipboard","",1,"btn-action-copy",3,"payload","copied"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&t.YNc(0,To,50,21,"div",0),2&e&&t.Q6J("ngIf",i.lookupResult)},dependencies:[u.sg,u.O5,u.PC,m.xw,m.Wh,m.yH,Z.Zl,F.lW,X.d,S.YE,S.nU,c.BZ,c.fO,c.as,c.w1,c.Dz,c.nj,c.ge,c.ev,c.XQ,c.Gk,U.$V,It.y,u.rS,u.uU,u.Nd]}),n})();const bo=["form"];function So(n,a){if(1&n&&(t.TgZ(0,"mat-error"),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.hij("",null==e.lookupFields[e.selectedFieldId]?null:e.lookupFields[e.selectedFieldId].placeholder," is required.")}}function Zo(n,a){if(1&n&&(t.TgZ(0,"mat-error"),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.hij("Invalid ",null==e.lookupFields[e.selectedFieldId]?null:e.lookupFields[e.selectedFieldId].placeholder,".")}}function Ao(n,a){if(1&n&&(t.TgZ(0,"div"),t._UZ(1,"rtl-ecl-node-lookup",25),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Q6J("lookupResult",e.nodeLookupValue)}}function Eo(n,a){if(1&n&&(t.TgZ(0,"span",23),t.YNc(1,Ao,2,1,"div",24),t.qZA()),2&n){const e=t.oxw(2),i=t.MAs(23);t.xp6(1),t.Q6J("ngIf",e.nodeLookupValue.nodeId)("ngIfElse",i)}}function wo(n,a){1&n&&(t.TgZ(0,"span"),t._uU(1,' fxFlex="100"'),t.TgZ(2,"h3"),t._uU(3,"Error! Unable to find details!"),t.qZA()())}function Io(n,a){if(1&n&&(t.TgZ(0,"div",17)(1,"div",18)(2,"span",19),t._uU(3),t.qZA()(),t.TgZ(4,"div",20),t.YNc(5,Eo,2,2,"span",21),t.YNc(6,wo,4,0,"span",22),t.qZA()()),2&n){const e=t.oxw();t.xp6(3),t.hij("",e.lookupFields[e.selectedFieldId].name," Details"),t.xp6(1),t.Q6J("ngSwitch",e.selectedFieldId),t.xp6(1),t.Q6J("ngSwitchCase",0)}}function Fo(n,a){1&n&&(t.TgZ(0,"h3"),t._uU(1,"Error! Unable to find details!"),t.qZA())}const qo=function(n){return{"mt-1":!0,"mt-2":n}};let No=(()=>{class n{constructor(e,i,o,s){this.logger=e,this.commonService=i,this.store=o,this.actions=s,this.lookupKeyCtrl=new h.p4,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=T.wn1,this.screenSize="",this.screenSizeEnum=l.cu,this.unSubs=[new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.actions.pipe((0,_.R)(this.unSubs[0]),(0,Y.h)(e=>e.type===l.lr.SET_LOOKUP_ECL||e.type===l.lr.UPDATE_API_CALL_STATUS_ECL)).subscribe(e=>{if(e.type===l.lr.SET_LOOKUP_ECL){switch(this.flgLoading[0]=!0,this.selectedFieldId){case 0:this.nodeLookupValue=e.payload[0]?JSON.parse(JSON.stringify(e.payload[0])):{nodeid:""};break;case 1:this.channelLookupValue=JSON.parse(JSON.stringify(e.payload))||[]}this.flgSetLookupValue=!0,this.logger.info(this.nodeLookupValue),this.logger.info(this.channelLookupValue)}e.type===l.lr.UPDATE_API_CALL_STATUS_ECL&&e.payload.status===l.Bn.ERROR&&"Lookup"===e.payload.action&&(this.flgLoading[0]="error")}),this.lookupKeyCtrl.valueChanges.pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{this.nodeLookupValue={},this.channelLookupValue=[],this.flgSetLookupValue=!1})}onLookup(){return this.lookupKeyCtrl.value?this.lookupKeyCtrl.value&&(this.lookupKeyCtrl.value.includes("@")||this.lookupKeyCtrl.value.includes(","))?(this.lookupKeyCtrl.setErrors({invalid:!0}),!0):void(0===(this.selectedFieldId||(this.selectedFieldId=0),this.flgSetLookupValue=!1,this.nodeLookupValue={},this.channelLookupValue=[],this.selectedFieldId)&&this.store.dispatch((0,D.Sf)({payload:this.lookupKeyCtrl.value.trim()}))):(this.lookupKeyCtrl.setErrors({required:!0}),!0)}onSelectChange(e){this.resetData(),this.selectedFieldId=e.value}resetData(){this.flgSetLookupValue=!1,this.nodeLookupValue={},this.channelLookupValue=[],this.lookupKeyCtrl.setValue(""),this.lookupKeyCtrl.setErrors(null),this.form.resetForm()}clearLookupValue(){this.nodeLookupValue={},this.channelLookupValue=[],this.flgSetLookupValue=!1}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(R.mQ),t.Y36(k.v),t.Y36(I.yh),t.Y36($.eX))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-lookups"]],viewQuery:function(e,i){if(1&e&&t.Gf(bo,7),2&e){let o;t.iGM(o=t.CRH())&&(i.form=o.first)}},decls:24,vars:9,consts:[["fxLayout","column"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start",1,"padding-gap"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxFlex","100","fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign.gt-sm","space-between center","fxLayoutAlign","start space-between",1,"w-100"],["form","ngForm"],["fxFlex","100","fxLayoutAlign","start end"],["color","primary","tabindex","1","name","lookupField"],["checked","",1,"mr-4",3,"value"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start end",3,"ngClass"],["matInput","","name","lookupKey","tabindex","2","required","",3,"formControl"],["key",""],[4,"ngIf"],["fxLayout","row","fxFlex","100",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","3","type","button",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","4","type","submit",3,"click"],["fxFlex","100","fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign.gt-sm","space-between center","fxLayoutAlign","start stretch","class","w-100 mt-2",4,"ngIf"],["errorBlock",""],["fxFlex","100","fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign.gt-sm","space-between center","fxLayoutAlign","start stretch",1,"w-100","mt-2"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start center"],[1,"page-title","font-bold-500"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start center",3,"ngSwitch"],["fxFlex","100",4,"ngSwitchCase"],[4,"ngSwitchDefault"],["fxFlex","100"],[4,"ngIf","ngIfElse"],[3,"lookupResult"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-content",2)(3,"form",3,4)(5,"div",5)(6,"mat-radio-group",6)(7,"mat-radio-button",7),t._uU(8,"Node"),t.qZA()()(),t.TgZ(9,"mat-form-field",8)(10,"mat-label"),t._uU(11),t.qZA(),t._UZ(12,"input",9,10),t.YNc(14,So,2,1,"mat-error",11),t.YNc(15,Zo,2,1,"mat-error",11),t.qZA(),t.TgZ(16,"div",12)(17,"button",13),t.NdJ("click",function(){return i.resetData()}),t._uU(18,"Clear"),t.qZA(),t.TgZ(19,"button",14),t.NdJ("click",function(){return i.onLookup()}),t._uU(20,"Lookup"),t.qZA()()(),t.YNc(21,Io,7,3,"div",15),t.qZA()()(),t.YNc(22,Fo,2,0,"ng-template",null,16,t.W1O)),2&e&&(t.xp6(7),t.Q6J("value",0),t.xp6(2),t.Q6J("ngClass",t.VKq(7,qo,i.screenSize===i.screenSizeEnum.XS||i.screenSize===i.screenSizeEnum.SM)),t.xp6(2),t.Oqu((null==i.lookupFields[i.selectedFieldId]?null:i.lookupFields[i.selectedFieldId].placeholder)||"Lookup Key"),t.xp6(1),t.Q6J("formControl",i.lookupKeyCtrl),t.xp6(2),t.Q6J("ngIf",null==i.lookupKeyCtrl.errors?null:i.lookupKeyCtrl.errors.required),t.xp6(1),t.Q6J("ngIf",null==i.lookupKeyCtrl.errors?null:i.lookupKeyCtrl.errors.invalid),t.xp6(6),t.Q6J("ngIf",i.flgSetLookupValue))},dependencies:[u.mk,u.O5,u.RF,u.n9,u.ED,h._Y,h.Fj,h.JJ,h.JL,h.Q7,h.F,h.oH,m.xw,m.Wh,m.yH,Z.oO,F.lW,b.dn,B.Nt,x.KE,x.hX,x.TO,it.VQ,it.U0,Lo],styles:[".tree-invisible[_ngcontent-%COMP%]{display:none}.lookup-tree[_ngcontent-%COMP%] ul[_ngcontent-%COMP%], .lookup-tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{margin-top:0;margin-bottom:0;list-style-type:none}"]}),n})();var Oo=f(9122);let Po=(()=>{class n{constructor(e,i){this.store=e,this.eclEffects=i,this.newAddress=""}onGenerateAddress(){this.store.dispatch((0,D._E)()),this.eclEffects.setNewAddress.pipe((0,K.q)(1)).subscribe(e=>{this.newAddress=e,setTimeout(()=>{this.store.dispatch((0,E.qR)({payload:{data:{address:this.newAddress,addressType:"",component:Oo.n}}}))},0)})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(I.yh),t.Y36(lt.o))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-on-chain-receive"]],decls:4,vars:0,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row"],["mat-flat-button","","color","primary","tabindex","1",3,"click"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"button",2),t.NdJ("click",function(){return i.onGenerateAddress()}),t._uU(3,"Generate Address"),t.qZA()()())},dependencies:[m.xw,m.Wh,m.yH,F.lW]}),n})(),Uo=(()=>{class n{constructor(e,i){this.store=e,this.activatedRoute=i,this.sweepAll=!1,this.unSubs=[new p.x,new p.x]}ngOnInit(){this.activatedRoute.data.pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{this.sweepAll=e.sweepAll})}openSendFundsModal(){this.store.dispatch((0,E.qR)({payload:{data:{sweepAll:this.sweepAll,component:At}}}))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(I.yh),t.Y36(y.gz))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-on-chain-send"]],decls:4,vars:1,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row"],["mat-flat-button","","color","primary","type","button","tabindex","1",3,"click"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"button",2),t.NdJ("click",function(){return i.openSendFundsModal()}),t._uU(3),t.qZA()()()),2&e&&(t.xp6(3),t.Oqu(i.sweepAll?"Sweep All":"Send Funds"))},dependencies:[m.xw,m.Wh,m.yH,F.lW]}),n})();var Ro=f(8675),Ft=f(4004),qt=f(455),Nt=f(7957),ko=f(9843);const Do=["form"];function Jo(n,a){if(1&n&&(t.TgZ(0,"mat-option",35),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.Q6J("value",e),t.xp6(1),t.Oqu(e.alias?e.alias:e.nodeId?e.nodeId:"")}}function Mo(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Peer alias is required."),t.qZA())}function Qo(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Peer not found in the list."),t.qZA())}function Yo(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mat-form-field",1)(1,"mat-label"),t._uU(2,"Peer Alias"),t.qZA(),t.TgZ(3,"input",31),t.NdJ("change",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onSelectedPeerChanged())}),t.qZA(),t.TgZ(4,"mat-autocomplete",32,33),t.NdJ("optionSelected",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onSelectedPeerChanged())}),t.YNc(6,Jo,2,2,"mat-option",34),t.ALo(7,"async"),t.qZA(),t.YNc(8,Mo,2,0,"mat-error",17),t.YNc(9,Qo,2,0,"mat-error",17),t.qZA()}if(2&n){const e=t.MAs(5),i=t.oxw();t.xp6(3),t.Q6J("formControl",i.selectedPeer)("matAutocomplete",e),t.xp6(1),t.Q6J("displayWith",i.displayFn),t.xp6(2),t.Q6J("ngForOf",t.lcZ(7,6,i.filteredPeers)),t.xp6(2),t.Q6J("ngIf",null==i.selectedPeer.errors?null:i.selectedPeer.errors.required),t.xp6(1),t.Q6J("ngIf",null==i.selectedPeer.errors?null:i.selectedPeer.errors.notfound)}}function Bo(n,a){1&n&&t.GkF(0)}function Ho(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Amount is required."),t.qZA())}function zo(n,a){if(1&n&&(t.TgZ(0,"mat-error"),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.hij("Amount must be less than or equal to ",e.totalBalance,".")}}function Vo(n,a){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.channelConnectionError)}}function Go(n,a){if(1&n&&(t.TgZ(0,"div",36),t._UZ(1,"fa-icon",37),t.YNc(2,Vo,2,1,"span",17),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faExclamationTriangle),t.xp6(1),t.Q6J("ngIf",""!==e.channelConnectionError)}}function Ko(n,a){if(1&n&&(t.TgZ(0,"mat-expansion-panel",39)(1,"mat-expansion-panel-header")(2,"mat-panel-title")(3,"span"),t._uU(4,"Peer: \xa0"),t.qZA(),t.TgZ(5,"strong",40),t._uU(6),t.qZA()()(),t.TgZ(7,"div",9)(8,"div",0)(9,"div",1)(10,"h4",41),t._uU(11,"Pubkey"),t.qZA(),t.TgZ(12,"span",42),t._uU(13),t.qZA()()(),t._UZ(14,"mat-divider",43),t.TgZ(15,"div",0)(16,"div",44)(17,"h4",41),t._uU(18,"Address"),t.qZA(),t.TgZ(19,"span",45),t._uU(20),t.qZA()(),t.TgZ(21,"div",44)(22,"h4",41),t._uU(23,"State"),t.qZA(),t.TgZ(24,"span",45),t._uU(25),t.ALo(26,"titlecase"),t.qZA()()()()()),2&n){const e=t.oxw(2);t.xp6(6),t.Oqu((null==e.peer?null:e.peer.alias)||(null==e.peer?null:e.peer.nodeId)),t.xp6(7),t.Oqu(e.peer.nodeId),t.xp6(7),t.Oqu(null==e.peer?null:e.peer.address),t.xp6(5),t.Oqu(t.lcZ(26,4,null==e.peer?null:e.peer.state))}}function Wo(n,a){if(1&n&&t.YNc(0,Ko,27,6,"mat-expansion-panel",38),2&n){const e=t.oxw();t.Q6J("ngIf",e.peer)}}let Ot=(()=>{class n{constructor(e,i,o,s){this.dialogRef=e,this.data=i,this.store=o,this.actions=s,this.selNode={},this.selectedPeer=new h.p4,this.faExclamationTriangle=T.eHv,this.channelConnectionError="",this.advancedTitle="Advanced Options",this.totalBalance=0,this.selectedPubkey="",this.isPrivate=!1,this.feeRate=null,this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.data.message?(this.information=this.data.message.information,this.totalBalance=this.data.message.balance,this.peer=this.data.message.peer||null,this.peers=this.data.message.peers||[]):(this.information={},this.totalBalance=0,this.peer=null,this.peers=[]),this.alertTitle=this.data.alertTitle||"Alert",this.store.select(C.LR).pipe((0,_.R)(this.unSubs[0])).subscribe(o=>{this.selNode=o,this.isPrivate=!!o?.unannouncedChannels}),this.actions.pipe((0,_.R)(this.unSubs[1]),(0,Y.h)(o=>o.type===l.lr.UPDATE_API_CALL_STATUS_ECL||o.type===l.lr.FETCH_CHANNELS_ECL)).subscribe(o=>{o.type===l.lr.UPDATE_API_CALL_STATUS_ECL&&o.payload.status===l.Bn.ERROR&&"SaveNewChannel"===o.payload.action&&(this.channelConnectionError=o.payload.message),o.type===l.lr.FETCH_CHANNELS_ECL&&this.dialogRef.close()});let e="",i="";this.sortedPeers=this.peers.sort((o,s)=>(e=o.alias?o.alias.toLowerCase():o.nodeId?o.nodeId.toLowerCase():"",i=s.alias?s.alias.toLowerCase():o.nodeId?o.nodeId.toLowerCase():"",e<i?-1:e>i?1:0)),this.filteredPeers=this.selectedPeer.valueChanges.pipe((0,_.R)(this.unSubs[2]),(0,Ro.O)(""),(0,Ft.U)(o=>"string"==typeof o?o:o.alias?o.alias:o.nodeId),(0,Ft.U)(o=>o?this.filterPeers(o):this.sortedPeers.slice()))}filterPeers(e){var i;return null===(i=this.sortedPeers)||void 0===i?void 0:i.filter(o=>{var s;return 0===(null===(s=o.alias)||void 0===s?void 0:s.toLowerCase().indexOf(e?e.toLowerCase():""))})}displayFn(e){return e&&e.alias?e.alias:e&&e.nodeId?e.nodeId:""}onSelectedPeerChanged(){var e;if(this.channelConnectionError="",this.selectedPubkey=this.selectedPeer.value&&this.selectedPeer.value.nodeId?this.selectedPeer.value.nodeId:null,"string"==typeof this.selectedPeer.value){const i=null===(e=this.peers)||void 0===e?void 0:e.filter(o=>{var s,r;return(null===(s=o.alias)||void 0===s?void 0:s.length)===this.selectedPeer.value.length&&0===(null===(r=o.alias)||void 0===r?void 0:r.toLowerCase().indexOf(this.selectedPeer.value?this.selectedPeer.value.toLowerCase():""))});1===i.length&&i[0].nodeId&&(this.selectedPubkey=i[0].nodeId)}this.selectedPeer.setErrors(this.selectedPeer.value&&!this.selectedPubkey?{notfound:!0}:null)}onClose(){this.dialogRef.close(!1)}resetData(){var e;this.feeRate=null,this.selectedPeer.setValue(""),this.fundingAmount=null,this.isPrivate=!(null===(e=this.selNode)||void 0===e||!e.unannouncedChannels),this.channelConnectionError="",this.advancedTitle="Advanced Options",this.form.resetForm()}onAdvancedPanelToggle(e){this.advancedTitle="Advanced Options",e&&this.feeRate&&this.feeRate>0&&(this.advancedTitle=this.advancedTitle+" | Fee (Sats/vByte): "+this.feeRate)}onOpenChannel(){if(!this.peer&&!this.selectedPubkey||!this.fundingAmount||this.totalBalance-this.fundingAmount<0)return!0;const e={nodeId:this.peer&&this.peer.nodeId?this.peer.nodeId:this.selectedPubkey,amount:this.fundingAmount,private:this.isPrivate};this.feeRate&&(e.feeRate=this.feeRate),this.store.dispatch((0,D.YX)({payload:e}))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(M.so),t.Y36(M.WI),t.Y36(I.yh),t.Y36($.eX))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-open-channel"]],viewQuery:function(e,i){if(1&e&&t.Gf(Do,7),2&e){let o;t.iGM(o=t.CRH())&&(i.form=o.first)}},decls:52,vars:18,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","11","fxFlex","5","fxLayoutAlign","center 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"],["fxLayout","column","fxFlex","70","fxLayoutAlign","start end"],["matInput","","type","number","tabindex","1","required","","name","amount",3,"step","min","max","ngModel","ngModelChange"],["amount","ngModel"],["matSuffix",""],[4,"ngIf"],["fxFlex","25","fxLayoutAlign","start center"],["tabindex","2","color","primary","name","isPrivate",3,"ngModel","ngModelChange"],["expanded","false",1,"flat-expansion-panel","mt-2",3,"closed","opened"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch"],["fxFlex","100","fxLayout","row","fxLayoutAlign","space-between center"],["fxLayout","column","fxFlex","49"],["matInput","","type","number","name","fee","tabindex","7",3,"step","min","ngModel","ngModelChange"],["fee","ngModel"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center",1,"mt-2"],["mat-button","","color","primary","tabindex","9","type","reset",1,"mr-1"],["autoFocus","","mat-button","","color","primary","type","submit","tabindex","10"],["peerDetailsExpansionBlock",""],["type","text","aria-label","Peers","matInput","","tabindex","1","required","",3,"formControl","matAutocomplete","change"],[3,"displayWith","optionSelected"],["auto","matAutocomplete"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"],["class","flat-expansion-panel my-1","expanded","false",4,"ngIf"],["expanded","false",1,"flat-expansion-panel","my-1"],[1,"font-weight-900"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text"],[1,"w-100","my-1"],["fxFlex","50"],[1,"overflow-wrap","foreground-secondary-text"]],template:function(e,i){if(1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-header",2)(3,"div",3)(4,"span",4),t._uU(5),t.qZA()(),t.TgZ(6,"button",5),t.NdJ("click",function(){return i.onClose()}),t._uU(7,"X"),t.qZA()(),t.TgZ(8,"mat-card-content",6)(9,"form",7,8),t.NdJ("submit",function(){return i.onOpenChannel()})("reset",function(){return i.resetData()}),t.TgZ(11,"div",9),t.YNc(12,Yo,10,8,"mat-form-field",10),t.qZA(),t.YNc(13,Bo,1,0,"ng-container",11),t.TgZ(14,"div",9)(15,"div",12)(16,"mat-form-field",13)(17,"mat-label"),t._uU(18,"Amount"),t.qZA(),t.TgZ(19,"input",14,15),t.NdJ("ngModelChange",function(s){return i.fundingAmount=s}),t.qZA(),t.TgZ(21,"mat-hint"),t._uU(22),t.ALo(23,"number"),t.qZA(),t.TgZ(24,"span",16),t._uU(25," Sats "),t.qZA(),t.YNc(26,Ho,2,0,"mat-error",17),t.YNc(27,zo,2,1,"mat-error",17),t.qZA(),t.TgZ(28,"div",18)(29,"mat-slide-toggle",19),t.NdJ("ngModelChange",function(s){return i.isPrivate=s}),t._uU(30,"Private Channel"),t.qZA()()(),t.TgZ(31,"mat-expansion-panel",20),t.NdJ("closed",function(){return i.onAdvancedPanelToggle(!0)})("opened",function(){return i.onAdvancedPanelToggle(!1)}),t.TgZ(32,"mat-expansion-panel-header")(33,"mat-panel-title")(34,"span"),t._uU(35),t.qZA()()(),t.TgZ(36,"div",21)(37,"div",12)(38,"div",22)(39,"mat-form-field",23)(40,"mat-label"),t._uU(41,"Fee (Sats/vByte)"),t.qZA(),t.TgZ(42,"input",24,25),t.NdJ("ngModelChange",function(s){return i.feeRate=s}),t.qZA()()()()()()(),t.YNc(44,Go,3,2,"div",26),t.TgZ(45,"div",27)(46,"button",28),t._uU(47,"Clear Fields"),t.qZA(),t.TgZ(48,"button",29),t._uU(49,"Open Channel"),t.qZA()()()()()(),t.YNc(50,Wo,1,1,"ng-template",null,30,t.W1O)),2&e){const o=t.MAs(20),s=t.MAs(51);t.xp6(5),t.Oqu(i.alertTitle),t.xp6(7),t.Q6J("ngIf",!i.peer&&i.peers&&i.peers.length>0),t.xp6(1),t.Q6J("ngTemplateOutlet",s),t.xp6(6),t.Q6J("step",1e3)("min",1)("max",i.totalBalance)("ngModel",i.fundingAmount),t.xp6(3),t.hij("Remaining: ",t.lcZ(23,16,i.totalBalance-(i.fundingAmount?i.fundingAmount:0)),""),t.xp6(4),t.Q6J("ngIf",null==o.errors?null:o.errors.required),t.xp6(1),t.Q6J("ngIf",null==o.errors?null:o.errors.max),t.xp6(2),t.Q6J("ngModel",i.isPrivate),t.xp6(6),t.Oqu(i.advancedTitle),t.xp6(7),t.Q6J("step",1)("min",0)("ngModel",i.feeRate),t.xp6(2),t.Q6J("ngIf",""!==i.channelConnectionError)}},dependencies:[u.sg,u.O5,u.tP,h._Y,h.Fj,h.wV,h.JJ,h.JL,h.Q7,h.qQ,h.Fd,h.On,h.F,h.oH,P.BN,m.xw,m.Wh,m.yH,F.lW,b.dn,b.dk,z.ib,z.yz,z.yK,B.Nt,x.KE,x.hX,x.bx,x.TO,x.R9,X.d,V.ey,qt.Rr,Nt.XC,Nt.ZL,j.h,ko.F,tt.q,u.Ov,u.JJ,u.rS],styles:[".open-inputs-box[_ngcontent-%COMP%]{padding:1.2rem 2.4rem .8rem!important}"]}),n})();function $o(n,a){if(1&n&&(t.TgZ(0,"span",7),t._uU(1,"Open"),t.qZA()),2&n){const e=t.oxw();t.s9C("matBadge",e.numOfOpenChannels)}}function Xo(n,a){if(1&n&&(t.TgZ(0,"span",7),t._uU(1,"Pending"),t.qZA()),2&n){const e=t.oxw();t.s9C("matBadge",e.numOfPendingChannels)}}function jo(n,a){if(1&n&&(t.TgZ(0,"span",7),t._uU(1,"Inactive"),t.qZA()),2&n){const e=t.oxw();t.s9C("matBadge",e.numOfInactiveChannels)}}let ts=(()=>{class n{constructor(e,i,o){this.logger=e,this.store=i,this.router=o,this.numOfOpenChannels=0,this.numOfPendingChannels=0,this.numOfInactiveChannels=0,this.selNode={},this.information={},this.peers=[],this.totalBalance=0,this.links=[{link:"open",name:"Open"},{link:"pending",name:"Pending"},{link:"inactive",name:"Inactive"}],this.activeLink=0,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.activeLink=this.links.findIndex(e=>e.link===this.router.url.substring(this.router.url.lastIndexOf("/")+1)),this.router.events.pipe((0,_.R)(this.unSubs[0]),(0,Y.h)(e=>e instanceof y.Av)).subscribe({next:e=>{this.activeLink=this.links.findIndex(i=>i.link===e.urlAfterRedirects.substring(e.urlAfterRedirects.lastIndexOf("/")+1))}}),this.store.select(C.Xz).pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{this.numOfOpenChannels=e.channelsStatus&&e.channelsStatus.active&&e.channelsStatus.active.channels?e.channelsStatus.active.channels:0,this.numOfPendingChannels=e.channelsStatus&&e.channelsStatus.pending&&e.channelsStatus.pending.channels?e.channelsStatus.pending.channels:0,this.numOfInactiveChannels=e.channelsStatus&&e.channelsStatus.inactive&&e.channelsStatus.inactive.channels?e.channelsStatus.inactive.channels:0,this.logger.info(e)}),this.store.select(C.LR).pipe((0,_.R)(this.unSubs[2])).subscribe(e=>{this.selNode=e}),this.store.select(C.yD).pipe((0,_.R)(this.unSubs[3])).subscribe(e=>{this.information=e}),this.store.select(C.Bo).pipe((0,_.R)(this.unSubs[4])).subscribe(e=>{this.peers=e.peers}),this.store.select(C.kY).pipe((0,_.R)(this.unSubs[5])).subscribe(e=>{this.totalBalance=e.onchainBalance.total||0})}onOpenChannel(){this.store.dispatch((0,E.qR)({payload:{data:{alertTitle:"Open Channel",message:{peers:this.peers,information:this.information,balance:this.totalBalance},component:Ot}}}))}onSelectedTabChange(e){this.router.navigateByUrl("/ecl/connections/channels/"+this.links[e.index].link)}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(R.mQ),t.Y36(I.yh),t.Y36(y.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channels-tables"]],decls:14,vars:1,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row"],["mat-flat-button","","color","primary","type","submit","tabindex","1",3,"click"],["fxLayout","column","fxFlex","100",1,"bordered-box"],["mat-stretch-tabs","false","mat-align-tabs","start",3,"selectedIndex","selectedIndexChange","selectedTabChange"],["mat-tab-label",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x-large"],["matBadgeOverlap","false",1,"tab-badge",3,"matBadge"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"button",2),t.NdJ("click",function(){return i.onOpenChannel()}),t._uU(3,"Open Channel"),t.qZA()(),t.TgZ(4,"div",3)(5,"mat-tab-group",4),t.NdJ("selectedIndexChange",function(s){return i.activeLink=s})("selectedTabChange",function(s){return i.onSelectedTabChange(s)}),t.TgZ(6,"mat-tab"),t.YNc(7,$o,2,1,"ng-template",5),t.qZA(),t.TgZ(8,"mat-tab"),t.YNc(9,Xo,2,1,"ng-template",5),t.qZA(),t.TgZ(10,"mat-tab"),t.YNc(11,jo,2,1,"ng-template",5),t.qZA()(),t.TgZ(12,"div",6),t._UZ(13,"router-outlet"),t.qZA()()()),2&e&&(t.xp6(5),t.Q6J("selectedIndex",i.activeLink))},dependencies:[m.xw,m.Wh,m.yH,F.lW,Et.k,q.uD,q.uX,q.SP,y.lC]}),n})();function es(n,a){if(1&n&&(t.TgZ(0,"div",11)(1,"h4",12),t._uU(2,"Short Channel ID"),t.qZA(),t.TgZ(3,"span",13),t._uU(4),t.qZA()()),2&n){const e=t.oxw();t.xp6(4),t.Oqu(e.channel.shortChannelId)}}function ns(n,a){if(1&n&&(t.TgZ(0,"div",11)(1,"h4",12),t._uU(2,"State"),t.qZA(),t.TgZ(3,"span",15),t._uU(4),t.ALo(5,"titlecase"),t.qZA()()),2&n){const e=t.oxw();t.xp6(4),t.Oqu(t.lcZ(5,1,e.channel.state))}}function is(n,a){if(1&n&&(t.TgZ(0,"div")(1,"div",9)(2,"div",11)(3,"h4",12),t._uU(4,"Local Balance (Sats)"),t.qZA(),t.TgZ(5,"span",15),t._uU(6),t.ALo(7,"number"),t.qZA()(),t.TgZ(8,"div",11)(9,"h4",12),t._uU(10,"Remote Balance (Sats)"),t.qZA(),t.TgZ(11,"span",15),t._uU(12),t.ALo(13,"number"),t.qZA()()(),t._UZ(14,"mat-divider",14),t.TgZ(15,"div",9)(16,"div",11)(17,"h4",12),t._uU(18,"Base Fee (mSats)"),t.qZA(),t.TgZ(19,"span",15),t._uU(20),t.ALo(21,"number"),t.qZA()(),t.TgZ(22,"div",11)(23,"h4",12),t._uU(24,"Fee Rate (mili mSats)"),t.qZA(),t.TgZ(25,"span",15),t._uU(26),t.ALo(27,"number"),t.qZA()()(),t._UZ(28,"mat-divider",14),t.qZA()),2&n){const e=t.oxw();t.xp6(6),t.Oqu(t.lcZ(7,6,e.channel.toLocal)),t.xp6(6),t.Oqu(t.lcZ(13,8,e.channel.toRemote)),t.xp6(2),t.Q6J("inset",!0),t.xp6(6),t.Oqu(t.lcZ(21,10,e.channel.feeBaseMsat)),t.xp6(6),t.Oqu(t.lcZ(27,12,e.channel.feeProportionalMillionths)),t.xp6(2),t.Q6J("inset",!0)}}function as(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Show Advanced"),t.qZA())}function os(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Hide Advanced"),t.qZA())}function ss(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",21),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onShowAdvanced())}),t.YNc(1,as,2,0,"p",22),t.YNc(2,os,2,0,"ng-template",null,23,t.W1O),t.qZA()}if(2&n){const e=t.MAs(3),i=t.oxw();t.xp6(1),t.Q6J("ngIf",!i.showAdvanced)("ngIfElse",e)}}function ls(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",24),t.NdJ("copied",function(o){t.CHM(e);const s=t.oxw();return t.KtG(s.onCopyChanID(o))}),t._uU(1,"Copy Short Channel ID"),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("payload",e.channel.shortChannelId)}}function rs(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",25),t.NdJ("copied",function(o){t.CHM(e);const s=t.oxw();return t.KtG(s.onCopyChanID(o))}),t._uU(1,"Copy Channel ID"),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("payload",e.channel.channelId)}}const cs=function(n){return{"xs-scroll-y":n}},us=function(n,a){return{"mt-2":n,"mt-1":a}};let mt=(()=>{class n{constructor(e,i,o,s,r){this.dialogRef=e,this.data=i,this.logger=o,this.commonService=s,this.snackBar=r,this.faReceipt=T.dLy,this.showAdvanced=!1,this.channelsType="open",this.screenSize="",this.screenSizeEnum=l.cu}ngOnInit(){this.channel=this.data.channel,this.channelsType=this.data.channelsType||"",this.screenSize=this.commonService.getScreenSize()}onClose(){this.dialogRef.close(!1)}onShowAdvanced(){this.showAdvanced=!this.showAdvanced}onCopyChanID(e){this.snackBar.open("open"===this.channelsType?"Short channel ID "+e+" copied.":"Channel ID copied."),this.logger.info("Copied Text: "+e)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(M.so),t.Y36(M.WI),t.Y36(R.mQ),t.Y36(k.v),t.Y36(wt.ux))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-information"]],decls:64,vars:28,consts:[["fxLayout","column","fxLayout.gt-sm","row","fxLayoutAlign","space-between stretch"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["tabindex","3","fxFlex","5","fxLayoutAlign","center center","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"padding-gap-x-large",3,"ngClass"],["fxLayout","column"],["fxLayout","row"],["fxFlex","50",4,"ngIf"],["fxFlex","50"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text"],[1,"my-1",3,"inset"],[1,"overflow-wrap","foreground-secondary-text"],[4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center","fxFlex","100",3,"ngClass"],["mat-button","","color","primary","type","reset","tabindex","1","class","mr-1",3,"click",4,"ngIf"],["autoFocus","","mat-button","","color","primary","tabindex","2","type","submit","rtlClipboard","",3,"payload","copied",4,"ngIf"],["autoFocus","","mat-button","","color","primary","tabindex","3","type","submit","rtlClipboard","",3,"payload","copied",4,"ngIf"],["mat-button","","color","primary","type","reset","tabindex","1",1,"mr-1",3,"click"],[4,"ngIf","ngIfElse"],["hideAdvancedText",""],["autoFocus","","mat-button","","color","primary","tabindex","2","type","submit","rtlClipboard","",3,"payload","copied"],["autoFocus","","mat-button","","color","primary","tabindex","3","type","submit","rtlClipboard","",3,"payload","copied"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-header",2)(3,"div",3),t._UZ(4,"fa-icon",4),t.TgZ(5,"span",5),t._uU(6,"Channel Information"),t.qZA()(),t.TgZ(7,"button",6),t.NdJ("click",function(){return i.onClose()}),t._uU(8,"X"),t.qZA()(),t.TgZ(9,"mat-card-content",7)(10,"div",8)(11,"div",9),t.YNc(12,es,5,1,"div",10),t.TgZ(13,"div",11)(14,"h4",12),t._uU(15,"Peer Alias"),t.qZA(),t.TgZ(16,"span",13),t._uU(17),t.qZA()(),t.YNc(18,ns,6,3,"div",10),t.qZA(),t._UZ(19,"mat-divider",14),t.TgZ(20,"div",9)(21,"div",1)(22,"h4",12),t._uU(23,"Channel ID"),t.qZA(),t.TgZ(24,"span",13),t._uU(25),t.qZA()()(),t._UZ(26,"mat-divider",14),t.TgZ(27,"div",9)(28,"div",1)(29,"h4",12),t._uU(30,"Peer Public Key"),t.qZA(),t.TgZ(31,"span",13),t._uU(32),t.qZA()()(),t._UZ(33,"mat-divider",14),t.TgZ(34,"div",9)(35,"div",11)(36,"h4",12),t._uU(37,"Private"),t.qZA(),t.TgZ(38,"span",15),t._uU(39),t.qZA()(),t.TgZ(40,"div",11)(41,"h4",12),t._uU(42,"Funder"),t.qZA(),t.TgZ(43,"span",15),t._uU(44),t.qZA()()(),t._UZ(45,"mat-divider",14),t.TgZ(46,"div",9)(47,"div",11)(48,"h4",12),t._uU(49,"State"),t.qZA(),t.TgZ(50,"span",15),t._uU(51),t.ALo(52,"titlecase"),t.qZA()(),t.TgZ(53,"div",11)(54,"h4",12),t._uU(55,"Buried"),t.qZA(),t.TgZ(56,"span",15),t._uU(57),t.qZA()()(),t._UZ(58,"mat-divider",14),t.YNc(59,is,29,14,"div",16),t.TgZ(60,"div",17),t.YNc(61,ss,4,2,"button",18),t.YNc(62,ls,2,1,"button",19),t.YNc(63,rs,2,1,"button",20),t.qZA()()()()()),2&e&&(t.xp6(4),t.Q6J("icon",i.faReceipt),t.xp6(5),t.Q6J("ngClass",t.VKq(23,cs,i.screenSize===i.screenSizeEnum.XS)),t.xp6(3),t.Q6J("ngIf","open"===i.channelsType),t.xp6(5),t.Oqu(i.channel.alias),t.xp6(1),t.Q6J("ngIf","open"!==i.channelsType),t.xp6(1),t.Q6J("inset",!0),t.xp6(6),t.Oqu(i.channel.channelId),t.xp6(1),t.Q6J("inset",!0),t.xp6(6),t.Oqu(i.channel.nodeId),t.xp6(1),t.Q6J("inset",!0),t.xp6(6),t.Oqu(i.channel.announceChannel?"No":"Yes"),t.xp6(5),t.Oqu(i.channel.isFunder?"Yes":"No"),t.xp6(1),t.Q6J("inset",!0),t.xp6(6),t.Oqu(t.lcZ(52,21,i.channel.state)),t.xp6(6),t.Oqu(i.channel.buried?"Yes":"No"),t.xp6(1),t.Q6J("inset",!0),t.xp6(1),t.Q6J("ngIf",i.showAdvanced&&"open"===i.channelsType),t.xp6(1),t.Q6J("ngClass",t.WLB(25,us,!i.showAdvanced,i.showAdvanced)),t.xp6(1),t.Q6J("ngIf","open"===i.channelsType),t.xp6(1),t.Q6J("ngIf","open"===i.channelsType),t.xp6(1),t.Q6J("ngIf","open"!==i.channelsType))},dependencies:[u.mk,u.O5,P.BN,m.xw,m.Wh,m.yH,Z.oO,F.lW,b.dn,b.dk,X.d,It.y,j.h,u.JJ,u.rS]}),n})();function ps(n,a){if(1&n&&(t.TgZ(0,"mat-option",38),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw();t.Q6J("value",e),t.xp6(1),t.Oqu(i.getLabel(e))}}function ms(n,a){1&n&&t._UZ(0,"mat-progress-bar",39)}function ds(n,a){1&n&&t._UZ(0,"th",40)}function hs(n,a){if(1&n&&(t.TgZ(0,"span",44),t._UZ(1,"fa-icon",45),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("icon",e.faEyeSlash)}}function _s(n,a){if(1&n&&(t.TgZ(0,"span",46),t._UZ(1,"fa-icon",45),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("icon",e.faEye)}}function gs(n,a){if(1&n&&(t.TgZ(0,"td",41),t.YNc(1,hs,2,1,"span",42),t.YNc(2,_s,2,1,"span",43),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Q6J("ngIf",!(null!=e&&e.announceChannel)),t.xp6(1),t.Q6J("ngIf",null==e?null:e.announceChannel)}}function fs(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Short Channel ID"),t.qZA())}function Cs(n,a){if(1&n&&(t.TgZ(0,"td",41),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null==e?null:e.shortChannelId)}}function xs(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Channel ID"),t.qZA())}const dt=function(n){return{width:n}};function ys(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,dt,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.channelId)}}function vs(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Alias"),t.qZA())}function Ts(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,dt,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.alias)}}function Ls(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Node ID"),t.qZA())}function bs(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,dt,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function Ss(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Funder"),t.qZA())}function Zs(n,a){if(1&n&&(t.TgZ(0,"td",41),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null!=e&&e.isFunder?"Yes":"No")}}function As(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Buried"),t.qZA())}function Es(n,a){if(1&n&&(t.TgZ(0,"td",41),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null!=e&&e.buried?"Yes":"No")}}function ws(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Base Fee (mSats)"),t.qZA())}function Is(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.feeBaseMsat,"1.0-0")," ")}}function Fs(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Fee Rate (mili mSats)"),t.qZA())}function qs(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.feeProportionalMillionths,"1.0-0")," ")}}function Ns(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Local Balance (Sats)"),t.qZA())}function Os(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.toLocal,"1.0-0")," ")}}function Ps(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Remote Balance (Sats)"),t.qZA())}function Us(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.toRemote,"1.0-0")," ")}}function Rs(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Fee/KW"),t.qZA())}function ks(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.feeRatePerKw,"1.0-0")," ")}}function Ds(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Balance Score"),t.qZA())}function Js(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"div",52)(2,"mat-hint",53),t._uU(3),t.ALo(4,"number"),t.qZA()(),t._UZ(5,"mat-progress-bar",54),t.qZA()),2&n){const e=a.$implicit;t.xp6(3),t.Oqu(t.lcZ(4,2,(null==e?null:e.balancedness)||0)),t.xp6(2),t.s9C("value",null!=e&&e.toLocal&&(null==e?null:e.toLocal)>0?+(null==e?null:e.toLocal)/(+(null==e?null:e.toLocal)+ +(null==e?null:e.toRemote))*100:0)}}function Ms(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",55)(1,"div",56)(2,"mat-select",57),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",58),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onChannelUpdate("all"))}),t._uU(5,"Update Fee Policy"),t.qZA(),t.TgZ(6,"mat-option",58),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onDownloadCSV())}),t._uU(7,"Download CSV"),t.qZA()()()()}}function Qs(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",59)(1,"div",56)(2,"mat-select",60),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",58),t.NdJ("click",function(o){const r=t.CHM(e).$implicit,d=t.oxw();return t.KtG(d.onChannelClick(r,o))}),t._uU(5,"View Info"),t.qZA(),t.TgZ(6,"mat-option",58),t.NdJ("click",function(){const s=t.CHM(e).$implicit,r=t.oxw();return t.KtG(r.onChannelUpdate(s))}),t._uU(7,"Update Fee Policy"),t.qZA(),t.TgZ(8,"mat-option",58),t.NdJ("click",function(){const s=t.CHM(e).$implicit,r=t.oxw();return t.KtG(r.onChannelClose(s,!1))}),t._uU(9,"Close Channel"),t.qZA(),t.TgZ(10,"mat-option",58),t.NdJ("click",function(){const s=t.CHM(e).$implicit,r=t.oxw();return t.KtG(r.onChannelClose(s,!0))}),t._uU(11,"Force Close"),t.qZA()()()()}}function Ys(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No peers connected. Add a peer in order to open a channel."),t.qZA())}function Bs(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No channel available."),t.qZA())}function Hs(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting channels..."),t.qZA())}function zs(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.errorMessage)}}function Vs(n,a){if(1&n&&(t.TgZ(0,"td",61),t.YNc(1,Ys,2,0,"p",62),t.YNc(2,Bs,2,0,"p",62),t.YNc(3,Hs,2,0,"p",62),t.YNc(4,zs,2,1,"p",62),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",e.numPeers<1&&(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",e.numPeers>0&&(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const Gs=function(n){return{"display-none":n}};function Ks(n,a){if(1&n&&t._UZ(0,"tr",63),2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,Gs,e.numPeers>0&&(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function Ws(n,a){1&n&&t._UZ(0,"tr",64)}function $s(n,a){1&n&&t._UZ(0,"tr",65)}const Xs=function(){return["all"]},js=function(n){return{"error-border":n}},tl=function(){return["no_peer"]};let el=(()=>{class n{constructor(e,i,o,s,r,d){var g,L,H,v,O,gt;this.logger=e,this.store=i,this.rtlEffects=o,this.commonService=s,this.router=r,this.camelCaseWithSpaces=d,this.faEye=T.Mdf,this.faEyeSlash=T.Aq,this.nodePageDefs=l.Xk,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="peers_channels",this.tableSetting={tableId:"open_channels",recordsPerPage:l.IV,sortBy:"alias",sortOrder:l.Pi.DESCENDING},this.totalBalance=0,this.displayedColumns=[],this.channels=new c.by([]),this.myChanPolicy={},this.information={},this.numPeers=-1,this.feeRateTypes=l.vn,this.selFilter="",this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.selFilter=null!==(H=null===(L=null===(g=this.router.getCurrentNavigation())||void 0===g?void 0:g.extras)||void 0===L?void 0:L.state)&&void 0!==H&&H.filter?null===(gt=null===(O=null===(v=this.router.getCurrentNavigation())||void 0===v?void 0:v.extras)||void 0===O?void 0:O.state)||void 0===gt?void 0:gt.filter:""}ngOnInit(){this.store.select(C.nF).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{var i,o;this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=(null===(i=e.pageSettings.find(s=>s.pageId===this.PAGE_ID))||void 0===i?void 0:i.tables.find(s=>s.tableId===this.tableSetting.tableId))||(null===(o=l.c3.find(s=>s.pageId===this.PAGE_ID))||void 0===o?void 0:o.tables.find(s=>s.tableId===this.tableSetting.tableId)),this.displayedColumns=this.screenSize===l.cu.XS||this.screenSize===l.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("announceChannel"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:l.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/14+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(C.Xz).pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.activeChannels=e.activeChannels,this.activeChannels.length>0&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadChannelsTable(),this.logger.info(e)}),this.store.select(C.yD).pipe((0,_.R)(this.unSubs[2])).subscribe(e=>{this.information=e}),this.store.select(C.Bo).pipe((0,_.R)(this.unSubs[3])).subscribe(e=>{this.numPeers=e.peers&&e.peers.length?e.peers.length:0}),this.store.select(C.kY).pipe((0,_.R)(this.unSubs[4])).subscribe(e=>{this.totalBalance=e.onchainBalance.total||0})}ngAfterViewInit(){this.activeChannels.length>0&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadChannelsTable()}onChannelUpdate(e){"all"!==e&&e?.state&&"NORMAL"!==e?.state||(this.store.dispatch((0,E.c1)({payload:{data:{type:l.n_.CONFIRM,alertTitle:"Update Fee Policy",noBtnText:"Cancel",yesBtnText:"Update",message:[],titleMessage:"string"==typeof e&&"all"===e?"Update fee policy for all channels":"Update fee policy for Channel: "+(e?.alias||e?.shortChannelId?e?.alias&&e?.shortChannelId?e?.alias+" ("+e?.shortChannelId+")":e?.alias?e?.alias:e?.shortChannelId:e?.channelId),flgShowInput:!0,getInputs:[{placeholder:"Base Fee (mSats)",inputType:l.Gi.NUMBER,inputValue:e&&typeof e?.feeBaseMsat<"u"?e?.feeBaseMsat:1e3,step:100,width:48},{placeholder:"Fee Rate (mili mSats)",inputType:l.Gi.NUMBER,inputValue:e&&typeof e?.feeProportionalMillionths<"u"?e?.feeProportionalMillionths:100,min:1,width:48,hintFunction:this.percentHintFunction}]}}})),this.rtlEffects.closeConfirm.pipe((0,_.R)(this.unSubs[5])).subscribe(s=>{if(s){const r=s[0].inputValue,d=s[1].inputValue;let g=null;if(this.commonService.isVersionCompatible(this.information.version,"0.6.2")){let L="";"all"===e?(this.activeChannels.forEach(H=>{L=L+","+H.nodeId}),L=L.substring(1),g={baseFeeMsat:r,feeRate:d,nodeIds:L}):g={baseFeeMsat:r,feeRate:d,nodeId:e?.nodeId}}else{let L="";"all"===e?(this.activeChannels.forEach(H=>{L=L+","+H.channelId}),L=L.substring(1),g={baseFeeMsat:r,feeRate:d,channelIds:L}):g={baseFeeMsat:r,feeRate:d,channelId:e?.channelId}}this.store.dispatch((0,D.pW)({payload:g}))}}),this.applyFilter())}percentHintFunction(e){return(e/1e4).toString()+"%"}onChannelClose(e,i){this.store.dispatch((0,E.c1)({payload:{data:{type:l.n_.CONFIRM,alertTitle:i?"Force Close Channel":"Close Channel",titleMessage:i?"Force closing channel: "+(e.alias||e.shortChannelId?e.alias&&e.shortChannelId?e.alias+" ("+e.shortChannelId+")":e.alias?e.alias:e.shortChannelId:e.channelId):"Closing channel: "+(e.alias||e.shortChannelId?e.alias&&e.shortChannelId?e.alias+" ("+e.shortChannelId+")":e.alias?e.alias:e.shortChannelId:e.channelId),noBtnText:"Cancel",yesBtnText:i?"Force Close":"Close Channel"}}})),this.rtlEffects.closeConfirm.pipe((0,_.R)(this.unSubs[6])).subscribe(d=>{d&&this.store.dispatch((0,D.BL)({payload:{channelId:e.channelId,force:i}}))})}onChannelClick(e,i){this.store.dispatch((0,E.qR)({payload:{data:{channel:e,channelsType:"open",component:mt}}}))}applyFilter(){this.channels.filter=this.selFilter.trim().toLowerCase()}getLabel(e){const i=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(o=>o.column===e);return i?i.label?i.label:this.camelCaseWithSpaces.transform(i.column,"_"):"announceChannel"===e?"Private":this.commonService.titleCase(e)}setFilterPredicate(){this.channels.filterPredicate=(e,i)=>{let o="";switch(this.selFilterBy){case"all":o=JSON.stringify(e).toLowerCase();break;case"announceChannel":o=e?.announceChannel?"public":"private";break;default:o=typeof e[this.selFilterBy]>"u"?"":"string"==typeof e[this.selFilterBy]?e[this.selFilterBy].toLowerCase():"boolean"==typeof e[this.selFilterBy]?e[this.selFilterBy]?"yes":"no":e[this.selFilterBy].toString()}return o.includes(i)}}loadChannelsTable(){this.channels=new c.by([...this.activeChannels]),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(e,i)=>e[i]&&isNaN(e[i])?e[i].toLocaleLowerCase():e[i]?+e[i]:null,this.channels.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter(),this.logger.info(this.channels)}onDownloadCSV(){this.channels.data&&this.channels.data.length>0&&this.commonService.downloadFile(this.channels.data,"ActiveChannels")}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(R.mQ),t.Y36(I.yh),t.Y36(nt.V),t.Y36(k.v),t.Y36(y.F0),t.Y36(G.i1))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-open-table"]],viewQuery:function(e,i){if(1&e&&(t.Gf(S.YE,5),t.Gf(A.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.sort=o.first),t.iGM(o=t.CRH())&&(i.paginator=o.first)}},features:[t._Bn([{provide:w.PG,useValue:{overlayPanelClass:"rtl-select-overlay"}},{provide:A.ye,useValue:(0,l.pt)("Channels")}])],decls:66,vars:18,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.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","column","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"matSortActive","matSortDirection","dataSource","ngClass"],["table",""],["matColumnDef","announceChannel"],["mat-header-cell","","mat-sort-header","","matTooltip","Private",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","shortChannelId"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","channelId"],["matColumnDef","alias"],["matColumnDef","nodeId"],["matColumnDef","isFunder"],["matColumnDef","buried"],["matColumnDef","feeBaseMsat"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","feeProportionalMillionths"],["matColumnDef","toLocal"],["matColumnDef","toRemote"],["matColumnDef","feeRatePerKw"],["matColumnDef","balancedness"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_peer"],["mat-footer-cell","","colspan","5",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","matTooltip","Private"],["mat-cell",""],["class","mr-1","matTooltip","Private","matTooltipPosition","right",4,"ngIf"],["class","mr-1","matTooltip","Public","matTooltipPosition","right",4,"ngIf"],["matTooltip","Private","matTooltipPosition","right",1,"mr-1"],[3,"icon"],["matTooltip","Public","matTooltipPosition","right",1,"mr-1"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["fxLayout","row"],["fxFlex","100","fxLayoutAlign","center center",1,"font-size-80"],["mode","determinate",3,"value"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["placeholder","Actions","tabindex","2",1,"mr-0"],["mat-footer-cell","","colspan","5"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1),t._UZ(2,"div",2),t.TgZ(3,"div",3)(4,"mat-form-field",4)(5,"mat-label"),t._uU(6,"Filter By"),t.qZA(),t.TgZ(7,"mat-select",5),t.NdJ("ngModelChange",function(s){return i.selFilterBy=s})("selectionChange",function(){return i.selFilter="",i.applyFilter()}),t.TgZ(8,"perfect-scrollbar"),t.YNc(9,ps,2,2,"mat-option",6),t.qZA()()(),t.TgZ(10,"mat-form-field",4)(11,"mat-label"),t._uU(12,"Filter"),t.qZA(),t.TgZ(13,"input",7),t.NdJ("ngModelChange",function(s){return i.selFilter=s})("input",function(){return i.applyFilter()})("keyup",function(){return i.applyFilter()}),t.qZA()()()(),t.TgZ(14,"div",8),t.YNc(15,ms,1,0,"mat-progress-bar",9),t.TgZ(16,"table",10,11),t.ynx(18,12),t.YNc(19,ds,1,0,"th",13),t.YNc(20,gs,3,2,"td",14),t.BQk(),t.ynx(21,15),t.YNc(22,fs,2,0,"th",16),t.YNc(23,Cs,2,1,"td",14),t.BQk(),t.ynx(24,17),t.YNc(25,xs,2,0,"th",16),t.YNc(26,ys,4,4,"td",14),t.BQk(),t.ynx(27,18),t.YNc(28,vs,2,0,"th",16),t.YNc(29,Ts,4,4,"td",14),t.BQk(),t.ynx(30,19),t.YNc(31,Ls,2,0,"th",16),t.YNc(32,bs,4,4,"td",14),t.BQk(),t.ynx(33,20),t.YNc(34,Ss,2,0,"th",16),t.YNc(35,Zs,2,1,"td",14),t.BQk(),t.ynx(36,21),t.YNc(37,As,2,0,"th",16),t.YNc(38,Es,2,1,"td",14),t.BQk(),t.ynx(39,22),t.YNc(40,ws,2,0,"th",23),t.YNc(41,Is,4,4,"td",14),t.BQk(),t.ynx(42,24),t.YNc(43,Fs,2,0,"th",23),t.YNc(44,qs,4,4,"td",14),t.BQk(),t.ynx(45,25),t.YNc(46,Ns,2,0,"th",23),t.YNc(47,Os,4,4,"td",14),t.BQk(),t.ynx(48,26),t.YNc(49,Ps,2,0,"th",23),t.YNc(50,Us,4,4,"td",14),t.BQk(),t.ynx(51,27),t.YNc(52,Rs,2,0,"th",23),t.YNc(53,ks,4,4,"td",14),t.BQk(),t.ynx(54,28),t.YNc(55,Ds,2,0,"th",16),t.YNc(56,Js,6,4,"td",14),t.BQk(),t.ynx(57,29),t.YNc(58,Ms,8,0,"th",30),t.YNc(59,Qs,12,0,"td",31),t.BQk(),t.ynx(60,32),t.YNc(61,Vs,5,4,"td",33),t.BQk(),t.YNc(62,Ks,1,3,"tr",34),t.YNc(63,Ws,1,0,"tr",35),t.YNc(64,$s,1,0,"tr",36),t.qZA()(),t._UZ(65,"mat-paginator",37),t.qZA()),2&e&&(t.xp6(7),t.Q6J("ngModel",i.selFilterBy),t.xp6(2),t.Q6J("ngForOf",t.DdM(14,Xs).concat(i.displayedColumns.slice(0,-1))),t.xp6(4),t.Q6J("ngModel",i.selFilter),t.xp6(2),t.Q6J("ngIf",i.apiCallStatus.status===i.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("matSortActive",i.tableSetting.sortBy)("matSortDirection",i.tableSetting.sortOrder)("dataSource",i.channels)("ngClass",t.VKq(15,js,""!==i.errorMessage)),t.xp6(46),t.Q6J("matFooterRowDef",t.DdM(17,tl)),t.xp6(1),t.Q6J("matHeaderRowDef",i.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumns),t.xp6(1),t.Q6J("pageSize",i.pageSize)("pageSizeOptions",i.pageSizeOptions)("showFirstLastButtons",i.screenSize!==i.screenSizeEnum.XS))},dependencies:[u.mk,u.sg,u.O5,u.PC,h.Fj,h.JJ,h.On,P.BN,m.xw,m.Wh,m.yH,Z.oO,Z.Zl,B.Nt,x.KE,x.hX,x.bx,Q.pW,w.gD,w.$L,V.ey,S.YE,S.nU,c.BZ,c.fO,c.as,c.w1,c.Dz,c.nj,c.mD,c.Ke,c.ge,c.ev,c.yh,c.XQ,c.Gk,c.Q2,W.gM,A.NW,U.Vv,U.$V,u.JJ],styles:[".mat-column-announceChannel[_ngcontent-%COMP%]{max-width:2.2rem;width:2.2rem;text-overflow:unset}.mat-column-balancedness[_ngcontent-%COMP%]{padding-left:2rem;min-width:15rem;max-width:30rem}"]}),n})();function nl(n,a){if(1&n&&(t.TgZ(0,"mat-option",35),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw();t.Q6J("value",e),t.xp6(1),t.Oqu(i.getLabel(e))}}function il(n,a){1&n&&t._UZ(0,"mat-progress-bar",36)}function al(n,a){1&n&&t._UZ(0,"th",37)}function ol(n,a){if(1&n&&(t.TgZ(0,"span",41),t._UZ(1,"fa-icon",42),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("icon",e.faEyeSlash)}}function sl(n,a){if(1&n&&(t.TgZ(0,"span",43),t._UZ(1,"fa-icon",42),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("icon",e.faEye)}}function ll(n,a){if(1&n&&(t.TgZ(0,"td",38),t.YNc(1,ol,2,1,"span",39),t.YNc(2,sl,2,1,"span",40),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Q6J("ngIf",!(null!=e&&e.announceChannel)),t.xp6(1),t.Q6J("ngIf",null==e?null:e.announceChannel)}}function rl(n,a){1&n&&(t.TgZ(0,"th",44),t._uU(1,"State"),t.qZA())}function cl(n,a){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.ALo(2,"titlecase"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,null==e?null:e.state))}}function ul(n,a){1&n&&(t.TgZ(0,"th",44),t._uU(1,"Channel ID"),t.qZA())}const Pt=function(n){return{width:n}};function pl(n,a){if(1&n&&(t.TgZ(0,"td",38)(1,"div",45)(2,"span",46),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Pt,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.channelId)}}function ml(n,a){1&n&&(t.TgZ(0,"th",44),t._uU(1,"Alias"),t.qZA())}function dl(n,a){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null==e?null:e.alias)}}function hl(n,a){1&n&&(t.TgZ(0,"th",44),t._uU(1,"Node ID"),t.qZA())}function _l(n,a){if(1&n&&(t.TgZ(0,"td",38)(1,"div",45)(2,"span",46),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Pt,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function gl(n,a){1&n&&(t.TgZ(0,"th",44),t._uU(1,"Funder"),t.qZA())}function fl(n,a){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null!=e&&e.isFunder?"Yes":"No")}}function Cl(n,a){1&n&&(t.TgZ(0,"th",44),t._uU(1,"Buried"),t.qZA())}function xl(n,a){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null!=e&&e.buried?"Yes":"No")}}function yl(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Local Balance (Sats)"),t.qZA())}function vl(n,a){if(1&n&&(t.TgZ(0,"td",38)(1,"span",48),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.toLocal,"1.0-0")," ")}}function Tl(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Remote Balance (Sats)"),t.qZA())}function Ll(n,a){if(1&n&&(t.TgZ(0,"td",38)(1,"span",48),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.toRemote,"1.0-0")," ")}}function bl(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Fee/KW"),t.qZA())}function Sl(n,a){if(1&n&&(t.TgZ(0,"td",38)(1,"span",48),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.feeRatePerKw,"1.0-0")," ")}}function Zl(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",49)(1,"div",50)(2,"mat-select",51),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",52),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onDownloadCSV())}),t._uU(5,"Download CSV"),t.qZA()()()()}}function Al(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",53)(1,"button",54),t.NdJ("click",function(o){const r=t.CHM(e).$implicit,d=t.oxw();return t.KtG(d.onChannelClick(r,o))}),t._uU(2,"View Info"),t.qZA()()}}function El(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No pending channel available."),t.qZA())}function wl(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting pending channels..."),t.qZA())}function Il(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.errorMessage)}}function Fl(n,a){if(1&n&&(t.TgZ(0,"td",55),t.YNc(1,El,2,0,"p",56),t.YNc(2,wl,2,0,"p",56),t.YNc(3,Il,2,1,"p",56),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const ql=function(n){return{"display-none":n}};function Nl(n,a){if(1&n&&t._UZ(0,"tr",57),2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,ql,(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function Ol(n,a){1&n&&t._UZ(0,"tr",58)}function Pl(n,a){1&n&&t._UZ(0,"tr",59)}const Ul=function(){return["all"]},Rl=function(n){return{"error-border":n}},kl=function(){return["no_channel"]};let Dl=(()=>{class n{constructor(e,i,o,s){this.logger=e,this.store=i,this.commonService=o,this.camelCaseWithSpaces=s,this.faEye=T.Mdf,this.faEyeSlash=T.Aq,this.nodePageDefs=l.Xk,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="peers_channels",this.tableSetting={tableId:"pending_channels",recordsPerPage:l.IV,sortBy:"alias",sortOrder:l.Pi.DESCENDING},this.totalBalance=0,this.displayedColumns=[],this.channels=new c.by([]),this.myChanPolicy={},this.information={},this.numPeers=-1,this.feeRateTypes=l.vn,this.selFilter="",this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(C.nF).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{var i,o;this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=(null===(i=e.pageSettings.find(s=>s.pageId===this.PAGE_ID))||void 0===i?void 0:i.tables.find(s=>s.tableId===this.tableSetting.tableId))||(null===(o=l.c3.find(s=>s.pageId===this.PAGE_ID))||void 0===o?void 0:o.tables.find(s=>s.tableId===this.tableSetting.tableId)),this.displayedColumns=this.screenSize===l.cu.XS||this.screenSize===l.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("announceChannel"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:l.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/14+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(C.Xz).pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.pendingChannels=e.pendingChannels,this.loadChannelsTable(),this.logger.info(e)}),this.store.select(C.yD).pipe((0,_.R)(this.unSubs[2])).subscribe(e=>{this.information=e}),this.store.select(C.Bo).pipe((0,_.R)(this.unSubs[3])).subscribe(e=>{this.numPeers=e.peers&&e.peers.length?e.peers.length:0}),this.store.select(C.kY).pipe((0,_.R)(this.unSubs[4])).subscribe(e=>{this.totalBalance=e.onchainBalance.total||0})}ngAfterViewInit(){this.pendingChannels.length>0&&this.loadChannelsTable()}onChannelClick(e,i){this.store.dispatch((0,E.qR)({payload:{data:{channel:e,channelsType:"pending",component:mt}}}))}applyFilter(){this.channels.filter=this.selFilter.trim().toLowerCase()}getLabel(e){const i=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(o=>o.column===e);return i?i.label?i.label:this.camelCaseWithSpaces.transform(i.column,"_"):"announceChannel"===e?"Private":this.commonService.titleCase(e)}setFilterPredicate(){this.channels.filterPredicate=(e,i)=>{let o="";switch(this.selFilterBy){case"all":o=JSON.stringify(e).toLowerCase();break;case"announceChannel":o=e?.announceChannel?"public":"private";break;default:o=typeof e[this.selFilterBy]>"u"?"":"string"==typeof e[this.selFilterBy]?e[this.selFilterBy].toLowerCase():"boolean"==typeof e[this.selFilterBy]?e[this.selFilterBy]?"yes":"no":e[this.selFilterBy].toString()}return o.includes(i)}}loadChannelsTable(){this.channels=new c.by([...this.pendingChannels]),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(e,i)=>e[i]&&isNaN(e[i])?e[i].toLocaleLowerCase():e[i]?+e[i]:null,this.channels.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter(),this.logger.info(this.channels)}onDownloadCSV(){this.channels.data&&this.channels.data.length>0&&this.commonService.downloadFile(this.channels.data,"PendingChannels")}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(R.mQ),t.Y36(I.yh),t.Y36(k.v),t.Y36(G.i1))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-pending-table"]],viewQuery:function(e,i){if(1&e&&(t.Gf(S.YE,5),t.Gf(A.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.sort=o.first),t.iGM(o=t.CRH())&&(i.paginator=o.first)}},features:[t._Bn([{provide:w.PG,useValue:{overlayPanelClass:"rtl-select-overlay"}},{provide:A.ye,useValue:(0,l.pt)("Channels")}])],decls:57,vars:18,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.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","column","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"matSortActive","matSortDirection","dataSource","ngClass"],["table",""],["matColumnDef","announceChannel"],["mat-header-cell","","mat-sort-header","","matTooltip","Private",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","state"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","channelId"],["matColumnDef","alias"],["matColumnDef","nodeId"],["matColumnDef","isFunder"],["matColumnDef","buried"],["matColumnDef","toLocal"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","toRemote"],["matColumnDef","feeRatePerKw"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_channel"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","matTooltip","Private"],["mat-cell",""],["class","mr-1","matTooltip","Private","matTooltipPosition","right",4,"ngIf"],["class","mr-1","matTooltip","Public","matTooltipPosition","right",4,"ngIf"],["matTooltip","Private","matTooltipPosition","right",1,"mr-1"],[3,"icon"],["matTooltip","Public","matTooltipPosition","right",1,"mr-1"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","4",1,"table-actions-button",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1),t._UZ(2,"div",2),t.TgZ(3,"div",3)(4,"mat-form-field",4)(5,"mat-label"),t._uU(6,"Filter By"),t.qZA(),t.TgZ(7,"mat-select",5),t.NdJ("ngModelChange",function(s){return i.selFilterBy=s})("selectionChange",function(){return i.selFilter="",i.applyFilter()}),t.TgZ(8,"perfect-scrollbar"),t.YNc(9,nl,2,2,"mat-option",6),t.qZA()()(),t.TgZ(10,"mat-form-field",4)(11,"mat-label"),t._uU(12,"Filter"),t.qZA(),t.TgZ(13,"input",7),t.NdJ("ngModelChange",function(s){return i.selFilter=s})("input",function(){return i.applyFilter()})("keyup",function(){return i.applyFilter()}),t.qZA()()()(),t.TgZ(14,"div",8),t.YNc(15,il,1,0,"mat-progress-bar",9),t.TgZ(16,"table",10,11),t.ynx(18,12),t.YNc(19,al,1,0,"th",13),t.YNc(20,ll,3,2,"td",14),t.BQk(),t.ynx(21,15),t.YNc(22,rl,2,0,"th",16),t.YNc(23,cl,3,3,"td",14),t.BQk(),t.ynx(24,17),t.YNc(25,ul,2,0,"th",16),t.YNc(26,pl,4,4,"td",14),t.BQk(),t.ynx(27,18),t.YNc(28,ml,2,0,"th",16),t.YNc(29,dl,2,1,"td",14),t.BQk(),t.ynx(30,19),t.YNc(31,hl,2,0,"th",16),t.YNc(32,_l,4,4,"td",14),t.BQk(),t.ynx(33,20),t.YNc(34,gl,2,0,"th",16),t.YNc(35,fl,2,1,"td",14),t.BQk(),t.ynx(36,21),t.YNc(37,Cl,2,0,"th",16),t.YNc(38,xl,2,1,"td",14),t.BQk(),t.ynx(39,22),t.YNc(40,yl,2,0,"th",23),t.YNc(41,vl,4,4,"td",14),t.BQk(),t.ynx(42,24),t.YNc(43,Tl,2,0,"th",23),t.YNc(44,Ll,4,4,"td",14),t.BQk(),t.ynx(45,25),t.YNc(46,bl,2,0,"th",23),t.YNc(47,Sl,4,4,"td",14),t.BQk(),t.ynx(48,26),t.YNc(49,Zl,6,0,"th",27),t.YNc(50,Al,3,0,"td",28),t.BQk(),t.ynx(51,29),t.YNc(52,Fl,4,3,"td",30),t.BQk(),t.YNc(53,Nl,1,3,"tr",31),t.YNc(54,Ol,1,0,"tr",32),t.YNc(55,Pl,1,0,"tr",33),t.qZA()(),t._UZ(56,"mat-paginator",34),t.qZA()),2&e&&(t.xp6(7),t.Q6J("ngModel",i.selFilterBy),t.xp6(2),t.Q6J("ngForOf",t.DdM(14,Ul).concat(i.displayedColumns.slice(0,-1))),t.xp6(4),t.Q6J("ngModel",i.selFilter),t.xp6(2),t.Q6J("ngIf",i.apiCallStatus.status===i.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("matSortActive",i.tableSetting.sortBy)("matSortDirection",i.tableSetting.sortOrder)("dataSource",i.channels)("ngClass",t.VKq(15,Rl,""!==i.errorMessage)),t.xp6(37),t.Q6J("matFooterRowDef",t.DdM(17,kl)),t.xp6(1),t.Q6J("matHeaderRowDef",i.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumns),t.xp6(1),t.Q6J("pageSize",i.pageSize)("pageSizeOptions",i.pageSizeOptions)("showFirstLastButtons",i.screenSize!==i.screenSizeEnum.XS))},dependencies:[u.mk,u.sg,u.O5,u.PC,h.Fj,h.JJ,h.On,P.BN,m.xw,m.Wh,m.yH,Z.oO,Z.Zl,F.lW,B.Nt,x.KE,x.hX,Q.pW,w.gD,w.$L,V.ey,S.YE,S.nU,c.BZ,c.fO,c.as,c.w1,c.Dz,c.nj,c.mD,c.Ke,c.ge,c.ev,c.yh,c.XQ,c.Gk,c.Q2,W.gM,A.NW,U.Vv,U.$V,u.JJ,u.rS],styles:[".mat-column-announceChannel[_ngcontent-%COMP%]{max-width:2.2rem;width:2.2rem;text-overflow:unset}"]}),n})();var ht=f(8425);const Jl=["peersForm"],Ml=["stepper"];function Ql(n,a){if(1&n&&t._uU(0),2&n){const e=t.oxw();t.Oqu(e.peerFormLabel)}}function Yl(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Address is required."),t.qZA())}function Bl(n,a){if(1&n&&(t.TgZ(0,"div",33),t._UZ(1,"fa-icon",34),t.TgZ(2,"span"),t._uU(3),t.qZA()()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faExclamationTriangle),t.xp6(2),t.Oqu(e.peerConnectionError)}}function Hl(n,a){if(1&n&&t._uU(0),2&n){const e=t.oxw();t.Oqu(e.channelFormLabel)}}function zl(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Amount is required."),t.qZA())}function Vl(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Amount must be a positive number."),t.qZA())}function Gl(n,a){if(1&n&&(t.TgZ(0,"mat-error"),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.hij("Amount must be less than or equal to ",e.totalBalance,".")}}function Kl(n,a){if(1&n&&(t.TgZ(0,"div",33),t._UZ(1,"fa-icon",34),t.TgZ(2,"span"),t._uU(3),t.qZA()()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faExclamationTriangle),t.xp6(2),t.Oqu(e.channelConnectionError)}}let Wl=(()=>{class n{constructor(e,i,o,s,r,d){this.dialogRef=e,this.data=i,this.store=o,this.formBuilder=s,this.actions=r,this.logger=d,this.faExclamationTriangle=T.eHv,this.selNode={},this.peerAddress="",this.totalBalance=0,this.flgChannelOpened=!1,this.channelOpenStatus=null,this.newlyAddedPeer=null,this.flgEditable=!0,this.peerConnectionError="",this.channelConnectionError="",this.peerFormLabel="Peer Details",this.channelFormLabel="Open Channel (Optional)",this.unSubs=[new p.x,new p.x]}ngOnInit(){var e;this.data.message?(this.totalBalance=this.data.message.balance,this.peerAddress=this.data.message.peer&&this.data.message.peer.nodeId&&this.data.message.peer.address?this.data.message.peer.nodeId+"@"+this.data.message.peer.address:this.data.message.peer&&this.data.message.peer.nodeId&&!this.data.message.peer.address?this.data.message.peer.nodeId:""):(this.totalBalance=0,this.peerAddress=""),this.peerFormGroup=this.formBuilder.group({hiddenAddress:["",[h.kI.required]],peerAddress:[this.peerAddress,[h.kI.required]]}),this.channelFormGroup=this.formBuilder.group({fundingAmount:["",[h.kI.required,h.kI.min(1),h.kI.max(this.totalBalance)]],isPrivate:[!(null===(e=this.selNode)||void 0===e||!e.unannouncedChannels)],feeRate:[null],hiddenAmount:["",[h.kI.required]]}),this.statusFormGroup=this.formBuilder.group({}),this.store.select(C.LR).pipe((0,_.R)(this.unSubs[0])).subscribe(i=>{this.selNode=i,this.channelFormGroup.controls.isPrivate.setValue(!!i?.unannouncedChannels)}),this.actions.pipe((0,_.R)(this.unSubs[1]),(0,Y.h)(i=>i.type===l.lr.NEWLY_ADDED_PEER_ECL||i.type===l.lr.FETCH_CHANNELS_ECL||i.type===l.lr.UPDATE_API_CALL_STATUS_ECL)).subscribe(i=>{i.type===l.lr.NEWLY_ADDED_PEER_ECL&&(this.logger.info(i.payload),this.flgEditable=!1,this.newlyAddedPeer=i.payload.peer,this.peerFormGroup.controls.hiddenAddress.setValue(this.peerFormGroup.controls.peerAddress.value),this.stepper.next()),i.type===l.lr.FETCH_CHANNELS_ECL&&this.dialogRef.close(),i.type===l.lr.UPDATE_API_CALL_STATUS_ECL&&i.payload.status===l.Bn.ERROR&&("SaveNewPeer"===i.payload.action?this.peerConnectionError=i.payload.message:"SaveNewChannel"===i.payload.action&&(this.channelConnectionError=i.payload.message))})}onConnectPeer(){if(!this.peerFormGroup.controls.peerAddress.value)return!0;this.peerConnectionError="",this.store.dispatch((0,D.El)({payload:{id:this.peerFormGroup.controls.peerAddress.value}}))}onOpenChannel(){var e;if(!this.channelFormGroup.controls.fundingAmount.value||this.totalBalance-this.channelFormGroup.controls.fundingAmount.value<0)return!0;this.channelConnectionError="",this.store.dispatch((0,D.YX)({payload:{nodeId:null===(e=this.newlyAddedPeer)||void 0===e?void 0:e.nodeId,amount:this.channelFormGroup.controls.fundingAmount.value,private:this.channelFormGroup.controls.isPrivate.value,feeRate:this.channelFormGroup.controls.feeRate.value}}))}onClose(){this.dialogRef.close(!1)}stepSelectionChanged(e){var i,o,s,r;switch(e.selectedIndex){case 0:default:this.peerFormLabel="Peer Details",this.channelFormLabel="Open Channel (Optional)";break;case 1:this.peerFormLabel=this.peerFormGroup.controls.peerAddress.value?"Peer Added: "+(null!==(i=this.newlyAddedPeer)&&void 0!==i&&i.alias?this.newlyAddedPeer.alias:null===(o=this.newlyAddedPeer)||void 0===o?void 0:o.nodeId):"Peer Details",this.channelFormLabel="Open Channel (Optional)";break;case 2:this.peerFormLabel=this.peerFormGroup.controls.peerAddress.value?"Peer Added: "+(null!==(s=this.newlyAddedPeer)&&void 0!==s&&s.alias?this.newlyAddedPeer.alias:null===(r=this.newlyAddedPeer)||void 0===r?void 0:r.nodeId):"Peer Details",this.channelFormLabel=this.channelFormGroup.controls.fundingAmount.value?"Opening Channel for "+this.channelFormGroup.controls.fundingAmount.value+" Sats":"Open Channel (Optional)"}e.selectedIndex<e.previouslySelectedIndex&&(0===e.selectedIndex?this.peerFormGroup.controls.hiddenAddress.setValue(""):1===e.selectedIndex&&this.channelFormGroup.controls.hiddenAmount.setValue(""))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(M.so),t.Y36(M.WI),t.Y36(I.yh),t.Y36(h.QS),t.Y36($.eX),t.Y36(R.mQ))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-connect-peer"]],viewQuery:function(e,i){if(1&e&&(t.Gf(Jl,5),t.Gf(Ml,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.form=o.first),t.iGM(o=t.CRH())&&(i.stepper=o.first)}},decls:55,vars:22,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 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",""],["fxLayout","column","fxFlex","100"],["autoFocus","","matInput","","formControlName","peerAddress","tabindex","1","required",""],[4,"ngIf"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"mt-2"],["mat-button","","color","primary","tabindex","3","type","button",3,"click"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","start","fxLayoutAlign.gt-sm","space-between",1,"mb-1",3,"formGroup"],["matStepLabel","","disabled","true"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between center"],["fxLayout","column","fxFlex","30","fxLayoutAlign","start end"],["matInput","","autoFocus","","formControlName","fundingAmount","type","number","tabindex","1","required","",3,"step"],["matSuffix",""],["fxLayout","column","fxFlex","30"],["matInput","","formControlName","feeRate","type","number","name","feeRate","tabindex","7",3,"step","min"],["fxFlex","35","fxLayoutAlign","start center"],["tabindex","2","color","primary","formControlName","isPrivate","name","isPrivate"],["mat-button","","color","primary","tabindex","8","type","button",3,"click"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center"],["mat-button","","color","primary","tabindex","12","type","button","default","",3,"click"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-header",2)(3,"div",3)(4,"span",4),t._uU(5,"Connect to a new peer"),t.qZA()(),t.TgZ(6,"button",5),t.NdJ("click",function(){return i.onClose()}),t._uU(7,"X"),t.qZA()(),t.TgZ(8,"mat-card-content",6)(9,"div",7)(10,"mat-vertical-stepper",8,9),t.NdJ("selectionChange",function(s){return i.stepSelectionChanged(s)}),t.TgZ(12,"mat-step",10)(13,"form",11),t.YNc(14,Ql,1,1,"ng-template",12),t.TgZ(15,"mat-form-field",13)(16,"mat-label"),t._uU(17,"Lightning Address (pubkey OR pubkey@ip:port)"),t.qZA(),t._UZ(18,"input",14),t.YNc(19,Yl,2,0,"mat-error",15),t.qZA(),t.YNc(20,Bl,4,2,"div",16),t.TgZ(21,"div",17)(22,"button",18),t.NdJ("click",function(){return i.onConnectPeer()}),t._uU(23),t.qZA()()()(),t.TgZ(24,"mat-step",10)(25,"form",19),t.YNc(26,Hl,1,1,"ng-template",20),t.TgZ(27,"div",21)(28,"div",22)(29,"mat-form-field",23)(30,"mat-label"),t._uU(31,"Amount"),t.qZA(),t._UZ(32,"input",24),t.TgZ(33,"mat-hint"),t._uU(34),t.ALo(35,"number"),t.qZA(),t.TgZ(36,"span",25),t._uU(37," Sats "),t.qZA(),t.YNc(38,zl,2,0,"mat-error",15),t.YNc(39,Vl,2,0,"mat-error",15),t.YNc(40,Gl,2,1,"mat-error",15),t.qZA(),t.TgZ(41,"mat-form-field",26)(42,"mat-label"),t._uU(43,"Fee (Sats/vByte)"),t.qZA(),t._UZ(44,"input",27),t.qZA(),t.TgZ(45,"div",28)(46,"mat-slide-toggle",29),t._uU(47,"Private Channel"),t.qZA()()()(),t.YNc(48,Kl,4,2,"div",16),t.TgZ(49,"div",17)(50,"button",30),t.NdJ("click",function(){return i.onOpenChannel()}),t._uU(51),t.qZA()()()()(),t.TgZ(52,"div",31)(53,"button",32),t.NdJ("click",function(){return i.onClose()}),t._uU(54),t.qZA()()()()()()),2&e&&(t.xp6(10),t.Q6J("linear",!0),t.xp6(2),t.Q6J("stepControl",i.peerFormGroup)("editable",i.flgEditable),t.xp6(1),t.Q6J("formGroup",i.peerFormGroup),t.xp6(6),t.Q6J("ngIf",null==i.peerFormGroup.controls.peerAddress.errors?null:i.peerFormGroup.controls.peerAddress.errors.required),t.xp6(1),t.Q6J("ngIf",""!==i.peerConnectionError),t.xp6(3),t.Oqu(""!==i.peerConnectionError?"Retry":"Add Peer"),t.xp6(1),t.Q6J("stepControl",i.channelFormGroup)("editable",i.flgEditable),t.xp6(1),t.Q6J("formGroup",i.channelFormGroup),t.xp6(7),t.Q6J("step",1e3),t.xp6(2),t.hij("Remaining: ",t.lcZ(35,20,i.totalBalance-(i.channelFormGroup.controls.fundingAmount.value?i.channelFormGroup.controls.fundingAmount.value:0)),""),t.xp6(4),t.Q6J("ngIf",null==i.channelFormGroup.controls.fundingAmount.errors?null:i.channelFormGroup.controls.fundingAmount.errors.required),t.xp6(1),t.Q6J("ngIf",null==i.channelFormGroup.controls.fundingAmount.errors?null:i.channelFormGroup.controls.fundingAmount.errors.min),t.xp6(1),t.Q6J("ngIf",null==i.channelFormGroup.controls.fundingAmount.errors?null:i.channelFormGroup.controls.fundingAmount.errors.max),t.xp6(4),t.Q6J("step",1)("min",0),t.xp6(4),t.Q6J("ngIf",""!==i.channelConnectionError),t.xp6(3),t.Oqu(""!==i.channelConnectionError?"Retry":"Open Channel"),t.xp6(3),t.Oqu(null!=i.newlyAddedPeer&&i.newlyAddedPeer.nodeId?"Do It Later":"Close"))},dependencies:[u.O5,h._Y,h.Fj,h.wV,h.JJ,h.JL,h.Q7,h.qQ,h.sg,h.u,P.BN,m.xw,m.Wh,m.yH,F.lW,b.dn,b.dk,B.Nt,x.KE,x.hX,x.bx,x.TO,x.R9,qt.Rr,ht.C0,ht.VY,ht.Vq,j.h,tt.q,u.JJ]}),n})();function $l(n,a){if(1&n&&(t.TgZ(0,"mat-option",35),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw();t.Q6J("value",e),t.xp6(1),t.Oqu(i.getLabel(e))}}function Xl(n,a){1&n&&t._UZ(0,"mat-progress-bar",36)}function jl(n,a){1&n&&t._UZ(0,"th",37)}const Ut=function(n){return{"mr-0":n}};function tr(n,a){if(1&n&&t._UZ(0,"span",41),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,Ut,e.screenSize===e.screenSizeEnum.XS))}}function er(n,a){if(1&n&&t._UZ(0,"span",42),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,Ut,e.screenSize===e.screenSizeEnum.XS))}}function nr(n,a){if(1&n&&(t.TgZ(0,"td",38),t.YNc(1,tr,1,3,"span",39),t.YNc(2,er,1,3,"span",40),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Q6J("ngIf","CONNECTED"===e.state),t.xp6(1),t.Q6J("ngIf","DISCONNECTED"===e.state)}}function ir(n,a){1&n&&(t.TgZ(0,"th",43),t._uU(1,"Alias"),t.qZA())}const Rt=function(n){return{width:n}};function ar(n,a){if(1&n&&(t.TgZ(0,"td",38)(1,"div",44)(2,"span",45),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Rt,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.alias)}}function or(n,a){1&n&&(t.TgZ(0,"th",43),t._uU(1,"Node ID"),t.qZA())}function sr(n,a){if(1&n&&(t.TgZ(0,"td",38)(1,"div",44)(2,"span",45),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Rt,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function lr(n,a){1&n&&(t.TgZ(0,"th",43),t._uU(1,"Network Address"),t.qZA())}function rr(n,a){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.hij(" ",null==e?null:e.address," ")}}function cr(n,a){1&n&&(t.TgZ(0,"th",43),t._uU(1,"Channels"),t.qZA())}function ur(n,a){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null==e?null:e.channels)}}function pr(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",46)(1,"div",47)(2,"mat-select",48),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",49),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onDownloadCSV())}),t._uU(5,"Download CSV"),t.qZA()()()()}}function mr(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mat-option",49),t.NdJ("click",function(){t.CHM(e);const o=t.oxw().$implicit,s=t.oxw();return t.KtG(s.onPeerDetach(o))}),t._uU(1,"Disconnect"),t.qZA()}}function dr(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mat-option",49),t.NdJ("click",function(){t.CHM(e);const o=t.oxw().$implicit,s=t.oxw();return t.KtG(s.onConnectPeer(o))}),t._uU(1,"Reconnect"),t.qZA()}}function hr(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",50)(1,"div",47)(2,"mat-select",48),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",49),t.NdJ("click",function(o){const r=t.CHM(e).$implicit,d=t.oxw();return t.KtG(d.onPeerClick(r,o))}),t._uU(5,"View Info"),t.qZA(),t.TgZ(6,"mat-option",49),t.NdJ("click",function(){const s=t.CHM(e).$implicit,r=t.oxw();return t.KtG(r.onOpenChannel(s))}),t._uU(7,"Open Channel"),t.qZA(),t.YNc(8,mr,2,0,"mat-option",51),t.YNc(9,dr,2,0,"mat-option",51),t.qZA()()()}if(2&n){const e=a.$implicit;t.xp6(8),t.Q6J("ngIf","CONNECTED"===e.state),t.xp6(1),t.Q6J("ngIf","DISCONNECTED"===e.state)}}function _r(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No connected peer."),t.qZA())}function gr(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting peers..."),t.qZA())}function fr(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.errorMessage)}}function Cr(n,a){if(1&n&&(t.TgZ(0,"td",52),t.YNc(1,_r,2,0,"p",53),t.YNc(2,gr,2,0,"p",53),t.YNc(3,fr,2,1,"p",53),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",(!(null!=e.peers&&e.peers.data)||(null==e.peers||null==e.peers.data?null:e.peers.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.peers&&e.peers.data)||(null==e.peers||null==e.peers.data?null:e.peers.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.peers&&e.peers.data)||(null==e.peers||null==e.peers.data?null:e.peers.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const xr=function(n){return{"display-none":n}};function yr(n,a){if(1&n&&t._UZ(0,"tr",54),2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,xr,(null==e.peers?null:e.peers.data)&&(null==e.peers||null==e.peers.data?null:e.peers.data.length)>0))}}function vr(n,a){1&n&&t._UZ(0,"tr",55)}function Tr(n,a){1&n&&t._UZ(0,"tr",56)}const Lr=function(){return["all"]},br=function(n){return{"error-border":n}},Sr=function(){return["no_peer"]};let Zr=(()=>{class n{constructor(e,i,o,s,r,d){this.logger=e,this.store=i,this.rtlEffects=o,this.actions=s,this.commonService=r,this.camelCaseWithSpaces=d,this.nodePageDefs=l.Xk,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="peers_channels",this.tableSetting={tableId:"peers",recordsPerPage:l.IV,sortBy:"alias",sortOrder:l.Pi.DESCENDING},this.faUsers=T.FVb,this.newlyAddedPeer="",this.displayedColumns=[],this.peerAddress="",this.peersData=[],this.peers=new c.by([]),this.information={},this.availableBalance=0,this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.selFilter="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(C.yD).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{this.information=e}),this.store.select(C.nF).pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{var i,o;this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=(null===(i=e.pageSettings.find(s=>s.pageId===this.PAGE_ID))||void 0===i?void 0:i.tables.find(s=>s.tableId===this.tableSetting.tableId))||(null===(o=l.c3.find(s=>s.pageId===this.PAGE_ID))||void 0===o?void 0:o.tables.find(s=>s.tableId===this.tableSetting.tableId)),this.displayedColumns=this.screenSize===l.cu.XS||this.screenSize===l.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("state"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:l.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/14+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(C.Bo).pipe((0,_.R)(this.unSubs[2])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.peersData=e.peers,this.loadPeersTable(this.peersData),this.logger.info(e)}),this.store.select(C.kY).pipe((0,_.R)(this.unSubs[3])).subscribe(e=>{this.availableBalance=e.onchainBalance.total||0}),this.actions.pipe((0,_.R)(this.unSubs[4]),(0,Y.h)(e=>e.type===l.lr.SET_PEERS_ECL)).subscribe(e=>{this.peerAddress=null})}ngAfterViewInit(){this.peersData.length>0&&this.loadPeersTable(this.peersData)}onPeerClick(e,i){const o=[[{key:"nodeId",value:e.nodeId,title:"Public Key",width:100}],[{key:"address",value:e.address,title:"Address",width:50},{key:"alias",value:e.alias,title:"Alias",width:50}],[{key:"state",value:this.commonService.titleCase(e.state||""),title:"State",width:50},{key:"channels",value:e.channels,title:"Channels",width:50}]];this.store.dispatch((0,E.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:"Peer Information",showQRName:"Public Key",showQRField:e.nodeId,message:o}}}))}onConnectPeer(e){this.store.dispatch((0,E.qR)({payload:{data:{message:{peer:e.nodeId?e:null,information:this.information,balance:this.availableBalance},component:Wl}}}))}onOpenChannel(e){this.store.dispatch((0,E.qR)({payload:{data:{alertTitle:"Open Channel",message:{peer:e,information:this.information,balance:this.availableBalance},newlyAdded:!1,component:Ot}}}))}onPeerDetach(e){this.store.dispatch(e&&e.channels&&e.channels>0?(0,E.qR)({payload:{data:{type:l.n_.ERROR,alertTitle:"Disconnect Not Allowed",titleMessage:"Channel active with this peer."}}}):(0,E.c1)({payload:{data:{type:l.n_.CONFIRM,alertTitle:"Disconnect Peer",titleMessage:"Disconnect peer: "+(e.alias?e.alias:e.nodeId),noBtnText:"Cancel",yesBtnText:"Disconnect"}}})),this.rtlEffects.closeConfirm.pipe((0,_.R)(this.unSubs[5])).subscribe(i=>{i&&this.store.dispatch((0,D.GD)({payload:{nodeId:e.nodeId||""}}))})}applyFilter(){this.peers.filter=this.selFilter.trim().toLowerCase()}getLabel(e){const i=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(o=>o.column===e);return i?i.label?i.label:this.camelCaseWithSpaces.transform(i.column,"_"):this.commonService.titleCase(e)}setFilterPredicate(){this.peers.filterPredicate=(e,i)=>{var o;let s="";switch(this.selFilterBy){case"all":s=JSON.stringify(e).toLowerCase();break;case"state":s=(null===(o=e?.state)||void 0===o?void 0:o.toLowerCase())||"";break;default:s=typeof e[this.selFilterBy]>"u"?"":"string"==typeof e[this.selFilterBy]?e[this.selFilterBy].toLowerCase():"boolean"==typeof e[this.selFilterBy]?e[this.selFilterBy]?"yes":"no":e[this.selFilterBy].toString()}return"state"===this.selFilterBy?0===s.indexOf(i):s.includes(i)}}loadPeersTable(e){this.peers=new c.by(e?[...e]:[]),this.peers.sort=this.sort,this.peers.sortingDataAccessor=(i,o)=>i[o]&&isNaN(i[o])?i[o].toLocaleLowerCase():i[o]?+i[o]:null,this.peers.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter()}onDownloadCSV(){this.peers.data&&this.peers.data.length>0&&this.commonService.downloadFile(this.peers.data,"Peers")}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(R.mQ),t.Y36(I.yh),t.Y36(nt.V),t.Y36($.eX),t.Y36(k.v),t.Y36(G.i1))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-peers"]],viewQuery:function(e,i){if(1&e&&(t.Gf(S.YE,5),t.Gf(A.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.sort=o.first),t.iGM(o=t.CRH())&&(i.paginator=o.first)}},features:[t._Bn([{provide:w.PG,useValue:{overlayPanelClass:"rtl-select-overlay"}},{provide:A.ye,useValue:(0,l.pt)("Peers")}])],decls:50,vars:19,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.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","column","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"matSortActive","matSortDirection","dataSource","ngClass"],["table",""],["matColumnDef","state"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","State",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","alias"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","nodeId"],["matColumnDef","address"],["matColumnDef","channels"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_peer"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","State"],["mat-cell",""],["class","dot green","matTooltip","Connected","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot red","matTooltip","Disconnected","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["matTooltip","Connected","matTooltipPosition","right",1,"dot","green",3,"ngClass"],["matTooltip","Disconnected","matTooltipPosition","right",1,"dot","red",3,"ngClass"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],[3,"click",4,"ngIf"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"form",1,2)(3,"button",3),t.NdJ("click",function(){return i.onConnectPeer({})}),t._uU(4,"Add Peer"),t.qZA()(),t.TgZ(5,"div",4)(6,"div",5)(7,"div",6),t._UZ(8,"fa-icon",7),t.TgZ(9,"span",8),t._uU(10,"Peers"),t.qZA()(),t.TgZ(11,"div",9)(12,"mat-form-field",10)(13,"mat-label"),t._uU(14,"Filter By"),t.qZA(),t.TgZ(15,"mat-select",11),t.NdJ("ngModelChange",function(s){return i.selFilterBy=s})("selectionChange",function(){return i.selFilter="",i.applyFilter()}),t.TgZ(16,"perfect-scrollbar"),t.YNc(17,$l,2,2,"mat-option",12),t.qZA()()(),t.TgZ(18,"mat-form-field",10)(19,"mat-label"),t._uU(20,"Filter"),t.qZA(),t.TgZ(21,"input",13),t.NdJ("ngModelChange",function(s){return i.selFilter=s})("input",function(){return i.applyFilter()})("keyup",function(){return i.applyFilter()}),t.qZA()()()(),t.TgZ(22,"div",14),t.YNc(23,Xl,1,0,"mat-progress-bar",15),t.TgZ(24,"table",16,17),t.ynx(26,18),t.YNc(27,jl,1,0,"th",19),t.YNc(28,nr,3,2,"td",20),t.BQk(),t.ynx(29,21),t.YNc(30,ir,2,0,"th",22),t.YNc(31,ar,4,4,"td",20),t.BQk(),t.ynx(32,23),t.YNc(33,or,2,0,"th",22),t.YNc(34,sr,4,4,"td",20),t.BQk(),t.ynx(35,24),t.YNc(36,lr,2,0,"th",22),t.YNc(37,rr,2,1,"td",20),t.BQk(),t.ynx(38,25),t.YNc(39,cr,2,0,"th",22),t.YNc(40,ur,2,1,"td",20),t.BQk(),t.ynx(41,26),t.YNc(42,pr,6,0,"th",27),t.YNc(43,hr,10,2,"td",28),t.BQk(),t.ynx(44,29),t.YNc(45,Cr,4,3,"td",30),t.BQk(),t.YNc(46,yr,1,3,"tr",31),t.YNc(47,vr,1,0,"tr",32),t.YNc(48,Tr,1,0,"tr",33),t.qZA()(),t._UZ(49,"mat-paginator",34),t.qZA()()),2&e&&(t.xp6(8),t.Q6J("icon",i.faUsers),t.xp6(7),t.Q6J("ngModel",i.selFilterBy),t.xp6(2),t.Q6J("ngForOf",t.DdM(15,Lr).concat(i.displayedColumns.slice(0,-1))),t.xp6(4),t.Q6J("ngModel",i.selFilter),t.xp6(2),t.Q6J("ngIf",i.apiCallStatus.status===i.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("matSortActive",i.tableSetting.sortBy)("matSortDirection",i.tableSetting.sortOrder)("dataSource",i.peers)("ngClass",t.VKq(16,br,""!==i.errorMessage)),t.xp6(22),t.Q6J("matFooterRowDef",t.DdM(18,Sr)),t.xp6(1),t.Q6J("matHeaderRowDef",i.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumns),t.xp6(1),t.Q6J("pageSize",i.pageSize)("pageSizeOptions",i.pageSizeOptions)("showFirstLastButtons",i.screenSize!==i.screenSizeEnum.XS))},dependencies:[u.mk,u.sg,u.O5,u.PC,h._Y,h.Fj,h.JJ,h.JL,h.On,h.F,P.BN,m.xw,m.Wh,m.yH,Z.oO,Z.Zl,F.lW,B.Nt,x.KE,x.hX,Q.pW,w.gD,w.$L,V.ey,S.YE,S.nU,c.BZ,c.fO,c.as,c.w1,c.Dz,c.nj,c.mD,c.Ke,c.ge,c.ev,c.yh,c.XQ,c.Gk,c.Q2,W.gM,A.NW,U.Vv,U.$V],styles:[".mat-column-state[_ngcontent-%COMP%]{max-width:2.2rem;width:2.2rem;text-overflow:unset}"]}),n})();const Ar=["queryRoutesForm"];function Er(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Destination Node ID is required."),t.qZA())}function wr(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Amount is required."),t.qZA())}function Ir(n,a){1&n&&t._UZ(0,"mat-progress-bar",22)}function Fr(n,a){1&n&&(t.TgZ(0,"th",40),t._uU(1," Alias"),t.qZA())}const kt=function(n){return{"max-width":n}};function qr(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"span",42)(2,"span",43),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,kt,i.screenSize===i.screenSizeEnum.XS?"6rem":"30rem")),t.xp6(2),t.Oqu(null==e?null:e.alias)}}function Nr(n,a){1&n&&(t.TgZ(0,"th",40),t._uU(1," ID"),t.qZA())}function Or(n,a){if(1&n&&(t.TgZ(0,"td",41)(1,"span",42)(2,"span",43),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,kt,i.screenSize===i.screenSizeEnum.XS?"6rem":"30rem")),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function Pr(n,a){1&n&&(t.TgZ(0,"th",40)(1,"div",44),t._uU(2,"Actions"),t.qZA()())}function Ur(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",45)(1,"button",46),t.NdJ("click",function(){const s=t.CHM(e).$implicit,r=t.oxw(2);return t.KtG(r.onHopClick(s))}),t._uU(2,"View Info"),t.qZA()()}}function Rr(n,a){1&n&&t._UZ(0,"tr",47)}function kr(n,a){1&n&&t._UZ(0,"tr",48)}const Dr=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}};function Jr(n,a){if(1&n&&(t.TgZ(0,"div",23)(1,"mat-expansion-panel",24)(2,"mat-expansion-panel-header")(3,"mat-panel-title",25)(4,"span",26),t._uU(5),t.qZA(),t.TgZ(6,"span",27),t._uU(7),t.ALo(8,"number"),t.qZA()()(),t.TgZ(9,"mat-panel-description",28)(10,"div",29)(11,"table",30,31),t.ynx(13,32),t.YNc(14,Fr,2,0,"th",33),t.YNc(15,qr,4,4,"td",34),t.BQk(),t.ynx(16,35),t.YNc(17,Nr,2,0,"th",33),t.YNc(18,Or,4,4,"td",34),t.BQk(),t.ynx(19,36),t.YNc(20,Pr,3,0,"th",33),t.YNc(21,Ur,3,0,"td",37),t.BQk(),t.YNc(22,Rr,1,0,"tr",38),t.YNc(23,kr,1,0,"tr",39),t.qZA()()()()()),2&n){const e=a.$implicit,i=a.index,o=t.oxw();t.xp6(5),t.hij("Route ",i+1,""),t.xp6(2),t.Oqu(t.lcZ(8,6,e.amount/1e3)),t.xp6(4),t.Q6J("dataSource",o.qrHops[i])("ngClass",t.VKq(8,Dr,"error"===o.flgLoading[0])),t.xp6(11),t.Q6J("matHeaderRowDef",o.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",o.displayedColumns)}}let Mr=(()=>{class n{constructor(e,i,o){this.store=e,this.eclEffects=i,this.commonService=o,this.allQRoutes=[],this.nodeId="",this.amount=0,this.qrHops=[],this.displayedColumns=["alias","nodeId","actions"],this.flgLoading=[!1],this.faRoute=T.FpQ,this.faExclamationTriangle=T.eHv,this.screenSize="",this.screenSizeEnum=l.cu,this.unSubs=[new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.qrHops[0]=new c.by([]),this.qrHops[0].data=[],this.eclEffects.setQueryRoutes.pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{e&&e.routes&&e.routes.length?(this.flgLoading[0]=!1,this.allQRoutes=e.routes,this.allQRoutes.forEach((i,o)=>{this.qrHops[o]=new c.by([...i.nodeIds])})):(this.flgLoading[0]="error",this.allQRoutes=[],this.qrHops=[])})}onQueryRoutes(){if(!this.nodeId||!this.amount)return!0;this.qrHops=[],this.flgLoading[0]=!0,this.store.dispatch((0,D.WO)({payload:{nodeId:this.nodeId,amount:1e3*this.amount}}))}resetData(){this.allQRoutes=[],this.nodeId="",this.amount=0,this.flgLoading[0]=!1,this.qrHops=[],this.form.resetForm()}onHopClick(e){this.store.dispatch((0,E.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:"Route Information",message:[[{key:"alias",value:e.alias,title:"Alias",width:100,type:l.Gi.STRING}],[{key:"nodeId",value:e.nodeId,title:"Node ID",width:100,type:l.Gi.STRING}]]}}}))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(I.yh),t.Y36(lt.o),t.Y36(k.v))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-query-routes"]],viewQuery:function(e,i){if(1&e&&t.Gf(Ar,7),2&e){let o;t.iGM(o=t.CRH())&&(i.form=o.first)}},decls:32,vars:10,consts:[["fxLayout","column"],["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"],["fxLayout","column","fxFlex","69","fxLayoutAlign","start end"],["matInput","","name","nodeId","tabindex","1","required","",3,"ngModel","ngModelChange"],["destPubkey","ngModel"],[4,"ngIf"],["fxLayout","column","fxFlex","29","fxLayoutAlign","start end"],["matInput","","name","amount","tabindex","2","type","number","required","",3,"step","min","ngModel","ngModelChange"],["fxLayout","row",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","3","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","type","submit","tabindex","4"],["fxLayout","column","fxLayoutAlign","start stretch","fxLayout.gt-sm","row wrap",1,"page-sub-title-container","mt-3","mb-1"],["fxFlex","70","fxLayoutAlign","start center"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["mode","indeterminate",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start",1,"padding-gap-x"],["fxLayout","column","fxFlex","100"],["fxFlex","100",4,"ngFor","ngForOf"],["mode","indeterminate"],["fxFlex","100"],[1,"flat-expansion-panel","help-expansion","mb-2px"],["fxLayout","row","fxLayoutAlign","space-between start"],["fxFlex","50","fxLayoutAlign","start start"],["fxFlex","50","fxLayoutAlign","end end"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between stretch",1,"table-container","mb-2",3,"perfectScrollbar"],["mat-table","",3,"dataSource","ngClass"],["table[i]",""],["matColumnDef","alias"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","nodeId"],["matColumnDef","actions"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],["fxLayout.gt-xs","row",1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["mat-cell","","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","4",1,"table-actions-button",3,"click"],["mat-header-row",""],["mat-row",""]],template:function(e,i){if(1&e){const o=t.EpF();t.TgZ(0,"div",0)(1,"form",1,2),t.NdJ("ngSubmit",function(){t.CHM(o);const r=t.MAs(2);return t.KtG(r.form.valid&&i.onQueryRoutes())}),t.TgZ(3,"div",3),t._UZ(4,"fa-icon",4),t.TgZ(5,"span"),t._uU(6,"The actual routing fee on a payment can be different from the fee shown on query routes."),t.qZA()(),t.TgZ(7,"mat-form-field",5)(8,"mat-label"),t._uU(9,"Destination Node ID"),t.qZA(),t.TgZ(10,"input",6,7),t.NdJ("ngModelChange",function(r){return i.nodeId=r}),t.qZA(),t.YNc(12,Er,2,0,"mat-error",8),t.qZA(),t.TgZ(13,"mat-form-field",9)(14,"mat-label"),t._uU(15,"Amount (Sats)"),t.qZA(),t.TgZ(16,"input",10),t.NdJ("ngModelChange",function(r){return i.amount=r}),t.qZA(),t.YNc(17,wr,2,0,"mat-error",8),t.qZA(),t.TgZ(18,"div",11)(19,"button",12),t.NdJ("click",function(){return i.resetData()}),t._uU(20,"Clear"),t.qZA(),t.TgZ(21,"button",13),t._uU(22,"Query Route"),t.qZA()()(),t.TgZ(23,"div",14)(24,"div",15),t._UZ(25,"fa-icon",16),t.TgZ(26,"span",17),t._uU(27,"Transaction Route"),t.qZA()()(),t.YNc(28,Ir,1,0,"mat-progress-bar",18),t.TgZ(29,"div",19)(30,"div",20),t.YNc(31,Jr,24,10,"div",21),t.qZA()()()}2&e&&(t.xp6(4),t.Q6J("icon",i.faExclamationTriangle),t.xp6(6),t.Q6J("ngModel",i.nodeId),t.xp6(2),t.Q6J("ngIf",!i.nodeId),t.xp6(4),t.Q6J("step",1e3)("min",0)("ngModel",i.amount),t.xp6(1),t.Q6J("ngIf",!i.amount),t.xp6(8),t.Q6J("icon",i.faRoute),t.xp6(3),t.Q6J("ngIf",!0===i.flgLoading[0]),t.xp6(3),t.Q6J("ngForOf",i.allQRoutes))},dependencies:[u.mk,u.sg,u.O5,u.PC,h._Y,h.Fj,h.wV,h.JJ,h.JL,h.Q7,h.qQ,h.On,h.F,P.BN,m.xw,m.Wh,m.yH,Z.oO,Z.Zl,F.lW,z.ib,z.yz,z.yK,z.u4,B.Nt,x.KE,x.hX,x.TO,Q.pW,c.BZ,c.fO,c.as,c.w1,c.Dz,c.nj,c.ge,c.ev,c.XQ,c.Gk,U.$V,tt.q,u.JJ]}),n})();function Qr(n,a){if(1&n&&(t.TgZ(0,"mat-option",37),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw();t.Q6J("value",e),t.xp6(1),t.Oqu(i.getLabel(e))}}function Yr(n,a){1&n&&t._UZ(0,"mat-progress-bar",38)}function Br(n,a){1&n&&t._UZ(0,"th",39)}function Hr(n,a){if(1&n&&(t.TgZ(0,"span",43),t._UZ(1,"fa-icon",44),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("icon",e.faEyeSlash)}}function zr(n,a){if(1&n&&(t.TgZ(0,"span",45),t._UZ(1,"fa-icon",44),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("icon",e.faEye)}}function Vr(n,a){if(1&n&&(t.TgZ(0,"td",40),t.YNc(1,Hr,2,1,"span",41),t.YNc(2,zr,2,1,"span",42),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Q6J("ngIf",!e.announceChannel),t.xp6(1),t.Q6J("ngIf",e.announceChannel)}}function Gr(n,a){1&n&&(t.TgZ(0,"th",46),t._uU(1,"State"),t.qZA())}function Kr(n,a){if(1&n&&(t.TgZ(0,"td",40),t._uU(1),t.ALo(2,"titlecase"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,null==e?null:e.state))}}function Wr(n,a){1&n&&(t.TgZ(0,"th",46),t._uU(1,"Short Channel ID"),t.qZA())}function $r(n,a){if(1&n&&(t.TgZ(0,"td",40),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null==e?null:e.shortChannelId)}}function Xr(n,a){1&n&&(t.TgZ(0,"th",46),t._uU(1,"Channel ID"),t.qZA())}const _t=function(n){return{width:n}};function jr(n,a){if(1&n&&(t.TgZ(0,"td",40)(1,"div",47)(2,"span",48),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,_t,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.channelId)}}function tc(n,a){1&n&&(t.TgZ(0,"th",46),t._uU(1,"Alias"),t.qZA())}function ec(n,a){if(1&n&&(t.TgZ(0,"td",40)(1,"div",47)(2,"span",48),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,_t,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(e.alias)}}function nc(n,a){1&n&&(t.TgZ(0,"th",46),t._uU(1,"Node ID"),t.qZA())}function ic(n,a){if(1&n&&(t.TgZ(0,"td",40)(1,"div",47)(2,"span",48),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,_t,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function ac(n,a){1&n&&(t.TgZ(0,"th",46),t._uU(1,"Funder"),t.qZA())}function oc(n,a){if(1&n&&(t.TgZ(0,"td",40),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null!=e&&e.isFunder?"Yes":"No")}}function sc(n,a){1&n&&(t.TgZ(0,"th",46),t._uU(1,"Buried"),t.qZA())}function lc(n,a){if(1&n&&(t.TgZ(0,"td",40),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null!=e&&e.buried?"Yes":"No")}}function rc(n,a){1&n&&(t.TgZ(0,"th",49),t._uU(1,"Local Balance (Sats)"),t.qZA())}function cc(n,a){if(1&n&&(t.TgZ(0,"td",40)(1,"span",50),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.toLocal,"1.0-0")," ")}}function uc(n,a){1&n&&(t.TgZ(0,"th",49),t._uU(1,"Remote Balance (Sats)"),t.qZA())}function pc(n,a){if(1&n&&(t.TgZ(0,"td",40)(1,"span",50),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.toRemote,"1.0-0")," ")}}function mc(n,a){1&n&&(t.TgZ(0,"th",49),t._uU(1,"Local Fee/KW"),t.qZA())}function dc(n,a){if(1&n&&(t.TgZ(0,"td",40)(1,"span",50),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.feeRatePerKw,"1.0-0")," ")}}function hc(n,a){1&n&&(t.TgZ(0,"th",46),t._uU(1,"Balance Score"),t.qZA())}function _c(n,a){if(1&n&&(t.TgZ(0,"td",40)(1,"div",51)(2,"mat-hint",52),t._uU(3),t.ALo(4,"number"),t.qZA()(),t._UZ(5,"mat-progress-bar",53),t.qZA()),2&n){const e=a.$implicit;t.xp6(3),t.Oqu(t.lcZ(4,2,(null==e?null:e.balancedness)||0)),t.xp6(2),t.s9C("value",e.toLocal&&e.toLocal>0?+e.toLocal/(+e.toLocal+ +e.toRemote)*100:0)}}function gc(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",54)(1,"div",55)(2,"mat-select",56),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",57),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onDownloadCSV())}),t._uU(5,"Download CSV"),t.qZA()()()()}}function fc(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",58)(1,"div",55)(2,"mat-select",59),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",57),t.NdJ("click",function(o){const r=t.CHM(e).$implicit,d=t.oxw();return t.KtG(d.onChannelClick(r,o))}),t._uU(5,"View Info"),t.qZA(),t.TgZ(6,"mat-option",57),t.NdJ("click",function(){const s=t.CHM(e).$implicit,r=t.oxw();return t.KtG(r.onChannelClose(s,!0))}),t._uU(7,"Force Close"),t.qZA()()()()}}function Cc(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No inactive channel available."),t.qZA())}function xc(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting inactive channels..."),t.qZA())}function yc(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(e.errorMessage)}}function vc(n,a){if(1&n&&(t.TgZ(0,"td",60),t.YNc(1,Cc,2,0,"p",61),t.YNc(2,xc,2,0,"p",61),t.YNc(3,yc,2,1,"p",61),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const Tc=function(n){return{"display-none":n}};function Lc(n,a){if(1&n&&t._UZ(0,"tr",62),2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,Tc,(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function bc(n,a){1&n&&t._UZ(0,"tr",63)}function Sc(n,a){1&n&&t._UZ(0,"tr",64)}const Zc=function(){return["all"]},Ac=function(n){return{"error-border":n}},Ec=function(){return["no_channel"]};let wc=(()=>{class n{constructor(e,i,o,s,r){this.logger=e,this.store=i,this.rtlEffects=o,this.commonService=s,this.camelCaseWithSpaces=r,this.faEye=T.Mdf,this.faEyeSlash=T.Aq,this.nodePageDefs=l.Xk,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="peers_channels",this.tableSetting={tableId:"inactive_channels",recordsPerPage:l.IV,sortBy:"alias",sortOrder:l.Pi.DESCENDING},this.totalBalance=0,this.displayedColumns=[],this.channels=new c.by([]),this.myChanPolicy={},this.information={},this.numPeers=-1,this.feeRateTypes=l.vn,this.selFilter="",this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(C.nF).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{var i,o;this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=(null===(i=e.pageSettings.find(s=>s.pageId===this.PAGE_ID))||void 0===i?void 0:i.tables.find(s=>s.tableId===this.tableSetting.tableId))||(null===(o=l.c3.find(s=>s.pageId===this.PAGE_ID))||void 0===o?void 0:o.tables.find(s=>s.tableId===this.tableSetting.tableId)),this.displayedColumns=this.screenSize===l.cu.XS||this.screenSize===l.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("announceChannel"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:l.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/14+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(C.Xz).pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.inactiveChannels=e.inactiveChannels,this.loadChannelsTable(),this.logger.info(e)}),this.store.select(C.yD).pipe((0,_.R)(this.unSubs[2])).subscribe(e=>{this.information=e}),this.store.select(C.Bo).pipe((0,_.R)(this.unSubs[3])).subscribe(e=>{this.numPeers=e.peers&&e.peers.length?e.peers.length:0}),this.store.select(C.kY).pipe((0,_.R)(this.unSubs[4])).subscribe(e=>{this.totalBalance=e.onchainBalance.total||0})}ngAfterViewInit(){this.inactiveChannels.length>0&&this.loadChannelsTable()}onChannelClose(e,i){this.store.dispatch((0,E.c1)({payload:{data:{type:l.n_.CONFIRM,alertTitle:i?"Force Close Channel":"Close Channel",titleMessage:i?"Force closing channel: "+(e.alias||e.shortChannelId?e.alias&&e.shortChannelId?e.alias+" ("+e.shortChannelId+")":e.alias?e.alias:e.shortChannelId:e.channelId):"Closing channel: "+(e.alias||e.shortChannelId?e.alias&&e.shortChannelId?e.alias+" ("+e.shortChannelId+")":e.alias?e.alias:e.shortChannelId:e.channelId),noBtnText:"Cancel",yesBtnText:i?"Force Close":"Close Channel"}}})),this.rtlEffects.closeConfirm.pipe((0,_.R)(this.unSubs[5])).subscribe(d=>{d&&this.store.dispatch((0,D.BL)({payload:{channelId:e.channelId||"",force:i}}))})}onChannelClick(e,i){this.store.dispatch((0,E.qR)({payload:{data:{channel:e,channelsType:"inactive",component:mt}}}))}applyFilter(){this.channels.filter=this.selFilter.trim().toLocaleLowerCase()}getLabel(e){const i=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(o=>o.column===e);return i?i.label?i.label:this.camelCaseWithSpaces.transform(i.column,"_"):"announceChannel"===e?"Private":this.commonService.titleCase(e)}setFilterPredicate(){this.channels.filterPredicate=(e,i)=>{let o="";switch(this.selFilterBy){case"all":o=JSON.stringify(e).toLowerCase();break;case"announceChannel":o=e?.announceChannel?"public":"private";break;default:o=typeof e[this.selFilterBy]>"u"?"":"string"==typeof e[this.selFilterBy]?e[this.selFilterBy].toLowerCase():"boolean"==typeof e[this.selFilterBy]?e[this.selFilterBy]?"yes":"no":e[this.selFilterBy].toString()}return o.includes(i)}}loadChannelsTable(){this.channels=new c.by([...this.inactiveChannels]),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(e,i)=>e[i]&&isNaN(e[i])?e[i].toLocaleLowerCase():e[i]?+e[i]:null,this.channels.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter(),this.logger.info(this.channels)}onDownloadCSV(){this.channels.data&&this.channels.data.length>0&&this.commonService.downloadFile(this.channels.data,"InactiveChannels")}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(R.mQ),t.Y36(I.yh),t.Y36(nt.V),t.Y36(k.v),t.Y36(G.i1))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-inactive-table"]],viewQuery:function(e,i){if(1&e&&(t.Gf(S.YE,5),t.Gf(A.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.sort=o.first),t.iGM(o=t.CRH())&&(i.paginator=o.first)}},features:[t._Bn([{provide:w.PG,useValue:{overlayPanelClass:"rtl-select-overlay"}},{provide:A.ye,useValue:(0,l.pt)("Channels")}])],decls:63,vars:18,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.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","column","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"matSortActive","matSortDirection","dataSource","ngClass"],["table",""],["matColumnDef","announceChannel"],["mat-header-cell","","mat-sort-header","","matTooltip","Private",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","state"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","shortChannelId"],["matColumnDef","channelId"],["matColumnDef","alias"],["matColumnDef","nodeId"],["matColumnDef","isFunder"],["matColumnDef","buried"],["matColumnDef","toLocal"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","toRemote"],["matColumnDef","feeRatePerKw"],["matColumnDef","balancedness"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_channel"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","matTooltip","Private"],["mat-cell",""],["class","mr-1","matTooltip","Private","matTooltipPosition","right",4,"ngIf"],["class","mr-1","matTooltip","Public","matTooltipPosition","right",4,"ngIf"],["matTooltip","Private","matTooltipPosition","right",1,"mr-1"],[3,"icon"],["matTooltip","Public","matTooltipPosition","right",1,"mr-1"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["fxLayout","row"],["fxFlex","100","fxLayoutAlign","center center",1,"font-size-80"],["mode","determinate",3,"value"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["placeholder","Actions","tabindex","2",1,"mr-0"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"div",1),t._UZ(2,"div",2),t.TgZ(3,"div",3)(4,"mat-form-field",4)(5,"mat-label"),t._uU(6,"Filter By"),t.qZA(),t.TgZ(7,"mat-select",5),t.NdJ("ngModelChange",function(s){return i.selFilterBy=s})("selectionChange",function(){return i.selFilter="",i.applyFilter()}),t.TgZ(8,"perfect-scrollbar"),t.YNc(9,Qr,2,2,"mat-option",6),t.qZA()()(),t.TgZ(10,"mat-form-field",4)(11,"mat-label"),t._uU(12,"Filter"),t.qZA(),t.TgZ(13,"input",7),t.NdJ("ngModelChange",function(s){return i.selFilter=s})("input",function(){return i.applyFilter()})("keyup",function(){return i.applyFilter()}),t.qZA()()()(),t.TgZ(14,"div",8),t.YNc(15,Yr,1,0,"mat-progress-bar",9),t.TgZ(16,"table",10,11),t.ynx(18,12),t.YNc(19,Br,1,0,"th",13),t.YNc(20,Vr,3,2,"td",14),t.BQk(),t.ynx(21,15),t.YNc(22,Gr,2,0,"th",16),t.YNc(23,Kr,3,3,"td",14),t.BQk(),t.ynx(24,17),t.YNc(25,Wr,2,0,"th",16),t.YNc(26,$r,2,1,"td",14),t.BQk(),t.ynx(27,18),t.YNc(28,Xr,2,0,"th",16),t.YNc(29,jr,4,4,"td",14),t.BQk(),t.ynx(30,19),t.YNc(31,tc,2,0,"th",16),t.YNc(32,ec,4,4,"td",14),t.BQk(),t.ynx(33,20),t.YNc(34,nc,2,0,"th",16),t.YNc(35,ic,4,4,"td",14),t.BQk(),t.ynx(36,21),t.YNc(37,ac,2,0,"th",16),t.YNc(38,oc,2,1,"td",14),t.BQk(),t.ynx(39,22),t.YNc(40,sc,2,0,"th",16),t.YNc(41,lc,2,1,"td",14),t.BQk(),t.ynx(42,23),t.YNc(43,rc,2,0,"th",24),t.YNc(44,cc,4,4,"td",14),t.BQk(),t.ynx(45,25),t.YNc(46,uc,2,0,"th",24),t.YNc(47,pc,4,4,"td",14),t.BQk(),t.ynx(48,26),t.YNc(49,mc,2,0,"th",24),t.YNc(50,dc,4,4,"td",14),t.BQk(),t.ynx(51,27),t.YNc(52,hc,2,0,"th",16),t.YNc(53,_c,6,4,"td",14),t.BQk(),t.ynx(54,28),t.YNc(55,gc,6,0,"th",29),t.YNc(56,fc,8,0,"td",30),t.BQk(),t.ynx(57,31),t.YNc(58,vc,4,3,"td",32),t.BQk(),t.YNc(59,Lc,1,3,"tr",33),t.YNc(60,bc,1,0,"tr",34),t.YNc(61,Sc,1,0,"tr",35),t.qZA()(),t._UZ(62,"mat-paginator",36),t.qZA()),2&e&&(t.xp6(7),t.Q6J("ngModel",i.selFilterBy),t.xp6(2),t.Q6J("ngForOf",t.DdM(14,Zc).concat(i.displayedColumns.slice(0,-1))),t.xp6(4),t.Q6J("ngModel",i.selFilter),t.xp6(2),t.Q6J("ngIf",i.apiCallStatus.status===i.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("matSortActive",i.tableSetting.sortBy)("matSortDirection",i.tableSetting.sortOrder)("dataSource",i.channels)("ngClass",t.VKq(15,Ac,""!==i.errorMessage)),t.xp6(43),t.Q6J("matFooterRowDef",t.DdM(17,Ec)),t.xp6(1),t.Q6J("matHeaderRowDef",i.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumns),t.xp6(1),t.Q6J("pageSize",i.pageSize)("pageSizeOptions",i.pageSizeOptions)("showFirstLastButtons",i.screenSize!==i.screenSizeEnum.XS))},dependencies:[u.mk,u.sg,u.O5,u.PC,h.Fj,h.JJ,h.On,P.BN,m.xw,m.Wh,m.yH,Z.oO,Z.Zl,B.Nt,x.KE,x.hX,x.bx,Q.pW,w.gD,w.$L,V.ey,S.YE,S.nU,c.BZ,c.fO,c.as,c.w1,c.Dz,c.nj,c.mD,c.Ke,c.ge,c.ev,c.yh,c.XQ,c.Gk,c.Q2,W.gM,A.NW,U.Vv,U.$V,u.JJ,u.rS],styles:[".mat-column-announceChannel[_ngcontent-%COMP%]{max-width:2.2rem;width:2.2rem;text-overflow:unset}.mat-column-balancedness[_ngcontent-%COMP%]{padding-left:3rem;min-width:15rem;max-width:30rem}"]}),n})();function Ic(n,a){if(1&n&&(t.TgZ(0,"div",5),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Oqu(e.errorMessage)}}function Fc(n,a){if(1&n&&(t.TgZ(0,"mat-option",13),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.Q6J("value",e),t.xp6(1),t.Oqu(i.getLabel(e))}}const qc=function(){return["all"]};function Nc(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",6),t._UZ(1,"div",7),t.TgZ(2,"div",8)(3,"mat-form-field",9)(4,"mat-label"),t._uU(5,"Filter By"),t.qZA(),t.TgZ(6,"mat-select",10),t.NdJ("ngModelChange",function(o){t.CHM(e);const s=t.oxw();return t.KtG(s.selFilterBy=o)})("selectionChange",function(){t.CHM(e);const o=t.oxw();return o.selFilter="",t.KtG(o.applyFilter())}),t.TgZ(7,"perfect-scrollbar"),t.YNc(8,Fc,2,2,"mat-option",11),t.qZA()()(),t.TgZ(9,"mat-form-field",9)(10,"mat-label"),t._uU(11,"Filter"),t.qZA(),t.TgZ(12,"input",12),t.NdJ("ngModelChange",function(o){t.CHM(e);const s=t.oxw();return t.KtG(s.selFilter=o)})("input",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.applyFilter())})("keyup",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.applyFilter())}),t.qZA()()()()}if(2&n){const e=t.oxw();t.xp6(6),t.Q6J("ngModel",e.selFilterBy),t.xp6(2),t.Q6J("ngForOf",t.DdM(3,qc).concat(e.displayedColumns.slice(0,-1))),t.xp6(4),t.Q6J("ngModel",e.selFilter)}}function Oc(n,a){1&n&&t._UZ(0,"mat-progress-bar",42)}function Pc(n,a){1&n&&t._UZ(0,"th",43)}const Uc=function(n){return{"ml-0":n}};function Rc(n,a){if(1&n&&(t._UZ(0,"span",46),t.ALo(1,"camelcase")),2&n){const e=t.oxw().$implicit,i=t.oxw(2);t.s9C("matTooltip",t.lcZ(1,2,null==e?null:e.type)),t.Q6J("ngClass",t.VKq(4,Uc,i.screenSize===i.screenSizeEnum.XS))}}function kc(n,a){if(1&n&&(t.TgZ(0,"td",44),t.YNc(1,Rc,2,6,"span",45),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Q6J("ngIf","payment-relayed"!==(null==e?null:e.type))}}function Dc(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Date/Time"),t.qZA())}function Jc(n,a){if(1&n&&(t.TgZ(0,"td",44),t._uU(1),t.ALo(2,"date"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,null==e?null:e.timestamp,"dd/MMM/y HH:mm")," ")}}function Mc(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"In Channel ID"),t.qZA())}const et=function(n){return{width:n}};function Qc(n,a){if(1&n&&(t.TgZ(0,"td",44)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,et,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.fromChannelId)}}function Yc(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"In Channel Short ID"),t.qZA())}function Bc(n,a){if(1&n&&(t.TgZ(0,"td",44),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null==e?null:e.fromShortChannelId)}}function Hc(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"In Channel"),t.qZA())}function zc(n,a){if(1&n&&(t.TgZ(0,"td",44)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,et,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.fromChannelAlias)}}function Vc(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Out Channel ID"),t.qZA())}function Gc(n,a){if(1&n&&(t.TgZ(0,"td",44)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,et,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.toChannelId)}}function Kc(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Out Channel Short ID"),t.qZA())}function Wc(n,a){if(1&n&&(t.TgZ(0,"td",44),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null==e?null:e.toShortChannelId)}}function $c(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Out Channel"),t.qZA())}function Xc(n,a){if(1&n&&(t.TgZ(0,"td",44)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,et,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.toChannelAlias)}}function jc(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1,"Payment Hash"),t.qZA())}function tu(n,a){if(1&n&&(t.TgZ(0,"td",44)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,et,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.paymentHash)}}function eu(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Amount In (Sats)"),t.qZA())}function nu(n,a){if(1&n&&(t.TgZ(0,"td",44)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,null==e?null:e.amountIn))}}function iu(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Amount Out (Sats)"),t.qZA())}function au(n,a){if(1&n&&(t.TgZ(0,"td",44)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,null==e?null:e.amountOut))}}function ou(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Fee Earned (Sats)"),t.qZA())}function su(n,a){if(1&n&&(t.TgZ(0,"td",44)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,(null==e?null:e.amountIn)-(null==e?null:e.amountOut)))}}function lu(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",52)(1,"div",53)(2,"mat-select",54),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",55),t.NdJ("click",function(){t.CHM(e);const o=t.oxw(2);return t.KtG(o.onDownloadCSV())}),t._uU(5,"Download CSV"),t.qZA()()()()}}function ru(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",56)(1,"button",57),t.NdJ("click",function(o){const r=t.CHM(e).$implicit,d=t.oxw(2);return t.KtG(d.onForwardingEventClick(r,o))}),t._uU(2,"View Info"),t.qZA()()}}function cu(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No forwarding history available."),t.qZA())}function uu(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting forwarding history..."),t.qZA())}function pu(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Oqu(e.errorMessage)}}function mu(n,a){if(1&n&&(t.TgZ(0,"td",58),t.YNc(1,cu,2,0,"p",59),t.YNc(2,uu,2,0,"p",59),t.YNc(3,pu,2,1,"p",59),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",(!(null!=e.forwardingHistoryEvents&&e.forwardingHistoryEvents.data)||(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.forwardingHistoryEvents&&e.forwardingHistoryEvents.data)||(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.forwardingHistoryEvents&&e.forwardingHistoryEvents.data)||(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const du=function(n){return{"display-none":n}};function hu(n,a){if(1&n&&t._UZ(0,"tr",60),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,du,(null==e.forwardingHistoryEvents?null:e.forwardingHistoryEvents.data)&&(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)>0))}}function _u(n,a){1&n&&t._UZ(0,"tr",61)}function gu(n,a){1&n&&t._UZ(0,"tr",62)}const fu=function(){return["no_event"]};function Cu(n,a){if(1&n&&(t.TgZ(0,"div",14),t.YNc(1,Oc,1,0,"mat-progress-bar",15),t.TgZ(2,"table",16,17),t.ynx(4,18),t.YNc(5,Pc,1,0,"th",19),t.YNc(6,kc,2,1,"td",20),t.BQk(),t.ynx(7,21),t.YNc(8,Dc,2,0,"th",22),t.YNc(9,Jc,3,4,"td",20),t.BQk(),t.ynx(10,23),t.YNc(11,Mc,2,0,"th",22),t.YNc(12,Qc,4,4,"td",20),t.BQk(),t.ynx(13,24),t.YNc(14,Yc,2,0,"th",22),t.YNc(15,Bc,2,1,"td",20),t.BQk(),t.ynx(16,25),t.YNc(17,Hc,2,0,"th",22),t.YNc(18,zc,4,4,"td",20),t.BQk(),t.ynx(19,26),t.YNc(20,Vc,2,0,"th",22),t.YNc(21,Gc,4,4,"td",20),t.BQk(),t.ynx(22,27),t.YNc(23,Kc,2,0,"th",22),t.YNc(24,Wc,2,1,"td",20),t.BQk(),t.ynx(25,28),t.YNc(26,$c,2,0,"th",22),t.YNc(27,Xc,4,4,"td",20),t.BQk(),t.ynx(28,29),t.YNc(29,jc,2,0,"th",22),t.YNc(30,tu,4,4,"td",20),t.BQk(),t.ynx(31,30),t.YNc(32,eu,2,0,"th",31),t.YNc(33,nu,4,3,"td",20),t.BQk(),t.ynx(34,32),t.YNc(35,iu,2,0,"th",31),t.YNc(36,au,4,3,"td",20),t.BQk(),t.ynx(37,33),t.YNc(38,ou,2,0,"th",31),t.YNc(39,su,4,3,"td",20),t.BQk(),t.ynx(40,34),t.YNc(41,lu,6,0,"th",35),t.YNc(42,ru,3,0,"td",36),t.BQk(),t.ynx(43,37),t.YNc(44,mu,4,3,"td",38),t.BQk(),t.YNc(45,hu,1,3,"tr",39),t.YNc(46,_u,1,0,"tr",40),t.YNc(47,gu,1,0,"tr",41),t.qZA()()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("matSortActive",e.tableSetting.sortBy)("matSortDirection",e.tableSetting.sortOrder)("dataSource",e.forwardingHistoryEvents),t.xp6(43),t.Q6J("matFooterRowDef",t.DdM(7,fu)),t.xp6(1),t.Q6J("matHeaderRowDef",e.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",e.displayedColumns)}}function xu(n,a){if(1&n&&t._UZ(0,"mat-paginator",63),2&n){const e=t.oxw();t.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}let Dt=(()=>{class n{constructor(e,i,o,s,r){this.logger=e,this.commonService=i,this.store=o,this.datePipe=s,this.camelCaseWithSpaces=r,this.pageId="routing",this.tableId="forwarding_history",this.eventsData=[],this.selFilter="",this.nodePageDefs=l.Xk,this.selFilterBy="all",this.colWidth="20rem",this.tableSetting={tableId:"forwarding_history",recordsPerPage:l.IV,sortBy:"timestamp",sortOrder:l.Pi.DESCENDING},this.displayedColumns=[],this.forwardingHistoryEvents=new c.by([]),this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(C.nF).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{var i,o;this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting.tableId=this.tableId,this.tableSetting=(null===(i=e.pageSettings.find(s=>s.pageId===this.pageId))||void 0===i?void 0:i.tables.find(s=>s.tableId===this.tableSetting.tableId))||(null===(o=l.c3.find(s=>s.pageId===this.pageId))||void 0===o?void 0:o.tables.find(s=>s.tableId===this.tableSetting.tableId)),this.displayedColumns=this.screenSize===l.cu.XS||this.screenSize===l.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("type"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:l.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/14+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(C.PP).pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.eventsData=e.payments&&e.payments.relayed?e.payments.relayed:[],this.eventsData.length>0&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadForwardingEventsTable(this.eventsData),this.logger.info(this.eventsData)})}ngAfterViewInit(){setTimeout(()=>{this.eventsData.length>0&&this.loadForwardingEventsTable(this.eventsData)},0)}ngOnChanges(e){e.eventsData&&(this.apiCallStatus={status:l.Bn.COMPLETED,action:"FetchPayments"},this.eventsData=e.eventsData.currentValue,e.eventsData.firstChange||this.loadForwardingEventsTable(this.eventsData)),e.selFilter&&!e.selFilter.firstChange&&(this.selFilterBy="all",this.applyFilter())}onForwardingEventClick(e,i){const o=[[{key:"paymentHash",value:e.paymentHash,title:"Payment Hash",width:100,type:l.Gi.STRING}],[{key:"timestamp",value:Math.round((e.timestamp||0)/1e3),title:"Date/Time",width:50,type:l.Gi.DATE_TIME},{key:"fee",value:(e.amountIn||0)-(e.amountOut||0),title:"Fee Earned (Sats)",width:50,type:l.Gi.NUMBER}],[{key:"amountIn",value:e.amountIn,title:"Amount In (Sats)",width:50,type:l.Gi.NUMBER},{key:"amountOut",value:e.amountOut,title:"Amount Out (Sats)",width:50,type:l.Gi.NUMBER}],[{key:"fromChannelAlias",value:e.fromChannelAlias,title:"From Channel Alias",width:50,type:l.Gi.STRING},{key:"fromShortChannelId",value:e.fromShortChannelId,title:"From Short Channel ID",width:50,type:l.Gi.STRING}],[{key:"fromChannelId",value:e.fromChannelId,title:"From Channel ID",width:100,type:l.Gi.STRING}],[{key:"toChannelAlias",value:e.toChannelAlias,title:"To Channel Alias",width:50,type:l.Gi.STRING},{key:"toShortChannelId",value:e.toShortChannelId,title:"To Short Channel ID",width:50,type:l.Gi.STRING}],[{key:"toChannelId",value:e.toChannelId,title:"To Channel ID",width:100,type:l.Gi.STRING}]];"payment-relayed"!==e.type&&o?.unshift([{key:"type",value:this.commonService.camelCase(e.type),title:"Relay Type",width:100,type:l.Gi.STRING}]),this.store.dispatch((0,E.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:"Event Information",message:o}}}))}applyFilter(){this.forwardingHistoryEvents&&(this.forwardingHistoryEvents.filter=this.selFilter.trim().toLowerCase())}getLabel(e){const i=this.nodePageDefs[this.pageId][this.tableSetting.tableId].allowedColumns.find(o=>o.column===e);return i?i.label?i.label:this.camelCaseWithSpaces.transform(i.column):this.commonService.titleCase(e)}setFilterPredicate(){this.forwardingHistoryEvents.filterPredicate=(e,i)=>{var o,s;let r="";switch(this.selFilterBy){case"all":r=(e.timestamp?null===(o=this.datePipe.transform(new Date(e.timestamp),"dd/MMM/y HH:mm"))||void 0===o?void 0:o.toLowerCase():"")+JSON.stringify(e).toLowerCase();break;case"timestamp":r=(null===(s=this.datePipe.transform(new Date(e.timestamp||0),"dd/MMM/y HH:mm"))||void 0===s?void 0:s.toLowerCase())||"";break;case"fee":r=(e.amountIn-e.amountOut).toString()||"0";break;default:r=typeof e[this.selFilterBy]>"u"?"":"string"==typeof e[this.selFilterBy]?e[this.selFilterBy].toLowerCase():"boolean"==typeof e[this.selFilterBy]?e[this.selFilterBy]?"yes":"no":e[this.selFilterBy].toString()}return r.includes(i)}}loadForwardingEventsTable(e){this.forwardingHistoryEvents=new c.by([...e]),this.forwardingHistoryEvents.sort=this.sort,this.forwardingHistoryEvents.sortingDataAccessor=(i,o)=>"fee"===o?i.amountIn-i.amountOut:i[o]&&isNaN(i[o])?i[o].toLocaleLowerCase():i[o]?+i[o]:null,this.forwardingHistoryEvents.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter(),this.logger.info(this.forwardingHistoryEvents)}onDownloadCSV(){this.forwardingHistoryEvents&&this.forwardingHistoryEvents.data&&this.forwardingHistoryEvents.data.length>0&&this.commonService.downloadFile(this.forwardingHistoryEvents.data,"Forwarding-history")}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(R.mQ),t.Y36(k.v),t.Y36(I.yh),t.Y36(u.uU),t.Y36(G.i1))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-forwarding-history"]],viewQuery:function(e,i){if(1&e&&(t.Gf(S.YE,5),t.Gf(A.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.sort=o.first),t.iGM(o=t.CRH())&&(i.paginator=o.first)}},inputs:{pageId:"pageId",tableId:"tableId",eventsData:"eventsData",selFilter:"selFilter"},features:[t._Bn([{provide:w.PG,useValue:{overlayPanelClass:"rtl-select-overlay"}},{provide:A.ye,useValue:(0,l.pt)("Events")}]),t.TTD],decls:5,vars:4,consts:[["fxLayout","column","fxLayoutAlign","start stretch",1,"padding-gap-x"],["class","p-2 error-border my-2",4,"ngIf"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch","class","page-sub-title-container",4,"ngIf"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100","class","table-container",3,"perfectScrollbar",4,"ngIf"],["class","mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons",4,"ngIf"],[1,"p-2","error-border","my-2"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter",3,"ngModel","ngModelChange","input","keyup"],[3,"value"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",1,"overflow-auto",3,"matSortActive","matSortDirection","dataSource"],["table",""],["matColumnDef","type"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","Type (if not payment relayed)",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","timestamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","fromChannelId"],["matColumnDef","fromShortChannelId"],["matColumnDef","fromChannelAlias"],["matColumnDef","toChannelId"],["matColumnDef","toShortChannelId"],["matColumnDef","toChannelAlias"],["matColumnDef","paymentHash"],["matColumnDef","amountIn"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","amountOut"],["matColumnDef","fee"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_event"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","Type (if not payment relayed)"],["mat-cell",""],["class","dot yellow","matTooltipPosition","right",3,"matTooltip","ngClass",4,"ngIf"],["matTooltipPosition","right",1,"dot","yellow",3,"matTooltip","ngClass"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","4",1,"table-actions-button",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.YNc(1,Ic,2,1,"div",1),t.YNc(2,Nc,13,4,"div",2),t.YNc(3,Cu,48,8,"div",3),t.YNc(4,xu,1,3,"mat-paginator",4),t.qZA()),2&e&&(t.xp6(1),t.Q6J("ngIf",""!==i.errorMessage),t.xp6(1),t.Q6J("ngIf",""===i.errorMessage),t.xp6(1),t.Q6J("ngIf",""===i.errorMessage),t.xp6(1),t.Q6J("ngIf",""===i.errorMessage))},dependencies:[u.mk,u.sg,u.O5,u.PC,h.Fj,h.JJ,h.On,m.xw,m.Wh,m.yH,Z.oO,Z.Zl,F.lW,B.Nt,x.KE,x.hX,Q.pW,w.gD,w.$L,V.ey,S.YE,S.nU,c.BZ,c.fO,c.as,c.w1,c.Dz,c.nj,c.mD,c.Ke,c.ge,c.ev,c.yh,c.XQ,c.Gk,c.Q2,W.gM,A.NW,U.Vv,U.$V,u.JJ,u.uU,G.h9],styles:[".mat-column-type[_ngcontent-%COMP%]{max-width:2.2rem;width:2.2rem;text-overflow:unset}.mat-column-type[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{max-width:2.2rem;width:2.2rem;text-overflow:unset}"]}),n})();const yu=["tableIn"],vu=["tableOut"],Tu=["paginatorIn"],Lu=["paginatorOut"];function bu(n,a){if(1&n&&(t.TgZ(0,"div",3),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Oqu(e.errorMessage)}}function Su(n,a){1&n&&t._UZ(0,"mat-progress-bar",34)}function Zu(n,a){1&n&&(t.TgZ(0,"th",35),t._uU(1,"Channel ID"),t.qZA())}const at=function(n){return{width:n}};function Au(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"div",37)(2,"span",38),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,at,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.channelId)}}function Eu(n,a){1&n&&(t.TgZ(0,"th",35),t._uU(1,"Peer Alias"),t.qZA())}function wu(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"div",37)(2,"span",38),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,at,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.alias)}}function Iu(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Events"),t.qZA())}function Fu(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"span",40),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.events))}}function qu(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Amount (Sats)"),t.qZA())}function Nu(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"span",40),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.totalAmount))}}function Ou(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Fee (Sats)"),t.qZA())}function Pu(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"span",40),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.totalFee))}}function Uu(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No incoming routing peer available."),t.qZA())}function Ru(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting incoming routing peers..."),t.qZA())}function ku(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Oqu(e.errorMessage)}}function Du(n,a){if(1&n&&(t.TgZ(0,"td",41),t.YNc(1,Uu,2,0,"p",42),t.YNc(2,Ru,2,0,"p",42),t.YNc(3,ku,2,1,"p",42),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",(!(null!=e.routingPeersIncoming&&e.routingPeersIncoming.data)||(null==e.routingPeersIncoming||null==e.routingPeersIncoming.data?null:e.routingPeersIncoming.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.routingPeersIncoming&&e.routingPeersIncoming.data)||(null==e.routingPeersIncoming||null==e.routingPeersIncoming.data?null:e.routingPeersIncoming.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.routingPeersIncoming&&e.routingPeersIncoming.data)||(null==e.routingPeersIncoming||null==e.routingPeersIncoming.data?null:e.routingPeersIncoming.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const Jt=function(n){return{"display-none":n}};function Ju(n,a){if(1&n&&t._UZ(0,"tr",43),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,Jt,(null==e.routingPeersIncoming?null:e.routingPeersIncoming.data)&&(null==e.routingPeersIncoming||null==e.routingPeersIncoming.data?null:e.routingPeersIncoming.data.length)>0))}}function Mu(n,a){1&n&&t._UZ(0,"tr",44)}function Qu(n,a){1&n&&t._UZ(0,"tr",45)}function Yu(n,a){1&n&&t._UZ(0,"mat-progress-bar",34)}function Bu(n,a){1&n&&(t.TgZ(0,"th",35),t._uU(1,"Channel ID"),t.qZA())}function Hu(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"div",37)(2,"span",38),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,at,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.channelId)}}function zu(n,a){1&n&&(t.TgZ(0,"th",35),t._uU(1,"Peer Alias"),t.qZA())}function Vu(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"div",37)(2,"span",38),t._uU(3),t.qZA()()()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,at,i.screenSize===i.screenSizeEnum.XS?"6rem":i.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.alias)}}function Gu(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Events"),t.qZA())}function Ku(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"span",40),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.events))}}function Wu(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Amount (Sats)"),t.qZA())}function $u(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"span",40),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.totalAmount))}}function Xu(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Fee (Sats)"),t.qZA())}function ju(n,a){if(1&n&&(t.TgZ(0,"td",36)(1,"span",40),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.totalFee))}}function tp(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No outgoing routing peer available."),t.qZA())}function ep(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting outgoing routing peers..."),t.qZA())}function np(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Oqu(e.errorMessage)}}function ip(n,a){if(1&n&&(t.TgZ(0,"td",41),t.YNc(1,tp,2,0,"p",42),t.YNc(2,ep,2,0,"p",42),t.YNc(3,np,2,1,"p",42),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",(!(null!=e.routingPeersOutgoing&&e.routingPeersOutgoing.data)||(null==e.routingPeersOutgoing||null==e.routingPeersOutgoing.data?null:e.routingPeersOutgoing.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.routingPeersOutgoing&&e.routingPeersOutgoing.data)||(null==e.routingPeersOutgoing||null==e.routingPeersOutgoing.data?null:e.routingPeersOutgoing.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.routingPeersOutgoing&&e.routingPeersOutgoing.data)||(null==e.routingPeersOutgoing||null==e.routingPeersOutgoing.data?null:e.routingPeersOutgoing.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}function ap(n,a){if(1&n&&t._UZ(0,"tr",43),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,Jt,(null==e.routingPeersOutgoing?null:e.routingPeersOutgoing.data)&&(null==e.routingPeersOutgoing||null==e.routingPeersOutgoing.data?null:e.routingPeersOutgoing.data.length)>0))}}function op(n,a){1&n&&t._UZ(0,"tr",44)}function sp(n,a){1&n&&t._UZ(0,"tr",45)}const lp=function(n,a){return{"mt-2":n,"mt-1":a}},rp=function(){return["no_incoming_event"]},cp=function(n){return{"mt-2":n}},up=function(){return["no_outgoing_event"]};function pp(n,a){if(1&n&&(t.TgZ(0,"div",4)(1,"div",5)(2,"div",6)(3,"div",7),t._uU(4,"Incoming"),t.qZA(),t._UZ(5,"div",8),t.qZA(),t.TgZ(6,"div",9),t.YNc(7,Su,1,0,"mat-progress-bar",10),t.TgZ(8,"table",11,12),t.ynx(10,13),t.YNc(11,Zu,2,0,"th",14),t.YNc(12,Au,4,4,"td",15),t.BQk(),t.ynx(13,16),t.YNc(14,Eu,2,0,"th",14),t.YNc(15,wu,4,4,"td",15),t.BQk(),t.ynx(16,17),t.YNc(17,Iu,2,0,"th",18),t.YNc(18,Fu,4,3,"td",15),t.BQk(),t.ynx(19,19),t.YNc(20,qu,2,0,"th",18),t.YNc(21,Nu,4,3,"td",15),t.BQk(),t.ynx(22,20),t.YNc(23,Ou,2,0,"th",18),t.YNc(24,Pu,4,3,"td",15),t.BQk(),t.ynx(25,21),t.YNc(26,Du,4,3,"td",22),t.BQk(),t.YNc(27,Ju,1,3,"tr",23),t.YNc(28,Mu,1,0,"tr",24),t.YNc(29,Qu,1,0,"tr",25),t.qZA()(),t._UZ(30,"mat-paginator",26,27),t.qZA(),t.TgZ(32,"div",28)(33,"div",6)(34,"div",7),t._uU(35,"Outgoing"),t.qZA(),t._UZ(36,"div",8),t.qZA(),t.TgZ(37,"div",29),t.YNc(38,Yu,1,0,"mat-progress-bar",10),t.TgZ(39,"table",30,31),t.ynx(41,13),t.YNc(42,Bu,2,0,"th",14),t.YNc(43,Hu,4,4,"td",15),t.BQk(),t.ynx(44,16),t.YNc(45,zu,2,0,"th",14),t.YNc(46,Vu,4,4,"td",15),t.BQk(),t.ynx(47,17),t.YNc(48,Gu,2,0,"th",18),t.YNc(49,Ku,4,3,"td",15),t.BQk(),t.ynx(50,19),t.YNc(51,Wu,2,0,"th",18),t.YNc(52,$u,4,3,"td",15),t.BQk(),t.ynx(53,20),t.YNc(54,Xu,2,0,"th",18),t.YNc(55,ju,4,3,"td",15),t.BQk(),t.ynx(56,32),t.YNc(57,ip,4,3,"td",22),t.BQk(),t.YNc(58,ap,1,3,"tr",23),t.YNc(59,op,1,0,"tr",24),t.YNc(60,sp,1,0,"tr",25),t.qZA(),t._UZ(61,"mat-paginator",26,33),t.qZA()()()),2&n){const e=t.oxw();t.xp6(2),t.Q6J("ngClass",t.WLB(22,lp,e.screenSize===e.screenSizeEnum.XS,e.screenSize===e.screenSizeEnum.SM)),t.xp6(5),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("matSortActive",e.tableSetting.sortBy)("matSortDirection",e.tableSetting.sortOrder)("dataSource",e.routingPeersIncoming),t.xp6(19),t.Q6J("matFooterRowDef",t.DdM(25,rp)),t.xp6(1),t.Q6J("matHeaderRowDef",e.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",e.displayedColumns),t.xp6(1),t.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS),t.xp6(3),t.Q6J("ngClass",t.VKq(26,cp,e.screenSize!==e.screenSizeEnum.LG)),t.xp6(5),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("matSortActive",e.tableSetting.sortBy)("matSortDirection",e.tableSetting.sortOrder)("dataSource",e.routingPeersOutgoing),t.xp6(19),t.Q6J("matFooterRowDef",t.DdM(28,up)),t.xp6(1),t.Q6J("matHeaderRowDef",e.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",e.displayedColumns),t.xp6(1),t.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}let mp=(()=>{class n{constructor(e,i,o,s){this.logger=e,this.commonService=i,this.store=o,this.camelCaseWithSpaces=s,this.nodePageDefs=l.Xk,this.selFilterByIn="all",this.selFilterByOut="all",this.colWidth="20rem",this.PAGE_ID="routing",this.tableSetting={tableId:"routing_peers",recordsPerPage:l.IV,sortBy:"totalFee",sortOrder:l.Pi.DESCENDING},this.routingPeersData=[],this.displayedColumns=[],this.routingPeersIncoming=new c.by([]),this.routingPeersOutgoing=new c.by([]),this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.filterIn="",this.filterOut="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(C.nF).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{var i,o;this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=(null===(i=e.pageSettings.find(s=>s.pageId===this.PAGE_ID))||void 0===i?void 0:i.tables.find(s=>s.tableId===this.tableSetting.tableId))||(null===(o=l.c3.find(s=>s.pageId===this.PAGE_ID))||void 0===o?void 0:o.tables.find(s=>s.tableId===this.tableSetting.tableId)),this.displayedColumns=this.screenSize===l.cu.XS||this.screenSize===l.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:l.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/(2*this.displayedColumns.length)/14+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(C.PP).pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.routingPeersData=e.payments&&e.payments.relayed?e.payments.relayed:[],this.routingPeersData.length>0&&this.sortIn&&this.paginatorIn&&this.sortOut&&this.paginatorOut&&this.loadRoutingPeersTable(this.routingPeersData),this.logger.info(e)})}ngAfterViewInit(){this.routingPeersData.length>0&&this.sortIn&&this.paginatorIn&&this.sortOut&&this.paginatorOut&&this.loadRoutingPeersTable(this.routingPeersData)}applyFilterIncoming(){this.routingPeersIncoming.filter=this.filterIn.trim().toLowerCase()}applyFilterOutgoing(){this.routingPeersOutgoing.filter=this.filterOut.trim().toLowerCase()}getLabel(e){const i=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(o=>o.column===e);return i?i.label?i.label:this.camelCaseWithSpaces.transform(i.column,"_"):this.commonService.titleCase(e)}setFilterPredicate(){this.routingPeersIncoming.filterPredicate=(e,i)=>{let o="";return o="all"===this.selFilterByIn?JSON.stringify(e).toLowerCase():"string"==typeof e[this.selFilterByIn]?e[this.selFilterByIn].toLowerCase():"boolean"==typeof e[this.selFilterByIn]?e[this.selFilterByIn]?"yes":"no":e[this.selFilterByIn].toString(),o.includes(i)},this.routingPeersOutgoing.filterPredicate=(e,i)=>{var o;let s="";switch(this.selFilterByOut){case"all":s=JSON.stringify(e).toLowerCase();break;case"total_amount":case"total_fee":s=(null===(o=+(e[this.selFilterByOut]||0)/1e3)||void 0===o?void 0:o.toString())||"";break;default:s="string"==typeof e[this.selFilterByOut]?e[this.selFilterByOut].toLowerCase():"boolean"==typeof e[this.selFilterByOut]?e[this.selFilterByOut]?"yes":"no":e[this.selFilterByOut].toString()}return s.includes(i)}}loadRoutingPeersTable(e){if(e.length>0){const i=this.groupRoutingPeers(e);this.routingPeersIncoming=new c.by(i[0]),this.routingPeersIncoming.sort=this.sortIn,this.routingPeersIncoming.paginator=this.paginatorIn,this.logger.info(this.routingPeersIncoming),this.routingPeersOutgoing=new c.by(i[1]),this.routingPeersOutgoing.sort=this.sortOut,this.routingPeersOutgoing.paginator=this.paginatorOut,this.logger.info(this.routingPeersOutgoing)}else this.routingPeersIncoming=new c.by([]),this.routingPeersOutgoing=new c.by([]);this.setFilterPredicate(),this.applyFilterIncoming(),this.applyFilterOutgoing()}groupRoutingPeers(e){const i=[],o=[];return e.forEach(s=>{const r=i.find(g=>g.channelId===s.fromChannelId),d=o.find(g=>g.channelId===s.toChannelId);r?(r.events++,r.totalAmount=+r.totalAmount+ +s.amountIn,r.totalFee=s.amountIn-s.amountOut+ +r.totalFee):i.push({channelId:s.fromChannelId,alias:s.fromChannelAlias,events:1,totalAmount:+s.amountIn,totalFee:s.amountIn-s.amountOut}),d?(d.events++,d.totalAmount=+d.totalAmount+ +s.amountOut,d.totalFee=s.amountIn-s.amountOut+ +d.totalFee):o.push({channelId:s.toChannelId,alias:s.toChannelAlias,events:1,totalAmount:+s.amountOut,totalFee:s.amountIn-s.amountOut})}),[this.commonService.sortDescByKey(i,"totalFee"),this.commonService.sortDescByKey(o,"totalFee")]}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(R.mQ),t.Y36(k.v),t.Y36(I.yh),t.Y36(G.i1))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-routing-peers"]],viewQuery:function(e,i){if(1&e&&(t.Gf(yu,5,S.YE),t.Gf(vu,5,S.YE),t.Gf(Tu,5),t.Gf(Lu,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.sortIn=o.first),t.iGM(o=t.CRH())&&(i.sortOut=o.first),t.iGM(o=t.CRH())&&(i.paginatorIn=o.first),t.iGM(o=t.CRH())&&(i.paginatorOut=o.first)}},features:[t._Bn([{provide:A.ye,useValue:(0,l.pt)("Peers")}])],decls:3,vars:2,consts:[["fxLayout","column","fxLayoutAlign","start stretch",1,"padding-gap"],["class","p-2 error-border my-2",4,"ngIf"],["fxLayout","column","fxLayout.gt-md","row","fxFlex","100","fxLayoutAlign","space-between stretch","class","page-sub-title-container mt-2",4,"ngIf"],[1,"p-2","error-border","my-2"],["fxLayout","column","fxLayout.gt-md","row","fxFlex","100","fxLayoutAlign","space-between stretch",1,"page-sub-title-container","mt-2"],["fxLayout","column","fxFlex","49","fxLayoutAlign","start stretch",1,"mb-4"],["fxLayout","column","fxLayout.gt-sm","row","fxLayoutAlign.gt-sm","space-between center","fxLayoutAlign","start stretch",1,"page-sub-title-container","w-100",3,"ngClass"],["fxFlex","70"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxLayoutAlign","start start","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","matSort","",1,"overflow-auto","incoming-table",3,"matSortActive","matSortDirection","dataSource"],["tableIn",""],["matColumnDef","channelId"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","alias"],["matColumnDef","events"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","totalAmount"],["matColumnDef","totalFee"],["matColumnDef","no_incoming_event"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["paginatorIn",""],["fxLayout","column","fxFlex","49","fxLayoutAlign","end stretch",1,"mb-4"],["fxLayout","column","fxLayoutAlign","start end","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mat-table","","matSort","",1,"overflow-auto","outgoing-table",3,"matSortActive","matSortDirection","dataSource"],["tableOut",""],["matColumnDef","no_outgoing_event"],["paginatorOut",""],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.YNc(1,bu,2,1,"div",1),t.YNc(2,pp,63,29,"div",2),t.qZA()),2&e&&(t.xp6(1),t.Q6J("ngIf",""!==i.errorMessage),t.xp6(1),t.Q6J("ngIf",""===i.errorMessage))},dependencies:[u.mk,u.O5,u.PC,m.xw,m.Wh,m.yH,Z.oO,Z.Zl,Q.pW,S.YE,S.nU,c.BZ,c.fO,c.as,c.w1,c.Dz,c.nj,c.mD,c.Ke,c.ge,c.ev,c.yh,c.XQ,c.Gk,c.Q2,A.NW,U.$V,u.JJ]}),n})();function dp(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",8),t.NdJ("click",function(){const s=t.CHM(e).$implicit,r=t.oxw();return t.KtG(r.activeLink=s.link)}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit,i=t.oxw();t.s9C("routerLink",e.link),t.Q6J("active",i.activeLink===e.link),t.xp6(1),t.Oqu(e.name)}}let hp=(()=>{class n{constructor(e){this.router=e,this.faChartBar=T.koM,this.links=[{link:"routingreport",name:"Routing"},{link:"transactions",name:"Transactions"}],this.activeLink=this.links[0].link,this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){const e=this.links.find(i=>this.router.url.includes(i.link));this.activeLink=e?e.link:this.links[0].link,this.router.events.pipe((0,_.R)(this.unSubs[0]),(0,Y.h)(i=>i instanceof y.Av)).subscribe({next:i=>{const o=this.links.find(s=>i.urlAfterRedirects.includes(s.link));this.activeLink=o?o.link:this.links[0].link}})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(y.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-reports"]],decls:12,vars:3,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","","mat-stretch-tabs","false","mat-align-tabs","start",3,"tabPanel"],["mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["tabPanel",""],["mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(e,i){if(1&e&&(t.TgZ(0,"div",0),t._UZ(1,"fa-icon",1),t.TgZ(2,"span",2),t._uU(3,"Reports"),t.qZA()(),t.TgZ(4,"div",3)(5,"mat-card")(6,"mat-card-content",4)(7,"nav",5),t.YNc(8,dp,2,3,"div",6),t.qZA(),t._UZ(9,"mat-tab-nav-panel",null,7)(11,"router-outlet"),t.qZA()()()),2&e){const o=t.MAs(10);t.xp6(1),t.Q6J("icon",i.faChartBar),t.xp6(6),t.Q6J("tabPanel",o),t.xp6(1),t.Q6J("ngForOf",i.links)}},dependencies:[u.sg,P.BN,m.xw,m.Wh,b.a8,b.dn,q.BU,q.sW,q.Nj,y.lC,y.rH]}),n})();var Mt=f(7772),Qt=f(2213),Yt=f(7671);function _p(n,a){if(1&n&&(t.TgZ(0,"div",13),t._uU(1),t.ALo(2,"number"),t.ALo(3,"number"),t.qZA()),2&n){const e=t.oxw();t.Q6J("@fadeIn",e.totalFeeSat),t.xp6(1),t.AsE("",t.xi3(2,3,e.totalFeeSat||0,"1.0-2")," Sats/",t.lcZ(3,6,e.filteredEventsBySelectedPeriod.length||0)," Events")}}function gp(n,a){1&n&&(t.TgZ(0,"div",14),t._uU(1,"No routing report for the selected period"),t.qZA())}function fp(n,a){if(1&n&&(t.TgZ(0,"span")(1,"span",17),t._uU(2),t.ALo(3,"number"),t.qZA(),t.TgZ(4,"span",17),t._uU(5),t.ALo(6,"number"),t.qZA()()),2&n){const e=a.model,i=t.oxw(2);t.xp6(2),t.hij("Events: ",t.lcZ(3,2,(i.selReportBy===i.reportBy.EVENTS?e.value:e.extra.totalEvents)||0),""),t.xp6(3),t.hij("Fee: ",t.xi3(6,4,(i.selReportBy===i.reportBy.EVENTS?e.extra.totalFees:e.value)||0,"1.0-2"),"")}}function Cp(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"ngx-charts-bar-vertical",15),t.NdJ("select",function(o){t.CHM(e);const s=t.oxw();return t.KtG(s.onChartBarSelected(o))})("mouseup",function(o){t.CHM(e);const s=t.oxw();return t.KtG(s.onChartMouseUp(o))}),t.YNc(1,fp,7,7,"ng-template",null,16,t.W1O),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("view",e.view)("results",e.routingReportData)("gradient",!1)("xAxis",!0)("yAxis",!0)("showXAxisLabel",!0)("showYAxisLabel",e.showYAxisLabel)("xAxisLabel",e.xAxisLabel)("yAxisLabel",e.yAxisLabel)("showGridLines",!1)("showDataLabel",!1)}}function xp(n,a){if(1&n&&t._UZ(0,"rtl-ecl-forwarding-history",18),2&n){const e=t.oxw();t.Q6J("pageId","reports")("tableId","routing")("eventsData",e.filteredEventsBySelectedPeriod)("selFilter",e.eventFilterValue)}}let yp=(()=>{class n{constructor(e,i,o){this.logger=e,this.commonService=i,this.store=o,this.reportPeriod=l.op[0],this.secondsInADay=86400,this.events=[],this.filteredEventsBySelectedPeriod=[],this.eventFilterValue="",this.reportBy=l.Xr,this.selReportBy=l.Xr.FEES,this.totalFeeSat=null,this.today=new Date(Date.now()),this.startDate=new Date(this.today.getFullYear(),this.today.getMonth(),1,0,0,0),this.endDate=new Date(this.today.getFullYear(),this.today.getMonth(),this.getMonthDays(this.today.getMonth(),this.today.getFullYear()),23,59,59),this.routingReportData=[],this.view=[350,350],this.screenPaddingX=100,this.gradient=!0,this.xAxisLabel="Date",this.yAxisLabel="Fee (Sats)",this.showYAxisLabel=!0,this.screenSize="",this.screenSizeEnum=l.cu,this.unSubs=[new p.x,new p.x]}ngOnInit(){this.screenSize=this.commonService.getScreenSize(),this.showYAxisLabel=!(this.screenSize===l.cu.XS||this.screenSize===l.cu.SM),this.store.select(C.PP).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{this.events=e.payments&&e.payments.relayed?e.payments.relayed:[],this.filterForwardingEvents(this.startDate,this.endDate),this.logger.info(e)}),this.commonService.containerSizeUpdated.pipe((0,_.R)(this.unSubs[1])).subscribe(e=>{switch(this.screenSize){case l.cu.MD:this.screenPaddingX=e.width/10;break;case l.cu.LG:this.screenPaddingX=e.width/16;break;default:this.screenPaddingX=e.width/20}this.view=[e.width-this.screenPaddingX,e.height/2.2],this.logger.info("Container Size: "+JSON.stringify(e)),this.logger.info("View: "+JSON.stringify(this.view))})}filterForwardingEvents(e,i){const o=Math.round(e.getTime()/1e3),s=Math.round(i.getTime()/1e3);this.logger.info("Filtering Forwarding Events Starting at "+new Date(Date.now()).toLocaleString()+" From "+e.toLocaleString()+" To "+i.toLocaleString()),this.filteredEventsBySelectedPeriod=[],this.routingReportData=[],this.totalFeeSat=null,this.events&&this.events.length>0&&(this.events.forEach(r=>{Math.floor((r.timestamp||0)/1e3)>=o&&Math.floor((r.timestamp||0)/1e3)<s&&this.filteredEventsBySelectedPeriod.push(r)}),this.routingReportData=this.selReportBy===this.reportBy.EVENTS?this.prepareEventsReport(e):this.prepareFeeReport(e)),this.logger.info("Filtering Forwarding Events Finished at "+new Date(Date.now()).toLocaleString())}onChartMouseUp(e){"svg"===e.srcElement.tagName&&e.srcElement.classList.length>0&&"ngx-charts"===e.srcElement.classList[0]&&(this.eventFilterValue="")}onChartBarSelected(e){this.eventFilterValue=this.reportPeriod===l.op[1]?e.name+"/"+this.startDate.getFullYear():e.name.toString().padStart(2,"0")+"/"+l.gg[this.startDate.getMonth()].name+"/"+this.startDate.getFullYear()}prepareFeeReport(e){var i,o;const s=Math.round(e.getTime()/1e3),r=[];if(this.totalFeeSat=0,this.logger.info("Fee Report Prepare Starting at "+new Date(Date.now()).toLocaleString()+" From "+e.toLocaleString()),this.reportPeriod===l.op[1]){for(let d=0;d<12;d++)r.push({name:l.gg[d].name,value:0,extra:{totalEvents:0}});null===(i=this.filteredEventsBySelectedPeriod)||void 0===i||i.map(d=>{const g=new Date(d.timestamp||0).getMonth();return r[g].value=r[g].value+((d.amountIn||0)-(d.amountOut||0)),r[g].extra.totalEvents=r[g].extra.totalEvents+1,this.totalFeeSat=(this.totalFeeSat?this.totalFeeSat:0)+((d.amountIn||0)-(d.amountOut||0)),this.filteredEventsBySelectedPeriod})}else{for(let d=0;d<this.getMonthDays(e.getMonth(),e.getFullYear());d++)r.push({name:d+1,value:0,extra:{totalEvents:0}});null===(o=this.filteredEventsBySelectedPeriod)||void 0===o||o.map(d=>{const g=Math.floor((Math.floor((d.timestamp||0)/1e3)-s)/this.secondsInADay);return r[g].value=r[g].value+((d.amountIn||0)-(d.amountOut||0)),r[g].extra.totalEvents=r[g].extra.totalEvents+1,this.totalFeeSat=(this.totalFeeSat?this.totalFeeSat:0)+((d.amountIn||0)-(d.amountOut||0)),this.filteredEventsBySelectedPeriod})}return this.logger.info("Fee Report Prepare Finished at "+new Date(Date.now()).toLocaleString()),r}prepareEventsReport(e){var i,o;const s=Math.round(e.getTime()/1e3),r=[];if(this.totalFeeSat=0,this.logger.info("Events Report Prepare Starting at "+new Date(Date.now()).toLocaleString()+" From "+e.toLocaleString()),this.reportPeriod===l.op[1]){for(let d=0;d<12;d++)r.push({name:l.gg[d].name,value:0,extra:{totalFees:0}});null===(i=this.filteredEventsBySelectedPeriod)||void 0===i||i.map(d=>{const g=new Date(d.timestamp||0).getMonth();return r[g].value=r[g].value+1,r[g].extra.totalFees=r[g].extra.totalFees+((d.amountIn||0)-(d.amountOut||0)),this.totalFeeSat=(this.totalFeeSat?this.totalFeeSat:0)+((d.amountIn||0)-(d.amountOut||0)),this.filteredEventsBySelectedPeriod})}else{for(let d=0;d<this.getMonthDays(e.getMonth(),e.getFullYear());d++)r.push({name:d+1,value:0,extra:{totalFees:0}});null===(o=this.filteredEventsBySelectedPeriod)||void 0===o||o.map(d=>{const g=Math.floor((Math.floor((d.timestamp||0)/1e3)-s)/this.secondsInADay);return r[g].value=r[g].value+1,r[g].extra.totalFees=r[g].extra.totalFees+((d.amountIn||0)-(d.amountOut||0)),this.totalFeeSat=(this.totalFeeSat?this.totalFeeSat:0)+((d.amountIn||0)-(d.amountOut||0)),this.filteredEventsBySelectedPeriod})}return this.logger.info("Events Report Prepare Finished at "+new Date(Date.now()).toLocaleString()),r}onSelectionChange(e){const i=e.selDate.getMonth(),o=e.selDate.getFullYear();this.reportPeriod=e.selScrollRange,this.reportPeriod===l.op[1]?(this.startDate=new Date(o,0,1,0,0,0),this.endDate=new Date(o,11,31,23,59,59)):(this.startDate=new Date(o,i,1,0,0,0),this.endDate=new Date(o,i,this.getMonthDays(i,o),23,59,59)),this.filterForwardingEvents(this.startDate,this.endDate),this.eventFilterValue=""}getMonthDays(e,i){return 1===e&&i%4==0?l.gg[e].days+1:l.gg[e].days}onSelReportByChange(){this.yAxisLabel=this.selReportBy===this.reportBy.EVENTS?"Events":"Fee (Sats)",this.routingReportData=this.selReportBy===this.reportBy.EVENTS?this.prepareEventsReport(this.startDate):this.prepareFeeReport(this.startDate)}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(R.mQ),t.Y36(k.v),t.Y36(I.yh))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-routing-report"]],hostBindings:function(e,i){1&e&&t.NdJ("mouseup",function(s){return i.onChartMouseUp(s)})},decls:17,vars:7,consts:[["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"padding-gap-x-large"],[3,"stepChanged"],["fxLayout","column","fxLayoutAlign","center center",1,"padding-gap-x"],["color","primary","name","selReportBy","fxFlex","100","fxLayoutAlign","start center",1,"my-1",3,"ngModel","ngModelChange","change"],[1,"mr-2"],["tabindex","1",1,"mr-2",3,"value"],["tabindex","2",3,"value"],["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"padding-gap-x"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100","class","font-size-120 font-bold-700 mt-1",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100","class","font-size-120 mt-1",4,"ngIf"],[1,"mt-1"],["class","one-color",3,"view","results","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","select","mouseup",4,"ngIf"],[3,"pageId","tableId","eventsData","selFilter",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","font-bold-700","mt-1"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","mt-1"],[1,"one-color",3,"view","results","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","select","mouseup"],["tooltipTemplate",""],[1,"tooltip-label"],[3,"pageId","tableId","eventsData","selFilter"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"rtl-horizontal-scroller",1),t.NdJ("stepChanged",function(s){return i.onSelectionChange(s)}),t.qZA(),t.TgZ(2,"div",2)(3,"mat-radio-group",3),t.NdJ("ngModelChange",function(s){return i.selReportBy=s})("change",function(){return i.onSelReportByChange()}),t.TgZ(4,"span",4),t._uU(5,"Report By: "),t.qZA(),t.TgZ(6,"mat-radio-button",5),t._uU(7,"Fees"),t.qZA(),t.TgZ(8,"mat-radio-button",6),t._uU(9,"Events"),t.qZA()()(),t.TgZ(10,"div",7),t.YNc(11,_p,4,8,"div",8),t.YNc(12,gp,2,0,"div",9),t.TgZ(13,"div",10),t.YNc(14,Cp,3,11,"ngx-charts-bar-vertical",11),t.qZA(),t.TgZ(15,"div",10),t.YNc(16,xp,1,4,"rtl-ecl-forwarding-history",12),t.qZA()()()),2&e&&(t.xp6(3),t.Q6J("ngModel",i.selReportBy),t.xp6(3),t.s9C("value",i.reportBy.FEES),t.xp6(2),t.s9C("value",i.reportBy.EVENTS),t.xp6(3),t.Q6J("ngIf",i.routingReportData.length>0&&i.filteredEventsBySelectedPeriod.length>0),t.xp6(1),t.Q6J("ngIf",i.routingReportData.length<=0||i.filteredEventsBySelectedPeriod.length<=0),t.xp6(2),t.Q6J("ngIf",i.routingReportData.length>0&&i.filteredEventsBySelectedPeriod.length>0),t.xp6(2),t.Q6J("ngIf",i.filteredEventsBySelectedPeriod.length>0))},dependencies:[u.O5,h.JJ,h.On,m.xw,m.Wh,m.yH,it.VQ,it.U0,Qt.K$,Yt.D,Dt,u.JJ],data:{animation:[Mt.J]}}),n})();var vp=f(165);function Tp(n,a){if(1&n&&(t.TgZ(0,"div",10),t._uU(1),t.ALo(2,"number"),t.ALo(3,"number"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.AsE(" Paid ",t.xi3(2,2,e.transactionsReportSummary.amountPaidSelectedPeriod||0,"1.0-2")," Sats/",t.lcZ(3,5,e.transactionsReportSummary.paymentsSelectedPeriod)," Payments ")}}function Lp(n,a){if(1&n&&(t.TgZ(0,"div",10),t._uU(1),t.ALo(2,"number"),t.ALo(3,"number"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.AsE(" Received ",t.xi3(2,2,e.transactionsReportSummary.amountReceivedSelectedPeriod||0,"1.0-2")," Sats/",t.lcZ(3,5,e.transactionsReportSummary.invoicesSelectedPeriod)," Invoices ")}}function bp(n,a){if(1&n&&(t.TgZ(0,"div",8),t.YNc(1,Tp,4,7,"div",9),t.YNc(2,Lp,4,7,"div",9),t.qZA()),2&n){const e=t.oxw();t.Q6J("@fadeIn",e.transactionsReportSummary),t.xp6(1),t.Q6J("ngIf",e.transactionsReportSummary.paymentsSelectedPeriod),t.xp6(1),t.Q6J("ngIf",e.transactionsReportSummary.invoicesSelectedPeriod)}}function Sp(n,a){1&n&&(t.TgZ(0,"div",11),t._uU(1,"No transactions report for the selected period"),t.qZA())}function Zp(n,a){if(1&n&&(t.TgZ(0,"span",14),t._uU(1),t.ALo(2,"number"),t.ALo(3,"number"),t.qZA()),2&n){const e=a.model;t.xp6(1),t.HOy("",e.name,": ",t.xi3(2,4,e.value||0,"1.0-2"),"/# ","Paid"===e.name?"Payments":"Invoices",": ",t.lcZ(3,7,(null==e.extra?null:e.extra.total)||0),"")}}function Ap(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"ngx-charts-bar-vertical-2d",12),t.NdJ("select",function(o){t.CHM(e);const s=t.oxw();return t.KtG(s.onChartBarSelected(o))})("mouseup",function(o){t.CHM(e);const s=t.oxw();return t.KtG(s.onChartMouseUp(o))}),t.YNc(1,Zp,4,9,"ng-template",null,13,t.W1O),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("view",e.view)("results",e.transactionsReportData)("noBarWhenZero",!1)("gradient",!1)("xAxis",!0)("yAxis",!0)("showXAxisLabel",!0)("showYAxisLabel",e.showYAxisLabel)("xAxisLabel",e.xAxisLabel)("yAxisLabel",e.yAxisLabel)("showGridLines",!1)("showDataLabel",!1)("groupPadding",e.reportPeriod===e.scrollRanges[0]?2:8)}}function Ep(n,a){if(1&n&&t._UZ(0,"rtl-transactions-report-table",15),2&n){const e=t.oxw();t.Q6J("displayedColumns",e.displayedColumns)("tableSetting",e.tableSetting)("dataList",e.transactionsNonZeroReportData)("dataRange",e.reportPeriod)("selFilter",e.transactionFilterValue)}}let wp=(()=>{class n{constructor(e,i,o){this.logger=e,this.commonService=i,this.store=o,this.scrollRanges=l.op,this.reportPeriod=l.op[0],this.secondsInADay=86400,this.payments=[],this.invoices=[],this.colWidth="20rem",this.PAGE_ID="reports",this.tableSetting={tableId:"transactions",recordsPerPage:l.IV,sortBy:"date",sortOrder:l.Pi.DESCENDING},this.displayedColumns=["date","amount_paid","num_payments","amount_received","num_invoices"],this.transactionsReportSummary={paymentsSelectedPeriod:0,invoicesSelectedPeriod:0,amountPaidSelectedPeriod:0,amountReceivedSelectedPeriod:0},this.transactionFilterValue="",this.today=new Date(Date.now()),this.startDate=new Date(this.today.getFullYear(),this.today.getMonth(),1,0,0,0),this.endDate=new Date(this.today.getFullYear(),this.today.getMonth(),this.getMonthDays(this.today.getMonth(),this.today.getFullYear()),23,59,59),this.transactionsReportData=[],this.transactionsNonZeroReportData=[],this.view=[350,350],this.screenPaddingX=100,this.gradient=!0,this.xAxisLabel="Date",this.yAxisLabel="Amount (Sats)",this.showYAxisLabel=!0,this.screenSize="",this.screenSizeEnum=l.cu,this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.screenSize=this.commonService.getScreenSize(),this.showYAxisLabel=!(this.screenSize===l.cu.XS||this.screenSize===l.cu.SM),this.store.select(C.nF).pipe((0,_.R)(this.unSubs[0])).subscribe(e=>{var i,o;this.tableSetting=(null===(i=e.pageSettings.find(s=>s.pageId===this.PAGE_ID))||void 0===i?void 0:i.tables.find(s=>s.tableId===this.tableSetting.tableId))||(null===(o=l.c3.find(s=>s.pageId===this.PAGE_ID))||void 0===o?void 0:o.tables.find(s=>s.tableId===this.tableSetting.tableId)),this.displayedColumns=this.screenSize===l.cu.XS||this.screenSize===l.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.push("actions"),this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/14+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(C.PP).pipe((0,_.R)(this.unSubs[1]),(0,ot.M)(this.store.select(C.Ef))).subscribe(([e,i])=>{this.payments=e.payments.sent?e.payments.sent:[],this.invoices=i.invoices?i.invoices:[],(this.payments.length>0||this.invoices.length>0)&&(this.transactionsReportData=this.filterTransactionsForSelectedPeriod(this.startDate,this.endDate),this.transactionsNonZeroReportData=this.prepareTableData())}),this.commonService.containerSizeUpdated.pipe((0,_.R)(this.unSubs[2])).subscribe(e=>{switch(this.screenSize){case l.cu.MD:this.screenPaddingX=e.width/10;break;case l.cu.LG:this.screenPaddingX=e.width/16;break;default:this.screenPaddingX=e.width/20}this.view=[e.width-this.screenPaddingX,e.height/2.2],this.logger.info("Container Size: "+JSON.stringify(e)),this.logger.info("View: "+JSON.stringify(this.view))})}onChartMouseUp(e){"svg"===e.srcElement.tagName&&e.srcElement.classList.length>0&&"ngx-charts"===e.srcElement.classList[0]&&(this.transactionFilterValue="")}onChartBarSelected(e){this.transactionFilterValue=this.reportPeriod===l.op[1]?e.series.toString()+"/"+this.startDate.getFullYear():e.series.toString().padStart(2,"0")+"/"+l.gg[this.startDate.getMonth()].name+"/"+this.startDate.getFullYear()}filterTransactionsForSelectedPeriod(e,i){var o,s;const r=Math.round(e.getTime()/1e3),d=Math.round(i.getTime()/1e3),g=[];this.transactionsReportSummary={paymentsSelectedPeriod:0,invoicesSelectedPeriod:0,amountPaidSelectedPeriod:0,amountReceivedSelectedPeriod:0};const L=null===(o=this.payments)||void 0===o?void 0:o.filter(v=>v.firstPartTimestamp&&Math.floor(v.firstPartTimestamp/1e3)>=r&&Math.floor(v.firstPartTimestamp/1e3)<d),H=null===(s=this.invoices)||void 0===s?void 0:s.filter(v=>"received"===v.status&&v.timestamp&&v.timestamp>=r&&v.timestamp<d);if(this.transactionsReportSummary.paymentsSelectedPeriod=L.length,this.transactionsReportSummary.invoicesSelectedPeriod=H.length,this.reportPeriod===l.op[1]){for(let v=0;v<12;v++)g.push({name:l.gg[v].name,date:new Date(e.getFullYear(),v,1,0,0,0,0),series:[{name:"Paid",value:0,extra:{total:0}},{name:"Received",value:0,extra:{total:0}}]});L?.map(v=>{const O=new Date(v.firstPartTimestamp||0).getMonth();return this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+(v.recipientAmount||0),g[O].series[0].value=g[O].series[0].value+v.recipientAmount,g[O].series[0].extra.total=g[O].series[0].extra.total+1,this.transactionsReportSummary}),H?.map(v=>{const O=new Date(1e3*(v.timestamp||0)).getMonth();return this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+(v.amountSettled||0),g[O].series[1].value=g[O].series[1].value+v.amountSettled,g[O].series[1].extra.total=g[O].series[1].extra.total+1,this.transactionsReportSummary})}else{for(let v=0;v<this.getMonthDays(e.getMonth(),e.getFullYear());v++)g.push({name:(v+1).toString(),date:new Date(1e3*(v*this.secondsInADay+r)),series:[{name:"Paid",value:0,extra:{total:0}},{name:"Received",value:0,extra:{total:0}}]});L?.map(v=>{const O=Math.floor((Math.floor((v.firstPartTimestamp||0)/1e3)-r)/this.secondsInADay);return this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+(v.recipientAmount||0),g[O].series[0].value=g[O].series[0].value+v.recipientAmount,g[O].series[0].extra.total=g[O].series[0].extra.total+1,this.transactionsReportSummary}),H?.map(v=>{const O=Math.floor(((v.timestamp||0)-r)/this.secondsInADay);return this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+(v.amountSettled||0),g[O].series[1].value=g[O].series[1].value+v.amountSettled,g[O].series[1].extra.total=g[O].series[1].extra.total+1,this.transactionsReportSummary})}return g}prepareTableData(){var e;return null===(e=this.transactionsReportData)||void 0===e?void 0:e.reduce((i,o)=>o.series[0].extra.total>0||o.series[1].extra.total>0?i.concat({date:o.date,amount_paid:o.series[0].value,num_payments:o.series[0].extra.total,amount_received:o.series[1].value,num_invoices:o.series[1].extra.total}):i,[])}onSelectionChange(e){const i=e.selDate.getMonth(),o=e.selDate.getFullYear();this.reportPeriod=e.selScrollRange,this.reportPeriod===l.op[1]?(this.startDate=new Date(o,0,1,0,0,0),this.endDate=new Date(o,11,31,23,59,59)):(this.startDate=new Date(o,i,1,0,0,0),this.endDate=new Date(o,i,this.getMonthDays(i,o),23,59,59)),this.transactionsReportData=this.filterTransactionsForSelectedPeriod(this.startDate,this.endDate),this.transactionsNonZeroReportData=this.prepareTableData(),this.transactionFilterValue=""}getMonthDays(e,i){return 1===e&&i%4==0?l.gg[e].days+1:l.gg[e].days}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(R.mQ),t.Y36(k.v),t.Y36(I.yh))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-transactions-report"]],hostBindings:function(e,i){1&e&&t.NdJ("mouseup",function(s){return i.onChartMouseUp(s)})},decls:9,vars:4,consts:[["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"padding-gap-x-large"],[3,"stepChanged"],["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"padding-gap-x"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100","class","font-size-120 font-bold-700 mt-1",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100","class","font-size-120 mt-1",4,"ngIf"],[1,"mt-1"],["class","two-color",3,"view","results","noBarWhenZero","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","groupPadding","select","mouseup",4,"ngIf"],[3,"displayedColumns","tableSetting","dataList","dataRange","selFilter",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","font-bold-700","mt-1"],["fxLayout","row","fxLayoutAlign","start stretch","fxFlex","100",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start stretch","fxFlex","100"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","mt-1"],[1,"two-color",3,"view","results","noBarWhenZero","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","groupPadding","select","mouseup"],["tooltipTemplate",""],[1,"tooltip-label"],[3,"displayedColumns","tableSetting","dataList","dataRange","selFilter"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0)(1,"rtl-horizontal-scroller",1),t.NdJ("stepChanged",function(s){return i.onSelectionChange(s)}),t.qZA(),t.TgZ(2,"div",2),t.YNc(3,bp,3,3,"div",3),t.YNc(4,Sp,2,0,"div",4),t.TgZ(5,"div",5),t.YNc(6,Ap,3,13,"ngx-charts-bar-vertical-2d",6),t.qZA(),t.TgZ(7,"div",5),t.YNc(8,Ep,1,5,"rtl-transactions-report-table",7),t.qZA()()()),2&e&&(t.xp6(3),t.Q6J("ngIf",i.transactionsNonZeroReportData.length>0),t.xp6(1),t.Q6J("ngIf",i.transactionsNonZeroReportData.length<=0),t.xp6(2),t.Q6J("ngIf",i.transactionsNonZeroReportData.length>0),t.xp6(2),t.Q6J("ngIf",i.transactionsNonZeroReportData.length>0))},dependencies:[u.O5,m.xw,m.Wh,m.yH,Qt.H5,Yt.D,vp.g,u.JJ],data:{animation:[Mt.J]}}),n})();var N=f(1643),Ip=f(9442);function Fp(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",9),t.NdJ("click",function(){const s=t.CHM(e).$implicit,r=t.oxw();return t.KtG(r.activeLink=s.link)}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit,i=t.oxw();t.s9C("routerLink",e.link),t.Q6J("active",i.activeLink===e.link),t.xp6(1),t.Oqu(e.name)}}const Op=y.Bz.forChild([{path:"",component:Ct,children:[{path:"",pathMatch:"full",redirectTo:"home"},{path:"home",component:fa,canActivate:[N.fY]},{path:"onchain",component:oo,canActivate:[N.fY],children:[{path:"",pathMatch:"full",redirectTo:"receive"},{path:"receive",component:Po,canActivate:[N.fY]},{path:"send",component:Uo,canActivate:[N.fY]}]},{path:"connections",component:ro,canActivate:[N.fY],children:[{path:"",pathMatch:"full",redirectTo:"channels"},{path:"channels",component:ts,canActivate:[N.fY],children:[{path:"",pathMatch:"full",redirectTo:"open"},{path:"open",component:el,canActivate:[N.fY]},{path:"pending",component:Dl,canActivate:[N.fY]},{path:"inactive",component:wc,canActivate:[N.fY]}]},{path:"peers",component:Zr,data:{sweepAll:!1},canActivate:[N.fY]}]},{path:"transactions",component:uo,canActivate:[N.fY],children:[{path:"",pathMatch:"full",redirectTo:"payments"},{path:"payments",component:bt,canActivate:[N.fY]},{path:"invoices",component:St,canActivate:[N.fY]}]},{path:"routing",component:mo,canActivate:[N.fY],children:[{path:"",pathMatch:"full",redirectTo:"forwardinghistory"},{path:"forwardinghistory",component:Dt,canActivate:[N.fY]},{path:"peers",component:mp,canActivate:[N.fY]}]},{path:"reports",component:hp,canActivate:[N.fY],children:[{path:"",pathMatch:"full",redirectTo:"routingreport"},{path:"routingreport",component:yp,canActivate:[N.fY]},{path:"transactions",component:wp,canActivate:[N.fY]}]},{path:"graph",component:(()=>{class n{constructor(e){this.router=e,this.faSearch=T.wn1,this.links=[{link:"lookups",name:"Lookup"},{link:"queryroutes",name:"Query Routes"}],this.activeLink=this.links[0].link,this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){const e=this.links.find(i=>this.router.url.includes(i.link));this.activeLink=e?e.link:this.links[0].link,this.router.events.pipe((0,_.R)(this.unSubs[0]),(0,Y.h)(i=>i instanceof y.Av)).subscribe({next:i=>{const o=this.links.find(s=>i.urlAfterRedirects.includes(s.link));this.activeLink=o?o.link:this.links[0].link}})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(y.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-graph"]],decls:13,vars:3,consts:[["fxLayout","row wrap","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x"],["fxLayout","column"],["mat-tab-nav-bar","","mat-stretch-tabs","false","mat-align-tabs","start",3,"tabPanel"],["mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["tabPanel",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"mat-tab-body-wrapper"],["mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(e,i){if(1&e&&(t.TgZ(0,"div",0),t._UZ(1,"fa-icon",1),t.TgZ(2,"span",2),t._uU(3,"Graph Lookups"),t.qZA()(),t.TgZ(4,"div",3)(5,"mat-card")(6,"mat-card-content",4)(7,"nav",5),t.YNc(8,Fp,2,3,"div",6),t.qZA(),t._UZ(9,"mat-tab-nav-panel",null,7),t.TgZ(11,"div",8),t._UZ(12,"router-outlet"),t.qZA()()()()),2&e){const o=t.MAs(10);t.xp6(1),t.Q6J("icon",i.faSearch),t.xp6(6),t.Q6J("tabPanel",o),t.xp6(1),t.Q6J("ngForOf",i.links)}},dependencies:[u.sg,P.BN,m.xw,m.Wh,m.yH,b.a8,b.dn,q.BU,q.sW,q.Nj,y.lC,y.rH]}),n})(),canActivate:[N.fY],children:[{path:"",pathMatch:"full",redirectTo:"lookups"},{path:"lookups",component:No,canActivate:[N.fY]},{path:"queryroutes",component:Mr,canActivate:[N.fY]}]},{path:"**",component:Ip.w}]}]);var Pp=f(9470);let Up=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n,bootstrap:[Ct]}),n.\u0275inj=t.cJS({providers:[N.fY],imports:[u.ez,Pp.m,Op]}),n})()}}]);