var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; }; if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } } { let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opener = _____WB$wombat$assign$function_____("opener"); !function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};e[o].call(i.exports,i,i.exports,n);i.l=!0;return i.exports}n.m=e;n.c=t;n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})};n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});Object.defineProperty(e,"__esModule",{value:!0})};n.t=function(e,t){1&t&&(e=n(e));if(8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);n.r(o);Object.defineProperty(o,"default",{enumerable:!0,value:e});if(2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o};n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};n.d(t,"a",t);return t};n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};n.p="//web.archive.org/web/20211207185928/https://static.hsappstatic.net/HubspotToolsMenu/static-1.119/";n(n.s=7)}([function(e,t){e.exports="//web.archive.org/web/20211207185928/https://static.hsappstatic.net/HubspotToolsMenu/static-1.119/js/sprocket_white.svg"},function(e,t){e.exports="//web.archive.org/web/20211207185928/https://static.hsappstatic.net/HubspotToolsMenu/static-1.119/js/sprocket_orange.svg"},function(e,t){e.exports="//web.archive.org/web/20211207185928/https://static.hsappstatic.net/HubspotToolsMenu/static-1.119/css/toolsmenu.css"},,,,,function(e,t,n){"use strict";n.r(t);var o="HS_SPROCKET_MENU_LOCAL_OVERRIDE",i="https://web.archive.org/web/20211207185928/https://local.hsappstatic.net/HubspotToolsMenu/static/js/index.js",r=function(){return Array.from(document.body.getElementsByTagName("script")).some((function(e){return e.src===i}))},s=function(){return!(!window.localStorage.getItem(o)&&1)&&!r()},a=function(){var e=document.createElement("script");e.src=i;e.onload=function(){setTimeout((function(){var e=new Event("DOMContentLoaded");document.dispatchEvent(e)}),100)};document.body.appendChild(e)};s()&&a();function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n0?n[0]:null;if(null!==o){var i=o.getAttribute("data-menu-id").trim();e.push([t.EDIT_NAVIGATION_MENU,this.baseUrl+"/menus/"+this.portalId+"/edit/"+i])}var r="";e.forEach((function(e){r+="
  • \n "+e[0]+"\n
  • "}));if(this.permissionObj.permissions.includes("CAN_PREVIEW_ENVIRONMENTS")){r+='
  • '+t.VIEW_BUFFER+'
  • '+t.VIEW_HARD+"
  • ";r+='
  • '+t.VIEW_STAGING+'
  • '+t.VIEW_PRODUCTION+"
  • "}var s='',a='\n \n ";document.body.appendChild(this.createElementFromHTML(s));document.body.appendChild(this.createElementFromHTML(a));this.registerEvents()}},{key:"registerEvents",value:function(){var e=this,t=document.querySelector(".hs-tools-menu");this.registerDropdown(t);t.querySelector(".hs-menu-hider").addEventListener("click",(function(e){e.preventDefault();e.stopPropagation();t.style.display="none"}));var n=t.querySelector(".hs-environment-buffer-on");n&&(this.cmsEnvironment.buffer?n.parentElement.removeChild(n):n.addEventListener("click",(function(t){t.preventDefault();t.stopPropagation();e.requestAndSetEnvironmentCookie(e.portalId,!0,e.cmsEnvironment.environmentId)})));var o=t.querySelector(".hs-environment-buffer-off");o&&(this.cmsEnvironment.buffer?o.addEventListener("click",(function(t){t.preventDefault();t.stopPropagation();e.requestAndSetEnvironmentCookie(e.portalId,!1,e.cmsEnvironment.environmentId)})):o.parentElement.removeChild(o));var i=t.querySelector(".hs-environment-staging");i&&(this.cmsEnvironment.environmentId!==this.environments.STAGING?i.addEventListener("click",(function(t){t.preventDefault();t.stopPropagation();e.requestAndSetEnvironmentCookie(e.portalId,e.cmsEnvironment.buffer,e.environments.STAGING)})):i.parentElement.removeChild(i));var r=t.querySelector(".hs-environment-production");r&&(this.cmsEnvironment.environmentId!==this.environments.PRODUCTION?r.addEventListener("click",(function(t){t.preventDefault();t.stopPropagation();e.requestAndSetEnvironmentCookie(e.portalId,e.cmsEnvironment.buffer,e.environments.PRODUCTION)})):r.parentElement.removeChild(r))}},{key:"requestAndSetEnvironmentCookie",value:function(e,t,n){var o=this.cpBaseUrl+"/content-tools-menu/api/v1/tools-menu/environment-cookie?portalId="+e+"&environmentId="+n+"&buffer="+t;this.httpGet(o,(function(e){document.cookie="hs_cms_environment="+btoa(JSON.stringify(e));window.location.reload()}))}},{key:"registerDropdown",value:function(e){var t=Array.from(e.children).find((function(e){return e.classList.contains("hs-sprocket")})),n=function(){e.classList.add("hs-collapsed");e.setAttribute("aria-expanded",!1);t.setAttribute("src",p.a)},o=function(){e.classList.remove("hs-collapsed");e.setAttribute("aria-expanded",!0);t.setAttribute("src",f.a)},i=function e(){n();document.body.removeEventListener("click",e)},r=function(t){if(!t.target.getAttribute("href")){t.preventDefault();t.stopPropagation();if(e.classList.contains("hs-collapsed")){o();document.body.addEventListener("click",i)}else{n();document.body.removeEventListener("click",i)}}};e.addEventListener("click",r,!1)}},{key:"getUrlParameter",value:function(e){e=e.replace(/[[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(location.search);return null===t?"":decodeURIComponent(t[1].replace(/\+/g," "))}},{key:"getCmsEnvironmentFromCookie",value:function(){var e=this.getCookie("hs_cms_environment");return e?JSON.parse(atob(e)):{portalId:0,environmentId:this.environments.PRODUCTION,buffer:!1,createdAt:0}}},{key:"getCookie",value:function(e){for(var t=e+"=",n=document.cookie.split(";"),o=0;o