cloudcommerce 2.0.4 → 2.0.6

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 (186) hide show
  1. package/.github/workflows/test-apps.yml +2 -2
  2. package/CHANGELOG.md +18 -0
  3. package/README.md +1 -1
  4. package/action.yml +4 -4
  5. package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
  6. package/ecomplus-stores/barra-doce/functions/ssr/package.json +6 -6
  7. package/ecomplus-stores/barra-doce/functions/ssr/src/assets/style.css +2 -2
  8. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ProductCard.vue +1 -1
  9. package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
  10. package/ecomplus-stores/barra-doce/package.json +2 -2
  11. package/package.json +2 -2
  12. package/packages/api/lib/api.d.ts +8 -2
  13. package/packages/api/lib/api.js +8 -6
  14. package/packages/api/lib/api.js.map +1 -1
  15. package/packages/api/package.json +3 -2
  16. package/packages/api/src/api.ts +12 -6
  17. package/packages/api/tests/index.test.ts +9 -0
  18. package/packages/api/types.d.ts +35 -26
  19. package/packages/apps/affiliate-program/package.json +1 -1
  20. package/packages/apps/correios/package.json +1 -1
  21. package/packages/apps/custom-payment/package.json +1 -1
  22. package/packages/apps/custom-shipping/package.json +1 -1
  23. package/packages/apps/datafrete/package.json +1 -1
  24. package/packages/apps/discounts/package.json +1 -1
  25. package/packages/apps/emails/package.json +1 -1
  26. package/packages/apps/fb-conversions/package.json +1 -1
  27. package/packages/apps/flash-courier/package.json +1 -1
  28. package/packages/apps/frenet/package.json +1 -1
  29. package/packages/apps/galaxpay/package.json +1 -1
  30. package/packages/apps/google-analytics/package.json +1 -1
  31. package/packages/apps/jadlog/package.json +1 -1
  32. package/packages/apps/loyalty-points/package.json +1 -1
  33. package/packages/apps/mandae/package.json +1 -1
  34. package/packages/apps/melhor-envio/package.json +1 -1
  35. package/packages/apps/mercadopago/package.json +1 -1
  36. package/packages/apps/pagarme/package.json +1 -1
  37. package/packages/apps/pagarme-v5/package.json +1 -1
  38. package/packages/apps/paghiper/package.json +1 -1
  39. package/packages/apps/pix/package.json +1 -1
  40. package/packages/apps/tiny-erp/package.json +1 -1
  41. package/packages/apps/webhooks/package.json +1 -1
  42. package/packages/cli/package.json +1 -1
  43. package/packages/config/package.json +1 -1
  44. package/packages/emails/package.json +1 -1
  45. package/packages/eslint/package.json +1 -1
  46. package/packages/events/package.json +1 -1
  47. package/packages/feeds/package.json +1 -1
  48. package/packages/firebase/package.json +1 -1
  49. package/packages/i18n/package.json +1 -1
  50. package/packages/modules/lib/firebase/functions-checkout/handle-order-transaction.js.map +1 -1
  51. package/packages/modules/package.json +1 -1
  52. package/packages/modules/src/firebase/functions-checkout/handle-order-transaction.ts +1 -1
  53. package/packages/passport/package.json +1 -1
  54. package/packages/ssr/lib/lib/cron-ssr-save-views.js +8 -4
  55. package/packages/ssr/lib/lib/cron-ssr-save-views.js.map +1 -1
  56. package/packages/ssr/package.json +2 -2
  57. package/packages/ssr/src/lib/cron-ssr-save-views.ts +8 -4
  58. package/packages/storefront/config/storefront.tailwind.cjs +10 -1
  59. package/packages/storefront/config/storefront.unocss.cjs +1 -1
  60. package/packages/storefront/dist/client/_astro/AccountPage.oxrx8xO0.js +1 -0
  61. package/packages/storefront/dist/client/_astro/CartSidebar.ShqcM66P.js +1 -0
  62. package/packages/storefront/dist/client/_astro/HeroSlider.OYdereCn.js +1 -0
  63. package/packages/storefront/dist/client/_astro/PitchBar.RVEArMQA.js +1 -0
  64. package/packages/storefront/dist/client/_astro/Prices.Bsod-tLh.js +1 -0
  65. package/packages/storefront/dist/client/_astro/ProductDetails.TQM36pzk.js +7 -0
  66. package/packages/storefront/dist/client/_astro/ProductShelf.HX1P9sTW.js +1 -0
  67. package/packages/storefront/dist/client/_astro/ProductShelf._0iHMZBO.js +1 -0
  68. package/packages/storefront/dist/client/_astro/QuantitySelector.SEAsIOhe.js +1 -0
  69. package/packages/storefront/dist/client/_astro/SearchModal.JVuqMQFe.js +1 -0
  70. package/packages/storefront/dist/client/_astro/SearchShowcase.zwEq0xsL.js +1 -0
  71. package/packages/storefront/dist/client/_astro/ShopHeader.BoPmUmjI.js +7 -0
  72. package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.40kDRyEO.js +1 -0
  73. package/packages/storefront/dist/client/_astro/{_slug_.cfRx-rdA.css → _slug_.PTG68eA8.css} +1 -1
  74. package/packages/storefront/dist/client/_astro/client.nPN_zw-c.js +1 -0
  75. package/packages/storefront/dist/client/_astro/customer-session.yn5lG3w3.js +7 -0
  76. package/packages/storefront/dist/client/_astro/format-money.ykh8O7d2.js +1 -0
  77. package/packages/storefront/dist/client/_astro/grid-title.z5ui_5pL.js +1 -0
  78. package/packages/storefront/dist/client/_astro/hoisted.FcmEawNA.js +1 -0
  79. package/packages/storefront/dist/client/_astro/hoisted.daSrX1-i.js +1 -0
  80. package/packages/storefront/dist/client/_astro/hoisted.hpPOAcMM.js +1 -0
  81. package/packages/storefront/dist/client/_astro/i18n.MycOopxQ.js +1 -0
  82. package/packages/storefront/dist/client/_astro/img.c2KI4eO6.js +1 -0
  83. package/packages/storefront/dist/client/_astro/index.8acAQSHW.js +1 -0
  84. package/packages/storefront/dist/client/_astro/index.NRzvVgQf.js +1 -0
  85. package/packages/storefront/dist/client/_astro/modules-info.dHD0h8Nc.js +1 -0
  86. package/packages/storefront/dist/client/_astro/name.itYHl42A.js +1 -0
  87. package/packages/storefront/dist/client/_astro/runtime-core.esm-bundler.Pr2hdd7G.js +1 -0
  88. package/packages/storefront/dist/client/_astro/shopping-cart.MgpVRgys.js +1 -0
  89. package/packages/storefront/dist/client/_astro/use-analytics.D9xd-k7D.js +1 -0
  90. package/packages/storefront/dist/client/_astro/use-product-card.gKh9czSW.js +1 -0
  91. package/packages/storefront/dist/client/_astro/use-text-value.ZIz7zsXT.js +4 -0
  92. package/packages/storefront/dist/server/chunks/{CartSidebar_gCUGFy65.mjs → CartSidebar_8VAKl-jR.mjs} +1 -1
  93. package/packages/storefront/dist/server/chunks/{SearchModal_2uYZ9tHy.mjs → SearchModal_7debttOi.mjs} +5 -5
  94. package/packages/storefront/dist/server/chunks/{_.._FnNLvTNv.mjs → _.._D6rq0cLa.mjs} +1 -1
  95. package/packages/storefront/dist/server/chunks/{account_iZ2QmK5E.mjs → _page__WXDIwV7g.mjs} +1 -1
  96. package/packages/storefront/dist/server/chunks/{~fallback_wxuqpDXG.mjs → account_DOT2RzND.mjs} +1 -1
  97. package/packages/storefront/dist/server/chunks/astro/{assets-service_TpUb271h.mjs → assets-service_gJYJeEDH.mjs} +9 -5
  98. package/packages/storefront/dist/server/chunks/{astro_PpArQAsY.mjs → astro_H-6uiAAG.mjs} +36 -30
  99. package/packages/storefront/dist/server/chunks/index_eXlHIU83.mjs +6 -0
  100. package/packages/storefront/dist/server/chunks/{node_wOa5hJmt.mjs → node_-eQO2yOn.mjs} +1 -1
  101. package/packages/storefront/dist/server/chunks/pages/{__cEcxuEWe.mjs → __fI3NeWvy.mjs} +1750 -730
  102. package/packages/storefront/dist/server/chunks/pages/_page__Piz8geXW.mjs +165 -0
  103. package/packages/storefront/dist/server/chunks/pages/{account_WliDuQOB.mjs → account_6pD7OYw-.mjs} +6 -3
  104. package/packages/storefront/dist/server/chunks/pages/index_2F5yi6YO.mjs +128 -0
  105. package/packages/storefront/dist/server/chunks/pages/{node_ZaY4t9qW.mjs → node_-Buhxl8v.mjs} +3 -3
  106. package/packages/storefront/dist/server/chunks/pages/{~fallback_TL5hPXF_.mjs → ~fallback_okEL1qQ3.mjs} +25 -8
  107. package/packages/storefront/dist/server/chunks/~fallback_M-xiy2GE.mjs +6 -0
  108. package/packages/storefront/dist/server/entry.mjs +34 -29
  109. package/packages/storefront/dist/server/manifest_oV2meNKS.mjs +196 -0
  110. package/packages/storefront/dist/server/renderers.mjs +5 -612
  111. package/packages/storefront/package.json +3 -3
  112. package/packages/storefront/src/lib/components/globals/ALink.vue +1 -0
  113. package/packages/test-base/package.json +1 -1
  114. package/packages/types/package.json +1 -1
  115. package/packages/storefront/dist/client/_astro/AccountPage.Osc6ffV0.js +0 -1
  116. package/packages/storefront/dist/client/_astro/CartSidebar.LrfpXG2B.js +0 -1
  117. package/packages/storefront/dist/client/_astro/HeroSlider.Zf6kCaqD.js +0 -1
  118. package/packages/storefront/dist/client/_astro/PitchBar.N4d9fV8H.js +0 -1
  119. package/packages/storefront/dist/client/_astro/Prices.eQ9Vd255.js +0 -1
  120. package/packages/storefront/dist/client/_astro/ProductDetails.Ln_jf57U.js +0 -7
  121. package/packages/storefront/dist/client/_astro/ProductShelf.X389bv9S.js +0 -1
  122. package/packages/storefront/dist/client/_astro/ProductShelf.vj6lVDCr.js +0 -1
  123. package/packages/storefront/dist/client/_astro/QuantitySelector.qSJQlvTe.js +0 -1
  124. package/packages/storefront/dist/client/_astro/SearchModal.BrVoDBvg.js +0 -1
  125. package/packages/storefront/dist/client/_astro/SearchShowcase.KAz3nwco.js +0 -1
  126. package/packages/storefront/dist/client/_astro/ShopHeader.mFKGzhIu.js +0 -7
  127. package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper._suIQ7WC.js +0 -1
  128. package/packages/storefront/dist/client/_astro/client.PdegUP6S.js +0 -1
  129. package/packages/storefront/dist/client/_astro/customer-session.KkTHFOXl.js +0 -7
  130. package/packages/storefront/dist/client/_astro/ecom-icon_12falx.png +0 -0
  131. package/packages/storefront/dist/client/_astro/ecom-icon_15pqnO.png +0 -0
  132. package/packages/storefront/dist/client/_astro/ecom-icon_t3guw.png +0 -0
  133. package/packages/storefront/dist/client/_astro/ecom-utils.Ld2zf-Ve.js +0 -1
  134. package/packages/storefront/dist/client/_astro/format-money.Axn0YFLJ.js +0 -1
  135. package/packages/storefront/dist/client/_astro/grid-title.GntHOijE.js +0 -1
  136. package/packages/storefront/dist/client/_astro/headphone_T2Jjc.avif +0 -0
  137. package/packages/storefront/dist/client/_astro/headphone_Z1CG18r.webp +0 -0
  138. package/packages/storefront/dist/client/_astro/hoisted.3ec9NcvP.js +0 -1
  139. package/packages/storefront/dist/client/_astro/hoisted.UnTlypMd.js +0 -1
  140. package/packages/storefront/dist/client/_astro/i18n.3-NUtxYq.js +0 -1
  141. package/packages/storefront/dist/client/_astro/img.pozlYdd3.js +0 -1
  142. package/packages/storefront/dist/client/_astro/index.TkCbiY_p.js +0 -1
  143. package/packages/storefront/dist/client/_astro/index.m6fK0JXC.js +0 -1
  144. package/packages/storefront/dist/client/_astro/logo_1UBsBq.webp +0 -0
  145. package/packages/storefront/dist/client/_astro/logo_Z1K5PE9.png +0 -0
  146. package/packages/storefront/dist/client/_astro/logo_Z1KIIl1.avif +0 -0
  147. package/packages/storefront/dist/client/_astro/modules-info.mmwB1qIJ.js +0 -1
  148. package/packages/storefront/dist/client/_astro/name.49dZlpDx.js +0 -1
  149. package/packages/storefront/dist/client/_astro/passion_LHbe9.webp +0 -0
  150. package/packages/storefront/dist/client/_astro/passion_Z23MeUb.avif +0 -0
  151. package/packages/storefront/dist/client/_astro/rect8589_1TtOHY.png +0 -0
  152. package/packages/storefront/dist/client/_astro/rect8589_1f5opX.webp +0 -0
  153. package/packages/storefront/dist/client/_astro/rect8589_IUskt.webp +0 -0
  154. package/packages/storefront/dist/client/_astro/rect8589_Uxfdf.png +0 -0
  155. package/packages/storefront/dist/client/_astro/rect8589_Z15uApA.png +0 -0
  156. package/packages/storefront/dist/client/_astro/rect8589_Z1Ap1Im.avif +0 -0
  157. package/packages/storefront/dist/client/_astro/rect8589_Z1JT1HB.webp +0 -0
  158. package/packages/storefront/dist/client/_astro/rect8589_ZY9mtN.avif +0 -0
  159. package/packages/storefront/dist/client/_astro/rect8589_tMFW0.avif +0 -0
  160. package/packages/storefront/dist/client/_astro/rect859_1TgQXS.avif +0 -0
  161. package/packages/storefront/dist/client/_astro/rect859_2Nm1z.avif +0 -0
  162. package/packages/storefront/dist/client/_astro/rect859_DIqwR.png +0 -0
  163. package/packages/storefront/dist/client/_astro/rect859_Z1IKDb2.png +0 -0
  164. package/packages/storefront/dist/client/_astro/rect859_Z29FI4V.webp +0 -0
  165. package/packages/storefront/dist/client/_astro/rect859_Z2kFHGk.avif +0 -0
  166. package/packages/storefront/dist/client/_astro/rect859_ZkpPFI.webp +0 -0
  167. package/packages/storefront/dist/client/_astro/rect859_jXzBi.png +0 -0
  168. package/packages/storefront/dist/client/_astro/rect859_x1l16.webp +0 -0
  169. package/packages/storefront/dist/client/_astro/rect89_1TSfW7.avif +0 -0
  170. package/packages/storefront/dist/client/_astro/rect89_Z1re32x.webp +0 -0
  171. package/packages/storefront/dist/client/_astro/shopping-cart.Ean2uW2R.js +0 -1
  172. package/packages/storefront/dist/client/_astro/use-analytics.Y7amTmnr.js +0 -1
  173. package/packages/storefront/dist/client/_astro/use-product-card.zB4z32bC.js +0 -1
  174. package/packages/storefront/dist/client/_astro/use-text-value.f9pDzruv.js +0 -4
  175. package/packages/storefront/dist/client/app/account/index.html +0 -56
  176. package/packages/storefront/dist/client/app/index.html +0 -96
  177. package/packages/storefront/dist/client/headset-gamer-corsair-hs40-raptor-ca-9011122-naap-vinho/index.html +0 -107
  178. package/packages/storefront/dist/client/index.html +0 -120
  179. package/packages/storefront/dist/client/macbook-apple-pro-15.4-intel-core-i7-2.6ghz-ram-16gb-ssd-512gb-mr972ll/a-prata/index.html +0 -107
  180. package/packages/storefront/dist/client/mouse-gamer-corsair-optico-harpoon-rgb-ch-9301011-na/index.html +0 -107
  181. package/packages/storefront/dist/client/teclado-gamer-fortrek-mecanico-k5-rgb-outemu-blue-preto/index.html +0 -107
  182. package/packages/storefront/dist/client/~fallback/index.html +0 -74
  183. package/packages/storefront/dist/server/chunks/index_1q5IpD39.mjs +0 -6
  184. package/packages/storefront/dist/server/chunks/index_JEU6B2DI.mjs +0 -6
  185. package/packages/storefront/dist/server/chunks/pages/index_2bQLkQf-.mjs +0 -317
  186. package/packages/storefront/dist/server/manifest_YgAgEwvF.mjs +0 -196
@@ -1,23 +1,25 @@
1
+ import { img, imgSizes, i18n, formatMoney, price, randomObjectId, nickname, inStock, gridTitle, categoriesList, name, onPromotion, variationsGrids, specTextValue, specValueByText } from '@ecomplus/utils';
1
2
  import '@astrojs/internal-helpers/path';
2
- import { A as AstroError, c as ExpectedImageOptions, E as ExpectedImage, d as InvalidImageService, e as createAstro, f as createComponent, g as ImageMissingAlt, r as renderTemplate, m as maybeRenderHead, h as addAttribute, s as spreadAttributes, u as unescapeHTML, i as renderComponent, j as createTransitionScope, k as renderSlotToString, l as renderAllHeadContent, n as renderSlot, F as Fragment } from '../astro_PpArQAsY.mjs';
3
+ import { A as AstroError, c as ExpectedImageOptions, E as ExpectedImage, d as InvalidImageService, e as createAstro, f as createComponent, g as ImageMissingAlt, r as renderTemplate, m as maybeRenderHead, h as addAttribute, s as spreadAttributes, u as unescapeHTML, i as renderComponent, j as createTransitionScope, k as renderSlotToString, l as renderAllHeadContent, n as renderSlot$1, F as Fragment } from '../astro_H-6uiAAG.mjs';
3
4
  import 'kleur/colors';
4
5
  import api from '@cloudcommerce/api';
5
6
  import { EventEmitter } from 'node:events';
6
7
  import fs, { copyFileSync } from 'node:fs';
7
8
  import { resolve, join, basename as basename$1 } from 'node:path';
9
+ import { parse } from 'yaml';
8
10
  import config from '@cloudcommerce/config';
9
- import { img, price, formatMoney, randomObjectId, nickname, inStock, gridTitle, name, onPromotion, categoriesList, imgSizes, variationsGrids, specTextValue, specValueByText } from '@ecomplus/utils';
10
11
  import 'clsx';
11
12
  /* empty css */
12
- import { renderSync, parse, ELEMENT_NODE, walkSync } from 'ultrahtml';
13
+ import { renderSync, parse as parse$1, ELEMENT_NODE, walkSync } from 'ultrahtml';
13
14
  import mime from 'mime/lite.js';
14
- import { i as isESMImportedImage, a as isLocalService, b as isRemoteImage, D as DEFAULT_HASH_PROPS } from '../astro/assets-service_TpUb271h.mjs';
15
+ import { i as isESMImportedImage, a as isLocalService, b as isRemoteImage, D as DEFAULT_HASH_PROPS } from '../astro/assets-service_gJYJeEDH.mjs';
15
16
  import imageSize from 'image-size';
16
- import { reactive, computed, shallowRef, useSSRContext, defineComponent, resolveComponent, mergeProps, withCtx, withDirectives, createVNode, vShow, openBlock, createBlock, createCommentVNode, Fragment as Fragment$1, renderList, watch, ref, toRef, nextTick, withModifiers, renderSlot as renderSlot$1, Teleport, resolveDynamicComponent, onMounted, createTextVNode, toDisplayString, defineAsyncComponent, vModelText, Suspense, createSlots, shallowReactive, withAsyncContext, inject, provide, vModelRadio } from 'vue';
17
- import { ssrRenderAttrs, ssrRenderComponent, ssrRenderStyle, ssrRenderList, ssrRenderClass, ssrIncludeBooleanAttr, ssrRenderAttr, ssrRenderSlot, ssrRenderTeleport, ssrRenderVNode, ssrInterpolate, ssrRenderSuspense, ssrLooseEqual } from 'vue/server-renderer';
18
- import { watchDebounced, useDebounceFn, useTimeout, promiseTimeout, watchOnce, onClickOutside, useUrlSearchParams, useElementHover, createReusableTemplate } from '@vueuse/core';
17
+ import { useSSRContext, defineComponent, computed, createVNode, resolveDynamicComponent, mergeProps, withCtx, renderSlot, inject, ref, watch, toRef, onMounted, onBeforeUnmount, provide, reactive, shallowRef, resolveComponent, withDirectives, vShow, openBlock, createBlock, createCommentVNode, Fragment as Fragment$1, renderList, nextTick, withModifiers, Teleport, createTextVNode, toDisplayString, defineAsyncComponent, vModelText, Suspense, createSlots, shallowReactive, withAsyncContext, vModelRadio } from 'vue';
18
+ import { ssrRenderSlotInner, ssrRenderVNode, ssrRenderSlot, ssrRenderAttrs, ssrRenderClass, ssrRenderComponent, ssrRenderStyle, ssrRenderList, ssrIncludeBooleanAttr, ssrRenderAttr, ssrRenderTeleport, ssrInterpolate, ssrRenderSuspense, ssrLooseEqual } from 'vue/server-renderer';
19
+ import { useScroll, useElementHover, useDebounceFn, watchDebounced, useTimeout, promiseTimeout, watchOnce, onClickOutside, useUrlSearchParams, createReusableTemplate } from '@vueuse/core';
19
20
  import mitt from 'mitt';
20
21
  import { Popover, PopoverButton, PopoverPanel, Menu, MenuButton, MenuItems, MenuItem, Listbox, ListboxButton, ListboxOptions, ListboxOption } from '@headlessui/vue';
22
+ import { micromark } from 'micromark';
21
23
 
22
24
  const _export_sfc = (sfc, props) => {
23
25
  const target = sfc.__vccOpts || sfc;
@@ -27,11 +29,616 @@ const _export_sfc = (sfc, props) => {
27
29
  return target;
28
30
  };
29
31
 
32
+ const _sfc_main$F = /* @__PURE__ */ defineComponent({
33
+ __name: "Fade",
34
+ props: {
35
+ speed: { default: "default" },
36
+ slide: {},
37
+ isFloating: { type: Boolean, default: false },
38
+ isLeaveTo: { type: Boolean, default: true },
39
+ isEnterFrom: { type: Boolean, default: true }
40
+ },
41
+ setup(__props, { expose: __expose }) {
42
+ __expose();
43
+ const props = __props;
44
+ const duration = computed(() => {
45
+ if (props.speed === "default")
46
+ return "var(--transition, .2s linear)";
47
+ return `var(--transition-${props.speed}, .4s linear)`;
48
+ });
49
+ const transform = computed(() => {
50
+ switch (props.slide) {
51
+ case "down":
52
+ return "translate3d(0, -100%, 0)";
53
+ case "left":
54
+ return "translate3d(-100%, 0, 0)";
55
+ case "right":
56
+ return "translate3d(100%, 0, 0)";
57
+ case "up":
58
+ return "translate3d(0, 100%, 0)";
59
+ default:
60
+ return "none";
61
+ }
62
+ });
63
+ const opacity = computed(() => {
64
+ return transform.value !== "none" ? 0.1 : 0;
65
+ });
66
+ const enterFromOpacity = computed(() => {
67
+ return props.isEnterFrom ? opacity.value : 1;
68
+ });
69
+ const leaveToOpacity = computed(() => {
70
+ return props.isLeaveTo ? opacity.value : 1;
71
+ });
72
+ const enterFromTransform = computed(() => {
73
+ return props.isEnterFrom ? transform.value : "none";
74
+ });
75
+ const leaveToTransform = computed(() => {
76
+ return props.isLeaveTo ? transform.value : "none";
77
+ });
78
+ const isSlideY = computed(() => {
79
+ return props.slide === "down" || props.slide === "up";
80
+ });
81
+ const height = computed(() => {
82
+ if (props.isFloating)
83
+ return null;
84
+ return isSlideY.value ? 0 : "auto";
85
+ });
86
+ const width = computed(() => {
87
+ if (props.isFloating)
88
+ return null;
89
+ return props.slide && !isSlideY.value ? 0 : "auto";
90
+ });
91
+ const enterFromHeight = computed(() => {
92
+ return props.isEnterFrom ? height.value : "auto";
93
+ });
94
+ const enterFromWidth = computed(() => {
95
+ return props.isEnterFrom ? width.value : "auto";
96
+ });
97
+ const willChange = computed(() => {
98
+ let properties = "opacity";
99
+ if (transform.value !== "none")
100
+ properties += ", transform";
101
+ if (height.value === 0)
102
+ properties += ", height";
103
+ if (width.value === 0)
104
+ properties += ", width";
105
+ return properties;
106
+ });
107
+ const setInitialStyles = (el) => {
108
+ el.style.setProperty("--fade-will-change", willChange.value);
109
+ el.style.setProperty("--fade-duration", duration.value);
110
+ el.style.setProperty("--fade-enter-opacity", String(enterFromOpacity.value));
111
+ el.style.setProperty("--fade-enter-transform", String(enterFromTransform.value));
112
+ el.style.setProperty("--fade-enter-height", String(enterFromHeight.value));
113
+ el.style.setProperty("--fade-enter-width", String(enterFromWidth.value));
114
+ el.style.setProperty("--fade-leave-opacity", String(leaveToOpacity.value));
115
+ el.style.setProperty("--fade-leave-transform", String(leaveToTransform.value));
116
+ };
117
+ const onEnter = (el) => {
118
+ if (props.slide && !props.isFloating && props.isEnterFrom) {
119
+ if (isSlideY.value) {
120
+ el.style.width = getComputedStyle(el).width;
121
+ el.style.height = "auto";
122
+ } else {
123
+ el.style.width = "auto";
124
+ el.style.height = getComputedStyle(el).height;
125
+ }
126
+ el.style.position = "absolute";
127
+ el.style.visibility = "hidden";
128
+ const { width: width2, height: height2 } = getComputedStyle(el);
129
+ el.style.width = isSlideY.value ? "" : "0";
130
+ el.style.height = isSlideY.value ? "0" : "";
131
+ el.style.position = "";
132
+ el.style.visibility = "";
133
+ getComputedStyle(el)[isSlideY.value ? "height" : "width"];
134
+ requestAnimationFrame(() => {
135
+ if (isSlideY.value) {
136
+ el.style.height = height2;
137
+ } else {
138
+ el.style.width = width2;
139
+ }
140
+ });
141
+ }
142
+ };
143
+ const onAfterEnter = (el) => {
144
+ if (props.slide && !props.isFloating && props.isEnterFrom) {
145
+ el.style[isSlideY.value ? "height" : "width"] = "";
146
+ }
147
+ };
148
+ const onLeave = (el) => {
149
+ if (props.slide && !props.isFloating && props.isLeaveTo) {
150
+ if (isSlideY.value) {
151
+ el.style.height = getComputedStyle(el).height;
152
+ } else {
153
+ el.style.width = getComputedStyle(el).width;
154
+ }
155
+ const sizeProp = isSlideY.value ? "height" : "width";
156
+ getComputedStyle(el)[sizeProp];
157
+ requestAnimationFrame(() => {
158
+ el.style[sizeProp] = "0";
159
+ });
160
+ }
161
+ };
162
+ const __returned__ = { props, duration, transform, opacity, enterFromOpacity, leaveToOpacity, enterFromTransform, leaveToTransform, isSlideY, height, width, enterFromHeight, enterFromWidth, willChange, setInitialStyles, onEnter, onAfterEnter, onLeave };
163
+ Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
164
+ return __returned__;
165
+ }
166
+ });
167
+ function _sfc_ssrRender$F(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
168
+ ssrRenderSlotInner(_ctx.$slots, "default", {}, null, _push, _parent, null, true);
169
+ }
170
+ const _sfc_setup$F = _sfc_main$F.setup;
171
+ _sfc_main$F.setup = (props, ctx) => {
172
+ const ssrContext = useSSRContext();
173
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/globals/Fade.vue");
174
+ return _sfc_setup$F ? _sfc_setup$F(props, ctx) : void 0;
175
+ };
176
+ const Fade = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["ssrRender", _sfc_ssrRender$F]]);
177
+
178
+ const _sfc_main$E = /* @__PURE__ */ defineComponent({
179
+ __name: "ALink",
180
+ props: {
181
+ href: {},
182
+ target: {}
183
+ },
184
+ setup(__props, { expose: __expose }) {
185
+ __expose();
186
+ const props = __props;
187
+ const linkTarget = computed(() => {
188
+ if (!props.href)
189
+ return void 0;
190
+ if (props.target)
191
+ return props.target;
192
+ if (props.href.startsWith("http")) {
193
+ const domain = globalThis.$storefront.settings.domain || window.location.host;
194
+ if (props.href.startsWith(`https://${domain}`))
195
+ return void 0;
196
+ }
197
+ return void 0;
198
+ });
199
+ const __returned__ = { props, linkTarget };
200
+ Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
201
+ return __returned__;
202
+ }
203
+ });
204
+ function _sfc_ssrRender$E(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
205
+ ssrRenderVNode(_push, createVNode(resolveDynamicComponent($props.href ? "a" : "span"), mergeProps({
206
+ href: $props.href,
207
+ target: $setup.linkTarget,
208
+ rel: $setup.linkTarget === "_blank" ? "noopener" : void 0
209
+ }, _attrs), {
210
+ default: withCtx((_, _push2, _parent2, _scopeId) => {
211
+ if (_push2) {
212
+ ssrRenderSlot(_ctx.$slots, "default", {}, null, _push2, _parent2, _scopeId);
213
+ } else {
214
+ return [
215
+ renderSlot(_ctx.$slots, "default")
216
+ ];
217
+ }
218
+ }),
219
+ _: 3
220
+ }), _parent);
221
+ }
222
+ const _sfc_setup$E = _sfc_main$E.setup;
223
+ _sfc_main$E.setup = (props, ctx) => {
224
+ const ssrContext = useSSRContext();
225
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/globals/ALink.vue");
226
+ return _sfc_setup$E ? _sfc_setup$E(props, ctx) : void 0;
227
+ };
228
+ const ALink = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["ssrRender", _sfc_ssrRender$E]]);
229
+
230
+ const _sfc_main$D = /* @__PURE__ */ defineComponent({
231
+ __name: "AImg",
232
+ props: {
233
+ picture: {},
234
+ loading: { default: "lazy" },
235
+ decoding: {},
236
+ alt: {},
237
+ preferredSize: {}
238
+ },
239
+ setup(__props, { expose: __expose }) {
240
+ __expose();
241
+ const props = __props;
242
+ const image = computed(() => {
243
+ if (props.picture.url) {
244
+ return props.picture;
245
+ }
246
+ return img(props.picture, void 0, props.preferredSize) || {};
247
+ });
248
+ const dimensions = computed(() => {
249
+ return imgSizes(image.value);
250
+ });
251
+ const attrs = computed(() => ({
252
+ src: image.value.url,
253
+ alt: image.value.alt || props.alt,
254
+ width: dimensions.value.width || void 0,
255
+ height: dimensions.value.height || void 0,
256
+ loading: props.loading,
257
+ decoding: props.decoding || (dimensions.value.height ? "async" : void 0)
258
+ }));
259
+ const __returned__ = { props, image, dimensions, attrs };
260
+ Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
261
+ return __returned__;
262
+ }
263
+ });
264
+ function _sfc_ssrRender$D(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
265
+ _push(`<img${ssrRenderAttrs(mergeProps($setup.attrs, _attrs))}>`);
266
+ }
267
+ const _sfc_setup$D = _sfc_main$D.setup;
268
+ _sfc_main$D.setup = (props, ctx) => {
269
+ const ssrContext = useSSRContext();
270
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/globals/AImg.vue");
271
+ return _sfc_setup$D ? _sfc_setup$D(props, ctx) : void 0;
272
+ };
273
+ const AImg = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["ssrRender", _sfc_ssrRender$D]]);
274
+
275
+ const rowClassName = "bg-gray-200 rounded-md dark:bg-gray-700";
276
+ const _sfc_main$C = /* @__PURE__ */ defineComponent({
277
+ __name: "Skeleton",
278
+ props: {
279
+ isBold: { type: Boolean },
280
+ isLarge: { type: Boolean }
281
+ },
282
+ setup(__props, { expose: __expose }) {
283
+ __expose();
284
+ const props = __props;
285
+ const firstRowClassName = computed(() => {
286
+ return `${rowClassName} ${props.isBold ? "h-8 mb-6" : "h-2.5 mb-4"}`;
287
+ });
288
+ const nextRowsClassName = computed(() => {
289
+ return `${rowClassName} ${props.isBold ? "h-5 mb-4" : "h-2 mb-2.5"}`;
290
+ });
291
+ const __returned__ = { props, rowClassName, firstRowClassName, nextRowsClassName };
292
+ Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
293
+ return __returned__;
294
+ }
295
+ });
296
+ function _sfc_ssrRender$C(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
297
+ _push(`<div${ssrRenderAttrs(mergeProps({
298
+ role: "status",
299
+ class: ["animate-pulse", $props.isLarge ? "max-w-4xl" : "max-w-sm"]
300
+ }, _attrs))}><div class="${ssrRenderClass([$setup.firstRowClassName, $props.isLarge ? "w-96" : "w-48"])}"></div><div class="${ssrRenderClass([$setup.nextRowsClassName, $props.isLarge ? "max-w-[680px]" : "max-w-[340px]"])}"></div><div class="${ssrRenderClass($setup.nextRowsClassName)}"></div><div class="${ssrRenderClass([$setup.nextRowsClassName, $props.isLarge ? "max-w-[660px]" : "max-w-[330px]"])}"></div><div class="${ssrRenderClass([$setup.nextRowsClassName, $props.isLarge ? "max-w-[600px]" : "max-w-[300px]"])}"></div><div class="${ssrRenderClass([$setup.nextRowsClassName, $props.isLarge ? "max-w-[720px]" : "max-w-[360px]"])}"></div><span class="sr-only">Loading...</span></div>`);
301
+ }
302
+ const _sfc_setup$C = _sfc_main$C.setup;
303
+ _sfc_main$C.setup = (props, ctx) => {
304
+ const ssrContext = useSSRContext();
305
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/globals/Skeleton.vue");
306
+ return _sfc_setup$C ? _sfc_setup$C(props, ctx) : void 0;
307
+ };
308
+ const Skeleton = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["ssrRender", _sfc_ssrRender$C]]);
309
+
310
+ const formatPercentage = (value, digits = 1) => {
311
+ return Number.isInteger(value) ? `${value}%` : `${value.toFixed(digits)}%`;
312
+ };
313
+ const createApp$1 = (app) => {
314
+ app.use({
315
+ // eslint-disable-next-line no-shadow
316
+ install: (app2, options) => {
317
+ app2.config.globalProperties.$t = (dict, lang) => {
318
+ return i18n(dict, lang || options?.lang);
319
+ };
320
+ app2.config.globalProperties.$money = formatMoney;
321
+ app2.config.globalProperties.$percentage = formatPercentage;
322
+ app2.config.globalProperties.$settings = globalThis.$storefront.settings;
323
+ app2.config.globalProperties.$apiContext = globalThis.$storefront.apiContext;
324
+ }
325
+ });
326
+ app.component("Fade", Fade);
327
+ app.component("ALink", ALink);
328
+ app.component("AImg", AImg);
329
+ app.component("Skeleton", Skeleton);
330
+ };
331
+
332
+ const _sfc_main$B = /* @__PURE__ */ defineComponent({
333
+ __name: "CarouselControl",
334
+ props: {
335
+ isPrev: { type: Boolean, default: false }
336
+ },
337
+ setup(__props, { expose: __expose }) {
338
+ __expose();
339
+ const { axis, changeSlide } = inject(carouselKey);
340
+ const isX = axis === "x";
341
+ const __returned__ = { axis, changeSlide, isX };
342
+ Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
343
+ return __returned__;
344
+ }
345
+ });
346
+ function _sfc_ssrRender$B(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
347
+ _push(`<button${ssrRenderAttrs(mergeProps({
348
+ type: "button",
349
+ "aria-label": !$props.isPrev ? "Pr\xF3ximo" : "Anterior",
350
+ class: ["group absolute z-[11]", $setup.isX ? `${!$props.isPrev ? "right-0" : "left-0"} top-0` : `${!$props.isPrev ? "bottom-0" : "top-0"} left-0`],
351
+ "data-carousel-control": !$props.isPrev ? "next" : "previous"
352
+ }, _attrs))}>`);
353
+ ssrRenderSlot(_ctx.$slots, "default", {}, () => {
354
+ _push(`<i class="${ssrRenderClass([{
355
+ "group-active:translate-x-1": $setup.isX && !$props.isPrev,
356
+ "rotate-180 group-active:-translate-x-1": $setup.isX && $props.isPrev,
357
+ "rotate-90 group-active:translate-y-1": !$setup.isX && !$props.isPrev,
358
+ "-rotate-90 group-active:-translate-y-1": !$setup.isX && $props.isPrev
359
+ }, "i-chevron-right m-0"])}"></i>`);
360
+ }, _push, _parent);
361
+ _push(`</button>`);
362
+ }
363
+ const _sfc_setup$B = _sfc_main$B.setup;
364
+ _sfc_main$B.setup = (props, ctx) => {
365
+ const ssrContext = useSSRContext();
366
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/CarouselControl.vue");
367
+ return _sfc_setup$B ? _sfc_setup$B(props, ctx) : void 0;
368
+ };
369
+ const CarouselControl = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["ssrRender", _sfc_ssrRender$B]]);
370
+
371
+ const carouselKey = Symbol("carousel");
372
+ const _sfc_main$A = /* @__PURE__ */ defineComponent({
373
+ __name: "Carousel",
374
+ props: {
375
+ as: { default: "ul" },
376
+ index: { default: 0 },
377
+ autoplay: {},
378
+ axis: { default: "x" },
379
+ hasControls: { type: Boolean },
380
+ wrapperKey: {}
381
+ },
382
+ emits: ["update:index"],
383
+ setup(__props, { expose: __expose, emit: __emit }) {
384
+ __expose();
385
+ const props = __props;
386
+ const emit = __emit;
387
+ const activeIndex = ref(0);
388
+ watch(toRef(props, "index"), (index) => {
389
+ if (index !== activeIndex.value) {
390
+ const step = index - activeIndex.value;
391
+ changeSlide(step, false);
392
+ }
393
+ }, {
394
+ immediate: true
395
+ });
396
+ watch(activeIndex, (current, previous) => {
397
+ if (current !== previous) {
398
+ emit("update:index", current);
399
+ }
400
+ });
401
+ const wrapper = ref(null);
402
+ const { [props.axis]: currentPos, isScrolling, arrivedState } = useScroll(wrapper);
403
+ const isX = props.axis === "x";
404
+ const isBoundStart = computed(() => isX ? arrivedState.left : arrivedState.top);
405
+ const isBoundEnd = computed(() => isX ? arrivedState.right : arrivedState.bottom);
406
+ const slideSizes = ref([]);
407
+ const wrapperScrollSize = ref(0);
408
+ const wrapperVisibleSize = ref(0);
409
+ const calcWrapperSize = () => {
410
+ if (!wrapper.value)
411
+ return;
412
+ if (isX) {
413
+ wrapperScrollSize.value = wrapper.value.scrollWidth;
414
+ wrapperVisibleSize.value = wrapper.value.offsetWidth;
415
+ } else {
416
+ wrapperScrollSize.value = wrapper.value.scrollHeight;
417
+ wrapperVisibleSize.value = wrapper.value.offsetHeight;
418
+ }
419
+ };
420
+ const calcSlidesSize = () => {
421
+ if (!wrapper.value)
422
+ return;
423
+ let childNodes = [...wrapper.value.children];
424
+ if (childNodes.length === 1 && childNodes[0].tagName.endsWith("SLOT")) {
425
+ childNodes = [...childNodes[0].children];
426
+ }
427
+ slideSizes.value = childNodes.map((node) => ({
428
+ offset: isX ? node.offsetLeft : node.offsetTop,
429
+ size: isX ? node.offsetWidth : node.offsetHeight
430
+ }));
431
+ };
432
+ const calcNextOffset = (step) => {
433
+ let nextSlideIndex = activeIndex.value + step;
434
+ if (nextSlideIndex >= slideSizes.value.length) {
435
+ return 0;
436
+ }
437
+ if (nextSlideIndex < 0) {
438
+ nextSlideIndex = slideSizes.value.length + nextSlideIndex;
439
+ }
440
+ const { offset, size } = slideSizes.value[nextSlideIndex] || {};
441
+ if (!size) {
442
+ return 0;
443
+ }
444
+ return offset;
445
+ };
446
+ const calcCurrentIndex = () => {
447
+ const index = slideSizes.value.findIndex((slide) => {
448
+ return Math.abs(slide.offset - currentPos.value) <= 5;
449
+ });
450
+ if (index > -1) {
451
+ activeIndex.value = index || 0;
452
+ }
453
+ };
454
+ let autoplayTimer;
455
+ const restartAutoplay = () => {
456
+ if (props.autoplay) {
457
+ clearTimeout(autoplayTimer);
458
+ autoplayTimer = setTimeout(() => {
459
+ changeSlide(1);
460
+ }, props.autoplay);
461
+ }
462
+ };
463
+ const changeSlide = (step, isPageScroll = true) => {
464
+ if (slideSizes.value.length < 2) {
465
+ return;
466
+ }
467
+ let nextOffset = -1;
468
+ if (currentPos.value + wrapperVisibleSize.value >= wrapperScrollSize.value) {
469
+ nextOffset = 0;
470
+ } else {
471
+ if (isPageScroll && (step === 1 || step === -1)) {
472
+ let pageStep = 0;
473
+ let pageStepSize = 0;
474
+ for (let i = activeIndex.value; i < slideSizes.value.length; i++) {
475
+ const { size } = slideSizes.value[i] || {};
476
+ if (size) {
477
+ pageStep += 1;
478
+ pageStepSize += size;
479
+ if (pageStepSize + size * 0.75 >= wrapperVisibleSize.value) {
480
+ break;
481
+ }
482
+ }
483
+ }
484
+ if (pageStep) {
485
+ step = step > 0 ? pageStep : -pageStep;
486
+ }
487
+ }
488
+ nextOffset = calcNextOffset(step);
489
+ }
490
+ wrapper.value?.scrollTo({
491
+ [isX ? "left" : "top"]: nextOffset,
492
+ behavior: "smooth"
493
+ });
494
+ restartAutoplay();
495
+ };
496
+ watch(isScrolling, (_isScrolling) => {
497
+ if (_isScrolling) {
498
+ clearTimeout(autoplayTimer);
499
+ } else {
500
+ calcCurrentIndex();
501
+ restartAutoplay();
502
+ }
503
+ });
504
+ const carousel = ref(null);
505
+ const isHovered = useElementHover(carousel);
506
+ watch(isHovered, (_isHovered) => {
507
+ if (_isHovered) {
508
+ clearTimeout(autoplayTimer);
509
+ } else {
510
+ restartAutoplay();
511
+ }
512
+ });
513
+ const calcOnInit = () => {
514
+ if (!wrapper.value) {
515
+ return;
516
+ }
517
+ calcWrapperSize();
518
+ calcSlidesSize();
519
+ calcCurrentIndex();
520
+ };
521
+ const onResize = useDebounceFn(() => {
522
+ if (!wrapper.value)
523
+ return;
524
+ if (isX) {
525
+ wrapper.value.scrollLeft = 0;
526
+ } else {
527
+ wrapper.value.scrollTop = 0;
528
+ }
529
+ calcOnInit();
530
+ }, 400);
531
+ onMounted(() => {
532
+ calcOnInit();
533
+ });
534
+ watch(toRef(props, "wrapperKey"), calcOnInit);
535
+ onBeforeUnmount(() => {
536
+ clearTimeout(autoplayTimer);
537
+ });
538
+ provide(carouselKey, {
539
+ autoplay: toRef(props, "autoplay"),
540
+ axis: props.axis,
541
+ changeSlide,
542
+ isBoundStart,
543
+ isBoundEnd
544
+ });
545
+ const __returned__ = { carouselKey, props, emit, activeIndex, wrapper, currentPos, isScrolling, arrivedState, isX, isBoundStart, isBoundEnd, slideSizes, wrapperScrollSize, wrapperVisibleSize, calcWrapperSize, calcSlidesSize, calcNextOffset, calcCurrentIndex, get autoplayTimer() {
546
+ return autoplayTimer;
547
+ }, set autoplayTimer(v) {
548
+ autoplayTimer = v;
549
+ }, restartAutoplay, changeSlide, carousel, isHovered, calcOnInit, onResize, CarouselControl };
550
+ Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
551
+ return __returned__;
552
+ }
553
+ });
554
+ function _sfc_ssrRender$A(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
555
+ _push(`<div${ssrRenderAttrs(mergeProps({
556
+ ref: "carousel",
557
+ class: `relative ${!$setup.isX ? "overflow-hidden" : ""}`,
558
+ "data-carousel": ""
559
+ }, _attrs))}>`);
560
+ ssrRenderVNode(_push, createVNode(resolveDynamicComponent($props.as), {
561
+ ref: "wrapper",
562
+ class: ["m-0 flex snap-mandatory list-none scroll-smooth p-0 [&>*]:snap-start [&>*]:outline-none", $setup.isX ? "snap-x overflow-y-hidden overflow-x-scroll" : "h-full flex-col snap-y overflow-x-hidden overflow-y-scroll"],
563
+ style: { "scrollbar-width": "none", "-webkit-overflow-scrolling": "touch", "-ms-overflow-style": "none" },
564
+ "data-carousel-wrapper": ""
565
+ }, {
566
+ default: withCtx((_, _push2, _parent2, _scopeId) => {
567
+ if (_push2) {
568
+ ssrRenderSlot(_ctx.$slots, "default", {}, null, _push2, _parent2, _scopeId);
569
+ } else {
570
+ return [
571
+ renderSlot(_ctx.$slots, "default")
572
+ ];
573
+ }
574
+ }),
575
+ _: 3
576
+ }), _parent);
577
+ ssrRenderSlot(_ctx.$slots, "controls", {
578
+ changeSlide: $setup.changeSlide,
579
+ isBoundStart: $setup.isBoundStart,
580
+ isBoundEnd: $setup.isBoundEnd,
581
+ activeIndex: $setup.activeIndex
582
+ }, () => {
583
+ if ($setup.slideSizes.length > 1 || $props.hasControls) {
584
+ _push(ssrRenderComponent($setup["CarouselControl"], { "is-prev": "" }, {
585
+ default: withCtx((_, _push2, _parent2, _scopeId) => {
586
+ if (_push2) {
587
+ ssrRenderSlot(_ctx.$slots, "previous", {}, null, _push2, _parent2, _scopeId);
588
+ } else {
589
+ return [
590
+ renderSlot(_ctx.$slots, "previous")
591
+ ];
592
+ }
593
+ }),
594
+ _: 3
595
+ }, _parent));
596
+ } else {
597
+ _push(`<!---->`);
598
+ }
599
+ if ($setup.slideSizes.length > 1 || $props.hasControls) {
600
+ _push(ssrRenderComponent($setup["CarouselControl"], null, {
601
+ default: withCtx((_, _push2, _parent2, _scopeId) => {
602
+ if (_push2) {
603
+ ssrRenderSlot(_ctx.$slots, "next", {}, null, _push2, _parent2, _scopeId);
604
+ } else {
605
+ return [
606
+ renderSlot(_ctx.$slots, "next")
607
+ ];
608
+ }
609
+ }),
610
+ _: 3
611
+ }, _parent));
612
+ } else {
613
+ _push(`<!---->`);
614
+ }
615
+ }, _push, _parent);
616
+ _push(`</div>`);
617
+ }
618
+ const _sfc_setup$A = _sfc_main$A.setup;
619
+ _sfc_main$A.setup = (props, ctx) => {
620
+ const ssrContext = useSSRContext();
621
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/Carousel.vue");
622
+ return _sfc_setup$A ? _sfc_setup$A(props, ctx) : void 0;
623
+ };
624
+ const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["ssrRender", _sfc_ssrRender$A]]);
625
+
626
+ const createApp = (app) => {
627
+ createApp$1(app);
628
+ app.component("Carousel", Carousel);
629
+ app.component("CarouselControl", CarouselControl);
630
+ };
631
+
632
+ const mod = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
633
+ __proto__: null,
634
+ default: createApp
635
+ }, Symbol.toStringTag, { value: 'Module' }));
636
+
30
637
  async function getConfiguredImageService() {
31
638
  if (!globalThis?.astroAsset?.imageService) {
32
639
  const { default: service } = await import(
33
640
  // @ts-expect-error
34
- '../astro/assets-service_TpUb271h.mjs'
641
+ '../astro/assets-service_gJYJeEDH.mjs'
35
642
  ).then(n => n.s).catch((e) => {
36
643
  const error = new AstroError(InvalidImageService);
37
644
  error.cause = e;
@@ -173,35 +780,27 @@ const imageConfig = {"service":{"entrypoint":"astro/assets/services/sharp","conf
173
780
  const assetsDir = new URL("file:///home/leo/code/ecomplus/cloud-commerce/packages/storefront/dist/client/");
174
781
  const getImage = async (options) => await getImage$1(options, imageConfig);
175
782
 
176
- let id = -1;
177
- const useId = () => String(++id);
178
- const clearAccents = (str) => {
179
- return str.replace(/[ÁáÃãÂâÀà]/g, "a").replace(/[ÉéÊê]/g, "e").replace(/[Íí]/g, "i").replace(/[ÕõÓóÔô]/g, "o").replace(/[Úú]/g, "u").replace(/[Çç]/g, "c");
180
- };
181
- const slugify = (str) => {
182
- return clearAccents(str.trim()).toLowerCase().replace(/[\W\r\n]/gm, "-").replace(/-{2,}/g, "-").replace(/(^-)|(-$)/g, "");
183
- };
184
- const toLowerCaseAccents = (str) => {
185
- return str.toLowerCase().replace(/Á/g, "á").replace(/Ã/g, "ã").replace(/Â/g, "â").replace(/À/g, "à").replace(/É/g, "é").replace(/Ê/g, "ê").replace(/Í/g, "í").replace(/Õ/g, "õ").replace(/Ó/g, "ó").replace(/Ô/g, "ô").replace(/Ú/g, "ú").replace(/Ç/g, "ç");
186
- };
187
- const termify = (str) => {
188
- return toLowerCaseAccents(str.trim()).replace(/[\r\n]/gm, " ").replace(/[^\w-&%áãâàéêíõóôúç]/g, " ").replace(/\s{2,}/g, " ");
189
- };
190
- const getSearchUrl = (term, baseUrl = "/s/") => {
191
- return `${baseUrl}${encodeURIComponent(termify(term))}`;
192
- };
193
- const scrollToEl = (el, top = 0) => {
194
- while (el.offsetParent) {
195
- top += el.offsetTop;
196
- el = el.offsetParent;
197
- }
198
- return window.scroll({
199
- top,
200
- behavior: "smooth"
201
- });
202
- };
783
+ const i19aboveOf = "Acima de";
784
+ const i19brands = "Marcas";
785
+ const i19categories = "Categorias";
786
+ const i19discount = "Desconto";
787
+ const i19error = "Erro";
788
+ const i19errorMsg = "Ocorreu um erro, tente novamente ou entre em contato conosco.";
789
+ const i19highestPrice = "Maior preço";
790
+ const i19home = "Início";
791
+ const i19lowestPrice = "Menor preço";
792
+ const i19myAccount = "Minha conta";
793
+ const i19name = "Nome";
794
+ const i19notFound = "Não encontrado";
795
+ const i19relatedProducts = "Produtos relacionados";
796
+ const i19releases = "Lançamentos";
797
+ const i19relevance = "Relevância";
798
+ const i19sales = "Vendas";
799
+ const i19searchProducts = "Buscar produtos";
800
+ const i19shoppingCart = "Carrinho de compras";
801
+ const i19upTo = "Até";
203
802
 
204
- global.__storefrontCMS = (fs, resolvePath) => {
803
+ global.__storefrontCMS = (fs, resolvePath, _parseMatter) => {
205
804
  const { STOREFRONT_BASE_DIR } = process.env;
206
805
  let baseDir;
207
806
  if (STOREFRONT_BASE_DIR) {
@@ -211,6 +810,7 @@ global.__storefrontCMS = (fs, resolvePath) => {
211
810
  }
212
811
  process.env.STOREFRONT_BASE_DIR = baseDir;
213
812
  const dirContent = resolvePath(baseDir, 'content');
813
+ const resolveContent = (filename) => resolvePath(dirContent, filename);
214
814
 
215
815
  const contentCache = {};
216
816
  const getContent = (filename) => {
@@ -220,7 +820,7 @@ global.__storefrontCMS = (fs, resolvePath) => {
220
820
  let content = contentCache[filename];
221
821
  if (!content) {
222
822
  if (filename.endsWith('/')) {
223
- const dirColl = resolvePath(dirContent, filename);
823
+ const dirColl = resolveContent(filename);
224
824
  return new Promise((resolve) => {
225
825
  const slugs = fs.existsSync(dirColl)
226
826
  ? fs.readdirSync(dirColl)
@@ -230,16 +830,22 @@ global.__storefrontCMS = (fs, resolvePath) => {
230
830
  resolve(slugs);
231
831
  });
232
832
  }
233
- // @TODO: Also parse Markdown with front matter
234
- const filepath = resolvePath(dirContent, `${filename}.json`);
235
- content = fs.existsSync(filepath)
236
- ? JSON.parse(fs.readFileSync(filepath, 'utf8'))
237
- : null;
833
+ const jsonFilepath = resolveContent(`${filename}.json`);
834
+ if (fs.existsSync(jsonFilepath)) {
835
+ content = JSON.parse(fs.readFileSync(jsonFilepath, 'utf8'));
836
+ } else if (_parseMatter && fs.existsSync(resolveContent(`${filename}.md`))) {
837
+ const rawMd = fs.readFileSync(resolveContent(`${filename}.md`), 'utf8');
838
+ const { markdown, matter } = _parseMatter(rawMd);
839
+ content = { ...matter, markdown };
840
+ } else {
841
+ content = null;
842
+ }
238
843
  if (!filename.includes('/')) {
239
844
  // Caching root content only (not collections)
240
845
  contentCache[filename] = content;
241
846
  }
242
847
  }
848
+ if (typeof content.then === 'function') return content;
243
849
  return filename === 'settings'
244
850
  ? content
245
851
  : new Promise((resolve) => { resolve(content); });
@@ -288,13 +894,25 @@ const _getConfig = () => {
288
894
  } else if (ECOM_STORE_ID) {
289
895
  config.set({ storeId: Number(ECOM_STORE_ID) });
290
896
  }
897
+ const parseFrontmatter = (markdown) => {
898
+ let matter = {};
899
+ if (markdown.substring(0, 4) === "---\n") {
900
+ const [frontmatter, _md] = markdown.substring(4).split("\n---\n");
901
+ markdown = _md;
902
+ const _matter = parse(frontmatter);
903
+ if (typeof _matter === "object" && _matter && !Array.isArray(_matter)) {
904
+ matter = _matter;
905
+ }
906
+ }
907
+ return { markdown, matter };
908
+ };
291
909
  const {
292
910
  domain,
293
911
  primaryColor,
294
912
  secondaryColor,
295
913
  settings,
296
914
  getContent
297
- } = global.__storefrontCMS(fs, resolve);
915
+ } = global.__storefrontCMS(fs, resolve, parseFrontmatter);
298
916
  config.set({ settingsContent: settings });
299
917
  let { storeId } = config.get();
300
918
  if (!storeId) {
@@ -334,6 +952,34 @@ const _getConfig = () => {
334
952
  };
335
953
  };
336
954
 
955
+ let id = -1;
956
+ const useId = () => String(++id);
957
+ const clearAccents = (str) => {
958
+ return str.replace(/[ÁáÃãÂâÀà]/g, "a").replace(/[ÉéÊê]/g, "e").replace(/[Íí]/g, "i").replace(/[ÕõÓóÔô]/g, "o").replace(/[Úú]/g, "u").replace(/[Çç]/g, "c");
959
+ };
960
+ const slugify = (str) => {
961
+ return clearAccents(str.trim()).toLowerCase().replace(/[\W\r\n]/gm, "-").replace(/-{2,}/g, "-").replace(/(^-)|(-$)/g, "");
962
+ };
963
+ const toLowerCaseAccents = (str) => {
964
+ return str.toLowerCase().replace(/Á/g, "á").replace(/Ã/g, "ã").replace(/Â/g, "â").replace(/À/g, "à").replace(/É/g, "é").replace(/Ê/g, "ê").replace(/Í/g, "í").replace(/Õ/g, "õ").replace(/Ó/g, "ó").replace(/Ô/g, "ô").replace(/Ú/g, "ú").replace(/Ç/g, "ç");
965
+ };
966
+ const termify = (str) => {
967
+ return toLowerCaseAccents(str.trim()).replace(/[\r\n]/gm, " ").replace(/[^\w-&%áãâàéêíõóôúç]/g, " ").replace(/\s{2,}/g, " ");
968
+ };
969
+ const getSearchUrl = (term, baseUrl = "/s/") => {
970
+ return `${baseUrl}${encodeURIComponent(termify(term))}`;
971
+ };
972
+ const scrollToEl = (el, top = 0) => {
973
+ while (el.offsetParent) {
974
+ top += el.offsetTop;
975
+ el = el.offsetParent;
976
+ }
977
+ return window.scroll({
978
+ top,
979
+ behavior: "smooth"
980
+ });
981
+ };
982
+
337
983
  const emitter$1 = new EventEmitter();
338
984
  const getConfig = _getConfig;
339
985
  if (!globalThis.$apiMergeConfig) {
@@ -374,6 +1020,7 @@ const loadRouteContext = async (Astro, {
374
1020
  contentCollection,
375
1021
  apiPrefetchEndpoints = globalThis.$apiPrefetchEndpoints
376
1022
  } = {}) => {
1023
+ globalThis.astroUrl = Astro.url;
377
1024
  const startedAt = Date.now();
378
1025
  let urlPath = Astro.url.pathname;
379
1026
  const isPreview = urlPath.startsWith("/~preview");
@@ -532,9 +1179,9 @@ const $$ViewTransitions = createComponent(async ($$result, $$props, $$slots) =>
532
1179
  `;
533
1180
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/components/ViewTransitions.astro", void 0);
534
1181
 
535
- var __freeze$4 = Object.freeze;
536
- var __defProp$4 = Object.defineProperty;
537
- var __template$4 = (cooked, raw) => __freeze$4(__defProp$4(cooked, "raw", { value: __freeze$4(raw || cooked.slice()) }));
1182
+ var __freeze$3 = Object.freeze;
1183
+ var __defProp$3 = Object.defineProperty;
1184
+ var __template$3 = (cooked, raw) => __freeze$3(__defProp$3(cooked, "raw", { value: __freeze$3(raw || cooked.slice()) }));
538
1185
  var _b, _c;
539
1186
  const $$Astro$e = createAstro("https://demo.ecomplus.app");
540
1187
  const $$BaseHead = createComponent(async ($$result, $$props, $$slots) => {
@@ -548,6 +1195,8 @@ const $$BaseHead = createComponent(async ($$result, $$props, $$slots) => {
548
1195
  };
549
1196
  const {
550
1197
  storeId,
1198
+ isHomepage,
1199
+ isSearchPage,
551
1200
  searchPageTerm,
552
1201
  cmsContent,
553
1202
  fetchingApiContext,
@@ -567,14 +1216,26 @@ const $$BaseHead = createComponent(async ($$result, $$props, $$slots) => {
567
1216
  }
568
1217
  const apiDoc = apiContext.doc;
569
1218
  const state = apiDoc || cmsContent || {};
570
- let title = state.meta_title || state.metaTitle || state.name && `${state.name} | ${settings.name}` || state.title && `${state.title} | ${settings.name}` || settings.name;
571
- if (searchPageTerm) {
572
- title = title.replace("$term", searchPageTerm);
573
- if (!title.includes(searchPageTerm)) {
574
- title = `${searchPageTerm} | ${title}`;
1219
+ let title = state.meta_title || state.metaTitle || state.name && `${state.name} | ${settings.name}` || state.title && `${state.title} | ${settings.name}` || "";
1220
+ let description = state.meta_description || state.metaDescription || state.short_description || state.description || settings.description || "";
1221
+ if (isHomepage) {
1222
+ if (!title)
1223
+ title = settings.name;
1224
+ if (!description)
1225
+ description = settings.description;
1226
+ }
1227
+ if (isSearchPage) {
1228
+ if (searchPageTerm) {
1229
+ if (!title)
1230
+ title = settings.name;
1231
+ title = title.replace("$term", searchPageTerm);
1232
+ if (!title.includes(searchPageTerm)) {
1233
+ title = `${searchPageTerm} | ${title}`;
1234
+ }
1235
+ } else if (!title) {
1236
+ title = `${i19searchProducts} | ${settings.name}`;
575
1237
  }
576
1238
  }
577
- const description = state.meta_description || state.metaDescription || state.short_description || settings.description;
578
1239
  const favicon = settings.icon ? getIconUrl(32) : "/favicon.ico";
579
1240
  const shortcutIcon = settings.icon ? getIconUrl(192) : null;
580
1241
  const canonicalUrl = new URL(Astro2.url.pathname, Astro2.site || `https://${domain}`);
@@ -665,7 +1326,7 @@ window.$isCmsPreview = true;`;
665
1326
  url: `https://${domain}/`,
666
1327
  logo: `https://${domain}${settings.logo}`
667
1328
  });
668
- return renderTemplate(_c || (_c = __template$4(['<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<script", ">", '</script>\n<script type="application/ld+json">', "</script>\n\n", "\n", ""])), addAttribute(primaryColor, "content"), addAttribute(favicon, "href"), shortcutIcon && renderTemplate`<link rel="icon" type="image/png"${addAttribute(shortcutIcon, "href")} sizes="192x192">`, title, addAttribute(description, "content"), addAttribute(settings.name, "content"), addAttribute(Astro2.generator, "content"), addAttribute(canonicalUrl, "href"), shortcutIcon && renderTemplate`<link rel="apple-touch-icon"${addAttribute(shortcutIcon, "href")}>`, addAttribute(settings.name, "content"), addAttribute(canonicalUrl, "content"), addAttribute(title, "content"), addAttribute(description, "content"), addAttribute(ogLocale, "content"), ogImage && renderTemplate`<meta property="og:image"${addAttribute(ogImage, "content")}>`, metatagsContent?.fbAppId && renderTemplate`<meta property="fb:app_id"${addAttribute(metatagsContent.fbAppId, "content")}>`, metatagsContent?.twitterUsername && renderTemplate`<meta name="twitter:site"${addAttribute(metatagsContent.twitterUsername, "content")}>`, addAttribute(String(storeId), "content"), isPWA , addAttribute(createTransitionScope($$result, "23j4qrxj"), "data-astro-transition-persist"), unescapeHTML(inlineClientJS), unescapeHTML(inlineJSONLd), hasViewTransitions && renderTemplate`${renderComponent($$result, "ViewTransitions", $$ViewTransitions, { "fallback": "none" })}`, contextInlineClientJS && renderTemplate(_b || (_b = __template$4(["<script>", "</script>"])), unescapeHTML(contextInlineClientJS)));
1329
+ return renderTemplate(_c || (_c = __template$3(['<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", "\n", '\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<script", ">", '</script>\n<script type="application/ld+json">', "</script>\n\n", "\n", ""])), addAttribute(primaryColor, "content"), addAttribute(favicon, "href"), shortcutIcon && renderTemplate`<link rel="icon" type="image/png"${addAttribute(shortcutIcon, "href")} sizes="192x192">`, title && renderTemplate`<title>${title}</title>`, description && renderTemplate`<meta name="description"${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?.fbAppId && renderTemplate`<meta property="fb:app_id"${addAttribute(metatagsContent.fbAppId, "content")}>`, metatagsContent?.twitterUsername && renderTemplate`<meta name="twitter:site"${addAttribute(metatagsContent.twitterUsername, "content")}>`, addAttribute(String(storeId), "content"), isPWA , addAttribute(createTransitionScope($$result, "kvdive2p"), "data-astro-transition-persist"), unescapeHTML(inlineClientJS), unescapeHTML(inlineJSONLd), hasViewTransitions && renderTemplate`${renderComponent($$result, "ViewTransitions", $$ViewTransitions, { "fallback": "none" })}`, contextInlineClientJS && renderTemplate(_b || (_b = __template$3(["<script>", "</script>"])), unescapeHTML(contextInlineClientJS)));
669
1330
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/BaseHead.astro", "self");
670
1331
 
671
1332
  function has(value) {
@@ -766,7 +1427,7 @@ function getWeight(element) {
766
1427
  }
767
1428
 
768
1429
  function capo(html) {
769
- const ast = parse(html);
1430
+ const ast = parse$1(html);
770
1431
  try {
771
1432
  walkSync(ast, (node, parent, index) => {
772
1433
  if (node.type === ELEMENT_NODE && node.name === "head") {
@@ -1142,8 +1803,8 @@ const $$BaseBody = createComponent(async ($$result, $$props, $$slots) => {
1142
1803
  return renderTemplate`${maybeRenderHead()}<body style="visibility:hidden" class="!visible"> <!-- Prevent FOUC -->
1143
1804
  <div id="teleported-overlap" class="relative z-[59]"></div>
1144
1805
  <div id="teleported-top" class="relative z-[19]"></div>
1145
- ${renderSlot($$result, $$slots["default"])}
1146
- ${renderSlot($$result, $$slots["before-body-end"])}
1806
+ ${renderSlot$1($$result, $$slots["default"])}
1807
+ ${renderSlot$1($$result, $$slots["before-body-end"])}
1147
1808
  <div id="teleported-bottom" class="relative z-[19]"></div>
1148
1809
  ${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 })}`}
1149
1810
  </body>`;
@@ -1156,26 +1817,26 @@ const $$Base$1 = createComponent(async ($$result, $$props, $$slots) => {
1156
1817
  const { getContent } = Astro2.locals.routeContext;
1157
1818
  const { customCode } = await getContent("layout");
1158
1819
  return renderTemplate`${renderComponent($$result, "Head", Head, {}, { "default": ($$result2) => renderTemplate`
1159
- ${renderSlot($$result2, $$slots["base-head"])}
1160
- ${customCode?.css && renderTemplate`<style>{customCode.css}</style>`}${customCode?.htmlHead && renderTemplate`${renderComponent($$result2, "Fragment", Fragment, {}, { "default": ($$result3) => renderTemplate`${unescapeHTML(customCode.htmlHead)}` })}`}${renderSlot($$result2, $$slots["base-head-scripts"])}
1161
- ${renderSlot($$result2, $$slots["before-head-end"])}
1820
+ ${renderSlot$1($$result2, $$slots["base-head"])}
1821
+ ${customCode?.css && renderTemplate`<style>{customCode.css}</style>`}${customCode?.htmlHead && renderTemplate`${renderComponent($$result2, "Fragment", Fragment, {}, { "default": ($$result3) => renderTemplate`${unescapeHTML(customCode.htmlHead)}` })}`}${renderSlot$1($$result2, $$slots["base-head-scripts"])}
1822
+ ${renderSlot$1($$result2, $$slots["before-head-end"])}
1162
1823
  ` })}
1163
1824
  ${renderComponent($$result, "BaseBody", $$BaseBody, {}, { "default": ($$result2) => renderTemplate`
1164
- ${renderSlot($$result2, $$slots["default"])}
1165
- ${customCode?.htmlBody && renderTemplate`${renderComponent($$result2, "Fragment", Fragment, {}, { "default": ($$result3) => renderTemplate`${unescapeHTML(customCode.htmlBody)}` })}`}${renderSlot($$result2, $$slots["base-body-scripts"])}
1166
- ${renderSlot($$result2, $$slots["before-body-end"])}
1825
+ ${renderSlot$1($$result2, $$slots["default"])}
1826
+ ${customCode?.htmlBody && renderTemplate`${renderComponent($$result2, "Fragment", Fragment, {}, { "default": ($$result3) => renderTemplate`${unescapeHTML(customCode.htmlBody)}` })}`}${renderSlot$1($$result2, $$slots["base-body-scripts"])}
1827
+ ${renderSlot$1($$result2, $$slots["before-body-end"])}
1167
1828
  ` })}`;
1168
1829
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/Base.astro", void 0);
1169
1830
 
1170
- var __freeze$3 = Object.freeze;
1171
- var __defProp$3 = Object.defineProperty;
1172
- var __template$3 = (cooked, raw) => __freeze$3(__defProp$3(cooked, "raw", { value: __freeze$3(raw || cooked.slice()) }));
1173
- var _a$3;
1831
+ var __freeze$2 = Object.freeze;
1832
+ var __defProp$2 = Object.defineProperty;
1833
+ var __template$2 = (cooked, raw) => __freeze$2(__defProp$2(cooked, "raw", { value: __freeze$2(raw || cooked.slice()) }));
1834
+ var _a$2;
1174
1835
  const $$Astro$a = createAstro("https://demo.ecomplus.app");
1175
1836
  const $$InlineScripts = createComponent(async ($$result, $$props, $$slots) => {
1176
1837
  const Astro2 = $$result.createAstro($$Astro$a, $$props, $$slots);
1177
1838
  Astro2.self = $$InlineScripts;
1178
- return renderTemplate(_a$3 || (_a$3 = __template$3(['<script>\n window.$firebaseConfig = {\n apiKey: "AIzaSyCnvm7QrPKzSBrUi09Z3zTgjDST0t4Yikg",\n authDomain: "ecom2-demo.firebaseapp.com",\n projectId: "ecom2-demo",\n storageBucket: "ecom2-demo.appspot.com",\n messagingSenderId: "70369627313",\n appId: "1:70369627313:web:06634033b9c6208fe7e690"\n };\n<\/script>'])));
1839
+ return renderTemplate(_a$2 || (_a$2 = __template$2(['<script>\n window.$firebaseConfig = {\n apiKey: "AIzaSyCnvm7QrPKzSBrUi09Z3zTgjDST0t4Yikg",\n authDomain: "ecom2-demo.firebaseapp.com",\n projectId: "ecom2-demo",\n storageBucket: "ecom2-demo.appspot.com",\n messagingSenderId: "70369627313",\n appId: "1:70369627313:web:06634033b9c6208fe7e690"\n };\n<\/script>'])));
1179
1840
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/scripts/InlineScripts.astro", void 0);
1180
1841
 
1181
1842
  const $$Astro$9 = createAstro("https://demo.ecomplus.app");
@@ -1183,11 +1844,11 @@ const $$Base = createComponent(async ($$result, $$props, $$slots) => {
1183
1844
  const Astro2 = $$result.createAstro($$Astro$9, $$props, $$slots);
1184
1845
  Astro2.self = $$Base;
1185
1846
  return renderTemplate`${renderComponent($$result, "SfBase", $$Base$1, {}, { "base-head": ($$result2) => renderTemplate`${renderComponent($$result2, "Fragment", Fragment, { "slot": "base-head" }, { "default": ($$result3) => renderTemplate`
1186
- ${renderSlot($$result3, $$slots["base-head"])}
1847
+ ${renderSlot$1($$result3, $$slots["base-head"])}
1187
1848
  ` })}`, "before-head-end": ($$result2) => renderTemplate`${renderComponent($$result2, "InlineScripts", $$InlineScripts, { "slot": "before-head-end" })}`, "default": ($$result2) => renderTemplate`
1188
1849
 
1189
1850
 
1190
- ${renderSlot($$result2, $$slots["default"])}
1851
+ ${renderSlot$1($$result2, $$slots["default"])}
1191
1852
  ` })}`;
1192
1853
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/Base.astro", void 0);
1193
1854
 
@@ -1218,7 +1879,8 @@ const useSharedData = async (props) => {
1218
1879
  return {
1219
1880
  value,
1220
1881
  getInlineClientJS: () => `
1221
- window.$storefront.data['${field}'] = ${JSON.stringify(value)};`
1882
+ window.$storefront.data['${field}'] = ${JSON.stringify(value)};
1883
+ window.dispatchEvent(new Event('storefront:data:${field}'));`
1222
1884
  };
1223
1885
  };
1224
1886
 
@@ -1420,7 +2082,7 @@ const usePageHeader = async ({ routeContext, listedCategoryFields }) => {
1420
2082
  };
1421
2083
  };
1422
2084
 
1423
- const _sfc_main$v = /* @__PURE__ */ defineComponent({
2085
+ const _sfc_main$z = /* @__PURE__ */ defineComponent({
1424
2086
  __name: "PitchBar",
1425
2087
  props: {
1426
2088
  slides: {}
@@ -1437,7 +2099,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
1437
2099
  return __returned__;
1438
2100
  }
1439
2101
  });
1440
- function _sfc_ssrRender$v(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2102
+ function _sfc_ssrRender$z(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
1441
2103
  const _component_Carousel = resolveComponent("Carousel");
1442
2104
  const _component_ALink = resolveComponent("ALink");
1443
2105
  const _component_CarouselControl = resolveComponent("CarouselControl");
@@ -1530,13 +2192,13 @@ function _sfc_ssrRender$v(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
1530
2192
  }, _parent));
1531
2193
  _push(`</div></div>`);
1532
2194
  }
1533
- const _sfc_setup$v = _sfc_main$v.setup;
1534
- _sfc_main$v.setup = (props, ctx) => {
2195
+ const _sfc_setup$z = _sfc_main$z.setup;
2196
+ _sfc_main$z.setup = (props, ctx) => {
1535
2197
  const ssrContext = useSSRContext();
1536
2198
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/PitchBar.vue");
1537
- return _sfc_setup$v ? _sfc_setup$v(props, ctx) : void 0;
2199
+ return _sfc_setup$z ? _sfc_setup$z(props, ctx) : void 0;
1538
2200
  };
1539
- const PitchBar = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["ssrRender", _sfc_ssrRender$v]]);
2201
+ const PitchBar = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["ssrRender", _sfc_ssrRender$z]]);
1540
2202
 
1541
2203
  const useStorage = (key, initialValue, storage = globalThis.localStorage) => {
1542
2204
  if (!storage) {
@@ -1920,7 +2582,7 @@ const useShopHeader = (props) => {
1920
2582
  };
1921
2583
  };
1922
2584
 
1923
- const _sfc_main$u = /* @__PURE__ */ defineComponent({
2585
+ const _sfc_main$y = /* @__PURE__ */ defineComponent({
1924
2586
  __name: "Drawer",
1925
2587
  props: {
1926
2588
  modelValue: { type: Boolean, default: false },
@@ -2023,7 +2685,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
2023
2685
  return __returned__;
2024
2686
  }
2025
2687
  });
2026
- function _sfc_ssrRender$u(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2688
+ function _sfc_ssrRender$y(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2027
2689
  const _component_Fade = resolveComponent("Fade");
2028
2690
  _push(ssrRenderComponent(_component_Fade, mergeProps({
2029
2691
  slide: $setup.slideTo,
@@ -2119,11 +2781,11 @@ function _sfc_ssrRender$u(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2119
2781
  class: ["absolute top-2 z-30 rounded", $props.placement === "end" ? "left-2" : "right-2"],
2120
2782
  "data-drawer-close": ""
2121
2783
  }, [
2122
- renderSlot$1(_ctx.$slots, "close", {}, () => [
2784
+ renderSlot(_ctx.$slots, "close", {}, () => [
2123
2785
  createVNode("i", { class: "i-close text-base-400 hover:text-base-600 m-0 text-3xl" })
2124
2786
  ])
2125
2787
  ], 2)) : createCommentVNode("", true),
2126
- renderSlot$1(_ctx.$slots, "default")
2788
+ renderSlot(_ctx.$slots, "default")
2127
2789
  ]),
2128
2790
  $props.backdropTarget ? (openBlock(), createBlock(Teleport, {
2129
2791
  key: 0,
@@ -2149,13 +2811,13 @@ function _sfc_ssrRender$u(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2149
2811
  _: 3
2150
2812
  }, _parent));
2151
2813
  }
2152
- const _sfc_setup$u = _sfc_main$u.setup;
2153
- _sfc_main$u.setup = (props, ctx) => {
2814
+ const _sfc_setup$y = _sfc_main$y.setup;
2815
+ _sfc_main$y.setup = (props, ctx) => {
2154
2816
  const ssrContext = useSSRContext();
2155
2817
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/Drawer.vue");
2156
- return _sfc_setup$u ? _sfc_setup$u(props, ctx) : void 0;
2818
+ return _sfc_setup$y ? _sfc_setup$y(props, ctx) : void 0;
2157
2819
  };
2158
- const Drawer = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["ssrRender", _sfc_ssrRender$u]]);
2820
+ const Drawer = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["ssrRender", _sfc_ssrRender$y]]);
2159
2821
 
2160
2822
  const storageKey$1 = "ecomSession";
2161
2823
  const emptySession = {
@@ -2194,26 +2856,33 @@ const initializeFirebaseAuth = (canWaitIdle) => {
2194
2856
  return;
2195
2857
  };
2196
2858
 
2197
- const _sfc_main$t = /* @__PURE__ */ defineComponent({
2859
+ const _sfc_main$x = /* @__PURE__ */ defineComponent({
2198
2860
  __name: "AccountLink",
2199
2861
  props: {
2200
2862
  to: {},
2201
2863
  accountUrl: { default: globalThis.$storefront?.settings.accountUrl || "/app/account" },
2202
- returnUrl: { default: globalThis.location?.href },
2864
+ returnUrl: {},
2203
2865
  isSignUp: { type: Boolean }
2204
2866
  },
2205
2867
  setup(__props, { expose: __expose }) {
2206
2868
  __expose();
2207
2869
  const props = __props;
2870
+ const locationUrl = ref("");
2871
+ if (globalThis.location?.href) {
2872
+ nextTick(() => {
2873
+ locationUrl.value = globalThis.location.href;
2874
+ });
2875
+ }
2208
2876
  const href = computed(() => {
2209
2877
  let url = props.accountUrl;
2878
+ const returnUrl = props.returnUrl || locationUrl.value;
2210
2879
  if (!props.to) {
2211
2880
  if (props.isSignUp) {
2212
2881
  url += "?sign_up&";
2213
2882
  } else {
2214
2883
  url += "?";
2215
2884
  }
2216
- return props.returnUrl ? `${url}return_url=${props.returnUrl}` : url;
2885
+ return returnUrl ? `${url}return_url=${returnUrl}` : url;
2217
2886
  }
2218
2887
  const { settings } = globalThis.$storefront;
2219
2888
  if (props.to === "orders" && settings.ordersUrl) {
@@ -2224,25 +2893,25 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
2224
2893
  }
2225
2894
  return `${url}/${props.to}`;
2226
2895
  });
2227
- const __returned__ = { props, href };
2896
+ const __returned__ = { props, locationUrl, href };
2228
2897
  Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
2229
2898
  return __returned__;
2230
2899
  }
2231
2900
  });
2232
- function _sfc_ssrRender$t(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2901
+ function _sfc_ssrRender$x(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2233
2902
  _push(`<a${ssrRenderAttrs(mergeProps({ href: $setup.href }, _attrs))}>`);
2234
2903
  ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
2235
2904
  _push(`</a>`);
2236
2905
  }
2237
- const _sfc_setup$t = _sfc_main$t.setup;
2238
- _sfc_main$t.setup = (props, ctx) => {
2906
+ const _sfc_setup$x = _sfc_main$x.setup;
2907
+ _sfc_main$x.setup = (props, ctx) => {
2239
2908
  const ssrContext = useSSRContext();
2240
2909
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/AccountLink.vue");
2241
- return _sfc_setup$t ? _sfc_setup$t(props, ctx) : void 0;
2910
+ return _sfc_setup$x ? _sfc_setup$x(props, ctx) : void 0;
2242
2911
  };
2243
- const AccountLink = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["ssrRender", _sfc_ssrRender$t]]);
2912
+ const AccountLink = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["ssrRender", _sfc_ssrRender$x]]);
2244
2913
 
2245
- const _sfc_main$s = /* @__PURE__ */ defineComponent({
2914
+ const _sfc_main$w = /* @__PURE__ */ defineComponent({
2246
2915
  __name: "SocialNetworkIcon",
2247
2916
  props: {
2248
2917
  as: { default: "i" },
@@ -2278,18 +2947,18 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
2278
2947
  return __returned__;
2279
2948
  }
2280
2949
  });
2281
- function _sfc_ssrRender$s(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2950
+ function _sfc_ssrRender$w(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2282
2951
  ssrRenderVNode(_push, createVNode(resolveDynamicComponent($props.as), mergeProps({ class: $setup.iconClassName }, _attrs), null), _parent);
2283
2952
  }
2284
- const _sfc_setup$s = _sfc_main$s.setup;
2285
- _sfc_main$s.setup = (props, ctx) => {
2953
+ const _sfc_setup$w = _sfc_main$w.setup;
2954
+ _sfc_main$w.setup = (props, ctx) => {
2286
2955
  const ssrContext = useSSRContext();
2287
2956
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/SocialNetworkIcon.vue");
2288
- return _sfc_setup$s ? _sfc_setup$s(props, ctx) : void 0;
2957
+ return _sfc_setup$w ? _sfc_setup$w(props, ctx) : void 0;
2289
2958
  };
2290
- const SocialNetworkIcon = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["ssrRender", _sfc_ssrRender$s]]);
2959
+ const SocialNetworkIcon = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["ssrRender", _sfc_ssrRender$w]]);
2291
2960
 
2292
- const _sfc_main$r = /* @__PURE__ */ defineComponent({
2961
+ const _sfc_main$v = /* @__PURE__ */ defineComponent({
2293
2962
  __name: "SocialNetworkLink",
2294
2963
  props: {
2295
2964
  network: {},
@@ -2315,7 +2984,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
2315
2984
  return __returned__;
2316
2985
  }
2317
2986
  });
2318
- function _sfc_ssrRender$r(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2987
+ function _sfc_ssrRender$v(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2319
2988
  const _component_ALink = resolveComponent("ALink");
2320
2989
  _push(ssrRenderComponent(_component_ALink, mergeProps({ href: $setup.fixedHref }, _attrs), {
2321
2990
  default: withCtx((_, _push2, _parent2, _scopeId) => {
@@ -2326,9 +2995,9 @@ function _sfc_ssrRender$r(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2326
2995
  }, _push2, _parent2, _scopeId);
2327
2996
  } else {
2328
2997
  return [
2329
- renderSlot$1(_ctx.$slots, "default", {}, () => [
2998
+ renderSlot(_ctx.$slots, "default", {}, () => [
2330
2999
  createVNode($setup["SocialNetworkIcon"], { network: $props.network }, null, 8, ["network"]),
2331
- renderSlot$1(_ctx.$slots, "append")
3000
+ renderSlot(_ctx.$slots, "append")
2332
3001
  ])
2333
3002
  ];
2334
3003
  }
@@ -2336,15 +3005,15 @@ function _sfc_ssrRender$r(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2336
3005
  _: 3
2337
3006
  }, _parent));
2338
3007
  }
2339
- const _sfc_setup$r = _sfc_main$r.setup;
2340
- _sfc_main$r.setup = (props, ctx) => {
3008
+ const _sfc_setup$v = _sfc_main$v.setup;
3009
+ _sfc_main$v.setup = (props, ctx) => {
2341
3010
  const ssrContext = useSSRContext();
2342
3011
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/SocialNetworkLink.vue");
2343
- return _sfc_setup$r ? _sfc_setup$r(props, ctx) : void 0;
3012
+ return _sfc_setup$v ? _sfc_setup$v(props, ctx) : void 0;
2344
3013
  };
2345
- const SocialNetworkLink = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["ssrRender", _sfc_ssrRender$r]]);
3014
+ const SocialNetworkLink = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["ssrRender", _sfc_ssrRender$v]]);
2346
3015
 
2347
- const _sfc_main$q = /* @__PURE__ */ defineComponent({
3016
+ const _sfc_main$u = /* @__PURE__ */ defineComponent({
2348
3017
  __name: "ShopSidenavCategory",
2349
3018
  props: {
2350
3019
  categoryTree: {}
@@ -2367,7 +3036,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
2367
3036
  return __returned__;
2368
3037
  }
2369
3038
  });
2370
- function _sfc_ssrRender$q(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3039
+ function _sfc_ssrRender$u(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2371
3040
  const _component_AImg = resolveComponent("AImg");
2372
3041
  const _component_ShopSidenavCategory = resolveComponent("ShopSidenavCategory", true);
2373
3042
  _push(`<li${ssrRenderAttrs(mergeProps({ class: "text-base-800 text-lg" }, _attrs))}>`);
@@ -2405,15 +3074,15 @@ function _sfc_ssrRender$q(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2405
3074
  }
2406
3075
  _push(`</li>`);
2407
3076
  }
2408
- const _sfc_setup$q = _sfc_main$q.setup;
2409
- _sfc_main$q.setup = (props, ctx) => {
3077
+ const _sfc_setup$u = _sfc_main$u.setup;
3078
+ _sfc_main$u.setup = (props, ctx) => {
2410
3079
  const ssrContext = useSSRContext();
2411
3080
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopSidenavCategory.vue");
2412
- return _sfc_setup$q ? _sfc_setup$q(props, ctx) : void 0;
3081
+ return _sfc_setup$u ? _sfc_setup$u(props, ctx) : void 0;
2413
3082
  };
2414
- const ShopSidenavCategory = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["ssrRender", _sfc_ssrRender$q]]);
3083
+ const ShopSidenavCategory = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["ssrRender", _sfc_ssrRender$u]]);
2415
3084
 
2416
- const _sfc_main$p = /* @__PURE__ */ defineComponent({
3085
+ const _sfc_main$t = /* @__PURE__ */ defineComponent({
2417
3086
  __name: "ShopSidenav",
2418
3087
  props: {
2419
3088
  categoryTrees: {}
@@ -2434,7 +3103,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
2434
3103
  return __returned__;
2435
3104
  }
2436
3105
  });
2437
- function _sfc_ssrRender$p(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3106
+ function _sfc_ssrRender$t(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2438
3107
  _push(`<aside${ssrRenderAttrs(mergeProps({ class: "flex h-full flex-col bg-white" }, _attrs))}><nav class="grow py-4"><ul class="relative h-full"><!--[-->`);
2439
3108
  ssrRenderList($props.categoryTrees, (categoryTree, i) => {
2440
3109
  _push(ssrRenderComponent($setup["ShopSidenavCategory"], {
@@ -2475,13 +3144,13 @@ function _sfc_ssrRender$p(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2475
3144
  });
2476
3145
  _push(`<!--]--></ul></footer></aside>`);
2477
3146
  }
2478
- const _sfc_setup$p = _sfc_main$p.setup;
2479
- _sfc_main$p.setup = (props, ctx) => {
3147
+ const _sfc_setup$t = _sfc_main$t.setup;
3148
+ _sfc_main$t.setup = (props, ctx) => {
2480
3149
  const ssrContext = useSSRContext();
2481
3150
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopSidenav.vue");
2482
- return _sfc_setup$p ? _sfc_setup$p(props, ctx) : void 0;
3151
+ return _sfc_setup$t ? _sfc_setup$t(props, ctx) : void 0;
2483
3152
  };
2484
- const ShopSidenav = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["ssrRender", _sfc_ssrRender$p]]);
3153
+ const ShopSidenav = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["ssrRender", _sfc_ssrRender$t]]);
2485
3154
 
2486
3155
  const useShopHeaderSubmenu = (props) => {
2487
3156
  const categoryPicture = computed(() => {
@@ -2530,7 +3199,7 @@ const useShopHeaderSubmenu = (props) => {
2530
3199
  };
2531
3200
  };
2532
3201
 
2533
- const _sfc_main$o = /* @__PURE__ */ defineComponent({
3202
+ const _sfc_main$s = /* @__PURE__ */ defineComponent({
2534
3203
  __name: "ShopHeaderSubmenu",
2535
3204
  props: {
2536
3205
  categoryTree: {},
@@ -2559,7 +3228,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
2559
3228
  return __returned__;
2560
3229
  }
2561
3230
  });
2562
- function _sfc_ssrRender$o(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3231
+ function _sfc_ssrRender$s(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2563
3232
  const _component_Fade = resolveComponent("Fade");
2564
3233
  const _component_AImg = resolveComponent("AImg");
2565
3234
  _push(ssrRenderComponent($setup["Popover"], _attrs, {
@@ -2572,7 +3241,7 @@ function _sfc_ssrRender$o(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2572
3241
  ssrRenderSlot(_ctx.$slots, "button", { open }, null, _push3, _parent3, _scopeId2);
2573
3242
  } else {
2574
3243
  return [
2575
- renderSlot$1(_ctx.$slots, "button", { open })
3244
+ renderSlot(_ctx.$slots, "button", { open })
2576
3245
  ];
2577
3246
  }
2578
3247
  }),
@@ -2779,7 +3448,7 @@ function _sfc_ssrRender$o(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2779
3448
  }, [
2780
3449
  createVNode($setup["PopoverButton"], { class: "outline-none" }, {
2781
3450
  default: withCtx(() => [
2782
- renderSlot$1(_ctx.$slots, "button", { open })
3451
+ renderSlot(_ctx.$slots, "button", { open })
2783
3452
  ]),
2784
3453
  _: 2
2785
3454
  }, 1024)
@@ -2873,15 +3542,15 @@ function _sfc_ssrRender$o(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2873
3542
  _: 3
2874
3543
  }, _parent));
2875
3544
  }
2876
- const _sfc_setup$o = _sfc_main$o.setup;
2877
- _sfc_main$o.setup = (props, ctx) => {
3545
+ const _sfc_setup$s = _sfc_main$s.setup;
3546
+ _sfc_main$s.setup = (props, ctx) => {
2878
3547
  const ssrContext = useSSRContext();
2879
3548
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopHeaderSubmenu.vue");
2880
- return _sfc_setup$o ? _sfc_setup$o(props, ctx) : void 0;
3549
+ return _sfc_setup$s ? _sfc_setup$s(props, ctx) : void 0;
2881
3550
  };
2882
- const ShopHeaderSubmenu = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["ssrRender", _sfc_ssrRender$o]]);
3551
+ const ShopHeaderSubmenu = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["ssrRender", _sfc_ssrRender$s]]);
2883
3552
 
2884
- const _sfc_main$n = /* @__PURE__ */ defineComponent({
3553
+ const _sfc_main$r = /* @__PURE__ */ defineComponent({
2885
3554
  __name: "ShopHeaderMenu",
2886
3555
  props: {
2887
3556
  inlineMenuTrees: {}
@@ -2897,7 +3566,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
2897
3566
  return __returned__;
2898
3567
  }
2899
3568
  });
2900
- function _sfc_ssrRender$n(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3569
+ function _sfc_ssrRender$r(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2901
3570
  _push(`<nav${ssrRenderAttrs(_attrs)}><ul class="${ssrRenderClass([$props.inlineMenuTrees.length < 7 ? "text-base" : "text-sm", "text-base-700 flex gap-4 xl:gap-5"])}"><!--[-->`);
2902
3571
  ssrRenderList($props.inlineMenuTrees, (categoryTree, i) => {
2903
3572
  _push(`<li>`);
@@ -2941,15 +3610,15 @@ function _sfc_ssrRender$n(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
2941
3610
  });
2942
3611
  _push(`<!--]--></ul></nav>`);
2943
3612
  }
2944
- const _sfc_setup$n = _sfc_main$n.setup;
2945
- _sfc_main$n.setup = (props, ctx) => {
3613
+ const _sfc_setup$r = _sfc_main$r.setup;
3614
+ _sfc_main$r.setup = (props, ctx) => {
2946
3615
  const ssrContext = useSSRContext();
2947
3616
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopHeaderMenu.vue");
2948
- return _sfc_setup$n ? _sfc_setup$n(props, ctx) : void 0;
3617
+ return _sfc_setup$r ? _sfc_setup$r(props, ctx) : void 0;
2949
3618
  };
2950
- const ShopHeaderMenu = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["ssrRender", _sfc_ssrRender$n]]);
3619
+ const ShopHeaderMenu = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["ssrRender", _sfc_ssrRender$r]]);
2951
3620
 
2952
- const _sfc_main$m = /* @__PURE__ */ defineComponent({
3621
+ const _sfc_main$q = /* @__PURE__ */ defineComponent({
2953
3622
  __name: "AccountMenu",
2954
3623
  setup(__props, { expose: __expose }) {
2955
3624
  __expose();
@@ -2976,7 +3645,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
2976
3645
  return __returned__;
2977
3646
  }
2978
3647
  });
2979
- function _sfc_ssrRender$m(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3648
+ function _sfc_ssrRender$q(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
2980
3649
  const _component_Fade = resolveComponent("Fade");
2981
3650
  const _component_ALink = resolveComponent("ALink");
2982
3651
  _push(ssrRenderComponent($setup["Menu"], mergeProps({
@@ -3006,7 +3675,7 @@ function _sfc_ssrRender$m(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
3006
3675
  ssrRenderSlot(_ctx.$slots, "button", { open }, null, _push4, _parent4, _scopeId3);
3007
3676
  } else {
3008
3677
  return [
3009
- renderSlot$1(_ctx.$slots, "button", { open })
3678
+ renderSlot(_ctx.$slots, "button", { open })
3010
3679
  ];
3011
3680
  }
3012
3681
  }),
@@ -3019,7 +3688,7 @@ function _sfc_ssrRender$m(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
3019
3688
  "aria-label": "Minha conta"
3020
3689
  }, {
3021
3690
  default: withCtx(() => [
3022
- renderSlot$1(_ctx.$slots, "button", { open })
3691
+ renderSlot(_ctx.$slots, "button", { open })
3023
3692
  ]),
3024
3693
  _: 2
3025
3694
  }, 1024)
@@ -3475,7 +4144,7 @@ function _sfc_ssrRender$m(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
3475
4144
  "aria-label": "Minha conta"
3476
4145
  }, {
3477
4146
  default: withCtx(() => [
3478
- renderSlot$1(_ctx.$slots, "button", { open })
4147
+ renderSlot(_ctx.$slots, "button", { open })
3479
4148
  ]),
3480
4149
  _: 2
3481
4150
  }, 1024)
@@ -3600,15 +4269,15 @@ function _sfc_ssrRender$m(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
3600
4269
  _: 3
3601
4270
  }, _parent));
3602
4271
  }
3603
- const _sfc_setup$m = _sfc_main$m.setup;
3604
- _sfc_main$m.setup = (props, ctx) => {
4272
+ const _sfc_setup$q = _sfc_main$q.setup;
4273
+ _sfc_main$q.setup = (props, ctx) => {
3605
4274
  const ssrContext = useSSRContext();
3606
4275
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/AccountMenu.vue");
3607
- return _sfc_setup$m ? _sfc_setup$m(props, ctx) : void 0;
4276
+ return _sfc_setup$q ? _sfc_setup$q(props, ctx) : void 0;
3608
4277
  };
3609
- const AccountMenu = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["ssrRender", _sfc_ssrRender$m]]);
4278
+ const AccountMenu = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["ssrRender", _sfc_ssrRender$q]]);
3610
4279
 
3611
- const _sfc_main$l = /* @__PURE__ */ defineComponent({
4280
+ const _sfc_main$p = /* @__PURE__ */ defineComponent({
3612
4281
  __name: "ShopHeader",
3613
4282
  props: {
3614
4283
  searchInput: {},
@@ -3619,8 +4288,8 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
3619
4288
  },
3620
4289
  setup(__props, { expose: __expose }) {
3621
4290
  __expose();
3622
- const SearchModal = defineAsyncComponent(() => import('../SearchModal_2uYZ9tHy.mjs'));
3623
- const CartSidebar = defineAsyncComponent(() => import('../CartSidebar_gCUGFy65.mjs'));
4291
+ const SearchModal = defineAsyncComponent(() => import('../SearchModal_7debttOi.mjs'));
4292
+ const CartSidebar = defineAsyncComponent(() => import('../CartSidebar_8VAKl-jR.mjs'));
3624
4293
  const props = __props;
3625
4294
  const header = ref(null);
3626
4295
  const searchInput = ref(null);
@@ -3645,12 +4314,14 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
3645
4314
  isMounted.value = true;
3646
4315
  handleOnMounted();
3647
4316
  });
3648
- const __returned__ = { SearchModal, CartSidebar, props, header, searchInput, isSticky, positionY, categoryTrees, inlineMenuTrees, isSearchOpen, isSearchOpenOnce, searchTerm, quickSearchTerm, toggleSearch, isCartOpen, isCartOpenOnce, cartTotalItems, handleOnMounted, isSidenavOpen, isMounted, Drawer, ShopSidenav, ShopHeaderMenu, AccountMenu };
4317
+ const __returned__ = { SearchModal, CartSidebar, props, header, searchInput, isSticky, positionY, categoryTrees, inlineMenuTrees, isSearchOpen, isSearchOpenOnce, searchTerm, quickSearchTerm, toggleSearch, isCartOpen, isCartOpenOnce, cartTotalItems, handleOnMounted, isSidenavOpen, isMounted, get isMobile() {
4318
+ return isMobile;
4319
+ }, Drawer, ShopSidenav, ShopHeaderMenu, AccountMenu };
3649
4320
  Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
3650
4321
  return __returned__;
3651
4322
  }
3652
4323
  });
3653
- function _sfc_ssrRender$l(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
4324
+ function _sfc_ssrRender$p(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3654
4325
  const _component_Fade = resolveComponent("Fade");
3655
4326
  const _component_Skeleton = resolveComponent("Skeleton");
3656
4327
  _push(`<header${ssrRenderAttrs(mergeProps({
@@ -3664,7 +4335,11 @@ function _sfc_ssrRender$l(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
3664
4335
  $setup.isMounted ? "text-base-500" : "text-base-400 animate-pulse"
3665
4336
  ], "text-3xl transition-colors"])}"></i></button></div>`);
3666
4337
  ssrRenderSlot(_ctx.$slots, "logo", {}, null, _push, _parent);
3667
- _push(ssrRenderComponent($setup["ShopHeaderMenu"], mergeProps({ class: "hidden lg:block" }, { inlineMenuTrees: $setup.inlineMenuTrees }), null, _parent));
4338
+ if (!$setup.isMobile) {
4339
+ _push(ssrRenderComponent($setup["ShopHeaderMenu"], mergeProps({ inlineMenuTrees: $setup.inlineMenuTrees }, { class: "hidden lg:block" }), null, _parent));
4340
+ } else {
4341
+ _push(`<!---->`);
4342
+ }
3668
4343
  _push(`<div class="text-base-800 flex basis-1/4 items-center justify-end gap-3 px-2 lg:gap-4"><form action="/s" method="get" class="relative"><label for="HeaderSearch" class="sr-only">${ssrInterpolate("Buscar produtos")}</label>`);
3669
4344
  _push(ssrRenderComponent(_component_Fade, null, {
3670
4345
  default: withCtx((_, _push2, _parent2, _scopeId) => {
@@ -3699,20 +4374,24 @@ function _sfc_ssrRender$l(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
3699
4374
  _: 1
3700
4375
  }, _parent));
3701
4376
  _push(`<button type="submit"${ssrRenderAttr("aria-label", "Buscar produtos")}><i class="${ssrRenderClass([$setup.isSearchOpen && "text-primary-600 -translate-x-2", "i-magnifying-glass hover:text-primary h-7 w-7 hover:scale-110 active:scale-125"])}"></i></button></form>`);
3702
- _push(ssrRenderComponent($setup["AccountMenu"], { class: "hidden sm:block" }, {
3703
- button: withCtx(({ open }, _push2, _parent2, _scopeId) => {
3704
- if (_push2) {
3705
- _push2(`<i class="${ssrRenderClass([open ? "text-black scale-110" : null, "i-user-circle hover:text-primary h-7 w-7 hover:scale-110 active:scale-125"])}"${_scopeId}></i>`);
3706
- } else {
3707
- return [
3708
- createVNode("i", {
3709
- class: ["i-user-circle hover:text-primary h-7 w-7 hover:scale-110 active:scale-125", open ? "text-black scale-110" : null]
3710
- }, null, 2)
3711
- ];
3712
- }
3713
- }),
3714
- _: 1
3715
- }, _parent));
4377
+ if (!$setup.isMobile) {
4378
+ _push(ssrRenderComponent($setup["AccountMenu"], { class: "hidden sm:block" }, {
4379
+ button: withCtx(({ open }, _push2, _parent2, _scopeId) => {
4380
+ if (_push2) {
4381
+ _push2(`<i class="${ssrRenderClass([open ? "text-black scale-110" : null, "i-user-circle hover:text-primary h-7 w-7 hover:scale-110 active:scale-125"])}"${_scopeId}></i>`);
4382
+ } else {
4383
+ return [
4384
+ createVNode("i", {
4385
+ class: ["i-user-circle hover:text-primary h-7 w-7 hover:scale-110 active:scale-125", open ? "text-black scale-110" : null]
4386
+ }, null, 2)
4387
+ ];
4388
+ }
4389
+ }),
4390
+ _: 1
4391
+ }, _parent));
4392
+ } else {
4393
+ _push(`<!---->`);
4394
+ }
3716
4395
  _push(`<a${ssrRenderAttr("href", _ctx.$settings.cartUrl || "/app/")}${ssrRenderAttr("aria-label", "Abrir carrinho")} class="group relative" role="button"><i class="i-shopping-bag group-hover:text-primary h-7 w-7 group-hover:scale-110 group-active:scale-125"></i>`);
3717
4396
  if ($setup.cartTotalItems) {
3718
4397
  _push(`<span class="ui-badge-pill-sm absolute -right-1.5 -top-1">${ssrInterpolate($setup.cartTotalItems)}</span>`);
@@ -3861,18 +4540,18 @@ function _sfc_ssrRender$l(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
3861
4540
  }
3862
4541
  _push(`</header>`);
3863
4542
  }
3864
- const _sfc_setup$l = _sfc_main$l.setup;
3865
- _sfc_main$l.setup = (props, ctx) => {
4543
+ const _sfc_setup$p = _sfc_main$p.setup;
4544
+ _sfc_main$p.setup = (props, ctx) => {
3866
4545
  const ssrContext = useSSRContext();
3867
4546
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopHeader.vue");
3868
- return _sfc_setup$l ? _sfc_setup$l(props, ctx) : void 0;
4547
+ return _sfc_setup$p ? _sfc_setup$p(props, ctx) : void 0;
3869
4548
  };
3870
- const ShopHeader = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["ssrRender", _sfc_ssrRender$l]]);
4549
+ const ShopHeader = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["ssrRender", _sfc_ssrRender$p]]);
3871
4550
 
3872
- var __freeze$2 = Object.freeze;
3873
- var __defProp$2 = Object.defineProperty;
3874
- var __template$2 = (cooked, raw) => __freeze$2(__defProp$2(cooked, "raw", { value: __freeze$2(raw || cooked.slice()) }));
3875
- var _a$2;
4551
+ var __freeze$1 = Object.freeze;
4552
+ var __defProp$1 = Object.defineProperty;
4553
+ var __template$1 = (cooked, raw) => __freeze$1(__defProp$1(cooked, "raw", { value: __freeze$1(raw || cooked.slice()) }));
4554
+ var _a$1;
3876
4555
  const $$Astro$8 = createAstro("https://demo.ecomplus.app");
3877
4556
  const $$PageHeader = createComponent(async ($$result, $$props, $$slots) => {
3878
4557
  const Astro2 = $$result.createAstro($$Astro$8, $$props, $$slots);
@@ -3885,7 +4564,7 @@ const $$PageHeader = createComponent(async ($$result, $$props, $$slots) => {
3885
4564
  shopHeader
3886
4565
  } = await usePageHeader({ routeContext });
3887
4566
  const { getInlineClientJS } = await useSharedData({ field: "categories" });
3888
- return renderTemplate`${renderSlot($$result, $$slots["pitch-bar"], renderTemplate(_a$2 || (_a$2 = __template$2(["\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(getInlineClientJS()), renderComponent($$result, "ShopHeader", ShopHeader, { ...shopHeader, "client:context": true, "client:component-hydration": "context", "client:component-path": "~/components/ShopHeader.vue", "client:component-export": "default" }, { "logo": ($$result2) => renderTemplate`${renderComponent($$result2, "Fragment", Fragment, { "slot": "logo" }, { "default": ($$result3) => renderTemplate`
4567
+ return renderTemplate`${renderSlot$1($$result, $$slots["pitch-bar"], renderTemplate(_a$1 || (_a$1 = __template$1(["\n ", "\n ", "\n\n<script async>", "<\/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(getInlineClientJS()), renderComponent($$result, "ShopHeader", ShopHeader, { ...shopHeader, "client:context": "data:categories", "client:component-hydration": "context", "client:component-path": "~/components/ShopHeader.vue", "client:component-export": "default" }, { "logo": ($$result2) => renderTemplate`${renderComponent($$result2, "Fragment", Fragment, { "slot": "logo" }, { "default": ($$result3) => renderTemplate`
3889
4568
  ${maybeRenderHead()}<a href="/">
3890
4569
  ${renderComponent($$result3, "LogoHeading", LogoHeading, {}, { "default": ($$result4) => renderTemplate`
3891
4570
  ${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" })}
@@ -3894,7 +4573,7 @@ const $$PageHeader = createComponent(async ($$result, $$props, $$slots) => {
3894
4573
  ` })}` })))}`;
3895
4574
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/PageHeader.astro", void 0);
3896
4575
 
3897
- const _sfc_main$k = /* @__PURE__ */ defineComponent({
4576
+ const _sfc_main$o = /* @__PURE__ */ defineComponent({
3898
4577
  __name: "PaymentMethodFlag",
3899
4578
  props: {
3900
4579
  as: { default: "i" },
@@ -3930,22 +4609,22 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
3930
4609
  return __returned__;
3931
4610
  }
3932
4611
  });
3933
- function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
4612
+ function _sfc_ssrRender$o(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3934
4613
  if (!$setup.iconClassName) {
3935
4614
  _push(`<b${ssrRenderAttrs(mergeProps({ class: "mb-1 text-[57%] leading-none tracking-tighter text-black" }, _attrs))}>${ssrInterpolate($setup.props.flag)}</b>`);
3936
4615
  } else {
3937
4616
  ssrRenderVNode(_push, createVNode(resolveDynamicComponent($props.as), mergeProps({ class: $setup.iconClassName }, _attrs), null), _parent);
3938
4617
  }
3939
4618
  }
3940
- const _sfc_setup$k = _sfc_main$k.setup;
3941
- _sfc_main$k.setup = (props, ctx) => {
4619
+ const _sfc_setup$o = _sfc_main$o.setup;
4620
+ _sfc_main$o.setup = (props, ctx) => {
3942
4621
  const ssrContext = useSSRContext();
3943
4622
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/PaymentMethodFlag.vue");
3944
- return _sfc_setup$k ? _sfc_setup$k(props, ctx) : void 0;
4623
+ return _sfc_setup$o ? _sfc_setup$o(props, ctx) : void 0;
3945
4624
  };
3946
- const PaymentMethodFlag = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["ssrRender", _sfc_ssrRender$k]]);
4625
+ const PaymentMethodFlag = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["ssrRender", _sfc_ssrRender$o]]);
3947
4626
 
3948
- const _sfc_main$j = /* @__PURE__ */ defineComponent({
4627
+ const _sfc_main$n = /* @__PURE__ */ defineComponent({
3949
4628
  __name: "FooterStamps",
3950
4629
  props: {
3951
4630
  stamps: {}
@@ -3957,7 +4636,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
3957
4636
  return __returned__;
3958
4637
  }
3959
4638
  });
3960
- function _sfc_ssrRender$j(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
4639
+ function _sfc_ssrRender$n(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
3961
4640
  const _component_ALink = resolveComponent("ALink");
3962
4641
  _push(`<div${ssrRenderAttrs(mergeProps({ class: "ui-section" }, _attrs))}><div class="flex flex-wrap items-start justify-between gap-5 lg:flex-nowrap"><ul class="mx-auto flex items-center gap-x-6 gap-y-3 overflow-x-auto md:mx-0 md:flex-wrap md:overflow-hidden lg:gap-x-8"><!--[-->`);
3963
4642
  ssrRenderList($props.stamps, (stamp, i) => {
@@ -3995,7 +4674,7 @@ function _sfc_ssrRender$j(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
3995
4674
  }
3996
4675
  } else {
3997
4676
  return [
3998
- renderSlot$1(_ctx.$slots, `picture-${i}`),
4677
+ renderSlot(_ctx.$slots, `picture-${i}`),
3999
4678
  !stamp.img ? (openBlock(), createBlock("span", {
4000
4679
  key: 0,
4001
4680
  class: "flex items-center"
@@ -4056,15 +4735,15 @@ function _sfc_ssrRender$j(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
4056
4735
  }, _parent));
4057
4736
  _push(`</div></div>`);
4058
4737
  }
4059
- const _sfc_setup$j = _sfc_main$j.setup;
4060
- _sfc_main$j.setup = (props, ctx) => {
4738
+ const _sfc_setup$n = _sfc_main$n.setup;
4739
+ _sfc_main$n.setup = (props, ctx) => {
4061
4740
  const ssrContext = useSSRContext();
4062
4741
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/FooterStamps.vue");
4063
- return _sfc_setup$j ? _sfc_setup$j(props, ctx) : void 0;
4742
+ return _sfc_setup$n ? _sfc_setup$n(props, ctx) : void 0;
4064
4743
  };
4065
- const FooterStamps = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["ssrRender", _sfc_ssrRender$j]]);
4744
+ const FooterStamps = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["ssrRender", _sfc_ssrRender$n]]);
4066
4745
 
4067
- const _sfc_main$i = /* @__PURE__ */ defineComponent({
4746
+ const _sfc_main$m = /* @__PURE__ */ defineComponent({
4068
4747
  __name: "ShopFooter",
4069
4748
  props: {
4070
4749
  stamps: {},
@@ -4082,7 +4761,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
4082
4761
  return __returned__;
4083
4762
  }
4084
4763
  });
4085
- function _sfc_ssrRender$i(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
4764
+ function _sfc_ssrRender$m(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
4086
4765
  const _component_ALink = resolveComponent("ALink");
4087
4766
  _push(`<footer${ssrRenderAttrs(mergeProps({ class: "bg-base-50 border-base-100 mt-auto w-screen border-t py-2" }, _attrs))}><div class="ui-section"><div class="border-base-200 flex flex-wrap justify-between gap-y-5 border-b pb-7 sm:gap-x-10 lg:flex-nowrap"><div class="shrink">`);
4088
4767
  ssrRenderSlot(_ctx.$slots, "logo", {}, null, _push, _parent);
@@ -4143,7 +4822,7 @@ function _sfc_ssrRender$i(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
4143
4822
  }
4144
4823
  _push(`</div>`);
4145
4824
  if ($props.categories?.length) {
4146
- _push(`<div class="basis-1/2 sm:basis-auto"><div class="mb-2.5 text-lg font-medium">${ssrInterpolate($props.categoriesColTitle || "Categorias")}</div><ul class="${ssrRenderClass([$props.categories.length > 4 ? "grid md:grid-cols-2 gap-x-5 gap-y-1.5" : "space-y-1.5", "text-sm"])}"><!--[-->`);
4825
+ _push(`<div class="basis-1/2 pr-2 sm:basis-auto sm:pr-0"><div class="mb-2.5 text-lg font-medium">${ssrInterpolate($props.categoriesColTitle || "Categorias")}</div><ul class="${ssrRenderClass([$props.categories.length > 4 ? "grid md:grid-cols-2 gap-x-5 gap-y-1.5" : "space-y-1.5", "text-sm"])}"><!--[-->`);
4147
4826
  ssrRenderList($props.categories, ({ name, slug }, i) => {
4148
4827
  _push(`<li><a${ssrRenderAttr("href", `/${slug}`)} class="ui-link text-base-600">${ssrInterpolate(name)}</a></li>`);
4149
4828
  });
@@ -4152,12 +4831,12 @@ function _sfc_ssrRender$i(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
4152
4831
  _push(`<!---->`);
4153
4832
  }
4154
4833
  if ($props.pageLinks?.length) {
4155
- _push(`<div class="basis-1/2 sm:basis-auto"><div class="mb-2.5 text-lg font-medium">${ssrInterpolate($props.pagesColTitle || "Institucional")}</div><ul class="${ssrRenderClass([$props.pageLinks.length > 5 ? "grid md:grid-cols-2 gap-x-5 gap-y-1.5" : "space-y-1.5", "text-sm"])}"><!--[-->`);
4834
+ _push(`<div class="basis-1/2 pl-2 sm:basis-auto sm:pl-0"><div class="mb-2.5 text-lg font-medium">${ssrInterpolate($props.pagesColTitle || "Institucional")}</div><ul class="${ssrRenderClass([$props.pageLinks.length > 5 ? "grid md:grid-cols-2 gap-x-5 gap-y-1.5" : "space-y-1.5", "text-sm"])}"><!--[-->`);
4156
4835
  ssrRenderList($props.pageLinks, ({ title, href }, i) => {
4157
4836
  _push(`<li>`);
4158
4837
  _push(ssrRenderComponent(_component_ALink, {
4159
4838
  href,
4160
- class: "ui-link text-base-600"
4839
+ class: ["ui-link", title === "Blog" ? "text-base-900" : "text-base-600"]
4161
4840
  }, {
4162
4841
  default: withCtx((_, _push2, _parent2, _scopeId) => {
4163
4842
  if (_push2) {
@@ -4180,13 +4859,13 @@ function _sfc_ssrRender$i(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
4180
4859
  _push(ssrRenderComponent($setup["FooterStamps"], { stamps: $props.stamps }, null, _parent));
4181
4860
  _push(`</footer>`);
4182
4861
  }
4183
- const _sfc_setup$i = _sfc_main$i.setup;
4184
- _sfc_main$i.setup = (props, ctx) => {
4862
+ const _sfc_setup$m = _sfc_main$m.setup;
4863
+ _sfc_main$m.setup = (props, ctx) => {
4185
4864
  const ssrContext = useSSRContext();
4186
4865
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ShopFooter.vue");
4187
- return _sfc_setup$i ? _sfc_setup$i(props, ctx) : void 0;
4866
+ return _sfc_setup$m ? _sfc_setup$m(props, ctx) : void 0;
4188
4867
  };
4189
- const ShopFooter = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["ssrRender", _sfc_ssrRender$i]]);
4868
+ const ShopFooter = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["ssrRender", _sfc_ssrRender$m]]);
4190
4869
 
4191
4870
  const $$Astro$7 = createAstro("https://demo.ecomplus.app");
4192
4871
  const $$PageFooter = createComponent(async ($$result, $$props, $$slots) => {
@@ -4222,11 +4901,14 @@ const $$PageFooter = createComponent(async ($$result, $$props, $$slots) => {
4222
4901
  pageLinks = [];
4223
4902
  const pageSlugs = await getContent("extra-pages/");
4224
4903
  for (let i = 0; i < pageSlugs.length; i++) {
4225
- const { title } = await getContent(`extra-pages/${pageSlugs[i]}`);
4904
+ const { title } = await getContent(`extra-pages/${pageSlugs[i]}`) || {};
4226
4905
  if (title) {
4227
4906
  pageLinks.push({ title, href: `/p/${pageSlugs[i]}` });
4228
4907
  }
4229
4908
  }
4909
+ if ((await getContent("blog/")).length) {
4910
+ pageLinks.push({ title: "Blog", href: "/blog/1/" });
4911
+ }
4230
4912
  }
4231
4913
  }
4232
4914
  return renderTemplate`${renderComponent($$result, "ShopFooter", ShopFooter, { "stamps": stamps, "categories": mainCategories, "categoriesColTitle": categoriesList?.title, "pageLinks": pageLinks, "pagesColTitle": pagesList?.title }, { "logo": ($$result2) => renderTemplate`${renderComponent($$result2, "Fragment", Fragment, { "slot": "logo" }, { "default": ($$result3) => renderTemplate`
@@ -4238,44 +4920,226 @@ const $$PageFooter = createComponent(async ($$result, $$props, $$slots) => {
4238
4920
  ` })}` })}`;
4239
4921
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/layouts/PageFooter.astro", void 0);
4240
4922
 
4241
- const i19aboveOf = "Acima de";
4242
- const i19brands = "Marcas";
4243
- const i19categories = "Categorias";
4244
- const i19discount = "Desconto";
4245
- const i19highestPrice = "Maior preço";
4246
- const i19lowestPrice = "Menor preço";
4247
- const i19name = "Nome";
4248
- const i19relatedProducts = "Produtos relacionados";
4249
- const i19releases = "Lançamentos";
4250
- const i19relevance = "Relevância";
4251
- const i19sales = "Vendas";
4252
- const i19upTo = "Até";
4253
-
4254
- const useProductShelf = (props) => {
4255
- const title = ref(props.title || "");
4256
- const titleLink = ref(props.titleLink || "");
4257
- const isFetching = ref(false);
4258
- let fetching = null;
4259
- const fetchError = ref(null);
4260
- const products = shallowReactive(props.products || []);
4261
- if (!props.products) {
4262
- isFetching.value = true;
4263
- fetching = (async () => {
4264
- const limit = props.limit || 24;
4265
- const offset = props.page ? (props.page - 1) * limit : 0;
4266
- let endpointQuery = `offset=${offset}&limit=${limit}`;
4267
- if (props.sort) {
4268
- endpointQuery += `&sort=${props.sort}`;
4269
- }
4270
- if (props.isRelatedProducts) {
4271
- const { apiContext } = globalThis.$storefront;
4272
- if (apiContext?.resource === "products") {
4273
- endpointQuery = `like=${apiContext.doc._id}`;
4274
- title.value = i19relatedProducts;
4275
- }
4276
- } else {
4277
- let searchQuery = props.searchQuery || "";
4278
- let collection;
4923
+ const usePagination = (props) => {
4924
+ const totalPages = computed(() => {
4925
+ if (props.totalPages)
4926
+ return props.totalPages;
4927
+ if (props.totalItems && props.pageSize) {
4928
+ return Math.ceil(props.totalItems / props.pageSize);
4929
+ }
4930
+ return 1;
4931
+ });
4932
+ const pageNumber = computed(() => {
4933
+ const currentPage = props.page || 1;
4934
+ if (currentPage < 1)
4935
+ return 1;
4936
+ if (currentPage > totalPages.value)
4937
+ return totalPages.value;
4938
+ return currentPage;
4939
+ });
4940
+ const maxPages = computed(() => props.maxPages || 10);
4941
+ const startPage = computed(() => {
4942
+ if (totalPages.value <= maxPages.value)
4943
+ return 1;
4944
+ const maxPagesBeforeCurrent = Math.floor(maxPages.value / 2);
4945
+ const maxPagesAfterCurrent = Math.ceil(maxPages.value / 2) - 1;
4946
+ if (pageNumber.value <= maxPagesBeforeCurrent)
4947
+ return 1;
4948
+ if (pageNumber.value + maxPagesAfterCurrent >= totalPages.value) {
4949
+ return totalPages.value - maxPages.value + 1;
4950
+ }
4951
+ return pageNumber.value - maxPagesBeforeCurrent;
4952
+ });
4953
+ const endPage = computed(() => {
4954
+ if (totalPages.value <= maxPages.value)
4955
+ return totalPages.value;
4956
+ const maxPagesBeforeCurrent = Math.floor(maxPages.value / 2);
4957
+ const maxPagesAfterCurrent = Math.ceil(maxPages.value / 2) - 1;
4958
+ if (pageNumber.value <= maxPagesBeforeCurrent)
4959
+ return maxPages.value;
4960
+ if (pageNumber.value + maxPagesAfterCurrent >= totalPages.value) {
4961
+ return totalPages.value;
4962
+ }
4963
+ return pageNumber.value + maxPagesAfterCurrent;
4964
+ });
4965
+ const pages = computed(() => {
4966
+ return Array.from(Array(endPage.value + 1 - startPage.value).keys()).map((i) => startPage.value + i);
4967
+ });
4968
+ const baseUrl = ref("");
4969
+ watch(toRef(props.isUrlPath), () => {
4970
+ const url = global.astroUrl ;
4971
+ if (props.isUrlPath && !url.pathname.endsWith("/")) {
4972
+ url.pathname += "/";
4973
+ } else {
4974
+ url.searchParams.delete("p");
4975
+ }
4976
+ baseUrl.value = `${url.pathname}${url.search}`;
4977
+ }, {
4978
+ immediate: true
4979
+ });
4980
+ const getPageLink = (pageN) => {
4981
+ if (props.isUrlPath)
4982
+ return `../${pageN}`;
4983
+ return `?p=${pageN}`;
4984
+ };
4985
+ const pageLinks = computed(() => {
4986
+ return pages.value.map((pageN) => baseUrl.value + getPageLink(pageN));
4987
+ });
4988
+ const prevPageLink = computed(() => {
4989
+ if (pageNumber.value <= 1)
4990
+ return null;
4991
+ return baseUrl.value + getPageLink(pageNumber.value - 1);
4992
+ });
4993
+ const nextPageLink = computed(() => {
4994
+ if (pageNumber.value >= totalPages.value)
4995
+ return null;
4996
+ return baseUrl.value + getPageLink(pageNumber.value + 1);
4997
+ });
4998
+ return {
4999
+ totalPages,
5000
+ startPage,
5001
+ endPage,
5002
+ pages,
5003
+ pageLinks,
5004
+ prevPageLink,
5005
+ nextPageLink
5006
+ };
5007
+ };
5008
+
5009
+ const _sfc_main$l = /* @__PURE__ */ defineComponent({
5010
+ __name: "Pagination",
5011
+ props: {
5012
+ totalItems: {},
5013
+ totalPages: {},
5014
+ page: { default: 1 },
5015
+ pageSize: {},
5016
+ maxPages: { default: 7 },
5017
+ isUrlPath: { type: Boolean, default: false }
5018
+ },
5019
+ emits: ["update:page"],
5020
+ setup(__props, { expose: __expose, emit: __emit }) {
5021
+ __expose();
5022
+ const props = __props;
5023
+ const emit = __emit;
5024
+ const {
5025
+ pages,
5026
+ pageLinks,
5027
+ prevPageLink,
5028
+ nextPageLink
5029
+ } = usePagination(props);
5030
+ const __returned__ = { props, emit, pages, pageLinks, prevPageLink, nextPageLink };
5031
+ Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
5032
+ return __returned__;
5033
+ }
5034
+ });
5035
+ function _sfc_ssrRender$l(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
5036
+ const _component_ALink = resolveComponent("ALink");
5037
+ _push(`<ol${ssrRenderAttrs(mergeProps({ class: "text-base-900 flex justify-center gap-1.5 text-center text-sm font-medium leading-9" }, _attrs))}><li>`);
5038
+ _push(ssrRenderComponent(_component_ALink, {
5039
+ href: $setup.prevPageLink,
5040
+ onClick: ($event) => $setup.prevPageLink && $setup.emit("update:page", $props.page - 1),
5041
+ class: ["mr-1 block min-w-9 rounded border px-3", $setup.prevPageLink ? "border-base-100 hover:bg-base-100" : "border-transparent text-base-500"]
5042
+ }, {
5043
+ default: withCtx((_, _push2, _parent2, _scopeId) => {
5044
+ if (_push2) {
5045
+ _push2(`<i class="i-arrow-right rotate-180"${_scopeId}></i><span class="ml-1.5 hidden md:inline"${_scopeId}>${ssrInterpolate("Anterior")}</span>`);
5046
+ } else {
5047
+ return [
5048
+ createVNode("i", { class: "i-arrow-right rotate-180" }),
5049
+ createVNode("span", { class: "ml-1.5 hidden md:inline" }, toDisplayString("Anterior"))
5050
+ ];
5051
+ }
5052
+ }),
5053
+ _: 1
5054
+ }, _parent));
5055
+ _push(`</li><!--[-->`);
5056
+ ssrRenderList($setup.pages, (pageN, i) => {
5057
+ _push(`<li>`);
5058
+ _push(ssrRenderComponent(_component_ALink, {
5059
+ href: pageN !== $props.page ? $setup.pageLinks[i] : null,
5060
+ onClick: ($event) => $setup.emit("update:page", pageN),
5061
+ class: ["block w-9 rounded border ring-black/10", pageN === $props.page ? "bg-base-50 border-base-100 ring text-base-700" : "border-transparent hover:bg-base-100"]
5062
+ }, {
5063
+ default: withCtx((_, _push2, _parent2, _scopeId) => {
5064
+ if (_push2) {
5065
+ _push2(`${ssrInterpolate(pageN)}`);
5066
+ } else {
5067
+ return [
5068
+ createTextVNode(toDisplayString(pageN), 1)
5069
+ ];
5070
+ }
5071
+ }),
5072
+ _: 2
5073
+ }, _parent));
5074
+ _push(`</li>`);
5075
+ });
5076
+ _push(`<!--]--><li>`);
5077
+ _push(ssrRenderComponent(_component_ALink, {
5078
+ href: $setup.nextPageLink,
5079
+ onClick: ($event) => $setup.nextPageLink && $setup.emit("update:page", $props.page + 1),
5080
+ class: ["ml-1 block min-w-9 rounded border px-3", $setup.nextPageLink ? "border-base-100 hover:bg-base-100" : "border-transparent text-base-500"]
5081
+ }, {
5082
+ default: withCtx((_, _push2, _parent2, _scopeId) => {
5083
+ if (_push2) {
5084
+ _push2(`<span class="mr-1.5 hidden md:inline"${_scopeId}>${ssrInterpolate("Pr\xF3ximo")}</span><i class="i-arrow-right"${_scopeId}></i>`);
5085
+ } else {
5086
+ return [
5087
+ createVNode("span", { class: "mr-1.5 hidden md:inline" }, toDisplayString("Pr\xF3ximo")),
5088
+ createVNode("i", { class: "i-arrow-right" })
5089
+ ];
5090
+ }
5091
+ }),
5092
+ _: 1
5093
+ }, _parent));
5094
+ _push(`</li></ol>`);
5095
+ }
5096
+ const _sfc_setup$l = _sfc_main$l.setup;
5097
+ _sfc_main$l.setup = (props, ctx) => {
5098
+ const ssrContext = useSSRContext();
5099
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Pagination.vue");
5100
+ return _sfc_setup$l ? _sfc_setup$l(props, ctx) : void 0;
5101
+ };
5102
+ const Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["ssrRender", _sfc_ssrRender$l]]);
5103
+
5104
+ var __freeze = Object.freeze;
5105
+ var __defProp = Object.defineProperty;
5106
+ var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(raw || cooked.slice()) }));
5107
+ var _a;
5108
+ const $$Astro$6 = createAstro("https://demo.ecomplus.app");
5109
+ const $$SharedData = createComponent(async ($$result, $$props, $$slots) => {
5110
+ const Astro2 = $$result.createAstro($$Astro$6, $$props, $$slots);
5111
+ Astro2.self = $$SharedData;
5112
+ const { getInlineClientJS } = await useSharedData(Astro2.props);
5113
+ return renderTemplate(_a || (_a = __template(["<script async>", "<\/script>"])), unescapeHTML(getInlineClientJS()));
5114
+ }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/components/SharedData.astro", void 0);
5115
+
5116
+ const useProductShelf = (props) => {
5117
+ const title = ref(props.title || "");
5118
+ const titleLink = ref(props.titleLink || "");
5119
+ const isFetching = ref(false);
5120
+ let fetching = null;
5121
+ const fetchError = ref(null);
5122
+ const products = shallowReactive(props.products || []);
5123
+ if (!props.products) {
5124
+ isFetching.value = true;
5125
+ fetching = (async () => {
5126
+ const limit = props.limit || 24;
5127
+ const offset = props.page ? (props.page - 1) * limit : 0;
5128
+ let endpointQuery = `offset=${offset}&limit=${limit}`;
5129
+ if (props.sort) {
5130
+ endpointQuery += `&sort=${props.sort}`;
5131
+ }
5132
+ if (props.isRelatedProducts) {
5133
+ const { apiContext } = globalThis.$storefront;
5134
+ if (apiContext?.resource === "products") {
5135
+ endpointQuery = `like=${apiContext.doc._id}`;
5136
+ if (!title.value && title.value !== null) {
5137
+ title.value = i19relatedProducts;
5138
+ }
5139
+ }
5140
+ } else {
5141
+ let searchQuery = props.searchQuery || "";
5142
+ let collection;
4279
5143
  if (props.collectionId) {
4280
5144
  try {
4281
5145
  const { data } = await api.get(`collections/${props.collectionId}`);
@@ -4919,11 +5783,17 @@ const usePageHero = async ({ routeContext }) => {
4919
5783
  return { heroSlider };
4920
5784
  };
4921
5785
  const usePageSections = async ({ routeContext, handleCustomSection }) => {
4922
- const sectionsContent = routeContext.cmsContent?.sections;
5786
+ const { cmsContent } = routeContext;
5787
+ let sectionsContent = cmsContent?.sections;
5788
+ if (cmsContent?.markdown && !sectionsContent?.find(({ type }) => type === "content-entry")) {
5789
+ if (!sectionsContent)
5790
+ sectionsContent = [];
5791
+ sectionsContent.push({ type: "content-entry" });
5792
+ }
4923
5793
  const sections = [];
4924
5794
  if (sectionsContent) {
4925
5795
  await Promise.all(sectionsContent.map(async ({ type, ...sectionContent }, index) => {
4926
- if (type === "product-shelf") {
5796
+ if (type === "product-shelf" || type === "related-products") {
4927
5797
  const {
4928
5798
  collectionIdAndInfo,
4929
5799
  isHeadless,
@@ -4968,13 +5838,24 @@ const usePageSections = async ({ routeContext, handleCustomSection }) => {
4968
5838
  sort,
4969
5839
  title: isHeadless ? null : title,
4970
5840
  titleLink,
4971
- isShuffle
5841
+ isShuffle,
5842
+ isRelatedProducts: type === "related-products"
4972
5843
  };
4973
- const { fetching, products } = useProductShelf(props);
5844
+ const {
5845
+ fetching,
5846
+ products,
5847
+ title: { value: finalTitle },
5848
+ titleLink: { value: finalTitleLink }
5849
+ } = useProductShelf(props);
4974
5850
  await fetching;
4975
5851
  sections[index] = {
4976
5852
  type,
4977
- props: { ...props, products }
5853
+ props: {
5854
+ ...props,
5855
+ title: finalTitle,
5856
+ titleLink: finalTitleLink,
5857
+ products
5858
+ }
4978
5859
  };
4979
5860
  return;
4980
5861
  }
@@ -5015,19 +5896,32 @@ const usePageSections = async ({ routeContext, handleCustomSection }) => {
5015
5896
  sections[index] = { type, props };
5016
5897
  return;
5017
5898
  }
5018
- if (type === "banners-grid") {
5019
- sections[index] = {
5020
- type,
5021
- props: {
5022
- banners: parseBanners(sectionContent.banners || [])
5023
- }
5024
- };
5025
- return;
5026
- }
5027
5899
  switch (type) {
5900
+ case "banners-grid":
5901
+ sections[index] = {
5902
+ type,
5903
+ props: {
5904
+ banners: parseBanners(sectionContent.banners || [])
5905
+ }
5906
+ };
5907
+ return;
5908
+ case "custom-html":
5909
+ sections[index] = {
5910
+ type,
5911
+ props: { html: sectionContent.html || "" }
5912
+ };
5913
+ return;
5914
+ case "content-entry":
5915
+ sections[index] = {
5916
+ type,
5917
+ props: {
5918
+ title: sectionContent.title || cmsContent?.title || "",
5919
+ markdown: sectionContent.markdown || cmsContent?.markdown || ""
5920
+ }
5921
+ };
5922
+ return;
5028
5923
  case "breadcrumbs":
5029
5924
  case "product-details":
5030
- case "related-products":
5031
5925
  case "doc-description":
5032
5926
  case "doc-banners":
5033
5927
  case "product-specifications":
@@ -5037,12 +5931,6 @@ const usePageSections = async ({ routeContext, handleCustomSection }) => {
5037
5931
  props: sectionContent
5038
5932
  };
5039
5933
  return;
5040
- case "custom-html":
5041
- sections[index] = {
5042
- type,
5043
- props: { html: sectionContent.html || "" }
5044
- };
5045
- return;
5046
5934
  }
5047
5935
  if (typeof handleCustomSection === "function") {
5048
5936
  const { props } = await handleCustomSection(
@@ -5058,9 +5946,9 @@ const usePageSections = async ({ routeContext, handleCustomSection }) => {
5058
5946
  };
5059
5947
  };
5060
5948
 
5061
- const $$Astro$6 = createAstro("https://demo.ecomplus.app");
5949
+ const $$Astro$5 = createAstro("https://demo.ecomplus.app");
5062
5950
  const $$BannerPictures = createComponent(async ($$result, $$props, $$slots) => {
5063
- const Astro2 = $$result.createAstro($$Astro$6, $$props, $$slots);
5951
+ const Astro2 = $$result.createAstro($$Astro$5, $$props, $$slots);
5064
5952
  Astro2.self = $$BannerPictures;
5065
5953
  const {
5066
5954
  img,
@@ -5113,7 +6001,7 @@ const useBanner = (props) => {
5113
6001
  };
5114
6002
  };
5115
6003
 
5116
- const _sfc_main$h = /* @__PURE__ */ defineComponent({
6004
+ const _sfc_main$k = /* @__PURE__ */ defineComponent({
5117
6005
  __name: "Banner",
5118
6006
  props: {
5119
6007
  img: {},
@@ -5129,106 +6017,384 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
5129
6017
  setup(__props, { expose: __expose }) {
5130
6018
  __expose();
5131
6019
  const props = __props;
5132
- const {
5133
- hasHeader,
5134
- parsedTitle,
5135
- parsedSubtitle,
5136
- parsedButtonText
5137
- } = useBanner(props);
5138
- const __returned__ = { props, hasHeader, parsedTitle, parsedSubtitle, parsedButtonText };
6020
+ const {
6021
+ hasHeader,
6022
+ parsedTitle,
6023
+ parsedSubtitle,
6024
+ parsedButtonText
6025
+ } = useBanner(props);
6026
+ const __returned__ = { props, hasHeader, parsedTitle, parsedSubtitle, parsedButtonText };
6027
+ Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
6028
+ return __returned__;
6029
+ }
6030
+ });
6031
+ function _sfc_ssrRender$k(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
6032
+ const _component_ALink = resolveComponent("ALink");
6033
+ _push(`<div${ssrRenderAttrs(mergeProps({
6034
+ class: ["mx-auto overflow-x-hidden", $setup.hasHeader ? "grid grid-cols-1 sm:grid-cols-2 items-center" : null]
6035
+ }, _attrs))}>`);
6036
+ _push(ssrRenderComponent(_component_ALink, {
6037
+ href: $props.href,
6038
+ class: $setup.hasHeader ? "sm:order-last [&_img]:max-w-full sm:[&_img]:max-w-none [&_img]:aspect-video sm:[&_img]:aspect-[2.5] [&_img]:object-cover" : "[&_img]:max-w-full"
6039
+ }, {
6040
+ default: withCtx((_, _push2, _parent2, _scopeId) => {
6041
+ if (_push2) {
6042
+ ssrRenderSlot(_ctx.$slots, "picture", {}, null, _push2, _parent2, _scopeId);
6043
+ } else {
6044
+ return [
6045
+ renderSlot(_ctx.$slots, "picture")
6046
+ ];
6047
+ }
6048
+ }),
6049
+ _: 3
6050
+ }, _parent));
6051
+ if ($setup.hasHeader) {
6052
+ _push(`<div class="mb-3 p-12 sm:mb-0 xl:ps-32">`);
6053
+ if ($setup.parsedTitle) {
6054
+ ssrRenderVNode(_push, createVNode(resolveDynamicComponent($props.headingTag), { class: "ui-title mt-1" }, {
6055
+ default: withCtx((_, _push2, _parent2, _scopeId) => {
6056
+ if (_push2) {
6057
+ _push2(`${ssrInterpolate($setup.parsedTitle)}`);
6058
+ } else {
6059
+ return [
6060
+ createTextVNode(toDisplayString($setup.parsedTitle), 1)
6061
+ ];
6062
+ }
6063
+ }),
6064
+ _: 1
6065
+ }), _parent);
6066
+ } else {
6067
+ _push(`<!---->`);
6068
+ }
6069
+ if ($setup.parsedSubtitle) {
6070
+ _push(`<p class="mt-4 text-lg md:mt-6">${ssrInterpolate($setup.parsedSubtitle)}</p>`);
6071
+ } else {
6072
+ _push(`<!---->`);
6073
+ }
6074
+ if ($setup.parsedButtonText) {
6075
+ _push(ssrRenderComponent(_component_ALink, {
6076
+ href: $props.buttonLink,
6077
+ class: "ui-btn-lg ui-btn-contrast mt-7 min-w-[150px] md:mt-10"
6078
+ }, {
6079
+ default: withCtx((_, _push2, _parent2, _scopeId) => {
6080
+ if (_push2) {
6081
+ _push2(`${ssrInterpolate($setup.parsedButtonText)}`);
6082
+ } else {
6083
+ return [
6084
+ createTextVNode(toDisplayString($setup.parsedButtonText), 1)
6085
+ ];
6086
+ }
6087
+ }),
6088
+ _: 1
6089
+ }, _parent));
6090
+ } else {
6091
+ _push(`<!---->`);
6092
+ }
6093
+ _push(`</div>`);
6094
+ } else {
6095
+ _push(`<!---->`);
6096
+ }
6097
+ _push(`</div>`);
6098
+ }
6099
+ const _sfc_setup$k = _sfc_main$k.setup;
6100
+ _sfc_main$k.setup = (props, ctx) => {
6101
+ const ssrContext = useSSRContext();
6102
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Banner.vue");
6103
+ return _sfc_setup$k ? _sfc_setup$k(props, ctx) : void 0;
6104
+ };
6105
+ const Banner = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["ssrRender", _sfc_ssrRender$k]]);
6106
+
6107
+ const _sfc_main$j = /* @__PURE__ */ defineComponent({
6108
+ __name: "HeroSlider",
6109
+ props: {
6110
+ autoplay: {},
6111
+ slides: {}
6112
+ },
6113
+ setup(__props, { expose: __expose }) {
6114
+ __expose();
6115
+ const isMounted = ref(false);
6116
+ onMounted(() => {
6117
+ isMounted.value = true;
6118
+ });
6119
+ const __returned__ = { isMounted, Banner };
6120
+ Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
6121
+ return __returned__;
6122
+ }
6123
+ });
6124
+ function _sfc_ssrRender$j(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
6125
+ const _component_Carousel = resolveComponent("Carousel");
6126
+ const _component_CarouselControl = resolveComponent("CarouselControl");
6127
+ _push(`<section${ssrRenderAttrs(mergeProps({ class: "relative mx-auto mb-9 md:mb-12" }, _attrs))}>`);
6128
+ _push(ssrRenderComponent(_component_Carousel, {
6129
+ autoplay: $props.autoplay,
6130
+ class: "secondary [&>*]:items-center"
6131
+ }, {
6132
+ controls: withCtx((_, _push2, _parent2, _scopeId) => {
6133
+ if (_push2) {
6134
+ _push2(`<div style="${ssrRenderStyle($props.slides.length > 1 ? null : { display: "none" })}" class="absolute bottom-5 right-5 z-10 flex w-screen items-center justify-end xl:left-1/2 xl:right-auto xl:-ms-[640px] xl:max-w-screen-xl"${_scopeId}><div class="${ssrRenderClass([$setup.isMounted ? "opacity-100" : "opacity-20 [&>*]:cursor-wait", "text-primary relative h-10 w-20 rounded-full bg-white/50 shadow-sm ring-1 ring-black/5 transition-opacity"])}"${_scopeId}>`);
6135
+ _push2(ssrRenderComponent(_component_CarouselControl, {
6136
+ class: "hover:bg-primary/10 h-10 w-10 rounded-full",
6137
+ "is-prev": ""
6138
+ }, {
6139
+ default: withCtx((_2, _push3, _parent3, _scopeId2) => {
6140
+ if (_push3) {
6141
+ _push3(`<i class="i-arrow-right rotate-180"${_scopeId2}></i>`);
6142
+ } else {
6143
+ return [
6144
+ createVNode("i", { class: "i-arrow-right rotate-180" })
6145
+ ];
6146
+ }
6147
+ }),
6148
+ _: 1
6149
+ }, _parent2, _scopeId));
6150
+ _push2(ssrRenderComponent(_component_CarouselControl, { class: "hover:bg-primary/10 h-10 w-10 rounded-full" }, {
6151
+ default: withCtx((_2, _push3, _parent3, _scopeId2) => {
6152
+ if (_push3) {
6153
+ _push3(`<i class="i-arrow-right"${_scopeId2}></i>`);
6154
+ } else {
6155
+ return [
6156
+ createVNode("i", { class: "i-arrow-right" })
6157
+ ];
6158
+ }
6159
+ }),
6160
+ _: 1
6161
+ }, _parent2, _scopeId));
6162
+ _push2(`</div></div>`);
6163
+ } else {
6164
+ return [
6165
+ withDirectives(createVNode("div", { class: "absolute bottom-5 right-5 z-10 flex w-screen items-center justify-end xl:left-1/2 xl:right-auto xl:-ms-[640px] xl:max-w-screen-xl" }, [
6166
+ createVNode("div", {
6167
+ class: ["text-primary relative h-10 w-20 rounded-full bg-white/50 shadow-sm ring-1 ring-black/5 transition-opacity", $setup.isMounted ? "opacity-100" : "opacity-20 [&>*]:cursor-wait"]
6168
+ }, [
6169
+ createVNode(_component_CarouselControl, {
6170
+ class: "hover:bg-primary/10 h-10 w-10 rounded-full",
6171
+ "is-prev": ""
6172
+ }, {
6173
+ default: withCtx(() => [
6174
+ createVNode("i", { class: "i-arrow-right rotate-180" })
6175
+ ]),
6176
+ _: 1
6177
+ }),
6178
+ createVNode(_component_CarouselControl, { class: "hover:bg-primary/10 h-10 w-10 rounded-full" }, {
6179
+ default: withCtx(() => [
6180
+ createVNode("i", { class: "i-arrow-right" })
6181
+ ]),
6182
+ _: 1
6183
+ })
6184
+ ], 2)
6185
+ ], 512), [
6186
+ [vShow, $props.slides.length > 1]
6187
+ ])
6188
+ ];
6189
+ }
6190
+ }),
6191
+ default: withCtx((_, _push2, _parent2, _scopeId) => {
6192
+ if (_push2) {
6193
+ _push2(`<!--[-->`);
6194
+ ssrRenderList($props.slides, (slide, i) => {
6195
+ _push2(`<li class="shrink-0 basis-full"${_scopeId}>`);
6196
+ _push2(ssrRenderComponent($setup["Banner"], mergeProps({ ...slide, headingTag: i === 0 ? "h2" : "h3" }, { class: "w-screen max-w-screen-2xl" }), {
6197
+ picture: withCtx((_2, _push3, _parent3, _scopeId2) => {
6198
+ if (_push3) {
6199
+ ssrRenderSlot(_ctx.$slots, `picture-${i}`, {}, null, _push3, _parent3, _scopeId2);
6200
+ } else {
6201
+ return [
6202
+ renderSlot(_ctx.$slots, `picture-${i}`)
6203
+ ];
6204
+ }
6205
+ }),
6206
+ _: 2
6207
+ }, _parent2, _scopeId));
6208
+ _push2(`</li>`);
6209
+ });
6210
+ _push2(`<!--]-->`);
6211
+ } else {
6212
+ return [
6213
+ (openBlock(true), createBlock(Fragment$1, null, renderList($props.slides, (slide, i) => {
6214
+ return openBlock(), createBlock("li", {
6215
+ key: i,
6216
+ class: "shrink-0 basis-full"
6217
+ }, [
6218
+ createVNode($setup["Banner"], mergeProps({ ...slide, headingTag: i === 0 ? "h2" : "h3" }, { class: "w-screen max-w-screen-2xl" }), {
6219
+ picture: withCtx(() => [
6220
+ renderSlot(_ctx.$slots, `picture-${i}`)
6221
+ ]),
6222
+ _: 2
6223
+ }, 1040)
6224
+ ]);
6225
+ }), 128))
6226
+ ];
6227
+ }
6228
+ }),
6229
+ _: 3
6230
+ }, _parent));
6231
+ _push(`</section>`);
6232
+ }
6233
+ const _sfc_setup$j = _sfc_main$j.setup;
6234
+ _sfc_main$j.setup = (props, ctx) => {
6235
+ const ssrContext = useSSRContext();
6236
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/HeroSlider.vue");
6237
+ return _sfc_setup$j ? _sfc_setup$j(props, ctx) : void 0;
6238
+ };
6239
+ const HeroSlider = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["ssrRender", _sfc_ssrRender$j]]);
6240
+
6241
+ const $$Astro$4 = createAstro("https://demo.ecomplus.app");
6242
+ const $$Hero = createComponent(async ($$result, $$props, $$slots) => {
6243
+ const Astro2 = $$result.createAstro($$Astro$4, $$props, $$slots);
6244
+ Astro2.self = $$Hero;
6245
+ const { routeContext } = Astro2.locals;
6246
+ const { heroSlider } = await usePageHero({ routeContext });
6247
+ const heroSlides = heroSlider.slides;
6248
+ return renderTemplate`${heroSlider.slides.length > 0 && renderTemplate`${renderComponent($$result, "HeroSlider", HeroSlider, { ...heroSlider, "client:idle": true, "client:component-hydration": "idle", "client:component-path": "~/components/HeroSlider.vue", "client:component-export": "default" }, { "picture-0": ($$result2) => renderTemplate`${heroSlides[0] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-0", ...heroSlides[0], "index": 0 })}`}`, "picture-1": ($$result2) => renderTemplate`${heroSlides[1] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-1", ...heroSlides[1], "index": 1 })}`}`, "picture-2": ($$result2) => renderTemplate`${heroSlides[2] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-2", ...heroSlides[2], "index": 2 })}`}`, "picture-3": ($$result2) => renderTemplate`${heroSlides[3] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-3", ...heroSlides[3], "index": 3 })}`}`, "picture-4": ($$result2) => renderTemplate`${heroSlides[4] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-4", ...heroSlides[4], "index": 4 })}`}`, "picture-5": ($$result2) => renderTemplate`${heroSlides[5] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-5", ...heroSlides[5], "index": 5 })}`}`, "picture-6": ($$result2) => renderTemplate`${heroSlides[6] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-6", ...heroSlides[6], "index": 6 })}`}`, "picture-7": ($$result2) => renderTemplate`${heroSlides[7] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-7", ...heroSlides[7], "index": 7 })}`}`, "picture-8": ($$result2) => renderTemplate`${heroSlides[8] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-8", ...heroSlides[8], "index": 8 })}`}`, "picture-9": ($$result2) => renderTemplate`${heroSlides[9] && renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { "slot": "picture-9", ...heroSlides[9], "index": 9 })}`}` })}`}`;
6249
+ }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/main/content/Hero.astro", void 0);
6250
+
6251
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
6252
+ __name: "ContentClearfix",
6253
+ props: {
6254
+ html: {}
6255
+ },
6256
+ setup(__props, { expose: __expose }) {
6257
+ __expose();
6258
+ const { html } = __props;
6259
+ const parsedHTML = html.replace(/<(img|iframe) /g, '<$1 loading="lazy" ');
6260
+ const __returned__ = { parsedHTML };
6261
+ Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
6262
+ return __returned__;
6263
+ }
6264
+ });
6265
+ function _sfc_ssrRender$i(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
6266
+ _push(`<article${ssrRenderAttrs(mergeProps({ class: "prose !max-w-full overflow-x-auto" }, _attrs))}><div class="[&amp;_iframe]:max-w-full [&amp;_img]:max-w-full [&amp;_table]:max-w-full">${$setup.parsedHTML}</div></article>`);
6267
+ }
6268
+ const _sfc_setup$i = _sfc_main$i.setup;
6269
+ _sfc_main$i.setup = (props, ctx) => {
6270
+ const ssrContext = useSSRContext();
6271
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/ContentClearfix.vue");
6272
+ return _sfc_setup$i ? _sfc_setup$i(props, ctx) : void 0;
6273
+ };
6274
+ const ContentClearfix = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["ssrRender", _sfc_ssrRender$i]]);
6275
+
6276
+ const $$Astro$3 = createAstro("https://demo.ecomplus.app");
6277
+ const $$BannersGrid = createComponent(async ($$result, $$props, $$slots) => {
6278
+ const Astro2 = $$result.createAstro($$Astro$3, $$props, $$slots);
6279
+ Astro2.self = $$BannersGrid;
6280
+ const { banners } = Astro2.props;
6281
+ return renderTemplate`${maybeRenderHead()}<section class="ui-section">
6282
+ <ul class="flex flex-wrap gap-4 lg:flex-nowrap">
6283
+ ${banners.map((banner) => renderTemplate`<li class="lg:flex-1 [&_img]:w-full [&_img]:object-cover">
6284
+ ${renderComponent($$result, "Banner", Banner, { ...banner }, { "picture": ($$result2) => renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { ...banner, "slot": "picture" })}` })}
6285
+ </li>`)}
6286
+ </ul>
6287
+ </section>`;
6288
+ }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/BannersGrid.astro", void 0);
6289
+
6290
+ const useBreadcrumbs = async (props = {}) => {
6291
+ const { settings, apiContext, data } = globalThis.$storefront;
6292
+ const {
6293
+ apiDoc = apiContext?.doc,
6294
+ domain = settings.domain
6295
+ } = props;
6296
+ let categories = props.categories || data.categories;
6297
+ if (!categories) {
6298
+ categories = (await useSharedData({ field: "categories" })).value;
6299
+ }
6300
+ const breadcrumbs = [];
6301
+ if (apiDoc) {
6302
+ const productCategories = apiDoc.categories;
6303
+ if (productCategories) {
6304
+ categoriesList(apiDoc).forEach((categoryName) => {
6305
+ const findCategory = (category2) => {
6306
+ return category2.name === categoryName;
6307
+ };
6308
+ const category = productCategories && productCategories.find(findCategory) || categories?.find(findCategory);
6309
+ if (category) {
6310
+ breadcrumbs.push({
6311
+ name: name(category),
6312
+ link: `/${category.slug}`
6313
+ });
6314
+ }
6315
+ });
6316
+ }
6317
+ breadcrumbs.push({
6318
+ name: name(apiDoc),
6319
+ link: `/${apiDoc.slug}`
6320
+ });
6321
+ }
6322
+ return {
6323
+ breadcrumbs,
6324
+ inlineJSONLd: domain ? JSON.stringify({
6325
+ "@context": "https://schema.org",
6326
+ "@type": "BreadcrumbList",
6327
+ itemListElement: [
6328
+ {
6329
+ "@type": "ListItem",
6330
+ position: 1,
6331
+ item: {
6332
+ "@id": `https://${domain}/`,
6333
+ name: "Homepage"
6334
+ }
6335
+ }
6336
+ ].concat(breadcrumbs.map(({ name, link }, index) => {
6337
+ return {
6338
+ "@type": "ListItem",
6339
+ position: index + 2,
6340
+ item: {
6341
+ "@id": `https://${domain}${link}`,
6342
+ name
6343
+ }
6344
+ };
6345
+ }))
6346
+ }) : null
6347
+ };
6348
+ };
6349
+
6350
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
6351
+ __name: "Breadcrumbs",
6352
+ props: {
6353
+ apiDoc: {},
6354
+ categories: {},
6355
+ domain: {}
6356
+ },
6357
+ async setup(__props, { expose: __expose }) {
6358
+ __expose();
6359
+ let __temp, __restore;
6360
+ const props = __props;
6361
+ const { breadcrumbs, inlineJSONLd } = ([__temp, __restore] = withAsyncContext(() => useBreadcrumbs(props)), __temp = await __temp, __restore(), __temp);
6362
+ const __returned__ = { props, breadcrumbs, inlineJSONLd };
5139
6363
  Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
5140
6364
  return __returned__;
5141
6365
  }
5142
6366
  });
5143
6367
  function _sfc_ssrRender$h(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
5144
- const _component_ALink = resolveComponent("ALink");
5145
- _push(`<div${ssrRenderAttrs(mergeProps({
5146
- class: ["mx-auto overflow-x-hidden", $setup.hasHeader ? "grid grid-cols-1 sm:grid-cols-2 items-center" : null]
5147
- }, _attrs))}>`);
5148
- _push(ssrRenderComponent(_component_ALink, {
5149
- href: $props.href,
5150
- class: $setup.hasHeader ? "sm:order-last [&_img]:max-w-full sm:[&_img]:max-w-none [&_img]:aspect-video sm:[&_img]:aspect-[2.5] [&_img]:object-cover" : "[&_img]:max-w-full"
5151
- }, {
5152
- default: withCtx((_, _push2, _parent2, _scopeId) => {
5153
- if (_push2) {
5154
- ssrRenderSlot(_ctx.$slots, "picture", {}, null, _push2, _parent2, _scopeId);
6368
+ _push(`<!--[-->`);
6369
+ if ($setup.breadcrumbs.length > 1) {
6370
+ _push(`<section class="ui-section-slim"><nav aria-label="Breadcrumb" class="w-full overflow-hidden text-lg md:text-sm"><ol class="text-base-600 flex items-center gap-1"><li><a href="/" class="hover:text-primary"><span class="sr-only">${ssrInterpolate("In\xEDcio")}</span><i class="i-home"></i></a></li><!--[-->`);
6371
+ ssrRenderList($setup.breadcrumbs, ({ name, link }, i) => {
6372
+ _push(`<!--[-->`);
6373
+ if (i + 1 < $setup.breadcrumbs.length) {
6374
+ _push(`<!--[--><li class="text-base-300"><i class="i-chevron-right"></i></li><li class="whitespace-nowrap"><a${ssrRenderAttr("href", link)} class="hover:text-primary">${ssrInterpolate(name)}</a></li><!--]-->`);
5155
6375
  } else {
5156
- return [
5157
- renderSlot$1(_ctx.$slots, "picture")
5158
- ];
6376
+ _push(`<!--[--><li class="text-base-300 hidden lg:block"><i class="i-chevron-right"></i></li><li class="hidden truncate lg:block"><span class="text-base-500">${ssrInterpolate(name)}</span></li><!--]-->`);
5159
6377
  }
5160
- }),
5161
- _: 3
5162
- }, _parent));
5163
- if ($setup.hasHeader) {
5164
- _push(`<div class="mb-3 p-12 sm:mb-0 xl:ps-32">`);
5165
- if ($setup.parsedTitle) {
5166
- ssrRenderVNode(_push, createVNode(resolveDynamicComponent($props.headingTag), { class: "ui-title mt-1" }, {
5167
- default: withCtx((_, _push2, _parent2, _scopeId) => {
5168
- if (_push2) {
5169
- _push2(`${ssrInterpolate($setup.parsedTitle)}`);
5170
- } else {
5171
- return [
5172
- createTextVNode(toDisplayString($setup.parsedTitle), 1)
5173
- ];
5174
- }
5175
- }),
5176
- _: 1
5177
- }), _parent);
5178
- } else {
5179
- _push(`<!---->`);
5180
- }
5181
- if ($setup.parsedSubtitle) {
5182
- _push(`<p class="mt-4 text-lg md:mt-6">${ssrInterpolate($setup.parsedSubtitle)}</p>`);
5183
- } else {
5184
- _push(`<!---->`);
5185
- }
5186
- if ($setup.parsedButtonText) {
5187
- _push(ssrRenderComponent(_component_ALink, {
5188
- href: $props.buttonLink,
5189
- class: "ui-btn-lg ui-btn-contrast mt-7 min-w-[150px] md:mt-10"
5190
- }, {
5191
- default: withCtx((_, _push2, _parent2, _scopeId) => {
5192
- if (_push2) {
5193
- _push2(`${ssrInterpolate($setup.parsedButtonText)}`);
5194
- } else {
5195
- return [
5196
- createTextVNode(toDisplayString($setup.parsedButtonText), 1)
5197
- ];
5198
- }
5199
- }),
5200
- _: 1
5201
- }, _parent));
5202
- } else {
5203
- _push(`<!---->`);
5204
- }
5205
- _push(`</div>`);
6378
+ _push(`<!--]-->`);
6379
+ });
6380
+ _push(`<!--]--></ol></nav></section>`);
5206
6381
  } else {
5207
6382
  _push(`<!---->`);
5208
6383
  }
5209
- _push(`</div>`);
6384
+ if ($setup.inlineJSONLd) {
6385
+ _push(`<script type="application/ld+json">${$setup.inlineJSONLd}<\/script>`);
6386
+ } else {
6387
+ _push(`<!---->`);
6388
+ }
6389
+ _push(`<!--]-->`);
5210
6390
  }
5211
6391
  const _sfc_setup$h = _sfc_main$h.setup;
5212
6392
  _sfc_main$h.setup = (props, ctx) => {
5213
6393
  const ssrContext = useSSRContext();
5214
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Banner.vue");
6394
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Breadcrumbs.vue");
5215
6395
  return _sfc_setup$h ? _sfc_setup$h(props, ctx) : void 0;
5216
6396
  };
5217
- const Banner = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["ssrRender", _sfc_ssrRender$h]]);
5218
-
5219
- const $$Astro$5 = createAstro("https://demo.ecomplus.app");
5220
- const $$BannersGrid = createComponent(async ($$result, $$props, $$slots) => {
5221
- const Astro2 = $$result.createAstro($$Astro$5, $$props, $$slots);
5222
- Astro2.self = $$BannersGrid;
5223
- const { banners } = Astro2.props;
5224
- return renderTemplate`${maybeRenderHead()}<section class="ui-section">
5225
- <ul class="flex flex-wrap gap-4 lg:flex-nowrap">
5226
- ${banners.map((banner) => renderTemplate`<li class="lg:flex-1 [&_img]:w-full [&_img]:object-cover">
5227
- ${renderComponent($$result, "Banner", Banner, { ...banner }, { "picture": ($$result2) => renderTemplate`${renderComponent($$result2, "BannerPictures", $$BannerPictures, { ...banner, "slot": "picture" })}` })}
5228
- </li>`)}
5229
- </ul>
5230
- </section>`;
5231
- }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/BannersGrid.astro", void 0);
6397
+ const Breadcrumbs = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["ssrRender", _sfc_ssrRender$h]]);
5232
6398
 
5233
6399
  const emitGtagEvent = async (name, _params) => {
5234
6400
  return;
@@ -6023,127 +7189,7 @@ _sfc_main$e.setup = (props, ctx) => {
6023
7189
  };
6024
7190
  const ProductShelf = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["ssrRender", _sfc_ssrRender$e]]);
6025
7191
 
6026
- const useBreadcrumbs = async (props = {}) => {
6027
- const { settings, apiContext, data } = globalThis.$storefront;
6028
- const {
6029
- apiDoc = apiContext?.doc,
6030
- domain = settings.domain
6031
- } = props;
6032
- let categories = props.categories || data.categories;
6033
- if (!categories) {
6034
- categories = (await useSharedData({ field: "categories" })).value;
6035
- }
6036
- const breadcrumbs = [];
6037
- if (apiDoc) {
6038
- const productCategories = apiDoc.categories;
6039
- if (productCategories) {
6040
- categoriesList(apiDoc).forEach((categoryName) => {
6041
- const findCategory = (category2) => {
6042
- return category2.name === categoryName;
6043
- };
6044
- const category = productCategories && productCategories.find(findCategory) || categories?.find(findCategory);
6045
- if (category) {
6046
- breadcrumbs.push({
6047
- name: name(category),
6048
- link: `/${category.slug}`
6049
- });
6050
- }
6051
- });
6052
- }
6053
- breadcrumbs.push({
6054
- name: name(apiDoc),
6055
- link: `/${apiDoc.slug}`
6056
- });
6057
- }
6058
- return {
6059
- breadcrumbs,
6060
- inlineJSONLd: domain ? JSON.stringify({
6061
- "@context": "https://schema.org",
6062
- "@type": "BreadcrumbList",
6063
- itemListElement: [
6064
- {
6065
- "@type": "ListItem",
6066
- position: 1,
6067
- item: {
6068
- "@id": `https://${domain}/`,
6069
- name: "Homepage"
6070
- }
6071
- }
6072
- ].concat(breadcrumbs.map(({ name, link }, index) => {
6073
- return {
6074
- "@type": "ListItem",
6075
- position: index + 2,
6076
- item: {
6077
- "@id": `https://${domain}${link}`,
6078
- name
6079
- }
6080
- };
6081
- }))
6082
- }) : null
6083
- };
6084
- };
6085
-
6086
- var __freeze$1 = Object.freeze;
6087
- var __defProp$1 = Object.defineProperty;
6088
- var __template$1 = (cooked, raw) => __freeze$1(__defProp$1(cooked, "raw", { value: __freeze$1(raw || cooked.slice()) }));
6089
- var _a$1;
6090
- const $$Astro$4 = createAstro("https://demo.ecomplus.app");
6091
- const $$Breadcrumbs = createComponent(async ($$result, $$props, $$slots) => {
6092
- const Astro2 = $$result.createAstro($$Astro$4, $$props, $$slots);
6093
- Astro2.self = $$Breadcrumbs;
6094
- const { breadcrumbs, inlineJSONLd } = await useBreadcrumbs(Astro2.props);
6095
- return renderTemplate`${breadcrumbs.length > 0 && renderTemplate`${maybeRenderHead()}<section${addAttribute(`ui-section-slim ${breadcrumbs.length > 1 ? "" : "hidden lg:block"}`, "class")}>
6096
- <nav aria-label="Breadcrumb" class="w-full overflow-hidden text-lg md:text-sm">
6097
- <ol class="flex items-center gap-1 text-base-600">
6098
- <li>
6099
- <a href="/" class="hover:text-primary">
6100
- <span class="sr-only"> Home </span>
6101
- <i class="i-home"></i>
6102
- </a>
6103
- </li>
6104
- ${breadcrumbs.map(
6105
- ({ name, link }, i) => renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`${i + 1 < breadcrumbs.length ? renderTemplate`<li class="text-base-300">
6106
- <i class="i-chevron-right"></i>
6107
- </li><li class="whitespace-nowrap">
6108
- <a${addAttribute(link, "href")} class="hover:text-primary">${name}</a>
6109
- </li>` : renderTemplate`<li class="hidden lg:block text-base-300">
6110
- <i class="i-chevron-right"></i>
6111
- </li><li class="hidden lg:block whitespace-nowrap overflow-hidden text-ellipsis">
6112
- <span class="text-base-500">${name}</span>
6113
- </li>`}` })}`
6114
- )}
6115
- </ol>
6116
- </nav>
6117
- ${inlineJSONLd && renderTemplate(_a$1 || (_a$1 = __template$1(['<script type="application/ld+json">', "<\/script>"])), unescapeHTML(inlineJSONLd))}
6118
- </section>`}`;
6119
- }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/Breadcrumbs.astro", void 0);
6120
-
6121
7192
  const _sfc_main$d = /* @__PURE__ */ defineComponent({
6122
- __name: "ContentClearfix",
6123
- props: {
6124
- html: {}
6125
- },
6126
- setup(__props, { expose: __expose }) {
6127
- __expose();
6128
- const { html } = __props;
6129
- const parsedHTML = html.replace(/<(img|iframe) /g, '<$1 loading="lazy" ');
6130
- const __returned__ = { parsedHTML };
6131
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
6132
- return __returned__;
6133
- }
6134
- });
6135
- function _sfc_ssrRender$d(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
6136
- _push(`<article${ssrRenderAttrs(mergeProps({ class: "prose !max-w-full overflow-x-auto" }, _attrs))}><div class="[&amp;_iframe]:max-w-full [&amp;_img]:max-w-full [&amp;_table]:max-w-full">${$setup.parsedHTML}</div></article>`);
6137
- }
6138
- const _sfc_setup$d = _sfc_main$d.setup;
6139
- _sfc_main$d.setup = (props, ctx) => {
6140
- const ssrContext = useSSRContext();
6141
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/ContentClearfix.vue");
6142
- return _sfc_setup$d ? _sfc_setup$d(props, ctx) : void 0;
6143
- };
6144
- const ContentClearfix = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["ssrRender", _sfc_ssrRender$d]]);
6145
-
6146
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
6147
7193
  __name: "Collapse",
6148
7194
  props: {
6149
7195
  title: {}
@@ -6155,20 +7201,20 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
6155
7201
  return __returned__;
6156
7202
  }
6157
7203
  });
6158
- function _sfc_ssrRender$c(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
7204
+ function _sfc_ssrRender$d(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
6159
7205
  _push(`<details${ssrRenderAttrs(mergeProps({ class: "group my-4 md:my-5 [&_i]:open:-rotate-90" }, _attrs))}><summary role="button" class="text-base-700 hover:text-base-800 [&amp;&gt;i]:hover:text-primary list-none text-2xl font-medium lowercase group-open:mb-3"><i class="i-chevron-right mr-1 rotate-90"></i><span>${ssrInterpolate($props.title)}</span></summary>`);
6160
7206
  ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
6161
7207
  _push(`</details>`);
6162
7208
  }
6163
- const _sfc_setup$c = _sfc_main$c.setup;
6164
- _sfc_main$c.setup = (props, ctx) => {
7209
+ const _sfc_setup$d = _sfc_main$d.setup;
7210
+ _sfc_main$d.setup = (props, ctx) => {
6165
7211
  const ssrContext = useSSRContext();
6166
7212
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Collapse.vue");
6167
- return _sfc_setup$c ? _sfc_setup$c(props, ctx) : void 0;
7213
+ return _sfc_setup$d ? _sfc_setup$d(props, ctx) : void 0;
6168
7214
  };
6169
- const Collapse = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["ssrRender", _sfc_ssrRender$c]]);
7215
+ const Collapse = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["ssrRender", _sfc_ssrRender$d]]);
6170
7216
 
6171
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
7217
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
6172
7218
  __name: "DocDescription",
6173
7219
  props: {
6174
7220
  apiDoc: { default: () => globalThis.$storefront.apiContext?.doc },
@@ -6183,7 +7229,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
6183
7229
  return __returned__;
6184
7230
  }
6185
7231
  });
6186
- function _sfc_ssrRender$b(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
7232
+ function _sfc_ssrRender$c(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
6187
7233
  if ($setup.html) {
6188
7234
  _push(`<section${ssrRenderAttrs(mergeProps({ class: "ui-section" }, _attrs))}>`);
6189
7235
  _push(ssrRenderComponent($setup["Collapse"], {
@@ -6206,15 +7252,15 @@ function _sfc_ssrRender$b(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
6206
7252
  _push(`<!---->`);
6207
7253
  }
6208
7254
  }
6209
- const _sfc_setup$b = _sfc_main$b.setup;
6210
- _sfc_main$b.setup = (props, ctx) => {
7255
+ const _sfc_setup$c = _sfc_main$c.setup;
7256
+ _sfc_main$c.setup = (props, ctx) => {
6211
7257
  const ssrContext = useSSRContext();
6212
7258
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/DocDescription.vue");
6213
- return _sfc_setup$b ? _sfc_setup$b(props, ctx) : void 0;
7259
+ return _sfc_setup$c ? _sfc_setup$c(props, ctx) : void 0;
6214
7260
  };
6215
- const DocDescription = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["ssrRender", _sfc_ssrRender$b]]);
7261
+ const DocDescription = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["ssrRender", _sfc_ssrRender$c]]);
6216
7262
 
6217
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
7263
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
6218
7264
  __name: "DocBanners",
6219
7265
  props: {
6220
7266
  apiDoc: { default: () => globalThis.$storefront.apiContext?.doc },
@@ -6229,25 +7275,29 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
6229
7275
  return __returned__;
6230
7276
  }
6231
7277
  });
6232
- function _sfc_ssrRender$a(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
7278
+ function _sfc_ssrRender$b(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
6233
7279
  const _component_AImg = resolveComponent("AImg");
6234
- _push(`<section${ssrRenderAttrs(mergeProps({ class: "ui-section" }, _attrs))}><ul class="flex flex-wrap gap-4 lg:flex-nowrap"><!--[-->`);
6235
- ssrRenderList($setup.pictures, (picture, i) => {
6236
- _push(`<li class="lg:flex-1 [&amp;_img]:w-full [&amp;_img]:object-cover">`);
6237
- _push(ssrRenderComponent(_component_AImg, { picture }, null, _parent));
6238
- _push(`</li>`);
6239
- });
6240
- _push(`<!--]--></ul></section>`);
7280
+ if ($setup.pictures.length) {
7281
+ _push(`<section${ssrRenderAttrs(mergeProps({ class: "ui-section" }, _attrs))}><ul class="flex flex-wrap gap-4 lg:flex-nowrap"><!--[-->`);
7282
+ ssrRenderList($setup.pictures, (picture, i) => {
7283
+ _push(`<li class="lg:flex-1 [&amp;_img]:w-full [&amp;_img]:object-cover">`);
7284
+ _push(ssrRenderComponent(_component_AImg, { picture }, null, _parent));
7285
+ _push(`</li>`);
7286
+ });
7287
+ _push(`<!--]--></ul></section>`);
7288
+ } else {
7289
+ _push(`<!---->`);
7290
+ }
6241
7291
  }
6242
- const _sfc_setup$a = _sfc_main$a.setup;
6243
- _sfc_main$a.setup = (props, ctx) => {
7292
+ const _sfc_setup$b = _sfc_main$b.setup;
7293
+ _sfc_main$b.setup = (props, ctx) => {
6244
7294
  const ssrContext = useSSRContext();
6245
7295
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/DocBanners.vue");
6246
- return _sfc_setup$a ? _sfc_setup$a(props, ctx) : void 0;
7296
+ return _sfc_setup$b ? _sfc_setup$b(props, ctx) : void 0;
6247
7297
  };
6248
- const DocBanners = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["ssrRender", _sfc_ssrRender$a]]);
7298
+ const DocBanners = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["ssrRender", _sfc_ssrRender$b]]);
6249
7299
 
6250
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
7300
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
6251
7301
  __name: "CheckoutLink",
6252
7302
  props: {
6253
7303
  to: { default: "cart" },
@@ -6302,20 +7352,20 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
6302
7352
  return __returned__;
6303
7353
  }
6304
7354
  });
6305
- function _sfc_ssrRender$9(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
7355
+ function _sfc_ssrRender$a(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
6306
7356
  _push(`<a${ssrRenderAttrs(mergeProps({ href: $setup.href }, _attrs))}>`);
6307
7357
  ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
6308
7358
  _push(`</a>`);
6309
7359
  }
6310
- const _sfc_setup$9 = _sfc_main$9.setup;
6311
- _sfc_main$9.setup = (props, ctx) => {
7360
+ const _sfc_setup$a = _sfc_main$a.setup;
7361
+ _sfc_main$a.setup = (props, ctx) => {
6312
7362
  const ssrContext = useSSRContext();
6313
7363
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/CheckoutLink.vue");
6314
- return _sfc_setup$9 ? _sfc_setup$9(props, ctx) : void 0;
7364
+ return _sfc_setup$a ? _sfc_setup$a(props, ctx) : void 0;
6315
7365
  };
6316
- const CheckoutLink = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["ssrRender", _sfc_ssrRender$9]]);
7366
+ const CheckoutLink = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["ssrRender", _sfc_ssrRender$a]]);
6317
7367
 
6318
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
7368
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
6319
7369
  __name: "QuantitySelectorControl",
6320
7370
  props: {
6321
7371
  isMinus: { type: Boolean }
@@ -6332,7 +7382,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
6332
7382
  return __returned__;
6333
7383
  }
6334
7384
  });
6335
- function _sfc_ssrRender$8(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
7385
+ function _sfc_ssrRender$9(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
6336
7386
  _push(`<button${ssrRenderAttrs(mergeProps({
6337
7387
  type: "button",
6338
7388
  class: "leading-12 enabled:text-primary enabled:hover:bg-primary-100/70 h-12 w-10 text-xl disabled:opacity-40",
@@ -6349,16 +7399,16 @@ function _sfc_ssrRender$8(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
6349
7399
  }, _push, _parent);
6350
7400
  _push(`</button>`);
6351
7401
  }
6352
- const _sfc_setup$8 = _sfc_main$8.setup;
6353
- _sfc_main$8.setup = (props, ctx) => {
7402
+ const _sfc_setup$9 = _sfc_main$9.setup;
7403
+ _sfc_main$9.setup = (props, ctx) => {
6354
7404
  const ssrContext = useSSRContext();
6355
7405
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/QuantitySelectorControl.vue");
6356
- return _sfc_setup$8 ? _sfc_setup$8(props, ctx) : void 0;
7406
+ return _sfc_setup$9 ? _sfc_setup$9(props, ctx) : void 0;
6357
7407
  };
6358
- const QuantitySelectorControl = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["ssrRender", _sfc_ssrRender$8]]);
7408
+ const QuantitySelectorControl = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["ssrRender", _sfc_ssrRender$9]]);
6359
7409
 
6360
7410
  const quantitySelectorKey = Symbol("quantitySelector");
6361
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
7411
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
6362
7412
  __name: "QuantitySelector",
6363
7413
  props: {
6364
7414
  modelValue: { default: 1 },
@@ -6407,7 +7457,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
6407
7457
  return __returned__;
6408
7458
  }
6409
7459
  });
6410
- function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
7460
+ function _sfc_ssrRender$8(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
6411
7461
  _push(`<div${ssrRenderAttrs(mergeProps({ "data-quantity-selector": "" }, _attrs))}>`);
6412
7462
  ssrRenderSlot(_ctx.$slots, "label", { inputId: $setup.inputId, value: $setup.value }, () => {
6413
7463
  _push(`<label${ssrRenderAttr("for", $setup.inputId)} class="sr-only">${ssrInterpolate("Quantidade")}</label>`);
@@ -6423,7 +7473,7 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
6423
7473
  ssrRenderSlot(_ctx.$slots, "minus", {}, null, _push2, _parent2, _scopeId);
6424
7474
  } else {
6425
7475
  return [
6426
- renderSlot$1(_ctx.$slots, "minus")
7476
+ renderSlot(_ctx.$slots, "minus")
6427
7477
  ];
6428
7478
  }
6429
7479
  }),
@@ -6435,7 +7485,7 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
6435
7485
  ssrRenderSlot(_ctx.$slots, "plus", {}, null, _push2, _parent2, _scopeId);
6436
7486
  } else {
6437
7487
  return [
6438
- renderSlot$1(_ctx.$slots, "plus")
7488
+ renderSlot(_ctx.$slots, "plus")
6439
7489
  ];
6440
7490
  }
6441
7491
  }),
@@ -6444,15 +7494,15 @@ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
6444
7494
  }, _push, _parent);
6445
7495
  _push(`</div></div>`);
6446
7496
  }
6447
- const _sfc_setup$7 = _sfc_main$7.setup;
6448
- _sfc_main$7.setup = (props, ctx) => {
7497
+ const _sfc_setup$8 = _sfc_main$8.setup;
7498
+ _sfc_main$8.setup = (props, ctx) => {
6449
7499
  const ssrContext = useSSRContext();
6450
7500
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/QuantitySelector.vue");
6451
- return _sfc_setup$7 ? _sfc_setup$7(props, ctx) : void 0;
7501
+ return _sfc_setup$8 ? _sfc_setup$8(props, ctx) : void 0;
6452
7502
  };
6453
- const QuantitySelector = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["ssrRender", _sfc_ssrRender$7]]);
7503
+ const QuantitySelector = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["ssrRender", _sfc_ssrRender$8]]);
6454
7504
 
6455
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
7505
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
6456
7506
  __name: "ImagesGallery",
6457
7507
  props: {
6458
7508
  pictures: {}
@@ -6509,7 +7559,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
6509
7559
  return __returned__;
6510
7560
  }
6511
7561
  });
6512
- function _sfc_ssrRender$6(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
7562
+ function _sfc_ssrRender$7(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
6513
7563
  const _component_Carousel = resolveComponent("Carousel");
6514
7564
  const _component_AImg = resolveComponent("AImg");
6515
7565
  const _component_CarouselControl = resolveComponent("CarouselControl");
@@ -6545,11 +7595,11 @@ function _sfc_ssrRender$6(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
6545
7595
  if (_push2) {
6546
7596
  _push2(`<!--[-->`);
6547
7597
  ssrRenderList(Math.ceil($props.pictures.length / 2), (i) => {
6548
- _push2(`<li class="${ssrRenderClass([i === 1 && "pt-1", "grid h-1/3 w-full grid-cols-2 gap-3 px-1 pb-3"])}"${_scopeId}><!--[-->`);
7598
+ _push2(`<li class="${ssrRenderClass([i === 1 && "pt-1", "grid w-full grid-cols-2 gap-3 px-1 pb-3"])}"${_scopeId}><!--[-->`);
6549
7599
  ssrRenderList([1, 2].map((ii) => (i - 1) * 2 + (ii - 1)), (index) => {
6550
7600
  _push2(`<!--[-->`);
6551
7601
  if (index < $props.pictures.length) {
6552
- _push2(`<button class="bg-secondary-100 h-full rounded"${_scopeId}>`);
7602
+ _push2(`<button class="bg-secondary-100 block rounded md:h-[175px]"${_scopeId}>`);
6553
7603
  _push2(ssrRenderComponent(_component_AImg, {
6554
7604
  picture: $props.pictures[index],
6555
7605
  class: ["ring-secondary/10 h-full w-full rounded border-2 object-cover opacity-90 transition-colors", index === $setup.activeIndex ? "border-secondary/50 ring-4 cursor-auto" : "border-transparent hover:border-primary hover:ring-4 hover:ring-primary/20"]
@@ -6568,7 +7618,7 @@ function _sfc_ssrRender$6(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
6568
7618
  (openBlock(true), createBlock(Fragment$1, null, renderList(Math.ceil($props.pictures.length / 2), (i) => {
6569
7619
  return openBlock(), createBlock("li", {
6570
7620
  key: i,
6571
- class: ["grid h-1/3 w-full grid-cols-2 gap-3 px-1 pb-3", i === 1 && "pt-1"]
7621
+ class: ["grid w-full grid-cols-2 gap-3 px-1 pb-3", i === 1 && "pt-1"]
6572
7622
  }, [
6573
7623
  (openBlock(true), createBlock(Fragment$1, null, renderList([1, 2].map((ii) => (i - 1) * 2 + (ii - 1)), (index) => {
6574
7624
  return openBlock(), createBlock(Fragment$1, {
@@ -6576,7 +7626,7 @@ function _sfc_ssrRender$6(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
6576
7626
  }, [
6577
7627
  index < $props.pictures.length ? (openBlock(), createBlock("button", {
6578
7628
  key: 0,
6579
- class: "bg-secondary-100 h-full rounded",
7629
+ class: "bg-secondary-100 block rounded md:h-[175px]",
6580
7630
  onClick: ($event) => $setup.activeIndex = index
6581
7631
  }, [
6582
7632
  createVNode(_component_AImg, {
@@ -6689,20 +7739,22 @@ function _sfc_ssrRender$6(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
6689
7739
  }
6690
7740
  _push(`</div></div>`);
6691
7741
  }
6692
- const _sfc_setup$6 = _sfc_main$6.setup;
6693
- _sfc_main$6.setup = (props, ctx) => {
7742
+ const _sfc_setup$7 = _sfc_main$7.setup;
7743
+ _sfc_main$7.setup = (props, ctx) => {
6694
7744
  const ssrContext = useSSRContext();
6695
7745
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ImagesGallery.vue");
6696
- return _sfc_setup$6 ? _sfc_setup$6(props, ctx) : void 0;
7746
+ return _sfc_setup$7 ? _sfc_setup$7(props, ctx) : void 0;
6697
7747
  };
6698
- const ImagesGallery = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["ssrRender", _sfc_ssrRender$6]]);
7748
+ const ImagesGallery = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["ssrRender", _sfc_ssrRender$7]]);
6699
7749
 
6700
7750
  const useSkuSelector = (props) => {
6701
- const grids = shallowReactive(globalThis.$storefront.data.grids || []);
6702
- if (!grids.length) {
6703
- api.get("grids").then(({ data: { result } }) => {
6704
- result.forEach((grid) => grids.push(grid));
6705
- });
7751
+ const grids = shallowReactive(
7752
+ props.grids || globalThis.$storefront.data.grids || []
7753
+ );
7754
+ if (!grids.length && false) {
7755
+ window.addEventListener("storefront:data:data", () => {
7756
+ globalThis.$storefront.data.grids?.forEach((grid) => grids.push(grid));
7757
+ }, { once: true });
6706
7758
  }
6707
7759
  const variationsGrids$1 = reactive({});
6708
7760
  const activeVariationsGrids = reactive({});
@@ -6804,11 +7856,12 @@ const useSkuSelector = (props) => {
6804
7856
  };
6805
7857
  };
6806
7858
 
6807
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
7859
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
6808
7860
  __name: "SkuSelector",
6809
7861
  props: {
6810
7862
  variations: {},
6811
- variationId: {}
7863
+ variationId: {},
7864
+ grids: {}
6812
7865
  },
6813
7866
  emits: ["update:variationId"],
6814
7867
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -6832,7 +7885,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
6832
7885
  return __returned__;
6833
7886
  }
6834
7887
  });
6835
- function _sfc_ssrRender$5(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
7888
+ function _sfc_ssrRender$6(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
6836
7889
  _push(`<div${ssrRenderAttrs(_attrs)}><!--[-->`);
6837
7890
  ssrRenderList($setup.variationsGrids, (options, gridId) => {
6838
7891
  _push(`<div class="mt-3"><span class="text-base-700 text-sm font-medium">${ssrInterpolate($setup.getGridTitle(gridId))}: `);
@@ -6859,15 +7912,15 @@ function _sfc_ssrRender$5(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
6859
7912
  });
6860
7913
  _push(`<!--]--></div>`);
6861
7914
  }
6862
- const _sfc_setup$5 = _sfc_main$5.setup;
6863
- _sfc_main$5.setup = (props, ctx) => {
7915
+ const _sfc_setup$6 = _sfc_main$6.setup;
7916
+ _sfc_main$6.setup = (props, ctx) => {
6864
7917
  const ssrContext = useSSRContext();
6865
7918
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/SkuSelector.vue");
6866
- return _sfc_setup$5 ? _sfc_setup$5(props, ctx) : void 0;
7919
+ return _sfc_setup$6 ? _sfc_setup$6(props, ctx) : void 0;
6867
7920
  };
6868
- const SkuSelector = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["ssrRender", _sfc_ssrRender$5]]);
7921
+ const SkuSelector = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["ssrRender", _sfc_ssrRender$6]]);
6869
7922
 
6870
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
7923
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
6871
7924
  __name: "ProductDetails",
6872
7925
  props: {
6873
7926
  product: { default: () => globalThis.$storefront.apiContext?.doc }
@@ -6920,7 +7973,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
6920
7973
  return __returned__;
6921
7974
  }
6922
7975
  });
6923
- function _sfc_ssrRender$4(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
7976
+ function _sfc_ssrRender$5(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
6924
7977
  const _component_Fade = resolveComponent("Fade");
6925
7978
  _push(`<section${ssrRenderAttrs(mergeProps({ class: "ui-section relative grid grid-cols-1 items-start gap-5 md:gap-4 lg:grid-cols-4 2xl:gap-6" }, _attrs))}><div class="w-full lg:col-span-3">`);
6926
7979
  if ($setup.product.pictures?.length) {
@@ -6970,7 +8023,7 @@ function _sfc_ssrRender$4(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
6970
8023
  }),
6971
8024
  _: 1
6972
8025
  }, _parent));
6973
- _push(`<div class="mt-5 flex flex-wrap items-center gap-x-4 gap-y-2 overflow-hidden md:flex-nowrap lg:mt-4 lg:flex-wrap">`);
8026
+ _push(`<div class="mt-5 flex flex-wrap items-center gap-x-4 gap-y-2 md:flex-nowrap lg:mt-4 lg:flex-wrap">`);
6974
8027
  _push(ssrRenderComponent($setup["QuantitySelector"], {
6975
8028
  modelValue: $setup.quantity,
6976
8029
  "onUpdate:modelValue": ($event) => $setup.quantity = $event,
@@ -7009,15 +8062,15 @@ function _sfc_ssrRender$4(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
7009
8062
  ssrRenderSlot(_ctx.$slots, "description", {}, null, _push, _parent);
7010
8063
  _push(`</div></section>`);
7011
8064
  }
7012
- const _sfc_setup$4 = _sfc_main$4.setup;
7013
- _sfc_main$4.setup = (props, ctx) => {
8065
+ const _sfc_setup$5 = _sfc_main$5.setup;
8066
+ _sfc_main$5.setup = (props, ctx) => {
7014
8067
  const ssrContext = useSSRContext();
7015
8068
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ProductDetails.vue");
7016
- return _sfc_setup$4 ? _sfc_setup$4(props, ctx) : void 0;
8069
+ return _sfc_setup$5 ? _sfc_setup$5(props, ctx) : void 0;
7017
8070
  };
7018
- const ProductDetails = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["ssrRender", _sfc_ssrRender$4]]);
8071
+ const ProductDetails = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["ssrRender", _sfc_ssrRender$5]]);
7019
8072
 
7020
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
8073
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
7021
8074
  __name: "ProductSpecifications",
7022
8075
  props: {
7023
8076
  product: { default: () => globalThis.$storefront.apiContext?.doc },
@@ -7038,7 +8091,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
7038
8091
  return __returned__;
7039
8092
  }
7040
8093
  });
7041
- function _sfc_ssrRender$3(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
8094
+ function _sfc_ssrRender$4(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
7042
8095
  if ($setup.hasSpecs) {
7043
8096
  _push(`<section${ssrRenderAttrs(mergeProps({ class: "ui-section" }, _attrs))}>`);
7044
8097
  _push(ssrRenderComponent($setup["Collapse"], {
@@ -7048,7 +8101,7 @@ function _sfc_ssrRender$3(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
7048
8101
  if (_push2) {
7049
8102
  _push2(`<ul${_scopeId}><!--[-->`);
7050
8103
  ssrRenderList($setup.specifications, (grid, gridId) => {
7051
- _push2(`<li class="border-base-200 grid grid-cols-2 border-dashed py-2 sm:grid-cols-3 [&amp;:not(:last-child)]:border-b"${_scopeId}><span class="text-base-700"${_scopeId}>${ssrInterpolate($setup.getGridTitle(`${gridId}`, $setup.grids))}</span><strong class="font-semibold sm:col-span-2"${_scopeId}>${ssrInterpolate($setup.getSpecTextValue($props.product, `${gridId}`, $setup.grids))}</strong></li>`);
8104
+ _push2(`<li class="border-base-200 grid grid-cols-2 border-dashed py-2 sm:grid-cols-3 [&amp;:not(:last-child)]:border-b"${_scopeId}><span class="text-base-700"${_scopeId}>${ssrInterpolate($setup.getGridTitle(`${gridId}`, $setup.grids || []))}</span><strong class="font-semibold sm:col-span-2"${_scopeId}>${ssrInterpolate($setup.getSpecTextValue($props.product, `${gridId}`, $setup.grids))}</strong></li>`);
7052
8105
  });
7053
8106
  _push2(`<!--]--></ul>`);
7054
8107
  } else {
@@ -7059,7 +8112,7 @@ function _sfc_ssrRender$3(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
7059
8112
  key: gridId,
7060
8113
  class: "border-base-200 grid grid-cols-2 border-dashed py-2 sm:grid-cols-3 [&:not(:last-child)]:border-b"
7061
8114
  }, [
7062
- createVNode("span", { class: "text-base-700" }, toDisplayString($setup.getGridTitle(`${gridId}`, $setup.grids)), 1),
8115
+ createVNode("span", { class: "text-base-700" }, toDisplayString($setup.getGridTitle(`${gridId}`, $setup.grids || [])), 1),
7063
8116
  createVNode("strong", { class: "font-semibold sm:col-span-2" }, toDisplayString($setup.getSpecTextValue($props.product, `${gridId}`, $setup.grids)), 1)
7064
8117
  ]);
7065
8118
  }), 128))
@@ -7074,157 +8127,15 @@ function _sfc_ssrRender$3(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
7074
8127
  _push(`<!---->`);
7075
8128
  }
7076
8129
  }
7077
- const _sfc_setup$3 = _sfc_main$3.setup;
7078
- _sfc_main$3.setup = (props, ctx) => {
8130
+ const _sfc_setup$4 = _sfc_main$4.setup;
8131
+ _sfc_main$4.setup = (props, ctx) => {
7079
8132
  const ssrContext = useSSRContext();
7080
8133
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ProductSpecifications.vue");
7081
- return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
7082
- };
7083
- const ProductSpecifications = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["ssrRender", _sfc_ssrRender$3]]);
7084
-
7085
- const usePagination = (props) => {
7086
- const totalPages = computed(() => {
7087
- if (props.totalPages)
7088
- return props.totalPages;
7089
- if (props.totalItems && props.pageSize) {
7090
- return Math.ceil(props.totalItems / props.pageSize);
7091
- }
7092
- return 1;
7093
- });
7094
- const pageNumber = computed(() => {
7095
- const currentPage = props.page || 1;
7096
- if (currentPage < 1)
7097
- return 1;
7098
- if (currentPage > totalPages.value)
7099
- return totalPages.value;
7100
- return currentPage;
7101
- });
7102
- const maxPages = computed(() => props.maxPages || 10);
7103
- const startPage = computed(() => {
7104
- if (totalPages.value <= maxPages.value)
7105
- return 1;
7106
- const maxPagesBeforeCurrent = Math.floor(maxPages.value / 2);
7107
- const maxPagesAfterCurrent = Math.ceil(maxPages.value / 2) - 1;
7108
- if (pageNumber.value <= maxPagesBeforeCurrent)
7109
- return 1;
7110
- if (pageNumber.value + maxPagesAfterCurrent >= totalPages.value) {
7111
- return totalPages.value - maxPages.value + 1;
7112
- }
7113
- return pageNumber.value - maxPagesBeforeCurrent;
7114
- });
7115
- const endPage = computed(() => {
7116
- if (totalPages.value <= maxPages.value)
7117
- return totalPages.value;
7118
- const maxPagesBeforeCurrent = Math.floor(maxPages.value / 2);
7119
- const maxPagesAfterCurrent = Math.ceil(maxPages.value / 2) - 1;
7120
- if (pageNumber.value <= maxPagesBeforeCurrent)
7121
- return maxPages.value;
7122
- if (pageNumber.value + maxPagesAfterCurrent >= totalPages.value) {
7123
- return totalPages.value;
7124
- }
7125
- return pageNumber.value + maxPagesAfterCurrent;
7126
- });
7127
- const pages = computed(() => {
7128
- return Array.from(Array(endPage.value + 1 - startPage.value).keys()).map((i) => startPage.value + i);
7129
- });
7130
- return {
7131
- totalPages,
7132
- startPage,
7133
- endPage,
7134
- pages
7135
- };
7136
- };
7137
-
7138
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
7139
- __name: "Pagination",
7140
- props: {
7141
- totalItems: {},
7142
- totalPages: {},
7143
- page: { default: 1 },
7144
- pageSize: {},
7145
- maxPages: { default: 7 }
7146
- },
7147
- emits: ["update:page"],
7148
- setup(__props, { expose: __expose, emit: __emit }) {
7149
- __expose();
7150
- const props = __props;
7151
- const emit = __emit;
7152
- const { totalPages, pages } = usePagination(props);
7153
- const __returned__ = { props, emit, totalPages, pages };
7154
- Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
7155
- return __returned__;
7156
- }
7157
- });
7158
- function _sfc_ssrRender$2(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
7159
- const _component_ALink = resolveComponent("ALink");
7160
- _push(`<ol${ssrRenderAttrs(mergeProps({ class: "text-base-900 flex justify-center gap-1.5 text-center text-sm font-medium leading-9" }, _attrs))}><li>`);
7161
- _push(ssrRenderComponent(_component_ALink, {
7162
- href: $props.page > 1 ? `?p=${$props.page - 1}` : null,
7163
- onClick: ($event) => $props.page > 1 && $setup.emit("update:page", $props.page - 1),
7164
- class: ["mr-1 block min-w-9 rounded border px-3", $props.page > 1 ? "border-base-100 hover:bg-base-100" : "border-transparent text-base-500"]
7165
- }, {
7166
- default: withCtx((_, _push2, _parent2, _scopeId) => {
7167
- if (_push2) {
7168
- _push2(`<i class="i-arrow-right rotate-180"${_scopeId}></i><span class="ml-1.5 hidden md:inline"${_scopeId}>${ssrInterpolate("Anterior")}</span>`);
7169
- } else {
7170
- return [
7171
- createVNode("i", { class: "i-arrow-right rotate-180" }),
7172
- createVNode("span", { class: "ml-1.5 hidden md:inline" }, toDisplayString("Anterior"))
7173
- ];
7174
- }
7175
- }),
7176
- _: 1
7177
- }, _parent));
7178
- _push(`</li><!--[-->`);
7179
- ssrRenderList($setup.pages, (pageN) => {
7180
- _push(`<li>`);
7181
- _push(ssrRenderComponent(_component_ALink, {
7182
- href: pageN !== $props.page ? `?p=${pageN}` : null,
7183
- onClick: ($event) => $setup.emit("update:page", pageN),
7184
- class: ["block w-9 rounded border ring-black/10", pageN === $props.page ? "bg-base-50 border-base-100 ring text-base-700" : "border-transparent hover:bg-base-100"]
7185
- }, {
7186
- default: withCtx((_, _push2, _parent2, _scopeId) => {
7187
- if (_push2) {
7188
- _push2(`${ssrInterpolate(pageN)}`);
7189
- } else {
7190
- return [
7191
- createTextVNode(toDisplayString(pageN), 1)
7192
- ];
7193
- }
7194
- }),
7195
- _: 2
7196
- }, _parent));
7197
- _push(`</li>`);
7198
- });
7199
- _push(`<!--]--><li>`);
7200
- _push(ssrRenderComponent(_component_ALink, {
7201
- href: $props.page < $setup.totalPages ? `?p=${$props.page + 1}` : null,
7202
- onClick: ($event) => $props.page < $setup.totalPages && $setup.emit("update:page", $props.page + 1),
7203
- class: ["ml-1 block min-w-9 rounded border px-3", $props.page < $setup.totalPages ? "border-base-100 hover:bg-base-100" : "border-transparent text-base-500"]
7204
- }, {
7205
- default: withCtx((_, _push2, _parent2, _scopeId) => {
7206
- if (_push2) {
7207
- _push2(`<span class="mr-1.5 hidden md:inline"${_scopeId}>${ssrInterpolate("Pr\xF3ximo")}</span><i class="i-arrow-right"${_scopeId}></i>`);
7208
- } else {
7209
- return [
7210
- createVNode("span", { class: "mr-1.5 hidden md:inline" }, toDisplayString("Pr\xF3ximo")),
7211
- createVNode("i", { class: "i-arrow-right" })
7212
- ];
7213
- }
7214
- }),
7215
- _: 1
7216
- }, _parent));
7217
- _push(`</li></ol>`);
7218
- }
7219
- const _sfc_setup$2 = _sfc_main$2.setup;
7220
- _sfc_main$2.setup = (props, ctx) => {
7221
- const ssrContext = useSSRContext();
7222
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/Pagination.vue");
7223
- return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
8134
+ return _sfc_setup$4 ? _sfc_setup$4(props, ctx) : void 0;
7224
8135
  };
7225
- const Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["ssrRender", _sfc_ssrRender$2]]);
8136
+ const ProductSpecifications = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["ssrRender", _sfc_ssrRender$4]]);
7226
8137
 
7227
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
8138
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
7228
8139
  __name: "SearchFilters",
7229
8140
  props: {
7230
8141
  searchEngine: {},
@@ -7250,7 +8161,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
7250
8161
  return __returned__;
7251
8162
  }
7252
8163
  });
7253
- function _sfc_ssrRender$1(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
8164
+ function _sfc_ssrRender$3(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
7254
8165
  _push(`<aside${ssrRenderAttrs(mergeProps({ class: "bg-base-50/40 h-screen overflow-y-auto" }, _attrs))}><header class="px-6 pb-3 pt-5 text-center">`);
7255
8166
  if ($setup.filtersCount) {
7256
8167
  _push(`<button class="ui-btn-sm ui-btn-danger py-1">${ssrInterpolate("Limpar filtros")} <i class="i-trash ml-0.5"></i></button>`);
@@ -7384,15 +8295,15 @@ function _sfc_ssrRender$1(_ctx, _push, _parent, _attrs, $props, $setup, $data, $
7384
8295
  }
7385
8296
  _push(`</aside>`);
7386
8297
  }
7387
- const _sfc_setup$1 = _sfc_main$1.setup;
7388
- _sfc_main$1.setup = (props, ctx) => {
8298
+ const _sfc_setup$3 = _sfc_main$3.setup;
8299
+ _sfc_main$3.setup = (props, ctx) => {
7389
8300
  const ssrContext = useSSRContext();
7390
8301
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/SearchFilters.vue");
7391
- return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
8302
+ return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
7392
8303
  };
7393
- const SearchFilters = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["ssrRender", _sfc_ssrRender$1]]);
8304
+ const SearchFilters = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["ssrRender", _sfc_ssrRender$3]]);
7394
8305
 
7395
- const _sfc_main = /* @__PURE__ */ defineComponent({
8306
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
7396
8307
  __name: "SearchShowcase",
7397
8308
  props: {
7398
8309
  term: {},
@@ -7441,7 +8352,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
7441
8352
  return __returned__;
7442
8353
  }
7443
8354
  });
7444
- function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
8355
+ function _sfc_ssrRender$2(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
7445
8356
  const _component_Skeleton = resolveComponent("Skeleton");
7446
8357
  const _component_Fade = resolveComponent("Fade");
7447
8358
  _push(`<!--[-->`);
@@ -7873,17 +8784,103 @@ function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $op
7873
8784
  }, _parent));
7874
8785
  _push(`<!--]-->`);
7875
8786
  }
8787
+ const _sfc_setup$2 = _sfc_main$2.setup;
8788
+ _sfc_main$2.setup = (props, ctx) => {
8789
+ const ssrContext = useSSRContext();
8790
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/SearchShowcase.vue");
8791
+ return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
8792
+ };
8793
+ const SearchShowcase = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["ssrRender", _sfc_ssrRender$2]]);
8794
+
8795
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
8796
+ __name: "PageTitle",
8797
+ props: {
8798
+ apiDoc: { default: () => globalThis.$storefront.apiContext?.doc },
8799
+ title: {},
8800
+ description: {}
8801
+ },
8802
+ setup(__props, { expose: __expose }) {
8803
+ __expose();
8804
+ const props = __props;
8805
+ const title = computed(() => {
8806
+ return props.title || props.apiDoc?.name;
8807
+ });
8808
+ const logo = computed(() => {
8809
+ return props.apiDoc?.logo;
8810
+ });
8811
+ const description = computed(() => {
8812
+ return props.description || props.apiDoc?.short_description;
8813
+ });
8814
+ const __returned__ = { props, title, logo, description };
8815
+ Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
8816
+ return __returned__;
8817
+ }
8818
+ });
8819
+ function _sfc_ssrRender$1(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
8820
+ const _component_AImg = resolveComponent("AImg");
8821
+ if ($setup.title) {
8822
+ _push(`<section${ssrRenderAttrs(mergeProps({ class: "ui-section" }, _attrs))}><div class="flex items-center gap-4">`);
8823
+ if ($setup.logo) {
8824
+ _push(ssrRenderComponent(_component_AImg, {
8825
+ picture: $setup.logo,
8826
+ alt: $setup.logo.alt || $setup.title,
8827
+ class: "h-auto max-w-[150px] xl:max-w-[200px]"
8828
+ }, null, _parent));
8829
+ } else {
8830
+ _push(`<!---->`);
8831
+ }
8832
+ _push(`<h1 class="ui-title">${ssrInterpolate($setup.title)}</h1></div><div class="prose">`);
8833
+ if ($setup.description) {
8834
+ _push(`<p>${ssrInterpolate($setup.description)}</p>`);
8835
+ } else {
8836
+ _push(`<!---->`);
8837
+ }
8838
+ _push(`</div></section>`);
8839
+ } else {
8840
+ _push(`<!---->`);
8841
+ }
8842
+ }
8843
+ const _sfc_setup$1 = _sfc_main$1.setup;
8844
+ _sfc_main$1.setup = (props, ctx) => {
8845
+ const ssrContext = useSSRContext();
8846
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/PageTitle.vue");
8847
+ return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
8848
+ };
8849
+ const PageTitle = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["ssrRender", _sfc_ssrRender$1]]);
8850
+
8851
+ const _sfc_main = /* @__PURE__ */ defineComponent({
8852
+ __name: "ContentEntry",
8853
+ props: {
8854
+ title: {},
8855
+ markdown: {}
8856
+ },
8857
+ setup(__props, { expose: __expose }) {
8858
+ __expose();
8859
+ const props = __props;
8860
+ const html = computed(() => micromark(props.markdown, {
8861
+ allowDangerousHtml: true
8862
+ }));
8863
+ const __returned__ = { props, html, ContentClearfix };
8864
+ Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
8865
+ return __returned__;
8866
+ }
8867
+ });
8868
+ function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
8869
+ _push(`<section${ssrRenderAttrs(mergeProps({ class: "ui-section" }, _attrs))}><article class="prose"><h1 class="ui-title not-prose my-4">${ssrInterpolate($props.title)}</h1>`);
8870
+ _push(ssrRenderComponent($setup["ContentClearfix"], { html: $setup.html }, null, _parent));
8871
+ _push(`</article></section>`);
8872
+ }
7876
8873
  const _sfc_setup = _sfc_main.setup;
7877
8874
  _sfc_main.setup = (props, ctx) => {
7878
8875
  const ssrContext = useSSRContext();
7879
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/SearchShowcase.vue");
8876
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/ContentEntry.vue");
7880
8877
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
7881
8878
  };
7882
- const SearchShowcase = /* @__PURE__ */ _export_sfc(_sfc_main, [["ssrRender", _sfc_ssrRender]]);
8879
+ const ContentEntry = /* @__PURE__ */ _export_sfc(_sfc_main, [["ssrRender", _sfc_ssrRender]]);
7883
8880
 
7884
- const $$Astro$3 = createAstro("https://demo.ecomplus.app");
8881
+ const $$Astro$2 = createAstro("https://demo.ecomplus.app");
7885
8882
  const $$Sections = createComponent(async ($$result, $$props, $$slots) => {
7886
- const Astro2 = $$result.createAstro($$Astro$3, $$props, $$slots);
8883
+ const Astro2 = $$result.createAstro($$Astro$2, $$props, $$slots);
7887
8884
  Astro2.self = $$Sections;
7888
8885
  const { routeContext } = Astro2.locals;
7889
8886
  const { sections } = await usePageSections({
@@ -7894,19 +8891,19 @@ const $$Sections = createComponent(async ($$result, $$props, $$slots) => {
7894
8891
  return { props: content };
7895
8892
  }
7896
8893
  });
7897
- const { isHomepage } = routeContext;
7898
- return renderTemplate`${maybeRenderHead()}<article class="mt-6 mb-9 md:mt-8 md:mb-12">
7899
- ${sections.map(async ({ type, props }) => {
8894
+ const { cmsContent } = routeContext;
8895
+ return renderTemplate`${maybeRenderHead()}<article class="mb-9 mt-6 md:mb-12 md:mt-8">
8896
+ ${sections.map(async ({ type, props }, index) => {
7900
8897
  switch (type) {
7901
8898
  case "product-shelf":
7902
- return isHomepage ? renderTemplate`${renderComponent($$result, "ProductShelf", ProductShelf, { ...props, "client:idle": true, "client:component-hydration": "idle", "client:component-path": "~/components/ProductShelf.vue", "client:component-export": "default" })}` : renderTemplate`${renderComponent($$result, "ProductShelf", ProductShelf, { ...props, "client:visible": true, "client:component-hydration": "visible", "client:component-path": "~/components/ProductShelf.vue", "client:component-export": "default" })}`;
8899
+ return index === 0 || index < 2 && !cmsContent?.hero?.slides.length ? renderTemplate`${renderComponent($$result, "ProductShelf", ProductShelf, { ...props, "client:idle": true, "client:component-hydration": "idle", "client:component-path": "~/components/ProductShelf.vue", "client:component-export": "default" })}` : renderTemplate`${renderComponent($$result, "ProductShelf", ProductShelf, { ...props, "client:visible": true, "client:component-hydration": "visible", "client:component-path": "~/components/ProductShelf.vue", "client:component-export": "default" })}`;
7903
8900
  case "related-products":
7904
8901
  props.isRelatedProducts = true;
7905
8902
  return renderTemplate`${renderComponent($$result, "ProductShelf", ProductShelf, { ...props, "client:visible": true, "client:component-hydration": "visible", "client:component-path": "~/components/ProductShelf.vue", "client:component-export": "default" })}`;
7906
8903
  case "banners-grid":
7907
8904
  return renderTemplate`${renderComponent($$result, "BannersGrid", $$BannersGrid, { ...props })}`;
7908
8905
  case "breadcrumbs":
7909
- return renderTemplate`${renderComponent($$result, "Breadcrumbs", $$Breadcrumbs, {})}`;
8906
+ return renderTemplate`${renderComponent($$result, "Breadcrumbs", Breadcrumbs, {})}`;
7910
8907
  case "doc-description":
7911
8908
  return renderTemplate`${renderComponent($$result, "DocDescription", DocDescription, {})}`;
7912
8909
  case "doc-banners":
@@ -7923,6 +8920,12 @@ const $$Sections = createComponent(async ($$result, $$props, $$slots) => {
7923
8920
  ${renderComponent($$result2, "SearchShowcase", SearchShowcase, { ...props, "client:context": true, "client:component-hydration": "context", "client:component-path": "~/components/SearchShowcase.vue", "client:component-export": "default" })}
7924
8921
  </article>
7925
8922
  ` })}`;
8923
+ case "page-title":
8924
+ return renderTemplate`${renderComponent($$result, "PageTitle", PageTitle, { ...props })}`;
8925
+ case "content-entry":
8926
+ return renderTemplate`${renderComponent($$result, "ContentEntry", ContentEntry, { ...props })}`;
8927
+ case "custom-html":
8928
+ return renderTemplate`${renderComponent($$result, "ContentClearfix", ContentClearfix, { "html": props.html })}`;
7926
8929
  case "c:foo":
7927
8930
  return renderTemplate`<div${addAttribute(props.foo, "data-foo")}></div>`;
7928
8931
  default:
@@ -7930,51 +8933,69 @@ const $$Sections = createComponent(async ($$result, $$props, $$slots) => {
7930
8933
  }
7931
8934
  })}
7932
8935
  </article>`;
7933
- }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/main/Sections.astro", void 0);
7934
-
7935
- var __freeze = Object.freeze;
7936
- var __defProp = Object.defineProperty;
7937
- var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(raw || cooked.slice()) }));
7938
- var _a;
7939
- const $$Astro$2 = createAstro("https://demo.ecomplus.app");
7940
- const $$SharedData = createComponent(async ($$result, $$props, $$slots) => {
7941
- const Astro2 = $$result.createAstro($$Astro$2, $$props, $$slots);
7942
- Astro2.self = $$SharedData;
7943
- const { getInlineClientJS } = await useSharedData(Astro2.props);
7944
- return renderTemplate(_a || (_a = __template(["<script>", "<\/script>"])), unescapeHTML(getInlineClientJS()));
7945
- }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/components/SharedData.astro", void 0);
8936
+ }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/main/content/Sections.astro", void 0);
7946
8937
 
7947
8938
  const $$Astro$1 = createAstro("https://demo.ecomplus.app");
7948
- const $$Wildcard = createComponent(async ($$result, $$props, $$slots) => {
8939
+ const $$Main = createComponent(async ($$result, $$props, $$slots) => {
7949
8940
  const Astro2 = $$result.createAstro($$Astro$1, $$props, $$slots);
7950
- Astro2.self = $$Wildcard;
7951
- const { fetchingApiContext } = Astro2.locals.routeContext;
7952
- const [
7953
- { data: { result: grids } }
7954
- ] = await Promise.all([
7955
- api.get("grids"),
7956
- fetchingApiContext
7957
- ]);
8941
+ Astro2.self = $$Main;
8942
+ const { routeContext } = Astro2.locals;
8943
+ const { isSearchPage, fetchingApiContext } = routeContext;
8944
+ const sharedData = {};
8945
+ if (isSearchPage || fetchingApiContext) {
8946
+ const [
8947
+ { data: { result: grids } }
8948
+ ] = await Promise.all([
8949
+ api.get("grids"),
8950
+ fetchingApiContext
8951
+ ]);
8952
+ sharedData.grids = grids;
8953
+ }
7958
8954
  return renderTemplate`${maybeRenderHead()}<main>
7959
- ${renderComponent($$result, "SharedData", $$SharedData, { "field": "grids", "value": grids })}
8955
+ ${Object.entries(sharedData).map(([field, value]) => renderTemplate`${renderComponent($$result, "SharedData", $$SharedData, { "field": field, "value": value })}`)}
8956
+ ${renderComponent($$result, "Hero", $$Hero, {})}
7960
8957
  ${renderComponent($$result, "Sections", $$Sections, {})}
7961
8958
  </main>`;
7962
- }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/main/Wildcard.astro", void 0);
8959
+ }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/main/Main.astro", void 0);
7963
8960
 
7964
8961
  const $$Astro = createAstro("https://demo.ecomplus.app");
7965
8962
  async function getStaticPaths() {
7966
- return (await api.get("products?sort=-sales&limit=4&fields=slug")).data.result.map(({ slug }) => ({ params: { slug } }));
8963
+ const paths = [{
8964
+ params: { slug: void 0 }
8965
+ }];
8966
+ if (!{"BASE_URL": "/", "MODE": "production", "DEV": false, "PROD": true, "SSR": true, "SITE": "https://demo.ecomplus.app", "ASSETS_PREFIX": undefined}.BUILD_MINIMAL) {
8967
+ const { data } = await api.get("products?sort=-sales&fields=slug&limit=2");
8968
+ data.result.forEach(({ slug }) => {
8969
+ if (slug)
8970
+ paths.push({ params: { slug } });
8971
+ });
8972
+ const pageSlugs = await getConfig().getContent("extra-pages/");
8973
+ const postSlugs = await getConfig().getContent("blog/");
8974
+ pageSlugs.slice(0, 2).map((slug) => `p/${slug}`).concat(postSlugs.slice(0, 2).map((slug) => `posts/${slug}`)).forEach((slug) => {
8975
+ paths.push({ params: { slug } });
8976
+ });
8977
+ }
8978
+ return paths;
7967
8979
  }
7968
8980
  const $$ = createComponent(async ($$result, $$props, $$slots) => {
7969
8981
  const Astro2 = $$result.createAstro($$Astro, $$props, $$slots);
7970
8982
  Astro2.self = $$;
7971
- if (String(Astro2.params.slug).endsWith(".css.map")) {
8983
+ let slug = Astro2.params.slug || "";
8984
+ if (slug.endsWith(".map")) {
7972
8985
  return new Response(null, { status: 404 });
7973
8986
  }
8987
+ let contentCollection;
8988
+ if (slug.startsWith("p/")) {
8989
+ contentCollection = "extra-pages";
8990
+ Astro2.params.slug = slug.replace(/^p\//, "");
8991
+ } else if (slug.startsWith("posts/")) {
8992
+ contentCollection = "blog";
8993
+ Astro2.params.slug = slug.replace(/^posts\//, "");
8994
+ }
7974
8995
  let routeContext;
7975
8996
  let loadError;
7976
8997
  try {
7977
- routeContext = await loadRouteContext(Astro2);
8998
+ routeContext = await loadRouteContext(Astro2, { contentCollection });
7978
8999
  } catch (err) {
7979
9000
  if (err.astroResponse) {
7980
9001
  return err.astroResponse;
@@ -7985,13 +9006,12 @@ const $$ = createComponent(async ($$result, $$props, $$slots) => {
7985
9006
  ${routeContext && renderTemplate`${renderComponent($$result, "Base", $$Base, {}, { "base-head": ($$result2) => renderTemplate`${renderComponent($$result2, "BaseHead", $$BaseHead, { "slot": "base-head" })}`, "default": ($$result2) => renderTemplate`
7986
9007
 
7987
9008
  ${renderComponent($$result2, "PageHeader", $$PageHeader, {})}
7988
- ${renderComponent($$result2, "WildcardMain", $$Wildcard, {})}
9009
+ ${renderComponent($$result2, "Main", $$Main, {})}
7989
9010
  ${renderComponent($$result2, "PageFooter", $$PageFooter, {})}
7990
9011
  ` })}`}
7991
9012
  ${loadError && renderTemplate`${renderComponent($$result, "Fragment", Fragment, {}, { "default": ($$result2) => renderTemplate`${unescapeHTML(loadError.responseHTML)}` })}`}
7992
9013
  </html>`;
7993
9014
  }, "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro", void 0);
7994
-
7995
9015
  const $$file = "/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro";
7996
9016
  const $$url = "/[...slug]";
7997
9017
 
@@ -8003,4 +9023,4 @@ const ____slug_ = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty(
8003
9023
  url: $$url
8004
9024
  }, Symbol.toStringTag, { value: 'Module' }));
8005
9025
 
8006
- export { $$BaseHead as $, Banner as B, CheckoutLink as C, FooterStamps as F, ProductShelf as P, QuantitySelector as Q, SearchEngine as S, _export_sfc as _, $$Picture as a, $$Base as b, $$BannerPictures as c, $$Sections as d, $$PageHeader as e, $$PageFooter as f, assetsDir as g, clearAccents as h, imageConfig as i, getSearchUrl as j, Prices as k, loadRouteContext as l, freeShippingFromValue as m, shoppingCart as n, ____slug_ as o, parseProduct as p, removeCartItem as r, searchHistory as s, totalItems as t, usePageHero as u };
9026
+ export { $$BaseHead as $, ____slug_ as A, CheckoutLink as C, FooterStamps as F, Pagination as P, QuantitySelector as Q, SearchEngine as S, _export_sfc as _, $$PageHeader as a, $$PageFooter as b, $$Base as c, $$Picture as d, i19shoppingCart as e, imageConfig as f, getConfig as g, assetsDir as h, i19myAccount as i, i19error as j, i19errorMsg as k, loadRouteContext as l, i19notFound as m, i19home as n, mod as o, createApp as p, clearAccents as q, getSearchUrl as r, searchHistory as s, ProductShelf as t, parseProduct as u, removeCartItem as v, Prices as w, freeShippingFromValue as x, shoppingCart as y, totalItems as z };