var T=Object.defineProperty,E=Object.defineProperties;var z=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var M=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var f=(a,e,r)=>e in a?T(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r,x=(a,e)=>{for(var r in e||(e={}))M.call(e,r)&&f(a,r,e[r]);if(h)for(var r of h(e))C.call(e,r)&&f(a,r,e[r]);return a},g=(a,e)=>E(a,z(e));var b=(a,e,r)=>new Promise((n,l)=>{var d=t=>{try{o(r.next(t))}catch(c){l(c)}},m=t=>{try{o(r.throw(t))}catch(c){l(c)}},o=t=>t.done?n(t.value):Promise.resolve(t.value).then(d,m);o((r=r.apply(a,e)).next())});import{j as s,bh as R,aT as A,r as j,aA as B,aX as I}from"./react-vendor-xYZnmIII.js";import{u as N}from"./use-lang-Dg6I_Fym.js";import{d as L}from"./debounce-CWHP_ANh.js";import{g as V}from"./route-D0xh7FtZ.js";import{V as X,W as k,B as q,X as F,e as H,Y as Q,c as W}from"./ui-components-CQM92IK3.js";import{T as Y}from"./table-page-size-CzF8rJAG.js";const $=a=>{const{className:e}=a,{table:r}=N(),n=()=>{};return s.jsx("div",{className:`relative ml-3 ${e}`,children:s.jsxs(X,{children:[s.jsx(k,{children:s.jsx(q,{size:"icon",variant:"secondary",className:"group h-10 w-11 rounded-md border border-gray-200 p-0 hover:border-blue-500",children:s.jsx(R,{className:"h-4 w-4 text-gray-700 group-hover:text-blue-500"})})}),s.jsx(F,{align:"end",children:s.jsx(H,{className:"max-h-[198px]",children:s.jsx(Q,{onClick:n,className:"text-center",children:r.csv})})})]})})},ee=a=>{var p;const{Icon:e,data:r,title:n,component:l,globalSearch:d,tablePageSizes:m,routeName:o,routeParams:t,exportPath:c,className:v}=a,{common:w}=N(),y=A(),i=V(y.url),u=j.useRef(null),P=L(D=>b(null,null,function*(){const S=D.target.value;I.get(route(o||"",g(x(x({},t||{}),i),{search:S})),{},{preserveState:!0,preserveScroll:!0,showProgress:!1})}),300);return j.useEffect(()=>{i.search&&u.current&&u.current.focus()},[a]),s.jsxs("div",{className:W("items-center justify-between p-6 md:flex",v),children:[s.jsxs("div",{className:"flex items-center gap-5",children:[e&&s.jsx("div",{className:"bg-primary-25 flex h-10 w-10 items-center justify-center rounded-md",children:e}),n&&s.jsx("p",{className:"mb-4 text-lg font-semibold md:mb-0",children:n})]}),s.jsxs("div",{className:"flex items-center justify-end gap-3",children:[d&&s.jsxs("div",{className:"relative w-full md:max-w-[260px]",children:[s.jsx("input",{type:"text",ref:u,placeholder:w.search,onChange:P,className:"focus:border-primary border-border h-10 w-full rounded-md border py-[15px] pr-4 pl-12 text-sm font-normal focus:ring-0 focus:outline-0",defaultValue:(p=i.search)!=null?p:""}),s.jsx(B,{className:"text-muted-foreground absolute top-1/2 left-4 z-10 h-4 w-4 -translate-y-1/2"})]}),o&&s.jsx(Y,{routeParams:t,routeName:o,pageData:r,dropdownList:m}),c&&s.jsx($,{route:c}),l&&l]})]})};export{ee as T};
