(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-30d07cc8"],{"3a1f":function(e,t,a){"use strict";a.r(t);a("4de4"),a("d81d"),a("e9f5"),a("ab43"),a("d3b7");var o=function(){var e=this,t=e._self._c;return t("div",{staticClass:"main-content"},["AA"===e.$store.getters.accountData.role?t("div",[t("breadcumb",{attrs:{page:"User Profile",folder:"Pages"}}),t("b-row",[t("b-col",{attrs:{lg:"12",md:"12",sm:"12"}},[t("b-overlay",{attrs:{rounded:"sm"}},[t("b-card",[t("b-form",{on:{submit:function(t){return t.preventDefault(),e.handelUpdateProfileLembaga.apply(null,arguments)}}},[t("b-form-group",{attrs:{label:"Logo Lembaga :"}},[null!==e.detailProfile.companyLogo?t("div",{staticClass:"mb-2"},[t("img",{staticStyle:{width:"80px","margin-bottom":"10px"},attrs:{src:e.detailProfile.companyLogo,alt:"Logo Lembaga"}}),t("button",{staticClass:"btn btn-primary btn-sm d-block",attrs:{type:"button"},on:{click:function(t){e.detailProfile.companyLogo=null,e.detailProfile.logoUrl=null}}},[e._v(" Hapus ")])]):t("b-form-file",{attrs:{placeholder:"Upload logo disini ...","drop-placeholder":"Upload logo disini ...",accept:"image/*"},on:{change:e.setImage}})],1),t("b-form-group",{attrs:{label:"Nama Lembaga :"}},[t("b-form-input",{attrs:{type:"text",placeholder:"Masukkan nama lembaga"},model:{value:e.detailProfile.companyName,callback:function(t){e.$set(e.detailProfile,"companyName",t)},expression:"detailProfile.companyName"}})],1),t("b-form-group",{attrs:{label:"Alamat Lembaga :"}},[t("b-form-textarea",{attrs:{id:"textarea",placeholder:"Masukkan alamat lembaga",rows:"3","max-rows":"6"},model:{value:e.detailProfile.companyAddress,callback:function(t){e.$set(e.detailProfile,"companyAddress",t)},expression:"detailProfile.companyAddress"}})],1),t("b-form-group",{attrs:{label:"Nama Bank :"}},[t("b-form-input",{attrs:{type:"text",placeholder:"Masukkan nama bank"},model:{value:e.detailProfile.companyBankAccountName,callback:function(t){e.$set(e.detailProfile,"companyBankAccountName",t)},expression:"\n detailProfile.companyBankAccountName\n "}})],1),t("b-form-group",{attrs:{label:"Nomor Rekening :","label-for":"input-nomor-rekening"}},[t("b-form-input",{attrs:{placeholder:"Masukkan nomor rekening",name:"nomor rekening"},on:{keypress:function(t){return e.handleBlockInputAlphabet(t)}},model:{value:e.detailProfile.companyBankAccountNumber,callback:function(t){e.$set(e.detailProfile,"companyBankAccountNumber",t)},expression:"detailProfile.companyBankAccountNumber"}})],1),t("b-button",{staticClass:"mt-3",attrs:{type:"submit",variant:"primary"}},[e._v("Simpan")])],1)],1)],1)],1)],1)],1):e._e(),"AE"===e.$store.getters.accountData.role||"AR"===e.$store.getters.accountData.role?t("div",[t("breadcumb",{staticStyle:{"margin-top":"26px"},attrs:{page:"Agent Profile",folder:"Pages"}}),t("b-row",[t("b-col",{attrs:{lg:"12",md:"12",sm:"12"}},[t("b-overlay",{attrs:{rounded:"sm"}},[t("b-card",[t("b-form",{on:{submit:function(t){return t.preventDefault(),e.handleUpdateProfileAgent(e.detailProfile)}}},[t("b-row",[t("b-col",{attrs:{lg:"6",md:"12",sm:"12"}},[t("b-form-group",{attrs:{label:"Nama Depan :"}},[t("b-form-input",{attrs:{type:"text",placeholder:"Masukkan nama depan"},model:{value:e.detailProfile.first_name,callback:function(t){e.$set(e.detailProfile,"first_name",t)},expression:"detailProfile.first_name"}})],1)],1),t("b-col",{attrs:{lg:"6",md:"12",sm:"12"}},[t("b-form-group",{attrs:{label:"Nama Belakang :"}},[t("b-form-input",{attrs:{type:"text",placeholder:"Masukkan nama belakang"},model:{value:e.detailProfile.last_name,callback:function(t){e.$set(e.detailProfile,"last_name",t)},expression:"detailProfile.last_name"}})],1)],1)],1),t("b-row",[t("b-col",{attrs:{lg:"6",md:"12",sm:"12"}},[t("b-form-group",{attrs:{label:"NIK :"}},[t("b-form-input",{attrs:{type:"number",required:"",placeholder:"NIK"},model:{value:e.detailProfile.nik,callback:function(t){e.$set(e.detailProfile,"nik",t)},expression:"detailProfile.nik"}})],1)],1),t("b-col",{attrs:{lg:"6",md:"12",sm:"12"}},[t("b-form-group",{attrs:{label:"Cabang BWA :"}},[t("select",{directives:[{name:"model",rawName:"v-model",value:e.detailProfile.branch_id,expression:"detailProfile.branch_id"}],staticClass:"form-control",attrs:{name:"branch_id",id:"branch_id",required:""},on:{change:function(t){var a=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.$set(e.detailProfile,"branch_id",t.target.multiple?a:a[0])}}},e._l(e.branches,(function(a){return t("option",{key:a.KdCabang,domProps:{value:a.KdCabang}},[e._v(e._s(a.Nama))])})),0)])],1)],1),t("b-row",[t("b-col",{attrs:{lg:"6",md:"12",sm:"12"}},[t("b-form-group",{attrs:{label:"Bank :"}},[t("b-form-input",{attrs:{readonly:"",type:"text",placeholder:"Bank"},model:{value:e.detailProfile.bank_name,callback:function(t){e.$set(e.detailProfile,"bank_name",t)},expression:"detailProfile.bank_name"}})],1)],1),t("b-col",{attrs:{lg:"6",md:"12",sm:"12"}},[t("b-form-group",{attrs:{label:"Cabang Bank :"}},[t("b-form-input",{attrs:{type:"text",placeholder:"Cabang Bank"},model:{value:e.detailProfile.bank_branch_name,callback:function(t){e.$set(e.detailProfile,"bank_branch_name",t)},expression:"detailProfile.bank_branch_name"}})],1)],1)],1),t("b-row",[t("b-col",{attrs:{lg:"6",md:"12",sm:"12"}},[t("b-form-group",{attrs:{label:"Nomor Rekening :"}},[t("b-form-input",{attrs:{type:"text",placeholder:"Nomor rekening"},on:{keypress:function(t){return e.handleBlockInputAlphabet(t)}},model:{value:e.detailProfile.bank_account_number,callback:function(t){e.$set(e.detailProfile,"bank_account_number",t)},expression:"detailProfile.bank_account_number"}})],1)],1),t("b-col",{attrs:{lg:"6",md:"12",sm:"12"}},[t("b-form-group",{attrs:{label:"Nama Akun Bank :"}},[t("b-form-input",{attrs:{type:"text",placeholder:"Nama Akun Bank"},model:{value:e.detailProfile.bank_account_name,callback:function(t){e.$set(e.detailProfile,"bank_account_name",t)},expression:"detailProfile.bank_account_name"}})],1)],1)],1),t("b-form-group",{attrs:{label:"Alamat :"}},[t("b-form-textarea",{attrs:{id:"textarea",placeholder:"Masukkan alamat",rows:"3","max-rows":"6"},model:{value:e.detailProfile.address,callback:function(t){e.$set(e.detailProfile,"address",t)},expression:"detailProfile.address"}})],1),t("b-row",[t("b-col",{attrs:{lg:"6",md:"12",sm:"12"}},[t("b-form-group",{attrs:{label:"Kelurahan :"}},[t("b-form-input",{attrs:{type:"text",placeholder:"Kelurahan"},model:{value:e.detailProfile.kelurahan,callback:function(t){e.$set(e.detailProfile,"kelurahan",t)},expression:"detailProfile.kelurahan"}})],1)],1),t("b-col",{attrs:{lg:"6",md:"12",sm:"12"}},[t("b-form-group",{attrs:{label:"Kecamatan :"}},[t("b-form-input",{attrs:{type:"text",placeholder:"Kecamatan"},model:{value:e.detailProfile.kecamatan,callback:function(t){e.$set(e.detailProfile,"kecamatan",t)},expression:"detailProfile.kecamatan"}})],1)],1)],1),t("b-row",[t("b-col",{attrs:{lg:"4",md:"12",sm:"12"}},[t("b-form-group",{attrs:{label:"Kota :"}},[t("b-form-input",{attrs:{type:"text",placeholder:"Kota"},model:{value:e.detailProfile.kota,callback:function(t){e.$set(e.detailProfile,"kota",t)},expression:"detailProfile.kota"}})],1)],1),t("b-col",{attrs:{lg:"4",md:"12",sm:"12"}},[t("b-form-group",{attrs:{label:"Provinsi :"}},[t("select",{directives:[{name:"model",rawName:"v-model",value:e.detailProfile.provinsi,expression:"detailProfile.provinsi"}],staticClass:"form-control",attrs:{name:"provinsi",id:"provinsi",required:""},on:{change:function(t){var a=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.$set(e.detailProfile,"provinsi",t.target.multiple?a:a[0])}}},e._l(e.provinces,(function(a){return t("option",{key:a.KdPropinsi,domProps:{value:a.KdPropinsi}},[e._v(e._s(a.NmPropinsi))])})),0)])],1),t("b-col",{attrs:{lg:"4",md:"12",sm:"12"}},[t("b-form-group",{attrs:{label:"Kode Pos :"}},[t("b-form-input",{attrs:{type:"text",placeholder:"Kode pos"},model:{value:e.detailProfile.kode_pos,callback:function(t){e.$set(e.detailProfile,"kode_pos",t)},expression:"detailProfile.kode_pos"}})],1)],1)],1),t("b-row",[t("b-col",{attrs:{lg:"6",md:"12",sm:"12"}},[t("b-form-group",{attrs:{label:"Telpon Rumah :"}},[t("b-form-input",{attrs:{type:"text",placeholder:"Telpon rumah"},model:{value:e.detailProfile.telp_rumah,callback:function(t){e.$set(e.detailProfile,"telp_rumah",t)},expression:"detailProfile.telp_rumah"}})],1)],1),t("b-col",{attrs:{lg:"6",md:"12",sm:"12"}},[t("b-form-group",{attrs:{label:"Nomor HP :"}},[t("b-form-input",{attrs:{type:"text",placeholder:"Nomor HP"},model:{value:e.detailProfile.phone_number,callback:function(t){e.$set(e.detailProfile,"phone_number",t)},expression:"detailProfile.phone_number"}})],1)],1)],1),t("b-row",[t("b-col",{attrs:{lg:"6",md:"12",sm:"12"}},[t("b-form-group",{attrs:{label:"Foto Selfie :"}},[e.detailProfile.file_selfie&&"string"===typeof e.detailProfile.file_selfie?t("img",{staticStyle:{width:"80px","margin-bottom":"10px"},attrs:{src:e.detailProfile.file_selfie,alt:"File selfie"}}):e._e(),t("b-form-file",{attrs:{placeholder:"Upload foto selfie",accept:"image/*",required:!e.detailProfile.file_selfie},model:{value:e.detailProfile.file_selfie,callback:function(t){e.$set(e.detailProfile,"file_selfie",t)},expression:"detailProfile.file_selfie"}})],1)],1)],1),t("b-button",{staticClass:"mt-3",class:e.isAEOrAR?"btn-ae-ar":null,attrs:{type:"submit",variant:e.isAEOrAR?null:"primary"}},[e._v("Simpan")])],1)],1)],1)],1)],1)],1):e._e()])},r=[],n=a("53ca"),l=a("c7eb"),i=a("1da1"),s=a("5530"),c=(a("99af"),a("caad"),a("a15b"),a("7d54"),a("e9c4"),a("b64b"),a("2532"),a("159b"),a("2f62")),d={metaInfo:{title:"Profile"},data:function(){var e={};return"AE"!==this.$store.getters.accountData.role&&"AR"!==this.$store.getters.accountData.role||(e.first_name=this.$store.getters["accountData"].detail.first_name,e.last_name=this.$store.getters["accountData"].detail.last_name,e.email=this.$store.getters["accountData"].email,e.phone_number=this.$store.getters["accountData"].detail.phone_number,e.address=this.$store.getters["accountData"].detail.address,e.dob=this.$store.getters["accountData"].detail.dob,e.bank_name=this.$store.getters["accountData"].detail.bank_name,e.bank_account_number=this.$store.getters["accountData"].detail.bank_account_number,e.bank_account_name=this.$store.getters["accountData"].detail.bank_account_name,e.bank_branch_name=this.$store.getters["accountData"].detail.bank_branch_name,e.kelurahan=this.$store.getters["accountData"].detail.kelurahan,e.kecamatan=this.$store.getters["accountData"].detail.kecamatan,e.kota=this.$store.getters["accountData"].detail.kota,e.provinsi=this.$store.getters["accountData"].detail.provinsi,e.kode_pos=this.$store.getters["accountData"].detail.kode_pos,e.telp_rumah=this.$store.getters["accountData"].detail.telp_rumah,e.branch_id=this.$store.getters["accountData"].detail.branch_id,e.nik=this.$store.getters["accountData"].detail.nik,e.file_selfie=this.$store.getters["accountData"].detail.file_selfie),"AA"===this.$store.getters.accountData.role&&(e.companyLogo=this.$store.getters["accountData"].company.company_logo_url,e.legalDocument=this.$store.getters["accountData"].company.company_legal_document,e.companyName=this.$store.getters["accountData"].company.company_name,e.companyAddress=this.$store.getters["accountData"].company.company_address,e.companyBankAccountName=this.$store.getters["accountData"].company.company_bank_account_name,e.companyBankAccountNumber=this.$store.getters["accountData"].company.company_bank_account_number,e.logoUrl=null),{branches:[],provinces:[],detailProfile:e,show:!1}},computed:Object(s["a"])({},Object(c["c"])(["isAEOrAR"])),mounted:function(){this.makeToast(),"AE"!==this.$store.getters["accountData"].role&&"AR"!==this.$store.getters["accountData"].role||(this.getBranches(),this.getProvinces())},methods:{makeToast:function(){},getBranches:function(){var e=this;return Object(i["a"])(Object(l["a"])().mark((function t(){var a,o;return Object(l["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$http.get("".concat("https://orchestrator.bwa.id/api/v1/","mgm/get-cabang"));case 2:a=t.sent,o=a.data,e.branches=o;case 5:case"end":return t.stop()}}),t)})))()},getProvinces:function(){var e=this;return Object(i["a"])(Object(l["a"])().mark((function t(){var a,o;return Object(l["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$http.get("".concat("https://orchestrator.bwa.id/api/v1/","mgm/get-propinsi"));case 2:a=t.sent,o=a.data,e.provinces=o;case 5:case"end":return t.stop()}}),t)})))()},handleBlockInputAlphabet:function(e){e=e||window.event;var t=e.which?e.which:e.keyCode;if(!(t>31&&(t<48||t>57)&&46!==t))return!0;e.preventDefault()},setImage:function(e){var t=this;if(null!==e.target.files&&""!==e.target.files){var a=e.target.files[0];if(a.size>5e5)this.$store.dispatch("error","file terlalu besar, harus dibawah 500 kb"),this.detailProfile.companyLogo=null;else{if(!a.type.includes("image/"))return this.$store.dispatch("error","Please select an image file"),void(this.detailProfile.companyLogo=null);if("function"===typeof FileReader){var o=new FileReader;o.onload=function(e){t.detailProfile.companyLogo=e.target.result},o.readAsDataURL(a)}else this.detailProfile.companyLogo=null,this.$store.dispatch("error","Sorry, FileReader API not supported");this.detailProfile.logoUrl=a}}},formatDate:function(e){var t=new Date(e),a=""+(t.getMonth()+1),o=""+t.getDate(),r=t.getFullYear();return a.length<2&&(a="0"+a),o.length<2&&(o="0"+o),[r,a,o].join("-")},handelUpdateProfileLembaga:function(){var e=this;this.show=!0;var t=new FormData;t.append("company_name",this.detailProfile.companyName),t.append("company_address",this.detailProfile.companyAddress),t.append("company_bank_account_number",this.detailProfile.companyBankAccountName),t.append("company_logo",this.detailProfile.logoUrl),t.append("company_name",this.detailProfile.companyName),t.append("company_bank_account_name",this.detailProfile.companyName),t.append("company_legal_document",this.detailProfile.legalDocument),t.append("_method","PATCH"),this.$http.post("".concat("https://orchestrator.bwa.id/api/v1/","companies/").concat(this.$route.params.uuid),t,{headers:{Authorization:"Bearer ".concat(this.$store.getters["accessToken"])}}).then((function(){e.show=!1,e.$store.dispatch("success","Profile berhasil diupdate"),setTimeout((function(){console.log("location.reload();"),location.reload()}),700)})).catch((function(t){e.$store.dispatch("error",t)}))},handleUpdateProfileAgent:function(e){var t=this;this.show=!0;var a=Object(s["a"])(Object(s["a"])({},e),{},{dob:this.formatDate(e.dob)});"object"!==Object(n["a"])(a.file_selfie)&&(a.file_selfie=null);var o=new FormData;Object.keys(a).forEach((function(e){a[e]&&""!==a[e]&&o.append(e,a[e])})),this.$http.post("".concat("https://orchestrator.bwa.id/api/v1/","me/profile"),o,{headers:{Authorization:"Bearer ".concat(this.$store.getters["accessToken"])}}).then((function(){t.show=!1,t.$store.dispatch("success","Profile berhasil diupdate"),t.$store.dispatch("getAccountData",t.$store.getters["accessToken"]).then((function(e){t.$store.dispatch("saveTokens",{tokens:{access_token:t.$store.getters["accessToken"],refresh_token:t.$store.getters["refreshToken"]},accountData:JSON.stringify(e),isLocalLogin:!1}).then((function(){localStorage.removeItem("updateProfile"),setTimeout((function(){location.reload()}),700)}))}))})).catch((function(e){t.$store.dispatch("error",e)}))}}},m=d,u=a("2877"),p=Object(u["a"])(m,o,r,!1,null,null,null);t["default"]=p.exports},a15b:function(e,t,a){"use strict";var o=a("23e7"),r=a("e330"),n=a("44ad"),l=a("fc6a"),i=a("a640"),s=r([].join),c=n!==Object,d=c||!i("join",",");o({target:"Array",proto:!0,forced:d},{join:function(e){return s(l(this),void 0===e?",":e)}})},ab43:function(e,t,a){"use strict";var o=a("23e7"),r=a("c65b"),n=a("59ed"),l=a("825a"),i=a("46c4"),s=a("c5cc"),c=a("9bdd"),d=a("2a62"),m=a("f99f"),u=a("c430"),p=!u&&m("map",TypeError),f=s((function(){var e=this.iterator,t=l(r(this.next,e)),a=this.done=!!t.done;if(!a)return c(e,this.mapper,[t.value,this.counter++],!0)}));o({target:"Iterator",proto:!0,real:!0,forced:u||p},{map:function(e){l(this);try{n(e)}catch(t){d(this,"throw",t)}return p?r(p,this,e):new f(i(this),{mapper:e})}})},d81d:function(e,t,a){"use strict";var o=a("23e7"),r=a("b727").map,n=a("1dde"),l=n("map");o({target:"Array",proto:!0,forced:!l},{map:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}})}}]);