adminizer 4.4.0 → 4.5.0-build.176

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 (68) hide show
  1. package/assets/add-8gey7dzI.js +1 -0
  2. package/assets/{add-form-Taz9dTw_.js → add-form-BfIXZ_9g.js} +1 -1
  3. package/assets/add-group-DukHMB0D.js +1 -0
  4. package/assets/{add-group-form-DMz0_Oo9.js → add-group-form-BkXmTsXF.js} +1 -1
  5. package/assets/add-user-BMSnrNjG.js +1 -0
  6. package/assets/{add-user-form-izlXhv2-.js → add-user-form-CeLtuCJN.js} +1 -1
  7. package/assets/{app-ByR7F4XX.css → app-CUnGKHb5.css} +1 -1
  8. package/assets/app-layout-BarrICdq.js +1 -0
  9. package/assets/{app-shell-C8Cnr5Hy.js → app-shell-CggZrBz6.js} +1 -1
  10. package/assets/{app-sidebar-BCtD_nHo.js → app-sidebar-CiyLPsHp.js} +1 -1
  11. package/assets/app-sidebar-header-pfquDpHT.js +1 -0
  12. package/assets/app.js +2 -2
  13. package/assets/breadcrumbs-BS5uXMaM.js +1 -0
  14. package/assets/{catalog-DYJ6dK_P.js → catalog-Bf_ljqeu.js} +1 -1
  15. package/assets/{dashboard-DEVNMK2g.js → dashboard-Bq5BHxQd.js} +1 -1
  16. package/assets/{date-picker-kW3wZQr_.js → date-picker-BjXNej9c.js} +1 -1
  17. package/assets/del-modal-P8KiMFNx.js +1 -0
  18. package/assets/{field-renderer-CVUxftOw.js → field-renderer-CUYWPzfi.js} +3 -3
  19. package/assets/form-BZYpPjh4.js +1 -0
  20. package/assets/{form-1GnTJlbE.js → form-DMLPoAW8.js} +1 -1
  21. package/assets/{geo-json-YeWQOYnT.js → geo-json-CM4o8sUY.js} +1 -1
  22. package/assets/{home-ipCg51mN.js → home-DOZTBkTR.js} +2 -2
  23. package/assets/list-BciRbNoe.js +1 -0
  24. package/assets/{list-table-Do8_doRe.js → list-table-CmYyTdS5.js} +3 -3
  25. package/assets/manifest.json +75 -75
  26. package/assets/{media-manager-IknQnWel.js → media-manager-CGPeuOR2.js} +1 -1
  27. package/assets/{module-Bf9rzSBs.js → module-CXzKzMta.js} +1 -1
  28. package/assets/{nav-footer-B85HLj-j.js → nav-footer-2ZwcY1Pj.js} +1 -1
  29. package/assets/{nav-main-UuH4U_0H.js → nav-main-CZa4xkP1.js} +1 -1
  30. package/assets/{nav-user-DuCZNsZX.js → nav-user-e1Cj0abB.js} +1 -1
  31. package/assets/{notification-C6X6f-xS.js → notification-DiUY6oAU.js} +1 -1
  32. package/assets/{pagination-render-io0M2m2O.js → pagination-render-C1OX0c6q.js} +1 -1
  33. package/assets/{tabs-BhkFoerH.js → tabs-7Dl6--VG.js} +1 -1
  34. package/assets/theme-switcher-xFldiRZz.js +1 -0
  35. package/assets/{toast-editor-DwRk6WqT.js → toast-editor-Bso8riqX.js} +1 -1
  36. package/assets/{user-info-BGQvqBmO.js → user-info-DrdQBvFb.js} +1 -1
  37. package/assets/{user-menu-content-BDm88xaM.js → user-menu-content-ePAt_cwK.js} +1 -1
  38. package/assets/{welcome-Cu8G7BE9.js → welcome-BhkcZ9JK.js} +1 -1
  39. package/controllers/ai/AiAssistantController.d.ts +7 -0
  40. package/controllers/ai/AiAssistantController.js +92 -0
  41. package/interfaces/adminpanelConfig.d.ts +5 -0
  42. package/interfaces/types.d.ts +13 -0
  43. package/lib/Adminizer.d.ts +2 -0
  44. package/lib/Adminizer.js +4 -0
  45. package/lib/ai-assistant/AbstractAiModelService.d.ts +17 -0
  46. package/lib/ai-assistant/AbstractAiModelService.js +32 -0
  47. package/lib/ai-assistant/AiAssistantHandler.d.ts +19 -0
  48. package/lib/ai-assistant/AiAssistantHandler.js +58 -0
  49. package/lib/ai-assistant/DummyAiModelService.d.ts +8 -0
  50. package/lib/ai-assistant/DummyAiModelService.js +14 -0
  51. package/lib/ai-assistant/OpenAiModelService.d.ts +24 -0
  52. package/lib/ai-assistant/OpenAiModelService.js +185 -0
  53. package/package.json +6 -3
  54. package/system/Router.js +7 -0
  55. package/system/bindAiAssistant.d.ts +2 -0
  56. package/system/bindAiAssistant.js +30 -0
  57. package/system/bindInertia.js +4 -0
  58. package/system/defaults.js +5 -0
  59. package/assets/add-DFzzaDhZ.js +0 -1
  60. package/assets/add-group-BVYkGCd9.js +0 -1
  61. package/assets/add-user-Dq_U0RCT.js +0 -1
  62. package/assets/app-layout-C7q3_eFS.js +0 -1
  63. package/assets/app-sidebar-header-Bcpas2Np.js +0 -1
  64. package/assets/breadcrumbs-DSMzNYiS.js +0 -1
  65. package/assets/del-modal-DyIWFflP.js +0 -1
  66. package/assets/form-B4ymMuwj.js +0 -1
  67. package/assets/list-C_KPYQc4.js +0 -1
  68. package/assets/theme-switcher-cgyA7_cO.js +0 -1
@@ -0,0 +1 @@
1
+ import{u as t,j as o}from"./app.js";import{A as m}from"./app-layout-BarrICdq.js";import p from"./add-form-BfIXZ_9g.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./monaco-ICtx6xoc.js";import"./handsontable-PVakPtJV.js";import"./app-shell-CggZrBz6.js";import"./app-sidebar-CiyLPsHp.js";import"./nav-main-CZa4xkP1.js";import"./material-icon-DwkE6wKL.js";import"./app-sidebar-header-pfquDpHT.js";import"./breadcrumbs-BS5uXMaM.js";import"./nav-user-e1Cj0abB.js";import"./user-info-DrdQBvFb.js";import"./user-menu-content-ePAt_cwK.js";import"./theme-switcher-xFldiRZz.js";import"./icon-DpkedrXG.js";import"./field-renderer-CUYWPzfi.js";import"./dynamic-controls-BOYmRX_z.js";import"./input-error-CmXZF6xy.js";const i=[];function k(){const r=t();return o.jsx(m,{breadcrumbs:i,children:o.jsx(p,{page:r,catalog:!1})})}export{k as default};
@@ -1 +1 @@
1
- import{X as J,bx as $,j as r,B as S,W as K,aE as X,by as T,L as B,bz as z,g as A,b as C,m as G,K as H,M as Q,N as W,aF as Y,O as Z,h as ee}from"./app.js";import{r as d}from"./monaco-ICtx6xoc.js";import{Icon as M}from"./icon-DpkedrXG.js";import{F as U}from"./field-renderer-CVUxftOw.js";import O from"./input-error-CmXZF6xy.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./handsontable-PVakPtJV.js";import"./dynamic-controls-BOYmRX_z.js";var I=new Map,k=new WeakMap,V=0,re=void 0;function se(e){return e?(k.has(e)||(V+=1,k.set(e,V.toString())),k.get(e)):"0"}function te(e){return Object.keys(e).sort().filter(t=>e[t]!==void 0).map(t=>`${t}_${t==="root"?se(e.root):e[t]}`).toString()}function ne(e){const t=te(e);let o=I.get(t);if(!o){const i=new Map;let p;const c=new IntersectionObserver(l=>{l.forEach(n=>{var a;const g=n.isIntersecting&&p.some(u=>n.intersectionRatio>=u);e.trackVisibility&&typeof n.isVisible>"u"&&(n.isVisible=g),(a=i.get(n.target))==null||a.forEach(u=>{u(g,n)})})},e);p=c.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),o={id:t,observer:c,elements:i},I.set(t,o)}return o}function ae(e,t,o={},i=re){if(typeof window.IntersectionObserver>"u"&&i!==void 0){const a=e.getBoundingClientRect();return t(i,{isIntersecting:i,target:e,intersectionRatio:typeof o.threshold=="number"?o.threshold:0,time:0,boundingClientRect:a,intersectionRect:a,rootBounds:a}),()=>{}}const{id:p,observer:c,elements:l}=ne(o),n=l.get(e)||[];return l.has(e)||l.set(e,n),n.push(t),c.observe(e),function(){n.splice(n.indexOf(t),1),n.length===0&&(l.delete(e),c.unobserve(e)),l.size===0&&(c.disconnect(),I.delete(p))}}function oe({threshold:e,delay:t,trackVisibility:o,rootMargin:i,root:p,triggerOnce:c,skip:l,initialInView:n,fallbackInView:a,onChange:g}={}){var u;const[j,N]=d.useState(null),f=d.useRef(g),[w,m]=d.useState({inView:!!n,entry:void 0});f.current=g,d.useEffect(()=>{if(l||!j)return;let v;return v=ae(j,(E,y)=>{m({inView:E,entry:y}),f.current&&f.current(E,y),y.isIntersecting&&c&&v&&(v(),v=void 0)},{root:p,rootMargin:i,threshold:e,trackVisibility:o,delay:t},a),()=>{v&&v()}},[Array.isArray(e)?e.toString():e,j,p,i,c,l,o,a,t]);const F=(u=w.entry)==null?void 0:u.target,h=d.useRef(void 0);!j&&F&&!c&&!l&&h.current!==F&&(h.current=F,m({inView:!!n,entry:void 0}));const x=[N,w.inView,w.entry];return x.ref=x[0],x.inView=x[1],x.entry=x[2],x}const _=d.memo(({field:e})=>!e||typeof e!="object"||!e.label?(console.error("Invalid field for LabelRenderer:",e),null):r.jsxs("div",{className:"flex gap-3",children:[r.jsx(C,{htmlFor:`${e.type}-${e.name}`,children:e.label}),e.tooltip&&r.jsx(H,{children:r.jsxs(Q,{children:[r.jsx(W,{onClick:t=>t.preventDefault(),children:r.jsx(M,{iconNode:Y,className:"text-primary w-5 h-5 cursor-pointer"})}),r.jsx(Z,{align:"center",side:"top",className:"z-[1002]",children:r.jsx("p",{children:e.tooltip})})]})})]})),ie=d.memo(({field:e,value:t,onChange:o,processing:i,notFound:p,search:c})=>{if(!e||typeof e!="object"||!e.name||!e.type)return console.error("Invalid field for LazyField:",e),r.jsx("div",{className:"text-red-500",children:"Error: Invalid field data"});const[l,n]=oe({triggerOnce:!0,rootMargin:"100px 0px"});return r.jsx("div",{ref:l,className:"grid gap-4 w-full",children:n?r.jsx(U,{field:e,value:t,onChange:o,notFound:p,search:c,processing:i}):r.jsx(G,{className:"w-full h-[250px] rounded-sm"})})}),ge=({page:e,catalog:t,callback:o,openNewWindow:i,openNewWindowLabel:p,isNavigation:c,DnavVisible:l,visibleLable:n})=>{const{fields:a,btnBack:g,view:u,notFound:j}=e.props,{data:N,setData:f,post:w,processing:m,transform:F}=J({...Object.fromEntries((a||[]).map(s=>[s.name,s.value??void 0])),jsonPopupCatalog:t}),[h,x]=d.useState(!1),[v,E]=d.useState(i??!1),[y,P]=d.useState(l??!1);d.useEffect(()=>(E(i??!1),$(),f({...Object.fromEntries((a||[]).map(s=>[s.name,s.value??void 0])),jsonPopupCatalog:t}),()=>$()),[a,t,i,f]);const R=d.useCallback((s,b)=>{f(s,b)},[f]);if(!Array.isArray(a))return console.error("Fields is not an array:",a),r.jsx("div",{className:"p-4 text-red-500",children:"Error: Fields data is invalid"});if(a.length===0)return console.warn("Fields array is empty"),r.jsx("div",{className:"p-4 text-gray-500",children:"No fields to display"});const L=a.filter(s=>!s||typeof s!="object"||!s.name||!s.type||!s.label);if(L.length>0)return console.error("Invalid fields found:",L),r.jsx("div",{className:"p-4 text-red-500",children:"Error: Some fields are missing required properties (name, type, label)"});const D=async s=>{if(s.preventDefault(),t){x(!0);const b=await ee.post(e.props.postLink,N);b.status===200&&o&&(c?o(b.data.record,v,y):o(b.data.record))}else{const b=localStorage.getItem("backUrl");F(q=>({...q,redirectUrl:b??""})),w(e.props.postLink,{onSuccess:()=>{localStorage.setItem("backUrl","")}})}};return r.jsxs("div",{className:"p-4 w-full",children:[!t&&r.jsxs("div",{className:"w-full sticky z-[1001] py-4 pb-8 top-0 h-fit bg-background flex gap-4",children:[r.jsx(S,{className:"w-fit",asChild:!0,children:r.jsxs(K,{href:g.link,preserveScroll:!0,children:[r.jsx(M,{iconNode:X}),g.title]})}),r.jsxs(S,{variant:"green",type:"submit",className:"w-fit lg:hidden",form:"addUserForm",disabled:h||m||e.props.view||T(),children:[h||m&&r.jsx(B,{className:"h-4 w-4 animate-spin"}),e.props.btnSave.title]})]}),r.jsx("form",{id:"addUserForm",onSubmit:D,className:u?"cursor-not-allowed":"",children:r.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:[r.jsx("div",{className:"flex flex-col gap-10",children:a.map(s=>r.jsx("div",{className:`grid gap-4 w-full ${u?"pointer-events-none":""}`,children:s.type==="markdown"||s.type==="table"||s.type==="jsonEditor"||s.type==="codeEditor"||s.type==="geoJson"?r.jsxs(r.Fragment,{children:[r.jsx(_,{field:s}),r.jsx(O,{message:z(`${s.type}-${s.name}`)}),r.jsx(ie,{field:s,value:N[s.name],onChange:R,processing:h||m||u,notFound:j,search:e.props.search})]}):r.jsxs(r.Fragment,{children:[r.jsx(_,{field:s}),r.jsx(O,{message:z(`${s.type}-${s.name}`)}),r.jsx(U,{field:s,value:N[s.name],onChange:R,processing:h||m||u,notFound:j,search:e.props.search})]})},s.name))}),r.jsxs("div",{className:`p-4 rounded-md h-fit sticky shadow ${t?"top-0 grid gap-4":"top-[84px] hidden lg:block"}`,children:[c&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex gap-4 items-center",children:[r.jsx(A,{id:"targetBlank",checked:v,onCheckedChange:s=>E(!!s),className:"cursor-pointer size-5"}),r.jsx(C,{htmlFor:"targetBlank",children:p})]}),r.jsxs("div",{className:"flex gap-4 items-center",children:[r.jsx(A,{id:"visible",checked:y,onCheckedChange:s=>P(!!s),className:"cursor-pointer size-5"}),r.jsx(C,{htmlFor:"visible",children:n})]})]}),r.jsxs(S,{variant:"green",type:"submit",className:"w-fit",disabled:h||m||e.props.view||T(),children:[(h||m)&&r.jsx(B,{className:"h-4 w-4 animate-spin"}),e.props.btnSave.title]})]})]})})]})};export{_ as LabelRenderer,ie as LazyField,ge as default};
1
+ import{X as H,bA as $,j as r,B as E,W as J,aH as K,bB as B,L as T,bC as A,g as z,b as S,m as X,K as G,M as Q,N as W,aI as Y,O as Z,h as ee}from"./app.js";import{r as d}from"./monaco-ICtx6xoc.js";import{Icon as M}from"./icon-DpkedrXG.js";import{F as U}from"./field-renderer-CUYWPzfi.js";import O from"./input-error-CmXZF6xy.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./handsontable-PVakPtJV.js";import"./dynamic-controls-BOYmRX_z.js";var I=new Map,C=new WeakMap,V=0,re=void 0;function se(e){return e?(C.has(e)||(V+=1,C.set(e,V.toString())),C.get(e)):"0"}function te(e){return Object.keys(e).sort().filter(t=>e[t]!==void 0).map(t=>`${t}_${t==="root"?se(e.root):e[t]}`).toString()}function ne(e){const t=te(e);let o=I.get(t);if(!o){const i=new Map;let p;const c=new IntersectionObserver(l=>{l.forEach(n=>{var a;const g=n.isIntersecting&&p.some(u=>n.intersectionRatio>=u);e.trackVisibility&&typeof n.isVisible>"u"&&(n.isVisible=g),(a=i.get(n.target))==null||a.forEach(u=>{u(g,n)})})},e);p=c.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),o={id:t,observer:c,elements:i},I.set(t,o)}return o}function ae(e,t,o={},i=re){if(typeof window.IntersectionObserver>"u"&&i!==void 0){const a=e.getBoundingClientRect();return t(i,{isIntersecting:i,target:e,intersectionRatio:typeof o.threshold=="number"?o.threshold:0,time:0,boundingClientRect:a,intersectionRect:a,rootBounds:a}),()=>{}}const{id:p,observer:c,elements:l}=ne(o),n=l.get(e)||[];return l.has(e)||l.set(e,n),n.push(t),c.observe(e),function(){n.splice(n.indexOf(t),1),n.length===0&&(l.delete(e),c.unobserve(e)),l.size===0&&(c.disconnect(),I.delete(p))}}function oe({threshold:e,delay:t,trackVisibility:o,rootMargin:i,root:p,triggerOnce:c,skip:l,initialInView:n,fallbackInView:a,onChange:g}={}){var u;const[j,N]=d.useState(null),f=d.useRef(g),[w,m]=d.useState({inView:!!n,entry:void 0});f.current=g,d.useEffect(()=>{if(l||!j)return;let x;return x=ae(j,(k,y)=>{m({inView:k,entry:y}),f.current&&f.current(k,y),y.isIntersecting&&c&&x&&(x(),x=void 0)},{root:p,rootMargin:i,threshold:e,trackVisibility:o,delay:t},a),()=>{x&&x()}},[Array.isArray(e)?e.toString():e,j,p,i,c,l,o,a,t]);const F=(u=w.entry)==null?void 0:u.target,h=d.useRef(void 0);!j&&F&&!c&&!l&&h.current!==F&&(h.current=F,m({inView:!!n,entry:void 0}));const v=[N,w.inView,w.entry];return v.ref=v[0],v.inView=v[1],v.entry=v[2],v}const _=d.memo(({field:e})=>!e||typeof e!="object"||!e.label?(console.error("Invalid field for LabelRenderer:",e),null):r.jsxs("div",{className:"flex gap-3",children:[r.jsx(S,{htmlFor:`${e.type}-${e.name}`,children:e.label}),e.tooltip&&r.jsx(G,{children:r.jsxs(Q,{children:[r.jsx(W,{onClick:t=>t.preventDefault(),children:r.jsx(M,{iconNode:Y,className:"text-primary w-5 h-5 cursor-pointer"})}),r.jsx(Z,{align:"center",side:"top",className:"z-[1002]",children:r.jsx("p",{children:e.tooltip})})]})})]})),ie=d.memo(({field:e,value:t,onChange:o,processing:i,notFound:p,search:c})=>{if(!e||typeof e!="object"||!e.name||!e.type)return console.error("Invalid field for LazyField:",e),r.jsx("div",{className:"text-red-500",children:"Error: Invalid field data"});const[l,n]=oe({triggerOnce:!0,rootMargin:"100px 0px"});return r.jsx("div",{ref:l,className:"grid gap-4 w-full",children:n?r.jsx(U,{field:e,value:t,onChange:o,notFound:p,search:c,processing:i}):r.jsx(X,{className:"w-full h-[250px] rounded-sm"})})}),ge=({page:e,catalog:t,callback:o,openNewWindow:i,openNewWindowLabel:p,isNavigation:c,DnavVisible:l,visibleLable:n})=>{const{fields:a,btnBack:g,view:u,notFound:j}=e.props,{data:N,setData:f,post:w,processing:m,transform:F}=H({...Object.fromEntries((a||[]).map(s=>[s.name,s.value??void 0])),jsonPopupCatalog:t}),[h,v]=d.useState(!1),[x,k]=d.useState(i??!1),[y,P]=d.useState(l??!1);d.useEffect(()=>(k(i??!1),$(),f({...Object.fromEntries((a||[]).map(s=>[s.name,s.value??void 0])),jsonPopupCatalog:t}),()=>$()),[a,t,i,f]);const R=d.useCallback((s,b)=>{f(s,b)},[f]);if(!Array.isArray(a))return console.error("Fields is not an array:",a),r.jsx("div",{className:"p-4 text-red-500",children:"Error: Fields data is invalid"});if(a.length===0)return console.warn("Fields array is empty"),r.jsx("div",{className:"p-4 text-gray-500",children:"No fields to display"});const L=a.filter(s=>!s||typeof s!="object"||!s.name||!s.type||!s.label);if(L.length>0)return console.error("Invalid fields found:",L),r.jsx("div",{className:"p-4 text-red-500",children:"Error: Some fields are missing required properties (name, type, label)"});const D=async s=>{if(s.preventDefault(),t){v(!0);const b=await ee.post(e.props.postLink,N);b.status===200&&o&&(c?o(b.data.record,x,y):o(b.data.record))}else{const b=localStorage.getItem("backUrl");F(q=>({...q,redirectUrl:b??""})),w(e.props.postLink,{onSuccess:()=>{localStorage.setItem("backUrl","")}})}};return r.jsxs("div",{className:"p-4 w-full",children:[!t&&r.jsxs("div",{className:"w-full sticky z-[1001] py-4 pb-8 top-0 h-fit bg-background flex gap-4",children:[r.jsx(E,{className:"w-fit",asChild:!0,children:r.jsxs(J,{href:g.link,preserveScroll:!0,children:[r.jsx(M,{iconNode:K}),g.title]})}),r.jsxs(E,{variant:"green",type:"submit",className:"w-fit lg:hidden",form:"addUserForm",disabled:h||m||e.props.view||B(),children:[h||m&&r.jsx(T,{className:"h-4 w-4 animate-spin"}),e.props.btnSave.title]})]}),r.jsx("form",{id:"addUserForm",onSubmit:D,className:u?"cursor-not-allowed":"",children:r.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:[r.jsx("div",{className:"flex flex-col gap-10",children:a.map(s=>r.jsx("div",{className:`grid gap-4 w-full ${u?"pointer-events-none":""}`,children:s.type==="markdown"||s.type==="table"||s.type==="jsonEditor"||s.type==="codeEditor"||s.type==="geoJson"?r.jsxs(r.Fragment,{children:[r.jsx(_,{field:s}),r.jsx(O,{message:A(`${s.type}-${s.name}`)}),r.jsx(ie,{field:s,value:N[s.name],onChange:R,processing:h||m||u,notFound:j,search:e.props.search})]}):r.jsxs(r.Fragment,{children:[r.jsx(_,{field:s}),r.jsx(O,{message:A(`${s.type}-${s.name}`)}),r.jsx(U,{field:s,value:N[s.name],onChange:R,processing:h||m||u,notFound:j,search:e.props.search})]})},s.name))}),r.jsxs("div",{className:`p-4 rounded-md h-fit sticky shadow ${t?"top-0 grid gap-4":"top-[84px] hidden lg:block"}`,children:[c&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex gap-4 items-center",children:[r.jsx(z,{id:"targetBlank",checked:x,onCheckedChange:s=>k(!!s),className:"cursor-pointer size-5"}),r.jsx(S,{htmlFor:"targetBlank",children:p})]}),r.jsxs("div",{className:"flex gap-4 items-center",children:[r.jsx(z,{id:"visible",checked:y,onCheckedChange:s=>P(!!s),className:"cursor-pointer size-5"}),r.jsx(S,{htmlFor:"visible",children:n})]})]}),r.jsxs(E,{variant:"green",type:"submit",className:"w-fit",disabled:h||m||e.props.view||B(),children:[(h||m)&&r.jsx(T,{className:"h-4 w-4 animate-spin"}),e.props.btnSave.title]})]})]})})]})};export{_ as LabelRenderer,ie as LazyField,ge as default};
@@ -0,0 +1 @@
1
+ import{j as r}from"./app.js";import{A as o}from"./app-layout-BarrICdq.js";import t from"./add-group-form-BkXmTsXF.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./monaco-ICtx6xoc.js";import"./handsontable-PVakPtJV.js";import"./app-shell-CggZrBz6.js";import"./app-sidebar-CiyLPsHp.js";import"./nav-main-CZa4xkP1.js";import"./material-icon-DwkE6wKL.js";import"./app-sidebar-header-pfquDpHT.js";import"./breadcrumbs-BS5uXMaM.js";import"./nav-user-e1Cj0abB.js";import"./user-info-DrdQBvFb.js";import"./user-menu-content-ePAt_cwK.js";import"./theme-switcher-xFldiRZz.js";import"./icon-DpkedrXG.js";const m=[];function E(){return r.jsx(o,{breadcrumbs:m,children:r.jsx(t,{})})}export{E as default};
@@ -1 +1 @@
1
- import{u as D,X as O,j as e,B as T,W as M,aE as q,L as z,b as x,I as y,g as P,K as S,M as U,N as A,aF as G,O as H}from"./app.js";import{Icon as I}from"./icon-DpkedrXG.js";import{r as h}from"./monaco-ICtx6xoc.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./handsontable-PVakPtJV.js";const E=h.memo(({field:s,disabled:d,value:c,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(P,{id:s.name,className:"cursor-pointer size-5",disabled:d,checked:c,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(S,{children:e.jsxs(U,{children:[e.jsx(A,{onClick:l=>l.preventDefault(),children:e.jsx(I,{iconNode:G,className:"text-primary w-5 h-5 cursor-pointer"})}),e.jsx(H,{align:"center",side:"top",children:e.jsx("p",{children:s.tooltip})})]})})]})]})});function J(){var u,g,j,b,v,f,N,k,C,w,F;const s=D(),{fields:d,groupedTokens:c,users:i}=s.props,{data:n,setData:m,clearErrors:l,post:L,processing:o}=O({...Object.fromEntries(d.map(a=>[a.name,a.value])),...Object.fromEntries(i.map(a=>[a.name,a.value])),...Object.fromEntries(c.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)},[]),B=a=>{a.preventDefault(),L(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:q}),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(z,{className:"h-4 w-4 animate-spin"}),s.props.btnSave.title]})]}),e.jsx("form",{id:"addUserForm",onSubmit:B,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:(g=r("name"))==null?void 0:g.label}),e.jsx(y,{id:(j=r("name"))==null?void 0:j.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:(k=r("description"))==null?void 0:k.name,type:"text",required:!0,tabIndex:1,autoComplete:(C=r("description"))==null?void 0:C.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{J as default};
1
+ import{u as D,X as O,j as e,B as T,W as M,aH as q,L as z,b as x,I as y,g as H,K as P,M as S,N as U,aI as A,O as G}from"./app.js";import{Icon as E}from"./icon-DpkedrXG.js";import{r as h}from"./monaco-ICtx6xoc.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./handsontable-PVakPtJV.js";const I=h.memo(({field:s,disabled:d,value:c,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(H,{id:s.name,className:"cursor-pointer size-5",disabled:d,checked:c,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(P,{children:e.jsxs(S,{children:[e.jsx(U,{onClick:l=>l.preventDefault(),children:e.jsx(E,{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 J(){var u,g,j,b,v,f,N,k,C,w,F;const s=D(),{fields:d,groupedTokens:c,users:i}=s.props,{data:n,setData:m,clearErrors:l,post:L,processing:o}=O({...Object.fromEntries(d.map(a=>[a.name,a.value])),...Object.fromEntries(i.map(a=>[a.name,a.value])),...Object.fromEntries(c.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)},[]),B=a=>{a.preventDefault(),L(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(E,{iconNode:q}),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(z,{className:"h-4 w-4 animate-spin"}),s.props.btnSave.title]})]}),e.jsx("form",{id:"addUserForm",onSubmit:B,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:(g=r("name"))==null?void 0:g.label}),e.jsx(y,{id:(j=r("name"))==null?void 0:j.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:(k=r("description"))==null?void 0:k.name,type:"text",required:!0,tabIndex:1,autoComplete:(C=r("description"))==null?void 0:C.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(I,{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(I,{field:t,disabled:o||s.props.view,value:n[t.name],onCheckedChange:p,tooltip:!0},t.name))]},a.header))})]})})]})}export{J as default};
@@ -0,0 +1 @@
1
+ import{j as r}from"./app.js";import{A as o}from"./app-layout-BarrICdq.js";import t from"./add-user-form-CeLtuCJN.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./monaco-ICtx6xoc.js";import"./handsontable-PVakPtJV.js";import"./app-shell-CggZrBz6.js";import"./app-sidebar-CiyLPsHp.js";import"./nav-main-CZa4xkP1.js";import"./material-icon-DwkE6wKL.js";import"./app-sidebar-header-pfquDpHT.js";import"./breadcrumbs-BS5uXMaM.js";import"./nav-user-e1Cj0abB.js";import"./user-info-DrdQBvFb.js";import"./user-menu-content-ePAt_cwK.js";import"./theme-switcher-xFldiRZz.js";import"./icon-DpkedrXG.js";import"./input-error-CmXZF6xy.js";const m=[];function F(){return r.jsx(o,{breadcrumbs:m,children:r.jsx(t,{})})}export{F as default};
@@ -1 +1 @@
1
- import{u as he,X as ue,j as e,B as c,W as G,aE as ge,L as je,b as o,I as n,S as J,c as Q,d as Y,e as Z,f as ee,g as m,K as fe,M as ve,N as be,aF as we,O as Ne,h as Ce}from"./app.js";import{Icon as se}from"./icon-DpkedrXG.js";import{r as ae}from"./monaco-ICtx6xoc.js";import Pe from"./input-error-CmXZF6xy.js";import Fe from"./material-icon-DwkE6wKL.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./handsontable-PVakPtJV.js";function Ae(){var p,x,h,u,g,j,f,v,b,w,N,C,P,F,k,z,y,I,U,E,S,T,A,L,q,V,B,D,M,O,H,K,R,W,X,_,$;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(G,{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:(F=a("timezone"))==null?void 0:F.label}),e.jsxs(J,{onValueChange:s=>d("timezone",s),defaultValue:r.timezone,disabled:i||l.props.view,children:[e.jsx(Q,{className:"w-full cursor-pointer",children:e.jsx(Y,{placeholder:(k=a("timezone"))==null?void 0:k.name})}),e.jsx(Z,{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:(E=a("isAdmin"))==null?void 0:E.label}),e.jsx(m,{id:(S=a("isAdmin"))==null?void 0:S.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:(L=a("isConfirmed"))==null?void 0:L.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:(q=a("locale"))==null?void 0:q.name,children:(V=a("locale"))==null?void 0:V.label}),e.jsxs(J,{onValueChange:s=>d("locale",s),defaultValue:r.locale,disabled:i||l.props.view,children:[e.jsx(Q,{className:"w-full cursor-pointer",children:e.jsx(Y,{placeholder:(B=a("locale"))==null?void 0:B.name})}),e.jsx(Z,{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(G,{href:l.props.userPretend.postLink,method:"post",data:{login:r.login,pretend:!0},children:[e.jsx(Fe,{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:(D=a("userPassword"))==null?void 0:D.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:(O=a("userPassword"))==null?void 0:O.name,children:(H=a("userPassword"))==null?void 0:H.label}),e.jsx(n,{id:(K=a("userPassword"))==null?void 0:K.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:(R=a("userPassword"))==null?void 0:R.label})]}),e.jsxs("div",{className:"grid gap-4 col-span-1 col-start-1",children:[e.jsx(o,{htmlFor:(W=a("repeatUserPassword"))==null?void 0:W.name,children:(X=a("repeatUserPassword"))==null?void 0:X.label}),e.jsx(n,{id:(_=a("repeatUserPassword"))==null?void 0:_.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:($=a("repeatUserPassword"))==null?void 0:$.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};
1
+ import{u as he,X as ue,j as e,B as c,W as G,aH as ge,L as je,b as o,I as n,S as J,c as Q,d as Y,e as Z,f as ee,g as m,K as fe,M as ve,N as be,aI as we,O as Ne,h as Ce}from"./app.js";import{Icon as se}from"./icon-DpkedrXG.js";import{r as ae}from"./monaco-ICtx6xoc.js";import Pe from"./input-error-CmXZF6xy.js";import ke from"./material-icon-DwkE6wKL.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./handsontable-PVakPtJV.js";function Ae(){var p,x,h,u,g,j,f,v,b,w,N,C,P,k,F,z,y,I,U,E,S,T,A,L,q,V,B,D,M,O,H,K,R,W,X,_,$;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(G,{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(J,{onValueChange:s=>d("timezone",s),defaultValue:r.timezone,disabled:i||l.props.view,children:[e.jsx(Q,{className:"w-full cursor-pointer",children:e.jsx(Y,{placeholder:(F=a("timezone"))==null?void 0:F.name})}),e.jsx(Z,{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:(E=a("isAdmin"))==null?void 0:E.label}),e.jsx(m,{id:(S=a("isAdmin"))==null?void 0:S.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:(L=a("isConfirmed"))==null?void 0:L.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:(q=a("locale"))==null?void 0:q.name,children:(V=a("locale"))==null?void 0:V.label}),e.jsxs(J,{onValueChange:s=>d("locale",s),defaultValue:r.locale,disabled:i||l.props.view,children:[e.jsx(Q,{className:"w-full cursor-pointer",children:e.jsx(Y,{placeholder:(B=a("locale"))==null?void 0:B.name})}),e.jsx(Z,{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(G,{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:(D=a("userPassword"))==null?void 0:D.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:(O=a("userPassword"))==null?void 0:O.name,children:(H=a("userPassword"))==null?void 0:H.label}),e.jsx(n,{id:(K=a("userPassword"))==null?void 0:K.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:(R=a("userPassword"))==null?void 0:R.label})]}),e.jsxs("div",{className:"grid gap-4 col-span-1 col-start-1",children:[e.jsx(o,{htmlFor:(W=a("repeatUserPassword"))==null?void 0:W.name,children:(X=a("repeatUserPassword"))==null?void 0:X.label}),e.jsx(n,{id:(_=a("repeatUserPassword"))==null?void 0:_.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:($=a("repeatUserPassword"))==null?void 0:$.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};