"use strict";function wp_has_service_consent(e){var n=consent_api_get_cookie(consent_api.cookie_prefix+"_consented_services");let t;try{t=JSON.parse(n)}catch(e){t={}}return t.hasOwnProperty(e)?t[e]:wp_has_consent(wp_get_service_category(e))}function wp_is_service_denied(e){var n=consent_api_get_cookie(consent_api.cookie_prefix+"_consented_services");let t;try{t=JSON.parse(n)}catch(e){t={}}return!!t.hasOwnProperty(e)&&!t[e]}function wp_set_service_consent(e,n){var t=consent_api_get_cookie(consent_api.cookie_prefix+"_consented_services");let o;try{o=JSON.parse(t)}catch(e){o={}}o[e]=n,consent_api_set_cookie(consent_api.cookie_prefix+"_consented_services",JSON.stringify(o));t={},t.service=e,t.value=n,e=new CustomEvent("wp_consent_api_status_change_service",{detail:t});document.dispatchEvent(e)}function wp_has_consent(e){let n=!1,t;t=void 0!==window.wp_consent_type?window.wp_consent_type:window.wp_fallback_consent_type;e=consent_api_get_cookie(consent_api.cookie_prefix+"_"+e);return n=!t||-1!==t.indexOf("optout")&&""===e||"allow"===e}function wp_get_service_category(n){if(consent_api.services&&Array.isArray(consent_api.services)){var t=consent_api.services;for(let e=0;e<t.length;e++)if(t[e]&&t[e].name===n&&t[e].category)return t[e].category}return"marketing"}function consent_api_set_cookie(e,n){let t=";secure";var o=consent_api.cookie_expiration,i=new Date,o=(i.setTime(i.getTime()+24*o*60*60*1e3),";expires="+i.toGMTString());"https:"!==window.location.protocol&&(t=""),document.cookie=e+"="+n+t+o+";path=/"}function consent_api_get_cookie(e){e+="=";for(var n=window.document.cookie.split(";"),t=0;t<n.length;t++){var o=n[t].trim();if(0===o.indexOf(e))return o.substring(e.length,o.length)}return""}function wp_set_consent(e,n){let t;if("allow"===n||"deny"===n){var o=consent_api_get_cookie(consent_api.cookie_prefix+"_"+e);if(consent_api_set_cookie(consent_api.cookie_prefix+"_"+e,n),o!==n){o=[];o[e]=n;try{t=new CustomEvent("wp_listen_for_consent_change",{detail:o})}catch(e){(t=document.createEvent("Event")).initEvent("wp_listen_for_consent_change",!0,!0),t.detail=o}document.dispatchEvent(t)}}}window.wp_fallback_consent_type=consent_api.consent_type,window.waitfor_consent_hook=consent_api.waitfor_consent_hook;