@billgangcom/theme-lib 1.110.8 → 1.111.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-sxsr8tvQ.js → builder-CSr9GKSb.js} +231 -227
- package/dist/{builder-Ylu8KeuJ.cjs → builder-Drs-eMpC.cjs} +9 -9
- package/dist/{builder-components-Q4JP7qec.js → builder-components-B35IxzAP.js} +4 -4
- package/dist/{builder-components-DNX0cR4w.cjs → builder-components-BHjHn2ZO.cjs} +1 -1
- package/dist/builder.cjs.js +1 -1
- package/dist/builder.es.js +109 -107
- package/dist/charge-BRVd1wLH.cjs +109 -0
- package/dist/{charge-BHimo0Ia.js → charge-CCn4nKwI.js} +10758 -9826
- package/dist/{checkout-d6wvO34l.js → checkout-BsYetn2-.js} +5 -5
- package/dist/{checkout-ChWWQWwh.cjs → checkout-DIJouRVV.cjs} +1 -1
- package/dist/exports.cjs.js +1 -1
- package/dist/exports.es.js +6 -6
- package/dist/{index-51gUpKgC.cjs → index-C6JugsHY.cjs} +1 -1
- package/dist/{index-CAvNpYWK.cjs → index-CG9fjckz.cjs} +1 -1
- package/dist/{index-0L3KsVSz.cjs → index-CGhwUO1e.cjs} +1 -1
- package/dist/{index-fcZNDgyv.js → index-Cr25rl1u.js} +5 -5
- package/dist/{index-005iXpfH.cjs → index-D71UMIbF.cjs} +1 -1
- package/dist/{index-CULkU3uk.js → index-DHhy_3x4.js} +5 -5
- package/dist/{index-1u-bUz7Q.js → index-DMB5q_9y.js} +1 -1
- package/dist/{index-tZaYQ2je.cjs → index-DbpGGHmH.cjs} +1 -1
- package/dist/{index-YFPDL2Gb.js → index-FBJs_JPX.js} +5 -5
- package/dist/{index-BIE-2CDi.js → index-Q6x34N1h.js} +10 -9
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +8 -8
- package/dist/order-ByTbpE8g.js +228 -0
- package/dist/order-Cel0_cQV.cjs +1 -0
- package/dist/src/constants/notification.d.ts +2 -0
- package/dist/src/storefront/api/checkout.d.ts +1 -0
- package/dist/src/storefront/api/index.d.ts +1 -0
- package/dist/src/storefront/api/order.d.ts +8 -0
- package/dist/src/storefront/components/CheckoutPrices/index.d.ts +2 -0
- package/dist/src/storefront/components/CheckoutProduct/index.d.ts +4 -0
- package/dist/src/storefront/components/ProtectYourCheckout/index.d.ts +12 -0
- package/dist/src/storefront/components/ReplacementModal/index.d.ts +16 -0
- package/dist/src/storefront/components/ReplacementRequestItem/index.d.ts +10 -0
- package/dist/src/storefront/components/index.d.ts +1 -0
- package/dist/src/storefront/models/checkout.d.ts +17 -1
- package/dist/src/storefront/models/order.d.ts +27 -0
- package/dist/src/storefront/store/useCartStore.d.ts +3 -0
- package/dist/src/ui/CheckboxSettings/index.d.ts +7 -0
- package/dist/src/ui/NotificationAntistock/index.d.ts +1 -0
- package/dist/src/ui/NotificationBuilder/index.d.ts +1 -0
- package/dist/src/ui/Select/index.d.ts +1 -0
- package/dist/src/ui/Tip/index.d.ts +2 -1
- package/dist/src/ui/index.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/{subscription-CTSwv1tc.js → subscription-BQgsD4lk.js} +5 -5
- package/dist/{subscription-CWcuwOPh.cjs → subscription-DEhfna15.cjs} +1 -1
- package/dist/{ticket-BKgu1XN7.cjs → ticket-BwxrIRC1.cjs} +1 -1
- package/dist/{ticket-CXMhORtd.js → ticket-C6mCCzyX.js} +5 -5
- package/dist/{top-up-ChgnBzTg.cjs → top-up-BwcFHgzC.cjs} +1 -1
- package/dist/{top-up-BQz5oQLf.js → top-up-Dqho0T4f.js} +5 -5
- package/dist/{ui-components-lP2XJY6B.js → ui-components-BK_dGhdU.js} +1856 -1787
- package/dist/ui-components-D9iV1NC1.cjs +1 -0
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +43 -42
- package/dist/{validation-Dp5GCtLg.js → validation-B8s971ha.js} +5 -5
- package/dist/{validation-CTtD_Uas.cjs → validation-DE-xVdL0.cjs} +1 -1
- package/package.json +1 -1
- package/dist/charge-DmSElVXn.cjs +0 -107
- package/dist/order-D4m9MM2M.js +0 -222
- package/dist/order-ZUA6jQ9p.cjs +0 -1
- package/dist/ui-components-JpkNO8Mq.cjs +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
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 { V as A, p as G } from "./builder-
|
|
2
|
+
import { u as D, C as N, a as x } from "./charge-CCn4nKwI.js";
|
|
3
|
+
import { V as A, p as G } from "./builder-CSr9GKSb.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-BK_dGhdU.js";
|
|
6
|
+
import "./builder-components-B35IxzAP.js";
|
|
7
|
+
import "./ticket-C6mCCzyX.js";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
const S = "_checkoutContainer_thje1_1", b = "_loaderContainer_thje1_20", s = {
|
|
10
10
|
checkoutContainer: S,
|
|
@@ -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-BRVd1wLH.cjs"),u=require("./builder-Drs-eMpC.cjs"),l=require("react"),_=require("./ui-components-D9iV1NC1.cjs");require("./builder-components-BHjHn2ZO.cjs");require("./ticket-BwxrIRC1.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-Drs-eMpC.cjs");require("./ui-components-D9iV1NC1.cjs");require("./builder-components-BHjHn2ZO.cjs");const t=require("./charge-BRVd1wLH.cjs"),e=require("./ticket-BwxrIRC1.cjs"),r=require("./checkout-DIJouRVV.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, R as f, H as l, u as d, G as x, I as C, F as R } from "./charge-
|
|
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 S } from "./checkout-
|
|
3
|
+
import { Y as p, Z as u, _ as c } from "./builder-CSr9GKSb.js";
|
|
4
|
+
import "./ui-components-BK_dGhdU.js";
|
|
5
|
+
import "./builder-components-B35IxzAP.js";
|
|
6
|
+
import { M as n, R as f, H as l, u as d, G as x, I as C, F as R } from "./charge-CCn4nKwI.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-C6mCCzyX.js";
|
|
8
|
+
import { Checkout as S } from "./checkout-BsYetn2-.js";
|
|
9
9
|
import "react-dom";
|
|
10
10
|
export {
|
|
11
11
|
p as AntistockRoutes,
|
|
@@ -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-BRVd1wLH.cjs"),t=require("./builder-Drs-eMpC.cjs"),J=require("./ticket-BwxrIRC1.cjs"),g=require("./ui-components-D9iV1NC1.cjs");require("./builder-components-BHjHn2ZO.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 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-Drs-eMpC.cjs");const r=require("react"),t=require("./ui-components-D9iV1NC1.cjs");require("./builder-components-BHjHn2ZO.cjs");require("./charge-BRVd1wLH.cjs");require("./ticket-BwxrIRC1.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 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-Drs-eMpC.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,10 +1,10 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import "./builder-
|
|
2
|
+
import "./builder-CSr9GKSb.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-BK_dGhdU.js";
|
|
5
|
+
import "./builder-components-B35IxzAP.js";
|
|
6
|
+
import "./charge-CCn4nKwI.js";
|
|
7
|
+
import "./ticket-C6mCCzyX.js";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
const f = () => (e.useEffect(() => {
|
|
10
10
|
setTimeout(() => {
|
|
@@ -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-D9iV1NC1.cjs");require("react");const n=require("./builder-Drs-eMpC.cjs");require("./builder-components-BHjHn2ZO.cjs");require("./charge-BRVd1wLH.cjs");require("./ticket-BwxrIRC1.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,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-BK_dGhdU.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-CSr9GKSb.js";
|
|
5
|
+
import "./builder-components-B35IxzAP.js";
|
|
6
|
+
import "./charge-CCn4nKwI.js";
|
|
7
|
+
import "./ticket-C6mCCzyX.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,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-CSr9GKSb.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 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-D9iV1NC1.cjs");require("react");const s=require("./builder-Drs-eMpC.cjs");require("./builder-components-BHjHn2ZO.cjs");require("./charge-BRVd1wLH.cjs");require("./ticket-BwxrIRC1.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;
|
|
@@ -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-BK_dGhdU.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-CSr9GKSb.js";
|
|
5
|
+
import "./builder-components-B35IxzAP.js";
|
|
6
|
+
import "./charge-CCn4nKwI.js";
|
|
7
|
+
import "./ticket-C6mCCzyX.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,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 { V as z, Z as U } from "./charge-
|
|
4
|
-
import { M as f, N as T, ab as V, p as F, a6 as G, e as R, O as H, m as M, a as q, u as B, V as X, b as Y, al as Z, ag as K } from "./builder-
|
|
5
|
-
import { g as Q } from "./ticket-
|
|
6
|
-
import { e as $, N as ee,
|
|
7
|
-
import "./builder-components-
|
|
3
|
+
import { V as z, Z as U } from "./charge-CCn4nKwI.js";
|
|
4
|
+
import { M as f, N as T, ab as V, p as F, a6 as G, e as R, O as H, m as M, a as q, u as B, V as X, b as Y, al as Z, ag as K } from "./builder-CSr9GKSb.js";
|
|
5
|
+
import { g as Q } from "./ticket-C6mCCzyX.js";
|
|
6
|
+
import { e as $, N as ee, p as te } from "./ui-components-BK_dGhdU.js";
|
|
7
|
+
import "./builder-components-B35IxzAP.js";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
const se = "_notifications_1ntnm_1", ae = "_wrapper_1ntnm_12", x = {
|
|
10
10
|
notifications: se,
|
|
@@ -68,7 +68,7 @@ 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 = V(), { token: l, setToken: d } = f(), { dashInfo: S, setDashInfo: y } = T(), { shopPassword: u } = f(), v = F(), [c,
|
|
71
|
+
const a = V(), { token: l, setToken: d } = f(), { dashInfo: S, setDashInfo: y } = T(), { shopPassword: u } = f(), v = F(), [c, b] = G(), { notifications: w } = R(), [I, p] = r.useState(!0), { setCustomerEmail: D } = H(), { setThemeSettings: k, themeSettings: A } = M(), { settings: C, setSettings: P } = q(), { setHeader: _, setFooter: E, setAnnouncement: L } = B(), { general: t, setGeneral: O, isAntistock: h } = X(), { pageContext: J, setPageContext: W } = Y();
|
|
72
72
|
Z(
|
|
73
73
|
(t == null ? void 0 : t.info.id) || localStorage.getItem("shopId") || null,
|
|
74
74
|
"production",
|
|
@@ -100,7 +100,7 @@ const pe = ({ children: i }) => {
|
|
|
100
100
|
}
|
|
101
101
|
}, [l, S]), r.useEffect(() => {
|
|
102
102
|
const e = c.get("r");
|
|
103
|
-
e && (localStorage.setItem("referralCode", e), c.delete("r"),
|
|
103
|
+
e && (localStorage.setItem("referralCode", e), c.delete("r"), b(c), v(
|
|
104
104
|
{
|
|
105
105
|
pathname: a.pathname,
|
|
106
106
|
search: c.toString()
|
|
@@ -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:
|
|
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,
|
|
@@ -139,7 +139,8 @@ const pe = ({ children: i }) => {
|
|
|
139
139
|
message: e.message,
|
|
140
140
|
timer: e.timer || 10,
|
|
141
141
|
id: e.id,
|
|
142
|
-
element: h ? te : e.component
|
|
142
|
+
element: h ? te : e.component,
|
|
143
|
+
label: e.label
|
|
143
144
|
},
|
|
144
145
|
e.id
|
|
145
146
|
)) })
|
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-Drs-eMpC.cjs");require("react/jsx-runtime");const c=require("react"),t=require("./ui-components-D9iV1NC1.cjs");require("./builder-components-BHjHn2ZO.cjs");const r=require("./charge-BRVd1wLH.cjs"),e=require("./ticket-BwxrIRC1.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
1
|
import { App as R } from "./builder.es.js";
|
|
2
|
-
import { Y as g, Z as l, _ as x } from "./builder-
|
|
2
|
+
import { Y as g, Z as l, _ as x } from "./builder-CSr9GKSb.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,
|
|
7
|
-
import "./builder-components-
|
|
8
|
-
import { M as w, R as A, H as E, u as M, G as N, I as O, F as P } from "./charge-
|
|
9
|
-
import { C as B, c as G, h as S, i as y, r as D, d as F, s as H, u as J, e as V, b as Y, a as Z } from "./ticket-
|
|
5
|
+
import { r as t } from "./ui-components-BK_dGhdU.js";
|
|
6
|
+
import { I as C, l as b, n as k, m as T } from "./ui-components-BK_dGhdU.js";
|
|
7
|
+
import "./builder-components-B35IxzAP.js";
|
|
8
|
+
import { M as w, R as A, H as E, u as M, G as N, I as O, F as P } from "./charge-CCn4nKwI.js";
|
|
9
|
+
import { C as B, c as G, h as S, i as y, r as D, d as F, s as H, u as J, e as V, b as Y, a as Z } from "./ticket-C6mCCzyX.js";
|
|
10
10
|
import "react-dom";
|
|
11
11
|
function f(e) {
|
|
12
12
|
o(() => {
|
|
@@ -30,8 +30,8 @@ export {
|
|
|
30
30
|
l as Routes,
|
|
31
31
|
G as aspectRatioOptions,
|
|
32
32
|
x as formatPrice,
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
b as getRegisteredIcon,
|
|
34
|
+
k as getRegisteredIcons,
|
|
35
35
|
S as hotReload,
|
|
36
36
|
y as iconNames,
|
|
37
37
|
T as isIconRegistered,
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { jsx as s, Fragment as R, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import r, { useState as B } from "react";
|
|
3
|
+
import { X as I, a7 as $, p as L, V as M } from "./builder-CSr9GKSb.js";
|
|
4
|
+
import { f as F, N as x, P as W, O as E, g as V, b as j, c as q, d as G, e as U, L as z, T as H, h as T, i as J, j as X, k as K, l as Q, m as Y, n as Z } from "./charge-CCn4nKwI.js";
|
|
5
|
+
import { e as ee, g as te, I as ae } from "./ui-components-BK_dGhdU.js";
|
|
6
|
+
import "./builder-components-B35IxzAP.js";
|
|
7
|
+
import "./ticket-C6mCCzyX.js";
|
|
8
|
+
import "react-dom";
|
|
9
|
+
const se = async (a = 1) => await F({ PageNumber: a }), Ie = () => {
|
|
10
|
+
const [a, l] = r.useState(null), [u, e] = B(null), [k, N] = r.useState(0), { page: g } = I(), [v, c] = r.useState(!0);
|
|
11
|
+
async function S() {
|
|
12
|
+
c(!0);
|
|
13
|
+
const { list: h, totalCount: m } = await se(g);
|
|
14
|
+
l(h), N(m), e(null), c(!1);
|
|
15
|
+
}
|
|
16
|
+
async function w() {
|
|
17
|
+
const h = (a == null ? void 0 : a.map((f) => f.gatewayName)) || [], m = await V(h);
|
|
18
|
+
e(m);
|
|
19
|
+
}
|
|
20
|
+
return r.useEffect(() => {
|
|
21
|
+
!u && a && w();
|
|
22
|
+
}, [a, u]), r.useEffect(() => {
|
|
23
|
+
S();
|
|
24
|
+
}, [g]), /* @__PURE__ */ s(R, { children: a != null && a.length && a.length === 0 ? /* @__PURE__ */ s(
|
|
25
|
+
x,
|
|
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__ */ i(R, { children: [
|
|
31
|
+
/* @__PURE__ */ s(W, { title: "Orders" }),
|
|
32
|
+
/* @__PURE__ */ s(
|
|
33
|
+
E,
|
|
34
|
+
{
|
|
35
|
+
orders: a,
|
|
36
|
+
gatewaysDetail: u,
|
|
37
|
+
totalCount: k,
|
|
38
|
+
isLoading: v
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
] }) });
|
|
42
|
+
}, oe = "_orderPage_gc87l_1", ce = "_leftSection_gc87l_15", ne = "_content_gc87l_35", ie = "_main_gc87l_42", re = "_mainAntistock_gc87l_56", le = "_orderMainDataAntistock_gc87l_69", de = "_timelineBlockAntistock_gc87l_81", ue = "_footerAntistock_gc87l_92", me = "_statusBlock_gc87l_104", ge = "_timelineBlock_gc87l_81", he = "_footer_gc87l_92", _e = "_rightSection_gc87l_121", pe = "_header_gc87l_142", fe = "_productList_gc87l_150", ye = "_mobileFooter_gc87l_157", ke = "_loaderContainer_gc87l_166", Ne = "_orderMainData_gc87l_69", ve = "_prices_gc87l_181", Se = "_headerTitle_gc87l_185", we = "_headerDescription_gc87l_189", o = {
|
|
43
|
+
orderPage: oe,
|
|
44
|
+
leftSection: ce,
|
|
45
|
+
content: ne,
|
|
46
|
+
main: ie,
|
|
47
|
+
mainAntistock: re,
|
|
48
|
+
orderMainDataAntistock: le,
|
|
49
|
+
timelineBlockAntistock: de,
|
|
50
|
+
footerAntistock: ue,
|
|
51
|
+
statusBlock: me,
|
|
52
|
+
timelineBlock: ge,
|
|
53
|
+
footer: he,
|
|
54
|
+
rightSection: _e,
|
|
55
|
+
header: pe,
|
|
56
|
+
productList: fe,
|
|
57
|
+
mobileFooter: ye,
|
|
58
|
+
loaderContainer: ke,
|
|
59
|
+
orderMainData: Ne,
|
|
60
|
+
prices: ve,
|
|
61
|
+
headerTitle: Se,
|
|
62
|
+
headerDescription: we
|
|
63
|
+
}, Oe = () => {
|
|
64
|
+
var f, O, A, C, D, P;
|
|
65
|
+
const { id: a, accessToken: l } = $(), u = L(), [e, k] = r.useState(), [N, g] = r.useState(!1), v = j(), { isAntistock: c } = M(), S = ((f = e == null ? void 0 : e.rawPrice) == null ? void 0 : f.currency) || "USD", w = new Intl.NumberFormat("en-US", {
|
|
66
|
+
style: "currency",
|
|
67
|
+
currency: S
|
|
68
|
+
}), h = r.useMemo(() => (e == null ? void 0 : e.partOrders.map((t) => {
|
|
69
|
+
var _, y;
|
|
70
|
+
return {
|
|
71
|
+
id: (t == null ? void 0 : t.id) || 0,
|
|
72
|
+
image: t.productWithVariant.image,
|
|
73
|
+
name: (() => {
|
|
74
|
+
var p, b;
|
|
75
|
+
const n = ((p = t.productWithVariant) == null ? void 0 : p.name) || "", d = ((b = t.productWithVariant) == null ? void 0 : b.variantName) || "";
|
|
76
|
+
return !n && !d ? "" : !d || n === d ? n : n ? `${n} (${d})` : d;
|
|
77
|
+
})(),
|
|
78
|
+
description: "",
|
|
79
|
+
price: {
|
|
80
|
+
quantity: t.quantity,
|
|
81
|
+
amount: ((_ = t.productWithVariant) == null ? void 0 : _.price.amount) || 0,
|
|
82
|
+
currency: (y = t.productWithVariant) == null ? void 0 : y.price.currency
|
|
83
|
+
},
|
|
84
|
+
deliveryCategories: "deliveryCategories" in t ? t.deliveryCategories : void 0,
|
|
85
|
+
customerNote: t.customerNote,
|
|
86
|
+
chargeType: t.chargeType || "ONE_TIME",
|
|
87
|
+
replacementRequests: "replacementRequests" in t ? t.replacementRequests : void 0,
|
|
88
|
+
allowedReplacementReasons: "allowedReplacementReasons" in t ? t.allowedReplacementReasons : void 0
|
|
89
|
+
};
|
|
90
|
+
})) || [], [e]), m = async (t, _, y = !1) => {
|
|
91
|
+
var d, p;
|
|
92
|
+
y || g(!0);
|
|
93
|
+
const { data: n } = await (_ ? K(`${t}/${_}`) : Q(t));
|
|
94
|
+
g(!1), n.status !== Y.Completed && ((d = n.charge) == null ? void 0 : d.status) === Z.NotPaid && u(`/charges/${(p = n.charge) == null ? void 0 : p.id}`, {
|
|
95
|
+
replace: !0
|
|
96
|
+
}), k(n);
|
|
97
|
+
};
|
|
98
|
+
return r.useLayoutEffect(() => {
|
|
99
|
+
if (a && !l) {
|
|
100
|
+
const t = JSON.parse(localStorage.getItem("orders") || "{}");
|
|
101
|
+
t[a] && u(`/orders/${a}/${t[a].fullAccessToken}`);
|
|
102
|
+
}
|
|
103
|
+
}, [a]), r.useEffect(() => {
|
|
104
|
+
a && m(a, l, !0);
|
|
105
|
+
const t = setInterval(() => {
|
|
106
|
+
a && m(a, l, !0);
|
|
107
|
+
}, 5e3);
|
|
108
|
+
return () => {
|
|
109
|
+
clearInterval(t);
|
|
110
|
+
};
|
|
111
|
+
}, [a, l]), N ? /* @__PURE__ */ s("div", { className: o.loaderContainer, children: /* @__PURE__ */ s(ee, {}) }) : /* @__PURE__ */ i("div", { className: o.orderPage, children: [
|
|
112
|
+
/* @__PURE__ */ s("div", { className: o.leftSection, children: /* @__PURE__ */ i("div", { className: o.content, children: [
|
|
113
|
+
/* @__PURE__ */ s(q, {}),
|
|
114
|
+
e && /* @__PURE__ */ i("div", { className: `${o.main} ${c ? o.mainAntistock : ""}`, children: [
|
|
115
|
+
/* @__PURE__ */ s(
|
|
116
|
+
G,
|
|
117
|
+
{
|
|
118
|
+
className: o.statusBlock,
|
|
119
|
+
orderStatus: e.status
|
|
120
|
+
}
|
|
121
|
+
),
|
|
122
|
+
/* @__PURE__ */ i(
|
|
123
|
+
"div",
|
|
124
|
+
{
|
|
125
|
+
className: `${o.orderMainData} ${c ? o.orderMainDataAntistock : ""}`,
|
|
126
|
+
children: [
|
|
127
|
+
/* @__PURE__ */ s(
|
|
128
|
+
U,
|
|
129
|
+
{
|
|
130
|
+
lastUpdate: e.createdAt,
|
|
131
|
+
paymentType: (O = e.charge) == null ? void 0 : O.gateway,
|
|
132
|
+
email: e.customer ? e.customer.email : ((A = e.charge) == null ? void 0 : A.customerForCharge.email) || "",
|
|
133
|
+
orderId: e.id
|
|
134
|
+
}
|
|
135
|
+
),
|
|
136
|
+
"accessToken" in e.review && !c && /* @__PURE__ */ s(
|
|
137
|
+
z,
|
|
138
|
+
{
|
|
139
|
+
orderId: e.id,
|
|
140
|
+
review: e.review
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
),
|
|
146
|
+
e.charge && e.charge.timeline && /* @__PURE__ */ s(
|
|
147
|
+
H,
|
|
148
|
+
{
|
|
149
|
+
className: `${o.timelineBlock} ${c ? o.timelineBlockAntistock : ""}`,
|
|
150
|
+
timeline: e.charge.timeline
|
|
151
|
+
}
|
|
152
|
+
),
|
|
153
|
+
/* @__PURE__ */ s(
|
|
154
|
+
T,
|
|
155
|
+
{
|
|
156
|
+
className: `${o.footer} ${c ? o.footerAntistock : ""}`
|
|
157
|
+
}
|
|
158
|
+
)
|
|
159
|
+
] })
|
|
160
|
+
] }) }),
|
|
161
|
+
/* @__PURE__ */ s(
|
|
162
|
+
"div",
|
|
163
|
+
{
|
|
164
|
+
className: o.rightSection,
|
|
165
|
+
style: c ? { borderLeft: "1px solid var(--border-secondary)" } : void 0,
|
|
166
|
+
children: /* @__PURE__ */ i("div", { className: o.content, children: [
|
|
167
|
+
((C = e == null ? void 0 : e.charge) == null ? void 0 : C.name) && /* @__PURE__ */ i("header", { className: o.header, children: [
|
|
168
|
+
/* @__PURE__ */ i("div", { children: [
|
|
169
|
+
/* @__PURE__ */ s("h1", { className: o.headerTitle, children: e.charge.name }),
|
|
170
|
+
e.charge.description && /* @__PURE__ */ s("p", { className: o.headerDescription, children: e.charge.description })
|
|
171
|
+
] }),
|
|
172
|
+
c ? null : /* @__PURE__ */ i(
|
|
173
|
+
te,
|
|
174
|
+
{
|
|
175
|
+
type: "Secondary",
|
|
176
|
+
onClick: () => v((e == null ? void 0 : e.id) || ""),
|
|
177
|
+
style: {
|
|
178
|
+
whiteSpace: "nowrap",
|
|
179
|
+
display: "flex",
|
|
180
|
+
alignItems: "center",
|
|
181
|
+
gap: "4px"
|
|
182
|
+
},
|
|
183
|
+
children: [
|
|
184
|
+
/* @__PURE__ */ s(ae, { name: "Copy" }),
|
|
185
|
+
/* @__PURE__ */ s("span", { children: "Copy ID" })
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
)
|
|
189
|
+
] }),
|
|
190
|
+
/* @__PURE__ */ i("div", { children: [
|
|
191
|
+
/* @__PURE__ */ s("div", { className: o.productList, children: h.map((t) => /* @__PURE__ */ s(
|
|
192
|
+
J,
|
|
193
|
+
{
|
|
194
|
+
product: t,
|
|
195
|
+
isOrder: !0,
|
|
196
|
+
isApplicableForReplacement: e == null ? void 0 : e.isApplicableForReplacement,
|
|
197
|
+
orderId: a,
|
|
198
|
+
accessToken: l,
|
|
199
|
+
allowedReplacementReasons: e == null ? void 0 : e.allowedReplacementReasons
|
|
200
|
+
},
|
|
201
|
+
t.id
|
|
202
|
+
)) }),
|
|
203
|
+
c ? null : /* @__PURE__ */ s(
|
|
204
|
+
X,
|
|
205
|
+
{
|
|
206
|
+
formatter: w,
|
|
207
|
+
coupon: null,
|
|
208
|
+
total: ((D = e == null ? void 0 : e.endPrice) == null ? void 0 : D.amount) || 0,
|
|
209
|
+
discount: 0,
|
|
210
|
+
totalWithDiscount: ((P = e == null ? void 0 : e.endPrice) == null ? void 0 : P.amount) || 0,
|
|
211
|
+
className: o.prices,
|
|
212
|
+
isShowSubtotal: !1
|
|
213
|
+
}
|
|
214
|
+
),
|
|
215
|
+
/* @__PURE__ */ s(T, { className: o.mobileFooter })
|
|
216
|
+
] })
|
|
217
|
+
] })
|
|
218
|
+
}
|
|
219
|
+
)
|
|
220
|
+
] });
|
|
221
|
+
}, $e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
222
|
+
__proto__: null,
|
|
223
|
+
OrderPage: Oe
|
|
224
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
225
|
+
export {
|
|
226
|
+
Ie as O,
|
|
227
|
+
$e as i
|
|
228
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),r=require("react"),k=require("./builder-Drs-eMpC.cjs"),n=require("./charge-BRVd1wLH.cjs"),w=require("./ui-components-D9iV1NC1.cjs");require("./builder-components-BHjHn2ZO.cjs");require("./ticket-BwxrIRC1.cjs");require("react-dom");const b=async(a=1)=>await n.fetchOrders({PageNumber:a}),B=()=>{const[a,l]=r.useState(null),[u,e]=r.useState(null),[x,j]=r.useState(0),{page:g}=k.usePaginationPagesStore(),[v,o]=r.useState(!0);async function N(){o(!0);const{list:h,totalCount:m}=await b(g);l(h),j(m),e(null),o(!1)}async function S(){const h=(a==null?void 0:a.map(f=>f.gatewayName))||[],m=await n.getGatewaysDetail(h);e(m)}return r.useEffect(()=>{!u&&a&&S()},[a,u]),r.useEffect(()=>{N()},[g]),t.jsx(t.Fragment,{children:a!=null&&a.length&&a.length===0?t.jsx(n.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(n.PageTitle,{title:"Orders"}),t.jsx(n.OrdersTable,{orders:a,gatewaysDetail:u,totalCount:x,isLoading:v})]})})},T="_orderPage_gc87l_1",$="_leftSection_gc87l_15",I="_content_gc87l_35",q="_main_gc87l_42",F="_mainAntistock_gc87l_56",L="_orderMainDataAntistock_gc87l_69",M="_timelineBlockAntistock_gc87l_81",W="_footerAntistock_gc87l_92",E="_statusBlock_gc87l_104",V="_timelineBlock_gc87l_81",G="_footer_gc87l_92",U="_rightSection_gc87l_121",z="_header_gc87l_142",H="_productList_gc87l_150",J="_mobileFooter_gc87l_157",K="_loaderContainer_gc87l_166",Q="_orderMainData_gc87l_69",X="_prices_gc87l_181",Y="_headerTitle_gc87l_185",Z="_headerDescription_gc87l_189",c={orderPage:T,leftSection:$,content:I,main:q,mainAntistock:F,orderMainDataAntistock:L,timelineBlockAntistock:M,footerAntistock:W,statusBlock:E,timelineBlock:V,footer:G,rightSection:U,header:z,productList:H,mobileFooter:J,loaderContainer:K,orderMainData:Q,prices:X,headerTitle:Y,headerDescription:Z},ee=()=>{var f,C,O,A,D,P;const{id:a,accessToken:l}=k.useParams(),u=k.useNavigate(),[e,x]=r.useState(),[j,g]=r.useState(!1),v=n.useCopy(),{isAntistock:o}=k.useGeneralStore(),N=((f=e==null?void 0:e.rawPrice)==null?void 0:f.currency)||"USD",S=new Intl.NumberFormat("en-US",{style:"currency",currency:N}),h=r.useMemo(()=>(e==null?void 0:e.partOrders.map(s=>{var _,y;return{id:(s==null?void 0:s.id)||0,image:s.productWithVariant.image,name:(()=>{var p,R;const i=((p=s.productWithVariant)==null?void 0:p.name)||"",d=((R=s.productWithVariant)==null?void 0:R.variantName)||"";return!i&&!d?"":!d||i===d?i:i?`${i} (${d})`:d})(),description:"",price:{quantity:s.quantity,amount:((_=s.productWithVariant)==null?void 0:_.price.amount)||0,currency:(y=s.productWithVariant)==null?void 0:y.price.currency},deliveryCategories:"deliveryCategories"in s?s.deliveryCategories:void 0,customerNote:s.customerNote,chargeType:s.chargeType||"ONE_TIME",replacementRequests:"replacementRequests"in s?s.replacementRequests:void 0,allowedReplacementReasons:"allowedReplacementReasons"in s?s.allowedReplacementReasons:void 0}}))||[],[e]),m=async(s,_,y=!1)=>{var d,p;y||g(!0);const{data:i}=await(_?n.fetchAuthorizedOrder(`${s}/${_}`):n.fetchOrder(s));g(!1),i.status!==n.OrderStatus.Completed&&((d=i.charge)==null?void 0:d.status)===n.ChargeStatus.NotPaid&&u(`/charges/${(p=i.charge)==null?void 0:p.id}`,{replace:!0}),x(i)};return r.useLayoutEffect(()=>{if(a&&!l){const s=JSON.parse(localStorage.getItem("orders")||"{}");s[a]&&u(`/orders/${a}/${s[a].fullAccessToken}`)}},[a]),r.useEffect(()=>{a&&m(a,l,!0);const s=setInterval(()=>{a&&m(a,l,!0)},5e3);return()=>{clearInterval(s)}},[a,l]),j?t.jsx("div",{className:c.loaderContainer,children:t.jsx(w.Loader,{})}):t.jsxs("div",{className:c.orderPage,children:[t.jsx("div",{className:c.leftSection,children:t.jsxs("div",{className:c.content,children:[t.jsx(n.CheckoutHeader,{}),e&&t.jsxs("div",{className:`${c.main} ${o?c.mainAntistock:""}`,children:[t.jsx(n.OrderStatusBlock,{className:c.statusBlock,orderStatus:e.status}),t.jsxs("div",{className:`${c.orderMainData} ${o?c.orderMainDataAntistock:""}`,children:[t.jsx(n.CheckoutOrderMainData,{lastUpdate:e.createdAt,paymentType:(C=e.charge)==null?void 0:C.gateway,email:e.customer?e.customer.email:((O=e.charge)==null?void 0:O.customerForCharge.email)||"",orderId:e.id}),"accessToken"in e.review&&!o&&t.jsx(n.LeaveAReview,{orderId:e.id,review:e.review})]}),e.charge&&e.charge.timeline&&t.jsx(n.TrackPayment,{className:`${c.timelineBlock} ${o?c.timelineBlockAntistock:""}`,timeline:e.charge.timeline}),t.jsx(n.CheckoutFooter,{className:`${c.footer} ${o?c.footerAntistock:""}`})]})]})}),t.jsx("div",{className:c.rightSection,style:o?{borderLeft:"1px solid var(--border-secondary)"}:void 0,children:t.jsxs("div",{className:c.content,children:[((A=e==null?void 0:e.charge)==null?void 0:A.name)&&t.jsxs("header",{className:c.header,children:[t.jsxs("div",{children:[t.jsx("h1",{className:c.headerTitle,children:e.charge.name}),e.charge.description&&t.jsx("p",{className:c.headerDescription,children:e.charge.description})]}),o?null:t.jsxs(w.Button,{type:"Secondary",onClick:()=>v((e==null?void 0:e.id)||""),style:{whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx(w.Icon,{name:"Copy"}),t.jsx("span",{children:"Copy ID"})]})]}),t.jsxs("div",{children:[t.jsx("div",{className:c.productList,children:h.map(s=>t.jsx(n.CheckoutProduct,{product:s,isOrder:!0,isApplicableForReplacement:e==null?void 0:e.isApplicableForReplacement,orderId:a,accessToken:l,allowedReplacementReasons:e==null?void 0:e.allowedReplacementReasons},s.id))}),o?null:t.jsx(n.CheckoutPrices,{formatter:S,coupon:null,total:((D=e==null?void 0:e.endPrice)==null?void 0:D.amount)||0,discount:0,totalWithDiscount:((P=e==null?void 0:e.endPrice)==null?void 0:P.amount)||0,className:c.prices,isShowSubtotal:!1}),t.jsx(n.CheckoutFooter,{className:c.mobileFooter})]})]})})]})},te=Object.freeze(Object.defineProperty({__proto__:null,OrderPage:ee},Symbol.toStringTag,{value:"Module"}));exports.Orders=B;exports.index=te;
|
|
@@ -6,6 +6,7 @@ export interface NotificationComponentProps {
|
|
|
6
6
|
padding?: number;
|
|
7
7
|
timer: number;
|
|
8
8
|
id: string;
|
|
9
|
+
label?: string;
|
|
9
10
|
}
|
|
10
11
|
export type Notification = {
|
|
11
12
|
id: string;
|
|
@@ -13,4 +14,5 @@ export type Notification = {
|
|
|
13
14
|
status: 'success' | 'error' | 'warning';
|
|
14
15
|
component?: React.FC<NotificationComponentProps>;
|
|
15
16
|
timer?: number;
|
|
17
|
+
label?: string;
|
|
16
18
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const fetchCheckoutDetail: (gateways: string[]) => Promise<any>;
|
|
@@ -12,3 +12,11 @@ export declare const getOrders: () => Promise<{
|
|
|
12
12
|
export declare const fetchOrder: (id: string) => Promise<import("@api").RequestResponse<any>>;
|
|
13
13
|
export declare const fetchOrderWithToken: (id: string, token: string) => Promise<import("@api").RequestResponse<any>>;
|
|
14
14
|
export declare const fetchAuthorizedOrder: (path: string) => Promise<import("@api").RequestResponse<any>>;
|
|
15
|
+
export declare const postReplacementRequest: (orderId: string, accessToken: string, body: {
|
|
16
|
+
partOrderId: number;
|
|
17
|
+
deliveryItemIds: string[];
|
|
18
|
+
imageUrls: string[];
|
|
19
|
+
reason: string;
|
|
20
|
+
message: string;
|
|
21
|
+
}) => Promise<import("@api").RequestResponse<any>>;
|
|
22
|
+
export declare const cancelReplacementRequest: (orderId: string, accessToken: string, requestId: string) => Promise<import("@api").RequestResponse<any>>;
|
|
@@ -10,6 +10,8 @@ interface CheckoutPricesProps {
|
|
|
10
10
|
isShowSubtotal?: boolean;
|
|
11
11
|
feeOrDiscount?: number | null;
|
|
12
12
|
serviceFeeAmount?: number | null;
|
|
13
|
+
replacementLabel?: string;
|
|
14
|
+
replacementAmount?: number | null;
|
|
13
15
|
}
|
|
14
16
|
export declare const CheckoutPrices: FC<CheckoutPricesProps>;
|
|
15
17
|
export {};
|
|
@@ -3,6 +3,10 @@ import { CheckoutProductT } from '@storefront/models';
|
|
|
3
3
|
interface CheckoutProductProps {
|
|
4
4
|
isOrder?: boolean;
|
|
5
5
|
product: CheckoutProductT;
|
|
6
|
+
isApplicableForReplacement?: boolean;
|
|
7
|
+
orderId?: string;
|
|
8
|
+
accessToken?: string;
|
|
9
|
+
allowedReplacementReasons?: string[];
|
|
6
10
|
}
|
|
7
11
|
export declare const CheckoutProduct: FC<CheckoutProductProps>;
|
|
8
12
|
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ReplacementConfig } from '@storefront/models';
|
|
3
|
+
export type ReplacementChoice = 'PRIORITY' | 'STANDARD' | 'NONE';
|
|
4
|
+
interface ProtectYourCheckoutProps {
|
|
5
|
+
config: ReplacementConfig | null;
|
|
6
|
+
totalAmount: number;
|
|
7
|
+
selected: ReplacementChoice | null;
|
|
8
|
+
onSelect: (choice: ReplacementChoice) => void;
|
|
9
|
+
onBack: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const ProtectYourCheckout: React.FC<ProtectYourCheckoutProps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { CheckoutProductT } from '@storefront/models';
|
|
3
|
+
interface ReplacementModalProps {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
product: CheckoutProductT;
|
|
7
|
+
orderId?: string;
|
|
8
|
+
accessToken?: string;
|
|
9
|
+
onSuccess?: (replacementRequest: {
|
|
10
|
+
id: string;
|
|
11
|
+
status: string;
|
|
12
|
+
}) => void;
|
|
13
|
+
allowedReplacementReasons?: string[];
|
|
14
|
+
}
|
|
15
|
+
export declare const ReplacementModal: FC<ReplacementModalProps>;
|
|
16
|
+
export {};
|