PageSourceSearch

https://myhub.compunet.biz/build/vue2/assets/Show-B-kQd57g.js

js compunet.biz collected 2026-10-02 07:06:24 UTC 104,073 bytes, 1 lines download raw bytes

1import{n as Z}from"./app-PlFopkv0.js";const z={data(){return{filtered_vendor_programs:[],filtered_vendor_certifications:[],vendor_program_roles:[],vendor_program_users:[],activeTab:"Select a tab to see more",company:null,searched_vendor_programs:[],searched_certificate_holders:[],form:{subcontractor_services:{activeContractType:null,coiDocExists:!1,coiExpirationDate:null,customerAllowsSubcontractors:null,documentBlobURL:null,healthSafetyEnv:!1,isSubcontractor:!1,loading:!1,masterMetadata:null,masterExpired:!1,masterExpiration:null,partneringMetadata:null,partneringExpired:!1,partneringExpiration:null,resellerMetadata:null,resellerExpired:!1,resellerExpiration:null,poRequired:!1,requiresBackgroundChecks:!1,requiresDrugScreening:!1,selectedOptions:[],servicesOptions:["Consulting","Managed Support Services","Other Service(s)","Physical Installation/Construction","Programming/Development","Staff Augmentation","Software Implementation"],wNineDocExists:!1,modal:{active:!1,activeType:null,activeLegacyID:null,open:t=>{this.form.subcontractor_services.modal.activeType=t,this.form.subcontractor_services.modal.active=!0},close:()=>{this.form.subcontractor_services.modal.active=!1,this.form.subcontractor_services.modal.activeType=null,this.form.subcontractor_services.modal.activeLegacyID=null}},checkSubcontractor:()=>{(this.form.settings.data.subcontractor.hasSubcontractor==="Yes"&&this.companyTypeIncludes([5,6,46,47,48,49])||this.companyTypeIncludes([1]))&&(this.form.subcontractor_services.isSubcontractor=!0,this.form.subcontractor_services.parseMetadata())},removeOption:t=>{this.form.subcontractor_services.selectedOptions=this.form.subcontractor_services.selectedOptions.filter(e=>e!=t),this.form.settings.data.isDirty=!0},tagUpdate:()=>{this.form.settings.data.isDirty=!0},parseMetadata:()=>{var s,i,a,r,o,n,l,c,m,d,h,p,u,g;let t=null,e=null;this.company_type_recid.some(f=>[5,6,46,47,48,49].includes(f))&&(!_.isNull(this.partnering_agreement)||!_.isNull(this.resellerAgreement))?(this.form.subcontractor_services.partneringMetadata=((i=(s=this.partnering_agreement)==null?void 0:s.ironclad_contract_metadata)==null?void 0:i.contract_metadata)??null,this.form.subcontractor_services.resellerMetadata=((r=(a=this.resellerAgreement)==null?void 0:a.ironclad_contract_metadata)==null?void 0:r.contract_metadata)??null,t=this.form.subcontractor_services.partneringMetadata||this.form.subcontractor_services.resellerMetadata,e=t||null,this.form.subcontractor_services.activeContractType=_.isNull(this.form.subcontractor_services.partneringMetadata)?"reseller":"partnering"):(this.company_type_recid.some(f=>[1].includes(f))||this.company_type_recid==1)&&!_.isNull(this.masterAgreement)&&(this.form.subcontractor_services.masterMetadata=((n=(o=this.masterAgreement)==null?void 0:o.ironclad_contract_metadata)==null?void 0:n.contract_metadata)??null,e=this.form.subcontractor_services.masterMetadata?this.form.subcontractor_services.masterMetadata:null,this.form.subcontractor_services.activeContractType="master"),this.form.subcontractor_services.requiresBackgroundChecks=((c=(l=e==null?void 0:e.properties)==null?void 0:l.backgroundCheck)==null?void 0:c.value)||null,this.form.subcontractor_services.requiresDrugScreening=((d=(m=e==null?void 0:e.properties)==null?void 0:m.drugTest)==null?void 0:d.value)||null,this.form.subcontractor_services.isExpired=null,(p=(h=e==null?void 0:e.properties)==null?void 0:h.expirationDate)!=null&&p.value?this.form.subcontractor_services.isExpired=Moment((g=(u=e==null?void 0:e.properties)==null?void 0:u.expirationDate)==null?void 0:g.value,"YYYY-MM-DDTHH:mm:ss.SSSZ").isBefore(Moment(),"day")||!1:this.form.subcontractor_services.isExpired=!1,(!_.isNull(this.coi)||!_.isNull(this.w_nine))&&this.form.subcontractor_services.validateContractDocs(),this.form.subcontractor_services.checkContractExpirations()},retrieveLegacyDoc:t=>{let e=null;e=t==="w_nine"?this.w_nine.id:this.coi.id;const s={contractID:e};axios.post(`/api/Explorers/Companies/${this.company_id}/Document/Preview/Legacy`,s,{responseType:"blob"}).then(i=>{this.form.subcontractor_services.documentBlobURL=URL.createObjectURL(i.data)}).finally(()=>{this.form.subcontractor_services.modal.activeLegacyID=e,this.form.subcontractor_services.modal.open("legacy")})},retrieveIroncladDoc:t=>{let e=null;switch(t){case"reseller":e=this.resellerAgreement.ironclad_id;break;case"partnering":e=this.partnering_agreement.ironclad_id;break;case"master":e=this.masterAgreement.ironclad_id;break}const s={contractID:e};axios.post(`/api/Explorers/Companies/${this.company_id}/Document/Preview`,s,{responseType:"blob"}).then(i=>{this.form.subcontractor_services.documentBlobURL=URL.createObjectURL(i.data)}).finally(()=>{this.form.subcontractor_services.modal.open("ironclad")}
1)},downloadDoc:()=>{this.form.subcontractor_services.modal.activeType==="ironclad"?this.form.subcontractor_services.downloadIroncladDoc():this.form.subcontractor_services.downloadLegacyDoc()},downloadIroncladDoc:()=>{const t=_.isNull(this.form.subcontractor_services.masterMetadata)?this.partnering_agreement:this.masterAgreement;window.open("/i/Explorers/Companies/Ironclad/RecordAttachmentDownload/"+t.ironclad_id+"/"+t.original_name)},downloadLegacyDoc:()=>{window.open("/i/Explorers/LegalDocs/Download/"+this.form.subcontractor_services.modal.activeLegacyID)},checkContractExpirations:()=>{var s,i;const t=["resellerMetadata","partneringMetadata","coi","w_nine"],e={resellerMetadata:{expired:"resellerExpired",expiration:"resellerExpiration"},partneringMetadata:{expired:"partneringExpired",expiration:"partneringExpiration"}};if(t.forEach(a=>{var r,o;if(!_.isNull(this[a]))if(a==="w_nine"||a==="coi")this[a].expired=Moment(this[a].termination_date)<Moment(),this[a].formatted_termination_date=Moment(this[a].termination_date,"MM/DD/YY").format("MM/DD/YYYY");else{const n=this.form.subcontractor_services[a];if(n){const l=n,c=(o=(r=l==null?void 0:l.properties)==null?void 0:r.expirationDate)==null?void 0:o.value,m=e[a];m&&(this.form.subcontractor_services[m.expired]=c?Moment(c)<Moment():!1,this.form.subcontractor_services[m.expiration]=c?Moment(c,"YYYY-MM-DDTHH:mm:ss.SSSZ").format("MM/DD/YYYY"):!1)}}}),!_.isNull(this.form.subcontractor_services.masterMetadata)){const a=this.form.subcontractor_services.masterMetadata;if((i=(s=a==null?void 0:a.properties)==null?void 0:s.expirationDate)!=null&&i.value){const r=a.properties.expirationDate.value;this.form.subcontractor_services.masterExpired=Moment(r)<Moment(),this.form.subcontractor_services.masterExpiration=Moment(r,"YYYY-MM-DDTHH:mm:ss.SSSZ").format("MM/DD/YYYY")}}},validateContractDocs:()=>{var e,s;if(_.isNull((e=this.coi)==null?void 0:e.hash_name)&&_.isNull((s=this.w_nine)==null?void 0:s.hash_name)){this.form.subcontractor_services.loading=!1;return}const t={coi:this.coi,wNine:this.w_nine};axios.post(`/api/Explorers/Companies/${this.company_id}/Documents`,t).then(i=>{this.form.subcontractor_services.coiDocExists=i.data.coi_exists,this.form.subcontractor_services.wNineDocExists=i.data.w_nine_exists}).finally(()=>{this.form.subcontractor_services.loading=!1})}},msp_admin:{modal:{active:!1,saving:!1,data:{user_id:null,company_recid:null,reason_type:null,notes:null},error:{reason_type:!1,notes:!1},getClass:(t,e)=>{var s="w-auto py-3 px-3 text-xs border-2 rounded-md flex items-center text-center uppercase justify-center font-medium cursor-pointer focus:outline-none";return this.form.msp_admin.modal.data[t]==e&&(s+=" bg-primary-200 hover:bg-primary-300"),s},submit:()=>{this.form.msp_admin.modal.isValid()&&(this.form.msp_admin.modal.saving=!0,axios.post("/api/Explorers/Companies/"+this.company_id+"/MSPAdmin/Escalate",this.form.msp_admin.modal.data).then(t=>{document.getElementById("msp-admin-escalate-button").remove(),this.$buefy.toast.open({message:"Access Granted for 24 Hours",type:"is-success",duration:3500})}).catch(t=>{}).finally(t=>{this.form.msp_admin.modal.saving=!1,this.form.msp_admin.modal.close()}))},isValid:()=>(this.form.msp_admin.modal.error.reason_type=!this.form.msp_admin.modal.data.reason_type,this.form.msp_admin.modal.error.notes=this.form.msp_admin.modal.data.reason_type=="other"&&!this.form.msp_admin.modal.data.notes,_.filter(this.form.msp_admin.modal.error,t=>!!t).length===0),close:()=>{this.form.msp_admin.modal.active=!1,this.form.msp_admin.modal.data.user_id=null,this.form.msp_admin.modal.data.company_recid=null},show:t=>{this.form.msp_admin.modal.data.user_id=t,this.form.msp_admin.modal.data.company_recid=this.company_id,this.form.msp_admin.modal.active=!0}}},contact:{active:!1,data:{Contact_Type_RecID:null},edit:!1,filters:{search:"",active:"Active"},hasError:{Default_Email:!1,Inactive_Flag:!1,First_Name:!1,Last_Name:!1},loading:!1,modal:{Contact_RecID:null,contact_types:this.contact_types,contact_types_filtered:this.contact_types,loaded_as_inactive:!1,designated_admin_active:!1,has_myhub_user:!1},notesModal:{active:!1,data:{title:null,body:null},close:()=>{this.form.contact.notesModal.active=!1,this.form.contact.notesModal.data.title=null,this.form.contact.notesModal.data.body=null},save:()=>{this.form.contact.noteBody=this.form.contact.notesModal.data.body,this.form.contact.noteTitle=this.form.contact.notesModal.data.title,this.form.contact.notesModal.close()},show:()=>{this.form.contact.notesModal.active=!0}},saving:!1,_createDA:t=>{t&&(this.form.contact.modal.designated_admin_active=!1,axios.post("/api/Explorers/Companies/"+this.company_id+"/Contacts/Create/DA",{ids:[t]}).then(e=>{e.data.missing_email.length?this.$buefy.dialog.alert({title:"Error",type:"is-danger",message:"MyHub Designated Admin access was not processed due to a missing email address: If you still wish this contact to be given admin access, please add an email or open a ticket via the support menu."}):this.$buefy.dialog.alert({title:"Success",type:"is-success",message:"Contact has been given admin access within MyHub."}),this.form.contact.modal.Contact_RecID=null,this.loadAsyncCompany()}).catch(e=>{}).finally(e=>{}))},_deleteDA:t=>{t&&axios.delete("/api/Explorers/Companies/"+this.company_id+"/Contacts/"+t+"/Delete").then(e=>{this.form.contact.close(),this.loadAsyncCompany(),e.data=="MyHub Designated Admin User Account Removed"?this.$buefy.toast.o
1pen({duration:1500,message:"MyHub User Account Removed",type:"is-success"}):this.$buefy.toast.open({duration:1500,message:"Error removing this contact as MyHub Designated Admin",type:"is-danger"})}).catch(e=>{}).finally(e=>{})},_post:()=>{this.form.contact.saving=!0,axios.post("/api/Explorers/Companies/"+this.company_id+"/Contacts/Save",this.form.contact.data).then(t=>{this.form.contact.modal.loaded_as_inactive===!1&&this.form.contact.data.Inactive_Flag==="1"&&this.form.contact.modal.has_myhub_user&&this.form.contact._deleteDA(this.form.contact.data.Contact_RecID),(this.form.contact.noteBody||this.form.contact.noteTitle)&&this.form.contact.saveNotesToTimeline(t.data.contact.Contact_RecID),this.form.contact.saving=!1,this.loadAsyncCompany()}).catch(t=>{}).finally(t=>{this.form.contact.close()})},close:()=>{this._resetData(this.form.contact.data),this._resetErrors(this.form.contact.hasError),this.form.contact.modal.has_myhub_user=!1,this.form.contact.modal.loaded_as_inactive=!1,this.form.contact.active=!1,this.form.contact.edit=!1},deleteDA:t=>{t&&this.$buefy.dialog.confirm({title:"Remove MyHub User Account",message:"Are you sure you want to remove this contacts MyHub User Account?",cancelText:"Cancel",confirmText:"Remove",type:"is-success",onConfirm:()=>{this.form.contact._deleteDA(t)}})},filteredTypes:t=>{t=t||"",this.form.contact.modal.contact_types_filtered=this.contact_types.filter(e=>e.Description.toLowerCase().indexOf(t.toLowerCase())!==-1)},saveNotesToTimeline:t=>{let e={timeline_subtype_id:1,timeline_type_id:1,payload:{title:this.form.contact.noteTitle,body:this.form.contact.noteBody},ids:{company_recid:this.company_id,contact_recid:t}};axios.post("/api/Timelines",e).then(s=>{this.$buefy.toast.open({message:"Entry Saved!",type:"is-success"})}).catch(s=>{this.$buefy.toast.open({message:"Entry Save Failed!",type:"is-danger"})}).finally(s=>{})},show:(t=null,e=null)=>{var s;this._resetErrors(this.form.contact.hasError),t?(this.form.contact.data.Contact_RecID=t.Contact_RecID,this.form.contact.data.Contact_Type_RecID=t.Contact_Type_RecID,this.form.contact.data.Default_Email=t.Default_Email,this.form.contact.data.Default_Phone=this.$options.filters.phone(t.Default_Phone),this.form.contact.data.First_Name=t.First_Name,this.form.contact.data.Inactive_Flag=t.Inactive_Flag,this.form.contact.data.Default_Flag=t.Default_Flag,this.form.contact.data.Default_Billing_Flag=t.Default_Billing_Flag,this.form.contact.data.Last_Name=t.Last_Name,this.form.contact.data.mobile_phone=(s=t.mobile_phone)==null?void 0:s.Description,this.form.contact.data.Title=t.Title,this.form.contact.modal.has_myhub_user=!!t.user,this.form.contact.modal.loaded_as_inactive=t.Inactive_Flag==="1",this.form.contact.active=!0,this.form.contact.edit=!0):(this.form.contact.data.Contact_RecID=null,this.form.contact.data.Contact_Type_RecID=null,this.form.contact.data.Default_Email=null,this.form.contact.data.Default_Phone=null,this.form.contact.data.Default_Flag=null,this.form.contact.data.Default_Billing_Flag=null,this.form.contact.data.First_Name=null,this.form.contact.data.Inactive_Flag="0",this.form.contact.data.Last_Name=null,this.form.contact.data.Title=null,this.form.contact.data.mobile_phone=null,this.form.contact.active=!0,this.form.contact.edit=!1,this.form.contact.noteBody=null,this.form.contact.noteTitle=null)},submit:()=>{if(this._validate("contact"))if(this.form.contact.edit)this.form.contact._post();else{let t=!1;
1this.company.contacts.forEach(e=>{e.Default_Email===this.form.contact.data.Default_Email&&(t=!0)}),t?this.form.contact.hasError.Default_Email=!0:this.form.contact._post()}}},infoSec:{active:!1,loading:!1,saved_infosec_policy:null,infosec_editable:!1,data:{has_requirements:null,incident_notification:null,notification_days:0,contact_name:null,contact_email:null,background_check:null,drug_test:null,termination_notification:null,termination_days:null,review_interval:null,subcontract:null},hasError:{has_requirements:!1,incident_notification:!1,notification_days:!1,contact_email:!1,background_check:!1,drug_test:!1,termination_notification:!1,termination_days:!1,review_interval:!1,subcontract:!1},_load:()=>axios.get("/api/Explorers/Companies/"+this.company_id+"/InfoSec").then(t=>{this.form.infoSec.infosec_editable=t.data.infosec_editable,this.form.infoSec.saved_infosec_policy=t.data.infosec_policy,this.form.infoSec.saved_infosec_policy&&Object.assign(this.form.infoSec.data,this.form.infoSec.saved_infosec_policy)}),_post:()=>{this.form.infoSec.loading=!0,axios.patch("/api/Explorers/Companies/"+this.company_id+"/InfoSec/Update",{policy:this.form.infoSec.data}).then(t=>{console.log("response",t)}).catch(t=>{}).finally(t=>{this.form.infoSec.loading=!1,this.form.infoSec.close()})},close:()=>{this.form.infoSec.saved_infosec_policy&&Object.assign(this.form.infoSec.data,this.form.infoSec.saved_infosec_policy),this.form.infoSec.active=!1},incidentNotificationClicked:()=>{this.form.infoSec.hasError.incident_notification=!1,this.form.infoSec.data.incident_notification||(this.form.infoSec.data.notification_days=null,this.form.infoSec.hasError.notification_days=!1,this.form.infoSec.data.contact_email=null,this.form.infoSec.hasError.contact_email=!1,this.form.infoSec.data.contact_name=null)},terminationNotificationClicked:()=>{this.form.infoSec.hasError.termination_notification=!1,this.form.infoSec.data.termination_notification||(this.form.infoSec.data.termination_days=null,this.form.infoSec.hasError.termination_days=!1)},validate:()=>(_.isNull(this.form.infoSec.data.has_requirements)?this.form.infoSec.hasError.has_requirements=!0:(this.form.infoSec.hasError.has_requirements=!1,this.form.infoSec.data.has_requirements?(_.isNull(this.form.infoSec.data.incident_notification)?this.form.infoSec.hasError.incident_notification=!0:this.form.infoSec.hasError.incident_notification=!1,this.form.infoSec.data.incident_notification?(_.isNull(this.form.infoSec.data.notification_days)?this.form.infoSec.hasError.notification_days=!0:this.form.infoSec.hasError.notification_days=!1,_.isNull(this.form.infoSec.data.contact_email)?this.form.infoSec.hasError.contact_email=!0:this.form.infoSec.hasError.contact_email=!1):(this.form.infoSec.hasError.notification_days=!1,this.form.infoSec.hasError.contact_email=!1),_.isNull(this.form.infoSec.data.background_check)?this.form.infoSec.hasError.background_check=!0:this.form.infoSec.hasError.background_check=!1,_.isNull(this.form.infoSec.data.drug_test)?this.form.infoSec.hasError.drug_test=!0:this.form.infoSec.hasError.drug_test=!1,_.isNull(this.form.infoSec.data.termination_notification)?this.form.infoSec.hasError.termination_notification=!0:this.form.infoSec.hasError.termination_notification=!1,this.form.infoSec.data.termination_notification?_.isEmpty(this.form.infoSec.data.termination_days)?this.form.infoSec.hasError.termination_days=!0:this.form.infoSec.hasError.termination_days=!1:this.form.infoSec.hasError.termination_days=!1,_.isNull(this.form.infoSec.data.review_interval)?this.form.infoSec.hasError.review_interval=!0:this.form.infoSec.hasError.review_interval=!1,_.isNull(this.form.infoSec.data.subcontract)?this.form.infoSec.hasError.subcontract=!0:this.form.infoSec.hasError.subcontract=!1):(this.form.infoSec.hasError.incident_notification=!1,this.form.infoSec.hasError.notification_days=!1,this.form.infoSec.hasError.contact_email=!1,this.form.infoSec.hasError.background_check=!1,this.form.infoSec.hasError.drug_test=!1,this.form.infoSec.hasError.termination_notification=!1,this.form.infoSec.hasError.termination_days=!1,this.form.infoSec.hasError.review_interval=!1,this.form.infoSec.hasError.
1subcontract=!1)),!(!this.form.infoSec.hasError.has_requirements&&!this.form.infoSec.hasError.incident_notification&&!this.form.infoSec.hasError.notification_days&&!this.form.infoSec.hasError.contact_email&&!this.form.infoSec.hasError.background_check&&!this.form.infoSec.hasError.drug_test&&!this.form.infoSec.hasError.termination_notification&&!this.form.infoSec.hasError.termination_days&&!this.form.infoSec.hasError.review_interval&&!this.form.infoSec.hasError.subcontract)),submit:()=>{this.form.infoSec.validate()||this.form.infoSec._post()}},drive:{_create:()=>{this.$buefy.dialog.confirm({title:"Create Drive Folder",message:"Building these folders onto SharePoint will take some time. You may safely leave this page or wait for a page refresh.<br/><br/>Do you wish to continue?",cancelText:"Cancel",confirmText:"Continue",type:"is-primary",onConfirm:()=>{axios.post("/api/Explorers/Companies/"+this.company_id+"/SharePoint/"+this.company.Company_Type_RecID).then(t=>{this.loadAsyncCompany()}).catch(t=>{}).finally(t=>{})}})},hasSharePointPermissionUID:t=>t!=null&&typeof t<"u"?!!t.permission_uid:!1},invoices:{data:[],loading:!0,_load:()=>{this.form.invoices.loading=!0;let t={page:1,per_page:20,status:"All",type:"default",company_recid:this.company_id};return axios.post("/api/Explorers/Invoices",t).then(e=>{this.form.invoices.data=e.data.invoices}).catch(e=>{this.form.invoices.data=[]}).finally(e=>{this.form.invoices.loading=!1})}},locations:{active:!1,data:{Address_Line1:null,Address_Line2:null,City:null,Company_Address_RecID:null,Company_Name:null,Company_RecID:null,PhoneNbr:null,Description:null,State_ID:null,Country_RecID:null,Zip:null,Ava_Validated_Flag:null,Default:null},edit:!1,filters:{search:"",active:"Active"},hasError:{Address_Line1:!1,City:!1,PhoneNbr:!1,Description:!1,State_ID:!1,Zip:!1},loading:!1,modal:{},saving:!1,defaultOptions:[{label:"Primary",field:"Default_Flag"},{label:"Mailing",field:"Default_Mail_Flag"},{label:"Billing",field:"Default_Bill_Flag"},{label:"Shipping",field:"Default_Ship_Flag"}],_post:t=>{this.form.locations.saving=!0,axios.post("/api/Explorers/Companies/Addresses/Store",this.form.locations.data).then(e=>{this.form.locations.saving=!1,this.loadAsyncCompany()}).catch(e=>{}).finally(e=>{this.form.locations.close()})},close:()=>{this._resetData(this.form.locations.data),this._deleteKeys(this.form.locations.modal),this._resetErrors(this.form.locations.hasError),this.form.locations.active=!1,this.form.locations.edit=!1},show:(t=null,e=null)=>{var s;if(this._resetErrors(this.form.locations.hasError),this.form.locations.data.Address_Line1=t==null?void 0:t.Address_Line1,this.form.locations.data.Address_Line2=t==null?void 0:t.Address_Line2,this.form.locations.data.City=t==null?void 0:t.City,this.form.locations.data.Ava_Validated_Flag=t==null?void 0:t.Ava_Validated_Flag,this.form.locations.data.Company_Address_RecID=t==null?void 0:t.Company_Address_RecID,this.form.locations.data.Company_Name=this.company.Company_Name,this.form.locations.data.Company_RecID=this.company.Company_RecID,this.form.locations.data.Inactive_Flag=(t==null?void 0:t.Inactive_Flag)??0,this.form.locations.data.PhoneNbr=t!=null&&t.PhoneNbr?this.$options.filters.phone(t.PhoneNbr):null,this.form.locations.data.Description=t==null?void 0:t.Description,this.form.locations.data.State_ID=t==null?void 0:t.State_ID,this.form.locations.data.Country_RecID=(s=this.country_options.find(i=>i.Country==(t==null?void 0:t.Country)))==null?void 0:s.Country_RecID,this.form.locations.data.Zip=t==null?void 0:t.Zip,this.form.locations.modal.states=this.state_options,this.form.locations.active=!0,this.form.locations.edit=!!t,!!t){for(const i of this.form.locations.defaultOptions)if(Number(t[i.field])){this.form.locations.data.Default=i.field;break}}},submit:()=>{this._validate("locations")&&this.form.locations._post()},checkAvalara:t=>{axios.get(`/api/Explorers/Companies/Addresses/${t.Company_Address_RecID}/Validate`).then(e=>{e.data.isValid?this.$buefy.toast.open({duration:2500,message:"Address Valid",type:"is-success"}):this.$buefy.toast.open({duration:2500,message:"Address Invalid",type:"is-danger"}),this.loadAsyncCompany()}).catch(e=>{}).finally(e=>{})},validateAvalara:t=>{axios.put(`/api/Explorers/Companies/Addresses/${t.Company_Address_RecID}/Validate`).then(e=>{this.form.locations.data.Ava_Validated_Flag=!!e.data.company_address.Ava_Validated_Flag,e.data.company_address.Ava_Validated_Flag?this.$buefy.toast.o
1pen({duration:2500,message:"Address Valid. Data Recorded.",type:"is-success"}):this.$buefy.toast.open({duration:2500,message:"Address Invalid. Data Recorded.",type:"is-danger"}),this.loadAsyncCompany()}).catch(e=>{}).finally(e=>{})},handleCountryInput:t=>{if(!this.form.locations.data.Country_RecID)return this.state_options;this.state_options.find(s=>s.State_ID==this.form.locations.data.State_ID).Country_RecID!=this.form.locations.data.Country_RecID&&(this.form.locations.data.State_ID=null)}},one_password:{active:!1,showErrors:!1,errors:null,data:{name:null,description:null},validations:{"form.one_password.data.name":[{type:"Required"}]},show:()=>{this.form.one_password.active=!0,this.form.one_password.data.name=this.company.Company_Name},close:()=>{this.form.one_password.active=!1,this.form.one_password.data.name=null,this.form.one_password.data.description=null},save:()=>{this.form.one_password.errors=this.$formErrors(this.$data,this.form.one_password.validations),_.isEmpty(this.form.one_password.errors)?axios.post("/api/Explorers/Companies/"+this.company_id+"/Vault",this.form.one_password.data).then(t=>{window.location.reload()}).catch(t=>{}).finally(t=>{}):this.form.one_password.showErrors=!0}},microsoft_teams:{active:!1,showErrors:!1,errors:null,data:{name:null,type:"Internal",description:null},validations:{"form.microsoft_teams.data.name":[{type:"Required"}],"form.microsoft_teams.data.type":[{type:"Calculation",eval:"_.findIndex(data.company.company_drive_groups, ['type', 'Internal']) >= 0",condition:"form.microsoft_teams.data.type === 'Internal'",errorMessage:"Internal team already exists. You may only create an External team."},{type:"Calculation",eval:"_.findIndex(data.company.company_drive_groups, ['type', 'External']) >= 0",condition:"form.microsoft_teams.data.type === 'External'",errorMessage:"External team already exists. You may only create an Internal team."}]},show:()=>{this.form.microsoft_teams.active=!0,this.form.microsoft_teams.formatName()},close:()=>{this.form.microsoft_teams.active=!1,this.form.microsoft_teams.data.name=null,this.form.microsoft_teams.data.description=null},save:()=>{this.form.microsoft_teams.errors=this.$formErrors(this.$data,this.form.microsoft_teams.validations),_.isEmpty(this.form.microsoft_teams.errors)?axios.post("/api/Explorers/Companies/"+this.company_id+"/MicrosoftTeam",this.form.microsoft_teams.data).then(t=>{window.location.reload()}).catch(t=>{}).finally(t=>{}):this.form.microsoft_teams.showErrors=!0},formatName:()=>{this.form.microsoft_teams.data.name=this.form.microsoft_teams.data.type==="External"?"c_"+this.company.Company_Name+"_EXT":"c_"+this.company.Company_Name}},orders:{data:[],loading:!0,_load:()=>{this.form.orders.loading=!0;let t={page:1,per_page:20,company_recid:this.company_id};return axios.post("/api/Explorers/Orders",t).then(e=>{this.form.orders.data=e.data.orders!==void 0?e.data.orders:[]}).catch(e=>{this.form.orders.data=[]}).finally(e=>{this.form.orders.loading=!1})}},photo:{active:!1,data:{file:null},deleting:!1,hasError:{file:!1},loading:!1,_delete:()=>{this.form.photo.deleting=!0,axios.delete("/api/Explorers/Companies/Profile/"+this.company.Company_RecID+"/Photo").then(t=>{window.location="/i/Explorers/Companies/"+this.company.Company_RecID}).catch(t=>{this.form.photo.data={}}).finally(t=>{this.form.photo.close()})},_post:()=>{if(this.form.photo.hasError.file=this.form.photo.data.file==null,!this.form.photo.hasError.file){this.form.photo.loading=!0;let t=new FormData;t.append("file",this.form.photo.data.file),axios.post("/api/Explorers/Companies/Profile/"+this.company.Company_RecID+"/Photo",t,{headers:{"Content-Type":"multipart/form-data"}}).then(e=>{window.location="/i/Explorers/Companies/"+this.company.Company_RecID}).catch(e=>{this.form.photo.data={}}).finally(e=>{this.form.photo.close()})}},close:()=>{this._resetData(this.form.photo.data),this._resetErrors(this.form.photo.hasError),this.form.photo.active=!1},remove:()=>{this.form.photo._delete()},show:()=>{this._resetErrors(this.form.photo.hasError),this.form.photo.data.file=null,this.form.photo.active=!0},submit:()=>{this.form.photo._post()}},products:{group:{active:!1,data:{},dataAtShow:{},errors:{name:!1},saving:!1,close:(t=!1)=>{!this.form.products.isFormDirty("group")||t?(this.form.products.group.active=!1,this.form.products.group.data={},this.form.products.group.dataAtShow={},this.form.products.group.errors.name=!1,this.form.products.group.saving=!1,this.form.products.line.data.product_group_id=null):this.$buefy.dialog.confirm({title:"Unsaved Changes",message:"Are you sure you want to cancel?",cancelText:"No",confirmText:"Yes",type:"is-success",onConfirm:()=>{this.form.products.group.close(!0)}})},defaultData:()=>({name:null,details:null,company_recid:null}),post:()=>{this.form.products.validate("group")&&(this.form.products.group.saving=!0,Vue.delete(this.form.products.group.data,"product_lines"),axios.post("/api/Explorers/Companies/"+this.company_id+"/ProductGroups",{data:this.form.products.group.data}).then(t=>{this.form.products.groups.load(),this.form.products.lines.load(),this.form.products.group.close(!0),this.form.products.line.data.product_group_id=t.data.id}).catch(t=>{}).finally(t=>{this.form.products.group.saving=!1}))},remove:t=>{this.$buefy.dialog.confirm({title:"Delete Product Group",message:"Are you sure you want to delete this product group?",cancelText:"Cancel",confirmText:"Delete",type:"is-danger",onConfirm:()=>{this.form.products.group.saving=!0,axios.delete("/api/Explorers/Companies/"+this.company_id+"/ProductGroups/"+t).then(e=>{this.form.products.groups.load(),this.form.products.lines.load(),this.form.products.group.close(!0)}).catch(e=>{}).finally(e=>{this.form.products.group.saving=!1})}})},show:(t=null)=>{this.form.products.group.data=this.form.products.group.defaultData(),t?(this.form.products.group.data={...t},this.form.products.group.dataAtShow={...t}):(this.form.products.group.data.company_recid=this.company.Company_RecID,this.form.products.group.dataAtShow={...this.form.products.group.data}),this.form.products.group.active=!0}},groups:{active:!1,loading:!1,data:[],close:()=>{this.form.products.groups.active=!1},load:()=>(this.form.products.groups.loading=!0,axios.get("/api/Explorers/Companies/"+this.company_id+"/ProductGroups").then(t=>{this.form.products.groups.data=t.data}).catch(t=>{this.form.products.groups.data=[]}).finally(t=>{this.form.products.groups.loading=!1})),show:()=>{this.form.products.groups.loading=!0,axios.all([this.form.products.lines.load()]).then(t=>{this.form.products.groups.loading=!1}),this.form.products.groups.active=!0}},line:{active:!1,add:!1,edit:!1,data:{},dataAtShow:{},errors:{},loading:!1,saving:!1,close:(t=!1)=>{!this.form.products.isFormDirty("line")||t?(this.form.products.line.active=!1,this.form.products.line.add=!1,this.form.products.line.edit=!1,this.form.products.line.data={},this.form.products.line.dataAtShow={},this.form.products.line.errors={},this.form.products.line.saving=!1):this.$buefy.dialog.confirm({title:"Unsaved Changes",message:"Are you sure you want to cancel?",cancelText:"No",confirmText:"Yes",type:"is-success",onConfirm:()=>{this.form.products.line.close(!0)}})},defaultData:()=>({name:null,details:null,logo_file:null,product_group_id:null,product_line_rating_id:null}),defaultErrors:()=>({name:!1,product_group_id:!1,product_line_rating_id:!1}),editSwitchDirtyDialog:()=>{this.form.products.isFormDirty("line")&&this.$buefy.dialog.confirm({title:"Unsaved Changes",message:"Are you sure you want to leave edit mode? All changes will be lost.",cancelText:"No",confirmText:"Yes",type:"is-success",onConfirm:()=>{this.form.products.line.edit=!1,this.form.products.line.data={...this.form.products.line.dataAtShow}},onCancel:()=>{this.form.products.line.edit=!0}})},logo:t=>t?t.path+t.name:"",post:()=>{if(this.form.products.validate("line")){this.form.products.line.saving=!0,Vue.delete(this.form.products.line.data,"logo"),Vue.delete(this.form.products.line.data,"rating");let t=new FormData;t.append("name",this.form.products.line.data.name),t.append("product_group_id",this.form.products.line.data.product_group_id),t.append("product_line_rating_id",this.form.products.line.data.product_line_rating_id),this.form.products.line.data.details&&t.append("details",this.form.products.line.data.details),this.form.products.line.data.id&&t.append("id",this.form.products.line.data.id),this.form.products.line.data.logo_file&&t.append("logo_file",this.form.products.line.data.logo_file),axios.post("/api/Explorers/Companies/"+this.company_id+"/ProductLines",t,{headers:{"Content-Type":"multipart/form-data"}}).then(e=>{this.form.products.line.close(!0),this.form.products.showcase.load(),this.form.products.lines.active&&this.form.products.lines.load()}).catch(e=>{}).finally(e=>{this.form.products.line.saving=!1})}},remove:()=>{this.$buefy.dialog.confirm({title:"Delete Product Line",message:"Are you sure you want to delete this product line?",cancelText:"Cancel",confirmText:"Delete",type:"is-danger",onConfirm:()=>{this.form.products.line.saving=!0,axios.delete("/api/Explorers/Companies/"+this.company_id+"/ProductLines/"+this.form.products.line.data.id).then(t=>{this.form.products.line.close(!0),this.form.products.showcase.load(),this.form.products.lines.load()}).catch(t=>{}).finally(t=>{this.form.products.line.saving=!1})}})},removeLogo:()=>{this.$buefy.dialog.confirm({title:"Delete Logo",message:"Are you sure you want to delete this logo? This action cannot be undone!",cancelText:"Cancel",confirmText:"Delete",type:"is-danger",onConfirm:()=>{axios.delete("/api/Explorers/Companies/"+this.company_id+"/ProductLineLogo/"+this.form.products.line.data.logo.id).then(t=>{this.form.products.line.data.logo=null,this.form.products.lines.load(),this.form.products.showcase.load()}).catch(t=>{}).finally(t=>{})}})},selectChanged:(t,e)=>{this.form.products.line.errors[e]=!1;let s=t.target.selectedOptions[0]._value?t.target.selectedOptions[0]._value:t.target.selectedOptions[0].value;s==0?this.form.products.line.data[e]=null:s==1?(this.form.products.group.show(),this.form.products.line.data[e]=!1):this.form.products.line.data[e]=s.id},show:(t=null)=>{this.form.products.line.data=this.form.products.line.defaultData(),this.form.products.line.errors=this.form.products.line.defaultErrors(),t?(this.form.products.line.data={...t},this.form.products.line.dataAtShow={...t}):(this.form.products.line.add=!0,this.form.products.line.dataAtShow={...this.form.products.line.data}),this.form.products.line.active=!0}},lines:{active:!1,data:[],loading:!1,load:()=>(this.form.products.lines.loading=!0,axios.get("/api/Explorers/Companies/"+this.company_id+"/ProductLines").then(t=>{this.form.products.lines.data=t.data}).catch(t=>{this.form.products.lines.data=[]}).finally(t=>{this.form.products.lines.loading=!1})),show:()=>{this.form.products.lines.load(),this.form.products.lines.active=!0}},showcase:{data:[],loading:!1,load:()=>(this.form.products.showcase.loading=!0,axios.get("/api/Explorers/Companies/"+this.company_id+"/ProductLinesShowcase").then(t=>{this.form.products.showcase.data=t.data}).catch(t=>{this.form.products.showcase.data=[]}).finally(t=>{this.form.products.showcase.loading=!1}))},isFormDirty:t=>{let e=!1,s=this.$objectDiff(this.form.products[t].data,this.form.products[t].dataAtShow);if(!_.isEmpty(s))for(let i of Object.keys(s))e=!(this.form.products[t].data[i]===""&&this.form.products[t].dataAtShow[i]===null);return this.form.products[t].data.logo_file!==this.form.products[t].dataAtShow.logo_file&&(e=!0),e},ratingStyle:t=>t===3?"text-success-500":t===2?"text-warn-600":t===1?"text-stop-300":"text-gray-400",validate:t=>{let e=!0;
1return Object.keys(this.form.products[t].errors).forEach(s=>{_.isNull(this.form.products[t].data[s])&&(this.form.products[t].errors[s]=!0,e=!1)}),e}},profile:{active:!1,data:{account_number:null,buying_arms:null,compunet_line_card:null,company_type_recid:null,current_promos:null,details:null,key_contacts:null,key_manufacturers:null,overview:null,partner_level:null,partner_portal:null,pricing:null,quick_details:null,vendor_portfolio_option_id:null,website:null},dataAtShow:{},hasError:{compunet_line_card:!1,partner_portal:!1,website:!1},loading:!0,modals:{invoices_active:!1,overview_active:!1,overview_clamped:!1,quick_details_active:!1,quick_details_clamped:!1,recent_orders_active:!1,certificate_holders:{active:!1,filter:{values:{per_page:30,pages:1,cert:null,user:null,status:null,terminated:null,market:null}},slide_over:!1,certCount:null,certificate:{},numCerticateHolders:null,calcNumCertificateHolders:()=>{let t=[],e=new Set;this.filtered_vendor_certifications.forEach(s=>{t.push(s.users)});for(let s=0;s<t.length;s++)for(let i=0;i<t[s].length;i++)e.add(t[s][i].user.name);this.form.profile.modals.certificate_holders.numCerticateHolders=e.size},calcNumCertificates:()=>this.company.certifications.map(t=>t.users.length).reduce((t,e)=>t+e,0),openModal:()=>{this.filtered_vendor_certifications=this.company.certifications,this.form.profile.modals.certificate_holders.certCount=this.form.profile.modals.certificate_holders.calcNumCertificates(),this.form.profile.modals.certificate_holders.active=!0,this.form.profile.modals.certificate_holders.calcNumCertificateHolders()},closeModal:()=>{this.form.profile.modals.certificate_holders.filter.values.cert=null,this.form.profile.modals.certificate_holders.filter.values.market=null,this.form.profile.modals.certificate_holders.filter.values.user=null,this.form.profile.modals.certificate_holders.filter.values.status=null,this.form.profile.modals.certificate_holders.filter.values.terminated=null,this.form.profile.modals.certificate_holders.active=!1,this.form.profile.modals.certificate_holders.slide_over=!1},openSlide:t=>{this.form.profile.modals.certificate_holders.certificate=t,this.form.profile.modals.certificate_holders.slide_over=!0},closeSlide:()=>{this.form.profile.modals.certificate_holders.certificate={},this.form.profile.modals.certificate_holders.slide_over=!1}},vendor_program_members:{options:{program_names:[],roles:[],users:[]},filter:{values:{per_page:30,page:1,program_name:null,role:"All",user:"All"}},active:!1,slide_over:!1,program:{},sortRoles:()=>{this.vendor_program_roles.sort((t,e)=>t.role_name<e.role_name?-1:t.role_name>e.role_name?1:0)},sortUsers:()=>{this.vendor_program_users.sort((t,e)=>t.name<e.name?-1:t.name>e.name?1:0)},setDefaultOptions:()=>{this.filtered_vendor_programs.forEach(t=>{this.form.profile.modals.vendor_program_members.options.program_names.push(t.program_name)})},reset_vendor_program_filters:()=>{this.form.profile.modals.vendor_program_members.filter.values.program_name=null,this.form.profile.modals.vendor_program_members.filter.values.role="All",this.form.profile.modals.vendor_program_members.filter.values.user="All"},itemize_searched_programs:()=>{this.searched_vendor_programs.forEach((t,e)=>{this.$set(this.searched_vendor_programs[e],"members_count",0),this.$set(this.searched_vendor_programs[e],"photos",[]);for(let s=0;s<t.roles.length;s++){this.searched_vendor_programs[e].members_count+=t.roles[s].role_users.length;for(let i=0;i<t.roles[s].role_users.length;i++)t.roles[s].role_users[i].primary?this.searched_vendor_programs[e].photos.unshift(t.roles[s].role_users[i].user.photos):this.searched_vendor_programs[e].photos.push(t.roles[s].role_users[i].user.photos)}}),this.filtered_vendor_programs=[...this.searched_vendor_programs]},closeModal:()=>{this.form.profile.modals.vendor_program_members.reset_vendor_program_filters(),this.form.profile.modals.vendor_program_members.active=!1,this.form.profile.modals.vendor_program_members.closeSlide()},closeSlide:()=>{this.form.profile.modals.vendor_program_members.program={},this.form.profile.modals.vendor_program_members.slide_over=!1},openModal:()=>{this.filtered_vendor_programs=[...this.company.vendor_programs],this.company.vendor_programs.forEac
1h((t,e)=>{this.$set(this.company.vendor_programs[e],"members_count",0),this.$set(this.company.vendor_programs[e],"photos",[]);for(let s=0;s<t.roles.length;s++){this.company.vendor_programs[e].members_count+=t.roles[s].role_users.length;for(let i=0;i<t.roles[s].role_users.length;i++)t.roles[s].role_users[i].primary?this.company.vendor_programs[e].photos.unshift(t.roles[s].role_users[i].user.photos):this.company.vendor_programs[e].photos.push(t.roles[s].role_users[i].user.photos)}}),this.form.profile.modals.vendor_program_members.setDefaultOptions(),this.company.vendor_programs.forEach(t=>{t.roles.forEach(e=>{this.vendor_program_roles.findIndex(s=>e.role_name===s.role_name)===-1&&this.vendor_program_roles.push(e),e.role_users.forEach(s=>{this.vendor_program_users.findIndex(i=>s.user.name===i.name)===-1&&this.vendor_program_users.push(s.user)})})}),this.form.profile.modals.vendor_program_members.sortRoles(),this.form.profile.modals.vendor_program_members.sortUsers(),this.form.profile.modals.vendor_program_members.active=!0},openSlide:t=>{this.form.profile.modals.vendor_program_members.program=t,this.form.profile.modals.vendor_program_members.slide_over=!0}},supplierRatingList:{toastDuration:1500,active:!1,loading:!1,userAlreadyRated:!1,filters:{starCount:[],order:"Top Reviews"},starCountFilterOptions:[5,4,3,2,1],orderFilterOptions:["Top Reviews","Most Recent"],data:[],categoryAverages:[],overallAverage:0,maxStars:0,categoryOptions:[],closeStarFilterDropdown:t=>{t||this.form.profile.modals.supplierRatingList.load()},load:()=>{this.form.profile.modals.supplierRatingList.loading=!0;const t=this.user_id;axios.get("/api/Explorers/Companies/"+this.company_id+"/SupplierRatings",{params:{...this.form.profile.modals.supplierRatingList.filters,userID:t}}).then(e=>{this.form.profile.modals.supplierRatingList.data=e.data.data,this.form.profile.modals.supplierRatingList.categoryAverages=e.data.categoryAverages,this.form.profile.modals.supplierRatingList.overallAverage=e.data.overallAverage,this.form.profile.modals.supplierRatingList.maxStars=e.data.maxStars,this.form.profile.modals.supplierRatingList.totalRatings=e.data.totalRatings,this.form.profile.modals.supplierRatingList.categoryOptions=e.data.categoryOptions,this.form.profile.modals.supplierRatingList.userAlreadyRated=e.data.previousRating}).catch(e=>{}).finally(e=>{this.form.profile.modals.supplierRatingList.loading=!1,this.form.profile.modals.supplierRatingList.clampReviews()})},open:()=>{this.form.profile.modals.supplierRatingList.active=!0,this.form.profile.modals.supplierRatingList.load()},close:()=>{this.form.profile.modals.supplierRatingList.active=!1,this.loadAsyncCompany()},clampReviews:()=>{this.form.profile.modals.supplierRatingList.data.forEach((e,s)=>{const i="review"+e.id,a=this.$refs[i];if(a&&a.length){const r=a[0],n=parseFloat(getComputedStyle(r).lineHeight)*3;this.$set(this.form.profile.modals.supplierRatingList.data[s],"clamp",r.scrollHeight>n)}})},helpfulRating:{loading:!1,markHelpful:t=>{this.form.profile.modals.supplierRatingList.helpfulRating.loading=!0;const e=this.form.profile.modals.supplierRatingList.data[t];if(e.marked_helpful)this.form.profile.modals.supplierRatingList.helpfulRating.deleteHelpfulMark(t,e.marked_helpful);else{const s={userID:this.user_id};this.form.profile.modals.supplierRatingList.helpfulRating.addHelpfulMark(t,s)}},addHelpfulMark:(t,e)=>{const s=this.form.profile.modals.supplierRatingList.data[t];axios.post(`/api/Explorers/Companies/${this.company_id}/SupplierRatings/${s.id}/Helpful`,e).then(i=>{i.data.errors?Object.keys(i.data.errors).forEach(r=>{this.$buefy.toast.open({duration:3e3,message:i.data.errors[r],type:"is-danger",queue:!1})}):(this.$set(this.form.profile.modals.supplierRatingList.data[t],"marked_helpful",i.data.id),this.$set(this.form.profile.modals.supplierRatingList.data[t],"helpful_ratings_count",s.helpful_ratings_count+1),this.$buefy.toast.open({duration:3e3,message:"Successfully marked review as helpful",type:"is-success",queue:!1}))}).catch(i=>{}).finally(i=>{this.form.profile.modals.supplierRatingList.helpfulRating.loading=!1})},deleteHelpfulMark:(t,e)=>{const s=this.form.profile.modals.supplierRatingList.data[t];axios.delete(`/api/Explorers/Companies/${this.company_id}/SupplierRatings/${s.id}/Helpful/${e}`).then(i=>
1{i.data.errors?Object.keys(i.data.errors).forEach(r=>{this.$buefy.toast.open({duration:3e3,message:i.data.errors[r],type:"is-danger",queue:!1})}):(this.$set(this.form.profile.modals.supplierRatingList.data[t],"marked_helpful",null),this.$set(this.form.profile.modals.supplierRatingList.data[t],"helpful_ratings_count",s.helpful_ratings_count-1),this.$buefy.toast.open({duration:3e3,message:"Removed mark as helpful",type:"is-success",queue:!1}))}).catch(i=>{}).finally(i=>{this.form.profile.modals.supplierRatingList.helpfulRating.loading=!1})}},showText:t=>{this.$set(this.form.profile.modals.supplierRatingList.data[t],"isExpanded",!0)},hideText:t=>{this.$set(this.form.profile.modals.supplierRatingList.data[t],"isExpanded",!1)}},supplierRating:{action:"Create",active:!1,originalData:{},loading:!1,averageStars:0,data:{},open:()=>{this.form.profile.modals.supplierRating.loading=!0,this.form.profile.modals.supplierRating.active=!0,this.form.profile.modals.supplierRating.loadRatings()},loadRatings:()=>{axios.get(`/api/Explorers/Companies/${this.company_id}/Users/${this.user_id}/SupplierRating`).then(t=>{this.$set(this.form.profile.modals.supplierRating,"data",t.data.results),this.form.profile.modals.supplierRating.originalData=_.cloneDeep(t.data.results),this.form.profile.modals.supplierRating.averageStars=t.data.averageStars,this.form.profile.modals.supplierRating.action=t.data.averageStars?"Edit":"Create"}).catch(t=>{}).finally(t=>{this.form.profile.modals.supplierRating.loading=!1})},submit:()=>{if(this.form.profile.modals.supplierRating.action,!this.form.profile.modals.supplierRating.validateAll())return;if(!this.form.profile.modals.supplierRating.hasChanges()){this.form.profile.modals.supplierRating.close();return}this.form.profile.modals.confirmRating.open()},hasChanges:()=>!_.isEqual(this.form.profile.modals.supplierRating.data,this.form.profile.modals.supplierRating.originalData),clearRating:t=>{this.form.profile.modals.supplierRating.data.categories[t].stars=0},validateAll:()=>Object.keys(this.form.profile.modals.supplierRating.validateFuncs).map(s=>this.form.profile.modals.supplierRating.validateFuncs[s]()).every(s=>s===!0),validateFuncs:{review:()=>{const t=this.form.profile.modals.supplierRating.data.review,e=typeof t,s=t===null,i=e==="string",a=i?t.trim()==="":!1;return i&&a&&(this.form.profile.modals.supplierRating.data.review=null),s||i},ratings:()=>this.form.profile.modals.supplierRating.data.categories.filter(e=>{const s=e.stars>this.form.profile.modals.supplierRating.data.max_stars,i=e.stars<=0;return s&&i}).length===0},close:()=>{this.form.profile.modals.supplierRating.active=!1},delete:()=>{this.form.profile.modals.supplierRating.loading=!0;const t=this.form.profile.modals.supplierRating.data.id;axios.delete(`/api/Explorers/Companies/${this.company_id}/SupplierRatings/${t}`).then(e=>{this.form.profile.modals.supplierRating.close(),this.form.profile.modals.supplierRatingList.load()}).catch(e=>{}).finally(e=>{this.form.profile.modals.supplierRating.loading=!1})},put:t=>{const e={...t,userID:this.user_id},s=t.id;axios.put(`/api/Explorers/Companies/${this.company_id}/SupplierRatings/${s}`,e).then(i=>{this.form.profile.modals.supplierRating.close(),this.form.profile.modals.confirmRating.close(),this.form.profile.modals.supplierRatingList.load(),this.$buefy.toast.open({duration:2500,message:"Review Updated Successfully",type:"is-success"})}).catch(i=>{}).finally(i=>{this.form.profile.modals.supplierRating.loading=!1})},post:t=>{const e={...t,userID:this.user_id};axios.post(`/api/Explorers/Companies/${this.company_id}/SupplierRatings`,e).then(s=>{this.form.profile.modals.supplierRating.close(),this.form.profile.modals.confirmRating.close(),this.form.profile.modals.supplierRatingList.load(),this.$buefy.toast.open({duration:2500,message:"Review Created Successfully",type:"is-success"})}).catch(s=>{}).finally(s=>{this.form.profile.modals.supplierRating.loading=!1})}},confirmRating:{active:!1,open:()=>{this.form.profile.modals.confirmRating.active=!0},close:()=>{this.form.profile.modals.confirmRating.active=!1},submit:()=>{const t=this.form.profile.modals.supplierRating.action;if(!this.form.profile.modals.supplierRating.validateAll())return;if(!this.form.profile.modals.supplierRating.hasChanges()){this.form.profile.modals.supplierRating.close();return}this.form.profile.modals.supplierRating.loading=!0;const i=this.form.profile.modals.supplierRating.data;if(t==="Create"){this.form.profile.modals.supplierRating.post(i);return}this.form.profile.modals.supplierRating.put(i)}},reportReview:{active:!1,loading:!1,data:{},errors:{reportedReason:""},reviewBeingReported:{},setData:()=>{const t=this.user_id;this.form.profile.modals.reportReview.data={reportedReason:"",userID:t}},setReviewBeingReported:t=>{this.form.profile.modals.reportReview.reviewBeingReported=_.cloneDeep(this.form.profile.modals.supplierRatingList.data[t])},open:t=>{this.form.profile.modals.reportReview.active=!0,this.form.profile.modals.reportReview.setReviewBeingReported(t),this.form.profile.modals.reportReview.setData()},close:()=>{this.form.profile.modals.reportReview.active=!1},submit:()=>{if(!this.form.profile.modals.reportReview.isValid()){this.form.profile.modals.reportReview.errors.reportedReason="You must provide the reason you are reporting this review";return}const e=this.form.profile.modals.reportReview.data;this.form.profile.modals.reportReview.create(e)},create:t=>{this.form.profile.modals.reportReview.loading=!0;const e=this.form.profile.modals.reportReview.reviewBeingReported.id;axios.post(`/api/Explorers/Companies/${this.company_id}/SupplierRatings/${e}/Report`,t).then(s=>
1{if(s.data.errors){Object.keys(s.data.errors).forEach(a=>{this.$buefy.toast.open({duration:3e3,message:s.data.errors[a],type:"is-danger",queue:!1})});return}else this.$buefy.toast.open({duration:3e3,message:"Successfully reported review",type:"is-success",queue:!1});this.form.profile.modals.reportReview.loading=!1,this.form.profile.modals.reportReview.close(),this.form.profile.modals.supplierRatingList.load()}).catch(s=>{}).finally(s=>{this.form.profile.modals.reportReview.loading=!1})},isValid:()=>this.form.profile.modals.reportReview.data.reportedReason.trim()!=""}},_post:()=>{var t=this.form.profile.data;axios.post("/api/Explorers/Companies/"+this.company_id,t).then(e=>{this.company=e.data,this.loadAsyncCompany()}).catch(e=>{this.company=null}).finally(e=>{this.form.profile.modals.overview_clamped=this.isLineClamped(this.$refs.overview),this.form.profile.modals.quick_details_clamped=this.isLineClamped(this.$refs.details),this.form.profile.close(!0)})},close:(t=!1)=>{!this.form.profile.isFormDirty()||t?(this._resetData(this.form.profile.data),this._resetErrors(this.form.profile.hasError),this.form.profile.dataAtShow={},this.form.profile.active=!1):this.$buefy.dialog.confirm({title:"Unsaved Changes",message:"Are you sure you want to cancel?",cancelText:"No",confirmText:"Yes",type:"is-success",onConfirm:()=>{this.form.profile.close(!0)}})},isFormDirty:()=>{var s,i;let t=!1,e=this.$objectDiff(this.form.profile.data,this.form.profile.dataAtShow);if(!_.isEmpty(e))for(let a of Object.keys(e))((i=this.form.profile.data[a])==null?void 0:i.toString().localeCompare((s=this.form.profile.dataAtShow[a])==null?void 0:s.toString()))!==0&&(t=!(this.form.profile.data[a]===""&&this.form.profile.dataAtShow[a]===null));return t},show:()=>{var t,e,s,i,a,r,o,n,l,c,m,d,h,p,u,g,f,y,v,b,E,D,w,C,S,k,R,x,A,I,T,M,L,P,N,$,F,O,B,j,q,H,Y,V,U;this._resetErrors(this.form.profile.hasError),this.form.profile.data.account_number=((s=(e=(t=this.company)==null?void 0:t.profile)==null?void 0:e.profile_data)==null?void 0:s.account_number)??null,this.form.profile.data.buying_arms=((r=(a=(i=this.company)==null?void 0:i.profile)==null?void 0:a.profile_data)==null?void 0:r.buying_arms)??null,this.form.profile.data.compunet_line_card=((l=(n=(o=this.company)==null?void 0:o.profile)==null?void 0:n.profile_data)==null?void 0:l.compunet_line_card)??null,this.form.profile.data.company_type_recid=this.company.Company_Type_RecID,this.form.profile.data.current_promos=((d=(m=(c=this.company)==null?void 0:c.profile)==null?void 0:m.profile_data)==null?void 0:d.current_promos)??null,this.form.profile.data.details=((u=(p=(h=this.company)==null?void 0:h.profile)==null?void 0:p.profile_data)==null?void 0:u.details)??null,this.form.profile.data.key_contacts=((y=(f=(g=this.company)==null?void 0:g.profile)==null?void 0:f.profile_data)==null?void 0:y.key_contacts)??null,this.form.profile.data.key_manufacturers=((E=(b=(v=this.company)==null?void 0:v.profile)==null?void 0:b.profile_data)==null?void 0:E.key_manufacturers)??null,this.form.profile.data.overview=((C=(w=(D=this.company)==null?void 0:D.profile)==null?void 0:w.profile_data)==null?void 0:C.overview)??null,this.form.profile.data.partner_level=((R=(k=(S=this.company)==null?void 0:S.profile)==null?void 0:k.profile_data)==null?void 0:R.partner_level)??null,this.form.profile.data.partner_portal=((I=(A=(x=this.company)==null?void 0:x.profile)==null?void 0:A.profile_data)==null?void 0:I.partner_portal)??null,this.form.profile.data.pricing=((L=(M=(T=this.company)==null?void 0:T.profile)==null?void 0:M.profile_data)==null?void 0:L.pricing)??null,this.form.profile.data.quick_details=(($=(N=(P=this.company)==null?void 0:P.profile)==null?void 0:N.profile_data)==null?void 0:$.quick_details)??null,this.form.profile.data.tier=(F=this.company)!=null&&F.Tier?this.company.Tier:"None",this.form.profile.data.training=((j=(B=(O=this.company)==null?void 0:O.profile)==null?void 0:B.profile_data)==null?void 0:j.training)??null,this.form.profile.data.vendor_portfolio_option_id=((H=(q=this.company)==null?void 0:q.profile)==null?void 0:H.vendor_portfolio_option_id)??null,this.form.profile.data.website=((U=(V=(Y=this.company)==null?void 0:Y.profile)==null?void 0:V.profile_data)==null?void 0:U.website)??null,this.form.profile.dataAtShow={...this.form.profile.data},this.form.profile.active=!0},submit:()=>
1{this._validate("profile")&&this.form.profile._post()}},tags:{active:!1,data:{selected_tags:null},edit:!1,hasError:{},loading:!1,modal:{filter_type:"All",filtered_tags:null,selectable_tags:null,tag_types:null},_delete:()=>{axios.delete("/api/Explorers/Companies/"+this.company.Company_RecID+"/RemoveTag/"+this.form.tags.data.selected_tags[0].id).then(t=>{}).catch(t=>{}).finally(t=>{this.company.tags.indexOf(this.form.tags.data.index)&&this.company.tags.splice(this.form.tags.data.index,1),this.form.tags.close()})},_load:()=>{var t={filter_name:null,filter_type:this.form.tags.modal.filter_type};axios.post("/api/Explorers/Companies/"+this.company.Company_RecID+"/TagFilter",t).then(e=>{this.form.tags.modal.selectable_tags=e.data.tags,this.form.tags.modal.filtered_tags=e.data.tags,this.form.tags.modal.tag_types=e.data.tag_types}).catch(e=>{this.form.tags.modal.selectable_tags=[],this.form.tags.modal.tag_types=[]}).finally(e=>{})},_post:t=>{axios.post("/api/Explorers/Companies/"+this.company_id+"/AddTags",t).then(e=>{this.company.tags=e.data}).catch(e=>{}).finally(e=>{this.form.tags.close()})},close:()=>{this._resetData(this.form.tags.modal),this._resetData(this.form.tags.data),this._resetErrors(this.form.tags.hasError),this.form.tags.modal.filter_type="All",this.form.tags.active=!1,this.form.tags.edit=!1},filter:t=>{this.form.tags.modal.filtered_tags=this.form.tags.modal.selectable_tags.filter(e=>e.name.toString().toLowerCase().indexOf(t.toLowerCase())>=0)},remove:()=>{this.$buefy.dialog.confirm({title:"Remove Tag",message:"Are you sure you want to remove this tag?",cancelText:"No",confirmText:"Yes",type:"is-success",onConfirm:()=>{this.form.tags._delete()}})},show:(t=null,e=null)=>{this._resetErrors(this.form.tags.hasError),this.form.tags._load(),t?(this.form.tags.data.selected_tags=[t],this.form.tags.data.index=e,this.form.tags.active=!0,this.form.tags.edit=!0):(this.form.tags.active=!0,this.form.tags.edit=!1)},submit:()=>{if(!this.form.tags.data.selected_tags)return!1;var t={};t.tag_ids=this.form.tags.data.selected_tags.map(function(e,s){return e.id}),this.form.tags._post(t)}},team:{active:!1,data:{member:null,role:null,role_description:null},email:()=>{var t;return _.map(_.filter((t=this.company)==null?void 0:t.sortedTeam,e=>_.includes(["Primary AE","Primary AM"],e.role.Role_Desc)?!0:e.user.department=="Engineering"),"user.email").join(",")},edit:{active:!1,data:{member:null,role:null,role_description:null},hasError:{update:!1,invalid_role:!1},_update:()=>{let t={};for(const e in this.form.team.edit.data)t[e]=this.form.team.edit.data[e];t.by=this.user_id,t.enrollment_form=this.form.team.enrollment.data,t.company_name=this.company.Company_Name,axios.patch("/api/Explorers/Companies/"+this.company_id+"/Team/"+this.form.team.edit.data.member.Company_Team_RecID+"/By/"+this.cw_member_recid,t).then(e=>{this.loadAsyncCompany(),this.form.team.edit.close(),this.form.team.enrollment.close()}).catch(e=>{}).finally(e=>{})},update:()=>{var i;let t=!1;var e=["Primary AE","Primary AM","Accounting Associate"],s=!1;(i=this.company)==null||i.sortedTeam.forEach(a=>{_.indexOf(e,a.role.Role_Desc)>-1&&a.role.Role_Desc==this.form.team.edit.data.role.Role_Desc&&(s=!0),a.Member_RecID===this.form.team.edit.data.member.Member_RecID&&(a.role.Role_Desc!==this.form.team.edit.data.role.Role_Desc||a.drive.role_description!==this.form.team.edit.data.role_description)&&(t=!0)}),this.form.team.edit.hasError.invalid_role=s,t||(this.form.team.edit.hasError.update=!0),!(_.filter(this.form.team.edit.hasError,a=>!!a).length>0)&&t&&(_.indexOf(["Primary Engineer","Engineer","Primary Architect","Project Management","Adoption Engineer","Architect","Engineering Manager"],this.form.team.edit.data.role.Role_Desc)>-1?this.form.team.enrollment.active=!0:(this.form.team.enrollment.data={},this.form.team.edit._update()))},close:()=>{this._resetData(this.form.team.edit.data),this._resetErrors(this.form.team.edit.hasError),this.form.team.edit.active=!1},show:t=>{this._resetData(this.form.team.edit.data),this._resetErrors(this.form.team.edit.hasError),this._resetErrors(this.form.team.hasError),this.form.team.edit.data.member=t,this.form.team.edit.data.role=t.role,this.form.team.edit.data.role_description=t.drive.role_description,this.form.team.edit.active=!0}},enrollment:{active:!1,data:{assets:null,credentials:!1,customer_laptop:!1,date_enrolled:!1,date_enrollment_updated:null,parking_pass:!1,physical_access:!1,vm_access:!1,vpn_access:!1},hasError:{credentials:!1,customer_laptop:!1,parking_pass:!1,physical_access:!1,vm_access:!1,vpn_access:!1},close:()=>{this._resetData(this.form.team.enrollment.data),this.form.team.enrollment.data.credentials=!1,this.form.team.enrollment.data.customer_laptop=!1,this.form.team.enrollment.data.date_enrolled=!1,this.form.team.enrollment.data.parking_pass=!1,this.form.team.enrollment.data.physical_access=!1,this.form.team.enrollment.data.vm_access=!1,this.form.team.enrollment.data.vpn_access=!1,this.form.team.enrollment.active=!1},submit:()=>{let t=!0;
1Object.keys(this.form.team.enrollment.hasError).forEach(e=>{_.isNull(this.form.team.enrollment.data[e])&&(this.form.team.enrollment.hasError[e]=!0,t=!1)}),t&&this.form.team._post()}},hasError:{member:!1,role:!1},loading:!1,modals:{descriptions:{"Primary AE":"The CompuNet Account Executive assigned to the account. Should be informed of all customer conversations and activity.","Primary AM":"The CompuNet Account Manager assigned to service the account.  Should be aware or involved in all quotes and customer opportunities.","Primary Engineer":"Engineers with Deep relationships who should be included on discussions relevant to customer needs/wants to access impact to their specialties.","Primary Architect":"Engineers or Architects who participate in multi-discipline longer term planning discussions with the customer.","Project Manager":"Front end facing engaged in paying engagements with customers to provide project management in support of product or services purchased from CompuNet.","Service Delivery":"Engineering Operations to coordinate the delivery and Scheduling of Services for the customer.","Contract Support":"Customer Contact for long term support contracts related to technologies - ex.. Smartnet, Microsoft Licensing, etc.","Adoption Engineer":"Technical application specialist who demos software capabilities, on-boards new SaaS subscription customers, trains administrators/end-users, and develops custom end-user guides/documentation for customers.","Success Manager":"Application solution sales specialist focused on helping customers identify application use cases, define success criteria, and measure successful outcomes.","Program Ops Manager":"Focused on ensuring partnership program compliance and supports successful funding efforts.","Financial Support":"Focused on AR/AP and terms with customer.","Fulfillment Support":"Focused on Delivery, Shipping and Fulfillment of orders.","Customer Service":"Focused on customer service audit or service review.",DSP:"Focused on executing and unifying CompuNet's strategy and messaging for partnership relationships and programs.","Secondary AE":"Someone covering for the Primary Account Executive.","Secondary AM":"Someone covering for the Primary Account Manager.","Associate AM":"Sales support for the Primary Account Manager and Primary Account Executive.",Engineer:"Engineer who is brought into account on an as needed basis.  Not notified of all customer activity and not involved in all account planning activities.",Architect:"Architect who is brought into account on an as needed basis.  Not notified of all customer activity and not involved in all account planning activities.","Engineering Manager":"Managers and Directors who require access to audit and review employees customer interactions."},prospect_descriptions:{"Primary AE":"The CompuNet Account Executive assigned to the account. Should be informed of all customer conversations and activity.","Primary AM":"The CompuNet Account Manager assigned to service the account.  Should be aware or involved in all quotes and customer opportunities."},members:[],role_description_active:!1,roles_active:!1,reject_active:!1},removing:!1,saving:!1,sortedTeamSliced:[],width:null,_delete:t=>{this.form.team.removing=!0,axios.delete("/api/Explorers/Companies/"+this.company_id+"/Team/"+t).then(e=>{this.loadAsyncCompany(),this.form.team.show()}).catch(e=>{}).finally(e=>{this.form.team.removing=!1})},_post:()=>{let t={};for(const e in this.form.team.data)t[e]=this.form.team.data[e];t.by=this.user_id,t.enrollment_form=this.form.team.enrollment.data,t.company_name=this.company.Company_Name,t.prospect=this.isLead,!this.form.team.hasError.member&&!this.form.team.hasError.role&&(this.form.team.saving=!0,axios.post("/api/Explorers/Companies/"+this.company_id+"/Team",t).then(e=>{if(this.loadAsyncCompany(),!this.isSuperAdmin&&!this.isDriveUserAdmin){let s=!1,i='<br/><br/>Please acknowledge:<div class="content is-mb-3"><ul>';this.form.contracts!=null&&this.form.contracts.count!=null&&(this.form.contracts.count.BAA>0&&(s=!0,i+="<li>This customer has a BAA on file.</li>"),this.form.contracts.count.NDA>0&&(s=!0,i+="<li>This customer has a NDA on file.</li>")),i+="</ul></div>";let a="If contracts are present you <strong>must sign</strong> them to maintain access to the SharePoint folder. You must sign all contracts before their agreement date starts, or if that has passed, before the day has ended.<br/><br/>You will have temporary membership to this team and its SharePoint folder, if available, for up to 48 hours. If you are approved your membership will continue uninterrupted. If declined you will be removed from this team and its SharePoint folder. You can request to have membership again.";s&&(a+=i),this.$buefy.dialog.alert({title:"New Team Member",message:a})}
1else this.$buefy.toast.open({duration:1500,message:"Team Member Added",type:"is-success"})}).catch(e=>{}).finally(e=>{this.$refs.autocomplete_members.setSelected(""),this.form.team.enrollment.close(),this._resetData(this.form.team.data),this.form.team.modals.members=[],this.form.team.saving=!1}))},close:()=>{var t;this._resetData(this.form.team.data),this._resetErrors(this.form.team.hasError),this.form.team.modals.members=[],this.form.team.sortedTeamSliced=[...(t=this.company)==null?void 0:t.sortedTeam].splice(0,this.availableTeamSpots),this.form.team.active=!1},onCompanyTeam:t=>{var e;for(let s=0;s<this.company.sortedTeam.length;s++)if(((e=this.company)==null?void 0:e.sortedTeam[s].user.id)==t.id)return!0;return!1},remove:t=>{this.$buefy.dialog.confirm({title:"Remove Team Member",message:"Doing this will permanently remove the current member's permission from SharePoint and signatures for this customer.<br/><br/>Do you want to continue?",cancelText:"Cancel",confirmText:"Continue",type:"is-danger",onConfirm:()=>{this.form.team._delete(t)}})},show:()=>{this._resetErrors(this.form.team.hasError),this.form.team.active=!0,this.form.team.width=window.innerWidth},submit:()=>{var t;if(_.isEmpty(this.form.team.data.member)?this.form.team.hasError.member=!0:this.form.team.hasError.member=this.form.team.onCompanyTeam(this.form.team.data.member),this.form.team.data.role==null)this.form.team.hasError.role=!0;else{let e=!1,s=!1;(t=this.company)==null||t.sortedTeam.forEach(i=>{i.role.Role_Desc==="Primary AE"?e=!0:i.role.Role_Desc==="Primary AM"&&(s=!0)}),this.form.team.data.role.Role_Desc=="Primary AE"&&e?this.form.team.hasError.role=!0:this.form.team.data.role.Role_Desc=="Primary AM"&&s&&(this.form.team.hasError.role=!0)}!this.form.team.hasError.member&&!this.form.team.hasError.role&&(_.indexOf(["Primary Engineer","Engineer","Primary Architect","Project Management","Adoption Engineer","Architect","Engineering Manager"],this.form.team.data.role.Role_Desc)>-1?this.form.team.enrollment.active=!0:(this.form.team.enrollment.data={},this.form.team._post()))}},timeline:{active:!1,reloadKey:0,close:()=>{this.form.timeline.active=!1,this.form.timeline.reloadKey+=1},show:()=>{this.form.timeline.active=!0}},settings:{active:!1,loading:!1,data:{master_customer_agent_id:null,allowsPartialInvoicing:null,allowsMyHubServiceTickets:null,requiresDrugScreening:null,requiresBackgroundChecks:null,poRequired:null,contacts:[],domains:[],tenants:[],ciscoContracts:[],awsMarketplaceBusinessIDs:[],aliases:[],tiers:[],tpids:[],isDirty:!1,subcontractor:{hasSubcontractor:null,w9:null,partner_agreement:null,coi:null,performsDrugScreening:null,performsBackgroundChecks:null}},close:()=>{this.form.settings.data.isDirty&&this.$buefy.dialog.confirm({title:"Unsaved Changes to Company Settings",message:"There are unsaved changes to the company settings, would you like to save them?",cancelText:"Cancel",confirmText:"Confirm",type:"is-success",onConfirm:()=>{this.form.settings.data.isDirty=!1,this.saveSettings(),this.form.settings.active=!1},onCancel:()=>{this.loadSettings(),this.form.settings.data.isDirty=!1,this.form.settings.active=!1}}),this.form.settings.data.isDirty=!1,this.form.settings.active=!1},open:()=>{this.loadSettings(),this.form.settings.active=!0},submit:()=>{this.$emptyString(this.form.settings.data.master_customer_agent_id)&&(this.form.settings.data.master_customer_agent_id=null),this.form.settings.data.isDirty==!0&&(this.form.settings.data.isDirty=!1,this.saveSettings(),this.form.settings.active=!1)},subcontractor:{input:()=>{this.form.settings.data.isDirty=!0,this.form.settings.data.subcontractor.hasSubcontractor!="Yes"&&(this.form.settings.data.subcontractor.w9=null,this.form.settings.data.subcontractor.partner_agreement=null,this.form.settings.data.subcontractor.coi=null,this.form.settings.data.subcontractor.performsDrugScreening=null,this.form.settings.data.subcontractor.performsBackgroundChecks=null)}},aliases:{active:!1,data:{alias:null,index:!1},hasError:{blankField:!1},checkForErrors:()=>{this.$emptyString(this.form.settings.aliases.data.alias)&&(this.form.settings.aliases.hasError.blankField=!0)},close:()=>{this.form.settings.aliases.active=!1,this.form.settings.aliases.data.alias=null,this.form.settings.aliases.hasError.blankField=!1},remove:t=>{this.form.settings.data.aliases.splice(t,1),this.form.settings.data.isDirty=!0},set:()=>{let t=this.form.settings.aliases.data.index;this.form.settings.aliases.checkForErrors(),this.form.settings.aliases.hasError.blankField==!1&&(t||t==0?this.form.settings.data.aliases[t]=this.form.settings.aliases.data.alias:this.form.settings.aliases.hasError.blankField==!1&&this.form.settings.data.aliases.push(this.form.settings.aliases.data.alias),this.form.settings.data.isDirty=!0,this.form.settings.aliases.close())},show:(t=null)=>{(t||t==0)&&(this.form.settings.aliases.data.alias=this.form.settings.data.aliases[t]),this.form.settings.aliases.data.index=t,this.form.settings.aliases.active=!0}},domains:{active:!1,data:{name:null,primary:null,index:null},hasError:{blankName:!1,blankPrimary:!1,blankField:!1},checkForErrors:()=>{this.$emptyString(this.form.settings.domains.data.name)&&(this.form.settings.domains.hasError.blankName=!0),this.form.settings.domains.data.primary==null&&(this.form.settings.domains.hasError.blankPrimary=!0),this.form.settings.domains.hasError.blankName==!0||this.form.settings.domains.hasError.blankPrimary==!0?this.form.settings.domains.hasError.blankField=!0:(this.form.settings.domains.hasError.blankName==!1||this.form.settings.domains.hasError.blankPrimary==!1)&&(this.form.settings.domains.hasError.blankField=!1)},close:()=>{this.form.settings.domains.active=!1,this.form.settings.domains.data.name=null,this.form.settings.domains.data.primary=null,this.form.settings.domains.hasError.blankName=!1,this.form.settings.domains.hasError.blankPrimary=!1,this.form.settings.domains.hasError.blankField=!1},remove:t=>{this.form.settings.data.domains.splice(t,1),this.form.settings.data.isDirty=!0},set:()=>{let t=this.form.settings.domains.data.index;this.form.settings.domains.checkForErrors(),this.form.settings.domains.hasError.blankField==!1&&(t||t==0?(this.form.settings.data.domains[t].name=this.form.settings.domains.data.name,this.form.settings.data.domains[t].primary=this.form.settings.domains.data.primary):this.form.settings.domains.hasError.blankField==!1&&this.form.settings.data.domains.push({name:this.form.settings.domains.data.name,primary:this.form.settings.domains.data.primary}),this.form.settings.data.isDirty=!0,this.form.settings.domains.close())},show:(t=null)=>{(t||t==0)&&(this.form.settings.domains.data.name=this.form.settings.data.domains[t].name,this.form.settings.domains.data.primary=this.form.settings.data.domains[t].primary),this.form.settings.domains.data.index=t,this.form.settings.domains.active=!0}},tpids:{active:!1,data:{title:null,managed:null,id:null},hasError:{blankTitle:!1,blankID:!1,blankField:!1},checkForErrors:()=>{this.$emptyString(this.form.settings.tpids.data.title)&&(this.form.settings.tpids.hasError.blankTitle=!0),this.$emptyString(this.form.settings.tpids.data.id)&&(this.form.settings.tpids.hasError.blankID=!0),this.form.settings.tpids.hasError.blankID==!0||this.form.settings.tpids.hasError.blankTitle==!0?this.form.settings.tpids.hasError.blankField=!0:(this.form.settings.tpids.hasError.blankID==!1||this.form.settings.tpids.hasError.blankTitle==!1)&&(this.form.settings.tpids.hasError.blankField=!1)},close:()=>{this.form.settings.tpids.active=!1,this.form.settings.tpids.data.title=null,this.form.settings.tpids.data.managed=null,this.form.settings.tpids.data.id=null,this.form.settings.tpids.hasError.blankTitle=!1,this.form.settings.tpids.hasError.blankID=!1,this.form.settings.tpids.hasError.blankField=!1},remove:t=>{this.form.settings.data.tpids.splice(t,1),this.form.settings.data.isDirty=!0},set:()=>{let t=this.form.settings.tpids.data.index;this.form.settings.tpids.checkForErrors(),this.form.settings.tpids.hasError.blankField==!1&&(t||t==0?(this.form.settings.data.tpids[t].title=this.form.settings.tpids.data.title,this.form.settings.data.tpids[t].managed=this.form.settings.tpids.data.managed,this.form.settings.data.tpids[t].id=this.form.settings.tpids.data.id):this.form.settings.tpids.hasError.blankField==!1&&this.form.settings.data.tpids.push({title:this.form.settings.tpids.data.title,managed:this.form.settings.tpids.data.managed,id:this.form.settings.tpids.data.id}),this.form.settings.data.isDirty=!0,this.form.settings.tpids.close())},show:(t=null)=>{(t||t==0)&&(this.form.settings.tpids.data.title=this.form.settings.data.tpids[t].title,this.form.settings.tpids.data.managed=this.form.settings.data.tpids[t].managed,this.form.settings.tpids.data.id=this.form.settings.data.tpids[t].id),this.form.settings.tpids.data.index=t,this.form.settings.tpids.active=!0}},tenants:{active:!1,data:{title:null,type:null,id:null,index:null},hasError:{blankTitle:!1,blankType:!1,blankID:!1,blankField:!1},tenantTypes:["Commercial","Education","Government","Non-Profit"],checkForErrors:()=>{this.$emptyString(this.form.settings.tenants.data.title)&&(this.form.settings.tenants.hasError.blankTitle=!0),this.$emptyString(this.form.settings.tenants.data.id)&&(this.form.settings.tenants.hasError.blankID=!0),this.form.settings.tenants.data.type==null&&(this.form.settings.tenants.hasError.blankType=!0),this.form.settings.tenants.hasError.blankType==!0||this.form.settings.tenants.hasError.blankID==!0||this.form.settings.tenants.hasError.blankTitle==!0?this.form.settings.tenants.hasError.blankField=!0:(this.form.settings.tenants.hasError.blankType==!1||this.form.settings.tenants.hasError.blankID==!1||this.form.settings.tenants.hasError.blankTitle==!1)&&(this.form.settings.tenants.hasError.blankField=!1)},close:()=>{this.form.settings.tenants.active=!1,this.form.settings.tenants.data.title=null,this.form.settings.tenants.data.type=null,this.form.settings.tenants.data.id=null,this.form.settings.tenants.hasError.blankType=!1,this.form.settings.tenants.hasError.blankTitle=!1,this.form.settings.tenants.hasError.blankID=!1,this.form.settings.tenants.hasError.blankField=!1},remove:t=>{this.form.settings.data.tenants.splice(t,1),this.form.settings.data.isDirty=!0},set:()=>{let t=this.form.settings.tenants.data.index;this.form.settings.tenants.checkForErrors(),this.form.settings.tenants.hasError.blankField==!1&&(t||t==0?(this.form.settings.data.tenants[t].title=this.form.settings.tenants.data.title,this.form.settings.data.tenants[t].type=this.form.settings.tenants.data.type,this.form.settings.data.tenants[t].id=this.form.settings.tenants.data.id):this.form.settings.tenants.hasError.blankField==!1&&this.form.settings.data.tenants.push({title:this.form.settings.tenants.data.title,type:this.form.settings.tenants.data.type,id:this.form.settings.tenants.data.id}),this.form.settings.data.isDirty=!0,this.form.settings.tenants.close())},show:(t=null)=>{(t||t==0)&&(this.form.settings.tenants.data.title=this.form.settings.data.tenants[t].title,this.form.settings.tenants.data.type=this.form.settings.data.tenants[t].type,this.form.settings.tenants.data.id=this.form.settings.data.tenants[t].id),this.form.settings.tenants.data.index=t,this.form.settings.tenants.active=!0}},awsMarketplaceBusinessIDs:{index:null,active:!1,data:{id:"",title:""},errors:{id:"",title:""},errorMessages:{blank:"This field cannot be blank"},checkForErrors:()=>{this.form.settings.awsMarketplaceBusinessIDs.resetErrors();let t=!1;return this.$emptyString(this.form.settings.awsMarketplaceBusinessIDs.data.id)&&(this.form.settings.awsMarketplaceBusinessIDs.errors.id=this.form.settings.awsMarketplaceBusinessIDs.errorMessages.blank,t=!0),this.$emptyString(this.form.settings.awsMarketplaceBusinessIDs.data.title)&&(this.form.settings.awsMarketplaceBusinessIDs.errors.title=this.form.settings.awsMarketplaceBusinessIDs.errorMessages.blank,t=!0),t},resetModal:()=>{this.form.settings.awsMarketplaceBusinessIDs.resetData(),this.form.settings.awsMarketplaceBusinessIDs.resetErrors()},resetData:()=>{this.form.settings.awsMarketplaceBusinessIDs.data={id:"",title:""},this.form.settings.awsMarketplaceBusinessIDs.index=null},resetErrors:()=>{this.form.settings.awsMarketplaceBusinessIDs.errors={id:"",title:""}},close:()=>{this.form.settings.awsMarketplaceBusinessIDs.active=!1,this.form.settings.awsMarketplaceBusinessIDs.resetModal()},remove:t=>{this.form.settings.data.awsMarketplaceBusinessIDs.splice(t,1),this.form.settings.data.isDirty=!0},set:()=>{let t=this.form.settings.awsMarketplaceBusinessIDs.data.index;this.form.settings.awsMarketplaceBusinessIDs.checkForErrors()||(t||t==0?(this.form.settings.data.awsMarketplaceBusinessIDs[t].id=this.form.settings.awsMarketplaceBusinessIDs.data.id,this.form.settings.data.awsMarketplaceBusinessIDs[t].title=this.form.settings.awsMarketplaceBusinessIDs.data.title):this.form.settings.data.awsMarketplaceBusinessIDs.push({id:this.form.settings.awsMarketplaceBusinessIDs.data.id,title:this.form.settings.awsMarketplaceBusinessIDs.data.title}),this.form.settings.data.isDirty=!0,this.form.settings.awsMarketplaceBusinessIDs.close())},show:(t=null)=>{(t||t==0)&&(this.form.settings.awsMarketplaceBusinessIDs.data.title=this.form.settings.data.awsMarketplaceBusinessIDs[t].title,this.form.settings.awsMarketplaceBusinessIDs.data.id=this.form.settings.data.awsMarketplaceBusinessIDs[t].id),this.form.settings.awsMarketplaceBusinessIDs.data.index=t,this.form.settings.awsMarketplaceBusinessIDs.active=!0}},ciscoContracts:{index:null,active:!1,data:{id:"",title:""},errors:{id:"",title:""},errorMessages:{blank:"This field cannot be blank"},checkForErrors:()=>{this.form.settings.ciscoContracts.resetErrors();let t=!1;return this.$emptyString(this.form.settings.ciscoContracts.data.id)&&(this.form.settings.ciscoContracts.errors.id=this.form.settings.ciscoContracts.errorMessages.blank,t=!0),this.$emptyString(this.form.settings.ciscoContracts.data.title)&&(this.form.settings.ciscoContracts.errors.title=this.form.settings.ciscoContracts.errorMessages.blank,t=!0),t},resetModal:()=>{this.form.settings.ciscoContracts.resetData(),this.form.settings.ciscoContracts.resetErrors()},resetData:()=>{this.form.settings.ciscoContracts.data={id:"",title:""},this.form.settings.ciscoContracts.index=null},resetErrors:()=>{this.form.settings.ciscoContracts.errors={id:"",title:""}},close:()=>{this.form.settings.ciscoContracts.active=!1,this.form.settings.ciscoContracts.resetModal()},remove:t=>{this.form.settings.data.ciscoContracts.splice(t,1),this.form.settings.data.isDirty=!0},set:()=>{let t=this.form.settings.ciscoContracts.data.index;this.form.settings.ciscoContracts.checkForErrors()||(t||t==0?(this.form.settings.data.ciscoContracts[t].id=this.form.settings.ciscoContracts.data.id,this.form.settings.data.ciscoContracts[t].title=this.form.settings.ciscoContracts.data.title):this.form.settings.data.ciscoContracts.push({id:this.form.settings.ciscoContracts.data.id,title:this.form.settings.ciscoContracts.data.title}),this.form.settings.data.isDirty=!0,this.form.settings.ciscoContracts.close())},show:(t=null)=>{(t||t==0)&&(this.form.settings.ciscoContracts.data.title=this.form.settings.data.ciscoContracts[t].title,this.form.settings.ciscoContracts.data.id=this.form.settings.data.ciscoContracts[t].id),this.form.settings.ciscoContracts.data.index=t,this.form.settings.ciscoContracts.active=!0}},tiers:{active:!1,data:{tier:null,domain:null,index:null},hasError:{blankTier:!1,duplicates:!1},errorMessage:null,close:()=>{this.form.settings.tiers.active=!1,this.form.settings.tiers.data.tier=null,this.form.settings.tiers.data.domain=null,this.form.settings.tiers.hasError.duplicates=!1,this.form.settings.tiers.hasError.blankTier=!1},remove:t=>{this.form.settings.data.tiers.splice(t,1),this.form.settings.data.isDirty=!0},set:()=>{let t=this.form.settings.tiers.data.index;this.checkForDuplicatesAndBlanks(),this.form.settings.tiers.hasError.blankTier||(t||t==0?this.companyTypeIncludes([5,6,46,47,48,49])?(this.form.settings.data.tiers[t].tier=this.form.settings.tiers.data.tier,this.form.settings.data.tiers[t].domain=this.form.settings.tiers.data.domain):this.form.settings.data.tiers[t].tier=this.form.settings.tiers.data.tier:this.companyTypeIncludes([5,6,46,47,48,49])?this.form.settings.data.tiers.push({tier:this.form.settings.tiers.data.tier,dom
1ain:this.form.settings.tiers.data.domain}):this.form.settings.data.tiers.push({tier:this.form.settings.tiers.data.tier}),this.form.settings.data.tiers=_.sortBy(this.form.settings.data.tiers,[this.form.settings.data.tiers,"tier"]),this.form.settings.data.isDirty=!0,this.form.settings.tiers.close())},setDomain:()=>{if(!_.isEmpty(this.form.settings.data.tiers))for(let t=0;t<this.form.settings.data.tiers.length;t++)this.form.settings.data.tiers[t].domain||(this.form.settings.data.tiers[t].domain=null)},show:(t=null)=>{(t||t==0)&&(this.form.settings.tiers.indexToEdit=t,this.form.settings.tiers.data.tier=this.form.settings.data.tiers[t].tier,this.form.settings.tiers.data.domain=this.form.settings.data.tiers[t].domain),this.form.settings.tiers.data.index=t,this.form.settings.tiers.active=!0}}},prospect:{reject:{title:"Discontinue Relationship",active:!1,saving:!1,data:{notes:null},defaults:()=>{this.form.prospect.reject.active=!1,this.form.prospect.reject.data.notes=null,this.form.prospect.reject.saving=!1},show:()=>{this.form.prospect.reject.active=!0},close:()=>{this.form.prospect.reject.defaults()},_patch:t=>{this.form.prospect.reject.saving=!0;let e={notes:this.form.prospect.reject.data.notes,action:t};axios.patch("/api/Explorers/Companies/Prospect/"+this.company_id,e).then(s=>{s.data.row_count===1?(this.$buefy.toast.open({duration:1500,message:"Relationship Discontinued",type:"is-success"}),this.form.prospect.reject.saveToTimeLine(),this.loadAsyncCompany()):this.$buefy.toast.open({duration:1500,message:"Failed To Discontinue Relationship",type:"is-danger"})}).catch(s=>{}).finally(()=>{this.form.prospect.reject.saving=!1,this.form.prospect.reject.active=!1})},submit:()=>{this.form.prospect.reject.data.notes?this.form.prospect.reject._patch("discontinue"):this.form.prospect.reject.hasError.notes=!0},saveToTimeLine:()=>{let t={timeline_subtype_id:11,timeline_type_id:1,payload:{action:"Discontinued",action_on:"Relationship",detail:this.form.prospect.reject.data.notes},ids:{company_recid:this.company_id}};axios.post("/api/Timelines",t).catch(e=>{this.$buefy.toast.open({duration:1500,message:"Failed To Create Timeline Entry",type:"is-danger"})})}},brokered:{active:!1,saving:!1,defaults:()=>{this.form.prospect.brokered.saving=!1,this.form.prospect.brokered.active=!1},show:()=>{this.form.prospect.brokered.active=!0},close:()=>{this.form.prospect.brokered.defaults()},_patch:t=>{this.form.prospect.brokered.saving=!0;let e={action:t};axios.patch("/api/Explorers/Companies/Prospect/"+this.company_id,e).then(s=>{s.data.row_count===1?(this.$buefy.toast.open({duration:1500,message:"Company Marked as Brokered Only",type:"is-success"}),this.form.prospect.brokered.saveToTimeLine(),this.loadAsyncCompany()):this.$buefy.toast.open({duration:1500,message:"Failed To Mark as Brokered Only",type:"is-danger"})}).catch(s=>{}).finally(()=>{this.form.prospect.brokered.defaults()})},submit:()=>{this.form.prospect.saving=!0,this.form.prospect.brokered._patch("brokered")},saveToTimeLine:()=>{let t={timeline_subtype_id:12,timeline_type_id:1,payload:{action:"Marked as Brokered",action_on:"Company",detail:"Company Marked as Brokered Only"},ids:{company_recid:this.company_id}};axios.post("/api/Timelines",t).catch(e=>{this.$buefy.toast.open({duration:1500,message:"Failed To Create Timeline Entry",type:"is-danger"})})}}},logistics:{show:!1,toggle:()=>{this.form.logistics.show=!this.form.logistics.show}}}}},mounted(){this.loadData()},watch:{"form.one_password.data":{handler:function(t,e){this.form.one_password.errors=this.$formErrors(this.$data,this.form.one_password.validations)},deep:!0}},computed:{resellerClass(){return!_.isNull(this.form.subcontractor_services.resellerMetadata)&&_.isNull(this.form.subcontractor_services.partneringMetadata)&&!this.form.subcontractor_services.resellerExpired?"text-sm font-semibold text-gray-600":!_.isNull(this.form.subcontractor_services.resellerMetadata)&&_.isNull(this.form.subcontractor_services.partneringMetadata)&&this.form.subcontractor_services.resellerExpired?"text-sm font-semibold text-stop-500":"text-sm font-semibold text-gray-400"},certitficateCount(){return this.filtered_vendor_certifications.map(t=>t.users.length).reduce((t,e)=>t+e,0)},availableTeamSpots(){return this.$refs.team?Math.floor(this.$refs.team.clientHeight/50):5}
1,companyStatus(){let t={description:"",class:"text-gray-700",icon:"status-offline"};return this.company&&(this.company.Delete_Flag==="1"?(t.description="Deleted",t.class="text-stop-400"):(t.description=this.company.Company_Status_Desc,this.company.Company_Status_RecID==="1"||this.company.Company_Status_RecID==="19"?(t.class="text-success-700",t.icon="status-online"):(this.company.Company_Status_RecID==="13"||this.company.Company_Status_RecID==="25")&&(t.class="text-warn-700"))),t},directoryExists(){return this.company.hasOwnProperty("directory")?this.company.directory.length>0:!1},filteredLocations(){return this.form.locations.filters.active==="Active"?this.company.company_addresses.filter(t=>this._filteredLocations(t,"Description","0")||this._filteredLocations(t,"Address_Line1","0")||this._filteredLocations(t,"Address_Line2","0")||this._filteredLocations(t,"City","0")||this._filteredLocations(t,"State_ID","0")||this._filteredLocations(t,"Zip","0")||this._filteredLocations(t,"PhoneNbr","0")):this.form.locations.filters.active==="Inactive"?this.company.company_addresses.filter(t=>this._filteredLocations(t,"Description","1")||this._filteredLocations(t,"Address_Line1","1")||this._filteredLocations(t,"Address_Line2","1")||this._filteredLocations(t,"City","1")||this._filteredLocations(t,"State_ID","1")||this._filteredLocations(t,"Zip","1")||this._filteredLocations(t,"PhoneNbr","1")):this.company.company_addresses.filter(t=>this._filteredLocations(t,"Description")||this._filteredLocations(t,"Address_Line1")||this._filteredLocations(t,"Address_Line2")||this._filteredLocations(t,"City")||this._filteredLocations(t,"State_ID")||this._filteredLocations(t,"Zip")||this._filteredLocations(t,"PhoneNbr"))},filteredPeople(){return this.form.contact.filters.active==="Active"?this.company.contacts.filter(t=>this._filteredPeople(t,"First_Name","0")||this._filteredPeople(t,"Last_Name","0")||this._filteredPeople(t,"Default_Email","0")||this._filteredPeople(t,"Default_Phone","0")):this.form.contact.filters.active==="Inactive"?this.company.contacts.filter(t=>this._filteredPeople(t,"First_Name","1")||this._filteredPeople(t,"Last_Name","1")||this._filteredPeople(t,"Default_Email","1")||this._filteredPeople(t,"Default_Phone","1")):this.company.contacts.filter(t=>this._filteredPeople(t,"First_Name")||this._filteredPeople(t,"Last_Name")||this._filteredPeople(t,"Default_Email")||this._filteredPeople(t,"Default_Phone"))},isTeamMember(){var e,s;let t=!1;return(e=this.company)!=null&&e.sortedTeam.length&&((s=this.company)==null||s.sortedTeam.forEach(i=>{i.Member_RecID==this.cw_member_recid&&(t=!0)})),t},isTimeAndExpenseEligible(){return this.company?this.company.Company_Type_RecID==="1"&&this.company.Delete_Flag==="0"&&this.company.Company_Status_RecID!=="13"&&this.company.Company_Status_RecID!=="25":!1},isDealCreateEligible(){return this.company?this.company.Delete_Flag==="0"&&this.company.Company_Status_RecID!=="13"&&this.company.Company_Status_RecID!=="3"&&this.company.Company_Status_RecID!=="25":!1},roleDescriptions(){return this.isLead?this.form.team.modals.prospect_descriptions:this.form.team.modals.descriptions},modalContactRoles:{set:function(t){this.form.contact.data.Contact_Type_RecID=t.map(e=>e.Contact_Type_RecID).join(", ")},get:function(){if(!this.form.contact.data.Contact_Type_RecID)return[];let t=this.form.contact.data.Contact_Type_RecID.split(",").map(e=>e.trim());return this.contact_types.filter(e=>t.includes(e.Contact_Type_RecID))}},photo(){var t;if((t=this.company)!=null&&t.photos){let e=this.company.photos.find(s=>s.size=="large");return e?e.path+e.name:"/images/profile_customer_icon.jpg"}return"/images/profile_customer_icon.jpg"},tabLabel(){return this.activeTab==="Select a tab to see more"?"Select a tab to see more":"Close tab"},vendorPortfolioOptionsName(){var t,e;return(e=(t=this.company)==null?void 0:t.profile)!=null&&e.vendor_portfolio_option_id?this.vendor_portfolio_options.find(i=>i.id===this.company.profile.vendor_portfolio_option_id).name:null},isActive(){return this.company.Company_Status_RecID==1||this.company.Company_Status_RecID==19},isInactive(){return this.company.Company_Status_RecID==3},isLead(){return this.company.Lead_Flag==1},isBrokeredOnly(){return this.company.Company_Status_RecID==26},isNew(){return this.company.Company_Status_RecID==23},isPending(){return this.company.Company_Status_RecID==24},isNotApproved(){return this.company.Company_Status_RecID==13},teamRoles(){return this.team_roles},isAeAssigned(){var e;return((e=this.company)==null?void 0:e.sortedTeam.findIndex(s=>s.Team_Role_Recid==1))!==-1},locationStateOptions(){return this.form.locations.data.Country_RecID?this.state_options.filter(t=>t.Country_RecID==this.form.locations.data.Country_RecID):this.state_options}},methods:{loadData(){axios.all([this.loadAsyncCompany(),this.form.invoices._load(),this.form.orders._load(),this.form.products.groups.load(),this.form.products.showcase.load(),this.form.infoSec._load()]).then(t=>{var e;this.form.profile.modals.overview_clamped=this.isLineClamped(this.$refs.overview),this.form.profile.modals.quick_details_clamped=this.isLineClamped(this.$refs.details),this.form.team.sortedTeamSliced=[...(e=this.company)==null?void 0:e.sortedTeam].splice(0,this.availableTeamSpots)}),this.form.subcontractor_services.loading=!0,axios.all([this.loadSettings()]).then(t=>{this.request.openSettingsModal=="1"&&this.form.settings.open(),(this.form.settings.data.subcontractor.hasSubcontractor==="Yes"||this.companyTypeIncludes([1]))&&this.form.subcontractor_services.checkSubcontractor()}).finally(()=>{this.form.subcontractor_services.loading=!1})},navigateToLegalDocs(){const t=`/i/Explorers/LegalDocs/Index/CompanyNav/${this.company.Company_RecID}`;window.location=t},onFavoriteClick(){axios.post("/api/Explorers/Companies/StarredCompanies/Toggle",{starred_company_id:this.company.Company_RecID}).then(t=>{this.company.isStarred=t.data.user_favorites_id>
1=1,this.$buefy.toast.open({message:(t.data.user_favorites_id>=1?"Company favorited successfully!":"Company removed successfully!")+" Please refresh page to see list changes.",type:"is-success",duration:2250})}).catch(t=>{this.$buefy.toast.open({message:"There was an error changing this favorite.",type:"is-danger",duration:2250})}).finally(t=>{})},companyTypeIncludes(t){if(t.constructor===Array){for(let e=0;e<t.length;e++)if(this.company_type_recid.includes(t[e]))return!0}return!1},_deleteKeys(t){Object.keys(t).forEach(e=>{delete t[e]})},_filteredLocations(t,e,s=null){if(t[e]!=null)return s===null?t[e].toString().toLowerCase().indexOf(this.form.locations.filters.search.toLowerCase())!==-1:t.Inactive_Flag===s&&t[e].toString().toLowerCase().indexOf(this.form.locations.filters.search.toLowerCase())!==-1},_filteredPeople(t,e,s=null){if(t[e]!=null)return s===null?t[e].toString().toLowerCase().indexOf(this.form.contact.filters.search.toLowerCase())!==-1:t.Inactive_Flag===s&&t[e].toString().toLowerCase().indexOf(this.form.contact.filters.search.toLowerCase())!==-1},_resetData(t){Object.keys(t).forEach(e=>{t[e]=null})},_resetErrors(t){Object.keys(t).forEach(e=>{t[e]=!1})},_validate(t){let e=!0;if(t==="contact")Object.keys(this.form.contact.hasError).forEach(s=>{if(_.isEmpty(this.form.contact.data[s]))this.form.contact.hasError[s]=!0;else{let i=null;s=="Default_Phone"?i=/^[0-9]{10}$/:s=="Default_Email"?i=/^\w+([\.+-]?\w+)*@\w+([\.+-]?\w+)*(\.\w{2,})+$/:s=="Inactive_Flag"&&(this.form.contact.hasError[s]=(parseInt(this.form.contact.data.Default_Flag)||parseInt(this.form.contact.data.Default_Billing_Flag))&&parseInt(this.form.contact.data.Inactive_Flag)),i&&(this.form.contact.hasError[s]=!i.test(this.form.contact.data[s]))}});else if(t==="locations")Object.keys(this.form.locations.hasError).forEach(s=>{if(_.isEmpty(this.form.locations.data[s]))s!=="PhoneNbr"&&(this.form.locations.hasError[s]=!0);else{let i=null;s==="PhoneNbr"&&(i=/^[0-9]{10}$/),i&&(this.form.locations.hasError[s]=!i.test(this.form.locations.data[s]))}});else if(t==="profile")Object.keys(this.form.profile.hasError).forEach(s=>{if(!_.isEmpty(this.form.profile.data[s])&&s!=="account_number"){let i=/^((https?):\/\/)?(www.)?([a-zA-Z0-9]{2,})+\.[a-zA-Z0-9]{2,63}(\.[a-zA-Z0-9]{2,63})?/;this.form.profile.hasError[s]=!i.test(this.form.profile.data[s])}});else return!1;return Object.values(this.form[t].hasError).forEach(s=>{s&&(e=!1)}),e},debounceLoadAsyncVendorPrograms:_.debounce(function(){let t=Object.assign(this.form.profile.modals.vendor_program_members.filter.values,{vendor:this.company.Company_Name});axios.post("/api/Explorers/Companies/"+this.company_id+"/VendorPrograms",t).then(e=>{this.searched_vendor_programs=e.data.results.rows,this.form.profile.modals.vendor_program_members.itemize_searched_programs()}).catch(e=>{this.company.vendor_programs=[]}).finally(e=>{})},500),debounceLoadAsyncVendorCertifications:_.debounce(function(){let t=Object.assign(this.form.profile.modals.certificate_holders.filter.values,{company_recid:this.company.Company_RecID});axios.post("/api/Explorers/Companies/"+this.company_id+"/Certificates",t).then(e=>{this.filtered_vendor_certifications=e.data.results.rows,this.form.profile.modals.certificate_holders.calcNumCertificateHolders(),this.$forceUpdate()}).catch(e=>{this.company.certifications=[]}).finally(e=>{})},500),debounceLoadAsyncMembers:_.debounce(function(t){this.form.team.hasError.member=!1,this.form.team.loading=!0,axios.post("/api/Employees/Search",{name:t,reduce:!0}).then(e=>{this.form.team.modals.members=e.data}).catch(e=>{this.form.team.members=[]}).finally(e=>{this.form.team.loading=!1})},500),debounceLoadAsyncTags:_.debounce(function(){this.form.tags._load()},500),directoryLink(t){if(this.directoryExists){let e="#";switch(t){case"Home":this.company.directory.forEach(s=>{if(s.is_root){e=s.webUrl;return}});break;case"Contracts":case"Engineering":case"Projects":case"Run Rate":this.company.directory.forEach(s=>{if(s.name==t){e=s.webUrl;return}});break}return e}},isLineClamped(t){return t?t.scrollHeight>t.clientHeight:!1},checkForDuplicatesAndBlanks(){this.form.settings.tiers.hasError.duplicates=!1;let t=this.form.settings.data.tiers;for(let e=0;e<t.length;e++)if(this.companyTypeIncludes([5,6,46,47,48,49])){if(t[e].tier===this.form.settings.tiers.data.tier&&t[e].domain===this.form.settings.tiers.data.domain){this.form.settings.tiers.errorMessage="A vendor can not have duplicate tier and vendor domain options selected.",this.form.settings.tiers.hasError.duplicates=!0;break}}else if(t[e].tier==this.form.settings.tiers.data.tier){this.form.settings.tiers.hasError.duplicates=!0,this.form.settings.tiers.errorMessage="A client can not have duplicate tier options selected.";break}this.form.settings.tiers.data.tier?this.form.settings.tiers.hasError.blankTier=!1:(this.form.settings.tiers.hasError.blankTier=!0,this.form.settings.tiers.errorMessage="Field can not be left blank.")},loadAsyncCompany(){return this.form.profile.loading=!0,axios.get("/api/Explorers/Companies/"+this.company_id).then(t=>{this.company=t.data}).catch(t=>{this.company=null}).finally(t=>{this.form.profile.loading=!1})},navigateToProjectsIndex(){const t={customers:[{Company_RecID:Number(this.company.Company_RecID),Company_Name:this.company.Company_Name}],statuses:["01 - New","02 - Waiting on Hardware","02.5 - Ready for Staging","03 - Ready for Scheduling","03.5 - Scheduled","04 - Waiting on Customer","06 - In Progress","07 - Closeout Review"]},e=`/i/Explorers/Projects?$filter=${JSON.stringify(t)}`;window.open(e,"_blank","noopener,noreferrer")},openClosePageHeaderButtons(t){t==="product_history_active"?this.openRoute("Products"):this.form.profile.modals[t]=!this.form.profile.modals[t]},openWindow(t){window.open(t,"_self")},openRoute(t){window.open("../"+t+"?company_recid="+this.company_id,"_self")},openUrl(t){t=t.match(/^https?:/)?t:"https://"+t,window.open(t,"_blank")}
1,showDealsModal(t){this.$refs.componentsDealsModal.showModal(t)},showTimeAndExpense(t){this.$refs.componentsTimeAndExpense.showModal(t)},team_member_photo(t){if(t){let e=t.find(s=>s.size=="large");return e?e.path+e.name:""}return""},supplierRatingPhoto(t){var e,s,i,a;return(e=t==null?void 0:t.user_photo)!=null&&e.path&&((s=t==null?void 0:t.user_photo)!=null&&s.name)?((i=t==null?void 0:t.user_photo)==null?void 0:i.path)+((a=t==null?void 0:t.user_photo)==null?void 0:a.name):""},toggleStarred(){axios.post("/api/Explorers/Companies/StarredCompanies/Toggle",{starred_company_id:this.company.Company_RecID}).then(t=>{this.company.isStarred=!this.company.isStarred,this.$buefy.toast.open({message:this.company.isStarred?"Company starred successfully!":"Company removed successfully!",type:"is-success",duration:2250})}).catch(t=>{this.$buefy.toast.open({message:"There was an error. Please try again later, or open a support ticket if the problem persists.",type:"is-danger",duration:2250})}).finally(t=>{})},addDomain(){this.form.settings.domains.push({name:"",isPrimary:this.form.settings.domains.length<1})},setPrimaryDomain(t,e){this.form.settings.domains.forEach((s,i)=>{s.isPrimary=i==t})},removeDomain(t){this.form.settings.domains.splice(t,1)[0].isPrimary&&(this.form.settings.domains[0].isPrimary=!0)},addTenant(){this.form.settings.tenants.push({title:"Primary",type:"",id:""})},removeTenant(t){this.form.settings.tenants.splice(t,1)},onDomainNameChange(t){let e=this.form.settings.domains[t].name.replaceAll(" ","");this.form.settings.domains[t].name=e},loadSettings(){return this.form.settings.loading=!0,axios.get("/api/Admin/Settings/"+this.company_id).then(t=>{console.log("response in load settings: ",t),typeof t.data=="object"&&(Object.keys(t.data).includes("tiers")&&(this.form.settings.data.tiers=_.sortBy(t.data.tiers,[t.data.tiers,"tier"])),Object.keys(t.data).includes("domains")&&(this.form.settings.data.domains=t.data.domains),Object.keys(t.data).includes("subcontractor")&&(this.form.settings.data.subcontractor=t.data.subcontractor[0]),Object.keys(t.data).includes("subcontractorServices")&&(this.form.subcontractor_services.selectedOptions=t.data.subcontractorServices),Object.keys(t.data).includes("tpids")&&(this.form.settings.data.tpids=t.data.tpids),Object.keys(t.data).includes("tenants")&&(this.form.settings.data.tenants=t.data.tenants),Object.keys(t.data).includes("allowsPartialInvoicing")&&(this.form.settings.data.allowsPartialInvoicing=t.data.allowsPartialInvoicing[0]),Object.keys(t.data).includes("allowsMyHubServiceTickets")&&(this.form.settings.data.allowsMyHubServiceTickets=t.data.allowsMyHubServiceTickets[0]),Object.keys(t.data).includes("aliases")&&(this.form.settings.data.aliases=t.data.aliases),Object.keys(t.data).includes("master_customer_agent_id")&&(this.form.settings.data.master_customer_agent_id=t.data.master_customer_agent_id),Object.keys(t.data).includes("requiresBackgroundChecks")&&(this.form.settings.data.requiresBackgroundChecks=t.data.requiresBackgroundChecks[0]),Object.keys(t.data).includes("requiresDrugScreening")&&(this.form.settings.data.requiresDrugScreening=t.data.requiresDrugScreening[0]),Object.keys(t.data).includes("ciscoContracts")&&(this.form.settings.data.ciscoContracts=t.data.ciscoContracts),Object.keys(t.data).includes("subcontractorAllowed")&&(this.form.subcontractor_services.customerAllowsSubcontractors=t.data.subcontractorAllowed[0]),Object.keys(t.data).includes("poRequired")&&(this.form.settings.data.poRequired=t.data.poRequired[0]),Object.keys(t.data).includes("awsMarketplaceBusinessIDs")&&(this.form.settings.data.awsMarketplaceBusinessIDs=t.data.awsMarketplaceBusinessIDs),this.form.settings.data.subcontractor.performsDrugScreening===void 0&&(this.form.settings.data.subcontractor.performsDrugScreening=null),this.form.settings.data.subcontractor.performsBackgroundChecks===void 0&&(this.form.settings.data.subcontractor.performsBackgroundChecks=null)),this.form.settings.tiers.setDomain()}).catch(t=>{}).finally(()=>{this.form.settings.loading=!1})},debounceAutocomplete:_.debounce(function(t,e,s){this.form.settings[t].autocomplete(e,s)},500),saveSettings(){let t={associated_recid:this.company_id,associated_rectype:"company",data:{domains:this.form.settings.data.domains,tenants:this.form.settings.data.tenants,ciscoContracts:this.form.settings.data.ciscoContracts,awsMarketplaceBusinessIDs:this.form.settings.data.awsMarketplaceBusinessIDs,allowsPartialInvoicing:this.form.settings.data.allowsPartialInvoicing,allowsMyHubServiceTickets:this.form.settings.data.allowsMyHubServiceTickets,aliases:this.form.settings.data.aliases,tiers:this.form.settings.data.tiers,master_customer_agent_id:this.form.settings.data.master_customer_agent_id,requiresDrugScreening:this.form.settings.data.requiresDrugScreening,requiresBackgroun
1dChecks:this.form.settings.data.requiresBackgroundChecks,tpids:this.form.settings.data.tpids,subcontractor:{subcontractor:this.form.settings.data.subcontractor},subcontractorServices:this.form.subcontractor_services.selectedOptions,subcontractorAllowed:this.form.subcontractor_services.customerAllowsSubcontractors,poRequired:this.form.settings.data.poRequired}};this.form.settings.loading=!0,axios.post("/api/Admin/Settings",t).then(e=>{}).catch(e=>{this.form.settings.allowsPartialInvoicing=this.form.settings.data.allowsPartialInvoicing}).finally(()=>{this.$buefy.toast.open({message:"Company Settings Updated Successfully",type:"is-success",duration:3500}),this.form.settings.loading=!1,window.location.reload()})},directorBannerActive(){return this.isLead&&!this.isInactive&&!this.isAeAssigned},supplierBannerActive(){return this.isLead&&!this.isInactive},prospectBannerActive(){return this.isLead&&!this.isInactive},reonboardingBannerActive(){return(this.isBrokeredOnly||this.isInactive||this.isNotApproved)&&!Number(this.company.Delete_Flag)},getSupplierType(t){let e=[];return t.forEach(s=>{e.push(s.Description)}),e},openOnboard(){var r,o,n,l;let t=51,e=this.getSupplierType(this.company_type_desc),s,i=this.owner_level;do if(Number(i.Owner_Level_ID)==2){s=i.Owner_Level_Name;break}else i=i.owner_level_reports_to;while(i);let a={};this.companyTypeIncludes([5,6,46,47,48,49])?(t=53,a={supplier_name:this.company_id,supplier_type:JSON.stringify(e),supplier_contact:(o=(r=this.company.contacts)==null?void 0:r[0])==null?void 0:o.Contact_Name,supplier_contact_email:(l=(n=this.company.contacts)==null?void 0:n[0])==null?void 0:l.Default_Email},s&&(a.compunet_region=s)):a.customer_name=this.company_id,window.open(`/i/Tools/CorporateServiceCatalog?item=${t}&request=true&prefilledValues=${JSON.stringify(a)}`,"_self")},launchIroncladCatalogItem(t){const s={"Non-Disclosure Agreement":{id:56,contactKey:"counterpartyContact"},Reseller:{id:64,contactKey:"counterpartyContactName"},Partnering:{id:59,contactKey:"counterpartyContactName"}}[t];let i={companyRecID:this.company.Company_RecID,catalogItemType:t},a={};axios.post(`/api/Explorers/Companies/${this.company.Company_RecID}/SupplierCache`,i).then(r=>{a={...r.data.supplier_cache};const o=this.processPrefilledData(t,s,a);let n=`/i/Tools/CorporateServiceCatalog?item=${s.id}&request=true&prefilledValues=${JSON.stringify(o)}`;window.location.href=n})},launchCompanyChangeRequest(){const t={companyHeader:this.company.Company_RecID};let e=`/i/Tools/CorporateServiceCatalog?item=${this.company_change_form_id}&request=true&prefilledValues=${JSON.stringify(t)}`;window.location.href=e},processPrefilledData(t,e,s){let i={counterpartyName:this.company.Company_RecID,[e.contactKey]:s.supplier_contact,counterpartyContactEmail:s.supplier_contact_email};const a=()=>{let r=null;const o=JSON.parse(s.partner_services)[0];return["Consulting","Managed Services","Physical Installation"].includes(o)?r=o:o==="Other Service(s)"&&(r="Other"),r};switch(t){case"Non-Disclosure Agreement":i.companyType="Supplier";break;case"Reseller":i.one_time=s.one_time_engagement,i.website=s.supplier_website;break;case"Partnering":i.one_time=s.one_time_engagement,i.market=s.market,i.partner_services=s.partner_services?a():null,i.service_desc=s.product_and_service_description,i.services_performed=a()?"Yes":"No",i.service_location=s.service_location,i.website=s.supplier_website;break}return i},openStatementPage(t){window.open(`/i/Tools/StatementManager/${t}?company_recid=${this.company_id}`,"_blank")}},props:["allowsProducts","coi","company_id","company_change_form_id","company_type_desc","company_type_recid","contact_types","contracts_manager","cw_member_recid","deniesProducts","domains","hasOnePassword","isCompanyTeamAdmin","isContractsManager","isCustomerSalesRepresentative","isDriveContractAdmin","isDriveSuperAdmin","isDriveUserAdmin","isFinance","isSuperAdmin","masterAgreement","owner_level","partnering_agreement","product_line_rating_options","resellerAgreement","service_request_item_ids","state_options","country_options","team_roles","user_id","vendor_portfolio_options","ms_tenants","markets","statement_remit_companies","request","w_nine"]},K=null,G=null;var J=Z(z,K,G,!1,null,null);const X=J.exports;export{X as default};

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.