import{K as o,m as h,j as p,k as t,D as r,a8 as l,t as u,X as i}from"./BCLrUOBx.js";const c={name:"OrderTabbing",components:{},directives:{},props:{},computed:{paidOrders(){var a,e;return((e=(a=this._.provides[i]||this.$route)==null?void 0:a.query)==null?void 0:e.paid)||!1},unpaidOrders(){var a,e;return((e=(a=this._.provides[i]||this.$route)==null?void 0:a.query)==null?void 0:e.unpaid)||!1},cardPaymentOrders(){var a,e;return((e=(a=this._.provides[i]||this.$route)==null?void 0:a.query)==null?void 0:e.cardPayment)||!1},cashOnDeliveryOrders(){var a,e;return((e=(a=this._.provides[i]||this.$route)==null?void 0:a.query)==null?void 0:e.cashOnDelivery)||!1},cancelledOrders(){var a,e;return((e=(a=this._.provides[i]||this.$route)==null?void 0:a.query)==null?void 0:e.cancelled)||!1}},data(){return{cashOnDelivery:!1,cardPayment:!1,cancelled:!1,paid:!1,unpaid:!1}},methods:{generateParam(){const a={};return this.cancelledOrders&&(a.cancelled=this.cancelledOrders?1:0),this.paidOrders&&(a.paid=this.paidOrders?1:0),this.unpaidOrders&&(a.unpaid=this.unpaidOrders?1:0),this.cardPaymentOrders&&(a.card_payment=this.cardPaymentOrders?1:0),this.cashOnDeliveryOrders&&(a.cash_on_delivery=this.cashOnDeliveryOrders?1:0),a},updateRoute(a,e=null){this.$router.push({query:{...(this._.provides[i]||this.$route).query,page:1,orderBy:"created_at",orderByType:"desc",[a]:e}}),this.$emit("fetch-data",this.generateParam())},unpaidChanged(){this.unpaid?this.updateRoute("unpaid",this.unpaid):this.updateRoute("unpaid")},cardPaymentChanged(){this.cardPayment?this.updateRoute("cardPayment",this.cardPayment):this.updateRoute("cardPayment")},codChanged(){this.cashOnDelivery?this.updateRoute("cashOnDelivery",this.cashOnDelivery):this.updateRoute("cashOnDelivery")},paidChanged(){this.paid?this.updateRoute("paid",this.paid):this.updateRoute("paid")},cancelledChanged(){this.cancelled?this.updateRoute("cancelled",this.cancelled):this.updateRoute("cancelled")},resetting(){this.cancelled=this.cancelledOrders,this.paid=this.paidOrders,this.unpaid=this.unpaidOrders,this.cardPayment=this.cardPaymentOrders,this.cashOnDelivery=this.cashOnDeliveryOrders}},mounted(){window.addEventListener("popstate",this.resetting),this.resetting()},unmounted(){window.removeEventListener("popstate",this.resetting)}},y={class:"mb-10 flex start wrap"},m={class:"ck-button"},v={class:"ck-button"},g={class:"ck-button"},O={class:"ck-button"},b={class:"ck-button"};function f(a,e,C,P,d,s){return p(),h("div",y,[t("div",m,[t("label",null,[r(t("input",{onChange:e[0]||(e[0]=(...n)=>s.cancelledChanged&&s.cancelledChanged(...n)),hidden:"",type:"checkbox",name:"orders-variation","onUpdate:modelValue":e[1]||(e[1]=n=>d.cancelled=n)},null,544),[[l,d.cancelled]]),t("span",null,u(a.$t("orderTabbing.cancelled")),1)])]),t("div",v,[t("label",null,[r(t("input",{onChange:e[2]||(e[2]=(...n)=>s.codChanged&&s.codChanged(...n)),hidden:"",type:"checkbox",name:"orders-variation","onUpdate:modelValue":e[3]||(e[3]=n=>d.cashOnDelivery=n)},null,544),[[l,d.cashOnDelivery]]),t("span",null,u(a.$t("orderTabbing.cod")),1)])]),t("div",g,[t("label",null,[r(t("input",{onChange:e[4]||(e[4]=(...n)=>s.cardPaymentChanged&&s.cardPaymentChanged(...n)),hidden:"",type:"checkbox",name:"orders-variation","onUpdate:modelValue":e[5]||(e[5]=n=>d.cardPayment=n)},null,544),[[l,d.cardPayment]]),t("span",null,u(a.$t("orderTabbing.cardPayment")),1)])]),t("div",O,[t("label",null,[r(t("input",{onChange:e[6]||(e[6]=(...n)=>s.paidChanged&&s.paidChanged(...n)),hidden:"",type:"checkbox",name:"orders-variation","onUpdate:modelValue":e[7]||(e[7]=n=>d.paid=n)},null,544),[[l,d.paid]]),t("span",null,u(a.$t("orderTabbing.paid")),1)])]),t("div",b,[t("label",null,[r(t("input",{onChange:e[8]||(e[8]=(...n)=>s.unpaidChanged&&s.unpaidChanged(...n)),hidden:"",type:"checkbox",name:"orders-variation","onUpdate:modelValue":e[9]||(e[9]=n=>d.unpaid=n)},null,544),[[l,d.unpaid]]),t("span",null,u(a.$t("orderTabbing.unPaid")),1)])])])}const k=o(c,[["render",f]]);export{k as default};
