(()=>{var e={};e.id=91,e.ids=[91],e.modules={10846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:e=>{"use strict";e.exports=require("next/dist/server/app-render/action-async-storage.external.js")},3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},29294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},63033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},12412:e=>{"use strict";e.exports=require("assert")},55511:e=>{"use strict";e.exports=require("crypto")},94735:e=>{"use strict";e.exports=require("events")},29021:e=>{"use strict";e.exports=require("fs")},81630:e=>{"use strict";e.exports=require("http")},55591:e=>{"use strict";e.exports=require("https")},21820:e=>{"use strict";e.exports=require("os")},33873:e=>{"use strict";e.exports=require("path")},27910:e=>{"use strict";e.exports=require("stream")},83997:e=>{"use strict";e.exports=require("tty")},79551:e=>{"use strict";e.exports=require("url")},28354:e=>{"use strict";e.exports=require("util")},74075:e=>{"use strict";e.exports=require("zlib")},44653:(e,t,r)=>{"use strict";r.r(t),r.d(t,{GlobalError:()=>n.a,__next_app__:()=>u,pages:()=>c,routeModule:()=>p,tree:()=>d});var a=r(70260),s=r(28203),i=r(25155),n=r.n(i),l=r(67292),o={};for(let e in l)0>["default","tree","pages","GlobalError","__next_app__","routeModule"].indexOf(e)&&(o[e]=()=>l[e]);r.d(t,o);let d=["",{children:["[lang]",{children:["(dashboard)",{children:["(private)",{children:["products",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(r.bind(r,13762)),"E:\\bw\\unomenudash\\src\\app\\[lang]\\(dashboard)\\(private)\\products\\page.tsx"]}]},{}]},{layout:[()=>Promise.resolve().then(r.bind(r,59702)),"E:\\bw\\unomenudash\\src\\app\\[lang]\\(dashboard)\\(private)\\layout.tsx"]}]},{}]},{layout:[()=>Promise.resolve().then(r.bind(r,15943)),"E:\\bw\\unomenudash\\src\\app\\[lang]\\layout.tsx"],metadata:{icon:[async e=>(await Promise.resolve().then(r.bind(r,70440))).default(e)],apple:[],openGraph:[],twitter:[],manifest:void 0}}]},{"not-found":[()=>Promise.resolve().then(r.t.bind(r,19937,23)),"next/dist/client/components/not-found-error"],forbidden:[()=>Promise.resolve().then(r.t.bind(r,69116,23)),"next/dist/client/components/forbidden-error"],unauthorized:[()=>Promise.resolve().then(r.t.bind(r,41485,23)),"next/dist/client/components/unauthorized-error"],metadata:{icon:[async e=>(await Promise.resolve().then(r.bind(r,70440))).default(e)],apple:[],openGraph:[],twitter:[],manifest:void 0}}],c=["E:\\bw\\unomenudash\\src\\app\\[lang]\\(dashboard)\\(private)\\products\\page.tsx"],u={require:r,loadChunk:()=>Promise.resolve()},p=new a.AppPageRouteModule({definition:{kind:s.RouteKind.APP_PAGE,page:"/[lang]/(dashboard)/(private)/products/page",pathname:"/[lang]/products",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:d}})},55034:(e,t,r)=>{Promise.resolve().then(r.bind(r,97883)),Promise.resolve().then(r.bind(r,9882))},72962:(e,t,r)=>{Promise.resolve().then(r.bind(r,1560)),Promise.resolve().then(r.bind(r,30883))},57285:(e,t,r)=>{"use strict";r.d(t,{A:()=>y});var a=r(58009),s=r(82281),i=r(29107),n=r(66095),l=r(71667),o=r(35884),d=r(94880),c=r(55249),u=r(31137),p=r(88613);function h(e){return(0,p.Ay)("MuiSkeleton",e)}(0,u.A)("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);var g=r(45512);let m=e=>{let{classes:t,variant:r,animation:a,hasChildren:s,width:n,height:l}=e;return(0,i.A)({root:["root",r,a,s&&"withChildren",s&&!n&&"fitContent",s&&!l&&"heightAuto"]},h,t)},x=(0,l.i7)`
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }

  100% {
    opacity: 1;
  }
`,b=(0,l.i7)`
  0% {
    transform: translateX(-100%);
  }

  50% {
    /* +0.5s of delay between each loop */
    transform: translateX(100%);
  }

  100% {
    transform: translateX(100%);
  }
`,v="string"!=typeof x?(0,l.AH)`
        animation: ${x} 2s ease-in-out 0.5s infinite;
      `:null,A="string"!=typeof b?(0,l.AH)`
        &::after {
          animation: ${b} 2s linear 0.5s infinite;
        }
      `:null,f=(0,o.Ay)("span",{name:"MuiSkeleton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,t[r.variant],!1!==r.animation&&t[r.animation],r.hasChildren&&t.withChildren,r.hasChildren&&!r.width&&t.fitContent,r.hasChildren&&!r.height&&t.heightAuto]}})((0,d.A)(({theme:e})=>{let t=String(e.shape.borderRadius).match(/[\d.\-+]*\s*(.*)/)[1]||"px",r=parseFloat(e.shape.borderRadius);return{display:"block",backgroundColor:e.vars?e.vars.palette.Skeleton.bg:(0,n.X4)(e.palette.text.primary,"light"===e.palette.mode?.11:.13),height:"1.2em",variants:[{props:{variant:"text"},style:{marginTop:0,marginBottom:0,height:"auto",transformOrigin:"0 55%",transform:"scale(1, 0.60)",borderRadius:`${r}${t}/${Math.round(r/.6*10)/10}${t}`,"&:empty:before":{content:'"\\00a0"'}}},{props:{variant:"circular"},style:{borderRadius:"50%"}},{props:{variant:"rounded"},style:{borderRadius:(e.vars||e).shape.borderRadius}},{props:({ownerState:e})=>e.hasChildren,style:{"& > *":{visibility:"hidden"}}},{props:({ownerState:e})=>e.hasChildren&&!e.width,style:{maxWidth:"fit-content"}},{props:({ownerState:e})=>e.hasChildren&&!e.height,style:{height:"auto"}},{props:{animation:"pulse"},style:v||{animation:`${x} 2s ease-in-out 0.5s infinite`}},{props:{animation:"wave"},style:{position:"relative",overflow:"hidden",WebkitMaskImage:"-webkit-radial-gradient(white, black)","&::after":{background:`linear-gradient(
                90deg,
                transparent,
                ${(e.vars||e).palette.action.hover},
                transparent
              )`,content:'""',position:"absolute",transform:"translateX(-100%)",bottom:0,left:0,right:0,top:0}}},{props:{animation:"wave"},style:A||{"&::after":{animation:`${b} 2s linear 0.5s infinite`}}}]}})),y=a.forwardRef(function(e,t){let r=(0,c.b)({props:e,name:"MuiSkeleton"}),{animation:a="pulse",className:i,component:n="span",height:l,style:o,variant:d="text",width:u,...p}=r,h={...r,animation:a,component:n,variant:d,hasChildren:!!p.children},x=m(h);return(0,g.jsx)(f,{as:n,ref:t,className:(0,s.A)(x.root,i),ownerState:h,...p,style:{width:u,height:l,...o}})})},69019:(e,t,r)=>{"use strict";r.d(t,{lQ:()=>i,ru:()=>l,pI:()=>c.p,kl:()=>n,Yx:()=>d,Xb:()=>o});var a=r(43645),s=r(24281);let i="categories-list",n=(e,t)=>{let r=[i,e];return(0,a.x)(r,()=>{let t={};return e&&Object.entries(e).forEach(([e,r])=>{void 0!==r&&""!==r&&(t[e]=null===r?"null":String(r))}),(0,s.Em)({url:"/categories",params:t})},t)},l=()=>(0,a.i)(["categories-add"],async e=>{let t=e.image??null;"undefined"!=typeof FileList&&t instanceof FileList&&(t=t.item(0));let r=new FormData;return r.append("name_ar",e.name_ar),r.append("name_en",e.name_en),r.append("description_ar",e.description_ar||""),r.append("description_en",e.description_en||""),r.append("sort_order",String(e.sort_order)),r.append("is_active",String(e.is_active)),e.parent_id&&r.append("parent_id",e.parent_id),t instanceof File?r.append("image",t):"string"==typeof t&&t&&r.append("image",t),await (0,s.Em)({url:"/categories",method:"POST",data:r,headers:{"Content-Type":"multipart/form-data"}})},{invalidateQueries:["categories-list"]}),o=e=>(0,a.x)(["products-by-category",e],()=>(0,s.Em)({url:`/products/category/${e}`}),{enabled:!!e}),d=e=>(0,a.x)(["category-info",e],()=>(0,s.Em)({url:`/categories/${e}`}),{enabled:!!e});var c=r(44463)},44463:(e,t,r)=>{"use strict";r.d(t,{p:()=>l});var a=r(43645),s=r(24281);let i=e=>Array.isArray(e)?e.map(e=>{let t=Array.isArray(e.children)?e.children:Array.isArray(e.subcategories)?e.subcategories:void 0;return{...e,children:i(t)}}):[],n=e=>Array.isArray(e)?i(e):Array.isArray(e?.data)?i(e.data):Array.isArray(e?.data?.data)?i(e.data.data):[],l=(e,t)=>{let r=["categories-dropdown-list",e];return(0,a.x)(r,async()=>{let t={};return e&&Object.entries(e).forEach(([e,r])=>{null!=r&&""!==r&&(t[e]=String(r))}),n(await (0,s.Em)({url:"/categories/dropdown/list",params:t}))},t)}},48095:(e,t,r)=>{"use strict";r.d(t,{OZ:()=>i,W$:()=>h,VL:()=>c,U5:()=>n,CC:()=>u,Zu:()=>p});var a=r(24281),s=r(43645);let i=()=>(0,s.i)(["products-add"],async e=>{console.log('dY"? useAddProduct received:',e);let t=new FormData;Object.entries(e).forEach(([e,r])=>{null!=r&&("images"===e&&Array.isArray(r)?r.forEach(e=>t.append("images[]",e)):"image"===e&&r instanceof File?t.append("image",r):t.append(e,String(r)))});let r=await (0,a.Em)({url:"/products",method:"POST",data:t,headers:{"Content-Type":"multipart/form-data"}});return console.log("?o. Server Response:",r),r},{invalidateQueries:["simple-products-list"]}),n=(e,t)=>{let r=["simple-products-list",e];return(0,s.x)(r,()=>{let t={};return e&&Object.entries(e).forEach(([e,r])=>{null!=r&&""!==r&&(t[e]=String(r))}),(0,a.Em)({url:"/products",params:t})},t)};var l=r(89633),o=r(33038);let d="product",c=e=>(0,l.I)({queryKey:[d,e],queryFn:async()=>await (0,a.Em)({url:`/products/${e}`,method:"GET"}),enabled:!!e}),u=()=>(0,s.i)(["products-update"],async({id:e,payload:t})=>await (0,a.Em)({url:`/products/${e}`,method:"PUT",data:t}),{onSuccess:async()=>{(0,o.revalidatePath)("")}}),p=()=>(0,s.i)(["products-update-image"],async({id:e,payload:t})=>{let r=new FormData;return r.append("image",t.image),await (0,a.Em)({url:`/products/${e}/update-image`,method:"POST",data:r})},{invalidateQueries:[d]}),h=()=>(0,s.i)(["products-delete"],async e=>await (0,a.Em)({url:`/products/${e}`,method:"DELETE"}),{invalidateQueries:["simple-products-list"]})},82813:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var a=r(45512),s=r(74167),i=r(65624),n=r(23721);let l=({table:e,totalItems:t})=>{let r=(0,n.c3)("");return(0,a.jsxs)("div",{className:"flex justify-between items-center p-4",children:[(0,a.jsxs)(s.A,{children:[r("KEY.SHOW")," ",e.getState().pagination.pageIndex*e.getState().pagination.pageSize+1," ",r("PROPERTY.TO")," ",Math.min((e.getState().pagination.pageIndex+1)*e.getState().pagination.pageSize,t)," ","\xa0",r("KEY.FROM_TOTAL")," ",t]}),(0,a.jsx)(i.A,{count:Math.ceil(t/e.getState().pagination.pageSize),page:e.getState().pagination.pageIndex+1,onChange:(t,r)=>e.setPageIndex(r-1)})]})}},30883:(e,t,r)=>{"use strict";r.d(t,{default:()=>Q});var a=r(45512),s=r(58009),i=r(23721),n=r(32277),l=r(79334),o=r(84477),d=r(70510),c=r(38953),u=r(74167),p=r(33449),h=r(66951),g=r(94305),m=r(572),x=r(82281),b=r(29107),v=r(10226),A=r(35884),f=r(55249),y=r(31137),_=r(88613);function j(e){return(0,_.Ay)("MuiDialogContentText",e)}(0,y.A)("MuiDialogContentText",["root"]);let w=e=>{let{classes:t}=e,r=(0,b.A)({root:["root"]},j,t);return{...t,...r}},S=(0,A.Ay)(u.A,{shouldForwardProp:e=>(0,v.A)(e)||"classes"===e,name:"MuiDialogContentText",slot:"Root",overridesResolver:(e,t)=>t.root})({}),C=s.forwardRef(function(e,t){let r=(0,f.b)({props:e,name:"MuiDialogContentText"}),{children:s,className:i,...n}=r,l=w(n);return(0,a.jsx)(S,{component:"p",variant:"body1",color:"textSecondary",ref:t,ownerState:n,className:(0,x.A)(l.root,i),...r,classes:l})});var E=r(33747),N=r(51323),T=r(92627),P=r(1560),k=r(60920),I=r(52095),R=r(20851),O=r(74016),M=r(57285),$=r(29280),U=r(83525),H=r(90001),D=r(12454),q=r(58284),z=r(24281),L=r(42109),W=r.n(L),F=r(82813),G=r(48095),V=r(69019);let Y=(e,t,r,a)=>{let s=(0,$.IL)(e.getValue(t),r);return a({itemRank:s}),s.passed},X=(0,U.FB)(),Q=()=>{let e=(0,i.c3)("PRODUCTS"),t=(0,n.Ym)(),r=(0,l.useRouter)(),x=(0,l.useSearchParams)(),b=e=>`/${t}${e}`,[v,A]=(0,s.useState)(x.get("search")||""),[f,y]=(0,s.useState)(x.get("search")||""),[_,j]=(0,s.useState)(null),w=Number(x.get("page"))||1,S=Number(x.get("per_page"))||10,$=x.get("sort_as")||"",L=x.get("is_available")||"",Q=x.get("category_id")||"",K=(0,G.W$)(),{data:B,isLoading:Z,refetch:J,isError:ee}=(0,G.U5)({page:w,per_page:S,search:f||void 0,sort_by:$?"sort_order":void 0,sort_as:$||void 0,is_available:""!==L?"true"===L:void 0,category_id:Q||void 0},{staleTime:3e5,gcTime:18e5}),{data:et}=(0,V.pI)({sort_by:"sort_order",sort_as:"asc"}),er=(0,s.useMemo)(()=>{if(!Array.isArray(et))return[];let e=(r,a=0)=>r.flatMap(r=>{let s=a?`${"-- ".repeat(a)}`:"",i="ar"===t?r.name_ar:r.name_en;return[{id:String(r.id),label:`${s}${i}`},...Array.isArray(r.children)?e(r.children,a+1):[]]});return e(et)},[et,t]),ea=B?.data,es=ea?.data??[],ei=ea?.total??0,en=ea?.available_total??es.filter(e=>e.is_available).length,el=ea?.featured_total??es.filter(e=>e.is_featured).length,eo=(0,s.useMemo)(()=>0===es.length?0:es.reduce((e,t)=>e+Number(t.current_price||t.price||0),0)/es.length,[es]),ed=Number(ea?.average_price??eo??0),ec=(0,s.useMemo)(()=>new Intl.NumberFormat("ar"===t?"ar-SA":"en-US"),[t]),eu=process.env.NEXT_PUBLIC_CURRENCY_CODE||"SAR",ep=(0,s.useMemo)(()=>new Intl.NumberFormat("ar"===t?"ar-SA":"en-US",{style:"currency",currency:eu,maximumFractionDigits:2}),[eu,t]),eh=e=>ec.format(e??0),eg=e=>{let t=Number(e??0);return Number.isNaN(t)?"—":ep.format(t)},em=[{key:"total",label:e("stats.totalProducts"),helper:e("stats.totalProductsHint"),value:eh(ea?.total??es.length),icon:"tabler-box"},{key:"available",label:e("stats.availableProducts"),helper:e("stats.availableProductsHint"),value:eh(en),icon:"tabler-check"},{key:"featured",label:e("stats.featuredProducts"),helper:e("stats.featuredProductsHint"),value:eh(el),icon:"tabler-star"},{key:"avg",label:e("stats.averagePrice"),helper:e("stats.averagePriceHint"),value:eg(ed),icon:"tabler-currency-dollar"}],ex=(0,s.useMemo)(()=>[X.accessor("name_ar",{header:e("productName"),cell:({row:r})=>{let s=r.original,i="ar"===t?s.name_ar:s.name_en,n="ar"===t?s.description_ar:s.description_en;return(0,a.jsxs)(T.A,{direction:"row",spacing:3,alignItems:"center",children:[(0,a.jsx)("img",{src:(0,z.VG)(s?.image),width:56,height:56,className:"rounded-lg object-cover bg-actionHover",alt:i}),(0,a.jsxs)(N.A,{className:"space-y-1",children:[(0,a.jsx)(u.A,{className:"font-semibold",color:"text.primary",children:i}),(0,a.jsx)(u.A,{variant:"body2",color:"text.secondary",noWrap:!0,children:n||e("noDescription")}),(0,a.jsxs)(T.A,{direction:"row",spacing:1,flexWrap:"wrap",children:[s.sku&&(0,a.jsx)(k.A,{size:"small",color:"default",variant:"outlined",label:`${e("sku")}: ${s.sku}`}),"number"==typeof s.sort_order&&(0,a.jsx)(k.A,{size:"small",variant:"outlined",label:`${e("sortOrder")}: ${s.sort_order}`})]})]})]})}}),X.accessor("category",{header:e("category"),cell:({row:e})=>(0,a.jsxs)(T.A,{spacing:.5,children:[(0,a.jsx)(u.A,{children:"ar"===t?e.original.category?.name_ar:e.original.category?.name_en}),e.original.category?.description_en&&(0,a.jsx)(u.A,{variant:"caption",color:"text.secondary",noWrap:!0,children:"ar"===t?e.original.category?.description_ar:e.original.category?.description_en})]})}),X.accessor("price",{header:e("price"),cell:({row:e})=>(0,a.jsxs)(T.A,{spacing:.5,children:[(0,a.jsx)(u.A,{fontWeight:600,children:eg(e.original.current_price??e.original.price)}),e.original.has_discount&&e.original.price&&(0,a.jsx)(u.A,{variant:"caption",color:"text.secondary",sx:{textDecoration:"line-through"},children:eg(e.original.price)})]})}),X.accessor("is_featured",{header:e("featured"),cell:({row:t})=>(0,a.jsx)(k.A,{size:"small",color:t.original.is_featured?"secondary":"default",variant:t.original.is_featured?"filled":"outlined",label:t.original.is_featured?e("yes"):e("no")})}),X.accessor("is_available",{header:e("available"),cell:({row:t})=>(0,a.jsx)(k.A,{size:"small",color:t.original.is_available?"success":"error",variant:"outlined",label:t.original.is_available?e("availability.available"):e("availability.unavailable")})}),X.accessor("actions",{header:e("actions"),cell:({row:t})=>(0,a.jsxs)(T.A,{direction:"row",spacing:1,children:[(0,a.jsx)(R.A,{title:e("actionsEdit"),children:(0,a.jsx)(c.A,{color:"primary",onClick:()=>r.push(b(`/products/edit/${t.original.id}`)),children:(0,a.jsx)("i",{className:"tabler-edit"})})}),(0,a.jsx)(R.A,{title:e("actionsView"),children:(0,a.jsx)(c.A,{onClick:()=>r.push(b(`/products/${t.original.id}`)),children:(0,a.jsx)("i",{className:"tabler-eye"})})}),(0,a.jsx)(R.A,{title:e("actionsDelete"),children:(0,a.jsx)(c.A,{color:"error",onClick:()=>j({id:String(t.original.id),name:t.original.name_en}),children:(0,a.jsx)("i",{className:"tabler-trash"})})})]}),enableSorting:!1})],[b,t,r,e]),eb=(0,H.N4)({data:es,columns:ex,filterFns:{fuzzy:Y},getCoreRowModel:(0,U.HT)(),getFilteredRowModel:(0,U.hM)(),getSortedRowModel:(0,U.h5)(),manualPagination:!0,pageCount:Math.max(1,Math.ceil(ei/S)),state:{pagination:{pageIndex:w-1,pageSize:S}},onPaginationChange:e=>{let t="function"==typeof e?e(eb.getState().pagination):e;r.push(`?${(0,z.jr)({page:t.pageIndex+1,per_page:t.pageSize})}`,{scroll:!1})}});(0,s.useEffect)(()=>{let e=setTimeout(()=>{let e=new URLSearchParams(window.location.search),t=v.trim();t?e.set("search",t):e.delete("search"),e.set("page","1"),Q?e.set("category_id",Q):e.delete("category_id"),$?e.set("sort_as",$):e.delete("sort_as"),L?e.set("is_available",L):e.delete("is_available"),y(t),r.replace(`?${e.toString()}`,{scroll:!1})},600);return()=>clearTimeout(e)},[L,Q,$,v,r]);let ev=(0,s.useCallback)(e=>{let t=Number(e.target.value);r.push(`?${(0,z.jr)({per_page:t,page:1})}`,{scroll:!1})},[r]),eA=async()=>{if(_)try{let t=await K.mutateAsync(_.id);D.oR.success(t?.message||e("deleteDialog.success")),j(null),J()}catch(r){let t=r?.response?.data?.message;D.oR.error(t||e("deleteDialog.error"))}};return ee?(0,a.jsx)(u.A,{color:"error",children:e("error")}):(0,a.jsxs)(T.A,{spacing:4,children:[(0,a.jsx)(o.A,{sx:{background:"linear-gradient(135deg, #162447 0%, #3a7bd5 100%)",color:"common.white"},children:(0,a.jsxs)(N.A,{className:"p-6 space-y-4",children:[(0,a.jsxs)(T.A,{direction:{xs:"column",md:"row"},justifyContent:"space-between",spacing:3,children:[(0,a.jsxs)(N.A,{children:[(0,a.jsx)(u.A,{variant:"h4",fontWeight:600,gutterBottom:!0,children:e("page.title")}),(0,a.jsx)(u.A,{sx:{color:"rgba(255,255,255,0.75)"},children:e("page.subtitle")})]}),(0,a.jsx)(T.A,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:{xs:"stretch",sm:"center"},children:(0,a.jsx)(d.default,{variant:"contained",color:"secondary",onClick:()=>r.push(b("/products/add")),startIcon:(0,a.jsx)("i",{className:"tabler-plus"}),children:e("page.actions.add")})})]}),(0,a.jsx)(P.default,{container:!0,spacing:3,children:em?.map(e=>a.jsx(P.default,{size:{xs:12,sm:6,lg:3},children:a.jsx(N.A,{sx:{p:3,borderRadius:3,backgroundColor:"rgba(0,0,0,0.2)",border:"1px solid rgba(255,255,255,0.2)",height:"100%"},children:a.jsxs(T.A,{spacing:1.5,children:[a.jsx(N.A,{sx:{width:42,height:42,borderRadius:"50%",backgroundColor:"rgba(0,0,0,0.25)",display:"flex",alignItems:"center",justifyContent:"center"},children:a.jsx("i",{className:`${e.icon} text-white`})}),Z?a.jsx(M.A,{variant:"text",width:"60%",sx:{bgcolor:"rgba(255,255,255,0.3)"}}):a.jsx(u.A,{variant:"h4",children:e.value}),a.jsx(u.A,{variant:"body2",sx:{color:"rgba(255,255,255,0.7)"},children:e.label}),a.jsx(u.A,{variant:"caption",sx:{color:"rgba(255,255,255,0.6)"},children:e.helper})]})})},e.key))})]})}),(0,a.jsx)(o.A,{children:(0,a.jsxs)(T.A,{spacing:3,className:"p-6",children:[(0,a.jsxs)("div",{className:"flex flex-wrap justify-between gap-4 items-end",children:[(0,a.jsx)(q.A,{placeholder:e("searchPlaceholder")||e("filters.searchPlaceholder"),value:v,onChange:e=>A(e.target.value),className:"max-sm:w-full flex-1 min-w-[200px]"}),(0,a.jsxs)("div",{className:"flex flex-wrap items-end gap-3",children:[(0,a.jsxs)(q.A,{select:!0,size:"small",label:e("sortOrder"),value:$,onChange:e=>(()=>{let t=new URLSearchParams(x.toString());t.set("page","1"),t.set("per_page",String(S));let a=f.trim();a?t.set("search",a):t.delete("search");let s=e.target.value;s?t.set("sort_as",s):t.delete("sort_as"),L?t.set("is_available",L):t.delete("is_available"),Q?t.set("category_id",Q):t.delete("category_id"),r.push(`?${t.toString()}`,{scroll:!1})})(),className:"w-32",children:[(0,a.jsx)(E.A,{value:"",children:"--"}),(0,a.jsx)(E.A,{value:"asc",children:e("sort.asc")}),(0,a.jsx)(E.A,{value:"desc",children:e("sort.desc")})]}),(0,a.jsxs)(q.A,{select:!0,size:"small",label:e("available"),value:L,onChange:e=>(()=>{let t=new URLSearchParams(x.toString());t.set("page","1"),t.set("per_page",String(S));let a=f.trim();a?t.set("search",a):t.delete("search"),$?t.set("sort_as",$):t.delete("sort_as");let s=e.target.value;s?t.set("is_available",s):t.delete("is_available"),Q?t.set("category_id",Q):t.delete("category_id"),r.push(`?${t.toString()}`,{scroll:!1})})(),className:"w-40",children:[(0,a.jsx)(E.A,{value:"",children:"ar"===t?"الكل":e("availability.all")}),(0,a.jsx)(E.A,{value:"true",children:"ar"===t?"المتوفر فقط":e("availability.available")}),(0,a.jsx)(E.A,{value:"false",children:"ar"===t?"غير المتوفر فقط":e("availability.unavailable")})]}),(0,a.jsxs)(q.A,{select:!0,size:"small",label:e("category"),value:Q,onChange:e=>(()=>{let t=new URLSearchParams(x.toString());t.set("page","1"),t.set("per_page",String(S));let a=f.trim();a?t.set("search",a):t.delete("search"),$?t.set("sort_as",$):t.delete("sort_as"),L?t.set("is_available",L):t.delete("is_available");let s=e.target.value;s?t.set("category_id",s):t.delete("category_id"),r.push(`?${t.toString()}`,{scroll:!1})})(),className:"w-48",children:[(0,a.jsx)(E.A,{value:"",children:e("category")}),er.map(e=>(0,a.jsx)(E.A,{value:e.id,children:e.label},e.id))]}),(0,a.jsx)(d.default,{variant:"text",color:"inherit",onClick:()=>{A("");let e=new URLSearchParams;e.set("page","1"),e.set("per_page",String(S)),r.replace(`?${e.toString()}`,{scroll:!1})},startIcon:(0,a.jsx)("i",{className:"tabler-refresh"}),children:e("filters.clear")})]})]}),(0,a.jsx)(I.A,{}),(0,a.jsx)("div",{className:"overflow-x-auto -mx-4 px-4",children:(0,a.jsxs)("table",{className:`${W().table} border-separate border-spacing-y-2`,children:[(0,a.jsx)("thead",{children:eb.getHeaderGroups().map(e=>(0,a.jsx)("tr",{children:e.headers.map(e=>(0,a.jsx)("th",{children:(0,H.Kv)(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,a.jsx)("tbody",{children:Z&&!es.length?Array.from({length:6}).map((e,t)=>(0,a.jsx)("tr",{children:Array.from({length:eb.getVisibleFlatColumns().length}).map((e,r)=>(0,a.jsx)("td",{children:(0,a.jsx)(M.A,{variant:"rounded",height:32})},`skeleton-${t}-${r}`))},`skeleton-${t}`)):0===eb.getRowModel().rows.length?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:eb.getVisibleFlatColumns().length,className:"text-center py-6",children:e("noData")})}):eb.getRowModel().rows.map(e=>(0,a.jsx)("tr",{className:"bg-backgroundPaper shadow-sm hover:shadow-md transition-all rounded-xl",children:e.getVisibleCells().map(e=>(0,a.jsx)("td",{className:"py-4 px-4 align-middle",children:(0,H.Kv)(e.column.columnDef.cell,e.getContext())},e.id))},e.id))})]})}),(0,a.jsx)(I.A,{}),(0,a.jsxs)(T.A,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:"center",gap:3,children:[(0,a.jsxs)(q.A,{select:!0,value:eb.getState().pagination.pageSize,onChange:ev,className:"w-24",children:[(0,a.jsx)(E.A,{value:"5",children:"5"}),(0,a.jsx)(E.A,{value:"10",children:"10"}),(0,a.jsx)(E.A,{value:"15",children:"15"}),(0,a.jsx)(E.A,{value:"25",children:"25"})]}),(0,a.jsx)(F.A,{table:eb,totalItems:ei})]})]})}),(0,a.jsxs)(p.A,{open:!!_,onClose:()=>j(null),children:[(0,a.jsx)(h.A,{children:e("deleteDialog.title")}),(0,a.jsx)(g.A,{children:(0,a.jsx)(C,{children:e("deleteDialog.description",{name:_?.name??""})})}),(0,a.jsxs)(m.A,{children:[(0,a.jsx)(d.default,{onClick:()=>j(null),color:"secondary",children:e("deleteDialog.cancel")}),(0,a.jsx)(d.default,{onClick:eA,color:"error",disabled:K.isPending,children:K.isPending?(0,a.jsx)(O.A,{size:18,color:"inherit"}):e("deleteDialog.confirm")})]})]})]})}},42109:e=>{e.exports={table:"table_table__cB3AL",cellWithInput:"table_cellWithInput__N6u24"}},97883:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>a});let a=(0,r(46760).registerClientReference)(function(){throw Error("Attempted to call the default export of \"E:\\\\bw\\\\unomenudash\\\\node_modules\\\\@mui\\\\material\\\\Grid2\\\\Grid2.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"E:\\bw\\unomenudash\\node_modules\\@mui\\material\\Grid2\\Grid2.js","default")},13762:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>l});var a=r(62740),s=r(9882),i=r(97883);let n=()=>(0,a.jsx)(i.default,{container:!0,spacing:6,children:(0,a.jsx)(i.default,{size:12,children:(0,a.jsx)(s.default,{})})}),l=async()=>(0,a.jsx)(n,{})},9882:(e,t,r)=>{"use strict";r.d(t,{default:()=>a});let a=(0,r(46760).registerClientReference)(function(){throw Error("Attempted to call the default export of \"E:\\\\bw\\\\unomenudash\\\\src\\\\views\\\\products\\\\simpleProduct\\\\index.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"E:\\bw\\unomenudash\\src\\views\\products\\simpleProduct\\index.tsx","default")},29280:(e,t,r)=>{"use strict";r.d(t,{IL:()=>n});let a={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",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ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},s=RegExp(Object.keys(a).join("|"),"g"),i={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function n(e,t,r){var a;if((r=r||{}).threshold=null!=(a=r.threshold)?a:i.MATCHES,!r.accessors){let a=l(e,t,r);return{rankedValue:e,rank:a,accessorIndex:-1,accessorThreshold:r.threshold,passed:a>=r.threshold}}let s=function(e,t){let r=[];for(let a=0,s=t.length;a<s;a++){let s=t[a],i="function"==typeof s?d:{...d,...s},n=function(e,t){let r=t;"object"==typeof t&&(r=t.accessor);let a=r(e);return null==a?[]:Array.isArray(a)?a:[String(a)]}(e,s);for(let e=0,t=n.length;e<t;e++)r.push({itemValue:n[e],attributes:i})}return r}(e,r.accessors),n={rankedValue:e,rank:i.NO_MATCH,accessorIndex:-1,accessorThreshold:r.threshold,passed:!1};for(let e=0;e<s.length;e++){let a=s[e],o=l(a.itemValue,t,r),{minRanking:d,maxRanking:c,threshold:u=r.threshold}=a.attributes;o<d&&o>=i.MATCHES?o=d:o>c&&(o=c),(o=Math.min(o,c))>=u&&o>n.rank&&(n.rank=o,n.passed=!0,n.accessorIndex=e,n.accessorThreshold=u,n.rankedValue=a.itemValue)}return n}function l(e,t,r){let a;return(e=o(e,r),(t=o(t,r)).length>e.length)?i.NO_MATCH:e===t?i.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase())===(t=t.toLowerCase())?i.EQUAL:e.startsWith(t)?i.STARTS_WITH:e.includes(` ${t}`)?i.WORD_STARTS_WITH:e.includes(t)?i.CONTAINS:1===t.length?i.NO_MATCH:(a="",e.split(" ").forEach(e=>{e.split("-").forEach(e=>{a+=e.substr(0,1)})}),a).includes(t)?i.ACRONYM:function(e,t){let r=0,a=0;function s(e,t,a){for(let s=a,i=t.length;s<i;s++)if(t[s]===e)return r+=1,s+1;return -1}let n=s(t[0],e,0);if(n<0)return i.NO_MATCH;a=n;for(let r=1,n=t.length;r<n;r++)if(!((a=s(t[r],e,a))>-1))return i.NO_MATCH;return function(e){let a=r/t.length;return i.MATCHES+1/e*a}(a-n)}(e,t)}function o(e,t){let{keepDiacritics:r}=t;return e=`${e}`,r||(e=e.replace(s,e=>a[e])),e}let d={maxRanking:1/0,minRanking:-1/0}}};var t=require("../../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),a=t.X(0,[638,403,171,719,398,1,160,38,411,170],()=>r(44653));module.exports=a})();