adminizer 4.6.0-build.205 → 4.6.0-build.207

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 (43) hide show
  1. package/assets/{DiffViewer-B36sF5l-.js → DiffViewer-BpSpxX-x.js} +1 -1
  2. package/assets/add-BP2bkvcF.js +1 -0
  3. package/assets/{add-form-BdmoVC_G.js → add-form-B39ytLc3.js} +1 -1
  4. package/assets/add-group-DQi0lc1e.js +1 -0
  5. package/assets/add-user-CNcCmpvV.js +1 -0
  6. package/assets/{app-layout-BbIIJVA5.js → app-layout-Bubi-NT8.js} +1 -1
  7. package/assets/{app-sidebar-CtgnXD3n.js → app-sidebar-Dbgnlkew.js} +1 -1
  8. package/assets/app-sidebar-header-C3yisT8p.js +1 -0
  9. package/assets/app.js +2 -2
  10. package/assets/{breadcrumbs-Df-vVsyM.js → breadcrumbs-CZZirDj8.js} +1 -1
  11. package/assets/{catalog-Dksg6Ktq.js → catalog-Ca9RdLCZ.js} +1 -1
  12. package/assets/{dashboard-Dju1w--H.js → dashboard-Bcz5b5w6.js} +1 -1
  13. package/assets/{field-renderer-C1uKgcGe.js → field-renderer-BMcYzyqF.js} +3 -3
  14. package/assets/form-Biwt3wOg.js +1 -0
  15. package/assets/{form-BjOpJfcr.js → form-CivHwW3U.js} +1 -1
  16. package/assets/{history-DxIi7yPY.js → history-DNn4VfTF.js} +1 -1
  17. package/assets/{home-BUSE07NY.js → home-BaGz7nwT.js} +2 -2
  18. package/assets/list-dmqGUjt-.js +1 -0
  19. package/assets/{list-table-DSRvmzBT.js → list-table-a2bIPh90.js} +3 -3
  20. package/assets/manifest.json +70 -70
  21. package/assets/{media-manager-Bf7A7-jv.js → media-manager-CFiru23k.js} +1 -1
  22. package/assets/{module-3NsdEr7f.js → module-B9a_e2wR.js} +1 -1
  23. package/assets/nav-footer-TGTgvr59.js +1 -0
  24. package/assets/{nav-main-DcvkRp44.js → nav-main-CVTsAC3C.js} +1 -1
  25. package/assets/{nav-user-PtK5V1sV.js → nav-user-F0xzKfK7.js} +1 -1
  26. package/assets/{notification-BNz2iBvD.js → notification-DYPjSRl4.js} +1 -1
  27. package/assets/{pagination-render-B5A4YOfb.js → pagination-render-40Bk8JSz.js} +1 -1
  28. package/assets/{theme-switcher-Ca0SixmO.js → theme-switcher-Jo-h4C2M.js} +1 -1
  29. package/assets/{user-info-BTJNUzpi.js → user-info-D2tUt2LU.js} +1 -1
  30. package/assets/{user-menu-content-DUnYpt8t.js → user-menu-content-C9xtndj8.js} +1 -1
  31. package/assets/{welcome-DtWHDtJz.js → welcome-BDZq6wiw.js} +1 -1
  32. package/helpers/menuHelper.d.ts +3 -6
  33. package/helpers/menuHelper.js +32 -19
  34. package/interfaces/adminpanelConfig.d.ts +13 -1
  35. package/package.json +1 -1
  36. package/system/Router.js +29 -0
  37. package/assets/add-B8GYr9Sn.js +0 -1
  38. package/assets/add-group-D-oqZjnR.js +0 -1
  39. package/assets/add-user-CVjGIJe8.js +0 -1
  40. package/assets/app-sidebar-header-C8sntqs3.js +0 -1
  41. package/assets/form-C7LRXfge.js +0 -1
  42. package/assets/list-B6iLj8LH.js +0 -1
  43. package/assets/nav-footer-Q8fVAK6n.js +0 -1
@@ -10,13 +10,10 @@ export type MenuItem = {
10
10
  title: string;
11
11
  id: string;
12
12
  type?: 'blank' | 'self';
13
- actions: HrefConfig[];
14
- icon: string;
15
- accessRightsToken: string;
13
+ actions: HrefConfig[] | null;
14
+ icon: string | null;
15
+ accessRightsToken: string | null;
16
16
  entityName?: string;
17
- /**
18
- * Section grouping for navbar items (side navigation)
19
- */
20
17
  section?: string;
21
18
  };
22
19
  export declare class MenuHelper {
@@ -52,7 +52,7 @@ export class MenuHelper {
52
52
  hasInlineActions(modelConfig, action) {
53
53
  action = action ?? 'list';
54
54
  const config = modelConfig[action];
55
- if (typeof config !== "object" || config === null || !('actions' in config) || !config.actions.inline) {
55
+ if (typeof config !== "object" || config === null || !('actions' in config) || !config.actions?.inline) {
56
56
  return false;
57
57
  }
58
58
  const actions = config.actions.inline;
@@ -71,7 +71,7 @@ export class MenuHelper {
71
71
  return [];
72
72
  }
73
73
  const config = modelConfig[action];
74
- if (typeof config === "object" && config !== null && 'actions' in config && config.actions.global) {
74
+ if (typeof config === "object" && config !== null && 'actions' in config && config.actions?.global) {
75
75
  return config.actions.global;
76
76
  }
77
77
  return [];
@@ -89,7 +89,7 @@ export class MenuHelper {
89
89
  return [];
90
90
  }
91
91
  const config = modelConfig[action];
92
- if (typeof config === "object" && config !== null && 'actions' in config && config.actions.inline) {
92
+ if (typeof config === "object" && config !== null && 'actions' in config && config.actions?.inline) {
93
93
  return config.actions.inline;
94
94
  }
95
95
  return [];
@@ -101,23 +101,22 @@ export class MenuHelper {
101
101
  */
102
102
  getMenuItems(user) {
103
103
  let menus = [];
104
- if (this.config.navbar.additionalLinks && this.config.navbar.additionalLinks.length > 0) {
105
- this.config.navbar.additionalLinks.forEach(function (additionalLink) {
106
- if (!additionalLink.link || !additionalLink.title || additionalLink.disabled) {
107
- return;
108
- }
109
- menus.push({
110
- link: additionalLink.link,
111
- title: additionalLink.title,
112
- type: additionalLink.type,
113
- id: additionalLink.id || additionalLink.title.replace(" ", "_"),
114
- actions: additionalLink.subItems || null,
115
- icon: additionalLink.icon || null,
116
- accessRightsToken: additionalLink.accessRightsToken || null,
117
- section: additionalLink.section || 'Platform',
118
- });
104
+ const staticLinks = this.config.navbar?.additionalLinks ?? [];
105
+ staticLinks.forEach(function (additionalLink) {
106
+ if (!additionalLink.link || !additionalLink.title || additionalLink.disabled) {
107
+ return;
108
+ }
109
+ menus.push({
110
+ link: additionalLink.link,
111
+ title: additionalLink.title,
112
+ type: additionalLink.type,
113
+ id: additionalLink.id || additionalLink.title.replace(" ", "_"),
114
+ actions: additionalLink.subItems || null,
115
+ icon: additionalLink.icon || null,
116
+ accessRightsToken: additionalLink.accessRightsToken || null,
117
+ section: additionalLink.section || 'Platform',
119
118
  });
120
- }
119
+ });
121
120
  if (this.config.models) {
122
121
  const _this = this;
123
122
  Object.entries(this.config.models).forEach(function ([key, val]) {
@@ -150,6 +149,20 @@ export class MenuHelper {
150
149
  }
151
150
  });
152
151
  }
152
+ const { handleAdditionalLinks, sectionHandlers } = this.config.navbar ?? {};
153
+ if (handleAdditionalLinks) {
154
+ menus = handleAdditionalLinks(user, menus);
155
+ }
156
+ if (sectionHandlers) {
157
+ const sections = Object.keys(sectionHandlers);
158
+ sections.forEach(section => {
159
+ const handler = sectionHandlers[section];
160
+ const sectionLinks = menus.filter(m => m.section === section);
161
+ const otherLinks = menus.filter(m => m.section !== section);
162
+ const handled = handler(user, sectionLinks);
163
+ menus = [...otherLinks, ...handled];
164
+ });
165
+ }
153
166
  return menus;
154
167
  }
155
168
  }
@@ -78,7 +78,19 @@ export interface AdminpanelConfig {
78
78
  /**
79
79
  * will be created at the bottom of the sidenav panel
80
80
  * */
81
- additionalLinks: HrefConfig[];
81
+ additionalLinks?: HrefConfig[];
82
+ /**
83
+ * Optional callback to filter or transform all navbar links after models have been processed.
84
+ * Receives all links (static + model-generated) and the current user; returns the final array.
85
+ */
86
+ handleAdditionalLinks?: (user: UserAP, allLinks: HrefConfig[]) => HrefConfig[];
87
+ /**
88
+ * Per-section handlers, applied after all links (static + model-generated) are collected.
89
+ * Each key is a section name; the handler receives links belonging to that section.
90
+ */
91
+ sectionHandlers?: {
92
+ [section: string]: (user: UserAP, links: HrefConfig[]) => HrefConfig[];
93
+ };
82
94
  };
83
95
  /**
84
96
  * Policies that will be executed before going to every page
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "adminizer",
3
3
  "type": "module",
4
- "version": "4.6.0-build.205",
4
+ "version": "4.6.0-build.207",
5
5
  "main": "index.js",
6
6
  "exports": {
7
7
  ".": "./index.js",
package/system/Router.js CHANGED
@@ -48,6 +48,35 @@ export default class Router {
48
48
  * @type {MiddlewareType[]}
49
49
  */
50
50
  let policies = adminizer.config.policies;
51
+ /**
52
+ * Prevent stale/cached admin API responses.
53
+ * This protects JSON endpoints from browser/proxy cache and avoids
54
+ * old HTML redirects being reused as API payloads.
55
+ */
56
+ const noCachePrefixes = [
57
+ '/api',
58
+ '/notifications/api',
59
+ '/history',
60
+ '/widgets-get-all',
61
+ '/widgets-get-all-db',
62
+ '/widgets-switch',
63
+ '/widgets-info',
64
+ '/widgets-action',
65
+ '/media-manager-uploader',
66
+ '/get-thumbs',
67
+ '/get-timezones',
68
+ ];
69
+ adminizer.app.use(adminizer.config.routePrefix, (req, res, next) => {
70
+ const requestPath = req.path || '/';
71
+ const shouldDisableCache = noCachePrefixes.some((prefix) => requestPath === prefix || requestPath.startsWith(`${prefix}/`));
72
+ if (shouldDisableCache) {
73
+ res.set('Cache-Control', 'no-store, no-cache, must-revalidate, proxy-revalidate');
74
+ res.set('Pragma', 'no-cache');
75
+ res.set('Expires', '0');
76
+ res.set('Surrogate-Control', 'no-store');
77
+ }
78
+ return next();
79
+ });
51
80
  /**
52
81
  * Widgets All
53
82
  */
@@ -1 +0,0 @@
1
- import{u as t,j as o}from"./app.js";import{A as m}from"./app-layout-BbIIJVA5.js";import p from"./add-form-BdmoVC_G.js";import"./jsoneditor-De1FvcYu.js";import"./handsontable-PxYdjN8c.js";import"./monaco-BhBYtg3d.js";import"./app-shell-DbPu3ZPM.js";import"./app-sidebar-CtgnXD3n.js";import"./nav-main-DcvkRp44.js";import"./material-icon-BXxpxGAd.js";import"./app-sidebar-header-C8sntqs3.js";import"./breadcrumbs-Df-vVsyM.js";import"./nav-user-PtK5V1sV.js";import"./user-info-BTJNUzpi.js";import"./user-menu-content-DUnYpt8t.js";import"./theme-switcher-Ca0SixmO.js";import"./icon-BTIjB9Wk.js";import"./field-renderer-C1uKgcGe.js";import"./dynamic-controls-k61T9W2P.js";import"./input-error-CSrUHo1P.js";import"./DiffViewer-B36sF5l-.js";const i=[];function k(){const r=t();return o.jsx(m,{breadcrumbs:i,children:o.jsx(p,{page:r,catalog:!1})})}export{k as default};
@@ -1 +0,0 @@
1
- import{j as r}from"./app.js";import{A as o}from"./app-layout-BbIIJVA5.js";import t from"./add-group-form-B7c4coU-.js";import"./jsoneditor-De1FvcYu.js";import"./handsontable-PxYdjN8c.js";import"./monaco-BhBYtg3d.js";import"./app-shell-DbPu3ZPM.js";import"./app-sidebar-CtgnXD3n.js";import"./nav-main-DcvkRp44.js";import"./material-icon-BXxpxGAd.js";import"./app-sidebar-header-C8sntqs3.js";import"./breadcrumbs-Df-vVsyM.js";import"./nav-user-PtK5V1sV.js";import"./user-info-BTJNUzpi.js";import"./user-menu-content-DUnYpt8t.js";import"./theme-switcher-Ca0SixmO.js";import"./icon-BTIjB9Wk.js";const m=[];function y(){return r.jsx(o,{breadcrumbs:m,children:r.jsx(t,{})})}export{y as default};
@@ -1 +0,0 @@
1
- import{j as r}from"./app.js";import{A as o}from"./app-layout-BbIIJVA5.js";import t from"./add-user-form-BXSGx38D.js";import"./jsoneditor-De1FvcYu.js";import"./handsontable-PxYdjN8c.js";import"./monaco-BhBYtg3d.js";import"./app-shell-DbPu3ZPM.js";import"./app-sidebar-CtgnXD3n.js";import"./nav-main-DcvkRp44.js";import"./material-icon-BXxpxGAd.js";import"./app-sidebar-header-C8sntqs3.js";import"./breadcrumbs-Df-vVsyM.js";import"./nav-user-PtK5V1sV.js";import"./user-info-BTJNUzpi.js";import"./user-menu-content-DUnYpt8t.js";import"./theme-switcher-Ca0SixmO.js";import"./icon-BTIjB9Wk.js";import"./input-error-CSrUHo1P.js";const m=[];function E(){return r.jsx(o,{breadcrumbs:m,children:r.jsx(t,{})})}export{E as default};
@@ -1 +0,0 @@
1
- import{u as z,j as e,h as y,aV as V,s as Y,B as $,aW as G,w as Q,x as W,aX as X,N as L,O as R,E as Z,Q as B,r as K,aY as ee,ai as F,L as D,ao as te,aq as se,aZ as ae,a_ as re}from"./app.js";import{Breadcrumbs as oe}from"./breadcrumbs-Df-vVsyM.js";import{NavUser as ne}from"./nav-user-PtK5V1sV.js";import{ThemeSwitcher as ie}from"./theme-switcher-Ca0SixmO.js";import{r as a}from"./handsontable-PxYdjN8c.js";import ce from"./material-icon-BXxpxGAd.js";const H=a.createContext(void 0),ve=({children:l})=>{const[w,o]=a.useState([]),[m,u]=a.useState([]),[p,f]=a.useState([]),[E,c]=a.useState(!1),[n,h]=a.useState(null),[j,C]=a.useState(""),v=z(),[g,S]=a.useState({}),M=[...m,...p],x=async()=>{try{const t=await y.get(`${window.routePrefix}/notifications/api`,{params:{unreadOnly:!0,limit:4}});o(t.data)}catch(t){console.error("Error fetching bell notifications:",t)}},i=async()=>{try{const t=await y.post(`${window.routePrefix}/notifications`);S(t.data)}catch(t){console.log(t)}},A=async()=>{await x()},b=async()=>{try{const t=await y.get(`${window.routePrefix}/notifications/api/get-classes`);t.data&&(h(t.data.activeServices),C(t.data.initTab))}catch(t){console.error("Error fetching tabs:",t)}},k=async(t,s)=>{try{if(!t){await P(s);return}const r=await y.post(`${window.routePrefix}/notifications/api/search`,{s:t,notificationClass:s});f(r.data)}catch(r){console.error("Error searching notifications:",r)}},P=async t=>{c(!0);try{const s=`${window.routePrefix}/notifications/api/${t}`,r=await y.get(s,{params:{limit:20,skip:0,unreadOnly:!1}});return u([]),f(r.data),r.data}catch(s){return console.error("Error fetching all notifications:",s),[]}finally{c(!1)}},I=async(t,s)=>{try{const r=`${window.routePrefix}/notifications/api/${t}`,d=await y.get(r,{params:{limit:20,skip:s,unreadOnly:!1}});return f(N=>[...N,...d.data]),d.data}catch(r){return console.error("Error paginating notifications:",r),[]}};a.useEffect(()=>{if(!v.props.notifications)return;i(),x();const t=new EventSource(`${window.routePrefix}/notifications/api/stream`);return t.addEventListener("connected",s=>{const r=JSON.parse(s.data);console.log("Connected event:",r),b()}),t.addEventListener("notification",s=>{const r=JSON.parse(s.data);u(d=>[r,...d]),o(d=>[r,...d].slice(0,4))}),t.onerror=()=>{console.error("SSE connection error")},()=>t.close()},[]);const T=async(t,s)=>{try{await y.put(`${window.routePrefix}/notifications/api/${t}/${s}/read`,{}),u(r=>r.map(d=>d.id===s?{...d,read:!0}:d)),f(r=>r.map(d=>d.id===s?{...d,read:!0}:d)),o([])}catch(r){console.error("Error marking as read:",r)}},_=async()=>{try{await y.put(`${window.routePrefix}/notifications/api/read-all`),u(t=>t.map(s=>({...s,read:!0}))),f(t=>t.map(s=>({...s,read:!0}))),await x()}catch(t){console.error("Error marking all as read:",t)}},O=w.filter(t=>!t.read).length;return e.jsx(H.Provider,{value:{bellNotifications:w,allNotifications:M,unreadCount:O,getTabs:b,tabs:n,initTab:j,search:k,markAsRead:T,markAllAsRead:_,getLocale:i,messages:g,fetchAllNotifications:P,paginateNotifications:I,loading:E,refreshBellNotifications:A},children:l})},U=()=>{const l=a.useContext(H);if(l===void 0)throw new Error("useNotifications must be used within a NotificationProvider");return l};function le(){const{bellNotifications:l,markAsRead:w,unreadCount:o,refreshBellNotifications:m,messages:u}=U(),[p,f]=a.useState(!1),E=async(n,h)=>{f(!0);try{await w(n,h),await m()}catch(j){console.error("Error marking as read:",j)}finally{f(!1)}},c=n=>{const h=new Date,j=new Date(n),C=h.getTime()-j.getTime(),v=Math.floor(C/1e3),g=new Intl.RelativeTimeFormat("en",{numeric:"auto"});if(v<60)return g.format(-v,"second");const S=Math.floor(v/60);if(S<60)return g.format(-S,"minute");const M=Math.floor(S/60);if(M<24)return g.format(-M,"hour");const x=Math.floor(M/24);if(x<30)return g.format(-x,"day");const i=Math.floor(x/30);if(i<12)return g.format(-i,"month");const A=Math.floor(i/12);return g.format(-A,"year")};return e.jsxs(V,{children:[e.jsx(Y,{asChild:!0,className:"cursor-pointer data-[state=open]:bg-sidebar-accent",children:e.jsxs($,{variant:"ghost",className:"relative",children:[e.jsx(G,{}),o>0&&e.jsx("div",{className:"absolute top-1.5 right-1.5 size-1.5 rounded-full bg-destructive"})]})}),e.jsxs(Q,{className:"z-[1002] p-2",align:"end",onCloseAutoFocus:n=>n.preventDefault(),children:[e.jsx(W,{className:`${p?"opacity-50 pointer-events-none":""}`,children:l.length===0?e.jsx("div",{className:"p-4 text-center text-muted-foreground",children:"No notifications"}):l.map(n=>e.jsxs("div",{children:[e.jsx(X,{asChild:!0,className:"cursor-pointer",onSelect:h=>{h.preventDefault(),K.visit(`${window.routePrefix}/notifications?type=${n.notificationClass}`)},children:e.jsxs("div",{className:"grid grid-cols-[32px_250px] grid-rows-[auto_1fr] items-start gap-x-4 gap-y-2",children:[n.icon?e.jsx(ce,{name:n.icon.icon,style:{color:n.icon.iconColor},className:"!text-[32px]"}):e.jsx("div",{}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-medium",children:n.title}),e.jsx("span",{className:"truncate",children:n.message})]}),e.jsxs("div",{className:"col-start-2 flex justify-between flex-nowrap items-center",children:[e.jsx("div",{className:"flex flex-nowrap gap-2 items-center",children:e.jsx("div",{children:c(n.createdAt)})}),e.jsxs(L,{children:[e.jsx(R,{asChild:!0,children:e.jsx($,{variant:"ghost",size:"icon",className:"size-4",onClick:h=>{h.stopPropagation(),E(n.notificationClass,n.id)},children:e.jsx(Z,{className:"text-primary"})})}),e.jsx(B,{side:"left",className:"z-[1003]",children:e.jsx("p",{children:u["Make read"]})})]})]})]})}),e.jsx(ee,{})]},n.id))}),e.jsx($,{variant:"secondary",asChild:!0,children:e.jsxs(F,{href:`${window.routePrefix}/notifications`,className:`w-full ${p?"opacity-50 pointer-events-none":""}`,children:[u["View All"],p&&e.jsx(D,{className:"h-4 w-4 animate-spin"})]})})]})]})}const de=()=>{if(!(typeof window>"u"))return window.__adminizerAiAssistantState__??void 0},ue=l=>{typeof window>"u"||(window.__adminizerAiAssistantState__=l)},q=a.createContext(void 0),Ne=({children:l})=>{const o=z().props.aiAssistant,m=a.useMemo(()=>de(),[]),[u,p]=a.useState(()=>(m==null?void 0:m.isOpen)??!1),[f,E]=a.useState([]),[c,n]=a.useState(()=>(m==null?void 0:m.activeModel)??(o==null?void 0:o.defaultModel)??void 0),[h,j]=a.useState([]),[C,v]=a.useState(!1),[g,S]=a.useState(!1),[M,x]=a.useState(null),i=(o==null?void 0:o.enabled)??!1,A=a.useCallback(async()=>{if(i)try{v(!0);const{data:s}=await y.get(`${window.routePrefix}/api/ai-assistant/models`);E(s),n(r=>{var N;return r||(o!=null&&o.defaultModel&&s.some(J=>J.id===o.defaultModel)?o.defaultModel:(N=s[0])==null?void 0:N.id)})}catch(s){console.error("Failed to load AI assistant models",s),x("Unable to load AI assistant models")}finally{v(!1)}},[o==null?void 0:o.defaultModel,i]),b=a.useCallback(async s=>{if(!(!i||!s))try{v(!0);const{data:r}=await y.get(`${window.routePrefix}/api/ai-assistant/history/${s}`);j(r.history??[])}catch(r){console.error("Failed to load AI assistant history",r),x("Unable to load AI assistant history")}finally{v(!1)}},[i]);a.useEffect(()=>{if(!i){j([]);return}A()},[A,i]),a.useEffect(()=>{!i||!c||b(c)},[c,b,i]);const k=a.useCallback(s=>{n(s)},[]),P=a.useCallback(()=>p(!0),[]),I=a.useCallback(()=>p(!1),[]),T=a.useCallback(()=>p(s=>!s),[]),_=a.useCallback(async s=>{if(!i||!c)return;const r=s.trim();if(!r)return;const d={id:`tmp-${Date.now()}`,role:"user",content:r,timestamp:new Date().toISOString(),modelId:c};j(N=>[...N,d]),S(!0),x(null);try{const{data:N}=await y.post(`${window.routePrefix}/api/ai-assistant/query`,{modelId:c,message:r});j(N.history??[])}catch(N){console.error("Failed to send AI assistant message",N),x("Unable to reach AI assistant"),await b(c)}finally{S(!1)}},[c,b,i]),O=a.useCallback(async()=>{c&&await b(c)},[c,b]);a.useEffect(()=>{i||p(!1)},[i]),a.useEffect(()=>{ue({isOpen:u,activeModel:c})},[c,u]);const t=a.useMemo(()=>({isEnabled:i,isOpen:u,openChat:P,closeChat:I,toggleChat:T,models:f,activeModel:c,setActiveModel:k,messages:h,loading:C,sending:g,error:M,sendMessage:_,refreshHistory:O}),[c,I,M,i,u,C,h,f,P,O,_,g,k,T]);return e.jsx(q.Provider,{value:t,children:l})},fe=()=>{const l=a.useContext(q);if(!l)throw new Error("useAiAssistant must be used within an AiAssistantProvider");return l};function me(){const{isEnabled:l,isOpen:w,toggleChat:o,models:m,sending:u,loading:p}=fe();if(!l)return null;const f=m.length>0;return e.jsx(e.Fragment,{children:e.jsxs(L,{children:[e.jsx(R,{asChild:!0,children:e.jsx($,{variant:"ghost",className:se("relative",{"text-primary":w}),onClick:o,"aria-expanded":w,"aria-haspopup":"true","aria-controls":"ai-assistant-panel",disabled:!f&&p,children:u?e.jsx(D,{className:"size-4 animate-spin"}):e.jsx(te,{className:"size-4"})})}),e.jsx(B,{side:"bottom",className:"z-[1002]",children:e.jsx("span",{children:"AI assistant"})})]})})}function pe({breadcrumbs:l=[]}){const{tabs:w}=U(),o=z();return e.jsx("header",{className:"border-sidebar-border/50 flex h-16 shrink-0 items-center gap-2 border-b px-6 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12 md:px-4",children:e.jsxs("div",{className:"flex justify-between w-full",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ae,{className:"-ml-1"}),e.jsx(oe,{breadcrumbs:l})]}),e.jsxs("div",{className:"flex gap-4 items-center",children:[e.jsx(me,{}),o.props.history&&e.jsx(F,{href:`${window.routePrefix}/history/view-all`,children:e.jsx($,{variant:"ghost",size:"icon",className:"shrink-0",children:e.jsx(re,{})})}),e.jsx(ie,{}),o.props.notifications&&(w===null?e.jsx("div",{className:"w-[40px] flex-none flex justify-center",children:e.jsx(D,{className:"size-4 animate-spin"})}):w.length?e.jsx(le,{}):null),e.jsx(ne,{})]})]})})}const be=Object.freeze(Object.defineProperty({__proto__:null,AppSidebarHeader:pe},Symbol.toStringTag,{value:"Module"}));export{pe as A,ve as N,fe as a,Ne as b,be as c,U as u};
@@ -1 +0,0 @@
1
- import{j as r}from"./app.js";import{A as o}from"./app-layout-BbIIJVA5.js";import t from"./form-BjOpJfcr.js";import"./jsoneditor-De1FvcYu.js";import"./handsontable-PxYdjN8c.js";import"./monaco-BhBYtg3d.js";import"./app-shell-DbPu3ZPM.js";import"./app-sidebar-CtgnXD3n.js";import"./nav-main-DcvkRp44.js";import"./material-icon-BXxpxGAd.js";import"./app-sidebar-header-C8sntqs3.js";import"./breadcrumbs-Df-vVsyM.js";import"./nav-user-PtK5V1sV.js";import"./user-info-BTJNUzpi.js";import"./user-menu-content-DUnYpt8t.js";import"./theme-switcher-Ca0SixmO.js";import"./icon-BTIjB9Wk.js";import"./add-form-BdmoVC_G.js";import"./field-renderer-C1uKgcGe.js";import"./dynamic-controls-k61T9W2P.js";import"./input-error-CSrUHo1P.js";import"./DiffViewer-B36sF5l-.js";const m=[];function g(){return r.jsx(o,{breadcrumbs:m,children:r.jsx(t,{})})}export{g as default};
@@ -1 +0,0 @@
1
- import{j as o}from"./app.js";import{A as r}from"./app-layout-BbIIJVA5.js";import t from"./list-table-DSRvmzBT.js";import"./jsoneditor-De1FvcYu.js";import"./handsontable-PxYdjN8c.js";import"./monaco-BhBYtg3d.js";import"./app-shell-DbPu3ZPM.js";import"./app-sidebar-CtgnXD3n.js";import"./nav-main-DcvkRp44.js";import"./material-icon-BXxpxGAd.js";import"./app-sidebar-header-C8sntqs3.js";import"./breadcrumbs-Df-vVsyM.js";import"./nav-user-PtK5V1sV.js";import"./user-info-BTJNUzpi.js";import"./user-menu-content-DUnYpt8t.js";import"./theme-switcher-Ca0SixmO.js";import"./icon-BTIjB9Wk.js";import"./del-modal-TaroxmfE.js";import"./pagination-render-B5A4YOfb.js";const m=[],y=()=>o.jsx(r,{breadcrumbs:m,className:"overflow-auto h-[calc(100svh-16px)]",children:o.jsx(t,{})});export{y as default};
@@ -1 +0,0 @@
1
- import{j as r,bd as o,bt as s,b1 as i,b2 as l,b6 as d}from"./app.js";import{Icon as c}from"./icon-BTIjB9Wk.js";import"./jsoneditor-De1FvcYu.js";import"./handsontable-PxYdjN8c.js";import"./monaco-BhBYtg3d.js";function j({items:a,className:t,...n}){return r.jsx(o,{...n,className:`group-data-[collapsible=icon]:p-0 ${t||""}`,children:r.jsx(s,{children:r.jsx(i,{children:a.map(e=>r.jsx(l,{children:r.jsx(d,{asChild:!0,className:"text-neutral-600 hover:text-neutral-800 dark:text-neutral-300 dark:hover:text-neutral-100",children:r.jsxs("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",children:[e.icon&&r.jsx(c,{iconNode:e.icon,className:"h-5 w-5"}),r.jsx("span",{children:e.title})]})})},e.title))})})})}export{j as NavFooter};