import{j as s,u as r,r as e}from"./router.chunk.YsRm4bSN.js";import{x as t,y as o,z as n,aj as i,u as a,Z as c,A as u,ai as d,r as l,K as m,B as f,R as p,E as j,J as h}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 w}from"./pro-switch-input.chunk.BAQFhkCR.js";import{P as x}from"./pro-badge.chunk.PstHsVdU.js";import{u as k}from"./use-update-dirty-state.chunk.Bh3v76yr.js";import{b}from"./settings.chunk.D9nMP-Um.js";import{u as y}from"./use-route-blocker-guard.chunk.CxzDiMl1.js";import{af as N}from"./icons.chunk.BwnSC3zE.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"./date-utils.chunk.DWRtWTmT.js";import"./switch.chunk.BWrU_4pe.js";import"./template-layout-context.chunk.B1U8ZWnY.js";const v=()=>s.jsx(t,{children:s.jsxs(o,{className:"growfund-p-5",children:[s.jsxs("div",{className:"growfund-flex growfund-items-center growfund-justify-between",children:[s.jsxs(n,{children:[__("Annual Receipt","growfund")," ",s.jsx(x,{})]}),s.jsx(w,{})]}),s.jsx(i,{children:__("Enable this option to allow donors to download their annual donation receipts from their dashboard.","growfund")})]})}),R=()=>{const w=r(),{appConfig:x,isDonationMode:R}=a(),E=g({resolver:h(b)});e.useEffect(()=>{E.reset.call(null,{...c(b),...x[u.Receipt]??{}})},[x,E.reset]);const{registerForm:D,isCurrentFormDirty:P}=d();e.useEffect(()=>{const s=D(u.Receipt,E);return()=>{s()}},[D]),k(E),y({isDirty:P});const C=l.get("PdfReceiptSettingsAnnualReceipt");return s.jsx(m,{...E,children:s.jsxs("div",{className:"growfund-grid growfund-gap-4",children:[s.jsx(t,{children:s.jsx(o,{className:"growfund-p-5",children:s.jsxs("div",{className:"growfund-flex growfund-items-center growfund-justify-between",children:[s.jsxs("div",{className:"growfund-space-y-2",children:[s.jsxs(n,{className:"growfund-flex growfund-items-center growfund-gap-2",children:[s.jsx(N,{}),s.jsx("div",{children:__("Default PDF Template","growfund")})]}),s.jsx(i,{className:"growfund-w-[90%]",children:__("Customize your receipt template with your logo, colors, greetings, footer and more.","growfund")})]}),s.jsx(f,{variant:"outline",onClick:()=>w(p.PdfReceiptTemplate.buildLink()),children:__("Edit","growfund")})]})})}),R&&s.jsx(j,{fallback:s.jsx(v,{}),children:C&&s.jsx(C,{})})]})})};export{R as default};
