"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7279],{17279:function(e,t,n){n.d(t,{iq:function(){return f},lM:function(){return w},nm:function(){return g},Jo:function(){return S},zW:function(){return b},PG:function(){return p},ew:function(){return N}});var i=n(85893),r=n(45697),a=n.n(r),o=n(90669);function u(e){let{section:t}=e;return t.code?(0,i.jsx)(o.Z,{html:t.code}):null}u.propTypes={section:a().object},n(47380),n(76882);var l=n(79545),d=n(67294),s=n(97236),c=n(50178),m=n(9779),v=n(67304);let f={NOW:"now",TRIBUTE:"tribute"};function g(e){let{section:t,rules:n={}}=e,r={...n,alignment:t.alignment};switch(null==t?void 0:t.__typename){case"RichTextSection":return(0,i.jsx)(l.Nq,{json:t.content.json,rules:r});case"HtmlCode":return(0,i.jsx)(u,{section:t});default:return null}}function p(e,t,n){let i=(0,d.useRef)(""),r=(0,d.useRef)(""),a=(0,d.useRef)(!1),o=(0,d.useRef)(!1),{isSignedIn:u}=(0,m.SE)();(0,d.useEffect)(()=>{let l=e=>{let t="Submit Secure Donation";isNaN(e)&&isNaN(e.replaceAll(",",""))||(t="".concat(i.current," $").concat(e));let n=document.querySelector('[data-fieldid="ggePaymentPlan--ongoingOption"]').checked;n&&(t+=" Each ".concat(r.current)),document.querySelector("#ggeForm1 button[type='submit']").innerHTML=t,document.querySelector(".ggeSection--payment h1").innerHTML='<i class="fa-regular fa-lock"></i> Your information is secure',a.current&&!o.current&&(e=>{let t=document.querySelectorAll('div[data-answername="DonationLevel"] .ggePrompts > .ggePrompt');t.forEach((t,n)=>{e?n<3?t.classList.remove("hiddenAmount"):t.classList.add("hiddenAmount"):n>1?t.classList.remove("hiddenAmount"):t.classList.add("hiddenAmount")})})(n)},d=t=>{var n,d,m,v;let f=document.querySelector('[data-answername="Tribute Message"]');f&&(a.current=!0),document.querySelector("main").setAttribute("data-formType",a.current?"tribute":"non-tribute");let g=document.querySelector("button.ggeButton[type='submit']");g&&g.classList.add("cbPrimaryButton"),i.current=g.innerHTML;let p=null===(n=t.detail.definition.pages[0].columns[0].sections.find(e=>"_kimbia.donation"===e.name))||void 0===n?void 0:n.questions.find(e=>"DonationLevel"===e.answerName),N=null==p?void 0:p.defaultAnswerLiteral.string;o.current=!(null==p?void 0:null===(d=p.paymentPlan)||void 0===d?void 0:d.oneTimeOption),document.querySelector('[data-sectionname="_payment"]').classList.add("clearfix");let y=null===(m=null===(v=t.detail.definition.pages[0].columns[0].sections.find(e=>"_kimbia.donation"===e.name))||void 0===v?void 0:v.questions.find(e=>"DonationLevel"===e.answerName))||void 0===m?void 0:m.paymentPlan.ongoingOptions[0].interval;r.current="MONTHLY"===y?"Month":"Period";let w=document.querySelector('label[for="_payment.verification__ggid1"]');w.innerHTML="CVC";let b=document.querySelector('[data-answername="DonationLevel"]'),S=document.createElement("div");S.setAttribute("id","planPortal"),b.parentNode.insertBefore(S,b);let h=(0,c.Ph)("tFirstName"),E=document.querySelector('[data-answername="hidden_TributeeFirstName"] input');h&&E&&(E.value=h);let L=(0,c.Ph)("tLastName"),T=document.querySelector('[data-answername="hidden_TributeeLastName"] input');L&&T&&(T.value=L);let q=(0,c.Ph)("siteLink"),A=document.querySelector('[data-answername="hidden_SiteUrl"] input');q&&A&&(A.value=q);let _=(0,c.Ph)("siteName"),P=document.querySelector('[data-answername="hidden_SiteName"] input');if(_&&P&&(P.value=_),N?l((0,s.Zg)(N)):l(),a.current){let e=document.querySelector('[data-answername="Name of Donor"]'),t=document.querySelector('div[data-answername="Anonymous"] input[type="checkbox"]'),n=document.querySelector('[data-answername="Name of Donor"] input'),i=(0,c.Ph)("firstName"),r=(0,c.Ph)("lastName"),a="".concat(i," ").concat(r);n&&i&&r&&(n.value=a),t&&t.addEventListener("change",t=>{n&&(t.target.checked?(e.style.display="none",n.value="Anonymous",n.setAttribute("disabled","true")):(e.style.display="block",n.value=a,n.removeAttribute("disabled")))})}if(u){let e=document.querySelector('[data-answername="Email Opt-In"]');e&&e.setAttribute("hidden","true")}e(o.current)},m=e=>{let t=(e.detail.total.amount/100).toLocaleString("en-US");l(t)},v=()=>{var e,t,i;let r=document.querySelector('[data-answername="Name of Donor"] input'),a=document.querySelector('[data-answername="Tribute Message"] textarea'),o=document.querySelector('[data-answername="Anonymous"] input[type="checkbox"]');n.current={signature:null!==(e=null==r?void 0:r.value)&&void 0!==e?e:"",message:null!==(t=null==a?void 0:a.value)&&void 0!==t?t:"",anonymousTribute:null!==(i=null==o?void 0:o.checked)&&void 0!==i&&i}},f=e=>{t(e)};return window.addEventListener("widgetRenderEnd",d),window.addEventListener("widgetRecalculate",m),window.addEventListener("widgetSubmit",v),window.addEventListener("widgetComplete",f),()=>{window.removeEventListener("widgetRenderEnd",d),window.removeEventListener("widgetRecalculate",m),window.removeEventListener("widgetSubmit",v),window.removeEventListener("widgetComplete",f)}},[])}function N(e,t,n){var i,r,a;let{id:o,firstName:u,lastName:l,emailAddress:d}=(0,m.SE)(),s=(0,c.Ph)("siteId"),{data:g}=(0,v.Z)(s),p={splitCode:e,campaign:n,siteId:s,userId:o,firstName:u,lastName:l,emailAddress:d,tributeeFirstName:null==g?void 0:null===(i=g.getSite)||void 0===i?void 0:i.firstName,tributeeLastName:null==g?void 0:null===(r=g.getSite)||void 0===r?void 0:r.lastName,siteUrl:s?(0,c.G3)(c.Z6.SITE_HOME_PAGE,s):void 0,siteName:null==g?void 0:null===(a=g.getSite)||void 0===a?void 0:a.title};return t&&(p.tributeMessage=t),(0,c.G3)(c.Z6.GIVE_DONATION,function(e){let t={};return Object.entries(e).forEach(e=>{let[n,i]=e,r=y.get(n);r&&i&&(t[r]=i)}),t.campaign||(t.campaign=e.siteId?f.TRIBUTE:f.NOW),t}(p))}g.propTypes={section:a().object.isRequired,rules:a().object};let y=new Map([["firstName","firstName"],["lastName","lastName"],["splitCode","split"],["emailAddress","email"],["userId","user_id"],["tributeMessage","msg"],["tributeeFirstName","tFirstName"],["tributeeLastName","tLastName"],["siteUrl","siteLink"],["siteName","siteName"],["campaign","campaign"],["siteId","siteId"]]),w={HEADER_DONATE:"1100",HEADER_TRIBUTE:"12000",FOOTER_DONATE:"1019",FOOTER_TRIBUTE:"12003"},b=()=>{let e=(0,c.Ph)("siteId");return e?f.TRIBUTE:f.NOW},S=e=>"".concat(e,"B")},97236:function(e,t,n){function i(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t?"number"==typeof e&&null!==e&&isFinite(e):!(String(e).search(/[^0-9e.-]+/)>-1)&&!isNaN(parseFloat(e))}function r(e){let t=String(e).match(/[\d.]+/);return Array.isArray(t)?Number(t[0]):NaN}function a(e){return"number"!=typeof e?"NaN":e>999999999?"1B+":e>999999?(Math.floor(e/1e5)/10).toString()+"M":e>999?(Math.floor(e/100)/10).toString()+"K":e<1e3?e.toString():void 0}n.d(t,{Zg:function(){return r},eQ:function(){return a},kE:function(){return i}})}}]);