cloudcommerce 0.26.2 → 0.26.3
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 +13 -0
- package/ecomplus-stores/barra-doce/functions/many/package.json +3 -3
- package/ecomplus-stores/barra-doce/functions/ssr/index.js +0 -1
- package/ecomplus-stores/barra-doce/functions/ssr/package.json +8 -8
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/CartItem.vue +64 -0
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/CartSidebar.vue +38 -7
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/Prices.vue +2 -3
- package/ecomplus-stores/barra-doce/functions/ssr/src/components/ShopHeader.vue +8 -4
- package/ecomplus-stores/barra-doce/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/barra-doce/package.json +2 -2
- package/ecomplus-stores/iluminim/functions/many/package.json +3 -3
- package/ecomplus-stores/iluminim/functions/ssr/package.json +8 -8
- package/ecomplus-stores/iluminim/functions/ssr/src/components/CartItem.vue +64 -0
- package/ecomplus-stores/iluminim/functions/ssr/src/components/CartSidebar.vue +37 -6
- package/ecomplus-stores/iluminim/functions/ssr/src/components/Prices.vue +2 -3
- package/ecomplus-stores/iluminim/functions/ssr/src/components/ShopHeader.vue +6 -2
- package/ecomplus-stores/iluminim/functions/with-apps/package.json +3 -3
- package/ecomplus-stores/iluminim/package.json +2 -2
- package/package.json +3 -3
- 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 +2 -2
- 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/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/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 +3 -3
- 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/lib/firebase/functions-checkout/request-to-module.js +2 -2
- package/packages/modules/lib/firebase/functions-checkout/request-to-module.js.map +1 -1
- package/packages/modules/lib/firebase/functions-checkout/utils.js +21 -9
- package/packages/modules/lib/firebase/functions-checkout/utils.js.map +1 -1
- package/packages/modules/package.json +2 -2
- package/packages/modules/schemas/@checkout.cjs +0 -1
- package/packages/modules/src/firebase/functions-checkout/request-to-module.ts +2 -2
- package/packages/modules/src/firebase/functions-checkout/utils.ts +23 -9
- package/packages/passport/package.json +1 -1
- package/packages/ssr/package.json +2 -2
- package/packages/storefront/dist/client/_astro/{Carousel.926668f2.js → Carousel.0b24e2cb.js} +1 -1
- package/packages/storefront/dist/client/_astro/CartSidebar.2731d333.js +1 -0
- package/packages/storefront/dist/client/_astro/{HeroSlider.1f0524aa.js → HeroSlider.a70b2582.js} +1 -1
- package/packages/storefront/dist/client/_astro/{PitchBar.7407eeaf.js → PitchBar.13991988.js} +1 -1
- package/packages/storefront/dist/client/_astro/{Prices.562a32ab.js → Prices.cdfa346a.js} +1 -1
- package/packages/storefront/dist/client/_astro/{ProductShelf.763cd2ca.js → ProductShelf.619c56a5.js} +1 -1
- package/packages/storefront/dist/client/_astro/SearchModal.117a477d.js +1 -0
- package/packages/storefront/dist/client/_astro/{ShopHeader.126900a6.js → ShopHeader.2c2fded7.js} +2 -2
- package/packages/storefront/dist/client/_astro/_...slug_.b693913e.css +1 -0
- package/packages/storefront/dist/client/_astro/{_plugin-vue_export-helper.ee681fa8.js → _plugin-vue_export-helper.fc5e2f5b.js} +1 -1
- package/packages/storefront/dist/client/_astro/{api.a2eda23e.js → api.39f40cd8.js} +1 -1
- package/packages/storefront/dist/client/_astro/client.a5d2898b.js +1 -0
- package/packages/storefront/dist/client/_astro/{firebase-app.93857bfb.js → firebase-app.8c541cce.js} +3 -3
- package/packages/storefront/dist/client/_astro/{format-money.923559cc.js → format-money.86f14860.js} +1 -1
- package/packages/storefront/dist/client/_astro/hoisted.d90361ee.js +1 -0
- package/packages/storefront/dist/client/_astro/{img.ec6ba316.js → img.d4891d80.js} +1 -1
- package/packages/storefront/dist/client/_astro/index.33801818.js +1 -0
- package/packages/storefront/dist/client/_astro/{modules-info.48980668.js → modules-info.ec412b24.js} +1 -1
- package/packages/storefront/dist/client/_empty-middleware.mjs +3 -0
- package/packages/storefront/dist/client/chunks/CartSidebar.0ce1e999.mjs +382 -0
- package/packages/storefront/dist/client/chunks/SearchModal.f603145b.mjs +32 -0
- package/packages/storefront/dist/client/chunks/astro.11be33ee.mjs +1424 -0
- package/packages/storefront/dist/{server/chunks/pages/_...slug_.astro.fd8a229f.mjs → client/chunks/pages/_...slug_.astro.ec6517ba.mjs} +360 -274
- package/packages/storefront/dist/{server/chunks/pages/account.astro.3b21bff8.mjs → client/chunks/pages/account.astro.3d2605e6.mjs} +2 -10
- package/packages/storefront/dist/{server/chunks/pages/index.astro.dab642f5.mjs → client/chunks/pages/index.astro.8ad03206.mjs} +167 -17
- package/packages/storefront/dist/{server/chunks/pages/~fallback.astro.7630c0d6.mjs → client/chunks/pages/~fallback.astro.d31d20b4.mjs} +8 -20
- package/packages/storefront/dist/client/chunks/sharp.3f154e38.mjs +74 -0
- package/packages/storefront/dist/client/manifest.e39eb543.mjs +79 -0
- package/packages/storefront/dist/client/pages/_---slug_.astro.mjs +23 -0
- package/packages/storefront/dist/client/pages/app/account.astro.mjs +23 -0
- package/packages/storefront/dist/client/pages/app.astro.mjs +23 -0
- package/packages/storefront/dist/client/pages/index.astro.mjs +23 -0
- package/packages/storefront/dist/client/pages/~fallback.astro.mjs +23 -0
- package/packages/storefront/dist/client/registerSW.js +1 -0
- package/packages/storefront/dist/client/renderers.mjs +369 -0
- package/packages/storefront/dist/client/sw.js +1 -1
- package/packages/storefront/dist/server/chunks/{CartSidebar.2b555408.mjs → CartSidebar.cca9fdd3.mjs} +14 -24
- package/packages/storefront/dist/server/chunks/{SearchModal.f418e188.mjs → SearchModal.a680efae.mjs} +8 -19
- package/packages/storefront/dist/server/chunks/_...f7cdc954.mjs +24 -0
- package/packages/storefront/dist/server/chunks/account@_@astro.fa8b921b.mjs +24 -0
- package/packages/storefront/dist/server/chunks/{astro.bb5b7191.mjs → astro.440a2e08.mjs} +149 -1859
- package/packages/storefront/dist/server/chunks/image-endpoint@_@js.802bf648.mjs +24 -0
- package/packages/storefront/dist/server/chunks/index@_@astro.a122f091.mjs +24 -0
- package/packages/storefront/dist/server/chunks/index@_@astro.da98dcbe.mjs +24 -0
- package/packages/storefront/dist/server/chunks/pages/_...slug_.astro.08ba5973.mjs +3930 -0
- package/packages/storefront/dist/server/chunks/pages/account.astro.f11f26f3.mjs +15 -0
- package/packages/storefront/dist/server/chunks/pages/image-endpoint.js.a9374d3e.mjs +238 -0
- package/packages/storefront/dist/server/chunks/pages/index.astro.079f316a.mjs +1650 -0
- package/packages/storefront/dist/server/chunks/pages/~fallback.astro.01594623.mjs +55 -0
- package/packages/storefront/dist/server/chunks/sharp.52841bb4.mjs +75 -0
- package/packages/storefront/dist/server/chunks/~fallback@_@astro.876a97c5.mjs +24 -0
- package/packages/storefront/dist/server/entry.mjs +1167 -2360
- package/packages/storefront/dist/server/manifest.12e7a10c.mjs +561 -0
- package/packages/storefront/dist/server/renderers.mjs +10 -21
- package/packages/storefront/package.json +6 -6
- package/packages/storefront/src/lib/layouts/BaseHead.astro +3 -2
- package/packages/test-base/package.json +1 -1
- package/packages/types/modules/@checkout:params.d.ts +1 -1
- package/packages/types/package.json +1 -1
- package/ecomplus-stores/iluminim/.ecomplus.cd.json +0 -5
- package/packages/storefront/dist/client/_astro/CartSidebar.eadba34f.js +0 -1
- package/packages/storefront/dist/client/_astro/SearchModal.cffd4c2d.js +0 -1
- package/packages/storefront/dist/client/_astro/_...slug_.36cd433d.css +0 -1
- package/packages/storefront/dist/client/_astro/client.e6d9439a.js +0 -1
- package/packages/storefront/dist/client/_astro/hoisted.572313d6.js +0 -1
- package/packages/storefront/dist/client/_astro/index.709ac149.js +0 -1
- package/packages/storefront/dist/server/chunks/_...d32bcc0c.mjs +0 -35
- package/packages/storefront/dist/server/chunks/account@_@astro.0106855f.mjs +0 -35
- package/packages/storefront/dist/server/chunks/endpoint@_@js.35807882.mjs +0 -35
- package/packages/storefront/dist/server/chunks/index@_@astro.477f5af1.mjs +0 -35
- package/packages/storefront/dist/server/chunks/index@_@astro.e5a61d6e.mjs +0 -35
- package/packages/storefront/dist/server/chunks/pages/endpoint.js.247079ba.mjs +0 -119
- package/packages/storefront/dist/server/chunks/~fallback@_@astro.65227dd7.mjs +0 -35
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
import { defineComponent, computed, useSSRContext, mergeProps, inject, ref, provide, withCtx, renderSlot, resolveComponent, openBlock, createBlock, createCommentVNode, createVNode, toDisplayString, createTextVNode } from 'vue';
|
|
2
|
+
import { _ as _export_sfc, k as parseProduct, m as useId, r as removeCartItem, n as freeShippingFromValue, o as shoppingCart, t as totalItems } from './pages/_...slug_.astro.ec6517ba.mjs';
|
|
3
|
+
import { ssrRenderAttrs, ssrRenderSlot, ssrRenderAttr, ssrInterpolate, ssrIncludeBooleanAttr, ssrRenderComponent, ssrRenderList } from 'vue/server-renderer';
|
|
4
|
+
import { P as Prices } from './pages/index.astro.8ad03206.mjs';
|
|
5
|
+
import { name, img } from '@ecomplus/utils';
|
|
6
|
+
import './astro.11be33ee.mjs';
|
|
7
|
+
import 'clsx';
|
|
8
|
+
import 'html-escaper';
|
|
9
|
+
import '@cloudcommerce/api';
|
|
10
|
+
import 'node:events';
|
|
11
|
+
import 'node:fs';
|
|
12
|
+
import 'node:path';
|
|
13
|
+
import '@cloudcommerce/config';
|
|
14
|
+
import 'ultrahtml';
|
|
15
|
+
/* empty css */import 'image-size';
|
|
16
|
+
import 'mime';
|
|
17
|
+
import '@vueuse/core';
|
|
18
|
+
import '@headlessui/vue';
|
|
19
|
+
|
|
20
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
21
|
+
__name: "CheckoutLink",
|
|
22
|
+
props: {
|
|
23
|
+
to: { default: "cart" },
|
|
24
|
+
cartUrl: { default: globalThis.$storefront.settings.cart_url || "/app/#/cart" },
|
|
25
|
+
checkoutUrl: { default: globalThis.$storefront.settings.checkout_url || "/app/#/checkout" }
|
|
26
|
+
},
|
|
27
|
+
setup(__props, { expose: __expose }) {
|
|
28
|
+
__expose();
|
|
29
|
+
const props = __props;
|
|
30
|
+
const href = computed(() => {
|
|
31
|
+
if (props.to === "cart")
|
|
32
|
+
return props.cartUrl;
|
|
33
|
+
return props.checkoutUrl;
|
|
34
|
+
});
|
|
35
|
+
const __returned__ = { props, href };
|
|
36
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
37
|
+
return __returned__;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
function _sfc_ssrRender$4(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
41
|
+
_push(`<a${ssrRenderAttrs(mergeProps({ href: $setup.href }, _attrs))}>`);
|
|
42
|
+
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push, _parent);
|
|
43
|
+
_push(`</a>`);
|
|
44
|
+
}
|
|
45
|
+
const _sfc_setup$4 = _sfc_main$4.setup;
|
|
46
|
+
_sfc_main$4.setup = (props, ctx) => {
|
|
47
|
+
const ssrContext = useSSRContext();
|
|
48
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/CheckoutLink.vue");
|
|
49
|
+
return _sfc_setup$4 ? _sfc_setup$4(props, ctx) : void 0;
|
|
50
|
+
};
|
|
51
|
+
const CheckoutLink = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["ssrRender", _sfc_ssrRender$4]]);
|
|
52
|
+
|
|
53
|
+
const useCartItem = (props) => {
|
|
54
|
+
const parsedItem = computed(() => {
|
|
55
|
+
return !props.item && props.product ? parseProduct(props.product) : null;
|
|
56
|
+
});
|
|
57
|
+
const cartItem = computed(() => {
|
|
58
|
+
return props.item || parsedItem.value;
|
|
59
|
+
});
|
|
60
|
+
const title = computed(() => {
|
|
61
|
+
return name(cartItem.value);
|
|
62
|
+
});
|
|
63
|
+
const link = computed(() => {
|
|
64
|
+
const { slug } = cartItem.value;
|
|
65
|
+
if (typeof slug === "string") {
|
|
66
|
+
return `/${slug}`;
|
|
67
|
+
}
|
|
68
|
+
return null;
|
|
69
|
+
});
|
|
70
|
+
const image = computed(() => {
|
|
71
|
+
if (cartItem.value.picture) {
|
|
72
|
+
return img(cartItem.value.picture, void 0, props.pictureSize || "small");
|
|
73
|
+
}
|
|
74
|
+
return void 0;
|
|
75
|
+
});
|
|
76
|
+
const finalPrice = computed(() => {
|
|
77
|
+
return cartItem.value.final_price || cartItem.value.price;
|
|
78
|
+
});
|
|
79
|
+
return {
|
|
80
|
+
cartItem,
|
|
81
|
+
title,
|
|
82
|
+
link,
|
|
83
|
+
image,
|
|
84
|
+
finalPrice
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
89
|
+
__name: "QuantitySelectorControl",
|
|
90
|
+
props: {
|
|
91
|
+
isMinus: { type: Boolean }
|
|
92
|
+
},
|
|
93
|
+
setup(__props, { expose: __expose }) {
|
|
94
|
+
__expose();
|
|
95
|
+
const {
|
|
96
|
+
value,
|
|
97
|
+
isBoundMin,
|
|
98
|
+
isBoundMax
|
|
99
|
+
} = inject(quantitySelectorKey);
|
|
100
|
+
const __returned__ = { value, isBoundMin, isBoundMax };
|
|
101
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
102
|
+
return __returned__;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
function _sfc_ssrRender$3(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
106
|
+
_push(`<button${ssrRenderAttrs(mergeProps({
|
|
107
|
+
type: "button",
|
|
108
|
+
class: "w-10 h-12 text-xl leading-12 enabled:text-primary enabled:hover:bg-primary-100/70 disabled:opacity-40",
|
|
109
|
+
"data-quantity-selector-control": $props.isMinus ? "minus" : "plus",
|
|
110
|
+
"aria-label": $props.isMinus ? "Menos" : "Mais",
|
|
111
|
+
disabled: $props.isMinus ? $setup.isBoundMin : $setup.isBoundMax
|
|
112
|
+
}, _attrs))}>`);
|
|
113
|
+
ssrRenderSlot(_ctx.$slots, "default", {}, () => {
|
|
114
|
+
if ($props.isMinus) {
|
|
115
|
+
_push(`<!--[-->\u2212<!--]-->`);
|
|
116
|
+
} else {
|
|
117
|
+
_push(`<!--[-->+<!--]-->`);
|
|
118
|
+
}
|
|
119
|
+
}, _push, _parent);
|
|
120
|
+
_push(`</button>`);
|
|
121
|
+
}
|
|
122
|
+
const _sfc_setup$3 = _sfc_main$3.setup;
|
|
123
|
+
_sfc_main$3.setup = (props, ctx) => {
|
|
124
|
+
const ssrContext = useSSRContext();
|
|
125
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/QuantitySelectorControl.vue");
|
|
126
|
+
return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
|
|
127
|
+
};
|
|
128
|
+
const QuantitySelectorControl = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["ssrRender", _sfc_ssrRender$3]]);
|
|
129
|
+
|
|
130
|
+
const quantitySelectorKey = Symbol("quantitySelector");
|
|
131
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
132
|
+
__name: "QuantitySelector",
|
|
133
|
+
props: {
|
|
134
|
+
modelValue: { default: 1 },
|
|
135
|
+
min: { default: 1 },
|
|
136
|
+
max: {},
|
|
137
|
+
step: {},
|
|
138
|
+
disabled: { type: Boolean },
|
|
139
|
+
readonly: { type: Boolean }
|
|
140
|
+
},
|
|
141
|
+
emits: ["update:modelValue"],
|
|
142
|
+
setup(__props, { expose: __expose, emit }) {
|
|
143
|
+
__expose();
|
|
144
|
+
const props = __props;
|
|
145
|
+
const input = ref(null);
|
|
146
|
+
const inputId = `NInput${useId()}`;
|
|
147
|
+
const value = computed({
|
|
148
|
+
get() {
|
|
149
|
+
return props.modelValue;
|
|
150
|
+
},
|
|
151
|
+
set(_value) {
|
|
152
|
+
if (_value < props.min) {
|
|
153
|
+
_value = props.min;
|
|
154
|
+
input.value.value = `${_value}`;
|
|
155
|
+
}
|
|
156
|
+
if (props.max && _value > props.max) {
|
|
157
|
+
_value = props.max;
|
|
158
|
+
input.value.value = `${_value}`;
|
|
159
|
+
}
|
|
160
|
+
emit("update:modelValue", _value);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
const isBoundMin = computed(() => {
|
|
164
|
+
return props.min >= value.value;
|
|
165
|
+
});
|
|
166
|
+
const isBoundMax = computed(() => {
|
|
167
|
+
return props.max <= value.value;
|
|
168
|
+
});
|
|
169
|
+
provide(quantitySelectorKey, {
|
|
170
|
+
value,
|
|
171
|
+
isBoundMin,
|
|
172
|
+
isBoundMax
|
|
173
|
+
});
|
|
174
|
+
const __returned__ = { quantitySelectorKey, props, emit, input, inputId, value, isBoundMin, isBoundMax, QuantitySelectorControl };
|
|
175
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
176
|
+
return __returned__;
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
function _sfc_ssrRender$2(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
180
|
+
_push(`<div${ssrRenderAttrs(mergeProps({ "data-quantity-selector": "" }, _attrs))}>`);
|
|
181
|
+
ssrRenderSlot(_ctx.$slots, "label", { inputId: $setup.inputId, value: $setup.value }, () => {
|
|
182
|
+
_push(`<label${ssrRenderAttr("for", $setup.inputId)} class="sr-only">${ssrInterpolate("Quantidade")}</label>`);
|
|
183
|
+
}, _push, _parent);
|
|
184
|
+
_push(`<div class="flex items-center"><input type="number"${ssrRenderAttr("id", $setup.inputId)}${ssrRenderAttr("value", $setup.value)}${ssrRenderAttr("min", $props.min)}${ssrRenderAttr("max", $props.max)}${ssrRenderAttr("step", $props.step)}${ssrIncludeBooleanAttr($props.disabled) ? " disabled" : ""}${ssrIncludeBooleanAttr($props.readonly) ? " readonly" : ""} class="h-12 w-14 px-2 text-lg border-transparent text-center [-moz-appearance:_textfield] [&::-webkit-outer-spin-button]:m-0 [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:m-0 [&::-webkit-inner-spin-button]:appearance-none">`);
|
|
185
|
+
ssrRenderSlot(_ctx.$slots, "controls", { value: $setup.value, isBoundMin: $setup.isBoundMin, isBoundMax: $setup.isBoundMax }, () => {
|
|
186
|
+
_push(ssrRenderComponent($setup["QuantitySelectorControl"], {
|
|
187
|
+
"is-minus": "",
|
|
188
|
+
class: "order-first"
|
|
189
|
+
}, {
|
|
190
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
191
|
+
if (_push2) {
|
|
192
|
+
ssrRenderSlot(_ctx.$slots, "minus", {}, null, _push2, _parent2, _scopeId);
|
|
193
|
+
} else {
|
|
194
|
+
return [
|
|
195
|
+
renderSlot(_ctx.$slots, "minus")
|
|
196
|
+
];
|
|
197
|
+
}
|
|
198
|
+
}),
|
|
199
|
+
_: 3
|
|
200
|
+
}, _parent));
|
|
201
|
+
_push(ssrRenderComponent($setup["QuantitySelectorControl"], { class: "order-last" }, {
|
|
202
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
203
|
+
if (_push2) {
|
|
204
|
+
ssrRenderSlot(_ctx.$slots, "plus", {}, null, _push2, _parent2, _scopeId);
|
|
205
|
+
} else {
|
|
206
|
+
return [
|
|
207
|
+
renderSlot(_ctx.$slots, "plus")
|
|
208
|
+
];
|
|
209
|
+
}
|
|
210
|
+
}),
|
|
211
|
+
_: 3
|
|
212
|
+
}, _parent));
|
|
213
|
+
}, _push, _parent);
|
|
214
|
+
_push(`</div></div>`);
|
|
215
|
+
}
|
|
216
|
+
const _sfc_setup$2 = _sfc_main$2.setup;
|
|
217
|
+
_sfc_main$2.setup = (props, ctx) => {
|
|
218
|
+
const ssrContext = useSSRContext();
|
|
219
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/lib/components/QuantitySelector.vue");
|
|
220
|
+
return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
|
|
221
|
+
};
|
|
222
|
+
const QuantitySelector = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["ssrRender", _sfc_ssrRender$2]]);
|
|
223
|
+
|
|
224
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
225
|
+
__name: "CartItem",
|
|
226
|
+
props: {
|
|
227
|
+
item: {},
|
|
228
|
+
product: {},
|
|
229
|
+
pictureSize: {}
|
|
230
|
+
},
|
|
231
|
+
setup(__props, { expose: __expose }) {
|
|
232
|
+
__expose();
|
|
233
|
+
const props = __props;
|
|
234
|
+
const {
|
|
235
|
+
cartItem,
|
|
236
|
+
title,
|
|
237
|
+
link,
|
|
238
|
+
image,
|
|
239
|
+
finalPrice
|
|
240
|
+
} = useCartItem(props);
|
|
241
|
+
const __returned__ = { props, cartItem, title, link, image, finalPrice, get removeCartItem() {
|
|
242
|
+
return removeCartItem;
|
|
243
|
+
}, QuantitySelector, Prices };
|
|
244
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
245
|
+
return __returned__;
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
function _sfc_ssrRender$1(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
249
|
+
const _component_ALink = resolveComponent("ALink");
|
|
250
|
+
const _component_AImg = resolveComponent("AImg");
|
|
251
|
+
_push(`<article${ssrRenderAttrs(mergeProps({ class: "relative bg-white shadow-sm" }, _attrs))}>`);
|
|
252
|
+
_push(ssrRenderComponent(_component_ALink, {
|
|
253
|
+
href: $setup.link,
|
|
254
|
+
class: "flex items-center gap-5 p-4 group"
|
|
255
|
+
}, {
|
|
256
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
257
|
+
if (_push2) {
|
|
258
|
+
if ($setup.image) {
|
|
259
|
+
_push2(ssrRenderComponent(_component_AImg, {
|
|
260
|
+
picture: $setup.image,
|
|
261
|
+
alt: $setup.title,
|
|
262
|
+
class: "w-20 h-20 object-cover"
|
|
263
|
+
}, null, _parent2, _scopeId));
|
|
264
|
+
} else {
|
|
265
|
+
_push2(`<!---->`);
|
|
266
|
+
}
|
|
267
|
+
_push2(`<p class="py-2 flex-auto text-sm text-base-700 group-hover:text-base-900 group-hover:underline"${_scopeId}>${ssrInterpolate($setup.title)}</p>`);
|
|
268
|
+
} else {
|
|
269
|
+
return [
|
|
270
|
+
$setup.image ? (openBlock(), createBlock(_component_AImg, {
|
|
271
|
+
key: 0,
|
|
272
|
+
picture: $setup.image,
|
|
273
|
+
alt: $setup.title,
|
|
274
|
+
class: "w-20 h-20 object-cover"
|
|
275
|
+
}, null, 8, ["picture", "alt"])) : createCommentVNode("", true),
|
|
276
|
+
createVNode("p", { class: "py-2 flex-auto text-sm text-base-700 group-hover:text-base-900 group-hover:underline" }, toDisplayString($setup.title), 1)
|
|
277
|
+
];
|
|
278
|
+
}
|
|
279
|
+
}),
|
|
280
|
+
_: 1
|
|
281
|
+
}, _parent));
|
|
282
|
+
if ($setup.cartItem._id) {
|
|
283
|
+
_push(`<button class="absolute top-0 right-0 p-2 opacity-70 hover:opacity-100"${ssrRenderAttr("aria-label", "Remover")}><span class="w-5 h-5 text-sm leading-none flex flex-col justify-center rounded-full border-3 text-danger-800 border-danger-700/30"><i class="i-close my-0 mx-auto"></i></span></button>`);
|
|
284
|
+
} else {
|
|
285
|
+
_push(`<!---->`);
|
|
286
|
+
}
|
|
287
|
+
_push(`<div class="flex justify-between items-center border-t-2 border-base-100"><div class="border-r-2 border-base-100">`);
|
|
288
|
+
_push(ssrRenderComponent($setup["QuantitySelector"], {
|
|
289
|
+
modelValue: $setup.cartItem.quantity,
|
|
290
|
+
"onUpdate:modelValue": ($event) => $setup.cartItem.quantity = $event,
|
|
291
|
+
min: $setup.cartItem.min_quantity,
|
|
292
|
+
max: $setup.cartItem.max_quantity
|
|
293
|
+
}, null, _parent));
|
|
294
|
+
_push(`</div>`);
|
|
295
|
+
_push(ssrRenderComponent($setup["Prices"], {
|
|
296
|
+
"base-price": $setup.cartItem.base_price,
|
|
297
|
+
price: $setup.finalPrice,
|
|
298
|
+
"has-cashback": false,
|
|
299
|
+
"has-price-options": false,
|
|
300
|
+
class: "px-4 py-2.5 text-[95%] text-right"
|
|
301
|
+
}, null, _parent));
|
|
302
|
+
_push(`</div></article>`);
|
|
303
|
+
}
|
|
304
|
+
const _sfc_setup$1 = _sfc_main$1.setup;
|
|
305
|
+
_sfc_main$1.setup = (props, ctx) => {
|
|
306
|
+
const ssrContext = useSSRContext();
|
|
307
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/CartItem.vue");
|
|
308
|
+
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
|
|
309
|
+
};
|
|
310
|
+
const CartItem = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["ssrRender", _sfc_ssrRender$1]]);
|
|
311
|
+
|
|
312
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
313
|
+
__name: "CartSidebar",
|
|
314
|
+
emits: ["close"],
|
|
315
|
+
setup(__props, { expose: __expose, emit }) {
|
|
316
|
+
__expose();
|
|
317
|
+
const __returned__ = { emit, get freeShippingFromValue() {
|
|
318
|
+
return freeShippingFromValue;
|
|
319
|
+
}, get shoppingCart() {
|
|
320
|
+
return shoppingCart;
|
|
321
|
+
}, get totalItems() {
|
|
322
|
+
return totalItems;
|
|
323
|
+
}, CheckoutLink, Prices, CartItem };
|
|
324
|
+
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
325
|
+
return __returned__;
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
329
|
+
_push(`<aside${ssrRenderAttrs(mergeProps({ class: "flex flex-col h-screen bg-white" }, _attrs))}><header class="px-6 py-4 flex justify-end items-center gap-3 shadow ring-1 ring-black/5 z-10"><span class="text-right text-base text-base-600 font-medium">${ssrInterpolate("Meu carrinho de compras")}</span><span class="min-w-[3rem] text-right"><span class="ui-badge-pill-lg">${ssrInterpolate($setup.totalItems)}</span></span></header><article class="grow overflow-y-auto bg-base-50">`);
|
|
330
|
+
if ($setup.freeShippingFromValue) {
|
|
331
|
+
_push(`<div class="text-sm text-center">`);
|
|
332
|
+
if ($setup.freeShippingFromValue > $setup.shoppingCart.subtotal) {
|
|
333
|
+
_push(`<div class="p-3 secondary-subtle">${ssrInterpolate("Adicione $1 para ganhar".replace(
|
|
334
|
+
"$1",
|
|
335
|
+
_ctx.$money($setup.freeShippingFromValue - $setup.shoppingCart.subtotal)
|
|
336
|
+
))} <strong class="lowercase">${ssrInterpolate("Frete gr\xE1tis")}</strong></div>`);
|
|
337
|
+
} else {
|
|
338
|
+
_push(`<div class="p-3 bg-success-50 text-success-800"><i class="text-success-900 i-check mr-1"></i> ${ssrInterpolate("Frete gr\xE1tis a partir de")} ${ssrInterpolate(_ctx.$money($setup.freeShippingFromValue))}</div>`);
|
|
339
|
+
}
|
|
340
|
+
_push(`</div>`);
|
|
341
|
+
} else {
|
|
342
|
+
_push(`<!---->`);
|
|
343
|
+
}
|
|
344
|
+
_push(`<ul class="px-4 pt-4 pb-2"><!--[-->`);
|
|
345
|
+
ssrRenderList($setup.shoppingCart.items, (item, i) => {
|
|
346
|
+
_push(`<li>`);
|
|
347
|
+
_push(ssrRenderComponent($setup["CartItem"], {
|
|
348
|
+
item,
|
|
349
|
+
class: "mb-3"
|
|
350
|
+
}, null, _parent));
|
|
351
|
+
_push(`</li>`);
|
|
352
|
+
});
|
|
353
|
+
_push(`<!--]--></ul></article><footer class="px-5 pt-4 pb-3 ring-2 ring-black/5 z-10"><div class="grid grid-cols-5 gap-3 items-center text-right"><div class="col-span-2">${ssrInterpolate("Subtotal")}</div>`);
|
|
354
|
+
_push(ssrRenderComponent($setup["Prices"], {
|
|
355
|
+
price: $setup.shoppingCart.subtotal,
|
|
356
|
+
class: "col-span-3 text-lg"
|
|
357
|
+
}, null, _parent));
|
|
358
|
+
_push(`</div>`);
|
|
359
|
+
_push(ssrRenderComponent($setup["CheckoutLink"], { class: "ui-btn-lg ui-btn-primary w-full text-right my-2.5" }, {
|
|
360
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
361
|
+
if (_push2) {
|
|
362
|
+
_push2(`<i class="i-check mr-2"${_scopeId}></i> ${ssrInterpolate("Finalizar compra")}`);
|
|
363
|
+
} else {
|
|
364
|
+
return [
|
|
365
|
+
createVNode("i", { class: "i-check mr-2" }),
|
|
366
|
+
createTextVNode(" " + toDisplayString("Finalizar compra"))
|
|
367
|
+
];
|
|
368
|
+
}
|
|
369
|
+
}),
|
|
370
|
+
_: 1
|
|
371
|
+
}, _parent));
|
|
372
|
+
_push(`<a href="#" class="ui-link text-base-500 hover:text-base-700 text-sm"><i class="i-arrow-left mr-1"></i> ${ssrInterpolate("Continuar comprando")}</a></footer></aside>`);
|
|
373
|
+
}
|
|
374
|
+
const _sfc_setup = _sfc_main.setup;
|
|
375
|
+
_sfc_main.setup = (props, ctx) => {
|
|
376
|
+
const ssrContext = useSSRContext();
|
|
377
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("src/components/CartSidebar.vue");
|
|
378
|
+
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
379
|
+
};
|
|
380
|
+
const CartSidebar = /* @__PURE__ */ _export_sfc(_sfc_main, [["ssrRender", _sfc_ssrRender]]);
|
|
381
|
+
|
|
382
|
+
export { CartSidebar as default };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { mergeProps, useSSRContext } from 'vue';
|
|
2
|
+
import { ssrRenderAttrs } from 'vue/server-renderer';
|
|
3
|
+
import { _ as _export_sfc } from './pages/_...slug_.astro.ec6517ba.mjs';
|
|
4
|
+
import './astro.11be33ee.mjs';
|
|
5
|
+
import 'clsx';
|
|
6
|
+
import 'html-escaper';
|
|
7
|
+
import '@cloudcommerce/api';
|
|
8
|
+
import 'node:events';
|
|
9
|
+
import 'node:fs';
|
|
10
|
+
import 'node:path';
|
|
11
|
+
import '@cloudcommerce/config';
|
|
12
|
+
import '@ecomplus/utils';
|
|
13
|
+
import 'ultrahtml';
|
|
14
|
+
/* empty css */import 'image-size';
|
|
15
|
+
import 'mime';
|
|
16
|
+
import '@vueuse/core';
|
|
17
|
+
import '@headlessui/vue';
|
|
18
|
+
|
|
19
|
+
const _sfc_main = {};
|
|
20
|
+
|
|
21
|
+
function _sfc_ssrRender(_ctx, _push, _parent, _attrs) {
|
|
22
|
+
_push(`<div${ssrRenderAttrs(mergeProps({ class: "w-full h-40 bg-base-300" }, _attrs))}></div>`);
|
|
23
|
+
}
|
|
24
|
+
const _sfc_setup = _sfc_main.setup;
|
|
25
|
+
_sfc_main.setup = (props, ctx) => {
|
|
26
|
+
const ssrContext = useSSRContext()
|
|
27
|
+
;(ssrContext.modules || (ssrContext.modules = new Set())).add("src/components/SearchModal.vue");
|
|
28
|
+
return _sfc_setup ? _sfc_setup(props, ctx) : undefined
|
|
29
|
+
};
|
|
30
|
+
const SearchModal = /*#__PURE__*/_export_sfc(_sfc_main, [['ssrRender',_sfc_ssrRender]]);
|
|
31
|
+
|
|
32
|
+
export { SearchModal as default };
|