import { defineComponent, resolveComponent, h } from 'vue';
import { P as PermissionName, A as AuthEntityDelete } from './server.mjs';
import { i as isRealmResourceWritable } from './utils-e4eb8c9d.mjs';
import { SlotName } from '@vue-layout/hyperscript';
import { u as useAuthStore, b as storeToRefs } from './auth-2d06b6ac.mjs';
import { _ as __nuxt_component_0 } from './nuxt-link-5ac46069.mjs';
import 'ofetch';
import 'destr';
import '@unhead/vue';
import '@unhead/dom';
import '@unhead/ssr';
import './page-011b4897.mjs';
import 'vue-router';
import 'defu';
import 'unctx';
import 'h3';
import 'ufo';
import 'hapic';
import 'rapiq';
import '@vue-layout/basic';
import '@vuelidate/validators';
import 'ilingo';
import 'nanoid';
import 'smob';
import 'browser-storage-adapter';
import 'cookie-es';
import 'ohash';
import 'vue/server-renderer';
import './composables-31566dd1.mjs';
import './_plugin-vue_export-helper-cc2b3d55.mjs';
import './config.mjs';
import 'scule';
import '@ucast/mongo2js';
import 'change-case';
import '@ebec/http';
import '@hapic/oauth2';
import 'hookable';

const index = defineComponent({
  emits: ["deleted"],
  setup(props, { emit }) {
    const list = resolveComponent("RobotList");
    const handleDeleted = (e) => {
      emit("deleted", e);
    };
    const store = useAuthStore();
    const { realmManagement, realmManagementId } = storeToRefs(store);
    return () => h(list, {
      onDeleted: handleDeleted,
      query: {
        filter: {
          realm_id: realmManagementId.value
        }
      }
    }, {
      [SlotName.HEADER]: () => h("h6", [
        h("i", { class: "fa-solid fa-list pe-1" }),
        "Overview"
      ]),
      [SlotName.ITEM_ACTIONS]: (props2) => h("div", [
        h(__nuxt_component_0, {
          class: "btn btn-xs btn-outline-primary me-1",
          to: `/admin/robots/${props2.data.id}`,
          disabled: !store.has(PermissionName.ROBOT_EDIT) || !isRealmResourceWritable(realmManagement.value, props2.data.realm_id)
        }, {
          default: () => h("i", { class: "fa fa-bars" })
        }),
        h(AuthEntityDelete, {
          class: "btn btn-xs btn-outline-danger",
          entityId: props2.data.id,
          entityType: "robot",
          withText: false,
          onDeleted: props2.deleted,
          disabled: !store.has(PermissionName.ROBOT_DROP) || !isRealmResourceWritable(realmManagement.value, props2.data.realm_id)
        })
      ])
    });
  }
});

export { index as default };
//# sourceMappingURL=index-16c3c2ae.mjs.map
