OwlCyberSecurity - MANAGER
Edit File: give-classic-template.js
(()=>{var e={12942:function(e){e.exports=function(){"use strict";var e=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],t=function(e){return String(e).replace(/[&<>"']/g,(function(e){return"&"+n[e]+";"}))},n={"&":"amp","<":"lt",">":"gt",'"':"quot","'":"apos"},o="dangerouslySetInnerHTML",i={className:"class",htmlFor:"for"},r={};return function(n,a){var c=[],s="";a=a||{};for(var l=arguments.length;l-- >2;)c.push(arguments[l]);if("function"==typeof n)return a.children=c.reverse(),n(a);if(n){if(s+="<"+n,a)for(var u in a)!1!==a[u]&&null!=a[u]&&u!==o&&(s+=" "+(i[u]?i[u]:t(u))+'="'+t(a[u])+'"');s+=">"}if(-1===e.indexOf(n)){if(a[o])s+=a[o].__html;else for(;c.length;){var d=c.pop();if(d)if(d.pop)for(var m=d.length;m--;)c.push(d[m]);else s+=!0===r[d]?d:t(d)}s+=n?"</"+n+">":""}return r[s]=!0,s}}()}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={exports:{}};return e[o].call(r.exports,r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=n(12942),t=n.n(e);function o(e,t){t.parentNode.insertBefore(e,t.nextSibling)}function i(e){e?.parentNode.removeChild(e)}function r(e){const t=document.createElement("template");return e.trim(),t.innerHTML=e,t.content.firstChild}function a(e,t="textContent"){const n=document.createElement("canvas").getContext("2d"),{fontWeight:o,fontSize:i,fontFamily:r}=window.getComputedStyle(e);return n.font=`${o} ${i} ${r}`,n.measureText(e[t]).width}const c=document.querySelector('[name="give-fee-recovery-settings"]')?.value,s=("give_fee_recovery_object"in window&&c&&JSON.parse(c),"Give_Recurring_Vars"in window),l="enabled"===window.classicTemplateOptions.payment_information.donation_summary_enabled,u=window?.give_cs_json_obj?.length>20;var d;function m(){classicTemplateOptions.donor_information.headline&&(document.querySelector(".give-personal-info-section legend:first-of-type").textContent=classicTemplateOptions.donor_information.headline)}function p(){classicTemplateOptions.donor_information.description&&o(r(t()("p",{className:"give-personal-info-description"},classicTemplateOptions.donor_information.description)),document.querySelector("#give_checkout_user_info legend:first-of-type"))}function g({symbol:e=window.Give.fn.getGlobalVar("currency_sign"),symbolPosition:n=window.Give.fn.getGlobalVar("currency_pos"),decimalSeparator:o=window.Give.fn.getGlobalVar("decimal_separator")}){document.querySelectorAll(".give-donation-level-btn:not(.give-btn-level-custom)").forEach((i=>{i.innerHTML!==("before"===n?e+i.value:i.value+e)&&function(e){const n=e.parentNode;if(!e.getAttribute("has-tooltip")){const o=r(t()("span",{className:"give-tooltip hint--top hint--bounce","aria-label":n.getAttribute("aria-label")}));e.innerHTML.length<50&&o.classList.add("narrow"),n.replaceChild(o,e),o.appendChild(e),e.setAttribute("has-tooltip","true")}}(i);const a=i.getAttribute("value"),[c,s]=a.split(o),l="before"===n?`${e}${a}`:`${a}${e}`;i.parentNode&&i.parentNode.getAttribute("aria-label")==i.getAttribute("aria-label")&&i.parentNode.setAttribute("aria-label",l),i.setAttribute("aria-label",l);const u=({position:n})=>t()("span",{className:`give-currency-symbol-${n}`},e);i.innerHTML=t()("span",{className:"give-formatted-currency","aria-hidden":!0},"before"===n&&t()(u,{position:"before"}),t()("span",{className:"give-amount-formatted"},t()("span",{className:"give-amount-without-decimals"},c),t()("span",{className:"give-amount-decimal"},s)),"after"===n&&t()(u,{position:"after"}))}))}"give_stripe_vars"in window&&(window.give_stripe_vars.element_font_styles={cssSrc:document.querySelector("#give-google-font-css")?.href},Object.assign(window.give_stripe_vars.element_base_styles,{color:"#828382",fontFamily:window.getComputedStyle(document.body).fontFamily,fontWeight:400})),d=()=>{document.getElementById("give-receipt")||(document.body.classList.add(`give-container-${window.classicTemplateOptions.visual_appearance.container_style}`),o(document.querySelector(".give-personal-info-section"),document.querySelector(".give-donation-amount-section")),document.querySelector(".give-payment-details-section").append(document.querySelector("#give_purchase_form_wrap")),o(document.querySelector(".give-donate-now-button-section"),document.querySelector(".give-payment-details-section")),classicTemplateOptions.donation_amount.description&&document.querySelector(".give-amount-heading").after(r(t()("p",{className:"give-amount-description"},classicTemplateOptions.donation_amount.description))),m(),p(),classicTemplateOptions.payment_information.headline&&(document.querySelector(".give-payment-mode-label").textContent=classicTemplateOptions.payment_information.headline),classicTemplateOptions.payment_information.description&&o(r(`<p class="give-payment-mode-description">${classicTemplateOptions.payment_information.description}</p>`),document.querySelector(".give-payment-mode-label")),function(){if(u){const e=JSON.parse(window.give_cs_json_obj).supported_currency,t=document.querySelector("input[name=give-cs-form-currency]"),n=new MutationObserver((([t])=>{const n=t.target.value,o=e[n];g({symbol:o.symbol,decimalSeparator:o.setting.decimal_separator,precision:o.setting.number_decimals})})),o=e[t.value];g({symbol:o.symbol,decimalSeparator:o.setting.decimal_separator,precision:o.setting.number_decimals}),n.observe(t,{attributeFilter:["value"]})}else g({})}(),function(){if(w())return;f(v());const e=document.querySelector("#give_purchase_form_wrap");e.removeChild(e.querySelector(".give-donation-submit")),document.querySelector(".give-gateway-details").append(...e.children),i(e)}(),l&&function(){const e=document.querySelector(".give-donation-form-summary-section"),t=document.querySelector(".give-payment-details-section");e.closest(".give-donate-now-button-section")?o(e,t):e.closest(".give-personal-info-section")&&t.parentNode.insertBefore(e,t)}(),s&&function(){const e=document.querySelector('[name="give-recurring-period"]');e&&(e.addEventListener("change",(function(e){window.GiveDonationSummary.handleDonorsChoiceRecurringFrequency(e.target,jQuery(".give-form"))})),document.querySelector(".give-recurring-donors-choice-period")?.addEventListener("change",(function(){window.GiveDonationSummary.handleDonorsChoiceRecurringFrequency(e,jQuery(".give-form"))})),document.querySelector('[name="give-price-id"]')?.addEventListener("change",(function(e){window.GiveDonationSummary.handleAdminDefinedRecurringFrequency(e.target,jQuery(".give-form"))})))}(),jQuery.ajaxPrefilter((function(e,t){e.url.includes("?payment-mode=")&&(e.beforeSend=function(){jQuery(".give-donate-now-button-section").block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),i(document.querySelector(".give-gateway-details")),t.beforeSend instanceof Function&&t.beforeSend()},e.success=function(e){t.success(e),i(document.querySelector("#give_purchase_form_wrap"));const n=v();n.innerHTML=e,document.querySelector(".give-personal-info-section").replaceChildren(...n.removeChild(n.querySelector(".give-personal-info-section")).children),m(),p(),document.querySelector(".give-donate-now-button-section").replaceWith(...n.removeChild(n.querySelector("#give_purchase_submit")).children),y(),l&&(document.querySelector(".give-donation-form-summary-section").replaceChildren(...n.removeChild(n.querySelector(".give-donation-form-summary-section")).children),window.GiveDonationSummary.initTotal()),i(document.querySelector(".give-gateway-details")),f(n),s&&function(){const e=jQuery(".give-form"),t=document.querySelector('[name="give-recurring-period"]'),n=document.querySelector('[name="give-price-id"]');t&&window.GiveDonationSummary.handleDonorsChoiceRecurringFrequency(t,e),n&&window.GiveDonationSummary.handleAdminDefinedRecurringFrequency(n,e)}(),jQuery(".give-donate-now-button-section").unblock()})})),u&&(window.Give_Currency_Switcher.adjust_dropdown_width=()=>{const e=document.querySelector(".give-cs-select-currency"),t=document.querySelector(".give-currency-symbol");e.style.setProperty("--currency-text-width",function(e){const{fontSize:t}=window.getComputedStyle(document.documentElement);return Number.parseFloat(e)/Number.parseFloat(t)+"rem"}(a(t))),e.style.width=null},window.Give_Currency_Switcher.adjust_dropdown_width()),s&&function(){const e=document.querySelector(".give-recurring-donors-choice-period");if(e){function t(){e.style.setProperty("--selected-text-width",function(e,t){const{fontSize:n}=window.getComputedStyle(t);return Number.parseFloat(e)/Number.parseFloat(n)+"em"}(a(e,"value"),e))}document.fonts.ready.then(t),e.addEventListener("change",t)}}(),y(),function(){const e=document.querySelector("#give_error_test_mode");e&&(w()?document.querySelector("#give_secure_site_wrapper").before(e):document.querySelector(".give-payment-mode-label").after(e))}(),u&&function(){const e=document.querySelector(".give-currency-switcher-msg-wrap");e.parentNode.after(e)}(),document.querySelectorAll('.give-donation-amount-section input[type="checkbox"]').forEach((e=>e.addEventListener("change",(e=>{e.target.parentNode.classList.toggle("checked-within")})))))},"loading"!==document.readyState?window.setTimeout(d,0):document.addEventListener("DOMContentLoaded",d);const v=()=>r('<div class="give-gateway-details"></div>'),f=e=>jQuery(".give-gateway-option-selected > .give-gateway-option").after(e);function y(){"enabled"===window.classicTemplateOptions.visual_appearance.secure_badge&&document.querySelector(".give-donate-now-button-section").lastChild.after(r(t()("aside",{className:"give-secure-donation-badge-bottom"},t()("svg",{className:"give-form-secure-icon"},t()("use",{href:"#give-icon-lock"})),window.classicTemplateOptions.visual_appearance.secure_badge_text)))}function w(){return 1===document.getElementById("give-gateway-radio-list").children.length}window.GiveClassicTemplate={share:e=>{let t=parent.window.location.toString();return window.Give.fn.getParameterByName("giveDonationAction",t)&&(t=window.Give.fn.removeURLParameter(t,"giveDonationAction"),t=window.Give.fn.removeURLParameter(t,"payment-confirmation"),t=window.Give.fn.removeURLParameter(t,"payment-id")),e.classList.contains("facebook-btn")?window.Give.share.fn.facebook(t):e.classList.contains("twitter-btn")&&window.Give.share.fn.twitter(t,classicTemplateOptions.donation_receipt.twitter_message),!1}}})()})();