adminizer 4.3.0-build.76 → 4.3.0-build.77

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 (102) hide show
  1. package/assets/add-DSapOiv0.js +1 -0
  2. package/assets/add-form-C04ZI5LT.js +1 -0
  3. package/assets/add-group-DWR7SBTO.js +1 -0
  4. package/assets/add-group-form-CyRwxTs3.js +1 -0
  5. package/assets/add-user-acATGxUL.js +1 -0
  6. package/assets/add-user-form-yp020h4r.js +1 -0
  7. package/assets/app-layout-BmT5KQwc.js +1 -0
  8. package/assets/app-shell-xEVbINZV.js +1 -0
  9. package/assets/app-sidebar-4lm9f_CG.js +1 -0
  10. package/assets/app-sidebar-header-CxXmzszq.js +1 -0
  11. package/assets/app.js +1640 -5786
  12. package/assets/breadcrumbs-livOfa2Z.js +1 -0
  13. package/assets/catalog-CG_EB2kz.js +6 -0
  14. package/assets/dashboard-CsmJfdLb.js +3 -0
  15. package/assets/date-picker-By3kj-Rx.js +1 -0
  16. package/assets/del-modal-DlcbcdR5.js +1 -0
  17. package/assets/dynamic-controls-PxBg8yMz.js +1 -0
  18. package/assets/{field-renderer-BP9UmRzN.js → field-renderer-Bp1lfm0v.js} +136 -136
  19. package/assets/form-CSTeMDf5.js +1 -0
  20. package/assets/form-CxHRGp7p.js +1 -0
  21. package/assets/geo-json-CCgjEQfu.js +4 -0
  22. package/assets/handsontable-D6MvFmcM.js +281 -0
  23. package/assets/home-D00XjLjD.js +2 -0
  24. package/assets/icon-ButfCBrt.js +1 -0
  25. package/assets/init-user-L-oxFTOv.js +1 -0
  26. package/assets/input-error-CHsDLcK0.js +1 -0
  27. package/assets/jsoneditor-CBqATVR0.js +3833 -0
  28. package/assets/list-4TOTsjqE.js +1 -0
  29. package/assets/list-table-vIvydJV2.js +22 -0
  30. package/assets/login-DLMJ6l_r.js +1 -0
  31. package/assets/manifest.json +298 -108
  32. package/assets/material-icon-sXk4BK-N.js +1 -0
  33. package/assets/media-manager-ASGJ4PcS.js +14 -0
  34. package/assets/module-mxngd2cA.js +1 -0
  35. package/assets/monaco-B1uVVM7f.js +11 -0
  36. package/assets/nav-footer-DbGCtmmN.js +1 -0
  37. package/assets/nav-main-BcWhl71g.js +1 -0
  38. package/assets/nav-user-BN2veV3l.js +1 -0
  39. package/assets/notification-BEfA5sT6.js +1 -0
  40. package/assets/pagination-render-BceTnewI.js +1 -0
  41. package/assets/register-C_W_hOmq.js +1 -0
  42. package/assets/tabs-CgZW_LLn.js +1 -0
  43. package/assets/theme-switcher-D1G6OSMc.js +1 -0
  44. package/assets/toast-editor-CfgZXoQZ.js +845 -0
  45. package/assets/user-info-BrWerGLc.js +1 -0
  46. package/assets/user-menu-content-D61_auxX.js +1 -0
  47. package/assets/vendor-DoC2WAmd.js +17 -0
  48. package/assets/welcome-FHRCdke0.js +1 -0
  49. package/package.json +1 -1
  50. package/ui/components/VanillaJSONEditor.d.ts +2 -0
  51. package/ui/components/VanillaJSONEditor.js +101 -0
  52. package/ui/components/handsontable.d.ts +10 -0
  53. package/ui/components/handsontable.js +51 -0
  54. package/ui/components/monaco-editor.d.ts +11 -0
  55. package/ui/components/monaco-editor.js +57 -0
  56. package/ui/hooks/form-state.d.ts +4 -0
  57. package/ui/hooks/form-state.js +45 -0
  58. package/ui/hooks/use-appearance.d.ts +7 -0
  59. package/ui/hooks/use-appearance.js +76 -0
  60. package/ui/hooks/use-window-size.d.ts +5 -0
  61. package/ui/hooks/use-window-size.js +21 -0
  62. package/assets/add-CCznNk7p.js +0 -1
  63. package/assets/add-form-Cujvebyq.js +0 -1
  64. package/assets/add-group-KxM-aCt4.js +0 -1
  65. package/assets/add-group-form-BrDR-i0l.js +0 -1
  66. package/assets/add-user-form-CrfboTix.js +0 -1
  67. package/assets/add-user-uiWxY8Il.js +0 -1
  68. package/assets/app-layout-DlouPwk2.js +0 -1
  69. package/assets/app-shell-B969C0PB.js +0 -1
  70. package/assets/app-sidebar-DBaEEAgj.js +0 -1
  71. package/assets/app-sidebar-header-DAKTYE0g.js +0 -1
  72. package/assets/breadcrumbs-DHQ3AkEO.js +0 -1
  73. package/assets/catalog-Dt5pVGyH.js +0 -6
  74. package/assets/dashboard-SxHpjYT5.js +0 -3
  75. package/assets/date-picker--zSt9NKp.js +0 -1
  76. package/assets/del-modal-B73-X7Bm.js +0 -1
  77. package/assets/dynamic-controls-CSVVCONh.js +0 -1
  78. package/assets/form-NLJGRnF1.js +0 -1
  79. package/assets/form-lSJpGHTy.js +0 -1
  80. package/assets/geo-json-Dq8ViYH4.js +0 -4
  81. package/assets/home-C5a2kMDP.js +0 -2
  82. package/assets/icon-BbhNOU2o.js +0 -1
  83. package/assets/init-user--zYviDj5.js +0 -1
  84. package/assets/input-error-1aQ9bwyz.js +0 -1
  85. package/assets/list-D-3gH3Qy.js +0 -1
  86. package/assets/list-table-D6PqwSh1.js +0 -22
  87. package/assets/login-BQhUl8bB.js +0 -1
  88. package/assets/material-icon-8nTeT-mJ.js +0 -1
  89. package/assets/media-manager-D1nqMyHv.js +0 -14
  90. package/assets/module-DvUc6HiL.js +0 -1
  91. package/assets/nav-footer-xpg-_O5z.js +0 -1
  92. package/assets/nav-main-FLS_mh3K.js +0 -1
  93. package/assets/nav-user-CfXR0Kcu.js +0 -1
  94. package/assets/notification-DsrY4egH.js +0 -1
  95. package/assets/pagination-render-rZ5_6g0n.js +0 -1
  96. package/assets/register-DQ_hsYCS.js +0 -1
  97. package/assets/tabs-DD2mZktY.js +0 -1
  98. package/assets/theme-switcher-BKpJx2Op.js +0 -1
  99. package/assets/toast-editor-CexR_aza.js +0 -845
  100. package/assets/user-info-obJxhBMF.js +0 -1
  101. package/assets/user-menu-content-Bs0bmqDB.js +0 -1
  102. package/assets/welcome-DOcJbFZS.js +0 -1
@@ -0,0 +1 @@
1
+ import{q as t,j as o}from"./app.js";import{A as m}from"./app-layout-BmT5KQwc.js";import p from"./add-form-C04ZI5LT.js";import"./jsoneditor-CBqATVR0.js";import"./vendor-DoC2WAmd.js";import"./monaco-B1uVVM7f.js";import"./handsontable-D6MvFmcM.js";import"./app-shell-xEVbINZV.js";import"./app-sidebar-4lm9f_CG.js";import"./nav-main-BcWhl71g.js";import"./material-icon-sXk4BK-N.js";import"./app-sidebar-header-CxXmzszq.js";import"./breadcrumbs-livOfa2Z.js";import"./nav-user-BN2veV3l.js";import"./user-info-BrWerGLc.js";import"./user-menu-content-D61_auxX.js";import"./theme-switcher-D1G6OSMc.js";import"./icon-ButfCBrt.js";import"./field-renderer-Bp1lfm0v.js";import"./dynamic-controls-PxBg8yMz.js";import"./input-error-CHsDLcK0.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};
@@ -0,0 +1 @@
1
+ import{V,bv as S,j as s,B as E,U as _,aC as z,bw as R,L as k,bx as $,f as A,a as L,l as P,H as D,J,K as U,aD as H,M as K,g as q}from"./app.js";import{r as p}from"./monaco-B1uVVM7f.js";import{Icon as M}from"./icon-ButfCBrt.js";import{F as O}from"./field-renderer-Bp1lfm0v.js";import T from"./input-error-CHsDLcK0.js";import"./jsoneditor-CBqATVR0.js";import"./vendor-DoC2WAmd.js";import"./handsontable-D6MvFmcM.js";import"./dynamic-controls-PxBg8yMz.js";var F=new Map,N=new WeakMap,B=0,G=void 0;function Q(e){return e?(N.has(e)||(B+=1,N.set(e,B.toString())),N.get(e)):"0"}function X(e){return Object.keys(e).sort().filter(t=>e[t]!==void 0).map(t=>`${t}_${t==="root"?Q(e.root):e[t]}`).toString()}function Y(e){const t=X(e);let a=F.get(t);if(!a){const i=new Map;let d;const c=new IntersectionObserver(o=>{o.forEach(n=>{var l;const f=n.isIntersecting&&d.some(u=>n.intersectionRatio>=u);e.trackVisibility&&typeof n.isVisible>"u"&&(n.isVisible=f),(l=i.get(n.target))==null||l.forEach(u=>{u(f,n)})})},e);d=c.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),a={id:t,observer:c,elements:i},F.set(t,a)}return a}function Z(e,t,a={},i=G){if(typeof window.IntersectionObserver>"u"&&i!==void 0){const l=e.getBoundingClientRect();return t(i,{isIntersecting:i,target:e,intersectionRatio:typeof a.threshold=="number"?a.threshold:0,time:0,boundingClientRect:l,intersectionRect:l,rootBounds:l}),()=>{}}const{id:d,observer:c,elements:o}=Y(a),n=o.get(e)||[];return o.has(e)||o.set(e,n),n.push(t),c.observe(e),function(){n.splice(n.indexOf(t),1),n.length===0&&(o.delete(e),c.unobserve(e)),o.size===0&&(c.disconnect(),F.delete(d))}}function W({threshold:e,delay:t,trackVisibility:a,rootMargin:i,root:d,triggerOnce:c,skip:o,initialInView:n,fallbackInView:l,onChange:f}={}){var u;const[j,C]=p.useState(null),m=p.useRef(f),[h,y]=p.useState({inView:!!n,entry:void 0});m.current=f,p.useEffect(()=>{if(o||!j)return;let g;return g=Z(j,(r,v)=>{y({inView:r,entry:v}),m.current&&m.current(r,v),v.isIntersecting&&c&&g&&(g(),g=void 0)},{root:d,rootMargin:i,threshold:e,trackVisibility:a,delay:t},l),()=>{g&&g()}},[Array.isArray(e)?e.toString():e,j,d,i,c,o,a,l,t]);const b=(u=h.entry)==null?void 0:u.target,w=p.useRef(void 0);!j&&b&&!c&&!o&&w.current!==b&&(w.current=b,y({inView:!!n,entry:void 0}));const x=[C,h.inView,h.entry];return x.ref=x[0],x.inView=x[1],x.entry=x[2],x}const I=p.memo(({field:e})=>s.jsxs("div",{className:"flex gap-3",children:[s.jsx(L,{htmlFor:`${e.type}-${e.name}`,children:e.label}),e.tooltip&&s.jsx(D,{children:s.jsxs(J,{children:[s.jsx(U,{onClick:t=>t.preventDefault(),children:s.jsx(M,{iconNode:H,className:"text-primary w-5 h-5 cursor-pointer"})}),s.jsx(K,{align:"center",side:"top",className:"z-[1002]",children:s.jsx("p",{children:e.tooltip})})]})})]})),ee=p.memo(({field:e,value:t,onChange:a,processing:i,notFound:d,search:c})=>{const[o,n]=W({triggerOnce:!0,rootMargin:"100px 0px"});return s.jsx("div",{ref:o,className:"grid gap-4 w-full",children:n?s.jsx(O,{field:e,value:t,onChange:a,notFound:d,search:c,processing:i}):s.jsx(P,{className:"w-full h-[250px] rounded-sm"})})}),de=({page:e,catalog:t,callback:a,openNewWindow:i,openNewWindowLabel:d,isNavigation:c})=>{const{fields:o,btnBack:n,view:l,notFound:f}=e.props,{data:u,setData:j,post:C,processing:m}=V({...Object.fromEntries(o.map(r=>[r.name,r.value??void 0])),jsonPopupCatalog:t}),[h,y]=p.useState(!1),[b,w]=p.useState(i??!1);p.useEffect(()=>(w(i??!1),S(),j({...Object.fromEntries(o.map(r=>[r.name,r.value??void 0])),jsonPopupCatalog:t}),()=>S()),[o,t,i]);const x=p.useCallback((r,v)=>{j(r,v)},[]),g=async r=>{if(r.preventDefault(),t){y(!0);const v=await q.post(e.props.postLink,u);v.status===200&&a&&(c?a(v.data.record,b):a(v.data.record))}else C(e.props.postLink)};return s.jsxs("div",{className:"p-4 w-full",children:[!t&&s.jsxs("div",{className:"w-full sticky z-[1001] py-4 pb-8 top-0 h-fit bg-background flex gap-4",children:[s.jsx(E,{className:"w-fit",asChild:!0,children:s.jsxs(_,{href:n.link,preserveScroll:!0,children:[s.jsx(M,{iconNode:z}),n.title]})}),s.jsxs(E,{variant:"green",type:"submit",className:"w-fit lg:hidden",form:"addUserForm",disabled:h||m||e.props.view||R(),children:[h||m&&s.jsx(k,{className:"h-4 w-4 animate-spin"}),e.props.btnSave.title]})]}),s.jsx("form",{id:"addUserForm",onSubmit:g,className:l?"cursor-not-allowed":"",children:s.jsxs("div",{className:`grid lg:grid-cols-[1fr_150px] gap-4 max-w-[1144px] pb-8 ${t?"lg:grid-cols-[1fr_200px]":"lg:grid-cols-[1fr_150px]"}`,children:[s.jsx("div",{className:"flex flex-col gap-10",children:o.map(r=>s.jsx("div",{className:`grid gap-4 w-full ${l?"pointer-events-none":""}`,children:r.type==="markdown"||r.type==="table"||r.type==="jsonEditor"||r.type==="codeEditor"||r.type==="geoJson"?s.jsxs(s.Fragment,{children:[s.jsx(I,{field:r}),s.jsx(T,{message:$(`${r.type}-${r.name}`)}),s.jsx(ee,{field:r,value:u[r.name],onChange:x,processing:h||m||l,notFound:f,search:e.props.search})]}):s.jsxs(s.Fragment,{children:[s.jsx(I,{field:r}),s.jsx(T,{message:$(`${r.type}-${r.name}`)}),s.jsx(O,{field:r,value:u[r.name],onChange:x,processing:h||m||l,notFound:f,search:e.props.search})]})},r.name))}),s.jsxs("div",{className:`p-4 rounded-md h-fit sticky shadow ${t?"top-0 grid gap-4":"top-[84px] hidden lg:block"}`,children:[c&&s.jsxs("div",{className:"flex gap-4 items-center",children:[s.jsx(A,{id:"targetBlank",checked:b,onCheckedChange:r=>w(!!r),className:"cursor-pointer size-5"}),s.jsx(L,{htmlFor:"targetBlank",children:d})]}),s.jsxs(E,{variant:"green",type:"submit",className:"w-fit",disabled:h||m||e.props.view||R(),children:[(h||m)&&s.jsx(k,{className:"h-4 w-4 animate-spin"}),e.props.btnSave.title]})]})]})})]})};export{I as LabelRenderer,ee as LazyField,de as default};
@@ -0,0 +1 @@
1
+ import{j as r}from"./app.js";import{A as o}from"./app-layout-BmT5KQwc.js";import t from"./add-group-form-CyRwxTs3.js";import"./jsoneditor-CBqATVR0.js";import"./vendor-DoC2WAmd.js";import"./monaco-B1uVVM7f.js";import"./handsontable-D6MvFmcM.js";import"./app-shell-xEVbINZV.js";import"./app-sidebar-4lm9f_CG.js";import"./nav-main-BcWhl71g.js";import"./material-icon-sXk4BK-N.js";import"./app-sidebar-header-CxXmzszq.js";import"./breadcrumbs-livOfa2Z.js";import"./nav-user-BN2veV3l.js";import"./user-info-BrWerGLc.js";import"./user-menu-content-D61_auxX.js";import"./theme-switcher-D1G6OSMc.js";import"./icon-ButfCBrt.js";const m=[];function E(){return r.jsx(o,{breadcrumbs:m,children:r.jsx(t,{})})}export{E as default};
@@ -0,0 +1 @@
1
+ import{q as B,V as q,j as e,B as T,U as M,aC as O,L as S,a as x,I as y,f as U,H as z,J as H,K as J,aD as A,M as G}from"./app.js";import{Icon as I}from"./icon-ButfCBrt.js";import{r as h}from"./monaco-B1uVVM7f.js";import"./jsoneditor-CBqATVR0.js";import"./vendor-DoC2WAmd.js";import"./handsontable-D6MvFmcM.js";const E=h.memo(({field:s,disabled:c,value:d,onCheckedChange:i,tooltip:n})=>{const m=h.useCallback(l=>{i(s.name,l)},[s.name,i]);return e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(U,{id:s.name,className:"cursor-pointer size-5",disabled:c,checked:d,onCheckedChange:m}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(x,{className:"cursor-pointer",htmlFor:s.name,children:s.label}),n&&e.jsx(z,{children:e.jsxs(H,{children:[e.jsx(J,{onClick:l=>l.preventDefault(),children:e.jsx(I,{iconNode:A,className:"text-primary w-5 h-5 cursor-pointer"})}),e.jsx(G,{align:"center",side:"top",children:e.jsx("p",{children:s.tooltip})})]})})]})]})});function W(){var u,j,g,b,v,f,N,C,k,w,F;const s=B(),{fields:c,groupedTokens:d,users:i}=s.props,{data:n,setData:m,clearErrors:l,post:D,processing:o}=q({...Object.fromEntries(c.map(a=>[a.name,a.value])),...Object.fromEntries(i.map(a=>[a.name,a.value])),...Object.fromEntries(d.flatMap(a=>a.fields.map(t=>[t.name,t.value])))}),r=a=>s.props.fields.find(t=>t.name===a),p=h.useCallback((a,t)=>{l(),m(a,t)},[]),L=a=>{a.preventDefault(),D(s.props.postLink)};return e.jsxs("div",{className:"flex h-full flex-1 flex-col gap-4 rounded-xl p-4",children:[e.jsxs("div",{className:"w-full sticky z-[1001] py-4 pb-8 top-0 h-fit bg-background flex gap-4",children:[e.jsx(T,{className:"mb-3 w-fit",asChild:!0,children:e.jsxs(M,{href:s.props.btnBack.link,children:[e.jsx(I,{iconNode:O}),s.props.btnBack.title]})}),e.jsxs(T,{variant:"green",type:"submit",className:"w-fit",form:"addUserForm",disabled:o||s.props.view,children:[o&&e.jsx(S,{className:"h-4 w-4 animate-spin"}),s.props.btnSave.title]})]}),e.jsx("form",{id:"addUserForm",onSubmit:L,className:`${s.props.view?"cursor-not-allowed":""}`,children:e.jsxs("div",{className:"flex flex-col gap-6 max-w-[1144px]",children:[e.jsx("h2",{className:"font-bold text-xl",children:s.props.head}),e.jsxs("div",{className:"grid gap-4",children:[e.jsx(x,{htmlFor:(u=r("name"))==null?void 0:u.name,children:(j=r("name"))==null?void 0:j.label}),e.jsx(y,{id:(g=r("name"))==null?void 0:g.name,type:"text",required:!0,tabIndex:1,autoComplete:(b=r("name"))==null?void 0:b.name,value:n.name,onChange:a=>p("name",a.target.value),disabled:o||s.props.view,placeholder:(v=r("name"))==null?void 0:v.label})]}),e.jsxs("div",{className:"grid gap-4",children:[e.jsx(x,{htmlFor:(f=r("description"))==null?void 0:f.name,children:(N=r("description"))==null?void 0:N.label}),e.jsx(y,{id:(C=r("description"))==null?void 0:C.name,type:"text",required:!0,tabIndex:1,autoComplete:(k=r("description"))==null?void 0:k.name,value:n.description,onChange:a=>p("description",a.target.value),disabled:o||s.props.view,placeholder:(w=r("description"))==null?void 0:w.label})]}),s.props.users.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"font-bold text-xl",children:s.props.userHead}),s.props.users.map(a=>e.jsx(E,{field:a,disabled:o||s.props.view,value:n[a.name],onCheckedChange:p},a.name))]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 xl:grid-cols-4 gap-4",children:((F=s.props.groupedTokens)==null?void 0:F.length)>0&&s.props.groupedTokens.map(a=>e.jsxs("div",{className:"grid gap-4 content-start justify-between",children:[e.jsx("h2",{className:"font-bold text-xl mt-3",children:a.header}),a.fields.map(t=>e.jsx(E,{field:t,disabled:o||s.props.view,value:n[t.name],onCheckedChange:p,tooltip:!0},t.name))]},a.header))})]})})]})}export{W as default};
@@ -0,0 +1 @@
1
+ import{j as r}from"./app.js";import{A as o}from"./app-layout-BmT5KQwc.js";import t from"./add-user-form-yp020h4r.js";import"./jsoneditor-CBqATVR0.js";import"./vendor-DoC2WAmd.js";import"./monaco-B1uVVM7f.js";import"./handsontable-D6MvFmcM.js";import"./app-shell-xEVbINZV.js";import"./app-sidebar-4lm9f_CG.js";import"./nav-main-BcWhl71g.js";import"./material-icon-sXk4BK-N.js";import"./app-sidebar-header-CxXmzszq.js";import"./breadcrumbs-livOfa2Z.js";import"./nav-user-BN2veV3l.js";import"./user-info-BrWerGLc.js";import"./user-menu-content-D61_auxX.js";import"./theme-switcher-D1G6OSMc.js";import"./icon-ButfCBrt.js";import"./input-error-CHsDLcK0.js";const m=[];function F(){return r.jsx(o,{breadcrumbs:m,children:r.jsx(t,{})})}export{F as default};
@@ -0,0 +1 @@
1
+ import{q as he,V as ue,j as e,B as c,U as W,aC as ge,L as je,a as o,I as n,S as X,b as Y,c as Z,d as _,e as ee,f as m,H as fe,J as ve,K as be,aD as we,M as Ne,g as Ce}from"./app.js";import{Icon as se}from"./icon-ButfCBrt.js";import{r as ae}from"./monaco-B1uVVM7f.js";import Pe from"./input-error-CHsDLcK0.js";import ke from"./material-icon-sXk4BK-N.js";import"./jsoneditor-CBqATVR0.js";import"./vendor-DoC2WAmd.js";import"./handsontable-D6MvFmcM.js";function Ae(){var p,x,h,u,g,j,f,v,b,w,N,C,P,k,F,z,y,I,U,S,E,T,A,q,L,V,D,B,M,H,J,O,K,R,$,G,Q;const l=he(),[le,re]=ae.useState(),{fields:ie,groups:de,auth:oe}=l.props,{data:r,setData:te,errors:ne,setError:ce,clearErrors:me,post:pe,processing:i}=ue({...Object.fromEntries(ie.map(s=>[s.name,s.value])),...Object.fromEntries(de.map(s=>[s.name,s.value]))});ae.useEffect(()=>{(async()=>{const t=await Ce.get(`${window.routePrefix}/get-timezones`);re(t.data.timezones)})()},[]);const a=s=>l.props.fields.find(t=>t.name===s),xe=s=>{if(s.preventDefault(),r.userPassword!==r.repeatUserPassword){ce("repeatUserPassword",l.props.passwordError);return}pe(l.props.postLink)},d=(s,t)=>{me(),te(s,t)};return e.jsxs("div",{className:"flex h-full flex-1 flex-col gap-4 rounded-xl p-4",children:[e.jsxs("div",{className:"w-full sticky z-[1001] py-4 pb-8 top-0 h-fit bg-background flex gap-4",children:[e.jsx(c,{className:"mb-3 w-fit",asChild:!0,children:e.jsxs(W,{href:l.props.btnBack.link,children:[e.jsx(se,{iconNode:ge}),l.props.btnBack.title]})}),e.jsxs(c,{variant:"green",type:"submit",className:"w-fit",form:"addUserForm",disabled:i||l.props.view,children:[i&&e.jsx(je,{className:"h-4 w-4 animate-spin"}),l.props.btnSave.title]})]}),e.jsx("form",{id:"addUserForm",onSubmit:xe,className:l.props.view?"cursor-not-allowed":"",children:e.jsxs("div",{className:"flex flex-col gap-10 max-w-[1144px]",children:[e.jsx("h2",{className:"font-bold text-xl",children:l.props.head}),e.jsxs("div",{className:"flex-col xl:flex-row flex gap-16",children:[e.jsxs("div",{className:"basis-1/2 flex flex-col gap-6",children:[e.jsxs("div",{className:"grid gap-4",children:[e.jsx(o,{htmlFor:(p=a("login"))==null?void 0:p.name,children:(x=a("login"))==null?void 0:x.label}),e.jsx(n,{id:(h=a("login"))==null?void 0:h.name,type:"text",required:!0,tabIndex:1,autoComplete:"username",value:r.login,onChange:s=>d("login",s.target.value),disabled:i||l.props.view,placeholder:(u=a("login"))==null?void 0:u.label})]}),e.jsxs("div",{className:"grid gap-4",children:[e.jsx(o,{htmlFor:(g=a("fullName"))==null?void 0:g.name,children:(j=a("fullName"))==null?void 0:j.label}),e.jsx(n,{id:(f=a("fullName"))==null?void 0:f.name,type:"text",required:!0,tabIndex:1,autoComplete:"additional-name",value:r.fullName,onChange:s=>d("fullName",s.target.value),disabled:i||l.props.view,placeholder:(v=a("fullName"))==null?void 0:v.label})]}),e.jsxs("div",{className:"grid gap-4",children:[e.jsx(o,{htmlFor:(b=a("email"))==null?void 0:b.name,children:(w=a("email"))==null?void 0:w.label}),e.jsx(n,{id:(N=a("email"))==null?void 0:N.name,type:"email",required:!0,tabIndex:1,autoComplete:"email",value:r.email,onChange:s=>d("email",s.target.value),disabled:i||l.props.view,placeholder:(C=a("email"))==null?void 0:C.label})]})]}),e.jsxs("div",{className:"basis-1/2 flex flex-col gap-6",children:[e.jsxs("div",{className:"grid gap-4",children:[e.jsx(o,{htmlFor:(P=a("timezone"))==null?void 0:P.name,children:(k=a("timezone"))==null?void 0:k.label}),e.jsxs(X,{onValueChange:s=>d("timezone",s),defaultValue:r.timezone,disabled:i||l.props.view,children:[e.jsx(Y,{className:"w-full cursor-pointer",children:e.jsx(Z,{placeholder:(F=a("timezone"))==null?void 0:F.name})}),e.jsx(_,{children:(le??[]).map(s=>e.jsx(ee,{value:s.value,children:s.label},s.value))})]})]}),e.jsxs("div",{className:"flex flex-col md:flex-row justify-start gap-4 xl:justify-between items-start md:items-center",children:[a("date")&&e.jsxs("div",{className:"grid gap-4",children:[e.jsx(o,{htmlFor:(z=a("date"))==null?void 0:z.name,children:(y=a("date"))==null?void 0:y.label}),e.jsx(n,{id:(I=a("date"))==null?void 0:I.name,type:"date",className:"max-w-fit",tabIndex:1,value:r.date,onChange:s=>d("date",s.target.value),disabled:i})]}),e.jsxs("div",{className:"flex gap-6",children:[a("isAdmin")&&e.jsxs("div",{className:"grid gap-4",children:[e.jsx(o,{className:"cursor-pointer",htmlFor:(U=a("isAdmin"))==null?void 0:U.name,children:(S=a("isAdmin"))==null?void 0:S.label}),e.jsx(m,{id:(E=a("isAdmin"))==null?void 0:E.name,className:"cursor-pointer size-5",disabled:i||l.props.view,checked:r.isAdmin,onCheckedChange:s=>d("isAdmin",s)})]}),a("isConfirmed")&&e.jsxs("div",{className:"grid gap-4",children:[e.jsx(o,{className:"cursor-pointer",htmlFor:(T=a("isConfirmed"))==null?void 0:T.name,children:(A=a("isConfirmed"))==null?void 0:A.label}),e.jsx(m,{id:(q=a("isConfirmed"))==null?void 0:q.name,className:"cursor-pointer size-5",disabled:i||l.props.view,checked:r.isConfirmed,onCheckedChange:s=>d("isConfirmed",s)})]})]})]}),a("locale")&&e.jsxs("div",{className:"grid gap-4",children:[e.jsx(o,{htmlFor:(L=a("locale"))==null?void 0:L.name,children:(V=a("locale"))==null?void 0:V.label}),e.jsxs(X,{onValueChange:s=>d("locale",s),defaultValue:r.locale,disabled:i||l.props.view,children:[e.jsx(Y,{className:"w-full cursor-pointer",children:e.jsx(Z,{placeholder:(D=a("locale"))==null?void 0:D.name})}),e.jsx(_,{children:(l.props.locales??[]).map(s=>e.jsx(ee,{value:s.value,children:s.label},s.value))})]})]})]})]}),oe.user.isAdministrator&&e.jsx(c,{className:"w-fit",asChild:!0,variant:"outline",children:e.jsxs(W,{href:l.props.userPretend.postLink,method:"post",data:{login:r.login,pretend:!0},children:[e.jsx(ke,{name:"masks",className:"!text-[18px]"}),l.props.userPretend.label]})}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("label",{className:"font-bold text-xl",children:(B=a("userPassword"))==null?void 0:B.label}),e.jsx(fe,{children:e.jsxs(ve,{children:[e.jsx(be,{onClick:s=>s.preventDefault(),children:e.jsx(se,{iconNode:we,className:"text-primary w-5 h-5 cursor-pointer"})}),e.jsx(Ne,{align:"center",side:"top",children:e.jsx("p",{children:(M=a("userPassword"))==null?void 0:M.tooltip})})]})})]}),e.jsxs("div",{className:"grid grid-col-1 lg:grid-cols-2 grid-rows-2 gap-x-16 gap-y-6",children:[e.jsxs("div",{className:"grid gap-4 col-span-1",children:[e.jsx(o,{htmlFor:(H=a("userPassword"))==null?void 0:H.name,children:(J=a("userPassword"))==null?void 0:J.label}),e.jsx(n,{id:(O=a("userPassword"))==null?void 0:O.name,type:"password",required:!l.props.edit,tabIndex:1,autoComplete:"new-password",value:r.password,onChange:s=>d("userPassword",s.target.value),disabled:i||l.props.view,placeholder:(K=a("userPassword"))==null?void 0:K.label})]}),e.jsxs("div",{className:"grid gap-4 col-span-1 col-start-1",children:[e.jsx(o,{htmlFor:(R=a("repeatUserPassword"))==null?void 0:R.name,children:($=a("repeatUserPassword"))==null?void 0:$.label}),e.jsx(n,{id:(G=a("repeatUserPassword"))==null?void 0:G.name,type:"password",required:!l.props.edit,tabIndex:1,autoComplete:"new-password",value:r.repeatUserPassword,onChange:s=>d("repeatUserPassword",s.target.value),disabled:i||l.props.view,placeholder:(Q=a("repeatUserPassword"))==null?void 0:Q.label}),e.jsx(Pe,{message:ne.repeatUserPassword})]})]}),l.props.groups.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"font-bold text-xl",children:l.props.groupHead}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-5 xl:grid-cols-6 gap-4",children:l.props.groups.map(s=>e.jsxs("div",{className:"grid gap-4",children:[e.jsx(o,{className:"cursor-pointer",htmlFor:s.name,children:s.label}),e.jsx(m,{id:s.name,disabled:i||l.props.view,className:"cursor-pointer size-5",checked:r[s.name],onCheckedChange:t=>d(s.name,t)})]},s.name))})]})]})})]})}export{Ae as default};
@@ -0,0 +1 @@
1
+ import{q as i,j as r,R as p,ac as m}from"./app.js";import n from"./app-shell-xEVbINZV.js";import{AppSidebar as x}from"./app-sidebar-4lm9f_CG.js";import{A as d,N as j}from"./app-sidebar-header-CxXmzszq.js";import{r as a}from"./monaco-B1uVVM7f.js";const c=a.memo(({children:s,breadcrumbs:t=[],className:e})=>{const o=i();return r.jsxs(n,{variant:"sidebar",children:[r.jsx(p,{title:o.props.title}),r.jsx(x,{}),r.jsxs(m,{className:e,children:[r.jsx(d,{breadcrumbs:t}),s]})]})}),S=a.memo(({children:s,className:t,breadcrumbs:e,...o})=>r.jsx(j,{children:r.jsx(c,{breadcrumbs:e,className:t,...o,children:s})}));export{S as A};
@@ -0,0 +1 @@
1
+ import{j as a,aE as d}from"./app.js";import{r as o}from"./monaco-B1uVVM7f.js";import"./jsoneditor-CBqATVR0.js";import"./vendor-DoC2WAmd.js";import"./handsontable-D6MvFmcM.js";const c=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{c as default};
@@ -0,0 +1 @@
1
+ import{q as N,j as s,aK as b,aL as g,aM as i,aN as c,aO as f,aP as v,aQ as k,aR as d,B as C,aS as M,aT as w,aU as _,aV as y,aW as B,aX as x,U as n,aY as T,aZ as p,a_ as t,C as o,a$ as h,b0 as j,b1 as m,b2 as u,b3 as R,b4 as U}from"./app.js";import{NavMain as $}from"./nav-main-BcWhl71g.js";import l from"./material-icon-sXk4BK-N.js";import"./jsoneditor-CBqATVR0.js";import"./vendor-DoC2WAmd.js";import"./monaco-B1uVVM7f.js";import"./handsontable-D6MvFmcM.js";function G(){const r=N();return s.jsxs(b,{collapsible:"icon",variant:"inset",children:[s.jsx(g,{children:s.jsx(i,{children:s.jsxs(c,{children:[s.jsx(f,{className:"p-0 shadow-none border-none bg-transparent hidden md:block",children:s.jsxs(v,{children:[s.jsx(k,{asChild:!0,className:"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground rounded-md",children:s.jsx(d,{asChild:!0,children:s.jsx(C,{variant:"ghost",asChild:!0,className:`w-full ${r.props.section?"":"pointer-events-none"}`,children:s.jsxs("div",{children:[s.jsx(l,{name:"rocket_launch",className:"!text-[18px]"}),s.jsx("span",{className:"group-data-[state=collapsed]:hidden",children:r.props.brand}),r.props.section&&s.jsx(M,{className:"ml-auto group-data-[state=collapsed]:hidden"})]})})})}),r.props.section&&s.jsx(w,{side:"right",className:"z-[1003]",children:r.props.section.map(a=>s.jsx("div",{children:a.subItems?s.jsxs(_,{children:[s.jsxs(y,{className:"flex gap-2 items-center cursor-pointer",children:[s.jsx(l,{name:a.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:a.title})]}),s.jsx(B,{children:a.subItems.map(e=>s.jsx(x,{children:e.type==="blank"?s.jsxs("a",{href:e.link,target:"_blank",className:"flex gap-2 items-center",children:[e.icon&&s.jsx(l,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]},e.id):s.jsxs(n,{href:e.link,className:"flex gap-2 items-center",children:[e.icon&&s.jsx(l,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]},e.id)},e.id))})]}):s.jsx(x,{children:a.type==="blank"?s.jsxs("a",{href:a.link,target:"_blank",className:"flex gap-2 items-center",children:[a.icon&&s.jsx(l,{name:a.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:a.title})]}):s.jsxs(n,{href:a.link,className:"flex gap-2 items-center",children:[a.icon&&s.jsx(l,{name:a.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:a.title})]})})},a.id))})]})}),s.jsx(T,{className:"px-2 py-0 block md:hidden",children:s.jsx(i,{children:s.jsx(p,{asChild:!0,className:"group/collapsible",children:s.jsxs(c,{children:[s.jsx(t,{asChild:!0,children:s.jsxs(d,{children:[s.jsx(l,{name:"rocket_launch",className:"!text-[18px]"}),s.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:r.props.brand}),r.props.section&&s.jsx(o,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"})]})}),r.props.section&&s.jsx(h,{children:s.jsx(j,{children:r.props.section&&r.props.section.map(a=>a.subItems?s.jsx(i,{children:s.jsx(p,{asChild:!0,className:"group/collapsible-sub",children:s.jsxs(c,{children:[s.jsx(t,{asChild:!0,children:s.jsxs(d,{children:[s.jsx(l,{name:a.icon,className:"!text-[18px]"}),s.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:a.title}),s.jsx(o,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible-sub:rotate-90"})]})}),s.jsx(h,{children:s.jsx(j,{children:a.subItems.map(e=>s.jsx(m,{children:s.jsx(u,{asChild:!0,children:e.type==="blank"?s.jsxs("a",{href:e.link,target:"_blank",className:"flex gap-2 items-center",children:[e.icon&&s.jsx(l,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]}):s.jsxs(n,{href:e.link,className:"flex gap-2 items-center",children:[e.icon&&s.jsx(l,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]})})},e.id))})})]})})},a.id):s.jsx(m,{children:s.jsx(u,{asChild:!0,children:a.type==="blank"?s.jsxs("a",{href:a.link,target:"_blank",className:"flex gap-2 items-center",children:[a.icon&&s.jsx(l,{name:a.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:a.title})]}):s.jsxs(n,{href:a.link,className:"flex gap-2 items-center",children:[a.icon&&s.jsx(l,{name:a.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:a.title})]})})},a.id))})})]})})})})]},r.props.brand)})}),s.jsx(R,{children:s.jsx($,{items:r.props.menu})}),s.jsx(U,{children:s.jsx("div",{className:"text-center opacity-70",children:r.props.showVersion&&"v.4.3.0"})})]})}export{G as AppSidebar};
@@ -0,0 +1 @@
1
+ import{j as e,g as N,aF as C,r as M,B as v,aG as S,u as E,v as $,aH as I,J as P,K as T,a2 as A,M as D,m as k,aI as B,U as R,L as z,aJ as L}from"./app.js";import{Breadcrumbs as O}from"./breadcrumbs-livOfa2Z.js";import{NavUser as _}from"./nav-user-BN2veV3l.js";import{ThemeSwitcher as J}from"./theme-switcher-D1G6OSMc.js";import{r as d}from"./monaco-B1uVVM7f.js";import H from"./material-icon-sXk4BK-N.js";const y=d.createContext(void 0),X=({children:i})=>{const[m,x]=d.useState([]),[j,c]=d.useState([]),[p,h]=d.useState(!1),f=async()=>{try{const r=await N.get(`${window.routePrefix}/api/notifications`,{params:{unreadOnly:!0,limit:4}});x(r.data)}catch(r){console.error("Error fetching bell notifications:",r)}},t=async()=>{await f()},n=async r=>{h(!0);try{const a=r?`${window.routePrefix}/api/notifications/${r}`:`${window.routePrefix}/api/notifications`,s=await N.get(a);return c(s.data),s.data}catch(a){return console.error("Error fetching all notifications:",a),[]}finally{h(!1)}};d.useEffect(()=>{f();const r=new EventSource(`${window.routePrefix}/api/notifications/stream`);return r.addEventListener("connected",a=>{const s=JSON.parse(a.data);console.log("Connected event:",s)}),r.addEventListener("notification",a=>{const s=JSON.parse(a.data);x(o=>[s,...o.filter(l=>l.id!==s.id)].slice(0,4)),c(o=>[s,...o.filter(l=>l.id!==s.id)])}),r.onerror=()=>{console.error("SSE connection error")},()=>r.close()},[]);const u=async(r,a)=>{try{await N.put(`${window.routePrefix}/api/notifications/${r}/${a}/read`,{}),c(s=>s.map(o=>o.id===a?{...o,read:!0}:o)),await f()}catch(s){throw console.error("Error marking as read:",s),s}},w=m.filter(r=>!r.read).length;return e.jsx(y.Provider,{value:{bellNotifications:m,allNotifications:j,unreadCount:w,markAsRead:u,fetchAllNotifications:n,loading:p,refreshBellNotifications:t},children:i})},F=()=>{const i=d.useContext(y);if(i===void 0)throw new Error("useNotifications must be used within a NotificationProvider");return i};function G(){const{bellNotifications:i,markAsRead:m,unreadCount:x,refreshBellNotifications:j}=F(),[c,p]=d.useState(!1),h=async(t,n)=>{p(!0);try{await m(t,n),await j()}catch(u){console.error("Error marking as read:",u)}finally{p(!1)}},f=t=>{const n=new Date,u=new Date(t),w=n.getTime()-u.getTime(),r=Math.floor(w/1e3),a=new Intl.RelativeTimeFormat("en",{numeric:"auto"});if(r<60)return a.format(-r,"second");const s=Math.floor(r/60);if(s<60)return a.format(-s,"minute");const o=Math.floor(s/60);if(o<24)return a.format(-o,"hour");const l=Math.floor(o/24);if(l<30)return a.format(-l,"day");const g=Math.floor(l/30);if(g<12)return a.format(-g,"month");const b=Math.floor(g/12);return a.format(-b,"year")};return e.jsxs(C,{children:[e.jsx(M,{asChild:!0,className:"cursor-pointer data-[state=open]:bg-sidebar-accent",children:e.jsxs(v,{variant:"ghost",className:"relative",children:[e.jsx(S,{}),x>0&&e.jsx("div",{className:"absolute top-1.5 right-1.5 size-1.5 rounded-full bg-destructive"})]})}),e.jsxs(E,{className:"z-[1002] p-2",align:"end",onCloseAutoFocus:t=>t.preventDefault(),children:[e.jsx($,{className:`${c?"opacity-50 pointer-events-none":""}`,children:i.length===0?e.jsx("div",{className:"p-4 text-center text-muted-foreground",children:"No notifications"}):i.map(t=>e.jsxs("div",{children:[e.jsx(I,{asChild:!0,className:"cursor-pointer",onSelect:n=>{n.preventDefault(),k.visit(`${window.routePrefix}/notifications?type=${t.notificationClass}`)},children:e.jsxs("div",{className:"grid grid-cols-[32px_250px] grid-rows-[auto_1fr] items-start gap-x-4 gap-y-2",children:[t.icon?e.jsx(H,{name:t.icon.icon,style:{color:t.icon.iconColor},className:"!text-[32px]"}):e.jsx("div",{}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-medium",children:t.title}),e.jsx("span",{className:"truncate",children:t.message})]}),e.jsxs("div",{className:"col-start-2 flex justify-between flex-nowrap items-center",children:[e.jsxs("div",{className:"flex flex-nowrap gap-2 items-center",children:[t.notificationClass==="general"?e.jsx("div",{className:"font-medium",children:"Info"}):e.jsx("div",{className:"font-medium",children:"Activity"}),e.jsx("span",{children:"●"}),e.jsx("div",{children:f(t.createdAt)})]}),e.jsxs(P,{children:[e.jsx(T,{asChild:!0,children:e.jsx(v,{variant:"ghost",size:"icon",className:"size-4",onClick:n=>{n.stopPropagation(),h(t.notificationClass,t.id)},children:e.jsx(A,{className:"text-primary"})})}),e.jsx(D,{side:"left",className:"z-[1003]",children:e.jsx("p",{children:"Make read"})})]})]})]})}),e.jsx(B,{})]},t.id))}),e.jsx(v,{variant:"secondary",asChild:!0,children:e.jsxs(R,{href:`${window.routePrefix}/notifications?type=general`,className:`w-full ${c?"opacity-50 pointer-events-none":""}`,children:["View All",c&&e.jsx(z,{className:"h-4 w-4 animate-spin"})]})})]})]})}function U({breadcrumbs:i=[]}){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(L,{className:"-ml-1"}),e.jsx(O,{breadcrumbs:i})]}),e.jsxs("div",{className:"flex gap-4 items-center",children:[e.jsx(J,{}),e.jsx(G,{}),e.jsx(_,{})]})]})})}const Z=Object.freeze(Object.defineProperty({__proto__:null,AppSidebarHeader:U},Symbol.toStringTag,{value:"Module"}));export{U as A,X as N,Z as a,F as u};