"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[996],{39381:function(e,n,t){t.r(n);var i,a={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"Admin_authorProfile",selections:[{alias:null,args:null,kind:"ScalarField",name:"uid",storageKey:null},i={alias:"_id",args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,concreteType:"Community",kind:"LinkedField",name:"community",plural:!1,selections:[i],storageKey:null}],type:"AuthorProfile",abstractKey:null};a.hash="c12c965a699737bee2b0dce13292bf90",n.default=a},11265:function(e,n,t){t.r(n);var i,a={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"Admin_entry",selections:[{alias:null,args:null,kind:"ScalarField",name:"uid",storageKey:null},{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"author",plural:!1,selections:i=[{alias:"_id",args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"uuid",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"type",storageKey:null},{alias:null,args:null,concreteType:"Community",kind:"LinkedField",name:"community",plural:!1,selections:i,storageKey:null}],type:"Entry",abstractKey:null};a.hash="6125c8fb594811bebedb59a0a2a5f649",n.default=a},73956:function(e,n,t){t.r(n);var i,a={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"Admin_entryGroup",selections:[{alias:null,args:null,kind:"ScalarField",name:"uid",storageKey:null},i={alias:"_id",args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:"entryGroupCommunity",args:null,concreteType:"Community",kind:"LinkedField",name:"community",plural:!1,selections:[i],storageKey:null},{alias:null,args:null,concreteType:"HubPage",kind:"LinkedField",name:"hubPage",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"Admin_hubPage"}],storageKey:null}],type:"EntryGroup",abstractKey:null};a.hash="ce4dcd19e91337306537925966927890",n.default=a},33349:function(e,n,t){t.r(n);var i,a={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"Admin_hubPage",selections:[i={alias:"_id",args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,concreteType:"Community",kind:"LinkedField",name:"community",plural:!1,selections:[i],storageKey:null},{alias:null,args:null,concreteType:"EntryGroup",kind:"LinkedField",name:"entryGroup",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"uid",storageKey:null}],storageKey:null}],type:"HubPage",abstractKey:null};a.hash="d43e1e642a46e0fb10b93f833a8e8698",n.default=a},10996:function(e,n,t){t.d(n,{Z:function(){return S}});var i,a=t(53520),r=t(97458),o=t(52983),l=t(61198),u=t(61568),d=t(29565),c=t(9326),E=t(81284),R=t(97158),s=t(13546),A=t.n(s);let T=((i={}).ABLE_TO_IP_BAN="ABLE_TO_IP_BAN",i.ASSET_MANAGER="ASSET_MANAGER",i.AUTHOR="AUTHOR",i.BETA_TESTER="BETA_TESTER",i.BYPASS_TWO_FACTOR_AUTHENTICATION="BYPASS_TWO_FACTOR_AUTHENTICATION",i.CAMPAIGNS_ADMIN="CAMPAIGNS_ADMIN",i.CHORUS_MANAGER="CHORUS_MANAGER",i.COMMUNITY_POST_AUTHOR="COMMUNITY_POST_AUTHOR",i.EDITOR="EDITOR",i.EDITORIAL_APPS_ADMIN="EDITORIAL_APPS_ADMIN",i.EMPLOYEE="EMPLOYEE",i.EXTERNAL_API_CLIENT="EXTERNAL_API_CLIENT",i.EXTERNAL_DEVELOPER="EXTERNAL_DEVELOPER",i.FREELANCE="FREELANCE",i.GROWTH_AND_ANALYTICS="GROWTH_AND_ANALYTICS",i.HEADLESS_ADMIN="HEADLESS_ADMIN",i.INTERNAL_MEMBER="INTERNAL_MEMBER",i.MANAGER="MANAGER",i.MEMBER="MEMBER",i.MODERATOR="MODERATOR",i.NETWORK_ADMIN="NETWORK_ADMIN",i.NETWORK_EDITOR="NETWORK_EDITOR",i.NETWORK_OPS="NETWORK_OPS",i.PTE_EDITOR="PTE_EDITOR",i.PUBLIC_AUDIENCE="PUBLIC_AUDIENCE",i.SUPERGROUP_AUTHOR="SUPERGROUP_AUTHOR",i.TRUSTED="TRUSTED",i.TRUSTED_AUTHOR="TRUSTED_AUTHOR",i),_=[T.NETWORK_ADMIN],m={adminMenu:{newQuickPost:[T.AUTHOR,T.COMMUNITY_POST_AUTHOR,T.SUPERGROUP_AUTHOR,T.TRUSTED_AUTHOR,T.EDITOR,T.MANAGER,T.CHORUS_MANAGER,T.HEADLESS_ADMIN,T.NETWORK_EDITOR,T.EXTERNAL_API_CLIENT],newStory:[T.AUTHOR,T.COMMUNITY_POST_AUTHOR,T.SUPERGROUP_AUTHOR,T.TRUSTED_AUTHOR,T.EDITOR,T.MANAGER,T.CHORUS_MANAGER,T.HEADLESS_ADMIN,T.NETWORK_EDITOR,T.EXTERNAL_API_CLIENT],dashboard:[T.AUTHOR,T.COMMUNITY_POST_AUTHOR,T.SUPERGROUP_AUTHOR,T.TRUSTED_AUTHOR,T.EDITOR,T.MANAGER,T.CHORUS_MANAGER,T.HEADLESS_ADMIN,T.NETWORK_EDITOR,T.EXTERNAL_API_CLIENT],editorial:[T.AUTHOR,T.COMMUNITY_POST_AUTHOR,T.SUPERGROUP_AUTHOR,T.TRUSTED_AUTHOR,T.EDITOR,T.MANAGER,T.CHORUS_MANAGER,T.HEADLESS_ADMIN,T.NETWORK_EDITOR,T.EXTERNAL_API_CLIENT],assetManager:[T.AUTHOR,T.COMMUNITY_POST_AUTHOR,T.SUPERGROUP_AUTHOR,T.TRUSTED_AUTHOR,T.EDITOR,T.MANAGER,T.CHORUS_MANAGER,T.HEADLESS_ADMIN,T.NETWORK_EDITOR,T.EXTERNAL_API_CLIENT],groups:[T.EDITOR,T.MANAGER,T.CHORUS_MANAGER,T.HEADLESS_ADMIN,T.NETWORK_EDITOR,T.SUPERGROUP_AUTHOR],hubLayout:[T.EDITOR,T.MANAGER,T.CHORUS_MANAGER,T.HEADLESS_ADMIN,T.NETWORK_EDITOR,T.SUPERGROUP_AUTHOR],network:[T.HEADLESS_ADMIN,T.NETWORK_EDITOR],community:[T.HEADLESS_ADMIN,T.NETWORK_EDITOR],navigation:[T.EDITOR,T.MANAGER,T.CHORUS_MANAGER,T.HEADLESS_ADMIN,T.NETWORK_EDITOR]},entry:{edit:[T.EDITOR,T.MANAGER,T.CHORUS_MANAGER,T.HEADLESS_ADMIN,T.NETWORK_EDITOR],editOwn:[T.EDITOR,T.MANAGER,T.CHORUS_MANAGER,T.HEADLESS_ADMIN,T.NETWORK_EDITOR,T.AUTHOR,T.COMMUNITY_POST_AUTHOR,T.SUPERGROUP_AUTHOR,T.TRUSTED_AUTHOR]},entryGroup:{edit:[T.EDITOR,T.MANAGER,T.CHORUS_MANAGER,T.HEADLESS_ADMIN,T.NETWORK_EDITOR,T.SUPERGROUP_AUTHOR]},authorProfile:{edit:[T.MODERATOR,T.MANAGER,T.CHORUS_MANAGER,T.HEADLESS_ADMIN,T.NETWORK_EDITOR],editOwn:[T.AUTHOR,T.COMMUNITY_POST_AUTHOR,T.SUPERGROUP_AUTHOR,T.TRUSTED_AUTHOR,T.EDITOR,T.MANAGER,T.CHORUS_MANAGER,T.HEADLESS_ADMIN,T.NETWORK_EDITOR,T.EXTERNAL_API_CLIENT]}};var O=function(e){let n=(0,d.aC)();return!!n?.viewer&&function(e,n){if(_.some(n=>e.includes(n)))return!0;let t=A()(m,n),i=Array.isArray(e)?e:[e];return!!t&&t.some(e=>i.includes(e))}(n.viewer.roles,e)},N=t(37782),y=function(){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"206 29.9 642.1 681.3",width:"20",children:(0,r.jsx)("path",{d:"M843 467.2c4.8 3.2 6.3 9.5 4 15-13.5 41.2-36.4 79.2-64.2 111.7-4 4.8-9.5 6.3-15 4l-81.6-28.5c-20.6 16.6-43.6 30.1-67.3 39.6l-16.6 84.7c-.8 5.5-5.5 10.3-11.1 11.1-21.4 4-42.8 6.3-64.2 6.3-22.2 0-43.6-2.4-64.2-6.3-5.5-.8-10.3-5.5-11.1-11.1L435.2 609c-24.6-9.5-48.3-23-67.3-39.6l-81.6 28.5c-5.5 2.4-11.1.8-15-4-28.5-32.5-51.5-70.5-64.2-111.7-2.4-5.5-.8-11.9 4-15l64.9-57c-2.4-12.7-3.2-26.1-3.2-39.6s.8-26.9 3.2-39.6l-65-57c-4.8-3.2-6.3-9.5-4-15 13.5-41.2 36.4-79.2 64.2-111.7 4-4.8 9.5-6.3 15-4l81.6 28.5c19.8-16.6 43.6-30.1 67.3-39.6l16.6-84.7c.8-5.5 5.5-10.3 11.1-11.1 42.8-8.7 86.3-8.7 129.1 0 5.5.8 10.3 5.5 11.1 11.1l15 85.5c24.6 9.5 47.5 23 67.3 39.6l81.6-28.5c5.5-2.4 11.1-.8 15 4 28.5 32.5 51.5 70.5 64.2 111.7 2.4 5.5.8 11.9-4 15l-65.7 57c2.4 12.7 3.2 26.1 3.2 39.6s-.8 26.9-3.2 39.6l66.6 56.2zm-190-95.8c0-69.7-57.8-127.5-127.5-127.5-70.5 0-127.5 57-127.5 127.5s57 127.5 127.5 127.5S653 441.9 653 371.4z"})})},U=function(e){var n=e.href,t=e.children;return(0,r.jsx)("li",{children:(0,r.jsx)("a",{className:"inline-block w-full py-2",href:n,children:t})})},S=(0,N.n)(function(e){var n,i,s=e.entry,A=e.entryGroup,T=e.hubPage,_=e.authorProfile,m=(0,c.q)().appConfig.deployEnv,N=(0,l.useFragment)(t(11265),s||null),S=(0,l.useFragment)(t(73956),A||null),p=(0,l.useFragment)(t(33349),(null==S?void 0:S.hubPage)||T||null),I=(0,l.useFragment)(t(39381),_||null),M=(0,u.Z)(),g=(0,a._)((0,o.useState)(!1),2),h=g[0],D=g[1],P=(0,d.aC)(),f=null==P?void 0:null===(n=P.viewer)||void 0===n?void 0:n.id,H={newStory:O("adminMenu.newStory"),newQuickPost:O("adminMenu.newQuickPost"),network:O("adminMenu.network"),hubLayout:O("adminMenu.hubLayout"),groups:O("adminMenu.groups"),editorial:O("adminMenu.editorial"),dashboard:O("adminMenu.dashboard"),community:O("adminMenu.community"),assetManager:O("adminMenu.assetManager"),navigation:O("adminMenu.navigation"),editEntry:O("entry.edit"),editOwnEntry:O("entry.editOwn"),editEntryGroup:O("entryGroup.edit"),editAuthorProfile:O("authorProfile.edit"),editOwnAuthorProfile:O("authorProfile.editOwn")},C=Object.keys(H).some(function(e){return!0===H[e]}),L=(0,o.useMemo)(function(){if(N){var e=H.editEntry,n=H.editOwnEntry&&f===N.author._id;return"QUICK_POST"===N.type?{type:"QuickPost",editURL:"".concat(E.YK,"/quick-compose/").concat(N.uuid),permitted:e||n,uid:N.uid}:{type:"Story",editURL:"".concat(E.YK,"/compose/").concat(N.uuid),permitted:e||n,uid:N.uid}}if(p){var t,i=(null===(t=p.community)||void 0===t?void 0:t._id.toString())||E.vv;return{type:"Hub",editURL:"".concat(E.RQ,"/admin/hub_layout/show?community_id=").concat(encodeURIComponent(i),"&hub_page_id=").concat(p._id),permitted:H.editEntryGroup,uid:p.entryGroup.uid}}if(S){var a="".concat(E.RQ,"/admin/entry_groups/edit/").concat(S._id);return S.entryGroupCommunity?{type:"Group",editURL:"".concat(a,"?community_id=").concat(encodeURIComponent(S.entryGroupCommunity._id.toString()),"&type=SiteGroup"),permitted:H.editEntryGroup,uid:S.uid}:{type:"Super Group",editURL:"".concat(a,"?type=SuperGroup"),permitted:H.editEntryGroup,uid:S.uid}}if(I){var r=H.editAuthorProfile,o=H.editOwnAuthorProfile&&f===I._id;return{type:"Author Profile",editURL:"".concat(E.RQ,"/admin/author_profiles/edit/").concat(I._id,"?community_id=").concat(encodeURIComponent(I.community._id)),permitted:r||o,uid:I.uid}}return null},[I,N,S,p,H.editAuthorProfile,H.editEntry,H.editEntryGroup,H.editOwnAuthorProfile,H.editOwnEntry,f]);return((0,o.useEffect)(function(){if(null==L?void 0:L.permitted){var e="";return document.body.addEventListener("keydown",n),function(){document.body.removeEventListener("keydown",n)}}function n(n){var t=n.key;1===t.length&&n.target===document.body&&((e+=t)!==E.wb.slice(0,e.length)?e=t===E.wb[0]?t:"":e.length===E.wb.length&&(e="",window.open(L.editURL,"_blank")))}},[L]),M&&C)?(0,r.jsxs)("div",{className:"fixed top-[10%] z-20 rounded-r bg-white p-8 font-polysans shadow-md hover:px-14",onMouseOver:function(){D(!0)},onMouseLeave:function(){D(!1)},children:[!h&&(0,r.jsx)(y,{}),h&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h2",{className:"leading-14 text-sm mb-4 cursor-default bg-repeating-lines-dark text-15 font-bold uppercase tracking-15 text-black",children:"Quick Admin"}),(0,r.jsxs)("ul",{className:"text-sm pt-2 text-13 uppercase leading-140 tracking-15 text-blurple",children:[H.newQuickPost&&(0,r.jsx)(U,{href:"".concat(E.YK,"/newstory?community_id=").concat(encodeURIComponent(E.vv),"&entry_type=QuickPost"),children:"New QuickPost"}),H.newStory&&(0,r.jsx)(U,{href:"".concat(E.YK,"/newstory?community_id=").concat(encodeURIComponent(E.vv)),children:"New Story"}),(null==L?void 0:L.permitted)&&(0,r.jsxs)(U,{href:L.editURL,children:["Edit ",L.type]}),H.dashboard&&(0,r.jsx)(U,{href:"".concat(E.YK,"/?community_id=").concat(encodeURIComponent(E.vv)),children:"Dashboard"}),H.editorial&&(0,r.jsx)(U,{href:"".concat(E.RQ,"/admin/dashboard/editorial?community_id=").concat(encodeURIComponent(E.vv)),children:"Editorial"}),H.assetManager&&(0,r.jsx)(U,{href:"".concat(E.YK,"/assets?community_id=").concat(encodeURIComponent(E.vv)),children:"Assets Manager"}),H.groups&&(0,r.jsx)(U,{href:"".concat(E.RQ,"/admin/entry_groups/list?community_id=").concat(encodeURIComponent(E.vv),"&type=SiteGroup"),children:"Groups"}),H.hubLayout&&(0,r.jsx)(U,{href:"".concat(E.RQ,"/admin/hub_layout/show?community_id=").concat(encodeURIComponent(E.vv)),children:"Hub Layout"}),H.network&&(0,r.jsx)(U,{href:"".concat(E.RQ,"/admin/networks/2/edit?community_id=").concat(encodeURIComponent(E.vv)),children:"The Verge Network"}),H.community&&(0,r.jsx)(U,{href:"".concat(E.RQ,"/admin/communities/network_edit/372?community_id=").concat(encodeURIComponent(E.vv)),children:"Verge Community"}),H.navigation&&(0,r.jsx)(U,{href:"".concat(E.RQ,"/admin/nav/show?community_id=").concat(encodeURIComponent(E.vv)),children:"Navigation"}),R.dm&&(null==P?void 0:null===(i=P.viewer)||void 0===i?void 0:i.coral)&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(U,{href:"".concat(R.dm,"/admin/moderate#accessToken=").concat(encodeURIComponent(P.viewer.coral)),children:"Comment Moderation"})})]}),"staging"!==m&&"production"!==m&&L&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h3",{className:"leading-14 text-sm mb-4 mt-8 cursor-default bg-repeating-lines-dark text-15 font-bold uppercase tracking-15 text-black",children:"Developer"}),(0,r.jsx)("ul",{className:"text-sm pt-2 text-13 uppercase leading-140 tracking-15 text-blurple",children:(0,r.jsx)(U,{href:"/api/revalidate?uid=".concat(L.uid,"&path=").concat(location.pathname,"&skip=fastly&skip=aws&skip=slack"),children:"Revalidate"})})]})]})]}):null},{context:"AdminErrorBoundary"})},61568:function(e,n,t){var i=t(53520),a=t(52983);n.Z=function(){var e=(0,i._)((0,a.useState)(!1),2),n=e[0],t=e[1];return(0,a.useEffect)(function(){t(!0)},[]),n}}}]);