import{j as s,r}from"./router.chunk.YsRm4bSN.js";import{u as o,x as n,y as e,z as i,aj as a,G as t,Z as c,A as d,ai as m,r as u,K as l,E as j,J as p}from"./main.chunk.N-eZ2ybB.js";import{_ as __}from"./wordpress.chunk.BVds2GcU.js";import{k as g}from"./forms.chunk.Bz8aaTWe.js";import{P as h}from"./pro-switch-input.chunk.BAQFhkCR.js";import{P as f}from"./pro-badge.chunk.PstHsVdU.js";import{u as x}from"./use-update-dirty-state.chunk.Bh3v76yr.js";import{U as k}from"./settings.chunk.D9nMP-Um.js";import{u as w}from"./use-route-blocker-guard.chunk.CxzDiMl1.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"./icons.chunk.BwnSC3zE.js";import"./date-utils.chunk.DWRtWTmT.js";import"./switch.chunk.BWrU_4pe.js";import"./template-layout-context.chunk.B1U8ZWnY.js";const b=()=>s.jsx(h,{label:__("Anonymous Donations","growfund"),description:__("Allow donors to donate anonymously.","growfund"),showProBadge:!0}),y=()=>{const{isDonationMode:r}=o();return s.jsx(h,{label:__(r?"Donor Comments":"Backer Comments","growfund"),description:__(r?"Allow donors to add comments to campaign.":"Allow backers to add comments to campaign.","growfund"),showProBadge:!0})},P=()=>s.jsxs(n,{children:[s.jsxs(e,{children:[s.jsxs(i,{children:[__("Fundraiser","growfund")," ",s.jsx(f,{})]}),s.jsx(a,{children:__("Manage fundraiser permissions and controls.","growfund")})]}),s.jsxs(t,{className:"growfund-space-y-4",children:[s.jsx(h,{label:__("Publishing Campaigns","growfund"),description:__("Toggle to allow direct campaign publishing.","growfund")}),s.jsx(h,{label:__("Campaign Deletion","growfund"),description:__("Toggle to allow deleting a campaign permanently.","growfund")})]})]}),C=()=>{const{appConfig:h,isDonationMode:f}=o(),C=g({resolver:p(k)});r.useEffect(()=>{C.reset.call(null,{...c(k),...h[d.UserAndPermissions]??{}})},[h,C.reset]);const{registerForm:A,isCurrentFormDirty:D}=m();r.useEffect(()=>{const s=A(d.UserAndPermissions,C);return()=>{s()}},[A]),x(C),w({isDirty:D});const U=u.get("UserPermissionsFundraiserSettings"),M=u.get("UserPermissionsAnonymousContributions"),B=u.get("UserPermissionsContributorComments");return s.jsx(l,{...C,children:s.jsxs("div",{className:"growfund-grid growfund-gap-4",children:[s.jsx(j,{fallback:s.jsx(P,{}),children:U&&s.jsx(U,{})}),s.jsxs(n,{children:[s.jsxs(e,{children:[s.jsx(i,{children:__(f?"Donor":"Backer","growfund")}),s.jsx(a,{children:__(f?"Manage donor permissions and controls.":"Manage backer permissions and controls.","growfund")})]}),s.jsxs(t,{className:"growfund-space-y-4",children:[f&&s.jsx(j,{fallback:s.jsx(b,{}),children:M&&s.jsx(M,{})}),s.jsx(j,{fallback:s.jsx(y,{}),children:B&&s.jsx(B,{})})]})]})]})})};export{C as default};
