1import{a as ye}from"./chunk-6LGDVQVT.js";import{a as be}from"./chunk-T3PZLYMY.js";import{a as Oe}from"./chunk-GIIMJHN6.js";import{a as Ee}from"./chunk-VYULK3Y3.js";import{a as xe}from"./chunk-I2BF4VFZ.js";import{a as pe,b as _e,c as me,d as ue,e as ge,f as fe}from"./chunk-B3QJM2RM.js";import"./chunk-M6OZBIKI.js";import"./chunk-XQLXGKEK.js";import"./chunk-IXD6ECVB.js";import"./chunk-RRCBQ55K.js";import"./chunk-DQRROS2B.js";import"./chunk-EONF3GVN.js";import"./chunk-5LMG4TVJ.js";import"./chunk-Z2TVBXTG.js";import"./chunk-ZV7NG4F4.js";import"./chunk-DJ5AJG3T.js";import"./chunk-6EF6RNOO.js";import"./chunk-T3DWPM4S.js";import"./chunk-K6QYQNRN.js";import{a as ve}from"./chunk-QIOURN4K.js";import"./chunk-KYVCMV2E.js";import"./chunk-HWZZ5RQT.js";import"./chunk-ZNR7QNVV.js";import"./chunk-WGAXTYG2.js";import"./chunk-U3Z5BGA7.js";import"./chunk-WF4KZOYP.js";import{a as he,b as Ce}from"./chunk-M6YDMVQ7.js";import{a as Se}from"./chunk-OTMVSU27.js";import{a as X}from"./chunk-EB6TJ75L.js";import"./chunk-QI7CEGT6.js";import{a as de,b as ce}from"./chunk-6ND7557V.js";import{D as ie,c as Z,g as ee,l as te}from"./chunk-FOJCKIWO.js";import{a as oe}from"./chunk-NBMUSEX4.js";import{a as ne,b as re}from"./chunk-3AIY57KH.js";import"./chunk-AB6CKZTE.js";import"./chunk-K5O3OQFW.js";import"./chunk-2DRXLVRR.js";import{c as ae,d as le,e as se}from"./chunk-RQJZECR4.js";import"./chunk-G3G5OK6Q.js";import"./chunk-AERMLNF3.js";import"./chunk-QHMYZ6SM.js";import"./chunk-PJPLTBJX.js";import"./chunk-DLIVM562.js";import"./chunk-CV2ZWZQE.js";import"./chunk-H4HD3LNW.js";import"./chunk-AQEWHUN5.js";import{c as q,d as J,e as Q}from"./chunk-YQZAETCE.js";import{o as j,r as K,x as Y}from"./chunk-EO42E46J.js";import"./chunk-3QVSKJ3X.js";import{C as U,D as z,H as $,I as W}from"./chunk-ERUCNOOT.js";import{$b as b,Cc as B,Dc as H,Ec as G,H as k,Jb as x,L as I,Lb as O,Nb as D,Qb as h,Qc as c,Rc as p,Sc as T,Tc as F,Uc as A,V as R,Vb as r,Wb as o,Xb as m,_a as N,da as E,db as t,f as M,fc as f,gc as s,la as u,ma as g,sa as V,sb as L,tc as d,uc as v,vc as _,wc as P,yb as C}from"./chunk-DBE7WQEG.js";import{g as y}from"./chunk-W7GRJBO5.js";function Re(n,i){n&1&&m(0,"app-widget-loading")}function Pe(n,i){if(n&1){let e=b();r(0,"app-widget-api-error",3),f("retry",function(){u(e);let l=s();return g(l.loadOrders())}),o()}}function Te(n,i){if(n&1&&(r(0,"span",7),d(1),o()),n&2){let e=s(2);t(),v(e.counts.open_cart)}}function Ae(n,i){if(n&1&&(r(0,"span",8),d(1),o()),n&2){let e=s(2);t(),v(e.counts.paid)}}function ke(n,i){if(n&1&&(r(0,"span",8),d(1),o()),n&2){let e=s(2);t(),v(e.counts.processing)}}function Ie(n,i){if(n&1&&(r(0,"span",8),d(1),o()),n&2){let e=s(2);t(),v(e.counts.shipped)}}function Ve(n,i){if(n&1&&(r(0,"span",8),d(1),o()),n&2){let e=s(2);t(),v(e.counts.return_in_transit)}}function Ne(n,i){if(n&1&&(r(0,"span",8),d(1),o()),n&2){let e=s(2);t(),v(e.counts.returned)}}function Le(n,i){if(n&1&&(r(0,"span",10),d(1),o()),n&2){let e=s(2);t(),v(e.counts.abandoned)}}function De(n,i){if(n&1){let e=b();r(0,"button",5),f("click",function(){u(e);let l=s(2);return g(l.onResetFilters())}),m(1,"i",17),d(2),c(3,"translate"),o()}n&2&&(t(2),_(" ",p(3,1,"COMMON.RESET_FILTERS")," "))}function Be(n,i){if(n&1){let e=b();r(0,"div",2)(1,"div",4)(2,"button",5),f("click",function(){u(e);let l=s();return g(l.filterByStatus(""))}),d(3),c(4,"translate"),o(),r(5,"button",5),f("click",function(){u(e);let l=s();return g(l.filterByStatus("open_cart"))}),m(6,"i",6),d(7),c(8,"translate"),C(9,Te,2,1,"span",7),o(),r(10,"button",5),f("click",function(){u(e);let l=s();return g(l.filterByStatus("paid"))}),d(11),c(12,"translate"),C(13,Ae,2,1,"span",8),o(),r(14,"button",5),f("click",function(){u(e);let l=s();return g(l.filterByStatus("processing"))}),d(15),c(16,"translate"),C(17,ke,2,1,"span",8),o(),r(18,"button",5),f("click",function(){u(e);let l=s();return g(l.filterByStatus("shipped"))}),d(19),c(20,"translate"),C(21,Ie,2,1,"span",8),o(),r(22,"button",5),f("click",function(){u(e);let l=s();return g(l.filterByStatus("delivered"))}),d(23),c(24,"translate"),o(),r(25,"button",5),f("click",function(){u(e);let l=s();return g(l.filterByStatus("return_in_transit"))}),d(26),c(27,"translate"),C(28,Ve,2,1,"span",8),o(),r(29,"button",5),f("click",function(){u(e);let l=s();return g(l.filterByStatus("returned"))}),d(30),c(31,"translate"),C(32,Ne,2,1,"span",8),o(),r(33,"button",5),f("click",function(){u(e);let l=s();return g(l.filterByStatus("refunded"))}),d(34),c(35,"translate"),o(),m(36,"span",9),r(37,"button",5),f("click",function(){u(e);let l=s();return g(l.filterByStatus("abandoned"))}),m(38,"i",6),d(39),c(40,"translate"),C(41,Le,2,1,"span",10),o(),C(42,De,4,3,"button",11),o(),r(43,"div",12)(44,"span",13),m(45,"i",14),r(46,"input",15),c(47,"translate"),f("ngModelChange",function(l){u(e);let S=s();return g(S.onSearchChange(l))}),o()(),r(48,"button",16),c(49,"translate"),f("click",function(){u(e);let l=s();return g(l.refresh())}),o()()()}if(n&2){let e=s();t(2),O("active",e.activeFilter===""),t(),_(" ",p(4,44,"MANAGER.SHOP.ORDERS_ALL")," "),t(2),O("active",e.activeFilter==="open_cart"),t(2),_(" ",p(8,46,"MANAGER.SHOP.ORDER_STATUS_OPEN_CART")," "),t(2),h(e.counts.open_cart?9:-1),t(),O("active",e.activeFilter==="paid"),t(),_(" ",p(12,48,"MANAGER.SHOP.ORDER_STATUS_PAID")," "),t(2),h(e.counts.paid?13:-1),t(),O("active",e.activeFilter==="processing"),t(),_(" ",p(16,50,"MANAGER.SHOP.ORDER_FILTER_TO_SHIP")," "),t(2),h(e.counts.processing?17:-1),t(),O("active",e.activeFilter==="shipped"),t(),_(" ",p(20,52,"MANAGER.SHOP.ORDER_STATUS_SHIPPED")," "),t(2),h(e.counts.shipped?21:-1),t(),O("active",e.activeFilter==="delivered"),t(),_(" ",p(24,54,"MANAGER.SHOP.ORDER_STATUS_DELIVERED")," "),t(2),O("active",e.activeFilter==="return_in_transit"),t(),_(" ",p(27,56,"MANAGER.SHOP.ORDER_STATUS_RETURN_IN_TRANSIT")," "),t(2),h(e.counts.return_in_transit?28:-1),t(),O("active",e.activeFilter==="returned"),t(),_(" ",p(31,58,"MANAGER.SHOP.ORDER_STATUS_RETURNED")," "),t(2),h(e.counts.returned?32:-1),t(),O("active",e.activeFilter==="refunded"),t(),_(" ",p(35,60,"MANAGER.SHOP.ORDER_STATUS_REFUNDED")," "),t(3),O("active",e.activeFilter==="abandoned"),t(2),_(" ",p(40,62,"MANAGER.SHOP.ORDER_STATUS_ABANDONED")," "),t(2),h(e.counts.abandoned?41:-1),t(),h(e.filters&&e.filters.activeCount()>0?42:-1),t(4),x("ngModel",e.searchTerm)("placeholder",p(47,64,"MANAGER.SHOP.ORDERS_SEARCH_PLACEHOLDER")),t(2),x("text",!0)("rounded",!0)("loading",e.refreshing)("pTooltip",p(49,66,"MANAGER.SHOP.ORDERS_REFRESH"))}}function He(n,i){n&1&&(r(0,"div",23)(1,"div",24)(2,"div",25)(3,"div",26)(4,"div",27),m(5,"i",6),o(),r(6,"div",28),d(7),c(8,"translate"),o(),r(9,"div",29),d(10),c(11,"translate"),o()()(),r(12,"div",25)(13,"div",26)(14,"div",30),m(15,"i",31),o(),r(16,"div",28),d(17),c(18,"translate"),o(),r(19,"div",29),d(20),c(21,"translate"),o()()(),r(22,"div",25)(23,"div",26)(24,"div",32),m(25,"i",33),o(),r(26,"div",28),d(27),c(28,"translate"),o(),r(29,"div",29),d(30),c(31,"translate"),o()()(),r(32,"div",25)(33,"div",26)(34,"div",34),m(35,"i",35),o(),r(36,"div",28),d(37),c(38,"translate"),o(),r(39,"div",29),d(40),c(41,"translate"),o()()()()()),n&2&&(t(7),_(" ",p(8,8,"MANAGER.SHOP.ORDER_STEP_PLACED_TITLE")," "),t(3),_(" ",p(11,10,"MANAGER.SHOP.ORDER_STEP_PLACED_DESC")," "),t(7),_(" ",p(18,12,"MANAGER.SHOP.ORDER_STEP_SHIPPED_TITLE")," "),t(3),_(" ",p(21,14,"MANAGER.SHOP.ORDER_STEP_SHIPPED_DESC")," "),t(7),_(" ",p(28,16,"MANAGER.SHOP.ORDER_STEP_DELIVERED_TITLE")," "),t(3),_(" ",p(31,18,"MANAGER.SHOP.ORDER_STEP_DELIVERED_DESC")," "),t(7),_(" ",p(38,20,"MANAGER.SHOP.ORDER_STEP_REFUND_TITLE")," "),t(3),_(" ",p(41,22,"MANAGER.SHOP.ORDER_STEP_REFUND_DESC")," "))}function Ge(n,i){if(n&1){let e=b();m(0,"app-widget-manager-empty-state",18),r(1,"div",19)(2,"button",20),f("
1click",function(){u(e);let l=s();return g(l.showLifecycleInfo=!l.showLifecycleInfo)}),m(3,"i",21),r(4,"span"),d(5),c(6,"translate"),o(),m(7,"i",22),o(),C(8,He,42,24,"div",23),o()}if(n&2){let e=s();t(5),v(p(6,6,"MANAGER.SHOP.ORDER_LIFECYCLE_TITLE")),t(2),O("pi-chevron-down",!e.showLifecycleInfo)("pi-chevron-up",e.showLifecycleInfo),t(),h(e.showLifecycleInfo?8:-1)}}function Fe(n,i){if(n&1){let e=b();r(0,"p-button",42),c(1,"translate"),f("onClick",function(){u(e);let l=s(3);return g(l.bulkGenerateLabels("a4"))}),o(),r(2,"p-button",43),c(3,"translate"),f("onClick",function(){u(e);let l=s(3);return g(l.bulkGenerateLabels("10x15"))}),o()}if(n&2){let e=s(3);x("label",p(1,4,"MANAGER.SHOP.BULK_GENERATE_LABELS_A4"))("loading",e.bulkGenerating),t(2),x("label",p(3,6,"MANAGER.SHOP.BULK_GENERATE_LABELS_10X15"))("loading",e.bulkGenerating)}}function Ue(n,i){if(n&1){let e=b();r(0,"p-button",44),c(1,"translate"),f("onClick",function(){u(e);let l=s(3);return g(l.bulkPrintLabels())}),o()}if(n&2){let e=s(3);x("label",p(1,2,"MANAGER.SHOP.BULK_PRINT_LABELS"))("loading",e.bulkPrinting)}}function ze(n,i){if(n&1){let e=b();r(0,"div",36)(1,"span",38),d(2),c(3,"translate"),o(),r(4,"div",39),C(5,Fe,4,8)(6,Ue,2,4,"p-button",40),r(7,"p-button",41),c(8,"translate"),f("onClick",function(){u(e);let l=s(2);return g(l.selectedOrders=[])}),o()()()}if(n&2){let e=s(2);t(2),P("",e.selectedOrders.length," ",p(3,6,"MANAGER.SHOP.ORDERS_SELECTED"),""),t(3),h(e.canBulkGenerateLabels?5:-1),t(),h(e.canBulkPrintLabels?6:-1),t(),x("text",!0)("pTooltip",p(8,8,"COMMON.CANCEL"))}}function $e(n,i){n&1&&(r(0,"tr")(1,"th",45),m(2,"p-tableHeaderCheckbox"),o(),r(3,"th",46),d(4),c(5,"translate"),m(6,"p-sortIcon",47),o(),r(7,"th",48),d(8),c(9,"translate"),m(10,"p-sortIcon",49),o(),r(11,"th",50),d(12),c(13,"translate"),m(14,"p-sortIcon",51),o(),r(15,"th",52),d(16),c(17,"translate"),m(18,"p-sortIcon",53),o(),r(19,"th"),d(20),c(21,"translate"),o(),r(22,"th"),d(23),c(24,"translate"),o(),r(25,"th",54),d(26),c(27,"translate"),m(28,"p-sortIcon",55),o(),m(29,"th",56),o()),n&2&&(t(4),_(" ",p(5,7,"MANAGER.SHOP.ORDER_COL_DATE")," "),t(4),_(" ",p(9,9,"MANAGER.SHOP.ORDER_COL_BUYER")," "),t(4),_(" ",p(13,11,"MANAGER.SHOP.ORDER_COL_ITEMS")," "),t(4),_(" ",p(17,13,"MANAGER.SHOP.ORDER_COL_TOTAL")," "),t(4),v(p(21,15,"MANAGER.SHOP.ORDER_COL_SHIPPING")),t(3),v(p(24,17,"MANAGER.SHOP.ORDER_COL_PAYMENT")),t(3),_(" ",p(27,19,"MANAGER.SHOP.ORDER_COL_STATUS")," "))}function We(n,i){if(n&1&&m(0,"img",60),n&2){let e=s().$implicit;x("src",e.buyerWorkspaceSnapshot==null?null:e.buyerWorkspaceSnapshot.avatarUrl,N)}}function je(n,i){if(n&1&&(r(0,"span",61),d(1),c(2,"slice"),c(3,"uppercase"),o()),n&2){let e=s().$implicit,a=s(2);t(),v(p(3,5,F(2,1,a.getBuyerName(e),0,1)))}}function Ke(n,i){if(n&1&&(r(0,"span",62),d(1),o()),n&2){let e=s().$implicit,a=s(2);t(),_("(",a.getBuyerWorkspaceName(e),")")}}function Ye(n,i){if(n&1&&(r(0,"div",62),m(1,"i",70),d(2),o()),n&2){let e=s().$implicit;t(2),_(" ",e.buyerSocialHandle," ")}}function qe(n,i){if(n&1&&(r(0,"span",63),m(1,"i",71),d(2),o()),n&2){let e=s().$implicit,a=s(2);t(),D(e.isLocalPickup?"pi pi-map-marker":"pi pi-truck"),t(),_(" ",a.getShippingLabel(e)," ")}}function Je(n,i){if(n&1&&(r(0,"div",66),m(1,"i",72),d(2),c(3,"translate"),c(4,"date"),o()),n&2){let e=s().$implicit;t(2),P(" ",p(3,2,"MANAGER.SHOP.OPEN_CART_UNTIL")," ",T(4,4,e.openUntil,"dd/MM HH:mm")," ")}}function Qe(n,i){if(n&1){let e=b();r(0,"tr")(1,"td"),m(2,"p-tableCheckbox",57),o(),r(3,"td",58),f("click",function(){let l=u(e).$implicit,S=s(2);return g(S.viewOrder(l))}),d(4),c(5,"date"),o(),r(6,"td",59),f("click",function(){let l=u(e).$implicit,S=s(2);return g(S.viewOrder(l))}),r(7,"div",12),C(8,We,1,1,"img",60)(9,je,4,7,"span",61),r(10,"div")(11,"div",38),d(12),C(13,Ke,2,1,"span",62),o(),r(14,"div",62),d(15),o(),C(16,Ye,3,1,"div",62),o()()(),r(17,"td"),d(18),o(),r(19,"td",38),d(20),o(),r(21,"td"),C(22,qe,3,3,"span",63),o(),r(23,"td"),m(24,"p-tag",64),o(),r(25,"td"),m(26,"p-tag",65),C(27,Je,5,7,"div",66),o(),r(28,"td")(29,"div",67)(30,"p-button",68),c(31,"translate"),f("onClick",function(){let l=u(e).$implicit,S=s(2);return g(S.viewOrder(l))}),o(),r(32,"p-button",69),c(33,"translate"),f("onClick",function(){let l=u(e).$implicit,S=s(2);return g(S.deleteOrder(l))}),o()()()()}if(n&2){let e=i.$implicit,a=s(2);t(2),x("value",e),t(2),_(" ",T(5,20,e.createdAt,"dd/MM/yyyy HH:mm")," "),t(4),h(e.buyerWorkspaceSnapshot!=null&&e.buyerWorkspaceSnapshot.avatarUrl?8:9),t(4),_(" ",a.getBuyerName(e)," "),t(),h(a.getBuyerWorkspaceName(e)?13:-1),t(2),_(" ",e.buyerEmail," "),t(),h(e.buyerSocialHandle?16:-1),t(2),v(e.itemsCount),t(2),_(" ",a.formatPrice(e.totalCents,e.currency)," "),t(2),h(a.getShippingLabel(e)?22:-1),t(2),x("roun
1ded",!0),t(2),x("severity",a.getStatusSeverity(e.status))("value",a.getStatusLabel(e.status)),t(),h(e.status==="open_cart"&&e.openUntil?27:-1),t(3),x("rounded",!0)("text",!0)("pTooltip",p(31,23,"MANAGER.SHOP.ORDER_BTN_DETAIL")),t(2),x("rounded",!0)("text",!0)("pTooltip",p(33,25,"COMMON.DELETE"))}}function Xe(n,i){if(n&1){let e=b();C(0,ze,9,10,"div",36),r(1,"p-table",37),f("onLazyLoad",function(l){u(e);let S=s();return g(S.onPageChange(l))}),G("selectionChange",function(l){u(e);let S=s();return H(S.selectedOrders,l)||(S.selectedOrders=l),g(l)}),C(2,$e,30,21,"ng-template",null,0,A)(4,Qe,34,27,"ng-template",null,1,A),o()}if(n&2){let e=s();h(e.selectedOrders.length>0?0:-1),t(),x("value",e.orders)("rows",e.limit)("totalRecords",e.totalOrders)("lazy",!0)("paginator",e.totalOrders>e.limit)("rowHover",!0),B("selection",e.selectedOrders)}}var we=class n{shopService=E(Oe);toastService=E(X);confirmService=E(ve);t=E(q);route=E(j);router=E(K);qf=E(xe);socketService=E(Ee);printService=E(ye);destroyRef=E(V);destroy$=new M;filters;loading=!0;refreshing=!1;error=null;orders=[];totalOrders=0;page=1;limit=20;activeFilter="";counts={};searchTerm="";activeSearch="";sortField=null;sortOrder=-1;searchInput$=new M;showLifecycleInfo=!1;selectedOrders=[];bulkGenerating=!1;ngOnInit(){this.filters=this.qf.init(this.route,[{key:"status",default:""},{key:"search",default:""},{key:"page",default:1,type:"number"},{key:"limit",default:20,type:"number"}],()=>this.onFiltersChanged(),this.destroyRef),this.syncFromFilters(),this.loadOrders(),this.loadCounts(),this.searchInput$.pipe(k(350),I(),R(this.destroy$)).subscribe(e=>{this.filters.set({search:e,page:1}),this.syncFromFilters(),this.loadOrders()}),this.shopService.refresh$.pipe(R(this.destroy$)).subscribe(()=>{this.loadOrders(),this.loadCounts()});let i=this.socketService.on("shop:order",e=>{if(this.loadOrders(),this.loadCounts(),e?.type==="new"){let a=e.totalCents?` \u2014 ${(e.totalCents/100).toFixed(2)} \u20AC`:"",l=e.buyerName?` (${e.buyerName})`:"";this.toastService.success(this.t.instant("MANAGER.SHOP.NEW_ORDER_REALTIME")+l+a)}});this.destroy$.subscribe(()=>i())}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}refresh(){return y(this,null,function*(){this.refreshing=!0,yield Promise.all([this.loadOrders(),this.loadCounts()]),this.refreshing=!1})}loadOrders(){return y(this,null,function*(){this.loading=!0,this.error=null;try{let i=yield this.shopService.listOrders({page:this.page,limit:this.limit,status:this.activeFilter||void 0,search:this.activeSearch||void 0,sort:this.sortField||void 0,order:this.sortField?this.sortOrder===1?"ASC":"DESC":void 0});this.orders=i.data,this.totalOrders=i.total}catch{this.error="load",this.toastService.error(this.t.instant("COMMON.ERROR"))}finally{this.loading=!1}})}loadCounts(){return y(this,null,function*(){try{this.counts=yield this.shopService.getOrderCounts()}catch{}})}filterByStatus(i){this.filters.set({status:i,page:1}),this.syncFromFilters(),this.loadOrders()}onPageChange(i){this.sortField=i.sortField||null,this.sortOrder=i.sortOrder||-1;let e=Math.floor(i.first/i.rows)+1;this.filters.set({page:e,limit:i.rows}),this.syncFromFilters(),this.loadOrders()}onSearchChange(i){this.searchInput$.next(i??"")}syncFromFilters(){let i=this.filters.values();this.activeFilter=i.status,this.activeSearch=i.search||"",this.searchTerm=this.activeSearch,this.page=i.page,this.limit=i.limit}onFiltersChanged(){this.syncFromFilters(),this.loadOrders()}onResetFilters(){this.filters.reset()}viewOrder(i){this.router.navigate(["/studio/shop/orders",i.id])}deleteOrder(i){return y(this,null,function*(){if(yield this.confirmService.confirm({message:this.t.instant("MANAGER.SHOP.ORDER_DELETE_CONFIRM"),header:this.t.instant("MANAGER.SHOP.ORDER_DELETE_TITLE"),severity:"danger",acceptLabel:this.t.instant("COMMON.DELETE"),rejectLabel:this.t.instant("COMMON.CANCEL")}))try{yield this.shopService.deleteOrder(i.id),this.toastService.success(this.t.instant("MANAGER.SHOP.ORDER_DELETED")),this.loadOrders(),this.loadCounts()}catch{this.toastService.error(this.t.instant("COMMON.ERROR"))}})}get canBulkGenerateLabels(){return this.selectedOrders.length>0&&this.selectedOrders.every(i=>["paid","processing"].includes(i.status)&&!i.labelUrl)}bulkGenerateLabels(i="a4"){return y(this,null,function*(){let e=this.selectedOrders.map(a=>a.id);if(e.length!==0){this.bulkGenerating=!0;try{let a=yield this.shopService.generateSendcloudLabel(e,i),l=a?.successCount||0,S=a?.errorCount||0;if(S===0?this.toastService.success(this.t.instant("MANAGER.SHOP.BULK_LABELS_SUCCESS",{count:l})):this.toastService.warn(this.t.instant("MANAGER.SHOP.BULK_LABELS_PARTIAL",{success:l,errors:S})),this.selectedOrders=[],this.loadOrders(),this.loadCounts(),a?.results?.length){let Me=a.results.filter(w=>w.success).map(w=>w.orderId);for(let w of Me)try{yield this.printService.triggerOrderPrintJobs(w,["shipping_label"])}catch{}}}catch{this.toastService.error(this.t.instant("COMMON.ERROR"))}finally{this.bulkGenerating=!1}}})}get canBulkPrintLabels(){return this.selectedOrders.length>0&&this.selectedOrders.every(i=>!!i.labelUrl)}bulkPrinting=!1;bulkPrintLabels(){return y(this,null,function*(){let i=this.selectedOrders.filter(e=>e.labelUrl).map(e=>e.id);if(i.length!==0){this.bulkPrinting=!0;try{let e=0;for(let a of i)try{yield this.printService.triggerOrderPrintJobs(a,["shipping_label"]),e++}catch{}this.toastService.success(this.t.instant("MANAGER.SHOP.BULK_PRINT_SENT",{count:e})),this.selectedOrders=[]}catch{this.toastService.error(this.t.instant("COMMON.ERROR"))}finally{this.bulkPrinting=!1}}})}formatPrice(i,e="EUR"){return(i/100).toFixed(2)+" "+e.toUpperCase()}getStatusSeverity(i){return{pending:"warn",open_cart:"warn",paid:"info",processing:"info",shipped:"warn",delivered:"success",cancelled:"danger",abandoned:"secondary",refunded:"secondary",partially_refunded:"warn",return_in_transit:"warn",returned:"warn"}[i]||"info"}getStatusLabel(i){let e=`MANAGER.SHOP.ORDER_STATUS_${i.toUpperCase()}`;return this.t.instant(e)}getBuyerName(i){return i.buyerName||i.buyerWorkspaceSnapshot?.displayName||"-"}getBuyerWorkspaceName(i){let e=i.buyerWorkspaceSnapshot?.displayName;return!e||e===i.buyerName?null:e}getShippingLabel(i){if(i.isLocalPickup)return this.t.instant("MANAGER.SHOP.ORDER_SHIPPING_PICKUP");let e=i.shippingMethodName||i.carrier;return e||((i.shippingCents??0)>0?"\u2014":"")}get totalCountForFilter(){return this.activeFilter?this.counts[this.activeFilter]||0:Object.values(this.counts).reduce((i,e)=>i+(e||0),0)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=L({type:n,selectors:[["app-view-manager-shop-orders"]
1],decls:5,vars:5,consts:[["header",""],["body",""],[1,"d-flex","align-items-center","justify-content-between","mb-3"],[3,"retry"],[1,"status-filters"],[1,"status-filter",3,"click"],[1,"pi","pi-shopping-cart"],[1,"badge-count","badge-count--warn"],[1,"badge-count"],[1,"status-filters__separator"],[1,"badge-count","badge-count--secondary"],[1,"status-filter"],[1,"d-flex","align-items-center","gap-2"],[2,"position","relative","display","inline-flex","align-items","center"],[1,"pi","pi-search",2,"position","absolute","left","0.6rem","opacity","0.55","font-size","0.85rem"],["pInputText","","type","text",2,"padding-left","2rem","min-width","220px",3,"ngModelChange","ngModel","placeholder"],["pButton","","severity","secondary","icon","pi pi-refresh","tooltipPosition","left",3,"click","text","rounded","loading","pTooltip"],[1,"pi","pi-filter-slash"],["icon","pi pi-shopping-cart","titleKey","MANAGER.SHOP.ORDERS_EMPTY_TITLE","descriptionKey","MANAGER.SHOP.ORDERS_EMPTY_DESC"],[1,"dash-info-section","mt-3"],["type","button",1,"dash-info-toggle",3,"click"],[1,"pi","pi-info-circle"],[1,"pi","ms-auto"],[1,"dash-info-grid"],[1,"row","g-3"],[1,"col-12","col-md-6"],[1,"info-card"],[1,"info-card__icon","info-card__icon--blue"],[1,"info-card__title"],[1,"info-card__text"],[1,"info-card__icon","info-card__icon--orange"],[1,"pi","pi-truck"],[1,"info-card__icon","info-card__icon--green"],[1,"pi","pi-check-circle"],[1,"info-card__icon","info-card__icon--red"],[1,"pi","pi-replay"],[1,"bulk-action-bar","mb-2","d-flex","align-items-center","gap-2","p-2","rounded",2,"background","rgba(102, 126, 234, 0.1)","border","1px solid rgba(102, 126, 234, 0.3)"],["styleClass","p-datatable-sm","dataKey","id",3,"onLazyLoad","selectionChange","value","rows","totalRecords","lazy","paginator","rowHover","selection"],[1,"fw-semibold"],[1,"ms-auto","d-flex","gap-2"],["icon","pi pi-print","severity","info",3,"label","loading"],["icon","pi pi-times","severity","secondary",3,"onClick","text","pTooltip"],["icon","pi pi-truck","severity","primary",3,"onClick","label","loading"],["icon","pi pi-tag","severity","secondary",3,"onClick","label","loading"],["icon","pi pi-print","severity","info",3,"onClick","label","loading"],[2,"width","3rem"],["pSortableColumn","createdAt"],["field","createdAt"],["pSortableColumn","buyerName"],["field","buyerName"],["pSortableColumn","itemsCount"],["field","itemsCount"],["pSortableColumn","totalCents"],["field","totalCents"],["pSortableColumn","status"],["field","status"],[2,"width","120px"],[3,"value"],[2,"cursor","pointer","white-space","nowrap",3,"click"],[2,"cursor","pointer",3,"click"],["alt","",1,"rounded-circle",2,"width","28px","height","28px","object-fit","cover","flex","0 0 auto",3,"src"],[1,"rounded-circle","d-inline-flex","align-items-center","justify-content-center",2,"width","28px","height","28px","flex","0 0 auto","background","rgba(47, 142, 239, 0.15)","color","#2f8eef","font-size","0.75rem","font-weight","600"],[1,"text-muted","small"],[1,"d-inline-flex","align-items-center","gap-1","small"],["value","Stripe","severity","secondary",3,"rounded"],[3,"severity","value"],[1,"text-muted","mt-1",2,"font-size","0.75em"],[1,"d-flex","gap-1"],["icon","pi pi-eye","severity","secondary",3,"onClick","rounded","text","pTooltip"],["icon","pi pi-trash","severity","danger",3,"onClick","rounded","text","pTooltip"],[1,"pi","pi-at",2,"font-size","0.7rem"],[2,"font-size","0.75rem","opacity","0.7"],[1,"pi","pi-clock","me-1"]],template:function(e,a){e&1&&C(0,Re,1,0,"app-widget-loading")(1,Pe,1,0,"app-widget-api-error")(2,Be,50,68,"div",2)(3,Ge,9,8)(4,Xe,6,8),e&2&&(h(a.loading&&a.orders.length===0?0:-1),t(),h(!a.loading&&a.error&&a.orders.length===0?1:-1),t(),h(!a.loading&&!a.error||a.orders.length>0?2:-1),t(),h(!a.loading&&!a.error&&a.orders.length===0?3:-1),t(),h(a.orders.length>0?4:-1))},dependencies:[W,U,$,z,Y,Q,J,se,ae,le,ie,Z,ee,te,Ce,he,fe,pe,_e,me,ue,ge,re,ne,ce,de,oe,Se,be],styles:[".shop-tab-content[_ngcontent-%COMP%]{background:var(--p-surface-card);border:1px solid var(--p-surface-border);border-top:none;border-radius:0 0 10px 10px;padding:1.25rem}.status-filters[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center}
1.status-filters__separator[_ngcontent-%COMP%]{width:1px;height:20px;background:var(--p-surface-border);margin:0 .25rem}.status-filter[_ngcontent-%COMP%]{background:var(--p-surface-ground);border:1px solid var(--p-surface-border);border-radius:20px;padding:.35rem .85rem;font-size:.8rem;color:var(--p-text-muted-color);cursor:pointer;transition:all .15s;display:inline-flex;align-items:center;gap:.4rem}.status-filter[_ngcontent-%COMP%]:hover{border-color:var(--p-primary-color);color:var(--p-primary-color)}.status-filter.active[_ngcontent-%COMP%]{background:var(--p-primary-color);border-color:var(--p-primary-color);color:#fff}.status-filter.active[_ngcontent-%COMP%] .badge-count[_ngcontent-%COMP%]{background:#ffffff4d;color:#fff}.badge-count[_ngcontent-%COMP%]{background:var(--p-surface-200);border-radius:10px;padding:.05rem .45rem;font-size:.7rem;font-weight:600}.badge-count--warn[_ngcontent-%COMP%]{background:#f59e0b;color:#fff}.badge-count--secondary[_ngcontent-%COMP%]{background:var(--p-surface-400);color:#fff}.empty-state[_ngcontent-%COMP%]{text-align:center;padding:4rem 1rem}.empty-state__icon[_ngcontent-%COMP%]{width:72px;height:72px;border-radius:50%;background:var(--p-surface-100);display:inline-flex;align-items:center;justify-content:center;font-size:1.75rem;color:var(--p-text-muted-color);margin-bottom:1.25rem}.empty-state__title[_ngcontent-%COMP%]{font-size:1.1rem;font-weight:600;color:var(--p-text-color);margin-bottom:.5rem}.empty-state__text[_ngcontent-%COMP%]{color:var(--p-text-muted-color);font-size:.9rem;max-width:400px;margin:0 auto}.dash-info-section[_ngcontent-%COMP%]{border-top:1px solid var(--p-surface-border);padding-top:1rem}.dash-info-toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;width:100%;background:none;border:none;padding:.5rem 0;cursor:pointer;font-size:.85rem;color:var(--p-text-muted-color);font-weight:500;transition:color .15s}.dash-info-toggle[_ngcontent-%COMP%]:hover{color:var(--p-text-color)}.dash-info-toggle[_ngcontent-%COMP%] i[_ngcontent-%COMP%]:first-child{font-size:.9rem}.dash-info-grid[_ngcontent-%COMP%]{padding-top:.75rem}.info-card[_ngcontent-%COMP%]{background:var(--p-surface-ground);border:1px solid var(--p-surface-border);border-radius:10px;padding:1rem;height:100%}.info-card__icon[_ngcontent-%COMP%]{width:36px;height:36px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:.9rem;margin-bottom:.75rem}.info-card__icon--blue[_ngcontent-%COMP%]{background:#3b82f61a;color:#3b82f6}.info-card__icon--orange[_ngcontent-%COMP%]{background:#f59e0b1a;color:#f59e0b}.info-card__icon--green[_ngcontent-%COMP%]{background:#22c55e1a;color:#22c55e}.info-card__icon--red[_ngcontent-%COMP%]{background:#ef44441a;color:#ef4444}.info-card__title[_ngcontent-%COMP%]{font-weight:600;font-size:.85rem;color:var(--p-text-color);margin-bottom:.3rem}.info-card__text[_ngcontent-%COMP%]{font-size:.78rem;color:var(--p-text-muted-color);line-height:1.45;margin:0}.order-detail[_ngcontent-%COMP%]{font-size:.9rem}.detail-section[_ngcontent-%COMP%]{border-bottom:1px solid var(--p-surface-border);padding-bottom:.75rem}.detail-section[_ngcontent-%COMP%]:last-child{border-bottom:none}.detail-section__title[_ngcontent-%COMP%]{font-size:.85rem;font-weight:600;color:var(--p-text-muted-color);margin-bottom:.5rem}.line-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;padding:.5rem 0;border-bottom:1px solid var(--p-surface-50)}.line-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.line-item__img[_ngcontent-%COMP%]{width:48px;height:48px;border-radius:8px;object-fit:cover;border:1px solid var(--p-surface-border)}.line-item__info[_ngcontent-%COMP%]{flex:1;min-width:0}"]})};export{we as ViewManagerShopOrdersComponent};
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.