1import{a as L}from"./chunk-KLFQLKK6.js";import"./chunk-ZJEC3Q4G.js";import{a as B}from"./chunk-AOJN6WNJ.js";import"./chunk-6AT5A2BN.js";import"./chunk-5VBVN4XO.js";import"./chunk-SWH5CKOF.js";import"./chunk-YU36PPIJ.js";import"./chunk-2UG4SRGW.js";import"./chunk-Y4S62ETF.js";import"./chunk-MCJE6KLX.js";import{f as O,i as M}from"./chunk-UYODVI7O.js";import{b}from"./chunk-KM6MCLXU.js";import"./chunk-FV2IMS43.js";import"./chunk-3KLM56HX.js";import{c as T}from"./chunk-MOXDLQT4.js";import"./chunk-VLJ55T5Q.js";import{a as k}from"./chunk-ZACTTJ4S.js";import{c as E,e as R}from"./chunk-EKU7OH35.js";import"./chunk-V2PPMFND.js";import{$a as w,Da as g,Db as x,Ha as v,Ib as I,Nb as e,Ob as i,Wb as _,ba as l,db as n,fc as t,gc as c,hc as m,kd as P,md as y,pb as C,uc as o,vb as S,vc as p}from"./chunk-5SAOKRHL.js";import{g as h}from"./chunk-NZN5XTIE.js";function U(r,u){if(r&1&&(e(0,"div",2),t(1,"\u2713"),i(),e(2,"h1"),t(3),o(4,"translate"),i(),e(5,"p"),t(6),o(7,"translate"),i(),e(8,"p",3),t(9),o(10,"translate"),e(11,"strong"),t(12),i()(),e(13,"a",4),t(14),o(15,"translate"),i()),r&2){let a=_();n(3),c(p(4,7,"cart.thanks")),n(3),c(p(7,9,"cart.doneConfirmed")),n(3),m("",p(10,11,"cart.yourReference")," "),n(3),c(a.shortRef()),n(),x("href",a.invoiceUrl(),w)("download",a.invoiceFilename()),n(),m(" ",p(15,13,"cart.downloadInvoice")," ")}}function z(r,u){r&1&&(e(0,"div",5),t(1,"\u23F3"),i(),e(2,"h1"),t(3),o(4,"translate"),i(),e(5,"p"),t(6),o(7,"translate"),i()),r&2&&(n(3),c(p(4,2,"cart.confirmingPayment")),n(3),c(p(7,4,"cart.confirmingPaymentHint")))}function F(r,u){if(r&1&&(e(0,"div",5),t(1,"\u23F3"),i(),e(2,"h1"),t(3),o(4,"translate"),i(),e(5,"p"),t(6),o(7,"translate"),i(),e(8,"p",3),t(9),o(10,"translate"),e(11,"strong"),t(12),i()()),r&2){let a=_();n(3),c(p(4,4,"cart.paymentPending")),n(3),c(p(7,6,"cart.paymentPendingHint")),n(3),m("",p(10,8,"cart.yourReference")," "),n(3),c(a.shortRef())}}function D(r,u){r&1&&(e(0,"div",6),t(1,"\u2715"),i(),e(2,"h1"),t(3),o(4,"translate"),i(),e(5,"p"),t(6),o(7,"translate"),i()),r&2&&(n(3),c(p(4,2,"cart.paymentCancelled")),n(3),c(p(7,4,"cart.paymentCancelledHint")))}var A=6,$=1200,ee=(()=>{class r{constructor(){this.state=g("checking"),this.route=l(O),this.cart=l(B),this.site=l(T),this.translation=l(b),this.platformId=l(v),this.reference=""}shortRef(){return(this.reference.split(".")[0]??"").toUpperCase()}homeLink(){return this.translation.localize("/")}invoiceUrl(){let a=this.site.effective()?.appId??"";return`${k.apiUrl}/api/public/site/order/invoice?appId=${encodeURIComponent(a)}&ref=${encodeURIComponent(this.reference)}`}invoiceFilename(){return`factura-${this.shortRef()||"pedido"}.pdf`}ngOnInit(){if(this.reference=this.route.snapshot.queryParamMap.get("ref")??"",this.route.snapshot.data.cancelled===!0){this.state.set("cancelled");return}if(!y(this.platformId)||!this.reference){this.state.set("pending");return}this.poll()}poll(){return h(this,null,function*(){for(let a=0;a<A;a++){if((yield this.cart.fetchOrderStatus(this.reference))?.paid){this.cart.clear(),this.state.set("confirmed");return}yield new Promise(s=>setTimeout(s,$*(a+1)))}this.state.set("pending")})}static{this.\u0275fac=function(d){return new(d||r)}}static{this.\u0275cmp=C({type:r,selectors:[["wr-order-return"]],decls:9,vars:5,consts:[[1,"wr-return"],[1,"wr-return__cta",3,"routerLink"],[1,"wr-return__icon","wr-return__icon--ok"],[1,"wr-return__ref"],["rel","noopener",1,"wr-return__invoice",3,"href","download"],[1,"wr-return__icon","wr-return__icon--wait"],[1,"wr-return__icon","wr-return__icon--ko"]],template:function(d,s){if(d&1&&(e(0,"wr-store-chrome")(1,"section",0),S(2,U,16,15)(3,z,8,6)(4,F,13,10)(5,D,8,6),e(6,"a",1),t(7),o(8,"translate"),i()()()),d&2){let f;n(2),I((f=s.state())==="confirmed"?2:f==="checking"?3:f==="pending"?4:5),n(4),x("routerLink",s.homeLink()),n(),c(p(8,3,"cart.keepShopping"))}},dependencies:[P,M,R,E,L],styles:[".wr-return[_ngcontent-%COMP%]{width:100%;max-width:560px;box-sizing:border-box;margin:0 auto;padding:64px 24px;text-align:center;display:flex;flex-direction:column;gap:14px;align-items:center}.wr-return__icon[_ngcontent-%COMP%]{width:72px;height:72px;line-height:72px;border-radius:50%;font-size:34px}.wr-return__icon--ok[_ngcontent-%COMP%]{background:#e7f6ec;color:#1e9e54}.wr-return__icon--ko[_ngcontent-%COMP%]{background:#fdecea;color:#c0392b}.wr-return__icon--wait[_ngcontent-%COMP%]{background:#fff6e5;color:#b26a00}.wr-return[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:24px;margin:0}.wr-return[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;opacity:.8}.wr-return__ref[_ngcontent-%COMP%]{font-size:14px}.wr-return__cta[_ngcontent-%COMP%]{margin-top:14px;display:inline-block;border-radius:10px;padding:12px 22px;background:var(--wr-primary, #004793);color:#fff;text-decoration:none;font-weight:700}.wr-return__invoice[_ngcontent-%COMP%]{margin-top:4px;display:inline-block;border-radius:10px;padding:10px 20px;border:1px solid currentColor;color:var(--wr-primary, #004793);text-decoration:none;font-weight:600}"],changeDetection:0})}}return r})();export{ee as OrderReturnComponent};
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.