2
0
mirror of https://github.com/Ride-The-Lightning/RTL synced 2024-10-31 09:20:27 +00:00
RTL/frontend/924.ff524ffae95c311b.js
Shahana Farooqui c7fd9fad08 Liquidity Ads Page except channel count and capacity filters
Liquidity Ads Page except channel count and capacity filters
2022-05-20 12:11:01 -04:00

1 line
299 KiB
JavaScript

"use strict";(self.webpackChunkRTLApp=self.webpackChunkRTLApp||[]).push([[924],{7924:(Yc,ct,g)=>{g.r(ct),g.d(ct,{ECLModule:()=>Qc});var u=g(9808),x=g(1402),kt=g(8878),t=g(5e3),p=g(7093),M=g(5899);function Pt(n,a){1&n&&t._UZ(0,"mat-progress-bar",3)}let ut=(()=>{class n{constructor(e){this.router=e,this.loading=!1,this.router.events.subscribe(i=>{switch(!0){case i instanceof x.OD:this.loading=!0;break;case i instanceof x.m2:case i instanceof x.gk:case i instanceof x.Q3:this.loading=!1}})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-root"]],decls:4,vars:1,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"inner-sidenav-content"],["color","primary","mode","indeterminate",4,"ngIf"],["outlet","outlet"],["color","primary","mode","indeterminate"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.YNc(1,Pt,1,0,"mat-progress-bar",1),t._UZ(2,"router-outlet",null,2),t.qZA()),2&e&&(t.xp6(1),t.Q6J("ngIf",i.loading))},directives:[p.xw,p.yH,p.Wh,u.O5,x.lC,M.pW],styles:[""],data:{animation:[kt.g]}}),n})();var d=g(7579),h=g(2722),et=g(1365),pt=g(534),Z=g(801),l=g(7731),C=g(2501),F=g(5043),S=g(5620),R=g(62),I=g(9444),mt=g(3954),T=g(9224),nt=g(2181),w=g(3322),q=g(7423),dt=g(5245);const ht=function(n){return{backgroundColor:n}};function Dt(n,a){if(1&n&&t._UZ(0,"span",6),2&n){const e=t.oxw();t.Q6J("ngStyle",t.VKq(1,ht,null==e.information?null:e.information.color))}}function Ut(n,a){if(1&n&&(t.TgZ(0,"div"),t.TgZ(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(),t.qZA()),2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngStyle",t.VKq(4,ht,null==e.information?null:e.information.color)),t.xp6(1),t.hij(" ",t.lcZ(6,2,null==e.information?null:e.information.color)," ")}}function Mt(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 Jt=(()=>{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(R.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),t.TgZ(1,"div"),t.TgZ(2,"h4",1),t._uU(3,"Alias"),t.qZA(),t.TgZ(4,"div",2),t._uU(5),t.YNc(6,Dt,1,3,"span",3),t.qZA(),t.qZA(),t.YNc(7,Ut,7,6,"div",4),t.TgZ(8,"div"),t.TgZ(9,"h4",1),t._uU(10,"Implementation"),t.qZA(),t.TgZ(11,"div",2),t._uU(12),t.qZA(),t.qZA(),t.TgZ(13,"div"),t.TgZ(14,"h4",1),t._uU(15,"Chain"),t.qZA(),t.YNc(16,Mt,2,1,"span",5),t.qZA(),t.qZA()),2&e&&(t.xp6(5),t.hij(" ",null==i.information?null:i.information.alias," "),t.xp6(1),t.Q6J("ngIf",!i.showColorFieldSeparately),t.xp6(1),t.Q6J("ngIf",i.showColorFieldSeparately),t.xp6(5),t.Oqu(null!=i.information&&i.information.lnImplementation||null!=i.information&&i.information.version?(null==i.information?null:i.information.lnImplementation)+" "+(null==i.information?null:i.information.version):""),t.xp6(4),t.Q6J("ngForOf",i.chains))},directives:[p.xw,p.yH,p.Wh,u.O5,u.sg,u.PC,w.Zl],pipes:[u.gd],styles:[""]}),n})();function Qt(n,a){if(1&n&&(t.TgZ(0,"div",2),t.TgZ(1,"div"),t.TgZ(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"),t.TgZ(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"),t.TgZ(16,"h4",3),t._uU(17,"Total"),t.qZA(),t.TgZ(18,"div",4),t._uU(19),t.ALo(20,"number"),t.qZA(),t.qZA(),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 Yt(n,a){if(1&n&&(t.TgZ(0,"div",6),t.TgZ(1,"p"),t._uU(2),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(2),t.Oqu(e.errorMessage)}}let Ht=(()=>{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,Qt,21,11,"div",0),t.YNc(1,Yt,3,1,"ng-template",null,1,t.W1O)),2&e){const o=t.MAs(2);t.Q6J("ngIf",""===(null==i.errorMessage?null:i.errorMessage.trim()))("ngIfElse",o)}},directives:[u.O5,p.xw,p.yH,p.Wh,M.pW],pipes:[u.JJ],styles:[""]}),n})();var y=g(7322),V=g(7238),G=g(4834),Q=g(644);const Bt=function(){return["../connections/channels/open"]},zt=function(n){return{filter:n}};function Vt(n,a){if(1&n&&(t.TgZ(0,"div",19),t.TgZ(1,"a",20),t._uU(2),t.ALo(3,"slice"),t.qZA(),t.TgZ(4,"div",6),t.TgZ(5,"mat-hint",21),t.TgZ(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),t.TgZ(15,"strong",8),t._uU(16,"Remote:"),t.qZA(),t._uU(17),t.ALo(18,"number"),t.qZA(),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,Bt))("state",t.VKq(24,zt,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 Gt(n,a){if(1&n&&(t.TgZ(0,"div",17),t.YNc(1,Vt,20,26,"div",18),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",e.allChannels)}}function Xt(n,a){if(1&n&&(t.TgZ(0,"div",3),t.TgZ(1,"div",4),t.TgZ(2,"span",5),t._uU(3,"Total Capacity"),t.qZA(),t.TgZ(4,"div",6),t.TgZ(5,"mat-hint",7),t.TgZ(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),t.TgZ(15,"strong",8),t._uU(16,"Remote:"),t.qZA(),t._uU(17),t.ALo(18,"number"),t.qZA(),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,Gt,2,1,"div",16),t.qZA(),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 $t(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",26),t._uU(1," No channels available. "),t.TgZ(2,"button",27),t.NdJ("click",function(){return t.CHM(e),t.oxw().goToChannels()}),t._uU(3,"Open Channel"),t.qZA(),t.qZA()}}function Wt(n,a){if(1&n&&(t.TgZ(0,"div",28),t.TgZ(1,"p"),t._uU(2),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(2),t.Oqu(e.errorMessage)}}let Kt=(()=>{class n{constructor(e){this.router=e,this.faBalanceScale=Z.DL8,this.faDumbbell=Z.FlN,this.sortBy="Balance Score"}goToChannels(){this.router.navigateByUrl("/ecl/connections")}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-capacity-info"]],inputs:{channelBalances:"channelBalances",allChannels:"allChannels",sortBy:"sortBy",errorMessage:"errorMessage"},decls:5,vars:2,consts:[["fxLayout","column","fxLayoutAlign","space-between stretch","fxFlex","100",4,"ngIf","ngIfElse"],["noChannelBlock",""],["errorBlock",""],["fxLayout","column","fxLayoutAlign","space-between stretch","fxFlex","100"],["fxLayout","column","fxFlex","9","fxLayoutAlign","end start"],[1,"dashboard-capacity-header","this-channel-capacity"],["fxLayout","row","fxLayoutAlign","space-between start",1,"w-100"],["fxFlex","40","fxLayoutAlign","start center",1,"font-size-90"],[1,"font-weight-900","mr-5px"],["fxFlex","20","fxLayoutAlign","center center",1,"font-size-90"],["matTooltip","Balance Score",1,"mr-3px",3,"icon"],["fxFlex","40","fxLayoutAlign","end center",1,"font-size-90"],["mode","determinate","color","accent",1,"dashboard-progress-bar","this-channel-bar",3,"value"],["fxLayout","column","fxFlex","3","fxLayoutAlign","end stretch"],[1,"dashboard-divider"],[1,"channels-capacity-scroll",3,"perfectScrollbar"],["fxLayout","column","fxFlex","100",4,"ngIf","ngIfElse"],["fxLayout","column","fxFlex","100"],["class","mt-2",4,"ngFor","ngForOf"],[1,"mt-2"],[1,"dashboard-capacity-header",3,"routerLink","state","matTooltip","matTooltipDisabled"],["fxFlex","40","fxLayoutAlign","start center",1,"font-size-90","color-primary"],["fxFlex","20","fxLayoutAlign","center center",1,"font-size-90","color-primary"],["matTooltip","Balance Score",1,"color-primary","mr-3px",3,"icon"],["fxFlex","40","fxLayoutAlign","end center",1,"font-size-90","color-primary"],["mode","determinate",1,"dashboard-progress-bar",3,"value"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between start",1,"mt-1","w-100"],["mat-stroked-button","","color","primary","tabindex","1",3,"click"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(e,i){if(1&e&&(t.YNc(0,Xt,24,15,"div",0),t.YNc(1,$t,4,0,"ng-template",null,1,t.W1O),t.YNc(3,Wt,3,1,"ng-template",null,2,t.W1O)),2&e){const o=t.MAs(4);t.Q6J("ngIf",""===(null==i.errorMessage?null:i.errorMessage.trim()))("ngIfElse",o)}},directives:[u.O5,p.xw,p.Wh,p.yH,y.bx,I.BN,V.gM,M.pW,G.d,Q.$V,u.sg,x.yS,q.lW],pipes:[u.JJ,u.OU],styles:[".channels-capacity-scroll[_ngcontent-%COMP%]{width:100%;height:100%;overflow-y:hidden}"]}),n})();function jt(n,a){if(1&n&&(t.TgZ(0,"div",2),t.TgZ(1,"div",3),t.TgZ(2,"div"),t.TgZ(3,"h4",4),t._uU(4,"Daily"),t.qZA(),t.TgZ(5,"div",5),t._uU(6),t.ALo(7,"number"),t.qZA(),t.qZA(),t.TgZ(8,"div"),t.TgZ(9,"h4",4),t._uU(10,"Weekly"),t.qZA(),t.TgZ(11,"div",5),t._uU(12),t.ALo(13,"number"),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h4",4),t._uU(16,"Monthly"),t.qZA(),t.TgZ(17,"div",5),t._uU(18),t.ALo(19,"number"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(20,"div",3),t.TgZ(21,"div"),t.TgZ(22,"h4",4),t._uU(23,"Transactions"),t.qZA(),t.TgZ(24,"div",5),t._uU(25),t.ALo(26,"number"),t.qZA(),t.qZA(),t.TgZ(27,"div"),t.TgZ(28,"h4",4),t._uU(29,"Transactions"),t.qZA(),t.TgZ(30,"div",5),t._uU(31),t.ALo(32,"number"),t.qZA(),t.qZA(),t.TgZ(33,"div"),t.TgZ(34,"h4",4),t._uU(35,"Transactions"),t.qZA(),t.TgZ(36,"div",5),t._uU(37),t.ALo(38,"number"),t.qZA(),t.qZA(),t.qZA(),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),t.TgZ(1,"p"),t._uU(2),t.qZA(),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?void 0:e.monthly_fee){this.totalFees=[{name:"Monthly",value:this.fees.monthly_fee},{name:"Weekly",value:this.fees.weekly_fee},{name:"Daily ",value:this.fees.daily_fee}];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)}},directives:[u.O5,p.xw,p.yH,p.Wh],pipes:[u.JJ],styles:[""]}),n})();function ne(n,a){if(1&n&&(t.TgZ(0,"div",2),t.TgZ(1,"div",3),t.TgZ(2,"div"),t.TgZ(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.qZA(),t.TgZ(9,"div"),t.TgZ(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.qZA(),t.TgZ(16,"div"),t.TgZ(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.qZA(),t.qZA(),t.TgZ(23,"div",3),t.TgZ(24,"div"),t.TgZ(25,"h4",4),t._uU(26,"Capacity"),t.qZA(),t.TgZ(27,"div",5),t._uU(28),t.ALo(29,"number"),t.qZA(),t.qZA(),t.TgZ(30,"div"),t.TgZ(31,"h4",4),t._uU(32,"Capacity"),t.qZA(),t.TgZ(33,"div",5),t._uU(34),t.ALo(35,"number"),t.qZA(),t.qZA(),t.TgZ(36,"div"),t.TgZ(37,"h4",4),t._uU(38,"Capacity"),t.qZA(),t.TgZ(39,"div",5),t._uU(40),t.ALo(41,"number"),t.qZA(),t.qZA(),t.qZA(),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),t.TgZ(1,"p"),t._uU(2),t.qZA(),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)}},directives:[u.O5,p.xw,p.yH,p.Wh],pipes:[u.JJ],styles:[""]}),n})();function oe(n,a){if(1&n&&(t.TgZ(0,"mat-hint",19),t.TgZ(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 se(n,a){if(1&n&&(t.TgZ(0,"mat-hint",19),t.TgZ(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 le(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 re(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 ce=function(){return["../connections/channels/open"]},ue=function(n){return{filter:n}};function pe(n,a){if(1&n&&(t.TgZ(0,"div",14),t.TgZ(1,"a",15),t._uU(2),t.ALo(3,"slice"),t.qZA(),t.TgZ(4,"div",16),t.YNc(5,oe,5,4,"mat-hint",17),t.YNc(6,se,5,4,"mat-hint",17),t.qZA(),t.YNc(7,le,1,1,"mat-progress-bar",18),t.YNc(8,re,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,ce))("state",t.VKq(15,ue,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 me(n,a){if(1&n&&(t.TgZ(0,"div",12),t.YNc(1,pe,9,17,"div",13),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",e.allChannels)}}const de=function(n,a,e){return{"mb-4":n,"mb-2":a,"mb-1":e}};function he(n,a){if(1&n&&(t.TgZ(0,"div",3),t.TgZ(1,"div",4),t.TgZ(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,me,2,1,"div",11),t.qZA(),t.qZA()),2&n){const e=t.oxw(),i=t.MAs(2);t.Q6J("ngClass",t.kEZ(7,de,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 ge(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",24),t.NdJ("click",function(){return t.CHM(e),t.oxw(2).goToChannels()}),t._uU(1,"Open Channel"),t.qZA()}}function _e(n,a){if(1&n&&(t.TgZ(0,"div",22),t._uU(1," No channels available. "),t.YNc(2,ge,2,0,"button",23),t.qZA()),2&n){const e=t.oxw();t.xp6(2),t.Q6J("ngIf","Out"===e.direction)}}function fe(n,a){if(1&n&&(t.TgZ(0,"div",25),t.TgZ(1,"p"),t._uU(2),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(2),t.Oqu(e.errorMessage)}}let Ce=(()=>{class n{constructor(e,i){this.router=e,this.commonService=i,this.screenSize="",this.screenSizeEnum=l.cu}ngOnInit(){this.screenSize=this.commonService.getScreenSize()}goToChannels(){this.router.navigateByUrl("/ecl/connections")}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(x.F0),t.Y36(R.v))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-liquidity-info"]],inputs:{direction:"direction",totalLiquidity:"totalLiquidity",allChannels:"allChannels",errorMessage:"errorMessage"},decls:5,vars:2,consts:[["fxLayout","column","fxLayoutAlign","space-between stretch","fxFlex","100",3,"ngClass",4,"ngIf","ngIfElse"],["noChannelBlock",""],["errorBlock",""],["fxLayout","column","fxLayoutAlign","space-between stretch","fxFlex","100",3,"ngClass"],["fxLayout","column","fxFlex","9","fxLayoutAlign","end start"],[1,"dashboard-capacity-header","this-channel-capacity"],[1,"font-size-90"],["mode","determinate","color","accent","value","100",1,"dashboard-progress-bar","this-channel-bar"],["fxLayout","column","fxFlex","3","fxLayoutAlign","end stretch"],[1,"dashboard-divider"],["fxLayout","column","fxFlex.gt-sm","88","fxFlex","84","fxLayoutAlign","start start",3,"perfectScrollbar"],["fxLayout","column","fxFlex","100","class","w-100",4,"ngIf","ngIfElse"],["fxLayout","column","fxFlex","100",1,"w-100"],["class","mt-2",4,"ngFor","ngForOf"],[1,"mt-2"],[1,"dashboard-capacity-header",3,"routerLink","state","matTooltip","matTooltipDisabled"],["fxLayout","row","fxLayoutAlign","space-between start",1,"w-100"],["fxFlex","100","fxLayoutAlign","start center","class","font-size-90 color-primary",4,"ngIf"],["class","dashboard-progress-bar","mode","determinate",3,"value",4,"ngIf"],["fxFlex","100","fxLayoutAlign","start center",1,"font-size-90","color-primary"],[1,"font-weight-900","mr-5px"],["mode","determinate",1,"dashboard-progress-bar",3,"value"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between center",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,he,12,11,"div",0),t.YNc(1,_e,3,1,"ng-template",null,1,t.W1O),t.YNc(3,fe,3,1,"ng-template",null,2,t.W1O)),2&e){const o=t.MAs(4);t.Q6J("ngIf",""===(null==i.errorMessage?null:i.errorMessage.trim()))("ngIfElse",o)}},directives:[u.O5,p.xw,p.Wh,p.yH,u.mk,w.oO,y.bx,M.pW,G.d,Q.$V,u.sg,x.yS,V.gM,q.lW],pipes:[u.JJ,u.OU],styles:[""]}),n})();var k=g(3251),J=g(9300),v=g(6087),A=g(4847),r=g(2075),D=g(8966),N=g(2994),z=g(6642),m=g(3075),U=g(7531),X=g(3390),$=g(6534),P=g(4107),Y=g(508);function xe(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Description is required."),t.qZA())}function ye(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 Ze(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 Te(n,a){if(1&n&&(t.TgZ(0,"div",26),t._UZ(1,"fa-icon",27),t.YNc(2,Ze,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 Ae=(()=>{class n{constructor(e,i,o,s,c,_){this.dialogRef=e,this.data=i,this.store=o,this.decimalPipe=s,this.commonService=c,this.actions=_,this.faExclamationTriangle=Z.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 d.x,new d.x,new d.x,new d.x,new d.x]}ngOnInit(){this.pageSize=this.data.pageSize,this.store.select(C.pg).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e}),this.store.select(C.yD).pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.information=e}),this.actions.pipe((0,h.R)(this.unSubs[2]),(0,J.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.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,N.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.fiatConversion&&this.invoiceValue>99&&(this.invoiceValueHint="",this.commonService.convertCurrency(this.invoiceValue,l.NT.SATS,l.NT.OTHER,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe((0,h.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(D.so),t.Y36(D.WI),t.Y36(S.yh),t.Y36(u.JJ),t.Y36(R.v),t.Y36(z.eX))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-create-invoices"]],decls:35,vars:16,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","8","fxFlex","5","fxLayoutAlign","center","default","","mat-button","",1,"btn-close-x","p-0",3,"mat-dialog-close"],[1,"padding-gap-x-large"],["fxLayout","row wrap","fxLayoutAlign","start space-between","fxFlex","100"],["addInvoiceForm","ngForm"],["fxFlex","100","fxLayoutAlign","start end"],["matInput","","autoFocus","","placeholder","Description","tabindex","2","name","description","required","",3,"ngModel","ngModelChange"],[4,"ngIf"],["fxLayout","row","fxLayoutAlign","space-between start","fxFlex","100"],["fxFlex","40"],["matInput","","placeholder","Amount","type","number","tabindex","3","name","invValue",3,"ngModel","step","min","ngModelChange","keyup"],["matSuffix",""],["fxFlex","30"],["matInput","","placeholder","Expiry","type","number","name","exp","tabindex","4",3,"ngModel","step","min","ngModelChange"],["fxFlex","26"],["tabindex","5","name","timeUnit",3,"value","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center",1,"mt-2"],["mat-button","","color","primary","tabindex","7","type","reset",1,"mr-1",3,"click"],["mat-button","","color","primary","tabindex","8",3,"click"],[3,"value"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"]],template:function(e,i){if(1&e){const o=t.EpF();t.TgZ(0,"div",0),t.TgZ(1,"div",1),t.TgZ(2,"mat-card-header",2),t.TgZ(3,"div",3),t.TgZ(4,"span",4),t._uU(5,"Create Invoice"),t.qZA(),t.qZA(),t.TgZ(6,"button",5),t._uU(7,"X"),t.qZA(),t.qZA(),t.TgZ(8,"mat-card-content",6),t.TgZ(9,"form",7,8),t.TgZ(11,"mat-form-field",9),t.TgZ(12,"input",10),t.NdJ("ngModelChange",function(c){return i.description=c}),t.qZA(),t.YNc(13,xe,2,0,"mat-error",11),t.qZA(),t.TgZ(14,"div",12),t.TgZ(15,"mat-form-field",13),t.TgZ(16,"input",14),t.NdJ("ngModelChange",function(c){return i.invoiceValue=c})("keyup",function(){return i.onInvoiceValueChange()}),t.qZA(),t.TgZ(17,"span",15),t._uU(18," Sats "),t.qZA(),t.TgZ(19,"mat-hint"),t._uU(20),t.qZA(),t.qZA(),t.TgZ(21,"mat-form-field",16),t.TgZ(22,"input",17),t.NdJ("ngModelChange",function(c){return i.expiry=c}),t.qZA(),t.TgZ(23,"span",15),t._uU(24),t.ALo(25,"titlecase"),t.qZA(),t.qZA(),t.TgZ(26,"mat-form-field",18),t.TgZ(27,"mat-select",19),t.NdJ("selectionChange",function(c){return i.onTimeUnitChange(c)}),t.YNc(28,ye,3,4,"mat-option",20),t.qZA(),t.qZA(),t.qZA(),t.YNc(29,Te,3,2,"div",21),t.TgZ(30,"div",22),t.TgZ(31,"button",23),t.NdJ("click",function(){return i.resetData()}),t._uU(32,"Clear Field"),t.qZA(),t.TgZ(33,"button",24),t.NdJ("click",function(){t.CHM(o);const c=t.MAs(10);return i.onAddInvoice(c)}),t._uU(34,"Create Invoice"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}2&e&&(t.xp6(6),t.Q6J("mat-dialog-close",!1),t.xp6(6),t.Q6J("ngModel",i.description),t.xp6(1),t.Q6J("ngIf",!i.description),t.xp6(3),t.Q6J("ngModel",i.invoiceValue)("step",100)("min",1),t.xp6(4),t.Oqu(i.invoiceValueHint),t.xp6(2),t.Q6J("ngModel",i.expiry)("step",i.selTimeUnit===i.timeUnitEnum.SECS?300:i.selTimeUnit===i.timeUnitEnum.MINS?10:i.selTimeUnit===i.timeUnitEnum.HOURS?2:1)("min",1),t.xp6(2),t.hij(" ",t.lcZ(25,14,i.selTimeUnit)," "),t.xp6(3),t.Q6J("value",i.selTimeUnit),t.xp6(1),t.Q6J("ngForOf",i.timeUnits),t.xp6(1),t.Q6J("ngIf",""!==i.invoiceError))},directives:[p.xw,p.yH,T.dk,p.Wh,q.lW,D.ZT,T.dn,m._Y,m.JL,m.F,y.KE,U.Nt,m.Fj,X.h,m.Q7,m.JJ,m.On,u.O5,m.wV,m.qQ,$.q,y.R9,y.bx,P.gD,u.sg,y.TO,Y.ey,I.BN],pipes:[u.rS],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),n})();var Le=g(7766),b=g(7861);function ve(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Description is required."),t.qZA())}function be(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"form",4,5),t.TgZ(2,"mat-form-field",6),t.TgZ(3,"input",7),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().description=o}),t.qZA(),t.YNc(4,ve,2,0,"mat-error",8),t.qZA(),t.TgZ(5,"mat-form-field",9),t.TgZ(6,"input",10,11),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().invoiceValue=o})("keyup",function(){return t.CHM(e),t.oxw().onInvoiceValueChange()}),t.qZA(),t.TgZ(8,"span",12),t._uU(9," Sats "),t.qZA(),t.TgZ(10,"mat-hint"),t._uU(11),t.qZA(),t.qZA(),t.TgZ(12,"div",13),t.TgZ(13,"button",14),t.NdJ("click",function(){return t.CHM(e),t.oxw().resetData()}),t._uU(14,"Clear Field"),t.qZA(),t.TgZ(15,"button",15),t.NdJ("click",function(){t.CHM(e);const o=t.MAs(1);return t.oxw().onAddInvoice(o)}),t._uU(16,"Create Invoice"),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(3),t.Q6J("ngModel",e.description),t.xp6(1),t.Q6J("ngIf",!e.description),t.xp6(2),t.Q6J("ngModel",e.invoiceValue)("step",100)("min",1),t.xp6(5),t.Oqu(e.invoiceValueHint)}}function Se(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",16),t.TgZ(1,"button",17),t.NdJ("click",function(){return t.CHM(e),t.oxw().openCreateInvoiceModal()}),t._uU(2,"Create Invoice"),t.qZA(),t.qZA()}}function we(n,a){1&n&&t._UZ(0,"mat-progress-bar",47)}function Ee(n,a){1&n&&(t.TgZ(0,"th",48),t._uU(1," Date Created "),t.qZA())}const it=function(n){return{"mr-0":n}};function qe(n,a){if(1&n&&t._UZ(0,"span",53),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.VKq(1,it,e.screenSize===e.screenSizeEnum.XS))}}function Ie(n,a){if(1&n&&t._UZ(0,"span",54),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.VKq(1,it,e.screenSize===e.screenSizeEnum.XS))}}function Oe(n,a){if(1&n&&t._UZ(0,"span",55),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.VKq(1,it,e.screenSize===e.screenSizeEnum.XS))}}function Fe(n,a){if(1&n&&(t.TgZ(0,"td",49),t.YNc(1,qe,1,3,"span",50),t.YNc(2,Ie,1,3,"span",51),t.YNc(3,Oe,1,3,"span",52),t._uU(4),t.ALo(5,"date"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Q6J("ngIf","received"===e.status),t.xp6(1),t.Q6J("ngIf","unpaid"===e.status),t.xp6(1),t.Q6J("ngIf",!e.status||"expired"===e.status||"unknown"===e.status),t.xp6(1),t.hij(" ",t.xi3(5,4,1e3*e.timestamp,"dd/MMM/y HH:mm")," ")}}function Re(n,a){1&n&&(t.TgZ(0,"th",48),t._uU(1," Date Settled "),t.qZA())}function Ne(n,a){if(1&n&&(t.TgZ(0,"td",49),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*e.receivedAt,"dd/MMM/y HH:mm")||"-")}}function ke(n,a){1&n&&(t.TgZ(0,"th",48),t._uU(1," Description "),t.qZA())}const Pe=function(n){return{"max-width":n}};function De(n,a){if(1&n&&(t.TgZ(0,"td",49),t.TgZ(1,"div",56),t.TgZ(2,"span",57),t._uU(3),t.qZA(),t.qZA(),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Pe,i.screenSize===i.screenSizeEnum.XS?"10rem":"32rem")),t.xp6(2),t.Oqu(e.description)}}function Ue(n,a){1&n&&(t.TgZ(0,"th",58),t._uU(1," Amount (Sats) "),t.qZA())}function Me(n,a){if(1&n&&(t.TgZ(0,"td",59),t.TgZ(1,"span",60),t._uU(2),t.ALo(3,"number"),t.qZA(),t.qZA()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",e.amount?t.xi3(3,1,e.amount,"1.0-0"):"-","")}}function Je(n,a){1&n&&(t.TgZ(0,"th",58),t._uU(1," Amount Settled (Sats) "),t.qZA())}function Qe(n,a){if(1&n&&(t.TgZ(0,"td",59),t.TgZ(1,"span",60),t._uU(2),t.ALo(3,"number"),t.qZA(),t.qZA()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",e.amountSettled?t.xi3(3,1,e.amountSettled,"1.0-0"):"-","")}}function Ye(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",61),t.TgZ(1,"div",62),t.TgZ(2,"mat-select",63),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",64),t.NdJ("click",function(){return t.CHM(e),t.oxw(2).onDownloadCSV()}),t._uU(5,"Download CSV"),t.qZA(),t.qZA(),t.qZA(),t.qZA()}}const He=function(n){return{"px-3":n}};function Be(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",65),t.TgZ(1,"div",66),t.TgZ(2,"mat-select",67),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",64),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw(2).onInvoiceClick(s)}),t._uU(5,"View Info"),t.qZA(),t.TgZ(6,"mat-option",64),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw(2).onRefreshInvoice(s)}),t._uU(7,"Refresh"),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,He,e.screenSize!==e.screenSizeEnum.XS))}}function ze(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No invoice available."),t.qZA())}function Ve(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting invoices..."),t.qZA())}function Ge(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 Xe(n,a){if(1&n&&(t.TgZ(0,"td",68),t.YNc(1,ze,2,0,"p",8),t.YNc(2,Ve,2,0,"p",8),t.YNc(3,Ge,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 $e=function(n){return{"display-none":n}};function We(n,a){if(1&n&&t._UZ(0,"tr",69),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,$e,(null==e.invoices?null:e.invoices.data)&&(null==e.invoices||null==e.invoices.data?null:e.invoices.data.length)>0))}}function Ke(n,a){1&n&&t._UZ(0,"tr",70)}function je(n,a){1&n&&t._UZ(0,"tr",71)}const tn=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},en=function(){return["no_invoice"]};function nn(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",18),t.TgZ(1,"div",19),t.TgZ(2,"div",20),t._UZ(3,"fa-icon",21),t.TgZ(4,"span",22),t._uU(5,"Invoices History"),t.qZA(),t.qZA(),t.TgZ(6,"mat-form-field",23),t.TgZ(7,"input",24),t.NdJ("keyup",function(){return t.CHM(e),t.oxw().applyFilter()})("ngModelChange",function(o){return t.CHM(e),t.oxw().selFilter=o}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(8,"div",25),t.YNc(9,we,1,0,"mat-progress-bar",26),t.TgZ(10,"table",27,28),t.ynx(12,29),t.YNc(13,Ee,2,0,"th",30),t.YNc(14,Fe,6,7,"td",31),t.BQk(),t.ynx(15,32),t.YNc(16,Re,2,0,"th",30),t.YNc(17,Ne,3,4,"td",31),t.BQk(),t.ynx(18,33),t.YNc(19,ke,2,0,"th",30),t.YNc(20,De,4,4,"td",31),t.BQk(),t.ynx(21,34),t.YNc(22,Ue,2,0,"th",35),t.YNc(23,Me,4,4,"td",36),t.BQk(),t.ynx(24,37),t.YNc(25,Je,2,0,"th",35),t.YNc(26,Qe,4,4,"td",36),t.BQk(),t.ynx(27,38),t.YNc(28,Ye,6,0,"th",39),t.YNc(29,Be,8,3,"td",40),t.BQk(),t.ynx(30,41),t.YNc(31,Xe,4,3,"td",42),t.BQk(),t.YNc(32,We,1,3,"tr",43),t.YNc(33,Ke,1,0,"tr",44),t.YNc(34,je,1,0,"tr",45),t.qZA(),t.qZA(),t._UZ(35,"mat-paginator",46),t.qZA()}if(2&n){const e=t.oxw();t.xp6(3),t.Q6J("icon",e.faHistory),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("dataSource",e.invoices)("ngClass",t.VKq(12,tn,""!==e.errorMessage)),t.xp6(22),t.Q6J("matFooterRowDef",t.DdM(14,en)),t.xp6(1),t.Q6J("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),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 gt=(()=>{class n{constructor(e,i,o,s,c,_){this.logger=e,this.store=i,this.decimalPipe=o,this.commonService=s,this.datePipe=c,this.actions=_,this.calledFrom="transactions",this.faHistory=Z.qO$,this.selNode={},this.newlyAddedInvoiceMemo="",this.newlyAddedInvoiceValue=0,this.description="",this.invoiceValue=null,this.invoiceValueHint="",this.displayedColumns=[],this.invoicePaymentReq="",this.invoiceJSONArr=[],this.information={},this.flgSticky=!1,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 d.x,new d.x,new d.x,new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===l.cu.XS?(this.flgSticky=!1,this.displayedColumns=["timestamp","amount","actions"]):this.screenSize===l.cu.SM||this.screenSize===l.cu.MD?(this.flgSticky=!1,this.displayedColumns=["timestamp","amount","amountSettled","actions"]):(this.flgSticky=!0,this.displayedColumns=["timestamp","receivedAt","description","amount","amountSettled","actions"])}ngOnInit(){this.store.select(C.pg).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e}),this.store.select(C.yD).pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.information=e}),this.store.select(C.Ef).pipe((0,h.R)(this.unSubs[2])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage="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.loadInvoicesTable(this.invoiceJSONArr),this.logger.info(e)}),this.actions.pipe((0,h.R)(this.unSubs[3]),(0,J.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.loadInvoicesTable(this.invoiceJSONArr)}openCreateInvoiceModal(){this.store.dispatch((0,b.qR)({payload:{data:{pageSize:this.pageSize,component:Ae}}}))}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,N.Z$)({payload:o})),this.resetData()}onInvoiceClick(e){this.store.dispatch((0,b.qR)({payload:{data:{invoice:e,newlyAdded:!1,component:Le.R}}}))}onRefreshInvoice(e){this.store.dispatch((0,N.n7)({payload:e.paymentHash}))}updateInvoicesData(e){this.invoiceJSONArr=this.invoiceJSONArr.map(i=>i.paymentHash===e.paymentHash?e:i)}loadInvoicesTable(e){this.invoices=new r.by(e?[...e]:[]),this.invoices.sortingDataAccessor=(i,o)=>i[o]&&isNaN(i[o])?i[o].toLocaleLowerCase():i[o]?+i[o]:null,this.invoices.sort=this.sort,this.invoices.filterPredicate=(i,o)=>((i.timestamp?this.datePipe.transform(new Date(1e3*i.timestamp),"dd/MMM/YYYY HH:mm").toLowerCase():"")+JSON.stringify(i).toLowerCase()).includes(o),this.invoices.paginator=this.paginator,this.applyFilter()}resetData(){this.description="",this.invoiceValue=null,this.expiry=null,this.invoiceValueHint=""}applyFilter(){this.invoices.filter=this.selFilter.trim().toLowerCase()}onInvoiceValueChange(){this.selNode.fiatConversion&&this.invoiceValue>99&&(this.invoiceValueHint="",this.commonService.convertCurrency(this.invoiceValue,l.NT.SATS,l.NT.OTHER,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe((0,h.R)(this.unSubs[4])).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(F.mQ),t.Y36(S.yh),t.Y36(u.JJ),t.Y36(R.v),t.Y36(u.uU),t.Y36(z.eX))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-lightning-invoices"]],viewQuery:function(e,i){if(1&e&&(t.Gf(A.YE,5),t.Gf(v.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:v.ye,useValue:(0,l.pt)("Invoices")}])],decls:4,vars:3,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch"],["fxLayout","row wrap","fxLayoutAlign","stretch start","fxFlex","100",4,"ngIf"],["fxLayout","row",4,"ngIf"],["fxLayout","column","fxLayoutAlign","start stretch",4,"ngIf"],["fxLayout","row wrap","fxLayoutAlign","stretch start","fxFlex","100"],["addInvoiceForm","ngForm"],["fxFlex","100","fxLayoutAlign","space-between stretch"],["matInput","","placeholder","Description","tabindex","2","name","description","required","true",3,"ngModel","ngModelChange"],[4,"ngIf"],["fxFlex","100","fxLayoutAlign","start end"],["matInput","","placeholder","Amount","type","number","tabindex","3","name","invValue",3,"ngModel","step","min","ngModelChange","keyup"],["invcVal","ngModel"],["matSuffix",""],["fxLayout","row",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","9","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","10",3,"click"],["fxLayout","row"],["mat-flat-button","","color","primary","tabindex","8",3,"click"],["fxLayout","column","fxLayoutAlign","start stretch"],["fxLayout","column","fxLayoutAlign","start stretch","fxLayout.gt-sm","row wrap",1,"page-sub-title-container","mt-1"],["fxFlex","70","fxLayoutAlign","start start","fxLayoutAlign.gt-sm","start center"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxFlex","30","fxLayoutAlign","start end"],["matInput","","placeholder","Filter",3,"ngModel","keyup","ngModelChange"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","timestamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","receivedAt"],["matColumnDef","description"],["matColumnDef","amount"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","class","pr-3",4,"matHeaderCellDef"],["mat-cell","","class","pr-3",4,"matCellDef"],["matColumnDef","amountSettled"],["matColumnDef","actions"],["mat-header-cell","","class","px-3",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",3,"ngClass",4,"matCellDef"],["matColumnDef","no_invoice"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["class","dot green","matTooltip","Received","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot yellow","matTooltip","Unpaid","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot red","matTooltip","Expired/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"],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",1,"pr-3"],["mat-cell","",1,"pr-3"],["fxLayoutAlign","end center"],["mat-header-cell","",1,"px-3"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",3,"ngClass"],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["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,be,17,6,"form",1),t.YNc(2,Se,3,0,"div",2),t.YNc(3,nn,36,15,"div",3),t.qZA()),2&e&&(t.xp6(1),t.Q6J("ngIf","home"===i.calledFrom),t.xp6(1),t.Q6J("ngIf","transactions"===i.calledFrom),t.xp6(1),t.Q6J("ngIf","transactions"===i.calledFrom))},directives:[p.xw,p.yH,p.Wh,u.O5,m._Y,m.JL,m.F,y.KE,U.Nt,m.Fj,m.Q7,m.JJ,m.On,m.wV,m.qQ,$.q,y.R9,y.bx,q.lW,y.TO,I.BN,Q.$V,r.BZ,A.YE,u.mk,w.oO,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,v.NW,M.pW,r.ge,A.nU,r.ev,V.gM,u.PC,w.Zl,P.gD,P.$L,Y.ey,r.yh,r.Q2,r.XQ,r.Gk],pipes:[u.uU,u.JJ],styles:[".mat-column-description[_ngcontent-%COMP%]{flex:0 0 15%;width:15%}.mat-column-description[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%]{display:flex}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),n})();var B=g(5698),at=g(3289),_t=g(8104);const an=["paymentReq"];function on(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 sn(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Payment request is required."),t.qZA())}function ln(n,a){if(1&n&&(t.TgZ(0,"mat-error"),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Oqu(e.paymentDecodedHint)}}function rn(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Payment amount is required."),t.qZA())}function cn(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mat-form-field",1),t.TgZ(1,"input",17,18),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().paymentAmount=o})("change",function(o){return t.CHM(e),t.oxw().onAmountChange(o)}),t.qZA(),t.TgZ(3,"mat-hint"),t._uU(4,"It is a zero amount invoice, enter amount to be paid."),t.qZA(),t.YNc(5,rn,2,0,"mat-error",11),t.qZA()}if(2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngModel",e.paymentAmount),t.xp6(4),t.Q6J("ngIf",!e.paymentAmount)}}function un(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 pn(n,a){if(1&n&&(t.TgZ(0,"div",19),t._UZ(1,"fa-icon",20),t.YNc(2,un,2,1,"span",11),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faExclamationTriangle),t.xp6(1),t.Q6J("ngIf",""!==e.paymentError)}}let mn=(()=>{class n{constructor(e,i,o,s,c,_,O,f){this.dialogRef=e,this.store=i,this.eclEffects=o,this.logger=s,this.commonService=c,this.decimalPipe=_,this.actions=O,this.dataService=f,this.faExclamationTriangle=Z.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 d.x,new d.x,new d.x,new d.x]}ngOnInit(){this.store.select(C.pg).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e}),this.store.select(C.Xz).pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.activeChannels=e.activeChannels,this.logger.info(e)}),this.actions.pipe((0,h.R)(this.unSubs[1]),(0,J.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,B.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.fiatConversion?this.commonService.convertCurrency(+this.paymentDecoded.amount,l.NT.SATS,l.NT.OTHER,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe((0,h.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,N.oV)(this.zeroAmtInvoice?{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,B.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.fiatConversion?this.commonService.convertCurrency(+this.paymentDecoded.amount,l.NT.SATS,l.NT.OTHER,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe((0,h.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(D.so),t.Y36(S.yh),t.Y36(at.o),t.Y36(F.mQ),t.Y36(R.v),t.Y36(u.JJ),t.Y36(z.eX),t.Y36(_t.D))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-lightning-send-payments"]],viewQuery:function(e,i){if(1&e&&t.Gf(an,5),2&e){let o;t.iGM(o=t.CRH())&&(i.paymentReq=o.first)}},decls:24,vars:7,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","8","fxFlex","5","fxLayoutAlign","center","default","","mat-button","",1,"btn-close-x","p-0",3,"mat-dialog-close"],[1,"padding-gap-x-large"],["fxLayoutAlign","space-between stretch","fxLayout","column"],["sendPaymentForm","ngForm"],["autoFocus","","matInput","","placeholder","Payment Request","name","paymentRequest","rows","4","tabindex","1","required","",3,"ngModel","ngModelChange","matTextareaAutosize"],["paymentReq","ngModel"],[4,"ngIf"],["fxFlex","100",4,"ngIf"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center",1,"mt-2"],["mat-button","","color","primary","tabindex","2","type","reset",1,"mr-1",3,"click"],["mat-button","","color","primary","tabindex","3",3,"click"],["matInput","","placeholder","Amount (Sats)","name","amount","tabindex","2","required","",3,"ngModel","ngModelChange","change"],["paymentAmt","ngModel"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"]],template:function(e,i){if(1&e&&(t.TgZ(0,"div",0),t.TgZ(1,"div",1),t.TgZ(2,"mat-card-header",2),t.TgZ(3,"div",3),t.TgZ(4,"span",4),t._uU(5,"Send Payment"),t.qZA(),t.qZA(),t.TgZ(6,"button",5),t._uU(7,"X"),t.qZA(),t.qZA(),t.TgZ(8,"mat-card-content",6),t.TgZ(9,"form",7,8),t.TgZ(11,"mat-form-field",1),t.TgZ(12,"textarea",9,10),t.NdJ("ngModelChange",function(s){return i.onPaymentRequestEntry(s)})("matTextareaAutosize",function(){return!0}),t.qZA(),t.YNc(14,on,2,1,"mat-hint",11),t.YNc(15,sn,2,0,"mat-error",11),t.YNc(16,ln,2,1,"mat-error",11),t.qZA(),t.YNc(17,cn,6,2,"mat-form-field",12),t.YNc(18,pn,3,2,"div",13),t.TgZ(19,"div",14),t.TgZ(20,"button",15),t.NdJ("click",function(){return i.resetData()}),t._uU(21,"Clear Fields"),t.qZA(),t.TgZ(22,"button",16),t.NdJ("click",function(){return i.onSendPayment()}),t._uU(23,"Send Payment"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&e){const o=t.MAs(13);t.xp6(6),t.Q6J("mat-dialog-close",!1),t.xp6(6),t.Q6J("ngModel",i.paymentRequest),t.xp6(2),t.Q6J("ngIf",i.paymentRequest&&""!==i.paymentDecodedHint),t.xp6(1),t.Q6J("ngIf",!i.paymentRequest),t.xp6(1),t.Q6J("ngIf",null==o.errors?null:o.errors.decodeError),t.xp6(1),t.Q6J("ngIf",i.zeroAmtInvoice),t.xp6(1),t.Q6J("ngIf",""!==i.paymentError)}},directives:[p.xw,p.yH,T.dk,p.Wh,q.lW,D.ZT,T.dn,m._Y,m.JL,m.F,y.KE,U.Nt,m.Fj,X.h,m.Q7,m.JJ,m.On,u.O5,y.bx,y.TO,I.BN],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}.mat-column-payment_hash[_ngcontent-%COMP%]{flex:1 1 20%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),n})();var H=g(1125);const dn=["scrollContainer"];function hn(n,a){if(1&n&&(t.TgZ(0,"div",9),t.TgZ(1,"div",1),t.TgZ(2,"h4",11),t._uU(3,"Description"),t.qZA(),t.TgZ(4,"span",12),t._uU(5),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(5),t.Oqu(e.description)}}function gn(n,a){1&n&&t._UZ(0,"mat-divider",14)}function _n(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mat-expansion-panel",23),t.NdJ("opened",function(){return t.CHM(e),t.oxw().onExpansionOpen(!0)})("closed",function(){return t.CHM(e),t.oxw().onExpansionOpen(!1)}),t.TgZ(1,"mat-expansion-panel-header"),t.TgZ(2,"mat-panel-title"),t.TgZ(3,"h4",24),t._uU(4),t.qZA(),t.TgZ(5,"h4",25),t._uU(6),t.ALo(7,"number"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(8,"div",8),t.TgZ(9,"div",9),t.TgZ(10,"div",26),t.TgZ(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.qZA(),t.TgZ(16,"div",26),t.TgZ(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.qZA(),t.qZA(),t._UZ(22,"mat-divider",14),t.TgZ(23,"div",9),t.TgZ(24,"div",1),t.TgZ(25,"h4",11),t._uU(26,"ID"),t.qZA(),t.TgZ(27,"span",27),t._uU(28),t.qZA(),t.qZA(),t.qZA(),t._UZ(29,"mat-divider",14),t.TgZ(30,"div",9),t.TgZ(31,"div",1),t.TgZ(32,"h4",11),t._uU(33,"To Channel"),t.qZA(),t.TgZ(34,"span",27),t._uU(35),t.qZA(),t.qZA(),t.qZA(),t.qZA(),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 fn=(()=>{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(D.so),t.Y36(D.WI))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-payment-information"]],viewQuery:function(e,i){if(1&e&&t.Gf(dn,5),2&e){let o;t.iGM(o=t.CRH())&&(i.scrollContainer=o.first)}},decls:66,vars:15,consts:[["fxLayout","column","fxLayout.gt-sm","row","fxLayoutAlign","space-between stretch"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","3","fxFlex","5","fxLayoutAlign","center","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"h-40","padding-gap-x-large",3,"perfectScrollbar"],["scrollContainer",""],["fxLayout","column"],["fxLayout","row"],["fxFlex","30"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text"],["fxFlex","70"],[1,"w-100","my-1"],["fxLayout","row",4,"ngIf"],["class","w-100 my-1",4,"ngIf"],["class","flat-expansion-panel my-1",3,"expanded","opened","closed",4,"ngFor","ngForOf"],["fxLayout","row","fxLayoutAlign","start end",1,"btn-sticky-container","padding-gap-x-large"],["mat-mini-fab","","aria-label","Scroll Down","fxLayoutAlign","center center",3,"click"],["fxLayoutAlign","center center"],["fxLayout","row","fxLayoutAlign","end center",1,"padding-gap-x-large","padding-gap-bottom-large"],["fxLayoutAlign","center center","tabindex","1","mat-button","","color","primary","type","button","default","",1,"mr-1",3,"mat-dialog-close"],[1,"flat-expansion-panel","my-1",3,"expanded","opened","closed"],["fxFlex","30","fxLayoutAlign","start",1,"font-bold-500"],["fxFlex","70","fxLayoutAlign","start",1,"font-bold-500"],["fxFlex","50"],[1,"overflow-wrap","foreground-secondary-text"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.TgZ(1,"div",1),t.TgZ(2,"mat-card-header",2),t.TgZ(3,"div",3),t.TgZ(4,"span",4),t._uU(5,"Payment Information"),t.qZA(),t.qZA(),t.TgZ(6,"button",5),t.NdJ("click",function(){return i.onClose()}),t._uU(7,"X"),t.qZA(),t.qZA(),t.TgZ(8,"mat-card-content",6,7),t.TgZ(10,"div",8),t.TgZ(11,"div",9),t.TgZ(12,"div",10),t.TgZ(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.qZA(),t.TgZ(18,"div",13),t.TgZ(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.qZA(),t.qZA(),t._UZ(24,"mat-divider",14),t.TgZ(25,"div",9),t.TgZ(26,"div",1),t.TgZ(27,"h4",11),t._uU(28,"ID"),t.qZA(),t.TgZ(29,"span",12),t._uU(30),t.qZA(),t.qZA(),t.qZA(),t._UZ(31,"mat-divider",14),t.TgZ(32,"div",9),t.TgZ(33,"div",1),t.TgZ(34,"h4",11),t._uU(35,"Payment Hash"),t.qZA(),t.TgZ(36,"span",12),t._uU(37),t.qZA(),t.qZA(),t.qZA(),t._UZ(38,"mat-divider",14),t.TgZ(39,"div",9),t.TgZ(40,"div",1),t.TgZ(41,"h4",11),t._uU(42,"Payment Preimage"),t.qZA(),t.TgZ(43,"span",12),t._uU(44),t.qZA(),t.qZA(),t.qZA(),t._UZ(45,"mat-divider",14),t.TgZ(46,"div",9),t.TgZ(47,"div",1),t.TgZ(48,"h4",11),t._uU(49,"Recipient Node"),t.qZA(),t.TgZ(50,"span",12),t._uU(51),t.qZA(),t.qZA(),t.qZA(),t._UZ(52,"mat-divider",14),t.YNc(53,hn,6,1,"div",15),t.YNc(54,gn,1,0,"mat-divider",16),t.TgZ(55,"div",9),t.TgZ(56,"div",1),t.TgZ(57,"mat-accordion"),t.YNc(58,_n,36,14,"mat-expansion-panel",17),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(59,"div",18),t.TgZ(60,"button",19),t.NdJ("click",function(){return i.onScrollDown()}),t.TgZ(61,"mat-icon",20),t._uU(62,"arrow_downward"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(63,"div",21),t.TgZ(64,"button",22),t._uU(65,"OK"),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.xp6(16),t.Oqu(t.lcZ(17,10,i.payment.recipientAmount)),t.xp6(6),t.Oqu(t.xi3(23,12,i.payment.firstPartTimestamp,"dd/MMM/y HH:mm")),t.xp6(8),t.Oqu(i.payment.id),t.xp6(7),t.Oqu(i.payment.paymentHash),t.xp6(7),t.Oqu(i.payment.paymentPreimage),t.xp6(7),t.Oqu(i.payment.recipientNodeAlias),t.xp6(2),t.Q6J("ngIf",i.description),t.xp6(1),t.Q6J("ngIf",i.description),t.xp6(4),t.Q6J("ngForOf",i.payment.parts),t.xp6(6),t.Q6J("mat-dialog-close",!1))},directives:[p.xw,p.Wh,p.yH,T.dk,q.lW,T.dn,Q.$V,G.d,u.O5,H.pp,u.sg,dt.Hw,D.ZT,H.ib,H.yz,H.yK],pipes:[u.JJ,u.uU],styles:[""]}),n})();var K=g(3093);const Cn=["sendPaymentForm"];function xn(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 yn(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Payment request is required."),t.qZA())}function Zn(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"form",4,5),t.TgZ(2,"mat-form-field",6),t.TgZ(3,"textarea",7,8),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().onPaymentRequestEntry(o)})("matTextareaAutosize",function(){return!0}),t.qZA(),t.YNc(5,xn,2,1,"mat-hint",9),t.YNc(6,yn,2,0,"mat-error",9),t.qZA(),t.TgZ(7,"div",10),t.TgZ(8,"button",11),t.NdJ("click",function(){return t.CHM(e),t.oxw().resetData()}),t._uU(9,"Clear Field"),t.qZA(),t.TgZ(10,"button",12),t.NdJ("click",function(){return t.CHM(e),t.oxw().onSendPayment()}),t._uU(11,"Send Payment"),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(3),t.Q6J("ngModel",e.paymentRequest),t.xp6(2),t.Q6J("ngIf",e.paymentRequest&&""!==e.paymentDecodedHint),t.xp6(1),t.Q6J("ngIf",!e.paymentRequest)}}function Tn(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",13),t.TgZ(1,"button",12),t.NdJ("click",function(){return t.CHM(e),t.oxw().openSendPaymentModal()}),t._uU(2,"Send Payment"),t.qZA(),t.qZA()}}function An(n,a){1&n&&t._UZ(0,"mat-progress-bar",49)}function Ln(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Date/Time"),t.qZA())}function vn(n,a){if(1&n&&(t.TgZ(0,"td",51),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 bn(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"ID"),t.qZA())}const W=function(n){return{"max-width":n}};function Sn(n,a){if(1&n&&(t.TgZ(0,"td",51),t.TgZ(1,"div",52),t.TgZ(2,"span",53),t._uU(3),t.qZA(),t.qZA(),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,W,i.screenSize===i.screenSizeEnum.XS?"10rem":"22rem")),t.xp6(2),t.Oqu(e.id)}}function wn(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Destination"),t.qZA())}function En(n,a){if(1&n&&(t.TgZ(0,"td",51),t.TgZ(1,"div",52),t.TgZ(2,"span",53),t._uU(3),t.qZA(),t.qZA(),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,W,i.screenSize===i.screenSizeEnum.XS?"10rem":"22rem")),t.xp6(2),t.Oqu(e.recipientNodeAlias)}}function qn(n,a){1&n&&(t.TgZ(0,"th",54),t._uU(1,"Amount (Sats)"),t.qZA())}function In(n,a){if(1&n&&(t.TgZ(0,"td",51),t.TgZ(1,"span",55),t._uU(2),t.ALo(3,"number"),t.qZA(),t.qZA()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,null==e?null:e.recipientAmount))}}function On(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",56),t.TgZ(1,"div",57),t.TgZ(2,"mat-select",58),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",59),t.NdJ("click",function(){return t.CHM(e),t.oxw(2).onDownloadCSV()}),t._uU(5,"Download CSV"),t.qZA(),t.qZA(),t.qZA(),t.qZA()}}function Fn(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",60),t.TgZ(1,"button",61),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw(2).onPaymentClick(s)}),t._uU(2,"View Info"),t.qZA(),t.qZA()}}function Rn(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No payment available."),t.qZA())}function Nn(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting payments..."),t.qZA())}function kn(n,a){if(1&n&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Oqu(e.errorMessage)}}function Pn(n,a){if(1&n&&(t.TgZ(0,"td",62),t.YNc(1,Rn,2,0,"p",9),t.YNc(2,Nn,2,0,"p",9),t.YNc(3,kn,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 Dn(n,a){if(1&n&&(t.TgZ(0,"span",65),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 Un(n,a){if(1&n&&(t.ynx(0),t.YNc(1,Dn,3,4,"span",64),t.BQk()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function Mn(n,a){if(1&n&&(t.TgZ(0,"td",51),t.TgZ(1,"span",63),t._uU(2),t.qZA(),t.YNc(3,Un,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," "),t.xp6(1),t.Q6J("ngIf",e.is_expanded)}}function Jn(n,a){if(1&n&&(t.TgZ(0,"span",63),t.TgZ(1,"span",66),t.TgZ(2,"span",53),t._uU(3),t.qZA(),t.qZA(),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(4);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,W,i.screenSize===i.screenSizeEnum.XS?"10rem":"22rem")),t.xp6(2),t.Oqu(e.id)}}function Qn(n,a){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,Jn,4,4,"span",67),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&&(t.TgZ(0,"td",51),t.TgZ(1,"div",66),t.TgZ(2,"span",53),t._uU(3),t.qZA(),t.qZA(),t.YNc(4,Qn,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,W,i.screenSize===i.screenSizeEnum.XS?"10rem":"22rem")),t.xp6(2),t.Oqu(e.id),t.xp6(1),t.Q6J("ngIf",e.is_expanded)}}function Hn(n,a){if(1&n&&(t.TgZ(0,"span",63),t.TgZ(1,"span",66),t.TgZ(2,"span",53),t._uU(3),t.qZA(),t.qZA(),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(4);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,W,i.screenSize===i.screenSizeEnum.XS?"10rem":"22rem")),t.xp6(2),t.Oqu(e.toChannelAlias)}}function Bn(n,a){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,Hn,4,4,"span",67),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function zn(n,a){if(1&n&&(t.TgZ(0,"td",51),t.TgZ(1,"div",66),t.TgZ(2,"span",53),t._uU(3),t.qZA(),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,W,i.screenSize===i.screenSizeEnum.XS?"10rem":"22rem")),t.xp6(2),t.Oqu(null==e?null:e.recipientNodeAlias),t.xp6(1),t.Q6J("ngIf",e.is_expanded)}}function Vn(n,a){if(1&n&&(t.TgZ(0,"span",68),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 Gn(n,a){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,Vn,3,4,"span",69),t.qZA()),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",51),t.TgZ(1,"span",68),t._uU(2),t.ALo(3,"number"),t.qZA(),t.YNc(4,Gn,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",e.is_expanded)}}function $n(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",71),t.TgZ(1,"button",74),t.NdJ("click",function(){const s=t.CHM(e).$implicit,c=t.oxw(2).$implicit;return t.oxw(2).onPartClick(s,c)}),t._uU(2),t.qZA(),t.qZA()}if(2&n){const e=a.index;t.xp6(2),t.hij("View ",e+1,"")}}function Wn(n,a){if(1&n&&(t.TgZ(0,"div"),t.YNc(1,$n,3,1,"div",73),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function Kn(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",70),t.TgZ(1,"span",71),t.TgZ(2,"button",72),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return s.is_expanded=!s.is_expanded}),t._uU(3),t.qZA(),t.qZA(),t.YNc(4,Wn,2,1,"div",9),t.qZA()}if(2&n){const e=a.$implicit;t.xp6(3),t.Oqu(e.is_expanded?"Hide":"Show"),t.xp6(1),t.Q6J("ngIf",e.is_expanded)}}function jn(n,a){1&n&&t._UZ(0,"tr",75)}const ti=function(n){return{"display-none":n}};function ei(n,a){if(1&n&&t._UZ(0,"tr",76),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,ti,(null==e.payments?null:e.payments.data)&&(null==e.payments||null==e.payments.data?null:e.payments.data.length)>0))}}function ni(n,a){1&n&&t._UZ(0,"tr",77)}function ii(n,a){1&n&&t._UZ(0,"tr",75)}const ai=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},oi=function(){return["no_payment"]};function si(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",14),t.TgZ(1,"div",15),t.TgZ(2,"div",16),t._UZ(3,"fa-icon",17),t.TgZ(4,"span",18),t._uU(5,"Payments History"),t.qZA(),t.qZA(),t.TgZ(6,"mat-form-field",19),t.TgZ(7,"input",20),t.NdJ("keyup",function(){return t.CHM(e),t.oxw().applyFilter()})("ngModelChange",function(o){return t.CHM(e),t.oxw().selFilter=o}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(8,"div",21),t.TgZ(9,"div",22),t.YNc(10,An,1,0,"mat-progress-bar",23),t.TgZ(11,"table",24,25),t.ynx(13,26),t.YNc(14,Ln,2,0,"th",27),t.YNc(15,vn,3,4,"td",28),t.BQk(),t.ynx(16,29),t.YNc(17,bn,2,0,"th",27),t.YNc(18,Sn,4,4,"td",28),t.BQk(),t.ynx(19,30),t.YNc(20,wn,2,0,"th",27),t.YNc(21,En,4,4,"td",28),t.BQk(),t.ynx(22,31),t.YNc(23,qn,2,0,"th",32),t.YNc(24,In,4,3,"td",28),t.BQk(),t.ynx(25,33),t.YNc(26,On,6,0,"th",34),t.YNc(27,Fn,3,0,"td",35),t.BQk(),t.ynx(28,36),t.YNc(29,Pn,4,3,"td",37),t.BQk(),t.ynx(30,38),t.YNc(31,Mn,4,2,"td",28),t.BQk(),t.ynx(32,39),t.YNc(33,Yn,5,5,"td",28),t.BQk(),t.ynx(34,40),t.YNc(35,zn,5,5,"td",28),t.BQk(),t.ynx(36,41),t.YNc(37,Xn,5,5,"td",28),t.BQk(),t.ynx(38,42),t.YNc(39,Kn,5,2,"td",43),t.BQk(),t.YNc(40,jn,1,0,"tr",44),t.YNc(41,ei,1,3,"tr",45),t.YNc(42,ni,1,0,"tr",46),t.YNc(43,ii,1,0,"tr",47),t.qZA(),t.qZA(),t.qZA(),t._UZ(44,"mat-paginator",48),t.qZA()}if(2&n){const e=t.oxw();t.xp6(3),t.Q6J("icon",e.faHistory),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("dataSource",e.payments)("ngClass",t.VKq(14,ai,""!==e.errorMessage)),t.xp6(29),t.Q6J("matRowDefColumns",e.partColumns)("matRowDefWhen",e.is_group),t.xp6(1),t.Q6J("matFooterRowDef",t.DdM(16,oi)),t.xp6(1),t.Q6J("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),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 ft=(()=>{class n{constructor(e,i,o,s,c,_,O){this.logger=e,this.commonService=i,this.store=o,this.rtlEffects=s,this.decimalPipe=c,this.dataService=_,this.datePipe=O,this.calledFrom="transactions",this.faHistory=Z.qO$,this.newlyAddedPayment="",this.selNode={},this.information={},this.paymentJSONArr=[],this.paymentDecoded={},this.displayedColumns=[],this.partColumns=[],this.paymentRequest="",this.paymentDecodedHint="",this.flgSticky=!1,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 d.x,new d.x,new d.x,new d.x,new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===l.cu.XS?(this.flgSticky=!1,this.displayedColumns=["firstPartTimestamp","actions"],this.partColumns=["groupTotal","groupAction"]):this.screenSize===l.cu.SM?(this.flgSticky=!1,this.displayedColumns=["firstPartTimestamp","recipientAmount","actions"],this.partColumns=["groupTotal","groupAmount","groupAction"]):this.screenSize===l.cu.MD?(this.flgSticky=!1,this.displayedColumns=["firstPartTimestamp","id","recipientAmount","actions"],this.partColumns=["groupTotal","groupId","groupAmount","groupAction"]):(this.flgSticky=!0,this.displayedColumns=["firstPartTimestamp","id","recipientNodeAlias","recipientAmount","actions"],this.partColumns=["groupTotal","groupId","groupChannelAlias","groupAmount","groupAction"])}ngOnInit(){this.store.select(C.pg).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e}),this.store.select(C.yD).pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.information=e}),this.store.select(C.PP).pipe((0,h.R)(this.unSubs[2])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage="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.loadPaymentsTable(this.paymentJSONArr),this.logger.info(e)})}ngAfterViewInit(){this.loadPaymentsTable(this.paymentJSONArr)}loadPaymentsTable(e){this.payments=new r.by(e?[...e]:[]),this.payments.sort=this.sort,this.payments.sortingDataAccessor=(i,o)=>{switch(o){case"firstPartTimestamp":return this.commonService.sortByKey(i.parts,"timestamp","number",this.sort.direction),i.firstPartTimestamp;case"id":return this.commonService.sortByKey(i.parts,"id","string",this.sort.direction),i.id;case"recipientNodeAlias":return this.commonService.sortByKey(i.parts,"toChannelAlias","string",this.sort.direction),i.recipientNodeAlias;case"recipientAmount":return this.commonService.sortByKey(i.parts,"amount","number",this.sort.direction),i.recipientAmount;default:return i[o]&&isNaN(i[o])?i[o].toLocaleLowerCase():i[o]?+i[o]:null}},this.payments.filterPredicate=(i,o)=>((i.firstPartTimestamp?this.datePipe.transform(new Date(i.firstPartTimestamp),"dd/MMM/YYYY HH:mm").toLowerCase():"")+JSON.stringify(i).toLowerCase()).includes(o),this.payments.paginator=this.paginator,this.applyFilter()}onSendPayment(){if(!this.paymentRequest)return!0;this.paymentDecoded.timestamp?this.sendPayment():this.dataService.decodePayment(this.paymentRequest,!1).pipe((0,B.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,b.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,B.q)(1)).subscribe(i=>{i&&(this.store.dispatch((0,N.oV)({payload:{invoice:this.paymentRequest,fromDialog:!1}})),this.resetData())})):(this.store.dispatch((0,b.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.toLowerCase(),inputValue:"",width:30}]}}})),this.rtlEffects.closeConfirm.pipe((0,B.q)(1)).subscribe(o=>{o&&(this.paymentDecoded.amount=o[0].inputValue,this.store.dispatch((0,N.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,B.q)(1)).subscribe(i=>{this.paymentDecoded=i,this.paymentDecoded.amount?this.selNode.fiatConversion?this.commonService.convertCurrency(+this.paymentDecoded.amount,l.NT.SATS,l.NT.OTHER,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe((0,h.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:this.paymentDecodedHint="Zero Amount Invoice | Memo: "+this.paymentDecoded.description})}openSendPaymentModal(){this.store.dispatch((0,b.qR)({payload:{data:{component:mn}}}))}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,B.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,b.qR)({payload:{data:{sentPaymentInfo:i,payment:e,component:fn}}}))}onPartClick(e,i){i.paymentHash&&""!==i.paymentHash.trim()?this.dataService.decodePayments(i.paymentHash).pipe((0,B.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.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,b.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:"Payment Part Information",message:s}}}))}applyFilter(){this.payments.filter=this.selFilter.trim().toLowerCase()}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,h.R)(this.unSubs[4])).subscribe(o=>{o.forEach((c,_)=>{c.length>0&&c[0].paymentRequest&&c[0].paymentRequest.description&&""!==c[0].paymentRequest.description&&(e[_].description=c[0].paymentRequest.description)});const s=e.reduce((c,_)=>c.concat(_),[]);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(F.mQ),t.Y36(R.v),t.Y36(S.yh),t.Y36(K.V),t.Y36(u.JJ),t.Y36(_t.D),t.Y36(u.uU))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-lightning-payments"]],viewQuery:function(e,i){if(1&e&&(t.Gf(Cn,5),t.Gf(A.YE,5),t.Gf(v.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:v.ye,useValue:(0,l.pt)("Payments")}])],decls:4,vars:3,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap",4,"ngIf"],["fxLayout","row",4,"ngIf"],["fxLayout","column","fxLayoutAlign","start stretch",4,"ngIf"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap"],["sendPaymentForm","ngForm"],["fxFlex","100"],["matInput","","placeholder","Payment Request","name","paymentRequest","tabindex","1","required","",3,"perfectScrollbar","ngModel","ngModelChange","matTextareaAutosize"],["paymentReq","ngModel"],[4,"ngIf"],["fxLayout","row",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","2","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","3",3,"click"],["fxLayout","row"],["fxLayout","column","fxLayoutAlign","start stretch"],["fxLayout","column","fxLayoutAlign","start stretch","fxLayout.gt-sm","row wrap",1,"page-sub-title-container","mt-1"],["fxFlex","70","fxLayoutAlign","start start","fxLayoutAlign.gt-sm","start center"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxFlex","30","fxLayoutAlign","start end"],["matInput","","placeholder","Filter",3,"ngModel","keyup","ngModelChange"],["fxLayout","row","fxLayoutAlign","start start"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","firstPartTimestamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","id"],["matColumnDef","recipientNodeAlias"],["matColumnDef","recipientAmount"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","actions"],["mat-header-cell","","class","px-3",4,"matHeaderCellDef"],["mat-cell","","class","px-3","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_payment"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["matColumnDef","groupTotal"],["matColumnDef","groupId"],["matColumnDef","groupChannelAlias"],["matColumnDef","groupAmount"],["matColumnDef","groupAction"],["mat-cell","","class","px-3",4,"matCellDef"],["mat-row","",4,"matRowDef","matRowDefColumns","matRowDefWhen"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell","",1,"px-3"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"px-3"],["mat-stroked-button","","color","primary","type","button","tabindex","4",3,"click"],["mat-footer-cell","","colspan","4"],["fxLayoutAlign","start center",1,"part-row-span"],["fxLayoutAlign","start center","class","part-row-span pl-3",4,"ngFor","ngForOf"],["fxLayoutAlign","start center",1,"part-row-span","pl-3"],["fxLayoutAlign","start center",1,"ellipsis-parent","part-row-span",3,"ngStyle"],["fxLayoutAlign","start center","class","part-row-span",4,"ngFor","ngForOf"],["fxLayoutAlign","end center",1,"part-row-span"],["fxLayoutAlign","end center","class","part-row-span",4,"ngFor","ngForOf"],["mat-cell","",1,"px-3"],["fxLayoutAlign","end start"],["mat-flat-button","","color","primary","type","button","tabindex","5",1,"btn-part-expand",3,"click"],["fxLayoutAlign","end start",4,"ngFor","ngForOf"],["mat-stroked-button","","color","primary","type","button","tabindex","6",1,"btn-part-info",3,"click"],["mat-row",""],["mat-footer-row","",3,"ngClass"],["mat-header-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.YNc(1,Zn,12,3,"form",1),t.YNc(2,Tn,3,0,"div",2),t.YNc(3,si,45,17,"div",3),t.qZA()),2&e&&(t.xp6(1),t.Q6J("ngIf","home"===i.calledFrom),t.xp6(1),t.Q6J("ngIf","transactions"===i.calledFrom),t.xp6(1),t.Q6J("ngIf","transactions"===i.calledFrom))},directives:[p.xw,p.yH,p.Wh,u.O5,m._Y,m.JL,m.F,y.KE,U.Nt,m.Fj,m.Q7,Q.$V,m.JJ,m.On,q.lW,y.bx,y.TO,I.BN,r.BZ,A.YE,u.mk,w.oO,r.w1,r.fO,r.Dz,r.mD,r.nj,r.Ke,r.as,v.NW,M.pW,r.ge,A.nU,r.ev,u.PC,w.Zl,P.gD,P.$L,Y.ey,r.yh,u.sg,r.Gk,r.Q2,r.XQ],pipes:[u.uU,u.JJ],styles:[".mat-column-id[_ngcontent-%COMP%], .mat-column-recipientNodeAlias[_ngcontent-%COMP%], .mat-column-groupId[_ngcontent-%COMP%], .mat-column-groupChannelAlias[_ngcontent-%COMP%]{padding:0 1rem;flex:0 0 25%;width:25%}.mat-column-id[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%], .mat-column-recipientNodeAlias[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%], .mat-column-groupId[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%], .mat-column-groupChannelAlias[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%]{display:flex}.mat-column-actions[_ngcontent-%COMP%], .mat-column-groupAction[_ngcontent-%COMP%]{min-height:4.8rem}.mat-column-groupAction[_ngcontent-%COMP%] .btn-part-expand[_ngcontent-%COMP%]{width:9rem}.mat-column-groupAction[_ngcontent-%COMP%] .btn-part-info[_ngcontent-%COMP%]{margin-top:.5rem;width:9rem}.part-row-span[_ngcontent-%COMP%]{min-height:4.2rem;place-content:center flex-start;align-items:center}.mat-column-groupTotal[_ngcontent-%COMP%]{min-width:15rem}"]}),n})();function li(n,a){if(1&n&&(t.TgZ(0,"button",26),t.TgZ(1,"mat-icon"),t._uU(2,"more_vert"),t.qZA(),t.qZA()),2&n){t.oxw();const e=t.MAs(11);t.Q6J("matMenuTriggerFor",e)}}function ri(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",27),t.NdJ("click",function(){const s=t.CHM(e).index,c=t.oxw().$implicit;return t.oxw(2).onNavigateTo(c.links[s])}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit;t.xp6(1),t.Oqu(e)}}function ci(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",27),t.NdJ("click",function(){return t.CHM(e),t.oxw(3).onsortChannelsBy()}),t._uU(1),t.qZA()}if(2&n){const e=t.oxw(3);t.xp6(1),t.hij("Sort By ","Balance Score"===e.sortField?"Capacity":"Balance Score","")}}function ui(n,a){1&n&&t._UZ(0,"mat-progress-bar",28)}function pi(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 mi(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 di(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 hi(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 gi(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 _i(n,a){1&n&&(t.TgZ(0,"h3"),t._uU(1,"Error! Unable to find information!"),t.qZA())}const Ct=function(n){return{"dashboard-card-content":!0,"error-border":n}};function fi(n,a){if(1&n&&(t.TgZ(0,"mat-grid-tile",8),t.TgZ(1,"mat-card",9),t.TgZ(2,"mat-card-header"),t.TgZ(3,"mat-card-title",10),t.TgZ(4,"div"),t._UZ(5,"fa-icon",11),t.TgZ(6,"span"),t._uU(7),t.qZA(),t.qZA(),t.TgZ(8,"div"),t.YNc(9,li,3,1,"button",12),t.TgZ(10,"mat-menu",13,14),t.YNc(12,ri,2,1,"button",15),t.YNc(13,ci,2,1,"button",16),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"mat-card-content",17),t.YNc(15,ui,1,0,"mat-progress-bar",18),t.TgZ(16,"div",19),t.YNc(17,pi,1,2,"rtl-ecl-node-info",20),t.YNc(18,mi,1,2,"rtl-ecl-balances-info",21),t.YNc(19,di,1,4,"rtl-ecl-channel-capacity-info",22),t.YNc(20,hi,1,2,"rtl-ecl-fee-info",23),t.YNc(21,gi,1,2,"rtl-ecl-channel-status-info",24),t.YNc(22,_i,2,0,"h3",25),t.qZA(),t.qZA(),t.qZA(),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,Ct,"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 Ci(n,a){if(1&n&&(t.TgZ(0,"div",2),t.TgZ(1,"div",3),t._UZ(2,"fa-icon",4),t.TgZ(3,"span",5),t._uU(4),t.qZA(),t.qZA(),t.TgZ(5,"mat-grid-list",6),t.YNc(6,fi,23,18,"mat-grid-tile",7),t.qZA(),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 xi(n,a){if(1&n&&(t.TgZ(0,"button",26),t.TgZ(1,"mat-icon"),t._uU(2,"more_vert"),t.qZA(),t.qZA()),2&n){t.oxw();const e=t.MAs(9);t.Q6J("matMenuTriggerFor",e)}}function yi(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",27),t.NdJ("click",function(){const s=t.CHM(e).index,c=t.oxw(2).$implicit;return t.oxw(2).onNavigateTo(c.links[s])}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit;t.xp6(1),t.Oqu(e)}}function Zi(n,a){if(1&n&&(t.TgZ(0,"mat-card-header"),t.TgZ(1,"mat-card-title",10),t.TgZ(2,"div"),t._UZ(3,"fa-icon",11),t.TgZ(4,"span"),t._uU(5),t.qZA(),t.qZA(),t.TgZ(6,"div"),t.YNc(7,xi,3,1,"button",12),t.TgZ(8,"mat-menu",13,42),t.YNc(10,yi,2,1,"button",15),t.qZA(),t.qZA(),t.qZA(),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 Ti(n,a){1&n&&t._UZ(0,"mat-progress-bar",28)}function Ai(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 Li(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 vi(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 bi(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 Si(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",27),t.NdJ("click",function(){const s=t.CHM(e).index,c=t.oxw(3).$implicit;return t.oxw(2).onNavigateTo(c.links[s])}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit;t.xp6(1),t.Oqu(e)}}function wi(n,a){if(1&n&&(t.TgZ(0,"button",26),t.TgZ(1,"mat-icon"),t._uU(2,"more_vert"),t.qZA(),t.qZA(),t.TgZ(3,"mat-menu",13,53),t.YNc(5,Si,2,1,"button",15),t.qZA()),2&n){const e=t.MAs(4),i=t.oxw(2).$implicit;t.Q6J("matMenuTriggerFor",e),t.xp6(5),t.Q6J("ngForOf",i.goToOptions)}}function Ei(n,a){1&n&&(t.TgZ(0,"span",45),t.TgZ(1,"mat-tab-group",46),t.TgZ(2,"mat-tab",47),t._UZ(3,"rtl-ecl-lightning-invoices",48),t.qZA(),t.TgZ(4,"mat-tab",49),t._UZ(5,"rtl-ecl-lightning-payments",50),t.qZA(),t.TgZ(6,"mat-tab",51),t.YNc(7,wi,6,2,"ng-template",52),t.qZA(),t.qZA(),t.qZA()),2&n&&(t.xp6(3),t.Q6J("calledFrom","home"),t.xp6(2),t.Q6J("calledFrom","home"),t.xp6(1),t.Q6J("disabled",!0))}function qi(n,a){1&n&&(t.TgZ(0,"h3"),t._uU(1,"Error! Unable to find information!"),t.qZA())}const Ii=function(n){return{"p-0":n}};function Oi(n,a){if(1&n&&(t.TgZ(0,"mat-grid-tile",8),t.TgZ(1,"mat-card",36),t.YNc(2,Zi,11,4,"mat-card-header",37),t.TgZ(3,"mat-card-content",38),t.YNc(4,Ti,1,0,"mat-progress-bar",18),t.TgZ(5,"div",19),t.YNc(6,Ai,1,1,"rtl-ecl-node-info",39),t.YNc(7,Li,1,2,"rtl-ecl-balances-info",21),t.YNc(8,vi,1,4,"rtl-ecl-channel-liquidity-info",40),t.YNc(9,bi,1,4,"rtl-ecl-channel-liquidity-info",40),t.YNc(10,Ei,8,3,"span",41),t.YNc(11,qi,2,0,"h3",25),t.qZA(),t.qZA(),t.qZA(),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,Ii,"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,Ct,"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 Fi(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.qZA(),t.TgZ(4,"mat-grid-list",35),t.YNc(5,Oi,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 Ri=(()=>{class n{constructor(e,i,o,s){this.logger=e,this.store=i,this.commonService=o,this.router=s,this.faSmile=pt.I3,this.faFrown=pt.Kf,this.faAngleDoubleDown=Z.Sbq,this.faAngleDoubleUp=Z.Vfw,this.faChartPie=Z.OS1,this.faBolt=Z.BDt,this.faServer=Z.xf3,this.faNetworkWired=Z.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="330px",this.merchantCardHeight="65px",this.sortField="Balance Score",this.errorMessages=["","","",""],this.apiCallStatusNodeInfo={status:l.Bn.COMPLETED},this.apiCallStatusFees={status:l.Bn.COMPLETED},this.apiCallStatusOCBal={status:l.Bn.COMPLETED},this.apiCallStatusAllChannels={status:l.Bn.COMPLETED},this.apiCallStatusEnum=l.Bn,this.unSubs=[new d.x,new d.x,new d.x,new d.x,new d.x,new d.x,new d.x,new d.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.pg).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e}),this.store.select(C.T$).pipe((0,h.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.information=e.information}),this.store.select(C.JG).pipe((0,h.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.fees=e.fees}),this.store.select(C.Xz).pipe((0,h.R)(this.unSubs[3]),(0,et.M)(this.store.select(C.kY))).subscribe(([e,i])=>{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.apiCallStatusOCBal.status===l.Bn.ERROR&&(this.errorMessages[3]="object"==typeof this.apiCallStatusOCBal.message?JSON.stringify(this.apiCallStatusOCBal.message):this.apiCallStatusOCBal.message),this.channels=e.activeChannels,this.onchainBalance=i.onchainBalance,this.balances.onchain=this.onchainBalance.total,this.balances.lightning=e.lightningBalance.localBalance,this.balances.total=this.balances.lightning+this.balances.onchain,this.balances=Object.assign({},this.balances);const o=e.lightningBalance.localBalance?+e.lightningBalance.localBalance:0,s=e.lightningBalance.remoteBalance?+e.lightningBalance.remoteBalance:0;this.channelBalances={localBalance:o,remoteBalance:s,balancedness:+(1-Math.abs((o-s)/(o+s))).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(this.channels.filter(_=>_.toRemote>0),"toRemote"))),this.allOutboundChannels=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.channels.filter(_=>_.toLocal>0),"toLocal"))),this.channels.forEach(_=>{this.totalInboundLiquidity=this.totalInboundLiquidity+Math.ceil(_.toRemote),this.totalOutboundLiquidity=this.totalOutboundLiquidity+Math.floor(_.toLocal)}),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+ +e.toRemote,s=+i.toLocal+ +i.toRemote;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(F.mQ),t.Y36(S.yh),t.Y36(R.v),t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-home"]],decls:3,vars:2,consts:[["fxLayout","column",4,"ngIf","ngIfElse"],["merchantDashboard",""],["fxLayout","column"],["fxLayout","row","fxLayoutAlign","start start",1,"page-title-container","mb-0"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["cols","10",3,"rowHeight"],[3,"colspan","rowspan",4,"ngFor","ngForOf"],[3,"colspan","rowspan"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",1,"h-100","dashboard-card","mt-4"],["fxLayoutAlign","space-between center"],[1,"mr-1",3,"icon"],["mat-icon-button","","class","more-button","aria-label","Toggle menu",3,"matMenuTriggerFor",4,"ngIf"],["xPosition","before",1,"dashboard-vert-menu"],["menuOperator","matMenu"],["mat-menu-item","",3,"click",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-0"],["cols","6",3,"rowHeight"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",1,"h-100","dashboard-card","mt-4",3,"ngClass"],[4,"ngIf"],["fxLayout","column","fxLayoutAlign","start stretch",3,"fxFlex","ngClass"],["fxFlex","100",3,"information",4,"ngSwitchCase"],["fxFlex","100",3,"direction","totalLiquidity","allChannels","errorMessage",4,"ngSwitchCase"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between start",4,"ngSwitchCase"],["menuMerchant","matMenu"],["fxFlex","100",3,"information"],["fxFlex","100",3,"direction","totalLiquidity","allChannels","errorMessage"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between start"],["fxLayout","column",1,"w-100","dashboard-tabs-group"],["label","Receive"],[1,"h-100",3,"calledFrom"],["label","Pay"],[3,"calledFrom"],[3,"disabled"],["mat-tab-label",""],["menuTransactions","matMenu"]],template:function(e,i){if(1&e&&(t.YNc(0,Ci,7,4,"div",0),t.YNc(1,Fi,6,4,"ng-template",null,1,t.W1O)),2&e){const o=t.MAs(2);t.Q6J("ngIf",(null==i.selNode?null:i.selNode.userPersona)===i.userPersonaEnum.OPERATOR)("ngIfElse",o)}},directives:[u.O5,p.xw,p.Wh,I.BN,mt.Il,u.sg,mt.DX,T.a8,p.yH,T.dk,T.n5,nt.VK,T.dn,u.mk,w.oO,u.RF,u.n9,u.ED,q.lW,nt.p6,dt.Hw,nt.OP,M.pW,Jt,Ht,Kt,ee,ae,Ce,k.SP,k.uX,gt,ft,k.uD],styles:[""]}),n})();var Ni=g(8377);const ki=["form"];function Pi(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Bitcoin address is required."),t.qZA())}function Di(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 Ui(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 Mi(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Target Confirmation Blocks is required."),t.qZA())}function Ji(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 Qi(n,a){if(1&n&&(t.TgZ(0,"div",30),t._UZ(1,"fa-icon",31),t.YNc(2,Ji,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 xt=(()=>{class n{constructor(e,i,o,s,c,_){this.dialogRef=e,this.logger=i,this.store=o,this.commonService=s,this.decimalPipe=c,this.actions=_,this.faExclamationTriangle=Z.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 d.x,new d.x,new d.x,new d.x,new d.x]}ngOnInit(){this.store.select(Ni.dT).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.fiatConversion=e.settings.fiatConversion,this.amountUnits=e.settings.currencyUnits,this.logger.info(e)}),this.actions.pipe((0,h.R)(this.unSubs[1]),(0,J.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,b.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,h.R)(this.unSubs[2])).subscribe({next:e=>{this.transaction.amount=parseInt(e[l.NT.SATS]),this.selAmountUnit=l.NT.SATS,this.store.dispatch((0,N.Iy)({payload:this.transaction}))},error:e=>{this.transaction.amount=null,this.selAmountUnit=l.NT.SATS,this.amountError="Conversion Error: "+e}}):this.store.dispatch((0,N.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,h.R)(this.unSubs[3])).subscribe({next:c=>{this.selAmountUnit=e.value,i.transaction.amount=+i.decimalPipe.transform(c[s],i.currencyUnitFormats[s]).replace(/,/g,"")},error:c=>{i.transaction.amount=null,this.amountError="Conversion Error: "+c,this.selAmountUnit=o,s=o}})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(D.so),t.Y36(F.mQ),t.Y36(S.yh),t.Y36(R.v),t.Y36(u.JJ),t.Y36(z.eX))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-on-chain-send-modal"]],viewQuery:function(e,i){if(1&e&&t.Gf(ki,7),2&e){let o;t.iGM(o=t.CRH())&&(i.form=o.first)}},decls:36,vars:15,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","8","fxFlex","5","fxLayoutAlign","center","default","","mat-button","",1,"btn-close-x","p-0",3,"mat-dialog-close"],[1,"padding-gap-x-large"],["fxLayout","row wrap","fxFlex","100","fxLayoutAlign","space-between start",1,"overflow-x-hidden",3,"submit","reset"],["form","ngForm"],["fxFlex","55"],["matInput","","autoFocus","","placeholder","Bitcoin Address","tabindex","1","name","addr","required","",3,"ngModel","ngModelChange"],["addrs","ngModel"],[4,"ngIf"],["fxFlex","30"],["matInput","","placeholder","Amount","name","amt","type","number","tabindex","2","required","",3,"ngModel","step","min","ngModelChange"],["amnt","ngModel"],["matSuffix",""],["fxFlex","10","fxLayoutAlign","start end"],["tabindex","3","required","","name","amountUnit",3,"value","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["fxFlex","60","fxLayoutAlign","space-between stretch","fxLayout","row wrap"],["fxFlex","48","fxLayout","row","fxLayoutAlign","start center"],["matInput","","placeholder","Target Confirmation Blocks","type","number","name","blocks","tabindex","8","required","true",3,"ngModel","step","min","ngModelChange"],["blocks","ngModel"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center"],["mat-button","","color","primary","tabindex","7","type","reset",1,"mr-1"],["mat-button","","color","primary","type","submit","tabindex","8"],[3,"value"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.TgZ(1,"div",1),t.TgZ(2,"mat-card-header",2),t.TgZ(3,"div",3),t.TgZ(4,"span",4),t._uU(5,"Send Payment"),t.qZA(),t.qZA(),t.TgZ(6,"button",5),t._uU(7,"X"),t.qZA(),t.qZA(),t.TgZ(8,"mat-card-content",6),t.TgZ(9,"form",7,8),t.NdJ("submit",function(){return i.onSendFunds()})("reset",function(){return i.resetData()}),t.TgZ(11,"mat-form-field",9),t.TgZ(12,"input",10,11),t.NdJ("ngModelChange",function(s){return i.transaction.address=s}),t.qZA(),t.YNc(14,Pi,2,0,"mat-error",12),t.qZA(),t.TgZ(15,"mat-form-field",13),t.TgZ(16,"input",14,15),t.NdJ("ngModelChange",function(s){return i.transaction.amount=s}),t.qZA(),t.TgZ(18,"span",16),t._uU(19),t.qZA(),t.YNc(20,Di,2,1,"mat-error",12),t.qZA(),t.TgZ(21,"mat-form-field",17),t.TgZ(22,"mat-select",18),t.NdJ("selectionChange",function(s){return i.onAmountUnitChange(s)}),t.YNc(23,Ui,2,2,"mat-option",19),t.qZA(),t.qZA(),t.TgZ(24,"div",20),t.TgZ(25,"mat-form-field",21),t.TgZ(26,"input",22,23),t.NdJ("ngModelChange",function(s){return i.transaction.blocks=s}),t.qZA(),t.YNc(28,Mi,2,0,"mat-error",12),t.qZA(),t.qZA(),t._UZ(29,"div",24),t.YNc(30,Qi,3,2,"div",25),t.TgZ(31,"div",26),t.TgZ(32,"button",27),t._uU(33,"Clear Fields"),t.qZA(),t.TgZ(34,"button",28),t._uU(35,"Send Funds"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.xp6(6),t.Q6J("mat-dialog-close",!1),t.xp6(6),t.Q6J("ngModel",i.transaction.address),t.xp6(2),t.Q6J("ngIf",!i.transaction.address),t.xp6(2),t.Q6J("ngModel",i.transaction.amount)("step",100)("min",0),t.xp6(3),t.hij(" ",i.selAmountUnit," "),t.xp6(1),t.Q6J("ngIf",!i.transaction.amount),t.xp6(2),t.Q6J("value",i.selAmountUnit),t.xp6(1),t.Q6J("ngForOf",i.amountUnits),t.xp6(3),t.Q6J("ngModel",i.transaction.blocks)("step",1)("min",0),t.xp6(2),t.Q6J("ngIf",!i.transaction.blocks),t.xp6(2),t.Q6J("ngIf",""!==i.sendFundError))},directives:[p.xw,p.yH,T.dk,p.Wh,q.lW,D.ZT,T.dn,m._Y,m.JL,m.F,y.KE,U.Nt,m.Fj,X.h,m.Q7,m.JJ,m.On,u.O5,m.wV,m.qQ,$.q,y.R9,P.gD,u.sg,y.TO,Y.ey,I.BN],styles:[""]}),n})();var ot=g(1203);function Yi(n,a){1&n&&t._UZ(0,"mat-progress-bar",31)}function Hi(n,a){1&n&&(t.TgZ(0,"th",32),t._uU(1," Date/Time "),t.qZA())}function Bi(n,a){if(1&n&&(t.TgZ(0,"td",33),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*e.timestamp,"dd/MMM/y HH:mm"))}}function zi(n,a){1&n&&(t.TgZ(0,"th",34),t._uU(1," Amount (Sats) "),t.qZA())}function Vi(n,a){if(1&n&&(t.TgZ(0,"span",37),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,e.amount))}}function Gi(n,a){if(1&n&&(t.TgZ(0,"span",38),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*e.amount),")")}}function Xi(n,a){if(1&n&&(t.TgZ(0,"td",33),t.YNc(1,Vi,3,3,"span",35),t.YNc(2,Gi,3,3,"span",36),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Q6J("ngIf",e.amount>0||0===e.amount),t.xp6(1),t.Q6J("ngIf",e.amount<0)}}function $i(n,a){1&n&&(t.TgZ(0,"th",34),t._uU(1," Fees (Sats) "),t.qZA())}function Wi(n,a){if(1&n&&(t.TgZ(0,"td",33),t.TgZ(1,"span",37),t._uU(2),t.ALo(3,"number"),t.qZA(),t.qZA()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.fees))}}function Ki(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1," Confirmations "),t.qZA())}function ji(n,a){if(1&n&&(t.TgZ(0,"td",40),t.TgZ(1,"span",37),t._uU(2),t.ALo(3,"number"),t.qZA(),t.qZA()),2&n){const e=a.$implicit;t.xp6(2),t.hij(" ",t.lcZ(3,1,null==e?null:e.confirmations)," ")}}function ta(n,a){1&n&&(t.TgZ(0,"th",32),t._uU(1," Address "),t.qZA())}function ea(n,a){if(1&n&&(t.TgZ(0,"td",33),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(e.address)}}function na(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",41),t.TgZ(1,"div",42),t.TgZ(2,"mat-select",43),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",44),t.NdJ("click",function(){return t.CHM(e),t.oxw().onDownloadCSV()}),t._uU(5,"Download CSV"),t.qZA(),t.qZA(),t.qZA(),t.qZA()}}function ia(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",45),t.TgZ(1,"button",46),t.NdJ("click",function(o){const c=t.CHM(e).$implicit;return t.oxw().onTransactionClick(c,o)}),t._uU(2,"View Info"),t.qZA(),t.qZA()}}function aa(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No transaction available."),t.qZA())}function oa(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting transactions..."),t.qZA())}function sa(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 la(n,a){if(1&n&&(t.TgZ(0,"td",47),t.YNc(1,aa,2,0,"p",48),t.YNc(2,oa,2,0,"p",48),t.YNc(3,sa,2,1,"p",48),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 ra=function(n){return{"display-none":n}};function ca(n,a){if(1&n&&t._UZ(0,"tr",49),2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,ra,(null==e.listTransactions?null:e.listTransactions.data)&&(null==e.listTransactions||null==e.listTransactions.data?null:e.listTransactions.data.length)>0))}}function ua(n,a){1&n&&t._UZ(0,"tr",50)}function pa(n,a){1&n&&t._UZ(0,"tr",51)}const ma=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},da=function(){return["no_transaction"]};let ha=(()=>{class n{constructor(e,i,o,s){this.logger=e,this.commonService=i,this.store=o,this.datePipe=s,this.faHistory=Z.qO$,this.displayedColumns=[],this.flgSticky=!1,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.unsub=[new d.x,new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===l.cu.XS?(this.flgSticky=!1,this.displayedColumns=["timestamp","amount","actions"]):this.screenSize===l.cu.SM?(this.flgSticky=!1,this.displayedColumns=["timestamp","amount","confirmations","fees","actions"]):this.screenSize===l.cu.MD?(this.flgSticky=!1,this.displayedColumns=["timestamp","amount","fees","confirmations","address","actions"]):(this.flgSticky=!0,this.displayedColumns=["timestamp","amount","fees","confirmations","address","actions"])}ngOnInit(){this.store.dispatch((0,N.mC)()),this.store.select(C.dx).pipe((0,h.R)(this.unsub[0])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage="object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message),e.transactions&&this.loadTransactionsTable(e.transactions),this.logger.info(e)})}applyFilter(){this.listTransactions.filter=this.selFilter.trim().toLowerCase()}onTransactionClick(e,i){this.store.dispatch((0,b.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 r.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.filterPredicate=(i,o)=>((i.timestamp?this.datePipe.transform(new Date(1e3*i.timestamp),"dd/MMM/YYYY HH:mm").toLowerCase():"")+JSON.stringify(i).toLowerCase()).includes(o),this.listTransactions.paginator=this.paginator,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.unsub.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(F.mQ),t.Y36(R.v),t.Y36(S.yh),t.Y36(u.uU))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-on-chain-transaction-history"]],viewQuery:function(e,i){if(1&e&&(t.Gf(A.YE,5),t.Gf(v.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:v.ye,useValue:(0,l.pt)("Transactions")}])],decls:37,vars:15,consts:[["fxLayout","row wrap","fxLayoutAlign","start start","fxLayout.gt-sm","column","fxFlex","100","fxLayoutAlign.gt-sm","start stretch"],["fxLayout","column","fxLayout.gt-xs","row wrap","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxFlex","30"],["matInput","","placeholder","Filter",3,"ngModel","keyup","ngModelChange"],["fxLayout","row","fxLayoutAlign","start start"],["fxLayout","column","fxLayoutAlign","start end","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","timestamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","amount"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","fees"],["matColumnDef","confirmations"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","class","pr-2",4,"matHeaderCellDef"],["mat-cell","","class","pr-2",4,"matCellDef"],["matColumnDef","address"],["matColumnDef","actions"],["mat-header-cell","","class","px-3",4,"matHeaderCellDef"],["mat-cell","","class","pl-3","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_transaction"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center",4,"ngIf"],["fxLayoutAlign","end center","class","red",4,"ngIf"],["fxLayoutAlign","end center"],["fxLayoutAlign","end center",1,"red"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",1,"pr-2"],["mat-cell","",1,"pr-2"],["mat-header-cell","",1,"px-3"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"pl-3"],["mat-stroked-button","","color","primary","type","button","tabindex","4",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.TgZ(1,"div",1),t.TgZ(2,"div",2),t._UZ(3,"fa-icon",3),t.TgZ(4,"span",4),t._uU(5,"Transaction History"),t.qZA(),t.qZA(),t.TgZ(6,"mat-form-field",5),t.TgZ(7,"input",6),t.NdJ("keyup",function(){return i.applyFilter()})("ngModelChange",function(s){return i.selFilter=s}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(8,"div",7),t.TgZ(9,"div",8),t.YNc(10,Yi,1,0,"mat-progress-bar",9),t.TgZ(11,"table",10,11),t.ynx(13,12),t.YNc(14,Hi,2,0,"th",13),t.YNc(15,Bi,3,4,"td",14),t.BQk(),t.ynx(16,15),t.YNc(17,zi,2,0,"th",16),t.YNc(18,Xi,3,2,"td",14),t.BQk(),t.ynx(19,17),t.YNc(20,$i,2,0,"th",16),t.YNc(21,Wi,4,3,"td",14),t.BQk(),t.ynx(22,18),t.YNc(23,Ki,2,0,"th",19),t.YNc(24,ji,4,3,"td",20),t.BQk(),t.ynx(25,21),t.YNc(26,ta,2,0,"th",13),t.YNc(27,ea,2,1,"td",14),t.BQk(),t.ynx(28,22),t.YNc(29,na,6,0,"th",23),t.YNc(30,ia,3,0,"td",24),t.BQk(),t.ynx(31,25),t.YNc(32,la,4,3,"td",26),t.BQk(),t.YNc(33,ca,1,3,"tr",27),t.YNc(34,ua,1,0,"tr",28),t.YNc(35,pa,1,0,"tr",29),t.qZA(),t._UZ(36,"mat-paginator",30),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.xp6(3),t.Q6J("icon",i.faHistory),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("dataSource",i.listTransactions)("ngClass",t.VKq(12,ma,""!==i.errorMessage)),t.xp6(22),t.Q6J("matFooterRowDef",t.DdM(14,da)),t.xp6(1),t.Q6J("matHeaderRowDef",i.displayedColumns)("matHeaderRowDefSticky",i.flgSticky),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumns),t.xp6(1),t.Q6J("pageSize",i.pageSize)("pageSizeOptions",i.pageSizeOptions)("showFirstLastButtons",i.screenSize!==i.screenSizeEnum.XS))},directives:[p.xw,p.Wh,p.yH,I.BN,y.KE,U.Nt,m.Fj,m.JJ,m.On,Q.$V,u.O5,r.BZ,A.YE,u.mk,w.oO,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,v.NW,M.pW,r.ge,A.nU,r.ev,P.gD,P.$L,Y.ey,q.lW,r.yh,r.Q2,r.XQ,r.Gk],pipes:[u.uU,u.JJ],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),n})();function ga(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",12),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw().activeLink=s.link}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit,i=t.oxw();t.s9C("routerLink",e.link),t.Q6J("active",i.activeLink===e.link),t.xp6(1),t.Oqu(e.name)}}let _a=(()=>{class n{constructor(e,i){this.store=e,this.router=i,this.selNode={},this.faExchangeAlt=Z.Ssp,this.faChartPie=Z.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 d.x,new d.x,new d.x,new d.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,h.R)(this.unSubs[0]),(0,J.h)(i=>i instanceof x.Av)).subscribe({next:i=>{const o=this.links.find(s=>i.urlAfterRedirects.includes(s.link));this.activeLink=o?o.link:this.links[0].link}}),this.store.select(C.pg).pipe((0,h.R)(this.unSubs[1])).subscribe(i=>{this.selNode=i}),this.store.select(C.kY).pipe((0,h.R)(this.unSubs[2])).subscribe(i=>{this.balances=[{title:"Total Balance",dataValue:i.onchainBalance.total||0},{title:"Confirmed",dataValue:i.onchainBalance.confirmed},{title:"Unconfirmed",dataValue:i.onchainBalance.unconfirmed}]})}openSendFundsModal(){this.store.dispatch((0,b.qR)({payload:{data:{component:xt}}}))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(S.yh),t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-on-chain"]],decls:21,vars:4,consts:[["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x","mb-4"],["fxLayout","column"],[3,"values"],["fxLayout","column",1,"padding-gap-x"],["mat-tab-nav-bar",""],["role","tab","mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x-large","mt-2"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x-large"],["fxLayout","row","fxFlex","100"],["role","tab","mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t._UZ(1,"fa-icon",1),t.TgZ(2,"span",2),t._uU(3,"On-chain Balance"),t.qZA(),t.qZA(),t.TgZ(4,"div",3),t.TgZ(5,"mat-card"),t.TgZ(6,"mat-card-content",4),t._UZ(7,"rtl-currency-unit-converter",5),t.qZA(),t.qZA(),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.qZA(),t.TgZ(12,"div",6),t.TgZ(13,"mat-card"),t.TgZ(14,"mat-card-content",4),t.TgZ(15,"nav",7),t.YNc(16,ga,2,3,"div",8),t.qZA(),t.TgZ(17,"div",9),t._UZ(18,"router-outlet"),t.qZA(),t.TgZ(19,"div",10),t._UZ(20,"rtl-ecl-on-chain-transaction-history",11),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.xp6(1),t.Q6J("icon",i.faChartPie),t.xp6(6),t.Q6J("values",i.balances),t.xp6(2),t.Q6J("icon",i.faExchangeAlt),t.xp6(7),t.Q6J("ngForOf",i.links))},directives:[p.xw,p.Wh,I.BN,T.a8,T.dn,ot.D,k.BU,u.sg,p.yH,x.lC,ha,k.Nj,x.rH],styles:[""]}),n})();var yt=g(7544);function fa(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 Ca(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 xa=(()=>{class n{constructor(e,i){this.store=e,this.router=i,this.activePeers=0,this.activeChannels=0,this.faUsers=Z.FVb,this.faChartPie=Z.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 d.x,new d.x,new d.x,new d.x]}ngOnInit(){this.activeLink=this.links.findIndex(e=>e.link===this.router.url.substring(this.router.url.lastIndexOf("/")+1)),this.router.events.pipe((0,h.R)(this.unSubs[0]),(0,J.h)(e=>e instanceof x.Av)).subscribe({next:e=>{this.activeLink=this.links.findIndex(i=>i.link===e.urlAfterRedirects.substring(e.urlAfterRedirects.lastIndexOf("/")+1))}}),this.store.select(C.Bo).pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.activePeers=e.peers&&e.peers.length?e.peers.length:0}),this.store.select(C.Xz).pipe((0,h.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,h.R)(this.unSubs[3])).subscribe(e=>{this.balances=[{title:"Total Balance",dataValue:e.onchainBalance.total||0},{title:"Confirmed",dataValue:e.onchainBalance.confirmed},{title:"Unconfirmed",dataValue:e.onchainBalance.unconfirmed}]})}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(S.yh),t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-connections"]],decls:22,vars:4,consts:[["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x","mb-4"],["fxLayout","column"],[3,"values"],["fxLayout","column",1,"padding-gap-x"],[3,"selectedIndex","selectedIndexChange","selectedTabChange"],["mat-tab-label",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x-large"],["matBadgeOverlap","false",1,"tab-badge",3,"matBadge"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t._UZ(1,"fa-icon",1),t.TgZ(2,"span",2),t._uU(3,"On-chain Balance"),t.qZA(),t.qZA(),t.TgZ(4,"div",3),t.TgZ(5,"mat-card"),t.TgZ(6,"mat-card-content",4),t._UZ(7,"rtl-currency-unit-converter",5),t.qZA(),t.qZA(),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.qZA(),t.TgZ(12,"div",6),t.TgZ(13,"mat-card"),t.TgZ(14,"mat-card-content",4),t.TgZ(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,fa,2,1,"ng-template",8),t.qZA(),t.TgZ(18,"mat-tab"),t.YNc(19,Ca,2,1,"ng-template",8),t.qZA(),t.qZA(),t.TgZ(20,"div",9),t._UZ(21,"router-outlet"),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.xp6(1),t.Q6J("icon",i.faChartPie),t.xp6(6),t.Q6J("values",i.balances),t.xp6(2),t.Q6J("icon",i.faUsers),t.xp6(6),t.Q6J("selectedIndex",i.activeLink))},directives:[p.xw,p.Wh,I.BN,T.a8,T.dn,ot.D,k.SP,k.uX,k.uD,p.yH,x.lC,yt.k],styles:[""]}),n})();function ya(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",11),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw().activeLink=s.link}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit,i=t.oxw();t.s9C("routerLink",e.link),t.Q6J("active",i.activeLink===e.link),t.xp6(1),t.Oqu(e.name)}}let Za=(()=>{class n{constructor(e,i,o){this.logger=e,this.store=i,this.router=o,this.faExchangeAlt=Z.Ssp,this.faChartPie=Z.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 d.x,new d.x,new d.x,new d.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,h.R)(this.unSubs[0]),(0,J.h)(i=>i instanceof x.Av)).subscribe({next:i=>{const o=this.links.find(s=>i.urlAfterRedirects.includes(s.link));this.activeLink=o?o.link:this.links[0].link}}),this.store.select(C.Xz).pipe((0,h.R)(this.unSubs[1]),(0,et.M)(this.store.select(C.pg))).subscribe(([i,o])=>{this.currencyUnits=o.currencyUnits,this.balances=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(F.mQ),t.Y36(S.yh),t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-transactions"]],decls:19,vars:4,consts:[["fxLayout","row wrap","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x","mb-4"],["fxLayout","column"],[3,"values"],["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],["fxLayout","column",1,"padding-gap-x"],["mat-tab-nav-bar",""],["role","tab","mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"mat-tab-body-wrapper"],["role","tab","mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t._UZ(1,"fa-icon",1),t.TgZ(2,"span",2),t._uU(3,"Lightning Balance"),t.qZA(),t.qZA(),t.TgZ(4,"div",3),t.TgZ(5,"mat-card"),t.TgZ(6,"mat-card-content",4),t._UZ(7,"rtl-currency-unit-converter",5),t.qZA(),t.qZA(),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.qZA(),t.TgZ(12,"div",7),t.TgZ(13,"mat-card"),t.TgZ(14,"mat-card-content",4),t.TgZ(15,"nav",8),t.YNc(16,ya,2,3,"div",9),t.qZA(),t.TgZ(17,"div",10),t._UZ(18,"router-outlet"),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.xp6(1),t.Q6J("icon",i.faChartPie),t.xp6(6),t.Q6J("values",i.balances),t.xp6(2),t.Q6J("icon",i.faExchangeAlt),t.xp6(7),t.Q6J("ngForOf",i.links))},directives:[p.xw,p.Wh,I.BN,T.a8,T.dn,ot.D,k.BU,u.sg,p.yH,x.lC,k.Nj,x.rH],styles:[""]}),n})();function Ta(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",11),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw().activeLink=s.link}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit,i=t.oxw();t.s9C("routerLink",e.link),t.Q6J("active",i.activeLink===e.link),t.xp6(1),t.Oqu(e.name)}}let Aa=(()=>{class n{constructor(e){this.router=e,this.faMapSigns=Z.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 d.x,new d.x,new d.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,h.R)(this.unSubs[0]),(0,J.h)(i=>i instanceof x.Av)).subscribe({next:i=>{const o=this.links.find(s=>i.urlAfterRedirects.includes(s.link));this.activeLink=o?o.link:this.links[0].link}})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-routing"]],decls:13,vars:2,consts:[["fxLayout","column"],["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start",1,"padding-gap-x"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch"],["fxLayout","row","fxFlex","100"],["mat-tab-nav-bar","","fxFlex","100"],["role","tab","mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"padding-gap-x-large"],["role","tab","mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.TgZ(1,"div",1),t._UZ(2,"fa-icon",2),t.TgZ(3,"span",3),t._uU(4,"Routing"),t.qZA(),t.qZA(),t.TgZ(5,"div",4),t.TgZ(6,"mat-card",5),t.TgZ(7,"mat-card-content",6),t.TgZ(8,"div",7),t.TgZ(9,"nav",8),t.YNc(10,Ta,2,3,"div",9),t.qZA(),t.qZA(),t.TgZ(11,"div",10),t._UZ(12,"router-outlet"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.xp6(2),t.Q6J("icon",i.faMapSigns),t.xp6(8),t.Q6J("ngForOf",i.links))},directives:[p.xw,p.Wh,I.BN,p.yH,T.a8,T.dn,k.BU,u.sg,x.lC,k.Nj,x.rH],styles:[""]}),n})();var j=g(9814),Zt=g(7261),Tt=g(6895);function La(n,a){if(1&n&&(t.TgZ(0,"span",9),t.TgZ(1,"div"),t._uU(2),t.ALo(3,"titlecase"),t.qZA(),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 va(n,a){1&n&&(t.TgZ(0,"th",24),t._uU(1,"Address"),t.qZA())}function ba(n,a){if(1&n&&(t.TgZ(0,"td",25),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.hij(" ",e," ")}}function Sa(n,a){1&n&&(t.TgZ(0,"th",26),t.TgZ(1,"span",27),t._uU(2,"Actions"),t.qZA(),t.qZA())}function wa(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",28),t.TgZ(1,"span",27),t.TgZ(2,"button",29),t.NdJ("copied",function(o){return t.CHM(e),t.oxw(2).onCopyNodeURI(o)}),t._uU(3,"Copy Node URI"),t.qZA(),t.qZA(),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 Ea(n,a){1&n&&t._UZ(0,"tr",30)}function qa(n,a){1&n&&t._UZ(0,"tr",31)}const Ia=function(n){return{"background-color":n}};function Oa(n,a){if(1&n&&(t.TgZ(0,"div",1),t._UZ(1,"mat-divider",2),t.TgZ(2,"div",3),t.TgZ(3,"div",4),t.TgZ(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.qZA(),t.qZA(),t.TgZ(10,"div",8),t.TgZ(11,"h4",5),t._uU(12,"Pub Key"),t.qZA(),t.TgZ(13,"span",9),t._uU(14),t.qZA(),t.qZA(),t.qZA(),t._UZ(15,"mat-divider",2),t.TgZ(16,"div",3),t.TgZ(17,"div",4),t.TgZ(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.qZA(),t.TgZ(23,"div",8),t.TgZ(24,"h4",5),t._uU(25,"Features"),t.qZA(),t.YNc(26,La,4,4,"span",10),t.ALo(27,"keyvalue"),t.qZA(),t.qZA(),t._UZ(28,"mat-divider",2),t.TgZ(29,"div",3),t.TgZ(30,"div",11),t.TgZ(31,"h4",5),t._uU(32,"Signature"),t.qZA(),t.TgZ(33,"span",6),t._uU(34),t.qZA(),t.qZA(),t.qZA(),t._UZ(35,"mat-divider",2),t.TgZ(36,"div",1),t.TgZ(37,"h4",12),t._uU(38,"Addresses"),t.qZA(),t.TgZ(39,"div",13),t.TgZ(40,"table",14,15),t.ynx(42,16),t.YNc(43,va,2,0,"th",17),t.YNc(44,ba,2,1,"td",18),t.BQk(),t.ynx(45,19),t.YNc(46,Sa,3,0,"th",20),t.YNc(47,wa,4,1,"td",21),t.BQk(),t.YNc(48,Ea,1,0,"tr",22),t.YNc(49,qa,1,0,"tr",23),t.qZA(),t.qZA(),t.qZA(),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,Ia,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 Fa=(()=>{class n{constructor(e,i){this.logger=e,this.snackBar=i,this.lookupResult={},this.displayedColumns=["address","actions"],this.nodeFeaturesEnum=l.H_}ngOnInit(){this.addresses=new r.by(this.lookupResult.addresses?[...this.lookupResult.addresses]:[]),this.addresses.data=this.lookupResult.addresses||[],this.addresses.sort=this.sort,this.addresses.sortingDataAccessor=(e,i)=>e[i]&&isNaN(e[i])?e[i].toLocaleLowerCase():e[i]?+e[i]:null}onCopyNodeURI(e){this.snackBar.open("Node URI copied."),this.logger.info("Copied Text: "+e)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(F.mQ),t.Y36(Zt.ux))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-node-lookup"]],viewQuery:function(e,i){if(1&e&&t.Gf(A.YE,5),2&e){let o;t.iGM(o=t.CRH())&&(i.sort=o.first)}},inputs:{lookupResult:"lookupResult"},decls:1,vars:1,consts:[["fxLayout","column",4,"ngIf"],["fxLayout","column"],[1,"my-1",3,"inset"],["fxLayout","row"],["fxFlex","30"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text"],[1,"ml-2",3,"ngStyle"],["fxFlex","70"],[1,"foreground-secondary-text","w-100"],["class","foreground-secondary-text w-100",4,"ngFor","ngForOf"],["fxFlex","100"],["fxFlex","100","fxLayoutAlign","start",1,"font-bold-500","mb-1"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mat-table","","matSort","",1,"overflow-auto",3,"dataSource"],["table",""],["matColumnDef","address"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","actions"],["mat-header-cell","","class","pl-1",4,"matHeaderCellDef"],["mat-cell","","class","pl-1",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell","",1,"pl-1"],["fxLayoutAlign","end center"],["mat-cell","",1,"pl-1"],["mat-stroked-button","","color","primary","type","button","tabindex","1","rtlClipboard","",3,"payload","copied"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&t.YNc(0,Oa,50,21,"div",0),2&e&&t.Q6J("ngIf",i.lookupResult)},directives:[u.O5,p.xw,G.d,p.yH,p.Wh,u.PC,w.Zl,u.sg,Q.$V,r.BZ,A.YE,r.w1,r.fO,r.Dz,r.as,r.nj,r.ge,A.nU,r.ev,q.lW,Tt.y,r.XQ,r.Gk],pipes:[u.uU,u.Nd,u.rS],styles:[""]}),n})();const Ra=["form"];function Na(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 ka(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 Pa(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 Da(n,a){if(1&n&&(t.TgZ(0,"span",23),t.YNc(1,Pa,2,1,"div",24),t.qZA()),2&n){const e=t.oxw(2),i=t.MAs(21);t.xp6(1),t.Q6J("ngIf",e.nodeLookupValue.nodeId)("ngIfElse",i)}}function Ua(n,a){1&n&&(t.TgZ(0,"span",23),t.TgZ(1,"h3"),t._uU(2,"Error! Unable to find details!"),t.qZA(),t.qZA())}function Ma(n,a){if(1&n&&(t.TgZ(0,"div",17),t.TgZ(1,"div",18),t.TgZ(2,"span",19),t._uU(3),t.qZA(),t.qZA(),t.TgZ(4,"div",20),t.YNc(5,Da,2,2,"span",21),t.YNc(6,Ua,3,0,"span",22),t.qZA(),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 Ja(n,a){1&n&&(t.TgZ(0,"h3"),t._uU(1,"Error! Unable to find details!"),t.qZA())}const Qa=function(n){return{"mt-1":!0,"mt-2":n}};let Ya=(()=>{class n{constructor(e,i,o,s){this.logger=e,this.commonService=i,this.store=o,this.actions=s,this.lookupKeyCtrl=new m.NI,this.nodeLookupValue={},this.channelLookupValue=[],this.flgSetLookupValue=!1,this.messageObj=[],this.selectedFieldId=0,this.lookupFields=[{id:0,name:"Node",placeholder:"Node ID"},{id:1,name:"Channel",placeholder:"Short Channel ID"}],this.flgLoading=[!0],this.faSearch=Z.wn1,this.screenSize="",this.screenSizeEnum=l.cu,this.unSubs=[new d.x,new d.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.actions.pipe((0,h.R)(this.unSubs[0]),(0,J.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,h.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,N.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(F.mQ),t.Y36(R.v),t.Y36(S.yh),t.Y36(z.eX))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-lookups"]],viewQuery:function(e,i){if(1&e&&t.Gf(Ra,7),2&e){let o;t.iGM(o=t.CRH())&&(i.form=o.first)}},decls:22,vars:9,consts:[["fxLayout","column"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start",1,"padding-gap"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxFlex","100","fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign.gt-sm","space-between center","fxLayoutAlign","start space-between",1,"w-100"],["form","ngForm"],["fxFlex","100","fxLayoutAlign","start end"],["color","primary","tabindex","1","name","lookupField"],["checked","",1,"mr-4",3,"value"],["fxFlex","100","fxLayoutAlign","start end",3,"ngClass"],["matInput","","name","lookupKey","tabindex","2","required","",3,"formControl","placeholder"],["key",""],[4,"ngIf"],["fxLayout","row","fxFlex","100",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","3","type","button",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","4","type","submit",3,"click"],["fxFlex","100","fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign.gt-sm","space-between center","fxLayoutAlign","start stretch","class","w-100 mt-2",4,"ngIf"],["errorBlock",""],["fxFlex","100","fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign.gt-sm","space-between center","fxLayoutAlign","start stretch",1,"w-100","mt-2"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start center"],[1,"page-title","font-bold-500"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start center",3,"ngSwitch"],["fxFlex","100",4,"ngSwitchCase"],["fxFlex","100",4,"ngSwitchDefault"],["fxFlex","100"],[4,"ngIf","ngIfElse"],[3,"lookupResult"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.TgZ(1,"div",1),t.TgZ(2,"mat-card-content",2),t.TgZ(3,"form",3,4),t.TgZ(5,"div",5),t.TgZ(6,"mat-radio-group",6),t.TgZ(7,"mat-radio-button",7),t._uU(8,"Node"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(9,"mat-form-field",8),t._UZ(10,"input",9,10),t.YNc(12,Na,2,1,"mat-error",11),t.YNc(13,ka,2,1,"mat-error",11),t.qZA(),t.TgZ(14,"div",12),t.TgZ(15,"button",13),t.NdJ("click",function(){return i.resetData()}),t._uU(16,"Clear"),t.qZA(),t.TgZ(17,"button",14),t.NdJ("click",function(){return i.onLookup()}),t._uU(18,"Lookup"),t.qZA(),t.qZA(),t.qZA(),t.YNc(19,Ma,7,3,"div",15),t.qZA(),t.qZA(),t.qZA(),t.YNc(20,Ja,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,Qa,i.screenSize===i.screenSizeEnum.XS||i.screenSize===i.screenSizeEnum.SM)),t.xp6(1),t.Q6J("formControl",i.lookupKeyCtrl)("placeholder",(null==i.lookupFields[i.selectedFieldId]?null:i.lookupFields[i.selectedFieldId].placeholder)||"Lookup Key"),t.xp6(2),t.Q6J("ngIf",null==i.lookupKeyCtrl.errors?null:i.lookupKeyCtrl.errors.required),t.xp6(1),t.Q6J("ngIf",null==i.lookupKeyCtrl.errors?null:i.lookupKeyCtrl.errors.invalid),t.xp6(6),t.Q6J("ngIf",i.flgSetLookupValue))},directives:[p.xw,p.yH,p.Wh,T.dn,m._Y,m.JL,m.F,j.VQ,j.U0,y.KE,u.mk,w.oO,U.Nt,m.Fj,m.Q7,m.JJ,m.oH,u.O5,q.lW,y.TO,u.RF,u.n9,u.ED,Fa],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}.pl-3[_ngcontent-%COMP%]{padding-left:3rem}"]}),n})();var Ha=g(9122);let Ba=(()=>{class n{constructor(e,i){this.store=e,this.eclEffects=i,this.newAddress=""}onGenerateAddress(){this.store.dispatch((0,N._E)()),this.eclEffects.setNewAddress.pipe((0,B.q)(1)).subscribe(e=>{this.newAddress=e,setTimeout(()=>{this.store.dispatch((0,b.qR)({payload:{data:{address:this.newAddress,addressType:"",component:Ha.n}}}))},0)})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(S.yh),t.Y36(at.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),t.TgZ(1,"div",1),t.TgZ(2,"button",2),t.NdJ("click",function(){return i.onGenerateAddress()}),t._uU(3,"Generate Address"),t.qZA(),t.qZA(),t.qZA())},directives:[p.xw,p.yH,p.Wh,q.lW],styles:[""]}),n})(),za=(()=>{class n{constructor(e,i){this.store=e,this.activatedRoute=i,this.sweepAll=!1,this.unSubs=[new d.x,new d.x]}ngOnInit(){this.activatedRoute.data.pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.sweepAll=e.sweepAll})}openSendFundsModal(){this.store.dispatch((0,b.qR)({payload:{data:{sweepAll:this.sweepAll,component:xt}}}))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(S.yh),t.Y36(x.gz))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-on-chain-send"]],decls:4,vars:1,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row"],["mat-flat-button","","color","primary","type","button","tabindex","1",3,"click"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.TgZ(1,"div",1),t.TgZ(2,"button",2),t.NdJ("click",function(){return i.openSendFundsModal()}),t._uU(3),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.xp6(3),t.Oqu(i.sweepAll?"Sweep All":"Send Funds"))},directives:[p.xw,p.yH,p.Wh,q.lW],styles:[""]}),n})();var Va=g(8675),At=g(4004),Ga=g(9843),Lt=g(2368),vt=g(1079);const Xa=["form"];function $a(n,a){if(1&n&&(t.TgZ(0,"mat-option",34),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 Wa(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Peer alias is required."),t.qZA())}function Ka(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Peer not found in the list."),t.qZA())}function ja(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mat-form-field",1),t.TgZ(1,"input",30),t.NdJ("change",function(){return t.CHM(e),t.oxw().onSelectedPeerChanged()}),t.qZA(),t.TgZ(2,"mat-autocomplete",31,32),t.NdJ("optionSelected",function(){return t.CHM(e),t.oxw().onSelectedPeerChanged()}),t.YNc(4,$a,2,2,"mat-option",33),t.ALo(5,"async"),t.qZA(),t.YNc(6,Wa,2,0,"mat-error",17),t.YNc(7,Ka,2,0,"mat-error",17),t.qZA()}if(2&n){const e=t.MAs(3),i=t.oxw();t.xp6(1),t.Q6J("formControl",i.selectedPeer)("matAutocomplete",e),t.xp6(1),t.Q6J("displayWith",i.displayFn),t.xp6(2),t.Q6J("ngForOf",t.lcZ(5,6,i.filteredPeers)),t.xp6(2),t.Q6J("ngIf",null==i.selectedPeer.errors?null:i.selectedPeer.errors.required),t.xp6(1),t.Q6J("ngIf",null==i.selectedPeer.errors?null:i.selectedPeer.errors.notfound)}}function to(n,a){1&n&&t.GkF(0)}function eo(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Amount is required."),t.qZA())}function no(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 io(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 ao(n,a){if(1&n&&(t.TgZ(0,"div",35),t._UZ(1,"fa-icon",36),t.YNc(2,io,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 oo(n,a){if(1&n&&(t.TgZ(0,"mat-expansion-panel",38),t.TgZ(1,"mat-expansion-panel-header"),t.TgZ(2,"mat-panel-title"),t.TgZ(3,"span"),t._uU(4,"Peer: \xa0"),t.qZA(),t.TgZ(5,"strong",39),t._uU(6),t.qZA(),t.qZA(),t.qZA(),t.TgZ(7,"div",9),t.TgZ(8,"div",0),t.TgZ(9,"div",1),t.TgZ(10,"h4",40),t._uU(11,"Pubkey"),t.qZA(),t.TgZ(12,"span",41),t._uU(13),t.qZA(),t.qZA(),t.qZA(),t._UZ(14,"mat-divider",42),t.TgZ(15,"div",0),t.TgZ(16,"div",43),t.TgZ(17,"h4",40),t._uU(18,"Address"),t.qZA(),t.TgZ(19,"span",44),t._uU(20),t.qZA(),t.qZA(),t.TgZ(21,"div",43),t.TgZ(22,"h4",40),t._uU(23,"State"),t.qZA(),t.TgZ(24,"span",44),t._uU(25),t.ALo(26,"titlecase"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),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 so(n,a){if(1&n&&t.YNc(0,oo,27,6,"mat-expansion-panel",37),2&n){const e=t.oxw();t.Q6J("ngIf",e.peer)}}let bt=(()=>{class n{constructor(e,i,o,s){this.dialogRef=e,this.data=i,this.store=o,this.actions=s,this.selectedPeer=new m.NI,this.faExclamationTriangle=Z.eHv,this.channelConnectionError="",this.advancedTitle="Advanced Options",this.totalBalance=0,this.selectedPubkey="",this.isPrivate=!1,this.feeRate=null,this.unSubs=[new d.x,new d.x]}ngOnInit(){this.information=this.data.message.information,this.totalBalance=this.data.message.balance,this.alertTitle=this.data.alertTitle,this.peer=this.data.message.peer||null,this.peers=this.data.message.peers||[],this.actions.pipe((0,h.R)(this.unSubs[0]),(0,J.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.toLowerCase(),e<i?-1:e>i?1:0)),this.filteredPeers=this.selectedPeer.valueChanges.pipe((0,h.R)(this.unSubs[1]),(0,Va.O)(""),(0,At.U)(o=>"string"==typeof o?o:o.alias?o.alias:o.nodeId),(0,At.U)(o=>o?this.filterPeers(o):this.sortedPeers.slice()))}filterPeers(e){return this.sortedPeers.filter(i=>0===i.alias.toLowerCase().indexOf(e?e.toLowerCase():""))}displayFn(e){return e&&e.alias?e.alias:e&&e.nodeId?e.nodeId:""}onSelectedPeerChanged(){if(this.channelConnectionError="",this.selectedPubkey=this.selectedPeer.value&&this.selectedPeer.value.nodeId?this.selectedPeer.value.nodeId:null,"string"==typeof this.selectedPeer.value){const e=this.peers.filter(i=>i.alias.length===this.selectedPeer.value.length&&0===i.alias.toLowerCase().indexOf(this.selectedPeer.value?this.selectedPeer.value.toLowerCase():""));1===e.length&&e[0].nodeId&&(this.selectedPubkey=e[0].nodeId)}this.selectedPeer.setErrors(this.selectedPeer.value&&!this.selectedPubkey?{notfound:!0}:null)}onClose(){this.dialogRef.close(!1)}resetData(){this.feeRate=null,this.selectedPeer.setValue(""),this.fundingAmount=null,this.isPrivate=!1,this.channelConnectionError="",this.advancedTitle="Advanced Options",this.form.resetForm()}onAdvancedPanelToggle(e){this.advancedTitle=e&&this.feeRate&&this.feeRate>0?"Advanced Options | Fee (Sats/vByte): "+this.feeRate:"Advanced Options"}onOpenChannel(){if(!this.peer&&!this.selectedPubkey||!this.fundingAmount||this.totalBalance-this.fundingAmount<0)return!0;this.store.dispatch((0,N.YX)({payload:{nodeId:this.peer&&this.peer.nodeId?this.peer.nodeId:this.selectedPubkey,amount:this.fundingAmount,private:this.isPrivate,feeRate:this.feeRate}}))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(D.so),t.Y36(D.WI),t.Y36(S.yh),t.Y36(z.eX))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-open-channel"]],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:48,vars:18,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","8","fxFlex","5","fxLayoutAlign","center","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"padding-gap-x-large"],["fxLayout","column",3,"submit","reset"],["form","ngForm"],["fxLayout","column"],["fxFlex","100",4,"ngIf"],[4,"ngTemplateOutlet"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between center"],["fxFlex","70","fxLayoutAlign","start end"],["matInput","","placeholder","Amount","type","number","tabindex","1","required","","name","amount",3,"ngModel","step","min","max","ngModelChange"],["amount","ngModel"],["matSuffix",""],[4,"ngIf"],["fxFlex","25","fxLayoutAlign","start center"],["tabindex","2","color","primary","name","isPrivate",3,"ngModel","ngModelChange"],["expanded","false",1,"flat-expansion-panel","mt-2",3,"closed","opened"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch"],["fxFlex","48","fxLayout","row","fxLayoutAlign","start center"],["matInput","","placeholder","Fee (Sats/vByte)","type","number","name","fee","tabindex","7",3,"ngModel","step","min","ngModelChange"],["fee","ngModel"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center",1,"mt-2"],["mat-button","","color","primary","tabindex","7","type","reset",1,"mr-1"],["autoFocus","","mat-button","","color","primary","type","submit","tabindex","9"],["peerDetailsExpansionBlock",""],["type","text","placeholder","Peer Alias","aria-label","Peers","matInput","","tabindex","1","required","",3,"formControl","matAutocomplete","change"],[3,"displayWith","optionSelected"],["auto","matAutocomplete"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"],["class","flat-expansion-panel my-1","expanded","false",4,"ngIf"],["expanded","false",1,"flat-expansion-panel","my-1"],[1,"font-weight-900"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text"],[1,"w-100","my-1"],["fxFlex","50"],[1,"overflow-wrap","foreground-secondary-text"]],template:function(e,i){if(1&e&&(t.TgZ(0,"div",0),t.TgZ(1,"div",1),t.TgZ(2,"mat-card-header",2),t.TgZ(3,"div",3),t.TgZ(4,"span",4),t._uU(5),t.qZA(),t.qZA(),t.TgZ(6,"button",5),t.NdJ("click",function(){return i.onClose()}),t._uU(7,"X"),t.qZA(),t.qZA(),t.TgZ(8,"mat-card-content",6),t.TgZ(9,"form",7,8),t.NdJ("submit",function(){return i.onOpenChannel()})("reset",function(){return i.resetData()}),t.TgZ(11,"div",9),t.YNc(12,ja,8,8,"mat-form-field",10),t.qZA(),t.YNc(13,to,1,0,"ng-container",11),t.TgZ(14,"div",9),t.TgZ(15,"div",12),t.TgZ(16,"mat-form-field",13),t.TgZ(17,"input",14,15),t.NdJ("ngModelChange",function(s){return i.fundingAmount=s}),t.qZA(),t.TgZ(19,"mat-hint"),t._uU(20),t.ALo(21,"number"),t.qZA(),t.TgZ(22,"span",16),t._uU(23," Sats "),t.qZA(),t.YNc(24,eo,2,0,"mat-error",17),t.YNc(25,no,2,1,"mat-error",17),t.qZA(),t.TgZ(26,"div",18),t.TgZ(27,"mat-slide-toggle",19),t.NdJ("ngModelChange",function(s){return i.isPrivate=s}),t._uU(28,"Private Channel"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(29,"mat-expansion-panel",20),t.NdJ("closed",function(){return i.onAdvancedPanelToggle(!0)})("opened",function(){return i.onAdvancedPanelToggle(!1)}),t.TgZ(30,"mat-expansion-panel-header"),t.TgZ(31,"mat-panel-title"),t.TgZ(32,"span"),t._uU(33),t.qZA(),t.qZA(),t.qZA(),t.TgZ(34,"div",21),t.TgZ(35,"div",12),t.TgZ(36,"div",22),t.TgZ(37,"mat-form-field",1),t.TgZ(38,"input",23,24),t.NdJ("ngModelChange",function(s){return i.feeRate=s}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.YNc(40,ao,3,2,"div",25),t.TgZ(41,"div",26),t.TgZ(42,"button",27),t._uU(43,"Clear Fields"),t.qZA(),t.TgZ(44,"button",28),t._uU(45,"Open Channel"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.YNc(46,so,1,1,"ng-template",null,29,t.W1O)),2&e){const o=t.MAs(18),s=t.MAs(47);t.xp6(5),t.Oqu(i.alertTitle),t.xp6(7),t.Q6J("ngIf",!i.peer&&i.peers&&i.peers.length>0),t.xp6(1),t.Q6J("ngTemplateOutlet",s),t.xp6(4),t.Q6J("ngModel",i.fundingAmount)("step",1e3)("min",1)("max",i.totalBalance),t.xp6(3),t.hij("Remaining Bal: ",t.lcZ(21,16,i.totalBalance-(i.fundingAmount?i.fundingAmount:0)),""),t.xp6(4),t.Q6J("ngIf",null==o.errors?null:o.errors.required),t.xp6(1),t.Q6J("ngIf",null==o.errors?null:o.errors.max),t.xp6(2),t.Q6J("ngModel",i.isPrivate),t.xp6(6),t.Oqu(i.advancedTitle),t.xp6(5),t.Q6J("ngModel",i.feeRate)("step",1)("min",0),t.xp6(2),t.Q6J("ngIf",""!==i.channelConnectionError)}},directives:[p.xw,p.yH,T.dk,p.Wh,q.lW,T.dn,m._Y,m.JL,m.F,u.O5,u.tP,y.KE,U.Nt,m.wV,m.qQ,m.Fd,m.Fj,$.q,Ga.F,m.Q7,m.JJ,m.On,y.bx,y.R9,Lt.Rr,H.ib,H.yz,H.yK,X.h,vt.ZL,m.oH,vt.XC,u.sg,Y.ey,y.TO,I.BN,G.d],pipes:[u.JJ,u.Ov,u.rS],styles:[".open-inputs-box[_ngcontent-%COMP%]{padding:1.2rem 2.4rem .8rem!important}"]}),n})();function lo(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 ro(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 co(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 uo=(()=>{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 d.x,new d.x,new d.x,new d.x,new d.x,new d.x]}ngOnInit(){this.activeLink=this.links.findIndex(e=>e.link===this.router.url.substring(this.router.url.lastIndexOf("/")+1)),this.router.events.pipe((0,h.R)(this.unSubs[0]),(0,J.h)(e=>e instanceof x.Av)).subscribe({next:e=>{this.activeLink=this.links.findIndex(i=>i.link===e.urlAfterRedirects.substring(e.urlAfterRedirects.lastIndexOf("/")+1))}}),this.store.select(C.Xz).pipe((0,h.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.pg).pipe((0,h.R)(this.unSubs[2])).subscribe(e=>{this.selNode=e}),this.store.select(C.yD).pipe((0,h.R)(this.unSubs[3])).subscribe(e=>{this.information=e}),this.store.select(C.Bo).pipe((0,h.R)(this.unSubs[4])).subscribe(e=>{this.peers=e.peers}),this.store.select(C.kY).pipe((0,h.R)(this.unSubs[5])).subscribe(e=>{this.totalBalance=e.onchainBalance.total})}onOpenChannel(){this.store.dispatch((0,b.qR)({payload:{data:{alertTitle:"Open Channel",message:{peers:this.peers,information:this.information,balance:this.totalBalance},component:bt}}}))}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(F.mQ),t.Y36(S.yh),t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channels-tables"]],decls:14,vars:1,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row"],["mat-flat-button","","color","primary","type","submit","tabindex","1",3,"click"],["fxLayout","column","fxFlex","100",1,"my-2","bordered-box"],[3,"selectedIndex","selectedIndexChange","selectedTabChange"],["mat-tab-label",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x-large"],["matBadgeOverlap","false",1,"tab-badge",3,"matBadge"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.TgZ(1,"div",1),t.TgZ(2,"button",2),t.NdJ("click",function(){return i.onOpenChannel()}),t._uU(3,"Open Channel"),t.qZA(),t.qZA(),t.TgZ(4,"div",3),t.TgZ(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,lo,2,1,"ng-template",5),t.qZA(),t.TgZ(8,"mat-tab"),t.YNc(9,ro,2,1,"ng-template",5),t.qZA(),t.TgZ(10,"mat-tab"),t.YNc(11,co,2,1,"ng-template",5),t.qZA(),t.qZA(),t.TgZ(12,"div",6),t._UZ(13,"router-outlet"),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.xp6(5),t.Q6J("selectedIndex",i.activeLink))},directives:[p.xw,p.yH,p.Wh,q.lW,k.SP,k.uX,k.uD,x.lC,yt.k],styles:[""]}),n})();function po(n,a){if(1&n&&(t.TgZ(0,"div",11),t.TgZ(1,"h4",12),t._uU(2,"Short Channel ID"),t.qZA(),t.TgZ(3,"span",13),t._uU(4),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(4),t.Oqu(e.channel.shortChannelId)}}function mo(n,a){if(1&n&&(t.TgZ(0,"div",11),t.TgZ(1,"h4",12),t._uU(2,"State"),t.qZA(),t.TgZ(3,"span",15),t._uU(4),t.ALo(5,"titlecase"),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(4),t.Oqu(t.lcZ(5,1,e.channel.state))}}function ho(n,a){if(1&n&&(t.TgZ(0,"div"),t.TgZ(1,"div",9),t.TgZ(2,"div",11),t.TgZ(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.qZA(),t.TgZ(8,"div",11),t.TgZ(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.qZA(),t.qZA(),t._UZ(14,"mat-divider",14),t.TgZ(15,"div",9),t.TgZ(16,"div",11),t.TgZ(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.qZA(),t.TgZ(22,"div",11),t.TgZ(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.qZA(),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 go(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Show Advanced"),t.qZA())}function _o(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Hide Advanced"),t.qZA())}function fo(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",21),t.NdJ("click",function(){return t.CHM(e),t.oxw().onShowAdvanced()}),t.YNc(1,go,2,0,"p",22),t.YNc(2,_o,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 Co(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",24),t.NdJ("copied",function(o){return t.CHM(e),t.oxw().onCopyChanID(o)}),t._uU(1,"Copy Short Channel ID"),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("payload",e.channel.shortChannelId)}}function xo(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",25),t.NdJ("copied",function(o){return t.CHM(e),t.oxw().onCopyChanID(o)}),t._uU(1,"Copy Channel ID"),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("payload",e.channel.channelId)}}const yo=function(n){return{"xs-scroll-y":n}},Zo=function(n,a){return{"mt-2":n,"mt-1":a}};let st=(()=>{class n{constructor(e,i,o,s,c){this.dialogRef=e,this.data=i,this.logger=o,this.commonService=s,this.snackBar=c,this.faReceipt=Z.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(D.so),t.Y36(D.WI),t.Y36(F.mQ),t.Y36(R.v),t.Y36(Zt.ux))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-information"]],decls:64,vars:28,consts:[["fxLayout","column","fxLayout.gt-sm","row","fxLayoutAlign","space-between stretch"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["tabindex","3","fxFlex","5","fxLayoutAlign","center","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"padding-gap-x-large",3,"ngClass"],["fxLayout","column"],["fxLayout","row"],["fxFlex","50",4,"ngIf"],["fxFlex","50"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text"],[1,"my-1",3,"inset"],[1,"overflow-wrap","foreground-secondary-text"],[4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center","fxFlex","100",3,"ngClass"],["mat-button","","color","primary","type","reset","tabindex","1","class","mr-1",3,"click",4,"ngIf"],["autoFocus","","mat-button","","color","primary","tabindex","2","type","submit","rtlClipboard","",3,"payload","copied",4,"ngIf"],["autoFocus","","mat-button","","color","primary","tabindex","3","type","submit","rtlClipboard","",3,"payload","copied",4,"ngIf"],["mat-button","","color","primary","type","reset","tabindex","1",1,"mr-1",3,"click"],[4,"ngIf","ngIfElse"],["hideAdvancedText",""],["autoFocus","","mat-button","","color","primary","tabindex","2","type","submit","rtlClipboard","",3,"payload","copied"],["autoFocus","","mat-button","","color","primary","tabindex","3","type","submit","rtlClipboard","",3,"payload","copied"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.TgZ(1,"div",1),t.TgZ(2,"mat-card-header",2),t.TgZ(3,"div",3),t._UZ(4,"fa-icon",4),t.TgZ(5,"span",5),t._uU(6,"Channel Information"),t.qZA(),t.qZA(),t.TgZ(7,"button",6),t.NdJ("click",function(){return i.onClose()}),t._uU(8,"X"),t.qZA(),t.qZA(),t.TgZ(9,"mat-card-content",7),t.TgZ(10,"div",8),t.TgZ(11,"div",9),t.YNc(12,po,5,1,"div",10),t.TgZ(13,"div",11),t.TgZ(14,"h4",12),t._uU(15,"Peer Alias"),t.qZA(),t.TgZ(16,"span",13),t._uU(17),t.qZA(),t.qZA(),t.YNc(18,mo,6,3,"div",10),t.qZA(),t._UZ(19,"mat-divider",14),t.TgZ(20,"div",9),t.TgZ(21,"div",1),t.TgZ(22,"h4",12),t._uU(23,"Channel ID"),t.qZA(),t.TgZ(24,"span",13),t._uU(25),t.qZA(),t.qZA(),t.qZA(),t._UZ(26,"mat-divider",14),t.TgZ(27,"div",9),t.TgZ(28,"div",1),t.TgZ(29,"h4",12),t._uU(30,"Peer Public Key"),t.qZA(),t.TgZ(31,"span",13),t._uU(32),t.qZA(),t.qZA(),t.qZA(),t._UZ(33,"mat-divider",14),t.TgZ(34,"div",9),t.TgZ(35,"div",11),t.TgZ(36,"h4",12),t._uU(37,"Private"),t.qZA(),t.TgZ(38,"span",15),t._uU(39),t.qZA(),t.qZA(),t.TgZ(40,"div",11),t.TgZ(41,"h4",12),t._uU(42,"Funder"),t.qZA(),t.TgZ(43,"span",15),t._uU(44),t.qZA(),t.qZA(),t.qZA(),t._UZ(45,"mat-divider",14),t.TgZ(46,"div",9),t.TgZ(47,"div",11),t.TgZ(48,"h4",12),t._uU(49,"State"),t.qZA(),t.TgZ(50,"span",15),t._uU(51),t.ALo(52,"titlecase"),t.qZA(),t.qZA(),t.TgZ(53,"div",11),t.TgZ(54,"h4",12),t._uU(55,"Buried"),t.qZA(),t.TgZ(56,"span",15),t._uU(57),t.qZA(),t.qZA(),t.qZA(),t._UZ(58,"mat-divider",14),t.YNc(59,ho,29,14,"div",16),t.TgZ(60,"div",17),t.YNc(61,fo,4,2,"button",18),t.YNc(62,Co,2,1,"button",19),t.YNc(63,xo,2,1,"button",20),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.xp6(4),t.Q6J("icon",i.faReceipt),t.xp6(5),t.Q6J("ngClass",t.VKq(23,yo,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(0===i.channel.channelFlags?"Yes":"No"),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,Zo,!i.showAdvanced,i.showAdvanced)),t.xp6(1),t.Q6J("ngIf","open"===i.channelsType),t.xp6(1),t.Q6J("ngIf","open"===i.channelsType),t.xp6(1),t.Q6J("ngIf","open"!==i.channelsType))},directives:[p.xw,p.Wh,p.yH,T.dk,I.BN,q.lW,T.dn,u.mk,w.oO,u.O5,G.d,X.h,Tt.y],pipes:[u.rS,u.JJ],styles:[""]}),n})();function To(n,a){1&n&&t._UZ(0,"mat-progress-bar",30)}function Ao(n,a){1&n&&(t.TgZ(0,"th",31),t._uU(1," Short Channel ID "),t.qZA())}function Lo(n,a){if(1&n&&(t.TgZ(0,"span",37),t._UZ(1,"fa-icon",38),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("icon",e.faEyeSlash)}}function vo(n,a){if(1&n&&(t.TgZ(0,"span",39),t._UZ(1,"fa-icon",38),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("icon",e.faEye)}}const St=function(n){return{"max-width":n}};function bo(n,a){if(1&n&&(t.TgZ(0,"td",32),t.TgZ(1,"div",33),t.YNc(2,Lo,2,1,"span",34),t.YNc(3,vo,2,1,"span",35),t.TgZ(4,"span",36),t._uU(5),t.qZA(),t.qZA(),t.qZA()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(4,St,i.screenSize===i.screenSizeEnum.XS?"12rem":"22rem")),t.xp6(1),t.Q6J("ngIf",0===e.channelFlags),t.xp6(1),t.Q6J("ngIf",0!==e.channelFlags),t.xp6(2),t.Oqu(null==e?null:e.shortChannelId)}}function So(n,a){1&n&&(t.TgZ(0,"th",31),t._uU(1," Alias "),t.qZA())}function wo(n,a){if(1&n&&(t.TgZ(0,"td",32),t.TgZ(1,"div",33),t.TgZ(2,"span",36),t._uU(3),t.qZA(),t.qZA(),t.qZA()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,St,i.screenSize===i.screenSizeEnum.XS?"12rem":"22rem")),t.xp6(2),t.Oqu(e.alias)}}function Eo(n,a){1&n&&(t.TgZ(0,"th",40),t._uU(1," Base Fee (mSats) "),t.qZA())}function qo(n,a){if(1&n&&(t.TgZ(0,"td",32),t.TgZ(1,"span",41),t._uU(2),t.ALo(3,"number"),t.qZA(),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 Io(n,a){1&n&&(t.TgZ(0,"th",40),t._uU(1," Fee Rate (mili mSats) "),t.qZA())}function Oo(n,a){if(1&n&&(t.TgZ(0,"td",32),t.TgZ(1,"span",41),t._uU(2),t.ALo(3,"number"),t.qZA(),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 Fo(n,a){1&n&&(t.TgZ(0,"th",40),t._uU(1," Local Balance (Sats) "),t.qZA())}function Ro(n,a){if(1&n&&(t.TgZ(0,"td",32),t.TgZ(1,"span",41),t._uU(2),t.ALo(3,"number"),t.qZA(),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 No(n,a){1&n&&(t.TgZ(0,"th",40),t._uU(1," Remote Balance (Sats) "),t.qZA())}function ko(n,a){if(1&n&&(t.TgZ(0,"td",32),t.TgZ(1,"span",41),t._uU(2),t.ALo(3,"number"),t.qZA(),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 Po(n,a){1&n&&(t.TgZ(0,"th",42),t._uU(1,"Balance Score "),t.qZA())}function Do(n,a){if(1&n&&(t.TgZ(0,"td",43),t.TgZ(1,"div",44),t.TgZ(2,"mat-hint",45),t._uU(3),t.ALo(4,"number"),t.qZA(),t.qZA(),t._UZ(5,"mat-progress-bar",46),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 Uo(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",47),t.TgZ(1,"div",48),t.TgZ(2,"mat-select",49),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",50),t.NdJ("click",function(){return t.CHM(e),t.oxw().onChannelUpdate("all")}),t._uU(5,"Update Fee Policy"),t.qZA(),t.TgZ(6,"mat-option",50),t.NdJ("click",function(){return t.CHM(e),t.oxw().onDownloadCSV()}),t._uU(7,"Download CSV"),t.qZA(),t.qZA(),t.qZA(),t.qZA()}}function Mo(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",51),t.TgZ(1,"div",52),t.TgZ(2,"mat-select",53),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",50),t.NdJ("click",function(o){const c=t.CHM(e).$implicit;return t.oxw().onChannelClick(c,o)}),t._uU(5,"View Info"),t.qZA(),t.TgZ(6,"mat-option",50),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw().onChannelUpdate(s)}),t._uU(7,"Update Fee Policy"),t.qZA(),t.TgZ(8,"mat-option",50),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw().onChannelClose(s,!1)}),t._uU(9,"Close Channel"),t.qZA(),t.TgZ(10,"mat-option",50),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw().onChannelClose(s,!0)}),t._uU(11,"Force Close"),t.qZA(),t.qZA(),t.qZA(),t.qZA()}}function Jo(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 Qo(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No channel available."),t.qZA())}function Yo(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting channels..."),t.qZA())}function Ho(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 Bo(n,a){if(1&n&&(t.TgZ(0,"td",54),t.YNc(1,Jo,2,0,"p",55),t.YNc(2,Qo,2,0,"p",55),t.YNc(3,Yo,2,0,"p",55),t.YNc(4,Ho,2,1,"p",55),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 zo=function(n){return{"display-none":n}};function Vo(n,a){if(1&n&&t._UZ(0,"tr",56),2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,zo,e.numPeers>0&&(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function Go(n,a){1&n&&t._UZ(0,"tr",57)}function Xo(n,a){1&n&&t._UZ(0,"tr",58)}const $o=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},Wo=function(){return["no_peer"]};let Ko=(()=>{class n{constructor(e,i,o,s,c){var _,O,f,L;this.logger=e,this.store=i,this.rtlEffects=o,this.commonService=s,this.router=c,this.faEye=Z.Mdf,this.faEyeSlash=Z.Aq,this.totalBalance=0,this.displayedColumns=[],this.myChanPolicy={},this.information={},this.numPeers=-1,this.feeRateTypes=l.vn,this.selFilter="",this.flgSticky=!1,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 d.x,new d.x,new d.x,new d.x,new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===l.cu.XS?(this.flgSticky=!1,this.displayedColumns=["alias","toLocal","toRemote","actions"]):this.screenSize===l.cu.SM?(this.flgSticky=!1,this.displayedColumns=["shortChannelId","alias","toLocal","toRemote","actions"]):this.screenSize===l.cu.MD?(this.flgSticky=!1,this.displayedColumns=["shortChannelId","alias","feeBaseMsat","feeProportionalMillionths","toLocal","toRemote","actions"]):(this.flgSticky=!0,this.displayedColumns=["shortChannelId","alias","feeBaseMsat","feeProportionalMillionths","toLocal","toRemote","balancedness","actions"]),this.selFilter=(null===(O=null===(_=this.router.getCurrentNavigation().extras)||void 0===_?void 0:_.state)||void 0===O?void 0:O.filter)?null===(L=null===(f=this.router.getCurrentNavigation().extras)||void 0===f?void 0:f.state)||void 0===L?void 0:L.filter:""}ngOnInit(){this.store.select(C.Xz).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage="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.loadChannelsTable(),this.logger.info(e)}),this.store.select(C.yD).pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.information=e}),this.store.select(C.Bo).pipe((0,h.R)(this.unSubs[2])).subscribe(e=>{this.numPeers=e.peers&&e.peers.length?e.peers.length:0}),this.store.select(C.kY).pipe((0,h.R)(this.unSubs[3])).subscribe(e=>{this.totalBalance=e.onchainBalance.total})}ngAfterViewInit(){this.activeChannels.length>0&&this.sort&&this.paginator&&this.loadChannelsTable()}onChannelUpdate(e){"all"!==e&&"NORMAL"!==e.state||(this.store.dispatch((0,b.c1)({payload:{data:{type:l.n_.CONFIRM,alertTitle:"Update Fee Policy",noBtnText:"Cancel",yesBtnText:"Update",message:[],titleMessage:"all"===e?"Update fee policy for all channels":"Update fee policy for Channel: "+(e.alias||e.shortChannelId?e.alias&&e.shortChannelId?e.alias+" ("+e.shortChannelId+")":e.alias?e.alias:e.shortChannelId:e.channelId),flgShowInput:!0,getInputs:[{placeholder:"Base Fee (mSats)",inputType:"number",inputValue:e&&void 0!==e.feeBaseMsat?e.feeBaseMsat:1e3,width:48},{placeholder:"Fee Rate (mili mSats)",inputType:"number",inputValue:e&&void 0!==e.feeProportionalMillionths?e.feeProportionalMillionths:100,min:1,width:48,hintFunction:this.percentHintFunction}]}}})),this.rtlEffects.closeConfirm.pipe((0,h.R)(this.unSubs[4])).subscribe(s=>{if(s){const c=s[0].inputValue,_=s[1].inputValue;let O=null;if(this.commonService.isVersionCompatible(this.information.version,"0.6.2")){let f="";"all"===e?(this.activeChannels.forEach(L=>{f=f+","+L.nodeId}),f=f.substring(1),O={baseFeeMsat:c,feeRate:_,nodeIds:f}):O={baseFeeMsat:c,feeRate:_,nodeId:e.nodeId}}else{let f="";"all"===e?(this.activeChannels.forEach(L=>{f=f+","+L.channelId}),f=f.substring(1),O={baseFeeMsat:c,feeRate:_,channelIds:f}):O={baseFeeMsat:c,feeRate:_,channelId:e.channelId}}this.store.dispatch((0,N.pW)({payload:O}))}}),this.applyFilter())}percentHintFunction(e){return(e/1e4).toString()+"%"}onChannelClose(e,i){this.store.dispatch((0,b.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,h.R)(this.unSubs[5])).subscribe(_=>{_&&this.store.dispatch((0,N.BL)({payload:{channelId:e.channelId,force:i}}))})}applyFilter(){this.channels.filter=this.selFilter.trim().toLowerCase()}onChannelClick(e,i){this.store.dispatch((0,b.qR)({payload:{data:{channel:e,channelsType:"open",component:st}}}))}loadChannelsTable(){this.activeChannels.sort((e,i)=>e.alias===i.alias?0:i.alias?1:-1),this.channels=new r.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.filterPredicate=(e,i)=>JSON.stringify(e).toLowerCase().includes(i),this.channels.paginator=this.paginator,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(F.mQ),t.Y36(S.yh),t.Y36(K.V),t.Y36(R.v),t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-open-table"]],viewQuery:function(e,i){if(1&e&&(t.Gf(A.YE,5),t.Gf(v.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:v.ye,useValue:(0,l.pt)("Channels")}])],decls:39,vars:14,consts:[["fxLayout","column",1,"padding-gap"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],["fxFlex","30"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","keyup","ngModelChange"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","shortChannelId"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","alias"],["matColumnDef","feeBaseMsat"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","feeProportionalMillionths"],["matColumnDef","toLocal"],["matColumnDef","toRemote"],["matColumnDef","balancedness"],["mat-header-cell","","mat-sort-header","","class","pl-3",4,"matHeaderCellDef"],["mat-cell","","class","pl-3",4,"matCellDef"],["matColumnDef","actions"],["mat-header-cell","","class","pl-1",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center","class","pl-1",4,"matCellDef"],["matColumnDef","no_peer"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"ellipsis-parent",3,"ngStyle"],["class","mr-1","matTooltip","Private","matTooltipPosition","right",4,"ngIf"],["class","mr-1","matTooltip","Public","matTooltipPosition","right",4,"ngIf"],[1,"ellipsis-child"],["matTooltip","Private","matTooltipPosition","right",1,"mr-1"],[3,"icon"],["matTooltip","Public","matTooltipPosition","right",1,"mr-1"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell","","mat-sort-header","",1,"pl-3"],["mat-cell","",1,"pl-3"],["fxLayout","row"],["fxFlex","100","fxLayoutAlign","center center",1,"font-size-80"],["mode","determinate",3,"value"],["mat-header-cell","",1,"pl-1"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"pl-1"],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","2",1,"mr-0"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.TgZ(1,"div",1),t._UZ(2,"div",2),t.TgZ(3,"mat-form-field",3),t.TgZ(4,"input",4),t.NdJ("keyup",function(){return i.applyFilter()})("ngModelChange",function(s){return i.selFilter=s}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(5,"div",5),t.YNc(6,To,1,0,"mat-progress-bar",6),t.TgZ(7,"table",7,8),t.ynx(9,9),t.YNc(10,Ao,2,0,"th",10),t.YNc(11,bo,6,6,"td",11),t.BQk(),t.ynx(12,12),t.YNc(13,So,2,0,"th",10),t.YNc(14,wo,4,4,"td",11),t.BQk(),t.ynx(15,13),t.YNc(16,Eo,2,0,"th",14),t.YNc(17,qo,4,4,"td",11),t.BQk(),t.ynx(18,15),t.YNc(19,Io,2,0,"th",14),t.YNc(20,Oo,4,4,"td",11),t.BQk(),t.ynx(21,16),t.YNc(22,Fo,2,0,"th",14),t.YNc(23,Ro,4,4,"td",11),t.BQk(),t.ynx(24,17),t.YNc(25,No,2,0,"th",14),t.YNc(26,ko,4,4,"td",11),t.BQk(),t.ynx(27,18),t.YNc(28,Po,2,0,"th",19),t.YNc(29,Do,6,4,"td",20),t.BQk(),t.ynx(30,21),t.YNc(31,Uo,8,0,"th",22),t.YNc(32,Mo,12,0,"td",23),t.BQk(),t.ynx(33,24),t.YNc(34,Bo,5,4,"td",25),t.BQk(),t.YNc(35,Vo,1,3,"tr",26),t.YNc(36,Go,1,0,"tr",27),t.YNc(37,Xo,1,0,"tr",28),t.qZA(),t.qZA(),t._UZ(38,"mat-paginator",29),t.qZA()),2&e&&(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("dataSource",i.channels)("ngClass",t.VKq(11,$o,""!==i.errorMessage)),t.xp6(28),t.Q6J("matFooterRowDef",t.DdM(13,Wo)),t.xp6(1),t.Q6J("matHeaderRowDef",i.displayedColumns)("matHeaderRowDefSticky",i.flgSticky),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumns),t.xp6(1),t.Q6J("pageSize",i.pageSize)("pageSizeOptions",i.pageSizeOptions)("showFirstLastButtons",i.screenSize!==i.screenSizeEnum.XS))},directives:[p.xw,p.Wh,p.yH,y.KE,U.Nt,m.Fj,m.JJ,m.On,Q.$V,u.O5,r.BZ,A.YE,u.mk,w.oO,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,v.NW,M.pW,r.ge,A.nU,r.ev,u.PC,w.Zl,V.gM,I.BN,y.bx,P.gD,P.$L,Y.ey,r.yh,r.Q2,r.XQ,r.Gk],pipes:[u.JJ],styles:[".mat-column-shortChannelId[_ngcontent-%COMP%]{flex:0 0 15%;width:15%}.mat-column-shortChannelId[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%]{display:flex}.mat-column-alias[_ngcontent-%COMP%]{padding-left:1rem;flex:0 0 15%;width:15%}.mat-column-alias[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%]{display:flex}.mat-column-balancedness[_ngcontent-%COMP%]{padding-left:2rem;flex:0 0 17%;width:17%}.mat-column-state[_ngcontent-%COMP%], .mat-column-feeBaseMsat[_ngcontent-%COMP%], .mat-column-feeProportionalMillionths[_ngcontent-%COMP%], .mat-column-toLocal[_ngcontent-%COMP%], .mat-column-toRemote[_ngcontent-%COMP%]{flex:1 1 10%;width:10%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media only screen and (max-width: 56.25em){.mat-column-state[_ngcontent-%COMP%], .mat-column-feeBaseMsat[_ngcontent-%COMP%], .mat-column-feeProportionalMillionths[_ngcontent-%COMP%], .mat-column-toLocal[_ngcontent-%COMP%], .mat-column-toRemote[_ngcontent-%COMP%]{white-space:unset;flex:1 1 20%;width:20%}}@media only screen and (max-width: 37.5em){.mat-column-state[_ngcontent-%COMP%], .mat-column-feeBaseMsat[_ngcontent-%COMP%], .mat-column-feeProportionalMillionths[_ngcontent-%COMP%], .mat-column-toLocal[_ngcontent-%COMP%], .mat-column-toRemote[_ngcontent-%COMP%]{white-space:unset}}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}.mat-column-actions[_ngcontent-%COMP%] .bordered-box.table-actions-select[_ngcontent-%COMP%]{flex:0 0 100%}@media only screen and (max-width: 56.25em){.mat-column-actions[_ngcontent-%COMP%] .bordered-box.table-actions-select[_ngcontent-%COMP%]{flex:0 0 90%}}@media only screen and (max-width: 37.5em){.mat-column-actions[_ngcontent-%COMP%] .bordered-box.table-actions-select[_ngcontent-%COMP%]{flex:0 0 80%}}"]}),n})();function jo(n,a){1&n&&t._UZ(0,"mat-progress-bar",25)}function ts(n,a){1&n&&(t.TgZ(0,"th",26),t._uU(1," State "),t.qZA())}function es(n,a){if(1&n&&(t.TgZ(0,"td",27),t._uU(1),t.ALo(2,"titlecase"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,null==e?null:e.state),"")}}function ns(n,a){1&n&&(t.TgZ(0,"th",26),t._uU(1," Alias "),t.qZA())}function is(n,a){if(1&n&&(t.TgZ(0,"td",27),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null==e?null:e.alias)}}function as(n,a){1&n&&(t.TgZ(0,"th",28),t._uU(1," Local Balance (Sats) "),t.qZA())}function os(n,a){if(1&n&&(t.TgZ(0,"td",27),t.TgZ(1,"span",29),t._uU(2),t.ALo(3,"number"),t.qZA(),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 ss(n,a){1&n&&(t.TgZ(0,"th",28),t._uU(1," Remote Balance (Sats) "),t.qZA())}function ls(n,a){if(1&n&&(t.TgZ(0,"td",27),t.TgZ(1,"span",29),t._uU(2),t.ALo(3,"number"),t.qZA(),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){if(1&n){const e=t.EpF();t.TgZ(0,"th",30),t.TgZ(1,"div",31),t.TgZ(2,"mat-select",32),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",33),t.NdJ("click",function(){return t.CHM(e),t.oxw().onDownloadCSV()}),t._uU(5,"Download CSV"),t.qZA(),t.qZA(),t.qZA(),t.qZA()}}function cs(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",34),t.TgZ(1,"button",35),t.NdJ("click",function(o){const c=t.CHM(e).$implicit;return t.oxw().onChannelClick(c,o)}),t._uU(2,"View Info"),t.qZA(),t.qZA()}}function us(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No pending channel available."),t.qZA())}function ps(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting pending channels..."),t.qZA())}function ms(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 ds(n,a){if(1&n&&(t.TgZ(0,"td",36),t.YNc(1,us,2,0,"p",37),t.YNc(2,ps,2,0,"p",37),t.YNc(3,ms,2,1,"p",37),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 hs=function(n){return{"display-none":n}};function gs(n,a){if(1&n&&t._UZ(0,"tr",38),2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,hs,(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function _s(n,a){1&n&&t._UZ(0,"tr",39)}function fs(n,a){1&n&&t._UZ(0,"tr",40)}const Cs=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},xs=function(){return["no_channel"]};let ys=(()=>{class n{constructor(e,i,o){this.logger=e,this.store=i,this.commonService=o,this.totalBalance=0,this.displayedColumns=[],this.myChanPolicy={},this.information={},this.numPeers=-1,this.feeRateTypes=l.vn,this.selFilter="",this.flgSticky=!1,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 d.x,new d.x,new d.x,new d.x,new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===l.cu.XS?(this.flgSticky=!1,this.displayedColumns=["state","alias","actions"]):this.screenSize===l.cu.SM||this.screenSize===l.cu.MD?(this.flgSticky=!1,this.displayedColumns=["state","alias","toLocal","toRemote","actions"]):(this.flgSticky=!0,this.displayedColumns=["state","alias","toLocal","toRemote","actions"])}ngOnInit(){this.store.select(C.Xz).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage="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,h.R)(this.unSubs[1])).subscribe(e=>{this.information=e}),this.store.select(C.Bo).pipe((0,h.R)(this.unSubs[4])).subscribe(e=>{this.numPeers=e.peers&&e.peers.length?e.peers.length:0}),this.store.select(C.kY).pipe((0,h.R)(this.unSubs[5])).subscribe(e=>{this.totalBalance=e.onchainBalance.total})}ngAfterViewInit(){this.pendingChannels.length>0&&this.loadChannelsTable()}applyFilter(){this.channels.filter=this.selFilter.trim().toLowerCase()}onChannelClick(e,i){this.store.dispatch((0,b.qR)({payload:{data:{channel:e,channelsType:"pending",component:st}}}))}loadChannelsTable(){this.pendingChannels.sort((e,i)=>e.alias===i.alias?0:i.alias?1:-1),this.channels=new r.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.filterPredicate=(e,i)=>JSON.stringify(e).toLowerCase().includes(i),this.channels.paginator=this.paginator,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(F.mQ),t.Y36(S.yh),t.Y36(R.v))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-pending-table"]],viewQuery:function(e,i){if(1&e&&(t.Gf(A.YE,5),t.Gf(v.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:v.ye,useValue:(0,l.pt)("Channels")}])],decls:30,vars:14,consts:[["fxLayout","column",1,"padding-gap"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],["fxFlex","30"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","keyup","ngModelChange"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","state"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","alias"],["matColumnDef","toLocal"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","toRemote"],["matColumnDef","actions"],["mat-header-cell","","class","pl-1",4,"matHeaderCellDef"],["mat-cell","","class","pl-1","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_channel"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell","",1,"pl-1"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"pl-1"],["mat-stroked-button","","color","primary","type","button","tabindex","4",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.TgZ(1,"div",1),t._UZ(2,"div",2),t.TgZ(3,"mat-form-field",3),t.TgZ(4,"input",4),t.NdJ("keyup",function(){return i.applyFilter()})("ngModelChange",function(s){return i.selFilter=s}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(5,"div",5),t.YNc(6,jo,1,0,"mat-progress-bar",6),t.TgZ(7,"table",7,8),t.ynx(9,9),t.YNc(10,ts,2,0,"th",10),t.YNc(11,es,3,3,"td",11),t.BQk(),t.ynx(12,12),t.YNc(13,ns,2,0,"th",10),t.YNc(14,is,2,1,"td",11),t.BQk(),t.ynx(15,13),t.YNc(16,as,2,0,"th",14),t.YNc(17,os,4,4,"td",11),t.BQk(),t.ynx(18,15),t.YNc(19,ss,2,0,"th",14),t.YNc(20,ls,4,4,"td",11),t.BQk(),t.ynx(21,16),t.YNc(22,rs,6,0,"th",17),t.YNc(23,cs,3,0,"td",18),t.BQk(),t.ynx(24,19),t.YNc(25,ds,4,3,"td",20),t.BQk(),t.YNc(26,gs,1,3,"tr",21),t.YNc(27,_s,1,0,"tr",22),t.YNc(28,fs,1,0,"tr",23),t.qZA(),t.qZA(),t._UZ(29,"mat-paginator",24),t.qZA()),2&e&&(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("dataSource",i.channels)("ngClass",t.VKq(11,Cs,""!==i.errorMessage)),t.xp6(19),t.Q6J("matFooterRowDef",t.DdM(13,xs)),t.xp6(1),t.Q6J("matHeaderRowDef",i.displayedColumns)("matHeaderRowDefSticky",i.flgSticky),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumns),t.xp6(1),t.Q6J("pageSize",i.pageSize)("pageSizeOptions",i.pageSizeOptions)("showFirstLastButtons",i.screenSize!==i.screenSizeEnum.XS))},directives:[p.xw,p.Wh,p.yH,y.KE,U.Nt,m.Fj,m.JJ,m.On,Q.$V,u.O5,r.BZ,A.YE,u.mk,w.oO,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,v.NW,M.pW,r.ge,A.nU,r.ev,P.gD,P.$L,Y.ey,q.lW,r.yh,r.Q2,r.XQ,r.Gk],pipes:[u.rS,u.JJ],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),n})();var lt=g(5615);const Zs=["peersForm"],Ts=["stepper"];function As(n,a){if(1&n&&t._uU(0),2&n){const e=t.oxw();t.Oqu(e.peerFormLabel)}}function Ls(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Address is required."),t.qZA())}function vs(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(),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faExclamationTriangle),t.xp6(2),t.Oqu(e.peerConnectionError)}}function bs(n,a){if(1&n&&t._uU(0),2&n){const e=t.oxw();t.Oqu(e.channelFormLabel)}}function Ss(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Amount is required."),t.qZA())}function ws(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Amount must be a positive number."),t.qZA())}function Es(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 qs(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(),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faExclamationTriangle),t.xp6(2),t.Oqu(e.channelConnectionError)}}let Is=(()=>{class n{constructor(e,i,o,s,c,_){this.dialogRef=e,this.data=i,this.store=o,this.formBuilder=s,this.actions=c,this.logger=_,this.faExclamationTriangle=Z.eHv,this.peerAddress="",this.totalBalance=0,this.flgChannelOpened=!1,this.channelOpenStatus=null,this.newlyAddedPeer=null,this.flgEditable=!0,this.peerConnectionError="",this.channelConnectionError="",this.peerFormLabel="Peer Details",this.channelFormLabel="Open Channel (Optional)",this.unSubs=[new d.x,new d.x]}ngOnInit(){this.totalBalance=this.data.message.balance,this.peerAddress=this.data.message.peer&&this.data.message.peer.nodeId&&this.data.message.peer.address?this.data.message.peer.nodeId+"@"+this.data.message.peer.address:this.data.message.peer&&this.data.message.peer.nodeId&&!this.data.message.peer.address?this.data.message.peer.nodeId:"",this.peerFormGroup=this.formBuilder.group({hiddenAddress:["",[m.kI.required]],peerAddress:[this.peerAddress,[m.kI.required]]}),this.channelFormGroup=this.formBuilder.group({fundingAmount:["",[m.kI.required,m.kI.min(1),m.kI.max(this.totalBalance)]],isPrivate:[!1],feeRate:[null],hiddenAmount:["",[m.kI.required]]}),this.statusFormGroup=this.formBuilder.group({}),this.actions.pipe((0,h.R)(this.unSubs[1]),(0,J.h)(e=>e.type===l.lr.NEWLY_ADDED_PEER_ECL||e.type===l.lr.FETCH_CHANNELS_ECL||e.type===l.lr.UPDATE_API_CALL_STATUS_ECL)).subscribe(e=>{e.type===l.lr.NEWLY_ADDED_PEER_ECL&&(this.logger.info(e.payload),this.flgEditable=!1,this.newlyAddedPeer=e.payload.peer,this.peerFormGroup.controls.hiddenAddress.setValue(this.peerFormGroup.controls.peerAddress.value),this.stepper.next()),e.type===l.lr.FETCH_CHANNELS_ECL&&this.dialogRef.close(),e.type===l.lr.UPDATE_API_CALL_STATUS_ECL&&e.payload.status===l.Bn.ERROR&&("SaveNewPeer"===e.payload.action?this.peerConnectionError=e.payload.message:"SaveNewChannel"===e.payload.action&&(this.channelConnectionError=e.payload.message))})}onConnectPeer(){if(!this.peerFormGroup.controls.peerAddress.value)return!0;this.peerConnectionError="",this.store.dispatch((0,N.El)({payload:{id:this.peerFormGroup.controls.peerAddress.value}}))}onOpenChannel(){if(!this.channelFormGroup.controls.fundingAmount.value||this.totalBalance-this.channelFormGroup.controls.fundingAmount.value<0)return!0;this.channelConnectionError="",this.store.dispatch((0,N.YX)({payload:{nodeId:this.newlyAddedPeer.nodeId,amount:this.channelFormGroup.controls.fundingAmount.value,private:this.channelFormGroup.controls.isPrivate.value,feeRate:this.channelFormGroup.controls.feeRate.value}}))}onClose(){this.dialogRef.close(!1)}stepSelectionChanged(e){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: "+(this.newlyAddedPeer.alias?this.newlyAddedPeer.alias:this.newlyAddedPeer.nodeId):"Peer Details",this.channelFormLabel="Open Channel (Optional)";break;case 2:this.peerFormLabel=this.peerFormGroup.controls.peerAddress.value?"Peer Added: "+(this.newlyAddedPeer.alias?this.newlyAddedPeer.alias:this.newlyAddedPeer.nodeId):"Peer Details",this.channelFormLabel=this.channelFormGroup.controls.fundingAmount.value?"Opening Channel for "+this.channelFormGroup.controls.fundingAmount.value+" Sats":"Open Channel (Optional)"}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(D.so),t.Y36(D.WI),t.Y36(S.yh),t.Y36(m.qu),t.Y36(z.eX),t.Y36(F.mQ))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-connect-peer"]],viewQuery:function(e,i){if(1&e&&(t.Gf(Zs,5),t.Gf(Ts,5)),2&e){let o;t.iGM(o=t.CRH())&&(i.form=o.first),t.iGM(o=t.CRH())&&(i.stepper=o.first)}},decls:50,vars:20,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","8","fxFlex","5","fxLayoutAlign","center","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"padding-gap-x-large"],["fxLayout","column"],[3,"linear","selectionChange"],["stepper",""],[3,"stepControl","editable"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","start","fxLayoutAlign.gt-sm","space-between",1,"my-1",3,"formGroup"],["matStepLabel",""],["autoFocus","","matInput","","placeholder","Lightning Address (pubkey OR pubkey@ip:port)","formControlName","peerAddress","tabindex","1","required",""],[4,"ngIf"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"mt-2"],["mat-button","","color","primary","tabindex","3","type","button",3,"click"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","start","fxLayoutAlign.gt-sm","space-between",1,"mb-1",3,"formGroup"],["matStepLabel","","disabled","true"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between center"],["fxFlex","60","fxLayoutAlign","start end"],["matInput","","autoFocus","","formControlName","fundingAmount","placeholder","Amount","type","number","tabindex","1","required","",3,"step"],["matSuffix",""],["fxFlex","35","fxLayoutAlign","start center"],["tabindex","2","color","primary","formControlName","isPrivate","name","isPrivate"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between center",1,"mt-1"],["fxFlex","48","fxLayout","row","fxLayoutAlign","start center"],["matInput","","formControlName","feeRate","placeholder","Fee (Sats/vByte)","type","number","name","feeRate","tabindex","7",3,"step","min"],["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),t.TgZ(1,"div",1),t.TgZ(2,"mat-card-header",2),t.TgZ(3,"div",3),t.TgZ(4,"span",4),t._uU(5,"Connect to a new peer"),t.qZA(),t.qZA(),t.TgZ(6,"button",5),t.NdJ("click",function(){return i.onClose()}),t._uU(7,"X"),t.qZA(),t.qZA(),t.TgZ(8,"mat-card-content",6),t.TgZ(9,"div",7),t.TgZ(10,"mat-vertical-stepper",8,9),t.NdJ("selectionChange",function(s){return i.stepSelectionChanged(s)}),t.TgZ(12,"mat-step",10),t.TgZ(13,"form",11),t.YNc(14,As,1,1,"ng-template",12),t.TgZ(15,"mat-form-field",1),t._UZ(16,"input",13),t.YNc(17,Ls,2,0,"mat-error",14),t.qZA(),t.YNc(18,vs,4,2,"div",15),t.TgZ(19,"div",16),t.TgZ(20,"button",17),t.NdJ("click",function(){return i.onConnectPeer()}),t._uU(21),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(22,"mat-step",10),t.TgZ(23,"form",18),t.YNc(24,bs,1,1,"ng-template",19),t.TgZ(25,"div",20),t.TgZ(26,"div",21),t.TgZ(27,"mat-form-field",22),t._UZ(28,"input",23),t.TgZ(29,"mat-hint"),t._uU(30),t.qZA(),t.TgZ(31,"span",24),t._uU(32," Sats "),t.qZA(),t.YNc(33,Ss,2,0,"mat-error",14),t.YNc(34,ws,2,0,"mat-error",14),t.YNc(35,Es,2,1,"mat-error",14),t.qZA(),t.TgZ(36,"div",25),t.TgZ(37,"mat-slide-toggle",26),t._uU(38,"Private Channel"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(39,"div",27),t.TgZ(40,"div",28),t.TgZ(41,"mat-form-field",1),t._UZ(42,"input",29),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.YNc(43,qs,4,2,"div",15),t.TgZ(44,"div",16),t.TgZ(45,"button",30),t.NdJ("click",function(){return i.onOpenChannel()}),t._uU(46),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(47,"div",31),t.TgZ(48,"button",32),t.NdJ("click",function(){return i.onClose()}),t._uU(49),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.xp6(10),t.Q6J("linear",!0),t.xp6(2),t.Q6J("stepControl",i.peerFormGroup)("editable",i.flgEditable),t.xp6(1),t.Q6J("formGroup",i.peerFormGroup),t.xp6(4),t.Q6J("ngIf",null==i.peerFormGroup.controls.peerAddress.errors?null:i.peerFormGroup.controls.peerAddress.errors.required),t.xp6(1),t.Q6J("ngIf",""!==i.peerConnectionError),t.xp6(3),t.Oqu(""!==i.peerConnectionError?"Retry":"Add Peer"),t.xp6(1),t.Q6J("stepControl",i.channelFormGroup)("editable",i.flgEditable),t.xp6(1),t.Q6J("formGroup",i.channelFormGroup),t.xp6(5),t.Q6J("step",1e3),t.xp6(2),t.hij("Remaining Bal: ",i.totalBalance-(i.channelFormGroup.controls.fundingAmount.value?i.channelFormGroup.controls.fundingAmount.value:0),""),t.xp6(3),t.Q6J("ngIf",null==i.channelFormGroup.controls.fundingAmount.errors?null:i.channelFormGroup.controls.fundingAmount.errors.required),t.xp6(1),t.Q6J("ngIf",null==i.channelFormGroup.controls.fundingAmount.errors?null:i.channelFormGroup.controls.fundingAmount.errors.min),t.xp6(1),t.Q6J("ngIf",null==i.channelFormGroup.controls.fundingAmount.errors?null:i.channelFormGroup.controls.fundingAmount.errors.max),t.xp6(7),t.Q6J("step",1)("min",0),t.xp6(1),t.Q6J("ngIf",""!==i.channelConnectionError),t.xp6(3),t.Oqu(""!==i.channelConnectionError?"Retry":"Open Channel"),t.xp6(3),t.Oqu(null!=i.newlyAddedPeer&&i.newlyAddedPeer.nodeId?"Do It Later":"Close"))},directives:[p.xw,p.yH,T.dk,p.Wh,q.lW,T.dn,lt.Vq,lt.C0,m._Y,m.JL,m.sg,lt.VY,y.KE,U.Nt,m.Fj,X.h,m.JJ,m.u,m.Q7,u.O5,m.wV,y.bx,y.R9,Lt.Rr,m.qQ,$.q,y.TO,I.BN],styles:[""]}),n})();function Os(n,a){1&n&&t._UZ(0,"mat-progress-bar",37)}function Fs(n,a){1&n&&(t.TgZ(0,"th",38),t._uU(1," ID "),t.qZA())}const rt=function(n){return{"max-width":n}};function Rs(n,a){if(1&n&&(t.TgZ(0,"td",39),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw();t.Q6J("ngStyle",t.VKq(2,rt,i.screenSize===i.screenSizeEnum.XS?"10rem":"30rem")),t.xp6(1),t.hij(" ",null==e?null:e.nodeId," ")}}function Ns(n,a){1&n&&(t.TgZ(0,"th",40),t._uU(1," Alias "),t.qZA())}const wt=function(n){return{"mr-0":n}};function ks(n,a){if(1&n&&t._UZ(0,"span",44),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,wt,e.screenSize===e.screenSizeEnum.XS))}}function Ps(n,a){if(1&n&&t._UZ(0,"span",45),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,wt,e.screenSize===e.screenSizeEnum.XS))}}function Ds(n,a){if(1&n&&(t.TgZ(0,"td",41),t.YNc(1,ks,1,3,"span",42),t.YNc(2,Ps,1,3,"span",43),t._uU(3),t.qZA()),2&n){const e=a.$implicit,i=t.oxw();t.Q6J("ngStyle",t.VKq(4,rt,i.screenSize===i.screenSizeEnum.XS?"10rem":"25rem")),t.xp6(1),t.Q6J("ngIf","CONNECTED"===e.state),t.xp6(1),t.Q6J("ngIf","DISCONNECTED"===e.state),t.xp6(1),t.hij(" ",null==e?null:e.alias," ")}}function Us(n,a){1&n&&(t.TgZ(0,"th",38),t._uU(1," State "),t.qZA())}function Ms(n,a){if(1&n&&(t.TgZ(0,"td",46),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.hij(" ",null==e?null:e.state," ")}}function Js(n,a){1&n&&(t.TgZ(0,"th",38),t._uU(1," Network Address "),t.qZA())}function Qs(n,a){if(1&n&&(t.TgZ(0,"td",39),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw();t.Q6J("ngStyle",t.VKq(2,rt,i.screenSize===i.screenSizeEnum.XS?"10rem":"20rem")),t.xp6(1),t.hij(" ",null==e?null:e.address," ")}}function Ys(n,a){1&n&&(t.TgZ(0,"th",47),t._uU(1," Channels "),t.qZA())}function Hs(n,a){if(1&n&&(t.TgZ(0,"td",48),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.hij(" ",null==e?null:e.channels," ")}}function Bs(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",49),t.TgZ(1,"div",50),t.TgZ(2,"mat-select",51),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",52),t.NdJ("click",function(){return t.CHM(e),t.oxw().onDownloadCSV()}),t._uU(5,"Download CSV"),t.qZA(),t.qZA(),t.qZA(),t.qZA()}}function zs(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mat-option",52),t.NdJ("click",function(){t.CHM(e);const o=t.oxw().$implicit;return t.oxw().onPeerDetach(o)}),t._uU(1,"Disconnect"),t.qZA()}}function Vs(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mat-option",52),t.NdJ("click",function(){t.CHM(e);const o=t.oxw().$implicit;return t.oxw().onConnectPeer(o)}),t._uU(1,"Reconnect"),t.qZA()}}function Gs(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",53),t.TgZ(1,"div",50),t.TgZ(2,"mat-select",51),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",52),t.NdJ("click",function(o){const c=t.CHM(e).$implicit;return t.oxw().onPeerClick(c,o)}),t._uU(5,"View Info"),t.qZA(),t.TgZ(6,"mat-option",52),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw().onOpenChannel(s)}),t._uU(7,"Open Channel"),t.qZA(),t.YNc(8,zs,2,0,"mat-option",54),t.YNc(9,Vs,2,0,"mat-option",54),t.qZA(),t.qZA(),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 Xs(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No connected peer."),t.qZA())}function $s(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting peers..."),t.qZA())}function Ws(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 Ks(n,a){if(1&n&&(t.TgZ(0,"td",55),t.YNc(1,Xs,2,0,"p",56),t.YNc(2,$s,2,0,"p",56),t.YNc(3,Ws,2,1,"p",56),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 js=function(n){return{"display-none":n}};function tl(n,a){if(1&n&&t._UZ(0,"tr",57),2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,js,(null==e.peers?null:e.peers.data)&&(null==e.peers||null==e.peers.data?null:e.peers.data.length)>0))}}function el(n,a){1&n&&t._UZ(0,"tr",58)}function nl(n,a){1&n&&t._UZ(0,"tr",59)}const il=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},al=function(){return["no_peer"]};let ol=(()=>{class n{constructor(e,i,o,s,c){this.logger=e,this.store=i,this.rtlEffects=o,this.actions=s,this.commonService=c,this.faUsers=Z.FVb,this.newlyAddedPeer="",this.displayedColumns=[],this.peerAddress="",this.peersData=[],this.information={},this.availableBalance=0,this.flgSticky=!1,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 d.x,new d.x,new d.x,new d.x,new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===l.cu.XS?(this.flgSticky=!1,this.displayedColumns=["alias","actions"]):this.screenSize===l.cu.SM?(this.flgSticky=!1,this.displayedColumns=["alias","nodeId","address","actions"]):this.screenSize===l.cu.MD?(this.flgSticky=!1,this.displayedColumns=["alias","nodeId","address","channels","actions"]):(this.flgSticky=!0,this.displayedColumns=["alias","nodeId","address","channels","actions"])}ngOnInit(){this.store.select(C.yD).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.information=e}),this.store.select(C.Bo).pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage="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,h.R)(this.unSubs[2])).subscribe(e=>{this.availableBalance=e.onchainBalance.total||0}),this.actions.pipe((0,h.R)(this.unSubs[3]),(0,J.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,b.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:"Peer Information",showQRName:"Public Key",showQRField:e.nodeId,message:o}}}))}onConnectPeer(e){this.store.dispatch((0,b.qR)({payload:{data:{message:{peer:e.nodeId?e:null,information:this.information,balance:this.availableBalance},component:Is}}}))}onOpenChannel(e){this.store.dispatch((0,b.qR)({payload:{data:{alertTitle:"Open Channel",message:{peer:e,information:this.information,balance:this.availableBalance},newlyAdded:!1,component:bt}}}))}onPeerDetach(e){this.store.dispatch(e.channels>0?(0,b.qR)({payload:{data:{type:l.n_.ERROR,alertTitle:"Disconnect Not Allowed",titleMessage:"Channel active with this peer."}}}):(0,b.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,h.R)(this.unSubs[4])).subscribe(i=>{i&&this.store.dispatch((0,N.GD)({payload:{nodeId:e.nodeId}}))})}applyFilter(){this.peers.filter=this.selFilter.trim().toLowerCase()}loadPeersTable(e){this.peers=new r.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.filterPredicate=(i,o)=>JSON.stringify(i).toLowerCase().includes(o),this.peers.paginator=this.paginator,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(F.mQ),t.Y36(S.yh),t.Y36(K.V),t.Y36(z.eX),t.Y36(R.v))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-peers"]],viewQuery:function(e,i){if(1&e&&(t.Gf(A.YE,5),t.Gf(v.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:v.ye,useValue:(0,l.pt)("Peers")}])],decls:42,vars:15,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap"],["peersForm","ngForm"],["mat-flat-button","","color","primary","type","submit","tabindex","1",3,"click"],["fxLayout","column"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxFlex","30"],["fxLayout","row","fxLayoutAlign","start start"],["matInput","","placeholder","Filter",3,"ngModel","keyup","ngModelChange"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","nodeId"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","alias"],["mat-header-cell","","mat-sort-header","","class","px-3",4,"matHeaderCellDef"],["mat-cell","","class","px-3",3,"ngStyle",4,"matCellDef"],["matColumnDef","state"],["mat-cell","",4,"matCellDef"],["matColumnDef","address"],["matColumnDef","channels"],["mat-header-cell","","class","px-2","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","","class","px-2",4,"matCellDef"],["matColumnDef","actions"],["mat-header-cell","","class","px-3",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center","class","px-3",4,"matCellDef"],["matColumnDef","no_peer"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell","",3,"ngStyle"],["mat-header-cell","","mat-sort-header","",1,"px-3"],["mat-cell","",1,"px-3",3,"ngStyle"],["class","dot green","matTooltip","Connected","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot red","matTooltip","Disconnected","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["matTooltip","Connected","matTooltipPosition","right",1,"dot","green",3,"ngClass"],["matTooltip","Disconnected","matTooltipPosition","right",1,"dot","red",3,"ngClass"],["mat-cell",""],["mat-header-cell","","mat-sort-header","",1,"px-2"],["mat-cell","",1,"px-2"],["mat-header-cell","",1,"px-3"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"px-3"],[3,"click",4,"ngIf"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.TgZ(1,"form",1,2),t.TgZ(3,"button",3),t.NdJ("click",function(){return i.onConnectPeer({})}),t._uU(4,"Add Peer"),t.qZA(),t.qZA(),t.TgZ(5,"div",4),t.TgZ(6,"div",5),t.TgZ(7,"div",6),t._UZ(8,"fa-icon",7),t.TgZ(9,"span",8),t._uU(10,"Peers"),t.qZA(),t.qZA(),t.TgZ(11,"mat-form-field",9),t.TgZ(12,"div",10),t.TgZ(13,"input",11),t.NdJ("keyup",function(){return i.applyFilter()})("ngModelChange",function(s){return i.selFilter=s}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"div",12),t.YNc(15,Os,1,0,"mat-progress-bar",13),t.TgZ(16,"table",14,15),t.ynx(18,16),t.YNc(19,Fs,2,0,"th",17),t.YNc(20,Rs,2,4,"td",18),t.BQk(),t.ynx(21,19),t.YNc(22,Ns,2,0,"th",20),t.YNc(23,Ds,4,6,"td",21),t.BQk(),t.ynx(24,22),t.YNc(25,Us,2,0,"th",17),t.YNc(26,Ms,2,1,"td",23),t.BQk(),t.ynx(27,24),t.YNc(28,Js,2,0,"th",17),t.YNc(29,Qs,2,4,"td",18),t.BQk(),t.ynx(30,25),t.YNc(31,Ys,2,0,"th",26),t.YNc(32,Hs,2,1,"td",27),t.BQk(),t.ynx(33,28),t.YNc(34,Bs,6,0,"th",29),t.YNc(35,Gs,10,2,"td",30),t.BQk(),t.ynx(36,31),t.YNc(37,Ks,4,3,"td",32),t.BQk(),t.YNc(38,tl,1,3,"tr",33),t.YNc(39,el,1,0,"tr",34),t.YNc(40,nl,1,0,"tr",35),t.qZA(),t.qZA(),t._UZ(41,"mat-paginator",36),t.qZA(),t.qZA()),2&e&&(t.xp6(8),t.Q6J("icon",i.faUsers),t.xp6(5),t.Q6J("ngModel",i.selFilter),t.xp6(2),t.Q6J("ngIf",i.apiCallStatus.status===i.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",i.peers)("ngClass",t.VKq(12,il,""!==i.errorMessage)),t.xp6(22),t.Q6J("matFooterRowDef",t.DdM(14,al)),t.xp6(1),t.Q6J("matHeaderRowDef",i.displayedColumns)("matHeaderRowDefSticky",i.flgSticky),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumns),t.xp6(1),t.Q6J("pageSize",i.pageSize)("pageSizeOptions",i.pageSizeOptions)("showFirstLastButtons",i.screenSize!==i.screenSizeEnum.XS))},directives:[p.xw,p.yH,p.Wh,m._Y,m.JL,m.F,q.lW,I.BN,y.KE,U.Nt,m.Fj,m.JJ,m.On,Q.$V,u.O5,r.BZ,A.YE,u.mk,w.oO,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,v.NW,M.pW,r.ge,A.nU,r.ev,u.PC,w.Zl,V.gM,P.gD,P.$L,Y.ey,r.yh,r.Q2,r.XQ,r.Gk],styles:[".mat-column-alias[_ngcontent-%COMP%]{flex:1 1 10%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-column-nodeId[_ngcontent-%COMP%]{flex:1 1 10%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-right:2rem}.mat-column-address[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),n})();const sl=["queryRoutesForm"];function ll(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Destination Node ID is required."),t.qZA())}function rl(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Amount is required."),t.qZA())}function cl(n,a){1&n&&t._UZ(0,"mat-progress-bar",21)}function ul(n,a){1&n&&(t.TgZ(0,"th",40),t._uU(1," Alias "),t.qZA())}function pl(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.hij(" ",null==e?null:e.alias," ")}}function ml(n,a){1&n&&(t.TgZ(0,"th",40),t._uU(1," ID "),t.qZA())}function dl(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.hij(" ",null==e?null:e.nodeId," ")}}function hl(n,a){1&n&&(t.TgZ(0,"th",42),t.TgZ(1,"span",43),t._uU(2,"Actions"),t.qZA(),t.qZA())}function gl(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",44),t.TgZ(1,"button",45),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw(2).onHopClick(s)}),t._uU(2,"View Info"),t.qZA(),t.qZA()}}function _l(n,a){1&n&&t._UZ(0,"tr",46)}function fl(n,a){1&n&&t._UZ(0,"tr",47)}const Cl=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}};function xl(n,a){if(1&n&&(t.TgZ(0,"div",22),t.TgZ(1,"mat-expansion-panel",23),t.TgZ(2,"mat-expansion-panel-header"),t.TgZ(3,"mat-panel-title",24),t.TgZ(4,"span",25),t._uU(5),t.qZA(),t.TgZ(6,"span",26),t._uU(7),t.ALo(8,"number"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(9,"mat-panel-description",27),t.TgZ(10,"div",28),t.TgZ(11,"table",29,30),t.ynx(13,31),t.YNc(14,ul,2,0,"th",32),t.YNc(15,pl,2,1,"td",33),t.BQk(),t.ynx(16,34),t.YNc(17,ml,2,0,"th",32),t.YNc(18,dl,2,1,"td",33),t.BQk(),t.ynx(19,35),t.YNc(20,hl,3,0,"th",36),t.YNc(21,gl,3,0,"td",37),t.BQk(),t.YNc(22,_l,1,0,"tr",38),t.YNc(23,fl,1,0,"tr",39),t.qZA(),t.qZA(),t.qZA(),t.qZA(),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,7,e.amount/1e3)),t.xp6(4),t.Q6J("dataSource",o.qrHops[i])("ngClass",t.VKq(9,Cl,"error"===o.flgLoading[0])),t.xp6(11),t.Q6J("matHeaderRowDef",o.displayedColumns)("matHeaderRowDefSticky",o.flgSticky),t.xp6(1),t.Q6J("matRowDefColumns",o.displayedColumns)}}let yl=(()=>{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.flgSticky=!1,this.flgLoading=[!1],this.faRoute=Z.FpQ,this.faExclamationTriangle=Z.eHv,this.screenSize="",this.screenSizeEnum=l.cu,this.unSubs=[new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===l.cu.XS?(this.flgSticky=!1,this.displayedColumns=["alias","actions"]):this.screenSize===l.cu.SM||this.screenSize===l.cu.MD?(this.flgSticky=!1,this.displayedColumns=["alias","nodeId","actions"]):(this.flgSticky=!0,this.displayedColumns=["alias","nodeId","actions"])}ngOnInit(){this.qrHops[0]=new r.by([]),this.qrHops[0].data=[],this.eclEffects.setQueryRoutes.pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{e&&e.routes&&e.routes.length?(this.flgLoading[0]=!1,this.allQRoutes=e.routes,this.allQRoutes.forEach((i,o)=>{this.qrHops[o]=new r.by([...i.nodeIds])})):(this.flgLoading[0]="error",this.allQRoutes=[],this.qrHops=[])})}onQueryRoutes(){if(!this.nodeId||!this.amount)return!0;this.qrHops=[],this.flgLoading[0]=!0,this.store.dispatch((0,N.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,b.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(S.yh),t.Y36(at.o),t.Y36(R.v))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-query-routes"]],viewQuery:function(e,i){if(1&e&&t.Gf(sl,7),2&e){let o;t.iGM(o=t.CRH())&&(i.form=o.first)}},decls:28,vars:10,consts:[["fxLayout","column","fxFlex","100"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap",3,"ngSubmit"],["queryRoutesForm","ngForm"],["fxFlex","100",1,"alert","alert-warn"],[1,"mr-1","alert-icon",3,"icon"],["fxFlex","69","fxLayoutAlign","start end"],["matInput","","placeholder","Destination Node ID","name","nodeId","tabindex","1","required","",3,"ngModel","ngModelChange"],["destPubkey","ngModel"],[4,"ngIf"],["fxFlex","29","fxLayoutAlign","start end"],["matInput","","placeholder","Amount (Sats)","name","amount","tabindex","2","type","number","required","",3,"ngModel","step","min","ngModelChange"],["fxLayout","row",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","3","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","type","submit","tabindex","4"],["fxLayout","row","fxLayoutAlign","start center",1,"page-sub-title-container","mt-2","mb-1"],["fxFlex","70"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["mode","indeterminate",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start",1,"padding-gap-x"],["fxFlex","100",4,"ngFor","ngForOf"],["mode","indeterminate"],["fxFlex","100"],[1,"flat-expansion-panel","help-expansion","mb-2px"],["fxLayout","row","fxLayoutAlign","space-between start"],["fxFlex","50","fxLayoutAlign","start start"],["fxFlex","50","fxLayoutAlign","end end"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between stretch",1,"table-container","mb-2",3,"perfectScrollbar"],["mat-table","",3,"dataSource","ngClass"],["table[i]",""],["matColumnDef","alias"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","nodeId"],["matColumnDef","actions"],["mat-header-cell","","class","pl-4 pr-3",4,"matHeaderCellDef"],["mat-cell","","class","pl-4",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],["mat-header-cell","",1,"pl-4","pr-3"],["fxLayoutAlign","end center"],["mat-cell","",1,"pl-4"],["mat-stroked-button","","color","primary","type","button","tabindex","4",3,"click"],["mat-header-row",""],["mat-row",""]],template:function(e,i){if(1&e){const o=t.EpF();t.TgZ(0,"div",0),t.TgZ(1,"form",1,2),t.NdJ("ngSubmit",function(){return t.CHM(o),t.MAs(2).form.valid&&i.onQueryRoutes()}),t.TgZ(3,"div",3),t._UZ(4,"fa-icon",4),t.TgZ(5,"span"),t._uU(6,"The actual routing fee on a payment can be different from the fee shown on query routes."),t.qZA(),t.qZA(),t.TgZ(7,"mat-form-field",5),t.TgZ(8,"input",6,7),t.NdJ("ngModelChange",function(c){return i.nodeId=c}),t.qZA(),t.YNc(10,ll,2,0,"mat-error",8),t.qZA(),t.TgZ(11,"mat-form-field",9),t.TgZ(12,"input",10),t.NdJ("ngModelChange",function(c){return i.amount=c}),t.qZA(),t.YNc(13,rl,2,0,"mat-error",8),t.qZA(),t.TgZ(14,"div",11),t.TgZ(15,"button",12),t.NdJ("click",function(){return i.resetData()}),t._uU(16,"Clear"),t.qZA(),t.TgZ(17,"button",13),t._uU(18,"Query Route"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(19,"div",14),t.TgZ(20,"div",15),t._UZ(21,"fa-icon",16),t.TgZ(22,"span",17),t._uU(23,"Transaction Route"),t.qZA(),t.qZA(),t.qZA(),t.YNc(24,cl,1,0,"mat-progress-bar",18),t.TgZ(25,"div",19),t.TgZ(26,"div",0),t.YNc(27,xl,24,11,"div",20),t.qZA(),t.qZA(),t.qZA()}2&e&&(t.xp6(4),t.Q6J("icon",i.faExclamationTriangle),t.xp6(4),t.Q6J("ngModel",i.nodeId),t.xp6(2),t.Q6J("ngIf",!i.nodeId),t.xp6(2),t.Q6J("ngModel",i.amount)("step",1e3)("min",0),t.xp6(1),t.Q6J("ngIf",!i.amount),t.xp6(8),t.Q6J("icon",i.faRoute),t.xp6(3),t.Q6J("ngIf",!0===i.flgLoading[0]),t.xp6(3),t.Q6J("ngForOf",i.allQRoutes))},directives:[p.xw,p.yH,m._Y,m.JL,m.F,p.Wh,I.BN,y.KE,U.Nt,m.Fj,m.Q7,m.JJ,m.On,u.O5,m.wV,m.qQ,$.q,q.lW,u.sg,y.TO,M.pW,H.ib,H.yz,H.yK,H.u4,Q.$V,r.BZ,u.mk,w.oO,r.w1,r.fO,r.Dz,r.as,r.nj,r.ge,r.ev,r.XQ,r.Gk],pipes:[u.JJ],styles:[".mat-column-actions[_ngcontent-%COMP%]{flex:0 0 5%;width:5%}.mat-column-pubkey_alias[_ngcontent-%COMP%]{flex:1 1 25%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),n})();function Zl(n,a){1&n&&t._UZ(0,"mat-progress-bar",29)}function Tl(n,a){1&n&&(t.TgZ(0,"th",30),t._uU(1," State "),t.qZA())}function Al(n,a){if(1&n&&(t.TgZ(0,"span",36),t._UZ(1,"fa-icon",37),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("icon",e.faEyeSlash)}}function Ll(n,a){if(1&n&&(t.TgZ(0,"span",38),t._UZ(1,"fa-icon",37),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("icon",e.faEye)}}const Et=function(n){return{"max-width":n}};function vl(n,a){if(1&n&&(t.TgZ(0,"td",31),t.TgZ(1,"div",32),t.YNc(2,Al,2,1,"span",33),t.YNc(3,Ll,2,1,"span",34),t.TgZ(4,"span",35),t._uU(5),t.ALo(6,"titlecase"),t.qZA(),t.qZA(),t.qZA()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(6,Et,i.screenSize===i.screenSizeEnum.XS?"10rem":"20rem")),t.xp6(1),t.Q6J("ngIf",0===e.channelFlags),t.xp6(1),t.Q6J("ngIf",0!==e.channelFlags),t.xp6(2),t.Oqu(t.lcZ(6,4,null==e?null:e.state))}}function bl(n,a){1&n&&(t.TgZ(0,"th",30),t._uU(1," Short Channel ID "),t.qZA())}function Sl(n,a){if(1&n&&(t.TgZ(0,"td",31),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Oqu(null==e?null:e.shortChannelId)}}function wl(n,a){1&n&&(t.TgZ(0,"th",30),t._uU(1," Alias "),t.qZA())}function El(n,a){if(1&n&&(t.TgZ(0,"td",31),t.TgZ(1,"div",32),t.TgZ(2,"span",35),t._uU(3),t.qZA(),t.qZA(),t.qZA()),2&n){const e=a.$implicit,i=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Et,i.screenSize===i.screenSizeEnum.XS?"10rem":"20rem")),t.xp6(2),t.Oqu(e.alias)}}function ql(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1," Local Balance (Sats) "),t.qZA())}function Il(n,a){if(1&n&&(t.TgZ(0,"td",31),t.TgZ(1,"span",40),t._uU(2),t.ALo(3,"number"),t.qZA(),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 Ol(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1," Remote Balance (Sats) "),t.qZA())}function Fl(n,a){if(1&n&&(t.TgZ(0,"td",31),t.TgZ(1,"span",40),t._uU(2),t.ALo(3,"number"),t.qZA(),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 Rl(n,a){1&n&&(t.TgZ(0,"th",41),t._uU(1,"Balance Score "),t.qZA())}function Nl(n,a){if(1&n&&(t.TgZ(0,"td",42),t.TgZ(1,"div",43),t.TgZ(2,"mat-hint",44),t._uU(3),t.ALo(4,"number"),t.qZA(),t.qZA(),t._UZ(5,"mat-progress-bar",45),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 kl(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",46),t.TgZ(1,"div",47),t.TgZ(2,"mat-select",48),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",49),t.NdJ("click",function(){return t.CHM(e),t.oxw().onDownloadCSV()}),t._uU(5,"Download CSV"),t.qZA(),t.qZA(),t.qZA(),t.qZA()}}function Pl(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",50),t.TgZ(1,"div",51),t.TgZ(2,"mat-select",52),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",49),t.NdJ("click",function(o){const c=t.CHM(e).$implicit;return t.oxw().onChannelClick(c,o)}),t._uU(5,"View Info"),t.qZA(),t.TgZ(6,"mat-option",49),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw().onChannelClose(s,!0)}),t._uU(7,"Force Close"),t.qZA(),t.qZA(),t.qZA(),t.qZA()}}function Dl(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No inactive channel available."),t.qZA())}function Ul(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting inactive channels..."),t.qZA())}function Ml(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 Jl(n,a){if(1&n&&(t.TgZ(0,"td",53),t.YNc(1,Dl,2,0,"p",54),t.YNc(2,Ul,2,0,"p",54),t.YNc(3,Ml,2,1,"p",54),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 Yl(n,a){if(1&n&&t._UZ(0,"tr",55),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 Hl(n,a){1&n&&t._UZ(0,"tr",56)}function Bl(n,a){1&n&&t._UZ(0,"tr",57)}const zl=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},Vl=function(){return["no_channel"]};let Gl=(()=>{class n{constructor(e,i,o,s){this.logger=e,this.store=i,this.rtlEffects=o,this.commonService=s,this.faEye=Z.Mdf,this.faEyeSlash=Z.Aq,this.totalBalance=0,this.displayedColumns=[],this.myChanPolicy={},this.information={},this.numPeers=-1,this.feeRateTypes=l.vn,this.selFilter="",this.flgSticky=!1,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 d.x,new d.x,new d.x,new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===l.cu.XS||this.screenSize===l.cu.SM?(this.flgSticky=!1,this.displayedColumns=["state","alias","toLocal","toRemote","actions"]):this.screenSize===l.cu.MD?(this.flgSticky=!1,this.displayedColumns=["state","shortChannelId","alias","toLocal","toRemote","actions"]):(this.flgSticky=!0,this.displayedColumns=["state","shortChannelId","alias","toLocal","toRemote","balancedness","actions"])}ngOnInit(){this.store.select(C.Xz).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage="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,h.R)(this.unSubs[1])).subscribe(e=>{this.information=e}),this.store.select(C.Bo).pipe((0,h.R)(this.unSubs[2])).subscribe(e=>{this.numPeers=e.peers&&e.peers.length?e.peers.length:0}),this.store.select(C.kY).pipe((0,h.R)(this.unSubs[3])).subscribe(e=>{this.totalBalance=e.onchainBalance.total})}ngAfterViewInit(){this.inactiveChannels.length>0&&this.loadChannelsTable()}onChannelClose(e,i){this.store.dispatch((0,b.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,h.R)(this.unSubs[4])).subscribe(_=>{_&&this.store.dispatch((0,N.BL)({payload:{channelId:e.channelId,force:i}}))})}applyFilter(){this.channels.filter=this.selFilter.trim().toLocaleLowerCase()}onChannelClick(e,i){this.store.dispatch((0,b.qR)({payload:{data:{channel:e,channelsType:"inactive",component:st}}}))}loadChannelsTable(){this.inactiveChannels.sort((e,i)=>e.alias===i.alias?0:i.alias?1:-1),this.channels=new r.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.filterPredicate=(e,i)=>JSON.stringify(e).toLowerCase().includes(i),this.channels.paginator=this.paginator,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(F.mQ),t.Y36(S.yh),t.Y36(K.V),t.Y36(R.v))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-inactive-table"]],viewQuery:function(e,i){if(1&e&&(t.Gf(A.YE,5),t.Gf(v.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:v.ye,useValue:(0,l.pt)("Channels")}])],decls:36,vars:14,consts:[["fxLayout","column",1,"padding-gap"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],["fxFlex","30"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","keyup","ngModelChange"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","state"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","shortChannelId"],["matColumnDef","alias"],["matColumnDef","toLocal"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","toRemote"],["matColumnDef","balancedness"],["mat-header-cell","","mat-sort-header","","class","pl-3",4,"matHeaderCellDef"],["mat-cell","","class","pl-3",4,"matCellDef"],["matColumnDef","actions"],["mat-header-cell","","class","pl-1",4,"matHeaderCellDef"],["mat-cell","","class","pl-1","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_channel"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"ellipsis-parent",3,"ngStyle"],["class","mr-1","matTooltip","Private","matTooltipPosition","right",4,"ngIf"],["class","mr-1","matTooltip","Public","matTooltipPosition","right",4,"ngIf"],[1,"ellipsis-child"],["matTooltip","Private","matTooltipPosition","right",1,"mr-1"],[3,"icon"],["matTooltip","Public","matTooltipPosition","right",1,"mr-1"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell","","mat-sort-header","",1,"pl-3"],["mat-cell","",1,"pl-3"],["fxLayout","row"],["fxFlex","100","fxLayoutAlign","center center",1,"font-size-80"],["mode","determinate",3,"value"],["mat-header-cell","",1,"pl-1"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"pl-1"],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","2",1,"mr-0"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.TgZ(1,"div",1),t._UZ(2,"div",2),t.TgZ(3,"mat-form-field",3),t.TgZ(4,"input",4),t.NdJ("keyup",function(){return i.applyFilter()})("ngModelChange",function(s){return i.selFilter=s}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(5,"div",5),t.YNc(6,Zl,1,0,"mat-progress-bar",6),t.TgZ(7,"table",7,8),t.ynx(9,9),t.YNc(10,Tl,2,0,"th",10),t.YNc(11,vl,7,8,"td",11),t.BQk(),t.ynx(12,12),t.YNc(13,bl,2,0,"th",10),t.YNc(14,Sl,2,1,"td",11),t.BQk(),t.ynx(15,13),t.YNc(16,wl,2,0,"th",10),t.YNc(17,El,4,4,"td",11),t.BQk(),t.ynx(18,14),t.YNc(19,ql,2,0,"th",15),t.YNc(20,Il,4,4,"td",11),t.BQk(),t.ynx(21,16),t.YNc(22,Ol,2,0,"th",15),t.YNc(23,Fl,4,4,"td",11),t.BQk(),t.ynx(24,17),t.YNc(25,Rl,2,0,"th",18),t.YNc(26,Nl,6,4,"td",19),t.BQk(),t.ynx(27,20),t.YNc(28,kl,6,0,"th",21),t.YNc(29,Pl,8,0,"td",22),t.BQk(),t.ynx(30,23),t.YNc(31,Jl,4,3,"td",24),t.BQk(),t.YNc(32,Yl,1,3,"tr",25),t.YNc(33,Hl,1,0,"tr",26),t.YNc(34,Bl,1,0,"tr",27),t.qZA(),t.qZA(),t._UZ(35,"mat-paginator",28),t.qZA()),2&e&&(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("dataSource",i.channels)("ngClass",t.VKq(11,zl,""!==i.errorMessage)),t.xp6(25),t.Q6J("matFooterRowDef",t.DdM(13,Vl)),t.xp6(1),t.Q6J("matHeaderRowDef",i.displayedColumns)("matHeaderRowDefSticky",i.flgSticky),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumns),t.xp6(1),t.Q6J("pageSize",i.pageSize)("pageSizeOptions",i.pageSizeOptions)("showFirstLastButtons",i.screenSize!==i.screenSizeEnum.XS))},directives:[p.xw,p.Wh,p.yH,y.KE,U.Nt,m.Fj,m.JJ,m.On,Q.$V,u.O5,r.BZ,A.YE,u.mk,w.oO,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,v.NW,M.pW,r.ge,A.nU,r.ev,u.PC,w.Zl,V.gM,I.BN,y.bx,P.gD,P.$L,Y.ey,r.yh,r.Q2,r.XQ,r.Gk],pipes:[u.rS,u.JJ],styles:[".mat-column-state[_ngcontent-%COMP%]{flex:0 0 15%;width:15%}.mat-column-state[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%]{display:flex}.mat-column-alias[_ngcontent-%COMP%]{flex:0 0 15%;width:15%}.mat-column-alias[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%]{display:flex}.mat-column-balancedness[_ngcontent-%COMP%]{padding-left:3rem;flex:0 0 20%;width:20%}.mat-column-shortChannelId[_ngcontent-%COMP%], .mat-column-toLocal[_ngcontent-%COMP%], .mat-column-toRemote[_ngcontent-%COMP%]{flex:1 1 15%;width:15%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media only screen and (max-width: 37.5em){.mat-column-shortChannelId[_ngcontent-%COMP%], .mat-column-toLocal[_ngcontent-%COMP%], .mat-column-toRemote[_ngcontent-%COMP%]{white-space:unset}}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}.mat-column-actions[_ngcontent-%COMP%] .bordered-box.table-actions-select[_ngcontent-%COMP%]{flex:0 0 100%}@media only screen and (max-width: 37.5em){.mat-column-actions[_ngcontent-%COMP%] .bordered-box.table-actions-select[_ngcontent-%COMP%]{flex:0 0 80%}}"]}),n})(),Xl=(()=>{class n{transform(e,i){return e.replace(/(?:^\w|[A-Z]|\b\w)/g,(o,s)=>o.toUpperCase()).replace(/\s+/g,"").replace(/-/g," ")}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275pipe=t.Yjl({name:"camelcase",type:n,pure:!0}),n})();function $l(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 Wl(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",6),t._UZ(1,"div",7),t.TgZ(2,"mat-form-field",8),t.TgZ(3,"input",9),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().filterValue=o})("input",function(){return t.CHM(e),t.oxw().applyFilter()})("keyup",function(){return t.CHM(e),t.oxw().applyFilter()}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(3),t.Q6J("ngModel",e.filterValue)}}function Kl(n,a){1&n&&t._UZ(0,"mat-progress-bar",32)}function jl(n,a){1&n&&(t.TgZ(0,"th",33),t._uU(1,"Date/Time"),t.qZA())}const tr=function(n){return{"ml-0":n}};function er(n,a){if(1&n&&(t._UZ(0,"span",36),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,tr,i.screenSize===i.screenSizeEnum.XS))}}function nr(n,a){if(1&n&&(t.TgZ(0,"td",34),t.YNc(1,er,2,6,"span",35),t._uU(2),t.ALo(3,"date"),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.Q6J("ngIf","payment-relayed"!==(null==e?null:e.type)),t.xp6(1),t.hij(" ",t.xi3(3,2,null==e?null:e.timestamp,"dd/MMM/y HH:mm")," ")}}function ir(n,a){1&n&&(t.TgZ(0,"th",33),t._uU(1,"In Channel"),t.qZA())}const qt=function(n){return{"max-width":n}};function ar(n,a){if(1&n&&(t.TgZ(0,"td",37),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.Q6J("ngStyle",t.VKq(2,qt,i.screenSize===i.screenSizeEnum.XS?"10rem":"20rem")),t.xp6(1),t.Oqu(null==e?null:e.fromChannelAlias)}}function or(n,a){1&n&&(t.TgZ(0,"th",33),t._uU(1,"Out Channel"),t.qZA())}function sr(n,a){if(1&n&&(t.TgZ(0,"td",37),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.Q6J("ngStyle",t.VKq(2,qt,i.screenSize===i.screenSizeEnum.XS?"10rem":"20rem")),t.xp6(1),t.Oqu(null==e?null:e.toChannelAlias)}}function lr(n,a){1&n&&(t.TgZ(0,"th",38),t._uU(1,"Amount In (Sats)"),t.qZA())}function rr(n,a){if(1&n&&(t.TgZ(0,"td",34),t.TgZ(1,"span",39),t._uU(2),t.ALo(3,"number"),t.qZA(),t.qZA()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,null==e?null:e.amountIn))}}function cr(n,a){1&n&&(t.TgZ(0,"th",38),t._uU(1,"Amount Out (Sats)"),t.qZA())}function ur(n,a){if(1&n&&(t.TgZ(0,"td",34),t.TgZ(1,"span",39),t._uU(2),t.ALo(3,"number"),t.qZA(),t.qZA()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,null==e?null:e.amountOut))}}function pr(n,a){1&n&&(t.TgZ(0,"th",38),t._uU(1,"Fee Earned (Sats)"),t.qZA())}function mr(n,a){if(1&n&&(t.TgZ(0,"td",34),t.TgZ(1,"span",39),t._uU(2),t.ALo(3,"number"),t.qZA(),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 dr(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",40),t.TgZ(1,"div",41),t.TgZ(2,"mat-select",42),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",43),t.NdJ("click",function(){return t.CHM(e),t.oxw(2).onDownloadCSV()}),t._uU(5,"Download CSV"),t.qZA(),t.qZA(),t.qZA(),t.qZA()}}function hr(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",44),t.TgZ(1,"button",45),t.NdJ("click",function(o){const c=t.CHM(e).$implicit;return t.oxw(2).onForwardingEventClick(c,o)}),t._uU(2,"View Info"),t.qZA(),t.qZA()}}function gr(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No forwarding history available."),t.qZA())}function _r(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting forwarding history..."),t.qZA())}function fr(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 Cr(n,a){if(1&n&&(t.TgZ(0,"td",46),t.YNc(1,gr,2,0,"p",47),t.YNc(2,_r,2,0,"p",47),t.YNc(3,fr,2,1,"p",47),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 xr=function(n){return{"display-none":n}};function yr(n,a){if(1&n&&t._UZ(0,"tr",48),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,xr,(null==e.forwardingHistoryEvents?null:e.forwardingHistoryEvents.data)&&(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)>0))}}function Zr(n,a){1&n&&t._UZ(0,"tr",49)}function Tr(n,a){1&n&&t._UZ(0,"tr",50)}const Ar=function(){return["no_event"]};function Lr(n,a){if(1&n&&(t.TgZ(0,"div",10),t.YNc(1,Kl,1,0,"mat-progress-bar",11),t.TgZ(2,"table",12,13),t.ynx(4,14),t.YNc(5,jl,2,0,"th",15),t.YNc(6,nr,4,5,"td",16),t.BQk(),t.ynx(7,17),t.YNc(8,ir,2,0,"th",15),t.YNc(9,ar,2,4,"td",18),t.BQk(),t.ynx(10,19),t.YNc(11,or,2,0,"th",15),t.YNc(12,sr,2,4,"td",18),t.BQk(),t.ynx(13,20),t.YNc(14,lr,2,0,"th",21),t.YNc(15,rr,4,3,"td",16),t.BQk(),t.ynx(16,22),t.YNc(17,cr,2,0,"th",21),t.YNc(18,ur,4,3,"td",16),t.BQk(),t.ynx(19,23),t.YNc(20,pr,2,0,"th",21),t.YNc(21,mr,4,3,"td",16),t.BQk(),t.ynx(22,24),t.YNc(23,dr,6,0,"th",25),t.YNc(24,hr,3,0,"td",26),t.BQk(),t.ynx(25,27),t.YNc(26,Cr,4,3,"td",28),t.BQk(),t.YNc(27,yr,1,3,"tr",29),t.YNc(28,Zr,1,0,"tr",30),t.YNc(29,Tr,1,0,"tr",31),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",e.forwardingHistoryEvents),t.xp6(25),t.Q6J("matFooterRowDef",t.DdM(6,Ar)),t.xp6(1),t.Q6J("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),t.xp6(1),t.Q6J("matRowDefColumns",e.displayedColumns)}}function vr(n,a){if(1&n&&t._UZ(0,"mat-paginator",51),2&n){const e=t.oxw();t.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}let It=(()=>{class n{constructor(e,i,o,s){this.logger=e,this.commonService=i,this.store=o,this.datePipe=s,this.eventsData=[],this.filterValue="",this.displayedColumns=[],this.flgSticky=!1,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 d.x,new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===l.cu.XS?(this.flgSticky=!1,this.displayedColumns=["timestamp","amountIn","actions"]):this.screenSize===l.cu.SM?(this.flgSticky=!1,this.displayedColumns=["timestamp","amountIn","fee","actions"]):this.screenSize===l.cu.MD?(this.flgSticky=!1,this.displayedColumns=["timestamp","amountIn","amountOut","fee","actions"]):(this.flgSticky=!0,this.displayedColumns=["timestamp","fromChannelAlias","toChannelAlias","amountIn","amountOut","fee","actions"])}ngOnInit(){this.store.select(C.PP).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{0===this.eventsData.length&&(this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage="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.loadForwardingEventsTable(this.eventsData),this.logger.info(this.eventsData))})}ngAfterViewInit(){this.eventsData.length>0&&this.loadForwardingEventsTable(this.eventsData)}ngOnChanges(e){e.eventsData&&(this.apiCallStatus={status:l.Bn.COMPLETED,action:"FetchPayments"},this.eventsData=e.eventsData.currentValue,e.eventsData.firstChange||this.loadForwardingEventsTable(this.eventsData)),e.filterValue&&!e.filterValue.firstChange&&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/1e3),title:"Date/Time",width:50,type:l.Gi.DATE_TIME},{key:"fee",value:e.amountIn-e.amountOut,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,b.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:"Event Information",message:o}}}))}loadForwardingEventsTable(e){this.forwardingHistoryEvents=new r.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.filterPredicate=(i,o)=>((i.timestamp?this.datePipe.transform(new Date(i.timestamp),"dd/MMM/YYYY HH:mm").toLowerCase():"")+JSON.stringify(i).toLowerCase()).includes(o),this.forwardingHistoryEvents.paginator=this.paginator,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")}applyFilter(){this.forwardingHistoryEvents&&(this.forwardingHistoryEvents.filter=this.filterValue.trim().toLowerCase())}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(F.mQ),t.Y36(R.v),t.Y36(S.yh),t.Y36(u.uU))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-forwarding-history"]],viewQuery:function(e,i){if(1&e&&(t.Gf(A.YE,5),t.Gf(v.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:{eventsData:"eventsData",filterValue:"filterValue"},features:[t._Bn([{provide:v.ye,useValue:(0,l.pt)("Events")}]),t.TTD],decls:5,vars:4,consts:[["fxLayout","column","fxLayoutAlign","start stretch",1,"padding-gap-x"],["class","p-2 error-border my-2",4,"ngIf"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch","class","page-sub-title-container",4,"ngIf"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100","class","table-container",3,"perfectScrollbar",4,"ngIf"],["class","mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons",4,"ngIf"],[1,"p-2","error-border","my-2"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],["fxFlex","30"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",1,"overflow-auto",3,"dataSource"],["table",""],["matColumnDef","timestamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","fromChannelAlias"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","toChannelAlias"],["matColumnDef","amountIn"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","amountOut"],["matColumnDef","fee"],["matColumnDef","actions"],["mat-header-cell","","class","px-3",4,"matHeaderCellDef"],["mat-cell","","class","px-3","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_event"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["class","dot yellow","matTooltipPosition","right",3,"matTooltip","ngClass",4,"ngIf"],["matTooltipPosition","right",1,"dot","yellow",3,"matTooltip","ngClass"],["mat-cell","",3,"ngStyle"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell","",1,"px-3"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"px-3"],["mat-stroked-button","","color","primary","type","button","tabindex","4",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.YNc(1,$l,2,1,"div",1),t.YNc(2,Wl,4,1,"div",2),t.YNc(3,Lr,30,7,"div",3),t.YNc(4,vr,1,3,"mat-paginator",4),t.qZA()),2&e&&(t.xp6(1),t.Q6J("ngIf",""!==i.errorMessage),t.xp6(1),t.Q6J("ngIf",""===i.errorMessage),t.xp6(1),t.Q6J("ngIf",""===i.errorMessage),t.xp6(1),t.Q6J("ngIf",""===i.errorMessage))},directives:[p.xw,p.Wh,u.O5,p.yH,y.KE,U.Nt,m.Fj,m.JJ,m.On,Q.$V,r.BZ,A.YE,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,M.pW,r.ge,A.nU,r.ev,V.gM,u.mk,w.oO,u.PC,w.Zl,P.gD,P.$L,Y.ey,q.lW,r.yh,r.Q2,r.XQ,r.Gk,v.NW],pipes:[u.uU,Xl,u.JJ],styles:[".mat-column-fromAlias[_ngcontent-%COMP%]{padding-left:2rem;flex:1 1 20%;width:20%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-column-toAlias[_ngcontent-%COMP%]{padding-left:1rem;flex:1 1 20%;width:20%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),n})();const br=["tableIn"],Sr=["tableOut"],wr=["paginatorIn"],Er=["paginatorOut"];function qr(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 Ir(n,a){1&n&&t._UZ(0,"mat-progress-bar",36)}function Or(n,a){1&n&&(t.TgZ(0,"th",37),t._uU(1,"Channel ID"),t.qZA())}const tt=function(n){return{"max-width":n}};function Fr(n,a){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.Q6J("ngStyle",t.VKq(2,tt,i.screenSize===i.screenSizeEnum.XS?"5rem":"10rem")),t.xp6(1),t.Oqu(e.channelId)}}function Rr(n,a){1&n&&(t.TgZ(0,"th",37),t._uU(1,"Peer Alias"),t.qZA())}function Nr(n,a){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.Q6J("ngStyle",t.VKq(2,tt,i.screenSize===i.screenSizeEnum.XS?"5rem":"10rem")),t.xp6(1),t.Oqu(e.alias)}}function kr(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Events"),t.qZA())}function Pr(n,a){if(1&n&&(t.TgZ(0,"td",40),t.TgZ(1,"span",41),t._uU(2),t.ALo(3,"number"),t.qZA(),t.qZA()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.events))}}function Dr(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Amount (Sats)"),t.qZA())}function Ur(n,a){if(1&n&&(t.TgZ(0,"td",40),t.TgZ(1,"span",41),t._uU(2),t.ALo(3,"number"),t.qZA(),t.qZA()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.totalAmount))}}function Mr(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Fee (Sats)"),t.qZA())}function Jr(n,a){if(1&n&&(t.TgZ(0,"td",40),t.TgZ(1,"span",41),t._uU(2),t.ALo(3,"number"),t.qZA(),t.qZA()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.totalFee))}}function Qr(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No incoming routing peer available."),t.qZA())}function Yr(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting incoming routing peers..."),t.qZA())}function Hr(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 Br(n,a){if(1&n&&(t.TgZ(0,"td",42),t.YNc(1,Qr,2,0,"p",43),t.YNc(2,Yr,2,0,"p",43),t.YNc(3,Hr,2,1,"p",43),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 Ot=function(n){return{"display-none":n}};function zr(n,a){if(1&n&&t._UZ(0,"tr",44),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,Ot,(null==e.RoutingPeersIncoming?null:e.RoutingPeersIncoming.data)&&(null==e.RoutingPeersIncoming||null==e.RoutingPeersIncoming.data?null:e.RoutingPeersIncoming.data.length)>0))}}function Vr(n,a){1&n&&t._UZ(0,"tr",45)}function Gr(n,a){1&n&&t._UZ(0,"tr",46)}function Xr(n,a){1&n&&t._UZ(0,"mat-progress-bar",36)}function $r(n,a){1&n&&(t.TgZ(0,"th",37),t._uU(1,"Channel ID"),t.qZA())}function Wr(n,a){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.Q6J("ngStyle",t.VKq(2,tt,i.screenSize===i.screenSizeEnum.XS?"5rem":"10rem")),t.xp6(1),t.Oqu(e.channelId)}}function Kr(n,a){1&n&&(t.TgZ(0,"th",37),t._uU(1,"Peer Alias"),t.qZA())}function jr(n,a){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.Q6J("ngStyle",t.VKq(2,tt,i.screenSize===i.screenSizeEnum.XS?"5rem":"10rem")),t.xp6(1),t.Oqu(e.alias)}}function tc(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Events"),t.qZA())}function ec(n,a){if(1&n&&(t.TgZ(0,"td",40),t.TgZ(1,"span",41),t._uU(2),t.ALo(3,"number"),t.qZA(),t.qZA()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.events))}}function nc(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Amount (Sats)"),t.qZA())}function ic(n,a){if(1&n&&(t.TgZ(0,"td",40),t.TgZ(1,"span",41),t._uU(2),t.ALo(3,"number"),t.qZA(),t.qZA()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.totalAmount))}}function ac(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Fee (Sats)"),t.qZA())}function oc(n,a){if(1&n&&(t.TgZ(0,"td",40),t.TgZ(1,"span",41),t._uU(2),t.ALo(3,"number"),t.qZA(),t.qZA()),2&n){const e=a.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.totalFee))}}function sc(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No outgoing routing peer available."),t.qZA())}function lc(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting outgoing routing peers..."),t.qZA())}function rc(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 cc(n,a){if(1&n&&(t.TgZ(0,"td",42),t.YNc(1,sc,2,0,"p",43),t.YNc(2,lc,2,0,"p",43),t.YNc(3,rc,2,1,"p",43),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 uc(n,a){if(1&n&&t._UZ(0,"tr",44),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,Ot,(null==e.RoutingPeersOutgoing?null:e.RoutingPeersOutgoing.data)&&(null==e.RoutingPeersOutgoing||null==e.RoutingPeersOutgoing.data?null:e.RoutingPeersOutgoing.data.length)>0))}}function pc(n,a){1&n&&t._UZ(0,"tr",45)}function mc(n,a){1&n&&t._UZ(0,"tr",46)}const dc=function(n,a){return{"mt-2":n,"mt-1":a}},hc=function(){return["no_incoming_event"]},gc=function(n){return{"mt-2":n}},_c=function(){return["no_outgoing_event"]};function fc(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",4),t.TgZ(1,"div",5),t.TgZ(2,"div",6),t.TgZ(3,"div",7),t._uU(4,"Incoming"),t.qZA(),t.TgZ(5,"mat-form-field",8),t.TgZ(6,"input",9),t.NdJ("keyup",function(){return t.CHM(e),t.oxw().applyIncomingFilter()})("ngModelChange",function(o){return t.CHM(e),t.oxw().filterIn=o}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(7,"div",10),t.YNc(8,Ir,1,0,"mat-progress-bar",11),t.TgZ(9,"table",12,13),t.ynx(11,14),t.YNc(12,Or,2,0,"th",15),t.YNc(13,Fr,2,4,"td",16),t.BQk(),t.ynx(14,17),t.YNc(15,Rr,2,0,"th",15),t.YNc(16,Nr,2,4,"td",16),t.BQk(),t.ynx(17,18),t.YNc(18,kr,2,0,"th",19),t.YNc(19,Pr,4,3,"td",20),t.BQk(),t.ynx(20,21),t.YNc(21,Dr,2,0,"th",19),t.YNc(22,Ur,4,3,"td",20),t.BQk(),t.ynx(23,22),t.YNc(24,Mr,2,0,"th",19),t.YNc(25,Jr,4,3,"td",20),t.BQk(),t.ynx(26,23),t.YNc(27,Br,4,3,"td",24),t.BQk(),t.YNc(28,zr,1,3,"tr",25),t.YNc(29,Vr,1,0,"tr",26),t.YNc(30,Gr,1,0,"tr",27),t.qZA(),t.qZA(),t._UZ(31,"mat-paginator",28,29),t.qZA(),t.TgZ(33,"div",30),t.TgZ(34,"div",6),t.TgZ(35,"div",7),t._uU(36,"Outgoing"),t.qZA(),t.TgZ(37,"mat-form-field",8),t.TgZ(38,"input",9),t.NdJ("keyup",function(){return t.CHM(e),t.oxw().applyOutgoingFilter()})("ngModelChange",function(o){return t.CHM(e),t.oxw().filterOut=o}),t.qZA(),t.qZA(),t.qZA(),t.TgZ(39,"div",31),t.YNc(40,Xr,1,0,"mat-progress-bar",11),t.TgZ(41,"table",32,33),t.ynx(43,14),t.YNc(44,$r,2,0,"th",15),t.YNc(45,Wr,2,4,"td",16),t.BQk(),t.ynx(46,17),t.YNc(47,Kr,2,0,"th",15),t.YNc(48,jr,2,4,"td",16),t.BQk(),t.ynx(49,18),t.YNc(50,tc,2,0,"th",19),t.YNc(51,ec,4,3,"td",20),t.BQk(),t.ynx(52,21),t.YNc(53,nc,2,0,"th",19),t.YNc(54,ic,4,3,"td",20),t.BQk(),t.ynx(55,22),t.YNc(56,ac,2,0,"th",19),t.YNc(57,oc,4,3,"td",20),t.BQk(),t.ynx(58,34),t.YNc(59,cc,4,3,"td",24),t.BQk(),t.YNc(60,uc,1,3,"tr",25),t.YNc(61,pc,1,0,"tr",26),t.YNc(62,mc,1,0,"tr",27),t.qZA(),t._UZ(63,"mat-paginator",28,35),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(2),t.Q6J("ngClass",t.WLB(22,dc,e.screenSize===e.screenSizeEnum.XS,e.screenSize===e.screenSizeEnum.SM)),t.xp6(4),t.Q6J("ngModel",e.filterIn),t.xp6(2),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",e.RoutingPeersIncoming),t.xp6(19),t.Q6J("matFooterRowDef",t.DdM(25,hc)),t.xp6(1),t.Q6J("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),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,gc,e.screenSize!==e.screenSizeEnum.LG)),t.xp6(4),t.Q6J("ngModel",e.filterOut),t.xp6(2),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",e.RoutingPeersOutgoing),t.xp6(19),t.Q6J("matFooterRowDef",t.DdM(28,_c)),t.xp6(1),t.Q6J("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),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 Cc=(()=>{class n{constructor(e,i,o){this.logger=e,this.commonService=i,this.store=o,this.routingPeersData=[],this.displayedColumns=[],this.flgSticky=!1,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 d.x,new d.x,new d.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===l.cu.XS?(this.flgSticky=!1,this.displayedColumns=["alias","totalFee"]):this.screenSize===l.cu.SM?(this.flgSticky=!1,this.displayedColumns=["alias","events","totalFee"]):this.screenSize===l.cu.MD?(this.flgSticky=!1,this.displayedColumns=["alias","events","totalAmount","totalFee"]):(this.flgSticky=!0,this.displayedColumns=["channelId","alias","events","totalAmount","totalFee"])}ngOnInit(){this.store.select(C.PP).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.errorMessage="",this.apiCallStatus=e.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage="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)}loadRoutingPeersTable(e){if(e.length>0){const i=this.groupRoutingPeers(e);this.RoutingPeersIncoming=new r.by(i[0]),this.RoutingPeersIncoming.sort=this.sortIn,this.RoutingPeersIncoming.filterPredicate=(o,s)=>JSON.stringify(o).toLowerCase().includes(s),this.RoutingPeersIncoming.paginator=this.paginatorIn,this.logger.info(this.RoutingPeersIncoming),this.RoutingPeersOutgoing=new r.by(i[1]),this.RoutingPeersOutgoing.sort=this.sortOut,this.RoutingPeersOutgoing.filterPredicate=(o,s)=>JSON.stringify(o).toLowerCase().includes(s),this.RoutingPeersOutgoing.paginator=this.paginatorOut,this.logger.info(this.RoutingPeersOutgoing)}else this.RoutingPeersIncoming=new r.by([]),this.RoutingPeersOutgoing=new r.by([]);this.applyIncomingFilter(),this.applyOutgoingFilter()}groupRoutingPeers(e){const i=[],o=[];return e.forEach(s=>{const c=i.find(O=>O.channelId===s.fromChannelId),_=o.find(O=>O.channelId===s.toChannelId);c?(c.events++,c.totalAmount=+c.totalAmount+ +s.amountIn,c.totalFee=s.amountIn-s.amountOut+ +c.totalFee):i.push({channelId:s.fromChannelId,alias:s.fromChannelAlias,events:1,totalAmount:+s.amountIn,totalFee:s.amountIn-s.amountOut}),_?(_.events++,_.totalAmount=+_.totalAmount+ +s.amountOut,_.totalFee=s.amountIn-s.amountOut+ +_.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")]}applyIncomingFilter(){this.RoutingPeersIncoming.filter=this.filterIn.toLowerCase()}applyOutgoingFilter(){this.RoutingPeersOutgoing.filter=this.filterOut.toLowerCase()}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(F.mQ),t.Y36(R.v),t.Y36(S.yh))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-routing-peers"]],viewQuery:function(e,i){if(1&e&&(t.Gf(br,5,A.YE),t.Gf(Sr,5,A.YE),t.Gf(wr,5),t.Gf(Er,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:v.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",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"],["fxLayout","column","fxFlex","49","fxLayoutAlign","start stretch",1,"mb-4"],["fxLayout","column","fxLayout.gt-sm","row","fxLayoutAlign.gt-sm","space-between center","fxLayoutAlign","start stretch",1,"page-sub-title-container","w-100",3,"ngClass"],["fxFlex","70"],["fxFlex","30"],["matInput","","placeholder","Filter",3,"ngModel","keyup","ngModelChange"],["fxLayout","column","fxLayoutAlign","start start","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","matSort","",1,"overflow-auto","incoming-table",3,"dataSource"],["tableIn",""],["matColumnDef","channelId"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","alias"],["matColumnDef","events"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","totalAmount"],["matColumnDef","totalFee"],["matColumnDef","no_incoming_event"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["paginatorIn",""],["fxLayout","column","fxFlex","49","fxLayoutAlign","end stretch",1,"mb-4"],["fxLayout","column","fxLayoutAlign","start end","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mat-table","","matSort","",1,"overflow-auto","outgoing-table",3,"dataSource"],["tableOut",""],["matColumnDef","no_outgoing_event"],["paginatorOut",""],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell","",3,"ngStyle"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["mat-cell",""],["fxLayoutAlign","end center"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.YNc(1,qr,2,1,"div",1),t.YNc(2,fc,65,29,"div",2),t.qZA()),2&e&&(t.xp6(1),t.Q6J("ngIf",""!==i.errorMessage),t.xp6(1),t.Q6J("ngIf",""===i.errorMessage))},directives:[p.xw,p.Wh,u.O5,p.yH,u.mk,w.oO,y.KE,U.Nt,m.Fj,m.JJ,m.On,Q.$V,r.BZ,A.YE,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,v.NW,M.pW,r.ge,A.nU,r.ev,u.PC,w.Zl,r.yh,r.Q2,r.XQ,r.Gk],pipes:[u.JJ],styles:[".mat-column-channelId[_ngcontent-%COMP%], .mat-column-alias[_ngcontent-%COMP%]{flex:1 1 10%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),n})();function xc(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",7),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw().activeLink=s.link}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit,i=t.oxw();t.s9C("routerLink",e.link),t.Q6J("active",i.activeLink===e.link),t.xp6(1),t.Oqu(e.name)}}let yc=(()=>{class n{constructor(e){this.router=e,this.faChartBar=Z.koM,this.links=[{link:"routingreport",name:"Routing"},{link:"transactions",name:"Transactions"}],this.activeLink=this.links[0].link,this.unSubs=[new d.x,new d.x,new d.x,new d.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,h.R)(this.unSubs[0]),(0,J.h)(i=>i instanceof x.Av)).subscribe({next:i=>{const o=this.links.find(s=>i.urlAfterRedirects.includes(s.link));this.activeLink=o?o.link:this.links[0].link}})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-reports"]],decls:10,vars:2,consts:[["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x"],["fxLayout","column"],["mat-tab-nav-bar",""],["role","tab","mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["role","tab","mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t._UZ(1,"fa-icon",1),t.TgZ(2,"span",2),t._uU(3,"Reports"),t.qZA(),t.qZA(),t.TgZ(4,"div",3),t.TgZ(5,"mat-card"),t.TgZ(6,"mat-card-content",4),t.TgZ(7,"nav",5),t.YNc(8,xc,2,3,"div",6),t.qZA(),t._UZ(9,"router-outlet"),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.xp6(1),t.Q6J("icon",i.faChartBar),t.xp6(7),t.Q6J("ngForOf",i.links))},directives:[p.xw,p.Wh,I.BN,T.a8,T.dn,k.BU,u.sg,x.lC,k.Nj,x.rH],styles:[""]}),n})();var Ft=g(7772),Rt=g(7671),Nt=g(6046);function Zc(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 Tc(n,a){1&n&&(t.TgZ(0,"div",14),t._uU(1,"No routing report for the selected period"),t.qZA())}function Ac(n,a){if(1&n&&(t.TgZ(0,"span"),t.TgZ(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(),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 Lc(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"ngx-charts-bar-vertical",15),t.NdJ("select",function(o){return t.CHM(e),t.oxw().onChartBarSelected(o)})("mouseup",function(o){return t.CHM(e),t.oxw().onChartMouseUp(o)}),t.YNc(1,Ac,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 vc(n,a){if(1&n&&t._UZ(0,"rtl-ecl-forwarding-history",18),2&n){const e=t.oxw();t.Q6J("eventsData",e.filteredEventsBySelectedPeriod)("filterValue",e.eventFilterValue)}}let bc=(()=>{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 d.x,new d.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,h.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,h.R)(this.unSubs[1])).subscribe(e=>{switch(this.screenSize){case l.cu.MD:this.screenPaddingX=e.width/10;break;case l.cu.LG:this.screenPaddingX=e.width/16;break;default:this.screenPaddingX=e.width/20}this.view=[e.width-this.screenPaddingX,e.height/2.2],this.logger.info("Container Size: "+JSON.stringify(e)),this.logger.info("View: "+JSON.stringify(this.view))})}filterForwardingEvents(e,i){const o=Math.round(e.getTime()/1e3),s=Math.round(i.getTime()/1e3);this.logger.info("Filtering Forwarding Events Starting at "+new Date(Date.now()).toLocaleString()+" From "+e.toLocaleString()+" To "+i.toLocaleString()),this.filteredEventsBySelectedPeriod=[],this.routingReportData=[],this.totalFeeSat=null,this.events&&this.events.length>0&&(this.events.forEach(c=>{Math.floor(c.timestamp/1e3)>=o&&Math.floor(c.timestamp/1e3)<s&&this.filteredEventsBySelectedPeriod.push(c)}),this.routingReportData=this.selReportBy===this.reportBy.EVENTS?this.prepareEventsReport(e):this.prepareFeeReport(e)),this.logger.info("Filtering Forwarding Events Finished at "+new Date(Date.now()).toLocaleString())}onChartMouseUp(e){"svg"===e.srcElement.tagName&&e.srcElement.classList.length>0&&"ngx-charts"===e.srcElement.classList[0]&&(this.eventFilterValue="")}onChartBarSelected(e){this.eventFilterValue=this.reportPeriod===l.op[1]?e.name+"/"+this.startDate.getFullYear():e.name.toString().padStart(2,"0")+"/"+l.gg[this.startDate.getMonth()].name+"/"+this.startDate.getFullYear()}prepareFeeReport(e){const i=Math.round(e.getTime()/1e3),o=[];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 s=0;s<12;s++)o.push({name:l.gg[s].name,value:0,extra:{totalEvents:0}});this.filteredEventsBySelectedPeriod.map(s=>{const c=new Date(s.timestamp).getMonth();return o[c].value=o[c].value+(s.amountIn-s.amountOut),o[c].extra.totalEvents=o[c].extra.totalEvents+1,this.totalFeeSat=(this.totalFeeSat?this.totalFeeSat:0)+(s.amountIn-s.amountOut),this.filteredEventsBySelectedPeriod})}else{for(let s=0;s<this.getMonthDays(e.getMonth(),e.getFullYear());s++)o.push({name:s+1,value:0,extra:{totalEvents:0}});this.filteredEventsBySelectedPeriod.map(s=>{const c=Math.floor((Math.floor(s.timestamp/1e3)-i)/this.secondsInADay);return o[c].value=o[c].value+(s.amountIn-s.amountOut),o[c].extra.totalEvents=o[c].extra.totalEvents+1,this.totalFeeSat=(this.totalFeeSat?this.totalFeeSat:0)+(s.amountIn-s.amountOut),this.filteredEventsBySelectedPeriod})}return this.logger.info("Fee Report Prepare Finished at "+new Date(Date.now()).toLocaleString()),o}prepareEventsReport(e){const i=Math.round(e.getTime()/1e3),o=[];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 s=0;s<12;s++)o.push({name:l.gg[s].name,value:0,extra:{totalFees:0}});this.filteredEventsBySelectedPeriod.map(s=>{const c=new Date(s.timestamp).getMonth();return o[c].value=o[c].value+1,o[c].extra.totalFees=o[c].extra.totalFees+(s.amountIn-s.amountOut),this.totalFeeSat=(this.totalFeeSat?this.totalFeeSat:0)+(s.amountIn-s.amountOut),this.filteredEventsBySelectedPeriod})}else{for(let s=0;s<this.getMonthDays(e.getMonth(),e.getFullYear());s++)o.push({name:s+1,value:0,extra:{totalFees:0}});this.filteredEventsBySelectedPeriod.map(s=>{const c=Math.floor((Math.floor(s.timestamp/1e3)-i)/this.secondsInADay);return o[c].value=o[c].value+1,o[c].extra.totalFees=o[c].extra.totalFees+(s.amountIn-s.amountOut),this.totalFeeSat=(this.totalFeeSat?this.totalFeeSat:0)+(s.amountIn-s.amountOut),this.filteredEventsBySelectedPeriod})}return this.logger.info("Events Report Prepare Finished at "+new Date(Date.now()).toLocaleString()),o}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(F.mQ),t.Y36(R.v),t.Y36(S.yh))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-routing-report"]],hostBindings:function(e,i){1&e&&t.NdJ("mouseup",function(s){return i.onChartMouseUp(s)})},decls:17,vars:7,consts:[["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"padding-gap-x-large"],[3,"stepChanged"],["fxLayout","column","fxLayoutAlign","center center",1,"padding-gap-x"],["color","primary","name","selReportBy","fxFlex","100","fxLayoutAlign","start start",1,"my-1",3,"ngModel","ngModelChange","change"],[1,"mr-2"],["tabindex","1",1,"mr-2",3,"value"],["tabindex","2",3,"value"],["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"padding-gap-x"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100","class","font-size-120 font-bold-700 mt-1",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100","class","font-size-120 mt-1",4,"ngIf"],[1,"mt-1"],["class","one-color",3,"view","results","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","select","mouseup",4,"ngIf"],[3,"eventsData","filterValue",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","font-bold-700","mt-1"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","mt-1"],[1,"one-color",3,"view","results","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","select","mouseup"],["tooltipTemplate",""],[1,"tooltip-label"],[3,"eventsData","filterValue"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.TgZ(1,"rtl-horizontal-scroller",1),t.NdJ("stepChanged",function(s){return i.onSelectionChange(s)}),t.qZA(),t.TgZ(2,"div",2),t.TgZ(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.qZA(),t.qZA(),t.TgZ(10,"div",7),t.YNc(11,Zc,4,8,"div",8),t.YNc(12,Tc,2,0,"div",9),t.TgZ(13,"div",10),t.YNc(14,Lc,3,11,"ngx-charts-bar-vertical",11),t.qZA(),t.TgZ(15,"div",10),t.YNc(16,vc,1,2,"rtl-ecl-forwarding-history",12),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.xp6(3),t.Q6J("ngModel",i.selReportBy),t.xp6(3),t.s9C("value",i.reportBy.FEES),t.xp6(2),t.s9C("value",i.reportBy.EVENTS),t.xp6(3),t.Q6J("ngIf",i.routingReportData.length>0&&i.filteredEventsBySelectedPeriod.length>0),t.xp6(1),t.Q6J("ngIf",i.routingReportData.length<=0||i.filteredEventsBySelectedPeriod.length<=0),t.xp6(2),t.Q6J("ngIf",i.routingReportData.length>0&&i.filteredEventsBySelectedPeriod.length>0),t.xp6(2),t.Q6J("ngIf",i.filteredEventsBySelectedPeriod.length>0))},directives:[p.xw,p.Wh,p.yH,Rt.D,j.VQ,m.JJ,m.On,j.U0,u.O5,Nt.K$,It],pipes:[u.JJ],styles:[""],data:{animation:[Ft.J]}}),n})();var Sc=g(165);function wc(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 Ec(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 qc(n,a){if(1&n&&(t.TgZ(0,"div",8),t.YNc(1,wc,4,7,"div",9),t.YNc(2,Ec,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 Ic(n,a){1&n&&(t.TgZ(0,"div",11),t._uU(1,"No transactions report for the selected period"),t.qZA())}function Oc(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 Fc(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"ngx-charts-bar-vertical-2d",12),t.NdJ("select",function(o){return t.CHM(e),t.oxw().onChartBarSelected(o)})("mouseup",function(o){return t.CHM(e),t.oxw().onChartMouseUp(o)}),t.YNc(1,Oc,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 Rc(n,a){if(1&n&&t._UZ(0,"rtl-transactions-report-table",15),2&n){const e=t.oxw();t.Q6J("dataList",e.transactionsNonZeroReportData)("dataRange",e.reportPeriod)("filterValue",e.transactionFilterValue)}}let Nc=(()=>{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.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 d.x,new d.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,h.R)(this.unSubs[0]),(0,et.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,h.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))})}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){const o=Math.round(e.getTime()/1e3),s=Math.round(i.getTime()/1e3),c=[];this.transactionsReportSummary={paymentsSelectedPeriod:0,invoicesSelectedPeriod:0,amountPaidSelectedPeriod:0,amountReceivedSelectedPeriod:0};const _=this.payments.filter(f=>Math.floor(f.firstPartTimestamp/1e3)>=o&&Math.floor(f.firstPartTimestamp/1e3)<s),O=this.invoices.filter(f=>"received"===f.status&&f.timestamp>=o&&f.timestamp<s);if(this.transactionsReportSummary.paymentsSelectedPeriod=_.length,this.transactionsReportSummary.invoicesSelectedPeriod=O.length,this.reportPeriod===l.op[1]){for(let f=0;f<12;f++)c.push({name:l.gg[f].name,date:new Date(e.getFullYear(),f,1,0,0,0,0),series:[{name:"Paid",value:0,extra:{total:0}},{name:"Received",value:0,extra:{total:0}}]});_.map(f=>{const L=new Date(f.firstPartTimestamp).getMonth();return this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+f.recipientAmount,c[L].series[0].value=c[L].series[0].value+f.recipientAmount,c[L].series[0].extra.total=c[L].series[0].extra.total+1,this.transactionsReportSummary}),O.map(f=>{const L=new Date(1e3*f.timestamp).getMonth();return this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+f.amountSettled,c[L].series[1].value=c[L].series[1].value+f.amountSettled,c[L].series[1].extra.total=c[L].series[1].extra.total+1,this.transactionsReportSummary})}else{for(let f=0;f<this.getMonthDays(e.getMonth(),e.getFullYear());f++)c.push({name:(f+1).toString(),date:new Date(1e3*(f*this.secondsInADay+o)),series:[{name:"Paid",value:0,extra:{total:0}},{name:"Received",value:0,extra:{total:0}}]});_.map(f=>{const L=Math.floor((Math.floor(f.firstPartTimestamp/1e3)-o)/this.secondsInADay);return this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+f.recipientAmount,c[L].series[0].value=c[L].series[0].value+f.recipientAmount,c[L].series[0].extra.total=c[L].series[0].extra.total+1,this.transactionsReportSummary}),O.map(f=>{const L=Math.floor((f.timestamp-o)/this.secondsInADay);return this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+f.amountSettled,c[L].series[1].value=c[L].series[1].value+f.amountSettled,c[L].series[1].extra.total=c[L].series[1].extra.total+1,this.transactionsReportSummary})}return c}prepareTableData(){return this.transactionsReportData.reduce((e,i)=>i.series[0].extra.total>0||i.series[1].extra.total>0?e.concat({date:i.date,amount_paid:i.series[0].value,num_payments:i.series[0].extra.total,amount_received:i.series[1].value,num_invoices:i.series[1].extra.total}):e,[])}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(F.mQ),t.Y36(R.v),t.Y36(S.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,"dataList","dataRange","filterValue",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","font-bold-700","mt-1"],["fxLayout","row","fxLayoutAlign","start stretch","fxFlex","100",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start stretch","fxFlex","100"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","mt-1"],[1,"two-color",3,"view","results","noBarWhenZero","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","groupPadding","select","mouseup"],["tooltipTemplate",""],[1,"tooltip-label"],[3,"dataList","dataRange","filterValue"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.TgZ(1,"rtl-horizontal-scroller",1),t.NdJ("stepChanged",function(s){return i.onSelectionChange(s)}),t.qZA(),t.TgZ(2,"div",2),t.YNc(3,qc,3,3,"div",3),t.YNc(4,Ic,2,0,"div",4),t.TgZ(5,"div",5),t.YNc(6,Fc,3,13,"ngx-charts-bar-vertical-2d",6),t.qZA(),t.TgZ(7,"div",5),t.YNc(8,Rc,1,3,"rtl-transactions-report-table",7),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.xp6(3),t.Q6J("ngIf",i.transactionsNonZeroReportData.length>0),t.xp6(1),t.Q6J("ngIf",i.transactionsNonZeroReportData.length<=0),t.xp6(2),t.Q6J("ngIf",i.transactionsNonZeroReportData.length>0),t.xp6(2),t.Q6J("ngIf",i.transactionsNonZeroReportData.length>0))},directives:[p.xw,p.Wh,p.yH,Rt.D,u.O5,Nt.H5,Sc.g],pipes:[u.JJ],styles:[""],data:{animation:[Ft.J]}}),n})();var E=g(1643),kc=g(9442);function Pc(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"div",8),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw().activeLink=s.link}),t._uU(1),t.qZA()}if(2&n){const e=a.$implicit,i=t.oxw();t.s9C("routerLink",e.link),t.Q6J("active",i.activeLink===e.link),t.xp6(1),t.Oqu(e.name)}}const Mc=x.Bz.forChild([{path:"",component:ut,children:[{path:"",pathMatch:"full",redirectTo:"home"},{path:"home",component:Ri,canActivate:[E.fY]},{path:"onchain",component:_a,canActivate:[E.fY],children:[{path:"",pathMatch:"full",redirectTo:"receive"},{path:"receive",component:Ba,canActivate:[E.fY]},{path:"send",component:za,canActivate:[E.fY]}]},{path:"connections",component:xa,canActivate:[E.fY],children:[{path:"",pathMatch:"full",redirectTo:"channels"},{path:"channels",component:uo,canActivate:[E.fY],children:[{path:"",pathMatch:"full",redirectTo:"open"},{path:"open",component:Ko,canActivate:[E.fY]},{path:"pending",component:ys,canActivate:[E.fY]},{path:"inactive",component:Gl,canActivate:[E.fY]}]},{path:"peers",component:ol,data:{sweepAll:!1},canActivate:[E.fY]}]},{path:"transactions",component:Za,canActivate:[E.fY],children:[{path:"",pathMatch:"full",redirectTo:"payments"},{path:"payments",component:ft,canActivate:[E.fY]},{path:"invoices",component:gt,canActivate:[E.fY]}]},{path:"routing",component:Aa,canActivate:[E.fY],children:[{path:"",pathMatch:"full",redirectTo:"forwardinghistory"},{path:"forwardinghistory",component:It,canActivate:[E.fY]},{path:"peers",component:Cc,canActivate:[E.fY]}]},{path:"reports",component:yc,canActivate:[E.fY],children:[{path:"",pathMatch:"full",redirectTo:"routingreport"},{path:"routingreport",component:bc,canActivate:[E.fY]},{path:"transactions",component:Nc,canActivate:[E.fY]}]},{path:"graph",component:(()=>{class n{constructor(e){this.router=e,this.faSearch=Z.wn1,this.links=[{link:"lookups",name:"Lookup"},{link:"queryroutes",name:"Query Routes"}],this.activeLink=this.links[0].link,this.unSubs=[new d.x,new d.x,new d.x,new d.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,h.R)(this.unSubs[0]),(0,J.h)(i=>i instanceof x.Av)).subscribe({next:i=>{const o=this.links.find(s=>i.urlAfterRedirects.includes(s.link));this.activeLink=o?o.link:this.links[0].link}})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(x.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-graph"]],decls:11,vars:2,consts:[["fxLayout","row wrap","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x"],["fxLayout","column"],["mat-tab-nav-bar",""],["role","tab","mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"mat-tab-body-wrapper"],["role","tab","mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t._UZ(1,"fa-icon",1),t.TgZ(2,"span",2),t._uU(3,"Graph Lookups"),t.qZA(),t.qZA(),t.TgZ(4,"div",3),t.TgZ(5,"mat-card"),t.TgZ(6,"mat-card-content",4),t.TgZ(7,"nav",5),t.YNc(8,Pc,2,3,"div",6),t.qZA(),t.TgZ(9,"div",7),t._UZ(10,"router-outlet"),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.xp6(1),t.Q6J("icon",i.faSearch),t.xp6(7),t.Q6J("ngForOf",i.links))},directives:[p.xw,p.Wh,I.BN,T.a8,T.dn,k.BU,u.sg,p.yH,x.lC,k.Nj,x.rH],styles:[""]}),n})(),canActivate:[E.fY],children:[{path:"",pathMatch:"full",redirectTo:"lookups"},{path:"lookups",component:Ya,canActivate:[E.fY]},{path:"queryroutes",component:yl,canActivate:[E.fY]}]},{path:"**",component:kc.w}]}]);var Jc=g(8750);let Qc=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n,bootstrap:[ut]}),n.\u0275inj=t.cJS({providers:[E.fY],imports:[[u.ez,Jc.m,Mc]]}),n})()}}]);