mirror of
https://github.com/Ride-The-Lightning/RTL
synced 2024-10-31 09:20:27 +00:00
bea5980c6f
Release 0.12.0
1 line
294 KiB
JavaScript
1 line
294 KiB
JavaScript
"use strict";(self.webpackChunkRTLApp=self.webpackChunkRTLApp||[]).push([[637],{8637:(kc,lt,g)=>{g.r(lt),g.d(lt,{ECLModule:()=>Nc});var u=g(9808),y=g(9291),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 rt=(()=>{class n{constructor(e){this.router=e,this.loading=!1,this.router.events.subscribe(i=>{switch(!0){case i instanceof y.OD:this.loading=!0;break;case i instanceof y.m2:case i instanceof y.gk:case i instanceof y.Q3:this.loading=!1}})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(y.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-root"]],decls:4,vars:1,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"inner-sidenav-content"],["color","primary","mode","indeterminate",4,"ngIf"],["outlet","outlet"],["color","primary","mode","indeterminate"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),t.YNc(1,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,y.lC,M.pW],styles:[""],data:{animation:[kt.g]}}),n})();var d=g(7579),h=g(2722),tt=g(1365),ct=g(534),Z=g(801),l=g(7731),_=g(2501),F=g(5043),b=g(5620),O=g(62),I=g(9444),ut=g(3954),A=g(9224),et=g(2181),S=g(3322),q=g(7423),pt=g(5245);const mt=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,mt,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,mt,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(O.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,S.Zl],pipes:[u.gd],styles:[""]}),n})();function Yt(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 Qt(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,Yt,21,11,"div",0),t.YNc(1,Qt,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 x=g(7322),z=g(7238),G=g(4834),Y=g(644);function Bt(n,a){if(1&n&&(t.TgZ(0,"div",19),t.TgZ(1,"span",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.xp6(1),t.AsE("",t.Dn7(3,9,(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,13,(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,16,(null==e?null:e.balancedness)||0),") "),t.xp6(5),t.hij("",t.xi3(18,18,(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 zt(n,a){if(1&n&&(t.TgZ(0,"div",17),t.YNc(1,Bt,20,21,"div",18),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",e.allChannels)}}function Vt(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,zt,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 Gt(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 Xt(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 $t=(()=>{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(y.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-capacity-info"]],inputs:{channelBalances:"channelBalances",allChannels:"allChannels",sortBy:"sortBy",errorMessage:"errorMessage"},decls:5,vars:2,consts:[["fxLayout","column","fxLayoutAlign","space-between stretch","fxFlex","100",4,"ngIf","ngIfElse"],["noChannelBlock",""],["errorBlock",""],["fxLayout","column","fxLayoutAlign","space-between stretch","fxFlex","100"],["fxLayout","column","fxFlex","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,"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,Vt,24,15,"div",0),t.YNc(1,Gt,4,0,"ng-template",null,1,t.W1O),t.YNc(3,Xt,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,x.bx,I.BN,z.gM,M.pW,G.d,Y.$V,u.sg,q.lW],pipes:[u.JJ,u.OU],styles:[".channels-capacity-scroll[_ngcontent-%COMP%]{width:100%;height:100%;overflow-y:hidden}"]}),n})();function Wt(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 Kt(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 jt=(()=>{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,Wt,39,18,"div",0),t.YNc(1,Kt,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 te(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 ee(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 ne=(()=>{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,te,42,18,"div",0),t.YNc(1,ee,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 ie(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 ae(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 oe(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 se(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)}}function le(n,a){if(1&n&&(t.TgZ(0,"div",14),t.TgZ(1,"span",15),t._uU(2),t.ALo(3,"slice"),t.qZA(),t.TgZ(4,"div",16),t.YNc(5,ie,5,4,"mat-hint",17),t.YNc(6,ae,5,4,"mat-hint",17),t.qZA(),t.YNc(7,oe,1,1,"mat-progress-bar",18),t.YNc(8,se,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.xp6(1),t.AsE("",t.Dn7(3,8,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 re(n,a){if(1&n&&(t.TgZ(0,"div",12),t.YNc(1,le,9,12,"div",13),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",e.allChannels)}}const ce=function(n,a,e){return{"mb-4":n,"mb-2":a,"mb-1":e}};function ue(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,re,2,1,"div",11),t.qZA(),t.qZA()),2&n){const e=t.oxw(),i=t.MAs(2);t.Q6J("ngClass",t.kEZ(7,ce,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 pe(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 me(n,a){if(1&n&&(t.TgZ(0,"div",22),t._uU(1," No channels available. "),t.YNc(2,pe,2,0,"button",23),t.qZA()),2&n){const e=t.oxw();t.xp6(2),t.Q6J("ngIf","Out"===e.direction)}}function de(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 he=(()=>{class n{constructor(e,i){this.router=e,this.commonService=i,this.screenSize="",this.screenSizeEnum=l.cu}ngOnInit(){this.screenSize=this.commonService.getScreenSize()}goToChannels(){this.router.navigateByUrl("/ecl/connections")}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(y.F0),t.Y36(O.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,"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,ue,12,11,"div",0),t.YNc(1,me,3,1,"ng-template",null,1,t.W1O),t.YNc(3,de,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,S.oO,x.bx,M.pW,G.d,Y.$V,u.sg,z.gM,q.lW],pipes:[u.JJ,u.OU],styles:[""]}),n})();var N=g(3251),J=g(9300),L=g(6087),T=g(4847),r=g(2075),D=g(8966),R=g(2994),B=g(6642),m=g(3075),U=g(7531),X=g(3390),$=g(6534),k=g(4107),Q=g(508);function ge(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Description is required."),t.qZA())}function fe(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 _e(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 Ce(n,a){if(1&n&&(t.TgZ(0,"div",26),t._UZ(1,"fa-icon",27),t.YNc(2,_e,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 xe=(()=>{class n{constructor(e,i,o,s,c,f){this.dialogRef=e,this.data=i,this.store=o,this.decimalPipe=s,this.commonService=c,this.actions=f,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(_.LR).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e}),this.store.select(_.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,R.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(b.yh),t.Y36(u.JJ),t.Y36(O.v),t.Y36(B.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,ge,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,fe,3,4,"mat-option",20),t.qZA(),t.qZA(),t.qZA(),t.YNc(29,Ce,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,A.dk,p.Wh,q.lW,D.ZT,A.dn,m._Y,m.JL,m.F,x.KE,U.Nt,m.Fj,X.h,m.Q7,m.JJ,m.On,u.O5,m.wV,m.qQ,$.q,x.R9,x.bx,k.gD,u.sg,x.TO,Q.ey,I.BN],pipes:[u.rS],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),n})();var ye=g(7766),v=g(7861);function Ze(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Description is required."),t.qZA())}function Te(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,Ze,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 Ae(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 Le(n,a){1&n&&t._UZ(0,"mat-progress-bar",47)}function ve(n,a){1&n&&(t.TgZ(0,"th",48),t._uU(1," Date Created "),t.qZA())}const nt=function(n){return{"mr-0":n}};function be(n,a){if(1&n&&t._UZ(0,"span",53),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.VKq(1,nt,e.screenSize===e.screenSizeEnum.XS))}}function Se(n,a){if(1&n&&t._UZ(0,"span",54),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.VKq(1,nt,e.screenSize===e.screenSizeEnum.XS))}}function we(n,a){if(1&n&&t._UZ(0,"span",55),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.VKq(1,nt,e.screenSize===e.screenSizeEnum.XS))}}function Ee(n,a){if(1&n&&(t.TgZ(0,"td",49),t.YNc(1,be,1,3,"span",50),t.YNc(2,Se,1,3,"span",51),t.YNc(3,we,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/YYYY HH:mm")," ")}}function qe(n,a){1&n&&(t.TgZ(0,"th",48),t._uU(1," Date Settled "),t.qZA())}function Ie(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/YYYY HH:mm")||"-")}}function Fe(n,a){1&n&&(t.TgZ(0,"th",48),t._uU(1," Description "),t.qZA())}const Oe=function(n){return{"max-width":n}};function Re(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,Oe,i.screenSize===i.screenSizeEnum.XS?"10rem":"32rem")),t.xp6(2),t.Oqu(e.description)}}function Ne(n,a){1&n&&(t.TgZ(0,"th",58),t._uU(1," Amount (Sats) "),t.qZA())}function ke(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 Pe(n,a){1&n&&(t.TgZ(0,"th",58),t._uU(1," Amount Settled (Sats) "),t.qZA())}function De(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 Ue(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 Me=function(n){return{"px-3":n}};function Je(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,Me,e.screenSize!==e.screenSizeEnum.XS))}}function Ye(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No invoice available."),t.qZA())}function Qe(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting invoices..."),t.qZA())}function He(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 Be(n,a){if(1&n&&(t.TgZ(0,"td",68),t.YNc(1,Ye,2,0,"p",8),t.YNc(2,Qe,2,0,"p",8),t.YNc(3,He,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 ze=function(n){return{"display-none":n}};function Ve(n,a){if(1&n&&t._UZ(0,"tr",69),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,ze,(null==e.invoices?null:e.invoices.data)&&(null==e.invoices||null==e.invoices.data?null:e.invoices.data.length)>0))}}function Ge(n,a){1&n&&t._UZ(0,"tr",70)}function Xe(n,a){1&n&&t._UZ(0,"tr",71)}const $e=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},We=function(){return["no_invoice"]};function Ke(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,Le,1,0,"mat-progress-bar",26),t.TgZ(10,"table",27,28),t.ynx(12,29),t.YNc(13,ve,2,0,"th",30),t.YNc(14,Ee,6,7,"td",31),t.BQk(),t.ynx(15,32),t.YNc(16,qe,2,0,"th",30),t.YNc(17,Ie,3,4,"td",31),t.BQk(),t.ynx(18,33),t.YNc(19,Fe,2,0,"th",30),t.YNc(20,Re,4,4,"td",31),t.BQk(),t.ynx(21,34),t.YNc(22,Ne,2,0,"th",35),t.YNc(23,ke,4,4,"td",36),t.BQk(),t.ynx(24,37),t.YNc(25,Pe,2,0,"th",35),t.YNc(26,De,4,4,"td",36),t.BQk(),t.ynx(27,38),t.YNc(28,Ue,6,0,"th",39),t.YNc(29,Je,8,3,"td",40),t.BQk(),t.ynx(30,41),t.YNc(31,Be,4,3,"td",42),t.BQk(),t.YNc(32,Ve,1,3,"tr",43),t.YNc(33,Ge,1,0,"tr",44),t.YNc(34,Xe,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,$e,""!==e.errorMessage)),t.xp6(22),t.Q6J("matFooterRowDef",t.DdM(14,We)),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 dt=(()=>{class n{constructor(e,i,o,s,c,f){this.logger=e,this.store=i,this.decimalPipe=o,this.commonService=s,this.datePipe=c,this.actions=f,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(_.LR).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e}),this.store.select(_.yD).pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.information=e}),this.store.select(_.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,v.qR)({payload:{data:{pageSize:this.pageSize,component:xe}}}))}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,R.Z$)({payload:o})),this.resetData()}onInvoiceClick(e){this.store.dispatch((0,v.qR)({payload:{data:{invoice:e,newlyAdded:!1,component:ye.R}}}))}onRefreshInvoice(e){this.store.dispatch((0,R.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(b.yh),t.Y36(u.JJ),t.Y36(O.v),t.Y36(u.uU),t.Y36(B.eX))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-lightning-invoices"]],viewQuery:function(e,i){if(1&e&&(t.Gf(T.YE,5),t.Gf(L.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:L.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,Te,17,6,"form",1),t.YNc(2,Ae,3,0,"div",2),t.YNc(3,Ke,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,x.KE,U.Nt,m.Fj,m.Q7,m.JJ,m.On,m.wV,m.qQ,$.q,x.R9,x.bx,q.lW,x.TO,I.BN,Y.$V,r.BZ,T.YE,u.mk,S.oO,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,L.NW,M.pW,r.ge,T.nU,r.ev,z.gM,u.PC,S.Zl,k.gD,k.$L,Q.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 H=g(5698),it=g(3289),ht=g(8104);const je=["paymentReq"];function tn(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 en(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Payment request is required."),t.qZA())}function nn(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 an(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Payment amount is required."),t.qZA())}function on(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,an,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 sn(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 ln(n,a){if(1&n&&(t.TgZ(0,"div",19),t._UZ(1,"fa-icon",20),t.YNc(2,sn,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 rn=(()=>{class n{constructor(e,i,o,s,c,f,P,C){this.dialogRef=e,this.store=i,this.eclEffects=o,this.logger=s,this.commonService=c,this.decimalPipe=f,this.actions=P,this.dataService=C,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(_.LR).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e}),this.store.select(_.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,H.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,R.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,H.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(b.yh),t.Y36(it.o),t.Y36(F.mQ),t.Y36(O.v),t.Y36(u.JJ),t.Y36(B.eX),t.Y36(ht.D))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-lightning-send-payments"]],viewQuery:function(e,i){if(1&e&&t.Gf(je,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,tn,2,1,"mat-hint",11),t.YNc(15,en,2,0,"mat-error",11),t.YNc(16,nn,2,1,"mat-error",11),t.qZA(),t.YNc(17,on,6,2,"mat-form-field",12),t.YNc(18,ln,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,A.dk,p.Wh,q.lW,D.ZT,A.dn,m._Y,m.JL,m.F,x.KE,U.Nt,m.Fj,X.h,m.Q7,m.JJ,m.On,u.O5,x.bx,x.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 V=g(1125);const cn=["scrollContainer"];function un(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 pn(n,a){1&n&&t._UZ(0,"mat-divider",14)}function mn(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/YYYY HH:mm")),t.xp6(8),t.Oqu(e.id),t.xp6(7),t.Oqu(e.toChannelAlias)}}let dn=(()=>{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(cn,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,un,6,1,"div",15),t.YNc(54,pn,1,0,"mat-divider",16),t.TgZ(55,"div",9),t.TgZ(56,"div",1),t.TgZ(57,"mat-accordion"),t.YNc(58,mn,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/YYYY 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,A.dk,q.lW,A.dn,Y.$V,G.d,u.O5,V.pp,u.sg,pt.Hw,D.ZT,V.ib,V.yz,V.yK],pipes:[u.JJ,u.uU],styles:[""]}),n})();var K=g(3093);const hn=["sendPaymentForm"];function gn(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 fn(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Payment request is required."),t.qZA())}function _n(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,gn,2,1,"mat-hint",9),t.YNc(6,fn,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 Cn(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 xn(n,a){1&n&&t._UZ(0,"mat-progress-bar",49)}function yn(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Date/Time"),t.qZA())}function Zn(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/YYYY HH:mm"))}}function Tn(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"ID"),t.qZA())}const W=function(n){return{"max-width":n}};function An(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 Ln(n,a){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Destination"),t.qZA())}function vn(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 bn(n,a){1&n&&(t.TgZ(0,"th",54),t._uU(1,"Amount (Sats)"),t.qZA())}function Sn(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 wn(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 En(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 qn(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No payment available."),t.qZA())}function In(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting payments..."),t.qZA())}function Fn(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 On(n,a){if(1&n&&(t.TgZ(0,"td",62),t.YNc(1,qn,2,0,"p",9),t.YNc(2,In,2,0,"p",9),t.YNc(3,Fn,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 Rn(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/YYYY HH:mm")," ")}}function Nn(n,a){if(1&n&&(t.ynx(0),t.YNc(1,Rn,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 kn(n,a){if(1&n&&(t.TgZ(0,"td",51),t.TgZ(1,"span",63),t._uU(2),t.qZA(),t.YNc(3,Nn,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 Pn(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 Dn(n,a){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,Pn,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 Un(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,Dn,2,1,"span",9),t.qZA()),2&n){const e=a.$implicit,i=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(3,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 Mn(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 Jn(n,a){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,Mn,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,Jn,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 Qn(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 Hn(n,a){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,Qn,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 Bn(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,Hn,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 zn(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 Vn(n,a){if(1&n&&(t.TgZ(0,"div"),t.YNc(1,zn,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 Gn(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,Vn,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 Xn(n,a){1&n&&t._UZ(0,"tr",75)}const $n=function(n){return{"display-none":n}};function Wn(n,a){if(1&n&&t._UZ(0,"tr",76),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,$n,(null==e.payments?null:e.payments.data)&&(null==e.payments||null==e.payments.data?null:e.payments.data.length)>0))}}function Kn(n,a){1&n&&t._UZ(0,"tr",77)}function jn(n,a){1&n&&t._UZ(0,"tr",75)}const ti=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},ei=function(){return["no_payment"]};function ni(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,xn,1,0,"mat-progress-bar",23),t.TgZ(11,"table",24,25),t.ynx(13,26),t.YNc(14,yn,2,0,"th",27),t.YNc(15,Zn,3,4,"td",28),t.BQk(),t.ynx(16,29),t.YNc(17,Tn,2,0,"th",27),t.YNc(18,An,4,4,"td",28),t.BQk(),t.ynx(19,30),t.YNc(20,Ln,2,0,"th",27),t.YNc(21,vn,4,4,"td",28),t.BQk(),t.ynx(22,31),t.YNc(23,bn,2,0,"th",32),t.YNc(24,Sn,4,3,"td",28),t.BQk(),t.ynx(25,33),t.YNc(26,wn,6,0,"th",34),t.YNc(27,En,3,0,"td",35),t.BQk(),t.ynx(28,36),t.YNc(29,On,4,3,"td",37),t.BQk(),t.ynx(30,38),t.YNc(31,kn,4,2,"td",28),t.BQk(),t.ynx(32,39),t.YNc(33,Un,5,5,"td",28),t.BQk(),t.ynx(34,40),t.YNc(35,Yn,5,5,"td",28),t.BQk(),t.ynx(36,41),t.YNc(37,Bn,5,5,"td",28),t.BQk(),t.ynx(38,42),t.YNc(39,Gn,5,2,"td",43),t.BQk(),t.YNc(40,Xn,1,0,"tr",44),t.YNc(41,Wn,1,3,"tr",45),t.YNc(42,Kn,1,0,"tr",46),t.YNc(43,jn,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,ti,""!==e.errorMessage)),t.xp6(29),t.Q6J("matRowDefColumns",e.partColumns)("matRowDefWhen",e.is_group),t.xp6(1),t.Q6J("matFooterRowDef",t.DdM(16,ei)),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,f,P){this.logger=e,this.commonService=i,this.store=o,this.rtlEffects=s,this.decimalPipe=c,this.dataService=f,this.datePipe=P,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(_.LR).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e}),this.store.select(_.yD).pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.information=e}),this.store.select(_.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,H.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,v.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,H.q)(1)).subscribe(i=>{i&&(this.store.dispatch((0,R.oV)({payload:{invoice:this.paymentRequest,fromDialog:!1}})),this.resetData())})):(this.store.dispatch((0,v.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,H.q)(1)).subscribe(o=>{o&&(this.paymentDecoded.amount=o[0].inputValue,this.store.dispatch((0,R.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,H.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,v.qR)({payload:{data:{component:rn}}}))}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,H.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,v.qR)({payload:{data:{sentPaymentInfo:i,payment:e,component:dn}}}))}onPartClick(e,i){i.paymentHash&&""!==i.paymentHash.trim()?this.dataService.decodePayments(i.paymentHash).pipe((0,H.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,v.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,f)=>{c.length>0&&c[0].paymentRequest&&c[0].paymentRequest.description&&""!==c[0].paymentRequest.description&&(e[f].description=c[0].paymentRequest.description)});const s=e.reduce((c,f)=>c.concat(f),[]);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(O.v),t.Y36(b.yh),t.Y36(K.V),t.Y36(u.JJ),t.Y36(ht.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(hn,5),t.Gf(T.YE,5),t.Gf(L.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:L.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,_n,12,3,"form",1),t.YNc(2,Cn,3,0,"div",2),t.YNc(3,ni,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,x.KE,U.Nt,m.Fj,m.Q7,Y.$V,m.JJ,m.On,q.lW,x.bx,x.TO,I.BN,r.BZ,T.YE,u.mk,S.oO,r.w1,r.fO,r.Dz,r.mD,r.nj,r.Ke,r.as,L.NW,M.pW,r.ge,T.nU,r.ev,u.PC,S.Zl,k.gD,k.$L,Q.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 ii(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 ai(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",15),t.NdJ("click",function(){return t.CHM(e),t.oxw(3).onNavigateTo("/ecl/reports")}),t._uU(1,"Fees Summary"),t.qZA()}}function oi(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",15),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 si(n,a){1&n&&t._UZ(0,"mat-progress-bar",27)}function li(n,a){if(1&n&&t._UZ(0,"rtl-ecl-node-info",28),2&n){const e=t.oxw(3);t.Q6J("information",e.information)("showColorFieldSeparately",!1)}}function ri(n,a){if(1&n&&t._UZ(0,"rtl-ecl-balances-info",29),2&n){const e=t.oxw(3);t.Q6J("balances",e.balances)("errorMessage",e.errorMessages[2]+" "+e.errorMessages[3])}}function ci(n,a){if(1&n&&t._UZ(0,"rtl-ecl-channel-capacity-info",30),2&n){const e=t.oxw(3);t.Q6J("sortBy",e.sortField)("channelBalances",e.channelBalances)("allChannels",e.allChannelsCapacity)("errorMessage",e.errorMessages[2])}}function ui(n,a){if(1&n&&t._UZ(0,"rtl-ecl-fee-info",31),2&n){const e=t.oxw(3);t.Q6J("fees",e.fees)("errorMessage",e.errorMessages[1])}}function pi(n,a){if(1&n&&t._UZ(0,"rtl-ecl-channel-status-info",32),2&n){const e=t.oxw(3);t.Q6J("channelsStatus",e.channelsStatus)("errorMessage",e.errorMessages[2])}}function mi(n,a){1&n&&(t.TgZ(0,"h3"),t._uU(1,"Error! Unable to find information!"),t.qZA())}const ft=function(n){return{"dashboard-card-content":!0,"error-border":n}};function di(n,a){if(1&n){const e=t.EpF();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,ii,3,1,"button",12),t.TgZ(10,"mat-menu",13,14),t.TgZ(12,"button",15),t.NdJ("click",function(){const s=t.CHM(e).$implicit;return t.oxw(2).onNavigateTo(s.link)}),t._uU(13),t.qZA(),t.YNc(14,ai,2,0,"button",16),t.YNc(15,oi,2,1,"button",16),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(16,"mat-card-content",17),t.YNc(17,si,1,0,"mat-progress-bar",18),t.TgZ(18,"div",19),t.YNc(19,li,1,2,"rtl-ecl-node-info",20),t.YNc(20,ri,1,2,"rtl-ecl-balances-info",21),t.YNc(21,ci,1,4,"rtl-ecl-channel-capacity-info",22),t.YNc(22,ui,1,2,"rtl-ecl-fee-info",23),t.YNc(23,pi,1,2,"rtl-ecl-channel-status-info",24),t.YNc(24,mi,2,0,"h3",25),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(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.link),t.xp6(4),t.hij("Go To ",e.goTo,""),t.xp6(1),t.Q6J("ngIf","fee"===e.id),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(17,ft,"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 hi(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,di,25,19,"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 gi(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 fi(n,a){if(1&n){const e=t.EpF();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,gi,3,1,"button",12),t.TgZ(8,"mat-menu",13,41),t.TgZ(10,"button",15),t.NdJ("click",function(){t.CHM(e);const o=t.oxw().$implicit;return t.oxw(2).onNavigateTo(o.link)}),t._uU(11),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(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.link),t.xp6(4),t.hij("Go To ",e.goTo,"")}}function _i(n,a){1&n&&t._UZ(0,"mat-progress-bar",27)}function Ci(n,a){if(1&n&&t._UZ(0,"rtl-ecl-node-info",42),2&n){const e=t.oxw(3);t.Q6J("information",e.information)}}function xi(n,a){if(1&n&&t._UZ(0,"rtl-ecl-balances-info",29),2&n){const e=t.oxw(3);t.Q6J("balances",e.balances)("errorMessage",e.errorMessages[2]+" "+e.errorMessages[3])}}function yi(n,a){if(1&n&&t._UZ(0,"rtl-ecl-channel-liquidity-info",43),2&n){const e=t.oxw(3);t.Q6J("direction","In")("totalLiquidity",e.totalInboundLiquidity)("allChannels",e.allInboundChannels)("errorMessage",e.errorMessages[2])}}function Zi(n,a){if(1&n&&t._UZ(0,"rtl-ecl-channel-liquidity-info",43),2&n){const e=t.oxw(3);t.Q6J("direction","Out")("totalLiquidity",e.totalOutboundLiquidity)("allChannels",e.allOutboundChannels)("errorMessage",e.errorMessages[2])}}function Ti(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"button",52),t.TgZ(1,"mat-icon"),t._uU(2,"more_vert"),t.qZA(),t.qZA(),t.TgZ(3,"mat-menu",13,53),t.TgZ(5,"button",15),t.NdJ("click",function(){t.CHM(e);const o=t.oxw(2).$implicit;return t.oxw(2).onNavigateTo(o.link)}),t._uU(6),t.qZA(),t.TgZ(7,"button",15),t.NdJ("click",function(){return t.CHM(e),t.oxw(4).onNavigateTo("/ecl/reports/transactions")}),t._uU(8,"Transactions Summary"),t.qZA(),t.qZA()}if(2&n){const e=t.MAs(4),i=t.oxw(2).$implicit;t.Q6J("matMenuTriggerFor",e),t.xp6(6),t.hij("Go To ",i.goTo,"")}}function Ai(n,a){1&n&&(t.TgZ(0,"span",44),t.TgZ(1,"mat-tab-group",45),t.TgZ(2,"mat-tab",46),t._UZ(3,"rtl-ecl-lightning-invoices",47),t.qZA(),t.TgZ(4,"mat-tab",48),t._UZ(5,"rtl-ecl-lightning-payments",49),t.qZA(),t.TgZ(6,"mat-tab",50),t.YNc(7,Ti,9,2,"ng-template",51),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 Li(n,a){1&n&&(t.TgZ(0,"h3"),t._uU(1,"Error! Unable to find information!"),t.qZA())}const vi=function(n){return{"p-0":n}};function bi(n,a){if(1&n&&(t.TgZ(0,"mat-grid-tile",8),t.TgZ(1,"mat-card",35),t.YNc(2,fi,12,4,"mat-card-header",36),t.TgZ(3,"mat-card-content",37),t.YNc(4,_i,1,0,"mat-progress-bar",18),t.TgZ(5,"div",19),t.YNc(6,Ci,1,1,"rtl-ecl-node-info",38),t.YNc(7,xi,1,2,"rtl-ecl-balances-info",21),t.YNc(8,yi,1,4,"rtl-ecl-channel-liquidity-info",39),t.YNc(9,Zi,1,4,"rtl-ecl-channel-liquidity-info",39),t.YNc(10,Ai,8,3,"span",40),t.YNc(11,Li,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,vi,"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,ft,"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 Si(n,a){if(1&n&&(t.TgZ(0,"div",33),t._UZ(1,"fa-icon",4),t.TgZ(2,"span",5),t._uU(3),t.qZA(),t.qZA(),t.TgZ(4,"mat-grid-list",34),t.YNc(5,bi,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 wi=(()=>{class n{constructor(e,i,o,s){this.logger=e,this.store=i,this.commonService=o,this.router=s,this.faSmile=ct.I3,this.faFrown=ct.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",icon:this.faServer,title:"Node Information",cols:10,rows:1},{id:"balance",goTo:"On-Chain",link:"/ecl/onchain",icon:this.faChartPie,title:"Balances",cols:10,rows:1},{id:"fee",goTo:"Routing",link:"/ecl/routing",icon:this.faBolt,title:"Routing Fee",cols:10,rows:1},{id:"status",goTo:"Channels",link:"/ecl/connections",icon:this.faNetworkWired,title:"Channels",cols:10,rows:1},{id:"capacity",goTo:"Channels",link:"/ecl/connections",icon:this.faNetworkWired,title:"Channels Capacity",cols:10,rows:2}],this.merchantCards=[{id:"balance",goTo:"On-Chain",link:"/ecl/onchain",icon:this.faChartPie,title:"Balances",cols:6,rows:4},{id:"transactions",goTo:"Transactions",link:"/ecl/transactions",title:"",cols:6,rows:4},{id:"inboundLiq",goTo:"Channels",link:"/ecl/connections",icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:6,rows:8},{id:"outboundLiq",goTo:"Channels",link:"/ecl/connections",icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:6,rows:8}]):this.screenSize===l.cu.SM||this.screenSize===l.cu.MD?(this.operatorCards=[{id:"node",icon:this.faServer,title:"Node Information",cols:5,rows:1},{id:"balance",goTo:"On-Chain",link:"/ecl/onchain",icon:this.faChartPie,title:"Balances",cols:5,rows:1},{id:"fee",goTo:"Routing",link:"/ecl/routing",icon:this.faBolt,title:"Routing Fee",cols:5,rows:1},{id:"status",goTo:"Channels",link:"/ecl/connections",icon:this.faNetworkWired,title:"Channels",cols:5,rows:1},{id:"capacity",goTo:"Channels",link:"/ecl/connections",icon:this.faNetworkWired,title:"Channels Capacity",cols:10,rows:2}],this.merchantCards=[{id:"balance",goTo:"On-Chain",link:"/ecl/onchain",icon:this.faChartPie,title:"Balances",cols:3,rows:4},{id:"transactions",goTo:"Transactions",link:"/ecl/transactions",title:"",cols:3,rows:4},{id:"inboundLiq",goTo:"Channels",link:"/ecl/connections",icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:3,rows:8},{id:"outboundLiq",goTo:"Channels",link:"/ecl/connections",icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:3,rows:8}]):(this.operatorCards=[{id:"node",icon:this.faServer,title:"Node Information",cols:3,rows:1},{id:"balance",goTo:"On-Chain",link:"/ecl/onchain",icon:this.faChartPie,title:"Balances",cols:3,rows:1},{id:"capacity",goTo:"Channels",link:"/ecl/connections",icon:this.faNetworkWired,title:"Channels Capacity",cols:4,rows:2},{id:"fee",goTo:"Routing",link:"/ecl/routing",icon:this.faBolt,title:"Routing Fee",cols:3,rows:1},{id:"status",goTo:"Channels",link:"/ecl/connections",icon:this.faNetworkWired,title:"Channels",cols:3,rows:1}],this.merchantCards=[{id:"balance",goTo:"On-Chain",link:"/ecl/onchain",icon:this.faChartPie,title:"Balances",cols:2,rows:5},{id:"inboundLiq",goTo:"Channels",link:"/ecl/connections",icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:2,rows:10},{id:"outboundLiq",goTo:"Channels",link:"/ecl/connections",icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:2,rows:10},{id:"transactions",goTo:"Transactions",link:"/ecl/transactions",title:"",cols:2,rows:5}])}ngOnInit(){this.store.select(_.LR).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e}),this.store.select(_.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(_.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(_.Xz).pipe((0,h.R)(this.unSubs[3]),(0,tt.M)(this.store.select(_.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(f=>f.toRemote>0),"toRemote"))),this.allOutboundChannels=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.channels.filter(f=>f.toLocal>0),"toLocal"))),this.channels.forEach(f=>{this.totalInboundLiquidity=this.totalInboundLiquidity+Math.ceil(f.toRemote),this.totalOutboundLiquidity=this.totalOutboundLiquidity+Math.floor(f.toLocal)}),this.logger.info(e)})}onNavigateTo(e){this.router.navigateByUrl(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(b.yh),t.Y36(O.v),t.Y36(y.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-home"]],decls:3,vars:2,consts:[["fxLayout","column",4,"ngIf","ngIfElse"],["merchantDashboard",""],["fxLayout","column"],["fxLayout","row","fxLayoutAlign","start start",1,"page-title-container","mb-0"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["cols","10",3,"rowHeight"],[3,"colspan","rowspan",4,"ngFor","ngForOf"],[3,"colspan","rowspan"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",1,"h-100","dashboard-card","mt-4"],["fxLayoutAlign","space-between center"],[1,"mr-1",3,"icon"],["mat-icon-button","","class","more-button","aria-label","Toggle menu",3,"matMenuTriggerFor",4,"ngIf"],["xPosition","before",1,"dashboard-vert-menu"],["menuOperator","matMenu"],["mat-menu-item","",3,"click"],["mat-menu-item","",3,"click",4,"ngIf"],["fxLayout","column",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"],["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",""],["mat-icon-button","","aria-label","Toggle menu",1,"more-button",2,"max-width","20px",3,"matMenuTriggerFor"],["menuTransactions","matMenu"]],template:function(e,i){if(1&e&&(t.YNc(0,hi,7,4,"div",0),t.YNc(1,Si,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,ut.Il,u.sg,ut.DX,A.a8,p.yH,A.dk,A.n5,et.VK,et.OP,A.dn,u.mk,S.oO,u.RF,u.n9,u.ED,q.lW,et.p6,pt.Hw,M.pW,Jt,Ht,$t,jt,ne,he,N.SP,N.uX,dt,gt,N.uD],styles:[""]}),n})();var Ei=g(8377);const qi=["form"];function Ii(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Bitcoin address is required."),t.qZA())}function Fi(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 Oi(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 Ri(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Target Confirmation Blocks is required."),t.qZA())}function Ni(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 ki(n,a){if(1&n&&(t.TgZ(0,"div",30),t._UZ(1,"fa-icon",31),t.YNc(2,Ni,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 _t=(()=>{class n{constructor(e,i,o,s,c,f){this.dialogRef=e,this.logger=i,this.store=o,this.commonService=s,this.decimalPipe=c,this.actions=f,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(Ei.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,v.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,R.Iy)({payload:this.transaction}))},error:e=>{this.transaction.amount=null,this.selAmountUnit=l.NT.SATS,this.amountError="Conversion Error: "+e}}):this.store.dispatch((0,R.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(b.yh),t.Y36(O.v),t.Y36(u.JJ),t.Y36(B.eX))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-on-chain-send-modal"]],viewQuery:function(e,i){if(1&e&&t.Gf(qi,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,Ii,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,Fi,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,Oi,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,Ri,2,0,"mat-error",12),t.qZA(),t.qZA(),t._UZ(29,"div",24),t.YNc(30,ki,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,A.dk,p.Wh,q.lW,D.ZT,A.dn,m._Y,m.JL,m.F,x.KE,U.Nt,m.Fj,X.h,m.Q7,m.JJ,m.On,u.O5,m.wV,m.qQ,$.q,x.R9,k.gD,u.sg,x.TO,Q.ey,I.BN],styles:[""]}),n})();var at=g(1203);function Pi(n,a){1&n&&t._UZ(0,"mat-progress-bar",31)}function Di(n,a){1&n&&(t.TgZ(0,"th",32),t._uU(1," Date/Time "),t.qZA())}function Ui(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/YYYY HH:mm"))}}function Mi(n,a){1&n&&(t.TgZ(0,"th",34),t._uU(1," Amount (Sats) "),t.qZA())}function Ji(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 Yi(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 Qi(n,a){if(1&n&&(t.TgZ(0,"td",33),t.YNc(1,Ji,3,3,"span",35),t.YNc(2,Yi,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 Hi(n,a){1&n&&(t.TgZ(0,"th",34),t._uU(1," Fees (Sats) "),t.qZA())}function Bi(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 zi(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1," Confirmations "),t.qZA())}function Vi(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 Gi(n,a){1&n&&(t.TgZ(0,"th",32),t._uU(1," Address "),t.qZA())}function Xi(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 $i(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 Wi(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 Ki(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No transaction available."),t.qZA())}function ji(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting transactions..."),t.qZA())}function ta(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 ea(n,a){if(1&n&&(t.TgZ(0,"td",47),t.YNc(1,Ki,2,0,"p",48),t.YNc(2,ji,2,0,"p",48),t.YNc(3,ta,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 na=function(n){return{"display-none":n}};function ia(n,a){if(1&n&&t._UZ(0,"tr",49),2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,na,(null==e.listTransactions?null:e.listTransactions.data)&&(null==e.listTransactions||null==e.listTransactions.data?null:e.listTransactions.data.length)>0))}}function aa(n,a){1&n&&t._UZ(0,"tr",50)}function oa(n,a){1&n&&t._UZ(0,"tr",51)}const sa=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},la=function(){return["no_transaction"]};let ra=(()=>{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,R.mC)()),this.store.select(_.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,v.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(O.v),t.Y36(b.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(T.YE,5),t.Gf(L.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:L.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,Pi,1,0,"mat-progress-bar",9),t.TgZ(11,"table",10,11),t.ynx(13,12),t.YNc(14,Di,2,0,"th",13),t.YNc(15,Ui,3,4,"td",14),t.BQk(),t.ynx(16,15),t.YNc(17,Mi,2,0,"th",16),t.YNc(18,Qi,3,2,"td",14),t.BQk(),t.ynx(19,17),t.YNc(20,Hi,2,0,"th",16),t.YNc(21,Bi,4,3,"td",14),t.BQk(),t.ynx(22,18),t.YNc(23,zi,2,0,"th",19),t.YNc(24,Vi,4,3,"td",20),t.BQk(),t.ynx(25,21),t.YNc(26,Gi,2,0,"th",13),t.YNc(27,Xi,2,1,"td",14),t.BQk(),t.ynx(28,22),t.YNc(29,$i,6,0,"th",23),t.YNc(30,Wi,3,0,"td",24),t.BQk(),t.ynx(31,25),t.YNc(32,ea,4,3,"td",26),t.BQk(),t.YNc(33,ia,1,3,"tr",27),t.YNc(34,aa,1,0,"tr",28),t.YNc(35,oa,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,sa,""!==i.errorMessage)),t.xp6(22),t.Q6J("matFooterRowDef",t.DdM(14,la)),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,x.KE,U.Nt,m.Fj,m.JJ,m.On,Y.$V,u.O5,r.BZ,T.YE,u.mk,S.oO,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,L.NW,M.pW,r.ge,T.nU,r.ev,k.gD,k.$L,Q.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 ca(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 ua=(()=>{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 y.Av)).subscribe(i=>{const o=this.links.find(s=>i.urlAfterRedirects.includes(s.link));this.activeLink=o?o.link:this.links[0].link}),this.store.select(_.LR).pipe((0,h.R)(this.unSubs[1])).subscribe(i=>{this.selNode=i}),this.store.select(_.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,v.qR)({payload:{data:{component:_t}}}))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(b.yh),t.Y36(y.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,ca,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,A.a8,A.dn,at.D,N.BU,u.sg,p.yH,y.lC,ra,N.Nj,y.rH],styles:[""]}),n})();var Ct=g(7544);function pa(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 ma(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 da=(()=>{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 y.Av)).subscribe(e=>{this.activeLink=this.links.findIndex(i=>i.link===e.urlAfterRedirects.substring(e.urlAfterRedirects.lastIndexOf("/")+1))}),this.store.select(_.Bo).pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.activePeers=e.peers&&e.peers.length?e.peers.length:0}),this.store.select(_.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(_.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(b.yh),t.Y36(y.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-connections"]],decls:22,vars:4,consts:[["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x","mb-4"],["fxLayout","column"],[3,"values"],["fxLayout","column",1,"padding-gap-x"],[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,pa,2,1,"ng-template",8),t.qZA(),t.TgZ(18,"mat-tab"),t.YNc(19,ma,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,A.a8,A.dn,at.D,N.SP,N.uX,N.uD,p.yH,y.lC,Ct.k],styles:[""]}),n})();function ha(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 ga=(()=>{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 y.Av)).subscribe(i=>{const o=this.links.find(s=>i.urlAfterRedirects.includes(s.link));this.activeLink=o?o.link:this.links[0].link}),this.store.select(_.Xz).pipe((0,h.R)(this.unSubs[1]),(0,tt.M)(this.store.select(_.LR))).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(b.yh),t.Y36(y.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,ha,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,A.a8,A.dn,at.D,N.BU,u.sg,p.yH,y.lC,N.Nj,y.rH],styles:[""]}),n})();function fa(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 _a=(()=>{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 y.Av)).subscribe(i=>{const o=this.links.find(s=>i.urlAfterRedirects.includes(s.link));this.activeLink=o?o.link:this.links[0].link})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(y.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-routing"]],decls: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,fa,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,A.a8,A.dn,N.BU,u.sg,y.lC,N.Nj,y.rH],styles:[""]}),n})();var xt=g(9814),yt=g(7261),Zt=g(6895);function Ca(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 xa(n,a){1&n&&(t.TgZ(0,"th",24),t._uU(1,"Address"),t.qZA())}function ya(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 Za(n,a){1&n&&(t.TgZ(0,"th",26),t.TgZ(1,"span",27),t._uU(2,"Actions"),t.qZA(),t.qZA())}function Ta(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 Aa(n,a){1&n&&t._UZ(0,"tr",30)}function La(n,a){1&n&&t._UZ(0,"tr",31)}const va=function(n){return{"background-color":n}};function ba(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,Ca,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,xa,2,0,"th",17),t.YNc(44,ya,2,1,"td",18),t.BQk(),t.ynx(45,19),t.YNc(46,Za,3,0,"th",20),t.YNc(47,Ta,4,1,"td",21),t.BQk(),t.YNc(48,Aa,1,0,"tr",22),t.YNc(49,La,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,va,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/YYYY 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 Sa=(()=>{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(yt.ux))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-node-lookup"]],viewQuery:function(e,i){if(1&e&&t.Gf(T.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,ba,50,21,"div",0),2&e&&t.Q6J("ngIf",i.lookupResult)},directives:[u.O5,p.xw,G.d,p.yH,p.Wh,u.PC,S.Zl,u.sg,Y.$V,r.BZ,T.YE,r.w1,r.fO,r.Dz,r.as,r.nj,r.ge,T.nU,r.ev,q.lW,Zt.y,r.XQ,r.Gk],pipes:[u.uU,u.Nd,u.rS],styles:[""]}),n})();const wa=["form"];function Ea(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 qa(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 Ia(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 Fa(n,a){if(1&n&&(t.TgZ(0,"span",23),t.YNc(1,Ia,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 Oa(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 Ra(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,Fa,2,2,"span",21),t.YNc(6,Oa,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 Na(n,a){1&n&&(t.TgZ(0,"h3"),t._uU(1,"Error! Unable to find details!"),t.qZA())}const ka=function(n){return{"mt-1":!0,"mt-2":n}};let Pa=(()=>{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,R.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(O.v),t.Y36(b.yh),t.Y36(B.eX))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-lookups"]],viewQuery:function(e,i){if(1&e&&t.Gf(wa,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,Ea,2,1,"mat-error",11),t.YNc(13,qa,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,Ra,7,3,"div",15),t.qZA(),t.qZA(),t.qZA(),t.YNc(20,Na,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,ka,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,A.dn,m._Y,m.JL,m.F,xt.VQ,xt.U0,x.KE,u.mk,S.oO,U.Nt,m.Fj,m.Q7,m.JJ,m.oH,u.O5,q.lW,x.TO,u.RF,u.n9,u.ED,Sa],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 Da=g(9122);let Ua=(()=>{class n{constructor(e,i){this.store=e,this.eclEffects=i,this.newAddress=""}onGenerateAddress(){this.store.dispatch((0,R._E)()),this.eclEffects.setNewAddress.pipe((0,H.q)(1)).subscribe(e=>{this.newAddress=e,setTimeout(()=>{this.store.dispatch((0,v.qR)({payload:{data:{address:this.newAddress,addressType:"",component:Da.n}}}))},0)})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(b.yh),t.Y36(it.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})(),Ma=(()=>{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,v.qR)({payload:{data:{sweepAll:this.sweepAll,component:_t}}}))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(b.yh),t.Y36(y.gz))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-on-chain-send"]],decls:4,vars:1,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row"],["mat-flat-button","","color","primary","type","button","tabindex","1",3,"click"]],template:function(e,i){1&e&&(t.TgZ(0,"div",0),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 Ja=g(8675),Tt=g(4004),Ya=g(9843),At=g(2368),Lt=g(1079);const Qa=["form"];function Ha(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 Ba(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Peer alias is required."),t.qZA())}function za(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Peer not found in the list."),t.qZA())}function Va(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,Ha,2,2,"mat-option",33),t.ALo(5,"async"),t.qZA(),t.YNc(6,Ba,2,0,"mat-error",17),t.YNc(7,za,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 Ga(n,a){1&n&&t.GkF(0)}function Xa(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Amount is required."),t.qZA())}function $a(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 Wa(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 Ka(n,a){if(1&n&&(t.TgZ(0,"div",35),t._UZ(1,"fa-icon",36),t.YNc(2,Wa,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 ja(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 to(n,a){if(1&n&&t.YNc(0,ja,27,6,"mat-expansion-panel",37),2&n){const e=t.oxw();t.Q6J("ngIf",e.peer)}}let vt=(()=>{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,Ja.O)(""),(0,Tt.U)(o=>"string"==typeof o?o:o.alias?o.alias:o.nodeId),(0,Tt.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,R.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(b.yh),t.Y36(B.eX))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-open-channel"]],viewQuery:function(e,i){if(1&e&&t.Gf(Qa,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,Va,8,8,"mat-form-field",10),t.qZA(),t.YNc(13,Ga,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,Xa,2,0,"mat-error",17),t.YNc(25,$a,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,Ka,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,to,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,A.dk,p.Wh,q.lW,A.dn,m._Y,m.JL,m.F,u.O5,u.tP,x.KE,U.Nt,m.wV,m.qQ,m.Fd,m.Fj,$.q,Ya.F,m.Q7,m.JJ,m.On,x.bx,x.R9,At.Rr,V.ib,V.yz,V.yK,X.h,Lt.ZL,m.oH,Lt.XC,u.sg,Q.ey,x.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 eo(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 no(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 io(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 ao=(()=>{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 y.Av)).subscribe(e=>{this.activeLink=this.links.findIndex(i=>i.link===e.urlAfterRedirects.substring(e.urlAfterRedirects.lastIndexOf("/")+1))}),this.store.select(_.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(_.LR).pipe((0,h.R)(this.unSubs[2])).subscribe(e=>{this.selNode=e}),this.store.select(_.yD).pipe((0,h.R)(this.unSubs[3])).subscribe(e=>{this.information=e}),this.store.select(_.Bo).pipe((0,h.R)(this.unSubs[4])).subscribe(e=>{this.peers=e.peers}),this.store.select(_.kY).pipe((0,h.R)(this.unSubs[5])).subscribe(e=>{this.totalBalance=e.onchainBalance.total})}onOpenChannel(){this.store.dispatch((0,v.qR)({payload:{data:{alertTitle:"Open Channel",message:{peers:this.peers,information:this.information,balance:this.totalBalance},component:vt}}}))}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(b.yh),t.Y36(y.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channels-tables"]],decls:14,vars:1,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row"],["mat-flat-button","","color","primary","type","submit","tabindex","1",3,"click"],["fxLayout","column","fxFlex","100",1,"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,eo,2,1,"ng-template",5),t.qZA(),t.TgZ(8,"mat-tab"),t.YNc(9,no,2,1,"ng-template",5),t.qZA(),t.TgZ(10,"mat-tab"),t.YNc(11,io,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,N.SP,N.uX,N.uD,y.lC,Ct.k],styles:[""]}),n})();function oo(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 so(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 lo(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 ro(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Show Advanced"),t.qZA())}function co(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Hide Advanced"),t.qZA())}function uo(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,ro,2,0,"p",22),t.YNc(2,co,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 po(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 mo(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 ho=function(n){return{"xs-scroll-y":n}},go=function(n,a){return{"mt-2":n,"mt-1":a}};let ot=(()=>{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(O.v),t.Y36(yt.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,oo,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,so,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,lo,29,14,"div",16),t.TgZ(60,"div",17),t.YNc(61,uo,4,2,"button",18),t.YNc(62,po,2,1,"button",19),t.YNc(63,mo,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,ho,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,go,!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,A.dk,I.BN,q.lW,A.dn,u.mk,S.oO,u.O5,G.d,X.h,Zt.y],pipes:[u.rS,u.JJ],styles:[""]}),n})();function fo(n,a){1&n&&t._UZ(0,"mat-progress-bar",30)}function _o(n,a){1&n&&(t.TgZ(0,"th",31),t._uU(1," Short Channel ID "),t.qZA())}function Co(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 xo(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 bt=function(n){return{"max-width":n}};function yo(n,a){if(1&n&&(t.TgZ(0,"td",32),t.TgZ(1,"div",33),t.YNc(2,Co,2,1,"span",34),t.YNc(3,xo,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,bt,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 Zo(n,a){1&n&&(t.TgZ(0,"th",31),t._uU(1," Alias "),t.qZA())}function To(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,bt,i.screenSize===i.screenSizeEnum.XS?"12rem":"22rem")),t.xp6(2),t.Oqu(e.alias)}}function Ao(n,a){1&n&&(t.TgZ(0,"th",40),t._uU(1," Base Fee (mSats) "),t.qZA())}function Lo(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 vo(n,a){1&n&&(t.TgZ(0,"th",40),t._uU(1," Fee Rate (mili mSats) "),t.qZA())}function bo(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 So(n,a){1&n&&(t.TgZ(0,"th",40),t._uU(1," Local Balance (Sats) "),t.qZA())}function wo(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 Eo(n,a){1&n&&(t.TgZ(0,"th",40),t._uU(1," Remote Balance (Sats) "),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.toRemote,"1.0-0")," ")}}function Io(n,a){1&n&&(t.TgZ(0,"th",42),t._uU(1,"Balance Score "),t.qZA())}function Fo(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 Oo(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 Ro(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 No(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 ko(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No channel available."),t.qZA())}function Po(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting channels..."),t.qZA())}function Do(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 Uo(n,a){if(1&n&&(t.TgZ(0,"td",54),t.YNc(1,No,2,0,"p",55),t.YNc(2,ko,2,0,"p",55),t.YNc(3,Po,2,0,"p",55),t.YNc(4,Do,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 Mo=function(n){return{"display-none":n}};function Jo(n,a){if(1&n&&t._UZ(0,"tr",56),2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,Mo,e.numPeers>0&&(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function Yo(n,a){1&n&&t._UZ(0,"tr",57)}function Qo(n,a){1&n&&t._UZ(0,"tr",58)}const Ho=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},Bo=function(){return["no_peer"]};let zo=(()=>{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,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"])}ngOnInit(){this.store.select(_.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(_.yD).pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.information=e}),this.store.select(_.Bo).pipe((0,h.R)(this.unSubs[2])).subscribe(e=>{this.numPeers=e.peers&&e.peers.length?e.peers.length:0}),this.store.select(_.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,v.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,f=s[1].inputValue;let P=null;if(this.commonService.isVersionCompatible(this.information.version,"0.6.2")){let C="";"all"===e?(this.activeChannels.forEach(E=>{C=C+","+E.nodeId}),C=C.substring(1),P={baseFeeMsat:c,feeRate:f,nodeIds:C}):P={baseFeeMsat:c,feeRate:f,nodeId:e.nodeId}}else{let C="";"all"===e?(this.activeChannels.forEach(E=>{C=C+","+E.channelId}),C=C.substring(1),P={baseFeeMsat:c,feeRate:f,channelIds:C}):P={baseFeeMsat:c,feeRate:f,channelId:e.channelId}}this.store.dispatch((0,R.pW)({payload:P}))}}),this.applyFilter())}percentHintFunction(e){return(e/1e4).toString()+"%"}onChannelClose(e,i){this.store.dispatch((0,v.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(f=>{f&&this.store.dispatch((0,R.BL)({payload:{channelId:e.channelId,force:i}}))})}applyFilter(){this.channels.filter=this.selFilter.trim().toLowerCase()}onChannelClick(e,i){this.store.dispatch((0,v.qR)({payload:{data:{channel:e,channelsType:"open",component:ot}}}))}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(b.yh),t.Y36(K.V),t.Y36(O.v))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-open-table"]],viewQuery:function(e,i){if(1&e&&(t.Gf(T.YE,5),t.Gf(L.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:L.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,fo,1,0,"mat-progress-bar",6),t.TgZ(7,"table",7,8),t.ynx(9,9),t.YNc(10,_o,2,0,"th",10),t.YNc(11,yo,6,6,"td",11),t.BQk(),t.ynx(12,12),t.YNc(13,Zo,2,0,"th",10),t.YNc(14,To,4,4,"td",11),t.BQk(),t.ynx(15,13),t.YNc(16,Ao,2,0,"th",14),t.YNc(17,Lo,4,4,"td",11),t.BQk(),t.ynx(18,15),t.YNc(19,vo,2,0,"th",14),t.YNc(20,bo,4,4,"td",11),t.BQk(),t.ynx(21,16),t.YNc(22,So,2,0,"th",14),t.YNc(23,wo,4,4,"td",11),t.BQk(),t.ynx(24,17),t.YNc(25,Eo,2,0,"th",14),t.YNc(26,qo,4,4,"td",11),t.BQk(),t.ynx(27,18),t.YNc(28,Io,2,0,"th",19),t.YNc(29,Fo,6,4,"td",20),t.BQk(),t.ynx(30,21),t.YNc(31,Oo,8,0,"th",22),t.YNc(32,Ro,12,0,"td",23),t.BQk(),t.ynx(33,24),t.YNc(34,Uo,5,4,"td",25),t.BQk(),t.YNc(35,Jo,1,3,"tr",26),t.YNc(36,Yo,1,0,"tr",27),t.YNc(37,Qo,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,Ho,""!==i.errorMessage)),t.xp6(28),t.Q6J("matFooterRowDef",t.DdM(13,Bo)),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,x.KE,U.Nt,m.Fj,m.JJ,m.On,Y.$V,u.O5,r.BZ,T.YE,u.mk,S.oO,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,L.NW,M.pW,r.ge,T.nU,r.ev,u.PC,S.Zl,z.gM,I.BN,x.bx,k.gD,k.$L,Q.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 Vo(n,a){1&n&&t._UZ(0,"mat-progress-bar",25)}function Go(n,a){1&n&&(t.TgZ(0,"th",26),t._uU(1," State "),t.qZA())}function Xo(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 $o(n,a){1&n&&(t.TgZ(0,"th",26),t._uU(1," Alias "),t.qZA())}function Wo(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 Ko(n,a){1&n&&(t.TgZ(0,"th",28),t._uU(1," Local Balance (Sats) "),t.qZA())}function jo(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 ts(n,a){1&n&&(t.TgZ(0,"th",28),t._uU(1," Remote Balance (Sats) "),t.qZA())}function es(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 ns(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 is(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 as(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No pending channel available."),t.qZA())}function os(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting pending channels..."),t.qZA())}function ss(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 ls(n,a){if(1&n&&(t.TgZ(0,"td",36),t.YNc(1,as,2,0,"p",37),t.YNc(2,os,2,0,"p",37),t.YNc(3,ss,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 rs=function(n){return{"display-none":n}};function cs(n,a){if(1&n&&t._UZ(0,"tr",38),2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,rs,(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function us(n,a){1&n&&t._UZ(0,"tr",39)}function ps(n,a){1&n&&t._UZ(0,"tr",40)}const ms=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},ds=function(){return["no_channel"]};let hs=(()=>{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(_.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(_.yD).pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.information=e}),this.store.select(_.Bo).pipe((0,h.R)(this.unSubs[4])).subscribe(e=>{this.numPeers=e.peers&&e.peers.length?e.peers.length:0}),this.store.select(_.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,v.qR)({payload:{data:{channel:e,channelsType:"pending",component:ot}}}))}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(b.yh),t.Y36(O.v))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-pending-table"]],viewQuery:function(e,i){if(1&e&&(t.Gf(T.YE,5),t.Gf(L.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:L.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,Vo,1,0,"mat-progress-bar",6),t.TgZ(7,"table",7,8),t.ynx(9,9),t.YNc(10,Go,2,0,"th",10),t.YNc(11,Xo,3,3,"td",11),t.BQk(),t.ynx(12,12),t.YNc(13,$o,2,0,"th",10),t.YNc(14,Wo,2,1,"td",11),t.BQk(),t.ynx(15,13),t.YNc(16,Ko,2,0,"th",14),t.YNc(17,jo,4,4,"td",11),t.BQk(),t.ynx(18,15),t.YNc(19,ts,2,0,"th",14),t.YNc(20,es,4,4,"td",11),t.BQk(),t.ynx(21,16),t.YNc(22,ns,6,0,"th",17),t.YNc(23,is,3,0,"td",18),t.BQk(),t.ynx(24,19),t.YNc(25,ls,4,3,"td",20),t.BQk(),t.YNc(26,cs,1,3,"tr",21),t.YNc(27,us,1,0,"tr",22),t.YNc(28,ps,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,ms,""!==i.errorMessage)),t.xp6(19),t.Q6J("matFooterRowDef",t.DdM(13,ds)),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,x.KE,U.Nt,m.Fj,m.JJ,m.On,Y.$V,u.O5,r.BZ,T.YE,u.mk,S.oO,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,L.NW,M.pW,r.ge,T.nU,r.ev,k.gD,k.$L,Q.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 st=g(5615);const gs=["peersForm"],fs=["stepper"];function _s(n,a){if(1&n&&t._uU(0),2&n){const e=t.oxw();t.Oqu(e.peerFormLabel)}}function Cs(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Address is required."),t.qZA())}function xs(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 ys(n,a){if(1&n&&t._uU(0),2&n){const e=t.oxw();t.Oqu(e.channelFormLabel)}}function Zs(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Amount is required."),t.qZA())}function Ts(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Amount must be a positive number."),t.qZA())}function As(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 Ls(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 vs=(()=>{class n{constructor(e,i,o,s,c,f){this.dialogRef=e,this.data=i,this.store=o,this.formBuilder=s,this.actions=c,this.logger=f,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,R.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,R.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(b.yh),t.Y36(m.qu),t.Y36(B.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(gs,5),t.Gf(fs,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,_s,1,1,"ng-template",12),t.TgZ(15,"mat-form-field",1),t._UZ(16,"input",13),t.YNc(17,Cs,2,0,"mat-error",14),t.qZA(),t.YNc(18,xs,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,ys,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,Zs,2,0,"mat-error",14),t.YNc(34,Ts,2,0,"mat-error",14),t.YNc(35,As,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,Ls,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,A.dk,p.Wh,q.lW,A.dn,st.Vq,st.C0,m._Y,m.JL,m.sg,st.VY,x.KE,U.Nt,m.Fj,X.h,m.JJ,m.u,m.Q7,u.O5,m.wV,x.bx,x.R9,At.Rr,m.qQ,$.q,x.TO,I.BN],styles:[""]}),n})();function bs(n,a){1&n&&t._UZ(0,"mat-progress-bar",35)}function Ss(n,a){1&n&&(t.TgZ(0,"th",36),t._uU(1," ID "),t.qZA())}const St=function(n){return{"max-width":n}};function ws(n,a){if(1&n&&(t.TgZ(0,"td",37),t._uU(1),t.qZA()),2&n){const e=a.$implicit,i=t.oxw();t.Q6J("ngStyle",t.VKq(2,St,i.screenSize===i.screenSizeEnum.XS?"10rem":"30rem")),t.xp6(1),t.hij(" ",null==e?null:e.nodeId," ")}}function Es(n,a){1&n&&(t.TgZ(0,"th",38),t._uU(1," Alias "),t.qZA())}const wt=function(n){return{"mr-0":n}};function qs(n,a){if(1&n&&t._UZ(0,"span",42),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,wt,e.screenSize===e.screenSizeEnum.XS))}}function Is(n,a){if(1&n&&t._UZ(0,"span",43),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,wt,e.screenSize===e.screenSizeEnum.XS))}}function Fs(n,a){if(1&n&&(t.TgZ(0,"td",39),t.YNc(1,qs,1,3,"span",40),t.YNc(2,Is,1,3,"span",41),t._uU(3),t.qZA()),2&n){const e=a.$implicit,i=t.oxw();t.Q6J("ngStyle",t.VKq(4,St,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 Os(n,a){1&n&&(t.TgZ(0,"th",36),t._uU(1," State "),t.qZA())}function Rs(n,a){if(1&n&&(t.TgZ(0,"td",44),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.hij(" ",null==e?null:e.state," ")}}function Ns(n,a){1&n&&(t.TgZ(0,"th",36),t._uU(1," Network Address "),t.qZA())}function ks(n,a){if(1&n&&(t.TgZ(0,"td",44),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.hij(" ",null==e?null:e.address," ")}}function Ps(n,a){1&n&&(t.TgZ(0,"th",36),t._uU(1," Channels "),t.qZA())}function Ds(n,a){if(1&n&&(t.TgZ(0,"td",44),t._uU(1),t.qZA()),2&n){const e=a.$implicit;t.xp6(1),t.hij(" ",null==e?null:e.channels," ")}}function Us(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"th",45),t.TgZ(1,"div",46),t.TgZ(2,"mat-select",47),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",48),t.NdJ("click",function(){return t.CHM(e),t.oxw().onDownloadCSV()}),t._uU(5,"Download CSV"),t.qZA(),t.qZA(),t.qZA(),t.qZA()}}function Ms(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mat-option",48),t.NdJ("click",function(){t.CHM(e);const o=t.oxw().$implicit;return t.oxw().onPeerDetach(o)}),t._uU(1,"Disconnect"),t.qZA()}}function Js(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"mat-option",48),t.NdJ("click",function(){t.CHM(e);const o=t.oxw().$implicit;return t.oxw().onConnectPeer(o)}),t._uU(1,"Reconnect"),t.qZA()}}function Ys(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",49),t.TgZ(1,"div",46),t.TgZ(2,"mat-select",47),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",48),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",48),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,Ms,2,0,"mat-option",50),t.YNc(9,Js,2,0,"mat-option",50),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 Qs(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No connected peer."),t.qZA())}function Hs(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting peers..."),t.qZA())}function Bs(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 zs(n,a){if(1&n&&(t.TgZ(0,"td",51),t.YNc(1,Qs,2,0,"p",52),t.YNc(2,Hs,2,0,"p",52),t.YNc(3,Bs,2,1,"p",52),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 Vs=function(n){return{"display-none":n}};function Gs(n,a){if(1&n&&t._UZ(0,"tr",53),2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,Vs,(null==e.peers?null:e.peers.data)&&(null==e.peers||null==e.peers.data?null:e.peers.data.length)>0))}}function Xs(n,a){1&n&&t._UZ(0,"tr",54)}function $s(n,a){1&n&&t._UZ(0,"tr",55)}const Ws=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},Ks=function(){return["no_peer"]};let js=(()=>{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(_.yD).pipe((0,h.R)(this.unSubs[0])).subscribe(e=>{this.information=e}),this.store.select(_.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(_.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,v.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:"Peer Information",showQRName:"Public Key",showQRField:e.nodeId,message:o}}}))}onConnectPeer(e){this.store.dispatch((0,v.qR)({payload:{data:{message:{peer:e.nodeId?e:null,information:this.information,balance:this.availableBalance},component:vs}}}))}onOpenChannel(e){this.store.dispatch((0,v.qR)({payload:{data:{alertTitle:"Open Channel",message:{peer:e,information:this.information,balance:this.availableBalance},newlyAdded:!1,component:vt}}}))}onPeerDetach(e){this.store.dispatch(e.channels>0?(0,v.qR)({payload:{data:{type:l.n_.ERROR,alertTitle:"Disconnect Not Allowed",titleMessage:"Channel active with this peer."}}}):(0,v.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,R.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(b.yh),t.Y36(K.V),t.Y36(B.eX),t.Y36(O.v))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-peers"]],viewQuery:function(e,i){if(1&e&&(t.Gf(T.YE,5),t.Gf(L.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:L.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"],["matColumnDef","actions"],["mat-header-cell","","class","px-3",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center","class","px-3",4,"matCellDef"],["matColumnDef","no_peer"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell","",3,"ngStyle"],["mat-header-cell","","mat-sort-header","",1,"px-3"],["mat-cell","",1,"px-3",3,"ngStyle"],["class","dot green","matTooltip","Connected","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot red","matTooltip","Disconnected","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["matTooltip","Connected","matTooltipPosition","right",1,"dot","green",3,"ngClass"],["matTooltip","Disconnected","matTooltipPosition","right",1,"dot","red",3,"ngClass"],["mat-cell",""],["mat-header-cell","",1,"px-3"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"px-3"],[3,"click",4,"ngIf"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(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,bs,1,0,"mat-progress-bar",13),t.TgZ(16,"table",14,15),t.ynx(18,16),t.YNc(19,Ss,2,0,"th",17),t.YNc(20,ws,2,4,"td",18),t.BQk(),t.ynx(21,19),t.YNc(22,Es,2,0,"th",20),t.YNc(23,Fs,4,6,"td",21),t.BQk(),t.ynx(24,22),t.YNc(25,Os,2,0,"th",17),t.YNc(26,Rs,2,1,"td",23),t.BQk(),t.ynx(27,24),t.YNc(28,Ns,2,0,"th",17),t.YNc(29,ks,2,1,"td",23),t.BQk(),t.ynx(30,25),t.YNc(31,Ps,2,0,"th",17),t.YNc(32,Ds,2,1,"td",23),t.BQk(),t.ynx(33,26),t.YNc(34,Us,6,0,"th",27),t.YNc(35,Ys,10,2,"td",28),t.BQk(),t.ynx(36,29),t.YNc(37,zs,4,3,"td",30),t.BQk(),t.YNc(38,Gs,1,3,"tr",31),t.YNc(39,Xs,1,0,"tr",32),t.YNc(40,$s,1,0,"tr",33),t.qZA(),t.qZA(),t._UZ(41,"mat-paginator",34),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,Ws,""!==i.errorMessage)),t.xp6(22),t.Q6J("matFooterRowDef",t.DdM(14,Ks)),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,x.KE,U.Nt,m.Fj,m.JJ,m.On,Y.$V,u.O5,r.BZ,T.YE,u.mk,S.oO,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,L.NW,M.pW,r.ge,T.nU,r.ev,u.PC,S.Zl,z.gM,k.gD,k.$L,Q.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%]{flex:1 1 15%;width:15%}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),n})();const tl=["queryRoutesForm"];function el(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Destination Node ID is required."),t.qZA())}function nl(n,a){1&n&&(t.TgZ(0,"mat-error"),t._uU(1,"Amount is required."),t.qZA())}function il(n,a){1&n&&t._UZ(0,"mat-progress-bar",31)}function al(n,a){1&n&&(t.TgZ(0,"th",32),t._uU(1," Alias "),t.qZA())}function ol(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.hij(" ",null==e?null:e.alias," ")}}function sl(n,a){1&n&&(t.TgZ(0,"th",32),t._uU(1," ID "),t.qZA())}function ll(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.hij(" ",null==e?null:e.nodeId," ")}}function rl(n,a){1&n&&(t.TgZ(0,"th",34),t.TgZ(1,"span",35),t._uU(2,"Actions"),t.qZA(),t.qZA())}function cl(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"td",36),t.TgZ(1,"button",37),t.NdJ("click",function(o){const c=t.CHM(e).$implicit;return t.oxw().onHopClick(c,o)}),t._uU(2,"View Info"),t.qZA(),t.qZA()}}function ul(n,a){1&n&&t._UZ(0,"tr",38)}function pl(n,a){1&n&&t._UZ(0,"tr",39)}const ml=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}};let dl=(()=>{class n{constructor(e,i,o){this.store=e,this.eclEffects=i,this.commonService=o,this.nodeId="",this.amount=0,this.flgSticky=!1,this.displayedColumns=[],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=new r.by([]),this.eclEffects.setQueryRoutes.pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.qrHops.data=[],e&&e.length&&e.length>0?(this.flgLoading[0]=!1,this.qrHops=new r.by([...e]),this.qrHops.data=e):this.flgLoading[0]="error",this.qrHops.sort=this.sort,this.qrHops.sortingDataAccessor=(i,o)=>i[o]&&isNaN(i[o])?i[o].toLocaleLowerCase():i[o]?+i[o]:null})}onQueryRoutes(){if(!this.nodeId||!this.amount)return!0;this.qrHops.data=[],this.flgLoading[0]=!0,this.store.dispatch((0,R.WO)({payload:{nodeId:this.nodeId,amount:1e3*this.amount}}))}resetData(){this.nodeId="",this.amount=0,this.flgLoading[0]=!1,this.qrHops.data=[],this.form.resetForm()}onHopClick(e,i){this.store.dispatch((0,v.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(b.yh),t.Y36(it.o),t.Y36(O.v))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-query-routes"]],viewQuery:function(e,i){if(1&e&&(t.Gf(T.YE,5),t.Gf(tl,7)),2&e){let o;t.iGM(o=t.CRH())&&(i.sort=o.first),t.iGM(o=t.CRH())&&(i.form=o.first)}},decls:39,vars:16,consts:[["fxLayout","column","fxFlex","100"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap",3,"ngSubmit"],["queryRoutesForm","ngForm"],["fxFlex","100",1,"alert","alert-warn"],[1,"mr-1","alert-icon",3,"icon"],["fxFlex","69","fxLayoutAlign","start end"],["matInput","","placeholder","Destination Node ID","name","nodeId","tabindex","1","required","",3,"ngModel","ngModelChange"],["destPubkey","ngModel"],[4,"ngIf"],["fxFlex","29","fxLayoutAlign","start end"],["matInput","","placeholder","Amount (Sats)","name","amount","tabindex","2","type","number","required","",3,"ngModel","step","min","ngModelChange"],["fxLayout","row",1,"mt-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"],[1,"table-container","mb-6",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","alias"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","nodeId"],["matColumnDef","actions"],["mat-header-cell","","class","pl-4 pr-3",4,"matHeaderCellDef"],["mat-cell","","class","pl-4",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell","",1,"pl-4","pr-3"],["fxLayoutAlign","end center"],["mat-cell","",1,"pl-4"],["mat-stroked-button","","color","primary","type","button","tabindex","4",3,"click"],["mat-header-row",""],["mat-row",""]],template:function(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,el,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,nl,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.TgZ(24,"div",18),t.YNc(25,il,1,0,"mat-progress-bar",19),t.TgZ(26,"table",20,21),t.ynx(28,22),t.YNc(29,al,2,0,"th",23),t.YNc(30,ol,2,1,"td",24),t.BQk(),t.ynx(31,25),t.YNc(32,sl,2,0,"th",23),t.YNc(33,ll,2,1,"td",24),t.BQk(),t.ynx(34,26),t.YNc(35,rl,3,0,"th",27),t.YNc(36,cl,3,0,"td",28),t.BQk(),t.YNc(37,ul,1,0,"tr",29),t.YNc(38,pl,1,0,"tr",30),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(4),t.Q6J("ngIf",!0===i.flgLoading[0]),t.xp6(1),t.Q6J("dataSource",i.qrHops)("ngClass",t.VKq(14,ml,"error"===i.flgLoading[0])),t.xp6(11),t.Q6J("matHeaderRowDef",i.displayedColumns)("matHeaderRowDefSticky",i.flgSticky),t.xp6(1),t.Q6J("matRowDefColumns",i.displayedColumns))},directives:[p.xw,p.yH,m._Y,m.JL,m.F,p.Wh,I.BN,x.KE,U.Nt,m.Fj,m.Q7,m.JJ,m.On,u.O5,m.wV,m.qQ,$.q,q.lW,Y.$V,r.BZ,T.YE,u.mk,S.oO,r.w1,r.fO,r.Dz,r.as,r.nj,x.TO,M.pW,r.ge,T.nU,r.ev,r.XQ,r.Gk],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 hl(n,a){1&n&&t._UZ(0,"mat-progress-bar",29)}function gl(n,a){1&n&&(t.TgZ(0,"th",30),t._uU(1," State "),t.qZA())}function fl(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 _l(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 Cl(n,a){if(1&n&&(t.TgZ(0,"td",31),t.TgZ(1,"div",32),t.YNc(2,fl,2,1,"span",33),t.YNc(3,_l,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 xl(n,a){1&n&&(t.TgZ(0,"th",30),t._uU(1," Short Channel ID "),t.qZA())}function yl(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 Zl(n,a){1&n&&(t.TgZ(0,"th",30),t._uU(1," Alias "),t.qZA())}function Tl(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 Al(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1," Local Balance (Sats) "),t.qZA())}function Ll(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 vl(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1," Remote Balance (Sats) "),t.qZA())}function bl(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 Sl(n,a){1&n&&(t.TgZ(0,"th",41),t._uU(1,"Balance Score "),t.qZA())}function wl(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 El(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 ql(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 Il(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No inactive channel available."),t.qZA())}function Fl(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting inactive channels..."),t.qZA())}function Ol(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 Rl(n,a){if(1&n&&(t.TgZ(0,"td",53),t.YNc(1,Il,2,0,"p",54),t.YNc(2,Fl,2,0,"p",54),t.YNc(3,Ol,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 Nl=function(n){return{"display-none":n}};function kl(n,a){if(1&n&&t._UZ(0,"tr",55),2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,Nl,(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function Pl(n,a){1&n&&t._UZ(0,"tr",56)}function Dl(n,a){1&n&&t._UZ(0,"tr",57)}const Ul=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},Ml=function(){return["no_channel"]};let Jl=(()=>{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(_.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(_.yD).pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.information=e}),this.store.select(_.Bo).pipe((0,h.R)(this.unSubs[2])).subscribe(e=>{this.numPeers=e.peers&&e.peers.length?e.peers.length:0}),this.store.select(_.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,v.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(f=>{f&&this.store.dispatch((0,R.BL)({payload:{channelId:e.channelId,force:i}}))})}applyFilter(){this.channels.filter=this.selFilter.trim().toLocaleLowerCase()}onChannelClick(e,i){this.store.dispatch((0,v.qR)({payload:{data:{channel:e,channelsType:"inactive",component:ot}}}))}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(b.yh),t.Y36(K.V),t.Y36(O.v))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-channel-inactive-table"]],viewQuery:function(e,i){if(1&e&&(t.Gf(T.YE,5),t.Gf(L.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:L.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,hl,1,0,"mat-progress-bar",6),t.TgZ(7,"table",7,8),t.ynx(9,9),t.YNc(10,gl,2,0,"th",10),t.YNc(11,Cl,7,8,"td",11),t.BQk(),t.ynx(12,12),t.YNc(13,xl,2,0,"th",10),t.YNc(14,yl,2,1,"td",11),t.BQk(),t.ynx(15,13),t.YNc(16,Zl,2,0,"th",10),t.YNc(17,Tl,4,4,"td",11),t.BQk(),t.ynx(18,14),t.YNc(19,Al,2,0,"th",15),t.YNc(20,Ll,4,4,"td",11),t.BQk(),t.ynx(21,16),t.YNc(22,vl,2,0,"th",15),t.YNc(23,bl,4,4,"td",11),t.BQk(),t.ynx(24,17),t.YNc(25,Sl,2,0,"th",18),t.YNc(26,wl,6,4,"td",19),t.BQk(),t.ynx(27,20),t.YNc(28,El,6,0,"th",21),t.YNc(29,ql,8,0,"td",22),t.BQk(),t.ynx(30,23),t.YNc(31,Rl,4,3,"td",24),t.BQk(),t.YNc(32,kl,1,3,"tr",25),t.YNc(33,Pl,1,0,"tr",26),t.YNc(34,Dl,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,Ul,""!==i.errorMessage)),t.xp6(25),t.Q6J("matFooterRowDef",t.DdM(13,Ml)),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,x.KE,U.Nt,m.Fj,m.JJ,m.On,Y.$V,u.O5,r.BZ,T.YE,u.mk,S.oO,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,L.NW,M.pW,r.ge,T.nU,r.ev,u.PC,S.Zl,z.gM,I.BN,x.bx,k.gD,k.$L,Q.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})(),Yl=(()=>{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 Ql(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 Hl(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 Bl(n,a){1&n&&t._UZ(0,"mat-progress-bar",32)}function zl(n,a){1&n&&(t.TgZ(0,"th",33),t._uU(1,"Date/Time"),t.qZA())}const Vl=function(n){return{"ml-0":n}};function Gl(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,Vl,i.screenSize===i.screenSizeEnum.XS))}}function Xl(n,a){if(1&n&&(t.TgZ(0,"td",34),t.YNc(1,Gl,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/YYYY HH:mm")," ")}}function $l(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 Wl(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 Kl(n,a){1&n&&(t.TgZ(0,"th",33),t._uU(1,"Out Channel"),t.qZA())}function jl(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 tr(n,a){1&n&&(t.TgZ(0,"th",38),t._uU(1,"Amount In (Sats)"),t.qZA())}function er(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 nr(n,a){1&n&&(t.TgZ(0,"th",38),t._uU(1,"Amount Out (Sats)"),t.qZA())}function ir(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 ar(n,a){1&n&&(t.TgZ(0,"th",38),t._uU(1,"Fee Earned (Sats)"),t.qZA())}function or(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 sr(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 lr(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 rr(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No forwarding history available."),t.qZA())}function cr(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting forwarding history..."),t.qZA())}function ur(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 pr(n,a){if(1&n&&(t.TgZ(0,"td",46),t.YNc(1,rr,2,0,"p",47),t.YNc(2,cr,2,0,"p",47),t.YNc(3,ur,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 mr=function(n){return{"display-none":n}};function dr(n,a){if(1&n&&t._UZ(0,"tr",48),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,mr,(null==e.forwardingHistoryEvents?null:e.forwardingHistoryEvents.data)&&(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)>0))}}function hr(n,a){1&n&&t._UZ(0,"tr",49)}function gr(n,a){1&n&&t._UZ(0,"tr",50)}const fr=function(){return["no_event"]};function _r(n,a){if(1&n&&(t.TgZ(0,"div",10),t.YNc(1,Bl,1,0,"mat-progress-bar",11),t.TgZ(2,"table",12,13),t.ynx(4,14),t.YNc(5,zl,2,0,"th",15),t.YNc(6,Xl,4,5,"td",16),t.BQk(),t.ynx(7,17),t.YNc(8,$l,2,0,"th",15),t.YNc(9,Wl,2,4,"td",18),t.BQk(),t.ynx(10,19),t.YNc(11,Kl,2,0,"th",15),t.YNc(12,jl,2,4,"td",18),t.BQk(),t.ynx(13,20),t.YNc(14,tr,2,0,"th",21),t.YNc(15,er,4,3,"td",16),t.BQk(),t.ynx(16,22),t.YNc(17,nr,2,0,"th",21),t.YNc(18,ir,4,3,"td",16),t.BQk(),t.ynx(19,23),t.YNc(20,ar,2,0,"th",21),t.YNc(21,or,4,3,"td",16),t.BQk(),t.ynx(22,24),t.YNc(23,sr,6,0,"th",25),t.YNc(24,lr,3,0,"td",26),t.BQk(),t.ynx(25,27),t.YNc(26,pr,4,3,"td",28),t.BQk(),t.YNc(27,dr,1,3,"tr",29),t.YNc(28,hr,1,0,"tr",30),t.YNc(29,gr,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,fr)),t.xp6(1),t.Q6J("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),t.xp6(1),t.Q6J("matRowDefColumns",e.displayedColumns)}}function Cr(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(_.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,v.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(O.v),t.Y36(b.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(T.YE,5),t.Gf(L.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:L.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,Ql,2,1,"div",1),t.YNc(2,Hl,4,1,"div",2),t.YNc(3,_r,30,7,"div",3),t.YNc(4,Cr,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,x.KE,U.Nt,m.Fj,m.JJ,m.On,Y.$V,r.BZ,T.YE,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,M.pW,r.ge,T.nU,r.ev,z.gM,u.mk,S.oO,u.PC,S.Zl,k.gD,k.$L,Q.ey,q.lW,r.yh,r.Q2,r.XQ,r.Gk,L.NW],pipes:[u.uU,Yl,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 xr=["tableIn"],yr=["tableOut"],Zr=["paginatorIn"],Tr=["paginatorOut"];function Ar(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 Lr(n,a){1&n&&t._UZ(0,"mat-progress-bar",36)}function vr(n,a){1&n&&(t.TgZ(0,"th",37),t._uU(1,"Channel ID"),t.qZA())}const j=function(n){return{"max-width":n}};function br(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,j,i.screenSize===i.screenSizeEnum.XS?"5rem":"10rem")),t.xp6(1),t.Oqu(e.channelId)}}function Sr(n,a){1&n&&(t.TgZ(0,"th",37),t._uU(1,"Peer Alias"),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,j,i.screenSize===i.screenSizeEnum.XS?"5rem":"10rem")),t.xp6(1),t.Oqu(e.alias)}}function Er(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Events"),t.qZA())}function qr(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 Ir(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Amount (Sats)"),t.qZA())}function Fr(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 Or(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Fee (Sats)"),t.qZA())}function Rr(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 Nr(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No incoming routing peer available."),t.qZA())}function kr(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting incoming routing peers..."),t.qZA())}function Pr(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 Dr(n,a){if(1&n&&(t.TgZ(0,"td",42),t.YNc(1,Nr,2,0,"p",43),t.YNc(2,kr,2,0,"p",43),t.YNc(3,Pr,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 Ft=function(n){return{"display-none":n}};function Ur(n,a){if(1&n&&t._UZ(0,"tr",44),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,Ft,(null==e.RoutingPeersIncoming?null:e.RoutingPeersIncoming.data)&&(null==e.RoutingPeersIncoming||null==e.RoutingPeersIncoming.data?null:e.RoutingPeersIncoming.data.length)>0))}}function Mr(n,a){1&n&&t._UZ(0,"tr",45)}function Jr(n,a){1&n&&t._UZ(0,"tr",46)}function Yr(n,a){1&n&&t._UZ(0,"mat-progress-bar",36)}function Qr(n,a){1&n&&(t.TgZ(0,"th",37),t._uU(1,"Channel ID"),t.qZA())}function Hr(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,j,i.screenSize===i.screenSizeEnum.XS?"5rem":"10rem")),t.xp6(1),t.Oqu(e.channelId)}}function Br(n,a){1&n&&(t.TgZ(0,"th",37),t._uU(1,"Peer Alias"),t.qZA())}function zr(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,j,i.screenSize===i.screenSizeEnum.XS?"5rem":"10rem")),t.xp6(1),t.Oqu(e.alias)}}function Vr(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Events"),t.qZA())}function Gr(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 Xr(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Amount (Sats)"),t.qZA())}function $r(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 Wr(n,a){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Fee (Sats)"),t.qZA())}function Kr(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 jr(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"No outgoing routing peer available."),t.qZA())}function tc(n,a){1&n&&(t.TgZ(0,"p"),t._uU(1,"Getting outgoing routing peers..."),t.qZA())}function ec(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 nc(n,a){if(1&n&&(t.TgZ(0,"td",42),t.YNc(1,jr,2,0,"p",43),t.YNc(2,tc,2,0,"p",43),t.YNc(3,ec,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 ic(n,a){if(1&n&&t._UZ(0,"tr",44),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,Ft,(null==e.RoutingPeersOutgoing?null:e.RoutingPeersOutgoing.data)&&(null==e.RoutingPeersOutgoing||null==e.RoutingPeersOutgoing.data?null:e.RoutingPeersOutgoing.data.length)>0))}}function ac(n,a){1&n&&t._UZ(0,"tr",45)}function oc(n,a){1&n&&t._UZ(0,"tr",46)}const sc=function(n,a){return{"mt-2":n,"mt-1":a}},lc=function(){return["no_incoming_event"]},rc=function(n){return{"mt-2":n}},cc=function(){return["no_outgoing_event"]};function uc(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,Lr,1,0,"mat-progress-bar",11),t.TgZ(9,"table",12,13),t.ynx(11,14),t.YNc(12,vr,2,0,"th",15),t.YNc(13,br,2,4,"td",16),t.BQk(),t.ynx(14,17),t.YNc(15,Sr,2,0,"th",15),t.YNc(16,wr,2,4,"td",16),t.BQk(),t.ynx(17,18),t.YNc(18,Er,2,0,"th",19),t.YNc(19,qr,4,3,"td",20),t.BQk(),t.ynx(20,21),t.YNc(21,Ir,2,0,"th",19),t.YNc(22,Fr,4,3,"td",20),t.BQk(),t.ynx(23,22),t.YNc(24,Or,2,0,"th",19),t.YNc(25,Rr,4,3,"td",20),t.BQk(),t.ynx(26,23),t.YNc(27,Dr,4,3,"td",24),t.BQk(),t.YNc(28,Ur,1,3,"tr",25),t.YNc(29,Mr,1,0,"tr",26),t.YNc(30,Jr,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,Yr,1,0,"mat-progress-bar",11),t.TgZ(41,"table",32,33),t.ynx(43,14),t.YNc(44,Qr,2,0,"th",15),t.YNc(45,Hr,2,4,"td",16),t.BQk(),t.ynx(46,17),t.YNc(47,Br,2,0,"th",15),t.YNc(48,zr,2,4,"td",16),t.BQk(),t.ynx(49,18),t.YNc(50,Vr,2,0,"th",19),t.YNc(51,Gr,4,3,"td",20),t.BQk(),t.ynx(52,21),t.YNc(53,Xr,2,0,"th",19),t.YNc(54,$r,4,3,"td",20),t.BQk(),t.ynx(55,22),t.YNc(56,Wr,2,0,"th",19),t.YNc(57,Kr,4,3,"td",20),t.BQk(),t.ynx(58,34),t.YNc(59,nc,4,3,"td",24),t.BQk(),t.YNc(60,ic,1,3,"tr",25),t.YNc(61,ac,1,0,"tr",26),t.YNc(62,oc,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,sc,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,lc)),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,rc,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,cc)),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 pc=(()=>{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(_.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(P=>P.channelId===s.fromChannelId),f=o.find(P=>P.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}),f?(f.events++,f.totalAmount=+f.totalAmount+ +s.amountOut,f.totalFee=s.amountIn-s.amountOut+ +f.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(O.v),t.Y36(b.yh))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-routing-peers"]],viewQuery:function(e,i){if(1&e&&(t.Gf(xr,5,T.YE),t.Gf(yr,5,T.YE),t.Gf(Zr,5),t.Gf(Tr,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:L.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,Ar,2,1,"div",1),t.YNc(2,uc,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,S.oO,x.KE,U.Nt,m.Fj,m.JJ,m.On,Y.$V,r.BZ,T.YE,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,L.NW,M.pW,r.ge,T.nU,r.ev,u.PC,S.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 mc(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 dc=(()=>{class n{constructor(e){this.router=e,this.faChartBar=Z.koM,this.links=[{link:"routingfees",name:"Routing Fees"},{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 y.Av)).subscribe(i=>{const o=this.links.find(s=>i.urlAfterRedirects.includes(s.link));this.activeLink=o?o.link:this.links[0].link})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(y.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-reports"]],decls: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,mc,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,A.a8,A.dn,N.BU,u.sg,y.lC,N.Nj,y.rH],styles:[""]}),n})();var Ot=g(7772),Rt=g(7671),Nt=g(6046);function hc(n,a){if(1&n&&(t.TgZ(0,"div",8),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 gc(n,a){1&n&&(t.TgZ(0,"div",9),t._uU(1,"No fee report for the selected period"),t.qZA())}function fc(n,a){if(1&n&&(t.TgZ(0,"span"),t.TgZ(1,"span",12),t._uU(2),t.ALo(3,"number"),t.qZA(),t.TgZ(4,"span",12),t._uU(5),t.ALo(6,"number"),t.qZA(),t.qZA()),2&n){const e=a.model;t.xp6(2),t.hij("Events: ",t.lcZ(3,2,e.extra.totalEvents||0),""),t.xp6(3),t.hij("Fee: ",t.xi3(6,4,e.value||0,"1.0-2"),"")}}function _c(n,a){if(1&n){const e=t.EpF();t.TgZ(0,"ngx-charts-bar-vertical",10),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,fc,7,7,"ng-template",null,11,t.W1O),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("view",e.view)("results",e.feeReportData)("gradient",!1)("xAxis",!0)("yAxis",!0)("showXAxisLabel",!0)("showYAxisLabel",e.showYAxisLabel)("xAxisLabel",e.xAxisLabel)("yAxisLabel",e.yAxisLabel)("showGridLines",!1)("showDataLabel",!1)}}function Cc(n,a){if(1&n&&t._UZ(0,"rtl-ecl-forwarding-history",13),2&n){const e=t.oxw();t.Q6J("eventsData",e.filteredEventsBySelectedPeriod)("filterValue",e.eventFilterValue)}}let xc=(()=>{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.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.feeReportData=[],this.view=[350,350],this.screenPaddingX=100,this.gradient=!0,this.xAxisLabel="Date",this.yAxisLabel="Fee (Sats)",this.showYAxisLabel=!0,this.screenSize="",this.screenSizeEnum=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(_.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.feeReportData=[],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.feeReportData=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.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}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}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(O.v),t.Y36(b.yh))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-fee-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","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.YNc(3,hc,4,8,"div",3),t.YNc(4,gc,2,0,"div",4),t.TgZ(5,"div",5),t.YNc(6,_c,3,11,"ngx-charts-bar-vertical",6),t.qZA(),t.TgZ(7,"div",5),t.YNc(8,Cc,1,2,"rtl-ecl-forwarding-history",7),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.xp6(3),t.Q6J("ngIf",i.feeReportData.length>0&&i.filteredEventsBySelectedPeriod.length>0),t.xp6(1),t.Q6J("ngIf",i.feeReportData.length<=0||i.filteredEventsBySelectedPeriod.length<=0),t.xp6(2),t.Q6J("ngIf",i.feeReportData.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,u.O5,Nt.K$,It],pipes:[u.JJ],styles:[""],data:{animation:[Ot.J]}}),n})();var yc=g(165);function Zc(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 Tc(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 Ac(n,a){if(1&n&&(t.TgZ(0,"div",8),t.YNc(1,Zc,4,7,"div",9),t.YNc(2,Tc,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 Lc(n,a){1&n&&(t.TgZ(0,"div",11),t._uU(1,"No transactions report for the selected period"),t.qZA())}function vc(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 bc(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,vc,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 Sc(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 wc=(()=>{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(_.PP).pipe((0,h.R)(this.unSubs[0]),(0,tt.M)(this.store.select(_.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 f=this.payments.filter(C=>Math.floor(C.firstPartTimestamp/1e3)>=o&&Math.floor(C.firstPartTimestamp/1e3)<s),P=this.invoices.filter(C=>"received"===C.status&&C.timestamp>=o&&C.timestamp<s);if(this.transactionsReportSummary.paymentsSelectedPeriod=f.length,this.transactionsReportSummary.invoicesSelectedPeriod=P.length,this.reportPeriod===l.op[1]){for(let C=0;C<12;C++)c.push({name:l.gg[C].name,date:new Date(e.getFullYear(),C,1,0,0,0,0),series:[{name:"Paid",value:0,extra:{total:0}},{name:"Received",value:0,extra:{total:0}}]});f.map(C=>{const E=new Date(C.firstPartTimestamp).getMonth();return this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+C.recipientAmount,c[E].series[0].value=c[E].series[0].value+C.recipientAmount,c[E].series[0].extra.total=c[E].series[0].extra.total+1,this.transactionsReportSummary}),P.map(C=>{const E=new Date(1e3*C.timestamp).getMonth();return this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+C.amountSettled,c[E].series[1].value=c[E].series[1].value+C.amountSettled,c[E].series[1].extra.total=c[E].series[1].extra.total+1,this.transactionsReportSummary})}else{for(let C=0;C<this.getMonthDays(e.getMonth(),e.getFullYear());C++)c.push({name:(C+1).toString(),date:new Date(1e3*(C*this.secondsInADay+o)),series:[{name:"Paid",value:0,extra:{total:0}},{name:"Received",value:0,extra:{total:0}}]});f.map(C=>{const E=Math.floor((Math.floor(C.firstPartTimestamp/1e3)-o)/this.secondsInADay);return this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+C.recipientAmount,c[E].series[0].value=c[E].series[0].value+C.recipientAmount,c[E].series[0].extra.total=c[E].series[0].extra.total+1,this.transactionsReportSummary}),P.map(C=>{const E=Math.floor((C.timestamp-o)/this.secondsInADay);return this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+C.amountSettled,c[E].series[1].value=c[E].series[1].value+C.amountSettled,c[E].series[1].extra.total=c[E].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(O.v),t.Y36(b.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,Ac,3,3,"div",3),t.YNc(4,Lc,2,0,"div",4),t.TgZ(5,"div",5),t.YNc(6,bc,3,13,"ngx-charts-bar-vertical-2d",6),t.qZA(),t.TgZ(7,"div",5),t.YNc(8,Sc,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,yc.g],pipes:[u.JJ],styles:[""],data:{animation:[Ot.J]}}),n})();var w=g(1643),Ec=g(9442);function qc(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 Oc=y.Bz.forChild([{path:"",component:rt,children:[{path:"",pathMatch:"full",redirectTo:"home"},{path:"home",component:wi,canActivate:[w.fY]},{path:"onchain",component:ua,canActivate:[w.fY],children:[{path:"",pathMatch:"full",redirectTo:"receive"},{path:"receive",component:Ua,canActivate:[w.fY]},{path:"send",component:Ma,canActivate:[w.fY]}]},{path:"connections",component:da,canActivate:[w.fY],children:[{path:"",pathMatch:"full",redirectTo:"channels"},{path:"channels",component:ao,canActivate:[w.fY],children:[{path:"",pathMatch:"full",redirectTo:"open"},{path:"open",component:zo,canActivate:[w.fY]},{path:"pending",component:hs,canActivate:[w.fY]},{path:"inactive",component:Jl,canActivate:[w.fY]}]},{path:"peers",component:js,data:{sweepAll:!1},canActivate:[w.fY]}]},{path:"transactions",component:ga,canActivate:[w.fY],children:[{path:"",pathMatch:"full",redirectTo:"payments"},{path:"payments",component:gt,canActivate:[w.fY]},{path:"invoices",component:dt,canActivate:[w.fY]}]},{path:"routing",component:_a,canActivate:[w.fY],children:[{path:"",pathMatch:"full",redirectTo:"forwardinghistory"},{path:"forwardinghistory",component:It,canActivate:[w.fY]},{path:"peers",component:pc,canActivate:[w.fY]}]},{path:"reports",component:dc,canActivate:[w.fY],children:[{path:"",pathMatch:"full",redirectTo:"routingfees"},{path:"routingfees",component:xc,canActivate:[w.fY]},{path:"transactions",component:wc,canActivate:[w.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 y.Av)).subscribe(i=>{const o=this.links.find(s=>i.urlAfterRedirects.includes(s.link));this.activeLink=o?o.link:this.links[0].link})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(y.F0))},n.\u0275cmp=t.Xpm({type:n,selectors:[["rtl-ecl-graph"]],decls: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,qc,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,A.a8,A.dn,N.BU,u.sg,p.yH,y.lC,N.Nj,y.rH],styles:[""]}),n})(),canActivate:[w.fY],children:[{path:"",pathMatch:"full",redirectTo:"lookups"},{path:"lookups",component:Pa,canActivate:[w.fY]},{path:"queryroutes",component:dl,canActivate:[w.fY]}]},{path:"**",component:Ec.w}]}]);var Rc=g(8750);let Nc=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n,bootstrap:[rt]}),n.\u0275inj=t.cJS({providers:[w.fY],imports:[[u.ez,Rc.m,Oc]]}),n})()}}]); |