cloudcommerce 0.24.1 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/.github/workflows/test-e2e.yml +2 -2
  2. package/CHANGELOG.md +43 -0
  3. package/action.yml +2 -2
  4. package/ecomplus-stores/barra-doce/.idx/dev.nix +24 -0
  5. package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
  6. package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/contato.json +11 -0
  7. package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/terms.json +11 -0
  8. package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/trocas.json +11 -0
  9. package/ecomplus-stores/barra-doce/functions/ssr/content/layout.json +30 -0
  10. package/ecomplus-stores/barra-doce/functions/ssr/content/settings.json +3 -3
  11. package/ecomplus-stores/barra-doce/functions/ssr/package.json +7 -7
  12. package/ecomplus-stores/barra-doce/functions/ssr/src/assets/style.css +2 -2
  13. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopFooter.vue +149 -0
  14. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopHeader.vue +2 -2
  15. package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/PageFooter.astro +68 -0
  16. package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/PageHeader.astro +1 -1
  17. package/ecomplus-stores/barra-doce/functions/ssr/src/main/Home.astro +6 -6
  18. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/index.astro +2 -0
  19. package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
  20. package/ecomplus-stores/barra-doce/package.json +2 -2
  21. package/ecomplus-stores/iluminim/.idx/dev.nix +24 -0
  22. package/ecomplus-stores/iluminim/functions/many/package.json +3 -3
  23. package/ecomplus-stores/iluminim/functions/ssr/content/extra-pages/contato.json +11 -0
  24. package/ecomplus-stores/iluminim/functions/ssr/content/extra-pages/terms.json +11 -0
  25. package/ecomplus-stores/iluminim/functions/ssr/content/extra-pages/trocas.json +11 -0
  26. package/ecomplus-stores/iluminim/functions/ssr/content/layout.json +30 -0
  27. package/ecomplus-stores/iluminim/functions/ssr/package.json +7 -7
  28. package/ecomplus-stores/iluminim/functions/ssr/src/assets/style.css +2 -2
  29. package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopFooter.vue +149 -0
  30. package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopHeader.vue +2 -2
  31. package/ecomplus-stores/iluminim/functions/ssr/src/layouts/PageFooter.astro +68 -0
  32. package/ecomplus-stores/iluminim/functions/ssr/src/layouts/PageHeader.astro +1 -1
  33. package/ecomplus-stores/iluminim/functions/ssr/src/pages/index.astro +2 -0
  34. package/ecomplus-stores/iluminim/functions/with-apps/package.json +3 -3
  35. package/ecomplus-stores/iluminim/package.json +2 -2
  36. package/ecomplus-stores/monocard/.idx/dev.nix +24 -0
  37. package/ecomplus-stores/monocard/functions/ssr/package.json +1 -1
  38. package/ecomplus-stores/tia-sonia/.idx/dev.nix +24 -0
  39. package/package.json +6 -6
  40. package/packages/api/package.json +1 -1
  41. package/packages/apps/affilate-program/package.json +1 -1
  42. package/packages/apps/correios/package.json +5 -3
  43. package/packages/apps/correios/tests/calculate-shipping.test.mjs +45 -0
  44. package/packages/apps/custom-payment/package.json +1 -1
  45. package/packages/apps/custom-shipping/package.json +4 -2
  46. package/packages/apps/custom-shipping/tests/calculate-shipping.test.mjs +37 -0
  47. package/packages/apps/datafrete/package.json +2 -2
  48. package/packages/apps/discounts/package.json +1 -1
  49. package/packages/apps/emails/package.json +1 -1
  50. package/packages/apps/fb-conversions/package.json +2 -2
  51. package/packages/apps/flash-courier/package.json +2 -2
  52. package/packages/apps/frenet/package.json +2 -2
  53. package/packages/apps/galaxpay/package.json +2 -2
  54. package/packages/apps/google-analytics/package.json +2 -2
  55. package/packages/apps/jadlog/package.json +2 -2
  56. package/packages/apps/loyalty-points/package.json +4 -2
  57. package/packages/apps/loyalty-points/tests/1-list-payments.test.mjs +37 -0
  58. package/packages/apps/loyalty-points/tests/2-create-transaction.test.mjs +41 -0
  59. package/packages/apps/melhor-envio/package.json +2 -2
  60. package/packages/apps/mercadopago/package.json +5 -3
  61. package/packages/apps/mercadopago/tests/1-list-payments.test.mjs +37 -0
  62. package/packages/apps/mercadopago/tests/2-create-transaction.test.mjs +42 -0
  63. package/packages/apps/pagarme/package.json +2 -2
  64. package/packages/apps/paghiper/package.json +2 -2
  65. package/packages/apps/pix/package.json +2 -2
  66. package/packages/apps/tiny-erp/package.json +2 -2
  67. package/packages/apps/webhooks/package.json +2 -2
  68. package/packages/cli/lib/cli.js +5 -1
  69. package/packages/cli/package.json +1 -1
  70. package/packages/cli/src/cli.ts +5 -1
  71. package/packages/config/package.json +1 -1
  72. package/packages/emails/package.json +2 -2
  73. package/packages/eslint/package.json +5 -5
  74. package/packages/events/package.json +1 -1
  75. package/packages/feeds/package.json +1 -1
  76. package/packages/firebase/package.json +2 -2
  77. package/packages/i18n/lib/en_us/i19allProducts.txt +1 -0
  78. package/packages/i18n/lib/en_us/i19institutional.txt +1 -0
  79. package/packages/i18n/lib/en_us.d.ts +2 -0
  80. package/packages/i18n/lib/en_us.js +2 -0
  81. package/packages/i18n/lib/en_us.js.map +1 -1
  82. package/packages/i18n/lib/pt_br/i19allProducts.txt +1 -0
  83. package/packages/i18n/lib/pt_br/i19institutional.txt +1 -0
  84. package/packages/i18n/lib/pt_br.d.ts +2 -0
  85. package/packages/i18n/lib/pt_br.js +2 -0
  86. package/packages/i18n/lib/pt_br.js.map +1 -1
  87. package/packages/i18n/package.json +1 -1
  88. package/packages/i18n/src/en_us.ts +2 -0
  89. package/packages/i18n/src/pt_br.ts +2 -0
  90. package/packages/modules/package.json +4 -3
  91. package/packages/modules/tests/modules.test.mjs +7 -8
  92. package/packages/passport/package.json +1 -1
  93. package/packages/ssr/lib/firebase/serve-storefront.js +44 -33
  94. package/packages/ssr/lib/firebase/serve-storefront.js.map +1 -1
  95. package/packages/ssr/package.json +6 -6
  96. package/packages/ssr/src/firebase/serve-storefront.ts +45 -34
  97. package/packages/storefront/config/storefront.cms.js +3 -1
  98. package/packages/storefront/config/storefront.config.mjs +8 -2
  99. package/packages/storefront/dist/client/_astro/{Carousel.63d511ab.js → Carousel.926668f2.js} +1 -1
  100. package/packages/storefront/dist/client/_astro/CartSidebar.eadba34f.js +1 -0
  101. package/packages/storefront/dist/client/_astro/HeroSlider.1f0524aa.js +1 -0
  102. package/packages/storefront/dist/client/_astro/PitchBar.7407eeaf.js +1 -0
  103. package/packages/storefront/dist/client/_astro/Prices.562a32ab.js +1 -0
  104. package/packages/storefront/dist/client/_astro/ProductShelf.763cd2ca.js +1 -0
  105. package/packages/storefront/dist/client/_astro/SearchModal.cffd4c2d.js +1 -0
  106. package/packages/storefront/dist/client/_astro/ShopHeader.126900a6.js +4 -0
  107. package/packages/storefront/dist/client/_astro/_...slug_.36cd433d.css +1 -0
  108. package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.ee681fa8.js +1 -0
  109. package/packages/storefront/dist/client/_astro/api.a2eda23e.js +1 -0
  110. package/packages/storefront/dist/client/_astro/client.e6d9439a.js +1 -0
  111. package/packages/storefront/dist/client/_astro/{firebase-app.1df8af9a.js → firebase-app.93857bfb.js} +121 -91
  112. package/packages/storefront/dist/client/_astro/format-money.923559cc.js +1 -0
  113. package/packages/storefront/dist/client/_astro/img.ec6ba316.js +1 -0
  114. package/packages/storefront/dist/client/_astro/index.709ac149.js +1 -0
  115. package/packages/storefront/dist/client/_astro/modules-info.48980668.js +1 -0
  116. package/packages/storefront/dist/client/manifest.webmanifest +1 -1
  117. package/packages/storefront/dist/client/sw.js +1 -1
  118. package/packages/storefront/dist/server/chunks/CartSidebar.2b555408.mjs +393 -0
  119. package/packages/storefront/dist/server/chunks/SearchModal.f418e188.mjs +44 -0
  120. package/packages/storefront/dist/server/chunks/_...d32bcc0c.mjs +35 -0
  121. package/packages/storefront/dist/server/chunks/{account@_@astro.a02ffb0b.mjs → account@_@astro.0106855f.mjs} +12 -4
  122. package/packages/storefront/dist/server/chunks/{astro.a7611b51.mjs → astro.bb5b7191.mjs} +141 -91
  123. package/packages/storefront/dist/server/chunks/{_...5323ec5a.mjs → endpoint@_@js.35807882.mjs} +12 -4
  124. package/packages/storefront/dist/server/chunks/{index@_@astro.d898498a.mjs → index@_@astro.477f5af1.mjs} +12 -4
  125. package/packages/storefront/dist/server/chunks/{index@_@astro.42c693b9.mjs → index@_@astro.e5a61d6e.mjs} +12 -4
  126. package/packages/storefront/dist/server/chunks/pages/{_...slug_.astro.0f33557e.mjs → _...slug_.astro.fd8a229f.mjs} +673 -937
  127. package/packages/storefront/dist/server/chunks/pages/{account.astro.9325adb2.mjs → account.astro.3b21bff8.mjs} +1 -1
  128. package/packages/storefront/dist/server/chunks/pages/endpoint.js.247079ba.mjs +119 -0
  129. package/packages/storefront/dist/server/chunks/pages/{index.astro.0f31fa39.mjs → index.astro.dab642f5.mjs} +605 -58
  130. package/packages/storefront/dist/server/chunks/pages/{~fallback.astro.bd93f01e.mjs → ~fallback.astro.7630c0d6.mjs} +25 -7
  131. package/packages/storefront/dist/server/chunks/{~fallback@_@astro.d17419ae.mjs → ~fallback@_@astro.65227dd7.mjs} +12 -4
  132. package/packages/storefront/dist/server/entry.mjs +28 -11
  133. package/packages/storefront/dist/server/manifest.webmanifest +1 -1
  134. package/packages/storefront/dist/server/renderers.mjs +80 -25
  135. package/packages/storefront/package.json +9 -8
  136. package/packages/storefront/src/helpers/server-data.ts +14 -17
  137. package/packages/storefront/src/images/use-ssr-picture.ts +18 -3
  138. package/packages/storefront/src/lib/components/BannerPictures.astro +4 -4
  139. package/packages/storefront/src/lib/components/PaymentMethodFlag.vue +2 -2
  140. package/packages/storefront/src/lib/components/SharedData.astro +1 -1
  141. package/packages/storefront/src/lib/composables/use-shared-data.ts +18 -3
  142. package/packages/storefront/src/lib/content.d.ts +36 -2
  143. package/packages/storefront/src/lib/layouts/Base.astro +3 -2
  144. package/packages/storefront/src/lib/layouts/use-page-main.ts +2 -2
  145. package/packages/storefront/src/lib/ssr-context.ts +1 -1
  146. package/packages/test-base/CHANGELOG.md +1 -0
  147. package/packages/test-base/README.md +7 -0
  148. package/packages/test-base/lib/endpoints.js +23 -0
  149. package/packages/test-base/lib/endpoints.js.map +1 -0
  150. package/packages/test-base/lib/index.js +4 -0
  151. package/packages/test-base/lib/index.js.map +1 -0
  152. package/packages/test-base/lib/playloads.js +14 -0
  153. package/packages/test-base/lib/playloads.js.map +1 -0
  154. package/packages/test-base/package.json +28 -0
  155. package/packages/test-base/payloads/calculate-shipping.json +37 -0
  156. package/packages/test-base/payloads/create-transaction.json +116 -0
  157. package/packages/test-base/payloads/list-payments.json +125 -0
  158. package/packages/test-base/src/endpoints.ts +37 -0
  159. package/packages/test-base/src/index.ts +3 -0
  160. package/packages/test-base/src/playloads.ts +24 -0
  161. package/packages/test-base/tsconfig.json +3 -0
  162. package/packages/types/package.json +1 -1
  163. package/ecomplus-stores/barra-doce/functions/ssr/content/extra-pages/.gitkeep +0 -0
  164. package/ecomplus-stores/iluminim/functions/ssr/content/extra-pages/.gitkeep +0 -0
  165. package/packages/storefront/dist/client/_astro/HeroSlider.8d2ea532.js +0 -1
  166. package/packages/storefront/dist/client/_astro/PitchBar.c2a2ad79.js +0 -1
  167. package/packages/storefront/dist/client/_astro/Prices.8572765c.js +0 -1
  168. package/packages/storefront/dist/client/_astro/ProductShelf.4a105932.js +0 -1
  169. package/packages/storefront/dist/client/_astro/ShopHeader.2400b065.js +0 -4
  170. package/packages/storefront/dist/client/_astro/_...slug_.a786e016.css +0 -1
  171. package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.48e557ba.js +0 -1
  172. package/packages/storefront/dist/client/_astro/client.9dbf6b61.js +0 -1
  173. package/packages/storefront/dist/client/_astro/ecom-icon_CDmhA.png +0 -0
  174. package/packages/storefront/dist/client/_astro/ecom-icon_Z27EX9f.png +0 -0
  175. package/packages/storefront/dist/client/_astro/ecom-icon_Zo1CLq.png +0 -0
  176. package/packages/storefront/dist/client/_astro/headphone_22qtrt.avif +0 -0
  177. package/packages/storefront/dist/client/_astro/headphone_247ud8.avif +0 -0
  178. package/packages/storefront/dist/client/_astro/headphone_Z1hoMcQ.webp +0 -0
  179. package/packages/storefront/dist/client/_astro/headphone_Z1j5MXv.webp +0 -0
  180. package/packages/storefront/dist/client/_astro/img.7def76a1.js +0 -1
  181. package/packages/storefront/dist/client/_astro/index.c0c35ead.js +0 -1
  182. package/packages/storefront/dist/client/_astro/logo_144owC.webp +0 -0
  183. package/packages/storefront/dist/client/_astro/logo_1ug3XF.png +0 -0
  184. package/packages/storefront/dist/client/_astro/logo_Z1EIN1I.avif +0 -0
  185. package/packages/storefront/dist/client/_astro/passion_29BEzB.webp +0 -0
  186. package/packages/storefront/dist/client/_astro/passion_2sykkb.avif +0 -0
  187. package/packages/storefront/dist/client/_astro/passion_HYj6i.webp +0 -0
  188. package/packages/storefront/dist/client/_astro/passion_Z18ANwS.avif +0 -0
  189. package/packages/storefront/dist/client/_astro/passion_ZK2FPz.webp +0 -0
  190. package/packages/storefront/dist/client/_astro/passion_pVNbE.avif +0 -0
  191. package/packages/storefront/dist/client/_astro/rect8589_1EUYOa.webp +0 -0
  192. package/packages/storefront/dist/client/_astro/rect8589_1Sqf3x.png +0 -0
  193. package/packages/storefront/dist/client/_astro/rect8589_1VeSii.avif +0 -0
  194. package/packages/storefront/dist/client/_astro/rect8589_2wFECM.png +0 -0
  195. package/packages/storefront/dist/client/_astro/rect8589_7mg8W.png +0 -0
  196. package/packages/storefront/dist/client/_astro/rect8589_Kv492.webp +0 -0
  197. package/packages/storefront/dist/client/_astro/rect8589_Z1DNkkN.webp +0 -0
  198. package/packages/storefront/dist/client/_astro/rect8589_Z1IS4wy.avif +0 -0
  199. package/packages/storefront/dist/client/_astro/rect8589_Zt4vbx.avif +0 -0
  200. package/packages/storefront/dist/client/_astro/rect859_1Bqr36.webp +0 -0
  201. package/packages/storefront/dist/client/_astro/rect859_1pj5UP.png +0 -0
  202. package/packages/storefront/dist/client/_astro/rect859_2dVuzq.avif +0 -0
  203. package/packages/storefront/dist/client/_astro/rect859_HaXay.png +0 -0
  204. package/packages/storefront/dist/client/_astro/rect859_Z100iy0.png +0 -0
  205. package/packages/storefront/dist/client/_astro/rect859_Z2i1RBz.avif +0 -0
  206. package/packages/storefront/dist/client/_astro/rect859_ZMRWqJ.webp +0 -0
  207. package/packages/storefront/dist/client/_astro/rect859_mPQHw.avif +0 -0
  208. package/packages/storefront/dist/client/_astro/rect859_xyq7d.webp +0 -0
  209. package/packages/storefront/dist/client/_astro/rect89_1DkX0O.webp +0 -0
  210. package/packages/storefront/dist/client/_astro/rect89_2uIqYp.avif +0 -0
  211. package/packages/storefront/dist/client/_astro/rect89_Z1rGPGT.webp +0 -0
  212. package/packages/storefront/dist/client/_astro/rect89_ZAjmIj.avif +0 -0
  213. package/packages/storefront/dist/client/~fallback.html +0 -98
  214. package/packages/storefront/dist/client/~index.html +0 -134
  215. package/packages/storefront/dist/server/images.dist.csv +0 -38
  216. package/packages/storefront/dist/server/images.src.csv +0 -11
  217. package/packages/storefront/dist/server/stylesheets.csv +0 -1
@@ -1,14 +1,23 @@
1
- import { c as createAstro, a as createComponent, r as renderTemplate, u as unescapeHTML, b as renderComponent, d as addAttribute, F as Fragment, m as maybeRenderHead, s as spreadAttributes, e as renderSlot, f as renderHead } from '../astro.a7611b51.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, u as unescapeHTML, b as renderComponent, d as addAttribute, F as Fragment, s as spreadAttributes, e as renderSlotToString, f as renderAllHeadContent, m as maybeRenderHead, g as renderSlot } from '../astro.bb5b7191.mjs';
2
12
  import api from '@cloudcommerce/api';
3
13
  import { EventEmitter } from 'node:events';
4
- import fs, { readFileSync } from 'node:fs';
5
- import { resolve, join } from 'node:path';
14
+ import fs from 'node:fs';
6
15
  import config from '@cloudcommerce/config';
7
- import { img, price, formatMoney, randomObjectId, nickname, onPromotion, name } from '@ecomplus/utils';
8
- /* empty css */import mime from 'mime';
9
- import { reactive, computed, shallowRef, useSSRContext, defineComponent, inject, mergeProps, ref, watch, toRef, onMounted, onBeforeUnmount, provide, createVNode, resolveDynamicComponent, withCtx, renderSlot as renderSlot$1, withDirectives, vShow, openBlock, createBlock, createCommentVNode, Fragment as Fragment$1, renderList, resolveComponent, withModifiers, Teleport, createTextVNode, toDisplayString } from 'vue';
10
- import { useScroll, useElementHover, useDebounceFn, useTimeout, watchDebounced, promiseTimeout } from '@vueuse/core';
11
- import { ssrRenderAttrs, ssrRenderSlot, ssrRenderClass, ssrRenderVNode, ssrRenderComponent, ssrRenderStyle, ssrRenderList, ssrIncludeBooleanAttr, ssrRenderAttr, ssrRenderTeleport, ssrInterpolate } from 'vue/server-renderer';
16
+ import { img, price, formatMoney, randomObjectId, nickname } from '@ecomplus/utils';
17
+ import { renderSync, parse, walkSync, ELEMENT_NODE } from 'ultrahtml';
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';
19
+ import { useScroll, useElementHover, useDebounceFn, useTimeout, watchDebounced, promiseTimeout, watchOnce } from '@vueuse/core';
20
+ import { ssrRenderAttrs, ssrRenderSlot, ssrRenderClass, ssrRenderVNode, ssrRenderComponent, ssrRenderStyle, ssrRenderList, ssrIncludeBooleanAttr, ssrRenderAttr, ssrRenderTeleport, ssrInterpolate, ssrRenderSuspense } from 'vue/server-renderer';
12
21
  import { Popover, PopoverButton, PopoverPanel, Menu, MenuButton, MenuItems, MenuItem } from '@headlessui/vue';
13
22
 
14
23
  const _export_sfc = (sfc, props) => {
@@ -19,6 +28,108 @@ const _export_sfc = (sfc, props) => {
19
28
  return target;
20
29
  };
21
30
 
31
+ function isOutputFormat(value) {
32
+ return ["avif", "jpeg", "jpg", "png", "webp", "svg"].includes(value);
33
+ }
34
+ function isOutputFormatSupportsAlpha(value) {
35
+ return ["avif", "png", "webp"].includes(value);
36
+ }
37
+ function isAspectRatioString(value) {
38
+ return /^\d*:\d*$/.test(value);
39
+ }
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
+ }
50
+ }
51
+ function isSSRService(service) {
52
+ return "transform" in service;
53
+ }
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
+ }
131
+ }
132
+
22
133
  global.__storefrontCMS = (fs, resolvePath) => {
23
134
  const { STOREFRONT_BASE_DIR } = process.env;
24
135
  let baseDir;
@@ -94,9 +205,15 @@ global.__storefrontCMS = (fs, resolvePath) => {
94
205
  };
95
206
 
96
207
  const _getConfig = () => {
97
- const { VITE_ECOM_STORE_ID } = (Object.assign({"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true,"SSR":true,"SITE":"https://ecom2-demo.web.app","ASSETS_PREFIX":undefined},{ECOM_STORE_ID:process.env.ECOM_STORE_ID,})) || process.env;
208
+ const {
209
+ ECOM_STORE_ID,
210
+ VITE_ECOM_STORE_ID,
211
+ PROD,
212
+ } = (Object.assign({"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true,"SSR":true,"SITE":"https://ecom2-demo.web.app","ASSETS_PREFIX":undefined},{ECOM_STORE_ID:process.env.ECOM_STORE_ID,})) || process.env;
98
213
  if (VITE_ECOM_STORE_ID) {
99
214
  config.set({ storeId: Number(VITE_ECOM_STORE_ID) });
215
+ } else if (ECOM_STORE_ID) {
216
+ config.set({ storeId: Number(ECOM_STORE_ID) });
100
217
  }
101
218
 
102
219
  const {
@@ -119,7 +236,7 @@ const _getConfig = () => {
119
236
  } catch {
120
237
  //
121
238
  }
122
- if (!storeId && false === true) {
239
+ if (!storeId && !PROD) {
123
240
  storeId = 1011;
124
241
  console.warn('> `storeId` is not set, using fallback 1011 for dev only\n');
125
242
  }
@@ -163,7 +280,7 @@ if (!globalThis.$storefront) {
163
280
  globalThis.$storefront = {
164
281
  settings: {},
165
282
  onLoad(callback) {
166
- emitter.on("load", callback);
283
+ emitter.once("load", callback);
167
284
  },
168
285
  data: {}
169
286
  };
@@ -202,20 +319,21 @@ const loadRouteContext = async (Astro, {
202
319
  const apiContext = {
203
320
  error: null
204
321
  };
322
+ const { slug } = Astro.params;
205
323
  if (isHomepage) {
206
324
  cmsContent = await config.getContent("pages/home");
207
- } else {
208
- const { slug } = Astro.params;
209
- if (slug) {
210
- if (contentCollection) {
211
- cmsContent = await config.getContent(`${contentCollection}/${slug}`);
212
- } else if (slug.startsWith("api/")) {
213
- const err = new Error("/api/* routes not implemented on SSR directly");
214
- Astro.response.status = 501;
215
- err.responseHTML = `<head></head><body>${err.message}</body>`;
216
- throw err;
217
- } else {
218
- fetchingApiContext = api.get(`slugs/${slug}`).then((response) => {
325
+ } else if (slug) {
326
+ if (contentCollection) {
327
+ cmsContent = await config.getContent(`${contentCollection}/${slug}`);
328
+ } else if (slug.startsWith("api/")) {
329
+ const err = new Error("/api/* routes not implemented on SSR directly");
330
+ Astro.response.status = 501;
331
+ err.responseHTML = `<head></head><body>${err.message}</body>`;
332
+ throw err;
333
+ } else {
334
+ const prefetchingsIndex = apiPrefetchings.findIndex((pr) => pr === null);
335
+ fetchingApiContext = new Promise((resolve, reject) => {
336
+ api.get(`slugs/${slug}`).then((response) => {
219
337
  Object.assign(apiContext, response.data);
220
338
  const apiResource = apiContext.resource;
221
339
  const apiDoc = apiContext.doc;
@@ -225,16 +343,18 @@ const loadRouteContext = async (Astro, {
225
343
  doc: apiDoc,
226
344
  timestamp: Date.now()
227
345
  };
228
- return response;
229
- });
230
- const index = apiPrefetchings.findIndex((pr) => pr === null);
231
- if (index > -1) {
232
- apiPrefetchings[index] = fetchingApiContext;
233
- } else {
234
- fetchingApiContext.catch((err) => {
346
+ resolve(null);
347
+ }).catch((err) => {
348
+ if (prefetchingsIndex > -1) {
349
+ reject(err);
350
+ } else {
235
351
  apiContext.error = err;
236
- });
237
- }
352
+ resolve(null);
353
+ }
354
+ });
355
+ });
356
+ if (prefetchingsIndex > -1) {
357
+ apiPrefetchings[prefetchingsIndex] = fetchingApiContext;
238
358
  }
239
359
  }
240
360
  }
@@ -246,6 +366,8 @@ const loadRouteContext = async (Astro, {
246
366
  if (!apiState[apiStateKey]) {
247
367
  apiState[apiStateKey] = data.result || data;
248
368
  }
369
+ } else if (slug && apiContext.doc) {
370
+ apiState[`slugs/${slug}`] = apiContext;
249
371
  }
250
372
  });
251
373
  } catch (err) {
@@ -402,98 +524,286 @@ window.$isCmsPreview = true;`;
402
524
  url: `https://${domain}/`,
403
525
  logo: `https://${domain}${settings.logo}`
404
526
  });
405
- return renderTemplate(_a$2 || (_a$2 = __template$2(['<meta charset="UTF-8"><meta name="viewport" content="width=device-width"><meta name="theme-color"', '><link rel="icon" type="image/png"', ' sizes="32x32">', "<title>", '</title><meta name="description"', '><meta name="author"', '><meta name="generator"', '><link rel="canonical"', ">", '<meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="default"><meta property="og:site_name"', '><meta property="og:url"', '><meta property="og:title"', '><meta property="og:description"', '><meta property="og:type" content="website"><meta property="og:locale"', ">", "", '<meta name="twitter:card" content="summary">', '<meta name="ecom-store-id"', ">", "", "<script>", '<\/script><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));
527
+ 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<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));
406
528
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/BaseHead.astro", void 0);
407
529
 
408
- const { STOREFRONT_BASE_DIR } = process.env;
409
- const baseDir = STOREFRONT_BASE_DIR || process.cwd();
410
- const builtImages = [];
411
- const manifestFilepath = join(baseDir, "dist/server/images.dist.csv");
412
- readFileSync(manifestFilepath, "utf-8").split(/\n/).forEach((line) => {
413
- const [filename, width, height] = line.split(",");
414
- builtImages.push({
415
- filename,
416
- width: Number(width),
417
- height: Number(height)
418
- });
419
- });
420
- builtImages.sort((a, b) => {
421
- if (a.width < b.width)
422
- return -1;
423
- return 1;
424
- });
425
- const getBuiltImage = async ({ src, width, format }) => {
426
- const filename = src.replace(/^.*\//, "").replace(/.\w+(\?.*)?$/, "");
427
- const filenameRegExp = new RegExp(`[_.][a-z0-9]+\\.${format}$`, "i");
428
- const matchFilename = (_builtImage) => {
429
- return filename === _builtImage.filename.replace(filenameRegExp, "");
430
- };
431
- let builtImage = builtImages.find((_builtImage) => {
432
- return _builtImage.width >= width && matchFilename(_builtImage);
433
- });
434
- if (!builtImage) {
435
- builtImage = builtImages.find(matchFilename);
530
+ function has(value) {
531
+ return typeof value === "string";
532
+ }
533
+ function is(a, b) {
534
+ return a === b;
535
+ }
536
+ function any(a, b) {
537
+ return has(a) && b.includes(a.toLowerCase());
538
+ }
539
+ const ElementWeights = {
540
+ META: 10,
541
+ TITLE: 9,
542
+ PRECONNECT: 8,
543
+ ASYNC_SCRIPT: 7,
544
+ IMPORT_STYLES: 6,
545
+ SYNC_SCRIPT: 5,
546
+ SYNC_STYLES: 4,
547
+ PRELOAD: 3,
548
+ DEFER_SCRIPT: 2,
549
+ PREFETCH_PRERENDER: 1,
550
+ OTHER: 0
551
+ };
552
+ const ElementDetectors = {
553
+ META: isMeta,
554
+ TITLE: isTitle,
555
+ PRECONNECT: isPreconnect,
556
+ DEFER_SCRIPT: isDeferScript,
557
+ ASYNC_SCRIPT: isAsyncScript,
558
+ IMPORT_STYLES: isImportStyles,
559
+ SYNC_SCRIPT: isSyncScript,
560
+ SYNC_STYLES: isSyncStyles,
561
+ PRELOAD: isPreload,
562
+ PREFETCH_PRERENDER: isPrefetchPrerender
563
+ };
564
+ const META_HTTP_EQUIV_KEYWORDS = [
565
+ "accept-ch",
566
+ "content-security-policy",
567
+ "content-type",
568
+ "default-style",
569
+ "delegate-ch",
570
+ "origin-trial",
571
+ "x-dns-prefetch-control"
572
+ ];
573
+ function isMeta(name, a) {
574
+ if (name === "base")
575
+ return true;
576
+ if (name !== "meta")
577
+ return false;
578
+ return has(a.charset) || is(a.name, "viewport") || any(a["http-equiv"], META_HTTP_EQUIV_KEYWORDS);
579
+ }
580
+ function isTitle(name) {
581
+ return name === "title";
582
+ }
583
+ function isPreconnect(name, { rel }) {
584
+ return name === "link" && is(rel, "preconnect");
585
+ }
586
+ function isAsyncScript(name, { src, async }) {
587
+ return name === "script" && has(src) && has(async);
588
+ }
589
+ function isImportStyles(name, a, children) {
590
+ const importRe = /@import/;
591
+ if (name === "style") {
592
+ return importRe.test(children);
436
593
  }
437
- if (builtImage) {
438
- return {
439
- src: `/_astro/${builtImage.filename}`,
440
- width: builtImage.width,
441
- height: builtImage.height
442
- };
594
+ return false;
595
+ }
596
+ function isSyncScript(name, { src, defer, async, type = "" }) {
597
+ if (name !== "script")
598
+ return false;
599
+ return !(has(src) && (has(defer) || has(async) || is(type, "module")) || type.includes("json"));
600
+ }
601
+ function isSyncStyles(name, { rel }) {
602
+ if (name === "style")
603
+ return true;
604
+ return name === "link" && is(rel, "stylesheet");
605
+ }
606
+ function isPreload(name, { rel }) {
607
+ return name === "link" && any(rel, ["preload", "modulepreload"]);
608
+ }
609
+ function isDeferScript(name, { src, defer, async, type }) {
610
+ if (name !== "script")
611
+ return false;
612
+ return has(src) && has(defer) || has(src) && is(type, "module") && !has(async);
613
+ }
614
+ function isPrefetchPrerender(name, { rel }) {
615
+ return name === "link" && any(rel, ["prefetch", "dns-prefetch", "prerender"]);
616
+ }
617
+ function getWeight(element) {
618
+ for (const [id, detector] of Object.entries(ElementDetectors)) {
619
+ const children = element.name === "style" && element.children.length > 0 ? renderSync(element) : "";
620
+ if (detector(element.name, element.attributes, children)) {
621
+ return ElementWeights[id];
622
+ }
443
623
  }
444
- console.warn(`Could not match built ${format} image for ${src} ${width}px`);
445
- return { src, width };
446
- };
624
+ return ElementWeights.OTHER;
625
+ }
626
+
627
+ function capo(html) {
628
+ const ast = parse(html);
629
+ try {
630
+ walkSync(ast, (node, parent, index) => {
631
+ if (node.type === ELEMENT_NODE && node.name === "head") {
632
+ if (parent) {
633
+ parent.children.splice(index, 1, getSortedHead(node));
634
+ throw "done";
635
+ }
636
+ }
637
+ });
638
+ } catch (e) {
639
+ if (e !== "done")
640
+ throw e;
641
+ }
642
+ return renderSync(ast);
643
+ }
644
+ function getSortedHead(head) {
645
+ const weightedChildren = head.children.map((node) => {
646
+ if (node.type === ELEMENT_NODE) {
647
+ const weight = getWeight(node);
648
+ return [weight, node];
649
+ }
650
+ }).filter(Boolean);
651
+ const children = weightedChildren.sort((a, b) => b[0] - a[0]).map(([_, element]) => element);
652
+ return { ...head, children };
653
+ }
447
654
 
655
+ const Head = createComponent({
656
+ factory: async (result, props, slots) => {
657
+ let head = "";
658
+ head += `<head${spreadAttributes(props)} data-capo>`;
659
+ head += await renderSlotToString(result, slots.default);
660
+ head += renderAllHeadContent(result);
661
+ head += "</head>";
662
+ return unescapeHTML(capo(head));
663
+ }
664
+ });
665
+
666
+ function isRemoteImage(src) {
667
+ return /^(https?:)?\/\//.test(src);
668
+ }
448
669
  function removeQueryString(src) {
449
670
  const index = src.lastIndexOf("?");
450
671
  return index > 0 ? src.substring(0, index) : src;
451
672
  }
452
- function basename(src) {
453
- return removeQueryString(src.replace(/^.*[\\\/]/, ""));
454
- }
455
- const extname = (src) => {
673
+ function extname(src) {
456
674
  const base = basename(src);
457
675
  const index = base.lastIndexOf(".");
458
676
  if (index <= 0) {
459
677
  return "";
460
678
  }
461
679
  return base.substring(index);
462
- };
463
- function parseAspectRatio(aspectRatio) {
464
- if (!aspectRatio) {
465
- return void 0;
680
+ }
681
+ function basename(src) {
682
+ return removeQueryString(src.replace(/^.*[\\\/]/, ""));
683
+ }
684
+
685
+ function resolveSize(transform) {
686
+ if (transform.width && transform.height) {
687
+ return transform;
466
688
  }
467
- if (typeof aspectRatio === "number") {
468
- return aspectRatio;
689
+ if (!transform.width && !transform.height) {
690
+ throw new Error(`"width" and "height" cannot both be undefined`);
691
+ }
692
+ if (!transform.aspectRatio) {
693
+ throw new Error(
694
+ `"aspectRatio" must be included if only "${transform.width ? "width" : "height"}" is provided`
695
+ );
696
+ }
697
+ let aspectRatio;
698
+ if (typeof transform.aspectRatio === "number") {
699
+ aspectRatio = transform.aspectRatio;
700
+ } else {
701
+ const [width, height] = transform.aspectRatio.split(":");
702
+ aspectRatio = Number.parseInt(width) / Number.parseInt(height);
703
+ }
704
+ if (transform.width) {
705
+ return {
706
+ ...transform,
707
+ width: transform.width,
708
+ height: Math.round(transform.width / aspectRatio)
709
+ };
710
+ } else if (transform.height) {
711
+ return {
712
+ ...transform,
713
+ width: Math.round(transform.height * aspectRatio),
714
+ height: transform.height
715
+ };
716
+ }
717
+ return transform;
718
+ }
719
+ async function resolveTransform(input) {
720
+ if (typeof input.src === "string") {
721
+ return resolveSize(input);
722
+ }
723
+ const metadata = "then" in input.src ? (await input.src).default : input.src;
724
+ let { width, height, aspectRatio, background, format = metadata.format, ...rest } = input;
725
+ if (!width && !height) {
726
+ width = metadata.width;
727
+ height = metadata.height;
728
+ } else if (width) {
729
+ let ratio = parseAspectRatio(aspectRatio) || metadata.width / metadata.height;
730
+ height = height || Math.round(width / ratio);
731
+ } else if (height) {
732
+ let ratio = parseAspectRatio(aspectRatio) || metadata.width / metadata.height;
733
+ width = width || Math.round(height * ratio);
734
+ }
735
+ return {
736
+ ...rest,
737
+ src: metadata.src,
738
+ width,
739
+ height,
740
+ aspectRatio,
741
+ format,
742
+ background
743
+ };
744
+ }
745
+ async function getImage(transform) {
746
+ var _a, _b, _c;
747
+ if (!transform.src) {
748
+ throw new Error("[@astrojs/image] `src` is required");
749
+ }
750
+ let loader = (_a = globalThis.astroImage) == null ? void 0 : _a.loader;
751
+ if (!loader) {
752
+ const { default: mod } = await import('./endpoint.js.247079ba.mjs').then(n => n.s).catch(() => {
753
+ throw new Error(
754
+ "[@astrojs/image] Builtin image loader not found. (Did you remember to add the integration to your Astro config?)"
755
+ );
756
+ });
757
+ loader = mod;
758
+ globalThis.astroImage = globalThis.astroImage || {};
759
+ globalThis.astroImage.loader = loader;
760
+ }
761
+ const resolved = await resolveTransform(transform);
762
+ const attributes = await loader.getImageAttributes(resolved);
763
+ 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;
764
+ const isLocalImage = !isRemoteImage(resolved.src);
765
+ const _loader = isDev && isLocalImage ? globalThis.astroImage.defaultLoader : loader;
766
+ if (!_loader) {
767
+ throw new Error("@astrojs/image: loader not found!");
768
+ }
769
+ const { searchParams } = isSSRService(_loader) ? _loader.serializeTransform(resolved) : globalThis.astroImage.defaultLoader.serializeTransform(resolved);
770
+ const imgSrc = !isLocalImage && resolved.src.startsWith("//") ? `https:${resolved.src}` : resolved.src;
771
+ let src;
772
+ if (/^[\/\\]?@astroimage/.test(imgSrc)) {
773
+ src = `${imgSrc}?${searchParams.toString()}`;
774
+ } else {
775
+ searchParams.set("href", imgSrc);
776
+ src = `/_image?${searchParams.toString()}`;
469
777
  }
470
- const [width, height] = aspectRatio.split(":");
471
- return parseInt(width, 10) / parseInt(height, 10);
778
+ if ((_c = globalThis.astroImage) == null ? void 0 : _c.addStaticImage) {
779
+ src = globalThis.astroImage.addStaticImage(resolved);
780
+ }
781
+ return {
782
+ ...attributes,
783
+ src
784
+ };
472
785
  }
786
+
473
787
  async function resolveAspectRatio({ src, aspectRatio }) {
474
788
  if (typeof src === "string") {
475
789
  return parseAspectRatio(aspectRatio);
790
+ } else {
791
+ const metadata = "then" in src ? (await src).default : src;
792
+ return parseAspectRatio(aspectRatio) || metadata.width / metadata.height;
476
793
  }
477
- throw new Error('Custom (faster) `Picture.ssr.astro` works only with string ("remote") src');
478
794
  }
479
795
  async function resolveFormats({ src, formats }) {
480
796
  const unique = new Set(formats);
481
797
  if (typeof src === "string") {
482
798
  unique.add(extname(src).replace(".", ""));
483
799
  } else {
484
- throw new Error("Custom `Picture.ssr.astro` works only with string src");
800
+ const metadata = "then" in src ? (await src).default : src;
801
+ unique.add(extname(metadata.src).replace(".", ""));
485
802
  }
486
803
  return Array.from(unique).filter(Boolean);
487
804
  }
488
- async function getBuiltPicture(params) {
489
- const {
490
- src,
491
- alt,
492
- widths,
493
- fit,
494
- position,
495
- background
496
- } = params;
805
+ async function getPicture(params) {
806
+ const { src, alt, widths, fit, position, background } = params;
497
807
  if (!src) {
498
808
  throw new Error("[@astrojs/image] `src` is required");
499
809
  }
@@ -511,7 +821,8 @@ async function getBuiltPicture(params) {
511
821
  async function getSource(format) {
512
822
  const imgs = await Promise.all(
513
823
  widths.map(async (width) => {
514
- const img = await getBuiltImage({
824
+ var _a;
825
+ const img = await getImage({
515
826
  src,
516
827
  alt,
517
828
  format,
@@ -524,7 +835,7 @@ async function getBuiltPicture(params) {
524
835
  if (format === lastFormat && width === maxWidth) {
525
836
  image = img;
526
837
  }
527
- return `${img.src} ${width}w`;
838
+ return `${(_a = img.src) == null ? void 0 : _a.replaceAll(" ", encodeURI)} ${width}w`;
528
839
  })
529
840
  );
530
841
  return {
@@ -535,7 +846,7 @@ async function getBuiltPicture(params) {
535
846
  const sources = await Promise.all(allFormats.map((format) => getSource(format)));
536
847
  return {
537
848
  sources,
538
- // @ts-ignore
849
+ // @ts-expect-error image will always be defined
539
850
  image
540
851
  };
541
852
  }
@@ -576,10 +887,25 @@ const useSSRPicture = async (params) => {
576
887
  }
577
888
  } else if ((!attrs.width || !attrs.height) && typeof src === "string") {
578
889
  const { width, height } = tryImageSize(src);
579
- if (height) {
890
+ if (width && height) {
580
891
  aspectRatio = getAspectRatio({ width, height }, tryImageSize);
581
- attrs.width = width;
582
- attrs.height = height;
892
+ let hasSplicedWidths = false;
893
+ for (let i = widths.length - 1; i >= 0; i--) {
894
+ if (widths[i] > width) {
895
+ widths.splice(i, 1);
896
+ hasSplicedWidths = true;
897
+ }
898
+ }
899
+ if (hasSplicedWidths) {
900
+ attrs.width = width;
901
+ attrs.height = height;
902
+ if (!widths.find((w) => w === width)) {
903
+ widths.push(width);
904
+ }
905
+ } else {
906
+ attrs.width = Math.max(...widths);
907
+ attrs.height = Math.round(attrs.width / aspectRatio);
908
+ }
583
909
  }
584
910
  }
585
911
  let sizes = propSizes || "";
@@ -670,27 +996,18 @@ const $$Astro$7 = createAstro("https://ecom2-demo.web.app");
670
996
  const $$Picture = createComponent(async ($$result, $$props, $$slots) => {
671
997
  const Astro2 = $$result.createAstro($$Astro$7, $$props, $$slots);
672
998
  Astro2.self = $$Picture;
673
- const { STOREFRONT_BASE_DIR } = process.env;
674
- const baseDir = STOREFRONT_BASE_DIR || process.cwd();
675
- const originalImages = [];
676
- const manifestFilepath = join(baseDir, "dist/server/images.src.csv");
677
- readFileSync(manifestFilepath, "utf-8").split(/\n/).forEach((line) => {
678
- const [filepath, width, height] = line.split(",");
679
- originalImages.push({
680
- filepath,
681
- width: Number(width),
682
- height: Number(height)
683
- });
684
- });
999
+ const deployRand = ({}).DEPLOY_RAND;
1000
+ const versionSuffix = ({}).BUILD_OUTPUT !== "static" && deployRand ? `&V=${deployRand}` : "";
1001
+ const getImageFilepath = (src) => {
1002
+ return resolve(process.env.STOREFRONT_BASE_DIR, `public${src}`);
1003
+ };
685
1004
  const tryImageSize = (src) => {
686
1005
  let dimensions = {};
687
1006
  if (typeof src === "string" && src.startsWith("/")) {
688
- const originalImage = originalImages.find(({ filepath }) => {
689
- return new RegExp(`^/${filepath}\\??.*`).test(src);
690
- });
691
- if (originalImage) {
692
- const { width, height } = originalImage;
693
- dimensions = { width, height };
1007
+ try {
1008
+ dimensions = sizeOf(getImageFilepath(src));
1009
+ } catch (e) {
1010
+ dimensions = {};
694
1011
  }
695
1012
  }
696
1013
  return dimensions;
@@ -703,17 +1020,35 @@ const $$Picture = createComponent(async ($$result, $$props, $$slots) => {
703
1020
  } = await useSSRPicture({
704
1021
  ...Astro2.props,
705
1022
  tryImageSize,
706
- getPicture: getBuiltPicture
1023
+ getPicture
707
1024
  });
708
- return renderTemplate`${maybeRenderHead()}<picture${spreadAttributes(pictureAttrs)}>${sources.map((attrs) => renderTemplate`<source${spreadAttributes(attrs)}${addAttribute(sizes, "sizes")}>`)}${imgAttrs && renderTemplate`<img${spreadAttributes(imgAttrs)}>`}</picture>`;
709
- }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/images/Picture.runtime.astro", void 0);
1025
+ if (imgAttrs) {
1026
+ imgAttrs.src += versionSuffix;
1027
+ }
1028
+ return renderTemplate`${maybeRenderHead()}<picture${spreadAttributes(pictureAttrs)}>
1029
+ ${sources.map((attrs) => {
1030
+ if (versionSuffix) {
1031
+ attrs.srcset = attrs.srcset.replace(/\s(\w+)$/, `${versionSuffix} $1`);
1032
+ }
1033
+ return renderTemplate`<source${spreadAttributes(attrs)}${addAttribute(sizes, "sizes")}>`;
1034
+ })}
1035
+ ${imgAttrs && renderTemplate`<img${spreadAttributes(imgAttrs)}>`}
1036
+ </picture>`;
1037
+ }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/components/Picture.astro", void 0);
710
1038
 
711
1039
  const $$Astro$6 = createAstro("https://ecom2-demo.web.app");
712
1040
  const $$BaseBody = createComponent(async ($$result, $$props, $$slots) => {
713
1041
  const Astro2 = $$result.createAstro($$Astro$6, $$props, $$slots);
714
1042
  Astro2.self = $$BaseBody;
715
1043
  const { settings } = Astro2.locals.routeContext;
716
- return renderTemplate`${maybeRenderHead()}<body><div id="teleported-overlap" class="relative z-[59]"></div><div id="teleported-top" class="relative z-[19]"></div>${renderSlot($$result, $$slots["default"])}${renderSlot($$result, $$slots["before-body-end"])}<div id="teleported-bottom" class="relative z-[19]"></div>${settings.icon && renderTemplate`${renderComponent($$result, "Picture", $$Picture, { "src": settings.icon, "alt": "Icon", "formats": ["png"], "widths": [32, 192, 512], "sizes": "32px", "class": "hidden absolute", "style": "bottom: -1000px", "hasImg": false })}`}</body>`;
1044
+ return renderTemplate`${maybeRenderHead()}<body>
1045
+ <div id="teleported-overlap" class="relative z-[59]"></div>
1046
+ <div id="teleported-top" class="relative z-[19]"></div>
1047
+ ${renderSlot($$result, $$slots["default"])}
1048
+ ${renderSlot($$result, $$slots["before-body-end"])}
1049
+ <div id="teleported-bottom" class="relative z-[19]"></div>
1050
+ ${settings.icon && renderTemplate`${renderComponent($$result, "Picture", $$Picture, { "src": settings.icon, "alt": "Icon", "formats": ["png"], "widths": [32, 192, 512], "sizes": "32px", "class": "hidden absolute", "style": "bottom: -1000px", "hasImg": false })}`}
1051
+ </body>`;
717
1052
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/BaseBody.astro", void 0);
718
1053
 
719
1054
  const $$Astro$5 = createAstro("https://ecom2-demo.web.app");
@@ -722,7 +1057,16 @@ const $$Base$1 = createComponent(async ($$result, $$props, $$slots) => {
722
1057
  Astro2.self = $$Base$1;
723
1058
  const { getContent } = Astro2.locals.routeContext;
724
1059
  const { custom_code: customCodeContent } = await getContent("layout");
725
- return renderTemplate`<head>${renderSlot($$result, $$slots["base-head"])}${customCodeContent?.css && renderTemplate`<style>{customCodeContent.css}</style>`}${customCodeContent?.html_head && renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`${unescapeHTML(customCodeContent.html_head)}` })}`}${renderSlot($$result, $$slots["base-head-scripts"])}${renderSlot($$result, $$slots["before-head-end"])}${renderHead()}</head>${renderComponent($$result, "BaseBody", $$BaseBody, {}, { "default": ($$result2) => renderTemplate`${renderSlot($$result2, $$slots["default"])}${customCodeContent?.html_body && renderTemplate`${renderComponent($$result2, "Fragment", Fragment, {}, { "default": ($$result3) => renderTemplate`${unescapeHTML(customCodeContent.html_body)}` })}`}${renderSlot($$result2, $$slots["base-body-scripts"])}${renderSlot($$result2, $$slots["before-body-end"])}` })}`;
1060
+ return renderTemplate`${renderComponent($$result, "Head", Head, {}, { "default": ($$result2) => renderTemplate`
1061
+ ${renderSlot($$result2, $$slots["base-head"])}
1062
+ ${customCodeContent?.css && renderTemplate`<style>{customCodeContent.css}</style>`}${customCodeContent?.html_head && renderTemplate`${renderComponent($$result2, "Fragment", Fragment, {}, { "default": ($$result3) => renderTemplate`${unescapeHTML(customCodeContent.html_head)}` })}`}${renderSlot($$result2, $$slots["base-head-scripts"])}
1063
+ ${renderSlot($$result2, $$slots["before-head-end"])}
1064
+ ` })}
1065
+ ${renderComponent($$result, "BaseBody", $$BaseBody, {}, { "default": ($$result2) => renderTemplate`
1066
+ ${renderSlot($$result2, $$slots["default"])}
1067
+ ${customCodeContent?.html_body && renderTemplate`${renderComponent($$result2, "Fragment", Fragment, {}, { "default": ($$result3) => renderTemplate`${unescapeHTML(customCodeContent.html_body)}` })}`}${renderSlot($$result2, $$slots["base-body-scripts"])}
1068
+ ${renderSlot($$result2, $$slots["before-body-end"])}
1069
+ ` })}`;
726
1070
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/Base.astro", void 0);
727
1071
 
728
1072
  var __freeze$1 = Object.freeze;
@@ -740,7 +1084,13 @@ const $$Astro$3 = createAstro("https://ecom2-demo.web.app");
740
1084
  const $$Base = createComponent(async ($$result, $$props, $$slots) => {
741
1085
  const Astro2 = $$result.createAstro($$Astro$3, $$props, $$slots);
742
1086
  Astro2.self = $$Base;
743
- return renderTemplate`${renderComponent($$result, "SfBase", $$Base$1, {}, { "base-head": ($$result2) => renderTemplate`${renderComponent($$result2, "Fragment", Fragment, { "slot": "base-head" }, { "default": ($$result3) => renderTemplate`${renderSlot($$result3, $$slots["base-head"])}` })}`, "before-head-end": ($$result2) => renderTemplate`${renderComponent($$result2, "InlineScripts", $$InlineScripts, { "slot": "before-head-end" })}`, "default": ($$result2) => renderTemplate`${renderSlot($$result2, $$slots["default"])}` })}`;
1087
+ return renderTemplate`${renderComponent($$result, "SfBase", $$Base$1, {}, { "base-head": ($$result2) => renderTemplate`${renderComponent($$result2, "Fragment", Fragment, { "slot": "base-head" }, { "default": ($$result3) => renderTemplate`
1088
+ ${renderSlot($$result3, $$slots["base-head"])}
1089
+ ` })}`, "before-head-end": ($$result2) => renderTemplate`${renderComponent($$result2, "InlineScripts", $$InlineScripts, { "slot": "before-head-end" })}`, "default": ($$result2) => renderTemplate`
1090
+
1091
+
1092
+ ${renderSlot($$result2, $$slots["default"])}
1093
+ ` })}`;
744
1094
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/Base.astro", void 0);
745
1095
 
746
1096
  const checkObjNotNull = (obj) => {
@@ -802,10 +1152,6 @@ userAgent.includes("Safari") && !userAgent.includes("Chrome");
802
1152
  const isIOS = /iPad|iPhone|iPod/.test(userAgent) && !window.MSStream;
803
1153
  const isMobile = isIOS || /Android|webOS|BlackBerry|IEMobile|Opera Mini/i.test(userAgent);
804
1154
 
805
- const {
806
- settings,
807
- apiContext
808
- } = globalThis.$storefront;
809
1155
  const networkNames = [
810
1156
  "whatsapp",
811
1157
  "instagram",
@@ -813,14 +1159,21 @@ const networkNames = [
813
1159
  "twitter",
814
1160
  "youtube",
815
1161
  "tiktok",
816
- "pinterest"
1162
+ "pinterest",
1163
+ "threads"
817
1164
  ];
818
1165
  const socialNetworks = {};
819
- networkNames.forEach((network) => {
820
- if (settings[network]) {
821
- socialNetworks[network] = settings[network];
822
- }
823
- });
1166
+ const setSocialNetworks = () => {
1167
+ const { settings } = globalThis.$storefront;
1168
+ networkNames.forEach((network) => {
1169
+ if (settings[network]) {
1170
+ socialNetworks[network] = settings[network];
1171
+ }
1172
+ });
1173
+ };
1174
+ {
1175
+ global.$storefront.onLoad(() => setSocialNetworks());
1176
+ }
824
1177
 
825
1178
  let id = -1;
826
1179
  const useId = () => String(++id);
@@ -900,10 +1253,7 @@ const usePitchBar = (props) => {
900
1253
  const usePageHeader = async ({ routeContext, listedCategoryFields }) => {
901
1254
  const { apiState, getContent } = routeContext;
902
1255
  const layoutContent = await getContent("layout");
903
- const {
904
- header: headerContent,
905
- service_links: serviceLinks
906
- } = layoutContent;
1256
+ const { header: headerContent } = layoutContent;
907
1257
  const pitchBar = parseLayoutContent(layoutContent);
908
1258
  let { categories } = apiState;
909
1259
  if (!categories) {
@@ -928,8 +1278,7 @@ const usePageHeader = async ({ routeContext, listedCategoryFields }) => {
928
1278
  categories,
929
1279
  menuCategorySlugs: headerContent.inline_menu_categories?.featured,
930
1280
  menuRandomCategories: headerContent.inline_menu_categories?.random,
931
- isAlphabeticalSortSubmenu: headerContent.alphabetical_sort_submenu,
932
- serviceLinks
1281
+ isAlphabeticalSortSubmenu: headerContent.alphabetical_sort_submenu
933
1282
  };
934
1283
  return {
935
1284
  pitchBar,
@@ -945,7 +1294,7 @@ window.$storefront.data['${field}'] = ${JSON.stringify(value)};`
945
1294
  };
946
1295
  };
947
1296
 
948
- const _sfc_main$j = /* @__PURE__ */ defineComponent({
1297
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
949
1298
  __name: "CarouselControl",
950
1299
  props: {
951
1300
  isPrev: { type: Boolean, default: false }
@@ -958,7 +1307,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
958
1307
  return __returned__;
959
1308
  }
960
1309
  });
961
- function _sfc_ssrRender$j(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
1310
+ function _sfc_ssrRender$c(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
962
1311
  _push(`<button${ssrRenderAttrs(mergeProps({
963
1312
  type: "button",
964
1313
  "aria-label": !$props.isPrev ? "Pr\xF3ximo" : "Anterior",
@@ -970,16 +1319,16 @@ function _sfc_ssrRender$j(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
970
1319
  }, _push, _parent);
971
1320
  _push(`</button>`);
972
1321
  }
973
- const _sfc_setup$j = _sfc_main$j.setup;
974
- _sfc_main$j.setup = (props, ctx) => {
1322
+ const _sfc_setup$c = _sfc_main$c.setup;
1323
+ _sfc_main$c.setup = (props, ctx) => {
975
1324
  const ssrContext = useSSRContext();
976
1325
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/CarouselControl.vue");
977
- return _sfc_setup$j ? _sfc_setup$j(props, ctx) : void 0;
1326
+ return _sfc_setup$c ? _sfc_setup$c(props, ctx) : void 0;
978
1327
  };
979
- const CarouselControl = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["ssrRender", _sfc_ssrRender$j]]);
1328
+ const CarouselControl = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["ssrRender", _sfc_ssrRender$c]]);
980
1329
 
981
1330
  const carouselKey = Symbol("carousel");
982
- const _sfc_main$i = /* @__PURE__ */ defineComponent({
1331
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
983
1332
  __name: "Carousel",
984
1333
  props: {
985
1334
  as: { default: "ul" },
@@ -1140,7 +1489,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
1140
1489
  return __returned__;
1141
1490
  }
1142
1491
  });
1143
- function _sfc_ssrRender$i(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
1492
+ function _sfc_ssrRender$b(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
1144
1493
  _push(`<div${ssrRenderAttrs(mergeProps({
1145
1494
  ref: "carousel",
1146
1495
  class: "relative",
@@ -1197,15 +1546,15 @@ function _sfc_ssrRender$i(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
1197
1546
  }, _push, _parent);
1198
1547
  _push(`</div>`);
1199
1548
  }
1200
- const _sfc_setup$i = _sfc_main$i.setup;
1201
- _sfc_main$i.setup = (props, ctx) => {
1549
+ const _sfc_setup$b = _sfc_main$b.setup;
1550
+ _sfc_main$b.setup = (props, ctx) => {
1202
1551
  const ssrContext = useSSRContext();
1203
1552
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/Carousel.vue");
1204
- return _sfc_setup$i ? _sfc_setup$i(props, ctx) : void 0;
1553
+ return _sfc_setup$b ? _sfc_setup$b(props, ctx) : void 0;
1205
1554
  };
1206
- const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["ssrRender", _sfc_ssrRender$i]]);
1555
+ const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["ssrRender", _sfc_ssrRender$b]]);
1207
1556
 
1208
- const _sfc_main$h = /* @__PURE__ */ defineComponent({
1557
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
1209
1558
  __name: "PitchBar",
1210
1559
  props: {
1211
1560
  slides: {}
@@ -1222,7 +1571,8 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
1222
1571
  return __returned__;
1223
1572
  }
1224
1573
  });
1225
- function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
1574
+ function _sfc_ssrRender$a(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
1575
+ const _component_ALink = resolveComponent("ALink");
1226
1576
  _push(`<div${ssrRenderAttrs(mergeProps({ class: "bg-base-100 relative z-20" }, _attrs))}><div class="container md:w-2/3 mx-auto px-3 py-1">`);
1227
1577
  _push(ssrRenderComponent($setup["Carousel"], {
1228
1578
  autoplay: $setup.countValidSlides > 1 ? 7e3 : void 0
@@ -1255,7 +1605,7 @@ function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
1255
1605
  _push2(`<!--[-->`);
1256
1606
  ssrRenderList($props.slides, (slide, i) => {
1257
1607
  _push2(`<li class="shrink-0 basis-full h-full text-center"${_scopeId}>`);
1258
- ssrRenderVNode(_push2, createVNode(resolveDynamicComponent(slide.href ? "ALink" : "span"), {
1608
+ _push2(ssrRenderComponent(_component_ALink, {
1259
1609
  href: slide.href,
1260
1610
  target: slide.target,
1261
1611
  class: ["inline-block px-8", slide.href ? "hover:underline" : null]
@@ -1278,7 +1628,7 @@ function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
1278
1628
  }
1279
1629
  }),
1280
1630
  _: 2
1281
- }), _parent2, _scopeId);
1631
+ }, _parent2, _scopeId));
1282
1632
  _push2(`</li>`);
1283
1633
  });
1284
1634
  _push2(`<!--]-->`);
@@ -1289,7 +1639,7 @@ function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
1289
1639
  key: i,
1290
1640
  class: "shrink-0 basis-full h-full text-center"
1291
1641
  }, [
1292
- (openBlock(), createBlock(resolveDynamicComponent(slide.href ? "ALink" : "span"), {
1642
+ createVNode(_component_ALink, {
1293
1643
  href: slide.href,
1294
1644
  target: slide.target,
1295
1645
  class: ["inline-block px-8", slide.href ? "hover:underline" : null]
@@ -1302,7 +1652,7 @@ function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
1302
1652
  }, null, 8, ["innerHTML"])) : createCommentVNode("", true)
1303
1653
  ]),
1304
1654
  _: 2
1305
- }, 1032, ["href", "target", "class"]))
1655
+ }, 1032, ["href", "target", "class"])
1306
1656
  ]);
1307
1657
  }), 128))
1308
1658
  ];
@@ -1312,13 +1662,13 @@ function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
1312
1662
  }, _parent));
1313
1663
  _push(`</div></div>`);
1314
1664
  }
1315
- const _sfc_setup$h = _sfc_main$h.setup;
1316
- _sfc_main$h.setup = (props, ctx) => {
1665
+ const _sfc_setup$a = _sfc_main$a.setup;
1666
+ _sfc_main$a.setup = (props, ctx) => {
1317
1667
  const ssrContext = useSSRContext();
1318
1668
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/PitchBar.vue");
1319
- return _sfc_setup$h ? _sfc_setup$h(props, ctx) : void 0;
1669
+ return _sfc_setup$a ? _sfc_setup$a(props, ctx) : void 0;
1320
1670
  };
1321
- const PitchBar = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["ssrRender", _sfc_ssrRender$h]]);
1671
+ const PitchBar = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["ssrRender", _sfc_ssrRender$a]]);
1322
1672
 
1323
1673
  const useStorage = (key, initialValue, storage = globalThis.localStorage) => {
1324
1674
  if (!storage) {
@@ -1505,7 +1855,7 @@ const useStickyHeader = (props) => {
1505
1855
  y.value = nextY;
1506
1856
  }, {
1507
1857
  debounce: isMobile ? 100 : 50,
1508
- maxWait: isMobile ? 300 : 150
1858
+ maxWait: isMobile ? 800 : 400
1509
1859
  });
1510
1860
  const isSticky = computed(() => ready.value && y.value > staticY.value * 1.2);
1511
1861
  const transition = ref("none");
@@ -1628,7 +1978,7 @@ const useShopHeader = (props) => {
1628
1978
  };
1629
1979
  };
1630
1980
 
1631
- const _sfc_main$g = /* @__PURE__ */ defineComponent({
1981
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
1632
1982
  __name: "Drawer",
1633
1983
  props: {
1634
1984
  modelValue: { type: Boolean, default: false },
@@ -1695,7 +2045,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
1695
2045
  return __returned__;
1696
2046
  }
1697
2047
  });
1698
- function _sfc_ssrRender$g(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2048
+ function _sfc_ssrRender$9(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
1699
2049
  const _component_Fade = resolveComponent("Fade");
1700
2050
  _push(ssrRenderComponent(_component_Fade, mergeProps({
1701
2051
  slide: $setup.slideTo,
@@ -1715,7 +2065,7 @@ function _sfc_ssrRender$g(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
1715
2065
  maxWidth: !$setup.isPlacementX ? `calc(100vw - ${$setup.scrollbarWidth}px)` : void 0
1716
2066
  })}"${ssrIncludeBooleanAttr($props.modelValue) ? " open" : ""}${ssrRenderAttr("data-drawer", $props.placement)}${_scopeId}><div class="relative h-full"${_scopeId}>`);
1717
2067
  if ($props.hasCloseButton) {
1718
- _push2(`<button type="button"${ssrRenderAttr("aria-label", "Fechar")} class="${ssrRenderClass([$props.placement === "end" ? "left-2" : "right-2", "absolute top-2"])}" data-drawer-close${_scopeId}>`);
2068
+ _push2(`<button type="button"${ssrRenderAttr("aria-label", "Fechar")} class="${ssrRenderClass([$props.placement === "end" ? "left-2" : "right-2", "absolute top-2 z-30"])}" data-drawer-close${_scopeId}>`);
1719
2069
  ssrRenderSlot(_ctx.$slots, "close", {}, () => {
1720
2070
  _push2(`<i class="i-close text-base-400 hover:text-base-600 text-3xl"${_scopeId}></i>`);
1721
2071
  }, _push2, _parent2, _scopeId);
@@ -1775,7 +2125,7 @@ function _sfc_ssrRender$g(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
1775
2125
  type: "button",
1776
2126
  "aria-label": "Fechar",
1777
2127
  onClick: withModifiers($setup.close, ["prevent"]),
1778
- class: ["absolute top-2", $props.placement === "end" ? "left-2" : "right-2"],
2128
+ class: ["absolute top-2 z-30", $props.placement === "end" ? "left-2" : "right-2"],
1779
2129
  "data-drawer-close": ""
1780
2130
  }, [
1781
2131
  renderSlot$1(_ctx.$slots, "close", {}, () => [
@@ -1803,13 +2153,13 @@ function _sfc_ssrRender$g(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
1803
2153
  _: 3
1804
2154
  }, _parent));
1805
2155
  }
1806
- const _sfc_setup$g = _sfc_main$g.setup;
1807
- _sfc_main$g.setup = (props, ctx) => {
2156
+ const _sfc_setup$9 = _sfc_main$9.setup;
2157
+ _sfc_main$9.setup = (props, ctx) => {
1808
2158
  const ssrContext = useSSRContext();
1809
2159
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/Drawer.vue");
1810
- return _sfc_setup$g ? _sfc_setup$g(props, ctx) : void 0;
2160
+ return _sfc_setup$9 ? _sfc_setup$9(props, ctx) : void 0;
1811
2161
  };
1812
- const Drawer = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["ssrRender", _sfc_ssrRender$g]]);
2162
+ const Drawer = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["ssrRender", _sfc_ssrRender$9]]);
1813
2163
 
1814
2164
  const storageKey = "ecomSession";
1815
2165
  const emptySession = {
@@ -1848,7 +2198,7 @@ const initializeFirebaseAuth = (canWaitIdle = !window.location.pathname.startsWi
1848
2198
  return;
1849
2199
  };
1850
2200
 
1851
- const _sfc_main$f = /* @__PURE__ */ defineComponent({
2201
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
1852
2202
  __name: "AccountLink",
1853
2203
  props: {
1854
2204
  to: {},
@@ -1883,20 +2233,20 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
1883
2233
  return __returned__;
1884
2234
  }
1885
2235
  });
1886
- function _sfc_ssrRender$f(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2236
+ function _sfc_ssrRender$8(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
1887
2237
  _push(`<a${ssrRenderAttrs(mergeProps({ href: $setup.href }, _attrs))}>`);
1888
2238
  ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
1889
2239
  _push(`</a>`);
1890
2240
  }
1891
- const _sfc_setup$f = _sfc_main$f.setup;
1892
- _sfc_main$f.setup = (props, ctx) => {
2241
+ const _sfc_setup$8 = _sfc_main$8.setup;
2242
+ _sfc_main$8.setup = (props, ctx) => {
1893
2243
  const ssrContext = useSSRContext();
1894
2244
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/AccountLink.vue");
1895
- return _sfc_setup$f ? _sfc_setup$f(props, ctx) : void 0;
2245
+ return _sfc_setup$8 ? _sfc_setup$8(props, ctx) : void 0;
1896
2246
  };
1897
- const AccountLink = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["ssrRender", _sfc_ssrRender$f]]);
2247
+ const AccountLink = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["ssrRender", _sfc_ssrRender$8]]);
1898
2248
 
1899
- const _sfc_main$e = /* @__PURE__ */ defineComponent({
2249
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1900
2250
  __name: "SocialNetworkIcon",
1901
2251
  props: {
1902
2252
  as: { default: "i" },
@@ -1921,6 +2271,8 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
1921
2271
  return "i-tiktok";
1922
2272
  case "twitter":
1923
2273
  return "i-twitter";
2274
+ case "threads":
2275
+ return "i-threads";
1924
2276
  default:
1925
2277
  return "";
1926
2278
  }
@@ -1930,18 +2282,18 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
1930
2282
  return __returned__;
1931
2283
  }
1932
2284
  });
1933
- function _sfc_ssrRender$e(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2285
+ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
1934
2286
  ssrRenderVNode(_push, createVNode(resolveDynamicComponent($props.as), mergeProps({ class: $setup.iconClassName }, _attrs), null), _parent);
1935
2287
  }
1936
- const _sfc_setup$e = _sfc_main$e.setup;
1937
- _sfc_main$e.setup = (props, ctx) => {
2288
+ const _sfc_setup$7 = _sfc_main$7.setup;
2289
+ _sfc_main$7.setup = (props, ctx) => {
1938
2290
  const ssrContext = useSSRContext();
1939
2291
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/SocialNetworkIcon.vue");
1940
- return _sfc_setup$e ? _sfc_setup$e(props, ctx) : void 0;
2292
+ return _sfc_setup$7 ? _sfc_setup$7(props, ctx) : void 0;
1941
2293
  };
1942
- const SocialNetworkIcon = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["ssrRender", _sfc_ssrRender$e]]);
2294
+ const SocialNetworkIcon = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["ssrRender", _sfc_ssrRender$7]]);
1943
2295
 
1944
- const _sfc_main$d = /* @__PURE__ */ defineComponent({
2296
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
1945
2297
  __name: "SocialNetworkLink",
1946
2298
  props: {
1947
2299
  network: {},
@@ -1967,7 +2319,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
1967
2319
  return __returned__;
1968
2320
  }
1969
2321
  });
1970
- function _sfc_ssrRender$d(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2322
+ function _sfc_ssrRender$6(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
1971
2323
  const _component_ALink = resolveComponent("ALink");
1972
2324
  _push(ssrRenderComponent(_component_ALink, mergeProps({ href: $setup.fixedHref }, _attrs), {
1973
2325
  default: withCtx((_, _push2, _parent2, _scopeId) => {
@@ -1988,15 +2340,15 @@ function _sfc_ssrRender$d(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
1988
2340
  _: 3
1989
2341
  }, _parent));
1990
2342
  }
1991
- const _sfc_setup$d = _sfc_main$d.setup;
1992
- _sfc_main$d.setup = (props, ctx) => {
2343
+ const _sfc_setup$6 = _sfc_main$6.setup;
2344
+ _sfc_main$6.setup = (props, ctx) => {
1993
2345
  const ssrContext = useSSRContext();
1994
2346
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/SocialNetworkLink.vue");
1995
- return _sfc_setup$d ? _sfc_setup$d(props, ctx) : void 0;
2347
+ return _sfc_setup$6 ? _sfc_setup$6(props, ctx) : void 0;
1996
2348
  };
1997
- const SocialNetworkLink = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["ssrRender", _sfc_ssrRender$d]]);
2349
+ const SocialNetworkLink = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["ssrRender", _sfc_ssrRender$6]]);
1998
2350
 
1999
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
2351
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
2000
2352
  __name: "ShopSidenavCategory",
2001
2353
  props: {
2002
2354
  categoryTree: {}
@@ -2019,7 +2371,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
2019
2371
  return __returned__;
2020
2372
  }
2021
2373
  });
2022
- function _sfc_ssrRender$c(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2374
+ function _sfc_ssrRender$5(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2023
2375
  const _component_AImg = resolveComponent("AImg");
2024
2376
  const _component_ShopSidenavCategory = resolveComponent("ShopSidenavCategory", true);
2025
2377
  _push(`<li${ssrRenderAttrs(mergeProps({ class: "text-lg text-base-800" }, _attrs))}>`);
@@ -2057,15 +2409,15 @@ function _sfc_ssrRender$c(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2057
2409
  }
2058
2410
  _push(`</li>`);
2059
2411
  }
2060
- const _sfc_setup$c = _sfc_main$c.setup;
2061
- _sfc_main$c.setup = (props, ctx) => {
2412
+ const _sfc_setup$5 = _sfc_main$5.setup;
2413
+ _sfc_main$5.setup = (props, ctx) => {
2062
2414
  const ssrContext = useSSRContext();
2063
2415
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopSidenavCategory.vue");
2064
- return _sfc_setup$c ? _sfc_setup$c(props, ctx) : void 0;
2416
+ return _sfc_setup$5 ? _sfc_setup$5(props, ctx) : void 0;
2065
2417
  };
2066
- const ShopSidenavCategory = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["ssrRender", _sfc_ssrRender$c]]);
2418
+ const ShopSidenavCategory = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["ssrRender", _sfc_ssrRender$5]]);
2067
2419
 
2068
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
2420
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
2069
2421
  __name: "ShopSidenav",
2070
2422
  props: {
2071
2423
  categoryTrees: {}
@@ -2086,7 +2438,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
2086
2438
  return __returned__;
2087
2439
  }
2088
2440
  });
2089
- function _sfc_ssrRender$b(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2441
+ function _sfc_ssrRender$4(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2090
2442
  _push(`<aside${ssrRenderAttrs(mergeProps({ class: "flex flex-col h-full" }, _attrs))}><nav class="py-4 grow"><ul class="relative h-full"><!--[-->`);
2091
2443
  ssrRenderList($props.categoryTrees, (categoryTree, i) => {
2092
2444
  _push(ssrRenderComponent($setup["ShopSidenavCategory"], {
@@ -2127,13 +2479,13 @@ function _sfc_ssrRender$b(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2127
2479
  });
2128
2480
  _push(`<!--]--></ul></footer></aside>`);
2129
2481
  }
2130
- const _sfc_setup$b = _sfc_main$b.setup;
2131
- _sfc_main$b.setup = (props, ctx) => {
2482
+ const _sfc_setup$4 = _sfc_main$4.setup;
2483
+ _sfc_main$4.setup = (props, ctx) => {
2132
2484
  const ssrContext = useSSRContext();
2133
2485
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopSidenav.vue");
2134
- return _sfc_setup$b ? _sfc_setup$b(props, ctx) : void 0;
2486
+ return _sfc_setup$4 ? _sfc_setup$4(props, ctx) : void 0;
2135
2487
  };
2136
- const ShopSidenav = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["ssrRender", _sfc_ssrRender$b]]);
2488
+ const ShopSidenav = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["ssrRender", _sfc_ssrRender$4]]);
2137
2489
 
2138
2490
  const useShopHeaderSubmenu = (props) => {
2139
2491
  const categoryPicture = computed(() => {
@@ -2182,7 +2534,7 @@ const useShopHeaderSubmenu = (props) => {
2182
2534
  };
2183
2535
  };
2184
2536
 
2185
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
2537
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
2186
2538
  __name: "ShopHeaderSubmenu",
2187
2539
  props: {
2188
2540
  categoryTree: {},
@@ -2208,7 +2560,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
2208
2560
  return __returned__;
2209
2561
  }
2210
2562
  });
2211
- function _sfc_ssrRender$a(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2563
+ function _sfc_ssrRender$3(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2212
2564
  const _component_Fade = resolveComponent("Fade");
2213
2565
  const _component_AImg = resolveComponent("AImg");
2214
2566
  _push(ssrRenderComponent($setup["Popover"], _attrs, {
@@ -2498,15 +2850,15 @@ function _sfc_ssrRender$a(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2498
2850
  _: 3
2499
2851
  }, _parent));
2500
2852
  }
2501
- const _sfc_setup$a = _sfc_main$a.setup;
2502
- _sfc_main$a.setup = (props, ctx) => {
2853
+ const _sfc_setup$3 = _sfc_main$3.setup;
2854
+ _sfc_main$3.setup = (props, ctx) => {
2503
2855
  const ssrContext = useSSRContext();
2504
2856
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopHeaderSubmenu.vue");
2505
- return _sfc_setup$a ? _sfc_setup$a(props, ctx) : void 0;
2857
+ return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
2506
2858
  };
2507
- const ShopHeaderSubmenu = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["ssrRender", _sfc_ssrRender$a]]);
2859
+ const ShopHeaderSubmenu = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["ssrRender", _sfc_ssrRender$3]]);
2508
2860
 
2509
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
2861
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
2510
2862
  __name: "ShopHeaderMenu",
2511
2863
  props: {
2512
2864
  inlineMenuTrees: {}
@@ -2522,7 +2874,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
2522
2874
  return __returned__;
2523
2875
  }
2524
2876
  });
2525
- function _sfc_ssrRender$9(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2877
+ function _sfc_ssrRender$2(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2526
2878
  _push(`<nav${ssrRenderAttrs(_attrs)}><ul class="${ssrRenderClass([$props.inlineMenuTrees.length < 7 ? "text-base" : "text-sm", "flex gap-4 xl:gap-5 text-base-700"])}"><!--[-->`);
2527
2879
  ssrRenderList($props.inlineMenuTrees, (categoryTree, i) => {
2528
2880
  _push(`<li>`);
@@ -2566,32 +2918,16 @@ function _sfc_ssrRender$9(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2566
2918
  });
2567
2919
  _push(`<!--]--></ul></nav>`);
2568
2920
  }
2569
- const _sfc_setup$9 = _sfc_main$9.setup;
2570
- _sfc_main$9.setup = (props, ctx) => {
2921
+ const _sfc_setup$2 = _sfc_main$2.setup;
2922
+ _sfc_main$2.setup = (props, ctx) => {
2571
2923
  const ssrContext = useSSRContext();
2572
2924
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopHeaderMenu.vue");
2573
- return _sfc_setup$9 ? _sfc_setup$9(props, ctx) : void 0;
2574
- };
2575
- const ShopHeaderMenu = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["ssrRender", _sfc_ssrRender$9]]);
2576
-
2577
- const _sfc_main$8 = {};
2578
-
2579
- function _sfc_ssrRender$8(_ctx, _push, _parent, _attrs) {
2580
- _push(`<div${ssrRenderAttrs(mergeProps({ class: "w-full h-40 bg-base-300" }, _attrs))}></div>`);
2581
- }
2582
- const _sfc_setup$8 = _sfc_main$8.setup;
2583
- _sfc_main$8.setup = (props, ctx) => {
2584
- const ssrContext = useSSRContext()
2585
- ;(ssrContext.modules || (ssrContext.modules = new Set())).add("src/components/SearchModal.vue");
2586
- return _sfc_setup$8 ? _sfc_setup$8(props, ctx) : undefined
2925
+ return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
2587
2926
  };
2588
- const SearchModal = /*#__PURE__*/_export_sfc(_sfc_main$8, [['ssrRender',_sfc_ssrRender$8]]);
2927
+ const ShopHeaderMenu = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["ssrRender", _sfc_ssrRender$2]]);
2589
2928
 
2590
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
2929
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
2591
2930
  __name: "AccountMenu",
2592
- props: {
2593
- serviceLinks: {}
2594
- },
2595
2931
  setup(__props, { expose: __expose }) {
2596
2932
  __expose();
2597
2933
  const __returned__ = { get Menu() {
@@ -2617,7 +2953,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
2617
2953
  return __returned__;
2618
2954
  }
2619
2955
  });
2620
- function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2956
+ function _sfc_ssrRender$1(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2621
2957
  const _component_Fade = resolveComponent("Fade");
2622
2958
  const _component_ALink = resolveComponent("ALink");
2623
2959
  _push(ssrRenderComponent($setup["Menu"], mergeProps({
@@ -2759,7 +3095,7 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2759
3095
  _: 2
2760
3096
  }, _parent4, _scopeId3));
2761
3097
  _push4(`<!--[-->`);
2762
- ssrRenderList($props.serviceLinks, ({ title, href }, i) => {
3098
+ ssrRenderList(_ctx.$settings.service_links, ({ title, href }, i) => {
2763
3099
  _push4(ssrRenderComponent($setup["MenuItem"], {
2764
3100
  as: "li",
2765
3101
  key: `s-${i}`
@@ -2906,7 +3242,7 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2906
3242
  ]),
2907
3243
  _: 1
2908
3244
  }),
2909
- (openBlock(true), createBlock(Fragment$1, null, renderList($props.serviceLinks, ({ title, href }, i) => {
3245
+ (openBlock(true), createBlock(Fragment$1, null, renderList(_ctx.$settings.service_links, ({ title, href }, i) => {
2910
3246
  return openBlock(), createBlock($setup["MenuItem"], {
2911
3247
  as: "li",
2912
3248
  key: `s-${i}`
@@ -3017,7 +3353,7 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
3017
3353
  ]),
3018
3354
  _: 1
3019
3355
  }),
3020
- (openBlock(true), createBlock(Fragment$1, null, renderList($props.serviceLinks, ({ title, href }, i) => {
3356
+ (openBlock(true), createBlock(Fragment$1, null, renderList(_ctx.$settings.service_links, ({ title, href }, i) => {
3021
3357
  return openBlock(), createBlock($setup["MenuItem"], {
3022
3358
  as: "li",
3023
3359
  key: `s-${i}`
@@ -3147,7 +3483,7 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
3147
3483
  ]),
3148
3484
  _: 1
3149
3485
  }),
3150
- (openBlock(true), createBlock(Fragment$1, null, renderList($props.serviceLinks, ({ title, href }, i) => {
3486
+ (openBlock(true), createBlock(Fragment$1, null, renderList(_ctx.$settings.service_links, ({ title, href }, i) => {
3151
3487
  return openBlock(), createBlock($setup["MenuItem"], {
3152
3488
  as: "li",
3153
3489
  key: `s-${i}`
@@ -3209,701 +3545,17 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
3209
3545
  _: 3
3210
3546
  }, _parent));
3211
3547
  }
3212
- const _sfc_setup$7 = _sfc_main$7.setup;
3213
- _sfc_main$7.setup = (props, ctx) => {
3214
- const ssrContext = useSSRContext();
3215
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/AccountMenu.vue");
3216
- return _sfc_setup$7 ? _sfc_setup$7(props, ctx) : void 0;
3217
- };
3218
- const AccountMenu = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["ssrRender", _sfc_ssrRender$7]]);
3219
-
3220
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
3221
- __name: "CheckoutLink",
3222
- props: {
3223
- to: { default: "cart" },
3224
- cartUrl: { default: globalThis.$storefront.settings.cart_url || "/app/#/cart" },
3225
- checkoutUrl: { default: globalThis.$storefront.settings.checkout_url || "/app/#/checkout" }
3226
- },
3227
- setup(__props, { expose: __expose }) {
3228
- __expose();
3229
- const props = __props;
3230
- const href = computed(() => {
3231
- if (props.to === "cart")
3232
- return props.cartUrl;
3233
- return props.checkoutUrl;
3234
- });
3235
- const __returned__ = { props, href };
3236
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
3237
- return __returned__;
3238
- }
3239
- });
3240
- function _sfc_ssrRender$6(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3241
- _push(`<a${ssrRenderAttrs(mergeProps({ href: $setup.href }, _attrs))}>`);
3242
- ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
3243
- _push(`</a>`);
3244
- }
3245
- const _sfc_setup$6 = _sfc_main$6.setup;
3246
- _sfc_main$6.setup = (props, ctx) => {
3247
- const ssrContext = useSSRContext();
3248
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/CheckoutLink.vue");
3249
- return _sfc_setup$6 ? _sfc_setup$6(props, ctx) : void 0;
3250
- };
3251
- const CheckoutLink = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["ssrRender", _sfc_ssrRender$6]]);
3252
-
3253
- const getPriceWithDiscount = (price, discount) => {
3254
- const { type, value } = discount;
3255
- let priceWithDiscount;
3256
- if (value) {
3257
- if (type === "percentage") {
3258
- priceWithDiscount = price * ((100 - value) / 100);
3259
- } else {
3260
- priceWithDiscount = price - value;
3261
- }
3262
- return priceWithDiscount > 0 ? priceWithDiscount : 0;
3263
- }
3264
- return price;
3265
- };
3266
- const usePrices = (props) => {
3267
- const _product = computed(() => {
3268
- return props.product || {
3269
- price: props.price || 0,
3270
- base_price: props.basePrice
3271
- };
3272
- });
3273
- const hasVariedPrices = computed(() => {
3274
- const { variations } = _product.value;
3275
- if (variations) {
3276
- const productPrice = price(_product.value);
3277
- for (let i = 0; i < variations.length; i++) {
3278
- const price$1 = price({
3279
- ..._product.value,
3280
- ...variations[i]
3281
- });
3282
- if (price$1 > productPrice) {
3283
- return true;
3284
- }
3285
- }
3286
- }
3287
- return false;
3288
- });
3289
- const salePrice = computed(() => {
3290
- const price$1 = price(_product.value);
3291
- const discount = availableExtraDiscount.value;
3292
- if (discount && (!discount.min_amount || price$1 > discount.min_amount)) {
3293
- return getPriceWithDiscount(price$1, discount);
3294
- }
3295
- return price$1;
3296
- });
3297
- const comparePrice = computed(() => {
3298
- if (onPromotion(_product.value)) {
3299
- return _product.value.base_price;
3300
- }
3301
- const price$1 = price(_product.value);
3302
- if (price$1 > salePrice.value) {
3303
- return price$1;
3304
- }
3305
- return 0;
3306
- });
3307
- const installmentsObject = computed(() => {
3308
- return props.installmentsOption || installmentsOption.value || { max_number: 1 };
3309
- });
3310
- const installmentsNumber = computed(() => {
3311
- if (installmentsObject.value.max_number <= 1) {
3312
- return 1;
3313
- }
3314
- const minInstallment = installmentsObject.value.min_installment || 5;
3315
- const maxInstallmentsNumber = Math.floor(salePrice.value / minInstallment);
3316
- return Math.min(maxInstallmentsNumber, installmentsObject.value.max_number);
3317
- });
3318
- const monthlyInterest = computed(() => {
3319
- return installmentsObject.value.monthly_interest || 0;
3320
- });
3321
- const installmentValue = computed(() => {
3322
- if (installmentsNumber.value >= 2) {
3323
- if (!monthlyInterest.value) {
3324
- return salePrice.value / installmentsNumber.value;
3325
- }
3326
- const interest = monthlyInterest.value / 100;
3327
- return salePrice.value * interest / (1 - (1 + interest) ** -installmentsNumber.value);
3328
- }
3329
- return 0;
3330
- });
3331
- const discountObject = computed(() => {
3332
- const discount = props.discountOption || discountOption.value;
3333
- if (discount && (!discount.min_amount || discount.min_amount <= salePrice.value) && (!props.isAmountTotal || discount.apply_at === "total")) {
3334
- return discount;
3335
- }
3336
- return {};
3337
- });
3338
- const discountLabel = computed(() => {
3339
- const { label } = discountObject.value;
3340
- if (label) {
3341
- if (label.includes(" ")) {
3342
- return label;
3343
- }
3344
- return `via ${label}`;
3345
- }
3346
- return "";
3347
- });
3348
- const priceWithDiscount = computed(() => {
3349
- return getPriceWithDiscount(salePrice.value, discountObject.value);
3350
- });
3351
- const pointsProgramObject = computed(() => {
3352
- if (props.loyaltyPointsProgram) {
3353
- return props.loyaltyPointsProgram;
3354
- }
3355
- const pointsPrograms = loyaltyPointsPrograms.value;
3356
- if (pointsPrograms) {
3357
- const programIds = Object.keys(pointsPrograms);
3358
- for (let i = 0; i < programIds.length; i++) {
3359
- const program = pointsPrograms[programIds[i]];
3360
- if (program?.earn_percentage && program.earn_percentage > 0) {
3361
- return program;
3362
- }
3363
- }
3364
- }
3365
- return { ratio: 0 };
3366
- });
3367
- const pointsMinPrice = computed(() => {
3368
- return pointsProgramObject.value.min_subtotal_to_earn || 0;
3369
- });
3370
- const pointsProgramName = computed(() => {
3371
- return pointsProgramObject.value.name || "";
3372
- });
3373
- const earnPointsPercentage = computed(() => {
3374
- return pointsProgramObject.value.earn_percentage || 0;
3375
- });
3376
- const cashbackPercentage = computed(() => {
3377
- return earnPointsPercentage.value * pointsProgramObject.value.ratio;
3378
- });
3379
- const cashbackValue = computed(() => {
3380
- return cashbackPercentage.value >= 1 ? salePrice.value * (cashbackPercentage.value / 100) : 0;
3381
- });
3382
- return {
3383
- hasVariedPrices,
3384
- salePrice,
3385
- comparePrice,
3386
- installmentsObject,
3387
- installmentsNumber,
3388
- monthlyInterest,
3389
- installmentValue,
3390
- discountObject,
3391
- discountLabel,
3392
- priceWithDiscount,
3393
- pointsProgramObject,
3394
- pointsMinPrice,
3395
- pointsProgramName,
3396
- earnPointsPercentage,
3397
- cashbackPercentage,
3398
- cashbackValue
3399
- };
3400
- };
3401
-
3402
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
3403
- __name: "Prices",
3404
- props: {
3405
- isBig: { type: Boolean },
3406
- isLiteral: { type: Boolean },
3407
- hasCashback: { type: Boolean, default: true },
3408
- hasPriceOptions: { type: Boolean, default: true },
3409
- product: {},
3410
- price: {},
3411
- basePrice: {},
3412
- isAmountTotal: { type: Boolean },
3413
- installmentsOption: {},
3414
- discountOption: {},
3415
- loyaltyPointsProgram: {}
3416
- },
3417
- setup(__props, { expose: __expose }) {
3418
- __expose();
3419
- const props = __props;
3420
- const {
3421
- hasVariedPrices,
3422
- salePrice,
3423
- comparePrice,
3424
- cashbackPercentage,
3425
- cashbackValue,
3426
- installmentsNumber,
3427
- monthlyInterest,
3428
- installmentValue,
3429
- priceWithDiscount,
3430
- discountLabel
3431
- } = usePrices(props);
3432
- const __returned__ = { props, hasVariedPrices, salePrice, comparePrice, cashbackPercentage, cashbackValue, installmentsNumber, monthlyInterest, installmentValue, priceWithDiscount, discountLabel };
3433
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
3434
- return __returned__;
3435
- }
3436
- });
3437
- function _sfc_ssrRender$5(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3438
- const _component_Fade = resolveComponent("Fade");
3439
- _push(`<div${ssrRenderAttrs(mergeProps({
3440
- class: ["text-base-600 [&>div]:[font-size:90%] [&_small]:lowercase [&_small]:[font-size:92%]", $props.isBig ? "text-lg" : null],
3441
- "data-prices": ""
3442
- }, _attrs))}>`);
3443
- if ($setup.comparePrice) {
3444
- _push(`<span class="text-base-500 mr-1 text-[87%]">`);
3445
- if ($props.isLiteral) {
3446
- _push(`<small>${ssrInterpolate(`${"De"} `)}</small>`);
3447
- } else {
3448
- _push(`<!---->`);
3449
- }
3450
- _push(`<s>${ssrInterpolate(_ctx.$money($setup.comparePrice))}</s>`);
3451
- if ($props.isLiteral) {
3452
- _push(`<small>${ssrInterpolate(` ${"Por"}`)}</small>`);
3453
- } else {
3454
- _push(`<!---->`);
3455
- }
3456
- _push(`</span>`);
3457
- } else {
3458
- _push(`<!---->`);
3459
- }
3460
- _push(`<strong class="${ssrRenderClass([$props.isBig ? "text-5xl block" : null, "inline-block text-base-800"])}">`);
3461
- if ($setup.hasVariedPrices) {
3462
- _push(`<small>${ssrInterpolate(`${"A partir de"} `)}</small>`);
3463
- } else {
3464
- _push(`<!---->`);
3465
- }
3466
- _push(` ${ssrInterpolate(_ctx.$money($setup.salePrice))}</strong>`);
3467
- _push(ssrRenderComponent(_component_Fade, { slide: "down" }, {
3468
- default: withCtx((_, _push2, _parent2, _scopeId) => {
3469
- if (_push2) {
3470
- if ($setup.cashbackValue && $props.hasCashback) {
3471
- _push2(`<div class="relative z-10"${_scopeId}><span${ssrRenderAttr("data-tooltip", "Receba $1 de volta".replace("$1", _ctx.$percentage($setup.cashbackPercentage)))}${_scopeId}><i class="i-arrow-uturn-left mr-1"${_scopeId}></i><span class="font-medium"${_scopeId}>${ssrInterpolate(_ctx.$money($setup.cashbackValue))}</span><small${_scopeId}> cashback</small></span></div>`);
3472
- } else {
3473
- _push2(`<!---->`);
3474
- }
3475
- } else {
3476
- return [
3477
- $setup.cashbackValue && $props.hasCashback ? (openBlock(), createBlock("div", {
3478
- key: 0,
3479
- class: "relative z-10"
3480
- }, [
3481
- createVNode("span", {
3482
- "data-tooltip": "Receba $1 de volta".replace("$1", _ctx.$percentage($setup.cashbackPercentage))
3483
- }, [
3484
- createVNode("i", { class: "i-arrow-uturn-left mr-1" }),
3485
- createVNode("span", { class: "font-medium" }, toDisplayString(_ctx.$money($setup.cashbackValue)), 1),
3486
- createVNode("small", null, " cashback")
3487
- ], 8, ["data-tooltip"])
3488
- ])) : createCommentVNode("", true)
3489
- ];
3490
- }
3491
- }),
3492
- _: 1
3493
- }, _parent));
3494
- _push(ssrRenderComponent(_component_Fade, { slide: "down" }, {
3495
- default: withCtx((_, _push2, _parent2, _scopeId) => {
3496
- if (_push2) {
3497
- if ($setup.installmentValue && $props.hasPriceOptions) {
3498
- _push2(`<div${_scopeId}>`);
3499
- if ($props.isLiteral) {
3500
- _push2(`<small${_scopeId}>${ssrInterpolate(`${"At\xE9"} `)}</small>`);
3501
- } else {
3502
- _push2(`<!---->`);
3503
- }
3504
- _push2(` ${ssrInterpolate($setup.installmentsNumber)}x `);
3505
- if ($props.isLiteral) {
3506
- _push2(`<small${_scopeId}>${ssrInterpolate(` ${"De"} `)}</small>`);
3507
- } else {
3508
- _push2(`<!---->`);
3509
- }
3510
- _push2(`<span${_scopeId}>${ssrInterpolate(_ctx.$money($setup.installmentValue))}</span>`);
3511
- if (!$setup.monthlyInterest && $props.isLiteral) {
3512
- _push2(`<small${_scopeId}>${ssrInterpolate("Sem juros")}</small>`);
3513
- } else {
3514
- _push2(`<!---->`);
3515
- }
3516
- _push2(`</div>`);
3517
- } else {
3518
- _push2(`<!---->`);
3519
- }
3520
- } else {
3521
- return [
3522
- $setup.installmentValue && $props.hasPriceOptions ? (openBlock(), createBlock("div", { key: 0 }, [
3523
- $props.isLiteral ? (openBlock(), createBlock("small", { key: 0 }, toDisplayString(`${"At\xE9"} `))) : createCommentVNode("", true),
3524
- createTextVNode(" " + toDisplayString($setup.installmentsNumber) + "x ", 1),
3525
- $props.isLiteral ? (openBlock(), createBlock("small", { key: 1 }, toDisplayString(` ${"De"} `))) : createCommentVNode("", true),
3526
- createVNode("span", null, toDisplayString(_ctx.$money($setup.installmentValue)), 1),
3527
- !$setup.monthlyInterest && $props.isLiteral ? (openBlock(), createBlock("small", { key: 2 }, toDisplayString("Sem juros"))) : createCommentVNode("", true)
3528
- ])) : createCommentVNode("", true)
3529
- ];
3530
- }
3531
- }),
3532
- _: 1
3533
- }, _parent));
3534
- _push(ssrRenderComponent(_component_Fade, { slide: "down" }, {
3535
- default: withCtx((_, _push2, _parent2, _scopeId) => {
3536
- if (_push2) {
3537
- if ($setup.priceWithDiscount < $setup.salePrice && $props.hasPriceOptions) {
3538
- _push2(`<div${_scopeId}>`);
3539
- if (!$setup.discountLabel) {
3540
- _push2(`<small${_scopeId}>${ssrInterpolate(`${"A partir de"} `)}</small>`);
3541
- } else {
3542
- _push2(`<!---->`);
3543
- }
3544
- _push2(`<span${_scopeId}>${ssrInterpolate(_ctx.$money($setup.priceWithDiscount))}</span>`);
3545
- if ($setup.discountLabel) {
3546
- _push2(`<small${_scopeId}>${ssrInterpolate(` ${$setup.discountLabel}`)}</small>`);
3547
- } else {
3548
- _push2(`<!---->`);
3549
- }
3550
- _push2(`</div>`);
3551
- } else {
3552
- _push2(`<!---->`);
3553
- }
3554
- } else {
3555
- return [
3556
- $setup.priceWithDiscount < $setup.salePrice && $props.hasPriceOptions ? (openBlock(), createBlock("div", { key: 0 }, [
3557
- !$setup.discountLabel ? (openBlock(), createBlock("small", { key: 0 }, toDisplayString(`${"A partir de"} `))) : createCommentVNode("", true),
3558
- createVNode("span", null, toDisplayString(_ctx.$money($setup.priceWithDiscount)), 1),
3559
- $setup.discountLabel ? (openBlock(), createBlock("small", { key: 1 }, toDisplayString(` ${$setup.discountLabel}`), 1)) : createCommentVNode("", true)
3560
- ])) : createCommentVNode("", true)
3561
- ];
3562
- }
3563
- }),
3564
- _: 1
3565
- }, _parent));
3566
- _push(`</div>`);
3567
- }
3568
- const _sfc_setup$5 = _sfc_main$5.setup;
3569
- _sfc_main$5.setup = (props, ctx) => {
3570
- const ssrContext = useSSRContext();
3571
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Prices.vue");
3572
- return _sfc_setup$5 ? _sfc_setup$5(props, ctx) : void 0;
3573
- };
3574
- const Prices = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["ssrRender", _sfc_ssrRender$5]]);
3575
-
3576
- const useCartItem = (props) => {
3577
- const parsedItem = computed(() => {
3578
- return !props.item && props.product ? parseProduct(props.product) : null;
3579
- });
3580
- const cartItem = computed(() => {
3581
- return props.item || parsedItem.value;
3582
- });
3583
- const title = computed(() => {
3584
- return name(cartItem.value);
3585
- });
3586
- const link = computed(() => {
3587
- const { slug } = cartItem.value;
3588
- if (typeof slug === "string") {
3589
- return `/${slug}`;
3590
- }
3591
- return null;
3592
- });
3593
- const image = computed(() => {
3594
- if (cartItem.value.picture) {
3595
- return img(cartItem.value.picture, void 0, props.pictureSize || "small");
3596
- }
3597
- return void 0;
3598
- });
3599
- const finalPrice = computed(() => {
3600
- return cartItem.value.final_price || cartItem.value.price;
3601
- });
3602
- return {
3603
- cartItem,
3604
- title,
3605
- link,
3606
- image,
3607
- finalPrice
3608
- };
3609
- };
3610
-
3611
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
3612
- __name: "QuantitySelectorControl",
3613
- props: {
3614
- isMinus: { type: Boolean }
3615
- },
3616
- setup(__props, { expose: __expose }) {
3617
- __expose();
3618
- const {
3619
- value,
3620
- isBoundMin,
3621
- isBoundMax
3622
- } = inject(quantitySelectorKey);
3623
- const __returned__ = { value, isBoundMin, isBoundMax };
3624
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
3625
- return __returned__;
3626
- }
3627
- });
3628
- function _sfc_ssrRender$4(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3629
- _push(`<button${ssrRenderAttrs(mergeProps({
3630
- type: "button",
3631
- class: "w-10 h-12 text-xl leading-12 enabled:text-primary enabled:hover:bg-primary-100/70 disabled:opacity-40",
3632
- "data-quantity-selector-control": $props.isMinus ? "minus" : "plus",
3633
- "aria-label": $props.isMinus ? "Menos" : "Mais",
3634
- disabled: $props.isMinus ? $setup.isBoundMin : $setup.isBoundMax
3635
- }, _attrs))}>`);
3636
- ssrRenderSlot(_ctx.$slots, "default", {}, () => {
3637
- if ($props.isMinus) {
3638
- _push(`<!--[-->\u2212<!--]-->`);
3639
- } else {
3640
- _push(`<!--[-->+<!--]-->`);
3641
- }
3642
- }, _push, _parent);
3643
- _push(`</button>`);
3644
- }
3645
- const _sfc_setup$4 = _sfc_main$4.setup;
3646
- _sfc_main$4.setup = (props, ctx) => {
3647
- const ssrContext = useSSRContext();
3648
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/QuantitySelectorControl.vue");
3649
- return _sfc_setup$4 ? _sfc_setup$4(props, ctx) : void 0;
3650
- };
3651
- const QuantitySelectorControl = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["ssrRender", _sfc_ssrRender$4]]);
3652
-
3653
- const quantitySelectorKey = Symbol("quantitySelector");
3654
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
3655
- __name: "QuantitySelector",
3656
- props: {
3657
- modelValue: { default: 1 },
3658
- min: { default: 1 },
3659
- max: {},
3660
- step: {},
3661
- disabled: { type: Boolean },
3662
- readonly: { type: Boolean }
3663
- },
3664
- emits: ["update:modelValue"],
3665
- setup(__props, { expose: __expose, emit }) {
3666
- __expose();
3667
- const props = __props;
3668
- const input = ref(null);
3669
- const inputId = `NInput${useId()}`;
3670
- const value = computed({
3671
- get() {
3672
- return props.modelValue;
3673
- },
3674
- set(_value) {
3675
- if (_value < props.min) {
3676
- _value = props.min;
3677
- input.value.value = `${_value}`;
3678
- }
3679
- if (props.max && _value > props.max) {
3680
- _value = props.max;
3681
- input.value.value = `${_value}`;
3682
- }
3683
- emit("update:modelValue", _value);
3684
- }
3685
- });
3686
- const isBoundMin = computed(() => {
3687
- return props.min >= value.value;
3688
- });
3689
- const isBoundMax = computed(() => {
3690
- return props.max <= value.value;
3691
- });
3692
- provide(quantitySelectorKey, {
3693
- value,
3694
- isBoundMin,
3695
- isBoundMax
3696
- });
3697
- const __returned__ = { quantitySelectorKey, props, emit, input, inputId, value, isBoundMin, isBoundMax, QuantitySelectorControl };
3698
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
3699
- return __returned__;
3700
- }
3701
- });
3702
- function _sfc_ssrRender$3(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3703
- _push(`<div${ssrRenderAttrs(mergeProps({ "data-quantity-selector": "" }, _attrs))}>`);
3704
- ssrRenderSlot(_ctx.$slots, "label", { inputId: $setup.inputId, value: $setup.value }, () => {
3705
- _push(`<label${ssrRenderAttr("for", $setup.inputId)} class="sr-only">${ssrInterpolate("Quantidade")}</label>`);
3706
- }, _push, _parent);
3707
- _push(`<div class="flex items-center"><input type="number"${ssrRenderAttr("id", $setup.inputId)}${ssrRenderAttr("value", $setup.value)}${ssrRenderAttr("min", $props.min)}${ssrRenderAttr("max", $props.max)}${ssrRenderAttr("step", $props.step)}${ssrIncludeBooleanAttr($props.disabled) ? " disabled" : ""}${ssrIncludeBooleanAttr($props.readonly) ? " readonly" : ""} class="h-12 w-14 px-2 text-lg border-transparent text-center [-moz-appearance:_textfield] [&amp;::-webkit-outer-spin-button]:m-0 [&amp;::-webkit-outer-spin-button]:appearance-none [&amp;::-webkit-inner-spin-button]:m-0 [&amp;::-webkit-inner-spin-button]:appearance-none">`);
3708
- ssrRenderSlot(_ctx.$slots, "controls", { value: $setup.value, isBoundMin: $setup.isBoundMin, isBoundMax: $setup.isBoundMax }, () => {
3709
- _push(ssrRenderComponent($setup["QuantitySelectorControl"], {
3710
- "is-minus": "",
3711
- class: "order-first"
3712
- }, {
3713
- default: withCtx((_, _push2, _parent2, _scopeId) => {
3714
- if (_push2) {
3715
- ssrRenderSlot(_ctx.$slots, "minus", {}, null, _push2, _parent2, _scopeId);
3716
- } else {
3717
- return [
3718
- renderSlot$1(_ctx.$slots, "minus")
3719
- ];
3720
- }
3721
- }),
3722
- _: 3
3723
- }, _parent));
3724
- _push(ssrRenderComponent($setup["QuantitySelectorControl"], { class: "order-last" }, {
3725
- default: withCtx((_, _push2, _parent2, _scopeId) => {
3726
- if (_push2) {
3727
- ssrRenderSlot(_ctx.$slots, "plus", {}, null, _push2, _parent2, _scopeId);
3728
- } else {
3729
- return [
3730
- renderSlot$1(_ctx.$slots, "plus")
3731
- ];
3732
- }
3733
- }),
3734
- _: 3
3735
- }, _parent));
3736
- }, _push, _parent);
3737
- _push(`</div></div>`);
3738
- }
3739
- const _sfc_setup$3 = _sfc_main$3.setup;
3740
- _sfc_main$3.setup = (props, ctx) => {
3741
- const ssrContext = useSSRContext();
3742
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/QuantitySelector.vue");
3743
- return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
3744
- };
3745
- const QuantitySelector = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["ssrRender", _sfc_ssrRender$3]]);
3746
-
3747
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
3748
- __name: "CartItem",
3749
- props: {
3750
- item: {},
3751
- product: {},
3752
- pictureSize: {}
3753
- },
3754
- setup(__props, { expose: __expose }) {
3755
- __expose();
3756
- const props = __props;
3757
- const {
3758
- cartItem,
3759
- title,
3760
- link,
3761
- image,
3762
- finalPrice
3763
- } = useCartItem(props);
3764
- const __returned__ = { props, cartItem, title, link, image, finalPrice, get removeCartItem() {
3765
- return removeCartItem;
3766
- }, QuantitySelector, Prices };
3767
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
3768
- return __returned__;
3769
- }
3770
- });
3771
- function _sfc_ssrRender$2(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3772
- const _component_AImg = resolveComponent("AImg");
3773
- _push(`<article${ssrRenderAttrs(mergeProps({ class: "relative bg-white shadow-sm" }, _attrs))}>`);
3774
- ssrRenderVNode(_push, createVNode(resolveDynamicComponent($setup.link ? "ALink" : "div"), {
3775
- href: $setup.link,
3776
- class: "flex items-center gap-5 p-4 group"
3777
- }, {
3778
- default: withCtx((_, _push2, _parent2, _scopeId) => {
3779
- if (_push2) {
3780
- if ($setup.image) {
3781
- _push2(ssrRenderComponent(_component_AImg, {
3782
- picture: $setup.image,
3783
- alt: $setup.title,
3784
- class: "w-20 h-20 object-cover"
3785
- }, null, _parent2, _scopeId));
3786
- } else {
3787
- _push2(`<!---->`);
3788
- }
3789
- _push2(`<p class="py-2 flex-auto text-sm text-base-700 group-hover:text-base-900 group-hover:underline"${_scopeId}>${ssrInterpolate($setup.title)}</p>`);
3790
- } else {
3791
- return [
3792
- $setup.image ? (openBlock(), createBlock(_component_AImg, {
3793
- key: 0,
3794
- picture: $setup.image,
3795
- alt: $setup.title,
3796
- class: "w-20 h-20 object-cover"
3797
- }, null, 8, ["picture", "alt"])) : createCommentVNode("", true),
3798
- createVNode("p", { class: "py-2 flex-auto text-sm text-base-700 group-hover:text-base-900 group-hover:underline" }, toDisplayString($setup.title), 1)
3799
- ];
3800
- }
3801
- }),
3802
- _: 1
3803
- }), _parent);
3804
- if ($setup.cartItem._id) {
3805
- _push(`<button class="absolute top-0 right-0 p-2 opacity-70 hover:opacity-100"${ssrRenderAttr("aria-label", "Remover")}><span class="w-5 h-5 text-sm leading-none flex flex-col justify-center rounded-full border-3 text-danger-800 border-danger-700/30"><i class="i-close my-0 mx-auto"></i></span></button>`);
3806
- } else {
3807
- _push(`<!---->`);
3808
- }
3809
- _push(`<div class="flex justify-between items-center border-t-2 border-base-100"><div class="border-r-2 border-base-100">`);
3810
- _push(ssrRenderComponent($setup["QuantitySelector"], {
3811
- modelValue: $setup.cartItem.quantity,
3812
- "onUpdate:modelValue": ($event) => $setup.cartItem.quantity = $event,
3813
- min: $setup.cartItem.min_quantity,
3814
- max: $setup.cartItem.max_quantity
3815
- }, null, _parent));
3816
- _push(`</div>`);
3817
- _push(ssrRenderComponent($setup["Prices"], {
3818
- "base-price": $setup.cartItem.base_price,
3819
- price: $setup.finalPrice,
3820
- class: "px-4 py-2.5 text-[95%]"
3821
- }, null, _parent));
3822
- _push(`</div></article>`);
3823
- }
3824
- const _sfc_setup$2 = _sfc_main$2.setup;
3825
- _sfc_main$2.setup = (props, ctx) => {
3826
- const ssrContext = useSSRContext();
3827
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/CartItem.vue");
3828
- return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
3829
- };
3830
- const CartItem = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["ssrRender", _sfc_ssrRender$2]]);
3831
-
3832
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
3833
- __name: "CartSidebar",
3834
- emits: ["close"],
3835
- setup(__props, { expose: __expose, emit }) {
3836
- __expose();
3837
- const __returned__ = { emit, get freeShippingFromValue() {
3838
- return freeShippingFromValue;
3839
- }, get shoppingCart() {
3840
- return shoppingCart;
3841
- }, get totalItems() {
3842
- return totalItems;
3843
- }, CheckoutLink, Prices, CartItem };
3844
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
3845
- return __returned__;
3846
- }
3847
- });
3848
- function _sfc_ssrRender$1(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3849
- _push(`<aside${ssrRenderAttrs(mergeProps({ class: "flex flex-col h-screen bg-white" }, _attrs))}><header class="px-6 py-4 flex justify-end items-center gap-3 shadow ring-1 ring-black/5 z-10"><span class="text-right text-base text-base-600 font-medium">${ssrInterpolate("Meu carrinho de compras")}</span><span class="min-w-[3rem] text-right"><span class="ui-badge-pill-lg">${ssrInterpolate($setup.totalItems)}</span></span></header><article class="grow overflow-y-auto bg-base-50">`);
3850
- if ($setup.freeShippingFromValue) {
3851
- _push(`<div class="text-sm text-center">`);
3852
- if ($setup.freeShippingFromValue > $setup.shoppingCart.subtotal) {
3853
- _push(`<div class="p-3 secondary-subtle">${ssrInterpolate("Adicione $1 para ganhar".replace(
3854
- "$1",
3855
- _ctx.$money($setup.freeShippingFromValue - $setup.shoppingCart.subtotal)
3856
- ))} <strong class="lowercase">${ssrInterpolate("Frete gr\xE1tis")}</strong></div>`);
3857
- } else {
3858
- _push(`<div class="p-3 bg-success-50 text-success-800"><i class="text-success-900 i-check mr-1"></i> ${ssrInterpolate("Frete gr\xE1tis a partir de")} ${ssrInterpolate(_ctx.$money($setup.freeShippingFromValue))}</div>`);
3859
- }
3860
- _push(`</div>`);
3861
- } else {
3862
- _push(`<!---->`);
3863
- }
3864
- _push(`<ul class="px-4 pt-4 pb-2"><!--[-->`);
3865
- ssrRenderList($setup.shoppingCart.items, (item, i) => {
3866
- _push(`<li>`);
3867
- _push(ssrRenderComponent($setup["CartItem"], {
3868
- item,
3869
- class: "mb-3"
3870
- }, null, _parent));
3871
- _push(`</li>`);
3872
- });
3873
- _push(`<!--]--></ul></article><footer class="px-5 pt-4 pb-3 ring-2 ring-black/5 z-10"><div class="grid grid-cols-2 gap-3 items-center text-right"><div>${ssrInterpolate("Subtotal")}</div>`);
3874
- _push(ssrRenderComponent($setup["Prices"], {
3875
- price: $setup.shoppingCart.subtotal,
3876
- "is-literal": true,
3877
- class: "text-lg"
3878
- }, null, _parent));
3879
- _push(`</div>`);
3880
- _push(ssrRenderComponent($setup["CheckoutLink"], { class: "ui-btn-lg ui-btn-primary w-full text-right my-2.5" }, {
3881
- default: withCtx((_, _push2, _parent2, _scopeId) => {
3882
- if (_push2) {
3883
- _push2(`<i class="i-check mr-2"${_scopeId}></i> ${ssrInterpolate("Finalizar compra")}`);
3884
- } else {
3885
- return [
3886
- createVNode("i", { class: "i-check mr-2" }),
3887
- createTextVNode(" " + toDisplayString("Finalizar compra"))
3888
- ];
3889
- }
3890
- }),
3891
- _: 1
3892
- }, _parent));
3893
- _push(`<a href="#" class="ui-link text-base-500 hover:text-base-700 text-sm"><i class="i-arrow-left mr-1"></i> ${ssrInterpolate("Continuar comprando")}</a></footer></aside>`);
3894
- }
3895
3548
  const _sfc_setup$1 = _sfc_main$1.setup;
3896
3549
  _sfc_main$1.setup = (props, ctx) => {
3897
3550
  const ssrContext = useSSRContext();
3898
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/CartSidebar.vue");
3551
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/AccountMenu.vue");
3899
3552
  return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
3900
3553
  };
3901
- const CartSidebar = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["ssrRender", _sfc_ssrRender$1]]);
3554
+ const AccountMenu = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["ssrRender", _sfc_ssrRender$1]]);
3902
3555
 
3903
3556
  const _sfc_main = /* @__PURE__ */ defineComponent({
3904
3557
  __name: "ShopHeader",
3905
3558
  props: {
3906
- serviceLinks: {},
3907
3559
  categories: {},
3908
3560
  menuCategorySlugs: {},
3909
3561
  menuRandomCategories: {},
@@ -3912,6 +3564,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3912
3564
  setup(__props, { expose: __expose }) {
3913
3565
  __expose();
3914
3566
  const props = __props;
3567
+ const SearchModal = defineAsyncComponent(() => import('../SearchModal.f418e188.mjs'));
3568
+ const CartSidebar = defineAsyncComponent(() => import('../CartSidebar.2b555408.mjs'));
3915
3569
  const header = ref(null);
3916
3570
  const {
3917
3571
  isSticky,
@@ -3921,7 +3575,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3921
3575
  } = useShopHeader({ ...props, header });
3922
3576
  const isSidenavOpen = ref(false);
3923
3577
  const isSearchOpen = ref(false);
3578
+ const isSearchOpenOnce = ref(false);
3579
+ watchOnce(isSearchOpen, () => {
3580
+ isSearchOpenOnce.value = true;
3581
+ });
3924
3582
  const isCartOpen = ref(false);
3583
+ const isCartOpenOnce = ref(false);
3584
+ watchOnce(isCartOpen, () => {
3585
+ isCartOpenOnce.value = true;
3586
+ });
3925
3587
  const isMounted = ref(false);
3926
3588
  const delayedTotalItems = ref(0);
3927
3589
  onMounted(() => {
@@ -3933,12 +3595,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
3933
3595
  delayedTotalItems.value = newTotalItems;
3934
3596
  }, { immediate: true });
3935
3597
  });
3936
- const __returned__ = { props, header, isSticky, positionY, categoryTrees, inlineMenuTrees, isSidenavOpen, isSearchOpen, isCartOpen, isMounted, delayedTotalItems, Drawer, ShopSidenav, ShopHeaderMenu, SearchModal, AccountMenu, CartSidebar };
3598
+ const __returned__ = { SearchModal, CartSidebar, props, header, isSticky, positionY, categoryTrees, inlineMenuTrees, isSidenavOpen, isSearchOpen, isSearchOpenOnce, isCartOpen, isCartOpenOnce, isMounted, delayedTotalItems, Drawer, ShopSidenav, ShopHeaderMenu, AccountMenu };
3937
3599
  Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
3938
3600
  return __returned__;
3939
3601
  }
3940
3602
  });
3941
3603
  function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3604
+ const _component_Skeleton = resolveComponent("Skeleton");
3942
3605
  _push(`<header${ssrRenderAttrs(mergeProps({
3943
3606
  ref: "header",
3944
3607
  class: ["relative top-0 z-50 transition-colors", [
@@ -3949,10 +3612,7 @@ function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $op
3949
3612
  ssrRenderSlot(_ctx.$slots, "logo", {}, null, _push, _parent);
3950
3613
  _push(ssrRenderComponent($setup["ShopHeaderMenu"], mergeProps({ class: "hidden lg:block" }, { inlineMenuTrees: $setup.inlineMenuTrees }), null, _parent));
3951
3614
  _push(`<div class="basis-1/4 px-2 flex justify-end items-center gap-3 lg:gap-4 text-base-800"><button${ssrRenderAttr("aria-label", "Buscar produtos")}><i class="i-magnifying-glass w-7 h-7 hover:text-primary hover:scale-110 active:scale-125"></i></button>`);
3952
- _push(ssrRenderComponent($setup["AccountMenu"], {
3953
- "service-links": $props.serviceLinks,
3954
- class: "hidden sm:block"
3955
- }, {
3615
+ _push(ssrRenderComponent($setup["AccountMenu"], { class: "hidden sm:block" }, {
3956
3616
  button: withCtx(({ open }, _push2, _parent2, _scopeId) => {
3957
3617
  if (_push2) {
3958
3618
  _push2(`<i class="${ssrRenderClass([open ? "text-black scale-110" : null, "i-user-circle w-7 h-7 hover:text-primary hover:scale-110 active:scale-125"])}"${_scopeId}></i>`);
@@ -4000,10 +3660,40 @@ function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $op
4000
3660
  }, {
4001
3661
  default: withCtx((_, _push2, _parent2, _scopeId) => {
4002
3662
  if (_push2) {
4003
- _push2(ssrRenderComponent($setup["SearchModal"], null, null, _parent2, _scopeId));
3663
+ ssrRenderSuspense(_push2, {
3664
+ fallback: () => {
3665
+ _push2(`<div class="container mx-auto"${_scopeId}>`);
3666
+ _push2(ssrRenderComponent(_component_Skeleton, {
3667
+ class: "p-6",
3668
+ "is-large": ""
3669
+ }, null, _parent2, _scopeId));
3670
+ _push2(`</div>`);
3671
+ },
3672
+ default: () => {
3673
+ if ($setup.isSearchOpenOnce) {
3674
+ _push2(ssrRenderComponent($setup["SearchModal"], null, null, _parent2, _scopeId));
3675
+ } else {
3676
+ _push2(`<!---->`);
3677
+ }
3678
+ },
3679
+ _: 1
3680
+ });
4004
3681
  } else {
4005
3682
  return [
4006
- createVNode($setup["SearchModal"])
3683
+ (openBlock(), createBlock(Suspense, null, {
3684
+ fallback: withCtx(() => [
3685
+ createVNode("div", { class: "container mx-auto" }, [
3686
+ createVNode(_component_Skeleton, {
3687
+ class: "p-6",
3688
+ "is-large": ""
3689
+ })
3690
+ ])
3691
+ ]),
3692
+ default: withCtx(() => [
3693
+ $setup.isSearchOpenOnce ? (openBlock(), createBlock($setup["SearchModal"], { key: 0 })) : createCommentVNode("", true)
3694
+ ]),
3695
+ _: 1
3696
+ }))
4007
3697
  ];
4008
3698
  }
4009
3699
  }),
@@ -4019,14 +3709,41 @@ function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $op
4019
3709
  }, {
4020
3710
  default: withCtx((_, _push3, _parent2, _scopeId) => {
4021
3711
  if (_push3) {
4022
- _push3(ssrRenderComponent($setup["CartSidebar"], {
4023
- onClose: ($event) => $setup.isCartOpen = false
4024
- }, null, _parent2, _scopeId));
3712
+ ssrRenderSuspense(_push3, {
3713
+ fallback: () => {
3714
+ _push3(ssrRenderComponent(_component_Skeleton, {
3715
+ class: "pt-16 px-6",
3716
+ "is-bold": ""
3717
+ }, null, _parent2, _scopeId));
3718
+ },
3719
+ default: () => {
3720
+ if ($setup.isCartOpenOnce) {
3721
+ _push3(ssrRenderComponent($setup["CartSidebar"], {
3722
+ onClose: ($event) => $setup.isCartOpen = false
3723
+ }, null, _parent2, _scopeId));
3724
+ } else {
3725
+ _push3(`<!---->`);
3726
+ }
3727
+ },
3728
+ _: 1
3729
+ });
4025
3730
  } else {
4026
3731
  return [
4027
- createVNode($setup["CartSidebar"], {
4028
- onClose: ($event) => $setup.isCartOpen = false
4029
- }, null, 8, ["onClose"])
3732
+ (openBlock(), createBlock(Suspense, null, {
3733
+ fallback: withCtx(() => [
3734
+ createVNode(_component_Skeleton, {
3735
+ class: "pt-16 px-6",
3736
+ "is-bold": ""
3737
+ })
3738
+ ]),
3739
+ default: withCtx(() => [
3740
+ $setup.isCartOpenOnce ? (openBlock(), createBlock($setup["CartSidebar"], {
3741
+ key: 0,
3742
+ onClose: ($event) => $setup.isCartOpen = false
3743
+ }, null, 8, ["onClose"])) : createCommentVNode("", true)
3744
+ ]),
3745
+ _: 1
3746
+ }))
4030
3747
  ];
4031
3748
  }
4032
3749
  }),
@@ -4065,7 +3782,13 @@ const $$PageHeader = createComponent(async ($$result, $$props, $$slots) => {
4065
3782
  field: "categories",
4066
3783
  value: categories?.map(({ _id, ...c }) => c)
4067
3784
  });
4068
- return renderTemplate`${renderSlot($$result, $$slots["pitch-bar"], renderTemplate(_a || (_a = __template(["", "", "<script>", "<\/script>", ""])), pitchBar.slides.length > 1 && renderTemplate`${renderComponent($$result, "PitchBar", PitchBar, { ...pitchBar, "client:idle": true, "client:component-hydration": "idle", "client:component-path": "~/components/PitchBar.vue", "client:component-export": "default" })}`, pitchBar.slides.length === 1 && renderTemplate`${renderComponent($$result, "PitchBar", PitchBar, { ...pitchBar })}`, unescapeHTML(inlineClientJS), renderComponent($$result, "ShopHeader", ShopHeader, { ...shopHeader, "client:load": true, "client:component-hydration": "load", "client:component-path": "~/components/ShopHeader.vue", "client:component-export": "default" }, { "logo": ($$result2) => renderTemplate`${renderComponent($$result2, "Fragment", Fragment, { "slot": "logo" }, { "default": ($$result3) => renderTemplate`${maybeRenderHead()}<a href="/">${renderComponent($$result3, "LogoHeading", LogoHeading, {}, { "logo-picture": ($$result4) => renderTemplate`${renderComponent($$result4, "Picture", $$Picture, { "slot": "logo-picture", "src": settings.logo, "alt": settings.name, "widths": [300], "fetchpriority": "high", "loading": "eager", "class": "hover:drop-shadow-sm max-w-[150px] mx-auto" })}` })}</a>` })}` })))}`;
3785
+ return renderTemplate`${renderSlot($$result, $$slots["pitch-bar"], renderTemplate(_a || (_a = __template(["\n ", "\n ", "\n\n<script>", "<\/script>\n", ""])), pitchBar.slides.length > 1 && renderTemplate`${renderComponent($$result, "PitchBar", PitchBar, { ...pitchBar, "client:idle": true, "client:component-hydration": "idle", "client:component-path": "~/components/PitchBar.vue", "client:component-export": "default" })}`, pitchBar.slides.length === 1 && renderTemplate`${renderComponent($$result, "PitchBar", PitchBar, { ...pitchBar })}`, unescapeHTML(inlineClientJS), renderComponent($$result, "ShopHeader", ShopHeader, { ...shopHeader, "client:load": true, "client:component-hydration": "load", "client:component-path": "~/components/ShopHeader.vue", "client:component-export": "default" }, { "logo": ($$result2) => renderTemplate`${renderComponent($$result2, "Fragment", Fragment, { "slot": "logo" }, { "default": ($$result3) => renderTemplate`
3786
+ ${maybeRenderHead()}<a href="/">
3787
+ ${renderComponent($$result3, "LogoHeading", LogoHeading, {}, { "default": ($$result4) => renderTemplate`
3788
+ ${renderComponent($$result4, "Picture", $$Picture, { "src": settings.logo, "alt": settings.name, "widths": [300], "fetchpriority": "high", "loading": "eager", "class": "hover:drop-shadow-sm max-w-[150px] mx-auto" })}
3789
+ ` })}
3790
+ </a>
3791
+ ` })}` })))}`;
4069
3792
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/PageHeader.astro", void 0);
4070
3793
 
4071
3794
  const $$Astro$1 = createAstro("https://ecom2-demo.web.app");
@@ -4075,7 +3798,13 @@ const $$Wildcard = createComponent(async ($$result, $$props, $$slots) => {
4075
3798
  const { fetchingApiContext, apiContext } = Astro2.locals.routeContext;
4076
3799
  await fetchingApiContext;
4077
3800
  const apiDoc = apiContext.doc;
4078
- return renderTemplate`${maybeRenderHead()}<main>${apiDoc && renderTemplate`<h1>Hello <span class="text-gradient">${apiDoc.name}</span></h1><hr><div class="mt-3"><mark>${apiDoc._id}</mark> from <i>${apiContext.resource}</i><p>${Math.random()}</p><em>Lorem ipsum dolor sit amet</em></div>`}</main>`;
3801
+ return renderTemplate`${maybeRenderHead()}<main>
3802
+ ${apiDoc && renderTemplate`<h1>Hello <span class="text-gradient">${apiDoc.name}</span></h1><hr><div class="mt-3">
3803
+ <mark>${apiDoc._id}</mark> from <i>${apiContext.resource}</i>
3804
+ <p>${Math.random()}</p>
3805
+ <em>Lorem ipsum dolor sit amet</em>
3806
+ </div>`}
3807
+ </main>`;
4079
3808
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/main/Wildcard.astro", void 0);
4080
3809
 
4081
3810
  const $$Astro = createAstro("https://ecom2-demo.web.app");
@@ -4098,7 +3827,14 @@ const $$ = createComponent(async ($$result, $$props, $$slots) => {
4098
3827
  }
4099
3828
  loadError = err;
4100
3829
  }
4101
- return renderTemplate`<html${addAttribute(routeContext?.lang.replace("_", "-"), "lang")}>${routeContext && renderTemplate`${renderComponent($$result, "Base", $$Base, {}, { "base-head": ($$result2) => renderTemplate`${renderComponent($$result2, "BaseHead", $$BaseHead, { "slot": "base-head" })}`, "default": ($$result2) => renderTemplate`${renderComponent($$result2, "PageHeader", $$PageHeader, {})}${renderComponent($$result2, "WildcardMain", $$Wildcard, {})}` })}`}${loadError && renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`${unescapeHTML(loadError.responseHTML)}` })}`}</html>`;
3830
+ return renderTemplate`<html${addAttribute(routeContext?.lang.replace("_", "-"), "lang")}>
3831
+ ${routeContext && renderTemplate`${renderComponent($$result, "Base", $$Base, {}, { "base-head": ($$result2) => renderTemplate`${renderComponent($$result2, "BaseHead", $$BaseHead, { "slot": "base-head" })}`, "default": ($$result2) => renderTemplate`
3832
+
3833
+ ${renderComponent($$result2, "PageHeader", $$PageHeader, {})}
3834
+ ${renderComponent($$result2, "WildcardMain", $$Wildcard, {})}
3835
+ ` })}`}
3836
+ ${loadError && renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`${unescapeHTML(loadError.responseHTML)}` })}`}
3837
+ </html>`;
4102
3838
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro", void 0);
4103
3839
 
4104
3840
  const $$file = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro";
@@ -4112,4 +3848,4 @@ const ____slug_ = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty(
4112
3848
  url: $$url
4113
3849
  }, Symbol.toStringTag, { value: 'Module' }));
4114
3850
 
4115
- export { $$Picture as $, Carousel as C, Prices as P, _export_sfc as _, CarouselControl as a, addProductToCart as b, $$BaseHead as c, $$PageHeader as d, $$Base as e, ____slug_ as f, loadRouteContext as l, parseShippingPhrase as p };
3851
+ 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, loadRouteContext as f, $$BaseHead as g, $$PageHeader as h, isOutputFormatSupportsAlpha as i, $$Base as j, parseProduct as k, loyaltyPointsPrograms as l, freeShippingFromValue as m, shoppingCart as n, ____slug_ as o, parseShippingPhrase as p, removeCartItem as r, socialNetworks as s, totalItems as t, useId as u };