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