adminizer 4.6.0-build.217 → 4.6.0-build.218

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 (53) hide show
  1. package/assets/{RelationDialogStack-BKadPz2U.js → RelationDialogStack-D9UVEF9s.js} +3 -3
  2. package/assets/add-L1mljOl6.js +1 -0
  3. package/assets/add-group-C_p1Wc38.js +1 -0
  4. package/assets/{add-group-form-B7c4coU-.js → add-group-form-B01gwDGu.js} +1 -1
  5. package/assets/add-user-GuWTBgXb.js +1 -0
  6. package/assets/{add-user-form-BXSGx38D.js → add-user-form-Cgwc9JkI.js} +1 -1
  7. package/assets/{app-layout-HwzoFLMz.js → app-layout-Cjj-00Ds.js} +1 -1
  8. package/assets/{app-shell-DbPu3ZPM.js → app-shell-QWCtn9ye.js} +1 -1
  9. package/assets/{app-sidebar-Cqj5L2kB.js → app-sidebar-CVaE0NP8.js} +1 -1
  10. package/assets/{app-sidebar-header-B__FqkNk.js → app-sidebar-header-BsPFDhZ8.js} +1 -1
  11. package/assets/app.js +1606 -1606
  12. package/assets/breadcrumbs-CZZirDj8.js +1 -0
  13. package/assets/{catalog-BiqXcqJM.js → catalog-tWWKxhUB.js} +1 -1
  14. package/assets/{dashboard-CJeHMGdM.js → dashboard-BcWkUeH7.js} +1 -1
  15. package/assets/{date-picker-Dk9WjnjY.js → date-picker-B5AZ_7Q9.js} +1 -1
  16. package/assets/{del-modal-CF3OUMvW.js → del-modal-BoyXZloG.js} +1 -1
  17. package/assets/{form-DBPr4-Pu.js → form-1WGY0YgG.js} +1 -1
  18. package/assets/form-BEPB8Y2T.js +1 -0
  19. package/assets/{geo-json-D5fjz6BF.js → geo-json-DsMUHo0l.js} +2 -2
  20. package/assets/{history-Yi7SOnuz.js → history-BBMyDQOi.js} +1 -1
  21. package/assets/{home-LTHyVJhs.js → home-BbHoY3UX.js} +2 -2
  22. package/assets/{icon-BTIjB9Wk.js → icon-DfDLMG5f.js} +1 -1
  23. package/assets/{init-user-CsEDYKZe.js → init-user-CF80MEnT.js} +1 -1
  24. package/assets/{input-error-CSrUHo1P.js → input-error-DuuqFgZa.js} +1 -1
  25. package/assets/list-ZYPQpqPI.js +1 -0
  26. package/assets/{list-table-DYfRlgPh.js → list-table-BsEWjTKY.js} +3 -3
  27. package/assets/{login-puJIq5NA.js → login-eDemYzN-.js} +1 -1
  28. package/assets/manifest.json +87 -97
  29. package/assets/{material-icon-BXxpxGAd.js → material-icon-DMT8KdmE.js} +1 -1
  30. package/assets/{media-manager-DqeCKAes.js → media-manager-DfYa_mT_.js} +3 -3
  31. package/assets/{module-AhIlQK_S.js → module-DffdLLNu.js} +1 -1
  32. package/assets/nav-footer-D3olYxtz.js +1 -0
  33. package/assets/{nav-main-8YJwixyP.js → nav-main-BctqyzeV.js} +1 -1
  34. package/assets/{nav-user-Booo1xYl.js → nav-user-Bn1Lt-BZ.js} +1 -1
  35. package/assets/{notification-yiRh6g8N.js → notification-CWxm1tMd.js} +7 -7
  36. package/assets/{pagination-render-CPeJhHnz.js → pagination-render-DxD78ahJ.js} +1 -1
  37. package/assets/{register-C2TFSMX0.js → register-349PwYbe.js} +1 -1
  38. package/assets/theme-switcher-DfExsHW2.js +1 -0
  39. package/assets/{toast-editor-D3dhpAw1.js → toast-editor-ESK5iWPx.js} +1 -1
  40. package/assets/{user-info-Cb4KumEO.js → user-info-DtBK5Kh8.js} +1 -1
  41. package/assets/{user-menu-content-BoS7_3sB.js → user-menu-content-0XYOCMaA.js} +1 -1
  42. package/assets/welcome-B7DJfOd_.js +1 -0
  43. package/package.json +1 -1
  44. package/assets/add-C6B3ZwYc.js +0 -1
  45. package/assets/add-group-HP1jb7VA.js +0 -1
  46. package/assets/add-user-CwpoBhnE.js +0 -1
  47. package/assets/breadcrumbs-CkRn0IkH.js +0 -1
  48. package/assets/form-BMWREamR.js +0 -1
  49. package/assets/list-BjO-TbRf.js +0 -1
  50. package/assets/nav-footer-BA2GnLu_.js +0 -1
  51. package/assets/tabs-DTgMEGE8.js +0 -1
  52. package/assets/theme-switcher-Bx74FM9Q.js +0 -1
  53. package/assets/welcome-B9W9z-dG.js +0 -1
@@ -1 +1 @@
1
- import{u as E,j as e,ah as I,an as P,ao as L,B as v,ap as R,S as z,c as C,d as D,e as M,f as T,aq as w,ar as k,L as O}from"./app.js";import B from"./app-shell-DbPu3ZPM.js";import{AppSidebar as K}from"./app-sidebar-Cqj5L2kB.js";import{A as V,a as N,N as _,b as F}from"./app-sidebar-header-B__FqkNk.js";import{r as l}from"./handsontable-PxYdjN8c.js";import{R as H}from"./RelationDialogStack-BKadPz2U.js";const q=l.memo(({children:o,breadcrumbs:a=[],className:i})=>{const n=E();return e.jsxs(B,{variant:"sidebar",children:[e.jsx(I,{title:n.props.title}),e.jsx(K,{}),e.jsxs(P,{className:i,children:[e.jsx(V,{breadcrumbs:a}),e.jsx("div",{className:"relative flex-1 overflow-hidden",children:e.jsx("div",{className:"h-full",children:o})})]})]})});function $({width:o="min(25vw, 420px)"}){const{isEnabled:a,isOpen:i,closeChat:n,models:s,activeModel:r,setActiveModel:d,messages:c,loading:m,sending:x,error:g,sendMessage:y}=N(),[f,h]=l.useState(""),j=l.useRef(null);l.useEffect(()=>{i||h("")},[i]),l.useEffect(()=>{j.current&&j.current.scrollIntoView({behavior:"smooth"})},[c]);const u=s.length>0,A=async t=>{t.preventDefault();const p=f.trim();p&&(await y(p),h(""))},S=t=>{if((t.ctrlKey||t.metaKey)&&t.key==="Enter"){t.preventDefault();const p=f.trim();p&&!x&&(y(p),h(""))}};return a?e.jsxs("aside",{id:"ai-assistant-panel","aria-label":"AI assistant chat","aria-hidden":!i,className:w("bg-card text-card-foreground fixed bottom-0 right-0 top-0 z-[60] flex h-full flex-col border-l shadow-xl transition-all duration-300 ease-in-out","md:w-auto w-full",i?"translate-x-0 opacity-100":"translate-x-full opacity-0 pointer-events-none"),style:{width:"var(--ai-assistant-panel-actual-width, "+o+")"},children:[e.jsxs("div",{className:"flex items-center justify-between border-b px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{className:"size-5 text-primary"}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-semibold leading-tight",children:"AI assistant"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Chat with your selected model."})]})]}),e.jsx(v,{variant:"ghost",size:"icon",onClick:n,"aria-label":"Close AI assistant",children:e.jsx(R,{className:"size-4"})})]}),e.jsxs("div",{className:"flex flex-1 flex-col gap-4 overflow-hidden px-4 py-4",children:[!u&&!m&&e.jsx("div",{className:"flex flex-1 items-center justify-center rounded-md border border-dashed p-6 text-sm text-muted-foreground",children:"No AI models are available for your account."}),u&&e.jsxs(e.Fragment,{children:[e.jsxs(z,{value:r,onValueChange:d,children:[e.jsx(C,{className:"w-full",children:e.jsx(D,{placeholder:"Select a model"})}),e.jsx(M,{className:"z-[70]",children:s.map(t=>e.jsx(T,{value:t.id,children:e.jsxs("div",{className:"flex flex-col text-left",children:[e.jsx("span",{className:"font-medium",children:t.name}),t.description&&e.jsx("span",{className:"text-xs text-muted-foreground",children:t.description})]})},t.id))})]}),e.jsxs("div",{className:"flex flex-1 flex-col gap-3 overflow-hidden rounded-md border bg-background p-4",children:[e.jsxs("div",{className:"flex-1 space-y-3 overflow-y-auto pr-2","data-ai-assistant-messages":!0,children:[m&&e.jsx("div",{className:"flex justify-center py-6 text-sm text-muted-foreground",children:"Loading conversation..."}),!m&&c.length===0&&e.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"Start a conversation to see responses here."}),c.map(t=>e.jsxs("div",{className:w("flex flex-col gap-1 rounded-md border p-3 text-sm shadow-xs",t.role==="assistant"?"border-primary/30 bg-primary/5":"border-border bg-background"),children:[e.jsx("span",{className:"font-semibold",children:t.role==="assistant"?"Assistant":"You"}),e.jsx("p",{className:"whitespace-pre-wrap leading-relaxed",children:t.content}),e.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(t.timestamp).toLocaleTimeString()})]},t.id)),e.jsx("div",{ref:j})]}),e.jsxs("form",{className:"space-y-2",onSubmit:A,children:[e.jsx(k,{placeholder:u?"Type your question... (Ctrl+Enter to send)":"No models available",value:f,onChange:t=>h(t.target.value),onKeyDown:S,disabled:!u||x,rows:3}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[g&&e.jsx("span",{className:"text-xs text-destructive",children:g}),e.jsx(v,{type:"submit",disabled:!u||x||!f.trim(),children:x?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(O,{className:"size-4 animate-spin"}),"Sending…"]}):"Send"})]})]})]})]})]})]}):null}const G="min(25vw, 420px)",b="margin-right 300ms ease-in-out";function U({children:o,panelWidth:a=G}){const{isEnabled:i,isOpen:n}=N();return l.useEffect(()=>{const s=document.getElementById("app");if(!s)return;const r=s.style.transition,d=r==null?void 0:r.includes("margin-right");return d||(s.style.transition=r?`${r}, ${b}`:b),s.classList.add("ai-assistant-host"),s.style.setProperty("--ai-assistant-panel-width",a),()=>{s.classList.remove("ai-assistant-host"),s.style.removeProperty("--ai-assistant-panel-width"),s.style.removeProperty("--ai-assistant-panel-actual-width"),s.style.removeProperty("margin-right"),delete s.dataset.aiAssistantOpen,d||(s.style.transition=r)}},[a]),l.useEffect(()=>{const s=document.getElementById("app");if(!s)return;const r=window.innerWidth<768,d=r?"100vw":a;s.style.setProperty("--ai-assistant-panel-actual-width",d),i&&n?(s.style.marginRight=r?"0":a,s.dataset.aiAssistantOpen="true"):(s.style.removeProperty("margin-right"),s.dataset.aiAssistantOpen="false");const c=()=>{const m=window.innerWidth<768,x=m?"100vw":a;s.style.setProperty("--ai-assistant-panel-actual-width",x),i&&n&&(s.style.marginRight=m?"0":a)};return window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[i,n,a]),e.jsxs(e.Fragment,{children:[o,e.jsx($,{width:a})]})}const ee=l.memo(({children:o,className:a,breadcrumbs:i,...n})=>e.jsx(_,{children:e.jsx(F,{children:e.jsxs(H,{children:[e.jsx(q,{breadcrumbs:i,className:a,...n,children:o}),e.jsx(U,{})]})})}));export{ee as A};
1
+ import{u as E,j as e,ah as I,ar as P,as as L,B as y,at as R,S as z,c as C,d as D,e as M,f as T,au as w,av as k,L as O}from"./app.js";import B from"./app-shell-QWCtn9ye.js";import{AppSidebar as K}from"./app-sidebar-CVaE0NP8.js";import{A as V,a as N,N as _,b as F}from"./app-sidebar-header-BsPFDhZ8.js";import{r as l}from"./handsontable-PxYdjN8c.js";import{R as H}from"./RelationDialogStack-D9UVEF9s.js";const $=l.memo(({children:o,breadcrumbs:a=[],className:i})=>{const n=E();return e.jsxs(B,{variant:"sidebar",children:[e.jsx(I,{title:n.props.title}),e.jsx(K,{}),e.jsxs(P,{className:i,children:[e.jsx(V,{breadcrumbs:a}),e.jsx("div",{className:"relative flex-1 overflow-hidden",children:e.jsx("div",{className:"h-full",children:o})})]})]})});function q({width:o="min(25vw, 420px)"}){const{isEnabled:a,isOpen:i,closeChat:n,models:s,activeModel:r,setActiveModel:d,messages:c,loading:m,sending:x,error:g,sendMessage:v}=N(),[f,h]=l.useState(""),j=l.useRef(null);l.useEffect(()=>{i||h("")},[i]),l.useEffect(()=>{j.current&&j.current.scrollIntoView({behavior:"smooth"})},[c]);const u=s.length>0,A=async t=>{t.preventDefault();const p=f.trim();p&&(await v(p),h(""))},S=t=>{if((t.ctrlKey||t.metaKey)&&t.key==="Enter"){t.preventDefault();const p=f.trim();p&&!x&&(v(p),h(""))}};return a?e.jsxs("aside",{id:"ai-assistant-panel","aria-label":"AI assistant chat","aria-hidden":!i,className:w("bg-card text-card-foreground fixed bottom-0 right-0 top-0 z-[60] flex h-full flex-col border-l shadow-xl transition-all duration-300 ease-in-out","md:w-auto w-full",i?"translate-x-0 opacity-100":"translate-x-full opacity-0 pointer-events-none"),style:{width:"var(--ai-assistant-panel-actual-width, "+o+")"},children:[e.jsxs("div",{className:"flex items-center justify-between border-b px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{className:"size-5 text-primary"}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-semibold leading-tight",children:"AI assistant"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Chat with your selected model."})]})]}),e.jsx(y,{variant:"ghost",size:"icon",onClick:n,"aria-label":"Close AI assistant",children:e.jsx(R,{className:"size-4"})})]}),e.jsxs("div",{className:"flex flex-1 flex-col gap-4 overflow-hidden px-4 py-4",children:[!u&&!m&&e.jsx("div",{className:"flex flex-1 items-center justify-center rounded-md border border-dashed p-6 text-sm text-muted-foreground",children:"No AI models are available for your account."}),u&&e.jsxs(e.Fragment,{children:[e.jsxs(z,{value:r,onValueChange:d,children:[e.jsx(C,{className:"w-full",children:e.jsx(D,{placeholder:"Select a model"})}),e.jsx(M,{className:"z-[70]",children:s.map(t=>e.jsx(T,{value:t.id,children:e.jsxs("div",{className:"flex flex-col text-left",children:[e.jsx("span",{className:"font-medium",children:t.name}),t.description&&e.jsx("span",{className:"text-xs text-muted-foreground",children:t.description})]})},t.id))})]}),e.jsxs("div",{className:"flex flex-1 flex-col gap-3 overflow-hidden rounded-md border bg-background p-4",children:[e.jsxs("div",{className:"flex-1 space-y-3 overflow-y-auto pr-2","data-ai-assistant-messages":!0,children:[m&&e.jsx("div",{className:"flex justify-center py-6 text-sm text-muted-foreground",children:"Loading conversation..."}),!m&&c.length===0&&e.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"Start a conversation to see responses here."}),c.map(t=>e.jsxs("div",{className:w("flex flex-col gap-1 rounded-md border p-3 text-sm shadow-xs",t.role==="assistant"?"border-primary/30 bg-primary/5":"border-border bg-background"),children:[e.jsx("span",{className:"font-semibold",children:t.role==="assistant"?"Assistant":"You"}),e.jsx("p",{className:"whitespace-pre-wrap leading-relaxed",children:t.content}),e.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(t.timestamp).toLocaleTimeString()})]},t.id)),e.jsx("div",{ref:j})]}),e.jsxs("form",{className:"space-y-2",onSubmit:A,children:[e.jsx(k,{placeholder:u?"Type your question... (Ctrl+Enter to send)":"No models available",value:f,onChange:t=>h(t.target.value),onKeyDown:S,disabled:!u||x,rows:3}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[g&&e.jsx("span",{className:"text-xs text-destructive",children:g}),e.jsx(y,{type:"submit",disabled:!u||x||!f.trim(),children:x?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(O,{className:"size-4 animate-spin"}),"Sending…"]}):"Send"})]})]})]})]})]})]}):null}const G="min(25vw, 420px)",b="margin-right 300ms ease-in-out";function U({children:o,panelWidth:a=G}){const{isEnabled:i,isOpen:n}=N();return l.useEffect(()=>{const s=document.getElementById("app");if(!s)return;const r=s.style.transition,d=r==null?void 0:r.includes("margin-right");return d||(s.style.transition=r?`${r}, ${b}`:b),s.classList.add("ai-assistant-host"),s.style.setProperty("--ai-assistant-panel-width",a),()=>{s.classList.remove("ai-assistant-host"),s.style.removeProperty("--ai-assistant-panel-width"),s.style.removeProperty("--ai-assistant-panel-actual-width"),s.style.removeProperty("margin-right"),delete s.dataset.aiAssistantOpen,d||(s.style.transition=r)}},[a]),l.useEffect(()=>{const s=document.getElementById("app");if(!s)return;const r=window.innerWidth<768,d=r?"100vw":a;s.style.setProperty("--ai-assistant-panel-actual-width",d),i&&n?(s.style.marginRight=r?"0":a,s.dataset.aiAssistantOpen="true"):(s.style.removeProperty("margin-right"),s.dataset.aiAssistantOpen="false");const c=()=>{const m=window.innerWidth<768,x=m?"100vw":a;s.style.setProperty("--ai-assistant-panel-actual-width",x),i&&n&&(s.style.marginRight=m?"0":a)};return window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[i,n,a]),e.jsxs(e.Fragment,{children:[o,e.jsx(q,{width:a})]})}const ee=l.memo(({children:o,className:a,breadcrumbs:i,...n})=>e.jsx(_,{children:e.jsx(F,{children:e.jsxs(H,{children:[e.jsx($,{breadcrumbs:i,className:a,...n,children:o}),e.jsx(U,{})]})})}));export{ee as A};
@@ -1 +1 @@
1
- import{j as a,aU as d}from"./app.js";import{r as o}from"./handsontable-PxYdjN8c.js";import"./jsoneditor-De1FvcYu.js";import"./monaco-BhBYtg3d.js";const u=o.memo(({children:e,variant:s="header"})=>{const[t,n]=o.useState(()=>typeof window<"u"?localStorage.getItem("sidebar")!=="false":!0),i=r=>{n(r),typeof window<"u"&&localStorage.setItem("sidebar",String(r))};return s==="header"?a.jsx("div",{className:"flex min-h-screen w-full flex-col",children:e}):a.jsx(d,{defaultOpen:t,open:t,onOpenChange:i,children:e})});export{u as default};
1
+ import{j as a,aP as d}from"./app.js";import{r as o}from"./handsontable-PxYdjN8c.js";import"./jsoneditor-De1FvcYu.js";import"./monaco-BhBYtg3d.js";const u=o.memo(({children:e,variant:s="header"})=>{const[t,n]=o.useState(()=>typeof window<"u"?localStorage.getItem("sidebar")!=="false":!0),i=r=>{n(r),typeof window<"u"&&localStorage.setItem("sidebar",String(r))};return s==="header"?a.jsx("div",{className:"flex min-h-screen w-full flex-col",children:e}):a.jsx(d,{defaultOpen:t,open:t,onOpenChange:i,children:e})});export{u as default};
@@ -1 +1 @@
1
- import{u as $,j as e,D as Z,U as G,b0 as J,i as Q,k as W,l as Y,b1 as I,b2 as ee,V as se,b as M,I as ae,ar as re,B as D,b3 as te,ap as le,b4 as ne,L as ie,h as ce,b5 as de,b6 as oe,b7 as F,b8 as S,b9 as xe,ba as pe,bb as he,bc as w,bd as me,be as ue,bf as je,bg as be,bh as fe,bi as z,ai as v,bj as ge,bk as E,bl as L,C as P,bm as B,bn as O,bo as A,bp as R,bq as Ne,br as ve}from"./app.js";import{NavMain as ke}from"./nav-main-8YJwixyP.js";import{r as i,a as ye}from"./handsontable-PxYdjN8c.js";import d from"./material-icon-BXxpxGAd.js";import"./jsoneditor-De1FvcYu.js";import"./monaco-BhBYtg3d.js";const Ce=5*1024*1024,q=i.memo(({routePrefix:t,triggerLabel:s,placeholder:a,ui:x,onClose:p})=>{const l=r=>x[r]??r,[m,k]=i.useState(""),[g,y]=i.useState(""),[j,b]=i.useState([]),[o,N]=i.useState({}),[h,_]=i.useState(!1),[C,H]=i.useState(!1),T=i.useRef(null),K=r=>{if(!r)return;const n={},u=[];Array.from(r).forEach(c=>{c.size>Ce?n[c.name]=l("File size exceeds the 5 MB limit"):u.push(c)}),b(c=>[...c,...u]),Object.keys(n).length&&N(c=>({...c,...n}))},U=r=>b(n=>n.filter((u,c)=>c!==r)),V=async r=>{var u,c;if(r.preventDefault(),!m.trim()){N({title:l("Title is required")});return}_(!0),N({});const n=new FormData;n.append("title",m.trim()),n.append("description",g.trim()),j.forEach(f=>n.append("files",f));try{await ce.post(`${t}/api/feedback`,n),H(!0)}catch(f){const X=((c=(u=f==null?void 0:f.response)==null?void 0:u.data)==null?void 0:c.error)??l("Internal server error");N({_global:X}),_(!1)}};return i.useEffect(()=>{if(!C)return;const r=setTimeout(p,2e3);return()=>clearTimeout(r)},[C,p]),C?e.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-24 text-center",children:[e.jsx(I,{size:48,className:"text-green-500 dark:text-green-400"}),e.jsx("p",{className:"text-base font-medium",children:l("Feedback sent successfully")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(ee,{className:"mb-4",children:[e.jsx(se,{children:s??l("Feedback")}),a&&e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:a})]}),e.jsxs("form",{onSubmit:V,className:"space-y-5",noValidate:!0,children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(M,{htmlFor:"fb-title",children:l("Title")}),e.jsx(ae,{id:"fb-title",value:m,onChange:r=>k(r.target.value),disabled:h,placeholder:l("Title"),className:o.title?"border-destructive":""}),o.title&&e.jsx("p",{className:"text-xs text-destructive",children:o.title})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(M,{htmlFor:"fb-desc",children:l("Description")}),e.jsx(re,{id:"fb-desc",value:g,onChange:r=>y(r.target.value),disabled:h,placeholder:l("Description"),rows:5,className:"resize-none"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(M,{children:l("Attach files")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(D,{type:"button",variant:"outline",size:"sm",onClick:()=>{var r;return(r=T.current)==null?void 0:r.click()},disabled:h,children:[e.jsx(te,{size:14,className:"mr-1"}),l("Attach files")]}),e.jsx("span",{className:"text-xs text-muted-foreground",children:l("Max 5 MB per file")})]}),e.jsx("input",{ref:T,type:"file",multiple:!0,className:"hidden",onChange:r=>K(r.target.files),disabled:h}),j.length>0&&e.jsx("ul",{className:"mt-2 space-y-1",children:j.map((r,n)=>e.jsxs("li",{className:"flex items-center justify-between rounded-md border bg-muted/40 px-3 py-1.5 text-xs",children:[e.jsx("span",{className:"truncate max-w-[340px]",children:r.name}),e.jsx("button",{type:"button",onClick:()=>U(n),className:"ml-2 text-muted-foreground hover:text-destructive transition-colors","aria-label":l("Remove file"),disabled:h,children:e.jsx(le,{size:13})})]},n))}),Object.entries(o).filter(([r])=>r!=="title"&&r!=="_global").map(([r,n])=>e.jsx("p",{className:"text-xs text-destructive",children:n},r))]}),o._global&&e.jsx("p",{className:"text-xs text-destructive",children:o._global}),e.jsx(ne,{children:e.jsx(D,{type:"submit",disabled:h,children:h?e.jsxs(e.Fragment,{children:[e.jsx(ie,{size:14,className:"mr-1.5 animate-spin"}),l("Sending...")]}):l("Send")})})]})]})});q.displayName="FeedbackForm";function Me(){const t=$(),s=t.props.uiMessages??{},a=t.props.routePrefix??window.routePrefix??"",x=t.props.feedbackTriggerLabel??null,p=t.props.feedbackPlaceholder??null,[l,m]=i.useState(!1),[k,g]=i.useState(0),y=i.useCallback(()=>m(!1),[]),j=i.useCallback(b=>{m(b),b||g(o=>o+1)},[]);return e.jsxs(Z,{open:l,onOpenChange:j,children:[e.jsx(G,{asChild:!0,children:e.jsxs("button",{className:"flex items-center gap-1.5 text-xs opacity-60 hover:opacity-100 transition-opacity cursor-pointer mt-1 mx-auto","aria-label":x??s["Send feedback"]??"Send feedback",children:[e.jsx(J,{size:13}),x??s["Send feedback"]??"Send feedback"]})}),ye.createPortal(e.jsx(Q,{}),document.body),e.jsx(W,{children:e.jsx(Y,{children:e.jsx(q,{routePrefix:a,triggerLabel:x,placeholder:p,ui:s,onClose:y},k)})})]})}function ze(){const t=$();return e.jsxs(de,{collapsible:"icon",variant:"inset",children:[e.jsx(oe,{children:e.jsx(F,{children:e.jsxs(S,{children:[e.jsx(xe,{className:"p-0 shadow-none border-none bg-transparent hidden md:block",children:e.jsxs(pe,{children:[e.jsx(he,{asChild:!0,className:"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground rounded-md",children:e.jsx(w,{asChild:!0,children:e.jsx(D,{variant:"ghost",asChild:!0,className:`w-full ${t.props.section?"":"pointer-events-none"}`,children:e.jsxs("div",{children:[e.jsx(d,{name:"rocket_launch",className:"!text-[18px]"}),e.jsx("span",{className:"group-data-[state=collapsed]:hidden",children:t.props.brand}),t.props.section&&e.jsx(me,{className:"ml-auto group-data-[state=collapsed]:hidden"})]})})})}),t.props.section&&e.jsx(ue,{side:"right",className:"z-[1003]",children:t.props.section.map(s=>e.jsx("div",{children:s.subItems?e.jsxs(je,{children:[e.jsxs(be,{className:"flex gap-2 items-center cursor-pointer",children:[e.jsx(d,{name:s.icon,className:"!text-[18px]"}),e.jsx("span",{className:"hover:underline",children:s.title})]}),e.jsx(fe,{children:s.subItems.map(a=>e.jsx(z,{children:a.type==="blank"?e.jsxs("a",{href:a.link,target:"_blank",className:"flex gap-2 items-center",children:[a.icon&&e.jsx(d,{name:a.icon,className:"!text-[18px]"}),e.jsx("span",{className:"hover:underline",children:a.title})]},a.id):e.jsxs(v,{href:a.link,className:"flex gap-2 items-center",children:[a.icon&&e.jsx(d,{name:a.icon,className:"!text-[18px]"}),e.jsx("span",{className:"hover:underline",children:a.title})]},a.id)},a.id))})]}):e.jsx(z,{children:s.type==="blank"?e.jsxs("a",{href:s.link,target:"_blank",className:"flex gap-2 items-center",children:[s.icon&&e.jsx(d,{name:s.icon,className:"!text-[18px]"}),e.jsx("span",{className:"hover:underline",children:s.title})]}):e.jsxs(v,{href:s.link,className:"flex gap-2 items-center",children:[s.icon&&e.jsx(d,{name:s.icon,className:"!text-[18px]"}),e.jsx("span",{className:"hover:underline",children:s.title})]})})},s.id))})]})}),e.jsx(ge,{className:"px-2 py-0 block md:hidden",children:e.jsx(F,{children:e.jsx(E,{asChild:!0,className:"group/collapsible",children:e.jsxs(S,{children:[e.jsx(L,{asChild:!0,children:e.jsxs(w,{children:[e.jsx(d,{name:"rocket_launch",className:"!text-[18px]"}),e.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:t.props.brand}),t.props.section&&e.jsx(P,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"})]})}),t.props.section&&e.jsx(B,{children:e.jsx(O,{children:t.props.section&&t.props.section.map(s=>s.subItems?e.jsx(F,{children:e.jsx(E,{asChild:!0,className:"group/collapsible-sub",children:e.jsxs(S,{children:[e.jsx(L,{asChild:!0,children:e.jsxs(w,{children:[e.jsx(d,{name:s.icon,className:"!text-[18px]"}),e.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:s.title}),e.jsx(P,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible-sub:rotate-90"})]})}),e.jsx(B,{children:e.jsx(O,{children:s.subItems.map(a=>e.jsx(A,{children:e.jsx(R,{asChild:!0,children:a.type==="blank"?e.jsxs("a",{href:a.link,target:"_blank",className:"flex gap-2 items-center",children:[a.icon&&e.jsx(d,{name:a.icon,className:"!text-[18px]"}),e.jsx("span",{className:"hover:underline",children:a.title})]}):e.jsxs(v,{href:a.link,className:"flex gap-2 items-center",children:[a.icon&&e.jsx(d,{name:a.icon,className:"!text-[18px]"}),e.jsx("span",{className:"hover:underline",children:a.title})]})})},a.id))})})]})})},s.id):e.jsx(A,{children:e.jsx(R,{asChild:!0,children:s.type==="blank"?e.jsxs("a",{href:s.link,target:"_blank",className:"flex gap-2 items-center",children:[s.icon&&e.jsx(d,{name:s.icon,className:"!text-[18px]"}),e.jsx("span",{className:"hover:underline",children:s.title})]}):e.jsxs(v,{href:s.link,className:"flex gap-2 items-center",children:[s.icon&&e.jsx(d,{name:s.icon,className:"!text-[18px]"}),e.jsx("span",{className:"hover:underline",children:s.title})]})})},s.id))})})]})})})})]},t.props.brand)})}),e.jsx(Ne,{children:e.jsx(ke,{items:t.props.menu})}),e.jsx(ve,{children:e.jsxs("div",{className:"flex flex-col items-center",children:[t.props.version&&(()=>{const s=t.props.version,a=s.text||"4.6.0",x=new Date("2026-05-05T03:47:10.748Z").toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}),p=s.text?`v.${a}`:`v.${a} · ${x}`,l="text-center opacity-70 hover:opacity-100 transition-opacity text-xs";return s.link?e.jsx("a",{href:s.link,target:"_blank",rel:"noreferrer",title:s.hint??void 0,className:l,children:p}):e.jsx("span",{title:s.hint??void 0,className:l,children:p})})(),t.props.showFeedback&&e.jsx(Me,{})]})})]})}export{ze as AppSidebar};
1
+ import{u as R,j as e,D as V,U as G,aX as Y,i as J,k as Q,l as W,aY as I,aZ as ee,V as se,b as M,I as ae,av as re,B as D,a_ as te,at as le,a$ as ne,L as ie,h as ce,b0 as de,b1 as oe,b2 as F,b3 as S,b4 as xe,b5 as pe,b6 as he,b7 as w,b8 as me,b9 as ue,ba as je,bb as be,bc as fe,bd as z,ai as v,be as ge,bf as E,bg as L,C as P,bh as B,bi as O,bj as $,bk as A,bl as Ne,bm as ve}from"./app.js";import{NavMain as ke}from"./nav-main-BctqyzeV.js";import{r as i,a as ye}from"./handsontable-PxYdjN8c.js";import d from"./material-icon-DMT8KdmE.js";import"./jsoneditor-De1FvcYu.js";import"./monaco-BhBYtg3d.js";const Ce=5*1024*1024,X=i.memo(({routePrefix:t,triggerLabel:s,placeholder:a,ui:x,onClose:p})=>{const l=r=>x[r]??r,[m,k]=i.useState(""),[g,y]=i.useState(""),[j,b]=i.useState([]),[o,N]=i.useState({}),[h,_]=i.useState(!1),[C,Z]=i.useState(!1),T=i.useRef(null),q=r=>{if(!r)return;const n={},u=[];Array.from(r).forEach(c=>{c.size>Ce?n[c.name]=l("File size exceeds the 5 MB limit"):u.push(c)}),b(c=>[...c,...u]),Object.keys(n).length&&N(c=>({...c,...n}))},H=r=>b(n=>n.filter((u,c)=>c!==r)),K=async r=>{var u,c;if(r.preventDefault(),!m.trim()){N({title:l("Title is required")});return}_(!0),N({});const n=new FormData;n.append("title",m.trim()),n.append("description",g.trim()),j.forEach(f=>n.append("files",f));try{await ce.post(`${t}/api/feedback`,n),Z(!0)}catch(f){const U=((c=(u=f==null?void 0:f.response)==null?void 0:u.data)==null?void 0:c.error)??l("Internal server error");N({_global:U}),_(!1)}};return i.useEffect(()=>{if(!C)return;const r=setTimeout(p,2e3);return()=>clearTimeout(r)},[C,p]),C?e.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-24 text-center",children:[e.jsx(I,{size:48,className:"text-green-500 dark:text-green-400"}),e.jsx("p",{className:"text-base font-medium",children:l("Feedback sent successfully")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(ee,{className:"mb-4",children:[e.jsx(se,{children:s??l("Feedback")}),a&&e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:a})]}),e.jsxs("form",{onSubmit:K,className:"space-y-5",noValidate:!0,children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(M,{htmlFor:"fb-title",children:l("Title")}),e.jsx(ae,{id:"fb-title",value:m,onChange:r=>k(r.target.value),disabled:h,placeholder:l("Title"),className:o.title?"border-destructive":""}),o.title&&e.jsx("p",{className:"text-xs text-destructive",children:o.title})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(M,{htmlFor:"fb-desc",children:l("Description")}),e.jsx(re,{id:"fb-desc",value:g,onChange:r=>y(r.target.value),disabled:h,placeholder:l("Description"),rows:5,className:"resize-none"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(M,{children:l("Attach files")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(D,{type:"button",variant:"outline",size:"sm",onClick:()=>{var r;return(r=T.current)==null?void 0:r.click()},disabled:h,children:[e.jsx(te,{size:14,className:"mr-1"}),l("Attach files")]}),e.jsx("span",{className:"text-xs text-muted-foreground",children:l("Max 5 MB per file")})]}),e.jsx("input",{ref:T,type:"file",multiple:!0,className:"hidden",onChange:r=>q(r.target.files),disabled:h}),j.length>0&&e.jsx("ul",{className:"mt-2 space-y-1",children:j.map((r,n)=>e.jsxs("li",{className:"flex items-center justify-between rounded-md border bg-muted/40 px-3 py-1.5 text-xs",children:[e.jsx("span",{className:"truncate max-w-[340px]",children:r.name}),e.jsx("button",{type:"button",onClick:()=>H(n),className:"ml-2 text-muted-foreground hover:text-destructive transition-colors","aria-label":l("Remove file"),disabled:h,children:e.jsx(le,{size:13})})]},n))}),Object.entries(o).filter(([r])=>r!=="title"&&r!=="_global").map(([r,n])=>e.jsx("p",{className:"text-xs text-destructive",children:n},r))]}),o._global&&e.jsx("p",{className:"text-xs text-destructive",children:o._global}),e.jsx(ne,{children:e.jsx(D,{type:"submit",disabled:h,children:h?e.jsxs(e.Fragment,{children:[e.jsx(ie,{size:14,className:"mr-1.5 animate-spin"}),l("Sending...")]}):l("Send")})})]})]})});X.displayName="FeedbackForm";function Me(){const t=R(),s=t.props.uiMessages??{},a=t.props.routePrefix??window.routePrefix??"",x=t.props.feedbackTriggerLabel??null,p=t.props.feedbackPlaceholder??null,[l,m]=i.useState(!1),[k,g]=i.useState(0),y=i.useCallback(()=>m(!1),[]),j=i.useCallback(b=>{m(b),b||g(o=>o+1)},[]);return e.jsxs(V,{open:l,onOpenChange:j,children:[e.jsx(G,{asChild:!0,children:e.jsxs("button",{className:"flex items-center gap-1.5 text-xs opacity-60 hover:opacity-100 transition-opacity cursor-pointer mt-1 mx-auto","aria-label":x??s["Send feedback"]??"Send feedback",children:[e.jsx(Y,{size:13}),x??s["Send feedback"]??"Send feedback"]})}),ye.createPortal(e.jsx(J,{}),document.body),e.jsx(Q,{children:e.jsx(W,{children:e.jsx(X,{routePrefix:a,triggerLabel:x,placeholder:p,ui:s,onClose:y},k)})})]})}function ze(){const t=R();return e.jsxs(de,{collapsible:"icon",variant:"inset",children:[e.jsx(oe,{children:e.jsx(F,{children:e.jsxs(S,{children:[e.jsx(xe,{className:"p-0 shadow-none border-none bg-transparent hidden md:block",children:e.jsxs(pe,{children:[e.jsx(he,{asChild:!0,className:"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground rounded-md",children:e.jsx(w,{asChild:!0,children:e.jsx(D,{variant:"ghost",asChild:!0,className:`w-full ${t.props.section?"":"pointer-events-none"}`,children:e.jsxs("div",{children:[e.jsx(d,{name:"rocket_launch",className:"!text-[18px]"}),e.jsx("span",{className:"group-data-[state=collapsed]:hidden",children:t.props.brand}),t.props.section&&e.jsx(me,{className:"ml-auto group-data-[state=collapsed]:hidden"})]})})})}),t.props.section&&e.jsx(ue,{side:"right",className:"z-[1003]",children:t.props.section.map(s=>e.jsx("div",{children:s.subItems?e.jsxs(je,{children:[e.jsxs(be,{className:"flex gap-2 items-center cursor-pointer",children:[e.jsx(d,{name:s.icon,className:"!text-[18px]"}),e.jsx("span",{className:"hover:underline",children:s.title})]}),e.jsx(fe,{children:s.subItems.map(a=>e.jsx(z,{children:a.type==="blank"?e.jsxs("a",{href:a.link,target:"_blank",className:"flex gap-2 items-center",children:[a.icon&&e.jsx(d,{name:a.icon,className:"!text-[18px]"}),e.jsx("span",{className:"hover:underline",children:a.title})]},a.id):e.jsxs(v,{href:a.link,className:"flex gap-2 items-center",children:[a.icon&&e.jsx(d,{name:a.icon,className:"!text-[18px]"}),e.jsx("span",{className:"hover:underline",children:a.title})]},a.id)},a.id))})]}):e.jsx(z,{children:s.type==="blank"?e.jsxs("a",{href:s.link,target:"_blank",className:"flex gap-2 items-center",children:[s.icon&&e.jsx(d,{name:s.icon,className:"!text-[18px]"}),e.jsx("span",{className:"hover:underline",children:s.title})]}):e.jsxs(v,{href:s.link,className:"flex gap-2 items-center",children:[s.icon&&e.jsx(d,{name:s.icon,className:"!text-[18px]"}),e.jsx("span",{className:"hover:underline",children:s.title})]})})},s.id))})]})}),e.jsx(ge,{className:"px-2 py-0 block md:hidden",children:e.jsx(F,{children:e.jsx(E,{asChild:!0,className:"group/collapsible",children:e.jsxs(S,{children:[e.jsx(L,{asChild:!0,children:e.jsxs(w,{children:[e.jsx(d,{name:"rocket_launch",className:"!text-[18px]"}),e.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:t.props.brand}),t.props.section&&e.jsx(P,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"})]})}),t.props.section&&e.jsx(B,{children:e.jsx(O,{children:t.props.section&&t.props.section.map(s=>s.subItems?e.jsx(F,{children:e.jsx(E,{asChild:!0,className:"group/collapsible-sub",children:e.jsxs(S,{children:[e.jsx(L,{asChild:!0,children:e.jsxs(w,{children:[e.jsx(d,{name:s.icon,className:"!text-[18px]"}),e.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:s.title}),e.jsx(P,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible-sub:rotate-90"})]})}),e.jsx(B,{children:e.jsx(O,{children:s.subItems.map(a=>e.jsx($,{children:e.jsx(A,{asChild:!0,children:a.type==="blank"?e.jsxs("a",{href:a.link,target:"_blank",className:"flex gap-2 items-center",children:[a.icon&&e.jsx(d,{name:a.icon,className:"!text-[18px]"}),e.jsx("span",{className:"hover:underline",children:a.title})]}):e.jsxs(v,{href:a.link,className:"flex gap-2 items-center",children:[a.icon&&e.jsx(d,{name:a.icon,className:"!text-[18px]"}),e.jsx("span",{className:"hover:underline",children:a.title})]})})},a.id))})})]})})},s.id):e.jsx($,{children:e.jsx(A,{asChild:!0,children:s.type==="blank"?e.jsxs("a",{href:s.link,target:"_blank",className:"flex gap-2 items-center",children:[s.icon&&e.jsx(d,{name:s.icon,className:"!text-[18px]"}),e.jsx("span",{className:"hover:underline",children:s.title})]}):e.jsxs(v,{href:s.link,className:"flex gap-2 items-center",children:[s.icon&&e.jsx(d,{name:s.icon,className:"!text-[18px]"}),e.jsx("span",{className:"hover:underline",children:s.title})]})})},s.id))})})]})})})})]},t.props.brand)})}),e.jsx(Ne,{children:e.jsx(ke,{items:t.props.menu})}),e.jsx(ve,{children:e.jsxs("div",{className:"flex flex-col items-center",children:[t.props.version&&(()=>{const s=t.props.version,a=s.text||"4.6.0",x=new Date("2026-05-08T01:55:26.606Z").toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}),p=s.text?`v.${a}`:`v.${a} · ${x}`,l="text-center opacity-70 hover:opacity-100 transition-opacity text-xs";return s.link?e.jsx("a",{href:s.link,target:"_blank",rel:"noreferrer",title:s.hint??void 0,className:l,children:p}):e.jsx("span",{title:s.hint??void 0,className:l,children:p})})(),t.props.showFeedback&&e.jsx(Me,{})]})})]})}export{ze as AppSidebar};
@@ -1 +1 @@
1
- import{h as L,aV as G,u as z,j as e,aW as Q,s as X,B as k,aX as Z,w as K,x as ee,aY as te,N as B,O as R,E as se,Q as F,r as ae,aZ as re,ai as U,L as D,ao as oe,aq as ne,a_ as ie,a$ as ce}from"./app.js";import{Breadcrumbs as le}from"./breadcrumbs-CkRn0IkH.js";import{NavUser as de}from"./nav-user-Booo1xYl.js";import{ThemeSwitcher as ue}from"./theme-switcher-Bx74FM9Q.js";import{r as n}from"./handsontable-PxYdjN8c.js";import fe from"./material-icon-BXxpxGAd.js";const pe={"Cache-Control":"no-store, no-cache, must-revalidate, proxy-revalidate",Pragma:"no-cache",Expires:"0"},H=s=>{if(typeof s!="string")return!1;const c=s.trim().toLowerCase();return c.startsWith("<!doctype html")||c.startsWith("<html")||c.startsWith("<")},he=s=>({...s??{},_ts:Date.now()}),O=async(s,c,a,u)=>{var x,m,S,l;const f={...u,headers:{...pe,...(u==null?void 0:u.headers)??{}},params:he(u==null?void 0:u.params)};try{let o;s==="get"?o=await L.get(c,f):s==="post"?o=await L.post(c,a,f):s==="put"?o=await L.put(c,a,f):o=await L.delete(c,{...f,data:a});const p=String(((x=o.headers)==null?void 0:x["content-type"])??"").toLowerCase();if(p&&!p.includes("application/json")||H(o.data))throw new Error(`Expected JSON response from "${c}", but received "${p||"unknown"}". This usually means the session expired and server returned an HTML login page.`);return o}catch(o){if(o instanceof G){const p=String(((S=(m=o.response)==null?void 0:m.headers)==null?void 0:S["content-type"])??"").toLowerCase();if(H((l=o.response)==null?void 0:l.data)||p.includes("text/html"))throw new Error("Server returned HTML instead of JSON. Most likely auth session expired. Please reload the page and log in again.")}throw o}},y={getJson:(s,c)=>O("get",s,void 0,c),postJson:(s,c,a)=>O("post",s,c,a),putJson:(s,c,a)=>O("put",s,c,a),deleteJson:(s,c,a)=>O("delete",s,c,a)},W=n.createContext(void 0),Ae=({children:s})=>{const[c,a]=n.useState([]),[u,f]=n.useState([]),[x,m]=n.useState([]),[S,l]=n.useState(!1),[o,p]=n.useState(null),[j,A]=n.useState(""),v=z(),[g,C]=n.useState({}),M=[...u,...x],w=async()=>{try{const t=await y.getJson(`${window.routePrefix}/notifications/api`,{params:{unreadOnly:!0,limit:4}});a(t.data)}catch(t){console.error("Error fetching bell notifications:",t)}},d=async()=>{try{const t=await y.postJson(`${window.routePrefix}/notifications`);C(t.data)}catch(t){console.log(t)}},E=async()=>{await w()},b=async()=>{try{const t=await y.getJson(`${window.routePrefix}/notifications/api/get-classes`);t.data&&(p(t.data.activeServices),A(t.data.initTab))}catch(t){console.error("Error fetching tabs:",t)}},$=async(t,r)=>{try{if(!t){await P(r);return}const i=await y.postJson(`${window.routePrefix}/notifications/api/search`,{s:t,notificationClass:r});m(i.data)}catch(i){console.error("Error searching notifications:",i)}},P=async t=>{l(!0);try{const r=`${window.routePrefix}/notifications/api/${t}`,i=await y.getJson(r,{params:{limit:20,skip:0,unreadOnly:!1}});return f([]),m(i.data),i.data}catch(r){return console.error("Error fetching all notifications:",r),[]}finally{l(!1)}},T=async(t,r)=>{try{const i=`${window.routePrefix}/notifications/api/${t}`,h=await y.getJson(i,{params:{limit:20,skip:r,unreadOnly:!1}});return m(N=>[...N,...h.data]),h.data}catch(i){return console.error("Error paginating notifications:",i),[]}};n.useEffect(()=>{if(!v.props.notifications)return;d(),w();const t=new EventSource(`${window.routePrefix}/notifications/api/stream`);return t.addEventListener("connected",r=>{const i=JSON.parse(r.data);console.log("Connected event:",i),b()}),t.addEventListener("notification",r=>{const i=JSON.parse(r.data);f(h=>[i,...h]),a(h=>[i,...h].slice(0,4))}),t.onerror=()=>{console.error("SSE connection error")},()=>t.close()},[]);const I=async(t,r)=>{try{await y.putJson(`${window.routePrefix}/notifications/api/${t}/${r}/read`,{}),f(i=>i.map(h=>h.id===r?{...h,read:!0}:h)),m(i=>i.map(h=>h.id===r?{...h,read:!0}:h)),a([])}catch(i){console.error("Error marking as read:",i)}},J=async()=>{try{await y.putJson(`${window.routePrefix}/notifications/api/read-all`,{}),f(t=>t.map(r=>({...r,read:!0}))),m(t=>t.map(r=>({...r,read:!0}))),await w()}catch(t){console.error("Error marking all as read:",t)}},_=c.filter(t=>!t.read).length;return e.jsx(W.Provider,{value:{bellNotifications:c,allNotifications:M,unreadCount:_,getTabs:b,tabs:o,initTab:j,search:$,markAsRead:I,markAllAsRead:J,getLocale:d,messages:g,fetchAllNotifications:P,paginateNotifications:T,loading:S,refreshBellNotifications:E},children:s})},q=()=>{const s=n.useContext(W);if(s===void 0)throw new Error("useNotifications must be used within a NotificationProvider");return s};function me(){const{bellNotifications:s,markAsRead:c,unreadCount:a,refreshBellNotifications:u,messages:f}=q(),[x,m]=n.useState(!1),S=async(o,p)=>{m(!0);try{await c(o,p),await u()}catch(j){console.error("Error marking as read:",j)}finally{m(!1)}},l=o=>{const p=new Date,j=new Date(o),A=p.getTime()-j.getTime(),v=Math.floor(A/1e3),g=new Intl.RelativeTimeFormat("en",{numeric:"auto"});if(v<60)return g.format(-v,"second");const C=Math.floor(v/60);if(C<60)return g.format(-C,"minute");const M=Math.floor(C/60);if(M<24)return g.format(-M,"hour");const w=Math.floor(M/24);if(w<30)return g.format(-w,"day");const d=Math.floor(w/30);if(d<12)return g.format(-d,"month");const E=Math.floor(d/12);return g.format(-E,"year")};return e.jsxs(Q,{children:[e.jsx(X,{asChild:!0,className:"cursor-pointer data-[state=open]:bg-sidebar-accent",children:e.jsxs(k,{variant:"ghost",className:"relative",children:[e.jsx(Z,{}),a>0&&e.jsx("div",{className:"absolute top-1.5 right-1.5 size-1.5 rounded-full bg-destructive"})]})}),e.jsxs(K,{className:"z-[1002] p-2",align:"end",onCloseAutoFocus:o=>o.preventDefault(),children:[e.jsx(ee,{className:`${x?"opacity-50 pointer-events-none":""}`,children:s.length===0?e.jsx("div",{className:"p-4 text-center text-muted-foreground",children:"No notifications"}):s.map(o=>e.jsxs("div",{children:[e.jsx(te,{asChild:!0,className:"cursor-pointer",onSelect:p=>{p.preventDefault(),ae.visit(`${window.routePrefix}/notifications?type=${o.notificationClass}`)},children:e.jsxs("div",{className:"grid grid-cols-[32px_250px] grid-rows-[auto_1fr] items-start gap-x-4 gap-y-2",children:[o.icon?e.jsx(fe,{name:o.icon.icon,style:{color:o.icon.iconColor},className:"!text-[32px]"}):e.jsx("div",{}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-medium",children:o.title}),e.jsx("span",{className:"truncate",children:o.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:l(o.createdAt)})}),e.jsxs(B,{children:[e.jsx(R,{asChild:!0,children:e.jsx(k,{variant:"ghost",size:"icon",className:"size-4",onClick:p=>{p.stopPropagation(),S(o.notificationClass,o.id)},children:e.jsx(se,{className:"text-primary"})})}),e.jsx(F,{side:"left",className:"z-[1003]",children:e.jsx("p",{children:f["Make read"]})})]})]})]})}),e.jsx(re,{})]},o.id))}),e.jsx(k,{variant:"secondary",asChild:!0,children:e.jsxs(U,{href:`${window.routePrefix}/notifications`,className:`w-full ${x?"opacity-50 pointer-events-none":""}`,children:[f["View All"],x&&e.jsx(D,{className:"h-4 w-4 animate-spin"})]})})]})]})}const xe=()=>{if(!(typeof window>"u"))return window.__adminizerAiAssistantState__??void 0},we=s=>{typeof window>"u"||(window.__adminizerAiAssistantState__=s)},V=n.createContext(void 0),Ee=({children:s})=>{const a=z().props.aiAssistant,u=n.useMemo(()=>xe(),[]),[f,x]=n.useState(()=>(u==null?void 0:u.isOpen)??!1),[m,S]=n.useState([]),[l,o]=n.useState(()=>(u==null?void 0:u.activeModel)??(a==null?void 0:a.defaultModel)??void 0),[p,j]=n.useState([]),[A,v]=n.useState(!1),[g,C]=n.useState(!1),[M,w]=n.useState(null),d=(a==null?void 0:a.enabled)??!1,E=n.useCallback(async()=>{if(d)try{v(!0);const{data:r}=await y.getJson(`${window.routePrefix}/api/ai-assistant/models`);S(r),o(i=>{var N;return i||(a!=null&&a.defaultModel&&r.some(Y=>Y.id===a.defaultModel)?a.defaultModel:(N=r[0])==null?void 0:N.id)})}catch(r){console.error("Failed to load AI assistant models",r),w("Unable to load AI assistant models")}finally{v(!1)}},[a==null?void 0:a.defaultModel,d]),b=n.useCallback(async r=>{if(!(!d||!r))try{v(!0);const{data:i}=await y.getJson(`${window.routePrefix}/api/ai-assistant/history/${r}`);j(i.history??[])}catch(i){console.error("Failed to load AI assistant history",i),w("Unable to load AI assistant history")}finally{v(!1)}},[d]);n.useEffect(()=>{if(!d){j([]);return}E()},[E,d]),n.useEffect(()=>{!d||!l||b(l)},[l,b,d]);const $=n.useCallback(r=>{o(r)},[]),P=n.useCallback(()=>x(!0),[]),T=n.useCallback(()=>x(!1),[]),I=n.useCallback(()=>x(r=>!r),[]),J=n.useCallback(async r=>{if(!d||!l)return;const i=r.trim();if(!i)return;const h={id:`tmp-${Date.now()}`,role:"user",content:i,timestamp:new Date().toISOString(),modelId:l};j(N=>[...N,h]),C(!0),w(null);try{const{data:N}=await y.postJson(`${window.routePrefix}/api/ai-assistant/query`,{modelId:l,message:i});j(N.history??[])}catch(N){console.error("Failed to send AI assistant message",N),w("Unable to reach AI assistant"),await b(l)}finally{C(!1)}},[l,b,d]),_=n.useCallback(async()=>{l&&await b(l)},[l,b]);n.useEffect(()=>{d||x(!1)},[d]),n.useEffect(()=>{we({isOpen:f,activeModel:l})},[l,f]);const t=n.useMemo(()=>({isEnabled:d,isOpen:f,openChat:P,closeChat:T,toggleChat:I,models:m,activeModel:l,setActiveModel:$,messages:p,loading:A,sending:g,error:M,sendMessage:J,refreshHistory:_}),[l,T,M,d,f,A,p,m,P,_,J,g,$,I]);return e.jsx(V.Provider,{value:t,children:s})},ge=()=>{const s=n.useContext(V);if(!s)throw new Error("useAiAssistant must be used within an AiAssistantProvider");return s};function ye(){const{isEnabled:s,isOpen:c,toggleChat:a,models:u,sending:f,loading:x}=ge();if(!s)return null;const m=u.length>0;return e.jsx(e.Fragment,{children:e.jsxs(B,{children:[e.jsx(R,{asChild:!0,children:e.jsx(k,{variant:"ghost",className:ne("relative",{"text-primary":c}),onClick:a,"aria-expanded":c,"aria-haspopup":"true","aria-controls":"ai-assistant-panel",disabled:!m&&x,children:f?e.jsx(D,{className:"size-4 animate-spin"}):e.jsx(oe,{className:"size-4"})})}),e.jsx(F,{side:"bottom",className:"z-[1002]",children:e.jsx("span",{children:"AI assistant"})})]})})}function je({breadcrumbs:s=[]}){const{tabs:c}=q(),a=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(ie,{className:"-ml-1"}),e.jsx(le,{breadcrumbs:s})]}),e.jsxs("div",{className:"flex gap-4 items-center",children:[e.jsx(ye,{}),a.props.history&&e.jsx(U,{href:`${window.routePrefix}/history/view-all`,children:e.jsx(k,{variant:"ghost",size:"icon",className:"shrink-0",children:e.jsx(ce,{})})}),e.jsx(ue,{}),a.props.notifications&&(c===null?e.jsx("div",{className:"w-[40px] flex-none flex justify-center",children:e.jsx(D,{className:"size-4 animate-spin"})}):c.length?e.jsx(me,{}):null),e.jsx(de,{})]})]})})}const Pe=Object.freeze(Object.defineProperty({__proto__:null,AppSidebarHeader:je},Symbol.toStringTag,{value:"Module"}));export{je as A,Ae as N,ge as a,Ee as b,Pe as c,q as u};
1
+ import{h as O,aQ as G,u as z,j as e,aR as Y,s as K,B as k,aS as X,w as Z,x as ee,aT as te,N as R,O as B,E as se,Q as F,r as ae,aU as re,ai as U,L as D,as as oe,au as ne,aV as ie,aW as ce}from"./app.js";import{Breadcrumbs as le}from"./breadcrumbs-CZZirDj8.js";import{NavUser as de}from"./nav-user-Bn1Lt-BZ.js";import{ThemeSwitcher as ue}from"./theme-switcher-DfExsHW2.js";import{r as n}from"./handsontable-PxYdjN8c.js";import fe from"./material-icon-DMT8KdmE.js";const pe={"Cache-Control":"no-store, no-cache, must-revalidate, proxy-revalidate",Pragma:"no-cache",Expires:"0"},H=s=>{if(typeof s!="string")return!1;const c=s.trim().toLowerCase();return c.startsWith("<!doctype html")||c.startsWith("<html")||c.startsWith("<")},he=s=>({...s??{},_ts:Date.now()}),_=async(s,c,a,u)=>{var x,m,S,l;const f={...u,headers:{...pe,...(u==null?void 0:u.headers)??{}},params:he(u==null?void 0:u.params)};try{let o;s==="get"?o=await O.get(c,f):s==="post"?o=await O.post(c,a,f):s==="put"?o=await O.put(c,a,f):o=await O.delete(c,{...f,data:a});const p=String(((x=o.headers)==null?void 0:x["content-type"])??"").toLowerCase();if(p&&!p.includes("application/json")||H(o.data))throw new Error(`Expected JSON response from "${c}", but received "${p||"unknown"}". This usually means the session expired and server returned an HTML login page.`);return o}catch(o){if(o instanceof G){const p=String(((S=(m=o.response)==null?void 0:m.headers)==null?void 0:S["content-type"])??"").toLowerCase();if(H((l=o.response)==null?void 0:l.data)||p.includes("text/html"))throw new Error("Server returned HTML instead of JSON. Most likely auth session expired. Please reload the page and log in again.")}throw o}},y={getJson:(s,c)=>_("get",s,void 0,c),postJson:(s,c,a)=>_("post",s,c,a),putJson:(s,c,a)=>_("put",s,c,a),deleteJson:(s,c,a)=>_("delete",s,c,a)},W=n.createContext(void 0),Ae=({children:s})=>{const[c,a]=n.useState([]),[u,f]=n.useState([]),[x,m]=n.useState([]),[S,l]=n.useState(!1),[o,p]=n.useState(null),[j,A]=n.useState(""),v=z(),[g,C]=n.useState({}),M=[...u,...x],w=async()=>{try{const t=await y.getJson(`${window.routePrefix}/notifications/api`,{params:{unreadOnly:!0,limit:4}});a(t.data)}catch(t){console.error("Error fetching bell notifications:",t)}},d=async()=>{try{const t=await y.postJson(`${window.routePrefix}/notifications`);C(t.data)}catch(t){console.log(t)}},E=async()=>{await w()},b=async()=>{try{const t=await y.getJson(`${window.routePrefix}/notifications/api/get-classes`);t.data&&(p(t.data.activeServices),A(t.data.initTab))}catch(t){console.error("Error fetching tabs:",t)}},$=async(t,r)=>{try{if(!t){await P(r);return}const i=await y.postJson(`${window.routePrefix}/notifications/api/search`,{s:t,notificationClass:r});m(i.data)}catch(i){console.error("Error searching notifications:",i)}},P=async t=>{l(!0);try{const r=`${window.routePrefix}/notifications/api/${t}`,i=await y.getJson(r,{params:{limit:20,skip:0,unreadOnly:!1}});return f([]),m(i.data),i.data}catch(r){return console.error("Error fetching all notifications:",r),[]}finally{l(!1)}},T=async(t,r)=>{try{const i=`${window.routePrefix}/notifications/api/${t}`,h=await y.getJson(i,{params:{limit:20,skip:r,unreadOnly:!1}});return m(N=>[...N,...h.data]),h.data}catch(i){return console.error("Error paginating notifications:",i),[]}};n.useEffect(()=>{if(!v.props.notifications)return;d(),w();const t=new EventSource(`${window.routePrefix}/notifications/api/stream`);return t.addEventListener("connected",r=>{const i=JSON.parse(r.data);console.log("Connected event:",i),b()}),t.addEventListener("notification",r=>{const i=JSON.parse(r.data);f(h=>[i,...h]),a(h=>[i,...h].slice(0,4))}),t.onerror=()=>{console.error("SSE connection error")},()=>t.close()},[]);const I=async(t,r)=>{try{await y.putJson(`${window.routePrefix}/notifications/api/${t}/${r}/read`,{}),f(i=>i.map(h=>h.id===r?{...h,read:!0}:h)),m(i=>i.map(h=>h.id===r?{...h,read:!0}:h)),a([])}catch(i){console.error("Error marking as read:",i)}},J=async()=>{try{await y.putJson(`${window.routePrefix}/notifications/api/read-all`,{}),f(t=>t.map(r=>({...r,read:!0}))),m(t=>t.map(r=>({...r,read:!0}))),await w()}catch(t){console.error("Error marking all as read:",t)}},L=c.filter(t=>!t.read).length;return e.jsx(W.Provider,{value:{bellNotifications:c,allNotifications:M,unreadCount:L,getTabs:b,tabs:o,initTab:j,search:$,markAsRead:I,markAllAsRead:J,getLocale:d,messages:g,fetchAllNotifications:P,paginateNotifications:T,loading:S,refreshBellNotifications:E},children:s})},q=()=>{const s=n.useContext(W);if(s===void 0)throw new Error("useNotifications must be used within a NotificationProvider");return s};function me(){const{bellNotifications:s,markAsRead:c,unreadCount:a,refreshBellNotifications:u,messages:f}=q(),[x,m]=n.useState(!1),S=async(o,p)=>{m(!0);try{await c(o,p),await u()}catch(j){console.error("Error marking as read:",j)}finally{m(!1)}},l=o=>{const p=new Date,j=new Date(o),A=p.getTime()-j.getTime(),v=Math.floor(A/1e3),g=new Intl.RelativeTimeFormat("en",{numeric:"auto"});if(v<60)return g.format(-v,"second");const C=Math.floor(v/60);if(C<60)return g.format(-C,"minute");const M=Math.floor(C/60);if(M<24)return g.format(-M,"hour");const w=Math.floor(M/24);if(w<30)return g.format(-w,"day");const d=Math.floor(w/30);if(d<12)return g.format(-d,"month");const E=Math.floor(d/12);return g.format(-E,"year")};return e.jsxs(Y,{children:[e.jsx(K,{asChild:!0,className:"cursor-pointer data-[state=open]:bg-sidebar-accent",children:e.jsxs(k,{variant:"ghost",className:"relative",children:[e.jsx(X,{}),a>0&&e.jsx("div",{className:"absolute top-1.5 right-1.5 size-1.5 rounded-full bg-destructive"})]})}),e.jsxs(Z,{className:"z-[1002] p-2",align:"end",onCloseAutoFocus:o=>o.preventDefault(),children:[e.jsx(ee,{className:`${x?"opacity-50 pointer-events-none":""}`,children:s.length===0?e.jsx("div",{className:"p-4 text-center text-muted-foreground",children:"No notifications"}):s.map(o=>e.jsxs("div",{children:[e.jsx(te,{asChild:!0,className:"cursor-pointer",onSelect:p=>{p.preventDefault(),ae.visit(`${window.routePrefix}/notifications?type=${o.notificationClass}`)},children:e.jsxs("div",{className:"grid grid-cols-[32px_250px] grid-rows-[auto_1fr] items-start gap-x-4 gap-y-2",children:[o.icon?e.jsx(fe,{name:o.icon.icon,style:{color:o.icon.iconColor},className:"!text-[32px]"}):e.jsx("div",{}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-medium",children:o.title}),e.jsx("span",{className:"truncate",children:o.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:l(o.createdAt)})}),e.jsxs(R,{children:[e.jsx(B,{asChild:!0,children:e.jsx(k,{variant:"ghost",size:"icon",className:"size-4",onClick:p=>{p.stopPropagation(),S(o.notificationClass,o.id)},children:e.jsx(se,{className:"text-primary"})})}),e.jsx(F,{side:"left",className:"z-[1003]",children:e.jsx("p",{children:f["Make read"]})})]})]})]})}),e.jsx(re,{})]},o.id))}),e.jsx(k,{variant:"secondary",asChild:!0,children:e.jsxs(U,{href:`${window.routePrefix}/notifications`,className:`w-full ${x?"opacity-50 pointer-events-none":""}`,children:[f["View All"],x&&e.jsx(D,{className:"h-4 w-4 animate-spin"})]})})]})]})}const xe=()=>{if(!(typeof window>"u"))return window.__adminizerAiAssistantState__??void 0},we=s=>{typeof window>"u"||(window.__adminizerAiAssistantState__=s)},Q=n.createContext(void 0),Ee=({children:s})=>{const a=z().props.aiAssistant,u=n.useMemo(()=>xe(),[]),[f,x]=n.useState(()=>(u==null?void 0:u.isOpen)??!1),[m,S]=n.useState([]),[l,o]=n.useState(()=>(u==null?void 0:u.activeModel)??(a==null?void 0:a.defaultModel)??void 0),[p,j]=n.useState([]),[A,v]=n.useState(!1),[g,C]=n.useState(!1),[M,w]=n.useState(null),d=(a==null?void 0:a.enabled)??!1,E=n.useCallback(async()=>{if(d)try{v(!0);const{data:r}=await y.getJson(`${window.routePrefix}/api/ai-assistant/models`);S(r),o(i=>{var N;return i||(a!=null&&a.defaultModel&&r.some(V=>V.id===a.defaultModel)?a.defaultModel:(N=r[0])==null?void 0:N.id)})}catch(r){console.error("Failed to load AI assistant models",r),w("Unable to load AI assistant models")}finally{v(!1)}},[a==null?void 0:a.defaultModel,d]),b=n.useCallback(async r=>{if(!(!d||!r))try{v(!0);const{data:i}=await y.getJson(`${window.routePrefix}/api/ai-assistant/history/${r}`);j(i.history??[])}catch(i){console.error("Failed to load AI assistant history",i),w("Unable to load AI assistant history")}finally{v(!1)}},[d]);n.useEffect(()=>{if(!d){j([]);return}E()},[E,d]),n.useEffect(()=>{!d||!l||b(l)},[l,b,d]);const $=n.useCallback(r=>{o(r)},[]),P=n.useCallback(()=>x(!0),[]),T=n.useCallback(()=>x(!1),[]),I=n.useCallback(()=>x(r=>!r),[]),J=n.useCallback(async r=>{if(!d||!l)return;const i=r.trim();if(!i)return;const h={id:`tmp-${Date.now()}`,role:"user",content:i,timestamp:new Date().toISOString(),modelId:l};j(N=>[...N,h]),C(!0),w(null);try{const{data:N}=await y.postJson(`${window.routePrefix}/api/ai-assistant/query`,{modelId:l,message:i});j(N.history??[])}catch(N){console.error("Failed to send AI assistant message",N),w("Unable to reach AI assistant"),await b(l)}finally{C(!1)}},[l,b,d]),L=n.useCallback(async()=>{l&&await b(l)},[l,b]);n.useEffect(()=>{d||x(!1)},[d]),n.useEffect(()=>{we({isOpen:f,activeModel:l})},[l,f]);const t=n.useMemo(()=>({isEnabled:d,isOpen:f,openChat:P,closeChat:T,toggleChat:I,models:m,activeModel:l,setActiveModel:$,messages:p,loading:A,sending:g,error:M,sendMessage:J,refreshHistory:L}),[l,T,M,d,f,A,p,m,P,L,J,g,$,I]);return e.jsx(Q.Provider,{value:t,children:s})},ge=()=>{const s=n.useContext(Q);if(!s)throw new Error("useAiAssistant must be used within an AiAssistantProvider");return s};function ye(){const{isEnabled:s,isOpen:c,toggleChat:a,models:u,sending:f,loading:x}=ge();if(!s)return null;const m=u.length>0;return e.jsx(e.Fragment,{children:e.jsxs(R,{children:[e.jsx(B,{asChild:!0,children:e.jsx(k,{variant:"ghost",className:ne("relative",{"text-primary":c}),onClick:a,"aria-expanded":c,"aria-haspopup":"true","aria-controls":"ai-assistant-panel",disabled:!m&&x,children:f?e.jsx(D,{className:"size-4 animate-spin"}):e.jsx(oe,{className:"size-4"})})}),e.jsx(F,{side:"bottom",className:"z-[1002]",children:e.jsx("span",{children:"AI assistant"})})]})})}function je({breadcrumbs:s=[]}){const{tabs:c}=q(),a=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(ie,{className:"-ml-1"}),e.jsx(le,{breadcrumbs:s})]}),e.jsxs("div",{className:"flex gap-4 items-center",children:[e.jsx(ye,{}),a.props.history&&e.jsx(U,{href:`${window.routePrefix}/history/view-all`,children:e.jsx(k,{variant:"ghost",size:"icon",className:"shrink-0",children:e.jsx(ce,{})})}),e.jsx(ue,{}),a.props.notifications&&(c===null?e.jsx("div",{className:"w-[40px] flex-none flex justify-center",children:e.jsx(D,{className:"size-4 animate-spin"})}):c.length?e.jsx(me,{}):null),e.jsx(de,{})]})]})})}const Pe=Object.freeze(Object.defineProperty({__proto__:null,AppSidebarHeader:je},Symbol.toStringTag,{value:"Module"}));export{je as A,Ae as N,ge as a,Ee as b,Pe as c,q as u};