"use strict";(self.webpackChunk_digicommerce_cms_admin=self.webpackChunk_digicommerce_cms_admin||[]).push([[3677],{15415:(x,h,l)=>{l.r(h),l.d(h,{default:()=>F});var e=l(32735),c=l(88425),v=l(99357),y=l(5636),P=l(83983),T=l(29270),d=l(11856),E=l(16540),m=l(95602),n=l(53214),M=l(84968),L=l(17247),C=(t,s,i)=>new Promise((f,u)=>{var r=a=>{try{o(i.next(a))}catch(g){u(g)}},p=a=>{try{o(i.throw(a))}catch(g){u(g)}},o=a=>a.done?f(a.value):Promise.resolve(a.value).then(r,p);o((i=i.apply(t,s)).next())});const b=()=>C(void 0,null,function*(){const{data:t}=yield L.be.get("/admin/plugins");return t}),I=t=>{const s=(0,c.useNotification)();return(0,M.useQuery)("list-enabled-plugins",()=>b(),{onSuccess:()=>{t&&t()},onError:()=>{s({type:"warning",message:{id:"notification.error",defaultMessage:"An error occured"}})}})},N=()=>{const{formatMessage:t}=(0,y.useIntl)(),{notifyStatus:s}=(0,T.useNotifyAT)();(0,c.useFocusWhenNavigate)();const i=t({id:"global.plugins",defaultMessage:"Plugins"}),f=()=>{s(t({id:"app.utils.notify.data-loaded",defaultMessage:"The {target} has loaded"},{target:i}))},{status:u,data:r}=I(f);return u!=="success"&&u!=="error"?e.createElement(d.Layout,null,e.createElement(E.Main,{"aria-busy":!0},e.createElement(c.LoadingIndicatorPage,null))):e.createElement(d.Layout,null,e.createElement(E.Main,null,e.createElement(d.HeaderLayout,{title:i,subtitle:t({id:"app.components.ListPluginsPage.description",defaultMessage:"List of the installed plugins in the project."})}),e.createElement(d.ContentLayout,null,e.createElement(n.Table,{colCount:2,rowCount:(r==null?void 0:r.plugins.length)+1},e.createElement(n.Thead,null,e.createElement(n.Tr,null,e.createElement(n.Th,null,e.createElement(m.Typography,{variant:"sigma",textColor:"neutral600"},t({id:"global.name",defaultMessage:"Name"}))),e.createElement(n.Th,null,e.createElement(m.Typography,{variant:"sigma",textColor:"neutral600"},t({id:"global.description",defaultMessage:"description"}))))),e.createElement(n.Tbody,null,r.plugins.map(({name:o,displayName:a,description:g})=>e.createElement(n.Tr,{key:o},e.createElement(n.Td,null,e.createElement(m.Typography,{textColor:"neutral800",variant:"omega",fontWeight:"bold"},t({id:`global.plugins.${o}`,defaultMessage:a}))),e.createElement(n.Td,null,e.createElement(m.Typography,{textColor:"neutral800"},t({id:`global.plugins.${o}.description`,defaultMessage:g}))))))))))},F=()=>{const{formatMessage:t}=(0,y.useIntl)(),s=t({id:"global.plugins",defaultMessage:"Plugins"});return e.createElement(c.CheckPagePermissions,{permissions:P.Z.marketplace.main},e.createElement(v.Helmet,{title:s}),e.createElement(N,null))}}}]);
