import{_ as A}from"./Select.440bd64c.js";import{_ as B}from"./List.2d6b7481.js";import{_ as N}from"./card.924cd882.js";import{u as R,bG as k,bF as D,bE as E,aL as m,bu as G,bq as H,c as P,a as w,b as p,ba as s,ah as U,w as $,bD as j,o as z}from"./entry.816e6e91.js";import"./Button.8c8352d3.js";import"./nuxt-link.0e2876ca.js";import"./Icon.1464d3c9.js";import"./Badge.73ba16f1.js";import"./Table.e164c81e.js";import"./index.84e04faa.js";import"./Pagination.967f26ab.js";import"./Input.7105798b.js";import"./Textarea.7637503b.js";import"./Modal.5478da99.js";import"./use-outside-click.3870bf81.js";import"./useToast.95f42666.js";const I={class:"row mx-0"},J={class:"col-lg-4 col-md-6 col-10 mb-4"},K={class:"col-lg-12"},ue={__name:"filtered-orders",async setup(M){var f,b,v;let r,_;R({title:"Orders List"});const O=k();O.pageName="Orders List";const e=D(),g=E();let l=m(1);l.value=((f=e.query)==null?void 0:f.page)||1;const S=["all","created","inProgress","invoiced","delivered","credit","delivered","canceled"];let u=m("");u.value=((b=e.query)==null?void 0:b.status)||"created";let t=m("");t.value=((v=e.query)==null?void 0:v.status)||"created";const{data:c,pending:V,execute:C}=([r,_]=G(()=>j({url:"orders/filter/10",method:"post"},{immediate:!1,body:{status:u},query:{page:l}})),r=await r,_(),r);H(()=>e.query,(o,i)=>{var n,d;u.value=((n=e.query)==null?void 0:n.status)||"created",l.value=((d=e.query)==null?void 0:d.page)||1,i==null&&C()},{immediate:!0});const F=o=>{o.target.value=="all"?g.push("/admin/orders"):g.push({query:{status:o.target.value,page:1}})};return(o,i)=>{const n=A,d=B,L=N;return z(),P("div",I,[w("div",J,[p(n,{options:S,modelValue:s(t),"onUpdate:modelValue":i[0]||(i[0]=a=>U(t)?t.value=a:t=a),onChange:F},null,8,["modelValue"])]),w("div",K,[p(L,{bodyClasses:"mt-2"},{body:$(()=>{var a,y,h,q,x;return[p(d,{pending:s(V),data:(a=s(c))==null?void 0:a.data,page:(h=(y=s(c))==null?void 0:y.meta)==null?void 0:h.current_page,total:(x=(q=s(c))==null?void 0:q.meta)==null?void 0:x.total},null,8,["pending","data","page","total"])]}),_:1})])])}}};export{ue as default};
