dgz-ui-shared 1.0.67 → 1.0.69

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.
@@ -1,4 +1,4 @@
1
- "use strict";const o=require("react"),e=require("./jsx-runtime-DUiatUiq.cjs"),w=require("./radio-group-CqPTye2U-CXc2TUFE.cjs"),i=require("./button-Bp2lHjov-D9UnCnYX.cjs"),v=require("./useTranslation-CZf20ucv.cjs"),l=require("./createLucideIcon-BnAj0RnC.cjs"),L=require("./lodash-C5w_OPmE.cjs"),d=require("./popover-HTqpqYpJ-Bx11rWT_.cjs"),S=require("./MyInput-yriz78UG.cjs"),z=require("./MySelect-DtdzVlXP.cjs"),H=require("./useFilter-CiORTEHP.cjs");/**
1
+ "use strict";const o=require("react"),e=require("./jsx-runtime-DUiatUiq.cjs"),w=require("./radio-group-CqPTye2U-CXc2TUFE.cjs"),i=require("./button-Bp2lHjov-D9UnCnYX.cjs"),v=require("./useTranslation-CZf20ucv.cjs"),l=require("./createLucideIcon-BnAj0RnC.cjs"),L=require("./lodash-C5w_OPmE.cjs"),h=require("./popover-HTqpqYpJ-Bx11rWT_.cjs"),S=require("./MyInput-yriz78UG.cjs"),z=require("./MySelect-DtdzVlXP.cjs"),H=require("./useFilter-CiORTEHP.cjs");/**
2
2
  * @license lucide-react v0.511.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -18,4 +18,4 @@
18
18
  *
19
19
  * This source code is licensed under the ISC license.
20
20
  * See the LICENSE file in the root directory of this source tree.
21
- */const B=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],F=l.createLucideIcon("search",B),D=({color:c="currentColor",size:t=24,className:r,...n})=>o.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:c,...n,className:"remixicon "+(r||"")},o.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"})),O=({color:c="currentColor",size:t=24,className:r,...n})=>o.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:c,...n,className:"remixicon "+(r||"")},o.createElement("path",{d:"M11 5H5V19H11V5ZM13 5V19H19V5H13ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3Z"})),A=({color:c="currentColor",size:t=24,className:r,...n})=>o.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:c,...n,className:"remixicon "+(r||"")},o.createElement("path",{d:"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"})),P=({name:c="search",defaultValue:t,onSearchChange:r})=>{const{t:n}=v.useTranslation(),a=u=>{const m=new FormData(u.currentTarget);r(m.get(c)),u.preventDefault()};return e.jsxRuntimeExports.jsxs("form",{className:"relative w-full max-w-64 min-w-40",onSubmit:a,children:[e.jsxRuntimeExports.jsx(w.yl,{className:"h-8 rounded-lg",name:c,placeholder:n("Search..."),defaultValue:t?`${t}`:""}),e.jsxRuntimeExports.jsx(i.u,{type:"submit",variant:"ghost",className:"text-foreground absolute top-0 right-0 cursor-pointer rounded-md !bg-transparent",size:"sm",children:e.jsxRuntimeExports.jsx(F,{})})]})},W=o.memo(function({filters:t,params:r,onFilter:n,onChange:a,onCancel:u,...m}){const{t:x}=v.useTranslation(),[R,g]=o.useState(!1),[C,p]=o.useState(!1),{form:j}=H.useFilter({params:r}),{watch:M,getValues:N,handleSubmit:b,control:E,reset:y}=j;o.useEffect(()=>{let s=!1;t.map(q=>{const h=L.lodashExports.get(r,`${q.name}`);(Array.isArray(h)?h.length>0:h)&&(s=!0),g(s)})},[t,r]),o.useEffect(()=>{a==null||a(N())},[M()]);const k=o.useCallback((s={})=>{n==null||n(s),p(!1)},[n]),f=o.useCallback(()=>{y(),n&&r&&n({...r,...Object.fromEntries(t.map(s=>[s.name,void 0]))}),p(!1)},[n,y,r,t]);return e.jsxRuntimeExports.jsxs(d.Oe,{open:C,onOpenChange:p,children:[e.jsxRuntimeExports.jsx(d._e,{children:e.jsxRuntimeExports.jsx(i.u,{asChild:!0,size:"sm",variant:"secondary",className:"ml-auto px-3",...m,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[R?e.jsxRuntimeExports.jsx($,{size:20}):e.jsxRuntimeExports.jsx(Z,{size:20})," ",e.jsxRuntimeExports.jsx("span",{className:"hidden lg:!inline",children:x("Filter")}),e.jsxRuntimeExports.jsx(I,{})]})})}),e.jsxRuntimeExports.jsx(d.ue,{side:"bottom",align:"end",className:"",children:e.jsxRuntimeExports.jsx(w.Ph,{...j,children:e.jsxRuntimeExports.jsxs("form",{onSubmit:b(k),className:"space-y-2",children:[e.jsxRuntimeExports.jsx("div",{className:"h-full shrink p-1",children:t.map(s=>s.options?e.jsxRuntimeExports.jsx(z.MySelect,{control:E,name:s.name,placeholder:s.placeholder,isMulti:s.isMulti,options:s.options,label:s.label},s.name):e.jsxRuntimeExports.jsx(S.MyInput,{control:E,placeholder:s.placeholder,name:s.name,label:s.label},s.name))}),e.jsxRuntimeExports.jsxs("div",{className:"flex shrink-0 justify-end gap-2",children:[e.jsxRuntimeExports.jsx(i.u,{variant:"destructive",type:"reset",size:"sm",onClick:f,children:x("Reset")}),e.jsxRuntimeExports.jsx(i.u,{type:"submit",size:"sm",children:x("Apply")})]})]})})})]})});exports.FilterWrapper=W;exports.Search=P;exports.f1=D;exports.pv=A;exports.yn=O;
21
+ */const B=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],F=l.createLucideIcon("search",B),D=({color:c="currentColor",size:t=24,className:r,...n})=>o.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:c,...n,className:"remixicon "+(r||"")},o.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"})),O=({color:c="currentColor",size:t=24,className:r,...n})=>o.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:c,...n,className:"remixicon "+(r||"")},o.createElement("path",{d:"M11 5H5V19H11V5ZM13 5V19H19V5H13ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3Z"})),A=({color:c="currentColor",size:t=24,className:r,...n})=>o.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:c,...n,className:"remixicon "+(r||"")},o.createElement("path",{d:"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"})),P=({name:c="search",defaultValue:t,onSearchChange:r})=>{const{t:n}=v.useTranslation(),a=u=>{const m=new FormData(u.currentTarget);r(m.get(c)||void 0),u.preventDefault()};return e.jsxRuntimeExports.jsxs("form",{className:"relative w-full max-w-64 min-w-40",onSubmit:a,children:[e.jsxRuntimeExports.jsx(w.yl,{className:"h-8 rounded-lg",name:c,placeholder:n("Search..."),defaultValue:t?`${t}`:""}),e.jsxRuntimeExports.jsx(i.u,{type:"submit",variant:"ghost",className:"text-foreground absolute top-0 right-0 cursor-pointer rounded-md !bg-transparent",size:"sm",children:e.jsxRuntimeExports.jsx(F,{})})]})},W=o.memo(function({filters:t,params:r,onFilter:n,onChange:a,onCancel:u,...m}){const{t:x}=v.useTranslation(),[R,g]=o.useState(!1),[C,p]=o.useState(!1),{form:j}=H.useFilter({params:r}),{watch:M,getValues:N,handleSubmit:b,control:E,reset:y}=j;o.useEffect(()=>{let s=!1;t.map(q=>{const d=L.lodashExports.get(r,`${q.name}`);(Array.isArray(d)?d.length>0:d)&&(s=!0),g(s)})},[t,r]),o.useEffect(()=>{a==null||a(N())},[M()]);const k=o.useCallback((s={})=>{n==null||n(s),p(!1)},[n]),f=o.useCallback(()=>{y(),n&&r&&n({...r,...Object.fromEntries(t.map(s=>[s.name,void 0]))}),p(!1)},[n,y,r,t]);return e.jsxRuntimeExports.jsxs(h.Oe,{open:C,onOpenChange:p,children:[e.jsxRuntimeExports.jsx(h._e,{children:e.jsxRuntimeExports.jsx(i.u,{asChild:!0,size:"sm",variant:"secondary",className:"ml-auto px-3",...m,children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[R?e.jsxRuntimeExports.jsx($,{size:20}):e.jsxRuntimeExports.jsx(Z,{size:20})," ",e.jsxRuntimeExports.jsx("span",{className:"hidden lg:!inline",children:x("Filter")}),e.jsxRuntimeExports.jsx(I,{})]})})}),e.jsxRuntimeExports.jsx(h.ue,{side:"bottom",align:"end",className:"",children:e.jsxRuntimeExports.jsx(w.Ph,{...j,children:e.jsxRuntimeExports.jsxs("form",{onSubmit:b(k),className:"space-y-2",children:[e.jsxRuntimeExports.jsx("div",{className:"h-full shrink p-1",children:t.map(s=>s.options?e.jsxRuntimeExports.jsx(z.MySelect,{control:E,name:s.name,placeholder:s.placeholder,isMulti:s.isMulti,options:s.options,label:s.label},s.name):e.jsxRuntimeExports.jsx(S.MyInput,{control:E,placeholder:s.placeholder,name:s.name,label:s.label},s.name))}),e.jsxRuntimeExports.jsxs("div",{className:"flex shrink-0 justify-end gap-2",children:[e.jsxRuntimeExports.jsx(i.u,{variant:"destructive",type:"reset",size:"sm",onClick:f,children:x("Reset")}),e.jsxRuntimeExports.jsx(i.u,{type:"submit",size:"sm",children:x("Apply")})]})]})})})]})});exports.FilterWrapper=W;exports.Search=P;exports.f1=D;exports.pv=A;exports.yn=O;
@@ -56,7 +56,7 @@ const G = [
56
56
  }) => {
57
57
  const { t: a } = g(), c = (m) => {
58
58
  const h = new FormData(m.currentTarget);
59
- o(h.get(r)), m.preventDefault();
59
+ o(h.get(r) || void 0), m.preventDefault();
60
60
  };
61
61
  return /* @__PURE__ */ e.jsxs(
62
62
  "form",
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../jsx-runtime-DUiatUiq.cjs"),O=require("../../button-Bp2lHjov-D9UnCnYX.cjs"),R=require("../../dropdown-menu-BPBcxHRB-towSSPIs.cjs"),L=require("../../MyLimitSelect-BFWr_fUn.cjs"),T=require("../../FilterWrapper-DiuKsyOG.cjs"),a=require("react"),E=require("../../lodash-C5w_OPmE.cjs"),m=require("../../index-DqTIeHVj-DlSOwhuZ.cjs"),n=require("../../utils-B6fNqzRf-BNysSCt9.cjs"),D=require("../../useSortable-ByFhUHQb.cjs"),F=require("../../radio-group-CqPTye2U-CXc2TUFE.cjs"),$=require("../../SortOrder-81BrXp3i.cjs"),G=require("../../Empty--unTFnpg.cjs"),I=require("../../createLucideIcon-BnAj0RnC.cjs"),J=require("../../Loader-bUUShWXh.cjs"),Q=require("../../useTranslation-CZf20ucv.cjs"),B=a.forwardRef(({className:s,...t},i)=>m.ae.jsx("table",{ref:i,className:n.mo("w-full caption-bottom text-sm",s),...t}));B.displayName="Table";const H=a.forwardRef(({className:s,...t},i)=>m.ae.jsx("thead",{ref:i,className:n.mo("[&_tr]:border-b",s),...t}));H.displayName="TableHeader";const U=a.forwardRef(({className:s,...t},i)=>m.ae.jsx("tbody",{ref:i,className:n.mo("[&_tr:last-child]:border-0",s),...t}));U.displayName="TableBody";const X=a.forwardRef(({className:s,...t},i)=>m.ae.jsx("tfoot",{ref:i,className:n.mo("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",s),...t}));X.displayName="TableFooter";const M=a.forwardRef(({className:s,...t},i)=>m.ae.jsx("tr",{ref:i,className:n.mo("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",s),...t}));M.displayName="TableRow";const q=a.forwardRef(({className:s,...t},i)=>m.ae.jsx("th",{ref:i,className:n.mo("text-muted-foreground h-12 px-4 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0",s),...t}));q.displayName="TableHead";const b=a.forwardRef(({className:s,...t},i)=>m.ae.jsx("td",{ref:i,className:n.mo("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...t}));b.displayName="TableCell";const Y=a.forwardRef(({className:s,...t},i)=>m.ae.jsx("caption",{ref:i,className:n.mo("text-muted-foreground mt-4 text-sm",s),...t}));Y.displayName="TableCaption";/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../jsx-runtime-DUiatUiq.cjs"),O=require("../../button-Bp2lHjov-D9UnCnYX.cjs"),R=require("../../dropdown-menu-BPBcxHRB-towSSPIs.cjs"),L=require("../../MyLimitSelect-BFWr_fUn.cjs"),T=require("../../FilterWrapper-B3eJ74dh.cjs"),a=require("react"),E=require("../../lodash-C5w_OPmE.cjs"),m=require("../../index-DqTIeHVj-DlSOwhuZ.cjs"),n=require("../../utils-B6fNqzRf-BNysSCt9.cjs"),D=require("../../useSortable-ByFhUHQb.cjs"),F=require("../../radio-group-CqPTye2U-CXc2TUFE.cjs"),$=require("../../SortOrder-81BrXp3i.cjs"),G=require("../../Empty--unTFnpg.cjs"),I=require("../../createLucideIcon-BnAj0RnC.cjs"),J=require("../../Loader-bUUShWXh.cjs"),Q=require("../../useTranslation-CZf20ucv.cjs"),B=a.forwardRef(({className:s,...r},i)=>m.ae.jsx("table",{ref:i,className:n.mo("w-full caption-bottom text-sm",s),...r}));B.displayName="Table";const H=a.forwardRef(({className:s,...r},i)=>m.ae.jsx("thead",{ref:i,className:n.mo("[&_tr]:border-b",s),...r}));H.displayName="TableHeader";const U=a.forwardRef(({className:s,...r},i)=>m.ae.jsx("tbody",{ref:i,className:n.mo("[&_tr:last-child]:border-0",s),...r}));U.displayName="TableBody";const X=a.forwardRef(({className:s,...r},i)=>m.ae.jsx("tfoot",{ref:i,className:n.mo("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",s),...r}));X.displayName="TableFooter";const M=a.forwardRef(({className:s,...r},i)=>m.ae.jsx("tr",{ref:i,className:n.mo("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",s),...r}));M.displayName="TableRow";const q=a.forwardRef(({className:s,...r},i)=>m.ae.jsx("th",{ref:i,className:n.mo("text-muted-foreground h-12 px-4 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0",s),...r}));q.displayName="TableHead";const b=a.forwardRef(({className:s,...r},i)=>m.ae.jsx("td",{ref:i,className:n.mo("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...r}));b.displayName="TableCell";const Y=a.forwardRef(({className:s,...r},i)=>m.ae.jsx("caption",{ref:i,className:n.mo("text-muted-foreground mt-4 text-sm",s),...r}));Y.displayName="TableCaption";/**
2
2
  * @license lucide-react v0.511.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -18,4 +18,4 @@
18
18
  *
19
19
  * This source code is licensed under the ISC license.
20
20
  * See the LICENSE file in the root directory of this source tree.
21
- */const te=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],re=I.createLucideIcon("refresh-cw",te),S=({rows:s=[],columns:t,onRowClick:i,rowKey:j,params:c={page:1,limit:L.DEFAULT_LIMIT},hasNumbers:u=!1,hasCheckbox:N=!1,selectedItems:_,onSelectedItemsChange:w,onSortOrderChange:l,isStickyHeader:z})=>{const{sortObject:d,handleSort:y}=D.useSortable({sortField:c==null?void 0:c.sortField,sortOrder:c==null?void 0:c.sortField,onSortOrderChange:l}),{selectedRows:h,isRowSelected:f,isAllRowsSelected:p,handleSelectAllRows:k,handleSelectRow:g}=D.useDataTable({rows:s,defaultSelectedRows:_});return a.useEffect(()=>{w&&w(h)},[h]),e.jsxRuntimeExports.jsxs(B,{className:"relative",children:[e.jsxRuntimeExports.jsx(H,{className:n.mo("bg-bg",z&&"sticky top-0 z-10"),children:e.jsxRuntimeExports.jsxs(M,{children:[N&&e.jsxRuntimeExports.jsx(q,{className:"w-12 p-3",children:e.jsxRuntimeExports.jsx(F.Tl,{className:"mt-1",checked:p(j),onCheckedChange:r=>k(j,!!r),"aria-label":"Select all"})}),u&&e.jsxRuntimeExports.jsx(q,{className:"w-12 p-2",children:"#"}),t.filter(r=>!r.hidden).map(r=>e.jsxRuntimeExports.jsx(q,{style:r.styles,className:n.mo("p-2",r.sortable&&"cursor-pointer"),onClick:()=>y(r.dataIndex),children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[r.name," ",r.sortable&&((d==null?void 0:d.sortField)===r.key?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[(d==null?void 0:d.sortOrder)===$.SortOrder.DESC&&e.jsxRuntimeExports.jsx(K,{size:15}),(d==null?void 0:d.sortOrder)===$.SortOrder.ASC&&e.jsxRuntimeExports.jsx(se,{size:15})]}):e.jsxRuntimeExports.jsx(P,{size:15}))]})},r.key))]})}),e.jsxRuntimeExports.jsx(U,{className:"[&>tr:nth-child(even)]:bg-bg-secondary",children:s.length?s.map((r,v)=>e.jsxRuntimeExports.jsxs(M,{onClick:()=>i==null?void 0:i(r),className:n.mo(i&&"cursor-pointer"),"data-state":f(r[j])&&"selected",children:[N&&e.jsxRuntimeExports.jsx(b,{className:"w-12 p-3",onClick:x=>x.stopPropagation(),children:e.jsxRuntimeExports.jsx(F.Tl,{className:"mt-1",checked:f(r[j]),onCheckedChange:x=>g(r[j],!!x),"aria-label":"Select row"})}),u&&e.jsxRuntimeExports.jsx(b,{className:"w-12 p-2",children:(c.page-1)*(c.limit||L.DEFAULT_LIMIT)+v+1}),t.filter(x=>!x.hidden).map(x=>e.jsxRuntimeExports.jsx(b,{className:"text-body-xs-medium max-w-xs overflow-hidden p-2 text-ellipsis",style:x.styles,children:x.render?x.render(E.lodashExports.get(r,x.dataIndex),r):E.lodashExports.get(r,x.dataIndex,"")},`${v}-${x.key}`))]},`${r[j]}`)):e.jsxRuntimeExports.jsx(M,{children:e.jsxRuntimeExports.jsx(b,{colSpan:u?N?t.length+2:t.length+1:t.length,children:e.jsxRuntimeExports.jsx(G.Empty,{})})})})]})},ie=({dataSource:s,columns:t,onRowClick:i,rowKey:j,hasNumbers:c,hasSearch:u,hasCheckbox:N,hasPagination:_,isStickyHeader:w,onParamChange:l,dataKey:z="docs",loading:d,tableKey:y,filters:h=[],handleFilterChange:f,params:p,hasColumnsVisibilityDropdown:k})=>{const{t:g}=Q.useTranslation(),[r,v]=a.useState([]),{formattedColumns:x,handleColumnsChange:V,resetColumns:W}=D.useColumns({key:y,columns:t});return e.jsxRuntimeExports.jsxs("div",{className:"border-border-alpha-light flex grow flex-col overflow-auto rounded-xl border shadow-xs",children:[(u||k&&y||!E.lodashExports.isEmpty(h))&&e.jsxRuntimeExports.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"w-full shrink",children:u&&e.jsxRuntimeExports.jsx(T.Search,{defaultValue:E.lodashExports.get(p,"search",""),onSearchChange:o=>l==null?void 0:l({...p,search:o,page:1})})}),e.jsxRuntimeExports.jsxs("div",{className:"flex shrink-0 items-center justify-end gap-3",children:[k&&y&&e.jsxRuntimeExports.jsxs(R.Nt,{children:[e.jsxRuntimeExports.jsx(R.jt,{asChild:!0,children:e.jsxRuntimeExports.jsxs(O.u,{variant:"secondary",size:"sm",className:"ml-auto rounded-lg px-3",children:[e.jsxRuntimeExports.jsx(T.yn,{})," ",e.jsxRuntimeExports.jsx("span",{className:"hidden lg:!inline",children:g("Customize columns")}),e.jsxRuntimeExports.jsx(T.f1,{})]})}),e.jsxRuntimeExports.jsxs(R.ut,{align:"end",children:[e.jsxRuntimeExports.jsxs(R.it,{className:"capitalize",onClick:W,children:[e.jsxRuntimeExports.jsx(re,{})," ",g("Reset columns")]}),e.jsxRuntimeExports.jsx(R.ft,{}),x.map(o=>e.jsxRuntimeExports.jsx(R.dt,{className:"capitalize",checked:!o.hidden,onCheckedChange:A=>V(o,!A),children:o.name},o.key))]})]}),!E.lodashExports.isEmpty(h)&&e.jsxRuntimeExports.jsx(T.FilterWrapper,{filters:h,onFilter:o=>{l==null||l({...p,...o,page:1}),f==null||f(o)}})]})]}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col overflow-auto border-y",children:d?e.jsxRuntimeExports.jsx(J.Loader,{}):e.jsxRuntimeExports.jsx(S,{params:p,rows:E.lodashExports.get(s,z,[]),rowKey:j,selectedItems:r,isStickyHeader:w,columns:x,hasCheckbox:N,hasNumbers:c,onRowClick:i,onSelectedItemsChange:v,onSortOrderChange:({sortField:o,sortOrder:A})=>{l==null||l({...p,sortField:o,sortOrder:A})}})}),_&&e.jsxRuntimeExports.jsxs("div",{className:"flex shrink-0 flex-col items-center justify-between gap-3 p-4 lg:flex-row",children:[e.jsxRuntimeExports.jsx("div",{className:"text-sm",children:e.jsxRuntimeExports.jsx(L.MyLimitSelect,{onLimitChange:o=>l==null?void 0:l({...p,limit:o,page:1}),defaultValue:s==null?void 0:s.limit})}),e.jsxRuntimeExports.jsxs("div",{className:"text-muted-foreground text-sm",children:[r.length," of ",(s==null?void 0:s.total)||0," row(s) selected."]}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(L.MyPagination,{onPageChange:o=>l==null?void 0:l({...p,page:o}),currentPage:s==null?void 0:s.page,totalPages:s==null?void 0:s.totalPages})})]})]})};exports.DataTable=ie;exports.MyTable=S;
21
+ */const te=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],re=I.createLucideIcon("refresh-cw",te),S=({rows:s=[],columns:r,onRowClick:i,rowKey:j,params:c={page:1,limit:L.DEFAULT_LIMIT},hasNumbers:u=!1,hasCheckbox:N=!1,selectedItems:_,onSelectedItemsChange:w,onSortOrderChange:l,isStickyHeader:z})=>{const{sortObject:d,handleSort:y}=D.useSortable({sortField:c==null?void 0:c.sortField,sortOrder:c==null?void 0:c.sortField,onSortOrderChange:l}),{selectedRows:h,isRowSelected:f,isAllRowsSelected:p,handleSelectAllRows:k,handleSelectRow:g}=D.useDataTable({rows:s,defaultSelectedRows:_});return a.useEffect(()=>{w&&w(h)},[h]),e.jsxRuntimeExports.jsxs(B,{className:"relative",children:[e.jsxRuntimeExports.jsx(H,{className:n.mo("bg-bg",z&&"sticky top-0 z-10"),children:e.jsxRuntimeExports.jsxs(M,{children:[N&&e.jsxRuntimeExports.jsx(q,{className:"w-12 p-3",children:e.jsxRuntimeExports.jsx(F.Tl,{className:"mt-1",checked:p(j),onCheckedChange:t=>k(j,!!t),"aria-label":"Select all"})}),u&&e.jsxRuntimeExports.jsx(q,{className:"w-12 p-2",children:"#"}),r.filter(t=>!t.hidden).map(t=>e.jsxRuntimeExports.jsx(q,{style:t.styles,className:n.mo("p-2",t.sortable&&"cursor-pointer"),onClick:()=>t.sortable&&y(t.dataIndex),children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[t.name," ",t.sortable&&((d==null?void 0:d.sortField)===t.key?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[(d==null?void 0:d.sortOrder)===$.SortOrder.DESC&&e.jsxRuntimeExports.jsx(K,{size:15}),(d==null?void 0:d.sortOrder)===$.SortOrder.ASC&&e.jsxRuntimeExports.jsx(se,{size:15})]}):e.jsxRuntimeExports.jsx(P,{size:15}))]})},t.key))]})}),e.jsxRuntimeExports.jsx(U,{className:"[&>tr:nth-child(even)]:bg-bg-secondary",children:s.length?s.map((t,v)=>e.jsxRuntimeExports.jsxs(M,{onClick:()=>i==null?void 0:i(t),className:n.mo(i&&"cursor-pointer"),"data-state":f(t[j])&&"selected",children:[N&&e.jsxRuntimeExports.jsx(b,{className:"w-12 p-3",onClick:x=>x.stopPropagation(),children:e.jsxRuntimeExports.jsx(F.Tl,{className:"mt-1",checked:f(t[j]),onCheckedChange:x=>g(t[j],!!x),"aria-label":"Select row"})}),u&&e.jsxRuntimeExports.jsx(b,{className:"w-12 p-2",children:(c.page-1)*(c.limit||L.DEFAULT_LIMIT)+v+1}),r.filter(x=>!x.hidden).map(x=>e.jsxRuntimeExports.jsx(b,{className:"text-body-xs-medium max-w-xs p-2",style:x.styles,children:x.render?x.render(E.lodashExports.get(t,x.dataIndex),t):E.lodashExports.get(t,x.dataIndex,"")},`${v}-${x.key}`))]},`${t[j]}`)):e.jsxRuntimeExports.jsx(M,{children:e.jsxRuntimeExports.jsx(b,{colSpan:u?N?r.length+2:r.length+1:r.length,children:e.jsxRuntimeExports.jsx(G.Empty,{})})})})]})},ie=({dataSource:s,columns:r,onRowClick:i,rowKey:j,hasNumbers:c,hasSearch:u,hasCheckbox:N,hasPagination:_,isStickyHeader:w,onParamChange:l,dataKey:z="docs",loading:d,tableKey:y,filters:h=[],handleFilterChange:f,params:p,hasColumnsVisibilityDropdown:k})=>{const{t:g}=Q.useTranslation(),[t,v]=a.useState([]),{formattedColumns:x,handleColumnsChange:V,resetColumns:W}=D.useColumns({key:y,columns:r});return e.jsxRuntimeExports.jsxs("div",{className:"border-border-alpha-light flex grow flex-col overflow-auto rounded-xl border shadow-xs",children:[(u||k&&y||!E.lodashExports.isEmpty(h))&&e.jsxRuntimeExports.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 p-4",children:[e.jsxRuntimeExports.jsx("div",{className:"w-full shrink",children:u&&e.jsxRuntimeExports.jsx(T.Search,{defaultValue:E.lodashExports.get(p,"search",""),onSearchChange:o=>l==null?void 0:l({...p,search:o,page:1})})}),e.jsxRuntimeExports.jsxs("div",{className:"flex shrink-0 items-center justify-end gap-3",children:[k&&y&&e.jsxRuntimeExports.jsxs(R.Nt,{children:[e.jsxRuntimeExports.jsx(R.jt,{asChild:!0,children:e.jsxRuntimeExports.jsxs(O.u,{variant:"secondary",size:"sm",className:"ml-auto rounded-lg px-3",children:[e.jsxRuntimeExports.jsx(T.yn,{})," ",e.jsxRuntimeExports.jsx("span",{className:"hidden lg:!inline",children:g("Customize columns")}),e.jsxRuntimeExports.jsx(T.f1,{})]})}),e.jsxRuntimeExports.jsxs(R.ut,{align:"end",children:[e.jsxRuntimeExports.jsxs(R.it,{className:"capitalize",onClick:W,children:[e.jsxRuntimeExports.jsx(re,{})," ",g("Reset columns")]}),e.jsxRuntimeExports.jsx(R.ft,{}),x.map(o=>e.jsxRuntimeExports.jsx(R.dt,{className:"capitalize",checked:!o.hidden,onCheckedChange:A=>V(o,!A),children:o.name},o.key))]})]}),!E.lodashExports.isEmpty(h)&&e.jsxRuntimeExports.jsx(T.FilterWrapper,{filters:h,onFilter:o=>{l==null||l({...p,...o,page:1}),f==null||f(o)}})]})]}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col overflow-auto border-y",children:d?e.jsxRuntimeExports.jsx(J.Loader,{}):e.jsxRuntimeExports.jsx(S,{params:p,rows:E.lodashExports.get(s,z,[]),rowKey:j,selectedItems:t,isStickyHeader:w,columns:x,hasCheckbox:N,hasNumbers:c,onRowClick:i,onSelectedItemsChange:v,onSortOrderChange:({sortField:o,sortOrder:A})=>{l==null||l({...p,sortField:o,sortOrder:A})}})}),_&&e.jsxRuntimeExports.jsxs("div",{className:"flex shrink-0 flex-col items-center justify-between gap-3 p-4 lg:flex-row",children:[e.jsxRuntimeExports.jsx("div",{className:"text-sm",children:e.jsxRuntimeExports.jsx(L.MyLimitSelect,{onLimitChange:o=>l==null?void 0:l({...p,limit:o,page:1}),defaultValue:s==null?void 0:s.limit})}),e.jsxRuntimeExports.jsxs("div",{className:"text-muted-foreground text-sm",children:[t.length," of ",(s==null?void 0:s.total)||0," row(s) selected."]}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(L.MyPagination,{onPageChange:o=>l==null?void 0:l({...p,page:o}),currentPage:s==null?void 0:s.page,totalPages:s==null?void 0:s.totalPages})})]})]})};exports.DataTable=ie;exports.MyTable=S;
@@ -2,7 +2,7 @@ import { j as e } from "../../jsx-runtime-C5mzlN2N.js";
2
2
  import { u as V } from "../../button-Bp2lHjov-BTlHPcva.js";
3
3
  import { N as W, j as B, u as G, i as J, f as O, d as Q } from "../../dropdown-menu-BPBcxHRB-EjT0ADL9.js";
4
4
  import { D as A, a as S, M as X } from "../../MyLimitSelect-Bzc40bxS.js";
5
- import { S as Y, y as Z, f as K, F as C } from "../../FilterWrapper-DwZpntbw.js";
5
+ import { S as Y, y as Z, f as K, F as C } from "../../FilterWrapper-yAOBKFII.js";
6
6
  import { forwardRef as p, useEffect as P, useState as ee } from "react";
7
7
  import { l as y } from "../../lodash-CYNxjS-I.js";
8
8
  import { a as h } from "../../index-DqTIeHVj-CeLMF2B2.js";
@@ -15,28 +15,28 @@ import { c as E } from "../../createLucideIcon-B950nf2d.js";
15
15
  import { L as ie } from "../../Loader-CVKJNLck.js";
16
16
  import { u as re } from "../../useTranslation-dH-uwymc.js";
17
17
  const F = p(
18
- ({ className: s, ...t }, d) => /* @__PURE__ */ h.jsx(
18
+ ({ className: s, ...l }, d) => /* @__PURE__ */ h.jsx(
19
19
  "table",
20
20
  {
21
21
  ref: d,
22
22
  className: o("w-full caption-bottom text-sm", s),
23
- ...t
23
+ ...l
24
24
  }
25
25
  )
26
26
  );
27
27
  F.displayName = "Table";
28
- const $ = p(({ className: s, ...t }, d) => /* @__PURE__ */ h.jsx("thead", { ref: d, className: o("[&_tr]:border-b", s), ...t }));
28
+ const $ = p(({ className: s, ...l }, d) => /* @__PURE__ */ h.jsx("thead", { ref: d, className: o("[&_tr]:border-b", s), ...l }));
29
29
  $.displayName = "TableHeader";
30
- const q = p(({ className: s, ...t }, d) => /* @__PURE__ */ h.jsx(
30
+ const q = p(({ className: s, ...l }, d) => /* @__PURE__ */ h.jsx(
31
31
  "tbody",
32
32
  {
33
33
  ref: d,
34
34
  className: o("[&_tr:last-child]:border-0", s),
35
- ...t
35
+ ...l
36
36
  }
37
37
  ));
38
38
  q.displayName = "TableBody";
39
- const ce = p(({ className: s, ...t }, d) => /* @__PURE__ */ h.jsx(
39
+ const ae = p(({ className: s, ...l }, d) => /* @__PURE__ */ h.jsx(
40
40
  "tfoot",
41
41
  {
42
42
  ref: d,
@@ -44,11 +44,11 @@ const ce = p(({ className: s, ...t }, d) => /* @__PURE__ */ h.jsx(
44
44
  "bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",
45
45
  s
46
46
  ),
47
- ...t
47
+ ...l
48
48
  }
49
49
  ));
50
- ce.displayName = "TableFooter";
51
- const T = p(({ className: s, ...t }, d) => /* @__PURE__ */ h.jsx(
50
+ ae.displayName = "TableFooter";
51
+ const T = p(({ className: s, ...l }, d) => /* @__PURE__ */ h.jsx(
52
52
  "tr",
53
53
  {
54
54
  ref: d,
@@ -56,11 +56,11 @@ const T = p(({ className: s, ...t }, d) => /* @__PURE__ */ h.jsx(
56
56
  "hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",
57
57
  s
58
58
  ),
59
- ...t
59
+ ...l
60
60
  }
61
61
  ));
62
62
  T.displayName = "TableRow";
63
- const _ = p(({ className: s, ...t }, d) => /* @__PURE__ */ h.jsx(
63
+ const _ = p(({ className: s, ...l }, d) => /* @__PURE__ */ h.jsx(
64
64
  "th",
65
65
  {
66
66
  ref: d,
@@ -68,28 +68,28 @@ const _ = p(({ className: s, ...t }, d) => /* @__PURE__ */ h.jsx(
68
68
  "text-muted-foreground h-12 px-4 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0",
69
69
  s
70
70
  ),
71
- ...t
71
+ ...l
72
72
  }
73
73
  ));
74
74
  _.displayName = "TableHead";
75
- const w = p(({ className: s, ...t }, d) => /* @__PURE__ */ h.jsx(
75
+ const w = p(({ className: s, ...l }, d) => /* @__PURE__ */ h.jsx(
76
76
  "td",
77
77
  {
78
78
  ref: d,
79
79
  className: o("p-4 align-middle [&:has([role=checkbox])]:pr-0", s),
80
- ...t
80
+ ...l
81
81
  }
82
82
  ));
83
83
  w.displayName = "TableCell";
84
- const ae = p(({ className: s, ...t }, d) => /* @__PURE__ */ h.jsx(
84
+ const ce = p(({ className: s, ...l }, d) => /* @__PURE__ */ h.jsx(
85
85
  "caption",
86
86
  {
87
87
  ref: d,
88
88
  className: o("text-muted-foreground mt-4 text-sm", s),
89
- ...t
89
+ ...l
90
90
  }
91
91
  ));
92
- ae.displayName = "TableCaption";
92
+ ce.displayName = "TableCaption";
93
93
  /**
94
94
  * @license lucide-react v0.511.0 - ISC
95
95
  *
@@ -109,12 +109,12 @@ const oe = [
109
109
  * This source code is licensed under the ISC license.
110
110
  * See the LICENSE file in the root directory of this source tree.
111
111
  */
112
- const ne = [
112
+ const me = [
113
113
  ["path", { d: "m21 16-4 4-4-4", key: "f6ql7i" }],
114
114
  ["path", { d: "M17 20V4", key: "1ejh1v" }],
115
115
  ["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
116
116
  ["path", { d: "M7 4v16", key: "1glfcx" }]
117
- ], me = E("arrow-up-down", ne);
117
+ ], ne = E("arrow-up-down", me);
118
118
  /**
119
119
  * @license lucide-react v0.511.0 - ISC
120
120
  *
@@ -141,28 +141,28 @@ const fe = [
141
141
  ["path", { d: "M8 16H3v5", key: "1cv678" }]
142
142
  ], je = E("refresh-cw", fe), Ne = ({
143
143
  rows: s = [],
144
- columns: t,
144
+ columns: l,
145
145
  onRowClick: d,
146
- rowKey: m,
146
+ rowKey: n,
147
147
  params: x = {
148
148
  page: 1,
149
149
  limit: A
150
150
  },
151
151
  hasNumbers: f = !1,
152
- hasCheckbox: k = !1,
152
+ hasCheckbox: b = !1,
153
153
  selectedItems: L,
154
154
  onSelectedItemsChange: g,
155
155
  onSortOrderChange: i,
156
156
  isStickyHeader: z
157
157
  }) => {
158
- const { sortObject: a, handleSort: b } = se({
158
+ const { sortObject: c, handleSort: k } = se({
159
159
  sortField: x == null ? void 0 : x.sortField,
160
160
  sortOrder: x == null ? void 0 : x.sortField,
161
161
  onSortOrderChange: i
162
162
  }), {
163
163
  selectedRows: j,
164
164
  isRowSelected: N,
165
- isAllRowsSelected: n,
165
+ isAllRowsSelected: m,
166
166
  handleSelectAllRows: v,
167
167
  handleSelectRow: u
168
168
  } = te({ rows: s, defaultSelectedRows: L });
@@ -174,44 +174,44 @@ const fe = [
174
174
  {
175
175
  className: o("bg-bg", z && "sticky top-0 z-10"),
176
176
  children: /* @__PURE__ */ e.jsxs(T, { children: [
177
- k && /* @__PURE__ */ e.jsx(_, { className: "w-12 p-3", children: /* @__PURE__ */ e.jsx(
177
+ b && /* @__PURE__ */ e.jsx(_, { className: "w-12 p-3", children: /* @__PURE__ */ e.jsx(
178
178
  I,
179
179
  {
180
180
  className: "mt-1",
181
- checked: n(m),
182
- onCheckedChange: (l) => v(m, !!l),
181
+ checked: m(n),
182
+ onCheckedChange: (t) => v(n, !!t),
183
183
  "aria-label": "Select all"
184
184
  }
185
185
  ) }),
186
186
  f && /* @__PURE__ */ e.jsx(_, { className: "w-12 p-2", children: "#" }),
187
- t.filter((l) => !l.hidden).map((l) => /* @__PURE__ */ e.jsx(
187
+ l.filter((t) => !t.hidden).map((t) => /* @__PURE__ */ e.jsx(
188
188
  _,
189
189
  {
190
- style: l.styles,
191
- className: o("p-2", l.sortable && "cursor-pointer"),
192
- onClick: () => b(l.dataIndex),
190
+ style: t.styles,
191
+ className: o("p-2", t.sortable && "cursor-pointer"),
192
+ onClick: () => t.sortable && k(t.dataIndex),
193
193
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
194
- l.name,
194
+ t.name,
195
195
  " ",
196
- l.sortable && ((a == null ? void 0 : a.sortField) === l.key ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
197
- (a == null ? void 0 : a.sortOrder) === D.DESC && /* @__PURE__ */ e.jsx(xe, { size: 15 }),
198
- (a == null ? void 0 : a.sortOrder) === D.ASC && /* @__PURE__ */ e.jsx(he, { size: 15 })
199
- ] }) : /* @__PURE__ */ e.jsx(me, { size: 15 }))
196
+ t.sortable && ((c == null ? void 0 : c.sortField) === t.key ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
197
+ (c == null ? void 0 : c.sortOrder) === D.DESC && /* @__PURE__ */ e.jsx(xe, { size: 15 }),
198
+ (c == null ? void 0 : c.sortOrder) === D.ASC && /* @__PURE__ */ e.jsx(he, { size: 15 })
199
+ ] }) : /* @__PURE__ */ e.jsx(ne, { size: 15 }))
200
200
  ] })
201
201
  },
202
- l.key
202
+ t.key
203
203
  ))
204
204
  ] })
205
205
  }
206
206
  ),
207
- /* @__PURE__ */ e.jsx(q, { className: "[&>tr:nth-child(even)]:bg-bg-secondary", children: s.length ? s.map((l, M) => /* @__PURE__ */ e.jsxs(
207
+ /* @__PURE__ */ e.jsx(q, { className: "[&>tr:nth-child(even)]:bg-bg-secondary", children: s.length ? s.map((t, M) => /* @__PURE__ */ e.jsxs(
208
208
  T,
209
209
  {
210
- onClick: () => d == null ? void 0 : d(l),
210
+ onClick: () => d == null ? void 0 : d(t),
211
211
  className: o(d && "cursor-pointer"),
212
- "data-state": N(l[m]) && "selected",
212
+ "data-state": N(t[n]) && "selected",
213
213
  children: [
214
- k && /* @__PURE__ */ e.jsx(
214
+ b && /* @__PURE__ */ e.jsx(
215
215
  w,
216
216
  {
217
217
  className: "w-12 p-3",
@@ -220,69 +220,69 @@ const fe = [
220
220
  I,
221
221
  {
222
222
  className: "mt-1",
223
- checked: N(l[m]),
224
- onCheckedChange: (r) => u(l[m], !!r),
223
+ checked: N(t[n]),
224
+ onCheckedChange: (r) => u(t[n], !!r),
225
225
  "aria-label": "Select row"
226
226
  }
227
227
  )
228
228
  }
229
229
  ),
230
230
  f && /* @__PURE__ */ e.jsx(w, { className: "w-12 p-2", children: (x.page - 1) * (x.limit || A) + M + 1 }),
231
- t.filter((r) => !r.hidden).map((r) => /* @__PURE__ */ e.jsx(
231
+ l.filter((r) => !r.hidden).map((r) => /* @__PURE__ */ e.jsx(
232
232
  w,
233
233
  {
234
- className: "text-body-xs-medium max-w-xs overflow-hidden p-2 text-ellipsis",
234
+ className: "text-body-xs-medium max-w-xs p-2",
235
235
  style: r.styles,
236
- children: r.render ? r.render(y.get(l, r.dataIndex), l) : y.get(l, r.dataIndex, "")
236
+ children: r.render ? r.render(y.get(t, r.dataIndex), t) : y.get(t, r.dataIndex, "")
237
237
  },
238
238
  `${M}-${r.key}`
239
239
  ))
240
240
  ]
241
241
  },
242
- `${l[m]}`
242
+ `${t[n]}`
243
243
  )) : /* @__PURE__ */ e.jsx(T, { children: /* @__PURE__ */ e.jsx(
244
244
  w,
245
245
  {
246
- colSpan: f ? k ? t.length + 2 : t.length + 1 : t.length,
246
+ colSpan: f ? b ? l.length + 2 : l.length + 1 : l.length,
247
247
  children: /* @__PURE__ */ e.jsx(de, {})
248
248
  }
249
249
  ) }) })
250
250
  ] });
251
251
  }, De = ({
252
252
  dataSource: s,
253
- columns: t,
253
+ columns: l,
254
254
  onRowClick: d,
255
- rowKey: m,
255
+ rowKey: n,
256
256
  hasNumbers: x,
257
257
  hasSearch: f,
258
- hasCheckbox: k,
258
+ hasCheckbox: b,
259
259
  hasPagination: L,
260
260
  isStickyHeader: g,
261
261
  onParamChange: i,
262
262
  dataKey: z = "docs",
263
- loading: a,
264
- tableKey: b,
263
+ loading: c,
264
+ tableKey: k,
265
265
  filters: j = [],
266
266
  handleFilterChange: N,
267
- params: n,
267
+ params: m,
268
268
  hasColumnsVisibilityDropdown: v
269
269
  }) => {
270
- const { t: u } = re(), [l, M] = ee([]), { formattedColumns: r, handleColumnsChange: H, resetColumns: U } = le({ key: b, columns: t });
270
+ const { t: u } = re(), [t, M] = ee([]), { formattedColumns: r, handleColumnsChange: H, resetColumns: U } = le({ key: k, columns: l });
271
271
  return /* @__PURE__ */ e.jsxs(
272
272
  "div",
273
273
  {
274
274
  className: "border-border-alpha-light flex grow flex-col overflow-auto rounded-xl border shadow-xs",
275
275
  children: [
276
- (f || v && b || !y.isEmpty(j)) && /* @__PURE__ */ e.jsxs("div", { className: "flex shrink-0 items-center justify-between gap-3 p-4", children: [
276
+ (f || v && k || !y.isEmpty(j)) && /* @__PURE__ */ e.jsxs("div", { className: "flex shrink-0 items-center justify-between gap-3 p-4", children: [
277
277
  /* @__PURE__ */ e.jsx("div", { className: "w-full shrink", children: f && /* @__PURE__ */ e.jsx(
278
278
  Y,
279
279
  {
280
- defaultValue: y.get(n, "search", ""),
281
- onSearchChange: (c) => i == null ? void 0 : i({ ...n, search: c, page: 1 })
280
+ defaultValue: y.get(m, "search", ""),
281
+ onSearchChange: (a) => i == null ? void 0 : i({ ...m, search: a, page: 1 })
282
282
  }
283
283
  ) }),
284
284
  /* @__PURE__ */ e.jsxs("div", { className: "flex shrink-0 items-center justify-end gap-3", children: [
285
- v && b && /* @__PURE__ */ e.jsxs(W, { children: [
285
+ v && k && /* @__PURE__ */ e.jsxs(W, { children: [
286
286
  /* @__PURE__ */ e.jsx(B, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
287
287
  V,
288
288
  {
@@ -311,15 +311,15 @@ const fe = [
311
311
  }
312
312
  ),
313
313
  /* @__PURE__ */ e.jsx(O, {}),
314
- r.map((c) => /* @__PURE__ */ e.jsx(
314
+ r.map((a) => /* @__PURE__ */ e.jsx(
315
315
  Q,
316
316
  {
317
317
  className: "capitalize",
318
- checked: !c.hidden,
319
- onCheckedChange: (R) => H(c, !R),
320
- children: c.name
318
+ checked: !a.hidden,
319
+ onCheckedChange: (R) => H(a, !R),
320
+ children: a.name
321
321
  },
322
- c.key
322
+ a.key
323
323
  ))
324
324
  ] })
325
325
  ] }),
@@ -327,28 +327,28 @@ const fe = [
327
327
  C,
328
328
  {
329
329
  filters: j,
330
- onFilter: (c) => {
331
- i == null || i({ ...n, ...c, page: 1 }), N == null || N(c);
330
+ onFilter: (a) => {
331
+ i == null || i({ ...m, ...a, page: 1 }), N == null || N(a);
332
332
  }
333
333
  }
334
334
  )
335
335
  ] })
336
336
  ] }),
337
- /* @__PURE__ */ e.jsx("div", { className: "flex flex-col overflow-auto border-y", children: a ? /* @__PURE__ */ e.jsx(ie, {}) : /* @__PURE__ */ e.jsx(
337
+ /* @__PURE__ */ e.jsx("div", { className: "flex flex-col overflow-auto border-y", children: c ? /* @__PURE__ */ e.jsx(ie, {}) : /* @__PURE__ */ e.jsx(
338
338
  Ne,
339
339
  {
340
- params: n,
340
+ params: m,
341
341
  rows: y.get(s, z, []),
342
- rowKey: m,
343
- selectedItems: l,
342
+ rowKey: n,
343
+ selectedItems: t,
344
344
  isStickyHeader: g,
345
345
  columns: r,
346
- hasCheckbox: k,
346
+ hasCheckbox: b,
347
347
  hasNumbers: x,
348
348
  onRowClick: d,
349
349
  onSelectedItemsChange: M,
350
- onSortOrderChange: ({ sortField: c, sortOrder: R }) => {
351
- i == null || i({ ...n, sortField: c, sortOrder: R });
350
+ onSortOrderChange: ({ sortField: a, sortOrder: R }) => {
351
+ i == null || i({ ...m, sortField: a, sortOrder: R });
352
352
  }
353
353
  }
354
354
  ) }),
@@ -356,12 +356,12 @@ const fe = [
356
356
  /* @__PURE__ */ e.jsx("div", { className: "text-sm", children: /* @__PURE__ */ e.jsx(
357
357
  S,
358
358
  {
359
- onLimitChange: (c) => i == null ? void 0 : i({ ...n, limit: c, page: 1 }),
359
+ onLimitChange: (a) => i == null ? void 0 : i({ ...m, limit: a, page: 1 }),
360
360
  defaultValue: s == null ? void 0 : s.limit
361
361
  }
362
362
  ) }),
363
363
  /* @__PURE__ */ e.jsxs("div", { className: "text-muted-foreground text-sm", children: [
364
- l.length,
364
+ t.length,
365
365
  " of ",
366
366
  (s == null ? void 0 : s.total) || 0,
367
367
  " row(s) selected."
@@ -369,7 +369,7 @@ const fe = [
369
369
  /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(
370
370
  X,
371
371
  {
372
- onPageChange: (c) => i == null ? void 0 : i({ ...n, page: c }),
372
+ onPageChange: (a) => i == null ? void 0 : i({ ...m, page: a }),
373
373
  currentPage: s == null ? void 0 : s.page,
374
374
  totalPages: s == null ? void 0 : s.totalPages
375
375
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../FilterWrapper-DiuKsyOG.cjs"),r=require("../../jsx-runtime-DUiatUiq.cjs"),u=require("react"),l=require("../../radio-group-CqPTye2U-CXc2TUFE.cjs"),p=require("../../button-Bp2lHjov-D9UnCnYX.cjs"),c=require("../../lodash-C5w_OPmE.cjs"),x=require("../../Keyboard-kyPAAQWP.cjs"),d=require("../../useTranslation-CZf20ucv.cjs"),h=({placeholder:s,onSearchChange:o})=>{const{t:a}=d.useTranslation(),[n,i]=u.useState("");return r.jsxRuntimeExports.jsxs("div",{className:"relative my-2 w-full",children:[r.jsxRuntimeExports.jsx(l.yl,{placeholder:s||a("Type text and press CTRL + Enter"),onInput:e=>i(c.lodashExports.get(e,"target.value","")),onKeyUp:e=>{e.key===x.Keyboard.ENTER&&(e.ctrlKey&&o(n),e.stopPropagation(),e.preventDefault())}}),r.jsxRuntimeExports.jsx(p.u,{type:"button",variant:"ghost",className:"text-foreground absolute top-0 right-0 cursor-pointer rounded-md !bg-transparent",onClick:()=>o(n),children:r.jsxRuntimeExports.jsx(t.pv,{})})]})};exports.FilterWrapper=t.FilterWrapper;exports.Search=t.Search;exports.SearchWithCtrl=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../FilterWrapper-B3eJ74dh.cjs"),r=require("../../jsx-runtime-DUiatUiq.cjs"),u=require("react"),l=require("../../radio-group-CqPTye2U-CXc2TUFE.cjs"),p=require("../../button-Bp2lHjov-D9UnCnYX.cjs"),c=require("../../lodash-C5w_OPmE.cjs"),d=require("../../Keyboard-kyPAAQWP.cjs"),x=require("../../useTranslation-CZf20ucv.cjs"),h=({placeholder:s,onSearchChange:o})=>{const{t:i}=x.useTranslation(),[n,a]=u.useState("");return r.jsxRuntimeExports.jsxs("div",{className:"relative my-2 w-full",children:[r.jsxRuntimeExports.jsx(l.yl,{placeholder:s||i("Type text and press CTRL + Enter"),onInput:e=>a(c.lodashExports.get(e,"target.value","")),onKeyUp:e=>{e.key===d.Keyboard.ENTER&&(e.ctrlKey&&o(n||void 0),e.stopPropagation(),e.preventDefault())}}),r.jsxRuntimeExports.jsx(p.u,{type:"button",variant:"ghost",className:"text-foreground absolute top-0 right-0 cursor-pointer rounded-md !bg-transparent",onClick:()=>o(n),children:r.jsxRuntimeExports.jsx(t.pv,{})})]})};exports.FilterWrapper=t.FilterWrapper;exports.Search=t.Search;exports.SearchWithCtrl=h;
@@ -1,5 +1,5 @@
1
- import { p as i } from "../../FilterWrapper-DwZpntbw.js";
2
- import { F as v, S as N } from "../../FilterWrapper-DwZpntbw.js";
1
+ import { p as i } from "../../FilterWrapper-yAOBKFII.js";
2
+ import { F as T, S as N } from "../../FilterWrapper-yAOBKFII.js";
3
3
  import { j as t } from "../../jsx-runtime-C5mzlN2N.js";
4
4
  import { useState as m } from "react";
5
5
  import { y as n } from "../../radio-group-CqPTye2U-DGs9dBuR.js";
@@ -7,7 +7,7 @@ import { u as l } from "../../button-Bp2lHjov-BTlHPcva.js";
7
7
  import { l as u } from "../../lodash-CYNxjS-I.js";
8
8
  import { K as f } from "../../Keyboard-CJVAJWdO.js";
9
9
  import { u as c } from "../../useTranslation-dH-uwymc.js";
10
- const K = ({
10
+ const v = ({
11
11
  placeholder: o,
12
12
  onSearchChange: e
13
13
  }) => {
@@ -19,7 +19,7 @@ const K = ({
19
19
  placeholder: o || a("Type text and press CTRL + Enter"),
20
20
  onInput: (r) => p(u.get(r, "target.value", "")),
21
21
  onKeyUp: (r) => {
22
- r.key === f.ENTER && (r.ctrlKey && e(s), r.stopPropagation(), r.preventDefault());
22
+ r.key === f.ENTER && (r.ctrlKey && e(s || void 0), r.stopPropagation(), r.preventDefault());
23
23
  }
24
24
  }
25
25
  ),
@@ -36,7 +36,7 @@ const K = ({
36
36
  ] });
37
37
  };
38
38
  export {
39
- v as FilterWrapper,
39
+ T as FilterWrapper,
40
40
  N as Search,
41
- K as SearchWithCtrl
41
+ v as SearchWithCtrl
42
42
  };
@@ -1,21 +1,21 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../jsx-runtime-DUiatUiq.cjs"),u=require("react"),k=require("../../lodash-C5w_OPmE.cjs"),N=require("../../utils-B6fNqzRf-BNysSCt9.cjs"),E=require("../../_commonjsHelpers-DKOUU3wS.cjs"),g=require("../../createLucideIcon-BnAj0RnC.cjs");/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../jsx-runtime-DUiatUiq.cjs"),a=require("react"),k=require("../../lodash-C5w_OPmE.cjs"),N=require("../../utils-B6fNqzRf-BNysSCt9.cjs"),w=require("../../_commonjsHelpers-DKOUU3wS.cjs"),g=require("../../createLucideIcon-BnAj0RnC.cjs");/**
2
2
  * @license lucide-react v0.511.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const M=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],C=g.createLucideIcon("chevron-left",M);/**
6
+ */const S=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],C=g.createLucideIcon("chevron-left",S);/**
7
7
  * @license lucide-react v0.511.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */const A=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],S=g.createLucideIcon("chevron-right",A);/**
11
+ */const A=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],_=g.createLucideIcon("chevron-right",A);/**
12
12
  * @license lucide-react v0.511.0 - ISC
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
- */const _=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],F=g.createLucideIcon("download",_);/**
16
+ */const F=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],T=g.createLucideIcon("download",F);/**
17
17
  * @license lucide-react v0.511.0 - ISC
18
18
  *
19
19
  * This source code is licensed under the ISC license.
20
20
  * See the LICENSE file in the root directory of this source tree.
21
- */const T=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],q=g.createLucideIcon("x",T);var R={exports:{}},I=R.exports,L;function O(){return L||(L=1,function(l,v){(function(h,x){x()})(I,function(){function h(e,t){return typeof t>"u"?t={autoBom:!1}:typeof t!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function x(e,t,d){var o=new XMLHttpRequest;o.open("GET",e),o.responseType="blob",o.onload=function(){f(o.response,t,d)},o.onerror=function(){console.error("could not download file")},o.send()}function w(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function s(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof E.commonjsGlobal=="object"&&E.commonjsGlobal.global===E.commonjsGlobal?E.commonjsGlobal:void 0,p=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),f=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!p?function(e,t,d){var o=a.URL||a.webkitURL,i=document.createElement("a");t=t||e.name||"download",i.download=t,i.rel="noopener",typeof e=="string"?(i.href=e,i.origin===location.origin?s(i):w(i.href)?x(e,t,d):s(i,i.target="_blank")):(i.href=o.createObjectURL(e),setTimeout(function(){o.revokeObjectURL(i.href)},4e4),setTimeout(function(){s(i)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,d){if(t=t||e.name||"download",typeof e!="string")navigator.msSaveOrOpenBlob(h(e,d),t);else if(w(e))x(e,t,d);else{var o=document.createElement("a");o.href=e,o.target="_blank",setTimeout(function(){s(o)})}}:function(e,t,d,o){if(o=o||open("","_blank"),o&&(o.document.title=o.document.body.innerText="downloading..."),typeof e=="string")return x(e,t,d);var i=e.type==="application/octet-stream",j=/constructor/i.test(a.HTMLElement)||a.safari,m=/CriOS\/[\d]+/.test(navigator.userAgent);if((m||i&&j||p)&&typeof FileReader<"u"){var b=new FileReader;b.onloadend=function(){var y=b.result;y=m?y:y.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=y:location=y,o=null},b.readAsDataURL(e)}else{var r=a.URL||a.webkitURL,c=r.createObjectURL(e);o?o.location=c:location.href=c,o=null,setTimeout(function(){r.revokeObjectURL(c)},4e4)}});a.saveAs=f.saveAs=f,l.exports=f})}(R)),R.exports}var z=O();const D=()=>[{icon:n.jsxRuntimeExports.jsx(F,{size:20}),onClick:l=>{z.saveAs(l.src,l.title)},label:"Download"}],U=u.memo(({image:l,index:v,onClick:h})=>n.jsxRuntimeExports.jsx("div",{className:"aspect-video cursor-pointer overflow-hidden rounded-lg bg-gray-200 transition-opacity hover:opacity-80",onClick:()=>h(v),children:n.jsxRuntimeExports.jsx("img",{src:l.thumbnail||l.src,alt:l.alt||`Image ${v+1}`,className:"h-full w-full object-cover"})},l.id)),G=({images:l,actionButtons:v=[],className:h,hasInfo:x,...w})=>{const[s,a]=u.useState(null),[p,f]=u.useState(!1),e=u.useMemo(()=>D(),[]),t=u.useMemo(()=>[...e,...v],[e,v]),d=u.useCallback(r=>{a(r),f(!0)},[]),o=u.useCallback(()=>{f(!1),a(null)},[]),i=u.useCallback(()=>{s!==null&&s>0&&a(s-1)},[s]),j=u.useCallback(()=>{s!==null&&s<l.length-1&&a(s+1)},[s,l.length]);u.useEffect(()=>{const r=c=>{if(p)switch(c.key){case"Escape":o();break;case"ArrowLeft":c.preventDefault(),i();break;case"ArrowRight":c.preventDefault(),j();break}};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[p,i,j,o]),u.useEffect(()=>(p?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[p]);const m=u.useMemo(()=>s!==null?l[s]:null,[s,l]),b=u.useMemo(()=>!p||!m?null:n.jsxRuntimeExports.jsxs("div",{className:"bg-opacity-95 bg-bg fixed inset-0 z-50 flex flex-col items-center justify-center",children:[n.jsxRuntimeExports.jsxs("div",{className:"absolute top-0 flex w-full items-start justify-between p-3",children:[n.jsxRuntimeExports.jsx("div",{children:m.title&&n.jsxRuntimeExports.jsx("h2",{className:"text-body-lg-semi-bold",children:m.title})}),n.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-4 py-1",children:[t.map((r,c)=>n.jsxRuntimeExports.jsx("button",{onClick:()=>r.onClick(m),className:"cursor-pointer",title:r.label,children:r.icon},c)),n.jsxRuntimeExports.jsx("button",{onClick:o,className:"cursor-pointer",title:"Close (Esc)",children:n.jsxRuntimeExports.jsx(q,{size:20})})]})]}),k.lodashExports.isNumber(s)&&s>0&&n.jsxRuntimeExports.jsx("button",{onClick:i,className:"bg-opacity-50 hover:bg-opacity-70 bg-bg text-secondary absolute top-1/2 left-2 z-50 -translate-y-1/2 rounded-full p-3 transition-all",title:"Previous (←)",children:n.jsxRuntimeExports.jsx(C,{size:24})}),k.lodashExports.isNumber(s)&&s<l.length-1&&n.jsxRuntimeExports.jsx("button",{onClick:j,className:"bg-opacity-0 hover:bg-opacity-100 text-secondary bg-bg absolute top-1/2 right-2 z-50 -translate-y-1/2 rounded-full p-3 transition-all",title:"Next (→)",children:n.jsxRuntimeExports.jsx(S,{size:24})}),n.jsxRuntimeExports.jsx("div",{className:"flex max-h-full max-w-full items-center justify-center overflow-hidden p-8",children:n.jsxRuntimeExports.jsx("img",{src:m.src,alt:m.alt||`Image ${s}`,className:"max-h-full max-w-full object-contain"})}),n.jsxRuntimeExports.jsx("div",{className:"bg-bg absolute bottom-0 w-full",children:n.jsxRuntimeExports.jsx("div",{className:"flex gap-2 overflow-x-auto p-3",children:l.map((r,c)=>n.jsxRuntimeExports.jsx("div",{className:N.mo("hover:border-item-primary h-16 min-w-16 shrink-0 cursor-pointer rounded border-3 border-transparent transition-all",c==s&&"border-item-primary"),onClick:()=>a(c),children:n.jsxRuntimeExports.jsx("img",{src:r.thumbnail||r.src,alt:r.alt||`Thumbnail ${c+1}`,className:"size-full object-cover"})},r.id))})})]}),[p,m,t,o,s,i,l,j]);return n.jsxRuntimeExports.jsxs("div",{className:"w-full",children:[n.jsxRuntimeExports.jsx("div",{...w,className:N.mo("grid grid-cols-1 gap-4 lg:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",h),children:l.map((r,c)=>n.jsxRuntimeExports.jsxs("div",{className:"relative",children:[n.jsxRuntimeExports.jsx(U,{image:r,index:c,onClick:d}),x&&r.title&&n.jsxRuntimeExports.jsx("div",{className:"bg-bg/70 absolute bottom-0 flex min-h-10 w-full items-center justify-center text-center",children:r.title})]},r.id))}),b]})},B=u.memo(G);exports.MyGallery=B;
21
+ */const q=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],O=g.createLucideIcon("x",q);var R={exports:{}},z=R.exports,L;function D(){return L||(L=1,function(l,v){(function(u,m){m()})(z,function(){function u(e,o){return typeof o>"u"?o={autoBom:!1}:typeof o!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),o={autoBom:!o}),o.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function m(e,o,d){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){p(n.response,o,d)},n.onerror=function(){console.error("could not download file")},n.send()}function h(e){var o=new XMLHttpRequest;o.open("HEAD",e,!1);try{o.send()}catch{}return 200<=o.status&&299>=o.status}function f(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var o=document.createEvent("MouseEvents");o.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(o)}}var t=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof w.commonjsGlobal=="object"&&w.commonjsGlobal.global===w.commonjsGlobal?w.commonjsGlobal:void 0,j=t.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),p=t.saveAs||(typeof window!="object"||window!==t?function(){}:"download"in HTMLAnchorElement.prototype&&!j?function(e,o,d){var n=t.URL||t.webkitURL,i=document.createElement("a");o=o||e.name||"download",i.download=o,i.rel="noopener",typeof e=="string"?(i.href=e,i.origin===location.origin?f(i):h(i.href)?m(e,o,d):f(i,i.target="_blank")):(i.href=n.createObjectURL(e),setTimeout(function(){n.revokeObjectURL(i.href)},4e4),setTimeout(function(){f(i)},0))}:"msSaveOrOpenBlob"in navigator?function(e,o,d){if(o=o||e.name||"download",typeof e!="string")navigator.msSaveOrOpenBlob(u(e,d),o);else if(h(e))m(e,o,d);else{var n=document.createElement("a");n.href=e,n.target="_blank",setTimeout(function(){f(n)})}}:function(e,o,d,n){if(n=n||open("","_blank"),n&&(n.document.title=n.document.body.innerText="downloading..."),typeof e=="string")return m(e,o,d);var i=e.type==="application/octet-stream",y=/constructor/i.test(t.HTMLElement)||t.safari,b=/CriOS\/[\d]+/.test(navigator.userAgent);if((b||i&&y||j)&&typeof FileReader<"u"){var x=new FileReader;x.onloadend=function(){var c=x.result;c=b?c:c.replace(/^data:[^;]*;/,"data:attachment/file;"),n?n.location.href=c:location=c,n=null},x.readAsDataURL(e)}else{var E=t.URL||t.webkitURL,r=E.createObjectURL(e);n?n.location=r:location.href=r,n=null,setTimeout(function(){E.revokeObjectURL(r)},4e4)}});t.saveAs=p.saveAs=p,l.exports=p})}(R)),R.exports}var U=D();const G=()=>[{icon:s.jsxRuntimeExports.jsx(T,{size:20}),onClick:l=>{U.saveAs(l.src,l.title)},label:"Download"}],I=a.memo(({src:l,alt:v,fallbackImage:u})=>{const[m,h]=a.useState(!1),f=()=>{h(!0)};return s.jsxRuntimeExports.jsx("img",{src:m&&u?u:l,alt:v,className:"max-h-full max-w-full object-contain",onError:f})}),B=a.memo(({image:l,index:v,onClick:u,fallbackImage:m})=>{const[h,f]=a.useState(!1),t=()=>{f(!0)};return s.jsxRuntimeExports.jsx("div",{className:"aspect-video cursor-pointer overflow-hidden rounded-lg bg-gray-200 transition-opacity hover:opacity-80",onClick:()=>u(v),children:s.jsxRuntimeExports.jsx("img",{src:h&&m?m:l.thumbnail||l.src,alt:l.alt||`Image ${v+1}`,className:"h-full w-full object-cover",onError:t})},l.id)}),H=({images:l,actionButtons:v=[],fallbackImage:u,className:m,hasInfo:h,...f})=>{const[t,j]=a.useState(null),[p,e]=a.useState(!1),o=a.useMemo(()=>G(),[]),d=a.useMemo(()=>[...o,...v],[o,v]),n=a.useCallback(r=>{j(r),e(!0)},[]),i=a.useCallback(()=>{e(!1),j(null)},[]),y=a.useCallback(()=>{t!==null&&t>0&&j(t-1)},[t]),b=a.useCallback(()=>{t!==null&&t<l.length-1&&j(t+1)},[t,l.length]);a.useEffect(()=>{const r=c=>{if(p)switch(c.key){case"Escape":i();break;case"ArrowLeft":c.preventDefault(),y();break;case"ArrowRight":c.preventDefault(),b();break}};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[p,y,b,i]),a.useEffect(()=>(p?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[p]);const x=a.useMemo(()=>t!==null?l[t]:null,[t,l]),E=a.useMemo(()=>!p||!x?null:s.jsxRuntimeExports.jsxs("div",{className:"bg-opacity-95 bg-bg fixed inset-0 z-50 flex flex-col items-center justify-center",children:[s.jsxRuntimeExports.jsxs("div",{className:"absolute top-0 flex w-full items-start justify-between p-3",children:[s.jsxRuntimeExports.jsx("div",{children:x.title&&s.jsxRuntimeExports.jsx("h2",{className:"text-body-lg-semi-bold",children:x.title})}),s.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-4 py-1",children:[d.map((r,c)=>s.jsxRuntimeExports.jsx("button",{onClick:()=>r.onClick(x),className:"cursor-pointer",title:r.label,children:r.icon},c)),s.jsxRuntimeExports.jsx("button",{onClick:i,className:"cursor-pointer",title:"Close (Esc)",children:s.jsxRuntimeExports.jsx(O,{size:20})})]})]}),k.lodashExports.isNumber(t)&&t>0&&s.jsxRuntimeExports.jsx("button",{onClick:y,className:"bg-opacity-50 hover:bg-opacity-70 bg-bg text-secondary absolute top-1/2 left-2 z-50 -translate-y-1/2 rounded-full p-3 transition-all",title:"Previous (←)",children:s.jsxRuntimeExports.jsx(C,{size:24})}),k.lodashExports.isNumber(t)&&t<l.length-1&&s.jsxRuntimeExports.jsx("button",{onClick:b,className:"bg-opacity-0 hover:bg-opacity-100 text-secondary bg-bg absolute top-1/2 right-2 z-50 -translate-y-1/2 rounded-full p-3 transition-all",title:"Next (→)",children:s.jsxRuntimeExports.jsx(_,{size:24})}),s.jsxRuntimeExports.jsx("div",{className:"flex max-h-full max-w-full items-center justify-center overflow-hidden p-8",children:s.jsxRuntimeExports.jsx(I,{src:x.src,alt:x.alt||`Image ${t}`,fallbackImage:u})}),s.jsxRuntimeExports.jsx("div",{className:"bg-bg absolute bottom-0 w-full",children:s.jsxRuntimeExports.jsx("div",{className:"flex gap-2 overflow-x-auto p-3",children:l.map((r,c)=>s.jsxRuntimeExports.jsx("div",{className:N.mo("hover:border-item-primary h-16 min-w-16 shrink-0 cursor-pointer rounded border-3 border-transparent transition-all",c==t&&"border-item-primary"),onClick:()=>j(c),children:s.jsxRuntimeExports.jsx("img",{src:r.thumbnail||r.src,alt:r.alt||`Thumbnail ${c+1}`,className:"size-full object-cover",onError:M=>{u&&(M.currentTarget.src=u)}})},r.id))})})]}),[p,u,x,d,i,t,y,l,b]);return s.jsxRuntimeExports.jsxs("div",{className:"w-full",children:[s.jsxRuntimeExports.jsx("div",{...f,className:N.mo("grid grid-cols-1 gap-4 lg:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",m),children:l.map((r,c)=>s.jsxRuntimeExports.jsxs("div",{className:"relative",children:[s.jsxRuntimeExports.jsx(B,{image:r,index:c,onClick:n,fallbackImage:u}),h&&r.title&&s.jsxRuntimeExports.jsx("div",{className:"bg-bg/70 absolute bottom-0 flex min-h-10 w-full items-center justify-center text-center",children:r.title})]},r.id))}),E]})},$=a.memo(H);exports.MyGallery=$;