@teamnovu/kit-shopware-composables 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/global.d.ts +8 -0
- package/dist/helpers/checkout/useAddresses.d.ts +9 -51
- package/dist/helpers/checkout/useOrderDetails.d.ts +3 -9
- package/dist/helpers/checkout/usePaymentMethods.d.ts +11 -49
- package/dist/helpers/checkout/useShippingMethods.d.ts +11 -55
- package/dist/helpers/general/usePagination.d.ts +3 -1
- package/dist/helpers/user/useIsLoggedIn.d.ts +3 -2
- package/dist/helpers/user/useUser.d.ts +4 -106
- package/dist/index.mjs +810 -641
- package/dist/keys.d.ts +42 -1
- package/dist/query/address/index.d.ts +1 -0
- package/dist/query/address/useCreateCustomerAddressMutation.d.ts +7 -6
- package/dist/query/address/useDeleteCustomerAddressMutation.d.ts +2 -1
- package/dist/query/address/useListAddressQuery.d.ts +5 -36
- package/dist/query/address/useUpdateCustomerAddressMutation.d.ts +167 -0
- package/dist/query/cart/useAddLineItemMutation.d.ts +7 -6
- package/dist/query/cart/useReadCartQuery.d.ts +5 -100
- package/dist/query/cart/useRemoveLineItemMutation.d.ts +7 -6
- package/dist/query/cart/useUpdateLineItemMutation.d.ts +7 -6
- package/dist/query/checkout/useCreateOrderMutation.d.ts +7 -6
- package/dist/query/context/useReadContextQuery.d.ts +8 -148
- package/dist/query/context/useUpdateContextMutation.d.ts +7 -6
- package/dist/query/country/index.d.ts +1 -0
- package/dist/query/country/useReadCountryQuery.d.ts +17 -0
- package/dist/query/customer/useChangeEmailMutation.d.ts +7 -6
- package/dist/query/customer/useChangeProfileMutation.d.ts +7 -6
- package/dist/query/customer/useLoginCustomerMutation.d.ts +7 -6
- package/dist/query/customer/useLogoutCustomerMutation.d.ts +7 -6
- package/dist/query/customer/useReadCustomerQuery.d.ts +10 -213
- package/dist/query/customer/useRegisterCustomerMutation.d.ts +7 -6
- package/dist/query/index.d.ts +4 -0
- package/dist/query/navigation/index.d.ts +1 -0
- package/dist/query/navigation/useReadNavigationQuery.d.ts +22 -0
- package/dist/query/order/useReadOrderQuery.d.ts +5 -32
- package/dist/query/payment/useHandlePaymentMutation.d.ts +7 -6
- package/dist/query/payment/useOrderSetPaymentMutation.d.ts +7 -6
- package/dist/query/payment/useReadPaymentMethodQuery.d.ts +5 -20
- package/dist/query/products/useReadCategoryListQuery.d.ts +5 -36
- package/dist/query/products/useReadCompactProductListingQuery.d.ts +5 -20
- package/dist/query/products/useReadCustomProductDetailQuery.d.ts +5 -52
- package/dist/query/salutation/index.d.ts +1 -0
- package/dist/query/salutation/useReadSalutationQuery.d.ts +17 -0
- package/dist/query/seoUrl/index.d.ts +1 -0
- package/dist/query/seoUrl/useReadSeoUrlQuery.d.ts +17 -0
- package/dist/query/shipping/useReadShippingMethodQuery.d.ts +5 -44
- package/dist/query/types/index.d.ts +1 -0
- package/dist/query/types/operations.d.ts +3 -3
- package/dist/query/types/query.d.ts +2 -3
- package/dist/query/types/util.d.ts +6 -0
- package/dist/util/unrefOptions.d.ts +2 -2
- package/package.json +6 -4
- package/src/global.d.ts +8 -0
- package/src/helpers/checkout/useAddresses.ts +1 -1
- package/src/helpers/checkout/useOrderDetails.ts +1 -2
- package/src/helpers/checkout/useOrderPayment.ts +1 -1
- package/src/helpers/checkout/usePaymentMethods.ts +5 -2
- package/src/helpers/checkout/useShippingMethods.ts +5 -2
- package/src/helpers/general/usePagination.ts +10 -5
- package/src/helpers/user/useIsLoggedIn.ts +6 -8
- package/src/helpers/user/useUser.ts +1 -1
- package/src/inject.ts +1 -1
- package/src/keys.ts +66 -1
- package/src/query/address/index.ts +1 -0
- package/src/query/address/useCreateCustomerAddressMutation.ts +7 -6
- package/src/query/address/useDeleteCustomerAddressMutation.ts +7 -6
- package/src/query/address/useUpdateCustomerAddressMutation.ts +42 -0
- package/src/query/cart/useAddLineItemMutation.ts +7 -6
- package/src/query/cart/useRemoveLineItemMutation.ts +6 -5
- package/src/query/cart/useUpdateLineItemMutation.ts +5 -4
- package/src/query/checkout/useCreateOrderMutation.ts +11 -8
- package/src/query/context/useReadContextQuery.ts +14 -5
- package/src/query/context/useUpdateContextMutation.ts +6 -5
- package/src/query/country/index.ts +1 -0
- package/src/query/country/useReadCountryQuery.ts +31 -0
- package/src/query/customer/useChangeEmailMutation.ts +7 -7
- package/src/query/customer/useChangeProfileMutation.ts +7 -7
- package/src/query/customer/useLoginCustomerMutation.ts +12 -9
- package/src/query/customer/useLogoutCustomerMutation.ts +11 -7
- package/src/query/customer/useReadCustomerQuery.ts +2 -1
- package/src/query/customer/useRegisterCustomerMutation.ts +7 -7
- package/src/query/index.ts +4 -0
- package/src/query/navigation/index.ts +1 -0
- package/src/query/navigation/useReadNavigationQuery.ts +43 -0
- package/src/query/order/useReadOrderQuery.ts +0 -2
- package/src/query/payment/useHandlePaymentMutation.ts +5 -4
- package/src/query/payment/useOrderSetPaymentMutation.ts +6 -5
- package/src/query/salutation/index.ts +1 -0
- package/src/query/salutation/useReadSalutationQuery.ts +31 -0
- package/src/query/seoUrl/index.ts +1 -0
- package/src/query/seoUrl/useReadSeoUrlQuery.ts +31 -0
- package/src/query/types/index.ts +1 -0
- package/src/query/types/operations.ts +5 -5
- package/src/query/types/query.ts +4 -6
- package/src/query/types/util.ts +19 -0
- package/src/util/unrefOptions.ts +4 -4
- package/src/util/useOptimistic.ts +2 -1
- package/tsconfig.json +4 -2
- package/vite.config.js +6 -1
package/dist/index.mjs
CHANGED
|
@@ -1,61 +1,116 @@
|
|
|
1
|
-
import { inject as
|
|
2
|
-
import { until as
|
|
3
|
-
import { queryOptions as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { inject as Y, unref as c, computed as o, reactive as Z, watch as H, toRef as W } from "vue";
|
|
2
|
+
import { until as J } from "@vueuse/core";
|
|
3
|
+
import { queryOptions as M, useQuery as O, useQueryClient as P, useMutation as Q } from "@tanstack/vue-query";
|
|
4
|
+
import "@teamnovu/kit-shopware-api-client";
|
|
5
|
+
const _ = Symbol("shopwareClient");
|
|
6
|
+
function v() {
|
|
7
|
+
const e = Y(_);
|
|
7
8
|
if (!e)
|
|
8
9
|
throw new Error("Shopware client not provided!");
|
|
9
10
|
return e;
|
|
10
11
|
}
|
|
11
|
-
const
|
|
12
|
+
const b = {
|
|
12
13
|
all: () => ["context"]
|
|
13
|
-
},
|
|
14
|
+
}, k = {
|
|
14
15
|
all: () => ["category"],
|
|
15
|
-
lists: () => [...
|
|
16
|
+
lists: () => [...k.all(), "list"],
|
|
16
17
|
list: (e) => [
|
|
17
|
-
...
|
|
18
|
+
...k.all(),
|
|
18
19
|
"list",
|
|
19
20
|
{
|
|
20
21
|
body: e
|
|
21
22
|
}
|
|
22
23
|
]
|
|
23
|
-
},
|
|
24
|
+
}, U = {
|
|
25
|
+
all: () => ["navigation"],
|
|
26
|
+
lists: () => [...U.all(), "list"],
|
|
27
|
+
list: (e) => [
|
|
28
|
+
...U.all(),
|
|
29
|
+
"list",
|
|
30
|
+
{
|
|
31
|
+
body: e
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
details: () => [...U.all(), "detail"],
|
|
35
|
+
detail: (e, n, t) => [
|
|
36
|
+
...U.all(),
|
|
37
|
+
"detail",
|
|
38
|
+
{
|
|
39
|
+
activeId: e,
|
|
40
|
+
rootId: n,
|
|
41
|
+
body: t
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}, w = {
|
|
24
45
|
all: () => ["product"],
|
|
25
|
-
lists: () => [...
|
|
26
|
-
list: (e,
|
|
27
|
-
...
|
|
46
|
+
lists: () => [...w.all(), "list"],
|
|
47
|
+
list: (e, n) => [
|
|
48
|
+
...w.all(),
|
|
28
49
|
"list",
|
|
29
50
|
{
|
|
30
51
|
url: e,
|
|
31
|
-
body:
|
|
52
|
+
body: n
|
|
32
53
|
}
|
|
33
54
|
],
|
|
34
|
-
details: () => [...
|
|
35
|
-
detail: (e,
|
|
36
|
-
...
|
|
55
|
+
details: () => [...w.all(), "detail"],
|
|
56
|
+
detail: (e, n) => [
|
|
57
|
+
...w.all(),
|
|
37
58
|
"detail",
|
|
38
59
|
{
|
|
39
60
|
url: e,
|
|
40
|
-
body:
|
|
61
|
+
body: n
|
|
41
62
|
}
|
|
42
63
|
]
|
|
43
|
-
}, R = {
|
|
44
|
-
get: () => ["cart"]
|
|
45
64
|
}, I = {
|
|
46
|
-
get: () => ["
|
|
47
|
-
},
|
|
65
|
+
get: () => ["cart"]
|
|
66
|
+
}, x = {
|
|
67
|
+
all: () => ["customer"],
|
|
68
|
+
detail: (e) => ["customer", { body: e }]
|
|
69
|
+
}, R = {
|
|
48
70
|
all: () => ["address"],
|
|
49
|
-
lists: () => [...
|
|
71
|
+
lists: () => [...R.all(), "list"],
|
|
72
|
+
list: (e) => [
|
|
73
|
+
...R.all(),
|
|
74
|
+
"list",
|
|
75
|
+
{
|
|
76
|
+
body: e
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
details: () => [...R.all(), "detail"],
|
|
80
|
+
detail: (e, n) => [...R.details(), e, ...n ? [{ body: n }] : []]
|
|
81
|
+
}, N = {
|
|
82
|
+
all: () => ["shippingMethod"],
|
|
83
|
+
lists: () => [...N.all(), "list"],
|
|
84
|
+
list: (e) => [
|
|
85
|
+
...N.all(),
|
|
86
|
+
"list",
|
|
87
|
+
{
|
|
88
|
+
body: e
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
}, B = {
|
|
92
|
+
all: () => ["paymentMethod"],
|
|
93
|
+
lists: () => [...B.all(), "list"],
|
|
50
94
|
list: (e) => [
|
|
51
|
-
...
|
|
95
|
+
...B.all(),
|
|
52
96
|
"list",
|
|
53
97
|
{
|
|
54
98
|
body: e
|
|
55
99
|
}
|
|
56
100
|
]
|
|
101
|
+
}, L = {
|
|
102
|
+
all: () => ["order"],
|
|
103
|
+
lists: () => [...L.all(), "list"],
|
|
104
|
+
details: () => [...L.all(), "detail"],
|
|
105
|
+
detail: (e) => [
|
|
106
|
+
...L.all(),
|
|
107
|
+
"detail",
|
|
108
|
+
{
|
|
109
|
+
body: e
|
|
110
|
+
}
|
|
111
|
+
]
|
|
57
112
|
}, E = {
|
|
58
|
-
all: () => ["
|
|
113
|
+
all: () => ["seoUrl"],
|
|
59
114
|
lists: () => [...E.all(), "list"],
|
|
60
115
|
list: (e) => [
|
|
61
116
|
...E.all(),
|
|
@@ -65,7 +120,7 @@ const U = {
|
|
|
65
120
|
}
|
|
66
121
|
]
|
|
67
122
|
}, D = {
|
|
68
|
-
all: () => ["
|
|
123
|
+
all: () => ["salutation"],
|
|
69
124
|
lists: () => [...D.all(), "list"],
|
|
70
125
|
list: (e) => [
|
|
71
126
|
...D.all(),
|
|
@@ -74,860 +129,974 @@ const U = {
|
|
|
74
129
|
body: e
|
|
75
130
|
}
|
|
76
131
|
]
|
|
77
|
-
},
|
|
78
|
-
all: () => ["
|
|
79
|
-
lists: () => [...
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
"detail",
|
|
132
|
+
}, T = {
|
|
133
|
+
all: () => ["country"],
|
|
134
|
+
lists: () => [...T.all(), "list"],
|
|
135
|
+
list: (e) => [
|
|
136
|
+
...T.all(),
|
|
137
|
+
"list",
|
|
84
138
|
{
|
|
85
139
|
body: e
|
|
86
140
|
}
|
|
87
141
|
]
|
|
88
142
|
};
|
|
89
|
-
function
|
|
90
|
-
const
|
|
143
|
+
function g(e) {
|
|
144
|
+
const n = c(e);
|
|
91
145
|
return Object.fromEntries(
|
|
92
|
-
Object.entries(
|
|
93
|
-
([
|
|
146
|
+
Object.entries(n ?? {}).map(
|
|
147
|
+
([t, s]) => [t, c(s)]
|
|
94
148
|
)
|
|
95
149
|
);
|
|
96
150
|
}
|
|
97
|
-
const
|
|
98
|
-
function
|
|
99
|
-
const
|
|
100
|
-
var
|
|
101
|
-
return (
|
|
151
|
+
const ee = "listAddress post /account/list-address";
|
|
152
|
+
function te(e) {
|
|
153
|
+
const n = v(), t = R.list(o(() => {
|
|
154
|
+
var s;
|
|
155
|
+
return (s = g(e)) == null ? void 0 : s.body;
|
|
102
156
|
}));
|
|
103
|
-
return
|
|
104
|
-
queryKey:
|
|
105
|
-
queryFn: ({ signal:
|
|
106
|
-
...
|
|
107
|
-
signal:
|
|
157
|
+
return M({
|
|
158
|
+
queryKey: t,
|
|
159
|
+
queryFn: ({ signal: s }) => n.query(ee, {
|
|
160
|
+
...g(e),
|
|
161
|
+
signal: s
|
|
108
162
|
})
|
|
109
163
|
});
|
|
110
164
|
}
|
|
111
|
-
function
|
|
112
|
-
return O(
|
|
165
|
+
function ne(e) {
|
|
166
|
+
return O(te(e));
|
|
167
|
+
}
|
|
168
|
+
const j = (e) => {
|
|
169
|
+
const n = e.replace(/\/?$/, "");
|
|
170
|
+
return n.startsWith("/") ? n.slice(1) : n;
|
|
171
|
+
}, et = (e) => `/${j(e)}`;
|
|
172
|
+
function tt(e, n, t) {
|
|
173
|
+
const s = P();
|
|
174
|
+
return {
|
|
175
|
+
onMutate: async (a) => {
|
|
176
|
+
await s.cancelQueries({ queryKey: e });
|
|
177
|
+
const r = s.getQueryData(e);
|
|
178
|
+
if (s.setQueryData(e, (i) => n(a, i)), t) {
|
|
179
|
+
const i = c(t), u = c(i.onMutate);
|
|
180
|
+
u == null || u(a);
|
|
181
|
+
}
|
|
182
|
+
return { previousValue: r };
|
|
183
|
+
},
|
|
184
|
+
onError: (a, r, i) => {
|
|
185
|
+
if (i && s.setQueryData(e, i.previousValue), t) {
|
|
186
|
+
const u = c(t), m = c(u.onError);
|
|
187
|
+
m == null || m(a, r, i);
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
onSettled: (...a) => {
|
|
191
|
+
if (s.invalidateQueries({ queryKey: e }), t) {
|
|
192
|
+
const r = c(t), i = c(r.onSettled);
|
|
193
|
+
i == null || i(...a);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
};
|
|
113
197
|
}
|
|
114
|
-
const
|
|
115
|
-
function
|
|
116
|
-
const
|
|
117
|
-
return
|
|
118
|
-
queryKey:
|
|
119
|
-
queryFn: ({ signal:
|
|
198
|
+
const se = "readContext get /context";
|
|
199
|
+
function re(e) {
|
|
200
|
+
const n = v();
|
|
201
|
+
return M({
|
|
202
|
+
queryKey: b.all(),
|
|
203
|
+
queryFn: ({ signal: t }) => n.query(se, {
|
|
204
|
+
...g(e),
|
|
205
|
+
signal: t
|
|
206
|
+
})
|
|
120
207
|
});
|
|
121
208
|
}
|
|
122
|
-
function
|
|
123
|
-
return O(
|
|
209
|
+
function V(e) {
|
|
210
|
+
return O(re(e));
|
|
124
211
|
}
|
|
125
|
-
const
|
|
126
|
-
function
|
|
127
|
-
const
|
|
128
|
-
return
|
|
212
|
+
const ae = "updateContext patch /context";
|
|
213
|
+
function $(e) {
|
|
214
|
+
const n = v(), t = P();
|
|
215
|
+
return Q({
|
|
129
216
|
...e,
|
|
130
|
-
mutationFn: async (
|
|
131
|
-
body:
|
|
217
|
+
mutationFn: async (s) => (t.cancelQueries({ queryKey: b.all() }), n.query(ae, {
|
|
218
|
+
body: s
|
|
132
219
|
})),
|
|
133
|
-
onSuccess: (
|
|
134
|
-
var
|
|
135
|
-
|
|
220
|
+
onSuccess: async (s, a, r) => {
|
|
221
|
+
var i, u;
|
|
222
|
+
await t.invalidateQueries({ queryKey: b.all() }), await ((u = c((i = c(e)) == null ? void 0 : i.onSuccess)) == null ? void 0 : u(s, a, r));
|
|
136
223
|
}
|
|
137
224
|
});
|
|
138
225
|
}
|
|
139
|
-
function
|
|
140
|
-
const e =
|
|
226
|
+
function nt() {
|
|
227
|
+
const e = $(), n = V(), t = ne(), s = o(() => n.isFetching.value || e.isPending.value), a = async (d) => {
|
|
141
228
|
await e.mutateAsync({
|
|
142
229
|
billingAddressId: d.id
|
|
143
|
-
}), await
|
|
144
|
-
},
|
|
230
|
+
}), await J(s).toBe(!1);
|
|
231
|
+
}, r = async (d) => {
|
|
145
232
|
await e.mutateAsync({
|
|
146
233
|
shippingAddressId: d.id
|
|
147
|
-
}), await
|
|
148
|
-
},
|
|
149
|
-
var d,
|
|
150
|
-
return (
|
|
151
|
-
}),
|
|
152
|
-
var d,
|
|
153
|
-
return (
|
|
154
|
-
}),
|
|
234
|
+
}), await J(s).toBe(!1);
|
|
235
|
+
}, i = o(() => {
|
|
236
|
+
var d, C;
|
|
237
|
+
return (C = (d = n.data.value) == null ? void 0 : d.customer) == null ? void 0 : C.activeBillingAddress;
|
|
238
|
+
}), u = o(() => {
|
|
239
|
+
var d, C;
|
|
240
|
+
return (C = (d = n.data.value) == null ? void 0 : d.customer) == null ? void 0 : C.activeShippingAddress;
|
|
241
|
+
}), m = o(() => {
|
|
155
242
|
var d;
|
|
156
|
-
return ((d =
|
|
157
|
-
(
|
|
158
|
-
var
|
|
159
|
-
return
|
|
243
|
+
return ((d = t.data.value) == null ? void 0 : d.elements.filter(
|
|
244
|
+
(C) => {
|
|
245
|
+
var S;
|
|
246
|
+
return C.id !== ((S = i.value) == null ? void 0 : S.id);
|
|
160
247
|
}
|
|
161
248
|
)) ?? [];
|
|
162
|
-
}),
|
|
249
|
+
}), q = o(() => {
|
|
163
250
|
var d;
|
|
164
|
-
return ((d =
|
|
165
|
-
(
|
|
166
|
-
var
|
|
167
|
-
return
|
|
251
|
+
return ((d = t.data.value) == null ? void 0 : d.elements.filter(
|
|
252
|
+
(C) => {
|
|
253
|
+
var S;
|
|
254
|
+
return C.id !== ((S = i.value) == null ? void 0 : S.id);
|
|
168
255
|
}
|
|
169
256
|
)) ?? [];
|
|
170
257
|
});
|
|
171
258
|
return {
|
|
172
259
|
contextUpdateMutation: e,
|
|
173
|
-
contextQuery:
|
|
174
|
-
addressListQuery:
|
|
175
|
-
setBillingAddress:
|
|
176
|
-
setShippingAddress:
|
|
177
|
-
isSaving:
|
|
178
|
-
activeBillingAddress:
|
|
179
|
-
activeShippingAddress:
|
|
180
|
-
inactiveBillingAddresses:
|
|
181
|
-
inactiveShippingAddresses:
|
|
260
|
+
contextQuery: n,
|
|
261
|
+
addressListQuery: t,
|
|
262
|
+
setBillingAddress: a,
|
|
263
|
+
setShippingAddress: r,
|
|
264
|
+
isSaving: s,
|
|
265
|
+
activeBillingAddress: i,
|
|
266
|
+
activeShippingAddress: u,
|
|
267
|
+
inactiveBillingAddresses: m,
|
|
268
|
+
inactiveShippingAddresses: q
|
|
182
269
|
};
|
|
183
270
|
}
|
|
184
|
-
const
|
|
185
|
-
function
|
|
186
|
-
const
|
|
187
|
-
return
|
|
188
|
-
queryKey:
|
|
189
|
-
queryFn: async ({ signal:
|
|
190
|
-
const
|
|
191
|
-
return
|
|
192
|
-
...
|
|
193
|
-
signal:
|
|
271
|
+
const ie = "readOrder post /order";
|
|
272
|
+
function ue(e) {
|
|
273
|
+
const n = v(), t = L.detail(e);
|
|
274
|
+
return M({
|
|
275
|
+
queryKey: t,
|
|
276
|
+
queryFn: async ({ signal: s }) => {
|
|
277
|
+
const a = g(e);
|
|
278
|
+
return n.query(ie, {
|
|
279
|
+
...a,
|
|
280
|
+
signal: s
|
|
194
281
|
});
|
|
195
|
-
}
|
|
196
|
-
enabled: !!e
|
|
282
|
+
}
|
|
197
283
|
});
|
|
198
284
|
}
|
|
199
|
-
function
|
|
200
|
-
return O(
|
|
285
|
+
function oe(e) {
|
|
286
|
+
return O(ue(e));
|
|
201
287
|
}
|
|
202
|
-
function
|
|
203
|
-
const
|
|
204
|
-
const
|
|
205
|
-
if (
|
|
288
|
+
function st(e, n) {
|
|
289
|
+
const t = o(() => {
|
|
290
|
+
const l = c(e);
|
|
291
|
+
if (l)
|
|
206
292
|
return {
|
|
207
293
|
body: {
|
|
208
294
|
filter: [
|
|
209
295
|
{
|
|
210
296
|
type: "equals",
|
|
211
297
|
field: "id",
|
|
212
|
-
value:
|
|
298
|
+
value: l
|
|
213
299
|
}
|
|
214
300
|
],
|
|
215
|
-
...
|
|
301
|
+
...n,
|
|
216
302
|
checkPromotion: !0
|
|
217
303
|
}
|
|
218
304
|
};
|
|
219
|
-
}),
|
|
220
|
-
var
|
|
221
|
-
return (
|
|
222
|
-
}),
|
|
223
|
-
var
|
|
224
|
-
return ((
|
|
225
|
-
}),
|
|
226
|
-
var
|
|
227
|
-
return (
|
|
228
|
-
}),
|
|
229
|
-
var
|
|
230
|
-
return (
|
|
231
|
-
}),
|
|
232
|
-
var
|
|
233
|
-
return (
|
|
234
|
-
}),
|
|
235
|
-
var
|
|
236
|
-
return (
|
|
237
|
-
}), d =
|
|
238
|
-
var
|
|
239
|
-
return (
|
|
240
|
-
}),
|
|
241
|
-
var
|
|
305
|
+
}), s = oe(t.value), a = o(() => {
|
|
306
|
+
var l, p, f, F;
|
|
307
|
+
return (F = (f = (p = (l = s.data) == null ? void 0 : l.value) == null ? void 0 : p.orders) == null ? void 0 : f.elements) == null ? void 0 : F[0];
|
|
308
|
+
}), r = o(() => {
|
|
309
|
+
var l, p;
|
|
310
|
+
return ((p = (l = s.data) == null ? void 0 : l.value) == null ? void 0 : p.paymentChangeable) || {};
|
|
311
|
+
}), i = o(() => {
|
|
312
|
+
var l, p, f;
|
|
313
|
+
return (f = (p = (l = a.value) == null ? void 0 : l.stateMachineState) == null ? void 0 : p.translated) == null ? void 0 : f.name;
|
|
314
|
+
}), u = o(() => {
|
|
315
|
+
var l, p;
|
|
316
|
+
return (p = (l = a.value) == null ? void 0 : l.stateMachineState) == null ? void 0 : p.technicalName;
|
|
317
|
+
}), m = o(() => {
|
|
318
|
+
var l, p;
|
|
319
|
+
return (p = (l = a.value) == null ? void 0 : l.price) == null ? void 0 : p.totalPrice;
|
|
320
|
+
}), q = o(() => {
|
|
321
|
+
var l, p;
|
|
322
|
+
return (p = (l = a.value) == null ? void 0 : l.price) == null ? void 0 : p.positionPrice;
|
|
323
|
+
}), d = o(() => {
|
|
324
|
+
var l;
|
|
325
|
+
return (l = a.value) == null ? void 0 : l.shippingTotal;
|
|
326
|
+
}), C = o(() => {
|
|
327
|
+
var l, p, f, F, z, G;
|
|
242
328
|
return {
|
|
243
|
-
email: (
|
|
244
|
-
firstName: (
|
|
245
|
-
lastName: (
|
|
329
|
+
email: (p = (l = a.value) == null ? void 0 : l.orderCustomer) == null ? void 0 : p.email,
|
|
330
|
+
firstName: (F = (f = a.value) == null ? void 0 : f.orderCustomer) == null ? void 0 : F.firstName,
|
|
331
|
+
lastName: (G = (z = a.value) == null ? void 0 : z.orderCustomer) == null ? void 0 : G.lastName
|
|
246
332
|
};
|
|
247
|
-
}),
|
|
248
|
-
var
|
|
249
|
-
return (
|
|
250
|
-
({ id:
|
|
251
|
-
var
|
|
252
|
-
return
|
|
333
|
+
}), S = o(() => {
|
|
334
|
+
var l, p;
|
|
335
|
+
return (p = (l = a.value) == null ? void 0 : l.addresses) == null ? void 0 : p.find(
|
|
336
|
+
({ id: f }) => {
|
|
337
|
+
var F;
|
|
338
|
+
return f === ((F = a.value) == null ? void 0 : F.billingAddressId);
|
|
253
339
|
}
|
|
254
340
|
);
|
|
255
|
-
}),
|
|
341
|
+
}), y = o(
|
|
256
342
|
() => {
|
|
257
|
-
var
|
|
258
|
-
return (
|
|
259
|
-
}
|
|
260
|
-
),
|
|
261
|
-
var
|
|
262
|
-
const
|
|
263
|
-
if (
|
|
264
|
-
return (
|
|
265
|
-
}),
|
|
266
|
-
var
|
|
267
|
-
const
|
|
268
|
-
if (
|
|
269
|
-
return (
|
|
270
|
-
}),
|
|
271
|
-
var
|
|
272
|
-
const
|
|
273
|
-
return ((
|
|
343
|
+
var l, p, f;
|
|
344
|
+
return (f = (p = (l = a.value) == null ? void 0 : l.deliveries) == null ? void 0 : p[0]) == null ? void 0 : f.shippingOrderAddress;
|
|
345
|
+
}
|
|
346
|
+
), h = o(() => {
|
|
347
|
+
var p, f;
|
|
348
|
+
const l = (p = a.value) == null ? void 0 : p.transactions;
|
|
349
|
+
if (l != null && l.length)
|
|
350
|
+
return (f = l.at(-1)) == null ? void 0 : f.paymentMethod;
|
|
351
|
+
}), A = o(() => {
|
|
352
|
+
var p, f;
|
|
353
|
+
const l = (p = a.value) == null ? void 0 : p.deliveries;
|
|
354
|
+
if (l != null && l.length)
|
|
355
|
+
return (f = l.at(-1)) == null ? void 0 : f.shippingMethod;
|
|
356
|
+
}), K = o(() => {
|
|
357
|
+
var p;
|
|
358
|
+
const l = c(e);
|
|
359
|
+
return ((p = r.value) == null ? void 0 : p[l]) ?? !1;
|
|
274
360
|
});
|
|
275
361
|
return {
|
|
276
|
-
order:
|
|
277
|
-
status:
|
|
278
|
-
statusTechnicalName:
|
|
279
|
-
total:
|
|
280
|
-
subtotal:
|
|
362
|
+
order: a,
|
|
363
|
+
status: i,
|
|
364
|
+
statusTechnicalName: u,
|
|
365
|
+
total: m,
|
|
366
|
+
subtotal: q,
|
|
281
367
|
shippingCosts: d,
|
|
282
|
-
shippingAddress:
|
|
283
|
-
billingAddress:
|
|
284
|
-
personalDetails:
|
|
285
|
-
shippingMethod:
|
|
286
|
-
paymentMethod:
|
|
287
|
-
paymentChangeable:
|
|
288
|
-
orderQuery:
|
|
289
|
-
orderSetPaymentMutation
|
|
368
|
+
shippingAddress: y,
|
|
369
|
+
billingAddress: S,
|
|
370
|
+
personalDetails: C,
|
|
371
|
+
shippingMethod: A,
|
|
372
|
+
paymentMethod: h,
|
|
373
|
+
paymentChangeable: K,
|
|
374
|
+
orderQuery: s
|
|
290
375
|
};
|
|
291
376
|
}
|
|
292
|
-
function
|
|
293
|
-
const
|
|
294
|
-
var
|
|
295
|
-
return (
|
|
296
|
-
var
|
|
297
|
-
return ((
|
|
377
|
+
function rt(e) {
|
|
378
|
+
const n = o(() => {
|
|
379
|
+
var r, i;
|
|
380
|
+
return (i = (r = c(e)) == null ? void 0 : r.transactions) == null ? void 0 : i.find((u) => {
|
|
381
|
+
var m;
|
|
382
|
+
return ((m = u.paymentMethod) == null ? void 0 : m.active) === !0;
|
|
298
383
|
});
|
|
299
|
-
}),
|
|
300
|
-
var
|
|
301
|
-
return (
|
|
302
|
-
}),
|
|
303
|
-
var
|
|
304
|
-
return (
|
|
384
|
+
}), t = o(() => {
|
|
385
|
+
var r;
|
|
386
|
+
return (r = n.value) == null ? void 0 : r.paymentMethod;
|
|
387
|
+
}), s = o(() => {
|
|
388
|
+
var r;
|
|
389
|
+
return (r = n.value) == null ? void 0 : r.stateMachineState;
|
|
305
390
|
});
|
|
306
391
|
return {
|
|
307
|
-
isAsynchronous:
|
|
392
|
+
isAsynchronous: o(
|
|
308
393
|
() => {
|
|
309
|
-
var
|
|
394
|
+
var r, i, u, m;
|
|
310
395
|
return (
|
|
311
396
|
// @ts-expect-error - This property does not seem to be declared in the typescript types
|
|
312
|
-
((
|
|
397
|
+
((i = (r = n.value) == null ? void 0 : r.paymentMethod) == null ? void 0 : i.asynchronous) && ((m = (u = n.value) == null ? void 0 : u.paymentMethod) == null ? void 0 : m.afterOrderEnabled)
|
|
313
398
|
);
|
|
314
399
|
}
|
|
315
400
|
),
|
|
316
|
-
activeTransaction:
|
|
317
|
-
state:
|
|
318
|
-
paymentMethod:
|
|
401
|
+
activeTransaction: n,
|
|
402
|
+
state: s,
|
|
403
|
+
paymentMethod: t
|
|
319
404
|
};
|
|
320
405
|
}
|
|
321
|
-
const
|
|
322
|
-
function
|
|
323
|
-
const
|
|
324
|
-
return
|
|
406
|
+
const ce = "createCustomerAddress post /account/address";
|
|
407
|
+
function at(e) {
|
|
408
|
+
const n = v(), t = P();
|
|
409
|
+
return Q({
|
|
325
410
|
...e,
|
|
326
|
-
mutationFn: async (
|
|
327
|
-
onSuccess: (
|
|
328
|
-
var
|
|
329
|
-
|
|
411
|
+
mutationFn: async (s) => n.query(ce, g(s)),
|
|
412
|
+
onSuccess: async (s, a, r) => {
|
|
413
|
+
var i, u;
|
|
414
|
+
await t.invalidateQueries({ queryKey: R.lists() }), await ((u = c((i = c(e)) == null ? void 0 : i.onSuccess)) == null ? void 0 : u(s, a, r));
|
|
330
415
|
}
|
|
331
416
|
});
|
|
332
417
|
}
|
|
333
|
-
const
|
|
334
|
-
function
|
|
335
|
-
const
|
|
336
|
-
return
|
|
418
|
+
const le = "deleteCustomerAddress delete /account/address/{addressId}";
|
|
419
|
+
function it(e) {
|
|
420
|
+
const n = v(), t = P();
|
|
421
|
+
return Q({
|
|
337
422
|
...e,
|
|
338
|
-
mutationFn: async (
|
|
339
|
-
onSuccess: (
|
|
340
|
-
var
|
|
341
|
-
|
|
423
|
+
mutationFn: async (s) => n.query(le, g(s)),
|
|
424
|
+
onSuccess: async (s, a, r) => {
|
|
425
|
+
var i, u;
|
|
426
|
+
await t.invalidateQueries({ queryKey: R.lists() }), await ((u = c((i = c(e)) == null ? void 0 : i.onSuccess)) == null ? void 0 : u(s, a, r));
|
|
342
427
|
}
|
|
343
428
|
});
|
|
344
429
|
}
|
|
345
|
-
const
|
|
346
|
-
function
|
|
347
|
-
const
|
|
348
|
-
return
|
|
430
|
+
const de = "updateCustomerAddress patch /account/address/{addressId}";
|
|
431
|
+
function ut(e) {
|
|
432
|
+
const n = v(), t = P();
|
|
433
|
+
return Q({
|
|
349
434
|
...e,
|
|
350
|
-
mutationFn: async (
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
435
|
+
mutationFn: async (s) => n.query(de, g(s)),
|
|
436
|
+
onSuccess: async (s, a, r) => {
|
|
437
|
+
var u, m;
|
|
438
|
+
const { addressId: i } = g(a).params;
|
|
439
|
+
t.setQueryData(R.detail(i), s), await Promise.all([
|
|
440
|
+
t.invalidateQueries({ queryKey: R.lists() }),
|
|
441
|
+
t.invalidateQueries({
|
|
442
|
+
queryKey: R.detail(g(a).params.addressId),
|
|
443
|
+
predicate: (q) => q.queryKey.at(-1) !== i
|
|
444
|
+
})
|
|
445
|
+
]), await ((m = c((u = c(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : m(s, a, r));
|
|
356
446
|
}
|
|
357
447
|
});
|
|
358
448
|
}
|
|
359
|
-
const
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
const o = l(n), a = l(o.onMutate);
|
|
371
|
-
a == null || a(r);
|
|
372
|
-
}
|
|
373
|
-
return { previousValue: u };
|
|
374
|
-
},
|
|
375
|
-
onError: (r, u, o) => {
|
|
376
|
-
if (o && t.setQueryData(e, o.previousValue), n) {
|
|
377
|
-
const a = l(n), p = l(a.onError);
|
|
378
|
-
p == null || p(r, u, o);
|
|
379
|
-
}
|
|
380
|
-
},
|
|
381
|
-
onSettled: (...r) => {
|
|
382
|
-
if (t.invalidateQueries({ queryKey: e }), n) {
|
|
383
|
-
const u = l(n), o = l(u.onSettled);
|
|
384
|
-
o == null || o(...r);
|
|
385
|
-
}
|
|
449
|
+
const ye = "addLineItem post /checkout/cart/line-item";
|
|
450
|
+
function ot(e) {
|
|
451
|
+
const n = v(), t = P();
|
|
452
|
+
return Q({
|
|
453
|
+
...e,
|
|
454
|
+
mutationFn: async (s) => n.query(ye, {
|
|
455
|
+
body: s
|
|
456
|
+
}),
|
|
457
|
+
onSuccess: async (s, a, r) => {
|
|
458
|
+
var i, u;
|
|
459
|
+
t.setQueryData(I.get(), s), await ((u = c((i = c(e)) == null ? void 0 : i.onSuccess)) == null ? void 0 : u(s, a, r));
|
|
386
460
|
}
|
|
387
|
-
};
|
|
461
|
+
});
|
|
388
462
|
}
|
|
389
|
-
const
|
|
390
|
-
function
|
|
391
|
-
const
|
|
392
|
-
return
|
|
393
|
-
queryKey:
|
|
394
|
-
queryFn: async ({ signal:
|
|
395
|
-
...
|
|
396
|
-
signal:
|
|
463
|
+
const pe = "readCart get /checkout/cart";
|
|
464
|
+
function me(e) {
|
|
465
|
+
const n = v(), t = I.get();
|
|
466
|
+
return M({
|
|
467
|
+
queryKey: t,
|
|
468
|
+
queryFn: async ({ signal: s }) => n.query(pe, {
|
|
469
|
+
...g(e),
|
|
470
|
+
signal: s
|
|
397
471
|
})
|
|
398
472
|
});
|
|
399
473
|
}
|
|
400
|
-
function
|
|
401
|
-
return O(
|
|
474
|
+
function ct() {
|
|
475
|
+
return O(me());
|
|
402
476
|
}
|
|
403
|
-
const
|
|
404
|
-
function
|
|
405
|
-
const
|
|
406
|
-
return
|
|
477
|
+
const ge = "removeLineItem post /checkout/cart/line-item/delete";
|
|
478
|
+
function lt(e) {
|
|
479
|
+
const n = v(), t = P();
|
|
480
|
+
return Q({
|
|
407
481
|
...e,
|
|
408
|
-
mutationFn: async (
|
|
409
|
-
body:
|
|
482
|
+
mutationFn: async (s) => n.query(ge, {
|
|
483
|
+
body: s
|
|
410
484
|
}),
|
|
411
|
-
onSuccess: (
|
|
412
|
-
var
|
|
413
|
-
|
|
485
|
+
onSuccess: async (s, a, r) => {
|
|
486
|
+
var i, u;
|
|
487
|
+
t.setQueryData(I.get(), s), await ((u = c((i = c(e)) == null ? void 0 : i.onSuccess)) == null ? void 0 : u(s, a, r));
|
|
414
488
|
}
|
|
415
489
|
});
|
|
416
490
|
}
|
|
417
|
-
const
|
|
418
|
-
function
|
|
419
|
-
const
|
|
420
|
-
return
|
|
491
|
+
const ve = "updateLineItem patch /checkout/cart/line-item";
|
|
492
|
+
function dt(e) {
|
|
493
|
+
const n = v(), t = P();
|
|
494
|
+
return Q({
|
|
421
495
|
...e,
|
|
422
|
-
mutationFn: async (
|
|
423
|
-
body:
|
|
496
|
+
mutationFn: async (s) => n.query(ve, {
|
|
497
|
+
body: s
|
|
424
498
|
}),
|
|
425
|
-
onSuccess: (
|
|
426
|
-
var
|
|
427
|
-
|
|
499
|
+
onSuccess: async (s, a, r) => {
|
|
500
|
+
var i, u;
|
|
501
|
+
t.setQueryData(I.get(), s), await ((u = c((i = c(e)) == null ? void 0 : i.onSuccess)) == null ? void 0 : u(s, a, r));
|
|
428
502
|
}
|
|
429
503
|
});
|
|
430
504
|
}
|
|
431
|
-
const
|
|
432
|
-
},
|
|
433
|
-
function
|
|
434
|
-
const
|
|
435
|
-
return
|
|
505
|
+
const yt = () => {
|
|
506
|
+
}, he = "createOrder post /checkout/order";
|
|
507
|
+
function pt(e) {
|
|
508
|
+
const n = v(), t = P();
|
|
509
|
+
return Q({
|
|
436
510
|
...e,
|
|
437
|
-
mutationFn: async (
|
|
438
|
-
onSuccess: (
|
|
439
|
-
var
|
|
440
|
-
|
|
511
|
+
mutationFn: async (s) => n.query(he, g(s)),
|
|
512
|
+
onSuccess: async (s, a, r) => {
|
|
513
|
+
var i, u;
|
|
514
|
+
await Promise.all([
|
|
515
|
+
// Clear cart after successful order creation
|
|
516
|
+
t.invalidateQueries({ queryKey: I.get() }),
|
|
517
|
+
// Invalidate order list to refetch data
|
|
518
|
+
t.invalidateQueries({ queryKey: L.lists() })
|
|
519
|
+
]), await ((u = c((i = c(e)) == null ? void 0 : i.onSuccess)) == null ? void 0 : u(s, a, r));
|
|
520
|
+
}
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
const fe = "readCountry post /country", qe = function(n) {
|
|
524
|
+
const t = v(), s = T.list(n);
|
|
525
|
+
return M({
|
|
526
|
+
queryKey: s,
|
|
527
|
+
queryFn: async ({ signal: a }) => {
|
|
528
|
+
const r = g(n);
|
|
529
|
+
return t.query(fe, {
|
|
530
|
+
...r,
|
|
531
|
+
signal: a
|
|
532
|
+
});
|
|
441
533
|
}
|
|
442
534
|
});
|
|
535
|
+
};
|
|
536
|
+
function mt(e) {
|
|
537
|
+
return O(qe(e));
|
|
443
538
|
}
|
|
444
|
-
const
|
|
445
|
-
function
|
|
446
|
-
const
|
|
447
|
-
return
|
|
539
|
+
const Ce = "changeEmail post /account/change-email";
|
|
540
|
+
function gt(e) {
|
|
541
|
+
const n = v(), t = P();
|
|
542
|
+
return Q({
|
|
448
543
|
...e,
|
|
449
|
-
mutationFn: async (
|
|
450
|
-
onSuccess: (
|
|
451
|
-
var
|
|
452
|
-
|
|
544
|
+
mutationFn: async (s) => n.query(Ce, g(s)),
|
|
545
|
+
onSuccess: async (s, a, r) => {
|
|
546
|
+
var i, u;
|
|
547
|
+
await t.invalidateQueries({ queryKey: x.all() }), await ((u = c((i = c(e)) == null ? void 0 : i.onSuccess)) == null ? void 0 : u(s, a, r));
|
|
453
548
|
}
|
|
454
549
|
});
|
|
455
550
|
}
|
|
456
|
-
const
|
|
457
|
-
function
|
|
458
|
-
const
|
|
459
|
-
return
|
|
551
|
+
const Se = "changeProfile post /account/change-profile";
|
|
552
|
+
function vt(e) {
|
|
553
|
+
const n = v(), t = P();
|
|
554
|
+
return Q({
|
|
460
555
|
...e,
|
|
461
|
-
mutationFn: async (
|
|
462
|
-
onSuccess: (
|
|
463
|
-
var
|
|
464
|
-
|
|
556
|
+
mutationFn: async (s) => n.query(Se, g(s)),
|
|
557
|
+
onSuccess: async (s, a, r) => {
|
|
558
|
+
var i, u;
|
|
559
|
+
await t.invalidateQueries({ queryKey: x.all() }), await ((u = c((i = c(e)) == null ? void 0 : i.onSuccess)) == null ? void 0 : u(s, a, r));
|
|
465
560
|
}
|
|
466
561
|
});
|
|
467
562
|
}
|
|
468
|
-
const
|
|
469
|
-
function
|
|
470
|
-
const
|
|
471
|
-
return
|
|
563
|
+
const Pe = "loginCustomer post /account/login";
|
|
564
|
+
function ht(e) {
|
|
565
|
+
const n = v(), t = P();
|
|
566
|
+
return Q({
|
|
472
567
|
...e,
|
|
473
|
-
mutationFn: async (
|
|
474
|
-
const
|
|
475
|
-
body:
|
|
476
|
-
}),
|
|
477
|
-
return
|
|
568
|
+
mutationFn: async (s) => {
|
|
569
|
+
const a = await n.queryRaw(Pe, {
|
|
570
|
+
body: s
|
|
571
|
+
}), r = a.headers.get("sw-context-token");
|
|
572
|
+
return r && n.setContextToken(r), a.json();
|
|
478
573
|
},
|
|
479
|
-
onSuccess: (
|
|
480
|
-
var
|
|
481
|
-
|
|
574
|
+
onSuccess: async (s, a, r) => {
|
|
575
|
+
var i, u;
|
|
576
|
+
await Promise.all([
|
|
577
|
+
t.removeQueries({ queryKey: b.all() }),
|
|
578
|
+
t.invalidateQueries({ queryKey: I.get() }),
|
|
579
|
+
t.invalidateQueries({ queryKey: x.all() })
|
|
580
|
+
]), await ((u = c((i = c(e)) == null ? void 0 : i.onSuccess)) == null ? void 0 : u(s, a, r));
|
|
482
581
|
}
|
|
483
582
|
});
|
|
484
583
|
}
|
|
485
|
-
const
|
|
486
|
-
function
|
|
487
|
-
const
|
|
488
|
-
return
|
|
584
|
+
const Qe = "logoutCustomer post /account/logout";
|
|
585
|
+
function ft(e) {
|
|
586
|
+
const n = v(), t = P();
|
|
587
|
+
return Q({
|
|
489
588
|
...e,
|
|
490
|
-
mutationFn: async (
|
|
491
|
-
onSuccess: (
|
|
492
|
-
var
|
|
493
|
-
|
|
589
|
+
mutationFn: async (s) => n.query(Qe, g(s)),
|
|
590
|
+
onSuccess: async (s, a, r) => {
|
|
591
|
+
var i, u;
|
|
592
|
+
await Promise.all([
|
|
593
|
+
t.removeQueries({ queryKey: b.all() }),
|
|
594
|
+
t.invalidateQueries({ queryKey: I.get() }),
|
|
595
|
+
t.invalidateQueries({ queryKey: x.all() })
|
|
596
|
+
]), await ((u = c((i = c(e)) == null ? void 0 : i.onSuccess)) == null ? void 0 : u(s, a, r));
|
|
494
597
|
}
|
|
495
598
|
});
|
|
496
599
|
}
|
|
497
|
-
const
|
|
498
|
-
function
|
|
499
|
-
const
|
|
500
|
-
return
|
|
501
|
-
queryKey:
|
|
502
|
-
queryFn: async () =>
|
|
600
|
+
const Me = "readCustomer post /account/customer";
|
|
601
|
+
function Oe(e) {
|
|
602
|
+
const n = v(), t = x.detail(o(() => g(e).body ?? {}));
|
|
603
|
+
return M({
|
|
604
|
+
queryKey: t,
|
|
605
|
+
queryFn: async () => n.query(Me, g(e))
|
|
503
606
|
});
|
|
504
607
|
}
|
|
505
|
-
function
|
|
506
|
-
return O(
|
|
608
|
+
function Ae(e) {
|
|
609
|
+
return O(Oe(e));
|
|
507
610
|
}
|
|
508
|
-
const
|
|
509
|
-
function
|
|
510
|
-
const
|
|
511
|
-
return
|
|
611
|
+
const Ke = "register post /account/register";
|
|
612
|
+
function qt(e) {
|
|
613
|
+
const n = v(), t = P();
|
|
614
|
+
return Q({
|
|
512
615
|
...e,
|
|
513
|
-
mutationFn: async (
|
|
514
|
-
onSuccess: (
|
|
515
|
-
var
|
|
516
|
-
|
|
616
|
+
mutationFn: async (s) => n.query(Ke, g(s)),
|
|
617
|
+
onSuccess: async (s, a, r) => {
|
|
618
|
+
var i, u;
|
|
619
|
+
await t.invalidateQueries({ queryKey: x.all() }), await ((u = c((i = c(e)) == null ? void 0 : i.onSuccess)) == null ? void 0 : u(s, a, r));
|
|
517
620
|
}
|
|
518
621
|
});
|
|
519
622
|
}
|
|
520
|
-
const
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
623
|
+
const Re = "readNavigation post /navigation/{activeId}/{rootId}", Fe = function(n, t, s) {
|
|
624
|
+
const a = v(), r = U.detail(n, t, s);
|
|
625
|
+
return M({
|
|
626
|
+
queryKey: r,
|
|
627
|
+
queryFn: async ({ signal: i }) => {
|
|
628
|
+
const u = c(n), m = c(t), q = g(s);
|
|
629
|
+
return a.query(Re, {
|
|
630
|
+
...q,
|
|
631
|
+
params: {
|
|
632
|
+
activeId: u,
|
|
633
|
+
rootId: m
|
|
634
|
+
},
|
|
635
|
+
signal: i
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
});
|
|
639
|
+
};
|
|
640
|
+
function Ct(e, n, t) {
|
|
641
|
+
return O(Fe(e, n, t));
|
|
642
|
+
}
|
|
643
|
+
const Ie = "readPaymentMethod post /payment-method";
|
|
644
|
+
function we(e) {
|
|
645
|
+
const n = v(), t = B.list(o(() => {
|
|
646
|
+
var s;
|
|
647
|
+
return (s = g(e)) == null ? void 0 : s.body;
|
|
525
648
|
}));
|
|
526
|
-
return
|
|
527
|
-
queryKey:
|
|
528
|
-
queryFn: ({ signal:
|
|
529
|
-
...
|
|
530
|
-
signal:
|
|
649
|
+
return M({
|
|
650
|
+
queryKey: t,
|
|
651
|
+
queryFn: ({ signal: s }) => n.query(Ie, {
|
|
652
|
+
...g(e),
|
|
653
|
+
signal: s
|
|
531
654
|
})
|
|
532
655
|
});
|
|
533
656
|
}
|
|
534
|
-
function
|
|
535
|
-
return O(
|
|
657
|
+
function Le(e) {
|
|
658
|
+
return O(we(e));
|
|
536
659
|
}
|
|
537
|
-
const
|
|
538
|
-
function
|
|
539
|
-
const
|
|
540
|
-
return
|
|
660
|
+
const xe = "handlePaymentMethod post /handle-payment";
|
|
661
|
+
function St(e) {
|
|
662
|
+
const n = v();
|
|
663
|
+
return Q({
|
|
541
664
|
...e,
|
|
542
|
-
mutationFn: async (
|
|
543
|
-
onSuccess: (
|
|
544
|
-
var
|
|
545
|
-
(
|
|
665
|
+
mutationFn: async (t) => n.query(xe, g(t)),
|
|
666
|
+
onSuccess: async (t, s, a) => {
|
|
667
|
+
var r, i;
|
|
668
|
+
await ((i = c((r = c(e)) == null ? void 0 : r.onSuccess)) == null ? void 0 : i(t, s, a));
|
|
546
669
|
}
|
|
547
670
|
});
|
|
548
671
|
}
|
|
549
|
-
const
|
|
550
|
-
function
|
|
551
|
-
const
|
|
552
|
-
return
|
|
672
|
+
const Ue = "orderSetPayment post /order/payment";
|
|
673
|
+
function Pt(e) {
|
|
674
|
+
const n = v(), t = P();
|
|
675
|
+
return Q({
|
|
553
676
|
...e,
|
|
554
|
-
mutationFn: async (
|
|
555
|
-
onSuccess: (
|
|
556
|
-
var
|
|
557
|
-
|
|
677
|
+
mutationFn: async (s) => n.query(Ue, g(s)),
|
|
678
|
+
onSuccess: async (s, a, r) => {
|
|
679
|
+
var i, u;
|
|
680
|
+
await t.invalidateQueries({ queryKey: L.all() }), await ((u = c((i = c(e)) == null ? void 0 : i.onSuccess)) == null ? void 0 : u(s, a, r));
|
|
558
681
|
}
|
|
559
682
|
});
|
|
560
683
|
}
|
|
561
|
-
const
|
|
562
|
-
const
|
|
563
|
-
return
|
|
564
|
-
queryKey:
|
|
565
|
-
queryFn: async ({ signal:
|
|
566
|
-
...
|
|
567
|
-
signal:
|
|
684
|
+
const be = "readCategoryList post /category", ke = function(n) {
|
|
685
|
+
const t = v(), s = k.list(n);
|
|
686
|
+
return M({
|
|
687
|
+
queryKey: s,
|
|
688
|
+
queryFn: async ({ signal: a }) => t.query(be, {
|
|
689
|
+
...g(n),
|
|
690
|
+
signal: a
|
|
568
691
|
})
|
|
569
692
|
});
|
|
570
693
|
};
|
|
571
|
-
function
|
|
572
|
-
return O(
|
|
694
|
+
function Qt(e) {
|
|
695
|
+
return O(ke(e));
|
|
573
696
|
}
|
|
574
|
-
const
|
|
575
|
-
function
|
|
576
|
-
const
|
|
577
|
-
return
|
|
578
|
-
queryKey:
|
|
579
|
-
queryFn: async ({ signal:
|
|
580
|
-
const
|
|
581
|
-
return
|
|
582
|
-
...
|
|
697
|
+
const Ne = "readCompactProductListing post /novu/headless/product-listing/{seoUrl}";
|
|
698
|
+
function Be(e, n) {
|
|
699
|
+
const t = v(), s = w.list(e, n);
|
|
700
|
+
return M({
|
|
701
|
+
queryKey: s,
|
|
702
|
+
queryFn: async ({ signal: a }) => {
|
|
703
|
+
const r = g(n);
|
|
704
|
+
return t.query(Ne, {
|
|
705
|
+
...r,
|
|
583
706
|
params: {
|
|
584
|
-
...
|
|
585
|
-
seoUrl:
|
|
707
|
+
...r.params,
|
|
708
|
+
seoUrl: j(c(e))
|
|
586
709
|
},
|
|
587
|
-
signal:
|
|
710
|
+
signal: a
|
|
588
711
|
});
|
|
589
712
|
}
|
|
590
713
|
});
|
|
591
714
|
}
|
|
592
|
-
function
|
|
593
|
-
return O(
|
|
715
|
+
function Mt(e, n) {
|
|
716
|
+
return O(Be(e, n));
|
|
594
717
|
}
|
|
595
|
-
const
|
|
596
|
-
function
|
|
597
|
-
const
|
|
598
|
-
return
|
|
599
|
-
queryKey:
|
|
600
|
-
queryFn: async ({ signal:
|
|
601
|
-
const
|
|
602
|
-
return
|
|
603
|
-
...
|
|
718
|
+
const Ee = "readCustomProductDetail post /novu/headless/product/{seoUrl}";
|
|
719
|
+
function De(e, n) {
|
|
720
|
+
const t = v(), s = w.detail(e, n);
|
|
721
|
+
return M({
|
|
722
|
+
queryKey: s,
|
|
723
|
+
queryFn: async ({ signal: a }) => {
|
|
724
|
+
const r = g(n);
|
|
725
|
+
return t.query(Ee, {
|
|
726
|
+
...r,
|
|
604
727
|
params: {
|
|
605
|
-
...
|
|
606
|
-
seoUrl:
|
|
728
|
+
...r.params,
|
|
729
|
+
seoUrl: j(c(e))
|
|
607
730
|
},
|
|
608
|
-
signal:
|
|
731
|
+
signal: a
|
|
732
|
+
});
|
|
733
|
+
}
|
|
734
|
+
});
|
|
735
|
+
}
|
|
736
|
+
function Ot(e, n) {
|
|
737
|
+
return O(De(e, n));
|
|
738
|
+
}
|
|
739
|
+
const Te = "readSalutation post /salutation", je = function(n) {
|
|
740
|
+
const t = v(), s = D.list(n);
|
|
741
|
+
return M({
|
|
742
|
+
queryKey: s,
|
|
743
|
+
queryFn: async ({ signal: a }) => {
|
|
744
|
+
const r = g(n);
|
|
745
|
+
return t.query(Te, {
|
|
746
|
+
...r,
|
|
747
|
+
signal: a
|
|
609
748
|
});
|
|
610
749
|
}
|
|
611
750
|
});
|
|
751
|
+
};
|
|
752
|
+
function At(e) {
|
|
753
|
+
return O(je(e));
|
|
612
754
|
}
|
|
613
|
-
|
|
614
|
-
|
|
755
|
+
const Ve = "readSeoUrl post /seo-url", $e = function(n) {
|
|
756
|
+
const t = v(), s = E.list(n);
|
|
757
|
+
return M({
|
|
758
|
+
queryKey: s,
|
|
759
|
+
queryFn: async ({ signal: a }) => {
|
|
760
|
+
const r = g(n);
|
|
761
|
+
return t.query(Ve, {
|
|
762
|
+
...r,
|
|
763
|
+
signal: a
|
|
764
|
+
});
|
|
765
|
+
}
|
|
766
|
+
});
|
|
767
|
+
};
|
|
768
|
+
function Kt(e) {
|
|
769
|
+
return O($e(e));
|
|
615
770
|
}
|
|
616
|
-
const
|
|
617
|
-
function
|
|
618
|
-
const
|
|
619
|
-
var
|
|
620
|
-
return (
|
|
771
|
+
const ze = "readShippingMethod post /shipping-method";
|
|
772
|
+
function Ge(e) {
|
|
773
|
+
const n = v(), t = N.list(o(() => {
|
|
774
|
+
var s;
|
|
775
|
+
return (s = g(e)) == null ? void 0 : s.body;
|
|
621
776
|
}));
|
|
622
|
-
return
|
|
623
|
-
queryKey:
|
|
624
|
-
queryFn: ({ signal:
|
|
625
|
-
...
|
|
626
|
-
signal:
|
|
777
|
+
return M({
|
|
778
|
+
queryKey: t,
|
|
779
|
+
queryFn: ({ signal: s }) => n.query(ze, {
|
|
780
|
+
...g(e),
|
|
781
|
+
signal: s
|
|
627
782
|
})
|
|
628
783
|
});
|
|
629
784
|
}
|
|
630
|
-
function
|
|
631
|
-
return O(
|
|
785
|
+
function He(e) {
|
|
786
|
+
return O(Ge(e));
|
|
632
787
|
}
|
|
633
|
-
function
|
|
634
|
-
const e =
|
|
788
|
+
function Rt() {
|
|
789
|
+
const e = V(), n = $(), t = Le({
|
|
635
790
|
query: {
|
|
636
|
-
|
|
791
|
+
onlyAvailable: !0
|
|
637
792
|
}
|
|
638
|
-
}),
|
|
639
|
-
paymentMethodId:
|
|
640
|
-
}),
|
|
641
|
-
var
|
|
642
|
-
return (
|
|
643
|
-
}),
|
|
644
|
-
var
|
|
645
|
-
return (
|
|
793
|
+
}), s = o(() => n.isPending.value), a = async (u) => n.mutateAsync({
|
|
794
|
+
paymentMethodId: u
|
|
795
|
+
}), r = o(() => {
|
|
796
|
+
var u, m;
|
|
797
|
+
return (m = (u = e.data) == null ? void 0 : u.value) == null ? void 0 : m.paymentMethod;
|
|
798
|
+
}), i = o(() => {
|
|
799
|
+
var u, m, q;
|
|
800
|
+
return ((q = (m = (u = t.data) == null ? void 0 : u.value) == null ? void 0 : m.elements) == null ? void 0 : q.sort((d, C) => (d.position ?? 0) - (C.position ?? 0))) ?? [];
|
|
646
801
|
});
|
|
647
802
|
return {
|
|
648
|
-
contextUpdateMutation:
|
|
803
|
+
contextUpdateMutation: n,
|
|
649
804
|
contextQuery: e,
|
|
650
|
-
paymentMethodsQuery:
|
|
651
|
-
activePaymentMethod:
|
|
652
|
-
setPaymentMethod:
|
|
653
|
-
isSaving:
|
|
654
|
-
paymentMethods:
|
|
805
|
+
paymentMethodsQuery: t,
|
|
806
|
+
activePaymentMethod: r,
|
|
807
|
+
setPaymentMethod: a,
|
|
808
|
+
isSaving: s,
|
|
809
|
+
paymentMethods: i
|
|
655
810
|
};
|
|
656
811
|
}
|
|
657
|
-
function
|
|
658
|
-
const e =
|
|
812
|
+
function Ft() {
|
|
813
|
+
const e = V(), n = $(), t = He({
|
|
659
814
|
query: {
|
|
660
|
-
|
|
815
|
+
onlyAvailable: !0
|
|
661
816
|
}
|
|
662
|
-
}),
|
|
663
|
-
shippingMethodId:
|
|
664
|
-
}),
|
|
665
|
-
var
|
|
666
|
-
return (
|
|
667
|
-
}),
|
|
668
|
-
var
|
|
669
|
-
return (
|
|
817
|
+
}), s = o(() => n.isPending.value), a = async (u) => n.mutateAsync({
|
|
818
|
+
shippingMethodId: u
|
|
819
|
+
}), r = o(() => {
|
|
820
|
+
var u, m;
|
|
821
|
+
return (m = (u = e.data) == null ? void 0 : u.value) == null ? void 0 : m.shippingMethod;
|
|
822
|
+
}), i = o(() => {
|
|
823
|
+
var u, m;
|
|
824
|
+
return ((m = (u = t.data) == null ? void 0 : u.value) == null ? void 0 : m.elements.sort((q, d) => (q.position ?? 0) - (d.position ?? 0))) ?? [];
|
|
670
825
|
});
|
|
671
826
|
return {
|
|
672
|
-
contextUpdateMutation:
|
|
827
|
+
contextUpdateMutation: n,
|
|
673
828
|
contextQuery: e,
|
|
674
|
-
shippingMethodsQuery:
|
|
675
|
-
activeShippingMethod:
|
|
676
|
-
setShippingMethod:
|
|
677
|
-
isSaving:
|
|
678
|
-
shippingMethods:
|
|
829
|
+
shippingMethodsQuery: t,
|
|
830
|
+
activeShippingMethod: r,
|
|
831
|
+
setShippingMethod: a,
|
|
832
|
+
isSaving: s,
|
|
833
|
+
shippingMethods: i
|
|
679
834
|
};
|
|
680
835
|
}
|
|
681
|
-
const
|
|
682
|
-
var
|
|
683
|
-
const
|
|
684
|
-
return (
|
|
685
|
-
},
|
|
686
|
-
function
|
|
687
|
-
const { total:
|
|
688
|
-
page:
|
|
689
|
-
total:
|
|
690
|
-
limit:
|
|
691
|
-
|
|
836
|
+
const We = (e, n) => {
|
|
837
|
+
var s;
|
|
838
|
+
const t = (s = e.extensions) == null ? void 0 : s.novuSeoUrls;
|
|
839
|
+
return (t == null ? void 0 : t[n]) ?? "";
|
|
840
|
+
}, It = (e, n) => o(() => We(c(e), c(n)));
|
|
841
|
+
function wt(e) {
|
|
842
|
+
const { total: n, limit: t, page: s, totalCountMode: a } = e ?? {}, r = Z({
|
|
843
|
+
page: s ?? 1,
|
|
844
|
+
total: n ?? 0,
|
|
845
|
+
limit: t,
|
|
846
|
+
totalCountMode: a
|
|
847
|
+
}), i = o(() => r.limit === void 0 ? 1 : Math.max(1, Math.ceil(r.total / r.limit))), u = o({
|
|
692
848
|
get() {
|
|
693
849
|
return r.page;
|
|
694
850
|
},
|
|
695
|
-
set(
|
|
696
|
-
r.page = Math.max(1, Math.min(
|
|
851
|
+
set(S) {
|
|
852
|
+
r.page = Math.max(1, Math.min(c(i), S));
|
|
697
853
|
}
|
|
698
854
|
});
|
|
699
|
-
|
|
700
|
-
[() =>
|
|
701
|
-
([
|
|
702
|
-
r.page = Math.min(
|
|
855
|
+
H(
|
|
856
|
+
[() => c(i), () => r],
|
|
857
|
+
([S, y]) => {
|
|
858
|
+
r.page = Math.min(S, r.page), r.total = y.total ?? 0, r.limit = y.limit;
|
|
703
859
|
}
|
|
704
860
|
);
|
|
705
|
-
const
|
|
861
|
+
const m = o(() => r.page === c(i)), q = o(() => r.page === 1), d = o(() => ({
|
|
706
862
|
p: r.page,
|
|
707
|
-
limit: r.limit
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
863
|
+
limit: r.limit,
|
|
864
|
+
"total-count-mode": r.totalCountMode ?? "none"
|
|
865
|
+
})), C = (S) => {
|
|
866
|
+
H(() => c(S), (y) => {
|
|
867
|
+
y && (r.total = (y == null ? void 0 : y.total) ?? 0, r.limit = (y == null ? void 0 : y.limit) ?? 0);
|
|
711
868
|
});
|
|
712
869
|
};
|
|
713
870
|
return {
|
|
714
|
-
page:
|
|
715
|
-
total:
|
|
716
|
-
limit:
|
|
717
|
-
pageCount:
|
|
718
|
-
isLastPage:
|
|
719
|
-
isFirstPage:
|
|
720
|
-
usePaginationSync:
|
|
871
|
+
page: c(u),
|
|
872
|
+
total: W(r, "total"),
|
|
873
|
+
limit: W(r, "limit"),
|
|
874
|
+
pageCount: i,
|
|
875
|
+
isLastPage: m,
|
|
876
|
+
isFirstPage: q,
|
|
877
|
+
usePaginationSync: C,
|
|
721
878
|
// This can be used to pass the pagination options directly to the query options
|
|
722
|
-
queryOptions:
|
|
879
|
+
queryOptions: d
|
|
723
880
|
};
|
|
724
881
|
}
|
|
725
|
-
function
|
|
726
|
-
var
|
|
727
|
-
if (!e || !((
|
|
882
|
+
function X(e) {
|
|
883
|
+
var t;
|
|
884
|
+
if (!e || !((t = e.calculatedPrices) != null && t.length))
|
|
728
885
|
return [];
|
|
729
|
-
const
|
|
730
|
-
return e.calculatedPrices.map(({ unitPrice:
|
|
731
|
-
label:
|
|
732
|
-
quantity:
|
|
733
|
-
unitPrice:
|
|
886
|
+
const n = e.calculatedPrices.length;
|
|
887
|
+
return e.calculatedPrices.map(({ unitPrice: s, quantity: a }, r) => ({
|
|
888
|
+
label: r === n - 1 ? `from ${a}` : `to ${a}`,
|
|
889
|
+
quantity: a,
|
|
890
|
+
unitPrice: s
|
|
734
891
|
}));
|
|
735
892
|
}
|
|
736
|
-
function
|
|
737
|
-
const
|
|
738
|
-
var
|
|
739
|
-
return (
|
|
740
|
-
}),
|
|
893
|
+
function Lt(e) {
|
|
894
|
+
const n = o(() => {
|
|
895
|
+
var y;
|
|
896
|
+
return (y = e.value) == null ? void 0 : y.calculatedCheapestPrice;
|
|
897
|
+
}), t = o(
|
|
741
898
|
() => {
|
|
742
|
-
var
|
|
743
|
-
return (((
|
|
744
|
-
}
|
|
745
|
-
),
|
|
746
|
-
var
|
|
747
|
-
return (
|
|
748
|
-
}),
|
|
749
|
-
var
|
|
750
|
-
return (((
|
|
751
|
-
}),
|
|
899
|
+
var y, h, A, K, l;
|
|
900
|
+
return (((h = (y = e.value) == null ? void 0 : y.calculatedPrices) == null ? void 0 : h.length) ?? 0) > 0 ? (K = (A = e.value) == null ? void 0 : A.calculatedPrices) == null ? void 0 : K[0] : (l = e.value) == null ? void 0 : l.calculatedPrice;
|
|
901
|
+
}
|
|
902
|
+
), s = o(() => {
|
|
903
|
+
var y;
|
|
904
|
+
return (y = t == null ? void 0 : t.value) == null ? void 0 : y.referencePrice;
|
|
905
|
+
}), a = o(() => {
|
|
906
|
+
var y, h;
|
|
907
|
+
return (((h = (y = e.value) == null ? void 0 : y.calculatedPrices) == null ? void 0 : h.length) ?? 0) > 1;
|
|
908
|
+
}), r = o(
|
|
752
909
|
() => {
|
|
753
|
-
var
|
|
754
|
-
return !!((
|
|
910
|
+
var y, h, A, K, l, p;
|
|
911
|
+
return !!((y = e.value) != null && y.parentId) && ((A = (h = e.value) == null ? void 0 : h.calculatedCheapestPrice) == null ? void 0 : A.hasRange) && ((K = t == null ? void 0 : t.value) == null ? void 0 : K.unitPrice) !== ((l = n == null ? void 0 : n.value) == null ? void 0 : l.unitPrice) && ((p = n == null ? void 0 : n.value) == null ? void 0 : p.unitPrice);
|
|
755
912
|
}
|
|
756
|
-
),
|
|
913
|
+
), i = o(
|
|
757
914
|
() => {
|
|
758
|
-
var
|
|
759
|
-
return
|
|
915
|
+
var y, h;
|
|
916
|
+
return a.value && X(e.value).length > 1 ? (h = (y = e.value) == null ? void 0 : y.calculatedPrices) == null ? void 0 : h.reduce((A, K) => K.unitPrice < A.unitPrice ? K : A) : t.value;
|
|
760
917
|
}
|
|
761
|
-
),
|
|
918
|
+
), u = o(
|
|
762
919
|
() => {
|
|
763
|
-
var
|
|
764
|
-
return (
|
|
920
|
+
var y;
|
|
921
|
+
return (y = i.value) == null ? void 0 : y.unitPrice;
|
|
765
922
|
}
|
|
766
|
-
),
|
|
923
|
+
), m = o(
|
|
767
924
|
() => {
|
|
768
|
-
var
|
|
769
|
-
return (
|
|
770
|
-
}
|
|
771
|
-
),
|
|
772
|
-
() =>
|
|
773
|
-
), d =
|
|
774
|
-
var
|
|
775
|
-
return !!((
|
|
776
|
-
}),
|
|
925
|
+
var y;
|
|
926
|
+
return (y = i.value) == null ? void 0 : y.totalPrice;
|
|
927
|
+
}
|
|
928
|
+
), q = o(
|
|
929
|
+
() => i.value
|
|
930
|
+
), d = o(() => {
|
|
931
|
+
var y, h;
|
|
932
|
+
return !!((h = (y = i.value) == null ? void 0 : y.listPrice) != null && h.percentage);
|
|
933
|
+
}), C = o(
|
|
777
934
|
() => {
|
|
778
|
-
var
|
|
779
|
-
return (
|
|
935
|
+
var y, h, A;
|
|
936
|
+
return (A = (h = (y = e.value) == null ? void 0 : y.calculatedPrice) == null ? void 0 : h.regulationPrice) == null ? void 0 : A.price;
|
|
780
937
|
}
|
|
781
|
-
),
|
|
938
|
+
), S = o(() => X(e.value));
|
|
782
939
|
return {
|
|
783
|
-
price:
|
|
784
|
-
totalPrice:
|
|
785
|
-
unitPrice:
|
|
786
|
-
displayFromVariants:
|
|
787
|
-
displayFrom:
|
|
788
|
-
tierPrices:
|
|
789
|
-
referencePrice:
|
|
940
|
+
price: q,
|
|
941
|
+
totalPrice: m,
|
|
942
|
+
unitPrice: u,
|
|
943
|
+
displayFromVariants: r,
|
|
944
|
+
displayFrom: a,
|
|
945
|
+
tierPrices: S,
|
|
946
|
+
referencePrice: s,
|
|
790
947
|
isListPrice: d,
|
|
791
|
-
regulationPrice:
|
|
948
|
+
regulationPrice: C
|
|
792
949
|
};
|
|
793
950
|
}
|
|
794
|
-
function
|
|
795
|
-
var
|
|
796
|
-
const
|
|
797
|
-
return
|
|
798
|
-
var
|
|
799
|
-
return ((
|
|
800
|
-
})) ?? (
|
|
801
|
-
var
|
|
802
|
-
return (
|
|
951
|
+
function Je(e, n) {
|
|
952
|
+
var s;
|
|
953
|
+
const t = (s = e.extensions) == null ? void 0 : s.variants;
|
|
954
|
+
return n.length === 0 ? (t == null ? void 0 : t.find((a) => {
|
|
955
|
+
var r;
|
|
956
|
+
return ((r = a.optionIds) == null ? void 0 : r.length) === 0;
|
|
957
|
+
})) ?? (t == null ? void 0 : t[0]) : t == null ? void 0 : t.find((a) => {
|
|
958
|
+
var r;
|
|
959
|
+
return (r = a.optionIds) == null ? void 0 : r.every((i) => n.includes(i));
|
|
803
960
|
});
|
|
804
961
|
}
|
|
805
|
-
function
|
|
806
|
-
return
|
|
962
|
+
function xt(e, n) {
|
|
963
|
+
return o(() => Je(c(e), c(n)));
|
|
807
964
|
}
|
|
808
|
-
function
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
return !!((n = (s = e.value) == null ? void 0 : s.customer) != null && n.id) && !!((r = (t = e.value) == null ? void 0 : t.customer) != null && r.active) && !((o = (u = e.value) == null ? void 0 : u.customer) != null && o.guest);
|
|
965
|
+
function Ut(e) {
|
|
966
|
+
return o(() => {
|
|
967
|
+
var n, t, s, a, r, i;
|
|
968
|
+
return !!((t = (n = c(e)) == null ? void 0 : n.customer) != null && t.id) && !!((a = (s = c(e)) == null ? void 0 : s.customer) != null && a.active) && !((i = (r = c(e)) == null ? void 0 : r.customer) != null && i.guest);
|
|
813
969
|
});
|
|
814
970
|
}
|
|
815
|
-
function
|
|
816
|
-
const
|
|
971
|
+
function bt(e) {
|
|
972
|
+
const n = Ae(e ? { body: e } : void 0), t = o(() => {
|
|
817
973
|
var d;
|
|
818
|
-
return (d =
|
|
819
|
-
}),
|
|
974
|
+
return (d = n.data) == null ? void 0 : d.value;
|
|
975
|
+
}), s = o(
|
|
820
976
|
() => {
|
|
821
977
|
var d;
|
|
822
|
-
return !!((d =
|
|
978
|
+
return !!((d = t.value) != null && d.id) && !!t.value.active && !t.value.guest;
|
|
823
979
|
}
|
|
824
|
-
),
|
|
980
|
+
), a = o(
|
|
825
981
|
() => {
|
|
826
982
|
var d;
|
|
827
|
-
return !!((d =
|
|
983
|
+
return !!((d = t.value) != null && d.id) && !t.value.guest;
|
|
828
984
|
}
|
|
829
|
-
),
|
|
985
|
+
), r = o(() => {
|
|
830
986
|
var d;
|
|
831
|
-
return !!((d =
|
|
832
|
-
}),
|
|
987
|
+
return !!((d = t.value) != null && d.guest);
|
|
988
|
+
}), i = o(
|
|
833
989
|
() => {
|
|
834
990
|
var d;
|
|
835
|
-
return ((d =
|
|
991
|
+
return ((d = t.value) == null ? void 0 : d.defaultBillingAddressId) || null;
|
|
836
992
|
}
|
|
837
|
-
),
|
|
993
|
+
), u = o(
|
|
838
994
|
() => {
|
|
839
995
|
var d;
|
|
840
|
-
return ((d =
|
|
996
|
+
return ((d = t.value) == null ? void 0 : d.defaultShippingAddressId) || null;
|
|
841
997
|
}
|
|
842
|
-
),
|
|
998
|
+
), m = o(
|
|
843
999
|
() => {
|
|
844
1000
|
var d;
|
|
845
|
-
return ((d =
|
|
1001
|
+
return ((d = t.value) == null ? void 0 : d.defaultBillingAddress) || null;
|
|
846
1002
|
}
|
|
847
|
-
),
|
|
1003
|
+
), q = o(
|
|
848
1004
|
() => {
|
|
849
1005
|
var d;
|
|
850
|
-
return ((d =
|
|
1006
|
+
return ((d = t.value) == null ? void 0 : d.defaultShippingAddress) || null;
|
|
851
1007
|
}
|
|
852
1008
|
);
|
|
853
1009
|
return {
|
|
854
1010
|
// Computed properties
|
|
855
|
-
user:
|
|
856
|
-
isLoggedIn:
|
|
857
|
-
isCustomerSession:
|
|
858
|
-
isGuestSession:
|
|
859
|
-
defaultBillingAddressId:
|
|
860
|
-
defaultShippingAddressId:
|
|
861
|
-
userDefaultBillingAddress:
|
|
862
|
-
userDefaultShippingAddress:
|
|
1011
|
+
user: t,
|
|
1012
|
+
isLoggedIn: s,
|
|
1013
|
+
isCustomerSession: a,
|
|
1014
|
+
isGuestSession: r,
|
|
1015
|
+
defaultBillingAddressId: i,
|
|
1016
|
+
defaultShippingAddressId: u,
|
|
1017
|
+
userDefaultBillingAddress: m,
|
|
1018
|
+
userDefaultShippingAddress: q,
|
|
863
1019
|
// Expose queries and mutations directly
|
|
864
|
-
customerQuery:
|
|
1020
|
+
customerQuery: n
|
|
865
1021
|
};
|
|
866
1022
|
}
|
|
867
1023
|
export {
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
L as
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
1024
|
+
et as absolutizeSeoUrl,
|
|
1025
|
+
R as addressKeys,
|
|
1026
|
+
I as cartKeys,
|
|
1027
|
+
k as categoryKeys,
|
|
1028
|
+
b as contextKeys,
|
|
1029
|
+
T as countryKeys,
|
|
1030
|
+
x as customerKeys,
|
|
1031
|
+
Je as getProductVariantForOptions,
|
|
1032
|
+
We as getSeoUrl,
|
|
1033
|
+
U as navigationKeys,
|
|
1034
|
+
L as orderKeys,
|
|
1035
|
+
B as paymentKeys,
|
|
1036
|
+
w as productKeys,
|
|
1037
|
+
Ie as readPaymentMethodOperation,
|
|
1038
|
+
ze as readShippingMethodOperation,
|
|
1039
|
+
j as relativizeSeoUrl,
|
|
1040
|
+
D as salutationKeys,
|
|
1041
|
+
E as seoUrlKeys,
|
|
1042
|
+
N as shippingKeys,
|
|
1043
|
+
_ as shopwareClientKey,
|
|
1044
|
+
g as unrefOptions,
|
|
1045
|
+
ot as useAddLineItemMutation,
|
|
1046
|
+
gt as useChangeEmailMutation,
|
|
1047
|
+
vt as useChangeProfileMutation,
|
|
1048
|
+
yt as useCheckout,
|
|
1049
|
+
nt as useCheckoutAddresses,
|
|
1050
|
+
at as useCreateCustomerAddressMutation,
|
|
1051
|
+
pt as useCreateOrderMutation,
|
|
1052
|
+
it as useDeleteCustomerAddressMutation,
|
|
1053
|
+
St as useHandlePaymentMutation,
|
|
1054
|
+
Ut as useIsLoggedIn,
|
|
1055
|
+
ne as useListAddressQuery,
|
|
1056
|
+
te as useListAddressQueryOptions,
|
|
1057
|
+
ht as useLoginCustomerMutation,
|
|
1058
|
+
ft as useLogoutCustomerMutation,
|
|
1059
|
+
tt as useOptimistic,
|
|
1060
|
+
st as useOrderDetails,
|
|
1061
|
+
rt as useOrderPayment,
|
|
1062
|
+
Pt as useOrderSetPaymentMutation,
|
|
1063
|
+
wt as usePagination,
|
|
1064
|
+
Rt as usePaymentMethods,
|
|
1065
|
+
Lt as useProductPrice,
|
|
1066
|
+
xt as useProductVariantForOptions,
|
|
1067
|
+
ct as useReadCartQuery,
|
|
1068
|
+
me as useReadCartQueryOptions,
|
|
1069
|
+
Qt as useReadCategoryListQuery,
|
|
1070
|
+
ke as useReadCategoryListQueryOptions,
|
|
1071
|
+
Mt as useReadCompactProductListingQuery,
|
|
1072
|
+
Be as useReadCompactProductListingQueryOptions,
|
|
1073
|
+
V as useReadContextQuery,
|
|
1074
|
+
re as useReadContextQueryOptions,
|
|
1075
|
+
mt as useReadCountryQuery,
|
|
1076
|
+
qe as useReadCountryQueryOptions,
|
|
1077
|
+
De as useReadCustomProductDetailOptions,
|
|
1078
|
+
Ot as useReadCustomProductDetailQuery,
|
|
1079
|
+
Ae as useReadCustomerQuery,
|
|
1080
|
+
Oe as useReadCustomerQueryOptions,
|
|
1081
|
+
Ct as useReadNavigationQuery,
|
|
1082
|
+
Fe as useReadNavigationQueryOptions,
|
|
1083
|
+
oe as useReadOrderQuery,
|
|
1084
|
+
ue as useReadOrderQueryOptions,
|
|
1085
|
+
Le as useReadPaymentMethodQuery,
|
|
1086
|
+
we as useReadPaymentMethodQueryOptions,
|
|
1087
|
+
At as useReadSalutationQuery,
|
|
1088
|
+
je as useReadSalutationQueryOptions,
|
|
1089
|
+
Kt as useReadSeoUrlQuery,
|
|
1090
|
+
$e as useReadSeoUrlQueryOptions,
|
|
1091
|
+
He as useReadShippingMethodQuery,
|
|
1092
|
+
Ge as useReadShippingMethodQueryOptions,
|
|
1093
|
+
qt as useRegisterCustomerMutation,
|
|
1094
|
+
lt as useRemoveLineItemMutation,
|
|
1095
|
+
It as useSeoUrl,
|
|
1096
|
+
Ft as useShippingMethods,
|
|
1097
|
+
v as useShopwareQueryClient,
|
|
1098
|
+
$ as useUpdateContextMutation,
|
|
1099
|
+
ut as useUpdateCustomerAddressMutation,
|
|
1100
|
+
dt as useUpdateLineItemMutation,
|
|
1101
|
+
bt as useUser
|
|
933
1102
|
};
|