adminizer 4.1.0-build.7 → 4.1.0-build.9

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 (101) hide show
  1. package/assets/{VanillaJSONEditor-FUe77pIA.js → VanillaJSONEditor-BGC0iJ01.js} +1 -1
  2. package/assets/add-EOP63mij.js +1 -0
  3. package/assets/{add-form-CYOfr0Ef.js → add-form-DofA75xF.js} +1 -1
  4. package/assets/add-group-CbKcu8bN.js +1 -0
  5. package/assets/{add-group-form-dzadPSfL.js → add-group-form-BUM07NJS.js} +1 -1
  6. package/assets/add-user-FQ_0_L3C.js +1 -0
  7. package/assets/{add-user-form-WHaw00sy.js → add-user-form-D1f_2noB.js} +1 -1
  8. package/assets/{app-DMmad2-f.css → app-DB4X6jGk.css} +1 -1
  9. package/assets/{app-layout-D1m9Kvxq.js → app-layout-YPlKN2l5.js} +1 -1
  10. package/assets/{app-shell-BWMRMkHM.js → app-shell-D6Uf68EA.js} +1 -1
  11. package/assets/{app-sidebar-header-DLAFi13E.js → app-sidebar-header-BTKq0Dr0.js} +1 -1
  12. package/assets/{app-sidebar-BCtaEFGb.js → app-sidebar-mh83eSsH.js} +1 -1
  13. package/assets/app.js +14 -14
  14. package/assets/{breadcrumbs-CQNon4Vl.js → breadcrumbs-B4LOvzuL.js} +1 -1
  15. package/assets/{button-CQ9t1kLz.js → button-CTOOfwvn.js} +1 -1
  16. package/assets/checkbox-D9ub-v0l.js +1 -0
  17. package/assets/dashboard-BiLSHuF2.js +1 -0
  18. package/assets/{date-picker-B__dVVqj.js → date-picker-DdGpxs8q.js} +1 -1
  19. package/assets/{dropdown-menu-SEBnEIiL.js → dropdown-menu-CsGmdVIn.js} +1 -1
  20. package/assets/{field-renderer-CapylJU9.js → field-renderer-Q3ajtfjk.js} +3 -3
  21. package/assets/form-D2gvtdQt.js +1 -0
  22. package/assets/{form-lOKv4Qbw.js → form-EPWwr8yD.js} +1 -1
  23. package/assets/{geo-json-CwteYDGB.js → geo-json-CFYMCghL.js} +1 -1
  24. package/assets/{home-BvoB5g29.js → home-Co9WBSjN.js} +2 -2
  25. package/assets/{index-BbXEMx9n.js → index-C5OL14ES.js} +1 -1
  26. package/assets/{index-DTRTjOmh.js → index-CGjCQBqR.js} +1 -1
  27. package/assets/{index-BcE9FUM6.js → index-Cb_qrizV.js} +1 -1
  28. package/assets/{index-K81GbF6O.js → index-DEzdKGnS.js} +1 -1
  29. package/assets/index-DUXJYtOc.js +1 -0
  30. package/assets/index-Dllsp4Rk.js +1 -0
  31. package/assets/{index-C0SL3SHw.js → index-DnbQEoxZ.js} +1 -1
  32. package/assets/{index-BC0yfOHo.js → index-Mx04mBJl.js} +1 -1
  33. package/assets/{index-DEk3sC8d.js → index-m5itSoCR.js} +1 -1
  34. package/assets/{init-user-D9mW-g14.js → init-user-CotD_o5_.js} +1 -1
  35. package/assets/{label-Z506NKsW.js → label-C2tlefOv.js} +1 -1
  36. package/assets/list-BrJBbAVm.js +1 -0
  37. package/assets/{list-table-DB1sEQLF.js → list-table-Cz8Wgfsa.js} +5 -5
  38. package/assets/{login-DrGaTWhY.js → login-B7br6gt5.js} +1 -1
  39. package/assets/manifest.json +458 -458
  40. package/assets/module-BA_EenoK.js +1 -0
  41. package/assets/{multi-select-oabtVhUP.js → multi-select-CDlcaNFy.js} +1 -1
  42. package/assets/{nav-footer-CM-yHiRs.js → nav-footer-CXKG3O4K.js} +1 -1
  43. package/assets/{nav-main-Q3xofGRT.js → nav-main-ByHRr3yf.js} +1 -1
  44. package/assets/{nav-user-Ds8i0Pa2.js → nav-user-BVRKiqm-.js} +1 -1
  45. package/assets/{pagination-render-B57pOpFy.js → pagination-render-CihJ7J2u.js} +1 -1
  46. package/assets/{popover-I249Gg2O.js → popover-_WN_Lj46.js} +1 -1
  47. package/assets/{register-C9FQIDtS.js → register-CpRFo88B.js} +1 -1
  48. package/assets/{select-D1N8zRPY.js → select-DYffGc49.js} +1 -1
  49. package/assets/{sidebar-4D-sX2l4.js → sidebar-B9HagQ6H.js} +1 -1
  50. package/assets/{toast-editor-FbrFd1ft.js → toast-editor-ZLOtXFu5.js} +82 -82
  51. package/assets/{tooltip-D2ehgLlB.js → tooltip-CWVAD5oF.js} +1 -1
  52. package/assets/{user-info-DBYoAJYJ.js → user-info-DA4KTAOF.js} +1 -1
  53. package/assets/{user-menu-content-qkvdkUVd.js → user-menu-content-Biwi4u9j.js} +1 -1
  54. package/assets/welcome-C1kRbbWq.js +1 -0
  55. package/controllers/addGroup.js +0 -2
  56. package/controllers/addUser.js +0 -2
  57. package/controllers/catalog/FrontentCatalogAdapter.js +0 -1
  58. package/controllers/ckeditorUpload.js +0 -1
  59. package/controllers/edit.js +0 -1
  60. package/controllers/editGroup.js +0 -2
  61. package/controllers/editUser.js +0 -1
  62. package/controllers/form.js +0 -1
  63. package/controllers/list.js +2 -2
  64. package/controllers/media-manager/mediaManagerAdapter.js +1 -2
  65. package/controllers/register.js +0 -2
  66. package/helpers/fieldsHelper.d.ts +1 -1
  67. package/index.d.ts +6 -0
  68. package/index.js +6 -0
  69. package/lib/Adminizer.js +0 -1
  70. package/lib/catalog/AbstractCatalog.js +0 -1
  71. package/lib/datatable/NodeTable.js +0 -3
  72. package/lib/inertia/inertiaAdapter.js +0 -1
  73. package/lib/media-manager/AbstractMediaManager.d.ts +2 -2
  74. package/lib/media-manager/AbstractMediaManager.js +1 -1
  75. package/lib/v4/DataAccessor.js +1 -1
  76. package/lib/v4/POWCaptcha.js +0 -1
  77. package/lib/v4/PolicyManager.js +0 -1
  78. package/lib/v4/model/AbstractModel.js +0 -2
  79. package/lib/v4/model/ModelHandler.js +0 -1
  80. package/lib/v4/model/adapter/sequelize.d.ts +3 -2
  81. package/lib/v4/model/adapter/sequelize.js +250 -58
  82. package/lib/v4/model/adapter/waterline.js +0 -1
  83. package/models/GroupAP.d.ts +8 -0
  84. package/models/MediaManagerAP.d.ts +16 -0
  85. package/models/MediaManagerAssociationsAP.d.ts +10 -0
  86. package/models/MediaManagerMetaAP.d.ts +8 -0
  87. package/models/NavigationAP.d.ts +5 -0
  88. package/models/UserAP.d.ts +19 -0
  89. package/package.json +1 -1
  90. package/system/bindInertia.js +1 -1
  91. package/assets/add-ZITr43GJ.js +0 -1
  92. package/assets/add-group-B332wN8K.js +0 -1
  93. package/assets/add-user-BHsqgOim.js +0 -1
  94. package/assets/checkbox-W0nGAXIj.js +0 -1
  95. package/assets/dashboard-BR602KhL.js +0 -1
  96. package/assets/form-DOUNk3o2.js +0 -1
  97. package/assets/index-Cdb9ACvz.js +0 -1
  98. package/assets/index-DrWfGwtf.js +0 -1
  99. package/assets/list-Qyd7ecQH.js +0 -1
  100. package/assets/module-DBaykv8l.js +0 -1
  101. package/assets/welcome-D2adQ8EU.js +0 -1
@@ -0,0 +1 @@
1
+ import{j as t}from"./app.js";import{c as m}from"./compiler-runtime-tM4jBQ-T.js";import{A as i}from"./app-layout-YPlKN2l5.js";import p from"./add-form-DofA75xF.js";import"./sidebar-B9HagQ6H.js";import"./index-DUXJYtOc.js";import"./button-CTOOfwvn.js";import"./utils-DjqsqOe8.js";import"./index-CGjCQBqR.js";import"./createLucideIcon-BFG25zNo.js";import"./index-Dllsp4Rk.js";import"./index-D5ir9iUV.js";import"./index-DEzdKGnS.js";import"./index-DnbQEoxZ.js";import"./index-Mx04mBJl.js";import"./tooltip-CWVAD5oF.js";import"./index-Cb_qrizV.js";import"./app-shell-D6Uf68EA.js";import"./app-sidebar-mh83eSsH.js";import"./nav-main-ByHRr3yf.js";import"./material-icon-CItZiB53.js";import"./chevron-right-D5q8rF7h.js";import"./index-C5OL14ES.js";import"./index-m5itSoCR.js";import"./chevrons-up-down-kALltqHV.js";import"./app-sidebar-header-BTKq0Dr0.js";import"./breadcrumbs-B4LOvzuL.js";import"./nav-user-BVRKiqm-.js";import"./dropdown-menu-CsGmdVIn.js";import"./user-info-DA4KTAOF.js";import"./user-menu-content-Biwi4u9j.js";import"./icon-Bz9BMaD0.js";import"./use-appearance-Co6mO0dV.js";import"./label-C2tlefOv.js";import"./field-renderer-Q3ajtfjk.js";import"./checkbox-D9ub-v0l.js";import"./index-DwctwfU0.js";import"./check-LAUWAnlX.js";import"./select-DYffGc49.js";import"./chevron-down-B5XuAFRu.js";import"./dynamic-controls-CSVVCONh.js";import"./input-DF7Ue23C.js";import"./multi-select-CDlcaNFy.js";import"./popover-_WN_Lj46.js";import"./search-BspystAk.js";import"./form-state-702tb_BV.js";import"./input-error-BBygona6.js";import"./move-left-BhKZRPb4.js";import"./loader-circle-Utah5tGx.js";const e=[];function to(){const r=m.c(1);let o;return r[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(i,{breadcrumbs:e,children:t.jsx(p,{})}),r[0]=o):o=r[0],o}export{to as default};
@@ -1 +1 @@
1
- import{j as r,r as u,q as O,S as V,J as z}from"./app.js";import{c as E}from"./compiler-runtime-tM4jBQ-T.js";import{B as y}from"./button-CQ9t1kLz.js";import{Icon as A}from"./icon-Bz9BMaD0.js";import{L as D}from"./label-Z506NKsW.js";import{T as J,a as U,b as q,c as P}from"./tooltip-D2ehgLlB.js";import B from"./field-renderer-CapylJU9.js";import{c as W}from"./utils-DjqsqOe8.js";import{r as $,h as C,g as I}from"./form-state-702tb_BV.js";import T from"./input-error-BBygona6.js";import{I as G,M as H}from"./move-left-BhKZRPb4.js";import{L}from"./loader-circle-Utah5tGx.js";import"./index-DrWfGwtf.js";import"./index-K81GbF6O.js";import"./index-Cdb9ACvz.js";import"./index-D5ir9iUV.js";import"./index-BC0yfOHo.js";import"./index-BcE9FUM6.js";import"./checkbox-W0nGAXIj.js";import"./index-DwctwfU0.js";import"./check-LAUWAnlX.js";import"./createLucideIcon-BFG25zNo.js";import"./select-D1N8zRPY.js";import"./index-BbXEMx9n.js";import"./index-C0SL3SHw.js";import"./chevron-down-B5XuAFRu.js";import"./dynamic-controls-CSVVCONh.js";import"./input-DF7Ue23C.js";import"./multi-select-oabtVhUP.js";import"./popover-I249Gg2O.js";import"./index-DTRTjOmh.js";import"./search-BspystAk.js";function K(t){const e=E.c(8);let s,n;e[0]!==t?({className:s,...n}=t,e[0]=t,e[1]=s,e[2]=n):(s=e[1],n=e[2]);let a;e[3]!==s?(a=W("bg-accent animate-pulse rounded-md",s),e[3]=s,e[4]=a):a=e[4];let i;return e[5]!==n||e[6]!==a?(i=r.jsx("div",{"data-slot":"skeleton",className:a,...n}),e[5]=n,e[6]=a,e[7]=i):i=e[7],i}var N=new Map,v=new WeakMap,k=0,Q=void 0;function X(t){return t?(v.has(t)||(k+=1,v.set(t,k.toString())),v.get(t)):"0"}function Y(t){return Object.keys(t).sort().filter(e=>t[e]!==void 0).map(e=>`${e}_${e==="root"?X(t.root):t[e]}`).toString()}function Z(t){const e=Y(t);let s=N.get(e);if(!s){const n=new Map;let a;const i=new IntersectionObserver(c=>{c.forEach(p=>{var l;const m=p.isIntersecting&&a.some(d=>p.intersectionRatio>=d);t.trackVisibility&&typeof p.isVisible>"u"&&(p.isVisible=m),(l=n.get(p.target))==null||l.forEach(d=>{d(m,p)})})},t);a=i.thresholds||(Array.isArray(t.threshold)?t.threshold:[t.threshold||0]),s={id:e,observer:i,elements:n},N.set(e,s)}return s}function _(t,e,s={},n=Q){if(typeof window.IntersectionObserver>"u"&&n!==void 0){const l=t.getBoundingClientRect();return e(n,{isIntersecting:n,target:t,intersectionRatio:typeof s.threshold=="number"?s.threshold:0,time:0,boundingClientRect:l,intersectionRect:l,rootBounds:l}),()=>{}}const{id:a,observer:i,elements:c}=Z(s),p=c.get(t)||[];return c.has(t)||c.set(t,p),p.push(e),i.observe(t),function(){p.splice(p.indexOf(e),1),p.length===0&&(c.delete(t),i.unobserve(t)),c.size===0&&(i.disconnect(),N.delete(a))}}function ee({threshold:t,delay:e,trackVisibility:s,rootMargin:n,root:a,triggerOnce:i,skip:c,initialInView:p,fallbackInView:l,onChange:m}={}){var d;const[o,f]=u.useState(null),x=u.useRef(m),[b,F]=u.useState({inView:!!p,entry:void 0});x.current=m,u.useEffect(()=>{if(c||!o)return;let g;return g=_(o,(S,w)=>{F({inView:S,entry:w}),x.current&&x.current(S,w),w.isIntersecting&&i&&g&&(g(),g=void 0)},{root:a,rootMargin:n,threshold:t,trackVisibility:s,delay:e},l),()=>{g&&g()}},[Array.isArray(t)?t.toString():t,o,a,n,i,c,s,l,e]);const j=(d=b.entry)==null?void 0:d.target,R=u.useRef(void 0);!o&&j&&!i&&!c&&R.current!==j&&(R.current=j,F({inView:!!p,entry:void 0}));const h=[f,b.inView,b.entry];return h.ref=h[0],h.inView=h[1],h.entry=h[2],h}const M=u.memo(t=>{const e=E.c(8),{field:s}=t,n=`${s.type}-${s.name}`;let a;e[0]!==s.label||e[1]!==n?(a=r.jsx(D,{htmlFor:n,children:s.label}),e[0]=s.label,e[1]=n,e[2]=a):a=e[2];let i;e[3]!==s.tooltip?(i=s.tooltip&&r.jsx(J,{children:r.jsxs(U,{children:[r.jsx(q,{onClick:re,children:r.jsx(A,{iconNode:G,className:"text-primary w-5 h-5 cursor-pointer"})}),r.jsx(P,{align:"center",side:"top",className:"z-[1002]",children:r.jsx("p",{children:s.tooltip})})]})}),e[3]=s.tooltip,e[4]=i):i=e[4];let c;return e[5]!==a||e[6]!==i?(c=r.jsxs("div",{className:"flex gap-3",children:[a,i]}),e[5]=a,e[6]=i,e[7]=c):c=e[7],c}),te=u.memo(t=>{const e=E.c(12),{field:s,value:n,onChange:a,processing:i,notFound:c,search:p}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={triggerOnce:!0,rootMargin:"100px 0px"},e[0]=l):l=e[0];const[m,d]=ee(l);let o;e[1]!==s||e[2]!==d||e[3]!==c||e[4]!==a||e[5]!==i||e[6]!==p||e[7]!==n?(o=d?r.jsx(B,{field:s,value:n,onChange:a,notFound:c,search:p,processing:i}):r.jsx(K,{className:"w-full h-[250px] rounded-sm"}),e[1]=s,e[2]=d,e[3]=c,e[4]=a,e[5]=i,e[6]=p,e[7]=n,e[8]=o):o=e[8];let f;return e[9]!==m||e[10]!==o?(f=r.jsx("div",{ref:m,className:"grid gap-4 w-full",children:o}),e[9]=m,e[10]=o,e[11]=f):f=e[11],f}),Ae=()=>{const t=O(),{fields:e,btnBack:s,view:n,notFound:a}=t.props,{data:i,setData:c,post:p,processing:l}=V(Object.fromEntries(e.map(o=>[o.name,o.value??void 0])));u.useEffect(()=>($(),()=>{$()}),[]);const m=u.useCallback((o,f)=>{c(o,f)},[]),d=o=>{o.preventDefault(),p(t.props.postLink)};return r.jsxs("div",{className:"p-4 w-full",children:[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(y,{className:"w-fit",asChild:!0,children:r.jsxs(z,{href:s.link,preserveScroll:!0,children:[r.jsx(A,{iconNode:H}),s.title]})}),r.jsxs(y,{variant:"green",type:"submit",className:"w-fit cursor-pointer lg:hidden",form:"addUserForm",disabled:l||t.props.view||C(),children:[l&&r.jsx(L,{className:"h-4 w-4 animate-spin"}),t.props.btnSave.title]})]}),r.jsx("form",{id:"addUserForm",onSubmit:d,className:n?"cursor-not-allowed":"",children:r.jsxs("div",{className:"grid lg:grid-cols-[1fr_150px] gap-4 max-w-[1144px] pb-8",children:[r.jsx("div",{className:"flex flex-col gap-10",children:e.map(o=>r.jsx("div",{className:`grid gap-4 w-full ${n?"pointer-events-none":""}`,children:o.type==="markdown"||o.type==="table"||o.type==="jsonEditor"||o.type==="codeEditor"||o.type==="geoJson"?r.jsxs(r.Fragment,{children:[r.jsx(M,{field:o}),r.jsx(T,{message:I(`${o.type}-${o.name}`)}),r.jsx(te,{field:o,value:i[o.name],onChange:m,processing:l||n,notFound:a,search:t.props.search})]}):r.jsxs(r.Fragment,{children:[r.jsx(M,{field:o}),r.jsx(T,{message:I(`${o.type}-${o.name}`)}),r.jsx(B,{field:o,value:i[o.name],onChange:m,processing:l||n,notFound:a,search:t.props.search})]})},o.name))}),r.jsx("div",{className:"p-4 rounded-md h-fit sticky top-[84px] shadow hidden lg:block",children:r.jsxs(y,{variant:"green",type:"submit",className:"w-fit cursor-pointer",disabled:l||t.props.view||C(),children:[l&&r.jsx(L,{className:"h-4 w-4 animate-spin"}),t.props.btnSave.title]})})]})})]})};function re(t){return t.preventDefault()}export{M as LabelRenderer,te as LazyField,Ae as default};
1
+ import{j as r,r as u,q as O,S as V,J as z}from"./app.js";import{c as E}from"./compiler-runtime-tM4jBQ-T.js";import{B as y}from"./button-CTOOfwvn.js";import{Icon as A}from"./icon-Bz9BMaD0.js";import{L as D}from"./label-C2tlefOv.js";import{T as J,a as U,b as q,c as P}from"./tooltip-CWVAD5oF.js";import B from"./field-renderer-Q3ajtfjk.js";import{c as W}from"./utils-DjqsqOe8.js";import{r as $,h as C,g as I}from"./form-state-702tb_BV.js";import T from"./input-error-BBygona6.js";import{I as G,M as H}from"./move-left-BhKZRPb4.js";import{L}from"./loader-circle-Utah5tGx.js";import"./index-DUXJYtOc.js";import"./index-DEzdKGnS.js";import"./index-Dllsp4Rk.js";import"./index-D5ir9iUV.js";import"./index-Mx04mBJl.js";import"./index-Cb_qrizV.js";import"./checkbox-D9ub-v0l.js";import"./index-DwctwfU0.js";import"./check-LAUWAnlX.js";import"./createLucideIcon-BFG25zNo.js";import"./select-DYffGc49.js";import"./index-C5OL14ES.js";import"./index-DnbQEoxZ.js";import"./chevron-down-B5XuAFRu.js";import"./dynamic-controls-CSVVCONh.js";import"./input-DF7Ue23C.js";import"./multi-select-CDlcaNFy.js";import"./popover-_WN_Lj46.js";import"./index-CGjCQBqR.js";import"./search-BspystAk.js";function K(t){const e=E.c(8);let s,n;e[0]!==t?({className:s,...n}=t,e[0]=t,e[1]=s,e[2]=n):(s=e[1],n=e[2]);let a;e[3]!==s?(a=W("bg-accent animate-pulse rounded-md",s),e[3]=s,e[4]=a):a=e[4];let i;return e[5]!==n||e[6]!==a?(i=r.jsx("div",{"data-slot":"skeleton",className:a,...n}),e[5]=n,e[6]=a,e[7]=i):i=e[7],i}var N=new Map,v=new WeakMap,k=0,Q=void 0;function X(t){return t?(v.has(t)||(k+=1,v.set(t,k.toString())),v.get(t)):"0"}function Y(t){return Object.keys(t).sort().filter(e=>t[e]!==void 0).map(e=>`${e}_${e==="root"?X(t.root):t[e]}`).toString()}function Z(t){const e=Y(t);let s=N.get(e);if(!s){const n=new Map;let a;const i=new IntersectionObserver(c=>{c.forEach(p=>{var l;const m=p.isIntersecting&&a.some(d=>p.intersectionRatio>=d);t.trackVisibility&&typeof p.isVisible>"u"&&(p.isVisible=m),(l=n.get(p.target))==null||l.forEach(d=>{d(m,p)})})},t);a=i.thresholds||(Array.isArray(t.threshold)?t.threshold:[t.threshold||0]),s={id:e,observer:i,elements:n},N.set(e,s)}return s}function _(t,e,s={},n=Q){if(typeof window.IntersectionObserver>"u"&&n!==void 0){const l=t.getBoundingClientRect();return e(n,{isIntersecting:n,target:t,intersectionRatio:typeof s.threshold=="number"?s.threshold:0,time:0,boundingClientRect:l,intersectionRect:l,rootBounds:l}),()=>{}}const{id:a,observer:i,elements:c}=Z(s),p=c.get(t)||[];return c.has(t)||c.set(t,p),p.push(e),i.observe(t),function(){p.splice(p.indexOf(e),1),p.length===0&&(c.delete(t),i.unobserve(t)),c.size===0&&(i.disconnect(),N.delete(a))}}function ee({threshold:t,delay:e,trackVisibility:s,rootMargin:n,root:a,triggerOnce:i,skip:c,initialInView:p,fallbackInView:l,onChange:m}={}){var d;const[o,f]=u.useState(null),x=u.useRef(m),[b,F]=u.useState({inView:!!p,entry:void 0});x.current=m,u.useEffect(()=>{if(c||!o)return;let g;return g=_(o,(S,w)=>{F({inView:S,entry:w}),x.current&&x.current(S,w),w.isIntersecting&&i&&g&&(g(),g=void 0)},{root:a,rootMargin:n,threshold:t,trackVisibility:s,delay:e},l),()=>{g&&g()}},[Array.isArray(t)?t.toString():t,o,a,n,i,c,s,l,e]);const j=(d=b.entry)==null?void 0:d.target,R=u.useRef(void 0);!o&&j&&!i&&!c&&R.current!==j&&(R.current=j,F({inView:!!p,entry:void 0}));const h=[f,b.inView,b.entry];return h.ref=h[0],h.inView=h[1],h.entry=h[2],h}const M=u.memo(t=>{const e=E.c(8),{field:s}=t,n=`${s.type}-${s.name}`;let a;e[0]!==s.label||e[1]!==n?(a=r.jsx(D,{htmlFor:n,children:s.label}),e[0]=s.label,e[1]=n,e[2]=a):a=e[2];let i;e[3]!==s.tooltip?(i=s.tooltip&&r.jsx(J,{children:r.jsxs(U,{children:[r.jsx(q,{onClick:re,children:r.jsx(A,{iconNode:G,className:"text-primary w-5 h-5 cursor-pointer"})}),r.jsx(P,{align:"center",side:"top",className:"z-[1002]",children:r.jsx("p",{children:s.tooltip})})]})}),e[3]=s.tooltip,e[4]=i):i=e[4];let c;return e[5]!==a||e[6]!==i?(c=r.jsxs("div",{className:"flex gap-3",children:[a,i]}),e[5]=a,e[6]=i,e[7]=c):c=e[7],c}),te=u.memo(t=>{const e=E.c(12),{field:s,value:n,onChange:a,processing:i,notFound:c,search:p}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={triggerOnce:!0,rootMargin:"100px 0px"},e[0]=l):l=e[0];const[m,d]=ee(l);let o;e[1]!==s||e[2]!==d||e[3]!==c||e[4]!==a||e[5]!==i||e[6]!==p||e[7]!==n?(o=d?r.jsx(B,{field:s,value:n,onChange:a,notFound:c,search:p,processing:i}):r.jsx(K,{className:"w-full h-[250px] rounded-sm"}),e[1]=s,e[2]=d,e[3]=c,e[4]=a,e[5]=i,e[6]=p,e[7]=n,e[8]=o):o=e[8];let f;return e[9]!==m||e[10]!==o?(f=r.jsx("div",{ref:m,className:"grid gap-4 w-full",children:o}),e[9]=m,e[10]=o,e[11]=f):f=e[11],f}),Ae=()=>{const t=O(),{fields:e,btnBack:s,view:n,notFound:a}=t.props,{data:i,setData:c,post:p,processing:l}=V(Object.fromEntries(e.map(o=>[o.name,o.value??void 0])));u.useEffect(()=>($(),()=>{$()}),[]);const m=u.useCallback((o,f)=>{c(o,f)},[]),d=o=>{o.preventDefault(),p(t.props.postLink)};return r.jsxs("div",{className:"p-4 w-full",children:[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(y,{className:"w-fit",asChild:!0,children:r.jsxs(z,{href:s.link,preserveScroll:!0,children:[r.jsx(A,{iconNode:H}),s.title]})}),r.jsxs(y,{variant:"green",type:"submit",className:"w-fit cursor-pointer lg:hidden",form:"addUserForm",disabled:l||t.props.view||C(),children:[l&&r.jsx(L,{className:"h-4 w-4 animate-spin"}),t.props.btnSave.title]})]}),r.jsx("form",{id:"addUserForm",onSubmit:d,className:n?"cursor-not-allowed":"",children:r.jsxs("div",{className:"grid lg:grid-cols-[1fr_150px] gap-4 max-w-[1144px] pb-8",children:[r.jsx("div",{className:"flex flex-col gap-10",children:e.map(o=>r.jsx("div",{className:`grid gap-4 w-full ${n?"pointer-events-none":""}`,children:o.type==="markdown"||o.type==="table"||o.type==="jsonEditor"||o.type==="codeEditor"||o.type==="geoJson"?r.jsxs(r.Fragment,{children:[r.jsx(M,{field:o}),r.jsx(T,{message:I(`${o.type}-${o.name}`)}),r.jsx(te,{field:o,value:i[o.name],onChange:m,processing:l||n,notFound:a,search:t.props.search})]}):r.jsxs(r.Fragment,{children:[r.jsx(M,{field:o}),r.jsx(T,{message:I(`${o.type}-${o.name}`)}),r.jsx(B,{field:o,value:i[o.name],onChange:m,processing:l||n,notFound:a,search:t.props.search})]})},o.name))}),r.jsx("div",{className:"p-4 rounded-md h-fit sticky top-[84px] shadow hidden lg:block",children:r.jsxs(y,{variant:"green",type:"submit",className:"w-fit cursor-pointer",disabled:l||t.props.view||C(),children:[l&&r.jsx(L,{className:"h-4 w-4 animate-spin"}),t.props.btnSave.title]})})]})})]})};function re(t){return t.preventDefault()}export{M as LabelRenderer,te as LazyField,Ae as default};
@@ -0,0 +1 @@
1
+ import{j as t}from"./app.js";import{c as m}from"./compiler-runtime-tM4jBQ-T.js";import{A as p}from"./app-layout-YPlKN2l5.js";import i from"./add-group-form-BUM07NJS.js";import"./sidebar-B9HagQ6H.js";import"./index-DUXJYtOc.js";import"./button-CTOOfwvn.js";import"./utils-DjqsqOe8.js";import"./index-CGjCQBqR.js";import"./createLucideIcon-BFG25zNo.js";import"./index-Dllsp4Rk.js";import"./index-D5ir9iUV.js";import"./index-DEzdKGnS.js";import"./index-DnbQEoxZ.js";import"./index-Mx04mBJl.js";import"./tooltip-CWVAD5oF.js";import"./index-Cb_qrizV.js";import"./app-shell-D6Uf68EA.js";import"./app-sidebar-mh83eSsH.js";import"./nav-main-ByHRr3yf.js";import"./material-icon-CItZiB53.js";import"./chevron-right-D5q8rF7h.js";import"./index-C5OL14ES.js";import"./index-m5itSoCR.js";import"./chevrons-up-down-kALltqHV.js";import"./app-sidebar-header-BTKq0Dr0.js";import"./breadcrumbs-B4LOvzuL.js";import"./nav-user-BVRKiqm-.js";import"./dropdown-menu-CsGmdVIn.js";import"./user-info-DA4KTAOF.js";import"./user-menu-content-Biwi4u9j.js";import"./icon-Bz9BMaD0.js";import"./use-appearance-Co6mO0dV.js";import"./label-C2tlefOv.js";import"./input-DF7Ue23C.js";import"./checkbox-D9ub-v0l.js";import"./index-DwctwfU0.js";import"./check-LAUWAnlX.js";import"./move-left-BhKZRPb4.js";import"./loader-circle-Utah5tGx.js";const e=[];function T(){const r=m.c(1);let o;return r[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(p,{breadcrumbs:e,children:t.jsx(i,{})}),r[0]=o):o=r[0],o}export{T as default};
@@ -1 +1 @@
1
- import{q as D,S,r as L,j as s,J as q}from"./app.js";import{c as M}from"./compiler-runtime-tM4jBQ-T.js";import{B as y}from"./button-CQ9t1kLz.js";import{Icon as B}from"./icon-Bz9BMaD0.js";import{L as j}from"./label-Z506NKsW.js";import{I as E}from"./input-DF7Ue23C.js";import{C as O}from"./checkbox-W0nGAXIj.js";import{T as z,a as J,b as R,c as U}from"./tooltip-D2ehgLlB.js";import{M as $,I as A}from"./move-left-BhKZRPb4.js";import{L as G}from"./loader-circle-Utah5tGx.js";import"./index-DrWfGwtf.js";import"./utils-DjqsqOe8.js";import"./index-K81GbF6O.js";import"./index-D5ir9iUV.js";import"./index-Cdb9ACvz.js";import"./index-DwctwfU0.js";import"./index-BC0yfOHo.js";import"./check-LAUWAnlX.js";import"./createLucideIcon-BFG25zNo.js";import"./index-BcE9FUM6.js";const I=L.memo(r=>{const e=M.c(20),{field:t,disabled:h,value:m,onCheckedChange:u,tooltip:f}=r;let x;e[0]!==t.name||e[1]!==u?(x=g=>{u(t.name,g)},e[0]=t.name,e[1]=u,e[2]=x):x=e[2];const i=x;let o;e[3]!==h||e[4]!==t.name||e[5]!==i||e[6]!==m?(o=s.jsx(O,{id:t.name,className:"cursor-pointer size-5",disabled:h,checked:m,onCheckedChange:i}),e[3]=h,e[4]=t.name,e[5]=i,e[6]=m,e[7]=o):o=e[7];let l;e[8]!==t.label||e[9]!==t.name?(l=s.jsx(j,{className:"cursor-pointer",htmlFor:t.name,children:t.label}),e[8]=t.label,e[9]=t.name,e[10]=l):l=e[10];let d;e[11]!==t.tooltip||e[12]!==f?(d=f&&s.jsx(z,{children:s.jsxs(J,{children:[s.jsx(R,{onClick:H,children:s.jsx(B,{iconNode:A,className:"text-primary w-5 h-5 cursor-pointer"})}),s.jsx(U,{align:"center",side:"top",children:s.jsx("p",{children:t.tooltip})})]})}),e[11]=t.tooltip,e[12]=f,e[13]=d):d=e[13];let p;e[14]!==l||e[15]!==d?(p=s.jsxs("div",{className:"flex gap-3",children:[l,d]}),e[14]=l,e[15]=d,e[16]=p):p=e[16];let c;return e[17]!==o||e[18]!==p?(c=s.jsxs("div",{className:"flex gap-3 items-center",children:[o,p]}),e[17]=o,e[18]=p,e[19]=c):c=e[19],c});function de(){var p,c,g,b,v,C,N,k,w,F,T;const r=D(),{fields:e,groupedTokens:t,users:h}=r.props,{data:m,setData:u,clearErrors:f,post:x,processing:i}=S({...Object.fromEntries(e.map(a=>[a.name,a.value])),...Object.fromEntries(h.map(a=>[a.name,a.value])),...Object.fromEntries(t.flatMap(a=>a.fields.map(n=>[n.name,n.value])))}),o=a=>r.props.fields.find(n=>n.name===a),l=L.useCallback((a,n)=>{f(),u(a,n)},[]),d=a=>{a.preventDefault(),x(r.props.postLink)};return s.jsxs("div",{className:"flex h-full flex-1 flex-col gap-4 rounded-xl p-4",children:[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(y,{className:"mb-3 w-fit",asChild:!0,children:s.jsxs(q,{href:r.props.btnBack.link,children:[s.jsx(B,{iconNode:$}),r.props.btnBack.title]})}),s.jsxs(y,{variant:"green",type:"submit",className:"w-fit cursor-pointer",form:"addUserForm",disabled:i||r.props.view,children:[i&&s.jsx(G,{className:"h-4 w-4 animate-spin"}),r.props.btnSave.title]})]}),s.jsx("form",{id:"addUserForm",onSubmit:d,className:`${r.props.view?"cursor-not-allowed":""}`,children:s.jsxs("div",{className:"flex flex-col gap-6 max-w-[1144px]",children:[s.jsx("h2",{className:"font-bold text-xl",children:r.props.head}),s.jsxs("div",{className:"grid gap-4",children:[s.jsx(j,{htmlFor:(p=o("name"))==null?void 0:p.name,children:(c=o("name"))==null?void 0:c.label}),s.jsx(E,{id:(g=o("name"))==null?void 0:g.name,type:"text",required:!0,tabIndex:1,autoComplete:(b=o("name"))==null?void 0:b.name,value:m.name,onChange:a=>l("name",a.target.value),disabled:i||r.props.view,placeholder:(v=o("name"))==null?void 0:v.label})]}),s.jsxs("div",{className:"grid gap-4",children:[s.jsx(j,{htmlFor:(C=o("description"))==null?void 0:C.name,children:(N=o("description"))==null?void 0:N.label}),s.jsx(E,{id:(k=o("description"))==null?void 0:k.name,type:"text",required:!0,tabIndex:1,autoComplete:(w=o("description"))==null?void 0:w.name,value:m.description,onChange:a=>l("description",a.target.value),disabled:i||r.props.view,placeholder:(F=o("description"))==null?void 0:F.label})]}),r.props.users.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"font-bold text-xl",children:r.props.userHead}),r.props.users.map(a=>s.jsx(I,{field:a,disabled:i||r.props.view,value:m[a.name],onCheckedChange:l},a.name))]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 xl:grid-cols-4 gap-4",children:((T=r.props.groupedTokens)==null?void 0:T.length)>0&&r.props.groupedTokens.map(a=>s.jsxs("div",{className:"grid gap-4 content-start justify-between",children:[s.jsx("h2",{className:"font-bold text-xl mt-3",children:a.header}),a.fields.map(n=>s.jsx(I,{field:n,disabled:i||r.props.view,value:m[n.name],onCheckedChange:l,tooltip:!0},n.name))]},a.header))})]})})]})}function H(r){return r.preventDefault()}export{de as default};
1
+ import{q as D,S,r as L,j as s,J as q}from"./app.js";import{c as M}from"./compiler-runtime-tM4jBQ-T.js";import{B as y}from"./button-CTOOfwvn.js";import{Icon as B}from"./icon-Bz9BMaD0.js";import{L as j}from"./label-C2tlefOv.js";import{I as E}from"./input-DF7Ue23C.js";import{C as O}from"./checkbox-D9ub-v0l.js";import{T as z,a as J,b as R,c as U}from"./tooltip-CWVAD5oF.js";import{M as $,I as A}from"./move-left-BhKZRPb4.js";import{L as G}from"./loader-circle-Utah5tGx.js";import"./index-DUXJYtOc.js";import"./utils-DjqsqOe8.js";import"./index-DEzdKGnS.js";import"./index-D5ir9iUV.js";import"./index-Dllsp4Rk.js";import"./index-DwctwfU0.js";import"./index-Mx04mBJl.js";import"./check-LAUWAnlX.js";import"./createLucideIcon-BFG25zNo.js";import"./index-Cb_qrizV.js";const I=L.memo(r=>{const e=M.c(20),{field:t,disabled:h,value:m,onCheckedChange:u,tooltip:f}=r;let x;e[0]!==t.name||e[1]!==u?(x=g=>{u(t.name,g)},e[0]=t.name,e[1]=u,e[2]=x):x=e[2];const i=x;let o;e[3]!==h||e[4]!==t.name||e[5]!==i||e[6]!==m?(o=s.jsx(O,{id:t.name,className:"cursor-pointer size-5",disabled:h,checked:m,onCheckedChange:i}),e[3]=h,e[4]=t.name,e[5]=i,e[6]=m,e[7]=o):o=e[7];let l;e[8]!==t.label||e[9]!==t.name?(l=s.jsx(j,{className:"cursor-pointer",htmlFor:t.name,children:t.label}),e[8]=t.label,e[9]=t.name,e[10]=l):l=e[10];let d;e[11]!==t.tooltip||e[12]!==f?(d=f&&s.jsx(z,{children:s.jsxs(J,{children:[s.jsx(R,{onClick:H,children:s.jsx(B,{iconNode:A,className:"text-primary w-5 h-5 cursor-pointer"})}),s.jsx(U,{align:"center",side:"top",children:s.jsx("p",{children:t.tooltip})})]})}),e[11]=t.tooltip,e[12]=f,e[13]=d):d=e[13];let p;e[14]!==l||e[15]!==d?(p=s.jsxs("div",{className:"flex gap-3",children:[l,d]}),e[14]=l,e[15]=d,e[16]=p):p=e[16];let c;return e[17]!==o||e[18]!==p?(c=s.jsxs("div",{className:"flex gap-3 items-center",children:[o,p]}),e[17]=o,e[18]=p,e[19]=c):c=e[19],c});function de(){var p,c,g,b,v,C,N,k,w,F,T;const r=D(),{fields:e,groupedTokens:t,users:h}=r.props,{data:m,setData:u,clearErrors:f,post:x,processing:i}=S({...Object.fromEntries(e.map(a=>[a.name,a.value])),...Object.fromEntries(h.map(a=>[a.name,a.value])),...Object.fromEntries(t.flatMap(a=>a.fields.map(n=>[n.name,n.value])))}),o=a=>r.props.fields.find(n=>n.name===a),l=L.useCallback((a,n)=>{f(),u(a,n)},[]),d=a=>{a.preventDefault(),x(r.props.postLink)};return s.jsxs("div",{className:"flex h-full flex-1 flex-col gap-4 rounded-xl p-4",children:[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(y,{className:"mb-3 w-fit",asChild:!0,children:s.jsxs(q,{href:r.props.btnBack.link,children:[s.jsx(B,{iconNode:$}),r.props.btnBack.title]})}),s.jsxs(y,{variant:"green",type:"submit",className:"w-fit cursor-pointer",form:"addUserForm",disabled:i||r.props.view,children:[i&&s.jsx(G,{className:"h-4 w-4 animate-spin"}),r.props.btnSave.title]})]}),s.jsx("form",{id:"addUserForm",onSubmit:d,className:`${r.props.view?"cursor-not-allowed":""}`,children:s.jsxs("div",{className:"flex flex-col gap-6 max-w-[1144px]",children:[s.jsx("h2",{className:"font-bold text-xl",children:r.props.head}),s.jsxs("div",{className:"grid gap-4",children:[s.jsx(j,{htmlFor:(p=o("name"))==null?void 0:p.name,children:(c=o("name"))==null?void 0:c.label}),s.jsx(E,{id:(g=o("name"))==null?void 0:g.name,type:"text",required:!0,tabIndex:1,autoComplete:(b=o("name"))==null?void 0:b.name,value:m.name,onChange:a=>l("name",a.target.value),disabled:i||r.props.view,placeholder:(v=o("name"))==null?void 0:v.label})]}),s.jsxs("div",{className:"grid gap-4",children:[s.jsx(j,{htmlFor:(C=o("description"))==null?void 0:C.name,children:(N=o("description"))==null?void 0:N.label}),s.jsx(E,{id:(k=o("description"))==null?void 0:k.name,type:"text",required:!0,tabIndex:1,autoComplete:(w=o("description"))==null?void 0:w.name,value:m.description,onChange:a=>l("description",a.target.value),disabled:i||r.props.view,placeholder:(F=o("description"))==null?void 0:F.label})]}),r.props.users.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"font-bold text-xl",children:r.props.userHead}),r.props.users.map(a=>s.jsx(I,{field:a,disabled:i||r.props.view,value:m[a.name],onCheckedChange:l},a.name))]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 xl:grid-cols-4 gap-4",children:((T=r.props.groupedTokens)==null?void 0:T.length)>0&&r.props.groupedTokens.map(a=>s.jsxs("div",{className:"grid gap-4 content-start justify-between",children:[s.jsx("h2",{className:"font-bold text-xl mt-3",children:a.header}),a.fields.map(n=>s.jsx(I,{field:n,disabled:i||r.props.view,value:m[n.name],onCheckedChange:l,tooltip:!0},n.name))]},a.header))})]})})]})}function H(r){return r.preventDefault()}export{de as default};
@@ -0,0 +1 @@
1
+ import{j as t}from"./app.js";import{c as m}from"./compiler-runtime-tM4jBQ-T.js";import{A as i}from"./app-layout-YPlKN2l5.js";import p from"./add-user-form-D1f_2noB.js";import"./sidebar-B9HagQ6H.js";import"./index-DUXJYtOc.js";import"./button-CTOOfwvn.js";import"./utils-DjqsqOe8.js";import"./index-CGjCQBqR.js";import"./createLucideIcon-BFG25zNo.js";import"./index-Dllsp4Rk.js";import"./index-D5ir9iUV.js";import"./index-DEzdKGnS.js";import"./index-DnbQEoxZ.js";import"./index-Mx04mBJl.js";import"./tooltip-CWVAD5oF.js";import"./index-Cb_qrizV.js";import"./app-shell-D6Uf68EA.js";import"./app-sidebar-mh83eSsH.js";import"./nav-main-ByHRr3yf.js";import"./material-icon-CItZiB53.js";import"./chevron-right-D5q8rF7h.js";import"./index-C5OL14ES.js";import"./index-m5itSoCR.js";import"./chevrons-up-down-kALltqHV.js";import"./app-sidebar-header-BTKq0Dr0.js";import"./breadcrumbs-B4LOvzuL.js";import"./nav-user-BVRKiqm-.js";import"./dropdown-menu-CsGmdVIn.js";import"./user-info-DA4KTAOF.js";import"./user-menu-content-Biwi4u9j.js";import"./icon-Bz9BMaD0.js";import"./use-appearance-Co6mO0dV.js";import"./label-C2tlefOv.js";import"./input-DF7Ue23C.js";import"./select-DYffGc49.js";import"./index-DwctwfU0.js";import"./chevron-down-B5XuAFRu.js";import"./check-LAUWAnlX.js";import"./checkbox-D9ub-v0l.js";import"./input-error-BBygona6.js";import"./move-left-BhKZRPb4.js";import"./loader-circle-Utah5tGx.js";const e=[];function W(){const o=m.c(1);let r;return o[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(i,{breadcrumbs:e,children:t.jsx(p,{})}),o[0]=r):r=o[0],r}export{W as default};
@@ -1 +1 @@
1
- var Cs=Object.defineProperty;var Ns=(e,t,r)=>t in e?Cs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var g=(e,t,r)=>Ns(e,typeof t!="symbol"?t+"":t,r);import{q as ks,r as ps,S as Ps,j as i,J as ds}from"./app.js";import{c as Ss}from"./compiler-runtime-tM4jBQ-T.js";import{Icon as us}from"./icon-Bz9BMaD0.js";import{B as jt}from"./button-CQ9t1kLz.js";import{L as b}from"./label-Z506NKsW.js";import{I as He}from"./input-DF7Ue23C.js";import{c as fs,S as hs,a as ms,b as bs,d as ys}from"./select-D1N8zRPY.js";import{C as vt}from"./checkbox-W0nGAXIj.js";import{b as qs,T as Es,a as As,c as Us}from"./tooltip-D2ehgLlB.js";import Is from"./input-error-BBygona6.js";import Ls from"./material-icon-CItZiB53.js";import{M as Bs,I as Fs}from"./move-left-BhKZRPb4.js";import{L as zs}from"./loader-circle-Utah5tGx.js";import"./utils-DjqsqOe8.js";import"./index-DrWfGwtf.js";import"./index-K81GbF6O.js";import"./index-Cdb9ACvz.js";import"./index-D5ir9iUV.js";import"./index-BbXEMx9n.js";import"./index-C0SL3SHw.js";import"./index-DwctwfU0.js";import"./index-BcE9FUM6.js";import"./chevron-down-B5XuAFRu.js";import"./createLucideIcon-BFG25zNo.js";import"./check-LAUWAnlX.js";import"./index-BC0yfOHo.js";class gs extends Error{constructor(r,o,a){const c=r.status||r.status===0?r.status:"",u=r.statusText||"",d=`${c} ${u}`.trim(),h=d?`status code ${d}`:"an unknown error";super(`Request failed with ${h}: ${o.method} ${o.url}`);g(this,"response");g(this,"request");g(this,"options");this.name="HTTPError",this.response=r,this.request=o,this.options=a}}class _s extends Error{constructor(r){super(`Request timed out: ${r.method} ${r.url}`);g(this,"request");this.name="TimeoutError",this.request=r}}const xs=(()=>{let e=!1,t=!1;const r=typeof globalThis.ReadableStream=="function",o=typeof globalThis.Request=="function";if(r&&o)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(a){if(a instanceof Error&&a.message==="unsupported BodyInit type")return!1;throw a}return e&&!t})(),Os=typeof globalThis.AbortController=="function",Hs=typeof globalThis.ReadableStream=="function",Ds=typeof globalThis.FormData=="function",js=["get","post","put","patch","head","delete"],Ms={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},Rt=2147483647,$s=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,vs=Symbol("stop"),Js={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0},Vs={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0},Ws=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[r,o]of e)t+=$s,t+=new TextEncoder().encode(`Content-Disposition: form-data; name="${r}"`).length,t+=typeof o=="string"?new TextEncoder().encode(o).length:o.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if(typeof e=="string")return new TextEncoder().encode(e).length;if(e instanceof URLSearchParams)return new TextEncoder().encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if(typeof e=="object"&&e!==null)try{const t=JSON.stringify(e);return new TextEncoder().encode(t).length}catch{return 0}return 0},Ks=(e,t)=>{const r=Number(e.headers.get("content-length"))||0;let o=0;return e.status===204?(t&&t({percent:1,totalBytes:r,transferredBytes:o},new Uint8Array),new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers})):new Response(new ReadableStream({async start(a){const c=e.body.getReader();t&&t({percent:0,transferredBytes:0,totalBytes:r},new Uint8Array);async function u(){const{done:d,value:h}=await c.read();if(d){a.close();return}if(t){o+=h.byteLength;const m=r===0?0:o/r;t({percent:m,transferredBytes:o,totalBytes:r},h)}a.enqueue(h),await u()}await u()}}),{status:e.status,statusText:e.statusText,headers:e.headers})},Xs=(e,t)=>{const r=Ws(e.body);let o=0;return new Request(e,{duplex:"half",body:new ReadableStream({async start(a){const c=e.body instanceof ReadableStream?e.body.getReader():new Response("").body.getReader();async function u(){const{done:d,value:h}=await c.read();if(d){t&&t({percent:1,transferredBytes:o,totalBytes:Math.max(r,o)},new Uint8Array),a.close();return}o+=h.byteLength;let m=r===0?0:o/r;(r<o||m===1)&&(m=.99),t&&t({percent:Number(m.toFixed(2)),transferredBytes:o,totalBytes:r},h),a.enqueue(h),await u()}await u()}})})},De=e=>e!==null&&typeof e=="object",Qe=(...e)=>{for(const t of e)if((!De(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return Ct({},...e)},Rs=(e={},t={})=>{const r=new globalThis.Headers(e),o=t instanceof globalThis.Headers,a=new globalThis.Headers(t);for(const[c,u]of a.entries())o&&u==="undefined"||u===void 0?r.delete(c):r.set(c,u);return r};function Ze(e,t,r){return Object.hasOwn(t,r)&&t[r]===void 0?[]:Ct(e[r]??[],t[r]??[])}const Ts=(e={},t={})=>({beforeRequest:Ze(e,t,"beforeRequest"),beforeRetry:Ze(e,t,"beforeRetry"),afterResponse:Ze(e,t,"afterResponse"),beforeError:Ze(e,t,"beforeError")}),Ct=(...e)=>{let t={},r={},o={};for(const a of e)if(Array.isArray(a))Array.isArray(t)||(t=[]),t=[...t,...a];else if(De(a)){for(let[c,u]of Object.entries(a))De(u)&&c in t&&(u=Ct(t[c],u)),t={...t,[c]:u};De(a.hooks)&&(o=Ts(o,a.hooks),t.hooks=o),De(a.headers)&&(r=Rs(r,a.headers),t.headers=r)}return t},Ys=e=>js.includes(e)?e.toUpperCase():e,Gs=["get","put","head","delete","options","trace"],Qs=[408,413,429,500,502,503,504],Zs=[413,429,503],ws={limit:2,methods:Gs,statusCodes:Qs,afterStatusCodes:Zs,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},er=(e={})=>{if(typeof e=="number")return{...ws,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");return{...ws,...e}};async function tr(e,t,r,o){return new Promise((a,c)=>{const u=setTimeout(()=>{r&&r.abort(),c(new _s(e))},o.timeout);o.fetch(e,t).then(a).catch(c).then(()=>{clearTimeout(u)})})}async function sr(e,{signal:t}){return new Promise((r,o)=>{t&&(t.throwIfAborted(),t.addEventListener("abort",a,{once:!0}));function a(){clearTimeout(c),o(t.reason)}const c=setTimeout(()=>{t==null||t.removeEventListener("abort",a),r()},e)})}const rr=(e,t)=>{const r={};for(const o in t)!(o in Vs)&&!(o in Js)&&!(o in e)&&(r[o]=t[o]);return r};class et{constructor(t,r={}){g(this,"request");g(this,"abortController");g(this,"_retryCount",0);g(this,"_input");g(this,"_options");var o,a;if(this._input=t,this._options={...r,headers:Rs(this._input.headers,r.headers),hooks:Ts({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:Ys(r.method??this._input.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:er(r.retry),throwHttpErrors:r.throwHttpErrors!==!1,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(Os){const c=this._options.signal??this._input.signal;this.abortController=new globalThis.AbortController,this._options.signal=c?AbortSignal.any([c,this.abortController.signal]):this.abortController.signal}if(xs&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=((a=(o=this._options).stringifyJson)==null?void 0:a.call(o,this._options.json))??JSON.stringify(this._options.json),this._options.headers.set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){const u="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),d=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,u);(Ds&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(d,{...this.request}),this._options)}if(this._options.onUploadProgress){if(typeof this._options.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!xs)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request.body&&(this.request=Xs(this.request,this._options.onUploadProgress))}}static create(t,r){const o=new et(t,r),a=async()=>{if(typeof o._options.timeout=="number"&&o._options.timeout>Rt)throw new RangeError(`The \`timeout\` option cannot be greater than ${Rt}`);await Promise.resolve();let d=await o._fetch();for(const h of o._options.hooks.afterResponse){const m=await h(o.request,o._options,o._decorateResponse(d.clone()));m instanceof globalThis.Response&&(d=m)}if(o._decorateResponse(d),!d.ok&&o._options.throwHttpErrors){let h=new gs(d,o.request,o._options);for(const m of o._options.hooks.beforeError)h=await m(h);throw h}if(o._options.onDownloadProgress){if(typeof o._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Hs)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return Ks(d.clone(),o._options.onDownloadProgress)}return d},u=(o._options.retry.methods.includes(o.request.method.toLowerCase())?o._retry(a):a()).finally(async()=>{var d;o.request.bodyUsed||await((d=o.request.body)==null?void 0:d.cancel())});for(const[d,h]of Object.entries(Ms))u[d]=async()=>{o.request.headers.set("accept",o.request.headers.get("accept")||h);const m=await u;if(d==="json"){if(m.status===204||(await m.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await m.text())}return m[d]()};return u}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount>this._options.retry.limit||t instanceof _s)throw t;if(t instanceof gs){if(!this._options.retry.statusCodes.includes(t.response.status))throw t;const o=t.response.headers.get("Retry-After")??t.response.headers.get("RateLimit-Reset")??t.response.headers.get("X-RateLimit-Reset")??t.response.headers.get("X-Rate-Limit-Reset");if(o&&this._options.retry.afterStatusCodes.includes(t.response.status)){let a=Number(o)*1e3;Number.isNaN(a)?a=Date.parse(o)-Date.now():a>=Date.parse("2024-01-01")&&(a-=Date.now());const c=this._options.retry.maxRetryAfter??a;return a<c?a:c}if(t.response.status===413)throw t}const r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}_decorateResponse(t){return this._options.parseJson&&(t.json=async()=>this._options.parseJson(await t.text())),t}async _retry(t){try{return await t()}catch(r){const o=Math.min(this._calculateRetryDelay(r),Rt);if(this._retryCount<1)throw r;await sr(o,{signal:this._options.signal});for(const a of this._options.hooks.beforeRetry)if(await a({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===vs)return;return this._retry(t)}}async _fetch(){for(const o of this._options.hooks.beforeRequest){const a=await o(this.request,this._options);if(a instanceof Request){this.request=a;break}if(a instanceof Response)return a}const t=rr(this.request,this._options),r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,t):tr(r,t,this.abortController,this._options)}}/*! MIT License © Sindre Sorhus */const Tt=e=>{const t=(r,o)=>et.create(r,Qe(e,o));for(const r of js)t[r]=(o,a)=>et.create(o,Qe(e,a,{method:r}));return t.create=r=>Tt(Qe(r)),t.extend=r=>(typeof r=="function"&&(r=r(e??{})),Tt(Qe(e,r))),t.stop=vs,t},or=Tt();function Br(){var Nt,kt,Pt,St,qt,Et,At,Ut,It,Lt,Bt,Ft,zt,Ot,Ht,Dt,Mt,$t,Jt,Vt,Wt,Kt,Xt,Yt,Gt,Qt,Zt,es,ts,ss,rs,os,is,as,ns,ls,cs;const e=Ss.c(260),t=ks(),[r,o]=ps.useState(),{fields:a,groups:c,auth:u}=t.props;let d;e[0]!==a?(d=Object.fromEntries(a.map(cr)),e[0]=a,e[1]=d):d=e[1];let h;e[2]!==c?(h=Object.fromEntries(c.map(lr)),e[2]=c,e[3]=h):h=e[3];let m;e[4]!==d||e[5]!==h?(m={...d,...h},e[4]=d,e[5]=h,e[6]=m):m=e[6];const{data:p,setData:Me,errors:tt,setError:st,clearErrors:rt,post:ot,processing:f}=Ps(m);let $e,Je;e[7]===Symbol.for("react.memo_cache_sentinel")?($e=()=>{(async()=>{const x=await or.get(`${window.routePrefix}/get-timezones`).json();o(x.timezones)})()},Je=[],e[7]=$e,e[8]=Je):($e=e[7],Je=e[8]),ps.useEffect($e,Je);let Ve;e[9]!==t.props.fields?(Ve=l=>t.props.fields.find(x=>x.name===l),e[9]=t.props.fields,e[10]=Ve):Ve=e[10];const s=Ve;let We;e[11]!==p.repeatUserPassword||e[12]!==p.userPassword||e[13]!==t.props.passwordError||e[14]!==t.props.postLink||e[15]!==ot||e[16]!==st?(We=l=>{if(l.preventDefault(),p.userPassword!==p.repeatUserPassword){st("repeatUserPassword",t.props.passwordError);return}ot(t.props.postLink)},e[11]=p.repeatUserPassword,e[12]=p.userPassword,e[13]=t.props.passwordError,e[14]=t.props.postLink,e[15]=ot,e[16]=st,e[17]=We):We=e[17];const it=We;let Ke;e[18]!==rt||e[19]!==Me?(Ke=(l,x)=>{rt(),Me(l,x)},e[18]=rt,e[19]=Me,e[20]=Ke):Ke=e[20];const n=Ke;let Xe;e[21]===Symbol.for("react.memo_cache_sentinel")?(Xe=i.jsx(us,{iconNode:Bs}),e[21]=Xe):Xe=e[21];let w;e[22]!==t.props.btnBack.link||e[23]!==t.props.btnBack.title?(w=i.jsx(jt,{className:"mb-3 w-fit",asChild:!0,children:i.jsxs(ds,{href:t.props.btnBack.link,children:[Xe,t.props.btnBack.title]})}),e[22]=t.props.btnBack.link,e[23]=t.props.btnBack.title,e[24]=w):w=e[24];const at=f||t.props.view;let y;e[25]!==f?(y=f&&i.jsx(zs,{className:"h-4 w-4 animate-spin"}),e[25]=f,e[26]=y):y=e[26];let _;e[27]!==t.props.btnSave.title||e[28]!==at||e[29]!==y?(_=i.jsxs(jt,{variant:"green",type:"submit",className:"w-fit cursor-pointer",form:"addUserForm",disabled:at,children:[y,t.props.btnSave.title]}),e[27]=t.props.btnSave.title,e[28]=at,e[29]=y,e[30]=_):_=e[30];let j;e[31]!==_||e[32]!==w?(j=i.jsxs("div",{className:"w-full sticky z-[1001] py-4 pb-8 top-0 h-fit bg-background flex gap-4",children:[w,_]}),e[31]=_,e[32]=w,e[33]=j):j=e[33];const nt=t.props.view?"cursor-not-allowed":"";let v;e[34]!==t.props.head?(v=i.jsx("h2",{className:"font-bold text-xl",children:t.props.head}),e[34]=t.props.head,e[35]=v):v=e[35];let R;e[36]!==s?(R=(Nt=s("login"))==null?void 0:Nt.name,e[36]=s,e[37]=R):R=e[37];let T;e[38]!==s?(T=(kt=s("login"))==null?void 0:kt.label,e[38]=s,e[39]=T):T=e[39];let C;e[40]!==R||e[41]!==T?(C=i.jsx(b,{htmlFor:R,children:T}),e[40]=R,e[41]=T,e[42]=C):C=e[42];let N;e[43]!==s?(N=(Pt=s("login"))==null?void 0:Pt.name,e[43]=s,e[44]=N):N=e[44];const lt=p.login;let k;e[45]!==n?(k=l=>n("login",l.target.value),e[45]=n,e[46]=k):k=e[46];const ct=f||t.props.view;let P;e[47]!==s?(P=(St=s("login"))==null?void 0:St.label,e[47]=s,e[48]=P):P=e[48];let S;e[49]!==N||e[50]!==lt||e[51]!==k||e[52]!==ct||e[53]!==P?(S=i.jsx(He,{id:N,type:"text",required:!0,tabIndex:1,autoComplete:"username",value:lt,onChange:k,disabled:ct,placeholder:P}),e[49]=N,e[50]=lt,e[51]=k,e[52]=ct,e[53]=P,e[54]=S):S=e[54];let q;e[55]!==C||e[56]!==S?(q=i.jsxs("div",{className:"grid gap-4",children:[C,S]}),e[55]=C,e[56]=S,e[57]=q):q=e[57];let E;e[58]!==s?(E=(qt=s("fullName"))==null?void 0:qt.name,e[58]=s,e[59]=E):E=e[59];let A;e[60]!==s?(A=(Et=s("fullName"))==null?void 0:Et.label,e[60]=s,e[61]=A):A=e[61];let U;e[62]!==E||e[63]!==A?(U=i.jsx(b,{htmlFor:E,children:A}),e[62]=E,e[63]=A,e[64]=U):U=e[64];let I;e[65]!==s?(I=(At=s("fullName"))==null?void 0:At.name,e[65]=s,e[66]=I):I=e[66];const pt=p.fullName;let L;e[67]!==n?(L=l=>n("fullName",l.target.value),e[67]=n,e[68]=L):L=e[68];const dt=f||t.props.view;let B;e[69]!==s?(B=(Ut=s("fullName"))==null?void 0:Ut.label,e[69]=s,e[70]=B):B=e[70];let F;e[71]!==I||e[72]!==pt||e[73]!==L||e[74]!==dt||e[75]!==B?(F=i.jsx(He,{id:I,type:"text",required:!0,tabIndex:1,autoComplete:"additional-name",value:pt,onChange:L,disabled:dt,placeholder:B}),e[71]=I,e[72]=pt,e[73]=L,e[74]=dt,e[75]=B,e[76]=F):F=e[76];let z;e[77]!==U||e[78]!==F?(z=i.jsxs("div",{className:"grid gap-4",children:[U,F]}),e[77]=U,e[78]=F,e[79]=z):z=e[79];let O;e[80]!==s?(O=(It=s("email"))==null?void 0:It.name,e[80]=s,e[81]=O):O=e[81];let H;e[82]!==s?(H=(Lt=s("email"))==null?void 0:Lt.label,e[82]=s,e[83]=H):H=e[83];let D;e[84]!==O||e[85]!==H?(D=i.jsx(b,{htmlFor:O,children:H}),e[84]=O,e[85]=H,e[86]=D):D=e[86];let M;e[87]!==s?(M=(Bt=s("email"))==null?void 0:Bt.name,e[87]=s,e[88]=M):M=e[88];const ut=p.email;let $;e[89]!==n?($=l=>n("email",l.target.value),e[89]=n,e[90]=$):$=e[90];const ft=f||t.props.view;let J;e[91]!==s?(J=(Ft=s("email"))==null?void 0:Ft.label,e[91]=s,e[92]=J):J=e[92];let V;e[93]!==M||e[94]!==ut||e[95]!==$||e[96]!==ft||e[97]!==J?(V=i.jsx(He,{id:M,type:"email",required:!0,tabIndex:1,autoComplete:"email",value:ut,onChange:$,disabled:ft,placeholder:J}),e[93]=M,e[94]=ut,e[95]=$,e[96]=ft,e[97]=J,e[98]=V):V=e[98];let W;e[99]!==D||e[100]!==V?(W=i.jsxs("div",{className:"grid gap-4",children:[D,V]}),e[99]=D,e[100]=V,e[101]=W):W=e[101];let K;e[102]!==q||e[103]!==z||e[104]!==W?(K=i.jsxs("div",{className:"basis-1/2 flex flex-col gap-6",children:[q,z,W]}),e[102]=q,e[103]=z,e[104]=W,e[105]=K):K=e[105];let X;e[106]!==s?(X=(zt=s("timezone"))==null?void 0:zt.name,e[106]=s,e[107]=X):X=e[107];let Y;e[108]!==s?(Y=(Ot=s("timezone"))==null?void 0:Ot.label,e[108]=s,e[109]=Y):Y=e[109];let G;e[110]!==X||e[111]!==Y?(G=i.jsx(b,{htmlFor:X,children:Y}),e[110]=X,e[111]=Y,e[112]=G):G=e[112];let Q;e[113]!==n?(Q=l=>n("timezone",l),e[113]=n,e[114]=Q):Q=e[114];const ht=p.timezone,mt=f||t.props.view;let Z;e[115]!==s?(Z=(Ht=s("timezone"))==null?void 0:Ht.name,e[115]=s,e[116]=Z):Z=e[116];let ee;e[117]!==Z?(ee=i.jsx(hs,{className:"w-full cursor-pointer",children:i.jsx(ms,{placeholder:Z})}),e[117]=Z,e[118]=ee):ee=e[118];let te;e[119]!==r?(te=r??[],e[119]=r,e[120]=te):te=e[120];let se;e[121]!==te?(se=te.map(nr),e[121]=te,e[122]=se):se=e[122];let re;e[123]!==se?(re=i.jsx(bs,{children:se}),e[123]=se,e[124]=re):re=e[124];let oe;e[125]!==Q||e[126]!==ht||e[127]!==mt||e[128]!==ee||e[129]!==re?(oe=i.jsxs(fs,{onValueChange:Q,defaultValue:ht,disabled:mt,children:[ee,re]}),e[125]=Q,e[126]=ht,e[127]=mt,e[128]=ee,e[129]=re,e[130]=oe):oe=e[130];let ie;e[131]!==G||e[132]!==oe?(ie=i.jsxs("div",{className:"grid gap-4",children:[G,oe]}),e[131]=G,e[132]=oe,e[133]=ie):ie=e[133];let ae;e[134]!==p.date||e[135]!==s||e[136]!==n||e[137]!==f?(ae=s("date")&&i.jsxs("div",{className:"grid gap-4",children:[i.jsx(b,{htmlFor:(Dt=s("date"))==null?void 0:Dt.name,children:(Mt=s("date"))==null?void 0:Mt.label}),i.jsx(He,{id:($t=s("date"))==null?void 0:$t.name,type:"date",className:"max-w-fit",tabIndex:1,value:p.date,onChange:l=>n("date",l.target.value),disabled:f})]}),e[134]=p.date,e[135]=s,e[136]=n,e[137]=f,e[138]=ae):ae=e[138];let ne;e[139]!==p.isAdmin||e[140]!==s||e[141]!==n||e[142]!==t.props.view||e[143]!==f?(ne=s("isAdmin")&&i.jsxs("div",{className:"grid gap-4",children:[i.jsx(b,{className:"cursor-pointer",htmlFor:(Jt=s("isAdmin"))==null?void 0:Jt.name,children:(Vt=s("isAdmin"))==null?void 0:Vt.label}),i.jsx(vt,{id:(Wt=s("isAdmin"))==null?void 0:Wt.name,className:"cursor-pointer size-5",disabled:f||t.props.view,checked:p.isAdmin,onCheckedChange:l=>n("isAdmin",l)})]}),e[139]=p.isAdmin,e[140]=s,e[141]=n,e[142]=t.props.view,e[143]=f,e[144]=ne):ne=e[144];let le;e[145]!==p.isConfirmed||e[146]!==s||e[147]!==n||e[148]!==t.props.view||e[149]!==f?(le=s("isConfirmed")&&i.jsxs("div",{className:"grid gap-4",children:[i.jsx(b,{className:"cursor-pointer",htmlFor:(Kt=s("isConfirmed"))==null?void 0:Kt.name,children:(Xt=s("isConfirmed"))==null?void 0:Xt.label}),i.jsx(vt,{id:(Yt=s("isConfirmed"))==null?void 0:Yt.name,className:"cursor-pointer size-5",disabled:f||t.props.view,checked:p.isConfirmed,onCheckedChange:l=>n("isConfirmed",l)})]}),e[145]=p.isConfirmed,e[146]=s,e[147]=n,e[148]=t.props.view,e[149]=f,e[150]=le):le=e[150];let ce;e[151]!==ne||e[152]!==le?(ce=i.jsxs("div",{className:"flex gap-6",children:[ne,le]}),e[151]=ne,e[152]=le,e[153]=ce):ce=e[153];let pe;e[154]!==ae||e[155]!==ce?(pe=i.jsxs("div",{className:"flex flex-col md:flex-row justify-start gap-4 xl:justify-between items-start md:items-center",children:[ae,ce]}),e[154]=ae,e[155]=ce,e[156]=pe):pe=e[156];let de;e[157]!==p.locale||e[158]!==s||e[159]!==n||e[160]!==t.props.locales||e[161]!==t.props.view||e[162]!==f?(de=s("locale")&&i.jsxs("div",{className:"grid gap-4",children:[i.jsx(b,{htmlFor:(Gt=s("locale"))==null?void 0:Gt.name,children:(Qt=s("locale"))==null?void 0:Qt.label}),i.jsxs(fs,{onValueChange:l=>n("locale",l),defaultValue:p.locale,disabled:f||t.props.view,children:[i.jsx(hs,{className:"w-full cursor-pointer",children:i.jsx(ms,{placeholder:(Zt=s("locale"))==null?void 0:Zt.name})}),i.jsx(bs,{children:(t.props.locales??[]).map(ar)})]})]}),e[157]=p.locale,e[158]=s,e[159]=n,e[160]=t.props.locales,e[161]=t.props.view,e[162]=f,e[163]=de):de=e[163];let ue;e[164]!==ie||e[165]!==pe||e[166]!==de?(ue=i.jsxs("div",{className:"basis-1/2 flex flex-col gap-6",children:[ie,pe,de]}),e[164]=ie,e[165]=pe,e[166]=de,e[167]=ue):ue=e[167];let fe;e[168]!==K||e[169]!==ue?(fe=i.jsxs("div",{className:"flex-col xl:flex-row flex gap-16",children:[K,ue]}),e[168]=K,e[169]=ue,e[170]=fe):fe=e[170];let he;e[171]!==u.user.isAdministrator||e[172]!==p.login||e[173]!==t.props.userPretend?(he=u.user.isAdministrator&&i.jsx(jt,{className:"w-fit",asChild:!0,variant:"outline",children:i.jsxs(ds,{href:t.props.userPretend.postLink,method:"post",data:{login:p.login,pretend:!0},children:[i.jsx(Ls,{name:"masks",className:"!text-[18px]"}),t.props.userPretend.label]})}),e[171]=u.user.isAdministrator,e[172]=p.login,e[173]=t.props.userPretend,e[174]=he):he=e[174];let me;e[175]!==s?(me=(es=s("userPassword"))==null?void 0:es.label,e[175]=s,e[176]=me):me=e[176];let be;e[177]!==me?(be=i.jsx("label",{className:"font-bold text-xl",children:me}),e[177]=me,e[178]=be):be=e[178];let Ye;e[179]===Symbol.for("react.memo_cache_sentinel")?(Ye=i.jsx(qs,{onClick:ir,children:i.jsx(us,{iconNode:Fs,className:"text-primary w-5 h-5 cursor-pointer"})}),e[179]=Ye):Ye=e[179];let ge;e[180]!==s?(ge=(ts=s("userPassword"))==null?void 0:ts.tooltip,e[180]=s,e[181]=ge):ge=e[181];let xe;e[182]!==ge?(xe=i.jsx(Es,{children:i.jsxs(As,{children:[Ye,i.jsx(Us,{align:"center",side:"top",children:i.jsx("p",{children:ge})})]})}),e[182]=ge,e[183]=xe):xe=e[183];let we;e[184]!==be||e[185]!==xe?(we=i.jsxs("div",{className:"flex gap-3",children:[be,xe]}),e[184]=be,e[185]=xe,e[186]=we):we=e[186];let ye;e[187]!==s?(ye=(ss=s("userPassword"))==null?void 0:ss.name,e[187]=s,e[188]=ye):ye=e[188];let _e;e[189]!==s?(_e=(rs=s("userPassword"))==null?void 0:rs.label,e[189]=s,e[190]=_e):_e=e[190];let je;e[191]!==ye||e[192]!==_e?(je=i.jsx(b,{htmlFor:ye,children:_e}),e[191]=ye,e[192]=_e,e[193]=je):je=e[193];let ve;e[194]!==s?(ve=(os=s("userPassword"))==null?void 0:os.name,e[194]=s,e[195]=ve):ve=e[195];const bt=!t.props.edit,gt=p.password;let Re;e[196]!==n?(Re=l=>n("userPassword",l.target.value),e[196]=n,e[197]=Re):Re=e[197];const xt=f||t.props.view;let Te;e[198]!==s?(Te=(is=s("userPassword"))==null?void 0:is.label,e[198]=s,e[199]=Te):Te=e[199];let Ce;e[200]!==ve||e[201]!==bt||e[202]!==gt||e[203]!==Re||e[204]!==xt||e[205]!==Te?(Ce=i.jsx(He,{id:ve,type:"password",required:bt,tabIndex:1,autoComplete:"new-password",value:gt,onChange:Re,disabled:xt,placeholder:Te}),e[200]=ve,e[201]=bt,e[202]=gt,e[203]=Re,e[204]=xt,e[205]=Te,e[206]=Ce):Ce=e[206];let Ne;e[207]!==je||e[208]!==Ce?(Ne=i.jsxs("div",{className:"grid gap-4 col-span-1",children:[je,Ce]}),e[207]=je,e[208]=Ce,e[209]=Ne):Ne=e[209];let ke;e[210]!==s?(ke=(as=s("repeatUserPassword"))==null?void 0:as.name,e[210]=s,e[211]=ke):ke=e[211];let Pe;e[212]!==s?(Pe=(ns=s("repeatUserPassword"))==null?void 0:ns.label,e[212]=s,e[213]=Pe):Pe=e[213];let Se;e[214]!==ke||e[215]!==Pe?(Se=i.jsx(b,{htmlFor:ke,children:Pe}),e[214]=ke,e[215]=Pe,e[216]=Se):Se=e[216];let qe;e[217]!==s?(qe=(ls=s("repeatUserPassword"))==null?void 0:ls.name,e[217]=s,e[218]=qe):qe=e[218];const wt=!t.props.edit,yt=p.repeatUserPassword;let Ee;e[219]!==n?(Ee=l=>n("repeatUserPassword",l.target.value),e[219]=n,e[220]=Ee):Ee=e[220];const _t=f||t.props.view;let Ae;e[221]!==s?(Ae=(cs=s("repeatUserPassword"))==null?void 0:cs.label,e[221]=s,e[222]=Ae):Ae=e[222];let Ue;e[223]!==qe||e[224]!==wt||e[225]!==yt||e[226]!==Ee||e[227]!==_t||e[228]!==Ae?(Ue=i.jsx(He,{id:qe,type:"password",required:wt,tabIndex:1,autoComplete:"new-password",value:yt,onChange:Ee,disabled:_t,placeholder:Ae}),e[223]=qe,e[224]=wt,e[225]=yt,e[226]=Ee,e[227]=_t,e[228]=Ae,e[229]=Ue):Ue=e[229];let Ie;e[230]!==tt.repeatUserPassword?(Ie=i.jsx(Is,{message:tt.repeatUserPassword}),e[230]=tt.repeatUserPassword,e[231]=Ie):Ie=e[231];let Le;e[232]!==Se||e[233]!==Ue||e[234]!==Ie?(Le=i.jsxs("div",{className:"grid gap-4 col-span-1 col-start-1",children:[Se,Ue,Ie]}),e[232]=Se,e[233]=Ue,e[234]=Ie,e[235]=Le):Le=e[235];let Be;e[236]!==Ne||e[237]!==Le?(Be=i.jsxs("div",{className:"grid grid-col-1 lg:grid-cols-2 grid-rows-2 gap-x-16 gap-y-6",children:[Ne,Le]}),e[236]=Ne,e[237]=Le,e[238]=Be):Be=e[238];let Fe;e[239]!==p||e[240]!==n||e[241]!==t.props.groupHead||e[242]!==t.props.groups||e[243]!==t.props.view||e[244]!==f?(Fe=t.props.groups.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"font-bold text-xl",children:t.props.groupHead}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-5 xl:grid-cols-6 gap-4",children:t.props.groups.map(l=>i.jsxs("div",{className:"grid gap-4",children:[i.jsx(b,{className:"cursor-pointer",htmlFor:l.name,children:l.label}),i.jsx(vt,{id:l.name,disabled:f||t.props.view,className:"cursor-pointer size-5",checked:p[l.name],onCheckedChange:x=>n(l.name,x)})]},l.name))})]}),e[239]=p,e[240]=n,e[241]=t.props.groupHead,e[242]=t.props.groups,e[243]=t.props.view,e[244]=f,e[245]=Fe):Fe=e[245];let ze;e[246]!==v||e[247]!==fe||e[248]!==he||e[249]!==we||e[250]!==Be||e[251]!==Fe?(ze=i.jsxs("div",{className:"flex flex-col gap-10 max-w-[1144px]",children:[v,fe,he,we,Be,Fe]}),e[246]=v,e[247]=fe,e[248]=he,e[249]=we,e[250]=Be,e[251]=Fe,e[252]=ze):ze=e[252];let Oe;e[253]!==it||e[254]!==ze||e[255]!==nt?(Oe=i.jsx("form",{id:"addUserForm",onSubmit:it,className:nt,children:ze}),e[253]=it,e[254]=ze,e[255]=nt,e[256]=Oe):Oe=e[256];let Ge;return e[257]!==Oe||e[258]!==j?(Ge=i.jsxs("div",{className:"flex h-full flex-1 flex-col gap-4 rounded-xl p-4",children:[j,Oe]}),e[257]=Oe,e[258]=j,e[259]=Ge):Ge=e[259],Ge}function ir(e){return e.preventDefault()}function ar(e){return i.jsx(ys,{value:e.value,children:e.label},e.value)}function nr(e){return i.jsx(ys,{value:e.value,children:e.label},e.value)}function lr(e){return[e.name,e.value]}function cr(e){return[e.name,e.value]}export{Br as default};
1
+ var Cs=Object.defineProperty;var Ns=(e,t,r)=>t in e?Cs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var g=(e,t,r)=>Ns(e,typeof t!="symbol"?t+"":t,r);import{q as ks,r as ps,S as Ps,j as i,J as ds}from"./app.js";import{c as Ss}from"./compiler-runtime-tM4jBQ-T.js";import{Icon as us}from"./icon-Bz9BMaD0.js";import{B as jt}from"./button-CTOOfwvn.js";import{L as b}from"./label-C2tlefOv.js";import{I as He}from"./input-DF7Ue23C.js";import{c as fs,S as hs,a as ms,b as bs,d as ys}from"./select-DYffGc49.js";import{C as vt}from"./checkbox-D9ub-v0l.js";import{b as qs,T as Es,a as As,c as Us}from"./tooltip-CWVAD5oF.js";import Is from"./input-error-BBygona6.js";import Ls from"./material-icon-CItZiB53.js";import{M as Bs,I as Fs}from"./move-left-BhKZRPb4.js";import{L as zs}from"./loader-circle-Utah5tGx.js";import"./utils-DjqsqOe8.js";import"./index-DUXJYtOc.js";import"./index-DEzdKGnS.js";import"./index-Dllsp4Rk.js";import"./index-D5ir9iUV.js";import"./index-C5OL14ES.js";import"./index-DnbQEoxZ.js";import"./index-DwctwfU0.js";import"./index-Cb_qrizV.js";import"./chevron-down-B5XuAFRu.js";import"./createLucideIcon-BFG25zNo.js";import"./check-LAUWAnlX.js";import"./index-Mx04mBJl.js";class gs extends Error{constructor(r,o,a){const c=r.status||r.status===0?r.status:"",u=r.statusText||"",d=`${c} ${u}`.trim(),h=d?`status code ${d}`:"an unknown error";super(`Request failed with ${h}: ${o.method} ${o.url}`);g(this,"response");g(this,"request");g(this,"options");this.name="HTTPError",this.response=r,this.request=o,this.options=a}}class _s extends Error{constructor(r){super(`Request timed out: ${r.method} ${r.url}`);g(this,"request");this.name="TimeoutError",this.request=r}}const xs=(()=>{let e=!1,t=!1;const r=typeof globalThis.ReadableStream=="function",o=typeof globalThis.Request=="function";if(r&&o)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(a){if(a instanceof Error&&a.message==="unsupported BodyInit type")return!1;throw a}return e&&!t})(),Os=typeof globalThis.AbortController=="function",Hs=typeof globalThis.ReadableStream=="function",Ds=typeof globalThis.FormData=="function",js=["get","post","put","patch","head","delete"],Ms={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},Rt=2147483647,$s=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,vs=Symbol("stop"),Js={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0},Vs={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0},Ws=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[r,o]of e)t+=$s,t+=new TextEncoder().encode(`Content-Disposition: form-data; name="${r}"`).length,t+=typeof o=="string"?new TextEncoder().encode(o).length:o.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if(typeof e=="string")return new TextEncoder().encode(e).length;if(e instanceof URLSearchParams)return new TextEncoder().encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if(typeof e=="object"&&e!==null)try{const t=JSON.stringify(e);return new TextEncoder().encode(t).length}catch{return 0}return 0},Ks=(e,t)=>{const r=Number(e.headers.get("content-length"))||0;let o=0;return e.status===204?(t&&t({percent:1,totalBytes:r,transferredBytes:o},new Uint8Array),new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers})):new Response(new ReadableStream({async start(a){const c=e.body.getReader();t&&t({percent:0,transferredBytes:0,totalBytes:r},new Uint8Array);async function u(){const{done:d,value:h}=await c.read();if(d){a.close();return}if(t){o+=h.byteLength;const m=r===0?0:o/r;t({percent:m,transferredBytes:o,totalBytes:r},h)}a.enqueue(h),await u()}await u()}}),{status:e.status,statusText:e.statusText,headers:e.headers})},Xs=(e,t)=>{const r=Ws(e.body);let o=0;return new Request(e,{duplex:"half",body:new ReadableStream({async start(a){const c=e.body instanceof ReadableStream?e.body.getReader():new Response("").body.getReader();async function u(){const{done:d,value:h}=await c.read();if(d){t&&t({percent:1,transferredBytes:o,totalBytes:Math.max(r,o)},new Uint8Array),a.close();return}o+=h.byteLength;let m=r===0?0:o/r;(r<o||m===1)&&(m=.99),t&&t({percent:Number(m.toFixed(2)),transferredBytes:o,totalBytes:r},h),a.enqueue(h),await u()}await u()}})})},De=e=>e!==null&&typeof e=="object",Qe=(...e)=>{for(const t of e)if((!De(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be an object");return Ct({},...e)},Rs=(e={},t={})=>{const r=new globalThis.Headers(e),o=t instanceof globalThis.Headers,a=new globalThis.Headers(t);for(const[c,u]of a.entries())o&&u==="undefined"||u===void 0?r.delete(c):r.set(c,u);return r};function Ze(e,t,r){return Object.hasOwn(t,r)&&t[r]===void 0?[]:Ct(e[r]??[],t[r]??[])}const Ts=(e={},t={})=>({beforeRequest:Ze(e,t,"beforeRequest"),beforeRetry:Ze(e,t,"beforeRetry"),afterResponse:Ze(e,t,"afterResponse"),beforeError:Ze(e,t,"beforeError")}),Ct=(...e)=>{let t={},r={},o={};for(const a of e)if(Array.isArray(a))Array.isArray(t)||(t=[]),t=[...t,...a];else if(De(a)){for(let[c,u]of Object.entries(a))De(u)&&c in t&&(u=Ct(t[c],u)),t={...t,[c]:u};De(a.hooks)&&(o=Ts(o,a.hooks),t.hooks=o),De(a.headers)&&(r=Rs(r,a.headers),t.headers=r)}return t},Ys=e=>js.includes(e)?e.toUpperCase():e,Gs=["get","put","head","delete","options","trace"],Qs=[408,413,429,500,502,503,504],Zs=[413,429,503],ws={limit:2,methods:Gs,statusCodes:Qs,afterStatusCodes:Zs,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},er=(e={})=>{if(typeof e=="number")return{...ws,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");return{...ws,...e}};async function tr(e,t,r,o){return new Promise((a,c)=>{const u=setTimeout(()=>{r&&r.abort(),c(new _s(e))},o.timeout);o.fetch(e,t).then(a).catch(c).then(()=>{clearTimeout(u)})})}async function sr(e,{signal:t}){return new Promise((r,o)=>{t&&(t.throwIfAborted(),t.addEventListener("abort",a,{once:!0}));function a(){clearTimeout(c),o(t.reason)}const c=setTimeout(()=>{t==null||t.removeEventListener("abort",a),r()},e)})}const rr=(e,t)=>{const r={};for(const o in t)!(o in Vs)&&!(o in Js)&&!(o in e)&&(r[o]=t[o]);return r};class et{constructor(t,r={}){g(this,"request");g(this,"abortController");g(this,"_retryCount",0);g(this,"_input");g(this,"_options");var o,a;if(this._input=t,this._options={...r,headers:Rs(this._input.headers,r.headers),hooks:Ts({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:Ys(r.method??this._input.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:er(r.retry),throwHttpErrors:r.throwHttpErrors!==!1,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(Os){const c=this._options.signal??this._input.signal;this.abortController=new globalThis.AbortController,this._options.signal=c?AbortSignal.any([c,this.abortController.signal]):this.abortController.signal}if(xs&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=((a=(o=this._options).stringifyJson)==null?void 0:a.call(o,this._options.json))??JSON.stringify(this._options.json),this._options.headers.set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){const u="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),d=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,u);(Ds&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(d,{...this.request}),this._options)}if(this._options.onUploadProgress){if(typeof this._options.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!xs)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request.body&&(this.request=Xs(this.request,this._options.onUploadProgress))}}static create(t,r){const o=new et(t,r),a=async()=>{if(typeof o._options.timeout=="number"&&o._options.timeout>Rt)throw new RangeError(`The \`timeout\` option cannot be greater than ${Rt}`);await Promise.resolve();let d=await o._fetch();for(const h of o._options.hooks.afterResponse){const m=await h(o.request,o._options,o._decorateResponse(d.clone()));m instanceof globalThis.Response&&(d=m)}if(o._decorateResponse(d),!d.ok&&o._options.throwHttpErrors){let h=new gs(d,o.request,o._options);for(const m of o._options.hooks.beforeError)h=await m(h);throw h}if(o._options.onDownloadProgress){if(typeof o._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Hs)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return Ks(d.clone(),o._options.onDownloadProgress)}return d},u=(o._options.retry.methods.includes(o.request.method.toLowerCase())?o._retry(a):a()).finally(async()=>{var d;o.request.bodyUsed||await((d=o.request.body)==null?void 0:d.cancel())});for(const[d,h]of Object.entries(Ms))u[d]=async()=>{o.request.headers.set("accept",o.request.headers.get("accept")||h);const m=await u;if(d==="json"){if(m.status===204||(await m.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await m.text())}return m[d]()};return u}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount>this._options.retry.limit||t instanceof _s)throw t;if(t instanceof gs){if(!this._options.retry.statusCodes.includes(t.response.status))throw t;const o=t.response.headers.get("Retry-After")??t.response.headers.get("RateLimit-Reset")??t.response.headers.get("X-RateLimit-Reset")??t.response.headers.get("X-Rate-Limit-Reset");if(o&&this._options.retry.afterStatusCodes.includes(t.response.status)){let a=Number(o)*1e3;Number.isNaN(a)?a=Date.parse(o)-Date.now():a>=Date.parse("2024-01-01")&&(a-=Date.now());const c=this._options.retry.maxRetryAfter??a;return a<c?a:c}if(t.response.status===413)throw t}const r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}_decorateResponse(t){return this._options.parseJson&&(t.json=async()=>this._options.parseJson(await t.text())),t}async _retry(t){try{return await t()}catch(r){const o=Math.min(this._calculateRetryDelay(r),Rt);if(this._retryCount<1)throw r;await sr(o,{signal:this._options.signal});for(const a of this._options.hooks.beforeRetry)if(await a({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===vs)return;return this._retry(t)}}async _fetch(){for(const o of this._options.hooks.beforeRequest){const a=await o(this.request,this._options);if(a instanceof Request){this.request=a;break}if(a instanceof Response)return a}const t=rr(this.request,this._options),r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,t):tr(r,t,this.abortController,this._options)}}/*! MIT License © Sindre Sorhus */const Tt=e=>{const t=(r,o)=>et.create(r,Qe(e,o));for(const r of js)t[r]=(o,a)=>et.create(o,Qe(e,a,{method:r}));return t.create=r=>Tt(Qe(r)),t.extend=r=>(typeof r=="function"&&(r=r(e??{})),Tt(Qe(e,r))),t.stop=vs,t},or=Tt();function Br(){var Nt,kt,Pt,St,qt,Et,At,Ut,It,Lt,Bt,Ft,zt,Ot,Ht,Dt,Mt,$t,Jt,Vt,Wt,Kt,Xt,Yt,Gt,Qt,Zt,es,ts,ss,rs,os,is,as,ns,ls,cs;const e=Ss.c(260),t=ks(),[r,o]=ps.useState(),{fields:a,groups:c,auth:u}=t.props;let d;e[0]!==a?(d=Object.fromEntries(a.map(cr)),e[0]=a,e[1]=d):d=e[1];let h;e[2]!==c?(h=Object.fromEntries(c.map(lr)),e[2]=c,e[3]=h):h=e[3];let m;e[4]!==d||e[5]!==h?(m={...d,...h},e[4]=d,e[5]=h,e[6]=m):m=e[6];const{data:p,setData:Me,errors:tt,setError:st,clearErrors:rt,post:ot,processing:f}=Ps(m);let $e,Je;e[7]===Symbol.for("react.memo_cache_sentinel")?($e=()=>{(async()=>{const x=await or.get(`${window.routePrefix}/get-timezones`).json();o(x.timezones)})()},Je=[],e[7]=$e,e[8]=Je):($e=e[7],Je=e[8]),ps.useEffect($e,Je);let Ve;e[9]!==t.props.fields?(Ve=l=>t.props.fields.find(x=>x.name===l),e[9]=t.props.fields,e[10]=Ve):Ve=e[10];const s=Ve;let We;e[11]!==p.repeatUserPassword||e[12]!==p.userPassword||e[13]!==t.props.passwordError||e[14]!==t.props.postLink||e[15]!==ot||e[16]!==st?(We=l=>{if(l.preventDefault(),p.userPassword!==p.repeatUserPassword){st("repeatUserPassword",t.props.passwordError);return}ot(t.props.postLink)},e[11]=p.repeatUserPassword,e[12]=p.userPassword,e[13]=t.props.passwordError,e[14]=t.props.postLink,e[15]=ot,e[16]=st,e[17]=We):We=e[17];const it=We;let Ke;e[18]!==rt||e[19]!==Me?(Ke=(l,x)=>{rt(),Me(l,x)},e[18]=rt,e[19]=Me,e[20]=Ke):Ke=e[20];const n=Ke;let Xe;e[21]===Symbol.for("react.memo_cache_sentinel")?(Xe=i.jsx(us,{iconNode:Bs}),e[21]=Xe):Xe=e[21];let w;e[22]!==t.props.btnBack.link||e[23]!==t.props.btnBack.title?(w=i.jsx(jt,{className:"mb-3 w-fit",asChild:!0,children:i.jsxs(ds,{href:t.props.btnBack.link,children:[Xe,t.props.btnBack.title]})}),e[22]=t.props.btnBack.link,e[23]=t.props.btnBack.title,e[24]=w):w=e[24];const at=f||t.props.view;let y;e[25]!==f?(y=f&&i.jsx(zs,{className:"h-4 w-4 animate-spin"}),e[25]=f,e[26]=y):y=e[26];let _;e[27]!==t.props.btnSave.title||e[28]!==at||e[29]!==y?(_=i.jsxs(jt,{variant:"green",type:"submit",className:"w-fit cursor-pointer",form:"addUserForm",disabled:at,children:[y,t.props.btnSave.title]}),e[27]=t.props.btnSave.title,e[28]=at,e[29]=y,e[30]=_):_=e[30];let j;e[31]!==_||e[32]!==w?(j=i.jsxs("div",{className:"w-full sticky z-[1001] py-4 pb-8 top-0 h-fit bg-background flex gap-4",children:[w,_]}),e[31]=_,e[32]=w,e[33]=j):j=e[33];const nt=t.props.view?"cursor-not-allowed":"";let v;e[34]!==t.props.head?(v=i.jsx("h2",{className:"font-bold text-xl",children:t.props.head}),e[34]=t.props.head,e[35]=v):v=e[35];let R;e[36]!==s?(R=(Nt=s("login"))==null?void 0:Nt.name,e[36]=s,e[37]=R):R=e[37];let T;e[38]!==s?(T=(kt=s("login"))==null?void 0:kt.label,e[38]=s,e[39]=T):T=e[39];let C;e[40]!==R||e[41]!==T?(C=i.jsx(b,{htmlFor:R,children:T}),e[40]=R,e[41]=T,e[42]=C):C=e[42];let N;e[43]!==s?(N=(Pt=s("login"))==null?void 0:Pt.name,e[43]=s,e[44]=N):N=e[44];const lt=p.login;let k;e[45]!==n?(k=l=>n("login",l.target.value),e[45]=n,e[46]=k):k=e[46];const ct=f||t.props.view;let P;e[47]!==s?(P=(St=s("login"))==null?void 0:St.label,e[47]=s,e[48]=P):P=e[48];let S;e[49]!==N||e[50]!==lt||e[51]!==k||e[52]!==ct||e[53]!==P?(S=i.jsx(He,{id:N,type:"text",required:!0,tabIndex:1,autoComplete:"username",value:lt,onChange:k,disabled:ct,placeholder:P}),e[49]=N,e[50]=lt,e[51]=k,e[52]=ct,e[53]=P,e[54]=S):S=e[54];let q;e[55]!==C||e[56]!==S?(q=i.jsxs("div",{className:"grid gap-4",children:[C,S]}),e[55]=C,e[56]=S,e[57]=q):q=e[57];let E;e[58]!==s?(E=(qt=s("fullName"))==null?void 0:qt.name,e[58]=s,e[59]=E):E=e[59];let A;e[60]!==s?(A=(Et=s("fullName"))==null?void 0:Et.label,e[60]=s,e[61]=A):A=e[61];let U;e[62]!==E||e[63]!==A?(U=i.jsx(b,{htmlFor:E,children:A}),e[62]=E,e[63]=A,e[64]=U):U=e[64];let I;e[65]!==s?(I=(At=s("fullName"))==null?void 0:At.name,e[65]=s,e[66]=I):I=e[66];const pt=p.fullName;let L;e[67]!==n?(L=l=>n("fullName",l.target.value),e[67]=n,e[68]=L):L=e[68];const dt=f||t.props.view;let B;e[69]!==s?(B=(Ut=s("fullName"))==null?void 0:Ut.label,e[69]=s,e[70]=B):B=e[70];let F;e[71]!==I||e[72]!==pt||e[73]!==L||e[74]!==dt||e[75]!==B?(F=i.jsx(He,{id:I,type:"text",required:!0,tabIndex:1,autoComplete:"additional-name",value:pt,onChange:L,disabled:dt,placeholder:B}),e[71]=I,e[72]=pt,e[73]=L,e[74]=dt,e[75]=B,e[76]=F):F=e[76];let z;e[77]!==U||e[78]!==F?(z=i.jsxs("div",{className:"grid gap-4",children:[U,F]}),e[77]=U,e[78]=F,e[79]=z):z=e[79];let O;e[80]!==s?(O=(It=s("email"))==null?void 0:It.name,e[80]=s,e[81]=O):O=e[81];let H;e[82]!==s?(H=(Lt=s("email"))==null?void 0:Lt.label,e[82]=s,e[83]=H):H=e[83];let D;e[84]!==O||e[85]!==H?(D=i.jsx(b,{htmlFor:O,children:H}),e[84]=O,e[85]=H,e[86]=D):D=e[86];let M;e[87]!==s?(M=(Bt=s("email"))==null?void 0:Bt.name,e[87]=s,e[88]=M):M=e[88];const ut=p.email;let $;e[89]!==n?($=l=>n("email",l.target.value),e[89]=n,e[90]=$):$=e[90];const ft=f||t.props.view;let J;e[91]!==s?(J=(Ft=s("email"))==null?void 0:Ft.label,e[91]=s,e[92]=J):J=e[92];let V;e[93]!==M||e[94]!==ut||e[95]!==$||e[96]!==ft||e[97]!==J?(V=i.jsx(He,{id:M,type:"email",required:!0,tabIndex:1,autoComplete:"email",value:ut,onChange:$,disabled:ft,placeholder:J}),e[93]=M,e[94]=ut,e[95]=$,e[96]=ft,e[97]=J,e[98]=V):V=e[98];let W;e[99]!==D||e[100]!==V?(W=i.jsxs("div",{className:"grid gap-4",children:[D,V]}),e[99]=D,e[100]=V,e[101]=W):W=e[101];let K;e[102]!==q||e[103]!==z||e[104]!==W?(K=i.jsxs("div",{className:"basis-1/2 flex flex-col gap-6",children:[q,z,W]}),e[102]=q,e[103]=z,e[104]=W,e[105]=K):K=e[105];let X;e[106]!==s?(X=(zt=s("timezone"))==null?void 0:zt.name,e[106]=s,e[107]=X):X=e[107];let Y;e[108]!==s?(Y=(Ot=s("timezone"))==null?void 0:Ot.label,e[108]=s,e[109]=Y):Y=e[109];let G;e[110]!==X||e[111]!==Y?(G=i.jsx(b,{htmlFor:X,children:Y}),e[110]=X,e[111]=Y,e[112]=G):G=e[112];let Q;e[113]!==n?(Q=l=>n("timezone",l),e[113]=n,e[114]=Q):Q=e[114];const ht=p.timezone,mt=f||t.props.view;let Z;e[115]!==s?(Z=(Ht=s("timezone"))==null?void 0:Ht.name,e[115]=s,e[116]=Z):Z=e[116];let ee;e[117]!==Z?(ee=i.jsx(hs,{className:"w-full cursor-pointer",children:i.jsx(ms,{placeholder:Z})}),e[117]=Z,e[118]=ee):ee=e[118];let te;e[119]!==r?(te=r??[],e[119]=r,e[120]=te):te=e[120];let se;e[121]!==te?(se=te.map(nr),e[121]=te,e[122]=se):se=e[122];let re;e[123]!==se?(re=i.jsx(bs,{children:se}),e[123]=se,e[124]=re):re=e[124];let oe;e[125]!==Q||e[126]!==ht||e[127]!==mt||e[128]!==ee||e[129]!==re?(oe=i.jsxs(fs,{onValueChange:Q,defaultValue:ht,disabled:mt,children:[ee,re]}),e[125]=Q,e[126]=ht,e[127]=mt,e[128]=ee,e[129]=re,e[130]=oe):oe=e[130];let ie;e[131]!==G||e[132]!==oe?(ie=i.jsxs("div",{className:"grid gap-4",children:[G,oe]}),e[131]=G,e[132]=oe,e[133]=ie):ie=e[133];let ae;e[134]!==p.date||e[135]!==s||e[136]!==n||e[137]!==f?(ae=s("date")&&i.jsxs("div",{className:"grid gap-4",children:[i.jsx(b,{htmlFor:(Dt=s("date"))==null?void 0:Dt.name,children:(Mt=s("date"))==null?void 0:Mt.label}),i.jsx(He,{id:($t=s("date"))==null?void 0:$t.name,type:"date",className:"max-w-fit",tabIndex:1,value:p.date,onChange:l=>n("date",l.target.value),disabled:f})]}),e[134]=p.date,e[135]=s,e[136]=n,e[137]=f,e[138]=ae):ae=e[138];let ne;e[139]!==p.isAdmin||e[140]!==s||e[141]!==n||e[142]!==t.props.view||e[143]!==f?(ne=s("isAdmin")&&i.jsxs("div",{className:"grid gap-4",children:[i.jsx(b,{className:"cursor-pointer",htmlFor:(Jt=s("isAdmin"))==null?void 0:Jt.name,children:(Vt=s("isAdmin"))==null?void 0:Vt.label}),i.jsx(vt,{id:(Wt=s("isAdmin"))==null?void 0:Wt.name,className:"cursor-pointer size-5",disabled:f||t.props.view,checked:p.isAdmin,onCheckedChange:l=>n("isAdmin",l)})]}),e[139]=p.isAdmin,e[140]=s,e[141]=n,e[142]=t.props.view,e[143]=f,e[144]=ne):ne=e[144];let le;e[145]!==p.isConfirmed||e[146]!==s||e[147]!==n||e[148]!==t.props.view||e[149]!==f?(le=s("isConfirmed")&&i.jsxs("div",{className:"grid gap-4",children:[i.jsx(b,{className:"cursor-pointer",htmlFor:(Kt=s("isConfirmed"))==null?void 0:Kt.name,children:(Xt=s("isConfirmed"))==null?void 0:Xt.label}),i.jsx(vt,{id:(Yt=s("isConfirmed"))==null?void 0:Yt.name,className:"cursor-pointer size-5",disabled:f||t.props.view,checked:p.isConfirmed,onCheckedChange:l=>n("isConfirmed",l)})]}),e[145]=p.isConfirmed,e[146]=s,e[147]=n,e[148]=t.props.view,e[149]=f,e[150]=le):le=e[150];let ce;e[151]!==ne||e[152]!==le?(ce=i.jsxs("div",{className:"flex gap-6",children:[ne,le]}),e[151]=ne,e[152]=le,e[153]=ce):ce=e[153];let pe;e[154]!==ae||e[155]!==ce?(pe=i.jsxs("div",{className:"flex flex-col md:flex-row justify-start gap-4 xl:justify-between items-start md:items-center",children:[ae,ce]}),e[154]=ae,e[155]=ce,e[156]=pe):pe=e[156];let de;e[157]!==p.locale||e[158]!==s||e[159]!==n||e[160]!==t.props.locales||e[161]!==t.props.view||e[162]!==f?(de=s("locale")&&i.jsxs("div",{className:"grid gap-4",children:[i.jsx(b,{htmlFor:(Gt=s("locale"))==null?void 0:Gt.name,children:(Qt=s("locale"))==null?void 0:Qt.label}),i.jsxs(fs,{onValueChange:l=>n("locale",l),defaultValue:p.locale,disabled:f||t.props.view,children:[i.jsx(hs,{className:"w-full cursor-pointer",children:i.jsx(ms,{placeholder:(Zt=s("locale"))==null?void 0:Zt.name})}),i.jsx(bs,{children:(t.props.locales??[]).map(ar)})]})]}),e[157]=p.locale,e[158]=s,e[159]=n,e[160]=t.props.locales,e[161]=t.props.view,e[162]=f,e[163]=de):de=e[163];let ue;e[164]!==ie||e[165]!==pe||e[166]!==de?(ue=i.jsxs("div",{className:"basis-1/2 flex flex-col gap-6",children:[ie,pe,de]}),e[164]=ie,e[165]=pe,e[166]=de,e[167]=ue):ue=e[167];let fe;e[168]!==K||e[169]!==ue?(fe=i.jsxs("div",{className:"flex-col xl:flex-row flex gap-16",children:[K,ue]}),e[168]=K,e[169]=ue,e[170]=fe):fe=e[170];let he;e[171]!==u.user.isAdministrator||e[172]!==p.login||e[173]!==t.props.userPretend?(he=u.user.isAdministrator&&i.jsx(jt,{className:"w-fit",asChild:!0,variant:"outline",children:i.jsxs(ds,{href:t.props.userPretend.postLink,method:"post",data:{login:p.login,pretend:!0},children:[i.jsx(Ls,{name:"masks",className:"!text-[18px]"}),t.props.userPretend.label]})}),e[171]=u.user.isAdministrator,e[172]=p.login,e[173]=t.props.userPretend,e[174]=he):he=e[174];let me;e[175]!==s?(me=(es=s("userPassword"))==null?void 0:es.label,e[175]=s,e[176]=me):me=e[176];let be;e[177]!==me?(be=i.jsx("label",{className:"font-bold text-xl",children:me}),e[177]=me,e[178]=be):be=e[178];let Ye;e[179]===Symbol.for("react.memo_cache_sentinel")?(Ye=i.jsx(qs,{onClick:ir,children:i.jsx(us,{iconNode:Fs,className:"text-primary w-5 h-5 cursor-pointer"})}),e[179]=Ye):Ye=e[179];let ge;e[180]!==s?(ge=(ts=s("userPassword"))==null?void 0:ts.tooltip,e[180]=s,e[181]=ge):ge=e[181];let xe;e[182]!==ge?(xe=i.jsx(Es,{children:i.jsxs(As,{children:[Ye,i.jsx(Us,{align:"center",side:"top",children:i.jsx("p",{children:ge})})]})}),e[182]=ge,e[183]=xe):xe=e[183];let we;e[184]!==be||e[185]!==xe?(we=i.jsxs("div",{className:"flex gap-3",children:[be,xe]}),e[184]=be,e[185]=xe,e[186]=we):we=e[186];let ye;e[187]!==s?(ye=(ss=s("userPassword"))==null?void 0:ss.name,e[187]=s,e[188]=ye):ye=e[188];let _e;e[189]!==s?(_e=(rs=s("userPassword"))==null?void 0:rs.label,e[189]=s,e[190]=_e):_e=e[190];let je;e[191]!==ye||e[192]!==_e?(je=i.jsx(b,{htmlFor:ye,children:_e}),e[191]=ye,e[192]=_e,e[193]=je):je=e[193];let ve;e[194]!==s?(ve=(os=s("userPassword"))==null?void 0:os.name,e[194]=s,e[195]=ve):ve=e[195];const bt=!t.props.edit,gt=p.password;let Re;e[196]!==n?(Re=l=>n("userPassword",l.target.value),e[196]=n,e[197]=Re):Re=e[197];const xt=f||t.props.view;let Te;e[198]!==s?(Te=(is=s("userPassword"))==null?void 0:is.label,e[198]=s,e[199]=Te):Te=e[199];let Ce;e[200]!==ve||e[201]!==bt||e[202]!==gt||e[203]!==Re||e[204]!==xt||e[205]!==Te?(Ce=i.jsx(He,{id:ve,type:"password",required:bt,tabIndex:1,autoComplete:"new-password",value:gt,onChange:Re,disabled:xt,placeholder:Te}),e[200]=ve,e[201]=bt,e[202]=gt,e[203]=Re,e[204]=xt,e[205]=Te,e[206]=Ce):Ce=e[206];let Ne;e[207]!==je||e[208]!==Ce?(Ne=i.jsxs("div",{className:"grid gap-4 col-span-1",children:[je,Ce]}),e[207]=je,e[208]=Ce,e[209]=Ne):Ne=e[209];let ke;e[210]!==s?(ke=(as=s("repeatUserPassword"))==null?void 0:as.name,e[210]=s,e[211]=ke):ke=e[211];let Pe;e[212]!==s?(Pe=(ns=s("repeatUserPassword"))==null?void 0:ns.label,e[212]=s,e[213]=Pe):Pe=e[213];let Se;e[214]!==ke||e[215]!==Pe?(Se=i.jsx(b,{htmlFor:ke,children:Pe}),e[214]=ke,e[215]=Pe,e[216]=Se):Se=e[216];let qe;e[217]!==s?(qe=(ls=s("repeatUserPassword"))==null?void 0:ls.name,e[217]=s,e[218]=qe):qe=e[218];const wt=!t.props.edit,yt=p.repeatUserPassword;let Ee;e[219]!==n?(Ee=l=>n("repeatUserPassword",l.target.value),e[219]=n,e[220]=Ee):Ee=e[220];const _t=f||t.props.view;let Ae;e[221]!==s?(Ae=(cs=s("repeatUserPassword"))==null?void 0:cs.label,e[221]=s,e[222]=Ae):Ae=e[222];let Ue;e[223]!==qe||e[224]!==wt||e[225]!==yt||e[226]!==Ee||e[227]!==_t||e[228]!==Ae?(Ue=i.jsx(He,{id:qe,type:"password",required:wt,tabIndex:1,autoComplete:"new-password",value:yt,onChange:Ee,disabled:_t,placeholder:Ae}),e[223]=qe,e[224]=wt,e[225]=yt,e[226]=Ee,e[227]=_t,e[228]=Ae,e[229]=Ue):Ue=e[229];let Ie;e[230]!==tt.repeatUserPassword?(Ie=i.jsx(Is,{message:tt.repeatUserPassword}),e[230]=tt.repeatUserPassword,e[231]=Ie):Ie=e[231];let Le;e[232]!==Se||e[233]!==Ue||e[234]!==Ie?(Le=i.jsxs("div",{className:"grid gap-4 col-span-1 col-start-1",children:[Se,Ue,Ie]}),e[232]=Se,e[233]=Ue,e[234]=Ie,e[235]=Le):Le=e[235];let Be;e[236]!==Ne||e[237]!==Le?(Be=i.jsxs("div",{className:"grid grid-col-1 lg:grid-cols-2 grid-rows-2 gap-x-16 gap-y-6",children:[Ne,Le]}),e[236]=Ne,e[237]=Le,e[238]=Be):Be=e[238];let Fe;e[239]!==p||e[240]!==n||e[241]!==t.props.groupHead||e[242]!==t.props.groups||e[243]!==t.props.view||e[244]!==f?(Fe=t.props.groups.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:"font-bold text-xl",children:t.props.groupHead}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-5 xl:grid-cols-6 gap-4",children:t.props.groups.map(l=>i.jsxs("div",{className:"grid gap-4",children:[i.jsx(b,{className:"cursor-pointer",htmlFor:l.name,children:l.label}),i.jsx(vt,{id:l.name,disabled:f||t.props.view,className:"cursor-pointer size-5",checked:p[l.name],onCheckedChange:x=>n(l.name,x)})]},l.name))})]}),e[239]=p,e[240]=n,e[241]=t.props.groupHead,e[242]=t.props.groups,e[243]=t.props.view,e[244]=f,e[245]=Fe):Fe=e[245];let ze;e[246]!==v||e[247]!==fe||e[248]!==he||e[249]!==we||e[250]!==Be||e[251]!==Fe?(ze=i.jsxs("div",{className:"flex flex-col gap-10 max-w-[1144px]",children:[v,fe,he,we,Be,Fe]}),e[246]=v,e[247]=fe,e[248]=he,e[249]=we,e[250]=Be,e[251]=Fe,e[252]=ze):ze=e[252];let Oe;e[253]!==it||e[254]!==ze||e[255]!==nt?(Oe=i.jsx("form",{id:"addUserForm",onSubmit:it,className:nt,children:ze}),e[253]=it,e[254]=ze,e[255]=nt,e[256]=Oe):Oe=e[256];let Ge;return e[257]!==Oe||e[258]!==j?(Ge=i.jsxs("div",{className:"flex h-full flex-1 flex-col gap-4 rounded-xl p-4",children:[j,Oe]}),e[257]=Oe,e[258]=j,e[259]=Ge):Ge=e[259],Ge}function ir(e){return e.preventDefault()}function ar(e){return i.jsx(ys,{value:e.value,children:e.label},e.value)}function nr(e){return i.jsx(ys,{value:e.value,children:e.label},e.value)}function lr(e){return[e.name,e.value]}function cr(e){return[e.name,e.value]}export{Br as default};