1import{a as Le,b as Ae,e as Re,f as Ve,g as $e,h as ze,i as Ne,j as Ue}from"./chunk-JLFMLN3Z.js";import{a as Fe}from"./chunk-ILRUTWFH.js";import{a as Be}from"./chunk-AHP6CBJJ.js";import"./chunk-PVDG46DZ.js";import{a as Te}from"./chunk-MJHKSL2V.js";import{a as Se,c as ve,d as Oe,e as Me}from"./chunk-2MWBZL4H.js";import{b as Ie}from"./chunk-H3ZOHFO7.js";import"./chunk-CIKJJUSN.js";import"./chunk-RRZRS5BZ.js";import"./chunk-LY7WOQZN.js";import{b as ke}from"./chunk-VG7OHNZN.js";import"./chunk-MS4AQ6UA.js";import{b as we,d as Ee}from"./chunk-N7NZ2FMU.js";import{f as De}from"./chunk-F2TSTV3I.js";import"./chunk-XRMXGMS4.js";import"./chunk-Q4V6AKYI.js";import"./chunk-T3PLPHIG.js";import"./chunk-2JW6ZMWV.js";import"./chunk-NIP74ZKI.js";import"./chunk-QNUNLKYK.js";import{c as K,r as Pe}from"./chunk-RE4JJFV5.js";import{d as ce,e as pe,f as se,i as _e,j as me,k as I}from"./chunk-COEKBYWO.js";import"./chunk-E2K2LIS4.js";import{a as L}from"./chunk-KJKRX6VS.js";import"./chunk-2CRWMDGS.js";import{a as be,b as ye}from"./chunk-4WMDX4SQ.js";import"./chunk-IQLKO45Z.js";import"./chunk-V6KBZVCY.js";import"./chunk-6FQQM4CE.js";import{a as ge,i as Ce,j as fe}from"./chunk-VTTO24NQ.js";import"./chunk-Y5VOXWTF.js";import{l as ue,n as B,q as F}from"./chunk-YWHNFDXQ.js";import"./chunk-FCTHY2PU.js";import"./chunk-DPVJW3LI.js";import{f as ee,i as te,n as ie}from"./chunk-GW33KQPR.js";import{T as xe,U as he}from"./chunk-TUEKBDZZ.js";import"./chunk-RLPOKPIS.js";import"./chunk-TPES7EAS.js";import{C as le,G as de,c as ne,h as oe,m as re,z as ae}from"./chunk-QXJM3TTT.js";import{D as Z,F as E,k as Q,v as X,x as Y}from"./chunk-TMOIAHHX.js";import{$a as T,Db as H,Ib as r,Jb as C,Kb as m,Lb as V,Mb as $,Rb as z,Sa as A,Sb as N,Tb as U,Wa as p,Xa as s,Ya as R,Za as G,_a as k,aa as W,ab as g,bb as a,cb as o,cc as j,db as P,ec as J,ga as n,kb as y,mc as x,nc as v,o as h,oc as w,p as b,qb as f,sa as M,tb as c,za as D}from"./chunk-DJNWGYMM.js";import{ea as O,f as q}from"./chunk-VOZAGDK7.js";import"./chunk-E5QWB6YB.js";var je=["USPS","UPS","FedEx","DHL","Other"];function Je(t,l){if(t&1&&(a(0,"mat-option",3),r(1),o()),t&2){let e=l.$implicit;g("value",e),n(),C(e)}}function Qe(t,l){t&1&&(a(0,"p",4),r(1,"Other carriers don't get a tracking link \u2014 the buyer sees the code as text."),o())}function Xe(t,l){t&1&&(a(0,"p",4),r(1," This line has platform labels; replacing the tracking changes what the buyer sees but keeps the labels. "),o())}function Ye(t,l){t&1&&(a(0,"p",4),r(1,"Saving tracking for the first time emails the buyer."),o())}function Ze(t,l){if(t&1&&(a(0,"p",7),r(1),o()),t&2){let e=c();n(),C(e.errorMessage)}}function et(t,l){if(t&1){let e=y();a(0,"button",13),f("click",function(){h(e);let i=c();return b(i.remove())}),r(1),o()}if(t&2){let e=c();g("disabled",e.saving||e.removing),n(),m(" ",e.removing?"Removing\u2026":"Remove tracking"," ")}}var Ke=(()=>{class t{dialogRef;data;api;carriers=je;carrier;code;saving=!1;removing=!1;errorMessage="";constructor(e,d,i){this.dialogRef=e,this.data=d,this.api=i,this.carrier=d.line.tracking?.carrier||"USPS",this.code=d.line.tracking?.code||""}get isEdit(){return!!this.data.line.tracking}get hasLabels(){return!!this.data.line.labels?.length}get canSave(){return!!this.carrier&&!!this.code.trim()&&!this.saving&&!this.removing}save(){this.canSave&&(this.saving=!0,this.errorMessage="",this.api.post("Shop/admin/tracking",{orderKey:this.data.order._key,lineIndex:this.data.lineIndex,carrier:this.carrier,code:this.code.trim()},!0).subscribe({next:e=>this.dialogRef.close({order:e,removed:!1}),error:e=>{this.saving=!1,this.errorMessage=typeof e?.error=="string"&&e.error?e.error:"The tracking couldn't be saved. Please try again."}}))}remove(){this.saving||this.removing||(this.removing=!0,this.errorMessage="",this.api.post("Shop/admin/tracking",{orderKey:this.data.order._key,lineIndex:this.data.lineIndex,carrier:null,code:null},!0).subscribe({next:e=>this.dialogRef.close({order:e,removed:!0}),error:e=>{this.removing=!1,this.errorMessage=typeof e?.error=="string"&&e.error?e.error:"The tracking couldn't be removed. Please try again."}}))}static \u0275fac=function(d){return new(d||t)(M(ce),M(pe),M(L))};static \u0275cmp=D({type:t,selectors:[["add-tracking-dialog"]],decls:23,vars:12,consts:[["titleId","add-tracking-title",3,"closed","title","subtitle"],["appearance","outline","subscriptSizing","dynamic",1,"f-carrier"],["name","carrier",3,"ngModelChange","ngModel"],[3,"value"],[1,"rpui-hint"],["appearance","outline","subscriptSizing","dynamic",1,"f-code"],["matInput","","name","code","maxlength","100","required","",3,"ngModelChange","keyup.enter","ngModel"],["role","alert",1,"dialog-error"],[1,"rpui-dialog-actions"],["mat-button","",1,"act-remove",3,"disabled"],[1,"rpui-spacer"],["mat-button","",3,"click","disabled"],["mat-flat-button","","color","primary",3,"click","disabled"],["mat-button","",1,"act-remove",3,"click","disabled"]],template:function(d,i){d&1&&(a(0,"rp-dialog-header",0),f("closed",function(){return i.dialogRef.close()}),o(),a(1,"mat-dialog-content")(2,"mat-form-field",1)(3,"mat-label"),r(4,"Carrier"),o(),a(5,"mat-select",2),U("ngModelChange",function(u){return N(i.carrier,u)||(i.carrier=u),u}),k(6,Je,2,2,"mat-option",3,G),o()(),p(8,Qe,2,0,"p",4),a(9,"mat-form-field",5)(10,"mat-label"),r(11,"Tracking code"),o(),a(12,"input",6),U("ngModelChange",function(u){return N(i.code,u)||(i.code=u),u}),f("keyup.enter",function(){return i.save()}),o()(),p(13,Xe,2,0,"p",4),p(14,Ye,2,0,"p",4),p(15,Ze,2,1,"p",7),o(),a(16,"mat-dialog-actions",8),p(17,et,2,2,"button",9),P(18,"span",10),a(19,"button",11),f("click",function(){return i.dialogRef.close()}),r(20,"Cancel"),o(),a(21,"button",12),f("click",function(){return i.save()}),r(22),o()()),d&2&&(g("title",i.isEdit?"Edit tracking":"Add tracking")("subtitle",i.data.line.name+(i.data.line.variantLabel?" \u2014 "+i.data.line.variantLabel:"")),n(5),z("ngModel",i.carrier),n(),T(i.carriers),n(2),s(i.carrier==="Other"?8:-1),n(4),z("ngModel",i.code),n(),s(i.hasLabels?13:-1),n(),s(i.isEdit?-1:14),n(),s(i.errorMessage?15:-1),n(2),s(i.isEdit?17:-1),n(2),g("disabled",i.saving||i.removing),n(2),g("disabled",!i.canSave),n(),m(" ",i.saving?"Saving\u2026":"Save tracking"," "))},dependencies:[E,de,ne,oe,ae,le,re,F,B,I,me,_e,fe,Ce,ge,ye,be,Ee,we,De,Fe],styles:["[_ngcontent-%COMP%]:root{--rp-nav
1y-900: #10243f;--rp-navy-800: #143b67;--rp-navy-700: #1a3668;--rp-navy-600: #244f7e;--rp-text: #122033;--rp-text-muted: #64798c;--rp-text-subtle: #667085;--rp-divider: #dce5ee;--rp-divider-soft: #e8edf3;--rp-border-control: #8792a5;--rp-surface: #ffffff;--rp-surface-tint: #f2f7fc;--rp-surface-head: #eef2f6;--rp-surface-sunken: #f7f9fc;--rp-ok-bg: #eaf6ea;--rp-ok-border: #7fb583;--rp-ok-fg: #2e7d32;--rp-warn-bg: #fff3e0;--rp-warn-border: #c9922f;--rp-warn-fg: #9a4a00;--rp-danger-bg: #ffebee;--rp-danger-border: #d97b7b;--rp-danger-fg: #c62828;--rp-info-bg: #eef2fb;--rp-info-border: #8fa6cf;--rp-info-fg: #244f7e;--rp-neutral-bg: #f1f3f6;--rp-neutral-border: #9aa4b2;--rp-neutral-fg: #5a6b7d;--rp-gold-bg: #fdf6e3;--rp-gold-ring: #d4a531;--rp-gold-fg: #6b4700;--rp-silver-bg: #f1f3f6;--rp-silver-ring: #9ba5b1;--rp-silver-fg: #48535f;--rp-bronze-bg: #f8ede6;--rp-bronze-ring: #c4855f;--rp-bronze-fg: #6e3b1d;--rp-focus-ring: #244f7e;--rp-radius-control: 6px;--rp-radius-card: 8px;--rp-radius-row: 10px;--rp-radius-panel: 16px;--rp-shadow-card: 0 1px 3px rgba(15, 31, 53, .05);--rp-shadow-panel: 0 1px 3px rgba(15, 31, 53, .04), 0 8px 32px rgba(15, 31, 53, .07)}mat-dialog-content[_ngcontent-%COMP%]{display:block;padding-top:8px}.f-carrier[_ngcontent-%COMP%], .f-code[_ngcontent-%COMP%]{width:100%;margin-bottom:12px}.rpui-hint[_ngcontent-%COMP%]{margin:0 0 12px}.dialog-error[_ngcontent-%COMP%]{margin:0 0 8px;color:#c62828;font-size:13px}.act-remove[_ngcontent-%COMP%]{color:#c62828}"]})}return t})();var tt=()=>["/pages/shop-admin/orders"],it=()=>["/pages/shop-admin/buy-label"],nt=(t,l)=>({orderKey:t,lineIndex:l});function ot(t,l){t&1&&(a(0,"div",3),P(1,"rp-state",4),o())}function rt(t,l){if(t&1){let e=y();a(0,"div",3)(1,"rp-state",5)(2,"button",6),f("click",function(){h(e);let i=c();return b(i.load())}),r(3,"Try again"),o(),a(4,"a",7),r(5,"Back to Orders"),o()()()}if(t&2){let e=c();n(),g("body",e.errorMessage),n(3),g("routerLink",j(2,tt))}}function at(t,l){t&1&&(a(0,"span",12),r(1,"Guest"),o())}function lt(t,l){if(t&1&&(a(0,"div",13),r(1),o()),t&2){let e=c(2);n(),C(e.order.email)}}function dt(t,l){if(t&1&&(a(0,"div",13),r(1),o()),t&2){let e=c(2);n(),C(e.order.phone)}}function ct(t,l){if(t&1&&(a(0,"mat-icon",17),r(1),o()),t&2){let e=c(2);n(),C(e.orderStatusChip(e.order.status).icon)}}function pt(t,l){if(t&1&&(r(0),x(1,"date")),t&2){let e=c(3);m(" \u2014 paid ",w(1,1,e.order.payment==null?null:e.order.payment.paidOn,"MMM d, y")," ")}}function st(t,l){if(t&1&&(a(0,"div",13),r(1),x(2,"titlecase"),p(3,pt,2,4),o()),t&2){let e=c(2);n(),V(" ",v(2,3,e.order.payment==null?null:e.order.payment.cardBrand)," ****",e.order.payment==null?null:e.order.payment.last4," "),n(2),s(e.order.payment!=null&&e.order.payment.paidOn?3:-1)}}function _t(t,l){if(t&1&&(a(0,"div",18),r(1),o()),t&2){let e=c(2);n(),C(e.order.payment==null?null:e.order.payment.failReason)}}function mt(t,l){if(t&1&&(a(0,"div",20)(1,"dt"),r(2,"Postage for labels bought through Register Play"),o(),a(3,"dd"),r(4),x(5,"currency"),o()()),t&2){let e=c();n(4),m("\u2212",v(5,1,e.postage))}}function ut(t,l){if(t&1&&(a(0,"div",20)(1,"dt"),r(2,"Register Play fee"),o(),a(3,"dd"),r(4),x(5,"currency"),o()(),p(6,mt,6,3,"div",20),a(7,"div",20)(8,"dt"),r(9,"Stripe fees (card processing)"),o(),a(10,"dd"),r(11),x(12,"currency"),o()(),a(13,"div",21)(14,"dt"),r(15,"Net to you"),o(),a(16,"dd"),r(17),x(18,"currency"),o()()),t&2){let e=l;n(4),m("\u2212",v(5,4,e.rpFee)),n(2),s(e.postage?6:-1),n(5),m("\u2212",v(12,6,e.stripeFee)),n(6),C(v(18,8,e.net))}}function gt(t,l){t&1&&(a(0,"p",22),r(1," Stripe charges a card processing fee on every card payment, the same as any card terminal. Stripe fees go to Stripe, not Register Play. "),o())}function Ct(t,l){if(t&1&&(r(0),P(1,"br")),t&2){let e=c();m(" ",e.street2)}}function ft(t,l){if(t&1&&(P(0,"br"),r(1)),t&2){let e=c();n(),m("",e.phone," ")}}function xt(t,l){if(t&1&&(a(0,"address",25),r(1),P(2,"br"),r(3),P(4,"br"),p(5,Ct,2,1),r(6),p(7,ft,2,1),o()),t&2){let e=l;n(),m(" ",e.name),n(2),m(" ",e.street1),n(2),s(e.street2?5:-1),n(),$(" ",e.city,", ",e.state," ",e.zip," "),n(),s(e.ph
1one?7:-1)}}function ht(t,l){t&1&&(a(0,"div",13),r(1,"Pickup only \u2014 no shipping address."),o())}function bt(t,l){if(t&1&&r(0),t&2){let e=c(3);V(" \u2014 about ",e.order.shipping==null?null:e.order.shipping.deliveryDays," day",(e.order.shipping==null?null:e.order.shipping.deliveryDays)===1?"":"s"," ")}}function yt(t,l){if(t&1&&(a(0,"div",26),r(1),p(2,bt,1,2),o()),t&2){let e=c(2);n(),m(" ",e.order.shipping==null?null:e.order.shipping.serviceLabel," "),n(),s(e.order.shipping!=null&&e.order.shipping.deliveryDays?2:-1)}}function St(t,l){if(t&1){let e=y();a(0,"button",32),f("click",function(){h(e);let i=c(2);return b(i.buyLabels())}),a(1,"mat-icon"),r(2,"local_shipping"),o(),r(3),o()}if(t&2){let e=c(2);g("disabled",!!e.labelBusy),n(3),m(" ",e.labelBusy==="buy"?"Buying labels\u2026":"Buy labels"," ")}}function vt(t,l){if(t&1&&(a(0,"p",30),r(1),o()),t&2){let e=c(2);n(),C(e.labelError)}}function Ot(t,l){if(t&1&&r(0),t&2){let e=c().$implicit;m(" \u2014 ",e.variantLabel," ")}}function Mt(t,l){if(t&1&&r(0),t&2){let e=c().$implicit;m(" SKU ",e.sku," \xB7 ")}}function Pt(t,l){if(t&1&&(a(0,"mat-icon",17),r(1),o()),t&2){let e=c().$implicit,d=c(2);n(),C(d.lineStatusChip(e.lineStatus).icon)}}function kt(t,l){if(t&1&&(a(0,"div",40)(1,"mat-icon",17),r(2,"storefront"),o(),r(3),o()),t&2){let e=c().$implicit;n(3),m(" Pickup",e.pickupDetails?" \u2014 "+e.pickupDetails:""," ")}}function Tt(t,l){if(t&1&&r(0),t&2){let e=c(4);m(" \xB7 ",e.order.shipping==null?null:e.order.shipping.serviceLabel," ")}}function Dt(t,l){if(t&1&&(a(0,"div",40)(1,"mat-icon",17),r(2,"local_shipping"),o(),a(3,"span"),r(4),p(5,Tt,1,1),o()()),t&2){let e=c().$implicit,d=c(2);n(4),m(" Ships to the buyer \u2014 ",d.lineShippingLabel(e)," "),n(),s(e.easyPostShipping&&(d.order.shipping!=null&&d.order.shipping.serviceLabel)?5:-1)}}function wt(t,l){if(t&1&&(a(0,"a",50),r(1),o()),t&2){let e=c();g("href",e.url,W),n(),C(e.code)}}function Et(t,l){if(t&1&&(a(0,"span",51),r(1),o()),t&2){let e=c();n(),C(e.code)}}function It(t,l){if(t&1&&r(0),t&2){let e=c(4).$implicit,d=c(2);m(" by ",d.enteredByName(e)," \xB7 ")}}function Bt(t,l){if(t&1&&(a(0,"span",52),r(1," entered "),p(2,It,1,1),r(3),x(4,"date"),o()),t&2){let e=c(),d=c(2).$implicit,i=c(2);n(2),s(i.enteredByName(d)?2:-1),n(),m(" ",w(4,2,e.enteredOn,"MMM d, y")," ")}}function Ft(t,l){if(t&1&&(a(0,"div",48)(1,"mat-icon",17),r(2,"route"),o(),a(3,"span"),r(4),p(5,wt,2,2,"a",50)(6,Et,2,1,"span",51),p(7,Bt,5,5,"span",52),o()()),t&2){let e=l;n(4),m(" ",e.carrier," "),n(),s(e.url?5:6),n(2),s(e.enteredOn?7:-1)}}function Lt(t,l){t&1&&(a(0,"div",49)(1,"mat-icon",17),r(2,"route"),o(),r(3," No tracking yet. "),o())}function At(t,l){if(t&1&&p(0,Ft,8,3,"div",48)(1,Lt,4,0,"div",49),t&2){let e,d=c().$implicit;s((e=d.tracking)?0:1,e)}}function Rt(t,l){if(t&1&&(a(0,"span",16),r(1),o()),t&2){let e=l;g("ngClass","rpui-chip--"+e.kind),n(),C(e.label)}}function Vt(t,l){if(t&1){let e=y();a(0,"button",55),f("click",function(){h(e);let i=c().$implicit,_=c(4);return b(_.printLabel(i.labelUrl))}),a(1,"mat-icon"),r(2,"print"),o(),r(3," Print label "),o()}}function $t(t,l){if(t&1&&(a(0,"li",53)(1,"span",54),r(2),o(),p(3,Rt,2,2,"span",16),p(4,Vt,4,0,"button",43),o()),t&2){let e,d=l.$implicit,i=c(4);n(2),C(d.trackingCode),n(),s((e=i.labelRefundChip(d.refund))?3:-1,e),n(),s(d.labelUrl?4:-1)}}function zt(t,l){if(t&1&&(a(0,"ul",41),k(1,$t,5,3,"li",53,R),o()),t&2){let e=c().$implicit;n(),T(e.labels)}}function Nt(t,l){if(t&1){let e=y();a(0,"button",55),f("click",function(){h(e);let i=c(),_=i.$implicit,u=i.$index,S=c(2);return b(S.openTracking(_,u))}),a(1,"mat-icon"),r(2,"edit_road"),o(),r(3),o()}if(t&2){let e=c().$implicit;n(3),m(" ",e.tracking?"Edit tracking":"Add tracking"," ")}}function Ut(t,l){if(t&1){let e=y();a(0,"button",56),f("click",function(){h(e);let i=c(),_=i.$implicit,u=i.$index,S=c(2);return b(S.voidLabel(_,u))}),a(1,"mat-icon"),r(2,"undo"),o(),r(3),o()}if(t&2){let e=c().$index,d=c(2);g("disabled",!!d.labelBusy),n(3),m(" ",d.labelBusy==="void-"+e?"Requesting\u2026":"Void label"," ")}}function jt(t,l){if(t&1&&(a(0,"a",45)(1,"mat-icon"),r(2,"sell"),o(),r(3," Buy label through RP "),o()),t&2){let e=c().$index,d=c(2);g("routerLink",j(2,it))("queryParams",J(3,nt,d.order._key,e))}}function Kt(t,l){if(t&1){let e=y();a(0,"button",57),f("click",function(){h(e);let i=c(),_=i.$implicit,u=i.$index,S=c(2);return b(S.setLineStatus(_,u,"shipped"))}),a(1,"mat-icon"),r(2,"check"),o(),r(3," Mark shipped (no tracking) "),o()}}function qt(t,l){if(t&1){let e=y();a(0,"button",57),f("click",function(){h(e);let i=c(),_=i.$implicit,u=i.$index,S=c(2);return b(S.setLineStatus(_,u,"pickedUp"))}),a(1,"mat-icon"),r(2,"storefront"),o(),r(3," Mark picked up "),o()}}function Wt(t,l){if(t&1){let e=y();a(0,"button",57),f("click",function(){h(e);let i=c(),_=i.$implicit,u=i.$index,S=c(2);return b(S.setLineStatus(_,u,"cancelled"))}),a(1,"mat-icon"),r(2,"block"),o(),r(3," Cancel line "),o()}}function Gt(t,l){if(t&1){let e=y();a(0,"button",57),f("click",function(){h(e);let i=c(),_=i.$implicit,u=i.$index,S=c(2);return b(S.setLineStatus(_,u,"new"))}),a(1,"mat-icon"),r(2,"restart_alt"),o(),r(3," Back to New "),o()}}function Ht(t,l){if(t&1&&(a(0,"section",31)(1,"div",33)(2,"div",34)(3,"div",35),r(4),p(5,Ot,1,1),o(),a(6,"div",36),p(7,Mt,1,1),r(8),x(9,"currency"),x(10,"currency"),o()(),a(11,"div",37)(12,"span",16),p(13,Pt,2,1,"mat-icon",17),r(14),o()()(),a(15,"div",38)(16,"div",39),p(17,kt,4,1,"div",40)(18,Dt,6,2,"div",40),p(19,At,2,1),p(20,zt,3,0,"ul",41),o(),a(21,"div",42),p(22,Nt,4,1,"button",43),p(23,Ut,4,2,"button",44),p(24,jt,4,6,"a",45),a(25,"button",46)(26,"mat-icon"),r(27,"more_vert"),o()(),a(28,"mat-menu",null,0),p(30,Kt,4,0,"button",47),p(31,qt,4,0,"button",47),p(32,Wt,4,0,"button",47),p(33,Gt,4,0,"button",47),o()()()()),t&2){let e=l.$implicit,d=l.$index,i=H(29),_=c(2);A("aria-label","Line "+(d+1)+": "+e.name),n(4),m(" ",e.name," "),n(),s(e.variantLabel?5:-1),n(2),s(e.sku?7:-1),n(),$(" ",e.qty," \xD7 ",v(9,23,e.unitPrice)," = ",v(10,25,e.lineTotal)," "),n(4),g("ngClass","rpui-chip--"+_.lineStatusChip(e.lineStatus).kind),n(),s(_.lineStatusChip(e.lineStatus).icon?13:-1),n(),m(" ",_.lineStatusChip(e.lineStatus).label," "),n(3),s(e.fulfillment==="pickup"?17:18),n(2),s(e.fulfillment==="ship"?19:-1),n(),s(e.labels!=null&&e.labels.length?20:-1),n(2),s(e.fulfillment==="ship"?22:-1),n(),s(_.canVoidLabels(e)?23:-1),n(),s(_.canBuyLabelThroughRP(e)?24:-1),n(),g("matMenuTriggerFor",i)("disabled",_.statusBusyIndex>=0),A("aria-label","Line status for "+e.name),n(5),s(e.fulfillment==="ship"&&e.lineStatus!=="shipped"?30:-1),n(),s(e.fulfillment==="pickup"&&e.lineStatus!=="pickedUp"?31:-1),n(),s(e.lineStatus!=="c
1ancelled"?32:-1),n(),s(e.lineStatus!=="new"?33:-1)}}function Jt(t,l){if(t&1&&(a(0,"div",3)(1,"div",8)(2,"section",9)(3,"h2",10),r(4,"Buyer"),o(),a(5,"div",11),r(6),p(7,at,2,0,"span",12),o(),p(8,lt,2,1,"div",13),p(9,dt,2,1,"div",13),o(),a(10,"section",14)(11,"h2",15),r(12,"Payment"),o(),a(13,"div",11)(14,"span",16),p(15,ct,2,1,"mat-icon",17),r(16),o()(),p(17,st,4,5,"div",13),p(18,_t,2,1,"div",18),a(19,"dl",19)(20,"div",20)(21,"dt"),r(22,"Items"),o(),a(23,"dd"),r(24),x(25,"currency"),o()(),a(26,"div",20)(27,"dt"),r(28,"Shipping"),o(),a(29,"dd"),r(30),x(31,"currency"),o()(),a(32,"div",21)(33,"dt"),r(34,"Total"),o(),a(35,"dd"),r(36),x(37,"currency"),o()(),p(38,ut,19,10),o(),p(39,gt,2,0,"p",22),o(),a(40,"section",23)(41,"h2",24),r(42,"Shipping"),o(),p(43,xt,8,7,"address",25)(44,ht,2,0,"div",13),p(45,yt,3,2,"div",26),o()(),a(46,"div",27)(47,"h2",28),r(48,"Lines"),o(),p(49,St,4,2,"button",29),o(),p(50,vt,2,1,"p",30),k(51,Ht,34,27,"section",31,R),o()),t&2){let e,d,i=c();n(6),m(" ",i.buyerTitle(i.order)," "),n(),s(i.isGuestOrder(i.order)?7:-1),n(),s(i.order.email?8:-1),n(),s(i.order.phone?9:-1),n(5),g("ngClass","rpui-chip--"+i.orderStatusChip(i.order.status).kind),n(),s(i.orderStatusChip(i.order.status).icon?15:-1),n(),m(" ",i.orderStatusChip(i.order.status).label," "),n(),s(i.order.payment!=null&&i.order.payment.cardBrand?17:-1),n(),s(i.order.status==="paymentFailed"&&(i.order.payment!=null&&i.order.payment.failReason)?18:-1),n(6),C(v(25,18,i.order.amounts==null?null:i.order.amounts.itemsSubtotal)),n(6),C(v(31,20,i.order.amounts==null?null:i.order.amounts.shippingCharged)),n(6),C(v(37,22,i.order.amounts==null?null:i.order.amounts.total)),n(2),s((e=i.order.payment==null?null:i.order.payment.fees)?38:-1,e),n(),s(i.order.payment!=null&&i.order.payment.fees?39:-1),n(4),s((d=i.order.shipTo)?43:44,d),n(2),s(i.order.shipping!=null&&i.order.shipping.serviceLabel?45:-1),n(4),s(i.hasUnlabelledEpUnits(i.order)?49:-1),n(),s(i.labelError?50:-1),n(),T(i.order.lines)}}var wi=(()=>{class t{api;notify;dialog;route;loading=!0;errorMessage="";order=null;enteredByNames={};labelBusy="";labelError="";statusBusyIndex=-1;orderStatusChip=Le;lineStatusChip=Ae;isGuestOrder=Re;buyerTitle=Ve;lineShippingLabel=Ue;canVoidLabels=ze;canBuyLabelThroughRP=Ne;hasUnlabelledEpUnits=$e;orderKey="";_unsubscribeAll=new q;constructor(e,d,i,_){this.api=e,this.notify=d,this.dialog=i,this.route=_}ngOnInit(){this.route.paramMap.pipe(O(this._unsubscribeAll)).subscribe(e=>{this.orderKey=e.get("key")||"",this.load()})}load(){this.loading=!0,this.errorMessage="",this.api.get("Shop/admin/orders?orderKey="+encodeURIComponent(this.orderKey),!0).pipe(O(this._unsubscribeAll)).subscribe({next:e=>{this.order=e?.orders?.[0]||null,this.enteredByNames=e?.enteredByNames||{},this.order||(this.errorMessage="This order no longer exists. It may have been placed on another site."),this.loading=!1},error:e=>{this.errorMessage=typeof e?.error=="string"&&e.error?e.error:"The order could not be loaded. Please try again.",this.loading=!1}})}get pageTitle(){return this.order?"Order #"+this.order.orderNo:"Order"}get shipLines(){return(this.order?.lines||[]).some(e=>e.fulfillment==="ship")}enteredByName(e){return this.enteredByNames[e.tracking?.enteredBy||""]||""}openTracking(e,d){this.order&&this.dialog.open(Ke,{data:{order:this.order,line:e,lineIndex:d},width:"480px",maxWidth:"94vw",autoFocus:"dialog",ariaLabelledBy:"add-tracking-title"}).afterClosed().pipe(O(this._unsubscribeAll)).subscribe(i=>{i?.order&&(this.order=i.order,this.notify.openToaster(i.removed?"Tracking removed \u2014 the line is back to New.":"Tracking saved.","success"))})}buyLabels(){if(!this.order||this.labelBusy)return;let e=this.dialog.open(K,{disableClose:!1});e.componentInstance.confirmMessage="Buy shipping labels for every unlabelled EasyPost parcel on this order? The buyer already paid this shipping \u2014 the label cost is recouped from it.",e.afterClosed().pipe(O(this._unsubscribeAll)).subscribe(d=>{!d||!this.order||(this.labelBusy="buy",this.labelError="",this.api.post("Shop/admin/buyLabels/"+this.order._key,{},!0).pipe(O(this._unsubscribeAll)).subscribe({next:i=>{this.labelBusy="",this.order=i,this.notify.openToaster("Labels bought \u2014 the buyer has been emailed the tracking.","success")},error:i=>{this.labelBusy="",this.labelError=typeof i?.error=="string"&&i.error?i.error:"The labels couldn't be bought. Please try again."}}))})}voidLabel(e,d){if(!this.order||this.labelBusy)return;let i=this.dialog.open(K,{disableClose:!1});i.componentInstance.confirmMessage="Request the carrier refund for the label"+((e.labels?.length||0)>1?"s":"")+' on "'+e.name+'"? Carrier refunds can take days (USPS especially). The line returns to New right away; the money side settles when the carrier answers.',i.afterClosed().pipe(O(this._unsubscribeAll)).subscribe(_=>{!_||!this.order||(this.labelBusy="void-"+d,this.labelError="",this.api.post("Shop/admin/voidLabel/"+this.order._key+"/"+d,{},!0).pipe(O(this._unsubscribeAll)).subscribe({next:u=>{this.labelBusy="",this.order=u,this.notify.openToaster("Void requested \u2014 the refund is pending with the carrier.","success")},error:u=>{this.labelBusy="",this.labelError=typeof u?.error=="string"&&u.error?u.error:"The void couldn't be requested. Please try again."}}))})}printLabel(e){e&&window.open(e,"_blank","noopener")}
1labelRefundChip(e){switch(e?.status){case"pending":return{label:"Refund pending",kind:"warn"};case"refunded":return{label:"Refunded",kind:"info"};case"denied":return{label:"Refund denied",kind:"danger"};default:return null}}setLineStatus(e,d,i){!this.order||this.statusBusyIndex>=0||e.lineStatus===i||(this.statusBusyIndex=d,this.api.post("Shop/admin/lineStatus",{orderKey:this.order._key,lineIndex:d,status:i},!0).pipe(O(this._unsubscribeAll)).subscribe({next:_=>{this.statusBusyIndex=-1,this.order=_,this.notify.openToaster("Line updated.","success")},error:_=>{this.statusBusyIndex=-1,this.notify.openErrorModal(typeof _?.error=="string"&&_.error?_.error:"The line couldn't be updated. Please try again.")}}))}ngOnDestroy(){this._unsubscribeAll.next(!0),this._unsubscribeAll.complete()}static \u0275fac=function(d){return new(d||t)(M(L),M(Pe),M(se),M(ee))};static \u0275cmp=D({type:t,selectors:[["shop-order-detail"]],decls:6,vars:9,consts:[["statusMenu","matMenu"],["id","ShopOrderDetailPage",1,"page-layout","simple","fullwidth"],["matIcon","receipt_long",3,"title","hideBanner","subtitle"],[1,"content","p-24"],["mode","loading","body","Loading the order"],["mode","error","title","We couldn't load this order",3,"body"],["mat-flat-button","","color","primary",3,"click"],["mat-stroked-button","",3,"routerLink"],[1,"summary-grid"],["aria-labelledby","buyer-heading",1,"rpui-card","summary-card"],["id","buyer-heading",1,"rpui-eyebrow"],[1,"summary-card__title"],[1,"rpui-chip","rpui-chip--neutral"],[1,"summary-card__row"],["aria-labelledby","payment-heading",1,"rpui-card","summary-card"],["id","payment-heading",1,"rpui-eyebrow"],[1,"rpui-chip",3,"ngClass"],["aria-hidden","true"],[1,"summary-card__row","fail-reason"],[1,"amounts"],[1,"amounts__row"],[1,"amounts__row","amounts__row--total"],[1,"amounts__note"],["aria-labelledby","shipping-heading",1,"rpui-card","summary-card"],["id","shipping-heading",1,"rpui-eyebrow"],[1,"summary-card__address"],[1,"summary-card__row","service"],[1,"lines-header"],[1,"lines-header__title"],["mat-flat-button","","color","primary",3,"disabled"],["role","alert",1,"label-error"],[1,"rpui-card","line-card"],["mat-flat-button","","color","primary",3,"click","disabled"],[1,"line-card__head"],[1,"line-card__identity"],[1,"line-card__name"],[1,"line-card__meta"],[1,"rpui-chip-set"],[1,"line-card__body"],[1,"line-card__fulfillment"],[1,"line-card__row"],["aria-label","Bought labels",1,"labels"],[1,"line-card__actions"],["mat-stroked-button",""],["mat-stroked-button","",1,"act-void",3,"disabled"],["mat-stroked-button","",3,"routerLink","queryParams"],["mat-icon-button","","matTooltip","Line status",1,"rpui-icon-target",3,"matMenuTriggerFor","disabled"],["mat-menu-item",""],[1,"line-card__row","tracking"],[1,"line-card__row","line-card__row--muted"],["target","_blank","rel","noopener",3,"href"],[1,"tracking__code"],[1,"tracking__entered"],[1,"labels__row"],[1,"labels__code"],["mat-stroked-button","",3,"click"],["mat-stroked-button","",1,"act-void",3,"click","disabled"],["mat-menu-item","",3,"click"]],template:function(d,i){d&1&&(a(0,"div",1),P(1,"page-header",2),x(2,"date"),p(3,ot,2,0,"div",3),p(4,rt,6,3,"div",3),p(5,Jt,53,24,"div",3),o()),d&2&&(n(),g("title",i.pageTitle)("hideBanner",!0)("subtitle",i.order!=null&&i.order.createdOn?"Placed "+w(2,6,i.order==null?null:i.order.createdOn,"MMM d, y, h:mm a"):""),n(2),s(i.loading?3:-1),n(),s(!i.loading&&i.errorMessage?4:-1),n(),s(!i.loading&&!i.errorMessage&&i.order?5:-1))},dependencies:[E,Q,ie,te,F,B,ue,I,he,xe,Me,ve,Se,Oe,Te,ke,Ie,Be,X,Z,Y],styles:["[_ngcontent-%COMP%]:root{--rp-navy-900: #10243f;--rp-navy-800: #143b67;--rp-navy-700: #1a3668;--rp-navy-600: #244f7e;--rp-text: #122033;--rp-text-muted: #64798c;--rp-text-subtle: #667085;--rp-divider: #dce5ee;--rp-divider-soft: #e8edf3;--rp-border-control: #8792a5;--rp-surface: #ffffff;--rp-surface-tint: #f2f7fc;--rp-surface-head: #eef2f6;--rp-surface-sunken: #f7f9fc;--rp-ok-bg: #eaf6ea;--rp-ok-border: #7fb583;--rp-ok-fg: #2e7d32;--rp-warn-bg: #fff3e0;--rp-warn-border: #c9922f;--rp-warn-fg: #9a4a00;--rp-danger-bg: #ffebee;--rp-danger-border: #d97b7b;--rp-danger-fg: #c62828;--rp-info-bg: #eef2fb;--rp-info-border: #8fa6cf;--rp-info-fg: #244f7e;--rp-neutral-bg: #f1f3f6;--rp-neutral-border: #9aa4b2;--rp-neutral-fg: #5a6b7d;--rp-gold-bg: #fdf6e3;--rp-gold-ring: #d4a531;--rp-gold-fg: #6b4700;--rp-silver-bg: #f1f3f6;--rp-silver-ring: #9ba5b1;--rp-silver-fg: #48535f;--rp-bronze-bg: #f8ede6;--rp-bronze-ring: #c4855f;--rp-bronze-fg: #6e3b1d;--rp-focus-ring: #244f7e;--rp-radius-control: 6px;--rp-radius-card: 8px;--rp-radius-row: 10px;--rp-radius-panel: 16px;--rp-shadow-card: 0 1px 3px rgba(15, 31, 53, .05);
1--rp-shadow-panel: 0 1px 3px rgba(15, 31, 53, .04), 0 8px 32px rgba(15, 31, 53, .07)}[_nghost-%COMP%]{display:block;width:100%}#ShopOrderDetailPage[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{width:100%}#ShopOrderDetailPage[_ngcontent-%COMP%] .summary-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:24px}@media screen and (max-width:959px){#ShopOrderDetailPage[_ngcontent-%COMP%] .summary-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}#ShopOrderDetailPage[_ngcontent-%COMP%] .summary-card[_ngcontent-%COMP%]{padding:16px}#ShopOrderDetailPage[_ngcontent-%COMP%] .summary-card__title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#122033;margin-bottom:8px;flex-wrap:wrap}#ShopOrderDetailPage[_ngcontent-%COMP%] .summary-card__row[_ngcontent-%COMP%]{color:#64798c;font-size:13px;margin-bottom:4px;overflow-wrap:anywhere}#ShopOrderDetailPage[_ngcontent-%COMP%] .summary-card__row.fail-reason[_ngcontent-%COMP%]{color:#c62828}#ShopOrderDetailPage[_ngcontent-%COMP%] .summary-card__row.service[_ngcontent-%COMP%]{color:#122033;margin-top:8px}#ShopOrderDetailPage[_ngcontent-%COMP%] .summary-card__address[_ngcontent-%COMP%]{font-style:normal;color:#64798c;font-size:13px;line-height:1.5}#ShopOrderDetailPage[_ngcontent-%COMP%] .amounts[_ngcontent-%COMP%]{margin:12px 0 0;border-top:1px solid #e8edf3;padding-top:8px}#ShopOrderDetailPage[_ngcontent-%COMP%] .amounts__row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;font-size:13px;color:#64798c;padding:2px 0}#ShopOrderDetailPage[_ngcontent-%COMP%] .amounts__row[_ngcontent-%COMP%] dt[_ngcontent-%COMP%]{margin:0}#ShopOrderDetailPage[_ngcontent-%COMP%] .amounts__row[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:0;font-variant-numeric:tabular-nums}#ShopOrderDetailPage[_ngcontent-%COMP%] .amounts__row--total[_ngcontent-%COMP%]{color:#122033;font-weight:600;border-top:1px solid #e8edf3;margin-top:4px;padding-top:8px}#ShopOrderDetailPage[_ngcontent-%COMP%] .amounts__note[_ngcontent-%COMP%]{margin:8px 0 0;font-size:12px;line-height:1.4;color:#64798c}#ShopOrderDetailPage[_ngcontent-%COMP%] .lines-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px;flex-wrap:wrap}#ShopOrderDetailPage[_ngcontent-%COMP%] .lines-header__title[_ngcontent-%COMP%]{margin:0;font-size:18px;font-weight:600;color:#122033}#ShopOrderDetailPage[_ngcontent-%COMP%] .label-error[_ngcontent-%COMP%]{margin:0 0 12px;color:#c62828;font-size:13px}#ShopOrderDetailPage[_ngcontent-%COMP%] .line-card[_ngcontent-%COMP%]{padding:16px;margin-bottom:16px}#ShopOrderDetailPage[_ngcontent-%COMP%] .line-card__head[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:12px;flex-wrap:wrap}#ShopOrderDetailPage[_ngcontent-%COMP%] .line-card__name[_ngcontent-%COMP%]{font-size:15px;font-weight:600;color:#122033}#ShopOrderDetailPage[_ngcontent-%COMP%] .line-card__meta[_ngcontent-%COMP%]{color:#64798c;font-size:13px;margin-top:2px}#ShopOrderDetailPage[_ngcontent-%COMP%] .line-card__body[_ngcontent-%COMP%]{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap}#ShopOrderDetailPage[_ngcontent-%COMP%] .line-card__fulfillment[_ngcontent-%COMP%]{flex:1 1 320px;min-width:0}#ShopOrderDetailPage[_ngcontent-%COMP%] .line-card__row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;color:#122033;font-size:13px;margin-bottom:8px;overflow-wrap:anywhere}#ShopOrderDetailPage[_ngcontent-%COMP%] .line-card__row[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;color:#667085;flex:0 0 auto}#ShopOrderDetailPage[_ngcontent-%COMP%] .line-card__row--muted[_ngcontent-%COMP%]{color:#64798c}#ShopOrderDetailPage[_ngcontent-%COMP%] .line-card[_ngcontent-%COMP%] .tracking[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:#244f7e;font-weight:600}#ShopOrderDetailPage[_ngcontent-%COMP%] .line-card[_ngcontent-%COMP%] .tracking__code[_ngcontent-%COMP%]{font-weight:600}#ShopOrderDetailPage[_ngcontent-%COMP%] .line-card[_ngcontent-%COMP%] .tracking__entered[_ngcontent-%COMP%]{color:#667085;margin-left:8px;font-size:12px}#ShopOrderDetailPage[_ngcontent-%COMP%] .line-card[_ngcontent-%COMP%] .labels[_ngcontent-%COMP%]{list-style:none;margin:8px 0 0;padding:0}#ShopOrderDetailPage[_ngcontent-%COMP%] .line-card[_ngcontent-%COMP%] .labels__row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;padding:8px 0;border-top:1px solid #e8edf3;flex-wrap:wrap}#ShopOrderDetailPage[_ngcontent-%COMP%] .line-card[_ngcontent-%COMP%] .labels__code[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:#122033;overflow-wrap:anywhere}#ShopOrderDetailPage[_ngcontent-%COMP%] .line-card__actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex-wrap:wrap}#ShopOrderDetailPage[_ngcontent-%COMP%] .line-card[_ngcontent-%COMP%] .act-void[_ngcontent-%COMP%]:hover:not([disabled]){color:#c62828}"]})}return t})();export{wi as ShopOrderDetailComponent};
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.