adminizer 4.6.0-build.205 → 4.6.0-build.207
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{DiffViewer-B36sF5l-.js → DiffViewer-BpSpxX-x.js} +1 -1
- package/assets/add-BP2bkvcF.js +1 -0
- package/assets/{add-form-BdmoVC_G.js → add-form-B39ytLc3.js} +1 -1
- package/assets/add-group-DQi0lc1e.js +1 -0
- package/assets/add-user-CNcCmpvV.js +1 -0
- package/assets/{app-layout-BbIIJVA5.js → app-layout-Bubi-NT8.js} +1 -1
- package/assets/{app-sidebar-CtgnXD3n.js → app-sidebar-Dbgnlkew.js} +1 -1
- package/assets/app-sidebar-header-C3yisT8p.js +1 -0
- package/assets/app.js +2 -2
- package/assets/{breadcrumbs-Df-vVsyM.js → breadcrumbs-CZZirDj8.js} +1 -1
- package/assets/{catalog-Dksg6Ktq.js → catalog-Ca9RdLCZ.js} +1 -1
- package/assets/{dashboard-Dju1w--H.js → dashboard-Bcz5b5w6.js} +1 -1
- package/assets/{field-renderer-C1uKgcGe.js → field-renderer-BMcYzyqF.js} +3 -3
- package/assets/form-Biwt3wOg.js +1 -0
- package/assets/{form-BjOpJfcr.js → form-CivHwW3U.js} +1 -1
- package/assets/{history-DxIi7yPY.js → history-DNn4VfTF.js} +1 -1
- package/assets/{home-BUSE07NY.js → home-BaGz7nwT.js} +2 -2
- package/assets/list-dmqGUjt-.js +1 -0
- package/assets/{list-table-DSRvmzBT.js → list-table-a2bIPh90.js} +3 -3
- package/assets/manifest.json +70 -70
- package/assets/{media-manager-Bf7A7-jv.js → media-manager-CFiru23k.js} +1 -1
- package/assets/{module-3NsdEr7f.js → module-B9a_e2wR.js} +1 -1
- package/assets/nav-footer-TGTgvr59.js +1 -0
- package/assets/{nav-main-DcvkRp44.js → nav-main-CVTsAC3C.js} +1 -1
- package/assets/{nav-user-PtK5V1sV.js → nav-user-F0xzKfK7.js} +1 -1
- package/assets/{notification-BNz2iBvD.js → notification-DYPjSRl4.js} +1 -1
- package/assets/{pagination-render-B5A4YOfb.js → pagination-render-40Bk8JSz.js} +1 -1
- package/assets/{theme-switcher-Ca0SixmO.js → theme-switcher-Jo-h4C2M.js} +1 -1
- package/assets/{user-info-BTJNUzpi.js → user-info-D2tUt2LU.js} +1 -1
- package/assets/{user-menu-content-DUnYpt8t.js → user-menu-content-C9xtndj8.js} +1 -1
- package/assets/{welcome-DtWHDtJz.js → welcome-BDZq6wiw.js} +1 -1
- package/helpers/menuHelper.d.ts +3 -6
- package/helpers/menuHelper.js +32 -19
- package/interfaces/adminpanelConfig.d.ts +13 -1
- package/package.json +1 -1
- package/system/Router.js +29 -0
- package/assets/add-B8GYr9Sn.js +0 -1
- package/assets/add-group-D-oqZjnR.js +0 -1
- package/assets/add-user-CVjGIJe8.js +0 -1
- package/assets/app-sidebar-header-C8sntqs3.js +0 -1
- package/assets/form-C7LRXfge.js +0 -1
- package/assets/list-B6iLj8LH.js +0 -1
- package/assets/nav-footer-Q8fVAK6n.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,E as f,aA as t,
|
|
1
|
+
import{j as e,E as f,aA as t,bM as n,P as b,bN as g,aG as v}from"./app.js";import{e as p}from"./handsontable-PxYdjN8c.js";const N=({changes:s,title:a="Changes",className:i=""})=>{if(!s||s.length===0)return e.jsx("div",{className:t("bg-muted border border-border rounded-lg p-4",i),children:e.jsxs("div",{className:"flex items-center text-muted-foreground",children:[e.jsx(f,{className:"w-5 h-5 mr-2"}),e.jsx("span",{children:"Changes not found"})]})});const o=r=>r===null?"null":r===void 0?"—":typeof r=="boolean"?r?"Да":"Нет":typeof r=="object"?JSON.stringify(r):String(r),m=r=>r.oldValue===void 0?"added":r.newValue===void 0?"removed":"modified";return e.jsxs("div",{className:t("bg-card border border-border rounded-lg shadow-sm",i),children:[e.jsx("div",{className:"px-4 py-3 border-b border-border bg-muted",children:e.jsxs("h3",{className:"text-lg font-semibold text-card-foreground flex items-center",children:[e.jsx(n,{className:"w-5 h-5 mr-2"}),a," (",s.length,")"]})}),e.jsx("div",{className:"divide-y divide-border",children:s.map((r,l)=>{const d=m(r),c=d==="added"?b:d==="removed"?g:n,x=t("text-xs px-2 py-1 rounded-full bg-opacity-10",d==="added"&&"text-green-600 bg-green-100",d==="removed"&&"text-destructive bg-destructive/20",d==="modified"&&"text-primary bg-primary/20"),u=d==="added"?"text-green-600":d==="removed"?"text-destructive":"text-primary";return e.jsxs("div",{className:"p-4 hover:bg-muted/50 transition-colors",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center",children:[p.createElement(c,{className:t("w-4 h-4 mr-2",u)}),e.jsx("span",{className:"font-medium text-card-foreground",children:r.field})]}),e.jsx("span",{className:x,children:d==="added"?"Added":d==="removed"?"Removed":"Updated"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm",children:[d!=="added"&&e.jsxs("div",{className:"p-2 bg-destructive/10 border border-destructive/20 rounded",children:[e.jsx("div",{className:"text-xs text-destructive font-medium mb-1",children:"Old:"}),e.jsx("div",{className:"text-destructive-foreground font-mono break-words",children:o(r.oldValue)})]}),d!=="removed"&&e.jsxs("div",{className:"p-2 bg-green-50 border border-green-100 rounded",children:[e.jsx("div",{className:"text-xs text-green-600 font-medium mb-1",children:"New:"}),e.jsx("div",{className:"text-green-800 font-mono break-words",children:o(r.newValue)})]})]}),d==="modified"&&e.jsxs("div",{className:"mt-2 flex items-center text-xs text-muted-foreground",children:[e.jsx(v,{className:"w-3 h-3 mr-1"}),"changed type: ",r.type]})]},l)})})]})};export{N as D};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as t,j as o}from"./app.js";import{A as m}from"./app-layout-Bubi-NT8.js";import p from"./add-form-B39ytLc3.js";import"./jsoneditor-De1FvcYu.js";import"./handsontable-PxYdjN8c.js";import"./monaco-BhBYtg3d.js";import"./app-shell-DbPu3ZPM.js";import"./app-sidebar-Dbgnlkew.js";import"./nav-main-CVTsAC3C.js";import"./material-icon-BXxpxGAd.js";import"./app-sidebar-header-C3yisT8p.js";import"./breadcrumbs-CZZirDj8.js";import"./nav-user-F0xzKfK7.js";import"./user-info-D2tUt2LU.js";import"./user-menu-content-C9xtndj8.js";import"./theme-switcher-Jo-h4C2M.js";import"./icon-BTIjB9Wk.js";import"./field-renderer-BMcYzyqF.js";import"./dynamic-controls-k61T9W2P.js";import"./input-error-CSrUHo1P.js";import"./DiffViewer-BpSpxX-x.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{u as se,j as e,a5 as te,a6 as re,a7 as E,a8 as D,a9 as ae,aa as k,L,B as C,ab as ne,ac as ie,ad as oe,ae as le,af as ce,h as H,D as de,i as ue,k as me,l as pe,aj as he,bG as U,ai as xe,aS as fe,bH as _,bI as q,g as G,b as $,M as ge,N as je,O as ve,aT as ye,Q as be,m as we}from"./app.js";import{r as c}from"./handsontable-PxYdjN8c.js";import{Icon as W}from"./icon-BTIjB9Wk.js";import{F as X}from"./field-renderer-C1uKgcGe.js";import J from"./input-error-CSrUHo1P.js";import{D as Ne}from"./DiffViewer-B36sF5l-.js";import"./jsoneditor-De1FvcYu.js";import"./monaco-BhBYtg3d.js";import"./dynamic-controls-k61T9W2P.js";var z=new Map,T=new WeakMap,K=0,Se=void 0;function ke(s){return s?(T.has(s)||(K+=1,T.set(s,K.toString())),T.get(s)):"0"}function Ce(s){return Object.keys(s).sort().filter(r=>s[r]!==void 0).map(r=>`${r}_${r==="root"?ke(s.root):s[r]}`).toString()}function De(s){const r=Ce(s);let n=z.get(r);if(!n){const l=new Map;let x;const u=new IntersectionObserver(d=>{d.forEach(i=>{var p;const b=i.isIntersecting&&x.some(m=>i.intersectionRatio>=m);s.trackVisibility&&typeof i.isVisible>"u"&&(i.isVisible=b),(p=l.get(i.target))==null||p.forEach(m=>{m(b,i)})})},s);x=u.thresholds||(Array.isArray(s.threshold)?s.threshold:[s.threshold||0]),n={id:r,observer:u,elements:l},z.set(r,n)}return n}function Fe(s,r,n={},l=Se){if(typeof window.IntersectionObserver>"u"&&l!==void 0){const p=s.getBoundingClientRect();return r(l,{isIntersecting:l,target:s,intersectionRatio:typeof n.threshold=="number"?n.threshold:0,time:0,boundingClientRect:p,intersectionRect:p,rootBounds:p}),()=>{}}const{id:x,observer:u,elements:d}=De(n),i=d.get(s)||[];return d.has(s)||d.set(s,i),i.push(r),u.observe(s),function(){i.splice(i.indexOf(r),1),i.length===0&&(d.delete(s),u.unobserve(s)),d.size===0&&(u.disconnect(),z.delete(x))}}function Ie({threshold:s,delay:r,trackVisibility:n,rootMargin:l,root:x,triggerOnce:u,skip:d,initialInView:i,fallbackInView:p,onChange:b}={}){var m;const[v,N]=c.useState(null),f=c.useRef(b),[S,h]=c.useState({inView:!!i,entry:void 0});f.current=b,c.useEffect(()=>{if(d||!v)return;let g;return g=Fe(v,(F,y)=>{h({inView:F,entry:y}),f.current&&f.current(F,y),y.isIntersecting&&u&&g&&(g(),g=void 0)},{root:x,rootMargin:l,threshold:s,trackVisibility:n,delay:r},p),()=>{g&&g()}},[Array.isArray(s)?s.toString():s,v,x,l,u,d,n,p,r]);const a=(m=S.entry)==null?void 0:m.target,o=c.useRef(void 0);!v&&a&&!u&&!d&&o.current!==a&&(o.current=a,h({inView:!!i,entry:void 0}));const w=[N,S.inView,S.entry];return w.ref=w[0],w.inView=w[1],w.entry=w[2],w}const Ee=({modelName:s,modelId:r,handleWatchHistory:n})=>{const[l,x]=c.useState([]),[u,d]=c.useState(!1),[i,p]=c.useState(null),[b,m]=c.useState(!0),v=se(),N="currentHistoryView",f=v.props.historyTableMessages;c.useEffect(()=>{(async()=>{m(!0);try{const o=await H.post(`${window.routePrefix}/history/get-model-history`,{modelName:s,modelId:r});o.data.data&&x(o.data.data)}catch(o){console.log(o)}finally{m(!1)}})()},[s,r]);const S=async a=>{try{const o=await H.post(`${window.routePrefix}/history/get-model-fields`,{historyId:a});o.data.data&&(localStorage.setItem(N,a.toString()),n(o.data.data))}catch(o){console.log(o)}},h=a=>{const o=localStorage.getItem(N);return o?o===a.id.toString():a.isCurrent};return e.jsx("div",{className:"relative h-full",children:e.jsxs("div",{className:"h-full overflow-y-auto mt-5 pr-5",children:[e.jsxs(te,{wrapperHeight:"max-h-full",children:[e.jsx(re,{className:"sticky top-0 bg-background shadow",children:e.jsxs(E,{children:[e.jsx(D,{className:"p-2 text-left",children:f.Date}),e.jsx(D,{className:"p-2 text-left",children:f.Event}),e.jsx(D,{className:"p-2 text-left",children:f.User}),e.jsx(D,{className:"p-2 text-left",children:"Diff"}),e.jsx(D,{className:"p-2 text-left"})]})}),e.jsx(ae,{children:b?e.jsx(E,{children:e.jsx(k,{colSpan:5,className:"p-10 text-center",children:e.jsx(L,{className:"mx-auto size-8 animate-spin"})})}):l.length>0?l.map(a=>e.jsxs(E,{children:[e.jsx(k,{className:"p-2 self-start pt-2.5",children:new Date(a.createdAt).toLocaleString()}),e.jsx(k,{className:"p-2 self-start pt-2.5 capitalize",children:a.action}),e.jsx(k,{className:"p-2 self-start pt-2.5 max-w-[250px] whitespace-break-spaces",children:e.jsx("div",{className:"max-w-[500px] whitespace-break-spaces font-medium text-chart-3",children:a.user.login})}),e.jsx(k,{className:"p-2 align-middle",children:e.jsx(C,{variant:"green",size:"sm",onClick:()=>{p(a.diff),d(!0)},children:e.jsx(ne,{})})}),e.jsx(k,{className:"p-2 align-middle text-center",children:h(a)?e.jsx("span",{className:"font-medium",children:f.Current}):e.jsx(C,{variant:"outline",size:"sm",onClick:()=>S(a.id),children:f.Watch})})]},a.id)):e.jsx(E,{children:e.jsx(k,{colSpan:5,className:"p-4 text-center font-medium text-muted-foreground",children:f["There is no history"]})})})]}),e.jsx(ie,{open:u,onOpenChange:a=>{d(a),a||setTimeout(()=>{document.body.removeAttribute("style")},300)},children:e.jsxs(oe,{className:"z-[1022] sm:max-w-[60vw]",children:[e.jsx(le,{children:e.jsx(ce,{children:"Diff"})}),e.jsx(Ne,{changes:i,className:"max-h-[80vh] overflow-auto sm:max-w-[60vw] w-full"})]})})]})})},Te=({dialogRef:s,modelId:r,modelName:n,callback:l})=>e.jsxs(de,{ref:s,children:[e.jsx(ue,{}),e.jsx(me,{children:e.jsx(pe,{children:e.jsx(Ee,{modelId:r,modelName:n,handleWatchHistory:l})})})]}),Q=c.memo(({field:s})=>!s||typeof s!="object"||!s.label?(console.error("Invalid field for LabelRenderer:",s),null):e.jsxs("div",{className:"flex gap-3",children:[e.jsx($,{htmlFor:`${s.type}-${s.name}`,children:s.label}),s.tooltip&&e.jsx(ge,{children:e.jsxs(je,{children:[e.jsx(ve,{onClick:r=>r.preventDefault(),children:e.jsx(W,{iconNode:ye,className:"text-primary w-5 h-5 cursor-pointer"})}),e.jsx(be,{align:"center",side:"top",className:"z-1002",children:e.jsx("p",{children:s.tooltip})})]})})]})),Re=c.memo(({field:s,value:r,onChange:n,processing:l,notFound:x,search:u})=>{if(!s||typeof s!="object"||!s.name||!s.type)return console.error("Invalid field for LazyField:",s),e.jsx("div",{className:"text-red-500",children:"Error: Invalid field data"});const[d,i]=Ie({triggerOnce:!0,rootMargin:"100px 0px"});return e.jsx("div",{ref:d,className:"grid gap-4 w-full",children:i?e.jsx(X,{field:s,value:r,onChange:n,notFound:x,search:u,processing:l}):e.jsx(we,{className:"w-full h-[250px] rounded-sm"})})}),Me=({page:s,catalog:r,callback:n,openNewWindow:l,openNewWindowLabel:x,isNavigation:u,DnavVisible:d,visibleLable:i})=>{var M;const{btnBack:p,btnHistory:b,view:m,edit:v,history:N,notFound:f,model:S,fields:h}=s.props,{data:a,setData:o,post:w,processing:g,transform:F}=he({...Object.fromEntries((h||[]).map(t=>[t.name,t.value??void 0])),jsonPopupCatalog:r}),[y,Y]=c.useState(!1),[B,O]=c.useState(l??!1),[V,Z]=c.useState(d??!1),R=c.useRef(null);c.useEffect(()=>{localStorage.removeItem("currentHistoryView")},[]),c.useEffect(()=>(O(l??!1),U(),o({...Object.fromEntries((h||[]).map(t=>[t.name,(t.type==="mediamanager"||t.type==="single-file")&&(t.value===null||t.value===void 0)?[]:t.value])),jsonPopupCatalog:r}),()=>U()),[h,r,l,o]);const A=c.useCallback((t,j)=>{o(t,j)},[o]);if(!Array.isArray(h))return console.error("Fields is not an array:",h),e.jsx("div",{className:"p-4 text-red-500",children:"Error: Fields data is invalid"});if(h.length===0)return console.warn("Fields array is empty"),e.jsx("div",{className:"p-4 text-gray-500",children:"No fields to display"});const P=h.filter(t=>!t||typeof t!="object"||!t.name||!t.type||!t.label);if(P.length>0)return console.error("Invalid fields found:",P),e.jsx("div",{className:"p-4 text-red-500",children:"Error: Some fields are missing required properties (name, type, label)"});const ee=async t=>{if(t.preventDefault(),r){Y(!0);const j=await H.post(s.props.postLink,a);j.status===200&&n&&(u?n(j.data.record,B,V):n(j.data.record))}else{const j=localStorage.getItem("backUrl");F(I=>({...I,redirectUrl:j??""})),w(s.props.postLink,{onSuccess:()=>{localStorage.setItem("backUrl","")}})}};return e.jsxs("div",{className:"p-4 w-full",children:[!r&&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:"w-fit",asChild:!0,children:e.jsxs(xe,{href:p.link,preserveScroll:!0,children:[e.jsx(W,{iconNode:fe}),p.title]})}),e.jsxs(C,{variant:"green",type:"submit",className:"w-fit lg:hidden",form:"addUserForm",disabled:y||g||s.props.view||_(),children:[y||g&&e.jsx(L,{className:"h-4 w-4 animate-spin"}),s.props.btnSave.title]})]}),e.jsx("form",{id:"addUserForm",onSubmit:ee,className:m?"cursor-not-allowed":"",children:e.jsxs("div",{className:"grid gap-4 max-w-286 pb-8 lg:grid-cols-[1fr_220px]",children:[e.jsx("div",{className:"flex flex-col gap-10",children:h.map(t=>e.jsx("div",{className:`grid gap-4 w-full ${m?"pointer-events-none":""}`,children:t.type==="markdown"||t.type==="table"||t.type==="jsonEditor"||t.type==="codeEditor"||t.type==="geoJson"?e.jsxs(e.Fragment,{children:[e.jsx(Q,{field:t}),e.jsx(J,{message:q(`${t.type}-${t.name}`)}),e.jsx(Re,{field:t,value:a[t.name],onChange:A,processing:y||g||m,notFound:f,search:s.props.search})]}):e.jsxs(e.Fragment,{children:[e.jsx(Q,{field:t}),e.jsx(J,{message:q(`${t.type}-${t.name}`)}),e.jsx(X,{field:t,value:a[t.name],onChange:A,processing:y||g||m,notFound:f,search:s.props.search})]})},t.name))}),e.jsxs("div",{className:`p-4 rounded-md h-fit sticky shadow ${r?"top-0 grid gap-4":"top-[84px] hidden lg:block"}`,children:[u&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-4 items-center",children:[e.jsx(G,{id:"targetBlank",checked:B,onCheckedChange:t=>O(!!t),className:"cursor-pointer size-5"}),e.jsx($,{htmlFor:"targetBlank",children:x})]}),e.jsxs("div",{className:"flex gap-4 items-center",children:[e.jsx(G,{id:"visible",checked:V,onCheckedChange:t=>Z(!!t),className:"cursor-pointer size-5"}),e.jsx($,{htmlFor:"visible",children:i})]})]}),e.jsxs("div",{className:`flex gap-2 ${N&&(v||m)?"justify-center":"justify-start"}`,children:[e.jsxs(C,{variant:"green",type:"submit",className:"w-fit",disabled:y||g||s.props.view||_(),children:[(y||g)&&e.jsx(L,{className:"h-4 w-4 animate-spin"}),s.props.btnSave.title]}),N&&(v||m)&&e.jsx(C,{variant:"outline",className:"w-fit",onClick:t=>{var j;t.preventDefault(),(j=R.current)==null||j.open()},children:b.title})]})]})]})}),N&&(v||m)&&e.jsx(Te,{dialogRef:R,modelName:S,modelId:(M=h.find(t=>t.name==="id"))==null?void 0:M.value,callback:t=>{var j;for(const I of Object.keys(t))o(I,t[I]);(j=R.current)==null||j.close()}})]})};export{Q as LabelRenderer,Re as LazyField,Me as default};
|
|
1
|
+
import{u as se,j as e,a5 as te,a6 as re,a7 as E,a8 as D,a9 as ae,aa as k,L,B as C,ab as ne,ac as ie,ad as oe,ae as le,af as ce,h as H,D as de,i as ue,k as me,l as pe,aj as he,bH as U,ai as xe,aS as fe,bI as _,bJ as J,g as q,b as $,M as ge,N as je,O as ve,aT as ye,Q as be,m as we}from"./app.js";import{r as c}from"./handsontable-PxYdjN8c.js";import{Icon as G}from"./icon-BTIjB9Wk.js";import{F as X}from"./field-renderer-BMcYzyqF.js";import K from"./input-error-CSrUHo1P.js";import{D as Ne}from"./DiffViewer-BpSpxX-x.js";import"./jsoneditor-De1FvcYu.js";import"./monaco-BhBYtg3d.js";import"./dynamic-controls-k61T9W2P.js";var z=new Map,T=new WeakMap,Q=0,Se=void 0;function ke(s){return s?(T.has(s)||(Q+=1,T.set(s,Q.toString())),T.get(s)):"0"}function Ce(s){return Object.keys(s).sort().filter(r=>s[r]!==void 0).map(r=>`${r}_${r==="root"?ke(s.root):s[r]}`).toString()}function De(s){const r=Ce(s);let n=z.get(r);if(!n){const l=new Map;let x;const u=new IntersectionObserver(d=>{d.forEach(i=>{var p;const b=i.isIntersecting&&x.some(m=>i.intersectionRatio>=m);s.trackVisibility&&typeof i.isVisible>"u"&&(i.isVisible=b),(p=l.get(i.target))==null||p.forEach(m=>{m(b,i)})})},s);x=u.thresholds||(Array.isArray(s.threshold)?s.threshold:[s.threshold||0]),n={id:r,observer:u,elements:l},z.set(r,n)}return n}function Fe(s,r,n={},l=Se){if(typeof window.IntersectionObserver>"u"&&l!==void 0){const p=s.getBoundingClientRect();return r(l,{isIntersecting:l,target:s,intersectionRatio:typeof n.threshold=="number"?n.threshold:0,time:0,boundingClientRect:p,intersectionRect:p,rootBounds:p}),()=>{}}const{id:x,observer:u,elements:d}=De(n),i=d.get(s)||[];return d.has(s)||d.set(s,i),i.push(r),u.observe(s),function(){i.splice(i.indexOf(r),1),i.length===0&&(d.delete(s),u.unobserve(s)),d.size===0&&(u.disconnect(),z.delete(x))}}function Ie({threshold:s,delay:r,trackVisibility:n,rootMargin:l,root:x,triggerOnce:u,skip:d,initialInView:i,fallbackInView:p,onChange:b}={}){var m;const[v,N]=c.useState(null),f=c.useRef(b),[S,h]=c.useState({inView:!!i,entry:void 0});f.current=b,c.useEffect(()=>{if(d||!v)return;let g;return g=Fe(v,(F,y)=>{h({inView:F,entry:y}),f.current&&f.current(F,y),y.isIntersecting&&u&&g&&(g(),g=void 0)},{root:x,rootMargin:l,threshold:s,trackVisibility:n,delay:r},p),()=>{g&&g()}},[Array.isArray(s)?s.toString():s,v,x,l,u,d,n,p,r]);const a=(m=S.entry)==null?void 0:m.target,o=c.useRef(void 0);!v&&a&&!u&&!d&&o.current!==a&&(o.current=a,h({inView:!!i,entry:void 0}));const w=[N,S.inView,S.entry];return w.ref=w[0],w.inView=w[1],w.entry=w[2],w}const Ee=({modelName:s,modelId:r,handleWatchHistory:n})=>{const[l,x]=c.useState([]),[u,d]=c.useState(!1),[i,p]=c.useState(null),[b,m]=c.useState(!0),v=se(),N="currentHistoryView",f=v.props.historyTableMessages;c.useEffect(()=>{(async()=>{m(!0);try{const o=await H.post(`${window.routePrefix}/history/get-model-history`,{modelName:s,modelId:r});o.data.data&&x(o.data.data)}catch(o){console.log(o)}finally{m(!1)}})()},[s,r]);const S=async a=>{try{const o=await H.post(`${window.routePrefix}/history/get-model-fields`,{historyId:a});o.data.data&&(localStorage.setItem(N,a.toString()),n(o.data.data))}catch(o){console.log(o)}},h=a=>{const o=localStorage.getItem(N);return o?o===a.id.toString():a.isCurrent};return e.jsx("div",{className:"relative h-full",children:e.jsxs("div",{className:"h-full overflow-y-auto mt-5 pr-5",children:[e.jsxs(te,{wrapperHeight:"max-h-full",children:[e.jsx(re,{className:"sticky top-0 bg-background shadow",children:e.jsxs(E,{children:[e.jsx(D,{className:"p-2 text-left",children:f.Date}),e.jsx(D,{className:"p-2 text-left",children:f.Event}),e.jsx(D,{className:"p-2 text-left",children:f.User}),e.jsx(D,{className:"p-2 text-left",children:"Diff"}),e.jsx(D,{className:"p-2 text-left"})]})}),e.jsx(ae,{children:b?e.jsx(E,{children:e.jsx(k,{colSpan:5,className:"p-10 text-center",children:e.jsx(L,{className:"mx-auto size-8 animate-spin"})})}):l.length>0?l.map(a=>e.jsxs(E,{children:[e.jsx(k,{className:"p-2 self-start pt-2.5",children:new Date(a.createdAt).toLocaleString()}),e.jsx(k,{className:"p-2 self-start pt-2.5 capitalize",children:a.action}),e.jsx(k,{className:"p-2 self-start pt-2.5 max-w-[250px] whitespace-break-spaces",children:e.jsx("div",{className:"max-w-[500px] whitespace-break-spaces font-medium text-chart-3",children:a.user.login})}),e.jsx(k,{className:"p-2 align-middle",children:e.jsx(C,{variant:"green",size:"sm",onClick:()=>{p(a.diff),d(!0)},children:e.jsx(ne,{})})}),e.jsx(k,{className:"p-2 align-middle text-center",children:h(a)?e.jsx("span",{className:"font-medium",children:f.Current}):e.jsx(C,{variant:"outline",size:"sm",onClick:()=>S(a.id),children:f.Watch})})]},a.id)):e.jsx(E,{children:e.jsx(k,{colSpan:5,className:"p-4 text-center font-medium text-muted-foreground",children:f["There is no history"]})})})]}),e.jsx(ie,{open:u,onOpenChange:a=>{d(a),a||setTimeout(()=>{document.body.removeAttribute("style")},300)},children:e.jsxs(oe,{className:"z-[1022] sm:max-w-[60vw]",children:[e.jsx(le,{children:e.jsx(ce,{children:"Diff"})}),e.jsx(Ne,{changes:i,className:"max-h-[80vh] overflow-auto sm:max-w-[60vw] w-full"})]})})]})})},Te=({dialogRef:s,modelId:r,modelName:n,callback:l})=>e.jsxs(de,{ref:s,children:[e.jsx(ue,{}),e.jsx(me,{children:e.jsx(pe,{children:e.jsx(Ee,{modelId:r,modelName:n,handleWatchHistory:l})})})]}),W=c.memo(({field:s})=>!s||typeof s!="object"||!s.label?(console.error("Invalid field for LabelRenderer:",s),null):e.jsxs("div",{className:"flex gap-3",children:[e.jsx($,{htmlFor:`${s.type}-${s.name}`,children:s.label}),s.tooltip&&e.jsx(ge,{children:e.jsxs(je,{children:[e.jsx(ve,{onClick:r=>r.preventDefault(),children:e.jsx(G,{iconNode:ye,className:"text-primary w-5 h-5 cursor-pointer"})}),e.jsx(be,{align:"center",side:"top",className:"z-1002",children:e.jsx("p",{children:s.tooltip})})]})})]})),Re=c.memo(({field:s,value:r,onChange:n,processing:l,notFound:x,search:u})=>{if(!s||typeof s!="object"||!s.name||!s.type)return console.error("Invalid field for LazyField:",s),e.jsx("div",{className:"text-red-500",children:"Error: Invalid field data"});const[d,i]=Ie({triggerOnce:!0,rootMargin:"100px 0px"});return e.jsx("div",{ref:d,className:"grid gap-4 w-full",children:i?e.jsx(X,{field:s,value:r,onChange:n,notFound:x,search:u,processing:l}):e.jsx(we,{className:"w-full h-[250px] rounded-sm"})})}),Me=({page:s,catalog:r,callback:n,openNewWindow:l,openNewWindowLabel:x,isNavigation:u,DnavVisible:d,visibleLable:i})=>{var M;const{btnBack:p,btnHistory:b,view:m,edit:v,history:N,notFound:f,model:S,fields:h}=s.props,{data:a,setData:o,post:w,processing:g,transform:F}=he({...Object.fromEntries((h||[]).map(t=>[t.name,t.value??void 0])),jsonPopupCatalog:r}),[y,Y]=c.useState(!1),[B,O]=c.useState(l??!1),[V,Z]=c.useState(d??!1),R=c.useRef(null);c.useEffect(()=>{localStorage.removeItem("currentHistoryView")},[]),c.useEffect(()=>(O(l??!1),U(),o({...Object.fromEntries((h||[]).map(t=>[t.name,(t.type==="mediamanager"||t.type==="single-file")&&(t.value===null||t.value===void 0)?[]:t.value])),jsonPopupCatalog:r}),()=>U()),[h,r,l,o]);const A=c.useCallback((t,j)=>{o(t,j)},[o]);if(!Array.isArray(h))return console.error("Fields is not an array:",h),e.jsx("div",{className:"p-4 text-red-500",children:"Error: Fields data is invalid"});if(h.length===0)return console.warn("Fields array is empty"),e.jsx("div",{className:"p-4 text-gray-500",children:"No fields to display"});const P=h.filter(t=>!t||typeof t!="object"||!t.name||!t.type||!t.label);if(P.length>0)return console.error("Invalid fields found:",P),e.jsx("div",{className:"p-4 text-red-500",children:"Error: Some fields are missing required properties (name, type, label)"});const ee=async t=>{if(t.preventDefault(),r){Y(!0);const j=await H.post(s.props.postLink,a);j.status===200&&n&&(u?n(j.data.record,B,V):n(j.data.record))}else{const j=localStorage.getItem("backUrl");F(I=>({...I,redirectUrl:j??""})),w(s.props.postLink,{onSuccess:()=>{localStorage.setItem("backUrl","")}})}};return e.jsxs("div",{className:"p-4 w-full",children:[!r&&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:"w-fit",asChild:!0,children:e.jsxs(xe,{href:p.link,preserveScroll:!0,children:[e.jsx(G,{iconNode:fe}),p.title]})}),e.jsxs(C,{variant:"green",type:"submit",className:"w-fit lg:hidden",form:"addUserForm",disabled:y||g||s.props.view||_(),children:[y||g&&e.jsx(L,{className:"h-4 w-4 animate-spin"}),s.props.btnSave.title]})]}),e.jsx("form",{id:"addUserForm",onSubmit:ee,className:m?"cursor-not-allowed":"",children:e.jsxs("div",{className:"grid gap-4 max-w-286 pb-8 lg:grid-cols-[1fr_220px]",children:[e.jsx("div",{className:"flex flex-col gap-10",children:h.map(t=>e.jsx("div",{className:`grid gap-4 w-full ${m?"pointer-events-none":""}`,children:t.type==="markdown"||t.type==="table"||t.type==="jsonEditor"||t.type==="codeEditor"||t.type==="geoJson"?e.jsxs(e.Fragment,{children:[e.jsx(W,{field:t}),e.jsx(K,{message:J(`${t.type}-${t.name}`)}),e.jsx(Re,{field:t,value:a[t.name],onChange:A,processing:y||g||m,notFound:f,search:s.props.search})]}):e.jsxs(e.Fragment,{children:[e.jsx(W,{field:t}),e.jsx(K,{message:J(`${t.type}-${t.name}`)}),e.jsx(X,{field:t,value:a[t.name],onChange:A,processing:y||g||m,notFound:f,search:s.props.search})]})},t.name))}),e.jsxs("div",{className:`p-4 rounded-md h-fit sticky shadow ${r?"top-0 grid gap-4":"top-[84px] hidden lg:block"}`,children:[u&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-4 items-center",children:[e.jsx(q,{id:"targetBlank",checked:B,onCheckedChange:t=>O(!!t),className:"cursor-pointer size-5"}),e.jsx($,{htmlFor:"targetBlank",children:x})]}),e.jsxs("div",{className:"flex gap-4 items-center",children:[e.jsx(q,{id:"visible",checked:V,onCheckedChange:t=>Z(!!t),className:"cursor-pointer size-5"}),e.jsx($,{htmlFor:"visible",children:i})]})]}),e.jsxs("div",{className:`flex gap-2 ${N&&(v||m)?"justify-center":"justify-start"}`,children:[e.jsxs(C,{variant:"green",type:"submit",className:"w-fit",disabled:y||g||s.props.view||_(),children:[(y||g)&&e.jsx(L,{className:"h-4 w-4 animate-spin"}),s.props.btnSave.title]}),N&&(v||m)&&e.jsx(C,{variant:"outline",className:"w-fit",onClick:t=>{var j;t.preventDefault(),(j=R.current)==null||j.open()},children:b.title})]})]})]})}),N&&(v||m)&&e.jsx(Te,{dialogRef:R,modelName:S,modelId:(M=h.find(t=>t.name==="id"))==null?void 0:M.value,callback:t=>{var j;for(const I of Object.keys(t))o(I,t[I]);(j=R.current)==null||j.close()}})]})};export{W as LabelRenderer,Re as LazyField,Me as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r}from"./app.js";import{A as o}from"./app-layout-Bubi-NT8.js";import t from"./add-group-form-B7c4coU-.js";import"./jsoneditor-De1FvcYu.js";import"./handsontable-PxYdjN8c.js";import"./monaco-BhBYtg3d.js";import"./app-shell-DbPu3ZPM.js";import"./app-sidebar-Dbgnlkew.js";import"./nav-main-CVTsAC3C.js";import"./material-icon-BXxpxGAd.js";import"./app-sidebar-header-C3yisT8p.js";import"./breadcrumbs-CZZirDj8.js";import"./nav-user-F0xzKfK7.js";import"./user-info-D2tUt2LU.js";import"./user-menu-content-C9xtndj8.js";import"./theme-switcher-Jo-h4C2M.js";import"./icon-BTIjB9Wk.js";const m=[];function y(){return r.jsx(o,{breadcrumbs:m,children:r.jsx(t,{})})}export{y as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r}from"./app.js";import{A as o}from"./app-layout-Bubi-NT8.js";import t from"./add-user-form-BXSGx38D.js";import"./jsoneditor-De1FvcYu.js";import"./handsontable-PxYdjN8c.js";import"./monaco-BhBYtg3d.js";import"./app-shell-DbPu3ZPM.js";import"./app-sidebar-Dbgnlkew.js";import"./nav-main-CVTsAC3C.js";import"./material-icon-BXxpxGAd.js";import"./app-sidebar-header-C3yisT8p.js";import"./breadcrumbs-CZZirDj8.js";import"./nav-user-F0xzKfK7.js";import"./user-info-D2tUt2LU.js";import"./user-menu-content-C9xtndj8.js";import"./theme-switcher-Jo-h4C2M.js";import"./icon-BTIjB9Wk.js";import"./input-error-CSrUHo1P.js";const m=[];function E(){return r.jsx(o,{breadcrumbs:m,children:r.jsx(t,{})})}export{E as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as E,j as e,ah as I,an as L,ao as P,B as v,ap as z,S as C,c as M,d as R,e as T,f as D,aq as w,ar as O,L as k}from"./app.js";import B from"./app-shell-DbPu3ZPM.js";import{AppSidebar as K}from"./app-sidebar-
|
|
1
|
+
import{u as E,j as e,ah as I,an as L,ao as P,B as v,ap as z,S as C,c as M,d as R,e as T,f as D,aq as w,ar as O,L as k}from"./app.js";import B from"./app-shell-DbPu3ZPM.js";import{AppSidebar as K}from"./app-sidebar-Dbgnlkew.js";import{A as V,a as N,N as _,b as F}from"./app-sidebar-header-C3yisT8p.js";import{r as l}from"./handsontable-PxYdjN8c.js";const H=l.memo(({children:o,breadcrumbs:a=[],className:i})=>{const n=E();return e.jsxs(B,{variant:"sidebar",children:[e.jsx(I,{title:n.props.title}),e.jsx(K,{}),e.jsxs(L,{className:i,children:[e.jsx(V,{breadcrumbs:a}),e.jsx("div",{className:"relative flex-1 overflow-hidden",children:e.jsx("div",{className:"h-full",children:o})})]})]})});function q({width:o="min(25vw, 420px)"}){const{isEnabled:a,isOpen:i,closeChat:n,models:s,activeModel:r,setActiveModel:d,messages:c,loading:m,sending:x,error:g,sendMessage:y}=N(),[f,h]=l.useState(""),j=l.useRef(null);l.useEffect(()=>{i||h("")},[i]),l.useEffect(()=>{j.current&&j.current.scrollIntoView({behavior:"smooth"})},[c]);const u=s.length>0,A=async t=>{t.preventDefault();const p=f.trim();p&&(await y(p),h(""))},S=t=>{if((t.ctrlKey||t.metaKey)&&t.key==="Enter"){t.preventDefault();const p=f.trim();p&&!x&&(y(p),h(""))}};return a?e.jsxs("aside",{id:"ai-assistant-panel","aria-label":"AI assistant chat","aria-hidden":!i,className:w("bg-card text-card-foreground fixed bottom-0 right-0 top-0 z-[60] flex h-full flex-col border-l shadow-xl transition-all duration-300 ease-in-out","md:w-auto w-full",i?"translate-x-0 opacity-100":"translate-x-full opacity-0 pointer-events-none"),style:{width:"var(--ai-assistant-panel-actual-width, "+o+")"},children:[e.jsxs("div",{className:"flex items-center justify-between border-b px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(P,{className:"size-5 text-primary"}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-semibold leading-tight",children:"AI assistant"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Chat with your selected model."})]})]}),e.jsx(v,{variant:"ghost",size:"icon",onClick:n,"aria-label":"Close AI assistant",children:e.jsx(z,{className:"size-4"})})]}),e.jsxs("div",{className:"flex flex-1 flex-col gap-4 overflow-hidden px-4 py-4",children:[!u&&!m&&e.jsx("div",{className:"flex flex-1 items-center justify-center rounded-md border border-dashed p-6 text-sm text-muted-foreground",children:"No AI models are available for your account."}),u&&e.jsxs(e.Fragment,{children:[e.jsxs(C,{value:r,onValueChange:d,children:[e.jsx(M,{className:"w-full",children:e.jsx(R,{placeholder:"Select a model"})}),e.jsx(T,{className:"z-[70]",children:s.map(t=>e.jsx(D,{value:t.id,children:e.jsxs("div",{className:"flex flex-col text-left",children:[e.jsx("span",{className:"font-medium",children:t.name}),t.description&&e.jsx("span",{className:"text-xs text-muted-foreground",children:t.description})]})},t.id))})]}),e.jsxs("div",{className:"flex flex-1 flex-col gap-3 overflow-hidden rounded-md border bg-background p-4",children:[e.jsxs("div",{className:"flex-1 space-y-3 overflow-y-auto pr-2","data-ai-assistant-messages":!0,children:[m&&e.jsx("div",{className:"flex justify-center py-6 text-sm text-muted-foreground",children:"Loading conversation..."}),!m&&c.length===0&&e.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"Start a conversation to see responses here."}),c.map(t=>e.jsxs("div",{className:w("flex flex-col gap-1 rounded-md border p-3 text-sm shadow-xs",t.role==="assistant"?"border-primary/30 bg-primary/5":"border-border bg-background"),children:[e.jsx("span",{className:"font-semibold",children:t.role==="assistant"?"Assistant":"You"}),e.jsx("p",{className:"whitespace-pre-wrap leading-relaxed",children:t.content}),e.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(t.timestamp).toLocaleTimeString()})]},t.id)),e.jsx("div",{ref:j})]}),e.jsxs("form",{className:"space-y-2",onSubmit:A,children:[e.jsx(O,{placeholder:u?"Type your question... (Ctrl+Enter to send)":"No models available",value:f,onChange:t=>h(t.target.value),onKeyDown:S,disabled:!u||x,rows:3}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[g&&e.jsx("span",{className:"text-xs text-destructive",children:g}),e.jsx(v,{type:"submit",disabled:!u||x||!f.trim(),children:x?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(k,{className:"size-4 animate-spin"}),"Sending…"]}):"Send"})]})]})]})]})]})]}):null}const $="min(25vw, 420px)",b="margin-right 300ms ease-in-out";function G({children:o,panelWidth:a=$}){const{isEnabled:i,isOpen:n}=N();return l.useEffect(()=>{const s=document.getElementById("app");if(!s)return;const r=s.style.transition,d=r==null?void 0:r.includes("margin-right");return d||(s.style.transition=r?`${r}, ${b}`:b),s.classList.add("ai-assistant-host"),s.style.setProperty("--ai-assistant-panel-width",a),()=>{s.classList.remove("ai-assistant-host"),s.style.removeProperty("--ai-assistant-panel-width"),s.style.removeProperty("--ai-assistant-panel-actual-width"),s.style.removeProperty("margin-right"),delete s.dataset.aiAssistantOpen,d||(s.style.transition=r)}},[a]),l.useEffect(()=>{const s=document.getElementById("app");if(!s)return;const r=window.innerWidth<768,d=r?"100vw":a;s.style.setProperty("--ai-assistant-panel-actual-width",d),i&&n?(s.style.marginRight=r?"0":a,s.dataset.aiAssistantOpen="true"):(s.style.removeProperty("margin-right"),s.dataset.aiAssistantOpen="false");const c=()=>{const m=window.innerWidth<768,x=m?"100vw":a;s.style.setProperty("--ai-assistant-panel-actual-width",x),i&&n&&(s.style.marginRight=m?"0":a)};return window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[i,n,a]),e.jsxs(e.Fragment,{children:[o,e.jsx(q,{width:a})]})}const Z=l.memo(({children:o,className:a,breadcrumbs:i,...n})=>e.jsx(_,{children:e.jsxs(F,{children:[e.jsx(H,{breadcrumbs:i,className:a,...n,children:o}),e.jsx(G,{})]})}));export{Z as A};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u,j as s,
|
|
1
|
+
import{u,j as s,b0 as N,b1 as g,b2 as i,b3 as c,b4 as f,b5 as v,b6 as k,b7 as d,B as C,b8 as M,b9 as w,ba as _,bb as y,bc as B,bd as x,ai as n,be as T,bf as p,bg as t,C as o,bh as h,bi as j,bj as b,bk as m,bl as R,bm as $}from"./app.js";import{NavMain as z}from"./nav-main-CVTsAC3C.js";import l from"./material-icon-BXxpxGAd.js";import"./jsoneditor-De1FvcYu.js";import"./handsontable-PxYdjN8c.js";import"./monaco-BhBYtg3d.js";function L(){const r=u();return s.jsxs(N,{collapsible:"icon",variant:"inset",children:[s.jsx(g,{children:s.jsx(i,{children:s.jsxs(c,{children:[s.jsx(f,{className:"p-0 shadow-none border-none bg-transparent hidden md:block",children:s.jsxs(v,{children:[s.jsx(k,{asChild:!0,className:"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground rounded-md",children:s.jsx(d,{asChild:!0,children:s.jsx(C,{variant:"ghost",asChild:!0,className:`w-full ${r.props.section?"":"pointer-events-none"}`,children:s.jsxs("div",{children:[s.jsx(l,{name:"rocket_launch",className:"!text-[18px]"}),s.jsx("span",{className:"group-data-[state=collapsed]:hidden",children:r.props.brand}),r.props.section&&s.jsx(M,{className:"ml-auto group-data-[state=collapsed]:hidden"})]})})})}),r.props.section&&s.jsx(w,{side:"right",className:"z-[1003]",children:r.props.section.map(e=>s.jsx("div",{children:e.subItems?s.jsxs(_,{children:[s.jsxs(y,{className:"flex gap-2 items-center cursor-pointer",children:[s.jsx(l,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]}),s.jsx(B,{children:e.subItems.map(a=>s.jsx(x,{children:a.type==="blank"?s.jsxs("a",{href:a.link,target:"_blank",className:"flex gap-2 items-center",children:[a.icon&&s.jsx(l,{name:a.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:a.title})]},a.id):s.jsxs(n,{href:a.link,className:"flex gap-2 items-center",children:[a.icon&&s.jsx(l,{name:a.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:a.title})]},a.id)},a.id))})]}):s.jsx(x,{children:e.type==="blank"?s.jsxs("a",{href:e.link,target:"_blank",className:"flex gap-2 items-center",children:[e.icon&&s.jsx(l,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]}):s.jsxs(n,{href:e.link,className:"flex gap-2 items-center",children:[e.icon&&s.jsx(l,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]})})},e.id))})]})}),s.jsx(T,{className:"px-2 py-0 block md:hidden",children:s.jsx(i,{children:s.jsx(p,{asChild:!0,className:"group/collapsible",children:s.jsxs(c,{children:[s.jsx(t,{asChild:!0,children:s.jsxs(d,{children:[s.jsx(l,{name:"rocket_launch",className:"!text-[18px]"}),s.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:r.props.brand}),r.props.section&&s.jsx(o,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"})]})}),r.props.section&&s.jsx(h,{children:s.jsx(j,{children:r.props.section&&r.props.section.map(e=>e.subItems?s.jsx(i,{children:s.jsx(p,{asChild:!0,className:"group/collapsible-sub",children:s.jsxs(c,{children:[s.jsx(t,{asChild:!0,children:s.jsxs(d,{children:[s.jsx(l,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:e.title}),s.jsx(o,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible-sub:rotate-90"})]})}),s.jsx(h,{children:s.jsx(j,{children:e.subItems.map(a=>s.jsx(b,{children:s.jsx(m,{asChild:!0,children:a.type==="blank"?s.jsxs("a",{href:a.link,target:"_blank",className:"flex gap-2 items-center",children:[a.icon&&s.jsx(l,{name:a.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:a.title})]}):s.jsxs(n,{href:a.link,className:"flex gap-2 items-center",children:[a.icon&&s.jsx(l,{name:a.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:a.title})]})})},a.id))})})]})})},e.id):s.jsx(b,{children:s.jsx(m,{asChild:!0,children:e.type==="blank"?s.jsxs("a",{href:e.link,target:"_blank",className:"flex gap-2 items-center",children:[e.icon&&s.jsx(l,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]}):s.jsxs(n,{href:e.link,className:"flex gap-2 items-center",children:[e.icon&&s.jsx(l,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]})})},e.id))})})]})})})})]},r.props.brand)})}),s.jsx(R,{children:s.jsx(z,{items:r.props.menu})}),s.jsx($,{children:s.jsx("div",{className:"text-center opacity-70",children:r.props.showVersion&&`v.${r.props.versionText||"4.6.0"}`})})]})}export{L as AppSidebar};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as L,aV as G,u as z,j as e,aW as Q,s as X,B as k,aX as Z,w as K,x as ee,aY as te,N as B,O as R,E as se,Q as F,r as ae,aZ as re,ai as U,L as D,ao as oe,aq as ne,a_ as ie,a$ as ce}from"./app.js";import{Breadcrumbs as le}from"./breadcrumbs-CZZirDj8.js";import{NavUser as de}from"./nav-user-F0xzKfK7.js";import{ThemeSwitcher as ue}from"./theme-switcher-Jo-h4C2M.js";import{r as n}from"./handsontable-PxYdjN8c.js";import fe from"./material-icon-BXxpxGAd.js";const pe={"Cache-Control":"no-store, no-cache, must-revalidate, proxy-revalidate",Pragma:"no-cache",Expires:"0"},H=s=>{if(typeof s!="string")return!1;const c=s.trim().toLowerCase();return c.startsWith("<!doctype html")||c.startsWith("<html")||c.startsWith("<")},he=s=>({...s??{},_ts:Date.now()}),O=async(s,c,a,u)=>{var x,m,S,l;const f={...u,headers:{...pe,...(u==null?void 0:u.headers)??{}},params:he(u==null?void 0:u.params)};try{let o;s==="get"?o=await L.get(c,f):s==="post"?o=await L.post(c,a,f):s==="put"?o=await L.put(c,a,f):o=await L.delete(c,{...f,data:a});const p=String(((x=o.headers)==null?void 0:x["content-type"])??"").toLowerCase();if(p&&!p.includes("application/json")||H(o.data))throw new Error(`Expected JSON response from "${c}", but received "${p||"unknown"}". This usually means the session expired and server returned an HTML login page.`);return o}catch(o){if(o instanceof G){const p=String(((S=(m=o.response)==null?void 0:m.headers)==null?void 0:S["content-type"])??"").toLowerCase();if(H((l=o.response)==null?void 0:l.data)||p.includes("text/html"))throw new Error("Server returned HTML instead of JSON. Most likely auth session expired. Please reload the page and log in again.")}throw o}},y={getJson:(s,c)=>O("get",s,void 0,c),postJson:(s,c,a)=>O("post",s,c,a),putJson:(s,c,a)=>O("put",s,c,a),deleteJson:(s,c,a)=>O("delete",s,c,a)},W=n.createContext(void 0),Ae=({children:s})=>{const[c,a]=n.useState([]),[u,f]=n.useState([]),[x,m]=n.useState([]),[S,l]=n.useState(!1),[o,p]=n.useState(null),[j,A]=n.useState(""),v=z(),[g,C]=n.useState({}),M=[...u,...x],w=async()=>{try{const t=await y.getJson(`${window.routePrefix}/notifications/api`,{params:{unreadOnly:!0,limit:4}});a(t.data)}catch(t){console.error("Error fetching bell notifications:",t)}},d=async()=>{try{const t=await y.postJson(`${window.routePrefix}/notifications`);C(t.data)}catch(t){console.log(t)}},E=async()=>{await w()},b=async()=>{try{const t=await y.getJson(`${window.routePrefix}/notifications/api/get-classes`);t.data&&(p(t.data.activeServices),A(t.data.initTab))}catch(t){console.error("Error fetching tabs:",t)}},$=async(t,r)=>{try{if(!t){await P(r);return}const i=await y.postJson(`${window.routePrefix}/notifications/api/search`,{s:t,notificationClass:r});m(i.data)}catch(i){console.error("Error searching notifications:",i)}},P=async t=>{l(!0);try{const r=`${window.routePrefix}/notifications/api/${t}`,i=await y.getJson(r,{params:{limit:20,skip:0,unreadOnly:!1}});return f([]),m(i.data),i.data}catch(r){return console.error("Error fetching all notifications:",r),[]}finally{l(!1)}},T=async(t,r)=>{try{const i=`${window.routePrefix}/notifications/api/${t}`,h=await y.getJson(i,{params:{limit:20,skip:r,unreadOnly:!1}});return m(N=>[...N,...h.data]),h.data}catch(i){return console.error("Error paginating notifications:",i),[]}};n.useEffect(()=>{if(!v.props.notifications)return;d(),w();const t=new EventSource(`${window.routePrefix}/notifications/api/stream`);return t.addEventListener("connected",r=>{const i=JSON.parse(r.data);console.log("Connected event:",i),b()}),t.addEventListener("notification",r=>{const i=JSON.parse(r.data);f(h=>[i,...h]),a(h=>[i,...h].slice(0,4))}),t.onerror=()=>{console.error("SSE connection error")},()=>t.close()},[]);const I=async(t,r)=>{try{await y.putJson(`${window.routePrefix}/notifications/api/${t}/${r}/read`,{}),f(i=>i.map(h=>h.id===r?{...h,read:!0}:h)),m(i=>i.map(h=>h.id===r?{...h,read:!0}:h)),a([])}catch(i){console.error("Error marking as read:",i)}},J=async()=>{try{await y.putJson(`${window.routePrefix}/notifications/api/read-all`,{}),f(t=>t.map(r=>({...r,read:!0}))),m(t=>t.map(r=>({...r,read:!0}))),await w()}catch(t){console.error("Error marking all as read:",t)}},_=c.filter(t=>!t.read).length;return e.jsx(W.Provider,{value:{bellNotifications:c,allNotifications:M,unreadCount:_,getTabs:b,tabs:o,initTab:j,search:$,markAsRead:I,markAllAsRead:J,getLocale:d,messages:g,fetchAllNotifications:P,paginateNotifications:T,loading:S,refreshBellNotifications:E},children:s})},q=()=>{const s=n.useContext(W);if(s===void 0)throw new Error("useNotifications must be used within a NotificationProvider");return s};function me(){const{bellNotifications:s,markAsRead:c,unreadCount:a,refreshBellNotifications:u,messages:f}=q(),[x,m]=n.useState(!1),S=async(o,p)=>{m(!0);try{await c(o,p),await u()}catch(j){console.error("Error marking as read:",j)}finally{m(!1)}},l=o=>{const p=new Date,j=new Date(o),A=p.getTime()-j.getTime(),v=Math.floor(A/1e3),g=new Intl.RelativeTimeFormat("en",{numeric:"auto"});if(v<60)return g.format(-v,"second");const C=Math.floor(v/60);if(C<60)return g.format(-C,"minute");const M=Math.floor(C/60);if(M<24)return g.format(-M,"hour");const w=Math.floor(M/24);if(w<30)return g.format(-w,"day");const d=Math.floor(w/30);if(d<12)return g.format(-d,"month");const E=Math.floor(d/12);return g.format(-E,"year")};return e.jsxs(Q,{children:[e.jsx(X,{asChild:!0,className:"cursor-pointer data-[state=open]:bg-sidebar-accent",children:e.jsxs(k,{variant:"ghost",className:"relative",children:[e.jsx(Z,{}),a>0&&e.jsx("div",{className:"absolute top-1.5 right-1.5 size-1.5 rounded-full bg-destructive"})]})}),e.jsxs(K,{className:"z-[1002] p-2",align:"end",onCloseAutoFocus:o=>o.preventDefault(),children:[e.jsx(ee,{className:`${x?"opacity-50 pointer-events-none":""}`,children:s.length===0?e.jsx("div",{className:"p-4 text-center text-muted-foreground",children:"No notifications"}):s.map(o=>e.jsxs("div",{children:[e.jsx(te,{asChild:!0,className:"cursor-pointer",onSelect:p=>{p.preventDefault(),ae.visit(`${window.routePrefix}/notifications?type=${o.notificationClass}`)},children:e.jsxs("div",{className:"grid grid-cols-[32px_250px] grid-rows-[auto_1fr] items-start gap-x-4 gap-y-2",children:[o.icon?e.jsx(fe,{name:o.icon.icon,style:{color:o.icon.iconColor},className:"!text-[32px]"}):e.jsx("div",{}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-medium",children:o.title}),e.jsx("span",{className:"truncate",children:o.message})]}),e.jsxs("div",{className:"col-start-2 flex justify-between flex-nowrap items-center",children:[e.jsx("div",{className:"flex flex-nowrap gap-2 items-center",children:e.jsx("div",{children:l(o.createdAt)})}),e.jsxs(B,{children:[e.jsx(R,{asChild:!0,children:e.jsx(k,{variant:"ghost",size:"icon",className:"size-4",onClick:p=>{p.stopPropagation(),S(o.notificationClass,o.id)},children:e.jsx(se,{className:"text-primary"})})}),e.jsx(F,{side:"left",className:"z-[1003]",children:e.jsx("p",{children:f["Make read"]})})]})]})]})}),e.jsx(re,{})]},o.id))}),e.jsx(k,{variant:"secondary",asChild:!0,children:e.jsxs(U,{href:`${window.routePrefix}/notifications`,className:`w-full ${x?"opacity-50 pointer-events-none":""}`,children:[f["View All"],x&&e.jsx(D,{className:"h-4 w-4 animate-spin"})]})})]})]})}const xe=()=>{if(!(typeof window>"u"))return window.__adminizerAiAssistantState__??void 0},we=s=>{typeof window>"u"||(window.__adminizerAiAssistantState__=s)},V=n.createContext(void 0),Ee=({children:s})=>{const a=z().props.aiAssistant,u=n.useMemo(()=>xe(),[]),[f,x]=n.useState(()=>(u==null?void 0:u.isOpen)??!1),[m,S]=n.useState([]),[l,o]=n.useState(()=>(u==null?void 0:u.activeModel)??(a==null?void 0:a.defaultModel)??void 0),[p,j]=n.useState([]),[A,v]=n.useState(!1),[g,C]=n.useState(!1),[M,w]=n.useState(null),d=(a==null?void 0:a.enabled)??!1,E=n.useCallback(async()=>{if(d)try{v(!0);const{data:r}=await y.getJson(`${window.routePrefix}/api/ai-assistant/models`);S(r),o(i=>{var N;return i||(a!=null&&a.defaultModel&&r.some(Y=>Y.id===a.defaultModel)?a.defaultModel:(N=r[0])==null?void 0:N.id)})}catch(r){console.error("Failed to load AI assistant models",r),w("Unable to load AI assistant models")}finally{v(!1)}},[a==null?void 0:a.defaultModel,d]),b=n.useCallback(async r=>{if(!(!d||!r))try{v(!0);const{data:i}=await y.getJson(`${window.routePrefix}/api/ai-assistant/history/${r}`);j(i.history??[])}catch(i){console.error("Failed to load AI assistant history",i),w("Unable to load AI assistant history")}finally{v(!1)}},[d]);n.useEffect(()=>{if(!d){j([]);return}E()},[E,d]),n.useEffect(()=>{!d||!l||b(l)},[l,b,d]);const $=n.useCallback(r=>{o(r)},[]),P=n.useCallback(()=>x(!0),[]),T=n.useCallback(()=>x(!1),[]),I=n.useCallback(()=>x(r=>!r),[]),J=n.useCallback(async r=>{if(!d||!l)return;const i=r.trim();if(!i)return;const h={id:`tmp-${Date.now()}`,role:"user",content:i,timestamp:new Date().toISOString(),modelId:l};j(N=>[...N,h]),C(!0),w(null);try{const{data:N}=await y.postJson(`${window.routePrefix}/api/ai-assistant/query`,{modelId:l,message:i});j(N.history??[])}catch(N){console.error("Failed to send AI assistant message",N),w("Unable to reach AI assistant"),await b(l)}finally{C(!1)}},[l,b,d]),_=n.useCallback(async()=>{l&&await b(l)},[l,b]);n.useEffect(()=>{d||x(!1)},[d]),n.useEffect(()=>{we({isOpen:f,activeModel:l})},[l,f]);const t=n.useMemo(()=>({isEnabled:d,isOpen:f,openChat:P,closeChat:T,toggleChat:I,models:m,activeModel:l,setActiveModel:$,messages:p,loading:A,sending:g,error:M,sendMessage:J,refreshHistory:_}),[l,T,M,d,f,A,p,m,P,_,J,g,$,I]);return e.jsx(V.Provider,{value:t,children:s})},ge=()=>{const s=n.useContext(V);if(!s)throw new Error("useAiAssistant must be used within an AiAssistantProvider");return s};function ye(){const{isEnabled:s,isOpen:c,toggleChat:a,models:u,sending:f,loading:x}=ge();if(!s)return null;const m=u.length>0;return e.jsx(e.Fragment,{children:e.jsxs(B,{children:[e.jsx(R,{asChild:!0,children:e.jsx(k,{variant:"ghost",className:ne("relative",{"text-primary":c}),onClick:a,"aria-expanded":c,"aria-haspopup":"true","aria-controls":"ai-assistant-panel",disabled:!m&&x,children:f?e.jsx(D,{className:"size-4 animate-spin"}):e.jsx(oe,{className:"size-4"})})}),e.jsx(F,{side:"bottom",className:"z-[1002]",children:e.jsx("span",{children:"AI assistant"})})]})})}function je({breadcrumbs:s=[]}){const{tabs:c}=q(),a=z();return e.jsx("header",{className:"border-sidebar-border/50 flex h-16 shrink-0 items-center gap-2 border-b px-6 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12 md:px-4",children:e.jsxs("div",{className:"flex justify-between w-full",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ie,{className:"-ml-1"}),e.jsx(le,{breadcrumbs:s})]}),e.jsxs("div",{className:"flex gap-4 items-center",children:[e.jsx(ye,{}),a.props.history&&e.jsx(U,{href:`${window.routePrefix}/history/view-all`,children:e.jsx(k,{variant:"ghost",size:"icon",className:"shrink-0",children:e.jsx(ce,{})})}),e.jsx(ue,{}),a.props.notifications&&(c===null?e.jsx("div",{className:"w-[40px] flex-none flex justify-center",children:e.jsx(D,{className:"size-4 animate-spin"})}):c.length?e.jsx(me,{}):null),e.jsx(de,{})]})]})})}const Pe=Object.freeze(Object.defineProperty({__proto__:null,AppSidebarHeader:je},Symbol.toStringTag,{value:"Module"}));export{je as A,Ae as N,ge as a,Ee as b,Pe as c,q as u};
|
package/assets/app.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./add-group-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./add-group-DQi0lc1e.js","./app-layout-Bubi-NT8.js","./app-shell-DbPu3ZPM.js","./handsontable-PxYdjN8c.js","./jsoneditor-De1FvcYu.js","./monaco-BhBYtg3d.js","./app-sidebar-Dbgnlkew.js","./nav-main-CVTsAC3C.js","./material-icon-BXxpxGAd.js","./app-sidebar-header-C3yisT8p.js","./breadcrumbs-CZZirDj8.js","./nav-user-F0xzKfK7.js","./user-info-D2tUt2LU.js","./user-menu-content-C9xtndj8.js","./theme-switcher-Jo-h4C2M.js","./icon-BTIjB9Wk.js","./add-group-form-B7c4coU-.js","./add-user-CNcCmpvV.js","./add-user-form-BXSGx38D.js","./input-error-CSrUHo1P.js","./add-BP2bkvcF.js","./add-form-B39ytLc3.js","./field-renderer-BMcYzyqF.js","./dynamic-controls-k61T9W2P.js","./field-renderer-DV8OITPR.css","./DiffViewer-BpSpxX-x.js","./catalog-Ca9RdLCZ.js","./del-modal-TaroxmfE.js","./catalog-D4n6dpGl.css","./dashboard-Bcz5b5w6.js","./dashboard-BOltB2Hq.css","./form-Biwt3wOg.js","./form-CivHwW3U.js","./history-DNn4VfTF.js","./home-BaGz7nwT.js","./init-user-CsEDYKZe.js","./list-dmqGUjt-.js","./list-table-a2bIPh90.js","./pagination-render-40Bk8JSz.js","./login-BfN1lJT1.js","./module-B9a_e2wR.js","./notification-DYPjSRl4.js","./tabs-DTgMEGE8.js","./register-C2TFSMX0.js","./welcome-BDZq6wiw.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{a as cee,c as UH,b as xa,s as Ma,d as ga,i as Mi,h as SF,m as Rj,e as see,f as lee,z as dee,v as uee,_ as vn}from"./jsoneditor-De1FvcYu.js";import{r as p,e as ke,a as Kd,b as CF,c as hee,R as MP,d as ur,F as Ca,f as Na,g as La,h as Ea,i as Ia,j as Aa,k as Ta,l as Ra,m as $a,n as ja,o as Pa,p as Oa,q as Da,s as za,t as qa,u as Ha,v as Va,w as Ba,x as Fa,y as Ua,z as Ga,A as Wa,B as Za,C as Xa,D as Ka,E as Ya,G as Qa,H as Ja,I as eo,J as to,K as no,L as ao,M as oo,N as ro,O as io,P as co,Q as so,S as lo,T as uo,U as ho,V as po,W as fo,X as yo,Y as mo,Z as vo,_ as ko,$ as go,a0 as Mo,a1 as xo,a2 as bo,a3 as wo,a4 as _o,a5 as So,a6 as Co,a7 as No,a8 as Lo,a9 as Eo,aa as Io,ab as Ao,ac as To,ad as Ro,ae as $o,af as jo,ag as Po,ah as Oo,ai as Do,aj as zo,ak as qo,al as Ho,am as Vo,an as Bo,ao as Fo,ap as Yd,aq as Qd,ar as Jd,as as pee,at as fee,au as yee,av as mee,aw as vee,ax as kee,ay as gee,az as Mee}from"./handsontable-PxYdjN8c.js";import{F as xee}from"./monaco-BhBYtg3d.js";var a$={exports:{}},e2={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.js
|
|
@@ -8070,4 +8070,4 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
8070
8070
|
* Last updated: Mar 09, 2023
|
|
8071
8071
|
*
|
|
8072
8072
|
* Description: Definition file for Chinese - China language-country.
|
|
8073
|
-
*/const PHe={languageCode:"zh-CN",[Fo]:"上方插入行",[Bo]:"下方插入行",[Vo]:"左方插入列",[Ho]:"右方插入列",[qo]:["移除该行","移除多行"],[zo]:["移除该列","移除多列"],[Do]:"撤销",[Oo]:"恢复",[Po]:"只读",[jo]:"清空该列",[$o]:"对齐",[Ro]:"左对齐",[To]:"水平居中",[Ao]:"右对齐",[Io]:"两端对齐",[Eo]:"顶端对齐",[Lo]:"垂直居中",[No]:"底端对齐",[Co]:"冻结该列",[So]:"取消冻结",[_o]:"边框",[wo]:"上",[bo]:"右",[xo]:"下",[Mo]:"左",[go]:"移除边框",[ko]:"插入批注",[vo]:"编辑批注",[mo]:"删除批注",[yo]:"只读批注",[fo]:"合并",[po]:"取消合并",[ho]:"复制",[Jd]:"带标题的复制",[Qd]:"带标题组的复制",[Yd]:"仅复制标题",[uo]:"剪切",[lo]:"插入子行",[so]:"与母行分离",[co]:["隐藏该列","隐藏多列"],[io]:["显示该列","显示多列"],[ro]:["隐藏该行","隐藏多行"],[oo]:["显示该行","显示多行"],[ao]:"无",[no]:"为空",[to]:"不为空",[eo]:"等于",[Ja]:"不等于",[Qa]:"开头是",[Ya]:"结尾是",[Ka]:"包含",[Xa]:"不包含",[Za]:"大于",[Wa]:"大于或等于",[Ga]:"小于",[Ua]:"小于或等于",[Fa]:"在此范围",[Ba]:"不在此范围",[Va]:"之后",[Ha]:"之前",[qa]:"今天",[za]:"明天",[Da]:"昨天",[Oa]:"空白单元格",[Pa]:"按条件过滤",[ja]:"按值过滤",[$a]:"且",[Ra]:"或",[Ta]:"全选",[Aa]:"清除",[Ia]:"确认",[Ea]:"取消",[La]:"搜索",[Na]:"值",[Ca]:"第二值"};mee();const bF={de:CHe,en:gee,es:NHe,fr:LHe,it:EHe,ja:IHe,ko:AHe,nl:THe,pl:RHe,pt:$He,ru:jHe,zh:PHe},OHe=document.documentElement.lang,ZY=bF[OHe]??bF.en;vee(ZY);const XY=({config:e,data:t=[],onChange:a,disabled:o})=>{const{appearance:i}=JO(),[s,l]=p.useState("ht-theme-main"),[h,f]=p.useState(!1),y=p.useCallback((m,x)=>{var b,w;if(x==="loadData")return;const S=(w=(b=k.current)==null?void 0:b.hotInstance)==null?void 0:w.getSourceData();a(S)},[]),k=p.useRef(null);return p.useEffect(()=>{const m=setTimeout(()=>{var x;(x=k.current)!=null&&x.hotInstance&&(k.current.hotInstance.loadData(t??[]),f(!0))},100);return()=>clearTimeout(m)},[t]),p.useEffect(()=>{l(i==="dark"?"ht-theme-main-dark":"ht-theme-main")},[i]),M.jsx("div",{style:{opacity:h?1:0},children:M.jsx(kee,{className:o?"pointer-events-none opacity-50":"",themeName:s,language:ZY.languageCode,ref:k,...e,afterChange:y,children:e.columns.map(m=>M.jsx(Mee,{data:m.data,...m},m.data))})})},vVe=Object.freeze(Object.defineProperty({__proto__:null,default:XY},Symbol.toStringTag,{value:"Module"})),DHe=()=>{const[e,t]=p.useState({width:typeof window<"u"?window.innerWidth:1024,height:typeof window<"u"?window.innerHeight:768});return p.useEffect(()=>{if(typeof window>"u")return;const a=()=>{t({width:window.innerWidth,height:window.innerHeight})};return window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[]),e},KY=({onChange:e,value:t,options:a,disabled:o})=>{const{appearance:i}=JO(),[s,l]=p.useState("light"),h=p.useRef(null),f=p.useRef(null),{width:y}=DHe(),k=y<768,m=y>=768&&y<1024,x=_=>{e(_)},S=_=>{h.current=_,b()},b=()=>{var N;if(!h.current)return;const _={minimap:{enabled:!k},fontSize:k?12:m?13:14,lineNumbers:k?"off":"on",lineDecorationsWidth:k?5:10,scrollBeyondLastLine:!k,wordWrap:k?"on":"bounded",renderWhitespace:k?"none":"selection",padding:{top:k?8:16,bottom:k?8:16}};h.current.updateOptions(_),(N=f.current)==null||N.classList.add("overflow-hidden"),setTimeout(()=>{var L,I;(L=h.current)==null||L.layout(),(I=f.current)==null||I.classList.remove("overflow-hidden")},100)};p.useEffect(()=>{l(i==="dark"?"vs-dark":"light")},[i]),p.useEffect(()=>{b()},[y]);const w=k?"300px":m?"400px":"500px";return M.jsx("div",{className:`border rounded-lg ${k?"p-1":"p-2"}`,ref:f,children:M.jsx(xee,{height:w,language:a.language,value:t,theme:s,options:{automaticLayout:!0,...k&&{wordWrap:"on"},minimap:{enabled:!k}},onChange:x,onMount:S,className:`transition-all duration-200 ease-in-out ${o?"pointer-events-none opacity-50 cursor-not-allowed":""}`})})},kVe=Object.freeze(Object.defineProperty({__proto__:null,default:KY},Symbol.toStringTag,{value:"Module"})),wF=gA("m-1 flex items-center border rounded-sm px-1",{variants:{variant:{default:"border-foreground/10 text-foreground bg-card hover:bg-card/80",secondary:"border-foreground/10 bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",inverted:"inverted"}},defaultVariants:{variant:"default"}}),eD=p.forwardRef(({options:e,onValueChange:t,variant:a,processing:o,disabled:i,defaultValue:s=[],placeholder:l="",notFound:h="",search:f="",animation:y=0,maxCount:k=3,modalPopover:m=!1,asChild:x=!1,className:S,mode:b="multiple",...w},_)=>{const[N,L]=p.useState(s),[I,j]=p.useState(!1),[O,P]=p.useState(!1);p.useEffect(()=>{s&&L(s)},[s]);const A=q=>{if(q.key==="Enter")j(!0);else if(q.key==="Backspace"&&!q.currentTarget.value){const B=[...N];B.pop(),L(B),t(B)}},$=q=>{let B;b==="single"?B=N.includes(q)?[]:[q]:B=N.includes(q)?N.filter(Y=>Y!==q):[...N,q],L(B),t(B),b==="single"&&j(!1)},F=()=>{L([]),t([])},X=()=>{j(q=>!q)},H=()=>{const q=N.slice(0,k);L(q),t(q)};return M.jsxs(gK,{open:I,onOpenChange:j,modal:m,children:[M.jsx(MK,{asChild:!0,children:M.jsx(MA,{ref:_,...w,onClick:X,disabled:i,className:te("flex w-full p-1 rounded-md border-input border-1 min-h-10 h-auto items-center justify-between bg-inherit hover:bg-inherit [&_svg]:pointer-events-auto",S),children:N.length>0?M.jsxs("div",{className:"flex justify-between items-center w-full",children:[M.jsxs("div",{className:"flex flex-wrap items-center",children:[N.slice(0,k).map(q=>{const B=e.find(ue=>ue.value===q),Y=B==null?void 0:B.icon;return M.jsxs("div",{className:te(O?"animate-bounce":"",wF({variant:a})),style:{animationDuration:`${y}s`},children:[Y&&M.jsx(Y,{className:"h-4 w-4 mr-2"}),B==null?void 0:B.label,M.jsx(Or,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:ue=>{ue.stopPropagation(),o||$(q)}})]},q)}),b==="multiple"&&N.length>k&&M.jsxs("div",{className:te("bg-transparent text-foreground border-foreground/1 hover:bg-transparent",O?"animate-bounce":"",wF({variant:a})),style:{animationDuration:`${y}s`},children:[`+ ${N.length-k} more`,M.jsx(Or,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:q=>{q.stopPropagation(),H()}})]})]}),M.jsxs("div",{className:"flex items-center justify-between",children:[N.length>0&&M.jsxs(M.Fragment,{children:[M.jsx(bi,{className:"h-4 mx-2 cursor-pointer text-muted-foreground",onClick:q=>{q.stopPropagation(),F()}}),M.jsx(ZO,{orientation:"vertical",className:"flex min-h-6 h-full"})]}),M.jsx(xi,{className:"h-4 mx-2 cursor-pointer text-muted-foreground"})]})]}):M.jsxs("div",{className:"flex items-center justify-between w-full mx-auto",children:[M.jsx("span",{className:"text-sm text-muted-foreground mx-3",children:l}),M.jsx(xi,{className:"h-4 cursor-pointer text-muted-foreground mx-2"})]})})}),M.jsx(xK,{className:"w-auto p-0 z-[1003]",align:"start",onEscapeKeyDown:()=>j(!1),children:M.jsxs(sO,{children:[M.jsx(zW,{placeholder:f,onKeyDown:A}),M.jsxs(qW,{children:[M.jsx(HW,{children:h}),M.jsx(VW,{children:e.map(q=>{const B=N.includes(q.value);return M.jsxs(FW,{onSelect:()=>$(q.value),className:"cursor-pointer",children:[M.jsx("div",{className:te("mr-2 flex h-5 w-5 items-center justify-center rounded border border-primary",B?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:M.jsx(sr,{className:"h-4 w-4 text-primary-foreground"})}),q.icon&&M.jsx(q.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),M.jsx("span",{children:q.label})]},q.value)})}),M.jsx(BW,{})]})]})}),y>0&&N.length>0&&b==="multiple"&&M.jsx(ki,{className:te("cursor-pointer my-2 text-foreground bg-background w-3 h-3",O?"":"text-muted-foreground"),onClick:()=>P(!O)})]})});eD.displayName="MultiSelect";const gVe=Object.freeze(Object.defineProperty({__proto__:null,default:eD},Symbol.toStringTag,{value:"Module"}));function zHe(){window.UIComponents??(window.UIComponents={}),window.JSComponents??(window.JSComponents={}),window.axios=Nt,window.sonner=Xqe,Object.assign(window.UIComponents,{Avatar:Dre,AvatarImage:zre,AvatarFallback:qre,Badge:Vre,Breadcrumb:F_e,BreadcrumbList:U_e,BreadcrumbItem:G_e,BreadcrumbLink:W_e,BreadcrumbPage:Z_e,BreadcrumbSeparator:X_e,BreadcrumbEllipsis:K_e,Button:MA,Calendar:ONe,Card:DNe,CardHeader:zNe,CardFooter:FNe,CardTitle:qNe,CardAction:VNe,CardDescription:HNe,CardContent:BNe,Checkbox:dLe,Collapsible:CLe,CollapsibleTrigger:NLe,CollapsibleContent:LLe,Command:sO,CommandDialog:OIe,CommandInput:zW,CommandList:qW,CommandEmpty:HW,CommandGroup:VW,CommandItem:FW,CommandShortcut:DIe,CommandSeparator:BW,ContextMenu:s$e,ContextMenuTrigger:l$e,ContextMenuContent:m$e,ContextMenuItem:v$e,ContextMenuCheckboxItem:k$e,ContextMenuRadioItem:g$e,ContextMenuLabel:M$e,ContextMenuSeparator:x$e,ContextMenuShortcut:b$e,ContextMenuGroup:d$e,ContextMenuPortal:u$e,ContextMenuSub:h$e,ContextMenuSubContent:y$e,ContextMenuSubTrigger:f$e,ContextMenuRadioGroup:p$e,Dialog:TW,DialogClose:jIe,DialogContent:jW,DialogDescription:DW,DialogFooter:PIe,DialogHeader:PW,DialogOverlay:$W,DialogPortal:RW,DialogTitle:OW,DialogTrigger:$Ie,DialogStack:yX,DialogStackTrigger:S$e,DialogStackOverlay:C$e,DialogStackBody:N$e,DialogStackContent:L$e,DialogStackTitle:E$e,DialogStackDescription:I$e,DialogStackHeader:A$e,DialogStackFooter:T$e,DialogStackNext:R$e,DialogStackPrevious:$$e,DropdownMenu:Mje,DropdownMenuPortal:xje,DropdownMenuTrigger:bje,DropdownMenuContent:wje,DropdownMenuGroup:_je,DropdownMenuLabel:Eje,DropdownMenuItem:Sje,DropdownMenuCheckboxItem:Cje,DropdownMenuRadioGroup:Nje,DropdownMenuRadioItem:Lje,DropdownMenuSeparator:Ije,DropdownMenuShortcut:Aje,DropdownMenuSub:Tje,DropdownMenuSubTrigger:Rje,DropdownMenuSubContent:$je,Input:jX,Label:Oje,Menubar:CPe,MenubarPortal:rK,MenubarMenu:NPe,MenubarTrigger:IPe,MenubarContent:APe,MenubarGroup:LPe,MenubarSeparator:PPe,MenubarLabel:jPe,MenubarItem:TPe,MenubarShortcut:OPe,MenubarCheckboxItem:RPe,MenubarRadioGroup:EPe,MenubarRadioItem:$Pe,MenubarSub:DPe,MenubarSubTrigger:zPe,MenubarSubContent:qPe,Pagination:HPe,PaginationContent:VPe,PaginationLink:FO,PaginationItem:BPe,PaginationPrevious:FPe,PaginationNext:UPe,PaginationEllipsis:GPe,Popover:gK,PopoverTrigger:MK,PopoverContent:xK,PopoverAnchor:mOe,Select:vDe,SelectContent:xDe,SelectGroup:kDe,SelectItem:wDe,SelectLabel:bDe,SelectScrollDownButton:nY,SelectScrollUpButton:tY,SelectSeparator:_De,SelectTrigger:MDe,SelectValue:gDe,Separator:ZO,Sheet:oY,SheetTrigger:EDe,SheetClose:IDe,SheetContent:rY,SheetHeader:iY,SheetFooter:RDe,SheetTitle:cY,SheetDescription:sY,Sidebar:gze,SidebarContent:Nze,SidebarFooter:Sze,SidebarGroup:Lze,SidebarGroupAction:Ize,SidebarGroupContent:Aze,SidebarGroupLabel:Eze,SidebarHeader:_ze,SidebarInput:wze,SidebarInset:bze,SidebarMenu:Tze,SidebarMenuAction:Pze,SidebarMenuBadge:Oze,SidebarMenuButton:jze,SidebarMenuItem:Rze,SidebarMenuSkeleton:Dze,SidebarMenuSub:zze,SidebarMenuSubButton:Hze,SidebarMenuSubItem:qze,SidebarProvider:kze,SidebarRail:xze,SidebarSeparator:Cze,SidebarTrigger:Mze,useSidebar:Y2,Skeleton:hP,Slider:mqe,Toaster:Kqe,Switch:hHe,Table:pHe,TableHeader:fHe,TableBody:yHe,TableFooter:mHe,TableHead:kHe,TableRow:vHe,TableCell:gHe,TableCaption:MHe,Textarea:xHe,Tooltip:xY,TooltipTrigger:bY,TooltipContent:wY,TooltipProvider:YO,VanillaJSONEditor:gP}),Object.assign(window.JSComponents,{VanillaJSONEditor:gP,HandsonTable:XY,MonacoEditor:KY,MultiSelect:eD})}const{createInertiaApp:qHe,router:YY}=HU;window.React=ke;window.ReactDOM=ur;window.InertiajsReact=HU;window.LucideReact=B_e;zHe();async function HHe(e,t){for(const a of Array.isArray(e)?e:[e]){const o=t[a];if(!(typeof o>"u"))return typeof o=="function"?o():o}throw new Error(`Page not found: ${e}`)}let tD=!1;YY.on("navigate",e=>{tD=!0});YY.on("finish",e=>{tD=!1});const _F=document.createElement.bind(document);document.createElement=function(e,t){const a=_F(e,t);return e.toLowerCase()==="iframe"&&tD?(console.warn("[Adminizer] Prevented iframe creation, forcing full page reload"),setTimeout(()=>{window.location.reload()},0),_F("div")):a};qHe({title:e=>`${e}`,resolve:e=>HHe(`./pages/${e}.tsx`,Object.assign({"./pages/add-group.tsx":()=>vn(()=>import("./add-group-D-oqZjnR.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url),"./pages/add-user.tsx":()=>vn(()=>import("./add-user-CVjGIJe8.js"),__vite__mapDeps([17,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,18,19]),import.meta.url),"./pages/add.tsx":()=>vn(()=>import("./add-B8GYr9Sn.js"),__vite__mapDeps([20,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,21,22,23,24,19,25]),import.meta.url),"./pages/catalog.tsx":()=>vn(()=>import("./catalog-Dksg6Ktq.js"),__vite__mapDeps([26,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,27,21,22,23,24,19,25,28]),import.meta.url),"./pages/dashboard.tsx":()=>vn(()=>import("./dashboard-Dju1w--H.js"),__vite__mapDeps([29,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,30]),import.meta.url),"./pages/form.tsx":()=>vn(()=>import("./form-C7LRXfge.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,32,21,22,23,24,19,25]),import.meta.url),"./pages/history.tsx":()=>vn(()=>import("./history-DxIi7yPY.js"),__vite__mapDeps([33,3,4,25,1,2,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url),"./pages/home.tsx":()=>vn(()=>import("./home-BUSE07NY.js"),__vite__mapDeps([34,4,3,5]),import.meta.url),"./pages/init-user.tsx":()=>vn(()=>import("./init-user-CsEDYKZe.js"),__vite__mapDeps([35,3,4,19,5]),import.meta.url),"./pages/list.tsx":()=>vn(()=>import("./list-B6iLj8LH.js"),__vite__mapDeps([36,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,37,27,38]),import.meta.url),"./pages/login.tsx":()=>vn(()=>import("./login-BfN1lJT1.js"),__vite__mapDeps([39,15,4,3,5,19]),import.meta.url),"./pages/module.tsx":()=>vn(()=>import("./module-3NsdEr7f.js"),__vite__mapDeps([40,3,4,1,2,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url),"./pages/notification.tsx":()=>vn(()=>import("./notification-BNz2iBvD.js"),__vite__mapDeps([41,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,42]),import.meta.url),"./pages/register.tsx":()=>vn(()=>import("./register-C2TFSMX0.js"),__vite__mapDeps([43,3,4,19,5]),import.meta.url),"./pages/welcome.tsx":()=>vn(()=>import("./welcome-DtWHDtJz.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url)})),setup({el:e,App:t,props:a}){Noe.createRoot(e).render(M.jsx(t,{...a}))},progress:{color:"#0f4898"}});export{gK as $,m$e as A,MA as B,lr as C,yX as D,s5 as E,v$e as F,DNe as G,zNe as H,jX as I,qNe as J,FNe as K,Fs as L,YO as M,xY as N,bY as O,I9 as P,wY as Q,hHe as R,vDe as S,Kqe as T,S$e as U,E$e as V,hr as W,uj as X,c2 as Y,s2 as Z,wSe as _,i5 as a,gze as a$,MK as a0,lv as a1,W1 as a2,xK as a3,ONe as a4,pHe as a5,fHe as a6,vHe as a7,kHe as a8,yHe as a9,te as aA,PIe as aB,jIe as aC,yf as aD,Kp as aE,ef as aF,of as aG,$Ie as aH,Rs as aI,kt as aJ,z2 as aK,bn as aL,It as aM,xZ as aN,bZ as aO,xe as aP,Pn as aQ,DA as aR,O7 as aS,fM as aT,kze as aU,Mje as aV,gy as aW,Sje as aX,Ije as aY,Mze as aZ,U8 as a_,gHe as aa,vc as ab,TW as ac,jW as ad,PW as ae,OW as af,vG as ag,moe as ah,koe as ai,$U as aj,hVe as ak,jE as al,Rx as am,bze as an,vl as ao,bi as ap,YU as aq,xHe as ar,DHe as as,JO as at,cb as au,B8 as av,v_ as aw,sr as ax,UL as ay,M1 as az,Oje as b,gVe as b$,_ze as b0,Tze as b1,Rze as b2,CPe as b3,NPe as b4,IPe as b5,jze as b6,Qv as b7,APe as b8,DPe as b9,SN as bA,Dre as bB,zre as bC,qre as bD,Eje as bE,jx as bF,yVe as bG,fVe as bH,pVe as bI,eD as bJ,mqe as bK,Un as bL,c7 as bM,dVe as bN,lf as bO,v2 as bP,r1 as bQ,__ as bR,HPe as bS,VPe as bT,BPe as bU,FO as bV,FPe as bW,UPe as bX,mVe as bY,vVe as bZ,kVe as b_,zPe as ba,qPe as bb,TPe as bc,Lze as bd,HG as be,NLe as bf,FG as bg,zze as bh,qze as bi,Hze as bj,Nze as bk,Sze as bl,F_e as bm,U_e as bn,G_e as bo,Z_e as bp,W_e as bq,X_e as br,Eze as bs,Aze as bt,CLe as bu,LLe as bv,Y2 as bw,$De as bx,wN as by,b7 as bz,MDe as c,gDe as d,xDe as e,wDe as f,dLe as g,Nt as h,C$e as i,M as j,N$e as k,L$e as l,hP as m,Vre as n,Yw as o,Bf as p,vX as q,qU as r,bje as s,Oqe as t,TP as u,fc as v,wje as w,_je as x,s$e as y,l$e as z};
|
|
8073
|
+
*/const PHe={languageCode:"zh-CN",[Fo]:"上方插入行",[Bo]:"下方插入行",[Vo]:"左方插入列",[Ho]:"右方插入列",[qo]:["移除该行","移除多行"],[zo]:["移除该列","移除多列"],[Do]:"撤销",[Oo]:"恢复",[Po]:"只读",[jo]:"清空该列",[$o]:"对齐",[Ro]:"左对齐",[To]:"水平居中",[Ao]:"右对齐",[Io]:"两端对齐",[Eo]:"顶端对齐",[Lo]:"垂直居中",[No]:"底端对齐",[Co]:"冻结该列",[So]:"取消冻结",[_o]:"边框",[wo]:"上",[bo]:"右",[xo]:"下",[Mo]:"左",[go]:"移除边框",[ko]:"插入批注",[vo]:"编辑批注",[mo]:"删除批注",[yo]:"只读批注",[fo]:"合并",[po]:"取消合并",[ho]:"复制",[Jd]:"带标题的复制",[Qd]:"带标题组的复制",[Yd]:"仅复制标题",[uo]:"剪切",[lo]:"插入子行",[so]:"与母行分离",[co]:["隐藏该列","隐藏多列"],[io]:["显示该列","显示多列"],[ro]:["隐藏该行","隐藏多行"],[oo]:["显示该行","显示多行"],[ao]:"无",[no]:"为空",[to]:"不为空",[eo]:"等于",[Ja]:"不等于",[Qa]:"开头是",[Ya]:"结尾是",[Ka]:"包含",[Xa]:"不包含",[Za]:"大于",[Wa]:"大于或等于",[Ga]:"小于",[Ua]:"小于或等于",[Fa]:"在此范围",[Ba]:"不在此范围",[Va]:"之后",[Ha]:"之前",[qa]:"今天",[za]:"明天",[Da]:"昨天",[Oa]:"空白单元格",[Pa]:"按条件过滤",[ja]:"按值过滤",[$a]:"且",[Ra]:"或",[Ta]:"全选",[Aa]:"清除",[Ia]:"确认",[Ea]:"取消",[La]:"搜索",[Na]:"值",[Ca]:"第二值"};mee();const bF={de:CHe,en:gee,es:NHe,fr:LHe,it:EHe,ja:IHe,ko:AHe,nl:THe,pl:RHe,pt:$He,ru:jHe,zh:PHe},OHe=document.documentElement.lang,ZY=bF[OHe]??bF.en;vee(ZY);const XY=({config:e,data:t=[],onChange:a,disabled:o})=>{const{appearance:i}=JO(),[s,l]=p.useState("ht-theme-main"),[h,f]=p.useState(!1),y=p.useCallback((m,x)=>{var b,w;if(x==="loadData")return;const S=(w=(b=k.current)==null?void 0:b.hotInstance)==null?void 0:w.getSourceData();a(S)},[]),k=p.useRef(null);return p.useEffect(()=>{const m=setTimeout(()=>{var x;(x=k.current)!=null&&x.hotInstance&&(k.current.hotInstance.loadData(t??[]),f(!0))},100);return()=>clearTimeout(m)},[t]),p.useEffect(()=>{l(i==="dark"?"ht-theme-main-dark":"ht-theme-main")},[i]),M.jsx("div",{style:{opacity:h?1:0},children:M.jsx(kee,{className:o?"pointer-events-none opacity-50":"",themeName:s,language:ZY.languageCode,ref:k,...e,afterChange:y,children:e.columns.map(m=>M.jsx(Mee,{data:m.data,...m},m.data))})})},vVe=Object.freeze(Object.defineProperty({__proto__:null,default:XY},Symbol.toStringTag,{value:"Module"})),DHe=()=>{const[e,t]=p.useState({width:typeof window<"u"?window.innerWidth:1024,height:typeof window<"u"?window.innerHeight:768});return p.useEffect(()=>{if(typeof window>"u")return;const a=()=>{t({width:window.innerWidth,height:window.innerHeight})};return window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[]),e},KY=({onChange:e,value:t,options:a,disabled:o})=>{const{appearance:i}=JO(),[s,l]=p.useState("light"),h=p.useRef(null),f=p.useRef(null),{width:y}=DHe(),k=y<768,m=y>=768&&y<1024,x=_=>{e(_)},S=_=>{h.current=_,b()},b=()=>{var N;if(!h.current)return;const _={minimap:{enabled:!k},fontSize:k?12:m?13:14,lineNumbers:k?"off":"on",lineDecorationsWidth:k?5:10,scrollBeyondLastLine:!k,wordWrap:k?"on":"bounded",renderWhitespace:k?"none":"selection",padding:{top:k?8:16,bottom:k?8:16}};h.current.updateOptions(_),(N=f.current)==null||N.classList.add("overflow-hidden"),setTimeout(()=>{var L,I;(L=h.current)==null||L.layout(),(I=f.current)==null||I.classList.remove("overflow-hidden")},100)};p.useEffect(()=>{l(i==="dark"?"vs-dark":"light")},[i]),p.useEffect(()=>{b()},[y]);const w=k?"300px":m?"400px":"500px";return M.jsx("div",{className:`border rounded-lg ${k?"p-1":"p-2"}`,ref:f,children:M.jsx(xee,{height:w,language:a.language,value:t,theme:s,options:{automaticLayout:!0,...k&&{wordWrap:"on"},minimap:{enabled:!k}},onChange:x,onMount:S,className:`transition-all duration-200 ease-in-out ${o?"pointer-events-none opacity-50 cursor-not-allowed":""}`})})},kVe=Object.freeze(Object.defineProperty({__proto__:null,default:KY},Symbol.toStringTag,{value:"Module"})),wF=gA("m-1 flex items-center border rounded-sm px-1",{variants:{variant:{default:"border-foreground/10 text-foreground bg-card hover:bg-card/80",secondary:"border-foreground/10 bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",inverted:"inverted"}},defaultVariants:{variant:"default"}}),eD=p.forwardRef(({options:e,onValueChange:t,variant:a,processing:o,disabled:i,defaultValue:s=[],placeholder:l="",notFound:h="",search:f="",animation:y=0,maxCount:k=3,modalPopover:m=!1,asChild:x=!1,className:S,mode:b="multiple",...w},_)=>{const[N,L]=p.useState(s),[I,j]=p.useState(!1),[O,P]=p.useState(!1);p.useEffect(()=>{s&&L(s)},[s]);const A=q=>{if(q.key==="Enter")j(!0);else if(q.key==="Backspace"&&!q.currentTarget.value){const B=[...N];B.pop(),L(B),t(B)}},$=q=>{let B;b==="single"?B=N.includes(q)?[]:[q]:B=N.includes(q)?N.filter(Y=>Y!==q):[...N,q],L(B),t(B),b==="single"&&j(!1)},F=()=>{L([]),t([])},X=()=>{j(q=>!q)},H=()=>{const q=N.slice(0,k);L(q),t(q)};return M.jsxs(gK,{open:I,onOpenChange:j,modal:m,children:[M.jsx(MK,{asChild:!0,children:M.jsx(MA,{ref:_,...w,onClick:X,disabled:i,className:te("flex w-full p-1 rounded-md border-input border-1 min-h-10 h-auto items-center justify-between bg-inherit hover:bg-inherit [&_svg]:pointer-events-auto",S),children:N.length>0?M.jsxs("div",{className:"flex justify-between items-center w-full",children:[M.jsxs("div",{className:"flex flex-wrap items-center",children:[N.slice(0,k).map(q=>{const B=e.find(ue=>ue.value===q),Y=B==null?void 0:B.icon;return M.jsxs("div",{className:te(O?"animate-bounce":"",wF({variant:a})),style:{animationDuration:`${y}s`},children:[Y&&M.jsx(Y,{className:"h-4 w-4 mr-2"}),B==null?void 0:B.label,M.jsx(Or,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:ue=>{ue.stopPropagation(),o||$(q)}})]},q)}),b==="multiple"&&N.length>k&&M.jsxs("div",{className:te("bg-transparent text-foreground border-foreground/1 hover:bg-transparent",O?"animate-bounce":"",wF({variant:a})),style:{animationDuration:`${y}s`},children:[`+ ${N.length-k} more`,M.jsx(Or,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:q=>{q.stopPropagation(),H()}})]})]}),M.jsxs("div",{className:"flex items-center justify-between",children:[N.length>0&&M.jsxs(M.Fragment,{children:[M.jsx(bi,{className:"h-4 mx-2 cursor-pointer text-muted-foreground",onClick:q=>{q.stopPropagation(),F()}}),M.jsx(ZO,{orientation:"vertical",className:"flex min-h-6 h-full"})]}),M.jsx(xi,{className:"h-4 mx-2 cursor-pointer text-muted-foreground"})]})]}):M.jsxs("div",{className:"flex items-center justify-between w-full mx-auto",children:[M.jsx("span",{className:"text-sm text-muted-foreground mx-3",children:l}),M.jsx(xi,{className:"h-4 cursor-pointer text-muted-foreground mx-2"})]})})}),M.jsx(xK,{className:"w-auto p-0 z-[1003]",align:"start",onEscapeKeyDown:()=>j(!1),children:M.jsxs(sO,{children:[M.jsx(zW,{placeholder:f,onKeyDown:A}),M.jsxs(qW,{children:[M.jsx(HW,{children:h}),M.jsx(VW,{children:e.map(q=>{const B=N.includes(q.value);return M.jsxs(FW,{onSelect:()=>$(q.value),className:"cursor-pointer",children:[M.jsx("div",{className:te("mr-2 flex h-5 w-5 items-center justify-center rounded border border-primary",B?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:M.jsx(sr,{className:"h-4 w-4 text-primary-foreground"})}),q.icon&&M.jsx(q.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),M.jsx("span",{children:q.label})]},q.value)})}),M.jsx(BW,{})]})]})}),y>0&&N.length>0&&b==="multiple"&&M.jsx(ki,{className:te("cursor-pointer my-2 text-foreground bg-background w-3 h-3",O?"":"text-muted-foreground"),onClick:()=>P(!O)})]})});eD.displayName="MultiSelect";const gVe=Object.freeze(Object.defineProperty({__proto__:null,default:eD},Symbol.toStringTag,{value:"Module"}));function zHe(){window.UIComponents??(window.UIComponents={}),window.JSComponents??(window.JSComponents={}),window.axios=Nt,window.sonner=Xqe,Object.assign(window.UIComponents,{Avatar:Dre,AvatarImage:zre,AvatarFallback:qre,Badge:Vre,Breadcrumb:F_e,BreadcrumbList:U_e,BreadcrumbItem:G_e,BreadcrumbLink:W_e,BreadcrumbPage:Z_e,BreadcrumbSeparator:X_e,BreadcrumbEllipsis:K_e,Button:MA,Calendar:ONe,Card:DNe,CardHeader:zNe,CardFooter:FNe,CardTitle:qNe,CardAction:VNe,CardDescription:HNe,CardContent:BNe,Checkbox:dLe,Collapsible:CLe,CollapsibleTrigger:NLe,CollapsibleContent:LLe,Command:sO,CommandDialog:OIe,CommandInput:zW,CommandList:qW,CommandEmpty:HW,CommandGroup:VW,CommandItem:FW,CommandShortcut:DIe,CommandSeparator:BW,ContextMenu:s$e,ContextMenuTrigger:l$e,ContextMenuContent:m$e,ContextMenuItem:v$e,ContextMenuCheckboxItem:k$e,ContextMenuRadioItem:g$e,ContextMenuLabel:M$e,ContextMenuSeparator:x$e,ContextMenuShortcut:b$e,ContextMenuGroup:d$e,ContextMenuPortal:u$e,ContextMenuSub:h$e,ContextMenuSubContent:y$e,ContextMenuSubTrigger:f$e,ContextMenuRadioGroup:p$e,Dialog:TW,DialogClose:jIe,DialogContent:jW,DialogDescription:DW,DialogFooter:PIe,DialogHeader:PW,DialogOverlay:$W,DialogPortal:RW,DialogTitle:OW,DialogTrigger:$Ie,DialogStack:yX,DialogStackTrigger:S$e,DialogStackOverlay:C$e,DialogStackBody:N$e,DialogStackContent:L$e,DialogStackTitle:E$e,DialogStackDescription:I$e,DialogStackHeader:A$e,DialogStackFooter:T$e,DialogStackNext:R$e,DialogStackPrevious:$$e,DropdownMenu:Mje,DropdownMenuPortal:xje,DropdownMenuTrigger:bje,DropdownMenuContent:wje,DropdownMenuGroup:_je,DropdownMenuLabel:Eje,DropdownMenuItem:Sje,DropdownMenuCheckboxItem:Cje,DropdownMenuRadioGroup:Nje,DropdownMenuRadioItem:Lje,DropdownMenuSeparator:Ije,DropdownMenuShortcut:Aje,DropdownMenuSub:Tje,DropdownMenuSubTrigger:Rje,DropdownMenuSubContent:$je,Input:jX,Label:Oje,Menubar:CPe,MenubarPortal:rK,MenubarMenu:NPe,MenubarTrigger:IPe,MenubarContent:APe,MenubarGroup:LPe,MenubarSeparator:PPe,MenubarLabel:jPe,MenubarItem:TPe,MenubarShortcut:OPe,MenubarCheckboxItem:RPe,MenubarRadioGroup:EPe,MenubarRadioItem:$Pe,MenubarSub:DPe,MenubarSubTrigger:zPe,MenubarSubContent:qPe,Pagination:HPe,PaginationContent:VPe,PaginationLink:FO,PaginationItem:BPe,PaginationPrevious:FPe,PaginationNext:UPe,PaginationEllipsis:GPe,Popover:gK,PopoverTrigger:MK,PopoverContent:xK,PopoverAnchor:mOe,Select:vDe,SelectContent:xDe,SelectGroup:kDe,SelectItem:wDe,SelectLabel:bDe,SelectScrollDownButton:nY,SelectScrollUpButton:tY,SelectSeparator:_De,SelectTrigger:MDe,SelectValue:gDe,Separator:ZO,Sheet:oY,SheetTrigger:EDe,SheetClose:IDe,SheetContent:rY,SheetHeader:iY,SheetFooter:RDe,SheetTitle:cY,SheetDescription:sY,Sidebar:gze,SidebarContent:Nze,SidebarFooter:Sze,SidebarGroup:Lze,SidebarGroupAction:Ize,SidebarGroupContent:Aze,SidebarGroupLabel:Eze,SidebarHeader:_ze,SidebarInput:wze,SidebarInset:bze,SidebarMenu:Tze,SidebarMenuAction:Pze,SidebarMenuBadge:Oze,SidebarMenuButton:jze,SidebarMenuItem:Rze,SidebarMenuSkeleton:Dze,SidebarMenuSub:zze,SidebarMenuSubButton:Hze,SidebarMenuSubItem:qze,SidebarProvider:kze,SidebarRail:xze,SidebarSeparator:Cze,SidebarTrigger:Mze,useSidebar:Y2,Skeleton:hP,Slider:mqe,Toaster:Kqe,Switch:hHe,Table:pHe,TableHeader:fHe,TableBody:yHe,TableFooter:mHe,TableHead:kHe,TableRow:vHe,TableCell:gHe,TableCaption:MHe,Textarea:xHe,Tooltip:xY,TooltipTrigger:bY,TooltipContent:wY,TooltipProvider:YO,VanillaJSONEditor:gP}),Object.assign(window.JSComponents,{VanillaJSONEditor:gP,HandsonTable:XY,MonacoEditor:KY,MultiSelect:eD})}const{createInertiaApp:qHe,router:YY}=HU;window.React=ke;window.ReactDOM=ur;window.InertiajsReact=HU;window.LucideReact=B_e;zHe();async function HHe(e,t){for(const a of Array.isArray(e)?e:[e]){const o=t[a];if(!(typeof o>"u"))return typeof o=="function"?o():o}throw new Error(`Page not found: ${e}`)}let tD=!1;YY.on("navigate",e=>{tD=!0});YY.on("finish",e=>{tD=!1});const _F=document.createElement.bind(document);document.createElement=function(e,t){const a=_F(e,t);return e.toLowerCase()==="iframe"&&tD?(console.warn("[Adminizer] Prevented iframe creation, forcing full page reload"),setTimeout(()=>{window.location.reload()},0),_F("div")):a};qHe({title:e=>`${e}`,resolve:e=>HHe(`./pages/${e}.tsx`,Object.assign({"./pages/add-group.tsx":()=>vn(()=>import("./add-group-DQi0lc1e.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url),"./pages/add-user.tsx":()=>vn(()=>import("./add-user-CNcCmpvV.js"),__vite__mapDeps([17,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,18,19]),import.meta.url),"./pages/add.tsx":()=>vn(()=>import("./add-BP2bkvcF.js"),__vite__mapDeps([20,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,21,22,23,24,19,25]),import.meta.url),"./pages/catalog.tsx":()=>vn(()=>import("./catalog-Ca9RdLCZ.js"),__vite__mapDeps([26,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,27,21,22,23,24,19,25,28]),import.meta.url),"./pages/dashboard.tsx":()=>vn(()=>import("./dashboard-Bcz5b5w6.js"),__vite__mapDeps([29,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,30]),import.meta.url),"./pages/form.tsx":()=>vn(()=>import("./form-Biwt3wOg.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,32,21,22,23,24,19,25]),import.meta.url),"./pages/history.tsx":()=>vn(()=>import("./history-DNn4VfTF.js"),__vite__mapDeps([33,3,4,25,1,2,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url),"./pages/home.tsx":()=>vn(()=>import("./home-BaGz7nwT.js"),__vite__mapDeps([34,4,3,5]),import.meta.url),"./pages/init-user.tsx":()=>vn(()=>import("./init-user-CsEDYKZe.js"),__vite__mapDeps([35,3,4,19,5]),import.meta.url),"./pages/list.tsx":()=>vn(()=>import("./list-dmqGUjt-.js"),__vite__mapDeps([36,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,37,27,38]),import.meta.url),"./pages/login.tsx":()=>vn(()=>import("./login-BfN1lJT1.js"),__vite__mapDeps([39,15,4,3,5,19]),import.meta.url),"./pages/module.tsx":()=>vn(()=>import("./module-B9a_e2wR.js"),__vite__mapDeps([40,3,4,1,2,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url),"./pages/notification.tsx":()=>vn(()=>import("./notification-DYPjSRl4.js"),__vite__mapDeps([41,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,42]),import.meta.url),"./pages/register.tsx":()=>vn(()=>import("./register-C2TFSMX0.js"),__vite__mapDeps([43,3,4,19,5]),import.meta.url),"./pages/welcome.tsx":()=>vn(()=>import("./welcome-BDZq6wiw.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url)})),setup({el:e,App:t,props:a}){Noe.createRoot(e).render(M.jsx(t,{...a}))},progress:{color:"#0f4898"}});export{gK as $,m$e as A,MA as B,lr as C,yX as D,s5 as E,v$e as F,DNe as G,zNe as H,jX as I,qNe as J,FNe as K,Fs as L,YO as M,xY as N,bY as O,I9 as P,wY as Q,hHe as R,vDe as S,Kqe as T,S$e as U,E$e as V,hr as W,uj as X,c2 as Y,s2 as Z,wSe as _,i5 as a,U8 as a$,MK as a0,lv as a1,W1 as a2,xK as a3,ONe as a4,pHe as a5,fHe as a6,vHe as a7,kHe as a8,yHe as a9,te as aA,PIe as aB,jIe as aC,yf as aD,Kp as aE,ef as aF,of as aG,$Ie as aH,Rs as aI,kt as aJ,z2 as aK,bn as aL,It as aM,xZ as aN,bZ as aO,xe as aP,Pn as aQ,DA as aR,O7 as aS,fM as aT,kze as aU,XHe as aV,Mje as aW,gy as aX,Sje as aY,Ije as aZ,Mze as a_,gHe as aa,vc as ab,TW as ac,jW as ad,PW as ae,OW as af,vG as ag,moe as ah,koe as ai,$U as aj,hVe as ak,jE as al,Rx as am,bze as an,vl as ao,bi as ap,YU as aq,xHe as ar,DHe as as,JO as at,cb as au,B8 as av,v_ as aw,sr as ax,UL as ay,M1 as az,Oje as b,kVe as b$,gze as b0,_ze as b1,Tze as b2,Rze as b3,CPe as b4,NPe as b5,IPe as b6,jze as b7,Qv as b8,APe as b9,b7 as bA,SN as bB,Dre as bC,zre as bD,qre as bE,Eje as bF,jx as bG,yVe as bH,fVe as bI,pVe as bJ,eD as bK,mqe as bL,Un as bM,c7 as bN,dVe as bO,lf as bP,v2 as bQ,r1 as bR,__ as bS,HPe as bT,VPe as bU,BPe as bV,FO as bW,FPe as bX,UPe as bY,mVe as bZ,vVe as b_,DPe as ba,zPe as bb,qPe as bc,TPe as bd,Lze as be,HG as bf,NLe as bg,FG as bh,zze as bi,qze as bj,Hze as bk,Nze as bl,Sze as bm,F_e as bn,U_e as bo,G_e as bp,Z_e as bq,W_e as br,X_e as bs,Eze as bt,Aze as bu,CLe as bv,LLe as bw,Y2 as bx,$De as by,wN as bz,MDe as c,gVe as c0,gDe as d,xDe as e,wDe as f,dLe as g,Nt as h,C$e as i,M as j,N$e as k,L$e as l,hP as m,Vre as n,Yw as o,Bf as p,vX as q,qU as r,bje as s,Oqe as t,TP as u,fc as v,wje as w,_je as x,s$e as y,l$e as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r,
|
|
1
|
+
import{j as r,bn as n,bo as i,bp as c,bq as d,br as l,ai as m,bs as h}from"./app.js";import{r as o}from"./handsontable-PxYdjN8c.js";import"./jsoneditor-De1FvcYu.js";import"./monaco-BhBYtg3d.js";function b({breadcrumbs:e}){return r.jsx(r.Fragment,{children:e.length>0&&r.jsx(n,{children:r.jsx(i,{children:e.map((s,a)=>{const t=a===e.length-1;return r.jsxs(o.Fragment,{children:[r.jsx(c,{children:t?r.jsx(d,{children:s.title}):r.jsx(l,{asChild:!0,children:r.jsx(m,{href:s.href,children:s.title})})}),!t&&r.jsx(h,{})]},a)})})})})}export{b as Breadcrumbs};
|