(()=>{"use strict";const t=function(t){const e=[];class n extends HTMLElement{connectedCallback(){this.user_data&&(void 0===e[this.user_data]&&(e[this.user_data]={elements:[]}),e[this.user_data].elements.push(this))}get user_data(){return this.getAttribute("data")}}window.customElements.define("pwp-user-data",n);let a=null,i={};async function s(){const{callApi:t}=PersonalizeWP.utils,n=Object.keys(e);if(n&&n.length>0){const e=n.filter(t=>!(t in i));if(e.length>0){const{data:n}=await t("v1/visitor-data",{uid:a.id,data:e});i={...i,...n}}}n.forEach(t=>{e[t].elements.forEach(t=>{const e=t.getAttribute("data");i[e]&&(t.innerText=i[e])})})}function d(t){return!(null===t||!Object.hasOwn(t,"id")||""===t?.id)}return t.init=function(){const{pwpGet:t}=PersonalizeWP.utils;a=t("tracked_user",!0,"pwp"),d(a)&&window.addEventListener("PWP:parsedPlaceholders",()=>{s()})},t.ready=function(){d(a)&&s()},t.readyInit=function(){window.PersonalizeWP&&PersonalizeWP.module("visitor-data",this)},t}({});var e;e=t,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{e.readyInit()},{once:!0}):e.readyInit()})();