@billgangcom/theme-lib 1.116.8 → 1.117.1
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-f0ugx4fz.js → builder-CQ8x7LFT.js} +1212 -1211
- package/dist/{builder-DmYqtNP5.cjs → builder-DH3c-jV8.cjs} +13 -13
- package/dist/{builder-components-BK2fDGJl.js → builder-components-BN-jGGPV.js} +1910 -1906
- package/dist/builder-components-BaTkvImB.cjs +5 -0
- package/dist/builder.cjs.js +1 -1
- package/dist/builder.es.js +212 -164
- package/dist/{charge-qD5mRJMf.cjs → charge-5SKFeEV5.cjs} +37 -37
- package/dist/{charge-1negffI8.js → charge-Cp5L5y1Y.js} +5231 -5138
- package/dist/{checkout-DIRNbVFS.js → checkout-D00CDp8M.js} +7 -7
- package/dist/{checkout-0ERLAcm8.cjs → checkout-DKTx23PY.cjs} +1 -1
- package/dist/exports.cjs.js +1 -1
- package/dist/exports.es.js +7 -7
- package/dist/{index-CEMM_pXQ.js → index-C7qlAf4E.js} +5 -5
- package/dist/{index-_yYkATZJ.js → index-CLSmm7Uw.js} +5 -5
- package/dist/{index-DX-dir-7.js → index-CVwe6iy7.js} +10 -10
- package/dist/{index-yxPurcYj.js → index-C_mAl-7y.js} +5 -5
- package/dist/{index-CidwOaYu.js → index-DApjGedA.js} +1 -1
- package/dist/{index-DBWEXhcg.cjs → index-DTDz_VSR.cjs} +1 -1
- package/dist/{index-D_AQGApz.cjs → index-Dajo5uDd.cjs} +1 -1
- package/dist/{index-DpNZtNdj.cjs → index-EqXaEf4V.cjs} +1 -1
- package/dist/{index-CEeFFpYv.cjs → index-eFdwvNhR.cjs} +1 -1
- package/dist/{index-CPO9oLj9.cjs → index-x5gSPcne.cjs} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +12 -12
- package/dist/order-DZNRAN4s.cjs +1 -0
- package/dist/order-Dh9SQdyW.js +277 -0
- package/dist/src/storefront/components/index.d.ts +1 -0
- package/dist/src/storefront/models/order.d.ts +3 -1
- package/dist/style.css +1 -1
- package/dist/{subscription-B24hZj7z.js → subscription-CAuIobXb.js} +7 -7
- package/dist/{subscription-0kB79dBi.cjs → subscription-CYm0ZyD6.cjs} +1 -1
- package/dist/{ticket-CrHG13A9.js → ticket--HqQx1ul.js} +5 -5
- package/dist/{ticket-3757pxOF.cjs → ticket-CzQwmTeE.cjs} +1 -1
- package/dist/{top-up-C3RpekTg.cjs → top-up-CYOVTbLN.cjs} +1 -1
- package/dist/{top-up-CFmQGXRJ.js → top-up-dq46L5ER.js} +5 -5
- package/dist/ui-components-Bp5fbjcw.cjs +1 -0
- package/dist/{ui-components-eSiLgpmM.js → ui-components-Ca4onG3X.js} +5 -5
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +1 -1
- package/dist/{validation-BMZ9cbHF.js → validation-C4N1CvhJ.js} +11 -11
- package/dist/{validation-Cajf8X9j.cjs → validation-PrGazRlX.cjs} +1 -1
- package/package.json +1 -1
- package/dist/builder-components-CqkelDOu.cjs +0 -5
- package/dist/order-BrYztFSw.js +0 -356
- package/dist/order-CnCo2Gt1.cjs +0 -1
- package/dist/ui-components-Ca0Z19h_.cjs +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as e, jsxs as j } from "react/jsx-runtime";
|
|
2
|
-
import { u as D, C as N, a as x } from "./charge-
|
|
3
|
-
import {
|
|
2
|
+
import { u as D, C as N, a as x } from "./charge-Cp5L5y1Y.js";
|
|
3
|
+
import { K as A, p as G } from "./builder-CQ8x7LFT.js";
|
|
4
4
|
import c from "react";
|
|
5
|
-
import { e as P } from "./ui-components-
|
|
6
|
-
import "./builder-components-
|
|
7
|
-
import "./ticket
|
|
5
|
+
import { e as P } from "./ui-components-Ca4onG3X.js";
|
|
6
|
+
import "./builder-components-BN-jGGPV.js";
|
|
7
|
+
import "./ticket--HqQx1ul.js";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
const S = "_checkoutContainer_thje1_1", b = "_loaderContainer_thje1_20", s = {
|
|
10
10
|
checkoutContainer: S,
|
|
11
11
|
loaderContainer: b
|
|
12
|
-
},
|
|
12
|
+
}, O = () => {
|
|
13
13
|
const { isAntistock: a } = A(), {
|
|
14
14
|
cart: t,
|
|
15
15
|
products: n,
|
|
@@ -73,5 +73,5 @@ const S = "_checkoutContainer_thje1_1", b = "_loaderContainer_thje1_20", s = {
|
|
|
73
73
|
] });
|
|
74
74
|
};
|
|
75
75
|
export {
|
|
76
|
-
|
|
76
|
+
O as Checkout
|
|
77
77
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("./charge-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("./charge-5SKFeEV5.cjs"),u=require("./builder-DH3c-jV8.cjs"),l=require("react"),_=require("./ui-components-Bp5fbjcw.cjs");require("./builder-components-BaTkvImB.cjs");require("./ticket-CzQwmTeE.cjs");require("react-dom");const b="_checkoutContainer_thje1_1",S="_loaderContainer_thje1_20",s={checkoutContainer:b,loaderContainer:S},D=()=>{const{isAntistock:r}=u.useGeneralStore(),{cart:t,products:c,pending:d,getTotalAndDiscount:C,getPossibleGateways:h,submitCart:p,setGateway:m,applyCoupon:g,setDiscordSocialConnectId:j,setCustomFields:k,applyCouponPending:y,coupon:i,removeCoupon:q,getDiscordSettings:v,setPaymentMethod:x,reset:f}=n.useCart(),a=l.useMemo(()=>C(),[i,t]),o=u.useNavigate();return l.useEffect(()=>{if(t.parts.length===0){if(r){o("/");return}try{o(-1)}catch{o("/")}}},[t.parts]),d?e.jsx("div",{className:s.checkoutContainer,children:e.jsx("div",{className:s.loaderContainer,children:e.jsx(_.Loader,{})})}):e.jsxs("div",{className:s.checkoutContainer,children:[e.jsx(n.CheckoutItems,{cart:t,products:c,applyCoupon:g,applyCouponPending:y,coupon:i,removeCoupon:q,totalAndDiscount:a}),e.jsx(n.CheckoutOperational,{cart:t,getPossibleGateways:h,setGateway:m,getDiscordSettings:v,products:c,submitCart:p,totalAndDiscount:a,setCustomFieldsToCart:k,setDiscordSocialConnectId:j,setPaymentMethod:x,reset:f,isAntistock:r})]})};exports.Checkout=D;
|
package/dist/exports.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("react");const o=require("./builder-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("react");const o=require("./builder-DH3c-jV8.cjs");require("./ui-components-Bp5fbjcw.cjs");require("./builder-components-BaTkvImB.cjs");const t=require("./charge-5SKFeEV5.cjs"),e=require("./ticket-CzQwmTeE.cjs"),r=require("./checkout-DKTx23PY.cjs");require("react-dom");exports.AntistockRoutes=o.AntistockRoutes;exports.Routes=o.Routes;exports.formatPrice=o.formatPrice;exports.MarkdownText=t.MarkdownText;exports.ReCaptchaProvider=t.ReCaptchaProvider;exports.parseDraftJsText=t.parseDraftJsText;exports.useCart=t.useCart;exports.useGeneralInfo=t.useGeneralInfo;exports.useMarkdownIt=t.useMarkdownIt;exports.useReCaptcha=t.useReCaptcha;exports.ColorVariables=e.ColorVariables;exports.aspectRatioOptions=e.aspectRatioOptions;exports.hotReload=e.hotReload;exports.iconNames=e.iconNames;exports.removeNotification=e.removeNotification;exports.showNotification=e.showNotification;exports.splitTextIntoSpans=e.splitTextIntoSpans;exports.useAdaptiveStyles=e.useAdaptiveStyles;exports.useBalance=e.useBalance;exports.useBuilderPages=e.useBuilderPages;exports.useCreateTicket=e.useCreateTicket;exports.Checkout=r.Checkout;
|
package/dist/exports.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { Y as p, Z as u, _ as c } from "./builder-
|
|
4
|
-
import "./ui-components-
|
|
5
|
-
import "./builder-components-
|
|
6
|
-
import { M as n,
|
|
7
|
-
import { C as k, c as I, h as T, i as v, r as w, d as M, s as N, u as P, e as b, b as A, a as B } from "./ticket
|
|
8
|
-
import { Checkout as J } from "./checkout-
|
|
3
|
+
import { Y as p, Z as u, _ as c } from "./builder-CQ8x7LFT.js";
|
|
4
|
+
import "./ui-components-Ca4onG3X.js";
|
|
5
|
+
import "./builder-components-BN-jGGPV.js";
|
|
6
|
+
import { M as n, G as f, J as l, u as d, I as x, K as C, H as h } from "./charge-Cp5L5y1Y.js";
|
|
7
|
+
import { C as k, c as I, h as T, i as v, r as w, d as M, s as N, u as P, e as b, b as A, a as B } from "./ticket--HqQx1ul.js";
|
|
8
|
+
import { Checkout as J } from "./checkout-D00CDp8M.js";
|
|
9
9
|
import "react-dom";
|
|
10
10
|
export {
|
|
11
11
|
p as AntistockRoutes,
|
|
@@ -29,5 +29,5 @@ export {
|
|
|
29
29
|
B as useCreateTicket,
|
|
30
30
|
x as useGeneralInfo,
|
|
31
31
|
C as useMarkdownIt,
|
|
32
|
-
|
|
32
|
+
h as useReCaptcha
|
|
33
33
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import "./builder-
|
|
2
|
+
import "./builder-CQ8x7LFT.js";
|
|
3
3
|
import e from "react";
|
|
4
|
-
import { e as r } from "./ui-components-
|
|
5
|
-
import "./builder-components-
|
|
6
|
-
import "./charge-
|
|
7
|
-
import "./ticket
|
|
4
|
+
import { e as r } from "./ui-components-Ca4onG3X.js";
|
|
5
|
+
import "./builder-components-BN-jGGPV.js";
|
|
6
|
+
import "./charge-Cp5L5y1Y.js";
|
|
7
|
+
import "./ticket--HqQx1ul.js";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
const f = () => (e.useEffect(() => {
|
|
10
10
|
setTimeout(() => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { B as m, a as w, C as _ } from "./ui-components-
|
|
2
|
+
import { B as m, a as w, C as _ } from "./ui-components-Ca4onG3X.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { j as I, r as b, s as j, b as v, J as P, k as T, u as k } from "./builder-
|
|
5
|
-
import "./builder-components-
|
|
6
|
-
import "./charge-
|
|
7
|
-
import "./ticket
|
|
4
|
+
import { j as I, r as b, s as j, b as v, J as P, k as T, u as k } from "./builder-CQ8x7LFT.js";
|
|
5
|
+
import "./builder-components-BN-jGGPV.js";
|
|
6
|
+
import "./charge-Cp5L5y1Y.js";
|
|
7
|
+
import "./ticket--HqQx1ul.js";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
const C = "_wrapper_1yd2j_1", A = "_error_1yd2j_11", N = "_title_1yd2j_21", B = "_buttons_1yd2j_29", i = {
|
|
10
10
|
wrapper: C,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as o, jsxs as N, Fragment as g } from "react/jsx-runtime";
|
|
2
2
|
import r from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { g as
|
|
6
|
-
import { e as
|
|
7
|
-
import "./builder-components-
|
|
3
|
+
import { Y as z, a0 as U } from "./charge-Cp5L5y1Y.js";
|
|
4
|
+
import { N as f, O as T, ab as F, p as G, a6 as R, e as H, Q as V, m as Y, a as q, u as B, K, b as M, al as Q, ag as X } from "./builder-CQ8x7LFT.js";
|
|
5
|
+
import { g as Z } from "./ticket--HqQx1ul.js";
|
|
6
|
+
import { e as $, N as ee, p as te } from "./ui-components-Ca4onG3X.js";
|
|
7
|
+
import "./builder-components-BN-jGGPV.js";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
const se = "_notifications_1ntnm_1", ae = "_wrapper_1ntnm_12", x = {
|
|
10
10
|
notifications: se,
|
|
@@ -68,14 +68,14 @@ function ne() {
|
|
|
68
68
|
a && (i.delete("customerAccessToken"), localStorage.setItem("token", a), l(a), d(null));
|
|
69
69
|
}
|
|
70
70
|
const pe = ({ children: i }) => {
|
|
71
|
-
const a = F(), { token: l, setToken: d } = f(), { dashInfo: S, setDashInfo: y } = T(), { shopPassword: u } = f(), v = G(), [c, b] = R(), { notifications: w } =
|
|
72
|
-
|
|
71
|
+
const a = F(), { token: l, setToken: d } = f(), { dashInfo: S, setDashInfo: y } = T(), { shopPassword: u } = f(), v = G(), [c, b] = R(), { notifications: w } = H(), [I, p] = r.useState(!0), { setCustomerEmail: D } = V(), { setThemeSettings: k, themeSettings: A } = Y(), { settings: C, setSettings: P } = q(), { setHeader: _, setFooter: E, setAnnouncement: L } = B(), { general: t, setGeneral: O, isAntistock: h } = K(), { pageContext: J, setPageContext: W } = M();
|
|
72
|
+
Q(
|
|
73
73
|
(t == null ? void 0 : t.info.id) || localStorage.getItem("shopId") || null,
|
|
74
74
|
"production",
|
|
75
75
|
h
|
|
76
76
|
);
|
|
77
77
|
const j = async () => {
|
|
78
|
-
const e = await
|
|
78
|
+
const e = await Z(
|
|
79
79
|
encodeURIComponent("/products"),
|
|
80
80
|
t == null ? void 0 : t.info.passwordProtected
|
|
81
81
|
);
|
|
@@ -93,7 +93,7 @@ const pe = ({ children: i }) => {
|
|
|
93
93
|
const e = localStorage.getItem("token");
|
|
94
94
|
if (e && (!l || !S))
|
|
95
95
|
try {
|
|
96
|
-
const n =
|
|
96
|
+
const n = X(e);
|
|
97
97
|
y(n), d(e), D(n.email);
|
|
98
98
|
} catch (n) {
|
|
99
99
|
console.error("Failed to decode token:", n), localStorage.removeItem("token"), d(""), y(null);
|
|
@@ -130,7 +130,7 @@ const pe = ({ children: i }) => {
|
|
|
130
130
|
s ? (s.settings && P(s.settings), s.header && _(JSON.parse(JSON.stringify(s.header))), s.footer && E(JSON.parse(JSON.stringify(s.footer))), s.announcement && L(JSON.parse(JSON.stringify(s.announcement)))) : P(C), k(m || A), p(!1);
|
|
131
131
|
};
|
|
132
132
|
a.pathname.startsWith("/validation") || e(), n();
|
|
133
|
-
}, []), h && (t != null && t.info.onHold) ? /* @__PURE__ */ o(oe, {}) : a.pathname.startsWith("/admin/builder") ? /* @__PURE__ */ o(g, { children: i }) : /* @__PURE__ */ o(g, { children: I ? /* @__PURE__ */ o("div", { className: x.wrapper, children: /* @__PURE__ */ o(
|
|
133
|
+
}, []), h && (t != null && t.info.onHold) ? /* @__PURE__ */ o(oe, {}) : a.pathname.startsWith("/admin/builder") ? /* @__PURE__ */ o(g, { children: i }) : /* @__PURE__ */ o(g, { children: I ? /* @__PURE__ */ o("div", { className: x.wrapper, children: /* @__PURE__ */ o($, {}) }) : /* @__PURE__ */ N(g, { children: [
|
|
134
134
|
i,
|
|
135
135
|
w.length > 0 && /* @__PURE__ */ o("div", { className: x.notifications, children: w.map((e) => /* @__PURE__ */ o(
|
|
136
136
|
ee,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
import { g as i } from "./ui-components-
|
|
2
|
+
import { g as i } from "./ui-components-Ca4onG3X.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { p as s, am as a } from "./builder-
|
|
5
|
-
import "./builder-components-
|
|
6
|
-
import "./charge-
|
|
7
|
-
import "./ticket
|
|
4
|
+
import { p as s, am as a } from "./builder-CQ8x7LFT.js";
|
|
5
|
+
import "./builder-components-BN-jGGPV.js";
|
|
6
|
+
import "./charge-Cp5L5y1Y.js";
|
|
7
|
+
import "./ticket--HqQx1ul.js";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
const c = "_wrapper_ej209_1", m = "_content_ej209_12", p = "_title_ej209_22", r = {
|
|
10
10
|
wrapper: c,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as n, Fragment as m } from "react/jsx-runtime";
|
|
2
|
-
import { ab as d, o as l, m as b, i as u, q as t, z as s } from "./builder-
|
|
2
|
+
import { ab as d, o as l, m as b, i as u, q as t, z as s } from "./builder-CQ8x7LFT.js";
|
|
3
3
|
import k from "react";
|
|
4
4
|
const B = (i) => {
|
|
5
5
|
const { children: c } = i, { pathname: r } = d(), { setActiveBlock: e } = l(), { setActiveBlock: a } = b(), { setActiveBlock: o } = u();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("./ui-components-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("./ui-components-Bp5fbjcw.cjs");require("react");const n=require("./builder-DH3c-jV8.cjs");require("./builder-components-BaTkvImB.cjs");require("./charge-5SKFeEV5.cjs");require("./ticket-CzQwmTeE.cjs");require("react-dom");const s="_wrapper_ej209_1",c="_content_ej209_12",a="_title_ej209_22",r={wrapper:s,content:c,title:a},l=()=>{const o=n.useNavigate(),t=n.useRouteError();return console.error("ROUTE ERROR: ",t),alert(t),e.jsx("div",{className:r.wrapper,children:e.jsxs("div",{className:r.content,children:[e.jsx("h1",{className:r.title,children:"Something Went Wrong"}),e.jsx(i.Button,{type:"Primary",onClick:()=>{o("/")},children:"Go Home"})]})})};exports.DynamicErrorPage=l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),i=require("react"),P=require("./charge-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),i=require("react"),P=require("./charge-5SKFeEV5.cjs"),t=require("./builder-DH3c-jV8.cjs"),J=require("./ticket-CzQwmTeE.cjs"),g=require("./ui-components-Bp5fbjcw.cjs");require("./builder-components-BaTkvImB.cjs");require("react-dom");const _="_notifications_1ntnm_1",F="_wrapper_1ntnm_12",j={notifications:_,wrapper:F},z=()=>(i.useEffect(()=>{document.title="Temporarily Unavailable"},[]),s.jsx("div",{style:{display:"flex",flexDirection:"column",width:"100vw",height:"100vh",overflowY:"scroll",overflowX:"hidden",background:"var(--surface-primary)",color:"var(--text-primary)"},children:s.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1",justifyContent:"center",alignItems:"center",gap:"24px"},children:[s.jsx("h2",{style:{color:"var(--text-primary)",fontSize:"var(--font-heading-h2-size)"},children:"Temporarily Unavailable"}),s.jsx("span",{style:{color:"var(--text-secondary)",fontSize:"var(--font-heading-h3-size)",width:"85%",textAlign:"center"},children:"We're making some quick updates to improve your shopping experience. During this time, browsing and checkout are temporarily unavailable."})]})}));function R(){const c=new URLSearchParams(document.location.search),n=c.get("customerAccessToken"),{setToken:d}=t.useStorefrontStore.getState(),{setDashInfo:u}=t.useCustomerDashboardStore.getState();n&&(c.delete("customerAccessToken"),localStorage.setItem("token",n),d(n),u(null))}const U=({children:c})=>{const n=t.useLocation(),{token:d,setToken:u}=t.useStorefrontStore(),{dashInfo:S,setDashInfo:y}=t.useCustomerDashboardStore(),{shopPassword:f}=t.useStorefrontStore(),v=t.useNavigate(),[l,b]=t.useSearchParams(),{notifications:x}=t.useNotificationStore(),[T,h]=i.useState(!0),{setCustomerEmail:I}=t.useCartStore(),{setThemeSettings:w,themeSettings:N}=t.useThemeSettingsStore(),{settings:C,setSettings:k}=t.useSettingsStore(),{setHeader:D,setFooter:q,setAnnouncement:A}=t.useLayersStore(),{general:o,setGeneral:E,isAntistock:p}=t.useGeneralStore(),{pageContext:L,setPageContext:O}=t.usePagesStore();t.useTrackingAnalytics((o==null?void 0:o.info.id)||localStorage.getItem("shopId")||null,"production",p);const W=async()=>{const e=await J.getDynamicPage(encodeURIComponent("/products"),o==null?void 0:o.info.passwordProtected);if(e){const{data:a}=e;O({...L,listings:a.listings})}};return i.useEffect(()=>{R()},[]),i.useEffect(()=>{const e=localStorage.getItem("token");if(e&&(!d||!S))try{const a=t.jwtDecode(e);y(a),u(e),I(a.email)}catch(a){console.error("Failed to decode token:",a),localStorage.removeItem("token"),u(""),y(null)}},[d,S]),i.useEffect(()=>{const e=l.get("r");e&&(localStorage.setItem("referralCode",e),l.delete("r"),b(l),v({pathname:n.pathname,search:l.toString()},{replace:!0}))},[l,n]),i.useEffect(()=>{!n.pathname.startsWith("/products")&&!n.pathname.startsWith("/admin/builder")&&o&&(o.info.passwordProtected&&f||o.isPasswordValid)&&W()},[o,f]),i.useLayoutEffect(()=>{const e=async()=>{if(h(!0),!o){const r=await P.fetchGeneral(f);if(!r.isPasswordValid&&!n.pathname.includes("/admin/builder")){v("/validation",{state:{from:n.pathname}});return}if(!r.info.passwordProtected){localStorage.removeItem("shopPassword");const{setShopPassword:m}=t.useStorefrontStore.getState();m("")}E(r)}},a=async()=>{h(!0);const{settings:r,theme:m}=(await P.fetchThemeAndSettings()).data;r?(r.settings&&k(r.settings),r.header&&D(JSON.parse(JSON.stringify(r.header))),r.footer&&q(JSON.parse(JSON.stringify(r.footer))),r.announcement&&A(JSON.parse(JSON.stringify(r.announcement)))):k(C),w(m||N),h(!1)};n.pathname.startsWith("/validation")||e(),a()},[]),p&&(o!=null&&o.info.onHold)?s.jsx(z,{}):n.pathname.startsWith("/admin/builder")?s.jsx(s.Fragment,{children:c}):s.jsx(s.Fragment,{children:T?s.jsx("div",{className:j.wrapper,children:s.jsx(g.Loader,{})}):s.jsxs(s.Fragment,{children:[c,x.length>0&&s.jsx("div",{className:j.notifications,children:x.map(e=>s.jsx(g.NotificationBuilder,{type:e.status,message:e.message,timer:e.timer||10,id:e.id,element:p?g.NotificationAntistock:e.component,label:e.label},e.id))})]})})};exports.WrapperPage=U;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),e=require("./builder-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),e=require("./builder-DH3c-jV8.cjs"),o=require("react"),l=r=>{const{children:i}=r,{pathname:a}=e.useLocation(),{setActiveBlock:t}=e.useNavbarStore(),{setActiveBlock:s}=e.useThemeSettingsStore(),{setActiveBlock:n}=e.usePreviewStore();return o.useEffect(()=>{switch(n({id:null,neededScroll:!1}),a){case"/admin/builder":t(e.navbarBlocks[0]);break;case"/admin/builder/add":t(e.navbarBlocks[1]);break;case"/admin/builder/theme":t(e.navbarBlocks[2]);break;case"/admin/builder/settings":t(e.navbarBlocks[3]);break;case"/admin/builder/theme/colors":t(e.navbarBlocks[2]),s(e.themeSettingsBlocks[0]);break;case"/admin/builder/theme/fonts":t(e.navbarBlocks[2]),s(e.themeSettingsBlocks[1]);break;case"/admin/builder/theme/borders":t(e.navbarBlocks[2]),s(e.themeSettingsBlocks[2]);break;case"/admin/builder/theme/buttons":t(e.navbarBlocks[2]),s(e.themeSettingsBlocks[3]);break;case"/admin/builder/theme/inputs":t(e.navbarBlocks[2]),s(e.themeSettingsBlocks[4]);break}},[a]),c.jsx(c.Fragment,{children:i})};exports.ActivePage=l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("./builder-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("./builder-DH3c-jV8.cjs");const r=require("react"),t=require("./ui-components-Bp5fbjcw.cjs");require("./builder-components-BaTkvImB.cjs");require("./charge-5SKFeEV5.cjs");require("./ticket-CzQwmTeE.cjs");require("react-dom");const i=()=>(r.useEffect(()=>{setTimeout(()=>{window.location.reload()},500)},[]),e.jsx("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:e.jsx(t.Loader,{})}));exports.RouterErrorPage=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("./ui-components-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("./ui-components-Bp5fbjcw.cjs");require("react");const s=require("./builder-DH3c-jV8.cjs");require("./builder-components-BaTkvImB.cjs");require("./charge-5SKFeEV5.cjs");require("./ticket-CzQwmTeE.cjs");require("react-dom");const j="_wrapper_1yd2j_1",w="_error_1yd2j_11",_="_title_1yd2j_21",b="_buttons_1yd2j_29",i={wrapper:j,error:w,title:_,buttons:b},S=async e=>{const o=localStorage.getItem("shopId")||void 0,r=localStorage.getItem("draftId"),d=`${s.useApiStore.getState().apiUrls.api}/v2/builder/shops/${o}/drafts/${r}/reset`;return await s.request({url:d,withToken:!0,method:"post",body:e})},x=()=>{const{error:e,setError:o}=s.useErrorStore(),{pages:r}=s.usePagesStore(),{setIsOpen:c}=s.useModalStore(),{title:d,description:m,setOnConfirm:u,setTitle:g,setDescription:p}=s.useConfirmationModalStore(),{setBlocks:h}=s.useLayersStore();async function y(){await S({resetSettings:(e==null?void 0:e.failedSettings)??!1,resetThemeSettings:(e==null?void 0:e.failedThemeSettings)??!1,resetPageIds:(e==null?void 0:e.failedPageIds)??[]}),o(null),h({}),window.location.reload()}async function f(){const a=[];r&&Object.keys(r).map(n=>r[n].id).filter(n=>n!==void 0).map(n=>a.push(n)),await S({resetSettings:!0,resetThemeSettings:!0,resetPageIds:a}),o(null)}return t.jsxs("div",{className:i.wrapper,children:[t.jsxs("div",{className:i.error,children:[t.jsxs("div",{children:[t.jsx("div",{className:i.title,children:"Oops! Something went wrong"}),t.jsx("span",{className:i.message,children:(e==null?void 0:e.message)||""})]}),t.jsxs("div",{className:i.buttons,children:[t.jsx(l.ButtonSettings,{type:"Primary",onClick:y,children:"Reset Settings"}),t.jsx(l.ButtonSettings,{type:"Secondary",onClick:a=>{a.stopPropagation(),g("Reset All Settings"),p("Are you sure you want to reset all settings? This is irreversible."),u(async()=>{await f()})},children:"Reset All Settings"})]})]}),d&&m&&t.jsx(l.BuilderModal,{close:()=>{c(!1),setTimeout(()=>{g(null),p(null),u(null),c(!0)},300)},children:t.jsx(l.ConfirmationModal,{})})]})};exports.ErrorPage=x;
|
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./builder.cjs.js"),a=require("./builder-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./builder.cjs.js"),a=require("./builder-DH3c-jV8.cjs");require("react/jsx-runtime");const c=require("react"),t=require("./ui-components-Bp5fbjcw.cjs");require("./builder-components-BaTkvImB.cjs");const r=require("./charge-5SKFeEV5.cjs"),e=require("./ticket-CzQwmTeE.cjs");require("react-dom");function u(o){c.useEffect(()=>{Object.entries(o).forEach(([s,i])=>{t.registerIcon(s,i)})},[o])}function g(o){Object.entries(o).forEach(([s,i])=>{t.registerIcon(s,i)})}exports.App=n.App;exports.AntistockRoutes=a.AntistockRoutes;exports.Routes=a.Routes;exports.formatPrice=a.formatPrice;exports.Icon=t.Icon;exports.getRegisteredIcon=t.getRegisteredIcon;exports.getRegisteredIcons=t.getRegisteredIcons;exports.isIconRegistered=t.isIconRegistered;exports.registerIcon=t.registerIcon;exports.MarkdownText=r.MarkdownText;exports.ReCaptchaProvider=r.ReCaptchaProvider;exports.parseDraftJsText=r.parseDraftJsText;exports.useCart=r.useCart;exports.useGeneralInfo=r.useGeneralInfo;exports.useMarkdownIt=r.useMarkdownIt;exports.useReCaptcha=r.useReCaptcha;exports.ColorVariables=e.ColorVariables;exports.aspectRatioOptions=e.aspectRatioOptions;exports.hotReload=e.hotReload;exports.iconNames=e.iconNames;exports.removeNotification=e.removeNotification;exports.showNotification=e.showNotification;exports.splitTextIntoSpans=e.splitTextIntoSpans;exports.useAdaptiveStyles=e.useAdaptiveStyles;exports.useBalance=e.useBalance;exports.useBuilderPages=e.useBuilderPages;exports.useCreateTicket=e.useCreateTicket;exports.registerIcons=g;exports.useIconRegistration=u;
|
package/dist/index.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { App as
|
|
2
|
-
import { Y as g, Z as l, _ as x } from "./builder-
|
|
1
|
+
import { App as d } from "./builder.es.js";
|
|
2
|
+
import { Y as g, Z as l, _ as x } from "./builder-CQ8x7LFT.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import { useEffect as o } from "react";
|
|
5
|
-
import { r as t } from "./ui-components-
|
|
6
|
-
import { I as C, l as b, n as k, m as T } from "./ui-components-
|
|
7
|
-
import "./builder-components-
|
|
8
|
-
import { M as w,
|
|
9
|
-
import { C as B, c as G, h as J, i as S, r as y, d as D, s as H, u as
|
|
5
|
+
import { r as t } from "./ui-components-Ca4onG3X.js";
|
|
6
|
+
import { I as C, l as b, n as k, m as T } from "./ui-components-Ca4onG3X.js";
|
|
7
|
+
import "./builder-components-BN-jGGPV.js";
|
|
8
|
+
import { M as w, G as A, J as E, u as M, I as N, K as O, H as P } from "./charge-Cp5L5y1Y.js";
|
|
9
|
+
import { C as B, c as G, h as J, i as S, r as y, d as D, s as H, u as K, e as V, b as Y, a as Z } from "./ticket--HqQx1ul.js";
|
|
10
10
|
import "react-dom";
|
|
11
11
|
function f(e) {
|
|
12
12
|
o(() => {
|
|
@@ -22,7 +22,7 @@ function u(e) {
|
|
|
22
22
|
}
|
|
23
23
|
export {
|
|
24
24
|
g as AntistockRoutes,
|
|
25
|
-
|
|
25
|
+
d as App,
|
|
26
26
|
B as ColorVariables,
|
|
27
27
|
C as Icon,
|
|
28
28
|
w as MarkdownText,
|
|
@@ -41,11 +41,11 @@ export {
|
|
|
41
41
|
y as removeNotification,
|
|
42
42
|
D as showNotification,
|
|
43
43
|
H as splitTextIntoSpans,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
K as useAdaptiveStyles,
|
|
45
|
+
V as useBalance,
|
|
46
|
+
Y as useBuilderPages,
|
|
47
47
|
M as useCart,
|
|
48
|
-
|
|
48
|
+
Z as useCreateTicket,
|
|
49
49
|
N as useGeneralInfo,
|
|
50
50
|
f as useIconRegistration,
|
|
51
51
|
O as useMarkdownIt,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime"),i=require("react"),x=require("./builder-DH3c-jV8.cjs"),a=require("./charge-5SKFeEV5.cjs"),O=require("./ui-components-Bp5fbjcw.cjs");require("./builder-components-BaTkvImB.cjs");require("./ticket-CzQwmTeE.cjs");require("react-dom");const U=async(o=1)=>await a.fetchOrders({PageNumber:o}),z=()=>{const[o,r]=i.useState(null),[u,e]=i.useState(null),[v,w]=i.useState(0),{page:f}=x.usePaginationPagesStore(),[j,g]=i.useState(!0);async function N(){g(!0);const{list:p,totalCount:l}=await U(f);r(p),w(l),e(null),g(!1)}async function _(){const p=(o==null?void 0:o.map(n=>n.gatewayName))||[],l=await a.getGatewaysDetail(p);e(l)}return i.useEffect(()=>{!u&&o&&_()},[o,u]),i.useEffect(()=>{N()},[f]),s.jsx(s.Fragment,{children:o!=null&&o.length&&o.length===0?s.jsx(a.NoItemsBlock,{title:"No Orders",description:"When you purchase products from our website, you'll see a history of orders here."}):s.jsxs(s.Fragment,{children:[s.jsx(a.PageTitle,{title:"Orders"}),s.jsx(a.OrdersTable,{orders:o,gatewaysDetail:u,totalCount:v,isLoading:j})]})})},H="_orderPage_gc87l_1",J="_leftSection_gc87l_15",K="_content_gc87l_35",Q="_main_gc87l_42",X="_mainAntistock_gc87l_56",Y="_orderMainDataAntistock_gc87l_69",Z="_timelineBlockAntistock_gc87l_81",ee="_footerAntistock_gc87l_92",te="_statusBlock_gc87l_104",se="_timelineBlock_gc87l_81",oe="_footer_gc87l_92",ae="_rightSection_gc87l_121",ce="_header_gc87l_142",ne="_productList_gc87l_150",ie="_mobileFooter_gc87l_157",re="_loaderContainer_gc87l_166",le="_orderMainData_gc87l_69",ue="_prices_gc87l_181",de="_headerTitle_gc87l_185",me="_headerDescription_gc87l_189",c={orderPage:H,leftSection:J,content:K,main:Q,mainAntistock:X,orderMainDataAntistock:Y,timelineBlockAntistock:Z,footerAntistock:ee,statusBlock:te,timelineBlock:se,footer:oe,rightSection:ae,header:ce,productList:ne,mobileFooter:ie,loaderContainer:re,orderMainData:le,prices:ue,headerTitle:de,headerDescription:me},he=()=>{var A,P,b,R,M,V,B,F,I;const{id:o,accessToken:r}=x.useParams(),u=x.useNavigate(),[e,v]=i.useState(),[w,f]=i.useState(!1),[j,g]=i.useState(!1),[N,_]=i.useState(!1),p=a.useCopy(),{isAntistock:l,general:n}=x.useGeneralStore(),q=((A=e==null?void 0:e.rawPrice)==null?void 0:A.currency)||"USD",L=new Intl.NumberFormat("en-US",{style:"currency",currency:q}),C=i.useMemo(()=>(e==null?void 0:e.partOrders.map(t=>{var y,S,h;return{id:Number((y=t.productWithVariant)==null?void 0:y.id)||0,partOrderId:Number(t==null?void 0:t.id)||0,image:t.productWithVariant.image,name:(()=>{var T,$;const d=((T=t.productWithVariant)==null?void 0:T.name)||"",m=(($=t.productWithVariant)==null?void 0:$.variantName)||"";return!d&&!m?"":!m||d===m?d:d?`${d} (${m})`:m})(),description:"",price:{quantity:t.quantity,amount:((S=t.productWithVariant)==null?void 0:S.price.amount)||0,currency:(h=t.productWithVariant)==null?void 0:h.price.currency},deliveryCategories:"deliveryCategories"in t?t.deliveryCategories:void 0,customerNote:t.customerNote,chargeType:t.chargeType||"ONE_TIME",replacementRequests:"replacementRequests"in t?t.replacementRequests:void 0,allowedReplacementReasons:"allowedReplacementReasons"in t?t.allowedReplacementReasons:void 0}}))||[],[e]);i.useEffect(()=>{e&&(e.status===a.OrderStatus.FullDeliveryFailure||e.status===a.OrderStatus.PartiallyDelivered)&&e.refundedPrice&&e.refundedPrice.amount>0&&g(!0)},[e==null?void 0:e.status]);const k=i.useCallback(async(t,y,S=!1)=>{var d,m;S||f(!0);const{data:h}=await(y?a.fetchAuthorizedOrder(`${t}/${y}`):a.fetchOrder(t));f(!1),h.status!==a.OrderStatus.Completed&&((d=h.charge)==null?void 0:d.status)===a.ChargeStatus.NotPaid&&u(`/charges/${(m=h.charge)==null?void 0:m.id}`,{replace:!0}),v(h)},[u]);i.useLayoutEffect(()=>{if(o&&!r){const t=JSON.parse(localStorage.getItem("orders")||"{}");t[o]&&u(`/orders/${o}/${t[o].fullAccessToken}`)}},[o,r,u]),i.useEffect(()=>{o&&k(o,r,!0);const t=setInterval(()=>{o&&k(o,r,!0)},5e3);return()=>{clearInterval(t)}},[o,r,k]);const E=i.useMemo(()=>!!(e!=null&&e.isApplicableForReplacement&&(e.status===a.OrderStatus.Completed||e.status===a.OrderStatus.PartiallyDelivered||e.status===a.OrderStatus.FullDeliveryFailure)),[e]),D=i.useMemo(()=>{var t;return!!((t=n==null?void 0:n.info)!=null&&t.isVouchesEnabled&&r)},[(P=n==null?void 0:n.info)==null?void 0:P.isVouchesEnabled,r]),W=i.useMemo(()=>{var t;return!!(!((t=n==null?void 0:n.info)!=null&&t.isVouchesEnabled)&&(e!=null&&e.review)&&"accessToken"in e.review&&!l)},[(b=n==null?void 0:n.info)==null?void 0:b.isVouchesEnabled,e==null?void 0:e.review,l]),G=i.useMemo(()=>{var t;return((t=n==null?void 0:n.info)==null?void 0:t.domain)||window.location.hostname},[(R=n==null?void 0:n.info)==null?void 0:R.domain]);return w?s.jsx("div",{className:c.loaderContainer,children:s.jsx(O.Loader,{})}):s.jsxs("div",{className:c.orderPage,children:[s.jsx("div",{className:c.leftSection,children:s.jsxs("div",{className:c.content,children:[s.jsx(a.CheckoutHeader,{}),e&&s.jsxs("div",{className:`${c.main} ${l?c.mainAntistock:""}`,children:[s.jsx(a.OrderStatusBlock,{className:c.statusBlock,orderStatus:e.status}),s.jsxs("div",{className:`${c.orderMainData} ${l?c.orderMainDataAntistock:""}`,children:[D&&s.jsx(a.VouchCard,{onAddMessage:()=>_(!0),isVouchLeft:e.isVouchLeft}),s.jsx(a.CheckoutOrderMainData,{lastUpdate:e.createdAt,paymentType:(M=e.charge)==null?void 0:M.gateway,email:e.customer?e.customer.email:((V=e.charge)==null?void 0:V.customerForCharge.email)||"",orderId:e.id}),W&&e.review&&s.jsx(a.LeaveAReview,{orderId:e.id,review:e.review})]}),e.charge&&e.charge.timeline&&s.jsx(a.TrackPayment,{className:`${c.timelineBlock} ${l?c.timelineBlockAntistock:""}`,timeline:e.charge.timeline}),s.jsx(a.CheckoutFooter,{className:`${c.footer} ${l?c.footerAntistock:""}`})]})]})}),s.jsx("div",{className:c.rightSection,style:l?{borderLeft:"1px solid var(--border-secondary)"}:void 0,children:s.jsxs("div",{className:c.content,children:[((B=e==null?void 0:e.charge)==null?void 0:B.name)&&s.jsxs("header",{className:c.header,children:[s.jsxs("div",{children:[s.jsx("h1",{className:c.headerTitle,children:e.charge.name}),e.charge.description&&s.jsx("p",{className:c.headerDescription,children:e.charge.description})]}),l?null:s.jsxs(O.Button,{type:"Secondary",onClick:()=>p((e==null?void 0:e.id)||""),style:{whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"4px"},children:[s.jsx(O.Icon,{name:"Copy"}),s.jsx("span",{children:"Copy ID"})]})]}),s.jsxs("div",{children:[s.jsx("div",{className:c.productList,children:C.map(t=>s.jsx(a.CheckoutProduct,{product:t,isOrder:!0,isApplicableForReplacement:E,orderId:o,accessToken:r,allowedReplacementReasons:e==null?void 0:e.allowedReplacementReasons},t.id))}),l?null:s.jsx(a.CheckoutPrices,{formatter:L,coupon:null,total:((F=e==null?void 0:e.endPrice)==null?void 0:F.amount)||0,discount:0,totalWithDiscount:((I=e==null?void 0:e.endPrice)==null?void 0:I.amount)||0,className:c.prices,isShowSubtotal:!1}),s.jsx(a.CheckoutFooter,{className:c.mobileFooter})]})]})}),(e==null?void 0:e.refundedPrice)&&s.jsx(a.RefundNotificationModal,{isOpen:j,onClose:()=>g(!1),refundedAmount:e.refundedPrice.amount,currency:e.refundedPrice.currency}),D&&s.jsx(a.VouchModal,{isOpen:N,onClose:()=>_(!1),products:C,orderId:o,accessToken:r,shopDomain:G,onSuccess:()=>{_(!1),o&&k(o,r,!0)}})]})},fe=Object.freeze(Object.defineProperty({__proto__:null,OrderPage:he},Symbol.toStringTag,{value:"Module"}));exports.Orders=z;exports.index=fe;
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { jsx as s, Fragment as W, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import i, { useState as H, useMemo as S } from "react";
|
|
3
|
+
import { X as J, a7 as K, p as X, K as Q } from "./builder-CQ8x7LFT.js";
|
|
4
|
+
import { f as Y, N as Z, P as ee, O as te, g as ae, b as se, c as f, d as oe, e as ce, h as ie, i as ne, j as re, V as le, k as de, L as ue, T as me, l as x, m as he, n as fe, R as pe, o as ge } from "./charge-Cp5L5y1Y.js";
|
|
5
|
+
import { e as _e, g as ye, I as ke } from "./ui-components-Ca4onG3X.js";
|
|
6
|
+
import "./builder-components-BN-jGGPV.js";
|
|
7
|
+
import "./ticket--HqQx1ul.js";
|
|
8
|
+
import "react-dom";
|
|
9
|
+
const ve = async (a = 1) => await Y({ PageNumber: a }), Xe = () => {
|
|
10
|
+
const [a, n] = i.useState(null), [d, e] = H(null), [N, O] = i.useState(0), { page: p } = J(), [C, g] = i.useState(!0);
|
|
11
|
+
async function D() {
|
|
12
|
+
g(!0);
|
|
13
|
+
const { list: y, totalCount: r } = await ve(p);
|
|
14
|
+
n(y), O(r), e(null), g(!1);
|
|
15
|
+
}
|
|
16
|
+
async function _() {
|
|
17
|
+
const y = (a == null ? void 0 : a.map((c) => c.gatewayName)) || [], r = await ae(y);
|
|
18
|
+
e(r);
|
|
19
|
+
}
|
|
20
|
+
return i.useEffect(() => {
|
|
21
|
+
!d && a && _();
|
|
22
|
+
}, [a, d]), i.useEffect(() => {
|
|
23
|
+
D();
|
|
24
|
+
}, [p]), /* @__PURE__ */ s(W, { children: a != null && a.length && a.length === 0 ? /* @__PURE__ */ s(
|
|
25
|
+
Z,
|
|
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__ */ l(W, { children: [
|
|
31
|
+
/* @__PURE__ */ s(ee, { title: "Orders" }),
|
|
32
|
+
/* @__PURE__ */ s(
|
|
33
|
+
te,
|
|
34
|
+
{
|
|
35
|
+
orders: a,
|
|
36
|
+
gatewaysDetail: d,
|
|
37
|
+
totalCount: N,
|
|
38
|
+
isLoading: C
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
] }) });
|
|
42
|
+
}, we = "_orderPage_gc87l_1", Se = "_leftSection_gc87l_15", Ne = "_content_gc87l_35", Oe = "_main_gc87l_42", Ce = "_mainAntistock_gc87l_56", De = "_orderMainDataAntistock_gc87l_69", Pe = "_timelineBlockAntistock_gc87l_81", Ae = "_footerAntistock_gc87l_92", be = "_statusBlock_gc87l_104", Re = "_timelineBlock_gc87l_81", Me = "_footer_gc87l_92", Ve = "_rightSection_gc87l_121", Ie = "_header_gc87l_142", Be = "_productList_gc87l_150", Te = "_mobileFooter_gc87l_157", Le = "_loaderContainer_gc87l_166", $e = "_orderMainData_gc87l_69", Fe = "_prices_gc87l_181", Ee = "_headerTitle_gc87l_185", We = "_headerDescription_gc87l_189", o = {
|
|
43
|
+
orderPage: we,
|
|
44
|
+
leftSection: Se,
|
|
45
|
+
content: Ne,
|
|
46
|
+
main: Oe,
|
|
47
|
+
mainAntistock: Ce,
|
|
48
|
+
orderMainDataAntistock: De,
|
|
49
|
+
timelineBlockAntistock: Pe,
|
|
50
|
+
footerAntistock: Ae,
|
|
51
|
+
statusBlock: be,
|
|
52
|
+
timelineBlock: Re,
|
|
53
|
+
footer: Me,
|
|
54
|
+
rightSection: Ve,
|
|
55
|
+
header: Ie,
|
|
56
|
+
productList: Be,
|
|
57
|
+
mobileFooter: Te,
|
|
58
|
+
loaderContainer: Le,
|
|
59
|
+
orderMainData: $e,
|
|
60
|
+
prices: Fe,
|
|
61
|
+
headerTitle: Ee,
|
|
62
|
+
headerDescription: We
|
|
63
|
+
}, xe = () => {
|
|
64
|
+
var b, R, M, V, I, B, T, L, $;
|
|
65
|
+
const { id: a, accessToken: n } = K(), d = X(), [e, N] = i.useState(), [O, p] = i.useState(!1), [C, g] = i.useState(!1), [D, _] = i.useState(!1), y = se(), { isAntistock: r, general: c } = Q(), q = ((b = e == null ? void 0 : e.rawPrice) == null ? void 0 : b.currency) || "USD", j = new Intl.NumberFormat("en-US", {
|
|
66
|
+
style: "currency",
|
|
67
|
+
currency: q
|
|
68
|
+
}), P = i.useMemo(() => (e == null ? void 0 : e.partOrders.map((t) => {
|
|
69
|
+
var k, w, h;
|
|
70
|
+
return {
|
|
71
|
+
id: Number((k = t.productWithVariant) == null ? void 0 : k.id) || 0,
|
|
72
|
+
partOrderId: Number(t == null ? void 0 : t.id) || 0,
|
|
73
|
+
image: t.productWithVariant.image,
|
|
74
|
+
name: (() => {
|
|
75
|
+
var F, E;
|
|
76
|
+
const u = ((F = t.productWithVariant) == null ? void 0 : F.name) || "", m = ((E = t.productWithVariant) == null ? void 0 : E.variantName) || "";
|
|
77
|
+
return !u && !m ? "" : !m || u === m ? u : u ? `${u} (${m})` : m;
|
|
78
|
+
})(),
|
|
79
|
+
description: "",
|
|
80
|
+
price: {
|
|
81
|
+
quantity: t.quantity,
|
|
82
|
+
amount: ((w = t.productWithVariant) == null ? void 0 : w.price.amount) || 0,
|
|
83
|
+
currency: (h = t.productWithVariant) == null ? void 0 : h.price.currency
|
|
84
|
+
},
|
|
85
|
+
deliveryCategories: "deliveryCategories" in t ? t.deliveryCategories : void 0,
|
|
86
|
+
customerNote: t.customerNote,
|
|
87
|
+
chargeType: t.chargeType || "ONE_TIME",
|
|
88
|
+
replacementRequests: "replacementRequests" in t ? t.replacementRequests : void 0,
|
|
89
|
+
allowedReplacementReasons: "allowedReplacementReasons" in t ? t.allowedReplacementReasons : void 0
|
|
90
|
+
};
|
|
91
|
+
})) || [], [e]);
|
|
92
|
+
i.useEffect(() => {
|
|
93
|
+
e && (e.status === f.FullDeliveryFailure || e.status === f.PartiallyDelivered) && e.refundedPrice && e.refundedPrice.amount > 0 && g(!0);
|
|
94
|
+
}, [e == null ? void 0 : e.status]);
|
|
95
|
+
const v = i.useCallback(
|
|
96
|
+
async (t, k, w = !1) => {
|
|
97
|
+
var u, m;
|
|
98
|
+
w || p(!0);
|
|
99
|
+
const { data: h } = await (k ? oe(`${t}/${k}`) : ce(t));
|
|
100
|
+
p(!1), h.status !== f.Completed && ((u = h.charge) == null ? void 0 : u.status) === ie.NotPaid && d(`/charges/${(m = h.charge) == null ? void 0 : m.id}`, {
|
|
101
|
+
replace: !0
|
|
102
|
+
}), N(h);
|
|
103
|
+
},
|
|
104
|
+
[d]
|
|
105
|
+
);
|
|
106
|
+
i.useLayoutEffect(() => {
|
|
107
|
+
if (a && !n) {
|
|
108
|
+
const t = JSON.parse(localStorage.getItem("orders") || "{}");
|
|
109
|
+
t[a] && d(`/orders/${a}/${t[a].fullAccessToken}`);
|
|
110
|
+
}
|
|
111
|
+
}, [a, n, d]), i.useEffect(() => {
|
|
112
|
+
a && v(a, n, !0);
|
|
113
|
+
const t = setInterval(() => {
|
|
114
|
+
a && v(a, n, !0);
|
|
115
|
+
}, 5e3);
|
|
116
|
+
return () => {
|
|
117
|
+
clearInterval(t);
|
|
118
|
+
};
|
|
119
|
+
}, [a, n, v]);
|
|
120
|
+
const G = S(() => !!(e != null && e.isApplicableForReplacement && (e.status === f.Completed || e.status === f.PartiallyDelivered || e.status === f.FullDeliveryFailure)), [e]), A = S(() => {
|
|
121
|
+
var t;
|
|
122
|
+
return !!((t = c == null ? void 0 : c.info) != null && t.isVouchesEnabled && n);
|
|
123
|
+
}, [(R = c == null ? void 0 : c.info) == null ? void 0 : R.isVouchesEnabled, n]), U = S(() => {
|
|
124
|
+
var t;
|
|
125
|
+
return !!(!((t = c == null ? void 0 : c.info) != null && t.isVouchesEnabled) && (e != null && e.review) && "accessToken" in e.review && !r);
|
|
126
|
+
}, [(M = c == null ? void 0 : c.info) == null ? void 0 : M.isVouchesEnabled, e == null ? void 0 : e.review, r]), z = S(() => {
|
|
127
|
+
var t;
|
|
128
|
+
return ((t = c == null ? void 0 : c.info) == null ? void 0 : t.domain) || window.location.hostname;
|
|
129
|
+
}, [(V = c == null ? void 0 : c.info) == null ? void 0 : V.domain]);
|
|
130
|
+
return O ? /* @__PURE__ */ s("div", { className: o.loaderContainer, children: /* @__PURE__ */ s(_e, {}) }) : /* @__PURE__ */ l("div", { className: o.orderPage, children: [
|
|
131
|
+
/* @__PURE__ */ s("div", { className: o.leftSection, children: /* @__PURE__ */ l("div", { className: o.content, children: [
|
|
132
|
+
/* @__PURE__ */ s(ne, {}),
|
|
133
|
+
e && /* @__PURE__ */ l("div", { className: `${o.main} ${r ? o.mainAntistock : ""}`, children: [
|
|
134
|
+
/* @__PURE__ */ s(
|
|
135
|
+
re,
|
|
136
|
+
{
|
|
137
|
+
className: o.statusBlock,
|
|
138
|
+
orderStatus: e.status
|
|
139
|
+
}
|
|
140
|
+
),
|
|
141
|
+
/* @__PURE__ */ l(
|
|
142
|
+
"div",
|
|
143
|
+
{
|
|
144
|
+
className: `${o.orderMainData} ${r ? o.orderMainDataAntistock : ""}`,
|
|
145
|
+
children: [
|
|
146
|
+
A && /* @__PURE__ */ s(
|
|
147
|
+
le,
|
|
148
|
+
{
|
|
149
|
+
onAddMessage: () => _(!0),
|
|
150
|
+
isVouchLeft: e.isVouchLeft
|
|
151
|
+
}
|
|
152
|
+
),
|
|
153
|
+
/* @__PURE__ */ s(
|
|
154
|
+
de,
|
|
155
|
+
{
|
|
156
|
+
lastUpdate: e.createdAt,
|
|
157
|
+
paymentType: (I = e.charge) == null ? void 0 : I.gateway,
|
|
158
|
+
email: e.customer ? e.customer.email : ((B = e.charge) == null ? void 0 : B.customerForCharge.email) || "",
|
|
159
|
+
orderId: e.id
|
|
160
|
+
}
|
|
161
|
+
),
|
|
162
|
+
U && e.review && /* @__PURE__ */ s(
|
|
163
|
+
ue,
|
|
164
|
+
{
|
|
165
|
+
orderId: e.id,
|
|
166
|
+
review: e.review
|
|
167
|
+
}
|
|
168
|
+
)
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
),
|
|
172
|
+
e.charge && e.charge.timeline && /* @__PURE__ */ s(
|
|
173
|
+
me,
|
|
174
|
+
{
|
|
175
|
+
className: `${o.timelineBlock} ${r ? o.timelineBlockAntistock : ""}`,
|
|
176
|
+
timeline: e.charge.timeline
|
|
177
|
+
}
|
|
178
|
+
),
|
|
179
|
+
/* @__PURE__ */ s(
|
|
180
|
+
x,
|
|
181
|
+
{
|
|
182
|
+
className: `${o.footer} ${r ? o.footerAntistock : ""}`
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
] })
|
|
186
|
+
] }) }),
|
|
187
|
+
/* @__PURE__ */ s(
|
|
188
|
+
"div",
|
|
189
|
+
{
|
|
190
|
+
className: o.rightSection,
|
|
191
|
+
style: r ? { borderLeft: "1px solid var(--border-secondary)" } : void 0,
|
|
192
|
+
children: /* @__PURE__ */ l("div", { className: o.content, children: [
|
|
193
|
+
((T = e == null ? void 0 : e.charge) == null ? void 0 : T.name) && /* @__PURE__ */ l("header", { className: o.header, children: [
|
|
194
|
+
/* @__PURE__ */ l("div", { children: [
|
|
195
|
+
/* @__PURE__ */ s("h1", { className: o.headerTitle, children: e.charge.name }),
|
|
196
|
+
e.charge.description && /* @__PURE__ */ s("p", { className: o.headerDescription, children: e.charge.description })
|
|
197
|
+
] }),
|
|
198
|
+
r ? null : /* @__PURE__ */ l(
|
|
199
|
+
ye,
|
|
200
|
+
{
|
|
201
|
+
type: "Secondary",
|
|
202
|
+
onClick: () => y((e == null ? void 0 : e.id) || ""),
|
|
203
|
+
style: {
|
|
204
|
+
whiteSpace: "nowrap",
|
|
205
|
+
display: "flex",
|
|
206
|
+
alignItems: "center",
|
|
207
|
+
gap: "4px"
|
|
208
|
+
},
|
|
209
|
+
children: [
|
|
210
|
+
/* @__PURE__ */ s(ke, { name: "Copy" }),
|
|
211
|
+
/* @__PURE__ */ s("span", { children: "Copy ID" })
|
|
212
|
+
]
|
|
213
|
+
}
|
|
214
|
+
)
|
|
215
|
+
] }),
|
|
216
|
+
/* @__PURE__ */ l("div", { children: [
|
|
217
|
+
/* @__PURE__ */ s("div", { className: o.productList, children: P.map((t) => /* @__PURE__ */ s(
|
|
218
|
+
he,
|
|
219
|
+
{
|
|
220
|
+
product: t,
|
|
221
|
+
isOrder: !0,
|
|
222
|
+
isApplicableForReplacement: G,
|
|
223
|
+
orderId: a,
|
|
224
|
+
accessToken: n,
|
|
225
|
+
allowedReplacementReasons: e == null ? void 0 : e.allowedReplacementReasons
|
|
226
|
+
},
|
|
227
|
+
t.id
|
|
228
|
+
)) }),
|
|
229
|
+
r ? null : /* @__PURE__ */ s(
|
|
230
|
+
fe,
|
|
231
|
+
{
|
|
232
|
+
formatter: j,
|
|
233
|
+
coupon: null,
|
|
234
|
+
total: ((L = e == null ? void 0 : e.endPrice) == null ? void 0 : L.amount) || 0,
|
|
235
|
+
discount: 0,
|
|
236
|
+
totalWithDiscount: (($ = e == null ? void 0 : e.endPrice) == null ? void 0 : $.amount) || 0,
|
|
237
|
+
className: o.prices,
|
|
238
|
+
isShowSubtotal: !1
|
|
239
|
+
}
|
|
240
|
+
),
|
|
241
|
+
/* @__PURE__ */ s(x, { className: o.mobileFooter })
|
|
242
|
+
] })
|
|
243
|
+
] })
|
|
244
|
+
}
|
|
245
|
+
),
|
|
246
|
+
(e == null ? void 0 : e.refundedPrice) && /* @__PURE__ */ s(
|
|
247
|
+
pe,
|
|
248
|
+
{
|
|
249
|
+
isOpen: C,
|
|
250
|
+
onClose: () => g(!1),
|
|
251
|
+
refundedAmount: e.refundedPrice.amount,
|
|
252
|
+
currency: e.refundedPrice.currency
|
|
253
|
+
}
|
|
254
|
+
),
|
|
255
|
+
A && /* @__PURE__ */ s(
|
|
256
|
+
ge,
|
|
257
|
+
{
|
|
258
|
+
isOpen: D,
|
|
259
|
+
onClose: () => _(!1),
|
|
260
|
+
products: P,
|
|
261
|
+
orderId: a,
|
|
262
|
+
accessToken: n,
|
|
263
|
+
shopDomain: z,
|
|
264
|
+
onSuccess: () => {
|
|
265
|
+
_(!1), a && v(a, n, !0);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
)
|
|
269
|
+
] });
|
|
270
|
+
}, Qe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
271
|
+
__proto__: null,
|
|
272
|
+
OrderPage: xe
|
|
273
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
274
|
+
export {
|
|
275
|
+
Xe as O,
|
|
276
|
+
Qe as i
|
|
277
|
+
};
|
|
@@ -27,6 +27,7 @@ export declare enum OrderStatus {
|
|
|
27
27
|
Expired = "EXPIRED",
|
|
28
28
|
FullDeliveryFailure = "FULL_DELIVERY_FAILURE",
|
|
29
29
|
PartiallyDelivered = "PARTIALLY_DELIVERED",
|
|
30
|
+
PartiallyRefunded = "PARTIALLY_REFUNDED",
|
|
30
31
|
Refunded = "REFUNDED",
|
|
31
32
|
Failed = "FAILED"
|
|
32
33
|
}
|
|
@@ -132,7 +133,8 @@ export declare enum ReplacementRequestStatus {
|
|
|
132
133
|
CANCELLED = "CANCELLED",
|
|
133
134
|
EXPIRED = "EXPIRED",
|
|
134
135
|
PROCESSING = "PROCESSING",
|
|
135
|
-
COMPLETED = "COMPLETED"
|
|
136
|
+
COMPLETED = "COMPLETED",
|
|
137
|
+
FAILED = "FAILED"
|
|
136
138
|
}
|
|
137
139
|
export type ReplacementRequestItem = {
|
|
138
140
|
originalSerialKey: string;
|