");vwo_$('head').append(_vwo_sel);return vwo_$('head')[0] && vwo_$('head')[0].lastChild;})("HEAD")}}, R_940895_48_1_2_0:{ fn:function(log,nonce=''){return (function(x) {
if(!vwo_$.fn.vwoRevertHtml){
return;
};
var ctx=vwo_$(x),el;
/*vwo_debug log("Revert","content",""); vwo_debug*/;
el=vwo_$('[vwo-element-id="1742919897117"]');
el.revertContentOp().remove();})("HEAD")}}, C_940895_63_1_2_0:{ fn:function(log,nonce=''){return (function(x) {var el,ctx=vwo_$(x);
/*vwo_debug log("paste",".actions"); vwo_debug*/!(el=vwo_$(".actions")).parent().find('[vwo-op-1742589780926=""]').length&&el.after('
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?
`),
},
};
options = { ...defaultOptions, ...options };
console.log("Initializing donation interrupter.");
return new Promise((resolve, reject) => {
try {
const dialogElement = document.createElement('dialog');
dialogElement.id = options.id;
dialogElement.classList.add("popup", "donation-interrupter", "NA");
dialogElement.innerHTML = `
${options.popupHTML.headingHTML}
${options.popupHTML.bodyHTML}
`;
document.body.appendChild(dialogElement);
//
//
const api = new Object({
askAmount: options.askAmount,
askFrequency: options.askFrequency,
});
Object.defineProperties(api, {
id: {
value: options.id,
writable: false, enumerable: true, configurable: false,
},
tokenName: {
value: options.tokenName,
writable: false, enumerable: true, configurable: false,
},
Dialog: {
value: dialogElement,
writable: false, enumerable: true, configurable: true,
},
show: {
value: function () {
this.update(),
this.Dialog.showModal(),
vwoCustomEvent(`${this.id}:shown`);
this.storedState.updateTokenProperty("lastShown", getCurrentDate());
this.hooks['onShow'].forEach((callback) => callback.call(this));
}, ...lockedProperty
},
hide: {
value: function () {
this.Dialog.close(),
this.hooks['onHide'].forEach((callback) => callback.call(this));
}, ...lockedProperty
},
update: {
value: function () {
this.Dialog.dispatchEvent(new CustomEvent('update'), { bubbles: false });
}, ...lockedProperty
}
});
Object.defineProperty(api, 'storedState', {
value: {
storageApi: localStorage,
getToken: (function () {
const tokenName = this.tokenName,
storageApi = this.storedState.storageApi;
return JSON.parse(storageApi.getItem(tokenName)) || null;
}).bind(api),
setToken: (function (tokenValue) {
const tokenName = this.tokenName,
storageApi = this.storedState.storageApi;
return storageApi.setItem(tokenName, JSON.stringify(tokenValue));
}).bind(api),
updateTokenProperty: (function (tokenPropertyName, tokenPropertyValue) {
let state = this.storedState.getToken() || {};
state[tokenPropertyName] = tokenPropertyValue;
this.storedState.setToken(state);
return (this.storedState.getToken() || {})[tokenPropertyName] || undefined;
}).bind(api),
}
});
initHooks(api, ['onShow', 'onHide', 'onUpdate', 'onYes', 'onNo']);
function handleDialogUpdate (event) { // update dynamic text in the dialog
Array.from(this.Dialog.querySelectorAll('[data-value]')).forEach(async (el) => {
const attributeValue = el.getAttribute('data-value');
const currentAmount = await window.NA.DonationForm.getAmount(),
currentFrequency = await window.NA.DonationForm.getFrequency();
if (attributeValue.match("askAmount")) {
el.textContent = this.askAmount(currentAmount);
} else if (attributeValue.match("askFrequency")) {
el.textContent = this.askFrequency(currentFrequency);
} else if (attributeValue.match("originalAmount") || attributeValue.match("amount")) {
el.textContent = currentAmount;
} else if (attributeValue.match("originalFrequency") || attributeValue.match("frequency")) {
el.textContent = currentFrequency;
}
});
this.hooks['onUpdate'].forEach((callback) => callback.call(this));
}
api.Dialog.addEventListener('update', handleDialogUpdate.bind(api));
//
const handleYes = (async function () {
vwoCustomEvent(`${this.id}:DonationInterrupter:yes`);
const currentAmount = await window.NA.DonationForm.getAmount(),
currentFrequency = await window.NA.DonationForm.getFrequency();
const catchAsyncError = (error) => { console.error("An error occured:", error); debugger; this.hide(); };
window.NA.DonationForm.setFrequency(this.askFrequency(currentFrequency)).then((frequency) => {
console.log("Updated frequency:", frequency);
window.NA.DonationForm.setAmount(this.askAmount(currentAmount)).then((amount) => {
console.log("Updated amount:", amount);
setTimeout(() => {
console.log("Submitting...");
try {
window.NA.DonationForm.submit();
} catch (error) {
console.error("Error when submitting.");
} finally {
this.hide();
}
}, 100);
}).catch(catchAsyncError);
}).catch(catchAsyncError);
this.storedState.updateTokenProperty("lastConverted", getCurrentDate());
}).bind(api);
const handleNo = (function () {
vwoCustomEvent(`${this.id}:DonationInterrupter:no`);
setTimeout(() => {
console.log("Submitting...");
try {
window.NA.DonationForm.submit();
} catch (error) {
console.error("Error when submitting.");
} finally {
this.hide();
}
}, 100);
this.storedState.updateTokenProperty("lastDismissed", getCurrentDate());
}).bind(api);
const handleCancel = (function () {
this.hide();
this.storedState.updateTokenProperty("lastDismissed", getCurrentDate());
}).bind(api);
async function handleDialogButtonClick (event) {
event.preventDefault();
if (event.target.hasAttribute('data-action')) {
if (event.target.getAttribute('data-action').match("yes")) {
await handleYes.call(this);
this.hooks['onYes'].forEach((callback) => callback.call(this));
}
if (event.target.getAttribute('data-action').match("no")) {
await handleNo.call(this);
this.hooks['onNo'].forEach((callback) => callback.call(this));
}
}
}
Array.from(api.Dialog.querySelectorAll('.popup__footer button')).forEach((button) => button.addEventListener('click', handleDialogButtonClick.bind(api)));
if (api.Dialog.querySelector('.btn-dismiss'))
api.Dialog.querySelector('.btn-dismiss').onclick = handleCancel;
window.NA.DonationForm.DonationInterrupter = api;
async function shouldDonationInterrupterShow () {
return new Promise(async (resolve, reject) => {
const shouldSubmit = true,
shouldNotSubmit = false;
const shouldShow = () => { this.show(), resolve(shouldNotSubmit) },
shouldNotShow = () => resolve(shouldSubmit);
try {
const formIsValid = await window.NA.DonationForm.validate();
if (!formIsValid)
return console.log("One or more donation form fields are invalid; donation interrupter will not be shown."),
shouldNotShow();
const currentFrequency = await window.NA.DonationForm.getFrequency(),
currentAmount = await window.NA.DonationForm.getAmount(),
askFrequency = this.askFrequency(currentFrequency),
askAmount = this.askAmount(currentAmount);
if (!currentFrequency || askFrequency == currentFrequency)
return console.log("Ask frequency returned false or invalid; donation interrupter will not be shown."),
shouldNotShow();
if (askAmount == false || askAmount <= 0)
return console.log("Ask amount returned false or invalid; donation interrupter will not be shown."),
shouldNotShow();
} catch (error) {
return console.error(error),
shouldNotShow();
}
try {
/// Summary: shows when not seen before at all, or if seen and dismissed on a day that is not the current day (e.g. yesterday)
const storedState = this.storedState.getToken();
if (!storedState || !storedState.hasOwnProperty("lastShown")) { // has not been seen before; first time
return console.log("Donation interrupter not seen yet; donation interrupter will be shown."),
shouldShow();
} else { // returning visitors
if (storedState.hasOwnProperty("lastConverted")) { // the user has converted from the popup before
return console.log("Already converted; donation interrupter will not be shown."),
shouldNotShow();
}
else if (storedState.hasOwnProperty("lastDismissed") && storedState['lastDismissed'] !== getCurrentDate()) { // if the popup has been dismissed before but the last time it was dismissed is NOT today
return console.log("Donation interrupter dismissed, but not today; donation interrupter will be shown."),
shouldShow();
}
else {
return console.log("Donation interrupter already seen and/or dismissed today; donation interrupter will not be shown."),
shouldNotShow();
}
}
} catch (error) {
return console.error(error),
shouldNotShow();
}
});
}
window.NA.DonationForm.interceptSubmit(shouldDonationInterrupterShow.bind(api));
resolve(api);
} catch (error) {
console.error(error);
}
});
}
window.NA = window.NA || {};
window.NA.DonationForm = window.NA.DonationForm || {};
window.NA.DonationForm.init = async function init () {
console.log("Initializing donation form API. Waiting for required elements....");
return new Promise((resolve, reject) => {
const asyncWaitForElement=async function(e,r=100,t=1e4){r=Number.isInteger(r)&&r>0&&r<=100?r:parseInt(r);let n="Array";if("NaN"==r)return console.error("Invalid refresh interval:",r);Array.isArray(e)||"string"!=typeof e||(n="string",e=[e]);let l=e=>document.querySelector(e),i=e=>e.every(e=>!!l(e));return new Promise((R,a)=>{let m=(e,r=null)=>(r&&clearInterval(r),R("Array"==n||e.length>1?e.map(e=>l(e)):l(e[0]))),o=n=>{console.error(`${n.name}: ${n.message}`);let l=()=>asyncWaitForElement(e,r=100,t=1e4);return a(n,l)};try{if(i(e))return m(e);let s=setInterval(()=>{if(i(e))return m(e,s)},1e3/r);setTimeout(()=>{try{if(!i(e)){clearInterval(s);let r=Error(`Failed to find matching elements within ${t}ms`);throw r.name="Timed Out",r}}catch(n){return o(n)}},t)}catch(u){return o(u)}})};
asyncWaitForElement([ 'form.webform-client-form', '#webform-component-donation--recurs-monthly', '#webform-component-donation--amount', '#webform-component-donation--recurring-amount', '.form-actions input[type="submit"]' ]).then(([ componentDonationForm, componentFrequency, componentAmountOnetime, componentAmountMonthly, formSubmitButton ]) => {
const api = DonationFormAPI({
root: componentDonationForm,
frequencyRadios: [...componentFrequency.querySelectorAll('.form-type-radio')],
amountRadios: [
[...componentAmountOnetime.querySelectorAll('div > .form-type-radio, div > .webform-component-textfield')],
[...componentAmountMonthly.querySelectorAll('div > .form-type-radio, div > .webform-component-textfield')],
],
submitButton: formSubmitButton,
//
});
window.NA.DonationForm = { ...window.NA.DonationForm, ...api };
resolve(window.NA.DonationForm);
}).catch((error) => reject(error));
});
};
}catch(e) {console.error(e)}
return vwo_$('head')[0] && vwo_$('head')[0].lastChild;})("head")}}, R_940895_39_1_2_0:{ fn:function(log,nonce=''){return (function(x) {
try{
var ctx=vwo_$(x),el;
/*vwo_debug log("Revert","content",""); vwo_debug*/;
el=vwo_$('[vwo-element-id="1740425171461"]');
el.revertContentOp().remove();
} catch(e) {console.error(e)}
try{
var el,ctx=vwo_$(x);
/*vwo_debug log("Revert","addElement","body"); vwo_debug*/(el=vwo_$('[vwo-element-id="1740425171462"]')).remove();
} catch(e) {console.error(e)}
return vwo_$('head')[0] && vwo_$('head')[0].lastChild;})("head")}}, R_940895_64_1_2_0:{ fn:function(log,nonce=''){return (function(x) {
if(!vwo_$.fn.vwoRevertHtml){
return;
};
var el,ctx=vwo_$(x);
/*vwo_debug log("Revert","content","#tfa_134-L > b:nth-of-type(1)"); vwo_debug*/(el=vwo_$("#tfa_134-L > b:nth-of-type(1)")).revertContentOp(),el=vwo_$("#tfa_134-L > b:nth-of-type(1)");})("#tfa_134-L > b:nth-of-type(1)")}}, C_940895_64_1_2_0:{ fn:function(log,nonce=''){return (function(x) {var el,ctx=vwo_$(x);
/*vwo_debug log("content","#tfa_134-L > b:nth-of-type(1)"); vwo_debug*/el=vwo_$("#tfa_134-L > b:nth-of-type(1)"),vwo_$("#tfa_134-L > b:nth-of-type(1)").each((function(){this.__vwoControlOuterHTML=this.__vwoControlOuterHTML||this.outerHTML,vwo_$(this).vwoAttr("class",""),!vwo_$(this).find('[vwo-op-1742933835357-1=""]').length&&vwo_$(this).append('
Your monthly gift supports trusted journalism, music discovery, and community
conversation for all – no matter where you live or how you listen. From the
broadcast to the podcast, on-air and online, gifts from individuals power everything
you find at Minnesota Public Radio.
Would you consider becoming a sustainer by converting your one-time gift to a
monthly gift today?
`),
min: 100, // do not show if original gift is below this amount
max: 500, // do not show if original gift is above this amount
askAmount: (originalAmount) => {
// the input is the original amount
// the output is the ask amount, or false if the input does not map to an ask amount
if (originalAmount > 500.00) // $500+
return false; // don't show
if (originalAmount >= 400.00) // $400-$500
return 50.00;
if (originalAmount >= 300.00) // $300-$399
return 40.00;
if (originalAmount >= 200.00) // $200-$299
return 30.00;
if (originalAmount >= 100.00) // $100-$199
return 15.00;
if (originalAmount < 100.00) // $100-
return 10.00;
return false;
},
};
//
//
//
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
//
//
//
window.NA.DonationForm.init({ makeTabbed: false }).then(async (donationFormApi) => {
//console.log("DonationForm:", donationFormApi);
console.log("Donation Form: %c READY %c", 'background-color: MediumSeaGreen; color: white; font-weight: bold;', 'background-color: unset; color: unset; font-weight: unset;');
console.log(donationFormApi);
const interrupter = await donationFormApi.DonationInterrupter.init({
min: DONATION_INTERRUPTER_OPTIONS.min,
max: DONATION_INTERRUPTER_OPTIONS.max,
askAmount: DONATION_INTERRUPTER_OPTIONS.askAmount,
popupHTML: {
headingHTML: DONATION_INTERRUPTER_OPTIONS.headingSectionHTML,
bodyHTML: DONATION_INTERRUPTER_OPTIONS.bodySectionHTML,
},
});
//console.log("DonationInterrupter", interrupter);
console.log("Donation Interrupter: %c READY %c", 'background-color: MediumSeaGreen; color: white; font-weight: bold;', 'background-color: unset; color: unset; font-weight: unset;');
console.log(interrupter);
//interrupter.show(); // debug: always show popup immediately when page loads
}).catch((error) => { console.log("Donation Interrupter: %c FAILED %c An error occured when initializing the API:", 'background-color: Tomato; color: white; font-weight: bold;', 'background-color: unset; color: Tomato; font-weight: unset;'), console.error(error) });
}catch(e) {console.error(e)}
return vwo_$('head')[0] && vwo_$('head')[0].lastChild;})("head")}}, R_940895_63_1_2_0:{ fn:function(log,nonce=''){return (function(x) {
if(!vwo_$.fn.vwoRevertHtml){
return;
};
var el,ctx=vwo_$(x);
/*vwo_debug log("Revert","remove","#tfa_31-HTML > p:nth-of-type(1)"); vwo_debug*/(el=vwo_$("#tfa_31-HTML > p:nth-of-type(1)")).vwoRevertCss(),(el=vwo_$('[vwo-element-id="1742589780114"]')).remove();})(".hintsBelow")}}},rules:[{"tags":[{"id":"metric","data":{"type":"g","campaigns":[{"g":5,"c":16}]},"metricId":0}],"triggers":["12639747"]},{"tags":[{"id":"metric","data":{"type":"m","campaigns":[{"g":2,"c":63}]},"metricId":959033},{"id":"metric","data":{"type":"m","campaigns":[{"g":2,"c":39}]},"metricId":959033},{"id":"metric","data":{"type":"m","campaigns":[{"g":3,"c":16}]},"metricId":959033},{"id":"metric","data":{"type":"m","campaigns":[{"g":3,"c":54}]},"metricId":959033},{"id":"metric","data":{"type":"m","campaigns":[{"g":2,"c":55}]},"metricId":959033},{"id":"metric","data":{"type":"m","campaigns":[{"g":2,"c":64}]},"metricId":959033},{"id":"metric","data":{"type":"m","campaigns":[{"g":3,"c":48}]},"metricId":959033},{"id":"metric","data":{"type":"m","campaigns":[{"g":5,"c":59}]},"metricId":959033},{"id":"metric","data":{"type":"m","campaigns":[{"g":2,"c":61}]},"metricId":959033},{"id":"metric","data":{"type":"m","campaigns":[{"g":1,"c":62}]},"metricId":959033}],"triggers":["8536415"]},{"tags":[{"data":"campaigns.39","id":"runCampaign","priority":4}],"triggers":["12454053"]},{"tags":[{"id":"metric","data":{"type":"m","campaigns":[{"g":3,"c":63}]},"metricId":959030},{"id":"metric","data":{"type":"m","campaigns":[{"g":1,"c":39}]},"metricId":959030},{"id":"metric","data":{"type":"m","campaigns":[{"g":4,"c":16}]},"metricId":959030},{"id":"metric","data":{"type":"m","campaigns":[{"g":2,"c":54}]},"metricId":959030},{"id":"metric","data":{"type":"m","campaigns":[{"g":3,"c":55}]},"metricId":959030},{"id":"metric","data":{"type":"m","campaigns":[{"g":3,"c":64}]},"metricId":959030},{"id":"metric","data":{"type":"m","campaigns":[{"g":4,"c":48}]},"metricId":959030},{"id":"metric","data":{"type":"m","campaigns":[{"g":4,"c":59}]},"metricId":959030},{"id":"metric","data":{"type":"m","campaigns":[{"g":3,"c":61}]},"metricId":959030},{"id":"metric","data":{"type":"m","campaigns":[{"g":2,"c":62}]},"metricId":959030}],"triggers":["8536412"]},{"tags":[{"data":"campaigns.63","id":"runCampaign","priority":4},{"data":"campaigns.16","id":"runCampaign","priority":4},{"data":"campaigns.54","id":"runCampaign","priority":4},{"data":"campaigns.55","id":"runCampaign","priority":4},{"data":"campaigns.64","id":"runCampaign","priority":4},{"data":"campaigns.48","id":"runCampaign","priority":4},{"data":"campaigns.61","id":"runCampaign","priority":4},{"data":"campaigns.62","id":"runCampaign","priority":4}],"triggers":["10589191"]},{"tags":[{"id":"metric","data":{"type":"g","campaigns":[{"g":7,"c":39}]},"metricId":0}],"triggers":["12454062"]},{"tags":[{"id":"metric","data":{"type":"m","campaigns":[{"g":4,"c":63}]},"metricId":959027},{"id":"metric","data":{"type":"m","campaigns":[{"g":3,"c":39}]},"metricId":959027},{"id":"metric","data":{"type":"m","campaigns":[{"g":1,"c":16}]},"metricId":959027},{"id":"metric","data":{"type":"m","campaigns":[{"g":4,"c":54}]},"metricId":959027},{"id":"metric","data":{"type":"m","campaigns":[{"g":4,"c":55}]},"metricId":959027},{"id":"metric","data":{"type":"m","campaigns":[{"g":4,"c":64}]},"metricId":959027},{"id":"metric","data":{"type":"m","campaigns":[{"g":5,"c":48}]},"metricId":959027},{"id":"metric","data":{"type":"m","campaigns":[{"g":2,"c":59}]},"metricId":959027},{"id":"metric","data":{"type":"m","campaigns":[{"g":4,"c":61}]},"metricId":959027},{"id":"metric","data":{"type":"m","campaigns":[{"g":3,"c":62}]},"metricId":959027}],"triggers":["8536409"]},{"tags":[{"id":"metric","data":{"type":"g","campaigns":[{"g":6,"c":39}]},"metricId":0}],"triggers":["12454059"]},{"tags":[{"id":"metric","data":{"type":"m","campaigns":[{"g":1,"c":63}]},"metricId":951908},{"id":"metric","data":{"type":"m","campaigns":[{"g":6,"c":16}]},"metricId":951908},{"id":"metric","data":{"type":"m","campaigns":[{"g":5,"c":54}]},"metricId":951908},{"id":"metric","data":{"type":"m","campaigns":[{"g":5,"c":55}]},"metricId":951908},{"id":"metric","data":{"type":"m","campaigns":[{"g":1,"c":64}]},"metricId":951908},{"id":"metric","data":{"type":"m","campaigns":[{"g":1,"c":48}]},"metricId":951908},{"id":"metric","data":{"type":"m","campaigns":[{"g":3,"c":59}]},"metricId":951908},{"id":"metric","data":{"type":"m","campaigns":[{"g":1,"c":61}]},"metricId":951908},{"id":"metric","data":{"type":"m","campaigns":[{"g":4,"c":62}]},"metricId":951908}],"triggers":["8639604"]},{"tags":[{"id":"metric","data":{"type":"m","campaigns":[{"g":5,"c":63}]},"metricId":951905},{"id":"metric","data":{"type":"m","campaigns":[{"g":4,"c":39}]},"metricId":951905},{"id":"metric","data":{"type":"m","campaigns":[{"g":2,"c":16}]},"metricId":951905},{"id":"metric","data":{"type":"m","campaigns":[{"g":1,"c":54}]},"metricId":951905},{"id":"metric","data":{"type":"m","campaigns":[{"g":1,"c":55}]},"metricId":951905},{"id":"metric","data":{"type":"m","campaigns":[{"g":5,"c":64}]},"metricId":951905},{"id":"metric","data":{"type":"m","campaigns":[{"g":2,"c":48}]},"metricId":951905},{"id":"metric","data":{"type":"m","campaigns":[{"g":1,"c":59}]},"metricId":951905},{"id":"metric","data":{"type":"m","campaigns":[{"g":5,"c":61}]},"metricId":951905},{"id":"metric","data":{"type":"m","campaigns":[{"g":5,"c":62}]},"metricId":951905}],"triggers":["8459768"]},{"tags":[{"id":"metric","data":{"type":"g","campaigns":[{"g":5,"c":39}]},"metricId":0}],"triggers":["12454056"]},{"tags":[{"data":"campaigns.59","id":"runCampaign","priority":4}],"triggers":["12629112"]},{"tags":[{"id":"prePostMutation","priority":3},{"id":"groupCampaigns","priority":2}],"triggers":["8"]},{"tags":[{"id":"visibilityService","priority":2}],"triggers":["9"]},{"tags":[{"id":"runTestCampaign"}],"triggers":["2"]},{"tags":[{"id":"urlChange"}],"triggers":["75"]},{"tags":[{"id":"checkEnvironment"}],"triggers":["5"]}],pages:{"ec":[{"1625289":{"inc":["o",["url","urlReg","(?i).*"]]}}]},pagesEval:{"ec":[1625289]},stags:{}}})();
;;var commonWrapper=function(argument){if(!argument){argument={valuesGetter:function(){return{}},valuesSetter:function(){},verifyData:function(){return{}}}}const getVisitorUuid=function(){if(window._vwo_acc_id>=1037725){return window.VWO&&window.VWO.get("visitor.id")}else{return window.VWO._&&window.VWO._.cookies&&window.VWO._.cookies.get("_vwo_uuid")}};var pollInterval=100;var timeout=6e4;return function(){var accountIntegrationSettings={};var _interval=null;function waitForAnalyticsVariables(){try{accountIntegrationSettings=argument.valuesGetter();accountIntegrationSettings.visitorUuid=getVisitorUuid()}catch(error){accountIntegrationSettings=undefined}if(accountIntegrationSettings&&argument.verifyData(accountIntegrationSettings)){argument.valuesSetter(accountIntegrationSettings);return 1}return 0}var currentTime=0;_interval=setInterval((function(){currentTime=currentTime||performance.now();var result=waitForAnalyticsVariables();if(result||performance.now()-currentTime>=timeout){clearInterval(_interval)}}),pollInterval)}};
var pushBasedCommonWrapper=function(argument){var firedCamp={};if(!argument){argument={integrationName:"",getExperimentList:function(){},accountSettings:function(){},pushData:function(){}}}return function(){window.VWO=window.VWO||[];const getVisitorUuid=function(){if(window._vwo_acc_id>=1037725){return window.VWO&&window.VWO.get("visitor.id")}else{return window.VWO._&&window.VWO._.cookies&&window.VWO._.cookies.get("_vwo_uuid")}};var sendDebugLogsOld=function(expId,variationId,errorType,user_type,data){try{var errorPayload={f:argument["integrationName"]||"",a:window._vwo_acc_id,url:window.location.href,exp:expId,v:variationId,vwo_uuid:getVisitorUuid(),user_type:user_type};if(errorType=="initIntegrationCallback"){errorPayload["log_type"]="initIntegrationCallback";errorPayload["data"]=JSON.stringify(data||"")}else if(errorType=="timeout"){errorPayload["timeout"]=true}if(window.VWO._.customError){window.VWO._.customError({msg:"integration debug",url:window.location.href,lineno:"",colno:"",source:JSON.stringify(errorPayload)})}}catch(e){window.VWO._.customError&&window.VWO._.customError({msg:"integration debug failed",url:"",lineno:"",colno:"",source:""})}};var sendDebugLogs=function(expId,variationId,errorType,user_type){var eventName="vwo_debugLogs";var eventPayload={};try{eventPayload={intName:argument["integrationName"]||"",varId:variationId,expId:expId,type:errorType,vwo_uuid:getVisitorUuid(),user_type:user_type};if(window.VWO._.event){window.VWO._.event(eventName,eventPayload,{enableLogs:1})}}catch(e){eventPayload={msg:"integration event log failed",url:window.location.href};window.VWO._.event&&window.VWO._.event(eventName,eventPayload)}};const callbackFn=function(data){if(!data)return;var expId=data[1],variationId=data[2],repeated=data[0],singleCall=0,debug=0;var experimentList=argument.getExperimentList();var integrationName=argument["integrationName"]||"vwo";if(typeof argument.accountSettings==="function"){var accountSettings=argument.accountSettings();if(accountSettings){singleCall=accountSettings["singleCall"];debug=accountSettings["debug"]}}if(debug){sendDebugLogs(expId,variationId,"intCallTriggered",repeated)}if(singleCall&&(repeated==="vS"||repeated==="vSS")||firedCamp[expId]){return}window.expList=window.expList||{};var expList=window.expList[integrationName]=window.expList[integrationName]||[];if(expId&&variationId&&["VISUAL_AB","VISUAL","SPLIT_URL"].indexOf(_vwo_exp[expId].type)>-1){if(experimentList.indexOf(+expId)!==-1){firedCamp[expId]=variationId;var visitorUuid=getVisitorUuid();var pollInterval=100;var currentTime=0;var timeout=6e4;var user_type=_vwo_exp[expId].exec?"vwo-retry":"vwo-new";var interval=setInterval((function(){if(expList.indexOf(expId)!==-1){clearInterval(interval);return}currentTime=currentTime||performance.now();var toClearInterval=argument.pushData(expId,variationId,visitorUuid);if(debug&&toClearInterval){sendDebugLogsOld(expId,variationId,"",user_type);sendDebugLogs(expId,variationId,"intDataPushed",user_type)}var isTimeout=performance.now()-currentTime>=timeout;if(isTimeout&&debug){sendDebugLogsOld(expId,variationId,"timeout",user_type);sendDebugLogs(expId,variationId,"intTimeout",user_type)}if(toClearInterval||isTimeout){clearInterval(interval)}if(toClearInterval){window.expList[integrationName].push(expId)}}),pollInterval||100)}}};window.VWO.push(["onVariationApplied",callbackFn]);window.VWO.push(["onVariationShownSent",callbackFn])}};
var surveyDataCommonWrapper=function(argument){if(!argument){argument={getCampaignList:function(){return[]},surveyStatusChange:function(){},answerSubmitted:function(){}}}return function(){window.VWO=window.VWO||[];function getValuesFromAnswers(answers){var values=[];for(var i=0;i