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

1 line
30 KiB
JavaScript

"use strict";(self.webpackChunkRTLApp=self.webpackChunkRTLApp||[]).push([[267],{1203:(Q,P,n)=>{n.d(P,{D:()=>V});var a=n(7579),T=n(2722),C=n(7731),e=n(8377),t=n(4650),S=n(62),D=n(9653),F=n(6895),L=n(1576),c=n(7392),w=n(266),N=n(3848);function y(p,h){if(1&p&&(t.TgZ(0,"mat-icon",10),t._uU(1,"info_outline"),t.qZA()),2&p){const m=t.oxw().$implicit;t.Q6J("matTooltip",m.tooltip)}}function x(p,h){if(1&p&&(t.TgZ(0,"span",11),t._uU(1),t.ALo(2,"number"),t.qZA()),2&p){const m=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,m.dataValue)," ")}}function E(p,h){if(1&p&&(t.TgZ(0,"span",11),t._uU(1),t.ALo(2,"number"),t.qZA()),2&p){const m=t.oxw().$implicit,f=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,m[f.currencyUnitEnum.BTC],f.currencyUnitFormats.BTC)," ")}}function g(p,h){if(1&p&&(t.TgZ(0,"span",11),t._uU(1),t.ALo(2,"number"),t.qZA()),2&p){const m=t.oxw().$implicit,f=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,m[f.currencyUnitEnum.OTHER],f.currencyUnitFormats.OTHER)," ")}}function U(p,h){if(1&p&&(t.TgZ(0,"div",6)(1,"div",7),t._uU(2),t.YNc(3,y,2,1,"mat-icon",8),t.qZA(),t.YNc(4,x,3,3,"span",9),t.YNc(5,E,3,4,"span",9),t.YNc(6,g,3,4,"span",9),t.qZA()),2&p){const m=h.$implicit,f=t.oxw().$implicit,M=t.oxw();t.xp6(2),t.hij(" ",m.title," "),t.xp6(1),t.Q6J("ngIf",m.tooltip),t.xp6(1),t.Q6J("ngIf",f===M.currencyUnitEnum.SATS),t.xp6(1),t.Q6J("ngIf",f===M.currencyUnitEnum.BTC),t.xp6(1),t.Q6J("ngIf",M.fiatConversion&&f!==M.currencyUnitEnum.SATS&&f!==M.currencyUnitEnum.BTC&&""===M.conversionErrorMsg)}}function b(p,h){if(1&p&&(t.TgZ(0,"div",12)(1,"div",13),t._uU(2),t.qZA()()),2&p){const m=t.oxw(2);t.xp6(2),t.Oqu(m.conversionErrorMsg)}}function A(p,h){if(1&p&&(t.TgZ(0,"mat-tab",2)(1,"div",3),t.YNc(2,U,7,5,"div",4),t.qZA(),t.YNc(3,b,3,1,"div",5),t.qZA()),2&p){const m=h.$implicit,f=t.oxw();t.s9C("label",m),t.xp6(2),t.Q6J("ngForOf",f.values),t.xp6(1),t.Q6J("ngIf",f.fiatConversion&&m!==f.currencyUnitEnum.SATS&&m!==f.currencyUnitEnum.BTC&&""!==f.conversionErrorMsg)}}class V{constructor(h,m){this.commonService=h,this.store=m,this.values=[],this.currencyUnitEnum=C.NT,this.currencyUnitFormats=C.Xz,this.currencyUnits=[],this.fiatConversion=!1,this.conversionErrorMsg="",this.unSubs=[new a.x,new a.x,new a.x]}ngOnInit(){this.store.select(e.dT).pipe((0,T.R)(this.unSubs[0])).subscribe(h=>{this.fiatConversion=h.settings.fiatConversion,this.currencyUnits=h.settings.currencyUnits,this.fiatConversion||this.currencyUnits.splice(2,1),this.currencyUnits.length>1&&this.values[0]&&this.values[0].dataValue>=0&&this.getCurrencyValues(this.values)})}ngOnChanges(){this.currencyUnits.length>1&&this.values[0]&&this.values[0].dataValue>=0&&this.getCurrencyValues(this.values)}getCurrencyValues(h){h.forEach(m=>{m.dataValue>0?(this.commonService.convertCurrency(m.dataValue,C.NT.SATS,C.NT.BTC,"",!0).pipe((0,T.R)(this.unSubs[1])).subscribe(f=>{m[C.NT.BTC]=f.BTC}),this.commonService.convertCurrency(m.dataValue,C.NT.SATS,C.NT.OTHER,this.currencyUnits[2],this.fiatConversion).pipe((0,T.R)(this.unSubs[2])).subscribe({next:f=>{m[C.NT.OTHER]=f.OTHER},error:f=>{this.conversionErrorMsg="Conversion Error: "+f}})):(m[C.NT.BTC]=m.dataValue,""===this.conversionErrorMsg&&(m[C.NT.OTHER]=m.dataValue))})}ngOnDestroy(){this.unSubs.forEach(h=>{h.next(null),h.complete()})}}V.\u0275fac=function(h){return new(h||V)(t.Y36(S.v),t.Y36(D.yh))},V.\u0275cmp=t.Xpm({type:V,selectors:[["rtl-currency-unit-converter"]],inputs:{values:"values"},features:[t.TTD],decls:2,vars:1,consts:[["mat-stretch-tabs","false","mat-align-tabs","start"],[3,"label",4,"ngFor","ngForOf"],[3,"label"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start"],["fxLayout","column","fxLayoutAlign","center start","class","cc-data-block",4,"ngFor","ngForOf"],["fxLayout","row","fxFlex","100","class","p-1 error-border mt-1",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center start",1,"cc-data-block"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start",1,"cc-data-title"],["matTooltipPosition","below","class","info-icon",3,"matTooltip",4,"ngIf"],["class","cc-data-value",4,"ngIf"],["matTooltipPosition","below",1,"info-icon",3,"matTooltip"],[1,