import{h as e}from"./p-91e1cdd0.js";import{b as t,n as r,m as a,i as s}from"./p-2c9dd7c4.js";import{_ as n}from"./p-556fdb43.js";import{i}from"./p-fdc8ec5f.js";const o="manage",c="manage/add",u="manage/edit",d=(r,a)=>{const s=[e("stencil-route",{url:`${a}/manage/add`,routeRender:()=>e("ap-ben-edit-benefit-page",null),exact:!0}),e("stencil-route",{url:`${a}/manage/edit/:benefitId`,routeRender:r=>e("ap-ben-edit-benefit-page",{benefitId:t(r.match.params.benefitId)}),exact:!0}),e("stencil-route",{url:`${a}/manage/:match?`,routeRender:t=>e("ap-ben-manage-page",Object.assign({},t))})],n=[e("stencil-route",{url:`${a}/admin`,routeRender:()=>e("ap-ben-role-management-page",null),exact:!0})];switch(r){case"accountAdmin":return s.concat(n);case"accountEditor":return s;default:return[]}},m=new class{constructor(){this._baseUrl=r,this._history=r}navigateInternally(e){const t=`${this.baseUrl}${this.toRouteWithLeadingSlash(e)}`;i.navigation(t),this.history.value.push(t)}toRouteWithLeadingSlash(e){return e.length>0&&"/"===e[0]?e:`/${e}`}set baseUrl(e){this._baseUrl=n.pipe(t(e),a((e=>e.replace(/\/$/,""))))}get baseUrl(){if(s(this._baseUrl))throw Error("Base URL is missing.");return this._baseUrl.value}set history(e){this._history=e}get history(){if(s(this._history))throw Error("Router history is missing.");return this._history}};export{c as A,u as E,o as M,m as n,d as r}