@billgangcom/theme-lib 1.114.2 → 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-X2Lu6tjb.js → builder-CVbCKY8a.js} +5 -5
- package/dist/{builder-nPHbngbk.cjs → builder-Iu70o8Zi.cjs} +2 -2
- package/dist/{builder-components-D785h2tu.cjs → builder-components-3ULrMVTv.cjs} +1 -1
- package/dist/{builder-components-BNkxxpUw.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-Jynnp_W-.js → charge-CqeINukp.js} +46 -38
- package/dist/{charge-DkQ14sNR.cjs → charge-pzp63q8N.cjs} +2 -2
- package/dist/{checkout-DPIHOxJF.cjs → checkout-B98fqO6J.cjs} +1 -1
- package/dist/{checkout-C-ZTxxGR.js → checkout-YVutPZ7f.js} +5 -5
- package/dist/exports.cjs.js +1 -1
- package/dist/exports.es.js +6 -6
- package/dist/{index-CgYqdTTw.js → index-B3WK0Wpu.js} +5 -5
- package/dist/{index-_Mr7z7VX.js → index-BUlydTOo.js} +5 -5
- package/dist/{index-AEcVqtPw.cjs → index-BV4ZiotJ.cjs} +1 -1
- package/dist/{index-CubqBfC_.js → index-C32vke_m.js} +5 -5
- package/dist/{index-ja-4kvwl.js → index-CiY9zOlN.js} +1 -1
- package/dist/{index-AgiKRTqt.cjs → index-Ck3jvxGA.cjs} +1 -1
- package/dist/{index-CqH6qeyf.cjs → index-D0izKDtJ.cjs} +1 -1
- package/dist/{index-C7nBO9Yk.cjs → index-D50xf07C.cjs} +1 -1
- package/dist/{index-BtN20SNf.cjs → index-Lf_IZiQr.cjs} +1 -1
- package/dist/{index-IyaVMeom.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-Bb6mktG2.cjs → subscription-4CHOOBkd.cjs} +1 -1
- package/dist/{subscription-CWaihzfa.js → subscription-D9tguRYG.js} +5 -5
- package/dist/{ticket-BL9adYRI.cjs → ticket-BKgdPBSh.cjs} +62 -62
- package/dist/{ticket-CLpJWP1h.js → ticket-BODLy8iD.js} +420 -414
- package/dist/{top-up-Dk-Y3esP.js → top-up-BxIXamXN.js} +5 -5
- package/dist/{top-up-Cg__N_vU.cjs → top-up-DR4KDupr.cjs} +1 -1
- package/dist/{ui-components-B8oZU0nb.js → ui-components-B2XdfTmJ.js} +4 -4
- package/dist/{ui-components-D0GuyFp-.cjs → ui-components-DnGzB9kA.cjs} +1 -1
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +1 -1
- package/dist/{validation-BVWHfuZu.cjs → validation-B_jzusSg.cjs} +1 -1
- package/dist/{validation-jyr_dGjd.js → validation-BusGxggf.js} +5 -5
- package/package.json +1 -1
- package/dist/order-DKol_hUe.cjs +0 -1
- package/dist/order-qWzTRhXL.js +0 -318
package/dist/ui.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./ui-components-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./ui-components-DnGzB9kA.cjs");exports.Accordion=t.Accordion;exports.AlignText=t.AlignText;exports.BurgerMenuButton=t.BurgerMenuButton;exports.Button=t.Button;exports.ButtonSettings=t.ButtonSettings;exports.ButtonTypeSettings=t.ButtonTypeSettings;exports.ButtonsSettings=t.ButtonsSettings;exports.CategorySettings=t.CategorySettings;exports.ChargeTypes=t.ChargeTypes;exports.Checkbox=t.Checkbox;exports.CheckboxSettings=t.CheckboxSettings;exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.ConfirmationModal=t.ConfirmationModal;exports.EmptyCart=t.EmptyCart;exports.ErrorableBlock=t.ErrorableBlock;exports.FormSettings=t.FormSettings;exports.GroupCardModal=t.GroupCardModal;exports.HeaderButtons=t.HeaderButtons;exports.Icon=t.Icon;exports.InputSettings=t.InputSettings;exports.InputUI=t.Input;exports.ItemsSettings=t.ItemsSettings;exports.LayoutSettings=t.LayoutSettings;exports.Link=t.Link;exports.ListingSelector=t.ListingSelector;exports.Loader=t.Loader;exports.LoaderBuilder=t.LoaderBuilder;exports.MetaInfoPost=t.MetaInfoPost;exports.Modal=t.Modal;exports.NotificationBuilder=t.NotificationBuilder;exports.PagesMobileMenu=t.PagesMobileMenu;exports.PagesMobileModal=t.PagesMobileModal;exports.PagesSettings=t.PagesSettings;exports.ProductCardButtons=t.ProductCardButtons;exports.ProductCardModal=t.ProductCardModal;exports.ProductOptions=t.ProductOptions;exports.RadioUI=t.Radio;exports.RangeSelector=t.RangeSelector;exports.Select=t.Select;exports.SelectInfiniteList=t.SelectInfiniteList;exports.SelectTypeText=t.SelectTypeText;exports.SelectUI=t.Select;exports.ShareLink=t.ShareLink;exports.ShoppingButton=t.ShoppingButton;exports.ShoppingModalCart=t.ShoppingModalCart;exports.Switch=t.Switch;exports.TextSettings=t.TextSettings;exports.TextareaSettings=t.TextareaSettings;exports.TextareaUI=t.Textarea;exports.Tip=t.Tip;exports.TypesText=t.TypesText;exports.UserInfo=t.UserInfo;exports.Wrapper=t.Wrapper;
|
package/dist/ui.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as t, A as e, Y as o, g as n, B as i, y as r, w as g, v as S, G as d, i as l, k as u, a5 as c, b as p, C as I, Q as B, E as C, F as M, a3 as T, J as h, I as x, c as y, f as L, t as P, q as f, $ as m, D as b, e as k, L as U, a1 as A, M as E, N as R, X as w, V as F, P as G, a0 as H, a2 as N, H as O, R as W, z as j, S as q, a6 as v, a4 as z, S as D, Z as J, K, O as Q, d as V, s as X, T as Y, j as Z, h as _, x as $, U as aa, W as sa } from "./ui-components-
|
|
1
|
+
import { _ as t, A as e, Y as o, g as n, B as i, y as r, w as g, v as S, G as d, i as l, k as u, a5 as c, b as p, C as I, Q as B, E as C, F as M, a3 as T, J as h, I as x, c as y, f as L, t as P, q as f, $ as m, D as b, e as k, L as U, a1 as A, M as E, N as R, X as w, V as F, P as G, a0 as H, a2 as N, H as O, R as W, z as j, S as q, a6 as v, a4 as z, S as D, Z as J, K, O as Q, d as V, s as X, T as Y, j as Z, h as _, x as $, U as aa, W as sa } from "./ui-components-B2XdfTmJ.js";
|
|
2
2
|
export {
|
|
3
3
|
t as Accordion,
|
|
4
4
|
e as AlignText,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),g=require("./charge-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),g=require("./charge-pzp63q8N.cjs"),d=require("./builder-Iu70o8Zi.cjs"),u=require("./ui-components-DnGzB9kA.cjs");require("./builder-components-3ULrMVTv.cjs");require("./ticket-BKgdPBSh.cjs");require("react-dom");const j="_lock_1mxa7_1",b="_wrapper_1mxa7_12",I="_content_1mxa7_22",y="_info_1mxa7_31",N="_buttons_1mxa7_38",q="_button_1mxa7_38",k="_input_1mxa7_50",L="_error_1mxa7_57",s={lock:j,wrapper:b,content:I,info:y,buttons:N,button:q,input:k,error:L},V=()=>{const[f,n]=r.useState(!1),[h,w]=r.useState(!1),[c,P]=r.useState(""),{general:o,setGeneral:_}=d.useGeneralStore(),{setShopPassword:p}=d.useStorefrontStore(),i=d.useLocation(),m=d.useNavigate();r.useEffect(()=>{if(o&&(!o.info.passwordProtected||o.isPasswordValid)){const t=i.state.from==="/validation"?"/":i.state.from;m(t)}},[o]),r.useEffect(()=>{o||(async()=>{var x;n(!0);const l=localStorage.getItem("shopPassword")||"",a=await g.fetchGeneral(l);if(a.isPasswordValid){const S=((x=i.state)==null?void 0:x.from)||"/";m(S)}a.info.passwordProtected||(localStorage.removeItem("shopPassword"),p("")),_(a),n(!1)})()},[o]);async function v(){var l;n(!0);const t=await g.fetchGeneral(c);if(!t.isPasswordValid)w(!0);else{localStorage.setItem("shopPassword",c),p(c);const a=((l=i.state)==null?void 0:l.from)||"/";m(a),t.info.passwordProtected||(localStorage.removeItem("shopPassword"),p("")),_(t)}n(!1)}return e.jsxs("div",{className:s.wrapper,children:[!f&&e.jsxs("div",{className:s.content,children:[e.jsx("div",{className:s.lock,children:e.jsx(u.Icon,{name:"Lock",fill:"var(--text-secondary)",width:64,height:64})}),e.jsxs("div",{className:s.info,children:[e.jsx("h2",{id:"h2",className:s.title,children:"The store is password protected"}),e.jsx("p",{id:"p",className:s.description,children:"If you do not have a password, we recommend you to contact the technical support of the store or write to the mail"})]}),e.jsxs("div",{className:s.input,children:[e.jsx(u.Input,{type:"password",onChange:t=>{w(!1),P(t)},value:c,placeholder:"Password",required:!0}),e.jsx("span",{className:s.error,children:h&&"Incorrect password"})]}),e.jsx("div",{className:s.buttons,children:e.jsx(u.Button,{type:"Primary",className:s.button,disabled:h,onClick:v,children:"Submit"})})]}),f&&e.jsx(u.Loader,{})]})};exports.ValidationPage=V;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as l, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import r from "react";
|
|
3
|
-
import { V as g } from "./charge-
|
|
4
|
-
import { V as I, M as b, ab as x, p as N } from "./builder-
|
|
5
|
-
import { I as y, f as k, g as V, e as L } from "./ui-components-
|
|
6
|
-
import "./builder-components-
|
|
7
|
-
import "./ticket-
|
|
3
|
+
import { V as g } from "./charge-CqeINukp.js";
|
|
4
|
+
import { V as I, M as b, ab as x, p as N } from "./builder-CVbCKY8a.js";
|
|
5
|
+
import { I as y, f as k, g as V, e as L } 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 E = "_lock_1mxa7_1", G = "_wrapper_1mxa7_12", j = "_content_1mxa7_22", C = "_info_1mxa7_31", q = "_buttons_1mxa7_38", B = "_button_1mxa7_38", M = "_input_1mxa7_50", R = "_error_1mxa7_57", t = {
|
|
10
10
|
lock: E,
|
package/package.json
CHANGED
package/dist/order-DKol_hUe.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),c=require("react"),x=require("./builder-nPHbngbk.cjs"),o=require("./charge-DkQ14sNR.cjs"),h=require("./ui-components-D0GuyFp-.cjs");require("./builder-components-D785h2tu.cjs");require("./ticket-BL9adYRI.cjs");require("react-dom");const $=async(s=1)=>await o.fetchOrders({PageNumber:s}),F=()=>{const[s,i]=c.useState(null),[d,e]=c.useState(null),[g,j]=c.useState(0),{page:_}=x.usePaginationPagesStore(),[k,f]=c.useState(!0);async function C(){f(!0);const{list:p,totalCount:y}=await $(_);i(p),j(y),e(null),f(!1)}async function r(){const p=(s==null?void 0:s.map(S=>S.gatewayName))||[],y=await o.getGatewaysDetail(p);e(y)}return c.useEffect(()=>{!d&&s&&r()},[s,d]),c.useEffect(()=>{C()},[_]),t.jsx(t.Fragment,{children:s!=null&&s.length&&s.length===0?t.jsx(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:d,totalCount:g,isLoading:k})]})})},M="_orderPage_gc87l_1",T="_leftSection_gc87l_15",L="_content_gc87l_35",q="_main_gc87l_42",W="_mainAntistock_gc87l_56",E="_orderMainDataAntistock_gc87l_69",G="_timelineBlockAntistock_gc87l_81",V="_footerAntistock_gc87l_92",U="_statusBlock_gc87l_104",z="_timelineBlock_gc87l_81",H="_footer_gc87l_92",J="_rightSection_gc87l_121",Y="_header_gc87l_142",K="_productList_gc87l_150",Q="_mobileFooter_gc87l_157",X="_loaderContainer_gc87l_166",Z="_orderMainData_gc87l_69",ee="_prices_gc87l_181",te="_headerTitle_gc87l_185",ne="_headerDescription_gc87l_189",a={orderPage:M,leftSection:T,content:L,main:q,mainAntistock:W,orderMainDataAntistock:E,timelineBlockAntistock:G,footerAntistock:V,statusBlock:U,timelineBlock:z,footer:H,rightSection:J,header:Y,productList:K,mobileFooter:Q,loaderContainer:X,orderMainData:Z,prices:ee,headerTitle:te,headerDescription:ne},se="_modalContent_1a05n_1",ae="_iconContainer_1a05n_16",oe="_warningIcon_1a05n_20",ce="_title_1a05n_25",re="_description_1a05n_33",ie="_buttonContainer_1a05n_40",le="_button_1a05n_40",u={modalContent:se,iconContainer:ae,warningIcon:oe,title:ce,description:re,buttonContainer:ie,button:le},ue=({isOpen:s,onClose:i,refundedAmount:d,currency:e})=>{const g=x.useNavigate(),{token:j,shopDomain:_}=x.useStorefrontStore(),{isAntistock:k}=x.useGeneralStore(),f=new Intl.NumberFormat("en-US",{style:"currency",currency:e}),C=()=>{g(k?"/account":"/customer-dash")},r=async()=>{k?window.open(`https://${_}/support`):g("/contact")},p=()=>{i()};return s?t.jsx(h.Modal,{close:i,children:t.jsxs("div",{className:u.modalContent,onClick:y=>y.stopPropagation(),children:[t.jsx("div",{className:u.iconContainer,children:t.jsx(h.Icon,{name:"WarningDiamond",fill:"var(--text-warning)",className:u.warningIcon})}),t.jsx("h2",{className:u.title,children:"Partial Delivery Failure Refund"}),t.jsxs("p",{className:u.description,children:["Your payment was successful but a few products were out of stock. We've automatically refunded the products that were out of stock, with a total of"," ",f.format(d),", to your account balance."]}),t.jsxs("div",{className:u.buttonContainer,children:[!j&&t.jsx(h.Button,{type:"Secondary",onClick:C,className:u.button,children:"Login"}),t.jsx(h.Button,{type:"Secondary",onClick:r,className:u.button,children:"Contact Support"}),t.jsx(h.Button,{type:"Primary",onClick:p,className:u.button,children:"Continue"})]})]})}):null},de=()=>{var O,P,D,A,R,I;const{id:s,accessToken:i}=x.useParams(),d=x.useNavigate(),[e,g]=c.useState(),[j,_]=c.useState(!1),[k,f]=c.useState(!1),C=o.useCopy(),{isAntistock:r}=x.useGeneralStore(),p=((O=e==null?void 0:e.rawPrice)==null?void 0:O.currency)||"USD",y=new Intl.NumberFormat("en-US",{style:"currency",currency:p}),S=c.useMemo(()=>(e==null?void 0:e.partOrders.map(n=>{var N,w;return{id:(n==null?void 0:n.id)||0,image:n.productWithVariant.image,name:(()=>{var v,B;const l=((v=n.productWithVariant)==null?void 0:v.name)||"",m=((B=n.productWithVariant)==null?void 0:B.variantName)||"";return!l&&!m?"":!m||l===m?l:l?`${l} (${m})`:m})(),description:"",price:{quantity:n.quantity,amount:((N=n.productWithVariant)==null?void 0:N.price.amount)||0,currency:(w=n.productWithVariant)==null?void 0:w.price.currency},deliveryCategories:"deliveryCategories"in n?n.deliveryCategories:void 0,customerNote:n.customerNote,chargeType:n.chargeType||"ONE_TIME",replacementRequests:"replacementRequests"in n?n.replacementRequests:void 0,allowedReplacementReasons:"allowedReplacementReasons"in n?n.allowedReplacementReasons:void 0}}))||[],[e]);c.useEffect(()=>{e&&(e.status===o.OrderStatus.FullDeliveryFailure||e.status===o.OrderStatus.PartiallyDelivered)&&e.refundedPrice&&e.refundedPrice.amount>0&&f(!0)},[e==null?void 0:e.status]);const b=async(n,N,w=!1)=>{var m,v;w||_(!0);const{data:l}=await(N?o.fetchAuthorizedOrder(`${n}/${N}`):o.fetchOrder(n));_(!1),l.status!==o.OrderStatus.Completed&&((m=l.charge)==null?void 0:m.status)===o.ChargeStatus.NotPaid&&d(`/charges/${(v=l.charge)==null?void 0:v.id}`,{replace:!0}),g(l)};return c.useLayoutEffect(()=>{if(s&&!i){const n=JSON.parse(localStorage.getItem("orders")||"{}");n[s]&&d(`/orders/${s}/${n[s].fullAccessToken}`)}},[s]),c.useEffect(()=>{s&&b(s,i,!0);const n=setInterval(()=>{s&&b(s,i,!0)},5e3);return()=>{clearInterval(n)}},[s,i]),j?t.jsx("div",{className:a.loaderContainer,children:t.jsx(h.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} ${r?a.mainAntistock:""}`,children:[t.jsx(o.OrderStatusBlock,{className:a.statusBlock,orderStatus:e.status}),t.jsxs("div",{className:`${a.orderMainData} ${r?a.orderMainDataAntistock:""}`,children:[t.jsx(o.CheckoutOrderMainData,{lastUpdate:e.createdAt,paymentType:(P=e.charge)==null?void 0:P.gateway,email:e.customer?e.customer.email:((D=e.charge)==null?void 0:D.customerForCharge.email)||"",orderId:e.id}),"accessToken"in e.review&&!r&&t.jsx(o.LeaveAReview,{orderId:e.id,review:e.review})]}),e.charge&&e.charge.timeline&&t.jsx(o.TrackPayment,{className:`${a.timelineBlock} ${r?a.timelineBlockAntistock:""}`,timeline:e.charge.timeline}),t.jsx(o.CheckoutFooter,{className:`${a.footer} ${r?a.footerAntistock:""}`})]})]})}),t.jsx("div",{className:a.rightSection,style:r?{borderLeft:"1px solid var(--border-secondary)"}:void 0,children:t.jsxs("div",{className:a.content,children:[((A=e==null?void 0:e.charge)==null?void 0:A.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})]}),r?null:t.jsxs(h.Button,{type:"Secondary",onClick:()=>C((e==null?void 0:e.id)||""),style:{whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx(h.Icon,{name:"Copy"}),t.jsx("span",{children:"Copy ID"})]})]}),t.jsxs("div",{children:[t.jsx("div",{className:a.productList,children:S.map(n=>t.jsx(o.CheckoutProduct,{product:n,isOrder:!0,isApplicableForReplacement:e==null?void 0:e.isApplicableForReplacement,orderId:s,accessToken:i,allowedReplacementReasons:e==null?void 0:e.allowedReplacementReasons},n.id))}),r?null:t.jsx(o.CheckoutPrices,{formatter:y,coupon:null,total:((R=e==null?void 0:e.endPrice)==null?void 0:R.amount)||0,discount:0,totalWithDiscount:((I=e==null?void 0:e.endPrice)==null?void 0:I.amount)||0,className:a.prices,isShowSubtotal:!1}),t.jsx(o.CheckoutFooter,{className:a.mobileFooter})]})]})}),(e==null?void 0:e.refundedPrice)&&t.jsx(ue,{isOpen:k,onClose:()=>f(!1),refundedAmount:e.refundedPrice.amount,currency:e.refundedPrice.currency})]})},me=Object.freeze(Object.defineProperty({__proto__:null,OrderPage:de},Symbol.toStringTag,{value:"Module"}));exports.Orders=F;exports.index=me;
|
package/dist/order-qWzTRhXL.js
DELETED
|
@@ -1,318 +0,0 @@
|
|
|
1
|
-
import { jsx as t, Fragment as B, jsxs as s } from "react/jsx-runtime";
|
|
2
|
-
import i, { useState as E } from "react";
|
|
3
|
-
import { X as V, p as F, M as j, V as W, a7 as q } from "./builder-X2Lu6tjb.js";
|
|
4
|
-
import { f as G, N as U, P as z, O as H, g as J, b as X, c as P, d as Y, e as K, h as Q, L as Z, T as ee, i as L, j as te, k as ne, l as ae, m as oe, n as se } from "./charge-Jynnp_W-.js";
|
|
5
|
-
import { M as ce, I as x, g as S, e as ie } from "./ui-components-B8oZU0nb.js";
|
|
6
|
-
import "./builder-components-BNkxxpUw.js";
|
|
7
|
-
import "./ticket-CLpJWP1h.js";
|
|
8
|
-
import "react-dom";
|
|
9
|
-
const re = async (a = 1) => await G({ PageNumber: a }), ze = () => {
|
|
10
|
-
const [a, r] = i.useState(null), [u, e] = E(null), [h, k] = i.useState(0), { page: g } = V(), [y, _] = i.useState(!0);
|
|
11
|
-
async function N() {
|
|
12
|
-
_(!0);
|
|
13
|
-
const { list: f, totalCount: p } = await re(g);
|
|
14
|
-
r(f), k(p), e(null), _(!1);
|
|
15
|
-
}
|
|
16
|
-
async function c() {
|
|
17
|
-
const f = (a == null ? void 0 : a.map((b) => b.gatewayName)) || [], p = await J(f);
|
|
18
|
-
e(p);
|
|
19
|
-
}
|
|
20
|
-
return i.useEffect(() => {
|
|
21
|
-
!u && a && c();
|
|
22
|
-
}, [a, u]), i.useEffect(() => {
|
|
23
|
-
N();
|
|
24
|
-
}, [g]), /* @__PURE__ */ t(B, { children: a != null && a.length && a.length === 0 ? /* @__PURE__ */ t(
|
|
25
|
-
U,
|
|
26
|
-
{
|
|
27
|
-
title: "No Orders",
|
|
28
|
-
description: "When you purchase products from our website, you'll see a history of orders here."
|
|
29
|
-
}
|
|
30
|
-
) : /* @__PURE__ */ s(B, { children: [
|
|
31
|
-
/* @__PURE__ */ t(z, { title: "Orders" }),
|
|
32
|
-
/* @__PURE__ */ t(
|
|
33
|
-
H,
|
|
34
|
-
{
|
|
35
|
-
orders: a,
|
|
36
|
-
gatewaysDetail: u,
|
|
37
|
-
totalCount: h,
|
|
38
|
-
isLoading: y
|
|
39
|
-
}
|
|
40
|
-
)
|
|
41
|
-
] }) });
|
|
42
|
-
}, le = "_orderPage_gc87l_1", de = "_leftSection_gc87l_15", ue = "_content_gc87l_35", me = "_main_gc87l_42", he = "_mainAntistock_gc87l_56", ge = "_orderMainDataAntistock_gc87l_69", _e = "_timelineBlockAntistock_gc87l_81", fe = "_footerAntistock_gc87l_92", pe = "_statusBlock_gc87l_104", ye = "_timelineBlock_gc87l_81", ke = "_footer_gc87l_92", Ne = "_rightSection_gc87l_121", Ce = "_header_gc87l_142", we = "_productList_gc87l_150", ve = "_mobileFooter_gc87l_157", Se = "_loaderContainer_gc87l_166", be = "_orderMainData_gc87l_69", Pe = "_prices_gc87l_181", Oe = "_headerTitle_gc87l_185", De = "_headerDescription_gc87l_189", o = {
|
|
43
|
-
orderPage: le,
|
|
44
|
-
leftSection: de,
|
|
45
|
-
content: ue,
|
|
46
|
-
main: me,
|
|
47
|
-
mainAntistock: he,
|
|
48
|
-
orderMainDataAntistock: ge,
|
|
49
|
-
timelineBlockAntistock: _e,
|
|
50
|
-
footerAntistock: fe,
|
|
51
|
-
statusBlock: pe,
|
|
52
|
-
timelineBlock: ye,
|
|
53
|
-
footer: ke,
|
|
54
|
-
rightSection: Ne,
|
|
55
|
-
header: Ce,
|
|
56
|
-
productList: we,
|
|
57
|
-
mobileFooter: ve,
|
|
58
|
-
loaderContainer: Se,
|
|
59
|
-
orderMainData: be,
|
|
60
|
-
prices: Pe,
|
|
61
|
-
headerTitle: Oe,
|
|
62
|
-
headerDescription: De
|
|
63
|
-
}, Ae = "_modalContent_1a05n_1", Re = "_iconContainer_1a05n_16", Ie = "_warningIcon_1a05n_20", Me = "_title_1a05n_25", $e = "_description_1a05n_33", Te = "_buttonContainer_1a05n_40", Be = "_button_1a05n_40", d = {
|
|
64
|
-
modalContent: Ae,
|
|
65
|
-
iconContainer: Re,
|
|
66
|
-
warningIcon: Ie,
|
|
67
|
-
title: Me,
|
|
68
|
-
description: $e,
|
|
69
|
-
buttonContainer: Te,
|
|
70
|
-
button: Be
|
|
71
|
-
}, Le = ({
|
|
72
|
-
isOpen: a,
|
|
73
|
-
onClose: r,
|
|
74
|
-
refundedAmount: u,
|
|
75
|
-
currency: e
|
|
76
|
-
}) => {
|
|
77
|
-
const h = F(), { token: k, shopDomain: g } = j(), { isAntistock: y } = W(), _ = new Intl.NumberFormat("en-US", {
|
|
78
|
-
style: "currency",
|
|
79
|
-
currency: e
|
|
80
|
-
}), N = () => {
|
|
81
|
-
h(y ? "/account" : "/customer-dash");
|
|
82
|
-
}, c = async () => {
|
|
83
|
-
y ? window.open(`https://${g}/support`) : h("/contact");
|
|
84
|
-
}, f = () => {
|
|
85
|
-
r();
|
|
86
|
-
};
|
|
87
|
-
return a ? /* @__PURE__ */ t(ce, { close: r, children: /* @__PURE__ */ s(
|
|
88
|
-
"div",
|
|
89
|
-
{
|
|
90
|
-
className: d.modalContent,
|
|
91
|
-
onClick: (p) => p.stopPropagation(),
|
|
92
|
-
children: [
|
|
93
|
-
/* @__PURE__ */ t("div", { className: d.iconContainer, children: /* @__PURE__ */ t(
|
|
94
|
-
x,
|
|
95
|
-
{
|
|
96
|
-
name: "WarningDiamond",
|
|
97
|
-
fill: "var(--text-warning)",
|
|
98
|
-
className: d.warningIcon
|
|
99
|
-
}
|
|
100
|
-
) }),
|
|
101
|
-
/* @__PURE__ */ t("h2", { className: d.title, children: "Partial Delivery Failure Refund" }),
|
|
102
|
-
/* @__PURE__ */ s("p", { className: d.description, children: [
|
|
103
|
-
"Your payment was successful but a few products were out of stock. We've automatically refunded the products that were out of stock, with a total of",
|
|
104
|
-
" ",
|
|
105
|
-
_.format(u),
|
|
106
|
-
", to your account balance."
|
|
107
|
-
] }),
|
|
108
|
-
/* @__PURE__ */ s("div", { className: d.buttonContainer, children: [
|
|
109
|
-
!k && /* @__PURE__ */ t(
|
|
110
|
-
S,
|
|
111
|
-
{
|
|
112
|
-
type: "Secondary",
|
|
113
|
-
onClick: N,
|
|
114
|
-
className: d.button,
|
|
115
|
-
children: "Login"
|
|
116
|
-
}
|
|
117
|
-
),
|
|
118
|
-
/* @__PURE__ */ t(
|
|
119
|
-
S,
|
|
120
|
-
{
|
|
121
|
-
type: "Secondary",
|
|
122
|
-
onClick: c,
|
|
123
|
-
className: d.button,
|
|
124
|
-
children: "Contact Support"
|
|
125
|
-
}
|
|
126
|
-
),
|
|
127
|
-
/* @__PURE__ */ t(
|
|
128
|
-
S,
|
|
129
|
-
{
|
|
130
|
-
type: "Primary",
|
|
131
|
-
onClick: f,
|
|
132
|
-
className: d.button,
|
|
133
|
-
children: "Continue"
|
|
134
|
-
}
|
|
135
|
-
)
|
|
136
|
-
] })
|
|
137
|
-
]
|
|
138
|
-
}
|
|
139
|
-
) }) : null;
|
|
140
|
-
}, Fe = () => {
|
|
141
|
-
var D, A, R, I, M, $;
|
|
142
|
-
const { id: a, accessToken: r } = q(), u = F(), [e, h] = i.useState(), [k, g] = i.useState(!1), [y, _] = i.useState(!1), N = X(), { isAntistock: c } = W(), f = ((D = e == null ? void 0 : e.rawPrice) == null ? void 0 : D.currency) || "USD", p = new Intl.NumberFormat("en-US", {
|
|
143
|
-
style: "currency",
|
|
144
|
-
currency: f
|
|
145
|
-
}), b = i.useMemo(() => (e == null ? void 0 : e.partOrders.map((n) => {
|
|
146
|
-
var C, v;
|
|
147
|
-
return {
|
|
148
|
-
id: (n == null ? void 0 : n.id) || 0,
|
|
149
|
-
image: n.productWithVariant.image,
|
|
150
|
-
name: (() => {
|
|
151
|
-
var w, T;
|
|
152
|
-
const l = ((w = n.productWithVariant) == null ? void 0 : w.name) || "", m = ((T = n.productWithVariant) == null ? void 0 : T.variantName) || "";
|
|
153
|
-
return !l && !m ? "" : !m || l === m ? l : l ? `${l} (${m})` : m;
|
|
154
|
-
})(),
|
|
155
|
-
description: "",
|
|
156
|
-
price: {
|
|
157
|
-
quantity: n.quantity,
|
|
158
|
-
amount: ((C = n.productWithVariant) == null ? void 0 : C.price.amount) || 0,
|
|
159
|
-
currency: (v = n.productWithVariant) == null ? void 0 : v.price.currency
|
|
160
|
-
},
|
|
161
|
-
deliveryCategories: "deliveryCategories" in n ? n.deliveryCategories : void 0,
|
|
162
|
-
customerNote: n.customerNote,
|
|
163
|
-
chargeType: n.chargeType || "ONE_TIME",
|
|
164
|
-
replacementRequests: "replacementRequests" in n ? n.replacementRequests : void 0,
|
|
165
|
-
allowedReplacementReasons: "allowedReplacementReasons" in n ? n.allowedReplacementReasons : void 0
|
|
166
|
-
};
|
|
167
|
-
})) || [], [e]);
|
|
168
|
-
i.useEffect(() => {
|
|
169
|
-
e && (e.status === P.FullDeliveryFailure || e.status === P.PartiallyDelivered) && e.refundedPrice && e.refundedPrice.amount > 0 && _(!0);
|
|
170
|
-
}, [e == null ? void 0 : e.status]);
|
|
171
|
-
const O = async (n, C, v = !1) => {
|
|
172
|
-
var m, w;
|
|
173
|
-
v || g(!0);
|
|
174
|
-
const { data: l } = await (C ? ae(`${n}/${C}`) : oe(n));
|
|
175
|
-
g(!1), l.status !== P.Completed && ((m = l.charge) == null ? void 0 : m.status) === se.NotPaid && u(`/charges/${(w = l.charge) == null ? void 0 : w.id}`, {
|
|
176
|
-
replace: !0
|
|
177
|
-
}), h(l);
|
|
178
|
-
};
|
|
179
|
-
return i.useLayoutEffect(() => {
|
|
180
|
-
if (a && !r) {
|
|
181
|
-
const n = JSON.parse(localStorage.getItem("orders") || "{}");
|
|
182
|
-
n[a] && u(`/orders/${a}/${n[a].fullAccessToken}`);
|
|
183
|
-
}
|
|
184
|
-
}, [a]), i.useEffect(() => {
|
|
185
|
-
a && O(a, r, !0);
|
|
186
|
-
const n = setInterval(() => {
|
|
187
|
-
a && O(a, r, !0);
|
|
188
|
-
}, 5e3);
|
|
189
|
-
return () => {
|
|
190
|
-
clearInterval(n);
|
|
191
|
-
};
|
|
192
|
-
}, [a, r]), k ? /* @__PURE__ */ t("div", { className: o.loaderContainer, children: /* @__PURE__ */ t(ie, {}) }) : /* @__PURE__ */ s("div", { className: o.orderPage, children: [
|
|
193
|
-
/* @__PURE__ */ t("div", { className: o.leftSection, children: /* @__PURE__ */ s("div", { className: o.content, children: [
|
|
194
|
-
/* @__PURE__ */ t(Y, {}),
|
|
195
|
-
e && /* @__PURE__ */ s("div", { className: `${o.main} ${c ? o.mainAntistock : ""}`, children: [
|
|
196
|
-
/* @__PURE__ */ t(
|
|
197
|
-
K,
|
|
198
|
-
{
|
|
199
|
-
className: o.statusBlock,
|
|
200
|
-
orderStatus: e.status
|
|
201
|
-
}
|
|
202
|
-
),
|
|
203
|
-
/* @__PURE__ */ s(
|
|
204
|
-
"div",
|
|
205
|
-
{
|
|
206
|
-
className: `${o.orderMainData} ${c ? o.orderMainDataAntistock : ""}`,
|
|
207
|
-
children: [
|
|
208
|
-
/* @__PURE__ */ t(
|
|
209
|
-
Q,
|
|
210
|
-
{
|
|
211
|
-
lastUpdate: e.createdAt,
|
|
212
|
-
paymentType: (A = e.charge) == null ? void 0 : A.gateway,
|
|
213
|
-
email: e.customer ? e.customer.email : ((R = e.charge) == null ? void 0 : R.customerForCharge.email) || "",
|
|
214
|
-
orderId: e.id
|
|
215
|
-
}
|
|
216
|
-
),
|
|
217
|
-
"accessToken" in e.review && !c && /* @__PURE__ */ t(
|
|
218
|
-
Z,
|
|
219
|
-
{
|
|
220
|
-
orderId: e.id,
|
|
221
|
-
review: e.review
|
|
222
|
-
}
|
|
223
|
-
)
|
|
224
|
-
]
|
|
225
|
-
}
|
|
226
|
-
),
|
|
227
|
-
e.charge && e.charge.timeline && /* @__PURE__ */ t(
|
|
228
|
-
ee,
|
|
229
|
-
{
|
|
230
|
-
className: `${o.timelineBlock} ${c ? o.timelineBlockAntistock : ""}`,
|
|
231
|
-
timeline: e.charge.timeline
|
|
232
|
-
}
|
|
233
|
-
),
|
|
234
|
-
/* @__PURE__ */ t(
|
|
235
|
-
L,
|
|
236
|
-
{
|
|
237
|
-
className: `${o.footer} ${c ? o.footerAntistock : ""}`
|
|
238
|
-
}
|
|
239
|
-
)
|
|
240
|
-
] })
|
|
241
|
-
] }) }),
|
|
242
|
-
/* @__PURE__ */ t(
|
|
243
|
-
"div",
|
|
244
|
-
{
|
|
245
|
-
className: o.rightSection,
|
|
246
|
-
style: c ? { borderLeft: "1px solid var(--border-secondary)" } : void 0,
|
|
247
|
-
children: /* @__PURE__ */ s("div", { className: o.content, children: [
|
|
248
|
-
((I = e == null ? void 0 : e.charge) == null ? void 0 : I.name) && /* @__PURE__ */ s("header", { className: o.header, children: [
|
|
249
|
-
/* @__PURE__ */ s("div", { children: [
|
|
250
|
-
/* @__PURE__ */ t("h1", { className: o.headerTitle, children: e.charge.name }),
|
|
251
|
-
e.charge.description && /* @__PURE__ */ t("p", { className: o.headerDescription, children: e.charge.description })
|
|
252
|
-
] }),
|
|
253
|
-
c ? null : /* @__PURE__ */ s(
|
|
254
|
-
S,
|
|
255
|
-
{
|
|
256
|
-
type: "Secondary",
|
|
257
|
-
onClick: () => N((e == null ? void 0 : e.id) || ""),
|
|
258
|
-
style: {
|
|
259
|
-
whiteSpace: "nowrap",
|
|
260
|
-
display: "flex",
|
|
261
|
-
alignItems: "center",
|
|
262
|
-
gap: "4px"
|
|
263
|
-
},
|
|
264
|
-
children: [
|
|
265
|
-
/* @__PURE__ */ t(x, { name: "Copy" }),
|
|
266
|
-
/* @__PURE__ */ t("span", { children: "Copy ID" })
|
|
267
|
-
]
|
|
268
|
-
}
|
|
269
|
-
)
|
|
270
|
-
] }),
|
|
271
|
-
/* @__PURE__ */ s("div", { children: [
|
|
272
|
-
/* @__PURE__ */ t("div", { className: o.productList, children: b.map((n) => /* @__PURE__ */ t(
|
|
273
|
-
te,
|
|
274
|
-
{
|
|
275
|
-
product: n,
|
|
276
|
-
isOrder: !0,
|
|
277
|
-
isApplicableForReplacement: e == null ? void 0 : e.isApplicableForReplacement,
|
|
278
|
-
orderId: a,
|
|
279
|
-
accessToken: r,
|
|
280
|
-
allowedReplacementReasons: e == null ? void 0 : e.allowedReplacementReasons
|
|
281
|
-
},
|
|
282
|
-
n.id
|
|
283
|
-
)) }),
|
|
284
|
-
c ? null : /* @__PURE__ */ t(
|
|
285
|
-
ne,
|
|
286
|
-
{
|
|
287
|
-
formatter: p,
|
|
288
|
-
coupon: null,
|
|
289
|
-
total: ((M = e == null ? void 0 : e.endPrice) == null ? void 0 : M.amount) || 0,
|
|
290
|
-
discount: 0,
|
|
291
|
-
totalWithDiscount: (($ = e == null ? void 0 : e.endPrice) == null ? void 0 : $.amount) || 0,
|
|
292
|
-
className: o.prices,
|
|
293
|
-
isShowSubtotal: !1
|
|
294
|
-
}
|
|
295
|
-
),
|
|
296
|
-
/* @__PURE__ */ t(L, { className: o.mobileFooter })
|
|
297
|
-
] })
|
|
298
|
-
] })
|
|
299
|
-
}
|
|
300
|
-
),
|
|
301
|
-
(e == null ? void 0 : e.refundedPrice) && /* @__PURE__ */ t(
|
|
302
|
-
Le,
|
|
303
|
-
{
|
|
304
|
-
isOpen: y,
|
|
305
|
-
onClose: () => _(!1),
|
|
306
|
-
refundedAmount: e.refundedPrice.amount,
|
|
307
|
-
currency: e.refundedPrice.currency
|
|
308
|
-
}
|
|
309
|
-
)
|
|
310
|
-
] });
|
|
311
|
-
}, He = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
312
|
-
__proto__: null,
|
|
313
|
-
OrderPage: Fe
|
|
314
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
315
|
-
export {
|
|
316
|
-
ze as O,
|
|
317
|
-
He as i
|
|
318
|
-
};
|