import{i as e,o as t,r as n}from"./button-DJ30HgDO.js";import{c as r}from"./chunk-EPOLDU6W-Dzz6WSjf.js";import"./free-solid-svg-icons-zCYot7wU.js";import{t as i}from"./use-api-BQhcC0Jo.js";import"./user-service-CruKwI9u.js";import"./toast-context-val-Z-lwvYkJ.js";import"./entity-list-table-zGFxBB5g.js";import"./page-container-DN56Bi3o.js";import"./page-status-Dgf15-K2.js";import"./icon-button-SGdacqAu.js";import"./use-toast-ehNQGp1o.js";import"./input-C5ngh159.js";import"./grant-permission-modal-C0plkvS4.js";import"./edit-permission-modal-CNhpXowl.js";import{t as a}from"./entity-permissions-page-layout-B3wC9Vq0.js";import"./use-all-users-D1dQfQpQ.js";import"./use-all-accounts-qqOdInba.js";import{m as o,p as s}from"./entity-service-Cpn5Fxqr.js";import"./use-all-groups-CdEQrry9.js";var c=t(e(),1);function l({modelName:e}){let{data:t,isLoading:n,error:r,refetch:a}=i((0,c.useCallback)(t=>e===null?Promise.resolve([]):o(e,t),[e]));return{modelUserPermissions:t??[],isLoading:n,error:r,refresh:a}}function u({modelName:e}){let{data:t,isLoading:n,error:r,refetch:a}=i((0,c.useCallback)(t=>e===null?Promise.resolve([]):s(e,t),[e]));return{modelGroupPermissions:t??[],isLoading:n,error:r,refresh:a}}var d=t(n(),1);function f(){let{modelName:e}=r(),{isLoading:t,error:n,refresh:i,modelUserPermissions:o}=l({modelName:e||null}),{isLoading:s,error:c,refresh:f,modelGroupPermissions:p}=u({modelName:e||null}),m=t||s,h=n||c;return e?(0,d.jsx)(a,{title:`Permissions for Model ${e}`,resourceId:e,resourceName:e,resourceType:`models`,userPermissions:o,groupPermissions:p,isLoading:m,error:h,refresh:()=>{i(),f()}}):(0,d.jsx)(`div`,{children:`Model Name is required.`})}export{f as default};