cloudcommerce 2.10.2 → 2.10.4
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/.vscode/settings.json +3 -3
- package/CHANGELOG.md +15 -0
- package/ecomplus-stores/barradoce/functions/many/package.json +3 -3
- package/ecomplus-stores/barradoce/functions/ssr/content/pages/products.json +1 -4
- package/ecomplus-stores/barradoce/functions/ssr/package.json +6 -6
- package/ecomplus-stores/barradoce/functions/ssr/{tailwind.config.cjs → tailwind.config.js} +3 -3
- package/ecomplus-stores/barradoce/functions/ssr/uno.config.js +4 -0
- package/ecomplus-stores/barradoce/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/barradoce/package.json +2 -2
- package/ecomplus-stores/barradoce/tailwind.config.js +8 -0
- package/package.json +4 -4
- package/packages/api/package.json +1 -1
- package/packages/apps/affiliate-program/package.json +2 -2
- package/packages/apps/correios/package.json +2 -2
- package/packages/apps/custom-payment/package.json +1 -1
- package/packages/apps/custom-shipping/package.json +1 -1
- package/packages/apps/datafrete/package.json +3 -3
- package/packages/apps/discounts/package.json +1 -1
- package/packages/apps/emails/package.json +3 -3
- package/packages/apps/fb-conversions/package.json +3 -3
- package/packages/apps/flash-courier/package.json +2 -2
- package/packages/apps/frenet/package.json +3 -3
- package/packages/apps/galaxpay/package.json +3 -3
- package/packages/apps/google-analytics/package.json +3 -3
- package/packages/apps/jadlog/package.json +1 -1
- package/packages/apps/loyalty-points/package.json +1 -1
- package/packages/apps/mandae/package.json +2 -2
- package/packages/apps/melhor-envio/package.json +3 -3
- package/packages/apps/mercadopago/package.json +3 -3
- package/packages/apps/pagarme/package.json +3 -3
- package/packages/apps/pagarme-v5/package.json +2 -2
- package/packages/apps/paghiper/package.json +3 -3
- package/packages/apps/pix/package.json +3 -3
- package/packages/apps/tiny-erp/package.json +3 -3
- package/packages/apps/webhooks/package.json +3 -3
- package/packages/cli/package.json +1 -1
- package/packages/config/package.json +1 -1
- package/packages/emails/package.json +1 -1
- package/packages/eslint/base.eslintrc.cjs +1 -0
- package/packages/eslint/package.json +4 -4
- package/packages/events/package.json +3 -3
- package/packages/feeds/package.json +2 -2
- package/packages/firebase/package.json +3 -3
- package/packages/i18n/package.json +1 -1
- package/packages/modules/package.json +3 -3
- package/packages/passport/package.json +3 -3
- package/packages/ssr/package.json +3 -3
- package/packages/storefront/config/{storefront.tailwind.cjs → storefront.tailwind.mjs} +19 -19
- package/packages/storefront/config/{storefront.unocss.cjs → storefront.unocss.mjs} +9 -9
- package/packages/storefront/dist/client/_astro/AccountPage.Cf0WE6GF.js +1 -0
- package/packages/storefront/dist/client/_astro/CartSidebar.DAvJKL2c.js +1 -0
- package/packages/storefront/dist/client/_astro/HeroSlider.DyjSOy4Q.js +1 -0
- package/packages/storefront/dist/client/_astro/PitchBar.CEGsee2q.js +1 -0
- package/packages/storefront/dist/client/_astro/Prices.9RhV7hCY.js +1 -0
- package/packages/storefront/dist/client/_astro/ProductDetails.BpZtnS8j.js +7 -0
- package/packages/storefront/dist/client/_astro/ProductShelf.C0TU_sRb.js +1 -0
- package/packages/storefront/dist/client/_astro/SearchModal.DWNSfxML.js +1 -0
- package/packages/storefront/dist/client/_astro/SearchShowcase.CUkbXIRk.js +1 -0
- package/packages/storefront/dist/client/_astro/ShippingCalculator.DZSCK4xv.js +1 -0
- package/packages/storefront/dist/client/_astro/ShopHeader.D7qqQxFD.js +7 -0
- package/packages/storefront/dist/client/_astro/{_plugin-vue_export-helper.3R8ooc_r.js → _plugin-vue_export-helper.6K9uDcVo.js} +1 -1
- package/packages/storefront/dist/client/_astro/_slug_.HhgCFKHv.css +1 -0
- package/packages/storefront/dist/client/_astro/client.D_V8TfA5.js +1 -0
- package/packages/storefront/dist/client/_astro/customer-session.Cctko5_9.js +7 -0
- package/packages/storefront/dist/client/_astro/{firebase-app.CBckq0Sj.js → firebase-app.CmI1zl7o.js} +1 -1
- package/packages/storefront/dist/client/_astro/{format-money.vLicYTv9.js → format-money.D19_eJVX.js} +1 -1
- package/packages/storefront/dist/client/_astro/{grid-title.CxNZApGL.js → grid-title.CZdq2sDS.js} +1 -1
- package/packages/storefront/dist/client/_astro/hoisted.BeKMioW4.js +1 -0
- package/packages/storefront/dist/client/_astro/hoisted.Bf1gCkSN.js +1 -0
- package/packages/storefront/dist/client/_astro/hoisted.CSjieYcR.js +8 -0
- package/packages/storefront/dist/client/_astro/{i18n.BE5r_SIU.js → i18n.DPcLqMFO.js} +1 -1
- package/packages/storefront/dist/client/_astro/{img.CB-F9VLo.js → img.Be85e5da.js} +1 -1
- package/packages/storefront/dist/client/_astro/{index-bea2a320.CHELEM8n.js → index-a8cf6c8f.k99a-gIB.js} +99 -99
- package/packages/storefront/dist/client/_astro/index.BCNoXz_Z.js +1 -0
- package/packages/storefront/dist/client/_astro/index.BgtOIB20.js +1 -0
- package/packages/storefront/dist/client/_astro/index.DlxZwqDP.js +1 -0
- package/packages/storefront/dist/client/_astro/modules-info.BswYf_-7.js +1 -0
- package/packages/storefront/dist/client/_astro/name.Dll7Wwmg.js +1 -0
- package/packages/storefront/dist/client/_astro/page.FdSlRisw.js +1 -0
- package/packages/storefront/dist/client/_astro/sf-utils.C9ygvYIB.js +13 -0
- package/packages/storefront/dist/client/_astro/shopping-cart.Cqc6p5UR.js +1 -0
- package/packages/storefront/dist/client/_astro/use-analytics.bP3a5cR0.js +1 -0
- package/packages/storefront/dist/client/_astro/{use-cms-preview.CPGTKut8.js → use-cms-preview.BxKK4a1X.js} +1 -1
- package/packages/storefront/dist/client/_astro/use-product-card.Cj9Q-Y1A.js +1 -0
- package/packages/storefront/dist/client/_astro/{use-text-value.D4Rw7N4D.js → use-text-value.DT0v9Yj_.js} +2 -2
- package/packages/storefront/dist/server/_astro-internal_middleware.mjs +4 -0
- package/packages/storefront/dist/server/chunks/404_jTV5wvby.mjs +5 -0
- package/packages/storefront/dist/server/chunks/{CartSidebar_lUckG0fs.mjs → CartSidebar_CV9qwGNE.mjs} +2 -1
- package/packages/storefront/dist/server/chunks/{SearchModal_B2f22Mff.mjs → SearchModal_Cw1ECnXI.mjs} +37 -15
- package/packages/storefront/dist/server/chunks/_.._k1NruPDv.mjs +5 -0
- package/packages/storefront/dist/server/chunks/_astro-internal_middleware_DIG56BhA.mjs +40 -0
- package/packages/storefront/dist/server/chunks/{_page__Ex4FhYrc.mjs → _page__BKNX3RH7.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/{account_B7sLjsXD.mjs → account_BZOa6Kmc.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/astro/{assets-service_BOyOfKDQ.mjs → assets-service_MW85B416.mjs} +5 -2
- package/packages/storefront/dist/server/chunks/{astro_B5LBy7PI.mjs → astro_8KdHu_Gf.mjs} +83 -113
- package/packages/storefront/dist/server/chunks/{index_C2hkTn-w.mjs → index_CZ6FSUEb.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/{index_BOh755yP.mjs → index_D1o9pXka.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/{node_DavlI8UF.mjs → node_Khrf-0bH.mjs} +1 -1
- package/packages/storefront/dist/server/chunks/pages/{__RXg_hYeF.mjs → 404_BPSxJtl3.mjs} +675 -4955
- package/packages/storefront/dist/server/chunks/pages/__ByRpsTnC.mjs +4630 -0
- package/packages/storefront/dist/server/chunks/pages/{_page__Dyte93f2.mjs → _page__BasreLue.mjs} +32 -9
- package/packages/storefront/dist/server/chunks/pages/{account_C66y6_Y9.mjs → account_MZBvNAyZ.mjs} +2 -2
- package/packages/storefront/dist/server/chunks/pages/{index_EO1hhrt8.mjs → index_CV2ET14h.mjs} +24 -9
- package/packages/storefront/dist/server/chunks/pages/{node_hc25rqYt.mjs → node_1tKTIKG-.mjs} +145 -11
- package/packages/storefront/dist/server/chunks/pages/{~fallback_-K3esUV3.mjs → ~fallback_BVYzgZ5p.mjs} +2 -28
- package/packages/storefront/dist/server/chunks/{~fallback_DQ6yB81s.mjs → ~fallback_xH9bJF7E.mjs} +1 -1
- package/packages/storefront/dist/server/entry.mjs +469 -507
- package/packages/storefront/dist/server/manifest_S9lE9v48.mjs +206 -0
- package/packages/storefront/dist/server/middleware.mjs +4 -0
- package/packages/storefront/dist/server/renderers.mjs +39 -50
- package/packages/storefront/package.json +7 -7
- package/packages/storefront/src/decap-cms/get-cms-config.ts +0 -1
- package/packages/storefront/src/images/picture-base.ts +1 -1
- package/packages/storefront/src/lib/assets/decap-cms.css +13 -3
- package/packages/storefront/src/lib/components/Picture.astro +1 -1
- package/packages/storefront/src/lib/composables/use-product-shelf.ts +1 -1
- package/packages/storefront/tailwind.config.js +3 -0
- package/packages/storefront/uno.config.js +3 -0
- package/packages/test-base/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/tailwind.config.js +6 -0
- package/ecomplus-stores/barradoce/functions/ssr/uno.config.cjs +0 -5
- package/ecomplus-stores/barradoce/tailwind.config.cjs +0 -7
- package/packages/storefront/dist/client/_astro/AccountPage.Cq0jrJE5.js +0 -1
- package/packages/storefront/dist/client/_astro/CartSidebar.DkX2BE1w.js +0 -1
- package/packages/storefront/dist/client/_astro/HeroSlider.CZujn8cU.js +0 -1
- package/packages/storefront/dist/client/_astro/PitchBar.DhcSEQPV.js +0 -1
- package/packages/storefront/dist/client/_astro/Prices.D1uItqV5.js +0 -1
- package/packages/storefront/dist/client/_astro/ProductDetails.DDNMc2oj.js +0 -7
- package/packages/storefront/dist/client/_astro/ProductShelf.BwRDTU-V.js +0 -1
- package/packages/storefront/dist/client/_astro/SearchModal.DgrtGsIu.js +0 -1
- package/packages/storefront/dist/client/_astro/SearchShowcase.DggdcmcI.js +0 -1
- package/packages/storefront/dist/client/_astro/ShippingCalculator.B5JIh5xw.js +0 -1
- package/packages/storefront/dist/client/_astro/ShopHeader.CIsQLhMR.js +0 -7
- package/packages/storefront/dist/client/_astro/_slug_.CnXAH2gj.css +0 -1
- package/packages/storefront/dist/client/_astro/client.mwowSQrH.js +0 -1
- package/packages/storefront/dist/client/_astro/customer-session.BAjMMoBA.js +0 -7
- package/packages/storefront/dist/client/_astro/hoisted.B8Lw6O9a.js +0 -1
- package/packages/storefront/dist/client/_astro/hoisted.D4m7OTKi.js +0 -8
- package/packages/storefront/dist/client/_astro/hoisted.DSAg3dYh.js +0 -1
- package/packages/storefront/dist/client/_astro/hoisted.D_dlmSy5.js +0 -1
- package/packages/storefront/dist/client/_astro/index.BAyyMfaO.js +0 -1
- package/packages/storefront/dist/client/_astro/index.CTTHpJlV.js +0 -1
- package/packages/storefront/dist/client/_astro/modules-info.C6KJuGeB.js +0 -1
- package/packages/storefront/dist/client/_astro/name.CIPngEFN.js +0 -1
- package/packages/storefront/dist/client/_astro/server-data.CUHTES8a.js +0 -1
- package/packages/storefront/dist/client/_astro/sf-utils.xmJHVMAX.js +0 -13
- package/packages/storefront/dist/client/_astro/shopping-cart.DGvCZWRZ.js +0 -1
- package/packages/storefront/dist/client/_astro/use-analytics.BWhF_fCv.js +0 -1
- package/packages/storefront/dist/client/_astro/use-product-card.C-RbCwna.js +0 -1
- package/packages/storefront/dist/server/_noop-middleware.mjs +0 -3
- package/packages/storefront/dist/server/chunks/_.._CvgSOb3Z.mjs +0 -5
- package/packages/storefront/dist/server/manifest_bZVxjk3o.mjs +0 -201
- package/packages/storefront/tailwind.config.cjs +0 -3
- package/packages/storefront/uno.config.cjs +0 -3
- package/tailwind.config.cjs +0 -5
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import '@astrojs/internal-helpers/path';
|
|
2
|
+
import 'cookie';
|
|
3
|
+
import { bold, red, yellow, dim, blue } from 'kleur/colors';
|
|
4
|
+
import 'string-width';
|
|
5
|
+
import './chunks/astro_8KdHu_Gf.mjs';
|
|
6
|
+
import 'clsx';
|
|
7
|
+
import { compile } from 'path-to-regexp';
|
|
8
|
+
|
|
9
|
+
const dateTimeFormat = new Intl.DateTimeFormat([], {
|
|
10
|
+
hour: "2-digit",
|
|
11
|
+
minute: "2-digit",
|
|
12
|
+
second: "2-digit",
|
|
13
|
+
hour12: false
|
|
14
|
+
});
|
|
15
|
+
const levels = {
|
|
16
|
+
debug: 20,
|
|
17
|
+
info: 30,
|
|
18
|
+
warn: 40,
|
|
19
|
+
error: 50,
|
|
20
|
+
silent: 90
|
|
21
|
+
};
|
|
22
|
+
function log(opts, level, label, message, newLine = true) {
|
|
23
|
+
const logLevel = opts.level;
|
|
24
|
+
const dest = opts.dest;
|
|
25
|
+
const event = {
|
|
26
|
+
label,
|
|
27
|
+
level,
|
|
28
|
+
message,
|
|
29
|
+
newLine
|
|
30
|
+
};
|
|
31
|
+
if (!isLogLevelEnabled(logLevel, level)) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
dest.write(event);
|
|
35
|
+
}
|
|
36
|
+
function isLogLevelEnabled(configuredLogLevel, level) {
|
|
37
|
+
return levels[configuredLogLevel] <= levels[level];
|
|
38
|
+
}
|
|
39
|
+
function info(opts, label, message, newLine = true) {
|
|
40
|
+
return log(opts, "info", label, message, newLine);
|
|
41
|
+
}
|
|
42
|
+
function warn(opts, label, message, newLine = true) {
|
|
43
|
+
return log(opts, "warn", label, message, newLine);
|
|
44
|
+
}
|
|
45
|
+
function error(opts, label, message, newLine = true) {
|
|
46
|
+
return log(opts, "error", label, message, newLine);
|
|
47
|
+
}
|
|
48
|
+
function debug(...args) {
|
|
49
|
+
if ("_astroGlobalDebug" in globalThis) {
|
|
50
|
+
globalThis._astroGlobalDebug(...args);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function getEventPrefix({ level, label }) {
|
|
54
|
+
const timestamp = `${dateTimeFormat.format(/* @__PURE__ */ new Date())}`;
|
|
55
|
+
const prefix = [];
|
|
56
|
+
if (level === "error" || level === "warn") {
|
|
57
|
+
prefix.push(bold(timestamp));
|
|
58
|
+
prefix.push(`[${level.toUpperCase()}]`);
|
|
59
|
+
} else {
|
|
60
|
+
prefix.push(timestamp);
|
|
61
|
+
}
|
|
62
|
+
if (label) {
|
|
63
|
+
prefix.push(`[${label}]`);
|
|
64
|
+
}
|
|
65
|
+
if (level === "error") {
|
|
66
|
+
return red(prefix.join(" "));
|
|
67
|
+
}
|
|
68
|
+
if (level === "warn") {
|
|
69
|
+
return yellow(prefix.join(" "));
|
|
70
|
+
}
|
|
71
|
+
if (prefix.length === 1) {
|
|
72
|
+
return dim(prefix[0]);
|
|
73
|
+
}
|
|
74
|
+
return dim(prefix[0]) + " " + blue(prefix.splice(1).join(" "));
|
|
75
|
+
}
|
|
76
|
+
if (typeof process !== "undefined") {
|
|
77
|
+
let proc = process;
|
|
78
|
+
if ("argv" in proc && Array.isArray(proc.argv)) {
|
|
79
|
+
if (proc.argv.includes("--verbose")) ; else if (proc.argv.includes("--silent")) ; else ;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
class Logger {
|
|
83
|
+
options;
|
|
84
|
+
constructor(options) {
|
|
85
|
+
this.options = options;
|
|
86
|
+
}
|
|
87
|
+
info(label, message, newLine = true) {
|
|
88
|
+
info(this.options, label, message, newLine);
|
|
89
|
+
}
|
|
90
|
+
warn(label, message, newLine = true) {
|
|
91
|
+
warn(this.options, label, message, newLine);
|
|
92
|
+
}
|
|
93
|
+
error(label, message, newLine = true) {
|
|
94
|
+
error(this.options, label, message, newLine);
|
|
95
|
+
}
|
|
96
|
+
debug(label, ...messages) {
|
|
97
|
+
debug(label, ...messages);
|
|
98
|
+
}
|
|
99
|
+
level() {
|
|
100
|
+
return this.options.level;
|
|
101
|
+
}
|
|
102
|
+
forkIntegrationLogger(label) {
|
|
103
|
+
return new AstroIntegrationLogger(this.options, label);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
class AstroIntegrationLogger {
|
|
107
|
+
options;
|
|
108
|
+
label;
|
|
109
|
+
constructor(logging, label) {
|
|
110
|
+
this.options = logging;
|
|
111
|
+
this.label = label;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Creates a new logger instance with a new label, but the same log options.
|
|
115
|
+
*/
|
|
116
|
+
fork(label) {
|
|
117
|
+
return new AstroIntegrationLogger(this.options, label);
|
|
118
|
+
}
|
|
119
|
+
info(message) {
|
|
120
|
+
info(this.options, this.label, message);
|
|
121
|
+
}
|
|
122
|
+
warn(message) {
|
|
123
|
+
warn(this.options, this.label, message);
|
|
124
|
+
}
|
|
125
|
+
error(message) {
|
|
126
|
+
error(this.options, this.label, message);
|
|
127
|
+
}
|
|
128
|
+
debug(message) {
|
|
129
|
+
debug(this.label, message);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function getRouteGenerator(segments, addTrailingSlash) {
|
|
134
|
+
const template = segments.map((segment) => {
|
|
135
|
+
return "/" + segment.map((part) => {
|
|
136
|
+
if (part.spread) {
|
|
137
|
+
return `:${part.content.slice(3)}(.*)?`;
|
|
138
|
+
} else if (part.dynamic) {
|
|
139
|
+
return `:${part.content}`;
|
|
140
|
+
} else {
|
|
141
|
+
return part.content.normalize().replace(/\?/g, "%3F").replace(/#/g, "%23").replace(/%5B/g, "[").replace(/%5D/g, "]").replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
142
|
+
}
|
|
143
|
+
}).join("");
|
|
144
|
+
}).join("");
|
|
145
|
+
let trailing = "";
|
|
146
|
+
if (addTrailingSlash === "always" && segments.length) {
|
|
147
|
+
trailing = "/";
|
|
148
|
+
}
|
|
149
|
+
const toPath = compile(template + trailing);
|
|
150
|
+
return (params) => {
|
|
151
|
+
const path = toPath(params);
|
|
152
|
+
return path || "/";
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function deserializeRouteData(rawRouteData) {
|
|
157
|
+
return {
|
|
158
|
+
route: rawRouteData.route,
|
|
159
|
+
type: rawRouteData.type,
|
|
160
|
+
pattern: new RegExp(rawRouteData.pattern),
|
|
161
|
+
params: rawRouteData.params,
|
|
162
|
+
component: rawRouteData.component,
|
|
163
|
+
generate: getRouteGenerator(rawRouteData.segments, rawRouteData._meta.trailingSlash),
|
|
164
|
+
pathname: rawRouteData.pathname || void 0,
|
|
165
|
+
segments: rawRouteData.segments,
|
|
166
|
+
prerender: rawRouteData.prerender,
|
|
167
|
+
redirect: rawRouteData.redirect,
|
|
168
|
+
redirectRoute: rawRouteData.redirectRoute ? deserializeRouteData(rawRouteData.redirectRoute) : void 0,
|
|
169
|
+
fallbackRoutes: rawRouteData.fallbackRoutes.map((fallback) => {
|
|
170
|
+
return deserializeRouteData(fallback);
|
|
171
|
+
}),
|
|
172
|
+
isIndex: rawRouteData.isIndex
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function deserializeManifest(serializedManifest) {
|
|
177
|
+
const routes = [];
|
|
178
|
+
for (const serializedRoute of serializedManifest.routes) {
|
|
179
|
+
routes.push({
|
|
180
|
+
...serializedRoute,
|
|
181
|
+
routeData: deserializeRouteData(serializedRoute.routeData)
|
|
182
|
+
});
|
|
183
|
+
const route = serializedRoute;
|
|
184
|
+
route.routeData = deserializeRouteData(serializedRoute.routeData);
|
|
185
|
+
}
|
|
186
|
+
const assets = new Set(serializedManifest.assets);
|
|
187
|
+
const componentMetadata = new Map(serializedManifest.componentMetadata);
|
|
188
|
+
const inlinedScripts = new Map(serializedManifest.inlinedScripts);
|
|
189
|
+
const clientDirectives = new Map(serializedManifest.clientDirectives);
|
|
190
|
+
return {
|
|
191
|
+
// in case user middleware exists, this no-op middleware will be reassigned (see plugin-ssr.ts)
|
|
192
|
+
middleware(_, next) {
|
|
193
|
+
return next();
|
|
194
|
+
},
|
|
195
|
+
...serializedManifest,
|
|
196
|
+
assets,
|
|
197
|
+
componentMetadata,
|
|
198
|
+
inlinedScripts,
|
|
199
|
+
clientDirectives,
|
|
200
|
+
routes
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
const manifest = deserializeManifest({"adapterName":"@astrojs/node","routes":[{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/page.FdSlRisw.js"}],"styles":[],"routeData":{"type":"endpoint","isIndex":false,"route":"/_image","pattern":"^\\/_image$","segments":[[{"content":"_image","dynamic":false,"spread":false}]],"params":[],"component":"../../node_modules/.pnpm/astro@4.5.12_@types+node@18.19.28_typescript@5.4.3/node_modules/astro/dist/assets/endpoint/node.js","pathname":"/_image","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.BeKMioW4.js"},{"type":"external","value":"/_astro/page.FdSlRisw.js"}],"styles":[{"type":"external","src":"/_astro/_slug_.HhgCFKHv.css"}],"routeData":{"route":"/~fallback","isIndex":false,"type":"page","pattern":"^\\/~fallback\\/?$","segments":[[{"content":"~fallback","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/~fallback.astro","pathname":"/~fallback","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.BeKMioW4.js"},{"type":"external","value":"/_astro/page.FdSlRisw.js"}],"styles":[{"type":"external","src":"/_astro/_slug_.HhgCFKHv.css"}],"routeData":{"route":"/404","isIndex":false,"type":"page","pattern":"^\\/404\\/?$","segments":[[{"content":"404","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/404.astro","pathname":"/404","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.CSjieYcR.js"},{"type":"external","value":"/_astro/page.FdSlRisw.js"}],"styles":[{"type":"external","src":"/_astro/_slug_.HhgCFKHv.css"}],"routeData":{"route":"/admin","isIndex":true,"type":"page","pattern":"^\\/admin\\/?$","segments":[[{"content":"admin","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/admin/index.astro","pathname":"/admin","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.BeKMioW4.js"},{"type":"external","value":"/_astro/page.FdSlRisw.js"}],"styles":[{"type":"external","src":"/_astro/_slug_.HhgCFKHv.css"}],"routeData":{"route":"/app/account","isIndex":false,"type":"page","pattern":"^\\/app\\/account\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}],[{"content":"account","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/account.astro","pathname":"/app/account","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.Bf1gCkSN.js"},{"type":"external","value":"/_astro/page.FdSlRisw.js"}],"styles":[{"type":"external","src":"/_astro/_slug_.HhgCFKHv.css"}],"routeData":{"route":"/app","isIndex":true,"type":"page","pattern":"^\\/app\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/index.astro","pathname":"/app","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.BeKMioW4.js"},{"type":"external","value":"/_astro/page.FdSlRisw.js"}],"styles":[{"type":"external","src":"/_astro/_slug_.HhgCFKHv.css"}],"routeData":{"route":"/blog/[page]","isIndex":false,"type":"page","pattern":"^\\/blog\\/([^/]+?)\\/?$","segments":[[{"content":"blog","dynamic":false,"spread":false}],[{"content":"page","dynamic":true,"spread":false}]],"params":["page"],"component":"src/pages/blog/[page].astro","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.BeKMioW4.js"},{"type":"external","value":"/_astro/page.FdSlRisw.js"}],"styles":[{"type":"external","src":"/_astro/_slug_.HhgCFKHv.css"}],"routeData":{"route":"/[...slug]","isIndex":false,"type":"page","pattern":"^(?:\\/(.*?))?\\/?$","segments":[[{"content":"...slug","dynamic":true,"spread":true}]],"params":["...slug"],"component":"src/pages/[...slug].astro","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}}],"site":"https://demo.ecomplus.app","base":"/","trailingSlash":"ignore","compressHTML":false,"componentMetadata":[],"renderers":[],"clientDirectives":[["idle","(()=>{var i=t=>{let e=async()=>{await(await t())()};\"requestIdleCallback\"in window?window.requestIdleCallback(e):setTimeout(e,200)};(self.Astro||(self.Astro={})).idle=i;window.dispatchEvent(new Event(\"astro:idle\"));})();"],["load","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).load=e;window.dispatchEvent(new Event(\"astro:load\"));})();"],["media","(()=>{var s=(i,t)=>{let a=async()=>{await(await i())()};if(t.value){let e=matchMedia(t.value);e.matches?a():e.addEventListener(\"change\",a,{once:!0})}};(self.Astro||(self.Astro={})).media=s;window.dispatchEvent(new Event(\"astro:media\"));})();"],["only","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).only=e;window.dispatchEvent(new Event(\"astro:only\"));})();"],["visible","(()=>{var l=(s,i,o)=>{let r=async()=>{await(await s())()},t=typeof i.value==\"object\"?i.value:void 0,c={rootMargin:t==null?void 0:t.rootMargin},n=new IntersectionObserver(e=>{for(let a of e)if(a.isIntersecting){n.disconnect(),r();break}},c);for(let e of o.children)n.observe(e)};(self.Astro||(self.Astro={})).visible=l;window.dispatchEvent(new Event(\"astro:visible\"));})();"],["sf","(()=>{var v=i=>new Promise(n=>{let r={},t=new IntersectionObserver(o=>{for(let c of o)if(c.isIntersecting){t.disconnect(),n();break}},r);for(let o of i.children)t.observe(o)}),l=new Promise(i=>{let n=new AbortController;[\"keydown\",\"mousemove\",\"pointerdown\",\"touchstart\",\"scroll\"].forEach(r=>{document.addEventListener(r,()=>{i(),n.abort(),window.dispatchEvent(new Event(\"firstInteraction\"))},{once:!0,passive:!0,signal:n.signal})})});window.$firstInteraction=l;var w=(i,n,r)=>{let t=(Array.isArray(n.value)?n.value:[n.value]).reduce((e,s)=>(typeof s==\"string\"&&s.split(\",\").forEach(u=>{e.push(u)}),e),[]),o=!t.length||t.includes(\"lazy\"),c=!o&&t.includes(\"eager\"),d=async()=>{t.includes(\"interaction\")&&await l,await(await i())()},a=async()=>{for(let e=0;e<t.length;e++)if(typeof t[e]==\"string\"&&t[e].startsWith(\"data:\")){let s=t[e].substring(5);if(!window.$storefront?.data?.[s]){window.addEventListener(`storefront:data:${s}`,a,{once:!0});return}}if(o&&await v(r),o||t.includes(\"idle\")){if(typeof window.requestIdleCallback==\"function\"){window.requestIdleCallback(d);return}setTimeout(d,100);return}d()};if(c){a();return}let f=window.$storefront?.apiContext?.doc._id||null;if(window._firstLoadContextId===f&&window._emitedContextId===f){a();return}window.addEventListener(\"storefront:apiContext\",a,{once:!0})};(self.Astro||(self.Astro={})).sf=w;window.dispatchEvent(new Event(\"astro:sf\"));})();\n"]],"entryModules":{"\u0000astro-internal:middleware":"_astro-internal_middleware.mjs","\u0000@astrojs-ssr-virtual-entry":"entry.mjs","\u0000@astro-renderers":"renderers.mjs","/src/pages/blog/[page].astro":"chunks/pages/_page__BasreLue.mjs","/src/pages/app/account.astro":"chunks/pages/account_MZBvNAyZ.mjs","/../../node_modules/.pnpm/astro@4.5.12_@types+node@18.19.28_typescript@5.4.3/node_modules/astro/dist/assets/endpoint/node.js":"chunks/pages/node_1tKTIKG-.mjs","/src/pages/~fallback.astro":"chunks/pages/~fallback_BVYzgZ5p.mjs","\u0000@astrojs-manifest":"manifest_S9lE9v48.mjs","\u0000@astro-page:../../node_modules/.pnpm/astro@4.5.12_@types+node@18.19.28_typescript@5.4.3/node_modules/astro/dist/assets/endpoint/node@_@js":"chunks/node_Khrf-0bH.mjs","\u0000@astro-page:src/pages/~fallback@_@astro":"chunks/~fallback_xH9bJF7E.mjs","\u0000@astro-page:src/pages/404@_@astro":"chunks/404_jTV5wvby.mjs","\u0000@astro-page:src/pages/admin/index@_@astro":"chunks/index_D1o9pXka.mjs","\u0000@astro-page:src/pages/app/account@_@astro":"chunks/account_BZOa6Kmc.mjs","\u0000@astro-page:src/pages/app/index@_@astro":"chunks/index_CZ6FSUEb.mjs","\u0000@astro-page:src/pages/blog/[page]@_@astro":"chunks/_page__BKNX3RH7.mjs","\u0000@astro-page:src/pages/[...slug]@_@astro":"chunks/_.._k1NruPDv.mjs","/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/SearchModal.vue":"_astro/SearchModal.DWNSfxML.js","/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/CartSidebar.vue":"_astro/CartSidebar.DAvJKL2c.js","/home/leo/code/ecomplus/cloud-commerce/node_modules/photoswipe/dist/photoswipe.css?inline":"_astro/photoswipe.CNpEZKfy.js","astro:scripts/page.js":"_astro/page.FdSlRisw.js","/astro/hoisted.js?q=1":"_astro/hoisted.Bf1gCkSN.js","~/components/PitchBar.vue":"_astro/PitchBar.CEGsee2q.js","/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/scripts/firebase-app.ts":"_astro/firebase-app.CmI1zl7o.js","/astro/hoisted.js?q=2":"_astro/hoisted.BeKMioW4.js","~/components/HeroSlider.vue":"_astro/HeroSlider.DyjSOy4Q.js","~/components/AccountPage.vue":"_astro/AccountPage.Cf0WE6GF.js","~/components/ProductDetails.vue":"_astro/ProductDetails.BpZtnS8j.js","~/components/ProductShelf.vue":"_astro/ProductShelf.C0TU_sRb.js","/home/leo/code/ecomplus/cloud-commerce/node_modules/photoswipe/dist/photoswipe-lightbox.esm.js":"_astro/photoswipe-lightbox.esm.BbYxSZIB.js","/astro/hoisted.js?q=0":"_astro/hoisted.CSjieYcR.js","~/components/ShopHeader.vue":"_astro/ShopHeader.D7qqQxFD.js","@astrojs/vue/client.js":"_astro/client.D_V8TfA5.js","~/components/SearchShowcase.vue":"_astro/SearchShowcase.CUkbXIRk.js","/home/leo/code/ecomplus/cloud-commerce/node_modules/photoswipe/dist/photoswipe.esm.js":"_astro/photoswipe.esm.C0FT-EY-.js","astro:scripts/before-hydration.js":""},"inlinedScripts":[],"assets":["/_astro/_slug_.HhgCFKHv.css","/robots.txt","/_astro/AccountPage.Cf0WE6GF.js","/_astro/CartSidebar.DAvJKL2c.js","/_astro/HeroSlider.DyjSOy4Q.js","/_astro/PitchBar.CEGsee2q.js","/_astro/Prices.9RhV7hCY.js","/_astro/ProductDetails.BpZtnS8j.js","/_astro/ProductShelf.C0TU_sRb.js","/_astro/SearchModal.DWNSfxML.js","/_astro/SearchShowcase.CUkbXIRk.js","/_astro/ShippingCalculator.DZSCK4xv.js","/_astro/ShopHeader.D7qqQxFD.js","/_astro/_commonjsHelpers.Cpj98o6Y.js","/_astro/_plugin-vue_export-helper.6K9uDcVo.js","/_astro/afetch.DPLba2tr.js","/_astro/client.D_V8TfA5.js","/_astro/customer-session.Cctko5_9.js","/_astro/firebase-app.CmI1zl7o.js","/_astro/format-money.D19_eJVX.js","/_astro/grid-title.CZdq2sDS.js","/_astro/hoisted.BeKMioW4.js","/_astro/hoisted.Bf1gCkSN.js","/_astro/hoisted.CSjieYcR.js","/_astro/i18n.DPcLqMFO.js","/_astro/img-sizes.rFK7so02.js","/_astro/img.Be85e5da.js","/_astro/index-a8cf6c8f.k99a-gIB.js","/_astro/index.BCNoXz_Z.js","/_astro/index.BgtOIB20.js","/_astro/index.DlxZwqDP.js","/_astro/modules-info.BswYf_-7.js","/_astro/name.Dll7Wwmg.js","/_astro/page.FdSlRisw.js","/_astro/photoswipe-lightbox.esm.BbYxSZIB.js","/_astro/photoswipe.CNpEZKfy.js","/_astro/photoswipe.esm.C0FT-EY-.js","/_astro/price.CHiL6Z1J.js","/_astro/sf-utils.C9ygvYIB.js","/_astro/shopping-cart.Cqc6p5UR.js","/_astro/use-analytics.bP3a5cR0.js","/_astro/use-cms-preview.BxKK4a1X.js","/_astro/use-product-card.Cj9Q-Y1A.js","/_astro/use-text-value.DT0v9Yj_.js","/img/icon.png","/img/large-icon.png","/img/uploads/banner2.webp","/img/uploads/ecom-icon.png","/img/uploads/headphone.webp","/img/uploads/logo.png","/img/uploads/og-image.png","/img/uploads/passion.webp","/img/uploads/rect8589.png","/img/uploads/rect859.png","/img/uploads/rect89.webp","/_astro/page.FdSlRisw.js"],"buildFormat":"directory"});
|
|
205
|
+
|
|
206
|
+
export { AstroIntegrationLogger as A, Logger as L, getEventPrefix as g, levels as l, manifest };
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import { defineComponent, h, createSSRApp } from 'vue';
|
|
2
2
|
import { renderToString } from 'vue/server-renderer';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const setup = async (app) => {
|
|
6
|
-
if ('default' in mod) {
|
|
7
|
-
await createApp(app);
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
/* eslint-disable no-restricted-syntax */
|
|
3
|
+
import { X as mod, Y as createApp } from './chunks/pages/404_BPSxJtl3.mjs';
|
|
12
4
|
|
|
13
5
|
/**
|
|
14
6
|
* Astro passes `children` as a string of HTML, so we need
|
|
@@ -17,57 +9,54 @@ const setup = async (app) => {
|
|
|
17
9
|
* This is the Vue + JSX equivalent of using `<div v-html="value" />`
|
|
18
10
|
*/
|
|
19
11
|
const StaticHtml = defineComponent({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
12
|
+
props: {
|
|
13
|
+
value: String,
|
|
14
|
+
name: String,
|
|
15
|
+
hydrate: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: true,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
setup({ name, value, hydrate }) {
|
|
21
|
+
if (!value) return () => null;
|
|
22
|
+
let tagName = hydrate ? 'astro-slot' : 'astro-static-slot';
|
|
23
|
+
return () => h(tagName, { name, innerHTML: value });
|
|
24
|
+
},
|
|
33
25
|
});
|
|
34
26
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
* help from us, so this just works out of the box!
|
|
41
|
-
*/
|
|
27
|
+
const setup = async (app) => {
|
|
28
|
+
if ('default' in mod) {
|
|
29
|
+
await createApp(app);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
42
32
|
|
|
43
33
|
function check(Component) {
|
|
44
|
-
|
|
34
|
+
return !!Component['ssrRender'] || !!Component['__ssrInlineRender'];
|
|
45
35
|
}
|
|
46
36
|
|
|
47
37
|
async function renderToStaticMarkup(Component, inputProps, slotted, metadata) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
return { html };
|
|
38
|
+
const slots = {};
|
|
39
|
+
const props = { ...inputProps };
|
|
40
|
+
delete props.slot;
|
|
41
|
+
for (const [key, value] of Object.entries(slotted)) {
|
|
42
|
+
slots[key] = () =>
|
|
43
|
+
h(StaticHtml, {
|
|
44
|
+
value,
|
|
45
|
+
name: key === 'default' ? undefined : key,
|
|
46
|
+
// Adjust how this is hydrated only when the version of Astro supports `astroStaticSlot`
|
|
47
|
+
hydrate: metadata.astroStaticSlot ? !!metadata.hydrate : true,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
const app = createSSRApp({ render: () => h(Component, props, slots) });
|
|
51
|
+
await setup(app);
|
|
52
|
+
const html = await renderToString(app);
|
|
53
|
+
return { html };
|
|
65
54
|
}
|
|
66
55
|
|
|
67
56
|
const _renderer0 = {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
57
|
+
check,
|
|
58
|
+
renderToStaticMarkup,
|
|
59
|
+
supportsAstroStaticSlot: true,
|
|
71
60
|
};
|
|
72
61
|
|
|
73
62
|
const renderers = [Object.assign({"name":"@astrojs/vue","clientEntrypoint":"@astrojs/vue/client.js","serverEntrypoint":"@astrojs/vue/server.js"}, { ssr: _renderer0 }),];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/storefront",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.10.
|
|
4
|
+
"version": "2.10.4",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce storefront with Astro",
|
|
6
6
|
"bin": {
|
|
7
7
|
"storefront": "./scripts/build-prod.sh"
|
|
@@ -58,16 +58,16 @@
|
|
|
58
58
|
"astro-capo": "^0.0.1",
|
|
59
59
|
"chroma-js": "^2.4.2",
|
|
60
60
|
"dotenv": "^16.4.5",
|
|
61
|
-
"firebase": "^10.
|
|
61
|
+
"firebase": "^10.10.0",
|
|
62
62
|
"image-size": "^1.1.1",
|
|
63
|
-
"mime": "^
|
|
63
|
+
"mime": "^4.0.1",
|
|
64
64
|
"mitt": "^3.0.1",
|
|
65
65
|
"semver": "^7.6.0",
|
|
66
66
|
"sharp": "^0.32.6",
|
|
67
|
-
"tailwindcss": "^3.4.
|
|
68
|
-
"unocss": "^0.58.
|
|
67
|
+
"tailwindcss": "^3.4.3",
|
|
68
|
+
"unocss": "^0.58.9",
|
|
69
69
|
"unplugin-auto-import": "^0.17.5",
|
|
70
|
-
"vite": "^5.2.
|
|
70
|
+
"vite": "^5.2.7",
|
|
71
71
|
"vite-plugin-pwa": "^0.19.7",
|
|
72
72
|
"vue": "^3.4.21",
|
|
73
73
|
"wade": "0.3.3",
|
|
@@ -76,6 +76,6 @@
|
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@cloudcommerce/eslint": "workspace:*",
|
|
78
78
|
"@cloudcommerce/types": "workspace:*",
|
|
79
|
-
"@types/react": "^18.2.
|
|
79
|
+
"@types/react": "^18.2.73"
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -16,7 +16,6 @@ export const getCmsConfig = () => {
|
|
|
16
16
|
const deepmerge = Deepmerge();
|
|
17
17
|
CMS.registerLocale(locale, deepmerge(CMS.getLocale(locale), {
|
|
18
18
|
editor: {
|
|
19
|
-
editorControl: { field: { optional: '?' } },
|
|
20
19
|
editorWidgets: {
|
|
21
20
|
image: {
|
|
22
21
|
chooseDifferent: i18n({ en: 'Change image', pt: 'Mudar imagem' }),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'astro/types';
|
|
2
2
|
import type { OutputFormat, TransformOptions, GetBuiltImage } from './get-built-image';
|
|
3
|
-
import mime from 'mime/lite
|
|
3
|
+
import mime from 'mime/lite';
|
|
4
4
|
|
|
5
5
|
export interface GetPictureParams {
|
|
6
6
|
src: string /* | ImageMetadata | Promise<{ default: ImageMetadata }> */;
|
|
@@ -4,6 +4,19 @@ body {
|
|
|
4
4
|
text-transform: none;
|
|
5
5
|
font-weight: 500;
|
|
6
6
|
width: calc(100% - 30px);
|
|
7
|
+
> span {
|
|
8
|
+
display: none;
|
|
9
|
+
}
|
|
10
|
+
&[class*="1qu85o2"] {
|
|
11
|
+
background: none;
|
|
12
|
+
&:has(span) {
|
|
13
|
+
color: #4b5563;
|
|
14
|
+
}
|
|
15
|
+
&:not(:has(span)) {
|
|
16
|
+
color: #1f2937;
|
|
17
|
+
font-weight: 600;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
7
20
|
~ input,
|
|
8
21
|
~ textarea {
|
|
9
22
|
padding: 12px 14px;
|
|
@@ -27,9 +40,6 @@ body {
|
|
|
27
40
|
}
|
|
28
41
|
}
|
|
29
42
|
}
|
|
30
|
-
[class*="1qu85o2-FieldLabel"] {
|
|
31
|
-
background: none;
|
|
32
|
-
}
|
|
33
43
|
[class*="TopBarContainer"] {
|
|
34
44
|
[class*="ExpandButtonContainer"] {
|
|
35
45
|
display: none;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { ImageMetadata } from 'astro';
|
|
3
3
|
import { resolve as resolvePath, basename } from 'node:path';
|
|
4
4
|
import { copyFileSync } from 'node:fs';
|
|
5
|
-
import mime from 'mime/lite
|
|
5
|
+
import mime from 'mime/lite';
|
|
6
6
|
import { getImage } from 'astro:assets';
|
|
7
7
|
import imageSize from 'image-size';
|
|
8
8
|
import { createPictureGetter } from '../../images/picture-base';
|
|
@@ -41,7 +41,7 @@ const useProductShelf = (props: Props) => {
|
|
|
41
41
|
if (props.isRelatedProducts) {
|
|
42
42
|
const { apiContext } = globalThis.$storefront;
|
|
43
43
|
if (apiContext?.resource === 'products') {
|
|
44
|
-
endpointQuery +=
|
|
44
|
+
endpointQuery += `&like=${apiContext.doc._id}`;
|
|
45
45
|
if (!title.value && title.value !== null) {
|
|
46
46
|
title.value = i19relatedProducts;
|
|
47
47
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as f,w as h,d as P,c as M,i as C,o as l,e as c,Z as F,f as i,a0 as b,a1 as r,l as S,j as k,n as A,g as L,h as U,a4 as T,a5 as V,F as j,k as B}from"./sf-utils.xmJHVMAX.js";import{_ as N,a as I,v as R,w as x}from"./_plugin-vue_export-helper.3R8ooc_r.js";import{e as q,f as _,E as D,a as O,d as E}from"./customer-session.BAjMMoBA.js";import{u as z}from"./index.BAyyMfaO.js";import{g as G,b as K,c as W}from"./index-bea2a320.CHELEM8n.js";import{u as Y}from"./index.CTTHpJlV.js";import"./server-data.CUHTES8a.js";const Z=m=>{q();const s=m?.canUseUrlParams!==!1?z("history"):{},e=s.sign_up!==void 0&&s.sign_up!=="0",a=s.password!==void 0&&s.password!=="0",u=f(e),n=f(!e&&!a);h(u,p=>{p?(n.value=!0,s.sign_up="1"):s.sign_up="0"}),h(n,p=>{s.password=p?"0":"1"});const o=f(""),d=f(!1),g=Y(async p=>{d.value=!0;const v=Date.now(),y=G();if(_.value){window.localStorage.setItem(D,_.value);try{if(n.value){const w=new URL(p||window.location.toString());w.searchParams.append("email",_.value),await K(y,_.value,{url:w.toString(),handleCodeInApp:!0})}else await W(y,_.value,o.value)}catch(w){console.warn(w.code),console.error(w)}setTimeout(()=>{d.value=!1},Math.min(2e3-(Date.now()-v),1))}},2e3);return{isLinkSignIn:n,isSignUp:u,email:_,password:o,isSubmitting:d,submitLogin:g}},$=P({__name:"LoginForm",props:{loginLinkActionUrl:{}},setup(m,{expose:t}){t();const{isLinkSignIn:s,isSignUp:e,email:a,password:u,isSubmitting:n,submitLogin:o}=Z(),d=f(!1),g=f(0),p=M(()=>g.value>9);h(n,()=>{!n.value&&s.value&&(d.value=!0,g.value+=1)}),h([a,e],()=>{d.value=!1}),h(p,()=>{s.value=!1});const v={isLinkSignIn:s,isSignUp:e,email:a,password:u,isSubmitting:n,submitLogin:o,isEmailSentMsg:d,countEmailsSent:g,isLinkSignInBlocked:p,get customerName(){return O}};return Object.defineProperty(v,"__isScriptSetup",{enumerable:!1,value:!0}),v}}),H={class:"text-base-600 mb-4 text-2xl font-light"},J={key:0},Q={key:1,class:"lowercase"},X={key:0,for:"login-form-email"},ee={class:"relative"},se=["disabled"],te={key:0,class:"text-success-800 absolute left-0 top-0 mt-4 font-medium"},ne=i("i",{class:"i-check mr-1"},null,-1);function ie(m,t,s,e,a,u){const n=C("Fade");return l(),c("form",{class:"text-base-800 w-full max-w-sm bg-white p-6 text-base md:p-8",onSubmit:t[4]||(t[4]=x(()=>e.submitLogin(s.loginLinkActionUrl),["prevent"]))},[F(m.$slots,"head"),i("p",H,[b(r("Olá")+" "),e.customerName?(l(),c("span",J,r(e.customerName),1)):(l(),c("span",Q,r("Visitante")))]),e.isLinkSignIn?(l(),c("label",X,r("Enviar link de acesso por e-mail"))):S("",!0),k(i("input",{id:"login-form-email",type:"email",placeholder:"email@mail.com","onUpdate:modelValue":t[0]||(t[0]=o=>e.email=o),class:"mb-0.5 mt-2 w-full",required:""},null,512),[[I,e.email]]),e.isLinkSignIn?S("",!0):k((l(),c("input",{key:1,type:"password",placeholder:"Senha","onUpdate:modelValue":t[1]||(t[1]=o=>e.password=o),class:"mb-0.5 mt-2 w-full lowercase",required:""},null,512)),[[I,e.password]]),i("div",ee,[i("div",{class:A(["transition-opacity",e.isEmailSentMsg&&"opacity-0 invisible"])},[k(i("a",{href:"?password",class:"text-base-500 ui-link text-right text-sm lowercase",onClick:t[2]||(t[2]=x(o=>e.isLinkSignIn=!e.isLinkSignIn,["prevent"]))},r(e.isLinkSignIn?"Entrar com senha":"Esqueci minha senha"),513),[[R,!e.isSignUp&&!e.isLinkSignInBlocked]]),i("button",{type:"submit",disabled:e.isSubmitting,class:A(["ui-btn-lg ui-btn-primary mb-2 mt-5 w-full",e.isSubmitting&&"opacity-50"])},r(e.isSignUp?"Cadastrar":"Acessar minha conta"),11,se)],2),L(n,{speed:"slow"},{default:U(()=>[e.isEmailSentMsg?(l(),c("p",te,[ne,b(" "+r("Te enviamos o e-mail, verifique sua caixa de entrada e spam se necessário."),1)])):S("",!0)]),_:1}),i("a",{href:"?sign_up",class:"ui-btn-lg ui-btn-contrast block w-full text-center",onClick:t[3]||(t[3]=x(o=>e.isSignUp=!e.isSignUp,["prevent"]))},r(e.isSignUp?"Acessar minha conta":"Criar uma conta"),1)])],32)}const ae=N($,[["render",ie]]),oe=P({__name:"AccountPage",setup(m,{expose:t}){t();let s=null;{const{location:a}=window,u=new URLSearchParams(a.search).get("return_url");if(!u){const n=new URL(a.toString());n.pathname="/app/",n.hash=`#${a.pathname.replace("/app/","/")}`,s=n.toString()}h(E,()=>{E.value&&(a.href=u||s)},{immediate:!0})}const e={get loginLinkActionUrl(){return s},set loginLinkActionUrl(a){s=a},LoginForm:ae};return Object.defineProperty(e,"__isScriptSetup",{enumerable:!1,value:!0}),e}}),re={class:"from-secondary-700 to-secondary-950 flex min-h-screen w-full flex-col justify-center bg-gradient-to-br"},le={class:"mx-auto p-4"},ce=i("section",{class:"ui-section text-center"},[i("a",{href:"/",class:"text-base-200 hover:text-white"},[i("i",{class:"i-arrow-right mr-1 rotate-180"}),b(" "+r("Ir para a loja"))])],-1),me={class:"overflow-hidden rounded-md shadow-md ring-4 ring-black/10"},ue={class:"mb-5 text-center"},de={href:"/",class:"inline-block"},pe={key:0,class:"ui-section px-0"},ge={class:"mx-auto flex max-w-sm flex-wrap items-center justify-evenly gap-4 px-3"};function _e(m,t,s,e,a,u){const n=C("ALink");return l(),c("article",re,[i("div",le,[ce,i("section",me,[L(e.LoginForm,T(V({loginLinkActionUrl:e.loginLinkActionUrl})),{head:U(()=>[i("div",ue,[i("a",de,[F(m.$slots,"logo")])])]),_:3},16)]),m.$settings.serviceLinks?.length?(l(),c("nav",pe,[i("ul",ge,[(l(!0),c(j,null,B(m.$settings.serviceLinks,({title:o,href:d},g)=>(l(),c("li",{key:`s-${g}`},[L(n,{href:d,class:"text-base-200 ui-link hover:text-white"},{default:U(()=>[b(r(o),1)]),_:2},1032,["href"])]))),128))])])):S("",!0)])])}const xe=N(oe,[["render",_e]]);export{xe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as v,w as f}from"./_plugin-vue_export-helper.3R8ooc_r.js";import{c as _,d as y,i as b,o as i,e as c,g as u,h as x,$ as C,l as g,f as t,a1 as o,a as S,a0 as h,F as I,k as w}from"./sf-utils.xmJHVMAX.js";import{f as F}from"./modules-info.C6KJuGeB.js";import{p as V,r as P,s as j,t as z}from"./shopping-cart.DGvCZWRZ.js";import{Q as A,C as L,S as q}from"./ShippingCalculator.B5JIh5xw.js";import{P as k}from"./Prices.D1uItqV5.js";import{n as B}from"./name.CIPngEFN.js";import{i as N}from"./img.CB-F9VLo.js";import"./afetch.DPLba2tr.js";import"./server-data.CUHTES8a.js";import"./format-money.vLicYTv9.js";import"./price.CHiL6Z1J.js";import"./customer-session.BAjMMoBA.js";import"./index.CTTHpJlV.js";import"./_commonjsHelpers.Cpj98o6Y.js";import"./i18n.BE5r_SIU.js";const E=a=>{const r=_(()=>!a.item&&a.product?V(a.product):null),s=_(()=>a.item||r.value),e=_(()=>B(s.value)),m=_(()=>{const{slug:n}=s.value;return typeof n=="string"?`/${n}`:null}),l=_(()=>{if(s.value.picture)return N(s.value.picture,void 0,a.pictureSize||"small")}),p=_(()=>s.value.final_price||s.value.price);return{cartItem:s,title:e,link:m,image:l,finalPrice:p}},Q=y({__name:"CartItem",props:{item:{},product:{},pictureSize:{}},setup(a,{expose:r}){r();const s=a,{cartItem:e,title:m,link:l,image:p,finalPrice:n}=E(s),d={props:s,cartItem:e,title:m,link:l,image:p,finalPrice:n,get removeCartItem(){return P},QuantitySelector:A,Prices:k};return Object.defineProperty(d,"__isScriptSetup",{enumerable:!1,value:!0}),d}}),M={class:"relative bg-white shadow-sm"},O={class:"text-base-700 group-hover:text-base-900 flex-auto py-2 text-sm group-hover:underline"},D=t("span",{class:"border-3 border-danger-700/30 text-danger-800 flex size-5 flex-col justify-center rounded-full text-sm leading-none"},[t("i",{class:"i-close mx-auto my-0"})],-1),R=[D],T={class:"border-base-100 flex items-center justify-between border-t-2"},U={class:"border-base-100 border-r-2"};function G(a,r,s,e,m,l){const p=b("AImg"),n=b("ALink");return i(),c("article",M,[u(n,{href:e.link,class:"group flex items-center gap-5 p-4"},{default:x(()=>[e.image?(i(),C(p,{key:0,picture:e.image,alt:e.title,class:"size-20 object-cover"},null,8,["picture","alt"])):g("",!0),t("p",O,o(e.title),1)]),_:1},8,["href"]),e.cartItem._id?(i(),c("button",{key:0,onClick:r[0]||(r[0]=f(d=>e.removeCartItem(e.cartItem._id),["stop"])),class:"absolute right-0 top-0 p-2 opacity-70 hover:opacity-100","aria-label":"Remover"},R)):g("",!0),t("div",T,[t("div",U,[u(e.QuantitySelector,{modelValue:e.cartItem.quantity,"onUpdate:modelValue":r[1]||(r[1]=d=>e.cartItem.quantity=d),min:e.cartItem.min_quantity,max:e.cartItem.max_quantity},null,8,["modelValue","min","max"])]),u(e.Prices,{"base-price":e.cartItem.base_price,price:e.finalPrice,"has-cashback":!1,"has-price-options":!1,class:"px-4 py-2.5 text-right text-[95%]"},null,8,["base-price","price"])])])}const H=v(Q,[["render",G]]),J=y({__name:"CartSidebar",emits:["close"],setup(a,{expose:r,emit:s}){r();const e=s,m=S(!1),l={emit:e,hasShippingCalculator:m,get freeShippingFromValue(){return F},get shoppingCart(){return j},get totalItems(){return z},CheckoutLink:L,Prices:k,CartItem:H,ShippingCalculator:q};return Object.defineProperty(l,"__isScriptSetup",{enumerable:!1,value:!0}),l}}),K={class:"flex h-screen flex-col bg-white"},W={class:"z-10 flex items-center justify-end gap-3 px-6 py-4 shadow ring-1 ring-black/5"},X=t("span",{class:"text-base-600 text-right text-base font-medium"},o("Meu carrinho de compras"),-1),Y={class:"min-w-[3rem] text-right"},Z={class:"ui-badge-pill-lg"},$={class:"bg-base-50 grow overflow-y-auto"},ee={key:0,class:"text-center text-sm"},te={key:0,class:"secondary-subtle p-3"},re=t("strong",{class:"lowercase"},o("Frete grátis"),-1),se={key:1,class:"bg-success-50 text-success-800 p-3"},ae=t("i",{class:"text-success-900 i-check mr-1"},null,-1),ie={class:"px-4 pb-2 pt-4"},oe={class:"z-10 px-5 pb-3 pt-4 ring-2 ring-black/5"},ne={class:"grid grid-cols-5 items-center gap-3 text-right"},ce=t("div",{class:"col-span-2"},o("Subtotal"),-1),le={key:0,class:"my-2.5 text-right"},me=t("i",{class:"i-truck text-base-500 ml-1"},null,-1),pe=t("i",{class:"i-check mr-2"},null,-1),de=t("i",{class:"i-arrow-right mr-1 rotate-180"},null,-1);function ue(a,r,s,e,m,l){const p=b("Fade");return i(),c("aside",K,[t("header",W,[X,t("span",Y,[t("span",Z,o(e.totalItems),1)])]),t("article",$,[e.freeShippingFromValue?(i(),c("div",ee,[e.freeShippingFromValue>e.shoppingCart.subtotal?(i(),c("div",te,[h(o("Adicione $1 para ganhar".replace("$1",a.$money(e.freeShippingFromValue-e.shoppingCart.subtotal)))+" ",1),re])):(i(),c("div",se,[ae,h(" "+o("Frete grátis a partir de")+" "+o(a.$money(e.freeShippingFromValue)),1)]))])):g("",!0),t("ul",ie,[(i(!0),c(I,null,w(e.shoppingCart.items,(n,d)=>(i(),c("li",{key:d},[u(e.CartItem,{item:n,class:"mb-3"},null,8,["item"])]))),128))])]),t("footer",oe,[t("div",ne,[ce,u(e.Prices,{price:e.shoppingCart.subtotal,class:"col-span-3 text-lg"},null,8,["price"])]),e.hasShippingCalculator?g("",!0):(i(),c("div",le,[t("a",{href:"#",class:"ui-link text-base-700 decoration-base-300",onClick:r[0]||(r[0]=f(n=>e.hasShippingCalculator=!0,["prevent","stop"]))},[h(o("Calcular frete")+" "),me])])),u(p,{slide:"down"},{default:x(()=>[e.hasShippingCalculator?(i(),C(e.ShippingCalculator,{key:0,"shipped-items":e.shoppingCart.items,class:"my-2.5 flex flex-wrap justify-end","can-auto-submit":""},null,8,["shipped-items"])):g("",!0)]),_:1}),u(e.CheckoutLink,{to:"checkout",class:"ui-btn-lg ui-btn-primary my-2.5 w-full text-right"},{default:x(()=>[pe,h(" "+o("Finalizar compra"))]),_:1}),t("a",{href:"#",onClick:r[1]||(r[1]=f(n=>e.emit("close"),["prevent"])),class:"text-base-500 ui-link hover:text-base-700 text-sm"},[de,h(" "+o("Continuar comprando"))])])])}const je=v(J,[["render",ue]]);export{je as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as d,d as w,i as x,o as r,e as l,g as c,h as o,Z as T,n as b,$ as v,a0 as y,a1 as f,a2 as B,l as m,a as C,T as H,j,f as _,F as L,k as z,a3 as N}from"./sf-utils.xmJHVMAX.js";import{_ as k,v as P}from"./_plugin-vue_export-helper.3R8ooc_r.js";import{p as g}from"./modules-info.C6KJuGeB.js";import"./afetch.DPLba2tr.js";import"./server-data.CUHTES8a.js";import"./format-money.vLicYTv9.js";import"./price.CHiL6Z1J.js";const V=s=>{const a=d(()=>s.title?g(s.title).value:""),t=d(()=>s.subtitle?g(s.subtitle).value:""),e=d(()=>s.buttonText?g(s.buttonText).value:""),i=d(()=>!!(a.value||t.value||e.value));return{parsedTitle:a,parsedSubtitle:t,parsedButtonText:e,hasHeader:i}},D=w({__name:"Banner",props:{img:{},alt:{},mobileImg:{},href:{},title:{},subtitle:{},buttonLink:{},buttonText:{},headingTag:{default:"h3"}},setup(s,{expose:a}){a();const t=s,{hasHeader:e,parsedTitle:i,parsedSubtitle:p,parsedButtonText:n}=V(t),u={props:t,hasHeader:e,parsedTitle:i,parsedSubtitle:p,parsedButtonText:n};return Object.defineProperty(u,"__isScriptSetup",{enumerable:!1,value:!0}),u}}),M={key:0,class:"mb-3 p-12 sm:mb-0 xl:ps-32"},A={key:1,class:"mt-4 text-lg md:mt-6"};function F(s,a,t,e,i,p){const n=x("ALink");return r(),l("div",{class:b(["mx-auto overflow-x-hidden",e.hasHeader?"grid grid-cols-1 sm:grid-cols-2 items-center":null])},[c(n,{href:t.href,class:b(e.hasHeader?"sm:order-last [&_img]:max-w-full sm:[&_img]:max-w-none [&_img]:aspect-video sm:[&_img]:aspect-[2.5] [&_img]:object-cover":"[&_img]:max-w-full")},{default:o(()=>[T(s.$slots,"picture")]),_:3},8,["href","class"]),e.hasHeader?(r(),l("div",M,[e.parsedTitle?(r(),v(B(t.headingTag),{key:0,class:"ui-title mt-1"},{default:o(()=>[y(f(e.parsedTitle),1)]),_:1})):m("",!0),e.parsedSubtitle?(r(),l("p",A,f(e.parsedSubtitle),1)):m("",!0),e.parsedButtonText?(r(),v(n,{key:2,href:t.buttonLink,class:"ui-btn-lg ui-btn-contrast mt-7 min-w-[150px] md:mt-10"},{default:o(()=>[y(f(e.parsedButtonText),1)]),_:1},8,["href"])):m("",!0)])):m("",!0)],2)}const O=k(D,[["render",F]]),E=w({__name:"HeroSlider",props:{autoplay:{},slides:{}},setup(s,{expose:a}){a();const t=C(!1);H(()=>{t.value=!0});const e={isMounted:t,Banner:O};return Object.defineProperty(e,"__isScriptSetup",{enumerable:!1,value:!0}),e}}),I={class:"relative mx-auto mb-9 md:mb-12"},Z={class:"absolute bottom-5 right-5 z-10 flex w-screen items-center justify-end xl:left-1/2 xl:right-auto xl:-ms-[640px] xl:max-w-screen-xl"},q=_("i",{class:"i-arrow-right rotate-180"},null,-1),G=_("i",{class:"i-arrow-right"},null,-1);function J(s,a,t,e,i,p){const n=x("CarouselControl"),u=x("Carousel");return r(),l("section",I,[c(u,{autoplay:t.autoplay,class:"secondary [&>*]:items-center"},{controls:o(()=>[j(_("div",Z,[_("div",{class:b(["text-primary relative h-10 w-20 rounded-full bg-white/50 shadow-sm ring-1 ring-black/5 transition-opacity",e.isMounted?"opacity-100":"opacity-20 [&>*]:cursor-wait"])},[c(n,{class:"hover:bg-primary/10 size-10 rounded-full","is-prev":""},{default:o(()=>[q]),_:1}),c(n,{class:"hover:bg-primary/10 size-10 rounded-full"},{default:o(()=>[G]),_:1})],2)],512),[[P,t.slides.length>1]])]),default:o(()=>[(r(!0),l(L,null,z(t.slides,(S,h)=>(r(),l("li",{key:h,class:"shrink-0 basis-full"},[c(e.Banner,N({...S,headingTag:h===0?"h2":"h3"},{class:"w-screen max-w-screen-2xl"}),{picture:o(()=>[T(s.$slots,`picture-${h}`)]),_:2},1040)]))),128))]),_:3},8,["autoplay"])])}const $=k(E,[["render",J]]);export{$ as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as m,d as C,e as n,f as h,g as l,h as d,i as u,o as i,j as x,F as b,k as g,n as k,l as S}from"./sf-utils.xmJHVMAX.js";import{_ as y,v as B}from"./_plugin-vue_export-helper.3R8ooc_r.js";import{p as V}from"./modules-info.C6KJuGeB.js";import{u as P}from"./use-cms-preview.CPGTKut8.js";import"./afetch.DPLba2tr.js";import"./server-data.CUHTES8a.js";import"./format-money.vLicYTv9.js";import"./price.CHiL6Z1J.js";const w=r=>{const{liveContent:a}=P(["layout","header","pitchBar"]),t=m(()=>(a.value||r.slides).map(({html:o})=>V(o).value.replace(/<\/?p>/g,"").replace(/<(\/?d-md)>/g,"<$1>"))),e=m(()=>t.value.filter(s=>s).length);return{parsedContents:t,countValidSlides:e}},L=C({__name:"PitchBar",props:{slides:{}},setup(r,{expose:a}){a();const t=r,{parsedContents:e,countValidSlides:s}=w(t),o={props:t,parsedContents:e,countValidSlides:s};return Object.defineProperty(o,"__isScriptSetup",{enumerable:!1,value:!0}),o}}),N={class:"bg-base-100 relative z-20"},j={class:"container mx-auto px-3 py-1 md:w-2/3"},z=["innerHTML"],A={class:"text-base-400 text-xl leading-none"};function F(r,a,t,e,s,o){const f=u("ALink"),_=u("CarouselControl"),v=u("Carousel");return i(),n("div",N,[h("div",j,[l(v,{autoplay:e.countValidSlides>1?7e3:void 0},{controls:d(()=>[x(h("div",A,[l(_,{class:"bg-base-100 hover:text-base-700 pr-2","is-prev":""}),l(_,{class:"bg-base-100 hover:text-base-700 pl-2"})],512),[[B,e.countValidSlides>1]])]),default:d(()=>[(i(!0),n(b,null,g(t.slides,(c,p)=>(i(),n("li",{key:p,class:"h-full shrink-0 basis-full text-center"},[l(f,{href:c.href,target:c.target,class:k(["inline-block px-8",c.href?"hover:underline":null])},{default:d(()=>[e.parsedContents[p]?(i(),n("span",{key:0,innerHTML:e.parsedContents[p],class:"text-base-800 prose text-sm"},null,8,z)):S("",!0)]),_:2},1032,["href","target","class"])]))),128))]),_:1},8,["autoplay"])])])}const I=y(L,[["render",F]]);export{I as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as T}from"./_plugin-vue_export-helper.3R8ooc_r.js";import{c as s,d as I,i as M,o as i,e as r,a1 as o,l,f as h,a0 as N,n as j,g as D,h as L}from"./sf-utils.xmJHVMAX.js";import{a as W,i as S,d as z,l as R}from"./modules-info.C6KJuGeB.js";import{p as g,o as E}from"./price.CHiL6Z1J.js";const me="Acima de",de="Marcas",_e="Categorias",he="Dias",ve="Desconto",Pe="Grátis",be="Frete grátis",fe="Maior preço",ye="Menor preço",pe="Nome",ge="Retire hoje",ke="Receba hoje",Ve="Produtos relacionados",Oe="Lançamentos",xe="Relevância",De="Vendas",Le="Até amanhã",Be="Até",Ne="Dias úteis",w=(a,c)=>{const{type:n,value:e}=c;let d;return e?(n==="percentage"?d=a*((100-e)/100):d=a-e,d>0?d:0):a},F=a=>{const c=s(()=>a.product||{price:a.price||0,base_price:a.basePrice}),n=s(()=>{const{variations:t}=c.value;if(t){const u=g(c.value);for(let P=0;P<t.length;P++)if(g({...c.value,...t[P]})>u)return!0}return!1}),e=s(()=>{const t=g(c.value),u=W.value;return u&&(!u.min_amount||t>u.min_amount)?w(t,u):t}),d=s(()=>{if(E(c.value))return c.value.base_price;const t=g(c.value);return t>e.value?t:0}),_=s(()=>a.installmentsOption||S.value||{max_number:1}),m=s(()=>{if(_.value.max_number<=1)return 1;const t=_.value.min_installment||5,u=Math.floor(e.value/t);return Math.min(u,_.value.max_number)}),b=s(()=>_.value.monthly_interest||0),k=s(()=>{if(m.value>=2){if(!b.value)return e.value/m.value;const t=b.value/100;return e.value*t/(1-(1+t)**-m.value)}return 0}),f=s(()=>{const t=a.discountOption||z.value;return t&&(!t.min_amount||t.min_amount<=e.value)&&(!a.isAmountTotal||t.apply_at==="total")?t:{}}),V=s(()=>{const{label:t}=f.value;return t?t.includes(" ")?t:`via ${t}`:""}),O=s(()=>w(e.value,f.value)),v=s(()=>{if(a.loyaltyPointsProgram)return a.loyaltyPointsProgram;const t=R.value;if(t){const u=Object.keys(t);for(let P=0;P<u.length;P++){const p=t[u[P]];if(p?.earn_percentage&&p.earn_percentage>0)return p}}return{ratio:0}}),y=s(()=>v.value.min_subtotal_to_earn||0),A=s(()=>v.value.name||""),B=s(()=>v.value.earn_percentage||0),x=s(()=>B.value*v.value.ratio),C=s(()=>x.value>=1?e.value*(x.value/100):0);return{hasVariedPrices:n,salePrice:e,comparePrice:d,installmentsObject:_,installmentsNumber:m,monthlyInterest:b,installmentValue:k,discountObject:f,discountLabel:V,priceWithDiscount:O,pointsProgramObject:v,pointsMinPrice:y,pointsProgramName:A,earnPointsPercentage:B,cashbackPercentage:x,cashbackValue:C}},q=I({__name:"Prices",props:{isBig:{type:Boolean},isLiteral:{type:Boolean},hasCashback:{type:Boolean,default:!0},hasPriceOptions:{type:Boolean,default:!0},product:{},price:{},basePrice:{},isAmountTotal:{type:Boolean},installmentsOption:{},discountOption:{},loyaltyPointsProgram:{}},setup(a,{expose:c}){c();const n=a,{hasVariedPrices:e,salePrice:d,comparePrice:_,cashbackPercentage:m,cashbackValue:b,installmentsNumber:k,monthlyInterest:f,installmentValue:V,priceWithDiscount:O,discountLabel:v}=F(n),y={props:n,hasVariedPrices:e,salePrice:d,comparePrice:_,cashbackPercentage:m,cashbackValue:b,installmentsNumber:k,monthlyInterest:f,installmentValue:V,priceWithDiscount:O,discountLabel:v};return Object.defineProperty(y,"__isScriptSetup",{enumerable:!1,value:!0}),y}}),G={key:0,class:"text-base-500 mr-1 text-[87%]"},U={key:0},H={key:1},J={key:0},K={key:0,class:"relative z-10"},Q=["data-tooltip"],X=h("i",{class:"i-arrow-uturn-left mr-1"},null,-1),Y={class:"font-medium"},Z=h("small",null," cashback",-1),$={key:0},ee={key:0},te={key:1},ae={key:2},ne={key:0},se={key:0},oe={key:1};function ie(a,c,n,e,d,_){const m=M("Fade");return i(),r("div",{class:j(["text-base-600 [&>div]:[font-size:90%] [&_small]:lowercase [&_small]:[font-size:92%]",n.isBig?"text-lg":null])},[e.comparePrice?(i(),r("span",G,[n.isLiteral?(i(),r("small",U,o("De "))):l("",!0),h("s",null,o(a.$money(e.comparePrice)),1),n.isLiteral?(i(),r("small",H,o(" Por"))):l("",!0)])):l("",!0),h("strong",{class:j(["text-base-800",n.isBig?"text-4xl block":"inline-block"])},[e.hasVariedPrices?(i(),r("small",J,o("A partir de "))):l("",!0),N(" "+o(a.$money(e.salePrice)),1)],2),D(m,{slide:"down"},{default:L(()=>[e.cashbackValue&&n.hasCashback?(i(),r("div",K,[h("span",{"data-tooltip":"Receba $1 de volta".replace("$1",a.$percentage(e.cashbackPercentage))},[X,h("span",Y,o(a.$money(e.cashbackValue)),1),Z],8,Q)])):l("",!0)]),_:1}),D(m,{slide:"down"},{default:L(()=>[e.installmentValue&&n.hasPriceOptions?(i(),r("div",$,[n.isLiteral?(i(),r("small",ee,o("Até "))):l("",!0),N(" "+o(e.installmentsNumber)+"x ",1),n.isLiteral?(i(),r("small",te,o(" De "))):l("",!0),h("span",null,o(a.$money(e.installmentValue)),1),!e.monthlyInterest&&n.isLiteral?(i(),r("small",ae,o(" Sem juros"))):l("",!0)])):l("",!0)]),_:1}),D(m,{slide:"down"},{default:L(()=>[e.priceWithDiscount<e.salePrice&&n.hasPriceOptions?(i(),r("div",ne,[e.discountLabel?l("",!0):(i(),r("small",se,o("A partir de "))),h("span",null,o(a.$money(e.priceWithDiscount)),1),e.discountLabel?(i(),r("small",oe,o(` ${e.discountLabel}`),1)):l("",!0)])):l("",!0)]),_:1})],2)}const je=T(q,[["render",ie]]);export{je as P,me as a,de as b,_e as c,xe as d,De as e,ye as f,fe as g,ve as h,Be as i,Oe as j,pe as k,Ne as l,he as m,Le as n,ge as o,ke as p,Pe as q,be as r,Ve as s};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{d as D,a as S,i as V,o as u,e as m,$ as I,h as A,f as v,l as b,F as w,k as P,n as z,g as k,aa as U,ab as H,Y as J,r as L,w as E,a8 as M,c as Q,a0 as B,a1 as C,ac as K,T as W,Z as X}from"./sf-utils.xmJHVMAX.js";import{_ as F,w as Y}from"./_plugin-vue_export-helper.3R8ooc_r.js";import{u as $}from"./index.BAyyMfaO.js";import{a as tt}from"./shopping-cart.DGvCZWRZ.js";import{u as et}from"./use-product-card.C-RbCwna.js";import{C as ot,Q as it,S as rt}from"./ShippingCalculator.B5JIh5xw.js";import{P as at}from"./Prices.D1uItqV5.js";import{_ as j}from"./customer-session.BAjMMoBA.js";import"./server-data.CUHTES8a.js";import{i as st}from"./img-sizes.rFK7so02.js";import"./index.CTTHpJlV.js";import{g as nt}from"./grid-title.CxNZApGL.js";import"./price.CHiL6Z1J.js";import"./use-analytics.BWhF_fCv.js";import"./afetch.DPLba2tr.js";import"./name.CIPngEFN.js";import"./i18n.BE5r_SIU.js";import"./img.CB-F9VLo.js";import"./_commonjsHelpers.Cpj98o6Y.js";import"./modules-info.C6KJuGeB.js";import"./format-money.vLicYTv9.js";const T=(a,n,l)=>{if(typeof a!="object"||a===null)return[];let t=[];if(typeof a=="object"&&a!==null)if(Array.isArray(a))a.length&&(a[0].specifications?a.forEach(e=>{t=t.concat(T(e,n,l))}):a[0].text&&(t=a));else{const{specifications:e}=a;if(e)for(const s in e)e[s]&&s===n&&(t=e[n]);if(t&&!t.length&&Array.isArray(l)&&l.length){let s,d;return l&&(d=l.find(i=>i.grid_id===n))&&d.options&&(s=d.options.map(i=>{let r;return i.colors&&i.colors.length?r=i.colors[0]:r=i.option_id,{text:i.text,value:r}})),T(s,n)}}return t},Z=(a,n,l,t=", ")=>{let e=T(a,n,l);if(e.length){let s=e[0].text;for(let d=1;d<e.length;d++)s+=t+e[d].text;return s}return null},lt=(a,n,l,t)=>{const e=T(a,l,t);for(let s=0;s<e.length;s++)if(e[s].text===n)return e[s].value},q=(a,n,l,t)=>{let e={};return a&&Array.isArray(a.variations)&&a.variations.forEach(s=>{if(l&&s.quantity<=0)return;let d=s.specifications,i=r=>Z(s,r,t);if(d){if(n){for(let r in n)if(n.hasOwnProperty(r)&&(!d[r]||i(r)!==n[r]))return}for(let r in d)if(d.hasOwnProperty(r)){let f=i(r);if(!e.hasOwnProperty(r))e[r]=[];else if(e[r].indexOf(f)!==-1)continue;e[r].push(f)}}}),e},ct=D({__name:"ImagesGallery",props:{pictures:{}},setup(a,{expose:n}){n();const l=S(0),t=S("");let e;const s=S(!1),i={activeIndex:l,psId:t,get lightbox(){return e},set lightbox(r){e=r},isLoadingLightbox:s,zoom:r=>{if(t.value=`ps-${H()}`,!e&&!s.value){s.value=!0;const f="photoswipe-style";Promise.all([j(()=>import("./photoswipe-lightbox.esm.BbYxSZIB.js"),__vite__mapDeps([])),j(()=>import("./photoswipe.esm.C0FT-EY-.js"),__vite__mapDeps([])),!document.getElementById(f)&&j(()=>import("./photoswipe.CNpEZKfy.js"),__vite__mapDeps([]))]).then(([{default:o},{default:c},h])=>{if(h){const{default:y}=h,g=document.createElement("style");g.id=f,g.textContent=y,document.head.appendChild(g)}e=new o({gallery:`#${t.value} > div`,children:"a",pswpModule:c,showAnimationDuration:300,hideAnimationDuration:300}),e.init(),e.loadAndOpen(r),s.value=!1})}},get getImgSizes(){return st}};return Object.defineProperty(i,"__isScriptSetup",{enumerable:!1,value:!0}),i}}),dt={class:"-mx-4 flex w-screen gap-3 sm:mx-0 sm:w-full md:h-[525px] 2xl:gap-5"},ut=["onClick"],mt=v("span",{class:"absolute bottom-0 block h-2 w-full bg-gradient-to-b from-transparent to-white"},null,-1),ft={class:"relative aspect-square h-full grow md:aspect-auto"},pt={key:0,class:"bg-base-200 i-arrow-path absolute left-1/2 top-1/2 -ml-7 -mt-7 size-14 animate-spin","aria-label":"Carregando"},gt={key:1,class:"mt-2 flex justify-center gap-1.5 md:hidden"},ht=["aria-label","onClick"];function _t(a,n,l,t,e,s){const d=V("AImg"),i=V("CarouselControl"),r=V("Carousel"),f=V("ALink");return u(),m("div",dt,[l.pictures.length>1?(u(),I(r,{key:0,axis:"y",class:"group hidden w-[300px] shrink-0 md:block"},{controls:A(()=>[v("span",null,[l.pictures.length>6?(u(),I(i,{key:0,class:"text-primary hover:bg-primary-300/60 !bottom-3 !left-1/2 -ml-5 size-10 rounded-full bg-white/60 text-xl opacity-0 shadow-sm ring-1 ring-black/5 group-hover:opacity-90"})):b("",!0),mt])]),default:A(()=>[(u(!0),m(w,null,P(Math.ceil(l.pictures.length/2),o=>(u(),m("li",{key:o,class:z(["grid w-full grid-cols-2 gap-3 px-1 pb-3",o===1&&"pt-1"])},[(u(!0),m(w,null,P([1,2].map(c=>(o-1)*2+(c-1)),c=>(u(),m(w,{key:`${o}-${c}`},[c<l.pictures.length?(u(),m("button",{key:0,class:"bg-secondary-100 block rounded md:h-[175px]",onClick:h=>t.activeIndex=c},[k(d,{picture:l.pictures[c],class:z(["ring-secondary/10 size-full rounded border-2 object-cover opacity-90 transition-colors",c===t.activeIndex?"border-secondary/50 ring-4 cursor-auto":"border-transparent hover:border-primary hover:ring-4 hover:ring-primary/20"])},null,8,["picture","class"])],8,ut)):b("",!0)],64))),128))],2))),128))]),_:1})):b("",!0),v("div",ft,[k(r,{as:"div",index:t.activeIndex,"onUpdate:index":n[1]||(n[1]=o=>t.activeIndex=o),class:z(["text-base-600 [&_i]:i-arrow-right mx-auto size-full max-w-[525px] [&>*]:h-full [&_i]:mx-2 [&_i]:text-2xl",t.isLoadingLightbox&&"opacity-80"]),id:t.psId},{default:A(()=>[n[0]||(U(-1),n[0]=(u(!0),m(w,null,P(l.pictures,(o,c)=>(u(),I(f,{key:`big-${c}`,href:o.zoom?.size&&o.zoom.url,"data-pswp-width":t.getImgSizes(o.zoom||"").width,"data-pswp-height":t.getImgSizes(o.zoom||"").height,target:"_blank",rel:"noreferrer",class:z(["shrink-0 basis-full",o.zoom?.size&&"cursor-zoom-in"]),onClick:Y(()=>o.zoom?.size&&t.zoom(c),["prevent"])},{default:A(()=>[k(d,{picture:o,"preferred-size":"big",class:"size-full rounded object-cover",fetchpriority:c===0?"high":"low",loading:c===0?"eager":"lazy"},null,8,["picture","fetchpriority","loading"])]),_:2},1032,["href","data-pswp-width","data-pswp-height","class","onClick"]))),128)),U(1),n[0])]),_:1},8,["index","class","id"]),t.isLoadingLightbox?(u(),m("i",pt)):b("",!0),l.pictures.length>1?(u(),m("ul",gt,[(u(!0),m(w,null,P(l.pictures.length,o=>(u(),m("li",{key:`d-${o}`},[v("button",{class:z(["bg-base-700 block h-1.5 w-3 rounded-full",t.activeIndex!==o-1&&"opacity-40"]),"aria-label":`Imagem ${o}`,onClick:c=>t.activeIndex=o-1},null,10,ht)]))),128))])):b("",!0)])])}const vt=F(ct,[["render",_t]]),yt=a=>{const n=J(a.grids||globalThis.$storefront.data.grids||[]);n.length||window.addEventListener("storefront:data:data",()=>{globalThis.$storefront.data.grids?.forEach(o=>n.push(o))},{once:!0});const l=L({}),t=L({});E(M(a,"variations"),()=>{Object.assign(t,q(a,void 0,!0));const o=q(a);Object.keys(o).forEach(c=>{t[c]?l[c]=t[c]:delete l[c]})},{immediate:!0});const e=Q(()=>Object.keys(l)),s=L({}),d=S(),i=({optionText:o,gridId:c,gridIndex:h})=>{s[c]=o;const y={};for(let p=0;p<=h;p++){const _=e[p];s[_]&&(y[_]=s[_])}const g=q(a,y,!0);for(let p=h+1;p<e.value.length;p++){const _=e[p],O=g[_];t[_]=O,s[_]&&!O.includes(s[_])&&delete s[_]}const x=a.variations.slice(0);for(let p=0;p<x.length;p++){const _=x[p],{specifications:O}=_,R=Object.keys(O);for(let G=0;G<R.length;G++){const N=R[G];if(s[N]!==Z(_,N)){x.splice(p,1),p-=1;break}}}d.value=x[0]?._id||null};return E(M(a,"variationId"),o=>{if(!o||o===d.value)return;const c=a.variations.find(x=>x._id===o);if(!c){d.value=null;return}const{specifications:h}=c,y=Object.keys(h),g=(x=0)=>{const p=y[x];if(y[x]&&h[p]&&h[p].length===1){const _=h[p][0].text;l[p].find(O=>O===_)&&(i({optionText:_,gridId:p,gridIndex:e.value.indexOf(p)}),g(x+1))}};g()},{immediate:!0}),{grids:n,variationsGrids:l,activeVariationsGrids:t,selectOption:i,selectedOptions:s,variationId:d,getGridTitle:o=>nt(o,n),getColorOptionBg:o=>{const c=o.split(",").map(h=>lt(a.variations,h.trim(),"colors"));return c.length>1?`background:linear-gradient(to right bottom, ${c[0]} 50%, ${c[1]} 50%)`:`background:${c[0]}`}}},bt=D({__name:"SkuSelector",props:{variations:{},variationId:{},grids:{}},emits:["update:variationId"],setup(a,{expose:n,emit:l}){n();const t=a,e=l,{variationsGrids:s,activeVariationsGrids:d,selectOption:i,selectedOptions:r,variationId:f,getGridTitle:o,getColorOptionBg:c}=yt(t);E(f,y=>{e("update:variationId",y)});const h={props:t,emit:e,variationsGrids:s,activeVariationsGrids:d,selectOption:i,selectedOptions:r,variationId:f,getGridTitle:o,getColorOptionBg:c};return Object.defineProperty(h,"__isScriptSetup",{enumerable:!1,value:!0}),h}}),xt={class:"text-base-700 text-sm font-medium"},kt={key:0,class:"text-base-800"},wt={key:0,class:"mt-2 flex gap-2"},Ct=["onClick"];function St(a,n,l,t,e,s){return u(),m("div",null,[(u(!0),m(w,null,P(t.variationsGrids,(d,i)=>(u(),m("div",{key:i,class:"mt-3"},[v("span",xt,[B(C(t.getGridTitle(i))+": ",1),t.selectedOptions[i]?(u(),m("strong",kt,C(t.selectedOptions[i]),1)):b("",!0)]),d.length<7?(u(),m("ul",wt,[(u(!0),m(w,null,P(d,(r,f)=>(u(),m("li",{key:`${i}-${f}`},[v("button",{class:z(["ring-primary/60 rounded border",[t.selectedOptions[i]===r?"border-primary ring-2":null,i==="colors"?"size-9 text-[0px]":"px-2.5 py-2 leading-none",t.activeVariationsGrids[i].includes(r)?"border-primary-400 bg-primary-100 text-primary-950":"border-primary-300 bg-primary-200 text-primary-600"]]),style:K(i==="colors"&&t.getColorOptionBg(r)),onClick:o=>t.selectOption({optionText:r,gridId:i,gridIndex:f})},C(r),15,Ct)]))),128))])):b("",!0)]))),128))])}const Ot=F(bt,[["render",St]]),zt=D({__name:"ProductDetails",props:{product:{default:()=>globalThis.$storefront.apiContext?.doc},cmsPreview:{}},setup(a,{expose:n}){n();const l=a,{product:t,title:e,isActive:s}=et(l),d=S(t.min_quantity||1),i=$("history"),r=S(!1),f=S(null);E(f,g=>{g&&(i.var=g,r.value=!1)}),W(()=>{E(i,({var:g})=>{typeof g=="string"&&g&&(f.value=g)},{immediate:!0})});const o=Q(()=>!!(!t.variations?.length||f.value)),c=g=>(o.value?r.value=!1:(g&&g.preventDefault(),r.value=!0),!r.value),y={props:l,product:t,title:e,isActive:s,quantity:d,params:i,hasSkuSelectionAlert:r,variationId:f,isSkuSelected:o,checkVariation:c,addToCart:()=>{c()&&tt(t,f.value||void 0,d.value)},CheckoutLink:ot,QuantitySelector:it,Prices:at,ImagesGallery:vt,SkuSelector:Ot,ShippingCalculator:rt};return Object.defineProperty(y,"__isScriptSetup",{enumerable:!1,value:!0}),y}}),At={class:"relative grid grid-cols-1 items-start gap-x-5 ui-section lg:grid-cols-4 lg:gap-x-4 2xl:gap-x-6"},Pt={class:"w-full lg:col-span-3"},Vt={class:"top-0 pt-4 transition-transform lg:sticky lg:pb-4 lg:sticky-header:translate-y-14"},It={class:"text-lg text-secondary-900 ui-text-brand"},Et={key:0,class:"mt-5"},Tt={key:0,class:"inline-block ui-alert"},Gt=v("i",{class:"ml-1 -rotate-90 i-arrow-right"},null,-1),Lt={class:"mt-5 flex flex-wrap items-center gap-x-4 gap-y-2 md:flex-nowrap lg:mt-4 lg:flex-wrap"},jt=v("i",{class:"mr-1 i-chevron-double-right"},null,-1),qt=["data-tooltip"],Bt={class:"mt-6 rounded border-2 border-base-50 border-t-base-100 p-4 lg:mt-4"},Dt={class:"w-full lg:col-span-3"};function Ft(a,n,l,t,e,s){const d=V("Fade");return u(),m("section",At,[v("div",Pt,[t.product.pictures?.length?(u(),I(t.ImagesGallery,{key:0,pictures:t.product.pictures,class:"mb-5"},null,8,["pictures"])):b("",!0)]),v("div",Vt,[v("h1",It,C(t.title),1),t.isActive?(u(),m("div",Et,[k(t.Prices,{product:t.product,"is-big":"","is-literal":""},null,8,["product"]),t.product.variations?(u(),I(t.SkuSelector,{key:0,variations:t.product.variations,"variation-id":t.variationId,"onUpdate:variationId":n[0]||(n[0]=i=>t.variationId=i),class:"my-4"},null,8,["variations","variation-id"])):b("",!0),k(d,{slide:"down"},{default:A(()=>[t.hasSkuSelectionAlert?(u(),m("div",Tt,[B(C("Por favor selecione uma opção em cada campo acima")+" "),Gt])):b("",!0)]),_:1}),v("div",Lt,[k(t.QuantitySelector,{modelValue:t.quantity,"onUpdate:modelValue":n[1]||(n[1]=i=>t.quantity=i),min:t.product.min_quantity,max:t.product.quantity,class:"rounded border-base-100 md:mr-5 lg:mb-2 lg:mr-auto lg:border-2"},null,8,["modelValue","min","max"]),k(t.CheckoutLink,{class:"grow text-center ui-btn-lg ui-btn-primary",to:"checkout","cart-item":{product_id:t.product._id,quantity:t.quantity,variation_id:t.variationId||void 0},"data-tooltip":t.isSkuSelected?null:"Escolha os detalhes do produto para comprar",onClick:t.checkVariation},{default:A(()=>[jt,B(" "+C("Comprar"))]),_:1},8,["cart-item","data-tooltip"]),v("button",{class:"grow ui-btn-lg ui-btn-contrast",onClick:Y(t.addToCart,["prevent"]),"data-tooltip":t.isSkuSelected?null:"Escolha os detalhes do produto para comprar"},C("Adicionar ao carrinho"),8,qt)]),v("div",Bt,[k(t.ShippingCalculator,{"shipped-items":[{...t.product,quantity:t.quantity}],"has-label":""},null,8,["shipped-items"])])])):b("",!0)]),v("div",Dt,[X(a.$slots,"description")])])}const le=F(zt,[["render",Ft]]);export{le as default};
|
|
2
|
-
function __vite__mapDeps(indexes) {
|
|
3
|
-
if (!__vite__mapDeps.viteFileDeps) {
|
|
4
|
-
__vite__mapDeps.viteFileDeps = []
|
|
5
|
-
}
|
|
6
|
-
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
|
|
7
|
-
}
|