(globalThis.webpackChunkPlesk=globalThis.webpackChunkPlesk||[]).push([["views/php/extensions"],{1435:(e,n,i)=>{"use strict";i.r(n),i.d(n,{SORT_ASC:()=>l,SORT_DESC:()=>d,default:()=>k});var t=i(296),a=i(668),s=i.n(a),o=i(297);const r=i(90).Locale.getSection("components.list"),l="ASC",d="DESC",c="all",u={set(e,n){localStorage.setItem(e,JSON.stringify(n))},get(e){const n=localStorage.getItem(e);return JSON.parse(n)}},m=e=>`list-sort_${e}`,p=e=>`list-page_${e}`,h=({id:e,data:n,columns:i,itemsPerPage:a=25,itemsPerPageOptions:s=[10,25,100,c],sortColumn:d,sortDirection:h=l,searchField:k,locale:f={},emptyView:v,emptyFilteredView:g,toolbar:x,selection:b=[],onSelectionChange:S,searchBarInputProps:y,rowKey:N="key",useStorage:P=!0,...E})=>{const{sortColumn:j,sortDirection:T,setSortState:F}=((e,{sortColumn:n,sortDirection:i})=>{const[{sortColumn:a,sortDirection:s},o]=(0,t.useState)({sortColumn:u.get(m(e))?.sortColumn??n,sortDirection:u.get(m(e))?.sortDirection??i});return{sortColumn:a,sortDirection:s,setSortState:n=>{o(e=>({...e,...n})),u.set(m(e),{...u.get(m(e)),...n})}}})(e,{sortColumn:d??i.find(({sortable:e})=>e)?.key,sortDirection:h}),{page:w,itemsPerPage:C,searchPattern:V,setPageState:D}=((e,{itemsPerPage:n},i=!0)=>{const a=i?{page:u.get(p(e))?.page,itemsPerPage:u.get(p(e))?.itemsPerPage,searchPattern:u.get(p(e))?.searchPattern}:{},[{page:s,itemsPerPage:o,searchPattern:r},l]=(0,t.useState)({page:a.page??1,itemsPerPage:a.itemsPerPage??n,searchPattern:a.searchPattern??""});return{page:s,itemsPerPage:o,searchPattern:r,setPageState:n=>{l(e=>({...e,...n})),i&&u.set(p(e),{...u.get(p(e)),...n})}}})(e,{itemsPerPage:s.includes(a)?a:s[0]},P),I=(0,t.useMemo)(()=>V?g??(0,t.jsx)(o.ListEmptyView,{reason:"filtered","data-testid":"list-empty-view-filtered"}):v??(0,t.jsx)(o.ListEmptyView,{}),[V,v,g]),H=(0,t.useMemo)(()=>i.map(({sortDataField:e,...n})=>n),[i]),L=(0,t.useMemo)(()=>k&&V?n.filter(e=>(Array.isArray(k)?k:[k]).some(n=>e[n]&&String(e[n]).toLowerCase().includes(V.toLowerCase()))):n,[n,V,k]),O=(0,t.useMemo)(()=>{if(!j)return L;const e=i.find(({key:e})=>e===j)?.sortDataField??j,n=i.find(({key:e})=>e===j)?.sort??((n,i)=>n[e]i[e]?1:0);return[...L].sort((e,i)=>l===T?n(e,i):n(i,e))},[L,j,T,i]),R=(0,t.useMemo)(()=>{if(C===c)return O;const e=C*(w-1),n=e+C;return O.slice(e,n)},[w,O,C]),q=(0,t.useCallback)(e=>{D({searchPattern:e}),e!==V&&D({page:1})},[V]),$=(0,t.useCallback)(e=>{D({itemsPerPage:e});(e===c?1:Math.ceil(L.length/e)){if("function"==typeof S&&b.length){const e=L.map(e=>{return n=e,"function"==typeof(i=N)?i(n):n[i];var n,i}).filter(e=>b.includes(e));S(e)}},[L]),(0,t.jsx)(o.List,{pagination:(0,t.jsx)(o.Pagination,{current:w,total:C===c?1:Math.ceil(L.length/C),onSelect:e=>D({page:e}),itemsPerPage:C,itemsPerPageOptions:s,onItemsPerPageChange:$}),toolbar:(x||k)&&(0,t.jsxs)(o.Toolbar,{children:[x,k&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.ToolbarExpander,{}),(0,t.jsx)(o.ToolbarGroup,{title:"",children:(0,t.jsx)(o.SearchBar,{inputProps:{placeholder:r.lmsg("searchPlaceholder"),"data-testid":"list-searchbar",value:V,...y??{}},onTyping:q})})]})]}),totalRows:L.length,sortColumn:j,sortDirection:T,onSortChange:F,columns:H,data:R,filtered:!!V,locale:{totalRows:({totalRows:e})=>r.formatMessage("recordsTotal",{total:e}),...f},emptyView:I,onSelectionChange:S,selection:b,rowKey:N,...E})};h.propTypes={id:s().string.isRequired,data:s().array.isRequired,columns:s().array.isRequired,itemsPerPage:s().number,itemsPerPageOptions:s().array,sortColumn:s().string,sortDirection:s().string,searchField:s().oneOfType([s().string,s().arrayOf(s().string.isRequired)]),locale:s().object,emptyView:s().node,emptyFilteredView:s().node,toolbar:s().node,onSelectionChange:s().func,selection:s().array,rowKey:s().oneOfType([s().string,s().func]),searchBarInputProps:s().object,useStorage:s().bool};const k=h},2525:(e,n,i)=>{"use strict";i.r(n),i.d(n,{default:()=>r});var t=i(297),a=i(90),s=i(296);const o=a.Locale.getTranslate("components.buttons"),r=({children:e,confirmationText:n,onClick:i,isCritical:a=!1,isProcessing:r=!1,target:l,...d})=>{const[c,u]=(0,s.useState)(!1),m=(0,s.jsx)(t.Button,{onClick:()=>u(!0),state:r?"loading":void 0,...d,children:r?(0,s.jsx)(o,{content:"wait"}):e});return(0,s.jsxs)(t.Popover,{target:l?(0,s.cloneElement)(l,{onClick:()=>u(!0)}):m,placement:"top",visible:c,onClose:()=>u(!1),children:[(0,s.jsx)(t.Paragraph,{children:n}),(0,s.jsx)(t.Button,{id:"buttonYes",intent:a?"danger":"primary",onClick:()=>{u(!1),i()},children:(0,s.jsx)(o,{content:"yes"})})," ",(0,s.jsx)(t.Button,{id:"buttonCancel",onClick:()=>u(!1),ghost:!0,children:(0,s.jsx)(o,{content:"cancel"})})]})}},2564:(e,n,i)=>{"use strict";i.r(n),i.d(n,{default:()=>t.default});var t=i(2565)},2565:(e,n,i)=>{"use strict";i.r(n),i.d(n,{default:()=>x});var t=i(90),a=i(346),s=i(675),o=i(2566),r=i(297),l=i(2567),d=i(2576),c=i(2570),u=i(620),m=i(296),p=i(668),h=i.n(p),k=i(658),f=i.n(k);const v=t.Locale.getTranslate("components.pages.php-handler.extensions"),g=({params:{id:e}})=>{const n=({phpHandler:{phpExtensions:n,installablePhpExtensions:i}},{cache:t})=>a.filter(n=>n.id!==e).forEach(e=>{const a={};n&&(a.phpExtensions=()=>n),i&&(a.installablePhpExtensions=()=>i),t.modify({id:t.identify(e),fields:a})}),{data:{phpHandler:{version:i,phpExtensions:t,affectedHandlers:a},os:{isUnix:s},config:{php:{pecl:{enabled:o,minVersion:p}}}},client:h}=(0,u.useQuery)(f(),{variables:{id:e},onCompleted:e=>n(e,h)}),[k,g]=(0,m.useState)(!1),x=(0,m.useMemo)(()=>{if(!s||!o)return!1;try{return(0,c.compareVersions)(i,p)>=0}catch{return!0}},[i,s,o,p]);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("p",{children:(0,m.jsx)(v,{content:a.length>1?"descriptionShared":"description",params:{handlers:(0,m.jsx)("b",{children:a.map(({name:e})=>e).join(", ")})}})}),x&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(r.Toolbar,{children:(0,m.jsx)(r.Button,{id:"managePhpExtensions",onClick:()=>g(!0),children:(0,m.jsx)(v,{content:"buttonManage"})})}),(0,m.jsx)(l.default,{id:e,affectedHandlers:a,updateAffectedHandlersCache:n,isOpen:k,onClose:()=>g(!1)})]}),(0,m.jsx)(d.default,{id:e,phpExtensions:t})]})};g.propTypes={params:h().shape({id:h().string.isRequired}).isRequired};const x=(0,s.withPageLayout)((0,o.withPhpSettingsTabs)(g),({params:{id:e}})=>{const{showFrames:n,pageHeader:i,pageSidebar:s}=(0,a.default)(),{data:{phpHandler:{name:o}}}=(0,u.useQuery)(f(),{variables:{id:e}}),r=[s.isPowerUserPanel?null:{title:t.Locale.getSection("admin.controllers.home.admin").lmsg("title"),href:"/admin/home"},{title:t.Locale.getSection("admin.controllers.server.tools").lmsg("title"),href:"/admin/server/tools"},{title:t.Locale.getSection("admin.controllers.php-handler.list").lmsg("title"),href:"/admin/php-handler/list/"},{title:t.Locale.getSection("components.pages.php-handler").lmsg("title",{name:o}),href:`/cp/php/extensions/id/${e}`}].filter(Boolean),l=r[r.length-1].title;return{showFrames:n,pageHeader:{...i,helpMenu:{...i.helpMenu,helpContext:"php-handler.list"}},pageSidebar:s,pageContentHeader:{pageTitle:l,breadcrumbs:r},pageTitle:l}})},2566:(e,n,i)=>{"use strict";i.r(n),i.d(n,{default:()=>m,withPhpSettingsTabs:()=>u});var t=i(296),a=i(599),s=i(297),o=i(90),r=i(718),l=i(668),d=i.n(l);const c=({params:{id:e}})=>{const{pathname:n}=(0,a.useLocation)(),i=(0,t.useMemo)(()=>[{title:o.Locale.getSection("components.pages.php-handler.extensions").lmsg("title"),url:`/cp/php/extensions/id/${e}`,id:"tabExtensions"},{title:o.Locale.getSection("components.pages.php-handler.php-ini").lmsg("title"),url:`/admin/php-handler/php-ini/id/${e}`,id:"tabIniFile"}],[e]),l=(0,t.useMemo)(()=>i.findIndex(({url:e})=>(0,a.matchPath)(e,n))+1,[i,n]);return(0,t.jsx)(s.Tabs,{active:l,children:i.map(({url:e,...n})=>(0,t.jsx)(s.Tab,{component:r.default,to:e,...n},e))})};c.propTypes={params:d().shape({id:d().string.isRequired}).isRequired};const u=e=>{const n=n=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c,{...n}),(0,t.jsx)(e,{...n})]});return n.displayName=`withPhpSettingsTabs(${e.displayName||e.name||"Component"})`,n.WrappedComponent=e,n},m=c},2567:(e,n,i)=>{"use strict";i.r(n),i.d(n,{default:()=>v});var t=i(668),a=i(297),s=i(90),o=i(696),r=i(620),l=i(296),d=i(698),c=i(2568),u=i(2574),m=i.n(u),p=i(2575),h=i.n(p);const k=s.Locale.getTranslate("components.pages.php-handler.extensions.manage"),f=({id:e,affectedHandlers:n,updateAffectedHandlersCache:i,isOpen:t=!1,onClose:s})=>{const{data:u,client:p}=(0,r.useQuery)(m(),{variables:{id:e},skip:!t,onCompleted:e=>i(e,p)}),[f,{loading:v}]=(0,o.useMutation)(h(),{variables:{id:e},onCompleted:({resetPhpExtensionCache:{query:e}})=>i(e,p)}),[g,x]=(0,l.useState)(null);return(0,l.useEffect)(()=>{t&&x(null)},[t]),(0,l.jsx)(d.default,{dataType:"manage-php-extensions",className:"manage-php-extensions",title:(0,l.jsx)(k,{content:"title"}),isOpen:t,onClose:s,task:g,onTaskComplete:f,size:"md",children:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(a.StatusMessage,{intent:"info",children:(0,l.jsx)(k,{content:"risks"})}),(0,l.jsx)("p",{children:(0,l.jsx)(k,{content:"description",params:{handlers:(0,l.jsx)("b",{children:n.map(({name:e})=>e).join(", ")})}})}),u&&!v?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("p",{children:(0,l.jsx)(a.Popover,{target:(0,l.jsx)("a",{children:(0,l.jsx)(k,{content:"notFound"})}),children:(0,l.jsx)(k,{content:"limitations"})})}),(0,l.jsx)(c.default,{...u.phpHandler,setTask:x,onReload:f})]}):(0,l.jsx)(a.ContentLoader,{})]})})};f.propTypes={id:t.PropTypes.string.isRequired,affectedHandlers:t.PropTypes.array.isRequired,updateAffectedHandlersCache:t.PropTypes.func.isRequired,isOpen:t.PropTypes.bool,onClose:t.PropTypes.func.isRequired};const v=f},2568:(e,n,i)=>{"use strict";i.r(n),i.d(n,{default:()=>j});var t=i(668),a=i(297),s=i(90),o=i(1435),r=i(296),l=i(2525),d=i(2569),c=i(696),u=i(546),m=i(2570),p=i(2572),h=i.n(p),k=i(2573),f=i.n(k);const v=s.Locale.getTranslate("admin.components.lists.phpextensions.installable"),g=s.Locale.getSection("admin.components.lists.phpextensions.installable"),x="notInstalled",b="outdated",S="latest",y=e=>{switch(e){case b:return"warning";case S:return"success";default:return"inactive"}},N=(e,n)=>{if(!n)return!1;try{return 1===(0,m.compareVersions)(e,n)}catch{const i=e=>e.split(".").map(e=>parseInt(e)||0).join(".");try{return 1===(0,m.compareVersions)(i(e),i(n))}catch{return!1}}},P=({onSubmit:e,...n})=>{const i=(0,r.useRef)(),[t,s]=(0,r.useState)(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Button,{"data-action":"installCustomPhpExtension",tooltip:(0,r.jsx)(v,{content:"buttonInstallCustomHint"}),onClick:()=>s(!0),ref:i,...n,children:(0,r.jsx)(v,{content:"buttonInstallCustom"})}),(0,r.jsx)(d.default,{targetRef:i,isOpen:t,onSubmit:e,onClose:()=>s(!1)})]})};P.propTypes={onSubmit:t.PropTypes.func.isRequired};const E=({id:e,installablePhpExtensions:n,setTask:i,onReload:t})=>{const s=(0,r.useMemo)(()=>["name","description"],[]),d=(0,r.useMemo)(()=>n.map(({package:e,installedVersion:n,latestVersion:i,...t})=>({key:e.toLowerCase(),name:e,status:N(i,n)?b:n?S:x,installedVersion:n,latestVersion:i,...t})),[n]),[m]=(0,c.useMutation)(h(),{variables:{phpHandlerId:e}}),[p]=(0,c.useMutation)(f(),{variables:{phpHandlerId:e}}),k=(0,r.useCallback)((e,n)=>{const i=({status:e})=>{switch(e){case b:return 0;case S:return 1;default:return 2}},t=i(e),a=i(n);if(ta)return 1;const s=e.name.toLowerCase(),o=n.name.toLowerCase();return so?1:0},[]),E=async e=>{const{data:{installPhpExtension:n}}=await m({variables:{extensionName:e}});i(n)},j=async e=>{try{await E(e)}catch({graphQLErrors:e}){e.forEach(({message:e,debugMessage:n})=>{(0,u.addToast)({intent:"danger",message:n||e})})}};return(0,r.jsx)(o.default,{id:"installable-php-extensions-list",columns:[{key:"status",title:(0,r.jsx)(v,{content:"status"}),sortDataField:"status",sortable:!0,sort:k,render:({status:e,name:n,...i})=>(0,r.jsx)(a.Tooltip,{title:(0,r.jsx)(v,{content:e,params:i}),children:(0,r.jsx)(a.Status,{intent:y(e)})})},{key:"name",title:(0,r.jsx)(v,{content:"name"}),sortDataField:"key",type:"title",sortable:!0,render:({name:e,latestVersion:n,installedVersion:i})=>`${e} (${i||n})`},{key:"description",title:(0,r.jsx)(v,{content:"description"}),sortable:!0,render:({description:e})=>`${e.charAt(0).toUpperCase()}${e.slice(1)}`},{key:"actions",type:"actions",render:({status:e,latestVersion:n,name:t})=>(0,r.jsxs)(a.ListActions,{children:[e===x&&(0,r.jsx)(a.ListAction,{icon:"plus",primary:!0,"data-action":"installPhpExtension",onClick:()=>j(t),children:(0,r.jsx)(v,{content:"actionInstall"})}),e===b&&(0,r.jsx)(a.ListAction,{icon:"arrow-up",primary:!0,"data-action":"upgradePhpExtension",onClick:()=>j(t),children:(0,r.jsx)(v,{content:"actionUpgrade",params:{version:n}})}),(0,r.jsx)(a.ListAction,{icon:"info-circle",primary:!0,component:"a",href:`https://pecl.php.net/package/${t}`,target:"_blank",children:(0,r.jsx)(v,{content:"actionDocs"})}),(0,r.jsx)(a.ListAction,{icon:"recycle",hidden:e===x,primary:!0,"data-action":"uninstallPhpExtension",children:({wrap:e})=>(0,r.jsx)(l.default,{target:e((0,r.jsx)(v,{content:"actionUninstall"})),confirmationText:(0,r.jsx)(v,{content:"uninstallConfirmation",params:{name:t}}),isCritical:!0,onClick:()=>(async e=>{try{const{data:{uninstallPhpExtension:n}}=await p({variables:{extensionName:e}});i(n)}catch({graphQLErrors:e}){e.forEach(({message:e,debugMessage:n})=>{(0,u.addToast)({intent:"danger",message:n||e})})}})(t)})})]})}],data:d,searchField:s,sortColumn:"status",toolbar:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.ToolbarGroup,{title:g.lmsg("groupInstall"),children:(0,r.jsx)(P,{onSubmit:E,intent:"primary"})}),(0,r.jsx)(a.ToolbarGroup,{title:g.lmsg("groupReload"),children:(0,r.jsx)(a.Button,{"data-action":"reloadPhpExtensions",tooltip:(0,r.jsx)(v,{content:"buttonReloadHint"}),onClick:t,children:(0,r.jsx)(v,{content:"buttonReload"})})})]}),searchBarInputProps:{"data-testid":"search-installable-extension"},emptyView:(0,r.jsx)(a.ListEmptyView,{actions:(0,r.jsx)(P,{onSubmit:E})}),emptyFilteredView:(0,r.jsx)(a.ListEmptyView,{reason:"filtered",actions:(0,r.jsx)(P,{onSubmit:E}),title:(0,r.jsx)(v,{content:"emptyViewFilteredTitle"}),description:(0,r.jsx)(v,{content:"emptyViewFilteredDescription"})})})};E.propTypes={id:t.PropTypes.string.isRequired,installablePhpExtensions:t.PropTypes.array.isRequired,setTask:t.PropTypes.func.isRequired,onReload:t.PropTypes.func.isRequired};const j=E},2569:(e,n,i)=>{"use strict";i.r(n),i.d(n,{default:()=>u});var t=i(668),a=i(297),s=i(90),o=i(296),r=i(546);const l=s.Locale.getTranslate("admin.components.forms.php-handler.extension"),d=s.Locale.getTranslate("components.buttons"),c=({isOpen:e=!1,onSubmit:n,onClose:i,...t})=>{const[s,c]=(0,o.useState)({}),[u,m]=(0,o.useState)(null),[p,h]=(0,o.useState)({});(0,o.useEffect)(()=>{e&&(c({extensionName:""}),m(null),h({}))},[e]);return(0,o.jsx)(a.Popover,{title:(0,o.jsx)(l,{content:"title"}),visible:e,onClose:i,...t,children:(0,o.jsx)(a.Form,{values:s,state:u,errors:p,submitButton:{id:"btn-ok",name:"ok",children:(0,o.jsx)(d,{content:"ok"})},applyButton:!1,cancelButton:{id:"btn-cancel",name:"cancel",children:(0,o.jsx)(d,{content:"cancel"}),onClick:i},onSubmit:async({extensionName:e})=>{h(null),m("submit");try{await n(e),i()}catch({graphQLErrors:e}){e.forEach(({message:e,debugMessage:n,extensions:i})=>{"validate"===i.category?h(e=>({...e,...i.messages})):(0,r.addToast)({intent:"danger",message:n||e})})}finally{m(null)}},children:(0,o.jsx)(a.FormFieldText,{name:"extensionName","data-test-id":"custom-package-name",label:(0,o.jsx)(l,{content:"name"}),description:(0,o.jsx)(l,{content:"description"}),required:!0})})})};c.propTypes={isOpen:t.PropTypes.bool,onSubmit:t.PropTypes.func.isRequired,onClose:t.PropTypes.func.isRequired};const u=c},2572:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"InstallPhpExtension"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"phpHandlerId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"extensionName"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"installPhpExtension"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"phpHandlerId"},value:{kind:"Variable",name:{kind:"Name",value:"phpHandlerId"}}},{kind:"ObjectField",name:{kind:"Name",value:"extensionName"},value:{kind:"Variable",name:{kind:"Name",value:"extensionName"}}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"progressTitle"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"progressValue"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"errors"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"output"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"steps"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"progress"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"errors"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"output"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:403}};n.loc.source={body:"mutation InstallPhpExtension($phpHandlerId: ID!, $extensionName: String!) {\n installPhpExtension(input: { phpHandlerId: $phpHandlerId, extensionName: $extensionName }) {\n id\n status\n progressTitle\n progressValue\n errors\n output\n steps {\n title\n progress\n status\n errors\n output\n }\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function i(e,n){if("FragmentSpread"===e.kind)n.add(e.name.value);else if("VariableDefinition"===e.kind){var t=e.type;"NamedType"===t.kind&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(e){i(e,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(e){i(e,n)}),e.definitions&&e.definitions.forEach(function(e){i(e,n)})}var t={};function a(e,n){for(var i=0;i0;){var l=r;r=new Set,l.forEach(function(e){o.has(e)||(o.add(e),(t[e]||new Set).forEach(function(e){r.add(e)}))})}return o.forEach(function(n){var t=a(e,n);t&&i.definitions.push(t)}),i}(n,"InstallPhpExtension")},2573:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UninstallPhpExtension"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"phpHandlerId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"extensionName"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"uninstallPhpExtension"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"phpHandlerId"},value:{kind:"Variable",name:{kind:"Name",value:"phpHandlerId"}}},{kind:"ObjectField",name:{kind:"Name",value:"extensionName"},value:{kind:"Variable",name:{kind:"Name",value:"extensionName"}}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"progressTitle"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"progressValue"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"errors"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"output"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"steps"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"progress"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"errors"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"output"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:407}};n.loc.source={body:"mutation UninstallPhpExtension($phpHandlerId: ID!, $extensionName: String!) {\n uninstallPhpExtension(input: { phpHandlerId: $phpHandlerId, extensionName: $extensionName }) {\n id\n status\n progressTitle\n progressValue\n errors\n output\n steps {\n title\n progress\n status\n errors\n output\n }\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function i(e,n){if("FragmentSpread"===e.kind)n.add(e.name.value);else if("VariableDefinition"===e.kind){var t=e.type;"NamedType"===t.kind&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(e){i(e,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(e){i(e,n)}),e.definitions&&e.definitions.forEach(function(e){i(e,n)})}var t={};function a(e,n){for(var i=0;i0;){var l=r;r=new Set,l.forEach(function(e){o.has(e)||(o.add(e),(t[e]||new Set).forEach(function(e){r.add(e)}))})}return o.forEach(function(n){var t=a(e,n);t&&i.definitions.push(t)}),i}(n,"UninstallPhpExtension")},2574:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"InstallablePhpExtensions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"phpHandler"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"installablePhpExtensions"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"package"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"description"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"installedVersion"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"latestVersion"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:232}};n.loc.source={body:"query InstallablePhpExtensions($id: ID!) {\n phpHandler(id: $id) {\n id\n installablePhpExtensions {\n package\n description\n installedVersion\n latestVersion\n }\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function i(e,n){if("FragmentSpread"===e.kind)n.add(e.name.value);else if("VariableDefinition"===e.kind){var t=e.type;"NamedType"===t.kind&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(e){i(e,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(e){i(e,n)}),e.definitions&&e.definitions.forEach(function(e){i(e,n)})}var t={};function a(e,n){for(var i=0;i0;){var l=r;r=new Set,l.forEach(function(e){o.has(e)||(o.add(e),(t[e]||new Set).forEach(function(e){r.add(e)}))})}return o.forEach(function(n){var t=a(e,n);t&&i.definitions.push(t)}),i}(n,"InstallablePhpExtensions")},2575:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ReloadPhpExtensions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"resetPhpExtensionCache"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"query"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"phpHandler"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"phpExtensions"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"enabled"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"installablePhpExtensions"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"package"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"description"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"installedVersion"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"latestVersion"},arguments:[],directives:[]}]}}]}}]}}]}}]}}],loc:{start:0,end:466}};n.loc.source={body:"mutation ReloadPhpExtensions($id: ID!) {\n resetPhpExtensionCache {\n query {\n phpHandler(id: $id) {\n id\n phpExtensions {\n name\n enabled\n }\n installablePhpExtensions {\n package\n description\n installedVersion\n latestVersion\n }\n }\n }\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function i(e,n){if("FragmentSpread"===e.kind)n.add(e.name.value);else if("VariableDefinition"===e.kind){var t=e.type;"NamedType"===t.kind&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(e){i(e,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(e){i(e,n)}),e.definitions&&e.definitions.forEach(function(e){i(e,n)})}var t={};function a(e,n){for(var i=0;i0;){var l=r;r=new Set,l.forEach(function(e){o.has(e)||(o.add(e),(t[e]||new Set).forEach(function(e){r.add(e)}))})}return o.forEach(function(n){var t=a(e,n);t&&i.definitions.push(t)}),i}(n,"ReloadPhpExtensions")},2576:(e,n,i)=>{"use strict";i.r(n),i.d(n,{default:()=>h});var t=i(90),a=i(297),s=i(668),o=i.n(s),r=i(546),l=i(696),d=i(296),c=i(2577),u=i.n(c);const m=t.Locale.getTranslate("admin.components.lists.phpextensions"),p=({id:e,phpExtensions:n})=>{const[i]=(0,l.useMutation)(u(),{variables:{phpHandlerId:e}}),[t,s]=(0,d.useState)([]);return(0,d.jsx)(a.Grid,{gap:"md",minColumnWidth:200,maxColumnsNumber:6,children:n.map(({name:e,enabled:n})=>(0,d.jsxs)(a.GridCol,{children:[(0,d.jsx)(a.Switch,{checked:n,loading:t.includes(e),tooltip:(0,d.jsx)(m,{content:n?"disable":"enable"}),onChange:()=>(async(e,n)=>{try{s(n=>[...n,e]),await i({variables:{extensionName:e,action:n}})}catch({graphQLErrors:e}){e.forEach(({message:e,debugMessage:n})=>{(0,r.addToast)({intent:"danger",message:n||e})})}finally{s(n=>n.filter(n=>n!==e))}})(e,n?"disable":"enable")})," ",e]},e))})};p.propTypes={id:o().string.isRequired,phpExtensions:o().array.isRequired};const h=p},2577:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"TogglePhpExtension"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"phpHandlerId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"extensionName"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"action"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"TogglePhpExtensionEnum"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"togglePhpExtension"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"phpHandlerId"},value:{kind:"Variable",name:{kind:"Name",value:"phpHandlerId"}}},{kind:"ObjectField",name:{kind:"Name",value:"extensionName"},value:{kind:"Variable",name:{kind:"Name",value:"extensionName"}}},{kind:"ObjectField",name:{kind:"Name",value:"action"},value:{kind:"Variable",name:{kind:"Name",value:"action"}}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"query"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"phpHandler"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"phpHandlerId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"phpExtensions"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"enabled"},arguments:[],directives:[]}]}}]}}]}}]}}]}}],loc:{start:0,end:436}};n.loc.source={body:"mutation TogglePhpExtension($phpHandlerId: ID!, $extensionName: String!, $action: TogglePhpExtensionEnum!) {\n togglePhpExtension(input: { phpHandlerId: $phpHandlerId, extensionName: $extensionName, action: $action }) {\n query {\n phpHandler(id: $phpHandlerId) {\n id\n phpExtensions {\n name\n enabled\n }\n }\n }\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function i(e,n){if("FragmentSpread"===e.kind)n.add(e.name.value);else if("VariableDefinition"===e.kind){var t=e.type;"NamedType"===t.kind&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(e){i(e,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(e){i(e,n)}),e.definitions&&e.definitions.forEach(function(e){i(e,n)})}var t={};function a(e,n){for(var i=0;i0;){var l=r;r=new Set,l.forEach(function(e){o.has(e)||(o.add(e),(t[e]||new Set).forEach(function(e){r.add(e)}))})}return o.forEach(function(n){var t=a(e,n);t&&i.definitions.push(t)}),i}(n,"TogglePhpExtension")}}]); //# sourceMappingURL=extensions.js.map?8f3b2d293e7c138768f3