1import{u as f,r as g,j as e,H as b,b as x}from"./app-D4IBpXEE.js";import{C as j}from"./ClientLayout-DYwATrPj.js";import{P as v}from"./Pagination-CtPDhrFn.js";import{u as N}from"./useTranslation-mV-gvqqz.js";import{S as y}from"./useClientNav-CCpWTcrs.js";import{c as k}from"./createLucideIcon-CNbh77gd.js";import{P as _}from"./package-check-CYwsz-m0.js";import{C as w}from"./clock-CjNziwQQ.js";import{S}from"./search-DEcyoQmh.js";import"./Topbar-YNLa3oLe.js";import"./ApplicationLogo-Bp8Si-NU.js";import"./Tabs-CO9UBWDc.js";import"./Modal-BG2UZmBH.js";import"./useLocale-DI-M_4se.js";import"./x-Bdl9lUlz.js";import"./Sidebar-CzTRGA0N.js";import"./useBranding-B7C0EavV.js";import"./plus-BtmR7ya-.js";import"./chevron-down-BD_xrt_b.js";import"./chevron-left-CWeHfR8G.js";import"./chevron-right-TmvN6Wf9.js";import"./BrandIcons-DMEfIFxP.js";import"./layers-YtkC_1qB.js";import"./users-CkbR-kb7.js";import"./file-text-Bmh95Nys.js";import"./book-open-CP9xNsRl.js";import"./image-XLVZUHN1.js";import"./message-square-CnPXhMbL.js";import"./mail-CzXHdh_t.js";import"./inbox-CUredXdt.js";import"./bot-vbm2HKxV.js";import"./database-BicTbJP6.js";import"./map-pin-N5xEBYne.js";import"./zap-BHSHd7Nv.js";/** 2 * @license lucide-react v0.575.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const C=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],O=k("dollar-sign",C);function o({label:a,value:l,Icon:n,tone:s="neutral"}){const t={neutral:"text-neutral-900 dark:text-neutral-100",green:"text-green-600 dark:text-green-400",amber:"text-amber-600 dark:text-amber-400"};return e.jsxs("div",{className:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-neutral-900 p-4 flex items-center gap-3",children:[n&&e.jsx(n,{className:`h-5 w-5 ${t[s]}`}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:a}),e.jsx("p",{className:`text-xl font-semibold ${t[s]}`,children:l})]})]})}function u({value:a,map:l={}}){if(!a)return e.jsx("span",{className:"text-neutral-400 text-xs",children:"â"});
6const n=l[a]||"bg-neutral-100 text-neutral-600 dark:bg-neutral-800 dark:text-neutral-300";return e.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs ${n}`,children:a})}const L={fulfilled:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-300"};function me({orders:a,filters:l={},stores:n=[],stats:s={}}){const{t}=N(),{props:p}=f(),d=p.flash??{},[m,h]=g.useState(l.search??""),c=r=>{x.get(route("client.ecommerce.orders.index"),{...l,...r},{preserveState:!0,replace:!0})};return e.jsxs(j,{title:t("ecommerce.orders")||"Orders",children:[e.jsx(b,{title:t("ecommerce.orders")||"Orders"}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-semibold text-neutral-900 dark:text-neutral-100",children:t("ecommerce.orders")||"Orders"}),e.jsx("p",{className:"mt-1 text-sm text-neutral-500 dark:text-neutral-400",children:t("ecommerce.orders_sub")||"Orders synced from your connected stores."})]}),d.success&&e.jsx("div",{className:"rounded-lg bg-green-50 dark:bg-green-900/30 text-green-800 dark:text-green-200 px-4 py-2 text-sm",children:d.success}),d.error&&e.jsx("div",{className:"rounded-lg bg-red-50 dark:bg-red-900/30 text-red-800 dark:text-red-200 px-4 py-2 text-sm",children:d.error}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-4",children:[e.jsx(o,{label:t("ecommerce.total_orders")||"Orders",value:s.total??0,Icon:y}),e.jsx(o,{label:t("ecommerce.revenue")||"Revenue",value:s.revenue??0,Icon:O,tone:"green"}),e.jsx(o,{label:t("ecommerce.fulfilled")||"Fulfilled",value:s.fulfilled??0,Icon:_,tone:"green"}),e.jsx(o,{label:t("ecommerce.unfulfilled")||"Unfulfilled",value:s.unfulfilled??0,Icon:w,tone:"amber"})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("form",{onSubmit:r=>{r.preventDefault(),c({search:m})},className:"relative flex-1 min-w-[200px]",children:[e.jsx(S,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-neutral-400"}),e.jsx("input",{value:m,onChange:r=>h(r.target.value),placeholder:t("ecommerce.search_orders")||"Search order # or customerâ¦",className:"w-full rounded-lg border border-neutral-300 dark:border-neutral-600 bg-white dark:bg-neutral-800 pl-9 pr-3 py-2 text-sm"})]}),e.jsxs("select",{value:l.store_id??"",onChange:r=>c({store_id:r.target.value||void 0}),className:"rounded-lg border border-neutral-300 dark:border-neutral-600 bg-white dark:bg-neutral-800 px-3 py-2 text-sm",children:[e.jsx("option",{value:"",children:t("ecommerce.all_stores")||"All stores"}),n.map(r=>e.jsx("option",{value:r.id,children:r.name},r.id))]}),e.jsxs("select",{value:l.fulfillment??"",onChange:r=>c({fulfillment:r.target.value||void 0}),className:"rounded-lg border border-neutral-300 dark:border-neutral-600 bg-white dark:bg-neutral-800 px-3 py-2 text-sm",children:[e.jsx("option",{value:"",children:t("ecommerce.all_fulfillment")||"All fulfillment"}),e.jsx("option",{value:"fulfilled",children:"Fulfilled"})]})]}),e.jsxs("div",{className:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-neutral-900 overflow-hidden",children:[e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-neutral-50 dark:bg-neutral-800/50 text-neutral-500 dark:text-neutral-400 text-xs uppercase",children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left font-medium px-4 py-2.5",children:t("ecommerce.order")||"Order"}),e.jsx("th",{className:"text-left font-medium px-4 py-2.5",children:t("ecommerce.customer")||"Customer"}),e.jsx("th",{className:"text-right font-medium px-4 py-2.5",children:t("ecommerce.total")||"Total"}),e.jsx("th",{className:"text-left font-medium px-4 py-2.5",children:t("ecommerce.payment")||"Payment"}),e.jsx("th",{className:"text-left font-medium px-4 py-2.5",children:t("ecommerce.fulfillment")||"Fulfillment"}),e.jsx("th",{className:"text-left font-medium px-4 py-2.5",children:t("ecommerce.date")||"Date"})]})}),e.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[a.data.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"px-4 py-8 text-center text-neutral-400",children:t("ecommerce.no_orders")||"No orders synced yet."})}),a.data.map(r=>{var i;return e.jsxs("tr",{onClick:()=>x.visit(route("client.ecommerce.orders.show",r.id)),className:"hover:bg-neutral-50 dark:hover:bg-neutral-800/40 cursor-pointer",children:[e.jsx("td",{className:"px-4 py-2.5 font-medium text-neutral-800 dark:text-neutral-200",children:r.number}
6),e.jsx("td",{className:"px-4 py-2.5 text-neutral-600 dark:text-neutral-300",children:((i=r.contact)==null?void 0:i.name)||"â"}),e.jsxs("td",{className:"px-4 py-2.5 text-right font-medium",children:[r.currency," ",r.total]}),e.jsx("td",{className:"px-4 py-2.5",children:e.jsx(u,{value:r.financial_status})}),e.jsx("td",{className:"px-4 py-2.5",children:e.jsx(u,{value:r.fulfillment_status,map:L})}),e.jsx("td",{className:"px-4 py-2.5 text-neutral-500",children:r.placed_at?new Date(r.placed_at).toLocaleDateString():"â"})]},r.id)})]})]}),e.jsx(v,{data:a})]})]})]})}export{me as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.