@iblai/web-utils 1.6.7 → 1.6.9

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.
Files changed (87) hide show
  1. package/dist/data-layer/src/features/mentor/privacy.d.ts +61 -0
  2. package/dist/data-layer/src/index.d.ts +1 -0
  3. package/dist/index.d.ts +676 -128
  4. package/dist/index.esm.js +14558 -21745
  5. package/dist/index.esm.js.map +1 -1
  6. package/dist/index.js +14648 -21750
  7. package/dist/index.js.map +1 -1
  8. package/dist/package.json +11 -2
  9. package/dist/web-utils/src/features/chat-input/__tests__/api-slice.test.d.ts +1 -0
  10. package/dist/web-utils/src/features/chat-input/api-slice.d.ts +12 -0
  11. package/dist/web-utils/src/features/files/filesSlice.d.ts +3 -0
  12. package/dist/web-utils/src/features/host-chat/__tests__/slice.test.d.ts +1 -0
  13. package/dist/web-utils/src/features/host-chat/slice.d.ts +17 -0
  14. package/dist/web-utils/src/features/index.d.ts +5 -0
  15. package/dist/web-utils/src/features/rbac/__tests__/rbac-slice.test.d.ts +1 -0
  16. package/dist/web-utils/src/features/rbac/rbac-slice.d.ts +13 -0
  17. package/dist/web-utils/src/features/subscription/__tests__/slice.test.d.ts +1 -0
  18. package/dist/web-utils/src/features/subscription/constants.d.ts +12 -0
  19. package/dist/web-utils/src/features/subscription/slice.d.ts +29 -0
  20. package/dist/web-utils/src/features/top-banner/__tests__/slice.test.d.ts +1 -0
  21. package/dist/web-utils/src/features/top-banner/slice.d.ts +24 -0
  22. package/dist/web-utils/src/hooks/__tests__/use-accessing-public-route.test.d.ts +1 -0
  23. package/dist/web-utils/src/hooks/__tests__/use-cached-session-id.test.d.ts +1 -0
  24. package/dist/web-utils/src/hooks/__tests__/use-chat-file-upload.test.d.ts +1 -0
  25. package/dist/web-utils/src/hooks/__tests__/use-embed-mode.test.d.ts +1 -0
  26. package/dist/web-utils/src/hooks/__tests__/use-event-callback.test.d.ts +1 -0
  27. package/dist/web-utils/src/hooks/__tests__/use-event-listener.test.d.ts +1 -0
  28. package/dist/web-utils/src/hooks/__tests__/use-file-drag-drop.test.d.ts +1 -0
  29. package/dist/web-utils/src/hooks/__tests__/use-local-storage.test.d.ts +1 -0
  30. package/dist/web-utils/src/hooks/__tests__/use-model-file-upload-capabilities.test.d.ts +1 -0
  31. package/dist/web-utils/src/hooks/__tests__/use-os.test.d.ts +1 -0
  32. package/dist/web-utils/src/hooks/__tests__/use-responsive.test.d.ts +1 -0
  33. package/dist/web-utils/src/hooks/__tests__/use-show-attachment.test.d.ts +1 -0
  34. package/dist/web-utils/src/hooks/__tests__/use-show-free-trial-dialog.test.d.ts +1 -0
  35. package/dist/web-utils/src/hooks/__tests__/use-show-voice-call.test.d.ts +1 -0
  36. package/dist/web-utils/src/hooks/__tests__/use-show-voice-recorder.test.d.ts +1 -0
  37. package/dist/web-utils/src/hooks/__tests__/use-timer.test.d.ts +1 -0
  38. package/dist/web-utils/src/hooks/__tests__/use-tokens.test.d.ts +1 -0
  39. package/dist/web-utils/src/hooks/__tests__/use-user-agreement.test.d.ts +1 -0
  40. package/dist/web-utils/src/hooks/__tests__/use-user.test.d.ts +1 -0
  41. package/dist/web-utils/src/hooks/__tests__/use-voice-chat.test.d.ts +1 -0
  42. package/dist/web-utils/src/hooks/__tests__/use-welcome-message.test.d.ts +1 -0
  43. package/dist/web-utils/src/hooks/chat/use-advanced-chat.d.ts +1 -1
  44. package/dist/web-utils/src/hooks/chat/use-chat-v2.d.ts +1 -1
  45. package/dist/web-utils/src/hooks/index.d.ts +23 -0
  46. package/dist/web-utils/src/hooks/subscription-v2/__tests__/use-402-error-check.test.d.ts +1 -0
  47. package/dist/web-utils/src/hooks/subscription-v2/use-402-error-check.d.ts +22 -0
  48. package/dist/web-utils/src/hooks/use-accessing-public-route.d.ts +1 -0
  49. package/dist/web-utils/src/hooks/use-cached-session-id.d.ts +8 -0
  50. package/dist/web-utils/src/hooks/use-chat-file-upload.d.ts +17 -0
  51. package/dist/web-utils/src/hooks/use-embed-mode.d.ts +1 -0
  52. package/dist/web-utils/src/hooks/use-event-callback.d.ts +2 -0
  53. package/dist/web-utils/src/hooks/use-event-listener.d.ts +6 -0
  54. package/dist/web-utils/src/hooks/use-file-drag-drop.d.ts +15 -0
  55. package/dist/web-utils/src/hooks/use-isomorphic-layout-effect.d.ts +2 -0
  56. package/dist/web-utils/src/hooks/use-local-storage.d.ts +13 -0
  57. package/dist/web-utils/src/hooks/use-mentor-settings.d.ts +39 -19
  58. package/dist/web-utils/src/hooks/use-model-file-upload-capabilities.d.ts +21 -0
  59. package/dist/web-utils/src/hooks/use-os.d.ts +8 -0
  60. package/dist/web-utils/src/hooks/use-responsive.d.ts +13 -0
  61. package/dist/web-utils/src/hooks/use-show-attachment.d.ts +7 -0
  62. package/dist/web-utils/src/hooks/use-show-free-trial-dialog.d.ts +31 -0
  63. package/dist/web-utils/src/hooks/use-show-voice-call.d.ts +7 -0
  64. package/dist/web-utils/src/hooks/use-show-voice-recorder.d.ts +7 -0
  65. package/dist/web-utils/src/hooks/use-timer.d.ts +7 -0
  66. package/dist/web-utils/src/hooks/use-tokens.d.ts +2 -0
  67. package/dist/web-utils/src/hooks/use-user-agreement.d.ts +21 -0
  68. package/dist/web-utils/src/hooks/use-user.d.ts +23 -0
  69. package/dist/web-utils/src/hooks/use-voice-chat.d.ts +11 -0
  70. package/dist/web-utils/src/hooks/use-welcome-message.d.ts +16 -0
  71. package/dist/web-utils/src/providers/__tests__/auth-provider.test.d.ts +1 -0
  72. package/dist/web-utils/src/providers/__tests__/service-worker-provider.test.d.ts +1 -0
  73. package/dist/web-utils/src/providers/auth-provider.d.ts +1 -1
  74. package/dist/web-utils/src/providers/index.d.ts +1 -0
  75. package/dist/web-utils/src/providers/service-worker-provider.d.ts +21 -0
  76. package/dist/web-utils/src/services/__tests__/event-bus.test.d.ts +1 -0
  77. package/dist/web-utils/src/services/__tests__/register-sw.test.d.ts +1 -0
  78. package/dist/web-utils/src/services/event-bus.d.ts +6 -0
  79. package/dist/web-utils/src/services/index.d.ts +2 -0
  80. package/dist/web-utils/src/services/register-sw.d.ts +71 -0
  81. package/dist/web-utils/src/utils/__tests__/tauri-api-cache.test.d.ts +1 -0
  82. package/dist/web-utils/src/utils/constants.d.ts +18 -0
  83. package/dist/web-utils/src/utils/helpers.d.ts +20 -0
  84. package/dist/web-utils/src/utils/index.d.ts +1 -0
  85. package/dist/web-utils/src/utils/platform.d.ts +1 -0
  86. package/dist/web-utils/src/utils/tauri-api-cache.d.ts +19 -0
  87. package/package.json +11 -2
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iblai/web-utils",
3
- "version": "1.6.6",
3
+ "version": "1.6.8",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",
@@ -67,6 +67,7 @@
67
67
  "axios": "1.13.6",
68
68
  "dayjs": "1.11.20",
69
69
  "jwt-decode": "4.0.0",
70
+ "mitt": "3.0.1",
70
71
  "react-redux": "9.2.0",
71
72
  "rollup": "4.59.0",
72
73
  "rollup-plugin-copy": "3.5.0",
@@ -75,12 +76,20 @@
75
76
  "peerDependencies": {
76
77
  "@iblai/data-layer": "^1.1.2",
77
78
  "@iblai/iblai-api": "4.166.0-ai",
79
+ "@tauri-apps/plugin-os": "2.3.2",
78
80
  "react": "19.1.0",
79
- "react-dom": "19.1.0"
81
+ "react-dom": "19.1.0",
82
+ "sonner": "^2.0.0"
80
83
  },
81
84
  "peerDependenciesMeta": {
82
85
  "@tauri-apps/api": {
83
86
  "optional": true
87
+ },
88
+ "@tauri-apps/plugin-os": {
89
+ "optional": true
90
+ },
91
+ "sonner": {
92
+ "optional": true
84
93
  }
85
94
  },
86
95
  "packageManager": "pnpm@10.11.0",
@@ -0,0 +1,12 @@
1
+ import { Slice, type Reducer } from "@reduxjs/toolkit/react";
2
+ export interface ChatInputState {
3
+ textareaInput: string;
4
+ }
5
+ export declare const chatInputSlice: Slice<ChatInputState>;
6
+ export declare const chatInputSliceSelectors: {
7
+ selectTextareaInput: (state: {
8
+ chatInput: ChatInputState;
9
+ }) => string;
10
+ };
11
+ export declare const chatInputSliceActions: import("@reduxjs/toolkit").CaseReducerActions<import("@reduxjs/toolkit").SliceCaseReducers<ChatInputState>, string>;
12
+ export declare const chatInputSliceReducer: Reducer<ChatInputState>;
@@ -18,3 +18,6 @@ export interface FilesState {
18
18
  export declare const filesSlice: Slice<FilesState>;
19
19
  export declare const addFiles: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<`${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPayload<any, `${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>, removeFile: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<`${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPayload<any, `${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>, clearFiles: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<`${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPayload<any, `${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>, updateFileProgress: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<`${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPayload<any, `${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>, updateFileStatus: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<`${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPayload<any, `${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>, updateFileUrl: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<`${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPayload<any, `${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>, updateFileMetadata: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<`${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPayload<any, `${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>, updateFileRetryCount: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<`${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPayload<any, `${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>, updateFileUrlFromWebSocket: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<`${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPayload<any, `${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>;
20
20
  export declare const filesReducer: Reducer<FilesState>;
21
+ export declare const selectAttachedFiles: (state: {
22
+ files: FilesState;
23
+ }) => AttachedFile[];
@@ -0,0 +1,17 @@
1
+ import { Slice } from "@reduxjs/toolkit";
2
+ interface Message {
3
+ role: "user" | "assistant";
4
+ content: string;
5
+ replyTo?: unknown;
6
+ }
7
+ export interface HostChatState {
8
+ messages: Message[];
9
+ enableChatActionsPopup: boolean;
10
+ }
11
+ export declare const hostChatSlice: Slice<HostChatState>;
12
+ export declare const addMessage: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<`${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPayload<any, `${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>, clearMessages: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<`${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPayload<any, `${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>, enableChatActionsPopup: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<`${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPayload<any, `${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>;
13
+ export declare const hostChatReducer: import("@reduxjs/toolkit").Reducer<HostChatState>;
14
+ export declare const selectEnableChatActionsPopup: (state: {
15
+ chat: HostChatState;
16
+ }) => boolean;
17
+ export {};
@@ -3,3 +3,8 @@ export * from "./tracking";
3
3
  export * from "./files/filesSlice";
4
4
  export * from "./csv";
5
5
  export * from "./monetization/slice";
6
+ export * from "./rbac/rbac-slice";
7
+ export * from "./chat-input/api-slice";
8
+ export * from "./host-chat/slice";
9
+ export * from "./subscription/slice";
10
+ export * from "./top-banner/slice";
@@ -0,0 +1,13 @@
1
+ import { Reducer } from "@reduxjs/toolkit";
2
+ export type RbacPermissions = {
3
+ mentors: Record<string, unknown>;
4
+ mentor: Record<string, unknown>;
5
+ };
6
+ export interface RbacState {
7
+ rbacPermissions: RbacPermissions | Record<string, never>;
8
+ }
9
+ export declare const updateRbacPermissions: import("@reduxjs/toolkit").ActionCreatorWithPayload<RbacPermissions | Record<string, never>, "rbac/updateRbacPermissions">;
10
+ export declare const rbacReducer: Reducer<RbacState>;
11
+ export declare const selectRbacPermissions: (state: {
12
+ rbac: RbacState;
13
+ }) => RbacPermissions | Record<string, never>;
@@ -0,0 +1,12 @@
1
+ export declare const SUBSCRIPTION_TRIGGERS: {
2
+ PRICING_MODAL: string;
3
+ SUBSCRIBE_USER: string;
4
+ };
5
+ export declare const SUBSCRIPTION_USER_CAPABILITIES: {
6
+ FREE_TRIAL: string;
7
+ FREE_PACKAGE: string;
8
+ STUDENT_UNDER_PAID_PACKAGE: string;
9
+ PAID_PACKAGE: string;
10
+ PRO_PACKAGE: string;
11
+ STARTER_PACKAGE: string;
12
+ };
@@ -0,0 +1,29 @@
1
+ import { type Slice } from "@reduxjs/toolkit";
2
+ interface PricingModalData {
3
+ referenceId: string;
4
+ customerEmail: string;
5
+ publishableKey: string;
6
+ pricingTableId: string;
7
+ }
8
+ interface FreeTrialUsageOptions {
9
+ count: number;
10
+ limitReached: boolean;
11
+ message: string;
12
+ }
13
+ interface SubscriptionStatus {
14
+ creditExhausted: boolean;
15
+ userCapability?: string;
16
+ callToAction?: string;
17
+ }
18
+ export interface SubscriptionState {
19
+ openPricingModal: boolean;
20
+ openAppleRestrictionModal: boolean;
21
+ freeTrialUsageOptions: FreeTrialUsageOptions;
22
+ pricingModalData: PricingModalData;
23
+ subscriptionStatus: SubscriptionStatus;
24
+ error402Detected: string;
25
+ }
26
+ export declare const subscriptionSlice: Slice<SubscriptionState>;
27
+ export declare const setOpenPricingModal: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<`${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPayload<any, `${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>, setOpenAppleRestrictionModal: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<`${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPayload<any, `${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>, setFreeTrialUsageOptions: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<`${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPayload<any, `${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>, setPricingModalData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<`${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPayload<any, `${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>, setSubscriptionStatus: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<`${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPayload<any, `${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>, setError402Detected: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<`${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPayload<any, `${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>;
28
+ export declare const subscriptionReducer: import("@reduxjs/toolkit").Reducer<SubscriptionState>;
29
+ export {};
@@ -0,0 +1,24 @@
1
+ import { type Slice } from "@reduxjs/toolkit";
2
+ /**
3
+ * Structural shape of TopBannerProps. Mirrors `@iblai/web-containers`
4
+ * `<TopBanner>` so this slice can be consumed without taking a circular
5
+ * dependency on the web-containers package.
6
+ */
7
+ export interface TopBannerOptions {
8
+ parentContainerSelector: string;
9
+ bannerText?: string;
10
+ loading?: boolean;
11
+ tooltipText?: string;
12
+ buttonHandler?: () => void;
13
+ buttonLabel?: string;
14
+ onLoad?: (bannerRef: HTMLDivElement) => void;
15
+ onClose?: () => void;
16
+ enabled: boolean;
17
+ onUpgrade?: string;
18
+ }
19
+ export interface TopBannerState {
20
+ topBannerOptions: TopBannerOptions;
21
+ }
22
+ export declare const topBannerSlice: Slice<TopBannerState>;
23
+ export declare const setTopBannerOptions: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<`${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPayload<any, `${string}/${string}`> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, never, any> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, never> | import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<any[], any, `${string}/${string}`, any, any>;
24
+ export declare const topBannerReducer: import("@reduxjs/toolkit").Reducer<TopBannerState>;
@@ -49,7 +49,7 @@ export declare function useAdvancedChat({ tenantKey, mentorId, username, token,
49
49
  isConnected: React.MutableRefObject<boolean>;
50
50
  messageQueue: React.MutableRefObject<any[]>;
51
51
  sessionIds: import("../../features").SessionIds;
52
- enableSafetyDisclaimer: boolean;
52
+ enableSafetyDisclaimer: any;
53
53
  resetConnection: () => void;
54
54
  isLoadingChats: boolean;
55
55
  refetchChats: () => Promise<void>;
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import type { AdvancedTab } from "../../utils/data/advanced-tab";
3
3
  import { ChatStatus } from "@web-utils/features";
4
4
  import { FileReference } from "../../types/file-upload";
5
- import { Error402MessageData } from "@web-utils/types";
5
+ import type { Error402MessageData } from "@web-utils/types";
6
6
  type MessageActionTypes = "redirectToAuthSpaJoinTenant";
7
7
  export interface MessageAction {
8
8
  text: string;
@@ -5,6 +5,7 @@ export * from "./subscription-v2/use-subscription-handler";
5
5
  export * from "./subscription-v2/class-subscription-flow";
6
6
  export * from "./subscription-v2/use-external-pricing-plan";
7
7
  export * from "./subscription-v2/constants";
8
+ export * from "./subscription-v2/use-402-error-check";
8
9
  export * from "./use-day-js";
9
10
  export * from "./chat/use-advanced-chat";
10
11
  export * from "./chat/use-mentor-tools";
@@ -16,3 +17,25 @@ export * from "./tenant-metadata/use-tenant-metadata";
16
17
  export * from "./tenant-metadata/constants";
17
18
  export * from "./use-mentor-settings";
18
19
  export * from "./stripe/use-stripe-upgrade";
20
+ export * from "./use-isomorphic-layout-effect";
21
+ export * from "./use-event-callback";
22
+ export * from "./use-event-listener";
23
+ export * from "./use-local-storage";
24
+ export * from "./use-user";
25
+ export * from "./use-tokens";
26
+ export * from "./use-accessing-public-route";
27
+ export * from "./use-embed-mode";
28
+ export * from "./use-chat-file-upload";
29
+ export * from "./use-model-file-upload-capabilities";
30
+ export * from "./use-file-drag-drop";
31
+ export * from "./use-cached-session-id";
32
+ export * from "./use-user-agreement";
33
+ export * from "./use-show-voice-recorder";
34
+ export * from "./use-show-voice-call";
35
+ export * from "./use-show-attachment";
36
+ export { default as useWelcomeMessage } from "./use-welcome-message";
37
+ export * from "./use-responsive";
38
+ export * from "./use-timer";
39
+ export * from "./use-voice-chat";
40
+ export * from "./use-show-free-trial-dialog";
41
+ export * from "./use-os";
@@ -0,0 +1,22 @@
1
+ export type PricingTablePayload = {
2
+ pricing_table_id?: string;
3
+ publishable_key?: string;
4
+ client_reference_id?: string;
5
+ };
6
+ type Local402Data = {
7
+ error?: string;
8
+ message?: string;
9
+ pricing_table?: PricingTablePayload;
10
+ };
11
+ interface Use402ErrorCheckProps {
12
+ /**
13
+ * Called when an admin hits a 402. Hosts wire this to whatever navigation
14
+ * primitive they use (Next router push, history.pushState, custom event, etc.)
15
+ * to surface the billing tab.
16
+ */
17
+ navigateToAdminBilling: () => void;
18
+ }
19
+ export declare const use402ErrorCheck: ({ navigateToAdminBilling, }: Use402ErrorCheckProps) => {
20
+ handle402Error: (messageData: Local402Data) => Promise<void>;
21
+ };
22
+ export {};
@@ -0,0 +1 @@
1
+ export declare function useAccessingPublicRoute(): boolean;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Persists a map of mentorId -> sessionId in localStorage so a chat session
3
+ * can be restored across reloads on a per-mentor basis.
4
+ *
5
+ * Returns a tuple shaped like useLocalStorage:
6
+ * `[cachedSessionId, saveCachedSessionId]`.
7
+ */
8
+ export declare function useCachedSessionId(): [Record<string, string>, import("react").Dispatch<import("react").SetStateAction<Record<string, string>>>, () => void];
@@ -0,0 +1,17 @@
1
+ interface FileUploadCapabilities {
2
+ supportsFileUpload: boolean;
3
+ allSupportedTypes: string[];
4
+ maxFileSizeMB: number;
5
+ maxFilesPerMessage: number;
6
+ }
7
+ interface UseChatFileUploadProps {
8
+ org: string;
9
+ userId: string;
10
+ errorHandler?: (error: string) => void;
11
+ capabilities?: FileUploadCapabilities;
12
+ }
13
+ export declare function useChatFileUpload({ org, userId, errorHandler, capabilities, }: UseChatFileUploadProps): {
14
+ uploadFiles: (files: File[]) => Promise<void>;
15
+ retryUpload: (fileId: string) => Promise<void>;
16
+ };
17
+ export {};
@@ -0,0 +1 @@
1
+ export declare function useEmbedMode(): boolean;
@@ -0,0 +1,2 @@
1
+ export declare function useEventCallback<Args extends unknown[], R>(fn: (...args: Args) => R): (...args: Args) => R;
2
+ export declare function useEventCallback<Args extends unknown[], R>(fn: ((...args: Args) => R) | undefined): ((...args: Args) => R) | undefined;
@@ -0,0 +1,6 @@
1
+ import type { RefObject } from "react";
2
+ declare function useEventListener<K extends keyof MediaQueryListEventMap>(eventName: K, handler: (event: MediaQueryListEventMap[K]) => void, element: RefObject<MediaQueryList>, options?: boolean | AddEventListenerOptions): void;
3
+ declare function useEventListener<K extends keyof WindowEventMap>(eventName: K, handler: (event: WindowEventMap[K]) => void, element?: undefined, options?: boolean | AddEventListenerOptions): void;
4
+ declare function useEventListener<K extends keyof HTMLElementEventMap & keyof SVGElementEventMap, T extends Element = K extends keyof HTMLElementEventMap ? HTMLDivElement : SVGElement>(eventName: K, handler: ((event: HTMLElementEventMap[K]) => void) | ((event: SVGElementEventMap[K]) => void), element: RefObject<T>, options?: boolean | AddEventListenerOptions): void;
5
+ declare function useEventListener<K extends keyof DocumentEventMap>(eventName: K, handler: (event: DocumentEventMap[K]) => void, element: RefObject<Document>, options?: boolean | AddEventListenerOptions): void;
6
+ export { useEventListener };
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ interface UseFileDragDropOptions {
3
+ org: string;
4
+ userId: string;
5
+ mentorId: string;
6
+ tenantKey: string;
7
+ isPublicRoute?: boolean;
8
+ }
9
+ export declare function useFileDragDrop({ org, userId, mentorId, tenantKey, isPublicRoute, }: UseFileDragDropOptions): {
10
+ isDraggingFile: boolean;
11
+ handleDragOver: (e: React.DragEvent) => void;
12
+ handleDragLeave: (e: React.DragEvent) => void;
13
+ handleDrop: (e: React.DragEvent) => Promise<void>;
14
+ };
15
+ export {};
@@ -0,0 +1,2 @@
1
+ import { useLayoutEffect } from "react";
2
+ export declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
@@ -0,0 +1,13 @@
1
+ import type { Dispatch, SetStateAction } from "react";
2
+ declare global {
3
+ interface WindowEventMap {
4
+ "local-storage": CustomEvent;
5
+ }
6
+ }
7
+ type UseLocalStorageOptions<T> = {
8
+ serializer?: (value: T) => string;
9
+ deserializer?: (value: string) => T;
10
+ initializeWithValue?: boolean;
11
+ };
12
+ export declare function useLocalStorage<T>(key: string, initialValue: T | (() => T), options?: UseLocalStorageOptions<T>): [T, Dispatch<SetStateAction<T>>, () => void];
13
+ export {};
@@ -1,26 +1,46 @@
1
1
  type Props = {
2
2
  mentorId: string;
3
3
  tenantKey: string;
4
- username: string;
4
+ /**
5
+ * Whether the caller is on a public route (e.g. a shareable token link).
6
+ * Skips the private mentor-settings query when true.
7
+ */
5
8
  isPublicRoute?: boolean;
9
+ /**
10
+ * Key of the platform's "main" tenant. When provided, isCommunityMentor
11
+ * resolves to true only if the mentor lives under this tenant. Without it,
12
+ * isCommunityMentor is always false.
13
+ */
14
+ mainTenantKey?: string;
6
15
  };
7
- type MentorSettingsData = {
8
- profileImage?: string | null;
9
- greetingMethod?: string | null;
10
- proactiveResponse?: string | null;
11
- llmProvider?: string | null;
12
- llmName?: string | null;
13
- mentorUniqueId?: string | null;
14
- mentorVisibility?: string | null | any;
15
- mentorName?: string | null;
16
- enableGuidedPrompts?: boolean | null;
17
- mentorSlug?: string | null;
18
- safetyDisclaimer: boolean;
19
- mentorTools?: any[] | null;
20
- allowAnonymous?: boolean | null;
16
+ export declare function useMentorSettings({ mentorId, tenantKey, isPublicRoute, mainTenantKey, }: Props): {
17
+ isLoading: boolean;
18
+ data: {
19
+ profileImage: string | null | undefined;
20
+ greetingMethod: string | undefined;
21
+ proactiveResponse: string | undefined;
22
+ llmProvider: string;
23
+ llmName: string | undefined;
24
+ mentorUniqueId: string | undefined;
25
+ mentorName: string | undefined;
26
+ enableGuidedPrompts: boolean | undefined;
27
+ mentorSlug: string | undefined;
28
+ safetyDisclaimer: any;
29
+ isCommunityMentor: boolean;
30
+ disclaimer: string | undefined;
31
+ mentorVisibility: import("@iblai/iblai-api").NullEnum | null | undefined;
32
+ allowAnonymous: boolean | undefined;
33
+ showAttachment: boolean | undefined;
34
+ showVoiceCall: boolean | undefined;
35
+ showVoiceRecord: boolean | undefined;
36
+ embedShowAttachment: boolean | undefined;
37
+ embedShowVoiceCall: boolean | undefined;
38
+ embedShowVoiceRecord: boolean | undefined;
39
+ llmConfig: any;
40
+ mentorDbId: number | undefined;
41
+ starterPrompts: string | undefined;
42
+ memoryEnabled: boolean;
43
+ mentorTools: any;
44
+ };
21
45
  };
22
- type UseMentorSettingsReturn = {
23
- data: MentorSettingsData;
24
- };
25
- export declare function useMentorSettings({ mentorId, tenantKey, username, isPublicRoute, }: Props): UseMentorSettingsReturn;
26
46
  export {};
@@ -0,0 +1,21 @@
1
+ interface UseModelFileUploadCapabilitiesProps {
2
+ mentorId: string;
3
+ tenantKey: string;
4
+ isPublicRoute?: boolean;
5
+ }
6
+ export interface FileUploadCapabilities {
7
+ supportsFileUpload: boolean;
8
+ supportsImages: boolean;
9
+ supportsDocuments: boolean;
10
+ supportedImageTypes: string[];
11
+ supportedDocumentTypes: string[];
12
+ allSupportedTypes: string[];
13
+ maxFileSizeMB: number;
14
+ maxFilesPerMessage: number;
15
+ supportsFileUrls: boolean;
16
+ }
17
+ /**
18
+ * Hook to determine file upload capabilities based on the LLM config.
19
+ */
20
+ export declare function useModelFileUploadCapabilities({ mentorId, tenantKey, isPublicRoute, }: UseModelFileUploadCapabilitiesProps): FileUploadCapabilities;
21
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Returns OS-derived flags. Currently only detects whether the host is an
3
+ * Apple device (macOS or iOS) via Tauri's plugin-os. In plain browsers
4
+ * (no Tauri runtime) `isAppleDevice` is always false.
5
+ */
6
+ export declare const useOS: () => {
7
+ isAppleDevice: boolean;
8
+ };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Tracks container width / viewport and returns a small screen-size bag.
3
+ * If a ref is passed, the hook observes that element via ResizeObserver
4
+ * and reacts to its width changes; otherwise it tracks window width.
5
+ */
6
+ export declare const useResponsive: (containerRef?: React.RefObject<HTMLElement>) => {
7
+ isMobile: boolean;
8
+ isTablet: boolean;
9
+ isLaptop: boolean;
10
+ isDesktop: boolean;
11
+ screenSize: "sm" | "md" | "lg" | "xl";
12
+ containerWidth: number;
13
+ };
@@ -0,0 +1,7 @@
1
+ interface UseShowAttachmentProps {
2
+ mentorId: string;
3
+ tenantKey: string;
4
+ isPublicRoute?: boolean;
5
+ }
6
+ export declare function useShowAttachment({ mentorId, tenantKey, isPublicRoute, }: UseShowAttachmentProps): boolean;
7
+ export {};
@@ -0,0 +1,31 @@
1
+ import type { ComponentType } from "react";
2
+ interface FreeTrialDialogProps {
3
+ isOpen: boolean;
4
+ onClose: () => void;
5
+ }
6
+ interface UseShowFreeTrialDialogReturn {
7
+ FreeTrialDialog: ComponentType<FreeTrialDialogProps> | null;
8
+ closeModal: () => void;
9
+ isModalOpen: boolean;
10
+ /**
11
+ * Run a callback, optionally gated by the trial check. The second
12
+ * `enforceTrialCheck` flag mirrors the mentor app's signature so call
13
+ * sites that pass `false` (i.e. opt-out of gating) typecheck against
14
+ * the stub. The stub ignores the flag and always runs the callback.
15
+ */
16
+ executeWithTrialCheck: (callback: () => void, enforceTrialCheck?: boolean) => void;
17
+ }
18
+ /**
19
+ * Stub implementation of the mentor app's free-trial gate.
20
+ *
21
+ * Always reports the gate as inactive (`isModalOpen: false`,
22
+ * `FreeTrialDialog: null`) and executes any guarded callback immediately.
23
+ * Mirrors the call-site shape of the mentor app's
24
+ * `useShowFreeTrialDialog` so the reusable Chat can render without
25
+ * pulling in the entire subscription / Apple-restriction flow.
26
+ *
27
+ * Host apps that want a real gate should replace this hook with their
28
+ * own implementation that wires up the subscription flow they use.
29
+ */
30
+ export declare function useShowFreeTrialDialog(): UseShowFreeTrialDialogReturn;
31
+ export {};
@@ -0,0 +1,7 @@
1
+ interface UseShowVoiceCallProps {
2
+ mentorId: string;
3
+ tenantKey: string;
4
+ isPublicRoute?: boolean;
5
+ }
6
+ export declare function useShowVoiceCall({ mentorId, tenantKey, isPublicRoute, }: UseShowVoiceCallProps): boolean;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ interface UseShowVoiceRecorderProps {
2
+ mentorId: string;
3
+ tenantKey: string;
4
+ isPublicRoute?: boolean;
5
+ }
6
+ export declare function useShowVoiceRecorder({ mentorId, tenantKey, isPublicRoute, }: UseShowVoiceRecorderProps): boolean;
7
+ export {};