PageSourceSearch

https://www.iconomi.com/chunk-RLUTX4Y2.js

js iconomi.com collected 2026-09-24 11:22:37 UTC 115,460 bytes, 7 lines download raw bytes

1import{a as Gt}from"./chunk-DHKY6DK2.js";import{b as ci,d as mi,e as pt,f as rt}from"./chunk-KWO5TZMO.js";import{a as Ei}from"./chunk-MPANLVAK.js";import{a as ri}from"./chunk-CIZPWRPU.js";import{a as Ii}from"./chunk-YVS4NOHK.js";import{a as le}from"./chunk-TKAN2FQQ.js";import{a as Ti,b as di}from"./chunk-4MWIOJVL.js";import{c as li}from"./chunk-WRKMTCPV.js";import{a as Bi}from"./chunk-RH3HVNH7.js";import{a as U}from"./chunk-X4RY445A.js";import{a as ue,h as Xe,i as _i,j as nt,k as ot,q as si,r as Ce}from"./chunk-OGVHPPP6.js";import"./chunk-PWD6IXQT.js";import{c as ai}from"./chunk-DL3LDHG2.js";import{F as oi,h as ge,i as Se,j as ii,nd as K,v as ni}from"./chunk-7RDSPWDS.js";import{A as xe,B as we,J as fe,K as qe,N as ti,P as Rt,Q as Z,e as N,h as ae,i as q,k as ei,o as J,r as Nt,s as ee,t as Ae,y as Pe,z as Oe}from"./chunk-T2PQV3GQ.js";import{f as y,g as $}from"./chunk-6ZPKWQR6.js";import{T as ut,U as W,V as re,X as _e,e as Kt,g as j,n as Qt,p as Jt,u as me}from"./chunk-BYJZ5R2X.js";import{Ac as z,Ad as ce,Bd as Ve,Ca as Be,Cd as it,Eb as St,Ec as Ie,Fc as Ee,Gc as B,Hc as jt,I as Vt,Ia as M,Ic as Mt,Id as Zt,Ja as L,Jc as Lt,K as k,Kc as dt,Lb as m,Lc as p,Na as Ht,Nc as c,Qb as F,Rb as et,Rc as He,Sc as je,Tb as tt,Tc as We,W as x,Xc as Ft,ad as A,bd as Ke,c as kt,cd as G,da as Ct,ic as S,jc as u,ka as zt,kc as pe,ma as ct,mc as te,nc as ie,oa as mt,oc as E,pc as _,qa as Ut,qc as r,rc as I,s as Et,sb as ne,sd as Y,td as Wt,ud as qt,vc as $e,wc as De,xa as Yt,y as ve,ya as Je,zb as l}from"./chunk-FR74WXOQ.js";import{a as se,b as Ue,c as Ye}from"./chunk-2WMK2XH7.js";var Si=(()=>{let o=class o{};o.ɵfac=function(t){return new(t||o)();},o.ɵcmp=F({type:o,selectors:[["app-b2b"]],standalone:!1,decls:1,vars:0,template:function(t,e){t&1&&I(0,"router-outlet");},dependencies:[ut],encapsulation:2});let i=o;return i;})();var ht=class{},bt=(()=>{let o=class o{constructor(){this.defaultCSVParserConfig={header:!0,delimiter:",",encoding:"utf8"};}parse(n,t){return t=se(se({},this.defaultCSVParserConfig),t),new kt(a=>{try{let T=null;if(this.isCSVFile(n)){let d=new FileReader();d.readAsText(n,t.encoding),d.onload=()=>{let R=d.result.trim();if(R){let O=this.csvStringToArray(R,t.delimiter),f=this.getHeaderArray(O);T=this.getDataRecordsArrayFromCSVFile(O,f.length,t),a.next(T);}else a.next([]);a.complete();},d.onerror=()=>{this.badCSVDataFormatErrorHandler(a);};}else this.notCSVFileErrorHandler(a);}catch{this.unknownCSVParserErrorHandler(a);}});}csvStringToArray(n,t){let e=new RegExp(`(\\${t}|\\r?\\n|\\r|^)(?:"((?:\\\\.|""|[^\\\\"])*)"|([^\\${t}"\\r\\n]*))`,"gi"),a=e.exec(n),T=[[]];for(;a;){a[1].length&&a[1]!==t&&T.push([]);let d=a[2]?a[2].replace(new RegExp('[\\\\"](.)',"g"),"$1"):a[3];T[T.length-1].push(d),a=e.exec(n);}return T;}getDataRecordsArrayFromCSVFile(n,t,e){let a=[],T=n[0],d=e.header?1:0;for(let R=d;R<n.length;R++){let O=n[R];if(O.length===t&&e.header){let f={};for(let g=0;g<O.length;g++)O[g]===void 0||O[g]===null?f[T[g]]="":f[T[g]]=O[g].trim();a.push(f);}else a.push(O);}return a;}isCSVFile(n){return n.name.toLowerCase().endsWith(".csv");}getHeaderArray(n){let t=n[0],e=[];for(let a of t)e.push(a);return e;}notCSVFileErrorHandler(n){let t=this.errorBuilder("NOT_A_CSV_FILE","Selected file is not a csv File Type.",2);n.error(t);}unknownCSVParserErrorHandler(n){let t=this.errorBuilder("UNKNOWN_ERROR","Unknown error. Please refer to official documentation for library usage.",404);n.error(t);}badCSVDataFormatErrorHandler(n){let t=this.errorBuilder("BAD_CSV_DATA_FORMAT","Unable to parse CSV File.",1);n.error(t);}errorBuilder(n,t,e){let a=new ht();return a.type=n,a.message=t,a.code=e,a;}};o.ɵfac=function(t){return new(t||o)();},o.ɵprov=Yt({token:o,factory:o.ɵfac,providedIn:"root"});let i=o;return i;})();var ui=(()=>{let o=class o{};o.ɵfac=function(t){return new(t||o)();},o.ɵmod=et({type:o}),o.ɵinj=Je({providers:[bt]});let i=o;return i;})();var Ni=(()=>{let o=class o{constructor(n,t){this.ngbActiveModal=n,this.formBuilder=t,this.headerSelected=new St(),this.form=this.formBuilder.group({header:null});}init(){this.form.get("header").setValue(this.headers[0]);}submit(){this.headerSelected.emit(this.form.get("header").value),this.ngbActiveModal.close();}};o.ɵfac=function(t){return new(t||o)(m(fe),m(Oe));},o.ɵcmp=F({type:o,selectors:[["app-b2b-upload-csvemails-modal"]],inputs:{headers:"headers"},outputs:{headerSelected:"headerSelected"},standalone:!1,decls:11,vars:2,consts:()=>{let n;n="Select column with emails";let t;t="Upload email list with CSV";let e;e="Close";let a;return a="Upload",[t,e,a,[1,"h5-black"],[1,"d-flex","flex-column",3,"ngSubmit"],["titleLabel",n,3,"items","ngControl"],[1,"d-flex","mt-40"],["type","button",1,"btn","btn-outline-primary","w-50","btn-lg","me-15",3,"click"],[1,"btn","btn-primary","w-50","btn-lg"]];},template:function(t,e){t&1&&(_(0,"app-modal-header")(1,"h5",3),B(2,0),r()(),_(3,"app-modal-body")(4,"form",4),p("ngSubmit",function(){return e.submit();}),I(5,"app-select-box",5),_(6,"div",6)(7,"button",7),p("click",function(){return e.ngbActiveModal.close();}),B(8,1),r(),_(9,"button",8),B(10,2),r()()()()),t&2&&(l(5),E("items",e.headers)("ngControl",e.form.get("header")));},dependencies:[Xe,J,q,ei,ge,Se],encapsulation:2});let i=o;return i;})();var Ne=class{static formatBool(o,s){return s?o?"Yes":"No":"N/A";}static formatBoolHtml(o,s){return s?o?'<div class="performance-small-positive">Yes</div>':'<div class="performance-small-negative">No</div>':"<div>N/A</div>";}static formatBalanceRange(o){switch(o){case"NOT_AVAILABLE":return"ZERO";case"RANGE_ZERO":return"0";case"RANGE_LESS_THAN_1K":return"< 1k";case"RANGE_1K_TO_10K":return"< 10k";case"RANGE_10K_TO_50K":return"< 50k";case"RANGE_50K_TO_100K":return"< 100k";case"RANGE_ABOVE_100K":return"> 100k";default:return"";}}};function Zi(i,o){i&1&&(_(0,"span",4),A(1,"(gift card)"),r());}function Ki(i,o){if(i&1&&(_(0,"span",4),A(1),r()),i&2){let s=c();l(),G("(",s.details.daaTicker,")");}}function Qi(i,o){if(i&1&&(_(0,"tr")(1,"td"),A(2,"Label:"),r(),_(3,"td"),A(4),r()()),i&2){let s=c();l(4),Ke(s.details.referralCodeLabel);}}function Ji(i,o){if(i&1&&I(0,"div",5),i&2){let s=c();E("innerHtml",s.formatDateOrBlank(s.details.referralConsumedAt),ne);}}function en(i,o){if(i&1&&I(0,"div",5),i&2){let s=c();E("innerHtml",s.formatDateOrBlank(s.details.userVerifiedAt),ne);}}function tn(i,o){if(i&1&&(_(0,"tr")(1,"td"),A(2,"Last deposit:"),r(),_(3,"td"),I(4,"div",5),r()()),i&2){let s=c();l(4),E("innerHtml",s.formatDateOrBlank(s.details.userDetails.lastDepositTime),ne);}}function nn(i,o){if(i&1&&(_(0,"tr")(1,"td"),A(2,"Last crypto buy:"),r(),_(3,"td"),I(4,"div",5),r()()),i&2){let s=c();l(4),E("innerHtml",s.formatDateOrBlank(s.details.userDetails.lastCryptoBuyTime),ne);}}function on(i,o){if(i&1&&(_(0,"tr")(1,"td"),A(2,"Currently copying your strategy:"),r(),_(3,"td"),I(4,"div",5),r()()),i&2){let s=c();l(4),E("innerHtml",s.formatBoolHtml(s.details.userDetails.currentlyCopyingAnyReferrerDaa,!0),ne);}}function rn(i,o){if(i&1&&(_(0,"tr")(1,"td"),A(2,"Last copy of your strategy:"),r(),_(3,"td"),I(4,"div",5),r()()),i&2){let s=c();l(4),E("innerHtml",s.formatDateOrBlank(s.details.userDetails.lastReferrerDaaCopyTime),ne);}}function _n(i,o){if(i&1&&(_(0,"tr")(1,"td"),A(2,"Currently copying other strategy:"),r(),_(3,"td"),I(4,"div",5),r()()),i&2){let s=c();l(4),E("innerHtml",s.formatBoolHtml(s.details.userDetails.currentlyCopyingAnyOtherDaa,!0),ne);}}function an(i,o){if(i&1&&(_(0,"tr")(1,"td"),A(2,"Last copy of other strategy:"),r(),_(3,"td"),I(4,"div",5),r()()),i&2){let s=c();l(4),E("innerHtml",s.formatDateOrBlank(s.details.userDetails.lastOtherDaaCopyTime),ne);}}function sn(i,o){if(i&1&&(_(0,"tr")(1,"td"),A(2,"Balance range:"),r(),_(3,"td"),A(4),r()()),i&2){let s=c();l(4),Ke(s.formatBalanceRange(s.details.userDetails.balanceRange));}}function ln(i,o){if(i&1&&(_(0,"tr")(1,"td"),A(2,"Has fiat currency:"),r(),_(3,"td"),I(4,"div",5),r()()),i&2){let s=c();l(4),E("innerHtml",s.formatBoolHtml(s.details.userDetails.hasFiat,!0),ne);}}function Tn(i,o){if(i&1&&(_(0,"tr")(1,"td"),A(2,"Has stable coins:"),r(),_(3,"td"),I(4,"div",5),r()()),i&2){let s=c();l(4),E("innerHtml",s.formatBoolHtml(s.details.userDetails.hasStableCoins,!0),ne);}}function dn(i,o){if(i&1&&(_(0,"tr")(1,"td"),A(2,"Has crypto coins:"),r(),_(3,"td"),I(4,"div",5),r()()),i&2){let s=c();l(4),E("innerHtml",s.formatBoolHtml(s.details.userDetails.hasCryptoCoins,!0),ne);}}var Ri=(()=>{let o=class o{constructor(n,t){this.locale=n,this.ngbActiveModal=t,this.formatBoolHtml=Ne.formatBoolHtml,this.formatBalanceRange=Ne.formatBalanceRange;}formatDateOrBlank(n){return n?Kt(n,"medium",this.locale):"<div>N/A</div>";}};o.ɵfac=function(t){return new(t||o)(m(Zt),m(fe));}
1,o.ɵcmp=F({type:o,selectors:[["app-b2b-referral-info-details-modal"]],standalone:!1,decls:50,vars:20,consts:()=>{let n;return n="Details",[n,[1,"h5-black"],[3,"height"],[1,"d-none","d-lg-table"],[1,"ms-5","paragraph-gray-900-regular"],[3,"innerHtml"]];},template:function(t,e){t&1&&(_(0,"app-modal-header")(1,"h5",1),B(2,0),r()(),_(3,"app-modal-body",2)(4,"div")(5,"table",3)(6,"tbody")(7,"tr")(8,"td"),A(9,"Referral code:"),r(),_(10,"td"),A(11),S(12,Zi,2,0,"span",4),S(13,Ki,2,1,"span",4),r()(),S(14,Qi,5,1,"tr"),_(15,"tr")(16,"td"),A(17,"User email:"),r(),_(18,"td"),A(19),r()(),_(20,"tr")(21,"td"),A(22,"User handle:"),r(),_(23,"td"),A(24),r()(),_(25,"tr")(26,"td"),A(27,"User registered:"),r(),_(28,"td"),S(29,Ji,1,1,"div",5),r()(),_(30,"tr")(31,"td"),A(32,"User verified:"),r(),_(33,"td"),S(34,en,1,1,"div",5),r()(),_(35,"tr")(36,"td"),A(37,"User consent:"),r(),_(38,"td"),I(39,"div",5),r()(),S(40,tn,5,1,"tr"),S(41,nn,5,1,"tr"),S(42,on,5,1,"tr"),S(43,rn,5,1,"tr"),S(44,_n,5,1,"tr"),S(45,an,5,1,"tr"),S(46,sn,5,1,"tr"),S(47,ln,5,1,"tr"),S(48,Tn,5,1,"tr"),S(49,dn,5,1,"tr"),r()()()()),t&2&&(l(3),E("height",768),l(8),G("",e.details.referralCode," "),l(),u(e.details.referralCodeType==="GIFT_CARD"?12:-1),l(),u(e.details.referralCodeType==="DAA"?13:-1),l(),u(e.details.referralCodeType==="INVITE"?14:-1),l(5),Ke(e.details.userEmail),l(5),Ke(e.details.userHandle),l(5),u(e.details.referralConsumedAt?29:-1),l(5),u(e.details.userDataConsent?34:-1),l(5),E("innerHtml",e.formatBoolHtml(e.details.userDataConsent,!0),ne),l(),u(e.details.userDataConsent?40:-1),l(),u(e.details.userDataConsent?41:-1),l(),u(e.details.userDataConsent?42:-1),l(),u(e.details.userDataConsent?43:-1),l(),u(e.details.userDataConsent?44:-1),l(),u(e.details.userDataConsent?45:-1),l(),u(e.details.userDataConsent?46:-1),l(),u(e.details.userDataConsent?47:-1),l(),u(e.details.userDataConsent?48:-1),l(),u(e.details.userDataConsent?49:-1));},dependencies:[ge,Se],encapsulation:2});let i=o;return i;})();var Bn=["fileInput"],pi=i=>({"btn-loading":i}),In=(i,o)=>o.referralCode;function En(i,o){if(i&1){let s=z();_(0,"div",20)(1,"h5",21),B(2,5),r(),_(3,"form",22),p("ngSubmit",function(){M(s);let t=c();return L(t.downloadPendingFees());}),_(4,"div",23)(5,"button",27),B(6,6),r()(),_(7,"div",28),I(8,"app-textarea",39),_(9,"i",40),p("click",function(){M(s);let t=Ft(11);return L(t.click());}),r(),_(10,"input",31,1),p("change",function(t){M(s);let e=c();return L(e.readFile(t,e.pendingFeesForm));}),r()()()();}if(i&2){let s=c();l(3),E("formGroup",s.pendingFeesForm),l(2),E("disabled",s.pendingFeesDownloadInProgress)("ngClass",Y(4,pi,s.pendingFeesDownloadInProgress)),l(3),E("errorMessages",s.emailValidationMessages);}}function cn(i,o){if(i&1){let s=z();_(0,"button",41),p("click",function(t){M(s);let e=c();return L(e.generateCsv(t,e.referralData));}),B(1,7),r();}}function mn(i,o){i&1&&(_(0,"div",36)(1,"div",42),B(2,8),r()());}function Sn(i,o){i&1&&(_(0,"div",36),I(1,"div",43),r());}function un(i,o){i&1&&(_(0,"div",37),B(1,9),r());}function Nn(i,o){i&1&&(_(0,"span",46),A(1,"(gift card)"),r());}function Rn(i,o){if(i&1&&(_(0,"span",46),A(1),r()),i&2){let s=c().$implicit;l(),G("(",s.daaTicker,")");}}function pn(i,o){if(i&1&&(_(0,"div"),A(1),r()),i&2){let s=c().$implicit;l(),Ke(s.referralCodeLabel);}}function An(i,o){if(i&1&&I(0,"div",47),i&2){let s=c().$implicit,n=c(2);E("innerHtml",n.formatBoolHtml(s.userVerifiedAt>0,s.userDataConsent),ne);}}function On(i,o){if(i&1&&I(0,"div",47),i&2){let s=c().$implicit,n=c(2);E("innerHtml",n.formatBoolHtml(s.userDetails.lastDepositTime>0,s.userDataConsent),ne);}}function fn(i,o){if(i&1&&I(0,"div",47),i&2){let s=c().$implicit,n=c(2);E("innerHtml",n.formatBoolHtml(s.userDetails.lastReferrerDaaCopyTime>0||s.userDetails.lastOtherDaaCopyTime>0||s.userDetails.lastCryptoBuyTime>0,s.userDataConsent),ne);}}function gn(i,o){if(i&1){let s=z();_(0,"button",49),p("click",function(t){M(s);let e=c().$implicit,a=c(2);return L(a.openDetailsModal(t,e));}),B(1,17),r();}}function Cn(i,o){if(i&1&&(_(0,"tr")(1,"td"),A(2),ce(3,"date"),I(4,"br"),A(5),ce(6,"date"),r(),_(7,"td"),A(8),S(9,Nn,2,0,"span",46),S(10,Rn,2,1,"span",46),r(),_(11,"td"),S(12,pn,2,1,"div"),r(),_(13,"td"),A(14),r(),_(15,"td"),I(16,"div",47),r(),_(17,"td"),S(18,An,1,1,"div",47),r(),_(19,"td"),S(20,On,1,1,"div",47),r(),_(21,"td"),S(22,fn,1,1,"div",47),r(),_(23,"td"),S(24,gn,2,0,"button",48),r()()),i&2){let s=o.$implicit,n=c(2);l(2),G(" ",it(3,12,s.referralCreatedAt,"medium")," "),l(3),G(" ",it(6,15,s.referralConsumedAt,"medium")," "),l(3),G(" ",s.referralCode," "),l(),u(s.referralCodeType==="GIFT_CARD"?9:-1),l(),u(s.referralCodeType==="DAA"?10:-1),l(2),u(s.referralCodeType==="INVITE"?12:-1),l(2),G(" ",s.userEmail," "),l(2),E("innerHtml",n.formatBoolHtml(s.referralConsumedAt>0,!0),ne),l(2),u(s.userDetails?18:-1),l(2),u(s.userDetails?20:-1),l(2),u(s.userDetails?22:-1),l(2),u(s.referralConsumedAt>0?24:-1);}}function Mn(i,o){if(i&1&&(_(0,"table",38)(1,"thead")(2,"tr")(3,"th",44),B(4,10),r(),_(5,"th",45),A(6,"Referal code (origin) "),r(),_(7,"th",44),B(8,11),r(),_(9,"th",44),B(10,12),r(),_(11,"th",44),Ie(12,13),I(13,"br"),Ee(),r(),_(14,"th",44),Ie(15,14),I(16,"br"),Ee(),r(),_(17,"th",44),Ie(18,15),I(19,"br"),Ee(),r(),_(20,"th",44),Ie(21,16),I(22,"br"),Ee(),r(),I(23,"th"),r()(),_(24,"tbody"),te(25,Cn,25,18,"tr",null,In),r()()),i&2){let s=c();l(25),ie(s.referralData);}}var Ai=(()=>{let o=class o{constructor(n,t,e,a,T,d,R){this.formBuilder=n,this.toastrService=t,this.socketsService=e,this.store=a,this.ngxCsvParser=T,this.ngbModal=d,this.document=R,this.emailRegex=/^(([a-zA-Z0-9_\-.+]+)@([a-zA-Z0-9_\-.+]+)\.([a-zA-Z]{2,5}){1,25}(($)|(;+\s*$)|( *,+\s*$)|((;+\s*)|( *,+\s*)(?=[a-zA-Z0-9_\-.+]))))*$/,this.formatBoolHtml=Ne.formatBoolHtml,this.emailValidationMessages=[{validatorName:"pattern",message:"Invalid format. Please use valid emails and separate them with commas."}],this.years=[],this.months=[],this.monthsNames={0:"January",1:"February",2:"March",3:"April",4:"May",5:"June",6:"July",7:"August",8:"September",9:"October",10:"November",11:"December"},this.form=this.formBuilder.group({month:null,year:null,emails:null}),this.pendingFeesForm=this.formBuilder.group({emails:null}),this.yearSub=this.form.get("year").valueChanges.subscribe(f=>{if(f){let g=Array.from(this.monthsPerYear.get(f));this.months=g.map(C=>({name:this.monthsNames[C],month:C})),g.includes(this.form.get("month").value)||this.form.get("month").setValue(null);}}),this.b2bStoreSub=this.store.pipe($("b2b"),k(f=>f.reportsMinDateLoaded),x(1)).subscribe(f=>{let g=new Set(),C=new Date();this.monthsPerYear=new Map();let b=f.reportsMinDate?new Date(f.reportsMinDate):new Date();for(;b.getFullYear()<C.getFullYear()||b.getFullYear()===C.getFullYear()&&b.getMonth()<=C.getMonth();)g.add(b.getFullYear()),this.monthsPerYear.get(b.getFullYear())||this.monthsPerYear.set(b.getFullYear(),new Set()),this.monthsPerYear.get(b.getFullYear()).add(b.getMonth()),b.setMonth(b.getMonth()+1);this.years=Array.from(g),this.form.get("month").setValue(C.getMonth()),this.form.get("year").setValue(C.getFullYear());});let O={dataType:"corporate-get-referrals",payload:{}};this.socketsService.sendMessage(O,["corporate-get-referrals-result"]).subscribe(f=>{this.referralData=f["corporate-get-referrals-result"].payload.referralData.sort((g,C)=>{let b=!!g.referralConsumedAt,Q=!!C.referralConsumedAt;return!b&&!Q?C.referralCreatedAt-g.referralCreatedAt:b?Q?C.referralConsumedAt-g.referralConsumedAt:1:-1;});},()=>{this.toastrService.error("Something went wrong. Please try again.");});}onError(){this.toastrService.error("Something went wrong."),this.downloadInProgress=!1;}ngOnDestroy(){this.b2bStoreSub.unsubscribe(),this.yearSub.unsubscribe();}download(){if(this.form.get("month").setValidators(N.required),this.form.get("year").setValidators(N.required),this.form.get("emails").value?this.form.get("emails").setValidators(N.pattern(this.emailRegex)):this.form.get("emails").clearValidators(),U.validateAllFormFields(this.form),this.form.valid){this.downloadInProgress=!0;let n={dataType:"get-paid-out-fees",payload:{date:{year:this.form.get("year").value,month:this.form.get("month").value+1,day:1}}};if(this.form.get("emails").value){let e=this.form.get("emails").value.replace(/\s/g,"").replace(/;/g,",").split(",").filter(a=>a);n.payload.emails=e;}this.socketsService.sendMessage(n,"downloadable-result").subscribe(t=>{Gt(this.document,t["downloadable-result"].payload)||this.onError(),this.downloadInProgress=!1;},()=>{this.onError();});}}downloadPendingFees(){if(this.pendingFeesForm.get("emails").value?this.pendingFeesForm.get("emails").setValidators(N.pattern(this.emailRegex)):this.pendingFeesForm.get("emails").clearValidators(),U.validateAllFormFields(this.pendingFeesForm),this.pendingFeesForm.valid){this.pendingFeesDownloadInProgress=!0;let n={dataType:"get-pending-fees",payload:{}};if(this.pendingFeesForm.get("emails").value){let e=this.pendingFeesForm.get("emails").value.replace(/\s/g,"").replace(/;/g,",").split(",").filter(a=>a);n.payload.emails=e;}this.socketsService.sendMessage(n,"downloadable-result").subscribe(t=>{Gt(this.document,t["downloadable-result"].payload)||this.onError(),this.pendingFeesDownloadInProgress=!1;},()=>{this.onError();});}}readFile(n,t){if(n.target.files?.length){let e=n.target.files[0];if(e.type!=="text/csv"){this.toastrService.error("Only CSV format supported");return;}this.ngxCsvParser.parse(e,{header:!0,delimiter:","}).pipe(x(1)).subscribe(a=>{if(a.length){if(this.csvData=a,this.csvHeaders=Object.keys(a[0]),this.csvHeaders.length>1){let d=this.ngbModal.open(Ni,{size:"sm"}).componentInstance;d.headers=this.csvHeaders,d.init(),d.headerSelected.pipe(x(1)).subscribe(R=>{this.selectHeader(R,t);});}else this.selectHeader(this.csvHeaders[0],t);}else this.toastrService.error("Something went wrong while reading file.");},a=>{this.toastrService.error(a.message);});}}selectHeader(n,t){let e=this.csvData.map(a=>a[n].trim().replaceAll('"',""));t.get("emails").setValue(e.join(", "));}openDetailsModal(n,t){n.stopPropagation(),n.preventDefault();let a=this.ngbModal.open(Ri,{size:"lg"}).componentInstance;a.details=t;}generateCsv(n,t){t||this.toastrService.error("No data.");let e=`Created at,Referral code,Referral code type,Ticker,Label,User e-mail,User handle,User registered,User verified,User consent,Last deposit,Last crypto buy,Currently copying your strategy,Last copy of your strategy,Currently copying other strategy,Last copy of other strategy,Balance range,Has fiat currency,Has stable coins,Has crypto coins
2`;for(let T of t)e+=this.formatCsvEntry(le.dateToISODateTime(new Date(T.referralCreatedAt),!0))+this.formatCsvEntry(T.referralCode)+this.formatCsvEntry(this.mapReferralCodeType(T.referralCodeType))+this.formatCsvEntry(T.daaTicker?T.daaTicker:"")+this.formatCsvEntry(T.referralCodeType==="INVITE"?T.referralCodeLabel:"")+this.formatCsvEntry(T.userEmail?T.userEmail:"")+this.formatCsvEntry(T.userHandle?T.userHandle:"")+this.formatCsvEntry(T.referralConsumedAt?le.dateToISODateTime(new Date(T.referralConsumedAt),!0):"")+this.formatCsvEntry(T.userVerifiedAt&&T.userDataConsent?le.dateToISODateTime(new Date(T.userVerifiedAt),!0):"")+this.formatCsvEntry(Ne.formatBool(T.userDataConsent,!0)),T.userDataConsent?e+=this.formatCsvEntry(T.userDetails.lastDepositTime?le.dateToISODateTime(new Date(T.userDetails.lastDepositTime),!0):"")+this.formatCsvEntry(T.userDetails.lastCryptoBuyTime?le.dateToISODateTime(new Date(T.userDetails.lastCryptoBuyTime),!0):"")+this.formatCsvEntry(Ne.formatBool(T.userDetails.currentlyCopyingAnyReferrerDaa,T.userDataConsent))+this.formatCsvEntry(T.userDetails.lastReferrerDaaCopyTime?le.dateToISODateTime(new Date(T.userDetails.lastReferrerDaaCopyTime),!0):"")+this.formatCsvEntry(Ne.formatBool(T.userDetails.currentlyCopyingAnyOtherDaa,T.userDataConsent))+this.formatCsvEntry(T.userDetails.lastOtherDaaCopyTime?le.dateToISODateTime(new Date(T.userDetails.lastOtherDaaCopyTime),!0):"")+this.formatCsvEntry(Ne.formatBalanceRange(T.userDetails.balanceRange))+this.formatCsvEntry(Ne.formatBool(T.userDetails.hasFiat,T.userDataConsent))+this.formatCsvEntry(Ne.formatBool(T.userDetails.hasStableCoins,T.userDataConsent))+this.formatCsvEntry(Ne.formatBool(T.userDetails.hasCryptoCoins,T.userDataConsent)):e+=",,,,,,,,,",e+=`
3`;let a=document.createElement("a");a.href="data:text/csv;charset=utf-8,"+encodeURI(e),a.target="_blank",a.download="referral_report_"+le.dateToISODate(new Date(),!0)+".csv",a.click();}formatCsvEntry(n,t){return'"'+n+(t?'"':'",');}mapReferralCodeType(n){return n==="DAA"?"strategy":n==="GIFT_CARD"?"gift card":"invite";}};o.ɵfac=function(t){return new(t||o)(m(Oe),m(Z),m(K),m(y),m(bt),m(qe),m(Ht));}
3,o.ɵcmp=F({type:o,selectors:[["app-b2b-reports"]],viewQuery:function(t,e){if(t&1&&He(Bn,7),t&2){let a;je(a=We())&&(e.fileInput=a.first);}},standalone:!1,decls:29,vars:18,consts:()=>{let n;n="Select year";let t;t="Select month";let e;e="Enter one or multiple e-mails (optional) or upload CSV file with emails";let a;a="Upload CSV with emails. File must have a header row.";let T;T="Paid out fees";let d;d="Generate report (.csv)";let R;R="Referral information";let O;O="Enter one or multiple e-mails (optional) or upload CSV file with emails";let f;f="Upload CSV with emails. File must have a header row.";let g;g="Pending fees information";let C;C="Generate report (.csv)";let b;b="Generate report (.csv)";let Q;Q="Fetching data ...";let D;D="No data";let oe;oe="Created at / registered at";let w;w="Label";let Te;Te="User e-mail";let de;de="User "+"\uFFFD#13\uFFFD\uFFFD/#13\uFFFD"+"registered";let X;X="User "+"\uFFFD#16\uFFFD\uFFFD/#16\uFFFD"+"verified";let Me;Me="User "+"\uFFFD#19\uFFFD\uFFFD/#19\uFFFD"+"deposited";let Le;Le="User "+"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"+"invested";let Re;return Re="Details",[["fileInput",""],["fileInput2",""],T,d,R,g,C,b,Q,D,oe,w,Te,de,X,Me,Le,Re,[1,"row"],[1,"col-12"],[1,"card","mb-30"],[1,"h5-black","mb-40"],[3,"ngSubmit","formGroup"],[1,"d-flex","flex-column","flex-lg-row","mb-30"],[1,"mb-30","mb-lg-0","me-lg-30","select-wrapper"],["placeholder",n,3,"items","ngControl"],["placeholder",t,3,"bindLabel","bindValue","items","ngControl"],[1,"btn","btn-primary","btn-lg","btn-block","btn-md-auto",3,"disabled","ngClass"],[1,"textarea-wrapper","position-relative"],["id","emails","formControlName","emails","placeholder",e,3,"errorMessages"],["ngbTooltip",a,"triggers","click hover focus",1,"icon-upload","fs-20","color-primary-500","cursor-pointer","position-absolute","p-5",3,"click"],["type","file","accept","text/csv",1,"d-none",3,"change"],[1,"d-flex","flex-column","flex-lg-row","mb-lg-30"],[1,"h5-black","mb-20","mb-lg-0"],[2,"display","flex","justify-content","flex-end","width","100%","padding","0"],[1,"btn","btn-secondary","btn-lg","btn-block","btn-md-auto"],[1,"d-flex","justify-content-center","align-items-center"],[1,"paragraph-black-regular","text-center","mb-10"],["id","referralTable",1,"w-100","d-none","d-lg-table"],["id","emails2","formControlName","emails","placeholder",O,3,"errorMessages"],["ngbTooltip",f,"triggers","click hover focus",1,"icon-upload","fs-20","color-primary-500","cursor-pointer","position-absolute","p-5",3,"click"],[1,"btn","btn-secondary","btn-lg","btn-block","btn-md-auto",3,"click"],[1,"status-indicator","text-center","mb-10","paragraph-black-regular"],[1,"loader"],[1,"text-start"],["i8n","",1,"text-start"],[1,"ms-5","paragraph-gray-900-regular"],[3,"innerHtml"],[1,"btn","btn-secondary","btn-block","ps-10","pe-10"],[1,"btn","btn-secondary","btn-block","ps-10","pe-10",3,"click"]];},template:function(t,e){if(t&1){let a=z();_(0,"div",18)(1,"div",19)(2,"div",20)(3,"h5",21),B(4,2),r(),_(5,"form",22),p("ngSubmit",function(){return M(a),L(e.download());}),_(6,"div",23)(7,"div",24),I(8,"app-select-box",25),r(),_(9,"div",24),I(10,"app-select-box",26),r(),_(11,"button",27),B(12,3),r()(),_(13,"div",28),I(14,"app-textarea",29),_(15,"i",30),p("click",function(){M(a);let d=Ft(17);return L(d.click());}),r(),_(16,"input",31,0),p("change",function(d){return M(a),L(e.readFile(d,e.form));}),r()()()(),S(18,En,12,6,"div",20),_(19,"div",20)(20,"div",32)(21,"h5",33),B(22,4),r(),_(23,"div",34),S(24,cn,2,0,"button",35),r()(),S(25,mn,3,0,"div",36),S(26,Sn,2,0,"div",36),S(27,un,2,0,"div",37),S(28,Mn,27,0,"table",38),r()()();}t&2&&(l(5),E("formGroup",e.form),l(3),E("items",e.years)("ngControl",e.form.get("year")),l(2),E("bindLabel","name")("bindValue","month")("items",e.months)("ngControl",e.form.get("month")),l(),E("disabled",e.downloadInProgress)("ngClass",Y(16,pi,e.downloadInProgress)),l(3),E("errorMessages",e.emailValidationMessages),l(4),u(-1),l(6),u(e.referralData!=null&&e.referralData.length?24:-1),l(),u(e.referralData?-1:25),l(),u(e.referralData?-1:26),l(),u((e.referralData==null?null:e.referralData.length)===0?27:-1),l(),u(e.referralData!=null&&e.referralData.length?28:-1));},dependencies:[j,Xe,J,ae,q,ee,Ae,ti,si,Jt],styles:[`.select-wrapper[_ngcontent-%COMP%]{min-width:150px}.icon-upload[_ngcontent-%COMP%]{right:5px;top:120px}
4/*# sourceMappingURL=b2b-reports.component-QRNCL3AA.css.map */`]});let i=o;return i;})();var Ln=i=>({"btn-loading":i}),Oi=(()=>{let o=class o{constructor(n,t,e,a,T){this.ngbActiveModal=n,this.formBuilder=t,this.store=e,this.toastrService=a,this.socketsService=T,this.form=this.formBuilder.group({email:null});}addUser(){this.form.get("email").setValidators([N.required,N.email]),U.validateAllFormFields(this.form),this.form.valid&&(this.actionInProgress=!0,this.socketsService.sendMessage({dataType:"add-corporate-agent",payload:{agentEmail:this.form.get("email").value}},"corporate-agents-result").subscribe(n=>{this.store.dispatch(new pt(n["corporate-agents-result"].payload.corporateAgents)),this.toastrService.success("New agent added successfully"),this.ngbActiveModal.close();},n=>{this.actionInProgress=!1,this.toastrService.error(n?.data?.payload?.error??"Something went wrong.");}));}};o.ɵfac=function(t){return new(t||o)(m(fe),m(Oe),m(y),m(Z),m(K));},o.ɵcmp=F({type:o,selectors:[["app-b2b-team-add-agent-modal"]],standalone:!1,decls:11,vars:6,consts:()=>{let n;n="Enter email";let t;t="Email";let e;e="Add Team member";let a;a="Close";let T;return T=" Confirm",[e,a,T,[1,"h5-black"],[3,"ngSubmit","formGroup"],["id","email","type","email","formControlName","email","placeholder",n,"titleLabel",t],[1,"d-flex","mt-40"],["type","button",1,"btn","btn-outline-primary","btn-lg","w-50","me-30",3,"click","disabled"],[1,"btn","btn-primary","btn-lg","w-50",3,"disabled","ngClass"]];},template:function(t,e){t&1&&(_(0,"app-modal-header")(1,"h5",3),B(2,0),r()(),_(3,"app-modal-body")(4,"form",4),p("ngSubmit",function(){return e.addUser();}),I(5,"app-input-box",5),_(6,"div",6)(7,"button",7),p("click",function(){return e.ngbActiveModal.close();}),B(8,1),r(),_(9,"button",8),B(10,2),r()()()()),t&2&&(l(4),E("formGroup",e.form),l(3),E("disabled",e.actionInProgress),l(2),E("disabled",e.actionInProgress)("ngClass",Y(4,Ln,e.actionInProgress)));},dependencies:[j,ue,J,ae,q,ee,Ae,ge,Se],encapsulation:2});let i=o;return i;})();var Ot=(()=>{let o=class o{transform(n){return n==="ROLE_CORPORATE_ADMIN"?"Admin":n==="ROLE_CORPORATE_SALES_REP"?"Sales rep":n==="ROLE_CORPORATE_SALES_ONBOARD"?"Sales rep with register":n;}};o.ɵfac=function(t){return new(t||o)();},o.ɵpipe=tt({name:"b2bRole",type:o,pure:!0,standalone:!1});let i=o;return i;})();var Gn=i=>({"btn-loading":i});function hn(i,o){if(i&1&&I(0,"app-select-box",8),i&2){let s=c();E("items",s.roles)("ngControl",s.form.get("role"));}}var fi=(()=>{let o=class o{constructor(n,t,e,a,T){this.ngbActiveModal=n,this.formBuilder=t,this.toastrService=e,this.store=a,this.socketsService=T,this.roles=[],this.statuses=[];let d=new Ot();this.roles=[{label:d.transform("ROLE_CORPORATE_SALES_REP"),value:"ROLE_CORPORATE_SALES_REP"},{label:d.transform("ROLE_CORPORATE_SALES_ONBOARD"),value:"ROLE_CORPORATE_SALES_ONBOARD"}],this.form=this.formBuilder.group({role:null,status:null});}init(){["ACTIVE","INACTIVE"].includes(this.agent.status)?this.statuses=["ACTIVE","INACTIVE","CANCELLED"]:["PENDING"].includes(this.agent.status)&&(this.statuses=["CANCELLED","PENDING"]),this.form.reset({role:this.agent.roles,status:this.agent.status});}save(){if(this.agent.status!=="PENDING"&&this.form.get("role").setValidators(N.required),this.form.get("status").setValidators(N.required),U.validateAllFormFields(this.form),this.form.valid){let n={dataType:"update-corporate-agent",payload:{agentId:this.agent.i
4d,status:this.form.get("status").value}},t=this.form.get("role").value;t&&(n.payload.roles=[t]),this.socketsService.sendMessage(n,"corporate-agents-result").subscribe(e=>{this.store.dispatch(new pt(e["corporate-agents-result"].payload.corporateAgents)),this.toastrService.success("Agent successfully updated"),this.ngbActiveModal.close();},e=>{this.actionInProgress=!1,this.toastrService.error(e.message);});}}};o.ɵfac=function(t){return new(t||o)(m(fe),m(Oe),m(Z),m(y),m(K));},o.ɵcmp=F({type:o,selectors:[["app-b2b-team-edit-agent-modal"]],inputs:{agent:"agent"},standalone:!1,decls:17,vars:11,consts:()=>{let n;n="Select role";let t;t="Role";let e;e="Select status";let a;a="Status";let T;T="Edit team member";let d;d="Close";let R;return R="Save",[T,d,R,[1,"h5-black"],[3,"ngSubmit","formGroup"],[1,"paragraph-black-regular","mb-10"],[1,"paragraph-black-regular","mb-20"],[1,"mb-20"],["bindLabel","label","bindValue","value","placeholder",n,"titleLabel",t,3,"items","ngControl"],["placeholder",e,"titleLabel",a,3,"items","ngControl"],[1,"d-flex","mt-40"],["type","button",1,"btn","btn-outline-primary","btn-lg","w-50","me-30",3,"click","disabled"],[1,"btn","btn-primary","btn-lg","w-50",3,"disabled","ngClass"]];},template:function(t,e){t&1&&(_(0,"app-modal-header")(1,"h5",3),B(2,0),r()(),_(3,"app-modal-body")(4,"form",4),p("ngSubmit",function(){return e.save();}),_(5,"div",5),A(6),r(),_(7,"div",6),A(8),r(),_(9,"div",7),S(10,hn,1,2,"app-select-box",8),r(),I(11,"app-select-box",9),_(12,"div",10)(13,"button",11),p("click",function(){return e.ngbActiveModal.close();}),B(14,1),r(),_(15,"button",12),B(16,2),r()()()()),t&2&&(l(4),E("formGroup",e.form),l(2),G(" ",e.agent.name," "),l(2),G(" ",e.agent.email," "),l(2),u(e.agent.status!=="PENDING"?10:-1),l(),E("items",e.statuses)("ngControl",e.form.get("status")),l(2),E("disabled",e.actionInProgress),l(2),E("disabled",e.actionInProgress)("ngClass",Y(9,Gn,e.actionInProgress)));},dependencies:[j,Xe,J,q,ee,ge,Se],encapsulation:2});let i=o;return i;})();var bn=(i,o,s)=>({"tag-secondary":i,"tag-gray":o,"tag-warning":s}),gi=(()=>{let o=class o{};o.ɵfac=function(t){return new(t||o)();},o.ɵcmp=F({type:o,selectors:[["app-b2b-team-agent-status"]],inputs:{agent:"agent"},standalone:!1,decls:2,vars:6,consts:[[1,"tag",3,"ngClass"]],template:function(t,e){t&1&&(_(0,"div",0),A(1),r()),t&2&&(E("ngClass",qt(2,bn,e.agent.status==="ACTIVE",e.agent.status==="INACTIVE"||e.agent.status==="CANCELLED",e.agent.status==="PENDING")),l(),G(" ",e.agent.status,`
5`));},dependencies:[j],encapsulation:2});let i=o;return i;})();var Ci=(i,o)=>o.email;function vn(i,o){if(i&1){let s=z();_(0,"button",22),p("click",function(){M(s);let t=c().$implicit,e=c();return L(e.openEditAgentModal(t));}),B(1,6),r();}}function $n(i,o){if(i&1&&(_(0,"tr")(1,"td"),A(2),r(),_(3,"td"),A(4),r(),_(5,"td"),A(6),ce(7,"b2bRole"),r(),_(8,"td"),I(9,"app-b2b-team-agent-status",19),r(),_(10,"td",20),S(11,vn,2,0,"button",21),r()()),i&2){let s=o.$implicit;l(2),G(" ",s.name," "),l(2),G(" ",s.email," "),l(2),G(" ",Ve(7,5,s.role)," "),l(3),E("agent",s),l(2),u(s.canEdit?11:-1);}}function Dn(i,o){if(i&1){let s=z();_(0,"button",30),p("click",function(){M(s);let t=c().$implicit,e=c();return L(e.openEditAgentModal(t));}),B(1,7),r();}}function Pn(i,o){if(i&1&&(_(0,"div",18)(1,"div",23)(2,"div",24),A(3),r(),_(4,"div",25),A(5),ce(6,"b2bRole"),r()(),_(7,"div",26)(8,"div",27),A(9),r(),I(10,"app-b2b-team-agent-status",19),r(),S(11,Dn,2,0,"button",28),I(12,"div",29),r()),i&2){let s=o.$implicit;l(3),G(" ",s.name," "),l(2),G(" ",Ve(6,5,s.role)," "),l(4),G(" ",s.email," "),l(),E("agent",s),l(),u(s.canEdit?11:-1);}}var Mi=(()=>{let o=class o{constructor(n,t){this.store=n,this.ngbModal=t,this.agents=[],this.storeSub=this.store.pipe($("b2b"),k(e=>e.agentsLoaded)).subscribe(e=>{this.agents=e.agents;});}ngOnDestroy(){this.storeSub.unsubscribe();}openAddAgentModal(){this.ngbModal.open(Oi,{size:"sm"});}openEditAgentModal(n){let e=this.ngbModal.open(fi,{size:"sm"}).componentInstance;e.agent=n,e.init();}};o.ɵfac=function(t){return new(t||o)(m(y),m(qe));},o.ɵcmp=F({type:o,selectors:[["app-b2b-teams"]],standalone:!1,decls:27,vars:0,consts:()=>{let n;n="Your team";let t;t="+ Add member";let e;e="Member";let a;a="Email";let T;T="Role";let d;d="Status";let R;R="Edit";let O;return O="Edit",[n,t,e,a,T,d,R,O,[1,"row"],[1,"col-12"],[1,"card"],[1,"d-flex","flex-column","flex-md-row","align-items-md-center","justify-content-between","mb-40"],[1,"h5-black","me-10"],["type","button",1,"btn","btn-primary","btn-lg","btn-block","btn-sm-auto",3,"click"],[1,"d-none","d-md-table"],["align","left"],[1,"d-flex","flex-column","d-md-none"],[1,"separator-gray-100","mb-20"],[1,"d-flex","flex-column","align-items-start","mb-20"],[3,"agent"],["align","right"],["type","button",1,"btn","btn-outline-primary"],["type","button",1,"btn","btn-outline-primary",3,"click"],[1,"d-flex","justify-content-between","align-items-center","mb-10","w-100"],[1,"paragraph-black-bold","me-10"],[1,"paragraph-black-regular"],[1,"d-flex","justify-content-between","align-items-center","mb-20","w-100"],[1,"paragraph-black-regular","me-10","word-break-all"],["type","button",1,"btn","btn-outline-primary","btn-block","btn-sm-auto"],[1,"separator-gray-100","mt-20"],["type","button",1,"btn","btn-outline-primary","btn-block","btn-sm-auto",3,"click"]];},template:function(t,e){t&1&&(_(0,"div",8)(1,"div",9)(2,"div",10)(3,"div",11)(4,"h5",12),B(5,0),r(),_(6,"button",13),p("click",function(){return e.openAddAgentModal();}),B(7,1),r()(),_(8,"table",14)(9,"thead")(10,"tr")(11,"th",15),B(12,2),r(),_(13,"th",15),B(14,3),r(),_(15,"th",15),B(16,4),r(),_(17,"th",15),B(18,5),r(),I(19,"th"),r()(),_(20,"tbody"),te(21,$n,12,7,"tr",null,Ci),r()(),_(23,"div",16),I(24,"div",17),te(25,Pn,13,7,"div",18,Ci),r()()()()),t&2&&(l(21),ie(e.agents),l(4),ie(e.agents));},dependencies:[gi,Ot],encapsulation:2});let i=o;return i;})();var Li=(i,o)=>{let s=Be(y),n=Be(W);return s.pipe($("user"),k(t=>!t.loginIntoCorporateInProgress&&t.loaded),x(1),ve(t=>t.corporateLogin||t.businessAccount||o.url.startsWith("/business-account")&&t.roles.some(e=>e==="ROLE_CORPORATE")?!0:n.createUrlTree(["/"])));};var Fi=()=>{let i=Be(y);return i.dispatch(new ci()),i.pipe($("b2b"),k(o=>o.reportsMinDateLoaded),x(1),ve(()=>!0));};var Gi=()=>{let i=Be(y),o=Be(W);return i.pipe($("user"),k(s=>s.userDataLoaded),x(1),mt(s=>s.roles.includes("ROLE_CORPORATE_ADMIN")?(i.dispatch(new mi(s.selectedCorporate.corporateUniqueId)),i.pipe($("b2b"),k(n=>n.agentsLoaded),x(1),ve(()=>!0))):Et(o.createUrlTree(["/business-account"]))));};var Ze=()=>{let i=Be(y),o=Be(W);return i.dispatch(new rt()),i.pipe($("b2b"),k(s=>s.verificationLoaded),x(1),ve(s=>(s?.verificationState.verificationStatus==="VERIFIED"&&o.navigate(["/dashboard"]),s.verificationState.verificationStatus==="IN_PROCESS"?(
5o.navigate(["/business-account/registration"]),!1):!0)));};var hi=(()=>{let o=class o{};o.ɵfac=function(t){return new(t||o)();},o.ɵcmp=F({type:o,selectors:[["app-b2b-registration"]],decls:1,vars:0,template:function(t,e){t&1&&I(0,"router-outlet");},dependencies:[_e,ut],encapsulation:2});let i=o;return i;})();var wn=["fileInput"],Xn=["fileInputRegister"],kn=["fileInputStructure"],Vn=(i,o)=>({"mb-10":i,"mb-30":o});function zn(i,o){if(i&1&&(_(0,"div",21),B(1,3),r(),_(2,"div",17),I(3,"app-input-box",22),r(),_(4,"div",17),I(5,"app-select-box",23),r()),i&2){let s=c();l(5),E("items",s.countries)("ngControl",s.formGroup.get("addressCountryAlpha2"))("searchable",!0);}}function Un(i,o){if(i&1&&(_(0,"div",24)(1,"div",25),I(2,"app-select-box",26),r(),_(3,"div",27),I(4,"app-input-box",28),r()(),_(5,"div",24)(6,"div",25),I(7,"app-input-box",29),r(),_(8,"div",27),I(9,"app-input-box",30),r()()),i&2){let s=c();l(2),E("items",s.countries)("ngControl",s.formGroup.get("addressCountryAlpha2"))("searchable",!0);}}function Yn(i,o){i&1&&($e(0),B(1,6),De());}function Hn(i,o){i&1&&($e(0),B(1,7),De());}function jn(i,o){if(i&1&&(_(0,"div")(1,"div",40),A(2),I(3,"i",41),r()()),i&2){let s=o.$implicit;l(2),G(" ",s," ");}}function Wn(i,o){if(i&1&&(_(0,"div",39),te(1,jn,4,1,"div",null,pe),r()),i&2){let s=c(2);l(),ie(s.formGroup.get("files").value);}}function qn(i,o){if(i&1){let s=z();_(0,"h6",31),B(1,4),r(),_(2,"div",32)(3,"div",33),B(4,5),r(),_(5,"div",34)(6,"div",35),p("click",function(t){M(s);let e=c();return t.preventDefault(),L(e.openFileInput());}),I(7,"app-input-box",36),r(),_(8,"button",37),p("click",function(t){M(s);let e=c();return t.preventDefault(),L(e.openFileInput());}),S(9,Yn,2,0,"ng-container"),S(10,Hn,2,0,"ng-container"),r()(),_(11,"input",38,0),p("change",function(t){M(s);let e=c();return L(e.fileSelected(t));}),r(),S(13,Wn,3,0,"div",39),r();}if(i&2){let s=c();l(7),E("readonly",!0),l(2),u(s.isFileUploading?9:-1),l(),u(s.isFileUploading?-1:10),l(3),u(s.formGroup.get("files").value?13:-1);}}function Zn(i,o){i&1&&(_(0,"div",17),I(1,"app-input-box",42),r(),I(2,"app-input-box",43));}function Kn(i,o){i&1&&($e(0),B(1,10),De());}function Qn(i,o){i&1&&($e(0),B(1,11),De());}function Jn(i,o){if(i&1&&(_(0,"div")(1,"div",47),A(2),I(3,"i",48),r()()),i&2){let s=o.$implicit;l(2),G(" ",s," ");}}function eo(i,o){if(i&1&&(_(0,"div",39),te(1,Jn,4,1,"div",null,pe),r()),i&2){let s=c(2);l(),ie(s.formGroup.get("register").value);}}function to(i,o){i&1&&($e(0),B(1,12),De());}function io(i,o){i&1&&($e(0),B(1,13),De());}function no(i,o){if(i&1&&(_(0,"div")(1,"div",47),A(2),I(3,"i",48),r()()),i&2){let s=o.$implicit;l(2),G(" ",s," ");}}function oo(i,o){if(i&1&&(_(0,"div",39),te(1,no,4,1,"div",null,pe),r()),i&2){let s=c(2);l(),ie(s.formGroup.get("structure").value);}}function ro(i,o){if(i&1){let s=z();_(0,"div",32)(1,"div",44),B(2,8),r(),_(3,"div",34)(4,"div",35),p("click",function(t){M(s);let e=c();return t.preventDefault(),L(e.openFileInputRegister());}),I(5,"app-input-box",45),r(),_(6,"button",37),p("click",function(t){M(s);let e=c();return t.preventDefault(),L(e.openFileInputRegister());}),S(7,Kn,2,0,"ng-container"),S(8,Qn,2,0,"ng-container"),r()(),_(9,"input",38,1),p("change",function(t){M(s);let e=c();return L(e.fileSelected(t,"register"));}),r(),S(11,eo,3,0,"div",39),r(),_(12,"div",32)(13,"div",44),B(14,9),r(),_(15,"div",34)(16,"div",35),p("click",function(t){M(s);let e=c();return t.preventDefault(),L(e.openFileInputStructure());}),I(17,"app-input-box",46),r(),_(18,"button",37),p("click",function(t){M(s);let e=c();return t.preventDefault(),L(e.openFileInputStructure());}),S(19,to,2,0,"ng-container"),S(20,io,2,0,"ng-container"),r()(),_(21,"input",38,2),p("change",function(t){M(s);let e=c();return L(e.fileSelected(t,"structure"));}),r(),S(23,oo,3,0,"div",39),r();}if(i&2){let s=c();l(5),E("readonly",!0),l(2),u(s.isFileUploading?7:-1),l(),u(s.isFileUploading?-1:8),l(3),u(s.formGroup.get("register").value?11:-1),l(6),E("readonly",!0),l(2),u(s.isFileUploading2?19:-1),l(),u(s.isFileUploading2?-1:20),l(3),u(s.formGroup.get("structure").value?23:-1);}}var ft=(()=>{let o=class o{constructor(n,t,e,a){this.socketsService=n,this.toastrService=t,this.store=e,this.httpService=a,this.maxDate=le.dateToNgbDate(new Date()),this.isFileUploading=!1,this.isFileUploading2=!1,this.legalEntities=!1;}ngOnInit(){this.store.pipe($("countryList"),Ut(n=>{!n.loaded&&!n.loading&&this.store.dispatch(li());}),ct(n=>!n.loaded),x(1)).subscribe(n=>{this.countries=n.nationalityList;});}fileSelected(n,t){let e=n.target.files;if(e.length===0){n.target.value="";return;}if(e[0].size>5e6){this.toastrService.error("File too large. Makes sure it is below 5MB. Make sure you select a different file."),n.target.value="";return;}let a;if(t==="register"?a=this.formGroup.get("register").value:t==="structure"?a=this.formGroup.get("structure").value:a=this.formGroup.get("files").value,a&&a.length>0&&a.some(T=>T===e[0].name)){this.toastrService.error("Cannot upload file of same name! Make sure you select a different file."),n.target.value="";return;}this.uploadFile(e[0],t);}uploadFile(n,t){if(this.legalEntities&&!this.formGroup.get("id")?.value){if(this.formGroup.get("companyName").setValidators(N.required),U.validateAllFormFields(this.formGroup),this.formGroup.valid){let e={dataType:"submit-company-key-entity-data",payload:{name:this.formGroup.get("companyName").value??"",address:this.formGroup.get("address").value??"",companyForm:this.formGroup.get("companyForm").value??"",companyRegNumber:this.formGroup.get("registrationNumber").value??"",kind:"LEGAL_ENTITY",type:"UBO"}};this.socketsService.sendMessage(e,"get-company-key-entity-list-result").subscribe(a=>{let d=a["get-company-key-entity-list-result"].payload.keyEntities.filter(R=>R.kind==="LEGAL_ENTITY"&&R.type==="UBO").find(R=>R.name===this.formGroup.get("companyName").value);this.formGroup.get("id").setValue(d.id),this.uploadProofOfCompanyWithId(n,d.id,t);},()=>{this.toastrService.error("Something went wrong. Save and refresh the page.");});}}else this.uploadProofOfCompanyWithId(n,this.formGroup.get("id")?.value,t);}uploadProofOfCompanyWithId(n,t,e){e==="structure"?this.isFileUploading2=!0:this.isFileUploading=!0,this.httpService.uploadProofOfCompany(n,t,e).subscribe(a=>{this.fetchFiles(),a?.data?.successfullyUploadedFileNameList?.length?(this.toastrService.success("File successfuly uploaded."),e==="structure"?this.isFileUploading2=!1:this.isFileUploading=!1):(this.toastrService.error("Something went wrong while uploading file. Make sure file is pdf and below 5MB. Please try again."),e==="structure"?this.isFileUploading2=!1:this.isFileUploading=!1);},()=>{this.toastrService.error("Something went wrong while uploading file. Make sure file is pdf and below 5MB. Please try again."),e==="structure"?this.isFileUploading2=!1:this.isFileUploading=!1;});}fetchFiles(){let n={dataType:"get-company-verification-file-list",payload:{}};
5this.socketsService.sendMessage(n,"dms/get-company-verification-list-response").subscribe(t=>{let e=this.formGroup.get("id")?.value;if(e){let a=t["dms/get-company-verification-list-response"].payload.documents.filter(d=>d.keyEntityId===e).filter(d=>d.documentType==="register").map(d=>d.fileName);this.formGroup.get("register").setValue(a);let T=t["dms/get-company-verification-list-response"].payload.documents.filter(d=>d.keyEntityId===e).filter(d=>d.documentType==="structure").map(d=>d.fileName);this.formGroup.get("structure").setValue(T);}else this.formGroup.get("files").setValue(t["dms/get-company-verification-list-response"].payload.documents.map(a=>a.fileName));});}openFileInput(){this.fileInput.nativeElement.click();}openFileInputRegister(){this.fileInputRegister.nativeElement.click();}openFileInputStructure(){this.fileInputStructure.nativeElement.click();}};o.ɵfac=function(t){return new(t||o)(m(K),m(Z),m(y),m(Rt));},o.ɵcmp=F({type:o,selectors:[["app-b2b-registration-company-info-controls"]],viewQuery:function(t,e){if(t&1&&(He(wn,5),He(Xn,5),He(kn,5)),t&2){let a;je(a=We())&&(e.fileInput=a.first),je(a=We())&&(e.fileInputRegister=a.first),je(a=We())&&(e.fileInputStructure=a.first);}},inputs:{formGroup:"formGroup",legalEntities:"legalEntities"},decls:14,vars:13,consts:()=>{let n;n="Full company name";let t;t="Organizational form";let e;e="Legal organizational form (LLC, holding company, publicly traded company, etc.)";let a;a="Registration number";let T;T="Registration number";let d;d="Date of registration";let R;R="Address";let O;O="Company address";let f;f="Country";let g;g="Country of registration";let C;C="The above company is the UBO and a shareholder of the company.";let b;b="Please select";let Q;Q="Country";let D;D="Street";let oe;oe="Street Address";let w;w="City";let Te;Te="City Name";let de;de="Zip";let X;X="Zip Code";let Me;Me="Upload Document";let Le;Le="Company registration certificate (not older than 3 months)";let Re;Re="Extract of your company\u2019s data from the official Business Register in the country where your company is incorporated. Upload the latest/current version of the document. (max. 5MB, pdf only)";let v;v="Uploading ...";let V;V="Upload";let at;at="Enter details";let st;st="Your company business activities (provide detailed explanation)";let lt;lt="Enter details";let Tt;Tt="Please explain how you will use the platform (for your company use or on behalf of others; please elaborate)";let P;P="Upload Document";let vt;vt="Upload Document";let $t;$t="Extract from your country\u2019s business/company register (max. 5MB)";let Dt;Dt="Extract of shareholders structure/register (max. 5MB)";let Pt;Pt="Uploading ...";let xt;xt="Upload";let wt;wt="Uploading ...";let Xt;return Xt="Upload",[["fileInput",""],["fileInputRegister",""],["fileInputStructure",""],C,Le,Re,v,V,$t,Dt,Pt,xt,wt,Xt,[3,"formGroup"],[3,"ngClass"],["id","companyName","type","text","formControlName","companyName","placeholder","Company name","titleLabel",n,3,"autofocus"],[1,"mb-30"],["id","companyForm","type","text","formControlName","companyForm","placeholder",t,"titleLabel",e],["id","registrationNumber","type","text","formControlName","registrationNumber","placeholder",a,"titleLabel",T],["id","registrationDate","placeholder","Date","titleLabel",d,3,"maxDate","ngControl"],[1,"paragraph-gray-900-regular","mb-30"],["id","address","type","text","formControlName","address","placeholder",R,"titleLabel",O],["bindLabel","name","bindValue","alpha2Code","placeholder",f,"titleLabel",g,3,"items","ngControl","searchable"],[1,"mb-30","d-flex"],[1,"w-50","me-15"],["bindLabel","name","bindValue","alpha2Code","placeholder",b,"titleLabel",Q,3,"items","ngControl","searchable"],[1,"w-50","ms-15"],["id","street-address","type","text","formControlName","addressStreet","placeholder",D,"titleLabel",oe],["id","city","type","text","formControlName","addressCity","placeholder",w,"titleLabel",Te],["id","postcode","type","text","formControlName","addressZipCode","placeholder",de,"titleLabel",X],[1,"h6-black","mt-10","mb-5"],[1,"d-flex","flex-column","align-items-end","mb-30"],[1,"paragraph-black-regular","fs-12","mb-10"],[1,"d-flex","w-100"],[1,"w-75","cursor-pointer",3,"click"],["id","files","type","text","formControlName","files","clazz","cursor-pointer","placeholder",Me,3,"readonly"],["type","button",1,"btn","btn-lg","btn-outline-primary-business","w-25","ms-15","p-0",3,"click"],["type","file","accept","application/pdf",1,"d-none",3,"change"],[1,"w-100"],[1,"color-primary-700-business","mt-10","mb-5"],[1,"icon-checked","fs-20","ms-10"],["id","activities","type","text","formControlName","activities","placeholder",at,"titleLabel",st],["id","usage","type","text","formControlName","usage","placeholder",lt,"titleLabel",Tt],[1,"paragraph-black-regular","fs-12","mb-10","w-100"],["id","register","type","text","formControlName","register","clazz","cursor-pointer","placeholder",P,3,"readonly"],["id","structure","type","text","formControlName","structure","clazz","cursor-pointer","placeholder",vt,3,"readonly"],[1,"color-primary-700-business","mb-5"],[1,"icon-checked","fs-20"]];},template:function(t,e){t&1&&(_(0,"div",14)(1,"div",15),I(2,"app-input-box",16),r(),S(3,zn,6,3),S(4,Un,10,3),_(5,"div",17),I(6,"app-input-box",18),r(),_(7,"div",17),I(8,"app-input-box",19),r(),_(9,"div",17),I(10,"app-datepicker-box",20),r(),S(11,qn,14,4),S(12,Zn,3,0),S(13,ro,24,8),r()),t&2&&(E("formGroup",e.formGroup),l(),E("ngClass",Wt(10,Vn,e.legalEntities,!e.legalEntities)),l(),E("autofocus",!1),l(),u(e.legalEntities?3:-1),l(),u(e.legalEntities?-1:4),l(6),E("maxDate",e.maxDate)("ngControl",e.formGroup.get("registrationDate")),l(),u(e.legalEntities?-1:11),l(),u(e.legalEntities?-1:12),l(
5),u(e.legalEntities?13:-1));},dependencies:[me,j,Ce,ue,Xe,_i,ae,q,ee,Ae,xe,we],encapsulation:2});let i=o;return i;})();var _o=i=>({"btn-loading":i}),bi=(()=>{let o=class o{constructor(n,t,e,a,T){this.formBuilder=n,this.socketsService=t,this.router=e,this.toastrService=a,this.store=T,this.minDate=le.dateToNgbDate(new Date()),this.form=this.formBuilder.group({companyName:null,addressCity:null,addressZipCode:null,addressStreet:null,addressCountryAlpha2:null,companyForm:null,registrationNumber:null,registrationDate:null,activities:null,usage:null,files:[]});}ngOnInit(){this.store.pipe($("b2b"),k(t=>t.verificationLoaded),x(1)).subscribe(t=>{if(t.verificationState.steps){let e=Ye(t.verificationState.steps?.companyInfo.fields,[]);Object.keys(this.form.controls).forEach(a=>{Object.prototype.hasOwnProperty.call(e,a)?(this.form.get(a).setValue(e[a].value),e[a].error&&t.verificationState.verificationStatus!=="CREATED"&&(this.form.get(a).setErrors({required:!0}),this.form.get(a).markAsDirty(),this.form.get(a).setValidators(N.required))):this.form.get(a).setValue(null);}),this.form.markAsUntouched();}});let n={dataType:"get-company-verification-file-list",payload:{}};this.socketsService.sendMessage(n,"dms/get-company-verification-list-response").subscribe(t=>{this.form.get("files").setValue(t["dms/get-company-verification-list-response"].payload.documents?.filter(e=>!e.documentType).map(e=>e.fileName));});}saveAndExit(){let n=["/"+"business-account"+"/"+"registration"];this.update(n);}saveAndContinue(){let n=["/"+"business-account"+"/"+"registration"+"/"+"financial-details"],t=[this.form].some(e=>Object.keys(e.controls).some(T=>{let d=e.get(T).value;return d instanceof Array?d.length:!!d;}));!this.form.touched||!t?this.router.navigate(n):(this.form.get("companyName").setValidators(N.required),this.form.get("addressCity").setValidators(N.required),this.form.get("addressZipCode").setValidators(N.required),this.form.get("addressStreet").setValidators(N.required),this.form.get("addressCountryAlpha2").setValidators(N.required),this.form.get("companyForm").setValidators(N.required),this.form.get("registrationNumber").setValidators(N.required),this.form.get("registrationDate").setValidators(N.required),this.form.get("files").value.length?this.form.get("files").clearValidators():this.form.get("files").setValidators(N.required),U.validateAllFormFields(this.form),this.actionInProgress=this.form.valid,this.form.valid&&this.update(n));}update(n){let t=Object.fromEntries(Object.entries(this.form.getRawValue()).filter(([a,T])=>T!==null));delete t.files;let e={dataType:"submit-company-data",payload:se({},t)};this.socketsService.sendMessage(e,"submit-company-data-result").subscribe(()=>{this.toastrService.success("Basic company information successfuly saved"),this.router.navigate(n);},()=>{this.actionInProgressSaveAndExit=!1,this.actionInProgress=!1,this.toastrService.error("Something went wrong. Please try again.");});}};o.ɵfac=function(t){return new(t||o)(m(Pe),m(K),m(W),m(Z),m(y));},o.ɵcmp=F({type:o,selectors:[["app-b2b-registration-basic-company-info"]],decls:14,vars:7,consts:()=>{let n;n="/business-account/registration";let t;t="Basic company information";let e;e="Save and exit";let a;a="Back";let T;return T="Next",[t,e,a,T,[1,"d-flex","justify-content-center","mb-30"],[1,"me-10","ms-10","me-0","ms-0","w-100","w-lg-50"],[1,"card","card-always-border"],[3,"ngSubmit","formGroup"],[1,"h3-black","mb-40"],[3,"formGroup"],["type","button",1,"w-100","btn","btn-outline-black","btn-lg","mt-60",3,"click","disabled"],[1,"d-flex","mt-30"],["routerLink",n,1,"w-50","btn","btn-secondary-business","btn-lg","me-15"],["type","button",1,"w-50","btn","btn-primary-business","btn-lg","ms-15",3,"click","disabled","ngClass"]];},template:function(t,e){t&1&&(_(0,"div",4)(1,"div",5)(2,"div",6)(3,"form",7),p("ngSubmit",function(){return e.saveAndExit();}),_(4,"h3",8),B(5,0),r(),I(6,"app-b2b-registration-company-info-controls",9),_(7,"button",10),p("click",function(){return e.saveAndExit(),e.actionInProgressSaveAndExit=!0;}),B(8,1),r(),_(9,"div",11)(10,"a",12),B(11,2),r(),_(12,"button",13),p("click",function(){return e.saveAndContinue();}),B(13,3),r()()()()()()),t&2&&(l(3),E("formGroup",e.form),l(3),E("formGroup",e.form),l(),E("disabled",!e.form.touched||e.actionInProgressSaveAndExit),l(5),E("disabled",e.actionInProgress)("ngClass",Y(5,_o,e.actionInProgress)));},dependencies:[me,j,Ce,J,q,ee,xe,we,ft,_e,re],encapsulation:2});let i=o;return i;})();var yi=(()=>{let o=class o{};o.ɵfac=function(t){return new(t||o)();},o.ɵcmp=F({type:o,selectors:[["app-b2b-registration-beneficial-owners"]],decls:52,vars:0,consts:()=>{let n;n="/business-account/registration/authorized-representatives";let t;t="/business-account/registration/natural-persons";let e;e="Beneficial owner(s) of your company";let a;a="We need information about the "+"\uFFFD#6\uFFFD"+"ultimate beneficial owner(s) (UBO)"+"\uFFFD/#6\uFFFD"+" of your company. If your company is owned or c
5ontrolled by another company or natural person, we also need their information.";let T;T="Who is an "+"\uFFFD#9\uFFFD"+"Ultimate beneficial owner (UBO)?"+"\uFFFD/#9\uFFFD"+"";let d;d="A natural person or company that is at the end of the chain of owners and owns a significant share of your company. It is usually:";let R;R="\u2022 a natural person who controls the last company in the chain of ownership or";let O;O="\u2022 a director(s) of a company that holds at least 25% ownership of the last company in the chain of ownership (if the company has NO single shareholder with more then 25% shares)";let f;f="Example:";let g;g="Company "+"[\uFFFD#25\uFFFD|\uFFFD#26\uFFFD|\uFFFD#27\uFFFD|\uFFFD#28\uFFFD|\uFFFD#29\uFFFD|\uFFFD#30\uFFFD]"+"A"+"[\uFFFD/#25\uFFFD|\uFFFD/#26\uFFFD|\uFFFD/#27\uFFFD|\uFFFD/#28\uFFFD|\uFFFD/#29\uFFFD|\uFFFD/#30\uFFFD]"+" owns at least 25% of "+"[\uFFFD#25\uFFFD|\uFFFD#26\uFFFD|\uFFFD#27\uFFFD|\uFFFD#28\uFFFD|\uFFFD#29\uFFFD|\uFFFD#30\uFFFD]"+"YOUR company\u2019"+"[\uFFFD/#25\uFFFD|\uFFFD/#26\uFFFD|\uFFFD/#27\uFFFD|\uFFFD/#28\uFFFD|\uFFFD/#29\uFFFD|\uFFFD/#30\uFFFD]"+" and Company "+"[\uFFFD#25\uFFFD|\uFFFD#26\uFFFD|\uFFFD#27\uFFFD|\uFFFD#28\uFFFD|\uFFFD#29\uFFFD|\uFFFD#30\uFFFD]"+"B"+"[\uFFFD/#25\uFFFD|\uFFFD/#26\uFFFD|\uFFFD/#27\uFFFD|\uFFFD/#28\uFFFD|\uFFFD/#29\uFFFD|\uFFFD/#30\uFFFD]"+" owns at least 50% of all shares of company "+"[\uFFFD#25\uFFFD|\uFFFD#26\uFFFD|\uFFFD#27\uFFFD|\uFFFD#28\uFFFD|\uFFFD#29\uFFFD|\uFFFD#30\uFFFD]"+"A"+"[\uFFFD/#25\uFFFD|\uFFFD/#26\uFFFD|\uFFFD/#27\uFFFD|\uFFFD/#28\uFFFD|\uFFFD/#29\uFFFD|\uFFFD/#30\uFFFD]"+" and Natural person "+"[\uFFFD#25\uFFFD|\uFFFD#26\uFFFD|\uFFFD#27\uFFFD|\uFFFD#28\uFFFD|\uFFFD#29\uFFFD|\uFFFD#30\uFFFD]"+"C"+"[\uFFFD/#25\uFFFD|\uFFFD/#26\uFFFD|\uFFFD/#27\uFFFD|\uFFFD/#28\uFFFD|\uFFFD/#29\uFFFD|\uFFFD/#30\uFFFD]"+" holds at least 25% of the shares of company "+"[\uFFFD#25\uFFFD|\uFFFD#26\uFFFD|\uFFFD#27\uFFFD|\uFFFD#28\uFFFD|\uFFFD#29\uFFFD|\uFFFD#30\uFFFD]"+"B"+"[\uFFFD/#25\uFFFD|\uFFFD/#26\uFFFD|\uFFFD/#27\uFFFD|\uFFFD/#28\uFFFD|\uFFFD/#29\uFFFD|\uFFFD/#30\uFFFD]"+", in this case we need information about person A and B as well.",g=dt(g);let C;C="UBO";let b;b="C";let Q;Q="B";let D;D="A";let oe;oe="YOUR COMPANY";let w;w="Please also provide information about any legal and natural persons who have so-called indirect control over your company (e.g. shareholders who exercise control alone or with other shareholders, including through any contract, understanding, relationship, intermediary, or tiered entity).";let Te;Te="Back";let de;return de="Next",[e,a,T,d,R,O,f,g,C,b,Q,D,oe,w,Te,de,[1,"d-flex","justify-content-center","mb-30"],[1,"card","card-always-border","me-10","ms-10","me-0","ms-0","w-100","w-lg-50"],[1,"h3-black"],[1,"paragraph-gray-900-regular","mt-20","mb-30"],[1,"paragraph-gray-900-regular","mb-10"],[1,"paragraph-gray-900-regular"],[1,"d-flex"],[1,"paragraph-gray-900-regular","fs-22","align-self-start"],[1,"d-flex","mb-30"],[1,"d-flex","mb-50"],[1,"d-flex","align-items-center","justify-content-center","mb-50"],[1,"paragraph-black-bold","text-center","text-lg-start","me-20","fs-16"],[1,"icon-arrow-long","icon-arrow-long-right","color-black","fs-22","me-20"],[1,"color-black","fs-20","me-20"],[1,"paragraph-gray-900-bold","text-center","text-lg-start","fs-16"],[1,"paragraph-gray-900-regular","mb-30"],["routerLink",n,1,"w-50","btn","btn-secondary-business","btn-lg","me-15"],["routerLink",t,1,"w-50","btn","btn-primary-business","btn-lg","ms-15"]];},template:function(t,e){t&1&&(_(0,"div",16)(1,"div",17)(2,"h3",18),B(3,0),r(),_(4,"div",19),Ie(5,1),I(6,"b"),Ee(),r(),_(7,"div",20),Ie(8,2),I(9,"b"),Ee(),r(),_(10,"div",21),B(11,3),r(),_(12,"div",22),I(13,"i",23),_(14,"div",21),B(15,4),r()(),_(16,"div",24),I(17,"i",23),_(18,"div",21),B(19,5),r()(),_(20,"div",20),B(21,6),r(),_(22,"div",25)(23,"div",21),Ie(24,7),I(25,"b")(26,"b")(27,"b")(28,"b")(29,"b")(30,"b"),Ee(),r()(),_(31,"div",26)(32,"div",27),B(33,8),r(),I(34,"i",28),_(35,"div",29),B(36,9),r(),I(37,"i",28),_(38,"div",29),B(39,10),r(),I(40,"i",28),_(41,"div",29),B(42,11),r(),_(43,"div",30),B(44,12),r()(),_(45,"div",31),B(46,13),r(),_(47,"div",22)(48,"button",32),B(49,14),r(),_(50,"button",33),B(51,15),r()()()());},dependencies:[_e,re],encapsulation:2});let i=o;return i;})();var ao=i=>({"btn-loading":i});
5function so(i,o){if(i&1){let s=z();_(0,"div",17)(1,"i",24),p("click",function(){M(s);let t=c(),e=t.$implicit,a=t.$index,T=c();return L(T.deleteInstance(e,a));}),r()();}}function lo(i,o){if(i&1&&(_(0,"div",16),I(1,"app-radio-button-list",25),r()),i&2){let s=c(),n=s.$implicit,t=s.$index,e=c();l(),E("formControl",n.get("type"))("id","types"+t)("items",e.types)("name","types"+t);}}function To(i,o){if(i&1&&(_(0,"div",16),S(1,so,2,0,"div",17),I(2,"app-input-box",18),r(),_(3,"div",16),I(4,"app-input-box",19),r(),S(5,lo,2,4,"div",16),_(6,"div",16),I(7,"app-input-box",20),r(),_(8,"div",21),I(9,"app-input-box",22),r(),I(10,"div",23)),i&2){let s=o.$implicit,n=o.$index;l(),u(n!==0?1:-1),l(),E("autofocus",!0)("formControl",s.get("name"))("id","name"+n),l(2),E("formControl",s.get("email"))("id","email"+n),l(),u(n===0?5:-1),l(2),E("formControl",s.get("mannerNote"))("id","manner"+n),l(2),E("formControl",s.get("restrictionNote"))("id","restrictions"+n);}}var $i=(()=>{let o=class o{constructor(n,t,e,a,T){this.formBuilder=n,this.socketsService=t,this.router=e,this.toastrService=a,this.store=T,this.noDataPresent=!1,this.types=[{label:"Yes, director",value:"DIRECTOR",disabled:!1},{label:"Yes, the person can represent the Company, but is not a Director",value:"LEGAL_REPRESENTATIVE",disabled:!1}],this.formArray=this.formBuilder.array([]);}addEmptyFormInstance(){let n=this.formBuilder.group({id:null,name:null,email:null,type:null,mannerNote:null,restrictionNote:null});this.formArray.push(n);}ngOnInit(){this.store.pipe($("b2b"),k(n=>n.verificationLoaded),x(1)).subscribe(n=>{if(n.verificationState.steps){let{representatives:t}=n.verificationState.steps?.authorizedRepresentatives,e=t.slice().sort((a,T)=>a.type.value==="NONE"&&T.type.value!=="NONE"?1:a.type.value!=="NONE"&&T.type.value==="NONE"?-1:0);e?.length===0?(this.addEmptyFormInstance(),this.noDataPresent=!0):e.forEach(a=>{let T=this.formBuilder.group({id:a.id.value,name:a.name.value,email:a.email.value,type:a.type.value,mannerNote:a.mannerNote.value,restrictionNote:a.restrictionNote.value});Object.keys(T.controls).forEach(d=>{if(a[d].error){let R=T.get(d);R.setErrors({required:!0}),R.markAsDirty(),R.setValidators(N.required);}}),this.formArray.push(T);}),this.formArray.markAsUntouched();}else this.addEmptyFormInstance(),this.noDataPresent=!0;});}saveAndExit(){let n=["/"+"business-account"+"/"+"registration"];this.formArray.controls.forEach((t,e)=>{t.get("name").setValidators(N.required),t.get("mannerNote").clearValidators(),t.get("restrictionNote").clearValidators(),t.get("email").clearValidators(),e===0&&t.get("type").setValidators(N.required),e!==0&&t.get("type").setValue("LEGAL_REPRESENTATIVE"),U.validateAllFormFields(t);}),this.actionInProgressSaveAndExit=this.formArray.valid,this.formArray.valid&&this.update(n);}saveAndContinue(){let n=["/"+"business-account"+"/"+"registration"+"/"+"beneficial-owners"],t=this.formArray.controls.some(e=>Object.keys(e.controls).some(T=>{let d=e.get(T).value;return d instanceof Array?d.length:!!d;}));!this.formArray.touched||!t?this.router.navigate(n):(this.formArray.controls.forEach((e,a)=>{e.get("name").setValidators(N.required),e.get("mannerNote").setValidators(N.required),e.get("restrictionNote").setValidators(N.required),e.get("email").setValidators([N.required,N.email]),a===0&&e.get("type").setValidators(N.required),a!==0&&e.get("type").setValue("LEGAL_REPRESENTATIVE"),U.validateAllFormFields(e);}),this.actionInProgress=this.formArray.valid,this.formArray.valid&&this.update(n));}update(n){this.formArray.controls.forEach(t=>{let e=t.getRawValue(),a=Object.fromEntries(Object.entries(e).filter(([d,R])=>R!==null));e.id||(a=Ye(a,[]));let T={dataType:"submit-company-key-entity-data",payload:Ue(se({},a),{kind:"NATURAL_PERSON"})};this.socketsService.sendMessage(T,"get-company-key-entity-list-result").subscribe(()=>{this.router.navigate(n),this.toastrService.success("Legal representatives successfuly saved!");},()=>{this.actionInProgressSaveAndExit=!1,this.actionInProgress=!1,this.toastrService.error("Something went wrong. Check that you filled all inputs and please try again.");});});}deleteInstance(n,t){let e=n.get("id").value;if(e){let a={dataType:"delete-company-key-entity",payload:{id:e}};this.socketsService.sendMessage(a,"get-company-key-entity-list-result").subscribe(()=>{let T=this.formArray.controls.findIndex(d=>d.get("id").value===e);this.formArray.removeAt(T),this.toastrService.success("Successfully deleted natural person entry!");},()=>{this.toastrService.error("Something went wrong. Please try again.");});}else this.formArray.removeAt(t);}};o.ɵfac=function(t){return new(t||o)(m(Pe),m(K),m(W),m(Z),m(y));},o.ɵcmp=F({type:o,selectors:[["app-b2b-registration-authorized-representatives"]],decls:18,vars:6,consts:()=>{let n;n="/business-account/registration/account-admin";let t;t="Legal representative(s)";let e;e="+ Add another Natural person";let a;a="Save and exit";let T;T="Back";let d;d="Next";let R;R="Name and surname";let O;O="Name and surname";let f;f="Email";let g;g="Email";let C;C="Describe manner of representation";let b;b="Manner of representation (for example: can this person represent the legal entity independently?)";let Q;Q="Describe restrictions of representation";let D;D="Restrictions of representation (for example: can this person represent the company independently for transactions up to 5,000.00 EUR?)";let oe;return oe="Is this person a legal representative or director of the company?",[t,e,a,T,d,[1,"d-flex","justify-content-center","mb-30"],[1,"me-10","ms-10","me-0","ms-0","w-100","w-lg-50"],[1,"card","card-always-border"],[1,"h3-black","mb-30"],[3,"ngSubmit","formGroup"],[1,"label-black-bold","mb-50","text-center","cursor-pointer"],[1,"fs-14",3,"click"],["type","button",1,"w-100","btn","btn-outline-black","btn-lg",3,"click","disabled"],[1,"d-flex","mt-30"],["routerLink",n,1,"w-50","btn","btn-secondary-business","btn-lg","me-15"],[1,"w-50","btn","btn-primary-business","btn-lg","ms-15",3,"disabled","ngClass"],[1,"mb-30"],[1,"w-100","d-flex","justify-content-end"],["type","text","placeholder",R,"titleLabel",O,3,"autofocus","formControl","id"],["type","email","placeholder",f,"titleLabel",g,3,"formControl","id"],["type","text","placeholder",C,"titleLabel",b,3,"formControl","id"],[1,"mb-40"],["type","text","placeholder",Q,"titleLabel",D,3,"formControl","id"],[1,"separator-gray-300","mb-25"],[1,"icon-cancel","fs-20","label-gray-500-regular","cursor-pointer",3,"click"],["orientation","vertical","titleLabel",oe,3,"formControl","id","items","name"]];},template:function(t,e){t&1&&(_(0,"div",5)(1,"div",6)(2,"div",7)(3,"h3",8),B(4,0),r(),_(5,"form",9),p("ngSubmit",function(){return e.saveAndContinue();}),te(6,To,11,11,null,null,pe),_(8,"div",10)(9,"a",11),p("click",function(){return e.addEmptyFormInstance();}),B(10,1),r()(),_(11,"button",12),p("click",function(){return e.saveAndExit();}),B(12,2),r(),_(13,"div",13)(14,"a",14),B(15,3),r(),_(16,"button",15),B(17,4),r()()()()()()),t&2&&(l(5),E("formGroup",e.formArray),l(),ie(e.formArray.controls),l(5),E("disabled",!e.formArray.touched||e.actionInProgress),l(5),E("disabled",e.actionInProgress)("ngClass",Y(4,ao,e.actionInProgress)));},dependencies:[me,j,xe,J,ae,q,we,Nt,ee,Ce,ue,ot,_e,re],encapsulation:2});let i=o;return i;})();var Bo=i=>({"btn-loading":i});
5function Io(i,o){if(i&1){let s=z();_(0,"div",19)(1,"i",24),p("click",function(){M(s);let t=c(),e=t.$implicit,a=t.$index,T=c();return L(T.deleteInstance(e,a));}),r()();}}function Eo(i,o){i&1&&I(0,"div",23);}function co(i,o){if(i&1&&(_(0,"div",18),S(1,Io,2,0,"div",19),I(2,"app-input-box",20),r(),_(3,"div",18),I(4,"app-input-box",21),r(),_(5,"div",18),I(6,"app-radio-button-list",22),r(),S(7,Eo,1,0,"div",23)),i&2){let s=o.$implicit,n=o.$index,t=c();l(),u(n!==0?1:-1),l(),E("formControl",s.get("name"))("id","name"+n),l(2),E("formControl",s.get("email"))("id","email"+n),l(2),E("formControl",s.get("uboType"))("id","uboType"+n)("items",t.uboTypes)("name","uboType"+n),l(),u(t.formArray.controls.length>1?7:-1);}}function mo(i,o){i&1&&($e(0),B(1,5),De());}function So(i,o){i&1&&($e(0),B(1,6),De());}var Di=(()=>{let o=class o{constructor(n,t,e,a,T){this.formBuilder=n,this.socketsService=t,this.router=e,this.toastrService=a,this.store=T,this.noDataPresent=!1,this.uboTypes=[{label:"A shareholder who owns 25% or more of my company",value:"COMPANY_SHAREHOLDER",disabled:!1},{label:"A shareholder who owns 25% or more of the shares in the last company in the ownership chain.",value:"END_COMPANY_SHAREHOLDER",disabled:!1},{label:"A director of the last company in the chain of ownership",value:"END_COMPANY_DIRECTOR",disabled:!1}],this.formArray=this.formBuilder.array([]);}addEmptyFormInstance(){let n=this.formBuilder.group({id:"",name:"",email:"",uboType:""});this.formArray.push(n);}ngOnInit(){this.store.pipe($("b2b"),k(n=>n.verificationLoaded),x(1)).subscribe(n=>{if(n.verificationState.steps){let{persons:t}=n.verificationState.steps?.naturalPersons;t.length===0?(this.addEmptyFormInstance(),this.noDataPresent=!0):t.forEach(e=>{let a=this.formBuilder.group({id:e.id.value,name:e.name.value,email:e.email.value,uboType:e.uboType.value});Object.keys(a.controls).forEach(T=>{if(e[T].error){let d=a.get(T);d.setErrors({required:!0}),d.markAsDirty(),d.setValidators(N.required);}}),this.formArray.push(a);});}else this.addEmptyFormInstance(),this.noDataPresent=!0;});}saveAndExit(){let n=["/"+"business-account"+"/"+"registration"];this.formArray.controls.forEach(t=>{t.get("name").setValidators(N.required),t.get("email").clearValidators(),U.validateAllFormFields(t);}),this.actionInProgressSaveAndExit=this.formArray.valid,this.formArray.valid&&this.update(n);}saveAndContinue(){let n=["/"+"business-account"+"/"+"registration"+"/"+"legal-entities"],t=this.formArray.controls.some(e=>Object.keys(e.controls).some(T=>{let d=e.get(T).value;return d instanceof Array?d.length:!!d;}));!this.formArray.touched||!t?this.router.navigate(n):(this.formArray.controls.forEach(e=>{e.get("name").setValidators(N.required),e.get("email").setValidators([N.required,N.email]),e.get("uboType").setValidators(N.required),U.validateAllFormFields(e);}),this.actionInProgress=this.formArray.valid,this.formArray.valid&&this.update(n));}update(n){this.formArray.controls.forEach(t=>{let e=t.getRawValue(),a={};e.id?a=e:a=Ye(e,[]);let T={dataType:"submit-company-key-entity-data",payload:Ue(se({},a),{kind:"NATURAL_PERSON",type:"UBO"})};this.socketsService.sendMessage(T,"get-company-key-entity-list-result").subscribe(()=>{this.router.navigate(n),this.toastrService.success("Natural person successfuly saved!");},()=>{this.actionInProgressSaveAndExit=!1,this.actionInProgress=!1,this.toastrService.error("Something went wrong. Check that you filled all inputs and please try again.");});});}deleteInstance(n,t){let e=n.get("id").value;if(e){let a={dataType:"delete-company-key-entity",payload:{id:e}};this.socketsService.sendMessage(a,"get-company-key-entity-list-result").subscribe(()=>{let T=this.formArray.controls.findIndex(d=>d.get("id").value===e);this.formArray.removeAt(T),this.toastrService.success("Successfully deleted natural person entry!");},()=>{this.toastrService.error("Something went wrong. Please try again.");});}else this.formArray.removeAt(t);}};o.ɵfac=function(t){return new(t||o)(m(Pe),m(K),m(W),m(Z),m(y));},o.ɵcmp=F({type:o,selectors:[["app-b2b-registration-natural-persons"]],decls:20,vars:8,consts:()=>{let n;n="/business-account/registration/beneficial-owners";let t;t="Natural persons (UBOs)";let e;e="Optional - Only for natural persons owning 25% or more of the company\u2019s equity.";let a;a="+ Add another natural person";let T;T="Save and exit";let d;d="Back";let R;R="Name and surname";let O;O="Name and surname";let f;f="Email";let g;g="Email";let C;C="Type of UBO:";let b;b="Skip";let Q;return Q="Next",[t,e,a,T,d,b,Q,[1,"d-flex","justify-content-center","mb-30"],[1,"me-10","ms-10","me-0","ms-0","w-100","w-lg-50"],[1,"card","card-always-border"],[1,"h3-black","mb-10"],[1,"paragraph-gray-900-regular","mb-30"],[3,"ngSubmit","formGroup"],[1,"label-black-bold","mb-50","text-center","fs-14","cursor-pointer",3,"click"],["type","button",1,"w-100","btn","btn-outline-black","btn-lg","mb-30",3,"click","disabled"],[1,"d-flex"],["routerLink",n,1,"w-50","btn","btn-secondary-business","btn-lg","me-15"],[1,"w-50","btn","btn-primary-business","btn-lg","ms-15",3,"disabled","ngClass"],[1,"mb-30"],[1,"w-100","d-flex","justify-content-end"],["type","text","placeholder",R,"titleLabel",O,3,"formControl","id"],["type","email","placeholder",f,"titleLabel",g,3,"formControl","id"],["orientation","vertical","titleLabel",C,3,"formControl","id","items","name"],[1,"separator-gray-300","mt-30","mb-30"],[1,"icon-cancel","fs-20","label-gray-500-regular","cursor-pointer",3,"click"]];},template:function(t,e){t&1&&(_(0,"div",7)(1,"div",8)(2,"div",9)(3,"h3",10),B(4,0),r(),_(5,"div",11),B(6,1),r(),_(7,"form",12),p("ngSubmit",function(){return e.saveAndContinue();}),te(8,co,8,10,null,null,pe),_(10,"div",13),p("click",function(){return e.addEmptyFormInstance();}),B(11,2),r(),_(12,"button",14),p("click",function(){return e.saveAndExit();}),B(13,3),r(),_(14,"div",15)(15,"a",16),B(16,4),r(),_(17,"button",17),S(18,mo,2,0,"ng-container"),S(19,So,2,0,"ng-container"),r()()()()()()),t&2&&(l(7),E("formGroup",e.formArray),l(),ie(e.formArray.controls),l(4),E("disabled",!e.formArray.touched||e.actionInProgressSaveAndExit),l(5),E("disabled",e.actionInProgress)("ngClass",Y(6,Bo,e.actionInProgress)),l(),u(e.noDataPresent&&!e.formArray.touched?18:-1),l(),u(e.noDataPresent&&!e.formArray.touched?-1:19));},dependencies:[me,j,xe,J,ae,q,we,Nt,ee,Ce,ue,ot,_e,re],encapsulation:2});let i=o;return i;})();var yt=(()=>{let o=class o{constructor(n,t,e,a){this.ngbActiveModal=n,this.socketsService=t,this.toastrService=e,this.router=a;}submit(){this.actionInProgress=!0;let n=["/"+"business-account"+"/"+"registration"],t={dataType:"complete-company-registration",payload:{}};this.socketsService.sendMessage(t,"complete-company-registration-result").subscribe(()=>{this.toastrService.success("Company registration successfuly completed! Your application is under review!"),this.router.navigate(n),this.ngbActiveModal.close(),this.actionInProgress=!1;},()=>{this.toastrService.error("Company registration is unsuccessful. Go through the form and make sure you filled 
5in company basic info and at least one company representative. Make sure you also uploaded files."),this.ngbActiveModal.close(),this.actionInProgress=!1;});}};o.ɵfac=function(t){return new(t||o)(m(fe),m(K),m(Z),m(W));},o.ɵcmp=F({type:o,selectors:[["app-b2b-registration-submit-modal"]],standalone:!1,decls:21,vars:1,consts:()=>{let n;n="Info";let t;t="Submit & next steps";let e;e="After submitting the application all users that need to go through a identity verification process (KYC) will receive instructions from us via email.";let a;a="You will be able to follow the progress and status of each person involved via our online portal.";let T;T="Regulatory requirements";let d;d="When you click submit, all the following directors/UBO\u2019s will get an email with instruction how to verify their identity "+"\uFFFD#15\uFFFD"+"(KYC verification)"+"\uFFFD/#15\uFFFD"+".";let R;R="Back";let O;return O="Next",[n,t,e,a,T,d,R,O,[1,"h5-gray","font-weight-bold"],[1,"h5-black","text-center","mb-30"],[1,"paragraph-black-regular","text-center","mb-30"],[1,"action-notice","action-notice--warning","action-notice--warning-bg","mb-20"],[1,"h5-black","fs-14","mb-10","color-warning-500"],[1,"label-black-regular"],[1,"w-50","btn","btn-outline-primary-business","btn-lg","me-15",3,"click"],[1,"w-50","btn","btn-primary-business","btn-lg","ms-15",3,"click","disabled"]];},template:function(t,e){t&1&&(_(0,"app-modal-header")(1,"h5",8),B(2,0),r()(),_(3,"app-modal-body")(4,"h5",9),B(5,1),r(),_(6,"div",10),B(7,2),r(),_(8,"div",10),B(9,3),r(),_(10,"div",11)(11,"div",12),B(12,4),r(),_(13,"div",13),Ie(14,5),I(15,"b"),Ee(),r()()(),_(16,"app-modal-footer")(17,"button",14),p("click",function(){return e.ngbActiveModal.close();}),B(18,6),r(),_(19,"button",15),p("click",function(){return e.submit();}),B(20,7),r()()),t&2&&(l(19),E("disabled",e.actionInProgress));},dependencies:[ge,Se,ii],encapsulation:2});let i=o;return i;})();var uo=i=>({"btn-loading":i});function No(i,o){if(i&1){let s=z();_(0,"div",17)(1,"i",20),p("click",function(){M(s);let t=c(),e=t.$implicit,a=t.$index,T=c();return L(T.deleteInstance(e,a));}),r()();}}function Ro(i,o){i&1&&I(0,"div",19);}function po(i,o){if(i&1&&(_(0,"div"),S(1,No,2,0,"div",17),I(2,"app-b2b-registration-company-info-controls",18),S(3,Ro,1,0,"div",19),r()),i&2){let s=o.$implicit,n=o.$index,t=c();l(),u(n!==0?1:-1),l(),E("formGroup",s)("legalEntities",!0),l(),u(t.formArray.controls.length<1?3:-1);}}var Pi=(()=>{let o=class o{constructor(n,t,e,a,T,d){this.formBuilder=n,this.socketsService=t,this.router=e,this.toastrService=a,this.ngbModal=T,this.store=d,this.minDate=le.dateToNgbDate(new Date()),this.noDataPresent=!1,this.formArray=this.formBuilder.array([]);}addEmptyFormInstance(){let n=this.formBuilder.group({id:null,address:null,addressCountryAlpha2:null,companyName:null,companyForm:null,registrationNumber:null,registrationDate:null,register:null,structure:null});this.formArray.push(n);}ngOnInit(){this.store.pipe($("b2b"),k(n=>n.verificationLoaded),x(1)).subscribe(n=>{if(n.verificationState.steps){let{entities:t}=n.verificationState.steps?.legalEntities;t.length===0?(this.addEmptyFormInstance(),this.noDataPresent=!0):t.forEach(e=>{let a=this.formBuilder.group({id:e.id.value,companyName:e.companyName.value,address:e.address.value,addressCountryAlpha2:e.companyRegCountry.value,companyForm:e.companyForm.value,registrationNumber:e.registrationNumber.value,registrationDate:e.registrationDate.value,register:[],structure:[]});Object.keys(a.controls).forEach(d=>{if(e[d]&&e[d].error){let R=a.get(d);R.setErrors({required:!0}),R.markAsDirty(),R.setValidators(N.required);}});let T={dataType:"get-company-verification-file-list",payload:{verificationId:a.get("id")?.value}};this.socketsService.sendMessage(T,"dms/get-company-verification-list-response").subscribe(d=>{let R=a.get("id")?.value;if(R){let O=d["dms/get-company-verification-list-response"].payload.documents.filter(g=>g.keyEntityId===R).filter(g=>g.documentType==="register").map(g=>g.fileName),f=d["dms/get-company-verification-list-response"].payload.documents.filter(g=>g.keyEntityId===R).filter(g=>g.documentType==="structure").map(g=>g.fileName);a.get("register").setValue(O),a.get("structure").setValue(f);}}),this.formArray.push(a);});}else this.addEmptyFormInstance(),this.noDataPresent=!0;});}saveAndExit(){let n=["/"+"business-account"+"/"+"registration"];
5this.formArray.controls.forEach(t=>{t.get("address").setValidators(N.required),t.get("companyName").setValidators(N.required),t.get("addressCountryAlpha2").clearValidators(),t.get("companyForm").clearValidators(),t.get("registrationNumber").clearValidators(),t.get("registrationDate").clearValidators(),U.validateAllFormFields(t);}),this.actionInProgressSaveAndExit=this.formArray.valid,this.formArray.valid&&this.update(n);}saveAndContinue(){let n=["/"+"business-account"+"/"+"registration"],t=this.formArray.controls.some(e=>Object.keys(e.controls).some(T=>{let d=e.get(T).value;return d instanceof Array?d.length:!!d;}));!this.formArray.touched||!t?this.ngbModal.open(yt,{size:"sm"}):(this.formArray.controls.forEach(e=>{e.get("address").setValidators(N.required),e.get("addressCountryAlpha2").setValidators(N.required),e.get("companyName").setValidators(N.required),e.get("companyForm").setValidators(N.required),e.get("registrationNumber").setValidators(N.required),e.get("registrationDate").setValidators(N.required),U.validateAllFormFields(e);}),this.actionInProgress=this.formArray.valid,this.formArray.valid&&this.update(n,!0));}update(n,t){this.formArray.controls.forEach(e=>{let a=e.getRawValue(),T={id:a.id,address:a.address,companyRegCountry:a.addressCountryAlpha2,name:a.companyName,companyForm:a.companyForm,companyRegNumber:a.registrationNumber,companyRegDate:a.registrationDate},d=Object.fromEntries(Object.entries(T).filter(([O,f])=>f!==null));delete d.files;let R={dataType:"submit-company-key-entity-data",payload:Ue(se({},d),{kind:"LEGAL_ENTITY",type:"UBO"})};this.socketsService.sendMessage(R,"get-company-key-entity-list-result").subscribe(()=>{t&&n?this.ngbModal.open(yt,{size:"sm"}):n&&this.router.navigate(n),this.actionInProgressSaveAndExit=!1,this.actionInProgress=!1,this.toastrService.success("Authorized representatives successfuly saved!");},()=>{this.actionInProgressSaveAndExit=!1,this.actionInProgress=!1,this.toastrService.error("Something went wrong. Check that you filled all inputs and please try again.");});});}deleteInstance(n,t){let e=n.get("id").value;if(e){let a={dataType:"delete-company-key-entity",payload:{id:e}};this.socketsService.sendMessage(a,"get-company-key-entity-list-result").subscribe(()=>{let T=this.formArray.controls.findIndex(d=>d.get("id").value===e);this.formArray.removeAt(T),this.toastrService.success("Successfully deleted legal entity entry!");},()=>{this.toastrService.error("Something went wrong. Please try again.");});}else this.formArray.removeAt(t);}};o.ɵfac=function(t){return new(t||o)(m(Pe),m(K),m(W),m(Z),m(qe),m(y));},o.ɵcmp=F({type:o,selectors:[["app-b2b-registration-legal-entities"]],decls:19,vars:6,consts:()=>{let n;n="/business-account/registration/beneficial-owners";let t;t="Legal entities (UBOs)";let e;e="Optional - Only for legal entities owning 25% or more of the company\u2019s equity.";let a;a="+ Add another legal entity";let T;T="Save and exit";let d;d="Back";let R;return R="Submit Verification",[t,e,a,T,d,R,[1,"d-flex","justify-content-center","mb-30"],[1,"me-10","ms-10","me-0","ms-0","w-100","w-lg-50"],[1,"card","card-always-border"],[1,"h3-black","mb-10"],[1,"paragraph-gray-900-regular","mb-30"],[3,"ngSubmit","formGroup"],[1,"label-black-bold","text-center","mb-30","fs-14","cursor-pointer",3,"click"],["type","button",1,"w-100","btn","btn-outline-black","btn-lg",3,"click","disabled"],[1,"d-flex","mt-30"],["routerLink",n,1,"w-50","btn","btn-secondary-business","btn-lg","me-15"],[1,"w-50","btn","btn-primary-business","btn-lg","ms-15",3,"disabled","ngClass"],[1,"w-100","d-flex","justify-content-end"],[3,"formGroup","legalEntities"],[1,"separator-gray-300","mt-30","mb-30"],[1,"icon-cancel","fs-20","label-gray-500-regular","cursor-pointer",3,"click"]];},template:function(t,e){t&1&&(_(0,"div",6)(1,"div",7)(2,"div",8)(3,"h3",9),B(4,0),r(),_(5,"div",10),B(6,1),r(),_(7,"form",11),p("ngSubmit",function(){return e.saveAndContinue();}),te(8,po,4,4,"div",null,pe),_(10,"div",12),p("click",function(){return e.addEmptyFormInstance();}),B(11,2),r(),_(12,"button",13),p("click",function(){return e.saveAndExit();}),B(13,3),r(),_(14,"div",14)(15,"a",15),B(16,4),r(),_(17,"button",16),B(18,5),r()()()()()()),t&2&&(l(7),E("formGroup",e.formArray),l(),ie(e.formArray.controls),l(4),E("disabled",!e.formArray.touched||e.actionInProgressSaveAndExit),l(5),E("disabled",e.actionInProgress)("ngClass",Y(4,uo,e.actionInProgress)));},dependencies:[me,j,Ce,J,q,ee,xe,we,ft,_e,re],encapsulation:2});let i=o;return i;})();
5function Ao(i,o){if(i&1){let s=z();_(0,"button",13),p("click",function(){M(s);let t=c();return L(t.submit());}),B(1,2),r();}if(i&2){let s=c();E("disabled",s.actionInProgress);}}function Oo(i,o){if(i&1){let s=z();_(0,"button",13),p("click",function(){M(s);let t=c();return L(t.submit());}),B(1,3),r();}if(i&2){let s=c();E("disabled",s.actionInProgress);}}var wi=(()=>{let o=class o{constructor(n,t,e,a){this.ngbActiveModal=n,this.socketsService=t,this.formBuilder=e,this.toastrService=a,this.update$=new St();}ngOnInit(){this.form=this.formBuilder.group({differentEmail:[{value:null,disabled:!0}],email:[{value:this.email,disabled:!0}]}),this.defaultEmail=this.email,setTimeout(()=>{this.form.get("differentEmail").enable();}),this.differentEmailSub=this.form.get("differentEmail").valueChanges.subscribe(n=>{n?this.form.get("email").enable():(this.form.get("email").disable(),this.form.get("email").setValue(this.defaultEmail,{onlySelf:!0,emitEvent:!1}));});}submit(){this.form.get("email").setValidators([N.required,N.email]),this.isResend=this.email===this.form.get("email").value,this.actionInProgress=!0;let n={dataType:"submit-company-key-entity-data",payload:{id:this.id,email:this.form.value.email}};this.socketsService.sendMessage(n,"get-company-key-entity-list-result").subscribe(()=>{this.toastrService.success(this.isResend?"Email resend successfully.":"Email was changed and resended successfully."),this.ngbActiveModal.close(),this.update$.emit(this.form.value.email),this.actionInProgress=!1;},()=>{this.toastrService.error(this.isResend?"Email resend unsuccessful.":"Email change and resend unsuccessful."),this.ngbActiveModal.close(),this.actionInProgress=!1;});}ngOnDestroy(){this.differentEmailSub.unsubscribe();}};o.ɵfac=function(t){return new(t||o)(m(fe),m(K),m(Pe),m(Z));},o.ɵcmp=F({type:o,selectors:[["app-b2b-registration-resend-modal"]],outputs:{update$:"update$"},standalone:!1,decls:14,vars:5,consts:()=>{let n;n="Update email address for this account";let t;t="Resend KYC Request";let e;e="Close";let a;a="Resend";let T;return T="Update & Resend",[t,e,a,T,[1,"h5-gray","font-weight-bold"],[3,"submit","formGroup"],[1,"mb-20"],["id","email","type","text","formControlName","email","placeholder","Enter email","titleLabel","Email",3,"labelClass"],[1,"mb-30"],["id","differentEmail","formControlName","differentEmail","label",n,3,"autofocus"],[1,"d-flex"],["type","button",1,"w-50","btn","btn-outline-primary-business","btn-lg","me-15",3,"click"],[1,"w-50","btn","btn-primary-business","btn-lg","ms-15",3,"disabled"],[1,"w-50","btn","btn-primary-business","btn-lg","ms-15",3,"click","disabled"]];},template:function(t,e){t&1&&(_(0,"app-modal-header")(1,"h5",4),B(2,0),r()(),_(3,"app-modal-body")(4,"form",5),p("submit",function(){return e.submit();}),_(5,"div",6),I(6,"app-input-box",7),r(),_(7,"div",8),I(8,"app-check-box",9),r()(),_(9,"div",10)(10,"button",11),p("click",function(){return e.ngbActiveModal.close();}),B(11,1),r(),S(12,Ao,2,1,"button",12),S(13,Oo,2,1,"button",12),r()()),t&2&&(l(4),E("formGroup",e.form),l(2),E("labelClass","label-gray-300-regular"),l(2),E("autofocus",!1),l(4),u(e.form.value.differentEmail?-1:12),l(),u(e.form.value.differentEmail?13:-1));},dependencies:[ue,J,ae,q,ee,Ae,nt,ge,Se],encapsulation:2});let i=o;return i;})();var Xi=(()=>{let o=class o{transform(n,t){let e;return n==="LEGAL_ENTITY"?e="Legal entity":n==="NATURAL_PERSON"&&(e="Natural person"),t&&(e+=" "+"(admin)"),e??n;}};o.ɵfac=function(t){return new(t||o)();},o.ɵpipe=tt({name:"b2bEntityKind",type:o,pure:!0});let i=o;return i;})();var ki=(()=>{let o=class o{transform(n){return n==="DIRECTOR"?"Director":n==="LEGAL_REPRESENTATIVE"?"Legal representative":n==="NONE"?"None":n==="UBO"?"UBO":n;}};o.ɵfac=function(t){return new(t||o)();},o.ɵpipe=tt({name:"b2bEntityType",type:o,pure:!0});let i=o;return i;})();var gt=i=>({"border-bottom-none":i}),Vi=i=>({"blinking-dot--green":i}),zi=(i,o)=>o.email;function fo(i,o){if(i&1&&(_(0,"div",26)(1,"a",31),jt(2,18),A(3),r(),I(4,"a",32),r()),i&2){let s=c();l(),Mt(s.user==null?null:s.user.handle),Lt(2),l(2),G(" @",s.user==null?null:s.user.handle," ");}}
5function go(i,o){if(i&1){let s=z();_(0,"div",33),B(1,0),r(),_(2,"div",34),B(3,1),r(),_(4,"button",35),p("click",function(){M(s);let t=c();return L(t.navigate());}),B(5,2),r();}}function Co(i,o){if(i&1){let s=z();_(0,"div",33),B(1,3),r(),_(2,"div",34),B(3,4),r(),_(4,"button",35),p("click",function(){M(s);let t=c();return L(t.navigate());}),B(5,5),r();}}function Mo(i,o){if(i&1&&(_(0,"div",29)(1,"div",36)(2,"div",37),B(3,6),r(),_(4,"div",38),B(5,7),r()(),I(6,"img",39),r()),i&2){let s=c();l(5),Mt(s.user.username),Lt(5);}}function Lo(i,o){i&1&&(_(0,"div",53),B(1,13),r());}function Fo(i,o){i&1&&(_(0,"div",53),B(1,14),r());}function Go(i,o){if(i&1&&(_(0,"div",53),A(1),ce(2,"titlecase"),r()),i&2){let s=c().$implicit;l(),G(" ",Ve(2,1,s.status)," ");}}function ho(i,o){if(i&1){let s=z();_(0,"tr")(1,"td",47)(2,"div",48)(3,"div",49),A(4),r(),_(5,"div",50),A(6),r()()(),_(7,"td",47)(8,"div",48)(9,"div",49),A(10),ce(11,"b2bEntityKind"),r(),_(12,"div",50),A(13),ce(14,"b2bEntityType"),r()()(),_(15,"td",47)(16,"div",51),I(17,"div",52),S(18,Lo,2,0,"div",53),S(19,Fo,2,0,"div",53),S(20,Go,3,3,"div",53),r()(),_(21,"td",54)(22,"button",55),p("click",function(){let t=M(s).$implicit,e=c(3);return L(e.openEmailModal(t.email,t.id));}),B(23,12),r()()();}if(i&2){let s=o.$implicit;l(),E("ngClass",Y(18,gt,s.admin&&s.status==="VERIFIED")),l(3),G(" ",s.name," "),l(2),G(" ",s.email," "),l(),E("ngClass",Y(20,gt,s.admin&&s.status==="VERIFIED")),l(3),G(" ",it(11,13,s.kind,s.admin)," "),l(3),G(" ",Ve(14,16,s.type)," "),l(2),E("ngClass",Y(22,gt,s.admin&&s.status==="VERIFIED")),l(2),E("ngClass",Y(24,Vi,s.status==="VERIFIED")),l(),u(s.status==="VERIFIED"?18:-1),l(),u(s.status==="REGISTERED"?19:-1),l(),u(s.status!=="REGISTERED"&&s.status!=="VERIFIED"?20:-1),l(),E("ngClass",Y(26,gt,s.admin&&s.status==="VERIFIED")),l(),E("disabled",s.status==="VERIFIED");}}function bo(i,o){if(i&1&&(_(0,"table",44)(1,"thead")(2,"tr")(3,"th",46),B(4,9),r(),_(5,"th",46),B(6,10),r(),_(7,"th",46),B(8,11),r(),I(9,"th",46),r()(),_(10,"tbody"),te(11,ho,24,28,"tr",null,zi),r()()),i&2){let s=c(2);l(11),ie(s.peopleList);}}function yo(i,o){i&1&&(_(0,"div",53),B(1,16),r());}function vo(i,o){i&1&&(_(0,"div",53),B(1,17),r());}function $o(i,o){if(i&1&&(_(0,"div",53),A(1),ce(2,"titlecase"),r()),i&2){let s=c().$implicit;l(),G(" ",Ve(2,1,s.status)," ");}}function Do(i,o){if(i&1){let s=z();_(0,"div",48)(1,"div",56),A(2),r(),_(3,"div",57),A(4),r(),_(5,"div",58),A(6),ce(7,"b2bEntityKind"),r(),_(8,"div",57),A(9),ce(10,"b2bEntityType"),r(),_(11,"div",59),I(12,"div",52),S(13,yo,2,0,"div",53),S(14,vo,2,0,"div",53),S(15,$o,3,3,"div",53),r(),_(16,"button",60),p("click",function(){let t=M(s).$implicit,e=c(3);return L(e.openEmailModal(t.email,t.id));}),B(17,15),r(),I(18,"div",61),r();}if(i&2){let s=o.$implicit;l(2),G(" ",s.name," "),l(2),G(" ",s.email," "),l(2),G(" ",it(7,8,s.kind,s.admin)," "),l(3),G(" ",Ve(10,11,s.type)," "),l(3),E("ngClass",Y(13,Vi,s.status==="VERIFIED")),l(),u(s.status==="VERIFIED"?13:-1),l(),u(s.status==="REGISTERED"?14:-1),l(),u(s.status!=="REGISTERED"&&s.status!=="VERIFIED"?15:-1);}}function Po(i,o){if(i&1&&(_(0,"div",45),te(1,Do,19,15,"div",48,zi),r()),i&2){let s=c(2);l(),ie(s.peopleList);}}function xo(i,o){if(i&1&&(_(0,"div",30)(1,"div",40)(2,"div",41)(3,"div",42)(4,"h5",43),B(5,8),r(),S(6,bo,13,0,"table",44),S(7,Po,3,0,"div",45),r()()()()),i&2){let s=c();l(6),u(s.peopleList!=null&&s.peopleList.length?6:-1),l(),u(s.peopleList!=null&&s.peopleList.length?7:-1);}}var Ui=(()=>{let o=class o{constructor(n,t,e){this.store=n,this.router=t,this.ngbModal=e,this.step=Qe.INIT,this.BusinessAccountRegistrationStepEnum=Qe;}ngOnInit(){this.store.pipe($("user"),x(1)).subscribe(n=>{this.user=n;}),this.subscriptions=this.store.pipe($("b2b"),k(n=>n.verificationLoaded)).subscribe(n=>{switch(this.peopleList=n.verificationState.steps?.kycEntities,n.verificationState.verificationStatus){case"IN_PROCESS":this.step=Qe.UNDER_REVIEW;break;case"DECLINE":this.step=Qe.UNDER_REVIEW;break;case"INITIALIZATION":this.step=Qe.CONTINUE;break;default:this.step=Qe.INIT;break;}});}navigate(){let n=["/"+"business-account"+"/"+"registration"+"/"+"basic-company-info"];this.router.navigate(n);}openEmailModal(n,t){let a=this.ngbModal.open(wi,{size:"sm"}).componentInstance;a.email=n,a.id=t,a.update$.pipe(x(1)).subscribe(()=>this.store.dispatch(new rt()));}ngOnDestroy(){this.subscriptions.unsubscribe();}};o.ɵfac=function(t){return new(t||o)(m(y),m(W),m(qe));},o.ɵcmp=F({type:o,selectors:[["app-b2b-registration-start"]],decls:16,vars:11,consts:()=>{let n;n="/settings";let t;t="/user/"+"\uFFFD0\uFFFD"+"";let e;e="Add company details";let a;a="To finalise your account setup, you need to add some details about your company.";let T;T="Get started";let d;d="Continue adding company details";let R;R="To finalise your account setup, you need to add some details about your company.";let O;O="Continue";let f;f="Email sent";let g;g="Business account registration under review";let C;
5C="You have successfully submitted the documentation, and your Business account registration application is now under review. An email was sent to "+"\uFFFD0\uFFFD"+" with a summary of all information entered. Our team will get back to you shortly via the same email address.";let b;b="Identity verification (KYC) progress";let Q;Q="Name and email";let D;D="Type";let oe;oe="Status";let w;w="You can only resend an invite a day after sending the invite the first time. After 5 days the invitee gets reminded automatically.";let Te;Te="Resend";let de;de="Completed";let X;X="Pending";let Me;Me="You can only resend an invite a day after sending the invite the first time. After 5 days the invitee gets reminded automatically.";let Le;Le="Resend";let Re;Re="Completed";let v;return v="Pending",[e,a,T,d,R,O,g,C,b,Q,D,oe,Te,de,X,Le,Re,v,["routerLink",t],[1,"row","pe-10","ps-10","pt-10","p-lg-0"],[1,"col-12","col-xl-4","mb-30","mb-xl-0"],[1,"card","card-always-border","h-100","d-flex","flex-column","align-items-center","justify-content-between","card-corporate"],[1,"d-flex","flex-column","align-items-center","mb-20"],[1,"mb-20",3,"border","isCorporate","size"],[1,"d-flex","flex-column","align-items-center"],[1,"h5-white","d-flex","ph-no-capture"],[1,"d-flex","align-items-center","mt-20"],[1,"col-12","col-xl-8"],[1,"card","h-100","card-always-border","d-flex","flex-column"],[1,"d-flex","align-items-center","flex-column","flex-lg-row","order-last","order-lg-first"],[1,"col-12","mt-30"],[1,"link-small-primary-regular","me-5","ph-no-capture",6,"routerLink"],["routerLink",n,1,"icon-edit","fs-16","color-primary-500"],[1,"h3-black","pt-lg-30"],[1,"paragraph-gray-900-regular","pt-30","pb-30"],[1,"btn","btn-primary-business","btn-lg","me-auto",3,"click"],[1,"w-lg-50","pt-30","pt-lg-0","text-center","text-start-lg"],[1,"h3-black","pt-lg-10"],[1,"paragraph-gray-900-regular","pt-30"],["src","assets/images/illustrations/m/email-sent.svg","alt",f,"height","140",1,"w-lg-50","order-first","order-lg-last"],[1,"row","mb-30"],[1,"col-12"],[1,"card","card-always-border"],[1,"h5-black","mb-20","mb-lg-40"],[1,"d-none","d-md-table"],[1,"d-md-none","d-flex","flex-column"],[1,"text-start","paragraph-black-regular"],[1,"ph-no-capture",3,"ngClass"],[1,"d-flex","flex-column"],[1,"paragraph-black-bold"],[1,"paragraph-gray-900-regular"],[1,"d-flex","align-items-center"],[1,"blinking-dot","me-5",3,"ngClass"],[1,"paragraph-black-regular"],[1,"ph-no-capture","text-end",3,"ngClass"],["ngbTooltip",w,1,"btn","btn-small","btn-outline-primary-business",3,"click","disabled"],[1,"paragraph-black-bold","mt-20","mb-5"],[1,"paragraph-gray-900-regular","mb-10"],[1,"paragraph-black-bold","mb-5"],[1,"d-flex","align-items-center","mb-10"],["ngbTooltip",Me,1,"btn","btn-small","btn-outline-primary-business","mb-20",3,"click"],[1,"separator-gray-100","mt-10","mb-10"]];},template:function(t,e){t&1&&(_(0,"div",19)(1,"div",20)(2,"div",21)(3,"div",22),I(4,"app-user-avatar-placeholder",23),_(5,"div",24)(6,"div",25),A(7),ce(8,"capitalize"),r(),S(9,fo,5,2,"div",26),r()()()(),_(10,"div",27)(11,"div",28),S(12,go,6,0),S(13,Co,6,0),S(14,Mo,7,1,"div",29),r()(),S(15,xo,8,2,"div",30),r()),t&2&&(l(4),E("border",!0)("isCorporate",e.user==null?null:e.user.corporateLogin)("size",90),l(3),G(" ",Ve(8,9,e.user==null?null:e.user.username)," "),l(2),u(e.user.isCorporateVerified?9:-1),l(3),u(e.step===e.BusinessAccountRegistrationStepEnum.INIT?12:-1),l(),u(e.step===e.BusinessAccountRegistrationStepEnum.CONTINUE?13:-1),l(),u(e.step===e.BusinessAccountRegistrationStepEnum.UNDER_REVIEW?14:-1),l(),u(e.step===e.BusinessAccountRegistrationStepEnum.UNDER_REVIEW?15:-1));},dependencies:[me,j,re,Bi,Qt,Ii,ki,Xi],styles:[`.border-bottom-none[_ngcontent-%COMP%]{border-bottom:0}.notice[_ngcontent-%COMP%]{background-color:var(--primary-50);border-radius:10px}
6/*# sourceMappingURL=b2b-registration-start.component-PHRBEN4E.css.map */`]});let i=o;return i;})(),Qe=function(i){return i[i.INIT=0]="INIT",i[i.CONTINUE=1]="CONTINUE",i[i.UNDER_REVIEW=2]="UNDER_REVIEW",i;}(Qe||{});var Yi=()=>{let i=Be(y),o=Be(W);return i.dispatch(new rt()),i.pipe($("b2b"),k(s=>s.verificationLoaded),x(1),ve(s=>(s?.verificationState.verificationStatus==="VERIFIED"&&o.navigate(["/dashboard"]),!0)));};var wo=["fileInput"],Xo=i=>({"btn-loading":i});function ko(i,o){if(i&1&&I(0,"app-check-box",23),i&2){let s=o.$implicit;E("formControlName",s.value)("id",s.value)("label",s.label);}}function Vo(i,o){if(i&1&&(_(0,"div",24),A(1),r()),i&2){let s=c();l(),G(" ",s.errorMsg," ");}}function zo(i,o){i&1&&(_(0,"div",25),I(1,"app-input-box",51),r()),i&2&&(l(),E("id","sourceOther"));}function Uo(i,o){if(i&1&&(_(0,"div")(1,"div",52),A(2),I(3,"i",53),r()()),i&2){let s=o.$implicit;l(2),G(" ",s.name," ");}}function Yo(i,o){if(i&1&&(_(0,"div",46),te(1,Uo,4,1,"div",null,pe),r()),i&2){let s=c();l(),ie(s.form.get("files").value);}}var Hi=(()=>{let o=class o{constructor(n,t,e,a,T,d){this.formBuilder=n,this.socketsService=t,this.toastrService=e,this.store=a,this.router=T,this.httpService=d,this.supportedFormats=["application/pdf"],this.supportedExtensions=[".pdf"],this.documentMessages={unsupportedImageType:"Unsupported format.",fileToLarge:"Unsupported format. PDF only."},this.alreadySubmittedFiles=[];}get uploadFiles(){return this.form.get("files");}ngOnInit(){this.store.pipe($("user"),k(n=>!!n.aml),Ct()).subscribe(n=>{this.options=n.aml.options,this.amlData=n.aml,this.init();});}
6ngOnDestroy(){this.formValueChangeSub&&this.formValueChangeSub.unsubscribe(),this.otherValueChangeSub&&this.otherValueChangeSub.unsubscribe();}init(){this.form=this.formBuilder.group({sourceOther:"",annualDeposit:null,annualTransaction:null,primaryIndustry:null,operationalStatus:null,annualRevenue:null,netWorth:null,explanation:[],files:this.formBuilder.array([])}),this.options.sourceKind?.forEach(e=>{this.form.addControl(e.value,this.formBuilder.control(null));});let n=this.form.get("OTHER");n&&(this.otherValueChangeSub=n.valueChanges.subscribe(e=>{this.showSourceOtherInput=e;let a=this.form.get("sourceOther");e?a.setValidators(N.required):(a.setValue(""),a.clearValidators());})),this.form.reset(this.amlData,{emitEvent:!1}),this.amlData?.sourceKinds?.forEach(e=>{let a=this.form.get(e);a&&a.setValue(!0,{emitEvent:!1});}),this.showSourceOtherInput=!!this.amlData.sourceOther,this.formValueChangeSub=this.form.valueChanges.subscribe(()=>{this.errorMsg=null;});let t={dataType:"aml-get-source-of-funds-documents",payload:{}};this.socketsService.sendMessage(t,"sof-documents").subscribe(e=>{let T=e["sof-documents"].payload.documents.map(d=>{let R=new Blob([],{type:d.mimeType}),O=new File([R],d.fileName,{type:d.mimeType});return this.uploadFiles.push(this.formBuilder.control(O)),O;});this.alreadySubmittedFiles=T;},()=>{this.toastrService.error("Something went wrong. Couldn't fetch saved files!");});}getQuestionnaireRequest(){let n=this.options.sourceKind.map(a=>this.form.get(a.value).value?a.value:null).filter(a=>a),t={operationalStatus:this.form.get("operationalStatus").value,primaryIndustry:this.form.get("primaryIndustry").value,annualRevenue:this.form.get("annualRevenue").value,annualDeposit:this.form.get("annualDeposit").value,annualTransaction:this.form.get("annualTransaction").value,netWorth:this.form.get("netWorth").value,sourceKinds:n},e=this.form.get("sourceOther").value;return e&&(t.sourceOther=e),t;}saveAndExit(){let n=["/"+"business-account"+"/"+"registration"];this.form.get("operationalStatus").setValidators([N.required]),this.form.get("primaryIndustry").setValidators([N.required]),this.form.get("annualRevenue").setValidators([N.required]),this.form.get("annualDeposit").setValidators([N.required]),this.form.get("annualTransaction").setValidators([N.required]),this.form.get("explanation").setValidators(N.required),this.form.get("netWorth").setValidators(N.required),U.validateAllFormFields(this.form);let t=this.form.value,e=t.files.filter(a=>!this.alreadySubmittedFiles.some(T=>T.lastModified===a.lastModified));this.form.valid?this.submitSofSowAndUploadFile(t,n,e):U.validateAllFormFields(this.form);}submit(){let n=["/"+"business-account"+"/"+"registration"+"/"+"account-admin"];if(!this.form.touched&&!this.amlData.previousSofRejected)this.router.navigate(n);else{this.form.get("operationalStatus").setValidators([N.required]),this.form.get("primaryIndustry").setValidators([N.required]),this.form.get("annualRevenue").setValidators([N.required]),this.form.get("annualDeposit").setValidators([N.required]),this.form.get("annualTransaction").setValidators([N.required]),this.form.get("explanation").setValidators(N.required),this.form.get("netWorth").setValidators(N.required),U.validateAllFormFields(this.form);let t=!1;this.options.sourceKind.forEach(T=>{t=t||this.form.get(T.value).value;});let e=this.form.value;e.files?.length===0&&this.form.get("files").setErrors({required:!0});let a=e.files.filter(T=>!this.alreadySubmittedFiles.some(d=>d.lastModified===T.lastModified));this.form.valid&&t&&e.explanation&&e.files?.length>0?(this.actionInProgress=!0,this.uploadInProgress=!0,this.submitSofSowAndUploadFile(e,n,a)):(U.validateAllFormFields(this.form),t||(this.errorMsg="Select at least one of your source of funds."));}}submitSofSowAndUploadFile(n,t,e){let a={dataType:"aml-submit-source-of-funds",payload:Ue(se({},this.getQuestionnaireRequest()),{explanation:n.explanation??""})},T=Et(null);e.length>0&&(T=Vt(...e.map(d=>this.httpService.uploadSourceOfFundsFile(d).pipe(Ct()))).pipe(zt((d,R)=>[...d,R.data.status],[]),ct(d=>e.length!==d.length))),T.pipe(mt(()=>
6this.socketsService.sendMessage(a,"aml-source-of-funds-details"))).subscribe(d=>{let R=d["aml-source-of-funds-details"].payload;this.store.dispatch(oi({data:R})),this.store.dispatch(ni()),this.toastrService.success("Successfully saved!"),this.router.navigate(t);},()=>{this.onError();});}onError(){this.actionInProgress=!1,this.uploadInProgress=!1,this.toastrService.error("Something went wrong. Please try again.");}fileSelected(n){let t=n.target.files;if(t.length===0)return;let e=this.formBuilder.control(t[0]);this.documentErrors=Object.keys(se(se({},Ti(7e6)(e)),di(this.supportedFormats)(e))).map(a=>this.documentMessages[a]),!(this.documentErrors.length>0)&&(this.uploadFiles.push(this.formBuilder.control(t[0])),this.form.get("files").markAsTouched());}openFileInput(){this.fileInput.nativeElement.click();}};o.ɵfac=function(t){return new(t||o)(m(Oe),m(K),m(Z),m(y),m(W),m(Rt));},o.ɵcmp=F({type:o,selectors:[["app-b2b-registration-financial-details"]],viewQuery:function(t,e){if(t&1&&He(wo,5),t&2){let a;je(a=We())&&(e.fileInput=a.first);}},standalone:!1,decls:63,vars:18,consts:()=>{let n;n="Type Annual Revenue";let t;t="What is your company's annual revenue? (in EUR)";let e;e="Select Status";let a;a="What is the current operational status of your company?";let T;T="Specify Primary Industry";let d;d="What is the primary industry in which your company operates?";let R;R="Please select";let O;O="What is your company's net worth?";let f;f="Please select";let g;g="What is your company's estimated annual sum of all deposits to the platform?";let C;C="Please select";let b;b="What is your company\u2019s estimated annual number of deposits to and withdrawals from the platform?";let Q;Q="Explain your company's source of wealth in a few words";let D;D="Please describe your company's source of wealth";let oe;oe="Upload Document";let w;w="/business-account/registration/basic-company-info";let Te;Te="Financial details";let de;de="What is your company's primary source of funds? (Select all that apply to your business.)";let X;X="Financial statement";let Me;Me="Upload one or multiple documents to support your explanation above (max. 5MB, pdf only)";let Le;Le="Accepted documents/proofs:";let Re;Re="- Operating Revenue,"+"[\uFFFD#40\uFFFD\uFFFD/#40\uFFFD|\uFFFD#41\uFFFD\uFFFD/#41\uFFFD|\uFFFD#42\uFFFD\uFFFD/#42\uFFFD]"+" - Loans,"+"[\uFFFD#40\uFFFD\uFFFD/#40\uFFFD|\uFFFD#41\uFFFD\uFFFD/#41\uFFFD|\uFFFD#42\uFFFD\uFFFD/#42\uFFFD]"+" - Investor Capital,"+"[\uFFFD#40\uFFFD\uFFFD/#40\uFFFD|\uFFFD#41\uFFFD\uFFFD/#41\uFFFD|\uFFFD#42\uFFFD\uFFFD/#42\uFFFD]"+" - Grants",Re=dt(Re);let v;v="- Franchise Fees,"+"[\uFFFD#45\uFFFD\uFFFD/#45\uFFFD|\uFFFD#46\uFFFD\uFFFD/#46\uFFFD|\uFFFD#47\uFFFD\uFFFD/#47\uFFFD]"+" - Leasing or Renting Assets,"+"[\uFFFD#45\uFFFD\uFFFD/#45\uFFFD|\uFFFD#46\uFFFD\uFFFD/#46\uFFFD|\uFFFD#47\uFFFD\uFFFD/#47\uFFFD]"+" - Royalties and Licensing Fees,"+"[\uFFFD#45\uFFFD\uFFFD/#45\uFFFD|\uFFFD#46\uFFFD\uFFFD/#46\uFFFD|\uFFFD#47\uFFFD\uFFFD/#47\uFFFD]"+" etc.",v=dt(v);let V;V="Upload a document";let at;at="Save and exit";let st;st="Back";let lt;lt="Next";let Tt;return Tt="Please Specify Here",[["fileInput",""],Te,de,X,Me,Le,Re,v,V,at,st,lt,[1,"d-flex","justify-content-center","mb-30"],[1,"me-10","ms-10","me-0","ms-0","w-100","w-lg-50"],[1,"card","card-always-border"],[3,"ngSubmit","formGroup"],[1,"h3-black","mb-30"],[1,"mb-30"],["id","annualRevenue","type","text","formControlName","annualRevenue","placeholder",n,"titleLabel",t],["bindLabel","label","bindValue","value","placeholder",e,"titleLabel",a,3,"items","ngControl"],["id","primaryIndustry","type","text","formControlName","primaryIndustry","placeholder",T,"titleLabel",d],[1,"label-black-regular","mb-10"],[1,"checkbox-grid"],[3,"formControlName","id","label"],[1,"mt-10","label-error-regular"],[1,"mt-10"],[1,"mb-20"],["bindLabel","label","bindValue","value","placeholder",R,"titleLabel",O,3,"items","ngControl"],["bindLabel","label","bindValue","value","placeholder",f,"titleLabel",g,3,"items","ngControl"],[1,"mb-40"],["bindLabel","label","bindValue","value","placeholder",C,"titleLabel",b,3,"items","ngControl"],["id","explanation","type","text","formControlName","explanation","placeholder",Q,"titleLabel",D],[1,"d-flex","flex-column","mb-30"],[1,"h6-black","mt-10","mb-5"],[1,"paragraph-black-regular","fs-12"],[1,"action-notice","mt-15","mb
6-15"],[1,"d-flex","flex-column","label-black-regular"],[1,"label-black-bold","mb-15","text-start"],[1,"d-flex"],[1,"text-start","w-50","me-20"],[1,"text-start"],[1,"d-flex","w-100"],[1,"w-75","cursor-pointer",3,"click"],["id","files","type","text","formControlName","files","clazz","cursor-pointer","placeholder",oe,3,"readonly"],["type","button",1,"btn","btn-lg","btn-outline-primary-business","w-25","ms-15","p-0",3,"click"],["type","file","accept","application/pdf",1,"d-none",3,"change"],[1,"mt-5"],["type","button",1,"w-100","btn","btn-outline-black","btn-lg",3,"click","disabled"],[1,"d-flex","mt-30"],["routerLink",w,1,"w-50","btn","btn-secondary-business","btn-lg","me-15"],["type","submit",1,"btn","btn-primary-business","btn-lg","w-50","ms-15",3,"disabled","ngClass"],["type","text","formControlName","sourceOther","placeholder",Tt,3,"id"],[1,"color-primary-700-business","mb-5"],[1,"icon-checked","fs-20"]];},template:function(t,e){if(t&1){let a=z();_(0,"div",12)(1,"div",13)(2,"div",14)(3,"form",15),p("ngSubmit",function(){return M(a),L(e.submit());}),_(4,"h3",16),B(5,1),r(),_(6,"div",17),I(7,"app-input-box",18),r(),_(8,"div",17),I(9,"app-select-box",19),r(),_(10,"div",17),I(11,"app-input-box",20),r(),_(12,"div",17)(13,"div",21),B(14,2),r(),_(15,"div",22),te(16,k
6o,1,3,"app-check-box",23,pe),r(),S(18,Vo,2,1,"div",24),S(19,zo,2,1,"div",25),r(),_(20,"div",26),I(21,"app-select-box",27),r(),_(22,"div",17),I(23,"app-select-box",28),r(),_(24,"div",29),I(25,"app-select-box",30),r(),_(26,"div",17),I(27,"app-input-box",31),r(),_(28,"div",32)(29,"h6",33),B(30,3),r(),_(31,"div",34),B(32,4),r(),_(33,"div",35)(34,"div",36)(35,"div",37),B(36,5),r(),_(37,"div",38)(38,"div",39),Ie(39,6),I(40,"br")(41,"br")(42,"br"),Ee(),r(),_(43,"div",40),Ie(44,7),I(45,"br")(46,"br")(47,"br"),Ee(),r()()()(),_(48,"div",41)(49,"div",42),p("click",function(d){return M(a),d.preventDefault(),L(e.openFileInput());}),I(50,"app-input-box",43),r(),_(51,"button",44),p("click",function(d){return M(a),d.preventDefault(),L(e.openFileInput());}),B(52,8),r()(),_(53,"input",45,0),p("change",function(d){return M(a),L(e.fileSelected(d));}),r(),S(55,Yo,3,0,"div",46),r(),_(56,"button",47),p("click",function(){return M(a),L(e.saveAndExit());}),B(57,9),r(),_(58,"div",48)(59,"a",49),B(60,10),r(),_(61,"button",50),B(62,11),r()()()()()();}if(t&2){let a;l(3),E("formGroup",e.form),l(6),E("items",e.options.operationalStatus)("ngControl",e.form.get("operationalStatus")),l(7),ie(e.options.sourceKind),l(2),u(e.errorMsg?18:-1),l(),u(e.showSourceOtherInput?19:-1),l(2),E("items",e.options.netWorth)("ngControl",e.form.get("netWorth")),l(2),E("items",e.options.annualDeposit)("ngControl",e.form.get("annualDeposit")),l(2),E("items",e.options.annualTransaction)("ngControl",e.form.get("annualTransaction")),l(25),E("readonly",!0),l(5),u(!(e.form==null||(a=e.form.get("files"))==null)&&a.value?55:-1),l(),E("disabled",!e.form.touched||e.actionInProgress),l(5),E("disabled",e.actionInProgress)("ngClass",Y(16,Xo,e.actionInProgress));}},dependencies:[j,re,ue,Xe,J,ae,q,ee,Ae,nt],styles:[`.checkbox-grid[_ngcontent-%COMP%]{display:grid;grid-column-gap:10px;grid-row-gap:10px;grid-template-columns:repeat(2,1fr)}.proof-file[_ngcontent-%COMP%]{border:1px solid var(--primary-700);border-radius:8px;word-break:break-all}.proof-file-invalid[_ngcontent-%COMP%]{border:1px solid var(--negative-500)}.upload-document[_ngcontent-%COMP%]{border:2px dashed var(--gray-300);border-radius:8px}.upload-document.error[_ngcontent-%COMP%]{border:2px dashed var(--error-500)}.upload-document[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{cursor:pointer;height:100%;opacity:0;position:absolute;width:100%}
7/*# sourceMappingURL=b2b-registration-financial-details.component-AAE4LEVZ.css.map */`]});let i=o;return i;})();var Ho=i=>({"btn-loading":i}),ji=(()=>{let o=class o{constructor(n,t,e,a,T){this.formBuilder=n,this.socketsService=t,this.store=e,this.router=a,this.toastrService=T,this.form=this.formBuilder.group({differentAdmin:null,name:[{value:null}],email:[{value:null}],type:null,id:null});}ngOnInit(){this.store.pipe($("b2b"),k(n=>n.verificationLoaded),x(1)).subscribe(n=>{if(n.verificationState.steps){let t=Ye(n.verificationState.steps?.admin.admin,[]);this.admin=t[0][0].filter(e=>e.admin)[0],this.allAdmins=t[0][0],this.openerId=t[0][1],this.form.get("differentAdmin").setValue(this.admin?.id!==this.openerId,{onlySelf:!0,emitEvent:!1}),this.setLabels(this.admin?.id===this.openerId),this.form.get("name").setValue(this.admin?.name,{onlySelf:!0,emitEvent:!1}),this.form.get("email").setValue(this.admin?.email,{onlySelf:!0,emitEvent:!1}),this.form.get("type").setValue(this.admin?.type,{onlySelf:!0,emitEvent:!1}),this.form.get("id").setValue(this.admin?.id,{onlySelf:!0,emitEvent:!1}),this.admin?.id!==this.openerId?(this.form.get("name").enable(),this.form.get("email").enable()):(this.form.get("name").disable(),this.form.get("email").disable()),this.form.markAsUntouched();}}),this.differentAdminSub=this.form.get("differentAdmin").valueChanges.subscribe(n=>{if(n){let t=this.allAdmins.find(e=>e.id!==this.openerId&&e.admin);t?(this.form.get("name").setValue(t?.name,{onlySelf:!0,emitEvent:!1}),this.form.get("email").setValue(t?.email,{onlySelf:!0,emitEvent:!1}),this.form.get("type").setValue(t?.type,{onlySelf:!0,emitEvent:!1}),this.form.get("id").setValue(t?.id,{onlySelf:!0,emitEvent:!1})):(this.form.get("name").setValue("",{onlySelf:!0,emitEvent:!1}),this.form.get("email").setValue("",{onlySelf:!0,emitEvent:!1}),this.form.get("type").setValue("",{onlySelf:!0,emitEvent:!1}),this.form.get("id").setValue("",{onlySelf:!0,emitEvent:!1})),this.form.get("name").enable(),this.form.get("email").enable(),this.setLabels(!0);}else{let t=this.allAdmins.find(e=>e.id===this.openerId);this.form.get("name").setValue(t?.name,{onlySelf:!0,emitEvent:!1}),this.form.get("email").setValue(t?.email,{onlySelf:!0,emitEvent:!1}),this.form.get("type").setValue(t?.type,{onlySelf:!0,emitEvent:!1}),this.form.get("id").setValue(t?.id,{onlySelf:!0,emitEvent:!1}),this.form.get("name").disable(),this.form.get("email").disable(),this.setLabels(!1);}});}setLabels(n){n?(this.radioButtonLabel="Is this person a legal representative or director of the company?",this.types=[{label:"Yes, director",value:"DIRECTOR",disabled:!1},{label:"Yes, a legal representative, but not director",value:"LEGAL_REPRESENTATIVE",disabled:!1},{label:"No",value:"NONE",disabled:!1}]):(this.radioButtonLabel="Are you a legal representative or director of a company",this.types=[{label:"Yes, I am a director",value:"DIRECTOR",disabled:!1},{label:"Yes, I can represent the Company, but I am not a Director",value:"LEGAL_REPRESENTATIVE",disabled:!1},{label:"No",value:"NONE",disabled:!1}]);}saveAndExit(){let n=["/"+"business-account"+"/"+"registration"];this.update(n,this.actionInProgressSaveAndExit);}update(n,t){if(this.form.get("name").setValidators([N.required]),this.form.get("email").setValidators([N.required,N.email]),this.form.get("type").setValidators([N.required]),U.validateAllFormFields(this.form),this.form.valid){t=!0;let e={dataType:"submit-company-key-entity-data",payload:{admin:!0,name:this.form.get("name").value,email:this.form.get("email").value,id:this.form.get("id").value??void 0,type:this.form.get("type").value,kind:"NATURAL_PERSON"}};this.socketsService.sendMessage(e,"get-company-key-entity-list-result").subscribe(()=>{this.router.navigate(n),t=!1,this.toastrService.success("Admin successfuly saved!");},()=>{t=!1,this.toastrService.error("Something went wrong. Check that you filled all inputs and please try again.");});}}submit(){let n=["/"+"business-account"+"/"+"registration"+"/"+"authorized-representatives"];this.update(n,this.actionInProgress);}
7ngOnDestroy(){this.differentAdminSub.unsubscribe();}};o.ɵfac=function(t){return new(t||o)(m(Oe),m(K),m(y),m(W),m(Z));},o.ɵcmp=F({type:o,selectors:[["app-b2b-registration-admin"]],standalone:!1,decls:20,vars:8,consts:()=>{let n;n="Enter another person as administrator";let t;t="Enter full name";let e;e="Name and surname";let a;a="Enter email";let T;T="Email";let d;d="/business-account/registration/financial-details";let R;R="Account administrator";let O;O="Save and exit";let f;f="Back";let g;return g="Next",[R,O,f,g,[1,"d-flex","justify-content-center","mb-30"],[1,"me-10","ms-10","me-0","ms-0","w-100","w-lg-50"],[1,"card","card-always-border"],[3,"ngSubmit","formGroup"],[1,"h3-black","mb-30"],[1,"mb-30"],["id","differentAdmin","formControlName","differentAdmin","label",n],["id","name","type","text","formControlName","name","placeholder",t,"titleLabel",e],["id","email","type","text","formControlName","email","placeholder",a,"titleLabel",T],["id","types","name","types","formControlName","type","orientation","vertical",3,"items","titleLabel"],["type","button",1,"w-100","btn","btn-outline-black","btn-lg","mt-50",3,"click","disabled"],[1,"d-flex","mt-30"],["routerLink",d,1,"w-50","btn","btn-secondary-business","btn-lg","me-15"],["type","submit",1,"btn","btn-primary-business","btn-lg","w-50",3,"disabled","ngClass"]];},template:function(t,e){t&1&&(_(0,"div",4)(1,"div",5)(2,"div",6)(3,"form",7),p("ngSubmit",function(){return e.submit();}),_(4,"h3",8),B(5,0),r(),_(6,"div",9),I(7,"app-check-box",10),r(),_(8,"div",9),I(9,"app-input-box",11),r(),_(10,"div",9),I(11,"app-input-box",12),r(),I(12,"app-radio-button-list",13),_(13,"button",14),p("click",function(){return e.saveAndExit();}),B(14,1),r(),_(15,"div",15)(16,"a",16),B(17,2),r(),_(18,"button",17),B(19,3),r()()()()()()),t&2&&(l(3),E("formGroup",e.form),l(9),E("items",e.types)("titleLabel",e.radioButtonLabel),l(),E("disabled",!e.form.touched||e.actionInProgress),l(5),E("disabled",e.actionInProgress)("ngClass",Y(6,Ho,e.actionInProgress)));},dependencies:[j,re,ue,J,ae,q,ee,Ae,nt,ot],encapsulation:2});let i=o;return i;})();var Wi=(()=>{let o=class o{};o.ɵfac=function(t){return new(t||o)();},o.ɵmod=et({type:o}),o.ɵinj=Je({imports:[_e.forChild([{path:"",canActivate:[ri,Ei,Li],component:Si,children:[{path:"",redirectTo:"reports",pathMatch:"full"},{path:"reports",component:Ai,canActivate:[Fi],data:{page:"b2b-reports"}},{path:"team",component:Mi,canActivate:[Gi],data:{page:"b2b-team"}},{path:"registration",component:hi,children:[{path:"",component:Ui,canActivate:[Yi],data:{page:"b2b-registration"}},{path:"basic-company-info",component:bi,canActivate:[Ze],data:{page:"b2b-registration-basic-company-info"}},{path:"financial-details",component:Hi,canActivate:[Ze],data:{page:"b2b-registration-financial-details"}},{path:"account-admin",component:ji,canActivate:[Ze],data:{page:"b2b-registration-account-admin"}},{path:"beneficial-owners",component:yi,canActivate:[Ze],data:{page:"b2b-registration-beneficial-owners"}},{path:"authorized-representatives",component:$i,canActivate:[Ze],data:{page:"b2b-registration-authorized-representatives"}},{path:"natural-persons",component:Di,canActivate:[Ze],data:{page:"b2b-registration-natural-persons"}},{path:"legal-entities",component:Pi,canActivate:[Ze],data:{page:"b2b-registration-legal-entities"}}]}]}])]});let i=o;return i;})();var ql=(()=>{let o=class o{};o.ɵfac=function(t){return new(t||o)();},o.ɵmod=et({type:o}),o.ɵinj=Je({imports:[me,_e,Ce,Wi,ui,ai,Se]});let i=o;return i;})();export{ql as B2bModule};/**i18n:8c51c29c11b6c1ba32fec7ee9cf9df348d7633865b41235a69c218d60eb68b29*///# sourceMappingURL=chunk-RLUTX4Y2.js.map

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.