module.exports=[62701,a=>{"use strict";var b=a.i(87924),c=a.i(50944),d=a.i(96438),e=a.i(71133);a.s(["default",0,function({image:a="/images/error-state.svg",title:f="Something went wrong",description:g="We couldn't complete your request. Please try again or return to the home page.",buttonText:h="Return to Home",buttonHref:i="/",onClick:j,loading:k=!1,className:l,variant:m="page",retryText:n="Try again",onRetry:o}){let p=(0,c.usePathname)(),q="page"===m?p.includes("/admin")?"min-h-[calc(100vh-4rem)] lg:min-h-[calc(100vh-5rem)]":"pb-8 pt-36 md:pt-40 xl:pt-44 2xl:pt-48":"section"===m?"rounded-2xl glass-card-v2 px-6 py-10 md:px-8 md:py-12":"rounded-xl border border-[#E5DFFF] bg-white/70 px-4 py-5";return(0,b.jsx)("section",{className:`relative flex w-full items-center justify-center px-4 ${q} ${l??""}`,role:"status","aria-live":"polite",children:(0,b.jsxs)("div",{className:"mx-auto w-full max-w-2xl text-center",children:[(0,b.jsx)("div",{className:"mb-6 flex justify-center sm:mb-8",children:(0,b.jsx)(e.default,{src:a,alt:"","aria-hidden":"true",width:280,height:280,priority:"page"===m,className:`h-auto ${"page"===m?"w-40 sm:w-48 md:w-56 lg:w-64 xl:w-72":"w-24 sm:w-28 md:w-32"}`})}),(0,b.jsx)("h2",{className:`mt-4 font-heading font-medium capitalize leading-tight text-heading ${"page"===m?"text-2xl lg:text-3xl 2xl:text-4xl 2xl:leading-11":"section"===m?"text-xl md:text-2xl":"text-lg md:text-xl"}`,children:f}),(0,b.jsx)("p",{className:`mx-auto mt-4 text-text md:mt-5 ${"page"===m?"text-base sm:text-lg 2xl:text-lg 2xl:leading-7":"text-sm md:text-base"}`,children:g}),(o||h)&&(0,b.jsxs)("div",{className:"mt-8 flex flex-col justify-center gap-3 sm:flex-row",children:[o&&(0,b.jsx)(d.default,{onClick:o,loading:k,className:"w-full sm:w-auto",buttonClassName:"w-full min-w-0 sm:min-w-[180px]",children:n}),h&&(0,b.jsx)(d.default,{href:i,onClick:j,className:"w-full sm:w-auto",buttonClassName:"w-full min-w-0 sm:min-w-[180px]",children:h})]})]})})}])},61719,a=>{"use strict";var b=a.i(72131);let c={page:1,limit:10,searchQuery:"",sortBy:void 0,sortDirection:void 0};a.s(["useAppPagination",0,function({initialState:a}={}){let[d,e]=(0,b.useState)({...c,...a}),f=(0,b.useMemo)(()=>d.sortBy?[{id:d.sortBy,desc:"desc"===d.sortDirection}]:[],[d.sortBy,d.sortDirection]),g=(0,b.useCallback)(a=>{let b=a[0];e(a=>({...a,sortBy:b?.id,sortDirection:b?b.desc?"desc":"asc":void 0,page:1}))},[]);return{params:d,set:(a,b)=>{e(c=>({...c,[a]:b}))},patch:a=>{e(b=>({...b,...a}))},reset:()=>{e({...c,...a})},sortingConfig:(0,b.useMemo)(()=>({state:f,onChange:g}),[f,g])}}])},38939,a=>{"use strict";var b=a.i(87924);a.s(["HeadingToolbar",0,function({title:a,subTitle:c,titleClassName:d="",subTitleClassName:e=""}){return(0,b.jsxs)("div",{children:[a&&(0,b.jsx)("div",{className:`
            font-body text-base lg:text-lg xl:text-xl 2xl:text-2xl font-semibold xl:leading-8.5 text-heading
            ${d}
          `,children:a}),c&&(0,b.jsx)("p",{className:`
            2xl:mt-0.5 font-body text-sm 2xl:text-base font-normal text-text
            ${e}
          `,children:c})]})}])},72214,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(73732),e=a.i(61719),f=a.i(38939),g=a.i(42871),h=a.i(33217),i=a.i(11461),j=a.i(31234),k=a.i(35112),l=a.i(328),m=a.i(50159);function n({contact:a}){let[d,e]=(0,c.useState)(!1),[f,g]=(0,c.useState)({top:0,left:0,origin:"top"}),h=(0,c.useRef)(null),i=(0,c.useRef)(null),{openModal:j}=(0,m.useModal)(),o=(0,c.useCallback)(()=>{let a=h.current;if(!a)return;let b=a.getBoundingClientRect(),c=window.innerHeight-b.bottom,d=b.top,e=c<96&&d>c,f=e?Math.max(12,b.top-88-8):Math.min(b.bottom+8,window.innerHeight-88-12),i=b.right-160;g({top:f,left:i=Math.min(i=Math.max(12,i),window.innerWidth-160-12),origin:e?"bottom":"top"})},[]);return(0,c.useEffect)(()=>{if(!d)return;let a=a=>{let b=a.target;h.current?.contains(b)||i.current?.contains(b)||e(!1)},b=a=>{"Escape"===a.key&&e(!1)};return window.addEventListener("resize",o),window.addEventListener("scroll",o,!0),document.addEventListener("mousedown",a),document.addEventListener("keydown",b),()=>{window.removeEventListener("resize",o),window.removeEventListener("scroll",o,!0),document.removeEventListener("mousedown",a),document.removeEventListener("keydown",b)}},[d,o]),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("button",{ref:h,type:"button",onClick:a=>{a.stopPropagation(),o(),e(a=>!a)},"aria-label":`Actions for ${a.name}`,className:"inline-flex h-8 w-8 items-center justify-center rounded-full text-link-1 transition hover:bg-link-1/10 focus:outline-none focus:ring-2 focus:ring-link-1/30",children:(0,b.jsx)(l.MdMoreVert,{size:20})}),d&&"u">typeof document&&(0,k.createPortal)((0,b.jsx)("div",{ref:i,role:"menu",style:{top:f.top,left:f.left,width:160,transformOrigin:"top"===f.origin?"top right":"bottom right"},className:"fixed z-60 overflow-hidden rounded-xl border border-black/5 bg-white py-1.5 shadow-[0_12px_40px_rgba(15,23,42,0.18)] ring-1 ring-black/5",children:(0,b.jsx)("button",{type:"button",role:"menuitem",onClick:b=>{b.stopPropagation(),e(!1),j("CONTACT_REQUEST_INFO",{uuid:a.uuid})},className:"block w-full px-4 py-2.5 text-left text-sm font-medium text-slate-700 transition hover:bg-link-1/5",children:"View"})}),document.body)]})}let o=[{accessorKey:"name",header:"Name",cell:({row:a})=>(0,b.jsx)("span",{className:"font-medium text-slate-900",children:a.original.name})},{accessorKey:"email",header:"Email",cell:({row:a})=>(0,b.jsx)("span",{children:a.original.email})},{accessorKey:"phone",header:"Phone Number",cell:({row:a})=>(0,b.jsx)("span",{children:a.original.phone})},{id:"actions",header:"Action",enableSorting:!1,cell:({row:a})=>(0,b.jsx)(n,{contact:a.original})}];var p=a.i(62701);a.s(["default",0,function(){let[a,k]=(0,c.useState)({}),l=(0,e.useAppPagination)(),{data:m,loading:n,error:q,isError:r}=function(a){let{data:b,isPending:c,isError:d,error:e}=(0,h.useQuery)({queryKey:["admin-contact-requests",a.params.page,a.params.limit,a.params.searchQuery,a.params.sortBy,a.params.sortDirection],queryFn:async()=>{let b={limit:a.params.limit,page:a.params.page,search:a.params.searchQuery,sortBy:a.params.sortBy,sortOrder:a?.params?.sortDirection?.toUpperCase()},c=await (0,i.apiGet)(j.ADMIN_CONTACTS.GET_CONTACT_REQUESTS,b);return{contacts:c.data.map(a=>({...a,name:`${a.firstName} ${a.lastName}`.trim(),phone:`${a.dialCode} ${a.phoneNumber}`.trim()})),pagination:c.meta}},staleTime:12e4,placeholderData:g.keepPreviousData,retry:!1});return{data:b,loading:c,error:e,isError:d}}(l),s=m?.contacts??[],t=m?.pagination;return(0,b.jsx)("section",{className:"w-full p-4 pt-6 2xl:pt-8 2xl:p-8",children:r?(0,b.jsx)(p.default,{variant:"section",title:"Unable to load contact requests",description:"The contact requests table failed to load. Please try again.",onRetry:()=>l.patch({}),buttonText:""}):(0,b.jsx)(d.DataTable,{data:s,loading:n,columns:o,appearance:"default",size:"md",getRowId:a=>a.uuid,rowSelection:a,sorting:l.sortingConfig,onRowSelectionChange:k,onSelectedRowsChange:a=>{},toolbar:(0,b.jsx)(f.HeadingToolbar,{title:"Contact Requests",subTitle:`${s.length} Contact Request(s) listed`,titleClassName:"",subTitleClassName:""}),classNames:{root:"",toolbar:"flex items-center gap-3",filters:"flex items-center gap-2",table:"min-w-full",tableThead:"bg-slate-100 border-t-2 border-slate-400  relative",tableTheadRow:"whitespace-nowrap",tableTheadCell:"px-3 py-2 2xl:p-3 text-left font-body text-sm 2xl:text-base font-medium text-heading relative",tableTbody:"border-t border-slate-300/50 relative",tableTbodyRow:`
              hover:bg-link-1/10 transition-colors
              [&>td]:border-b [&>td]:border-gray-200
            `,tableTbodyCell:"py-2 px-3 font-body text-[13px] 2xl:text-sm text-table-text relative",pagination:""},pagination:{controller:l,pageCount:t?.totalPages,totalItems:t?.total}})})}],72214)}];

//# sourceMappingURL=src_1iiql_u._.js.map