// Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ import { storeToRefs } from 'pinia' import { unref } from 'vue' import { useApplicationStore } from '#shared/stores/application.ts' import type { ConfigList } from '#shared/types/store.ts' import type { App } from 'vue' declare module '@vue/runtime-core' { export interface ComponentCustomProperties { $c: ConfigList } } const applicationConfigPlugin = (app: App) => { const application = useApplicationStore() const { config } = storeToRefs(application) Object.defineProperty(app.config.globalProperties, '$c', { enumerable: true, get: () => unref(config), }) } export default applicationConfigPlugin