");vwo_$('head').append(_vwo_sel);return vwo_$('head')[0] && vwo_$('head')[0].lastChild;})("HEAD")}}, GL_940895_16_post:{ fn:function(VWO_CURRENT_CAMPAIGN, VWO_CURRENT_VARIATION,nonce = ""){}}, R_940895_61_1_2_9:{ fn:function(log,nonce=''){return (function(x) {
if(!vwo_$.fn.vwoRevertHtml){
return;
};
var el,ctx=vwo_$(x);
/*vwo_debug log("Revert","editElement","#tfa_134-L > b:nth-of-type(1)"); vwo_debug*/(el=vwo_$("#tfa_134-L > b:nth-of-type(1)")).vwoRevertHtml();})("#tfa_134-L > b:nth-of-type(1)")}}, C_940895_61_1_2_5:{ fn:function(log,nonce=''){return (function(x) {var el,ctx=vwo_$(x);
/*vwo_debug log("editElement","#tfa_112-L > b:nth-of-type(1)"); vwo_debug*/(el=vwo_$("#tfa_112-L > b:nth-of-type(1)")).html("6. How likely are you to recommend MPR to a friend or family member?");})("#tfa_112-L > b:nth-of-type(1)")}}, R_940895_61_1_2_5:{ fn:function(log,nonce=''){return (function(x) {
if(!vwo_$.fn.vwoRevertHtml){
return;
};
var el,ctx=vwo_$(x);
/*vwo_debug log("Revert","editElement","#tfa_112-L > b:nth-of-type(1)"); vwo_debug*/(el=vwo_$("#tfa_112-L > b:nth-of-type(1)")).vwoRevertHtml();})("#tfa_112-L > b:nth-of-type(1)")}}, R_940895_48_1_2_2:{ fn:function(log,nonce=''){return (function(x) {
if(!vwo_$.fn.vwoRevertHtml){
return;
};
var el,ctx=vwo_$(x);
/*vwo_debug log("Revert","content","[vwo-element-id='1742482566780']"); vwo_debug*/(el=vwo_$("[vwo-element-id='1742482566780']")).revertContentOp(),el=vwo_$("[vwo-element-id='1742482566780']");})("[vwo-element-id='1742482566780']")}}, C_940895_48_1_2_2:{ fn:function(log,nonce=''){return (function(x) {var el,ctx=vwo_$(x);
/*vwo_debug log("content","[vwo-element-id='1742482566780']"); vwo_debug*/(el=vwo_$("[vwo-element-id='1742482566780']")).replaceWith2("You'll gain real-world insights into how economics impacts your daily life with this easy-to-follow online course. This crash course is based on the acclaimed textbook Economy, Society, and Public Policy by CORE Econ, tailored to help you grasp key concepts without feeling overwhelmed.
Whether you're new to economics or just want to deepen your understanding, this course covers the basics and connects them to today’s pressing issues—from inequality to public policy decisions.
Each week, you'll receive a reading guide that distills core principles, offers actionable takeaways, and explains how they affect the current world. While the full ebook enriches the experience, the guides alone provide a comprehensive understanding of fundamental economic ideas.
You’ll find this course especially useful and unique because…"),el=vwo_$("[vwo-element-id='1742482566780']");})("[vwo-element-id='1742482566780']")}}, R_940895_48_1_2_1:{ fn:function(log,nonce=''){return (function(x) {
if(!vwo_$.fn.vwoRevertHtml){
return;
};
var el,ctx=vwo_$(x);
/*vwo_debug log("Revert","editElement",".stylingblock-content-margin-cell > table:nth-of-type(1) > tbody:nth-of-type(1) > tr:nth-of-type(1) > td:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > h2:nth-of-type(1) > span:nth-of-type(1)"); vwo_debug*/(el=vwo_$(".stylingblock-content-margin-cell > table:nth-of-type(1) > tbody:nth-of-type(1) > tr:nth-of-type(1) > td:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > h2:nth-of-type(1) > span:nth-of-type(1)")).vwoRevertHtml();})(".stylingblock-content-margin-cell > table:nth-of-type(1) > tbody:nth-of-type(1) > tr:nth-of-type(1) > td:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > h2:nth-of-type(1) > span:nth-of-type(1)")}}, C_940895_48_1_2_1:{ fn:function(log,nonce=''){return (function(x) {var el,ctx=vwo_$(x);
/*vwo_debug log("editElement",".stylingblock-content-margin-cell > table:nth-of-type(1) > tbody:nth-of-type(1) > tr:nth-of-type(1) > td:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > h2:nth-of-type(1) > span:nth-of-type(1)"); vwo_debug*/(el=vwo_$(".stylingblock-content-margin-cell > table:nth-of-type(1) > tbody:nth-of-type(1) > tr:nth-of-type(1) > td:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > h2:nth-of-type(1) > span:nth-of-type(1)")).html("Hello! David Brancaccio here. Do you want instant access to the free online course - “Economics 101” - to understand basic economic concepts?");})(".stylingblock-content-margin-cell > table:nth-of-type(1) > tbody:nth-of-type(1) > tr:nth-of-type(1) > td:nth-of-type(1) > div:nth-of-type(1) > div:nth-of-type(1) > h2:nth-of-type(1) > span:nth-of-type(1)")}}, C_940895_59_1_2_0:{ fn:function(log,nonce=''){return (function(x) {var el,ctx=vwo_$(x);
/*vwo_debug log("remove visibility",".field-item > p:nth-of-type(2)"); vwo_debug*/(el=vwo_$(".field-item > p:nth-of-type(2)")).vwoCss({visibility:"hidden !important",display:"none !important"});})(".field-item > p:nth-of-type(2)")}}, C_940895_61_1_2_9:{ fn:function(log,nonce=''){return (function(x) {var el,ctx=vwo_$(x);
/*vwo_debug log("editElement","#tfa_134-L > b:nth-of-type(1)"); vwo_debug*/(el=vwo_$("#tfa_134-L > b:nth-of-type(1)")).html("10. In your own words, why would an MPR listener choose to become a donor?");})("#tfa_134-L > b:nth-of-type(1)")}}, R_940895_61_1_2_8:{ fn:function(log,nonce=''){return (function(x) {
if(!vwo_$.fn.vwoRevertHtml){
return;
};
var el,ctx=vwo_$(x);
/*vwo_debug log("Revert","editElement","#tfa_130-L > b:nth-of-type(1)"); vwo_debug*/(el=vwo_$("#tfa_130-L > b:nth-of-type(1)")).vwoRevertHtml();})("#tfa_130-L > b:nth-of-type(1)")}}, C_940895_61_1_2_8:{ fn:function(log,nonce=''){return (function(x) {var el,ctx=vwo_$(x);
/*vwo_debug log("editElement","#tfa_130-L > b:nth-of-type(1)"); vwo_debug*/(el=vwo_$("#tfa_130-L > b:nth-of-type(1)")).html("9. Do you believe that MPR is an important community resource?");})("#tfa_130-L > b:nth-of-type(1)")}}, R_940895_61_1_2_7:{ fn:function(log,nonce=''){return (function(x) {
if(!vwo_$.fn.vwoRevertHtml){
return;
};
var el,ctx=vwo_$(x);
/*vwo_debug log("Revert","editElement","#tfa_124-L > b:nth-of-type(1)"); vwo_debug*/(el=vwo_$("#tfa_124-L > b:nth-of-type(1)")).vwoRevertHtml();})("#tfa_124-L > b:nth-of-type(1)")}}, C_940895_39_1_2_0:{ fn:function(log,nonce=''){return (function(x) {
try{
var _vwo_sel = vwo_$("`);
!vwo_$("head").find('#1740425171461').length && vwo_$('head').append(_vwo_sel);}catch(e) {console.error(e)}
try{}catch(e) {console.error(e)}
try{const getCurrentDate = (d = new Date()) => d.toISOString().split('T')[0];
function vwoCustomEvent (labelValue) {
window.VWO = window.VWO || [];
VWO.event = VWO.event || function () {VWO.push(["event"].concat([].slice.call(arguments)))};
VWO.event("customEvent", { "label": labelValue.toString() });
}
class RadioButtonComponent {
constructor (element) {
this.radio = element.querySelector('input[type="radio"]');
this.label = element.querySelector('label');
}
get value () {
let value = this.radio.value;
if (Number.isNaN(parseFloat(value)))
return value;
if (parseFloat(value) % 1 == 0)
return parseInt(value);
return parseFloat(value);
}
set value (newValue) {
this.radio.value = newValue;
}
get text () {
return this.label.textContent;
}
set text (newText) {
if (this.label.querySelector('.form-required')) {
const labelTextNode = [...this.label.childNodes].filter(({ nodeType }) => nodeType === Node.TEXT_NODE)[0];
labelTextNode.nodeValue = newText;
} else {
this.label.textContent = newText;
}
}
get checked () {
return this.radio.checked;
}
set checked (bool) {
this.click(),
bool === true && this.radio.checked === true;
}
click () {
this.label.click();
}
select () {
this.click();
}
addEventListener (eventType, callbackFunction) {
switch (eventType) {
case 'click':
this.label.addEventListener(eventType, callbackFunction);
case 'change':
default:
this.radio.addEventListener(eventType, callbackFunction);
}
}
}
class TextFieldComponent {
constructor (element) {
this.input = element.querySelector('input[type="text"]');
this.label = element.querySelector('label');
}
get value () {
return this.input.value;
}
set value (newValue) {
this.input.dispatchEvent(new Event('focus'));
this.input.value = newValue;
this.input.dispatchEvent(new Event('keyup'));
this.input.dispatchEvent(new Event('change'));
this.input.dispatchEvent(new Event('blur'));
}
get text () {
return this.input.placeholder;
}
set text (newText) {
this.input.placeholder = newText;
}
addEventListener (eventType, callbackFunction) {
this.input.addEventListener(eventType, callbackFunction);
}
}
class GiftArrayButton extends RadioButtonComponent {
constructor (element) {
super(element);
}
get amount () {
return this.value;
}
set amount (newAmount) {
if (Number.isNaN(parseInt(newAmount)) || parseInt(newAmount) <= 0)
throw new Error("New amount must be a valid number greater than 0.");
newAmount = parseInt(newAmount);
this.text = '$' + newAmount;
this.value = newAmount;
}
}
class GiftArrayOtherAmount extends TextFieldComponent {
constructor (element) {
super(element);
}
get amount () {
return parseFloat(this.value);
}
set amount (newAmount) {
if (Number.isNaN(parseInt(newAmount)) || parseInt(newAmount) <= 0)
throw new Error("New amount must be a valid number greater than 0.");
newAmount = parseFloat(newAmount);
this.value = newAmount;
this.input.dispatchEvent(new Event('updateSummary'));
}
}
class GiftArray extends Array {
constructor (items) {
if (!Array.isArray(items) && items.length === 0) {
throw new Error("GiftArray: Arugment 1 is not an instance of Array with a length greater than 0:" + items.join(', '));
}
if (items.every((item) => item instanceof GiftArrayButton || item instanceof GiftArrayOtherAmount)) {
if (items.find((item) => item instanceof GiftArrayOtherAmount)) {
let temp = items.find((item) => item instanceof GiftArrayOtherAmount);
items = items.filter((item) => item instanceof GiftArrayButton);
items.push(temp);
}
} else if (items.every((item) => item instanceof HTMLElement)) {
items = items.map((item) => item.matches(".webform-component-textfield") ? new GiftArrayOtherAmount(item) : new GiftArrayButton(item));
} else {
throw new Error("GiftArray: Arugment 1 is not of type HTMLElement, HTMLElement[], or GiftArrayButton|GiftArrayButton[]:" + items.join(', '));
}
super(...items);
this.Buttons = items.filter((item) => item instanceof GiftArrayButton);
this.OtherAmountInput = items.find((item) => item instanceof GiftArrayOtherAmount);
}
get amount () {
const activeButton = this.Buttons.find((item) => item.checked);
if (activeButton.value === "other") {
const otherButton = activeButton;
if (!otherButton) {
throw new Error("GiftArray.amount: Other Button was not defined.");
}
otherButton.click();
return this.OtherAmountInput.value;
} else {
return activeButton.value;
}
}
set amount (newAmount) {
if (Number.isNaN(parseInt(newAmount)) || parseInt(newAmount) <= 0)
throw new Error("New amount must be a valid number greater than 0.");
newAmount = parseFloat(newAmount);
const matchingButton = this.find((item) => item.value === newAmount);
if (matchingButton) {
matchingButton.click();
} else {
const otherButton = this.Buttons.find((item) => item.value === "other");
otherButton.click();
this.OtherAmountInput.amount = newAmount;
}
}
addEventListeners (eventType, callbackFunction, filter = undefined) {
if (filter && typeof filter === 'function') {
const filteredItems = this.filter((item) => filter.call(this, item));
filteredItems.forEach((item) => item.addEventListener(eventType, callbackFunction));
} else if (filter && typeof filter === 'string') {
if (filter.match(/buttons/gmi))
this.Buttons.forEach((item) => item.addEventListener(eventType, callbackFunction));
if (filter.match(/other/gmi))
this.OtherAmountInput.addEventListener(eventType, callbackFunction);
} else {
this.forEach((item) => item.addEventListener(eventType, callbackFunction));
}
}
}
class FrequencyButton extends RadioButtonComponent {
constructor (element) {
super(element);
}
get frequency () {
return this.text.match(/Monthly/gmi) ? "Monthly" : "One-Time";
}
set freqency (newAmount) {
if (Number.isNaN(parseInt(newAmount)) || parseInt(newAmount) <= 0)
throw new Error("New amount must be a valid number greater than 0.");
newAmount = parseInt(newAmount);
this.text = '$' + newAmount;
this.value = newAmount;
}
}
class FrequencyArray extends Array {
constructor (items) {
if (!Array.isArray(items) && items.length === 0) {
throw new Error("FrequencyArray: Arugment 1 is not an instance of Array with a length greater than 0:" + items.join(', '));
}
/*if (items.every((item) => item instanceof GiftArrayButton || item instanceof GiftArrayOtherAmount)) {
if (items.find((item) => item instanceof GiftArrayOtherAmount)) {
let temp = items.find((item) => item instanceof GiftArrayOtherAmount);
items = items.filter((item) => item instanceof GiftArrayButton);
items.push(temp);
}
} else*/ if (items.every((item) => item instanceof HTMLElement)) {
items = items.map((item) => item.matches(".webform-component-textfield") ? new GiftArrayOtherAmount(item) : new GiftArrayButton(item));
} else {
throw new Error("FrequencyArray: Arugment 1 is not of type HTMLElement or HTMLElement[]:" + items.join(', '));
}
super(...items);
this.Buttons = items.filter((item) => item instanceof GiftArrayButton);
}
get frequency () {
const activeButton = this.Buttons.find((item) => item.checked);
if (activeButton.value === "recurs")
return "monthly";
if (activeButton.value === "NO_RECURR")
return "one-time";
return activeButton.value;
}
set frequency (newFrequency) {
const reNewFrequencyValue = new RegExp(newFrequency, 'gmi');
const matchingButton = this.find((item) => item.value.match(reNewFrequencyValue) || item.text.match(reNewFrequencyValue));
matchingButton.click();
}
get recurring () {
return this.frequency === "monthly" ? true : false;
}
set recurring (bool) {
this.frequency = bool === true ? "monthly" : "one-time";
}
addEventListeners (eventType, callbackFunction, filter = undefined) {
if (filter && typeof filter === 'function') {
const filteredItems = this.filter((item) => filter.call(this, item));
filteredItems.forEach((item) => item.addEventListener(eventType, callbackFunction));
} else if (filter && typeof filter === 'string') {
if (filter.match(/buttons/gmi))
this.Buttons.forEach((item) => item.addEventListener(eventType, callbackFunction));
if (filter.match(/other/gmi))
this.OtherAmountInput.addEventListener(eventType, callbackFunction);
} else {
this.forEach((item) => item.addEventListener(eventType, callbackFunction));
}
}
}
//
const lockedProperty = { writable: false, configurable: false, enumerable: true };
function DonationFormAPI (elements, options = {}) {
const defaultOptions = {
min: 1.00,
max: 999999.99,
makeTabbed: false,
fakeSubmit: true,
overrideGiftArrayValues: false,
};
options = { ...defaultOptions, ...options };
//
const { frequencyRadios, submitButton, root } = elements;
const [ amountRadiosOnetime, amountRadiosMonthly ] = elements.amountRadios;
const oneTimeOtherAmountWrapper = amountRadiosOnetime.find((div) => !div.matches('.webform-component-textfield') || div.querySelector('input[type="text"]'));
const oneTimeRadioButtons = amountRadiosOnetime.filter((div) => div !== oneTimeOtherAmountWrapper);
const monthlyOtherAmountWrapper = amountRadiosMonthly.find((div) => !div.matches('.webform-component-textfield') || div.querySelector('input[type="text"]'));
const monthlyRadioButtons = amountRadiosMonthly.filter((div) => div !== monthlyOtherAmountWrapper);
const debug = {
log: (...args) => window.NA.DonationForm.DEBUG_MODE && console.log(...args),
info: (...args) => window.NA.DonationForm.DEBUG_MODE && console.log(...args),
warn: (...args) => window.NA.DonationForm.DEBUG_MODE && console.log(...args),
error: (...args) => window.NA.DonationForm.DEBUG_MODE && console.log(...args),
};
//
const api = new Object();
Object.defineProperty(api, 'root', {
value: root,
writable: false,
configurable: true,
enumerable: true,
});
Object.defineProperties(api, {
'FORM_MINIMUM': {
value: options.min || 0,
...lockedProperty
},
'FORM_MAXIMUM': {
value: options.max || Infinity,
...lockedProperty
},
});
Object.defineProperties(api, {
GiftArrays: {
value: {
"one-time": new GiftArray([ ...oneTimeRadioButtons, oneTimeOtherAmountWrapper ]),
"monthly": new GiftArray([ ...monthlyRadioButtons, monthlyOtherAmountWrapper ]),
},
writable: false,
configurable: true,
enumerable: true,
},
Frequencies: {
value: new FrequencyArray(frequencyRadios),
writable: false,
configurable: true,
enumerable: true,
},
SubmitButton: {
value: submitButton,
writable: false,
configurable: false,
enumerable: true,
}
});
Object.defineProperties(api, {
'getFrequency': {
value: async function () {
if (!this || this === null) throw new Error("validate: Unable to read API context.");
return new Promise((resolve, reject) => {
try {
resolve(this.Frequencies.frequency);
} catch (error) {
reject(error);
}
});
}, ...lockedProperty
},
'setFrequency': {
value: async function (frequency) {
if (!this || this === null) throw new Error("validate: Unable to read API context.");
return new Promise(async (resolve, reject) => {
try {
this.Frequencies.frequency = frequency;
if (await this.getFrequency() === frequency)
resolve(frequency);
} catch (error) {
reject(error);
}
});
}, ...lockedProperty
},
'getAmount': {
value: async function (frequency = undefined) {
if (!this || this === null) throw new Error("validate: Unable to read API context.");
return new Promise(async (resolve, reject) => {
try {
frequency = frequency || await this.getFrequency();
if (frequency && this.GiftArrays.hasOwnProperty(frequency)) {
const activeGiftArray = this.GiftArrays[frequency];
resolve(activeGiftArray.amount);
} else {
throw new Error("getAmount: Invalid frequency: " + frequency);
}
} catch (error) {
reject(error);
}
});
}, ...lockedProperty
},
'setAmount': {
value: async function (amount, frequency = undefined) {
if (!this || this === null) throw new Error("validate: Unable to read API context.");
return new Promise(async (resolve, reject) => {
try {
const currentFrequency = await this.getFrequency();
if (!frequency) {
frequency = currentFrequency;
} else if (frequency !== currentFrequency) {
frequency = await this.setFrequency(frequency);
}
if (frequency && this.GiftArrays.hasOwnProperty(frequency)) {
const activeGiftArray = this.GiftArrays[frequency];
activeGiftArray.amount = amount;
} else {
throw new Error("setAmount: Invalid frequency: " + frequency);
}
if (await this.getAmount() === amount)
resolve(amount);
} catch (error) {
reject(error);
}
});
}, ...lockedProperty
},
'getRecurring': {
value: async function () {
if (!this || this === null) throw new Error("validate: Unable to read API context.");
return new Promise((resolve, reject) => {
try {
resolve(this.Frequencies.recurring);
} catch (error) {
reject(error);
}
});
}, ...lockedProperty
},
'setRecurring': {
value: async function (bool) {
if (!this || this === null) throw new Error("validate: Unable to read API context.");
return new Promise(async (resolve, reject) => {
try {
this.Frequencies.frequency = bool ? true : false;
if (await this.getRecurring() === bool)
resolve(bool);
} catch (error) {
reject(error);
}
});
}, ...lockedProperty
},
freqency: {
get () { return this.getFrequency() },
set (value) { this.setFrequency(value) },
enumerable: true, configurable: true,
},
amount: {
get () { return this.getAmount() },
set (value) { this.setAmount(value) },
enumerable: true, configurable: true,
},
recurring: {
get () { return this.getRecurring() },
set (value) { this.setRecurring(value) },
enumerable: true, configurable: true,
},
});
Object.defineProperties(api, {
'submit': {
value: async function (condition = this.validate||function(){return true}) {
//this.hooks['onBeforeSubmit'].forEach((callback) => callback.call(this));
let result;
const isAsyncFunction = (func) => func.constructor.name === "AsyncFunction";
if (Array.isArray(condition)) {
if (condition.every((c) => typeof c === 'function' && isAsyncFunction(c))) {
result = await Promise.all(condition.map(async (c) => await c.call(this)));
} else if (condition.every((c) => typeof c === 'function')) {
result = condition.every((c) => c.call(this));
} else if (condition.every((c) => c === true || c === false)) {
result = condition.every((c) => c);
}
} else if (typeof condition === 'function' && isAsyncFunction(condition)) {
result = await condition.call(this);
} else if (typeof condition === 'function') {
result = condition.call(this);
} else if (condition === true || condition === false) {
result = condition;
} else {
console.error("Unknown error.");
debugger;
}
//
if (result === true) {
if (window.NA.DonationForm.hasOwnProperty("DEBUG_MODE") && window.NA.DonationForm["DEBUG_MODE"] == true)
return console.log("Submit aborted (debug mode is enabled).");
this.SubmitButton.click(),
this.hooks['onSubmit'].forEach((callback) => callback.call(this));
//this.hooks['onAfterSubmit'].forEach((callback) => callback.call(this));
} else {
return console.log("Submit failed (conditions did not evaluate to true).");
}
}, ...lockedProperty
},
'interceptSubmit': {
value: function (handleInterceptedSubmit = () => { return new Promise((resolve) => resolve(undefined)) }) {
try {
window.NA.DonationForm.SubmitButtonCopy = window.NA.DonationForm.SubmitButtonCopy || createNewSubmitButton(window.NA.DonationForm.SubmitButton, { cloneOriginal: false, hideOriginal: true, observeOriginal: false });
window.NA.DonationForm.SubmitButtonCopy.addEventListener('click', async (event) => {
event.preventDefault(), event.stopPropagation();
const shouldFormSubmit = await handleInterceptedSubmit.call(this, event);
if (shouldFormSubmit) {
console.info("Submit allowed by initial interceptSubmit callback function resulting in a truthy evaluation.");
const formIsValid = await window.NA.DonationForm.validate();
if (!formIsValid) { // if submit allowed but there are known errors in the form
console.warn("Form has known errors. Attempting to submit to show errors then retrying.");
console.log("Submitting...");
window.NA.DonationForm.submit(true); // submit anyway to trigger the error to be shown
window.NA.DonationForm.SubmitButton.style.setProperty("display", "none"), debug.info("SubmitButton hidden."), // hide the original submit button again
window.NA.DonationForm.SubmitButtonCopy.style.setProperty("display", "none"), debug.info("SubmitButtonCopy hidden."); // hide the copy of the submit button again
window.NA.DonationForm.SubmitButtonCopy.style.removeProperty("display"), debug.info("SubmitButtonCopy unhidden."); // show the copy of the submit button
} else {
console.log("Submitting...");
window.NA.DonationForm.submit(true);
}
} else {
console.log("Submit prevented.");
console.info("Next submit will be allowed.");
window.NA.DonationForm.SubmitButton.style.removeProperty("display"), debug.info("SubmitButton unhidden."); // show the original submit button so that if something goes wrong the user can still click the submit button
window.NA.DonationForm.SubmitButtonCopy.style.setProperty("display", "none"), debug.info("SubmitButtonCopy hidden."); // hide the copy of the submit button that intercepts submit attempts so that there aren't two buttons
}
});
console.log("Submit intercept added.\nButton:", window.NA.DonationForm.SubmitButtonCopy);
} catch (error) {
console.error("Failed to add submit intercept:", error);
}
}, ...lockedProperty
},
'validate': {
value: async function (root = undefined) {
if (!this || this === null)
throw new Error("validate: Unable to read API context.");
root = root || this.root;
const flattenArray = (array) => array.reduce((flat, toFlatten) => flat.concat(Array.isArray(toFlatten) ? flattenArray(toFlatten) : toFlatten), []);
try {
const freqency = await this.getFrequency(),
amount = await this.getAmount();
if (!freqency || !amount)
return false;
if (amount < this.FORM_MINIMUM || amount > this.FORM_MAXIMUM)
return console.error("validate:", "Gift amount is invalid:", amount), false;
let requiredFields = Array.from(root.querySelectorAll('label:has(.form-required)'))
.map((label) => document.getElementById(label.htmlFor) || (label.nextElementSibling || label.previousElementSibling))
.filter((_) => !!_) // remove blanks
.filter((field) => {
if (field.name && field.name.includes('[payment_information]'))
return false;
return true;
})
.map((field) => {
if (field.matches("div"))
return [...field.querySelectorAll('input')];
return field;
})
requiredFields = flattenArray(requiredFields);
const valid = requiredFields.every((input) => {
const type = input.tagName.toLowerCase() === 'select' ? 'select' : input.type;
const { name, value, id } = input;
//console.log(type, name, value);
if (name === 'submitted[payment_information][payment_fields][credit][card_number]') {
if (value && value.length === 16)
return true;
return console.error("validate:", name+':', "CC is invalid."), false;
}
if (name === 'submitted[leadership_circle]')
return true;
if (name === 'submitted[donation][other_amount]' || name === 'submitted[donation][recurring_other_amount]')
if (amount)
return true;
switch (type) {
case 'email':
const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
if (!emailRegex.test(value))
return console.error("validate:", name+':', "Email address is invalid.\n", input, value), false;
return true;
case 'tel':
if (!value || value.length < 10)
return console.error("validate:", name+':', "Phone number is invalid.\n", input, value), false;
return true;
case 'select':
case 'radio':
case 'text':
if (!value || value.length === 0)
return console.error("validate:", name+':', "Field is invalid.\n", input, value), false;
return true;
default:
debug.log("default");
return true;
}
/*if (!value || value.length === 0)
return false;*/
});
return valid;
} catch (error) {
console.error(error);
return false;
}
}, ...lockedProperty
},
//'makeTabbed': { value: function(){} },
'DonationInterrupter': {
value: { init: initDonationInterrupter.bind(api) },
enumerable: true,
configurable: true,
writable: true,
}
});
initHooks(api, ['onFrequencyChange', 'onAmountChange', 'onTrySubmit', 'onSubmit']);
api.Frequencies.addEventListeners('change', (event) => {
if (event.target.checked) {
api.hooks['onFrequencyChange'].forEach((callback) => {
callback.call(api, event.target.value);
});
}
});
Object.entries(api.GiftArrays).forEach(([ key, GiftArray ]) => {
GiftArray.addEventListeners('change', (event) => {
if (event.target.checked) {
api.hooks['onAmountChange'].forEach((callback) => {
callback.call(api, event.target.value);
});
}
});
});
api.SubmitButton.addEventListener('click', (event) => {
api.hooks['onTrySubmit'].forEach((callback) => callback.call(api, event));
});
api.root.addEventListener('submit', (event) => {
api.hooks['onSubmit'].forEach((callback) => callback.call(api, event));
});
if (options.makeTabbed)
api.makeTabbed();
/*if (options.fakeSubmit)
window.NA.DonationForm.SubmitButtonCopy = window.NA.DonationForm.SubmitButtonCopy || createNewSubmitButton(window.NA.DonationForm.SubmitButton, { cloneOriginal: false, hideOriginal: true, observeOriginal: false });*/
return api;
}
function createNewSubmitButton (originalSubmitButton = window.NA.DonationForm.SubmitButton, options = {}) {
const defaultOptions = {
cloneOriginal: true,
hideOriginal: true,
observeOriginal: true,
};
options = { ...defaultOptions, ...options };
const newSubmitButton = document.createElement('button');
//newSubmitButton.id = "submit-button-copy";
newSubmitButton.classList.add("btn");
newSubmitButton.textContent = originalSubmitButton.value;
originalSubmitButton.after(newSubmitButton);
options.hideOriginal && originalSubmitButton.style.setProperty("display", "none");
return newSubmitButton;
}
function initHooks (api, hookNames = []) {
const hooks = Object.fromEntries(hookNames.map((hookName) => ([hookName, new Array()])));
Object.defineProperty(api, 'hooks', {
value: hooks,
...lockedProperty
});
}
function initDonationInterrupter (options = {}) {
const getExpId = () => {
let experiments = window._vwo_exp;
experiments = Object.entries(window._vwo_exp);
let id = experiments.find(([id, data]) => {
const name = data.name;
return name.match(/Donation Interrupter/);
})[1]?.id;
return id;
};
const getExpVariation = (id) => {
let experiment = window._vwo_exp[id];
return experiment.combination_chosen || experiment.combination_selected;
};
const defaultOptions = {
id: [ 'VWO', getExpId(), getExpVariation(getExpId()) ].join('-'),
tokenName: ("NA__MPR_DonationInterrupter:" + [ 'VWO', getExpId(), getExpVariation(getExpId()) ].join('-')),
min: 10,
max: 100,
askAmount: (originalAmount) => {
if (originalAmount > 500) // $500+
return false; // don't show
if (originalAmount >= 400) // $400-$500
return 50;
if (originalAmount >= 300) // $300-$399
return 40;
if (originalAmount >= 200) // $200-$299
return 30;
if (originalAmount >= 100) // $100-$199
return 15;
if (originalAmount < 100) // $100-
return 10;
return false;
},
askFrequency: (originalFrequency) => {
return "monthly";
},
popupHTML: {
headingHTML: (`
Lorem ipsum dolor sit amet
`),
bodyHTML: (`
Consectetur adipiscing elit. Sed nec egestas turpis, hendrerit semper nisl. Pellentesque auctor ipsum at
pharetra eleifend. Pellentesque a rhoncus turpis, ut tempus nibh. Donec vel dui hendrerit nisi imperdiet
tincidunt. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.
Duis efficitur dolor ut nisl blandit imperdiet. Nullam pretium est nunc, tincidunt viverra ligula dapibus.
Duis malesuada:
dui eu venenatis volutpat
urna libero posuere lectus
non tincidunt mauris ligula consectetur felis
lacinia hendrerit enim at molestie
Sed placerat fringilla consequat. Nullam eu pellentesque sem?
AI in the election: misinformation machine or meme generator?
Experts have warned that artificial intelligence threatens to supercharge the spread of misinformation in this election year. But so far, The Washington Post’s Will Oremus says, the new tech seems to be giving a bigger boost to meme creation.
Experts have warned that artificial intelligence threatens to supercharge the spread of misinformation in this election year. But so far, The Washington Post’s Will Oremus says, the new tech seems to be giving a bigger boost to meme creation.
Perhaps you’ve heard — maybe even on this show — that generative artificial intelligence has the potential to superchargemis- and disinformation in our elections.
A bad actor could use AI tools to produce a video, for example, of a candidate saying or doing something incriminating that, in real life, they didn’t actually say or do.
But with 68 days until Election Day, we haven’t seen the widespread AI misinformation campaigns that experts warned about. Instead, as Will Oremus pointed out in a recent analysis for The Washington Post, we’ve seen a whole lot of silly AI-generated memes.
He told Marketplace’s Meghan McCarty Carino that the most recent examples have come from one particular presidential candidate.
The following is an edited transcript of their conversation.
Will Oremus: Former President Donald Trump amplified a couple of AI-generated images. One of those images showed a Soviet-style rally where Vice President Kamala Harris is presiding, and there are all these identical people in uniform in the crowd, and hanging over them all is this big, Soviet-style hammer-and-sickle flag. And so, this goes along with the idea that Kamala is a communist, which is a name that Trump has called her in the past. Nobody’s going to think that this is the real Democratic convention. Maybe a few people will, but what it does is it gets across the message in a vivid way. It’s kind of like calling her a name, but instead, it’s done with a picture.
Another AI-generated image that he amplified was of a picture of a bunch of young women with T-shirts that say Swifties for Trump. And this was at a time when there were rumors that Taylor Swift might be a guest at the Democratic convention or that she might come out and endorse Kamala Harris. And Trump was kind of trying to counter this by saying, well, actually I’ve heard a lot of Taylor Swift fans are voting for me and they’re upset with Kamala. And so, to illustrate that idea, he amplified a tweet. He screenshotted a tweet from Elon Musk’s X network that somebody else had made, but it was these AI images seeming to show a lot of Taylor Swift fans who were actually for Donald Trump. But it wasn’t real, it was AI-generated. There was actually one real image of someone, a Taylor Swift fan who is, in fact, a Trump supporter, but the rest were automated by AI.
Meghan McCarty Carino: And how obvious was it that these images were generated by AI?
Oremus: That’s a really tough question. So, for you and me, I think it’s pretty obvious that these are AI-generated, right? I mean, we cover technology, we’ve seen what AI images look like. I don’t want to necessarily assume that the average person knows all the telltale signs of an AI image at this point, but, especially with the Kamala Harris one, they probably wonder, “Wait, is that real? That looks a little funny.”
McCarty Carino: Yeah, it has a kind of an uncanny quality to it.
Oremus: Yeah. I wouldn’t say it’s superphotorealistic. But it’s certainly more realistic than just a drawing or an illustration or a comic. I think it’s playing a similar role, but it also has this potential to deceive people who aren’t really paying close attention.
McCarty Carino: But, as you say, the extent to which these images are likely to trick people, or even are intended to trick people, is not very high.
Oremus: Yeah, we can’t rule out the possibility of a very sophisticated AI fake that tries to make people think something happened that didn’t happen. We just haven’t seen much of that yet, and I think we’re likely to continue to see AI used more to generate memes or to illustrate a message, basically visual propaganda, more than really a hoax or an attempt at deception. Of course, if some people do get tricked into thinking it’s real, maybe the people who are posting it would be fine with that, but it’s really more about another tool in the arsenal of political messaging.
McCarty Carino: Right, it seems like more kind of an incremental increase in sophistication over something like Photoshop or basic memes, rather than a kind of exponential step up in deception.
Oremus: I think that’s exactly right. We can think of this as an evolution of the ability to manipulate images and video and audio. It’s easier than Photoshop, it might look more realistic than Photoshop, it doesn’t require any particular skills, and so it is now democratized — and I don’t mean that in a positive sense — but just in the sense that anybody can do it easily now. And so, there’s this blurring of the line between truth and unreality that I think is problematic. It’s just a bit of a different manifestation of the problem than some experts were expecting and fearing. And I think it leads to different responses. If the concern is a deepfake that’s going to fool everybody, then you might need visual forensics experts to go in and find out what’s true and what’s false, and you need fact checkers to debunk it and spread the word far and wide, to say, “Well, this image looked like this was true, but actually it’s fake and we can prove it.” But if it’s just a meme and there’s sort of a plausible deniability here and you can say, “Well, this was just a joke and everybody knows it’s just a joke,” then debunking doesn’t really help. And, in fact, debunking could make it worse by spreading the meme or the propaganda further than it would have reached otherwise.
McCarty Carino: You note that these particular images might just be jokes, but they do contribute to this phenomenon called the liar’s dividend. Explain that.
Oremus: Yeah, there’s this idea called the liar’s dividend. I don’t know who came up with it, but I first heard it from disinformation researcher Joan Donovan. It’s this idea that the more you can blur the line between truth and fiction, the more that people know that it’s possible to create realistic fakes, the more people who actually do get caught doing something are able to deny it. Because you can say, “That wasn’t me with my hand in the cookie jar. Somebody generated an AI image of me with a hand in the cookie jar.” It just creates a general confusion, and it can make the average person sort of throw their hands up and say, “Well, who knows what’s real and who knows what to believe?”
We’ve actually seen sort of an example of this with Trump fairly recently. So, just a week or so before Trump amplified those fake images, Trump and his campaign accused Harris of faking an image of a large, enthusiastic crowd that was greeting her outside of her airplane. Trump said that it was “A.I.’d,” implying that she had faked it to make it look like she had this big crowd. But in fact, all signs point to the fact that this was a real image. But everybody knows that fakes are everywhere now, and so it sounded plausible that maybe she didn’t really have that crowd and that maybe she was the one lying, even though that wasn’t the case. You want to say that this is an abuse of the technology, but in some ways, this is what the technology is for, right? I mean, the existence of AI generators is inviting us all to create realistic-looking images on demand of things that aren’t actually real, and so it’s just going to be a more confusing world, I think, going forward.
McCarty Carino: Clearly, this flood of AI imagery on the internet has the potential to create this kind of epistemic problem of no one believing anything. But I also wonder, if the proliferation of low-stakes AI fakes could kind of train audiences to be more alert to the deceptive powers of artificial intelligence.
Will Oremus: Yeah, that’s an optimistic take. I like it. New technologies come out, and they catch us by surprise, and they cause problems, and they disrupt things, and then gradually we figure out how to adapt. And it doesn’t mean that the problem gets fully solved necessarily, but I think people will adapt. People will learn that just because you see an image of something that looks real doesn’t mean that it really happened. They’ll learn the same eventually with audio and with video. And so, you’ll have to come up with new ways of figuring out what to trust or maybe fall back on old ways, right? Maybe you go back to sources that have track records of credibility and of telling the truth rather than just trusting what you see in your social media feed.
More on this
One thing Will Oremus noted in our conversation is that while AI-generated images probably aren’t fooling many people in this election, AI-generated voices may be a different story.
By now, voters are kind of used to getting these robotic-sounding automated voice messages from politicians, but during the Democratic Party primary in New Hampshire back in January, voters in the state were subjected to an AI-generated voice spoof of President Joe Biden telling them not to go to the polls.
The hoax was allegedly orchestrated by Steve Kramer, a political consultant who was working for the campaign of Democratic U.S Rep. Dean Phillips, an opponent to Biden in that primary. But he said he orchestrated the call on his own as a stunt to demonstrate how easy it is to do.
Last week, the Federal Communications Commission fined the telecom company that distributed the robocall $1 million for its role in the scam.
Kramer still faces a $6 million fine from the FCC and 26 criminal charges for voter intimidation and impersonating officials.
Every day, the “Marketplace Tech” team demystifies the digital economy with stories that explore more than just Big Tech. We’re committed to covering topics that matter to you and the world around us, diving deep into how technology intersects with climate change, inequity, and disinformation.
As part of a nonprofit newsroom, we’re counting on listeners like you to keep this public service paywall-free and available to all.