var iframeParent_AjN7cG9zvVi7H6RaILxp = document.getElementById( 'miniextensions-iframe-embed-AjN7cG9zvVi7H6RaILxp' ); iframeParent_AjN7cG9zvVi7H6RaILxp.innerHTML = ` `; if (860) { document.getElementById('miniextensions-iframe-embed-AjN7cG9zvVi7H6RaILxp').style.height = '860px'; } var eventMethod_AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz = window.addEventListener ? "addEventListener" : "attachEvent"; var eventer_AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz = window[eventMethod_AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz]; var messageEvent_AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz = eventMethod_AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz == "attachEvent" ? "onmessage" : "message"; function toggleModal_AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz(url, shouldConfirmIfClosing) { var modal_AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz = document.querySelector( '.modal-AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz' ); if (url) { if (modal_AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz) { modal_AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz.remove(); } var elem = document.createElement('div'); elem.className = "modal-AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz show-modal-AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz"; elem.innerHTML = ''; document.body.appendChild(elem); } else { if (modal_AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz) { if (shouldConfirmIfClosing && !window.confirm('Are you sure want to leave? Your unsaved changes will be lost.')) { return; } modal_AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz.remove(); } } } function windowOnClick_AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz(event) { var modal_AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz = document.querySelector( '.modal-AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz' ); if (event.target === modal_AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz) { toggleModal_AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz(null, true); } } window.addEventListener('click', windowOnClick_AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz); function debounce_AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz(func, wait, immediate) { var timeout; return function() { var context = this, args = arguments; var later = function() { timeout = null; if (!immediate) func.apply(context, args); }; var callNow = immediate && !timeout; clearTimeout(timeout); timeout = setTimeout(later, wait); if (callNow) func.apply(context, args); }; }; window.addEventListener('scroll', debounce_AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz(function(e) { const iframe = document.getElementById('miniExtensionsIframe-AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz'); if (false && window && iframe && iframe.contentWindow && iframe.contentWindow.postMessage) { const iframeRect = iframe.getBoundingClientRect() const innerHeight = window.innerHeight; if (innerHeight != null && iframeRect != null && iframeRect.top != null) { iframe.contentWindow.postMessage({ type: 'miniExtensionsOnScrollParent', offsetWithScroll: iframeRect.top * -1, id: 'AjN7cG9zvVi7H6RaILxp', }, '*'); } } }, 250)); eventer_AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz(messageEvent_AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz, function(e) { if (!e.data) return; if (e && e.data && e.data.type && e.data.type === 'miniExtensionsOpenUrl') { if (e.data.iframeMessageId != null && e.data.iframeMessageId !== '71r4UJD4Cz') { return; } if (e.data.mode === 'replace-parent') { window.location.href = e.data.url; } else if (e.data.newTab || e.data.mode === 'new-tab') { window.open(e.data.url); } else if (e.data.mode === 'replace-iframe' || e.data.mode === 'replace-iframe-not-href') { document.getElementById('miniExtensionsIframe-AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz').src = e.data.url; if (true || !(e.data.url.startsWith('https://app.miniextensions.com') || e.data.url.startsWith('http://localhost'))) { document.getElementById('miniExtensionsIframe-AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz').scrolling = 'yes'; } else { document.getElementById('miniExtensionsIframe-AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz').scrolling = 'no'; } } else if (e.data.mode === 'replace-parent-not-href') { window.location.replace(e.data.url); } else { window.open(e.data.url); } } else if (e && e.data && e.data.type && e.data.type === 'miniExtensionsOpenModalEditor') { if (e.data.iframeMessageId != null && e.data.iframeMessageId !== '71r4UJD4Cz') { return; } const finalUrlObject = new URL(e.data.url); finalUrlObject.searchParams.append( 'iframeMessageId', '0oNDLE4WGJ' ); finalUrlObject.searchParams.append( 'iframeToCloseMessageId', '71r4UJD4Cz' ); const finalUrl = finalUrlObject.toString(); toggleModal_AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz(finalUrl, false); } else if (e && e.data && e.data.type && e.data.type === 'miniExtensionsCloseModalEditor') { if (e.data.iframeMessageId != null && e.data.iframeMessageId !== '71r4UJD4Cz') { return; } toggleModal_AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz(null, false); } else if (e && e.data && e.data.type && e.data.type === 'reloadPortalDataAfterChange') { const iframe = document.getElementById('miniExtensionsIframe-AjN7cG9zvVi7H6RaILxp_71r4UJD4Cz'); if (iframe && iframe.contentWindow && iframe.contentWindow.postMessage) { iframe.contentWindow.postMessage(e.data, '*'); } } }, false);