cloudcommerce 0.26.3 → 0.26.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.
Files changed (112) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
  3. package/ecomplus-stores/barra-doce/functions/ssr/package.json +6 -6
  4. package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
  5. package/ecomplus-stores/barra-doce/package.json +2 -2
  6. package/ecomplus-stores/iluminim/functions/many/package.json +3 -3
  7. package/ecomplus-stores/iluminim/functions/ssr/package.json +6 -6
  8. package/ecomplus-stores/iluminim/functions/with-apps/package.json +3 -3
  9. package/ecomplus-stores/iluminim/package.json +2 -2
  10. package/package.json +2 -2
  11. package/packages/api/package.json +1 -1
  12. package/packages/apps/affilate-program/package.json +1 -1
  13. package/packages/apps/correios/package.json +1 -1
  14. package/packages/apps/custom-payment/package.json +1 -1
  15. package/packages/apps/custom-shipping/package.json +1 -1
  16. package/packages/apps/datafrete/package.json +1 -1
  17. package/packages/apps/discounts/package.json +1 -1
  18. package/packages/apps/emails/package.json +1 -1
  19. package/packages/apps/fb-conversions/package.json +1 -1
  20. package/packages/apps/flash-courier/package.json +1 -1
  21. package/packages/apps/frenet/package.json +1 -1
  22. package/packages/apps/galaxpay/package.json +1 -1
  23. package/packages/apps/google-analytics/package.json +1 -1
  24. package/packages/apps/jadlog/package.json +1 -1
  25. package/packages/apps/loyalty-points/package.json +1 -1
  26. package/packages/apps/melhor-envio/package.json +1 -1
  27. package/packages/apps/mercadopago/package.json +1 -1
  28. package/packages/apps/pagarme/package.json +1 -1
  29. package/packages/apps/paghiper/package.json +1 -1
  30. package/packages/apps/pix/package.json +1 -1
  31. package/packages/apps/tiny-erp/package.json +1 -1
  32. package/packages/apps/webhooks/package.json +1 -1
  33. package/packages/cli/package.json +1 -1
  34. package/packages/config/package.json +1 -1
  35. package/packages/emails/package.json +1 -1
  36. package/packages/eslint/package.json +1 -1
  37. package/packages/events/package.json +1 -1
  38. package/packages/feeds/package.json +1 -1
  39. package/packages/firebase/package.json +1 -1
  40. package/packages/i18n/package.json +1 -1
  41. package/packages/modules/package.json +1 -1
  42. package/packages/passport/package.json +1 -1
  43. package/packages/ssr/package.json +1 -1
  44. package/packages/storefront/astro.config.mjs +33 -23
  45. package/packages/storefront/dist/client/_astro/{Carousel.0b24e2cb.js → Carousel.9ad2e1dc.js} +1 -1
  46. package/packages/storefront/dist/client/_astro/{CartSidebar.2731d333.js → CartSidebar.a6c6a885.js} +1 -1
  47. package/packages/storefront/dist/client/_astro/{HeroSlider.a70b2582.js → HeroSlider.ee1e6200.js} +1 -1
  48. package/packages/storefront/dist/client/_astro/{PitchBar.13991988.js → PitchBar.6111676e.js} +1 -1
  49. package/packages/storefront/dist/client/_astro/{Prices.cdfa346a.js → Prices.04ff8fce.js} +1 -1
  50. package/packages/storefront/dist/client/_astro/{ProductShelf.619c56a5.js → ProductShelf.085721d6.js} +1 -1
  51. package/packages/storefront/dist/client/_astro/SearchModal.cffd4c2d.js +1 -0
  52. package/packages/storefront/dist/client/_astro/{ShopHeader.2c2fded7.js → ShopHeader.7e485e35.js} +2 -2
  53. package/packages/storefront/dist/client/_astro/{_plugin-vue_export-helper.fc5e2f5b.js → _plugin-vue_export-helper.ee681fa8.js} +1 -1
  54. package/packages/storefront/dist/client/_astro/{api.39f40cd8.js → api.a2eda23e.js} +1 -1
  55. package/packages/storefront/dist/client/_astro/client.e6d9439a.js +1 -0
  56. package/packages/storefront/dist/client/_astro/{format-money.86f14860.js → format-money.923559cc.js} +1 -1
  57. package/packages/storefront/dist/client/_astro/hoisted.85fdcf03.js +1 -0
  58. package/packages/storefront/dist/client/_astro/{img.d4891d80.js → img.ec6ba316.js} +1 -1
  59. package/packages/storefront/dist/client/_astro/{index.33801818.js → index.ea57babe.js} +1 -1
  60. package/packages/storefront/dist/client/_astro/{modules-info.ec412b24.js → modules-info.e5d77bf3.js} +1 -1
  61. package/packages/storefront/dist/client/sw.js +1 -1
  62. package/packages/storefront/dist/server/chunks/{CartSidebar.cca9fdd3.mjs → CartSidebar.41b20543.mjs} +20 -9
  63. package/packages/storefront/dist/server/chunks/{SearchModal.a680efae.mjs → SearchModal.5f5e6a15.mjs} +19 -8
  64. package/packages/storefront/dist/server/chunks/_...4a2548d2.mjs +35 -0
  65. package/packages/storefront/dist/server/chunks/account@_@astro.204fba92.mjs +35 -0
  66. package/packages/storefront/dist/server/chunks/{astro.440a2e08.mjs → astro.708269c6.mjs} +1859 -149
  67. package/packages/storefront/dist/server/chunks/endpoint@_@js.11be892a.mjs +35 -0
  68. package/packages/storefront/dist/server/chunks/index@_@astro.19e0f502.mjs +35 -0
  69. package/packages/storefront/dist/server/chunks/index@_@astro.b37a6ac9.mjs +35 -0
  70. package/packages/storefront/dist/{client/chunks/pages/_...slug_.astro.ec6517ba.mjs → server/chunks/pages/_...slug_.astro.36e8882b.mjs} +273 -331
  71. package/packages/storefront/dist/{client/chunks/pages/account.astro.3d2605e6.mjs → server/chunks/pages/account.astro.32e7e6ef.mjs} +10 -2
  72. package/packages/storefront/dist/server/chunks/pages/endpoint.js.f7a896a1.mjs +119 -0
  73. package/packages/storefront/dist/server/chunks/pages/{index.astro.079f316a.mjs → index.astro.3145bd93.mjs} +2 -3
  74. package/packages/storefront/dist/server/chunks/pages/{~fallback.astro.01594623.mjs → ~fallback.astro.ba4c2475.mjs} +20 -9
  75. package/packages/storefront/dist/server/chunks/~fallback@_@astro.6bb4c4b4.mjs +35 -0
  76. package/packages/storefront/dist/server/entry.mjs +2359 -1166
  77. package/packages/storefront/dist/server/renderers.mjs +21 -10
  78. package/packages/storefront/package.json +1 -1
  79. package/packages/storefront/src/lib/layouts/BaseHead.astro +3 -0
  80. package/packages/test-base/package.json +1 -1
  81. package/packages/types/package.json +1 -1
  82. package/pnpm-workspace.yaml +0 -2
  83. package/packages/storefront/dist/client/_astro/SearchModal.117a477d.js +0 -1
  84. package/packages/storefront/dist/client/_astro/client.a5d2898b.js +0 -1
  85. package/packages/storefront/dist/client/_astro/hoisted.d90361ee.js +0 -1
  86. package/packages/storefront/dist/client/_empty-middleware.mjs +0 -3
  87. package/packages/storefront/dist/client/chunks/CartSidebar.0ce1e999.mjs +0 -382
  88. package/packages/storefront/dist/client/chunks/SearchModal.f603145b.mjs +0 -32
  89. package/packages/storefront/dist/client/chunks/astro.11be33ee.mjs +0 -1424
  90. package/packages/storefront/dist/client/chunks/pages/index.astro.8ad03206.mjs +0 -1650
  91. package/packages/storefront/dist/client/chunks/pages/~fallback.astro.d31d20b4.mjs +0 -54
  92. package/packages/storefront/dist/client/chunks/sharp.3f154e38.mjs +0 -74
  93. package/packages/storefront/dist/client/manifest.e39eb543.mjs +0 -79
  94. package/packages/storefront/dist/client/pages/_---slug_.astro.mjs +0 -23
  95. package/packages/storefront/dist/client/pages/app/account.astro.mjs +0 -23
  96. package/packages/storefront/dist/client/pages/app.astro.mjs +0 -23
  97. package/packages/storefront/dist/client/pages/index.astro.mjs +0 -23
  98. package/packages/storefront/dist/client/pages/~fallback.astro.mjs +0 -23
  99. package/packages/storefront/dist/client/registerSW.js +0 -1
  100. package/packages/storefront/dist/client/renderers.mjs +0 -369
  101. package/packages/storefront/dist/server/chunks/_...f7cdc954.mjs +0 -24
  102. package/packages/storefront/dist/server/chunks/account@_@astro.fa8b921b.mjs +0 -24
  103. package/packages/storefront/dist/server/chunks/image-endpoint@_@js.802bf648.mjs +0 -24
  104. package/packages/storefront/dist/server/chunks/index@_@astro.a122f091.mjs +0 -24
  105. package/packages/storefront/dist/server/chunks/index@_@astro.da98dcbe.mjs +0 -24
  106. package/packages/storefront/dist/server/chunks/pages/_...slug_.astro.08ba5973.mjs +0 -3930
  107. package/packages/storefront/dist/server/chunks/pages/account.astro.f11f26f3.mjs +0 -15
  108. package/packages/storefront/dist/server/chunks/pages/image-endpoint.js.a9374d3e.mjs +0 -238
  109. package/packages/storefront/dist/server/chunks/sharp.52841bb4.mjs +0 -75
  110. package/packages/storefront/dist/server/chunks/~fallback@_@astro.876a97c5.mjs +0 -24
  111. package/packages/storefront/dist/server/manifest.12e7a10c.mjs +0 -561
  112. /package/packages/storefront/dist/client/{workbox-5e0bf4e4.js → workbox-1b331600.js} +0 -0
@@ -1,15 +1,21 @@
1
- import { c as createAstro, a as createComponent, r as renderTemplate, u as unescapeHTML, b as renderComponent, d as addAttribute, F as Fragment, s as spreadAttributes, e as renderSlotToString, f as renderAllHeadContent, A as AstroError, E as ExpectedImage, L as LocalImageUsedWrongly, M as MissingImageDimension, U as UnsupportedImageFormat, g as ExpectedImageOptions, I as InvalidImageService, m as maybeRenderHead, h as renderSlot } from '../astro.11be33ee.mjs';
1
+ import 'kleur/colors';
2
+ import 'node:fs/promises';
3
+ import { resolve, join } from 'node:path';
4
+ import 'node:url';
5
+ import 'http-cache-semantics';
6
+ import 'node:os';
7
+ import sizeOf from 'image-size';
8
+ import 'magic-string';
9
+ import mime from 'mime';
10
+ import 'node:stream';
11
+ import { c as createAstro, a as createComponent, r as renderTemplate, b as addAttribute, d as renderComponent, u as unescapeHTML, F as Fragment, s as spreadAttributes, e as renderSlotToString, f as renderAllHeadContent, m as maybeRenderHead, g as renderSlot } from '../astro.708269c6.mjs';
2
12
  import api from '@cloudcommerce/api';
3
13
  import { EventEmitter } from 'node:events';
4
14
  import fs from 'node:fs';
5
- import { resolve, join } from 'node:path';
6
15
  import config from '@cloudcommerce/config';
7
16
  import { img, price, formatMoney, randomObjectId, nickname } from '@ecomplus/utils';
8
- import 'clsx';
9
17
  import { renderSync, parse, walkSync, ELEMENT_NODE } from 'ultrahtml';
10
- /* empty css */import imageSize from 'image-size';
11
- import mime from 'mime';
12
- import { reactive, computed, shallowRef, useSSRContext, defineComponent, inject, mergeProps, ref, watch, toRef, onMounted, onBeforeUnmount, provide, createVNode, resolveDynamicComponent, withCtx, renderSlot as renderSlot$1, resolveComponent, withDirectives, vShow, openBlock, createBlock, createCommentVNode, Fragment as Fragment$1, renderList, withModifiers, Teleport, createTextVNode, toDisplayString, defineAsyncComponent, Suspense } from 'vue';
18
+ /* empty css */import { reactive, computed, shallowRef, useSSRContext, defineComponent, inject, mergeProps, ref, watch, toRef, onMounted, onBeforeUnmount, provide, createVNode, resolveDynamicComponent, withCtx, renderSlot as renderSlot$1, resolveComponent, withDirectives, vShow, openBlock, createBlock, createCommentVNode, Fragment as Fragment$1, renderList, withModifiers, Teleport, createTextVNode, toDisplayString, defineAsyncComponent, Suspense } from 'vue';
13
19
  import { useScroll, useElementHover, useDebounceFn, useTimeout, watchDebounced, promiseTimeout, watchOnce } from '@vueuse/core';
14
20
  import { ssrRenderAttrs, ssrRenderSlot, ssrRenderClass, ssrRenderVNode, ssrRenderComponent, ssrRenderStyle, ssrRenderList, ssrIncludeBooleanAttr, ssrRenderAttr, ssrRenderTeleport, ssrInterpolate, ssrRenderSuspense } from 'vue/server-renderer';
15
21
  import { Popover, PopoverButton, PopoverPanel, Menu, MenuButton, MenuItems, MenuItem } from '@headlessui/vue';
@@ -22,31 +28,106 @@ const _export_sfc = (sfc, props) => {
22
28
  return target;
23
29
  };
24
30
 
25
- function removeTrailingForwardSlash(path) {
26
- return path.endsWith("/") ? path.slice(0, path.length - 1) : path;
31
+ function isOutputFormat(value) {
32
+ return ["avif", "jpeg", "jpg", "png", "webp", "svg"].includes(value);
27
33
  }
28
- function removeLeadingForwardSlash(path) {
29
- return path.startsWith("/") ? path.substring(1) : path;
34
+ function isOutputFormatSupportsAlpha(value) {
35
+ return ["avif", "png", "webp"].includes(value);
30
36
  }
31
- function trimSlashes(path) {
32
- return path.replace(/^\/|\/$/g, "");
37
+ function isAspectRatioString(value) {
38
+ return /^\d*:\d*$/.test(value);
33
39
  }
34
- function isString(path) {
35
- return typeof path === "string" || path instanceof String;
40
+ function parseAspectRatio(aspectRatio) {
41
+ if (!aspectRatio) {
42
+ return void 0;
43
+ }
44
+ if (typeof aspectRatio === "number") {
45
+ return aspectRatio;
46
+ } else {
47
+ const [width, height] = aspectRatio.split(":");
48
+ return parseInt(width) / parseInt(height);
49
+ }
36
50
  }
37
- function joinPaths(...paths) {
38
- return paths.filter(isString).map((path, i) => {
39
- if (i === 0) {
40
- return removeTrailingForwardSlash(path);
41
- } else if (i === paths.length - 1) {
42
- return removeLeadingForwardSlash(path);
43
- } else {
44
- return trimSlashes(path);
45
- }
46
- }).join("/");
51
+ function isSSRService(service) {
52
+ return "transform" in service;
47
53
  }
48
- function isRemotePath(src) {
49
- return /^(http|ftp|https|ws):?\/\//.test(src) || src.startsWith("data:");
54
+ class BaseSSRService {
55
+ async getImageAttributes(transform) {
56
+ const { width, height, src, format, quality, aspectRatio, ...rest } = transform;
57
+ return {
58
+ ...rest,
59
+ width,
60
+ height
61
+ };
62
+ }
63
+ serializeTransform(transform) {
64
+ const searchParams = new URLSearchParams();
65
+ if (transform.quality) {
66
+ searchParams.append("q", transform.quality.toString());
67
+ }
68
+ if (transform.format) {
69
+ searchParams.append("f", transform.format);
70
+ }
71
+ if (transform.width) {
72
+ searchParams.append("w", transform.width.toString());
73
+ }
74
+ if (transform.height) {
75
+ searchParams.append("h", transform.height.toString());
76
+ }
77
+ if (transform.aspectRatio) {
78
+ searchParams.append("ar", transform.aspectRatio.toString());
79
+ }
80
+ if (transform.fit) {
81
+ searchParams.append("fit", transform.fit);
82
+ }
83
+ if (transform.background) {
84
+ searchParams.append("bg", transform.background);
85
+ }
86
+ if (transform.position) {
87
+ searchParams.append("p", encodeURI(transform.position));
88
+ }
89
+ searchParams.append("href", transform.src);
90
+ return { searchParams };
91
+ }
92
+ parseTransform(searchParams) {
93
+ if (!searchParams.has("href")) {
94
+ return void 0;
95
+ }
96
+ let transform = { src: searchParams.get("href") };
97
+ if (searchParams.has("q")) {
98
+ transform.quality = parseInt(searchParams.get("q"));
99
+ }
100
+ if (searchParams.has("f")) {
101
+ const format = searchParams.get("f");
102
+ if (isOutputFormat(format)) {
103
+ transform.format = format;
104
+ }
105
+ }
106
+ if (searchParams.has("w")) {
107
+ transform.width = parseInt(searchParams.get("w"));
108
+ }
109
+ if (searchParams.has("h")) {
110
+ transform.height = parseInt(searchParams.get("h"));
111
+ }
112
+ if (searchParams.has("ar")) {
113
+ const ratio = searchParams.get("ar");
114
+ if (isAspectRatioString(ratio)) {
115
+ transform.aspectRatio = ratio;
116
+ } else {
117
+ transform.aspectRatio = parseFloat(ratio);
118
+ }
119
+ }
120
+ if (searchParams.has("fit")) {
121
+ transform.fit = searchParams.get("fit");
122
+ }
123
+ if (searchParams.has("p")) {
124
+ transform.position = decodeURI(searchParams.get("p"));
125
+ }
126
+ if (searchParams.has("bg")) {
127
+ transform.background = searchParams.get("bg");
128
+ }
129
+ return transform;
130
+ }
50
131
  }
51
132
 
52
133
  global.__storefrontCMS = (fs, resolvePath) => {
@@ -338,6 +419,16 @@ const loadRouteContext = async (Astro, {
338
419
 
339
420
  const pwaInfo = {"pwaInDevEnvironment":false,"webManifest":{"href":"/manifest.webmanifest","useCredentials":false,"linkTag":"<link rel=\"manifest\" href=\"/manifest.webmanifest\">"}};
340
421
 
422
+ const $$Astro$9 = createAstro("https://ecom2-demo.web.app");
423
+ const $$ViewTransitions = createComponent(async ($$result, $$props, $$slots) => {
424
+ const Astro2 = $$result.createAstro($$Astro$9, $$props, $$slots);
425
+ Astro2.self = $$ViewTransitions;
426
+ const { fallback = "animate" } = Astro2.props;
427
+ return renderTemplate`<meta name="astro-view-transitions-enabled" content="true">
428
+ <meta name="astro-view-transitions-fallback"${addAttribute(fallback, "content")}>
429
+ `;
430
+ }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/node_modules/astro/components/ViewTransitions.astro", void 0);
431
+
341
432
  var __freeze$2 = Object.freeze;
342
433
  var __defProp$2 = Object.defineProperty;
343
434
  var __template$2 = (cooked, raw) => __freeze$2(__defProp$2(cooked, "raw", { value: __freeze$2(raw || cooked.slice()) }));
@@ -445,7 +536,7 @@ window.$isCmsPreview = true;`;
445
536
  url: `https://${domain}/`,
446
537
  logo: `https://${domain}${settings.logo}`
447
538
  });
448
- return renderTemplate(_a$2 || (_a$2 = __template$2(['<meta charset="UTF-8">\n<meta name="viewport" content="width=device-width">\n<meta name="theme-color"', '>\n<link rel="icon" type="image/png"', ' sizes="32x32">\n', "\n<title>", '</title>\n<meta name="description"', '>\n<meta name="author"', '>\n<meta name="generator"', '>\n<link rel="canonical"', ">\n", '\n<meta name="apple-mobile-web-app-capable" content="yes">\n<meta name="apple-mobile-web-app-status-bar-style" content="default">\n<meta property="og:site_name"', '>\n<meta property="og:url"', '>\n<meta property="og:title"', '>\n<meta property="og:description"', '>\n<meta property="og:type" content="website">\n<meta property="og:locale"', ">\n", "\n", '\n<meta name="twitter:card" content="summary">\n', '\n<meta name="ecom-store-id"', ">\n\n\n", "\n", "\n\n<script>", '<\/script>\n<script type="application/ld+json">', "<\/script>"])), addAttribute(primaryColor, "content"), addAttribute(favicon, "href"), shortcutIcon && renderTemplate`<link rel="icon" type="image/png"${addAttribute(shortcutIcon, "href")} sizes="192x192">`, title, addAttribute(description, "content"), addAttribute(settings.name, "content"), addAttribute(Astro2.generator, "content"), addAttribute(canonicalUrl, "href"), shortcutIcon && renderTemplate`<link rel="apple-touch-icon"${addAttribute(shortcutIcon, "href")}>`, addAttribute(settings.name, "content"), addAttribute(canonicalUrl, "content"), addAttribute(title, "content"), addAttribute(description, "content"), addAttribute(ogLocale, "content"), ogImage && renderTemplate`<meta property="og:image"${addAttribute(ogImage, "content")}>`, metatagsContent?.fb_app_id && renderTemplate`<meta property="fb:app_id"${addAttribute(metatagsContent.fb_app_id, "content")}>`, metatagsContent?.twitter_username && renderTemplate`<meta name="twitter:site"${addAttribute(metatagsContent.twitter_username, "content")}>`, addAttribute(String(storeId), "content"), pwaInfo && renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`${unescapeHTML(pwaInfo.webManifest.linkTag)}` })}`, !pwaInfo && !false && renderTemplate`<link rel="manifest" href="/manifest.webmanifest">`, unescapeHTML(inlineClientJS), unescapeHTML(inlineJSONLd));
539
+ return renderTemplate(_a$2 || (_a$2 = __template$2(['<meta charset="UTF-8">\n<meta name="viewport" content="width=device-width">\n<meta name="theme-color"', '>\n<link rel="icon" type="image/png"', ' sizes="32x32">\n', "\n<title>", '</title>\n<meta name="description"', '>\n<meta name="author"', '>\n<meta name="generator"', '>\n<link rel="canonical"', ">\n", '\n<meta name="apple-mobile-web-app-capable" content="yes">\n<meta name="apple-mobile-web-app-status-bar-style" content="default">\n<meta property="og:site_name"', '>\n<meta property="og:url"', '>\n<meta property="og:title"', '>\n<meta property="og:description"', '>\n<meta property="og:type" content="website">\n<meta property="og:locale"', ">\n", "\n", '\n<meta name="twitter:card" content="summary">\n', '\n<meta name="ecom-store-id"', ">\n\n\n", "\n", "\n\n<script>", '<\/script>\n<script type="application/ld+json">', "<\/script>\n\n", ""])), addAttribute(primaryColor, "content"), addAttribute(favicon, "href"), shortcutIcon && renderTemplate`<link rel="icon" type="image/png"${addAttribute(shortcutIcon, "href")} sizes="192x192">`, title, addAttribute(description, "content"), addAttribute(settings.name, "content"), addAttribute(Astro2.generator, "content"), addAttribute(canonicalUrl, "href"), shortcutIcon && renderTemplate`<link rel="apple-touch-icon"${addAttribute(shortcutIcon, "href")}>`, addAttribute(settings.name, "content"), addAttribute(canonicalUrl, "content"), addAttribute(title, "content"), addAttribute(description, "content"), addAttribute(ogLocale, "content"), ogImage && renderTemplate`<meta property="og:image"${addAttribute(ogImage, "content")}>`, metatagsContent?.fb_app_id && renderTemplate`<meta property="fb:app_id"${addAttribute(metatagsContent.fb_app_id, "content")}>`, metatagsContent?.twitter_username && renderTemplate`<meta name="twitter:site"${addAttribute(metatagsContent.twitter_username, "content")}>`, addAttribute(String(storeId), "content"), pwaInfo && renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`${unescapeHTML(pwaInfo.webManifest.linkTag)}` })}`, !pwaInfo && !false && renderTemplate`<link rel="manifest" href="/manifest.webmanifest">`, unescapeHTML(inlineClientJS), unescapeHTML(inlineJSONLd), renderComponent($$result, "ViewTransitions", $$ViewTransitions, {}));
449
540
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/BaseHead.astro", void 0);
450
541
 
451
542
  function has(value) {
@@ -584,335 +675,193 @@ const Head = createComponent({
584
675
  }
585
676
  });
586
677
 
587
- const VALID_SUPPORTED_FORMATS = [
588
- "jpeg",
589
- "jpg",
590
- "png",
591
- "tiff",
592
- "webp",
593
- "gif",
594
- "svg"
595
- ];
596
-
597
- function matchPattern(url, remotePattern) {
598
- return matchProtocol(url, remotePattern.protocol) && matchHostname(url, remotePattern.hostname, true) && matchPort(url, remotePattern.port) && matchPathname(url, remotePattern.pathname, true);
599
- }
600
- function matchPort(url, port) {
601
- return !port || port === url.port;
602
- }
603
- function matchProtocol(url, protocol) {
604
- return !protocol || protocol === url.protocol.slice(0, -1);
678
+ function isRemoteImage(src) {
679
+ return /^(https?:)?\/\//.test(src);
605
680
  }
606
- function matchHostname(url, hostname, allowWildcard) {
607
- if (!hostname) {
608
- return true;
609
- } else if (!allowWildcard || !hostname.startsWith("*")) {
610
- return hostname === url.hostname;
611
- } else if (hostname.startsWith("**.")) {
612
- const slicedHostname = hostname.slice(2);
613
- return slicedHostname !== url.hostname && url.hostname.endsWith(slicedHostname);
614
- } else if (hostname.startsWith("*.")) {
615
- const slicedHostname = hostname.slice(1);
616
- const additionalSubdomains = url.hostname.replace(slicedHostname, "").split(".").filter(Boolean);
617
- return additionalSubdomains.length === 1;
618
- }
619
- return false;
681
+ function removeQueryString(src) {
682
+ const index = src.lastIndexOf("?");
683
+ return index > 0 ? src.substring(0, index) : src;
620
684
  }
621
- function matchPathname(url, pathname, allowWildcard) {
622
- if (!pathname) {
623
- return true;
624
- } else if (!allowWildcard || !pathname.endsWith("*")) {
625
- return pathname === url.pathname;
626
- } else if (pathname.endsWith("/**")) {
627
- const slicedPathname = pathname.slice(0, -2);
628
- return slicedPathname !== url.pathname && url.pathname.startsWith(slicedPathname);
629
- } else if (pathname.endsWith("/*")) {
630
- const slicedPathname = pathname.slice(0, -1);
631
- const additionalPathChunks = url.pathname.replace(slicedPathname, "").split("/").filter(Boolean);
632
- return additionalPathChunks.length === 1;
685
+ function extname(src) {
686
+ const base = basename(src);
687
+ const index = base.lastIndexOf(".");
688
+ if (index <= 0) {
689
+ return "";
633
690
  }
634
- return false;
635
- }
636
-
637
- function isESMImportedImage(src) {
638
- return typeof src === "object";
691
+ return base.substring(index);
639
692
  }
640
- function isRemoteAllowed(src, {
641
- domains = [],
642
- remotePatterns = []
643
- }) {
644
- if (!isRemotePath(src))
645
- return false;
646
- const url = new URL(src);
647
- return domains.some((domain) => matchHostname(url, domain)) || remotePatterns.some((remotePattern) => matchPattern(url, remotePattern));
693
+ function basename(src) {
694
+ return removeQueryString(src.replace(/^.*[\\\/]/, ""));
648
695
  }
649
696
 
650
- function isLocalService(service) {
651
- if (!service) {
652
- return false;
697
+ function resolveSize(transform) {
698
+ if (transform.width && transform.height) {
699
+ return transform;
653
700
  }
654
- return "transform" in service;
655
- }
656
- function parseQuality(quality) {
657
- let result = parseInt(quality);
658
- if (Number.isNaN(result)) {
659
- return quality;
701
+ if (!transform.width && !transform.height) {
702
+ throw new Error(`"width" and "height" cannot both be undefined`);
660
703
  }
661
- return result;
662
- }
663
- const baseService = {
664
- validateOptions(options) {
665
- if (!options.src || typeof options.src !== "string" && typeof options.src !== "object") {
666
- throw new AstroError({
667
- ...ExpectedImage,
668
- message: ExpectedImage.message(JSON.stringify(options.src))
669
- });
670
- }
671
- if (!isESMImportedImage(options.src)) {
672
- if (options.src.startsWith("/@fs/")) {
673
- throw new AstroError({
674
- ...LocalImageUsedWrongly,
675
- message: LocalImageUsedWrongly.message(options.src)
676
- });
677
- }
678
- let missingDimension;
679
- if (!options.width && !options.height) {
680
- missingDimension = "both";
681
- } else if (!options.width && options.height) {
682
- missingDimension = "width";
683
- } else if (options.width && !options.height) {
684
- missingDimension = "height";
685
- }
686
- if (missingDimension) {
687
- throw new AstroError({
688
- ...MissingImageDimension,
689
- message: MissingImageDimension.message(missingDimension, options.src)
690
- });
691
- }
692
- } else {
693
- if (!VALID_SUPPORTED_FORMATS.includes(options.src.format)) {
694
- throw new AstroError({
695
- ...UnsupportedImageFormat,
696
- message: UnsupportedImageFormat.message(
697
- options.src.format,
698
- options.src.src,
699
- VALID_SUPPORTED_FORMATS
700
- )
701
- });
702
- }
703
- if (options.src.format === "svg") {
704
- options.format = "svg";
705
- }
706
- }
707
- if (!options.format) {
708
- options.format = "webp";
709
- }
710
- return options;
711
- },
712
- getHTMLAttributes(options) {
713
- let targetWidth = options.width;
714
- let targetHeight = options.height;
715
- if (isESMImportedImage(options.src)) {
716
- const aspectRatio = options.src.width / options.src.height;
717
- if (targetHeight && !targetWidth) {
718
- targetWidth = Math.round(targetHeight * aspectRatio);
719
- } else if (targetWidth && !targetHeight) {
720
- targetHeight = Math.round(targetWidth / aspectRatio);
721
- } else if (!targetWidth && !targetHeight) {
722
- targetWidth = options.src.width;
723
- targetHeight = options.src.height;
724
- }
725
- }
726
- const { src, width, height, format, quality, ...attributes } = options;
704
+ if (!transform.aspectRatio) {
705
+ throw new Error(
706
+ `"aspectRatio" must be included if only "${transform.width ? "width" : "height"}" is provided`
707
+ );
708
+ }
709
+ let aspectRatio;
710
+ if (typeof transform.aspectRatio === "number") {
711
+ aspectRatio = transform.aspectRatio;
712
+ } else {
713
+ const [width, height] = transform.aspectRatio.split(":");
714
+ aspectRatio = Number.parseInt(width) / Number.parseInt(height);
715
+ }
716
+ if (transform.width) {
727
717
  return {
728
- ...attributes,
729
- width: targetWidth,
730
- height: targetHeight,
731
- loading: attributes.loading ?? "lazy",
732
- decoding: attributes.decoding ?? "async"
733
- };
734
- },
735
- getURL(options, imageConfig) {
736
- const searchParams = new URLSearchParams();
737
- if (isESMImportedImage(options.src)) {
738
- searchParams.append("href", options.src.src);
739
- } else if (isRemoteAllowed(options.src, imageConfig)) {
740
- searchParams.append("href", options.src);
741
- } else {
742
- return options.src;
743
- }
744
- const params = {
745
- w: "width",
746
- h: "height",
747
- q: "quality",
748
- f: "format"
718
+ ...transform,
719
+ width: transform.width,
720
+ height: Math.round(transform.width / aspectRatio)
749
721
  };
750
- Object.entries(params).forEach(([param, key]) => {
751
- options[key] && searchParams.append(param, options[key].toString());
752
- });
753
- const imageEndpoint = joinPaths("/", "/_image");
754
- return `${imageEndpoint}?${searchParams}`;
755
- },
756
- parseURL(url) {
757
- const params = url.searchParams;
758
- if (!params.has("href")) {
759
- return void 0;
760
- }
761
- const transform = {
762
- src: params.get("href"),
763
- width: params.has("w") ? parseInt(params.get("w")) : void 0,
764
- height: params.has("h") ? parseInt(params.get("h")) : void 0,
765
- format: params.get("f"),
766
- quality: params.get("q")
722
+ } else if (transform.height) {
723
+ return {
724
+ ...transform,
725
+ width: Math.round(transform.height * aspectRatio),
726
+ height: transform.height
767
727
  };
768
- return transform;
769
728
  }
770
- };
771
-
772
- /* eslint-disable */
773
- function isRemoteImage(src) {
774
- return typeof src === "string";
729
+ return transform;
775
730
  }
776
- async function getConfiguredImageService() {
777
- if (!globalThis?.astroAsset?.imageService) {
778
- const { default: service } = await import(
779
- // @ts-expect-error
780
- '../sharp.3f154e38.mjs'
781
- ).catch((e) => {
782
- const error = new AstroError(InvalidImageService);
783
- error.cause = e;
784
- throw error;
785
- });
786
- if (!globalThis.astroAsset)
787
- globalThis.astroAsset = {};
788
- globalThis.astroAsset.imageService = service;
789
- return service;
731
+ async function resolveTransform(input) {
732
+ if (typeof input.src === "string") {
733
+ return resolveSize(input);
734
+ }
735
+ const metadata = "then" in input.src ? (await input.src).default : input.src;
736
+ let { width, height, aspectRatio, background, format = metadata.format, ...rest } = input;
737
+ if (!width && !height) {
738
+ width = metadata.width;
739
+ height = metadata.height;
740
+ } else if (width) {
741
+ let ratio = parseAspectRatio(aspectRatio) || metadata.width / metadata.height;
742
+ height = height || Math.round(width / ratio);
743
+ } else if (height) {
744
+ let ratio = parseAspectRatio(aspectRatio) || metadata.width / metadata.height;
745
+ width = width || Math.round(height * ratio);
790
746
  }
791
- return globalThis.astroAsset.imageService;
747
+ return {
748
+ ...rest,
749
+ src: metadata.src,
750
+ width,
751
+ height,
752
+ aspectRatio,
753
+ format,
754
+ background
755
+ };
792
756
  }
793
- async function getImage(options, imageConfig) {
794
- if (!options || typeof options !== "object") {
795
- throw new AstroError({
796
- ...ExpectedImageOptions,
797
- message: ExpectedImageOptions.message(JSON.stringify(options))
757
+ async function getImage(transform) {
758
+ var _a, _b, _c;
759
+ if (!transform.src) {
760
+ throw new Error("[@astrojs/image] `src` is required");
761
+ }
762
+ let loader = (_a = globalThis.astroImage) == null ? void 0 : _a.loader;
763
+ if (!loader) {
764
+ const { default: mod } = await import('./endpoint.js.f7a896a1.mjs').then(n => n.s).catch(() => {
765
+ throw new Error(
766
+ "[@astrojs/image] Builtin image loader not found. (Did you remember to add the integration to your Astro config?)"
767
+ );
798
768
  });
769
+ loader = mod;
770
+ globalThis.astroImage = globalThis.astroImage || {};
771
+ globalThis.astroImage.loader = loader;
772
+ }
773
+ const resolved = await resolveTransform(transform);
774
+ const attributes = await loader.getImageAttributes(resolved);
775
+ const isDev = (_b = (Object.assign({"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true,"SSR":true,"SITE":"https://ecom2-demo.web.app","ASSETS_PREFIX":undefined},{SSR:true,}))) == null ? void 0 : _b.DEV;
776
+ const isLocalImage = !isRemoteImage(resolved.src);
777
+ const _loader = isDev && isLocalImage ? globalThis.astroImage.defaultLoader : loader;
778
+ if (!_loader) {
779
+ throw new Error("@astrojs/image: loader not found!");
780
+ }
781
+ const { searchParams } = isSSRService(_loader) ? _loader.serializeTransform(resolved) : globalThis.astroImage.defaultLoader.serializeTransform(resolved);
782
+ const imgSrc = !isLocalImage && resolved.src.startsWith("//") ? `https:${resolved.src}` : resolved.src;
783
+ let src;
784
+ if (/^[\/\\]?@astroimage/.test(imgSrc)) {
785
+ src = `${imgSrc}?${searchParams.toString()}`;
786
+ } else {
787
+ searchParams.set("href", imgSrc);
788
+ src = `/_image?${searchParams.toString()}`;
799
789
  }
800
- const service = await getConfiguredImageService();
801
- const resolvedOptions = {
802
- ...options,
803
- src: typeof options.src === "object" && "then" in options.src ? (await options.src).default : options.src
804
- };
805
- const validatedOptions = service.validateOptions ? await service.validateOptions(resolvedOptions, imageConfig) : resolvedOptions;
806
- let imageURL = await service.getURL(validatedOptions, imageConfig);
807
- if (isLocalService(service) && globalThis.astroAsset.addStaticImage && // If `getURL` returned the same URL as the user provided, it means the service doesn't need to do anything
808
- !(isRemoteImage(validatedOptions.src) && imageURL === validatedOptions.src)) {
809
- imageURL = globalThis.astroAsset.addStaticImage(validatedOptions);
790
+ if ((_c = globalThis.astroImage) == null ? void 0 : _c.addStaticImage) {
791
+ src = globalThis.astroImage.addStaticImage(resolved);
810
792
  }
811
793
  return {
812
- rawOptions: resolvedOptions,
813
- options: validatedOptions,
814
- src: imageURL,
815
- attributes: service.getHTMLAttributes !== void 0 ? service.getHTMLAttributes(validatedOptions, imageConfig) : {}
794
+ ...attributes,
795
+ src
816
796
  };
817
797
  }
818
798
 
819
- function removeQueryString(src) {
820
- const index = src.lastIndexOf("?");
821
- return index > 0 ? src.substring(0, index) : src;
822
- }
823
- function basename(src) {
824
- return removeQueryString(src.replace(/^.*[\\\/]/, ""));
825
- }
826
- const extname = (src) => {
827
- const base = basename(src);
828
- const index = base.lastIndexOf(".");
829
- if (index <= 0) {
830
- return "";
831
- }
832
- return base.substring(index);
833
- };
834
- function parseAspectRatio(aspectRatio) {
835
- if (!aspectRatio) {
836
- return void 0;
837
- }
838
- if (typeof aspectRatio === "number") {
839
- return aspectRatio;
840
- }
841
- const [width, height] = aspectRatio.split(":");
842
- return parseInt(width, 10) / parseInt(height, 10);
843
- }
844
799
  async function resolveAspectRatio({ src, aspectRatio }) {
845
800
  if (typeof src === "string") {
846
801
  return parseAspectRatio(aspectRatio);
802
+ } else {
803
+ const metadata = "then" in src ? (await src).default : src;
804
+ return parseAspectRatio(aspectRatio) || metadata.width / metadata.height;
847
805
  }
848
- throw new Error('Custom (faster) `Picture.runtime.astro` works only with string ("remote") src');
849
806
  }
850
807
  async function resolveFormats({ src, formats }) {
851
808
  const unique = new Set(formats);
852
809
  if (typeof src === "string") {
853
810
  unique.add(extname(src).replace(".", ""));
854
811
  } else {
855
- throw new Error("Custom `Picture.ssr.astro` works only with string src");
812
+ const metadata = "then" in src ? (await src).default : src;
813
+ unique.add(extname(metadata.src).replace(".", ""));
856
814
  }
857
815
  return Array.from(unique).filter(Boolean);
858
816
  }
859
- const createPictureGetter = (getImage) => {
860
- return async (params) => {
861
- const {
862
- src,
863
- alt,
864
- widths,
865
- fit,
866
- position,
867
- background
868
- } = params;
869
- if (!src) {
870
- throw new Error("[@astrojs/image] `src` is required");
871
- }
872
- if (!widths || !Array.isArray(widths)) {
873
- throw new Error("[@astrojs/image] at least one `width` is required. ex: `widths={[100]}`");
874
- }
875
- const aspectRatio = await resolveAspectRatio(params);
876
- if (!aspectRatio) {
877
- throw new Error("`aspectRatio` must be provided for remote images");
878
- }
879
- const allFormats = await resolveFormats(params);
880
- const lastFormat = allFormats[allFormats.length - 1];
881
- const maxWidth = Math.max(...widths);
882
- let image;
883
- async function getSource(format) {
884
- const imgs = await Promise.all(
885
- widths.map(async (width) => {
886
- const img = await getImage({
887
- src,
888
- alt,
889
- format,
890
- width,
891
- height: width / aspectRatio,
892
- fit,
893
- position,
894
- background,
895
- aspectRatio
896
- });
897
- if (format === lastFormat && width === maxWidth) {
898
- image = img;
899
- }
900
- return `${img.src} ${width}w`;
901
- })
902
- );
903
- return {
904
- type: mime.getType(format) || format,
905
- srcset: imgs.join(",")
906
- };
907
- }
908
- const sources = await Promise.all(allFormats.map((format) => getSource(format)));
817
+ async function getPicture(params) {
818
+ const { src, alt, widths, fit, position, background } = params;
819
+ if (!src) {
820
+ throw new Error("[@astrojs/image] `src` is required");
821
+ }
822
+ if (!widths || !Array.isArray(widths)) {
823
+ throw new Error("[@astrojs/image] at least one `width` is required. ex: `widths={[100]}`");
824
+ }
825
+ const aspectRatio = await resolveAspectRatio(params);
826
+ if (!aspectRatio) {
827
+ throw new Error("`aspectRatio` must be provided for remote images");
828
+ }
829
+ const allFormats = await resolveFormats(params);
830
+ const lastFormat = allFormats[allFormats.length - 1];
831
+ const maxWidth = Math.max(...widths);
832
+ let image;
833
+ async function getSource(format) {
834
+ const imgs = await Promise.all(
835
+ widths.map(async (width) => {
836
+ var _a;
837
+ const img = await getImage({
838
+ src,
839
+ alt,
840
+ format,
841
+ width,
842
+ fit,
843
+ position,
844
+ background,
845
+ aspectRatio
846
+ });
847
+ if (format === lastFormat && width === maxWidth) {
848
+ image = img;
849
+ }
850
+ return `${(_a = img.src) == null ? void 0 : _a.replaceAll(" ", encodeURI)} ${width}w`;
851
+ })
852
+ );
909
853
  return {
910
- sources,
911
- // @ts-ignore
912
- image
854
+ type: mime.getType(format) || format,
855
+ srcset: imgs.join(",")
913
856
  };
857
+ }
858
+ const sources = await Promise.all(allFormats.map((format) => getSource(format)));
859
+ return {
860
+ sources,
861
+ // @ts-expect-error image will always be defined
862
+ image
914
863
  };
915
- };
864
+ }
916
865
 
917
866
  const getAspectRatio = (src, tryImageSize) => {
918
867
  if (typeof src === "string") {
@@ -1060,7 +1009,7 @@ const $$Picture = createComponent(async ($$result, $$props, $$slots) => {
1060
1009
  const Astro2 = $$result.createAstro($$Astro$7, $$props, $$slots);
1061
1010
  Astro2.self = $$Picture;
1062
1011
  const deployRand = ({}).DEPLOY_RAND;
1063
- const versionSuffix = process.env.BUILD_OUTPUT !== "static" && deployRand ? `&V=${deployRand}` : "";
1012
+ const versionSuffix = ({}).BUILD_OUTPUT !== "static" && deployRand ? `&V=${deployRand}` : "";
1064
1013
  const getImageFilepath = (src) => {
1065
1014
  return resolve(process.env.STOREFRONT_BASE_DIR, `public${src}`);
1066
1015
  };
@@ -1068,7 +1017,7 @@ const $$Picture = createComponent(async ($$result, $$props, $$slots) => {
1068
1017
  let dimensions = {};
1069
1018
  if (typeof src === "string" && src.startsWith("/")) {
1070
1019
  try {
1071
- dimensions = imageSize(getImageFilepath(src));
1020
+ dimensions = sizeOf(getImageFilepath(src));
1072
1021
  } catch (e) {
1073
1022
  dimensions = {};
1074
1023
  }
@@ -1083,14 +1032,7 @@ const $$Picture = createComponent(async ($$result, $$props, $$slots) => {
1083
1032
  } = await useSSRPicture({
1084
1033
  ...Astro2.props,
1085
1034
  tryImageSize,
1086
- getPicture: createPictureGetter(async (imageOptions) => {
1087
- const {
1088
- options,
1089
- src,
1090
- attributes: { width, height }
1091
- } = await getImage(imageOptions);
1092
- return { src, width, height };
1093
- })
1035
+ getPicture
1094
1036
  });
1095
1037
  if (imgAttrs) {
1096
1038
  imgAttrs.src += versionSuffix;
@@ -3646,8 +3588,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3646
3588
  setup(__props, { expose: __expose }) {
3647
3589
  __expose();
3648
3590
  const props = __props;
3649
- const SearchModal = defineAsyncComponent(() => import('../SearchModal.f603145b.mjs'));
3650
- const CartSidebar = defineAsyncComponent(() => import('../CartSidebar.0ce1e999.mjs'));
3591
+ const SearchModal = defineAsyncComponent(() => import('../SearchModal.5f5e6a15.mjs'));
3592
+ const CartSidebar = defineAsyncComponent(() => import('../CartSidebar.41b20543.mjs'));
3651
3593
  const header = ref(null);
3652
3594
  const {
3653
3595
  isSticky,
@@ -3934,4 +3876,4 @@ const ____slug_ = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty(
3934
3876
  url: $$url
3935
3877
  }, Symbol.toStringTag, { value: 'Module' }));
3936
3878
 
3937
- export { $$Picture as $, Carousel as C, SocialNetworkLink as S, _export_sfc as _, CarouselControl as a, availableExtraDiscount as b, addProductToCart as c, discountOption as d, loadRouteContext as e, filterMainCategories as f, $$BaseHead as g, $$PageHeader as h, installmentsOption as i, $$Base as j, parseProduct as k, loyaltyPointsPrograms as l, useId as m, freeShippingFromValue as n, shoppingCart as o, parseShippingPhrase as p, baseService as q, removeCartItem as r, socialNetworks as s, totalItems as t, useSharedData as u, parseQuality as v, ____slug_ as w };
3879
+ export { $$Picture as $, BaseSSRService as B, Carousel as C, SocialNetworkLink as S, _export_sfc as _, CarouselControl as a, availableExtraDiscount as b, installmentsOption as c, discountOption as d, addProductToCart as e, filterMainCategories as f, loadRouteContext as g, $$BaseHead as h, isOutputFormatSupportsAlpha as i, $$PageHeader as j, $$Base as k, loyaltyPointsPrograms as l, parseProduct as m, useId as n, freeShippingFromValue as o, parseShippingPhrase as p, shoppingCart as q, removeCartItem as r, socialNetworks as s, totalItems as t, useSharedData as u, ____slug_ as v };