1import{l as i,j as e,f as d,L as c,e as l,u as p,am as m,ad as u}from"./entry-CFysDqw_.js";import{M as s}from"./index-B2wgB0BV.js";import"./PageHeaderSlot-B0sriCQm.js";import"./textarea-D_r1wqLQ.js";import{b as h,r as x}from"./use-permission-CNsaSB_3.js";import{a as f}from"./chat-session-context-2m7mGyup.js";import{P as g}from"./PartnerSwitcher-h5dD9cWM.js";import{B as j}from"./building-2-BGGjAxVI.js";import"./sparkles-4OJAl6sZ.js";import"./index-BMOAZvav.js";import"./with-selector-5orPIsow.js";import"./copy-ClaX0sSv.js";import"./chevron-right-CVRkkDZ6.js";import"./mock-members-LGgI6A3N.js";import"./arrow-up-DMB7Jo4d.js";import"./dumbbell-Chq-Sanx.js";import"./clock-C8zY0FqF.js";import"./chart-column-CNpxvM2S.js";import"./map-pinned-B9GFFD2x.js";import"./zap-kSLV-0uJ.js";import"./popover-D73YyG-P.js";import"./use-debounced-value-BXl4PGNs.js";import"./chevron-down-Bewp-ACc.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const w=i("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);function y(){return e.jsxs("section",{className:"flex flex-1 flex-col items-center justify-center gap-3 px-4 py-16 text-center",children:[e.jsx(w,{className:"size-8 text-on-surface-muted","aria-hidden":!0}),e.jsx("h1",{className:"text-heading-h4-semi text-on-surface",children:e.jsx(s,{id:"portal.access.denied.title",defaultMessage:"You don't have access to this page",description:"Heading shown when a signed-in user opens a portal page their role does not allow."})}),e.jsx("p",{className:"max-w-md text-body-md text-on-surface-muted",children:e.jsx(s,{id:"portal.access.denied.body",defaultMessage:"Your role doesn't include this page. Ask your partner admin if you need it.",description:"Explanation under the access-denied heading, pointing the user to their partner admin."})}),e.jsx(d,{asChild:!0,className:"mt-2",children:e.jsx(c,{to:"/dashboard",children:e.jsx(s,{id:"portal.access.denied.dashboardLink",defaultMessage:"Go to dashboard",description:"Button on the access-denied view that returns the user to the dashboard home."})})})]})}function P(){const{clearConversations:a}=f();return e.jsxs("section",{className:"flex flex-1 flex-col items-center justify-center gap-3 px-4 py-16 text-center",children:[e.jsx(j,{className:"size-8 text-on-surface-muted","aria-hidden":!0}),e.jsx("h1",{className:"text-heading-h4-semi text-on-surface",children:e.jsx(s,{id:"portal.access.selectPartner.title",defaultMessage:"Choose a partner to continue",description:"Heading shown to a portal admin who opens a partner page before picking a partner to work as."})}),e.jsx("p",{className:"max-w-md text-body-md text-on-surface-muted",children:e.jsx(s,{id:"portal.access.selectPartner.body",defaultMessage:"This page shows one partner's data. Pick the partner you want to work as.",description:"Explanation under the choose-a-partner heading, above the partner selector."})}),e.jsx(g,{id:"select-partner",stayOnPage:!0,onSwitch:a,className:"mt-2 w-full max-w-xs text-left"})]})}function K(){const{pathname:a}=l(),{status:n,session:t}=p(),o=h(a);if(n==="loading")return null;if(!o){const r=x(a);return(t==null?void 0:t.isPortalAdmin)&&t.actingPartnerId===null&&r!==null&&m(r)?e.jsx(P,{}):e.jsx(y,{})}return e.jsx(u,{},(t==null?void 0:t.actingPartnerId)??"")}export{y as AccessDeniedView,K as RequireAccess};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.