cloudcommerce 0.33.5 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
- package/ecomplus-stores/barra-doce/functions/ssr/package.json +6 -6
- package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/barra-doce/package.json +2 -2
- package/package.json +2 -2
- package/packages/api/package.json +1 -1
- package/packages/apps/affilate-program/package.json +1 -1
- package/packages/apps/correios/package.json +1 -1
- package/packages/apps/custom-payment/package.json +1 -1
- package/packages/apps/custom-shipping/package.json +1 -1
- package/packages/apps/datafrete/package.json +1 -1
- package/packages/apps/discounts/package.json +1 -1
- package/packages/apps/emails/package.json +1 -1
- package/packages/apps/fb-conversions/package.json +1 -1
- package/packages/apps/flash-courier/package.json +1 -1
- package/packages/apps/frenet/package.json +1 -1
- package/packages/apps/galaxpay/package.json +1 -1
- package/packages/apps/google-analytics/package.json +1 -1
- package/packages/apps/jadlog/package.json +1 -1
- package/packages/apps/loyalty-points/package.json +1 -1
- package/packages/apps/mandae/package.json +1 -1
- package/packages/apps/melhor-envio/package.json +1 -1
- package/packages/apps/mercadopago/package.json +1 -1
- package/packages/apps/pagarme/package.json +1 -1
- package/packages/apps/pagarme-v5/package.json +1 -1
- package/packages/apps/paghiper/package.json +1 -1
- package/packages/apps/pix/package.json +1 -1
- package/packages/apps/tiny-erp/package.json +1 -1
- package/packages/apps/webhooks/package.json +1 -1
- package/packages/cli/package.json +1 -1
- package/packages/config/package.json +1 -1
- package/packages/emails/package.json +1 -1
- package/packages/eslint/package.json +1 -1
- package/packages/events/package.json +1 -1
- package/packages/feeds/package.json +1 -1
- package/packages/firebase/package.json +1 -1
- package/packages/i18n/package.json +1 -1
- package/packages/modules/package.json +1 -1
- package/packages/passport/package.json +1 -1
- package/packages/ssr/package.json +3 -3
- package/packages/storefront/.auto-imports.d.ts +1 -1
- package/packages/storefront/astro.config.mjs +5 -10
- package/packages/storefront/config/astro/mock-pwa-info.mjs +2 -0
- package/packages/storefront/dist/client/_astro/AccountPage.6ead88b1.js +1 -0
- package/packages/storefront/dist/client/_astro/CartSidebar.8151e4ee.js +1 -0
- package/packages/storefront/dist/client/_astro/HeroSlider.46474cda.js +1 -0
- package/packages/storefront/dist/client/_astro/PitchBar.fbca6881.js +1 -0
- package/packages/storefront/dist/client/_astro/Prices.311303d8.js +1 -0
- package/packages/storefront/dist/client/_astro/ProductDetails.d66f9f7e.js +1 -0
- package/packages/storefront/dist/client/_astro/ProductShelf.9536b4c1.js +1 -0
- package/packages/storefront/dist/client/_astro/QuantitySelector.e74e368a.js +1 -0
- package/packages/storefront/dist/client/_astro/SearchModal.83b73e0b.js +1 -0
- package/packages/storefront/dist/client/_astro/ShopHeader.06f4d486.js +4 -0
- package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.dd1a60ce.js +1 -0
- package/packages/storefront/dist/client/_astro/_slug_.52cde7a0.css +1 -0
- package/packages/storefront/dist/client/_astro/afetch.f4507208.js +1 -0
- package/packages/storefront/dist/client/_astro/client.7c1b0374.js +1 -0
- package/packages/storefront/dist/client/_astro/customer-session.2d173cc1.js +1 -0
- package/packages/storefront/dist/client/_astro/ecom-icon_12falx.png +0 -0
- package/packages/storefront/dist/client/_astro/ecom-icon_15pqnO.png +0 -0
- package/packages/storefront/dist/client/_astro/ecom-icon_t3guw.png +0 -0
- package/packages/storefront/dist/client/_astro/ecom-utils.c385a436.js +1 -0
- package/packages/storefront/dist/client/_astro/firebase-app.992a296f.js +16 -0
- package/packages/storefront/dist/client/_astro/format-money.8962a5ab.js +1 -0
- package/packages/storefront/dist/client/_astro/hoisted.57d8d9d0.js +1 -0
- package/packages/storefront/dist/client/_astro/hoisted.f16496bc.js +1 -0
- package/packages/storefront/dist/client/_astro/i18n.78f362d9.js +1 -0
- package/packages/storefront/dist/client/_astro/img-sizes.41e0efe4.js +1 -0
- package/packages/storefront/dist/client/_astro/img.bfbd75a8.js +1 -0
- package/packages/storefront/dist/client/_astro/{firebase-app.3f59f3c7.js → index-61e5ac61.bdc8d0cd.js} +129 -99
- package/packages/storefront/dist/client/_astro/index.e02b88b7.js +1 -0
- package/packages/storefront/dist/client/_astro/index.e20e07e3.js +1 -0
- package/packages/storefront/dist/client/_astro/logo_1UBsBq.webp +0 -0
- package/packages/storefront/dist/client/_astro/logo_Z1K5PE9.png +0 -0
- package/packages/storefront/dist/client/_astro/logo_Z1KIIl1.avif +0 -0
- package/packages/storefront/dist/client/_astro/modules-info.3c447a07.js +1 -0
- package/packages/storefront/dist/client/_astro/name.3cd31c8b.js +1 -0
- package/packages/storefront/dist/client/_astro/photoswipe-lightbox.esm.c157838f.js +4 -0
- package/packages/storefront/dist/client/_astro/photoswipe.01431ec7.js +2 -0
- package/packages/storefront/dist/client/_astro/photoswipe.esm.92c2d901.js +4 -0
- package/packages/storefront/dist/client/_astro/price.04ceb6c4.js +1 -0
- package/packages/storefront/dist/client/_astro/rect8589_1TtOHY.png +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_Uxfdf.png +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_Z15uApA.png +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_Z1JT1HB.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_tMFW0.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect859_DIqwR.png +0 -0
- package/packages/storefront/dist/client/_astro/rect859_Z1IKDb2.png +0 -0
- package/packages/storefront/dist/client/_astro/rect859_Z2kFHGk.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect859_jXzBi.png +0 -0
- package/packages/storefront/dist/client/_astro/rect859_x1l16.webp +0 -0
- package/packages/storefront/dist/client/_astro/sf-utils.b04e1813.js +1 -0
- package/packages/storefront/dist/client/_astro/shopping-cart.6b03b120.js +1 -0
- package/packages/storefront/dist/client/_astro/use-analytics.d0c184ef.js +1 -0
- package/packages/storefront/dist/client/_astro/use-product-card.e0990572.js +1 -0
- package/packages/storefront/dist/client/robots.txt +1 -1
- package/packages/storefront/dist/client/~fallback.html +21 -14
- package/packages/storefront/dist/client/~index.html +43 -36
- package/packages/storefront/dist/server/chunks/CartSidebar_03b51b57.mjs +203 -0
- package/packages/storefront/dist/server/chunks/SearchModal_2afca4fe.mjs +18 -0
- package/packages/storefront/dist/server/chunks/_.._4def02ff.mjs +6 -0
- package/packages/storefront/dist/server/chunks/account_2ee873cf.mjs +6 -0
- package/packages/storefront/dist/server/chunks/astro/assets-service_66a9c838.mjs +496 -0
- package/packages/storefront/dist/server/chunks/{astro.708269c6.mjs → astro_8447f017.mjs} +208 -1878
- package/packages/storefront/dist/server/chunks/index_37bacd45.mjs +6 -0
- package/packages/storefront/dist/server/chunks/index_5dcbbe32.mjs +6 -0
- package/packages/storefront/dist/server/chunks/node_b3ae36f1.mjs +6 -0
- package/packages/storefront/dist/server/chunks/pages/{_...slug_.astro.0808946e.mjs → __80fd1c60.mjs} +1781 -950
- package/packages/storefront/dist/server/chunks/pages/account_bfd9a66a.mjs +21 -0
- package/packages/storefront/dist/server/chunks/pages/index_8e1d063c.mjs +295 -0
- package/packages/storefront/dist/server/chunks/pages/node_530334cf.mjs +160 -0
- package/packages/storefront/dist/server/chunks/pages/~fallback_6ff698cd.mjs +30 -0
- package/packages/storefront/dist/server/chunks/photoswipe_9528923e.mjs +3 -0
- package/packages/storefront/dist/server/chunks/~fallback_7c4b84d5.mjs +6 -0
- package/packages/storefront/dist/server/entry.mjs +1012 -2526
- package/packages/storefront/dist/server/images.dist.csv +30 -30
- package/packages/storefront/dist/server/manifest_2019b8a9.mjs +1069 -0
- package/packages/storefront/dist/server/renderers.mjs +335 -51
- package/packages/storefront/dist/server/static-builds.csv +66 -51
- package/packages/storefront/package.json +4 -5
- package/packages/storefront/src/env.d.ts +1 -1
- package/packages/storefront/src/images/get-built-image.ts +36 -8
- package/packages/storefront/src/images/get-built-picture.ts +3 -130
- package/packages/storefront/src/images/picture-base.ts +135 -0
- package/packages/storefront/src/images/use-ssr-picture.ts +18 -10
- package/packages/storefront/src/lib/components/Picture.astro +47 -4
- package/packages/test-base/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/packages/storefront/dist/client/_astro/Carousel.4bf71bce.js +0 -1
- package/packages/storefront/dist/client/_astro/CartSidebar.05b12b39.js +0 -1
- package/packages/storefront/dist/client/_astro/HeroSlider.fe108a14.js +0 -1
- package/packages/storefront/dist/client/_astro/PitchBar.2c821b77.js +0 -1
- package/packages/storefront/dist/client/_astro/Prices.78eb0a61.js +0 -1
- package/packages/storefront/dist/client/_astro/ProductShelf.46d8a51c.js +0 -1
- package/packages/storefront/dist/client/_astro/SearchModal.cffd4c2d.js +0 -1
- package/packages/storefront/dist/client/_astro/ShopHeader.3694a82b.js +0 -4
- package/packages/storefront/dist/client/_astro/_...slug_.a4a7a874.css +0 -1
- package/packages/storefront/dist/client/_astro/_plugin-vue_export-helper.ee681fa8.js +0 -1
- package/packages/storefront/dist/client/_astro/api.a2eda23e.js +0 -1
- package/packages/storefront/dist/client/_astro/client.e6d9439a.js +0 -1
- package/packages/storefront/dist/client/_astro/ecom-icon_CDmhA.png +0 -0
- package/packages/storefront/dist/client/_astro/ecom-icon_Z27EX9f.png +0 -0
- package/packages/storefront/dist/client/_astro/ecom-icon_Zo1CLq.png +0 -0
- package/packages/storefront/dist/client/_astro/format-money.923559cc.js +0 -1
- package/packages/storefront/dist/client/_astro/hoisted.648beb9d.js +0 -1
- package/packages/storefront/dist/client/_astro/img.ec6ba316.js +0 -1
- package/packages/storefront/dist/client/_astro/index.fadf28bd.js +0 -1
- package/packages/storefront/dist/client/_astro/logo_144owC.webp +0 -0
- package/packages/storefront/dist/client/_astro/logo_1ug3XF.png +0 -0
- package/packages/storefront/dist/client/_astro/logo_Z1EIN1I.avif +0 -0
- package/packages/storefront/dist/client/_astro/modules-info.df822732.js +0 -1
- package/packages/storefront/dist/client/_astro/preload-helper.cf010ec4.js +0 -1
- package/packages/storefront/dist/client/_astro/rect8589_1ND0he.png +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_1mIaKd.png +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_Z2a06Gx.png +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_Z2nulUU.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect8589_ZH7hsH.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect859_1IVKep.png +0 -0
- package/packages/storefront/dist/client/_astro/rect859_1zkdb4.webp +0 -0
- package/packages/storefront/dist/client/_astro/rect859_CnIof.png +0 -0
- package/packages/storefront/dist/client/_astro/rect859_Z1OtQaE.avif +0 -0
- package/packages/storefront/dist/client/_astro/rect859_flB3g.png +0 -0
- package/packages/storefront/dist/client/_astro/session-utm.744b0db3.js +0 -1
- package/packages/storefront/dist/client/_astro/workbox-window.prod.es5.a7b12eab.js +0 -2
- package/packages/storefront/dist/client/manifest.webmanifest +0 -1
- package/packages/storefront/dist/client/sw.js +0 -1
- package/packages/storefront/dist/client/workbox-1b331600.js +0 -1
- package/packages/storefront/dist/server/chunks/CartSidebar.4179ad81.mjs +0 -386
- package/packages/storefront/dist/server/chunks/SearchModal.146ce2f7.mjs +0 -37
- package/packages/storefront/dist/server/chunks/_...05c626ea.mjs +0 -28
- package/packages/storefront/dist/server/chunks/account@_@astro.5eaddaf8.mjs +0 -28
- package/packages/storefront/dist/server/chunks/index@_@astro.25a343cc.mjs +0 -28
- package/packages/storefront/dist/server/chunks/index@_@astro.2d2f2e33.mjs +0 -28
- package/packages/storefront/dist/server/chunks/pages/account.astro.32e7e6ef.mjs +0 -23
- package/packages/storefront/dist/server/chunks/pages/index.astro.d4145872.mjs +0 -186
- package/packages/storefront/dist/server/chunks/pages/~fallback.astro.84d4765b.mjs +0 -49
- package/packages/storefront/dist/server/chunks/~fallback@_@astro.86d710c3.mjs +0 -28
- package/packages/storefront/dist/server/manifest.webmanifest +0 -1
- package/packages/storefront/dist/server/registerSW.js +0 -1
- /package/packages/storefront/dist/client/_astro/{headphone_1Ekzdh.avif → headphone_T2Jjc.avif} +0 -0
- /package/packages/storefront/dist/client/_astro/{headphone_Z1GbHcH.webp → headphone_Z1CG18r.webp} +0 -0
- /package/packages/storefront/dist/client/_astro/{passion_1LvKlp.webp → passion_LHbe9.webp} +0 -0
- /package/packages/storefront/dist/client/_astro/{passion_2PSWs.avif → passion_Z23MeUb.avif} +0 -0
- /package/packages/storefront/dist/client/_astro/{rect8589_1A8K2Q.webp → rect8589_1f5opX.webp} +0 -0
- /package/packages/storefront/dist/client/_astro/{rect8589_ZorpIx.webp → rect8589_IUskt.webp} +0 -0
- /package/packages/storefront/dist/client/_astro/{rect8589_Z1NFjiR.avif → rect8589_Z1Ap1Im.avif} +0 -0
- /package/packages/storefront/dist/client/_astro/{rect8589_LhopI.avif → rect8589_ZY9mtN.avif} +0 -0
- /package/packages/storefront/dist/client/_astro/{rect859_1CcLjM.avif → rect859_1TgQXS.avif} +0 -0
- /package/packages/storefront/dist/client/_astro/{rect859_299fN7.avif → rect859_2Nm1z.avif} +0 -0
- /package/packages/storefront/dist/client/_astro/{rect859_sLbkT.webp → rect859_Z29FI4V.webp} +0 -0
- /package/packages/storefront/dist/client/_astro/{rect859_rsWaw.webp → rect859_ZkpPFI.webp} +0 -0
- /package/packages/storefront/dist/client/_astro/{rect89_1yf5jS.avif → rect89_1TSfW7.avif} +0 -0
- /package/packages/storefront/dist/client/_astro/{rect89_GQBli.webp → rect89_Z1re32x.webp} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [0.34.0](https://github.com/ecomplus/cloud-commerce/compare/v0.33.5...v0.34.0) (2023-11-26)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### ⚠ BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
* **storefront:** Updating to Astro v3
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* **storefront:** Updating to Astro v3 ([7a0b529](https://github.com/ecomplus/cloud-commerce/commit/7a0b5295357c0fc9f1946e5b98578e0adaefa86c))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **storefront:** Updating custom `<Picture>` handlers for Astro v3 assets ([#233](https://github.com/ecomplus/cloud-commerce/issues/233)) ([5396645](https://github.com/ecomplus/cloud-commerce/commit/53966455cbd595b07300a22f8a5726ef553eef2c))
|
|
20
|
+
|
|
5
21
|
### [0.33.5](https://github.com/ecomplus/cloud-commerce/compare/v0.33.4...v0.33.5) (2023-11-24)
|
|
6
22
|
|
|
7
23
|
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"main": "index.js",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@cloudcommerce/feeds": "^0.33.
|
|
19
|
-
"@cloudcommerce/firebase": "^0.33.
|
|
20
|
-
"@cloudcommerce/passport": "^0.33.
|
|
18
|
+
"@cloudcommerce/feeds": "^0.33.5",
|
|
19
|
+
"@cloudcommerce/firebase": "^0.33.5",
|
|
20
|
+
"@cloudcommerce/passport": "^0.33.5"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
},
|
|
18
18
|
"main": "index.js",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@cloudcommerce/api": "^0.33.
|
|
21
|
-
"@cloudcommerce/firebase": "^0.33.
|
|
22
|
-
"@cloudcommerce/ssr": "^0.33.
|
|
20
|
+
"@cloudcommerce/api": "^0.33.5",
|
|
21
|
+
"@cloudcommerce/firebase": "^0.33.5",
|
|
22
|
+
"@cloudcommerce/ssr": "^0.33.5",
|
|
23
23
|
"@headlessui/vue": "^1.7.16"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@cloudcommerce/i18n": "^0.33.
|
|
27
|
-
"@cloudcommerce/storefront": "^0.33.
|
|
28
|
-
"@cloudcommerce/types": "^0.33.
|
|
26
|
+
"@cloudcommerce/i18n": "^0.33.5",
|
|
27
|
+
"@cloudcommerce/storefront": "^0.33.5",
|
|
28
|
+
"@cloudcommerce/types": "^0.33.5",
|
|
29
29
|
"@fontsource/croissant-one": "^5.0.17",
|
|
30
30
|
"@iconify-json/mingcute": "^1.1.11",
|
|
31
31
|
"photoswipe": "^5.4.2"
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"main": "index.js",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@cloudcommerce/events": "^0.33.
|
|
19
|
-
"@cloudcommerce/firebase": "^0.33.
|
|
20
|
-
"@cloudcommerce/modules": "^0.33.
|
|
18
|
+
"@cloudcommerce/events": "^0.33.5",
|
|
19
|
+
"@cloudcommerce/firebase": "^0.33.5",
|
|
20
|
+
"@cloudcommerce/modules": "^0.33.5"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"url": "https://github.com/ecomplus/cloud-commerce/issues"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@cloudcommerce/cli": "^0.33.
|
|
26
|
+
"@cloudcommerce/cli": "^0.33.5"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@cloudcommerce/eslint": "^0.33.
|
|
29
|
+
"@cloudcommerce/eslint": "^0.33.5"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudcommerce",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.34.0",
|
|
5
5
|
"description": "Open fair-code headless commerce platform: API-first, microservices based, event driven and cloud native",
|
|
6
6
|
"main": "packages/api/lib/index.js",
|
|
7
7
|
"author": "E-Com Club Softwares para E-commerce <ti@e-com.club>",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"vite": "^4.5.0",
|
|
31
31
|
"vitest": "^0.34.6",
|
|
32
32
|
"zx": "^7.2.3",
|
|
33
|
-
"@cloudcommerce/eslint": "0.
|
|
33
|
+
"@cloudcommerce/eslint": "0.34.0"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"fix-install": "bash scripts/pre-install.sh && pnpm i",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/ssr",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.34.0",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce storefront SSR",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
"build:workers": "npx tsc -p src/cloudflare --outDir cloudflare && npx eslint --ext .js cloudflare --fix"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@astrojs/node": "
|
|
28
|
+
"@astrojs/node": "6.0.4",
|
|
29
29
|
"@cloudcommerce/api": "workspace:*",
|
|
30
30
|
"@cloudcommerce/firebase": "workspace:*",
|
|
31
31
|
"@cloudcommerce/i18n": "workspace:*",
|
|
32
32
|
"@ecomplus/utils": "1.5.0-rc.5",
|
|
33
33
|
"@vueuse/core": "10.6.1",
|
|
34
|
-
"astro": "
|
|
34
|
+
"astro": "3.6.0",
|
|
35
35
|
"astro-capo": "^0.0.1",
|
|
36
36
|
"axios": "^1.6.2",
|
|
37
37
|
"firebase-admin": "^11.11.0",
|
|
@@ -61,5 +61,5 @@ declare global {
|
|
|
61
61
|
// for type re-export
|
|
62
62
|
declare global {
|
|
63
63
|
// @ts-ignore
|
|
64
|
-
export type { Component, ComponentPublicInstance, ComputedRef, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
|
|
64
|
+
export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
|
|
65
65
|
}
|
|
@@ -2,10 +2,9 @@ import { fileURLToPath } from 'node:url';
|
|
|
2
2
|
import { lstatSync, readFileSync } from 'node:fs';
|
|
3
3
|
import { join as joinPath, relative as relativePath } from 'node:path';
|
|
4
4
|
import * as dotenv from 'dotenv';
|
|
5
|
-
import { defineConfig } from 'astro/config';
|
|
5
|
+
import { defineConfig, passthroughImageService } from 'astro/config';
|
|
6
6
|
import node from '@astrojs/node';
|
|
7
7
|
import vue from '@astrojs/vue';
|
|
8
|
-
import image from '@astrojs/image';
|
|
9
8
|
import UnoCSS from 'unocss/astro';
|
|
10
9
|
import AstroPWA from '@vite-pwa/astro';
|
|
11
10
|
import AutoImport from 'unplugin-auto-import/astro';
|
|
@@ -209,23 +208,19 @@ const genAstroConfig = ({
|
|
|
209
208
|
viteAlias.push({
|
|
210
209
|
find: 'virtual:pwa-info',
|
|
211
210
|
replacement: joinPath(__dirname, 'config/astro/mock-pwa-info.mjs'),
|
|
211
|
+
}, {
|
|
212
|
+
find: 'virtual:pwa-register',
|
|
213
|
+
replacement: joinPath(__dirname, 'config/astro/mock-pwa-info.mjs'),
|
|
212
214
|
});
|
|
213
215
|
}
|
|
214
|
-
if (!isToServerless) {
|
|
215
|
-
integrations.push(image({
|
|
216
|
-
serviceEntryPoint: '@astrojs/image/sharp',
|
|
217
|
-
}));
|
|
218
|
-
}
|
|
219
216
|
return {
|
|
220
|
-
experimental: {
|
|
221
|
-
viewTransitions: true,
|
|
222
|
-
},
|
|
223
217
|
output: isSSG ? 'static' : 'server',
|
|
224
218
|
adapter: isSSG ? undefined : node({
|
|
225
219
|
mode: 'middleware',
|
|
226
220
|
}),
|
|
227
221
|
outDir,
|
|
228
222
|
integrations,
|
|
223
|
+
image: isToServerless ? { service: passthroughImageService() } : undefined,
|
|
229
224
|
site,
|
|
230
225
|
compressHTML: isToServerless,
|
|
231
226
|
build: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as M,f as _,E as T,b as V,i as A}from"./customer-session.2d173cc1.js";import{_ as P,a as I,v as R,w as k}from"./_plugin-vue_export-helper.dd1a60ce.js";import{a as j}from"./index.e02b88b7.js";import{g as B,b as O,c as q}from"./index-61e5ac61.bdc8d0cd.js";import{b as D}from"./index.e20e07e3.js";import{a as f,w as h,J as C,c as z,K as F,f as l,h as c,W as N,N as i,O as S,L as r,M as b,T as L,P as E,Q as x,R as U,a0 as K,a1 as W,U as G,V as J}from"./ecom-utils.c385a436.js";import"./sf-utils.b04e1813.js";const Q=m=>{M();const s=m?.canUseUrlParams!==!1?j("history"):{},e=s.sign_up!==void 0&&s.sign_up!=="0",a=s.password!==void 0&&s.password!=="0",u=f(e),n=f(!e&&!a);h(u,p=>{p?(n.value=!0,s.sign_up="1"):s.sign_up="0"}),h(n,p=>{s.password=p?"0":"1"});const o=f(""),d=f(!1),g=D(async p=>{d.value=!0;const v=Date.now(),y=B();if(_.value){window.localStorage.setItem(T,_.value);try{if(n.value){const w=new URL(p||window.location.toString());w.searchParams.append("email",_.value),await O(y,_.value,{url:w.toString(),handleCodeInApp:!0})}else await q(y,_.value,o.value)}catch(w){console.warn(w.code),console.error(w)}setTimeout(()=>{d.value=!1},Math.min(2e3-(Date.now()-v),1))}},2e3);return{isLinkSignIn:n,isSignUp:u,email:_,password:o,isSubmitting:d,submitLogin:g}},Y=C({__name:"LoginForm",props:{loginLinkActionUrl:{}},setup(m,{expose:t}){t();const{isLinkSignIn:s,isSignUp:e,email:a,password:u,isSubmitting:n,submitLogin:o}=Q(),d=f(!1),g=f(0),p=z(()=>g.value>9);h(n,()=>{!n.value&&s.value&&(d.value=!0,g.value+=1)}),h([a,e],()=>{d.value=!1}),h(p,()=>{s.value=!1});const v={isLinkSignIn:s,isSignUp:e,email:a,password:u,isSubmitting:n,submitLogin:o,isEmailSentMsg:d,countEmailsSent:g,isLinkSignInBlocked:p,get customerName(){return V}};return Object.defineProperty(v,"__isScriptSetup",{enumerable:!1,value:!0}),v}}),$={class:"text-base-600 mb-4 text-2xl font-light"},H={key:0},X={key:1,class:"lowercase"},Z={key:0,for:"login-form-email"},ee={class:"relative"},se=["disabled"],te={key:0,class:"text-success-800 absolute left-0 top-0 mt-4 font-medium"},ne=i("i",{class:"i-check mr-1"},null,-1);function ie(m,t,s,e,a,u){const n=F("Fade");return l(),c("form",{class:"text-base-800 w-full max-w-sm bg-white p-6 text-base md:p-8",onSubmit:t[4]||(t[4]=k(()=>e.submitLogin(s.loginLinkActionUrl),["prevent"]))},[N(m.$slots,"head"),i("p",$,[S(r("Olá")+" "),e.customerName?(l(),c("span",H,r(e.customerName),1)):(l(),c("span",X,r("Visitante")))]),e.isLinkSignIn?(l(),c("label",Z,r("Enviar link de acesso por e-mail"))):b("",!0),L(i("input",{id:"login-form-email",type:"email",placeholder:"email@mail.com","onUpdate:modelValue":t[0]||(t[0]=o=>e.email=o),class:"mb-0.5 mt-2 w-full rounded",required:""},null,512),[[I,e.email]]),e.isLinkSignIn?b("",!0):L((l(),c("input",{key:1,type:"password",placeholder:"Senha","onUpdate:modelValue":t[1]||(t[1]=o=>e.password=o),class:"mb-0.5 mt-2 w-full rounded lowercase",required:""},null,512)),[[I,e.password]]),i("div",ee,[i("div",{class:E(["transition-opacity",e.isEmailSentMsg&&"opacity-0 invisible"])},[L(i("a",{href:"?password",class:"ui-link text-base-500 text-right text-sm lowercase",onClick:t[2]||(t[2]=k(o=>e.isLinkSignIn=!e.isLinkSignIn,["prevent"]))},r(e.isLinkSignIn?"Entrar com senha":"Esqueci minha senha"),513),[[R,!e.isSignUp&&!e.isLinkSignInBlocked]]),i("button",{type:"submit",disabled:e.isSubmitting,class:E(["ui-btn-lg ui-btn-primary mb-2 mt-5 w-full",e.isSubmitting&&"opacity-50"])},r(e.isSignUp?"Cadastrar":"Acessar minha conta"),11,se)],2),x(n,{speed:"slow"},{default:U(()=>[e.isEmailSentMsg?(l(),c("p",te,[ne,S(" "+r("Te enviamos o e-mail, verifique sua caixa de entrada e spam se necessário."),1)])):b("",!0)]),_:1}),i("a",{href:"?sign_up",class:"ui-btn-lg ui-btn-contrast block w-full text-center",onClick:t[3]||(t[3]=k(o=>e.isSignUp=!e.isSignUp,["prevent"]))},r(e.isSignUp?"Acessar minha conta":"Criar uma conta"),1)])],32)}const ae=P(Y,[["render",ie]]),oe=C({__name:"AccountPage",setup(m,{expose:t}){t();let s=null;{const{location:a}=window,u=new URLSearchParams(a.search).get("return_url");if(!u){const n=new URL(a.toString());n.pathname="/app/",n.hash=`#${a.pathname.replace("/app/","/")}`,s=n.toString()}h(A,()=>{A.value&&(a.href=u||s)},{immediate:!0})}const e={get loginLinkActionUrl(){return s},set loginLinkActionUrl(a){s=a},LoginForm:ae};return Object.defineProperty(e,"__isScriptSetup",{enumerable:!1,value:!0}),e}}),re={class:"from-secondary-700 to-secondary-950 flex min-h-screen w-full flex-col justify-center bg-gradient-to-br"},le={class:"mx-auto p-4"},ce=i("section",{class:"ui-section text-center"},[i("a",{href:"/",class:"text-base-200 hover:text-white"},[i("i",{class:"i-arrow-right mr-1 rotate-180"}),S(" "+r("Ir para a loja"))])],-1),me={class:"overflow-hidden rounded-md shadow-md ring-4 ring-black/10"},ue={class:"mb-5 text-center"},de={href:"/",class:"inline-block"},pe={key:0,class:"ui-section px-0"},ge={class:"mx-auto flex max-w-sm flex-wrap items-center justify-evenly gap-4 px-3"};function _e(m,t,s,e,a,u){const n=F("ALink");return l(),c("article",re,[i("div",le,[ce,i("section",me,[x(e.LoginForm,K(W({loginLinkActionUrl:e.loginLinkActionUrl})),{head:U(()=>[i("div",ue,[i("a",de,[N(m.$slots,"logo")])])]),_:3},16)]),m.$settings.serviceLinks?.length?(l(),c("nav",pe,[i("ul",ge,[(l(!0),c(G,null,J(m.$settings.serviceLinks,({title:o,href:d},g)=>(l(),c("li",{key:`s-${g}`},[x(n,{href:d,class:"ui-link text-base-200 hover:text-white"},{default:U(()=>[S(r(o),1)]),_:2},1032,["href"])]))),128))])])):b("",!0)])])}const Le=P(oe,[["render",_e]]);export{Le as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as b,w as x}from"./_plugin-vue_export-helper.dd1a60ce.js";import{f as C}from"./modules-info.3c447a07.js";import{p as I,r as S,s as w,t as V}from"./shopping-cart.6b03b120.js";import{Q as F,C as P}from"./QuantitySelector.e74e368a.js";import{P as v}from"./Prices.311303d8.js";import{c as p,J as y,K as f,f as i,h as m,Q as d,R as k,X as j,M as h,N as t,L as o,O as g,U as L,V as N}from"./ecom-utils.c385a436.js";import{g as z}from"./name.3cd31c8b.js";import{g as A}from"./img.bfbd75a8.js";import"./afetch.f4507208.js";import"./sf-utils.b04e1813.js";import"./format-money.8962a5ab.js";import"./price.04ceb6c4.js";import"./customer-session.2d173cc1.js";import"./index.e20e07e3.js";import"./i18n.78f362d9.js";const q=a=>{const s=p(()=>!a.item&&a.product?I(a.product):null),r=p(()=>a.item||s.value),e=p(()=>z(r.value)),n=p(()=>{const{slug:l}=r.value;return typeof l=="string"?`/${l}`:null}),u=p(()=>{if(r.value.picture)return A(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:F,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 J=b(B,[["render",D]]),K=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:P,Prices:v,CartItem:J};return Object.defineProperty(n,"__isScriptSetup",{enumerable:!1,value:!0}),n}}),T={class:"flex h-screen flex-col bg-white"},X={class:"z-10 flex items-center justify-end gap-3 px-6 py-4 shadow ring-1 ring-black/5"},G=t("span",{class:"text-base-600 text-right text-base font-medium"},o("Meu carrinho de compras"),-1),H={class:"min-w-[3rem] text-right"},W={class:"ui-badge-pill-lg"},Y={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",T,[t("header",X,[G,t("span",H,[t("span",W,o(e.totalItems),1)])]),t("article",Y,[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(L,null,N(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(K,[["render",le]]);export{Se as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as w,v as B}from"./_plugin-vue_export-helper.dd1a60ce.js";import{p as f}from"./modules-info.3c447a07.js";import{c as d,J as T,K as x,f as r,h as l,Q as c,R as o,W as k,P as b,X as v,O as y,L as g,Y as C,M as m,a as H,o as L,T as N,N as _,U as P,V,Z as j}from"./ecom-utils.c385a436.js";import"./afetch.f4507208.js";import"./sf-utils.b04e1813.js";import"./format-money.8962a5ab.js";import"./price.04ceb6c4.js";const M=s=>{const a=d(()=>s.title?f(s.title).value:""),t=d(()=>s.subtitle?f(s.subtitle).value:""),e=d(()=>s.buttonText?f(s.buttonText).value:""),i=d(()=>!!(a.value||t.value||e.value));return{parsedTitle:a,parsedSubtitle:t,parsedButtonText:e,hasHeader:i}},D=T({__name:"Banner",props:{img:{},alt:{},mobileImg:{},href:{},title:{},subtitle:{},buttonLink:{},buttonText:{},headingTag:{default:"h3"}},setup(s,{expose:a}){a();const t=s,{hasHeader:e,parsedTitle:i,parsedSubtitle:p,parsedButtonText:n}=M(t),u={props:t,hasHeader:e,parsedTitle:i,parsedSubtitle:p,parsedButtonText:n};return Object.defineProperty(u,"__isScriptSetup",{enumerable:!1,value:!0}),u}}),O={key:0,class:"mb-3 p-12 sm:mb-0 xl:ps-32"},z={key:1,class:"mt-4 text-lg md:mt-6"};function A(s,a,t,e,i,p){const n=x("ALink");return r(),l("div",{class:b(["mx-auto overflow-x-hidden",e.hasHeader?"grid grid-cols-1 sm:grid-cols-2 items-center":null])},[c(n,{href:t.href,class:b(e.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")},{default:o(()=>[k(s.$slots,"picture")]),_:3},8,["href","class"]),e.hasHeader?(r(),l("div",O,[e.parsedTitle?(r(),v(C(t.headingTag),{key:0,class:"ui-title mt-1"},{default:o(()=>[y(g(e.parsedTitle),1)]),_:1})):m("",!0),e.parsedSubtitle?(r(),l("p",z,g(e.parsedSubtitle),1)):m("",!0),e.parsedButtonText?(r(),v(n,{key:2,href:t.buttonLink,class:"ui-btn-lg ui-btn-contrast mt-7 min-w-[150px] md:mt-10"},{default:o(()=>[y(g(e.parsedButtonText),1)]),_:1},8,["href"])):m("",!0)])):m("",!0)],2)}const E=w(D,[["render",A]]),F=T({__name:"HeroSlider",props:{autoplay:{},slides:{}},setup(s,{expose:a}){a();const t=H(!1);L(()=>{t.value=!0});const e={isMounted:t,Banner:E};return Object.defineProperty(e,"__isScriptSetup",{enumerable:!1,value:!0}),e}}),I={class:"relative mx-auto"},J={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"},K=_("i",{class:"i-arrow-right rotate-180"},null,-1),Q=_("i",{class:"i-arrow-right"},null,-1);function R(s,a,t,e,i,p){const n=x("CarouselControl"),u=x("Carousel");return r(),l("section",I,[c(u,{autoplay:t.autoplay,class:"secondary [&>*]:items-center"},{controls:o(()=>[N(_("div",J,[_("div",{class:b(["text-primary relative h-10 w-20 rounded-full bg-white/50 shadow-sm ring-1 ring-black/5 transition-opacity",e.isMounted?"opacity-100":"opacity-20 [&>*]:cursor-wait"])},[c(n,{class:"hover:bg-primary/10 h-10 w-10 rounded-full","is-prev":""},{default:o(()=>[K]),_:1}),c(n,{class:"hover:bg-primary/10 h-10 w-10 rounded-full"},{default:o(()=>[Q]),_:1})],2)],512),[[B,t.slides.length>1]])]),default:o(()=>[(r(!0),l(P,null,V(t.slides,(S,h)=>(r(),l("li",{key:h,class:"shrink-0 basis-full"},[c(e.Banner,j({...S,headingTag:h===0?"h2":"h3"},{class:"w-screen max-w-screen-2xl"}),{picture:o(()=>[k(s.$slots,`picture-${h}`)]),_:2},1040)]))),128))]),_:3},8,["autoplay"])])}const $=w(F,[["render",R]]);export{$ as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as C,v as g}from"./_plugin-vue_export-helper.dd1a60ce.js";import{p as x}from"./modules-info.3c447a07.js";import{S as b,c as m,J as w,K as p,h as r,N as h,Q as i,R as u,f as l,T as S,U as y,V as B,P as k,M as P}from"./ecom-utils.c385a436.js";import"./afetch.f4507208.js";import"./sf-utils.b04e1813.js";import"./format-money.8962a5ab.js";import"./price.04ceb6c4.js";function V(t,e){{const s=btoa(JSON.stringify({filename:t}));window.parent.postMessage(JSON.parse(JSON.stringify({type:"open",filename:t,id:s})),window.location.origin),window.addEventListener("message",n=>{n.data.id===s&&e(n.data.data)})}}const L=t=>{const e=b(null);return window.$isCmsPreview&&V(t,s=>{e.value=s}),{liveContent:e}},N=t=>{const e={slides:[]};return t.header?.pitchBar&&(e.slides=t.header.pitchBar),e},J=t=>{const{liveContent:e}=L("layout"),s=m(()=>(e.value?N(e.value).slides:t.slides).map(({html:o})=>x(o).value.replace(/<\/?p>/g,"").replace(/<(\/?d-md)>/g,"<$1>"))),n=m(()=>s.value.filter(a=>a).length);return{parsedContents:s,countValidSlides:n}},M=w({__name:"PitchBar",props:{slides:{}},setup(t,{expose:e}){e();const s=t,{parsedContents:n,countValidSlides:a}=J(s),o={props:s,parsedContents:n,countValidSlides:a};return Object.defineProperty(o,"__isScriptSetup",{enumerable:!1,value:!0}),o}}),O={class:"bg-base-100 relative z-20"},T={class:"container mx-auto px-3 py-1 md:w-2/3"},z=["innerHTML"],A={class:"text-base-400 text-xl leading-none"};function E(t,e,s,n,a,o){const f=p("ALink"),_=p("CarouselControl"),v=p("Carousel");return l(),r("div",O,[h("div",T,[i(v,{autoplay:n.countValidSlides>1?7e3:void 0},{controls:u(()=>[S(h("div",A,[i(_,{class:"bg-base-100 hover:text-base-700 pr-2","is-prev":""}),i(_,{class:"bg-base-100 hover:text-base-700 pl-2"})],512),[[g,n.countValidSlides>1]])]),default:u(()=>[(l(!0),r(y,null,B(s.slides,(c,d)=>(l(),r("li",{key:d,class:"h-full shrink-0 basis-full text-center"},[i(f,{href:c.href,target:c.target,class:k(["inline-block px-8",c.href?"hover:underline":null])},{default:u(()=>[n.parsedContents[d]?(l(),r("span",{key:0,innerHTML:n.parsedContents[d],class:"prose text-base-800 text-sm"},null,8,z)):P("",!0)]),_:2},1032,["href","target","class"])]))),128))]),_:1},8,["autoplay"])])])}const Q=C(M,[["render",E]]);export{Q as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as W,i as A,d as z,l as M}from"./modules-info.3c447a07.js";import{c as s,J as S,K as E,f as o,h as i,L as r,M as c,N as h,O as N,P as C,Q as L,R as B}from"./ecom-utils.c385a436.js";import{g,c as T}from"./price.04ceb6c4.js";import{_ as F}from"./_plugin-vue_export-helper.dd1a60ce.js";const j=(a,l)=>{const{type:n,value:e}=l;let d;return e?(n==="percentage"?d=a*((100-e)/100):d=a-e,d>0?d:0):a},R=a=>{const l=s(()=>a.product||{price:a.price||0,base_price:a.basePrice}),n=s(()=>{const{variations:t}=l.value;if(t){const u=g(l.value);for(let P=0;P<t.length;P++)if(g({...l.value,...t[P]})>u)return!0}return!1}),e=s(()=>{const t=g(l.value),u=W.value;return u&&(!u.min_amount||t>u.min_amount)?j(t,u):t}),d=s(()=>{if(T(l.value))return l.value.base_price;const t=g(l.value);return t>e.value?t:0}),_=s(()=>a.installmentsOption||A.value||{max_number:1}),m=s(()=>{if(_.value.max_number<=1)return 1;const t=_.value.min_installment||5,u=Math.floor(e.value/t);return Math.min(u,_.value.max_number)}),b=s(()=>_.value.monthly_interest||0),k=s(()=>{if(m.value>=2){if(!b.value)return e.value/m.value;const t=b.value/100;return e.value*t/(1-(1+t)**-m.value)}return 0}),f=s(()=>{const t=a.discountOption||z.value;return t&&(!t.min_amount||t.min_amount<=e.value)&&(!a.isAmountTotal||t.apply_at==="total")?t:{}}),O=s(()=>{const{label:t}=f.value;return t?t.includes(" ")?t:`via ${t}`:""}),V=s(()=>j(e.value,f.value)),v=s(()=>{if(a.loyaltyPointsProgram)return a.loyaltyPointsProgram;const t=M.value;if(t){const u=Object.keys(t);for(let P=0;P<u.length;P++){const p=t[u[P]];if(p?.earn_percentage&&p.earn_percentage>0)return p}}return{ratio:0}}),y=s(()=>v.value.min_subtotal_to_earn||0),w=s(()=>v.value.name||""),D=s(()=>v.value.earn_percentage||0),x=s(()=>D.value*v.value.ratio),I=s(()=>x.value>=1?e.value*(x.value/100):0);return{hasVariedPrices:n,salePrice:e,comparePrice:d,installmentsObject:_,installmentsNumber:m,monthlyInterest:b,installmentValue:k,discountObject:f,discountLabel:O,priceWithDiscount:V,pointsProgramObject:v,pointsMinPrice:y,pointsProgramName:w,earnPointsPercentage:D,cashbackPercentage:x,cashbackValue:I}},J=S({__name:"Prices",props:{isBig:{type:Boolean},isLiteral:{type:Boolean},hasCashback:{type:Boolean,default:!0},hasPriceOptions:{type:Boolean,default:!0},product:{},price:{},basePrice:{},isAmountTotal:{type:Boolean},installmentsOption:{},discountOption:{},loyaltyPointsProgram:{}},setup(a,{expose:l}){l();const n=a,{hasVariedPrices:e,salePrice:d,comparePrice:_,cashbackPercentage:m,cashbackValue:b,installmentsNumber:k,monthlyInterest:f,installmentValue:O,priceWithDiscount:V,discountLabel:v}=R(n),y={props:n,hasVariedPrices:e,salePrice:d,comparePrice:_,cashbackPercentage:m,cashbackValue:b,installmentsNumber:k,monthlyInterest:f,installmentValue:O,priceWithDiscount:V,discountLabel:v};return Object.defineProperty(y,"__isScriptSetup",{enumerable:!1,value:!0}),y}}),K={key:0,class:"text-base-500 mr-1 text-[87%]"},Q={key:0},q={key:1},G={key:0},H={key:0,class:"relative z-10"},U=["data-tooltip"],X=h("i",{class:"i-arrow-uturn-left mr-1"},null,-1),Y={class:"font-medium"},Z=h("small",null," cashback",-1),$={key:0},ee={key:0},te={key:1},ae={key:2},ne={key:0},se={key:0},re={key:1};function oe(a,l,n,e,d,_){const m=E("Fade");return o(),i("div",{class:C(["text-base-600 [&>div]:[font-size:90%] [&_small]:lowercase [&_small]:[font-size:92%]",n.isBig?"text-lg":null])},[e.comparePrice?(o(),i("span",K,[n.isLiteral?(o(),i("small",Q,r("De "))):c("",!0),h("s",null,r(a.$money(e.comparePrice)),1),n.isLiteral?(o(),i("small",q,r(" Por"))):c("",!0)])):c("",!0),h("strong",{class:C(["text-base-800",n.isBig?"text-4xl block":"inline-block"])},[e.hasVariedPrices?(o(),i("small",G,r("A partir de "))):c("",!0),N(" "+r(a.$money(e.salePrice)),1)],2),L(m,{slide:"down"},{default:B(()=>[e.cashbackValue&&n.hasCashback?(o(),i("div",H,[h("span",{"data-tooltip":"Receba $1 de volta".replace("$1",a.$percentage(e.cashbackPercentage))},[X,h("span",Y,r(a.$money(e.cashbackValue)),1),Z],8,U)])):c("",!0)]),_:1}),L(m,{slide:"down"},{default:B(()=>[e.installmentValue&&n.hasPriceOptions?(o(),i("div",$,[n.isLiteral?(o(),i("small",ee,r("Até "))):c("",!0),N(" "+r(e.installmentsNumber)+"x ",1),n.isLiteral?(o(),i("small",te,r(" De "))):c("",!0),h("span",null,r(a.$money(e.installmentValue)),1),!e.monthlyInterest&&n.isLiteral?(o(),i("small",ae,r(" Sem juros"))):c("",!0)])):c("",!0)]),_:1}),L(m,{slide:"down"},{default:B(()=>[e.priceWithDiscount<e.salePrice&&n.hasPriceOptions?(o(),i("div",ne,[e.discountLabel?c("",!0):(o(),i("small",se,r("A partir de "))),h("span",null,r(a.$money(e.priceWithDiscount)),1),e.discountLabel?(o(),i("small",re,r(` ${e.discountLabel}`),1)):c("",!0)])):c("",!0)]),_:1})],2)}const me=F(J,[["render",oe]]);export{me as P};
|