PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.14.0
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.14.0
2.14.0 2.13.0 2.13.1 2.12.0 2.11.1 2.11.0 2.10.0 2.9.0 2.7.4 2.7.5 2.7.6 2.7.7 2.8.0 2.8.1 2.9.1 trunk 1.0 1.0-beta1 1.0-beta2 1.0-beta3 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 All 81 releases
← All changes | assets/build/cookie-consent.js +10 -1 2.13.0 → 2.14.0 View file →
@@ -1 +1,10 @@
1 -(()=>{"use strict";const e=window.ABlocksConsentConfig||{},t="ablocks/consent/change",s=e=>{const t=document.cookie.split(";").map(e=>e.trim()).find(t=>0===t.indexOf(e+"="));return t?t.slice(e.length+1):null},o=(e,t,s)=>{const o=null===s?"":"; expires="+new Date(Date.now()+24*s*60*60*1e3).toUTCString();document.cookie=e+"="+encodeURIComponent(t)+o+"; path=/; SameSite=Lax"+("https:"===window.location.protocol?"; Secure":"")},n=()=>e.cookie+"_dismissed",i=()=>"1"===s(n()),a=e=>{const t=e?s(e):null;if(!t)return null;try{return JSON.parse(decodeURIComponent(t))}catch(e){return null}},r=()=>{const t=a(e.cookie)||(e.cookiePrev?(()=>{const t=a(e.cookiePrev);return t?(o(e.cookie,JSON.stringify(t),e.days),o(e.cookiePrev,"",-1),t):null})():null);return t&&Number(t.v)===Number(e.version)&&Array.isArray(t.c)?e.reconsentDays>0&&t.t&&(Date.now()/1e3-t.t)/86400>e.reconsentDays?null:t:null},c=()=>(e.categories||[]).filter(e=>e.locked).map(e=>e.slug),d=()=>(e.categories||[]).filter(e=>!e.locked).map(e=>e.slug),l=e=>{const t=e.getAttribute("data-ablocks-embed-html");if(!t||!e.parentNode)return;const s=document.createElement("template");s.innerHTML=t,e.parentNode.replaceChild(s.content,e)},h=s=>{(e=>{const t=t=>e.indexOf(t.getAttribute("data-ablocks-consent"))>-1;Array.from(document.querySelectorAll('script[type="text/plain"][data-ablocks-consent]')).forEach(e=>{t(e)&&(e=>{const t=document.createElement("script");Array.from(e.attributes).forEach(e=>{"type"!==e.name&&"data-ablocks-consent"!==e.name&&"data-ablocks-type"!==e.name&&t.setAttribute(e.name,e.value)});const s=e.getAttribute("data-ablocks-type");s&&"text/plain"!==s&&(t.type=s),t.src?t.async=!1:t.text=e.textContent,e.parentNode.insertBefore(t,e),e.parentNode.removeChild(e)})(e)}),Array.from(document.querySelectorAll("[data-ablocks-consent][data-ablocks-src]")).forEach(e=>{t(e)&&(e=>{const t=e.getAttribute("data-ablocks-src");e.removeAttribute("data-ablocks-src"),e.removeAttribute("data-ablocks-consent"),t&&e.setAttribute("src",t)})(e)}),Array.from(document.querySelectorAll(".ablocks-consent-embed[data-ablocks-consent]")).forEach(e=>{t(e)&&l(e)})})(s),(t=>{if(!e.consentMode||"function"!=typeof window.gtag)return;const s=e.signals||{},o={};Object.keys(s).forEach(e=>{const n=t.indexOf(e)>-1?"granted":"denied";s[e].forEach(e=>{o[e]=n})});const n=JSON.stringify(o);Object.keys(o).length&&n!==JSON.stringify(window.ABlocksConsentSignals||null)&&(window.gtag("consent","update",o),e.consentModeAds&&o.ad_storage&&window.gtag("set","ads_data_redaction","granted"!==o.ad_storage),window.ABlocksConsentSignals=o),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"ablocks_consent_update",ablocksConsent:t.join(",")})})(s);const o=document.documentElement;(e.categories||[]).forEach(e=>{o.classList.toggle("ablocks-consent-"+e.slug,s.indexOf(e.slug)>-1)}),o.classList.add("ablocks-consent-decided"),document.dispatchEvent(new CustomEvent(t,{detail:{granted:s}}))};class u{constructor(e){this.root=e,this.panel=e.querySelector(".ablocks-consent__panel"),this.main=e.querySelector(".ablocks-consent__main"),this.prefsModal=document.getElementById("ablocks-consent-prefs"),this.prefs=(this.prefsModal||e).querySelector(".ablocks-consent__prefs"),this.reopenButton=document.querySelector(".ablocks-consent-reopen"),this.standalone=!1,this.lastFocus=null,this.onModalKeydown=this.onModalKeydown.bind(this),this.bind()}bind(){document.addEventListener("click",e=>{const t=e.target.closest("[data-ablocks-consent-action]");t&&(e.preventDefault(),this.act(t.getAttribute("data-ablocks-consent-action"),t))}),document.addEventListener("keydown",t=>{"Escape"===t.key&&(this.prefsOpen()?this.closePrefs():e.canClose&&!this.root.hidden&&this.dismiss())})}onModalKeydown(e){if("Tab"!==e.key||!this.prefsModal||this.prefsModal.hidden)return;const t=Array.from(this.prefsModal.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select, textarea, [tabindex]:not([tabindex="-1"])')).filter(e=>null!==e.offsetParent);if(!t.length)return;const s=t[0],o=t[t.length-1],n=this.prefsModal.ownerDocument.activeElement;e.shiftKey&&n===s?(e.preventDefault(),o.focus()):e.shiftKey||n!==o||(e.preventDefault(),s.focus())}act(e,t){if("accept"===e)this.decide(d(),"accept_all");else if("reject"===e)this.decide([],"reject_all");else if("save"===e)this.decide(this.checkedCategories(),"save");else if("settings"===e)this.showPrefs();else if("close-banner"===e)this.dismiss();else if("close-prefs"===e)this.closePrefs();else if("toggle-category"===e)this.toggleCategory(t);else if("open"===e)this.open();else if("load-embed"===e){const e=t.closest(".ablocks-consent-embed");e&&l(e)}else"allow-embeds"===e&&this.allowCategory(t)}allowCategory(e){const t=e.closest(".ablocks-consent-embed");if(!t)return;const s=t.getAttribute("data-ablocks-consent"),o=r(),n=(o&&o.c?o.c:[]).slice();-1===n.indexOf(s)&&n.push(s),this.decide(n,"embed_allow")}toggleCategory(e){const t=document.getElementById(e.getAttribute("aria-controls"));if(!t)return;const s="true"===e.getAttribute("aria-expanded");e.setAttribute("aria-expanded",s?"false":"true"),t.hidden=s;const o=e.closest(".ablocks-consent__cat");o&&o.classList.toggle("is-open",!s)}checkedCategories(){return Array.from(this.prefs.querySelectorAll("[data-ablocks-consent-category]")).filter(e=>e.checked).map(e=>e.getAttribute("data-ablocks-consent-category"))}syncToggles(e){Array.from(this.prefs.querySelectorAll("[data-ablocks-consent-category]")).forEach(t=>{t.checked=e.indexOf(t.getAttribute("data-ablocks-consent-category"))>-1})}decide(t,s){const a=r(),l=a&&a.id?a.id:(()=>{const e=new Uint8Array(16);if(window.crypto&&window.crypto.getRandomValues)window.crypto.getRandomValues(e);else for(let t=0;t<e.length;t++)e[t]=Math.floor(256*Math.random());return Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("")})(),u=c().concat(t.filter(e=>d().indexOf(e)>-1));o(e.cookie,JSON.stringify({id:l,v:Number(e.version),c:u,t:Math.floor(Date.now()/1e3)}),e.days),i()&&o(n(),"",-1),h(u),((t,s,o)=>{if(!e.record||!e.endpoint)return;const n=JSON.stringify({consent_id:t,categories:s,decision:o,page_url:window.location.pathname});try{window.fetch(e.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0})}catch(e){}})(l,u,s),this.hide()}prefsOpen(){return this.prefsModal?!this.prefsModal.hidden:!this.prefs.hidden}closePrefs(t=!0){const s=this.standalone;this.standalone=!1,this.prefsModal?(this.prefsModal.classList.remove("is-visible"),window.setTimeout(()=>{this.prefsModal.hidden=!0},220),document.removeEventListener("keydown",this.onModalKeydown),t&&this.lastFocus&&this.lastFocus.focus&&this.lastFocus.focus(),this.lastFocus=null):(this.prefs.hidden=!0,this.main.hidden=!1),this.root.classList.remove("is-prefs-open"),s&&(this.prefsModal||(this.root.classList.remove("is-visible"),window.setTimeout(()=>{this.root.hidden=!0},220)),this.reopenButton&&e.reopen&&(this.reopenButton.hidden=!1))}showPrefs(){const e=r();this.syncToggles(e?e.c:[]),this.prefsModal?(this.lastFocus=this.prefsModal.ownerDocument.activeElement,this.prefsModal.hidden=!1,window.requestAnimationFrame(()=>{this.prefsModal.classList.add("is-visible")}),document.addEventListener("keydown",this.onModalKeydown)):(this.main.hidden=!0,this.prefs.hidden=!1),this.root.classList.add("is-prefs-open"),this.focusPrefs()}focusPrefs(){const e=this.prefs.querySelector(".ablocks-consent__close")||this.prefs.querySelector("[data-ablocks-consent-category]");e&&e.focus()}show(){this.root.hidden=!1,window.requestAnimationFrame(()=>{this.root.classList.add("is-visible")}),this.reopenButton&&(this.reopenButton.hidden=!0)}hide(){this.standalone=!1,this.prefsModal&&this.closePrefs(!1),this.root.classList.remove("is-visible"),window.setTimeout(()=>{this.root.hidden=!0,this.prefsModal||this.closePrefs(!1)},220),this.reopenButton&&e.reopen&&(this.reopenButton.hidden=!1)}dismiss(){"reject"!==e.closeAction?(o(n(),"1",e.dismissDays>0?e.dismissDays:null),this.hide()):this.decide([],"reject_all")}open(){this.standalone=this.root.hidden,this.prefsModal&&this.standalone?this.reopenButton&&(this.reopenButton.hidden=!0):this.show(),this.showPrefs()}}const f=()=>{const s=document.getElementById("ablocks-consent");if(!s||!e.cookie)return;const o=new u(s),n=r(),a=()=>{e.reopen&&o.reopenButton&&(o.reopenButton.hidden=!1)};n?(h(n.c),a()):("notice"===e.mode&&h(c().concat(d())),i()?a():window.setTimeout(()=>o.show(),e.delay||0)),window.aBlocksConsent={get:()=>{const e=r();return e?e.c:[]},has:e=>{const t=r();return!!t&&t.c.indexOf(e)>-1},open:()=>o.open(),dismiss:()=>o.dismiss(),acceptAll:()=>o.decide(d(),"accept_all"),rejectAll:()=>o.decide([],"reject_all"),withdraw:()=>o.decide([],"withdraw"),onChange:e=>document.addEventListener(t,t=>e(t.detail.granted))}};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",f):f()})();
1 +(()=>{"use strict";const e=window.ABlocksConsentConfig||{},t="ablocks/consent/change",s=e=>{const t=document.cookie.split(";").map(e=>e.trim()).find(t=>0===t.indexOf(e+"="));return t?t.slice(e.length+1):null},o=(e,t,s)=>{const o=null===s?"":"; expires="+new Date(Date.now()+24*s*60*60*1e3).toUTCString();document.cookie=e+"="+encodeURIComponent(t)+o+"; path=/; SameSite=Lax"+("https:"===window.location.protocol?"; Secure":"")},n=()=>e.cookie+"_dismissed",i=()=>"1"===s(n()),a=e=>{const t=e?s(e):null;if(!t)return null;try{return JSON.parse(decodeURIComponent(t))}catch(e){return null}},r=()=>{const t=a(e.cookie)||(e.cookiePrev?(()=>{const t=a(e.cookiePrev);return t?(o(e.cookie,JSON.stringify(t),e.days),o(e.cookiePrev,"",-1),t):null})():null);return t&&Number(t.v)===Number(e.version)&&Array.isArray(t.c)?e.reconsentDays>0&&t.t&&(Date.now()/1e3-t.t)/86400>e.reconsentDays?null:t:null
2 +},c=()=>(e.categories||[]).filter(e=>e.locked).map(e=>e.slug),d=()=>(e.categories||[]).filter(e=>!e.locked).map(e=>e.slug),l=e=>{const t=e.getAttribute("data-ablocks-embed-html");if(!t||!e.parentNode)return;const s=document.createElement("template");s.innerHTML=t,e.parentNode.replaceChild(s.content,e)},h=s=>{(e=>{const t=t=>e.indexOf(t.getAttribute("data-ablocks-consent"))>-1;Array.from(document.querySelectorAll('script[type="text/plain"][data-ablocks-consent]')).forEach(e=>{t(e)&&(e=>{const t=document.createElement("script");Array.from(e.attributes).forEach(e=>{"type"!==e.name&&"data-ablocks-consent"!==e.name&&"data-ablocks-type"!==e.name&&t.setAttribute(e.name,e.value)});const s=e.getAttribute("data-ablocks-type");s&&"text/plain"!==s&&(t.type=s),t.src?t.async=!1:t.text=e.textContent,e.parentNode.insertBefore(t,e),e.parentNode.removeChild(e)})(e)}),Array.from(document.querySelectorAll("[data-ablocks-consent][data-ablocks-src]")).forEach(e=>{t(e)&&(e=>{
3 +const t=e.getAttribute("data-ablocks-src");e.removeAttribute("data-ablocks-src"),e.removeAttribute("data-ablocks-consent"),t&&e.setAttribute("src",t)})(e)}),Array.from(document.querySelectorAll(".ablocks-consent-embed[data-ablocks-consent]")).forEach(e=>{t(e)&&l(e)})})(s),(t=>{if(!e.consentMode||"function"!=typeof window.gtag)return;const s=e.signals||{},o={};Object.keys(s).forEach(e=>{const n=t.indexOf(e)>-1?"granted":"denied";s[e].forEach(e=>{o[e]=n})});const n=JSON.stringify(o);Object.keys(o).length&&n!==JSON.stringify(window.ABlocksConsentSignals||null)&&(window.gtag("consent","update",o),e.consentModeAds&&o.ad_storage&&window.gtag("set","ads_data_redaction","granted"!==o.ad_storage),window.ABlocksConsentSignals=o),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"ablocks_consent_update",ablocksConsent:t.join(",")})})(s);const o=document.documentElement;(e.categories||[]).forEach(e=>{o.classList.toggle("ablocks-consent-"+e.slug,s.indexOf(e.slug)>-1)}),
4 +o.classList.add("ablocks-consent-decided"),document.dispatchEvent(new CustomEvent(t,{detail:{granted:s}}))};class u{constructor(e){this.root=e,this.panel=e.querySelector(".ablocks-consent__panel"),this.main=e.querySelector(".ablocks-consent__main"),this.prefsModal=document.getElementById("ablocks-consent-prefs"),this.prefs=(this.prefsModal||e).querySelector(".ablocks-consent__prefs"),this.reopenButton=document.querySelector(".ablocks-consent-reopen"),this.standalone=!1,this.lastFocus=null,this.onModalKeydown=this.onModalKeydown.bind(this),this.bind()}bind(){document.addEventListener("click",e=>{const t=e.target.closest("[data-ablocks-consent-action]");t&&(e.preventDefault(),this.act(t.getAttribute("data-ablocks-consent-action"),t))}),document.addEventListener("keydown",t=>{"Escape"===t.key&&(this.prefsOpen()?this.closePrefs():e.canClose&&!this.root.hidden&&this.dismiss())})}onModalKeydown(e){if("Tab"!==e.key||!this.prefsModal||this.prefsModal.hidden)return
5 +;const t=Array.from(this.prefsModal.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select, textarea, [tabindex]:not([tabindex="-1"])')).filter(e=>null!==e.offsetParent);if(!t.length)return;const s=t[0],o=t[t.length-1],n=this.prefsModal.ownerDocument.activeElement;e.shiftKey&&n===s?(e.preventDefault(),o.focus()):e.shiftKey||n!==o||(e.preventDefault(),s.focus())}act(e,t){if("accept"===e)this.decide(d(),"accept_all");else if("reject"===e)this.decide([],"reject_all");else if("save"===e)this.decide(this.checkedCategories(),"save");else if("settings"===e)this.showPrefs();else if("close-banner"===e)this.dismiss();else if("close-prefs"===e)this.closePrefs();else if("toggle-category"===e)this.toggleCategory(t);else if("open"===e)this.open();else if("load-embed"===e){const e=t.closest(".ablocks-consent-embed");e&&l(e)}else"allow-embeds"===e&&this.allowCategory(t)}allowCategory(e){const t=e.closest(".ablocks-consent-embed");if(!t)return
6 +;const s=t.getAttribute("data-ablocks-consent"),o=r(),n=(o&&o.c?o.c:[]).slice();-1===n.indexOf(s)&&n.push(s),this.decide(n,"embed_allow")}toggleCategory(e){const t=document.getElementById(e.getAttribute("aria-controls"));if(!t)return;const s="true"===e.getAttribute("aria-expanded");e.setAttribute("aria-expanded",s?"false":"true"),t.hidden=s;const o=e.closest(".ablocks-consent__cat");o&&o.classList.toggle("is-open",!s)}checkedCategories(){return Array.from(this.prefs.querySelectorAll("[data-ablocks-consent-category]")).filter(e=>e.checked).map(e=>e.getAttribute("data-ablocks-consent-category"))}syncToggles(e){Array.from(this.prefs.querySelectorAll("[data-ablocks-consent-category]")).forEach(t=>{t.checked=e.indexOf(t.getAttribute("data-ablocks-consent-category"))>-1})}decide(t,s){const a=r(),l=a&&a.id?a.id:(()=>{const e=new Uint8Array(16);if(window.crypto&&window.crypto.getRandomValues)window.crypto.getRandomValues(e);else for(let t=0;t<e.length;t++)e[t]=Math.floor(256*Math.random())
7 +;return Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("")})(),u=c().concat(t.filter(e=>d().indexOf(e)>-1));o(e.cookie,JSON.stringify({id:l,v:Number(e.version),c:u,t:Math.floor(Date.now()/1e3)}),e.days),i()&&o(n(),"",-1),h(u),((t,s,o)=>{if(!e.record||!e.endpoint)return;const n=JSON.stringify({consent_id:t,categories:s,decision:o,page_url:window.location.pathname});try{window.fetch(e.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0})}catch(e){}})(l,u,s),this.hide()}prefsOpen(){return this.prefsModal?!this.prefsModal.hidden:!this.prefs.hidden}closePrefs(t=!0){const s=this.standalone;this.standalone=!1,this.prefsModal?(this.prefsModal.classList.remove("is-visible"),window.setTimeout(()=>{this.prefsModal.hidden=!0},220),document.removeEventListener("keydown",this.onModalKeydown),t&&this.lastFocus&&this.lastFocus.focus&&this.lastFocus.focus(),this.lastFocus=null):(this.prefs.hidden=!0,this.main.hidden=!1),
8 +this.root.classList.remove("is-prefs-open"),s&&(this.prefsModal||(this.root.classList.remove("is-visible"),window.setTimeout(()=>{this.root.hidden=!0},220)),this.reopenButton&&e.reopen&&(this.reopenButton.hidden=!1))}showPrefs(){const e=r();this.syncToggles(e?e.c:[]),this.prefsModal?(this.lastFocus=this.prefsModal.ownerDocument.activeElement,this.prefsModal.hidden=!1,window.requestAnimationFrame(()=>{this.prefsModal.classList.add("is-visible")}),document.addEventListener("keydown",this.onModalKeydown)):(this.main.hidden=!0,this.prefs.hidden=!1),this.root.classList.add("is-prefs-open"),this.focusPrefs()}focusPrefs(){const e=this.prefs.querySelector(".ablocks-consent__close")||this.prefs.querySelector("[data-ablocks-consent-category]");e&&e.focus()}show(){this.root.hidden=!1,window.requestAnimationFrame(()=>{this.root.classList.add("is-visible")}),this.reopenButton&&(this.reopenButton.hidden=!0)}hide(){this.standalone=!1,this.prefsModal&&this.closePrefs(!1),
9 +this.root.classList.remove("is-visible"),window.setTimeout(()=>{this.root.hidden=!0,this.prefsModal||this.closePrefs(!1)},220),this.reopenButton&&e.reopen&&(this.reopenButton.hidden=!1)}dismiss(){"reject"!==e.closeAction?(o(n(),"1",e.dismissDays>0?e.dismissDays:null),this.hide()):this.decide([],"reject_all")}open(){this.standalone=this.root.hidden,this.prefsModal&&this.standalone?this.reopenButton&&(this.reopenButton.hidden=!0):this.show(),this.showPrefs()}}const f=()=>{const s=document.getElementById("ablocks-consent");if(!s||!e.cookie)return;const o=new u(s),n=r(),a=()=>{e.reopen&&o.reopenButton&&(o.reopenButton.hidden=!1)};n?(h(n.c),a()):("notice"===e.mode&&h(c().concat(d())),i()?a():window.setTimeout(()=>o.show(),e.delay||0)),window.aBlocksConsent={get:()=>{const e=r();return e?e.c:[]},has:e=>{const t=r();return!!t&&t.c.indexOf(e)>-1},open:()=>o.open(),dismiss:()=>o.dismiss(),acceptAll:()=>o.decide(d(),"accept_all"),rejectAll:()=>o.decide([],"reject_all"),
10 +withdraw:()=>o.decide([],"withdraw"),onChange:e=>document.addEventListener(t,t=>e(t.detail.granted))}};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",f):f()})();