1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9384],{12984:(e,a,t)=>{t.d(a,{J:()=>d});var r=t(62021),s=t(74361),n=t(35548),i=t(2244),l=t(53745);let o=(0,i.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=s.forwardRef((e,a)=>{let{className:t,children:s,required:i,...d}=e;return(0,r.jsxs)(n.b,{ref:a,className:(0,l.cn)(o(),t),...d,children:[s,i&&(0,r.jsx)("span",{className:"text-destructive ml-1",children:"*"})]})});d.displayName=n.b.displayName},18683:(e,a,t)=>{t.d(a,{m_:()=>i,oK:()=>l});var r=t(62021),s=t(57468),n=t.n(s);function i(e){if(e)return e.startsWith("http")?e:"".concat("https://r4funds.com").concat(e)}function l(e){return a=>(0,r.jsxs)(r.Fragment,{children:[(null==e?void 0:e.title)&&(0,r.jsxs)(n(),{children:[(0,r.jsx)("title",{children:"".concat(e.title," | R4Fund$")}),(null==e?void 0:e.description)&&(0,r.jsx)("meta",{name:"description",content:e.description}),(null==e?void 0:e.ogTitle)&&(0,r.jsx)("meta",{property:"og:title",content:e.ogTitle}),(null==e?void 0:e.ogDescription)&&(0,r.jsx)("meta",{property:"og:description",content:e.ogDescription}),(null==e?void 0:e.ogImage)&&(0,r.jsx)("meta",{property:"og:image",content:i(e.ogImage)}),(null==e?void 0:e.ogUrl)&&(0,r.jsx)("meta",{property:"og:url",content:e.ogUrl}),(null==e?void 0:e.ogType)&&(0,r.jsx)("meta",{property:"og:type",content:e.ogType}),(null==e?void 0:e.ogSiteName)&&(0,r.jsx)("meta",{property:"og:site_name",content:e.ogSiteName}),(null==e?void 0:e.ogLocale)&&(0,r.jsx)("meta",{property:"og:locale",content:e.ogLocale})]}),a]})}},56103:(e,a,t)=>{t.d(a,{$C:()=>d,$p:()=>x,He:()=>u,cy:()=>c,qH:()=>m,yx:()=>p});var r=t(77802),s=t(6475),n=t(42293),i=t(63922),l=t(68804),o=t(71733);let d=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,r.I)({queryKey:["email-templates",e],queryFn:async()=>{let{data:a}=await i.default.get(o.oi.list(),{params:e});return a}})},c=e=>(0,r.I)({queryKey:["email-templates",e],queryFn:async()=>{let{data:a}=await i.default.get(o.oi.byId(e));return a},enabled:!!e}),m=()=>{let e=(0,s.jE)();return(0,n.n)({mutationFn:async e=>{let{data:a}=await i.default.post(o.oi.create(),e);return a},onSuccess:()=>{e.invalidateQueries({queryKey:["email-templates"]}),l.toast.success("Email template created successfully")},onError:e=>{var a,t;l.toast.error((null==(t=e.response)||null==(a=t.data)?void 0:a.message)||"Failed to create email template")}})},x=()=>{let e=(0,s.jE)();return(0,n.n)({mutationFn:async e=>{let{id:a,dto:t}=e,{data:r}=await i.default.patch(o.oi.update(a),t);return r},onSuccess:(a,t)=>{e.invalidateQueries({queryKey:["email-templates"]}),e.invalidateQueries({queryKey:["email-templates",t.id]}),l.toast.success("Email template updated successfully")},onError:e=>{var a,t;l.toast.error((null==(t=e.response)||null==(a=t.data)?void 0:a.message)||"Failed to update email template")}})},u=()=>{let e=(0,s.jE)();return(0,n.n)({mutationFn:async e=>{await i.default.delete(o.oi.delete(e))},onSuccess:()=>{e.invalidateQueries({queryKey:["email-templates"]}),l.toast.success("Email template deleted successfully")},onError:e=>{var a,t;l.toast.error((null==(t=e.response)||null==(a=t.data)?void 0:a.message)||"Failed to delete email template")}})},p=()=>(0,n.n)({mutationFn:async e=>{await i.default.post(o.oi.testSend(),e)},onSuccess:()=>{l.toast.success("Test email sent successfully")},onError:e=>{var a,t;l.toast.error((null==(t=e.response)||null==(a=t.data)?void 0:a.message)||"Failed to send test email")}})},62798:(e,a,t)=>{t.d(a,{e:()=>y});var r=t(62021),s=t(74361),n=t(55103),i=t.n(n),l=t(77926),o=t(54686),d=t(12984),c=t(56103);t(45903);var m=t(71462),x=t(53745),u=t(31072),p=t(87253),g=t(59483),h=t(60506);let f=e=>{let{value:a,onChange:n,className:i,height:l="300px"}=e,o=(0,s.useRef)(null),d=(0,s.useRef)(null);return(0,s.useEffect)(()=>{if(!o.current||d.current)return;let e=!0;return(async()=>{try{let r=(await Promise.all([t.e(9653),t.e(3569)]).then(t.bind(t,89653))).default;if(!e||!o.current||d.current)return;let s=new r(o.current,{theme:"snow",modules:{toolbar:[[{header:[1,2,3,!1]}],["bold","italic","underline","strike"],[{color:[]},{background:[]}],[{list:"ordered"},{list:"bullet"}],["link","image"],["clean"]]}});
1d.current=s,a&&(s.root.innerHTML=a),s.on("text-change",()=>{e&&n(s.root.innerHTML)})}catch(e){console.error("Failed to initialize Quill:",e)}})(),()=>{e=!1,d.current&&(d.current=null)}},[]),(0,s.useEffect)(()=>{if(!d.current)return;let e=d.current.root.innerHTML,t=a||"";if(e!==t){let e=d.current.getSelection();d.current.root.innerHTML=t,e&&d.current.setSelection(e)}},[a]),(0,r.jsxs)("div",{className:"quill-editor-wrapper ".concat(i||""),children:[(0,r.jsx)("style",{children:"\n .quill-editor-wrapper .ql-container {\n font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;\n font-size: 16px;\n color: #1e293b;\n border: none !important;\n }\n .quill-editor-wrapper .ql-toolbar {\n border-top: none !important;\n border-left: none !important;\n border-right: none !important;\n border-bottom: 1px solid #e2e8f0 !important;\n background-color: #f8fafc;\n padding: 12px 16px !important;\n }\n .quill-editor-wrapper .ql-editor {\n padding: 40px !important;\n min-height: 400px;\n line-height: 1.6;\n }\n .quill-editor-wrapper .ql-editor h2 {\n font-size: 24px !important;\n font-weight: 700 !important;\n letter-spacing: -0.01em !important;\n margin: 0 0 16px 0 !important;\n color: #0f172a !important;\n }\n .quill-editor-wrapper .ql-editor p {\n margin: 0 0 24px 0 !important;\n font-size: 16px !important;\n color: #475569 !important;\n }\n .quill-editor-wrapper .ql-editor strong {\n color: #0f172a !important;\n font-weight: 700 !important;\n }\n "}),(0,r.jsx)("div",{ref:o,style:{height:l}})]})},y=e=>{let{template:a,mode:t="edit",onSaveSuccess:n,onCancel:y}=e,[b,j]=s.useState(""),[v,N]=s.useState(""),[w,k]=s.useState(""),[S,E]=s.useState(""),[C,F]=s.useState(""),[A,T]=s.useState({}),[z,R]=s.useState(!0),[D,q]=s.useState(!1),[B,P]=s.useState(!1),[L,U]=s.useState(""),[H,M]=s.useState("[email protected]"),[Z,I]=s.useState("R4Fund$"),[J,$]=s.useState(""),[K,W]=s.useState("editor"),_=(0,c.$p)(),O=(0,c.qH)(),Y=(0,c.yx)(),Q=(0,s.useMemo)(()=>Array.from(new Set(S.match(/{{[a-zA-Z0-9_]+}}/g)||[])).filter(e=>"{{else}}"!==e&&"{{this}}"!==e),[S]);(0,s.useEffect)(()=>{let e={...A},a=!1;Q.forEach(t=>{let r=t.replace(/[{}]/g,"").trim();if(void 0===e[r]){let t={name:"Test Recipient",donorName:"John Doe",amount:"100",subTotal:"103.50",currency:"USD",schoolName:"Example Academy",schoolSlug:"example-academy",campaignName:"Winter Fundraiser",resetLink:"https://r4funds.com/reset-password?token=test",date:new Date().toLocaleDateString("en-US",{timeZone:"UTC"}),currentYear:new Date().getFullYear().toString(),schoolLogo:"/rock-solid-logo.svg",logoUrl:"/rock-solid-logo.svg",optionalDonationAmount:"5.00",transactionFees:"3.50",students:[{name:"Alice Smith",amount:"50"},{name:"Bob Johnson",amount:"50"}]};e[r]=t[r]||"",a=!0}}),a&&T(e)},[Q]),(0,s.useEffect)(()=>{"edit"===t&&a?(j(a.key),N(a.subject),k(a.description||""),E(a.body),U(a.toPattern||""),M(a.fromEmail||"[email protected]"),I(a.fromName||"R4Fund$"),$(a.additionalHeaders?Object.entries(a.additionalHeaders).map(e=>{let[a,t]=e;return"".concat(a,": ").concat(t)}).join("\n"):"")):(j(""),N(""),k(""),E(""),U(""),M("[email protected]"),I("R4Fund$"),$("")),W("editor"),T({name:"Test Recipient",donorName:"John Doe",amount:"100",subTotal:"103.50",currency:"USD",campaignName:"Winter Fundraiser",schoolName:"Example Academy",resetLink:"https://r4funds.com/reset-password?token=test",date:new Date().toLocaleDateString(),currentYear:new Date().getFullYear().toString(),schoolLogo:"/rock-solid-logo.svg",logoUrl:"/rock-solid-logo.svg",optionalDonationAmount:"5.00",transactionFees:"3.50",students:[{name:"Alice Smith",amount:"50"},{name:"Bob Johnson",amount:"50"}]})},[a,t]);let X="\x3c!-- PRE_BODY_START --\x3e",V="\x3c!-- PRE_BODY_END --\x3e",G=(0,s.useMemo)(()=>{if(S.includes(X)&&S.includes(V)){let e=S.split(X);if(e.length>1)return e[1].split(V)[0].trim()}return S},[S]),ee=(0,s.useMemo)(()=>{try{if(!v)return"";return i().compile(v)(A)}catch(e){return console.warn("Handlebars subject compilation warning:",e),v}},[v,A]),ea=(0,s.useMemo)(()=>
1{try{if(!Z)return"";return i().compile(Z)(A)}catch(e){return console.warn("Handlebars fromName compilation warning:",e),Z}},[Z,A]),et=(0,s.useMemo)(()=>{try{if(!S)return"";let e=i().compile(S)(A);return"\n <!DOCTYPE html>\n <html>\n <head>\n <meta charset=\"utf-8\">\n <style>\n body {\n font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n line-height: 1.5;\n color: #0f172a;\n margin: 0;\n padding: 0;\n background-color: #f8fafc;\n }\n .preview-wrapper {\n padding: 20px;\n width: 100%;\n box-sizing: border-box;\n }\n </style>\n </head>\n <body>\n <div class=\"preview-wrapper\">\n ".concat(e,"\n </div>\n </body>\n </html>\n ")}catch(e){return console.warn("Handlebars compilation warning:",e),'\n <!DOCTYPE html>\n <html>\n <head>\n <meta charset="utf-8">\n <style>\n body {\n font-family: \'Inter\', -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, sans-serif;\n padding: 20px;\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 100vh;\n background-color: #f8fafc;\n }\n .message {\n text-align: center;\n color: #64748b;\n }\n .icon {\n font-size: 48px;\n margin-bottom: 10px;\n }\n </style>\n </head>\n <body>\n <div class="message">\n <div class="icon">âï¸</div>\n <p>Preview will update when template syntax is complete...</p>\n </div>\n </body>\n </html>\n '}},[S,A]);return(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsxs)("div",{className:"h-12 w-12 md:h-16 md:w-16 rounded-lg bg-primary/10 flex items-center justify-center border shadow-sm flex-shrink-0",children:[(0,r.jsx)(p.Ay,{name:"Mail",size:24,className:"text-primary md:hidden"}),(0,r.jsx)(p.Ay,{name:"Mail",size:32,className:"text-primary hidden md:block"})]}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)("h1",{className:"text-xl md:text-3xl font-bold tracking-tight truncate",children:"create"===t?"Create Email Template":v?v.replace(/\{\{[^}]+\}\}/g,"..."):"Email Template"}),b&&(0,r.jsx)(g.E,{variant:"outline",className:"font-mono text-[10px] md:text-xs",children:b})]}),(0,r.jsxs)("p",{className:"text-muted-foreground flex items-center gap-1 mt-1 text-xs md:text-sm truncate",children:[(0,r.jsx)(p.Ay,{name:"Tag",size:14}),w||"Customize the automated email sent to users"]})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[(0,r.jsxs)(l.$,{variant:"outline",onClick:y,className:"w-full sm:w-auto",children:[(0,r.jsx)(p.Ay,{name:"ArrowLeft",size:18,className:"mr-2"}),"Back"]}),(0,r.jsx)(l.$,{onClick:()=>{let e={};J.trim()&&J.split("\n").forEach(a=>{let[t,...r]=a.split(":");t&&r.length>0&&(e[t.trim()]=r.join(":").trim())});let r={subject:v,body:S,description:w,toPattern:L||void 0,fromEmail:H||void 0,fromName:Z||void 0,additionalHeaders:Object.keys(e).length>0?e:void 0};"edit"===t&&a?_.mutate({id:a.id,dto:r},{onSuccess:()=>{null==n||n()}}):O.mutate({key:b,...r},{onSuccess:()=>{null==n||n()}})},disabled:_.isPending||O.isPending,className:"w-full sm:w-auto",children:_.isPending||O.isPending?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.Ay,{name:"Loader2",className:"mr-2 animate-spin",size:18}),"Saving..."]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.Ay,{name:"Save",className:"mr-2",size:18}),"Save"]})})]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[(0,r.jsxs)("div",{className:"lg:col-span-2 space-y-6",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 pb-2 border-b",children:[(0,r.jsx)(p.Ay,{name:"Edit",size:18,className:"text-primary"}),(0,r.jsx)("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:"Template Editor"})]}),Q.length>0&&(0,r.jsxs)("div",{className:"bg-muted/30 border border-gray-200 dark:border-gray-700 rounded-lg p-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,r.jsx)(p.Ay,{name:"Tag",size:14,className:"text-amber-600"}),(0,r.jsxs)("span",{className:"text-xs font-medium",children:["Placeholders (",Q.length,")"]})]}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5",children:Q.map(e=>(0,r.jsx)("button",{onClick:()=>(0,x.lW)(e),className:"px-2 py-1 text-[10px] font-mono bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded hover:bg-primary hover:text-white hover:border-primary transition-colors",children:e},e))})]}),(0,r.jsxs)(m.tU,{value:K,onValueChange:W,className:"w-full",children:[(0,r.jsx)("div",{className:"overflow-x-auto pb-1 scrollbar-none",children:(0,r.jsxs)(m.j7,{className:"bg-muted inline-flex w-auto min-w-full",children:[(0,r.jsxs)(m.Xi,{value:"editor",className:"flex items-center gap-2 whitespace-nowrap",children:[(0,r.jsx)(p.Ay,{name:"Edit",size:14}),"Editor"]}),(0,r.jsxs)(m.Xi,{value:"code",className:"flex items-center gap-2 whitespace-nowrap",children:[(0,r.jsx)(p.Ay,{name:"Code",size:14}),"Code"]}),(0,r.jsxs)(m.Xi,{value:"preview",className:"flex items-center gap-2 whitespace-nowrap",children:[(0,r.jsx)(p.Ay,{name:"Eye",size:14}),"Live Preview"]})]})}),(0,r.jsx)(m.av,{value:"editor",className:"mt-4",children:(0,r.jsxs)(u.Zp,{className:"border-gray-200 dark:border-gray-700 shadow-sm overflow-hidden",children:[(0,r.jsxs)("div",{className:"bg-muted/50 border-b border-gray-200 dark:border-gray-700 px-5 py-3 flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center text-primary",children:(0,r.jsx)(p.Ay,{name:"Edit",size:16})}),(0,r.jsx)("span",{className:"text-xs font-bold text-slate-600 dar
1k:text-slate-300 uppercase tracking-widest",children:"Template Body Editor"})]}),S.includes(X)&&(0,r.jsxs)(g.E,{variant:"outline",className:"text-[10px]",children:[(0,r.jsx)(p.Ay,{name:"Zap",size:10,className:"mr-1"}),"Protected"]})]}),(0,r.jsx)(u.Wu,{className:"p-0",children:"create"===t||S?(0,r.jsx)(f,{value:G,onChange:e=>{if(S.includes(X)&&S.includes(V)){let a=S.split(X),t=a[1].split(V);E("".concat(a[0]).concat(X,"\n ").concat(e,"\n ").concat(V).concat(t.slice(1).join(V)))}else E(e)},height:"calc(min(600px, 70vh))"}):(0,r.jsx)("div",{className:"flex items-center justify-center h-[300px] md:h-[600px] text-muted-foreground",children:(0,r.jsx)(p.Ay,{name:"Loader2",className:"animate-spin",size:24})})})]})}),(0,r.jsx)(m.av,{value:"code",className:"mt-4",children:(0,r.jsxs)(u.Zp,{className:"border-gray-200 dark:border-gray-700 shadow-sm",children:[(0,r.jsx)(u.aR,{className:"border-b border-gray-200 dark:border-gray-700",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)(u.ZB,{className:"text-sm font-semibold flex items-center gap-2",children:[(0,r.jsx)(p.Ay,{name:"Code",size:16}),"Raw HTML Content"]}),(0,r.jsxs)(g.E,{variant:"outline",className:"text-[10px] text-amber-600 bg-amber-50 dark:bg-amber-900/30 border-amber-200 dark:border-amber-800",children:[(0,r.jsx)(p.Ay,{name:"AlertTriangle",size:10,className:"mr-1"}),"Advanced Mode"]})]})}),(0,r.jsxs)(u.Wu,{className:"p-4",children:[(0,r.jsx)("textarea",{value:S,onChange:e=>E(e.target.value),className:"w-full h-[400px] md:h-[600px] p-4 font-mono text-xs bg-slate-950 text-slate-200 border border-gray-200 dark:border-gray-700 rounded-md focus:ring-1 focus:ring-primary outline-none transition-all resize-none",spellCheck:!1}),(0,r.jsx)("p",{className:"text-[10px] text-muted-foreground italic mt-2",children:"Changes made here will reflect in the Editor tab and Live Preview."})]})]})}),(0,r.jsx)(m.av,{value:"preview",className:"mt-4",children:(0,r.jsxs)(u.Zp,{className:"border-gray-200 dark:border-gray-700 shadow-sm overflow-hidden",children:[(0,r.jsx)(u.aR,{className:"border-b border-gray-200 dark:border-gray-700 bg-white dark:bg-soft-dark",children:(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-xs font-bold text-muted-foreground uppercase w-16",children:"Subject:"}),(0,r.jsx)("span",{className:"text-sm font-medium",children:ee||"(No Subject)"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 border-t pt-2",children:[(0,r.jsx)("span",{className:"text-xs font-bold text-muted-foreground uppercase w-16",children:"From:"}),(0,r.jsxs)("span",{className:"text-sm font-medium",children:[ea||"R4Fund$"," <",H||"[email protected]",">"]})]})]})}),(0,r.jsx)(u.Wu,{className:"p-2 md:p-4 bg-[#f1f5f9] dark:bg-slate-900 min-h-[400px] md:min-h-[600px] flex justify-center",children:(0,r.jsx)("iframe",{title:"Email Preview",srcDoc:et,className:"w-full max-w-full md:max-w-[650px] bg-white shadow-xl rounded-sm border-none min-h-[400px] md:min-h-[600px]",sandbox:"allow-same-origin"})})]})})]})]}),(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 pb-2 border-b",children:[(0,r.jsx)(p.Ay,{name:"Settings",size:18,className:"text-primary"}),(0,r.jsx)("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:"Template Settings"})]}),(0,r.jsx)(h.Nt,{open:z,onOpenChange:R,children:(0,r.jsxs)(u.Zp,{className:"border-gray-200 dark:border-gray-700 bg-white dark:bg-soft-dark shadow-sm",children:[(0,r.jsx)(h.R6,{asChild:!0,children:(0,r.jsx)(u.aR,{className:"border-b border-gray-100 dark:border-gray-700 pb-4 cursor-pointer hover:bg-muted/50 transition-colors",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"p-2 bg-primary/10 rounded-lg text-primary",children:(0,r.jsx)(p.Ay,{name:"Settings",size:20})}),(0,r.jsxs)("div",{children:[(0,r.jsx)(u.ZB,{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:"Template Configuration"}),(0,r.jsx)(u.BT,{children:"Basic identification details"})]})]}),(0,r.jsx)(p.Ay,{name:z?"ChevronUp":"ChevronDown",size:20,className:"text-muted-foreground transition-transform"})]})})}),(0,r.jsx)(h.Ke,{children:(0,r.jsxs)(u.Wu,{className:"p-6 space-y-4",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.J,{htmlFor:"key",className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Template Unique Key"}),(0,r.jsx)(o.p,{id:"key",value:b,onChange:e=>j(e.target.value),placeholder:"e.g. welcome-email",disabled:"edit"===t,className:"h-10 bg-gray-50/50 dark:bg-lite-dark border-gray-200 dark:border-gray-600 focus:ring-2 focus:ring-primary/20 transition-all font-mono text-sm"}),(0,r.jsxs)("p",{className:"text-[11px] text-gray-400 italic flex items-center gap-1",children:[(0,r.jsx)(p.Ay,{name:"Info",size:12}),"System identifier - cannot be changed once created"]})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.J,{htmlFor:"subject",className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Email Subject Line"}
1),(0,r.jsx)(o.p,{id:"subject",value:v,onChange:e=>N(e.target.value),placeholder:"Welcome to R4Fund$!",className:"h-10 border-gray-200 dark:border-gray-600 focus:ring-2 focus:ring-primary/20 transition-all"}),(0,r.jsxs)("p",{className:"text-[11px] text-gray-400 italic flex items-center gap-1",children:[(0,r.jsx)(p.Ay,{name:"Eye",size:12}),"The subject line shown in the recipient's inbox"]})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.J,{htmlFor:"description",className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Detailed Description"}),(0,r.jsx)(o.p,{id:"description",value:w,onChange:e=>k(e.target.value),placeholder:"e.g. Sent to donors after a successful transaction...",className:"h-10 bg-gray-50/50 dark:bg-lite-dark border-gray-200 dark:border-gray-600 focus:ring-2 focus:ring-primary/20 transition-all"})]})]})})]})}),(0,r.jsx)(h.Nt,{open:B,onOpenChange:P,children:(0,r.jsxs)(u.Zp,{className:"border-gray-200 dark:border-gray-700 bg-white dark:bg-soft-dark shadow-sm",children:[(0,r.jsx)(h.R6,{asChild:!0,children:(0,r.jsx)(u.aR,{className:"border-b border-gray-100 dark:border-gray-700 pb-4 cursor-pointer hover:bg-muted/50 transition-colors",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"p-2 bg-purple-500/10 rounded-lg text-purple-600",children:(0,r.jsx)(p.Ay,{name:"Mail",size:20})}),(0,r.jsxs)("div",{children:[(0,r.jsx)(u.ZB,{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:"Email Headers"}),(0,r.jsx)(u.BT,{children:"Configure recipient and sender information"})]})]}),(0,r.jsx)(p.Ay,{name:B?"ChevronUp":"ChevronDown",size:20,className:"text-muted-foreground transition-transform"})]})})}),(0,r.jsx)(h.Ke,{children:(0,r.jsxs)(u.Wu,{className:"p-6 space-y-4",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.J,{htmlFor:"toPattern",className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"To Pattern"}),(0,r.jsx)(o.p,{id:"toPattern",value:L,onChange:e=>U(e.target.value),placeholder:"[donor-first-name] [donor-last-name] <[donor-email]>",className:"h-10 font-mono text-xs bg-gray-50/50 dark:bg-lite-dark border-gray-200 dark:border-gray-600 focus:ring-2 focus:ring-primary/20 transition-all"}),(0,r.jsxs)("p",{className:"text-[11px] text-gray-400 italic flex items-center gap-1",children:[(0,r.jsx)(p.Ay,{name:"Info",size:12}),"Use placeholders like [donor-first-name], [donor-email] for dynamic recipients"]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.J,{htmlFor:"fromName",className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"From Name"}),(0,r.jsx)(o.p,{id:"fromName",value:Z,onChange:e=>I(e.target.value),placeholder:"R4Fund$",className:"h-10 border-gray-200 dark:border-gray-600 focus:ring-2 focus:ring-primary/20 transition-all"})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.J,{htmlFor:"fromEmail",className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"From Email"}),(0,r.jsx)(o.p,{id:"fromEmail",type:"email",value:H,onChange:e=>M(e.target.value),placeholder:"[email protected]",className:"h-10 font-mono text-xs border-gray-200 dark:border-gray-600 focus:ring-2 focus:ring-primary/20 transition-all"})]})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.J,{htmlFor:"additionalHeaders",className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Additional Headers"}),(0,r.jsx)("textarea",{id:"additionalHeaders",value:J,onChange:e=>$(e.target.value),placeholder:"Bcc: [email protected] Reply-To: [email protected]",rows:3,className:"w-full p-3 font-mono text-xs bg-gray-50/50 dark:bg-lite-dark border border-gray-200 dark:border-gray-600 rounded-md focus:ring-2 focus:ring-primary/20 outline-none transition-all resize-none"}),(0,r.jsxs)("p",{className:"text-[11px] text-gray-400 italic flex items-center gap-1",children:[(0,r.jsx)(p.Ay,{name:"Info",size:12}),"One header per line in format: Header-Name: value (e.g., Bcc: [email protected])"]})]})]})})]})}),Q.length>0&&(0,r.jsx)(h.Nt,{open:D,onOpenChange:q,children:(0,r.jsxs)(u.Zp,{className:"border-gray-200 dark:border-gray-700 bg-white dark:bg-soft-dark shadow-sm",children:[(0,r.jsx)(h.R6,{asChild:!0,children:(0,r.jsx)(u.aR,{className:"border-b border-gray-100 dark:border-gray-700 pb-4 cursor-pointer hover:bg-muted/50 transition-colors",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"p-2 bg-blue-500/10 rounded-lg text-blue-600",children:(0,r.jsx)(p.Ay,{name:"FlaskConical",size:20})}),(0,r.jsxs)("div",{children:[(0,r.jsx)(u.ZB,{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:"Test Data"}),(0,r.jsx)(u.BT,{children:"Configure test values"})]})]}),(0,r.jsx)(p.Ay,{name:D?"ChevronUp":"ChevronDown",size:20,className:"text-muted-foreground transition-transform"})]})})}),(0,r.jsx)(h.Ke,{children:(0,r.jsx)(u.Wu,{className:"p-6",children:(0,r.jsx)("div",{className:"space-y-3 max-h-[300px] overflow-y-auto",children:Q.map(e=>{let a=e.replace(/[{}]/g,"");return(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(d.J,{htmlFor:"test-".concat(a),className:"text-xs font-medium text-muted-foreground",children:e}),(0,r.jsx)(o.p,{id:"test-".concat(a),value:A[a]||"",onChange:e=>T({...A,[a]:e.target.value}),placeholder:"Value for ".concat(e,"..."),className:"h-8 text-xs font-mono"})]},e)})})})})]})}),(0,r.jsxs)(u.Zp,{className:"border-gray-200 dark:border-gray-700 bg-white dark:bg-soft-dark shadow-sm",children:[(0,r.jsx)(u.aR,{className:"border-b border-gray-100 dark:border-gray-700 pb-4",children:(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"p-2 bg-indigo-500/10 rounded-lg text-indigo-600",children:(0,r.jsx)(p.Ay,{name:"Send",size:20})}),(0,r.jsxs)("div",{children:[(0,r.jsx)(u.ZB,{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:"Send Test Email"}),(0,r.jsx)(u.BT,{children:"Test your changes"})]})]})}),(0,r.jsx)(u.Wu,{className:"p-6",children:(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.J,{className:"text-sm font-medium",children:"Test Email Recipient"}),(0,r.jsx)(o.p,{placeholder:"Enter your email address...",value:C,onChange:e=>F(e.target.value),className:"h-10"})]}),(0,r.jsx)(l.$,{variant:"secondary",className:"w-full h-10 font-bold",onClick:()=>{b&&C&&Y.mutate({to:C,templateKey:b,data:A})},disabled:Y.isPending||!C,children:Y.isPending?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.Ay,{name:"Loader2",className:"mr-2 animate-spin",size:16}),"Sending..."]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.Ay,{name:"Send",className:"mr-2",size:16}),"Send Test"]})})]})})]})]})]})]})}},71462:(e,a,t)=>{t.d(a,{Xi:()=>d,av:()=>c,j7:()=>o,tU:()=>l});var r=t(62021),s=t(74361),n=t(32595),i=t(53745);let l=n.bL,o=s.forwardRef((e,a)=>{let{className:t,...s}=e;return(0,r.jsx)(n.B8,{ref:a,className:(0,i.cn)("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",t),...s})});o.displayName=n.B8.displayName;let d=s.forwardRef((e,a)=>{let{className:t,...s}=e;return(0,r.jsx)(n.l9,{ref:a,className:(0,i.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",t),...s})});d.displayName=n.l9.displayName;let c=s.forwardRef((e,a)=>{let{className:t,...s}=e;return(0,r.jsx)(n.UC,{ref:a,className:(0,i.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...s})});c.displayName=n.UC.displayName}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.