const i={computed:{loggedUser(){return this.$store.state.user||{}},isReady(){return this.loggedUser&&Object.keys(this.loggedUser).length>0},permissions(){return this.isReady&&this.loggedUser.role.permissions},routePathString(){return this.$store.state.routes[this.$route.name]||""},isAdministrator(){if(!this.loggedUser.role_id)return!0;const e=this.permissions;return e?e.settings.accessible&&e.reports.accessible&&e.leads.accessible&&e.reports.sales_report.every(s=>["C","R","U","D"].includes(s)):!1}},methods:{hasPermissionTo(e){if(!this.loggedUser.role_id)return!0;let s=this.routePathString.split(".").reduce((r,t)=>r&&r[t]||null,this.permissions);return s&&s.includes(e)}}};export{i as p};
