(()=>{let e=document.createElement("style"),n=document.createTextNode("\n  \n    .fade-0 {\n      opacity: 0;\n    }\n            \n    .fade-in {\n      animation: fadeIn 0.5s ease-in-out forwards;\n    }\n\n    @keyframes fadeIn {\n      0% {\n          opacity: 0;\n      }\n  \n      100% {\n          opacity: 1;\n      }\n    }   \n\n    .error-component {\n      position: fixed;\n      height: 50px;\n      width: 100vw;\n      top: -50px;\n      left: 0px;\n      background-color: #000;\n      display: flex;\n      justify-content: center;\n      align-items: center;\n      z-index: 1001;\n  \n      .error-text {\n          color: #FFF;\n          text-align: center;\n      }\n\n  \n      .close {\n          color: #FFF;\n          position: absolute;\n          right: 25px;\n          background-color: #FFF;\n          border-radius: 20px;\n          width: 25px;\n          height: 25px;\n          display: flex;\n          justify-content: center;\n          align-items: center;\n          cursor: pointer;\n          img {\n              color: #000;\n              height: 12px;\n              width: 12px;\n          }\n      }\n    }\n  \n    @media screen and (max-width: 768px) {\n        .error-component {\n            font-size: 12px;\n        }\n    }\n  \n    .expand-drawer {\n        animation: expand-d .5s forwards;\n    }\n  \n    .collapse-drawer {\n        animation: collapse-d .5s forwards;\n    }\n  \n  @keyframes expand-d {\n      from {\n          top: -50px;\n      }\n  \n      to {\n          top: 0px;\n      }\n  }\n  \n  @keyframes collapse-d {\n      from {\n          top: 0px;\n      }\n  \n      to {\n          top: -50px;\n      }\n  }\n \n  \n  ");e.appendChild(n),document.head.appendChild(e);const t=document.getElementById("essence-voting"),o=new Map,s=t.dataset.laodingDelay||"0";const a=document.body,i=document.createElement("iframe");i.id="essie-frame",i.style.position="relative",i.style.border="none",i.style.width="100dvw",i.style.height="2669px",i.style.overflow="hidden",i.classList.add("fade-0"),i.src="https://essie.essence.com/",i.allow="clipboard-read; clipboard-write",setTimeout((()=>{i.classList.add("fade-in")}),1e3*s);const d=document.createElement("div");d.id="essie-error",d.classList.add("error-component"),d.style.position="fixed",d.style.top="-50px",d.style.left="0",d.style.width="100dvw",d.style.height="50px",d.style.backgroundColor="F000",d.style.color="#FFF",t.appendChild(i),t.appendChild(d);let r=0,c=0;window.addEventListener("message",(async e=>{if("essence-voting"===e.data.from){if("essie-error"===e.data.action&&(d.innerHTML=e.data.data,d.classList.add("expand-drawer"),d.classList.remove("collapse-drawer"),setTimeout((()=>{d.classList.remove("expand-drawer"),d.classList.add("collapse-drawer")}),5e3)),"essie-height"===e.data.action&&(i.style.height=e.data.data+"px",r=e.data.data),"hide-overflow"===e.data.action&&(document.querySelectorAll("*").forEach((e=>{const n=window.getComputedStyle(e).position;"fixed"!==n&&"absolute"!==n||(o.set(e,{display:e.style.display,pointerEvents:e.style.pointerEvents,opacity:e.style.opacity,outline:e.style.outline}),e.style.display="none")})),c=window.scrollY,i.style.height=window.innerHeight+"px",i.scrollIntoView({block:"center"}),a.style="overflow: hidden;"),"restore-overflow"===e.data.action&&(o.forEach(((e,n)=>{n.style.display=e.display||"",n.style.pointerEvents=e.pointerEvents||"",n.style.opacity=e.opacity||"",n.style.outline=e.outline||""})),o.clear(),window.scrollTo(0,c),i.style.height=r+"px",a.style="overflow: auto;"),"open-id-modal"===e.data.action){const e=document.getElementById("one-id-frame");if(!e)return;e.contentWindow.postMessage({to:"essence-id",from:"property",action:"open-sign-in-modal"},e.src)}if("get-user"===e.data.action){const e=document.getElementById("one-id-frame");if(!e)return;e.contentWindow.postMessage({to:"essence-id",from:"property",action:"get-user"},e.src)}if("get-status"===e.data.action){const e=document.getElementById("one-id-frame");if(!e)return;e.contentWindow.postMessage({to:"essence-id",from:"property",action:"get-status"},e.src)}"get-location-href"===e.data.action&&i.contentWindow.postMessage({to:"essence-voting",from:"property",action:"send-location-href",data:window.location.href},i.src)}"essence-id"===e?.data?.from&&("user-data"===e?.data?.action&&i.contentWindow.postMessage({to:"essence-voting",from:"essence-id",data:e.data.data,action:"user-data"},i.src),"user-status"===e?.data?.action&&i.contentWindow.postMessage({to:"essence-voting",from:"essence-id",data:e.data.data,action:"user-status"},i.src),"sign-out"===e?.data?.action&&i.contentWindow.postMessage({to:"essence-voting",from:"essence-id",action:"sign-out"},i.src),"sign-in"===e?.data?.action&&i.contentWindow.postMessage({to:"essence-voting",from:"essence-id",action:"sign-in"},i.src))}),!1)})();