import{An as e,C as t,E as n,Nn as r,Qt as i,_n as a,an as o,bn as s,en as c,jn as l,nn as u,on as d,q as f,rn as p,tn as m,vn as h,wn as g}from"./app-4kCgdoJR.js";import{t as _}from"./AdminLayout-DEe0k-dp.js";var v={class:`flex items-center justify-center gap-4`},y={class:`relative flex grow flex-col items-stretch justify-stretch self-stretch bg-white px-4 sm:px-6 lg:px-8 dark:bg-gray-800`},b={class:`flow-root grow`},x={class:`-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8`},S={class:`my-2 inline-block min-w-full border-b border-gray-200 align-middle dark:border-gray-700`},C={class:`min-w-full divide-y divide-gray-200 dark:divide-gray-700`},w={scope:`col`,class:`text-focus py-3.5 ps-6 pe-3 text-start text-sm font-semibold`},T={scope:`col`,class:`text-focus px-3 py-3.5 text-start text-sm font-semibold`},E={scope:`col`,class:`text-focus py-3.5 ps-3 pe-6 text-start text-sm font-semibold`},D={class:`divide-y divide-gray-200 bg-white dark:divide-gray-700 dark:bg-gray-900`},O={class:`py-4 ps-6 pe-3 text-sm whitespace-nowrap`},k={class:`px-3 py-4 text-sm whitespace-nowrap`},A=[`innerHTML`],j={class:`py-4 ps-3 pe-6 text-end text-sm whitespace-nowrap`},M={key:1},N={colspan:`100%`},P={class:`text-mute py-3.5 ps-4 pe-3 text-sm font-light whitespace-nowrap sm:ps-2 lg:ps-4`},F={class:`-mx-4 sm:-mx-6 lg:-mx-8`},I=Object.assign({layout:_},{__name:`Logs`,props:[`pagination`,`gift_card`],setup(_){let{filters:I,searching:L,sortBy:R}=f();return(f,z)=>{let B=s(`Head`),V=s(`Link`),H=s(`Header`),U=s(`Icon`);return a(),p(i,null,[d(B,null,{default:g(()=>[c(`title`,null,r(f.$t(`Gift Card Logs`)),1)]),_:1}),d(H,null,{subheading:g(()=>[o(r(f.$t(`Please review the data below`)),1)]),menu:g(()=>[c(`div`,v,[d(V,{class:`btn-primary`,href:f.route(`gift_cards.index`)},{default:g(()=>[o(r(f.$t(`List {x}`,{x:f.$t(`Gift Cards`)})),1)]),_:1},8,[`href`])])]),default:g(()=>[o(r(f.$t(`Gift Card Logs`))+` (`+r(_.gift_card.number)+`) `,1)]),_:1}),c(`div`,y,[e(L)?(a(),m(e(n),{key:0,"circle-size":`w-10 h-10`})):u(``,!0),c(`div`,b,[c(`div`,x,[c(`div`,S,[c(`table`,C,[c(`thead`,null,[c(`tr`,null,[c(`th`,w,[c(`button`,{type:`button`,class:`flex items-center gap-2 whitespace-nowrap`,onClick:z[0]||=t=>e(R)(e(I)?.sort==`created_at:asc`?`created_at:desc`:`created_at:asc`)},[o(r(f.$t(`Created at`))+` `,1),e(I)?.sort?.startsWith(`created_at:`)?(a(),m(U,{key:0,size:`size-3 text-mute`,name:e(I).sort==`created_at:desc`?`c-up`:`c-down`},null,8,[`name`])):u(``,!0)])]),c(`th`,T,[c(`button`,{type:`button`,class:`flex items-center gap-2 whitespace-nowrap`,onClick:z[1]||=t=>e(R)(e(I)?.sort==`description:asc`?`description:desc`:`description:asc`)},[o(r(f.$t(`Description`))+` `,1),e(I)?.sort?.startsWith(`description:`)?(a(),m(U,{key:0,size:`size-3 text-mute`,name:e(I).sort==`description:desc`?`c-up`:`c-down`},null,8,[`name`])):u(``,!0)])]),c(`th`,E,[c(`button`,{type:`button`,class:`flex items-center gap-2 whitespace-nowrap`,onClick:z[2]||=t=>e(R)(e(I)?.sort==`amount:asc`?`amount:desc`:`amount:asc`)},[o(r(f.$t(`Amount`))+` `,1),e(I)?.sort?.startsWith(`amount:`)?(a(),m(U,{key:0,size:`size-3 text-mute`,name:e(I).sort==`amount:desc`?`c-up`:`c-down`},null,8,[`name`])):u(``,!0)])])])]),c(`tbody`,D,[_.pagination&&_.pagination.data&&_.pagination.data.length?(a(!0),p(i,{key:0},h(_.pagination.data,e=>(a(),p(`tr`,{key:e.id,class:l(e.deleted_at?`bg-red-100 dark:bg-red-950`:``)},[c(`td`,O,r(f.$datetime(e.created_at)),1),c(`td`,k,[c(`div`,{class:`-my-2 line-clamp-2 min-w-64`,innerHTML:e.description||``},null,8,A)]),c(`td`,j,r(f.$currency(e.value)),1)],2))),128)):(a(),p(`tr`,M,[c(`td`,N,[c(`div`,P,r(f.$t(`There is no data to display!`)),1)])]))])])])])]),c(`div`,F,[d(e(t),{class:`mx-4 mt-auto py-2 text-sm sm:mx-6`,meta:_.pagination.meta,links:_.pagination.links},null,8,[`meta`,`links`])])])],64)}}});export{I as default};