import{aw as l,j as e,l as m,k as d,g as p,h as u,i as g}from"./app-BgLa5dit.js";import{O as f}from"./u6fIQ8Ti.chunk.js";import{D as h}from"./C4BcftDO.chunk.js";import{O as x}from"./Vn1DtJ-y.chunk.js";import{C as O}from"./CiR1qo7K.chunk.js";import{N as w,a as y}from"./BY5LkID7.chunk.js";import"./DG_07YWO.chunk.js";import"./DJ0pq8J_.chunk.js";import"./CCcwLDvu.chunk.js";import"./DDfKZ_ng.chunk.js";import"./Bs6fQ2wT.chunk.js";import"./BUT90D7O.chunk.js";function j(){const s=l(),r=[{label:"Organisation",value:s.values.name||"",badge:s.values.salesforceAccountId&&"salesforce"},{label:"Organisation Type",value:e.jsx(x,{type:s.values.type}),badge:s.values.salesforceAccountId&&"salesforce"}];return e.jsxs("div",{children:[e.jsx("h1",{className:"mb-4",children:"Review and Confirm"}),e.jsx("p",{className:"mb-4",children:"You're about to create the following organisation. Please check and confirm all details."}),e.jsx("div",{className:"crm-studio-wizard-form",children:e.jsx(h,{heading:"Organisation details",disableCollapse:!0,children:e.jsx("div",{className:"p-3",children:r.map(({label:o,value:n,badge:i},a)=>e.jsxs("div",{className:`d-flex flex-nowrap align-items-center ${a===r.length-1?"":"mb-3"}`,children:[e.jsx("span",{className:"col-3 d-inline-block me-3 flex-shrink-0",children:o}),e.jsx("div",{className:"flex-grow-1",children:n}),i&&e.jsx(O,{type:i})]},a))})})})]})}const F=s=>{const r=m(),o=d();function n(a){p.trigger({application:g.CRM_STUDIO,action:u.CrmStudio.ORGANISATION_OVERVIEW,args:[a]})}async function i(a){const c={name:a.name,orgType:a.type,salesforceAccountId:a.salesforceAccountId};try{const t=await o(f.createOrganisation(c));r.success("Organisation successfully created! You will be redirected to their page now"),n(t.id)}catch{r.error("An error occurred while creating the organisation. Please try again.")}}return e.jsx(w,{queryParams:s.queryParams||{},currentStepId:y.CONFIRM,onSubmit:i,loaded:!0,children:e.jsx(j,{})})};export{F as NewOrganisationWizardConfirmView};
//# sourceMappingURL=dejjZZDp.chunk.js.map
