import{u as s,r,j as n}from"./router.chunk.YsRm4bSN.js";import{_ as __,s as sprintf}from"./wordpress.chunk.BVds2GcU.js";import{c3 as d,f as e,C as a,n as o,o as f,g as l,h as g,j as i,bM as u,v as t,D as c,B as w,c2 as m,b4 as p,bN as x}from"./main.chunk.N-eZ2ybB.js";import{D as h}from"./dot-separator.chunk.CtyhSI2x.js";import{i as j,J as N,bd as y,z as _,t as b}from"./icons.chunk.BwnSC3zE.js";import{f as v}from"./date-utils.chunk.DWRtWTmT.js";import"./react-jsx-runtime.chunk.ATkk6v2S.js";import"./react.js";import"./react-dom-client.chunk.BMQ1litG.js";import"./react-dom.js";import"./pdf-core.chunk.D33I_Wdh.js";import"./ui-radix.chunk.Xzokq_Gv.js";import"./utils.chunk.C1IATKsN.js";import"./forms.chunk.Bz8aaTWe.js";const k=()=>{const{setTopbar:k}=d(),{currentUser:A}=e(),D=s();r.useEffect(()=>{k({title:__("Profile","growfund"),icon:j})},[k]);const E=p.isBacker(),B=p.isDonor();return E||B?n.jsxs(a,{className:"growfund-mt-10 growfund-space-y-3",size:"sm",children:[n.jsx(o,{className:"growfund-border-none growfund-shadow-none",children:n.jsxs(f,{className:"growfund-flex growfund-items-center growfund-gap-3 growfund-relative",children:[n.jsxs(l,{className:"growfund-shrink-0 growfund-size-[5.5rem]",children:[n.jsx(g,{src:A.image?.url??void 0}),n.jsx(i,{children:u({first_name:A.first_name,last_name:A.last_name})})]}),n.jsxs("div",{className:"growfund-space-y-3",children:[n.jsxs("h4",{className:"growfund-typo-h4 growfund-font-semibold growfund-text-fg-primary growfund-flex growfund-items-center growfund-gap-2",children:[n.jsx("span",{className:"growfund-break-all growfund-line-clamp-2 growfund-max-w-96",children:sprintf("%s %s",A.first_name,A.last_name)}),A.is_verified?n.jsxs(t,{variant:"primary",children:[n.jsx(N,{className:"growfund-size-3 growfund-text-icon-success"}),__("Verified","growfund")]}):n.jsx(t,{variant:"secondary",children:__("Awaiting Verification","growfund")})]}),n.jsxs("div",{className:"growfund-flex growfund-items-center growfund-gap-2 growfund-typo-tiny",children:[A.last_contribution_at&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"growfund-flex growfund-items-center growfund-gap-1",children:[n.jsx(y,{className:"growfund-size-4 growfund-text-icon-primary"}),n.jsx("span",{className:"growfund-typo-body-sm growfund-text-fg-primary",children:(E?sprintf(
/* translators: %s: Last pledged date */
__("Last Pledged %s","growfund"),v(new Date(A.last_contribution_at),c.HUMAN_READABLE_DATE_WITH_TIME)):
/* translators: %s: Last donated date */__("Last Donated %s","growfund"),v(new Date(A.last_contribution_at),c.HUMAN_READABLE_DATE_WITH_TIME))})]}),n.jsx(h,{})]}),n.jsxs("div",{className:"growfund-flex growfund-items-center growfund-gap-1",children:[n.jsx(_,{className:"growfund-size-4 growfund-text-icon-primary"}),n.jsx("span",{className:"growfund-typo-body-sm growfund-text-fg-primary",children:sprintf(
/* translators: %s: Joined date */
__("Joined %s","growfund"),v(new Date(A.joined_at),c.HUMAN_READABLE))})]})]}),n.jsx(t,{variant:"info",children:sprintf(
/* translators: %s: Number of pledged campaigns */__(E?"Pledged to %s campaigns":"Donated to %s campaigns","growfund"),A.total_number_of_contributions)})]}),n.jsxs(w,{variant:"secondary",size:"sm",className:"growfund-absolute growfund-top-1/2 growfund-right-6 growfund-translate-y-[-50%]",onClick:()=>{D(m.Settings.buildLink())},children:[n.jsx(b,{}),__("Edit Profile","growfund")]})]})}),n.jsx(o,{className:"growfund-border-none growfund-shadow-none",children:n.jsxs(f,{children:[n.jsx("h6",{className:"growfund-typo-h6 growfund-font-semibold growfund-text-fg-primary",children:__("Details","growfund")}),n.jsxs("div",{className:"growfund-space-y-4 growfund-mt-3",children:[n.jsxs("div",{className:"growfund-grid growfund-grid-cols-2 growfund-gap-3",children:[n.jsxs("div",{className:"growfund-flex growfund-flex-col growfund-gap-1",children:[n.jsx("span",{className:"growfund-typo-small growfund-text-fg-muted-foreground",children:__("First Name","growfund")}),n.jsx("span",{className:"growfund-typo-small growfund-text-fg-primary growfund-break-all growfund-line-clamp-2",children:A.first_name})]}),n.jsxs("div",{className:"growfund-flex growfund-flex-col growfund-gap-1",children:[n.jsx("span",{className:"growfund-typo-small growfund-text-fg-muted-foreground",children:__("Last Name","growfund")}),n.jsx("span",{className:"growfund-typo-small growfund-text-fg-primary growfund-break-all growfund-line-clamp-2",children:A.last_name})]})]}),n.jsxs("div",{className:"growfund-grid growfund-grid-cols-2 growfund-gap-3",children:[n.jsxs("div",{className:"growfund-flex growfund-flex-col growfund-gap-1",children:[n.jsx("span",{className:"growfund-typo-small growfund-text-fg-muted-foreground growfund-flex growfund-items-center growfund-gap-2",children:__("Email","growfund")}),n.jsx("span",{className:"growfund-typo-small growfund-text-fg-primary",children:A.email})]}),n.jsxs("div",{className:"growfund-flex growfund-flex-col growfund-gap-1",children:[n.jsx("span",{className:"growfund-typo-small growfund-text-fg-muted-foreground",children:__("Phone Number","growfund")}),n.jsx("span",{className:"growfund-typo-small growfund-text-fg-primary",children:A.phone})]})]}),n.jsxs("div",{className:"growfund-grid growfund-grid-cols-2 growfund-gap-3",children:[E&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"growfund-flex growfund-flex-col growfund-gap-1",children:[n.jsx("span",{className:"growfund-typo-small growfund-text-fg-muted-foreground",children:__("Shipping Address","growfund")}),n.jsx("span",{className:"growfund-typo-small growfund-text-fg-primary",children:x(A.shipping_address)})]}),A.is_billing_address_same?n.jsxs("div",{className:"growfund-flex growfund-flex-col growfund-gap-1",children:[n.jsx("span",{className:"growfund-typo-small growfund-text-fg-muted-foreground",children:__("Billing Address","growfund")}),n.jsx("span",{className:"growfund-typo-small growfund-text-fg-primary",children:x(A.shipping_address)})]}):n.jsxs("div",{className:"growfund-flex growfund-flex-col growfund-gap-1",children:[n.jsx("span",{className:"growfund-typo-small growfund-text-fg-muted-foreground",children:__("Billing Address","growfund")}),n.jsx("span",{className:"growfund-typo-small growfund-text-fg-primary",children:x(A.billing_address)})]})]}),p.isDonor()&&n.jsxs("div",{className:"growfund-flex growfund-flex-col growfund-gap-1",children:[n.jsx("span",{className:"growfund-typo-small growfund-text-fg-muted-foreground",children:__("Billing Address","growfund")}),n.jsx("span",{className:"growfund-typo-small growfund-text-fg-primary",children:x(A.billing_address)})]})]})]})]})})]}):n.jsx("div",{children:__("You are not allowed to access this page.","growfund")})};export{k as default};
