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