1"use strict";(self.webpackChunklight_bootstrap_dashboard_react=self.webpackChunklight_bootstrap_dashboard_react||[]).push([[8927],{66499:function(e,t,n){n.d(t,{BX:function(){return a},Tk:function(){return l}});var r=n(37762),i=n(1413),o=n(36685),l=function(e,t){var n,r=null===e||void 0===e||null===(n=e.metadata)||void 0===n?void 0:n.order_cost_bonus;if(void 0!==r&&null!==r&&""!==r){var i=Number(r);if(!Number.isNaN(i))return i}var l=Number(null===t||void 0===t?void 0:t[o.RC]);return Number.isNaN(l)?0:l},a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.generalConfig,o=function(e,t){var n,o,l=null===e||void 0===e||null===(n=e.metadata)||void 0===n?void 0:n.order_cost;if(l&&(l.cost||l.final_cost)){var a=Number(l.adjust_ratio||1)||1,d=Number(l.cost)||(l.final_cost?Math.round(Number(l.final_cost)/a):0);if(d<=0)return null;var s=Number(l.number_of_set||0);return{cost:d,number_of_set:s,base_price_vnd:Number(l.base_price_vnd)||(s>0?Math.round(d/s):d),breakdown:Array.isArray(l.breakdown)?l.breakdown.map((function(e){return(0,i.Z)((0,i.Z)({},e),{},{line_cost:Number(e.line_cost||0)})})):null,_synth:!!l._synth}}var c=null===e||void 0===e||null===(o=e.metadata)||void 0===o?void 0:o.parent_products;if(!Array.isArray(c)||!c.length)return null;var u,f="function"===typeof t?function(n){return Number(t(n,e)||0)}:function(e){return Number((null===e||void 0===e?void 0:e.quantity)||0)},p=0,h=0,g=[],x=(0,r.Z)(c);try{for(x.s();!(u=x.n()).done;){var v=u.value,m=f(v),b=Number((null===v||void 0===v?void 0:v.base_price_vnd)||0),y=m*b;y<=0||(p+=y,h+=m,g.push({product_code:(null===v||void 0===v?void 0:v.product_code)||"",quantity:m,base_price_vnd:b,line_cost:y}))}}catch(j){x.e(j)}finally{x.f()}return p<=0?null:{cost:p,number_of_set:h,base_price_vnd:h>0?Math.round(p/h):p,breakdown:g,_synth:!0}}(e,t.getParentSetCount);return o?function(e,t){if(!e)return null;var n=Number(e.cost)||0;if(n<=0)return null;var r=Number(t)||0,o=Math.round(n*(1+r/100)),l=n>0?Math.round(o/n*1e3)/1e3:1,a=Array.isArray(e.breakdown)?e.breakdown.map((function(e){return(0,i.Z)((0,i.Z)({},e),{},{bonus_percent:r,line_final:Math.round(Number(e.line_cost||0)*(1+r/100))})})):e.breakdown;return(0,i.Z)((0,i.Z)({},e),{},{bonus_percent:r,adjust_ratio:l,final_cost:o,breakdown:a})}(o,l(e,n)):null}},48927:function(e,t,n){n.r(t),n.d(t,{ART_COMPANY_ID:function(){return R},buildName:function(){return q},classifyArtStatus:function(){return B},getEffectiveOrderCost:function(){return G},getOrderImages:function(){return K},getOrderNumStatus:function(){return O},getOrderSetCount:function(){return E},getParentInfo:function(){return J},getParentProductCode:function(){return $},getProductImage:function(){return ee},parseFilterOptions:function(){return X},toLotus:function(){return Q}});var r=n(93433),i=n(29439),o=n(61819),l=n(1413),a=n(15861),d=n(37762),s=n(88391),c=n(87650),u=n(74961),f=n(23774),p=n(86960),h=n(37920),g=n.n(h),x=n(88513),v=n(48280),m=n(36441),b=n(52580),y=n(93847),j=n(18707),_=n(1885),S=n(15841),k=n(36685),w=n(66499),C=n(9226),z=n(89958),W=n(20998),Z=n(86676),M=n(69107),Y=n(75371),D=n(18204),I=n(68456),N=n(23712),R="000009",A=[R,"000001"],L=[{key:"today",label:"H\xf4m nay"},{key:"yesterday",label:"H\xf4m qua"},{key:"thisWeek",label:"Tu\u1ea7n n\xe0y"},{key:"lastWeek",label:"Tu\u1ea7n tr\u01b0\u1edbc"},{key:"thisMonth",label:"Th\xe1ng n\xe0y"},{key:"lastMonth",label:"Th\xe1ng tr\u01b0\u1edbc"},{key:"all",label:"T\u1ea5t c\u1ea3"}],T=[{bg:"#dbeafe",border:"#3b82f6",text:"#1d4ed8"},{bg:"#dcfce7",border:"#22c55e",text:"#15803d"},{bg:"#fef9c3",border:"#eab308",text:"#a16207"},{bg:"#fce7f3",border:"#ec4899",text:"#be185d"},{bg:"#ffedd5",border:"#f97316",text:"#c2410c"},{bg:"#ede9fe",border:"#8b5cf6",text:"#6d28d9"},{bg:"#cffafe",border:"#06b6d4",text:"#0e7490"},{bg:"#fee2e2",border:"#ef4444",text:"#b91c1c"},{bg:"#f0fdf4",border:"#4ade80",text:"#166534"},{bg:"#fdf4ff",border:"#c084fc",text:"#7e22ce"}],H={bg:"#f8f9fa",border:"#dee2e6",text:"#495057"},P=function(e){var t={queued:{label:"Ch\u1edd t\xf4",image:W},painting:{label:"\u0110ang t\xf4",image:Z}
1,done:{label:"Chu\u1ea9n b\u1ecb giao",image:M},done2:{label:"Ho\xe0n th\xe0nh",image:Y},shipped:{label:"Giao MH",image:D}};return t[e]||t.queued},O=function(e){var t=null===e||void 0===e?void 0:e.status;if(null===t||void 0===t||""===t)return null;var n=Number(t);if(!isNaN(n))return n;var r=u.QS.getCodeByEnum(String(t));return null!==r?r:null},B=function(e){var t=O(e);return null===t||t<=10?"queued":11===t?"painting":12===t?"done":13===t?"done2":t>=15?"shipped":"queued"},q=function(e){var t,n,r,i,o=null===e||void 0===e||null===(t=e.metadata)||void 0===t||null===(n=t.parent_product)||void 0===n?void 0:n.title;if(o)return o;var l=null===e||void 0===e||null===(r=e.listings)||void 0===r||null===(i=r[0])||void 0===i?void 0:i.title;return l||((null===e||void 0===e?void 0:e.order_id)||"Unknown")},F=function(e){var t,n={},r=(0,d.Z)((null===e||void 0===e?void 0:e.listings)||[]);try{for(r.s();!(t=r.n()).done;){var i=t.value,o=String((null===i||void 0===i?void 0:i.product_code)||(null!==i&&void 0!==i&&i.sku&&null!==i&&void 0!==i&&i.size?"".concat(i.sku,"-").concat(i.size):"")||"").toUpperCase();o&&(n[o]=(n[o]||0)+Number((null===i||void 0===i?void 0:i.quantity)||0))}}catch(l){r.e(l)}finally{r.f()}return n},U=function(e,t){var n=(Array.isArray(null===e||void 0===e?void 0:e.child_products)?e.child_products:[]).find((function(e){return(null===e||void 0===e?void 0:e.product_code)&&Number((null===e||void 0===e?void 0:e.quantity)||0)>0}));if(!n)return 0;var r=Number(n.quantity||0),i=Number(t[String(n.product_code).toUpperCase()]||0);return r>0&&i>0?Math.round(i/r):0},E=function(e){var t,n=(null===e||void 0===e?void 0:e.metadata)||{},r=F(e);return null!==(t=n.parent_product)&&void 0!==t&&t.product_code?U(n.parent_product,r):Array.isArray(n.parent_products)?n.parent_products.reduce((function(e,t){return e+U(t,r)}),0):0},G=function(e,t){return(0,w.BX)(e,{generalConfig:t,getParentSetCount:function(e,t){return U(e,F(t))}})},K=function(e,t){var n=[];t&&n.push(t);var r,i=(0,d.Z)((null===e||void 0===e?void 0:e.listings)||[]);try{for(i.s();!(r=i.n()).done;){var o=r.value;null!==o&&void 0!==o&&o.img_url&&!n.includes(o.img_url)&&n.push(o.img_url)}}catch(l){i.e(l)}finally{i.f()}return n},Q=function(e){return Math.round(Number(e||0)/1e3)},X=function(e){return String(e||"").split(/\r?\n/).map((function(e){return e.trim()})).filter(Boolean).map((function(e){var t=e.indexOf(":"),n=(-1===t?e:e.slice(0,t)).trim(),r=(-1===t?n:e.slice(t+1)).trim();return n?{value:n,label:r||n}:null})).filter(Boolean)},V=function(e,t){if(!e)return"";var n=X(t).find((function(t){return t.value===e}));return n?n.label:e},$=function(e){var t,n,r=(null===e||void 0===e?void 0:e.metadata)||{};return null!==(t=r.parent_product)&&void 0!==t&&t.product_code?String(r.parent_product.product_code):Array.isArray(r.parent_products)&&null!==(n=r.parent_products[0])&&void 0!==n&&n.product_code?String(r.parent_products[0].product_code):null},J=function(e){var t,n=(null===e||void 0===e?void 0:e.metadata)||{},r=F(e),i=[];if(null!==(t=n.parent_product)&&void 0!==t&&t.product_code)i.push({code:String(n.parent_product.product_code).replace(/^\d{6}_/,""),quantity:U(n.parent_product,r)});else if(Array.isArray(n.parent_products)){var o,l=(0,d.Z)(n.parent_products);try{for(l.s();!(o=l.n()).done;){var a=o.value;null!==a&&void 0!==a&&a.product_code&&i.push({code:String(a.product_code).replace(/^\d{6}_/,""),quantity:U(a,r)})}}catch(s){l.e(s)}finally{l.f()}}return i},ee=function(e){var t,n,r;return(null===(t=((null===e||void 0===e?void 0:e.metadata)||{}).parent_product)||void 0===t?void 0:t.img_url)||(null===e||void 0===e||null===(n=e.listings)||void 0===n||null===(r=n[0])||void 0===r?void 0:r.img_url)||null},te=function(e){if(!e)return"";var t=g()(e);return t.isSame(g()(),"day")?t.format("HH:mm"):t.format("DD/MM HH:mm")},ne=function(){var e=(0,a.Z)((0,o.Z)().mark((function e(t){var n,r,i,a,d=arguments;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=d.length>1&&void 0!==d[1]?d[1]:{},r=(0,S.LP)(),e.next=4,fetch("".concat((0,_.kG)()).concat(t),(0,l.Z)((0,l.Z)({},n),{},{headers:(0,l.Z)({Authorization:"Bearer ".concat(r)},n.headers||{})}));case 4:return i=e.sent,e.next=7,i.json();case 7:if(0!==(a=e.sent).status){e.next=10;break}throw new Error(a.message||"L\u1ed7i server");case 10:return e.abrupt("return",a);case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();t.default=(0,f.$j)((function(e){return{currentCompany:e.companyReducer.currentCompany,currentUser:e.authen
1Reducer.user}}))((function(e){var t=e.currentCompany,n=e.currentUser,f=(0,p.k6)(),h=(0,p.TH)(),S=function(e){return new URLSearchParams(h.search).get(e)},w=function(e,t){var n=new URLSearchParams(h.search);e?n.set("date",e):n.delete("date"),t?n.set("status",t):n.delete("status"),f.replace({search:n.toString()})},Y=(0,s.useState)([]),F=(0,i.Z)(Y,2),U=F[0],re=F[1],ie=(0,s.useState)({}),oe=(0,i.Z)(ie,2),le=oe[0],ae=oe[1],de=(0,s.useState)(null),se=(0,i.Z)(de,2),ce=se[0],ue=se[1],fe=(0,s.useState)(null),pe=(0,i.Z)(fe,2),he=pe[0],ge=pe[1],xe=(0,s.useState)({}),ve=(0,i.Z)(xe,2),me=ve[0],be=ve[1],ye=(0,s.useState)(!1),je=(0,i.Z)(ye,2),_e=je[0],Se=je[1],ke=(0,s.useState)(""),we=(0,i.Z)(ke,2),Ce=we[0],ze=we[1],We=(0,s.useState)((function(){return S("date")||localStorage.getItem("art_overview_date_filter")||"today"})),Ze=(0,i.Z)(We,2),Me=Ze[0],Ye=Ze[1],De=(0,s.useState)((function(){return S("status")||localStorage.getItem("art_overview_status_filter")||""})),Ie=(0,i.Z)(De,2),Ne=Ie[0],Re=Ie[1],Ae=(0,s.useState)(null),Le=(0,i.Z)(Ae,2),Te=Le[0],He=Le[1],Pe=(0,s.useState)(null),Oe=(0,i.Z)(Pe,2),Be=Oe[0],qe=Oe[1],Fe=(0,s.useState)((function(){return"false"!==localStorage.getItem("art_overview_show_details")})),Ue=(0,i.Z)(Fe,2),Ee=Ue[0],Ge=Ue[1],Ke=(0,s.useState)((function(){return"true"===localStorage.getItem("art_overview_expand_order")})),Qe=(0,i.Z)(Ke,2),Xe=Qe[0],Ve=Qe[1],$e=(0,s.useState)(""),Je=(0,i.Z)($e,2),et=Je[0],tt=Je[1],nt=(0,s.useState)(""),rt=(0,i.Z)(nt,2),it=rt[0],ot=rt[1],lt=(0,s.useState)(!1),at=(0,i.Z)(lt,2),dt=at[0],st=at[1],ct=(0,s.useState)(""),ut=(0,i.Z)(ct,2),ft=ut[0],pt=ut[1],ht=(0,s.useState)(null),gt=(0,i.Z)(ht,2),xt=gt[0],vt=gt[1],mt=(0,s.useState)([]),bt=(0,i.Z)(mt,2),yt=bt[0],jt=bt[1],_t=(0,s.useState)(!1),St=(0,i.Z)(_t,2),kt=St[0],wt=St[1],Ct=(0,s.useState)(1),zt=(0,i.Z)(Ct,2),Wt=zt[0],Zt=zt[1],Mt=(0,s.useState)(1),Yt=(0,i.Z)(Mt,2),Dt=Yt[0],It=Yt[1],Nt=(0,s.useState)(0),Rt=(0,i.Z)(Nt,2),At=Rt[0],Lt=Rt[1],Tt=(0,s.useState)("ALL"),Ht=(0,i.Z)(Tt,2),Pt=Ht[0],Ot=Ht[1],Bt=window.innerWidth<768,qt=(null===n||void 0===n?void 0:n.username)||"",Ft=String((null===t||void 0===t?void 0:t.company_id)||(null===t||void 0===t?void 0:t.company_shortcode)||""),Ut=A.includes(Ft),Et=function(){var e=(0,a.Z)((0,o.Z)().mark((function e(){return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Te){e.next=2;break}return e.abrupt("return");case 2:return st(!0),e.prev=3,e.next=6,ne("/api/order",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([{order_id:Te.order_id,shop_id:Te.shop_id,status:et,custom_filter_1:it||void 0}])});case 6:re((function(e){return e.map((function(e){return e.order_id===Te.order_id?(0,l.Z)((0,l.Z)({},e),{},{status:et,custom_filter_1:it||e.custom_filter_1}):e}))})),He(null),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),alert("L\u1ed7i l\u01b0u: "+e.t0.message);case 13:return e.prev=13,st(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[3,10,13,16]])})));return function(){return e.apply(this,arguments)}}(),Gt=(0,s.useMemo)((function(){if("all"===Me)return{from:null,to:null};var e=g()().format("YYYY-MM-DD"),t=e,n=e;return"yesterday"===Me?n=t=g()().subtract(1,"day").format("YYYY-MM-DD"):"thisWeek"===Me?t=g()().startOf("isoWeek").format("YYYY-MM-DD"):"lastWeek"===Me?(t=g()().subtract(1,"week").startOf("isoWeek").format("YYYY-MM-DD"),n=g()().subtract(1,"week").endOf("isoWeek").format("YYYY-MM-DD")):"thisMonth"===Me?t=g()().startOf("month").format("YYYY-MM-DD"):"lastMonth"===Me&&(t=g()().subtract(1,"month").startOf("month").format("YYYY-MM-DD"),n=g()().subtract(1,"month").endOf("month").format("YYYY-MM-DD")),{from:t,to:n}}),[Me]);(0,s.useEffect)((function(){ne("/api/permissions/users-by-group?group_name=".concat(encodeURIComponent("Team Fulfill"))).then((function(e){var t,n={};((null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.users)||[]).forEach((function(e){var t;e.username&&(n[e.username]={fullname:e.fullname||e.full_name||e.username,hopDong:(null===(t=e.metadata)||void 0===t?void 0:t.hop_dong)||""})})),be(n)})).catch((function(){}))}),[]),(0,s.useEffect)((function(){if(Ut){var e=function(){var e=(0,a.Z)((0,o.Z)().mark((function e(){var t,n,r,i,l;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Se(!0),ze(""),e.prev=2,r="".concat((0,_.kG)(),"/api/order/get-orders?limit=1000&skip=0&super_root_check_company_id=").concat(R),e.next=6,y.b.get(r);case 6:i=e.sent,l=(null===i||void 0===i||null===(t=i.data)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.orders)||[],re(l.filter((function(e){return String((null===e||void 0===e?void 0:e.company_id)||"")===R}))),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(2),ze((null===e.t0||void 0===e.t0?void 0:e.t0.message)||"Kh\xf4ng th\u1ec3 t\u1ea3i d\u1eef li\u1ec7u ART Overview");case 14:return e.prev=14,Se(!1),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[2,11,14,17]])})));return function(){return e.apply(this,arguments)}}();e()}}),[Ut]),(0,s.useEffect)((function(){var e,t=new Set,n=(0,d.Z)(U);try{for(n.s();!(e=n.n()).done;){var i=e.value,o=$(i);o&&t.add(String(o).toUpperCase())}}catch(c){n.e(c)}finally{n.f()}var a=(0,r.Z)(t).filter((function(e){return!le[e]}));if(a.length){var s=!1;return j.ht.getSESProductsByCodes(a).then((function(e){var t,n,r;if(!s){var i=(null===e||void 0===e||null===(t=e.data)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.result)||(null===e||void 0===e||null===(r=e.data)||void 0===r?void 0:r.data)||[];Array.isArray(i)&&i.length&&ae((function(e){var t,n=(0,l.Z)({},e),r=(0,d.Z)(i);try{for(r.s();!(t=r.n()).done;){var o=t.value,a=String((null===o||void 0===o?void 0:o.product_code)||"").toUpperCase(),s=Array.isArray(null===o||void 0===o?void 0:o.images)&&o.images.length&&(o.images[0].image_link||o.images[0].thumbnail_url)||null;a&&s&&(n[a]=s)}}catch(c){r.e(c)}finally{r.f()}return n}))}})).catch((function(e){console.warn("ArtOverview parent image fetch failed:",null===e||void 0===e?void 0:e.message)})),function(){s=!0}}}),[U]);var Kt=(0,s.useMemo)((function(){var e=new Set;
1return U.forEach((function(t){var n=String((null===t||void 0===t?void 0:t.executor_user)||"").trim();n&&e.add(n)})),Array.from(e).sort()}),[U]),Qt=(0,s.useMemo)((function(){var e=function(e){if(!Gt.from)return!0;var t=function(e){if(!e)return!1;var t=g()(e).format("YYYY-MM-DD");return t>=Gt.from&&t<=Gt.to};return t(e.start_fulfill)||t(e.finish_fulfill)||t(e.shipping_center_date)},t=function(e){if(!Ne)return!0;var t=O(e);return"processing"===Ne?null!==t&&t>=10&&t<=13:"processed"!==Ne||null!==t&&t>=15},n=function(e,t){return e.start_fulfill||t.start_fulfill?e.start_fulfill?t.start_fulfill?new Date(t.start_fulfill)-new Date(e.start_fulfill):1:-1:0},r=Kt.map((function(r,i){return{executor:r,colorIndex:i,orders:U.filter((function(e){return String((null===e||void 0===e?void 0:e.executor_user)||"").trim()===r})).filter(e).filter(t).sort(n)}})),i=U.filter((function(e){return!String((null===e||void 0===e?void 0:e.executor_user)||"").trim()})).filter(e).filter(t).sort(n);return i.length>0&&r.push({executor:"",colorIndex:-1,orders:i}),r}),[U,Kt,Ne,Gt]),Xt=(0,s.useMemo)((function(){return Qt.flatMap((function(e){return e.orders})).reduce((function(e,t){var n=E(t)||1,r=B(t);if("done"===r||"done2"===r?e.done+=n:"painting"===r?e.painting+=n:"shipped"!==r&&(e.queued+=n),t.shipping_center_date){var i=g()(t.shipping_center_date).format("YYYY-MM-DD");(!Gt.from||i>=Gt.from&&i<=Gt.to)&&(e.shipped+=n)}if(Gt.from&&t.start_fulfill){var o=g()(t.start_fulfill).format("YYYY-MM-DD");o>=Gt.from&&o<=Gt.to&&(e.inRange+=n)}return e}),{done:0,painting:0,queued:0,shipped:0,inRange:0})}),[Qt,Gt]),Vt=(0,s.useMemo)((function(){if("all"===Me)return"T\u1ea5t c\u1ea3";var e=g()(Gt.from).format("DD/MM/YYYY"),t=g()(Gt.to).format("DD/MM/YYYY");return"today"===Me||"yesterday"===Me?e:"".concat(e," - ").concat(t)}),[Me,Gt.from,Gt.to]),$t=function(e){return(0,k.a4)(e,t)||e||"-"},Jt=(0,k.Dm)(t),en=(null===Jt||void 0===Jt?void 0:Jt[k.kc])||"",tn=function(){var e=(0,a.Z)((0,o.Z)().mark((function e(t){var n,r,i,l,a,d,s=arguments;return(0,o.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:1,wt(!0),e.prev=2,e.next=5,ne("/api/order/get-logs/".concat(encodeURIComponent(t),"?page=").concat(n));case 5:r=e.sent,i=(null===r||void 0===r?void 0:r.data)||{},l=i.logs,a=i.totalPages,d=i.totalCount,jt(Array.isArray(l)?l:[]),It(a||1),Lt(d||0),Zt(n),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(2),jt([]);case 16:return e.prev=16,wt(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[2,13,16,19]])})));return function(t){return e.apply(this,arguments)}}(),nn=function(e,t){t.stopPropagation(),vt(e),jt([]),Ot("ALL"),tn(e.order_id,1)},rn=(0,s.useMemo)((function(){var e=[],t=[];return Qt.forEach((function(n){var r,i=n.executor,o=n.orders;if(i&&0!==o.length){var l=(null===(r=me[i])||void 0===r?void 0:r.hopDong)||"";"fulltime"===String(l).toLowerCase()?e.push(i):t.push(i)}})),e.sort((function(e,t){var n,r;return((null===(n=me[e])||void 0===n?void 0:n.fullname)||e).localeCompare((null===(r=me[t])||void 0===r?void 0:r.fullname)||t)})),t.sort((function(e,t){var n,r;return((null===(n=me[e])||void 0===n?void 0:n.fullname)||e).localeCompare((null===(r=me[t])||void 0===r?void 0:r.fullname)||t)})),{fulltimeList:e,parttimeList:t}}),[Qt,me]),on=(0,s.useMemo)((function(){return(ft?Qt.filter((function(e){return e.executor===ft})):Qt).filter((function(e){return e.orders.length>0}))}),[Qt,ft]),ln=function(e){var t=e.hopDong;if(!t)return null;var n="fulltime"===String(t).toLowerCase();return(0,N.jsx)("span",{style:{fontSize:10,fontWeight:700,padding:"1px 5px",borderRadius:4,background:n?"#dcfce7":"#fef9c3",color:n?"#15803d":"#a16207",border:"1px solid ".concat(n?"#86efac":"#fde68a"),whiteSpace:"nowrap",flexShrink:0},children:n?"FT":"PT"})};if(!Ut)return(0,N.jsx)("div",{className:"content",children:(0,N.jsxs)(x.Z,{color:"warning",className:"mb-0",children:["ART Overview ch\u1ec9 d\xe0nh cho company ",(0,N.jsx)("b",{children:A.join(", ")}),"."]})});var an=function(e){var t=$(e);if(t){var n=le[String(t).toUpperCase()];if(n)return n}return ee(e)},dn=function(e){var t=Array.isArray(null===e||void 0===e?void 0:e.listings)?e.listings:[];return(0,N.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:t.map((function(t,n){var r,i=(t.product_code||(t.sku&&t.size?"".concat(t.sku,"-").concat(t.size):t.sku)||"").replace(/^\d{6}_/,""),o=null!==(r=t.quantity)&&void 0!==r?r:1;return(0,N.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[t.img_url?(0,N.jsx)("img",{src:t.img_url,alt:"",onClick:function(n){n.stopPropagation();var r=K(e,an(e)),i=r.indexOf(t.img_url);ue({images:r,index:i>=0?i:0})},style:{width:44,height:44,objectFit:"cover",borderRadius:6,flexShrink:0,border:"1px solid #e9ecef",cursor:"zoom-in"}}):(0,N.jsx)("div",{style:{width:44,height:44,borderRadius:6,background:"#f1f3f5",flexShrink:0}}),(0,N.jsxs)("div",{style:{fontSize:11,color:"#495057",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:[t.title?(0,N.jsxs)("span",{style:{fontWeight:600,color:"#212529"},children:[t.title," \xb7 "]}):null,(0,N.jsx)("span",{style:{fontFamily:"monospace",fontWeight:700},children:i})," ",(0,N.jsxs)("span",{style:{background:"#198754",color:"#fff",borderRadius:8,padding:"0 5px",fontSize:10,fontWeight:800},children:["\xd7",o]})]})]},n)}))})},sn=function(e){var t=G(e,Jt);return t&&t.final_cost?(0,N.jsxs)("span",{onClick:function(t){t.stopPropagation(),ge(e)},title:"Xem chi ti\u1ebft th\u01b0\u1edfng",style:{fontSize:11,fontWeight:800,color:"#dc2626",background:"#fff1f2",border:"1px solid #fecaca",borderRadius:8,padding:"1px 8px",whiteSpace:"nowrap",cursor:"pointer"}
1,children:["\ud83e\udeb7 ",Q(t.final_cost).toLocaleString("vi-VN"),t.adjust_ratio>1?(0,N.jsxs)("span",{style:{marginLeft:4,color:"#7c3aed",fontWeight:700},children:["(+",Math.round(100*(t.adjust_ratio-1)),"%)"]}):null]}):null},cn=function(e){var t=e.displayName,n=e.pc,r=e.size,i=void 0===r?56:r;return(0,N.jsx)("div",{style:{width:i,height:i,borderRadius:"50%",background:n.border,display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontWeight:700,fontSize:.4*i,flexShrink:0},children:t.charAt(0).toUpperCase()})};return(0,N.jsxs)("div",{className:"content",children:[(0,N.jsx)("div",{className:"mb-3",children:(0,N.jsxs)("div",{className:"d-flex flex-column flex-md-row align-items-md-start justify-content-md-between",style:{gap:10},children:[(0,N.jsxs)("div",{children:[(0,N.jsxs)("h2",{className:"mt-0 mb-2",style:{fontWeight:700,fontSize:Bt?22:void 0},children:["ART Overview ",(0,N.jsxs)("span",{style:{fontSize:"0.6em",fontWeight:400,color:"#6c757d"},children:["(",Vt,")"]})]}),(0,N.jsxs)("div",{className:"d-flex flex-wrap align-items-center",style:{gap:10},children:[Gt.from&&(0,N.jsx)("div",{className:"d-flex align-items-center",style:{gap:5,fontSize:13,color:"#15803d",fontWeight:600},children:(0,N.jsxs)("span",{children:["\ud83c\udfa8 T\xf4 ","today"===Me?"h\xf4m nay":"yesterday"===Me?"h\xf4m qua":"thisWeek"===Me?"tu\u1ea7n n\xe0y":"lastWeek"===Me?"tu\u1ea7n tr\u01b0\u1edbc":Vt,": ",(0,N.jsx)("b",{children:Xt.inRange})]})}),(0,N.jsxs)("div",{className:"d-flex align-items-center text-muted",style:{gap:5,fontSize:13},children:[(0,N.jsx)("img",{src:D,alt:"Giao MH",style:{width:16,height:16,objectFit:"contain"}}),(0,N.jsxs)("span",{children:["Giao MH: ",(0,N.jsx)("b",{children:Xt.shipped})]})]}),(0,N.jsxs)("div",{className:"d-flex align-items-center text-muted",style:{gap:5,fontSize:13},children:[(0,N.jsx)("img",{src:M,alt:"Chu\u1ea9n b\u1ecb giao",style:{width:16,height:16,objectFit:"contain"}}),(0,N.jsxs)("span",{children:["Chu\u1ea9n b\u1ecb giao: ",(0,N.jsx)("b",{children:Xt.done})]})]}),(0,N.jsxs)("div",{className:"d-flex align-items-center text-muted",style:{gap:5,fontSize:13},children:[(0,N.jsx)("img",{src:Z,alt:"\u0110ang t\xf4",style:{width:16,height:16,objectFit:"contain"}}),(0,N.jsxs)("span",{children:["\u0110ang t\xf4: ",(0,N.jsx)("b",{children:Xt.painting})]})]}),(0,N.jsxs)("div",{className:"d-flex align-items-center text-muted",style:{gap:5,fontSize:13},children:[(0,N.jsx)("img",{src:W,alt:"Ch\u1edd t\xf4",style:{width:16,height:16,objectFit:"contain"}}),(0,N.jsxs)("span",{children:["Ch\u1edd t\xf4: ",(0,N.jsx)("b",{children:Xt.queued})]})]}),(0,N.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:5,fontSize:13,color:"#495057",cursor:"pointer",margin:0,userSelect:"none"},children:[(0,N.jsx)("input",{type:"checkbox",checked:!Ee,onChange:function(e){Ge(!e.target.checked),localStorage.setItem("art_overview_show_details",String(!e.target.checked))},style:{cursor:"pointer"}}),"T\u1ed5ng quan"]}),(0,N.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:5,fontSize:13,color:"#495057",cursor:"pointer",margin:0,userSelect:"none"},children:[(0,N.jsx)("input",{type:"checkbox",checked:Xe,onChange:function(e){Ve(e.target.checked),localStorage.setItem("art_overview_expand_order",String(e.target.checked))},style:{cursor:"pointer"}}),"M\u1edf r\u1ed9ng \u0111\u01a1n"]})]}),(rn.fulltimeList.length>0||rn.parttimeList.length>0)&&(0,N.jsxs)("div",{className:"d-flex align-items-center",style:{gap:8,marginTop:6},children:[(0,N.jsx)("span",{style:{fontSize:13,color:"#6c757d",whiteSpace:"nowrap"},children:"Ng\u01b0\u1eddi th\u1ef1c hi\u1ec7n:"}),(0,N.jsxs)("select",{value:ft,onChange:function(e){return pt(e.target.value)},style:{padding:"4px 10px",borderRadius:20,fontSize:13,border:"1.5px solid ".concat(ft?"#0d6efd":"#dee2e6"),background:ft?"#e7f1ff":"#fff",color:ft?"#0d6efd":"#6c757d",fontWeight:ft?700:400,cursor:"pointer",outline:"none"},children:[(0,N.jsx)("option",{value:"",children:"All task"}),qt&&Qt.some((function(e){return e.executor===qt&&e.orders.length>0}))&&(0,N.jsx)("option",{value:qt,children:"My task"}),rn.fulltimeList.length>0&&(0,N.jsx)("option",{disabled:!0,children:"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"}),rn.fulltimeList.map((function(e){var t;return(0,N.jsx)("option",{value:e,children:(null===(t=me[e])||void 0===t?void 0:t.fullname)||e},e)}
1)),rn.parttimeList.length>0&&(0,N.jsx)("option",{disabled:!0,children:"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"}),rn.parttimeList.map((function(e){var t;return(0,N.jsx)("option",{value:e,children:(null===(t=me[e])||void 0===t?void 0:t.fullname)||e},e)}))]})]})]}),(0,N.jsxs)("div",{className:"d-flex flex-column",style:{gap:6,flexShrink:0},children:[(0,N.jsx)("div",{className:"d-flex flex-wrap",style:{gap:6},children:L.map((function(e){return(0,N.jsx)(v.Z,{size:"sm",color:Me===e.key?"primary":"secondary",outline:Me!==e.key,onClick:function(){Ye(e.key),localStorage.setItem("art_overview_date_filter",e.key),w(e.key,Ne)},children:e.label},e.key)}))}),(0,N.jsx)("div",{className:"d-flex flex-wrap",style:{gap:6},children:[{key:"",label:"T\u1ea5t c\u1ea3 tr\u1ea1ng th\xe1i"},{key:"processing",label:"\u0110ang x\u1eed l\xfd"},{key:"processed",label:"\u0110\xe3 x\u1eed l\xfd"}].map((function(e){return(0,N.jsx)(v.Z,{size:"sm",color:Ne===e.key?"warning":"secondary",outline:Ne!==e.key,onClick:function(){Re(e.key),localStorage.setItem("art_overview_status_filter",e.key),w(Me,e.key)},children:e.label},e.key)}))})]})]})}),Ce&&(0,N.jsx)(x.Z,{color:"danger",children:Ce}),_e?(0,N.jsx)("div",{className:"d-flex align-items-center justify-content-center py-5",children:(0,N.jsx)(m.Z,{color:"primary"})}):function(){var e=Bt?1:Xe?3:Ee?4:3,t=Array.from({length:e},(function(){return[]})),n=new Array(e).fill(0);return on.forEach((function(e){var i=n.indexOf(Math.min.apply(Math,(0,r.Z)(n)));t[i].push(e),n[i]+=e.orders.length+1})),(0,N.jsx)("div",{style:{display:"flex",gap:10,alignItems:"flex-start"},children:t.map((function(e,t){return(0,N.jsx)("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:10},children:e.map((function(e){var t,n=e.executor,r=e.orders,i=e.colorIndex,o=i>=0?T[i%T.length]:H,l=(t=n)?me[t]||{fullname:t,hopDong:""}:{fullname:"Ch\u01b0a ph\xe2n c\xf4ng",hopDong:""},a=l.fullname,d=l.hopDong;return Ee?(0,N.jsxs)("div",{style:{background:"#fff",borderRadius:12,boxShadow:"0 1px 6px rgba(0,0,0,0.09)",overflow:"hidden",border:"2px solid ".concat(o.border)},children:[(0,N.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 14px",background:o.bg,borderBottom:"1px solid ".concat(o.border)},children:[(0,N.jsx)(cn,{displayName:a,pc:o,size:36}),(0,N.jsx)("span",{style:{fontWeight:700,fontSize:15,color:o.text},children:a}),(0,N.jsx)(ln,{hopDong:d}),(0,N.jsxs)("span",{style:{fontSize:12,color:o.text,opacity:.6,marginLeft:"auto"},children:[r.length," \u0111\u01a1n"]})]}),0===r.length?(0,N.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:12,color:"#adb5bd",padding:"14px"},children:[(0,N.jsx)("img",{src:I,alt:"",style:{width:14,height:14}})," Kh\xf4ng c\xf3 \u0111\u01a1n"]}):(0,N.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"10px"},children:r.map((function(e){var t=e.start_fulfill?g()(e.start_fulfill).format("YYYY-MM-DD"):null;return function(e,t){var n,r,i=B(e),o=P(i),l=q(e),a=V(null===e||void 0===e?void 0:e.custom_filter_1,en),d="painting"===i?"#fd7e14":"done"===i||"done2"===i?"#198754":"shipped"===i?"#0d6efd":"#adb5bd",s=$t(e.order_id),c=null===e||void 0===e||null===(n=e.listings)||void 0===n?void 0:n[0],u=an(e),f=c?(c.product_code||c.sku||"").replace(/^\d{6}_/,""):"",p=null!==(r=null===c||void 0===c?void 0:c.quantity)&&void 0!==r?r:1,h=J(e),g=h.reduce((function(e,t){return e+Number(t.quantity||0)}),0);return(0,N.jsxs)("div",{onClick:function(){return qe(e)},style:{display:"grid",gridTemplateColumns:"100px 1fr auto",gap:8,padding:"8px 10px",borderRadius:6,background:t?"#f0fdf4":"#fff",border:t?"1px solid #bbf7d0":"1px solid #e9ecef",cursor:"pointer",alignItems:"center"},children:[(0,N.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:4,minWidth:0},children:[(0,N.jsxs)("div",{style:{position:"relative",width:100,height:100},children:[u?(0,N.jsx)("img",{src:u,alt:"",onClick:function(t){t.stopPropagation();var n=K(e,u);n.length&&ue({images:n,index:0})},style:{width:100,height:100,objectFit:"cover",borderRadius:8,cursor:"zoom-in"}}):(0,N.jsx)("div",{style:{width:100,height:100,borderRadius:8,background:"#f1f3f5"}}),g>0&&(0,N.jsx)("span",{style:{position:"absolute",top:5,right:5,background:"#16a34a",color:"#fff",borderRadius:999,minWidth:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,fontWeight:800,padding:"0 6px",border:"2px s
1olid #fff",boxShadow:"0 1px 4px rgba(0,0,0,0.25)"},children:g})]}),h.map((function(e,t){return(0,N.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:4,flexWrap:"wrap"},children:[(0,N.jsx)("span",{style:{fontSize:11,fontWeight:800,color:"#dc2626",fontFamily:"monospace",lineHeight:1.3,wordBreak:"break-all",border:"1px solid #f5a3a3",background:"#fff5f5",borderRadius:5,padding:"1px 6px"},children:e.code}),e.quantity>0&&(0,N.jsxs)("span",{style:{fontSize:10,fontWeight:800,color:"#fff",background:"#198754",borderRadius:8,padding:"1px 7px",whiteSpace:"nowrap"},children:["\xd7",e.quantity]})]},t)}))]}),(0,N.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:3,minWidth:0},children:[(0,N.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5,minWidth:0},children:[(0,N.jsx)("span",{style:{fontSize:10,background:"#e9ecef",color:"#495057",borderRadius:4,padding:"1px 5px",fontWeight:700,whiteSpace:"nowrap",flexShrink:0},children:s}),(0,N.jsx)("span",{style:{fontSize:13,fontWeight:700,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#212529"},children:l})]}),Xe?dn(e):f&&(0,N.jsxs)("div",{style:{fontSize:11,fontWeight:700,color:"#495057",fontFamily:"monospace"},children:[f," ",(0,N.jsxs)("span",{style:{background:"#198754",color:"#fff",borderRadius:8,padding:"0 5px",fontSize:10,fontWeight:800},children:["\xd7",p]})]})]}),(0,N.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:3,alignItems:"flex-end",flexShrink:0,alignSelf:"center"},children:[Xe&&sn(e),a&&(0,N.jsx)("span",{style:{fontSize:11,background:"#f0f4ff",color:"#3b5bdb",border:"1px solid #c5d0fa",borderRadius:4,padding:"1px 6px",fontWeight:600,whiteSpace:"nowrap"},children:a}),(0,N.jsxs)("div",{style:{fontSize:11,color:"#868e96",whiteSpace:"nowrap"},children:[e.start_fulfill?te(e.start_fulfill):"",e.finish_fulfill?" \u2192 ".concat(te(e.finish_fulfill)):""]}),(0,N.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4},children:[(0,N.jsx)("img",{src:o.image,alt:o.label,title:o.label,style:{width:14,height:14,objectFit:"contain"}}),(0,N.jsx)("span",{style:{fontSize:11,color:d,fontWeight:700,whiteSpace:"nowrap"},children:o.label}),e.shipping_center_date&&(0,N.jsxs)("span",{style:{fontSize:11,color:"#0d6efd",whiteSpace:"nowrap"},children:["\ud83d\ude9a ",te(e.shipping_center_date)]}),(0,N.jsx)("button",{onClick:function(t){t.stopPropagation(),He(e),tt(e.status||""),ot(e.custom_filter_1||"")},style:{background:"none",border:"none",cursor:"pointer",color:"#adb5bd",padding:"0 2px",lineHeight:1,display:"flex",alignItems:"center"},title:"Ch\u1ec9nh s\u1eeda",children:(0,N.jsx)(b.fmQ,{size:12})}),(0,N.jsx)("button",{onClick:function(t){return nn(e,t)},style:{background:"none",border:"none",cursor:"pointer",color:"#adb5bd",padding:"0 2px",lineHeight:1,display:"flex",alignItems:"center"},title:"L\u1ecbch s\u1eed",children:(0,N.jsx)(b.ceS,{size:12})})]})]})]},e._id)}(e,!(!Gt.from||!t)&&(t>=Gt.from&&t<=Gt.to))}))})]},n||"__unassigned__"):(0,N.jsxs)("div",{style:{background:"#fff",borderRadius:12,boxShadow:"0 1px 6px rgba(0,0,0,0.09)",display:"flex",overflow:"hidden"},children:[(0,N.jsxs)("div",{style:{flexShrink:0,width:Bt?80:120,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"12px 8px",background:o.bg,borderRight:"1px solid ".concat(o.border)},children:[(0,N.jsx)(cn,{displayName:a,pc:o,size:56}),(0,N.jsx)("span",{style:{fontSize:12,fontWeight:700,color:o.text,marginTop:6,textAlign:"center",wordBreak:"break-word",maxWidth:100},children:a}),(0,N.jsx)(ln,{hopDong:d}),(0,N.jsxs)("span",{style:{fontSize:11,color:"#adb5bd",marginTop:2},children:[r.length," \u0111\u01a1n"]})]}),(0,N.jsx)("div",{style:{flex:1,minWidth:0,padding:0===r.length?0:"4px 6px"},children:0===r.length?(0,N.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"14px 16px",fontSize:13,color:"#adb5bd",height:"100%"},children:[(0,N.jsx)("img",{src:I,alt:"",style:{width:18,height:18}})," Kh\xf4ng c\xf3 \u0111\u01a1n"]}):(0,N.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:3,padding:"4px 0"},children:r.map((function(e){var t=e.start_fulfill?g()(e.start_fulfill).format("YYYY-MM-DD"):null;return function(e,t){var n,r,i=B(e),o=P(i),l=q(e),a=V(null===e||void 0===e?void 0:e.custom_filter_1,en),d="painting"===i?"#fd7e14":"done"===i||"done2"===i?"#198754":"shipped"===i?"#0d6efd":"#adb5bd",s=$t(e.order_id),c=null===e||void 0===e||null===(n=e.listings)||void 0===n?void 0:n[0],u=c?(c.product_code||c.sku||"").replace(/^\d{6}_/,""):"",f=null!==(r=null===c||void 0===c?void 0:c.quantity)&&void 0!==r?r:1;return(0,N.jsxs)("div",{onClick:function(){return qe(e)},style:{display:"grid",gridTemplateColumns:"auto 1fr auto",gap:8,padding:"7px 8px",borderRadius:6,background:t?"#f0fdf4":"#fff",border:t?"1px solid #bbf7d0":"1px solid #e9ecef",cursor:"pointer",alignItems:"center"},children:[(0,N.jsx)("img",{src:o.image,alt:o.label,title:o.label,style:{width:18,height:18,objectFit:"contain"}}),(0,N.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:2,minWidth:0},children:[(0,N.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5,minWidth:0},children:[(0,N.jsx)("span",{style:{fontSize:10,background:"#e9ecef",color:"#495057",borderRadius:4,padding:"1px 5px",fontWeight:700,whiteSpace:"nowrap",flexShrink:0},children:s}),(0,N.jsx)("span",{style:{fontSize:13,fontWeight:700,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#212529"},children:l})]}),Xe?dn(e):u&&(0,N.jsxs)("div",{style:{fontSize:11,fontWeight:700,color:"#495057",fontFamily:"monospace"},children:[u," ",(0,N.jsxs)("span",{style:{background:"#198754",color:"#fff",borderRadius:8,padding:"0 5px",fontSize:10,fontWeight:800},children:["\xd7",f]})]})]}),(0,N.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:2,alignItems:"flex-end",flexShrink:0},children:[a&&(0,N.jsx)("span",{style:{fontSize:10,background:"#f0f4ff",color:"#3b5bdb",border:"1px solid #c5d0fa",borderRadius:4,padding:"1px 5px",fontWeight:600,whiteSpace:"nowrap"},children:a}),(0,N.jsxs)("div",{style:{fontSize:11,color:"#868e96",whiteSpace:"nowrap"},children:[e.start_fulfill?te(e.start_fulfill):"",e.finish_fulfill?" \u2192 ".concat(te(e.finish_fulfill)):""]}),(0,N.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4},children:[(0,N.jsx)("span",{style:{fontSize:11,color:d,fontWeight:700,whiteSpace:"nowrap"},children:o.label}),e.shipping_center_date&&(0,N.jsxs)("span",{style:{fontSize:11,color:"#0d6efd",whiteSpace:"nowrap"},children:["\ud83d\ude9a ",te(e.shipping_center_date)]}),(0,N.jsx)("button",{onClick:function(t){t.stopPropagation(),He(e),tt(e.status||""),ot(e.custom_filter_1||"")},style:{background:"none",border:"none",cursor:"pointer",color:"#adb5bd",padding:"0 2px",lineHeight:1,display:"flex",alignItems:"center"},title:"Ch\u1ec9nh s\u1eeda",children:(0,N.jsx)(b.fmQ,{size:12})}),(0,N.jsx)("button",{onClick:function(t){return nn(e,t)},style:{background:"none",border:"none",cursor:"pointer",color:"#adb5bd",padding:"0 2px",lineHeight:1,display:"flex",alignItems:"center"},title:"L\u1ecbch s\u1eed",children:(0,N.jsx)(b.ceS,{size:12})})]})]})]},e._id)}(e,!(!Gt.from||!t)&&(t>=Gt.from&&t<=Gt.to))}))})})]},n||"__unassigned__")}))},t)}))})}(),Be&&(0,N.jsx)(z.Z,{show:!!Be,onHide:function(){return qe(null)},url:"".concat(window.location.origin,"/admin/orders/order-detail/").concat(Be.order_id,"?show_sidebar=false"),title:"Chi ti\u1ebft \u2014 ".concat($t(Be.order_id))}),ce&&Array.isArray(ce.images)&&ce.images.length>0&&c.createPortal((0,N.jsx)("div",{onClick:function(){return ue(null)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.8)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e5},children:(0,N.jsxs)("div",{onClick:function(e){return e.stopPropagation()},style:{position:"relative",display:"flex",alignItems:"center",gap:12},children:[ce.images.length>1&&(0,N.jsx)("button",{onClick:function(){return ue((function(e){return(0,l.Z)((0,l.Z)({},e),{},{index:(e.index-1+e.images.length)%e.images.length})}
1))},style:{background:"rgba(255,255,255,0.9)",border:"none",borderRadius:"50%",width:44,height:44,fontSize:22,cursor:"pointer",flexShrink:0},children:"\u2039"}),(0,N.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[(0,N.jsx)("img",{src:ce.images[ce.index],alt:"",style:{maxWidth:"80vw",maxHeight:"80vh",objectFit:"contain",borderRadius:8,background:"#fff"}}),(0,N.jsxs)("div",{style:{color:"#fff",fontSize:13},children:[ce.index+1," / ",ce.images.length]})]}),ce.images.length>1&&(0,N.jsx)("button",{onClick:function(){return ue((function(e){return(0,l.Z)((0,l.Z)({},e),{},{index:(e.index+1)%e.images.length})}))},style:{background:"rgba(255,255,255,0.9)",border:"none",borderRadius:"50%",width:44,height:44,fontSize:22,cursor:"pointer",flexShrink:0},children:"\u203a"}),(0,N.jsx)("button",{onClick:function(){return ue(null)},style:{position:"absolute",top:-40,right:0,background:"rgba(255,255,255,0.9)",border:"none",borderRadius:8,padding:"4px 12px",cursor:"pointer",fontWeight:700},children:"\u2715 \u0110\xf3ng"})]})}),document.body),he&&function(){var e=G(he,Jt);if(!e)return null;var t=e.adjust_ratio||1,n=t>1?Math.round(100*(t-1)):0,o=function(e){return"".concat(Q(e).toLocaleString("vi-VN")," \ud83e\udeb7")},l="#7c3aed",a=Array.isArray(he.listings)?he.listings:[],d=[["Lotus / Linh Th\xfa",o(e.base_price_vnd)],["S\u1ed1 Linh Th\xfa",e.number_of_set],["Qu\xe0 H\u1ed3i Sinh",o(e.cost)]].concat((0,r.Z)(n>0?[["\u0110i\u1ec3m th\xe2n thi\u1ebft","\xd7".concat(Math.round(100*t)/100," (+").concat(n,"%)")]]:[]),[["T\u1ed5ng lotus",o(e.final_cost)]]);return c.createPortal((0,N.jsx)("div",{onClick:function(){return ge(null)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.45)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e5},children:(0,N.jsxs)("div",{onClick:function(e){return e.stopPropagation()},style:{background:"#fff",borderRadius:12,padding:22,minWidth:300,maxWidth:400,maxHeight:"85vh",overflowY:"auto",boxShadow:"0 8px 32px rgba(0,0,0,0.2)"},children:[(0,N.jsx)("div",{style:{fontWeight:800,fontSize:16,color:"#dc2626",marginBottom:2},children:"\ud83e\udeb7 Chi ti\u1ebft qu\xe0 H\u1ed3i Sinh"}),(0,N.jsxs)("div",{style:{fontSize:12,color:"#64748b",marginBottom:12},children:["Nhi\u1ec7m v\u1ee5: ",(0,N.jsx)("strong",{children:$t(he.order_id)})]}),(0,N.jsx)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:(0,N.jsx)("tbody",{children:d.map((function(e,t,n){var r=(0,i.Z)(e,2),o=r[0],a=r[1];return(0,N.jsxs)("tr",{style:{borderBottom:t<n.length-1?"1px solid #f1f5f9":"none"},children:[(0,N.jsx)("td",{style:{padding:"8px 0",color:"\u0110i\u1ec3m th\xe2n thi\u1ebft"===o?l:"#64748b",fontWeight:"\u0110i\u1ec3m th\xe2n thi\u1ebft"===o?700:400},children:o}),(0,N.jsx)("td",{style:{padding:"8px 0",textAlign:"right",fontWeight:t===n.length-1?800:600,color:t===n.length-1?"#dc2626":"\u0110i\u1ec3m th\xe2n thi\u1ebft"===o?l:"#1e293b"},children:a})]},o)}))})}),a.length>0&&(0,N.jsxs)("div",{style:{marginTop:14,borderTop:"1px solid #f1f5f9",paddingTop:12},children:[(0,N.jsxs)("div",{style:{fontSize:11,fontWeight:700,color:"#94a3b8",textTransform:"uppercase",letterSpacing:.5,marginBottom:8},children:["\ud83d\udc3e Linh Th\xfa c\u1ea7n H\u1ed3i Sinh (",a.length,")"]}),(0,N.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:a.map((function(e,t){var n;return(0,N.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.img_url?(0,N.jsx)("img",{src:e.img_url,alt:"",style:{width:40,height:40,objectFit:"cover",borderRadius:6,border:"1px solid #e2e8f0",flexShrink:0}}):(0,N.jsx)("div",{style:{width:40,height:40,background:"#f1f5f9",borderRadius:6,flexShrink:0}}),(0,N.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,N.jsx)("div",{style:{fontSize:13,fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title||"\u2014"}),(0,N.jsxs)("div",{style:{fontSize:11,color:"#64748b"},children:["Size: ",e.size||"\u2014"," \xb7 SL: ",(0,N.jsx)("strong",{children:null!==(n=e.quantity)&&void 0!==n?n:1})]})]})]},t)}))})]}),(0,N.jsx)("div",{style:{textAlign:"right",marginTop:16},children:(0,N.jsx)("button",{onClick:function(){return ge(null)},style:{background:"#f1f5f9",border:"none",borderRadius:8,padding:"6px 16px",cursor:"pointer",fontWeight:700},children:"\u0110\xf3ng"})})]})}),document.body)}(),Te&&c.createPortal((0,N.jsx)("div",{onClick:function(){return He(null)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.45)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:99999},children:(0,N.jsxs)("div",{onClick:function(e){return e.stopPropagation()},style:{background:"#fff",borderRadius:14,padding:24,width:340,maxWidth:"92vw",boxShadow:"0 8px 32px rgba(0,0,0,0.18)"},children:[(0,N.jsxs)("div",{style:{fontWeight:700,fontSize:16,marginBottom:20,color:"#1e293b",display:"flex",alignItems:"center",gap:8},children:[(0,N.jsx)(b.fmQ,{}),"Ch\u1ec9nh s\u1eeda",(0,N.jsx)("code",{style:{fontSize:13,color:"#6c757d",fontWeight:400},children:$t(Te.order_id)})]}),(0,N.jsxs)("div",{style:{marginBottom:16},children:[(0,N.jsx)("label",{style:{fontSize:12,fontWeight:600,color:"#6c757d",textTransform:"uppercase",letterSpacing:.5,display:"block",marginBottom:6},children:"Tr\u1ea1ng th\xe1i"}),(0,N.jsx)("select",{value:et,onChange:function(e){return tt(e.target.value)},style:{width:"100%",padding:"9px 12px",borderRadius:8,border:"1px solid #dee2e6",fontSize:14,outline:"none"},children:Object.values(u.dO).filter((function(e){return e.code>=10&&e.code<=15}
1)).sort((function(e,t){return e.code-t.code})).map((function(e){var n,r,i=(0,C.W$)(e.enum,(0,C.iH)(e.enum),null===t||void 0===t||null===(n=t.metadata)||void 0===n||null===(r=n.configs)||void 0===r?void 0:r.orderStatus);return(0,N.jsxs)("option",{value:e.enum,children:["[",e.code,"] ",i]},e.enum)}))})]}),(0,N.jsxs)("div",{style:{marginBottom:20},children:[(0,N.jsx)("label",{style:{fontSize:12,fontWeight:600,color:"#6c757d",textTransform:"uppercase",letterSpacing:.5,display:"block",marginBottom:6},children:"C\xf4ng \u0111o\u1ea1n"}),(0,N.jsxs)("select",{value:it,onChange:function(e){return ot(e.target.value)},style:{width:"100%",padding:"9px 12px",borderRadius:8,border:"1px solid #dee2e6",fontSize:14,outline:"none"},children:[(0,N.jsx)("option",{value:"",children:"\u2014 Kh\xf4ng ch\u1ecdn \u2014"}),X(en).map((function(e){return(0,N.jsx)("option",{value:e.value,children:e.label},e.value)}))]})]}),(0,N.jsxs)("div",{style:{display:"flex",gap:10,justifyContent:"flex-end"},children:[(0,N.jsx)("button",{onClick:function(){return He(null)},style:{padding:"9px 20px",borderRadius:8,border:"1px solid #dee2e6",background:"#fff",color:"#6c757d",fontWeight:600,fontSize:14,cursor:"pointer"},children:"Hu\u1ef7"}),(0,N.jsx)("button",{onClick:Et,disabled:dt,style:{padding:"9px 24px",borderRadius:8,border:"none",background:"#4f46e5",color:"#fff",fontWeight:600,fontSize:14,cursor:dt?"not-allowed":"pointer",opacity:dt?.7:1},children:dt?"\u0110ang l\u01b0u...":"L\u01b0u"})]})]})}),document.body),xt&&c.createPortal((0,N.jsx)("div",{onClick:function(){return vt(null)},style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:99999},children:(0,N.jsxs)("div",{onClick:function(e){return e.stopPropagation()},style:{background:"#fff",borderRadius:12,width:"90vw",maxWidth:900,maxHeight:"85vh",display:"flex",flexDirection:"column",boxShadow:"0 8px 40px rgba(0,0,0,0.22)"},children:[(0,N.jsxs)("div",{style:{padding:"14px 20px",borderBottom:"1px solid #dee2e6",display:"flex",alignItems:"center",gap:12,flexShrink:0},children:[(0,N.jsx)(b.ceS,{style:{color:"#6c757d"}}),(0,N.jsxs)("span",{style:{fontWeight:700,fontSize:15},children:["L\u1ecbch s\u1eed \u2014 ",$t(xt.order_id)]}),(0,N.jsxs)("span",{style:{fontSize:12,color:"#6c757d"},children:["(",At," logs)"]}),(0,N.jsxs)("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:8}
1,children:[(0,N.jsxs)("select",{value:Pt,onChange:function(e){return Ot(e.target.value)},style:{padding:"4px 8px",borderRadius:6,border:"1px solid #dee2e6",fontSize:12},children:[(0,N.jsx)("option",{value:"ALL",children:"T\u1ea5t c\u1ea3 level"}),(0,N.jsx)("option",{value:"1",children:"Level 1"}),(0,N.jsx)("option",{value:"2",children:"Level 2"}),(0,N.jsx)("option",{value:"3",children:"Level 3"}),(0,N.jsx)("option",{value:"4",children:"Level 4"})]}),(0,N.jsx)("button",{onClick:function(){return tn(xt.order_id,Wt)},style:{padding:"4px 12px",borderRadius:6,border:"1px solid #dee2e6",background:"#fff",fontSize:12,cursor:"pointer"},children:"Reload"}),(0,N.jsx)("button",{onClick:function(){return vt(null)},style:{background:"none",border:"none",fontSize:20,cursor:"pointer",color:"#6c757d",lineHeight:1},children:"\xd7"})]})]}),(0,N.jsx)("div",{style:{flex:1,overflowY:"auto"},children:kt?(0,N.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:40,gap:10,color:"#6c757d"},children:[(0,N.jsx)(m.Z,{color:"primary",size:"sm"})," Loading logs..."]}):0===yt.length?(0,N.jsx)("div",{style:{textAlign:"center",padding:40,color:"#adb5bd"},children:"Kh\xf4ng c\xf3 log n\xe0o"}):(0,N.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[(0,N.jsx)("thead",{children:(0,N.jsx)("tr",{style:{background:"#f8f9fa",position:"sticky",top:0},children:["Time","Team","User","Status","Message"].map((function(e){return(0,N.jsx)("th",{style:{padding:"8px 12px",textAlign:"left",borderBottom:"2px solid #dee2e6",fontWeight:600,whiteSpace:"nowrap"},children:e},e)}))})}),(0,N.jsx)("tbody",{children:yt.filter((function(e){return"ALL"===Pt||String(e.level)===Pt})).sort((function(e,t){return new Date(t.time)-new Date(e.time)})).map((function(e,t){var n=1===e.level?"#ffe5e5":2===e.level?"#fff5e5":3===e.level?"#e5f0ff":4===e.level?"#f2f2f2":"#fff",r=1===e.level?"#b30000":2===e.level?"#b36b00":3===e.level?"#005cb3":4===e.level?"#666":"#212529";return(0,N.jsxs)("tr",{style:{background:n,color:r},children:[(0,N.jsx)("td",{style:{padding:"6px 12px",whiteSpace:"nowrap",borderBottom:"1px solid #f0f0f0"},children:g()(e.time).format("DD/MM HH:mm:ss")}),(0,N.jsx)("td",{style:{padding:"6px 12px",whiteSpace:"nowrap",borderBottom:"1px solid #f0f0f0"},children:e.perform_by_team||"\u2014"}),(0,N.jsx)("td",{style:{padding:"6px 12px",whiteSpace:"nowrap",borderBottom:"1px solid #f0f0f0"},children:e.perform_by_user||"\u2014"}),(0,N.jsx)("td",{style:{padding:"6px 12px",whiteSpace:"nowrap",borderBottom:"1px solid #f0f0f0"},children:void 0!==e.status?"[".concat(e.status,"]"):"\u2014"}),(0,N.jsx)("td",{style:{padding:"6px 12px",borderBottom:"1px solid #f0f0f0"},children:e.message})]},e._id||t)}))})]})}),Dt>1&&(0,N.jsxs)("div",{style:{padding:"10px 20px",borderTop:"1px solid #dee2e6",display:"flex",alignItems:"center",justifyContent:"center",gap:10,flexShrink:0},children:[(0,N.jsx)("button",{disabled:Wt<=1,onClick:function(){return tn(xt.order_id,Wt-1)},style:{padding:"4px 12px",borderRadius:6,border:"1px solid #dee2e6",background:Wt<=1?"#f8f9fa":"#fff",cursor:Wt<=1?"not-allowed":"pointer",fontSize:13},children:"\u2039 Tr\u01b0\u1edbc"}),(0,N.jsxs)("span",{style:{fontSize:13,color:"#6c757d"},children:["Trang ",Wt," / ",Dt]}),(0,N.jsx)("button",{disabled:Wt>=Dt,onClick:function(){return tn(xt.order_id,Wt+1)},style:{padding:"4px 12px",borderRadius:6,border:"1px solid #dee2e6",background:Wt>=Dt?"#f8f9fa":"#fff",cursor:Wt>=Dt?"not-allowed":"pointer",fontSize:13},children:"Sau \u203a"})]})]})}),document.body)]})}))},68456:function(e,t,n){e.exports=n.p+"static/media/warning.3ad85d2e3636ae046bf6.png"}}]);
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.