(function (){
'use strict';
function getCountry(){
const selectors=['#calc_shipping_country', '#shipping_country', '#billing_country'];
for (const selector of selectors){
const element=document.querySelector(selector);
if(element?.value){
return element.value;
}}
return window.wilmsShopBridge?.initial_country||'';
}
function hidePayPalMessagesForSwitzerland (){
const country=getCountry();
const isSwitzerland=String(country).toUpperCase()==='CH';
document.querySelectorAll('.ppcp-messages').forEach(function (element){
element.style.display=isSwitzerland ? 'none':'';
});
}
window.wilmsShopBridge=window.wilmsShopBridge||{};
window.wilmsShopBridge.hidePayPalMessagesForSwitzerland=hidePayPalMessagesForSwitzerland;
document.addEventListener('DOMContentLoaded', hidePayPalMessagesForSwitzerland);
jQuery(document.body).on('updated_checkout updated_wc_div updated_cart_totals country_to_state_changed',
hidePayPalMessagesForSwitzerland
);
document.addEventListener('DOMContentLoaded', function (){
const observer=new MutationObserver(function (){
hidePayPalMessagesForSwitzerland ();
});
observer.observe(document.body, { childList: true, subtree: true });
});
})();