cloudcommerce 0.0.67 → 0.0.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/package.json +1 -1
  3. package/packages/api/lib/api.js +8 -8
  4. package/packages/api/lib/api.js.map +1 -1
  5. package/packages/api/package.json +1 -1
  6. package/packages/api/src/api.ts +8 -8
  7. package/packages/apps/correios/package.json +3 -3
  8. package/packages/apps/custom-shipping/package.json +3 -3
  9. package/packages/apps/discounts/package.json +1 -1
  10. package/packages/apps/tiny-erp/package.json +1 -1
  11. package/packages/cli/config/firebase.json +6 -6
  12. package/packages/cli/package.json +1 -1
  13. package/packages/config/lib/config.js +4 -1
  14. package/packages/config/lib/config.js.map +1 -1
  15. package/packages/config/lib/env.js +4 -1
  16. package/packages/config/lib/env.js.map +1 -1
  17. package/packages/config/package.json +1 -1
  18. package/packages/config/src/config.ts +7 -3
  19. package/packages/config/src/env.ts +4 -1
  20. package/packages/events/package.json +1 -1
  21. package/packages/firebase/package.json +1 -1
  22. package/packages/modules/package.json +1 -1
  23. package/packages/passport/package.json +1 -1
  24. package/packages/ssr/lib/firebase/serve-storefront.js +67 -0
  25. package/packages/ssr/lib/firebase/serve-storefront.js.map +1 -0
  26. package/packages/ssr/lib/firebase.js +4 -3
  27. package/packages/ssr/lib/firebase.js.map +1 -1
  28. package/packages/ssr/lib/index.js +3 -0
  29. package/packages/ssr/lib/index.js.map +1 -1
  30. package/packages/ssr/package.json +1 -2
  31. package/packages/ssr/src/firebase/serve-storefront.ts +78 -0
  32. package/packages/ssr/src/firebase.ts +4 -3
  33. package/packages/ssr/src/index.ts +3 -0
  34. package/packages/storefront/astro.config.mjs +5 -0
  35. package/packages/storefront/dist/client/assets/{_...d4aa8aff.css → 404-_...d4aa8aff.css} +0 -0
  36. package/packages/storefront/dist/client/assets/404-index.d9230d24.css +1 -0
  37. package/packages/storefront/dist/client/assets/{_...0b5ebd52.css → 404.530428e5.css} +1 -1
  38. package/packages/storefront/dist/client/assets/_...98510c96.css +1 -0
  39. package/packages/storefront/dist/client/assets/index.53a3a3e0.css +1 -0
  40. package/packages/storefront/dist/server/entry.mjs +275 -135
  41. package/packages/storefront/example.env +2 -0
  42. package/packages/storefront/package.json +8 -2
  43. package/packages/storefront/src/layouts/Layout.astro +7 -0
  44. package/packages/storefront/src/pages/404.astro +74 -0
  45. package/packages/storefront/src/pages/[...slug].astro +11 -5
  46. package/packages/{ssr/src/firebase/.gitkeep → storefront/src/pages/app/index.astro} +0 -0
  47. package/packages/storefront/src/pages/index.astro +2 -2
  48. package/packages/storefront/src/types.ts +18 -0
  49. package/packages/storefront/storefront.config.mjs +41 -0
  50. package/packages/types/package.json +1 -1
  51. package/turbo.json +6 -0
  52. package/packages/storefront/content/blog.json +0 -18
  53. package/packages/storefront/content/brands.json +0 -24
  54. package/packages/storefront/content/categories.json +0 -24
  55. package/packages/storefront/content/code.json +0 -5
  56. package/packages/storefront/content/collections.json +0 -24
  57. package/packages/storefront/content/contacts.json +0 -13
  58. package/packages/storefront/content/footer.json +0 -46
  59. package/packages/storefront/content/header.json +0 -27
  60. package/packages/storefront/content/home.json +0 -45
  61. package/packages/storefront/content/info.json +0 -18
  62. package/packages/storefront/content/maintenance.json +0 -6
  63. package/packages/storefront/content/menu.json +0 -6
  64. package/packages/storefront/content/pages/contato.json +0 -6
  65. package/packages/storefront/content/pages/entrega.json +0 -6
  66. package/packages/storefront/content/pages/faq.json +0 -6
  67. package/packages/storefront/content/pages/pagamentos.json +0 -6
  68. package/packages/storefront/content/pages/privacidade.json +0 -6
  69. package/packages/storefront/content/pages/sobre-nos.json +0 -6
  70. package/packages/storefront/content/pages/termos.json +0 -6
  71. package/packages/storefront/content/pages/trocas.json +0 -6
  72. package/packages/storefront/content/posts/esta-loja-e-um-pwa.json +0 -9
  73. package/packages/storefront/content/products.json +0 -32
  74. package/packages/storefront/content/search.json +0 -8
  75. package/packages/storefront/content/settings.json +0 -25
  76. package/packages/storefront/content/social.json +0 -5
  77. package/packages/storefront/content/widgets/analytics.json +0 -11
  78. package/packages/storefront/content/widgets/compre-confie.json +0 -11
  79. package/packages/storefront/content/widgets/ebit.json +0 -11
  80. package/packages/storefront/content/widgets/fb-pixel.json +0 -12
  81. package/packages/storefront/content/widgets/gmc-ratings.json +0 -12
  82. package/packages/storefront/content/widgets/minicart.json +0 -6
  83. package/packages/storefront/content/widgets/offers-notification.json +0 -11
  84. package/packages/storefront/content/widgets/opinioes-verificadas.json +0 -18
  85. package/packages/storefront/content/widgets/product-card.json +0 -10
  86. package/packages/storefront/content/widgets/product.json +0 -13
  87. package/packages/storefront/content/widgets/search-engine.json +0 -8
  88. package/packages/storefront/content/widgets/search.json +0 -6
  89. package/packages/storefront/content/widgets/tag-manager.json +0 -12
  90. package/packages/storefront/content/widgets/tawkto.json +0 -12
  91. package/packages/storefront/content/widgets/trustvox.json +0 -15
  92. package/packages/storefront/content/widgets/user.json +0 -5
  93. package/packages/storefront/dist/client/assets/index.5608ba47.css +0 -1
  94. package/packages/storefront/src/storefront-config.ts +0 -28
@@ -3,9 +3,10 @@ import '@cloudcommerce/firebase/lib/init';
3
3
  // eslint-disable-next-line import/no-unresolved
4
4
  import { onRequest } from 'firebase-functions/v2/https';
5
5
  import config from '@cloudcommerce/firebase/lib/config';
6
+ import serveStorefront from './firebase/serve-storefront';
6
7
 
7
- const options = config.get().httpsFunctionOptions;
8
+ const { httpsFunctionOptions } = config.get();
8
9
 
9
- export const ssr = onRequest(options, (request, response) => {
10
- response.send('<h1>Hello SSR!</h1>');
10
+ export const ssr = onRequest(httpsFunctionOptions, (req, res) => {
11
+ serveStorefront(req, res);
11
12
  });
@@ -0,0 +1,3 @@
1
+ import serveStorefront from './firebase/serve-storefront';
2
+
3
+ export default serveStorefront;
@@ -1,3 +1,4 @@
1
+ import * as dotenv from 'dotenv';
1
2
  // https://github.com/import-js/eslint-plugin-import/issues/1810
2
3
  /* eslint-disable import/no-unresolved */
3
4
  import { defineConfig } from 'astro/config';
@@ -6,6 +7,9 @@ import vue from '@astrojs/vue';
6
7
  import partytown from '@astrojs/partytown';
7
8
  import prefetch from '@astrojs/prefetch';
8
9
  import sitemap from '@astrojs/sitemap';
10
+ import getConfig from './storefront.config.mjs';
11
+
12
+ dotenv.config();
9
13
 
10
14
  // https://astro.build/config
11
15
  export default defineConfig({
@@ -17,4 +21,5 @@ export default defineConfig({
17
21
  prefetch(),
18
22
  sitemap(),
19
23
  ],
24
+ site: `https://${getConfig().domain}`,
20
25
  });
@@ -0,0 +1 @@
1
+ :root{--link-gradient: linear-gradient(45deg, #4F39FA, #DA62C4 30%, var(--color-border) 60%)}.link-card:where(.astro-ASCHB54V){list-style:none;display:flex;padding:.15rem;background-image:var(--link-gradient);background-size:400%;border-radius:.5rem;background-position:100%;transition:background-position .6s cubic-bezier(.22,1,.36,1)}.link-card:where(.astro-ASCHB54V)>a:where(.astro-ASCHB54V){width:100%;text-decoration:none;line-height:1.4;padding:1em 1.3em;border-radius:.35rem;color:var(--text-color);background-color:#fff;opacity:.8}h2:where(.astro-ASCHB54V){margin:0;transition:color .6s cubic-bezier(.22,1,.36,1)}p:where(.astro-ASCHB54V){margin-top:.75rem;margin-bottom:0}h2:where(.astro-ASCHB54V) span:where(.astro-ASCHB54V){display:inline-block;transition:transform .3s cubic-bezier(.22,1,.36,1)}.link-card:where(.astro-ASCHB54V):is(:hover,:focus-within){background-position:0}.link-card:where(.astro-ASCHB54V):is(:hover,:focus-within) h2:where(.astro-ASCHB54V){color:#4f39fa}.link-card:where(.astro-ASCHB54V):is(:hover,:focus-within) h2:where(.astro-ASCHB54V) span:where(.astro-ASCHB54V){transform:translate(2px)}
@@ -1 +1 @@
1
- :root{--astro-gradient: linear-gradient(0deg,#4F39FA, #DA62C4)}h1:where(.astro-QB6KRBZ4){margin:2rem 0}main:where(.astro-QB6KRBZ4){margin:auto;padding:1em;max-width:60ch}.text-gradient:where(.astro-QB6KRBZ4){font-weight:900;background-image:var(--astro-gradient);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-size:100% 200%;background-position-y:100%;border-radius:.4rem;animation:pulse 4s ease-in-out infinite}@keyframes pulse{0%,to{background-position-y:0%}50%{background-position-y:80%}}.instructions:where(.astro-QB6KRBZ4){line-height:1.6;margin:1rem 0;background:#4F39FA;padding:1rem;border-radius:.4rem;color:var(--color-bg)}.instructions:where(.astro-QB6KRBZ4) code:where(.astro-QB6KRBZ4){font-size:.875em;border:.1em solid var(--color-border);border-radius:4px;padding:.15em .25em}.link-card-grid:where(.astro-QB6KRBZ4){display:grid;grid-template-columns:repeat(auto-fit,minmax(24ch,1fr));gap:1rem;padding:0}
1
+ :root{--astro-gradient: linear-gradient(0deg,#4F39FA, #DA62C4)}h1:where(.astro-7FYMG5AV){margin:2rem 0}main:where(.astro-7FYMG5AV){margin:auto;padding:1em;max-width:60ch}.text-gradient:where(.astro-7FYMG5AV){font-weight:900;background-image:var(--astro-gradient);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-size:100% 200%;background-position-y:100%;border-radius:.4rem;animation:pulse 4s ease-in-out infinite}@keyframes pulse{0%,to{background-position-y:0%}50%{background-position-y:80%}}.instructions:where(.astro-7FYMG5AV){line-height:1.6;margin:1rem 0;background:#4F39FA;padding:1rem;border-radius:.4rem;color:var(--color-bg)}.instructions:where(.astro-7FYMG5AV) code:where(.astro-7FYMG5AV){font-size:.875em;border:.1em solid var(--color-border);border-radius:4px;padding:.15em .25em}.link-card-grid:where(.astro-7FYMG5AV){display:grid;grid-template-columns:repeat(auto-fit,minmax(24ch,1fr));gap:1rem;padding:0}
@@ -0,0 +1 @@
1
+ :root{--astro-gradient: linear-gradient(0deg,#4F39FA, #DA62C4)}h1:where(.astro-WWHJ5KDF){margin:2rem 0}main:where(.astro-WWHJ5KDF){margin:auto;padding:1em;max-width:60ch}.text-gradient:where(.astro-WWHJ5KDF){font-weight:900;background-image:var(--astro-gradient);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-size:100% 200%;background-position-y:100%;border-radius:.4rem;animation:pulse 4s ease-in-out infinite}@keyframes pulse{0%,to{background-position-y:0%}50%{background-position-y:80%}}.instructions:where(.astro-WWHJ5KDF){line-height:1.6;margin:1rem 0;background:#4F39FA;padding:1rem;border-radius:.4rem;color:var(--color-bg)}.instructions:where(.astro-WWHJ5KDF) code:where(.astro-WWHJ5KDF){font-size:.875em;border:.1em solid var(--color-border);border-radius:4px;padding:.15em .25em}.link-card-grid:where(.astro-WWHJ5KDF){display:grid;grid-template-columns:repeat(auto-fit,minmax(24ch,1fr));gap:1rem;padding:0}
@@ -0,0 +1 @@
1
+ :root{--astro-gradient: linear-gradient(0deg,#4F39FA, #DA62C4)}h1:where(.astro-C3E44E3K){margin:2rem 0}main:where(.astro-C3E44E3K){margin:auto;padding:1em;max-width:60ch}.text-gradient:where(.astro-C3E44E3K){font-weight:900;background-image:var(--astro-gradient);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-size:100% 200%;background-position-y:100%;border-radius:.4rem;animation:pulse 4s ease-in-out infinite}@keyframes pulse{0%,to{background-position-y:0%}50%{background-position-y:80%}}.instructions:where(.astro-C3E44E3K){line-height:1.6;margin:1rem 0;background:#4F39FA;padding:1rem;border-radius:.4rem;color:var(--color-bg)}.instructions:where(.astro-C3E44E3K) code:where(.astro-C3E44E3K){font-size:.875em;border:.1em solid var(--color-border);border-radius:4px;padding:.15em .25em}.link-card-grid:where(.astro-C3E44E3K){display:grid;grid-template-columns:repeat(auto-fit,minmax(24ch,1fr));gap:1rem;padding:0}
@@ -2,7 +2,11 @@ import * as adapter from '@astrojs/node/server.js';
2
2
  import { defineComponent, h, createSSRApp } from 'vue';
3
3
  import { renderToString as renderToString$1 } from 'vue/server-renderer';
4
4
  import { escape } from 'html-escaper';
5
- /* empty css *//* empty css *//* empty css */import 'mime';
5
+ /* empty css *//* empty css */import { fileURLToPath } from 'url';
6
+ import { readFileSync } from 'fs';
7
+ import { resolve } from 'path';
8
+ import Deepmerge from '@fastify/deepmerge';
9
+ /* empty css *//* empty css *//* empty css */import 'mime';
6
10
  import 'kleur/colors';
7
11
  import 'string-width';
8
12
  import 'path-browserify';
@@ -1262,120 +1266,10 @@ var server_default = {
1262
1266
  renderToStaticMarkup
1263
1267
  };
1264
1268
 
1265
- const $$metadata$3 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/Layout.astro", { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
1266
- const $$Astro$3 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/Layout.astro", "", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1267
- const $$Layout = createComponent(async ($$result, $$props, $$slots) => {
1268
- const Astro2 = $$result.createAstro($$Astro$3, $$props, $$slots);
1269
- Astro2.self = $$Layout;
1270
- const { title } = Astro2.props;
1271
- const STYLES = [];
1272
- for (const STYLE of STYLES)
1273
- $$result.styles.add(STYLE);
1274
- return renderTemplate`<html lang="en" class="astro-ZMK4NUBX">
1275
- <head>
1276
- <meta charset="UTF-8">
1277
- <meta name="viewport" content="width=device-width">
1278
- <link rel="icon" type="image/x-icon" href="/favicon.ico">
1279
- <title>${title}</title>
1280
- ${renderHead($$result)}</head>
1281
- <body class="astro-ZMK4NUBX">
1282
- ${renderSlot($$result, $$slots["default"])}
1283
-
1284
- </body></html>`;
1285
- });
1286
-
1287
- const $$file$3 = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/Layout.astro";
1288
- const $$url$3 = undefined;
1289
-
1290
- const $$module2$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1291
- __proto__: null,
1292
- $$metadata: $$metadata$3,
1293
- default: $$Layout,
1294
- file: $$file$3,
1295
- url: $$url$3
1296
- }, Symbol.toStringTag, { value: 'Module' }));
1297
-
1298
- const $$metadata$2 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/Card.astro", { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
1299
- const $$Astro$2 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/Card.astro", "", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1300
- const $$Card = createComponent(async ($$result, $$props, $$slots) => {
1301
- const Astro2 = $$result.createAstro($$Astro$2, $$props, $$slots);
1302
- Astro2.self = $$Card;
1303
- const { href, title, body } = Astro2.props;
1304
- const STYLES = [];
1305
- for (const STYLE of STYLES)
1306
- $$result.styles.add(STYLE);
1307
- return renderTemplate`${maybeRenderHead($$result)}<li class="link-card astro-ASCHB54V">
1308
- <a${addAttribute(href, "href")} class="astro-ASCHB54V">
1309
- <h2 class="astro-ASCHB54V">
1310
- ${title}
1311
- <span class="astro-ASCHB54V">&rarr;</span>
1312
- </h2>
1313
- <p class="astro-ASCHB54V">
1314
- ${body}
1315
- </p>
1316
- </a>
1317
- </li>
1318
- `;
1319
- });
1320
-
1321
- const $$file$2 = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/Card.astro";
1322
- const $$url$2 = undefined;
1323
-
1324
- const $$module2 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1325
- __proto__: null,
1326
- $$metadata: $$metadata$2,
1327
- default: $$Card,
1328
- file: $$file$2,
1329
- url: $$url$2
1330
- }, Symbol.toStringTag, { value: 'Module' }));
1331
-
1332
- const $$metadata$1 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/index.astro", { modules: [{ module: $$module2$1, specifier: "../layouts/Layout.astro", assert: {} }, { module: $$module2, specifier: "../components/Card.astro", assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
1333
- const $$Astro$1 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/index.astro", "", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1334
- const $$Index = createComponent(async ($$result, $$props, $$slots) => {
1335
- const Astro2 = $$result.createAstro($$Astro$1, $$props, $$slots);
1336
- Astro2.self = $$Index;
1337
- const fetchingProducts = await fetch("https://ecomplus.io/v2/:1056/products");
1338
- const products = (await fetchingProducts.json()).result;
1339
- const STYLES = [];
1340
- for (const STYLE of STYLES)
1341
- $$result.styles.add(STYLE);
1342
- return renderTemplate`${renderComponent($$result, "Layout", $$Layout, { "title": "Welcome to Astro.", "class": "astro-2COIDAMR" }, { "default": () => renderTemplate`${maybeRenderHead($$result)}<main class="astro-2COIDAMR">
1343
- <h1 class="astro-2COIDAMR">Welcome to <span class="text-gradient astro-2COIDAMR">Astro</span></h1>
1344
- <p class="instructions astro-2COIDAMR">
1345
- Check out the <code class="astro-2COIDAMR">src/pages</code> directory to get started.<br class="astro-2COIDAMR">
1346
- <strong class="astro-2COIDAMR">Code Challenge:</strong> Tweak the "Welcome to Astro" message above.
1347
- </p>
1348
- <ul role="list" class="link-card-grid astro-2COIDAMR">
1349
- ${renderComponent($$result, "Card", $$Card, { "href": "https://docs.astro.build/", "title": "Documentation", "body": "Learn how Astro works and explore the official API docs.", "class": "astro-2COIDAMR" })}
1350
- ${renderComponent($$result, "Card", $$Card, { "href": "https://astro.build/integrations/", "title": "Integrations", "body": "Supercharge your project with new frameworks and libraries.", "class": "astro-2COIDAMR" })}
1351
- ${renderComponent($$result, "Card", $$Card, { "href": "https://astro.build/themes/", "title": "Themes", "body": "Explore a galaxy of community-built starter themes.", "class": "astro-2COIDAMR" })}
1352
- ${renderComponent($$result, "Card", $$Card, { "href": "https://astro.build/chat/", "title": "Chat", "body": "Come say hi to our amazing Discord community. \u2764\uFE0F", "class": "astro-2COIDAMR" })}
1353
- </ul>
1354
- <ul role="list" class="mt-3 fs-20 astro-2COIDAMR">
1355
- ${products.map((product) => renderTemplate`<li class="astro-2COIDAMR">
1356
- <a${addAttribute(`/${product.slug}`, "href")} class="astro-2COIDAMR">${product.sku}</a>
1357
- </li>`)}
1358
- </ul>
1359
- </main>` })}
1360
-
1361
- `;
1362
- });
1363
-
1364
- const $$file$1 = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/index.astro";
1365
- const $$url$1 = "";
1366
-
1367
- const _page0 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1368
- __proto__: null,
1369
- $$metadata: $$metadata$1,
1370
- default: $$Index,
1371
- file: $$file$1,
1372
- url: $$url$1
1373
- }, Symbol.toStringTag, { value: 'Module' }));
1374
-
1375
1269
  // @ts-ignore
1376
- const env = (typeof window === 'object' && window)
1377
- || (typeof process === 'object' && process && process.env)
1378
- || {};
1270
+ const _env$1 = (Object.assign({"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true},{LANG:process.env.LANG,ECOM_STORE_ID:process.env.ECOM_STORE_ID,BASE_URL:'/',}))
1271
+ || (typeof process === 'object' && process?.env)
1272
+ || globalThis;
1379
1273
  class ApiError extends Error {
1380
1274
  constructor(config, response, msg, isTimeout = false) {
1381
1275
  if (response) {
@@ -1398,8 +1292,8 @@ const def = {
1398
1292
  // eslint-disable-next-line dot-notation
1399
1293
  headers['Authorization'] = `Bearer ${config.accessToken}`;
1400
1294
  } else {
1401
- const authenticationId = config.authenticationId || env.ECOM_AUTHENTICATION_ID;
1402
- const apiKey = config.apiKey || env.ECOM_API_KEY;
1295
+ const authenticationId = config.authenticationId || _env$1.ECOM_AUTHENTICATION_ID;
1296
+ const apiKey = config.apiKey || _env$1.ECOM_API_KEY;
1403
1297
  if (authenticationId && apiKey) {
1404
1298
  const rawAuth = `${authenticationId}:${apiKey}`;
1405
1299
  const base64Auth = typeof Buffer === 'function'
@@ -1409,18 +1303,18 @@ const def = {
1409
1303
  }
1410
1304
  }
1411
1305
  }
1412
- let url = config.baseUrl || env.API_BASE_URL || 'https://ecomplus.io/v2';
1306
+ let url = config.baseUrl || _env$1.API_BASE_URL || 'https://ecomplus.io/v2';
1413
1307
  const { endpoint, params } = config;
1414
1308
  if (endpoint !== 'login'
1415
1309
  && endpoint !== 'authenticate'
1416
1310
  && endpoint !== 'ask-auth-callback'
1417
1311
  && endpoint !== 'check-username') {
1418
- const storeId = config.storeId || env.ECOM_STORE_ID;
1312
+ const storeId = config.storeId || _env$1.ECOM_STORE_ID;
1419
1313
  if (!storeId) {
1420
1314
  throw new Error('`storeId` must be set in config or `ECOM_STORE_ID` env var');
1421
1315
  }
1422
1316
  url += `/:${storeId}`;
1423
- const lang = config.lang || env.ECOM_LANG;
1317
+ const lang = config.lang || _env$1.ECOM_LANG;
1424
1318
  if (lang) {
1425
1319
  url += `,lang:${lang}`;
1426
1320
  }
@@ -1548,26 +1442,272 @@ const $$module1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty(
1548
1442
  ApiError
1549
1443
  }, Symbol.toStringTag, { value: 'Module' }));
1550
1444
 
1551
- const $$metadata = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro", { modules: [{ module: $$module1, specifier: "@cloudcommerce/api", assert: {} }, { module: $$module2$1, specifier: "../layouts/Layout.astro", assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
1552
- const $$Astro = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro", "", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1445
+ const DEFAULT_LANG = 'pt_br';
1446
+
1447
+ const DEFAULT_CURRENCY = 'BRL';
1448
+
1449
+ const DEFAULT_CURRENCY_SYMBOL = 'R$';
1450
+
1451
+ const DEFAULT_COUNTRY_CODE = 'BR';
1452
+ // # sourceMappingURL=defaults.js.map
1453
+
1454
+ // @ts-ignore
1455
+ const _env = (Object.assign({"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true},{LANG:process.env.LANG,ECOM_STORE_ID:process.env.ECOM_STORE_ID,}))
1456
+ || (typeof process === 'object' && process?.env)
1457
+ || globalThis;
1458
+ const deepmerge = Deepmerge();
1459
+ const self = globalThis.__cloudCommerce || {
1460
+ config: {
1461
+ lang: _env.ECOM_LANG || DEFAULT_LANG,
1462
+ currency: _env.ECOM_CURRENCY || DEFAULT_CURRENCY,
1463
+ currencySymbol: _env.ECOM_CURRENCY_SYMBOL || DEFAULT_CURRENCY_SYMBOL,
1464
+ countryCode: _env.ECOM_COUNTRY_CODE || DEFAULT_COUNTRY_CODE,
1465
+ storeId: Number(_env.ECOM_STORE_ID),
1466
+ },
1467
+ };
1468
+ globalThis.__cloudCommerce = self;
1469
+
1470
+ const config = {
1471
+ get() {
1472
+ return self.config;
1473
+ },
1474
+ set(config) {
1475
+ self.config = deepmerge(self.config, config);
1476
+ if (config.storeId) {
1477
+ _env.ECOM_STORE_ID = config.storeId;
1478
+ }
1479
+ },
1480
+ };
1481
+ // # sourceMappingURL=config.js.map
1482
+
1483
+ const getConfig = () => {
1484
+ const {
1485
+ STOREFRONT_BASE_DIR,
1486
+ VITE_ECOM_STORE_ID,
1487
+ } = (Object.assign({"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true},{STOREFRONT_BASE_DIR:process.env.STOREFRONT_BASE_DIR,ECOM_STORE_ID:process.env.ECOM_STORE_ID,})) || process.env;
1488
+
1489
+ const { storeId, lang } = config.get();
1490
+
1491
+ let baseDir;
1492
+ if (STOREFRONT_BASE_DIR) {
1493
+ const currentDir = fileURLToPath(new URL('.', import.meta.url));
1494
+ baseDir = resolve(currentDir, STOREFRONT_BASE_DIR);
1495
+ } else {
1496
+ baseDir = process.cwd();
1497
+ }
1498
+ const dirContent = resolve(baseDir, 'content');
1499
+ if (VITE_ECOM_STORE_ID) {
1500
+ config.set({ storeId: Number(VITE_ECOM_STORE_ID) });
1501
+ }
1502
+
1503
+ const settings = JSON.parse(
1504
+ readFileSync(resolve(dirContent, 'settings.json'), 'utf8'),
1505
+ );
1506
+ const { domain } = settings;
1507
+ const primaryColor = settings.primary_color || '#20c997';
1508
+ const secondaryColor = settings.secondary_color || '#343a40';
1509
+
1510
+ return {
1511
+ storeId,
1512
+ lang,
1513
+ domain,
1514
+ primaryColor,
1515
+ secondaryColor,
1516
+ settings,
1517
+ };
1518
+ };
1519
+
1520
+ const $$module2$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1521
+ __proto__: null,
1522
+ default: getConfig
1523
+ }, Symbol.toStringTag, { value: 'Module' }));
1524
+
1525
+ var __freeze = Object.freeze;
1526
+ var __defProp = Object.defineProperty;
1527
+ var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(raw || cooked.slice()) }));
1528
+ var _a;
1529
+ const $$metadata$5 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/Layout.astro", { modules: [{ module: $$module2$1, specifier: "../../storefront.config.mjs", assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
1530
+ const $$Astro$5 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/Layout.astro", "https://storefront-demo.e-com.plus/", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1531
+ const $$Layout = createComponent(async ($$result, $$props, $$slots) => {
1532
+ const Astro2 = $$result.createAstro($$Astro$5, $$props, $$slots);
1533
+ Astro2.self = $$Layout;
1534
+ const { title } = Astro2.props;
1535
+ const { lang } = getConfig();
1536
+ const STYLES = [];
1537
+ for (const STYLE of STYLES)
1538
+ $$result.styles.add(STYLE);
1539
+ return renderTemplate(_a || (_a = __template(['<html lang="en" class="astro-DEZ7DR5X">\n<head>\n <meta charset="UTF-8">\n <meta name="viewport" content="width=device-width">\n <link rel="icon" type="image/x-icon" href="/favicon.ico">\n <title>', `</title>
1540
+ <link rel="stylesheet" media="print" onload="this.media='all'" href="https://www.gstatic.com/firebasejs/ui/6.0.1/firebase-ui-auth.css">
1541
+ `, '</head>\n<body class="astro-DEZ7DR5X">\n ', '\n <script async type="text/partytown"', "><\/script>\n</body>\n</html>\n\n"])), title, renderHead($$result), renderSlot($$result, $$slots["default"]), addAttribute(`https://www.gstatic.com/firebasejs/ui/6.0.1/firebase-ui-auth__${lang}.js`, "src"));
1542
+ });
1543
+
1544
+ const $$file$5 = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/Layout.astro";
1545
+ const $$url$5 = undefined;
1546
+
1547
+ const $$module3 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1548
+ __proto__: null,
1549
+ $$metadata: $$metadata$5,
1550
+ default: $$Layout,
1551
+ file: $$file$5,
1552
+ url: $$url$5
1553
+ }, Symbol.toStringTag, { value: 'Module' }));
1554
+
1555
+ const $$metadata$4 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/Card.astro", { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
1556
+ const $$Astro$4 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/Card.astro", "https://storefront-demo.e-com.plus/", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1557
+ const $$Card = createComponent(async ($$result, $$props, $$slots) => {
1558
+ const Astro2 = $$result.createAstro($$Astro$4, $$props, $$slots);
1559
+ Astro2.self = $$Card;
1560
+ const { href, title, body } = Astro2.props;
1561
+ const STYLES = [];
1562
+ for (const STYLE of STYLES)
1563
+ $$result.styles.add(STYLE);
1564
+ return renderTemplate`${maybeRenderHead($$result)}<li class="link-card astro-ASCHB54V">
1565
+ <a${addAttribute(href, "href")} class="astro-ASCHB54V">
1566
+ <h2 class="astro-ASCHB54V">
1567
+ ${title}
1568
+ <span class="astro-ASCHB54V">&rarr;</span>
1569
+ </h2>
1570
+ <p class="astro-ASCHB54V">
1571
+ ${body}
1572
+ </p>
1573
+ </a>
1574
+ </li>
1575
+ `;
1576
+ });
1577
+
1578
+ const $$file$4 = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/Card.astro";
1579
+ const $$url$4 = undefined;
1580
+
1581
+ const $$module2 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1582
+ __proto__: null,
1583
+ $$metadata: $$metadata$4,
1584
+ default: $$Card,
1585
+ file: $$file$4,
1586
+ url: $$url$4
1587
+ }, Symbol.toStringTag, { value: 'Module' }));
1588
+
1589
+ const $$metadata$3 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/index.astro", { modules: [{ module: $$module1, specifier: "@cloudcommerce/api", assert: {} }, { module: $$module3, specifier: "../layouts/Layout.astro", assert: {} }, { module: $$module2, specifier: "../components/Card.astro", assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
1590
+ const $$Astro$3 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/index.astro", "https://storefront-demo.e-com.plus/", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1591
+ const $$Index$1 = createComponent(async ($$result, $$props, $$slots) => {
1592
+ const Astro2 = $$result.createAstro($$Astro$3, $$props, $$slots);
1593
+ Astro2.self = $$Index$1;
1594
+ const products = (await api.get("products")).data.result;
1595
+ const STYLES = [];
1596
+ for (const STYLE of STYLES)
1597
+ $$result.styles.add(STYLE);
1598
+ return renderTemplate`${renderComponent($$result, "Layout", $$Layout, { "title": "Welcome to Astro.", "class": "astro-C3E44E3K" }, { "default": () => renderTemplate`${maybeRenderHead($$result)}<main class="astro-C3E44E3K">
1599
+ <h1 class="astro-C3E44E3K">Welcome to <span class="text-gradient astro-C3E44E3K">Astro</span></h1>
1600
+ <p class="instructions astro-C3E44E3K">
1601
+ Check out the <code class="astro-C3E44E3K">src/pages</code> directory to get started.<br class="astro-C3E44E3K">
1602
+ <strong class="astro-C3E44E3K">Code Challenge:</strong> Tweak the "Welcome to Astro" message above.
1603
+ </p>
1604
+ <ul role="list" class="link-card-grid astro-C3E44E3K">
1605
+ ${renderComponent($$result, "Card", $$Card, { "href": "https://docs.astro.build/", "title": "Documentation", "body": "Learn how Astro works and explore the official API docs.", "class": "astro-C3E44E3K" })}
1606
+ ${renderComponent($$result, "Card", $$Card, { "href": "https://astro.build/integrations/", "title": "Integrations", "body": "Supercharge your project with new frameworks and libraries.", "class": "astro-C3E44E3K" })}
1607
+ ${renderComponent($$result, "Card", $$Card, { "href": "https://astro.build/themes/", "title": "Themes", "body": "Explore a galaxy of community-built starter themes.", "class": "astro-C3E44E3K" })}
1608
+ ${renderComponent($$result, "Card", $$Card, { "href": "https://astro.build/chat/", "title": "Chat", "body": "Come say hi to our amazing Discord community. \u2764\uFE0F", "class": "astro-C3E44E3K" })}
1609
+ </ul>
1610
+ <ul role="list" class="mt-3 fs-20 astro-C3E44E3K">
1611
+ ${products.map((product) => renderTemplate`<li class="astro-C3E44E3K">
1612
+ <a${addAttribute(`/${product.slug}`, "href")} class="astro-C3E44E3K">${product.sku}</a>
1613
+ </li>`)}
1614
+ </ul>
1615
+ </main>` })}
1616
+
1617
+ `;
1618
+ });
1619
+
1620
+ const $$file$3 = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/index.astro";
1621
+ const $$url$3 = "";
1622
+
1623
+ const _page0 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1624
+ __proto__: null,
1625
+ $$metadata: $$metadata$3,
1626
+ default: $$Index$1,
1627
+ file: $$file$3,
1628
+ url: $$url$3
1629
+ }, Symbol.toStringTag, { value: 'Module' }));
1630
+
1631
+ const $$metadata$2 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/404.astro", { modules: [{ module: $$module3, specifier: "../layouts/Layout.astro", assert: {} }, { module: $$module2, specifier: "../components/Card.astro", assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
1632
+ const $$Astro$2 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/404.astro", "https://storefront-demo.e-com.plus/", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1633
+ const $$404 = createComponent(async ($$result, $$props, $$slots) => {
1634
+ const Astro2 = $$result.createAstro($$Astro$2, $$props, $$slots);
1635
+ Astro2.self = $$404;
1636
+ const STYLES = [];
1637
+ for (const STYLE of STYLES)
1638
+ $$result.styles.add(STYLE);
1639
+ return renderTemplate`${renderComponent($$result, "Layout", $$Layout, { "title": "Welcome to Astro.", "class": "astro-7FYMG5AV" }, { "default": () => renderTemplate`${maybeRenderHead($$result)}<main class="astro-7FYMG5AV">
1640
+ <h1 class="astro-7FYMG5AV">404</h1>
1641
+ <p class="instructions astro-7FYMG5AV">
1642
+ Check out the <code class="astro-7FYMG5AV">src/pages</code> directory to get started.<br class="astro-7FYMG5AV">
1643
+ <strong class="astro-7FYMG5AV">Code Challenge:</strong> Tweak the "Welcome to Astro" message above.
1644
+ </p>
1645
+ <ul role="list" class="link-card-grid astro-7FYMG5AV">
1646
+ ${renderComponent($$result, "Card", $$Card, { "href": "https://docs.astro.build/", "title": "Documentation", "body": "Learn how Astro works and explore the official API docs.", "class": "astro-7FYMG5AV" })}
1647
+ ${renderComponent($$result, "Card", $$Card, { "href": "https://astro.build/integrations/", "title": "Integrations", "body": "Supercharge your project with new frameworks and libraries.", "class": "astro-7FYMG5AV" })}
1648
+ ${renderComponent($$result, "Card", $$Card, { "href": "https://astro.build/themes/", "title": "Themes", "body": "Explore a galaxy of community-built starter themes.", "class": "astro-7FYMG5AV" })}
1649
+ ${renderComponent($$result, "Card", $$Card, { "href": "https://astro.build/chat/", "title": "Chat", "body": "Come say hi to our amazing Discord community. \u2764\uFE0F", "class": "astro-7FYMG5AV" })}
1650
+ </ul>
1651
+ </main>` })}
1652
+
1653
+ `;
1654
+ });
1655
+
1656
+ const $$file$2 = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/404.astro";
1657
+ const $$url$2 = "/404";
1658
+
1659
+ const _page1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1660
+ __proto__: null,
1661
+ $$metadata: $$metadata$2,
1662
+ default: $$404,
1663
+ file: $$file$2,
1664
+ url: $$url$2
1665
+ }, Symbol.toStringTag, { value: 'Module' }));
1666
+
1667
+ const $$metadata$1 = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/app/index.astro", { modules: [], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
1668
+ const $$Astro$1 = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/app/index.astro", "https://storefront-demo.e-com.plus/", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1669
+ const $$Index = createComponent(async ($$result, $$props, $$slots) => {
1670
+ const Astro2 = $$result.createAstro($$Astro$1, $$props, $$slots);
1671
+ Astro2.self = $$Index;
1672
+ return renderTemplate``;
1673
+ });
1674
+
1675
+ const $$file$1 = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/app/index.astro";
1676
+ const $$url$1 = "/app";
1677
+
1678
+ const _page2 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1679
+ __proto__: null,
1680
+ $$metadata: $$metadata$1,
1681
+ default: $$Index,
1682
+ file: $$file$1,
1683
+ url: $$url$1
1684
+ }, Symbol.toStringTag, { value: 'Module' }));
1685
+
1686
+ const $$metadata = createMetadata("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro", { modules: [{ module: $$module1, specifier: "@cloudcommerce/api", assert: {} }, { module: $$module2$1, specifier: "../../storefront.config.mjs", assert: {} }, { module: $$module3, specifier: "../layouts/Layout.astro", assert: {} }], hydratedComponents: [], clientOnlyComponents: [], hydrationDirectives: /* @__PURE__ */ new Set([]), hoisted: [] });
1687
+ const $$Astro = createAstro("/@fs/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro", "https://storefront-demo.e-com.plus/", "file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/");
1553
1688
  const $$ = createComponent(async ($$result, $$props, $$slots) => {
1554
1689
  const Astro2 = $$result.createAstro($$Astro, $$props, $$slots);
1555
1690
  Astro2.self = $$;
1556
1691
  const { slug } = Astro2.params;
1557
- const { data: { resource, doc } } = await api.get(`slugs/${slug}`, {
1558
- storeId: 1056,
1559
- fetch
1560
- });
1692
+ let resource;
1693
+ let doc;
1694
+ try {
1695
+ const { data } = await api.get(`slugs/${slug}`, { fetch });
1696
+ resource = data.resource;
1697
+ doc = data.doc;
1698
+ } catch {
1699
+ return Astro2.redirect(`/404?url=${encodeURIComponent(`/${slug}`)}`);
1700
+ }
1561
1701
  const STYLES = [];
1562
1702
  for (const STYLE of STYLES)
1563
1703
  $$result.styles.add(STYLE);
1564
- return renderTemplate`${renderComponent($$result, "Layout", $$Layout, { "title": doc.name, "class": "astro-QB6KRBZ4" }, { "default": () => renderTemplate`${maybeRenderHead($$result)}<main class="astro-QB6KRBZ4">
1565
- <h1 class="astro-QB6KRBZ4">Hello <span class="text-gradient astro-QB6KRBZ4">${doc.name}</span></h1>
1566
- <hr class="astro-QB6KRBZ4">
1567
- <div class="mt-3 astro-QB6KRBZ4">
1568
- <mark class="astro-QB6KRBZ4">${doc._id}</mark> from <i class="astro-QB6KRBZ4">${resource}</i>
1569
- <p class="astro-QB6KRBZ4">${Math.random()}</p>
1570
- <em class="astro-QB6KRBZ4">Lorem ipsum dolor sit amet</em>
1704
+ return renderTemplate`${renderComponent($$result, "Layout", $$Layout, { "title": doc.name, "class": "astro-WWHJ5KDF" }, { "default": () => renderTemplate`${maybeRenderHead($$result)}<main class="astro-WWHJ5KDF">
1705
+ <h1 class="astro-WWHJ5KDF">Hello <span class="text-gradient astro-WWHJ5KDF">${doc.name}</span></h1>
1706
+ <hr class="astro-WWHJ5KDF">
1707
+ <div class="mt-3 astro-WWHJ5KDF">
1708
+ <mark class="astro-WWHJ5KDF">${doc._id}</mark> from <i class="astro-WWHJ5KDF">${resource}</i>
1709
+ <p class="astro-WWHJ5KDF">${Math.random()}</p>
1710
+ <em class="astro-WWHJ5KDF">Lorem ipsum dolor sit amet</em>
1571
1711
  </div>
1572
1712
  </main>` })}
1573
1713
 
@@ -1577,7 +1717,7 @@ const $$ = createComponent(async ($$result, $$props, $$slots) => {
1577
1717
  const $$file = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro";
1578
1718
  const $$url = "/[...slug]";
1579
1719
 
1580
- const _page1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1720
+ const _page3 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1581
1721
  __proto__: null,
1582
1722
  $$metadata,
1583
1723
  default: $$,
@@ -1585,7 +1725,7 @@ const _page1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
1585
1725
  url: $$url
1586
1726
  }, Symbol.toStringTag, { value: 'Module' }));
1587
1727
 
1588
- const pageMap = new Map([['src/pages/index.astro', _page0],['src/pages/[...slug].astro', _page1],]);
1728
+ const pageMap = new Map([['src/pages/index.astro', _page0],['src/pages/404.astro', _page1],['src/pages/app/index.astro', _page2],['src/pages/[...slug].astro', _page3],]);
1589
1729
  const renderers = [Object.assign({"name":"astro:jsx","serverEntrypoint":"astro/jsx/server.js","jsxImportSource":"astro"}, { ssr: server_default }),Object.assign({"name":"@astrojs/vue","clientEntrypoint":"@astrojs/vue/client.js","serverEntrypoint":"@astrojs/vue/server.js"}, { ssr: _renderer1 }),];
1590
1730
 
1591
1731
  if (typeof process !== "undefined") {
@@ -1657,7 +1797,7 @@ function deserializeManifest(serializedManifest) {
1657
1797
  };
1658
1798
  }
1659
1799
 
1660
- const _manifest = Object.assign(deserializeManifest({"adapterName":"@astrojs/node","routes":[{"file":"","links":["assets/_...d4aa8aff.css","assets/index.5608ba47.css"],"scripts":[{"type":"external","value":"page.3aa82516.js"},{"stage":"head-inline","children":"!(function(w,p,f,c){c=w[p]=Object.assign(w[p]||{},{\"lib\":\"/~partytown/\",\"debug\":false});c[f]=(c[f]||[])})(window,'partytown','forward');/* Partytown 0.4.5 - MIT builder.io */\n!function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,\"/\"==(a=(o.lib||\"/~partytown/\")+(o.debug?\"debug/\":\"\"))[0]&&(s=e.querySelectorAll('script[type=\"text/partytown\"]'),i!=t?i.dispatchEvent(new CustomEvent(\"pt1\",{detail:t})):(d=setTimeout(w,1e4),e.addEventListener(\"pt0\",f),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||\"partytown-sw.js\"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener(\"statechange\",(function(t){\"activated\"==t.target.state&&h()}))}),console.error):w())))}function h(t){c=e.createElement(t?\"script\":\"iframe\"),t||(c.setAttribute(\"style\",\"display:block;width:0;height:0;border:0;visibility:hidden\"),c.setAttribute(\"aria-hidden\",!0)),c.src=a+\"partytown-\"+(t?\"atomics.js?v=0.4.5\":\"sandbox-sw.html?\"+Date.now()),e.body.appendChild(c)}function w(t,n){for(f(),t=0;t<s.length;t++)(n=e.createElement(\"script\")).innerHTML=s[t].innerHTML,e.head.appendChild(n);c&&c.parentNode.removeChild(c)}function f(){clearTimeout(d)}o=t.partytown||{},i==t&&(o.forward||[]).map((function(e){p=t,e.split(\".\").map((function(e,n,i){p=p[i[n]]=n+1<i.length?\"push\"==i[n+1]?[]:p[i[n]]||{}:function(){(t._ptf=t._ptf||[]).push(i,arguments)}}))})),\"complete\"==e.readyState?u():(t.addEventListener(\"DOMContentLoaded\",u),t.addEventListener(\"load\",u))}(window,document,navigator,top,window.crossOriginIsolated);"}],"routeData":{"route":"/","type":"page","pattern":"^\\/$","segments":[],"params":[],"component":"src/pages/index.astro","pathname":"/","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":["assets/_...d4aa8aff.css","assets/_...0b5ebd52.css"],"scripts":[{"type":"external","value":"page.3aa82516.js"},{"stage":"head-inline","children":"!(function(w,p,f,c){c=w[p]=Object.assign(w[p]||{},{\"lib\":\"/~partytown/\",\"debug\":false});c[f]=(c[f]||[])})(window,'partytown','forward');/* Partytown 0.4.5 - MIT builder.io */\n!function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,\"/\"==(a=(o.lib||\"/~partytown/\")+(o.debug?\"debug/\":\"\"))[0]&&(s=e.querySelectorAll('script[type=\"text/partytown\"]'),i!=t?i.dispatchEvent(new CustomEvent(\"pt1\",{detail:t})):(d=setTimeout(w,1e4),e.addEventListener(\"pt0\",f),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||\"partytown-sw.js\"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener(\"statechange\",(function(t){\"activated\"==t.target.state&&h()}))}),console.error):w())))}function h(t){c=e.createElement(t?\"script\":\"iframe\"),t||(c.setAttribute(\"style\",\"display:block;width:0;height:0;border:0;visibility:hidden\"),c.setAttribute(\"aria-hidden\",!0)),c.src=a+\"partytown-\"+(t?\"atomics.js?v=0.4.5\":\"sandbox-sw.html?\"+Date.now()),e.body.appendChild(c)}function w(t,n){for(f(),t=0;t<s.length;t++)(n=e.createElement(\"script\")).innerHTML=s[t].innerHTML,e.head.appendChild(n);c&&c.parentNode.removeChild(c)}function f(){clearTimeout(d)}o=t.partytown||{},i==t&&(o.forward||[]).map((function(e){p=t,e.split(\".\").map((function(e,n,i){p=p[i[n]]=n+1<i.length?\"push\"==i[n+1]?[]:p[i[n]]||{}:function(){(t._ptf=t._ptf||[]).push(i,arguments)}}))})),\"complete\"==e.readyState?u():(t.addEventListener(\"DOMContentLoaded\",u),t.addEventListener(\"load\",u))}(window,document,navigator,top,window.crossOriginIsolated);"}],"routeData":{"route":"/[...slug]","type":"page","pattern":"^(?:\\/(.*?))?\\/?$","segments":[[{"content":"...slug","dynamic":true,"spread":true}]],"params":["...slug"],"component":"src/pages/[...slug].astro","_meta":{"trailingSlash":"ignore"}}}],"base":"/","markdown":{"drafts":false,"syntaxHighlight":"shiki","shikiConfig":{"langs":[],"theme":"github-dark","wrap":false},"remarkPlugins":[],"rehypePlugins":[],"remarkRehype":{},"extendDefaultPlugins":false,"isAstroFlavoredMd":false},"pageMap":null,"renderers":[],"entryModules":{"\u0000@astrojs-ssr-virtual-entry":"entry.mjs","@astrojs/vue/client.js":"client.6d48c590.js","astro:scripts/page.js":"page.3aa82516.js","astro:scripts/before-hydration.js":"data:text/javascript;charset=utf-8,//[no before-hydration script]"},"assets":["/assets/_...0b5ebd52.css","/assets/_...d4aa8aff.css","/assets/index.5608ba47.css","/client.6d48c590.js","/favicon.ico","/page.3aa82516.js","/page.3aa82516.js","/~partytown/partytown-atomics.js","/~partytown/partytown-media.js","/~partytown/partytown-sw.js","/~partytown/partytown.js"]}), {
1800
+ const _manifest = Object.assign(deserializeManifest({"adapterName":"@astrojs/node","routes":[{"file":"","links":["assets/404-_...d4aa8aff.css","assets/404-index.d9230d24.css","assets/index.53a3a3e0.css"],"scripts":[{"type":"external","value":"page.3aa82516.js"},{"stage":"head-inline","children":"!(function(w,p,f,c){c=w[p]=Object.assign(w[p]||{},{\"lib\":\"/~partytown/\",\"debug\":false});c[f]=(c[f]||[])})(window,'partytown','forward');/* Partytown 0.4.5 - MIT builder.io */\n!function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,\"/\"==(a=(o.lib||\"/~partytown/\")+(o.debug?\"debug/\":\"\"))[0]&&(s=e.querySelectorAll('script[type=\"text/partytown\"]'),i!=t?i.dispatchEvent(new CustomEvent(\"pt1\",{detail:t})):(d=setTimeout(w,1e4),e.addEventListener(\"pt0\",f),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||\"partytown-sw.js\"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener(\"statechange\",(function(t){\"activated\"==t.target.state&&h()}))}),console.error):w())))}function h(t){c=e.createElement(t?\"script\":\"iframe\"),t||(c.setAttribute(\"style\",\"display:block;width:0;height:0;border:0;visibility:hidden\"),c.setAttribute(\"aria-hidden\",!0)),c.src=a+\"partytown-\"+(t?\"atomics.js?v=0.4.5\":\"sandbox-sw.html?\"+Date.now()),e.body.appendChild(c)}function w(t,n){for(f(),t=0;t<s.length;t++)(n=e.createElement(\"script\")).innerHTML=s[t].innerHTML,e.head.appendChild(n);c&&c.parentNode.removeChild(c)}function f(){clearTimeout(d)}o=t.partytown||{},i==t&&(o.forward||[]).map((function(e){p=t,e.split(\".\").map((function(e,n,i){p=p[i[n]]=n+1<i.length?\"push\"==i[n+1]?[]:p[i[n]]||{}:function(){(t._ptf=t._ptf||[]).push(i,arguments)}}))})),\"complete\"==e.readyState?u():(t.addEventListener(\"DOMContentLoaded\",u),t.addEventListener(\"load\",u))}(window,document,navigator,top,window.crossOriginIsolated);"}],"routeData":{"route":"/","type":"page","pattern":"^\\/$","segments":[],"params":[],"component":"src/pages/index.astro","pathname":"/","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":["assets/404-_...d4aa8aff.css","assets/404-index.d9230d24.css","assets/404.530428e5.css"],"scripts":[{"type":"external","value":"page.3aa82516.js"},{"stage":"head-inline","children":"!(function(w,p,f,c){c=w[p]=Object.assign(w[p]||{},{\"lib\":\"/~partytown/\",\"debug\":false});c[f]=(c[f]||[])})(window,'partytown','forward');/* Partytown 0.4.5 - MIT builder.io */\n!function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,\"/\"==(a=(o.lib||\"/~partytown/\")+(o.debug?\"debug/\":\"\"))[0]&&(s=e.querySelectorAll('script[type=\"text/partytown\"]'),i!=t?i.dispatchEvent(new CustomEvent(\"pt1\",{detail:t})):(d=setTimeout(w,1e4),e.addEventListener(\"pt0\",f),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||\"partytown-sw.js\"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener(\"statechange\",(function(t){\"activated\"==t.target.state&&h()}))}),console.error):w())))}function h(t){c=e.createElement(t?\"script\":\"iframe\"),t||(c.setAttribute(\"style\",\"display:block;width:0;height:0;border:0;visibility:hidden\"),c.setAttribute(\"aria-hidden\",!0)),c.src=a+\"partytown-\"+(t?\"atomics.js?v=0.4.5\":\"sandbox-sw.html?\"+Date.now()),e.body.appendChild(c)}function w(t,n){for(f(),t=0;t<s.length;t++)(n=e.createElement(\"script\")).innerHTML=s[t].innerHTML,e.head.appendChild(n);c&&c.parentNode.removeChild(c)}function f(){clearTimeout(d)}o=t.partytown||{},i==t&&(o.forward||[]).map((function(e){p=t,e.split(\".\").map((function(e,n,i){p=p[i[n]]=n+1<i.length?\"push\"==i[n+1]?[]:p[i[n]]||{}:function(){(t._ptf=t._ptf||[]).push(i,arguments)}}))})),\"complete\"==e.readyState?u():(t.addEventListener(\"DOMContentLoaded\",u),t.addEventListener(\"load\",u))}(window,document,navigator,top,window.crossOriginIsolated);"}],"routeData":{"route":"/404","type":"page","pattern":"^\\/404\\/?$","segments":[[{"content":"404","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/404.astro","pathname":"/404","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"page.3aa82516.js"},{"stage":"head-inline","children":"!(function(w,p,f,c){c=w[p]=Object.assign(w[p]||{},{\"lib\":\"/~partytown/\",\"debug\":false});c[f]=(c[f]||[])})(window,'partytown','forward');/* Partytown 0.4.5 - MIT builder.io */\n!function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,\"/\"==(a=(o.lib||\"/~partytown/\")+(o.debug?\"debug/\":\"\"))[0]&&(s=e.querySelectorAll('script[type=\"text/partytown\"]'),i!=t?i.dispatchEvent(new CustomEvent(\"pt1\",{detail:t})):(d=setTimeout(w,1e4),e.addEventListener(\"pt0\",f),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||\"partytown-sw.js\"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener(\"statechange\",(function(t){\"activated\"==t.target.state&&h()}))}),console.error):w())))}function h(t){c=e.createElement(t?\"script\":\"iframe\"),t||(c.setAttribute(\"style\",\"display:block;width:0;height:0;border:0;visibility:hidden\"),c.setAttribute(\"aria-hidden\",!0)),c.src=a+\"partytown-\"+(t?\"atomics.js?v=0.4.5\":\"sandbox-sw.html?\"+Date.now()),e.body.appendChild(c)}function w(t,n){for(f(),t=0;t<s.length;t++)(n=e.createElement(\"script\")).innerHTML=s[t].innerHTML,e.head.appendChild(n);c&&c.parentNode.removeChild(c)}function f(){clearTimeout(d)}o=t.partytown||{},i==t&&(o.forward||[]).map((function(e){p=t,e.split(\".\").map((function(e,n,i){p=p[i[n]]=n+1<i.length?\"push\"==i[n+1]?[]:p[i[n]]||{}:function(){(t._ptf=t._ptf||[]).push(i,arguments)}}))})),\"complete\"==e.readyState?u():(t.addEventListener(\"DOMContentLoaded\",u),t.addEventListener(\"load\",u))}(window,document,navigator,top,window.crossOriginIsolated);"}],"routeData":{"route":"/app","type":"page","pattern":"^\\/app\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/index.astro","pathname":"/app","_meta":{"trailingSlash":"ignore"}}},{"file":"","links":["assets/404-_...d4aa8aff.css","assets/_...98510c96.css"],"scripts":[{"type":"external","value":"page.3aa82516.js"},{"stage":"head-inline","children":"!(function(w,p,f,c){c=w[p]=Object.assign(w[p]||{},{\"lib\":\"/~partytown/\",\"debug\":false});c[f]=(c[f]||[])})(window,'partytown','forward');/* Partytown 0.4.5 - MIT builder.io */\n!function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,\"/\"==(a=(o.lib||\"/~partytown/\")+(o.debug?\"debug/\":\"\"))[0]&&(s=e.querySelectorAll('script[type=\"text/partytown\"]'),i!=t?i.dispatchEvent(new CustomEvent(\"pt1\",{detail:t})):(d=setTimeout(w,1e4),e.addEventListener(\"pt0\",f),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||\"partytown-sw.js\"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener(\"statechange\",(function(t){\"activated\"==t.target.state&&h()}))}),console.error):w())))}function h(t){c=e.createElement(t?\"script\":\"iframe\"),t||(c.setAttribute(\"style\",\"display:block;width:0;height:0;border:0;visibility:hidden\"),c.setAttribute(\"aria-hidden\",!0)),c.src=a+\"partytown-\"+(t?\"atomics.js?v=0.4.5\":\"sandbox-sw.html?\"+Date.now()),e.body.appendChild(c)}function w(t,n){for(f(),t=0;t<s.length;t++)(n=e.createElement(\"script\")).innerHTML=s[t].innerHTML,e.head.appendChild(n);c&&c.parentNode.removeChild(c)}function f(){clearTimeout(d)}o=t.partytown||{},i==t&&(o.forward||[]).map((function(e){p=t,e.split(\".\").map((function(e,n,i){p=p[i[n]]=n+1<i.length?\"push\"==i[n+1]?[]:p[i[n]]||{}:function(){(t._ptf=t._ptf||[]).push(i,arguments)}}))})),\"complete\"==e.readyState?u():(t.addEventListener(\"DOMContentLoaded\",u),t.addEventListener(\"load\",u))}(window,document,navigator,top,window.crossOriginIsolated);"}],"routeData":{"route":"/[...slug]","type":"page","pattern":"^(?:\\/(.*?))?\\/?$","segments":[[{"content":"...slug","dynamic":true,"spread":true}]],"params":["...slug"],"component":"src/pages/[...slug].astro","_meta":{"trailingSlash":"ignore"}}}],"site":"https://storefront-demo.e-com.plus/","base":"/","markdown":{"drafts":false,"syntaxHighlight":"shiki","shikiConfig":{"langs":[],"theme":"github-dark","wrap":false},"remarkPlugins":[],"rehypePlugins":[],"remarkRehype":{},"extendDefaultPlugins":false,"isAstroFlavoredMd":false},"pageMap":null,"renderers":[],"entryModules":{"\u0000@astrojs-ssr-virtual-entry":"entry.mjs","@astrojs/vue/client.js":"client.6d48c590.js","astro:scripts/page.js":"page.3aa82516.js","astro:scripts/before-hydration.js":"data:text/javascript;charset=utf-8,//[no before-hydration script]"},"assets":["/assets/404.530428e5.css","/assets/404-_...d4aa8aff.css","/assets/404-index.d9230d24.css","/assets/_...98510c96.css","/assets/index.53a3a3e0.css","/client.6d48c590.js","/favicon.ico","/page.3aa82516.js","/page.3aa82516.js","/~partytown/partytown-atomics.js","/~partytown/partytown-media.js","/~partytown/partytown-sw.js","/~partytown/partytown.js"]}), {
1661
1801
  pageMap: pageMap,
1662
1802
  renderers: renderers
1663
1803
  });
@@ -0,0 +1,2 @@
1
+ STOREFRONT_BASE_DIR=../../store/functions/ssr/
2
+ ECOM_STORE_ID=1011
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/storefront",
3
3
  "type": "module",
4
- "version": "0.0.67",
4
+ "version": "0.0.70",
5
5
  "description": "E-Com Plus Cloud Commerce storefront with Astro",
6
6
  "main": "src/index.js",
7
7
  "repository": {
@@ -20,7 +20,9 @@
20
20
  "start": "astro dev",
21
21
  "build": "astro build",
22
22
  "preview": "astro preview",
23
- "astro": "astro"
23
+ "astro": "astro",
24
+ "prerelease": "rm content && cp -r ../../store/functions/ssr/content ./",
25
+ "postrelease": "rm -rf content && ln -s ../../store/functions/ssr/content content"
24
26
  },
25
27
  "dependencies": {
26
28
  "@astrojs/node": "^1.0.1",
@@ -29,8 +31,12 @@
29
31
  "@astrojs/sitemap": "^1.0.0",
30
32
  "@astrojs/vue": "^1.0.0",
31
33
  "@cloudcommerce/api": "workspace:*",
34
+ "@cloudcommerce/config": "workspace:*",
35
+ "@nanostores/vue": "^0.6.0",
32
36
  "@picocss/pico": "^1.5.3",
33
37
  "astro": "^1.1.5",
38
+ "dotenv": "^16.0.2",
39
+ "nanostores": "^0.6.0",
34
40
  "rollup": "^2.79.0",
35
41
  "unocss": "^0.45.15",
36
42
  "vite": "^3.1.0",