1import{a as te}from"./chunk-RGWTER5P.js";import{a as ee}from"./chunk-UPFZ5GD6.js";import"./chunk-BYXBJQAS.js";import{a as H,f as J}from"./chunk-JDYWGDNH.js";import"./chunk-IRONFM6M.js";import"./chunk-VHX354RR.js";import{a as Q,b as X}from"./chunk-22WJKAIZ.js";import{b as Z}from"./chunk-SLWPYULI.js";import"./chunk-RPDGXIQT.js";import"./chunk-RFHORXFH.js";import"./chunk-44BDWJO3.js";import"./chunk-YPSMJDVJ.js";import"./chunk-F6HJUGGY.js";import{a as Y,b as q}from"./chunk-W6FQLWKF.js";import"./chunk-6MXSXX3N.js";import"./chunk-MT62CIDI.js";import"./chunk-BXNQRMY5.js";import"./chunk-RFCDL6VX.js";import"./chunk-XWDSR7V3.js";import"./chunk-3THAQ3J3.js";import"./chunk-OAED5FIG.js";import"./chunk-P37GQ53N.js";import"./chunk-YK3HMHC4.js";import"./chunk-2DRXLVRR.js";import{d as K,e as G}from"./chunk-OFHUO5H7.js";import"./chunk-M3XSAKW4.js";import"./chunk-H76LZNGX.js";import"./chunk-PGR2NPNS.js";import"./chunk-OZD37XM5.js";import"./chunk-DLIVM562.js";import"./chunk-CV2ZWZQE.js";import"./chunk-AVEXXPAT.js";import{ja as $}from"./chunk-FHU4TM37.js";import{D as k,g as z,l as W}from"./chunk-Q2KKZV5J.js";import{a as j}from"./chunk-BD6EMWWF.js";import"./chunk-AB6CKZTE.js";import{c as N,d as F,e as B}from"./chunk-DIGPPQJE.js";import{s as R,x as A}from"./chunk-EU6HCBUP.js";import"./chunk-KAJMKXZ6.js";import{D as V,x as O}from"./chunk-ZAQTNZYS.js";import"./chunk-SRTXE2HR.js";import{Dc as P,Ec as L,Fc as M,Jb as E,Kc as w,Lc as b,Mb as I,Rb as m,Uc as d,Vc as u,Wb as r,Wc as U,Xb as o,Yb as _,ac as x,da as T,db as a,gc as C,hc as l,la as v,ma as D,sb as h,uc as s,vc as p,wc as f,yb as c}from"./chunk-NTTV6FWH.js";import{g as y}from"./chunk-W7GRJBO5.js";var ne=()=>({minWidth:"200px"}),ae=()=>[10,25,50],oe=t=>["/studio/disputes",t];function re(t,i){t&1&&_(0,"app-widget-loading")}function se(t,i){if(t&1){let e=x();r(0,"app-widget-api-error",6),C("retry",function(){v(e);let g=l();return D(g.loadData())}),o()}}function le(t,i){t&1&&_(0,"app-widget-manager-empty-state",4)}function pe(t,i){t&1&&(r(0,"tr")(1,"th"),s(2),d(3,"translate"),o(),r(4,"th"),s(5),d(6,"translate"),o(),r(7,"th"),s(8),d(9,"translate"),o(),r(10,"th"),s(11),d(12,"translate"),o(),r(13,"th"),s(14),d(15,"translate"),o(),_(16,"th"),o()),t&2&&(a(2),p(u(3,5,"DISPUTES.COL_TICKET")),a(3),p(u(6,7,"DISPUTES.COL_REASON")),a(3),p(u(9,9,"DISPUTES.COL_STATUS")),a(3),p(u(12,11,"DISPUTES.COL_AMOUNT")),a(3),p(u(15,13,"DISPUTES.COL_DATE")))}function de(t,i){if(t&1&&(r(0,"span",12),s(1),o()),t&2){let e=l().$implicit,n=l(2);a(),p(n.getReasonLabel(e.disputeReason))}}function me(t,i){if(t&1&&_(0,"p-tag",13),t&2){let e=l().$implicit,n=l(2);E("severity",n.getStatusSeverity(e.disputeStatus))("value",n.getStatusLabel(e.disputeStatus))}}function ue(t,i){if(t&1&&(r(0,"span",10),s(1),o()),t&2){let e=l().$implicit,n=l(2);a(),p(n.formatPrice(e.disputeAmountCents))}}function ce(t,i){if(t&1&&(r(0,"tr")(1,"td")(2,"span",10),s(3),o(),r(4,"div",11),s(5),o()(),r(6,"td"),c(7,de,2,1,"span",12),o(),r(8,"td"),c(9,me,1,2,"p-tag",13),o(),r(10,"td"),c(11,ue,2,1,"span",10),o(),r(12,"td")(13,"span",14),s(14),d(15,"date"),o()(),r(16,"td",15),_(17,"p-button",16),o()()),t&2){let e=i.$implicit;a(3),f("#",e.ticketNumber,""),a(2),f(" ",e.subject," "),a(2),m(e.dis
1puteReason?7:-1),a(2),m(e.disputeStatus?9:-1),a(2),m(e.disputeAmountCents?11:-1),a(3),p(U(15,9,e.createdAt,"dd/MM/yyyy")),a(3),E("text",!0)("rounded",!0)("routerLink",b(12,oe,e.id))}}function _e(t,i){if(t&1){let e=x();r(0,"p-table",7),C("onLazyLoad",function(g){v(e);let S=l();return D(S.onPageChange(g))}),c(1,pe,17,15,"ng-template",8)(2,ce,18,14,"ng-template",9),o()}if(t&2){let e=l();E("value",e.disputes)("lazy",!0)("paginator",!0)("rows",e.limit)("totalRecords",e.total)("first",(e.page-1)*e.limit)("rowsPerPageOptions",w(7,ae))}}var ie=class t{disputeService=T(ee);t=T(N);loading=!0;error=null;disputes=[];total=0;page=1;limit=10;statusFilter="";statusOptions=[];ngOnInit(){this.statusOptions=[{label:this.t.instant("DISPUTES.FILTER_ALL"),value:""},{label:this.t.instant("DISPUTES.STATUS_OPEN"),value:"open"},{label:this.t.instant("DISPUTES.STATUS_SELLER_RESPONSE_PENDING"),value:"seller_response_pending"},{label:this.t.instant("DISPUTES.STATUS_SELLER_RESPONDED"),value:"seller_responded"},{label:this.t.instant("DISPUTES.STATUS_ESCALATED"),value:"escalated"},{label:this.t.instant("DISPUTES.STATUS_ADMIN_RESOLVED"),value:"admin_resolved"},{label:this.t.instant("DISPUTES.STATUS_CLOSED"),value:"closed"}],this.loadData()}loadData(){return y(this,null,function*(){this.loading=!0,this.error=null;try{let i=yield this.disputeService.listBuyerDisputes({page:this.page,limit:this.limit,status:this.statusFilter||void 0});this.disputes=i.data,this.total=i.total}catch{this.error="load"}finally{this.loading=!1}})}onFilterChange(){this.page=1,this.loadData()}onPageChange(i){this.page=Math.floor(i.first/i.rows)+1,this.limit=i.rows,this.loadData()}getStatusSeverity(i){return{open:"warn",seller_response_pending:"warn",seller_responded:"info",ai_reviewing:"info",ai_resolved:"success",escalated:"danger",admin_resolved:"success",refund_processing:"info",closed:"secondary"}[i]||"info"}getStatusLabel(i){return this.t.instant(`DISPUTES.STATUS_${i.toUpperCase()}`)}getReasonLabel(i){return this.t.instant(`DISPUTES.REASON_${i.toUpperCase()}`)}formatPrice(i,e="EUR"){return(i/100).toFixed(2)+" "+e.toUpperCase()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=h({type:t,selectors:[["app-view-manager-disputes"]],decls:13,vars:15,consts:[[1,"d-flex","justify-content-between","align-items-center","mb-3","flex-wrap","gap-2"],[1,"mb-1"],[1,"text-muted","mb-0","small"],["optionLabel","label","optionValue","value",3,"ngModelChange","onChange","ngModel","options"],["icon","pi pi-shield","titleKey","DISPUTES.EMPTY_TITLE","descriptionKey","DISPUTES.EMPTY_DESC"],["styleClass","p-datatable-sm p-datatable-striped","responsiveLayout","scroll",3,"value","lazy","paginator","rows","totalRecords","first","rowsPerPageOptions"],[3,"retry"],["styleClass","p-datatable-sm p-datatable-striped","responsiveLayout","scroll",3,"onLazyLoad","value","lazy","paginator","rows","totalRecords","first","rowsPerPageOptions"],["pTemplate","header"],["pTemplate","body"],[1,"fw-semibold"],[1,"text-muted","small","text-truncate",2,"max-width","200px"],[1,"small"],["size","small",3,"severity","value"],[1,"small","text-muted"],[1,"text-end"],["icon","pi pi-eye","severity","secondary",3,"text","rounded","routerLink"]],template:function(e,n){e&1&&(r(0,"div",0)(1,"div")(2,"h4",1),s(3),d(4,"translate"),o(),r(5,"p",2),s(6),d(7,"translate"),o()(),r(8,"p-select",3),M("ngModelChange",function(S){return L(n.statusFilter,S)||(n.statusFilter=S),S}),C("onChange",function(){return n.onFilterChange()}),o()(),c(9,re,1,0,"app-widget-loading")(10,se,1,0,"app-widget-api-error")(11,le,1,0,"app-widget-manager-empty-state",4)(12,_e,3,8,"p-table",5)),e&2&&(a(3),p(u(4,10,"DISPUTES.TITLE")),a(3),f(" ",u(7,12,"DISPUTES.SUBTITLE")," "),a(2),I(w(14,ne)),P("ngModel",n.statusFilter),E("options",n.statusOptions),a(),m(n.loading?9:-1),a(),m(!n.loading&&n.error?10:-1),a(),m(!n.loading&&!n.error&&n.disputes.length===0?11:-1),a(),m(!n.loading&&!n.error&&n.disputes.length>0?12:-1))},dependencies:[V,O,A,R,k,z,W,B,F,G,K,$,X,Q,J,H,q,Y,j,Z,te],styles:["[_nghost-%COMP%] p-table .p-datatable-tbody>tr>td{vertical-align:middle}"]})};export{ie as ViewManagerDisputesComponent};
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.