class o{constructor({caminho:e,acaoIr:n}){this._partesCaminho=[];this._acaoIr=n,this._partesCaminho=(Array.isArray(e)?e:[e]).flatMap(t=>t.split("/")).filter(Boolean)}get caminho(){return`/${this._partesCaminho.join("/")}`}set caminho(e){this._partesCaminho=e.split("/").filter(n=>n)}endereco(e,n){const t=new URL(typeof window<"u"?window.location.href:"http://localhost");t.pathname=this.caminho,t.search="";const r=Object.entries(e);for(const[s,a]of r)t.searchParams.set(String(s),a??"");return t.hash="",n&&(t.hash=`#${t.search}`,t.search=""),t.href}ir(e){this._acaoIr?this._acaoIr(this.endereco(e)):typeof window<"u"&&(window.location.href=this.endereco(e))}get parametros(){const e=new URL(typeof window<"u"?window.location.href:"http://localhost"),n=e.searchParams,t=Object.fromEntries(n.entries()),r=e.hash;if(r){const s=Object.fromEntries(new URLSearchParams(r.slice(1)).entries());return{...t,...s}}return t}}export{o as TipagemRotas}; //# sourceMappingURL=tipagemRotas.mjs.map