(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[994],{71791:function(e,n,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/AdminPageLayout",function(){return i(14197)}])},14197:function(e,n,i){"use strict";i.r(n),i.d(n,{default:function(){return y}});var s=i(39324),a=i(4337),t=i(35250),r=i(16266),c=i(19841),l=i(60554),o=i(70079),d=i(1454),u=i(32004),m=i(94968),f=i(21389),g=i(6038),h=i(52696),x=i(75641),p=i(88327),j=i(15329),v=i(1821),b=i(82277),w=i(13090),N=i(78931);function P(){var e=(0,a._)(["max-w-5xl mx-auto w-full"]);return P=function(){return e},e}function _(e){var n=e.route,i=e.children,s=(0,l.useRouter)();return(0,t.jsx)(j.ZB,{$as:"button",className:(0,c.default)("rounded",s.route===n?"bg-gray-700":"hover:bg-gray-800"),onClick:function(){s.push(n)},children:i})}function k(e){var n=e.workspaceName,i=e.hasAdminPrivileges,a=(0,N.hz)(),c=(0,l.useRouter)(),m=(0,o.useCallback)(function(){c.push("/")},[c]);return(0,t.jsxs)("nav",{className:"p-2",children:[(0,t.jsxs)("div",{className:"mb-1 flex flex-row gap-2",children:[(0,t.jsxs)(w.MP,{onClick:m,children:[(0,t.jsx)(p.ZP,{icon:d.Ao2}),(0,t.jsx)(u.Z,(0,s._)({},A.backToChat))]}),(0,t.jsx)(w.H,{})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 py-2",children:[(0,t.jsxs)("div",{className:"my-2 flex flex-col gap-2 px-2",children:[(0,t.jsx)(g.B0,{size:"large"}),(0,t.jsx)("h2",{className:"text-lg text-gray-100",children:n})]}),(0,t.jsxs)(_,{route:"/admin",children:[(0,t.jsx)(p.ZP,{icon:r.Z}),(0,t.jsx)(u.Z,(0,s._)({},A.membersPageTitle))]}),!0===i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(_,{route:"/admin/analytics",children:[(0,t.jsx)(p.ZP,{icon:d.orK}),(0,t.jsx)(u.Z,(0,s._)({},A.analytics))]}),a.has("workspace_admin_settings")&&(0,t.jsxs)(_,{route:"/admin/settings",children:[(0,t.jsx)(p.ZP,{icon:d.nbt}),(0,t.jsx)(u.Z,(0,s._)({},A.adminSettings))]})]}):null]})]})}function y(e){var n,i=e.mobilePageTitle,a=e.requireAdminPrivileges,r=void 0!==a&&a,c=e.children,d=(0,N.ec)(function(e){return e.currentWorkspace}),m=(0,N.$T)(),f=(0,h.Ix)(d),g=(0,l.useRouter)(),p=null!=d?(n=d.role)===x.r3.ADMIN||n===x.r3.OWNER:void 0;return(0,o.useEffect)(function(){r&&!1===p&&g.push("/admin")},[r,p,g]),(0,t.jsx)(b.Z,{showNavigation:!0,renderTitle:i,renderSidebar:(0,t.jsx)(k,{workspaceName:m?"":f,hasAdminPrivileges:p}),children:(0,t.jsxs)(Z,{children:[m&&(0,t.jsx)("div",{className:"flex min-h-screen items-center justify-center",children:(0,t.jsx)(v.Z,{})}),!m&&!d&&(0,t.jsx)("div",{className:"flex min-h-screen items-center justify-center",children:(0,t.jsx)(u.Z,(0,s._)({},A.workspaceNotFound))}),!m&&d&&c]})})}var Z=f.Z.div(P()),A=(0,m.vU)({workspaceNotFound:{id:"adminPage.workspaceNotFound",defaultMessage:"Workspace not found",description:"The title of the admin page."},backToChat:{id:"adminPage.backToChat",defaultMessage:"Back to chat",description:"Navigation button to return to main chat page"},membersPageTitle:{id:"adminPage.membersPageTitle",defaultMessage:"Members",description:"The title of the members page"},analytics:{id:"adminPage.analytics",defaultMessage:"Analytics",description:"Analytics sidebar item"},adminSettings:{id:"adminPage.adminSettings",defaultMessage:"Admin settings",description:"Settings sidebar item"}})},16266:function(e,n,i){"use strict";var s=i(70079);let a=s.forwardRef(function({title:e,titleId:n,...i},a){return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:a,"aria-labelledby":n},i),e?s.createElement("title",{id:n},e):null,s.createElement("path",{fillRule:"evenodd",d:"M18.685 19.097A9.723 9.723 0 0021.75 12c0-5.385-4.365-9.75-9.75-9.75S2.25 6.615 2.25 12a9.723 9.723 0 003.065 7.097A9.716 9.716 0 0012 21.75a9.716 9.716 0 006.685-2.653zm-12.54-1.285A7.486 7.486 0 0112 15a7.486 7.486 0 015.855 2.812A8.224 8.224 0 0112 20.25a8.224 8.224 0 01-5.855-2.438zM15.75 9a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z",clipRule:"evenodd"}))});n.Z=a}},function(e){e.O(0,[2798,8948,6493,9774,2888,179],function(){return e(e.s=71791)}),_N_E=e.O()}]);