1import{a as Ue}from"./chunk-GYEAK6A2.js";import"./chunk-VZDUNVSE.js";import{a as ke}from"./chunk-DGH55HEQ.js";import{a as Ve}from"./chunk-HI3BBQYM.js";import"./chunk-BYXBJQAS.js";import{a as De,b as Oe}from"./chunk-E6GZEUAF.js";import{a as Ne}from"./chunk-GIIMJHN6.js";import"./chunk-VYULK3Y3.js";import{a as Se,b as xe}from"./chunk-LAPCUU4J.js";import"./chunk-DQRROS2B.js";import{b as ve}from"./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 be}from"./chunk-QIOURN4K.js";import{a as fe,b as Re}from"./chunk-KYVCMV2E.js";import"./chunk-HWZZ5RQT.js";import"./chunk-ZNR7QNVV.js";import"./chunk-U3Z5BGA7.js";import{a as Ie,b as ye}from"./chunk-N3YFX76I.js";import"./chunk-WF4KZOYP.js";import{a as Pe,b as Te}from"./chunk-M6YDMVQ7.js";import{a as we}from"./chunk-OTMVSU27.js";import{a as pe}from"./chunk-EB6TJ75L.js";import"./chunk-QI7CEGT6.js";import"./chunk-6ND7557V.js";import{D as ue,c as ce,g as _e,l as me}from"./chunk-FOJCKIWO.js";import{a as Ce}from"./chunk-NBMUSEX4.js";import"./chunk-3AIY57KH.js";import{a as oe}from"./chunk-AB6CKZTE.js";import{b as Ae,c as Me}from"./chunk-H66TAOKK.js";import"./chunk-Z64D265S.js";import"./chunk-K5O3OQFW.js";import"./chunk-2DRXLVRR.js";import{d as Ee,e as he}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{ja as ge}from"./chunk-AQEWHUN5.js";import{c as le,d as se,e as de}from"./chunk-YQZAETCE.js";import{o as ie,r as ne,s as ae,x as re}from"./chunk-EO42E46J.js";import"./chunk-3QVSKJ3X.js";import{A as K,C as X,D as J,F as Z,H as ee,I as te,p as Q}from"./chunk-ERUCNOOT.js";import{$b as f,Cc as P,Dc as T,Ec as w,Gc as U,Hc as k,Jb as u,Lb as V,Mb as H,Ob as $,Qb as _,Qc as s,Rc as d,Sb as G,Sc as b,Tb as D,Tc as N,Ub as O,Uc as L,Vb as a,Wb as r,Xb as g,_a as y,da as I,db as i,fc as v,gc as c,la as S,ma as x,mc as q,nc as j,oc as z,sb as W,tc as o,uc as C,vc as m,wc as A,xc as Y,yb as h}from"./chunk-DBE7WQEG.js";import{g as R}from"./chunk-W7GRJBO5.js";var Fe=["chatWidget"],We=t=>["/studio/disputes",t],$e=t=>["/studio/messages",t],qe=t=>({days:t}),je=t=>({time:t}),ze=()=>[1,2,3,4,5],B=()=>({width:"550px",maxWidth:"95vw"}),Ye=(t,n)=>n.productId,Qe=(t,n)=>n.date,Ke=(t,n)=>n.key,F=(t,n)=>n.id;function Xe(t,n){if(t&1&&(a(0,"span",8),o(1),s(2,"slice"),r(),g(3,"p-tag",9)),t&2){let e=c();i(),m("#",N(2,3,e.order.id,0,8),""),i(2),u("severity",e.getStatusSeverity(e.order.status))("value",e.getStatusLabel(e.order.status))}}function Je(t,n){t&1&&g(0,"app-widget-loading")}function Ze(t,n){if(t&1){let e=f();a(0,"app-widget-api-error",10),v("retry",function(){S(e);let p=c();return x(p.loadOrder())}),r()}}function et(t,n){if(t&1&&(o(0),s(1,"translate"),s(2,"date")),t&2){let e=c(3);A(" ",d(1,2,"MANAGER.PURCHASES.OPEN_UNTIL")," ",b(2,4,e.order.openUntil,"dd/MM/yyyy HH:mm")," ")}}function tt(t,n){if(t&1){let e=f();a(0,"div",11)(1,"div",50)(2,"div")(3,"div",51),g(4,"i",52),o(5),s(6,"translate"),r(),a(7,"div",16),h(8,et,3,7),r()(),a(9,"p-button",53),s(10,"translate"),v("onClick",function(){S(e);let p=c(2);return x(p.closeCart())}),r()()()}if(t&2){let e=c(2);i(5),m(" ",d(6,3,"MANAGER.PURCHASES.STATUS_OPEN_CART")," "),i(3),_(e.order.openUntil?8:-1),i(),u("label",d(10,5,"MANAGER.PURCHASES.CLOSE_CART_ACCEPT"))}}function it(t,n){if(t&1&&g(0,"img",54),t&2){let e=c().$implicit;u("src",e.imageUrl,y)("alt",e.title)}}function nt(t,n){t&1&&(a(0,"div",55),g(1,"i",62),r())}function at(t,n){if(t&1&&(a(0,"span",63),o(1),r()),t&2){let e=n.$implicit;i(),A("",e.key,": ",e.value,"")}}function rt(t,n){if(t&1&&(a(0,"div",16),D(1,at,2,2,"span",63,Ke),s(3,"keyvalue"),r()),t&2){let e=c().$implicit;i(),O(d(3,0,e.options))}}function ot(t,n){if(t&1&&(a(0,"div",58),g(1,"i",64),o(2),r()),t&2){let e=c().$implicit;i(2),m(" ",e.buyerItemDescription," ")}}function lt(t,n){if(t&1&&(a(0,"a",66),g(1,"i",67),o(2),a(3,"span",68),o(4),r()()),t&2){let e=n.$implicit,l=c(4);V("line-item__download-btn--exhausted",e.downloadCount>=e.maxDownloads),u("href",l.getDownloadUrl(e),y),i(2),m(" ",e.fileName," "),i(2),A(" (",e.downloadCount,"/",e.maxDownloads,") ")}}function st(t,n){if(t&1&&(a(0,"div",61),D(1,lt,5,6,"a",65,F),r()),t&2){let e=c().$implicit,l=c(2);i(),O(l.getTokensForProduct(e.productId))}}
1function dt(t,n){if(t&1&&(a(0,"div",18),h(1,it,1,2,"img",54)(2,nt,2,0,"div",55),a(3,"div",56)(4,"div",57),o(5),r(),h(6,rt,4,2,"div",16)(7,ot,3,1,"div",58),r(),a(8,"div",59),o(9),r(),a(10,"div",60),o(11),r(),h(12,st,3,0,"div",61),r()),t&2){let e=n.$implicit,l=c(2);i(),_(e.imageUrl?1:2),i(4),C(e.title),i(),_(e.options?6:-1),i(),_(e.buyerItemDescription?7:-1),i(2),m(" x",e.quantity," "),i(2),m(" ",l.formatPrice(e.totalCents,l.order.currency)," "),i(),_(l.getTokensForProduct(e.productId).length>0?12:-1)}}function pt(t,n){if(t&1&&(a(0,"div",20)(1,"span",21),o(2),s(3,"translate"),r(),a(4,"span"),o(5),r()()),t&2){let e=c(2);i(2),C(d(3,2,"MANAGER.PURCHASES.SHIPPING")),i(3),C(e.formatPrice(e.order.shippingCents,e.order.currency))}}function ct(t,n){if(t&1&&(a(0,"div",20)(1,"span",21),o(2),s(3,"translate"),r(),a(4,"span",69),o(5),r()()),t&2){let e=c(2);i(2),C(d(3,2,"MANAGER.PURCHASES.DISCOUNT")),i(3),m("-",e.formatPrice(e.order.discountCents,e.order.currency),"")}}function _t(t,n){t&1&&(a(0,"span",16),o(1),s(2,"translate"),r()),t&2&&(i(),m("(",d(2,1,"MANAGER.PURCHASES.PARTIAL"),")"))}function mt(t,n){if(t&1&&(a(0,"div",20)(1,"span",16),o(2),s(3,"translate"),r(),a(4,"span",75),o(5),r()()),t&2){let e=c(3);i(2),C(d(3,2,"MANAGER.PURCHASES.REFUND_COMPENSATION_LABEL")),i(3),C(e.getRefundModeLabel(e.order.refundMode))}}function ut(t,n){if(t&1&&(a(0,"div",20)(1,"span",16),o(2),r(),a(3,"span",75),o(4),r()()),t&2){let e=c(3);i(2),C(e.getRefundReferenceLabel()),i(2),C(e.getRefundReferenceValue())}}function gt(t,n){if(t&1&&(a(0,"div",70)(1,"span",71),g(2,"i",72),o(3),s(4,"translate"),h(5,_t,3,3,"span",16),r(),a(6,"span",73),o(7),r()(),h(8,mt,6,4,"div",20)(9,ut,5,2,"div",20),a(10,"div",74)(11,"span",57),o(12),s(13,"translate"),r(),a(14,"span",57),o(15),r()()),t&2){let e=c(2);i(3),m("",d(4,7,"MANAGER.PURCHASES.REFUNDED_AMOUNT")," "),i(2),_(e.order.status==="partially_refunded"?5:-1),i(2),m("-",e.formatPrice(e.order.refundedAmountCents,e.order.currency),""),i(),_(e.order.refundMode?8:-1),i(),_(e.getRefundReferenceValue()?9:-1),i(3),C(d(13,9,"MANAGER.PURCHASES.NET_TOTAL")),i(3),C(e.formatPrice(e.order.totalCents-e.order.refundedAmountCents,e.order.currency))}}function Ct(t,n){if(t&1&&(a(0,"div",76)(1,"span",21),o(2),s(3,"translate"),r(),a(4,"span",79),o(5),r()()),t&2){let e=c(3);i(2),m("",d(3,2,"MANAGER.PURCHASES.CARRIER")," :"),i(3),C(e.order.carrier)}}function Et(t,n){if(t&1&&(a(0,"div",76)(1,"span",21),o(2),s(3,"translate"),r(),a(4,"span",79),o(5),r()()),t&2){let e=c(3);i(2),m("",d(3,2,"MANAGER.PURCHASES.TRACKING_NUMBER")," :"),i(3),C(e.order.trackingNumber)}}function ht(t,n){if(t&1&&(a(0,"a",77),g(1,"i",45),o(2),s(3,"translate"),r()),t&2){let e=c(3);u("href",e.order.trackingUrl,y),i(2),m(" ",d(3,2,"MANAGER.PURCHASES.TRACKING_LINK")," ")}}function St(t,n){if(t&1&&(a(0,"div",78)(1,"span",21),o(2),s(3,"translate"),r(),a(4,"span",79),o(5),s(6,"date"),r()()),t&2){let e=c(3);i(2),m("",d(3,2,"MANAGER.PURCHASES.ESTIMATED_DELIVERY")," :"),i(3),C(b(6,4,e.order.estimatedDeliveryAt,"dd/MM/yyyy"))}}function xt(t,n){if(t&1&&h(0,Ct,6,4,"div",76)(1,Et,6,4,"div",76)(2,ht,4,4,"a",77)(3,St,7,7,"div",78),t&2){let e=c(2);_(e.order.carrier?0:-1),i(),_(e.order.trackingNumber?1:-1),i(),_(e.order.trackingUrl?2:-1),i(),_(e.order.estimatedDeliveryAt?3:-1)}}function vt(t,n){t&1&&(a(0,"div",23),g(1,"i",80),a(2,"span"),o(3),s(4,"translate"),r()()),t&2&&(i(3),C(d(4,1,"MANAGER.PURCHASES.VIRTUAL_NO_SHIPPING")))}function ft(t,n){t&1&&(a(0,"p",24),o(1),s(2,"translate"),r()),t&2&&(i(),m(" ",d(2,1,"MANAGER.PURCHASES.NO_TRACKING")," "))}function Rt(t,n){if(t&1&&(a(0,"div",84)(1,"span",21),o(2),s(3,"translate"),r(),a(4,"span",86),o(5),r()()),t&2){let e=c().$implicit;i(2),m("",d(3,2,"MANAGER.PURCHASES.CARRIER")," :"),i(3),C(e.carrier)}}function At(t,n){if(t&1&&(a(0,"div",84)(1,"span",21),o(2),s(3,"translate"),r(),a(4,"span",86),o(5),r()()),t&2){let e=c().$implicit;i(2),m("",d(3,2,"MANAGER.PURCHASES.TRACKING_NUMBER")," :"),i(3),C(e.trackingNumber)}}function Mt(t,n){if(t&1&&(a(0,"a",85),g(1,"i",45),o(2),s(3,"translate"),r()),t&2){let e=c().$implicit;u("href",e.trackingUrl,y),i(2),m(" ",d(3,2,"MANAGER.PURCHASES.TRACKING_LINK")," ")}}function Pt(t,n){if(t&1&&(a(0,"div",84)(1,"span",21),o(2),s(3,"translate"),r(),a(4,"span",86),o(5),s(6,"date"),r()()),t&2){let e=c().$implicit;i(2),m("",d(3,2,"MANAGER.PURCHASES.ESTIMATED_DELIVERY")," :"),i(3),C(b(6,4,e.estimatedDeliveryAt,"dd/MM/yyyy"))}}function Tt(t,n){if(t&1&&(a(0,"div",82)(1,"div",83)(2,"span",57),o(3),s(4,"translate"),r(),a(5,"span",16),o(6),s(7,"date"),r()(),h(8,Rt,6,4,"div",84)(9,At,6,4,"div",84)(10,Mt,4,4,"a",85)(11,Pt,7,7,"div",84),r()),t&2){let e=n.$implicit,l=n.$index,p=c(3);V("border-bottom",l<p.order.shipments.length-1),i(3),A(" ",d(4,9,"MANAGER.PURCHASES.SHIPMENT_NUMBER")," ",l+1," "),i(3),C(b(7,11,e.shippedAt,"dd/MM/yyyy")),i(2),_(e.carrier?8:-1),i(),_(e.trackingNumber?9:-1),i(),_(e.trackingUrl?10:-1),i(),_(e.estimatedDeliveryAt?11:-1)}}function wt(t,n){if(t&1&&(a(0,"p-panel",14),s(1,"translate"),D(2,Tt,12,14,"div",81,F),r()),t&2){let e=c(2);u("toggleable",!0)("header",d(1,2,"MANAGER.PURCHASES.SHIPMENTS_TITLE")),i(2),O(e.order.shipments)}}function bt(t,n){if(t&1&&(a(0,"p-panel",14),s(1,"translate"),a(2,"p",87),o(3),r()()),t&2){let e=c(2);u("toggleable",!1)("header",d(1,3,"MANAGER.PURCHASES.SELLER_NOTES")),i(3),C(e.visibleSellerNote)}}function It(t,n){if(t&1&&(a(0,"div",25)(1,"div",88),g(2,"i",89),a(3,"div")(4,"div",57),o(5),s(6,"translate"),r(),a(7,"small",21),g(8,"p-tag",90),r()()(),g(9,"p-button",91),s(10,"translate"),r()),t&2){let e=c(2);i(5),m(" ",d(6,6,"DISPUTES.ACTIVE_DISPUTE")," "),i(3),u("severity",e.getDisputeStatusSeverity(e.existingDispute.disputeStatus||""))("value",e.getDisputeStatusLabel(e.existingDispute.disputeStatus||"")),i(),u("label",d(10,8,"DISPUTES.VIEW_DISPUTE"))("outlined",!0)("routerLink",k(10,We,e.existingDispute.i
1d))}}function yt(t,n){if(t&1&&(a(0,"a",94),g(1,"p-tag",95),r()),t&2){let e=c(3);u("routerLink",k(3,$e,e.orderTicket.id)),i(),u("value","#"+e.orderTicket.ticketNumber)("rounded",!0)}}function Dt(t,n){if(t&1&&(a(0,"div",92)(1,"span"),g(2,"i",93),o(3),s(4,"translate"),r(),h(5,yt,2,5,"a",94),r()),t&2){let e=c(2);i(3),m("",d(4,2,"MANAGER.PURCHASES.MESSAGING")," "),i(2),_(e.orderTicket?5:-1)}}function Ot(t,n){t&1&&(a(0,"div",29),g(1,"i",96),o(2),s(3,"translate"),r()),t&2&&(i(2),m(" ",d(3,1,"MANAGER.PURCHASES.WAITING_SELLER_RESPONSE")," "))}function Nt(t,n){t&1&&(a(0,"div",30),g(1,"i",97),o(2),s(3,"translate"),r()),t&2&&(i(2),m(" ",d(3,1,"MANAGER.PURCHASES.ESCALATION_HINT")," "))}function Ut(t,n){if(t&1){let e=f();a(0,"div",98),v("click",function(){S(e);let p=c(2);return x(p.downloadReceipt())}),a(1,"div",99),g(2,"i",100),r(),a(3,"div",101)(4,"div",102),o(5),s(6,"translate"),r(),a(7,"div",103),o(8),s(9,"translate"),r()(),g(10,"i",104),r()}t&2&&(i(5),m(" ",d(6,2,"MANAGER.PURCHASES.DOWNLOAD_RECEIPT")," "),i(3),m(" ",d(9,4,"MANAGER.PURCHASES.DOWNLOAD_RECEIPT_DESC")," "))}function kt(t,n){if(t&1){let e=f();a(0,"div",98),v("click",function(){S(e);let p=c(2);return x(p.downloadInvoice())}),a(1,"div",105),g(2,"i",106),r(),a(3,"div",101)(4,"div",102),o(5),s(6,"translate"),r(),a(7,"div",103),o(8),s(9,"translate"),r()(),g(10,"i",104),r()}t&2&&(i(5),m(" ",d(6,2,"MANAGER.PURCHASES.DOWNLOAD_INVOICE")," "),i(3),m(" ",d(9,4,"MANAGER.PURCHASES.DOWNLOAD_INVOICE_DESC")," "))}function Vt(t,n){t&1&&(a(0,"div",34)(1,"div",107),g(2,"i",108),r(),a(3,"div",101)(4,"div",109),o(5),s(6,"translate"),r(),a(7,"div",103),o(8),s(9,"translate"),r()()()),t&2&&(i(5),m(" ",d(6,2,"MANAGER.PURCHASES.INVOICE_AFTER_SHIPMENT")," "),i(3),m(" ",d(9,4,"MANAGER.PURCHASES.INVOICE_AFTER_SHIPMENT_DESC")," "))}function Ht(t,n){if(t&1){let e=f();a(0,"div",98),v("click",function(){S(e);let p=c(2);return x(p.openReportDialog())}),a(1,"div",110),g(2,"i",111),r(),a(3,"div",101)(4,"div",102),o(5),s(6,"translate"),r(),a(7,"div",103),o(8),s(9,"translate"),r()(),g(10,"i",112),r()}t&2&&(i(5),m(" ",d(6,2,"MANAGER.PURCHASES.REPORT_PROBLEM")," "),i(3),m(" ",d(9,4,"MANAGER.PURCHASES.REPORT_PROBLEM_DESC")," "))}function Lt(t,n){if(t&1){let e=f();a(0,"div",98),v("click",function(){S(e);let p=c(2);return x(p.openCancelRequestDialog())}),a(1,"div",113),g(2,"i",114),r(),a(3,"div",101)(4,"div",102),o(5),s(6,"translate"),r(),a(7,"div",103),o(8),s(9,"translate"),r()(),g(10,"i",112),r()}if(t&2){let e=c(2);i(5),m(" ",d(6,2,"MANAGER.PURCHASES.CANCEL_REQUEST_BTN")," "),i(3),m(" ",b(9,4,"MANAGER.PURCHASES.CANCEL_WITHDRAWAL_REMAINING",k(7,qe,e.remainingWithdrawalDays))," ")}}function Gt(t,n){if(t&1&&(a(0,"div",34)(1,"div",107),g(2,"i",115),r(),a(3,"div",101)(4,"div",109),o(5),s(6,"translate"),r(),a(7,"div",103),o(8),s(9,"translate"),r()()()),t&2){let e=c(2);i(5),m(" ",d(6,2,"DISPUTES.OPEN_DISPUTE")," "),i(3),m(" ",b(9,4,"MANAGER.PURCHASES.DISPUTE_WAIT_DESC",k(7,je,e.remainingEscalationTime))," ")}}function Bt(t,n){if(t&1){let e=f();a(0,"div",116),v("click",function(){S(e);let p=c(2);return x(p.openDisputeDialog())}),a(1,"div",113),g(2,"i",117),r(),a(3,"div",101)(4,"div",102),o(5),s(6,"translate"),r(),a(7,"div",103),o(8),s(9,"translate"),r()(),g(10,"i",112),r()}t&2&&(i(5),m(" ",d(6,2,"DISPUTES.OPEN_DISPUTE")," "),i(3),m(" ",d(9,4,"MANAGER.PURCHASES.OPEN_DISPUTE_DESC")," "))}function Ft(t,n){t&1&&(a(0,"div",36),g(1,"i",108),a(2,"span"),o(3),s(4,"translate"),r()()),t&2&&(i(3),C(d(4,1,"MANAGER.PURCHASES.NO_ACTIONS")))}function Wt(t,n){if(t&1&&g(0,"img",39),t&2){let e=c(2);u("src",e.order.sellerInfo.avatarUrl,y)("alt",e.order.sellerInfo.displayName)}}function $t(t,n){if(t&1&&(a(0,"div",40),o(1),s(2,"uppercase"),r()),t&2){let e=c(2);i(),m(" ",d(2,1,((e.order.sellerInfo==null?null:e.order.sellerInfo.displayName)||e.order.bioPageUsername).charAt(0))," ")}}function qt(t,n){if(t&1&&g(0,"i",119),t&2){let e=n.$implicit,l=c(3);u("ngClass",e<=l.Math.round(l.order.sellerInfo.averageRating)?"pi-star-fill":"pi-star")}}function jt(t,n){if(t&1&&(a(0,"div",43)(1,"div",118),D(2,qt,1,1,"i",119,G),r(),a(4,"span",120),o(5),s(6,"translate"),r()()),t&2){let e=c(2);i(2),O(U(5,ze)),i(3),Y("",e.order.sellerInfo.averageRating,"/5 (",e.order.sellerInfo.reviewCount," ",d(6,3,"MANAGER.PURCHASES.REVIEWS"),")")}}function zt(t,n){t&1&&(a(0,"div",43)(1,"span",121),o(2),s(3,"translate"),r()()),t&2&&(i(2),C(d(3,1,"MANAGER.PURCHASES.NO_REVIEWS_YET")))}function Yt(t,n){if(t&1&&(a(0,"div",51),o(1),r()),t&2){let e=c(3);i(),m(" ",e.order.servicePointAddress.name," ")}}function Qt(t,n){if(t&1&&(a(0,"div"),o(1),r()),t&2){let e=c(3);i(),C(e.order.servicePointAddress.street)}}function Kt(t,n){if(t&1&&(a(0,"div"),o(1),r()),t&2){let e=c(3);i(),A(" ",e.order.servicePointAddress.postal_code," ",e.order.servicePointAddress.city," ")}}function Xt(t,n){if(t&1&&(a(0,"div",122),g(1,"span",123),s(2,"lowercase"),a(3,"span",16),o(4),s(5,"uppercase"),r()()),t&2){let e=c(3);i(),u("ngClass","fp-"+d(2,2,e.order.servicePointAddress.country)),i(3),C(d(5,4,e.order.servicePointAddress.country))}}function Jt(t,n){if(t&1&&(a(0,"p-panel",14),s(1,"translate"),h(2,Yt,2,1,"div",51)(3,Qt,2,1,"div")(4,Kt,2,2,"div")(5,Xt,6,6,"div",122),r()),t&2){let e=c(2);u("toggleable",!1)("header",d(1,6,"MANAGER.PURCHASES.SERVICE_POINT")),i(2),_(e.order.servicePointAddress.name?2:-1),i(),_(e.order.servicePointAddress.street?3:-1),i(),_(e.order.servicePointAddress.postal_code||e.order.servicePointAddress.city?4:-1),i(),_(e.order.servicePointAddress.country?5:-1)}}function Zt(t,n){if(t&1&&(a(0,"div",51),o(1),r()),t&2){let e=c(3);i(),m(" ",e.order.shippingAddress.name," ")}}function ei(t,n){if(t&1&&(a(0,"div"),o(1),r()),t&2){let e=c(3);i(),C(e.order.shippingAddress.line2)}}function ti(t,n){if(t&1&&(a(0,"div"),o(1),r()),t&2){let e=c(3);i(),C(e.order.shippingAddress.state)}}function ii(t,n){if(t&1&&(a(0,"div",122),g(1,"span",123),s(2,"lowercase"),a(3,"span",16),o(4),s(5,"uppercase"),r()()),t&2){let e=c(3);i(),u("ngClass","fp-"+d(2,2,e.order.shippingAddress.country)),i(3),C(d(5,4,e.order.shippingAddress.country))}}function ni(t,n){if(t&1&&(a(0,"p-panel",14),s(1,"translate"),h(2,Zt,2,1,"div",51),a(3,"div"),o(4),r(),h(5,ei,2,1,"div"),a(6,"div"),o(7),r(),h(8,ti,2,1,"div")(9,ii,6,6,"div",122),r()),t&2){let e=c(2);u("toggleable",!1)("header",d(1,9,"MANAGER.PURCHASES.SHIPPING_ADDRESS")),i(2),_(e.order.shippingAddress.name?2:-1),i(2),C(e.order.shippingAddress.line1),i(),_(e.order.shippingAddress.line2?5:-1),i(2),A(" ",e.order.shippingAddress.postalCode," ",e.order.shippingAddress.city," "),i(),_(e.order.shippingAddress.state?8:-1),i(),_(e.order.shippingAddress.country?9:-1)}}function ai(t,n){if(t&1&&(a(0,"div",51),o(1),r()),t&2){let e=c(3);i(),m(" ",e.order.billingAddress.name," ")}}function ri(t,n){if(t&1&&(a(0,"div"),o(1),r()),t&2){let e=c(3);i(),C(e.order.billingAddress.line2)}}function oi(t,n){if(t&1&&(a(0,"div"),o(1),r()),t&2){let e=c(3);i(),C(e.order.billingAddress.state)}}function li(t,n){if(t&1&&(a(0,"div",122),g(1,"span",123),s(2,"lowercase"),a(3,"span",16),o(4),s(5,"uppercase"),r()()),t&2){let e=c(3);i(),u("ngClass","fp-"+d(2,2,e.order.billingAddress.country)),i(3),C(d(5,4,e.order.billingAddress.country))}}function si(t,n){if(t&1&&(a(0,"p-panel",14),s(1,"translate"),h(2,ai,2,1,"div",51),a(3,"div"),o(4),r(),h(5,ri,2,1,"div"),a(6,"div"),o(7),r(),h(8,oi,2,1,"div")(9,li,6,6,"div",122),r()),t&2){let e=c(2);u("toggleable",!1)("header",d(1,9,"MANAGER.PURCHASES.BILLING_ADDRESS")),i(2),_(e.order.billingAddress.name?2:-1),i(2),C(e.order.billingAddress.line1),i(),_(e.order.billingAddress.line2?5:-1),i(2),A(" ",e.order.billingAddress.postalCode," ",e.order.billingAddress.city," "),i(),_(e.order.billingAddress.state?8:-1),i(),_(e.order.billingAddress.country?9:-1)}}function di(t,n){t&1&&g(0,"p-skeleton",46)}function pi(t,n){t&1&&(a(0,"p",24),o(1),s(2,"translate"),r()),t&2&&(i(),m(" ",d(2,1,"MANAGER.PURCHASES.REFUND_HISTORY_EMPTY")," "))}function ci(t,n){if(t&1&&(a(0,"div",16),o(1),r()),t&2){let e=c().$implicit,l=c(3);i(),m(" ",l.getRefundModeLabel(e.refundMode)," ")}}function _i(t,n){if(t&1&&(a(0,"div",128)(1,"span",21),o(2),r(),a(3,"span",57),o(4),r()()),t&2){let e=c().$implicit,l=c(3);i(2),C(l.getRefundHistoryReferenceLabel(e)),i(2),C(l.getRefundHistoryReferenceValue(e))}}function mi(t,n){if(t&1&&(a(0,"div",124)(1,"div",125)(2,"div")(3,"div",57),o(4),r(),a(5,"div",16),o(6),s(7,"date"),r()(),a(8,"div",126)(9,"div",127),o(10),r(),h(11,ci,2,1,"div",16),r()(),h(12,_i,5,2,"div",128),r()),t&2){let e=n.$implicit,l=c(3);i(4),m(" ",l.getRefundHistoryTypeLabel(e.refundType)," "),i(2),m(" ",b(7,5,e.createdAt,"dd/MM/yyyy HH:mm")," "),i(4),m(" -",l.formatPrice(e.amountCents,l.order.currency)," "),i(),_(e.refundMode?11:-1),i(),_(l.getRefundHistoryReferenceValue(e)?12:-1)}}function ui(t,n){if(t&1&&(a(0,"div",47),D(1,mi,13,8,"div",124,F),r()),t&2){let e=c(2);i(),O(e.refundHistory)}}function gi(t,n){if(t&1&&(a(0,"div",129)(1,"div",130),g(2,"i"),r(),a(3,"div",131)(4,"div",132),o(5),r(),a(6,"div",16),o(7),s(8,"date"),r()()()),t&2){let e=n.$implicit;V("timeline__item--success",e.severity==="success")("timeline__item--danger",e.severity==="danger")("timeline__item--info",e.severity==="info"),i(2),$("pi ",e.icon,""),i(3),m(" ",e.label," "),i(2),m(" ",b(8,11,e.date,"dd/MM/yyyy HH:mm")," ")}}function Ci(t,n){if(t&1){let e=f();h(0,tt,11,7,"div",11),a(1,"div",12)(2,"div",13)(3,"p-panel",14),s(4,"translate"),a(5,"div",15)(6,"span",16),o(7),s(8,"translate"),s(9,"date"),r(),a(10,"span",16),o(11),s(12,"slice"),r()(),a(13,"div",17)(14,"span",16),o(15),s(16,"translate"),r(),g(17,"p-tag",9),r()(),a(18,"p-panel",14),s(19,"translate"),D(20,dt,13,7,"div",18,Ye),a(22,"div",19)(23,"div",20)(24,"span",21),o(25),s(26,"translate"),r(),a(27,"span"),o(28),r()(),h(29,pt,6,4,"div",20)(30,ct,6,4,"div",20),a(31,"div",22)(32,"span"),o(33,"Total"),r(),a(34,"span"),o(35),r()(),h(36,gt,16,11),r()(),a(37,"p-panel",14),s(38,"translate"),h(39,xt,4,4)(40,vt,5,3,"div",23)(41,ft,3,3,"p",24),r(),h(42,wt,4,4,"p-
1panel",14)(43,bt,4,5,"p-panel",14)(44,It,11,12,"div",25),a(45,"p-panel",26),h(46,Dt,6,4,"ng-template",27),a(47,"app-widget-chat",28,0),s(49,"translate"),v("messageSent",function(p){S(e);let E=c();return x(E.onChatMessageSent(p))}),r(),h(50,Ot,4,3,"div",29)(51,Nt,4,3,"div",30),r()(),a(52,"div",31)(53,"p-panel",14),s(54,"translate"),a(55,"div",32),h(56,Ut,11,6,"div",33)(57,kt,11,6,"div",33)(58,Vt,10,6,"div",34)(59,Ht,11,6,"div",33)(60,Lt,11,9,"div",33)(61,Gt,10,9,"div",34)(62,Bt,11,6,"div",35),r(),h(63,Ft,5,3,"div",36),r(),a(64,"p-panel",14),s(65,"translate"),a(66,"div",37)(67,"div",38),h(68,Wt,1,2,"img",39)(69,$t,3,3,"div",40),a(70,"div",41),o(71),r(),a(72,"a",42),o(73),r()(),h(74,jt,7,6,"div",43)(75,zt,4,3,"div",43),a(76,"a",44),g(77,"i",45),o(78),s(79,"translate"),r()()(),h(80,Jt,6,8,"p-panel",14)(81,ni,10,11,"p-panel",14)(82,si,10,11,"p-panel",14),a(83,"p-panel",14),s(84,"translate"),h(85,di,1,0,"p-skeleton",46)(86,pi,3,3,"p",24)(87,ui,3,0,"div",47),r(),a(88,"p-panel",14),s(89,"translate"),a(90,"div",48),D(91,gi,9,14,"div",49,Qe),r()()()()}if(t&2){let e=c();_(e.order.status==="open_cart"?0:-1),i(3),u("toggleable",!1)("header",d(4,59,"MANAGER.PURCHASES.ORDER_SUMMARY")),i(4),A("",d(8,61,"MANAGER.PURCHASES.COL_DATE")," : ",b(9,63,e.order.createdAt,"dd/MM/yyyy HH:mm"),""),i(4),m("ID : ",N(12,66,e.order.id,0,8),""),i(4),C(d(16,70,"MANAGER.PURCHASES.CURRENT_STATUS")),i(2),u("severity",e.getStatusSeverity(e.order.status))("value",e.getStatusLabel(e.order.status)),i(),u("toggleable",!1)("header",d(19,72,"MANAGER.PURCHASES.ITEMS_TITLE")),i(2),O(e.order.lineItems),i(5),C(d(26,74,"MANAGER.PURCHASES.SUBTOTAL")),i(3),C(e.formatPrice(e.order.subtotalCents,e.order.currency)),i(),_(e.order.shippingCents>0?29:-1),i(),_(e.order.discountCents>0?30:-1),i(5),C(e.formatPrice(e.order.totalCents,e.order.currency)),i(),_((e.order.refundedAmountCents||0)>0?36:-1),i(),u("toggleable",!1)("header",d(38,76,"MANAGER.PURCHASES.TRACKING")),i(2),_(e.order.carrier||e.order.trackingNumber||e.order.trackingUrl?39:e.isAllVirtual?40:41),i(3),_(e.order.shipments!=null&&e.order.shipments.length?42:-1),i(),_(e.visibleSellerNote?43:-1),i(),_(e.existingDispute?44:-1),i(),u("toggleable",!1),i(2),u("ticket",e.orderTicket)("loading",e.loadingTicket)("compact",!0)("allowInitialMessage",!0)("emptyStateHint",d(49,78,"MANAGER.PURCHASES.NO_MESSAGES")),i(3),_(e.orderTicket&&!e.existingDispute&&!e.canOpenDispute&&(e.orderTicket.lastMessage==null?null:e.orderTicket.lastMessage.senderType)!=="seller"?50:-1),i(),_(e.canOpenDispute?51:-1),i(2),u("toggleable",!1)("header",d(54,80,"MANAGER.PURCHASES.ACTIONS")),i(3),_(e.canDownloadReceipt?56:-1),i(),_(e.invoice?57:-1),i(),_(e.showsInvoicePendingInfo?58:-1),i(),_(e.canReportProblem?59:-1),i(),_(e.canRequestCancellation?60:-1),i(),_(e.isWaitingForEscalation?61:-1),i(),_(e.canOpenDispute?62:-1),i(),_(e.hasActionItems?-1:63),i(),u("toggleable",!1)("header",d(65,82,"MANAGER.PURCHASES.SELLER_CARD")),i(4),_(e.order.sellerInfo!=null&&e.order.sellerInfo.avatarUrl?68:69),i(3),m(" ",(e.order.sellerInfo==null?null:e.order.sellerInfo.displayName)||e.order.bioPageUsername," "),i(),u("href","/@"+e.order.bioPageUsername+"/bio?v=shop",y),i(),A(" ","@","",e.order.bioPageUsername," "),i(),_(e.order.sellerInfo&&e.order.sellerInfo.reviewCount>0?74:75),i(2),u("href","/@"+e.order.bioPageUsername+"/bio?v=shop",y),i(2),m(" ",d(79,84,"MANAGER.PURCHASES.VIEW_SHOP")," "),i(2),_(e.order.servicePointAddress?80:-1),i(),_(e.order.shippingAddress&&!e.order.servicePointAddress?81:-1),i(),_(e.order.billingAddress?82:-1),i(),u("toggleable",!1)("header",d(84,86,"MANAGER.PURCHASES.REFUND_HISTORY_TITLE")),i(2),_(e.loadingRefundHistory?85:e.refundHistory.length===0?86:87),i(3),u("toggleable",!1)("header",d(89,88,"MANAGER.PURCHASES.TIMELINE_TITLE")),i(3),O(e.timelineEvents)}}function Ei(t,n){if(t&1){let e=f();a(0,"div",147),g(1,"img",148),a(2,"button",149),v("click",function(){let p=S(e).$index,E=c(3);return x(E.removeReportFile(p))}),g(3,"i",150),r()()}if(t&2){let e=n.$implicit;i(),u("src",e,y)}}function hi(t,n){if(t&1&&(a(0,"div",142),D(1,Ei,4,1,"div",147,G),r()),t&2){let e=c(2);i(),O(e.reportFileUrls)}}function Si(t,n){if(t&1){let e=f();a(0,"p-button",151),s(1,"translate"),v("onClick",function(){S(e);let p=c(2);return x(p.showReportDialog=!1)}),r(),a(2,"p-button",152),s(3,"translate"),v("onClick",function(){S(e);let p=c(2);return x(p.submitReport())}),r()}if(t&2){let e=c(2);u("label",d(1,5,"COMMON.CANCEL"))("text",!0),i(2),u("label",d(3,7,"MANAGER.PURCHASES.REPORT_SUB
1MIT"))("loading",e.reportSubmitting)("disabled",!e.reportMessage.trim())}}function xi(t,n){if(t&1){let e=f();a(0,"p-dialog",133),s(1,"translate"),w("visibleChange",function(p){S(e);let E=c();return T(E.showReportDialog,p)||(E.showReportDialog=p),x(p)}),a(2,"div",134)(3,"div",135)(4,"small",21),o(5),s(6,"translate"),r(),a(7,"div",57),o(8),s(9,"slice"),r()(),a(10,"div",136)(11,"label",137),o(12),s(13,"translate"),r(),a(14,"p-select",138),w("ngModelChange",function(p){S(e);let E=c();return T(E.reportReason,p)||(E.reportReason=p),x(p)}),r()(),a(15,"div",136)(16,"label",137),o(17),s(18,"translate"),r(),a(19,"textarea",139),s(20,"translate"),w("ngModelChange",function(p){S(e);let E=c();return T(E.reportMessage,p)||(E.reportMessage=p),x(p)}),r()(),a(21,"div",136)(22,"label",140),o(23),s(24,"translate"),r(),a(25,"p",141),o(26),s(27,"translate"),r(),h(28,hi,3,0,"div",142),a(29,"label",143),g(30,"i",144),o(31),s(32,"translate"),a(33,"input",145),v("change",function(p){S(e);let E=c();return x(E.onReportFilesSelected(p))}),r()()(),a(34,"div",146),g(35,"i",97),o(36),s(37,"translate"),r()(),h(38,Si,4,9,"ng-template",null,1,L),r()}if(t&2){let e=c();H(U(42,B)),u("header",d(1,20,"MANAGER.PURCHASES.REPORT_PROBLEM")),P("visible",e.showReportDialog),u("modal",!0),i(5),C(d(6,22,"MANAGER.PURCHASES.COL_ORDER")),i(3),A(" ",N(9,24,e.order.id,0,8),"... - ",e.formatPrice(e.order.totalCents,e.order.currency)," "),i(4),C(d(13,28,"MANAGER.PURCHASES.REPORT_TYPE_LABEL")),i(2),P("ngModel",e.reportReason),u("options",e.reportReasonOptions),i(3),C(d(18,30,"MANAGER.PURCHASES.REPORT_MESSAGE_LABEL")),i(2),P("ngModel",e.reportMessage),u("rows",4)("placeholder",d(20,32,"MANAGER.PURCHASES.REPORT_MESSAGE_PLACEHOLDER")),i(4),C(d(24,34,"MANAGER.PURCHASES.REPORT_PHOTOS_LABEL")),i(3),m(" ",d(27,36,"MANAGER.PURCHASES.REPORT_PHOTOS_HINT")," "),i(2),_(e.reportFiles.length>0?28:-1),i(3),m("",d(32,38,"MANAGER.PURCHASES.REPORT_ADD_PHOTOS")," "),i(5),m(" ",d(37,40,"MANAGER.PURCHASES.REPORT_INFO")," ")}}function vi(t,n){if(t&1){let e=f();a(0,"p-button",151),s(1,"translate"),v("onClick",function(){S(e);let p=c(2);return x(p.showDisputeDialog=!1)}),r(),a(2,"p-button",155),s(3,"translate"),v("onClick",function(){S(e);let p=c(2);return x(p.submitDispute())}),r()}if(t&2){let e=c(2);u("label",d(1,5,"COMMON.CANCEL"))("text",!0),i(2),u("label",d(3,7,"DISPUTES.SUBMIT_DISPUTE"))("loading",e.disputeSubmitting)("disabled",!e.disputeMessage.trim())}}function fi(t,n){if(t&1){let e=f();a(0,"p-dialog",133),s(1,"translate"),w("visibleChange",function(p){S(e);let E=c();return T(E.showDisputeDialog,p)||(E.showDisputeDialog=p),x(p)}),a(2,"div",153)(3,"small",21),o(4),s(5,"translate"),r(),a(6,"div",57),o(7),s(8,"slice"),r()(),a(9,"div",136)(10,"label",137),o(11),s(12,"translate"),r(),a(13,"p-select",138),w("ngModelChange",function(p){S(e);let E=c();return T(E.disputeReason,p)||(E.disputeReason=p),x(p)}),r()(),a(14,"div",154)(15,"label",137),o(16),s(17,"translate"),r(),a(18,"textarea",139),s(19,"translate"),w("ngModelChange",function(p){S(e);let E=c();return T(E.disputeMessage,p)||(E.disputeMessage=p),x(p)}),r()(),a(20,"div",146),g(21,"i",97),o(22),s(23,"translate"),r(),h(24,vi,4,9,"ng-template",null,1,L),r()}if(t&2){let e=c();H(U(32,B)),u("header",d(1,16,"DISPUTES.DIALOG_TITLE")),P("visible",e.showDisputeDialog),u("modal",!0),i(4),C(d(5,18,"MANAGER.PURCHASES.COL_ORDER")),i(3),A(" ",N(8,20,e.order.id,0,8),"... - ",e.formatPrice(e.order.totalCents,e.order.currency)," "),i(4),C(d(12,24,"DISPUTES.REASON_LABEL")),i(2),P("ngModel",e.disputeReason),u("options",e.disputeReasonOptions),i(3),C(d(17,26,"DISPUTES.MESSAGE_LABEL")),i(2),P("ngModel",e.disputeMessage),u("rows",4)("placeholder",d(19,28,"DISPUTES.MESSAGE_PLACEHOLDER")),i(4),m(" ",d(23,30,"DISPUTES.DIALOG_INFO")," ")}}function Ri(t,n){if(t&1){let e=f();a(0,"p-button",151),s(1,"translate"),v("onClick",function(){S(e);let p=c(2);return x(p.showCancelRequestDialog=!1)}),r(),a(2,"p-button",156),s(3,"translate"),v("onClick",function(){S(e);let p=c(2);return x(p.submitCancelRequest())}),r()}if(t&2){let e=c(2);u("label",d(1,4,"COMMON.CANCEL"))("text",!0),i(2),u("label",d(3,6,"MANAGER.PURCHASES.CANCEL_REQUEST_SUBMIT"))("loading",e.cancelRequestSubmitting)}}function Ai(t,n){if(t&1){let e=f();a(0,"p-dialog",133),s(1,"translate"),w("visibleChange",function(p){S(e);let E=c();return T(E.showCancelRequestDialog,p)||(E.showCancelRequestDialog=p),x(p)}),a(2,"div",134)(3,"div",135)(4,"small",21),o(5),s(6,"translate"),r(),a(7,"div",57),o(8),s(9,"slice"),r()(),a(10,"div",136)(11,"label",137),o(12),s(13,"translate"),r(),a(14,"p-select",138),w("ngModelChange",function(p){S(e);let E=c();return T(E.cancelRequestReason,p)||(E.cancelRequestReason=p),x(p)}),r()(),a(15,"div",136)(16,"label",137),o(17),s(18,"translate"),r(),a(19,"textarea",139),s(20,"translate"),w("ngModelChange",function(p){S(e);let E=c();return T(E.cancelRequestMessage,p)||(E.cancelRequestMessage=p),x(p)}),r()(),a(21,"div",146),g(22,"i",97),o(23),s(24,"translate"),r()(),h(25,Ri,4,8,"ng-template",null,1,L),r()}if(t&2){let e=c();H(U(32,B)),u("header",d(1,16,"MANAGER.PURCHASES.CANCEL_REQUEST_TITLE")),P("visible",e.showCancelRequestDialog),u("modal",!0),i(5),C(d(6,18,"MANAGER.PURCHASES.COL_ORDER")),i(3),A(" ",N(9,20,e.order.id,0,8),"... - ",e.formatPrice(e.order.totalCents,e.order.currency)," "),i(4),C(d(13,24,"MANAGER.PURCHASES.CANCEL_REASON_LABEL")),i(2),P("ngModel",e.cancelRequestReason),u("options",e.cancelRequestReasonOptions),i(3),C(d(18,26,"MANAGER.PURCHASES.CANCEL_REQUEST_MESSAGE_LABEL")),i(2),P("ngModel",e.cancelRequestMessage),u("rows",4)("placeholder",d(20,28,"MANAGER.PURCHASES.CANCEL_REQUEST_MESSAGE_PLACEHOLDER")),i(4),m(" ",d(24,30,"MANAGER.PURCHASES.CANCEL_REQUEST_INFO")," ")}}
1var He=class t{route=I(ie);router=I(ne);shopService=I(Ne);ticketService=I(ke);disputeService=I(Ve);toastService=I(pe);confirmService=I(be);t=I(le);Math=Math;loading=!0;error=null;order=null;orderId="";chatWidget;orderTicket=null;loadingTicket=!1;socketSubscription=null;timelineEvents=[];refundHistory=[];loadingRefundHistory=!1;invoice=null;loadingInvoice=!1;downloadTokens=[];loadingDownloads=!1;existingDispute=null;loadingDispute=!1;showReportDialog=!1;reportMessage="";reportSubmitting=!1;reportReason="other";reportReasonOptions=[];reportFiles=[];reportFileUrls=[];showDisputeDialog=!1;disputeReason="other";disputeMessage="";disputeSubmitting=!1;disputeReasonOptions=[];showCancelRequestDialog=!1;cancelRequestMessage="";cancelRequestSubmitting=!1;cancelRequestReason="";cancelRequestReasonOptions=[];ESCALATION_DELAY_MS=48*60*60*1e3;WITHDRAWAL_PERIOD_MS=14*24*60*60*1e3;get isOrderEligible(){return!!this.order&&!this.existingDispute&&["paid","processing","shipped","delivered","return_in_transit","returned"].includes(this.order.status)}get canReportProblem(){return this.isOrderEligible&&!this.orderTicket}get canRequestCancellation(){if(!this.order||this.orderTicket||!["paid","processing","open_cart"].includes(this.order.status))return!1;let n=this.order.paidAt||this.order.createdAt;return Date.now()-new Date(n).getTime()<=this.WITHDRAWAL_PERIOD_MS}get remainingWithdrawalDays(){if(!this.order)return 0;let n=this.order.paidAt||this.order.createdAt,e=Date.now()-new Date(n).getTime(),l=this.WITHDRAWAL_PERIOD_MS-e;return Math.max(0,Math.ceil(l/(24*60*60*1e3)))}get canOpenDispute(){return!this.isOrderEligible||!this.orderTicket?!1:Date.now()-new Date(this.orderTicket.createdAt).getTime()>this.ESCALATION_DELAY_MS}get isWaitingForEscalation(){return!this.isOrderEligible||!this.orderTicket||this.existingDispute?!1:Date.now()-new Date(this.orderTicket.createdAt).getTime()<=this.ESCALATION_DELAY_MS}get remainingEscalationTime(){if(!this.orderTicket)return"";let n=Date.now()-new Date(this.orderTicket.createdAt).getTime(),e=Math.max(0,this.ESCALATION_DELAY_MS-n),l=Math.floor(e/(60*60*1e3)),p=Math.floor(e%(60*60*1e3)/(60*1e3));return l>0?`${l}h${p>0?p.toString().padStart(2,"0"):""}`:`${p}min`}get canDownloadReceipt(){return!!this.order&&["shipped","delivered","return_in_transit","returned"].includes(this.order.status)}get showsInvoicePendingInfo(){return!this.canDownloadReceipt&&!this.invoice&&!!this.order&&["paid","processing"].includes(this.order.status)}get hasActionItems(){return this.canDownloadReceipt||!!this.invoice||this.showsInvoicePendingInfo||this.canReportProblem||this.canRequestCancellation||this.isWaitingForEscalation||this.canOpenDispute}ngOnInit(){if(this.orderId=this.route.snapshot.paramMap.get("id")||"",!this.orderId){this.router.navigate(["/studio/purchases"]);return}this.reportReasonOptions=[{label:this.t.instant("MANAGER.PURCHASES.PROBLEM_NOT_RECEIVED"),value:"not_received"},{label:this.t.instant("MANAGER.PURCHASES.PROBLEM_NOT_AS_DESCRIBED"),value:"not_as_described"},{label:this.t.instant("MANAGER.PURCHASES.PROBLEM_DEFECTIVE"),value:"defective"},{label:this.t.instant("MANAGER.PURCHASES.PROBLEM_WRONG_ITEM"),value:"wrong_item"},{label:this.t.instant("MANAGER.PURCHASES.PROBLEM_PARTIAL_ORDER"),value:"partial_order"},{label:this.t.instant("MANAGER.PURCHASES.PROBLEM_OTHER"),value:"other"}],this.disputeReasonOptions=[{label:this.t.instant("DISPUTES.REASON_NOT_RECEIVED"),value:"not_received"},{label:this.t.instant("DISPUTES.REASON_NOT_AS_DESCRIBED"),value:"not_as_described"},{label:this.t.instant("DISPUTES.REASON_DEFECTIVE"),value:"defective"},{label:this.t.instant("DISPUTES.REASON_WRONG_ITEM"),value:"wrong_item"},{label:this.t.instant("DISPUTES.REASON_COUNTERFEIT"),value:"counterfeit"},{label:this.t.instant("DISPUTES.REASON_PARTIAL_ORDER"),value:"partial_order"},{label:this.t.instant("DISPUTES.REASON_OTHER"),value:"other"}],this.cancelRequestReasonOptions=[{label:this.t.instant("MANAGER.PURCHASES.CANCEL_REASON_CHANGED_MIND"),value:"changed_mind"},{label:this.t.instant("MANAGER.PURCHASES.CANCEL_REASON_ORDERED_MISTAKE"),value:"ordered_by_mistake"},{label:this.t.instant("MANAGER.PURCHASES.CANCEL_REASON_DELIVERY_TOO_LONG"),value:"delivery_too_long"},{label:this.t.instant("MANAGER.PURCHASES.CANCEL_REASON_FOUND_CHEAPER"),value:"found_cheaper"},{label:this.t.instant("MANAGER.PURCHASES.CANCEL_REASON_OTHER"),value:"other"}],this.loadOrder(),this.connectSocket()}ngOnDestroy(){this.socketSubscription&&(this.socketSubscription.close(),this.socketSubscription=null)}loadOrder(){return R(this,null,function*(){this.loading=!0,this.error=null;try{this.order=yield this.shopService.getPurchase(this.orderId),this.buildTimeline(),this.loadRefundHistory(),this.loadOrderTicket(),this.loadExistingDispute(),this.loadInvoice(),this.loadDownloadTokens()}catch{this.error="load"}finally{this.loading=!1}})}loadExistingDispute(){return R(this,null,function*(){this.loadingDispute=!0;try{let n=yield this.disputeService.getDisputeByOrder(this.orderId);this.existingDispute=n.dispute}catch{}finally{this.loadingDispute=!1}})}openReportDialog(){this.reportMessage="",this.reportReason="other",this.reportFiles=[],this.reportFileUrls.forEac
1h(n=>URL.revokeObjectURL(n)),this.reportFileUrls=[],this.reportSubmitting=!1,this.showReportDialog=!0}onReportFilesSelected(n){let e=n.target;if(e.files){for(let l of Array.from(e.files))this.reportFiles.push(l),this.reportFileUrls.push(URL.createObjectURL(l));e.value=""}}removeReportFile(n){this.reportFiles.splice(n,1),URL.revokeObjectURL(this.reportFileUrls[n]),this.reportFileUrls.splice(n,1)}buildReportMessage(n){let e=this.order,l=[];l.push(`${this.t.instant("MANAGER.PURCHASES.REPORT_MSG_HEADER")}`),l.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),l.push(""),l.push(`${this.t.instant("MANAGER.PURCHASES.REPORT_MSG_ORDER_REF")} : #${e.id.substring(0,8)}`),l.push(`${this.t.instant("MANAGER.PURCHASES.REPORT_MSG_ORDER_DATE")} : ${new Date(e.createdAt).toLocaleDateString()}`),l.push(`${this.t.instant("MANAGER.PURCHASES.REPORT_MSG_PROBLEM_TYPE")} : ${n}`),l.push(`${this.t.instant("MANAGER.PURCHASES.REPORT_MSG_AMOUNT")} : ${this.formatPrice(e.totalCents,e.currency)}`),l.push(""),l.push(`${this.t.instant("MANAGER.PURCHASES.REPORT_MSG_ITEMS")} :`);for(let p of e.lineItems)l.push(` \u2022 ${p.title} (x${p.quantity}) \u2014 ${this.formatPrice(p.totalCents,e.currency)}`);return l.push(""),l.push(`${this.t.instant("MANAGER.PURCHASES.REPORT_MSG_DESCRIPTION")} :`),l.push(this.reportMessage.trim()),this.reportFiles.length>0&&(l.push(""),l.push(`\u{1F4F7} ${this.t.instant("MANAGER.PURCHASES.REPORT_MSG_PHOTOS_COUNT",{count:this.reportFiles.length})}`)),l.join(` 2`)}submitReport(){return R(this,null,function*(){if(!(!this.order||!this.reportMessage.trim()||this.orderTicket)){this.reportSubmitting=!0;try{let n=this.reportReasonOptions.find(M=>M.value===this.reportReason)?.label||"",e=`${this.t.instant("MANAGER.PURCHASES.REPORT_PROBLEM")} (${n}) \u2014 #${this.orderId.substring(0,8)}`,l=this.buildReportMessage(n),p=yield this.ticketService.create({subject:e,message:l,orderId:this.orderId});if(this.reportFiles.length>0){let M=yield this.ticketService.uploadImages(p.ticketId,this.reportFiles);M.length>0&&(yield this.ticketService.reply(p.ticketId,{message:this.t.instant("MANAGER.PURCHASES.REPORT_PHOTOS_ATTACHED"),attachments:M}))}let E=yield this.ticketService.findOne(p.ticketId);this.orderTicket=E.ticket,this.showReportDialog=!1,this.toastService.success(this.t.instant("MANAGER.PURCHASES.PROBLEM_REPORTED"))}catch{this.toastService.error(this.t.instant("COMMON.ERROR"))}finally{this.reportSubmitting=!1}}})}openCancelRequestDialog(){this.cancelRequestMessage="",this.cancelRequestReason="changed_mind",this.cancelRequestSubmitting=!1,this.showCancelRequestDialog=!0}buildCancelRequestMessage(n){let e=this.order,l=[];l.push(`${this.t.instant("MANAGER.PURCHASES.CANCEL_MSG_HEADER")}`),l.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),l.push(""),l.push(`${this.t.instant("MANAGER.PURCHASES.CANCEL_MSG_ORDER_REF")} : #${e.id.substring(0,8)}`),l.push(`${this.t.instant("MANAGER.PURCHASES.CANCEL_MSG_ORDER_DATE")} : ${new Date(e.createdAt).toLocaleDateString()}`),l.push(`${this.t.instant("MANAGER.PURCHASES.CANCEL_MSG_REASON")} : ${n}`),l.push(`${this.t.instant("MANAGER.PURCHASES.CANCEL_MSG_AMOUNT")} : ${this.formatPrice(e.totalCents,e.currency)}`),l.push(""),l.push(`${this.t.instant("MANAGER.PURCHASES.CANCEL_MSG_ITEMS")} :`);for(let p of e.lineItems)l.push(` \u2022 ${p.title} (x${p.quantity}) \u2014 ${this.formatPrice(p.totalCents,e.currency)}`);return l.push(""),this.cancelRequestMessage.trim()&&(l.push(`${this.t.instant("MANAGER.PURCHASES.CANCEL_MSG_DESCRIPTION")} :`),l.push(this.cancelRequestMessage.trim())),l.join(` 3`)}submitCancelRequest(){return R(this,null,function*(){if(!(!this.order||this.orderTicket)){this.cancelRequestSubmitting=!0;try{let n=this.cancelRequestReasonOptions.find(M=>M.value===this.cancelRequestReason)?.label||"",e=`${this.t.instant("MANAGER.PURCHASES.CANCEL_REQUEST_TITLE")} \u2014 #${this.orderId.substring(0,8)}`,l=this.buildCancelRequestMessage(n),p=yield this.ticketService.create({subject:e,message:l,orderId:this.orderId}),E=yield this.ticketService.findOne(p.ticketId);this.orderTicket=E.ticket,this.showCancelRequestDialog=!1,this.toastService.success(this.t.instant("MANAGER.PURCHASES.CANCEL_REQUEST_SUCCESS"))}catch{this.toastService.error(this.t.instant("COMMON.ERROR"))}finally{this.cancelRequestSubmitting=!1}}})}openDisputeDialog(){this.disputeReason="other",this.disputeMessage="",this.disputeSubmitting=!1,this.showDisputeDialog=!0}submitDispute(){return R(this,null,function*(){if(!(!this.order||!this.disputeMessage.trim())){this.disputeSubmitting=!0;try{let n={orderId:this.order.id,reason:this.disputeReason,message:this.disputeMessage.trim()}
3,e=yield this.disputeService.openDispute(n);this.toastService.success(this.t.instant("DISPUTES.OPENED_SUCCESS")),this.showDisputeDialog=!1,this.router.navigate(["/studio/disputes",e.disputeId])}catch(n){this.toastService.error(n?.error?.message||this.t.instant("COMMON.ERROR"))}finally{this.disputeSubmitting=!1}}})}loadOrderTicket(){return R(this,null,function*(){this.loadingTicket=!0;try{let n=yield this.ticketService.findAll({orderId:this.orderId,contextType:"inquiry",limit:1});if(n.data.length>0){let e=yield this.ticketService.findOne(n.data[0].id);this.orderTicket=e.ticket}}catch{}finally{this.loadingTicket=!1}})}onChatMessageSent(n){return R(this,null,function*(){try{let{files:e}=this.chatWidget?.detachSelectedImages()||{files:[]};if(!this.orderTicket){let E=`${this.t.instant("MANAGER.PURCHASES.DETAIL_TITLE")} #${this.orderId.substring(0,8)}`,M=yield this.ticketService.create({subject:E,message:n.message,orderId:this.orderId}),Le=yield this.ticketService.findOne(M.ticketId);if(this.orderTicket=Le.ticket,e.length>0){let Ge=yield this.ticketService.uploadImages(M.ticketId,e),Be=yield this.ticketService.reply(M.ticketId,{message:"",attachments:Ge});this.orderTicket.messages&&(this.orderTicket.messages=[...this.orderTicket.messages,Be.message]),this.orderTicket.messageCount+=1}this.chatWidget?.resetForm(),this.toastService.success(this.t.instant("MANAGER.PURCHASES.MESSAGE_SENT"));return}let l;e.length>0&&(l=yield this.ticketService.uploadImages(this.orderTicket.id,e));let p=yield this.ticketService.reply(this.orderTicket.id,{message:n.message,attachments:l});if(this.orderTicket.messages){let E=this.orderTicket.messages.findIndex(M=>M.id===p.message.id);E>=0?(this.orderTicket.messages[E]=p.message,this.orderTicket.messages=[...this.orderTicket.messages]):(this.orderTicket.messages=[...this.orderTicket.messages,p.message],this.orderTicket.messageCount+=1)}this.chatWidget?.resetForm()}catch{this.chatWidget?.markSendingDone(),this.toastService.error(this.t.instant("COMMON.ERROR"))}})}connectSocket(){this.socketSubscription||(this.socketSubscription=this.ticketService.connectStream(n=>{if(n.type==="new_message"&&n.message&&this.orderTicket&&this.orderTicket.id===n.ticketId)this.orderTicket.messages?.some(l=>l.id===n.message.id)||(this.orderTicket.messages=[...this.orderTicket.messages||[],n.message],this.orderTicket.messageCount+=1,setTimeout(()=>this.chatWidget?.scrollToLatest()));else if(n.type==="link_preview_update"&&n.messageId&&n.linkPreviews&&this.orderTicket&&this.orderTicket.id===n.ticketId){let e=this.orderTicket.messages?.find(l=>l.id===n.messageId);e&&(e.linkPreviews=n.linkPreviews)}}))}buildTimeline(){if(!this.order)return;let n=[];n.push({label:this.t.instant("MANAGER.PURCHASES.TIMELINE_ORDERED"),date:this.order.createdAt,icon:"pi-shopping-cart",severity:""}),this.order.paidAt&&n.push({label:this.t.instant("MANAGER.PURCHASES.TIMELINE_PAID"),date:this.order.paidAt,icon:"pi-credit-card",severity:"success"}),this.order.shippedAt&&n.push({label:this.t.instant("MANAGER.PURCHASES.TIMELINE_SHIPPED"),date:this.order.shippedAt,icon:"pi-truck",severity:"info"}),this.order.deliveredAt&&n.push({label:this.t.instant("MANAGER.PURCHASES.TIMELINE_DELIVERED"),date:this.order.deliveredAt,icon:"pi-check-circle",severity:"success"}),this.order.cancelledAt&&n.push({label:this.t.instant("MANAGER.PURCHASES.TIMELINE_CANCELLED"),date:this.order.cancelledAt,icon:"pi-times-circle",severity:"danger"}),this.order.refundedAt&&n.push({label:this.t.instant("MANAGER.PURCHASES.TIMELINE_REFUNDED"),date:this.order.refundedAt,icon:"pi-replay",severity:"danger"}),this.timelineEvents=n}downloadReceipt(){return R(this,null,function*(){if(this.order)try{let n=yield this.shopService.getPurchaseReceiptUrl(this.order.id);n.receiptUrl?window.open(n.receiptUrl,"_blank"):this.toastService.warn(this.t.instant("MANAGER.PURCHASES.NO_RECEIPT"))}catch{this.toastService.error(this.t.instant("COMMON.ERROR"))}})}loadInvoice(){return R(this,null,function*(){this.loadingInvoice=!0;try{this.invoice=yield this.shopService.getPurchaseInvoiceInfo(this.orderId)}catch{}finally{this.loadingInvoice=!1}})}loadDownloadTokens(){return R(this,null,function*(){this.loadingDownloads=!0;try{this.downloadTokens=yield this.shopService.getOrderDownloadTokens(this.orderId)}catch{this.downloadTokens=[]}finally{this.loadingDownloads=!1}})}getDownloadUrl(n){return`${oe.api}/api/shop/download/${n.token}`}getTokensForProduct(n){return this.downloadTokens.filter(e=>e.productId===n)}loadRefundHistory(){return R(this,null,function*(){this.loadingRefundHistory=!0;try{this.refundHistory=yield this.shopService.getPurchaseRefundHistory(this.orderId)}catch{this.refundHistory=[]}finally{this.loadingRefundHistory=!1}})}downloadInvoice(){return R(this,null,function*(){try{let n=yield this.shopService.downloadPurchaseInvoice(this.orderId),e=URL.createObjectURL(n),l=document.createElement("a");l.href=e,l.download=`${this.invoice?.invoiceNumber||"facture"}.pdf`,l.click(),URL.revokeObjectURL(e)}catch{this.toastService.error(this.t.instant("COMMON.ERROR"))}})}closeCart(){return R(this,null,function*(){if(!(!this.order||this.order.status!=="open_cart"||!(yield this.confirmService.confirm({message:this.t.instant("MANAGER.PURCHASES.CLOSE_CART_CONFIRM"),header:this.t.instant("MANAGER.PURCHASES.CLOSE_CART_TITLE"),severity:"info",acceptLabel:this.t.instant("MANAGER.PURCHASES.CLOSE_CART_ACCEPT"),rejectLabel:this.t.instant("COMMON.CANCEL")}))))try{yield this.shopService.closePurchaseCart(this.order.id),this.toastService.success(this.t.instant("MANAGER.PURCHASES.CLOSE_CART_SUCCESS")),this.loadOrder()}catch{this.toastService.error(this.t.instant("COMMON.ERROR"))}})}formatPrice(n,e="EUR"){return(n/100).toFixed(2)+" "+e.toUpperCase()}getStatusSeverity(n){return{pending:"warn",open_cart:"warn",paid:"info",processing:"info",shipped:"warn",delivered:"success",cancelled:"danger",refunded:"secondary",partially_refunded:"warn",return_in_transit:"warn",returned:"warn"}[n]||"info"}get visibleSellerNote(){let n=this.order?.sellerNotes?.trim();return!n||n.startsWith("Merged into order ")?null:n}get isAllVirtual(){return this.order?.lineItems?.length?this.order.lineItems.every(n=>n.requiresShipping===!1):!1}getStatusLabel(n){return this.t.instant(`MANAGER.PURCHASES.STATUS_${n.toUpperCase()}`)}getRefundModeLabel(n){switch(n){case"store_credit":return this.t.instant("MANAGER.PURCHASES.REFUND_COMPENSATION_STORE_CREDIT");case"mixed":return this.t.instant("MANAGER.PURCHASES.REFUND_COMPENSATION_MIXED");case"money":default:return this.t.instant("MANAGER.PURCHASES.REFUND_COMPENSATION_MONEY")}}
3getRefundReferenceLabel(){return this.order?.refundStoreCreditCode?this.t.instant("MANAGER.PURCHASES.REFUND_REFERENCE_STORE_CREDIT"):this.order?.refundStripeId?this.t.instant("MANAGER.PURCHASES.REFUND_REFERENCE_STRIPE"):null}getRefundReferenceValue(){return this.order?.refundStoreCreditCode||this.order?.refundStripeId||null}getRefundHistoryTypeLabel(n){return n==="partial"?this.t.instant("MANAGER.PURCHASES.REFUND_HISTORY_TYPE_PARTIAL"):this.t.instant("MANAGER.PURCHASES.REFUND_HISTORY_TYPE_FULL")}getRefundHistoryReferenceLabel(n){return n.storeCreditCode?this.t.instant("MANAGER.PURCHASES.REFUND_REFERENCE_STORE_CREDIT"):n.stripeRefundId?this.t.instant("MANAGER.PURCHASES.REFUND_REFERENCE_STRIPE"):null}getRefundHistoryReferenceValue(n){return n.storeCreditCode||n.stripeRefundId||null}getDisputeStatusSeverity(n){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"}[n]||"info"}getDisputeStatusLabel(n){return this.t.instant(`DISPUTES.STATUS_${n.toUpperCase()}`)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=W({type:t,selectors:[["app-view-manager-purchase-detail"]],viewQuery:function(e,l){if(e&1&&q(Fe,5),e&2){let p;j(p=z())&&(l.chatWidget=p.first)}},decls:16,vars:13,consts:[["chatWidget",""],["footer",""],[1,"d-flex","justify-content-between","align-items-center","mb-2","flex-wrap","gap-2"],[1,"text-light","fs-6","d-flex","align-items-center","gap-2"],["routerLink","/studio/purchases","queryParamsHandling","preserve",1,"text-muted","text-decoration-none"],[1,"pi","pi-arrow-left","me-2"],[1,"pi","pi-angle-right","mx-1","text-muted"],[3,"header","visible","modal","style"],[1,"text-muted","ms-1"],[3,"severity","value"],[3,"retry"],[1,"card","mb-4",2,"border-left","4px solid var(--p-orange-500)","background","var(--p-orange-50)"],[1,"row","g-4"],[1,"col-12","col-lg-8"],[3,"toggleable","header"],[1,"d-flex","justify-content-between","align-items-center","flex-wrap","gap-2"],[1,"text-muted","small"],[1,"d-flex","justify-content-between","align-items-center","mt-3"],[1,"line-item"],[1,"totals-section","mt-3","pt-3"],[1,"d-flex","justify-content-between","mb-1"],[1,"text-muted"],[1,"d-flex","justify-content-between","fw-bold","fs-6","mt-2","pt-2","border-top"],[1,"d-flex","align-items-center","gap-2","text-muted","mb-0"],[1,"text-muted","mb-0"],[1,"dispute-banner","mb-3","p-3","border","rounded","d-flex","align-items-center","justify-content-between","gap-2"],[3,"toggleable"],["pTemplate","header"],[3,"messageSent","ticket","loading","compact","allowInitialMessage","emptyStateHint"],[1,"mt-3","p-2","border","rounded","text-muted","small"],[1,"mt-3","p-2","border","rounded","small","dispute-escalation-hint"],[1,"col-12","col-lg-4"],[1,"action-list"],[1,"action-item"],[1,"action-item","action-item--disabled"],[1,"action-item","action-item--danger"],[1,"alert","alert-secondary","d-flex","align-items-center","gap-2","mt-3","mb-0","small"],[1,"shop-card"],[1,"shop-card__identity"],[1,"shop-card__avatar","rounded-circle",3,"src","alt"],[1,"shop-card__avatar","shop-card__avatar--initials","rounded-circle"],[1,"shop-card__name","fw-semibold"],["target","_blank","rel","noopener",1,"shop-card__username","text-muted",3,"href"],[1,"shop-card__rating"],["target","_blank","rel","noopener",1,"shop-card__cta",3,"href"],[1,"pi","pi-external-link"],["height","80px"],[1,"d-flex","flex-column","gap-3"],[1,"timeline"],[1,"timeline__item",3,"timeline__item--success","timeline__item--danger","timeline__item--info"],[1,"card-body","d-flex","align-items-center","justify-content-between","flex-wrap","gap-3"],[1,"fw-semibold","mb-1"],[1,"pi","pi-shopping-cart","me-2"],["icon","pi pi-lock","severity","warn",3,"onClick","label"],[1,"line-item__img",3,"src","alt"],[1,"line-item__img","line-item__img--placeholder"],[1,"line-item__info"],[1,"fw-semibold"],[1,"text-muted","small","mt-1"],[1,"line-item__qty","text-muted"],[1,"line-item__price","fw-semibold"],[1,"line-item__downloads"],[1,"pi","pi-image"],[1,"me-2"],[1,"pi","pi-tag","me-1",2,"font-size","0.75rem"],["target","_blank",1,"line-item__download-btn",3,"href","line-item__download-btn--exhausted"],["target","_blank",1,"line-item__download-btn",3,"href"],[1,"pi","pi-download"],[1,"line-item__download-count"],[1,"text-success"],[1,"d-flex","justify-content-between","mb-1","mt-2"],[1,"text-danger"],[1,"pi","pi-replay","me-1"],[1,"text-danger","fw-semibold"],[1,"d-flex","justify-content-between"],[1,"small","fw-semibold"],[1,"mb-2"],["target","_blank","rel","noopener",1,"d-inline-flex","align-items-center","gap-1",3,"href"],[1,"mb-2","mt-2"],[1,"fw-semibold","ms-1"],[1,"pi","pi-cloud-download"],[1,"mb-3","pb-3",3,"border-bottom"],[1,"mb-3","pb-3"],[1,"d-flex","justify-content-between","align-items-center","mb-2"],[1,"mb-1","small"],["target","_blank","rel","noopener",1,"small","d-inline-flex","align-items-center","gap-1","mb-1",3,"href"],[1,"ms-1"],[1,"mb-0"],[1,"d-flex","align-items-center","gap-2"],[1,"pi","pi-exclamation-triangle","text-warning"],["size","small",3,"severity","value"],["icon","pi pi-arrow-right","severity","warn","size","small",3,"label","outlined","routerLink"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[1,"pi","pi-comments","me-2"],[1,"text-decoration-none",3,"routerLink"],["severity","info",3,"value","rounded"],[1,"pi","pi-clock","me-1"],[1,"pi","pi-info-circle","me-1"],[1,"action-item",3,"click"],[1,"action-item__icon","action-item__icon--secondary"],[1,"pi","pi-file-pdf"],[1,"action-item__text"],[1,"action-item__label"],[1,"action-item__desc"],[1,"pi","pi-download","action-item__arrow"],[1,"action-item__icon","action-item__icon--primary"],[1,"pi","pi-file"],[1,"action-item__icon","action-item__icon--muted"],[1,"pi","pi-info-circle"],[1,"action-item__label","text-muted"],[1,"action-item__icon","action-item__icon--warn"],[1,"pi","pi-exclamation-triangle"],[1,"pi","pi-chevron-right","action-item__arrow"],[1,"action-item__icon","action-item__icon--danger"],[1,"pi","pi-times-circle"],[1,"pi","pi-clock"],[1,"action-item","action-item--danger",3,"click"],[1,"pi","pi-shield"],[1,"shop-card__stars"],[1,"pi",3,"ngClass"],[1,"shop-card__rating-text"],[1,"text-muted",2,"font-size","0.8rem"],[1,"d-flex","align-items-center","gap-1","mt-1"],[1,"fp","fp-rounded",3,"ngClass"],[1,"border","rounded","p-3"],[1,"d-flex","justify-content-between","align-items-start","gap-3","flex-wrap"],[1,"text-end"],[1,"fw-semibold","text-danger"],[1,"d-flex","justify-content-between","gap-3","mt-2","small"],[1,"timeline__item"],[1,"timeline__dot"],[1,"timeline__content"],[1,"fw-semibold","small"],[3,"visibleChange","header","visible","modal"],[1,"pt-3"],[1,"mb-3","p-3","border","rounded"],[1,"mb-3"],[1,"form-label","fw-semibold"],["optionLabel","label","optionValue","value","styleClass","w-100",3,"ngModelChange","ngModel","options"],["pTextarea","",1,"w-100",3,"ngModelChange","ngModel","rows","placeholder"],[1,"form-label","fw-semibold","d-block"],[1,"text-muted","small","mb-2"],[1,"d-flex","flex-wrap","gap-2","mb-2"],[1,"report-photo-add"],[1,"pi","pi-camera","me-2"],["type","file","accept","image/*","multiple","",1,"d-none",3,"change"],[1,"mb-3","p-2","border","rounded","text-muted","small"],[1,"report-photo-preview"],["alt","",1,"report-photo-preview__img",3,"src"],["type","button",1,"report-photo-preview__remove",3,"click"],[1,"pi","pi-times"],["severity","secondary",3,"onClick","label","text"],["icon","pi pi-send","severity","warn",3,"onClick","label","loading","disabled"],[1,"pt-3","mb-3","p-3","border","rounded"],[1,"mb-4"],["icon","pi pi-exclamation-triangle","severity","danger",3,"onClick","label","loading","disabled"],["icon","pi pi-times-circle","severity","danger",3,"onClick","label","loading"]],template:function(e,l){e&1&&(a(0,"div",2)(1,"span",3)(2,"a",4),g(3,"i",5),o(4),s(5,"translate"),r(),g(6,"i",6),o(7
3),s(8,"translate"),h(9,Xe,4,7),r()(),h(10,Je,1,0,"app-widget-loading")(11,Ze,1,0,"app-widget-api-error")(12,Ci,93,90)(13,xi,40,43,"p-dialog",7)(14,fi,26,33,"p-dialog",7)(15,Ai,27,33,"p-dialog",7)),e&2&&(i(4),m("",d(5,9,"MANAGER.PURCHASES.TITLE")," "),i(3),m(" ",d(8,11,"MANAGER.PURCHASES.DETAIL_TITLE")," "),i(2),_(l.order?9:-1),i(),_(l.loading?10:-1),i(),_(!l.loading&&l.error?11:-1),i(),_(!l.loading&&!l.error&&l.order?12:-1),i(),_(l.order?13:-1),i(),_(l.order?14:-1),i(),_(l.order?15:-1))},dependencies:[te,Q,X,K,ee,J,Z,re,ae,ue,ce,_e,me,de,se,he,Ee,ge,Te,Pe,xe,Se,Oe,De,ye,Ie,Me,Ae,Re,fe,ve,Ce,we,Ue],styles:['[_nghost-%COMP%] p-panel+p-panel{display:block;margin-top:1rem}.line-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;padding:.6rem 0;border-bottom:1px solid var(--p-surface-50);flex-wrap:wrap}.line-item[_ngcontent-%COMP%]:last-of-type{border-bottom:none}.line-item__img[_ngcontent-%COMP%]{width:52px;height:52px;border-radius:8px;object-fit:cover;border:1px solid var(--p-surface-border);flex-shrink:0}.line-item__img--placeholder[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;background:var(--p-surface-ground);color:var(--p-text-muted-color);font-size:1.1rem}.line-item__info[_ngcontent-%COMP%]{flex:1;min-width:0}.line-item__qty[_ngcontent-%COMP%]{font-size:.85rem;flex-shrink:0}.line-item__price[_ngcontent-%COMP%]{flex-shrink:0;text-align:right;min-width:80px}.line-item__downloads[_ngcontent-%COMP%]{width:100%;display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}.line-item__download-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;padding:4px 10px;background:linear-gradient(135deg,#eff6ff,#eef2ff);border:1px solid #bfdbfe;border-radius:6px;color:#1e40af;font-size:.78rem;font-weight:500;text-decoration:none;cursor:pointer;transition:background .2s,border-color .2s}.line-item__download-btn[_ngcontent-%COMP%]:hover{background:linear-gradient(135deg,#dbeafe,#e0e7ff);border-color:#93c5fd}.line-item__download-btn[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.75rem}.line-item__download-btn--exhausted[_ngcontent-%COMP%]{opacity:.5;pointer-events:none}.line-item__download-count[_ngcontent-%COMP%]{font-size:.7rem;color:#6b7280}.totals-section[_ngcontent-%COMP%]{border-top:1px solid var(--p-surface-border)}.timeline[_ngcontent-%COMP%]{position:relative;padding-left:1.5rem}.timeline__item[_ngcontent-%COMP%]{position:relative;padding-bottom:1rem;padding-left:.75rem}.timeline__item[_ngcontent-%COMP%]:last-child{padding-bottom:0}.timeline__item[_ngcontent-%COMP%]:before{content:"";position:absolute;left:-1.0625rem;top:.875rem;bottom:0;width:2px;background:var(--p-surface-border)}.timeline__item[_ngcontent-%COMP%]:last-child:before{display:none}.timeline__item--success[_ngcontent-%COMP%] .timeline__dot[_ngcontent-%COMP%]{background:var(--p-green-500);color:#fff}.timeline__item--danger[_ngcontent-%COMP%] .timeline__dot[_ngcontent-%COMP%]{background:var(--p-red-500);color:#fff}.timeline__item--info[_ngcontent-%COMP%] .timeline__dot[_ngcontent-%COMP%]{background:var(--p-blue-500);color:#fff}.timeline__dot[_ngcontent-%COMP%]{position:absolute;left:-1.5rem;top:0;width:.875rem;height:.875rem;border-radius:50%;background:var(--p-surface-300);display:flex;align-items:center;justify-content:center}.timeline__dot[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.5rem}.timeline__content[_ngcontent-%COMP%]{min-width:0}.messages-list[_ngcontent-%COMP%]{max-height:300px;overflow-y:auto;display:flex;flex-direction:column;gap:.5rem}.message[_ngcontent-%COMP%]{padding:.5rem .75rem;border-radius:8px;background:var(--p-surface-ground)}.message--mine[_ngcontent-%COMP%]{background:rgba(var(--p-primary-500-rgb, 99, 102, 241),.08);border-left:3px solid var(--p-primary-color)}.message--system[_ngcontent-%COMP%]{background:rgba(var(--p-yellow-500-rgb, 234, 179, 8),.08);font-style:italic}.message__header[_ngcontent-%COMP%]{margin-bottom:.15rem}.message__content[_ngcontent-%COMP%]{line-height:1.4}.dispute-banner[_ngcontent-%COMP%]{background:rgba(var(--p-yellow-500-rgb, 234, 179, 8),.06);border-color:var(--p-yellow-300)!important}.action-list[_ngcontent-%COMP%]{display:flex;flex-direction:column}.action-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;padding:.65rem .5rem;border-bottom:1px solid var(--p-surface-50);
3cursor:pointer;border-radius:6px;transition:background .15s}.action-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.action-item[_ngcontent-%COMP%]:hover{background:var(--p-surface-ground)}.action-item--danger[_ngcontent-%COMP%]:hover{background:rgba(var(--p-red-500-rgb, 239, 68, 68),.04)}.action-item--disabled[_ngcontent-%COMP%]{cursor:default;opacity:.7}.action-item--disabled[_ngcontent-%COMP%]:hover{background:transparent}.action-item__icon[_ngcontent-%COMP%]{width:36px;height:36px;border-radius:8px;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:.95rem}.action-item__icon--primary[_ngcontent-%COMP%]{background:rgba(var(--p-primary-500-rgb, 99, 102, 241),.1);color:var(--p-primary-600)}.action-item__icon--secondary[_ngcontent-%COMP%]{background:var(--p-surface-100);color:var(--p-text-muted-color)}.action-item__icon--warn[_ngcontent-%COMP%]{background:rgba(var(--p-yellow-500-rgb, 234, 179, 8),.1);color:var(--p-yellow-600)}.action-item__icon--danger[_ngcontent-%COMP%]{background:rgba(var(--p-red-500-rgb, 239, 68, 68),.1);color:var(--p-red-600)}.action-item__icon--muted[_ngcontent-%COMP%]{background:var(--p-surface-100);color:var(--p-surface-400)}.action-item__text[_ngcontent-%COMP%]{flex:1;min-width:0}.action-item__label[_ngcontent-%COMP%]{font-weight:600;font-size:.85rem;line-height:1.3}.action-item__desc[_ngcontent-%COMP%]{font-size:.75rem;color:var(--p-text-muted-color);line-height:1.3}.action-item__arrow[_ngcontent-%COMP%]{font-size:.75rem;color:var(--p-text-muted-color);flex-shrink:0}.shop-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;text-align:center;gap:.5rem}.shop-card__identity[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:.25rem}.shop-card__avatar[_ngcontent-%COMP%]{width:56px;height:56px;object-fit:cover;flex-shrink:0;margin-bottom:.25rem}.shop-card__avatar--initials[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;background:var(--p-primary-100);color:var(--p-primary-600);font-weight:700;font-size:1.3rem}.shop-card__name[_ngcontent-%COMP%]{font-size:1rem;line-height:1.3}.shop-card__username[_ngcontent-%COMP%]{font-size:.8rem;text-decoration:none}.shop-card__username[_ngcontent-%COMP%]:hover{text-decoration:underline}.shop-card__rating[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:.15rem;margin-top:.25rem}.shop-card__stars[_ngcontent-%COMP%]{display:flex;gap:2px}.shop-card__stars[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.85rem;color:#f59e0b}.shop-card__rating-text[_ngcontent-%COMP%]{font-size:.78rem;color:var(--p-text-muted-color)}.shop-card__cta[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.4rem;margin-top:.5rem;padding:.45rem 1.25rem;border-radius:6px;font-size:.85rem;font-weight:500;text-decoration:none;color:var(--p-primary-600);background:rgba(var(--p-primary-500-rgb, 99, 102, 241),.08);transition:background .15s,color .15s}.shop-card__cta[_ngcontent-%COMP%]:hover{background:rgba(var(--p-primary-500-rgb, 99, 102, 241),.16);color:var(--p-primary-700)}.shop-card__cta[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:.78rem}.dispute-escalation-hint[_ngcontent-%COMP%]{background:rgba(var(--p-orange-500-rgb, 249, 115, 22),.06);border-color:var(--p-orange-300)!important;color:var(--p-text-color)}.report-photo-preview[_ngcontent-%COMP%]{position:relative;width:72px;height:72px}.report-photo-preview__img[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:cover;border-radius:8px;border:1px solid var(--p-surface-border)}.report-photo-preview__remove[_ngcontent-%COMP%]{position:absolute;top:-6px;right:-6px;width:20px;height:20px;border-radius:50%;background:var(--p-red-500);color:#fff;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:.6rem;padding:0}.report-photo-add[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.25rem;padding:.4rem .75rem;border:1px dashed var(--p-surface-border);border-radius:8px;cursor:pointer;color:var(--p-text-muted-color);font-size:.85rem;transition:border-color .2s}.report-photo-add[_ngcontent-%COMP%]:hover{border-color:var(--p-primary-color);color:var(--p-primary-color)}.dispute-steps[_ngcontent-%COMP%]{background:var(--p-surface-ground)}.dispute-step[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.4rem;opacity:.4}.dispute-step--active[_ngcontent-%COMP%]{opacity:1}.dispute-step--done[_ngcontent-%COMP%]{opacity:.7}.dispute-step--done[_ngcontent-%COMP%] .dispute-step__num[_ngcontent-%COMP%]{background:var(--p-green-500);color:#fff}.dispute-step--disabled[_ngcontent-%COMP%]{opacity:.3}.dispute-step__num[_ngcontent-%COMP%]{width:1.5rem;height:1.5rem;border-radius:50%;background:var(--p-surface-300);color:var(--p-text-color);display:flex;align-items:center;justify-content:center;font-size:.75rem;font-weight:600;flex-shrink:0}.dispute-step__label[_ngcontent-%COMP%]{font-size:.8rem;white-space:nowrap}']})};export{He as ViewManagerPurchaseDetailComponent};
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.