1"use strict";(self.webpackChunkwhois=self.webpackChunkwhois||[]).push([[644],{1963:(L,p,i)=>{i.r(p),i.d(p,{BalanceModule:()=>R});var u=i(9808),l=i(3075),r=i(7972),s=i(9103),d=i(8202),g=i(8642),f=i(325),_=i(655),e=i(5e3),A=i(5830),h=i(5800);const E=["refillForm"],v=["paytrailForm"];function m(n,o){1&n&&(e.TgZ(0,"nb-alert",20),e._UZ(1,"nb-icon",21),e._uU(2),e.ALo(3,"translate"),e.qZA()),2&n&&(e.xp6(2),e.hij(" ",e.lcZ(3,1,"PAGES.BALANCE.REFILL_SUCCESS")," "))}function M(n,o){1&n&&(e.TgZ(0,"nb-alert",22),e._UZ(1,"nb-icon",23),e._uU(2),e.ALo(3,"translate"),e.qZA()),2&n&&(e.xp6(2),e.hij(" ",e.lcZ(3,1,"PAGES.BALANCE.REFILL_PAYMENT_FAILED")," "))}function b(n,o){1&n&&(e.TgZ(0,"nb-alert",22),e._UZ(1,"nb-icon",23),e._uU(2),e.ALo(3,"translate"),e.qZA()),2&n&&(e.xp6(2),e.hij(" ",e.lcZ(3,1,"PAGES.BALANCE.NEGATIVE_BALANCE_WARNING")," "))}function C(n,o){if(1&n&&(e.TgZ(0,"nb-alert",24),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Oqu(e.lcZ(2,1,"SERVER_ERRORS."+t.error))}}function y(n,o){1&n&&(e.ynx(0),e._uU(1),e.ALo(2,"translate"),e.BQk()),2&n&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"PAGES.BALANCE.REFILL.AMOUNT.REQUIRED")))}function I(n,o){1&n&&(e.ynx(0),e._uU(1),e.ALo(2,"translate"),e.BQk()),2&n&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"PAGES.BALANCE.REFILL.AMOUNT.PATTERN")))}function T(n,o){if(1&n&&(e.TgZ(0,"span",25),e.YNc(1,y,3,3,"ng-container",26),e.YNc(2,I,3,3,"ng-container",26),e.qZA()),2&n){const t=e.oxw(),a=e.MAs(28);e.ekj("animate__animated",t.refillAttempted)("animate__headShake",t.refillAttempted),e.xp6(1),e.Q6J("ngIf",null==a.errors?null:a.errors.required),e.xp6(1),e.Q6J("ngIf",null==a.errors?null:a.errors.pattern)}}function Z(n,o){if(1&n&&e._UZ(0,"input",30),2&n){const t=o.$implicit;e.Q6J("name",t.name)("value",t.value)}}function N(n,o){if(1&n&&(e.TgZ(0,"form",27,28),e.YNc(2,Z,1,2,"input",29),e.qZA()),2&n){const t=e.oxw();e.Q6J("action",t.paytrailApiUrl,e.LSH),e.xp6(2),e.Q6J("ngForOf",t.paytrailFields)}}const P=function(n){return{prefix:"",suffix:"\u20ac ",inputMode:n,precision:0,thousands:" ",decimal:","}},O=[{path:"",component:(()=>{class n{constructor(t,a,c,B,S){this.api=t,this.toastrService=a,this.activatedRoute=c,this.router=B,this.translate=S,this.loadingBalance=!1,this.refillAttempted=!1,this.error=null,this.currencyMaskInputMode=d.fF.FINANCIAL}ngOnInit(){this.loadBalance(),this.queryParamsSubscription=this.activatedRoute.queryParams.subscribe(t=>(0,_.mG)(this,void 0,void 0,function*(){if(t&&t.refillAttempted){if(t.transactionId)try{(yield this.api.instance.service("transactions").get(t.transactionId))&&(this.refillSucceeded=!0)}catch(a){this.refillSucceeded=!1}else this.refillSucceeded=!1;setTimeout(()=>{this.router.navigate(["billing/balance"],{replaceUrl:!0})})}}))}ngOnDestroy(){this.queryParamsSubscription&&this.queryParamsSubscription.unsubscribe()}loadBalance(){return(0,_.mG)(this,void 0,void 0,function*(){this.loadingBalance=!0;try{this.registrar=yield this.api.instance.service("registrars").get((yield this.api.instance.registrar).id),this.balance=this.registrar.balance,this.locale="sv"===this.registrar.language?"sv_SE":"en_US",this.isBalanceNegative&&(this.amount=this.debt<this.minAmount?this.minAmount.toString():this.debt.toString()),this.loadingBalance=!1}catch(t){console.error(t)}})}get debt(){return this.isBalanceNegative?-1*Math.ceil(parseFloat(this.balance)):0}get isBalanceNegative(){return this.balance&&parseFloat(this.balance)<0}get minAmount(){return Math.max(this.debt,20)}get amountTooLow(){return parseFloat(this.amount)<this.minAmount}doRefill(){return(0,_.mG)(this,void 0,void 0,function*(){if(!this.refillLoading)if(this.refillForm.valid){this.refillLoading=!0,this.refillAttempted=!1,this.error=null;try{const t=yield this.api.instance.service("refill").create({amount:this.amount});window.location.href=t}catch(t){console.error(t),this.error=t.message?t.message:yield this.translate.get("PAGES.BALANCE.REFILL_ERROR").toPromise(),this.refillAttempted=!0,this.refillLoading=!1}}else this.refillAttempted=!0})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(A.s),e.Y36(r.quB),e.Y36(f.gz),e.Y36(f.F0),e.Y36(s.sK))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-balance"]],viewQuery:function(t,a){if(1&t&&(e.Gf(E,5),e.Gf(v,5)),2&t){let c;e.iGM(c=e.CRH())&&(a.refillForm=c.first),e.iGM(c=e.CRH())&&(a.paytrailForm=c.first)}},decls:36,vars:37,consts:[[1,"inner"],[1,"animate__animated","animate__fadeIn"],["status","success","class","alert--with-icon",4,"ngIf"],["status","danger","class","alert--with-icon",4,"ngIf"],[1,"balance"],[3,"loading","balance","isBalanceNegative","showRefill"],[1,"refill"],[3,"submit","keyup.enter"],["refillForm","ngForm"],["status","info",1,"alert--with-icon"],["icon","info-outline"],[1,"min-amount"],["status","danger",4,"ngIf"],[1,"refill-form__amount-input-wrapper"],["id","amount","name","AMOUNT","nbInput","","fieldSize","medium","fullWidth","","required","","currencyMask","","placeholder","100\u20ac","required","",3,"ngModel","disabled","status","options","ngModelChange"],["amountInput","ngModel"],["type","submit","nbSuffix","","nbButton","","status","primary","size","medium",3,"disabled","nbSpinner"],["icon","credit-card-outline"],["class","form__error-message",3,"animate__animated","animate__headShake",4,"ngIf"],["method","post",3,"action",4,"ngIf"],["status","success",1,"alert--with-icon"],["icon","checkmark-circle-outline"],["status","danger",1,"alert--with-icon"],["icon","alert-triangle-outline"],["status","danger"],[1,"form__error-message"],[4,"ngIf"],["method","post",3,"action"],["paytrailForm",""],["type","hidden",3,"name","value",4,"ngFor","ngForOf"],["type","hidden",3,"name","value"]],template:function(t,a){if(1&t&&(e.TgZ(0,"div",0)(1,"h1"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.TgZ(4,"div",1),e.YNc(5,m,4,3,"nb-alert",2),e.YNc(6,M,4,3,"nb-alert",3),e.YNc(7,b,4,3,"nb-alert",3),e.TgZ(8,"div",4),e._UZ(9,"app-balance-card",5),e.TgZ(10,"nb-card",6)(11,"nb-card-header")(12,"h2"),e._uU(13),e.ALo(14,"translate"),e.qZA()(),e.TgZ(15,"nb-card-body")(16,"form",7,8),e.NdJ("submit",function(){return a.doRefill()})("keyup.enter",function(){return a.doRefill()}),e.TgZ(18,"nb-alert",9),e._UZ(19,"nb-icon",10),e._uU(20),e.ALo(21,"translate"),e.TgZ(22,"span",11),e._uU(23),e.ALo(24,"currency"),e.qZA()(),e.YNc(25,C,3,3,"nb-alert",12),e.TgZ(26,"div",13)(27,"input",14,15),e.NdJ("ngModelChange",function(B){return a.amount=B}),e.qZA(),e.TgZ(29,"button",16),e._UZ(30,"nb-icon",17),e.TgZ(31,"span"),e._uU(32),e.ALo(33,"translate"),e.qZA()()(),e.YNc(34,T,3,6,"span",18),e.qZA(),e.YNc(35,N,3,2,"form",19),e.qZA()()()()()),2&t){const c=e.MAs(28);
1e.xp6(2),e.Oqu(e.lcZ(3,25,"PAGES.BALANCE.HEADING")),e.xp6(3),e.Q6J("ngIf",!0===a.refillSucceeded),e.xp6(1),e.Q6J("ngIf",!1===a.refillSucceeded),e.xp6(1),e.Q6J("ngIf",a.isBalanceNegative),e.xp6(2),e.Q6J("loading",a.loadingBalance)("balance",a.balance)("isBalanceNegative",a.isBalanceNegative)("showRefill",!1),e.xp6(4),e.Oqu(e.lcZ(14,27,"PAGES.BALANCE.REFILL.HEADING")),e.xp6(7),e.hij(" ",e.lcZ(21,29,"PAGES.BALANCE.REFILL.MINIMUM_AMOUNT"),": "),e.xp6(3),e.Oqu(e.lcZ(24,31,a.minAmount)),e.xp6(2),e.Q6J("ngIf",a.error),e.xp6(2),e.Q6J("ngModel",a.amount)("disabled",a.refillLoading)("status",a.refillAttempted&&(c.invalid||a.error)?"danger":"basic")("options",e.VKq(35,P,a.currencyMaskInputMode)),e.xp6(2),e.Q6J("disabled",a.refillLoading||a.amountTooLow)("nbSpinner",a.refillLoading),e.xp6(1),e.Udp("visibility",a.refillLoading?"hidden":"visible"),e.xp6(1),e.Udp("visibility",a.refillLoading?"hidden":"visible"),e.xp6(1),e.Oqu(e.lcZ(33,33,"PAGES.BALANCE.REFILL.SUBMIT")),e.xp6(2),e.Q6J("ngIf",c.invalid&&a.refillAttempted),e.xp6(1),e.Q6J("ngIf",a.paytrailFields&&a.paytrailApiUrl)}},directives:[u.O5,r.$9b,r.fMN,h.a,r.Asz,r.ndF,r.yKW,l._Y,l.JL,l.F,r.h8i,l.Fj,l.Q7,d.g1,l.JJ,l.On,r.DPz,r.Q7R,u.sg],pipes:[s.X$,u.H9],styles:[".refill-form__amount-input-wrapper[_ngcontent-%COMP%]{display:flex;justify-content:space-between;flex-wrap:nowrap}.refill-form__amount-input-wrapper[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex-grow:1;margin-right:1rem}.min-amount[_ngcontent-%COMP%]{margin-left:.5rem;font-weight:700}@media (min-width: 992px){.balance[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;grid-gap:1rem}}"]}),n})()}];let U=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[[f.Bz.forChild(O)],f.Bz]}),n})(),R=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}
1),n.\u0275inj=e.cJS({imports:[[u.ez,U,g.c,l.u5,r.T2N,r.KdK,r.PYG,r.uuI,r.nKr,r.zyh,d.Ud,s.aw.forChild()]]}),n})()},5503:(L,p,i)=>{i.d(p,{D:()=>r});var u=i(9808),l=i(5e3);let r=(()=>{class s{}return s.\u0275fac=function(g){return new(g||s)},s.\u0275mod=l.oAB({type:s}),s.\u0275inj=l.cJS({imports:[[u.ez]]}),s})()},5830:(L,p,i)=>{i.d(p,{s:()=>_});var u=i(325),l=i(1086),r=i(2198),s=i(4850),d=i(5e3),g=i(9822),f=i(7948);let _=(()=>{class e{constructor(h,E,v){this.router=h,this.registrarApi=E,this.adminApi=v,this.router.events.pipe((0,r.h)(m=>m instanceof u.jw&&Object.keys(m.snapshot.data).length>0),(0,s.U)(m=>m instanceof u.jw?m.snapshot.data:{})).subscribe(m=>{this.isAdmin=m.admin})}get onModeChanged(){return(0,l.of)(this.isAdmin)}get instance(){return this.isAdmin?this.adminApi:this.registrarApi}}return e.\u0275fac=function(h){return new(h||e)(d.LFG(u.F0),d.LFG(g.D),d.LFG(f.o))},e.\u0275prov=d.Yz7({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.