@vc-shell/framework 2.4.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-agent/index.js +3 -3
- package/dist/chunks/{VcAiAgentPanel.vue_vue_type_script_setup_true_lang-Cm_izaFs.js → VcAiAgentPanel.vue_vue_type_script_setup_true_lang-9mBLzIi1.js} +490 -468
- package/dist/chunks/VcAiAgentPanel.vue_vue_type_script_setup_true_lang-9mBLzIi1.js.map +1 -0
- package/dist/chunks/{VcAiAgentPanel.vue_vue_type_style_index_0_lang-DrGobYkj.js → VcAiAgentPanel.vue_vue_type_style_index_0_lang-CZdY18Hq.js} +74 -68
- package/dist/chunks/{VcAiAgentPanel.vue_vue_type_style_index_0_lang-DrGobYkj.js.map → VcAiAgentPanel.vue_vue_type_style_index_0_lang-CZdY18Hq.js.map} +1 -1
- package/dist/chunks/{VcScheduler.vue_vue_type_script_setup_true_lang-B-xA79lJ.js → VcScheduler.vue_vue_type_script_setup_true_lang-BmlVL_rn.js} +6388 -6183
- package/dist/chunks/VcScheduler.vue_vue_type_script_setup_true_lang-BmlVL_rn.js.map +1 -0
- package/dist/chunks/{VcScheduler.vue_vue_type_style_index_0_lang-BSvjI-39.js → VcScheduler.vue_vue_type_style_index_0_lang-BTg4PjTB.js} +533 -521
- package/dist/chunks/VcScheduler.vue_vue_type_style_index_0_lang-BTg4PjTB.js.map +1 -0
- package/dist/chunks/dashboard-feed-row.vue_vue_type_script_setup_true_lang-BCsJG_hk.js +724 -0
- package/dist/chunks/dashboard-feed-row.vue_vue_type_script_setup_true_lang-BCsJG_hk.js.map +1 -0
- package/dist/chunks/{index-C-SEYj46.js → index-B7RhGTNx.js} +2 -2
- package/dist/chunks/{index-C-SEYj46.js.map → index-B7RhGTNx.js.map} +1 -1
- package/dist/core/blade-navigation/utils/bladeRouterGuard.d.ts +1 -2
- package/dist/core/blade-navigation/utils/bladeRouterGuard.d.ts.map +1 -1
- package/dist/core/composables/index.d.ts +1 -0
- package/dist/core/composables/index.d.ts.map +1 -1
- package/dist/core/composables/useLatestRequest/index.d.ts +43 -0
- package/dist/core/composables/useLatestRequest/index.d.ts.map +1 -0
- package/dist/core/composables/usePopup/index.d.ts +12 -3
- package/dist/core/composables/usePopup/index.d.ts.map +1 -1
- package/dist/core/composables/usePopup/keys.d.ts +3 -1
- package/dist/core/composables/usePopup/keys.d.ts.map +1 -1
- package/dist/core/composables/usePopup/types.d.ts +32 -1
- package/dist/core/composables/usePopup/types.d.ts.map +1 -1
- package/dist/core/interceptors/index.d.ts.map +1 -1
- package/dist/core/plugins/ai-agent/components/VcAiAgentPanel.vue.d.ts +4 -1
- package/dist/core/plugins/ai-agent/components/VcAiAgentPanel.vue.d.ts.map +1 -1
- package/dist/core/plugins/ai-agent/services/ai-agent-service.d.ts.map +1 -1
- package/dist/core/plugins/ai-agent/services/message-transport.d.ts +2 -0
- package/dist/core/plugins/ai-agent/services/message-transport.d.ts.map +1 -1
- package/dist/core/plugins/ai-agent/types.d.ts +1 -1
- package/dist/core/plugins/ai-agent/types.d.ts.map +1 -1
- package/dist/core/utilities/error.d.ts.map +1 -1
- package/dist/core/utilities/focus.d.ts +25 -0
- package/dist/core/utilities/focus.d.ts.map +1 -0
- package/dist/core/utilities/index.d.ts +1 -0
- package/dist/core/utilities/index.d.ts.map +1 -1
- package/dist/core/utilities/sessionExpiration.d.ts +14 -0
- package/dist/core/utilities/sessionExpiration.d.ts.map +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/framework.js +1300 -1262
- package/dist/framework.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/injection-keys.d.ts +1 -2
- package/dist/injection-keys.d.ts.map +1 -1
- package/dist/locales/de.js +3 -0
- package/dist/locales/en.js +3 -0
- package/dist/locales/en.json +3 -0
- package/dist/locales/types.d.ts +3 -0
- package/dist/shell/_internal/blade-navigation/components/vc-blade-navigation/focus-target.d.ts +20 -0
- package/dist/shell/_internal/blade-navigation/components/vc-blade-navigation/focus-target.d.ts.map +1 -0
- package/dist/shell/_internal/blade-navigation/components/vc-blade-navigation/vc-blade-navigation-new.vue.d.ts.map +1 -1
- package/dist/shell/_internal/blade-navigation/components/vc-blade-slot/vc-blade-slot.vue.d.ts +5 -0
- package/dist/shell/_internal/blade-navigation/components/vc-blade-slot/vc-blade-slot.vue.d.ts.map +1 -1
- package/dist/shell/_internal/popup/components/vc-popup-container/PopupInstanceProvider.vue.d.ts +30 -0
- package/dist/shell/_internal/popup/components/vc-popup-container/PopupInstanceProvider.vue.d.ts.map +1 -0
- package/dist/shell/_internal/popup/components/vc-popup-container/vc-popup-container.vue.d.ts.map +1 -1
- package/dist/shell/auth/ChangePasswordPage/components/change-password/ChangePassword.vue.d.ts.map +1 -1
- package/dist/shell/auth/InvitePage/components/invite/Invite.vue.d.ts.map +1 -1
- package/dist/shell/auth/ResetPasswordPage/components/reset-password/ResetPassword.vue.d.ts.map +1 -1
- package/dist/shell/components/change-password/change-password.vue.d.ts.map +1 -1
- package/dist/shell/dashboard/draggable-dashboard/GridstackDashboard.vue.d.ts.map +1 -1
- package/dist/shell/dashboard/draggable-dashboard/composables/useGridstack.d.ts +5 -8
- package/dist/shell/dashboard/draggable-dashboard/composables/useGridstack.d.ts.map +1 -1
- package/dist/shell/dashboard/draggable-dashboard/composables/useGridstackAdapter.d.ts +6 -6
- package/dist/shell/dashboard/draggable-dashboard/composables/useGridstackAdapter.d.ts.map +1 -1
- package/dist/shell/dashboard/draggable-dashboard/types.d.ts +11 -0
- package/dist/shell/dashboard/draggable-dashboard/types.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/molecules/vc-color-input/vc-color-input.vue.d.ts +2 -2
- package/dist/ui/components/molecules/vc-date-picker/vc-date-picker.vue.d.ts +2 -2
- package/dist/ui/components/molecules/vc-input/vc-input.vue.d.ts +2 -2
- package/dist/ui/components/molecules/vc-multivalue/_internal/MultivalueTrigger.vue.d.ts +2 -2
- package/dist/ui/components/molecules/vc-popover/vc-popover.vue.d.ts +4 -0
- package/dist/ui/components/molecules/vc-popover/vc-popover.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-select/_internal/SelectTrigger.vue.d.ts +2 -2
- package/dist/ui/components/organisms/vc-app/_internal/app-bar/components/MenuSidebar.vue.d.ts +1 -0
- package/dist/ui/components/organisms/vc-app/_internal/app-bar/components/MenuSidebar.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/layouts/DesktopLayout.vue.d.ts +8 -0
- package/dist/ui/components/organisms/vc-app/_internal/layouts/DesktopLayout.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/layouts/MobileLayout.vue.d.ts +5 -0
- package/dist/ui/components/organisms/vc-app/_internal/layouts/MobileLayout.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/sidebar/SidebarHeader.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/_internal/BladeHeader.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/useBladeSkeleton.d.ts +16 -0
- package/dist/ui/components/organisms/vc-blade/useBladeSkeleton.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-data-table/VcDataTable.vue.d.ts +1 -2
- package/dist/ui/components/organisms/vc-data-table/VcDataTable.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-data-table/components/GlobalFiltersPanel.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-data-table/components/TableSearchHeader.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-data-table/components/mobile/PullToRefresh.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-scheduler/VcScheduler.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-scheduler/_internal/SchedulerToolbar.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-scheduler/_internal/month/MonthEventBar.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-scheduler/_internal/month/MonthMorePopover.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-scheduler/_internal/month/MonthWeekRow.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-scheduler/_internal/views/SchedulerTimelineView.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-scheduler/composables/useTimelineTimeGrid.d.ts +2 -0
- package/dist/ui/components/organisms/vc-scheduler/composables/useTimelineTimeGrid.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-sidebar/vc-sidebar.vue.d.ts +1 -0
- package/dist/ui/components/organisms/vc-sidebar/vc-sidebar.vue.d.ts.map +1 -1
- package/dist/ui/composables/useDataTablePagination.d.ts +22 -1
- package/dist/ui/composables/useDataTablePagination.d.ts.map +1 -1
- package/dist/ui/index.js +3 -3
- package/package.json +4 -4
- package/dist/chunks/VcAiAgentPanel.vue_vue_type_script_setup_true_lang-Cm_izaFs.js.map +0 -1
- package/dist/chunks/VcScheduler.vue_vue_type_script_setup_true_lang-B-xA79lJ.js.map +0 -1
- package/dist/chunks/VcScheduler.vue_vue_type_style_index_0_lang-BSvjI-39.js.map +0 -1
- package/dist/chunks/dashboard-feed-row.vue_vue_type_script_setup_true_lang-BXDneKBz.js +0 -679
- package/dist/chunks/dashboard-feed-row.vue_vue_type_script_setup_true_lang-BXDneKBz.js.map +0 -1
package/dist/framework.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framework.js","sources":["../core/utilities/camelToSnake.ts","../core/utilities/kebabToCamel.ts","../core/utilities/camelize.ts","../core/utilities/assets.ts","../core/plugins/permissions/index.ts","../core/notifications/composables/useBladeNotifications.ts","../core/notifications/composables/useNotificationContext.ts","../core/notifications/composables/useBroadcastFilter.ts","../core/notifications/toast-types.ts","../core/plugins/signalR/index.ts","../core/blade-navigation/table-query-state/useTableQueryState.ts","../core/plugins/modularity/index.ts","../core/blade-navigation/utils/restoreFromUrl.ts","../core/blade-navigation/utils/bladeRouterGuard.ts","../shell/_internal/blade-navigation/plugin-v2.ts","../core/constants/defaults.ts","../shell/_internal/popup/common/vc-popup-base.vue","../shell/_internal/popup/common/vc-popup-warning.vue","../shell/_internal/popup/common/vc-popup-error.vue","../shell/_internal/popup/common/vc-popup-info.vue","../shell/_internal/popup/register-presets.ts","../shell/_internal/popup/plugin.ts","../core/composables/useFunctions/debounce.ts","../core/composables/useFunctions/delay.ts","../core/composables/useFunctions/once.ts","../core/composables/useFunctions/throttle.ts","../core/composables/useFunctions/index.ts","../core/composables/useNotifications/index.ts","../core/composables/useAsync/index.ts","../core/composables/useApiClient/index.ts","../core/composables/useLoading/index.ts","../core/composables/useSettings/index.ts","../core/composables/useAssets/index.ts","../core/composables/useAssetsManager/index.ts","../core/composables/useBeforeUnload/index.ts","../core/composables/useDynamicProperties/utils.ts","../core/composables/useDynamicProperties/strategies/regular.ts","../core/composables/useDynamicProperties/strategies/boolean.ts","../core/composables/useDynamicProperties/strategies/dictionary.ts","../core/composables/useDynamicProperties/strategies/measure.ts","../core/composables/useDynamicProperties/strategies/color.ts","../core/composables/useDynamicProperties/strategies/index.ts","../core/composables/useDynamicProperties/index.ts","../core/composables/useWebVitals/index.ts","../core/composables/useBladeWidgets/index.ts","../core/composables/bladeContext/index.ts","../core/composables/useModificationTracker/index.ts","../modules/assets/components/assets-details/assets-details.vue","../modules/assets/components/assets-details/index.ts","../modules/assets/index.ts","../modules/assets-manager/components/assets-manager/assets-manager.vue","../modules/assets-manager/components/assets-manager/index.ts","../modules/assets-manager/index.ts","../core/composables/useConnectionStatus/index.ts","../core/composables/useSlowNetworkDetection/index.ts","../core/interceptors/index.ts","../core/plugins/global-error-handler/index.ts","../shell/_internal/notifications/composables/useInstance/index.ts","../shell/_internal/notifications/composables/useContainer/index.ts","../shell/_internal/notifications/register-backend.ts","../core/utilities/buildInfo.ts","../shell/components/sidebar/sidebar.vue","../shell/components/sidebar/index.ts","../shell/auth/sign-in/external-provider.vue","../shell/auth/sign-in/external-providers.vue","../shell/auth/utils.ts","../shell/auth/LoginPage/components/login/Login.vue","../shell/auth/LoginPage/components/login/index.ts","../shell/auth/ForgotPasswordPage/components/forgot-password/ForgotPassword.vue","../shell/auth/ForgotPasswordPage/components/forgot-password/index.ts","../shell/auth/ResetPasswordPage/components/reset-password/ResetPassword.vue","../shell/auth/ResetPasswordPage/components/reset-password/index.ts","../shell/auth/InvitePage/components/invite/Invite.vue","../shell/auth/InvitePage/components/invite/index.ts","../shell/auth/ChangePasswordPage/components/change-password/ChangePassword.vue","../shell/auth/ChangePasswordPage/components/change-password/index.ts","../core/composables/useBladeNavigationAdapter/index.ts","../core/composables/useBladeForm/index.ts","../shell/_internal/notifications/components/notification-container/computeToastOffsets.ts","../shell/_internal/notifications/components/notification-container/useToastStack.ts","../shell/_internal/notifications/components/notification-container/index.ts","../index.ts"],"sourcesContent":["export function camelToSnake(str: string): string {\r\n return str\r\n .replace(/[\\w]([A-Z])/g, function (m) {\r\n return m[0] + \"_\" + m[1];\r\n })\r\n .toLowerCase();\r\n}\r\n","export const kebabToCamel = (str: string) => str.replace(/-./g, (x) => x[1].toUpperCase());\r\n\r\nexport function kebabToPascal(str: string) {\r\n const camelCase = kebabToCamel(str);\r\n const pascalCase = camelCase[0].toUpperCase() + camelCase.substring(1);\r\n return pascalCase;\r\n}\r\n","export function camelize(str: string) {\r\n return str.replace(/\\W+(.)/g, function (match, chr) {\r\n return chr.toUpperCase();\r\n });\r\n}\r\n","const imageExtensions = new Set([\"png\", \"jpg\", \"jpeg\", \"svg\", \"gif\"]);\n\nfunction getExtension(fileName: string) {\n return fileName.split(\".\").pop()?.toLowerCase();\n}\n\nfunction isImage(name: string | undefined) {\n if (!name) return false;\n return imageExtensions.has(getExtension(name) ?? \"\");\n}\n\nfunction readableSize(bytes: number | undefined, decimals = 2) {\n if (!bytes) return \"0 Bytes\";\n\n const k = 1024;\n const dm = decimals < 0 ? 0 : decimals;\n const sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\"];\n\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n\n return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`;\n}\n\nconst extensionColors: Record<string, string> = {\n pdf: \"#e74c3c\",\n doc: \"#2b579a\",\n docx: \"#2b579a\",\n xls: \"#217346\",\n xlsx: \"#217346\",\n ppt: \"#d35230\",\n pptx: \"#d35230\",\n csv: \"#16a085\",\n zip: \"#f39c12\",\n mp3: \"#e67e22\",\n aac: \"#e67e22\",\n mp4: \"#8e44ad\",\n avi: \"#8e44ad\",\n};\n\nfunction getExtensionColor(name: string | undefined): string {\n if (!name) return \"var(--neutrals-400)\";\n const ext = getExtension(name) ?? \"\";\n return extensionColors[ext] ?? \"var(--neutrals-400)\";\n}\n\nfunction getExtensionLabel(name: string | undefined): string {\n if (!name) return \"FILE\";\n return (getExtension(name) ?? \"FILE\").toUpperCase();\n}\n\nexport { isImage, readableSize, getExtensionColor, getExtensionLabel };\n","import { usePermissions } from \"@core/composables/usePermissions\";\r\nimport { App } from \"vue\";\r\n\r\nexport const permissions = {\r\n install(app: App) {\r\n const { hasAccess } = usePermissions();\r\n app.config.globalProperties.$hasAccess = hasAccess;\r\n },\r\n};\r\n","import { computed, onScopeDispose, getCurrentScope } from \"vue\";\nimport { PushNotification } from \"@core/api/platform\";\nimport { useNotificationStore } from \"./useNotificationStore\";\nimport type { BladeNotificationOptions, BladeNotificationReturn } from \"../types\";\n\n/**\n * Blade-level notification subscription.\n *\n * Level 2 (additive): provides blade-specific behavior on top of\n * the always-on module config (Level 1). When the blade unmounts,\n * only blade-specific behavior stops — dropdown and toasts continue.\n *\n * Must be called within a component setup or effectScope.\n */\nexport function useBladeNotifications<T extends PushNotification = PushNotification>(\n options: BladeNotificationOptions<T>,\n): BladeNotificationReturn<T> {\n const store = useNotificationStore();\n\n // Subscribe with handler\n const unsub = store.subscribe({\n types: options.types,\n filter: options.filter as ((msg: PushNotification) => boolean) | undefined,\n handler: options.onMessage as ((msg: PushNotification) => void) | undefined,\n });\n\n // Auto-cleanup if within a scope\n if (getCurrentScope()) {\n onScopeDispose(unsub);\n }\n\n // Filtered messages from realtime\n const messages = computed(() =>\n store.realtime.value.filter((msg): msg is T => {\n if (!msg.notifyType || !options.types.includes(msg.notifyType)) return false;\n if (!msg.isNew) return false;\n if (options.filter && !(options.filter as (m: PushNotification) => boolean)(msg)) return false;\n return true;\n }),\n );\n\n const unreadCount = computed(() => messages.value.length);\n\n function markAsRead(msg: T) {\n store.markAsRead(msg);\n }\n\n return {\n messages,\n unreadCount,\n markAsRead,\n };\n}\n","import { inject, type ComputedRef } from \"vue\";\nimport { PushNotification } from \"@core/api/platform\";\nimport { NotificationContextKey } from \"../types\";\n\nexport function useNotificationContext<T extends PushNotification = PushNotification>(): ComputedRef<T> {\n const ctx = inject(NotificationContextKey);\n if (!ctx) {\n throw new Error(\"useNotificationContext() must be used inside a notification template\");\n }\n return ctx as ComputedRef<T>;\n}\n","import { PushNotification } from \"@core/api/platform\";\nimport { useNotificationStore } from \"./useNotificationStore\";\n\nexport interface UseBroadcastFilterReturn {\n setBroadcastFilter(fn: (msg: PushNotification) => boolean): void;\n clearBroadcastFilter(): void;\n}\n\nexport function useBroadcastFilter(): UseBroadcastFilterReturn {\n const store = useNotificationStore();\n return {\n setBroadcastFilter: store.setBroadcastFilter,\n clearBroadcastFilter: store.clearBroadcastFilter,\n };\n}\n","import { VNode, DefineComponent, InjectionKey, Ref } from \"vue\";\n\nexport type NotificationType = \"success\" | \"error\" | \"warning\" | \"default\";\n\nexport interface NotificationOptions {\n pauseOnHover?: boolean;\n timeout?: number | boolean;\n content?: Content;\n notificationId?: number | string;\n type?: NotificationType;\n onOpen?: <T>(payload: T) => void;\n onClose?: <T>(payload: T) => void;\n\n payload?: string | Record<string, any>;\n updateId?: string | number;\n position?: NotificationPosition;\n /** Set by `actions.dismiss()` to trigger exit animation in VcToast */\n dismissing?: boolean;\n}\n\n// Adding a new type for notification positioning\nexport type NotificationPosition =\n | \"top-center\"\n | \"top-right\"\n | \"top-left\"\n | \"bottom-center\"\n | \"bottom-right\"\n | \"bottom-left\";\n\nexport type Content = string | VNode | DefineComponent<{}, {}, any>;\n\nexport interface NotificationContainerState {\n notificationContainers: Record<NotificationPosition, Ref<NotificationOptions[]>>;\n actions: {\n remove(id: string | number): void;\n clear(): void;\n };\n}\n\nexport const NotificationContainerStateKey: InjectionKey<NotificationContainerState> =\n Symbol(\"NotificationContainerState\");\n","import { type App, watch } from \"vue\";\nimport { HubConnectionBuilder, LogLevel } from \"@microsoft/signalr\";\nimport { PushNotification } from \"@core/api/platform\";\nimport { useNotificationStore } from \"@core/notifications\";\nimport { useUserManagement } from \"@core/composables/useUserManagement\";\nimport { useCypressSignalRMock } from \"cypress-signalr-mock\";\nimport { createLogger } from \"@core/utilities\";\n\nconst logger = createLogger(\"signalR\");\n\nexport const signalR = {\n install(_app: App) {\n const store = useNotificationStore();\n const { isAuthenticated } = useUserManagement();\n let reconnect = false;\n const connection =\n useCypressSignalRMock(\"pushNotificationHub\", { enableForVitest: true }) ??\n new HubConnectionBuilder()\n .withUrl(\"/pushNotificationHub\")\n .withAutomaticReconnect()\n .configureLogging(LogLevel.Information)\n .build();\n\n const start = () => {\n connection\n .start()\n .then(() => {\n logger.info(\"Connected.\");\n })\n .catch((err: unknown) => {\n logger.error(\"Connection Error: \", err);\n setTimeout(() => start(), 5000);\n });\n };\n\n async function stop() {\n await connection.stop();\n }\n\n connection.onclose(() => {\n if (reconnect) start();\n });\n\n connection.on(\"Send\", (message: PushNotification) => {\n store.ingest(message);\n });\n\n connection.on(\"SendSystemEvents\", (message: PushNotification) => {\n store.ingest(message, { broadcast: true });\n });\n\n watch(\n isAuthenticated,\n async (value) => {\n if (value) {\n reconnect = true;\n start();\n } else {\n reconnect = false;\n await stop();\n }\n },\n { immediate: true },\n );\n },\n};\n","import { inject } from \"vue\";\nimport { TableQueryStateKey, type TableQueryPatch } from \"./types\";\n\nexport interface UseTableQueryStateReturn {\n /**\n * Read the table view state (sort/search/page) restored from the URL for this\n * table. Returns an empty patch when no persistence service is provided (a\n * standalone table or a non-URL blade), so callers can use it unconditionally.\n */\n read(): TableQueryPatch;\n}\n\n/**\n * Reads the table view state (sort/search/page) restored from the URL.\n *\n * A list page calls this in `setup`, reads `{ sort, search, page }`, and seeds its\n * own refs before its loader runs, so a reload makes one request. Read-only: the\n * write-back (view state → URL) stays inside VcDataTable via useTableQueryPersistence.\n *\n * @param stateKey The same `state-key` passed to VcDataTable for this table.\n */\nexport function useTableQueryState(stateKey?: string): UseTableQueryStateReturn {\n const service = inject(TableQueryStateKey, undefined);\n\n return {\n read: () => (service ? service.read(stateKey) : {}),\n };\n}\n","import { App, Component, inject } from \"vue\";\nimport { i18n } from \"@core/plugins/i18n\";\nimport type { BladeInstanceConstructor } from \"@core/blade-navigation/types\";\nimport { createLogger } from \"@core/utilities\";\nimport { useNotificationStore } from \"@core/notifications\";\nimport type { ModuleNotificationsConfig } from \"@core/notifications\";\nimport { notification } from \"@core/notifications/notification\";\nimport { BladeRegistryKey, IBladeRegistryInstance } from \"@core/composables/useBladeRegistry\";\n\nconst logger = createLogger(\"modularity\");\n\n/**\n * Options for defineAppModule.\n */\nexport interface DefineAppModuleOptions {\n /** Blade components for BladeRegistry registration */\n blades?: Record<string, BladeInstanceConstructor>;\n /** Locales for vue-i18n merge */\n locales?: Record<string, object>;\n /** @deprecated Use `notifications` instead */\n notificationTemplates?: Record<string, Component & { notifyType?: string }>;\n /** Notification type configurations (new API) */\n notifications?: ModuleNotificationsConfig;\n}\n\n/**\n * Creates an app module plugin with explicit registration intent.\n *\n * @example\n * ```ts\n * export default defineAppModule({\n * blades: { OrdersList, OrderDetails },\n * locales: { en, de },\n * });\n * ```\n */\nexport function defineAppModule(options: DefineAppModuleOptions) {\n const { blades, locales, notificationTemplates, notifications } = options;\n\n return {\n install(app: App): void {\n const store = useNotificationStore();\n\n // Step 1: Blade registration (only if blades provided)\n if (blades && Object.keys(blades).length > 0) {\n const bladeRegistry = app.runWithContext(() => inject<IBladeRegistryInstance>(BladeRegistryKey));\n\n if (!bladeRegistry?._registerBladeFn) {\n logger.error(\"defineAppModule: BladeRegistry not found. Blade registration will be skipped.\");\n } else {\n for (const [exportKey, component] of Object.entries(blades)) {\n const name = component.name || exportKey;\n app.runWithContext(() => {\n bladeRegistry._registerBladeFn(name, {\n component,\n route: component.url,\n isWorkspace: component.isWorkspace || false,\n routable: component.routable !== false,\n permissions: component.permissions,\n });\n });\n }\n }\n }\n\n // Step 2: Register notification types (new API)\n if (notifications) {\n for (const [type, config] of Object.entries(notifications)) {\n store.registerType(type, config);\n }\n }\n\n // Step 3: Legacy notification support (deprecated)\n if (!notifications && notificationTemplates) {\n for (const template of Object.values(notificationTemplates)) {\n const type = template.notifyType;\n if (type) {\n store.registerType(type, {\n template: template as Component,\n toast: { mode: \"auto\" },\n });\n }\n }\n }\n\n // Step 3b: Legacy blade notifyType compat shim (deprecated)\n if (blades) {\n for (const component of Object.values(blades)) {\n if (component.notifyType) {\n const notifyTypes = Array.isArray(component.notifyType) ? component.notifyType : [component.notifyType];\n\n // Skip if notifications config already handles these types\n const unhandledTypes = notifyTypes.filter((t) => !store.registry.has(t));\n if (unhandledTypes.length > 0) {\n // Permanent subscription — no cleanup needed (app lifetime)\n store.subscribe({\n types: notifyTypes,\n handler: (message) => {\n if (message.title) {\n notification(message.title, {\n onClose() {\n store.markAsRead(message);\n },\n });\n }\n },\n });\n\n if (import.meta.env.DEV) {\n logger.warn(\n `[vc-shell] notifyType on blade \"${component.name}\" is deprecated. ` +\n `Use useBladeNotifications() inside the blade instead. ` +\n `See: MIGRATION_GUIDE.md#notifications`,\n );\n }\n }\n }\n }\n }\n\n // Step 4: Locale merge\n if (locales) {\n for (const [key, message] of Object.entries(locales)) {\n i18n.global.mergeLocaleMessage(key, message);\n }\n }\n },\n };\n}\n\n/**\n * @deprecated Use `defineAppModule()` instead. This function is a backward-compatible\n * adapter that delegates to `defineAppModule`. It will be removed in a future major version.\n *\n * @example\n * ```ts\n * // Before:\n * export default createAppModule(pages, locales);\n * // After:\n * export default defineAppModule({ blades: pages, locales });\n * ```\n */\nexport function createAppModule(\n pages: Record<string, BladeInstanceConstructor>,\n locales?: Record<string, object>,\n notificationTemplates?: Record<string, Component & { notifyType?: string }>,\n _components?: Record<string, Component>,\n) {\n return defineAppModule({\n blades: pages,\n locales,\n notificationTemplates,\n });\n}\n","import type { Router } from \"vue-router\";\nimport type { IBladeRegistry } from \"@core/composables/useBladeRegistry\";\nimport type { IBladeStack, ParsedBladeUrl } from \"@core/blade-navigation/types\";\nimport { navigateToMainRoute } from \"./navigateToMainRoute\";\nimport { notification } from \"@core/notifications/notification\";\nimport { i18n } from \"@core/plugins\";\n\n/**\n * Restore the blade stack from a parsed URL.\n *\n * Used on initial page load and when navigating via URL (not back/forward).\n * Resolves URL segments to blade names via BladeRegistry, then opens\n * workspace + child blade.\n *\n * Returns `true` if the URL contained segments for a non-routable blade\n * that was skipped — the caller should clean up the URL to match the\n * actual blade stack state.\n *\n * @param bladeStack - The BladeStack to populate\n * @param bladeRegistry - Registry for resolving URLs → blade names\n * @param parsed - Parsed URL segments\n * @param hasAccess - Optional permission check function\n * @param router - Optional router for redirecting on access denial\n * @param routeParams - Route params to preserve on redirect (e.g. sellerId for tenant prefix)\n * @returns `true` if the URL needs cleanup (non-routable blade was skipped)\n */\nexport async function restoreFromUrl(\n bladeStack: IBladeStack,\n bladeRegistry: IBladeRegistry,\n parsed: ParsedBladeUrl,\n hasAccess?: (permissions: string | string[] | undefined) => boolean,\n router?: Router,\n routeParams?: Record<string, string>,\n): Promise<boolean> {\n // Skip if no workspace URL to restore\n if (!parsed.workspaceUrl) return false;\n\n // Find workspace blade by URL segment\n const workspaceMatch = bladeRegistry.getBladeByRoute(parsed.workspaceUrl);\n\n // Guard 1: blade not found\n if (!workspaceMatch) {\n console.warn(`[restoreFromUrl] No workspace blade found for URL segment '${parsed.workspaceUrl}'`);\n if (router) navigateToMainRoute(router, routeParams);\n return false;\n }\n\n // Guard 2: not a workspace\n if (!workspaceMatch.data.isWorkspace) {\n console.warn(\n `[restoreFromUrl] Blade '${workspaceMatch.name}' matched URL '${parsed.workspaceUrl}' but is not a workspace`,\n );\n if (router) navigateToMainRoute(router, routeParams);\n return false;\n }\n\n // Guard 3: permissions\n // Note: openWorkspace() also checks permissions as a safety net (defense-in-depth),\n // but we check here first to redirect and show toast before the workspace is opened.\n if (hasAccess && workspaceMatch.data.permissions && !hasAccess(workspaceMatch.data.permissions)) {\n console.warn(`[restoreFromUrl] Access denied to workspace '${workspaceMatch.name}'`);\n notification.error(i18n.global.t(\"PERMISSION_MESSAGES.ACCESS_RESTRICTED\"), { timeout: 3000 });\n if (router) navigateToMainRoute(router, routeParams);\n return false;\n }\n\n // Open workspace (if not already the current one)\n const currentWorkspace = bladeStack.workspace.value;\n if (currentWorkspace?.name !== workspaceMatch.name) {\n await bladeStack.openWorkspace({ name: workspaceMatch.name });\n }\n\n // If there's a child blade URL, open it (if not already open with matching param)\n if (parsed.bladeUrl) {\n const bladeMatch = bladeRegistry.getBladeByRoute(parsed.bladeUrl);\n if (bladeMatch) {\n // Idempotency: skip if child already exists with same name and param.\n // This means the blade was opened programmatically (normal operation)\n // and syncUrlPush just triggered the guard — not a page restore.\n const existingChild = bladeStack.blades.value.find((b) => b.name === bladeMatch.name && b.param === parsed.param);\n if (existingChild) {\n return false;\n }\n\n // Non-routable blades should not be restored from URL.\n // Signal the caller to clean the URL.\n if (bladeMatch.data.routable === false) {\n return true;\n }\n\n await bladeStack.openBlade({\n name: bladeMatch.name,\n param: parsed.param,\n // options not available from URL — blade must handle gracefully\n });\n } else {\n console.warn(`[restoreFromUrl] No blade found for URL segment '${parsed.bladeUrl}'`);\n }\n }\n\n return false;\n}\n","import type { RouteLocationNormalized } from \"vue-router\";\nimport type { Router } from \"vue-router\";\nimport type { UseBladeRegistryReturn } from \"@core/composables/useBladeRegistry\";\nimport type { IBladeStack } from \"@core/blade-navigation/types\";\nimport { parseBladeUrl, buildUrlFromStack } from \"@core/blade-navigation/utils/urlSync\";\nimport { restoreFromUrl } from \"@core/blade-navigation/utils/restoreFromUrl\";\n\n/**\n * Result of the blade router guard.\n *\n * - `undefined` — allow navigation (no redirect)\n * - `false` — cancel navigation (e.g. beforeClose guard prevented closing)\n * - `{ path, query, replace }` — redirect to cleaned-up URL\n */\nexport type BladeGuardResult = undefined | false | { path: string; query: Record<string, string>; replace: true };\n\nasync function clearBladeStackRespectingGuards(bladeStack: IBladeStack): Promise<boolean> {\n while (bladeStack.blades.value.length > 1) {\n const bladesBeforeClose = bladeStack.blades.value;\n const lastBlade = bladesBeforeClose[bladesBeforeClose.length - 1];\n const prevented = await bladeStack.closeBlade(lastBlade.id);\n\n if (prevented) {\n return false;\n }\n\n // Defensive exit to avoid infinite loops if stack doesn't change unexpectedly.\n if (bladeStack.blades.value.length >= bladesBeforeClose.length) {\n return false;\n }\n }\n\n if (bladeStack.blades.value.length > 0) {\n bladeStack._restoreStack([]);\n }\n\n return true;\n}\n\n/**\n * Router guard that syncs URL navigation with the BladeStack.\n *\n * Determines whether a navigation target is a real Vue Router page\n * or a blade URL handled by the catch-all route:\n *\n * - **Real child routes** (e.g. \"Platform\", \"Dashboard\"): clears any open\n * blades and lets Vue Router render the page.\n * - **Blade catch-all route**: parses URL segments and restores the\n * blade stack (workspace + optional child blade).\n *\n * The catch-all route is identified by `meta.bladeCatchAll`, which is set\n * by the BladeNavigationPlugin when it registers the catch-all.\n */\nexport async function bladeRouterGuard(\n to: RouteLocationNormalized,\n bladeStack: IBladeStack,\n bladeRegistry: UseBladeRegistryReturn,\n hasAccess?: (permissions: string | string[] | undefined) => boolean,\n router?: Router,\n): Promise<BladeGuardResult> {\n // Only process routes under the root (App) route\n if (!to.matched.some((r) => r.meta?.root)) return undefined;\n\n // Only run blade restoration when the URL matches the blade catch-all route.\n // Real Vue Router child routes (e.g. \"Platform\", \"Dashboard\") should be\n // handled by Vue Router normally — not interpreted as blade URL segments.\n const isBladeCatchAll = to.matched.some((r) => r.meta?.bladeCatchAll);\n if (!isBladeCatchAll) {\n // Clear any open blades so the page renders without stale blade state\n if (bladeStack.blades.value.length > 0) {\n const wasCleared = await clearBladeStackRespectingGuards(bladeStack);\n if (!wasCleared) {\n return false;\n }\n }\n return undefined;\n }\n\n // Extract tenant prefix from route params (first param, typically sellerId)\n const tenantPrefix = (Object.values(to.params)?.[0] as string) || \"\";\n\n // Parse the URL path into blade segments\n const parsed = parseBladeUrl(to.path, tenantPrefix);\n\n if (!parsed.workspaceUrl) {\n // No workspace in URL (e.g. navigating to \"/\") — clear the blade stack.\n // The app shell renders its own default view (e.g. dashboard) when the stack is empty.\n if (bladeStack.blades.value.length > 0) {\n const wasCleared = await clearBladeStackRespectingGuards(bladeStack);\n if (!wasCleared) {\n return false;\n }\n }\n return undefined;\n }\n\n // Preserve route params (e.g. sellerId) so fallback redirects keep the tenant prefix\n const routeParams = Object.fromEntries(Object.entries(to.params).filter(([, v]) => typeof v === \"string\")) as Record<\n string,\n string\n >;\n\n // Restore blade stack from URL (idempotent — skips if already matching)\n const needsUrlCleanup = await restoreFromUrl(bladeStack, bladeRegistry, parsed, hasAccess, router, routeParams);\n\n // If a non-routable blade was in the URL, clean up to match actual stack\n if (needsUrlCleanup) {\n const { path, query } = buildUrlFromStack(tenantPrefix, bladeStack.blades.value);\n return { path, query, replace: true };\n }\n\n return undefined;\n}\n","import { Router } from \"vue-router\";\r\nimport { App } from \"vue\";\r\nimport { BladeNavigationPlugin, BladeStackKey, BladeMessagingKey } from \"@core/blade-navigation/types\";\r\nimport { createBladeStack } from \"@core/blade-navigation/useBladeStack\";\r\nimport { createBladeMessaging } from \"@core/blade-navigation/useBladeMessaging\";\r\nimport { bladeRouterGuard } from \"@core/blade-navigation/utils/bladeRouterGuard\";\r\nimport { useBladeRegistry } from \"@core/composables/useBladeRegistry\";\r\nimport type { IBladeRegistry } from \"@core/composables/useBladeRegistry\";\r\nimport { usePermissions } from \"@core/composables/usePermissions\";\r\nimport {\r\n setBladeNavigationInstance,\r\n setBladeStackInstance,\r\n setBladeMessagingInstance,\r\n setBladeRegistryInstance,\r\n} from \"@core/blade-navigation/singletons\";\r\n\r\n// Re-export singletons for backward compatibility\r\nexport {\r\n bladeNavigationInstance,\r\n bladeStackInstance,\r\n bladeMessagingInstance,\r\n bladeRegistryInstance,\r\n _resetBladeNavigationSingletons,\r\n} from \"@core/blade-navigation/singletons\";\r\n\r\n/**\r\n * New Blade Navigation Plugin (v2).\r\n *\r\n * Sets up:\r\n * - BladeStack state machine (provided via BladeStackKey)\r\n * - BladeMessaging for inter-blade communication (provided via BladeMessagingKey)\r\n * - Auto catch-all route under the root route (safety net for blade URLs)\r\n * - Router beforeEach guard for URL → blade stack restoration\r\n *\r\n * Vue Router serves as the URL sync layer only. BladeStack is the source of truth.\r\n * Back/forward is handled natively by Vue Router — beforeEach fires on popstate\r\n * and restores BladeStack from the URL.\r\n */\r\nexport const VcBladeNavigationComponent = {\r\n install(app: App, args: { router: Router }) {\r\n const { router } = args;\r\n\r\n // ── Legacy backward compatibility ───────────────────────────────────────\r\n const bladeNavigationPluginData: BladeNavigationPlugin = {\r\n router: args.router,\r\n };\r\n setBladeNavigationInstance(bladeNavigationPluginData);\r\n\r\n // ── New BladeStack system ───────────────────────────────────────────────\r\n\r\n // BladeRegistry must already be provided by the main app setup (framework/index.ts)\r\n const bladeRegistry = app.runWithContext(() => {\r\n try {\r\n return useBladeRegistry();\r\n } catch {\r\n console.warn(\r\n \"[BladeNavigationPlugin] BladeRegistry not yet available. \" +\r\n \"BladeStack will be created but URL restoration may be deferred.\",\r\n );\r\n return undefined;\r\n }\r\n }) as IBladeRegistry | undefined;\r\n\r\n if (!bladeRegistry) {\r\n console.error(\"[BladeNavigationPlugin] BladeRegistry is required but not found.\");\r\n return;\r\n }\r\n\r\n // Get permission checker for workspace access control\r\n const { hasAccess } = app.runWithContext(() => usePermissions());\r\n\r\n // Create BladeStack with permission enforcement\r\n const bladeStack = createBladeStack(bladeRegistry, hasAccess);\r\n app.provide(BladeStackKey, bladeStack);\r\n setBladeStackInstance(bladeStack);\r\n\r\n // Create BladeMessaging\r\n const messaging = createBladeMessaging(bladeStack);\r\n app.provide(BladeMessagingKey, messaging);\r\n setBladeMessagingInstance(messaging);\r\n setBladeRegistryInstance(bladeRegistry!);\r\n\r\n // ── Auto-register catch-all route ───────────────────────────────────────\r\n // Safety net: prevents Vue Router \"route not found\" errors for blade URLs\r\n // in hash mode. BladeStack handles actual rendering.\r\n const mainRoute = router.getRoutes().find((r) => r.meta?.root);\r\n if (mainRoute) {\r\n router.addRoute(mainRoute.name as string, {\r\n path: \":pathMatch(.*)*\",\r\n component: { render: () => null },\r\n meta: { bladeCatchAll: true },\r\n });\r\n }\r\n\r\n // ── Router guard for URL → blade stack restoration ──────────────────────\r\n // Fires on: direct URL entry, deep links, back/forward (popstate)\r\n // The adapter's router.push()/replace() also triggers this, but\r\n // restoreFromUrl is idempotent — if stack already matches URL, it's a no-op.\r\n router.beforeEach((to) => bladeRouterGuard(to, bladeStack, bladeRegistry, hasAccess, router));\r\n },\r\n};\r\n","/**\r\n * Component Default Values for VC-Shell Framework\r\n * Centralized storage for default prop values across components\r\n */\r\n\r\nexport const COMPONENT_DEFAULTS = {\r\n input: {\r\n maxlength: 1024,\r\n debounce: 0,\r\n type: \"text\" as const,\r\n autocomplete: \"off\" as const,\r\n },\r\n\r\n select: {\r\n debounce: 500,\r\n pageSize: 20,\r\n searchable: true,\r\n clearable: true,\r\n },\r\n\r\n table: {\r\n pageSize: 20,\r\n pageSizes: [10, 20, 50, 100] as readonly number[],\r\n selectable: false,\r\n multiselect: false,\r\n stickyHeader: true,\r\n },\r\n\r\n pagination: {\r\n pageSize: 20,\r\n visiblePages: 5,\r\n },\r\n\r\n textarea: {\r\n rows: 3,\r\n maxlength: 4096,\r\n },\r\n\r\n editor: {\r\n minHeight: 200,\r\n maxHeight: 500,\r\n },\r\n\r\n tooltip: {\r\n delay: 300,\r\n placement: \"top\" as const,\r\n },\r\n\r\n modal: {\r\n closeOnEscape: true,\r\n closeOnOverlayClick: true,\r\n },\r\n\r\n notification: {\r\n duration: 5000,\r\n position: \"top-right\" as const,\r\n },\r\n\r\n dashboard: {\r\n columns: 12,\r\n rowHeight: 80,\r\n gap: 20,\r\n },\r\n} as const;\r\n\r\n/**\r\n * Type for accessing component defaults\r\n */\r\nexport type ComponentDefaults = typeof COMPONENT_DEFAULTS;\r\n\r\n/**\r\n * Helper to get defaults for a specific component\r\n */\r\nexport function getComponentDefaults<K extends keyof ComponentDefaults>(componentName: K): ComponentDefaults[K] {\r\n return COMPONENT_DEFAULTS[componentName];\r\n}\r\n","<template>\n <VcPopup\n :variant=\"variant\"\n :is-mobile-fullscreen=\"isMobileFullscreen\"\n :title=\"title\"\n :closable=\"closable\"\n @close=\"$emit('close')\"\n >\n <template\n v-if=\"$slots.header\"\n #header\n >\n <slot name=\"header\" />\n </template>\n\n <template #content>\n <slot />\n </template>\n\n <template #footer=\"{ close }\">\n <slot\n name=\"footer\"\n :close=\"close\"\n :confirm=\"() => handleConfirm(close)\"\n >\n <div\n class=\"vc-popup-base__actions\"\n :class=\"{\n 'vc-popup-base__actions--confirm': mode === 'confirm',\n 'vc-popup-base__actions--single': mode === 'acknowledge',\n }\"\n >\n <template v-if=\"mode === 'confirm'\">\n <VcButton\n :text=\"confirmAsText\"\n class=\"vc-popup-base__confirm\"\n @click=\"handleConfirm(close)\"\n >\n {{ confirmLabel }}\n </VcButton>\n <VcButton @click=\"close\">{{ cancelLabel }}</VcButton>\n </template>\n <VcButton\n v-else\n class=\"vc-popup-base__single\"\n @click=\"close\"\n >\n {{ actionLabel }}\n </VcButton>\n </div>\n </slot>\n </template>\n </VcPopup>\n</template>\n<!-- eslint-disable @typescript-eslint/no-explicit-any -->\n<script lang=\"ts\" setup>\nimport VcPopup, { type PopupVariant } from \"@ui/components/organisms/vc-popup/vc-popup.vue\";\nimport { VcButton } from \"@ui/components/atoms/vc-button\";\n\nexport interface Props {\n title?: string;\n variant?: PopupVariant;\n mode?: \"acknowledge\" | \"confirm\";\n actionLabel?: string;\n confirmLabel?: string;\n cancelLabel?: string;\n confirmAsText?: boolean;\n closable?: boolean;\n isMobileFullscreen?: boolean;\n closeOnConfirm?: boolean;\n}\n\nexport interface Emits {\n (event: \"close\"): void;\n (event: \"confirm\"): void;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n variant: \"default\",\n mode: \"acknowledge\",\n actionLabel: \"\",\n confirmLabel: \"\",\n cancelLabel: \"\",\n confirmAsText: false,\n closable: true,\n isMobileFullscreen: true,\n closeOnConfirm: false,\n});\n\nconst emit = defineEmits<Emits>();\n\ndefineSlots<{\n header: (props: any) => any;\n default: (props: any) => any;\n footer: (props: { close: () => void; confirm: () => void }) => any;\n}>();\n\nfunction handleConfirm(close: () => void): void {\n emit(\"confirm\");\n\n if (props.closeOnConfirm) {\n close();\n }\n}\n</script>\n\n<style lang=\"scss\">\n:root {\n // Deprecated alias: --confirm-button-color\n --popup-base-confirm-color: var(--confirm-button-color, var(--secondary-700));\n}\n\n.vc-popup-base {\n &__actions {\n @apply tw-flex tw-flex-auto tw-justify-end;\n\n &--confirm {\n @apply tw-gap-6;\n }\n\n &--single {\n @apply tw-gap-0;\n }\n }\n\n &__single {\n @apply tw-ml-auto;\n }\n\n &__confirm {\n color: var(--popup-base-confirm-color) !important;\n }\n}\n</style>\n","<template>\n <VcPopupBase\n variant=\"warning\"\n mode=\"confirm\"\n :confirm-label=\"$t('COMPONENTS.ORGANISMS.VC_POPUP.CONFIRM')\"\n :cancel-label=\"$t('COMPONENTS.ORGANISMS.VC_POPUP.CANCEL')\"\n confirm-as-text\n :title=\"title\"\n @close=\"$emit('close')\"\n @confirm=\"$emit('confirm')\"\n >\n <template\n v-if=\"$slots.header\"\n #header\n >\n <slot name=\"header\" />\n </template>\n <slot />\n </VcPopupBase>\n</template>\n<!-- eslint-disable @typescript-eslint/no-explicit-any -->\n<script lang=\"ts\" setup>\nimport VcPopupBase from \"@shell/_internal/popup/common/vc-popup-base.vue\";\n\nexport interface Props {\n title?: string;\n}\n\nexport interface Emits {\n (event: \"close\"): void;\n (event: \"confirm\"): void;\n}\n\ndefineProps<Props>();\n\ndefineEmits<Emits>();\n\ndefineSlots<{\n header: (props: any) => any;\n default: (props: any) => any;\n}>();\n</script>\n","<template>\n <VcPopupBase\n variant=\"error\"\n mode=\"acknowledge\"\n :action-label=\"$t('COMPONENTS.ORGANISMS.VC_POPUP.OK')\"\n :title=\"title\"\n @close=\"$emit('close')\"\n >\n <template\n v-if=\"$slots.header\"\n #header\n >\n <slot name=\"header\" />\n </template>\n <slot />\n </VcPopupBase>\n</template>\n<!-- eslint-disable @typescript-eslint/no-explicit-any -->\n<script lang=\"ts\" setup>\nimport VcPopupBase from \"@shell/_internal/popup/common/vc-popup-base.vue\";\n\nexport interface Props {\n title?: string;\n}\n\nexport interface Emits {\n (event: \"close\"): void;\n}\n\ndefineProps<Props>();\n\ndefineEmits<Emits>();\n\ndefineSlots<{\n header: (props: any) => any;\n default: (props: any) => any;\n}>();\n</script>\n","<template>\n <VcPopupBase\n variant=\"info\"\n mode=\"acknowledge\"\n :action-label=\"$t('COMPONENTS.ORGANISMS.VC_POPUP.OK')\"\n :title=\"title\"\n @close=\"$emit('close')\"\n >\n <template\n v-if=\"$slots.header\"\n #header\n >\n <slot name=\"header\" />\n </template>\n <slot />\n </VcPopupBase>\n</template>\n<!-- eslint-disable @typescript-eslint/no-explicit-any -->\n<script lang=\"ts\" setup>\nimport VcPopupBase from \"@shell/_internal/popup/common/vc-popup-base.vue\";\n\nexport interface Props {\n title?: string;\n}\n\nexport interface Emits {\n (event: \"close\"): void;\n}\n\ndefineProps<Props>();\n\ndefineEmits<Emits>();\n\ndefineSlots<{\n header: (props: any) => any;\n default: (props: any) => any;\n}>();\n</script>\n","import { registerPopupPreset } from \"@core/composables/usePopup/preset-registry\";\nimport vcPopupWarning from \"@shell/_internal/popup/common/vc-popup-warning.vue\";\nimport vcPopupError from \"@shell/_internal/popup/common/vc-popup-error.vue\";\nimport vcPopupInfo from \"@shell/_internal/popup/common/vc-popup-info.vue\";\n\n/**\n * Registers shell popup preset components (warning, error, info) with the core popup registry.\n * Called once during framework plugin install.\n */\nexport function registerPopupPresets(): void {\n registerPopupPreset(\"warning\", vcPopupWarning);\n registerPopupPreset(\"error\", vcPopupError);\n registerPopupPreset(\"info\", vcPopupInfo);\n}\n","import { App, shallowReactive, DefineComponent } from \"vue\";\nimport type { PopupPlugin, UsePopupProps, UsePopupInternal } from \"@core/composables/usePopup/types\";\nimport { PopupPluginKey } from \"@core/composables/usePopup/keys\";\nimport { setPopupPluginInstance } from \"@core/composables/usePopup/singleton\";\nimport { registerPopupPresets } from \"@shell/_internal/popup/register-presets\";\n\n// Re-export for backward compatibility\nexport { popupPluginInstance } from \"@core/composables/usePopup/singleton\";\n\nexport const VcPopupHandler = {\n install(app: App) {\n const popups = shallowReactive<(UsePopupProps<DefineComponent> & UsePopupInternal)[]>([]);\n\n const popupPlugin: PopupPlugin = {\n popups,\n };\n\n app.config.globalProperties.$popupPlugin = popupPlugin;\n app.provide(PopupPluginKey, popupPlugin);\n setPopupPluginInstance(popupPlugin);\n registerPopupPresets();\n },\n};\n","export default function debounce(func: (...args: any[]) => void, delay: number): (...args: unknown[]) => void {\r\n let timer: number | null = null;\r\n\r\n return function (...args: unknown[]): void {\r\n if (timer) {\r\n clearTimeout(timer);\r\n }\r\n\r\n timer = window.setTimeout(() => {\r\n timer = null;\r\n func(...args);\r\n }, delay);\r\n };\r\n}\r\n","export default function delay(func: (...args: unknown[]) => void, delay = 0): void {\r\n setTimeout(func, delay);\r\n}\r\n","const resultsMap = new WeakMap();\r\n\r\nexport default function once(func: (...args: unknown[]) => void): (...args: unknown[]) => unknown {\r\n return function (...args: unknown[]): unknown {\r\n if (!resultsMap.has(func)) {\r\n const result = func(...args);\r\n resultsMap.set(func, result);\r\n }\r\n return resultsMap.get(func);\r\n };\r\n}\r\n","export default function throttle(func: (...args: unknown[]) => void, delay: number): (...args: unknown[]) => void {\r\n let wasThrottled = false;\r\n\r\n return function (...args: unknown[]): void {\r\n if (!wasThrottled) {\r\n func(...args);\r\n wasThrottled = true;\r\n setTimeout(() => {\r\n wasThrottled = false;\r\n }, delay);\r\n }\r\n };\r\n}\r\n","import debounce from \"@core/composables/useFunctions/debounce\";\r\nimport delay from \"@core/composables/useFunctions/delay\";\r\nimport once from \"@core/composables/useFunctions/once\";\r\nimport throttle from \"@core/composables/useFunctions/throttle\";\r\n\r\nexport interface UseFunctionsReturn {\r\n debounce: typeof debounce;\r\n delay: typeof delay;\r\n once: typeof once;\r\n throttle: typeof throttle;\r\n}\r\n\r\n/** @deprecated Use UseFunctionsReturn instead */\r\nexport type IUseFunctions = UseFunctionsReturn;\r\n\r\nexport function useFunctions(): UseFunctionsReturn {\r\n return {\r\n debounce,\r\n delay,\r\n once,\r\n throttle,\r\n };\r\n}\r\n","import { computed, ComputedRef, getCurrentScope, onScopeDispose } from \"vue\";\nimport { PushNotification } from \"@core/api/platform\";\nimport { useNotificationStore } from \"@core/notifications\";\nimport { orderBy } from \"lodash-es\";\nimport { createLogger } from \"@core/utilities\";\n\nconst logger = createLogger(\"use-notifications\");\n\nexport interface UseNotificationsReturn {\n readonly notifications: ComputedRef<PushNotification[]>;\n readonly moduleNotifications: ComputedRef<PushNotification[]>;\n loadFromHistory(take?: number): Promise<void>;\n addNotification(message: PushNotification): void;\n markAsRead(message: PushNotification): void;\n markAllAsRead(): void;\n setNotificationHandler(handler: (notification: PushNotification) => void): void;\n}\n\n/** @deprecated Use UseNotificationsReturn instead */\nexport type INotifications = UseNotificationsReturn;\n\n/**\n * @deprecated Use `useBladeNotifications()` for blade-level subscriptions\n * or `useNotificationStore()` for direct store access.\n */\nexport function useNotifications(notifyType?: string | string[]): UseNotificationsReturn {\n if (import.meta.env.DEV) {\n logger.warn(\n \"[vc-shell] useNotifications() is deprecated. Use useBladeNotifications() instead. \" +\n \"See: MIGRATION_GUIDE.md#notifications\",\n );\n }\n\n const store = useNotificationStore();\n const types = notifyType ? (Array.isArray(notifyType) ? notifyType : [notifyType]) : [];\n\n let handler: ((msg: PushNotification) => void) | undefined;\n\n // Subscribe if types provided\n let unsub: (() => void) | undefined;\n if (types.length) {\n unsub = store.subscribe({\n types,\n handler: (msg) => handler?.(msg),\n });\n\n if (getCurrentScope()) {\n onScopeDispose(() => unsub?.());\n }\n }\n\n const moduleNotifications = computed(() => {\n if (!types.length) return [];\n return store.realtime.value.filter(\n (item) => item.isNew && item.notifyType != null && types.includes(item.notifyType),\n );\n });\n\n return {\n notifications: computed(() => orderBy(store.history.value, [\"created\"], [\"desc\"])),\n moduleNotifications,\n loadFromHistory: store.loadHistory,\n addNotification: store.ingest,\n markAsRead: store.markAsRead,\n markAllAsRead: store.markAllAsRead,\n setNotificationHandler: (fn) => {\n handler = fn;\n },\n };\n}\n","import { readonly, ref, type Ref, type DeepReadonly } from \"vue\";\nimport { HasLoading } from \"@core/composables/useLoading\";\nimport { parseError, DisplayableError } from \"@core/utilities/error\";\nimport { setPendingErrorNotification } from \"@core/utilities/pendingErrorNotifications\";\nimport { isSessionExpired } from \"@core/utilities/sessionExpiration\";\nimport { createLogger } from \"@core/utilities\";\n\n// Lazy-resolved reference to the notification singleton.\n// We avoid a top-level import of `@core/notifications/notification`\n// because that module may transitively pull in UI components (@ui/components) which\n// import from @core/composables — creating a circular dependency at module load time.\nlet _notification: typeof import(\"@core/notifications/notification\").notification | undefined;\n\nconst logger = createLogger(\"use-async\");\n\nexport type AsyncAction<Payload = void, Result = void> = (payload?: Payload, ...rest: any[]) => Promise<Result>;\n\nexport interface UseAsyncOptions {\n /**\n * Show error notification on failure. Default: true.\n *\n * Notifications are deferred via setTimeout(0) so that ErrorInterceptor\n * can cancel them when it catches the same error for blade banner display.\n * This prevents duplicate toast+banner for load errors while still\n * showing toasts for save/delete errors caught by module try/catch.\n */\n notify?: boolean;\n /** Notification timeout in ms. Default: 8000 */\n notifyTimeout?: number;\n}\n\nexport interface UseAsyncReturn<Payload = void, Result = void> extends HasLoading {\n action: AsyncAction<Payload, Result>;\n /** Reactive error state — set on failure, cleared on next invocation */\n error: DeepReadonly<Ref<DisplayableError | null>>;\n}\n\n/** @deprecated Use UseAsyncReturn instead */\nexport type UseAsync<Payload = void, Result = void> = UseAsyncReturn<Payload, Result>;\n\nexport function useAsync<Payload = void, Result = void>(\n innerAction: AsyncAction<Payload, Result>,\n options?: UseAsyncOptions,\n): UseAsyncReturn<Payload, Result> {\n const loading = ref(false);\n const error = ref<DisplayableError | null>(null);\n\n const shouldNotify = options?.notify !== false;\n const notifyTimeout = options?.notifyTimeout ?? 8000;\n\n async function action(payload?: Payload, ...rest: any[]): Promise<Result> {\n loading.value = true;\n error.value = null;\n\n try {\n return await innerAction(payload, ...rest);\n } catch (e) {\n const parsed = parseError(e);\n error.value = parsed;\n logger.error(\"Async action failed:\", e);\n\n // While the session is expired the app is redirecting to login — suppress the\n // toast so the user isn't buried under load errors from the abandoned page.\n if (shouldNotify && !isSessionExpired() && e && typeof e === \"object\") {\n const notifId = `async-error-${parsed.message.slice(0, 80)}`;\n\n // Defer notification so ErrorInterceptor can cancel it\n // when onErrorCaptured fires (synchronously, before setTimeout(0) callback)\n const timerId = setTimeout(async () => {\n if (!_notification) {\n const mod = await import(\"@core/notifications/notification\");\n _notification = mod.notification;\n }\n _notification.error(parsed.message, {\n timeout: notifyTimeout,\n notificationId: notifId,\n });\n }, 0);\n\n setPendingErrorNotification(e, timerId, notifId);\n }\n\n throw e;\n } finally {\n loading.value = false;\n }\n }\n\n return {\n loading: readonly(loading),\n error: readonly(error),\n action,\n };\n}\n","export interface IAuthApiBase {\r\n authToken: string;\r\n setAuthToken(token: string): void;\r\n getBaseUrl(defaultUrl: string, baseUrl: string): string;\r\n}\r\n\r\nexport interface UseApiClientReturn<ApiClient extends IAuthApiBase> {\r\n getApiClient: () => Promise<ApiClient>;\r\n}\r\n\r\n/** @deprecated Use UseApiClientReturn instead */\r\nexport type UseApiClient<ApiClient extends IAuthApiBase> = UseApiClientReturn<ApiClient>;\r\n\r\nexport function useApiClient<ApiClient extends IAuthApiBase>(\r\n c: new (baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise<Response> }) => ApiClient,\r\n): UseApiClientReturn<ApiClient> {\r\n async function getApiClient() {\r\n const client = new c();\r\n return client;\r\n }\r\n\r\n return {\r\n getApiClient,\r\n };\r\n}\r\n","import { computed, ComputedRef, Ref } from \"vue\";\r\n\r\nexport interface HasLoading {\r\n loading: Readonly<Ref<boolean>>;\r\n}\r\n\r\nexport type UseLoadingReturn = ComputedRef<boolean>;\r\n\r\nexport function useLoading(...args: Readonly<Ref<boolean>>[]): UseLoadingReturn {\r\n return computed(() => args.some((item) => item.value));\r\n}\r\n","import { useAsync } from \"@core/composables/useAsync\";\nimport { useApiClient } from \"@core/composables/useApiClient\";\nimport { computed, Ref, ref, ComputedRef, onMounted } from \"vue\";\nimport { SettingClient } from \"@core/api/platform\";\nimport { useLoading } from \"@core/composables/useLoading\";\nimport { createLogger } from \"@core/utilities\";\n\nconst logger = createLogger(\"use-settings\");\n\ninterface IUISetting {\n contrast_logo?: string;\n logo?: string;\n title?: string;\n avatar?: string;\n role?: string;\n}\n\nexport interface UseSettingsReturn {\n readonly uiSettings: Ref<IUISetting>;\n readonly loading: ComputedRef<boolean>;\n applySettings: (args: { logo?: string; title?: string; avatar?: string; role?: string }) => void;\n}\n\n/** @deprecated Use UseSettingsReturn instead */\nexport type IUseSettings = UseSettingsReturn;\n\nexport function useSettings(): UseSettingsReturn {\n const uiSettings = ref<IUISetting | undefined>();\n const customSettingsApplied = ref(false);\n\n const { getApiClient } = useApiClient(SettingClient);\n\n const { loading, action: getUiCustomizationSettings } = useAsync(async () => {\n if (customSettingsApplied.value) return;\n\n const result = await (await getApiClient()).getUICustomizationSetting();\n\n // defaultValue can be empty or malformed JSON — JSON.parse would throw and\n // reject the whole action, so guard it and treat unparseable settings as absent.\n let settings: IUISetting | null = null;\n if (result.defaultValue) {\n try {\n settings = JSON.parse(result.defaultValue);\n } catch (e) {\n logger.warn(\"Failed to parse UI customization settings JSON; ignoring.\", e);\n }\n }\n\n if (settings && !uiSettings.value) {\n uiSettings.value = {\n contrast_logo: settings.contrast_logo,\n logo: settings.logo,\n title: settings.title,\n };\n }\n });\n\n function applySettings(args: { logo?: string; title?: string; avatar?: string; role?: string }) {\n customSettingsApplied.value = true;\n uiSettings.value = {\n ...uiSettings.value,\n logo: args.logo,\n title: args.title,\n avatar: args.avatar,\n role: args.role,\n };\n }\n\n onMounted(async () => {\n if (!uiSettings.value && !customSettingsApplied.value) {\n await getUiCustomizationSettings();\n }\n });\n\n return {\n uiSettings: computed(() => uiSettings.value ?? {}),\n applySettings,\n loading: useLoading(loading),\n };\n}\n","import { computed, ref, ComputedRef } from \"vue\";\nimport * as _ from \"lodash-es\";\nimport type { ICommonAsset } from \"@core/types\";\nimport { createLogger } from \"@core/utilities\";\n\nconst logger = createLogger(\"use-assets\");\n\n/** Maximum number of concurrent uploads */\nconst MAX_CONCURRENT_UPLOADS = 4;\n\nexport interface UseAssetsReturn {\n upload: (files: FileList, uploadPath: string, startingSortOrder?: number) => Promise<ICommonAsset[]>;\n remove: (filesToDelete: ICommonAsset[], initialAssetArr: ICommonAsset[]) => ICommonAsset[];\n edit: (updatedFiles: ICommonAsset[], initialAssetArr: ICommonAsset[]) => ICommonAsset[];\n loading: ComputedRef<boolean>;\n}\n\n/** @deprecated Use UseAssetsReturn instead */\nexport type IUseAssets = UseAssetsReturn;\n\n/**\n * Uploads a single file and returns the asset\n */\nasync function uploadSingleFile(\n file: File,\n uploadPath: string,\n index: number,\n startingSortOrder?: number,\n): Promise<ICommonAsset | null> {\n const formData = new FormData();\n formData.append(\"file\", file);\n\n const result = await fetch(`/api/assets?folderUrl=/${uploadPath}`, {\n method: \"POST\",\n body: formData,\n });\n\n const response = await result.json();\n\n if (response?.length) {\n const uploadedFile = response[0];\n uploadedFile.createdDate = new Date();\n uploadedFile.sortOrder =\n startingSortOrder !== undefined && startingSortOrder >= 0 ? startingSortOrder + index + 1 : 0;\n uploadedFile.url = uploadedFile.url ? decodeURI(uploadedFile.url) : \"\";\n\n if (\"size\" in uploadedFile) {\n uploadedFile.size = file.size;\n }\n\n return uploadedFile;\n }\n\n return null;\n}\n\n/**\n * Processes items in batches with concurrency limit\n */\nasync function processBatched<T, R>(\n items: T[],\n processor: (item: T, index: number) => Promise<R>,\n concurrency: number,\n): Promise<R[]> {\n const results: R[] = [];\n\n for (let i = 0; i < items.length; i += concurrency) {\n const batch = items.slice(i, i + concurrency);\n const batchResults = await Promise.all(batch.map((item, batchIndex) => processor(item, i + batchIndex)));\n results.push(...batchResults);\n }\n\n return results;\n}\n\nexport function useAssets(): UseAssetsReturn {\n const loading = ref(false);\n\n if (import.meta.env?.DEV) {\n console.warn(\n \"[useAssets] is deprecated. Use useAssetsManager(ref, options) instead. \" + \"See migration guide #32.\",\n );\n }\n\n async function upload(files: FileList, uploadPath: string, startingSortOrder?: number): Promise<ICommonAsset[]> {\n try {\n loading.value = true;\n\n const fileArray = Array.from(files);\n\n // Upload files in parallel batches\n const uploadResults = await processBatched(\n fileArray,\n (file, index) => uploadSingleFile(file, uploadPath, index, startingSortOrder),\n MAX_CONCURRENT_UPLOADS,\n );\n\n // Filter out null results and return successful uploads\n return uploadResults.filter((asset): asset is ICommonAsset => asset !== null);\n } catch (error) {\n logger.error(\"Upload failed:\", error);\n throw error;\n } finally {\n loading.value = false;\n }\n }\n\n function remove(filesToDelete: ICommonAsset[], initialAssetArr: ICommonAsset[], assetKey = \"url\"): ICommonAsset[] {\n try {\n loading.value = true;\n\n let updatedAssetArr = _.cloneDeep(initialAssetArr) || [];\n\n if (updatedAssetArr && updatedAssetArr.length && filesToDelete.length > 0) {\n updatedAssetArr = _.differenceWith(updatedAssetArr, filesToDelete, (x, y) => x[assetKey] === y[assetKey]);\n }\n\n return updatedAssetArr;\n } catch (error) {\n logger.error(\"Remove failed:\", error);\n throw error;\n } finally {\n loading.value = false;\n }\n }\n\n function edit(updatedFiles: ICommonAsset[], initialAssetArr: ICommonAsset[]): ICommonAsset[] {\n // When all items are passed (e.g. reorder), preserve the order of updatedFiles.\n // When a subset is passed (e.g. single asset edit), update in place within initial order.\n if (updatedFiles.length === initialAssetArr.length) {\n return updatedFiles.map((file) => ({ ...file }));\n }\n\n const updatedAssetArr = _.cloneDeep(initialAssetArr) || [];\n\n if (updatedAssetArr && updatedAssetArr.length) {\n updatedFiles.forEach((updatedFile) => {\n const index = updatedAssetArr.findIndex((asset) => asset.url === updatedFile.url);\n if (index !== -1) {\n updatedAssetArr[index] = { ...updatedAssetArr[index], ...updatedFile };\n }\n });\n }\n\n return updatedAssetArr;\n }\n\n return {\n upload,\n remove,\n edit,\n loading: computed(() => loading.value),\n };\n}\n","import { computed, ref, watch, Ref, ComputedRef } from \"vue\";\nimport { createLogger } from \"@core/utilities\";\n\nconst logger = createLogger(\"use-assets-manager\");\n\nexport interface AssetLike {\n url?: string;\n name?: string;\n sortOrder?: number;\n [key: string]: any;\n}\n\nexport interface UseAssetsManagerOptions {\n uploadPath: () => string;\n confirmRemove?: () => Promise<boolean> | boolean;\n assetKey?: string;\n concurrency?: number;\n}\n\nexport interface UseAssetsManagerReturn {\n items: Ref<AssetLike[]>;\n upload: (files: FileList, startingSortOrder?: number) => Promise<void>;\n remove: (item: AssetLike) => Promise<void>;\n removeMany: (items: AssetLike[]) => Promise<void>;\n reorder: (items: AssetLike[]) => void;\n updateItem: (item: AssetLike) => void;\n loading: ComputedRef<boolean>;\n}\n\n/** Default concurrency for parallel uploads */\nconst DEFAULT_CONCURRENCY = 4;\n\n/**\n * Uploads a single file and returns the asset\n */\nasync function uploadSingleFile(\n file: File,\n uploadPath: string,\n index: number,\n startingSortOrder?: number,\n): Promise<AssetLike | null> {\n const formData = new FormData();\n formData.append(\"file\", file);\n\n const normalizedPath = uploadPath.startsWith(\"/\") ? uploadPath.slice(1) : uploadPath;\n const result = await fetch(`/api/assets?folderUrl=/${normalizedPath}`, {\n method: \"POST\",\n body: formData,\n });\n\n const response = await result.json();\n\n if (response?.length) {\n const uploadedFile = response[0];\n uploadedFile.createdDate = new Date();\n uploadedFile.sortOrder =\n startingSortOrder !== undefined && startingSortOrder >= 0 ? startingSortOrder + index + 1 : 0;\n uploadedFile.url = uploadedFile.url ? decodeURI(uploadedFile.url) : \"\";\n\n if (\"size\" in uploadedFile) {\n uploadedFile.size = file.size;\n }\n\n return uploadedFile;\n }\n\n return null;\n}\n\n/**\n * Processes items in batches with concurrency limit\n */\nasync function processBatched<T, R>(\n items: T[],\n processor: (item: T, index: number) => Promise<R>,\n concurrency: number,\n): Promise<R[]> {\n const results: R[] = [];\n\n for (let i = 0; i < items.length; i += concurrency) {\n const batch = items.slice(i, i + concurrency);\n const batchResults = await Promise.all(batch.map((item, batchIndex) => processor(item, i + batchIndex)));\n results.push(...batchResults);\n }\n\n return results;\n}\n\n/**\n * Normalizes a list's `sortOrder`: orders items by their current `sortOrder`\n * (items without one are kept stable at the end) and reassigns a clean\n * sequential `sortOrder` (0..n). Guarantees every item has a `sortOrder` on\n * load — the source may arrive without it. Idempotent: normalizing an\n * already-normalized list yields the same order and values.\n */\nfunction normalizeSortOrder(list: AssetLike[]): AssetLike[] {\n return list\n .map((item, index) => ({ item, index }))\n .sort((a, b) => {\n const ao = a.item.sortOrder ?? Number.MAX_SAFE_INTEGER;\n const bo = b.item.sortOrder ?? Number.MAX_SAFE_INTEGER;\n return ao === bo ? a.index - b.index : ao - bo;\n })\n .map(({ item }, index) => ({ ...item, sortOrder: index }));\n}\n\nexport function useAssetsManager(\n source: Ref<AssetLike[] | undefined | null>,\n options: UseAssetsManagerOptions,\n): UseAssetsManagerReturn {\n const _loading = ref(false);\n\n // Internal ref owns the data. Synced from source via watch,\n // written back to source after every mutation.\n // This avoids reactivity issues when source is a WritableComputed\n // wrapping deeply nested properties (e.g. item.value.productData.assets).\n const _items = ref<AssetLike[]>(normalizeSortOrder(source.value ?? []));\n\n // Sync: source → internal (e.g. when parent reloads data). Normalize sortOrder\n // on the way in so items always carry a clean sequential sortOrder, even when\n // the source provides them without one. Idempotent, so it does not loop on the\n // writeback that mutations perform via _sync().\n watch(\n () => source.value,\n (newVal) => {\n _items.value = normalizeSortOrder(newVal ?? []);\n },\n { deep: true, immediate: true },\n );\n\n /** Write internal state back to source */\n function _sync() {\n source.value = _items.value;\n }\n\n const items: Ref<AssetLike[]> = _items;\n const loading = computed(() => _loading.value);\n\n const concurrency = options.concurrency ?? DEFAULT_CONCURRENCY;\n const assetKey = options.assetKey ?? \"url\";\n\n async function upload(files: FileList, startingSortOrder?: number): Promise<void> {\n try {\n _loading.value = true;\n\n const fileArray = Array.from(files);\n const uploadPath = options.uploadPath();\n\n const uploadResults = await processBatched(\n fileArray,\n (file, index) => uploadSingleFile(file, uploadPath, index, startingSortOrder),\n concurrency,\n );\n\n const successfulUploads = uploadResults.filter((asset): asset is AssetLike => asset !== null);\n _items.value = [..._items.value, ...successfulUploads];\n _sync();\n } catch (error) {\n logger.error(\"Upload failed:\", error);\n throw error;\n } finally {\n _loading.value = false;\n }\n }\n\n async function remove(item: AssetLike): Promise<void> {\n await removeMany([item]);\n }\n\n async function removeMany(itemsToRemove: AssetLike[]): Promise<void> {\n if (options.confirmRemove) {\n const confirmed = await options.confirmRemove();\n if (!confirmed) return;\n }\n\n const keysToRemove = new Set(itemsToRemove.map((i) => i[assetKey]));\n _items.value = _items.value.filter((i) => !keysToRemove.has(i[assetKey]));\n _sync();\n }\n\n function reorder(newOrder: AssetLike[]): void {\n _items.value = newOrder.map((item) => ({ ...item }));\n _sync();\n }\n\n function updateItem(item: AssetLike): void {\n const index = _items.value.findIndex((existing) => existing[assetKey] === item[assetKey]);\n if (index !== -1) {\n const updated = [..._items.value];\n updated[index] = { ..._items.value[index], ...item };\n _items.value = updated;\n _sync();\n }\n }\n\n return {\n items,\n upload,\n remove,\n removeMany,\n reorder,\n updateItem,\n loading,\n };\n}\n","import { onBeforeMount, onBeforeUnmount, unref, ComputedRef } from \"vue\";\r\n\r\nexport interface UseBeforeUnloadReturn {\r\n modified: ComputedRef<boolean>;\r\n}\r\n\r\n/**\r\n * Prevents the user from closing the tab if the modified flag is set to true.\r\n * @param modified - The flag that indicates whether the user has made changes.\r\n * @returns The modified flag.\r\n */\r\nexport const useBeforeUnload = (modified: ComputedRef<boolean>): UseBeforeUnloadReturn => {\r\n onBeforeMount(() => {\r\n window.addEventListener(\"beforeunload\", preventUnload);\r\n });\r\n\r\n onBeforeUnmount(() => {\r\n window.removeEventListener(\"beforeunload\", preventUnload);\r\n });\r\n\r\n function preventUnload(event: Event) {\r\n if (!unref(modified)) return;\r\n event.preventDefault();\r\n }\r\n\r\n return {\r\n modified,\r\n };\r\n};\r\n","import type { IBaseProperty, IBasePropertyValue } from \"./types\";\n\nexport function isEmptyValue(value: unknown): boolean {\n if (value === undefined || value === null) return true;\n if (typeof value === \"number\" && isNaN(value)) return true;\n if (typeof value === \"string\" && value.trim().length === 0) return true;\n if (typeof value === \"object\" && Object.keys(value).length === 0) return true;\n return false;\n}\n\nexport function isMultilanguageProperty(property: IBaseProperty): boolean {\n return Boolean(property.multilanguage);\n}\n\nexport function isMultivalueProperty(property: IBaseProperty): boolean {\n return Boolean(property.multivalue);\n}\n\nexport function isDictionaryProperty(property: IBaseProperty): boolean {\n return Boolean(property.dictionary);\n}\n\nexport function isMeasureProperty(property: IBaseProperty): boolean {\n return property.valueType === \"Measure\";\n}\n\nexport function isColorProperty(property: IBaseProperty): boolean {\n return property.valueType === \"Color\";\n}\n\nexport function createValue(params: Partial<IBasePropertyValue>): IBasePropertyValue {\n return { isInherited: false, ...params };\n}\n\nexport function cleanEmptyValues(property: IBaseProperty, locale?: string): void {\n if (!property.values) return;\n\n if (isMultilanguageProperty(property) && locale) {\n property.values = property.values.filter((v) => v.languageCode !== locale);\n } else {\n property.values = [];\n }\n\n if (property.values.length > 0 && property.values.every((v) => isEmptyValue(v.value))) {\n property.values = [];\n }\n}\n","import type { IBaseProperty, IBasePropertyValue, PropertyDisplayValue } from \"../types\";\nimport type { PropertyValueStrategy, PropertyInputValue, SetContext } from \"./types\";\nimport { isEmptyValue, isMultilanguageProperty, isMultivalueProperty, createValue, cleanEmptyValues } from \"../utils\";\n\nexport const regularStrategy: PropertyValueStrategy = {\n get(property: IBaseProperty, locale: string): PropertyDisplayValue {\n if (isMultilanguageProperty(property)) {\n if (isMultivalueProperty(property)) {\n return (property.values?.filter((v) => v.languageCode === locale) ?? []) as IBasePropertyValue[];\n }\n // Find by locale first, then fallback to value without languageCode\n const val =\n property.values?.find((v) => v.languageCode === locale) ?? property.values?.find((v) => !v.languageCode);\n return (val?.value as string) ?? \"\";\n }\n\n if (isMultivalueProperty(property)) {\n return (property.values ?? []) as IBasePropertyValue[];\n }\n\n return (property.values?.[0]?.value as string) ?? \"\";\n },\n\n set(property: IBaseProperty, value: PropertyInputValue, context: SetContext): void {\n if (!Array.isArray(value) && isEmptyValue(value)) {\n cleanEmptyValues(property, context.locale);\n return;\n }\n\n if (isMultilanguageProperty(property)) {\n if (Array.isArray(value)) {\n const otherLocales = property.values?.filter((v) => v.languageCode !== context.locale) ?? [];\n const newValues = (value as IBasePropertyValue[]).map((item) =>\n createValue({ ...item, languageCode: context.locale }),\n );\n property.values = [...otherLocales, ...newValues];\n } else {\n const existing = property.values?.find((v) => v.languageCode === context.locale);\n if (existing) {\n existing.value = value as string;\n } else {\n if (!property.values) property.values = [];\n property.values.push(createValue({ value: value as string, languageCode: context.locale }));\n }\n }\n return;\n }\n\n if (Array.isArray(value)) {\n property.values = (value as IBasePropertyValue[]).map((item) => createValue(item));\n return;\n }\n\n if (property.values?.[0]) {\n Object.assign(property.values[0], { value });\n } else {\n property.values = [createValue({ value: value as string })];\n }\n },\n};\n","import type { IBaseProperty, PropertyDisplayValue } from \"../types\";\nimport type { PropertyValueStrategy, PropertyInputValue, SetContext } from \"./types\";\nimport { isMultilanguageProperty, createValue } from \"../utils\";\n\nexport const booleanStrategy: PropertyValueStrategy = {\n get(property: IBaseProperty, locale: string): PropertyDisplayValue {\n if (isMultilanguageProperty(property)) {\n const val =\n property.values?.find((v) => v.languageCode === locale) ?? property.values?.find((v) => !v.languageCode);\n return val?.value ?? false;\n }\n return property.values?.[0]?.value ?? false;\n },\n\n set(property: IBaseProperty, value: PropertyInputValue, _context: SetContext): void {\n if (property.values?.[0]) {\n Object.assign(property.values[0], { value });\n } else {\n property.values = [createValue({ value })];\n }\n },\n};\n","import type { IBaseProperty, IBasePropertyValue, IBasePropertyDictionaryItem, PropertyDisplayValue } from \"../types\";\nimport type { PropertyValueStrategy, PropertyInputValue, SetContext } from \"./types\";\nimport { isEmptyValue, isMultilanguageProperty, isMultivalueProperty, createValue, cleanEmptyValues } from \"../utils\";\n\nexport const dictionaryStrategy: PropertyValueStrategy = {\n get(property: IBaseProperty, locale: string): PropertyDisplayValue {\n if (isMultilanguageProperty(property)) {\n if (isMultivalueProperty(property)) {\n return (property.values?.filter((v) => v.languageCode === locale) ?? []) as IBasePropertyValue[];\n }\n // Find by locale first, then fallback to value without languageCode\n const val =\n property.values?.find((v) => v.languageCode === locale) ?? property.values?.find((v) => !v.languageCode);\n return (val?.valueId as string) ?? \"\";\n }\n\n if (isMultivalueProperty(property)) {\n return (property.values ?? []) as IBasePropertyValue[];\n }\n\n return (property.values?.[0]?.valueId as string) ?? \"\";\n },\n\n set(property: IBaseProperty, value: PropertyInputValue, context: SetContext): void {\n const { dictionary, locale } = context;\n\n // Empty value → clean up regardless of dictionary presence\n if (!Array.isArray(value) && isEmptyValue(value)) {\n cleanEmptyValues(property, locale);\n return;\n }\n\n if (!dictionary?.length) return;\n\n if (isMultilanguageProperty(property)) {\n setMultilanguageDictionary(property, value, dictionary, locale);\n } else {\n setSingleLanguageDictionary(property, value, dictionary);\n }\n },\n};\n\nfunction setMultilanguageDictionary(\n property: IBaseProperty,\n value: PropertyInputValue,\n dictionary: IBasePropertyDictionaryItem[],\n locale?: string,\n): void {\n if (Array.isArray(value)) {\n setMultilanguageMultivalueDictionary(\n property,\n value as (IBasePropertyDictionaryItem & { value: string })[],\n dictionary,\n );\n } else {\n setMultilanguageSingleValueDictionary(property, value as string, dictionary, locale);\n }\n}\n\nfunction setMultilanguageMultivalueDictionary(\n property: IBaseProperty,\n values: (IBasePropertyDictionaryItem & { value: string })[],\n dictionary: IBasePropertyDictionaryItem[],\n): void {\n property.values = values.flatMap((item) => {\n const dictItem = dictionary.find(\n (x) => x.id === (item as unknown as IBasePropertyValue).valueId || x.id === item.id,\n );\n\n if (dictItem?.localizedValues?.length) {\n return dictItem.localizedValues.map((locValue) =>\n createValue({\n propertyId: dictItem.propertyId,\n alias: dictItem.alias,\n languageCode: locValue.languageCode,\n value: locValue.value ?? dictItem.alias,\n valueId: dictItem.id,\n colorCode: dictItem.colorCode,\n }),\n );\n }\n\n return createValue(item as unknown as Partial<IBasePropertyValue>);\n });\n}\n\nfunction setMultilanguageSingleValueDictionary(\n property: IBaseProperty,\n value: string,\n dictionary: IBasePropertyDictionaryItem[],\n locale?: string,\n): void {\n const dictionaryItem = dictionary.find((x) => x.id === value);\n\n if (!dictionaryItem) {\n property.values = [];\n return;\n }\n\n if (dictionaryItem.localizedValues?.length) {\n property.values = dictionaryItem.localizedValues.map((locValue) =>\n createValue({\n propertyId: dictionaryItem.propertyId,\n alias: dictionaryItem.alias,\n languageCode: locValue.languageCode,\n value: locValue.value ?? dictionaryItem.alias,\n valueId: dictionaryItem.id,\n colorCode: dictionaryItem.colorCode,\n }),\n );\n } else {\n const existingLanguageCodes = [...new Set((property.values ?? []).map((v) => v.languageCode).filter(Boolean))];\n const languageCodes = existingLanguageCodes.length > 0 ? existingLanguageCodes : locale ? [locale] : [];\n\n property.values = languageCodes.map((langCode) =>\n createValue({\n propertyId: dictionaryItem.propertyId,\n alias: dictionaryItem.alias,\n languageCode: langCode,\n value: dictionaryItem.alias,\n valueId: dictionaryItem.id,\n colorCode: dictionaryItem.colorCode,\n }),\n );\n }\n}\n\nfunction setSingleLanguageDictionary(\n property: IBaseProperty,\n value: PropertyInputValue,\n dictionary: IBasePropertyDictionaryItem[],\n): void {\n if (Array.isArray(value)) {\n property.values = (value as (IBasePropertyDictionaryItem & { value: string })[]).flatMap((item) => {\n const dictItem = dictionary.find(\n (x) => x.id === (item as unknown as IBasePropertyValue).valueId || x.id === item.id,\n );\n\n if (dictItem) {\n return createValue({\n propertyId: dictItem.propertyId,\n alias: dictItem.alias,\n value: item.value ?? dictItem.alias,\n valueId: dictItem.id,\n colorCode: dictItem.colorCode,\n });\n }\n\n return createValue(item as unknown as Partial<IBasePropertyValue>);\n });\n } else {\n if (isEmptyValue(value)) {\n property.values = [];\n return;\n }\n\n const dictionaryItem = dictionary.find((x) => x.id === value);\n property.values = [\n createValue({\n propertyId: dictionaryItem?.propertyId,\n alias: dictionaryItem?.alias,\n value: (dictionaryItem as IBasePropertyDictionaryItem & { value: string })?.value ?? dictionaryItem?.alias,\n valueId: value as string,\n colorCode: dictionaryItem?.colorCode,\n }),\n ];\n }\n}\n","import type { IBaseProperty, PropertyDisplayValue } from \"../types\";\nimport type { PropertyValueStrategy, PropertyInputValue, SetContext } from \"./types\";\nimport { isEmptyValue, createValue, cleanEmptyValues } from \"../utils\";\n\nexport const measureStrategy: PropertyValueStrategy = {\n get(property: IBaseProperty, _locale: string): PropertyDisplayValue {\n return (property.values?.[0]?.value as string) ?? \"\";\n },\n\n set(property: IBaseProperty, value: PropertyInputValue, context: SetContext): void {\n if (isEmptyValue(value)) {\n cleanEmptyValues(property);\n return;\n }\n property.values = [createValue({ value, unitOfMeasureId: context.unitOfMeasureId })];\n },\n};\n","import type { IBaseProperty, IBasePropertyValue, PropertyDisplayValue } from \"../types\";\nimport type { PropertyValueStrategy, PropertyInputValue, SetContext } from \"./types\";\nimport { isEmptyValue, isMultivalueProperty, createValue, cleanEmptyValues } from \"../utils\";\n\nexport const colorStrategy: PropertyValueStrategy = {\n get(property: IBaseProperty, _locale: string): PropertyDisplayValue {\n if (isMultivalueProperty(property)) {\n return (property.values ?? []) as IBasePropertyValue[];\n }\n return (property.values?.[0]?.value as string) ?? \"\";\n },\n\n set(property: IBaseProperty, value: PropertyInputValue, context: SetContext): void {\n if (!Array.isArray(value) && isEmptyValue(value)) {\n cleanEmptyValues(property);\n return;\n }\n\n if (Array.isArray(value)) {\n property.values = (value as IBasePropertyValue[]).map((item) =>\n createValue({ ...item, value: item.value, colorCode: item.colorCode }),\n );\n } else {\n property.values = [createValue({ value, colorCode: context.colorCode })];\n }\n },\n};\n","import type { IBaseProperty } from \"../types\";\nimport type { PropertyValueStrategy } from \"./types\";\nimport { isMeasureProperty, isColorProperty, isDictionaryProperty } from \"../utils\";\nimport { regularStrategy } from \"./regular\";\nimport { booleanStrategy } from \"./boolean\";\nimport { dictionaryStrategy } from \"./dictionary\";\nimport { measureStrategy } from \"./measure\";\nimport { colorStrategy } from \"./color\";\n\nexport function resolveStrategy(property: IBaseProperty): PropertyValueStrategy {\n if (isMeasureProperty(property)) return measureStrategy;\n if (isColorProperty(property) && !isDictionaryProperty(property)) return colorStrategy;\n if (property.valueType === \"Boolean\") return booleanStrategy;\n if (isDictionaryProperty(property)) return dictionaryStrategy;\n return regularStrategy;\n}\n","import { useLoading } from \"@core/composables/useLoading\";\nimport { useAsync } from \"@core/composables/useAsync\";\nimport { resolveStrategy } from \"./strategies\";\nimport type {\n DynamicPropertiesOptions,\n UseDynamicPropertiesReturn,\n SetPropertyValueParams,\n IBaseProperty,\n IBasePropertyDictionaryItem,\n IBasePropertyDictionaryItemSearchCriteria,\n PropertyDisplayValue,\n} from \"./types\";\n\n// Re-export all types for backward compatibility\nexport * from \"./types\";\n\nexport function useDynamicProperties(options: DynamicPropertiesOptions): UseDynamicPropertiesReturn {\n const { searchDictionary, searchMeasurements } = options;\n\n const { loading: dictionaryItemsLoading, action: searchDictionaryItems } = useAsync<\n IBasePropertyDictionaryItemSearchCriteria,\n IBasePropertyDictionaryItem[] | undefined\n >(async (args) => {\n if (!args) return undefined;\n return await searchDictionary(args);\n });\n\n async function loadDictionaries(\n propertyId: string,\n keyword?: string,\n locale?: string,\n ): Promise<IBasePropertyDictionaryItem[] | undefined> {\n if (!propertyId) return undefined;\n\n const items = await searchDictionaryItems({\n propertyIds: [propertyId],\n keyword,\n skip: 0,\n });\n\n if (!locale || !items) return items;\n\n return items.map((item) => {\n const localizedValue = item.localizedValues?.find((loc) => loc.languageCode === locale)?.value;\n return { ...item, value: localizedValue ?? item.alias } as IBasePropertyDictionaryItem;\n });\n }\n\n async function loadMeasurements(measureId: string, _keyword?: string, locale?: string) {\n if (!measureId || !searchMeasurements) return undefined;\n return await searchMeasurements(measureId, locale);\n }\n\n function getPropertyValue(property: IBaseProperty, locale: string): PropertyDisplayValue {\n return resolveStrategy(property).get(property, locale);\n }\n\n function setPropertyValue(params: SetPropertyValueParams): void {\n const { property, value, ...context } = params;\n resolveStrategy(property).set(property, value, context);\n }\n\n return {\n getPropertyValue,\n setPropertyValue,\n loadDictionaries,\n loadMeasurements,\n loading: useLoading(dictionaryItemsLoading),\n };\n}\n","import { onFCP, onLCP, onCLS, onINP, onTTFB } from \"web-vitals\";\r\nimport type { Metric } from \"web-vitals\";\r\n\r\nexport interface IWebVitalsMetric {\r\n name: string;\r\n value: number;\r\n rating: \"good\" | \"needs-improvement\" | \"poor\";\r\n}\r\n\r\nexport type WebVitalsCallback = (metric: IWebVitalsMetric) => void;\r\n\r\n/**\r\n * Registers Core Web Vitals observers (FCP, LCP, CLS, INP, TTFB).\r\n * Call once per app session, typically after app.mount().\r\n *\r\n * @param callback - Optional custom handler. Defaults to console.warn in dev mode.\r\n * @returns void — side-effect only composable\r\n */\r\nexport function useWebVitals(callback?: WebVitalsCallback): void {\r\n const defaultCallback: WebVitalsCallback = (metric) => {\r\n if (import.meta.env.DEV) {\r\n const unit = metric.name === \"CLS\" ? \"\" : \"ms\";\r\n const value = metric.name === \"CLS\" ? metric.value.toFixed(4) : Math.round(metric.value);\r\n console.warn(`[web-vitals] ${metric.name}: ${value}${unit} (${metric.rating})`);\r\n }\r\n };\r\n\r\n const handler = (metric: Metric) => {\r\n (callback ?? defaultCallback)({\r\n name: metric.name,\r\n value: metric.value,\r\n rating: metric.rating,\r\n });\r\n };\r\n\r\n onFCP(handler);\r\n onLCP(handler);\r\n onCLS(handler);\r\n onINP(handler);\r\n onTTFB(handler);\r\n}\r\n","import { type ComputedRef, type Ref, onMounted, onUnmounted, inject } from \"vue\";\r\nimport { WidgetServiceKey, WidgetScopeKey } from \"@framework/injection-keys\";\r\nimport { BladeDescriptorKey } from \"@core/blade-navigation/types\";\r\nimport type { IWidget, IHeadlessWidgetFields, IWidgetTrigger } from \"@core/services/widget-service\";\r\nimport { createLogger, InjectionError } from \"@core/utilities\";\r\n\r\nconst logger = createLogger(\"use-blade-widgets\");\r\n\r\nexport interface HeadlessWidgetDeclaration {\r\n id: string;\r\n icon: string;\r\n title: string;\r\n badge?: Ref<number | string> | ComputedRef<number | string>;\r\n loading?: Ref<boolean> | ComputedRef<boolean>;\r\n disabled?: Ref<boolean> | ComputedRef<boolean> | boolean;\r\n isVisible?: ComputedRef<boolean> | Ref<boolean> | boolean;\r\n onClick?: () => void;\r\n onRefresh?: () => void | Promise<void>;\r\n}\r\n\r\nexport interface UseBladeWidgetsReturn {\r\n /** Call trigger.onRefresh on a specific widget */\r\n refresh: (widgetId: string) => void;\r\n /** Call trigger.onRefresh on all blade widgets that have a trigger */\r\n refreshAll: () => void;\r\n}\r\n\r\n/**\r\n * Declarative headless widget registration for blades.\r\n * Automatically registers on mount, unregisters on unmount.\r\n * Gets bladeId from blade context (BladeDescriptorKey).\r\n *\r\n * @example\r\n * ```ts\r\n * const { refreshAll } = useBladeWidgets([\r\n * { id: \"OffersWidget\", icon: \"lucide-tag\", title: \"OFFERS.TITLE\",\r\n * badge: count, onClick: () => openBlade({ name: \"Offers\" }) },\r\n * ]);\r\n * ```\r\n */\r\nexport function useBladeWidgets(widgets: HeadlessWidgetDeclaration[]): UseBladeWidgetsReturn {\r\n const _service = inject(WidgetServiceKey);\r\n if (!_service) {\r\n throw new InjectionError(\"WidgetService\");\r\n }\r\n const widgetService = _service;\r\n\r\n const descriptor = inject(BladeDescriptorKey, undefined);\r\n if (!descriptor) {\r\n throw new Error(\r\n \"[vc-shell] useBladeWidgets() requires blade context (BladeDescriptorKey). \" +\r\n \"It must be called inside a blade component rendered by VcBladeSlot.\",\r\n );\r\n }\r\n\r\n const bladeId = descriptor.value.id;\r\n\r\n onMounted(() => {\r\n for (const decl of widgets) {\r\n widgetService.registerWidget(buildWidget(decl), bladeId);\r\n }\r\n });\r\n\r\n onUnmounted(() => {\r\n for (const decl of widgets) {\r\n widgetService.unregisterWidget(decl.id, bladeId);\r\n }\r\n });\r\n\r\n function refresh(widgetId: string): void {\r\n const registered = widgetService.getWidgets(bladeId);\r\n const widget = registered.find((w) => w.id === widgetId);\r\n if (widget?.trigger?.onRefresh) {\r\n widget.trigger.onRefresh();\r\n } else {\r\n logger.warn(`Widget '${widgetId}' has no trigger.onRefresh registered.`);\r\n }\r\n }\r\n\r\n function refreshAll(): void {\r\n const registered = widgetService.getWidgets(bladeId);\r\n for (const widget of registered) {\r\n if (widget.trigger?.onRefresh) {\r\n widget.trigger.onRefresh();\r\n }\r\n }\r\n }\r\n\r\n return { refresh, refreshAll };\r\n}\r\n\r\n// ── Widget scope (for component-based external widgets) ─────────────────────\r\n\r\n// Re-export for backward compatibility (type moved to widget-service)\r\nexport type { IWidgetScope } from \"@core/services/widget-service\";\r\n\r\n/**\r\n * Registers a trigger contract (onRefresh, onClick, badge) for an external\r\n * component-based widget, so the hosting blade can call `refresh()` / `refreshAll()`.\r\n *\r\n * Uses provide/inject — no props or IDs needed. Must be called inside a widget\r\n * component rendered by WidgetContainer.\r\n *\r\n * @example\r\n * ```ts\r\n * // Inside an external widget component:\r\n * useWidgetTrigger({ onRefresh: loadData });\r\n * ```\r\n */\r\nexport function useWidgetTrigger(trigger: IWidgetTrigger): void {\r\n const scope = inject(WidgetScopeKey);\r\n if (!scope) {\r\n logger.warn(\"useWidgetTrigger() called outside WidgetContainer scope — trigger will not be registered.\");\r\n return;\r\n }\r\n scope.setTrigger(trigger);\r\n}\r\n\r\n// ── Internal ─────────────────────────────────────────────────────────────────\r\n\r\nfunction buildWidget(decl: HeadlessWidgetDeclaration): IWidget {\r\n const headless: IHeadlessWidgetFields = {\r\n icon: decl.icon,\r\n badge: decl.badge,\r\n loading: decl.loading,\r\n disabled: decl.disabled,\r\n onClick: decl.onClick,\r\n onRefresh: decl.onRefresh,\r\n };\r\n\r\n return {\r\n id: decl.id,\r\n title: decl.title,\r\n isVisible: decl.isVisible,\r\n headless,\r\n trigger: decl.onRefresh ? { onRefresh: decl.onRefresh } : undefined,\r\n };\r\n}\r\n","import { provide, inject, computed, toValue, isRef, type MaybeRefOrGetter, type ComputedRef } from \"vue\";\r\nimport { BladeContextKey } from \"@framework/injection-keys\";\r\nimport { InjectionError } from \"@core/utilities\";\r\n\r\n/**\r\n * Shallow-unwraps all ref/computed values in a record.\r\n * Plain values pass through unchanged.\r\n */\r\nfunction unwrapRecord(record: Record<string, unknown>): Record<string, unknown> {\r\n const result: Record<string, unknown> = {};\r\n for (const key of Object.keys(record)) {\r\n const val = record[key];\r\n result[key] = isRef(val) ? val.value : val;\r\n }\r\n return result;\r\n}\r\n\r\n/**\r\n * Exposes blade data for external widgets, extensions, and nested components.\r\n * Must be called in blade's `<script setup>`.\r\n *\r\n * All ref/computed values in the provided object are **automatically unwrapped**\r\n * so consumers can access them directly without `.value`.\r\n *\r\n * @example\r\n * ```ts\r\n * defineBladeContext({ item, disabled });\r\n * // consumer: ctx.value.item — already unwrapped, no .value needed\r\n * ```\r\n */\r\nexport function defineBladeContext(data: MaybeRefOrGetter<Record<string, unknown>>): void {\r\n provide(\r\n BladeContextKey,\r\n computed(() => unwrapRecord(toValue(data))),\r\n );\r\n}\r\n\r\n/**\r\n * Injects blade context provided by the nearest ancestor blade via `defineBladeContext`.\r\n * Returns a ComputedRef — access fields via `.value`.\r\n * Nested refs are already unwrapped by `defineBladeContext`.\r\n * Throws if no context is found.\r\n *\r\n * @example\r\n * ```ts\r\n * const ctx = injectBladeContext();\r\n * const entityId = computed(() => ctx.value.id as string);\r\n * ```\r\n */\r\nexport function injectBladeContext(): ComputedRef<Record<string, unknown>> {\r\n const ctx = inject<ComputedRef<Record<string, unknown>>>(BladeContextKey);\r\n if (!ctx) {\r\n throw new InjectionError(\"BladeContext\");\r\n }\r\n return ctx;\r\n}\r\n","import { ref, watch, Ref, computed, DeepReadonly, unref, isRef } from \"vue\";\nimport { cloneDeep, isEqualWith } from \"lodash-es\";\n\n/**\n * Custom comparator for deep equality that treats null, undefined, and \"\"\n * as semantically equivalent \"empty\" values.\n * This prevents false modification detection when APIs return null\n * but local state uses undefined or empty strings (common with language switching).\n */\nfunction isEmpty(value: unknown): boolean {\n return value === null || value === undefined || value === \"\";\n}\n\nfunction semanticEqual(a: unknown, b: unknown): boolean {\n return isEqualWith(a, b, (valA: unknown, valB: unknown) => {\n if (isEmpty(valA) && isEmpty(valB)) return true;\n return undefined; // fall back to default deep comparison\n });\n}\n\n/**\n * Return values from useModificationTracker.\n * @template T Type of the tracked value.\n */\nexport interface UseModificationTrackerReturn<T> {\n /**\n * Reactive reference to the current tracked value.\n * It can be changed directly or through v-model.\n */\n currentValue: Ref<T>;\n /**\n * Reactive reference to the pristine value.\n * It is a \"clean\" version representing the original, unmodified state.\n */\n pristineValue: Ref<T>;\n /**\n * Shows if currentValue has been modified compared to its \"pristine\" state.\n * Read-only.\n */\n isModified: DeepReadonly<Ref<boolean>>;\n /**\n * Resets the modification state.\n * The new \"pristine\" state will be set based on the current value of currentValue,\n * or based on `newBaselineValue` if provided.\n * `isModified` will become false.\n * @param newBaselineValue Optional new value (or Ref) that will become \"pristine\".\n */\n resetModificationState: (newBaselineValue?: T | Ref<T>) => void;\n}\n\n/**\n * Composable for tracking value changes (including deeply nested objects).\n *\n * @template T Type of the tracked value.\n * @param initialValueProp Initial value or Ref to it.\n * @returns {UseModificationTrackerReturn<T>} Object with `currentValue`, `isModified` and `resetModificationState`.\n */\nexport function useModificationTracker<T>(initialValueProp: T | Ref<T>): UseModificationTrackerReturn<T> {\n const getClonedUnreffedValue = (val: T | Ref<T>): T => cloneDeep(unref(val));\n\n const pristineValue = ref(getClonedUnreffedValue(initialValueProp)) as Ref<T>;\n const currentValue = ref(getClonedUnreffedValue(initialValueProp)) as Ref<T>;\n const isModified = ref(false);\n\n if (isRef(initialValueProp)) {\n watch(\n initialValueProp,\n (newExternalInitialValue) => {\n // When the external initialValueProp (Ref) changes,\n // we need to decide if we should update currentValue.\n const wasModified = !semanticEqual(currentValue.value, pristineValue.value);\n\n // Always update the \"pristine\" value (pristineValue), to reflect the new external source.\n pristineValue.value = cloneDeep(newExternalInitialValue);\n\n // If the user has not made any changes until this point,\n // we also update currentValue.\n // This prevents false triggering of isModified when loading data asynchronously.\n if (!wasModified) {\n currentValue.value = cloneDeep(newExternalInitialValue);\n }\n // If the user has already made changes (wasModified = true), we do not update currentValue,\n // to not overwrite their changes. isModified will remain true, because\n // currentValue will now be different from the new pristineValue.\n },\n { deep: true }, // Deep tracking, if initialValueProp is a Ref to an object/array\n );\n }\n\n watch(\n [currentValue, pristineValue], // Track changes in currentValue or pristineValue\n ([newCurrentVal, newPristineVal]) => {\n isModified.value = !semanticEqual(newCurrentVal, newPristineVal);\n },\n { deep: true },\n );\n\n const resetModificationState = (newBaselineValueInput?: T | Ref<T>) => {\n if (newBaselineValueInput !== undefined) {\n const newClonedBase = getClonedUnreffedValue(newBaselineValueInput);\n pristineValue.value = newClonedBase;\n currentValue.value = cloneDeep(newClonedBase); // Reset currentValue to the new baseline\n } else {\n pristineValue.value = cloneDeep(currentValue.value);\n }\n // Synchronously reset so that code running in the same tick (e.g. onBeforeClose)\n // sees the updated value before the deep watcher fires.\n isModified.value = false;\n };\n\n return {\n currentValue,\n pristineValue,\n isModified: computed(() => isModified.value),\n resetModificationState,\n };\n}\n","<template>\n <VcBlade\n :title=\"options?.asset?.name\"\n :subtitle=\"t('ASSETS.PAGES.DETAILS.SUBTITLE')\"\n :toolbar-items=\"bladeToolbar\"\n >\n <!-- Blade contents -->\n <div class=\"tw-flex tw-grow-1 tw-border-t tw-border-solid tw-border-t-[--assets-details-border]\">\n <div class=\"assets-details__content tw-grow tw-basis-0 tw-w-full tw-overflow-hidden\">\n <VcContainer :no-padding=\"true\">\n <div class=\"tw-p-4\">\n <VcForm>\n <div class=\"assets-details__header\">\n <template v-if=\"isImage(defaultAsset.name)\">\n <VcImage\n :src=\"defaultAsset.url\"\n size=\"xl\"\n :bordered=\"true\"\n class=\"tw-shrink-0\"\n ></VcImage>\n </template>\n <template v-else>\n <div class=\"assets-details__file-preview tw-shrink-0\">\n <div\n class=\"assets-details__file-badge\"\n :style=\"{ backgroundColor: getExtensionColor(defaultAsset.name) }\"\n >\n {{ getExtensionLabel(defaultAsset.name) }}\n </div>\n </div>\n </template>\n <div class=\"assets-details__meta\">\n <VcField\n :label=\"t('ASSETS.PAGES.DETAILS.FIELDS.SIZE')\"\n :model-value=\"readableSize(defaultAsset.size)\"\n />\n <VcField\n :label=\"t('ASSETS.PAGES.DETAILS.FIELDS.CREATED_DATE')\"\n :model-value=\"defaultAsset.createdDate\"\n type=\"date-ago\"\n />\n <VcField\n :label=\"t('ASSETS.PAGES.DETAILS.FIELDS.URL')\"\n :model-value=\"defaultAsset.url\"\n :display-value=\"defaultAsset.name\"\n type=\"link\"\n copyable\n />\n </div>\n </div>\n\n <Field\n v-if=\"!options?.hiddenFields?.includes('name')\"\n v-slot=\"{ errorMessage, handleChange, errors }\"\n :label=\"t('ASSETS.PAGES.DETAILS.FIELDS.NAME.TITLE')\"\n name=\"asset_name\"\n rules=\"required\"\n :model-value=\"defaultAsset.name\"\n >\n <VcInput\n v-model=\"assetNameClean\"\n class=\"tw-mb-4\"\n :label=\"t('ASSETS.PAGES.DETAILS.FIELDS.NAME.TITLE')\"\n clearable\n required\n :error=\"!!errors.length\"\n :error-message=\"errorMessage\"\n :placeholder=\"t('ASSETS.PAGES.DETAILS.FIELDS.NAME.PLACEHOLDER')\"\n :disabled=\"readonly\"\n @update:model-value=\"handleChange\"\n ></VcInput>\n </Field>\n <VcInput\n v-if=\"assetType === 'Image' && !options?.hiddenFields?.includes('altText')\"\n v-model=\"defaultAsset.altText\"\n class=\"tw-mb-4\"\n :label=\"t('ASSETS.PAGES.DETAILS.FIELDS.ALT.TITLE')\"\n clearable\n :placeholder=\"t('ASSETS.PAGES.DETAILS.FIELDS.ALT.PLACEHOLDER')\"\n :tooltip=\"t('ASSETS.PAGES.DETAILS.FIELDS.ALT.TOOLTIP')\"\n :disabled=\"readonly\"\n ></VcInput>\n <VcTextarea\n v-if=\"!options?.hiddenFields?.includes('description')\"\n v-model=\"defaultAsset.description\"\n class=\"tw-mb-4\"\n :label=\"t('ASSETS.PAGES.DETAILS.FIELDS.DESCRIPTION.TITLE')\"\n :placeholder=\"t('ASSETS.PAGES.DETAILS.FIELDS.DESCRIPTION.PLACEHOLDER')\"\n :disabled=\"readonly\"\n ></VcTextarea>\n </VcForm>\n </div>\n </VcContainer>\n </div>\n </div>\n </VcBlade>\n</template>\n\n<script lang=\"ts\">\nimport { __registerBladeConfig } from \"@vc-shell/framework\";\n__registerBladeConfig(\"AssetsDetails\", { });\n</script>\n<script lang=\"ts\" setup>\nimport type { IBladeToolbar } from \"@core/types\";\nimport type { AssetLike } from \"@core/composables/useAssetsManager\";\nimport { computed, ref } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport { VcBlade } from \"@ui/components/organisms/vc-blade\";\nimport { VcContainer } from \"@ui/components/atoms/vc-container\";\nimport { VcForm } from \"@ui/components/molecules/vc-form\";\nimport { VcImage } from \"@ui/components/atoms/vc-image\";\nimport { VcInput } from \"@ui/components/molecules/vc-input\";\nimport { VcTextarea } from \"@ui/components/molecules/vc-textarea\";\nimport { VcField } from \"@ui/components/molecules/vc-field\";\nimport { isImage, readableSize, getExtensionColor, getExtensionLabel } from \"@core/utilities/assets\";\nimport { useIsFormValid, Field, useForm, useIsFormDirty } from \"vee-validate\";\nimport { useBlade } from \"@core/composables/useBlade\";\n\ninterface AssetsDetailsOptions {\n asset: AssetLike;\n disabled?: boolean;\n hiddenFields?: string[];\n assetEditHandler?: (defaultAsset: AssetLike) => void;\n assetRemoveHandler?: (defaultAsset: AssetLike) => Promise<void>;\n}\n\ndefineOptions({ name: \"AssetsDetails\" });\n\n\nconst { options, closeSelf } = useBlade<AssetsDetailsOptions>();\n\nuseForm({ validateOnMount: false });\nconst isValid = useIsFormValid();\nconst isDirty = useIsFormDirty();\nconst { t } = useI18n({ useScope: \"global\" });\nconst defaultAsset = ref<AssetLike>({ ...options.value?.asset });\n\nconst readonly = computed(() => options.value?.disabled);\n\nconst assetNameClean = computed({\n get() {\n const name = defaultAsset.value.name;\n if (!name) return \"\";\n const dotIndex = name.lastIndexOf(\".\");\n return dotIndex > 0 ? name.slice(0, dotIndex) : name;\n },\n set(value) {\n const name = defaultAsset.value.name;\n if (!name) return;\n const dotIndex = name.lastIndexOf(\".\");\n const ext = dotIndex > 0 ? name.slice(dotIndex) : \"\";\n defaultAsset.value.name = value ? value + ext : \"\";\n },\n});\n\nconst isDisabled = computed(() => {\n return !isDirty.value || !isValid.value;\n});\n\nconst bladeToolbar = ref<IBladeToolbar[]>([\n {\n id: \"save\",\n title: t(\"ASSETS.PAGES.DETAILS.TOOLBAR.SAVE\"),\n icon: \"lucide-save\",\n async clickHandler() {\n if (options.value?.assetEditHandler && typeof options.value?.assetEditHandler === \"function\") {\n await options.value?.assetEditHandler(defaultAsset.value);\n closeSelf();\n }\n },\n disabled: computed(() => isDisabled.value || readonly.value),\n },\n {\n id: \"delete\",\n title: t(\"ASSETS.PAGES.DETAILS.TOOLBAR.DELETE\"),\n icon: \"lucide-trash-2\",\n async clickHandler() {\n if (options.value?.assetRemoveHandler && typeof options.value?.assetRemoveHandler === \"function\") {\n await options.value?.assetRemoveHandler(defaultAsset.value);\n closeSelf();\n }\n },\n disabled: computed(() => readonly.value),\n },\n]);\n\nconst assetType = computed(() => defaultAsset.value?.typeId);\n</script>\n\n<style lang=\"scss\">\n:root {\n --assets-details-border: var(--neutrals-200);\n}\n\n.assets-details__header {\n @apply tw-flex tw-mb-4;\n @apply tw-overflow-hidden;\n}\n\n.assets-details__meta {\n @apply tw-flex tw-flex-col tw-gap-3;\n @apply tw-ml-6 tw-min-w-0 tw-flex-1;\n @apply tw-overflow-hidden;\n}\n\n.assets-details__file-preview {\n @apply tw-w-[var(--image-size-xl)] tw-h-[var(--image-size-xl)];\n @apply tw-rounded-[var(--image-border-radius)];\n @apply tw-border tw-border-solid tw-border-[color:var(--image-border-color)];\n @apply tw-bg-[var(--neutrals-50)];\n @apply tw-flex tw-flex-col tw-items-center tw-justify-center;\n @apply tw-gap-2;\n @apply tw-overflow-hidden;\n}\n\n.assets-details__file-badge {\n @apply tw-flex tw-items-center tw-justify-center;\n @apply tw-px-3.5 tw-py-1.5;\n @apply tw-rounded-md;\n @apply tw-text-sm tw-font-bold tw-tracking-wide;\n @apply tw-text-white;\n}\n</style>\n","import _AssetsDetails from \"@modules/assets/components/assets-details/assets-details.vue\";\n\nexport const AssetsDetails = _AssetsDetails as typeof _AssetsDetails;\n","import { defineAppModule } from \"@core/plugins/modularity\";\nimport * as components from \"@modules/assets/components\";\n\nexport const AssetsDetailsModule = defineAppModule({ blades: components });\n\nexport default components;\n","<template>\n <VcBlade\n :title=\"bladeTitle\"\n :toolbar-items=\"bladeToolbar\"\n width=\"70%\"\n >\n <div\n v-loading=\"isLoading\"\n class=\"tw-relative tw-h-full tw-flex-1\"\n @dragover.prevent.stop=\"dragOver\"\n @dragleave.prevent=\"dragLeave\"\n @drop.prevent.stop=\"onDrop\"\n >\n <!-- @vue-generic {AssetLike} -->\n <VcDataTable\n v-model:selection=\"selectedItems\"\n :items=\"defaultAssets\"\n state-key=\"assets_manager\"\n :reorderable-rows=\"!readonly\"\n :selection-mode=\"!readonly ? 'multiple' : undefined\"\n :row-actions=\"!readonly ? actionBuilder : undefined\"\n :empty-state=\"{\n icon: 'lucide-cloud-upload',\n title: $t('ASSETS_MANAGER.EMPTY.UPLOAD_ASSETS'),\n actionLabel: $t('ASSETS_MANAGER.EMPTY.UPLOAD'),\n actionHandler: toggleUploader,\n }\"\n class=\"tw-h-full tw-w-full\"\n @row-click=\"({ data }) => onItemClick(data)\"\n @row-reorder=\"sortAssets\"\n >\n <VcColumn\n id=\"url\"\n :title=\"t('ASSETS_MANAGER.TABLE.HEADER.IMAGE')\"\n width=\"10%\"\n always-visible\n type=\"image\"\n >\n <template #body=\"{ data }\">\n <div class=\"tw-flex tw-items-center tw-justify-center\">\n <template v-if=\"isImage(data.name ?? '')\">\n <VcImage\n :bordered=\"true\"\n size=\"s\"\n aspect=\"1x1\"\n :src=\"data.url\"\n background=\"contain\"\n ></VcImage>\n </template>\n <template v-else>\n <div\n class=\"assets-manager__file-badge\"\n :style=\"{ backgroundColor: getExtensionColor(data.name ?? '') }\"\n >\n {{ getExtensionLabel(data.name ?? \"\") }}\n </div>\n </template>\n </div>\n </template>\n </VcColumn>\n\n <VcColumn\n id=\"name\"\n :title=\"t('ASSETS_MANAGER.TABLE.HEADER.NAME')\"\n width=\"20%\"\n always-visible\n />\n\n <VcColumn\n id=\"size\"\n :title=\"t('ASSETS_MANAGER.TABLE.HEADER.SIZE')\"\n width=\"20%\"\n always-visible\n >\n <template #body=\"{ data }\">\n <div>\n {{ readableSize(data.size ?? 0) }}\n </div>\n </template>\n </VcColumn>\n\n <VcColumn\n id=\"sortOrder\"\n :title=\"t('ASSETS_MANAGER.TABLE.HEADER.SORT_ORDER')\"\n width=\"25%\"\n always-visible\n >\n <template #body=\"{ data }\">\n <div>\n {{ data.sortOrder }}\n </div>\n </template>\n </VcColumn>\n\n <VcColumn\n id=\"createdDate\"\n :title=\"t('ASSETS_MANAGER.TABLE.HEADER.CREATED_DATE')\"\n width=\"25%\"\n type=\"date-ago\"\n always-visible\n />\n </VcDataTable>\n </div>\n\n <input\n ref=\"uploader\"\n type=\"file\"\n hidden\n multiple\n name=\"assets_manager\"\n @change=\"inputUpload\"\n />\n </VcBlade>\n</template>\n\n<script lang=\"ts\">\nimport { __registerBladeConfig } from \"@vc-shell/framework\";\n__registerBladeConfig(\"AssetsManager\", { });\n</script>\n<script setup lang=\"ts\">\nimport type { AssetLike, UseAssetsManagerReturn } from \"@core/composables/useAssetsManager\";\nimport { IBladeToolbar } from \"@core/types\";\nimport { ref, computed, unref } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport { isImage, readableSize, getExtensionColor, getExtensionLabel } from \"@core/utilities/assets\";\nimport { useBlade } from \"@core/composables/useBlade\";\nimport { createLogger } from \"@core/utilities\";\nimport { TableAction } from \"@ui/components/organisms/vc-data-table/types\";\nimport { VcBlade, VcColumn, VcDataTable, VcImage } from \"@ui/components\";\nimport { vLoading } from \"@core/directives\";\n\nconst logger = createLogger(\"assets-manager\");\n\ninterface AssetsManagerOptions {\n title?: string;\n manager: UseAssetsManagerReturn;\n disabled?: boolean;\n hiddenFields?: string[];\n}\n\ndefineOptions({ name: \"AssetsManager\" });\n\n\nconst { options, openBlade } = useBlade<AssetsManagerOptions>();\n\nconst { t } = useI18n({ useScope: \"global\" });\n\nconst manager = computed(() => options.value!.manager);\n\nconst defaultAssets = computed(() => manager.value.items.value ?? []);\n\nconst isLoading = computed(() => manager.value.loading.value);\n\nconst bladeTitle = computed(() => options.value?.title || t(\"ASSETS_MANAGER.TITLE\"));\n\nconst isDragging = ref(false);\nconst uploader = ref();\nconst selectedItems = ref<AssetLike[]>([]);\nconst readonly = computed(() => options.value?.disabled);\n\nconst bladeToolbar = ref<IBladeToolbar[]>([\n {\n id: \"add\",\n title: computed(() => t(\"ASSETS_MANAGER.TOOLBAR.ADD\")),\n icon: \"lucide-plus\",\n clickHandler() {\n toggleUploader();\n },\n disabled: computed(() => readonly.value),\n isVisible: computed(() => !readonly.value),\n },\n {\n id: \"delete\",\n title: computed(() => t(\"ASSETS_MANAGER.TOOLBAR.DELETE\")),\n icon: \"lucide-trash-2\",\n async clickHandler() {\n await manager.value.removeMany(selectedItems.value);\n },\n disabled: computed(() => !selectedItems.value.length || readonly.value),\n isVisible: computed(() => !readonly.value),\n },\n]);\n\nasync function sortAssets(event: { dragIndex: number; dropIndex: number; value: AssetLike[] }) {\n if (event.dragIndex !== event.dropIndex) {\n const sorted = event.value.map((item, index) => {\n item.sortOrder = index;\n return item;\n });\n\n manager.value.reorder(sorted);\n }\n}\n\nfunction dragOver() {\n if (!readonly.value) {\n isDragging.value = true;\n }\n}\n\nfunction dragLeave() {\n if (!readonly.value) {\n isDragging.value = false;\n }\n}\n\nasync function onDrop(event: DragEvent) {\n if (!readonly.value) {\n const fileList = event.dataTransfer?.files;\n\n if (fileList && fileList.length) {\n try {\n await upload(fileList);\n } catch (error) {\n logger.error(\"Failed to upload dropped files:\", error);\n throw error;\n }\n }\n isDragging.value = false;\n }\n}\n\nfunction toggleUploader() {\n uploader.value.value = \"\";\n uploader.value.click();\n}\n\nasync function upload(files: FileList) {\n if (!files || files.length === 0) return;\n\n const existingNames = new Set((defaultAssets.value ?? []).map((asset) => asset.name).filter(Boolean));\n\n const transfer = new DataTransfer();\n for (const file of Array.from(files)) {\n let fileName = file.name;\n\n if (existingNames.has(fileName)) {\n const ext = fileName.includes(\".\") ? `.${fileName.split(\".\").pop()}` : \"\";\n const base = fileName.slice(0, fileName.length - ext.length);\n let i = 1;\n while (existingNames.has(fileName)) {\n fileName = `${base}_${i}${ext}`;\n i++;\n }\n }\n\n existingNames.add(fileName);\n transfer.items.add(new File([file], fileName, { type: file.type }));\n }\n\n try {\n const maxSortOrder = defaultAssets.value.reduce((max, asset) => Math.max(max, asset.sortOrder ?? 0), -1);\n await manager.value.upload(transfer.files, maxSortOrder);\n } catch (error) {\n logger.error(\"Failed to upload assets:\", error);\n throw error;\n }\n}\n\nasync function inputUpload(event: Event) {\n const target = event.target as HTMLInputElement;\n const fileList = target.files;\n\n if (fileList && fileList.length) {\n try {\n await upload(fileList);\n } catch (error) {\n logger.error(\"Failed to upload files:\", error);\n throw error;\n }\n }\n}\n\nfunction onItemClick(item: AssetLike) {\n openBlade({\n name: \"AssetsDetails\",\n options: {\n asset: unref(item),\n disabled: readonly.value,\n hiddenFields: options.value?.hiddenFields,\n assetEditHandler: (asset: AssetLike) => {\n manager.value.updateItem(asset);\n },\n assetRemoveHandler: async (asset: AssetLike) => {\n await manager.value.remove(asset);\n },\n },\n }).catch((error) => {\n logger.error(\"Failed to open AssetsDetails blade:\", error);\n });\n}\n\nconst actionBuilder = (): TableAction[] => {\n return [\n {\n icon: \"lucide-trash-2\",\n title: computed(() => t(\"ASSETS_MANAGER.TABLE.ACTIONS.DELETE\")),\n type: \"danger\",\n async clickHandler(item: AssetLike) {\n await manager.value.remove(item);\n selectedItems.value = [];\n },\n },\n ];\n};\n</script>\n\n<style lang=\"scss\">\n:root {\n --assets-manager-empty-icon-color: var(--primary-400);\n --assets-manager-mobile-border: var(--info-100);\n}\n\n.assets-manager__file-badge {\n @apply tw-flex tw-items-center tw-justify-center;\n @apply tw-px-2.5 tw-py-1;\n @apply tw-rounded;\n @apply tw-text-xs tw-font-bold tw-tracking-wide;\n @apply tw-text-white;\n}\n</style>\n","import _AssetsManager from \"@modules/assets-manager/components/assets-manager/assets-manager.vue\";\n\nexport const AssetsManager = _AssetsManager as typeof _AssetsManager;\n","import { defineAppModule } from \"@core/plugins/modularity\";\nimport * as components from \"@modules/assets-manager/components\";\n\nexport const AssetsManagerModule = defineAppModule({ blades: components });\n\nexport * from \"@modules/assets-manager/components\";\n","import { watch, readonly, ref } from \"vue\";\r\nimport { useNetwork } from \"@vueuse/core\";\r\nimport { notification } from \"@core/notifications/notification\";\r\nimport { createLogger } from \"@core/utilities\";\r\n\r\nconst logger = createLogger(\"connection-status\");\r\n\r\nconst OFFLINE_NOTIFICATION_ID = \"vc-framework-offline-status\";\r\n\r\n// Module-level singleton state\r\nconst _isSetup = ref(false);\r\nconst _isOnline = ref(true);\r\n\r\nexport interface UseConnectionStatusReturn {\r\n isOnline: Readonly<typeof _isOnline>;\r\n}\r\n\r\n/** @deprecated Use UseConnectionStatusReturn instead */\r\nexport type UseConnectionStatus = UseConnectionStatusReturn;\r\n\r\nexport function useConnectionStatus(): UseConnectionStatusReturn {\r\n if (!_isSetup.value && typeof window !== \"undefined\") {\r\n _isSetup.value = true;\r\n\r\n const { isOnline } = useNetwork();\r\n\r\n watch(\r\n isOnline,\r\n (online) => {\r\n _isOnline.value = online;\r\n\r\n if (!online) {\r\n logger.warn(\"Network connection lost\");\r\n notification.warning(\"You are currently offline. Some features may be unavailable.\", {\r\n notificationId: OFFLINE_NOTIFICATION_ID,\r\n timeout: false,\r\n });\r\n document.documentElement.classList.add(\"vc-offline\");\r\n } else {\r\n logger.info(\"Network connection restored\");\r\n notification.remove(OFFLINE_NOTIFICATION_ID);\r\n document.documentElement.classList.remove(\"vc-offline\");\r\n }\r\n },\r\n { immediate: true },\r\n );\r\n }\r\n\r\n return {\r\n isOnline: readonly(_isOnline),\r\n };\r\n}\r\n","import { computed, ref, watch, type Ref } from \"vue\";\nimport { createLogger } from \"@core/utilities\";\nimport { notification } from \"@core/notifications/notification\";\nimport { useConnectionStatus } from \"@core/composables/useConnectionStatus\";\n\nconst logger = createLogger(\"slow-network\");\nconst SLOW_REQUEST_THRESHOLD_MS = 10000;\nconst SLOW_EFFECTIVE_TYPES = [\"slow-2g\", \"2g\"];\nlet _connectionHandler: (() => void) | null = null;\n\nconst SLOW_NETWORK_NOTIFICATION_ID = \"vc-framework-slow-network\";\nconst DISMISS_DELAY_MS = 3000;\n// TODO: move to i18n locale files when useConnectionStatus also migrates to i18n\nconst SLOW_NETWORK_MESSAGE = \"Your network is slow or the server is taking longer than usual. Please be patient.\";\nlet _dismissTimer: ReturnType<typeof setTimeout> | null = null;\n\nfunction showSlowNotification() {\n notification.warning(SLOW_NETWORK_MESSAGE, {\n notificationId: SLOW_NETWORK_NOTIFICATION_ID,\n timeout: false,\n });\n}\n\nfunction hideSlowNotification() {\n notification.remove(SLOW_NETWORK_NOTIFICATION_ID);\n}\n\n// ── Module-level singleton state ────────────────────────────────────\nconst _isSetup = ref(false);\nconst _slowRequestCount = ref(0);\nconst _isSlowEffectiveType = ref(false);\nconst _pendingTimers = new Map<string, ReturnType<typeof setTimeout>>();\nconst _trackedSlowIds = new Set<string>();\n\nconst isSlowNetwork = computed(() => _slowRequestCount.value > 0 || _isSlowEffectiveType.value);\n\nexport interface UseSlowNetworkDetectionReturn {\n isSlowNetwork: Readonly<Ref<boolean>>;\n trackRequest(id: string): void;\n untrackRequest(id: string): void;\n}\n\nfunction trackRequest(id: string): void {\n const timer = setTimeout(() => {\n _slowRequestCount.value++;\n _pendingTimers.delete(id);\n _trackedSlowIds.add(id);\n }, SLOW_REQUEST_THRESHOLD_MS);\n _pendingTimers.set(id, timer);\n}\n\nfunction untrackRequest(id: string): void {\n const timer = _pendingTimers.get(id);\n if (timer != null) {\n // Request completed before threshold — cancel timer\n clearTimeout(timer);\n _pendingTimers.delete(id);\n } else if (_trackedSlowIds.has(id)) {\n // Timer already fired — decrement slow count\n _slowRequestCount.value = Math.max(0, _slowRequestCount.value - 1);\n _trackedSlowIds.delete(id);\n }\n // else: unknown id — no-op (defensive)\n}\n\nexport function useSlowNetworkDetection(): UseSlowNetworkDetectionReturn {\n if (!_isSetup.value && typeof window !== \"undefined\") {\n _isSetup.value = true;\n\n const connection = (navigator as any).connection;\n if (connection) {\n _connectionHandler = () => {\n const isSlow = SLOW_EFFECTIVE_TYPES.includes(connection.effectiveType);\n if (isSlow !== _isSlowEffectiveType.value) {\n logger.info(`Connection type: ${connection.effectiveType} → ${isSlow ? \"slow\" : \"normal\"}`);\n }\n _isSlowEffectiveType.value = isSlow;\n };\n connection.addEventListener(\"change\", _connectionHandler);\n _connectionHandler(); // initial check\n }\n\n const { isOnline } = useConnectionStatus();\n\n watch(isSlowNetwork, (slow) => {\n if (slow) {\n if (_dismissTimer != null) {\n clearTimeout(_dismissTimer);\n _dismissTimer = null;\n }\n if (isOnline.value) {\n logger.info(\"Slow network detected — showing notification\");\n showSlowNotification();\n }\n } else {\n _dismissTimer = setTimeout(() => {\n logger.info(\"Network recovered — hiding notification\");\n hideSlowNotification();\n _dismissTimer = null;\n }, DISMISS_DELAY_MS);\n }\n });\n\n watch(isOnline, (online) => {\n if (!online) {\n if (_dismissTimer != null) {\n clearTimeout(_dismissTimer);\n _dismissTimer = null;\n }\n hideSlowNotification();\n } else if (isSlowNetwork.value) {\n showSlowNotification();\n }\n });\n }\n\n return {\n isSlowNetwork,\n trackRequest,\n untrackRequest,\n };\n}\n\n/** Test-only: reset singleton state between tests. No-op in production builds. @internal — not public API. */\nexport const _resetForTest: (() => void) | undefined = import.meta.env.VITEST\n ? () => {\n const connection = (navigator as any).connection;\n if (connection && _connectionHandler) {\n connection.removeEventListener(\"change\", _connectionHandler);\n _connectionHandler = null;\n }\n if (_dismissTimer != null) {\n clearTimeout(_dismissTimer);\n _dismissTimer = null;\n }\n _isSetup.value = false;\n _slowRequestCount.value = 0;\n _isSlowEffectiveType.value = false;\n for (const timer of _pendingTimers.values()) {\n clearTimeout(timer);\n }\n _pendingTimers.clear();\n _trackedSlowIds.clear();\n }\n : undefined;\n","import { Router } from \"vue-router\";\nimport { useUserManagement } from \"@core/composables/useUserManagement\";\nimport { notification } from \"@core/notifications/notification\";\nimport { createLogger } from \"@core/utilities\";\nimport { isSessionExpired, markSessionExpired } from \"@core/utilities/sessionExpiration\";\nimport { useSlowNetworkDetection } from \"@core/composables/useSlowNetworkDetection\";\n\nconst logger = createLogger(\"interceptors\");\n\n// Paths a platform redirects an unauthenticated request to.\nconst LOGIN_PATH_PATTERN = /(^|\\/)(login|signin|sign-in|account\\/login|connect\\/authorize)(\\/|$)/i;\n\n/**\n * Detects a dead session that no status code reveals.\n *\n * Some platform configurations answer an unauthenticated API call with a redirect\n * to the login page instead of a 401. `fetch` follows that redirect transparently,\n * so the interceptor sees a 200 carrying HTML: the caller then parses a login page\n * as data and the UI silently renders \"nothing found\" while the session is gone.\n *\n * HTML alone is not the signal — an endpoint may legitimately serve a rendered\n * template or an export. It counts only when the request was also redirected away\n * from the endpoint that was asked. A login-shaped final URL is conclusive on its\n * own, for platforms that omit the content type.\n */\nfunction looksLikeLoginPage(response: Response): boolean {\n let pathname: string;\n try {\n pathname = new URL(response.url, window.location.origin).pathname;\n } catch {\n return false;\n }\n\n if (LOGIN_PATH_PATTERN.test(pathname)) {\n return true;\n }\n\n const contentType = response.headers?.get?.(\"content-type\") ?? \"\";\n return response.redirected === true && contentType.includes(\"text/html\");\n}\n\ntype PatchedFetch = typeof window.fetch & { __vcInterceptorsInstalled__?: true };\n\nexport function registerInterceptors(router: Router) {\n // Idempotency guard: a second install would wrap the already-wrapped fetch,\n // stacking timeouts, duplicate 401 sign-outs and slow-network tracking.\n // A brand on the function survives module reloads (HMR / test workers) while\n // living only within this tab.\n const existing = window.fetch as PatchedFetch;\n if (existing.__vcInterceptorsInstalled__) {\n logger.warn(\"registerInterceptors called twice — ignoring second install\");\n return window.fetch;\n }\n\n const { fetch: originalFetch } = window;\n const { signOut, isAuthenticated } = useUserManagement();\n const { trackRequest, untrackRequest } = useSlowNetworkDetection();\n let requestCounter = 0;\n\n const patched = (async (...args: Parameters<typeof window.fetch>) => {\n /**\n * Overrides the global `fetch` function to handle API calls in demo mode.\n * If `window.__DEMO_MODE__` is true, the fetch is cancelled and a warning is logged.\n * Otherwise, the original `fetch` function is called.\n * @param args - The arguments passed to the `fetch` function.\n * @returns A promise that resolves to the response from the API call.\n */\n if (window.__DEMO_MODE__) {\n logger.warn(\"CANCELLED FETCH WHILE IN __DEMO_MODE__: \", ...args);\n logger.warn(\"Please logout and add APP_PLATFORM_URL into .env file of your application to enable API calls\");\n return new Promise((resolve: any) => {\n /**\n * This conditions are mocking login, currentuser API calls for demo purposes.\n */\n if (args[0] === \"/api/platform/security/login\") {\n resolve({\n status: 200,\n text: async () => JSON.stringify({ succeeded: true }),\n });\n } else if (args[0] === \"/api/platform/security/currentuser\") {\n notification.warning(\n \"You are currently in DEMO mode until the first page refresh. \\n All API calls are disabled. Please add APP_PLATFORM_URL to your application's .env file to enable API calls.\",\n {\n timeout: 10000,\n },\n );\n resolve({\n status: 200,\n text: async () => JSON.stringify({ id: \"demo_user_id\", userName: \"DEMO_USER\" }),\n });\n } else {\n resolve({\n status: 200,\n text: async () => JSON.stringify({}),\n });\n }\n });\n } else {\n const [resource, init] = args;\n\n function isApiRequest(input: RequestInfo | URL): boolean {\n const raw = typeof input === \"string\" ? input : input instanceof Request ? input.url : input.toString();\n\n try {\n const url = new URL(raw, window.location.origin);\n return url.origin === window.location.origin && url.pathname.startsWith(\"/api/\");\n } catch {\n return false;\n }\n }\n\n // Scope hardening only to platform API calls\n if (!isApiRequest(resource)) {\n return originalFetch(...args);\n }\n\n if (!navigator.onLine) {\n logger.warn(\"Request blocked: browser is offline\", resource);\n return Promise.reject(new Error(\"Network unavailable. Please check your connection.\"));\n }\n\n const requestId = String(++requestCounter);\n trackRequest(requestId);\n\n // Always enforce timeout, but preserve external cancellation semantics\n const controller = new AbortController();\n let didTimeout = false;\n const timeoutId = setTimeout(() => {\n didTimeout = true;\n controller.abort();\n }, 30000);\n\n const externalSignal = init?.signal;\n const abortFromExternal = () => controller.abort();\n if (externalSignal?.aborted) {\n abortFromExternal();\n } else if (externalSignal) {\n externalSignal.addEventListener(\"abort\", abortFromExternal, { once: true });\n }\n\n try {\n const response = await originalFetch(resource, {\n ...(init || {}),\n signal: controller.signal,\n });\n\n /**\n * If the response is unauthorized, logout the user\n */\n // A 401 on a session we still believe is alive means the cookie died under us.\n // Flag it before returning the 401 to the caller, so the data-load errors it\n // triggers (blade banners + toasts on the page that was mid-navigation) are\n // suppressed in favour of a single clean redirect to login.\n //\n // The flag doubles as an \"already handling it\" latch: concurrent 401s from the\n // same dead session are suppressed by it but skip this branch, so sign-out,\n // redirect and toast happen exactly once. It is deliberately not set when we\n // are not signed in — a 401 we don't act on must not silence the whole app.\n // A 401 is the explicit signal; a successful response that is actually the\n // login page is the same death reported differently (see looksLikeLoginPage).\n // A 403 is deliberately excluded — authenticated-but-unauthorized is not an\n // expired session, and signing the user out over it would be wrong.\n const sessionDied = response.status === 401 || (response.ok && looksLikeLoginPage(response));\n\n if (sessionDied && !isSessionExpired() && isAuthenticated.value) {\n markSessionExpired();\n\n signOut()\n .catch((err) => {\n logger.error(\"signOut failed after session expiry:\", err);\n })\n .finally(() => {\n redirect(router);\n notification.error(\n \"Access Denied: Your session has expired or you do not have the necessary permissions.\\nPlease log in again or contact the administrator for assistance.\",\n );\n });\n }\n\n return response;\n } catch (e) {\n if (didTimeout) {\n throw new Error(\"Request timed out. Please try again.\");\n }\n throw e;\n } finally {\n untrackRequest(requestId);\n clearTimeout(timeoutId);\n if (externalSignal) {\n externalSignal.removeEventListener(\"abort\", abortFromExternal);\n }\n }\n }\n }) as PatchedFetch;\n\n patched.__vcInterceptorsInstalled__ = true;\n window.fetch = patched;\n return patched;\n}\n\nfunction redirect(router: Router) {\n // redirect to login page if it exists\n if (router && router.getRoutes().some((route) => route.path === \"/login\" || route.name === \"Login\")) {\n if (router.currentRoute.value.path !== \"/login\") {\n router.push(\"/login\");\n }\n } else {\n // Use the origin to redirect to the root of the application if no login page exists.\n // Usually this is the case when the application is used as a module.\n window.location.href = window.location.origin + \"/\";\n }\n}\n","import type { App } from \"vue\";\r\nimport { notification } from \"@core/notifications/notification\";\r\nimport { parseError } from \"@core/utilities/error\";\r\nimport { createLogger } from \"@core/utilities\";\r\n\r\nconst logger = createLogger(\"global-error-handler\");\r\n\r\nfunction errorKey(err: unknown): string {\r\n if (err instanceof Error) return `${err.name}:${err.message}`;\r\n return String(err);\r\n}\r\n\r\nconst recentErrors = new Map<string, number>();\r\nconst DEDUP_WINDOW_MS = 3000;\r\ntype WindowWithVcGlobalHandlers = Window & { __VC_GLOBAL_ERROR_HANDLERS_INSTALLED__?: boolean };\r\n\r\nfunction isDuplicate(err: unknown): boolean {\r\n const key = errorKey(err);\r\n const now = Date.now();\r\n const last = recentErrors.get(key);\r\n if (last && now - last < DEDUP_WINDOW_MS) return true;\r\n recentErrors.set(key, now);\r\n if (recentErrors.size > 50) {\r\n for (const [k, t] of recentErrors) {\r\n if (now - t > DEDUP_WINDOW_MS) recentErrors.delete(k);\r\n }\r\n }\r\n return false;\r\n}\r\n\r\nexport function setupGlobalErrorHandlers(app: App): void {\r\n // 1. Vue component errors — chain to existing handler\r\n const existingHandler = app.config.errorHandler;\r\n app.config.errorHandler = (err, instance, info) => {\r\n logger.error(\"Unhandled Vue error:\", err, \"\\nInfo:\", info);\r\n if (!isDuplicate(err)) {\r\n const parsed = parseError(err);\r\n notification.error(parsed.message, {\r\n timeout: 8000,\r\n notificationId: `global-vue-${errorKey(err)}`,\r\n });\r\n }\r\n existingHandler?.(err, instance, info);\r\n };\r\n\r\n if (typeof window === \"undefined\") return;\r\n const win = window as WindowWithVcGlobalHandlers;\r\n\r\n // Idempotency guard: prevent duplicated listeners when framework is installed multiple times\r\n if (win.__VC_GLOBAL_ERROR_HANDLERS_INSTALLED__) return;\r\n win.__VC_GLOBAL_ERROR_HANDLERS_INSTALLED__ = true;\r\n\r\n const onUnhandledRejection = (event: PromiseRejectionEvent) => {\r\n logger.error(\"Unhandled rejection:\", event.reason);\r\n if (!isDuplicate(event.reason)) {\r\n const parsed = parseError(event.reason);\r\n notification.error(parsed.message, {\r\n timeout: 8000,\r\n notificationId: `global-rejection-${errorKey(event.reason)}`,\r\n });\r\n }\r\n };\r\n\r\n // 2. Unhandled promise rejections\r\n window.addEventListener(\"unhandledrejection\", onUnhandledRejection);\r\n\r\n const onWindowError = (event: ErrorEvent) => {\r\n if (!event.error) return;\r\n logger.error(\"Uncaught error:\", event.error);\r\n if (!isDuplicate(event.error)) {\r\n const parsed = parseError(event.error);\r\n notification.error(parsed.message, {\r\n timeout: 8000,\r\n notificationId: `global-error-${errorKey(event.error)}`,\r\n });\r\n }\r\n };\r\n\r\n // 3. Uncaught JS errors\r\n window.addEventListener(\"error\", onWindowError);\r\n}\r\n","import { App } from \"vue\";\nimport { NotificationPosition } from \"@core/notifications/toast-types\";\nimport { createLogger } from \"@core/utilities\";\n\nconst logger = createLogger(\"notification-instance\");\n\ninterface IUseInstance {\n saveInstance(app: App<Element>, id: string, position: NotificationPosition): void;\n unmountComponent(position?: NotificationPosition): void;\n clearContainer(): void;\n getInstanceByPosition(position: NotificationPosition): App<Element> | undefined;\n}\n\n// Instance storage for different positions\nconst containerInstances: Record<NotificationPosition, App<Element> | undefined> = {\n \"top-center\": undefined,\n \"top-right\": undefined,\n \"top-left\": undefined,\n \"bottom-center\": undefined,\n \"bottom-right\": undefined,\n \"bottom-left\": undefined,\n};\n\nexport function useInstance(): IUseInstance {\n function saveInstance(app: App<Element>, id: string, position: NotificationPosition) {\n const container = document.getElementById(id);\n if (container) {\n containerInstances[position] = app;\n }\n }\n\n function unmountComponent(position?: NotificationPosition) {\n try {\n if (position) {\n // Remove specific container by position\n if (containerInstances[position]) {\n containerInstances[position]?.unmount();\n document.getElementById(`notification-${position}`)?.remove();\n containerInstances[position] = undefined;\n }\n } else {\n // Remove all containers\n Object.keys(containerInstances).forEach((pos) => {\n const position = pos as NotificationPosition;\n containerInstances[position]?.unmount();\n document.getElementById(`notification-${position}`)?.remove();\n containerInstances[position] = undefined;\n });\n\n // Remove the root container if there are no active containers\n const hasActiveContainers = Object.values(containerInstances).some((instance) => instance !== undefined);\n if (!hasActiveContainers) {\n document.querySelector(\".notification\")?.remove();\n }\n }\n } catch (error) {\n logger.error(\"Failed to unmount notification component:\", error);\n }\n }\n\n function clearContainer() {\n Object.keys(containerInstances).forEach((pos) => {\n if (containerInstances[pos as NotificationPosition]) {\n unmountComponent(pos as NotificationPosition);\n }\n });\n }\n\n function getInstanceByPosition(position: NotificationPosition): App<Element> | undefined {\n return containerInstances[position];\n }\n\n return {\n saveInstance,\n unmountComponent,\n clearContainer,\n getInstanceByPosition,\n };\n}\n","import { createApp, nextTick, reactive, ref, Ref } from \"vue\";\nimport {\n NotificationOptions,\n NotificationPosition,\n NotificationContainerStateKey,\n} from \"@core/notifications/toast-types\";\nimport { useInstance } from \"@shell/_internal/notifications/composables/useInstance\";\nimport * as _ from \"lodash-es\";\nimport { generateId, createLogger } from \"@core/utilities\";\nimport { i18n } from \"@core/plugins/i18n\";\n\nconst logger = createLogger(\"notification-container\");\n\ninterface IUseContainer {\n defaultOptions: NotificationOptions;\n notificationContainers: Record<NotificationPosition, Ref<NotificationOptions[]>>;\n actions: {\n add(options: NotificationOptions): void;\n remove(id: string | number): void;\n clear(): void;\n dismiss(notificationId: string | number): void;\n update(option: NotificationOptions): void;\n setPosition(position: NotificationPosition): void;\n };\n getAllNotifications(): NotificationOptions[];\n getNotificationsByPosition(position: NotificationPosition): NotificationOptions[];\n appendInstance(options: NotificationOptions): void;\n generateNotificationId(): string;\n getNotification(notificationId: string | number): NotificationOptions | undefined;\n hasNotification(notificationId: string | number): boolean;\n}\n\n// Create containers for each position\nconst notificationContainers: Record<NotificationPosition, Ref<NotificationOptions[]>> = {\n \"top-center\": ref([]),\n \"top-right\": ref([]),\n \"top-left\": ref([]),\n \"bottom-center\": ref([]),\n \"bottom-right\": ref([]),\n \"bottom-left\": ref([]),\n};\n\nconst { clearContainer, unmountComponent, saveInstance, getInstanceByPosition } = useInstance();\n\nexport function useContainer(): IUseContainer {\n const defaultOptions = reactive<NotificationOptions>({\n timeout: 3000,\n pauseOnHover: true,\n position: \"top-center\",\n });\n\n function getAllNotifications() {\n // Combine notifications from all positions\n return Object.values(notificationContainers).flatMap((container) => container.value);\n }\n\n function getNotificationsByPosition(position: NotificationPosition) {\n return notificationContainers[position].value;\n }\n\n function getNotification(notificationId: string | number) {\n return getAllNotifications().find((item) => item.notificationId === notificationId);\n }\n\n function generateRoot(position: NotificationPosition) {\n const rootInstance = document.querySelector(\".notification\");\n const container = rootInstance || document.createElement(\"div\");\n\n // Check if a container already exists for the specified position\n const positionSelector = `.notification__container[data-position=\"${position}\"]`;\n let renderRoot = document.querySelector(positionSelector) as HTMLElement | null;\n\n // If there is no container for this position, create a new one\n if (!renderRoot) {\n renderRoot = document.createElement(\"div\");\n renderRoot.className = \"notification__container\";\n renderRoot.id = `notification-${position}`;\n renderRoot.setAttribute(\"data-position\", position);\n\n if (!rootInstance) {\n container.className = \"notification\";\n document.body.appendChild(container);\n }\n\n container.appendChild(renderRoot);\n }\n\n return renderRoot;\n }\n\n const pendingMounts = new Map<NotificationPosition, Promise<void>>();\n\n async function appendInstance(options: NotificationOptions) {\n const position = options.position || (defaultOptions.position as NotificationPosition);\n\n // Wait for any in-flight mount for this position to finish first\n const pending = pendingMounts.get(position);\n if (pending) {\n await pending;\n }\n\n if (!getInstanceByPosition(position)) {\n const mountPromise = (async () => {\n const dom = generateRoot(position);\n const { default: NotificationContainer } =\n await import(\"@shell/_internal/notifications/components/notification-container\");\n const instance = createApp(NotificationContainer, {\n ...(options as Record<string, unknown>),\n position,\n });\n // Notifications mount as their own Vue app root, so the main app's plugins\n // aren't inherited — install i18n here so $t works in VcToast and children.\n instance.use(i18n);\n instance.provide(NotificationContainerStateKey, { notificationContainers, actions });\n instance.mount(dom);\n saveInstance(instance, dom.id, position);\n })();\n\n pendingMounts.set(position, mountPromise);\n await mountPromise;\n pendingMounts.delete(position);\n }\n\n nextTick(() => {\n if (options.updateId) {\n actions.update(options);\n } else {\n actions.add(options);\n }\n });\n }\n\n function hasNotification(notificationId: string | number): boolean {\n return getAllNotifications().some((item) => item.notificationId === notificationId);\n }\n\n const actions = {\n add(options: NotificationOptions) {\n const position = options.position || (defaultOptions.position as NotificationPosition);\n const containers = notificationContainers[position];\n const exists = containers.value.find((item) => item.notificationId === options.notificationId);\n\n if (!exists) {\n nextTick(() => {\n containers.value.push(options);\n if (options.onOpen && typeof options?.onOpen === \"function\") {\n options.onOpen(options.payload);\n }\n });\n }\n },\n\n remove(id: string | number) {\n if (id) {\n // Find the notification among all containers\n let notification: NotificationOptions | undefined;\n let positionToRemoveFrom: NotificationPosition | undefined;\n\n // Search in which container the notification is located\n Object.entries(notificationContainers).forEach(([pos, container]) => {\n const found = container.value.find((item) => item.notificationId === id);\n if (found) {\n notification = found;\n positionToRemoveFrom = pos as NotificationPosition;\n }\n });\n\n if (positionToRemoveFrom) {\n // Remove the notification from the corresponding container\n notificationContainers[positionToRemoveFrom].value = notificationContainers[\n positionToRemoveFrom\n ].value.filter((item) => item.notificationId !== id);\n\n // If container is empty, unmount it\n if (notificationContainers[positionToRemoveFrom].value.length === 0) {\n unmountComponent(positionToRemoveFrom);\n }\n\n // Call the onClose callback\n nextTick(() => {\n if (notification?.onClose && typeof notification?.onClose === \"function\") {\n notification.onClose(notification.payload);\n }\n });\n }\n }\n },\n\n clear() {\n clearContainer();\n // Clear all containers\n Object.values(notificationContainers).forEach((container) => {\n container.value = [];\n });\n },\n\n dismiss(notificationId: string | number) {\n if (!notificationId) return;\n\n // Mark the notification as dismissing — VcToast watches this flag\n // and handles its own exit animation, then emits 'close' when done.\n let found = false;\n Object.values(notificationContainers).forEach((container) => {\n container.value.forEach((item) => {\n if (item.notificationId === notificationId) {\n item.dismissing = true;\n found = true;\n }\n });\n });\n\n // If notification wasn't found (already removed or never existed), no-op\n if (!found) {\n logger.debug(`dismiss: notification ${notificationId} not found`);\n }\n },\n\n update(option: NotificationOptions) {\n if (option.updateId) {\n // Find the notification across all containers\n let notification: NotificationOptions | undefined;\n let containerToUpdate: Ref<NotificationOptions[]> | undefined;\n let containerPosition: NotificationPosition | undefined;\n\n // First check all containers\n Object.entries(notificationContainers).forEach(([pos, container]) => {\n const found = container.value.find((item) => item.notificationId === option.notificationId);\n if (found) {\n notification = found;\n containerToUpdate = container;\n containerPosition = pos as NotificationPosition;\n }\n });\n\n // If we found the notification and container to update\n if (notification && containerToUpdate) {\n logger.debug(`Updating notification ${option.notificationId} in position ${containerPosition}`);\n\n // If the position changes, move the notification between containers\n if (option.position && option.position !== containerPosition) {\n // Remove from current container\n containerToUpdate.value = containerToUpdate.value.filter(\n (item) => item.notificationId !== option.notificationId,\n );\n\n // Create updated notification with new properties\n const updatedNotification = {\n ...notification,\n ...option,\n };\n\n // Define target position\n const targetPosition = option.position;\n\n // Check if a container already exists for the target position\n if (!getInstanceByPosition(targetPosition)) {\n // If no container exists for the target position, create a new one\n logger.debug(`Creating new container for position ${targetPosition}`);\n appendInstance(updatedNotification);\n } else {\n // If a container exists for the target position, add the updated notification\n logger.debug(`Adding to existing container for position ${targetPosition}`);\n notificationContainers[targetPosition].value.push(updatedNotification);\n }\n } else {\n // Standard update of notification properties\n logger.debug(`Standard update of notification properties`);\n\n // Apply all new properties from option to notification\n Object.keys(option).forEach((key) => {\n if (key !== \"updateId\" && key !== \"notificationId\") {\n const propKey = key as keyof NotificationOptions;\n const propValue = option[propKey];\n\n // Safely assign property\n if (notification && propValue !== undefined) {\n // Use explicit type casting instead of any\n (notification as Record<keyof NotificationOptions, unknown>)[propKey] = propValue;\n }\n }\n });\n }\n\n return true;\n } else {\n logger.warn(`Notification with ID ${option.notificationId} not found for update`);\n return false;\n }\n }\n\n return false;\n },\n\n setPosition(position: NotificationPosition) {\n if (position) {\n defaultOptions.position = position;\n }\n },\n };\n\n return {\n defaultOptions,\n notificationContainers,\n actions,\n getAllNotifications,\n getNotificationsByPosition,\n appendInstance,\n getNotification,\n generateNotificationId: generateId,\n hasNotification,\n };\n}\n","import { setNotificationBackend } from \"@core/notifications/notification\";\nimport { useContainer } from \"@shell/_internal/notifications/composables/useContainer\";\n\n/**\n * Registers the shell notification backend (useContainer) with the core notification API.\n * Called once during framework initialization.\n */\nexport function registerNotificationBackend(): void {\n const container = useContainer();\n setNotificationBackend({\n defaultOptions: container.defaultOptions,\n actions: container.actions,\n getAllNotifications: container.getAllNotifications,\n appendInstance: container.appendInstance,\n getNotification: (id) => container.getNotification(id),\n hasNotification: (id) => container.hasNotification(id),\n });\n}\n","import { version as frameworkVersion } from \"../../package.json\";\n\n/**\n * `version` is read statically from the framework's `package.json`, so it is\n * always accurate — both in a built/published framework AND when the framework\n * is consumed from source (Storybook, dev server, Vitest).\n *\n * `buildDate` and `gitHash` are injected by Vite `define` in\n * `framework/vite.config.mts` during `vite build` of the framework. In source\n * contexts the `define` is not applied; `typeof <undeclared>` returns\n * `\"undefined\"` without throwing a ReferenceError, so they fall back to \"dev\".\n */\nexport interface IFrameworkBuildInfo {\n version: string;\n buildDate: string;\n gitHash: string;\n}\n\nexport function getFrameworkBuildInfo(): IFrameworkBuildInfo {\n return {\n version: frameworkVersion,\n buildDate: typeof __VC_SHELL_BUILD_DATE__ !== \"undefined\" ? __VC_SHELL_BUILD_DATE__ : \"dev\",\n gitHash: typeof __VC_SHELL_GIT_HASH__ !== \"undefined\" ? __VC_SHELL_GIT_HASH__ : \"dev\",\n };\n}\n\nexport function logFrameworkBuildInfo(info: IFrameworkBuildInfo = getFrameworkBuildInfo()): void {\n // Direct console.warn (not console.log, not the logger util): the %c CSS styling\n // is not supported by the logger abstraction, and this banner must always print.\n // console.warn is used deliberately — app production builds mark console.log/info/debug\n // as `pure` in esbuild (see vite.application.appconfig.ts), which strips this banner\n // during dead-code elimination. console.warn survives that pass.\n console.warn(\n `%c@vc-shell/framework%c v${info.version} · ${info.buildDate} · ${info.gitHash}`,\n \"font-weight:bold;color:#319ED4\",\n \"color:inherit\",\n );\n}\n","<template>\n <template v-if=\"isSidebarVisible\">\n <VcSidebar\n :model-value=\"true\"\n :position=\"position\"\n :title=\"title\"\n :close-button=\"closeCross\"\n :teleport=\"!isDesktop\"\n @update:model-value=\"onModelUpdate\"\n >\n <template\n v-if=\"$slots.header\"\n #header=\"{ close }\"\n >\n <slot\n name=\"header\"\n :close=\"close\"\n />\n </template>\n\n <slot name=\"content\" />\n </VcSidebar>\n </template>\n\n <template v-else>\n <slot name=\"content\" />\n </template>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from \"vue\";\nimport { VcSidebar } from \"@ui/components/organisms/vc-sidebar\";\nimport { useResponsive } from \"@framework/core/composables/useResponsive\";\n\nexport interface Props {\n position?: \"left\" | \"right\";\n render?: \"always\" | \"mobile\" | \"desktop\";\n isExpanded: boolean;\n title?: string;\n closeCross?: boolean;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n position: \"right\",\n render: \"always\",\n closeCross: true,\n});\n\nconst emit = defineEmits<{\n (event: \"close\"): void;\n}>();\n\ndefineSlots<{\n header?: (args: { close: () => void }) => unknown;\n content?: () => unknown;\n}>();\n\nconst { isMobile, isDesktop } = useResponsive();\n\nconst renderMatchesViewport = computed(() => {\n if (props.render === \"always\") {\n return true;\n }\n\n if (props.render === \"mobile\") {\n return isMobile.value;\n }\n\n return isDesktop.value;\n});\n\nconst isSidebarVisible = computed(() => props.isExpanded && renderMatchesViewport.value);\n\nfunction onModelUpdate(value: boolean) {\n if (!value) {\n emit(\"close\");\n }\n}\n</script>\n","import SidebarComponent from \"@shell/components/sidebar/sidebar.vue\";\n\n/**\n * @deprecated Use `VcSidebar` from `framework/ui/components` instead.\n * This wrapper is kept for backward compatibility and may be removed in a future release.\n */\nexport const Sidebar = SidebarComponent;\n","<template>\n <VcButton\n variant=\"secondary\"\n class=\"vc-external-provider\"\n @click=\"$emit('signIn')\"\n >\n <div class=\"tw-flex tw-flex-row tw-items-center tw-gap-2\">\n <VcImage\n :src=\"processedLogo\"\n class=\"vc-external-provider__icon\"\n size=\"xxs\"\n />{{ displayName }}\n </div>\n </VcButton>\n</template>\n\n<script lang=\"ts\" setup>\nimport { VcButton } from \"@ui/components/atoms/vc-button\";\nimport { VcImage } from \"@ui/components/atoms/vc-image\";\nimport { computed } from \"vue\";\n\nexport interface Props {\n logo: string | undefined;\n displayName: string | undefined;\n authenticationType: string | undefined;\n}\n\nexport interface Emits {\n (event: \"signIn\"): void;\n}\n\nconst props = defineProps<Props>();\ndefineEmits<Emits>();\n\nconst processedLogo = computed(() => {\n if (props.logo && !props.logo.startsWith(\"data:image\") && !props.logo.startsWith(\"http\")) {\n return new URL(props.logo, window.location.origin).toString();\n }\n return props.logo;\n});\n</script>\n\n<style lang=\"scss\">\n.vc-external-provider {\n &__icon {\n @apply tw-flex-shrink-0;\n }\n}\n</style>\n","<template>\n <div class=\"tw-flex tw-justify-center tw-flex-col tw-gap-4\">\n <ExternalProvider\n v-for=\"provider in providers\"\n :key=\"provider.authenticationType\"\n :logo=\"provider.logoUrl\"\n :display-name=\"provider.displayName\"\n :authentication-type=\"provider.authenticationType\"\n @sign-in=\"signIn(provider.authenticationType)\"\n />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ExternalSignInProviderInfo } from \"@core/api/platform\";\nimport { useExternalProvider } from \"@shell/auth/sign-in/useExternalProvider\";\nimport { default as ExternalProvider } from \"@shell/auth/sign-in/external-provider.vue\";\n\nexport interface Props {\n providers: ExternalSignInProviderInfo[];\n}\n\ndefineProps<Props>();\n\nconst { signIn } = useExternalProvider();\n</script>\n","/**\n * Validates and sanitizes a post-login redirect path.\n * Prevents open-redirect attacks by rejecting non-relative URLs.\n */\nexport function resolveSafeRedirectPath(candidate: string | null): string {\n if (!candidate) return \"/\";\n const redirectPath = candidate.trim();\n if (!redirectPath.startsWith(\"/\") || redirectPath.startsWith(\"//\")) {\n return \"/\";\n }\n return redirectPath;\n}\n\n/** Minimal translate function shape (compatible with vue-i18n's `t`). */\ntype TranslateFn = (key: string, named?: Record<string, unknown>) => string;\n\n/**\n * Maps a sign-in result to a user-facing, localized error message.\n * Takes the `t` function so the util stays pure and testable.\n */\nexport function formatSignInError(result: { status?: number; error?: string }, t: TranslateFn): string {\n if (result.status === 401) {\n return t(\"LOGIN.ERRORS.INVALID_CREDENTIALS\");\n }\n if (result.status) {\n return t(\"LOGIN.ERRORS.AUTH_WITH_CODE\", { code: result.status });\n }\n if (result.error) {\n return t(\"LOGIN.ERRORS.AUTH_GENERIC\", { detail: result.error });\n }\n return t(\"LOGIN.ERRORS.INVALID_CREDENTIALS\");\n}\n\nexport interface PasswordClientError {\n code: string;\n}\n\n/**\n * Performs client-side password change validation.\n * Returns additional error codes to append to server-side validation results.\n */\nexport function validatePasswordChange(fields: {\n password: string;\n confirmPassword: string;\n currentPassword: string;\n}): PasswordClientError[] {\n const errors: PasswordClientError[] = [];\n if (fields.confirmPassword !== fields.password) {\n errors.push({ code: \"Repeat-password\" });\n }\n if (fields.password === fields.currentPassword && fields.confirmPassword === fields.currentPassword) {\n errors.push({ code: \"Equal-passwords\" });\n }\n return errors;\n}\n","<template>\n <VcAuthLayout\n :logo=\"customization.logo\"\n :background=\"background\"\n :title=\"title || $t('LOGIN.TITLE')\"\n :subtitle=\"subtitle || $t('LOGIN.SUBTITLE')\"\n class=\"vc-login-page\"\n >\n <!-- SSO Providers -->\n <div\n v-if=\"loginProviders && loginProviders.length\"\n class=\"vc-login-page__providers\"\n >\n <ExternalProviders :providers=\"loginProviders\" />\n\n <div\n v-if=\"!ssoOnly\"\n class=\"vc-login-page__separator-line\"\n >\n {{ $t(\"LOGIN.OR\") }}\n </div>\n </div>\n\n <!-- SSO-only error: no providers configured -->\n <VcHint\n v-if=\"ssoOnly && providersLoaded && !loginProviders?.length\"\n class=\"tw-mt-4 tw-text-danger-500\"\n >\n {{ $t(\"LOGIN.SSO_NO_PROVIDERS_ERROR\") }}\n </VcHint>\n\n <template v-if=\"!ssoOnly\">\n <VcForm\n class=\"tw-gap-5\"\n @submit=\"login\"\n >\n <Field\n v-slot=\"{ errorMessage, handleChange, errors }\"\n :label=\"$t('LOGIN.FIELDS.LOGIN.LABEL')\"\n name=\"username\"\n :model-value=\"form.username\"\n rules=\"required\"\n >\n <VcInput\n ref=\"loginField\"\n v-model=\"form.username\"\n :label=\"$t('LOGIN.FIELDS.LOGIN.LABEL')\"\n :placeholder=\"$t('LOGIN.FIELDS.LOGIN.PLACEHOLDER')\"\n autocomplete=\"username\"\n required\n :error=\"!!errors.length\"\n :error-message=\"errorMessage\"\n @update:model-value=\"handleChange\"\n />\n </Field>\n\n <Field\n v-slot=\"{ errorMessage, handleChange, errors }\"\n :label=\"$t('LOGIN.FIELDS.PASSWORD.LABEL')\"\n name=\"password\"\n :model-value=\"form.password\"\n rules=\"required\"\n >\n <VcInput\n ref=\"passwordField\"\n v-model=\"form.password\"\n :label=\"$t('LOGIN.FIELDS.PASSWORD.LABEL')\"\n :placeholder=\"$t('LOGIN.FIELDS.PASSWORD.PLACEHOLDER')\"\n type=\"password\"\n autocomplete=\"current-password\"\n required\n :error=\"!!errors.length\"\n :error-message=\"errorMessage\"\n @keyup.enter=\"login\"\n @update:model-value=\"handleChange\"\n />\n </Field>\n\n <VcButton\n variant=\"primary\"\n class=\"tw-w-full\"\n icon=\"lucide-log-in\"\n :disabled=\"!isValid\"\n :loading=\"loading\"\n @click=\"login\"\n >\n {{ $t(\"LOGIN.BUTTON\") }}\n </VcButton>\n\n <VcButton\n variant=\"link\"\n class=\"tw-w-full tw-justify-center\"\n type=\"button\"\n @click=\"goToForgotPassword\"\n >\n {{ $t(\"LOGIN.FORGOT_PASSWORD_BUTTON\") }}\n </VcButton>\n </VcForm>\n\n <!-- Plugin extension point -->\n <ExtensionPoint\n name=\"auth:after-form\"\n separator\n separator-class=\"tw-border-t tw-border-[color:var(--login-separator)] tw-border-solid tw-pb-5\"\n wrapper-class=\"vc-login-page__separator\"\n />\n\n <VcHint\n v-if=\"!signInResult.succeeded\"\n class=\"tw-mt-4 tw-text-danger-500\"\n >\n {{ signInResult.error }}\n </VcHint>\n </template>\n </VcAuthLayout>\n</template>\n\n<!-- eslint-disable @typescript-eslint/no-explicit-any -->\n<script lang=\"ts\" setup>\nimport { ref, reactive, computed, onMounted, type Ref } from \"vue\";\nimport { useRouter } from \"vue-router\";\nimport { useIsFormValid, Field, useForm } from \"vee-validate\";\nimport { useSettings } from \"@core/composables\";\nimport { useUserManagement } from \"@core/composables/useUserManagement\";\nimport { ExternalSignInProviderInfo, SignInResult } from \"@core/api/platform\";\nimport { default as ExternalProviders } from \"@shell/auth/sign-in/external-providers.vue\";\nimport { useExternalProvider } from \"@shell/auth/sign-in/useExternalProvider\";\nimport { resolveSafeRedirectPath, formatSignInError } from \"@shell/auth/utils\";\nimport { useI18n } from \"vue-i18n\";\nimport { ExtensionPoint } from \"@core/plugins/extension-points\";\nimport { createLogger } from \"@core/utilities\";\nimport { VcAuthLayout, VcButton, VcForm, VcHint, VcInput } from \"@ui/components\";\n\nconst logger = createLogger(\"login-page\");\n\nexport interface Props {\n logo?: string;\n background?: string;\n title?: string;\n subtitle?: string;\n ssoOnly?: boolean;\n}\n\nconst props = defineProps<Props>();\n\nconst { t } = useI18n({ useScope: \"global\" });\nconst router = useRouter();\n\nconst { validateField } = useForm({ validateOnMount: false });\nconst { uiSettings, loading: customizationLoading } = useSettings();\nconst signInResult = ref({ succeeded: true }) as Ref<SignInResult & { status?: number; error?: any }>;\nconst { signIn, loading, user } = useUserManagement();\nconst { getProviders } = useExternalProvider();\nconst isValid = useIsFormValid();\nconst loginProviders = ref<ExternalSignInProviderInfo[]>();\nconst providersLoaded = ref(false);\n\nonMounted(async () => {\n loginProviders.value = await getProviders();\n providersLoaded.value = true;\n});\n\nconst customization = computed(() => ({\n logo: !customizationLoading.value ? uiSettings.value?.logo || props.logo : \"\",\n}));\n\nconst form = reactive({\n username: \"\",\n password: \"\",\n});\n\nconst login = async () => {\n if (!isValid.value) return;\n\n signInResult.value.error = \"\";\n signInResult.value = (await signIn(form.username, form.password)) as SignInResult & {\n status?: number;\n error?: any;\n };\n\n if (signInResult.value.succeeded && user.value?.passwordExpired) {\n await router.push({ name: \"ChangePassword\" });\n return;\n }\n\n if (signInResult.value.succeeded) {\n const redirectTo = resolveSafeRedirectPath(localStorage.getItem(\"redirectAfterLogin\"));\n localStorage.removeItem(\"redirectAfterLogin\");\n await router.push(redirectTo);\n return;\n }\n\n // Error handling\n signInResult.value.error = formatSignInError(signInResult.value, t);\n\n form.password = \"\";\n validateField(\"password\");\n};\n\nconst goToForgotPassword = () => {\n router.push({ name: \"ForgotPassword\" });\n};\n\nlogger.debug(\"Init login-page\");\n</script>\n\n<style lang=\"scss\">\n:root {\n --login-separator: var(--secondary-200);\n --login-separator-text: var(--neutrals-400);\n}\n\n.vc-login-page {\n &__separator {\n @apply tw-mt-5;\n }\n\n &__separator-line {\n @apply tw-flex tw-items-center tw-text-center tw-text-xs tw-text-[color:var(--login-separator-text)]\n before:tw-content-[''] before:tw-flex-1 before:tw-border-b before:tw-border-b-[color:var(--login-separator)] before:tw-mr-3\n after:tw-content-[''] after:tw-flex-1 after:tw-border-b after:tw-border-b-[color:var(--login-separator)] after:tw-ml-3;\n @apply tw-my-4;\n }\n}\n</style>\n","import _Login from \"@shell/auth/LoginPage/components/login/Login.vue\";\r\n\r\nexport const Login = _Login as typeof _Login;\r\n","<template>\n <VcAuthLayout\n :logo=\"customization.logo\"\n :background=\"background\"\n :title=\"forgotPasswordRequestSent ? t('FORGOT_PASSWORD.SUCCESS_TITLE') : t('FORGOT_PASSWORD.TITLE')\"\n :subtitle=\"forgotPasswordRequestSent ? undefined : t('FORGOT_PASSWORD.SUBTITLE')\"\n >\n <!-- Request form -->\n <template v-if=\"!forgotPasswordRequestSent\">\n <VcForm @submit=\"forgot\">\n <Field\n v-slot=\"{ errorMessage, handleChange, errors }\"\n :label=\"t('FORGOT_PASSWORD.FIELDS.EMAIL.LABEL')\"\n name=\"loginOrEmail\"\n :model-value=\"form.loginOrEmail\"\n rules=\"required|email\"\n >\n <VcInput\n ref=\"emailField\"\n v-model=\"form.loginOrEmail\"\n class=\"tw-mb-6\"\n :label=\"t('FORGOT_PASSWORD.FIELDS.EMAIL.LABEL')\"\n :placeholder=\"t('FORGOT_PASSWORD.FIELDS.EMAIL.PLACEHOLDER')\"\n required\n :error=\"!!errors.length\"\n :error-message=\"errorMessage\"\n @update:model-value=\"handleChange\"\n />\n </Field>\n\n <VcButton\n variant=\"primary\"\n class=\"tw-w-full tw-mb-4\"\n :disabled=\"!isValid || loading\"\n :loading=\"loading\"\n @click=\"forgot\"\n >\n {{ t(\"FORGOT_PASSWORD.SEND_BUTTON\") }}\n </VcButton>\n\n <div class=\"tw-text-center\">\n <VcButton\n variant=\"link\"\n icon=\"lucide-arrow-left\"\n icon-size=\"xs\"\n type=\"button\"\n @click=\"goBack\"\n >\n {{ t(\"FORGOT_PASSWORD.BACK_TO_LOGIN\") }}\n </VcButton>\n </div>\n </VcForm>\n\n <VcHint\n v-if=\"error\"\n class=\"tw-mt-3 tw-text-danger-500\"\n >\n {{ error }}\n </VcHint>\n </template>\n\n <!-- Success state -->\n <template v-else>\n <div class=\"tw-text-center tw-mb-6\">\n <p class=\"tw-text-sm tw-text-neutrals-600\">\n {{ t(\"FORGOT_PASSWORD.SUCCESS_TEXT\", { email: maskedEmail }) }}\n </p>\n </div>\n\n <VcButton\n variant=\"primary\"\n class=\"tw-w-full\"\n @click=\"goBack\"\n >\n {{ t(\"FORGOT_PASSWORD.BACK_TO_LOGIN\") }}\n </VcButton>\n </template>\n </VcAuthLayout>\n</template>\n\n<script lang=\"ts\" setup>\nimport { ref, reactive, computed } from \"vue\";\nimport { useRouter } from \"vue-router\";\nimport { useIsFormValid, Field, useForm } from \"vee-validate\";\nimport { useSettings } from \"@core/composables\";\nimport { useUserManagement } from \"@core/composables/useUserManagement\";\nimport { useI18n } from \"vue-i18n\";\nimport { VcAuthLayout, VcButton, VcForm, VcHint, VcInput } from \"@ui/components\";\n\ntype ForgotPasswordFunc = (args: { loginOrEmail: string }) => Promise<void>;\n\nexport interface Props {\n logo?: string;\n background?: string;\n composable?: () => { forgotPassword: ForgotPasswordFunc };\n}\n\nconst props = defineProps<Props>();\n\nconst router = useRouter();\nconst { t } = useI18n({ useScope: \"global\" });\nuseForm({ validateOnMount: false });\nconst isValid = useIsFormValid();\nconst { uiSettings, loading: customizationLoading } = useSettings();\n\nconst loading = ref(false);\nconst error = ref(\"\");\nconst forgotPasswordRequestSent = ref(false);\n\nconst form = reactive({\n loginOrEmail: \"\",\n});\n\nlet forgotPassword: ForgotPasswordFunc | undefined;\n\nif (props.composable && typeof props.composable === \"function\") {\n const result = props.composable();\n forgotPassword = result.forgotPassword;\n} else {\n const { requestPasswordReset } = useUserManagement();\n forgotPassword = async (args: { loginOrEmail: string }) => {\n await requestPasswordReset(args.loginOrEmail);\n };\n}\n\nconst customization = computed(() => ({\n logo: !customizationLoading.value ? uiSettings.value?.logo || props.logo : \"\",\n}));\n\nconst maskedEmail = computed(() => {\n const email = form.loginOrEmail;\n const [name, domain] = email.split(\"@\");\n if (!name || !domain) return email;\n const masked = name.length > 2 ? name[0] + \"***\" + name[name.length - 1] : name[0] + \"***\";\n return `${masked}@${domain}`;\n});\n\nconst forgot = async () => {\n if (!isValid.value || !forgotPassword) return;\n\n try {\n loading.value = true;\n error.value = \"\";\n await forgotPassword({ loginOrEmail: form.loginOrEmail });\n forgotPasswordRequestSent.value = true;\n } catch (e) {\n error.value = e instanceof Error ? e.message : String(e);\n } finally {\n loading.value = false;\n }\n};\n\nconst goBack = () => {\n router.push({ name: \"Login\" });\n};\n</script>\n","import _ForgotPassword from \"@shell/auth/ForgotPasswordPage/components/forgot-password/ForgotPassword.vue\";\r\n\r\nexport const ForgotPassword = _ForgotPassword as typeof _ForgotPassword;\r\n","<template>\n <VcAuthLayout\n :logo=\"customization.logo\"\n :background=\"background\"\n :title=\"t('PASSWORDRESET.TITLE')\"\n :subtitle=\"t('PASSWORDRESET.SUBTITLE')\"\n >\n <VcLoading\n v-if=\"loading\"\n active\n />\n\n <VcForm>\n <Field\n v-slot=\"{ field, errorMessage, handleChange, errors }\"\n :label=\"t('PASSWORDRESET.FIELDS.PASSWORD.LABEL')\"\n name=\"password\"\n :model-value=\"form.password\"\n rules=\"required\"\n >\n <VcInput\n v-bind=\"field\"\n ref=\"passwordField\"\n v-model=\"form.password\"\n class=\"tw-mb-4\"\n :label=\"t('PASSWORDRESET.FIELDS.PASSWORD.LABEL')\"\n :placeholder=\"t('PASSWORDRESET.FIELDS.PASSWORD.PLACEHOLDER')\"\n type=\"password\"\n :disabled=\"!form.tokenIsValid\"\n required\n :error=\"!!errors.length\"\n :error-message=\"errorMessage\"\n @update:model-value=\"\n (e) => {\n handleChange(e);\n validate();\n }\n \"\n />\n </Field>\n\n <Field\n v-slot=\"{ field, errorMessage, handleChange, errors }\"\n :label=\"t('PASSWORDRESET.FIELDS.CONFIRM_PASSWORD.LABEL')\"\n name=\"confirm_password\"\n :model-value=\"form.confirmPassword\"\n rules=\"required\"\n >\n <VcInput\n v-bind=\"field\"\n ref=\"confirmPasswordField\"\n v-model=\"form.confirmPassword\"\n class=\"tw-mb-6\"\n :label=\"t('PASSWORDRESET.FIELDS.CONFIRM_PASSWORD.LABEL')\"\n :placeholder=\"t('PASSWORDRESET.FIELDS.CONFIRM_PASSWORD.PLACEHOLDER')\"\n :disabled=\"!form.tokenIsValid\"\n type=\"password\"\n required\n :error=\"!!errors.length\"\n :error-message=\"errorMessage\"\n @update:model-value=\"\n (e) => {\n handleChange(e);\n validate();\n }\n \"\n @keyup.enter=\"resetPassword\"\n />\n </Field>\n\n <VcButton\n variant=\"primary\"\n class=\"tw-w-full\"\n :disabled=\"disableButton\"\n :loading=\"loading\"\n @click=\"resetPassword\"\n >\n {{ t(\"PASSWORDRESET.SAVE_PASSWORD\") }}\n </VcButton>\n\n <VcHint\n v-for=\"error in form.errors\"\n :key=\"error\"\n class=\"tw-mt-3 tw-text-danger-500\"\n >\n {{ t(`PASSWORDRESET.ERRORS.${error}`) }}\n </VcHint>\n </VcForm>\n </VcAuthLayout>\n</template>\n\n<script lang=\"ts\" setup>\nimport { reactive, onMounted, computed } from \"vue\";\nimport { useRouter } from \"vue-router\";\nimport { Field, useForm } from \"vee-validate\";\nimport { useSettings } from \"@core/composables\";\nimport { useI18n } from \"vue-i18n\";\nimport { useUserManagement } from \"@core/composables/useUserManagement\";\nimport { VcAuthLayout, VcButton, VcForm, VcHint, VcInput, VcLoading } from \"@ui/components\";\n\nconst props = withDefaults(\n defineProps<{\n userId: string;\n userName: string;\n token: string;\n logo?: string;\n background?: string;\n }>(),\n {\n background: \"/assets/background.jpg\",\n logo: \"/assets/logo-white.svg\",\n },\n);\n\nconst { validateToken, validatePassword, resetPasswordByToken, signIn, loading } = useUserManagement();\nconst router = useRouter();\nconst { t } = useI18n({ useScope: \"global\" });\nconst { validate: veeValidate } = useForm({ validateOnMount: false });\nconst { uiSettings, loading: customizationLoading } = useSettings();\n\nconst form = reactive<{\n isValid: boolean;\n tokenIsValid: boolean;\n errors: string[];\n password: string;\n confirmPassword: string;\n}>({\n isValid: false,\n tokenIsValid: false,\n errors: [],\n password: \"\",\n confirmPassword: \"\",\n});\n\nonMounted(async () => {\n form.tokenIsValid = await validateToken(props.userId, props.token);\n if (!form.tokenIsValid) {\n form.errors.push(\"Invalid-token\");\n }\n});\n\nconst disableButton = computed(() => {\n return loading.value || !form.password || !form.confirmPassword || (!form.isValid && form.tokenIsValid);\n});\n\nconst validate = async () => {\n if (form.tokenIsValid) {\n const errors = (await validatePassword(form.password)).errors;\n form.errors = errors?.map((x) => x.code) as string[];\n if (form.confirmPassword !== form.password) {\n form.errors.push(\"Repeat-password\");\n }\n form.isValid = form.errors.length == 0;\n }\n};\n\nconst resetPassword = async () => {\n const { valid } = await veeValidate();\n if (valid) {\n const result = await resetPasswordByToken(props.userId, form.password, props.token);\n if (result.succeeded) {\n const loginResult = await signIn(props.userName, form.password);\n if (loginResult.succeeded) {\n router.push(\"/\");\n } else {\n form.errors = (\"error\" in loginResult && [loginResult.error as string]) || [];\n }\n } else {\n form.errors = result.errors as string[];\n }\n }\n};\n\nconst customization = computed(() => ({\n logo: !customizationLoading.value ? uiSettings.value?.logo || props.logo : \"\",\n}));\n</script>\n","import _ResetPassword from \"@shell/auth/ResetPasswordPage/components/reset-password/ResetPassword.vue\";\r\n\r\nexport const ResetPassword = _ResetPassword as typeof _ResetPassword;\r\n","<template>\n <VcAuthLayout\n :logo=\"customization.logo\"\n :background=\"background\"\n :title=\"t('INVITATION.TITLE')\"\n :subtitle=\"t('INVITATION.SUBTITLE')\"\n >\n <VcLoading\n v-if=\"loading\"\n active\n />\n\n <VcForm>\n <VcInput\n class=\"tw-mb-4\"\n :label=\"t('INVITATION.FIELDS.EMAIL.LABEL')\"\n :model-value=\"userName\"\n name=\"username\"\n disabled\n />\n\n <Field\n v-slot=\"{ field, errorMessage, handleChange, errors }\"\n :label=\"t('INVITATION.FIELDS.PASSWORD.LABEL')\"\n :model-value=\"form.password\"\n rules=\"required\"\n name=\"password\"\n >\n <VcInput\n v-bind=\"field\"\n ref=\"passwordField\"\n v-model=\"form.password\"\n class=\"tw-mb-4\"\n :label=\"t('INVITATION.FIELDS.PASSWORD.LABEL')\"\n :placeholder=\"t('INVITATION.FIELDS.PASSWORD.PLACEHOLDER')\"\n type=\"password\"\n :disabled=\"!form.tokenIsValid\"\n :error=\"!!errors.length\"\n :error-message=\"errorMessage\"\n required\n @update:model-value=\"\n (e) => {\n handleChange(e);\n validate();\n }\n \"\n />\n </Field>\n\n <Field\n v-slot=\"{ field, errorMessage, handleChange, errors }\"\n :label=\"t('INVITATION.FIELDS.CONFIRM_PASSWORD.LABEL')\"\n :model-value=\"form.confirmPassword\"\n rules=\"required\"\n name=\"confirm_password\"\n >\n <VcInput\n v-bind=\"field\"\n ref=\"confirmPasswordField\"\n v-model=\"form.confirmPassword\"\n class=\"tw-mb-6\"\n :label=\"t('INVITATION.FIELDS.CONFIRM_PASSWORD.LABEL')\"\n :placeholder=\"t('INVITATION.FIELDS.CONFIRM_PASSWORD.PLACEHOLDER')\"\n :disabled=\"!form.tokenIsValid\"\n type=\"password\"\n :error=\"!!errors.length\"\n :error-message=\"errorMessage\"\n required\n @update:model-value=\"\n (e) => {\n handleChange(e);\n validate();\n }\n \"\n @keyup.enter=\"acceptInvitation\"\n />\n </Field>\n\n <VcButton\n variant=\"primary\"\n class=\"tw-w-full\"\n :disabled=\"loading || !form.isValid || !form.tokenIsValid\"\n :loading=\"loading\"\n @click=\"acceptInvitation\"\n >\n {{ t(\"INVITATION.ACCEPT_INVITATION\") }}\n </VcButton>\n\n <VcHint\n v-for=\"error in form.errors\"\n :key=\"error\"\n class=\"tw-mt-3 tw-text-danger-500\"\n >\n {{ t(`INVITATION.ERRORS.${error}`) }}\n </VcHint>\n </VcForm>\n </VcAuthLayout>\n</template>\n\n<script lang=\"ts\" setup>\nimport { reactive, onMounted, computed } from \"vue\";\nimport { useRouter } from \"vue-router\";\nimport { useIsFormValid, Field, useIsFormDirty, useForm } from \"vee-validate\";\nimport { useSettings } from \"@core/composables\";\nimport { useI18n } from \"vue-i18n\";\nimport { useUserManagement } from \"@core/composables/useUserManagement\";\nimport { VcInput } from \"@ui/components/molecules/vc-input\";\nimport { VcAuthLayout, VcButton, VcForm, VcHint, VcLoading } from \"@ui/components\";\n\nuseForm({ validateOnMount: false });\n\nconst props = withDefaults(\n defineProps<{\n userId: string;\n userName: string;\n token: string;\n logo?: string;\n background?: string;\n }>(),\n {\n background: \"/assets/background.jpg\",\n logo: \"/assets/logo-white.svg\",\n },\n);\n\nconst { validateToken, validatePassword, resetPasswordByToken, signIn, loading } = useUserManagement();\nconst router = useRouter();\nconst { t } = useI18n({ useScope: \"global\" });\nconst isFormValid = useIsFormValid();\nconst isDirty = useIsFormDirty();\nconst { uiSettings, loading: customizationLoading } = useSettings();\n\nconst form = reactive<{\n isValid: boolean;\n tokenIsValid: boolean;\n errors: string[];\n password: string;\n confirmPassword: string;\n}>({\n isValid: false,\n tokenIsValid: false,\n errors: [],\n password: \"\",\n confirmPassword: \"\",\n});\n\nconst isDisabled = computed(() => {\n return !isDirty.value || !isFormValid.value;\n});\n\nonMounted(async () => {\n form.tokenIsValid = await validateToken(props.userId, props.token);\n if (!form.tokenIsValid) {\n form.errors.push(\"Invalid-token\");\n }\n});\n\nconst validate = async () => {\n if (form.tokenIsValid) {\n const errors = (await validatePassword(form.password)).errors;\n form.errors = errors?.map((x) => x.code) as string[];\n if (form.confirmPassword && form.confirmPassword !== form.password) {\n form.errors.push(\"Repeat-password\");\n }\n form.isValid = form.errors.length == 0 && !isDisabled.value;\n }\n};\n\nconst acceptInvitation = async () => {\n const result = await resetPasswordByToken(props.userId, form.password, props.token);\n if (result.succeeded) {\n const result = await signIn(props.userName, form.password);\n if (result.succeeded) {\n router.push(\"/\");\n }\n } else {\n form.errors = result.errors as string[];\n }\n};\n\nconst customization = computed(() => ({\n logo: !customizationLoading.value ? uiSettings.value?.logo || props.logo : \"\",\n}));\n</script>\n","import _Invite from \"@shell/auth/InvitePage/components/invite/Invite.vue\";\r\n\r\nexport const Invite = _Invite as typeof _Invite;\r\n","<template>\n <VcAuthLayout\n :logo=\"customization.logo\"\n :background=\"background\"\n :title=\"forced ? t('COMPONENTS.CHANGE_PASSWORD.TITLE_FORCED') : t('COMPONENTS.CHANGE_PASSWORD.TITLE')\"\n :subtitle=\"forced ? t('COMPONENTS.CHANGE_PASSWORD.SUBTITLE_FORCED') : undefined\"\n >\n <div\n v-if=\"forced\"\n class=\"tw-mb-4\"\n >\n <VcBanner\n variant=\"info\"\n icon=\"lucide-lightbulb\"\n icon-size=\"l\"\n >{{ t(\"COMPONENTS.CHANGE_PASSWORD.FORCED.LABEL\") }}\n </VcBanner>\n </div>\n\n <VcForm>\n <Field\n v-slot=\"{ field, errorMessage, errors }\"\n :label=\"t('COMPONENTS.CHANGE_PASSWORD.CURRENT_PASSWORD.LABEL')\"\n name=\"current\"\n rules=\"required|min:6\"\n :model-value=\"form.currentPassword\"\n >\n <VcInput\n v-bind=\"field\"\n ref=\"passwordField\"\n v-model=\"form.currentPassword\"\n class=\"tw-mb-4\"\n :label=\"t('COMPONENTS.CHANGE_PASSWORD.CURRENT_PASSWORD.LABEL')\"\n :placeholder=\"t('COMPONENTS.CHANGE_PASSWORD.CURRENT_PASSWORD.PLACEHOLDER')\"\n type=\"password\"\n required\n :error=\"!!errors.length\"\n :error-message=\"errorMessage\"\n @update:model-value=\"validateForm\"\n />\n </Field>\n\n <Field\n v-slot=\"{ field, errorMessage, errors }\"\n :label=\"t('COMPONENTS.CHANGE_PASSWORD.NEW_PASSWORD.LABEL')\"\n name=\"new_pass\"\n rules=\"required|min:6\"\n :model-value=\"form.password\"\n >\n <VcInput\n v-bind=\"field\"\n ref=\"newPasswordField\"\n v-model=\"form.password\"\n class=\"tw-mb-4\"\n :label=\"t('COMPONENTS.CHANGE_PASSWORD.NEW_PASSWORD.LABEL')\"\n :placeholder=\"t('COMPONENTS.CHANGE_PASSWORD.NEW_PASSWORD.PLACEHOLDER')\"\n type=\"password\"\n required\n :error=\"!!errors.length\"\n :error-message=\"errorMessage\"\n @update:model-value=\"validateForm\"\n />\n </Field>\n\n <Field\n v-slot=\"{ field, errorMessage, errors }\"\n :label=\"t('COMPONENTS.CHANGE_PASSWORD.CONFIRM_PASSWORD.LABEL')\"\n name=\"confirm_pass\"\n rules=\"required|min:6\"\n :model-value=\"form.confirmPassword\"\n >\n <VcInput\n v-bind=\"field\"\n ref=\"confirmPasswordField\"\n v-model=\"form.confirmPassword\"\n class=\"tw-mb-6\"\n :label=\"t('COMPONENTS.CHANGE_PASSWORD.CONFIRM_PASSWORD.LABEL')\"\n :placeholder=\"t('COMPONENTS.CHANGE_PASSWORD.CONFIRM_PASSWORD.PLACEHOLDER')\"\n type=\"password\"\n required\n :error=\"!!errors.length\"\n :error-message=\"errorMessage\"\n @update:model-value=\"validateForm\"\n />\n </Field>\n\n <div class=\"tw-flex tw-gap-3\">\n <VcButton\n variant=\"secondary\"\n class=\"tw-flex-1\"\n @click=\"cancelChange\"\n >\n {{ t(\"COMPONENTS.CHANGE_PASSWORD.CANCEL\") }}\n </VcButton>\n <VcButton\n variant=\"primary\"\n class=\"tw-flex-1\"\n :disabled=\"loading || !form.isValid || isDisabled\"\n :loading=\"loading\"\n @click=\"changePassword\"\n >\n {{ t(\"COMPONENTS.CHANGE_PASSWORD.SAVE\") }}\n </VcButton>\n </div>\n\n <VcHint\n v-for=\"(err, i) in form.errors\"\n :key=\"i\"\n class=\"tw-mt-3 tw-text-danger-500\"\n >\n {{ (err as IdentityError).code ? t(`COMPONENTS.CHANGE_PASSWORD.ERRORS.${(err as IdentityError).code}`) : err }}\n </VcHint>\n </VcForm>\n </VcAuthLayout>\n</template>\n\n<script lang=\"ts\" setup>\nimport { nextTick, reactive, computed } from \"vue\";\nimport { useIsFormValid, Field, useIsFormDirty, useForm } from \"vee-validate\";\nimport { IdentityError } from \"@core/api/platform\";\nimport { useUserManagement } from \"@core/composables/useUserManagement\";\nimport { useSettings } from \"@core/composables\";\nimport { useI18n } from \"vue-i18n\";\nimport { useRouter } from \"vue-router\";\nimport { VcAuthLayout, VcBanner, VcButton, VcForm, VcHint, VcInput } from \"@ui/components\";\nimport { validatePasswordChange } from \"@shell/auth/utils\";\n\ninterface IChangePassForm {\n isValid: boolean;\n errors: IdentityError[] | string[];\n currentPassword: string;\n password: string;\n confirmPassword: string;\n}\n\nexport interface Props {\n forced?: boolean;\n logo?: string;\n background?: string;\n}\n\nconst props = defineProps<Props>();\n\nconst { t } = useI18n({ useScope: \"global\" });\nconst { changeUserPassword, loading, validatePassword, signOut } = useUserManagement();\nconst { uiSettings, loading: customizationLoading } = useSettings();\n\nconst customization = computed(() => ({\n logo: !customizationLoading.value ? uiSettings.value?.logo || props.logo : \"\",\n}));\nuseForm({ validateOnMount: false });\nconst isValid = useIsFormValid();\nconst isDirty = useIsFormDirty();\nconst router = useRouter();\n\nconst form = reactive<IChangePassForm>({\n isValid: false,\n errors: [],\n currentPassword: \"\",\n password: \"\",\n confirmPassword: \"\",\n});\n\nconst isDisabled = computed(() => {\n return !isDirty.value || !isValid.value;\n});\n\nasync function cancelChange() {\n await signOut();\n await router.push(\"/login\");\n}\n\nasync function changePassword() {\n const result = await changeUserPassword(form.currentPassword, form.password);\n if (result?.succeeded) {\n await router.push(\"/\");\n } else if (result?.errors) {\n form.errors = result?.errors;\n form.isValid = form.errors.length == 0;\n }\n}\n\nfunction validateForm() {\n nextTick(async () => {\n if (form.password || form.confirmPassword) {\n const serverErrors = (await validatePassword(form.password)).errors ?? [];\n const clientErrors = validatePasswordChange({\n password: form.password,\n confirmPassword: form.confirmPassword,\n currentPassword: form.currentPassword,\n });\n form.errors = [...serverErrors, ...clientErrors];\n form.isValid = form.errors.length == 0;\n }\n });\n}\n</script>\n","import _ChangePassword from \"@shell/auth/ChangePasswordPage/components/change-password/ChangePassword.vue\";\n\nexport const ChangePasswordPage = _ChangePassword as typeof _ChangePassword;\n","/**\n * useBladeNavigation adapter — maps the legacy IUseBladeNavigation API\n * onto the new BladeStack + BladeMessaging system.\n *\n * Drop-in replacement for the old useBladeNavigation.\n * Consumer code keeps working; deprecation warnings guide migration.\n */\nimport { computed, getCurrentInstance, inject, warn, Component, ComputedRef, Ref, ref } from \"vue\";\nimport { RouteLocationNormalized, RouteLocationRaw, NavigationFailure } from \"vue-router\";\nimport {\n bladeNavigationInstance as globalBladeNavigationPluginInstanceFallback,\n bladeStackInstance,\n bladeMessagingInstance,\n bladeRegistryInstance,\n} from \"@core/blade-navigation/singletons\";\nimport type { IBladeRegistry as _IBladeRegistry } from \"@core/composables/useBladeRegistry\";\nimport {\n BladeVNode,\n IBladeEvent,\n IParentCallArgs,\n BladeInstanceConstructor,\n BladeDescriptor,\n BladeDescriptorKey,\n} from \"@core/blade-navigation/types\";\nimport { createUrlSync, getTenantPrefix } from \"@core/blade-navigation/utils/urlSync\";\nimport { createLogger } from \"@core/utilities\";\n\nconst logger = createLogger(\"use-blade-navigation-adapter\");\n\n// ── Deprecation helpers ────────────────────────────────────────────────────────\n\nconst _deprecationWarned = new Set<string>();\n\nfunction warnDeprecated(method: string, replacement?: string): void {\n if (_deprecationWarned.has(method)) return;\n _deprecationWarned.add(method);\n const msg = `[useBladeNavigation] \"${method}\" is deprecated.`;\n console.warn(replacement ? `${msg} Use ${replacement} instead.` : msg);\n}\n\n// ── IUseBladeNavigation interface (matches old API) ────────────────────────────\n\nexport interface IUseBladeNavigation {\n readonly blades: ComputedRef<BladeVNode[]>;\n readonly activeWorkspace: ComputedRef<BladeVNode | undefined>;\n readonly currentBladeNavigationData: ComputedRef<BladeVNode[\"props\"][\"navigation\"] | undefined>;\n openBlade: <Blade extends Component>(\n args: IBladeEvent<Blade>,\n isWorkspace?: boolean,\n ) => Promise<void | NavigationFailure>;\n closeBlade: (index: number) => Promise<boolean>;\n goToRoot: () => RouteLocationRaw;\n onParentCall: (args: IParentCallArgs, currentBladeIndex?: number) => void;\n onBeforeClose: (cb: () => Promise<boolean | undefined>) => void;\n resolveBladeByName: (name: string) => BladeInstanceConstructor | undefined;\n routeResolver: (to: RouteLocationNormalized) => Promise<RouteLocationRaw | undefined> | RouteLocationRaw | undefined;\n setNavigationQuery: (query: Record<string, string | number>) => void;\n getNavigationQuery: () => Record<string, string | number> | undefined;\n setBladeError: (bladeIdx: number, error: unknown) => void;\n clearBladeError: (bladeIdx: number) => void;\n}\n\n// ── BladeVNode shim ────────────────────────────────────────────────────────────\n\n/**\n * Creates a minimal BladeVNode-compatible object from a BladeDescriptor.\n * Only satisfies property reads — NOT a real VNode for rendering.\n */\nfunction descriptorToShim(descriptor: BladeDescriptor, index: number, activeId?: string): BladeVNode {\n return {\n props: {\n navigation: {\n idx: index,\n instance: descriptor.title != null ? { title: descriptor.title } : (undefined as any),\n isVisible: descriptor.visible,\n error: ref(descriptor.error ? new Error(String(descriptor.error)) : null) as Ref<Error | null>,\n },\n param: descriptor.param,\n options: descriptor.options,\n expanded: descriptor.id === activeId,\n closable: index > 0,\n },\n type: { name: descriptor.name },\n } as unknown as BladeVNode;\n}\n\n// ── Shared state (module-level, no inject needed) ───────────────────────────────\n// Lazily created computeds cached for all calls to useBladeNavigation().\n// Call _resetAdapterState() in test teardown to prevent cross-test leaks.\n\nlet _blades: ComputedRef<BladeVNode[]> | undefined;\nlet _activeWorkspace: ComputedRef<BladeVNode | undefined> | undefined;\n\n/**\n * Reset adapter's cached computeds. For use in test teardown only.\n * @internal\n */\nexport function _resetAdapterState(): void {\n _blades = undefined;\n _activeWorkspace = undefined;\n _deprecationWarned.clear();\n}\n\nfunction getSharedState() {\n const bladeStack = bladeStackInstance;\n const messaging = bladeMessagingInstance;\n const bladeRegistry = bladeRegistryInstance;\n\n if (!bladeStack || !messaging) {\n throw new Error(\n \"[useBladeNavigation adapter] BladeStack or BladeMessaging not available. \" +\n \"Ensure plugin-v2 is installed before calling useBladeNavigation().\",\n );\n }\n\n const router = globalBladeNavigationPluginInstanceFallback?.router;\n\n if (!router) {\n throw new Error(\"[@vc-shell/framework#useBladeNavigation] Vue Router instance is not available.\");\n }\n\n // Lazily create computeds once\n if (!_blades) {\n _blades = computed<BladeVNode[]>(() => {\n const activeId = bladeStack.activeBlade.value?.id;\n return bladeStack.blades.value.map((d, i) => descriptorToShim(d, i, activeId));\n });\n }\n\n if (!_activeWorkspace) {\n _activeWorkspace = computed<BladeVNode | undefined>(() => {\n const ws = bladeStack.workspace.value;\n if (!ws) return undefined;\n return descriptorToShim(ws, 0, bladeStack.activeBlade.value?.id);\n });\n }\n\n return {\n bladeStack,\n messaging,\n bladeRegistry: bladeRegistry!,\n router,\n blades: _blades,\n activeWorkspace: _activeWorkspace,\n };\n}\n\n// ── Utility: extract blade name from IBladeEvent.blade ─────────────────────────\n\nfunction extractBladeName<Blade extends Component>(blade: IBladeEvent<Blade>[\"blade\"]): string {\n if (!blade) {\n throw new Error(\"Blade cannot be null or undefined.\");\n }\n\n // { name: \"SomeBlade\" } shorthand\n if (typeof blade === \"object\" && \"name\" in blade && typeof (blade as any).name === \"string\") {\n return (blade as any).name;\n }\n\n // Component constructor — extract .name or .__name\n const comp = blade as any;\n return comp.name || comp.__name || \"UnknownBlade\";\n}\n\n// ── Per-caller function ────────────────────────────────────────────────────────\n\nexport function useBladeNavigation(): IUseBladeNavigation {\n const { bladeStack, messaging, bladeRegistry, router, blades, activeWorkspace } = getSharedState();\n\n // Try to get current blade descriptor from the new render layer (VcBladeSlot)\n // Only call inject() when inside a component setup — avoids Vue warning in route guards\n const currentDescriptor = getCurrentInstance() ? inject(BladeDescriptorKey, undefined) : undefined;\n\n // ── URL sync helpers (centralized in urlSync.ts) ────────────────────────────\n\n const { syncUrlPush, syncUrlReplace } = createUrlSync(router, bladeStack);\n\n // ── Helpers ──────────────────────────────────────────────────────────────────\n\n function getCurrentBladeId(): string | undefined {\n if (currentDescriptor) return currentDescriptor.value.id;\n // Fallback: active blade (for app-level code outside any blade)\n return bladeStack.activeBlade.value?.id;\n }\n\n function getBladeIdByIndex(index: number): string | undefined {\n const allBlades = bladeStack.blades.value;\n if (index >= 0 && index < allBlades.length) {\n return allBlades[index].id;\n }\n return undefined;\n }\n\n // ── openBlade ──────────────────────────────────────────────────────────────\n\n async function openBlade<Blade extends Component>(\n args: IBladeEvent<Blade>,\n isWorkspace?: boolean,\n ): Promise<void | NavigationFailure> {\n const name = extractBladeName(args.blade);\n\n const event = {\n name,\n param: args.param,\n options: args.options,\n onOpen: args.onOpen,\n onClose: args.onClose,\n replaceCurrentBlade: args.replaceCurrentBlade,\n };\n\n if (isWorkspace) {\n await bladeStack.openWorkspace(event);\n } else if (args.replaceCurrentBlade) {\n // Legacy replaceCurrentBlade maps to coverCurrentBlade (hide + stack)\n await bladeStack.coverCurrentBlade(event);\n } else {\n const parentId = getCurrentBladeId();\n await bladeStack.openBlade({ ...event, parentId });\n }\n\n // Sync URL only if the opened blade has a URL segment.\n // Blades without URLs (e.g. third-level detail panels) should not\n // change the address bar — the previous blade's URL stays.\n const openedBlade = bladeStack.activeBlade.value;\n if (openedBlade?.url) {\n syncUrlPush();\n }\n }\n\n // ── closeBlade ─────────────────────────────────────────────────────────────\n\n async function closeBlade(index: number): Promise<boolean> {\n warnDeprecated(\"closeBlade(index)\", \"useBlade().closeSelf()\");\n const bladeId = getBladeIdByIndex(index);\n if (!bladeId) {\n logger.error(`closeBlade: No blade found at index ${index}.`);\n return false;\n }\n const prevented = await bladeStack.closeBlade(bladeId);\n if (!prevented) {\n // Blade was closed — sync URL (replace, no new history entry)\n syncUrlReplace();\n }\n return prevented;\n }\n\n // ── goToRoot ───────────────────────────────────────────────────────────────\n\n function goToRoot(): RouteLocationRaw {\n warnDeprecated(\"goToRoot()\");\n\n // Navigate by route name, preserving current params (tenant prefix).\n // Using { path: \"/\" } would drop the tenant prefix from the URL.\n const routes = router.getRoutes();\n const mainRoute = routes.find((r) => r.meta?.root);\n const mainRouteAlias = routes.find((r) => r.aliasOf?.path === mainRoute?.path) || mainRoute;\n\n if (mainRouteAlias?.name) {\n return {\n name: mainRouteAlias.name,\n params: router.currentRoute.value.params,\n };\n }\n\n // Fallback: construct path with tenant prefix\n const tenantPrefix = getTenantPrefix(router);\n return { path: tenantPrefix ? `/${tenantPrefix}` : \"/\" };\n }\n\n // ── onParentCall ───────────────────────────────────────────────────────────\n\n async function onParentCall(args: IParentCallArgs, currentBladeIndex?: number): Promise<void> {\n warnDeprecated(\"onParentCall(args, index)\", \"useBlade().callParent(method, args)\");\n\n let callerId: string | undefined;\n\n if (currentBladeIndex !== undefined) {\n callerId = getBladeIdByIndex(currentBladeIndex);\n } else {\n callerId = getCurrentBladeId();\n }\n\n if (!callerId) {\n logger.error(\"onParentCall: Could not determine caller blade.\");\n return;\n }\n\n try {\n const result = await messaging.callParent(callerId, args.method as string, args.args);\n if (typeof args.callback === \"function\") {\n args.callback(result);\n }\n } catch (error) {\n logger.error(`onParentCall: Failed to call parent method \"${args.method}\":`, error);\n }\n }\n\n // ── onBeforeClose ──────────────────────────────────────────────────────────\n\n function onBeforeClose(cb: () => Promise<boolean | undefined>): void {\n warnDeprecated(\"onBeforeClose(cb)\", \"useBlade().onBeforeClose(guard)\");\n\n const bladeId = getCurrentBladeId();\n if (!bladeId) {\n warn(\"onBeforeClose: Could not determine current blade.\");\n return;\n }\n\n // ⚠️ Guard boolean inversion between legacy and new API:\n // Legacy onBeforeClose: return `false` → PREVENT close; `undefined`/`true` → allow\n // New registerBeforeClose: return `true` → PREVENT close; `false` → allow\n // The adapter inverts the result to bridge the two APIs.\n bladeStack.registerBeforeClose(bladeId, async () => {\n const result = await cb();\n return result === false;\n });\n }\n\n // ── resolveBladeByName ─────────────────────────────────────────────────────\n\n function resolveBladeByName(name: string): BladeInstanceConstructor | undefined {\n return bladeRegistry.getBladeComponent(name) as BladeInstanceConstructor | undefined;\n }\n\n // ── routeResolver (noop — handled by plugin-v2) ────────────────────────────\n\n function routeResolver(_to: RouteLocationNormalized): undefined {\n warnDeprecated(\"routeResolver\", \"plugin-v2 handles URL resolution automatically\");\n return undefined;\n }\n\n // ── setNavigationQuery / getNavigationQuery ────────────────────────────────\n\n function setNavigationQuery(query: Record<string, string | number>): void {\n warnDeprecated(\"setNavigationQuery\");\n\n const ws = bladeStack.workspace.value;\n if (!ws) return;\n\n const prefix = ws.name.toLowerCase();\n const cleanQuery: Record<string, string> = {};\n for (const [k, v] of Object.entries(query)) {\n if (v != null) cleanQuery[`${prefix}_${k}`] = String(v);\n }\n\n router.options.history.replace(\n decodeURIComponent(\n `${window.location.hash.substring(1).split(\"?\")[0]}?${new URLSearchParams(cleanQuery).toString()}`,\n ),\n );\n }\n\n function getNavigationQuery(): Record<string, string | number> | undefined {\n warnDeprecated(\"getNavigationQuery\");\n\n const ws = bladeStack.workspace.value;\n if (!ws) return undefined;\n\n const prefix = ws.name.toLowerCase();\n const urlParams = new URLSearchParams(window.location.hash.split(\"?\")[1] || \"\");\n const result: Record<string, string | number> = {};\n\n for (const [key, value] of urlParams.entries()) {\n if (key.startsWith(`${prefix}_`)) {\n const cleanKey = key.replace(`${prefix}_`, \"\");\n const numValue = Number(value);\n result[cleanKey] = isNaN(numValue) ? value : numValue;\n }\n }\n\n return Object.keys(result).length > 0 ? result : undefined;\n }\n\n // ── Error management ───────────────────────────────────────────────────────\n\n function setBladeError(bladeIdx: number, error: unknown): void {\n const bladeId = getBladeIdByIndex(bladeIdx);\n if (bladeId) {\n bladeStack.setBladeError(bladeId, error);\n }\n }\n\n function clearBladeError(bladeIdx: number): void {\n const bladeId = getBladeIdByIndex(bladeIdx);\n if (bladeId) {\n bladeStack.clearBladeError(bladeId);\n }\n }\n\n // ── currentBladeNavigationData ─────────────────────────────────────────────\n\n const currentBladeNavigationData = computed(() => {\n if (!currentDescriptor) return undefined;\n const d = currentDescriptor.value;\n const allBlades = bladeStack.blades.value;\n const idx = allBlades.findIndex((b) => b.id === d.id);\n return {\n idx,\n instance: d.title != null ? { title: d.title } : (undefined as any),\n isVisible: d.visible,\n error: ref(d.error ? new Error(String(d.error)) : null) as Ref<Error | null>,\n } as BladeVNode[\"props\"][\"navigation\"];\n });\n\n // ── Return ─────────────────────────────────────────────────────────────────\n\n return {\n blades,\n activeWorkspace,\n openBlade,\n closeBlade,\n goToRoot,\n onParentCall,\n onBeforeClose,\n resolveBladeByName,\n routeResolver,\n setNavigationQuery,\n getNavigationQuery,\n setBladeError,\n clearBladeError,\n currentBladeNavigationData,\n };\n}\n","import { ref, computed, provide, toValue, watch, type Ref } from \"vue\";\nimport { useForm } from \"vee-validate\";\nimport { cloneDeep } from \"lodash-es\";\nimport { useBeforeUnload } from \"@core/composables/useBeforeUnload\";\nimport { useBlade } from \"@core/composables/useBlade\";\nimport { usePopup } from \"@core/composables/usePopup\";\nimport { BladeFormKey } from \"@framework/injection-keys\";\nimport type { UseBladeFormOptions, UseBladeFormReturn } from \"./types\";\n\nexport type { UseBladeFormOptions, UseBladeFormReturn, BladeFormInjection } from \"./types\";\n\nfunction isEmptyPrimitive(value: unknown): boolean {\n return value === null || value === undefined || value === \"\";\n}\n\nfunction semanticEqual(a: unknown, b: unknown): boolean {\n // Both empty primitives\n if (isEmptyPrimitive(a) && isEmptyPrimitive(b)) return true;\n // [] ≈ undefined/null (empty array = empty)\n if (isEmptyPrimitive(a) && Array.isArray(b) && b.length === 0) return true;\n if (Array.isArray(a) && a.length === 0 && isEmptyPrimitive(b)) return true;\n\n if (a === b) return true;\n if (typeof a !== typeof b) return false;\n if (typeof a !== \"object\" || a === null || b === null) return false;\n\n if (Array.isArray(a) || Array.isArray(b)) {\n if (!Array.isArray(a) || !Array.isArray(b)) return false;\n if (a.length !== b.length) return false;\n return a.every((item, i) => semanticEqual(item, b[i]));\n }\n\n const aObj = a as Record<string, unknown>;\n const bObj = b as Record<string, unknown>;\n const allKeys = new Set([...Object.keys(aObj), ...Object.keys(bObj)]);\n for (const key of allKeys) {\n if (!semanticEqual(aObj[key], bObj[key])) return false;\n }\n return true;\n}\n\n/**\n * Unified form state management for blades.\n *\n * Encapsulates vee-validate form, modification tracking, browser unload guard,\n * and blade close guard into a single composable with lifecycle-based API.\n *\n * **Must be called from component setup()** — uses provide() internally.\n *\n * Unlike useModificationTracker (which creates a separate currentValue clone),\n * this composable tracks changes directly on the passed `data` ref.\n * The template binds to `data` via v-model — edits go straight into\n * the ref and are detected by a deep watcher against a pristine snapshot.\n */\nexport function useBladeForm<T>(options: UseBladeFormOptions<T>): UseBladeFormReturn {\n const {\n data,\n canSaveOverride,\n autoBeforeClose = true,\n autoBeforeUnload = true,\n closeConfirmMessage,\n onRevert,\n } = options;\n\n // --- vee-validate ---\n const { meta: formMeta, setFieldError, errorBag } = useForm({ validateOnMount: false });\n\n // --- Pristine snapshot tracking ---\n // We track modifications by comparing `data` against a pristine snapshot.\n // Unlike useModificationTracker, there is no separate currentValue clone —\n // the template writes directly into `data`, and the deep watcher detects changes.\n const pristineSnapshot = ref(cloneDeep(data.value)) as Ref<T>;\n const trackerIsModified = ref(false);\n\n watch(\n data,\n (newVal) => {\n if (isReady.value) {\n trackerIsModified.value = !semanticEqual(newVal, pristineSnapshot.value);\n }\n },\n { deep: true },\n );\n\n // --- Readiness gate ---\n const isReady = ref(false);\n\n const isModified = computed(() => isReady.value && trackerIsModified.value);\n\n const canSave = computed(() => {\n if (!isReady.value) return false;\n if (!formMeta.value.valid) return false;\n if (!trackerIsModified.value) return false;\n if (canSaveOverride && !canSaveOverride.value) return false;\n return true;\n });\n\n // --- Lifecycle methods ---\n function setBaseline(): void {\n pristineSnapshot.value = cloneDeep(data.value) as T;\n trackerIsModified.value = false;\n isReady.value = true;\n }\n\n /**\n * Mark the form as ready without resetting the pristine snapshot.\n *\n * Unlike `setBaseline()`, this does NOT overwrite the pristine snapshot.\n * Instead it compares current `data` against the snapshot taken at setup time\n * and sets `trackerIsModified` accordingly.\n *\n * Use when data was programmatically pre-filled (e.g. \"create from template\")\n * and should appear as modified immediately so the save button is enabled.\n */\n function markReady(): void {\n isReady.value = true;\n trackerIsModified.value = !semanticEqual(data.value, pristineSnapshot.value);\n }\n\n function revert(): void | Promise<void> {\n if (onRevert) {\n return onRevert();\n }\n data.value = cloneDeep(pristineSnapshot.value);\n }\n\n // --- Auto guards ---\n if (autoBeforeUnload) {\n useBeforeUnload(isModified);\n }\n\n if (autoBeforeClose !== false) {\n const { onBeforeClose } = useBlade();\n const { showConfirmation } = usePopup();\n\n onBeforeClose(async () => {\n let shouldGuard: boolean;\n\n if (typeof autoBeforeClose === \"object\") {\n // ComputedRef<boolean> — custom condition AND isModified\n shouldGuard = autoBeforeClose.value && isModified.value;\n } else {\n // true (default) — guard based on isModified only\n shouldGuard = isModified.value;\n }\n\n if (shouldGuard) {\n const message = closeConfirmMessage\n ? toValue(closeConfirmMessage)\n : \"You have unsaved changes. Are you sure you want to leave?\";\n return !(await showConfirmation(message));\n }\n return false;\n });\n }\n\n // --- Provide for VcBlade auto-integration ---\n provide(BladeFormKey, { isModified, canSave });\n\n return {\n setBaseline,\n markReady,\n revert,\n canSave,\n isModified,\n isReady: computed(() => isReady.value),\n formMeta,\n setFieldError,\n errorBag,\n };\n}\n","/**\n * Pure layout math for the toast stack. No Vue imports — deterministic given\n * the toast ids, their measured heights, and the expanded flag. Extracted from\n * NotificationContainer so the geometry can be unit-tested in isolation and the\n * component is left with only wiring + render.\n */\n\nexport const GAP = 14;\nexport const VISIBLE_TOASTS = 3;\n\nexport interface ToastLayout {\n /** Number of toasts stacked in front of this one (0 = front/newest). */\n sonnerIndex: number;\n /** CSS `--z-index`: front toast is highest. */\n zIndex: number;\n /** Vertical offset in px (sum of newer toast heights + gap * sonnerIndex). */\n offset: number;\n /** This toast's measured height in px (0 when not yet reported). */\n initialHeight: number;\n}\n\nexport interface ToastStackLayout {\n /** Per-toast layout, in the same order as the input `ids`. */\n toasts: ToastLayout[];\n /** Height of the front (newest) toast in px. */\n frontHeight: number;\n /** Total height of the group element in px. */\n groupHeight: number;\n}\n\n/**\n * @param ids toast ids, oldest → newest (array order matches the source list)\n * @param heights map of toast id → measured height in px\n * @param isExpanded whether the stack is expanded (hover / single toast)\n */\nexport function computeToastOffsets(\n ids: (string | number | undefined)[],\n heights: Map<string | number, number>,\n isExpanded: boolean,\n): ToastStackLayout {\n const count = ids.length;\n\n const heightOf = (id: string | number | undefined): number => (id !== undefined ? heights.get(id) || 0 : 0);\n\n // Front toast = newest = last in array\n const frontToastId = count > 0 ? ids[count - 1] : undefined;\n const frontHeight = heightOf(frontToastId);\n\n const toasts: ToastLayout[] = ids.map((id, arrayIndex) => {\n // sonnerIndex: 0 = front/newest, higher = older/back\n const sonnerIndex = count - 1 - arrayIndex;\n\n // Expanded offset: sum heights of newer toasts + gap * sonnerIndex\n let heightSum = 0;\n for (let i = arrayIndex + 1; i < count; i++) {\n heightSum += heightOf(ids[i]);\n }\n const offset = sonnerIndex * GAP + heightSum;\n\n return {\n sonnerIndex,\n zIndex: count - sonnerIndex,\n offset,\n initialHeight: heightOf(id),\n };\n });\n\n let groupHeight: number;\n if (isExpanded && count > 1) {\n // Expanded: offset of oldest toast + its height\n const oldestSonnerIdx = count - 1;\n let hSum = 0;\n for (let i = 1; i < count; i++) {\n hSum += heightOf(ids[i]);\n }\n const oldestOffset = oldestSonnerIdx * GAP + hSum;\n const oldestHeight = heightOf(ids[0]);\n groupHeight = oldestOffset + oldestHeight;\n } else {\n // Collapsed: front toast height + visible back toasts gap\n groupHeight = frontHeight + Math.min(count - 1, VISIBLE_TOASTS - 1) * GAP;\n }\n\n return { toasts, frontHeight, groupHeight };\n}\n","import { reactive, ref } from \"vue\";\n\n/**\n * Expand/collapse state machine + height tracking for the toast stack.\n * Extracted from NotificationContainer so the timer-driven behaviour can be\n * unit-tested with fake timers, leaving the component with only layout + render.\n */\nexport function useToastStack() {\n const expanded = ref(false);\n const interacting = ref(false);\n let collapseTimer: ReturnType<typeof setTimeout> | null = null;\n\n function expandStack() {\n if (collapseTimer) {\n clearTimeout(collapseTimer);\n collapseTimer = null;\n }\n expanded.value = true;\n }\n\n function collapseStack() {\n if (interacting.value) return;\n collapseTimer = setTimeout(() => {\n expanded.value = false;\n collapseTimer = null;\n }, 200);\n }\n\n // Height tracking: toastId → height\n const heightsMap = reactive(new Map<string | number, number>());\n\n function reportHeight(toastId: string | number, height: number) {\n const rounded = Math.round(height);\n if (heightsMap.get(toastId) !== rounded) {\n heightsMap.set(toastId, rounded);\n }\n }\n\n function forgetHeight(toastId: string | number) {\n heightsMap.delete(toastId);\n }\n\n function clearHeights() {\n heightsMap.clear();\n }\n\n function setInteracting(value: boolean) {\n interacting.value = value;\n }\n\n return {\n expanded,\n interacting,\n heightsMap,\n expandStack,\n collapseStack,\n reportHeight,\n forgetHeight,\n clearHeights,\n setInteracting,\n };\n}\n","import { VcToast } from \"@ui/components/molecules/vc-toast\";\nimport { VcIcon } from \"@ui/components/atoms/vc-icon\";\nimport { PropType, computed, defineComponent, h, toRaw, inject } from \"vue\";\nimport {\n Content,\n NotificationType,\n NotificationPosition,\n NotificationContainerStateKey,\n} from \"@core/notifications/toast-types\";\nimport { GAP, VISIBLE_TOASTS, computeToastOffsets } from \"./computeToastOffsets\";\nimport { useToastStack } from \"./useToastStack\";\nimport { i18n } from \"@core/plugins/i18n\";\n\nconst NotificationContainer = defineComponent({\n name: \"NotificationContainer\",\n inheritAttrs: false,\n props: {\n pauseOnHover: {\n type: Boolean,\n required: false,\n default: true,\n },\n timeout: {\n type: [Number, Boolean],\n required: false,\n default: 3000,\n },\n content: {\n type: [String, Object] as PropType<Content>,\n required: false,\n default: \"\",\n },\n notificationId: {\n type: [String, Number],\n required: false,\n default: \"\",\n },\n updateId: {\n type: [String, Number],\n required: false,\n default: \"\",\n },\n type: {\n type: String as PropType<NotificationType>,\n required: false,\n default: \"default\",\n },\n onOpen: {\n type: Function as PropType<<T>(payload: T) => void>,\n required: false,\n default: undefined,\n },\n onClose: {\n type: Function as PropType<<T>(payload: T) => void>,\n required: false,\n default: undefined,\n },\n payload: {\n type: [String, Object] as PropType<Record<string, any>>,\n required: false,\n default: () => ({}),\n },\n position: {\n type: String as PropType<NotificationPosition>,\n required: false,\n default: \"top-center\",\n },\n },\n setup(props) {\n const { notificationContainers, actions } = inject(NotificationContainerStateKey)!;\n const notificationsList = computed(() => {\n return notificationContainers[props.position as NotificationPosition].value || [];\n });\n\n const {\n expanded,\n heightsMap,\n expandStack,\n collapseStack,\n reportHeight,\n forgetHeight,\n clearHeights,\n setInteracting,\n } = useToastStack();\n\n function isComponent(content: Content) {\n return typeof content === \"object\" && (!!(content as any)?.render || !!(content as any)?.setup);\n }\n\n function handleClose(id: string | number | undefined) {\n if (id) {\n forgetHeight(id);\n actions.remove(id);\n }\n }\n\n function handleClearAll() {\n actions.clear();\n clearHeights();\n }\n\n const isTop = computed(() => (props.position || \"top-center\").startsWith(\"top\"));\n\n return () => {\n const items = notificationsList.value;\n const count = items.length;\n const isExpanded = expanded.value || count <= 1;\n const showClearAll = count > 1;\n\n const layout = computeToastOffsets(\n items.map((item) => item.notificationId),\n heightsMap,\n isExpanded,\n );\n\n const children = items.map((item, arrayIndex) => {\n const { sonnerIndex, zIndex, offset, initialHeight } = layout.toasts[arrayIndex];\n\n const toastStyle: Record<string, string | number> = {\n \"--toasts-before\": sonnerIndex,\n \"--z-index\": zIndex,\n \"--offset\": `${offset}px`,\n \"--initial-height\": initialHeight ? `${initialHeight}px` : \"auto\",\n };\n\n const toastProps = {\n ...item,\n onClose: handleClose,\n onReportHeight: reportHeight,\n toastIndex: sonnerIndex,\n toastsCount: count,\n expanded: isExpanded,\n visibleToasts: VISIBLE_TOASTS,\n style: toastStyle,\n };\n\n const toastVNode =\n item.content && isComponent(item.content)\n ? h(VcToast, { ...toastProps, content: h(toRaw(item.content)) })\n : h(VcToast, toastProps);\n\n // The group is an <ol>, so each toast must be a list item\n // (WCAG 1.3.1 / axe `list`). display:contents keeps the wrapper\n // layout-transparent while preserving the listitem semantics.\n return h(\"li\", { key: item.notificationId, style: { display: \"contents\" } }, [toastVNode]);\n });\n\n // Clear all button — fixed position top-right of toast stack\n let clearAllButton = null;\n if (showClearAll) {\n // <li>: the group is an <ol>, so every direct child must be a list item\n // (WCAG 1.3.1 / axe `list`).\n clearAllButton = h(\n \"li\",\n {\n class: \"notification__clear-all\",\n style: {\n position: \"absolute\",\n [isTop.value ? \"top\" : \"bottom\"]: \"0\",\n left: \"var(--width, 356px)\",\n \"margin-left\": \"8px\",\n \"list-style\": \"none\",\n opacity: isExpanded ? \"1\" : \"0\",\n \"pointer-events\": isExpanded ? \"auto\" : \"none\",\n transition: \"opacity 200ms ease\",\n },\n },\n [\n h(\n \"button\",\n {\n type: \"button\",\n onClick: handleClearAll,\n },\n [\n h(VcIcon, { icon: \"lucide-x\", size: \"xs\", \"aria-hidden\": \"true\" }),\n i18n.global.t(\"CORE.NOTIFICATIONS.CLEAR_ALL\"),\n ],\n ),\n ],\n );\n }\n\n return h(\n \"ol\",\n {\n class: \"notification__toast-group\",\n \"data-expanded\": String(isExpanded),\n \"data-position\": props.position || \"top-center\",\n \"data-y-position\": isTop.value ? \"top\" : \"bottom\",\n style: {\n \"--front-toast-height\": `${layout.frontHeight}px`,\n \"--gap\": `${GAP}px`,\n width: \"var(--width, 356px)\",\n height: `${layout.groupHeight}px`,\n },\n onMouseenter: expandStack,\n onMouseleave: collapseStack,\n onPointerdown: () => {\n setInteracting(true);\n },\n onPointerup: () => {\n setInteracting(false);\n },\n },\n [...children, clearAllButton],\n );\n };\n },\n});\n\nexport default NotificationContainer;\n","import type { RouteLocationNormalized, Router } from \"vue-router\";\nimport { App } from \"vue\";\nimport { useBreakpoints } from \"@vueuse/core\";\nimport { i18n } from \"@core/plugins/i18n\";\nimport { permissions } from \"@core/plugins/permissions\";\nimport { signalR } from \"@core/plugins/signalR\";\nimport { aiAgentPlugin, type AiAgentPluginOptions } from \"@core/plugins/ai-agent\";\nimport { notification } from \"@core/notifications/notification\";\nimport { VcBladeNavigationComponent } from \"@shell/_internal/blade-navigation\";\nimport { VcPopupHandler } from \"@shell/_internal/popup\";\nimport { AssetsDetailsModule } from \"@modules/assets\";\nimport { AssetsManagerModule } from \"@modules/assets-manager\";\nimport { registerInterceptors } from \"@core/interceptors\";\nimport { usePermissions } from \"@core/composables/usePermissions\";\nimport { useUserManagement } from \"@core/composables/useUserManagement\";\nimport Vue3TouchEvents from \"vue3-touch-events\";\nimport * as locales from \"@locales\";\nimport { AppInsightsPlugin, AppInsightsPluginOptions } from \"vue3-application-insights\";\nimport { useAppInsights, AppInsightsOptionsKey, AppInsightsInstanceKey } from \"@core/composables/useAppInsights\";\nimport { useAppInsights as useInsightsFromLib } from \"vue3-application-insights\";\nimport { setupGlobalErrorHandlers } from \"@core/plugins/global-error-handler\";\nimport { useConnectionStatus } from \"@core/composables/useConnectionStatus\";\nimport { useSlowNetworkDetection } from \"@core/composables/useSlowNetworkDetection\";\nimport { useNotificationStore } from \"@core/notifications\";\nimport { registerNotificationBackend } from \"@shell/_internal/notifications/register-backend\";\n\n// Import Blade Registry\nimport { createBladeRegistry, BladeRegistryKey, IBladeRegistryInstance } from \"@core/composables/useBladeRegistry\";\n\nimport * as coreComposables from \"@core/composables\";\nimport { logFrameworkBuildInfo } from \"@core/utilities/buildInfo\";\nimport \"normalize.css\";\nimport \"./assets/styles/fonts.scss\";\nimport \"./assets/styles/index.scss\";\nimport {\n createWidgetService,\n createMenuService,\n createAppBarWidgetService,\n createSettingsMenuService,\n createToolbarService,\n createLanguageService,\n} from \"@core/services\";\nimport {\n AppBarWidgetServiceKey,\n MenuServiceKey,\n NotificationStoreKey,\n SettingsMenuServiceKey,\n ToolbarServiceKey,\n WidgetServiceKey,\n LanguageServiceKey,\n IsMobileKey,\n IsDesktopKey,\n IsPhoneKey,\n IsTabletKey,\n IsTouchKey,\n BladeRoutesKey,\n} from \"@framework/injection-keys\";\n\nimport \"@fortawesome/fontawesome-free/css/fontawesome.min.css\";\nimport \"@fortawesome/fontawesome-free/css/solid.min.css\";\nimport \"bootstrap-icons/font/bootstrap-icons.min.css\";\nimport \"@material-symbols/font-300/index.css\";\n\ntype I18NParams = Parameters<typeof i18n.global.mergeLocaleMessage>;\n\nexport interface FrameworkInstallArgs {\n router: Router;\n i18n?: {\n locale: string;\n fallbackLocale: string;\n };\n applicationInsights?: {\n instrumentationKey: string;\n appName?: string;\n cloudRole?: string;\n cloudRoleInstance?: string;\n };\n /**\n * AI Agent plugin options.\n * Configure tenantId here to identify the platform instance.\n *\n * @example\n * ```typescript\n * app.use(VirtoShellFramework, {\n * router,\n * aiAgent: {\n * config: {\n * tenantId: \"virto\"\n * }\n * }\n * });\n * ```\n */\n aiAgent?: AiAgentPluginOptions;\n}\n\nexport interface VcShellFrameworkPlugin {\n install(app: App, args: FrameworkInstallArgs): void;\n}\n\n// ── Install helpers ──────────────────────────────────────────────────\n\nfunction setupI18n(app: App, args: FrameworkInstallArgs) {\n if (args.i18n?.locale) {\n i18n.global.locale.value = args.i18n.locale;\n }\n if (args.i18n?.fallbackLocale) {\n i18n.global.fallbackLocale.value = args.i18n.fallbackLocale;\n }\n\n app.use(i18n);\n\n // Dev-mode: warn about missing translation keys\n if (import.meta.env.DEV) {\n i18n.global.setMissingHandler((locale, key) => {\n console.warn(`[vc-shell i18n] Missing translation: \"${key}\" for locale \"${locale}\"`);\n });\n }\n\n const languageService = createLanguageService();\n app.provide(LanguageServiceKey, languageService);\n\n const { resolveCamelCaseLocale } = languageService;\n\n app.config.globalProperties.$mergeLocaleMessage = (locale: I18NParams[0], message: I18NParams[1]) => {\n i18n.global.mergeLocaleMessage(resolveCamelCaseLocale(locale), message);\n };\n\n // Components locales\n Object.entries(locales).forEach(([key, message]) => {\n i18n.global.mergeLocaleMessage(resolveCamelCaseLocale(key), message);\n });\n}\n\nfunction setupBreakpoints(app: App) {\n const bp = useBreakpoints({\n phone: 480,\n desktop: 1024,\n });\n\n app.config.globalProperties.$isPhone = bp.smaller(\"phone\");\n app.config.globalProperties.$isTablet = bp.between(\"phone\", \"desktop\");\n app.config.globalProperties.$isMobile = bp.smaller(\"desktop\");\n app.config.globalProperties.$isDesktop = bp.greater(\"desktop\");\n app.config.globalProperties.$isTouch = \"ontouchstart\" in window || navigator.maxTouchPoints > 0;\n\n // Typed Symbol keys (internal framework use)\n app.provide(IsPhoneKey, app.config.globalProperties.$isPhone);\n app.provide(IsTabletKey, app.config.globalProperties.$isTablet);\n app.provide(IsMobileKey, app.config.globalProperties.$isMobile);\n app.provide(IsDesktopKey, app.config.globalProperties.$isDesktop);\n app.provide(IsTouchKey, app.config.globalProperties.$isTouch);\n}\n\nfunction setupLegacyGlobals(app: App) {\n // Pages\n app.config.globalProperties.pages = [];\n\n // Blade routes\n app.config.globalProperties.bladeRoutes = [];\n app.provide(BladeRoutesKey, app.config.globalProperties.bladeRoutes);\n}\n\nfunction createAndProvideServices(app: App) {\n app.provide(WidgetServiceKey, createWidgetService());\n app.provide(ToolbarServiceKey, createToolbarService());\n app.provide(AppBarWidgetServiceKey, createAppBarWidgetService());\n app.provide(MenuServiceKey, createMenuService());\n app.provide(SettingsMenuServiceKey, createSettingsMenuService());\n app.provide(NotificationStoreKey, useNotificationStore());\n\n const bladeRegistryInstance: IBladeRegistryInstance = createBladeRegistry(app);\n app.provide(BladeRegistryKey, bladeRegistryInstance);\n}\n\nfunction installPlugins(app: App, args: FrameworkInstallArgs) {\n // Register notification backend before any plugin that might use notifications\n registerNotificationBackend();\n\n app.use(VcBladeNavigationComponent, { router: args.router });\n app.use(VcPopupHandler);\n app.use(AssetsDetailsModule);\n app.use(AssetsManagerModule);\n app.use(signalR);\n app.use(permissions);\n app.use<[]>(Vue3TouchEvents);\n\n app.use(aiAgentPlugin, args.aiAgent);\n}\n\nfunction provideApplicationInsightsOptions(app: App, args: FrameworkInstallArgs) {\n if (!args.applicationInsights?.instrumentationKey) return;\n\n const aiOptions: AppInsightsPluginOptions = {\n appInsightsConfig: {\n config: {\n instrumentationKey: args.applicationInsights.instrumentationKey,\n },\n },\n trackAppErrors: true,\n appName: args.applicationInsights?.appName,\n cloudRole: args.applicationInsights?.cloudRole,\n cloudRoleInstance: args.applicationInsights?.cloudRoleInstance,\n };\n\n // Provide options synchronously so components can inject at setup time\n // (useErrorHandler -> useAppInsights -> inject(AppInsightsOptionsKey))\n app.provide(AppInsightsOptionsKey, aiOptions);\n}\n\nfunction installApplicationInsightsDeferred(app: App, args: FrameworkInstallArgs) {\n if (!args.applicationInsights?.instrumentationKey) return;\n\n const aiOptions: AppInsightsPluginOptions = {\n appInsightsConfig: {\n config: {\n instrumentationKey: args.applicationInsights.instrumentationKey,\n },\n },\n trackAppErrors: true,\n appName: args.applicationInsights?.appName,\n cloudRole: args.applicationInsights?.cloudRole,\n cloudRoleInstance: args.applicationInsights?.cloudRoleInstance,\n };\n\n // Install the SDK plugin (may start telemetry collection)\n app.use(AppInsightsPlugin, aiOptions);\n\n // Re-provide instance under our own key so useAppInsights() can inject with a default\n // (avoids Vue \"injection not found\" warning when the library's private Symbol is used)\n const appInsightsInstance = app.runWithContext(() => useInsightsFromLib());\n app.provide(AppInsightsInstanceKey, appInsightsInstance);\n\n // Register router hooks for page tracking.\n // Note: the initial navigation's page-view may not be tracked since\n // router.isReady() may resolve before these hooks are registered.\n // This is an acceptable trade-off for removing SDK init from critical path.\n app.runWithContext(() => {\n const { setupPageTracking } = useAppInsights();\n\n args.router.beforeEach((to) => {\n setupPageTracking.beforeEach({ name: to.name as string });\n });\n\n args.router.afterEach((to) => {\n setupPageTracking.afterEach({ name: to.name as string, fullPath: to.fullPath });\n });\n });\n}\n\nfunction setupRouterGuards(router: Router) {\n const getParam = (to: RouteLocationNormalized) => {\n let param: {\n [k: string]: string | string[];\n } = {};\n\n if (Object.keys(to.params).length > 0) {\n param = Object.fromEntries(Object.entries(to.params).filter(([key]) => key !== \"pathMatch\"));\n }\n\n return param;\n };\n\n // Check if user is authenticated and redirect to login page if not.\n // TODO add check if app has login page\n router.beforeEach(async (to) => {\n const { isAuthenticated } = useUserManagement();\n\n if (to.meta.root === true) {\n try {\n if (!isAuthenticated.value) {\n localStorage.setItem(\"redirectAfterLogin\", to.fullPath);\n return { name: \"Login\" };\n }\n } catch (_e) {\n localStorage.setItem(\"redirectAfterLogin\", to.fullPath);\n return { name: \"Login\" };\n }\n }\n });\n\n // Check if user has access to the page and redirect to previous path if not.\n router.beforeEach((to, from) => {\n const { hasAccess } = usePermissions();\n if (!to.meta.permissions) {\n return true;\n } else if (hasAccess(to.meta.permissions as string | string[])) return true;\n else {\n notification.error(i18n.global.t(\"PERMISSION_MESSAGES.ACCESS_RESTRICTED\"), {\n timeout: 3000,\n });\n\n const param = getParam(to);\n\n return Object.keys(param)[0] ? `/${Object.values(param)[0]}` + from.path : from.path;\n }\n });\n}\n\n// ── Plugin entry point ───────────────────────────────────────────────\n\nexport default {\n install(app: App, args: FrameworkInstallArgs): void {\n // Print framework version banner for debugging (see core/utilities/buildInfo.ts)\n logFrameworkBuildInfo();\n\n // Register base theme\n coreComposables.useTheme().register([{ key: \"light\", localizationKey: \"core.themes.light\" }]);\n\n // HTTP Interceptors\n window.fetch = registerInterceptors(args.router);\n\n setupI18n(app, args);\n setupBreakpoints(app);\n setupLegacyGlobals(app);\n createAndProvideServices(app);\n installPlugins(app, args);\n\n // Provide AppInsights options synchronously (components inject at setup time)\n provideApplicationInsightsOptions(app, args);\n\n setupGlobalErrorHandlers(app);\n\n if (typeof window !== \"undefined\") {\n app.runWithContext(() => useConnectionStatus());\n app.runWithContext(() => useSlowNetworkDetection());\n }\n\n setupRouterGuards(args.router);\n\n // Defer non-critical plugins to post-paint.\n // setTimeout(fn, 0) yields to the browser's rendering pipeline —\n // the browser paints before executing the next macrotask.\n setTimeout(() => {\n performance.mark(\"vc:deferred-plugins-start\");\n // notifyMountComplete(); // Trigger deferred SignalR connection\n installApplicationInsightsDeferred(app, args); // AppInsights SDK + router hooks\n performance.mark(\"vc:deferred-plugins-done\");\n }, 0);\n },\n} as VcShellFrameworkPlugin;\n\n// ── Public API ───────────────────────────────────────────────────────\n\n// Injection keys (typed Symbol keys)\nexport * from \"./injection-keys\";\n\n// UI components (atoms, molecules, organisms)\nexport * from \"@ui/components\";\nexport * from \"@ui/types\";\n\n// Core composables\nexport * from \"@core/composables\";\n\n// Notifications (new API)\nexport {\n useBladeNotifications,\n useNotificationStore,\n useNotificationContext,\n useBroadcastFilter,\n NotificationContextKey,\n} from \"@core/notifications\";\nexport { notification } from \"@core/notifications/notification\";\nexport type {\n Severity,\n ToastConfig,\n NotificationTypeConfig,\n ModuleNotificationsConfig,\n NotificationAction,\n BladeNotificationOptions,\n BladeNotificationReturn,\n UseBroadcastFilterReturn,\n} from \"@core/notifications\";\n\n// Core\nexport * from \"@core/directives\";\nexport * from \"@core/types\";\nexport * from \"@core/api/platform\";\nexport * from \"@core/utilities\";\nexport * from \"@core/constants\";\n\n// Core plugins (public surface only)\nexport * from \"@core/plugins/modularity\";\nexport * from \"@core/plugins/permissions\";\nexport * from \"@core/plugins/validation\";\n\n// i18n (public singleton)\nexport { i18n } from \"@core/plugins/i18n\";\n\n// SignalR\nexport { signalR } from \"@core/plugins/signalR\";\n\n// Blade navigation (public composables + types)\nexport * from \"@core/blade-navigation\";\n\n// Popup (public composable)\nexport { usePopup } from \"@core/composables/usePopup\";\n\n// Shell components (public building blocks)\nexport * from \"@shell/components\";\nexport * from \"@shell/auth\";\nexport * from \"@shell/dashboard\";\n\n// AI Agent (also available via @vc-shell/framework/ai-agent)\nexport * from \"@core/plugins/ai-agent/public\";\n\n// Extensions (also available via @vc-shell/framework/extensions)\nexport * from \"@core/plugins/extension-points/public\";\n\n// Built-in modules\nexport * from \"@modules\";\n\n// Shared composables that moved to core/ui\nexport * from \"@core/composables/useBladeNavigationAdapter\";\nexport * from \"@core/composables/useBladeForm\";\n\n// Multilanguage selector (moved from shared to ui)\nexport * from \"@ui/components/molecules/multilanguage-selector\";\n\n// UI composables (useTableSort, useTableSelection)\nexport * from \"@ui/composables\";\n\n// Notification rendering internals (used by shell layout)\nimport \"@shell/_internal/notifications/styles/index.scss\";\nexport * from \"@shell/_internal/notifications/composables\";\nexport * from \"@shell/_internal/notifications/components\";\n\n// Blade navigation rendering components (VcBladeNavigation, VcBladeSlot)\nexport * from \"@shell/_internal/blade-navigation\";\n\n// Pre-registration functions (used by external modules before provide/inject tree exists)\nexport { registerExternalWidget, registerWidget } from \"@core/composables/useWidgets\";\nexport { registerToolbarItem } from \"@core/services/toolbar-service\";\nexport { addMenuItem } from \"@core/services/menu-service\";\nexport { addAppBarWidget } from \"@core/services/app-bar-menu-service\";\nexport { addSettingsMenuItem } from \"@core/services/settings-menu-service\";\nexport { registerDashboardWidget } from \"@core/services/dashboard-service\";\nexport type { IExternalWidgetRegistration, IWidgetTrigger } from \"@core/services/widget-service\";\n"],"names":["camelToSnake","str","m","kebabToCamel","x","kebabToPascal","camelCase","camelize","match","chr","imageExtensions","getExtension","fileName","isImage","name","readableSize","bytes","decimals","k","dm","sizes","i","extensionColors","getExtensionColor","ext","getExtensionLabel","permissions","app","hasAccess","usePermissions","useBladeNotifications","options","store","useNotificationStore","unsub","getCurrentScope","onScopeDispose","messages","computed","msg","unreadCount","markAsRead","useNotificationContext","ctx","inject","NotificationContextKey","useBroadcastFilter","NotificationContainerStateKey","logger","createLogger","signalR","_app","isAuthenticated","useUserManagement","reconnect","connection","useCypressSignalRMock","HubConnectionBuilder","LogLevel","start","err","stop","message","watch","value","useTableQueryState","stateKey","service","TableQueryStateKey","defineAppModule","blades","locales","notificationTemplates","notifications","bladeRegistry","BladeRegistryKey","exportKey","component","type","config","template","notifyTypes","t","notification","key","i18n","createAppModule","pages","_components","restoreFromUrl","bladeStack","parsed","router","routeParams","workspaceMatch","navigateToMainRoute","bladeMatch","b","clearBladeStackRespectingGuards","bladesBeforeClose","lastBlade","bladeRouterGuard","to","r","tenantPrefix","parseBladeUrl","v","path","query","buildUrlFromStack","VcBladeNavigationComponent","args","bladeNavigationPluginData","setBladeNavigationInstance","useBladeRegistry","createBladeStack","BladeStackKey","setBladeStackInstance","messaging","createBladeMessaging","BladeMessagingKey","setBladeMessagingInstance","setBladeRegistryInstance","mainRoute","COMPONENT_DEFAULTS","getComponentDefaults","componentName","props","__props","emit","__emit","handleConfirm","close","_createBlock","VcPopup","$emit","_renderSlot","_ctx","_withCtx","_createElementVNode","_createElementBlock","_Fragment","_createVNode","_unref","VcButton","$event","$slots","VcPopupBase","$t","registerPopupPresets","registerPopupPreset","vcPopupWarning","vcPopupError","vcPopupInfo","VcPopupHandler","popupPlugin","shallowReactive","PopupPluginKey","setPopupPluginInstance","debounce","func","delay","timer","resultsMap","once","result","throttle","wasThrottled","useFunctions","useNotifications","notifyType","types","handler","moduleNotifications","item","orderBy","fn","_notification","useAsync","innerAction","loading","ref","error","shouldNotify","notifyTimeout","action","payload","rest","e","parseError","isSessionExpired","notifId","timerId","n","setPendingErrorNotification","readonly","useApiClient","c","getApiClient","useLoading","useSettings","uiSettings","customSettingsApplied","SettingClient","getUiCustomizationSettings","settings","applySettings","onMounted","MAX_CONCURRENT_UPLOADS","uploadSingleFile","file","uploadPath","index","startingSortOrder","formData","response","uploadedFile","processBatched","items","processor","concurrency","results","batch","batchResults","batchIndex","useAssets","upload","files","fileArray","asset","remove","filesToDelete","initialAssetArr","assetKey","updatedAssetArr","_.cloneDeep","_.differenceWith","y","edit","updatedFiles","updatedFile","DEFAULT_CONCURRENCY","normalizedPath","normalizeSortOrder","list","a","ao","bo","useAssetsManager","source","_loading","_items","newVal","_sync","successfulUploads","removeMany","itemsToRemove","keysToRemove","reorder","newOrder","updateItem","existing","updated","useBeforeUnload","modified","onBeforeMount","preventUnload","onBeforeUnmount","event","unref","isEmptyValue","isMultilanguageProperty","property","isMultivalueProperty","isDictionaryProperty","isMeasureProperty","isColorProperty","createValue","params","cleanEmptyValues","locale","regularStrategy","context","otherLocales","newValues","booleanStrategy","_context","dictionaryStrategy","dictionary","setMultilanguageDictionary","setSingleLanguageDictionary","setMultilanguageMultivalueDictionary","setMultilanguageSingleValueDictionary","values","dictItem","locValue","dictionaryItem","existingLanguageCodes","languageCodes","langCode","measureStrategy","_locale","colorStrategy","resolveStrategy","useDynamicProperties","searchDictionary","searchMeasurements","dictionaryItemsLoading","searchDictionaryItems","loadDictionaries","propertyId","keyword","localizedValue","loc","loadMeasurements","measureId","_keyword","getPropertyValue","setPropertyValue","useWebVitals","callback","defaultCallback","metric","onFCP","onLCP","onCLS","onINP","onTTFB","useBladeWidgets","widgets","_service","WidgetServiceKey","InjectionError","widgetService","descriptor","BladeDescriptorKey","bladeId","decl","buildWidget","onUnmounted","refresh","widgetId","widget","w","refreshAll","registered","useWidgetTrigger","trigger","scope","WidgetScopeKey","headless","unwrapRecord","record","val","isRef","defineBladeContext","data","provide","BladeContextKey","toValue","injectBladeContext","isEmpty","semanticEqual","isEqualWith","valA","valB","useModificationTracker","initialValueProp","getClonedUnreffedValue","cloneDeep","pristineValue","currentValue","isModified","newExternalInitialValue","wasModified","newCurrentVal","newPristineVal","resetModificationState","newBaselineValueInput","newClonedBase","__registerBladeConfig","closeSelf","useBlade","useForm","isValid","useIsFormValid","isDirty","useIsFormDirty","useI18n","defaultAsset","assetNameClean","dotIndex","isDisabled","bladeToolbar","assetType","VcBlade","_hoisted_1","_hoisted_2","VcContainer","_hoisted_3","VcForm","_hoisted_4","VcImage","_openBlock","_hoisted_5","_normalizeStyle","_hoisted_6","VcField","Field","errorMessage","handleChange","errors","VcInput","_cache","VcTextarea","AssetsDetails","_AssetsDetails","AssetsDetailsModule","components","openBlade","manager","defaultAssets","isLoading","bladeTitle","isDragging","uploader","selectedItems","toggleUploader","sortAssets","sorted","dragOver","dragLeave","onDrop","fileList","existingNames","transfer","base","maxSortOrder","max","inputUpload","onItemClick","actionBuilder","VcDataTable","VcColumn","_toDisplayString","AssetsManager","_AssetsManager","AssetsManagerModule","OFFLINE_NOTIFICATION_ID","_isSetup","_isOnline","useConnectionStatus","isOnline","useNetwork","online","SLOW_REQUEST_THRESHOLD_MS","SLOW_EFFECTIVE_TYPES","_connectionHandler","SLOW_NETWORK_NOTIFICATION_ID","DISMISS_DELAY_MS","SLOW_NETWORK_MESSAGE","_dismissTimer","showSlowNotification","hideSlowNotification","_slowRequestCount","_isSlowEffectiveType","_pendingTimers","_trackedSlowIds","isSlowNetwork","trackRequest","id","untrackRequest","useSlowNetworkDetection","isSlow","slow","LOGIN_PATH_PATTERN","looksLikeLoginPage","pathname","contentType","registerInterceptors","originalFetch","signOut","requestCounter","patched","resolve","isApiRequest","input","raw","url","resource","init","requestId","controller","didTimeout","timeoutId","externalSignal","abortFromExternal","markSessionExpired","redirect","route","errorKey","recentErrors","DEDUP_WINDOW_MS","isDuplicate","now","last","setupGlobalErrorHandlers","existingHandler","instance","info","win","onUnhandledRejection","onWindowError","containerInstances","useInstance","saveInstance","position","unmountComponent","pos","clearContainer","getInstanceByPosition","notificationContainers","useContainer","defaultOptions","reactive","getAllNotifications","container","getNotificationsByPosition","getNotification","notificationId","generateRoot","rootInstance","positionSelector","renderRoot","pendingMounts","appendInstance","pending","mountPromise","dom","NotificationContainer","index$1","createApp","actions","nextTick","hasNotification","containers","positionToRemoveFrom","found","option","containerToUpdate","containerPosition","updatedNotification","targetPosition","propKey","propValue","generateId","registerNotificationBackend","setNotificationBackend","getFrameworkBuildInfo","frameworkVersion","logFrameworkBuildInfo","isMobile","isDesktop","useResponsive","renderMatchesViewport","isSidebarVisible","onModelUpdate","VcSidebar","Sidebar","SidebarComponent","processedLogo","signIn","useExternalProvider","_renderList","provider","ExternalProvider","resolveSafeRedirectPath","candidate","redirectPath","formatSignInError","validatePasswordChange","fields","useRouter","validateField","customizationLoading","signInResult","user","getProviders","loginProviders","providersLoaded","customization","form","login","redirectTo","goToForgotPassword","VcAuthLayout","ExternalProviders","VcHint","ExtensionPoint","_createTextVNode","Login","_Login","forgotPasswordRequestSent","forgotPassword","requestPasswordReset","maskedEmail","email","domain","forgot","goBack","ForgotPassword","_ForgotPassword","validateToken","validatePassword","resetPasswordByToken","veeValidate","disableButton","validate","resetPassword","valid","loginResult","VcLoading","field","_mergeProps","ResetPassword","_ResetPassword","isFormValid","acceptInvitation","Invite","_Invite","changeUserPassword","cancelChange","changePassword","validateForm","serverErrors","clientErrors","VcBanner","ChangePasswordPage","_ChangePassword","_deprecationWarned","warnDeprecated","method","replacement","descriptorToShim","activeId","_blades","_activeWorkspace","_resetAdapterState","getSharedState","bladeStackInstance","bladeMessagingInstance","bladeRegistryInstance","globalBladeNavigationPluginInstanceFallback","d","ws","extractBladeName","blade","comp","useBladeNavigation","activeWorkspace","currentDescriptor","getCurrentInstance","syncUrlPush","syncUrlReplace","createUrlSync","getCurrentBladeId","getBladeIdByIndex","allBlades","isWorkspace","parentId","closeBlade","prevented","goToRoot","routes","mainRouteAlias","getTenantPrefix","onParentCall","currentBladeIndex","callerId","onBeforeClose","cb","warn","resolveBladeByName","routeResolver","_to","setNavigationQuery","prefix","cleanQuery","getNavigationQuery","urlParams","cleanKey","numValue","setBladeError","bladeIdx","clearBladeError","currentBladeNavigationData","isEmptyPrimitive","aObj","bObj","allKeys","useBladeForm","canSaveOverride","autoBeforeClose","autoBeforeUnload","closeConfirmMessage","onRevert","formMeta","setFieldError","errorBag","pristineSnapshot","trackerIsModified","isReady","canSave","setBaseline","markReady","revert","showConfirmation","usePopup","shouldGuard","BladeFormKey","GAP","VISIBLE_TOASTS","computeToastOffsets","ids","heights","isExpanded","count","heightOf","frontToastId","frontHeight","toasts","arrayIndex","sonnerIndex","heightSum","offset","groupHeight","oldestSonnerIdx","hSum","oldestOffset","oldestHeight","useToastStack","expanded","interacting","collapseTimer","expandStack","collapseStack","heightsMap","reportHeight","toastId","height","rounded","forgetHeight","clearHeights","setInteracting","defineComponent","notificationsList","isComponent","content","handleClose","handleClearAll","isTop","showClearAll","layout","children","zIndex","initialHeight","toastStyle","toastProps","toastVNode","h","VcToast","toRaw","clearAllButton","VcIcon","setupI18n","languageService","createLanguageService","LanguageServiceKey","resolveCamelCaseLocale","setupBreakpoints","bp","useBreakpoints","IsPhoneKey","IsTabletKey","IsMobileKey","IsDesktopKey","IsTouchKey","setupLegacyGlobals","BladeRoutesKey","createAndProvideServices","createWidgetService","ToolbarServiceKey","createToolbarService","AppBarWidgetServiceKey","createAppBarWidgetService","MenuServiceKey","createMenuService","SettingsMenuServiceKey","createSettingsMenuService","NotificationStoreKey","createBladeRegistry","installPlugins","Vue3TouchEvents","aiAgentPlugin","provideApplicationInsightsOptions","aiOptions","AppInsightsOptionsKey","installApplicationInsightsDeferred","AppInsightsPlugin","appInsightsInstance","useInsightsFromLib","AppInsightsInstanceKey","setupPageTracking","useAppInsights","setupRouterGuards","getParam","param","from","coreComposables.useTheme"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,SAASA,GAAaC,GAAqB;AAChD,SAAOA,EACJ,QAAQ,gBAAgB,SAAUC,GAAG;AACpC,WAAOA,EAAE,CAAC,IAAI,MAAMA,EAAE,CAAC;AAAA,EACzB,CAAC,EACA,YAAA;AACL;ACNO,MAAMC,KAAe,CAACF,MAAgBA,EAAI,QAAQ,OAAO,CAACG,MAAMA,EAAE,CAAC,EAAE,YAAA,CAAa;AAElF,SAASC,GAAcJ,GAAa;AACzC,QAAMK,IAAYH,GAAaF,CAAG;AAElC,SADmBK,EAAU,CAAC,EAAE,gBAAgBA,EAAU,UAAU,C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core/utilities/camelize.ts","../core/utilities/assets.ts","../core/plugins/permissions/index.ts","../core/notifications/composables/useBladeNotifications.ts","../core/notifications/composables/useNotificationContext.ts","../core/notifications/composables/useBroadcastFilter.ts","../core/notifications/toast-types.ts","../core/plugins/signalR/index.ts","../core/blade-navigation/table-query-state/useTableQueryState.ts","../core/plugins/modularity/index.ts","../core/blade-navigation/utils/restoreFromUrl.ts","../core/blade-navigation/utils/bladeRouterGuard.ts","../shell/_internal/blade-navigation/plugin-v2.ts","../core/constants/defaults.ts","../shell/_internal/popup/common/vc-popup-base.vue","../shell/_internal/popup/common/vc-popup-warning.vue","../shell/_internal/popup/common/vc-popup-error.vue","../shell/_internal/popup/common/vc-popup-info.vue","../shell/_internal/popup/register-presets.ts","../shell/_internal/popup/plugin.ts","../core/composables/useFunctions/debounce.ts","../core/composables/useFunctions/delay.ts","../core/composables/useFunctions/once.ts","../core/composables/useFunctions/throttle.ts","../core/composables/useFunctions/index.ts","../core/composables/useNotifications/index.ts","../core/composables/useAsync/index.ts","../core/composables/useApiClient/index.ts","../core/composables/useLoading/index.ts","../core/composables/useSettings/index.ts","../core/composables/useLatestRequest/index.ts","../core/composables/useAssets/index.ts","../core/composables/useAssetsManager/index.ts","../core/composables/useBeforeUnload/index.ts","../core/composables/useDynamicProperties/utils.ts","../core/composables/useDynamicProperties/strategies/regular.ts","../core/composables/useDynamicProperties/strategies/boolean.ts","../core/composables/useDynamicProperties/strategies/dictionary.ts","../core/composables/useDynamicProperties/strategies/measure.ts","../core/composables/useDynamicProperties/strategies/color.ts","../core/composables/useDynamicProperties/strategies/index.ts","../core/composables/useDynamicProperties/index.ts","../core/composables/useWebVitals/index.ts","../core/composables/useBladeWidgets/index.ts","../core/composables/bladeContext/index.ts","../core/composables/useModificationTracker/index.ts","../modules/assets/components/assets-details/assets-details.vue","../modules/assets/components/assets-details/index.ts","../modules/assets/index.ts","../modules/assets-manager/components/assets-manager/assets-manager.vue","../modules/assets-manager/components/assets-manager/index.ts","../modules/assets-manager/index.ts","../core/composables/useConnectionStatus/index.ts","../core/composables/useSlowNetworkDetection/index.ts","../core/interceptors/index.ts","../core/plugins/global-error-handler/index.ts","../shell/_internal/notifications/composables/useInstance/index.ts","../shell/_internal/notifications/composables/useContainer/index.ts","../shell/_internal/notifications/register-backend.ts","../core/utilities/buildInfo.ts","../shell/components/sidebar/sidebar.vue","../shell/components/sidebar/index.ts","../shell/auth/sign-in/external-provider.vue","../shell/auth/sign-in/external-providers.vue","../shell/auth/utils.ts","../shell/auth/LoginPage/components/login/Login.vue","../shell/auth/LoginPage/components/login/index.ts","../shell/auth/ForgotPasswordPage/components/forgot-password/ForgotPassword.vue","../shell/auth/ForgotPasswordPage/components/forgot-password/index.ts","../shell/auth/ResetPasswordPage/components/reset-password/ResetPassword.vue","../shell/auth/ResetPasswordPage/components/reset-password/index.ts","../shell/auth/InvitePage/components/invite/Invite.vue","../shell/auth/InvitePage/components/invite/index.ts","../shell/auth/ChangePasswordPage/components/change-password/ChangePassword.vue","../shell/auth/ChangePasswordPage/components/change-password/index.ts","../core/composables/useBladeNavigationAdapter/index.ts","../core/composables/useBladeForm/index.ts","../shell/_internal/notifications/components/notification-container/computeToastOffsets.ts","../shell/_internal/notifications/components/notification-container/useToastStack.ts","../shell/_internal/notifications/components/notification-container/index.ts","../index.ts"],"sourcesContent":["export function camelToSnake(str: string): string {\r\n return str\r\n .replace(/[\\w]([A-Z])/g, function (m) {\r\n return m[0] + \"_\" + m[1];\r\n })\r\n .toLowerCase();\r\n}\r\n","export const kebabToCamel = (str: string) => str.replace(/-./g, (x) => x[1].toUpperCase());\r\n\r\nexport function kebabToPascal(str: string) {\r\n const camelCase = kebabToCamel(str);\r\n const pascalCase = camelCase[0].toUpperCase() + camelCase.substring(1);\r\n return pascalCase;\r\n}\r\n","export function camelize(str: string) {\r\n return str.replace(/\\W+(.)/g, function (match, chr) {\r\n return chr.toUpperCase();\r\n });\r\n}\r\n","const imageExtensions = new Set([\"png\", \"jpg\", \"jpeg\", \"svg\", \"gif\"]);\n\nfunction getExtension(fileName: string) {\n return fileName.split(\".\").pop()?.toLowerCase();\n}\n\nfunction isImage(name: string | undefined) {\n if (!name) return false;\n return imageExtensions.has(getExtension(name) ?? \"\");\n}\n\nfunction readableSize(bytes: number | undefined, decimals = 2) {\n if (!bytes) return \"0 Bytes\";\n\n const k = 1024;\n const dm = decimals < 0 ? 0 : decimals;\n const sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\"];\n\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n\n return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`;\n}\n\nconst extensionColors: Record<string, string> = {\n pdf: \"#e74c3c\",\n doc: \"#2b579a\",\n docx: \"#2b579a\",\n xls: \"#217346\",\n xlsx: \"#217346\",\n ppt: \"#d35230\",\n pptx: \"#d35230\",\n csv: \"#16a085\",\n zip: \"#f39c12\",\n mp3: \"#e67e22\",\n aac: \"#e67e22\",\n mp4: \"#8e44ad\",\n avi: \"#8e44ad\",\n};\n\nfunction getExtensionColor(name: string | undefined): string {\n if (!name) return \"var(--neutrals-400)\";\n const ext = getExtension(name) ?? \"\";\n return extensionColors[ext] ?? \"var(--neutrals-400)\";\n}\n\nfunction getExtensionLabel(name: string | undefined): string {\n if (!name) return \"FILE\";\n return (getExtension(name) ?? \"FILE\").toUpperCase();\n}\n\nexport { isImage, readableSize, getExtensionColor, getExtensionLabel };\n","import { usePermissions } from \"@core/composables/usePermissions\";\r\nimport { App } from \"vue\";\r\n\r\nexport const permissions = {\r\n install(app: App) {\r\n const { hasAccess } = usePermissions();\r\n app.config.globalProperties.$hasAccess = hasAccess;\r\n },\r\n};\r\n","import { computed, onScopeDispose, getCurrentScope } from \"vue\";\nimport { PushNotification } from \"@core/api/platform\";\nimport { useNotificationStore } from \"./useNotificationStore\";\nimport type { BladeNotificationOptions, BladeNotificationReturn } from \"../types\";\n\n/**\n * Blade-level notification subscription.\n *\n * Level 2 (additive): provides blade-specific behavior on top of\n * the always-on module config (Level 1). When the blade unmounts,\n * only blade-specific behavior stops — dropdown and toasts continue.\n *\n * Must be called within a component setup or effectScope.\n */\nexport function useBladeNotifications<T extends PushNotification = PushNotification>(\n options: BladeNotificationOptions<T>,\n): BladeNotificationReturn<T> {\n const store = useNotificationStore();\n\n // Subscribe with handler\n const unsub = store.subscribe({\n types: options.types,\n filter: options.filter as ((msg: PushNotification) => boolean) | undefined,\n handler: options.onMessage as ((msg: PushNotification) => void) | undefined,\n });\n\n // Auto-cleanup if within a scope\n if (getCurrentScope()) {\n onScopeDispose(unsub);\n }\n\n // Filtered messages from realtime\n const messages = computed(() =>\n store.realtime.value.filter((msg): msg is T => {\n if (!msg.notifyType || !options.types.includes(msg.notifyType)) return false;\n if (!msg.isNew) return false;\n if (options.filter && !(options.filter as (m: PushNotification) => boolean)(msg)) return false;\n return true;\n }),\n );\n\n const unreadCount = computed(() => messages.value.length);\n\n function markAsRead(msg: T) {\n store.markAsRead(msg);\n }\n\n return {\n messages,\n unreadCount,\n markAsRead,\n };\n}\n","import { inject, type ComputedRef } from \"vue\";\nimport { PushNotification } from \"@core/api/platform\";\nimport { NotificationContextKey } from \"../types\";\n\nexport function useNotificationContext<T extends PushNotification = PushNotification>(): ComputedRef<T> {\n const ctx = inject(NotificationContextKey);\n if (!ctx) {\n throw new Error(\"useNotificationContext() must be used inside a notification template\");\n }\n return ctx as ComputedRef<T>;\n}\n","import { PushNotification } from \"@core/api/platform\";\nimport { useNotificationStore } from \"./useNotificationStore\";\n\nexport interface UseBroadcastFilterReturn {\n setBroadcastFilter(fn: (msg: PushNotification) => boolean): void;\n clearBroadcastFilter(): void;\n}\n\nexport function useBroadcastFilter(): UseBroadcastFilterReturn {\n const store = useNotificationStore();\n return {\n setBroadcastFilter: store.setBroadcastFilter,\n clearBroadcastFilter: store.clearBroadcastFilter,\n };\n}\n","import { VNode, DefineComponent, InjectionKey, Ref } from \"vue\";\n\nexport type NotificationType = \"success\" | \"error\" | \"warning\" | \"default\";\n\nexport interface NotificationOptions {\n pauseOnHover?: boolean;\n timeout?: number | boolean;\n content?: Content;\n notificationId?: number | string;\n type?: NotificationType;\n onOpen?: <T>(payload: T) => void;\n onClose?: <T>(payload: T) => void;\n\n payload?: string | Record<string, any>;\n updateId?: string | number;\n position?: NotificationPosition;\n /** Set by `actions.dismiss()` to trigger exit animation in VcToast */\n dismissing?: boolean;\n}\n\n// Adding a new type for notification positioning\nexport type NotificationPosition =\n | \"top-center\"\n | \"top-right\"\n | \"top-left\"\n | \"bottom-center\"\n | \"bottom-right\"\n | \"bottom-left\";\n\nexport type Content = string | VNode | DefineComponent<{}, {}, any>;\n\nexport interface NotificationContainerState {\n notificationContainers: Record<NotificationPosition, Ref<NotificationOptions[]>>;\n actions: {\n remove(id: string | number): void;\n clear(): void;\n };\n}\n\nexport const NotificationContainerStateKey: InjectionKey<NotificationContainerState> =\n Symbol(\"NotificationContainerState\");\n","import { type App, watch } from \"vue\";\nimport { HubConnectionBuilder, LogLevel } from \"@microsoft/signalr\";\nimport { PushNotification } from \"@core/api/platform\";\nimport { useNotificationStore } from \"@core/notifications\";\nimport { useUserManagement } from \"@core/composables/useUserManagement\";\nimport { useCypressSignalRMock } from \"cypress-signalr-mock\";\nimport { createLogger } from \"@core/utilities\";\n\nconst logger = createLogger(\"signalR\");\n\nexport const signalR = {\n install(_app: App) {\n const store = useNotificationStore();\n const { isAuthenticated } = useUserManagement();\n let reconnect = false;\n const connection =\n useCypressSignalRMock(\"pushNotificationHub\", { enableForVitest: true }) ??\n new HubConnectionBuilder()\n .withUrl(\"/pushNotificationHub\")\n .withAutomaticReconnect()\n .configureLogging(LogLevel.Information)\n .build();\n\n const start = () => {\n connection\n .start()\n .then(() => {\n logger.info(\"Connected.\");\n })\n .catch((err: unknown) => {\n logger.error(\"Connection Error: \", err);\n setTimeout(() => start(), 5000);\n });\n };\n\n async function stop() {\n await connection.stop();\n }\n\n connection.onclose(() => {\n if (reconnect) start();\n });\n\n connection.on(\"Send\", (message: PushNotification) => {\n store.ingest(message);\n });\n\n connection.on(\"SendSystemEvents\", (message: PushNotification) => {\n store.ingest(message, { broadcast: true });\n });\n\n watch(\n isAuthenticated,\n async (value) => {\n if (value) {\n reconnect = true;\n start();\n } else {\n reconnect = false;\n await stop();\n }\n },\n { immediate: true },\n );\n },\n};\n","import { inject } from \"vue\";\nimport { TableQueryStateKey, type TableQueryPatch } from \"./types\";\n\nexport interface UseTableQueryStateReturn {\n /**\n * Read the table view state (sort/search/page) restored from the URL for this\n * table. Returns an empty patch when no persistence service is provided (a\n * standalone table or a non-URL blade), so callers can use it unconditionally.\n */\n read(): TableQueryPatch;\n}\n\n/**\n * Reads the table view state (sort/search/page) restored from the URL.\n *\n * A list page calls this in `setup`, reads `{ sort, search, page }`, and seeds its\n * own refs before its loader runs, so a reload makes one request. Read-only: the\n * write-back (view state → URL) stays inside VcDataTable via useTableQueryPersistence.\n *\n * @param stateKey The same `state-key` passed to VcDataTable for this table.\n */\nexport function useTableQueryState(stateKey?: string): UseTableQueryStateReturn {\n const service = inject(TableQueryStateKey, undefined);\n\n return {\n read: () => (service ? service.read(stateKey) : {}),\n };\n}\n","import { App, Component, inject } from \"vue\";\nimport { i18n } from \"@core/plugins/i18n\";\nimport type { BladeInstanceConstructor } from \"@core/blade-navigation/types\";\nimport { createLogger } from \"@core/utilities\";\nimport { useNotificationStore } from \"@core/notifications\";\nimport type { ModuleNotificationsConfig } from \"@core/notifications\";\nimport { notification } from \"@core/notifications/notification\";\nimport { BladeRegistryKey, IBladeRegistryInstance } from \"@core/composables/useBladeRegistry\";\n\nconst logger = createLogger(\"modularity\");\n\n/**\n * Options for defineAppModule.\n */\nexport interface DefineAppModuleOptions {\n /** Blade components for BladeRegistry registration */\n blades?: Record<string, BladeInstanceConstructor>;\n /** Locales for vue-i18n merge */\n locales?: Record<string, object>;\n /** @deprecated Use `notifications` instead */\n notificationTemplates?: Record<string, Component & { notifyType?: string }>;\n /** Notification type configurations (new API) */\n notifications?: ModuleNotificationsConfig;\n}\n\n/**\n * Creates an app module plugin with explicit registration intent.\n *\n * @example\n * ```ts\n * export default defineAppModule({\n * blades: { OrdersList, OrderDetails },\n * locales: { en, de },\n * });\n * ```\n */\nexport function defineAppModule(options: DefineAppModuleOptions) {\n const { blades, locales, notificationTemplates, notifications } = options;\n\n return {\n install(app: App): void {\n const store = useNotificationStore();\n\n // Step 1: Blade registration (only if blades provided)\n if (blades && Object.keys(blades).length > 0) {\n const bladeRegistry = app.runWithContext(() => inject<IBladeRegistryInstance>(BladeRegistryKey));\n\n if (!bladeRegistry?._registerBladeFn) {\n logger.error(\"defineAppModule: BladeRegistry not found. Blade registration will be skipped.\");\n } else {\n for (const [exportKey, component] of Object.entries(blades)) {\n const name = component.name || exportKey;\n app.runWithContext(() => {\n bladeRegistry._registerBladeFn(name, {\n component,\n route: component.url,\n isWorkspace: component.isWorkspace || false,\n routable: component.routable !== false,\n permissions: component.permissions,\n });\n });\n }\n }\n }\n\n // Step 2: Register notification types (new API)\n if (notifications) {\n for (const [type, config] of Object.entries(notifications)) {\n store.registerType(type, config);\n }\n }\n\n // Step 3: Legacy notification support (deprecated)\n if (!notifications && notificationTemplates) {\n for (const template of Object.values(notificationTemplates)) {\n const type = template.notifyType;\n if (type) {\n store.registerType(type, {\n template: template as Component,\n toast: { mode: \"auto\" },\n });\n }\n }\n }\n\n // Step 3b: Legacy blade notifyType compat shim (deprecated)\n if (blades) {\n for (const component of Object.values(blades)) {\n if (component.notifyType) {\n const notifyTypes = Array.isArray(component.notifyType) ? component.notifyType : [component.notifyType];\n\n // Skip if notifications config already handles these types\n const unhandledTypes = notifyTypes.filter((t) => !store.registry.has(t));\n if (unhandledTypes.length > 0) {\n // Permanent subscription — no cleanup needed (app lifetime)\n store.subscribe({\n types: notifyTypes,\n handler: (message) => {\n if (message.title) {\n notification(message.title, {\n onClose() {\n store.markAsRead(message);\n },\n });\n }\n },\n });\n\n if (import.meta.env.DEV) {\n logger.warn(\n `[vc-shell] notifyType on blade \"${component.name}\" is deprecated. ` +\n `Use useBladeNotifications() inside the blade instead. ` +\n `See: MIGRATION_GUIDE.md#notifications`,\n );\n }\n }\n }\n }\n }\n\n // Step 4: Locale merge\n if (locales) {\n for (const [key, message] of Object.entries(locales)) {\n i18n.global.mergeLocaleMessage(key, message);\n }\n }\n },\n };\n}\n\n/**\n * @deprecated Use `defineAppModule()` instead. This function is a backward-compatible\n * adapter that delegates to `defineAppModule`. It will be removed in a future major version.\n *\n * @example\n * ```ts\n * // Before:\n * export default createAppModule(pages, locales);\n * // After:\n * export default defineAppModule({ blades: pages, locales });\n * ```\n */\nexport function createAppModule(\n pages: Record<string, BladeInstanceConstructor>,\n locales?: Record<string, object>,\n notificationTemplates?: Record<string, Component & { notifyType?: string }>,\n _components?: Record<string, Component>,\n) {\n return defineAppModule({\n blades: pages,\n locales,\n notificationTemplates,\n });\n}\n","import type { Router } from \"vue-router\";\nimport type { IBladeRegistry } from \"@core/composables/useBladeRegistry\";\nimport type { IBladeStack, ParsedBladeUrl } from \"@core/blade-navigation/types\";\nimport { navigateToMainRoute } from \"./navigateToMainRoute\";\nimport { notification } from \"@core/notifications/notification\";\nimport { i18n } from \"@core/plugins\";\n\n/**\n * Restore the blade stack from a parsed URL.\n *\n * Used on initial page load and when navigating via URL (not back/forward).\n * Resolves URL segments to blade names via BladeRegistry, then opens\n * workspace + child blade.\n *\n * Returns `true` if the URL contained segments for a non-routable blade\n * that was skipped — the caller should clean up the URL to match the\n * actual blade stack state.\n *\n * @param bladeStack - The BladeStack to populate\n * @param bladeRegistry - Registry for resolving URLs → blade names\n * @param parsed - Parsed URL segments\n * @param hasAccess - Optional permission check function\n * @param router - Optional router for redirecting on access denial\n * @param routeParams - Route params to preserve on redirect (e.g. sellerId for tenant prefix)\n * @returns `true` if the URL needs cleanup (non-routable blade was skipped)\n */\nexport async function restoreFromUrl(\n bladeStack: IBladeStack,\n bladeRegistry: IBladeRegistry,\n parsed: ParsedBladeUrl,\n hasAccess?: (permissions: string | string[] | undefined) => boolean,\n router?: Router,\n routeParams?: Record<string, string>,\n): Promise<boolean> {\n // Skip if no workspace URL to restore\n if (!parsed.workspaceUrl) return false;\n\n // Find workspace blade by URL segment\n const workspaceMatch = bladeRegistry.getBladeByRoute(parsed.workspaceUrl);\n\n // Guard 1: blade not found\n if (!workspaceMatch) {\n console.warn(`[restoreFromUrl] No workspace blade found for URL segment '${parsed.workspaceUrl}'`);\n if (router) navigateToMainRoute(router, routeParams);\n return false;\n }\n\n // Guard 2: not a workspace\n if (!workspaceMatch.data.isWorkspace) {\n console.warn(\n `[restoreFromUrl] Blade '${workspaceMatch.name}' matched URL '${parsed.workspaceUrl}' but is not a workspace`,\n );\n if (router) navigateToMainRoute(router, routeParams);\n return false;\n }\n\n // Guard 3: permissions\n // Note: openWorkspace() also checks permissions as a safety net (defense-in-depth),\n // but we check here first to redirect and show toast before the workspace is opened.\n if (hasAccess && workspaceMatch.data.permissions && !hasAccess(workspaceMatch.data.permissions)) {\n console.warn(`[restoreFromUrl] Access denied to workspace '${workspaceMatch.name}'`);\n notification.error(i18n.global.t(\"PERMISSION_MESSAGES.ACCESS_RESTRICTED\"), { timeout: 3000 });\n if (router) navigateToMainRoute(router, routeParams);\n return false;\n }\n\n // Open workspace (if not already the current one)\n const currentWorkspace = bladeStack.workspace.value;\n if (currentWorkspace?.name !== workspaceMatch.name) {\n await bladeStack.openWorkspace({ name: workspaceMatch.name });\n }\n\n // If there's a child blade URL, open it (if not already open with matching param)\n if (parsed.bladeUrl) {\n const bladeMatch = bladeRegistry.getBladeByRoute(parsed.bladeUrl);\n if (bladeMatch) {\n // Idempotency: skip if child already exists with same name and param.\n // This means the blade was opened programmatically (normal operation)\n // and syncUrlPush just triggered the guard — not a page restore.\n const existingChild = bladeStack.blades.value.find((b) => b.name === bladeMatch.name && b.param === parsed.param);\n if (existingChild) {\n return false;\n }\n\n // Non-routable blades should not be restored from URL.\n // Signal the caller to clean the URL.\n if (bladeMatch.data.routable === false) {\n return true;\n }\n\n await bladeStack.openBlade({\n name: bladeMatch.name,\n param: parsed.param,\n // options not available from URL — blade must handle gracefully\n });\n } else {\n console.warn(`[restoreFromUrl] No blade found for URL segment '${parsed.bladeUrl}'`);\n }\n }\n\n return false;\n}\n","import type { RouteLocationNormalized, Router } from \"vue-router\";\nimport type { UseBladeRegistryReturn } from \"@core/composables/useBladeRegistry\";\nimport type { IBladeStack } from \"@core/blade-navigation/types\";\nimport { parseBladeUrl, buildUrlFromStack } from \"@core/blade-navigation/utils/urlSync\";\nimport { restoreFromUrl } from \"@core/blade-navigation/utils/restoreFromUrl\";\n\n/**\n * Result of the blade router guard.\n *\n * - `undefined` — allow navigation (no redirect)\n * - `false` — cancel navigation (e.g. beforeClose guard prevented closing)\n * - `{ path, query, replace }` — redirect to cleaned-up URL\n */\nexport type BladeGuardResult = undefined | false | { path: string; query: Record<string, string>; replace: true };\n\nasync function clearBladeStackRespectingGuards(bladeStack: IBladeStack): Promise<boolean> {\n while (bladeStack.blades.value.length > 1) {\n const bladesBeforeClose = bladeStack.blades.value;\n const lastBlade = bladesBeforeClose[bladesBeforeClose.length - 1];\n const prevented = await bladeStack.closeBlade(lastBlade.id);\n\n if (prevented) {\n return false;\n }\n\n // Defensive exit to avoid infinite loops if stack doesn't change unexpectedly.\n if (bladeStack.blades.value.length >= bladesBeforeClose.length) {\n return false;\n }\n }\n\n if (bladeStack.blades.value.length > 0) {\n bladeStack._restoreStack([]);\n }\n\n return true;\n}\n\n/**\n * Router guard that syncs URL navigation with the BladeStack.\n *\n * Determines whether a navigation target is a real Vue Router page\n * or a blade URL handled by the catch-all route:\n *\n * - **Real child routes** (e.g. \"Platform\", \"Dashboard\"): clears any open\n * blades and lets Vue Router render the page.\n * - **Blade catch-all route**: parses URL segments and restores the\n * blade stack (workspace + optional child blade).\n *\n * The catch-all route is identified by `meta.bladeCatchAll`, which is set\n * by the BladeNavigationPlugin when it registers the catch-all.\n */\nexport async function bladeRouterGuard(\n to: RouteLocationNormalized,\n bladeStack: IBladeStack,\n bladeRegistry: UseBladeRegistryReturn,\n hasAccess?: (permissions: string | string[] | undefined) => boolean,\n router?: Router,\n): Promise<BladeGuardResult> {\n // Only process routes under the root (App) route\n if (!to.matched.some((r) => r.meta?.root)) return undefined;\n\n // Only run blade restoration when the URL matches the blade catch-all route.\n // Real Vue Router child routes (e.g. \"Platform\", \"Dashboard\") should be\n // handled by Vue Router normally — not interpreted as blade URL segments.\n const isBladeCatchAll = to.matched.some((r) => r.meta?.bladeCatchAll);\n if (!isBladeCatchAll) {\n // Clear any open blades so the page renders without stale blade state\n if (bladeStack.blades.value.length > 0) {\n const wasCleared = await clearBladeStackRespectingGuards(bladeStack);\n if (!wasCleared) {\n return false;\n }\n }\n return undefined;\n }\n\n // Extract tenant prefix from route params (first param, typically sellerId)\n const tenantPrefix = (Object.values(to.params)?.[0] as string) || \"\";\n\n // Parse the URL path into blade segments\n const parsed = parseBladeUrl(to.path, tenantPrefix);\n\n if (!parsed.workspaceUrl) {\n // No workspace in URL (e.g. navigating to \"/\") — clear the blade stack.\n // The app shell renders its own default view (e.g. dashboard) when the stack is empty.\n if (bladeStack.blades.value.length > 0) {\n const wasCleared = await clearBladeStackRespectingGuards(bladeStack);\n if (!wasCleared) {\n return false;\n }\n }\n return undefined;\n }\n\n // Preserve route params (e.g. sellerId) so fallback redirects keep the tenant prefix\n const routeParams = Object.fromEntries(Object.entries(to.params).filter(([, v]) => typeof v === \"string\")) as Record<\n string,\n string\n >;\n\n // Restore blade stack from URL (idempotent — skips if already matching)\n const needsUrlCleanup = await restoreFromUrl(bladeStack, bladeRegistry, parsed, hasAccess, router, routeParams);\n\n // If a non-routable blade was in the URL, clean up to match actual stack\n if (needsUrlCleanup) {\n const { path, query } = buildUrlFromStack(tenantPrefix, bladeStack.blades.value);\n return { path, query, replace: true };\n }\n\n return undefined;\n}\n","import { Router } from \"vue-router\";\r\nimport { App } from \"vue\";\r\nimport { BladeNavigationPlugin, BladeStackKey, BladeMessagingKey } from \"@core/blade-navigation/types\";\r\nimport { createBladeStack } from \"@core/blade-navigation/useBladeStack\";\r\nimport { createBladeMessaging } from \"@core/blade-navigation/useBladeMessaging\";\r\nimport { bladeRouterGuard } from \"@core/blade-navigation/utils/bladeRouterGuard\";\r\nimport { useBladeRegistry } from \"@core/composables/useBladeRegistry\";\r\nimport type { IBladeRegistry } from \"@core/composables/useBladeRegistry\";\r\nimport { usePermissions } from \"@core/composables/usePermissions\";\r\nimport {\r\n setBladeNavigationInstance,\r\n setBladeStackInstance,\r\n setBladeMessagingInstance,\r\n setBladeRegistryInstance,\r\n} from \"@core/blade-navigation/singletons\";\r\n\r\n// Re-export singletons for backward compatibility\r\nexport {\r\n bladeNavigationInstance,\r\n bladeStackInstance,\r\n bladeMessagingInstance,\r\n bladeRegistryInstance,\r\n _resetBladeNavigationSingletons,\r\n} from \"@core/blade-navigation/singletons\";\r\n\r\n/**\r\n * New Blade Navigation Plugin (v2).\r\n *\r\n * Sets up:\r\n * - BladeStack state machine (provided via BladeStackKey)\r\n * - BladeMessaging for inter-blade communication (provided via BladeMessagingKey)\r\n * - Auto catch-all route under the root route (safety net for blade URLs)\r\n * - Router beforeEach guard for URL → blade stack restoration\r\n *\r\n * Vue Router serves as the URL sync layer only. BladeStack is the source of truth.\r\n * Back/forward is handled natively by Vue Router — beforeEach fires on popstate\r\n * and restores BladeStack from the URL.\r\n */\r\nexport const VcBladeNavigationComponent = {\r\n install(app: App, args: { router: Router }) {\r\n const { router } = args;\r\n\r\n // ── Legacy backward compatibility ───────────────────────────────────────\r\n const bladeNavigationPluginData: BladeNavigationPlugin = {\r\n router: args.router,\r\n };\r\n setBladeNavigationInstance(bladeNavigationPluginData);\r\n\r\n // ── New BladeStack system ───────────────────────────────────────────────\r\n\r\n // BladeRegistry must already be provided by the main app setup (framework/index.ts)\r\n const bladeRegistry = app.runWithContext(() => {\r\n try {\r\n return useBladeRegistry();\r\n } catch {\r\n console.warn(\r\n \"[BladeNavigationPlugin] BladeRegistry not yet available. \" +\r\n \"BladeStack will be created but URL restoration may be deferred.\",\r\n );\r\n return undefined;\r\n }\r\n }) as IBladeRegistry | undefined;\r\n\r\n if (!bladeRegistry) {\r\n console.error(\"[BladeNavigationPlugin] BladeRegistry is required but not found.\");\r\n return;\r\n }\r\n\r\n // Get permission checker for workspace access control\r\n const { hasAccess } = app.runWithContext(() => usePermissions());\r\n\r\n // Create BladeStack with permission enforcement\r\n const bladeStack = createBladeStack(bladeRegistry, hasAccess);\r\n app.provide(BladeStackKey, bladeStack);\r\n setBladeStackInstance(bladeStack);\r\n\r\n // Create BladeMessaging\r\n const messaging = createBladeMessaging(bladeStack);\r\n app.provide(BladeMessagingKey, messaging);\r\n setBladeMessagingInstance(messaging);\r\n setBladeRegistryInstance(bladeRegistry!);\r\n\r\n // ── Auto-register catch-all route ───────────────────────────────────────\r\n // Safety net: prevents Vue Router \"route not found\" errors for blade URLs\r\n // in hash mode. BladeStack handles actual rendering.\r\n const mainRoute = router.getRoutes().find((r) => r.meta?.root);\r\n if (mainRoute) {\r\n router.addRoute(mainRoute.name as string, {\r\n path: \":pathMatch(.*)*\",\r\n component: { render: () => null },\r\n meta: { bladeCatchAll: true },\r\n });\r\n }\r\n\r\n // ── Router guard for URL → blade stack restoration ──────────────────────\r\n // Fires on: direct URL entry, deep links, back/forward (popstate)\r\n // The adapter's router.push()/replace() also triggers this, but\r\n // restoreFromUrl is idempotent — if stack already matches URL, it's a no-op.\r\n router.beforeEach((to) => bladeRouterGuard(to, bladeStack, bladeRegistry, hasAccess, router));\r\n },\r\n};\r\n","/**\r\n * Component Default Values for VC-Shell Framework\r\n * Centralized storage for default prop values across components\r\n */\r\n\r\nexport const COMPONENT_DEFAULTS = {\r\n input: {\r\n maxlength: 1024,\r\n debounce: 0,\r\n type: \"text\" as const,\r\n autocomplete: \"off\" as const,\r\n },\r\n\r\n select: {\r\n debounce: 500,\r\n pageSize: 20,\r\n searchable: true,\r\n clearable: true,\r\n },\r\n\r\n table: {\r\n pageSize: 20,\r\n pageSizes: [10, 20, 50, 100] as readonly number[],\r\n selectable: false,\r\n multiselect: false,\r\n stickyHeader: true,\r\n },\r\n\r\n pagination: {\r\n pageSize: 20,\r\n visiblePages: 5,\r\n },\r\n\r\n textarea: {\r\n rows: 3,\r\n maxlength: 4096,\r\n },\r\n\r\n editor: {\r\n minHeight: 200,\r\n maxHeight: 500,\r\n },\r\n\r\n tooltip: {\r\n delay: 300,\r\n placement: \"top\" as const,\r\n },\r\n\r\n modal: {\r\n closeOnEscape: true,\r\n closeOnOverlayClick: true,\r\n },\r\n\r\n notification: {\r\n duration: 5000,\r\n position: \"top-right\" as const,\r\n },\r\n\r\n dashboard: {\r\n columns: 12,\r\n rowHeight: 80,\r\n gap: 20,\r\n },\r\n} as const;\r\n\r\n/**\r\n * Type for accessing component defaults\r\n */\r\nexport type ComponentDefaults = typeof COMPONENT_DEFAULTS;\r\n\r\n/**\r\n * Helper to get defaults for a specific component\r\n */\r\nexport function getComponentDefaults<K extends keyof ComponentDefaults>(componentName: K): ComponentDefaults[K] {\r\n return COMPONENT_DEFAULTS[componentName];\r\n}\r\n","<template>\n <VcPopup\n :variant=\"variant\"\n :is-mobile-fullscreen=\"isMobileFullscreen\"\n :title=\"title\"\n :closable=\"closable\"\n @close=\"$emit('close')\"\n >\n <template\n v-if=\"$slots.header\"\n #header\n >\n <slot name=\"header\" />\n </template>\n\n <template #content>\n <slot />\n </template>\n\n <template #footer=\"{ close }\">\n <slot\n name=\"footer\"\n :close=\"close\"\n :confirm=\"() => handleConfirm(close)\"\n >\n <div\n class=\"vc-popup-base__actions\"\n :class=\"{\n 'vc-popup-base__actions--confirm': mode === 'confirm',\n 'vc-popup-base__actions--single': mode === 'acknowledge',\n }\"\n >\n <template v-if=\"mode === 'confirm'\">\n <VcButton\n :text=\"confirmAsText\"\n class=\"vc-popup-base__confirm\"\n @click=\"handleConfirm(close)\"\n >\n {{ confirmLabel }}\n </VcButton>\n <VcButton @click=\"close\">{{ cancelLabel }}</VcButton>\n </template>\n <VcButton\n v-else\n class=\"vc-popup-base__single\"\n @click=\"close\"\n >\n {{ actionLabel }}\n </VcButton>\n </div>\n </slot>\n </template>\n </VcPopup>\n</template>\n<!-- eslint-disable @typescript-eslint/no-explicit-any -->\n<script lang=\"ts\" setup>\nimport VcPopup, { type PopupVariant } from \"@ui/components/organisms/vc-popup/vc-popup.vue\";\nimport { VcButton } from \"@ui/components/atoms/vc-button\";\n\nexport interface Props {\n title?: string;\n variant?: PopupVariant;\n mode?: \"acknowledge\" | \"confirm\";\n actionLabel?: string;\n confirmLabel?: string;\n cancelLabel?: string;\n confirmAsText?: boolean;\n closable?: boolean;\n isMobileFullscreen?: boolean;\n closeOnConfirm?: boolean;\n}\n\nexport interface Emits {\n (event: \"close\"): void;\n (event: \"confirm\"): void;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n variant: \"default\",\n mode: \"acknowledge\",\n actionLabel: \"\",\n confirmLabel: \"\",\n cancelLabel: \"\",\n confirmAsText: false,\n closable: true,\n isMobileFullscreen: true,\n closeOnConfirm: false,\n});\n\nconst emit = defineEmits<Emits>();\n\ndefineSlots<{\n header: (props: any) => any;\n default: (props: any) => any;\n footer: (props: { close: () => void; confirm: () => void }) => any;\n}>();\n\nfunction handleConfirm(close: () => void): void {\n emit(\"confirm\");\n\n if (props.closeOnConfirm) {\n close();\n }\n}\n</script>\n\n<style lang=\"scss\">\n:root {\n // Deprecated alias: --confirm-button-color\n --popup-base-confirm-color: var(--confirm-button-color, var(--secondary-700));\n}\n\n.vc-popup-base {\n &__actions {\n @apply tw-flex tw-flex-auto tw-justify-end;\n\n &--confirm {\n @apply tw-gap-6;\n }\n\n &--single {\n @apply tw-gap-0;\n }\n }\n\n &__single {\n @apply tw-ml-auto;\n }\n\n &__confirm {\n color: var(--popup-base-confirm-color) !important;\n }\n}\n</style>\n","<template>\n <VcPopupBase\n variant=\"warning\"\n mode=\"confirm\"\n :confirm-label=\"$t('COMPONENTS.ORGANISMS.VC_POPUP.CONFIRM')\"\n :cancel-label=\"$t('COMPONENTS.ORGANISMS.VC_POPUP.CANCEL')\"\n confirm-as-text\n :title=\"title\"\n @close=\"$emit('close')\"\n @confirm=\"$emit('confirm')\"\n >\n <template\n v-if=\"$slots.header\"\n #header\n >\n <slot name=\"header\" />\n </template>\n <slot />\n </VcPopupBase>\n</template>\n<!-- eslint-disable @typescript-eslint/no-explicit-any -->\n<script lang=\"ts\" setup>\nimport VcPopupBase from \"@shell/_internal/popup/common/vc-popup-base.vue\";\n\nexport interface Props {\n title?: string;\n}\n\nexport interface Emits {\n (event: \"close\"): void;\n (event: \"confirm\"): void;\n}\n\ndefineProps<Props>();\n\ndefineEmits<Emits>();\n\ndefineSlots<{\n header: (props: any) => any;\n default: (props: any) => any;\n}>();\n</script>\n","<template>\n <VcPopupBase\n variant=\"error\"\n mode=\"acknowledge\"\n :action-label=\"$t('COMPONENTS.ORGANISMS.VC_POPUP.OK')\"\n :title=\"title\"\n @close=\"$emit('close')\"\n >\n <template\n v-if=\"$slots.header\"\n #header\n >\n <slot name=\"header\" />\n </template>\n <slot />\n </VcPopupBase>\n</template>\n<!-- eslint-disable @typescript-eslint/no-explicit-any -->\n<script lang=\"ts\" setup>\nimport VcPopupBase from \"@shell/_internal/popup/common/vc-popup-base.vue\";\n\nexport interface Props {\n title?: string;\n}\n\nexport interface Emits {\n (event: \"close\"): void;\n}\n\ndefineProps<Props>();\n\ndefineEmits<Emits>();\n\ndefineSlots<{\n header: (props: any) => any;\n default: (props: any) => any;\n}>();\n</script>\n","<template>\n <VcPopupBase\n variant=\"info\"\n mode=\"acknowledge\"\n :action-label=\"$t('COMPONENTS.ORGANISMS.VC_POPUP.OK')\"\n :title=\"title\"\n @close=\"$emit('close')\"\n >\n <template\n v-if=\"$slots.header\"\n #header\n >\n <slot name=\"header\" />\n </template>\n <slot />\n </VcPopupBase>\n</template>\n<!-- eslint-disable @typescript-eslint/no-explicit-any -->\n<script lang=\"ts\" setup>\nimport VcPopupBase from \"@shell/_internal/popup/common/vc-popup-base.vue\";\n\nexport interface Props {\n title?: string;\n}\n\nexport interface Emits {\n (event: \"close\"): void;\n}\n\ndefineProps<Props>();\n\ndefineEmits<Emits>();\n\ndefineSlots<{\n header: (props: any) => any;\n default: (props: any) => any;\n}>();\n</script>\n","import { registerPopupPreset } from \"@core/composables/usePopup/preset-registry\";\nimport vcPopupWarning from \"@shell/_internal/popup/common/vc-popup-warning.vue\";\nimport vcPopupError from \"@shell/_internal/popup/common/vc-popup-error.vue\";\nimport vcPopupInfo from \"@shell/_internal/popup/common/vc-popup-info.vue\";\n\n/**\n * Registers shell popup preset components (warning, error, info) with the core popup registry.\n * Called once during framework plugin install.\n */\nexport function registerPopupPresets(): void {\n registerPopupPreset(\"warning\", vcPopupWarning);\n registerPopupPreset(\"error\", vcPopupError);\n registerPopupPreset(\"info\", vcPopupInfo);\n}\n","import { App, shallowReactive, DefineComponent } from \"vue\";\nimport type { PopupPlugin, UsePopupProps, UsePopupInternal } from \"@core/composables/usePopup/types\";\nimport { PopupPluginKey } from \"@core/composables/usePopup/keys\";\nimport { setPopupPluginInstance } from \"@core/composables/usePopup/singleton\";\nimport { registerPopupPresets } from \"@shell/_internal/popup/register-presets\";\n\n// Re-export for backward compatibility\nexport { popupPluginInstance } from \"@core/composables/usePopup/singleton\";\n\nexport const VcPopupHandler = {\n install(app: App) {\n const popups = shallowReactive<(UsePopupProps<DefineComponent> & UsePopupInternal)[]>([]);\n\n const popupPlugin: PopupPlugin = {\n popups,\n };\n\n app.config.globalProperties.$popupPlugin = popupPlugin;\n app.provide(PopupPluginKey, popupPlugin);\n setPopupPluginInstance(popupPlugin);\n registerPopupPresets();\n },\n};\n","export default function debounce(func: (...args: any[]) => void, delay: number): (...args: unknown[]) => void {\r\n let timer: number | null = null;\r\n\r\n return function (...args: unknown[]): void {\r\n if (timer) {\r\n clearTimeout(timer);\r\n }\r\n\r\n timer = window.setTimeout(() => {\r\n timer = null;\r\n func(...args);\r\n }, delay);\r\n };\r\n}\r\n","export default function delay(func: (...args: unknown[]) => void, delay = 0): void {\r\n setTimeout(func, delay);\r\n}\r\n","const resultsMap = new WeakMap();\r\n\r\nexport default function once(func: (...args: unknown[]) => void): (...args: unknown[]) => unknown {\r\n return function (...args: unknown[]): unknown {\r\n if (!resultsMap.has(func)) {\r\n const result = func(...args);\r\n resultsMap.set(func, result);\r\n }\r\n return resultsMap.get(func);\r\n };\r\n}\r\n","export default function throttle(func: (...args: unknown[]) => void, delay: number): (...args: unknown[]) => void {\r\n let wasThrottled = false;\r\n\r\n return function (...args: unknown[]): void {\r\n if (!wasThrottled) {\r\n func(...args);\r\n wasThrottled = true;\r\n setTimeout(() => {\r\n wasThrottled = false;\r\n }, delay);\r\n }\r\n };\r\n}\r\n","import debounce from \"@core/composables/useFunctions/debounce\";\r\nimport delay from \"@core/composables/useFunctions/delay\";\r\nimport once from \"@core/composables/useFunctions/once\";\r\nimport throttle from \"@core/composables/useFunctions/throttle\";\r\n\r\nexport interface UseFunctionsReturn {\r\n debounce: typeof debounce;\r\n delay: typeof delay;\r\n once: typeof once;\r\n throttle: typeof throttle;\r\n}\r\n\r\n/** @deprecated Use UseFunctionsReturn instead */\r\nexport type IUseFunctions = UseFunctionsReturn;\r\n\r\nexport function useFunctions(): UseFunctionsReturn {\r\n return {\r\n debounce,\r\n delay,\r\n once,\r\n throttle,\r\n };\r\n}\r\n","import { computed, ComputedRef, getCurrentScope, onScopeDispose } from \"vue\";\nimport { PushNotification } from \"@core/api/platform\";\nimport { useNotificationStore } from \"@core/notifications\";\nimport { orderBy } from \"lodash-es\";\nimport { createLogger } from \"@core/utilities\";\n\nconst logger = createLogger(\"use-notifications\");\n\nexport interface UseNotificationsReturn {\n readonly notifications: ComputedRef<PushNotification[]>;\n readonly moduleNotifications: ComputedRef<PushNotification[]>;\n loadFromHistory(take?: number): Promise<void>;\n addNotification(message: PushNotification): void;\n markAsRead(message: PushNotification): void;\n markAllAsRead(): void;\n setNotificationHandler(handler: (notification: PushNotification) => void): void;\n}\n\n/** @deprecated Use UseNotificationsReturn instead */\nexport type INotifications = UseNotificationsReturn;\n\n/**\n * @deprecated Use `useBladeNotifications()` for blade-level subscriptions\n * or `useNotificationStore()` for direct store access.\n */\nexport function useNotifications(notifyType?: string | string[]): UseNotificationsReturn {\n if (import.meta.env.DEV) {\n logger.warn(\n \"[vc-shell] useNotifications() is deprecated. Use useBladeNotifications() instead. \" +\n \"See: MIGRATION_GUIDE.md#notifications\",\n );\n }\n\n const store = useNotificationStore();\n const types = notifyType ? (Array.isArray(notifyType) ? notifyType : [notifyType]) : [];\n\n let handler: ((msg: PushNotification) => void) | undefined;\n\n // Subscribe if types provided\n let unsub: (() => void) | undefined;\n if (types.length) {\n unsub = store.subscribe({\n types,\n handler: (msg) => handler?.(msg),\n });\n\n if (getCurrentScope()) {\n onScopeDispose(() => unsub?.());\n }\n }\n\n const moduleNotifications = computed(() => {\n if (!types.length) return [];\n return store.realtime.value.filter(\n (item) => item.isNew && item.notifyType != null && types.includes(item.notifyType),\n );\n });\n\n return {\n notifications: computed(() => orderBy(store.history.value, [\"created\"], [\"desc\"])),\n moduleNotifications,\n loadFromHistory: store.loadHistory,\n addNotification: store.ingest,\n markAsRead: store.markAsRead,\n markAllAsRead: store.markAllAsRead,\n setNotificationHandler: (fn) => {\n handler = fn;\n },\n };\n}\n","import { readonly, ref, type Ref, type DeepReadonly } from \"vue\";\nimport { HasLoading } from \"@core/composables/useLoading\";\nimport { parseError, DisplayableError } from \"@core/utilities/error\";\nimport { setPendingErrorNotification } from \"@core/utilities/pendingErrorNotifications\";\nimport { isSessionExpired } from \"@core/utilities/sessionExpiration\";\nimport { createLogger } from \"@core/utilities\";\n\n// Lazy-resolved reference to the notification singleton.\n// We avoid a top-level import of `@core/notifications/notification`\n// because that module may transitively pull in UI components (@ui/components) which\n// import from @core/composables — creating a circular dependency at module load time.\nlet _notification: typeof import(\"@core/notifications/notification\").notification | undefined;\n\nconst logger = createLogger(\"use-async\");\n\nexport type AsyncAction<Payload = void, Result = void> = (payload?: Payload, ...rest: any[]) => Promise<Result>;\n\nexport interface UseAsyncOptions {\n /**\n * Show error notification on failure. Default: true.\n *\n * Notifications are deferred via setTimeout(0) so that ErrorInterceptor\n * can cancel them when it catches the same error for blade banner display.\n * This prevents duplicate toast+banner for load errors while still\n * showing toasts for save/delete errors caught by module try/catch.\n */\n notify?: boolean;\n /** Notification timeout in ms. Default: 8000 */\n notifyTimeout?: number;\n}\n\nexport interface UseAsyncReturn<Payload = void, Result = void> extends HasLoading {\n action: AsyncAction<Payload, Result>;\n /** Reactive error state — set on failure, cleared on next invocation */\n error: DeepReadonly<Ref<DisplayableError | null>>;\n}\n\n/** @deprecated Use UseAsyncReturn instead */\nexport type UseAsync<Payload = void, Result = void> = UseAsyncReturn<Payload, Result>;\n\nexport function useAsync<Payload = void, Result = void>(\n innerAction: AsyncAction<Payload, Result>,\n options?: UseAsyncOptions,\n): UseAsyncReturn<Payload, Result> {\n const loading = ref(false);\n const error = ref<DisplayableError | null>(null);\n\n const shouldNotify = options?.notify !== false;\n const notifyTimeout = options?.notifyTimeout ?? 8000;\n\n async function action(payload?: Payload, ...rest: any[]): Promise<Result> {\n loading.value = true;\n error.value = null;\n\n try {\n return await innerAction(payload, ...rest);\n } catch (e) {\n const parsed = parseError(e);\n error.value = parsed;\n logger.error(\"Async action failed:\", e);\n\n // While the session is expired the app is redirecting to login — suppress the\n // toast so the user isn't buried under load errors from the abandoned page.\n if (shouldNotify && !isSessionExpired() && e && typeof e === \"object\") {\n const notifId = `async-error-${parsed.message.slice(0, 80)}`;\n\n // Defer notification so ErrorInterceptor can cancel it\n // when onErrorCaptured fires (synchronously, before setTimeout(0) callback)\n const timerId = setTimeout(async () => {\n if (!_notification) {\n const mod = await import(\"@core/notifications/notification\");\n _notification = mod.notification;\n }\n _notification.error(parsed.message, {\n timeout: notifyTimeout,\n notificationId: notifId,\n });\n }, 0);\n\n setPendingErrorNotification(e, timerId, notifId);\n }\n\n throw e;\n } finally {\n loading.value = false;\n }\n }\n\n return {\n loading: readonly(loading),\n error: readonly(error),\n action,\n };\n}\n","export interface IAuthApiBase {\r\n authToken: string;\r\n setAuthToken(token: string): void;\r\n getBaseUrl(defaultUrl: string, baseUrl: string): string;\r\n}\r\n\r\nexport interface UseApiClientReturn<ApiClient extends IAuthApiBase> {\r\n getApiClient: () => Promise<ApiClient>;\r\n}\r\n\r\n/** @deprecated Use UseApiClientReturn instead */\r\nexport type UseApiClient<ApiClient extends IAuthApiBase> = UseApiClientReturn<ApiClient>;\r\n\r\nexport function useApiClient<ApiClient extends IAuthApiBase>(\r\n c: new (baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise<Response> }) => ApiClient,\r\n): UseApiClientReturn<ApiClient> {\r\n async function getApiClient() {\r\n const client = new c();\r\n return client;\r\n }\r\n\r\n return {\r\n getApiClient,\r\n };\r\n}\r\n","import { computed, ComputedRef, Ref } from \"vue\";\r\n\r\nexport interface HasLoading {\r\n loading: Readonly<Ref<boolean>>;\r\n}\r\n\r\nexport type UseLoadingReturn = ComputedRef<boolean>;\r\n\r\nexport function useLoading(...args: Readonly<Ref<boolean>>[]): UseLoadingReturn {\r\n return computed(() => args.some((item) => item.value));\r\n}\r\n","import { useAsync } from \"@core/composables/useAsync\";\nimport { useApiClient } from \"@core/composables/useApiClient\";\nimport { computed, Ref, ref, ComputedRef, onMounted } from \"vue\";\nimport { SettingClient } from \"@core/api/platform\";\nimport { useLoading } from \"@core/composables/useLoading\";\nimport { createLogger } from \"@core/utilities\";\n\nconst logger = createLogger(\"use-settings\");\n\ninterface IUISetting {\n contrast_logo?: string;\n logo?: string;\n title?: string;\n avatar?: string;\n role?: string;\n}\n\nexport interface UseSettingsReturn {\n readonly uiSettings: Ref<IUISetting>;\n readonly loading: ComputedRef<boolean>;\n applySettings: (args: { logo?: string; title?: string; avatar?: string; role?: string }) => void;\n}\n\n/** @deprecated Use UseSettingsReturn instead */\nexport type IUseSettings = UseSettingsReturn;\n\nexport function useSettings(): UseSettingsReturn {\n const uiSettings = ref<IUISetting | undefined>();\n const customSettingsApplied = ref(false);\n\n const { getApiClient } = useApiClient(SettingClient);\n\n const { loading, action: getUiCustomizationSettings } = useAsync(async () => {\n if (customSettingsApplied.value) return;\n\n const result = await (await getApiClient()).getUICustomizationSetting();\n\n // defaultValue can be empty or malformed JSON — JSON.parse would throw and\n // reject the whole action, so guard it and treat unparseable settings as absent.\n let settings: IUISetting | null = null;\n if (result.defaultValue) {\n try {\n settings = JSON.parse(result.defaultValue);\n } catch (e) {\n logger.warn(\"Failed to parse UI customization settings JSON; ignoring.\", e);\n }\n }\n\n if (settings && !uiSettings.value) {\n uiSettings.value = {\n contrast_logo: settings.contrast_logo,\n logo: settings.logo,\n title: settings.title,\n };\n }\n });\n\n function applySettings(args: { logo?: string; title?: string; avatar?: string; role?: string }) {\n customSettingsApplied.value = true;\n uiSettings.value = {\n ...uiSettings.value,\n logo: args.logo,\n title: args.title,\n avatar: args.avatar,\n role: args.role,\n };\n }\n\n onMounted(async () => {\n if (!uiSettings.value && !customSettingsApplied.value) {\n await getUiCustomizationSettings();\n }\n });\n\n return {\n uiSettings: computed(() => uiSettings.value ?? {}),\n applySettings,\n loading: useLoading(loading),\n };\n}\n","import { getCurrentScope, onScopeDispose, readonly, ref, type Ref } from \"vue\";\n\nexport interface LatestRequest {\n /** False once a newer request started, or once the tracker was invalidated or disposed. */\n isCurrent(): boolean;\n /** Marks this request finished. Idempotent; only the current request clears `pending`. */\n complete(): void;\n}\n\nexport interface UseLatestRequestReturn {\n /** Starts a request and supersedes any earlier one. */\n begin(): LatestRequest;\n /** Supersedes the in-flight request without starting a new one — e.g. on selection change. */\n invalidate(): void;\n /** Permanently supersedes everything. Called automatically when the owning scope stops. */\n dispose(): void;\n /** True while the newest request is still running. */\n pending: Readonly<Ref<boolean>>;\n}\n\n/**\n * Latest-wins sequencing: lets a caller drop a response that a newer request\n * already superseded.\n *\n * ```ts\n * const search = useLatestRequest();\n *\n * async function load(criteria) {\n * const request = search.begin();\n * try {\n * const result = await api.search(criteria);\n * if (!request.isCurrent()) return; // a newer search won\n * items.value = result;\n * } finally {\n * request.complete();\n * }\n * }\n * ```\n *\n * This discards the late result rather than cancelling the request: the\n * generated API clients build their own `RequestInit` and take no `AbortSignal`,\n * so there is nothing to cancel through. Aborting would additionally save the\n * round trip and belongs with a client that accepts a signal.\n */\nexport function useLatestRequest(): UseLatestRequestReturn {\n const pending = ref(false);\n let sequence = 0;\n let disposed = false;\n\n function begin(): LatestRequest {\n const requestId = ++sequence;\n let completed = false;\n\n if (!disposed) pending.value = true;\n\n return {\n isCurrent: () => !disposed && requestId === sequence,\n complete: () => {\n if (completed) return;\n completed = true;\n\n // A superseded request finishing must not clear `pending` — the newer\n // one is still running and the screen is still waiting for its data.\n if (!disposed && requestId === sequence) pending.value = false;\n },\n };\n }\n\n function invalidate(): void {\n sequence++;\n pending.value = false;\n }\n\n function dispose(): void {\n disposed = true;\n invalidate();\n }\n\n // A response landing after its blade closed must not write into a dead scope.\n if (getCurrentScope()) onScopeDispose(dispose);\n\n return {\n begin,\n invalidate,\n dispose,\n pending: readonly(pending),\n };\n}\n","import { computed, ref, ComputedRef } from \"vue\";\nimport * as _ from \"lodash-es\";\nimport type { ICommonAsset } from \"@core/types\";\nimport { createLogger } from \"@core/utilities\";\n\nconst logger = createLogger(\"use-assets\");\n\n/** Maximum number of concurrent uploads */\nconst MAX_CONCURRENT_UPLOADS = 4;\n\nexport interface UseAssetsReturn {\n upload: (files: FileList, uploadPath: string, startingSortOrder?: number) => Promise<ICommonAsset[]>;\n remove: (filesToDelete: ICommonAsset[], initialAssetArr: ICommonAsset[]) => ICommonAsset[];\n edit: (updatedFiles: ICommonAsset[], initialAssetArr: ICommonAsset[]) => ICommonAsset[];\n loading: ComputedRef<boolean>;\n}\n\n/** @deprecated Use UseAssetsReturn instead */\nexport type IUseAssets = UseAssetsReturn;\n\n/**\n * Uploads a single file and returns the asset\n */\nasync function uploadSingleFile(\n file: File,\n uploadPath: string,\n index: number,\n startingSortOrder?: number,\n): Promise<ICommonAsset | null> {\n const formData = new FormData();\n formData.append(\"file\", file);\n\n const result = await fetch(`/api/assets?folderUrl=/${uploadPath}`, {\n method: \"POST\",\n body: formData,\n });\n\n const response = await result.json();\n\n if (response?.length) {\n const uploadedFile = response[0];\n uploadedFile.createdDate = new Date();\n uploadedFile.sortOrder =\n startingSortOrder !== undefined && startingSortOrder >= 0 ? startingSortOrder + index + 1 : 0;\n uploadedFile.url = uploadedFile.url ? decodeURI(uploadedFile.url) : \"\";\n\n if (\"size\" in uploadedFile) {\n uploadedFile.size = file.size;\n }\n\n return uploadedFile;\n }\n\n return null;\n}\n\n/**\n * Processes items in batches with concurrency limit\n */\nasync function processBatched<T, R>(\n items: T[],\n processor: (item: T, index: number) => Promise<R>,\n concurrency: number,\n): Promise<R[]> {\n const results: R[] = [];\n\n for (let i = 0; i < items.length; i += concurrency) {\n const batch = items.slice(i, i + concurrency);\n const batchResults = await Promise.all(batch.map((item, batchIndex) => processor(item, i + batchIndex)));\n results.push(...batchResults);\n }\n\n return results;\n}\n\nexport function useAssets(): UseAssetsReturn {\n const loading = ref(false);\n\n if (import.meta.env?.DEV) {\n console.warn(\n \"[useAssets] is deprecated. Use useAssetsManager(ref, options) instead. \" + \"See migration guide #32.\",\n );\n }\n\n async function upload(files: FileList, uploadPath: string, startingSortOrder?: number): Promise<ICommonAsset[]> {\n try {\n loading.value = true;\n\n const fileArray = Array.from(files);\n\n // Upload files in parallel batches\n const uploadResults = await processBatched(\n fileArray,\n (file, index) => uploadSingleFile(file, uploadPath, index, startingSortOrder),\n MAX_CONCURRENT_UPLOADS,\n );\n\n // Filter out null results and return successful uploads\n return uploadResults.filter((asset): asset is ICommonAsset => asset !== null);\n } catch (error) {\n logger.error(\"Upload failed:\", error);\n throw error;\n } finally {\n loading.value = false;\n }\n }\n\n function remove(filesToDelete: ICommonAsset[], initialAssetArr: ICommonAsset[], assetKey = \"url\"): ICommonAsset[] {\n try {\n loading.value = true;\n\n let updatedAssetArr = _.cloneDeep(initialAssetArr) || [];\n\n if (updatedAssetArr && updatedAssetArr.length && filesToDelete.length > 0) {\n updatedAssetArr = _.differenceWith(updatedAssetArr, filesToDelete, (x, y) => x[assetKey] === y[assetKey]);\n }\n\n return updatedAssetArr;\n } catch (error) {\n logger.error(\"Remove failed:\", error);\n throw error;\n } finally {\n loading.value = false;\n }\n }\n\n function edit(updatedFiles: ICommonAsset[], initialAssetArr: ICommonAsset[]): ICommonAsset[] {\n // When all items are passed (e.g. reorder), preserve the order of updatedFiles.\n // When a subset is passed (e.g. single asset edit), update in place within initial order.\n if (updatedFiles.length === initialAssetArr.length) {\n return updatedFiles.map((file) => ({ ...file }));\n }\n\n const updatedAssetArr = _.cloneDeep(initialAssetArr) || [];\n\n if (updatedAssetArr && updatedAssetArr.length) {\n updatedFiles.forEach((updatedFile) => {\n const index = updatedAssetArr.findIndex((asset) => asset.url === updatedFile.url);\n if (index !== -1) {\n updatedAssetArr[index] = { ...updatedAssetArr[index], ...updatedFile };\n }\n });\n }\n\n return updatedAssetArr;\n }\n\n return {\n upload,\n remove,\n edit,\n loading: computed(() => loading.value),\n };\n}\n","import { computed, ref, watch, Ref, ComputedRef } from \"vue\";\nimport { createLogger } from \"@core/utilities\";\n\nconst logger = createLogger(\"use-assets-manager\");\n\nexport interface AssetLike {\n url?: string;\n name?: string;\n sortOrder?: number;\n [key: string]: any;\n}\n\nexport interface UseAssetsManagerOptions {\n uploadPath: () => string;\n confirmRemove?: () => Promise<boolean> | boolean;\n assetKey?: string;\n concurrency?: number;\n}\n\nexport interface UseAssetsManagerReturn {\n items: Ref<AssetLike[]>;\n upload: (files: FileList, startingSortOrder?: number) => Promise<void>;\n remove: (item: AssetLike) => Promise<void>;\n removeMany: (items: AssetLike[]) => Promise<void>;\n reorder: (items: AssetLike[]) => void;\n updateItem: (item: AssetLike) => void;\n loading: ComputedRef<boolean>;\n}\n\n/** Default concurrency for parallel uploads */\nconst DEFAULT_CONCURRENCY = 4;\n\n/**\n * Uploads a single file and returns the asset\n */\nasync function uploadSingleFile(\n file: File,\n uploadPath: string,\n index: number,\n startingSortOrder?: number,\n): Promise<AssetLike | null> {\n const formData = new FormData();\n formData.append(\"file\", file);\n\n const normalizedPath = uploadPath.startsWith(\"/\") ? uploadPath.slice(1) : uploadPath;\n const result = await fetch(`/api/assets?folderUrl=/${normalizedPath}`, {\n method: \"POST\",\n body: formData,\n });\n\n const response = await result.json();\n\n if (response?.length) {\n const uploadedFile = response[0];\n uploadedFile.createdDate = new Date();\n uploadedFile.sortOrder =\n startingSortOrder !== undefined && startingSortOrder >= 0 ? startingSortOrder + index + 1 : 0;\n uploadedFile.url = uploadedFile.url ? decodeURI(uploadedFile.url) : \"\";\n\n if (\"size\" in uploadedFile) {\n uploadedFile.size = file.size;\n }\n\n return uploadedFile;\n }\n\n return null;\n}\n\n/**\n * Processes items in batches with concurrency limit\n */\nasync function processBatched<T, R>(\n items: T[],\n processor: (item: T, index: number) => Promise<R>,\n concurrency: number,\n): Promise<R[]> {\n const results: R[] = [];\n\n for (let i = 0; i < items.length; i += concurrency) {\n const batch = items.slice(i, i + concurrency);\n const batchResults = await Promise.all(batch.map((item, batchIndex) => processor(item, i + batchIndex)));\n results.push(...batchResults);\n }\n\n return results;\n}\n\n/**\n * Normalizes a list's `sortOrder`: orders items by their current `sortOrder`\n * (items without one are kept stable at the end) and reassigns a clean\n * sequential `sortOrder` (0..n). Guarantees every item has a `sortOrder` on\n * load — the source may arrive without it. Idempotent: normalizing an\n * already-normalized list yields the same order and values.\n */\nfunction normalizeSortOrder(list: AssetLike[]): AssetLike[] {\n return list\n .map((item, index) => ({ item, index }))\n .sort((a, b) => {\n const ao = a.item.sortOrder ?? Number.MAX_SAFE_INTEGER;\n const bo = b.item.sortOrder ?? Number.MAX_SAFE_INTEGER;\n return ao === bo ? a.index - b.index : ao - bo;\n })\n .map(({ item }, index) => ({ ...item, sortOrder: index }));\n}\n\nexport function useAssetsManager(\n source: Ref<AssetLike[] | undefined | null>,\n options: UseAssetsManagerOptions,\n): UseAssetsManagerReturn {\n const _loading = ref(false);\n\n // Internal ref owns the data. Synced from source via watch,\n // written back to source after every mutation.\n // This avoids reactivity issues when source is a WritableComputed\n // wrapping deeply nested properties (e.g. item.value.productData.assets).\n const _items = ref<AssetLike[]>(normalizeSortOrder(source.value ?? []));\n\n // Sync: source → internal (e.g. when parent reloads data). Normalize sortOrder\n // on the way in so items always carry a clean sequential sortOrder, even when\n // the source provides them without one. Idempotent, so it does not loop on the\n // writeback that mutations perform via _sync().\n watch(\n () => source.value,\n (newVal) => {\n _items.value = normalizeSortOrder(newVal ?? []);\n },\n { deep: true, immediate: true },\n );\n\n /** Write internal state back to source */\n function _sync() {\n source.value = _items.value;\n }\n\n const items: Ref<AssetLike[]> = _items;\n const loading = computed(() => _loading.value);\n\n const concurrency = options.concurrency ?? DEFAULT_CONCURRENCY;\n const assetKey = options.assetKey ?? \"url\";\n\n async function upload(files: FileList, startingSortOrder?: number): Promise<void> {\n try {\n _loading.value = true;\n\n const fileArray = Array.from(files);\n const uploadPath = options.uploadPath();\n\n const uploadResults = await processBatched(\n fileArray,\n (file, index) => uploadSingleFile(file, uploadPath, index, startingSortOrder),\n concurrency,\n );\n\n const successfulUploads = uploadResults.filter((asset): asset is AssetLike => asset !== null);\n _items.value = [..._items.value, ...successfulUploads];\n _sync();\n } catch (error) {\n logger.error(\"Upload failed:\", error);\n throw error;\n } finally {\n _loading.value = false;\n }\n }\n\n async function remove(item: AssetLike): Promise<void> {\n await removeMany([item]);\n }\n\n async function removeMany(itemsToRemove: AssetLike[]): Promise<void> {\n if (options.confirmRemove) {\n const confirmed = await options.confirmRemove();\n if (!confirmed) return;\n }\n\n const keysToRemove = new Set(itemsToRemove.map((i) => i[assetKey]));\n _items.value = _items.value.filter((i) => !keysToRemove.has(i[assetKey]));\n _sync();\n }\n\n function reorder(newOrder: AssetLike[]): void {\n _items.value = newOrder.map((item) => ({ ...item }));\n _sync();\n }\n\n function updateItem(item: AssetLike): void {\n const index = _items.value.findIndex((existing) => existing[assetKey] === item[assetKey]);\n if (index !== -1) {\n const updated = [..._items.value];\n updated[index] = { ..._items.value[index], ...item };\n _items.value = updated;\n _sync();\n }\n }\n\n return {\n items,\n upload,\n remove,\n removeMany,\n reorder,\n updateItem,\n loading,\n };\n}\n","import { onBeforeMount, onBeforeUnmount, unref, ComputedRef } from \"vue\";\r\n\r\nexport interface UseBeforeUnloadReturn {\r\n modified: ComputedRef<boolean>;\r\n}\r\n\r\n/**\r\n * Prevents the user from closing the tab if the modified flag is set to true.\r\n * @param modified - The flag that indicates whether the user has made changes.\r\n * @returns The modified flag.\r\n */\r\nexport const useBeforeUnload = (modified: ComputedRef<boolean>): UseBeforeUnloadReturn => {\r\n onBeforeMount(() => {\r\n window.addEventListener(\"beforeunload\", preventUnload);\r\n });\r\n\r\n onBeforeUnmount(() => {\r\n window.removeEventListener(\"beforeunload\", preventUnload);\r\n });\r\n\r\n function preventUnload(event: Event) {\r\n if (!unref(modified)) return;\r\n event.preventDefault();\r\n }\r\n\r\n return {\r\n modified,\r\n };\r\n};\r\n","import type { IBaseProperty, IBasePropertyValue } from \"./types\";\n\nexport function isEmptyValue(value: unknown): boolean {\n if (value === undefined || value === null) return true;\n if (typeof value === \"number\" && isNaN(value)) return true;\n if (typeof value === \"string\" && value.trim().length === 0) return true;\n if (typeof value === \"object\" && Object.keys(value).length === 0) return true;\n return false;\n}\n\nexport function isMultilanguageProperty(property: IBaseProperty): boolean {\n return Boolean(property.multilanguage);\n}\n\nexport function isMultivalueProperty(property: IBaseProperty): boolean {\n return Boolean(property.multivalue);\n}\n\nexport function isDictionaryProperty(property: IBaseProperty): boolean {\n return Boolean(property.dictionary);\n}\n\nexport function isMeasureProperty(property: IBaseProperty): boolean {\n return property.valueType === \"Measure\";\n}\n\nexport function isColorProperty(property: IBaseProperty): boolean {\n return property.valueType === \"Color\";\n}\n\nexport function createValue(params: Partial<IBasePropertyValue>): IBasePropertyValue {\n return { isInherited: false, ...params };\n}\n\nexport function cleanEmptyValues(property: IBaseProperty, locale?: string): void {\n if (!property.values) return;\n\n if (isMultilanguageProperty(property) && locale) {\n property.values = property.values.filter((v) => v.languageCode !== locale);\n } else {\n property.values = [];\n }\n\n if (property.values.length > 0 && property.values.every((v) => isEmptyValue(v.value))) {\n property.values = [];\n }\n}\n","import type { IBaseProperty, IBasePropertyValue, PropertyDisplayValue } from \"../types\";\nimport type { PropertyValueStrategy, PropertyInputValue, SetContext } from \"./types\";\nimport { isEmptyValue, isMultilanguageProperty, isMultivalueProperty, createValue, cleanEmptyValues } from \"../utils\";\n\nexport const regularStrategy: PropertyValueStrategy = {\n get(property: IBaseProperty, locale: string): PropertyDisplayValue {\n if (isMultilanguageProperty(property)) {\n if (isMultivalueProperty(property)) {\n return (property.values?.filter((v) => v.languageCode === locale) ?? []) as IBasePropertyValue[];\n }\n // Find by locale first, then fallback to value without languageCode\n const val =\n property.values?.find((v) => v.languageCode === locale) ?? property.values?.find((v) => !v.languageCode);\n return (val?.value as string) ?? \"\";\n }\n\n if (isMultivalueProperty(property)) {\n return (property.values ?? []) as IBasePropertyValue[];\n }\n\n return (property.values?.[0]?.value as string) ?? \"\";\n },\n\n set(property: IBaseProperty, value: PropertyInputValue, context: SetContext): void {\n if (!Array.isArray(value) && isEmptyValue(value)) {\n cleanEmptyValues(property, context.locale);\n return;\n }\n\n if (isMultilanguageProperty(property)) {\n if (Array.isArray(value)) {\n const otherLocales = property.values?.filter((v) => v.languageCode !== context.locale) ?? [];\n const newValues = (value as IBasePropertyValue[]).map((item) =>\n createValue({ ...item, languageCode: context.locale }),\n );\n property.values = [...otherLocales, ...newValues];\n } else {\n const existing = property.values?.find((v) => v.languageCode === context.locale);\n if (existing) {\n existing.value = value as string;\n } else {\n if (!property.values) property.values = [];\n property.values.push(createValue({ value: value as string, languageCode: context.locale }));\n }\n }\n return;\n }\n\n if (Array.isArray(value)) {\n property.values = (value as IBasePropertyValue[]).map((item) => createValue(item));\n return;\n }\n\n if (property.values?.[0]) {\n Object.assign(property.values[0], { value });\n } else {\n property.values = [createValue({ value: value as string })];\n }\n },\n};\n","import type { IBaseProperty, PropertyDisplayValue } from \"../types\";\nimport type { PropertyValueStrategy, PropertyInputValue, SetContext } from \"./types\";\nimport { isMultilanguageProperty, createValue } from \"../utils\";\n\nexport const booleanStrategy: PropertyValueStrategy = {\n get(property: IBaseProperty, locale: string): PropertyDisplayValue {\n if (isMultilanguageProperty(property)) {\n const val =\n property.values?.find((v) => v.languageCode === locale) ?? property.values?.find((v) => !v.languageCode);\n return val?.value ?? false;\n }\n return property.values?.[0]?.value ?? false;\n },\n\n set(property: IBaseProperty, value: PropertyInputValue, _context: SetContext): void {\n if (property.values?.[0]) {\n Object.assign(property.values[0], { value });\n } else {\n property.values = [createValue({ value })];\n }\n },\n};\n","import type { IBaseProperty, IBasePropertyValue, IBasePropertyDictionaryItem, PropertyDisplayValue } from \"../types\";\nimport type { PropertyValueStrategy, PropertyInputValue, SetContext } from \"./types\";\nimport { isEmptyValue, isMultilanguageProperty, isMultivalueProperty, createValue, cleanEmptyValues } from \"../utils\";\n\nexport const dictionaryStrategy: PropertyValueStrategy = {\n get(property: IBaseProperty, locale: string): PropertyDisplayValue {\n if (isMultilanguageProperty(property)) {\n if (isMultivalueProperty(property)) {\n return (property.values?.filter((v) => v.languageCode === locale) ?? []) as IBasePropertyValue[];\n }\n // Find by locale first, then fallback to value without languageCode\n const val =\n property.values?.find((v) => v.languageCode === locale) ?? property.values?.find((v) => !v.languageCode);\n return (val?.valueId as string) ?? \"\";\n }\n\n if (isMultivalueProperty(property)) {\n return (property.values ?? []) as IBasePropertyValue[];\n }\n\n return (property.values?.[0]?.valueId as string) ?? \"\";\n },\n\n set(property: IBaseProperty, value: PropertyInputValue, context: SetContext): void {\n const { dictionary, locale } = context;\n\n // Empty value → clean up regardless of dictionary presence\n if (!Array.isArray(value) && isEmptyValue(value)) {\n cleanEmptyValues(property, locale);\n return;\n }\n\n if (!dictionary?.length) return;\n\n if (isMultilanguageProperty(property)) {\n setMultilanguageDictionary(property, value, dictionary, locale);\n } else {\n setSingleLanguageDictionary(property, value, dictionary);\n }\n },\n};\n\nfunction setMultilanguageDictionary(\n property: IBaseProperty,\n value: PropertyInputValue,\n dictionary: IBasePropertyDictionaryItem[],\n locale?: string,\n): void {\n if (Array.isArray(value)) {\n setMultilanguageMultivalueDictionary(\n property,\n value as (IBasePropertyDictionaryItem & { value: string })[],\n dictionary,\n );\n } else {\n setMultilanguageSingleValueDictionary(property, value as string, dictionary, locale);\n }\n}\n\nfunction setMultilanguageMultivalueDictionary(\n property: IBaseProperty,\n values: (IBasePropertyDictionaryItem & { value: string })[],\n dictionary: IBasePropertyDictionaryItem[],\n): void {\n property.values = values.flatMap((item) => {\n const dictItem = dictionary.find(\n (x) => x.id === (item as unknown as IBasePropertyValue).valueId || x.id === item.id,\n );\n\n if (dictItem?.localizedValues?.length) {\n return dictItem.localizedValues.map((locValue) =>\n createValue({\n propertyId: dictItem.propertyId,\n alias: dictItem.alias,\n languageCode: locValue.languageCode,\n value: locValue.value ?? dictItem.alias,\n valueId: dictItem.id,\n colorCode: dictItem.colorCode,\n }),\n );\n }\n\n return createValue(item as unknown as Partial<IBasePropertyValue>);\n });\n}\n\nfunction setMultilanguageSingleValueDictionary(\n property: IBaseProperty,\n value: string,\n dictionary: IBasePropertyDictionaryItem[],\n locale?: string,\n): void {\n const dictionaryItem = dictionary.find((x) => x.id === value);\n\n if (!dictionaryItem) {\n property.values = [];\n return;\n }\n\n if (dictionaryItem.localizedValues?.length) {\n property.values = dictionaryItem.localizedValues.map((locValue) =>\n createValue({\n propertyId: dictionaryItem.propertyId,\n alias: dictionaryItem.alias,\n languageCode: locValue.languageCode,\n value: locValue.value ?? dictionaryItem.alias,\n valueId: dictionaryItem.id,\n colorCode: dictionaryItem.colorCode,\n }),\n );\n } else {\n const existingLanguageCodes = [...new Set((property.values ?? []).map((v) => v.languageCode).filter(Boolean))];\n const languageCodes = existingLanguageCodes.length > 0 ? existingLanguageCodes : locale ? [locale] : [];\n\n property.values = languageCodes.map((langCode) =>\n createValue({\n propertyId: dictionaryItem.propertyId,\n alias: dictionaryItem.alias,\n languageCode: langCode,\n value: dictionaryItem.alias,\n valueId: dictionaryItem.id,\n colorCode: dictionaryItem.colorCode,\n }),\n );\n }\n}\n\nfunction setSingleLanguageDictionary(\n property: IBaseProperty,\n value: PropertyInputValue,\n dictionary: IBasePropertyDictionaryItem[],\n): void {\n if (Array.isArray(value)) {\n property.values = (value as (IBasePropertyDictionaryItem & { value: string })[]).flatMap((item) => {\n const dictItem = dictionary.find(\n (x) => x.id === (item as unknown as IBasePropertyValue).valueId || x.id === item.id,\n );\n\n if (dictItem) {\n return createValue({\n propertyId: dictItem.propertyId,\n alias: dictItem.alias,\n value: item.value ?? dictItem.alias,\n valueId: dictItem.id,\n colorCode: dictItem.colorCode,\n });\n }\n\n return createValue(item as unknown as Partial<IBasePropertyValue>);\n });\n } else {\n if (isEmptyValue(value)) {\n property.values = [];\n return;\n }\n\n const dictionaryItem = dictionary.find((x) => x.id === value);\n property.values = [\n createValue({\n propertyId: dictionaryItem?.propertyId,\n alias: dictionaryItem?.alias,\n value: (dictionaryItem as IBasePropertyDictionaryItem & { value: string })?.value ?? dictionaryItem?.alias,\n valueId: value as string,\n colorCode: dictionaryItem?.colorCode,\n }),\n ];\n }\n}\n","import type { IBaseProperty, PropertyDisplayValue } from \"../types\";\nimport type { PropertyValueStrategy, PropertyInputValue, SetContext } from \"./types\";\nimport { isEmptyValue, createValue, cleanEmptyValues } from \"../utils\";\n\nexport const measureStrategy: PropertyValueStrategy = {\n get(property: IBaseProperty, _locale: string): PropertyDisplayValue {\n return (property.values?.[0]?.value as string) ?? \"\";\n },\n\n set(property: IBaseProperty, value: PropertyInputValue, context: SetContext): void {\n if (isEmptyValue(value)) {\n cleanEmptyValues(property);\n return;\n }\n property.values = [createValue({ value, unitOfMeasureId: context.unitOfMeasureId })];\n },\n};\n","import type { IBaseProperty, IBasePropertyValue, PropertyDisplayValue } from \"../types\";\nimport type { PropertyValueStrategy, PropertyInputValue, SetContext } from \"./types\";\nimport { isEmptyValue, isMultivalueProperty, createValue, cleanEmptyValues } from \"../utils\";\n\nexport const colorStrategy: PropertyValueStrategy = {\n get(property: IBaseProperty, _locale: string): PropertyDisplayValue {\n if (isMultivalueProperty(property)) {\n return (property.values ?? []) as IBasePropertyValue[];\n }\n return (property.values?.[0]?.value as string) ?? \"\";\n },\n\n set(property: IBaseProperty, value: PropertyInputValue, context: SetContext): void {\n if (!Array.isArray(value) && isEmptyValue(value)) {\n cleanEmptyValues(property);\n return;\n }\n\n if (Array.isArray(value)) {\n property.values = (value as IBasePropertyValue[]).map((item) =>\n createValue({ ...item, value: item.value, colorCode: item.colorCode }),\n );\n } else {\n property.values = [createValue({ value, colorCode: context.colorCode })];\n }\n },\n};\n","import type { IBaseProperty } from \"../types\";\nimport type { PropertyValueStrategy } from \"./types\";\nimport { isMeasureProperty, isColorProperty, isDictionaryProperty } from \"../utils\";\nimport { regularStrategy } from \"./regular\";\nimport { booleanStrategy } from \"./boolean\";\nimport { dictionaryStrategy } from \"./dictionary\";\nimport { measureStrategy } from \"./measure\";\nimport { colorStrategy } from \"./color\";\n\nexport function resolveStrategy(property: IBaseProperty): PropertyValueStrategy {\n if (isMeasureProperty(property)) return measureStrategy;\n if (isColorProperty(property) && !isDictionaryProperty(property)) return colorStrategy;\n if (property.valueType === \"Boolean\") return booleanStrategy;\n if (isDictionaryProperty(property)) return dictionaryStrategy;\n return regularStrategy;\n}\n","import { useLoading } from \"@core/composables/useLoading\";\nimport { useAsync } from \"@core/composables/useAsync\";\nimport { resolveStrategy } from \"./strategies\";\nimport type {\n DynamicPropertiesOptions,\n UseDynamicPropertiesReturn,\n SetPropertyValueParams,\n IBaseProperty,\n IBasePropertyDictionaryItem,\n IBasePropertyDictionaryItemSearchCriteria,\n PropertyDisplayValue,\n} from \"./types\";\n\n// Re-export all types for backward compatibility\nexport * from \"./types\";\n\nexport function useDynamicProperties(options: DynamicPropertiesOptions): UseDynamicPropertiesReturn {\n const { searchDictionary, searchMeasurements } = options;\n\n const { loading: dictionaryItemsLoading, action: searchDictionaryItems } = useAsync<\n IBasePropertyDictionaryItemSearchCriteria,\n IBasePropertyDictionaryItem[] | undefined\n >(async (args) => {\n if (!args) return undefined;\n return await searchDictionary(args);\n });\n\n async function loadDictionaries(\n propertyId: string,\n keyword?: string,\n locale?: string,\n ): Promise<IBasePropertyDictionaryItem[] | undefined> {\n if (!propertyId) return undefined;\n\n const items = await searchDictionaryItems({\n propertyIds: [propertyId],\n keyword,\n skip: 0,\n });\n\n if (!locale || !items) return items;\n\n return items.map((item) => {\n const localizedValue = item.localizedValues?.find((loc) => loc.languageCode === locale)?.value;\n return { ...item, value: localizedValue ?? item.alias } as IBasePropertyDictionaryItem;\n });\n }\n\n async function loadMeasurements(measureId: string, _keyword?: string, locale?: string) {\n if (!measureId || !searchMeasurements) return undefined;\n return await searchMeasurements(measureId, locale);\n }\n\n function getPropertyValue(property: IBaseProperty, locale: string): PropertyDisplayValue {\n return resolveStrategy(property).get(property, locale);\n }\n\n function setPropertyValue(params: SetPropertyValueParams): void {\n const { property, value, ...context } = params;\n resolveStrategy(property).set(property, value, context);\n }\n\n return {\n getPropertyValue,\n setPropertyValue,\n loadDictionaries,\n loadMeasurements,\n loading: useLoading(dictionaryItemsLoading),\n };\n}\n","import { onFCP, onLCP, onCLS, onINP, onTTFB } from \"web-vitals\";\r\nimport type { Metric } from \"web-vitals\";\r\n\r\nexport interface IWebVitalsMetric {\r\n name: string;\r\n value: number;\r\n rating: \"good\" | \"needs-improvement\" | \"poor\";\r\n}\r\n\r\nexport type WebVitalsCallback = (metric: IWebVitalsMetric) => void;\r\n\r\n/**\r\n * Registers Core Web Vitals observers (FCP, LCP, CLS, INP, TTFB).\r\n * Call once per app session, typically after app.mount().\r\n *\r\n * @param callback - Optional custom handler. Defaults to console.warn in dev mode.\r\n * @returns void — side-effect only composable\r\n */\r\nexport function useWebVitals(callback?: WebVitalsCallback): void {\r\n const defaultCallback: WebVitalsCallback = (metric) => {\r\n if (import.meta.env.DEV) {\r\n const unit = metric.name === \"CLS\" ? \"\" : \"ms\";\r\n const value = metric.name === \"CLS\" ? metric.value.toFixed(4) : Math.round(metric.value);\r\n console.warn(`[web-vitals] ${metric.name}: ${value}${unit} (${metric.rating})`);\r\n }\r\n };\r\n\r\n const handler = (metric: Metric) => {\r\n (callback ?? defaultCallback)({\r\n name: metric.name,\r\n value: metric.value,\r\n rating: metric.rating,\r\n });\r\n };\r\n\r\n onFCP(handler);\r\n onLCP(handler);\r\n onCLS(handler);\r\n onINP(handler);\r\n onTTFB(handler);\r\n}\r\n","import { type ComputedRef, type Ref, onMounted, onUnmounted, inject } from \"vue\";\r\nimport { WidgetServiceKey, WidgetScopeKey } from \"@framework/injection-keys\";\r\nimport { BladeDescriptorKey } from \"@core/blade-navigation/types\";\r\nimport type { IWidget, IHeadlessWidgetFields, IWidgetTrigger } from \"@core/services/widget-service\";\r\nimport { createLogger, InjectionError } from \"@core/utilities\";\r\n\r\nconst logger = createLogger(\"use-blade-widgets\");\r\n\r\nexport interface HeadlessWidgetDeclaration {\r\n id: string;\r\n icon: string;\r\n title: string;\r\n badge?: Ref<number | string> | ComputedRef<number | string>;\r\n loading?: Ref<boolean> | ComputedRef<boolean>;\r\n disabled?: Ref<boolean> | ComputedRef<boolean> | boolean;\r\n isVisible?: ComputedRef<boolean> | Ref<boolean> | boolean;\r\n onClick?: () => void;\r\n onRefresh?: () => void | Promise<void>;\r\n}\r\n\r\nexport interface UseBladeWidgetsReturn {\r\n /** Call trigger.onRefresh on a specific widget */\r\n refresh: (widgetId: string) => void;\r\n /** Call trigger.onRefresh on all blade widgets that have a trigger */\r\n refreshAll: () => void;\r\n}\r\n\r\n/**\r\n * Declarative headless widget registration for blades.\r\n * Automatically registers on mount, unregisters on unmount.\r\n * Gets bladeId from blade context (BladeDescriptorKey).\r\n *\r\n * @example\r\n * ```ts\r\n * const { refreshAll } = useBladeWidgets([\r\n * { id: \"OffersWidget\", icon: \"lucide-tag\", title: \"OFFERS.TITLE\",\r\n * badge: count, onClick: () => openBlade({ name: \"Offers\" }) },\r\n * ]);\r\n * ```\r\n */\r\nexport function useBladeWidgets(widgets: HeadlessWidgetDeclaration[]): UseBladeWidgetsReturn {\r\n const _service = inject(WidgetServiceKey);\r\n if (!_service) {\r\n throw new InjectionError(\"WidgetService\");\r\n }\r\n const widgetService = _service;\r\n\r\n const descriptor = inject(BladeDescriptorKey, undefined);\r\n if (!descriptor) {\r\n throw new Error(\r\n \"[vc-shell] useBladeWidgets() requires blade context (BladeDescriptorKey). \" +\r\n \"It must be called inside a blade component rendered by VcBladeSlot.\",\r\n );\r\n }\r\n\r\n const bladeId = descriptor.value.id;\r\n\r\n onMounted(() => {\r\n for (const decl of widgets) {\r\n widgetService.registerWidget(buildWidget(decl), bladeId);\r\n }\r\n });\r\n\r\n onUnmounted(() => {\r\n for (const decl of widgets) {\r\n widgetService.unregisterWidget(decl.id, bladeId);\r\n }\r\n });\r\n\r\n function refresh(widgetId: string): void {\r\n const registered = widgetService.getWidgets(bladeId);\r\n const widget = registered.find((w) => w.id === widgetId);\r\n if (widget?.trigger?.onRefresh) {\r\n widget.trigger.onRefresh();\r\n } else {\r\n logger.warn(`Widget '${widgetId}' has no trigger.onRefresh registered.`);\r\n }\r\n }\r\n\r\n function refreshAll(): void {\r\n const registered = widgetService.getWidgets(bladeId);\r\n for (const widget of registered) {\r\n if (widget.trigger?.onRefresh) {\r\n widget.trigger.onRefresh();\r\n }\r\n }\r\n }\r\n\r\n return { refresh, refreshAll };\r\n}\r\n\r\n// ── Widget scope (for component-based external widgets) ─────────────────────\r\n\r\n// Re-export for backward compatibility (type moved to widget-service)\r\nexport type { IWidgetScope } from \"@core/services/widget-service\";\r\n\r\n/**\r\n * Registers a trigger contract (onRefresh, onClick, badge) for an external\r\n * component-based widget, so the hosting blade can call `refresh()` / `refreshAll()`.\r\n *\r\n * Uses provide/inject — no props or IDs needed. Must be called inside a widget\r\n * component rendered by WidgetContainer.\r\n *\r\n * @example\r\n * ```ts\r\n * // Inside an external widget component:\r\n * useWidgetTrigger({ onRefresh: loadData });\r\n * ```\r\n */\r\nexport function useWidgetTrigger(trigger: IWidgetTrigger): void {\r\n const scope = inject(WidgetScopeKey);\r\n if (!scope) {\r\n logger.warn(\"useWidgetTrigger() called outside WidgetContainer scope — trigger will not be registered.\");\r\n return;\r\n }\r\n scope.setTrigger(trigger);\r\n}\r\n\r\n// ── Internal ─────────────────────────────────────────────────────────────────\r\n\r\nfunction buildWidget(decl: HeadlessWidgetDeclaration): IWidget {\r\n const headless: IHeadlessWidgetFields = {\r\n icon: decl.icon,\r\n badge: decl.badge,\r\n loading: decl.loading,\r\n disabled: decl.disabled,\r\n onClick: decl.onClick,\r\n onRefresh: decl.onRefresh,\r\n };\r\n\r\n return {\r\n id: decl.id,\r\n title: decl.title,\r\n isVisible: decl.isVisible,\r\n headless,\r\n trigger: decl.onRefresh ? { onRefresh: decl.onRefresh } : undefined,\r\n };\r\n}\r\n","import { provide, inject, computed, toValue, isRef, type MaybeRefOrGetter, type ComputedRef } from \"vue\";\r\nimport { BladeContextKey } from \"@framework/injection-keys\";\r\nimport { InjectionError } from \"@core/utilities\";\r\n\r\n/**\r\n * Shallow-unwraps all ref/computed values in a record.\r\n * Plain values pass through unchanged.\r\n */\r\nfunction unwrapRecord(record: Record<string, unknown>): Record<string, unknown> {\r\n const result: Record<string, unknown> = {};\r\n for (const key of Object.keys(record)) {\r\n const val = record[key];\r\n result[key] = isRef(val) ? val.value : val;\r\n }\r\n return result;\r\n}\r\n\r\n/**\r\n * Exposes blade data for external widgets, extensions, and nested components.\r\n * Must be called in blade's `<script setup>`.\r\n *\r\n * All ref/computed values in the provided object are **automatically unwrapped**\r\n * so consumers can access them directly without `.value`.\r\n *\r\n * @example\r\n * ```ts\r\n * defineBladeContext({ item, disabled });\r\n * // consumer: ctx.value.item — already unwrapped, no .value needed\r\n * ```\r\n */\r\nexport function defineBladeContext(data: MaybeRefOrGetter<Record<string, unknown>>): void {\r\n provide(\r\n BladeContextKey,\r\n computed(() => unwrapRecord(toValue(data))),\r\n );\r\n}\r\n\r\n/**\r\n * Injects blade context provided by the nearest ancestor blade via `defineBladeContext`.\r\n * Returns a ComputedRef — access fields via `.value`.\r\n * Nested refs are already unwrapped by `defineBladeContext`.\r\n * Throws if no context is found.\r\n *\r\n * @example\r\n * ```ts\r\n * const ctx = injectBladeContext();\r\n * const entityId = computed(() => ctx.value.id as string);\r\n * ```\r\n */\r\nexport function injectBladeContext(): ComputedRef<Record<string, unknown>> {\r\n const ctx = inject<ComputedRef<Record<string, unknown>>>(BladeContextKey);\r\n if (!ctx) {\r\n throw new InjectionError(\"BladeContext\");\r\n }\r\n return ctx;\r\n}\r\n","import { ref, watch, Ref, computed, DeepReadonly, unref, isRef } from \"vue\";\nimport { cloneDeep, isEqualWith } from \"lodash-es\";\n\n/**\n * Custom comparator for deep equality that treats null, undefined, and \"\"\n * as semantically equivalent \"empty\" values.\n * This prevents false modification detection when APIs return null\n * but local state uses undefined or empty strings (common with language switching).\n */\nfunction isEmpty(value: unknown): boolean {\n return value === null || value === undefined || value === \"\";\n}\n\nfunction semanticEqual(a: unknown, b: unknown): boolean {\n return isEqualWith(a, b, (valA: unknown, valB: unknown) => {\n if (isEmpty(valA) && isEmpty(valB)) return true;\n return undefined; // fall back to default deep comparison\n });\n}\n\n/**\n * Return values from useModificationTracker.\n * @template T Type of the tracked value.\n */\nexport interface UseModificationTrackerReturn<T> {\n /**\n * Reactive reference to the current tracked value.\n * It can be changed directly or through v-model.\n */\n currentValue: Ref<T>;\n /**\n * Reactive reference to the pristine value.\n * It is a \"clean\" version representing the original, unmodified state.\n */\n pristineValue: Ref<T>;\n /**\n * Shows if currentValue has been modified compared to its \"pristine\" state.\n * Read-only.\n */\n isModified: DeepReadonly<Ref<boolean>>;\n /**\n * Resets the modification state.\n * The new \"pristine\" state will be set based on the current value of currentValue,\n * or based on `newBaselineValue` if provided.\n * `isModified` will become false.\n * @param newBaselineValue Optional new value (or Ref) that will become \"pristine\".\n */\n resetModificationState: (newBaselineValue?: T | Ref<T>) => void;\n}\n\n/**\n * Composable for tracking value changes (including deeply nested objects).\n *\n * @template T Type of the tracked value.\n * @param initialValueProp Initial value or Ref to it.\n * @returns {UseModificationTrackerReturn<T>} Object with `currentValue`, `isModified` and `resetModificationState`.\n */\nexport function useModificationTracker<T>(initialValueProp: T | Ref<T>): UseModificationTrackerReturn<T> {\n const getClonedUnreffedValue = (val: T | Ref<T>): T => cloneDeep(unref(val));\n\n const pristineValue = ref(getClonedUnreffedValue(initialValueProp)) as Ref<T>;\n const currentValue = ref(getClonedUnreffedValue(initialValueProp)) as Ref<T>;\n const isModified = ref(false);\n\n if (isRef(initialValueProp)) {\n watch(\n initialValueProp,\n (newExternalInitialValue) => {\n // When the external initialValueProp (Ref) changes,\n // we need to decide if we should update currentValue.\n const wasModified = !semanticEqual(currentValue.value, pristineValue.value);\n\n // Always update the \"pristine\" value (pristineValue), to reflect the new external source.\n pristineValue.value = cloneDeep(newExternalInitialValue);\n\n // If the user has not made any changes until this point,\n // we also update currentValue.\n // This prevents false triggering of isModified when loading data asynchronously.\n if (!wasModified) {\n currentValue.value = cloneDeep(newExternalInitialValue);\n }\n // If the user has already made changes (wasModified = true), we do not update currentValue,\n // to not overwrite their changes. isModified will remain true, because\n // currentValue will now be different from the new pristineValue.\n },\n { deep: true }, // Deep tracking, if initialValueProp is a Ref to an object/array\n );\n }\n\n watch(\n [currentValue, pristineValue], // Track changes in currentValue or pristineValue\n ([newCurrentVal, newPristineVal]) => {\n isModified.value = !semanticEqual(newCurrentVal, newPristineVal);\n },\n { deep: true },\n );\n\n const resetModificationState = (newBaselineValueInput?: T | Ref<T>) => {\n if (newBaselineValueInput !== undefined) {\n const newClonedBase = getClonedUnreffedValue(newBaselineValueInput);\n pristineValue.value = newClonedBase;\n currentValue.value = cloneDeep(newClonedBase); // Reset currentValue to the new baseline\n } else {\n pristineValue.value = cloneDeep(currentValue.value);\n }\n // Synchronously reset so that code running in the same tick (e.g. onBeforeClose)\n // sees the updated value before the deep watcher fires.\n isModified.value = false;\n };\n\n return {\n currentValue,\n pristineValue,\n isModified: computed(() => isModified.value),\n resetModificationState,\n };\n}\n","<template>\n <VcBlade\n :title=\"options?.asset?.name\"\n :subtitle=\"t('ASSETS.PAGES.DETAILS.SUBTITLE')\"\n :toolbar-items=\"bladeToolbar\"\n >\n <!-- Blade contents -->\n <div class=\"tw-flex tw-grow-1 tw-border-t tw-border-solid tw-border-t-[--assets-details-border]\">\n <div class=\"assets-details__content tw-grow tw-basis-0 tw-w-full tw-overflow-hidden\">\n <VcContainer :no-padding=\"true\">\n <div class=\"tw-p-4\">\n <VcForm>\n <div class=\"assets-details__header\">\n <template v-if=\"isImage(defaultAsset.name)\">\n <VcImage\n :src=\"defaultAsset.url\"\n size=\"xl\"\n :bordered=\"true\"\n class=\"tw-shrink-0\"\n ></VcImage>\n </template>\n <template v-else>\n <div class=\"assets-details__file-preview tw-shrink-0\">\n <div\n class=\"assets-details__file-badge\"\n :style=\"{ backgroundColor: getExtensionColor(defaultAsset.name) }\"\n >\n {{ getExtensionLabel(defaultAsset.name) }}\n </div>\n </div>\n </template>\n <div class=\"assets-details__meta\">\n <VcField\n :label=\"t('ASSETS.PAGES.DETAILS.FIELDS.SIZE')\"\n :model-value=\"readableSize(defaultAsset.size)\"\n />\n <VcField\n :label=\"t('ASSETS.PAGES.DETAILS.FIELDS.CREATED_DATE')\"\n :model-value=\"defaultAsset.createdDate\"\n type=\"date-ago\"\n />\n <VcField\n :label=\"t('ASSETS.PAGES.DETAILS.FIELDS.URL')\"\n :model-value=\"defaultAsset.url\"\n :display-value=\"defaultAsset.name\"\n type=\"link\"\n copyable\n />\n </div>\n </div>\n\n <Field\n v-if=\"!options?.hiddenFields?.includes('name')\"\n v-slot=\"{ errorMessage, handleChange, errors }\"\n :label=\"t('ASSETS.PAGES.DETAILS.FIELDS.NAME.TITLE')\"\n name=\"asset_name\"\n rules=\"required\"\n :model-value=\"defaultAsset.name\"\n >\n <VcInput\n v-model=\"assetNameClean\"\n class=\"tw-mb-4\"\n :label=\"t('ASSETS.PAGES.DETAILS.FIELDS.NAME.TITLE')\"\n clearable\n required\n :error=\"!!errors.length\"\n :error-message=\"errorMessage\"\n :placeholder=\"t('ASSETS.PAGES.DETAILS.FIELDS.NAME.PLACEHOLDER')\"\n :disabled=\"readonly\"\n @update:model-value=\"handleChange\"\n ></VcInput>\n </Field>\n <VcInput\n v-if=\"assetType === 'Image' && !options?.hiddenFields?.includes('altText')\"\n v-model=\"defaultAsset.altText\"\n class=\"tw-mb-4\"\n :label=\"t('ASSETS.PAGES.DETAILS.FIELDS.ALT.TITLE')\"\n clearable\n :placeholder=\"t('ASSETS.PAGES.DETAILS.FIELDS.ALT.PLACEHOLDER')\"\n :tooltip=\"t('ASSETS.PAGES.DETAILS.FIELDS.ALT.TOOLTIP')\"\n :disabled=\"readonly\"\n ></VcInput>\n <VcTextarea\n v-if=\"!options?.hiddenFields?.includes('description')\"\n v-model=\"defaultAsset.description\"\n class=\"tw-mb-4\"\n :label=\"t('ASSETS.PAGES.DETAILS.FIELDS.DESCRIPTION.TITLE')\"\n :placeholder=\"t('ASSETS.PAGES.DETAILS.FIELDS.DESCRIPTION.PLACEHOLDER')\"\n :disabled=\"readonly\"\n ></VcTextarea>\n </VcForm>\n </div>\n </VcContainer>\n </div>\n </div>\n </VcBlade>\n</template>\n\n<script lang=\"ts\">\nimport { __registerBladeConfig } from \"@vc-shell/framework\";\n__registerBladeConfig(\"AssetsDetails\", { });\n</script>\n<script lang=\"ts\" setup>\nimport type { IBladeToolbar } from \"@core/types\";\nimport type { AssetLike } from \"@core/composables/useAssetsManager\";\nimport { computed, ref } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport { VcBlade } from \"@ui/components/organisms/vc-blade\";\nimport { VcContainer } from \"@ui/components/atoms/vc-container\";\nimport { VcForm } from \"@ui/components/molecules/vc-form\";\nimport { VcImage } from \"@ui/components/atoms/vc-image\";\nimport { VcInput } from \"@ui/components/molecules/vc-input\";\nimport { VcTextarea } from \"@ui/components/molecules/vc-textarea\";\nimport { VcField } from \"@ui/components/molecules/vc-field\";\nimport { isImage, readableSize, getExtensionColor, getExtensionLabel } from \"@core/utilities/assets\";\nimport { useIsFormValid, Field, useForm, useIsFormDirty } from \"vee-validate\";\nimport { useBlade } from \"@core/composables/useBlade\";\n\ninterface AssetsDetailsOptions {\n asset: AssetLike;\n disabled?: boolean;\n hiddenFields?: string[];\n assetEditHandler?: (defaultAsset: AssetLike) => void;\n assetRemoveHandler?: (defaultAsset: AssetLike) => Promise<void>;\n}\n\ndefineOptions({ name: \"AssetsDetails\" });\n\n\nconst { options, closeSelf } = useBlade<AssetsDetailsOptions>();\n\nuseForm({ validateOnMount: false });\nconst isValid = useIsFormValid();\nconst isDirty = useIsFormDirty();\nconst { t } = useI18n({ useScope: \"global\" });\nconst defaultAsset = ref<AssetLike>({ ...options.value?.asset });\n\nconst readonly = computed(() => options.value?.disabled);\n\nconst assetNameClean = computed({\n get() {\n const name = defaultAsset.value.name;\n if (!name) return \"\";\n const dotIndex = name.lastIndexOf(\".\");\n return dotIndex > 0 ? name.slice(0, dotIndex) : name;\n },\n set(value) {\n const name = defaultAsset.value.name;\n if (!name) return;\n const dotIndex = name.lastIndexOf(\".\");\n const ext = dotIndex > 0 ? name.slice(dotIndex) : \"\";\n defaultAsset.value.name = value ? value + ext : \"\";\n },\n});\n\nconst isDisabled = computed(() => {\n return !isDirty.value || !isValid.value;\n});\n\nconst bladeToolbar = ref<IBladeToolbar[]>([\n {\n id: \"save\",\n title: t(\"ASSETS.PAGES.DETAILS.TOOLBAR.SAVE\"),\n icon: \"lucide-save\",\n async clickHandler() {\n if (options.value?.assetEditHandler && typeof options.value?.assetEditHandler === \"function\") {\n await options.value?.assetEditHandler(defaultAsset.value);\n closeSelf();\n }\n },\n disabled: computed(() => isDisabled.value || readonly.value),\n },\n {\n id: \"delete\",\n title: t(\"ASSETS.PAGES.DETAILS.TOOLBAR.DELETE\"),\n icon: \"lucide-trash-2\",\n async clickHandler() {\n if (options.value?.assetRemoveHandler && typeof options.value?.assetRemoveHandler === \"function\") {\n await options.value?.assetRemoveHandler(defaultAsset.value);\n closeSelf();\n }\n },\n disabled: computed(() => readonly.value),\n },\n]);\n\nconst assetType = computed(() => defaultAsset.value?.typeId);\n</script>\n\n<style lang=\"scss\">\n:root {\n --assets-details-border: var(--neutrals-200);\n}\n\n.assets-details__header {\n @apply tw-flex tw-mb-4;\n @apply tw-overflow-hidden;\n}\n\n.assets-details__meta {\n @apply tw-flex tw-flex-col tw-gap-3;\n @apply tw-ml-6 tw-min-w-0 tw-flex-1;\n @apply tw-overflow-hidden;\n}\n\n.assets-details__file-preview {\n @apply tw-w-[var(--image-size-xl)] tw-h-[var(--image-size-xl)];\n @apply tw-rounded-[var(--image-border-radius)];\n @apply tw-border tw-border-solid tw-border-[color:var(--image-border-color)];\n @apply tw-bg-[var(--neutrals-50)];\n @apply tw-flex tw-flex-col tw-items-center tw-justify-center;\n @apply tw-gap-2;\n @apply tw-overflow-hidden;\n}\n\n.assets-details__file-badge {\n @apply tw-flex tw-items-center tw-justify-center;\n @apply tw-px-3.5 tw-py-1.5;\n @apply tw-rounded-md;\n @apply tw-text-sm tw-font-bold tw-tracking-wide;\n @apply tw-text-white;\n}\n</style>\n","import _AssetsDetails from \"@modules/assets/components/assets-details/assets-details.vue\";\n\nexport const AssetsDetails = _AssetsDetails as typeof _AssetsDetails;\n","import { defineAppModule } from \"@core/plugins/modularity\";\nimport * as components from \"@modules/assets/components\";\n\nexport const AssetsDetailsModule = defineAppModule({ blades: components });\n\nexport default components;\n","<template>\n <VcBlade\n :title=\"bladeTitle\"\n :toolbar-items=\"bladeToolbar\"\n width=\"70%\"\n >\n <div\n v-loading=\"isLoading\"\n class=\"tw-relative tw-h-full tw-flex-1\"\n @dragover.prevent.stop=\"dragOver\"\n @dragleave.prevent=\"dragLeave\"\n @drop.prevent.stop=\"onDrop\"\n >\n <!-- @vue-generic {AssetLike} -->\n <VcDataTable\n v-model:selection=\"selectedItems\"\n :items=\"defaultAssets\"\n state-key=\"assets_manager\"\n :reorderable-rows=\"!readonly\"\n :selection-mode=\"!readonly ? 'multiple' : undefined\"\n :row-actions=\"!readonly ? actionBuilder : undefined\"\n :empty-state=\"{\n icon: 'lucide-cloud-upload',\n title: $t('ASSETS_MANAGER.EMPTY.UPLOAD_ASSETS'),\n actionLabel: $t('ASSETS_MANAGER.EMPTY.UPLOAD'),\n actionHandler: toggleUploader,\n }\"\n class=\"tw-h-full tw-w-full\"\n @row-click=\"({ data }) => onItemClick(data)\"\n @row-reorder=\"sortAssets\"\n >\n <VcColumn\n id=\"url\"\n :title=\"t('ASSETS_MANAGER.TABLE.HEADER.IMAGE')\"\n width=\"10%\"\n always-visible\n type=\"image\"\n >\n <template #body=\"{ data }\">\n <div class=\"tw-flex tw-items-center tw-justify-center\">\n <template v-if=\"isImage(data.name ?? '')\">\n <VcImage\n :bordered=\"true\"\n size=\"s\"\n aspect=\"1x1\"\n :src=\"data.url\"\n background=\"contain\"\n ></VcImage>\n </template>\n <template v-else>\n <div\n class=\"assets-manager__file-badge\"\n :style=\"{ backgroundColor: getExtensionColor(data.name ?? '') }\"\n >\n {{ getExtensionLabel(data.name ?? \"\") }}\n </div>\n </template>\n </div>\n </template>\n </VcColumn>\n\n <VcColumn\n id=\"name\"\n :title=\"t('ASSETS_MANAGER.TABLE.HEADER.NAME')\"\n width=\"20%\"\n always-visible\n />\n\n <VcColumn\n id=\"size\"\n :title=\"t('ASSETS_MANAGER.TABLE.HEADER.SIZE')\"\n width=\"20%\"\n always-visible\n >\n <template #body=\"{ data }\">\n <div>\n {{ readableSize(data.size ?? 0) }}\n </div>\n </template>\n </VcColumn>\n\n <VcColumn\n id=\"sortOrder\"\n :title=\"t('ASSETS_MANAGER.TABLE.HEADER.SORT_ORDER')\"\n width=\"25%\"\n always-visible\n >\n <template #body=\"{ data }\">\n <div>\n {{ data.sortOrder }}\n </div>\n </template>\n </VcColumn>\n\n <VcColumn\n id=\"createdDate\"\n :title=\"t('ASSETS_MANAGER.TABLE.HEADER.CREATED_DATE')\"\n width=\"25%\"\n type=\"date-ago\"\n always-visible\n />\n </VcDataTable>\n </div>\n\n <input\n ref=\"uploader\"\n type=\"file\"\n hidden\n multiple\n name=\"assets_manager\"\n @change=\"inputUpload\"\n />\n </VcBlade>\n</template>\n\n<script lang=\"ts\">\nimport { __registerBladeConfig } from \"@vc-shell/framework\";\n__registerBladeConfig(\"AssetsManager\", { });\n</script>\n<script setup lang=\"ts\">\nimport type { AssetLike, UseAssetsManagerReturn } from \"@core/composables/useAssetsManager\";\nimport { IBladeToolbar } from \"@core/types\";\nimport { ref, computed, unref } from \"vue\";\nimport { useI18n } from \"vue-i18n\";\nimport { isImage, readableSize, getExtensionColor, getExtensionLabel } from \"@core/utilities/assets\";\nimport { useBlade } from \"@core/composables/useBlade\";\nimport { createLogger } from \"@core/utilities\";\nimport { TableAction } from \"@ui/components/organisms/vc-data-table/types\";\nimport { VcBlade, VcColumn, VcDataTable, VcImage } from \"@ui/components\";\nimport { vLoading } from \"@core/directives\";\n\nconst logger = createLogger(\"assets-manager\");\n\ninterface AssetsManagerOptions {\n title?: string;\n manager: UseAssetsManagerReturn;\n disabled?: boolean;\n hiddenFields?: string[];\n}\n\ndefineOptions({ name: \"AssetsManager\" });\n\n\nconst { options, openBlade } = useBlade<AssetsManagerOptions>();\n\nconst { t } = useI18n({ useScope: \"global\" });\n\nconst manager = computed(() => options.value!.manager);\n\nconst defaultAssets = computed(() => manager.value.items.value ?? []);\n\nconst isLoading = computed(() => manager.value.loading.value);\n\nconst bladeTitle = computed(() => options.value?.title || t(\"ASSETS_MANAGER.TITLE\"));\n\nconst isDragging = ref(false);\nconst uploader = ref();\nconst selectedItems = ref<AssetLike[]>([]);\nconst readonly = computed(() => options.value?.disabled);\n\nconst bladeToolbar = ref<IBladeToolbar[]>([\n {\n id: \"add\",\n title: computed(() => t(\"ASSETS_MANAGER.TOOLBAR.ADD\")),\n icon: \"lucide-plus\",\n clickHandler() {\n toggleUploader();\n },\n disabled: computed(() => readonly.value),\n isVisible: computed(() => !readonly.value),\n },\n {\n id: \"delete\",\n title: computed(() => t(\"ASSETS_MANAGER.TOOLBAR.DELETE\")),\n icon: \"lucide-trash-2\",\n async clickHandler() {\n await manager.value.removeMany(selectedItems.value);\n },\n disabled: computed(() => !selectedItems.value.length || readonly.value),\n isVisible: computed(() => !readonly.value),\n },\n]);\n\nasync function sortAssets(event: { dragIndex: number; dropIndex: number; value: AssetLike[] }) {\n if (event.dragIndex !== event.dropIndex) {\n const sorted = event.value.map((item, index) => {\n item.sortOrder = index;\n return item;\n });\n\n manager.value.reorder(sorted);\n }\n}\n\nfunction dragOver() {\n if (!readonly.value) {\n isDragging.value = true;\n }\n}\n\nfunction dragLeave() {\n if (!readonly.value) {\n isDragging.value = false;\n }\n}\n\nasync function onDrop(event: DragEvent) {\n if (!readonly.value) {\n const fileList = event.dataTransfer?.files;\n\n if (fileList && fileList.length) {\n try {\n await upload(fileList);\n } catch (error) {\n logger.error(\"Failed to upload dropped files:\", error);\n throw error;\n }\n }\n isDragging.value = false;\n }\n}\n\nfunction toggleUploader() {\n uploader.value.value = \"\";\n uploader.value.click();\n}\n\nasync function upload(files: FileList) {\n if (!files || files.length === 0) return;\n\n const existingNames = new Set((defaultAssets.value ?? []).map((asset) => asset.name).filter(Boolean));\n\n const transfer = new DataTransfer();\n for (const file of Array.from(files)) {\n let fileName = file.name;\n\n if (existingNames.has(fileName)) {\n const ext = fileName.includes(\".\") ? `.${fileName.split(\".\").pop()}` : \"\";\n const base = fileName.slice(0, fileName.length - ext.length);\n let i = 1;\n while (existingNames.has(fileName)) {\n fileName = `${base}_${i}${ext}`;\n i++;\n }\n }\n\n existingNames.add(fileName);\n transfer.items.add(new File([file], fileName, { type: file.type }));\n }\n\n try {\n const maxSortOrder = defaultAssets.value.reduce((max, asset) => Math.max(max, asset.sortOrder ?? 0), -1);\n await manager.value.upload(transfer.files, maxSortOrder);\n } catch (error) {\n logger.error(\"Failed to upload assets:\", error);\n throw error;\n }\n}\n\nasync function inputUpload(event: Event) {\n const target = event.target as HTMLInputElement;\n const fileList = target.files;\n\n if (fileList && fileList.length) {\n try {\n await upload(fileList);\n } catch (error) {\n logger.error(\"Failed to upload files:\", error);\n throw error;\n }\n }\n}\n\nfunction onItemClick(item: AssetLike) {\n openBlade({\n name: \"AssetsDetails\",\n options: {\n asset: unref(item),\n disabled: readonly.value,\n hiddenFields: options.value?.hiddenFields,\n assetEditHandler: (asset: AssetLike) => {\n manager.value.updateItem(asset);\n },\n assetRemoveHandler: async (asset: AssetLike) => {\n await manager.value.remove(asset);\n },\n },\n }).catch((error) => {\n logger.error(\"Failed to open AssetsDetails blade:\", error);\n });\n}\n\nconst actionBuilder = (): TableAction[] => {\n return [\n {\n icon: \"lucide-trash-2\",\n title: computed(() => t(\"ASSETS_MANAGER.TABLE.ACTIONS.DELETE\")),\n type: \"danger\",\n async clickHandler(item: AssetLike) {\n await manager.value.remove(item);\n selectedItems.value = [];\n },\n },\n ];\n};\n</script>\n\n<style lang=\"scss\">\n:root {\n --assets-manager-empty-icon-color: var(--primary-400);\n --assets-manager-mobile-border: var(--info-100);\n}\n\n.assets-manager__file-badge {\n @apply tw-flex tw-items-center tw-justify-center;\n @apply tw-px-2.5 tw-py-1;\n @apply tw-rounded;\n @apply tw-text-xs tw-font-bold tw-tracking-wide;\n @apply tw-text-white;\n}\n</style>\n","import _AssetsManager from \"@modules/assets-manager/components/assets-manager/assets-manager.vue\";\n\nexport const AssetsManager = _AssetsManager as typeof _AssetsManager;\n","import { defineAppModule } from \"@core/plugins/modularity\";\nimport * as components from \"@modules/assets-manager/components\";\n\nexport const AssetsManagerModule = defineAppModule({ blades: components });\n\nexport * from \"@modules/assets-manager/components\";\n","import { watch, readonly, ref } from \"vue\";\r\nimport { useNetwork } from \"@vueuse/core\";\r\nimport { notification } from \"@core/notifications/notification\";\r\nimport { createLogger } from \"@core/utilities\";\r\n\r\nconst logger = createLogger(\"connection-status\");\r\n\r\nconst OFFLINE_NOTIFICATION_ID = \"vc-framework-offline-status\";\r\n\r\n// Module-level singleton state\r\nconst _isSetup = ref(false);\r\nconst _isOnline = ref(true);\r\n\r\nexport interface UseConnectionStatusReturn {\r\n isOnline: Readonly<typeof _isOnline>;\r\n}\r\n\r\n/** @deprecated Use UseConnectionStatusReturn instead */\r\nexport type UseConnectionStatus = UseConnectionStatusReturn;\r\n\r\nexport function useConnectionStatus(): UseConnectionStatusReturn {\r\n if (!_isSetup.value && typeof window !== \"undefined\") {\r\n _isSetup.value = true;\r\n\r\n const { isOnline } = useNetwork();\r\n\r\n watch(\r\n isOnline,\r\n (online) => {\r\n _isOnline.value = online;\r\n\r\n if (!online) {\r\n logger.warn(\"Network connection lost\");\r\n notification.warning(\"You are currently offline. Some features may be unavailable.\", {\r\n notificationId: OFFLINE_NOTIFICATION_ID,\r\n timeout: false,\r\n });\r\n document.documentElement.classList.add(\"vc-offline\");\r\n } else {\r\n logger.info(\"Network connection restored\");\r\n notification.remove(OFFLINE_NOTIFICATION_ID);\r\n document.documentElement.classList.remove(\"vc-offline\");\r\n }\r\n },\r\n { immediate: true },\r\n );\r\n }\r\n\r\n return {\r\n isOnline: readonly(_isOnline),\r\n };\r\n}\r\n","import { computed, ref, watch, type Ref } from \"vue\";\nimport { createLogger } from \"@core/utilities\";\nimport { notification } from \"@core/notifications/notification\";\nimport { useConnectionStatus } from \"@core/composables/useConnectionStatus\";\n\nconst logger = createLogger(\"slow-network\");\nconst SLOW_REQUEST_THRESHOLD_MS = 10000;\nconst SLOW_EFFECTIVE_TYPES = [\"slow-2g\", \"2g\"];\nlet _connectionHandler: (() => void) | null = null;\n\nconst SLOW_NETWORK_NOTIFICATION_ID = \"vc-framework-slow-network\";\nconst DISMISS_DELAY_MS = 3000;\n// TODO: move to i18n locale files when useConnectionStatus also migrates to i18n\nconst SLOW_NETWORK_MESSAGE = \"Your network is slow or the server is taking longer than usual. Please be patient.\";\nlet _dismissTimer: ReturnType<typeof setTimeout> | null = null;\n\nfunction showSlowNotification() {\n notification.warning(SLOW_NETWORK_MESSAGE, {\n notificationId: SLOW_NETWORK_NOTIFICATION_ID,\n timeout: false,\n });\n}\n\nfunction hideSlowNotification() {\n notification.remove(SLOW_NETWORK_NOTIFICATION_ID);\n}\n\n// ── Module-level singleton state ────────────────────────────────────\nconst _isSetup = ref(false);\nconst _slowRequestCount = ref(0);\nconst _isSlowEffectiveType = ref(false);\nconst _pendingTimers = new Map<string, ReturnType<typeof setTimeout>>();\nconst _trackedSlowIds = new Set<string>();\n\nconst isSlowNetwork = computed(() => _slowRequestCount.value > 0 || _isSlowEffectiveType.value);\n\nexport interface UseSlowNetworkDetectionReturn {\n isSlowNetwork: Readonly<Ref<boolean>>;\n trackRequest(id: string): void;\n untrackRequest(id: string): void;\n}\n\nfunction trackRequest(id: string): void {\n const timer = setTimeout(() => {\n _slowRequestCount.value++;\n _pendingTimers.delete(id);\n _trackedSlowIds.add(id);\n }, SLOW_REQUEST_THRESHOLD_MS);\n _pendingTimers.set(id, timer);\n}\n\nfunction untrackRequest(id: string): void {\n const timer = _pendingTimers.get(id);\n if (timer != null) {\n // Request completed before threshold — cancel timer\n clearTimeout(timer);\n _pendingTimers.delete(id);\n } else if (_trackedSlowIds.has(id)) {\n // Timer already fired — decrement slow count\n _slowRequestCount.value = Math.max(0, _slowRequestCount.value - 1);\n _trackedSlowIds.delete(id);\n }\n // else: unknown id — no-op (defensive)\n}\n\nexport function useSlowNetworkDetection(): UseSlowNetworkDetectionReturn {\n if (!_isSetup.value && typeof window !== \"undefined\") {\n _isSetup.value = true;\n\n const connection = (navigator as any).connection;\n if (connection) {\n _connectionHandler = () => {\n const isSlow = SLOW_EFFECTIVE_TYPES.includes(connection.effectiveType);\n if (isSlow !== _isSlowEffectiveType.value) {\n logger.info(`Connection type: ${connection.effectiveType} → ${isSlow ? \"slow\" : \"normal\"}`);\n }\n _isSlowEffectiveType.value = isSlow;\n };\n connection.addEventListener(\"change\", _connectionHandler);\n _connectionHandler(); // initial check\n }\n\n const { isOnline } = useConnectionStatus();\n\n watch(isSlowNetwork, (slow) => {\n if (slow) {\n if (_dismissTimer != null) {\n clearTimeout(_dismissTimer);\n _dismissTimer = null;\n }\n if (isOnline.value) {\n logger.info(\"Slow network detected — showing notification\");\n showSlowNotification();\n }\n } else {\n _dismissTimer = setTimeout(() => {\n logger.info(\"Network recovered — hiding notification\");\n hideSlowNotification();\n _dismissTimer = null;\n }, DISMISS_DELAY_MS);\n }\n });\n\n watch(isOnline, (online) => {\n if (!online) {\n if (_dismissTimer != null) {\n clearTimeout(_dismissTimer);\n _dismissTimer = null;\n }\n hideSlowNotification();\n } else if (isSlowNetwork.value) {\n showSlowNotification();\n }\n });\n }\n\n return {\n isSlowNetwork,\n trackRequest,\n untrackRequest,\n };\n}\n\n/** Test-only: reset singleton state between tests. No-op in production builds. @internal — not public API. */\nexport const _resetForTest: (() => void) | undefined = import.meta.env.VITEST\n ? () => {\n const connection = (navigator as any).connection;\n if (connection && _connectionHandler) {\n connection.removeEventListener(\"change\", _connectionHandler);\n _connectionHandler = null;\n }\n if (_dismissTimer != null) {\n clearTimeout(_dismissTimer);\n _dismissTimer = null;\n }\n _isSetup.value = false;\n _slowRequestCount.value = 0;\n _isSlowEffectiveType.value = false;\n for (const timer of _pendingTimers.values()) {\n clearTimeout(timer);\n }\n _pendingTimers.clear();\n _trackedSlowIds.clear();\n }\n : undefined;\n","import { Router } from \"vue-router\";\nimport { useUserManagement } from \"@core/composables/useUserManagement\";\nimport { notification } from \"@core/notifications/notification\";\nimport { createLogger } from \"@core/utilities\";\nimport { isSessionExpired, markSessionExpired, SessionExpiredError } from \"@core/utilities/sessionExpiration\";\nimport { useSlowNetworkDetection } from \"@core/composables/useSlowNetworkDetection\";\n\nconst logger = createLogger(\"interceptors\");\n\n// Paths a platform redirects an unauthenticated request to.\nconst LOGIN_PATH_PATTERN = /(^|\\/)(login|signin|sign-in|account\\/login|connect\\/authorize)(\\/|$)/i;\n\n/**\n * Detects a dead session that no status code reveals.\n *\n * Some platform configurations answer an unauthenticated API call with a redirect\n * to the login page instead of a 401. `fetch` follows that redirect transparently,\n * so the interceptor sees a 200 carrying HTML: the caller then parses a login page\n * as data and the UI silently renders \"nothing found\" while the session is gone.\n *\n * HTML alone is not the signal — an endpoint may legitimately serve a rendered\n * template or an export. It counts only when the request was also redirected away\n * from the endpoint that was asked. A login-shaped final URL is conclusive on its\n * own, for platforms that omit the content type.\n */\nfunction looksLikeLoginPage(response: Response): boolean {\n let pathname: string;\n try {\n pathname = new URL(response.url, window.location.origin).pathname;\n } catch {\n return false;\n }\n\n if (LOGIN_PATH_PATTERN.test(pathname)) {\n return true;\n }\n\n const contentType = response.headers?.get?.(\"content-type\") ?? \"\";\n return response.redirected === true && contentType.includes(\"text/html\");\n}\n\ntype PatchedFetch = typeof window.fetch & { __vcInterceptorsInstalled__?: true };\n\nexport function registerInterceptors(router: Router) {\n // Idempotency guard: a second install would wrap the already-wrapped fetch,\n // stacking timeouts, duplicate 401 sign-outs and slow-network tracking.\n // A brand on the function survives module reloads (HMR / test workers) while\n // living only within this tab.\n const existing = window.fetch as PatchedFetch;\n if (existing.__vcInterceptorsInstalled__) {\n logger.warn(\"registerInterceptors called twice — ignoring second install\");\n return window.fetch;\n }\n\n const { fetch: originalFetch } = window;\n const { signOut, isAuthenticated } = useUserManagement();\n const { trackRequest, untrackRequest } = useSlowNetworkDetection();\n let requestCounter = 0;\n\n const patched = (async (...args: Parameters<typeof window.fetch>) => {\n /**\n * Overrides the global `fetch` function to handle API calls in demo mode.\n * If `window.__DEMO_MODE__` is true, the fetch is cancelled and a warning is logged.\n * Otherwise, the original `fetch` function is called.\n * @param args - The arguments passed to the `fetch` function.\n * @returns A promise that resolves to the response from the API call.\n */\n if (window.__DEMO_MODE__) {\n logger.warn(\"CANCELLED FETCH WHILE IN __DEMO_MODE__: \", ...args);\n logger.warn(\"Please logout and add APP_PLATFORM_URL into .env file of your application to enable API calls\");\n return new Promise((resolve: any) => {\n /**\n * This conditions are mocking login, currentuser API calls for demo purposes.\n */\n if (args[0] === \"/api/platform/security/login\") {\n resolve({\n status: 200,\n text: async () => JSON.stringify({ succeeded: true }),\n });\n } else if (args[0] === \"/api/platform/security/currentuser\") {\n notification.warning(\n \"You are currently in DEMO mode until the first page refresh. \\n All API calls are disabled. Please add APP_PLATFORM_URL to your application's .env file to enable API calls.\",\n {\n timeout: 10000,\n },\n );\n resolve({\n status: 200,\n text: async () => JSON.stringify({ id: \"demo_user_id\", userName: \"DEMO_USER\" }),\n });\n } else {\n resolve({\n status: 200,\n text: async () => JSON.stringify({}),\n });\n }\n });\n } else {\n const [resource, init] = args;\n\n function isApiRequest(input: RequestInfo | URL): boolean {\n const raw = typeof input === \"string\" ? input : input instanceof Request ? input.url : input.toString();\n\n try {\n const url = new URL(raw, window.location.origin);\n return url.origin === window.location.origin && url.pathname.startsWith(\"/api/\");\n } catch {\n return false;\n }\n }\n\n // Scope hardening only to platform API calls\n if (!isApiRequest(resource)) {\n return originalFetch(...args);\n }\n\n if (!navigator.onLine) {\n logger.warn(\"Request blocked: browser is offline\", resource);\n return Promise.reject(new Error(\"Network unavailable. Please check your connection.\"));\n }\n\n const requestId = String(++requestCounter);\n trackRequest(requestId);\n\n // Always enforce timeout, but preserve external cancellation semantics\n const controller = new AbortController();\n let didTimeout = false;\n const timeoutId = setTimeout(() => {\n didTimeout = true;\n controller.abort();\n }, 30000);\n\n const externalSignal = init?.signal;\n const abortFromExternal = () => controller.abort();\n if (externalSignal?.aborted) {\n abortFromExternal();\n } else if (externalSignal) {\n externalSignal.addEventListener(\"abort\", abortFromExternal, { once: true });\n }\n\n try {\n const response = await originalFetch(resource, {\n ...(init || {}),\n signal: controller.signal,\n });\n\n /**\n * If the response is unauthorized, logout the user\n */\n // A 401 on a session we still believe is alive means the cookie died under us.\n // Flag it before returning the 401 to the caller, so the data-load errors it\n // triggers (blade banners + toasts on the page that was mid-navigation) are\n // suppressed in favour of a single clean redirect to login.\n //\n // The flag doubles as an \"already handling it\" latch: concurrent 401s from the\n // same dead session are suppressed by it but skip this branch, so sign-out,\n // redirect and toast happen exactly once. It is deliberately not set when we\n // are not signed in — a 401 we don't act on must not silence the whole app.\n // A 401 is the explicit signal; a successful response that is actually the\n // login page is the same death reported differently (see looksLikeLoginPage).\n // A 403 is deliberately excluded — authenticated-but-unauthorized is not an\n // expired session, and signing the user out over it would be wrong.\n const isLoginPageResponse = response.ok && looksLikeLoginPage(response);\n const sessionDied = response.status === 401 || isLoginPageResponse;\n\n if (sessionDied && !isSessionExpired() && isAuthenticated.value) {\n markSessionExpired();\n\n signOut()\n .catch((err) => {\n logger.error(\"signOut failed after session expiry:\", err);\n })\n .finally(() => {\n redirect(router);\n notification.error(\n \"Access Denied: Your session has expired or you do not have the necessary permissions.\\nPlease log in again or contact the administrator for assistance.\",\n );\n });\n }\n\n // A 200 that is really the login page must not reach the caller — it would be parsed\n // as data. On a concurrent burst every request then raised its own\n // \"Unexpected token '<', \"<!DOCTYPE \"...\" on a page already redirecting to login,\n // burying the one message that says what happened (VCST-5688). Failing the request is\n // the honest answer: it returned no data. All of them fail with the same error, so a\n // consumer that does surface it shows one message, not one per request.\n //\n // Gated on the expiry flag, which the branch above has just set for the first response\n // of the burst: while nobody is signed in a login page is an expected answer, not a\n // session death, and failing those requests would break the pre-auth flow.\n //\n // A 401 is still returned unchanged: its body is not a document, so nothing tries to\n // parse markup, and callers may legitimately branch on the status themselves.\n if (isLoginPageResponse && isSessionExpired()) {\n throw new SessionExpiredError();\n }\n\n return response;\n } catch (e) {\n if (didTimeout) {\n throw new Error(\"Request timed out. Please try again.\");\n }\n throw e;\n } finally {\n untrackRequest(requestId);\n clearTimeout(timeoutId);\n if (externalSignal) {\n externalSignal.removeEventListener(\"abort\", abortFromExternal);\n }\n }\n }\n }) as PatchedFetch;\n\n patched.__vcInterceptorsInstalled__ = true;\n window.fetch = patched;\n return patched;\n}\n\nfunction redirect(router: Router) {\n // redirect to login page if it exists\n if (router && router.getRoutes().some((route) => route.path === \"/login\" || route.name === \"Login\")) {\n if (router.currentRoute.value.path !== \"/login\") {\n router.push(\"/login\");\n }\n } else {\n // Use the origin to redirect to the root of the application if no login page exists.\n // Usually this is the case when the application is used as a module.\n window.location.href = window.location.origin + \"/\";\n }\n}\n","import type { App } from \"vue\";\r\nimport { notification } from \"@core/notifications/notification\";\r\nimport { parseError } from \"@core/utilities/error\";\r\nimport { createLogger } from \"@core/utilities\";\r\n\r\nconst logger = createLogger(\"global-error-handler\");\r\n\r\nfunction errorKey(err: unknown): string {\r\n if (err instanceof Error) return `${err.name}:${err.message}`;\r\n return String(err);\r\n}\r\n\r\nconst recentErrors = new Map<string, number>();\r\nconst DEDUP_WINDOW_MS = 3000;\r\ntype WindowWithVcGlobalHandlers = Window & { __VC_GLOBAL_ERROR_HANDLERS_INSTALLED__?: boolean };\r\n\r\nfunction isDuplicate(err: unknown): boolean {\r\n const key = errorKey(err);\r\n const now = Date.now();\r\n const last = recentErrors.get(key);\r\n if (last && now - last < DEDUP_WINDOW_MS) return true;\r\n recentErrors.set(key, now);\r\n if (recentErrors.size > 50) {\r\n for (const [k, t] of recentErrors) {\r\n if (now - t > DEDUP_WINDOW_MS) recentErrors.delete(k);\r\n }\r\n }\r\n return false;\r\n}\r\n\r\nexport function setupGlobalErrorHandlers(app: App): void {\r\n // 1. Vue component errors — chain to existing handler\r\n const existingHandler = app.config.errorHandler;\r\n app.config.errorHandler = (err, instance, info) => {\r\n logger.error(\"Unhandled Vue error:\", err, \"\\nInfo:\", info);\r\n if (!isDuplicate(err)) {\r\n const parsed = parseError(err);\r\n notification.error(parsed.message, {\r\n timeout: 8000,\r\n notificationId: `global-vue-${errorKey(err)}`,\r\n });\r\n }\r\n existingHandler?.(err, instance, info);\r\n };\r\n\r\n if (typeof window === \"undefined\") return;\r\n const win = window as WindowWithVcGlobalHandlers;\r\n\r\n // Idempotency guard: prevent duplicated listeners when framework is installed multiple times\r\n if (win.__VC_GLOBAL_ERROR_HANDLERS_INSTALLED__) return;\r\n win.__VC_GLOBAL_ERROR_HANDLERS_INSTALLED__ = true;\r\n\r\n const onUnhandledRejection = (event: PromiseRejectionEvent) => {\r\n logger.error(\"Unhandled rejection:\", event.reason);\r\n if (!isDuplicate(event.reason)) {\r\n const parsed = parseError(event.reason);\r\n notification.error(parsed.message, {\r\n timeout: 8000,\r\n notificationId: `global-rejection-${errorKey(event.reason)}`,\r\n });\r\n }\r\n };\r\n\r\n // 2. Unhandled promise rejections\r\n window.addEventListener(\"unhandledrejection\", onUnhandledRejection);\r\n\r\n const onWindowError = (event: ErrorEvent) => {\r\n if (!event.error) return;\r\n logger.error(\"Uncaught error:\", event.error);\r\n if (!isDuplicate(event.error)) {\r\n const parsed = parseError(event.error);\r\n notification.error(parsed.message, {\r\n timeout: 8000,\r\n notificationId: `global-error-${errorKey(event.error)}`,\r\n });\r\n }\r\n };\r\n\r\n // 3. Uncaught JS errors\r\n window.addEventListener(\"error\", onWindowError);\r\n}\r\n","import { App } from \"vue\";\nimport { NotificationPosition } from \"@core/notifications/toast-types\";\nimport { createLogger } from \"@core/utilities\";\n\nconst logger = createLogger(\"notification-instance\");\n\ninterface IUseInstance {\n saveInstance(app: App<Element>, id: string, position: NotificationPosition): void;\n unmountComponent(position?: NotificationPosition): void;\n clearContainer(): void;\n getInstanceByPosition(position: NotificationPosition): App<Element> | undefined;\n}\n\n// Instance storage for different positions\nconst containerInstances: Record<NotificationPosition, App<Element> | undefined> = {\n \"top-center\": undefined,\n \"top-right\": undefined,\n \"top-left\": undefined,\n \"bottom-center\": undefined,\n \"bottom-right\": undefined,\n \"bottom-left\": undefined,\n};\n\nexport function useInstance(): IUseInstance {\n function saveInstance(app: App<Element>, id: string, position: NotificationPosition) {\n const container = document.getElementById(id);\n if (container) {\n containerInstances[position] = app;\n }\n }\n\n function unmountComponent(position?: NotificationPosition) {\n try {\n if (position) {\n // Remove specific container by position\n if (containerInstances[position]) {\n containerInstances[position]?.unmount();\n document.getElementById(`notification-${position}`)?.remove();\n containerInstances[position] = undefined;\n }\n } else {\n // Remove all containers\n Object.keys(containerInstances).forEach((pos) => {\n const position = pos as NotificationPosition;\n containerInstances[position]?.unmount();\n document.getElementById(`notification-${position}`)?.remove();\n containerInstances[position] = undefined;\n });\n\n // Remove the root container if there are no active containers\n const hasActiveContainers = Object.values(containerInstances).some((instance) => instance !== undefined);\n if (!hasActiveContainers) {\n document.querySelector(\".notification\")?.remove();\n }\n }\n } catch (error) {\n logger.error(\"Failed to unmount notification component:\", error);\n }\n }\n\n function clearContainer() {\n Object.keys(containerInstances).forEach((pos) => {\n if (containerInstances[pos as NotificationPosition]) {\n unmountComponent(pos as NotificationPosition);\n }\n });\n }\n\n function getInstanceByPosition(position: NotificationPosition): App<Element> | undefined {\n return containerInstances[position];\n }\n\n return {\n saveInstance,\n unmountComponent,\n clearContainer,\n getInstanceByPosition,\n };\n}\n","import { createApp, nextTick, reactive, ref, Ref } from \"vue\";\nimport {\n NotificationOptions,\n NotificationPosition,\n NotificationContainerStateKey,\n} from \"@core/notifications/toast-types\";\nimport { useInstance } from \"@shell/_internal/notifications/composables/useInstance\";\nimport * as _ from \"lodash-es\";\nimport { generateId, createLogger } from \"@core/utilities\";\nimport { i18n } from \"@core/plugins/i18n\";\n\nconst logger = createLogger(\"notification-container\");\n\ninterface IUseContainer {\n defaultOptions: NotificationOptions;\n notificationContainers: Record<NotificationPosition, Ref<NotificationOptions[]>>;\n actions: {\n add(options: NotificationOptions): void;\n remove(id: string | number): void;\n clear(): void;\n dismiss(notificationId: string | number): void;\n update(option: NotificationOptions): void;\n setPosition(position: NotificationPosition): void;\n };\n getAllNotifications(): NotificationOptions[];\n getNotificationsByPosition(position: NotificationPosition): NotificationOptions[];\n appendInstance(options: NotificationOptions): void;\n generateNotificationId(): string;\n getNotification(notificationId: string | number): NotificationOptions | undefined;\n hasNotification(notificationId: string | number): boolean;\n}\n\n// Create containers for each position\nconst notificationContainers: Record<NotificationPosition, Ref<NotificationOptions[]>> = {\n \"top-center\": ref([]),\n \"top-right\": ref([]),\n \"top-left\": ref([]),\n \"bottom-center\": ref([]),\n \"bottom-right\": ref([]),\n \"bottom-left\": ref([]),\n};\n\nconst { clearContainer, unmountComponent, saveInstance, getInstanceByPosition } = useInstance();\n\nexport function useContainer(): IUseContainer {\n const defaultOptions = reactive<NotificationOptions>({\n timeout: 3000,\n pauseOnHover: true,\n position: \"top-center\",\n });\n\n function getAllNotifications() {\n // Combine notifications from all positions\n return Object.values(notificationContainers).flatMap((container) => container.value);\n }\n\n function getNotificationsByPosition(position: NotificationPosition) {\n return notificationContainers[position].value;\n }\n\n function getNotification(notificationId: string | number) {\n return getAllNotifications().find((item) => item.notificationId === notificationId);\n }\n\n function generateRoot(position: NotificationPosition) {\n const rootInstance = document.querySelector(\".notification\");\n const container = rootInstance || document.createElement(\"div\");\n\n // Check if a container already exists for the specified position\n const positionSelector = `.notification__container[data-position=\"${position}\"]`;\n let renderRoot = document.querySelector(positionSelector) as HTMLElement | null;\n\n // If there is no container for this position, create a new one\n if (!renderRoot) {\n renderRoot = document.createElement(\"div\");\n renderRoot.className = \"notification__container\";\n renderRoot.id = `notification-${position}`;\n renderRoot.setAttribute(\"data-position\", position);\n\n if (!rootInstance) {\n container.className = \"notification\";\n document.body.appendChild(container);\n }\n\n container.appendChild(renderRoot);\n }\n\n return renderRoot;\n }\n\n const pendingMounts = new Map<NotificationPosition, Promise<void>>();\n\n async function appendInstance(options: NotificationOptions) {\n const position = options.position || (defaultOptions.position as NotificationPosition);\n\n // Wait for any in-flight mount for this position to finish first\n const pending = pendingMounts.get(position);\n if (pending) {\n await pending;\n }\n\n if (!getInstanceByPosition(position)) {\n const mountPromise = (async () => {\n const dom = generateRoot(position);\n const { default: NotificationContainer } =\n await import(\"@shell/_internal/notifications/components/notification-container\");\n const instance = createApp(NotificationContainer, {\n ...(options as Record<string, unknown>),\n position,\n });\n // Notifications mount as their own Vue app root, so the main app's plugins\n // aren't inherited — install i18n here so $t works in VcToast and children.\n instance.use(i18n);\n instance.provide(NotificationContainerStateKey, { notificationContainers, actions });\n instance.mount(dom);\n saveInstance(instance, dom.id, position);\n })();\n\n pendingMounts.set(position, mountPromise);\n await mountPromise;\n pendingMounts.delete(position);\n }\n\n nextTick(() => {\n if (options.updateId) {\n actions.update(options);\n } else {\n actions.add(options);\n }\n });\n }\n\n function hasNotification(notificationId: string | number): boolean {\n return getAllNotifications().some((item) => item.notificationId === notificationId);\n }\n\n const actions = {\n add(options: NotificationOptions) {\n const position = options.position || (defaultOptions.position as NotificationPosition);\n const containers = notificationContainers[position];\n const exists = containers.value.find((item) => item.notificationId === options.notificationId);\n\n if (!exists) {\n nextTick(() => {\n containers.value.push(options);\n if (options.onOpen && typeof options?.onOpen === \"function\") {\n options.onOpen(options.payload);\n }\n });\n }\n },\n\n remove(id: string | number) {\n if (id) {\n // Find the notification among all containers\n let notification: NotificationOptions | undefined;\n let positionToRemoveFrom: NotificationPosition | undefined;\n\n // Search in which container the notification is located\n Object.entries(notificationContainers).forEach(([pos, container]) => {\n const found = container.value.find((item) => item.notificationId === id);\n if (found) {\n notification = found;\n positionToRemoveFrom = pos as NotificationPosition;\n }\n });\n\n if (positionToRemoveFrom) {\n // Remove the notification from the corresponding container\n notificationContainers[positionToRemoveFrom].value = notificationContainers[\n positionToRemoveFrom\n ].value.filter((item) => item.notificationId !== id);\n\n // If container is empty, unmount it\n if (notificationContainers[positionToRemoveFrom].value.length === 0) {\n unmountComponent(positionToRemoveFrom);\n }\n\n // Call the onClose callback\n nextTick(() => {\n if (notification?.onClose && typeof notification?.onClose === \"function\") {\n notification.onClose(notification.payload);\n }\n });\n }\n }\n },\n\n clear() {\n clearContainer();\n // Clear all containers\n Object.values(notificationContainers).forEach((container) => {\n container.value = [];\n });\n },\n\n dismiss(notificationId: string | number) {\n if (!notificationId) return;\n\n // Mark the notification as dismissing — VcToast watches this flag\n // and handles its own exit animation, then emits 'close' when done.\n let found = false;\n Object.values(notificationContainers).forEach((container) => {\n container.value.forEach((item) => {\n if (item.notificationId === notificationId) {\n item.dismissing = true;\n found = true;\n }\n });\n });\n\n // If notification wasn't found (already removed or never existed), no-op\n if (!found) {\n logger.debug(`dismiss: notification ${notificationId} not found`);\n }\n },\n\n update(option: NotificationOptions) {\n if (option.updateId) {\n // Find the notification across all containers\n let notification: NotificationOptions | undefined;\n let containerToUpdate: Ref<NotificationOptions[]> | undefined;\n let containerPosition: NotificationPosition | undefined;\n\n // First check all containers\n Object.entries(notificationContainers).forEach(([pos, container]) => {\n const found = container.value.find((item) => item.notificationId === option.notificationId);\n if (found) {\n notification = found;\n containerToUpdate = container;\n containerPosition = pos as NotificationPosition;\n }\n });\n\n // If we found the notification and container to update\n if (notification && containerToUpdate) {\n logger.debug(`Updating notification ${option.notificationId} in position ${containerPosition}`);\n\n // If the position changes, move the notification between containers\n if (option.position && option.position !== containerPosition) {\n // Remove from current container\n containerToUpdate.value = containerToUpdate.value.filter(\n (item) => item.notificationId !== option.notificationId,\n );\n\n // Create updated notification with new properties\n const updatedNotification = {\n ...notification,\n ...option,\n };\n\n // Define target position\n const targetPosition = option.position;\n\n // Check if a container already exists for the target position\n if (!getInstanceByPosition(targetPosition)) {\n // If no container exists for the target position, create a new one\n logger.debug(`Creating new container for position ${targetPosition}`);\n appendInstance(updatedNotification);\n } else {\n // If a container exists for the target position, add the updated notification\n logger.debug(`Adding to existing container for position ${targetPosition}`);\n notificationContainers[targetPosition].value.push(updatedNotification);\n }\n } else {\n // Standard update of notification properties\n logger.debug(`Standard update of notification properties`);\n\n // Apply all new properties from option to notification\n Object.keys(option).forEach((key) => {\n if (key !== \"updateId\" && key !== \"notificationId\") {\n const propKey = key as keyof NotificationOptions;\n const propValue = option[propKey];\n\n // Safely assign property\n if (notification && propValue !== undefined) {\n // Use explicit type casting instead of any\n (notification as Record<keyof NotificationOptions, unknown>)[propKey] = propValue;\n }\n }\n });\n }\n\n return true;\n } else {\n logger.warn(`Notification with ID ${option.notificationId} not found for update`);\n return false;\n }\n }\n\n return false;\n },\n\n setPosition(position: NotificationPosition) {\n if (position) {\n defaultOptions.position = position;\n }\n },\n };\n\n return {\n defaultOptions,\n notificationContainers,\n actions,\n getAllNotifications,\n getNotificationsByPosition,\n appendInstance,\n getNotification,\n generateNotificationId: generateId,\n hasNotification,\n };\n}\n","import { setNotificationBackend } from \"@core/notifications/notification\";\nimport { useContainer } from \"@shell/_internal/notifications/composables/useContainer\";\n\n/**\n * Registers the shell notification backend (useContainer) with the core notification API.\n * Called once during framework initialization.\n */\nexport function registerNotificationBackend(): void {\n const container = useContainer();\n setNotificationBackend({\n defaultOptions: container.defaultOptions,\n actions: container.actions,\n getAllNotifications: container.getAllNotifications,\n appendInstance: container.appendInstance,\n getNotification: (id) => container.getNotification(id),\n hasNotification: (id) => container.hasNotification(id),\n });\n}\n","import { version as frameworkVersion } from \"../../package.json\";\n\n/**\n * `version` is read statically from the framework's `package.json`, so it is\n * always accurate — both in a built/published framework AND when the framework\n * is consumed from source (Storybook, dev server, Vitest).\n *\n * `buildDate` and `gitHash` are injected by Vite `define` in\n * `framework/vite.config.mts` during `vite build` of the framework. In source\n * contexts the `define` is not applied; `typeof <undeclared>` returns\n * `\"undefined\"` without throwing a ReferenceError, so they fall back to \"dev\".\n */\nexport interface IFrameworkBuildInfo {\n version: string;\n buildDate: string;\n gitHash: string;\n}\n\nexport function getFrameworkBuildInfo(): IFrameworkBuildInfo {\n return {\n version: frameworkVersion,\n buildDate: typeof __VC_SHELL_BUILD_DATE__ !== \"undefined\" ? __VC_SHELL_BUILD_DATE__ : \"dev\",\n gitHash: typeof __VC_SHELL_GIT_HASH__ !== \"undefined\" ? __VC_SHELL_GIT_HASH__ : \"dev\",\n };\n}\n\nexport function logFrameworkBuildInfo(info: IFrameworkBuildInfo = getFrameworkBuildInfo()): void {\n // Direct console.warn (not console.log, not the logger util): the %c CSS styling\n // is not supported by the logger abstraction, and this banner must always print.\n // console.warn is used deliberately — app production builds mark console.log/info/debug\n // as `pure` in esbuild (see vite.application.appconfig.ts), which strips this banner\n // during dead-code elimination. console.warn survives that pass.\n console.warn(\n `%c@vc-shell/framework%c v${info.version} · ${info.buildDate} · ${info.gitHash}`,\n \"font-weight:bold;color:#319ED4\",\n \"color:inherit\",\n );\n}\n","<template>\n <template v-if=\"isSidebarVisible\">\n <VcSidebar\n :model-value=\"true\"\n :position=\"position\"\n :title=\"title\"\n :close-button=\"closeCross\"\n :teleport=\"!isDesktop\"\n @update:model-value=\"onModelUpdate\"\n >\n <template\n v-if=\"$slots.header\"\n #header=\"{ close }\"\n >\n <slot\n name=\"header\"\n :close=\"close\"\n />\n </template>\n\n <slot name=\"content\" />\n </VcSidebar>\n </template>\n\n <template v-else>\n <slot name=\"content\" />\n </template>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from \"vue\";\nimport { VcSidebar } from \"@ui/components/organisms/vc-sidebar\";\nimport { useResponsive } from \"@framework/core/composables/useResponsive\";\n\nexport interface Props {\n position?: \"left\" | \"right\";\n render?: \"always\" | \"mobile\" | \"desktop\";\n isExpanded: boolean;\n title?: string;\n closeCross?: boolean;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n position: \"right\",\n render: \"always\",\n closeCross: true,\n});\n\nconst emit = defineEmits<{\n (event: \"close\"): void;\n}>();\n\ndefineSlots<{\n header?: (args: { close: () => void }) => unknown;\n content?: () => unknown;\n}>();\n\nconst { isMobile, isDesktop } = useResponsive();\n\nconst renderMatchesViewport = computed(() => {\n if (props.render === \"always\") {\n return true;\n }\n\n if (props.render === \"mobile\") {\n return isMobile.value;\n }\n\n return isDesktop.value;\n});\n\nconst isSidebarVisible = computed(() => props.isExpanded && renderMatchesViewport.value);\n\nfunction onModelUpdate(value: boolean) {\n if (!value) {\n emit(\"close\");\n }\n}\n</script>\n","import SidebarComponent from \"@shell/components/sidebar/sidebar.vue\";\n\n/**\n * @deprecated Use `VcSidebar` from `framework/ui/components` instead.\n * This wrapper is kept for backward compatibility and may be removed in a future release.\n */\nexport const Sidebar = SidebarComponent;\n","<template>\n <VcButton\n variant=\"secondary\"\n class=\"vc-external-provider\"\n @click=\"$emit('signIn')\"\n >\n <div class=\"tw-flex tw-flex-row tw-items-center tw-gap-2\">\n <VcImage\n :src=\"processedLogo\"\n class=\"vc-external-provider__icon\"\n size=\"xxs\"\n />{{ displayName }}\n </div>\n </VcButton>\n</template>\n\n<script lang=\"ts\" setup>\nimport { VcButton } from \"@ui/components/atoms/vc-button\";\nimport { VcImage } from \"@ui/components/atoms/vc-image\";\nimport { computed } from \"vue\";\n\nexport interface Props {\n logo: string | undefined;\n displayName: string | undefined;\n authenticationType: string | undefined;\n}\n\nexport interface Emits {\n (event: \"signIn\"): void;\n}\n\nconst props = defineProps<Props>();\ndefineEmits<Emits>();\n\nconst processedLogo = computed(() => {\n if (props.logo && !props.logo.startsWith(\"data:image\") && !props.logo.startsWith(\"http\")) {\n return new URL(props.logo, window.location.origin).toString();\n }\n return props.logo;\n});\n</script>\n\n<style lang=\"scss\">\n.vc-external-provider {\n &__icon {\n @apply tw-flex-shrink-0;\n }\n}\n</style>\n","<template>\n <div class=\"tw-flex tw-justify-center tw-flex-col tw-gap-4\">\n <ExternalProvider\n v-for=\"provider in providers\"\n :key=\"provider.authenticationType\"\n :logo=\"provider.logoUrl\"\n :display-name=\"provider.displayName\"\n :authentication-type=\"provider.authenticationType\"\n @sign-in=\"signIn(provider.authenticationType)\"\n />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ExternalSignInProviderInfo } from \"@core/api/platform\";\nimport { useExternalProvider } from \"@shell/auth/sign-in/useExternalProvider\";\nimport { default as ExternalProvider } from \"@shell/auth/sign-in/external-provider.vue\";\n\nexport interface Props {\n providers: ExternalSignInProviderInfo[];\n}\n\ndefineProps<Props>();\n\nconst { signIn } = useExternalProvider();\n</script>\n","/**\n * Validates and sanitizes a post-login redirect path.\n * Prevents open-redirect attacks by rejecting non-relative URLs.\n */\nexport function resolveSafeRedirectPath(candidate: string | null): string {\n if (!candidate) return \"/\";\n const redirectPath = candidate.trim();\n if (!redirectPath.startsWith(\"/\") || redirectPath.startsWith(\"//\")) {\n return \"/\";\n }\n return redirectPath;\n}\n\n/** Minimal translate function shape (compatible with vue-i18n's `t`). */\ntype TranslateFn = (key: string, named?: Record<string, unknown>) => string;\n\n/**\n * Maps a sign-in result to a user-facing, localized error message.\n * Takes the `t` function so the util stays pure and testable.\n */\nexport function formatSignInError(result: { status?: number; error?: string }, t: TranslateFn): string {\n if (result.status === 401) {\n return t(\"LOGIN.ERRORS.INVALID_CREDENTIALS\");\n }\n if (result.status) {\n return t(\"LOGIN.ERRORS.AUTH_WITH_CODE\", { code: result.status });\n }\n if (result.error) {\n return t(\"LOGIN.ERRORS.AUTH_GENERIC\", { detail: result.error });\n }\n return t(\"LOGIN.ERRORS.INVALID_CREDENTIALS\");\n}\n\nexport interface PasswordClientError {\n code: string;\n}\n\n/**\n * Performs client-side password change validation.\n * Returns additional error codes to append to server-side validation results.\n */\nexport function validatePasswordChange(fields: {\n password: string;\n confirmPassword: string;\n currentPassword: string;\n}): PasswordClientError[] {\n const errors: PasswordClientError[] = [];\n if (fields.confirmPassword !== fields.password) {\n errors.push({ code: \"Repeat-password\" });\n }\n if (fields.password === fields.currentPassword && fields.confirmPassword === fields.currentPassword) {\n errors.push({ code: \"Equal-passwords\" });\n }\n return errors;\n}\n","<template>\n <VcAuthLayout\n :logo=\"customization.logo\"\n :background=\"background\"\n :title=\"title || $t('LOGIN.TITLE')\"\n :subtitle=\"subtitle || $t('LOGIN.SUBTITLE')\"\n class=\"vc-login-page\"\n >\n <!-- SSO Providers -->\n <div\n v-if=\"loginProviders && loginProviders.length\"\n class=\"vc-login-page__providers\"\n >\n <ExternalProviders :providers=\"loginProviders\" />\n\n <div\n v-if=\"!ssoOnly\"\n class=\"vc-login-page__separator-line\"\n >\n {{ $t(\"LOGIN.OR\") }}\n </div>\n </div>\n\n <!-- SSO-only error: no providers configured -->\n <VcHint\n v-if=\"ssoOnly && providersLoaded && !loginProviders?.length\"\n class=\"tw-mt-4 tw-text-danger-500\"\n >\n {{ $t(\"LOGIN.SSO_NO_PROVIDERS_ERROR\") }}\n </VcHint>\n\n <template v-if=\"!ssoOnly\">\n <VcForm\n class=\"tw-gap-5\"\n @submit=\"login\"\n >\n <Field\n v-slot=\"{ errorMessage, handleChange, errors }\"\n :label=\"$t('LOGIN.FIELDS.LOGIN.LABEL')\"\n name=\"username\"\n :model-value=\"form.username\"\n rules=\"required\"\n >\n <VcInput\n ref=\"loginField\"\n v-model=\"form.username\"\n :label=\"$t('LOGIN.FIELDS.LOGIN.LABEL')\"\n :placeholder=\"$t('LOGIN.FIELDS.LOGIN.PLACEHOLDER')\"\n autocomplete=\"username\"\n required\n :error=\"!!errors.length\"\n :error-message=\"errorMessage\"\n @update:model-value=\"handleChange\"\n />\n </Field>\n\n <Field\n v-slot=\"{ errorMessage, handleChange, errors }\"\n :label=\"$t('LOGIN.FIELDS.PASSWORD.LABEL')\"\n name=\"password\"\n :model-value=\"form.password\"\n rules=\"required\"\n >\n <VcInput\n ref=\"passwordField\"\n v-model=\"form.password\"\n :label=\"$t('LOGIN.FIELDS.PASSWORD.LABEL')\"\n :placeholder=\"$t('LOGIN.FIELDS.PASSWORD.PLACEHOLDER')\"\n type=\"password\"\n autocomplete=\"current-password\"\n required\n :error=\"!!errors.length\"\n :error-message=\"errorMessage\"\n @keyup.enter=\"login\"\n @update:model-value=\"handleChange\"\n />\n </Field>\n\n <VcButton\n variant=\"primary\"\n class=\"tw-w-full\"\n icon=\"lucide-log-in\"\n :disabled=\"!isValid\"\n :loading=\"loading\"\n @click=\"login\"\n >\n {{ $t(\"LOGIN.BUTTON\") }}\n </VcButton>\n\n <VcButton\n variant=\"link\"\n class=\"tw-w-full tw-justify-center\"\n type=\"button\"\n @click=\"goToForgotPassword\"\n >\n {{ $t(\"LOGIN.FORGOT_PASSWORD_BUTTON\") }}\n </VcButton>\n </VcForm>\n\n <!-- Plugin extension point -->\n <ExtensionPoint\n name=\"auth:after-form\"\n separator\n separator-class=\"tw-border-t tw-border-[color:var(--login-separator)] tw-border-solid tw-pb-5\"\n wrapper-class=\"vc-login-page__separator\"\n />\n\n <VcHint\n v-if=\"!signInResult.succeeded\"\n class=\"tw-mt-4 tw-text-danger-500\"\n >\n {{ signInResult.error }}\n </VcHint>\n </template>\n </VcAuthLayout>\n</template>\n\n<!-- eslint-disable @typescript-eslint/no-explicit-any -->\n<script lang=\"ts\" setup>\nimport { ref, reactive, computed, onMounted, type Ref } from \"vue\";\nimport { useRouter } from \"vue-router\";\nimport { useIsFormValid, Field, useForm } from \"vee-validate\";\nimport { useSettings } from \"@core/composables\";\nimport { useUserManagement } from \"@core/composables/useUserManagement\";\nimport { ExternalSignInProviderInfo, SignInResult } from \"@core/api/platform\";\nimport { default as ExternalProviders } from \"@shell/auth/sign-in/external-providers.vue\";\nimport { useExternalProvider } from \"@shell/auth/sign-in/useExternalProvider\";\nimport { resolveSafeRedirectPath, formatSignInError } from \"@shell/auth/utils\";\nimport { useI18n } from \"vue-i18n\";\nimport { ExtensionPoint } from \"@core/plugins/extension-points\";\nimport { createLogger } from \"@core/utilities\";\nimport { VcAuthLayout, VcButton, VcForm, VcHint, VcInput } from \"@ui/components\";\n\nconst logger = createLogger(\"login-page\");\n\nexport interface Props {\n logo?: string;\n background?: string;\n title?: string;\n subtitle?: string;\n ssoOnly?: boolean;\n}\n\nconst props = defineProps<Props>();\n\nconst { t } = useI18n({ useScope: \"global\" });\nconst router = useRouter();\n\nconst { validateField } = useForm({ validateOnMount: false });\nconst { uiSettings, loading: customizationLoading } = useSettings();\nconst signInResult = ref({ succeeded: true }) as Ref<SignInResult & { status?: number; error?: any }>;\nconst { signIn, loading, user } = useUserManagement();\nconst { getProviders } = useExternalProvider();\nconst isValid = useIsFormValid();\nconst loginProviders = ref<ExternalSignInProviderInfo[]>();\nconst providersLoaded = ref(false);\n\nonMounted(async () => {\n loginProviders.value = await getProviders();\n providersLoaded.value = true;\n});\n\nconst customization = computed(() => ({\n logo: !customizationLoading.value ? uiSettings.value?.logo || props.logo : \"\",\n}));\n\nconst form = reactive({\n username: \"\",\n password: \"\",\n});\n\nconst login = async () => {\n if (!isValid.value) return;\n\n signInResult.value.error = \"\";\n signInResult.value = (await signIn(form.username, form.password)) as SignInResult & {\n status?: number;\n error?: any;\n };\n\n if (signInResult.value.succeeded && user.value?.passwordExpired) {\n await router.push({ name: \"ChangePassword\" });\n return;\n }\n\n if (signInResult.value.succeeded) {\n const redirectTo = resolveSafeRedirectPath(localStorage.getItem(\"redirectAfterLogin\"));\n localStorage.removeItem(\"redirectAfterLogin\");\n await router.push(redirectTo);\n return;\n }\n\n // Error handling\n signInResult.value.error = formatSignInError(signInResult.value, t);\n\n form.password = \"\";\n validateField(\"password\");\n};\n\nconst goToForgotPassword = () => {\n router.push({ name: \"ForgotPassword\" });\n};\n\nlogger.debug(\"Init login-page\");\n</script>\n\n<style lang=\"scss\">\n:root {\n --login-separator: var(--secondary-200);\n --login-separator-text: var(--neutrals-400);\n}\n\n.vc-login-page {\n &__separator {\n @apply tw-mt-5;\n }\n\n &__separator-line {\n @apply tw-flex tw-items-center tw-text-center tw-text-xs tw-text-[color:var(--login-separator-text)]\n before:tw-content-[''] before:tw-flex-1 before:tw-border-b before:tw-border-b-[color:var(--login-separator)] before:tw-mr-3\n after:tw-content-[''] after:tw-flex-1 after:tw-border-b after:tw-border-b-[color:var(--login-separator)] after:tw-ml-3;\n @apply tw-my-4;\n }\n}\n</style>\n","import _Login from \"@shell/auth/LoginPage/components/login/Login.vue\";\r\n\r\nexport const Login = _Login as typeof _Login;\r\n","<template>\n <VcAuthLayout\n :logo=\"customization.logo\"\n :background=\"background\"\n :title=\"forgotPasswordRequestSent ? t('FORGOT_PASSWORD.SUCCESS_TITLE') : t('FORGOT_PASSWORD.TITLE')\"\n :subtitle=\"forgotPasswordRequestSent ? undefined : t('FORGOT_PASSWORD.SUBTITLE')\"\n >\n <!-- Request form -->\n <template v-if=\"!forgotPasswordRequestSent\">\n <VcForm @submit=\"forgot\">\n <Field\n v-slot=\"{ errorMessage, handleChange, errors }\"\n :label=\"t('FORGOT_PASSWORD.FIELDS.EMAIL.LABEL')\"\n name=\"loginOrEmail\"\n :model-value=\"form.loginOrEmail\"\n rules=\"required|email\"\n >\n <VcInput\n ref=\"emailField\"\n v-model=\"form.loginOrEmail\"\n class=\"tw-mb-6\"\n :label=\"t('FORGOT_PASSWORD.FIELDS.EMAIL.LABEL')\"\n :placeholder=\"t('FORGOT_PASSWORD.FIELDS.EMAIL.PLACEHOLDER')\"\n required\n :error=\"!!errors.length\"\n :error-message=\"errorMessage\"\n @update:model-value=\"handleChange\"\n />\n </Field>\n\n <VcButton\n variant=\"primary\"\n class=\"tw-w-full tw-mb-4\"\n :disabled=\"!isValid || loading\"\n :loading=\"loading\"\n @click=\"forgot\"\n >\n {{ t(\"FORGOT_PASSWORD.SEND_BUTTON\") }}\n </VcButton>\n\n <div class=\"tw-text-center\">\n <VcButton\n variant=\"link\"\n icon=\"lucide-arrow-left\"\n icon-size=\"xs\"\n type=\"button\"\n @click=\"goBack\"\n >\n {{ t(\"FORGOT_PASSWORD.BACK_TO_LOGIN\") }}\n </VcButton>\n </div>\n </VcForm>\n\n <VcHint\n v-if=\"error\"\n class=\"tw-mt-3 tw-text-danger-500\"\n >\n {{ error }}\n </VcHint>\n </template>\n\n <!-- Success state -->\n <template v-else>\n <div class=\"tw-text-center tw-mb-6\">\n <p class=\"tw-text-sm tw-text-neutrals-600\">\n {{ t(\"FORGOT_PASSWORD.SUCCESS_TEXT\", { email: maskedEmail }) }}\n </p>\n </div>\n\n <VcButton\n variant=\"primary\"\n class=\"tw-w-full\"\n @click=\"goBack\"\n >\n {{ t(\"FORGOT_PASSWORD.BACK_TO_LOGIN\") }}\n </VcButton>\n </template>\n </VcAuthLayout>\n</template>\n\n<script lang=\"ts\" setup>\nimport { ref, reactive, computed } from \"vue\";\nimport { useRouter } from \"vue-router\";\nimport { useIsFormValid, Field, useForm } from \"vee-validate\";\nimport { useSettings } from \"@core/composables\";\nimport { useUserManagement } from \"@core/composables/useUserManagement\";\nimport { useI18n } from \"vue-i18n\";\nimport { VcAuthLayout, VcButton, VcForm, VcHint, VcInput } from \"@ui/components\";\n\ntype ForgotPasswordFunc = (args: { loginOrEmail: string }) => Promise<void>;\n\nexport interface Props {\n logo?: string;\n background?: string;\n composable?: () => { forgotPassword: ForgotPasswordFunc };\n}\n\nconst props = defineProps<Props>();\n\nconst router = useRouter();\nconst { t } = useI18n({ useScope: \"global\" });\nuseForm({ validateOnMount: false });\nconst isValid = useIsFormValid();\nconst { uiSettings, loading: customizationLoading } = useSettings();\n\nconst loading = ref(false);\nconst error = ref(\"\");\nconst forgotPasswordRequestSent = ref(false);\n\nconst form = reactive({\n loginOrEmail: \"\",\n});\n\nlet forgotPassword: ForgotPasswordFunc | undefined;\n\nif (props.composable && typeof props.composable === \"function\") {\n const result = props.composable();\n forgotPassword = result.forgotPassword;\n} else {\n const { requestPasswordReset } = useUserManagement();\n forgotPassword = async (args: { loginOrEmail: string }) => {\n await requestPasswordReset(args.loginOrEmail);\n };\n}\n\nconst customization = computed(() => ({\n logo: !customizationLoading.value ? uiSettings.value?.logo || props.logo : \"\",\n}));\n\nconst maskedEmail = computed(() => {\n const email = form.loginOrEmail;\n const [name, domain] = email.split(\"@\");\n if (!name || !domain) return email;\n const masked = name.length > 2 ? name[0] + \"***\" + name[name.length - 1] : name[0] + \"***\";\n return `${masked}@${domain}`;\n});\n\nconst forgot = async () => {\n if (!isValid.value || !forgotPassword) return;\n\n try {\n loading.value = true;\n error.value = \"\";\n await forgotPassword({ loginOrEmail: form.loginOrEmail });\n forgotPasswordRequestSent.value = true;\n } catch (e) {\n error.value = e instanceof Error ? e.message : String(e);\n } finally {\n loading.value = false;\n }\n};\n\nconst goBack = () => {\n router.push({ name: \"Login\" });\n};\n</script>\n","import _ForgotPassword from \"@shell/auth/ForgotPasswordPage/components/forgot-password/ForgotPassword.vue\";\r\n\r\nexport const ForgotPassword = _ForgotPassword as typeof _ForgotPassword;\r\n","<template>\n <VcAuthLayout\n :logo=\"customization.logo\"\n :background=\"background\"\n :title=\"t('PASSWORDRESET.TITLE')\"\n :subtitle=\"t('PASSWORDRESET.SUBTITLE')\"\n >\n <VcLoading\n v-if=\"loading\"\n active\n />\n\n <VcForm>\n <Field\n v-slot=\"{ field, errorMessage, handleChange, errors }\"\n :label=\"t('PASSWORDRESET.FIELDS.PASSWORD.LABEL')\"\n name=\"password\"\n :model-value=\"form.password\"\n rules=\"required\"\n >\n <VcInput\n v-bind=\"field\"\n ref=\"passwordField\"\n v-model=\"form.password\"\n class=\"tw-mb-4\"\n :label=\"t('PASSWORDRESET.FIELDS.PASSWORD.LABEL')\"\n :placeholder=\"t('PASSWORDRESET.FIELDS.PASSWORD.PLACEHOLDER')\"\n type=\"password\"\n autocomplete=\"new-password\"\n :disabled=\"!form.tokenIsValid\"\n required\n :error=\"!!errors.length\"\n :error-message=\"errorMessage\"\n @update:model-value=\"\n (e) => {\n handleChange(e);\n validate();\n }\n \"\n />\n </Field>\n\n <Field\n v-slot=\"{ field, errorMessage, handleChange, errors }\"\n :label=\"t('PASSWORDRESET.FIELDS.CONFIRM_PASSWORD.LABEL')\"\n name=\"confirm_password\"\n :model-value=\"form.confirmPassword\"\n rules=\"required\"\n >\n <VcInput\n v-bind=\"field\"\n ref=\"confirmPasswordField\"\n v-model=\"form.confirmPassword\"\n class=\"tw-mb-6\"\n :label=\"t('PASSWORDRESET.FIELDS.CONFIRM_PASSWORD.LABEL')\"\n :placeholder=\"t('PASSWORDRESET.FIELDS.CONFIRM_PASSWORD.PLACEHOLDER')\"\n :disabled=\"!form.tokenIsValid\"\n type=\"password\"\n autocomplete=\"new-password\"\n required\n :error=\"!!errors.length\"\n :error-message=\"errorMessage\"\n @update:model-value=\"\n (e) => {\n handleChange(e);\n validate();\n }\n \"\n @keyup.enter=\"resetPassword\"\n />\n </Field>\n\n <VcButton\n variant=\"primary\"\n class=\"tw-w-full\"\n :disabled=\"disableButton\"\n :loading=\"loading\"\n @click=\"resetPassword\"\n >\n {{ t(\"PASSWORDRESET.SAVE_PASSWORD\") }}\n </VcButton>\n\n <VcHint\n v-for=\"error in form.errors\"\n :key=\"error\"\n class=\"tw-mt-3 tw-text-danger-500\"\n >\n {{ t(`PASSWORDRESET.ERRORS.${error}`) }}\n </VcHint>\n </VcForm>\n </VcAuthLayout>\n</template>\n\n<script lang=\"ts\" setup>\nimport { reactive, onMounted, computed } from \"vue\";\nimport { useRouter } from \"vue-router\";\nimport { Field, useForm } from \"vee-validate\";\nimport { useSettings } from \"@core/composables\";\nimport { useI18n } from \"vue-i18n\";\nimport { useUserManagement } from \"@core/composables/useUserManagement\";\nimport { VcAuthLayout, VcButton, VcForm, VcHint, VcInput, VcLoading } from \"@ui/components\";\n\nconst props = withDefaults(\n defineProps<{\n userId: string;\n userName: string;\n token: string;\n logo?: string;\n background?: string;\n }>(),\n {\n background: \"/assets/background.jpg\",\n logo: \"/assets/logo-white.svg\",\n },\n);\n\nconst { validateToken, validatePassword, resetPasswordByToken, signIn, loading } = useUserManagement();\nconst router = useRouter();\nconst { t } = useI18n({ useScope: \"global\" });\nconst { validate: veeValidate } = useForm({ validateOnMount: false });\nconst { uiSettings, loading: customizationLoading } = useSettings();\n\nconst form = reactive<{\n isValid: boolean;\n tokenIsValid: boolean;\n errors: string[];\n password: string;\n confirmPassword: string;\n}>({\n isValid: false,\n tokenIsValid: false,\n errors: [],\n password: \"\",\n confirmPassword: \"\",\n});\n\nonMounted(async () => {\n form.tokenIsValid = await validateToken(props.userId, props.token);\n if (!form.tokenIsValid) {\n form.errors.push(\"Invalid-token\");\n }\n});\n\nconst disableButton = computed(() => {\n return loading.value || !form.password || !form.confirmPassword || (!form.isValid && form.tokenIsValid);\n});\n\nconst validate = async () => {\n if (form.tokenIsValid) {\n const errors = (await validatePassword(form.password)).errors;\n form.errors = errors?.map((x) => x.code) as string[];\n if (form.confirmPassword !== form.password) {\n form.errors.push(\"Repeat-password\");\n }\n form.isValid = form.errors.length == 0;\n }\n};\n\nconst resetPassword = async () => {\n const { valid } = await veeValidate();\n if (valid) {\n const result = await resetPasswordByToken(props.userId, form.password, props.token);\n if (result.succeeded) {\n const loginResult = await signIn(props.userName, form.password);\n if (loginResult.succeeded) {\n router.push(\"/\");\n } else {\n form.errors = (\"error\" in loginResult && [loginResult.error as string]) || [];\n }\n } else {\n form.errors = result.errors as string[];\n }\n }\n};\n\nconst customization = computed(() => ({\n logo: !customizationLoading.value ? uiSettings.value?.logo || props.logo : \"\",\n}));\n</script>\n","import _ResetPassword from \"@shell/auth/ResetPasswordPage/components/reset-password/ResetPassword.vue\";\r\n\r\nexport const ResetPassword = _ResetPassword as typeof _ResetPassword;\r\n","<template>\n <VcAuthLayout\n :logo=\"customization.logo\"\n :background=\"background\"\n :title=\"t('INVITATION.TITLE')\"\n :subtitle=\"t('INVITATION.SUBTITLE')\"\n >\n <VcLoading\n v-if=\"loading\"\n active\n />\n\n <VcForm>\n <VcInput\n class=\"tw-mb-4\"\n :label=\"t('INVITATION.FIELDS.EMAIL.LABEL')\"\n :model-value=\"userName\"\n name=\"username\"\n autocomplete=\"username\"\n disabled\n />\n\n <Field\n v-slot=\"{ field, errorMessage, handleChange, errors }\"\n :label=\"t('INVITATION.FIELDS.PASSWORD.LABEL')\"\n :model-value=\"form.password\"\n rules=\"required\"\n name=\"password\"\n >\n <VcInput\n v-bind=\"field\"\n ref=\"passwordField\"\n v-model=\"form.password\"\n class=\"tw-mb-4\"\n :label=\"t('INVITATION.FIELDS.PASSWORD.LABEL')\"\n :placeholder=\"t('INVITATION.FIELDS.PASSWORD.PLACEHOLDER')\"\n type=\"password\"\n autocomplete=\"new-password\"\n :disabled=\"!form.tokenIsValid\"\n :error=\"!!errors.length\"\n :error-message=\"errorMessage\"\n required\n @update:model-value=\"\n (e) => {\n handleChange(e);\n validate();\n }\n \"\n />\n </Field>\n\n <Field\n v-slot=\"{ field, errorMessage, handleChange, errors }\"\n :label=\"t('INVITATION.FIELDS.CONFIRM_PASSWORD.LABEL')\"\n :model-value=\"form.confirmPassword\"\n rules=\"required\"\n name=\"confirm_password\"\n >\n <VcInput\n v-bind=\"field\"\n ref=\"confirmPasswordField\"\n v-model=\"form.confirmPassword\"\n class=\"tw-mb-6\"\n :label=\"t('INVITATION.FIELDS.CONFIRM_PASSWORD.LABEL')\"\n :placeholder=\"t('INVITATION.FIELDS.CONFIRM_PASSWORD.PLACEHOLDER')\"\n :disabled=\"!form.tokenIsValid\"\n type=\"password\"\n autocomplete=\"new-password\"\n :error=\"!!errors.length\"\n :error-message=\"errorMessage\"\n required\n @update:model-value=\"\n (e) => {\n handleChange(e);\n validate();\n }\n \"\n @keyup.enter=\"acceptInvitation\"\n />\n </Field>\n\n <VcButton\n variant=\"primary\"\n class=\"tw-w-full\"\n :disabled=\"loading || !form.isValid || !form.tokenIsValid\"\n :loading=\"loading\"\n @click=\"acceptInvitation\"\n >\n {{ t(\"INVITATION.ACCEPT_INVITATION\") }}\n </VcButton>\n\n <VcHint\n v-for=\"error in form.errors\"\n :key=\"error\"\n class=\"tw-mt-3 tw-text-danger-500\"\n >\n {{ t(`INVITATION.ERRORS.${error}`) }}\n </VcHint>\n </VcForm>\n </VcAuthLayout>\n</template>\n\n<script lang=\"ts\" setup>\nimport { reactive, onMounted, computed } from \"vue\";\nimport { useRouter } from \"vue-router\";\nimport { useIsFormValid, Field, useIsFormDirty, useForm } from \"vee-validate\";\nimport { useSettings } from \"@core/composables\";\nimport { useI18n } from \"vue-i18n\";\nimport { useUserManagement } from \"@core/composables/useUserManagement\";\nimport { VcInput } from \"@ui/components/molecules/vc-input\";\nimport { VcAuthLayout, VcButton, VcForm, VcHint, VcLoading } from \"@ui/components\";\n\nuseForm({ validateOnMount: false });\n\nconst props = withDefaults(\n defineProps<{\n userId: string;\n userName: string;\n token: string;\n logo?: string;\n background?: string;\n }>(),\n {\n background: \"/assets/background.jpg\",\n logo: \"/assets/logo-white.svg\",\n },\n);\n\nconst { validateToken, validatePassword, resetPasswordByToken, signIn, loading } = useUserManagement();\nconst router = useRouter();\nconst { t } = useI18n({ useScope: \"global\" });\nconst isFormValid = useIsFormValid();\nconst isDirty = useIsFormDirty();\nconst { uiSettings, loading: customizationLoading } = useSettings();\n\nconst form = reactive<{\n isValid: boolean;\n tokenIsValid: boolean;\n errors: string[];\n password: string;\n confirmPassword: string;\n}>({\n isValid: false,\n tokenIsValid: false,\n errors: [],\n password: \"\",\n confirmPassword: \"\",\n});\n\nconst isDisabled = computed(() => {\n return !isDirty.value || !isFormValid.value;\n});\n\nonMounted(async () => {\n form.tokenIsValid = await validateToken(props.userId, props.token);\n if (!form.tokenIsValid) {\n form.errors.push(\"Invalid-token\");\n }\n});\n\nconst validate = async () => {\n if (form.tokenIsValid) {\n const errors = (await validatePassword(form.password)).errors;\n form.errors = errors?.map((x) => x.code) as string[];\n if (form.confirmPassword && form.confirmPassword !== form.password) {\n form.errors.push(\"Repeat-password\");\n }\n form.isValid = form.errors.length == 0 && !isDisabled.value;\n }\n};\n\nconst acceptInvitation = async () => {\n const result = await resetPasswordByToken(props.userId, form.password, props.token);\n if (result.succeeded) {\n const result = await signIn(props.userName, form.password);\n if (result.succeeded) {\n router.push(\"/\");\n }\n } else {\n form.errors = result.errors as string[];\n }\n};\n\nconst customization = computed(() => ({\n logo: !customizationLoading.value ? uiSettings.value?.logo || props.logo : \"\",\n}));\n</script>\n","import _Invite from \"@shell/auth/InvitePage/components/invite/Invite.vue\";\r\n\r\nexport const Invite = _Invite as typeof _Invite;\r\n","<template>\n <VcAuthLayout\n :logo=\"customization.logo\"\n :background=\"background\"\n :title=\"forced ? t('COMPONENTS.CHANGE_PASSWORD.TITLE_FORCED') : t('COMPONENTS.CHANGE_PASSWORD.TITLE')\"\n :subtitle=\"forced ? t('COMPONENTS.CHANGE_PASSWORD.SUBTITLE_FORCED') : undefined\"\n >\n <div\n v-if=\"forced\"\n class=\"tw-mb-4\"\n >\n <VcBanner\n variant=\"info\"\n icon=\"lucide-lightbulb\"\n icon-size=\"l\"\n >{{ t(\"COMPONENTS.CHANGE_PASSWORD.FORCED.LABEL\") }}\n </VcBanner>\n </div>\n\n <VcForm>\n <Field\n v-slot=\"{ field, errorMessage, errors }\"\n :label=\"t('COMPONENTS.CHANGE_PASSWORD.CURRENT_PASSWORD.LABEL')\"\n name=\"current\"\n rules=\"required|min:6\"\n :model-value=\"form.currentPassword\"\n >\n <VcInput\n v-bind=\"field\"\n ref=\"passwordField\"\n v-model=\"form.currentPassword\"\n class=\"tw-mb-4\"\n :label=\"t('COMPONENTS.CHANGE_PASSWORD.CURRENT_PASSWORD.LABEL')\"\n :placeholder=\"t('COMPONENTS.CHANGE_PASSWORD.CURRENT_PASSWORD.PLACEHOLDER')\"\n type=\"password\"\n autocomplete=\"current-password\"\n required\n :error=\"!!errors.length\"\n :error-message=\"errorMessage\"\n @update:model-value=\"validateForm\"\n />\n </Field>\n\n <Field\n v-slot=\"{ field, errorMessage, errors }\"\n :label=\"t('COMPONENTS.CHANGE_PASSWORD.NEW_PASSWORD.LABEL')\"\n name=\"new_pass\"\n rules=\"required|min:6\"\n :model-value=\"form.password\"\n >\n <VcInput\n v-bind=\"field\"\n ref=\"newPasswordField\"\n v-model=\"form.password\"\n class=\"tw-mb-4\"\n :label=\"t('COMPONENTS.CHANGE_PASSWORD.NEW_PASSWORD.LABEL')\"\n :placeholder=\"t('COMPONENTS.CHANGE_PASSWORD.NEW_PASSWORD.PLACEHOLDER')\"\n type=\"password\"\n autocomplete=\"new-password\"\n required\n :error=\"!!errors.length\"\n :error-message=\"errorMessage\"\n @update:model-value=\"validateForm\"\n />\n </Field>\n\n <Field\n v-slot=\"{ field, errorMessage, errors }\"\n :label=\"t('COMPONENTS.CHANGE_PASSWORD.CONFIRM_PASSWORD.LABEL')\"\n name=\"confirm_pass\"\n rules=\"required|min:6\"\n :model-value=\"form.confirmPassword\"\n >\n <VcInput\n v-bind=\"field\"\n ref=\"confirmPasswordField\"\n v-model=\"form.confirmPassword\"\n class=\"tw-mb-6\"\n :label=\"t('COMPONENTS.CHANGE_PASSWORD.CONFIRM_PASSWORD.LABEL')\"\n :placeholder=\"t('COMPONENTS.CHANGE_PASSWORD.CONFIRM_PASSWORD.PLACEHOLDER')\"\n type=\"password\"\n autocomplete=\"new-password\"\n required\n :error=\"!!errors.length\"\n :error-message=\"errorMessage\"\n @update:model-value=\"validateForm\"\n />\n </Field>\n\n <div class=\"tw-flex tw-gap-3\">\n <VcButton\n variant=\"secondary\"\n class=\"tw-flex-1\"\n @click=\"cancelChange\"\n >\n {{ t(\"COMPONENTS.CHANGE_PASSWORD.CANCEL\") }}\n </VcButton>\n <VcButton\n variant=\"primary\"\n class=\"tw-flex-1\"\n :disabled=\"loading || !form.isValid || isDisabled\"\n :loading=\"loading\"\n @click=\"changePassword\"\n >\n {{ t(\"COMPONENTS.CHANGE_PASSWORD.SAVE\") }}\n </VcButton>\n </div>\n\n <VcHint\n v-for=\"(err, i) in form.errors\"\n :key=\"i\"\n class=\"tw-mt-3 tw-text-danger-500\"\n >\n {{ (err as IdentityError).code ? t(`COMPONENTS.CHANGE_PASSWORD.ERRORS.${(err as IdentityError).code}`) : err }}\n </VcHint>\n </VcForm>\n </VcAuthLayout>\n</template>\n\n<script lang=\"ts\" setup>\nimport { nextTick, reactive, computed } from \"vue\";\nimport { useIsFormValid, Field, useIsFormDirty, useForm } from \"vee-validate\";\nimport { IdentityError } from \"@core/api/platform\";\nimport { useUserManagement } from \"@core/composables/useUserManagement\";\nimport { useSettings } from \"@core/composables\";\nimport { useI18n } from \"vue-i18n\";\nimport { useRouter } from \"vue-router\";\nimport { VcAuthLayout, VcBanner, VcButton, VcForm, VcHint, VcInput } from \"@ui/components\";\nimport { validatePasswordChange } from \"@shell/auth/utils\";\n\ninterface IChangePassForm {\n isValid: boolean;\n errors: IdentityError[] | string[];\n currentPassword: string;\n password: string;\n confirmPassword: string;\n}\n\nexport interface Props {\n forced?: boolean;\n logo?: string;\n background?: string;\n}\n\nconst props = defineProps<Props>();\n\nconst { t } = useI18n({ useScope: \"global\" });\nconst { changeUserPassword, loading, validatePassword, signOut } = useUserManagement();\nconst { uiSettings, loading: customizationLoading } = useSettings();\n\nconst customization = computed(() => ({\n logo: !customizationLoading.value ? uiSettings.value?.logo || props.logo : \"\",\n}));\nuseForm({ validateOnMount: false });\nconst isValid = useIsFormValid();\nconst isDirty = useIsFormDirty();\nconst router = useRouter();\n\nconst form = reactive<IChangePassForm>({\n isValid: false,\n errors: [],\n currentPassword: \"\",\n password: \"\",\n confirmPassword: \"\",\n});\n\nconst isDisabled = computed(() => {\n return !isDirty.value || !isValid.value;\n});\n\nasync function cancelChange() {\n await signOut();\n await router.push(\"/login\");\n}\n\nasync function changePassword() {\n const result = await changeUserPassword(form.currentPassword, form.password);\n if (result?.succeeded) {\n await router.push(\"/\");\n } else if (result?.errors) {\n form.errors = result?.errors;\n form.isValid = form.errors.length == 0;\n }\n}\n\nfunction validateForm() {\n nextTick(async () => {\n if (form.password || form.confirmPassword) {\n const serverErrors = (await validatePassword(form.password)).errors ?? [];\n const clientErrors = validatePasswordChange({\n password: form.password,\n confirmPassword: form.confirmPassword,\n currentPassword: form.currentPassword,\n });\n form.errors = [...serverErrors, ...clientErrors];\n form.isValid = form.errors.length == 0;\n }\n });\n}\n</script>\n","import _ChangePassword from \"@shell/auth/ChangePasswordPage/components/change-password/ChangePassword.vue\";\n\nexport const ChangePasswordPage = _ChangePassword as typeof _ChangePassword;\n","/**\n * useBladeNavigation adapter — maps the legacy IUseBladeNavigation API\n * onto the new BladeStack + BladeMessaging system.\n *\n * Drop-in replacement for the old useBladeNavigation.\n * Consumer code keeps working; deprecation warnings guide migration.\n */\nimport { computed, getCurrentInstance, inject, warn, Component, ComputedRef, Ref, ref } from \"vue\";\nimport { RouteLocationNormalized, RouteLocationRaw, NavigationFailure } from \"vue-router\";\nimport {\n bladeNavigationInstance as globalBladeNavigationPluginInstanceFallback,\n bladeStackInstance,\n bladeMessagingInstance,\n bladeRegistryInstance,\n} from \"@core/blade-navigation/singletons\";\nimport type { IBladeRegistry as _IBladeRegistry } from \"@core/composables/useBladeRegistry\";\nimport {\n BladeVNode,\n IBladeEvent,\n IParentCallArgs,\n BladeInstanceConstructor,\n BladeDescriptor,\n BladeDescriptorKey,\n} from \"@core/blade-navigation/types\";\nimport { createUrlSync, getTenantPrefix } from \"@core/blade-navigation/utils/urlSync\";\nimport { createLogger } from \"@core/utilities\";\n\nconst logger = createLogger(\"use-blade-navigation-adapter\");\n\n// ── Deprecation helpers ────────────────────────────────────────────────────────\n\nconst _deprecationWarned = new Set<string>();\n\nfunction warnDeprecated(method: string, replacement?: string): void {\n if (_deprecationWarned.has(method)) return;\n _deprecationWarned.add(method);\n const msg = `[useBladeNavigation] \"${method}\" is deprecated.`;\n console.warn(replacement ? `${msg} Use ${replacement} instead.` : msg);\n}\n\n// ── IUseBladeNavigation interface (matches old API) ────────────────────────────\n\nexport interface IUseBladeNavigation {\n readonly blades: ComputedRef<BladeVNode[]>;\n readonly activeWorkspace: ComputedRef<BladeVNode | undefined>;\n readonly currentBladeNavigationData: ComputedRef<BladeVNode[\"props\"][\"navigation\"] | undefined>;\n openBlade: <Blade extends Component>(\n args: IBladeEvent<Blade>,\n isWorkspace?: boolean,\n ) => Promise<void | NavigationFailure>;\n closeBlade: (index: number) => Promise<boolean>;\n goToRoot: () => RouteLocationRaw;\n onParentCall: (args: IParentCallArgs, currentBladeIndex?: number) => void;\n onBeforeClose: (cb: () => Promise<boolean | undefined>) => void;\n resolveBladeByName: (name: string) => BladeInstanceConstructor | undefined;\n routeResolver: (to: RouteLocationNormalized) => Promise<RouteLocationRaw | undefined> | RouteLocationRaw | undefined;\n setNavigationQuery: (query: Record<string, string | number>) => void;\n getNavigationQuery: () => Record<string, string | number> | undefined;\n setBladeError: (bladeIdx: number, error: unknown) => void;\n clearBladeError: (bladeIdx: number) => void;\n}\n\n// ── BladeVNode shim ────────────────────────────────────────────────────────────\n\n/**\n * Creates a minimal BladeVNode-compatible object from a BladeDescriptor.\n * Only satisfies property reads — NOT a real VNode for rendering.\n */\nfunction descriptorToShim(descriptor: BladeDescriptor, index: number, activeId?: string): BladeVNode {\n return {\n props: {\n navigation: {\n idx: index,\n instance: descriptor.title != null ? { title: descriptor.title } : (undefined as any),\n isVisible: descriptor.visible,\n error: ref(descriptor.error ? new Error(String(descriptor.error)) : null) as Ref<Error | null>,\n },\n param: descriptor.param,\n options: descriptor.options,\n expanded: descriptor.id === activeId,\n closable: index > 0,\n },\n type: { name: descriptor.name },\n } as unknown as BladeVNode;\n}\n\n// ── Shared state (module-level, no inject needed) ───────────────────────────────\n// Lazily created computeds cached for all calls to useBladeNavigation().\n// Call _resetAdapterState() in test teardown to prevent cross-test leaks.\n\nlet _blades: ComputedRef<BladeVNode[]> | undefined;\nlet _activeWorkspace: ComputedRef<BladeVNode | undefined> | undefined;\n\n/**\n * Reset adapter's cached computeds. For use in test teardown only.\n * @internal\n */\nexport function _resetAdapterState(): void {\n _blades = undefined;\n _activeWorkspace = undefined;\n _deprecationWarned.clear();\n}\n\nfunction getSharedState() {\n const bladeStack = bladeStackInstance;\n const messaging = bladeMessagingInstance;\n const bladeRegistry = bladeRegistryInstance;\n\n if (!bladeStack || !messaging) {\n throw new Error(\n \"[useBladeNavigation adapter] BladeStack or BladeMessaging not available. \" +\n \"Ensure plugin-v2 is installed before calling useBladeNavigation().\",\n );\n }\n\n const router = globalBladeNavigationPluginInstanceFallback?.router;\n\n if (!router) {\n throw new Error(\"[@vc-shell/framework#useBladeNavigation] Vue Router instance is not available.\");\n }\n\n // Lazily create computeds once\n if (!_blades) {\n _blades = computed<BladeVNode[]>(() => {\n const activeId = bladeStack.activeBlade.value?.id;\n return bladeStack.blades.value.map((d, i) => descriptorToShim(d, i, activeId));\n });\n }\n\n if (!_activeWorkspace) {\n _activeWorkspace = computed<BladeVNode | undefined>(() => {\n const ws = bladeStack.workspace.value;\n if (!ws) return undefined;\n return descriptorToShim(ws, 0, bladeStack.activeBlade.value?.id);\n });\n }\n\n return {\n bladeStack,\n messaging,\n bladeRegistry: bladeRegistry!,\n router,\n blades: _blades,\n activeWorkspace: _activeWorkspace,\n };\n}\n\n// ── Utility: extract blade name from IBladeEvent.blade ─────────────────────────\n\nfunction extractBladeName<Blade extends Component>(blade: IBladeEvent<Blade>[\"blade\"]): string {\n if (!blade) {\n throw new Error(\"Blade cannot be null or undefined.\");\n }\n\n // { name: \"SomeBlade\" } shorthand\n if (typeof blade === \"object\" && \"name\" in blade && typeof (blade as any).name === \"string\") {\n return (blade as any).name;\n }\n\n // Component constructor — extract .name or .__name\n const comp = blade as any;\n return comp.name || comp.__name || \"UnknownBlade\";\n}\n\n// ── Per-caller function ────────────────────────────────────────────────────────\n\nexport function useBladeNavigation(): IUseBladeNavigation {\n const { bladeStack, messaging, bladeRegistry, router, blades, activeWorkspace } = getSharedState();\n\n // Try to get current blade descriptor from the new render layer (VcBladeSlot)\n // Only call inject() when inside a component setup — avoids Vue warning in route guards\n const currentDescriptor = getCurrentInstance() ? inject(BladeDescriptorKey, undefined) : undefined;\n\n // ── URL sync helpers (centralized in urlSync.ts) ────────────────────────────\n\n const { syncUrlPush, syncUrlReplace } = createUrlSync(router, bladeStack);\n\n // ── Helpers ──────────────────────────────────────────────────────────────────\n\n function getCurrentBladeId(): string | undefined {\n if (currentDescriptor) return currentDescriptor.value.id;\n // Fallback: active blade (for app-level code outside any blade)\n return bladeStack.activeBlade.value?.id;\n }\n\n function getBladeIdByIndex(index: number): string | undefined {\n const allBlades = bladeStack.blades.value;\n if (index >= 0 && index < allBlades.length) {\n return allBlades[index].id;\n }\n return undefined;\n }\n\n // ── openBlade ──────────────────────────────────────────────────────────────\n\n async function openBlade<Blade extends Component>(\n args: IBladeEvent<Blade>,\n isWorkspace?: boolean,\n ): Promise<void | NavigationFailure> {\n const name = extractBladeName(args.blade);\n\n const event = {\n name,\n param: args.param,\n options: args.options,\n onOpen: args.onOpen,\n onClose: args.onClose,\n replaceCurrentBlade: args.replaceCurrentBlade,\n };\n\n if (isWorkspace) {\n await bladeStack.openWorkspace(event);\n } else if (args.replaceCurrentBlade) {\n // Legacy replaceCurrentBlade maps to coverCurrentBlade (hide + stack)\n await bladeStack.coverCurrentBlade(event);\n } else {\n const parentId = getCurrentBladeId();\n await bladeStack.openBlade({ ...event, parentId });\n }\n\n // Sync URL only if the opened blade has a URL segment.\n // Blades without URLs (e.g. third-level detail panels) should not\n // change the address bar — the previous blade's URL stays.\n const openedBlade = bladeStack.activeBlade.value;\n if (openedBlade?.url) {\n syncUrlPush();\n }\n }\n\n // ── closeBlade ─────────────────────────────────────────────────────────────\n\n async function closeBlade(index: number): Promise<boolean> {\n warnDeprecated(\"closeBlade(index)\", \"useBlade().closeSelf()\");\n const bladeId = getBladeIdByIndex(index);\n if (!bladeId) {\n logger.error(`closeBlade: No blade found at index ${index}.`);\n return false;\n }\n const prevented = await bladeStack.closeBlade(bladeId);\n if (!prevented) {\n // Blade was closed — sync URL (replace, no new history entry)\n syncUrlReplace();\n }\n return prevented;\n }\n\n // ── goToRoot ───────────────────────────────────────────────────────────────\n\n function goToRoot(): RouteLocationRaw {\n warnDeprecated(\"goToRoot()\");\n\n // Navigate by route name, preserving current params (tenant prefix).\n // Using { path: \"/\" } would drop the tenant prefix from the URL.\n const routes = router.getRoutes();\n const mainRoute = routes.find((r) => r.meta?.root);\n const mainRouteAlias = routes.find((r) => r.aliasOf?.path === mainRoute?.path) || mainRoute;\n\n if (mainRouteAlias?.name) {\n return {\n name: mainRouteAlias.name,\n params: router.currentRoute.value.params,\n };\n }\n\n // Fallback: construct path with tenant prefix\n const tenantPrefix = getTenantPrefix(router);\n return { path: tenantPrefix ? `/${tenantPrefix}` : \"/\" };\n }\n\n // ── onParentCall ───────────────────────────────────────────────────────────\n\n async function onParentCall(args: IParentCallArgs, currentBladeIndex?: number): Promise<void> {\n warnDeprecated(\"onParentCall(args, index)\", \"useBlade().callParent(method, args)\");\n\n let callerId: string | undefined;\n\n if (currentBladeIndex !== undefined) {\n callerId = getBladeIdByIndex(currentBladeIndex);\n } else {\n callerId = getCurrentBladeId();\n }\n\n if (!callerId) {\n logger.error(\"onParentCall: Could not determine caller blade.\");\n return;\n }\n\n try {\n const result = await messaging.callParent(callerId, args.method as string, args.args);\n if (typeof args.callback === \"function\") {\n args.callback(result);\n }\n } catch (error) {\n logger.error(`onParentCall: Failed to call parent method \"${args.method}\":`, error);\n }\n }\n\n // ── onBeforeClose ──────────────────────────────────────────────────────────\n\n function onBeforeClose(cb: () => Promise<boolean | undefined>): void {\n warnDeprecated(\"onBeforeClose(cb)\", \"useBlade().onBeforeClose(guard)\");\n\n const bladeId = getCurrentBladeId();\n if (!bladeId) {\n warn(\"onBeforeClose: Could not determine current blade.\");\n return;\n }\n\n // ⚠️ Guard boolean inversion between legacy and new API:\n // Legacy onBeforeClose: return `false` → PREVENT close; `undefined`/`true` → allow\n // New registerBeforeClose: return `true` → PREVENT close; `false` → allow\n // The adapter inverts the result to bridge the two APIs.\n bladeStack.registerBeforeClose(bladeId, async () => {\n const result = await cb();\n return result === false;\n });\n }\n\n // ── resolveBladeByName ─────────────────────────────────────────────────────\n\n function resolveBladeByName(name: string): BladeInstanceConstructor | undefined {\n return bladeRegistry.getBladeComponent(name) as BladeInstanceConstructor | undefined;\n }\n\n // ── routeResolver (noop — handled by plugin-v2) ────────────────────────────\n\n function routeResolver(_to: RouteLocationNormalized): undefined {\n warnDeprecated(\"routeResolver\", \"plugin-v2 handles URL resolution automatically\");\n return undefined;\n }\n\n // ── setNavigationQuery / getNavigationQuery ────────────────────────────────\n\n function setNavigationQuery(query: Record<string, string | number>): void {\n warnDeprecated(\"setNavigationQuery\");\n\n const ws = bladeStack.workspace.value;\n if (!ws) return;\n\n const prefix = ws.name.toLowerCase();\n const cleanQuery: Record<string, string> = {};\n for (const [k, v] of Object.entries(query)) {\n if (v != null) cleanQuery[`${prefix}_${k}`] = String(v);\n }\n\n router.options.history.replace(\n decodeURIComponent(\n `${window.location.hash.substring(1).split(\"?\")[0]}?${new URLSearchParams(cleanQuery).toString()}`,\n ),\n );\n }\n\n function getNavigationQuery(): Record<string, string | number> | undefined {\n warnDeprecated(\"getNavigationQuery\");\n\n const ws = bladeStack.workspace.value;\n if (!ws) return undefined;\n\n const prefix = ws.name.toLowerCase();\n const urlParams = new URLSearchParams(window.location.hash.split(\"?\")[1] || \"\");\n const result: Record<string, string | number> = {};\n\n for (const [key, value] of urlParams.entries()) {\n if (key.startsWith(`${prefix}_`)) {\n const cleanKey = key.replace(`${prefix}_`, \"\");\n const numValue = Number(value);\n result[cleanKey] = isNaN(numValue) ? value : numValue;\n }\n }\n\n return Object.keys(result).length > 0 ? result : undefined;\n }\n\n // ── Error management ───────────────────────────────────────────────────────\n\n function setBladeError(bladeIdx: number, error: unknown): void {\n const bladeId = getBladeIdByIndex(bladeIdx);\n if (bladeId) {\n bladeStack.setBladeError(bladeId, error);\n }\n }\n\n function clearBladeError(bladeIdx: number): void {\n const bladeId = getBladeIdByIndex(bladeIdx);\n if (bladeId) {\n bladeStack.clearBladeError(bladeId);\n }\n }\n\n // ── currentBladeNavigationData ─────────────────────────────────────────────\n\n const currentBladeNavigationData = computed(() => {\n if (!currentDescriptor) return undefined;\n const d = currentDescriptor.value;\n const allBlades = bladeStack.blades.value;\n const idx = allBlades.findIndex((b) => b.id === d.id);\n return {\n idx,\n instance: d.title != null ? { title: d.title } : (undefined as any),\n isVisible: d.visible,\n error: ref(d.error ? new Error(String(d.error)) : null) as Ref<Error | null>,\n } as BladeVNode[\"props\"][\"navigation\"];\n });\n\n // ── Return ─────────────────────────────────────────────────────────────────\n\n return {\n blades,\n activeWorkspace,\n openBlade,\n closeBlade,\n goToRoot,\n onParentCall,\n onBeforeClose,\n resolveBladeByName,\n routeResolver,\n setNavigationQuery,\n getNavigationQuery,\n setBladeError,\n clearBladeError,\n currentBladeNavigationData,\n };\n}\n","import { ref, computed, provide, toValue, watch, type Ref } from \"vue\";\nimport { useForm } from \"vee-validate\";\nimport { cloneDeep } from \"lodash-es\";\nimport { useBeforeUnload } from \"@core/composables/useBeforeUnload\";\nimport { useBlade } from \"@core/composables/useBlade\";\nimport { usePopup } from \"@core/composables/usePopup\";\nimport { BladeFormKey } from \"@framework/injection-keys\";\nimport type { UseBladeFormOptions, UseBladeFormReturn } from \"./types\";\n\nexport type { UseBladeFormOptions, UseBladeFormReturn, BladeFormInjection } from \"./types\";\n\nfunction isEmptyPrimitive(value: unknown): boolean {\n return value === null || value === undefined || value === \"\";\n}\n\nfunction semanticEqual(a: unknown, b: unknown): boolean {\n // Both empty primitives\n if (isEmptyPrimitive(a) && isEmptyPrimitive(b)) return true;\n // [] ≈ undefined/null (empty array = empty)\n if (isEmptyPrimitive(a) && Array.isArray(b) && b.length === 0) return true;\n if (Array.isArray(a) && a.length === 0 && isEmptyPrimitive(b)) return true;\n\n if (a === b) return true;\n if (typeof a !== typeof b) return false;\n if (typeof a !== \"object\" || a === null || b === null) return false;\n\n if (Array.isArray(a) || Array.isArray(b)) {\n if (!Array.isArray(a) || !Array.isArray(b)) return false;\n if (a.length !== b.length) return false;\n return a.every((item, i) => semanticEqual(item, b[i]));\n }\n\n const aObj = a as Record<string, unknown>;\n const bObj = b as Record<string, unknown>;\n const allKeys = new Set([...Object.keys(aObj), ...Object.keys(bObj)]);\n for (const key of allKeys) {\n if (!semanticEqual(aObj[key], bObj[key])) return false;\n }\n return true;\n}\n\n/**\n * Unified form state management for blades.\n *\n * Encapsulates vee-validate form, modification tracking, browser unload guard,\n * and blade close guard into a single composable with lifecycle-based API.\n *\n * **Must be called from component setup()** — uses provide() internally.\n *\n * Unlike useModificationTracker (which creates a separate currentValue clone),\n * this composable tracks changes directly on the passed `data` ref.\n * The template binds to `data` via v-model — edits go straight into\n * the ref and are detected by a deep watcher against a pristine snapshot.\n */\nexport function useBladeForm<T>(options: UseBladeFormOptions<T>): UseBladeFormReturn {\n const {\n data,\n canSaveOverride,\n autoBeforeClose = true,\n autoBeforeUnload = true,\n closeConfirmMessage,\n onRevert,\n } = options;\n\n // --- vee-validate ---\n const { meta: formMeta, setFieldError, errorBag } = useForm({ validateOnMount: false });\n\n // --- Pristine snapshot tracking ---\n // We track modifications by comparing `data` against a pristine snapshot.\n // Unlike useModificationTracker, there is no separate currentValue clone —\n // the template writes directly into `data`, and the deep watcher detects changes.\n const pristineSnapshot = ref(cloneDeep(data.value)) as Ref<T>;\n const trackerIsModified = ref(false);\n\n watch(\n data,\n (newVal) => {\n if (isReady.value) {\n trackerIsModified.value = !semanticEqual(newVal, pristineSnapshot.value);\n }\n },\n { deep: true },\n );\n\n // --- Readiness gate ---\n const isReady = ref(false);\n\n const isModified = computed(() => isReady.value && trackerIsModified.value);\n\n const canSave = computed(() => {\n if (!isReady.value) return false;\n if (!formMeta.value.valid) return false;\n if (!trackerIsModified.value) return false;\n if (canSaveOverride && !canSaveOverride.value) return false;\n return true;\n });\n\n // --- Lifecycle methods ---\n function setBaseline(): void {\n pristineSnapshot.value = cloneDeep(data.value) as T;\n trackerIsModified.value = false;\n isReady.value = true;\n }\n\n /**\n * Mark the form as ready without resetting the pristine snapshot.\n *\n * Unlike `setBaseline()`, this does NOT overwrite the pristine snapshot.\n * Instead it compares current `data` against the snapshot taken at setup time\n * and sets `trackerIsModified` accordingly.\n *\n * Use when data was programmatically pre-filled (e.g. \"create from template\")\n * and should appear as modified immediately so the save button is enabled.\n */\n function markReady(): void {\n isReady.value = true;\n trackerIsModified.value = !semanticEqual(data.value, pristineSnapshot.value);\n }\n\n function revert(): void | Promise<void> {\n if (onRevert) {\n return onRevert();\n }\n data.value = cloneDeep(pristineSnapshot.value);\n }\n\n // --- Auto guards ---\n if (autoBeforeUnload) {\n useBeforeUnload(isModified);\n }\n\n if (autoBeforeClose !== false) {\n const { onBeforeClose } = useBlade();\n const { showConfirmation } = usePopup();\n\n onBeforeClose(async () => {\n let shouldGuard: boolean;\n\n if (typeof autoBeforeClose === \"object\") {\n // ComputedRef<boolean> — custom condition AND isModified\n shouldGuard = autoBeforeClose.value && isModified.value;\n } else {\n // true (default) — guard based on isModified only\n shouldGuard = isModified.value;\n }\n\n if (shouldGuard) {\n const message = closeConfirmMessage\n ? toValue(closeConfirmMessage)\n : \"You have unsaved changes. Are you sure you want to leave?\";\n return !(await showConfirmation(message));\n }\n return false;\n });\n }\n\n // --- Provide for VcBlade auto-integration ---\n provide(BladeFormKey, { isModified, canSave });\n\n return {\n setBaseline,\n markReady,\n revert,\n canSave,\n isModified,\n isReady: computed(() => isReady.value),\n formMeta,\n setFieldError,\n errorBag,\n };\n}\n","/**\n * Pure layout math for the toast stack. No Vue imports — deterministic given\n * the toast ids, their measured heights, and the expanded flag. Extracted from\n * NotificationContainer so the geometry can be unit-tested in isolation and the\n * component is left with only wiring + render.\n */\n\nexport const GAP = 14;\nexport const VISIBLE_TOASTS = 3;\n\nexport interface ToastLayout {\n /** Number of toasts stacked in front of this one (0 = front/newest). */\n sonnerIndex: number;\n /** CSS `--z-index`: front toast is highest. */\n zIndex: number;\n /** Vertical offset in px (sum of newer toast heights + gap * sonnerIndex). */\n offset: number;\n /** This toast's measured height in px (0 when not yet reported). */\n initialHeight: number;\n}\n\nexport interface ToastStackLayout {\n /** Per-toast layout, in the same order as the input `ids`. */\n toasts: ToastLayout[];\n /** Height of the front (newest) toast in px. */\n frontHeight: number;\n /** Total height of the group element in px. */\n groupHeight: number;\n}\n\n/**\n * @param ids toast ids, oldest → newest (array order matches the source list)\n * @param heights map of toast id → measured height in px\n * @param isExpanded whether the stack is expanded (hover / single toast)\n */\nexport function computeToastOffsets(\n ids: (string | number | undefined)[],\n heights: Map<string | number, number>,\n isExpanded: boolean,\n): ToastStackLayout {\n const count = ids.length;\n\n const heightOf = (id: string | number | undefined): number => (id !== undefined ? heights.get(id) || 0 : 0);\n\n // Front toast = newest = last in array\n const frontToastId = count > 0 ? ids[count - 1] : undefined;\n const frontHeight = heightOf(frontToastId);\n\n const toasts: ToastLayout[] = ids.map((id, arrayIndex) => {\n // sonnerIndex: 0 = front/newest, higher = older/back\n const sonnerIndex = count - 1 - arrayIndex;\n\n // Expanded offset: sum heights of newer toasts + gap * sonnerIndex\n let heightSum = 0;\n for (let i = arrayIndex + 1; i < count; i++) {\n heightSum += heightOf(ids[i]);\n }\n const offset = sonnerIndex * GAP + heightSum;\n\n return {\n sonnerIndex,\n zIndex: count - sonnerIndex,\n offset,\n initialHeight: heightOf(id),\n };\n });\n\n let groupHeight: number;\n if (isExpanded && count > 1) {\n // Expanded: offset of oldest toast + its height\n const oldestSonnerIdx = count - 1;\n let hSum = 0;\n for (let i = 1; i < count; i++) {\n hSum += heightOf(ids[i]);\n }\n const oldestOffset = oldestSonnerIdx * GAP + hSum;\n const oldestHeight = heightOf(ids[0]);\n groupHeight = oldestOffset + oldestHeight;\n } else {\n // Collapsed: front toast height + visible back toasts gap\n groupHeight = frontHeight + Math.min(count - 1, VISIBLE_TOASTS - 1) * GAP;\n }\n\n return { toasts, frontHeight, groupHeight };\n}\n","import { reactive, ref } from \"vue\";\n\n/**\n * Expand/collapse state machine + height tracking for the toast stack.\n * Extracted from NotificationContainer so the timer-driven behaviour can be\n * unit-tested with fake timers, leaving the component with only layout + render.\n */\nexport function useToastStack() {\n const expanded = ref(false);\n const interacting = ref(false);\n let collapseTimer: ReturnType<typeof setTimeout> | null = null;\n\n function expandStack() {\n if (collapseTimer) {\n clearTimeout(collapseTimer);\n collapseTimer = null;\n }\n expanded.value = true;\n }\n\n function collapseStack() {\n if (interacting.value) return;\n collapseTimer = setTimeout(() => {\n expanded.value = false;\n collapseTimer = null;\n }, 200);\n }\n\n // Height tracking: toastId → height\n const heightsMap = reactive(new Map<string | number, number>());\n\n function reportHeight(toastId: string | number, height: number) {\n const rounded = Math.round(height);\n if (heightsMap.get(toastId) !== rounded) {\n heightsMap.set(toastId, rounded);\n }\n }\n\n function forgetHeight(toastId: string | number) {\n heightsMap.delete(toastId);\n }\n\n function clearHeights() {\n heightsMap.clear();\n }\n\n function setInteracting(value: boolean) {\n interacting.value = value;\n }\n\n return {\n expanded,\n interacting,\n heightsMap,\n expandStack,\n collapseStack,\n reportHeight,\n forgetHeight,\n clearHeights,\n setInteracting,\n };\n}\n","import { VcToast } from \"@ui/components/molecules/vc-toast\";\nimport { VcIcon } from \"@ui/components/atoms/vc-icon\";\nimport { PropType, computed, defineComponent, h, toRaw, inject } from \"vue\";\nimport {\n Content,\n NotificationType,\n NotificationPosition,\n NotificationContainerStateKey,\n} from \"@core/notifications/toast-types\";\nimport { GAP, VISIBLE_TOASTS, computeToastOffsets } from \"./computeToastOffsets\";\nimport { useToastStack } from \"./useToastStack\";\nimport { i18n } from \"@core/plugins/i18n\";\n\nconst NotificationContainer = defineComponent({\n name: \"NotificationContainer\",\n inheritAttrs: false,\n props: {\n pauseOnHover: {\n type: Boolean,\n required: false,\n default: true,\n },\n timeout: {\n type: [Number, Boolean],\n required: false,\n default: 3000,\n },\n content: {\n type: [String, Object] as PropType<Content>,\n required: false,\n default: \"\",\n },\n notificationId: {\n type: [String, Number],\n required: false,\n default: \"\",\n },\n updateId: {\n type: [String, Number],\n required: false,\n default: \"\",\n },\n type: {\n type: String as PropType<NotificationType>,\n required: false,\n default: \"default\",\n },\n onOpen: {\n type: Function as PropType<<T>(payload: T) => void>,\n required: false,\n default: undefined,\n },\n onClose: {\n type: Function as PropType<<T>(payload: T) => void>,\n required: false,\n default: undefined,\n },\n payload: {\n type: [String, Object] as PropType<Record<string, any>>,\n required: false,\n default: () => ({}),\n },\n position: {\n type: String as PropType<NotificationPosition>,\n required: false,\n default: \"top-center\",\n },\n },\n setup(props) {\n const { notificationContainers, actions } = inject(NotificationContainerStateKey)!;\n const notificationsList = computed(() => {\n return notificationContainers[props.position as NotificationPosition].value || [];\n });\n\n const {\n expanded,\n heightsMap,\n expandStack,\n collapseStack,\n reportHeight,\n forgetHeight,\n clearHeights,\n setInteracting,\n } = useToastStack();\n\n function isComponent(content: Content) {\n return typeof content === \"object\" && (!!(content as any)?.render || !!(content as any)?.setup);\n }\n\n function handleClose(id: string | number | undefined) {\n if (id) {\n forgetHeight(id);\n actions.remove(id);\n }\n }\n\n function handleClearAll() {\n actions.clear();\n clearHeights();\n }\n\n const isTop = computed(() => (props.position || \"top-center\").startsWith(\"top\"));\n\n return () => {\n const items = notificationsList.value;\n const count = items.length;\n const isExpanded = expanded.value || count <= 1;\n const showClearAll = count > 1;\n\n const layout = computeToastOffsets(\n items.map((item) => item.notificationId),\n heightsMap,\n isExpanded,\n );\n\n const children = items.map((item, arrayIndex) => {\n const { sonnerIndex, zIndex, offset, initialHeight } = layout.toasts[arrayIndex];\n\n const toastStyle: Record<string, string | number> = {\n \"--toasts-before\": sonnerIndex,\n \"--z-index\": zIndex,\n \"--offset\": `${offset}px`,\n \"--initial-height\": initialHeight ? `${initialHeight}px` : \"auto\",\n };\n\n const toastProps = {\n ...item,\n onClose: handleClose,\n onReportHeight: reportHeight,\n toastIndex: sonnerIndex,\n toastsCount: count,\n expanded: isExpanded,\n visibleToasts: VISIBLE_TOASTS,\n style: toastStyle,\n };\n\n const toastVNode =\n item.content && isComponent(item.content)\n ? h(VcToast, { ...toastProps, content: h(toRaw(item.content)) })\n : h(VcToast, toastProps);\n\n // The group is an <ol>, so each toast must be a list item\n // (WCAG 1.3.1 / axe `list`). display:contents keeps the wrapper\n // layout-transparent while preserving the listitem semantics.\n return h(\"li\", { key: item.notificationId, style: { display: \"contents\" } }, [toastVNode]);\n });\n\n // Clear all button — fixed position top-right of toast stack\n let clearAllButton = null;\n if (showClearAll) {\n // <li>: the group is an <ol>, so every direct child must be a list item\n // (WCAG 1.3.1 / axe `list`).\n clearAllButton = h(\n \"li\",\n {\n class: \"notification__clear-all\",\n style: {\n position: \"absolute\",\n [isTop.value ? \"top\" : \"bottom\"]: \"0\",\n left: \"var(--width, 356px)\",\n \"margin-left\": \"8px\",\n \"list-style\": \"none\",\n opacity: isExpanded ? \"1\" : \"0\",\n \"pointer-events\": isExpanded ? \"auto\" : \"none\",\n transition: \"opacity 200ms ease\",\n },\n },\n [\n h(\n \"button\",\n {\n type: \"button\",\n onClick: handleClearAll,\n },\n [\n h(VcIcon, { icon: \"lucide-x\", size: \"xs\", \"aria-hidden\": \"true\" }),\n i18n.global.t(\"CORE.NOTIFICATIONS.CLEAR_ALL\"),\n ],\n ),\n ],\n );\n }\n\n return h(\n \"ol\",\n {\n class: \"notification__toast-group\",\n \"data-expanded\": String(isExpanded),\n \"data-position\": props.position || \"top-center\",\n \"data-y-position\": isTop.value ? \"top\" : \"bottom\",\n style: {\n \"--front-toast-height\": `${layout.frontHeight}px`,\n \"--gap\": `${GAP}px`,\n width: \"var(--width, 356px)\",\n height: `${layout.groupHeight}px`,\n },\n onMouseenter: expandStack,\n onMouseleave: collapseStack,\n onPointerdown: () => {\n setInteracting(true);\n },\n onPointerup: () => {\n setInteracting(false);\n },\n },\n [...children, clearAllButton],\n );\n };\n },\n});\n\nexport default NotificationContainer;\n","import type { RouteLocationNormalized, Router } from \"vue-router\";\nimport { App } from \"vue\";\nimport { useBreakpoints } from \"@vueuse/core\";\nimport { i18n } from \"@core/plugins/i18n\";\nimport { permissions } from \"@core/plugins/permissions\";\nimport { signalR } from \"@core/plugins/signalR\";\nimport { aiAgentPlugin, type AiAgentPluginOptions } from \"@core/plugins/ai-agent\";\nimport { notification } from \"@core/notifications/notification\";\nimport { VcBladeNavigationComponent } from \"@shell/_internal/blade-navigation\";\nimport { VcPopupHandler } from \"@shell/_internal/popup\";\nimport { AssetsDetailsModule } from \"@modules/assets\";\nimport { AssetsManagerModule } from \"@modules/assets-manager\";\nimport { registerInterceptors } from \"@core/interceptors\";\nimport { usePermissions } from \"@core/composables/usePermissions\";\nimport { useUserManagement } from \"@core/composables/useUserManagement\";\nimport Vue3TouchEvents from \"vue3-touch-events\";\nimport * as locales from \"@locales\";\nimport {\n AppInsightsPlugin,\n AppInsightsPluginOptions,\n useAppInsights as useInsightsFromLib,\n} from \"vue3-application-insights\";\nimport { useAppInsights, AppInsightsOptionsKey, AppInsightsInstanceKey } from \"@core/composables/useAppInsights\";\nimport { setupGlobalErrorHandlers } from \"@core/plugins/global-error-handler\";\nimport { useConnectionStatus } from \"@core/composables/useConnectionStatus\";\nimport { useSlowNetworkDetection } from \"@core/composables/useSlowNetworkDetection\";\nimport { useNotificationStore } from \"@core/notifications\";\nimport { registerNotificationBackend } from \"@shell/_internal/notifications/register-backend\";\n\n// Import Blade Registry\nimport { createBladeRegistry, BladeRegistryKey, IBladeRegistryInstance } from \"@core/composables/useBladeRegistry\";\n\nimport * as coreComposables from \"@core/composables\";\nimport { logFrameworkBuildInfo } from \"@core/utilities/buildInfo\";\nimport \"normalize.css\";\nimport \"./assets/styles/fonts.scss\";\nimport \"./assets/styles/index.scss\";\nimport {\n createWidgetService,\n createMenuService,\n createAppBarWidgetService,\n createSettingsMenuService,\n createToolbarService,\n createLanguageService,\n} from \"@core/services\";\nimport {\n AppBarWidgetServiceKey,\n MenuServiceKey,\n NotificationStoreKey,\n SettingsMenuServiceKey,\n ToolbarServiceKey,\n WidgetServiceKey,\n LanguageServiceKey,\n IsMobileKey,\n IsDesktopKey,\n IsPhoneKey,\n IsTabletKey,\n IsTouchKey,\n BladeRoutesKey,\n} from \"@framework/injection-keys\";\n\nimport \"@fortawesome/fontawesome-free/css/fontawesome.min.css\";\nimport \"@fortawesome/fontawesome-free/css/solid.min.css\";\nimport \"bootstrap-icons/font/bootstrap-icons.min.css\";\nimport \"@material-symbols/font-300/index.css\";\n\ntype I18NParams = Parameters<typeof i18n.global.mergeLocaleMessage>;\n\nexport interface FrameworkInstallArgs {\n router: Router;\n i18n?: {\n locale: string;\n fallbackLocale: string;\n };\n applicationInsights?: {\n instrumentationKey: string;\n appName?: string;\n cloudRole?: string;\n cloudRoleInstance?: string;\n };\n /**\n * AI Agent plugin options.\n * Configure tenantId here to identify the platform instance.\n *\n * @example\n * ```typescript\n * app.use(VirtoShellFramework, {\n * router,\n * aiAgent: {\n * config: {\n * tenantId: \"virto\"\n * }\n * }\n * });\n * ```\n */\n aiAgent?: AiAgentPluginOptions;\n}\n\nexport interface VcShellFrameworkPlugin {\n install(app: App, args: FrameworkInstallArgs): void;\n}\n\n// ── Install helpers ──────────────────────────────────────────────────\n\nfunction setupI18n(app: App, args: FrameworkInstallArgs) {\n if (args.i18n?.locale) {\n i18n.global.locale.value = args.i18n.locale;\n }\n if (args.i18n?.fallbackLocale) {\n i18n.global.fallbackLocale.value = args.i18n.fallbackLocale;\n }\n\n app.use(i18n);\n\n // Dev-mode: warn about missing translation keys\n if (import.meta.env.DEV) {\n i18n.global.setMissingHandler((locale, key) => {\n console.warn(`[vc-shell i18n] Missing translation: \"${key}\" for locale \"${locale}\"`);\n });\n }\n\n const languageService = createLanguageService();\n app.provide(LanguageServiceKey, languageService);\n\n const { resolveCamelCaseLocale } = languageService;\n\n app.config.globalProperties.$mergeLocaleMessage = (locale: I18NParams[0], message: I18NParams[1]) => {\n i18n.global.mergeLocaleMessage(resolveCamelCaseLocale(locale), message);\n };\n\n // Components locales\n Object.entries(locales).forEach(([key, message]) => {\n i18n.global.mergeLocaleMessage(resolveCamelCaseLocale(key), message);\n });\n}\n\nfunction setupBreakpoints(app: App) {\n const bp = useBreakpoints({\n phone: 480,\n desktop: 1024,\n });\n\n app.config.globalProperties.$isPhone = bp.smaller(\"phone\");\n app.config.globalProperties.$isTablet = bp.between(\"phone\", \"desktop\");\n app.config.globalProperties.$isMobile = bp.smaller(\"desktop\");\n app.config.globalProperties.$isDesktop = bp.greater(\"desktop\");\n app.config.globalProperties.$isTouch = \"ontouchstart\" in window || navigator.maxTouchPoints > 0;\n\n // Typed Symbol keys (internal framework use)\n app.provide(IsPhoneKey, app.config.globalProperties.$isPhone);\n app.provide(IsTabletKey, app.config.globalProperties.$isTablet);\n app.provide(IsMobileKey, app.config.globalProperties.$isMobile);\n app.provide(IsDesktopKey, app.config.globalProperties.$isDesktop);\n app.provide(IsTouchKey, app.config.globalProperties.$isTouch);\n}\n\nfunction setupLegacyGlobals(app: App) {\n // Pages\n app.config.globalProperties.pages = [];\n\n // Blade routes\n app.config.globalProperties.bladeRoutes = [];\n app.provide(BladeRoutesKey, app.config.globalProperties.bladeRoutes);\n}\n\nfunction createAndProvideServices(app: App) {\n app.provide(WidgetServiceKey, createWidgetService());\n app.provide(ToolbarServiceKey, createToolbarService());\n app.provide(AppBarWidgetServiceKey, createAppBarWidgetService());\n app.provide(MenuServiceKey, createMenuService());\n app.provide(SettingsMenuServiceKey, createSettingsMenuService());\n app.provide(NotificationStoreKey, useNotificationStore());\n\n const bladeRegistryInstance: IBladeRegistryInstance = createBladeRegistry(app);\n app.provide(BladeRegistryKey, bladeRegistryInstance);\n}\n\nfunction installPlugins(app: App, args: FrameworkInstallArgs) {\n // Register notification backend before any plugin that might use notifications\n registerNotificationBackend();\n\n app.use(VcBladeNavigationComponent, { router: args.router });\n app.use(VcPopupHandler);\n app.use(AssetsDetailsModule);\n app.use(AssetsManagerModule);\n app.use(signalR);\n app.use(permissions);\n app.use<[]>(Vue3TouchEvents);\n\n app.use(aiAgentPlugin, args.aiAgent);\n}\n\nfunction provideApplicationInsightsOptions(app: App, args: FrameworkInstallArgs) {\n if (!args.applicationInsights?.instrumentationKey) return;\n\n const aiOptions: AppInsightsPluginOptions = {\n appInsightsConfig: {\n config: {\n instrumentationKey: args.applicationInsights.instrumentationKey,\n },\n },\n trackAppErrors: true,\n appName: args.applicationInsights?.appName,\n cloudRole: args.applicationInsights?.cloudRole,\n cloudRoleInstance: args.applicationInsights?.cloudRoleInstance,\n };\n\n // Provide options synchronously so components can inject at setup time\n // (useErrorHandler -> useAppInsights -> inject(AppInsightsOptionsKey))\n app.provide(AppInsightsOptionsKey, aiOptions);\n}\n\nfunction installApplicationInsightsDeferred(app: App, args: FrameworkInstallArgs) {\n if (!args.applicationInsights?.instrumentationKey) return;\n\n const aiOptions: AppInsightsPluginOptions = {\n appInsightsConfig: {\n config: {\n instrumentationKey: args.applicationInsights.instrumentationKey,\n },\n },\n trackAppErrors: true,\n appName: args.applicationInsights?.appName,\n cloudRole: args.applicationInsights?.cloudRole,\n cloudRoleInstance: args.applicationInsights?.cloudRoleInstance,\n };\n\n // Install the SDK plugin (may start telemetry collection)\n app.use(AppInsightsPlugin, aiOptions);\n\n // Re-provide instance under our own key so useAppInsights() can inject with a default\n // (avoids Vue \"injection not found\" warning when the library's private Symbol is used)\n const appInsightsInstance = app.runWithContext(() => useInsightsFromLib());\n app.provide(AppInsightsInstanceKey, appInsightsInstance);\n\n // Register router hooks for page tracking.\n // Note: the initial navigation's page-view may not be tracked since\n // router.isReady() may resolve before these hooks are registered.\n // This is an acceptable trade-off for removing SDK init from critical path.\n app.runWithContext(() => {\n const { setupPageTracking } = useAppInsights();\n\n args.router.beforeEach((to) => {\n setupPageTracking.beforeEach({ name: to.name as string });\n });\n\n args.router.afterEach((to) => {\n setupPageTracking.afterEach({ name: to.name as string, fullPath: to.fullPath });\n });\n });\n}\n\nfunction setupRouterGuards(router: Router) {\n const getParam = (to: RouteLocationNormalized) => {\n let param: {\n [k: string]: string | string[];\n } = {};\n\n if (Object.keys(to.params).length > 0) {\n param = Object.fromEntries(Object.entries(to.params).filter(([key]) => key !== \"pathMatch\"));\n }\n\n return param;\n };\n\n // Check if user is authenticated and redirect to login page if not.\n // TODO add check if app has login page\n router.beforeEach(async (to) => {\n const { isAuthenticated } = useUserManagement();\n\n if (to.meta.root === true) {\n try {\n if (!isAuthenticated.value) {\n localStorage.setItem(\"redirectAfterLogin\", to.fullPath);\n return { name: \"Login\" };\n }\n } catch (_e) {\n localStorage.setItem(\"redirectAfterLogin\", to.fullPath);\n return { name: \"Login\" };\n }\n }\n });\n\n // Check if user has access to the page and redirect to previous path if not.\n router.beforeEach((to, from) => {\n const { hasAccess } = usePermissions();\n if (!to.meta.permissions) {\n return true;\n } else if (hasAccess(to.meta.permissions as string | string[])) return true;\n else {\n notification.error(i18n.global.t(\"PERMISSION_MESSAGES.ACCESS_RESTRICTED\"), {\n timeout: 3000,\n });\n\n const param = getParam(to);\n\n return Object.keys(param)[0] ? `/${Object.values(param)[0]}` + from.path : from.path;\n }\n });\n}\n\n// ── Plugin entry point ───────────────────────────────────────────────\n\nexport default {\n install(app: App, args: FrameworkInstallArgs): void {\n // Print framework version banner for debugging (see core/utilities/buildInfo.ts)\n logFrameworkBuildInfo();\n\n // Register base theme\n coreComposables.useTheme().register([{ key: \"light\", localizationKey: \"core.themes.light\" }]);\n\n // HTTP Interceptors\n window.fetch = registerInterceptors(args.router);\n\n setupI18n(app, args);\n setupBreakpoints(app);\n setupLegacyGlobals(app);\n createAndProvideServices(app);\n installPlugins(app, args);\n\n // Provide AppInsights options synchronously (components inject at setup time)\n provideApplicationInsightsOptions(app, args);\n\n setupGlobalErrorHandlers(app);\n\n if (typeof window !== \"undefined\") {\n app.runWithContext(() => useConnectionStatus());\n app.runWithContext(() => useSlowNetworkDetection());\n }\n\n setupRouterGuards(args.router);\n\n // Defer non-critical plugins to post-paint.\n // setTimeout(fn, 0) yields to the browser's rendering pipeline —\n // the browser paints before executing the next macrotask.\n setTimeout(() => {\n performance.mark(\"vc:deferred-plugins-start\");\n // notifyMountComplete(); // Trigger deferred SignalR connection\n installApplicationInsightsDeferred(app, args); // AppInsights SDK + router hooks\n performance.mark(\"vc:deferred-plugins-done\");\n }, 0);\n },\n} as VcShellFrameworkPlugin;\n\n// ── Public API ───────────────────────────────────────────────────────\n\n// Injection keys (typed Symbol keys)\nexport * from \"./injection-keys\";\n\n// UI components (atoms, molecules, organisms)\nexport * from \"@ui/components\";\nexport * from \"@ui/types\";\n\n// Core composables\nexport * from \"@core/composables\";\n\n// Notifications (new API)\nexport {\n useBladeNotifications,\n useNotificationStore,\n useNotificationContext,\n useBroadcastFilter,\n NotificationContextKey,\n} from \"@core/notifications\";\nexport { notification } from \"@core/notifications/notification\";\nexport type {\n Severity,\n ToastConfig,\n NotificationTypeConfig,\n ModuleNotificationsConfig,\n NotificationAction,\n BladeNotificationOptions,\n BladeNotificationReturn,\n UseBroadcastFilterReturn,\n} from \"@core/notifications\";\n\n// Core\nexport * from \"@core/directives\";\nexport * from \"@core/types\";\nexport * from \"@core/api/platform\";\nexport * from \"@core/utilities\";\nexport * from \"@core/constants\";\n\n// Core plugins (public surface only)\nexport * from \"@core/plugins/modularity\";\nexport * from \"@core/plugins/permissions\";\nexport * from \"@core/plugins/validation\";\n\n// i18n (public singleton)\nexport { i18n } from \"@core/plugins/i18n\";\n\n// SignalR\nexport { signalR } from \"@core/plugins/signalR\";\n\n// Blade navigation (public composables + types)\nexport * from \"@core/blade-navigation\";\n\n// Popup (public composable)\nexport { usePopup } from \"@core/composables/usePopup\";\n\n// Shell components (public building blocks)\nexport * from \"@shell/components\";\nexport * from \"@shell/auth\";\nexport * from \"@shell/dashboard\";\n\n// AI Agent (also available via @vc-shell/framework/ai-agent)\nexport * from \"@core/plugins/ai-agent/public\";\n\n// Extensions (also available via @vc-shell/framework/extensions)\nexport * from \"@core/plugins/extension-points/public\";\n\n// Built-in modules\nexport * from \"@modules\";\n\n// Shared composables that moved to core/ui\nexport * from \"@core/composables/useBladeNavigationAdapter\";\nexport * from \"@core/composables/useBladeForm\";\n\n// Multilanguage selector (moved from shared to ui)\nexport * from \"@ui/components/molecules/multilanguage-selector\";\n\n// UI composables (useTableSort, useTableSelection)\nexport * from \"@ui/composables\";\n\n// Notification rendering internals (used by shell layout)\nimport \"@shell/_internal/notifications/styles/index.scss\";\nexport * from \"@shell/_internal/notifications/composables\";\nexport * from \"@shell/_internal/notifications/components\";\n\n// Blade navigation rendering components (VcBladeNavigation, VcBladeSlot)\nexport * from \"@shell/_internal/blade-navigation\";\n\n// Pre-registration functions (used by external modules before provide/inject tree exists)\nexport { registerExternalWidget, registerWidget } from \"@core/composables/useWidgets\";\nexport { registerToolbarItem } from \"@core/services/toolbar-service\";\nexport { addMenuItem } from \"@core/services/menu-service\";\nexport { addAppBarWidget } from \"@core/services/app-bar-menu-service\";\nexport { addSettingsMenuItem } from \"@core/services/settings-menu-service\";\nexport { registerDashboardWidget } from \"@core/services/dashboard-service\";\nexport type { IExternalWidgetRegistration, IWidgetTrigger } from \"@core/services/widget-service\";\n"],"names":["camelToSnake","str","m","kebabToCamel","x","kebabToPascal","camelCase","camelize","match","chr","imageExtensions","getExtension","fileName","isImage","name","readableSize","bytes","decimals","k","dm","sizes","i","extensionColors","getExtensionColor","ext","getExtensionLabel","permissions","app","hasAccess","usePermissions","useBladeNotifications","options","store","useNotificationStore","unsub","getCurrentScope","onScopeDispose","messages","computed","msg","unreadCount","markAsRead","useNotificationContext","ctx","inject","NotificationContextKey","useBroadcastFilter","NotificationContainerStateKey","logger","createLogger","signalR","_app","isAuthenticated","useUserManagement","reconnect","connection","useCypressSignalRMock","HubConnectionBuilder","LogLevel","start","err","stop","message","watch","value","useTableQueryState","stateKey","service","TableQueryStateKey","defineAppModule","blades","locales","notificationTemplates","notifications","bladeRegistry","BladeRegistryKey","exportKey","component","type","config","template","notifyTypes","t","notification","key","i18n","createAppModule","pages","_components","restoreFromUrl","bladeStack","parsed","router","routeParams","workspaceMatch","navigateToMainRoute","bladeMatch","b","clearBladeStackRespectingGuards","bladesBeforeClose","lastBlade","bladeRouterGuard","to","r","tenantPrefix","parseBladeUrl","v","path","query","buildUrlFromStack","VcBladeNavigationComponent","args","bladeNavigationPluginData","setBladeNavigationInstance","useBladeRegistry","createBladeStack","BladeStackKey","setBladeStackInstance","messaging","createBladeMessaging","BladeMessagingKey","setBladeMessagingInstance","setBladeRegistryInstance","mainRoute","COMPONENT_DEFAULTS","getComponentDefaults","componentName","props","__props","emit","__emit","handleConfirm","close","_createBlock","VcPopup","$emit","_renderSlot","_ctx","_withCtx","_createElementVNode","_createElementBlock","_Fragment","_createVNode","_unref","VcButton","$event","$slots","VcPopupBase","$t","registerPopupPresets","registerPopupPreset","vcPopupWarning","vcPopupError","vcPopupInfo","VcPopupHandler","popupPlugin","shallowReactive","PopupPluginKey","setPopupPluginInstance","debounce","func","delay","timer","resultsMap","once","result","throttle","wasThrottled","useFunctions","useNotifications","notifyType","types","handler","moduleNotifications","item","orderBy","fn","_notification","useAsync","innerAction","loading","ref","error","shouldNotify","notifyTimeout","action","payload","rest","e","parseError","isSessionExpired","notifId","timerId","n","setPendingErrorNotification","readonly","useApiClient","c","getApiClient","useLoading","useSettings","uiSettings","customSettingsApplied","SettingClient","getUiCustomizationSettings","settings","applySettings","onMounted","useLatestRequest","pending","sequence","disposed","begin","requestId","completed","invalidate","dispose","MAX_CONCURRENT_UPLOADS","uploadSingleFile","file","uploadPath","index","startingSortOrder","formData","response","uploadedFile","processBatched","items","processor","concurrency","results","batch","batchResults","batchIndex","useAssets","upload","files","fileArray","asset","remove","filesToDelete","initialAssetArr","assetKey","updatedAssetArr","_.cloneDeep","_.differenceWith","y","edit","updatedFiles","updatedFile","DEFAULT_CONCURRENCY","normalizedPath","normalizeSortOrder","list","a","ao","bo","useAssetsManager","source","_loading","_items","newVal","_sync","successfulUploads","removeMany","itemsToRemove","keysToRemove","reorder","newOrder","updateItem","existing","updated","useBeforeUnload","modified","onBeforeMount","preventUnload","onBeforeUnmount","event","unref","isEmptyValue","isMultilanguageProperty","property","isMultivalueProperty","isDictionaryProperty","isMeasureProperty","isColorProperty","createValue","params","cleanEmptyValues","locale","regularStrategy","context","otherLocales","newValues","booleanStrategy","_context","dictionaryStrategy","dictionary","setMultilanguageDictionary","setSingleLanguageDictionary","setMultilanguageMultivalueDictionary","setMultilanguageSingleValueDictionary","values","dictItem","locValue","dictionaryItem","existingLanguageCodes","languageCodes","langCode","measureStrategy","_locale","colorStrategy","resolveStrategy","useDynamicProperties","searchDictionary","searchMeasurements","dictionaryItemsLoading","searchDictionaryItems","loadDictionaries","propertyId","keyword","localizedValue","loc","loadMeasurements","measureId","_keyword","getPropertyValue","setPropertyValue","useWebVitals","callback","defaultCallback","metric","onFCP","onLCP","onCLS","onINP","onTTFB","useBladeWidgets","widgets","_service","WidgetServiceKey","InjectionError","widgetService","descriptor","BladeDescriptorKey","bladeId","decl","buildWidget","onUnmounted","refresh","widgetId","widget","w","refreshAll","registered","useWidgetTrigger","trigger","scope","WidgetScopeKey","headless","unwrapRecord","record","val","isRef","defineBladeContext","data","provide","BladeContextKey","toValue","injectBladeContext","isEmpty","semanticEqual","isEqualWith","valA","valB","useModificationTracker","initialValueProp","getClonedUnreffedValue","cloneDeep","pristineValue","currentValue","isModified","newExternalInitialValue","wasModified","newCurrentVal","newPristineVal","resetModificationState","newBaselineValueInput","newClonedBase","__registerBladeConfig","closeSelf","useBlade","useForm","isValid","useIsFormValid","isDirty","useIsFormDirty","useI18n","defaultAsset","assetNameClean","dotIndex","isDisabled","bladeToolbar","assetType","VcBlade","_hoisted_1","_hoisted_2","VcContainer","_hoisted_3","VcForm","_hoisted_4","VcImage","_openBlock","_hoisted_5","_normalizeStyle","_hoisted_6","VcField","Field","errorMessage","handleChange","errors","VcInput","_cache","VcTextarea","AssetsDetails","_AssetsDetails","AssetsDetailsModule","components","openBlade","manager","defaultAssets","isLoading","bladeTitle","isDragging","uploader","selectedItems","toggleUploader","sortAssets","sorted","dragOver","dragLeave","onDrop","fileList","existingNames","transfer","base","maxSortOrder","max","inputUpload","onItemClick","actionBuilder","VcDataTable","VcColumn","_toDisplayString","AssetsManager","_AssetsManager","AssetsManagerModule","OFFLINE_NOTIFICATION_ID","_isSetup","_isOnline","useConnectionStatus","isOnline","useNetwork","online","SLOW_REQUEST_THRESHOLD_MS","SLOW_EFFECTIVE_TYPES","_connectionHandler","SLOW_NETWORK_NOTIFICATION_ID","DISMISS_DELAY_MS","SLOW_NETWORK_MESSAGE","_dismissTimer","showSlowNotification","hideSlowNotification","_slowRequestCount","_isSlowEffectiveType","_pendingTimers","_trackedSlowIds","isSlowNetwork","trackRequest","id","untrackRequest","useSlowNetworkDetection","isSlow","slow","LOGIN_PATH_PATTERN","looksLikeLoginPage","pathname","contentType","registerInterceptors","originalFetch","signOut","requestCounter","patched","resolve","isApiRequest","input","raw","url","resource","init","controller","didTimeout","timeoutId","externalSignal","abortFromExternal","isLoginPageResponse","markSessionExpired","redirect","SessionExpiredError","route","errorKey","recentErrors","DEDUP_WINDOW_MS","isDuplicate","now","last","setupGlobalErrorHandlers","existingHandler","instance","info","win","onUnhandledRejection","onWindowError","containerInstances","useInstance","saveInstance","position","unmountComponent","pos","clearContainer","getInstanceByPosition","notificationContainers","useContainer","defaultOptions","reactive","getAllNotifications","container","getNotificationsByPosition","getNotification","notificationId","generateRoot","rootInstance","positionSelector","renderRoot","pendingMounts","appendInstance","mountPromise","dom","NotificationContainer","index$1","createApp","actions","nextTick","hasNotification","containers","positionToRemoveFrom","found","option","containerToUpdate","containerPosition","updatedNotification","targetPosition","propKey","propValue","generateId","registerNotificationBackend","setNotificationBackend","getFrameworkBuildInfo","frameworkVersion","logFrameworkBuildInfo","isMobile","isDesktop","useResponsive","renderMatchesViewport","isSidebarVisible","onModelUpdate","VcSidebar","Sidebar","SidebarComponent","processedLogo","signIn","useExternalProvider","_renderList","provider","ExternalProvider","resolveSafeRedirectPath","candidate","redirectPath","formatSignInError","validatePasswordChange","fields","useRouter","validateField","customizationLoading","signInResult","user","getProviders","loginProviders","providersLoaded","customization","form","login","redirectTo","goToForgotPassword","VcAuthLayout","ExternalProviders","VcHint","ExtensionPoint","_createTextVNode","Login","_Login","forgotPasswordRequestSent","forgotPassword","requestPasswordReset","maskedEmail","email","domain","forgot","goBack","ForgotPassword","_ForgotPassword","validateToken","validatePassword","resetPasswordByToken","veeValidate","disableButton","validate","resetPassword","valid","loginResult","VcLoading","field","_mergeProps","ResetPassword","_ResetPassword","isFormValid","acceptInvitation","Invite","_Invite","changeUserPassword","cancelChange","changePassword","validateForm","serverErrors","clientErrors","VcBanner","ChangePasswordPage","_ChangePassword","_deprecationWarned","warnDeprecated","method","replacement","descriptorToShim","activeId","_blades","_activeWorkspace","_resetAdapterState","getSharedState","bladeStackInstance","bladeMessagingInstance","bladeRegistryInstance","globalBladeNavigationPluginInstanceFallback","d","ws","extractBladeName","blade","comp","useBladeNavigation","activeWorkspace","currentDescriptor","getCurrentInstance","syncUrlPush","syncUrlReplace","createUrlSync","getCurrentBladeId","getBladeIdByIndex","allBlades","isWorkspace","parentId","closeBlade","prevented","goToRoot","routes","mainRouteAlias","getTenantPrefix","onParentCall","currentBladeIndex","callerId","onBeforeClose","cb","warn","resolveBladeByName","routeResolver","_to","setNavigationQuery","prefix","cleanQuery","getNavigationQuery","urlParams","cleanKey","numValue","setBladeError","bladeIdx","clearBladeError","currentBladeNavigationData","isEmptyPrimitive","aObj","bObj","allKeys","useBladeForm","canSaveOverride","autoBeforeClose","autoBeforeUnload","closeConfirmMessage","onRevert","formMeta","setFieldError","errorBag","pristineSnapshot","trackerIsModified","isReady","canSave","setBaseline","markReady","revert","showConfirmation","usePopup","shouldGuard","BladeFormKey","GAP","VISIBLE_TOASTS","computeToastOffsets","ids","heights","isExpanded","count","heightOf","frontToastId","frontHeight","toasts","arrayIndex","sonnerIndex","heightSum","offset","groupHeight","oldestSonnerIdx","hSum","oldestOffset","oldestHeight","useToastStack","expanded","interacting","collapseTimer","expandStack","collapseStack","heightsMap","reportHeight","toastId","height","rounded","forgetHeight","clearHeights","setInteracting","defineComponent","notificationsList","isComponent","content","handleClose","handleClearAll","isTop","showClearAll","layout","children","zIndex","initialHeight","toastStyle","toastProps","toastVNode","h","VcToast","toRaw","clearAllButton","VcIcon","setupI18n","languageService","createLanguageService","LanguageServiceKey","resolveCamelCaseLocale","setupBreakpoints","bp","useBreakpoints","IsPhoneKey","IsTabletKey","IsMobileKey","IsDesktopKey","IsTouchKey","setupLegacyGlobals","BladeRoutesKey","createAndProvideServices","createWidgetService","ToolbarServiceKey","createToolbarService","AppBarWidgetServiceKey","createAppBarWidgetService","MenuServiceKey","createMenuService","SettingsMenuServiceKey","createSettingsMenuService","NotificationStoreKey","createBladeRegistry","installPlugins","Vue3TouchEvents","aiAgentPlugin","provideApplicationInsightsOptions","aiOptions","AppInsightsOptionsKey","installApplicationInsightsDeferred","AppInsightsPlugin","appInsightsInstance","useInsightsFromLib","AppInsightsInstanceKey","setupPageTracking","useAppInsights","setupRouterGuards","getParam","param","from","coreComposables.useTheme"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,SAASA,GAAaC,GAAqB;AAChD,SAAOA,EACJ,QAAQ,gBAAgB,SAAUC,GAAG;AACpC,WAAOA,EAAE,CAAC,IAAI,MAAMA,EAAE,CAAC;AAAA,EACzB,CAAC,EACA,YAAA;AACL;ACNO,MAAMC,KAAe,CAACF,MAAgBA,EAAI,QAAQ,OAAO,CAACG,MAAMA,EAAE,CAAC,EAAE,YAAA,CAAa;AAElF,SAASC,GAAcJ,GAAa;AACzC,QAAMK,IAAYH,GAAaF,CAAG;AAElC,SADmBK,EAAU,CAAC,EAAE,gBAAgBA,EAAU,UAAU,CAAC;AAEvE;ACNO,SAASC,GAASN,GAAa;AACpC,SAAOA,EAAI,QAAQ,WAAW,SAAUO,GAAOC,GAAK;AAClD,WAAOA,EAAI,YAAA;AAAA,EACb,CAAC;AACH;ACJA,MAAMC,yBAAsB,IAAI,CAAC,OAAO,OAAO,QAAQ,OAAO,KAAK,CAAC;AAEpE,SAASC,GAAaC,GAAkB;AACtC,SAAOA,EAAS,MAAM,GAAG,EAAE,IAAA,GAAO,YAAA;AACpC;AAEA,SAASC,GAAQC,GAA0B;AACzC,SAAKA,IACEJ,GAAgB,IAAIC,GAAaG,CAAI,KAAK,EAAE,IADjC;AAEpB;AAEA,SAASC,GAAaC,GAA2BC,IAAW,GAAG;AAC7D,MAAI,CAACD,EAAO,QAAO;AAEnB,QAAME,IAAI,MACJC,IAAKF,IAAW,IAAI,IAAIA,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