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