Liferay.Loader.define("frontend-js-spa-web@5.0.32/util/utils",["module","exports","require"],(function(t,e,n){window;{Object.defineProperty(e,"__esModule",{value:!0}),e.clearNodeAttributes=function(t){Array.prototype.slice.call(t.attributes).forEach((e=>t.removeAttribute(e.name)))},e.copyNodeAttributes=function(t,e){Array.prototype.slice.call(t.attributes).forEach((t=>e.setAttribute(t.name,t.value)))},e.getCurrentBrowserPath=function(){return"".concat(window.location.pathname).concat(window.location.search).concat(window.location.hash)},e.getCurrentBrowserPathWithoutHash=r,e.getNodeOffset=function(t){let[e,n]=[0,0];do{e+=t.offsetLeft,n+=t.offsetTop,t=t.offsetParent}while(t);return{offsetLeft:e,offsetTop:n}},e.getPortletBoundaryId=o,e.getPortletBoundaryIds=i,e.getUid=function(){return t++},e.getUrlPath=a,e.getUrlPathWithoutHash=c,e.getUrlPathWithoutHashAndSearch=function(t){return(!t||t.startsWith("/")?new URL(t,window.location.origin):new URL(t)).pathname},e.isCurrentBrowserPath=function(t){if(t){const e=r();return c(t)===a(e)}return!1},e.removePathTrailingSlash=function(t){const e=t?t.length:0;e>1&&"/"===t[e-1]&&(t=t.substr(0,e-1));return t},e.resetAllPortlets=function(){i(Liferay.Portlet.list).forEach((t=>{const e=document.querySelector("#"+t);e&&(Liferay.Portlet.destroy(e),e.portletProcessed=!1)})),Liferay.Portlet.readyCounter=0,Liferay.destroyComponents(((t,e)=>e.destroyOnNavigate))},e.runStyle=s,e.runStylesInElement=function(t,e,n){const r=t.querySelectorAll("style,link");if(!r.length&&e)return void setTimeout(e);let o=0;const i=function(){e&&++o===r.length&&setTimeout(e)};for(let t=0;t<r.length;t++)s(r[t],i,n)},e.setReferrer=function(t){Object.defineProperty(document,"referrer",{configurable:!0,get:()=>t})};let t=1;function r(){return"".concat(window.location.pathname).concat(window.location.search)}function o(t){return"p_p_id_"+t+"_"}function i(t){return t.map((t=>o(t)))}function a(t){const e=!t||t.startsWith("/")?new URL(t,window.location.origin):new URL(t);return e.pathname+e.search+e.hash}function c(t){const e=!t||t.startsWith("/")?new URL(t,window.location.origin):new URL(t);return e.pathname+e.search}function s(t,e,n){const r=function(){e&&e()};if(!t.rel||"stylesheet"===t.rel||"canonical"===t.rel||"alternate"===t.rel)return"STYLE"===t.tagName||"canonical"===t.rel||"alternate"===t.rel?setTimeout(r):(t.addEventListener("load",r,{once:!0}),t.addEventListener("error",r,{once:!0})),n?n(t):document.head.appendChild(t),t;setTimeout(r)}}}));
//# sourceMappingURL=utils.js.map