function cleanBtnHref(e){return e.href.replace(/https:\/\/www.curseforge.com|\/download.*$/g,"")}function handleLinkButtonsClick(){const e=getAllLinkButtons();e.forEach(e=>{var t=isActionButton(e,/.*download.*curseforge/i),n=isActionButton(e,/.*download.*((?!curseforge).*)/i),o=isActionButton(e,/.*install.*/i);t?handleDownloadCurseForgeButton(e):o?handleInstallButton(e):n&&handleDownloadButton(e)})}function handleDownloadCurseForgeButton(e){let t=window.location.href.replace(/https:\/\/www.curseforge.com|\/download.*$/g,"");var n=e.getAttribute("data-project-id");n&&(t+=`#${n}`),e.onclick=()=>{gtag("event","cf_downloadpage_downloadCF",{send_to:"G-N8BTN266HQ",event_category:"downloads",event_label:t,contentId:t,item_id:t})}}function handleDownloadButton(e){let t=cleanBtnHref(e);var n=e.getAttribute("data-project-id");n&&(t+=`#${n}`),e.onclick=()=>{gtag("event","conversion",{send_to:"AW-807668235/Z_DWCP_qjIkCEIuUkIED"}),gtag("event","cf_project_download",{send_to:"G-N8BTN266HQ",event_category:"downloads",event_label:t,contentId:t,item_id:t})}}function handleInstallButton(e){let t=cleanBtnHref(e);var n=e.getAttribute("data-project-id");n&&(t+=`#${n}`),e.onclick=()=>{gtag("event","conversion",{send_to:"AW-807668235/Z_DWCP_qjIkCEIuUkIED"}),gtag("event","cf_project_install",{send_to:"G-N8BTN266HQ",event_category:"installs",event_label:t,contentId:t,item_id:t})}}function getAllLinkButtons(){return[...document.querySelectorAll("a[href][class*=button]")]}function isActionButton(e,t){return e.querySelector("use")&&e.querySelector("use").getAttribute("xlink:href")&&e.querySelector("use").getAttribute("xlink:href").includes(t)||t.test(e.innerText)}document.addEventListener("DOMContentLoaded",()=>{const a={"new-cf-website-2":{position:"top",html:'<style>.new-cf-website-banner{background-color:#040201;background-image:url(https://content.overwolf.com/curseforge/banner-assets/cf-new-site-left.png),url(https://content.overwolf.com/curseforge/banner-assets/cf-new-site-right.png);background-position:left center,right center;background-size:auto 100%,auto 100%;background-repeat:no-repeat,no-repeat;height:80px;padding-left:0;padding-right:180px;font-weight:700;font-size:33px;line-height:130%;display:flex;color:#fff;font-family:Madera,Lato,sans-serif;justify-content:center;align-items:center;position:relative;overflow:hidden}.new-cf-website-banner p{position:relative;z-index:1;text-align:center;font-size:inherit;flex-shrink:0;margin-right:8px}.new-cf-website-banner a{height:36px;width:10em;background:0 0;border:1px solid;color:#fff;display:flex;justify-content:center;align-items:center;cursor:pointer;text-decoration:none;font-size:16px;font-weight:400;flex-shrink:0;position:relative;z-index:1}.new-cf-website-banner .banner-btn-secondary{margin-right:16px;position:relative;z-index:1}.new-cf-website-banner .banner-btn-secondary:hover{background:rgba(255,255,255,.2)}.new-cf-website-banner .banner-btn-primary{background:#f16436;border:none}.new-cf-website-banner .banner-btn-primary:hover{background-color:#ff784d}.new-cf-website-banner .btn-dismiss{width:32px;height:32px;display:flex;align-items:center;justify-content:center;background:0 0;border:none;cursor:pointer;flex-shrink:0;position:absolute;top:0;bottom:0;right:12px;margin:auto;z-index:1}.new-cf-website-banner .btn-dismiss:hover{background-color:rgba(255,255,255,.1)}@media (max-width:1500px){.shrinking-spacer{display:none}.new-cf-website-banner{background-image:url(https://content.overwolf.com/curseforge/banner-assets/cf-new-site-left.png);background-position:-200px top;height:110px;flex-wrap:wrap;padding:10px;box-sizing:border-box}.new-cf-website-banner p{flex-basis:100%;margin:0;font-size:18px;line-height:120%;padding:0 40px;box-sizing:border-box;margin-bottom:7px}.new-cf-website-banner p strong{display:block;width:300px;margin:auto}.new-cf-website-banner p span{width:255px;display:block;margin:auto}.new-cf-website-banner a{box-sizing:border-box;width:112px;height:32px;font-size:12px}.new-cf-website-banner .btn-dismiss{bottom:auto;right:6px;top:6px;transform:scale(.8)}}@media (max-width:500px){.new-cf-website-banner{background-position:-260px top}}.shrinking-spacer{width:80px;flex-shrink:2;flex-grow:0}.shrinking-spacer~.shrinking-spacer{flex-shrink:6}</style><div class="new-cf-website-banner"><div class="shrinking-spacer" style="width:340px"></div><p><strong>New CurseForge website launching on April 18th!</strong></p><div class="shrinking-spacer" style="width:100px"></div><a href="https://medium.com/overwolf/switch-to-the-new-website-announcement-18-4-4fce04336e2d" target="_blank" class="banner-btn-secondary" rel="noreferer, noopener">Learn more</a><a rel="nofollow" href="https://beta.curseforge.com" target="_blank" class="banner-btn-primary">See it now</a><button class="btn-dismiss"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M1.29924 0L0 1.29924L6.70076 8L0 14.7008L1.29924 16L8 9.29924L14.7008 16L16 14.7008L9.29924 8L16 1.29924L14.7008 0L8 6.70076L1.29924 0Z" fill="white"/></svg></button></div>'},"minecraft-server-list":{position:"results",include:["/minecraft"],html:'<style>.servers-list-banner-container{position:relative;padding-bottom:13.3%;max-width:880px;box-sizing:border-box}.servers-list-banner{position:absolute;top:0;right:0;left:0;bottom:0;background:url(https://content.overwolf.com/curseforge/banner-assets/cf-servers-bg.png);display:flex;background-size:auto 100%;padding:20px;align-items:center;font-family:Madera,Lato,sans-serif;box-sizing:border-box;gap:12px;background-position:left center;padding-left:30%}.servers-list-banner h2{font-size:22px;line-height:120%;color:#fff;margin-right:20px;max-width:600px;font-weight:700}.servers-list-banner .button-cta{height:32px;width:150px;display:flex;margin-left:auto;justify-content:center;align-items:center;background:#f16436;border:none;font-size:14px;color:#fff;margin-right:10px;text-decoration:none;flex-shrink:0}.servers-list-banner .button-cta:hover{background-color:#ff784d}.servers-list-banner .btn-dismiss{width:32px;height:32px;display:flex;align-items:center;justify-content:center;background:0 0;border:none;cursor:pointer;flex-shrink:0;margin-right:12px}.servers-list-banner .btn-dismiss:hover{background-color:rgba(255,255,255,.1)}@media (max-width:1200px){.servers-list-banner h2{font-size:16px}.servers-list-banner .btn-dismiss{display:none}.servers-list-banner .button-cta{text-transform:uppercase;width:117px;font-size:12px;margin-right:0}}@media (max-width:600px){.servers-list-banner h2{font-size:12px}}</style><div style="max-width:880px"><div class="servers-list-banner-container"><div class="servers-list-banner"><h2>The hottest online Minecraft servers are waiting for you!</h2><a href="https://servers.curseforge.com/" target="_blank" class="button-cta">Check it out</a><button class="btn-dismiss"><svg width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M0.974428 0L0 0.974428L5.02557 6L0 11.0256L0.974428 12L6 6.97443L11.0256 12L12 11.0256L6.97443 6L12 0.974428L11.0256 0L6 5.02557L0.974428 0Z" fill="white"/></svg></button></div></div></div>'}};function e(n){var e=a[n];const o=document.createElement("div");switch(o.setAttribute("id",n),o.innerHTML=e.html,e.position){case"top":const r=document.querySelector("body");r.insertBefore(o,r.firstChild);break;case"results":const i=document.querySelector("section > div.px-2.flex-1 > div > div.flex.flex-col.mb-4");if(!i)return;i.nextElementSibling.classList.contains("upsell")&&i.nextElementSibling.remove(),i.parentNode.insertBefore(o,i.nextElementSibling)}const t=o.querySelector(".btn-dismiss");t&&t.addEventListener("click",e=>{var t;o.remove(),t=n,s.push(t),localStorage["dismissed-banners"]=JSON.stringify(s)})}let s=localStorage["dismissed-banners"]?JSON.parse(localStorage["dismissed-banners"]):[];s instanceof Array||(s=[]);for(const t in a)!s.includes(t)&&function(e){const t=a[e];if("www.curseforge.com"===document.location.hostname){const n=document.location.pathname;e=e=>n.startsWith(e);return!!t.exclude&&t.exclude.some(e)?void 0:!(t.include&&!t.include.some(e))}}(t)&&e(t)}),document.addEventListener("DOMContentLoaded",()=>{handleLinkButtonsClick()}),document.addEventListener("DOMContentLoaded",()=>{const s=document.createElement("div");s.className="download-modal",s.innerHTML='<div class="download-modal-backdrop"></div><div class="download-modal-dialog"><button class="close-modal"><svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M4.29289 4.29289C4.68342 3.90237 5.31658 3.90237 5.70711 4.29289L10 8.58579L14.2929 4.29289C14.6834 3.90237 15.3166 3.90237 15.7071 4.29289C16.0976 4.68342 16.0976 5.31658 15.7071 5.70711L11.4142 10L15.7071 14.2929C16.0976 14.6834 16.0976 15.3166 15.7071 15.7071C15.3166 16.0976 14.6834 16.0976 14.2929 15.7071L10 11.4142L5.70711 15.7071C5.31658 16.0976 4.68342 16.0976 4.29289 15.7071C3.90237 15.3166 3.90237 14.6834 4.29289 14.2929L8.58579 10L4.29289 5.70711C3.90237 5.31658 3.90237 4.68342 4.29289 4.29289Z" fill="#999999"/></svg></button><div class="download-modal-inner"></div></div>';const l=s.querySelector(".download-modal-inner"),e=s.querySelector(".download-modal-backdrop");function d(e){s.parentNode||document.body.appendChild(s),l.innerHTML=e,s.classList.add("is-open"),document.body.style.overflow="hidden"}function c(){l.innerHTML="",s.classList.remove("is-open"),document.body.style.overflow=""}e.addEventListener("click",c),s.querySelector(".close-modal").addEventListener("click",c);const p={installInApp:e=>`<div class="modal-content"><h1>Your download should start right away<br>in the CurseForge app...</h1><p class="sub">If it doesn’t,<a class="link-retry" href="${e}">click here</a></p></div><div class="modal-footer"><p>Still don’t have Curse Forge app?<br>Manage your mods and addons with the CurseForge desktop app</p><a class="btn-download-app" href="http://download.curseforge.com" target="_blank" onclick="var label = '${e}'.replace('https://www.curseforge.com', '').replace('/download', '').replace('?client=y', '');
      var projectId = $('[data-project-id]').attr('data-project-id');
      if (projectId) {
        label += '#' + projectId;
      }
      gtag('event', 'cf_modal_button_downloadCF', { 'send_to': 'G-N8BTN266HQ', 'event_category': 'modal_buttons', 'event_label': label, 'contentId': label, 'item_id': label });"><svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.73023 5L5.02326 6.17391C3.55814 6.17391 0 6.17391 0 6.17391C0 6.17391 0.0837209 6.52609 0.125581 6.56522C0.251163 6.76087 0.376744 6.99565 0.544186 7.15217C1.33953 8.01304 2.72093 8.36522 3.85116 8.56087C4.64651 8.71739 5.44186 8.75652 6.23721 8.79565L7.15814 11.1043H7.66046L7.95349 11.8478H7.53488L6.82326 14H13.814L13.1023 11.8478H12.6837L12.9767 11.1043H13.4791C13.4791 11.1043 13.8977 8.71739 15.1953 7.62174C16.4512 6.52609 18 6.36957 18 6.36957V5H4.73023ZM11.7628 10.9087C11.4279 11.1043 11.0512 11.1043 10.8 11.2609C10.6326 11.3391 10.5488 11.5739 10.5488 11.5739C10.3814 11.2217 10.1721 11.1043 9.92093 11.0261C9.66977 10.9478 9.2093 10.987 8.5814 10.4783C8.16279 10.1261 8.12093 9.65652 8.16279 9.42174V9.38261C8.16279 9.34348 8.16279 9.34348 8.16279 9.30435C8.16279 9.26522 8.16279 9.22609 8.20465 9.18696C8.28837 8.95217 8.49767 8.71739 8.91628 8.56087C8.91628 8.56087 8.62326 8.95217 8.91628 9.34348C9.08372 9.57826 9.4186 9.69565 9.71163 9.53913C9.83721 9.46087 9.92093 9.30435 9.96279 9.18696C10.0465 8.91304 10.0465 8.63913 9.79535 8.44348C9.4186 8.13043 9.33488 7.7 9.58605 7.42609C9.58605 7.42609 9.66977 7.77826 10.0465 7.73913C10.2977 7.73913 10.2977 7.66087 10.214 7.58261C10.1721 7.46522 9.62791 6.72174 10.4233 6.17391C10.4233 6.17391 10.9256 5.86087 11.5116 5.9C11.1767 5.93913 10.8 6.13478 10.6744 6.44783C10.6744 6.44783 10.6744 6.44783 10.6744 6.48696C10.5488 6.8 10.6326 7.15217 10.8837 7.46522C11.0512 7.7 11.2605 7.89565 11.3442 8.2087C11.2186 8.16957 11.1349 8.2087 11.0512 8.28696C10.9674 8.36522 10.9256 8.52174 10.9674 8.63913C11.0093 8.71739 11.093 8.79565 11.1767 8.79565C11.2186 8.79565 11.2186 8.79565 11.2605 8.79565H11.3023C11.4279 8.75652 11.5116 8.6 11.4698 8.48261C11.5535 8.56087 11.5953 8.75652 11.5535 8.87391C11.5535 8.9913 11.4698 9.1087 11.4279 9.18696C11.386 9.26522 11.3023 9.34348 11.2605 9.42174C11.2186 9.5 11.1767 9.57826 11.1767 9.65652C11.1767 9.73478 11.1767 9.85217 11.2186 9.93043C11.386 10.1652 11.7209 9.93043 11.8047 9.73478C11.9302 9.5 11.8884 9.22609 11.7209 8.9913C11.7209 8.9913 12.014 9.14783 12.2233 9.69565C12.3907 10.1652 12.0977 10.713 11.7628 10.9087Z" fill="#0D0D0D"/></svg>Download App</a></div>`,promptApp:e=>`<div class="modal-content app-prompt"><h1>Got CurseForge?</h1><p>You need to have the CurseForge app before you can install and launch mods.<br>Do you have CurseForge installed on this computer?</p><div class="actions"><a id="need_cf_modal_button" href="https://download.curseforge.com" target="_blank" onclick="var label = '${e}'.replace('https://www.curseforge.com', '').replace('/download', '').replace('?client=y', '');
      var projectId = $('[data-project-id]').attr('data-project-id');
      if (projectId) {
        label += '#' + projectId;
      }
      gtag('event', 'cf_modal_button_needCF', { 'send_to': 'G-N8BTN266HQ', 'event_category': 'modal_buttons', 'event_label': label, 'contentId': label, 'item_id': label });">No, I need CurseForge</a><a id="open_cf_modal_button" class="link-btn-continue" href="${e}" onclick="var label = '${e}'.replace('https://www.curseforge.com', '').replace('/download', '').replace('?client=y', '');
      var projectId = $('[data-project-id]').attr('data-project-id');
      if (projectId) {
        label += '#' + projectId;
      }
      gtag('event', 'cf_modal_button_openCF', { 'send_to': 'G-N8BTN266HQ', 'event_category': 'modal_buttons', 'event_label': label, 'contentId': label, 'item_id': label });">Yes, open CurseForge app</a></div></div><div class="modal-footer app-prompt"><svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="40" height="40" fill="#0D0D0D"/><path d="M11.8837 14L12.3721 15.9565C9.93023 15.9565 4 15.9565 4 15.9565C4 15.9565 4.13953 16.5435 4.2093 16.6087C4.4186 16.9348 4.62791 17.3261 4.90698 17.587C6.23256 19.0217 8.53488 19.6087 10.4186 19.9348C11.7442 20.1957 13.0698 20.2609 14.3953 20.3261L15.9302 24.1739H16.7674L17.2558 25.413H16.5581L15.3721 29H27.0233L25.8372 25.413H25.1395L25.6279 24.1739H26.4651C26.4651 24.1739 27.1628 20.1957 29.3256 18.3696C31.4186 16.5435 34 16.2826 34 16.2826V14H11.8837ZM23.6047 23.8478C23.0465 24.1739 22.4186 24.1739 22 24.4348C21.7209 24.5652 21.5814 24.9565 21.5814 24.9565C21.3023 24.3696 20.9535 24.1739 20.5349 24.0435C20.1163 23.913 19.3488 23.9783 18.3023 23.1304C17.6047 22.5435 17.5349 21.7609 17.6047 21.3696V21.3043C17.6047 21.2391 17.6047 21.2391 17.6047 21.1739C17.6047 21.1087 17.6047 21.0435 17.6744 20.9783C17.814 20.587 18.1628 20.1957 18.8605 19.9348C18.8605 19.9348 18.3721 20.587 18.8605 21.2391C19.1395 21.6304 19.6977 21.8261 20.186 21.5652C20.3953 21.4348 20.5349 21.1739 20.6047 20.9783C20.7442 20.5217 20.7442 20.0652 20.3256 19.7391C19.6977 19.2174 19.5581 18.5 19.9767 18.0435C19.9767 18.0435 20.1163 18.6304 20.7442 18.5652C21.1628 18.5652 21.1628 18.4348 21.0233 18.3043C20.9535 18.1087 20.0465 16.8696 21.3721 15.9565C21.3721 15.9565 22.2093 15.4348 23.186 15.5C22.6279 15.5652 22 15.8913 21.7907 16.413C21.7907 16.413 21.7907 16.413 21.7907 16.4783C21.5814 17 21.7209 17.587 22.1395 18.1087C22.4186 18.5 22.7674 18.8261 22.907 19.3478C22.6977 19.2826 22.5581 19.3478 22.4186 19.4783C22.2791 19.6087 22.2093 19.8696 22.2791 20.0652C22.3488 20.1957 22.4884 20.3261 22.6279 20.3261C22.6977 20.3261 22.6977 20.3261 22.7674 20.3261H22.8372C23.0465 20.2609 23.186 20 23.1163 19.8043C23.2558 19.9348 23.3256 20.2609 23.2558 20.4565C23.2558 20.6522 23.1163 20.8478 23.0465 20.9783C22.9767 21.1087 22.8372 21.2391 22.7674 21.3696C22.6977 21.5 22.6279 21.6304 22.6279 21.7609C22.6279 21.8913 22.6279 22.087 22.6977 22.2174C22.9767 22.6087 23.5349 22.2174 23.6744 21.8913C23.8837 21.5 23.814 21.0435 23.5349 20.6522C23.5349 20.6522 24.0233 20.913 24.3721 21.8261C24.6512 22.6087 24.1628 23.5217 23.6047 23.8478Z" fill="white"/></svg><p>CurseForge is a desktop app that allows you to download and manage<br>your addons and mods! It’s free to join and easy to use.<a class="underline" href="https://support.curseforge.com/en/support/solutions/articles/9000193488-getting-started" target="_blank">Learn more</a></p></div>`};function u(e){window.location.href=e}function t(e){e.preventDefault(),async function(t){let n=t;if(!n.startsWith("curseforge://"))try{const i=await fetch(n);var o=i.url.substring(i.url.lastIndexOf("?")+1);const a=new URLSearchParams(o);let e=`curseforge://install?addonId=${a.get("addonId")}`;a.has("fileId")&&(e+=`&fileId=${a.get("fileId")}`),n=e}catch(e){console.log(e)}if(localStorage.appPromptShown){let e=n.replace("curseforge://install?","");var r=$("[data-project-id]").attr("data-project-id");r&&(e+=`#${r}`),gtag("event","cf_open_modal_gotCF",{send_to:"G-N8BTN266HQ",event_category:"modalview",event_label:e,contentId:e,item_id:e}),d(p.installInApp(t)),l.querySelector(".link-retry").href=n,s.querySelector(".btn-download-app").addEventListener("click",c),u(n)}else{let e=n.replace("curseforge://install?","");r=$("[data-project-id]").attr("data-project-id");r&&(e+=`#${r}`),gtag("event","cf_open_modal_firsttime",{send_to:"G-N8BTN266HQ",event_category:"modalview",event_label:e,contentId:e,item_id:e}),d(p.promptApp(t)),l.querySelector(".link-btn-continue").addEventListener("click",function(e,t){t.preventDefault(),d(p.installInApp(e)),u(e)}.bind(null,n)),localStorage.appPromptShown=!0}}(this.href)}const n=[...document.querySelectorAll("a.button")],o=n.filter(e=>{return e.querySelector("img")&&e.querySelector("img").getAttribute("src").includes("anvil.svg")||e.textContent.includes("Install")}),r=n.filter(t=>{var e=t.querySelector("use")&&t.querySelector("use").getAttribute("xlink:href")&&t.querySelector("use").getAttribute("xlink:href").includes("Download");return!(-1<["button--early-access","button--early-access-icon-only"].findIndex(e=>t.className.includes(e)))&&(e||t.textContent.includes("Download")&&!t.getAttribute("target"))});o.forEach(function(e){e.dataset.tooltip="Install with CurseForge app",e.addEventListener("click",t)}),r.forEach(function(e){e.dataset.tooltip="Download file"})}),document.addEventListener("DOMContentLoaded",()=>{const i=()=>{var e=(e=>{const t=`; ${document.cookie}`,n=t.split(`; ${e}=`);if(2===n.length)return n.pop().split(";").shift()})("User");let t="curse-user",n="https://static-cdn.jtvnw.net/jtv_user_pictures/xarth/404_user_70x70.png";if(null!==e&&0<e.length){const r=decodeURIComponent(e);for(const i of r.split("&")){var o=i.split("=");"UserName"==o[0]&&(t=o[1]),"AvatarUrl"==o[0]&&(n=o[1])}}return`<div class="relative flex user-menu items-center h-full"><div class="flex items-center"><a class="w-6 h-6" href="/members/${t}"><img class="rounded h-6 w-6" style="max-width: 32px" src="${n}" alt="View ${t}'s Profile" onerror="if (this.src != 'http://www.gravatar.com/avatar/00000000000000000000000000000000?d=mm&amp;f=y') this.src = 'http://www.gravatar.com/avatar/00000000000000000000000000000000?d=mm&amp;f=y';"><i class="u-icon u-icon-online"></i></a></div></div>`};(()=>{if(-1!==document.cookie.indexOf("User=")){var t,n=document.querySelectorAll('.button--overlay[href*="/twitch-"');for(let e=0;e<n.length;++e){const o=n[e],r=o.children[0];-1!==r.innerText.indexOf("Login")?(r.innerText="Dashboard",o.href="https://authors.curseforge.com"):-1!==r.innerText.indexOf("Sign Up")&&(o.style.display="none",t=o.parentElement.parentElement,divElement=document.createElement("div"),divElement.classList.add("ml-2"),divElement.innerHTML=i(),t.appendChild(divElement))}}})()}),document.addEventListener("DOMContentLoaded",()=>{const e=document.querySelector(".header-general-notification");function t(){localStorage["is-header-notification-dismissed"]=!0,e.remove()}e&&(localStorage["is-header-notification-dismissed"]?e.remove():(e.removeAttribute("hidden"),e.querySelector(".header-general-notification-close").addEventListener("click",t)))});const MessageBox=function(){let t=document.createElement("div");t.className="msgbox-container",t.innerHTML='<div class="msgbox-backdrop"></div><div class="msgbox"><button class="msgbox-close-button"></button><h2>@@title</h2><section class="msgbox-text">@@text</section><div class="buttons"><button class="msgbox-btn-secondary">@@secondaryText</button><button class="msgbox-btn-primary">@@primaryText</button></div></div>';let n,o=null;function e(){t.classList.remove("is-open"),n&&n()}function r(){o=!0,e()}function i(){o=!1,e()}return t.querySelector(".msgbox-btn-secondary").addEventListener("click",i),t.querySelector(".msgbox-btn-primary").addEventListener("click",r),t.querySelector(".msgbox-backdrop").addEventListener("click",e),t.querySelector(".msgbox-close-button").addEventListener("click",e),{open:function(e){return t.parentNode||document.body.appendChild(t),o=null,e=e,t.querySelector("h2").textContent=e.title||"",t.querySelector(".msgbox-text").innerHTML=e.text||"",t.querySelector(".msgbox-btn-primary").textContent=e.primaryText||"",t.querySelector(".msgbox-btn-secondary").textContent=e.secondaryText||"",t.classList.add("is-open"),new Promise((e,t)=>{n=()=>{e(o)}})}}}();