(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4e3ea42e"],{"0208":function(e,t,a){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r="web"===e.env.BUILD?a("fad9").withParams:a("5510").withParams,n=r;t.default=n}).call(this,a("e6ae"))},"0411":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"alpha",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"alphaNum",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"numeric",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"between",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"email",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"ipAddress",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"macAddress",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"maxLength",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"minLength",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"required",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"requiredIf",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(t,"requiredUnless",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(t,"sameAs",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(t,"url",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(t,"or",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(t,"and",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(t,"not",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(t,"minValue",{enumerable:!0,get:function(){return $.default}}),Object.defineProperty(t,"maxValue",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(t,"integer",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(t,"decimal",{enumerable:!0,get:function(){return O.default}}),t.helpers=void 0;var r=j(a("dc6f")),n=j(a("c04e")),o=j(a("2a96")),i=j(a("c02a")),s=j(a("251c")),u=j(a("609e")),l=j(a("1f69")),c=j(a("68e8")),d=j(a("932d8")),f=j(a("b03d")),m=j(a("1caf")),b=j(a("40f9")),p=j(a("c81c")),h=j(a("433f")),v=j(a("f0b7")),y=j(a("baef")),g=j(a("9c93")),$=j(a("43b2")),x=j(a("8cb0")),_=j(a("78a6")),O=j(a("2f62")),D=N(a("5b37"));function N(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,a):{};r.get||r.set?Object.defineProperty(t,a,r):t[a]=e[a]}return t.default=e,t}function j(e){return e&&e.__esModule?e:{default:e}}t.helpers=D},"0754":function(e,t,a){"use strict";a.d(t,"a",(function(){return o}));var r=a("94c8");const n=function(){const e=this.$vnode.componentOptions.Ctor.options.__validations||{},t={};for(const a in e){if(!e.hasOwnProperty(a))continue;let r=e[a];"__validations__"===a&&(r=this[r]),"function"===typeof r&&(r=r.call(this)),"__validations__"===a?Object.assign(t,r):t[a]=r}return t};function o(){return Object(r["a"])((e,t)=>{e.__validations||(e.__validations={}),e.__validations["__validations__"]=t,e.validations=n})}},"1caf":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a("5b37"),n=function(e){return(0,r.withParams)({type:"requiredIf",prop:e},(function(t,a){return!(0,r.ref)(e,this,a)||(0,r.req)(t)}))};t.default=n},"1f69":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a("5b37"),n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:":";return(0,r.withParams)({type:"macAddress"},(function(t){if(!(0,r.req)(t))return!0;if("string"!==typeof t)return!1;var a="string"===typeof e&&""!==e?t.split(e):12===t.length||16===t.length?t.match(/.{2}/g):null;return null!==a&&(6===a.length||8===a.length)&&a.every(o)}))};t.default=n;var o=function(e){return e.toLowerCase().match(/^[0-9a-f]{2}$/)}},"20d0":function(e,t,a){"use strict";var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"bg-white shadow-md-new rounded"},[a("div",{staticClass:"py-12 px-16 border-b border-neutral-200 leading-none text-neutral-600"},[a("h2",{staticClass:"text-2xl font-bold mb-6"},[e._v(e._s(e.title))]),a("p",{staticClass:"font-bold mb-2"},[e._v(" "+e._s(e.accountInfo.bankName)+" "+e._s(e.accountInfo.accountNumber)+" ")]),a("p",{staticClass:"font-ubuntu font-light mb-3 text-sm"},[e._v(" ID: "+e._s(e.accountInfo.id)+" ")]),a("copy-button",{staticClass:"font-ubuntu font-medium py-1 text-main-secondary",attrs:{value:e.accountInfo.id}},[a("translate",[e._v("Copy ID")])],1),a("hr",{staticClass:"my-6 border-neutral-200"}),a("p",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"text-neutral-500 mb-3 font-bold"},[e._v("Details")]),e._l(e.summaryDetails,(function(t,r){return[t.content&&t.content.length?a("div",{key:"summary-"+r,staticClass:"flex mb-3 last:mb-0 text-sm font-ubuntu"},[a("p",{staticClass:"leading-5.5 w-2/5 text-neutral-400 font-medium"},[e._v(" "+e._s(t.label)+" ")]),a("div",{staticClass:"leading-5.5 flex-1 font-light"},[Array.isArray(t.content)?[e._l(t.content,(function(t,n){return[t?a("p",{key:"summary"+r+"-"+n},[e._v(" "+e._s(t)+" ")]):e._e()]}))]:[e._v(" "+e._s(t.content)+" ")]],2)]):e._e()]}))],2),a("div",{staticClass:"py-6 px-16 flex font-ubuntu"},[a("button",{staticClass:"text-main-primary font-medium mr-6",on:{click:function(t){return e.$emit("onDone")}}},[a("translate",[e._v("Done")])],1),a("button",{staticClass:"text-neutral-500 font-medium",on:{click:function(t){return e.$emit("onAddAnother")}}},[a("translate",[e._v("Add Another Account")])],1)])])},n=[],o=a("4903"),i=a("e98f"),s=a("3617");let u=class extends i["f"]{};Object(o["a"])([Object(i["c"])({type:String,default:""})],u.prototype,"title",void 0),Object(o["a"])([Object(i["c"])({type:Object,default:{}})],u.prototype,"accountInfo",void 0),Object(o["a"])([Object(i["c"])({type:Array,default:()=>[]})],u.prototype,"summaryDetails",void 0),u=Object(o["a"])([Object(i["a"])({name:"bankAccountSummary",components:{CopyButton:s["a"]}})],u);var l=u,c=l,d=a("d8ae"),f=Object(d["a"])(c,r,n,!1,null,null,null);t["a"]=f.exports},"251c":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a("5b37"),n=/^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/,o=(0,r.regex)("email",n);t.default=o},"2a96":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a("5b37"),n=(0,r.regex)("numeric",/^[0-9]*$/);t.default=n},"2f62":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a("5b37"),n=(0,r.regex)("decimal",/^[-]?\d*(\.\d+)?$/);t.default=n},"40f9":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a("5b37"),n=function(e){return(0,r.withParams)({type:"requiredUnless",prop:e},(function(t,a){return!!(0,r.ref)(e,this,a)||(0,r.req)(t)}))};t.default=n},"41d7":function(e,t,a){"use strict";a.d(t,"b",(function(){return n})),a.d(t,"a",(function(){return i}));var r=a("93f3");const n=e=>!/[`'"=|!@#$%^&*()_+{}\[\]:;<>,.?~\\\-/]/.test(e),o=Object.values(r["b"]).map(e=>e.substring(1)),i=e=>{for(const t of o)if(e.startsWith(t))return!1;return!0}},"433f":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a("5b37"),n=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:[/?#]\S*)?$/i,o=(0,r.regex)("url",n);t.default=o},"43b2":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a("5b37"),n=function(e){return(0,r.withParams)({type:"minValue",min:e},(function(t){return!(0,r.req)(t)||(!/\s/.test(t)||t instanceof Date)&&+t>=+e}))};t.default=n},"48d4":function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("div",{staticClass:"-mx-6 px-6 py-4 border-b border-neutral-300"},[a("breadcrumb",{staticClass:"mb-3",attrs:{items:e.navigations}}),a("h2",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"text-2xl leading-none font-bold"},[e._v(" Add Destination Account ")])],1),a("div",{staticClass:"py-8"},[e.showSummary?a("div",{staticClass:"max-w-xl m-auto"},[a("Summary",{attrs:{title:e.$gettext("Destination Account Added"),"account-info":e.summaryData.accountInfo,"summary-details":e.summaryData.summaryDetails},on:{onDone:e.onDone,onAddAnother:e.onAddAnother}})],1):a("div",{staticClass:"max-w-3xl m-auto"},[e.fetchingDirectData?a("div",{staticClass:"flex flex-col justify-center items-center h-full"},[a("lottie-animation",{attrs:{name:"LoadingBlueCircle"}})],1):[e.errorMsg?a("message",{staticClass:"mb-4",attrs:{"auto-close":!1,type:"error",title:e.errorMsg}}):e._e(),a("account-form",{attrs:{"init-form-values":e.initFormValues,loading:e.isSubmitting},on:{success:e.handleSubmit,error:e.showError}})]],2)])])},n=[],o=a("4903"),i=a("ae53"),s=a("e98f"),u=a("841e"),l=a("3882"),c=a("ebe2"),d=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("form",{staticClass:"bg-white shadow-md-new rounded",on:{submit:function(t){return t.preventDefault(),e.onSubmit.apply(null,arguments)}}},[a("div",{staticClass:"py-10 px-16 border-b border-neutral-200"},[a("p",{staticClass:"font-bold text-main-primary mb-6"},[e._v("Bank")]),a("div",{staticClass:"grid grid-cols-2 gap-12"},[a("TextInput",{staticClass:"w-full",attrs:{"data-testid":"country",label:e.$gettext("Country"),error:e.$v.formData.country.$error&&e.$gettext("Select country of operations on the Direct Settings page.")||"",disabled:!0},model:{value:e.$v.formData.country.$model,callback:function(t){e.$set(e.$v.formData.country,"$model",t)},expression:"$v.formData.country.$model"}}),a("Dropdown",{staticClass:"w-full",attrs:{options:e.bankOptions,title:e.labels.bank,"data-testid":"bank",error:e.$v.formData.bank.$error?"Select a bank.":""},model:{value:e.$v.formData.bank.$model,callback:function(t){e.$set(e.$v.formData.bank,"$model","string"===typeof t?t.trim():t)},expression:"$v.formData.bank.$model"}})],1),!e.supportLink||e.supportMobileScrapper||e.isBankWhitelisted?[a("hr",{staticClass:"my-8 border-neutral-200"}),a("p",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"font-bold text-main-primary mb-6"},[e._v(" Account Information ")]),a("div",{staticClass:"grid grid-cols-2 gap-x-12 gap-y-8"},[e.isBankWhitelisted?e._e():[a("Dropdown",{staticClass:"w-full mb-6",attrs:{error:e.$v.formData.accountType.$error?"Select an account type.":"",options:e.accountTypes,title:e.$gettext("Account Type"),"data-testid":"accountType"},model:{value:e.$v.formData.accountType.$model,callback:function(t){e.$set(e.$v.formData.accountType,"$model",t)},expression:"$v.formData.accountType.$model"}}),a("TextInput",{staticClass:"w-full",attrs:{error:e.$v.formData.accountNumber.$error&&e._accountNoValidationMessage||"",label:e.labels.accountNumber},on:{keyup:e.formatAccountNumber},model:{value:e.$v.formData.accountNumber.$model,callback:function(t){e.$set(e.$v.formData.accountNumber,"$model","string"===typeof t?t.trim():t)},expression:"$v.formData.accountNumber.$model"}})],e.showCorporateHolderInfo?a("TextInput",{key:"holderName",attrs:{error:e.$v.formData.fullName.$error&&e._fullNameValidationMessage||"",label:e.labels.accountHolder},model:{value:e.$v.formData.fullName.$model,callback:function(t){e.$set(e.$v.formData.fullName,"$model","string"===typeof t?t.trim():t)},expression:"$v.formData.fullName.$model"}}):e._e(),e.showPersonalHolderInfo?[a("TextInput",{key:"holderFirstName",staticClass:"mb-6",attrs:{error:e.$v.formData.firstName.$error&&e._firstNameValidationMessage||"",label:e.labels.firstName},model:{value:e.$v.formData.firstName.$model,callback:function(t){e.$set(e.$v.formData.firstName,"$model","string"===typeof t?t.trim():t)},expression:"$v.formData.firstName.$model"}}),a("TextInput",{key:"holderMiddleName",staticClass:"mb-6",attrs:{error:e.$v.formData.firstName.$error&&e._middleNameValidationMessage||"",label:e.$gettext("Holder Middle Name")},model:{value:e.$v.formData.middleName.$model,callback:function(t){e.$set(e.$v.formData.middleName,"$model","string"===typeof t?t.trim():t)},expression:"$v.formData.middleName.$model"}}),a("TextInput",{key:"holderLastName",staticClass:"mb-6",attrs:{error:e.$v.formData.lastName.$error&&e._lastNameValidationMessage||"",label:e.$gettext("Holder Last Name")},model:{value:e.$v.formData.lastName.$model,callback:function(t){e.$set(e.$v.formData.lastName,"$model","string"===typeof t?t.trim():t)},expression:"$v.formData.lastName.$model"}})]:e._e(),a("TextInput",{attrs:{error:e.$v.formData.emailAddress.$error&&e._emailValidationMessage||"",label:e.$gettext("Holder Email Address")},model:{value:e.$v.formData.emailAddress.$model,callback:function(t){e.$set(e.$v.formData.emailAddress,"$model","string"===typeof t?t.trim():t)},expression:"$v.formData.emailAddress.$model"}}),a("TextInput",{attrs:{error:e.$v.formData.phoneNumber.$error&&e._phoneNoValidationMessage||"",label:e.$gettext("Phone Number")},scopedSlots:e._u([{key:"prefix",fn:function(){return[a("Dropdown",{staticClass:"border-r p-2 flex",attrs:{options:e.countryMobileCodesOption},scopedSlots:e._u([{key:"trigger",fn:function(t){var r=t.selectedOption;return[a("span",{staticClass:"mr-2 text-neutral-600"},[e._v(e._s(r?r.label:null))]),a("svg-icon",{attrs:{"has-fill":!1,name:"IconChevronDown"}})]}}],null,!1,1123118530),model:{value:e.formData.countryCode,callback:function(t){e.$set(e.formData,"countryCode",t)},expression:"formData.countryCode"}})]},proxy:!0}],null,!1,658048468),model:{value:e.$v.formData.phoneNumber.$model,callback:function(t){e.$set(e.$v.formData.phoneNumber,"$model","string"===typeof t?t.trim():t)},expression:"$v.formData.phoneNumber.$model"}}),e.supportVisa?a("TextInput",{attrs:{error:e.$v.formData.pan.$error&&e.$gettext("Enter your 16 digit card number.")||"",label:e.$gettext("Visa PAN"),inputmode:"numeric",maxlength:"16"},on:{input:e.onPanInput},model:{value:e.$v.formData.pan.$model,callback:function(t){e.$set(e.$v.formData.pan,"$model","string"===typeof t?t.trim():t)},expression:"$v.formData.pan.$model"}}):e._e()],2)]:e._e()],2),a("div",{staticClass:"py-6 px-16 flex justify-end"},[a("Button",{staticClass:"w-43",attrs:{disabled:e.$v.$invalid,loading:e.loading,type:"submit",size:"md",variant:"primary"}},[a("translate",[e._v("Add Account")])],1)],1)])},f=[],m=a("0411"),b=a("75d9"),p=a("93f3"),h=a("94c1"),v=a("325f"),y=a("0754"),g=a("91b3"),$=a("41d7");const x=Object(l["a"])("config"),_=Object(l["a"])("direct"),O=[b["g"].BRI_PERSONAL],D=(e={})=>({country:"",bank:"",bankCode:null,accountType:null,accountNumber:"",fullName:"",firstName:"",middleName:"",lastName:"",emailAddress:"",countryCode:Object.values(p["b"])[0],phoneNumber:"",pan:"",...e});let N=class extends s["f"]{constructor(){super(...arguments),this.formData=D(this.initFormValues),this.accountTypes=[{label:"Corporate",value:g["a"].CORPORATE},{label:"Personal",value:g["a"].PERSONAL}],this.countryMobileCodesOption=Object.values(p["b"])}onSuccess(){const e={...this.formData,bankCode:this.selectedBankCode};return this.isJKTDashboard&&(e.lastName=this.formData.lastName||"testing"),e}onError(e){return e}watchDestinationBankCodeChanged(e){this.formData=D({country:this.formData.country,bank:this.formData.bank}),c["i"].includes(e)&&(this.formData.accountType=g["a"].CORPORATE,this.formData.accountNumber="123456789"),this.formatAccountNumber()}get mandatorySymbol(){return this.isJKTDashboard?" *":""}get labels(){return{bank:this.$gettext("Bank")+this.mandatorySymbol,accountNumber:this.$gettext("Account Number")+this.mandatorySymbol,accountHolder:this.$gettext("Account Holder")+this.mandatorySymbol,firstName:this.$gettext("Holder First Name")+this.mandatorySymbol}}get supportVisa(){var e;return(null===(e=this.selectedBankInteractionMethods)||void 0===e?void 0:e.includes(b["i"].VISA))&&this.getToggle(v["a"].DIRECT_VISA)}get supportLink(){var e;return null===(e=this.selectedBankInteractionMethods)||void 0===e?void 0:e.includes(b["i"].LINK)}get supportMobileScrapper(){var e;return null===(e=this.selectedBankInteractionMethods)||void 0===e?void 0:e.includes(b["i"].MOBILE_SCRAPER)}get showPersonalHolderInfo(){const{accountType:e}=this.formData;return Boolean(e)&&e===g["a"].PERSONAL}get showCorporateHolderInfo(){const{accountType:e}=this.formData;return Boolean(e)&&e===g["a"].CORPORATE}get accountId(){return this.initFormValues&&this.initFormValues.id}get banks(){return this.formData.country?this.getBanksFromCountry(this.formData.country):[]}get bankOptions(){return this.banks.length?this.banks.map(e=>e.title).sort():[]}get selectedBank(){const{bank:e}=this.formData;return e?this.banks.find(t=>t.title===e):null}get selectedBankCode(){var e;return null===(e=this.selectedBank)||void 0===e?void 0:e.code}get selectedBankInteractionMethods(){var e;return null===(e=this.selectedBank)||void 0===e?void 0:e.bankInteractionMethods}get isBankWhitelisted(){var e;return c["i"].includes(null===(e=this.selectedBank)||void 0===e?void 0:e.code)}get _fullNameValidationMessage(){var e,t,a;return(null===(e=this.$v.formData.fullName)||void 0===e?void 0:e.required)?(null===(t=this.$v.formData.fullName)||void 0===t?void 0:t.noSpecialCharacters)?(null===(a=this.$v.formData.fullName)||void 0===a?void 0:a.invalid)?"":this.$gettext("Account Holder should be longer than 1 word. Try again."):this.$gettext("The account holder's full name must not contain special characters."):this.$gettext("Enter account holder's full name.")}get _firstNameValidationMessage(){var e,t;return(null===(e=this.$v.formData.firstName)||void 0===e?void 0:e.required)?(null===(t=this.$v.formData.firstName)||void 0===t?void 0:t.noSpecialCharacters)?"":this.$gettext("The account holder's first name must not contain special characters."):this.$gettext("Enter account holder's first name.")}get _middleNameValidationMessage(){var e;return(null===(e=this.$v.formData.middleName)||void 0===e?void 0:e.noSpecialCharacters)?"":this.$gettext("The account holder's middle name must not contain special characters.")}get _lastNameValidationMessage(){var e,t;return(null===(e=this.$v.formData.lastName)||void 0===e?void 0:e.required)?(null===(t=this.$v.formData.lastName)||void 0===t?void 0:t.noSpecialCharacters)?"":this.$gettext("The account holder's last name must not contain special characters."):this.$gettext("Enter account holder's last name.")}get _emailValidationMessage(){var e,t;return(null===(e=this.$v.formData.emailAddress)||void 0===e?void 0:e.required)?(null===(t=this.$v.formData.emailAddress)||void 0===t?void 0:t.email)?"":this.$gettext("Invalid email address. Try again."):this.$gettext("Enter your email address.")}get _accountNoValidationMessage(){var e,t;return(null===(e=this.$v.formData.accountNumber)||void 0===e?void 0:e.required)?(null===(t=this.$v.formData.accountNumber)||void 0===t?void 0:t.alreadyExisted)?"":this.$gettext("An account has already exist. Log in with the email address or enter a new one."):this.$gettext("Enter your account number.")}get _phoneNoValidationMessage(){var e,t;return(null===(e=this.$v.formData.phoneNumber)||void 0===e?void 0:e.minLength)&&(null===(t=this.$v.formData.phoneNumber)||void 0===t?void 0:t.maxLength)?"":this.$gettext("Phone number must be 9 to 13 digits.")}formatAccountNumber(){const{accountNumber:e}=this.formData;if(!e||!this.selectedBankCode)return;let t=1/0;switch(this.selectedBankCode){case b["r"].PH_RCBC:case b["r"].ID_BCA:t=10;break;case b["r"].PH_BDO:case b["r"].PH_UB:case b["r"].PH_PNB:case b["r"].ID_CIMB:t=12;break;case b["r"].PH_METRO:case b["r"].ID_MANDIRI:t=13;break;default:break}this.formData.accountNumber=Object(h["f"])(this.formData.accountNumber,t)}onSubmit(){this.onSuccess()}onPanInput(e){this.formData.pan=Object(h["u"])(e)}validations(){return{formData:{country:{required:m["required"]},bank:{required:m["required"]},pan:{minLength:Object(m["minLength"])(16),maxLength:Object(m["maxLength"])(16)},accountNumber:{required:Object(m["requiredIf"])(()=>!this.supportLink),alreadyExisted:e=>{var t;return c["i"].includes(null===(t=this.selectedBank)||void 0===t?void 0:t.code)||this.checkAccountNumberUnique(e,this.selectedBankCode)}},accountType:{required:Object(m["requiredIf"])(()=>!this.supportLink)},fullName:{required:Object(m["requiredIf"])(()=>{var e;return this.showCorporateHolderInfo&&(!this.supportLink||c["i"].includes(null===(e=this.selectedBank)||void 0===e?void 0:e.code))}),invalid:e=>!this.showCorporateHolderInfo||!e||e.trim().split(" ").length>1,noSpecialCharacters:$["b"]},firstName:{required:Object(m["requiredIf"])(()=>this.showPersonalHolderInfo&&!this.supportLink),noSpecialCharacters:$["b"]},middleName:{noSpecialCharacters:$["b"]},lastName:{required:Object(m["requiredIf"])(()=>!this.isJKTDashboard&&this.showPersonalHolderInfo&&!this.supportLink),noSpecialCharacters:$["b"]},emailAddress:{required:Object(m["requiredIf"])(()=>O.includes(this.selectedBankCode)&&!this.supportLink),email:m["email"]},phoneNumber:{minLength:Object(m["minLength"])(9),maxLength:Object(m["maxLength"])(13)}}}}};Object(o["a"])([Object(s["c"])({type:Boolean,default:!1})],N.prototype,"loading",void 0),Object(o["a"])([Object(s["c"])({type:Object,default:()=>({})})],N.prototype,"initFormValues",void 0),Object(o["a"])([x.Getter("getToggle")],N.prototype,"getToggle",void 0),Object(o["a"])([_.Getter("getBanksFromCountry")],N.prototype,"getBanksFromCountry",void 0),Object(o["a"])([_.Getter("currentBusinessInfoId")],N.prototype,"businessInfoId",void 0),Object(o["a"])([_.Getter("checkAccountNumberUnique")],N.prototype,"checkAccountNumberUnique",void 0),Object(o["a"])([x.Getter("isJKTDashboard")],N.prototype,"isJKTDashboard",void 0),Object(o["a"])([Object(s["b"])("success")],N.prototype,"onSuccess",null),Object(o["a"])([Object(s["b"])("error")],N.prototype,"onError",null),Object(o["a"])([Object(s["g"])("selectedBankCode")],N.prototype,"watchDestinationBankCodeChanged",null),Object(o["a"])([Object(y["a"])()],N.prototype,"validations",null),N=Object(o["a"])([Object(s["a"])({name:"account-form",components:{Dropdown:u["Dropdown"],TextInput:u["Input"],Button:u["Button"],SvgIcon:u["SvgIcon"]}})],N);var j=N,C=j,k=a("d8ae"),P=Object(k["a"])(C,d,f,!1,null,null,null),A=P.exports,w=a("20d0"),S=a("6fa6"),I=a("df17");const M=Object(l["a"])("direct");let T=class extends s["f"]{constructor(){super(...arguments),this.errorMsg=null,this.isSubmitting=!1,this.showSummary=!1,this.summaryData=null,this.navigations=[{label:this.$gettext("Settings"),link:"/settings?tab="+I["a"].BANK_ACCOUNTS},{label:this.$gettext("Bank Accounts")}]}get initFormValues(){return{country:this.selectedCountry}}get fetchingDirectData(){return this.fetchingData.isFetchingBusinessInfo||this.fetchingData.isFetchingBanks}async onAddAnother(){this.showSummary=!1,await this.getAccounts()}onDone(){this.$router.push("/settings?tab="+I["a"].BANK_ACCOUNTS)}showError(e){this.errorMsg=null,this.$nextTick(()=>{this.errorMsg=e})}formatSummaryData(e,t){const{country:a,bank:r,accountType:n,accountNumber:o,firstName:s,middleName:u,lastName:l,fullName:d,phoneNumber:f,countryCode:m,emailAddress:b,pan:p}=e,h=n===g["a"].CORPORATE,v=c["i"].includes(e.bankCode),y={bankCode:e.bankCode,accountInfo:{bankName:e.bank,accountNumber:e.accountNumber,id:t},summaryDetails:[{label:this.$gettext("Country"),content:a},{label:this.$gettext("Bank"),content:r},n&&!v?{label:this.$gettext("Account Type"),content:Object(i["capitalize"])(n||"")}:null,o&&!v?{label:this.$gettext("Account Number"),content:o}:null,h&&d?{label:this.$gettext("Holder Name"),content:d}:null,!h&&s?{label:this.$gettext("First Name"),content:s}:null,!h&&u?{label:this.$gettext("Middle Name"),content:u}:null,!h&&l?{label:this.$gettext("Last Name"),content:l}:null,b?{label:this.$gettext("Email Address"),content:b}:null,f?{label:this.$gettext("Phone Number"),content:`${m} ${f}`}:null,p?{label:this.$gettext("Visa PAN"),content:p}:null].filter(Boolean)};return y}async handleSubmit(e){try{this.isSubmitting=!0;const t=e.accountType===g["a"].CORPORATE?b["c"].CORPORATE:b["c"].JOINT,a=e.countryCode?e.countryCode.split(" ")[1]:"",r={id:e.id,bankCode:e.bankCode,accountNumber:e.accountNumber,enabled:e.enabled,emailAddress:e.emailAddress,countryCode:a,phoneNumber:e.phoneNumber,accountType:t,pan:e.pan,...Object(S["a"])(e)},n=await this.upsertAccount(r);this.summaryData=this.formatSummaryData(e,n),this.$nextTick(()=>this.showSummary=!0)}catch(t){this.showError(t.message)}finally{this.isSubmitting=!1}}};Object(o["a"])([M.State("selectedCountry")],T.prototype,"selectedCountry",void 0),Object(o["a"])([M.Action("upsertDestinationAccount")],T.prototype,"upsertAccount",void 0),Object(o["a"])([M.Action("getDestinationAccounts")],T.prototype,"getAccounts",void 0),Object(o["a"])([M.State("fetchingData")],T.prototype,"fetchingData",void 0),T=Object(o["a"])([Object(s["a"])({name:"destination-account",components:{Breadcrumb:u["Breadcrumb"],Message:u["Message"],AccountForm:A,Summary:w["a"],LottieAnimation:u["LottieAnimation"]}})],T);var B=T,q=B,L=Object(k["a"])(q,r,n,!1,null,null,null);t["default"]=L.exports},"5b37":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"withParams",{enumerable:!0,get:function(){return r.default}}),t.regex=t.ref=t.len=t.req=void 0;var r=n(a("0208"));function n(e){return e&&e.__esModule?e:{default:e}}function o(e){return o="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var i=function(e){if(Array.isArray(e))return!!e.length;if(void 0===e||null===e)return!1;if(!1===e)return!0;if(e instanceof Date)return!isNaN(e.getTime());if("object"===o(e)){for(var t in e)return!0;return!1}return!!String(e).length};t.req=i;var s=function(e){return Array.isArray(e)?e.length:"object"===o(e)?Object.keys(e).length:String(e).length};t.len=s;var u=function(e,t,a){return"function"===typeof e?e.call(t,a):a[e]};t.ref=u;var l=function(e,t){return(0,r.default)({type:e},(function(e){return!i(e)||t.test(e)}))};t.regex=l},"609e":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a("5b37"),n=(0,r.withParams)({type:"ipAddress"},(function(e){if(!(0,r.req)(e))return!0;if("string"!==typeof e)return!1;var t=e.split(".");return 4===t.length&&t.every(o)}));t.default=n;var o=function(e){if(e.length>3||0===e.length)return!1;if("0"===e[0]&&"0"!==e)return!1;if(!e.match(/^\d+$/))return!1;var t=0|+e;return t>=0&&t<=255}},"68e8":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a("5b37"),n=function(e){return(0,r.withParams)({type:"maxLength",max:e},(function(t){return!(0,r.req)(t)||(0,r.len)(t)<=e}))};t.default=n},"78a6":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a("5b37"),n=(0,r.regex)("integer",/(^[0-9]*$)|(^-[0-9]+$)/);t.default=n},"8cb0":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a("5b37"),n=function(e){return(0,r.withParams)({type:"maxValue",max:e},(function(t){return!(0,r.req)(t)||(!/\s/.test(t)||t instanceof Date)&&+t<=+e}))};t.default=n},"932d8":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a("5b37"),n=function(e){return(0,r.withParams)({type:"minLength",min:e},(function(t){return!(0,r.req)(t)||(0,r.len)(t)>=e}))};t.default=n},"9c93":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a("5b37"),n=function(e){return(0,r.withParams)({type:"not"},(function(t,a){return!(0,r.req)(t)||!e.call(this,t,a)}))};t.default=n},b03d:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a("5b37"),n=(0,r.withParams)({type:"required"},(function(e){return"string"===typeof e?(0,r.req)(e.trim()):(0,r.req)(e)}));t.default=n},baef:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a("5b37"),n=function(){for(var e=arguments.length,t=new Array(e),a=0;a0&&t.reduce((function(t,a){return t&&a.apply(e,r)}),!0)}))};t.default=n},c02a:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a("5b37"),n=function(e,t){return(0,r.withParams)({type:"between",min:e,max:t},(function(a){return!(0,r.req)(a)||(!/\s/.test(a)||a instanceof Date)&&+e<=+a&&+t>=+a}))};t.default=n},c04e:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a("5b37"),n=(0,r.regex)("alphaNum",/^[a-zA-Z0-9]*$/);t.default=n},c81c:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a("5b37"),n=function(e){return(0,r.withParams)({type:"sameAs",eq:e},(function(t,a){return t===(0,r.ref)(e,this,a)}))};t.default=n},dc6f:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a("5b37"),n=(0,r.regex)("alpha",/^[a-zA-Z]*$/);t.default=n},f0b7:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a("5b37"),n=function(){for(var e=arguments.length,t=new Array(e),a=0;a0&&t.reduce((function(t,a){return t||a.apply(e,r)}),!1)}))};t.default=n},fad9:function(e,t,a){"use strict";(function(e){function a(e){return a="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.withParams=void 0;var r="undefined"!==typeof window?window:"undefined"!==typeof e?e:{},n=function(e,t){return"object"===a(e)&&void 0!==t?t:e((function(){}))},o=r.vuelidate?r.vuelidate.withParams:n;t.withParams=o}).call(this,a("d755"))}}]); //# sourceMappingURL=chunk-4e3ea42e.19fc980f.js.map