cloudcommerce 2.0.7 → 2.0.9

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 (168) hide show
  1. package/.husky/pre-commit +4 -0
  2. package/.vscode/settings.json +8 -2
  3. package/CHANGELOG.md +20 -0
  4. package/action.yml +1 -1
  5. package/ecomplus-stores/barra-doce/.husky/pre-commit +4 -0
  6. package/ecomplus-stores/barra-doce/.vscode/settings.json +3 -2
  7. package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
  8. package/ecomplus-stores/barra-doce/functions/ssr/.staged.eslintrc.cjs +6 -0
  9. package/ecomplus-stores/barra-doce/functions/ssr/package.json +9 -8
  10. package/ecomplus-stores/barra-doce/functions/ssr/src/components/AccountMenu.vue +4 -1
  11. package/ecomplus-stores/barra-doce/functions/ssr/src/components/AccountPage.vue +6 -3
  12. package/ecomplus-stores/barra-doce/functions/ssr/src/components/Banner.vue +2 -1
  13. package/ecomplus-stores/barra-doce/functions/ssr/src/components/BlogPosts.vue +8 -2
  14. package/ecomplus-stores/barra-doce/functions/ssr/src/components/Breadcrumbs.vue +4 -1
  15. package/ecomplus-stores/barra-doce/functions/ssr/src/components/CartItem.vue +4 -3
  16. package/ecomplus-stores/barra-doce/functions/ssr/src/components/CartSidebar.vue +1 -1
  17. package/ecomplus-stores/barra-doce/functions/ssr/src/components/CheckoutPage.vue +2 -2
  18. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ContentEntry.vue +1 -1
  19. package/ecomplus-stores/barra-doce/functions/ssr/src/components/FooterStamps.vue +8 -6
  20. package/ecomplus-stores/barra-doce/functions/ssr/src/components/HeroSlider.vue +7 -3
  21. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ImagesGallery.vue +13 -11
  22. package/ecomplus-stores/barra-doce/functions/ssr/src/components/LoginForm.vue +1 -1
  23. package/ecomplus-stores/barra-doce/functions/ssr/src/components/PitchBar.vue +5 -2
  24. package/ecomplus-stores/barra-doce/functions/ssr/src/components/Prices.vue +1 -1
  25. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ProductCard.vue +13 -13
  26. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ProductDetails.vue +1 -1
  27. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ProductShelf.vue +9 -6
  28. package/ecomplus-stores/barra-doce/functions/ssr/src/components/SearchModal.vue +1 -1
  29. package/ecomplus-stores/barra-doce/functions/ssr/src/components/SearchShowcase.vue +8 -9
  30. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopFooter.vue +15 -6
  31. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopHeader.vue +10 -10
  32. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopHeaderMenu.vue +2 -1
  33. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopHeaderSubmenu.vue +7 -4
  34. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopSidenav.vue +5 -2
  35. package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopSidenavCategory.vue +3 -2
  36. package/ecomplus-stores/barra-doce/functions/ssr/src/components/SkuSelector.vue +8 -5
  37. package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/PageFooter.astro +1 -2
  38. package/ecomplus-stores/barra-doce/functions/ssr/src/layouts/PageHeader.astro +2 -1
  39. package/ecomplus-stores/barra-doce/functions/ssr/src/main/Fallback.astro +3 -3
  40. package/ecomplus-stores/barra-doce/functions/ssr/src/main/Main.astro +2 -2
  41. package/ecomplus-stores/barra-doce/functions/ssr/src/pages/[...slug].astro +4 -4
  42. package/ecomplus-stores/barra-doce/functions/ssr/src/scripts/InlineScripts.astro +8 -8
  43. package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
  44. package/ecomplus-stores/barra-doce/package.json +10 -3
  45. package/ecomplus-stores/barra-doce/tailwind.config.cjs +5 -0
  46. package/ecomplus-stores/tia-sonia/.vscode/launch.json +11 -0
  47. package/ecomplus-stores/tia-sonia/.vscode/settings.json +7 -1
  48. package/package.json +9 -4
  49. package/packages/api/package.json +1 -1
  50. package/packages/apps/affiliate-program/package.json +1 -1
  51. package/packages/apps/correios/package.json +2 -2
  52. package/packages/apps/custom-payment/package.json +1 -1
  53. package/packages/apps/custom-shipping/package.json +1 -1
  54. package/packages/apps/datafrete/package.json +1 -1
  55. package/packages/apps/discounts/package.json +1 -1
  56. package/packages/apps/emails/package.json +1 -1
  57. package/packages/apps/fb-conversions/package.json +1 -1
  58. package/packages/apps/flash-courier/package.json +1 -1
  59. package/packages/apps/frenet/package.json +1 -1
  60. package/packages/apps/galaxpay/package.json +1 -1
  61. package/packages/apps/google-analytics/package.json +1 -1
  62. package/packages/apps/jadlog/package.json +1 -1
  63. package/packages/apps/loyalty-points/package.json +1 -1
  64. package/packages/apps/mandae/package.json +1 -1
  65. package/packages/apps/melhor-envio/package.json +1 -1
  66. package/packages/apps/mercadopago/package.json +1 -1
  67. package/packages/apps/pagarme/package.json +1 -1
  68. package/packages/apps/pagarme-v5/package.json +1 -1
  69. package/packages/apps/paghiper/package.json +1 -1
  70. package/packages/apps/pix/package.json +1 -1
  71. package/packages/apps/tiny-erp/package.json +1 -1
  72. package/packages/apps/webhooks/package.json +1 -1
  73. package/packages/cli/package.json +1 -1
  74. package/packages/config/package.json +1 -1
  75. package/packages/emails/package.json +1 -1
  76. package/packages/eslint/base.eslintrc.cjs +3 -4
  77. package/packages/eslint/package.json +6 -5
  78. package/packages/eslint/storefront.eslintrc.cjs +19 -2
  79. package/packages/eslint/storefront.staged.eslintrc.cjs +9 -0
  80. package/packages/events/package.json +1 -1
  81. package/packages/feeds/package.json +1 -1
  82. package/packages/firebase/package.json +2 -2
  83. package/packages/i18n/package.json +1 -1
  84. package/packages/modules/package.json +2 -2
  85. package/packages/passport/package.json +1 -1
  86. package/packages/ssr/package.json +5 -5
  87. package/packages/storefront/dist/client/_astro/{AccountPage.oxrx8xO0.js → AccountPage.9BlGHXT3.js} +1 -1
  88. package/packages/storefront/dist/client/_astro/CartSidebar.55UgTcV0.js +1 -0
  89. package/packages/storefront/dist/client/_astro/{HeroSlider.OYdereCn.js → HeroSlider.XZb2xsyV.js} +1 -1
  90. package/packages/storefront/dist/client/_astro/{PitchBar.RVEArMQA.js → PitchBar.Nr7T3S3T.js} +1 -1
  91. package/packages/storefront/dist/client/_astro/{Prices.Bsod-tLh.js → Prices.Ye-m2HTo.js} +1 -1
  92. package/packages/storefront/dist/client/_astro/ProductDetails.ENLKdSz_.js +7 -0
  93. package/packages/storefront/dist/client/_astro/ProductShelf.CNf5JDrU.js +1 -0
  94. package/packages/storefront/dist/client/_astro/ProductShelf.lCBJky3e.js +1 -0
  95. package/packages/storefront/dist/client/_astro/{QuantitySelector.SEAsIOhe.js → QuantitySelector.tumfWDjC.js} +1 -1
  96. package/packages/storefront/dist/client/_astro/{SearchModal.JVuqMQFe.js → SearchModal.4osqtafp.js} +1 -1
  97. package/packages/storefront/dist/client/_astro/{SearchShowcase.zwEq0xsL.js → SearchShowcase.hg6TWrz3.js} +1 -1
  98. package/packages/storefront/dist/client/_astro/ShopHeader.xLMeJpqV.js +7 -0
  99. package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.SO-0jCqa.js +5 -0
  100. package/packages/storefront/dist/client/_astro/_slug_.r344YGqG.css +1 -0
  101. package/packages/storefront/dist/client/_astro/client.ZhEmw4hZ.js +1 -0
  102. package/packages/storefront/dist/client/_astro/{customer-session.yn5lG3w3.js → customer-session.hXdZh5Ii.js} +1 -1
  103. package/packages/storefront/dist/client/_astro/{format-money.ykh8O7d2.js → format-money.iK5LGydz.js} +1 -1
  104. package/packages/storefront/dist/client/_astro/{grid-title.z5ui_5pL.js → grid-title.vGKBy72g.js} +1 -1
  105. package/packages/storefront/dist/client/_astro/{hoisted.hpPOAcMM.js → hoisted.HGTzAuTI.js} +1 -1
  106. package/packages/storefront/dist/client/_astro/{hoisted.daSrX1-i.js → hoisted.J15ErMtK.js} +1 -1
  107. package/packages/storefront/dist/client/_astro/hoisted.KYhwGfsv.js +1 -0
  108. package/packages/storefront/dist/client/_astro/{i18n.MycOopxQ.js → i18n.Lxnz1oF-.js} +1 -1
  109. package/packages/storefront/dist/client/_astro/{img.c2KI4eO6.js → img.WnsidxCx.js} +1 -1
  110. package/packages/storefront/dist/client/_astro/{index.NRzvVgQf.js → index.R7A-Pg5V.js} +1 -1
  111. package/packages/storefront/dist/client/_astro/{index.8acAQSHW.js → index.q6KIyKlJ.js} +1 -1
  112. package/packages/storefront/dist/client/_astro/{modules-info.dHD0h8Nc.js → modules-info.tVRhvxNm.js} +1 -1
  113. package/packages/storefront/dist/client/_astro/name.urFqJ5yn.js +1 -0
  114. package/packages/storefront/dist/client/_astro/runtime-core.esm-bundler.XTSAdOlw.js +13 -0
  115. package/packages/storefront/dist/client/_astro/sf-utils.Z4H-dRBJ.js +1 -0
  116. package/packages/storefront/dist/client/_astro/{shopping-cart.MgpVRgys.js → shopping-cart.ZdSCrjS6.js} +1 -1
  117. package/packages/storefront/dist/client/_astro/{use-analytics.D9xd-k7D.js → use-analytics.tCrQbW8O.js} +1 -1
  118. package/packages/storefront/dist/client/_astro/{use-product-card.gKh9czSW.js → use-product-card.-9TsgDDW.js} +1 -1
  119. package/packages/storefront/dist/client/_astro/use-text-value.XE_A2nDM.js +4 -0
  120. package/packages/storefront/dist/server/chunks/{CartSidebar_8VAKl-jR.mjs → CartSidebar_7UWmGIF6.mjs} +5 -5
  121. package/packages/storefront/dist/server/chunks/{SearchModal_7debttOi.mjs → SearchModal_MNdcYMws.mjs} +4 -4
  122. package/packages/storefront/dist/server/chunks/{_.._D6rq0cLa.mjs → _.._h5R83hoK.mjs} +1 -1
  123. package/packages/storefront/dist/server/chunks/{_page__WXDIwV7g.mjs → _page__lWVlZyRe.mjs} +1 -1
  124. package/packages/storefront/dist/server/chunks/{account_DOT2RzND.mjs → account_jmelxnlw.mjs} +1 -1
  125. package/packages/storefront/dist/server/chunks/astro/{assets-service_gJYJeEDH.mjs → assets-service_xNulQtBO.mjs} +1 -1
  126. package/packages/storefront/dist/server/chunks/{astro_H-6uiAAG.mjs → astro_tggR3S_9.mjs} +2 -2
  127. package/packages/storefront/dist/server/chunks/{index_eXlHIU83.mjs → index_e3ytAL8v.mjs} +1 -1
  128. package/packages/storefront/dist/server/chunks/{node_-eQO2yOn.mjs → node_kUJIRL0c.mjs} +1 -1
  129. package/packages/storefront/dist/server/chunks/pages/{__fI3NeWvy.mjs → __wihn0dYD.mjs} +864 -856
  130. package/packages/storefront/dist/server/chunks/pages/{_page__Piz8geXW.mjs → _page__Sb1eYhpz.mjs} +2 -2
  131. package/packages/storefront/dist/server/chunks/pages/{account_6pD7OYw-.mjs → account_-mULVQUB.mjs} +2 -2
  132. package/packages/storefront/dist/server/chunks/pages/{index_2F5yi6YO.mjs → index_mQXYNYRg.mjs} +4 -4
  133. package/packages/storefront/dist/server/chunks/pages/{node_-Buhxl8v.mjs → node_-qe5LuQh.mjs} +3 -3
  134. package/packages/storefront/dist/server/chunks/pages/{~fallback_okEL1qQ3.mjs → ~fallback_ad_xyGHU.mjs} +4 -4
  135. package/packages/storefront/dist/server/chunks/~fallback_EZqiEAFE.mjs +6 -0
  136. package/packages/storefront/dist/server/entry.mjs +376 -307
  137. package/packages/storefront/dist/server/manifest_RrmXPEuL.mjs +196 -0
  138. package/packages/storefront/dist/server/renderers.mjs +1 -1
  139. package/packages/storefront/package.json +7 -6
  140. package/packages/storefront/src/helpers/server-data.ts +2 -1
  141. package/packages/storefront/src/lib/components/BannerPictures.astro +7 -6
  142. package/packages/storefront/src/lib/components/CarouselControl.vue +2 -2
  143. package/packages/storefront/src/lib/components/ContentClearfix.vue +1 -1
  144. package/packages/storefront/src/lib/components/Drawer.vue +2 -2
  145. package/packages/storefront/src/lib/components/Picture.astro +2 -2
  146. package/packages/storefront/src/lib/components/QuantitySelectorControl.vue +2 -2
  147. package/packages/storefront/src/lib/components/ViewTransitions.astro +1 -0
  148. package/packages/storefront/src/lib/layouts/BaseBody.astro +3 -3
  149. package/packages/storefront/src/lib/layouts/BaseHead.astro +29 -29
  150. package/packages/storefront/src/lib/pages/_vue.ts +3 -2
  151. package/packages/test-base/package.json +1 -1
  152. package/packages/types/package.json +1 -1
  153. package/tailwind.config.cjs +5 -0
  154. package/packages/storefront/dist/client/_astro/CartSidebar.ShqcM66P.js +0 -1
  155. package/packages/storefront/dist/client/_astro/ProductDetails.TQM36pzk.js +0 -7
  156. package/packages/storefront/dist/client/_astro/ProductShelf.HX1P9sTW.js +0 -1
  157. package/packages/storefront/dist/client/_astro/ProductShelf._0iHMZBO.js +0 -1
  158. package/packages/storefront/dist/client/_astro/ShopHeader.BoPmUmjI.js +0 -7
  159. package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.40kDRyEO.js +0 -1
  160. package/packages/storefront/dist/client/_astro/_slug_.PTG68eA8.css +0 -1
  161. package/packages/storefront/dist/client/_astro/client.nPN_zw-c.js +0 -1
  162. package/packages/storefront/dist/client/_astro/hoisted.FcmEawNA.js +0 -1
  163. package/packages/storefront/dist/client/_astro/name.itYHl42A.js +0 -1
  164. package/packages/storefront/dist/client/_astro/runtime-core.esm-bundler.Pr2hdd7G.js +0 -1
  165. package/packages/storefront/dist/client/_astro/sf-utils.yjuG8NjM.js +0 -1
  166. package/packages/storefront/dist/client/_astro/use-text-value.ZIz7zsXT.js +0 -4
  167. package/packages/storefront/dist/server/chunks/~fallback_M-xiy2GE.mjs +0 -6
  168. package/packages/storefront/dist/server/manifest_oV2meNKS.mjs +0 -196
@@ -0,0 +1,196 @@
1
+ import '@astrojs/internal-helpers/path';
2
+ import 'cookie';
3
+ import { bold, red, yellow, dim, blue } from 'kleur/colors';
4
+ import 'string-width';
5
+ import './chunks/astro_tggR3S_9.mjs';
6
+ import 'clsx';
7
+ import { compile } from 'path-to-regexp';
8
+
9
+ const dateTimeFormat = new Intl.DateTimeFormat([], {
10
+ hour: "2-digit",
11
+ minute: "2-digit",
12
+ second: "2-digit",
13
+ hour12: false
14
+ });
15
+ const levels = {
16
+ debug: 20,
17
+ info: 30,
18
+ warn: 40,
19
+ error: 50,
20
+ silent: 90
21
+ };
22
+ function log(opts, level, label, message, newLine = true) {
23
+ const logLevel = opts.level;
24
+ const dest = opts.dest;
25
+ const event = {
26
+ label,
27
+ level,
28
+ message,
29
+ newLine
30
+ };
31
+ if (!isLogLevelEnabled(logLevel, level)) {
32
+ return;
33
+ }
34
+ dest.write(event);
35
+ }
36
+ function isLogLevelEnabled(configuredLogLevel, level) {
37
+ return levels[configuredLogLevel] <= levels[level];
38
+ }
39
+ function info(opts, label, message, newLine = true) {
40
+ return log(opts, "info", label, message, newLine);
41
+ }
42
+ function warn(opts, label, message, newLine = true) {
43
+ return log(opts, "warn", label, message, newLine);
44
+ }
45
+ function error(opts, label, message, newLine = true) {
46
+ return log(opts, "error", label, message, newLine);
47
+ }
48
+ function debug(...args) {
49
+ if ("_astroGlobalDebug" in globalThis) {
50
+ globalThis._astroGlobalDebug(...args);
51
+ }
52
+ }
53
+ function getEventPrefix({ level, label }) {
54
+ const timestamp = `${dateTimeFormat.format(/* @__PURE__ */ new Date())}`;
55
+ const prefix = [];
56
+ if (level === "error" || level === "warn") {
57
+ prefix.push(bold(timestamp));
58
+ prefix.push(`[${level.toUpperCase()}]`);
59
+ } else {
60
+ prefix.push(timestamp);
61
+ }
62
+ if (label) {
63
+ prefix.push(`[${label}]`);
64
+ }
65
+ if (level === "error") {
66
+ return red(prefix.join(" "));
67
+ }
68
+ if (level === "warn") {
69
+ return yellow(prefix.join(" "));
70
+ }
71
+ if (prefix.length === 1) {
72
+ return dim(prefix[0]);
73
+ }
74
+ return dim(prefix[0]) + " " + blue(prefix.splice(1).join(" "));
75
+ }
76
+ if (typeof process !== "undefined") {
77
+ let proc = process;
78
+ if ("argv" in proc && Array.isArray(proc.argv)) {
79
+ if (proc.argv.includes("--verbose")) ; else if (proc.argv.includes("--silent")) ; else ;
80
+ }
81
+ }
82
+ class Logger {
83
+ options;
84
+ constructor(options) {
85
+ this.options = options;
86
+ }
87
+ info(label, message, newLine = true) {
88
+ info(this.options, label, message, newLine);
89
+ }
90
+ warn(label, message, newLine = true) {
91
+ warn(this.options, label, message, newLine);
92
+ }
93
+ error(label, message, newLine = true) {
94
+ error(this.options, label, message, newLine);
95
+ }
96
+ debug(label, ...messages) {
97
+ debug(label, ...messages);
98
+ }
99
+ level() {
100
+ return this.options.level;
101
+ }
102
+ forkIntegrationLogger(label) {
103
+ return new AstroIntegrationLogger(this.options, label);
104
+ }
105
+ }
106
+ class AstroIntegrationLogger {
107
+ options;
108
+ label;
109
+ constructor(logging, label) {
110
+ this.options = logging;
111
+ this.label = label;
112
+ }
113
+ /**
114
+ * Creates a new logger instance with a new label, but the same log options.
115
+ */
116
+ fork(label) {
117
+ return new AstroIntegrationLogger(this.options, label);
118
+ }
119
+ info(message) {
120
+ info(this.options, this.label, message);
121
+ }
122
+ warn(message) {
123
+ warn(this.options, this.label, message);
124
+ }
125
+ error(message) {
126
+ error(this.options, this.label, message);
127
+ }
128
+ debug(message) {
129
+ debug(this.label, message);
130
+ }
131
+ }
132
+
133
+ function getRouteGenerator(segments, addTrailingSlash) {
134
+ const template = segments.map((segment) => {
135
+ return "/" + segment.map((part) => {
136
+ if (part.spread) {
137
+ return `:${part.content.slice(3)}(.*)?`;
138
+ } else if (part.dynamic) {
139
+ return `:${part.content}`;
140
+ } else {
141
+ return part.content.normalize().replace(/\?/g, "%3F").replace(/#/g, "%23").replace(/%5B/g, "[").replace(/%5D/g, "]").replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
142
+ }
143
+ }).join("");
144
+ }).join("");
145
+ let trailing = "";
146
+ if (addTrailingSlash === "always" && segments.length) {
147
+ trailing = "/";
148
+ }
149
+ const toPath = compile(template + trailing);
150
+ return toPath;
151
+ }
152
+
153
+ function deserializeRouteData(rawRouteData) {
154
+ return {
155
+ route: rawRouteData.route,
156
+ type: rawRouteData.type,
157
+ pattern: new RegExp(rawRouteData.pattern),
158
+ params: rawRouteData.params,
159
+ component: rawRouteData.component,
160
+ generate: getRouteGenerator(rawRouteData.segments, rawRouteData._meta.trailingSlash),
161
+ pathname: rawRouteData.pathname || void 0,
162
+ segments: rawRouteData.segments,
163
+ prerender: rawRouteData.prerender,
164
+ redirect: rawRouteData.redirect,
165
+ redirectRoute: rawRouteData.redirectRoute ? deserializeRouteData(rawRouteData.redirectRoute) : void 0,
166
+ fallbackRoutes: rawRouteData.fallbackRoutes.map((fallback) => {
167
+ return deserializeRouteData(fallback);
168
+ })
169
+ };
170
+ }
171
+
172
+ function deserializeManifest(serializedManifest) {
173
+ const routes = [];
174
+ for (const serializedRoute of serializedManifest.routes) {
175
+ routes.push({
176
+ ...serializedRoute,
177
+ routeData: deserializeRouteData(serializedRoute.routeData)
178
+ });
179
+ const route = serializedRoute;
180
+ route.routeData = deserializeRouteData(serializedRoute.routeData);
181
+ }
182
+ const assets = new Set(serializedManifest.assets);
183
+ const componentMetadata = new Map(serializedManifest.componentMetadata);
184
+ const clientDirectives = new Map(serializedManifest.clientDirectives);
185
+ return {
186
+ ...serializedManifest,
187
+ assets,
188
+ componentMetadata,
189
+ clientDirectives,
190
+ routes
191
+ };
192
+ }
193
+
194
+ const manifest = deserializeManifest({"adapterName":"@astrojs/node","routes":[{"file":"","links":[],"scripts":[],"styles":[],"routeData":{"type":"endpoint","isIndex":false,"route":"/_image","pattern":"^\\/_image$","segments":[[{"content":"_image","dynamic":false,"spread":false}]],"params":[],"component":"../../node_modules/.pnpm/astro@4.2.1_@types+node@18.19.7_typescript@5.2.2/node_modules/astro/dist/assets/endpoint/node.js","pathname":"/_image","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.J15ErMtK.js"}],"styles":[{"type":"external","src":"/_astro/_slug_.r344YGqG.css"}],"routeData":{"route":"/app","isIndex":true,"type":"page","pattern":"^\\/app\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/index.astro","pathname":"/app","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.HGTzAuTI.js"}],"styles":[{"type":"external","src":"/_astro/_slug_.r344YGqG.css"}],"routeData":{"route":"/app/account","isIndex":false,"type":"page","pattern":"^\\/app\\/account\\/?$","segments":[[{"content":"app","dynamic":false,"spread":false}],[{"content":"account","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/app/account.astro","pathname":"/app/account","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.HGTzAuTI.js"}],"styles":[{"type":"external","src":"/_astro/_slug_.r344YGqG.css"}],"routeData":{"route":"/blog/[page]","isIndex":false,"type":"page","pattern":"^\\/blog\\/([^/]+?)\\/?$","segments":[[{"content":"blog","dynamic":false,"spread":false}],[{"content":"page","dynamic":true,"spread":false}]],"params":["page"],"component":"src/pages/blog/[page].astro","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.KYhwGfsv.js"}],"styles":[{"type":"external","src":"/_astro/_slug_.r344YGqG.css"}],"routeData":{"route":"/~fallback","isIndex":false,"type":"page","pattern":"^\\/~fallback\\/?$","segments":[[{"content":"~fallback","dynamic":false,"spread":false}]],"params":[],"component":"src/pages/~fallback.astro","pathname":"/~fallback","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}},{"file":"","links":[],"scripts":[{"type":"external","value":"/_astro/hoisted.HGTzAuTI.js"}],"styles":[{"type":"external","src":"/_astro/_slug_.r344YGqG.css"}],"routeData":{"route":"/[...slug]","isIndex":false,"type":"page","pattern":"^(?:\\/(.*?))?\\/?$","segments":[[{"content":"...slug","dynamic":true,"spread":true}]],"params":["...slug"],"component":"src/pages/[...slug].astro","prerender":false,"fallbackRoutes":[],"_meta":{"trailingSlash":"ignore"}}}],"site":"https://demo.ecomplus.app","base":"/","trailingSlash":"ignore","compressHTML":false,"componentMetadata":[["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/layouts/BaseHead.astro",{"propagation":"in-tree","containsHead":false}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/[...slug].astro",{"propagation":"in-tree","containsHead":false}],["\u0000@astro-page:src/pages/[...slug]@_@astro",{"propagation":"in-tree","containsHead":false}],["\u0000@astrojs-ssr-virtual-entry",{"propagation":"in-tree","containsHead":false}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/app/account.astro",{"propagation":"in-tree","containsHead":false}],["\u0000@astro-page:src/pages/app/account@_@astro",{"propagation":"in-tree","containsHead":false}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/app/index.astro",{"propagation":"in-tree","containsHead":false}],["\u0000@astro-page:src/pages/app/index@_@astro",{"propagation":"in-tree","containsHead":false}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/blog/[page].astro",{"propagation":"in-tree","containsHead":false}],["\u0000@astro-page:src/pages/blog/[page]@_@astro",{"propagation":"in-tree","containsHead":false}],["/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/pages/~fallback.astro",{"propagation":"in-tree","containsHead":false}],["\u0000@astro-page:src/pages/~fallback@_@astro",{"propagation":"in-tree","containsHead":false}]],"renderers":[],"clientDirectives":[["idle","(()=>{var i=t=>{let e=async()=>{await(await t())()};\"requestIdleCallback\"in window?window.requestIdleCallback(e):setTimeout(e,200)};(self.Astro||(self.Astro={})).idle=i;window.dispatchEvent(new Event(\"astro:idle\"));})();"],["load","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).load=e;window.dispatchEvent(new Event(\"astro:load\"));})();"],["media","(()=>{var s=(i,t)=>{let a=async()=>{await(await i())()};if(t.value){let e=matchMedia(t.value);e.matches?a():e.addEventListener(\"change\",a,{once:!0})}};(self.Astro||(self.Astro={})).media=s;window.dispatchEvent(new Event(\"astro:media\"));})();"],["only","(()=>{var e=async t=>{await(await t())()};(self.Astro||(self.Astro={})).only=e;window.dispatchEvent(new Event(\"astro:only\"));})();"],["visible","(()=>{var l=(s,i,o)=>{let r=async()=>{await(await s())()},t=typeof i.value==\"object\"?i.value:void 0,c={rootMargin:t==null?void 0:t.rootMargin},n=new IntersectionObserver(e=>{for(let a of e)if(a.isIntersecting){n.disconnect(),r();break}},c);for(let e of o.children)n.observe(e)};(self.Astro||(self.Astro={})).visible=l;window.dispatchEvent(new Event(\"astro:visible\"));})();"],["context","(()=>{var a=(s,o)=>{let n=async()=>{await(await s())()},r=()=>{let t=Array.isArray(o.value)?o.value:[o.value];for(let e=0;e<t.length;e++)if(typeof t[e]==\"string\"&&t[e].startsWith(\"data:\")){let d=t[e].substring(5);if(!window.$storefront?.data?.[d]){window.addEventListener(`storefront:data:${d}`,r,{once:!0});return}}if(t.includes(\"idle\")){if(typeof window.requestIdleCallback==\"function\"){setTimeout(()=>window.requestIdleCallback(n),9);return}setTimeout(n,200);return}n()},i=window.$storefront?.apiContext?.doc._id||null;if(window._firstLoadContextId===i&&window._emitedContextId===i){console.log(\"[ctx] first load\"),r(),document.addEventListener(\"astro:beforeload\",()=>{delete window._firstLoadContextId},{once:!0});return}window.addEventListener(\"storefront:apiContext\",r,{once:!0})};(self.Astro||(self.Astro={})).context=a;window.dispatchEvent(new Event(\"astro:context\"));})();\n"]],"entryModules":{"\u0000@astrojs-ssr-virtual-entry":"entry.mjs","\u0000@astro-renderers":"renderers.mjs","\u0000empty-middleware":"_empty-middleware.mjs","/src/pages/blog/[page].astro":"chunks/pages/_page__Sb1eYhpz.mjs","/src/pages/app/account.astro":"chunks/pages/account_-mULVQUB.mjs","/src/pages/app/index.astro":"chunks/pages/index_mQXYNYRg.mjs","/../../node_modules/.pnpm/astro@4.2.1_@types+node@18.19.7_typescript@5.2.2/node_modules/astro/dist/assets/endpoint/node.js":"chunks/pages/node_-qe5LuQh.mjs","/src/pages/~fallback.astro":"chunks/pages/~fallback_ad_xyGHU.mjs","\u0000@astrojs-manifest":"manifest_RrmXPEuL.mjs","\u0000@astro-page:../../node_modules/.pnpm/astro@4.2.1_@types+node@18.19.7_typescript@5.2.2/node_modules/astro/dist/assets/endpoint/node@_@js":"chunks/node_kUJIRL0c.mjs","\u0000@astro-page:src/pages/app/index@_@astro":"chunks/index_e3ytAL8v.mjs","\u0000@astro-page:src/pages/app/account@_@astro":"chunks/account_jmelxnlw.mjs","\u0000@astro-page:src/pages/blog/[page]@_@astro":"chunks/_page__lWVlZyRe.mjs","\u0000@astro-page:src/pages/~fallback@_@astro":"chunks/~fallback_EZqiEAFE.mjs","\u0000@astro-page:src/pages/[...slug]@_@astro":"chunks/_.._h5R83hoK.mjs","/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/SearchModal.vue":"_astro/SearchModal.4osqtafp.js","/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/components/CartSidebar.vue":"_astro/CartSidebar.55UgTcV0.js","/home/leo/code/ecomplus/cloud-commerce/node_modules/photoswipe/dist/photoswipe.css?inline":"_astro/photoswipe.0V7m2jWu.js","/astro/hoisted.js?q=1":"_astro/hoisted.KYhwGfsv.js","~/components/PitchBar.vue":"_astro/PitchBar.Nr7T3S3T.js","/home/leo/code/ecomplus/cloud-commerce/packages/storefront/src/lib/scripts/firebase-app.ts":"_astro/firebase-app.cPMfoOsn.js","~/components/HeroSlider.vue":"_astro/HeroSlider.XZb2xsyV.js","/home/leo/code/ecomplus/cloud-commerce/node_modules/photoswipe/dist/photoswipe-lightbox.esm.js":"_astro/photoswipe-lightbox.esm.dZBqKD9u.js","~/components/ProductShelf.vue":"_astro/ProductShelf.CNf5JDrU.js","/astro/hoisted.js?q=0":"_astro/hoisted.J15ErMtK.js","~/components/ProductDetails.vue":"_astro/ProductDetails.ENLKdSz_.js","/astro/hoisted.js?q=2":"_astro/hoisted.HGTzAuTI.js","~/components/AccountPage.vue":"_astro/AccountPage.9BlGHXT3.js","@astrojs/vue/client.js":"_astro/client.ZhEmw4hZ.js","~/components/ShopHeader.vue":"_astro/ShopHeader.xLMeJpqV.js","~/components/SearchShowcase.vue":"_astro/SearchShowcase.hg6TWrz3.js","/home/leo/code/ecomplus/cloud-commerce/node_modules/photoswipe/dist/photoswipe.esm.js":"_astro/photoswipe.esm.Ylh9TGkz.js","astro:scripts/before-hydration.js":""},"assets":["/_astro/_slug_.r344YGqG.css","/robots.txt","/_astro/AccountPage.9BlGHXT3.js","/_astro/CartSidebar.55UgTcV0.js","/_astro/HeroSlider.XZb2xsyV.js","/_astro/PitchBar.Nr7T3S3T.js","/_astro/Prices.Ye-m2HTo.js","/_astro/ProductDetails.ENLKdSz_.js","/_astro/ProductShelf.CNf5JDrU.js","/_astro/ProductShelf.lCBJky3e.js","/_astro/QuantitySelector.tumfWDjC.js","/_astro/SearchModal.4osqtafp.js","/_astro/SearchShowcase.hg6TWrz3.js","/_astro/ShopHeader.xLMeJpqV.js","/_astro/_plugin-vue_export-helper.SO-0jCqa.js","/_astro/afetch.5c8VmT0-.js","/_astro/client.ZhEmw4hZ.js","/_astro/customer-session.hXdZh5Ii.js","/_astro/firebase-app.cPMfoOsn.js","/_astro/format-money.iK5LGydz.js","/_astro/grid-title.vGKBy72g.js","/_astro/hoisted.HGTzAuTI.js","/_astro/hoisted.J15ErMtK.js","/_astro/hoisted.KYhwGfsv.js","/_astro/i18n.Lxnz1oF-.js","/_astro/img-sizes.gxAI9JNh.js","/_astro/img.WnsidxCx.js","/_astro/index-dd468b12.D5s8VdAL.js","/_astro/index.R7A-Pg5V.js","/_astro/index.q6KIyKlJ.js","/_astro/modules-info.tVRhvxNm.js","/_astro/name.urFqJ5yn.js","/_astro/photoswipe-lightbox.esm.dZBqKD9u.js","/_astro/photoswipe.0V7m2jWu.js","/_astro/photoswipe.esm.Ylh9TGkz.js","/_astro/price.Easct8WC.js","/_astro/runtime-core.esm-bundler.XTSAdOlw.js","/_astro/sf-utils.Z4H-dRBJ.js","/_astro/shopping-cart.ZdSCrjS6.js","/_astro/use-analytics.tCrQbW8O.js","/_astro/use-product-card.-9TsgDDW.js","/_astro/use-text-value.XE_A2nDM.js","/img/icon.png","/img/large-icon.png","/img/uploads/banner2.webp","/img/uploads/ecom-icon.png","/img/uploads/headphone.webp","/img/uploads/logo.png","/img/uploads/og-image.png","/img/uploads/passion.webp","/img/uploads/rect8589.png","/img/uploads/rect859.png","/img/uploads/rect89.webp"]});
195
+
196
+ export { AstroIntegrationLogger as A, Logger as L, getEventPrefix as g, levels as l, manifest };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, h, createSSRApp } from 'vue';
2
2
  import { renderToString } from 'vue/server-renderer';
3
- import { o as mod, p as createApp } from './chunks/pages/__fI3NeWvy.mjs';
3
+ import { o as mod, p as createApp } from './chunks/pages/__wihn0dYD.mjs';
4
4
 
5
5
  const setup = async (app) => {
6
6
  if ('default' in mod) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/storefront",
3
3
  "type": "module",
4
- "version": "2.0.7",
4
+ "version": "2.0.9",
5
5
  "description": "E-Com Plus Cloud Commerce storefront with Astro",
6
6
  "bin": {
7
7
  "storefront": "./scripts/build-prod.sh"
@@ -26,10 +26,11 @@
26
26
  "build:prod": "bash scripts/build-prod.sh",
27
27
  "preview": "astro preview",
28
28
  "astro": "astro",
29
- "prepare-monorepo": "bash scripts/prepare-monorepo.sh"
29
+ "prepare-monorepo": "bash scripts/prepare-monorepo.sh",
30
+ "lint:fix": "eslint -c ../eslint/storefront.staged.eslintrc.cjs src/lib/**/*.{ts,vue,astro} --fix"
30
31
  },
31
32
  "dependencies": {
32
- "@astrojs/node": "7.0.4",
33
+ "@astrojs/node": "8.0.0",
33
34
  "@astrojs/vue": "4.0.8",
34
35
  "@cloudcommerce/api": "workspace:*",
35
36
  "@cloudcommerce/config": "workspace:*",
@@ -41,8 +42,8 @@
41
42
  "@iconify-json/logos": "^1.1.42",
42
43
  "@types/gtag.js": "^0.0.18",
43
44
  "@vite-pwa/astro": "^0.2.0",
44
- "@vueuse/core": "10.7.1",
45
- "astro": "4.1.2",
45
+ "@vueuse/core": "10.7.2",
46
+ "astro": "4.2.1",
46
47
  "astro-capo": "^0.0.1",
47
48
  "chroma-js": "^2.4.2",
48
49
  "dotenv": "^16.3.1",
@@ -57,7 +58,7 @@
57
58
  "unplugin-auto-import": "^0.17.3",
58
59
  "vite": "^5.0.11",
59
60
  "vite-plugin-pwa": "^0.17.4",
60
- "vue": "^3.4.11",
61
+ "vue": "^3.4.15",
61
62
  "wade": "0.3.3",
62
63
  "yaml": "^2.3.4"
63
64
  },
@@ -13,6 +13,7 @@ export type NetworkName = typeof networkNames[number];
13
13
 
14
14
  const socialNetworks: Partial<Record<NetworkName, string>> = {};
15
15
  const setSocialNetworks = () => {
16
+ if (!globalThis.$storefront) return;
16
17
  const { settings } = globalThis.$storefront;
17
18
  networkNames.forEach((network: NetworkName) => {
18
19
  if (settings[network]) {
@@ -20,7 +21,7 @@ const setSocialNetworks = () => {
20
21
  }
21
22
  });
22
23
  };
23
- if (import.meta.env.SSR) {
24
+ if (import.meta.env.SSR && global.$storefront) {
24
25
  global.$storefront.onLoad(() => setSocialNetworks());
25
26
  } else {
26
27
  setSocialNetworks();
@@ -38,23 +38,24 @@ if (!mobileWidths?.length) {
38
38
  }
39
39
  ---
40
40
 
41
- {img &&
42
- <Picture
41
+ {img
42
+ && <Picture
43
43
  src={img}
44
44
  alt={alt || ''}
45
45
  widths={widths}
46
46
  fetchpriority={index === 0 ? 'high' : 'low'}
47
47
  loading={index === 0 ? 'eager' : 'lazy'}
48
- class={`${(mobileImg ? 'hidden md:block ' : '')}mx-auto text-sm text-opacity-70 ${className}`}
48
+ class={`${(mobileImg ? 'hidden md:block ' : '')}mx-auto
49
+ text-sm text-opacity-70 ${className}`}
49
50
  />
50
51
  }
51
- {mobileImg &&
52
- <Picture
52
+ {mobileImg
53
+ && <Picture
53
54
  src={mobileImg}
54
55
  alt={alt || ''}
55
56
  widths={mobileWidths}
56
57
  fetchpriority={index === 0 ? 'high' : 'low'}
57
58
  loading={index === 0 ? 'eager' : 'lazy'}
58
- class={`md:hidden mx-auto text-sm text-opacity-70 ${mobileClass}`}
59
+ class={`mx-auto text-sm text-opacity-70 md:hidden ${mobileClass}`}
59
60
  />
60
61
  }
@@ -17,7 +17,7 @@ const isX = axis === 'x';
17
17
  <button
18
18
  type="button"
19
19
  :aria-label="!isPrev ? $t.i19next : $t.i19previous"
20
- @click="changeSlide(!isPrev ? 1 : -1)"
20
+ @click.stop.prevent="changeSlide(!isPrev ? 1 : -1)"
21
21
  class="group absolute z-[11]"
22
22
  :class="isX
23
23
  ? `${(!isPrev ? 'right-0' : 'left-0')} top-0`
@@ -26,7 +26,7 @@ const isX = axis === 'x';
26
26
  >
27
27
  <slot>
28
28
  <i
29
- class="i-chevron-right m-0"
29
+ class="m-0 i-chevron-right"
30
30
  :class="{
31
31
  'group-active:translate-x-1': isX && !isPrev,
32
32
  'rotate-180 group-active:-translate-x-1': isX && isPrev,
@@ -8,7 +8,7 @@ const parsedHTML = html.replace(/<(img|iframe) /g, '<$1 loading="lazy" ');
8
8
  </script>
9
9
 
10
10
  <template>
11
- <article class="prose !max-w-full overflow-x-auto" v-once>
11
+ <article class="!max-w-full overflow-x-auto prose" v-once>
12
12
  <div
13
13
  class="[&_iframe]:max-w-full [&_img]:max-w-full [&_table]:max-w-full"
14
14
  v-html="parsedHTML"
@@ -143,7 +143,7 @@ const isPlacementX = computed(() => {
143
143
  data-drawer-close
144
144
  >
145
145
  <slot name="close">
146
- <i class="i-close text-base-400 hover:text-base-600 m-0 text-3xl"></i>
146
+ <i class="m-0 text-3xl text-base-400 i-close hover:text-base-600"></i>
147
147
  </slot>
148
148
  </button>
149
149
  <slot />
@@ -152,7 +152,7 @@ const isPlacementX = computed(() => {
152
152
  <Fade>
153
153
  <div
154
154
  v-if="modelValue && !isHidden"
155
- class="fixed left-0 top-0 z-30 h-screen w-screen bg-black/50"
155
+ class="size-screen fixed left-0 top-0 z-30 bg-black/50"
156
156
  data-drawer-backdrop
157
157
  ></div>
158
158
  </Fade>
@@ -21,7 +21,7 @@ const getImageFilepath = (src: string) => {
21
21
  try {
22
22
  copyFileSync(filepath, resolvePath(
23
23
  import.meta.env.STOREFRONT_BASE_DIR,
24
- import.meta.env.BUILD_OUT_DIR || 'dist/client',
24
+ import.meta.env.BUILD_OUT_DIR || 'dist/client',
25
25
  '_astro',
26
26
  basename(filepath),
27
27
  ));
@@ -90,7 +90,7 @@ if (imgAttrs) {
90
90
  if (versionSuffix) {
91
91
  attrs.srcset = attrs.srcset.replace(/\s(\w+)$/, `${versionSuffix} $1`);
92
92
  }
93
- return <source {...attrs} sizes={sizes} />
93
+ return <source {...attrs} sizes={sizes} />;
94
94
  })}
95
95
  {imgAttrs && <img {...imgAttrs} />}
96
96
  </picture>
@@ -20,8 +20,8 @@ const {
20
20
  <template>
21
21
  <button
22
22
  type="button"
23
- class="leading-12 enabled:text-primary enabled:hover:bg-primary-100/70
24
- h-12 w-10 text-xl disabled:opacity-40"
23
+ class="leading-12 h-12 w-10 text-xl
24
+ enabled:text-primary enabled:hover:bg-primary-100/70 disabled:opacity-40"
25
25
  :data-quantity-selector-control="isMinus ? 'minus' : 'plus'"
26
26
  :aria-label="isMinus ? $t.i19minus : $t.i19plus"
27
27
  :disabled="isMinus ? isBoundMin : isBoundMax"
@@ -11,6 +11,7 @@ const { fallback = 'animate' } = Astro.props as Props;
11
11
  <meta name="astro-view-transitions-enabled" content="true" />
12
12
  <meta name="astro-view-transitions-fallback" content={fallback} />
13
13
  <script>
14
+ /* eslint-disable */
14
15
  type Fallback = 'none' | 'animate' | 'swap';
15
16
  type Direction = 'forward' | 'back';
16
17
  type State = {
@@ -16,14 +16,14 @@ const { settings } = Astro.locals.routeContext;
16
16
  <slot />
17
17
  <slot name="before-body-end" />
18
18
  <div id="teleported-bottom" class="relative z-[19]"></div>
19
- {settings.icon &&
20
- <Picture
19
+ {settings.icon
20
+ && <Picture
21
21
  src={settings.icon}
22
22
  alt="Icon"
23
23
  formats={['png']}
24
24
  widths={[32, 192, 512]}
25
25
  sizes="32px"
26
- class="hidden absolute"
26
+ class="absolute hidden"
27
27
  style="bottom: -1000px"
28
28
  hasImg={false}
29
29
  />
@@ -12,12 +12,6 @@ export interface Props {
12
12
  const isPWA = pwaInfo !== false; // config/astro/mock-pwa-info.mjs
13
13
  const hasViewTransitions = Astro.props.hasViewTransitions !== false
14
14
  && !Astro.url.pathname.startsWith('/app/');
15
- const deployRand = import.meta.env.DEPLOY_RAND || '_';
16
- const getIconUrl = (size: number) => {
17
- return `/_image?f=png&w=${size}&h=${size}`
18
- + `&href=${encodeURIComponent(settings.icon)}&V=${deployRand}`;
19
- };
20
-
21
15
  const {
22
16
  storeId,
23
17
  isHomepage,
@@ -39,20 +33,25 @@ const {
39
33
  if (fetchingApiContext) {
40
34
  await fetchingApiContext;
41
35
  }
36
+ const deployRand = import.meta.env.DEPLOY_RAND || '_';
37
+ const getIconUrl = (size: number) => {
38
+ return `/_image?f=png&w=${size}&h=${size}`
39
+ + `&href=${encodeURIComponent(settings.icon)}&V=${deployRand}`;
40
+ };
42
41
 
43
42
  const apiDoc = apiContext.doc;
44
43
  const state: Record<string, any> = apiDoc || cmsContent || {};
45
- let title: string = state.meta_title ||
46
- state.metaTitle ||
47
- (state.name && `${state.name} | ${settings.name}`) ||
48
- (state.title && `${state.title} | ${settings.name}`) ||
49
- '';
50
- let description: string = state.meta_description ||
51
- state.metaDescription ||
52
- state.short_description ||
53
- state.description ||
54
- settings.description ||
55
- '';
44
+ let title: string = state.meta_title
45
+ || state.metaTitle
46
+ || (state.name && `${state.name} | ${settings.name}`)
47
+ || (state.title && `${state.title} | ${settings.name}`)
48
+ || '';
49
+ let description: string = state.meta_description
50
+ || state.metaDescription
51
+ || state.short_description
52
+ || state.description
53
+ || settings.description
54
+ || '';
56
55
  if (isHomepage) {
57
56
  if (!title) title = settings.name;
58
57
  if (!description) description = settings.description;
@@ -135,10 +134,10 @@ if (apiDoc) {
135
134
  window._firstLoadContextId = '${apiDoc._id}';`;
136
135
  contextInlineClientJS = `
137
136
  $storefront.apiContext = ${JSON.stringify({
138
- resource: apiContext.resource,
139
- doc: minifyApiDoc({ ...apiDoc }),
140
- timestamp: Date.now(),
141
- })};
137
+ resource: apiContext.resource,
138
+ doc: minifyApiDoc({ ...apiDoc }),
139
+ timestamp: Date.now(),
140
+ })};
142
141
  $storefront.context /* DEPRECATED */ = $storefront.apiContext;
143
142
  _emitApiContext('${apiDoc._id}');`;
144
143
  } else {
@@ -168,8 +167,8 @@ const inlineJSONLd = JSON.stringify({
168
167
  <meta name="viewport" content="width=device-width">
169
168
  <meta name="theme-color" content={primaryColor}>
170
169
  <link rel="icon" type="image/png" href={favicon} sizes="32x32" />
171
- {shortcutIcon &&
172
- <link rel="icon" type="image/png" href={shortcutIcon} sizes="192x192" />}
170
+ {shortcutIcon
171
+ && <link rel="icon" type="image/png" href={shortcutIcon} sizes="192x192" />}
173
172
  {title && <title>{title}</title>}
174
173
  {description && <meta name="description" content={description}>}
175
174
  <meta name="author" content={settings.name}>
@@ -185,21 +184,22 @@ const inlineJSONLd = JSON.stringify({
185
184
  <meta property="og:type" content="website">
186
185
  <meta property="og:locale" content={ogLocale}>
187
186
  {ogImage && <meta property="og:image" content={ogImage} />}
188
- {metatagsContent?.fbAppId &&
189
- <meta property="fb:app_id" content={metatagsContent.fbAppId} />}
187
+ {metatagsContent?.fbAppId
188
+ && <meta property="fb:app_id" content={metatagsContent.fbAppId} />}
190
189
  <meta name="twitter:card" content="summary">
191
- {metatagsContent?.twitterUsername &&
192
- <meta name="twitter:site" content={metatagsContent.twitterUsername} />}
190
+ {metatagsContent?.twitterUsername
191
+ && <meta name="twitter:site" content={metatagsContent.twitterUsername} />}
193
192
  <meta name="ecom-store-id" content={String(storeId)}>
194
193
 
195
194
  {isPWA && <>
196
195
  <script>
196
+ /* eslint-disable */
197
197
  import { registerSW } from 'virtual:pwa-register';
198
198
  registerSW({ immediate: false });
199
199
  </script>
200
200
  {pwaInfo && <Fragment set:html={pwaInfo.webManifest.linkTag} />}
201
- {(!pwaInfo && !import.meta.env.DEV) &&
202
- <link rel="manifest" href="/manifest.webmanifest" />}
201
+ {(!pwaInfo && !import.meta.env.DEV)
202
+ && <link rel="manifest" href="/manifest.webmanifest" />}
203
203
  </>}
204
204
 
205
205
  <script is:inline set:html={inlineClientJS} transition:persist />
@@ -20,8 +20,9 @@ const createApp = (app: App) => {
20
20
  };
21
21
  app.config.globalProperties.$money = formatMoney;
22
22
  app.config.globalProperties.$percentage = formatPercentage;
23
- app.config.globalProperties.$settings = globalThis.$storefront.settings;
24
- app.config.globalProperties.$apiContext = globalThis.$storefront.apiContext;
23
+ const { settings, apiContext } = globalThis.$storefront || {};
24
+ app.config.globalProperties.$settings = settings;
25
+ app.config.globalProperties.$apiContext = apiContext;
25
26
  },
26
27
  });
27
28
  app.component('Fade', Fade);
@@ -2,7 +2,7 @@
2
2
  "name": "@cloudcommerce/test-base",
3
3
  "private": true,
4
4
  "type": "module",
5
- "version": "2.0.7",
5
+ "version": "2.0.9",
6
6
  "description": "E-Com Plus Cloud Commerce basic setup for testing",
7
7
  "main": "lib/index.js",
8
8
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/types",
3
3
  "type": "module",
4
- "version": "2.0.7",
4
+ "version": "2.0.9",
5
5
  "description": "E-Com Plus Cloud Commerce reusable type definitions",
6
6
  "main": "index.ts",
7
7
  "repository": {
@@ -0,0 +1,5 @@
1
+ process.env.STOREFRONT_BASE_DIR = './packages/storefront';
2
+
3
+ const { genTailwindConfig } = require('./packages/storefront/config/storefront.tailwind.cjs');
4
+
5
+ module.exports = genTailwindConfig();
@@ -1 +0,0 @@
1
- import{_ as b,w as x}from"./_plugin-vue_export-helper.40kDRyEO.js";import{f as C}from"./modules-info.dHD0h8Nc.js";import{p as I,r as S,s as w,t as V}from"./shopping-cart.MgpVRgys.js";import{Q as P,C as F}from"./QuantitySelector.SEAsIOhe.js";import{P as v}from"./Prices.Bsod-tLh.js";import{c as p,d as y,M as f,N as i,O as m,U as d,V as k,$ as j,Q as h,P as o,R as t,S as g,X as N,Y as z}from"./runtime-core.esm-bundler.Pr2hdd7G.js";import{g as A}from"./name.itYHl42A.js";import{g as L}from"./img.c2KI4eO6.js";import"./afetch.5c8VmT0-.js";import"./sf-utils.yjuG8NjM.js";import"./format-money.ykh8O7d2.js";import"./price.Easct8WC.js";import"./customer-session.yn5lG3w3.js";import"./index.8acAQSHW.js";import"./i18n.MycOopxQ.js";const q=a=>{const s=p(()=>!a.item&&a.product?I(a.product):null),r=p(()=>a.item||s.value),e=p(()=>A(r.value)),n=p(()=>{const{slug:l}=r.value;return typeof l=="string"?`/${l}`:null}),u=p(()=>{if(r.value.picture)return L(r.value.picture,void 0,a.pictureSize||"small")}),c=p(()=>r.value.final_price||r.value.price);return{cartItem:r,title:e,link:n,image:u,finalPrice:c}},B=y({__name:"CartItem",props:{item:{},product:{},pictureSize:{}},setup(a,{expose:s}){s();const r=a,{cartItem:e,title:n,link:u,image:c,finalPrice:l}=q(r),_={props:r,cartItem:e,title:n,link:u,image:c,finalPrice:l,get removeCartItem(){return S},QuantitySelector:P,Prices:v};return Object.defineProperty(_,"__isScriptSetup",{enumerable:!1,value:!0}),_}}),Q={class:"relative bg-white shadow-sm"},E={class:"text-base-700 group-hover:text-base-900 flex-auto py-2 text-sm group-hover:underline"},M=t("span",{class:"border-3 text-danger-800 border-danger-700/30 flex h-5 w-5 flex-col justify-center rounded-full text-sm leading-none"},[t("i",{class:"i-close mx-auto my-0"})],-1),O=[M],R={class:"border-base-100 flex items-center justify-between border-t-2"},U={class:"border-base-100 border-r-2"};function D(a,s,r,e,n,u){const c=f("AImg"),l=f("ALink");return i(),m("article",Q,[d(l,{href:e.link,class:"group flex items-center gap-5 p-4"},{default:k(()=>[e.image?(i(),j(c,{key:0,picture:e.image,alt:e.title,class:"h-20 w-20 object-cover"},null,8,["picture","alt"])):h("",!0),t("p",E,o(e.title),1)]),_:1},8,["href"]),e.cartItem._id?(i(),m("button",{key:0,onClick:s[0]||(s[0]=x(_=>e.removeCartItem(e.cartItem._id),["stop"])),class:"absolute right-0 top-0 p-2 opacity-70 hover:opacity-100","aria-label":"Remover"},O)):h("",!0),t("div",R,[t("div",U,[d(e.QuantitySelector,{modelValue:e.cartItem.quantity,"onUpdate:modelValue":s[1]||(s[1]=_=>e.cartItem.quantity=_),min:e.cartItem.min_quantity,max:e.cartItem.max_quantity},null,8,["modelValue","min","max"])]),d(e.Prices,{"base-price":e.cartItem.base_price,price:e.finalPrice,"has-cashback":!1,"has-price-options":!1,class:"px-4 py-2.5 text-right text-[95%]"},null,8,["base-price","price"])])])}const T=b(B,[["render",D]]),X=y({__name:"CartSidebar",emits:["close"],setup(a,{expose:s,emit:r}){s();const n={emit:r,get freeShippingFromValue(){return C},get shoppingCart(){return w},get totalItems(){return V},CheckoutLink:F,Prices:v,CartItem:T};return Object.defineProperty(n,"__isScriptSetup",{enumerable:!1,value:!0}),n}}),Y={class:"flex h-screen flex-col bg-white"},G={class:"z-10 flex items-center justify-end gap-3 px-6 py-4 shadow ring-1 ring-black/5"},H=t("span",{class:"text-base-600 text-right text-base font-medium"},o("Meu carrinho de compras"),-1),J={class:"min-w-[3rem] text-right"},K={class:"ui-badge-pill-lg"},W={class:"bg-base-50 grow overflow-y-auto"},Z={key:0,class:"text-center text-sm"},$={key:0,class:"secondary-subtle p-3"},ee=t("strong",{class:"lowercase"},o("Frete grátis"),-1),te={key:1,class:"bg-success-50 text-success-800 p-3"},re=t("i",{class:"text-success-900 i-check mr-1"},null,-1),se={class:"px-4 pb-2 pt-4"},ae={class:"z-10 px-5 pb-3 pt-4 ring-2 ring-black/5"},oe={class:"grid grid-cols-5 items-center gap-3 text-right"},ie=t("div",{class:"col-span-2"},o("Subtotal"),-1),ne=t("i",{class:"i-check mr-2"},null,-1),ce=t("i",{class:"i-arrow-right mr-1 rotate-180"},null,-1);function le(a,s,r,e,n,u){return i(),m("aside",Y,[t("header",G,[H,t("span",J,[t("span",K,o(e.totalItems),1)])]),t("article",W,[e.freeShippingFromValue?(i(),m("div",Z,[e.freeShippingFromValue>e.shoppingCart.subtotal?(i(),m("div",$,[g(o("Adicione $1 para ganhar".replace("$1",a.$money(e.freeShippingFromValue-e.shoppingCart.subtotal)))+" ",1),ee])):(i(),m("div",te,[re,g(" "+o("Frete grátis a partir de")+" "+o(a.$money(e.freeShippingFromValue)),1)]))])):h("",!0),t("ul",se,[(i(!0),m(N,null,z(e.shoppingCart.items,(c,l)=>(i(),m("li",{key:l},[d(e.CartItem,{item:c,class:"mb-3"},null,8,["item"])]))),128))])]),t("footer",ae,[t("div",oe,[ie,d(e.Prices,{price:e.shoppingCart.subtotal,class:"col-span-3 text-lg"},null,8,["price"])]),d(e.CheckoutLink,{to:"checkout",class:"ui-btn-lg ui-btn-primary my-2.5 w-full text-right"},{default:k(()=>[ne,g(" "+o("Finalizar compra"))]),_:1}),t("a",{href:"#",onClick:s[0]||(s[0]=x(c=>e.emit("close"),["prevent"])),class:"ui-link text-base-500 hover:text-base-700 text-sm"},[ce,g(" "+o("Continuar comprando"))])])])}const Se=b(X,[["render",le]]);export{Se as default};
@@ -1,7 +0,0 @@
1
- import{_ as D,w as Q}from"./_plugin-vue_export-helper.40kDRyEO.js";import{u as Z}from"./index.NRzvVgQf.js";import{a as J}from"./shopping-cart.MgpVRgys.js";import{u as K}from"./use-product-card.gKh9czSW.js";import{C as W,Q as $}from"./QuantitySelector.SEAsIOhe.js";import{P as tt}from"./Prices.Bsod-tLh.js";import{_ as G}from"./customer-session.yn5lG3w3.js";import{u as et}from"./sf-utils.yjuG8NjM.js";import{d as R,a as C,M as I,N as u,O as f,$ as P,V as z,Q as b,R as v,X as k,T as V,U as w,Y as A,a7 as F,L as ot,r as L,w as T,a6 as M,c as H,S as B,P as S,a8 as rt,H as it,Z as at}from"./runtime-core.esm-bundler.Pr2hdd7G.js";import{g as nt}from"./img-sizes.gxAI9JNh.js";import"./index.8acAQSHW.js";import{g as st}from"./grid-title.z5ui_5pL.js";import"./price.Easct8WC.js";import"./use-analytics.D9xd-k7D.js";import"./afetch.5c8VmT0-.js";import"./name.itYHl42A.js";import"./i18n.MycOopxQ.js";import"./img.c2KI4eO6.js";import"./modules-info.dHD0h8Nc.js";import"./format-money.ykh8O7d2.js";const q=(a,s,l)=>{if(typeof a!="object"||a===null)return[];let t=[];if(typeof a=="object"&&a!==null)if(Array.isArray(a))a.length&&(a[0].specifications?a.forEach(e=>{t=t.concat(q(e,s,l))}):a[0].text&&(t=a));else{const{specifications:e}=a;if(e)for(const n in e)e[n]&&n===s&&(t=e[s]);if(t&&!t.length&&Array.isArray(l)&&l.length){let n,d;return l&&(d=l.find(r=>r.grid_id===s))&&d.options&&(n=d.options.map(r=>{let i;return r.colors&&r.colors.length?i=r.colors[0]:i=r.option_id,{text:r.text,value:i}})),q(n,s)}}return t},X=q,lt=(a,s,l,t=", ")=>{let e=X(a,s,l);if(e.length){let n=e[0].text;for(let d=1;d<e.length;d++)n+=t+e[d].text;return n}return null},Y=lt,ct=(a,s,l,t)=>{const e=X(a,l,t);for(let n=0;n<e.length;n++)if(e[n].text===s)return e[n].value},dt=ct,ut=(a,s,l,t)=>{let e={};return a&&Array.isArray(a.variations)&&a.variations.forEach(n=>{if(l&&n.quantity<=0)return;let d=n.specifications,r=i=>Y(n,i,t);if(d){if(s){for(let i in s)if(s.hasOwnProperty(i)&&(!d[i]||r(i)!==s[i]))return}for(let i in d)if(d.hasOwnProperty(i)){let m=r(i);if(!e.hasOwnProperty(i))e[i]=[];else if(e[i].indexOf(m)!==-1)continue;e[i].push(m)}}}),e},j=ut,mt=R({__name:"ImagesGallery",props:{pictures:{}},setup(a,{expose:s}){s();const l=C(0),t=C("");let e;const n=C(!1),r={activeIndex:l,psId:t,get lightbox(){return e},set lightbox(i){e=i},isLoadingLightbox:n,zoom:i=>{if(t.value=`ps-${et()}`,!e&&!n.value){n.value=!0;const m="photoswipe-style";Promise.all([G(()=>import("./photoswipe-lightbox.esm.dZBqKD9u.js"),__vite__mapDeps([])),G(()=>import("./photoswipe.esm.Ylh9TGkz.js"),__vite__mapDeps([])),!document.getElementById(m)&&G(()=>import("./photoswipe.0V7m2jWu.js"),__vite__mapDeps([]))]).then(([{default:o},{default:c},h])=>{if(h){const{default:y}=h,p=document.createElement("style");p.id=m,p.textContent=y,document.head.appendChild(p)}e=new o({gallery:`#${t.value} > div`,children:"a",pswpModule:c,showAnimationDuration:300,hideAnimationDuration:300}),e.init(),e.loadAndOpen(i),n.value=!1})}},get getImgSizes(){return nt}};return Object.defineProperty(r,"__isScriptSetup",{enumerable:!1,value:!0}),r}}),ft={class:"-mx-4 flex w-screen gap-3 sm:mx-0 sm:w-full md:h-[525px] 2xl:gap-5"},gt=["onClick"],pt=v("span",{class:"absolute bottom-0 block h-2 w-full bg-gradient-to-b from-transparent to-white"},null,-1),ht={class:"relative aspect-square h-full grow md:aspect-auto"},_t={key:0,class:"i-arrow-path bg-base-200 absolute left-1/2 top-1/2 -ml-7 -mt-7 h-14 w-14 animate-spin","aria-label":"Carregando"},vt={key:1,class:"mt-2 flex justify-center gap-1.5 md:hidden"},yt=["aria-label","onClick"];function bt(a,s,l,t,e,n){const d=I("AImg"),r=I("CarouselControl"),i=I("Carousel"),m=I("ALink");return u(),f("div",ft,[l.pictures.length>1?(u(),P(i,{key:0,axis:"y",class:"group hidden w-[300px] shrink-0 md:block"},{controls:z(()=>[v("span",null,[l.pictures.length>6?(u(),P(r,{key:0,class:"hover:bg-primary-300/60 text-primary !bottom-3 !left-1/2 -ml-5 h-10 w-10 rounded-full bg-white/60 text-xl opacity-0 shadow-sm ring-1 ring-black/5 group-hover:opacity-90"})):b("",!0),pt])]),default:z(()=>[(u(!0),f(k,null,A(Math.ceil(l.pictures.length/2),o=>(u(),f("li",{key:o,class:V(["grid w-full grid-cols-2 gap-3 px-1 pb-3",o===1&&"pt-1"])},[(u(!0),f(k,null,A([1,2].map(c=>(o-1)*2+(c-1)),c=>(u(),f(k,{key:`${o}-${c}`},[c<l.pictures.length?(u(),f("button",{key:0,class:"bg-secondary-100 block rounded md:h-[175px]",onClick:h=>t.activeIndex=c},[w(d,{picture:l.pictures[c],class:V(["ring-secondary/10 h-full w-full rounded border-2 object-cover opacity-90 transition-colors",c===t.activeIndex?"border-secondary/50 ring-4 cursor-auto":"border-transparent hover:border-primary hover:ring-4 hover:ring-primary/20"])},null,8,["picture","class"])],8,gt)):b("",!0)],64))),128))],2))),128))]),_:1})):b("",!0),v("div",ht,[w(i,{as:"div",index:t.activeIndex,"onUpdate:index":s[1]||(s[1]=o=>t.activeIndex=o),class:V(["text-base-600 [&_i]:i-arrow-right mx-auto h-full w-full max-w-[525px] [&>*]:h-full [&_i]:mx-2 [&_i]:text-2xl",t.isLoadingLightbox&&"opacity-80"]),id:t.psId},{default:z(()=>[s[0]||(F(-1),s[0]=(u(!0),f(k,null,A(l.pictures,(o,c)=>(u(),P(m,{key:`big-${c}`,href:o.zoom?.size&&o.zoom.url,"data-pswp-width":t.getImgSizes(o.zoom||"").width,"data-pswp-height":t.getImgSizes(o.zoom||"").height,target:"_blank",rel:"noreferrer",class:V(["shrink-0 basis-full",o.zoom?.size&&"cursor-zoom-in"]),onClick:Q(()=>o.zoom?.size&&t.zoom(c),["prevent"])},{default:z(()=>[w(d,{picture:o,"preferred-size":"big",class:"h-full w-full rounded object-cover",fetchpriority:c===0?"high":"low",loading:c===0?"eager":"lazy"},null,8,["picture","fetchpriority","loading"])]),_:2},1032,["href","data-pswp-width","data-pswp-height","class","onClick"]))),128)),F(1),s[0])]),_:1},8,["index","class","id"]),t.isLoadingLightbox?(u(),f("i",_t)):b("",!0),l.pictures.length>1?(u(),f("ul",vt,[(u(!0),f(k,null,A(l.pictures.length,o=>(u(),f("li",{key:`d-${o}`},[v("button",{class:V(["bg-base-700 block h-1.5 w-3 rounded-full",t.activeIndex!==o-1&&"opacity-40"]),"aria-label":`Imagem ${o}`,onClick:c=>t.activeIndex=o-1},null,10,yt)]))),128))])):b("",!0)])])}const xt=D(mt,[["render",bt]]),kt=a=>{const s=ot(a.grids||globalThis.$storefront.data.grids||[]);s.length||window.addEventListener("storefront:data:data",()=>{globalThis.$storefront.data.grids?.forEach(o=>s.push(o))},{once:!0});const l=L({}),t=L({});T(M(a,"variations"),()=>{Object.assign(t,j(a,void 0,!0));const o=j(a);Object.keys(o).forEach(c=>{t[c]?l[c]=t[c]:delete l[c]})},{immediate:!0});const e=H(()=>Object.keys(l)),n=L({}),d=C(),r=({optionText:o,gridId:c,gridIndex:h})=>{n[c]=o;const y={};for(let g=0;g<=h;g++){const _=e[g];n[_]&&(y[_]=n[_])}const p=j(a,y,!0);for(let g=h+1;g<e.value.length;g++){const _=e[g],O=p[_];t[_]=O,n[_]&&!O.includes(n[_])&&delete n[_]}const x=a.variations.slice(0);for(let g=0;g<x.length;g++){const _=x[g],{specifications:O}=_,N=Object.keys(O);for(let E=0;E<N.length;E++){const U=N[E];if(n[U]!==Y(_,U)){x.splice(g,1),g-=1;break}}}d.value=x[0]?._id||null};return T(M(a,"variationId"),o=>{if(!o||o===d.value)return;const c=a.variations.find(x=>x._id===o);if(!c){d.value=null;return}const{specifications:h}=c,y=Object.keys(h),p=(x=0)=>{const g=y[x];if(y[x]&&h[g]&&h[g].length===1){const _=h[g][0].text;l[g].find(O=>O===_)&&(r({optionText:_,gridId:g,gridIndex:e.value.indexOf(g)}),p(x+1))}};p()},{immediate:!0}),{grids:s,variationsGrids:l,activeVariationsGrids:t,selectOption:r,selectedOptions:n,variationId:d,getGridTitle:o=>st(o,s),getColorOptionBg:o=>{const c=o.split(",").map(h=>dt(a.variations,h.trim(),"colors"));return c.length>1?`background:linear-gradient(to right bottom, ${c[0]} 50%, ${c[1]} 50%)`:`background:${c[0]}`}}},wt=R({__name:"SkuSelector",props:{variations:{},variationId:{},grids:{}},emits:["update:variationId"],setup(a,{expose:s,emit:l}){s();const t=a,e=l,{variationsGrids:n,activeVariationsGrids:d,selectOption:r,selectedOptions:i,variationId:m,getGridTitle:o,getColorOptionBg:c}=kt(t);T(m,y=>{e("update:variationId",y)});const h={props:t,emit:e,variationsGrids:n,activeVariationsGrids:d,selectOption:r,selectedOptions:i,variationId:m,getGridTitle:o,getColorOptionBg:c};return Object.defineProperty(h,"__isScriptSetup",{enumerable:!1,value:!0}),h}}),St={class:"text-base-700 text-sm font-medium"},Ct={key:0,class:"text-base-800"},Ot={key:0,class:"mt-2 flex gap-2"},Vt=["onClick"];function zt(a,s,l,t,e,n){return u(),f("div",null,[(u(!0),f(k,null,A(t.variationsGrids,(d,r)=>(u(),f("div",{key:r,class:"mt-3"},[v("span",St,[B(S(t.getGridTitle(r))+": ",1),t.selectedOptions[r]?(u(),f("strong",Ct,S(t.selectedOptions[r]),1)):b("",!0)]),d.length<7?(u(),f("ul",Ot,[(u(!0),f(k,null,A(d,(i,m)=>(u(),f("li",{key:`${r}-${m}`},[v("button",{class:V(["ring-primary/60 rounded border",[t.selectedOptions[r]===i?"border-primary ring-2":null,r==="colors"?"h-9 w-9 text-[0px]":"px-2.5 py-2 leading-none",t.activeVariationsGrids[r].includes(i)?"text-primary-950 bg-primary-100 border-primary-400":"text-primary-600 bg-primary-200 border-primary-300"]]),style:rt(r==="colors"?t.getColorOptionBg(i):void 0),onClick:o=>t.selectOption({optionText:i,gridId:r,gridIndex:m})},S(i),15,Vt)]))),128))])):b("",!0)]))),128))])}const At=D(wt,[["render",zt]]),It=R({__name:"ProductDetails",props:{product:{default:()=>globalThis.$storefront.apiContext?.doc}},setup(a,{expose:s}){s();const l=a,{product:t,title:e,isActive:n}=K(l),d=C(t.min_quantity||1),r=Z("history"),i=C(!1),m=C(null);T(m,p=>{p&&(r.var=p,i.value=!1)}),it(()=>{T(r,({var:p})=>{typeof p=="string"&&p&&(m.value=p)},{immediate:!0})});const o=H(()=>!!(!t.variations?.length||m.value)),c=p=>(o.value?i.value=!1:(p&&p.preventDefault(),i.value=!0),!i.value),y={props:l,product:t,title:e,isActive:n,quantity:d,params:r,hasSkuSelectionAlert:i,variationId:m,isSkuSelected:o,checkVariation:c,addToCart:()=>{c()&&J(t,m.value?m.value:void 0)},CheckoutLink:W,QuantitySelector:$,Prices:tt,ImagesGallery:xt,SkuSelector:At};return Object.defineProperty(y,"__isScriptSetup",{enumerable:!1,value:!0}),y}}),Pt={class:"ui-section relative grid grid-cols-1 items-start gap-5 md:gap-4 lg:grid-cols-4 2xl:gap-6"},Tt={class:"w-full lg:col-span-3"},Et={class:"lg:sticky-header:translate-y-14 top-0 py-4 transition-transform lg:sticky"},Gt={class:"ui-text-brand text-secondary-900 text-lg"},Lt={key:0,class:"mt-5"},jt={key:0,class:"ui-alert inline-block"},Bt=v("i",{class:"i-arrow-right ml-1 -rotate-90"},null,-1),qt={class:"mt-5 flex flex-wrap items-center gap-x-4 gap-y-2 md:flex-nowrap lg:mt-4 lg:flex-wrap"},Dt=v("i",{class:"i-chevron-double-right mr-1"},null,-1),Rt=["data-tooltip"],Nt={class:"w-full lg:col-span-3"};function Ut(a,s,l,t,e,n){const d=I("Fade");return u(),f("section",Pt,[v("div",Tt,[t.product.pictures?.length?(u(),P(t.ImagesGallery,{key:0,pictures:t.product.pictures},null,8,["pictures"])):b("",!0)]),v("div",Et,[v("h1",Gt,S(t.title),1),t.isActive?(u(),f("div",Lt,[w(t.Prices,{product:t.product,"is-big":"","is-literal":""},null,8,["product"]),t.product.variations?(u(),P(t.SkuSelector,{key:0,variations:t.product.variations,"variation-id":t.variationId,"onUpdate:variationId":s[0]||(s[0]=r=>t.variationId=r),class:"my-4"},null,8,["variations","variation-id"])):b("",!0),w(d,{slide:"down"},{default:z(()=>[t.hasSkuSelectionAlert?(u(),f("div",jt,[B(S("Por favor selecione uma opção em cada campo acima")+" "),Bt])):b("",!0)]),_:1}),v("div",qt,[w(t.QuantitySelector,{modelValue:t.quantity,"onUpdate:modelValue":s[1]||(s[1]=r=>t.quantity=r),min:t.product.min_quantity,max:t.product.quantity,class:"border-base-100 rounded md:mr-5 lg:mb-2 lg:mr-auto lg:border-2"},null,8,["modelValue","min","max"]),w(t.CheckoutLink,{class:"ui-btn-lg ui-btn-primary grow text-center",to:"checkout","cart-item":{product_id:t.product._id,quantity:t.quantity,variation_id:t.variationId||void 0},"data-tooltip":t.isSkuSelected?null:"Escolha os detalhes do produto para comprar",onClick:t.checkVariation},{default:z(()=>[Dt,B(" "+S("Comprar"))]),_:1},8,["cart-item","data-tooltip"]),v("button",{class:"ui-btn-lg ui-btn-contrast grow",onClick:Q(t.addToCart,["prevent"]),"data-tooltip":t.isSkuSelected?null:"Escolha os detalhes do produto para comprar"},S("Adicionar ao carrinho"),8,Rt)])])):b("",!0)]),v("div",Nt,[at(a.$slots,"description")])])}const ce=D(It,[["render",Ut]]);export{ce as default};
2
- function __vite__mapDeps(indexes) {
3
- if (!__vite__mapDeps.viteFileDeps) {
4
- __vite__mapDeps.viteFileDeps = []
5
- }
6
- return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
7
- }