@billgangcom/theme-lib 1.115.0 → 1.116.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/{builder-CVbCKY8a.js → builder-Bj8ViroH.js} +5 -5
  2. package/dist/{builder-Iu70o8Zi.cjs → builder-CUCCG2gi.cjs} +2 -2
  3. package/dist/{builder-components-3ULrMVTv.cjs → builder-components-D2219YPy.cjs} +1 -1
  4. package/dist/{builder-components-BuaB_nik.js → builder-components-R1dTBy7D.js} +4 -4
  5. package/dist/builder.cjs.js +1 -1
  6. package/dist/builder.es.js +34 -34
  7. package/dist/charge-BrY_-ls8.cjs +109 -0
  8. package/dist/{charge-CqeINukp.js → charge-Cti1lSP2.js} +8389 -8013
  9. package/dist/{checkout-B98fqO6J.cjs → checkout-C-7bV9sk.cjs} +1 -1
  10. package/dist/{checkout-YVutPZ7f.js → checkout-CTbZMuPC.js} +5 -5
  11. package/dist/exports.cjs.js +1 -1
  12. package/dist/exports.es.js +7 -7
  13. package/dist/{index-B3WK0Wpu.js → index-B03fd16N.js} +8 -8
  14. package/dist/{index-BUlydTOo.js → index-BBcZT0G2.js} +5 -5
  15. package/dist/{index-D0izKDtJ.cjs → index-CILywG47.cjs} +1 -1
  16. package/dist/{index-BV4ZiotJ.cjs → index-CQm0i92r.cjs} +1 -1
  17. package/dist/{index-CiY9zOlN.js → index-CUFJfAc6.js} +1 -1
  18. package/dist/{index-C32vke_m.js → index-CUnfTwF8.js} +5 -5
  19. package/dist/{index-D50xf07C.cjs → index-HhcLQjbw.cjs} +1 -1
  20. package/dist/{index-Ck3jvxGA.cjs → index-O5YekXKo.cjs} +1 -1
  21. package/dist/{index-dHSb9Tg9.js → index-OTW9ycHk.js} +5 -5
  22. package/dist/{index-Lf_IZiQr.cjs → index-xbQ-1j9f.cjs} +1 -1
  23. package/dist/index.cjs.js +1 -1
  24. package/dist/index.es.js +14 -14
  25. package/dist/order-1lHCRSUw.js +355 -0
  26. package/dist/order-DNaXADFJ.cjs +1 -0
  27. package/dist/src/storefront/api/index.d.ts +1 -0
  28. package/dist/src/storefront/api/vouches.d.ts +7 -0
  29. package/dist/src/storefront/components/VouchCard/index.d.ts +7 -0
  30. package/dist/src/storefront/components/VouchModal/index.d.ts +12 -0
  31. package/dist/src/storefront/components/index.d.ts +2 -0
  32. package/dist/src/storefront/models/shop.d.ts +1 -0
  33. package/dist/src/ui/Checkbox/index.d.ts +1 -0
  34. package/dist/src/ui/Textarea/index.d.ts +1 -0
  35. package/dist/style.css +1 -1
  36. package/dist/{subscription-4CHOOBkd.cjs → subscription-BS-hdxzD.cjs} +1 -1
  37. package/dist/{subscription-D9tguRYG.js → subscription-DBjS-E8T.js} +5 -5
  38. package/dist/{ticket-BODLy8iD.js → ticket-BtcmMwIl.js} +5 -5
  39. package/dist/{ticket-BKgdPBSh.cjs → ticket-myEl0GYr.cjs} +1 -1
  40. package/dist/{top-up-BxIXamXN.js → top-up-DNSDJwN-.js} +8 -8
  41. package/dist/{top-up-DR4KDupr.cjs → top-up-DTVCb-zx.cjs} +1 -1
  42. package/dist/ui-components-BR9v0VH1.cjs +1 -0
  43. package/dist/{ui-components-B2XdfTmJ.js → ui-components-PK209o-T.js} +978 -968
  44. package/dist/ui.cjs.js +1 -1
  45. package/dist/ui.es.js +1 -1
  46. package/dist/{validation-B_jzusSg.cjs → validation-D3uB6IO3.cjs} +1 -1
  47. package/dist/{validation-BusGxggf.js → validation-DgaNU463.js} +9 -9
  48. package/package.json +1 -1
  49. package/dist/charge-pzp63q8N.cjs +0 -109
  50. package/dist/order-C0KsOrOK.cjs +0 -1
  51. package/dist/order-D4daxyzU.js +0 -325
  52. package/dist/ui-components-DnGzB9kA.cjs +0 -1
@@ -1 +0,0 @@
1
- "use strict";const t=require("react/jsx-runtime"),r=require("react"),x=require("./builder-Iu70o8Zi.cjs"),o=require("./charge-pzp63q8N.cjs"),p=require("./ui-components-DnGzB9kA.cjs");require("./builder-components-3ULrMVTv.cjs");require("./ticket-BKgdPBSh.cjs");require("react-dom");const M=async(s=1)=>await o.fetchOrders({PageNumber:s}),$=()=>{const[s,l]=r.useState(null),[m,e]=r.useState(null),[g,j]=r.useState(0),{page:_}=x.usePaginationPagesStore(),[S,i]=r.useState(!0);async function k(){i(!0);const{list:f,totalCount:y}=await M(_);l(f),j(y),e(null),i(!1)}async function c(){const f=(s==null?void 0:s.map(C=>C.gatewayName))||[],y=await o.getGatewaysDetail(f);e(y)}return r.useEffect(()=>{!m&&s&&c()},[s,m]),r.useEffect(()=>{k()},[_]),t.jsx(t.Fragment,{children:s!=null&&s.length&&s.length===0?t.jsx(o.NoItemsBlock,{title:"No Orders",description:"When you purchase products from our website, you'll see a history of orders here."}):t.jsxs(t.Fragment,{children:[t.jsx(o.PageTitle,{title:"Orders"}),t.jsx(o.OrdersTable,{orders:s,gatewaysDetail:m,totalCount:g,isLoading:S})]})})},T="_orderPage_gc87l_1",q="_leftSection_gc87l_15",L="_content_gc87l_35",W="_main_gc87l_42",E="_mainAntistock_gc87l_56",U="_orderMainDataAntistock_gc87l_69",G="_timelineBlockAntistock_gc87l_81",V="_footerAntistock_gc87l_92",z="_statusBlock_gc87l_104",H="_timelineBlock_gc87l_81",J="_footer_gc87l_92",Y="_rightSection_gc87l_121",K="_header_gc87l_142",Q="_productList_gc87l_150",X="_mobileFooter_gc87l_157",Z="_loaderContainer_gc87l_166",ee="_orderMainData_gc87l_69",te="_prices_gc87l_181",ne="_headerTitle_gc87l_185",se="_headerDescription_gc87l_189",a={orderPage:T,leftSection:q,content:L,main:W,mainAntistock:E,orderMainDataAntistock:U,timelineBlockAntistock:G,footerAntistock:V,statusBlock:z,timelineBlock:H,footer:J,rightSection:Y,header:K,productList:Q,mobileFooter:X,loaderContainer:Z,orderMainData:ee,prices:te,headerTitle:ne,headerDescription:se},oe="_modalContent_1a05n_1",ae="_iconContainer_1a05n_16",ce="_warningIcon_1a05n_20",re="_title_1a05n_25",ie="_description_1a05n_33",le="_buttonContainer_1a05n_40",ue="_button_1a05n_40",d={modalContent:oe,iconContainer:ae,warningIcon:ce,title:re,description:ie,buttonContainer:le,button:ue},de=({isOpen:s,onClose:l,refundedAmount:m,currency:e})=>{var w,v;const g=x.useNavigate(),{token:j,shopDomain:_}=x.useStorefrontStore(),{isAntistock:S,general:i}=x.useGeneralStore(),k=!!((w=i==null?void 0:i.info)!=null&&w.disableSupport),c=(v=i==null?void 0:i.info)==null?void 0:v.thirdPartySupportUrl,f=!(k&&!c),y=new Intl.NumberFormat("en-US",{style:"currency",currency:e}),C=()=>{g(S?"/account":"/customer-dash")},O=async()=>{if(k&&c){window.open(c);return}S?window.open(`https://${_}/support`):g("/contact")},A=()=>{l()};return s?t.jsx(p.Modal,{close:l,children:t.jsxs("div",{className:d.modalContent,onClick:P=>P.stopPropagation(),children:[t.jsx("div",{className:d.iconContainer,children:t.jsx(p.Icon,{name:"WarningDiamond",fill:"var(--text-warning)",className:d.warningIcon})}),t.jsx("h2",{className:d.title,children:"Partial Delivery Failure Refund"}),t.jsxs("p",{className:d.description,children:["Your payment was successful but a few products were out of stock. We've automatically refunded the products that were out of stock, with a total of"," ",y.format(m),", to your account balance."]}),t.jsxs("div",{className:d.buttonContainer,children:[!j&&t.jsx(p.Button,{type:"Secondary",onClick:C,className:d.button,children:"Login"}),f&&t.jsx(p.Button,{type:"Secondary",onClick:O,className:d.button,children:"Contact Support"}),t.jsx(p.Button,{type:"Primary",onClick:A,className:d.button,children:"Continue"})]})]})}):null},me=()=>{var w,v,P,R,B,I;const{id:s,accessToken:l}=x.useParams(),m=x.useNavigate(),[e,g]=r.useState(),[j,_]=r.useState(!1),[S,i]=r.useState(!1),k=o.useCopy(),{isAntistock:c}=x.useGeneralStore(),f=((w=e==null?void 0:e.rawPrice)==null?void 0:w.currency)||"USD",y=new Intl.NumberFormat("en-US",{style:"currency",currency:f}),C=r.useMemo(()=>(e==null?void 0:e.partOrders.map(n=>{var N,D;return{id:(n==null?void 0:n.id)||0,image:n.productWithVariant.image,name:(()=>{var b,F;const u=((b=n.productWithVariant)==null?void 0:b.name)||"",h=((F=n.productWithVariant)==null?void 0:F.variantName)||"";return!u&&!h?"":!h||u===h?u:u?`${u} (${h})`:h})(),description:"",price:{quantity:n.quantity,amount:((N=n.productWithVariant)==null?void 0:N.price.amount)||0,currency:(D=n.productWithVariant)==null?void 0:D.price.currency},deliveryCategories:"deliveryCategories"in n?n.deliveryCategories:void 0,customerNote:n.customerNote,chargeType:n.chargeType||"ONE_TIME",replacementRequests:"replacementRequests"in n?n.replacementRequests:void 0,allowedReplacementReasons:"allowedReplacementReasons"in n?n.allowedReplacementReasons:void 0}}))||[],[e]);r.useEffect(()=>{e&&(e.status===o.OrderStatus.FullDeliveryFailure||e.status===o.OrderStatus.PartiallyDelivered)&&e.refundedPrice&&e.refundedPrice.amount>0&&i(!0)},[e==null?void 0:e.status]);const O=async(n,N,D=!1)=>{var h,b;D||_(!0);const{data:u}=await(N?o.fetchAuthorizedOrder(`${n}/${N}`):o.fetchOrder(n));_(!1),u.status!==o.OrderStatus.Completed&&((h=u.charge)==null?void 0:h.status)===o.ChargeStatus.NotPaid&&m(`/charges/${(b=u.charge)==null?void 0:b.id}`,{replace:!0}),g(u)};r.useLayoutEffect(()=>{if(s&&!l){const n=JSON.parse(localStorage.getItem("orders")||"{}");n[s]&&m(`/orders/${s}/${n[s].fullAccessToken}`)}},[s]),r.useEffect(()=>{s&&O(s,l,!0);const n=setInterval(()=>{s&&O(s,l,!0)},5e3);return()=>{clearInterval(n)}},[s,l]);const A=r.useMemo(()=>!!(e!=null&&e.isApplicableForReplacement&&(e.status===o.OrderStatus.Completed||e.status===o.OrderStatus.PartiallyDelivered||e.status===o.OrderStatus.FullDeliveryFailure)),[e]);return j?t.jsx("div",{className:a.loaderContainer,children:t.jsx(p.Loader,{})}):t.jsxs("div",{className:a.orderPage,children:[t.jsx("div",{className:a.leftSection,children:t.jsxs("div",{className:a.content,children:[t.jsx(o.CheckoutHeader,{}),e&&t.jsxs("div",{className:`${a.main} ${c?a.mainAntistock:""}`,children:[t.jsx(o.OrderStatusBlock,{className:a.statusBlock,orderStatus:e.status}),t.jsxs("div",{className:`${a.orderMainData} ${c?a.orderMainDataAntistock:""}`,children:[t.jsx(o.CheckoutOrderMainData,{lastUpdate:e.createdAt,paymentType:(v=e.charge)==null?void 0:v.gateway,email:e.customer?e.customer.email:((P=e.charge)==null?void 0:P.customerForCharge.email)||"",orderId:e.id}),"accessToken"in e.review&&!c&&t.jsx(o.LeaveAReview,{orderId:e.id,review:e.review})]}),e.charge&&e.charge.timeline&&t.jsx(o.TrackPayment,{className:`${a.timelineBlock} ${c?a.timelineBlockAntistock:""}`,timeline:e.charge.timeline}),t.jsx(o.CheckoutFooter,{className:`${a.footer} ${c?a.footerAntistock:""}`})]})]})}),t.jsx("div",{className:a.rightSection,style:c?{borderLeft:"1px solid var(--border-secondary)"}:void 0,children:t.jsxs("div",{className:a.content,children:[((R=e==null?void 0:e.charge)==null?void 0:R.name)&&t.jsxs("header",{className:a.header,children:[t.jsxs("div",{children:[t.jsx("h1",{className:a.headerTitle,children:e.charge.name}),e.charge.description&&t.jsx("p",{className:a.headerDescription,children:e.charge.description})]}),c?null:t.jsxs(p.Button,{type:"Secondary",onClick:()=>k((e==null?void 0:e.id)||""),style:{whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx(p.Icon,{name:"Copy"}),t.jsx("span",{children:"Copy ID"})]})]}),t.jsxs("div",{children:[t.jsx("div",{className:a.productList,children:C.map(n=>t.jsx(o.CheckoutProduct,{product:n,isOrder:!0,isApplicableForReplacement:A,orderId:s,accessToken:l,allowedReplacementReasons:e==null?void 0:e.allowedReplacementReasons},n.id))}),c?null:t.jsx(o.CheckoutPrices,{formatter:y,coupon:null,total:((B=e==null?void 0:e.endPrice)==null?void 0:B.amount)||0,discount:0,totalWithDiscount:((I=e==null?void 0:e.endPrice)==null?void 0:I.amount)||0,className:a.prices,isShowSubtotal:!1}),t.jsx(o.CheckoutFooter,{className:a.mobileFooter})]})]})}),(e==null?void 0:e.refundedPrice)&&t.jsx(de,{isOpen:S,onClose:()=>i(!1),refundedAmount:e.refundedPrice.amount,currency:e.refundedPrice.currency})]})},he=Object.freeze(Object.defineProperty({__proto__:null,OrderPage:me},Symbol.toStringTag,{value:"Module"}));exports.Orders=$;exports.index=he;
@@ -1,325 +0,0 @@
1
- import { jsx as t, Fragment as T, jsxs as c } from "react/jsx-runtime";
2
- import r, { useState as q, useMemo as U } from "react";
3
- import { X as V, p as W, M as j, V as x, a7 as G } from "./builder-CVbCKY8a.js";
4
- import { f as z, N as H, P as J, O as X, g as Y, b as K, c as w, d as Q, e as Z, h as ee, L as te, T as ne, i as L, j as ae, k as oe, l as se, m as ce, n as ie } from "./charge-CqeINukp.js";
5
- import { M as re, I as E, g as R, e as le } from "./ui-components-B2XdfTmJ.js";
6
- import "./builder-components-BuaB_nik.js";
7
- import "./ticket-BODLy8iD.js";
8
- import "react-dom";
9
- const de = async (a = 1) => await z({ PageNumber: a }), Je = () => {
10
- const [a, l] = r.useState(null), [m, e] = q(null), [p, C] = r.useState(0), { page: f } = V(), [y, i] = r.useState(!0);
11
- async function k() {
12
- i(!0);
13
- const { list: _, totalCount: g } = await de(f);
14
- l(_), C(g), e(null), i(!1);
15
- }
16
- async function s() {
17
- const _ = (a == null ? void 0 : a.map((N) => N.gatewayName)) || [], g = await Y(_);
18
- e(g);
19
- }
20
- return r.useEffect(() => {
21
- !m && a && s();
22
- }, [a, m]), r.useEffect(() => {
23
- k();
24
- }, [f]), /* @__PURE__ */ t(T, { children: a != null && a.length && a.length === 0 ? /* @__PURE__ */ t(
25
- H,
26
- {
27
- title: "No Orders",
28
- description: "When you purchase products from our website, you'll see a history of orders here."
29
- }
30
- ) : /* @__PURE__ */ c(T, { children: [
31
- /* @__PURE__ */ t(J, { title: "Orders" }),
32
- /* @__PURE__ */ t(
33
- X,
34
- {
35
- orders: a,
36
- gatewaysDetail: m,
37
- totalCount: p,
38
- isLoading: y
39
- }
40
- )
41
- ] }) });
42
- }, ue = "_orderPage_gc87l_1", me = "_leftSection_gc87l_15", he = "_content_gc87l_35", pe = "_main_gc87l_42", fe = "_mainAntistock_gc87l_56", _e = "_orderMainDataAntistock_gc87l_69", ge = "_timelineBlockAntistock_gc87l_81", ye = "_footerAntistock_gc87l_92", ke = "_statusBlock_gc87l_104", we = "_timelineBlock_gc87l_81", Ce = "_footer_gc87l_92", Ne = "_rightSection_gc87l_121", Se = "_header_gc87l_142", ve = "_productList_gc87l_150", be = "_mobileFooter_gc87l_157", Pe = "_loaderContainer_gc87l_166", De = "_orderMainData_gc87l_69", Oe = "_prices_gc87l_181", Ae = "_headerTitle_gc87l_185", Re = "_headerDescription_gc87l_189", o = {
43
- orderPage: ue,
44
- leftSection: me,
45
- content: he,
46
- main: pe,
47
- mainAntistock: fe,
48
- orderMainDataAntistock: _e,
49
- timelineBlockAntistock: ge,
50
- footerAntistock: ye,
51
- statusBlock: ke,
52
- timelineBlock: we,
53
- footer: Ce,
54
- rightSection: Ne,
55
- header: Se,
56
- productList: ve,
57
- mobileFooter: be,
58
- loaderContainer: Pe,
59
- orderMainData: De,
60
- prices: Oe,
61
- headerTitle: Ae,
62
- headerDescription: Re
63
- }, Ie = "_modalContent_1a05n_1", Me = "_iconContainer_1a05n_16", Be = "_warningIcon_1a05n_20", $e = "_title_1a05n_25", Fe = "_description_1a05n_33", Te = "_buttonContainer_1a05n_40", Le = "_button_1a05n_40", u = {
64
- modalContent: Ie,
65
- iconContainer: Me,
66
- warningIcon: Be,
67
- title: $e,
68
- description: Fe,
69
- buttonContainer: Te,
70
- button: Le
71
- }, We = ({
72
- isOpen: a,
73
- onClose: l,
74
- refundedAmount: m,
75
- currency: e
76
- }) => {
77
- var S, v;
78
- const p = W(), { token: C, shopDomain: f } = j(), { isAntistock: y, general: i } = x(), k = !!((S = i == null ? void 0 : i.info) != null && S.disableSupport), s = (v = i == null ? void 0 : i.info) == null ? void 0 : v.thirdPartySupportUrl, _ = !(k && !s), g = new Intl.NumberFormat("en-US", {
79
- style: "currency",
80
- currency: e
81
- }), N = () => {
82
- p(y ? "/account" : "/customer-dash");
83
- }, D = async () => {
84
- if (k && s) {
85
- window.open(s);
86
- return;
87
- }
88
- y ? window.open(`https://${f}/support`) : p("/contact");
89
- }, I = () => {
90
- l();
91
- };
92
- return a ? /* @__PURE__ */ t(re, { close: l, children: /* @__PURE__ */ c(
93
- "div",
94
- {
95
- className: u.modalContent,
96
- onClick: (O) => O.stopPropagation(),
97
- children: [
98
- /* @__PURE__ */ t("div", { className: u.iconContainer, children: /* @__PURE__ */ t(
99
- E,
100
- {
101
- name: "WarningDiamond",
102
- fill: "var(--text-warning)",
103
- className: u.warningIcon
104
- }
105
- ) }),
106
- /* @__PURE__ */ t("h2", { className: u.title, children: "Partial Delivery Failure Refund" }),
107
- /* @__PURE__ */ c("p", { className: u.description, children: [
108
- "Your payment was successful but a few products were out of stock. We've automatically refunded the products that were out of stock, with a total of",
109
- " ",
110
- g.format(m),
111
- ", to your account balance."
112
- ] }),
113
- /* @__PURE__ */ c("div", { className: u.buttonContainer, children: [
114
- !C && /* @__PURE__ */ t(
115
- R,
116
- {
117
- type: "Secondary",
118
- onClick: N,
119
- className: u.button,
120
- children: "Login"
121
- }
122
- ),
123
- _ && /* @__PURE__ */ t(
124
- R,
125
- {
126
- type: "Secondary",
127
- onClick: D,
128
- className: u.button,
129
- children: "Contact Support"
130
- }
131
- ),
132
- /* @__PURE__ */ t(
133
- R,
134
- {
135
- type: "Primary",
136
- onClick: I,
137
- className: u.button,
138
- children: "Continue"
139
- }
140
- )
141
- ] })
142
- ]
143
- }
144
- ) }) : null;
145
- }, xe = () => {
146
- var S, v, O, M, B, $;
147
- const { id: a, accessToken: l } = G(), m = W(), [e, p] = r.useState(), [C, f] = r.useState(!1), [y, i] = r.useState(!1), k = K(), { isAntistock: s } = x(), _ = ((S = e == null ? void 0 : e.rawPrice) == null ? void 0 : S.currency) || "USD", g = new Intl.NumberFormat("en-US", {
148
- style: "currency",
149
- currency: _
150
- }), N = r.useMemo(() => (e == null ? void 0 : e.partOrders.map((n) => {
151
- var b, A;
152
- return {
153
- id: (n == null ? void 0 : n.id) || 0,
154
- image: n.productWithVariant.image,
155
- name: (() => {
156
- var P, F;
157
- const d = ((P = n.productWithVariant) == null ? void 0 : P.name) || "", h = ((F = n.productWithVariant) == null ? void 0 : F.variantName) || "";
158
- return !d && !h ? "" : !h || d === h ? d : d ? `${d} (${h})` : h;
159
- })(),
160
- description: "",
161
- price: {
162
- quantity: n.quantity,
163
- amount: ((b = n.productWithVariant) == null ? void 0 : b.price.amount) || 0,
164
- currency: (A = n.productWithVariant) == null ? void 0 : A.price.currency
165
- },
166
- deliveryCategories: "deliveryCategories" in n ? n.deliveryCategories : void 0,
167
- customerNote: n.customerNote,
168
- chargeType: n.chargeType || "ONE_TIME",
169
- replacementRequests: "replacementRequests" in n ? n.replacementRequests : void 0,
170
- allowedReplacementReasons: "allowedReplacementReasons" in n ? n.allowedReplacementReasons : void 0
171
- };
172
- })) || [], [e]);
173
- r.useEffect(() => {
174
- e && (e.status === w.FullDeliveryFailure || e.status === w.PartiallyDelivered) && e.refundedPrice && e.refundedPrice.amount > 0 && i(!0);
175
- }, [e == null ? void 0 : e.status]);
176
- const D = async (n, b, A = !1) => {
177
- var h, P;
178
- A || f(!0);
179
- const { data: d } = await (b ? se(`${n}/${b}`) : ce(n));
180
- f(!1), d.status !== w.Completed && ((h = d.charge) == null ? void 0 : h.status) === ie.NotPaid && m(`/charges/${(P = d.charge) == null ? void 0 : P.id}`, {
181
- replace: !0
182
- }), p(d);
183
- };
184
- r.useLayoutEffect(() => {
185
- if (a && !l) {
186
- const n = JSON.parse(localStorage.getItem("orders") || "{}");
187
- n[a] && m(`/orders/${a}/${n[a].fullAccessToken}`);
188
- }
189
- }, [a]), r.useEffect(() => {
190
- a && D(a, l, !0);
191
- const n = setInterval(() => {
192
- a && D(a, l, !0);
193
- }, 5e3);
194
- return () => {
195
- clearInterval(n);
196
- };
197
- }, [a, l]);
198
- const I = U(() => !!(e != null && e.isApplicableForReplacement && (e.status === w.Completed || e.status === w.PartiallyDelivered || e.status === w.FullDeliveryFailure)), [e]);
199
- return C ? /* @__PURE__ */ t("div", { className: o.loaderContainer, children: /* @__PURE__ */ t(le, {}) }) : /* @__PURE__ */ c("div", { className: o.orderPage, children: [
200
- /* @__PURE__ */ t("div", { className: o.leftSection, children: /* @__PURE__ */ c("div", { className: o.content, children: [
201
- /* @__PURE__ */ t(Q, {}),
202
- e && /* @__PURE__ */ c("div", { className: `${o.main} ${s ? o.mainAntistock : ""}`, children: [
203
- /* @__PURE__ */ t(
204
- Z,
205
- {
206
- className: o.statusBlock,
207
- orderStatus: e.status
208
- }
209
- ),
210
- /* @__PURE__ */ c(
211
- "div",
212
- {
213
- className: `${o.orderMainData} ${s ? o.orderMainDataAntistock : ""}`,
214
- children: [
215
- /* @__PURE__ */ t(
216
- ee,
217
- {
218
- lastUpdate: e.createdAt,
219
- paymentType: (v = e.charge) == null ? void 0 : v.gateway,
220
- email: e.customer ? e.customer.email : ((O = e.charge) == null ? void 0 : O.customerForCharge.email) || "",
221
- orderId: e.id
222
- }
223
- ),
224
- "accessToken" in e.review && !s && /* @__PURE__ */ t(
225
- te,
226
- {
227
- orderId: e.id,
228
- review: e.review
229
- }
230
- )
231
- ]
232
- }
233
- ),
234
- e.charge && e.charge.timeline && /* @__PURE__ */ t(
235
- ne,
236
- {
237
- className: `${o.timelineBlock} ${s ? o.timelineBlockAntistock : ""}`,
238
- timeline: e.charge.timeline
239
- }
240
- ),
241
- /* @__PURE__ */ t(
242
- L,
243
- {
244
- className: `${o.footer} ${s ? o.footerAntistock : ""}`
245
- }
246
- )
247
- ] })
248
- ] }) }),
249
- /* @__PURE__ */ t(
250
- "div",
251
- {
252
- className: o.rightSection,
253
- style: s ? { borderLeft: "1px solid var(--border-secondary)" } : void 0,
254
- children: /* @__PURE__ */ c("div", { className: o.content, children: [
255
- ((M = e == null ? void 0 : e.charge) == null ? void 0 : M.name) && /* @__PURE__ */ c("header", { className: o.header, children: [
256
- /* @__PURE__ */ c("div", { children: [
257
- /* @__PURE__ */ t("h1", { className: o.headerTitle, children: e.charge.name }),
258
- e.charge.description && /* @__PURE__ */ t("p", { className: o.headerDescription, children: e.charge.description })
259
- ] }),
260
- s ? null : /* @__PURE__ */ c(
261
- R,
262
- {
263
- type: "Secondary",
264
- onClick: () => k((e == null ? void 0 : e.id) || ""),
265
- style: {
266
- whiteSpace: "nowrap",
267
- display: "flex",
268
- alignItems: "center",
269
- gap: "4px"
270
- },
271
- children: [
272
- /* @__PURE__ */ t(E, { name: "Copy" }),
273
- /* @__PURE__ */ t("span", { children: "Copy ID" })
274
- ]
275
- }
276
- )
277
- ] }),
278
- /* @__PURE__ */ c("div", { children: [
279
- /* @__PURE__ */ t("div", { className: o.productList, children: N.map((n) => /* @__PURE__ */ t(
280
- ae,
281
- {
282
- product: n,
283
- isOrder: !0,
284
- isApplicableForReplacement: I,
285
- orderId: a,
286
- accessToken: l,
287
- allowedReplacementReasons: e == null ? void 0 : e.allowedReplacementReasons
288
- },
289
- n.id
290
- )) }),
291
- s ? null : /* @__PURE__ */ t(
292
- oe,
293
- {
294
- formatter: g,
295
- coupon: null,
296
- total: ((B = e == null ? void 0 : e.endPrice) == null ? void 0 : B.amount) || 0,
297
- discount: 0,
298
- totalWithDiscount: (($ = e == null ? void 0 : e.endPrice) == null ? void 0 : $.amount) || 0,
299
- className: o.prices,
300
- isShowSubtotal: !1
301
- }
302
- ),
303
- /* @__PURE__ */ t(L, { className: o.mobileFooter })
304
- ] })
305
- ] })
306
- }
307
- ),
308
- (e == null ? void 0 : e.refundedPrice) && /* @__PURE__ */ t(
309
- We,
310
- {
311
- isOpen: y,
312
- onClose: () => i(!1),
313
- refundedAmount: e.refundedPrice.amount,
314
- currency: e.refundedPrice.currency
315
- }
316
- )
317
- ] });
318
- }, Xe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
319
- __proto__: null,
320
- OrderPage: xe
321
- }, Symbol.toStringTag, { value: "Module" }));
322
- export {
323
- Je as O,
324
- Xe as i
325
- };