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