import{r,j as s}from"./router.chunk.YsRm4bSN.js";import{aJ as t,J as o,az as e,u as i}from"./main.chunk.N-eZ2ybB.js";import{k as n}from"./forms.chunk.Bz8aaTWe.js";import{d as u}from"./template.chunk.DPZ5D-on.js";import{O as c}from"./option-keys.chunk.CTqS8AT8.js";import{P as a,a as m}from"./pdf-receipt.chunk.DweY_jAg.js";import{u as p}from"./template-layout-context.chunk.B1U8ZWnY.js";import{a as j}from"./use-update-dirty-state.chunk.Bh3v76yr.js";import"./react-jsx-runtime.chunk.ATkk6v2S.js";import"./react.js";import"./react-dom-client.chunk.BMQ1litG.js";import"./react-dom.js";import"./wordpress.chunk.BVds2GcU.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"./radio-group.chunk.BTBtVnZk.js";import"./separator.chunk.3HcpyIlz.js";import"./media-field.chunk.B--jhwMa.js";import"./media.chunk.BUcAGRSV.js";import"./charts.chunk.BbweDdoQ.js";import"./range-slider-field.chunk.lLx6oBQy.js";import"./pro-color-picker-input.chunk.c0Q1A8Ua.js";import"./pro-badge.chunk.PstHsVdU.js";import"./editor-field.chunk.851uyGBn.js";import"./use-currency.chunk.QE--bLc6.js";import"./pro-checkbox-input.chunk.CXHxe_1k.js";const d=()=>{const i=r.useRef(null),d=t(c.PDF_DONATION_RECEIPT_TEMPLATE),h=n({resolver:o(m)}),{registerForm:k}=p();r.useEffect(()=>{const r=k(c.PDF_DONATION_RECEIPT_TEMPLATE,h);return()=>{r()}},[k]),j(h);const f=r.useMemo(()=>d.data?d.data:null,[d.data]);return d.isLoading||d.isPending?s.jsx(e,{}):s.jsx(u,{form:h,ref:i,children:s.jsx(a,{pdfReceiptTemplate:f})})},h=()=>{const i=r.useRef(null),d=t(c.PDF_PLEDGE_RECEIPT_TEMPLATE),h=n({resolver:o(m)}),{registerForm:k}=p();r.useEffect(()=>{const r=k(c.PDF_PLEDGE_RECEIPT_TEMPLATE,h);return()=>{r()}},[k]),j(h);const f=r.useMemo(()=>d.data?d.data:null,[d.data]);return d.isLoading||d.isPending?s.jsx(e,{}):s.jsx(u,{form:h,ref:i,children:s.jsx(a,{pdfReceiptTemplate:f})})},k=()=>{const{isDonationMode:r}=i();return r?s.jsx(d,{}):s.jsx(h,{})};export{k as default};
