@abpjs/theme-basic 0.7.6

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 (38) hide show
  1. package/LICENSE +165 -0
  2. package/README.md +680 -0
  3. package/dist/components/blocks/sidebars/sidebar-with-collapsible/block.d.ts +1 -0
  4. package/dist/components/blocks/sidebars/sidebar-with-collapsible/index.d.ts +10 -0
  5. package/dist/components/blocks/sidebars/sidebar-with-collapsible/language-selector.d.ts +8 -0
  6. package/dist/components/blocks/sidebars/sidebar-with-collapsible/logo.d.ts +15 -0
  7. package/dist/components/blocks/sidebars/sidebar-with-collapsible/nav-links.d.ts +12 -0
  8. package/dist/components/blocks/sidebars/sidebar-with-collapsible/navbar.d.ts +7 -0
  9. package/dist/components/blocks/sidebars/sidebar-with-collapsible/search-context.d.ts +20 -0
  10. package/dist/components/blocks/sidebars/sidebar-with-collapsible/search-field.d.ts +1 -0
  11. package/dist/components/blocks/sidebars/sidebar-with-collapsible/sidebar-link.d.ts +16 -0
  12. package/dist/components/blocks/sidebars/sidebar-with-collapsible/sidebar.d.ts +26 -0
  13. package/dist/components/blocks/sidebars/sidebar-with-collapsible/user-profile.d.ts +8 -0
  14. package/dist/components/change-password/ChangePassword.d.ts +26 -0
  15. package/dist/components/change-password/index.d.ts +1 -0
  16. package/dist/components/index.d.ts +7 -0
  17. package/dist/components/layout/Layout.d.ts +30 -0
  18. package/dist/components/layout/index.d.ts +1 -0
  19. package/dist/components/layout-account/LayoutAccount.d.ts +45 -0
  20. package/dist/components/layout-account/index.d.ts +1 -0
  21. package/dist/components/layout-application/LayoutApplication.d.ts +60 -0
  22. package/dist/components/layout-application/index.d.ts +1 -0
  23. package/dist/components/layout-empty/LayoutEmpty.d.ts +23 -0
  24. package/dist/components/layout-empty/index.d.ts +1 -0
  25. package/dist/components/profile/Profile.d.ts +28 -0
  26. package/dist/components/profile/index.d.ts +1 -0
  27. package/dist/contexts/branding.context.d.ts +67 -0
  28. package/dist/contexts/index.d.ts +2 -0
  29. package/dist/contexts/layout.context.d.ts +60 -0
  30. package/dist/hooks/index.d.ts +1 -0
  31. package/dist/index.d.ts +20 -0
  32. package/dist/index.js +1466 -0
  33. package/dist/index.mjs +1435 -0
  34. package/dist/models/index.d.ts +1 -0
  35. package/dist/models/layout.d.ts +26 -0
  36. package/dist/providers/ThemeBasicProvider.d.ts +92 -0
  37. package/dist/providers/index.d.ts +1 -0
  38. package/package.json +59 -0
package/dist/index.js ADDED
@@ -0,0 +1,1466 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ Block: () => Block,
24
+ BrandingProvider: () => BrandingProvider,
25
+ ChangePassword: () => ChangePassword,
26
+ DefaultLogo: () => DefaultLogo,
27
+ LAYOUTS: () => LAYOUTS,
28
+ LanguageSelector: () => LanguageSelector,
29
+ LayoutAccount: () => LayoutAccount,
30
+ LayoutApplication: () => LayoutApplication,
31
+ LayoutBase: () => LayoutBase,
32
+ LayoutEmpty: () => LayoutEmpty,
33
+ LayoutProvider: () => LayoutProvider,
34
+ Logo: () => Logo,
35
+ LogoIcon: () => LogoIcon,
36
+ LogoText: () => LogoText,
37
+ NavLinks: () => NavLinks,
38
+ Navbar: () => Navbar,
39
+ Profile: () => Profile,
40
+ SIDEBAR_Z_INDEX: () => SIDEBAR_Z_INDEX,
41
+ SearchField: () => SearchField,
42
+ SearchProvider: () => SearchProvider,
43
+ Sidebar: () => Sidebar,
44
+ SidebarLink: () => SidebarLink,
45
+ ThemeBasicProvider: () => ThemeBasicProvider,
46
+ UserProfile: () => UserProfile,
47
+ defaultThemeBasicConfig: () => defaultThemeBasicConfig,
48
+ defineConfig: () => import_theme_shared3.defineConfig,
49
+ useBranding: () => useBranding,
50
+ useLayoutContext: () => useLayoutContext,
51
+ useLayoutService: () => useLayoutService,
52
+ useLogo: () => useLogo,
53
+ useNavigationElements: () => useNavigationElements,
54
+ useSearch: () => useSearch
55
+ });
56
+ module.exports = __toCommonJS(index_exports);
57
+
58
+ // src/contexts/layout.context.tsx
59
+ var import_react = require("react");
60
+ var import_jsx_runtime = require("react/jsx-runtime");
61
+ var LayoutContext = (0, import_react.createContext)(null);
62
+ function LayoutProvider({ children }) {
63
+ const [navigationElements, setNavigationElements] = (0, import_react.useState)([]);
64
+ const addNavigationElement = (0, import_react.useCallback)(
65
+ (elements) => {
66
+ const payloadArray = Array.isArray(elements) ? elements : [elements];
67
+ setNavigationElements((prev) => {
68
+ const newElements = payloadArray.filter(
69
+ ({ name }) => prev.findIndex((nav) => nav.name === name) < 0
70
+ );
71
+ if (newElements.length === 0) {
72
+ return prev;
73
+ }
74
+ const merged = [...prev, ...newElements].map((element) => ({
75
+ ...element,
76
+ order: element.order ?? 99
77
+ })).sort((a, b) => (a.order ?? 99) - (b.order ?? 99));
78
+ return merged;
79
+ });
80
+ },
81
+ []
82
+ );
83
+ const removeNavigationElement = (0, import_react.useCallback)((name) => {
84
+ setNavigationElements((prev) => prev.filter((el) => el.name !== name));
85
+ }, []);
86
+ const clearNavigationElements = (0, import_react.useCallback)(() => {
87
+ setNavigationElements([]);
88
+ }, []);
89
+ const state = (0, import_react.useMemo)(
90
+ () => ({
91
+ navigationElements
92
+ }),
93
+ [navigationElements]
94
+ );
95
+ const service = (0, import_react.useMemo)(
96
+ () => ({
97
+ addNavigationElement,
98
+ removeNavigationElement,
99
+ clearNavigationElements
100
+ }),
101
+ [addNavigationElement, removeNavigationElement, clearNavigationElements]
102
+ );
103
+ const contextValue = (0, import_react.useMemo)(
104
+ () => ({
105
+ state,
106
+ service
107
+ }),
108
+ [state, service]
109
+ );
110
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LayoutContext.Provider, { value: contextValue, children });
111
+ }
112
+ function useLayoutContext() {
113
+ const context = (0, import_react.useContext)(LayoutContext);
114
+ if (!context) {
115
+ throw new Error("useLayoutContext must be used within a LayoutProvider");
116
+ }
117
+ return context;
118
+ }
119
+ function useLayoutService() {
120
+ return useLayoutContext().service;
121
+ }
122
+ function useNavigationElements() {
123
+ return useLayoutContext().state.navigationElements;
124
+ }
125
+
126
+ // src/contexts/branding.context.tsx
127
+ var import_react2 = require("react");
128
+ var import_jsx_runtime2 = require("react/jsx-runtime");
129
+ var defaultConfig = {
130
+ appName: "ABP Application",
131
+ logoLink: "/"
132
+ };
133
+ var BrandingContext = (0, import_react2.createContext)({
134
+ config: defaultConfig
135
+ });
136
+ function BrandingProvider({
137
+ children,
138
+ logo,
139
+ logoIcon,
140
+ appName,
141
+ logoLink
142
+ }) {
143
+ const config = (0, import_react2.useMemo)(
144
+ () => ({
145
+ logo,
146
+ logoIcon: logoIcon || logo,
147
+ // Fallback to full logo if icon not provided
148
+ appName: appName || defaultConfig.appName,
149
+ logoLink: logoLink || defaultConfig.logoLink
150
+ }),
151
+ [logo, logoIcon, appName, logoLink]
152
+ );
153
+ const contextValue = (0, import_react2.useMemo)(
154
+ () => ({ config }),
155
+ [config]
156
+ );
157
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(BrandingContext.Provider, { value: contextValue, children });
158
+ }
159
+ function useBranding() {
160
+ return (0, import_react2.useContext)(BrandingContext).config;
161
+ }
162
+ function useLogo(preferIcon = false) {
163
+ const { logo, logoIcon, appName } = useBranding();
164
+ if (preferIcon && logoIcon) {
165
+ return logoIcon;
166
+ }
167
+ return logo || appName;
168
+ }
169
+
170
+ // src/components/layout/Layout.tsx
171
+ var import_react3 = require("react");
172
+ var import_react4 = require("@chakra-ui/react");
173
+ var import_lucide_react = require("lucide-react");
174
+ var import_react_router_dom = require("react-router-dom");
175
+ var import_jsx_runtime3 = require("react/jsx-runtime");
176
+ function LayoutBase({
177
+ brandName = "MyProjectName",
178
+ brandLink = "/",
179
+ children,
180
+ renderOutlet = true
181
+ }) {
182
+ const [isOpen, setIsOpen] = (0, import_react3.useState)(false);
183
+ const onToggle = () => setIsOpen(!isOpen);
184
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
185
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
186
+ import_react4.Box,
187
+ {
188
+ as: "nav",
189
+ id: "main-navbar",
190
+ position: "fixed",
191
+ top: 0,
192
+ left: 0,
193
+ right: 0,
194
+ zIndex: "sticky",
195
+ bg: "gray.800",
196
+ color: "white",
197
+ px: 4,
198
+ py: 2,
199
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
200
+ import_react4.Flex,
201
+ {
202
+ maxW: "container.xl",
203
+ mx: "auto",
204
+ align: "center",
205
+ justify: "space-between",
206
+ wrap: "wrap",
207
+ children: [
208
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
209
+ import_react4.Box,
210
+ {
211
+ asChild: true,
212
+ fontWeight: "bold",
213
+ fontSize: "lg",
214
+ color: "white",
215
+ _hover: { textDecoration: "none" },
216
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_router_dom.Link, { to: brandLink, children: brandName })
217
+ }
218
+ ),
219
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
220
+ import_react4.IconButton,
221
+ {
222
+ display: { base: "flex", md: "none" },
223
+ onClick: onToggle,
224
+ variant: "ghost",
225
+ color: "white",
226
+ "aria-label": "Toggle Navigation",
227
+ "aria-expanded": isOpen,
228
+ _hover: { bg: "gray.700" },
229
+ children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.X, { size: 12 }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.Menu, { size: 20 })
230
+ }
231
+ ),
232
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react4.Collapsible.Root, { open: isOpen, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react4.Collapsible.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
233
+ import_react4.Box,
234
+ {
235
+ display: { base: "block", md: "none" },
236
+ pb: 4,
237
+ w: "full",
238
+ children
239
+ }
240
+ ) }) }),
241
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
242
+ import_react4.Flex,
243
+ {
244
+ display: { base: "none", md: "flex" },
245
+ align: "center",
246
+ flex: 1,
247
+ ml: 8,
248
+ children
249
+ }
250
+ )
251
+ ]
252
+ }
253
+ )
254
+ }
255
+ ),
256
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react4.Container, { maxW: "container.xl", pt: "5rem", pb: 4, children: renderOutlet && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_router_dom.Outlet, {}) })
257
+ ] });
258
+ }
259
+
260
+ // src/components/layout-application/LayoutApplication.tsx
261
+ var import_react20 = require("react");
262
+ var import_react21 = require("@chakra-ui/react");
263
+ var import_react_router_dom6 = require("react-router-dom");
264
+ var import_core8 = require("@abpjs/core");
265
+
266
+ // src/components/blocks/sidebars/sidebar-with-collapsible/sidebar.tsx
267
+ var import_react14 = require("@chakra-ui/react");
268
+ var import_lu5 = require("react-icons/lu");
269
+
270
+ // src/components/blocks/sidebars/sidebar-with-collapsible/logo.tsx
271
+ var import_react5 = require("@chakra-ui/react");
272
+ var import_react_router_dom2 = require("react-router-dom");
273
+ var import_jsx_runtime4 = require("react/jsx-runtime");
274
+ var DefaultLogo = (props) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { height: "28", viewBox: "0 0 143 50", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
275
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("title", { children: "Logo" }),
276
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
277
+ "path",
278
+ {
279
+ fillRule: "evenodd",
280
+ clipRule: "evenodd",
281
+ d: "M20.127 0C15.466 0 11.2287 1.69492 7.83887 4.23729L30.9321 31.9915L49.788 17.7966C48.9406 7.83898 40.466 0 30.0846 0",
282
+ fill: "var(--chakra-colors-color-palette-solid)"
283
+ }
284
+ ),
285
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
286
+ "path",
287
+ {
288
+ fillRule: "evenodd",
289
+ clipRule: "evenodd",
290
+ d: "M30.0847 50C41.1017 50 50 41.1017 50 30.0847V29.0254L32.839 41.7373C30.9322 43.2203 28.178 42.7966 26.6949 41.1017L2.11864 11.4407C0.847458 13.983 0 16.9491 0 19.9152V29.8729C0 40.8898 8.89831 49.7881 19.9153 49.7881",
291
+ fill: "var(--chakra-colors-color-palette-emphasized)"
292
+ }
293
+ ),
294
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
295
+ "path",
296
+ {
297
+ d: "M67.736 37V11.8H71.876V37H67.736ZM70.58 37V33.22H83.756V37H70.58ZM93.2313 37.36C91.5513 37.36 90.0273 36.964 88.6593 36.172C87.2913 35.356 86.1993 34.264 85.3833 32.896C84.5913 31.528 84.1953 30.004 84.1953 28.324C84.1953 26.644 84.5913 25.132 85.3833 23.788C86.1993 22.444 87.2913 21.376 88.6593 20.584C90.0273 19.768 91.5513 19.36 93.2313 19.36C94.9353 19.36 96.4713 19.756 97.8393 20.548C99.2073 21.34 100.287 22.42 101.079 23.788C101.895 25.132 102.303 26.644 102.303 28.324C102.303 30.004 101.895 31.528 101.079 32.896C100.287 34.264 99.2073 35.356 97.8393 36.172C96.4713 36.964 94.9353 37.36 93.2313 37.36ZM93.2313 33.544C94.2153 33.544 95.0793 33.328 95.8233 32.896C96.5913 32.44 97.1793 31.816 97.5873 31.024C98.0193 30.232 98.2353 29.332 98.2353 28.324C98.2353 27.316 98.0193 26.428 97.5873 25.66C97.1553 24.892 96.5673 24.292 95.8233 23.86C95.0793 23.404 94.2153 23.176 93.2313 23.176C92.2713 23.176 91.4073 23.404 90.6393 23.86C89.8953 24.292 89.3073 24.892 88.8753 25.66C88.4673 26.428 88.2633 27.316 88.2633 28.324C88.2633 29.332 88.4673 30.232 88.8753 31.024C89.3073 31.816 89.8953 32.44 90.6393 32.896C91.4073 33.328 92.2713 33.544 93.2313 33.544ZM111.716 44.56C109.892 44.56 108.296 44.224 106.928 43.552C105.56 42.904 104.456 41.98 103.616 40.78L106.208 38.188C106.904 39.052 107.696 39.7 108.584 40.132C109.472 40.564 110.54 40.78 111.788 40.78C113.348 40.78 114.584 40.372 115.496 39.556C116.408 38.764 116.864 37.672 116.864 36.28V32.032L117.548 28.216L116.864 24.364V19.72H120.824V36.28C120.824 37.936 120.44 39.376 119.672 40.6C118.904 41.848 117.836 42.82 116.468 43.516C115.1 44.212 113.516 44.56 111.716 44.56ZM111.536 36.64C110 36.64 108.608 36.268 107.36 35.524C106.136 34.756 105.164 33.712 104.444 32.392C103.748 31.072 103.4 29.596 103.4 27.964C103.4 26.332 103.748 24.868 104.444 23.572C105.164 22.276 106.136 21.256 107.36 20.512C108.608 19.744 110 19.36 111.536 19.36C112.904 19.36 114.104 19.636 115.136 20.188C116.168 20.74 116.972 21.508 117.548 22.492C118.124 23.452 118.412 24.58 118.412 25.876V30.124C118.412 31.396 118.112 32.524 117.512 33.508C116.936 34.492 116.132 35.26 115.1 35.812C114.068 36.364 112.88 36.64 111.536 36.64ZM112.328 32.896C113.288 32.896 114.128 32.692 114.848 32.284C115.568 31.876 116.12 31.312 116.504 30.592C116.912 29.848 117.116 28.984 117.116 28C117.116 27.016 116.912 26.164 116.504 25.444C116.12 24.7 115.568 24.124 114.848 23.716C114.128 23.308 113.288 23.104 112.328 23.104C111.368 23.104 110.516 23.308 109.772 23.716C109.052 24.124 108.488 24.7 108.08 25.444C107.672 26.164 107.468 27.016 107.468 28C107.468 28.96 107.672 29.812 108.08 30.556C108.488 31.3 109.052 31.876 109.772 32.284C110.516 32.692 111.368 32.896 112.328 32.896ZM132.063 37.36C130.383 37.36 128.859 36.964 127.491 36.172C126.123 35.356 125.031 34.264 124.215 32.896C123.423 31.528 123.027 30.004 123.027 28.324C123.027 26.644 123.423 25.132 124.215 23.788C125.031 22.444 126.123 21.376 127.491 20.584C128.859 19.768 130.383 19.36 132.063 19.36C133.767 19.36 135.303 19.756 136.671 20.548C138.039 21.34 139.119 22.42 139.911 23.788C140.727 25.132 141.136 26.644 141.136 28.324C141.136 30.004 140.727 31.528 139.911 32.896C139.119 34.264 138.039 35.356 136.671 36.172C135.303 36.964 133.767 37.36 132.063 37.36ZM132.063 33.544C133.047 33.544 133.911 33.328 134.655 32.896C135.423 32.44 136.011 31.816 136.419 31.024C136.851 30.232 137.067 29.332 137.067 28.324C137.067 27.316 136.851 26.428 136.419 25.66C135.987 24.892 135.399 24.292 134.655 23.86C133.911 23.404 133.047 23.176 132.063 23.176C131.103 23.176 130.239 23.404 129.471 23.86C128.727 24.292 128.139 24.892 127.707 25.66C127.299 26.428 127.095 27.316 127.095 28.324C127.095 29.332 127.299 30.232 127.707 31.024C128.139 31.816 128.727 32.44 129.471 32.896C130.239 33.328 131.103 33.544 132.063 33.544Z",
298
+ fill: "var(--chakra-colors-fg)"
299
+ }
300
+ )
301
+ ] });
302
+ var Logo = ({ style }) => {
303
+ const { logo, appName, logoLink } = useBranding();
304
+ const logoContent = logo || (appName ? appName : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DefaultLogo, { style }));
305
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react5.Box, { asChild: true, style, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_router_dom2.Link, { to: logoLink || "/", children: typeof logoContent === "string" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react5.Text, { fontWeight: "bold", fontSize: "lg", children: logoContent }) : logoContent }) });
306
+ };
307
+ var LogoText = (props) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { height: "24", viewBox: "0 0 75 34", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
308
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("title", { children: "Logo" }),
309
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
310
+ "path",
311
+ {
312
+ d: "M0.736 26V0.799998H4.876V26H0.736ZM3.58 26V22.22H16.756V26H3.58ZM26.2313 26.36C24.5513 26.36 23.0273 25.964 21.6593 25.172C20.2913 24.356 19.1993 23.264 18.3833 21.896C17.5913 20.528 17.1953 19.004 17.1953 17.324C17.1953 15.644 17.5913 14.132 18.3833 12.788C19.1993 11.444 20.2913 10.376 21.6593 9.584C23.0273 8.768 24.5513 8.36 26.2313 8.36C27.9353 8.36 29.4713 8.756 30.8393 9.548C32.2073 10.34 33.2873 11.42 34.0793 12.788C34.8953 14.132 35.3033 15.644 35.3033 17.324C35.3033 19.004 34.8953 20.528 34.0793 21.896C33.2873 23.264 32.2073 24.356 30.8393 25.172C29.4713 25.964 27.9353 26.36 26.2313 26.36ZM26.2313 22.544C27.2153 22.544 28.0793 22.328 28.8233 21.896C29.5913 21.44 30.1793 20.816 30.5873 20.024C31.0193 19.232 31.2353 18.332 31.2353 17.324C31.2353 16.316 31.0193 15.428 30.5873 14.66C30.1553 13.892 29.5673 13.292 28.8233 12.86C28.0793 12.404 27.2153 12.176 26.2313 12.176C25.2713 12.176 24.4073 12.404 23.6393 12.86C22.8953 13.292 22.3073 13.892 21.8753 14.66C21.4673 15.428 21.2633 16.316 21.2633 17.324C21.2633 18.332 21.4673 19.232 21.8753 20.024C22.3073 20.816 22.8953 21.44 23.6393 21.896C24.4073 22.328 25.2713 22.544 26.2313 22.544ZM44.7165 33.56C42.8925 33.56 41.2965 33.224 39.9285 32.552C38.5605 31.904 37.4565 30.98 36.6165 29.78L39.2085 27.188C39.9045 28.052 40.6965 28.7 41.5845 29.132C42.4725 29.564 43.5405 29.78 44.7885 29.78C46.3485 29.78 47.5845 29.372 48.4965 28.556C49.4085 27.764 49.8645 26.672 49.8645 25.28V21.032L50.5485 17.216L49.8645 13.364V8.72H53.8245V25.28C53.8245 26.936 53.4405 28.376 52.6725 29.6C51.9045 30.848 50.8365 31.82 49.4685 32.516C48.1005 33.212 46.5165 33.56 44.7165 33.56ZM44.5365 25.64C43.0005 25.64 41.6085 25.268 40.3605 24.524C39.1365 23.756 38.1645 22.712 37.4445 21.392C36.7485 20.072 36.4005 18.596 36.4005 16.964C36.4005 15.332 36.7485 13.868 37.4445 12.572C38.1645 11.276 39.1365 10.256 40.3605 9.512C41.6085 8.744 43.0005 8.36 44.5365 8.36C45.9045 8.36 47.1045 8.636 48.1365 9.188C49.1685 9.74 49.9725 10.508 50.5485 11.492C51.1245 12.452 51.4125 13.58 51.4125 14.876V19.124C51.4125 20.396 51.1125 21.524 50.5125 22.508C49.9365 23.492 49.1325 24.26 48.1005 24.812C47.0685 25.364 45.8805 25.64 44.5365 25.64ZM45.3285 21.896C46.2885 21.896 47.1285 21.692 47.8485 21.284C48.5685 20.876 49.1205 20.312 49.5045 19.592C49.9125 18.848 50.1165 17.984 50.1165 17C50.1165 16.016 49.9125 15.164 49.5045 14.444C49.1205 13.7 48.5685 13.124 47.8485 12.716C47.1285 12.308 46.2885 12.104 45.3285 12.104C44.3685 12.104 43.5165 12.308 42.7725 12.716C42.0525 13.124 41.4885 13.7 41.0805 14.444C40.6725 15.164 40.4685 16.016 40.4685 17C40.4685 17.96 40.6725 18.812 41.0805 19.556C41.4885 20.3 42.0525 20.876 42.7725 21.284C43.5165 21.692 44.3685 21.896 45.3285 21.896ZM65.0635 26.36C63.3835 26.36 61.8595 25.964 60.4915 25.172C59.1235 24.356 58.0315 23.264 57.2155 21.896C56.4235 20.528 56.0275 19.004 56.0275 17.324C56.0275 15.644 56.4235 14.132 57.2155 12.788C58.0315 11.444 59.1235 10.376 60.4915 9.584C61.8595 8.768 63.3835 8.36 65.0635 8.36C66.7675 8.36 68.3035 8.756 69.6715 9.548C71.0395 10.34 72.1195 11.42 72.9115 12.788C73.7275 14.132 74.1355 15.644 74.1355 17.324C74.1355 19.004 73.7275 20.528 72.9115 21.896C72.1195 23.264 71.0395 24.356 69.6715 25.172C68.3035 25.964 66.7675 26.36 65.0635 26.36ZM65.0635 22.544C66.0475 22.544 66.9115 22.328 67.6555 21.896C68.4235 21.44 69.0115 20.816 69.4195 20.024C69.8515 19.232 70.0675 18.332 70.0675 17.324C70.0675 16.316 69.8515 15.428 69.4195 14.66C68.9875 13.892 68.3995 13.292 67.6555 12.86C66.9115 12.404 66.0475 12.176 65.0635 12.176C64.1035 12.176 63.2395 12.404 62.4715 12.86C61.7275 13.292 61.1395 13.892 60.7075 14.66C60.2995 15.428 60.0955 16.316 60.0955 17.324C60.0955 18.332 60.2995 19.232 60.7075 20.024C61.1395 20.816 61.7275 21.44 62.4715 21.896C63.2395 22.328 64.1035 22.544 65.0635 22.544Z",
313
+ fill: "var(--chakra-colors-fg)"
314
+ }
315
+ )
316
+ ] });
317
+ var LogoIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { height: "24", viewBox: "0 0 50 50", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
318
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("title", { children: "Logo" }),
319
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
320
+ "path",
321
+ {
322
+ fillRule: "evenodd",
323
+ clipRule: "evenodd",
324
+ d: "M20.127 0C15.466 0 11.2287 1.69492 7.83887 4.23729L30.9321 31.9915L49.788 17.7966C48.9406 7.83898 40.466 0 30.0846 0",
325
+ fill: "var(--chakra-colors-color-palette-solid)"
326
+ }
327
+ ),
328
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
329
+ "path",
330
+ {
331
+ fillRule: "evenodd",
332
+ clipRule: "evenodd",
333
+ d: "M30.0847 50C41.1017 50 50 41.1017 50 30.0847V29.0254L32.839 41.7373C30.9322 43.2203 28.178 42.7966 26.6949 41.1017L2.11864 11.4407C0.847458 13.983 0 16.9491 0 19.9152V29.8729C0 40.8898 8.89831 49.7881 19.9153 49.7881",
334
+ fill: "var(--chakra-colors-color-palette-emphasized)"
335
+ }
336
+ )
337
+ ] });
338
+
339
+ // src/components/blocks/sidebars/sidebar-with-collapsible/search-field.tsx
340
+ var import_react7 = require("@chakra-ui/react");
341
+ var import_lu = require("react-icons/lu");
342
+ var import_core = require("@abpjs/core");
343
+
344
+ // src/components/blocks/sidebars/sidebar-with-collapsible/search-context.tsx
345
+ var import_react6 = require("react");
346
+ var import_jsx_runtime5 = require("react/jsx-runtime");
347
+ var SearchContext = (0, import_react6.createContext)(void 0);
348
+ var SearchProvider = ({ children }) => {
349
+ const [searchQuery, setSearchQuery] = (0, import_react6.useState)("");
350
+ const value = (0, import_react6.useMemo)(
351
+ () => ({
352
+ searchQuery,
353
+ setSearchQuery
354
+ }),
355
+ [searchQuery]
356
+ );
357
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SearchContext.Provider, { value, children });
358
+ };
359
+ var useSearch = () => {
360
+ const context = (0, import_react6.useContext)(SearchContext);
361
+ if (!context) {
362
+ return {
363
+ searchQuery: "",
364
+ setSearchQuery: () => {
365
+ }
366
+ };
367
+ }
368
+ return context;
369
+ };
370
+
371
+ // src/components/blocks/sidebars/sidebar-with-collapsible/search-field.tsx
372
+ var import_jsx_runtime6 = require("react/jsx-runtime");
373
+ var SearchField = () => {
374
+ const { t } = (0, import_core.useLocalization)();
375
+ const { searchQuery, setSearchQuery } = useSearch();
376
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
377
+ import_react7.InputGroup,
378
+ {
379
+ flex: "1",
380
+ startElement: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react7.Icon, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lu.LuSearch, {}) }),
381
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
382
+ import_react7.Input,
383
+ {
384
+ placeholder: t("AbpUi::Search"),
385
+ value: searchQuery,
386
+ onChange: (e) => setSearchQuery(e.target.value)
387
+ }
388
+ )
389
+ }
390
+ );
391
+ };
392
+
393
+ // src/components/blocks/sidebars/sidebar-with-collapsible/sidebar-link.tsx
394
+ var import_react8 = require("@chakra-ui/react");
395
+ var import_react_router_dom3 = require("react-router-dom");
396
+ var import_jsx_runtime7 = require("react/jsx-runtime");
397
+ var SidebarLink = (props) => {
398
+ const { children, href, exact = false, badge, badgeColorPalette = "gray", ...buttonProps } = props;
399
+ const location = (0, import_react_router_dom3.useLocation)();
400
+ const isRootPath = !href || href === "/";
401
+ const isActive = href !== void 0 ? isRootPath || exact ? location.pathname === href || location.pathname === "/" + href : location.pathname.startsWith(href) : false;
402
+ const content = badge ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_react8.HStack, { width: "full", children: [
403
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react8.HStack, { gap: "3", children }),
404
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react8.Spacer, {}),
405
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react8.Badge, { size: "sm", colorPalette: badgeColorPalette, variant: "solid", children: badge })
406
+ ] }) : children;
407
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
408
+ import_react8.Button,
409
+ {
410
+ variant: "ghost",
411
+ width: "full",
412
+ justifyContent: "start",
413
+ gap: "3",
414
+ color: isActive ? "colorPalette.fg" : "fg.muted",
415
+ bg: isActive ? "colorPalette.subtle" : void 0,
416
+ _hover: {
417
+ bg: "colorPalette.subtle",
418
+ color: "colorPalette.fg"
419
+ },
420
+ asChild: !!href,
421
+ ...buttonProps,
422
+ children: href ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_router_dom3.NavLink, { to: href, children: content }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: content })
423
+ }
424
+ );
425
+ };
426
+
427
+ // src/components/blocks/sidebars/sidebar-with-collapsible/user-profile.tsx
428
+ var import_react9 = require("@chakra-ui/react");
429
+ var import_lu2 = require("react-icons/lu");
430
+ var import_core2 = require("@abpjs/core");
431
+ var import_react_router_dom4 = require("react-router-dom");
432
+ var import_jsx_runtime8 = require("react/jsx-runtime");
433
+ var UserProfile = ({ onChangePassword, onProfile, onLogout, loginUrl = "/account/login" }) => {
434
+ const { currentUser } = (0, import_core2.useConfig)();
435
+ const { isAuthenticated } = (0, import_core2.useAuth)();
436
+ const { endSide } = (0, import_core2.useDirection)();
437
+ const { t } = (0, import_core2.useLocalization)();
438
+ if (!isAuthenticated || !currentUser) {
439
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react9.Button, { asChild: true, variant: "outline", width: "full", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_router_dom4.Link, { to: loginUrl, children: [
440
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lu2.LuLogIn, {}),
441
+ t("AbpAccount::Login")
442
+ ] }) });
443
+ }
444
+ const getInitials = () => {
445
+ const userName = currentUser.userName || "";
446
+ return userName.slice(0, 2).toUpperCase();
447
+ };
448
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react9.HStack, { gap: "3", justify: "space-between", children: [
449
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react9.HStack, { gap: "3", children: [
450
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react9.Avatar.Root, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react9.Avatar.Fallback, { children: getInitials() }) }),
451
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react9.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react9.Text, { textStyle: "sm", fontWeight: "medium", children: currentUser.userName }) })
452
+ ] }),
453
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react9.Menu.Root, { positioning: { placement: `${endSide}-start` }, children: [
454
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react9.Menu.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
455
+ import_react9.Box,
456
+ {
457
+ as: "button",
458
+ p: "2",
459
+ borderRadius: "md",
460
+ cursor: "pointer",
461
+ _hover: { bg: "colorPalette.subtle" },
462
+ "aria-label": "User menu",
463
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lu2.LuEllipsisVertical, {})
464
+ }
465
+ ) }),
466
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react9.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react9.Menu.Positioner, { style: { zIndex: SIDEBAR_Z_INDEX + 100 }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react9.Menu.Content, { children: [
467
+ onProfile && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react9.Menu.Item, { value: "profile", onClick: onProfile, children: [
468
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lu2.LuUser, {}),
469
+ t("AbpUi::PersonalInfo")
470
+ ] }),
471
+ onChangePassword && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react9.Menu.Item, { value: "change-password", onClick: onChangePassword, children: [
472
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lu2.LuKey, {}),
473
+ t("AbpUi::ChangePassword")
474
+ ] }),
475
+ onLogout && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react9.Menu.Item, { value: "logout", onClick: onLogout, color: "red.500", children: [
476
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lu2.LuLogOut, {}),
477
+ t("AbpUi::Logout")
478
+ ] })
479
+ ] }) }) })
480
+ ] })
481
+ ] });
482
+ };
483
+
484
+ // src/components/blocks/sidebars/sidebar-with-collapsible/nav-links.tsx
485
+ var import_react10 = require("@chakra-ui/react");
486
+ var import_lu3 = require("react-icons/lu");
487
+ var import_core3 = require("@abpjs/core");
488
+ var import_react11 = require("react");
489
+ var import_react_router_dom5 = require("react-router-dom");
490
+ var import_jsx_runtime9 = require("react/jsx-runtime");
491
+ function getVisibleRoutes(routes) {
492
+ return routes.reduce((acc, val) => {
493
+ if (val.invisible) {
494
+ return acc;
495
+ }
496
+ const route = { ...val };
497
+ if (route.children && route.children.length) {
498
+ route.children = getVisibleRoutes(route.children);
499
+ }
500
+ return [...acc, route];
501
+ }, []);
502
+ }
503
+ function filterRoutesBySearch(routes, searchQuery) {
504
+ if (!searchQuery.trim()) {
505
+ return routes;
506
+ }
507
+ const query = searchQuery.toLowerCase().trim();
508
+ return routes.reduce((acc, route) => {
509
+ const nameMatches = route.name?.toLowerCase().includes(query);
510
+ let matchingChildren = [];
511
+ if (route.children && route.children.length) {
512
+ matchingChildren = filterRoutesBySearch(route.children, searchQuery);
513
+ }
514
+ if (nameMatches || matchingChildren.length > 0) {
515
+ const filteredRoute = { ...route };
516
+ if (matchingChildren.length > 0) {
517
+ filteredRoute.children = matchingChildren;
518
+ }
519
+ return [...acc, filteredRoute];
520
+ }
521
+ return acc;
522
+ }, []);
523
+ }
524
+ var CollapsibleNavLink = ({ route }) => {
525
+ const location = (0, import_react_router_dom5.useLocation)();
526
+ const { direction } = (0, import_core3.useDirection)();
527
+ const isChildActive = (0, import_react11.useMemo)(() => {
528
+ const checkActive = (routes) => {
529
+ return routes.some((r) => {
530
+ const path = r.url || r.path || "";
531
+ if (path && location.pathname.startsWith(path)) {
532
+ return true;
533
+ }
534
+ if (r.children?.length) {
535
+ return checkActive(r.children);
536
+ }
537
+ return false;
538
+ });
539
+ };
540
+ return route.children ? checkActive(route.children) : false;
541
+ }, [route.children, location.pathname]);
542
+ const [isOpen, setIsOpen] = (0, import_react11.useState)(isChildActive);
543
+ const showHighlight = !isOpen && isChildActive;
544
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react10.Collapsible.Root, { defaultOpen: isChildActive, onOpenChange: (details) => setIsOpen(details.open), children: [
545
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react10.Collapsible.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
546
+ import_react10.Button,
547
+ {
548
+ variant: "ghost",
549
+ width: "full",
550
+ justifyContent: "start",
551
+ color: showHighlight ? "colorPalette.fg" : "fg.muted",
552
+ bg: showHighlight ? "colorPalette.subtle" : void 0,
553
+ dir: direction,
554
+ _hover: {
555
+ bg: "colorPalette.subtle",
556
+ color: "colorPalette.fg"
557
+ },
558
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react10.HStack, { justifyContent: "space-between", width: "full", children: [
559
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react10.HStack, { gap: "3", children: [
560
+ route.icon,
561
+ route.name
562
+ ] }),
563
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react10.HStack, { gap: "2", children: [
564
+ route.badge !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react10.Badge, { size: "sm", colorPalette: route.badgeColorPalette || "gray", variant: "solid", children: route.badge }),
565
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react10.Collapsible.Context, { children: (context) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
566
+ import_react10.Icon,
567
+ {
568
+ "aria-hidden": true,
569
+ transition: "transform 0.2s",
570
+ transformOrigin: "center",
571
+ transform: context.open ? "rotate(180deg)" : void 0,
572
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lu3.LuChevronDown, {})
573
+ }
574
+ ) })
575
+ ] })
576
+ ] })
577
+ }
578
+ ) }),
579
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react10.Collapsible.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react10.Stack, { gap: "1", py: "1", children: route.children?.map((child) => {
580
+ const childRoute = child;
581
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
582
+ SidebarLink,
583
+ {
584
+ href: childRoute.url || child.path,
585
+ ps: "12",
586
+ badge: child.badge,
587
+ badgeColorPalette: child.badgeColorPalette,
588
+ children: [
589
+ child.icon,
590
+ child.name
591
+ ]
592
+ },
593
+ child.name
594
+ );
595
+ }) }) })
596
+ ] });
597
+ };
598
+ var NavLinks = ({ defaultIcon }) => {
599
+ const { routes } = (0, import_core3.useConfig)();
600
+ const { searchQuery } = useSearch();
601
+ const visibleRoutes = (0, import_react11.useMemo)(() => {
602
+ const visible = getVisibleRoutes(routes || []);
603
+ return filterRoutesBySearch(visible, searchQuery);
604
+ }, [routes, searchQuery]);
605
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react10.Stack, { gap: "1", children: visibleRoutes.map((route) => {
606
+ const icon = route.icon || defaultIcon;
607
+ const hasChildren = route.children && route.children.length > 0;
608
+ if (hasChildren) {
609
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CollapsibleNavLink, { route }, route.name);
610
+ }
611
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
612
+ SidebarLink,
613
+ {
614
+ href: route.url || route.path,
615
+ badge: route.badge,
616
+ badgeColorPalette: route.badgeColorPalette,
617
+ children: [
618
+ icon,
619
+ route.name
620
+ ]
621
+ },
622
+ route.name
623
+ );
624
+ }) });
625
+ };
626
+
627
+ // src/components/blocks/sidebars/sidebar-with-collapsible/language-selector.tsx
628
+ var import_react12 = require("@chakra-ui/react");
629
+ var import_lu4 = require("react-icons/lu");
630
+ var import_core4 = require("@abpjs/core");
631
+ var import_react13 = require("react");
632
+ var import_jsx_runtime10 = require("react/jsx-runtime");
633
+ var LanguageSelector = ({ compact = false }) => {
634
+ const { localization } = (0, import_core4.useConfig)();
635
+ const { language, setLanguage } = (0, import_core4.useSession)();
636
+ const handleLanguageChange = (0, import_react13.useCallback)((cultureName) => {
637
+ setLanguage(cultureName);
638
+ window.location.reload();
639
+ }, [setLanguage]);
640
+ const languages = (0, import_react13.useMemo)(() => {
641
+ return localization?.languages || [];
642
+ }, [localization]);
643
+ const currentLanguage = (0, import_react13.useMemo)(() => {
644
+ return languages.find((lang) => lang.cultureName === language);
645
+ }, [languages, language]);
646
+ const otherLanguages = (0, import_react13.useMemo)(() => {
647
+ return languages.filter((lang) => lang.cultureName !== language);
648
+ }, [languages, language]);
649
+ if (languages.length <= 1) {
650
+ return null;
651
+ }
652
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react12.Menu.Root, { children: [
653
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react12.Menu.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
654
+ import_react12.Button,
655
+ {
656
+ variant: "ghost",
657
+ width: "full",
658
+ justifyContent: "start",
659
+ gap: "3",
660
+ color: "fg.muted",
661
+ _hover: {
662
+ bg: "colorPalette.subtle",
663
+ color: "colorPalette.fg"
664
+ },
665
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react12.HStack, { justifyContent: "space-between", width: "full", children: [
666
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react12.HStack, { gap: "3", children: [
667
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lu4.LuGlobe, {}),
668
+ !compact && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react12.Text, { children: currentLanguage?.displayName || currentLanguage?.cultureName })
669
+ ] }),
670
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lu4.LuChevronDown, {})
671
+ ] })
672
+ }
673
+ ) }),
674
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react12.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react12.Menu.Positioner, { style: { zIndex: SIDEBAR_Z_INDEX + 100 }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react12.Menu.Content, { children: otherLanguages.map((lang) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
675
+ import_react12.Menu.Item,
676
+ {
677
+ value: lang.cultureName,
678
+ onClick: () => handleLanguageChange(lang.cultureName),
679
+ children: lang.displayName || lang.cultureName
680
+ },
681
+ lang.cultureName
682
+ )) }) }) })
683
+ ] });
684
+ };
685
+
686
+ // src/components/blocks/sidebars/sidebar-with-collapsible/sidebar.tsx
687
+ var import_jsx_runtime11 = require("react/jsx-runtime");
688
+ var Sidebar = ({
689
+ showSearch = true,
690
+ showLanguageSelector = true,
691
+ showHelpCenter = false,
692
+ helpCenterUrl,
693
+ showSettings = false,
694
+ settingsUrl,
695
+ defaultIcon,
696
+ userProfileProps,
697
+ headerContent,
698
+ footerContent,
699
+ ...props
700
+ }) => {
701
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SearchProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
702
+ import_react14.Stack,
703
+ {
704
+ flex: "1",
705
+ p: { base: "4", md: "6" },
706
+ bg: "bg.panel",
707
+ borderInlineEndWidth: "1px",
708
+ justifyContent: "space-between",
709
+ maxW: "xs",
710
+ ...props,
711
+ children: [
712
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react14.Stack, { gap: "6", children: [
713
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Logo, { style: { alignSelf: "start" } }),
714
+ headerContent,
715
+ showSearch && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SearchField, {}),
716
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(NavLinks, { defaultIcon })
717
+ ] }),
718
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react14.Stack, { gap: "4", separator: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react14.StackSeparator, {}), children: [
719
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react14.Box, {}),
720
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react14.Stack, { gap: "1", children: [
721
+ showLanguageSelector && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(LanguageSelector, {}),
722
+ showHelpCenter && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(SidebarLink, { href: helpCenterUrl, children: [
723
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lu5.LuCircleHelp, {}),
724
+ " Help Center"
725
+ ] }),
726
+ showSettings && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(SidebarLink, { href: settingsUrl, children: [
727
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lu5.LuSettings, {}),
728
+ " Settings"
729
+ ] }),
730
+ footerContent
731
+ ] }),
732
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(UserProfile, { ...userProfileProps })
733
+ ] })
734
+ ]
735
+ }
736
+ ) });
737
+ };
738
+
739
+ // src/components/blocks/sidebars/sidebar-with-collapsible/navbar.tsx
740
+ var import_react15 = require("@chakra-ui/react");
741
+ var import_lu6 = require("react-icons/lu");
742
+ var import_core5 = require("@abpjs/core");
743
+ var import_jsx_runtime12 = require("react/jsx-runtime");
744
+ var Navbar = ({ sidebarProps, ...props }) => {
745
+ const { isRtl } = (0, import_core5.useDirection)();
746
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react15.Container, { py: "2.5", background: "bg.panel", borderBottomWidth: "1px", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react15.HStack, { justify: "space-between", children: [
747
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Logo, {}),
748
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react15.Drawer.Root, { placement: isRtl ? "end" : "start", children: [
749
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react15.Drawer.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react15.IconButton, { "aria-label": "Open Menu", variant: "ghost", colorPalette: "gray", children: isRtl ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lu6.LuAlignLeft, {}) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lu6.LuAlignRight, {}) }) }),
750
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react15.Portal, { children: [
751
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react15.Drawer.Backdrop, {}),
752
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react15.Drawer.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react15.Drawer.Content, { children: [
753
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react15.Drawer.CloseTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react15.CloseButton, { size: "sm", colorPalette: "gray" }) }),
754
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Sidebar, { ...sidebarProps })
755
+ ] }) })
756
+ ] })
757
+ ] })
758
+ ] }) });
759
+ };
760
+
761
+ // src/components/blocks/sidebars/sidebar-with-collapsible/block.tsx
762
+ var import_jsx_runtime13 = require("react/jsx-runtime");
763
+ var Block = () => {
764
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
765
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Navbar, { hideFrom: "md" }),
766
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Sidebar, { hideBelow: "md" })
767
+ ] });
768
+ };
769
+
770
+ // src/components/change-password/ChangePassword.tsx
771
+ var import_react16 = require("react");
772
+ var import_react17 = require("@chakra-ui/react");
773
+ var import_react_hook_form = require("react-hook-form");
774
+ var import_core6 = require("@abpjs/core");
775
+ var import_theme_shared = require("@abpjs/theme-shared");
776
+ var import_lucide_react2 = require("lucide-react");
777
+ var import_jsx_runtime14 = require("react/jsx-runtime");
778
+ function ChangePassword({
779
+ visible,
780
+ onVisibleChange
781
+ }) {
782
+ const { t } = (0, import_core6.useLocalization)();
783
+ const { changePassword } = (0, import_core6.useProfile)();
784
+ const toaster = (0, import_theme_shared.useToaster)();
785
+ const {
786
+ register,
787
+ handleSubmit,
788
+ watch,
789
+ reset,
790
+ formState: { errors, isSubmitting }
791
+ } = (0, import_react_hook_form.useForm)({
792
+ defaultValues: {
793
+ password: "",
794
+ newPassword: "",
795
+ repeatNewPassword: ""
796
+ }
797
+ });
798
+ const newPassword = watch("newPassword");
799
+ (0, import_react16.useEffect)(() => {
800
+ if (visible) {
801
+ reset();
802
+ }
803
+ }, [visible, reset]);
804
+ const onSubmit = async (data) => {
805
+ try {
806
+ await changePassword({
807
+ currentPassword: data.password,
808
+ newPassword: data.newPassword
809
+ });
810
+ toaster.success(
811
+ t("AbpIdentity::PasswordChangedMessage") || "Password changed successfully",
812
+ t("AbpUi::Success") || "Success"
813
+ );
814
+ onVisibleChange(false);
815
+ } catch (error) {
816
+ toaster.error(
817
+ error instanceof Error ? error.message : "An error occurred",
818
+ t("AbpIdentity::PasswordChangeFailed") || "Failed to change password"
819
+ );
820
+ }
821
+ };
822
+ const handleClose = () => {
823
+ onVisibleChange(false);
824
+ };
825
+ const passwordValidation = {
826
+ required: t("AbpIdentity::ThisFieldIsRequired") || "This field is required",
827
+ minLength: {
828
+ value: 6,
829
+ message: t("AbpIdentity::PasswordTooShort") || "Password must be at least 6 characters"
830
+ },
831
+ validate: {
832
+ hasLowercase: (value) => /[a-z]/.test(value) || t("AbpIdentity::PasswordRequiresLower") || "Password must contain a lowercase letter",
833
+ hasUppercase: (value) => /[A-Z]/.test(value) || t("AbpIdentity::PasswordRequiresUpper") || "Password must contain an uppercase letter",
834
+ hasNumber: (value) => /[0-9]/.test(value) || t("AbpIdentity::PasswordRequiresDigit") || "Password must contain a number",
835
+ hasSpecial: (value) => /[!@#$%^&*(),.?":{}|<>]/.test(value) || t("AbpIdentity::PasswordRequiresNonAlphanumeric") || "Password must contain a special character"
836
+ }
837
+ };
838
+ const modalFooter = /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
839
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react17.Button, { variant: "ghost", mr: 3, onClick: handleClose, children: t("AbpIdentity::Cancel") || "Cancel" }),
840
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
841
+ import_react17.Button,
842
+ {
843
+ colorPalette: "blue",
844
+ type: "submit",
845
+ loading: isSubmitting,
846
+ form: "change-password-form",
847
+ children: [
848
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react2.Check, { size: 16 }),
849
+ t("AbpIdentity::Save") || "Save"
850
+ ]
851
+ }
852
+ )
853
+ ] });
854
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
855
+ import_theme_shared.Modal,
856
+ {
857
+ visible,
858
+ onVisibleChange,
859
+ header: t("AbpIdentity::ChangePassword") || "Change Password",
860
+ footer: modalFooter,
861
+ centered: true,
862
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("form", { id: "change-password-form", onSubmit: handleSubmit(onSubmit), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react17.VStack, { gap: 4, children: [
863
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react17.Field.Root, { invalid: !!errors.password, children: [
864
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react17.Field.Label, { children: [
865
+ t("AbpIdentity::DisplayName:CurrentPassword") || "Current Password",
866
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react17.Field.RequiredIndicator, {})
867
+ ] }),
868
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
869
+ import_react17.Input,
870
+ {
871
+ type: "password",
872
+ ...register("password", {
873
+ required: t("AbpIdentity::ThisFieldIsRequired") || "This field is required"
874
+ })
875
+ }
876
+ ),
877
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react17.Field.ErrorText, { children: errors.password?.message })
878
+ ] }),
879
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react17.Field.Root, { invalid: !!errors.newPassword, children: [
880
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react17.Field.Label, { children: [
881
+ t("AbpIdentity::DisplayName:NewPassword") || "New Password",
882
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react17.Field.RequiredIndicator, {})
883
+ ] }),
884
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
885
+ import_react17.Input,
886
+ {
887
+ type: "password",
888
+ ...register("newPassword", passwordValidation)
889
+ }
890
+ ),
891
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react17.Field.ErrorText, { children: errors.newPassword?.message })
892
+ ] }),
893
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react17.Field.Root, { invalid: !!errors.repeatNewPassword, children: [
894
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react17.Field.Label, { children: [
895
+ t("AbpIdentity::DisplayName:NewPasswordConfirm") || "Confirm New Password",
896
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react17.Field.RequiredIndicator, {})
897
+ ] }),
898
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
899
+ import_react17.Input,
900
+ {
901
+ type: "password",
902
+ ...register("repeatNewPassword", {
903
+ required: t("AbpIdentity::ThisFieldIsRequired") || "This field is required",
904
+ validate: (value) => value === newPassword || t("AbpIdentity::Identity.PasswordConfirmationFailed") || "Passwords do not match"
905
+ })
906
+ }
907
+ ),
908
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react17.Field.ErrorText, { children: errors.repeatNewPassword?.message })
909
+ ] })
910
+ ] }) })
911
+ }
912
+ );
913
+ }
914
+
915
+ // src/components/profile/Profile.tsx
916
+ var import_react18 = require("react");
917
+ var import_react19 = require("@chakra-ui/react");
918
+ var import_react_hook_form2 = require("react-hook-form");
919
+ var import_core7 = require("@abpjs/core");
920
+ var import_theme_shared2 = require("@abpjs/theme-shared");
921
+ var import_lucide_react3 = require("lucide-react");
922
+ var import_jsx_runtime15 = require("react/jsx-runtime");
923
+ function Profile({
924
+ visible,
925
+ onVisibleChange
926
+ }) {
927
+ const { t } = (0, import_core7.useLocalization)();
928
+ const { profile, fetchProfile, updateProfile, loading } = (0, import_core7.useProfile)();
929
+ const toaster = (0, import_theme_shared2.useToaster)();
930
+ const {
931
+ register,
932
+ handleSubmit,
933
+ reset,
934
+ formState: { errors, isSubmitting }
935
+ } = (0, import_react_hook_form2.useForm)({
936
+ defaultValues: {
937
+ userName: "",
938
+ email: "",
939
+ name: "",
940
+ surname: "",
941
+ phoneNumber: ""
942
+ }
943
+ });
944
+ (0, import_react18.useEffect)(() => {
945
+ if (visible) {
946
+ fetchProfile().then(() => {
947
+ });
948
+ }
949
+ }, [visible, fetchProfile]);
950
+ (0, import_react18.useEffect)(() => {
951
+ if (profile) {
952
+ reset({
953
+ userName: profile.userName || "",
954
+ email: profile.email || "",
955
+ name: profile.name || "",
956
+ surname: profile.surname || "",
957
+ phoneNumber: profile.phoneNumber || ""
958
+ });
959
+ }
960
+ }, [profile, reset]);
961
+ const onSubmit = async (data) => {
962
+ try {
963
+ await updateProfile(data);
964
+ toaster.success(
965
+ t("AbpIdentity::ProfileUpdatedMessage") || "Profile updated successfully",
966
+ t("AbpUi::Success") || "Success"
967
+ );
968
+ onVisibleChange(false);
969
+ } catch (error) {
970
+ toaster.error(
971
+ error instanceof Error ? error.message : "An error occurred",
972
+ t("AbpIdentity::ProfileUpdateFailed") || "Failed to update profile"
973
+ );
974
+ }
975
+ };
976
+ const handleClose = () => {
977
+ onVisibleChange(false);
978
+ };
979
+ const modalFooter = /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
980
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react19.Button, { variant: "ghost", mr: 3, onClick: handleClose, children: t("AbpIdentity::Cancel") || "Cancel" }),
981
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
982
+ import_react19.Button,
983
+ {
984
+ colorPalette: "blue",
985
+ type: "submit",
986
+ loading: isSubmitting || loading,
987
+ form: "profile-form",
988
+ children: [
989
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react3.Check, { size: 16 }),
990
+ t("AbpIdentity::Save") || "Save"
991
+ ]
992
+ }
993
+ )
994
+ ] });
995
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
996
+ import_theme_shared2.Modal,
997
+ {
998
+ visible,
999
+ onVisibleChange,
1000
+ header: t("AbpIdentity::PersonalInfo") || "Personal Info",
1001
+ footer: modalFooter,
1002
+ size: "lg",
1003
+ centered: true,
1004
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("form", { id: "profile-form", onSubmit: handleSubmit(onSubmit), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react19.VStack, { gap: 4, children: [
1005
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react19.Field.Root, { invalid: !!errors.userName, children: [
1006
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react19.Field.Label, { children: [
1007
+ t("AbpIdentity::DisplayName:UserName") || "Username",
1008
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react19.Field.RequiredIndicator, {})
1009
+ ] }),
1010
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1011
+ import_react19.Input,
1012
+ {
1013
+ type: "text",
1014
+ ...register("userName", {
1015
+ required: t("AbpIdentity::ThisFieldIsRequired") || "This field is required",
1016
+ maxLength: {
1017
+ value: 256,
1018
+ message: "Maximum 256 characters"
1019
+ }
1020
+ })
1021
+ }
1022
+ ),
1023
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react19.Field.ErrorText, { children: errors.userName?.message })
1024
+ ] }),
1025
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react19.HStack, { gap: 4, w: "full", children: [
1026
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react19.Field.Root, { invalid: !!errors.name, flex: 1, children: [
1027
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react19.Field.Label, { children: t("AbpIdentity::DisplayName:Name") || "Name" }),
1028
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1029
+ import_react19.Input,
1030
+ {
1031
+ type: "text",
1032
+ ...register("name", {
1033
+ maxLength: {
1034
+ value: 64,
1035
+ message: "Maximum 64 characters"
1036
+ }
1037
+ })
1038
+ }
1039
+ ),
1040
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react19.Field.ErrorText, { children: errors.name?.message })
1041
+ ] }),
1042
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react19.Field.Root, { invalid: !!errors.surname, flex: 1, children: [
1043
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react19.Field.Label, { children: t("AbpIdentity::DisplayName:Surname") || "Surname" }),
1044
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1045
+ import_react19.Input,
1046
+ {
1047
+ type: "text",
1048
+ ...register("surname", {
1049
+ maxLength: {
1050
+ value: 64,
1051
+ message: "Maximum 64 characters"
1052
+ }
1053
+ })
1054
+ }
1055
+ ),
1056
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react19.Field.ErrorText, { children: errors.surname?.message })
1057
+ ] })
1058
+ ] }),
1059
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react19.Field.Root, { invalid: !!errors.email, children: [
1060
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react19.Field.Label, { children: [
1061
+ t("AbpIdentity::DisplayName:EmailAddress") || "Email Address",
1062
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react19.Field.RequiredIndicator, {})
1063
+ ] }),
1064
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1065
+ import_react19.Input,
1066
+ {
1067
+ type: "email",
1068
+ ...register("email", {
1069
+ required: t("AbpIdentity::ThisFieldIsRequired") || "This field is required",
1070
+ pattern: {
1071
+ value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,
1072
+ message: t("AbpIdentity::InvalidEmail") || "Invalid email address"
1073
+ },
1074
+ maxLength: {
1075
+ value: 256,
1076
+ message: "Maximum 256 characters"
1077
+ }
1078
+ })
1079
+ }
1080
+ ),
1081
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react19.Field.ErrorText, { children: errors.email?.message })
1082
+ ] }),
1083
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react19.Field.Root, { invalid: !!errors.phoneNumber, children: [
1084
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react19.Field.Label, { children: t("AbpIdentity::DisplayName:PhoneNumber") || "Phone Number" }),
1085
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1086
+ import_react19.Input,
1087
+ {
1088
+ type: "tel",
1089
+ ...register("phoneNumber", {
1090
+ maxLength: {
1091
+ value: 16,
1092
+ message: "Maximum 16 characters"
1093
+ }
1094
+ })
1095
+ }
1096
+ ),
1097
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react19.Field.ErrorText, { children: errors.phoneNumber?.message })
1098
+ ] })
1099
+ ] }) })
1100
+ }
1101
+ );
1102
+ }
1103
+
1104
+ // src/components/layout-application/LayoutApplication.tsx
1105
+ var import_jsx_runtime16 = require("react/jsx-runtime");
1106
+ var SIDEBAR_Z_INDEX = 1100;
1107
+ function LayoutApplication({
1108
+ showLanguageSelector = true,
1109
+ showCurrentUser = true,
1110
+ showSearch = true,
1111
+ showHelpCenter = false,
1112
+ helpCenterUrl,
1113
+ showSettings = false,
1114
+ settingsUrl,
1115
+ defaultIcon,
1116
+ headerContent,
1117
+ footerContent,
1118
+ children
1119
+ }) {
1120
+ const navigate = (0, import_react_router_dom6.useNavigate)();
1121
+ const { logout } = (0, import_core8.useAuth)();
1122
+ const { direction, isRtl } = (0, import_core8.useDirection)();
1123
+ const [isChangePasswordOpen, setIsChangePasswordOpen] = (0, import_react20.useState)(false);
1124
+ const [isProfileOpen, setIsProfileOpen] = (0, import_react20.useState)(false);
1125
+ const handleLogout = (0, import_react20.useCallback)(() => {
1126
+ logout();
1127
+ navigate("/account/login");
1128
+ }, [logout, navigate]);
1129
+ const handleChangePassword = (0, import_react20.useCallback)(() => {
1130
+ setIsChangePasswordOpen(true);
1131
+ }, []);
1132
+ const handleProfile = (0, import_react20.useCallback)(() => {
1133
+ setIsProfileOpen(true);
1134
+ }, []);
1135
+ const sidebarProps = {
1136
+ showSearch,
1137
+ showLanguageSelector,
1138
+ showHelpCenter,
1139
+ helpCenterUrl,
1140
+ showSettings,
1141
+ settingsUrl,
1142
+ defaultIcon,
1143
+ headerContent,
1144
+ footerContent,
1145
+ userProfileProps: showCurrentUser ? {
1146
+ onChangePassword: handleChangePassword,
1147
+ onProfile: handleProfile,
1148
+ onLogout: handleLogout
1149
+ } : void 0
1150
+ };
1151
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
1152
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react21.Flex, { minH: "100vh", dir: direction, children: [
1153
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1154
+ import_react21.Box,
1155
+ {
1156
+ position: "fixed",
1157
+ top: 0,
1158
+ left: isRtl ? void 0 : 0,
1159
+ right: isRtl ? 0 : void 0,
1160
+ insetInline: 0,
1161
+ zIndex: SIDEBAR_Z_INDEX,
1162
+ hideFrom: "md",
1163
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Navbar, { sidebarProps })
1164
+ }
1165
+ ),
1166
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1167
+ import_react21.Box,
1168
+ {
1169
+ as: "aside",
1170
+ position: "fixed",
1171
+ top: 0,
1172
+ left: isRtl ? void 0 : 0,
1173
+ right: isRtl ? 0 : void 0,
1174
+ bottom: 0,
1175
+ hideBelow: "md",
1176
+ zIndex: SIDEBAR_Z_INDEX,
1177
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Sidebar, { h: "100vh", ...sidebarProps })
1178
+ }
1179
+ ),
1180
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1181
+ import_react21.Box,
1182
+ {
1183
+ as: "main",
1184
+ flex: "1",
1185
+ ml: { base: 0, md: isRtl ? 0 : "320px" },
1186
+ mr: { base: 0, md: isRtl ? "320px" : 0 },
1187
+ mt: { base: "60px", md: 0 },
1188
+ p: { base: 4, md: 6 },
1189
+ minH: "100vh",
1190
+ children: children || /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_router_dom6.Outlet, {})
1191
+ }
1192
+ )
1193
+ ] }),
1194
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1195
+ ChangePassword,
1196
+ {
1197
+ visible: isChangePasswordOpen,
1198
+ onVisibleChange: setIsChangePasswordOpen
1199
+ }
1200
+ ),
1201
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Profile, { visible: isProfileOpen, onVisibleChange: setIsProfileOpen })
1202
+ ] });
1203
+ }
1204
+ LayoutApplication.type = import_core8.eLayoutType.application;
1205
+
1206
+ // src/components/layout-account/LayoutAccount.tsx
1207
+ var import_react22 = require("@chakra-ui/react");
1208
+ var import_react_router_dom7 = require("react-router-dom");
1209
+ var import_core9 = require("@abpjs/core");
1210
+ var import_jsx_runtime17 = require("react/jsx-runtime");
1211
+ function LayoutAccount({
1212
+ showLanguageSelector = true,
1213
+ showSearch = false,
1214
+ showHelpCenter = false,
1215
+ helpCenterUrl,
1216
+ showSettings = false,
1217
+ settingsUrl,
1218
+ defaultIcon,
1219
+ headerContent,
1220
+ footerContent,
1221
+ children
1222
+ }) {
1223
+ const { direction, isRtl } = (0, import_core9.useDirection)();
1224
+ const sidebarProps = {
1225
+ showSearch,
1226
+ showLanguageSelector,
1227
+ showHelpCenter,
1228
+ helpCenterUrl,
1229
+ showSettings,
1230
+ settingsUrl,
1231
+ defaultIcon,
1232
+ headerContent,
1233
+ footerContent,
1234
+ userProfileProps: void 0
1235
+ // No user profile on account pages
1236
+ };
1237
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react22.Flex, { minH: "100vh", dir: direction, children: [
1238
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1239
+ import_react22.Box,
1240
+ {
1241
+ position: "fixed",
1242
+ top: 0,
1243
+ left: isRtl ? void 0 : 0,
1244
+ right: isRtl ? 0 : void 0,
1245
+ insetInline: 0,
1246
+ zIndex: SIDEBAR_Z_INDEX,
1247
+ hideFrom: "md",
1248
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Navbar, { sidebarProps })
1249
+ }
1250
+ ),
1251
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1252
+ import_react22.Box,
1253
+ {
1254
+ as: "aside",
1255
+ position: "fixed",
1256
+ top: 0,
1257
+ left: isRtl ? void 0 : 0,
1258
+ right: isRtl ? 0 : void 0,
1259
+ bottom: 0,
1260
+ hideBelow: "md",
1261
+ zIndex: SIDEBAR_Z_INDEX,
1262
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Sidebar, { h: "100vh", ...sidebarProps })
1263
+ }
1264
+ ),
1265
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1266
+ import_react22.Box,
1267
+ {
1268
+ as: "main",
1269
+ flex: "1",
1270
+ ml: { base: 0, md: isRtl ? 0 : "320px" },
1271
+ mr: { base: 0, md: isRtl ? "320px" : 0 },
1272
+ mt: { base: "60px", md: 0 },
1273
+ p: { base: 4, md: 6 },
1274
+ minH: "100vh",
1275
+ children: children || /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_router_dom7.Outlet, {})
1276
+ }
1277
+ )
1278
+ ] });
1279
+ }
1280
+ LayoutAccount.type = import_core9.eLayoutType.account;
1281
+
1282
+ // src/components/layout-empty/LayoutEmpty.tsx
1283
+ var import_react23 = require("@chakra-ui/react");
1284
+ var import_react_router_dom8 = require("react-router-dom");
1285
+ var import_core10 = require("@abpjs/core");
1286
+ var import_jsx_runtime18 = require("react/jsx-runtime");
1287
+ function LayoutEmpty({ children }) {
1288
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react23.Box, { minH: "100vh", children: children || /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_router_dom8.Outlet, {}) });
1289
+ }
1290
+ LayoutEmpty.type = import_core10.eLayoutType.empty;
1291
+
1292
+ // src/providers/ThemeBasicProvider.tsx
1293
+ var import_react24 = require("react");
1294
+ var import_theme_shared3 = require("@abpjs/theme-shared");
1295
+ var import_core11 = require("@abpjs/core");
1296
+ var import_jsx_runtime19 = require("react/jsx-runtime");
1297
+ function LocaleSync({ children }) {
1298
+ const { language } = (0, import_core11.useSession)();
1299
+ const { direction } = (0, import_core11.useDirection)();
1300
+ (0, import_react24.useEffect)(() => {
1301
+ document.documentElement.dir = direction;
1302
+ document.documentElement.lang = language || "en";
1303
+ }, [direction, language]);
1304
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_jsx_runtime19.Fragment, { children });
1305
+ }
1306
+ function ThemeBasicInner({
1307
+ children,
1308
+ renderToasts,
1309
+ renderConfirmation,
1310
+ toastPosition,
1311
+ mergedThemeOverrides,
1312
+ enableColorMode,
1313
+ defaultColorMode,
1314
+ logo,
1315
+ logoIcon,
1316
+ appName,
1317
+ logoLink
1318
+ }) {
1319
+ const { language } = (0, import_core11.useSession)();
1320
+ const locale = language || "en-US";
1321
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1322
+ import_theme_shared3.ThemeSharedProvider,
1323
+ {
1324
+ renderToasts,
1325
+ renderConfirmation,
1326
+ toastPosition,
1327
+ themeOverrides: mergedThemeOverrides,
1328
+ enableColorMode,
1329
+ defaultColorMode,
1330
+ locale,
1331
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(LocaleSync, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1332
+ BrandingProvider,
1333
+ {
1334
+ logo,
1335
+ logoIcon,
1336
+ appName,
1337
+ logoLink,
1338
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(LayoutProvider, { children })
1339
+ }
1340
+ ) })
1341
+ }
1342
+ );
1343
+ }
1344
+ var defaultThemeBasicConfig = (0, import_theme_shared3.defineConfig)({
1345
+ theme: {
1346
+ tokens: {
1347
+ colors: {
1348
+ brand: {
1349
+ 50: { value: "#e3f2fd" },
1350
+ 100: { value: "#bbdefb" },
1351
+ 200: { value: "#90caf9" },
1352
+ 300: { value: "#64b5f6" },
1353
+ 400: { value: "#42a5f5" },
1354
+ 500: { value: "#2196f3" },
1355
+ 600: { value: "#1e88e5" },
1356
+ 700: { value: "#1976d2" },
1357
+ 800: { value: "#1565c0" },
1358
+ 900: { value: "#0d47a1" },
1359
+ 950: { value: "#082f5e" }
1360
+ }
1361
+ }
1362
+ },
1363
+ semanticTokens: {
1364
+ colors: {
1365
+ // Brand colors with light/dark support
1366
+ brand: {
1367
+ solid: {
1368
+ value: { _light: "{colors.brand.500}", _dark: "{colors.brand.400}" }
1369
+ },
1370
+ contrast: {
1371
+ value: { _light: "{colors.white}", _dark: "{colors.white}" }
1372
+ },
1373
+ fg: {
1374
+ value: { _light: "{colors.brand.700}", _dark: "{colors.brand.300}" }
1375
+ },
1376
+ muted: {
1377
+ value: { _light: "{colors.brand.100}", _dark: "{colors.brand.900}" }
1378
+ },
1379
+ subtle: {
1380
+ value: { _light: "{colors.brand.50}", _dark: "{colors.brand.950}" }
1381
+ },
1382
+ emphasized: {
1383
+ value: { _light: "{colors.brand.300}", _dark: "{colors.brand.600}" }
1384
+ },
1385
+ focusRing: {
1386
+ value: { _light: "{colors.brand.500}", _dark: "{colors.brand.400}" }
1387
+ }
1388
+ }
1389
+ }
1390
+ }
1391
+ },
1392
+ globalCss: {
1393
+ "html, body": {
1394
+ colorPalette: "brand"
1395
+ }
1396
+ }
1397
+ });
1398
+ function ThemeBasicProvider({
1399
+ children,
1400
+ renderToasts = true,
1401
+ renderConfirmation = true,
1402
+ themeOverrides,
1403
+ toastPosition = "bottom-right",
1404
+ enableColorMode = false,
1405
+ defaultColorMode = "light",
1406
+ logo,
1407
+ logoIcon,
1408
+ appName,
1409
+ logoLink
1410
+ }) {
1411
+ const mergedThemeOverrides = themeOverrides || defaultThemeBasicConfig;
1412
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1413
+ ThemeBasicInner,
1414
+ {
1415
+ renderToasts,
1416
+ renderConfirmation,
1417
+ toastPosition,
1418
+ mergedThemeOverrides,
1419
+ enableColorMode,
1420
+ defaultColorMode,
1421
+ logo,
1422
+ logoIcon,
1423
+ appName,
1424
+ logoLink,
1425
+ children
1426
+ }
1427
+ );
1428
+ }
1429
+
1430
+ // src/index.ts
1431
+ var LAYOUTS = [LayoutApplication, LayoutAccount, LayoutEmpty];
1432
+ // Annotate the CommonJS export names for ESM import in node:
1433
+ 0 && (module.exports = {
1434
+ Block,
1435
+ BrandingProvider,
1436
+ ChangePassword,
1437
+ DefaultLogo,
1438
+ LAYOUTS,
1439
+ LanguageSelector,
1440
+ LayoutAccount,
1441
+ LayoutApplication,
1442
+ LayoutBase,
1443
+ LayoutEmpty,
1444
+ LayoutProvider,
1445
+ Logo,
1446
+ LogoIcon,
1447
+ LogoText,
1448
+ NavLinks,
1449
+ Navbar,
1450
+ Profile,
1451
+ SIDEBAR_Z_INDEX,
1452
+ SearchField,
1453
+ SearchProvider,
1454
+ Sidebar,
1455
+ SidebarLink,
1456
+ ThemeBasicProvider,
1457
+ UserProfile,
1458
+ defaultThemeBasicConfig,
1459
+ defineConfig,
1460
+ useBranding,
1461
+ useLayoutContext,
1462
+ useLayoutService,
1463
+ useLogo,
1464
+ useNavigationElements,
1465
+ useSearch
1466
+ });