@fayz-ai/storefront 0.82.0 → 0.83.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics/meta-pixel.d.ts.map +1 -1
- package/dist/analytics/posthog.d.ts +3 -0
- package/dist/analytics/posthog.d.ts.map +1 -1
- package/dist/app/router.d.ts +2 -2
- package/dist/chunk-4REZOGGW.js +153 -0
- package/dist/chunk-4REZOGGW.js.map +1 -0
- package/dist/{chunk-UJHCVRK3.js → chunk-7N5HKQBM.js} +2 -2
- package/dist/{chunk-UJHCVRK3.js.map → chunk-7N5HKQBM.js.map} +1 -1
- package/dist/{chunk-GI5BTJK6.js → chunk-G2R6OJQA.js} +4 -4
- package/dist/{chunk-GI5BTJK6.js.map → chunk-G2R6OJQA.js.map} +1 -1
- package/dist/{chunk-RYWQGQ4M.js → chunk-OV6DVQMB.js} +128 -115
- package/dist/chunk-OV6DVQMB.js.map +1 -0
- package/dist/components/delivery/StoreCover.d.ts +0 -17
- package/dist/components/delivery/StoreCover.d.ts.map +1 -1
- package/dist/document/config.d.ts +7 -5
- package/dist/document/config.d.ts.map +1 -1
- package/dist/edge.d.ts +1 -1
- package/dist/edge.d.ts.map +1 -1
- package/dist/edge.js +16 -26
- package/dist/edge.js.map +1 -1
- package/dist/experiments/assign.d.ts +41 -53
- package/dist/experiments/assign.d.ts.map +1 -1
- package/dist/experiments/react.d.ts +4 -3
- package/dist/experiments/react.d.ts.map +1 -1
- package/dist/host/edge-handler.d.ts +15 -12
- package/dist/host/edge-handler.d.ts.map +1 -1
- package/dist/host.js +4 -4
- package/dist/index.js +7 -7
- package/dist/lib/theme.d.ts +2 -0
- package/dist/lib/theme.d.ts.map +1 -1
- package/dist/render.js +4 -4
- package/dist/tanstack.js +3 -3
- package/package.json +4 -4
- package/dist/chunk-746BEU7H.js +0 -160
- package/dist/chunk-746BEU7H.js.map +0 -1
- package/dist/chunk-RYWQGQ4M.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Link, useStorefrontConfig, useStorefrontConfigOptional, useBlockData, BlockDataError, navigateTo, useRoutePath, toBlockNodes, defaultPageBlocks, PageDataScope, getStorefrontComponents, useLoader, currentStaticRenderPass, matchPath, translate, productSeo, StorefrontConfigProvider, mergePageTheme, pageThemeSelector, MENU_DATA_NEEDS, resolveConfig, useRouterAdapter, shellRouterAdapter, StorefrontRouterProvider, useScrollToTopOnNavigate, checkPageBlocks, normalizeLanguage, useHashPath, resolveStorefrontRoute, matchContentPage } from './chunk-
|
|
2
|
-
import { CONTROL, readVisitorId } from './chunk-
|
|
1
|
+
import { Link, useStorefrontConfig, useStorefrontConfigOptional, useBlockData, BlockDataError, navigateTo, useRoutePath, toBlockNodes, defaultPageBlocks, PageDataScope, getStorefrontComponents, useLoader, currentStaticRenderPass, matchPath, translate, productSeo, StorefrontConfigProvider, mergePageTheme, pageThemeSelector, MENU_DATA_NEEDS, resolveConfig, useRouterAdapter, shellRouterAdapter, StorefrontRouterProvider, useScrollToTopOnNavigate, checkPageBlocks, normalizeLanguage, useHashPath, resolveStorefrontRoute, matchContentPage } from './chunk-7N5HKQBM.js';
|
|
2
|
+
import { runningExperiments, CONTROL, readVisitorId } from './chunk-4REZOGGW.js';
|
|
3
3
|
import { create } from 'zustand';
|
|
4
4
|
import { persist } from 'zustand/middleware';
|
|
5
5
|
import { normalizePostalCode, getCountrySchema, lookupPostalCode, useBlockPath, BlockRenderer, BlockChildren, defineLoader, repairBlockTree, renderBlocks, clearExtensionPoints, defineExtensionPoint, runExtensionPoint, runEscapeValve, errorMessage, hasEntityDeclaration, resolveEntityDeclaration, defineBlock, formatPostalCode, countryName, defineEntity, defaultRouterAdapter, describeError, validateAddress } from '@fayz-ai/core';
|
|
6
6
|
import { getShopProvider, setShopProvider } from '@fayz-ai/shop/runtime';
|
|
7
|
-
import * as
|
|
8
|
-
import
|
|
7
|
+
import * as React38 from 'react';
|
|
8
|
+
import React38__default, { createContext, useRef, useState, useEffect, useMemo, useContext, useCallback } from 'react';
|
|
9
9
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
10
10
|
import { createMockAuthAdapter } from '@fayz-ai/auth';
|
|
11
11
|
import { createAuthRuntime } from '@fayz-ai/auth/lib/runtime';
|
|
@@ -543,26 +543,26 @@ var bootstrap = null;
|
|
|
543
543
|
function getExperimentBootstrap() {
|
|
544
544
|
return bootstrap;
|
|
545
545
|
}
|
|
546
|
-
var ExperimentContext =
|
|
546
|
+
var ExperimentContext = React38__default.createContext(null);
|
|
547
547
|
function ExperimentProvider({ assignments, path, children }) {
|
|
548
548
|
const config = useStorefrontConfig();
|
|
549
|
-
const kept =
|
|
549
|
+
const kept = React38__default.useRef(null);
|
|
550
550
|
if (!kept.current && assignments) kept.current = assignments;
|
|
551
551
|
const current = kept.current ?? { flags: {} };
|
|
552
552
|
if (typeof window !== "undefined" && kept.current && !bootstrap) bootstrap = kept.current;
|
|
553
|
-
const declaredKeys = Object.keys(config.experiments
|
|
554
|
-
const declared =
|
|
555
|
-
const exposed =
|
|
556
|
-
const value =
|
|
553
|
+
const declaredKeys = Object.keys(runningExperiments(config.experiments)).sort().join("\n");
|
|
554
|
+
const declared = React38__default.useMemo(() => new Set(declaredKeys ? declaredKeys.split("\n") : []), [declaredKeys]);
|
|
555
|
+
const exposed = React38__default.useMemo(() => /* @__PURE__ */ new Set(), [path]);
|
|
556
|
+
const value = React38__default.useMemo(() => ({ assignments: current, declared, exposed }), [current, declared, exposed]);
|
|
557
557
|
return /* @__PURE__ */ jsx(ExperimentContext.Provider, { value, children });
|
|
558
558
|
}
|
|
559
559
|
function useExperiment(key) {
|
|
560
|
-
const state =
|
|
560
|
+
const state = React38__default.useContext(ExperimentContext);
|
|
561
561
|
const assigned = state?.declared.has(key) ? state.assignments.flags[key] : void 0;
|
|
562
562
|
const result = assigned ?? { variant: CONTROL };
|
|
563
563
|
const variant = result.variant;
|
|
564
564
|
const inExperiment = Boolean(assigned);
|
|
565
|
-
|
|
565
|
+
React38__default.useEffect(() => {
|
|
566
566
|
if (!state || !inExperiment || state.exposed.has(key)) return;
|
|
567
567
|
state.exposed.add(key);
|
|
568
568
|
trackStorefront("experiment_exposed", { experiment: key, variant });
|
|
@@ -589,7 +589,7 @@ function ExperimentVariantBlock({ node }) {
|
|
|
589
589
|
}
|
|
590
590
|
var experimentBlockMeta = {
|
|
591
591
|
label: "Experiment",
|
|
592
|
-
description: 'A/B test: shows one of its variants to each visitor, as
|
|
592
|
+
description: 'A/B test: shows one of its variants to each visitor, as bucketed at the edge for the declared experiment of the same key. The variant named "control" is the fallback.',
|
|
593
593
|
settings: [
|
|
594
594
|
{
|
|
595
595
|
id: "experiment",
|
|
@@ -657,6 +657,7 @@ function startStorefrontPostHog(config, context) {
|
|
|
657
657
|
capture_heatmaps: true,
|
|
658
658
|
disable_session_recording: config.replay === false,
|
|
659
659
|
session_recording: { maskAllInputs: true },
|
|
660
|
+
disable_surveys: config.surveys !== true,
|
|
660
661
|
before_send: (event) => {
|
|
661
662
|
if (!event) return event;
|
|
662
663
|
const groups = event.properties.$groups ?? {};
|
|
@@ -736,6 +737,16 @@ function metaEventFor(event, currency) {
|
|
|
736
737
|
}
|
|
737
738
|
}
|
|
738
739
|
var strip = (params) => Object.fromEntries(Object.entries(params).filter(([, v]) => v !== void 0 && v !== null));
|
|
740
|
+
function loadFbEventsAfterLoad() {
|
|
741
|
+
const inject = () => {
|
|
742
|
+
const script = document.createElement("script");
|
|
743
|
+
script.async = true;
|
|
744
|
+
script.src = "https://connect.facebook.net/en_US/fbevents.js";
|
|
745
|
+
document.head.appendChild(script);
|
|
746
|
+
};
|
|
747
|
+
if (document.readyState === "complete") inject();
|
|
748
|
+
else window.addEventListener("load", inject, { once: true });
|
|
749
|
+
}
|
|
739
750
|
function installFbq() {
|
|
740
751
|
if (window.fbq) return window.fbq;
|
|
741
752
|
const fbq = function(...args) {
|
|
@@ -748,10 +759,7 @@ function installFbq() {
|
|
|
748
759
|
fbq.queue = [];
|
|
749
760
|
window.fbq = fbq;
|
|
750
761
|
if (!window._fbq) window._fbq = fbq;
|
|
751
|
-
|
|
752
|
-
script.async = true;
|
|
753
|
-
script.src = "https://connect.facebook.net/en_US/fbevents.js";
|
|
754
|
-
document.head.appendChild(script);
|
|
762
|
+
loadFbEventsAfterLoad();
|
|
755
763
|
return fbq;
|
|
756
764
|
}
|
|
757
765
|
var PURCHASES_KEY = "fayz.meta.purchases";
|
|
@@ -815,19 +823,19 @@ function StorefrontAnalytics({ config, path }) {
|
|
|
815
823
|
const metaPixel = pixelId && META_PIXEL_ID.test(pixelId) ? pixelId : null;
|
|
816
824
|
const reporting = Boolean(posthog || metaPixel);
|
|
817
825
|
const menuPath = config.delivery?.menuPath;
|
|
818
|
-
const previous =
|
|
819
|
-
|
|
826
|
+
const previous = React38.useRef(null);
|
|
827
|
+
React38.useEffect(() => {
|
|
820
828
|
if (!posthog) return;
|
|
821
829
|
startStorefrontPostHog(posthog, { storeName: config.name, commerceMode: config.commerceMode });
|
|
822
830
|
}, [posthog, config.name, config.commerceMode]);
|
|
823
|
-
|
|
831
|
+
React38.useEffect(() => {
|
|
824
832
|
if (!metaPixel) return;
|
|
825
833
|
startStorefrontMetaPixel({ pixelId: metaPixel }, { currency: config.currency ?? "BRL" });
|
|
826
834
|
}, [metaPixel, config.currency]);
|
|
827
|
-
|
|
835
|
+
React38.useEffect(() => {
|
|
828
836
|
if (metaPixel) trackMetaPageView();
|
|
829
837
|
}, [metaPixel, path]);
|
|
830
|
-
|
|
838
|
+
React38.useEffect(() => {
|
|
831
839
|
if (!reporting) return;
|
|
832
840
|
let ready = useCartStore.persist?.hasHydrated?.() ?? true;
|
|
833
841
|
const unhydrated = useCartStore.persist?.onFinishHydration?.(() => {
|
|
@@ -858,7 +866,7 @@ function StorefrontAnalytics({ config, path }) {
|
|
|
858
866
|
unhydrated?.();
|
|
859
867
|
};
|
|
860
868
|
}, [reporting]);
|
|
861
|
-
|
|
869
|
+
React38.useEffect(() => {
|
|
862
870
|
if (!reporting) return;
|
|
863
871
|
const from = previous.current;
|
|
864
872
|
previous.current = path;
|
|
@@ -1672,9 +1680,9 @@ function SmoothImage({
|
|
|
1672
1680
|
const easing = resolved.easing ?? "cubic-bezier(0.22, 1, 0.36, 1)";
|
|
1673
1681
|
const blur = resolved.blur ?? true;
|
|
1674
1682
|
const transform = resolved.transform ?? "none";
|
|
1675
|
-
const ref =
|
|
1676
|
-
const [loaded, setLoaded] =
|
|
1677
|
-
const delivered =
|
|
1683
|
+
const ref = React38__default.useRef(null);
|
|
1684
|
+
const [loaded, setLoaded] = React38__default.useState(() => mode === "none" || !clientMounted);
|
|
1685
|
+
const delivered = React38__default.useMemo(() => {
|
|
1678
1686
|
if (transform !== "supabase" || !src || srcSet || !isStorageImageUrl(src)) return { src, srcSet, sizes };
|
|
1679
1687
|
if (variant?.width) {
|
|
1680
1688
|
const w = variant.width;
|
|
@@ -1692,10 +1700,10 @@ function SmoothImage({
|
|
|
1692
1700
|
sizes: variant?.sizes ?? sizes ?? "100vw"
|
|
1693
1701
|
};
|
|
1694
1702
|
}, [transform, src, srcSet, sizes, variant?.width, variant?.sizes, variant?.widths, variant?.quality]);
|
|
1695
|
-
|
|
1703
|
+
React38__default.useEffect(() => {
|
|
1696
1704
|
clientMounted = true;
|
|
1697
1705
|
}, []);
|
|
1698
|
-
|
|
1706
|
+
React38__default.useEffect(() => {
|
|
1699
1707
|
if (mode === "none") {
|
|
1700
1708
|
setLoaded(true);
|
|
1701
1709
|
return;
|
|
@@ -2637,8 +2645,8 @@ var BADGE_TONE_CLASSES = {
|
|
|
2637
2645
|
warning: "bg-amber-500 text-white"
|
|
2638
2646
|
};
|
|
2639
2647
|
function useExtensionBadges(product) {
|
|
2640
|
-
const [badges, setBadges] =
|
|
2641
|
-
|
|
2648
|
+
const [badges, setBadges] = React38__default.useState([]);
|
|
2649
|
+
React38__default.useEffect(() => {
|
|
2642
2650
|
let cancelled = false;
|
|
2643
2651
|
getProductCardBadges(product).then((next) => {
|
|
2644
2652
|
if (!cancelled && next.length > 0) setBadges(next);
|
|
@@ -3778,7 +3786,7 @@ function scalarToString(value) {
|
|
|
3778
3786
|
}
|
|
3779
3787
|
function ProductSpecs({ product }) {
|
|
3780
3788
|
const config = useStorefrontConfig();
|
|
3781
|
-
const extraExcluded =
|
|
3789
|
+
const extraExcluded = React38__default.useMemo(
|
|
3782
3790
|
() => new Set(config.productSpecs?.exclude ?? []),
|
|
3783
3791
|
[config.productSpecs?.exclude]
|
|
3784
3792
|
);
|
|
@@ -5503,7 +5511,7 @@ function CollectionHero({
|
|
|
5503
5511
|
{
|
|
5504
5512
|
className: `absolute inset-0 flex flex-col justify-center p-6 text-white sm:p-12 ${OVERLAY_CLASS[overlay]} ${centered ? "items-center text-center" : "items-start text-left"}`,
|
|
5505
5513
|
children: /* @__PURE__ */ jsxs(Reveal, { className: centered ? "max-w-3xl" : "max-w-2xl", children: [
|
|
5506
|
-
logos && logos.length > 0 && /* @__PURE__ */ jsx("div", { className: `mb-6 flex items-center gap-5 ${centered ? "justify-center" : ""}`, children: logos.map((logo, i) => /* @__PURE__ */ jsxs(
|
|
5514
|
+
logos && logos.length > 0 && /* @__PURE__ */ jsx("div", { className: `mb-6 flex items-center gap-5 ${centered ? "justify-center" : ""}`, children: logos.map((logo, i) => /* @__PURE__ */ jsxs(React38__default.Fragment, { children: [
|
|
5507
5515
|
i > 0 && /* @__PURE__ */ jsx("span", { className: "text-2xl font-light opacity-60", "aria-hidden": true, children: "\xD7" }),
|
|
5508
5516
|
/* @__PURE__ */ jsx("img", { src: logo.src, alt: logo.alt, className: "h-10 w-auto object-contain sm:h-14" })
|
|
5509
5517
|
] }, logo.src)) }),
|
|
@@ -6287,10 +6295,10 @@ function StorefrontConfigHost({
|
|
|
6287
6295
|
buyer,
|
|
6288
6296
|
children
|
|
6289
6297
|
}) {
|
|
6290
|
-
const [policy, setPolicy] =
|
|
6291
|
-
const [shipping, setShipping] =
|
|
6292
|
-
const [delivery, setDelivery] =
|
|
6293
|
-
|
|
6298
|
+
const [policy, setPolicy] = React38__default.useState(null);
|
|
6299
|
+
const [shipping, setShipping] = React38__default.useState(null);
|
|
6300
|
+
const [delivery, setDelivery] = React38__default.useState(null);
|
|
6301
|
+
React38__default.useEffect(() => {
|
|
6294
6302
|
let cancelled = false;
|
|
6295
6303
|
let provider;
|
|
6296
6304
|
try {
|
|
@@ -6327,7 +6335,7 @@ function StorefrontConfigHost({
|
|
|
6327
6335
|
cancelled = true;
|
|
6328
6336
|
};
|
|
6329
6337
|
}, [config]);
|
|
6330
|
-
const resolved =
|
|
6338
|
+
const resolved = React38__default.useMemo(
|
|
6331
6339
|
() => applyBuyer(applyDeliveryPolicy(applyShippingSettings(applyStoreSettings(config, policy), shipping), delivery), buyer),
|
|
6332
6340
|
[config, policy, shipping, delivery, buyer?.language, buyer?.country]
|
|
6333
6341
|
);
|
|
@@ -6339,7 +6347,7 @@ function MarketScope({ children }) {
|
|
|
6339
6347
|
const markets = useMarketStore((s2) => s2.markets);
|
|
6340
6348
|
const market = markets.length ? marketForCountry(markets, country) : null;
|
|
6341
6349
|
const prices = useMarketStore((s2) => market ? s2.prices[market.code] : void 0);
|
|
6342
|
-
|
|
6350
|
+
React38__default.useEffect(() => {
|
|
6343
6351
|
useMarketStore.getState().setActive(market);
|
|
6344
6352
|
if (!market || market.isDefault || prices) return;
|
|
6345
6353
|
let provider;
|
|
@@ -6351,11 +6359,11 @@ function MarketScope({ children }) {
|
|
|
6351
6359
|
void provider.getMarketPrices?.(market.code).then((list) => useMarketStore.getState().setPrices(market.code, list)).catch(() => {
|
|
6352
6360
|
});
|
|
6353
6361
|
}, [market?.code, prices]);
|
|
6354
|
-
|
|
6362
|
+
React38__default.useEffect(() => {
|
|
6355
6363
|
if (!market || !market.isDefault && !prices) return;
|
|
6356
6364
|
useCartStore.getState().repriceForMarket();
|
|
6357
6365
|
}, [market?.code, prices]);
|
|
6358
|
-
const value =
|
|
6366
|
+
const value = React38__default.useMemo(() => {
|
|
6359
6367
|
if (!market) return base;
|
|
6360
6368
|
return {
|
|
6361
6369
|
...base,
|
|
@@ -6461,6 +6469,7 @@ function googleFontsHref(theme) {
|
|
|
6461
6469
|
(f) => Boolean(f)
|
|
6462
6470
|
);
|
|
6463
6471
|
const unique = [...new Set(families)];
|
|
6472
|
+
if (!unique.length) return null;
|
|
6464
6473
|
const params = unique.map((f) => `family=${encodeURIComponent(f).replace(/%20/g, "+")}:wght@300;400;500;600;700`).join("&");
|
|
6465
6474
|
return `https://fonts.googleapis.com/css2?${params}&display=swap`;
|
|
6466
6475
|
}
|
|
@@ -6485,7 +6494,7 @@ function StorefrontThemeStyle({
|
|
|
6485
6494
|
document.getElementById(linkId)?.remove();
|
|
6486
6495
|
};
|
|
6487
6496
|
}, [fontsHref, linkId, selector]);
|
|
6488
|
-
return
|
|
6497
|
+
return React38__default.createElement(
|
|
6489
6498
|
"style",
|
|
6490
6499
|
{ "data-sf-theme": theme.name },
|
|
6491
6500
|
themeToCss(theme, { selector })
|
|
@@ -6584,7 +6593,7 @@ function SearchOverlay({ onClose }) {
|
|
|
6584
6593
|
"\u201D."
|
|
6585
6594
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6586
6595
|
/* @__PURE__ */ jsx("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-4", children: suggestions.map(
|
|
6587
|
-
(product) => searchConfig.renderSuggestion ? /* @__PURE__ */ jsx(
|
|
6596
|
+
(product) => searchConfig.renderSuggestion ? /* @__PURE__ */ jsx(React38__default.Fragment, { children: searchConfig.renderSuggestion(product) }, product.id) : /* @__PURE__ */ jsx(SuggestionCard, { product, onNavigate: onClose }, product.id)
|
|
6588
6597
|
) }),
|
|
6589
6598
|
/* @__PURE__ */ jsx(
|
|
6590
6599
|
"button",
|
|
@@ -6791,11 +6800,11 @@ function HeaderActions({ onMenuClick }) {
|
|
|
6791
6800
|
const openDrawer = useCartStore((s2) => s2.openDrawer);
|
|
6792
6801
|
const session = useSessionStore();
|
|
6793
6802
|
const [accountOpen, setAccountOpen] = useState(false);
|
|
6794
|
-
const accountRef =
|
|
6803
|
+
const accountRef = React38__default.useRef(null);
|
|
6795
6804
|
const pop = usePopOnChange(count);
|
|
6796
6805
|
const firstName = session.name?.split(/\s+/)[0];
|
|
6797
6806
|
const initial2 = (firstName ?? session.email ?? "C").slice(0, 1).toUpperCase();
|
|
6798
|
-
|
|
6807
|
+
React38__default.useEffect(() => {
|
|
6799
6808
|
if (!accountOpen) return;
|
|
6800
6809
|
const onPointerDown = (event) => {
|
|
6801
6810
|
if (!accountRef.current?.contains(event.target)) setAccountOpen(false);
|
|
@@ -6962,7 +6971,7 @@ function MobileMenuDrawer({ open, onClose }) {
|
|
|
6962
6971
|
navigateTo(config.catalogPath);
|
|
6963
6972
|
onClose();
|
|
6964
6973
|
};
|
|
6965
|
-
|
|
6974
|
+
React38__default.useEffect(() => {
|
|
6966
6975
|
if (!open) return;
|
|
6967
6976
|
const onKey = (e) => {
|
|
6968
6977
|
if (e.key === "Escape") onClose();
|
|
@@ -7936,8 +7945,8 @@ function AddressForm({ country, language, value, onChange, onPostalCode, lookup,
|
|
|
7936
7945
|
postalHint()
|
|
7937
7946
|
] }, "postalCode");
|
|
7938
7947
|
}
|
|
7939
|
-
if (row.length === 1) return /* @__PURE__ */ jsx(
|
|
7940
|
-
return /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-3", children: cells.map((key) => /* @__PURE__ */ jsx(
|
|
7948
|
+
if (row.length === 1) return /* @__PURE__ */ jsx(React38__default.Fragment, { children: input(specs.get(cells[0])) }, cells[0]);
|
|
7949
|
+
return /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-3", children: cells.map((key) => /* @__PURE__ */ jsx(React38__default.Fragment, { children: input(specs.get(key)) }, key)) }, cells.join("-"));
|
|
7941
7950
|
}) });
|
|
7942
7951
|
}
|
|
7943
7952
|
function flag(iso2) {
|
|
@@ -8293,13 +8302,13 @@ function CardBrick({ publicKey, amount, email, onSubmit, onError }) {
|
|
|
8293
8302
|
var POLL_MS = 3e3;
|
|
8294
8303
|
var RESUME_KEY = "fz.checkout.resume";
|
|
8295
8304
|
function useExpiry(expiresAt) {
|
|
8296
|
-
const target =
|
|
8305
|
+
const target = React38__default.useMemo(() => {
|
|
8297
8306
|
if (!expiresAt) return null;
|
|
8298
8307
|
const t = new Date(expiresAt).getTime();
|
|
8299
8308
|
return Number.isFinite(t) ? t : null;
|
|
8300
8309
|
}, [expiresAt]);
|
|
8301
|
-
const [now, setNow] =
|
|
8302
|
-
|
|
8310
|
+
const [now, setNow] = React38__default.useState(() => Date.now());
|
|
8311
|
+
React38__default.useEffect(() => {
|
|
8303
8312
|
if (target === null) return;
|
|
8304
8313
|
const id = setInterval(() => setNow(Date.now()), 1e3);
|
|
8305
8314
|
return () => clearInterval(id);
|
|
@@ -8995,7 +9004,7 @@ function CheckoutPage() {
|
|
|
8995
9004
|
district: "",
|
|
8996
9005
|
state: ""
|
|
8997
9006
|
});
|
|
8998
|
-
|
|
9007
|
+
React38__default.useEffect(() => {
|
|
8999
9008
|
if (!known.ready) return;
|
|
9000
9009
|
setForm((current) => ({
|
|
9001
9010
|
...current,
|
|
@@ -9011,7 +9020,7 @@ function CheckoutPage() {
|
|
|
9011
9020
|
}));
|
|
9012
9021
|
}, [known.ready, known.phone, known.document, known.address]);
|
|
9013
9022
|
const [step, setStep] = useState(resume ? 3 : 1);
|
|
9014
|
-
const reportedStart =
|
|
9023
|
+
const reportedStart = React38__default.useRef(false);
|
|
9015
9024
|
useEffect(() => {
|
|
9016
9025
|
if (reportedStart.current) return;
|
|
9017
9026
|
reportedStart.current = true;
|
|
@@ -9024,7 +9033,7 @@ function CheckoutPage() {
|
|
|
9024
9033
|
});
|
|
9025
9034
|
}
|
|
9026
9035
|
}, []);
|
|
9027
|
-
const reportedStep =
|
|
9036
|
+
const reportedStep = React38__default.useRef(null);
|
|
9028
9037
|
useEffect(() => {
|
|
9029
9038
|
if (reportedStep.current === step) return;
|
|
9030
9039
|
reportedStep.current = step;
|
|
@@ -9033,7 +9042,7 @@ function CheckoutPage() {
|
|
|
9033
9042
|
}, [step]);
|
|
9034
9043
|
const [contactKnown, setContactKnown] = useState(false);
|
|
9035
9044
|
const [editingContact, setEditingContact] = useState(false);
|
|
9036
|
-
const skippedContact =
|
|
9045
|
+
const skippedContact = React38__default.useRef(false);
|
|
9037
9046
|
const fulfillmentType = useDeliveryStore((s2) => s2.fulfillmentType);
|
|
9038
9047
|
const scheduledFor = useDeliveryStore((s2) => s2.scheduledFor);
|
|
9039
9048
|
const deliveryReference = useDeliveryStore((s2) => {
|
|
@@ -9062,7 +9071,7 @@ function CheckoutPage() {
|
|
|
9062
9071
|
const [applyingDiscount, setApplyingDiscount] = useState(false);
|
|
9063
9072
|
const [showSignin, setShowSignin] = useState(false);
|
|
9064
9073
|
const [placing, setPlacing] = useState(false);
|
|
9065
|
-
const leaving =
|
|
9074
|
+
const leaving = React38__default.useRef(false);
|
|
9066
9075
|
const [zipLookup, setZipLookup] = useState("idle");
|
|
9067
9076
|
const subtotal = selectSubtotal(cart);
|
|
9068
9077
|
const discountTotal = selectDiscountTotal(cart);
|
|
@@ -9070,7 +9079,7 @@ function CheckoutPage() {
|
|
|
9070
9079
|
const shipping = isPickup ? 0 : shippingRaw;
|
|
9071
9080
|
const total = selectTotal(cart, config) - (isPickup ? shippingRaw : 0);
|
|
9072
9081
|
const checkoutSlotContext = { subtotal, total };
|
|
9073
|
-
const checkoutSessionInput =
|
|
9082
|
+
const checkoutSessionInput = React38__default.useMemo(() => ({
|
|
9074
9083
|
items: cart.lines.map((line) => ({
|
|
9075
9084
|
productId: line.productId,
|
|
9076
9085
|
variantId: line.variantId ?? null,
|
|
@@ -9247,7 +9256,7 @@ function CheckoutPage() {
|
|
|
9247
9256
|
cancelled = true;
|
|
9248
9257
|
};
|
|
9249
9258
|
}, [session.customerId]);
|
|
9250
|
-
const shownCountry =
|
|
9259
|
+
const shownCountry = React38__default.useRef(country);
|
|
9251
9260
|
useEffect(() => {
|
|
9252
9261
|
if (shownCountry.current === country) return;
|
|
9253
9262
|
shownCountry.current = country;
|
|
@@ -10029,6 +10038,7 @@ function etaParts(minutes) {
|
|
|
10029
10038
|
}
|
|
10030
10039
|
return { approx: false, text: `${Math.ceil(m / 60)} h` };
|
|
10031
10040
|
}
|
|
10041
|
+
var COVER_PRIORITY = React38__default.version.startsWith("18.") ? { fetchpriority: "high" } : { fetchPriority: "high" };
|
|
10032
10042
|
function StoreCover({ onShowHours, onOpenAccount }) {
|
|
10033
10043
|
const sessionName = useSessionStore((s2) => s2.name || s2.email);
|
|
10034
10044
|
const config = useStorefrontConfig();
|
|
@@ -10040,6 +10050,8 @@ function StoreCover({ onShowHours, onOpenAccount }) {
|
|
|
10040
10050
|
const compact = size === "compact";
|
|
10041
10051
|
const modes = config.delivery?.fulfillmentModes ?? ["delivery"];
|
|
10042
10052
|
const type = useDeliveryStore((s2) => s2.fulfillmentType);
|
|
10053
|
+
const etaInfo = type !== "pickup" && config.delivery?.etaMinutes ? etaParts(config.delivery.etaMinutes) : null;
|
|
10054
|
+
const etaText = etaInfo ? t(etaInfo.approx ? "delivery.eta" : "delivery.etaUpTo", { duration: etaInfo.text }) : "";
|
|
10043
10055
|
const setFulfillmentType = useDeliveryStore((s2) => s2.setFulfillmentType);
|
|
10044
10056
|
const refreshService = useServiceStore((s2) => s2.refresh);
|
|
10045
10057
|
const service = useServiceStore();
|
|
@@ -10054,7 +10066,7 @@ function StoreCover({ onShowHours, onOpenAccount }) {
|
|
|
10054
10066
|
{
|
|
10055
10067
|
"data-testid": TID.storeCover,
|
|
10056
10068
|
"data-cover-size": size,
|
|
10057
|
-
className:
|
|
10069
|
+
className: "relative isolate bg-neutral-900 text-white",
|
|
10058
10070
|
children: [
|
|
10059
10071
|
cover && /* @__PURE__ */ jsx(
|
|
10060
10072
|
"img",
|
|
@@ -10062,6 +10074,7 @@ function StoreCover({ onShowHours, onOpenAccount }) {
|
|
|
10062
10074
|
src: cover,
|
|
10063
10075
|
alt: "",
|
|
10064
10076
|
"aria-hidden": true,
|
|
10077
|
+
...COVER_PRIORITY,
|
|
10065
10078
|
className: "absolute inset-0 -z-10 h-full w-full object-cover"
|
|
10066
10079
|
}
|
|
10067
10080
|
),
|
|
@@ -10087,9 +10100,9 @@ function StoreCover({ onShowHours, onOpenAccount }) {
|
|
|
10087
10100
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 [text-shadow:0_1px_3px_rgb(0_0_0_/_0.7)]", children: [
|
|
10088
10101
|
/* @__PURE__ */ jsx("div", { className: `grid ${compact ? "h-11 w-11" : "h-14 w-14"} shrink-0 place-items-center overflow-hidden rounded-xl bg-white/10 ring-1 ring-white/20`, children: logo ? /* @__PURE__ */ jsx("img", { src: logo, alt: "", "aria-hidden": true, className: "h-full w-full object-cover" }) : /* @__PURE__ */ jsx("span", { className: "text-xl font-bold", children: config.name.slice(0, 1) }) }),
|
|
10089
10102
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
10090
|
-
/* @__PURE__ */ jsx("h1", { className:
|
|
10091
|
-
|
|
10092
|
-
config.delivery?.paused ? /* @__PURE__ */ jsxs("p", { "data-testid": "store-delivery-paused", className: "mt-0.5 inline-flex items-center gap-1.5 truncate text-sm font-semibold text-amber-300", children: [
|
|
10103
|
+
/* @__PURE__ */ jsx("h1", { className: `truncate ${compact ? "text-lg" : "text-xl"} font-bold leading-tight`, children: config.name }),
|
|
10104
|
+
compact && !config.delivery?.paused ? locality || etaText ? /* @__PURE__ */ jsx("p", { "data-testid": etaText ? "store-eta" : void 0, className: "truncate text-sm text-white/80", children: [locality, etaText].filter(Boolean).join(" \xB7 ") }) : null : locality ? /* @__PURE__ */ jsx("p", { className: "truncate text-sm text-white/70", children: locality }) : null,
|
|
10105
|
+
compact && !config.delivery?.paused ? null : config.delivery?.paused ? /* @__PURE__ */ jsxs("p", { "data-testid": "store-delivery-paused", className: "mt-0.5 inline-flex items-center gap-1.5 truncate text-sm font-semibold text-amber-300", children: [
|
|
10093
10106
|
/* @__PURE__ */ jsx("span", { className: "h-2 w-2 shrink-0 rounded-full bg-amber-400", "aria-hidden": true }),
|
|
10094
10107
|
t("delivery.paused")
|
|
10095
10108
|
] }) : (() => {
|
|
@@ -10170,8 +10183,8 @@ function AddressStrip({
|
|
|
10170
10183
|
const money = (v) => formatMoney(v, config.currency, config.locale);
|
|
10171
10184
|
const subtotal = selectSubtotal(useCartStore());
|
|
10172
10185
|
const resolve = useDeliveryStore((s2) => s2.resolve);
|
|
10173
|
-
const quotedOnce =
|
|
10174
|
-
|
|
10186
|
+
const quotedOnce = React38__default.useRef(false);
|
|
10187
|
+
React38__default.useEffect(() => {
|
|
10175
10188
|
if (quotedOnce.current || isPickup) return;
|
|
10176
10189
|
if (delivery.status !== "idle" || delivery.options.length > 0 || !delivery.postalCode) return;
|
|
10177
10190
|
quotedOnce.current = true;
|
|
@@ -10233,17 +10246,17 @@ function MenuToolbar({
|
|
|
10233
10246
|
onQuery,
|
|
10234
10247
|
autoFocusSearch
|
|
10235
10248
|
}) {
|
|
10236
|
-
const inputRef =
|
|
10237
|
-
const [active, setActive] =
|
|
10238
|
-
|
|
10249
|
+
const inputRef = React38__default.useRef(null);
|
|
10250
|
+
const [active, setActive] = React38__default.useState(null);
|
|
10251
|
+
React38__default.useEffect(() => {
|
|
10239
10252
|
setActive(
|
|
10240
10253
|
(current) => current && sections.some((s2) => s2.slug === current) ? current : sections[0]?.slug ?? null
|
|
10241
10254
|
);
|
|
10242
10255
|
}, [sections]);
|
|
10243
|
-
|
|
10256
|
+
React38__default.useEffect(() => {
|
|
10244
10257
|
if (autoFocusSearch) inputRef.current?.focus();
|
|
10245
10258
|
}, [autoFocusSearch]);
|
|
10246
|
-
|
|
10259
|
+
React38__default.useEffect(() => {
|
|
10247
10260
|
if (typeof IntersectionObserver === "undefined") return;
|
|
10248
10261
|
const seen = /* @__PURE__ */ new Map();
|
|
10249
10262
|
const observer = new IntersectionObserver(
|
|
@@ -10430,10 +10443,10 @@ function ItemSheet({
|
|
|
10430
10443
|
}) {
|
|
10431
10444
|
const config = useStorefrontConfig();
|
|
10432
10445
|
const money = (v) => formatMoney(v, config.currency, config.locale);
|
|
10433
|
-
const groups =
|
|
10434
|
-
const [options, setOptions] =
|
|
10435
|
-
const [notes, setNotes] =
|
|
10436
|
-
const [quantity, setQuantity] =
|
|
10446
|
+
const groups = React38__default.useMemo(() => getProductOptionGroups(product), [product]);
|
|
10447
|
+
const [options, setOptions] = React38__default.useState({});
|
|
10448
|
+
const [notes, setNotes] = React38__default.useState("");
|
|
10449
|
+
const [quantity, setQuantity] = React38__default.useState(1);
|
|
10437
10450
|
const image = product.images?.find((i) => i.isPrimary) ?? product.images?.[0];
|
|
10438
10451
|
const stock = product.inventoryCount;
|
|
10439
10452
|
const missing = groups.filter((g) => !options[g.label]);
|
|
@@ -10627,8 +10640,8 @@ function ScheduleSheet({ onClose }) {
|
|
|
10627
10640
|
const scheduledFor = useDeliveryStore((s2) => s2.scheduledFor);
|
|
10628
10641
|
const setScheduledFor = useDeliveryStore((s2) => s2.setScheduledFor);
|
|
10629
10642
|
const timezone = useServiceStore((s2) => s2.service?.timezone) ?? "America/Sao_Paulo";
|
|
10630
|
-
const [slots, setSlots] =
|
|
10631
|
-
|
|
10643
|
+
const [slots, setSlots] = React38__default.useState(null);
|
|
10644
|
+
React38__default.useEffect(() => {
|
|
10632
10645
|
let alive = true;
|
|
10633
10646
|
void (async () => {
|
|
10634
10647
|
const rows = await getShopProvider()?.listScheduleSlots?.(fulfillmentType) ?? [];
|
|
@@ -10638,7 +10651,7 @@ function ScheduleSheet({ onClose }) {
|
|
|
10638
10651
|
alive = false;
|
|
10639
10652
|
};
|
|
10640
10653
|
}, [fulfillmentType]);
|
|
10641
|
-
const days =
|
|
10654
|
+
const days = React38__default.useMemo(() => {
|
|
10642
10655
|
const fmtDay = new Intl.DateTimeFormat("pt-BR", {
|
|
10643
10656
|
weekday: "long",
|
|
10644
10657
|
day: "2-digit",
|
|
@@ -10724,8 +10737,8 @@ function hhmm(time) {
|
|
|
10724
10737
|
}
|
|
10725
10738
|
function ServiceHoursModal({ onClose }) {
|
|
10726
10739
|
const fulfillmentType = useServiceStore((s2) => s2.fulfillmentType);
|
|
10727
|
-
const [hours, setHours] =
|
|
10728
|
-
|
|
10740
|
+
const [hours, setHours] = React38__default.useState(null);
|
|
10741
|
+
React38__default.useEffect(() => {
|
|
10729
10742
|
let alive = true;
|
|
10730
10743
|
void (async () => {
|
|
10731
10744
|
const rows = await getShopProvider()?.listServiceHours?.(fulfillmentType) ?? [];
|
|
@@ -10735,7 +10748,7 @@ function ServiceHoursModal({ onClose }) {
|
|
|
10735
10748
|
alive = false;
|
|
10736
10749
|
};
|
|
10737
10750
|
}, [fulfillmentType]);
|
|
10738
|
-
const byDay =
|
|
10751
|
+
const byDay = React38__default.useMemo(() => {
|
|
10739
10752
|
const map = /* @__PURE__ */ new Map();
|
|
10740
10753
|
for (const h of hours ?? []) {
|
|
10741
10754
|
const list = map.get(h.weekday) ?? [];
|
|
@@ -10820,7 +10833,7 @@ function AddressSheet({ onClose, onSignIn }) {
|
|
|
10820
10833
|
const unsavedCurrent = current && !saved.some((a) => a.id === selectedId) ? current : null;
|
|
10821
10834
|
const fromAccount = accountBook.filter((a) => !saved.some((b) => normalizePostalCode(b.postalCode) === normalizePostalCode(a.postalCode) && b.number.trim().toLowerCase() === (a.number ?? "").trim().toLowerCase()));
|
|
10822
10835
|
const nothingToList = saved.length === 0 && !unsavedCurrent && fromAccount.length === 0 && !customerId;
|
|
10823
|
-
const [editing, setEditing] =
|
|
10836
|
+
const [editing, setEditing] = React38__default.useState(
|
|
10824
10837
|
nothingToList && !onSignIn ? {} : null
|
|
10825
10838
|
);
|
|
10826
10839
|
function pickAccountAddress(a) {
|
|
@@ -10839,13 +10852,13 @@ function AddressSheet({ onClose, onSignIn }) {
|
|
|
10839
10852
|
void selectAddress(id, subtotal);
|
|
10840
10853
|
onClose();
|
|
10841
10854
|
}
|
|
10842
|
-
const closeRef =
|
|
10855
|
+
const closeRef = React38__default.useRef(() => {
|
|
10843
10856
|
});
|
|
10844
10857
|
closeRef.current = () => {
|
|
10845
10858
|
if (editing && !nothingToList) setEditing(null);
|
|
10846
10859
|
else onClose();
|
|
10847
10860
|
};
|
|
10848
|
-
|
|
10861
|
+
React38__default.useEffect(() => {
|
|
10849
10862
|
const onKey = (e) => {
|
|
10850
10863
|
if (e.key === "Escape") closeRef.current();
|
|
10851
10864
|
};
|
|
@@ -11026,8 +11039,8 @@ function AddressLines({ address }) {
|
|
|
11026
11039
|
] });
|
|
11027
11040
|
}
|
|
11028
11041
|
function useAccountAddresses(customerId) {
|
|
11029
|
-
const [rows, setRows] =
|
|
11030
|
-
|
|
11042
|
+
const [rows, setRows] = React38__default.useState([]);
|
|
11043
|
+
React38__default.useEffect(() => {
|
|
11031
11044
|
if (!customerId) {
|
|
11032
11045
|
setRows([]);
|
|
11033
11046
|
return;
|
|
@@ -11055,24 +11068,24 @@ function AddressForm2({ onDone, initial: initial2, replaces }) {
|
|
|
11055
11068
|
const storeError = useDeliveryStore((s2) => s2.error);
|
|
11056
11069
|
const refusedZone = useDeliveryStore((s2) => s2.refusedZone);
|
|
11057
11070
|
const subtotal = selectSubtotal(useCartStore());
|
|
11058
|
-
const [cep, setCep] =
|
|
11059
|
-
const [number, setNumber] =
|
|
11060
|
-
const [complement, setComplement] =
|
|
11061
|
-
const [reference, setReference] =
|
|
11062
|
-
const [label, setLabel] =
|
|
11063
|
-
const [touched, setTouched] =
|
|
11064
|
-
const numberRef =
|
|
11071
|
+
const [cep, setCep] = React38__default.useState(initial2?.postalCode ? formatPostalCode(initial2.postalCode) : "");
|
|
11072
|
+
const [number, setNumber] = React38__default.useState(initial2?.number ?? "");
|
|
11073
|
+
const [complement, setComplement] = React38__default.useState(initial2?.complement ?? "");
|
|
11074
|
+
const [reference, setReference] = React38__default.useState(initial2?.reference ?? "");
|
|
11075
|
+
const [label, setLabel] = React38__default.useState(initial2?.label ?? "");
|
|
11076
|
+
const [touched, setTouched] = React38__default.useState(false);
|
|
11077
|
+
const numberRef = React38__default.useRef(null);
|
|
11065
11078
|
const digits = normalizePostalCode(cep);
|
|
11066
11079
|
const found = Boolean(looked) && normalizePostalCode(looked.postalCode) === digits;
|
|
11067
|
-
|
|
11080
|
+
React38__default.useEffect(() => {
|
|
11068
11081
|
if (found) numberRef.current?.focus();
|
|
11069
11082
|
}, [found]);
|
|
11070
11083
|
async function lookUp() {
|
|
11071
11084
|
if (digits.length !== 8) return;
|
|
11072
11085
|
await resolve(digits, subtotal);
|
|
11073
11086
|
}
|
|
11074
|
-
const prefilled =
|
|
11075
|
-
|
|
11087
|
+
const prefilled = React38__default.useRef(false);
|
|
11088
|
+
React38__default.useEffect(() => {
|
|
11076
11089
|
if (prefilled.current || !initial2?.postalCode) return;
|
|
11077
11090
|
prefilled.current = true;
|
|
11078
11091
|
if (!found) void lookUp();
|
|
@@ -11288,7 +11301,7 @@ function AccountDrawer({ onClose, onSignIn, onAddresses, onShowHours }) {
|
|
|
11288
11301
|
const session = useSessionStore();
|
|
11289
11302
|
const signedIn = Boolean(session.email);
|
|
11290
11303
|
const name = session.name || session.email?.split("@")[0] || "";
|
|
11291
|
-
|
|
11304
|
+
React38__default.useEffect(() => {
|
|
11292
11305
|
const onKey = (event) => {
|
|
11293
11306
|
if (event.key === "Escape") onClose();
|
|
11294
11307
|
};
|
|
@@ -11372,8 +11385,8 @@ function AccountDrawer({ onClose, onSignIn, onAddresses, onShowHours }) {
|
|
|
11372
11385
|
function MenuPage() {
|
|
11373
11386
|
const config = useStorefrontConfig();
|
|
11374
11387
|
const addItem = useCartStore((s2) => s2.addItem);
|
|
11375
|
-
const [openProduct, setOpenProduct] =
|
|
11376
|
-
|
|
11388
|
+
const [openProduct, setOpenProduct] = React38__default.useState(null);
|
|
11389
|
+
React38__default.useEffect(() => {
|
|
11377
11390
|
if (!openProduct) return;
|
|
11378
11391
|
trackStorefront("product_viewed", {
|
|
11379
11392
|
product_id: openProduct.id,
|
|
@@ -11384,18 +11397,18 @@ function MenuPage() {
|
|
|
11384
11397
|
surface: "menu_sheet"
|
|
11385
11398
|
});
|
|
11386
11399
|
}, [openProduct?.id]);
|
|
11387
|
-
const [showHours, setShowHours] =
|
|
11388
|
-
const [showClosed, setShowClosed] =
|
|
11389
|
-
const [showAddress, setShowAddress] =
|
|
11390
|
-
const [showAccount, setShowAccount] =
|
|
11391
|
-
const [showSignIn, setShowSignIn] =
|
|
11392
|
-
const [showSchedule, setShowSchedule] =
|
|
11393
|
-
const [query, setQuery] =
|
|
11400
|
+
const [showHours, setShowHours] = React38__default.useState(false);
|
|
11401
|
+
const [showClosed, setShowClosed] = React38__default.useState(false);
|
|
11402
|
+
const [showAddress, setShowAddress] = React38__default.useState(false);
|
|
11403
|
+
const [showAccount, setShowAccount] = React38__default.useState(false);
|
|
11404
|
+
const [showSignIn, setShowSignIn] = React38__default.useState(false);
|
|
11405
|
+
const [showSchedule, setShowSchedule] = React38__default.useState(false);
|
|
11406
|
+
const [query, setQuery] = React38__default.useState("");
|
|
11394
11407
|
const serviceState = useServiceStore();
|
|
11395
11408
|
const refreshService = useServiceStore((s2) => s2.refresh);
|
|
11396
11409
|
const paused = Boolean(config.delivery?.paused);
|
|
11397
11410
|
const isOpen = selectIsOpen(serviceState) && !paused;
|
|
11398
|
-
|
|
11411
|
+
React38__default.useEffect(() => {
|
|
11399
11412
|
void refreshService();
|
|
11400
11413
|
}, [refreshService]);
|
|
11401
11414
|
const cart = useCartStore();
|
|
@@ -11417,7 +11430,7 @@ function MenuPage() {
|
|
|
11417
11430
|
const loading = products.status === "loading" || products.status === "idle";
|
|
11418
11431
|
const items = products.data ?? [];
|
|
11419
11432
|
const cats = categories.data ?? [];
|
|
11420
|
-
const allSections =
|
|
11433
|
+
const allSections = React38__default.useMemo(() => {
|
|
11421
11434
|
const byCategory = /* @__PURE__ */ new Map();
|
|
11422
11435
|
const loose = [];
|
|
11423
11436
|
for (const p of items) {
|
|
@@ -11445,7 +11458,7 @@ function MenuPage() {
|
|
|
11445
11458
|
}
|
|
11446
11459
|
return ordered;
|
|
11447
11460
|
}, [items, cats]);
|
|
11448
|
-
const highlights =
|
|
11461
|
+
const highlights = React38__default.useMemo(
|
|
11449
11462
|
() => pickHighlights(items, {
|
|
11450
11463
|
listingFeaturedIds: featured.data?.listing,
|
|
11451
11464
|
menuFeaturedIds: featured.data?.menu,
|
|
@@ -11454,7 +11467,7 @@ function MenuPage() {
|
|
|
11454
11467
|
[items, featured.data, config.delivery?.highlightSlugs]
|
|
11455
11468
|
);
|
|
11456
11469
|
const normalized = query.trim().toLowerCase();
|
|
11457
|
-
const sections =
|
|
11470
|
+
const sections = React38__default.useMemo(() => {
|
|
11458
11471
|
if (!normalized) return allSections;
|
|
11459
11472
|
return allSections.map((section) => ({
|
|
11460
11473
|
...section,
|
|
@@ -11627,7 +11640,7 @@ function MenuPage() {
|
|
|
11627
11640
|
);
|
|
11628
11641
|
}
|
|
11629
11642
|
function BottomBarSpace() {
|
|
11630
|
-
|
|
11643
|
+
React38__default.useEffect(() => {
|
|
11631
11644
|
const root = document.documentElement;
|
|
11632
11645
|
root.style.setProperty("--fayz-bottom-bar", "4.5rem");
|
|
11633
11646
|
return () => {
|
|
@@ -11918,7 +11931,7 @@ function OrderConfirmationPage({ orderId }) {
|
|
|
11918
11931
|
const [loading, setLoading] = useState(true);
|
|
11919
11932
|
const money = (v) => formatMoney(v, config.currency, config.locale);
|
|
11920
11933
|
useStorefrontHead({ title: order ? `Pedido #${order.orderNumber} \u2014 ${config.name}` : config.name });
|
|
11921
|
-
const reload =
|
|
11934
|
+
const reload = React38__default.useCallback(() => {
|
|
11922
11935
|
let cancelled = false;
|
|
11923
11936
|
getShopProvider().getOrder(orderId).then((o) => {
|
|
11924
11937
|
if (!cancelled) setOrder(o);
|
|
@@ -11947,7 +11960,7 @@ function OrderConfirmationPage({ orderId }) {
|
|
|
11947
11960
|
] }, column)) }),
|
|
11948
11961
|
/* @__PURE__ */ jsxs("div", { className: "mt-6", children: [
|
|
11949
11962
|
/* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-32" }),
|
|
11950
|
-
/* @__PURE__ */ jsx("div", { className: "mt-3 flex items-center gap-2", children: [0, 1, 2, 3].map((node) => /* @__PURE__ */ jsxs(
|
|
11963
|
+
/* @__PURE__ */ jsx("div", { className: "mt-3 flex items-center gap-2", children: [0, 1, 2, 3].map((node) => /* @__PURE__ */ jsxs(React38__default.Fragment, { children: [
|
|
11951
11964
|
/* @__PURE__ */ jsx(Skeleton, { className: "h-7 w-7 shrink-0 rounded-full" }),
|
|
11952
11965
|
node < 3 && /* @__PURE__ */ jsx(Skeleton, { className: "h-px flex-1" })
|
|
11953
11966
|
] }, node)) })
|
|
@@ -12234,7 +12247,7 @@ function OrdersPanel() {
|
|
|
12234
12247
|
/* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-24 rounded-full" })
|
|
12235
12248
|
] }),
|
|
12236
12249
|
/* @__PURE__ */ jsx(Skeleton, { className: "mt-2 h-3 w-20" }),
|
|
12237
|
-
/* @__PURE__ */ jsx("div", { className: "mt-4 flex items-center gap-2", children: [0, 1, 2, 3].map((node) => /* @__PURE__ */ jsxs(
|
|
12250
|
+
/* @__PURE__ */ jsx("div", { className: "mt-4 flex items-center gap-2", children: [0, 1, 2, 3].map((node) => /* @__PURE__ */ jsxs(React38__default.Fragment, { children: [
|
|
12238
12251
|
/* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-6 shrink-0 rounded-full" }),
|
|
12239
12252
|
node < 3 && /* @__PURE__ */ jsx(Skeleton, { className: "h-px flex-1" })
|
|
12240
12253
|
] }, node)) }),
|
|
@@ -12313,7 +12326,7 @@ function ProfilePanel() {
|
|
|
12313
12326
|
const [saving, setSaving] = useState(false);
|
|
12314
12327
|
const [saved, setSaved] = useState(false);
|
|
12315
12328
|
const [error, setError] = useState(null);
|
|
12316
|
-
|
|
12329
|
+
React38__default.useEffect(() => {
|
|
12317
12330
|
if (!supported) return;
|
|
12318
12331
|
let cancelled = false;
|
|
12319
12332
|
provider.getMyProfile().then((p) => {
|
|
@@ -12606,7 +12619,7 @@ function PolicyPage({ kind }) {
|
|
|
12606
12619
|
] }) })
|
|
12607
12620
|
] });
|
|
12608
12621
|
}
|
|
12609
|
-
var StorefrontErrorBoundary = class extends
|
|
12622
|
+
var StorefrontErrorBoundary = class extends React38__default.Component {
|
|
12610
12623
|
constructor() {
|
|
12611
12624
|
super(...arguments);
|
|
12612
12625
|
this.state = { error: null };
|
|
@@ -12896,5 +12909,5 @@ function createStorefront(options) {
|
|
|
12896
12909
|
}
|
|
12897
12910
|
|
|
12898
12911
|
export { AddressForm, AddressSheet, AddressStrip, BEFORE_PLACE_ORDER_VALVE, BUYER_COUNTRY_COOKIE, BenefitsRow, CART_LINE_ANNOTATION_POINT, CHECKOUT_FIELD_POINT, CartDrawer, CatalogPage, CategoryShowcase, CheckoutPage, ClosedStoreDialog, CollectionCta, CollectionHero, ContentPage, CountdownBand, CountrySelect, DeliverToPicker, EmailConfirmationRequiredError, EntityListBlock, ExperimentBlock, ExperimentProvider, ExperimentVariantBlock, FaqSection, FiltersPanel, FormBlock, HeroSection, ImageTiles, ItemSheet, ManifestoBlock, MediaCarousel, MenuItemRow, MenuPage, MenuToolbar, MotifStrip, MyPurchasesPage, NewsletterBand, ORDER_METADATA_POINT, OrderConfirmationPage, OrderTrackingTimeline, PAGE_DATA_SCRIPT_ID, PLACEHOLDER_ASPECTS, PRODUCT_CARD_BADGE_POINT, PaymentTerms, Price, ProductCard, ProductDetailPage, ProductEnquiryForm, ProductGallery, ProductGrid, ProductOptionSelector, ProductRail, ProductReviews, ProductSlider, ProductSpecs, ProductSpotlight, PromoBanner, QuantityInput, Reveal, STOREFRONT_SLOTS, ScheduleSheet, SealsBand, SearchOverlay, ServiceHoursModal, Slot, SmoothImage, StepsSection, StoreCover, StorefrontAnalytics, StorefrontConfigHost, StorefrontFooter, StorefrontHeader, StorefrontPage, StorefrontShell, StorefrontThemeStyle, StoryQuote, THEME_SCALE_FIELDS, THEME_SCALE_VAR_PREFIX, TID, Testimonials, TierCards, applyDeliveryPolicy, applyStoreSettings, bannerPlaceholder, buildEnquiryFromForm, collectOrderMetadata, createStorefront, createStorefrontApp, entityListBlockMeta, establishCustomerSession, formatMoney, formatProductOptionSelection, getCartLineAnnotations, getCheckoutFieldContributions, getCustomerAuthAdapter, getProductCardBadges, getProductOptionGroups, hydratedEntriesFor, identifyStorefrontBuyer, initStorefrontRuntime, isExperimentBinding, listSlots, marketForCountry, marketUnitPrice, matchesFacets, mergeCollectionFacet, nextMilestone, normalizeProductOptionSelection, onStorefrontEvent, orderGalleryImages, overrideComponent, overrideProps, pickProductCardImage, placeStorefrontOrder, prefersReducedMotion, productCardComponentContract, productOptionSelectionKey, productPlaceholder, readHydratedPageData, registerStorefrontBlocks, registerStorefrontEntities, registerStorefrontExtensionPoints, registerStorefrontLoaders, resetPageDiagnostics, resetProductOptionsDeprecationWarnings, resetStorefrontExtensionPoints, resolveAuthAdapter, resolveExperimental, resolveOverride, resolvePaymentTerms, resolveStorefrontProvider, resolveVariantForSelection, roundCents, runBeforePlaceOrderValve, sectionsToBlocks, selectCount, selectDiscountTotal, selectIsOpen, selectRequiresShipping, selectShipping, selectShowsHours, selectSubtotal, selectTotal, selectionPrice, serializePageData, signInByEmail, signOutCustomer, signUpCustomer, startStorefrontPostHog, storeBuyerId, storefrontComponentContracts, themeToCss, toFacetMap, trackStorefront, useBuyerCountry, useBuyerStore, useCartStore, useCatalogStore, useCategories, useDeliveryStore, useDiscountValidator, useEnquiry, useExperiment, useExperimentValue, useInView, useMarketProduct, useMarketStore, useMyOrders, usePopOnChange, useProduct, useProducts, useScrolled, useServiceStore, useSessionStore, useSlotContext, useStorefrontActions, useStorefrontHead, useStorefrontPage, useStorefrontPageOptional, useT, usedSlots, withFacet, withMarketPrice };
|
|
12899
|
-
//# sourceMappingURL=chunk-
|
|
12900
|
-
//# sourceMappingURL=chunk-
|
|
12912
|
+
//# sourceMappingURL=chunk-OV6DVQMB.js.map
|
|
12913
|
+
//# sourceMappingURL=chunk-OV6DVQMB.js.map
|