@infrab4a/connect-angular 3.9.7 → 3.10.0-beta.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/angular-connect.module.d.ts +19 -19
- package/angular-elastic-search.module.d.ts +9 -9
- package/angular-firebase-auth.module.d.ts +10 -10
- package/angular-firestore.module.d.ts +15 -15
- package/angular-hasura-graphql.module.d.ts +16 -16
- package/bundles/infrab4a-connect-angular.umd.js +2123 -2214
- package/bundles/infrab4a-connect-angular.umd.js.map +1 -1
- package/consts/backend-url.const.d.ts +1 -1
- package/consts/default-shop.const.d.ts +1 -1
- package/consts/es-config.const.d.ts +1 -1
- package/consts/hasura-options.const.d.ts +1 -1
- package/consts/index.d.ts +4 -4
- package/esm2015/angular-connect.module.js +52 -52
- package/esm2015/angular-elastic-search.module.js +34 -34
- package/esm2015/angular-firebase-auth.module.js +113 -113
- package/esm2015/angular-firestore.module.js +394 -394
- package/esm2015/angular-hasura-graphql.module.js +156 -156
- package/esm2015/consts/backend-url.const.js +1 -1
- package/esm2015/consts/default-shop.const.js +2 -2
- package/esm2015/consts/es-config.const.js +2 -2
- package/esm2015/consts/hasura-options.const.js +2 -2
- package/esm2015/consts/index.js +5 -5
- package/esm2015/index.js +6 -6
- package/esm2015/infrab4a-connect-angular.js +4 -4
- package/esm2015/services/auth.service.js +42 -42
- package/esm2015/services/cart.service.js +261 -281
- package/esm2015/services/checkout-subscription.service.js +53 -53
- package/esm2015/services/checkout.service.js +70 -75
- package/esm2015/services/coupon.service.js +222 -246
- package/esm2015/services/home-shop.service.js +116 -116
- package/esm2015/services/index.js +9 -9
- package/esm2015/services/order.service.js +32 -32
- package/esm2015/services/shipping.service.js +98 -98
- package/esm2015/services/types/index.js +3 -3
- package/esm2015/services/types/required-checkout-data.type.js +2 -2
- package/esm2015/services/types/required-checkout-subscription-data.type.js +2 -2
- package/esm2015/services/types/shipping-methods.type.js +2 -2
- package/fesm2015/infrab4a-connect-angular.js +1521 -1584
- package/fesm2015/infrab4a-connect-angular.js.map +1 -1
- package/index.d.ts +5 -5
- package/infrab4a-connect-angular.d.ts +5 -5
- package/package.json +2 -2
- package/services/auth.service.d.ts +19 -19
- package/services/cart.service.d.ts +40 -42
- package/services/checkout-subscription.service.d.ts +18 -18
- package/services/checkout.service.d.ts +23 -23
- package/services/coupon.service.d.ts +27 -25
- package/services/home-shop.service.d.ts +25 -25
- package/services/index.d.ts +8 -8
- package/services/order.service.d.ts +13 -13
- package/services/shipping.service.d.ts +19 -19
- package/services/types/index.d.ts +2 -2
- package/services/types/required-checkout-data.type.d.ts +2 -2
- package/services/types/required-checkout-subscription-data.type.d.ts +2 -2
- package/services/types/shipping-methods.type.d.ts +12 -12
- package/esm2015/services/errors/group-invalid-coupon.error.js +0 -8
- package/esm2015/services/errors/index.js +0 -3
- package/esm2015/services/errors/invalid-coupon.error.js +0 -8
- package/services/errors/group-invalid-coupon.error.d.ts +0 -6
- package/services/errors/index.d.ts +0 -2
- package/services/errors/invalid-coupon.error.d.ts +0 -5
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@angular/fire/auth'), require('@infrab4a/connect'), require('js-cookie'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@infrab4a/connect-angular', ['exports', '@angular/core', 'rxjs', 'rxjs/operators', '@angular/fire/auth', '@infrab4a/connect', 'js-cookie', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.infrab4a = global.infrab4a || {}, global.infrab4a["connect-angular"] = {}), global.ng.core, global.rxjs, global.rxjs.operators, global.ng.fire.auth, global["@infrab4a/connect"], global["js-cookie"], global
|
|
5
|
-
})(this, (function (exports, i0, rxjs, operators, i1, i3, cookie,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@angular/fire/auth'), require('@infrab4a/connect'), require('js-cookie'), require('@angular/fire/firestore'), require('@angular/common/http'), require('@angular/fire')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@infrab4a/connect-angular', ['exports', '@angular/core', 'rxjs', 'rxjs/operators', '@angular/fire/auth', '@infrab4a/connect', 'js-cookie', '@angular/fire/firestore', '@angular/common/http', '@angular/fire'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.infrab4a = global.infrab4a || {}, global.infrab4a["connect-angular"] = {}), global.ng.core, global.rxjs, global.rxjs.operators, global.ng.fire.auth, global["@infrab4a/connect"], global["js-cookie"], global.ng.fire.firestore, global.ng.common.http, global.ng.fire));
|
|
5
|
+
})(this, (function (exports, i0, rxjs, operators, i1, i3, cookie, i1$1, i1$2, fire) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -31,363 +31,363 @@
|
|
|
31
31
|
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
|
32
32
|
var i1__namespace$2 = /*#__PURE__*/_interopNamespace(i1$2);
|
|
33
33
|
|
|
34
|
-
/*! *****************************************************************************
|
|
35
|
-
Copyright (c) Microsoft Corporation.
|
|
36
|
-
|
|
37
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
38
|
-
purpose with or without fee is hereby granted.
|
|
39
|
-
|
|
40
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
41
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
42
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
43
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
44
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
45
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
46
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
47
|
-
***************************************************************************** */
|
|
48
|
-
/* global Reflect, Promise */
|
|
49
|
-
var extendStatics = function (d, b) {
|
|
50
|
-
extendStatics = Object.setPrototypeOf ||
|
|
51
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
52
|
-
function (d, b) { for (var p in b)
|
|
53
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
54
|
-
d[p] = b[p]; };
|
|
55
|
-
return extendStatics(d, b);
|
|
56
|
-
};
|
|
57
|
-
function __extends(d, b) {
|
|
58
|
-
if (typeof b !== "function" && b !== null)
|
|
59
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
60
|
-
extendStatics(d, b);
|
|
61
|
-
function __() { this.constructor = d; }
|
|
62
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
63
|
-
}
|
|
64
|
-
var __assign = function () {
|
|
65
|
-
__assign = Object.assign || function __assign(t) {
|
|
66
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
67
|
-
s = arguments[i];
|
|
68
|
-
for (var p in s)
|
|
69
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
70
|
-
t[p] = s[p];
|
|
71
|
-
}
|
|
72
|
-
return t;
|
|
73
|
-
};
|
|
74
|
-
return __assign.apply(this, arguments);
|
|
75
|
-
};
|
|
76
|
-
function __rest(s, e) {
|
|
77
|
-
var t = {};
|
|
78
|
-
for (var p in s)
|
|
79
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
80
|
-
t[p] = s[p];
|
|
81
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
82
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
83
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
84
|
-
t[p[i]] = s[p[i]];
|
|
85
|
-
}
|
|
86
|
-
return t;
|
|
87
|
-
}
|
|
88
|
-
function __decorate(decorators, target, key, desc) {
|
|
89
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
90
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
91
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
92
|
-
else
|
|
93
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
94
|
-
if (d = decorators[i])
|
|
95
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
96
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
97
|
-
}
|
|
98
|
-
function __param(paramIndex, decorator) {
|
|
99
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
100
|
-
}
|
|
101
|
-
function __metadata(metadataKey, metadataValue) {
|
|
102
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
103
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
104
|
-
}
|
|
105
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
106
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
107
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
108
|
-
function fulfilled(value) { try {
|
|
109
|
-
step(generator.next(value));
|
|
110
|
-
}
|
|
111
|
-
catch (e) {
|
|
112
|
-
reject(e);
|
|
113
|
-
} }
|
|
114
|
-
function rejected(value) { try {
|
|
115
|
-
step(generator["throw"](value));
|
|
116
|
-
}
|
|
117
|
-
catch (e) {
|
|
118
|
-
reject(e);
|
|
119
|
-
} }
|
|
120
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
121
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
function __generator(thisArg, body) {
|
|
125
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
126
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
127
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
128
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
129
|
-
function step(op) {
|
|
130
|
-
if (f)
|
|
131
|
-
throw new TypeError("Generator is already executing.");
|
|
132
|
-
while (_)
|
|
133
|
-
try {
|
|
134
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
135
|
-
return t;
|
|
136
|
-
if (y = 0, t)
|
|
137
|
-
op = [op[0] & 2, t.value];
|
|
138
|
-
switch (op[0]) {
|
|
139
|
-
case 0:
|
|
140
|
-
case 1:
|
|
141
|
-
t = op;
|
|
142
|
-
break;
|
|
143
|
-
case 4:
|
|
144
|
-
_.label++;
|
|
145
|
-
return { value: op[1], done: false };
|
|
146
|
-
case 5:
|
|
147
|
-
_.label++;
|
|
148
|
-
y = op[1];
|
|
149
|
-
op = [0];
|
|
150
|
-
continue;
|
|
151
|
-
case 7:
|
|
152
|
-
op = _.ops.pop();
|
|
153
|
-
_.trys.pop();
|
|
154
|
-
continue;
|
|
155
|
-
default:
|
|
156
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
157
|
-
_ = 0;
|
|
158
|
-
continue;
|
|
159
|
-
}
|
|
160
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
161
|
-
_.label = op[1];
|
|
162
|
-
break;
|
|
163
|
-
}
|
|
164
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
165
|
-
_.label = t[1];
|
|
166
|
-
t = op;
|
|
167
|
-
break;
|
|
168
|
-
}
|
|
169
|
-
if (t && _.label < t[2]) {
|
|
170
|
-
_.label = t[2];
|
|
171
|
-
_.ops.push(op);
|
|
172
|
-
break;
|
|
173
|
-
}
|
|
174
|
-
if (t[2])
|
|
175
|
-
_.ops.pop();
|
|
176
|
-
_.trys.pop();
|
|
177
|
-
continue;
|
|
178
|
-
}
|
|
179
|
-
op = body.call(thisArg, _);
|
|
180
|
-
}
|
|
181
|
-
catch (e) {
|
|
182
|
-
op = [6, e];
|
|
183
|
-
y = 0;
|
|
184
|
-
}
|
|
185
|
-
finally {
|
|
186
|
-
f = t = 0;
|
|
187
|
-
}
|
|
188
|
-
if (op[0] & 5)
|
|
189
|
-
throw op[1];
|
|
190
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
194
|
-
if (k2 === undefined)
|
|
195
|
-
k2 = k;
|
|
196
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
197
|
-
}) : (function (o, m, k, k2) {
|
|
198
|
-
if (k2 === undefined)
|
|
199
|
-
k2 = k;
|
|
200
|
-
o[k2] = m[k];
|
|
201
|
-
});
|
|
202
|
-
function __exportStar(m, o) {
|
|
203
|
-
for (var p in m)
|
|
204
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
205
|
-
__createBinding(o, m, p);
|
|
206
|
-
}
|
|
207
|
-
function __values(o) {
|
|
208
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
209
|
-
if (m)
|
|
210
|
-
return m.call(o);
|
|
211
|
-
if (o && typeof o.length === "number")
|
|
212
|
-
return {
|
|
213
|
-
next: function () {
|
|
214
|
-
if (o && i >= o.length)
|
|
215
|
-
o = void 0;
|
|
216
|
-
return { value: o && o[i++], done: !o };
|
|
217
|
-
}
|
|
218
|
-
};
|
|
219
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
220
|
-
}
|
|
221
|
-
function __read(o, n) {
|
|
222
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
223
|
-
if (!m)
|
|
224
|
-
return o;
|
|
225
|
-
var i = m.call(o), r, ar = [], e;
|
|
226
|
-
try {
|
|
227
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
228
|
-
ar.push(r.value);
|
|
229
|
-
}
|
|
230
|
-
catch (error) {
|
|
231
|
-
e = { error: error };
|
|
232
|
-
}
|
|
233
|
-
finally {
|
|
234
|
-
try {
|
|
235
|
-
if (r && !r.done && (m = i["return"]))
|
|
236
|
-
m.call(i);
|
|
237
|
-
}
|
|
238
|
-
finally {
|
|
239
|
-
if (e)
|
|
240
|
-
throw e.error;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
return ar;
|
|
244
|
-
}
|
|
245
|
-
/** @deprecated */
|
|
246
|
-
function __spread() {
|
|
247
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
248
|
-
ar = ar.concat(__read(arguments[i]));
|
|
249
|
-
return ar;
|
|
250
|
-
}
|
|
251
|
-
/** @deprecated */
|
|
252
|
-
function __spreadArrays() {
|
|
253
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
254
|
-
s += arguments[i].length;
|
|
255
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
256
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
257
|
-
r[k] = a[j];
|
|
258
|
-
return r;
|
|
259
|
-
}
|
|
260
|
-
function __spreadArray(to, from, pack) {
|
|
261
|
-
if (pack || arguments.length === 2)
|
|
262
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
263
|
-
if (ar || !(i in from)) {
|
|
264
|
-
if (!ar)
|
|
265
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
266
|
-
ar[i] = from[i];
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
270
|
-
}
|
|
271
|
-
function __await(v) {
|
|
272
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
273
|
-
}
|
|
274
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
275
|
-
if (!Symbol.asyncIterator)
|
|
276
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
277
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
278
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
279
|
-
function verb(n) { if (g[n])
|
|
280
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
281
|
-
function resume(n, v) { try {
|
|
282
|
-
step(g[n](v));
|
|
283
|
-
}
|
|
284
|
-
catch (e) {
|
|
285
|
-
settle(q[0][3], e);
|
|
286
|
-
} }
|
|
287
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
288
|
-
function fulfill(value) { resume("next", value); }
|
|
289
|
-
function reject(value) { resume("throw", value); }
|
|
290
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
291
|
-
resume(q[0][0], q[0][1]); }
|
|
292
|
-
}
|
|
293
|
-
function __asyncDelegator(o) {
|
|
294
|
-
var i, p;
|
|
295
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
296
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
297
|
-
}
|
|
298
|
-
function __asyncValues(o) {
|
|
299
|
-
if (!Symbol.asyncIterator)
|
|
300
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
301
|
-
var m = o[Symbol.asyncIterator], i;
|
|
302
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
303
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
304
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
305
|
-
}
|
|
306
|
-
function __makeTemplateObject(cooked, raw) {
|
|
307
|
-
if (Object.defineProperty) {
|
|
308
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
309
|
-
}
|
|
310
|
-
else {
|
|
311
|
-
cooked.raw = raw;
|
|
312
|
-
}
|
|
313
|
-
return cooked;
|
|
314
|
-
}
|
|
315
|
-
;
|
|
316
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
317
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
318
|
-
}) : function (o, v) {
|
|
319
|
-
o["default"] = v;
|
|
320
|
-
};
|
|
321
|
-
function __importStar(mod) {
|
|
322
|
-
if (mod && mod.__esModule)
|
|
323
|
-
return mod;
|
|
324
|
-
var result = {};
|
|
325
|
-
if (mod != null)
|
|
326
|
-
for (var k in mod)
|
|
327
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
328
|
-
__createBinding(result, mod, k);
|
|
329
|
-
__setModuleDefault(result, mod);
|
|
330
|
-
return result;
|
|
331
|
-
}
|
|
332
|
-
function __importDefault(mod) {
|
|
333
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
334
|
-
}
|
|
335
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
336
|
-
if (kind === "a" && !f)
|
|
337
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
338
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
339
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
340
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
341
|
-
}
|
|
342
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
343
|
-
if (kind === "m")
|
|
344
|
-
throw new TypeError("Private method is not writable");
|
|
345
|
-
if (kind === "a" && !f)
|
|
346
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
347
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
348
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
349
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
34
|
+
/*! *****************************************************************************
|
|
35
|
+
Copyright (c) Microsoft Corporation.
|
|
36
|
+
|
|
37
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
38
|
+
purpose with or without fee is hereby granted.
|
|
39
|
+
|
|
40
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
41
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
42
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
43
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
44
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
45
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
46
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
47
|
+
***************************************************************************** */
|
|
48
|
+
/* global Reflect, Promise */
|
|
49
|
+
var extendStatics = function (d, b) {
|
|
50
|
+
extendStatics = Object.setPrototypeOf ||
|
|
51
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
52
|
+
function (d, b) { for (var p in b)
|
|
53
|
+
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
54
|
+
d[p] = b[p]; };
|
|
55
|
+
return extendStatics(d, b);
|
|
56
|
+
};
|
|
57
|
+
function __extends(d, b) {
|
|
58
|
+
if (typeof b !== "function" && b !== null)
|
|
59
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
60
|
+
extendStatics(d, b);
|
|
61
|
+
function __() { this.constructor = d; }
|
|
62
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
63
|
+
}
|
|
64
|
+
var __assign = function () {
|
|
65
|
+
__assign = Object.assign || function __assign(t) {
|
|
66
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
67
|
+
s = arguments[i];
|
|
68
|
+
for (var p in s)
|
|
69
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
70
|
+
t[p] = s[p];
|
|
71
|
+
}
|
|
72
|
+
return t;
|
|
73
|
+
};
|
|
74
|
+
return __assign.apply(this, arguments);
|
|
75
|
+
};
|
|
76
|
+
function __rest(s, e) {
|
|
77
|
+
var t = {};
|
|
78
|
+
for (var p in s)
|
|
79
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
80
|
+
t[p] = s[p];
|
|
81
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
82
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
83
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
84
|
+
t[p[i]] = s[p[i]];
|
|
85
|
+
}
|
|
86
|
+
return t;
|
|
87
|
+
}
|
|
88
|
+
function __decorate(decorators, target, key, desc) {
|
|
89
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
90
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
91
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
92
|
+
else
|
|
93
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
94
|
+
if (d = decorators[i])
|
|
95
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
96
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
97
|
+
}
|
|
98
|
+
function __param(paramIndex, decorator) {
|
|
99
|
+
return function (target, key) { decorator(target, key, paramIndex); };
|
|
100
|
+
}
|
|
101
|
+
function __metadata(metadataKey, metadataValue) {
|
|
102
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
103
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
104
|
+
}
|
|
105
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
106
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
107
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
108
|
+
function fulfilled(value) { try {
|
|
109
|
+
step(generator.next(value));
|
|
110
|
+
}
|
|
111
|
+
catch (e) {
|
|
112
|
+
reject(e);
|
|
113
|
+
} }
|
|
114
|
+
function rejected(value) { try {
|
|
115
|
+
step(generator["throw"](value));
|
|
116
|
+
}
|
|
117
|
+
catch (e) {
|
|
118
|
+
reject(e);
|
|
119
|
+
} }
|
|
120
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
121
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
function __generator(thisArg, body) {
|
|
125
|
+
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
126
|
+
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
127
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
128
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
129
|
+
function step(op) {
|
|
130
|
+
if (f)
|
|
131
|
+
throw new TypeError("Generator is already executing.");
|
|
132
|
+
while (_)
|
|
133
|
+
try {
|
|
134
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
135
|
+
return t;
|
|
136
|
+
if (y = 0, t)
|
|
137
|
+
op = [op[0] & 2, t.value];
|
|
138
|
+
switch (op[0]) {
|
|
139
|
+
case 0:
|
|
140
|
+
case 1:
|
|
141
|
+
t = op;
|
|
142
|
+
break;
|
|
143
|
+
case 4:
|
|
144
|
+
_.label++;
|
|
145
|
+
return { value: op[1], done: false };
|
|
146
|
+
case 5:
|
|
147
|
+
_.label++;
|
|
148
|
+
y = op[1];
|
|
149
|
+
op = [0];
|
|
150
|
+
continue;
|
|
151
|
+
case 7:
|
|
152
|
+
op = _.ops.pop();
|
|
153
|
+
_.trys.pop();
|
|
154
|
+
continue;
|
|
155
|
+
default:
|
|
156
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
157
|
+
_ = 0;
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
161
|
+
_.label = op[1];
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
165
|
+
_.label = t[1];
|
|
166
|
+
t = op;
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
if (t && _.label < t[2]) {
|
|
170
|
+
_.label = t[2];
|
|
171
|
+
_.ops.push(op);
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
if (t[2])
|
|
175
|
+
_.ops.pop();
|
|
176
|
+
_.trys.pop();
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
op = body.call(thisArg, _);
|
|
180
|
+
}
|
|
181
|
+
catch (e) {
|
|
182
|
+
op = [6, e];
|
|
183
|
+
y = 0;
|
|
184
|
+
}
|
|
185
|
+
finally {
|
|
186
|
+
f = t = 0;
|
|
187
|
+
}
|
|
188
|
+
if (op[0] & 5)
|
|
189
|
+
throw op[1];
|
|
190
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
194
|
+
if (k2 === undefined)
|
|
195
|
+
k2 = k;
|
|
196
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
197
|
+
}) : (function (o, m, k, k2) {
|
|
198
|
+
if (k2 === undefined)
|
|
199
|
+
k2 = k;
|
|
200
|
+
o[k2] = m[k];
|
|
201
|
+
});
|
|
202
|
+
function __exportStar(m, o) {
|
|
203
|
+
for (var p in m)
|
|
204
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
205
|
+
__createBinding(o, m, p);
|
|
206
|
+
}
|
|
207
|
+
function __values(o) {
|
|
208
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
209
|
+
if (m)
|
|
210
|
+
return m.call(o);
|
|
211
|
+
if (o && typeof o.length === "number")
|
|
212
|
+
return {
|
|
213
|
+
next: function () {
|
|
214
|
+
if (o && i >= o.length)
|
|
215
|
+
o = void 0;
|
|
216
|
+
return { value: o && o[i++], done: !o };
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
220
|
+
}
|
|
221
|
+
function __read(o, n) {
|
|
222
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
223
|
+
if (!m)
|
|
224
|
+
return o;
|
|
225
|
+
var i = m.call(o), r, ar = [], e;
|
|
226
|
+
try {
|
|
227
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
228
|
+
ar.push(r.value);
|
|
229
|
+
}
|
|
230
|
+
catch (error) {
|
|
231
|
+
e = { error: error };
|
|
232
|
+
}
|
|
233
|
+
finally {
|
|
234
|
+
try {
|
|
235
|
+
if (r && !r.done && (m = i["return"]))
|
|
236
|
+
m.call(i);
|
|
237
|
+
}
|
|
238
|
+
finally {
|
|
239
|
+
if (e)
|
|
240
|
+
throw e.error;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
return ar;
|
|
244
|
+
}
|
|
245
|
+
/** @deprecated */
|
|
246
|
+
function __spread() {
|
|
247
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
248
|
+
ar = ar.concat(__read(arguments[i]));
|
|
249
|
+
return ar;
|
|
250
|
+
}
|
|
251
|
+
/** @deprecated */
|
|
252
|
+
function __spreadArrays() {
|
|
253
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
254
|
+
s += arguments[i].length;
|
|
255
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
256
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
257
|
+
r[k] = a[j];
|
|
258
|
+
return r;
|
|
259
|
+
}
|
|
260
|
+
function __spreadArray(to, from, pack) {
|
|
261
|
+
if (pack || arguments.length === 2)
|
|
262
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
263
|
+
if (ar || !(i in from)) {
|
|
264
|
+
if (!ar)
|
|
265
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
266
|
+
ar[i] = from[i];
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
270
|
+
}
|
|
271
|
+
function __await(v) {
|
|
272
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
273
|
+
}
|
|
274
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
275
|
+
if (!Symbol.asyncIterator)
|
|
276
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
277
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
278
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
279
|
+
function verb(n) { if (g[n])
|
|
280
|
+
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
281
|
+
function resume(n, v) { try {
|
|
282
|
+
step(g[n](v));
|
|
283
|
+
}
|
|
284
|
+
catch (e) {
|
|
285
|
+
settle(q[0][3], e);
|
|
286
|
+
} }
|
|
287
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
288
|
+
function fulfill(value) { resume("next", value); }
|
|
289
|
+
function reject(value) { resume("throw", value); }
|
|
290
|
+
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
291
|
+
resume(q[0][0], q[0][1]); }
|
|
292
|
+
}
|
|
293
|
+
function __asyncDelegator(o) {
|
|
294
|
+
var i, p;
|
|
295
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
296
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
297
|
+
}
|
|
298
|
+
function __asyncValues(o) {
|
|
299
|
+
if (!Symbol.asyncIterator)
|
|
300
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
301
|
+
var m = o[Symbol.asyncIterator], i;
|
|
302
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
303
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
304
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
305
|
+
}
|
|
306
|
+
function __makeTemplateObject(cooked, raw) {
|
|
307
|
+
if (Object.defineProperty) {
|
|
308
|
+
Object.defineProperty(cooked, "raw", { value: raw });
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
cooked.raw = raw;
|
|
312
|
+
}
|
|
313
|
+
return cooked;
|
|
314
|
+
}
|
|
315
|
+
;
|
|
316
|
+
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
317
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
318
|
+
}) : function (o, v) {
|
|
319
|
+
o["default"] = v;
|
|
320
|
+
};
|
|
321
|
+
function __importStar(mod) {
|
|
322
|
+
if (mod && mod.__esModule)
|
|
323
|
+
return mod;
|
|
324
|
+
var result = {};
|
|
325
|
+
if (mod != null)
|
|
326
|
+
for (var k in mod)
|
|
327
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
328
|
+
__createBinding(result, mod, k);
|
|
329
|
+
__setModuleDefault(result, mod);
|
|
330
|
+
return result;
|
|
331
|
+
}
|
|
332
|
+
function __importDefault(mod) {
|
|
333
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
334
|
+
}
|
|
335
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
336
|
+
if (kind === "a" && !f)
|
|
337
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
338
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
339
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
340
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
341
|
+
}
|
|
342
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
343
|
+
if (kind === "m")
|
|
344
|
+
throw new TypeError("Private method is not writable");
|
|
345
|
+
if (kind === "a" && !f)
|
|
346
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
347
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
348
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
349
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
350
350
|
}
|
|
351
351
|
|
|
352
|
-
var AuthService = /** @class */ (function () {
|
|
353
|
-
function AuthService(angularFireAuth, userRepository) {
|
|
354
|
-
this.angularFireAuth = angularFireAuth;
|
|
355
|
-
this.userRepository = userRepository;
|
|
356
|
-
}
|
|
357
|
-
AuthService.prototype.getAuthstate = function () {
|
|
358
|
-
var observables = [
|
|
359
|
-
this.angularFireAuth.authState.pipe(operators.catchError(function () { return rxjs.of(null); })),
|
|
360
|
-
this.getUser().pipe(operators.catchError(function () { return rxjs.of(null); })),
|
|
361
|
-
];
|
|
362
|
-
return rxjs.combineLatest(observables).pipe(operators.map(function (_a) {
|
|
363
|
-
var _b = __read(_a, 2), fireUser = _b[0], user = _b[1];
|
|
364
|
-
return {
|
|
365
|
-
user: user,
|
|
366
|
-
isAnonymous: fireUser === null || fireUser === void 0 ? void 0 : fireUser.isAnonymous,
|
|
367
|
-
};
|
|
368
|
-
}));
|
|
369
|
-
};
|
|
370
|
-
AuthService.prototype.getUser = function () {
|
|
371
|
-
var _this = this;
|
|
372
|
-
return this.getFireUser().pipe(operators.map(function (user) { return user === null || user === void 0 ? void 0 : user.uid; }), operators.mergeMap(function (id) { return (id ? rxjs.from(_this.userRepository.get({ id: id })).pipe(operators.catchError(function () { return rxjs.of(null); })) : rxjs.of(null)); }));
|
|
373
|
-
};
|
|
374
|
-
AuthService.prototype.getTokenId = function () {
|
|
375
|
-
return this.angularFireAuth.idToken;
|
|
376
|
-
};
|
|
377
|
-
AuthService.prototype.getFireUser = function () {
|
|
378
|
-
return this.angularFireAuth.user.pipe(operators.catchError(function () { return rxjs.of(null); }));
|
|
379
|
-
};
|
|
380
|
-
return AuthService;
|
|
381
|
-
}());
|
|
382
|
-
AuthService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AuthService, deps: [{ token: i1__namespace.AngularFireAuth }, { token: 'UserRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
383
|
-
AuthService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AuthService });
|
|
384
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AuthService, decorators: [{
|
|
385
|
-
type: i0.Injectable
|
|
386
|
-
}], ctorParameters: function () {
|
|
387
|
-
return [{ type: i1__namespace.AngularFireAuth }, { type: undefined, decorators: [{
|
|
388
|
-
type: i0.Inject,
|
|
389
|
-
args: ['UserRepository']
|
|
390
|
-
}] }];
|
|
352
|
+
var AuthService = /** @class */ (function () {
|
|
353
|
+
function AuthService(angularFireAuth, userRepository) {
|
|
354
|
+
this.angularFireAuth = angularFireAuth;
|
|
355
|
+
this.userRepository = userRepository;
|
|
356
|
+
}
|
|
357
|
+
AuthService.prototype.getAuthstate = function () {
|
|
358
|
+
var observables = [
|
|
359
|
+
this.angularFireAuth.authState.pipe(operators.catchError(function () { return rxjs.of(null); })),
|
|
360
|
+
this.getUser().pipe(operators.catchError(function () { return rxjs.of(null); })),
|
|
361
|
+
];
|
|
362
|
+
return rxjs.combineLatest(observables).pipe(operators.map(function (_a) {
|
|
363
|
+
var _b = __read(_a, 2), fireUser = _b[0], user = _b[1];
|
|
364
|
+
return {
|
|
365
|
+
user: user,
|
|
366
|
+
isAnonymous: fireUser === null || fireUser === void 0 ? void 0 : fireUser.isAnonymous,
|
|
367
|
+
};
|
|
368
|
+
}));
|
|
369
|
+
};
|
|
370
|
+
AuthService.prototype.getUser = function () {
|
|
371
|
+
var _this = this;
|
|
372
|
+
return this.getFireUser().pipe(operators.map(function (user) { return user === null || user === void 0 ? void 0 : user.uid; }), operators.mergeMap(function (id) { return (id ? rxjs.from(_this.userRepository.get({ id: id })).pipe(operators.catchError(function () { return rxjs.of(null); })) : rxjs.of(null)); }));
|
|
373
|
+
};
|
|
374
|
+
AuthService.prototype.getTokenId = function () {
|
|
375
|
+
return this.angularFireAuth.idToken;
|
|
376
|
+
};
|
|
377
|
+
AuthService.prototype.getFireUser = function () {
|
|
378
|
+
return this.angularFireAuth.user.pipe(operators.catchError(function () { return rxjs.of(null); }));
|
|
379
|
+
};
|
|
380
|
+
return AuthService;
|
|
381
|
+
}());
|
|
382
|
+
AuthService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AuthService, deps: [{ token: i1__namespace.AngularFireAuth }, { token: 'UserRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
383
|
+
AuthService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AuthService });
|
|
384
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AuthService, decorators: [{
|
|
385
|
+
type: i0.Injectable
|
|
386
|
+
}], ctorParameters: function () {
|
|
387
|
+
return [{ type: i1__namespace.AngularFireAuth }, { type: undefined, decorators: [{
|
|
388
|
+
type: i0.Inject,
|
|
389
|
+
args: ['UserRepository']
|
|
390
|
+
}] }];
|
|
391
391
|
} });
|
|
392
392
|
|
|
393
393
|
var BACKEND_URL = 'BACKEND_URL';
|
|
@@ -398,1885 +398,1794 @@
|
|
|
398
398
|
|
|
399
399
|
var HASURA_OPTIONS = 'HASURA_OPTIONS';
|
|
400
400
|
|
|
401
|
-
var
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
if (
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
return [2 /*return*/,
|
|
524
|
-
}
|
|
525
|
-
});
|
|
526
|
-
});
|
|
527
|
-
};
|
|
528
|
-
CouponService.prototype.
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
return [
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
return
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
if (
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
}
|
|
636
|
-
return [2 /*return*/,
|
|
637
|
-
}
|
|
638
|
-
});
|
|
639
|
-
});
|
|
640
|
-
};
|
|
641
|
-
CouponService.prototype.
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CouponService, decorators: [{
|
|
693
|
-
type: i0.Injectable,
|
|
694
|
-
args: [{
|
|
695
|
-
providedIn: 'root',
|
|
696
|
-
}]
|
|
697
|
-
}], ctorParameters: function () {
|
|
698
|
-
return [{ type: undefined, decorators: [{
|
|
699
|
-
type: i0.Inject,
|
|
700
|
-
args: ['CouponRepository']
|
|
701
|
-
}] }, { type: i3__namespace.Shops, decorators: [{
|
|
702
|
-
type: i0.Inject,
|
|
703
|
-
args: [DEFAULT_SHOP]
|
|
704
|
-
}] }, { type: undefined, decorators: [{
|
|
705
|
-
type: i0.Inject,
|
|
706
|
-
args: ['OrderRepository']
|
|
707
|
-
}] }, { type: undefined, decorators: [{
|
|
708
|
-
type: i0.Inject,
|
|
709
|
-
args: ['CategoryRepository']
|
|
710
|
-
}] }];
|
|
401
|
+
var CouponService = /** @class */ (function () {
|
|
402
|
+
function CouponService(couponRepository, defaultShop, orderRepository, categoryRepository) {
|
|
403
|
+
this.couponRepository = couponRepository;
|
|
404
|
+
this.defaultShop = defaultShop;
|
|
405
|
+
this.orderRepository = orderRepository;
|
|
406
|
+
this.categoryRepository = categoryRepository;
|
|
407
|
+
this.emailIsFromCollaborator = function (userEmail) { return !!(userEmail === null || userEmail === void 0 ? void 0 : userEmail.match(/@b4a.com.br/g)); };
|
|
408
|
+
}
|
|
409
|
+
CouponService.prototype.checkCoupon = function (nickname, checkoutType, checkout, plan) {
|
|
410
|
+
var _this = this;
|
|
411
|
+
return rxjs.from(this.couponRepository
|
|
412
|
+
.find({
|
|
413
|
+
filters: {
|
|
414
|
+
nickname: { operator: i3.Where.EQUALS, value: nickname },
|
|
415
|
+
active: { operator: i3.Where.EQUALS, value: true },
|
|
416
|
+
},
|
|
417
|
+
})
|
|
418
|
+
.then(function (result) { return result.data[0]; })).pipe(operators.concatMap(function (coupon) { return _this.couponValidation(coupon, checkoutType); }), operators.concatMap(function (couponValid) { return _this.couponRulesValidation(couponValid, checkoutType, checkout, plan); }), operators.map(function (couponValidated) { return couponValidated; }));
|
|
419
|
+
};
|
|
420
|
+
CouponService.prototype.couponValidation = function (coupon, checkoutType) {
|
|
421
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
422
|
+
var isInShop, isCheckoutType;
|
|
423
|
+
return __generator(this, function (_c) {
|
|
424
|
+
if (!coupon)
|
|
425
|
+
throw 'Cupom inválido.';
|
|
426
|
+
if ((coupon === null || coupon === void 0 ? void 0 : coupon.beginAt) && (coupon === null || coupon === void 0 ? void 0 : coupon.beginAt) > new Date())
|
|
427
|
+
throw 'Cupom inválido.';
|
|
428
|
+
if ((coupon === null || coupon === void 0 ? void 0 : coupon.expiresIn) && (coupon === null || coupon === void 0 ? void 0 : coupon.expiresIn) < new Date())
|
|
429
|
+
throw 'Cupom expirado.';
|
|
430
|
+
isInShop = coupon.shopAvailability === i3.Shops.ALL || coupon.shopAvailability === this.defaultShop;
|
|
431
|
+
if (!isInShop)
|
|
432
|
+
throw 'Cupom inválido para loja.';
|
|
433
|
+
isCheckoutType = coupon.checkoutType === i3.CheckoutTypes.ALL || coupon.checkoutType === checkoutType;
|
|
434
|
+
if (!isCheckoutType)
|
|
435
|
+
throw 'Cupom inválido. Erro de checkout.';
|
|
436
|
+
return [2 /*return*/, coupon];
|
|
437
|
+
});
|
|
438
|
+
});
|
|
439
|
+
};
|
|
440
|
+
CouponService.prototype.couponRulesValidation = function (coupon, checkoutType, checkout, plan) {
|
|
441
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
442
|
+
var orders, ordersWithUser, validUser, hasProductCategories, hasMinSubTotal;
|
|
443
|
+
return __generator(this, function (_c) {
|
|
444
|
+
switch (_c.label) {
|
|
445
|
+
case 0:
|
|
446
|
+
if (checkoutType == i3.CheckoutTypes.SUBSCRIPTION) {
|
|
447
|
+
if (coupon.plan && coupon.plan.toUpperCase() !== plan.toUpperCase())
|
|
448
|
+
throw 'Cupom inválido para sua assinatura.';
|
|
449
|
+
return [2 /*return*/, coupon];
|
|
450
|
+
}
|
|
451
|
+
return [4 /*yield*/, this.getOrdersWithCoupon(coupon)];
|
|
452
|
+
case 1:
|
|
453
|
+
orders = _c.sent();
|
|
454
|
+
ordersWithUser = this.countOrdersWithUser(orders, checkout.user.email);
|
|
455
|
+
if (coupon.useLimitPerUser && ordersWithUser > 0)
|
|
456
|
+
throw 'Limite de uso por usuário atingido.';
|
|
457
|
+
if (!coupon.unlimited && coupon.useLimit && orders.length >= coupon.useLimit)
|
|
458
|
+
throw 'Limite de uso atingido.';
|
|
459
|
+
validUser = this.coupomUserValidation(coupon, checkout === null || checkout === void 0 ? void 0 : checkout.user);
|
|
460
|
+
if (!validUser)
|
|
461
|
+
throw 'Usuário não elegível.';
|
|
462
|
+
return [4 /*yield*/, this.hasProductCategories(coupon, checkout)];
|
|
463
|
+
case 2:
|
|
464
|
+
hasProductCategories = _c.sent();
|
|
465
|
+
if (!hasProductCategories)
|
|
466
|
+
throw 'Seu carrinho não possui produtos elegíveis para desconto.';
|
|
467
|
+
return [4 /*yield*/, this.hasMinSubTotal(coupon, checkout)];
|
|
468
|
+
case 3:
|
|
469
|
+
hasMinSubTotal = _c.sent();
|
|
470
|
+
if (!hasMinSubTotal)
|
|
471
|
+
throw "Valor m\u00EDnimo de " + Intl.NumberFormat('pt-BR', { style: 'currency', currency: 'BRL' }).format(coupon.minSubTotalValue) + " n\u00E3o atingido";
|
|
472
|
+
return [2 /*return*/, coupon];
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
});
|
|
476
|
+
};
|
|
477
|
+
CouponService.prototype.calcDiscountSubscription = function (coupon, checkout) {
|
|
478
|
+
var discount = 0;
|
|
479
|
+
if (coupon.discount.subscription.type == i3.CouponTypes.ABSOLUTE)
|
|
480
|
+
discount = coupon.discount.subscription.value;
|
|
481
|
+
else
|
|
482
|
+
discount = checkout.subscriptionPlan.recurrencePrice * (coupon.discount.subscription.value / 100);
|
|
483
|
+
return rxjs.of(discount);
|
|
484
|
+
};
|
|
485
|
+
CouponService.prototype.calcDiscountShopping = function (coupon, checkout) {
|
|
486
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
487
|
+
var discount;
|
|
488
|
+
return __generator(this, function (_c) {
|
|
489
|
+
switch (_c.label) {
|
|
490
|
+
case 0:
|
|
491
|
+
discount = 0;
|
|
492
|
+
if (!(checkout.user.isSubscriber && coupon.discount.subscriber.value)) return [3 /*break*/, 2];
|
|
493
|
+
return [4 /*yield*/, this.calcDiscountByType(coupon.discount.subscriber.type, coupon.discount.subscriber.value, coupon.productsCategories, checkout)];
|
|
494
|
+
case 1:
|
|
495
|
+
discount = _c.sent();
|
|
496
|
+
return [3 /*break*/, 4];
|
|
497
|
+
case 2: return [4 /*yield*/, this.calcDiscountByType(coupon.discount.non_subscriber.type, coupon.discount.non_subscriber.value, coupon.productsCategories, checkout)];
|
|
498
|
+
case 3:
|
|
499
|
+
discount = _c.sent();
|
|
500
|
+
_c.label = 4;
|
|
501
|
+
case 4: return [2 /*return*/, discount];
|
|
502
|
+
}
|
|
503
|
+
});
|
|
504
|
+
});
|
|
505
|
+
};
|
|
506
|
+
CouponService.prototype.calcDiscountByType = function (type, value, categories, checkout) {
|
|
507
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
508
|
+
var discount, lineItensDiscount, subTotal;
|
|
509
|
+
return __generator(this, function (_c) {
|
|
510
|
+
switch (_c.label) {
|
|
511
|
+
case 0:
|
|
512
|
+
discount = 0;
|
|
513
|
+
return [4 /*yield*/, this.getLineItensEligebleForDiscount(categories, checkout)];
|
|
514
|
+
case 1:
|
|
515
|
+
lineItensDiscount = _c.sent();
|
|
516
|
+
subTotal = this.calcCheckoutSubtotal(lineItensDiscount, checkout.user, checkout.shop);
|
|
517
|
+
if (type == i3.CouponTypes.ABSOLUTE) {
|
|
518
|
+
discount = value > subTotal ? subTotal : value;
|
|
519
|
+
}
|
|
520
|
+
else {
|
|
521
|
+
discount = subTotal * (value / 100);
|
|
522
|
+
}
|
|
523
|
+
return [2 /*return*/, discount];
|
|
524
|
+
}
|
|
525
|
+
});
|
|
526
|
+
});
|
|
527
|
+
};
|
|
528
|
+
CouponService.prototype.hasMinSubTotal = function (coupon, checkout) {
|
|
529
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
530
|
+
var lineItensDiscount, subTotal;
|
|
531
|
+
return __generator(this, function (_c) {
|
|
532
|
+
switch (_c.label) {
|
|
533
|
+
case 0:
|
|
534
|
+
if (!coupon.minSubTotalValue)
|
|
535
|
+
return [2 /*return*/, true];
|
|
536
|
+
return [4 /*yield*/, this.getLineItensEligebleForDiscount(coupon.productsCategories, checkout)];
|
|
537
|
+
case 1:
|
|
538
|
+
lineItensDiscount = _c.sent();
|
|
539
|
+
subTotal = this.calcCheckoutSubtotal(lineItensDiscount, checkout.user, checkout.shop);
|
|
540
|
+
if (coupon.minSubTotalValue <= subTotal)
|
|
541
|
+
return [2 /*return*/, true];
|
|
542
|
+
return [2 /*return*/, false];
|
|
543
|
+
}
|
|
544
|
+
});
|
|
545
|
+
});
|
|
546
|
+
};
|
|
547
|
+
CouponService.prototype.hasProductCategories = function (coupon, checkout) {
|
|
548
|
+
var _a;
|
|
549
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
550
|
+
var couponCategories, hasCategories;
|
|
551
|
+
return __generator(this, function (_c) {
|
|
552
|
+
switch (_c.label) {
|
|
553
|
+
case 0:
|
|
554
|
+
if (!coupon.productsCategories || !coupon.productsCategories.length) {
|
|
555
|
+
return [2 /*return*/, true];
|
|
556
|
+
}
|
|
557
|
+
return [4 /*yield*/, this.getCouponCategoriesId(coupon.productsCategories)];
|
|
558
|
+
case 1:
|
|
559
|
+
couponCategories = _c.sent();
|
|
560
|
+
hasCategories = (_a = checkout.lineItems) === null || _a === void 0 ? void 0 : _a.filter(function (i) {
|
|
561
|
+
var _a;
|
|
562
|
+
if (!i.categories || !((_a = i.categories) === null || _a === void 0 ? void 0 : _a.length))
|
|
563
|
+
return true;
|
|
564
|
+
return i.categories.some(function (c) { return couponCategories.some(function (cat) { return cat.id == c || cat.firestoreId == c; }); });
|
|
565
|
+
});
|
|
566
|
+
return [2 /*return*/, hasCategories.length ? true : false];
|
|
567
|
+
}
|
|
568
|
+
});
|
|
569
|
+
});
|
|
570
|
+
};
|
|
571
|
+
CouponService.prototype.coupomUserValidation = function (coupon, user) {
|
|
572
|
+
if (!user || coupon.exclusivityType.includes(i3.Exclusivities.ALL_USERS))
|
|
573
|
+
return true;
|
|
574
|
+
var userTypes = [];
|
|
575
|
+
if (coupon.exclusivityType.includes(i3.Exclusivities.COLLABORATORS) && this.emailIsFromCollaborator(user.email))
|
|
576
|
+
userTypes.push(i3.Exclusivities.COLLABORATORS);
|
|
577
|
+
if (coupon.exclusivityType.includes(i3.Exclusivities.SPECIFIC_USER) && coupon.userExclusiveEmail.includes(user.email))
|
|
578
|
+
userTypes.push(i3.Exclusivities.SPECIFIC_USER);
|
|
579
|
+
if (coupon.exclusivityType.includes(i3.Exclusivities.ACTIVE_SUBSCRIBER) && user.isSubscriber)
|
|
580
|
+
userTypes.push(i3.Exclusivities.ACTIVE_SUBSCRIBER);
|
|
581
|
+
if ((coupon.exclusivityType.includes(i3.Exclusivities.NON_SUBSCRIBER) ||
|
|
582
|
+
coupon.exclusivityType.includes(i3.Exclusivities.INACTIVE_SUBSCRIBER)) &&
|
|
583
|
+
!user.isSubscriber)
|
|
584
|
+
userTypes.push(i3.Exclusivities.ACTIVE_SUBSCRIBER);
|
|
585
|
+
return coupon.exclusivityType.some(function (r) { return userTypes.includes(r); });
|
|
586
|
+
};
|
|
587
|
+
CouponService.prototype.getCouponCategoriesId = function (productsCategories) {
|
|
588
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
589
|
+
var couponCategories, index, c;
|
|
590
|
+
return __generator(this, function (_c) {
|
|
591
|
+
switch (_c.label) {
|
|
592
|
+
case 0:
|
|
593
|
+
couponCategories = [];
|
|
594
|
+
index = 0;
|
|
595
|
+
_c.label = 1;
|
|
596
|
+
case 1:
|
|
597
|
+
if (!(index < productsCategories.length)) return [3 /*break*/, 4];
|
|
598
|
+
return [4 /*yield*/, this.categoryRepository.get({
|
|
599
|
+
id: productsCategories[index],
|
|
600
|
+
})];
|
|
601
|
+
case 2:
|
|
602
|
+
c = _c.sent();
|
|
603
|
+
couponCategories.push({ id: c.id, firestoreId: c.firestoreId });
|
|
604
|
+
_c.label = 3;
|
|
605
|
+
case 3:
|
|
606
|
+
index++;
|
|
607
|
+
return [3 /*break*/, 1];
|
|
608
|
+
case 4: return [2 /*return*/, couponCategories];
|
|
609
|
+
}
|
|
610
|
+
});
|
|
611
|
+
});
|
|
612
|
+
};
|
|
613
|
+
CouponService.prototype.getLineItensEligebleForDiscount = function (productsCategories, checkout) {
|
|
614
|
+
var _a;
|
|
615
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
616
|
+
var lineItensDiscount, couponCategories;
|
|
617
|
+
return __generator(this, function (_c) {
|
|
618
|
+
switch (_c.label) {
|
|
619
|
+
case 0:
|
|
620
|
+
lineItensDiscount = [];
|
|
621
|
+
return [4 /*yield*/, this.getCouponCategoriesId(productsCategories)];
|
|
622
|
+
case 1:
|
|
623
|
+
couponCategories = _c.sent();
|
|
624
|
+
if (productsCategories && productsCategories.length) {
|
|
625
|
+
lineItensDiscount = (_a = checkout.lineItems) === null || _a === void 0 ? void 0 : _a.filter(function (i) {
|
|
626
|
+
var _a;
|
|
627
|
+
if ((_a = i.categories) === null || _a === void 0 ? void 0 : _a.length) {
|
|
628
|
+
return i.categories.some(function (c) { return couponCategories.some(function (cat) { return cat.id == c || cat.firestoreId == c; }); });
|
|
629
|
+
}
|
|
630
|
+
return true;
|
|
631
|
+
});
|
|
632
|
+
}
|
|
633
|
+
else {
|
|
634
|
+
lineItensDiscount = checkout.lineItems;
|
|
635
|
+
}
|
|
636
|
+
return [2 /*return*/, lineItensDiscount];
|
|
637
|
+
}
|
|
638
|
+
});
|
|
639
|
+
});
|
|
640
|
+
};
|
|
641
|
+
CouponService.prototype.calcCheckoutSubtotal = function (lineItens, user, shop) {
|
|
642
|
+
return ((lineItens === null || lineItens === void 0 ? void 0 : lineItens.reduce(function (acc, curr) {
|
|
643
|
+
var _a, _b;
|
|
644
|
+
return (user === null || user === void 0 ? void 0 : user.isSubscriber) && ((_a = curr.price[shop]) === null || _a === void 0 ? void 0 : _a.subscriberPrice)
|
|
645
|
+
? acc + ((_b = curr.price[shop]) === null || _b === void 0 ? void 0 : _b.subscriberPrice) * curr.quantity
|
|
646
|
+
: acc + curr.pricePaid * curr.quantity;
|
|
647
|
+
}, 0)) || 0);
|
|
648
|
+
};
|
|
649
|
+
CouponService.prototype.getOrdersWithCoupon = function (coupon) {
|
|
650
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
651
|
+
return __generator(this, function (_c) {
|
|
652
|
+
switch (_c.label) {
|
|
653
|
+
case 0: return [4 /*yield*/, this.orderRepository
|
|
654
|
+
.find({
|
|
655
|
+
filters: {
|
|
656
|
+
coupon: { id: coupon.id },
|
|
657
|
+
payment: { status: 'paid' },
|
|
658
|
+
},
|
|
659
|
+
})
|
|
660
|
+
.then(function (result) { return result.data; })];
|
|
661
|
+
case 1: return [2 /*return*/, _c.sent()];
|
|
662
|
+
}
|
|
663
|
+
});
|
|
664
|
+
});
|
|
665
|
+
};
|
|
666
|
+
CouponService.prototype.countOrdersWithUser = function (orders, email) {
|
|
667
|
+
return orders.filter(function (o) { return o.user.email == email; }).length;
|
|
668
|
+
};
|
|
669
|
+
return CouponService;
|
|
670
|
+
}());
|
|
671
|
+
CouponService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CouponService, deps: [{ token: 'CouponRepository' }, { token: DEFAULT_SHOP }, { token: 'OrderRepository' }, { token: 'CategoryRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
672
|
+
CouponService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CouponService, providedIn: 'root' });
|
|
673
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CouponService, decorators: [{
|
|
674
|
+
type: i0.Injectable,
|
|
675
|
+
args: [{
|
|
676
|
+
providedIn: 'root',
|
|
677
|
+
}]
|
|
678
|
+
}], ctorParameters: function () {
|
|
679
|
+
return [{ type: undefined, decorators: [{
|
|
680
|
+
type: i0.Inject,
|
|
681
|
+
args: ['CouponRepository']
|
|
682
|
+
}] }, { type: i3__namespace.Shops, decorators: [{
|
|
683
|
+
type: i0.Inject,
|
|
684
|
+
args: [DEFAULT_SHOP]
|
|
685
|
+
}] }, { type: undefined, decorators: [{
|
|
686
|
+
type: i0.Inject,
|
|
687
|
+
args: ['OrderRepository']
|
|
688
|
+
}] }, { type: undefined, decorators: [{
|
|
689
|
+
type: i0.Inject,
|
|
690
|
+
args: ['CategoryRepository']
|
|
691
|
+
}] }];
|
|
711
692
|
} });
|
|
712
693
|
|
|
713
|
-
var CheckoutService = /** @class */ (function () {
|
|
714
|
-
function CheckoutService(couponService, checkoutRepository, orderRepository, userRepository, defaultShop) {
|
|
715
|
-
this.couponService = couponService;
|
|
716
|
-
this.checkoutRepository = checkoutRepository;
|
|
717
|
-
this.orderRepository = orderRepository;
|
|
718
|
-
this.userRepository = userRepository;
|
|
719
|
-
this.defaultShop = defaultShop;
|
|
720
|
-
}
|
|
721
|
-
CheckoutService.prototype.getCheckout = function (checkoutData) {
|
|
722
|
-
var checkoutId = cookie__default["default"].get('checkoutId');
|
|
723
|
-
if (!i3.isNil(checkoutId))
|
|
724
|
-
return rxjs.from(this.checkoutRepository.get({ id: checkoutId }));
|
|
725
|
-
return rxjs.from(this.createCheckout(checkoutData));
|
|
726
|
-
};
|
|
727
|
-
CheckoutService.prototype.getUserByCheckout = function (checkoutId) {
|
|
728
|
-
var _this = this;
|
|
729
|
-
return rxjs.from(this.checkoutRepository.get({ id: checkoutId })).pipe(operators.concatMap(function (checkout) { var _a; return ((_a = checkout === null || checkout === void 0 ? void 0 : checkout.user) === null || _a === void 0 ? void 0 : _a.id) ? rxjs.of(checkout.user) : rxjs.from(_this.userRepository.get({ id: checkout.user.id })); }), operators.concatMap(function (user) { return rxjs.of(user) || rxjs.throwError(function () { return new i3.NotFoundError('User is not found'); }); }));
|
|
730
|
-
};
|
|
731
|
-
CheckoutService.prototype.updateCheckoutLineItems = function (checkout) {
|
|
732
|
-
return rxjs.from(this.checkoutRepository.update(i3.Checkout.toInstance({ id: checkout.id, lineItems: checkout.lineItems })));
|
|
733
|
-
};
|
|
734
|
-
CheckoutService.prototype.updateCheckoutUser = function (checkout) {
|
|
735
|
-
return rxjs.from(this.checkoutRepository.update(i3.Checkout.toInstance({ id: checkout.id, user: checkout.user })));
|
|
736
|
-
};
|
|
737
|
-
CheckoutService.prototype.clearCheckoutFromSession = function () {
|
|
738
|
-
cookie__default["default"].remove('checkoutId');
|
|
739
|
-
return rxjs.of();
|
|
740
|
-
};
|
|
741
|
-
CheckoutService.prototype.calcDiscount = function (coupon) {
|
|
742
|
-
var _this = this;
|
|
743
|
-
return this.getCheckout().pipe(operators.concatMap(function (checkout) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_b) {
|
|
744
|
-
switch (_b.label) {
|
|
745
|
-
case 0: return [4 /*yield*/, this.couponService.calcDiscountShopping(coupon, checkout)];
|
|
746
|
-
case 1: return [2 /*return*/, _b.sent()];
|
|
747
|
-
}
|
|
748
|
-
}); }); }));
|
|
749
|
-
};
|
|
750
|
-
CheckoutService.prototype.checkCoupon = function (nickname, checkoutType) {
|
|
751
|
-
var _this = this;
|
|
752
|
-
return this.getCheckout().pipe(operators.concatMap(function (checkout) {
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
args: ['UserRepository']
|
|
789
|
-
}] }, { type: i3__namespace.Shops, decorators: [{
|
|
790
|
-
type: i0.Inject,
|
|
791
|
-
args: [DEFAULT_SHOP]
|
|
792
|
-
}] }];
|
|
694
|
+
var CheckoutService = /** @class */ (function () {
|
|
695
|
+
function CheckoutService(couponService, checkoutRepository, orderRepository, userRepository, defaultShop) {
|
|
696
|
+
this.couponService = couponService;
|
|
697
|
+
this.checkoutRepository = checkoutRepository;
|
|
698
|
+
this.orderRepository = orderRepository;
|
|
699
|
+
this.userRepository = userRepository;
|
|
700
|
+
this.defaultShop = defaultShop;
|
|
701
|
+
}
|
|
702
|
+
CheckoutService.prototype.getCheckout = function (checkoutData) {
|
|
703
|
+
var checkoutId = cookie__default["default"].get('checkoutId');
|
|
704
|
+
if (!i3.isNil(checkoutId))
|
|
705
|
+
return rxjs.from(this.checkoutRepository.get({ id: checkoutId }));
|
|
706
|
+
return rxjs.from(this.createCheckout(checkoutData));
|
|
707
|
+
};
|
|
708
|
+
CheckoutService.prototype.getUserByCheckout = function (checkoutId) {
|
|
709
|
+
var _this = this;
|
|
710
|
+
return rxjs.from(this.checkoutRepository.get({ id: checkoutId })).pipe(operators.concatMap(function (checkout) { var _a; return ((_a = checkout === null || checkout === void 0 ? void 0 : checkout.user) === null || _a === void 0 ? void 0 : _a.id) ? rxjs.of(checkout.user) : rxjs.from(_this.userRepository.get({ id: checkout.user.id })); }), operators.concatMap(function (user) { return rxjs.of(user) || rxjs.throwError(function () { return new i3.NotFoundError('User is not found'); }); }));
|
|
711
|
+
};
|
|
712
|
+
CheckoutService.prototype.updateCheckoutLineItems = function (checkout) {
|
|
713
|
+
return rxjs.from(this.checkoutRepository.update(i3.Checkout.toInstance({ id: checkout.id, lineItems: checkout.lineItems })));
|
|
714
|
+
};
|
|
715
|
+
CheckoutService.prototype.updateCheckoutUser = function (checkout) {
|
|
716
|
+
return rxjs.from(this.checkoutRepository.update(i3.Checkout.toInstance({ id: checkout.id, user: checkout.user })));
|
|
717
|
+
};
|
|
718
|
+
CheckoutService.prototype.clearCheckoutFromSession = function () {
|
|
719
|
+
cookie__default["default"].remove('checkoutId');
|
|
720
|
+
return rxjs.of();
|
|
721
|
+
};
|
|
722
|
+
CheckoutService.prototype.calcDiscount = function (coupon) {
|
|
723
|
+
var _this = this;
|
|
724
|
+
return this.getCheckout().pipe(operators.concatMap(function (checkout) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_b) {
|
|
725
|
+
switch (_b.label) {
|
|
726
|
+
case 0: return [4 /*yield*/, this.couponService.calcDiscountShopping(coupon, checkout)];
|
|
727
|
+
case 1: return [2 /*return*/, _b.sent()];
|
|
728
|
+
}
|
|
729
|
+
}); }); }));
|
|
730
|
+
};
|
|
731
|
+
CheckoutService.prototype.checkCoupon = function (nickname, checkoutType) {
|
|
732
|
+
var _this = this;
|
|
733
|
+
return this.getCheckout().pipe(operators.concatMap(function (checkout) { return _this.couponService.checkCoupon(nickname, i3.CheckoutTypes.ECOMMERCE, checkout, null).pipe(); }));
|
|
734
|
+
};
|
|
735
|
+
CheckoutService.prototype.createCheckout = function (checkoutData) {
|
|
736
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
737
|
+
var checkout;
|
|
738
|
+
return __generator(this, function (_b) {
|
|
739
|
+
switch (_b.label) {
|
|
740
|
+
case 0: return [4 /*yield*/, this.checkoutRepository.create(Object.assign(Object.assign({ createdAt: new Date() }, i3.Checkout.toInstance(i3.pick(checkoutData, ['user', 'shop'])).toPlain()), { shop: (checkoutData === null || checkoutData === void 0 ? void 0 : checkoutData.shop) || this.defaultShop }))];
|
|
741
|
+
case 1:
|
|
742
|
+
checkout = _b.sent();
|
|
743
|
+
cookie__default["default"].set('checkoutId', checkout.id);
|
|
744
|
+
return [2 /*return*/, checkout];
|
|
745
|
+
}
|
|
746
|
+
});
|
|
747
|
+
});
|
|
748
|
+
};
|
|
749
|
+
return CheckoutService;
|
|
750
|
+
}());
|
|
751
|
+
CheckoutService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CheckoutService, deps: [{ token: CouponService }, { token: 'CheckoutRepository' }, { token: 'OrderRepository' }, { token: 'UserRepository' }, { token: DEFAULT_SHOP }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
752
|
+
CheckoutService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CheckoutService });
|
|
753
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CheckoutService, decorators: [{
|
|
754
|
+
type: i0.Injectable
|
|
755
|
+
}], ctorParameters: function () {
|
|
756
|
+
return [{ type: CouponService }, { type: undefined, decorators: [{
|
|
757
|
+
type: i0.Inject,
|
|
758
|
+
args: ['CheckoutRepository']
|
|
759
|
+
}] }, { type: undefined, decorators: [{
|
|
760
|
+
type: i0.Inject,
|
|
761
|
+
args: ['OrderRepository']
|
|
762
|
+
}] }, { type: undefined, decorators: [{
|
|
763
|
+
type: i0.Inject,
|
|
764
|
+
args: ['UserRepository']
|
|
765
|
+
}] }, { type: i3__namespace.Shops, decorators: [{
|
|
766
|
+
type: i0.Inject,
|
|
767
|
+
args: [DEFAULT_SHOP]
|
|
768
|
+
}] }];
|
|
793
769
|
} });
|
|
794
770
|
|
|
795
|
-
var CartService = /** @class */ (function () {
|
|
796
|
-
function CartService(authService, checkoutService, defaultShop, productRepository,
|
|
797
|
-
var _this = this;
|
|
798
|
-
this.authService = authService;
|
|
799
|
-
this.checkoutService = checkoutService;
|
|
800
|
-
this.defaultShop = defaultShop;
|
|
801
|
-
this.productRepository = productRepository;
|
|
802
|
-
this.
|
|
803
|
-
this.
|
|
804
|
-
this.
|
|
805
|
-
this.
|
|
806
|
-
|
|
807
|
-
var
|
|
808
|
-
var
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
checkoutLoaded.lineItems[index].
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
.
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
var
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
case
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
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
|
-
return this.
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
};
|
|
972
|
-
CartService.prototype.
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
return [4 /*yield*/, this.
|
|
988
|
-
case
|
|
989
|
-
|
|
990
|
-
return [
|
|
991
|
-
case
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
.
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
case
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
return [3 /*break*/, 11];
|
|
1176
|
-
case 21: return [3 /*break*/, 24];
|
|
1177
|
-
case 22:
|
|
1178
|
-
e_3_1 = _o.sent();
|
|
1179
|
-
e_3 = { error: e_3_1 };
|
|
1180
|
-
return [3 /*break*/, 24];
|
|
1181
|
-
case 23:
|
|
1182
|
-
try {
|
|
1183
|
-
if (elegibleCampaigns_1_1 && !elegibleCampaigns_1_1.done && (_l = elegibleCampaigns_1.return)) _l.call(elegibleCampaigns_1);
|
|
1184
|
-
}
|
|
1185
|
-
finally { if (e_3) throw e_3.error; }
|
|
1186
|
-
return [7 /*endfinally*/];
|
|
1187
|
-
case 24:
|
|
1188
|
-
if (!campaingnProducts.length)
|
|
1189
|
-
return [2 /*return*/, Object.assign(Object.assign({}, checkout), { lineItems: notGiftItems })];
|
|
1190
|
-
gifts = this.giftToLineItems([].concat.apply([], __spreadArray([], __read(campaingnProducts))));
|
|
1191
|
-
return [2 /*return*/, Object.assign(Object.assign({}, checkout), { lineItems: notGiftItems.concat(gifts) })];
|
|
1192
|
-
}
|
|
1193
|
-
});
|
|
1194
|
-
}); }), operators.concatMap(function (checkout) { return _this.checkoutService.updateCheckoutLineItems(checkout); }), operators.map(function (checkout) { return _this.generateCartObject(checkout.lineItems); }), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
|
|
1195
|
-
};
|
|
1196
|
-
CartService.prototype.giftToLineItems = function (items) {
|
|
1197
|
-
return items.map(function (item) {
|
|
1198
|
-
var _a;
|
|
1199
|
-
var brand = item.brand, categories = item.categories, id = item.id, name = item.name, price = item.price, sku = item.sku, slug = item.slug, stock = item.stock, weight = item.weight, EAN = item.EAN;
|
|
1200
|
-
var image = ((_a = item === null || item === void 0 ? void 0 : item.miniatures) === null || _a === void 0 ? void 0 : _a.length) ? item.miniatures[0] : item.images[0];
|
|
1201
|
-
return i3.LineItem.toInstance({
|
|
1202
|
-
brand: brand,
|
|
1203
|
-
categories: categories,
|
|
1204
|
-
id: id.toString(),
|
|
1205
|
-
name: name,
|
|
1206
|
-
price: price,
|
|
1207
|
-
sku: sku,
|
|
1208
|
-
slug: slug,
|
|
1209
|
-
stock: stock,
|
|
1210
|
-
weight: weight,
|
|
1211
|
-
EAN: EAN,
|
|
1212
|
-
image: image,
|
|
1213
|
-
pricePaid: 0,
|
|
1214
|
-
quantity: 1,
|
|
1215
|
-
isGift: true,
|
|
1216
|
-
});
|
|
1217
|
-
});
|
|
1218
|
-
};
|
|
1219
|
-
return CartService;
|
|
1220
|
-
}());
|
|
1221
|
-
CartService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CartService, deps: [{ token: AuthService }, { token: CheckoutService }, { token: DEFAULT_SHOP }, { token: 'ProductRepository' }, { token: 'CategoryRepository' }, { token: 'VariantRepository' }, { token: 'Buy2WinRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1222
|
-
CartService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CartService });
|
|
1223
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CartService, decorators: [{
|
|
1224
|
-
type: i0.Injectable
|
|
1225
|
-
}], ctorParameters: function () {
|
|
1226
|
-
return [{ type: AuthService }, { type: CheckoutService }, { type: i3__namespace.Shops, decorators: [{
|
|
1227
|
-
type: i0.Inject,
|
|
1228
|
-
args: [DEFAULT_SHOP]
|
|
1229
|
-
}] }, { type: undefined, decorators: [{
|
|
1230
|
-
type: i0.Inject,
|
|
1231
|
-
args: ['ProductRepository']
|
|
1232
|
-
}] }, { type: undefined, decorators: [{
|
|
1233
|
-
type: i0.Inject,
|
|
1234
|
-
args: ['CategoryRepository']
|
|
1235
|
-
}] }, { type: undefined, decorators: [{
|
|
1236
|
-
type: i0.Inject,
|
|
1237
|
-
args: ['VariantRepository']
|
|
1238
|
-
}] }, { type: i3__namespace.Buy2WinFirestoreRepository, decorators: [{
|
|
1239
|
-
type: i0.Inject,
|
|
1240
|
-
args: ['Buy2WinRepository']
|
|
1241
|
-
}] }];
|
|
771
|
+
var CartService = /** @class */ (function () {
|
|
772
|
+
function CartService(authService, checkoutService, defaultShop, productRepository, variantRepository, buy2WinRepository) {
|
|
773
|
+
var _this = this;
|
|
774
|
+
this.authService = authService;
|
|
775
|
+
this.checkoutService = checkoutService;
|
|
776
|
+
this.defaultShop = defaultShop;
|
|
777
|
+
this.productRepository = productRepository;
|
|
778
|
+
this.variantRepository = variantRepository;
|
|
779
|
+
this.buy2WinRepository = buy2WinRepository;
|
|
780
|
+
this.cartSubject = new rxjs.Subject();
|
|
781
|
+
this.updateLineItemInCart = function (lineItem, quantity, checkout) { return (i3.isNil(checkout) ? _this.checkoutService.getCheckout() : rxjs.of(checkout)).pipe(operators.concatMap(function (checkoutLoaded) {
|
|
782
|
+
var _a;
|
|
783
|
+
var items = [];
|
|
784
|
+
var index = (_a = checkoutLoaded.lineItems) === null || _a === void 0 ? void 0 : _a.map(function (checkoutItem) { return checkoutItem.id; }).indexOf(lineItem.id);
|
|
785
|
+
if (index > -1) {
|
|
786
|
+
checkoutLoaded.lineItems[index].quantity += quantity;
|
|
787
|
+
checkoutLoaded.lineItems[index].pricePaid = lineItem.pricePaid;
|
|
788
|
+
}
|
|
789
|
+
else
|
|
790
|
+
checkoutLoaded.lineItems = items.concat(checkoutLoaded.lineItems ? checkoutLoaded.lineItems.concat([lineItem]) : [lineItem]);
|
|
791
|
+
return _this.checkoutService
|
|
792
|
+
.updateCheckoutLineItems(checkoutLoaded)
|
|
793
|
+
.pipe(operators.map(function (updatedCheckout) { return _this.generateCartObject(updatedCheckout.lineItems); }));
|
|
794
|
+
})); };
|
|
795
|
+
this.generateCartObject = function (items) { return items
|
|
796
|
+
? items.reduce(function (cart, item) {
|
|
797
|
+
var _h;
|
|
798
|
+
var _a;
|
|
799
|
+
return (Object.assign(Object.assign({}, cart), (_h = {}, _h[item.id] = i3.LineItem.toInstance(Object.assign(Object.assign({}, (cart[item.id] || item)), { quantity: (((_a = cart[item.id]) === null || _a === void 0 ? void 0 : _a.quantity) || 0) + (item.quantity ? item.quantity : 1) })), _h)));
|
|
800
|
+
}, {})
|
|
801
|
+
: []; };
|
|
802
|
+
this.buildLineItem = function (_h) {
|
|
803
|
+
var checkout = _h.checkout, item = _h.item, quantity = _h.quantity;
|
|
804
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
805
|
+
var _a, _b, _c, _d, _e, _f, _g, product, image, id, name, EAN, slug, stock, price, weight, sku, type, isGift, pricePaid;
|
|
806
|
+
return __generator(this, function (_h) {
|
|
807
|
+
switch (_h.label) {
|
|
808
|
+
case 0: return [4 /*yield*/, this.getProductData(item.id)];
|
|
809
|
+
case 1:
|
|
810
|
+
product = _h.sent();
|
|
811
|
+
item.quantity = (item === null || item === void 0 ? void 0 : item.quantity) || ((_b = (_a = checkout === null || checkout === void 0 ? void 0 : checkout.lineItems) === null || _a === void 0 ? void 0 : _a.find(function (lineItem) { return lineItem.id === item.id; })) === null || _b === void 0 ? void 0 : _b.quantity) || 0;
|
|
812
|
+
if (this.checkMaxStock(item, quantity || 0))
|
|
813
|
+
throw new Error('Desculpe! Temos apenas ' + ((_c = item.stock) === null || _c === void 0 ? void 0 : _c.quantity) + ' em estoque.');
|
|
814
|
+
image = item.image || ((_d = item.images) === null || _d === void 0 ? void 0 : _d.shift());
|
|
815
|
+
id = item.id, name = item.name, EAN = item.EAN, slug = item.slug, stock = item.stock, price = item.price, weight = item.weight, sku = item.sku, type = item.type;
|
|
816
|
+
isGift = item.isGift || null;
|
|
817
|
+
pricePaid = this.getProductPrice({
|
|
818
|
+
product: item,
|
|
819
|
+
shop: checkout.shop || this.defaultShop,
|
|
820
|
+
isSubscriber: (_e = checkout.user) === null || _e === void 0 ? void 0 : _e.isSubscriber,
|
|
821
|
+
});
|
|
822
|
+
return [2 /*return*/, {
|
|
823
|
+
checkout: checkout,
|
|
824
|
+
lineItem: i3.LineItem.toInstance({
|
|
825
|
+
id: id,
|
|
826
|
+
name: name !== null && name !== void 0 ? name : product.name,
|
|
827
|
+
EAN: EAN !== null && EAN !== void 0 ? EAN : product.EAN,
|
|
828
|
+
brand: product.brand,
|
|
829
|
+
slug: slug !== null && slug !== void 0 ? slug : product.slug,
|
|
830
|
+
sku: sku !== null && sku !== void 0 ? sku : product.sku,
|
|
831
|
+
stock: stock,
|
|
832
|
+
price: price,
|
|
833
|
+
image: image,
|
|
834
|
+
weight: weight !== null && weight !== void 0 ? weight : product.weight,
|
|
835
|
+
quantity: (item.quantity || 0) + (quantity || 0),
|
|
836
|
+
pricePaid: pricePaid,
|
|
837
|
+
categories: (_f = product.categories) !== null && _f !== void 0 ? _f : [],
|
|
838
|
+
isGift: isGift !== null && isGift !== void 0 ? isGift : null,
|
|
839
|
+
costPrice: (_g = product.costPrice) !== null && _g !== void 0 ? _g : 0,
|
|
840
|
+
type: type,
|
|
841
|
+
}),
|
|
842
|
+
}];
|
|
843
|
+
}
|
|
844
|
+
});
|
|
845
|
+
});
|
|
846
|
+
};
|
|
847
|
+
this.getProductPrice = function (_h) {
|
|
848
|
+
var product = _h.product, isSubscriber = _h.isSubscriber;
|
|
849
|
+
var info = product.price;
|
|
850
|
+
if (product.isGift)
|
|
851
|
+
return 0;
|
|
852
|
+
return isSubscriber && info.subscriberPrice > 0 ? info.subscriberPrice : info.price;
|
|
853
|
+
};
|
|
854
|
+
this.checkMaxStock = function (item, quantity) {
|
|
855
|
+
var _a;
|
|
856
|
+
var maxStock = ((_a = item.stock) === null || _a === void 0 ? void 0 : _a.quantity) || 0;
|
|
857
|
+
var currentItemAmount = item.quantity || 0;
|
|
858
|
+
return currentItemAmount + quantity > maxStock;
|
|
859
|
+
};
|
|
860
|
+
}
|
|
861
|
+
CartService.prototype.addItem = function (item, quantity) {
|
|
862
|
+
var _this = this;
|
|
863
|
+
if (quantity === void 0) { quantity = 1; }
|
|
864
|
+
return rxjs.from(this.checkoutService.getCheckout()).pipe(operators.concatMap(function (checkout) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_h) {
|
|
865
|
+
switch (_h.label) {
|
|
866
|
+
case 0: return [4 /*yield*/, this.buildLineItem({ checkout: checkout, item: item, quantity: quantity || 1 })];
|
|
867
|
+
case 1: return [2 /*return*/, _h.sent()];
|
|
868
|
+
}
|
|
869
|
+
}); }); }), operators.mergeMap(function (_h) {
|
|
870
|
+
var checkout = _h.checkout, lineItem = _h.lineItem;
|
|
871
|
+
return _this.updateLineItemInCart(lineItem, quantity || 1, checkout);
|
|
872
|
+
}), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
|
|
873
|
+
};
|
|
874
|
+
CartService.prototype.decreaseItem = function (item) {
|
|
875
|
+
var _this = this;
|
|
876
|
+
return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) {
|
|
877
|
+
var _a;
|
|
878
|
+
var checkoutItem = (_a = checkout.lineItems) === null || _a === void 0 ? void 0 : _a.find(function (lineItem) { return lineItem.id === item.id; });
|
|
879
|
+
if (!i3.isNil(checkoutItem))
|
|
880
|
+
checkoutItem.quantity -= checkoutItem.quantity > 1 ? 1 : 0;
|
|
881
|
+
return checkout;
|
|
882
|
+
}), operators.concatMap(function (checkout) { return _this.checkoutService.updateCheckoutLineItems(checkout); }), operators.map(function (checkout) { return _this.generateCartObject(checkout.lineItems); }), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
|
|
883
|
+
};
|
|
884
|
+
CartService.prototype.getCart = function (checkout) {
|
|
885
|
+
var _this = this;
|
|
886
|
+
this.buildCartFromCheckout(checkout).subscribe(function (cart) { return _this.cartSubject.next(cart); });
|
|
887
|
+
return this.cartSubject;
|
|
888
|
+
};
|
|
889
|
+
/**
|
|
890
|
+
* @deprecated The method should not be used
|
|
891
|
+
*/
|
|
892
|
+
CartService.prototype.getVariantPriceDiscount = function (item) {
|
|
893
|
+
return this.authService.getUser().pipe(operators.concatMap(function (user) { return rxjs.iif(function () { return user.isSubscriber && !!item.price.subscriberPrice; }, rxjs.of(item.price.subscriberPrice), rxjs.of(item.price.price)); }), operators.catchError(function () { return rxjs.of(item.price.price); }));
|
|
894
|
+
};
|
|
895
|
+
CartService.prototype.removeItem = function (item) {
|
|
896
|
+
var _this = this;
|
|
897
|
+
return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) {
|
|
898
|
+
var index = checkout.lineItems.findIndex(function (lineItem) { return lineItem.id === item.id; });
|
|
899
|
+
if (index >= 0)
|
|
900
|
+
checkout.lineItems.splice(index, 1);
|
|
901
|
+
return checkout;
|
|
902
|
+
}), operators.concatMap(function (checkout) { return _this.checkoutService.updateCheckoutLineItems(checkout); }), operators.map(function (checkout) { return _this.generateCartObject(checkout.lineItems); }), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
|
|
903
|
+
};
|
|
904
|
+
CartService.prototype.updateUserCart = function (user) {
|
|
905
|
+
var _this = this;
|
|
906
|
+
return this.checkoutService.getCheckout().pipe(operators.concatMap(function (checkout) { return _this.checkoutService.updateCheckoutUser(i3.Checkout.toInstance(Object.assign(Object.assign({}, checkout.toPlain()), { user: user }))); }), operators.concatMap(function (checkout) { return __awaiter(_this, void 0, void 0, function () {
|
|
907
|
+
var _a, _b, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
908
|
+
var _this = this;
|
|
909
|
+
return __generator(this, function (_s) {
|
|
910
|
+
switch (_s.label) {
|
|
911
|
+
case 0:
|
|
912
|
+
_j = (_h = this.checkoutService)
|
|
913
|
+
.updateCheckoutLineItems;
|
|
914
|
+
_l = (_k = i3.Checkout).toInstance;
|
|
915
|
+
_o = (_m = Object).assign;
|
|
916
|
+
_p = [Object.assign({}, checkout.toPlain())];
|
|
917
|
+
_q = {};
|
|
918
|
+
if (!((_a = checkout.lineItems) === null || _a === void 0 ? void 0 : _a.length)) return [3 /*break*/, 2];
|
|
919
|
+
return [4 /*yield*/, Promise.all((_b = checkout.lineItems) === null || _b === void 0 ? void 0 : _b.map(function (item) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_h) {
|
|
920
|
+
switch (_h.label) {
|
|
921
|
+
case 0: return [4 /*yield*/, this.buildLineItem({ checkout: checkout, item: item })];
|
|
922
|
+
case 1: return [2 /*return*/, (_h.sent()).lineItem];
|
|
923
|
+
}
|
|
924
|
+
}); }); }))];
|
|
925
|
+
case 1:
|
|
926
|
+
_r = _s.sent();
|
|
927
|
+
return [3 /*break*/, 3];
|
|
928
|
+
case 2:
|
|
929
|
+
_r = [];
|
|
930
|
+
_s.label = 3;
|
|
931
|
+
case 3: return [2 /*return*/, _j.apply(_h, [_l.apply(_k, [_o.apply(_m, _p.concat([(_q.lineItems = _r, _q)]))])])
|
|
932
|
+
.toPromise()];
|
|
933
|
+
}
|
|
934
|
+
});
|
|
935
|
+
}); }), operators.map(function (checkout) { return _this.generateCartObject(checkout.lineItems); }), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
|
|
936
|
+
};
|
|
937
|
+
CartService.prototype.clearCart = function () {
|
|
938
|
+
var _this = this;
|
|
939
|
+
return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) {
|
|
940
|
+
_this.checkoutService.clearCheckoutFromSession();
|
|
941
|
+
return checkout;
|
|
942
|
+
}), operators.concatMap(function (oldCheckout) { return _this.buildCartFromCheckout(oldCheckout); }), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
|
|
943
|
+
};
|
|
944
|
+
CartService.prototype.buildCartFromCheckout = function (checkoutData) {
|
|
945
|
+
var _this = this;
|
|
946
|
+
return this.checkoutService.getCheckout(checkoutData).pipe(operators.map(function (checkout) { return checkout.lineItems; }), operators.concatMap(function (lineItems) { return rxjs.of(_this.generateCartObject(lineItems)); }));
|
|
947
|
+
};
|
|
948
|
+
CartService.prototype.getProductData = function (productId) {
|
|
949
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
950
|
+
var product, variant, error_1;
|
|
951
|
+
return __generator(this, function (_h) {
|
|
952
|
+
switch (_h.label) {
|
|
953
|
+
case 0:
|
|
954
|
+
_h.trys.push([0, 2, , 5]);
|
|
955
|
+
return [4 /*yield*/, this.productRepository.get({ id: productId })];
|
|
956
|
+
case 1:
|
|
957
|
+
product = _h.sent();
|
|
958
|
+
return [3 /*break*/, 5];
|
|
959
|
+
case 2:
|
|
960
|
+
error_1 = _h.sent();
|
|
961
|
+
if (!(error_1 instanceof i3.NotFoundError))
|
|
962
|
+
throw error_1;
|
|
963
|
+
return [4 /*yield*/, this.variantRepository.get({ id: productId })];
|
|
964
|
+
case 3:
|
|
965
|
+
variant = _h.sent();
|
|
966
|
+
return [4 /*yield*/, this.productRepository.get({ id: variant.productId })];
|
|
967
|
+
case 4:
|
|
968
|
+
product = _h.sent();
|
|
969
|
+
return [3 /*break*/, 5];
|
|
970
|
+
case 5: return [2 /*return*/, Object.assign(Object.assign({}, product.toPlain()), (variant && Object.assign({}, variant.toPlain())))];
|
|
971
|
+
}
|
|
972
|
+
});
|
|
973
|
+
});
|
|
974
|
+
};
|
|
975
|
+
CartService.prototype.getGifts = function () {
|
|
976
|
+
var _this = this;
|
|
977
|
+
return this.checkoutService.getCheckout().pipe(operators.mergeMap(function (checkout) { return __awaiter(_this, void 0, void 0, function () {
|
|
978
|
+
var notGiftItems, cartTotal, campaigns, elegibleCampaigns, _loop_1, campaigns_1, campaigns_1_1, campaign, campaingnProducts, elegibleCampaigns_1, elegibleCampaigns_1_1, campaign, elegibleProducts, _h, _j, product, productData, gift, e_1_1, e_2_1, gifts;
|
|
979
|
+
var e_3, _k, e_2, _l, e_1, _m;
|
|
980
|
+
return __generator(this, function (_o) {
|
|
981
|
+
switch (_o.label) {
|
|
982
|
+
case 0:
|
|
983
|
+
notGiftItems = checkout.lineItems ? checkout.lineItems.filter(function (item) { return !item.isGift; }) : [];
|
|
984
|
+
if (!notGiftItems.length)
|
|
985
|
+
return [2 /*return*/, Object.assign(Object.assign({}, checkout), { lineItems: [] })];
|
|
986
|
+
cartTotal = notGiftItems.reduce(function (a, b) { return a + b.pricePaid * b.quantity; }, 0);
|
|
987
|
+
return [4 /*yield*/, this.buy2WinRepository
|
|
988
|
+
.find({
|
|
989
|
+
filters: {
|
|
990
|
+
active: { operator: i3.Where.EQUALS, value: true },
|
|
991
|
+
shop: { operator: i3.Where.EQUALS, value: this.defaultShop },
|
|
992
|
+
},
|
|
993
|
+
})
|
|
994
|
+
.then(function (data) { return data.data; })];
|
|
995
|
+
case 1:
|
|
996
|
+
campaigns = _o.sent();
|
|
997
|
+
if (!campaigns.length)
|
|
998
|
+
return [2 /*return*/, Object.assign(Object.assign({}, checkout), { lineItems: notGiftItems })];
|
|
999
|
+
elegibleCampaigns = [];
|
|
1000
|
+
_loop_1 = function (campaign) {
|
|
1001
|
+
var today = new Date();
|
|
1002
|
+
if (!(campaign.startDate <= today) && !(campaign.endDate >= today))
|
|
1003
|
+
return "continue";
|
|
1004
|
+
if (campaign.activeCategory) {
|
|
1005
|
+
var categoriesCampaing_1 = campaign.categories.map(function (c) { return c.id; });
|
|
1006
|
+
var filterProductsCategories = checkout.lineItems.filter(function (l) {
|
|
1007
|
+
var _a;
|
|
1008
|
+
if (!l.categories || !((_a = l.categories) === null || _a === void 0 ? void 0 : _a.length))
|
|
1009
|
+
return true;
|
|
1010
|
+
return l.categories.some(function (c) { return categoriesCampaing_1.some(function (cat) { return cat == c; }); });
|
|
1011
|
+
});
|
|
1012
|
+
if (filterProductsCategories.length) {
|
|
1013
|
+
var cartTotalCategories = filterProductsCategories.reduce(function (a, b) { return a + b.pricePaid * b.quantity; }, 0);
|
|
1014
|
+
if (cartTotalCategories >= campaign.cartValueMin)
|
|
1015
|
+
elegibleCampaigns.push(campaign);
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
else {
|
|
1019
|
+
if (campaign.cartValue && campaign.cartValue > 0) {
|
|
1020
|
+
if (campaign.cartValue <= cartTotal)
|
|
1021
|
+
elegibleCampaigns.push(campaign);
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
};
|
|
1025
|
+
try {
|
|
1026
|
+
for (campaigns_1 = __values(campaigns), campaigns_1_1 = campaigns_1.next(); !campaigns_1_1.done; campaigns_1_1 = campaigns_1.next()) {
|
|
1027
|
+
campaign = campaigns_1_1.value;
|
|
1028
|
+
_loop_1(campaign);
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
1032
|
+
finally {
|
|
1033
|
+
try {
|
|
1034
|
+
if (campaigns_1_1 && !campaigns_1_1.done && (_k = campaigns_1.return)) _k.call(campaigns_1);
|
|
1035
|
+
}
|
|
1036
|
+
finally { if (e_3) throw e_3.error; }
|
|
1037
|
+
}
|
|
1038
|
+
if (!elegibleCampaigns.length)
|
|
1039
|
+
return [2 /*return*/, Object.assign(Object.assign({}, checkout), { lineItems: notGiftItems })];
|
|
1040
|
+
campaingnProducts = [];
|
|
1041
|
+
_o.label = 2;
|
|
1042
|
+
case 2:
|
|
1043
|
+
_o.trys.push([2, 14, 15, 16]);
|
|
1044
|
+
elegibleCampaigns_1 = __values(elegibleCampaigns), elegibleCampaigns_1_1 = elegibleCampaigns_1.next();
|
|
1045
|
+
_o.label = 3;
|
|
1046
|
+
case 3:
|
|
1047
|
+
if (!!elegibleCampaigns_1_1.done) return [3 /*break*/, 13];
|
|
1048
|
+
campaign = elegibleCampaigns_1_1.value;
|
|
1049
|
+
elegibleProducts = [];
|
|
1050
|
+
_o.label = 4;
|
|
1051
|
+
case 4:
|
|
1052
|
+
_o.trys.push([4, 9, 10, 11]);
|
|
1053
|
+
_h = (e_1 = void 0, __values(campaign.products)), _j = _h.next();
|
|
1054
|
+
_o.label = 5;
|
|
1055
|
+
case 5:
|
|
1056
|
+
if (!!_j.done) return [3 /*break*/, 8];
|
|
1057
|
+
product = _j.value;
|
|
1058
|
+
return [4 /*yield*/, this.productRepository.find({ filters: { sku: product } })];
|
|
1059
|
+
case 6:
|
|
1060
|
+
productData = (_o.sent()).data;
|
|
1061
|
+
if (!productData.length)
|
|
1062
|
+
return [3 /*break*/, 7];
|
|
1063
|
+
gift = productData.shift();
|
|
1064
|
+
if (gift.stock.quantity < 1)
|
|
1065
|
+
return [3 /*break*/, 7];
|
|
1066
|
+
elegibleProducts.push(gift);
|
|
1067
|
+
_o.label = 7;
|
|
1068
|
+
case 7:
|
|
1069
|
+
_j = _h.next();
|
|
1070
|
+
return [3 /*break*/, 5];
|
|
1071
|
+
case 8: return [3 /*break*/, 11];
|
|
1072
|
+
case 9:
|
|
1073
|
+
e_1_1 = _o.sent();
|
|
1074
|
+
e_1 = { error: e_1_1 };
|
|
1075
|
+
return [3 /*break*/, 11];
|
|
1076
|
+
case 10:
|
|
1077
|
+
try {
|
|
1078
|
+
if (_j && !_j.done && (_m = _h.return)) _m.call(_h);
|
|
1079
|
+
}
|
|
1080
|
+
finally { if (e_1) throw e_1.error; }
|
|
1081
|
+
return [7 /*endfinally*/];
|
|
1082
|
+
case 11:
|
|
1083
|
+
campaingnProducts.push(elegibleProducts);
|
|
1084
|
+
_o.label = 12;
|
|
1085
|
+
case 12:
|
|
1086
|
+
elegibleCampaigns_1_1 = elegibleCampaigns_1.next();
|
|
1087
|
+
return [3 /*break*/, 3];
|
|
1088
|
+
case 13: return [3 /*break*/, 16];
|
|
1089
|
+
case 14:
|
|
1090
|
+
e_2_1 = _o.sent();
|
|
1091
|
+
e_2 = { error: e_2_1 };
|
|
1092
|
+
return [3 /*break*/, 16];
|
|
1093
|
+
case 15:
|
|
1094
|
+
try {
|
|
1095
|
+
if (elegibleCampaigns_1_1 && !elegibleCampaigns_1_1.done && (_l = elegibleCampaigns_1.return)) _l.call(elegibleCampaigns_1);
|
|
1096
|
+
}
|
|
1097
|
+
finally { if (e_2) throw e_2.error; }
|
|
1098
|
+
return [7 /*endfinally*/];
|
|
1099
|
+
case 16:
|
|
1100
|
+
if (!campaingnProducts.length)
|
|
1101
|
+
return [2 /*return*/, Object.assign(Object.assign({}, checkout), { lineItems: notGiftItems })];
|
|
1102
|
+
gifts = this.giftToLineItems([].concat.apply([], __spreadArray([], __read(campaingnProducts))));
|
|
1103
|
+
return [2 /*return*/, Object.assign(Object.assign({}, checkout), { lineItems: notGiftItems.concat(gifts) })];
|
|
1104
|
+
}
|
|
1105
|
+
});
|
|
1106
|
+
}); }), operators.concatMap(function (checkout) { return _this.checkoutService.updateCheckoutLineItems(checkout); }), operators.map(function (checkout) { return _this.generateCartObject(checkout.lineItems); }), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
|
|
1107
|
+
};
|
|
1108
|
+
CartService.prototype.giftToLineItems = function (items) {
|
|
1109
|
+
return items.map(function (item) {
|
|
1110
|
+
var _a;
|
|
1111
|
+
var brand = item.brand, categories = item.categories, id = item.id, name = item.name, price = item.price, sku = item.sku, slug = item.slug, stock = item.stock, weight = item.weight, EAN = item.EAN;
|
|
1112
|
+
var image = ((_a = item === null || item === void 0 ? void 0 : item.miniatures) === null || _a === void 0 ? void 0 : _a.length) ? item.miniatures[0] : item.images[0];
|
|
1113
|
+
return i3.LineItem.toInstance({
|
|
1114
|
+
brand: brand,
|
|
1115
|
+
categories: categories,
|
|
1116
|
+
id: id.toString(),
|
|
1117
|
+
name: name,
|
|
1118
|
+
price: price,
|
|
1119
|
+
sku: sku,
|
|
1120
|
+
slug: slug,
|
|
1121
|
+
stock: stock,
|
|
1122
|
+
weight: weight,
|
|
1123
|
+
EAN: EAN,
|
|
1124
|
+
image: image,
|
|
1125
|
+
pricePaid: 0,
|
|
1126
|
+
quantity: 1,
|
|
1127
|
+
isGift: true,
|
|
1128
|
+
});
|
|
1129
|
+
});
|
|
1130
|
+
};
|
|
1131
|
+
return CartService;
|
|
1132
|
+
}());
|
|
1133
|
+
CartService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CartService, deps: [{ token: AuthService }, { token: CheckoutService }, { token: DEFAULT_SHOP }, { token: 'ProductRepository' }, { token: 'VariantRepository' }, { token: 'Buy2WinRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1134
|
+
CartService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CartService });
|
|
1135
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CartService, decorators: [{
|
|
1136
|
+
type: i0.Injectable
|
|
1137
|
+
}], ctorParameters: function () {
|
|
1138
|
+
return [{ type: AuthService }, { type: CheckoutService }, { type: i3__namespace.Shops, decorators: [{
|
|
1139
|
+
type: i0.Inject,
|
|
1140
|
+
args: [DEFAULT_SHOP]
|
|
1141
|
+
}] }, { type: undefined, decorators: [{
|
|
1142
|
+
type: i0.Inject,
|
|
1143
|
+
args: ['ProductRepository']
|
|
1144
|
+
}] }, { type: undefined, decorators: [{
|
|
1145
|
+
type: i0.Inject,
|
|
1146
|
+
args: ['VariantRepository']
|
|
1147
|
+
}] }, { type: i3__namespace.Buy2WinFirestoreRepository, decorators: [{
|
|
1148
|
+
type: i0.Inject,
|
|
1149
|
+
args: ['Buy2WinRepository']
|
|
1150
|
+
}] }];
|
|
1242
1151
|
} });
|
|
1243
1152
|
|
|
1244
|
-
var CheckoutSubscriptionService = /** @class */ (function () {
|
|
1245
|
-
function CheckoutSubscriptionService(checkoutSubscriptionRepository, subscriptionRepository, couponService) {
|
|
1246
|
-
this.checkoutSubscriptionRepository = checkoutSubscriptionRepository;
|
|
1247
|
-
this.subscriptionRepository = subscriptionRepository;
|
|
1248
|
-
this.couponService = couponService;
|
|
1249
|
-
}
|
|
1250
|
-
CheckoutSubscriptionService.prototype.getCheckoutSubscription = function (checkoutData) {
|
|
1251
|
-
var checkoutId = cookie__default["default"].get('checkoutSubscriptionId');
|
|
1252
|
-
if (!i3.isNil(checkoutId))
|
|
1253
|
-
return rxjs.from(this.checkoutSubscriptionRepository.get({ id: checkoutId }));
|
|
1254
|
-
return rxjs.from(this.createCheckoutSubscription(checkoutData));
|
|
1255
|
-
};
|
|
1256
|
-
CheckoutSubscriptionService.prototype.createCheckoutSubscription = function (checkoutData) {
|
|
1257
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1258
|
-
var checkout;
|
|
1259
|
-
return __generator(this, function (_a) {
|
|
1260
|
-
switch (_a.label) {
|
|
1261
|
-
case 0: return [4 /*yield*/, this.checkoutSubscriptionRepository.create(Object.assign({ createdAt: new Date() }, i3.CheckoutSubscription.toInstance(i3.pick(checkoutData, ['user', 'shop'])).toPlain()))];
|
|
1262
|
-
case 1:
|
|
1263
|
-
checkout = _a.sent();
|
|
1264
|
-
cookie__default["default"].set('checkoutSubscriptionId', checkout.id);
|
|
1265
|
-
return [2 /*return*/, checkout];
|
|
1266
|
-
}
|
|
1267
|
-
});
|
|
1268
|
-
});
|
|
1269
|
-
};
|
|
1270
|
-
CheckoutSubscriptionService.prototype.clearCheckoutSubscriptionFromSession = function () {
|
|
1271
|
-
cookie__default["default"].remove('checkoutSubscriptionId');
|
|
1272
|
-
return rxjs.of();
|
|
1273
|
-
};
|
|
1274
|
-
CheckoutSubscriptionService.prototype.checkCoupon = function (nickname, userEmail) {
|
|
1275
|
-
var _this = this;
|
|
1276
|
-
return this.getCheckoutSubscription().pipe(operators.concatMap(function (checkout) { return _this.couponService
|
|
1277
|
-
.checkCoupon(nickname,
|
|
1278
|
-
.pipe(); }));
|
|
1279
|
-
};
|
|
1280
|
-
CheckoutSubscriptionService.prototype.calcDiscountSubscription = function (coupon) {
|
|
1281
|
-
var _this = this;
|
|
1282
|
-
return this.getCheckoutSubscription().pipe(operators.concatMap(function (checkout) { return _this.couponService.calcDiscountSubscription(coupon, checkout).pipe(); }));
|
|
1283
|
-
};
|
|
1284
|
-
return CheckoutSubscriptionService;
|
|
1285
|
-
}());
|
|
1286
|
-
CheckoutSubscriptionService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CheckoutSubscriptionService, deps: [{ token: 'CheckoutSubscriptionRepository' }, { token: 'SubscriptionRepository' }, { token: CouponService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1287
|
-
CheckoutSubscriptionService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CheckoutSubscriptionService });
|
|
1288
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CheckoutSubscriptionService, decorators: [{
|
|
1289
|
-
type: i0.Injectable
|
|
1290
|
-
}], ctorParameters: function () {
|
|
1291
|
-
return [{ type: undefined, decorators: [{
|
|
1292
|
-
type: i0.Inject,
|
|
1293
|
-
args: ['CheckoutSubscriptionRepository']
|
|
1294
|
-
}] }, { type: undefined, decorators: [{
|
|
1295
|
-
type: i0.Inject,
|
|
1296
|
-
args: ['SubscriptionRepository']
|
|
1297
|
-
}] }, { type: CouponService }];
|
|
1153
|
+
var CheckoutSubscriptionService = /** @class */ (function () {
|
|
1154
|
+
function CheckoutSubscriptionService(checkoutSubscriptionRepository, subscriptionRepository, couponService) {
|
|
1155
|
+
this.checkoutSubscriptionRepository = checkoutSubscriptionRepository;
|
|
1156
|
+
this.subscriptionRepository = subscriptionRepository;
|
|
1157
|
+
this.couponService = couponService;
|
|
1158
|
+
}
|
|
1159
|
+
CheckoutSubscriptionService.prototype.getCheckoutSubscription = function (checkoutData) {
|
|
1160
|
+
var checkoutId = cookie__default["default"].get('checkoutSubscriptionId');
|
|
1161
|
+
if (!i3.isNil(checkoutId))
|
|
1162
|
+
return rxjs.from(this.checkoutSubscriptionRepository.get({ id: checkoutId }));
|
|
1163
|
+
return rxjs.from(this.createCheckoutSubscription(checkoutData));
|
|
1164
|
+
};
|
|
1165
|
+
CheckoutSubscriptionService.prototype.createCheckoutSubscription = function (checkoutData) {
|
|
1166
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1167
|
+
var checkout;
|
|
1168
|
+
return __generator(this, function (_a) {
|
|
1169
|
+
switch (_a.label) {
|
|
1170
|
+
case 0: return [4 /*yield*/, this.checkoutSubscriptionRepository.create(Object.assign({ createdAt: new Date() }, i3.CheckoutSubscription.toInstance(i3.pick(checkoutData, ['user', 'shop'])).toPlain()))];
|
|
1171
|
+
case 1:
|
|
1172
|
+
checkout = _a.sent();
|
|
1173
|
+
cookie__default["default"].set('checkoutSubscriptionId', checkout.id);
|
|
1174
|
+
return [2 /*return*/, checkout];
|
|
1175
|
+
}
|
|
1176
|
+
});
|
|
1177
|
+
});
|
|
1178
|
+
};
|
|
1179
|
+
CheckoutSubscriptionService.prototype.clearCheckoutSubscriptionFromSession = function () {
|
|
1180
|
+
cookie__default["default"].remove('checkoutSubscriptionId');
|
|
1181
|
+
return rxjs.of();
|
|
1182
|
+
};
|
|
1183
|
+
CheckoutSubscriptionService.prototype.checkCoupon = function (nickname, userEmail) {
|
|
1184
|
+
var _this = this;
|
|
1185
|
+
return this.getCheckoutSubscription().pipe(operators.concatMap(function (checkout) { return _this.couponService
|
|
1186
|
+
.checkCoupon(nickname, i3.CheckoutTypes.SUBSCRIPTION, checkout, checkout.subscriptionPlan.name)
|
|
1187
|
+
.pipe(); }));
|
|
1188
|
+
};
|
|
1189
|
+
CheckoutSubscriptionService.prototype.calcDiscountSubscription = function (coupon) {
|
|
1190
|
+
var _this = this;
|
|
1191
|
+
return this.getCheckoutSubscription().pipe(operators.concatMap(function (checkout) { return _this.couponService.calcDiscountSubscription(coupon, checkout).pipe(); }));
|
|
1192
|
+
};
|
|
1193
|
+
return CheckoutSubscriptionService;
|
|
1194
|
+
}());
|
|
1195
|
+
CheckoutSubscriptionService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CheckoutSubscriptionService, deps: [{ token: 'CheckoutSubscriptionRepository' }, { token: 'SubscriptionRepository' }, { token: CouponService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1196
|
+
CheckoutSubscriptionService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CheckoutSubscriptionService });
|
|
1197
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CheckoutSubscriptionService, decorators: [{
|
|
1198
|
+
type: i0.Injectable
|
|
1199
|
+
}], ctorParameters: function () {
|
|
1200
|
+
return [{ type: undefined, decorators: [{
|
|
1201
|
+
type: i0.Inject,
|
|
1202
|
+
args: ['CheckoutSubscriptionRepository']
|
|
1203
|
+
}] }, { type: undefined, decorators: [{
|
|
1204
|
+
type: i0.Inject,
|
|
1205
|
+
args: ['SubscriptionRepository']
|
|
1206
|
+
}] }, { type: CouponService }];
|
|
1298
1207
|
} });
|
|
1299
1208
|
|
|
1300
|
-
var HomeShopService = /** @class */ (function () {
|
|
1301
|
-
function HomeShopService(categoryRepository, homeRepository, productRepository, defaultShop) {
|
|
1302
|
-
this.categoryRepository = categoryRepository;
|
|
1303
|
-
this.homeRepository = homeRepository;
|
|
1304
|
-
this.productRepository = productRepository;
|
|
1305
|
-
this.defaultShop = defaultShop;
|
|
1306
|
-
this.buildCategoryGroupWithRequiredData = function (group) {
|
|
1307
|
-
var _a, _b;
|
|
1308
|
-
return ({
|
|
1309
|
-
category: i3.Category.toInstance(i3.pick(((_a = group === null || group === void 0 ? void 0 : group.category) === null || _a === void 0 ? void 0 : _a.toPlain()) || {}, ['id', 'name', 'slug', 'conditions'])),
|
|
1310
|
-
products: ((_b = group === null || group === void 0 ? void 0 : group.products) === null || _b === void 0 ? void 0 : _b.map(function (product) { return i3.Product.toInstance(i3.pick((product === null || product === void 0 ? void 0 : product.toPlain()) || {}, [
|
|
1311
|
-
'id',
|
|
1312
|
-
'price',
|
|
1313
|
-
'reviews',
|
|
1314
|
-
'hasVariants',
|
|
1315
|
-
'slug',
|
|
1316
|
-
'sku',
|
|
1317
|
-
'stock',
|
|
1318
|
-
'costPrice',
|
|
1319
|
-
'images',
|
|
1320
|
-
'miniatures',
|
|
1321
|
-
'name',
|
|
1322
|
-
'weight',
|
|
1323
|
-
'rate',
|
|
1324
|
-
'type',
|
|
1325
|
-
])); })) || [],
|
|
1326
|
-
});
|
|
1327
|
-
};
|
|
1328
|
-
}
|
|
1329
|
-
Object.defineProperty(HomeShopService.prototype, "homeId", {
|
|
1330
|
-
get: function () {
|
|
1331
|
-
if (this.defaultShop === i3.Shops.GLAMSHOP)
|
|
1332
|
-
return 'glamshop';
|
|
1333
|
-
if (this.defaultShop === i3.Shops.MENSMARKET)
|
|
1334
|
-
return 'mens_market';
|
|
1335
|
-
return null;
|
|
1336
|
-
},
|
|
1337
|
-
enumerable: false,
|
|
1338
|
-
configurable: true
|
|
1339
|
-
});
|
|
1340
|
-
HomeShopService.prototype.getHomeData = function () {
|
|
1341
|
-
var _this = this;
|
|
1342
|
-
return this.getHomeConfiguration().pipe(operators.map(function (home) { var _a; return (((_a = home === null || home === void 0 ? void 0 : home.data) === null || _a === void 0 ? void 0 : _a.expiresAt) > new Date() ? home : null); }), operators.concatMap(function (home) { return home
|
|
1343
|
-
? rxjs.of(home)
|
|
1344
|
-
: rxjs.forkJoin([_this.getDiscoverProducts(), _this.getFeaturedProducts(), _this.getVerticalProducts()]).pipe(operators.map(function (_c) {
|
|
1345
|
-
var _d = __read(_c, 3), discoverProducts = _d[0], featuredProducts = _d[1], verticalProducts = _d[2];
|
|
1346
|
-
return ({
|
|
1347
|
-
discoverProducts: discoverProducts,
|
|
1348
|
-
featuredProducts: featuredProducts,
|
|
1349
|
-
verticalProducts: verticalProducts,
|
|
1350
|
-
});
|
|
1351
|
-
}), operators.concatMap(function (data) { return _this.saveHomeData(data); })); }));
|
|
1352
|
-
};
|
|
1353
|
-
HomeShopService.prototype.getBanners = function (type) {
|
|
1354
|
-
return this.getHomeConfiguration().pipe(operators.map(function (home) {
|
|
1355
|
-
if (type === 'brand')
|
|
1356
|
-
return home.brandsCarousel;
|
|
1357
|
-
if (type === 'buyToWin')
|
|
1358
|
-
return [home.buyToWinBanner];
|
|
1359
|
-
if (type === 'block')
|
|
1360
|
-
return home.blockBanners;
|
|
1361
|
-
if (type === 'blog')
|
|
1362
|
-
return [home.blogBanner];
|
|
1363
|
-
}));
|
|
1364
|
-
};
|
|
1365
|
-
HomeShopService.prototype.getMinValueForFreeShipping = function () {
|
|
1366
|
-
return this.getHomeConfiguration().pipe(operators.map(function (home) { return home.minValueForFreeShipping; }));
|
|
1367
|
-
};
|
|
1368
|
-
HomeShopService.prototype.getDiscoverProducts = function () {
|
|
1369
|
-
var _this = this;
|
|
1370
|
-
return this.getHomeConfiguration().pipe(operators.concatMap(function (home) { return rxjs.from(_this.categoryRepository.getCategoriesForHome(home.discoverCategories)).pipe(operators.map(function (groups) { return groups.map(_this.buildCategoryGroupWithRequiredData); })); }));
|
|
1371
|
-
};
|
|
1372
|
-
HomeShopService.prototype.getFeaturedProducts = function () {
|
|
1373
|
-
var _this = this;
|
|
1374
|
-
return this.getHomeConfiguration().pipe(operators.concatMap(function (home) { return rxjs.from(_this.categoryRepository.getCategoriesForHome(home.featuredCategories)).pipe(operators.map(function (groups) { return groups.map(_this.buildCategoryGroupWithRequiredData); })); }));
|
|
1375
|
-
};
|
|
1376
|
-
HomeShopService.prototype.getVerticalProducts = function () {
|
|
1377
|
-
var _this = this;
|
|
1378
|
-
return this.getHomeConfiguration().pipe(operators.concatMap(function (home) { return rxjs.forkJoin(home.verticalCarousels.filter(Boolean).map(function (id) { return rxjs.from(_this.categoryRepository.get({ id: id })).pipe(operators.concatMap(function (category) { return rxjs.from(_this.productRepository.find({
|
|
1379
|
-
filters: { categories: { operator: i3.Where.IN, value: [category.id] } },
|
|
1380
|
-
limits: { limit: 12 },
|
|
1381
|
-
})).pipe(operators.map(function (products) { return ({ category: category, products: products }); })); }), operators.map(function (_c) {
|
|
1382
|
-
var category = _c.category, products = _c.products;
|
|
1383
|
-
return ({ category: category, products: products.data });
|
|
1384
|
-
}), operators.map(_this.buildCategoryGroupWithRequiredData)); })); }));
|
|
1385
|
-
};
|
|
1386
|
-
HomeShopService.prototype.getHomeConfiguration = function () {
|
|
1387
|
-
var _this = this;
|
|
1388
|
-
return rxjs.of(this.homeConfiguration).pipe(operators.concatMap(function (home) { return home
|
|
1389
|
-
? rxjs.of(home)
|
|
1390
|
-
: !_this.homeId
|
|
1391
|
-
? rxjs.throwError(new i3.RequiredArgumentError(['homeId']))
|
|
1392
|
-
: rxjs.from(_this.homeRepository.get({ id: _this.homeId })).pipe(operators.tap(function (homeLoaded) { return (_this.homeConfiguration = homeLoaded); })); }));
|
|
1393
|
-
};
|
|
1394
|
-
HomeShopService.prototype.saveHomeData = function (homeData) {
|
|
1395
|
-
var _this = this;
|
|
1396
|
-
var data = {
|
|
1397
|
-
createdAt: new Date(),
|
|
1398
|
-
expiresAt: i3.add(new Date(), { hours: 1 }),
|
|
1399
|
-
data: homeData,
|
|
1400
|
-
};
|
|
1401
|
-
return rxjs.from(this.homeRepository.update({
|
|
1402
|
-
id: this.homeId,
|
|
1403
|
-
data: data,
|
|
1404
|
-
})).pipe(operators.tap(function () { return (_this.homeConfiguration.data = data); }), operators.map(function () { return _this.homeConfiguration; }));
|
|
1405
|
-
};
|
|
1406
|
-
return HomeShopService;
|
|
1407
|
-
}());
|
|
1408
|
-
HomeShopService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: HomeShopService, deps: [{ token: 'CategoryRepository' }, { token: 'HomeRepository' }, { token: 'ProductRepository' }, { token: DEFAULT_SHOP }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1409
|
-
HomeShopService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: HomeShopService });
|
|
1410
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: HomeShopService, decorators: [{
|
|
1411
|
-
type: i0.Injectable
|
|
1412
|
-
}], ctorParameters: function () {
|
|
1413
|
-
return [{ type: undefined, decorators: [{
|
|
1414
|
-
type: i0.Inject,
|
|
1415
|
-
args: ['CategoryRepository']
|
|
1416
|
-
}] }, { type: undefined, decorators: [{
|
|
1417
|
-
type: i0.Inject,
|
|
1418
|
-
args: ['HomeRepository']
|
|
1419
|
-
}] }, { type: undefined, decorators: [{
|
|
1420
|
-
type: i0.Inject,
|
|
1421
|
-
args: ['ProductRepository']
|
|
1422
|
-
}] }, { type: i3__namespace.Shops, decorators: [{
|
|
1423
|
-
type: i0.Inject,
|
|
1424
|
-
args: [DEFAULT_SHOP]
|
|
1425
|
-
}] }];
|
|
1209
|
+
var HomeShopService = /** @class */ (function () {
|
|
1210
|
+
function HomeShopService(categoryRepository, homeRepository, productRepository, defaultShop) {
|
|
1211
|
+
this.categoryRepository = categoryRepository;
|
|
1212
|
+
this.homeRepository = homeRepository;
|
|
1213
|
+
this.productRepository = productRepository;
|
|
1214
|
+
this.defaultShop = defaultShop;
|
|
1215
|
+
this.buildCategoryGroupWithRequiredData = function (group) {
|
|
1216
|
+
var _a, _b;
|
|
1217
|
+
return ({
|
|
1218
|
+
category: i3.Category.toInstance(i3.pick(((_a = group === null || group === void 0 ? void 0 : group.category) === null || _a === void 0 ? void 0 : _a.toPlain()) || {}, ['id', 'name', 'slug', 'conditions'])),
|
|
1219
|
+
products: ((_b = group === null || group === void 0 ? void 0 : group.products) === null || _b === void 0 ? void 0 : _b.map(function (product) { return i3.Product.toInstance(i3.pick((product === null || product === void 0 ? void 0 : product.toPlain()) || {}, [
|
|
1220
|
+
'id',
|
|
1221
|
+
'price',
|
|
1222
|
+
'reviews',
|
|
1223
|
+
'hasVariants',
|
|
1224
|
+
'slug',
|
|
1225
|
+
'sku',
|
|
1226
|
+
'stock',
|
|
1227
|
+
'costPrice',
|
|
1228
|
+
'images',
|
|
1229
|
+
'miniatures',
|
|
1230
|
+
'name',
|
|
1231
|
+
'weight',
|
|
1232
|
+
'rate',
|
|
1233
|
+
'type',
|
|
1234
|
+
])); })) || [],
|
|
1235
|
+
});
|
|
1236
|
+
};
|
|
1237
|
+
}
|
|
1238
|
+
Object.defineProperty(HomeShopService.prototype, "homeId", {
|
|
1239
|
+
get: function () {
|
|
1240
|
+
if (this.defaultShop === i3.Shops.GLAMSHOP)
|
|
1241
|
+
return 'glamshop';
|
|
1242
|
+
if (this.defaultShop === i3.Shops.MENSMARKET)
|
|
1243
|
+
return 'mens_market';
|
|
1244
|
+
return null;
|
|
1245
|
+
},
|
|
1246
|
+
enumerable: false,
|
|
1247
|
+
configurable: true
|
|
1248
|
+
});
|
|
1249
|
+
HomeShopService.prototype.getHomeData = function () {
|
|
1250
|
+
var _this = this;
|
|
1251
|
+
return this.getHomeConfiguration().pipe(operators.map(function (home) { var _a; return (((_a = home === null || home === void 0 ? void 0 : home.data) === null || _a === void 0 ? void 0 : _a.expiresAt) > new Date() ? home : null); }), operators.concatMap(function (home) { return home
|
|
1252
|
+
? rxjs.of(home)
|
|
1253
|
+
: rxjs.forkJoin([_this.getDiscoverProducts(), _this.getFeaturedProducts(), _this.getVerticalProducts()]).pipe(operators.map(function (_c) {
|
|
1254
|
+
var _d = __read(_c, 3), discoverProducts = _d[0], featuredProducts = _d[1], verticalProducts = _d[2];
|
|
1255
|
+
return ({
|
|
1256
|
+
discoverProducts: discoverProducts,
|
|
1257
|
+
featuredProducts: featuredProducts,
|
|
1258
|
+
verticalProducts: verticalProducts,
|
|
1259
|
+
});
|
|
1260
|
+
}), operators.concatMap(function (data) { return _this.saveHomeData(data); })); }));
|
|
1261
|
+
};
|
|
1262
|
+
HomeShopService.prototype.getBanners = function (type) {
|
|
1263
|
+
return this.getHomeConfiguration().pipe(operators.map(function (home) {
|
|
1264
|
+
if (type === 'brand')
|
|
1265
|
+
return home.brandsCarousel;
|
|
1266
|
+
if (type === 'buyToWin')
|
|
1267
|
+
return [home.buyToWinBanner];
|
|
1268
|
+
if (type === 'block')
|
|
1269
|
+
return home.blockBanners;
|
|
1270
|
+
if (type === 'blog')
|
|
1271
|
+
return [home.blogBanner];
|
|
1272
|
+
}));
|
|
1273
|
+
};
|
|
1274
|
+
HomeShopService.prototype.getMinValueForFreeShipping = function () {
|
|
1275
|
+
return this.getHomeConfiguration().pipe(operators.map(function (home) { return home.minValueForFreeShipping; }));
|
|
1276
|
+
};
|
|
1277
|
+
HomeShopService.prototype.getDiscoverProducts = function () {
|
|
1278
|
+
var _this = this;
|
|
1279
|
+
return this.getHomeConfiguration().pipe(operators.concatMap(function (home) { return rxjs.from(_this.categoryRepository.getCategoriesForHome(home.discoverCategories)).pipe(operators.map(function (groups) { return groups.map(_this.buildCategoryGroupWithRequiredData); })); }));
|
|
1280
|
+
};
|
|
1281
|
+
HomeShopService.prototype.getFeaturedProducts = function () {
|
|
1282
|
+
var _this = this;
|
|
1283
|
+
return this.getHomeConfiguration().pipe(operators.concatMap(function (home) { return rxjs.from(_this.categoryRepository.getCategoriesForHome(home.featuredCategories)).pipe(operators.map(function (groups) { return groups.map(_this.buildCategoryGroupWithRequiredData); })); }));
|
|
1284
|
+
};
|
|
1285
|
+
HomeShopService.prototype.getVerticalProducts = function () {
|
|
1286
|
+
var _this = this;
|
|
1287
|
+
return this.getHomeConfiguration().pipe(operators.concatMap(function (home) { return rxjs.forkJoin(home.verticalCarousels.filter(Boolean).map(function (id) { return rxjs.from(_this.categoryRepository.get({ id: id })).pipe(operators.concatMap(function (category) { return rxjs.from(_this.productRepository.find({
|
|
1288
|
+
filters: { categories: { operator: i3.Where.IN, value: [category.id] } },
|
|
1289
|
+
limits: { limit: 12 },
|
|
1290
|
+
})).pipe(operators.map(function (products) { return ({ category: category, products: products }); })); }), operators.map(function (_c) {
|
|
1291
|
+
var category = _c.category, products = _c.products;
|
|
1292
|
+
return ({ category: category, products: products.data });
|
|
1293
|
+
}), operators.map(_this.buildCategoryGroupWithRequiredData)); })); }));
|
|
1294
|
+
};
|
|
1295
|
+
HomeShopService.prototype.getHomeConfiguration = function () {
|
|
1296
|
+
var _this = this;
|
|
1297
|
+
return rxjs.of(this.homeConfiguration).pipe(operators.concatMap(function (home) { return home
|
|
1298
|
+
? rxjs.of(home)
|
|
1299
|
+
: !_this.homeId
|
|
1300
|
+
? rxjs.throwError(new i3.RequiredArgumentError(['homeId']))
|
|
1301
|
+
: rxjs.from(_this.homeRepository.get({ id: _this.homeId })).pipe(operators.tap(function (homeLoaded) { return (_this.homeConfiguration = homeLoaded); })); }));
|
|
1302
|
+
};
|
|
1303
|
+
HomeShopService.prototype.saveHomeData = function (homeData) {
|
|
1304
|
+
var _this = this;
|
|
1305
|
+
var data = {
|
|
1306
|
+
createdAt: new Date(),
|
|
1307
|
+
expiresAt: i3.add(new Date(), { hours: 1 }),
|
|
1308
|
+
data: homeData,
|
|
1309
|
+
};
|
|
1310
|
+
return rxjs.from(this.homeRepository.update({
|
|
1311
|
+
id: this.homeId,
|
|
1312
|
+
data: data,
|
|
1313
|
+
})).pipe(operators.tap(function () { return (_this.homeConfiguration.data = data); }), operators.map(function () { return _this.homeConfiguration; }));
|
|
1314
|
+
};
|
|
1315
|
+
return HomeShopService;
|
|
1316
|
+
}());
|
|
1317
|
+
HomeShopService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: HomeShopService, deps: [{ token: 'CategoryRepository' }, { token: 'HomeRepository' }, { token: 'ProductRepository' }, { token: DEFAULT_SHOP }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1318
|
+
HomeShopService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: HomeShopService });
|
|
1319
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: HomeShopService, decorators: [{
|
|
1320
|
+
type: i0.Injectable
|
|
1321
|
+
}], ctorParameters: function () {
|
|
1322
|
+
return [{ type: undefined, decorators: [{
|
|
1323
|
+
type: i0.Inject,
|
|
1324
|
+
args: ['CategoryRepository']
|
|
1325
|
+
}] }, { type: undefined, decorators: [{
|
|
1326
|
+
type: i0.Inject,
|
|
1327
|
+
args: ['HomeRepository']
|
|
1328
|
+
}] }, { type: undefined, decorators: [{
|
|
1329
|
+
type: i0.Inject,
|
|
1330
|
+
args: ['ProductRepository']
|
|
1331
|
+
}] }, { type: i3__namespace.Shops, decorators: [{
|
|
1332
|
+
type: i0.Inject,
|
|
1333
|
+
args: [DEFAULT_SHOP]
|
|
1334
|
+
}] }];
|
|
1426
1335
|
} });
|
|
1427
1336
|
|
|
1428
|
-
var OrderService = /** @class */ (function () {
|
|
1429
|
-
function OrderService(angularFirestore, orderRepository) {
|
|
1430
|
-
this.angularFirestore = angularFirestore;
|
|
1431
|
-
this.orderRepository = orderRepository;
|
|
1432
|
-
this.orderSubject = new rxjs.Subject();
|
|
1433
|
-
}
|
|
1434
|
-
OrderService.prototype.getOrder = function (id) {
|
|
1435
|
-
var _this = this;
|
|
1436
|
-
this.angularFirestore
|
|
1437
|
-
.doc(this.orderRepository.collectionName + "/" + id)
|
|
1438
|
-
.valueChanges()
|
|
1439
|
-
.pipe(operators.map(function (doc) { return i3.Order.toInstance(doc); }))
|
|
1440
|
-
.subscribe(function (doc) { return _this.orderSubject.next(doc); });
|
|
1441
|
-
return this.orderSubject;
|
|
1442
|
-
};
|
|
1443
|
-
return OrderService;
|
|
1444
|
-
}());
|
|
1445
|
-
OrderService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService, deps: [{ token: i1__namespace$1.AngularFirestore }, { token: 'OrderRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1446
|
-
OrderService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService });
|
|
1447
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService, decorators: [{
|
|
1448
|
-
type: i0.Injectable
|
|
1449
|
-
}], ctorParameters: function () {
|
|
1450
|
-
return [{ type: i1__namespace$1.AngularFirestore }, { type: i3__namespace.OrderFirestoreRepository, decorators: [{
|
|
1451
|
-
type: i0.Inject,
|
|
1452
|
-
args: ['OrderRepository']
|
|
1453
|
-
}] }];
|
|
1337
|
+
var OrderService = /** @class */ (function () {
|
|
1338
|
+
function OrderService(angularFirestore, orderRepository) {
|
|
1339
|
+
this.angularFirestore = angularFirestore;
|
|
1340
|
+
this.orderRepository = orderRepository;
|
|
1341
|
+
this.orderSubject = new rxjs.Subject();
|
|
1342
|
+
}
|
|
1343
|
+
OrderService.prototype.getOrder = function (id) {
|
|
1344
|
+
var _this = this;
|
|
1345
|
+
this.angularFirestore
|
|
1346
|
+
.doc(this.orderRepository.collectionName + "/" + id)
|
|
1347
|
+
.valueChanges()
|
|
1348
|
+
.pipe(operators.map(function (doc) { return i3.Order.toInstance(doc); }))
|
|
1349
|
+
.subscribe(function (doc) { return _this.orderSubject.next(doc); });
|
|
1350
|
+
return this.orderSubject;
|
|
1351
|
+
};
|
|
1352
|
+
return OrderService;
|
|
1353
|
+
}());
|
|
1354
|
+
OrderService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService, deps: [{ token: i1__namespace$1.AngularFirestore }, { token: 'OrderRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1355
|
+
OrderService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService });
|
|
1356
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService, decorators: [{
|
|
1357
|
+
type: i0.Injectable
|
|
1358
|
+
}], ctorParameters: function () {
|
|
1359
|
+
return [{ type: i1__namespace$1.AngularFirestore }, { type: i3__namespace.OrderFirestoreRepository, decorators: [{
|
|
1360
|
+
type: i0.Inject,
|
|
1361
|
+
args: ['OrderRepository']
|
|
1362
|
+
}] }];
|
|
1454
1363
|
} });
|
|
1455
1364
|
|
|
1456
|
-
var ShippingService = /** @class */ (function () {
|
|
1457
|
-
function ShippingService(http, apiUrl, homeService) {
|
|
1458
|
-
this.http = http;
|
|
1459
|
-
this.apiUrl = apiUrl;
|
|
1460
|
-
this.homeService = homeService;
|
|
1461
|
-
}
|
|
1462
|
-
ShippingService.prototype.getShippingMethods = function (shop, zip, weightGrams, totalPrice, personId, subscriptionPlan) {
|
|
1463
|
-
var _this = this;
|
|
1464
|
-
return rxjs.combineLatest([
|
|
1465
|
-
this.homeService.getHomeData(),
|
|
1466
|
-
this.http.get(this.apiUrl + "open/checkshippingcompany?personId=" + personId + "&postalCode=" + zip + "&weightGrams=" + weightGrams),
|
|
1467
|
-
]).pipe(operators.map(function (_a) {
|
|
1468
|
-
var _b = __read(_a, 2), datas = _b[0], shippingMethodsResponse = _b[1];
|
|
1469
|
-
var shippingMethods = shippingMethodsResponse.result;
|
|
1470
|
-
if (!shippingMethods.length)
|
|
1471
|
-
return [];
|
|
1472
|
-
shippingMethods = shippingMethods.map(function (s) {
|
|
1473
|
-
if (s.ShippingCompanyName == 'Same Day EG')
|
|
1474
|
-
s.ShippingCompanyName = 'Same Day';
|
|
1475
|
-
else
|
|
1476
|
-
return s;
|
|
1477
|
-
});
|
|
1478
|
-
var datasSameDayNotAvaliable = datas.sameDayNotAvaliable;
|
|
1479
|
-
if (_this.isHolidays(datasSameDayNotAvaliable)) {
|
|
1480
|
-
shippingMethods = shippingMethods.filter(function (method) { return method.serviceName !== 'Same Day'; });
|
|
1481
|
-
}
|
|
1482
|
-
if (totalPrice >= 200) {
|
|
1483
|
-
shippingMethods = shippingMethods.map(function (s) {
|
|
1484
|
-
if (s.serviceName !== 'Same Day')
|
|
1485
|
-
return Object.assign(Object.assign({}, s), { totalPrice: 0 });
|
|
1486
|
-
else
|
|
1487
|
-
return s;
|
|
1488
|
-
});
|
|
1489
|
-
}
|
|
1490
|
-
if (shop == i3.Shops.GLAMSHOP)
|
|
1491
|
-
return shippingMethods;
|
|
1492
|
-
if (_this.isFreeShippingBySubscription(shop, subscriptionPlan)) {
|
|
1493
|
-
shippingMethods = shippingMethods.map(function (s) {
|
|
1494
|
-
if (s.serviceName == 'Same Day')
|
|
1495
|
-
return Object.assign(Object.assign({}, s), { totalPrice: s.totalPrice / 2 });
|
|
1496
|
-
else
|
|
1497
|
-
return Object.assign(Object.assign({}, s), { totalPrice: 0 });
|
|
1498
|
-
});
|
|
1499
|
-
}
|
|
1500
|
-
if (_this.isHalfShippingBySubscription(shop, subscriptionPlan)) {
|
|
1501
|
-
shippingMethods = shippingMethods.map(function (s) {
|
|
1502
|
-
return Object.assign(Object.assign({}, s), { totalPrice: s.totalPrice / 2 });
|
|
1503
|
-
});
|
|
1504
|
-
}
|
|
1505
|
-
return shippingMethods;
|
|
1506
|
-
}));
|
|
1507
|
-
};
|
|
1508
|
-
ShippingService.prototype.isFreeShippingBySubscription = function (shop, subscriptionPlan) {
|
|
1509
|
-
if (!subscriptionPlan)
|
|
1510
|
-
return false;
|
|
1511
|
-
if (shop == i3.Shops.MENSMARKET && subscriptionPlan == 'SELECT') {
|
|
1512
|
-
return true;
|
|
1513
|
-
}
|
|
1514
|
-
return false;
|
|
1515
|
-
};
|
|
1516
|
-
ShippingService.prototype.isHalfShippingBySubscription = function (shop, subscriptionPlan) {
|
|
1517
|
-
if (!subscriptionPlan)
|
|
1518
|
-
return false;
|
|
1519
|
-
if (shop == i3.Shops.MENSMARKET && subscriptionPlan == 'PRIME') {
|
|
1520
|
-
return true;
|
|
1521
|
-
}
|
|
1522
|
-
return false;
|
|
1523
|
-
};
|
|
1524
|
-
ShippingService.prototype.isHolidays = function (datas) {
|
|
1525
|
-
var today = new Date();
|
|
1526
|
-
for (var key in datas) {
|
|
1527
|
-
var start = new Date(today.getFullYear() + "-" + datas[key].beginDate);
|
|
1528
|
-
var end = new Date(today.getFullYear() + "-" + datas[key].endDate);
|
|
1529
|
-
if (start > end)
|
|
1530
|
-
end = new Date(today.getFullYear() + 1 + "-" + datas[key].endDate);
|
|
1531
|
-
if (today >= start && today <= end)
|
|
1532
|
-
return true;
|
|
1533
|
-
}
|
|
1534
|
-
return false;
|
|
1535
|
-
};
|
|
1536
|
-
return ShippingService;
|
|
1537
|
-
}());
|
|
1538
|
-
ShippingService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService, deps: [{ token: i1__namespace$2.HttpClient }, { token: BACKEND_URL }, { token: HomeShopService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1539
|
-
ShippingService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService });
|
|
1540
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService, decorators: [{
|
|
1541
|
-
type: i0.Injectable
|
|
1542
|
-
}], ctorParameters: function () {
|
|
1543
|
-
return [{ type: i1__namespace$2.HttpClient }, { type: undefined, decorators: [{
|
|
1544
|
-
type: i0.Inject,
|
|
1545
|
-
args: [BACKEND_URL]
|
|
1546
|
-
}] }, { type: HomeShopService }];
|
|
1365
|
+
var ShippingService = /** @class */ (function () {
|
|
1366
|
+
function ShippingService(http, apiUrl, homeService) {
|
|
1367
|
+
this.http = http;
|
|
1368
|
+
this.apiUrl = apiUrl;
|
|
1369
|
+
this.homeService = homeService;
|
|
1370
|
+
}
|
|
1371
|
+
ShippingService.prototype.getShippingMethods = function (shop, zip, weightGrams, totalPrice, personId, subscriptionPlan) {
|
|
1372
|
+
var _this = this;
|
|
1373
|
+
return rxjs.combineLatest([
|
|
1374
|
+
this.homeService.getHomeData(),
|
|
1375
|
+
this.http.get(this.apiUrl + "open/checkshippingcompany?personId=" + personId + "&postalCode=" + zip + "&weightGrams=" + weightGrams),
|
|
1376
|
+
]).pipe(operators.map(function (_a) {
|
|
1377
|
+
var _b = __read(_a, 2), datas = _b[0], shippingMethodsResponse = _b[1];
|
|
1378
|
+
var shippingMethods = shippingMethodsResponse.result;
|
|
1379
|
+
if (!shippingMethods.length)
|
|
1380
|
+
return [];
|
|
1381
|
+
shippingMethods = shippingMethods.map(function (s) {
|
|
1382
|
+
if (s.ShippingCompanyName == 'Same Day EG')
|
|
1383
|
+
s.ShippingCompanyName = 'Same Day';
|
|
1384
|
+
else
|
|
1385
|
+
return s;
|
|
1386
|
+
});
|
|
1387
|
+
var datasSameDayNotAvaliable = datas.sameDayNotAvaliable;
|
|
1388
|
+
if (_this.isHolidays(datasSameDayNotAvaliable)) {
|
|
1389
|
+
shippingMethods = shippingMethods.filter(function (method) { return method.serviceName !== 'Same Day'; });
|
|
1390
|
+
}
|
|
1391
|
+
if (totalPrice >= 200) {
|
|
1392
|
+
shippingMethods = shippingMethods.map(function (s) {
|
|
1393
|
+
if (s.serviceName !== 'Same Day')
|
|
1394
|
+
return Object.assign(Object.assign({}, s), { totalPrice: 0 });
|
|
1395
|
+
else
|
|
1396
|
+
return s;
|
|
1397
|
+
});
|
|
1398
|
+
}
|
|
1399
|
+
if (shop == i3.Shops.GLAMSHOP)
|
|
1400
|
+
return shippingMethods;
|
|
1401
|
+
if (_this.isFreeShippingBySubscription(shop, subscriptionPlan)) {
|
|
1402
|
+
shippingMethods = shippingMethods.map(function (s) {
|
|
1403
|
+
if (s.serviceName == 'Same Day')
|
|
1404
|
+
return Object.assign(Object.assign({}, s), { totalPrice: s.totalPrice / 2 });
|
|
1405
|
+
else
|
|
1406
|
+
return Object.assign(Object.assign({}, s), { totalPrice: 0 });
|
|
1407
|
+
});
|
|
1408
|
+
}
|
|
1409
|
+
if (_this.isHalfShippingBySubscription(shop, subscriptionPlan)) {
|
|
1410
|
+
shippingMethods = shippingMethods.map(function (s) {
|
|
1411
|
+
return Object.assign(Object.assign({}, s), { totalPrice: s.totalPrice / 2 });
|
|
1412
|
+
});
|
|
1413
|
+
}
|
|
1414
|
+
return shippingMethods;
|
|
1415
|
+
}));
|
|
1416
|
+
};
|
|
1417
|
+
ShippingService.prototype.isFreeShippingBySubscription = function (shop, subscriptionPlan) {
|
|
1418
|
+
if (!subscriptionPlan)
|
|
1419
|
+
return false;
|
|
1420
|
+
if (shop == i3.Shops.MENSMARKET && subscriptionPlan == 'SELECT') {
|
|
1421
|
+
return true;
|
|
1422
|
+
}
|
|
1423
|
+
return false;
|
|
1424
|
+
};
|
|
1425
|
+
ShippingService.prototype.isHalfShippingBySubscription = function (shop, subscriptionPlan) {
|
|
1426
|
+
if (!subscriptionPlan)
|
|
1427
|
+
return false;
|
|
1428
|
+
if (shop == i3.Shops.MENSMARKET && subscriptionPlan == 'PRIME') {
|
|
1429
|
+
return true;
|
|
1430
|
+
}
|
|
1431
|
+
return false;
|
|
1432
|
+
};
|
|
1433
|
+
ShippingService.prototype.isHolidays = function (datas) {
|
|
1434
|
+
var today = new Date();
|
|
1435
|
+
for (var key in datas) {
|
|
1436
|
+
var start = new Date(today.getFullYear() + "-" + datas[key].beginDate);
|
|
1437
|
+
var end = new Date(today.getFullYear() + "-" + datas[key].endDate);
|
|
1438
|
+
if (start > end)
|
|
1439
|
+
end = new Date(today.getFullYear() + 1 + "-" + datas[key].endDate);
|
|
1440
|
+
if (today >= start && today <= end)
|
|
1441
|
+
return true;
|
|
1442
|
+
}
|
|
1443
|
+
return false;
|
|
1444
|
+
};
|
|
1445
|
+
return ShippingService;
|
|
1446
|
+
}());
|
|
1447
|
+
ShippingService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService, deps: [{ token: i1__namespace$2.HttpClient }, { token: BACKEND_URL }, { token: HomeShopService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1448
|
+
ShippingService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService });
|
|
1449
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService, decorators: [{
|
|
1450
|
+
type: i0.Injectable
|
|
1451
|
+
}], ctorParameters: function () {
|
|
1452
|
+
return [{ type: i1__namespace$2.HttpClient }, { type: undefined, decorators: [{
|
|
1453
|
+
type: i0.Inject,
|
|
1454
|
+
args: [BACKEND_URL]
|
|
1455
|
+
}] }, { type: HomeShopService }];
|
|
1547
1456
|
} });
|
|
1548
1457
|
|
|
1549
|
-
var AngularFirebaseAuthModule = /** @class */ (function () {
|
|
1550
|
-
function AngularFirebaseAuthModule() {
|
|
1551
|
-
}
|
|
1552
|
-
AngularFirebaseAuthModule.initializeApp = function (options, nameOrConfig) {
|
|
1553
|
-
return {
|
|
1554
|
-
ngModule: AngularFirebaseAuthModule,
|
|
1555
|
-
providers: [
|
|
1556
|
-
{ provide: fire.FIREBASE_OPTIONS, useValue: options },
|
|
1557
|
-
{ provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig },
|
|
1558
|
-
],
|
|
1559
|
-
};
|
|
1560
|
-
};
|
|
1561
|
-
return AngularFirebaseAuthModule;
|
|
1562
|
-
}());
|
|
1563
|
-
AngularFirebaseAuthModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirebaseAuthModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
1564
|
-
AngularFirebaseAuthModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirebaseAuthModule, imports: [fire.AngularFireModule] });
|
|
1565
|
-
AngularFirebaseAuthModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirebaseAuthModule, providers: [
|
|
1566
|
-
{
|
|
1567
|
-
provide: 'Authentication',
|
|
1568
|
-
useFactory: function (authenticationService, userRepository) {
|
|
1569
|
-
return new i3.Authentication(authenticationService, userRepository);
|
|
1570
|
-
},
|
|
1571
|
-
deps: ['AuthenticationService', 'UserRepository'],
|
|
1572
|
-
},
|
|
1573
|
-
{
|
|
1574
|
-
provide: 'AuthenticationService',
|
|
1575
|
-
useFactory: function (angularFireAuth) {
|
|
1576
|
-
return new i3.AuthenticationFirebaseAuthService(angularFireAuth);
|
|
1577
|
-
},
|
|
1578
|
-
deps: [i1.AngularFireAuth],
|
|
1579
|
-
},
|
|
1580
|
-
{
|
|
1581
|
-
provide: 'Register',
|
|
1582
|
-
useFactory: function (registerService, userRepository) {
|
|
1583
|
-
return new i3.Register(registerService, userRepository);
|
|
1584
|
-
},
|
|
1585
|
-
deps: ['RegisterService', 'UserRepository'],
|
|
1586
|
-
},
|
|
1587
|
-
{
|
|
1588
|
-
provide: 'RegisterService',
|
|
1589
|
-
useFactory: function (angularFireAuth) {
|
|
1590
|
-
return new i3.RegisterFirebaseAuthService(angularFireAuth);
|
|
1591
|
-
},
|
|
1592
|
-
deps: [i1.AngularFireAuth],
|
|
1593
|
-
},
|
|
1594
|
-
{
|
|
1595
|
-
provide: 'SignOut',
|
|
1596
|
-
useFactory: function (authenticationService) {
|
|
1597
|
-
return new i3.SignOut(authenticationService);
|
|
1598
|
-
},
|
|
1599
|
-
deps: ['AuthenticationService'],
|
|
1600
|
-
},
|
|
1601
|
-
{
|
|
1602
|
-
provide: 'RecoveryPassword',
|
|
1603
|
-
useFactory: function (authenticationService) {
|
|
1604
|
-
return new i3.RecoveryPassword(authenticationService);
|
|
1605
|
-
},
|
|
1606
|
-
deps: ['AuthenticationService'],
|
|
1607
|
-
},
|
|
1608
|
-
], imports: [[fire.AngularFireModule]] });
|
|
1609
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirebaseAuthModule, decorators: [{
|
|
1610
|
-
type: i0.NgModule,
|
|
1611
|
-
args: [{
|
|
1612
|
-
imports: [fire.AngularFireModule],
|
|
1613
|
-
providers: [
|
|
1614
|
-
{
|
|
1615
|
-
provide: 'Authentication',
|
|
1616
|
-
useFactory: function (authenticationService, userRepository) {
|
|
1617
|
-
return new i3.Authentication(authenticationService, userRepository);
|
|
1618
|
-
},
|
|
1619
|
-
deps: ['AuthenticationService', 'UserRepository'],
|
|
1620
|
-
},
|
|
1621
|
-
{
|
|
1622
|
-
provide: 'AuthenticationService',
|
|
1623
|
-
useFactory: function (angularFireAuth) {
|
|
1624
|
-
return new i3.AuthenticationFirebaseAuthService(angularFireAuth);
|
|
1625
|
-
},
|
|
1626
|
-
deps: [i1.AngularFireAuth],
|
|
1627
|
-
},
|
|
1628
|
-
{
|
|
1629
|
-
provide: 'Register',
|
|
1630
|
-
useFactory: function (registerService, userRepository) {
|
|
1631
|
-
return new i3.Register(registerService, userRepository);
|
|
1632
|
-
},
|
|
1633
|
-
deps: ['RegisterService', 'UserRepository'],
|
|
1634
|
-
},
|
|
1635
|
-
{
|
|
1636
|
-
provide: 'RegisterService',
|
|
1637
|
-
useFactory: function (angularFireAuth) {
|
|
1638
|
-
return new i3.RegisterFirebaseAuthService(angularFireAuth);
|
|
1639
|
-
},
|
|
1640
|
-
deps: [i1.AngularFireAuth],
|
|
1641
|
-
},
|
|
1642
|
-
{
|
|
1643
|
-
provide: 'SignOut',
|
|
1644
|
-
useFactory: function (authenticationService) {
|
|
1645
|
-
return new i3.SignOut(authenticationService);
|
|
1646
|
-
},
|
|
1647
|
-
deps: ['AuthenticationService'],
|
|
1648
|
-
},
|
|
1649
|
-
{
|
|
1650
|
-
provide: 'RecoveryPassword',
|
|
1651
|
-
useFactory: function (authenticationService) {
|
|
1652
|
-
return new i3.RecoveryPassword(authenticationService);
|
|
1653
|
-
},
|
|
1654
|
-
deps: ['AuthenticationService'],
|
|
1655
|
-
},
|
|
1656
|
-
],
|
|
1657
|
-
}]
|
|
1458
|
+
var AngularFirebaseAuthModule = /** @class */ (function () {
|
|
1459
|
+
function AngularFirebaseAuthModule() {
|
|
1460
|
+
}
|
|
1461
|
+
AngularFirebaseAuthModule.initializeApp = function (options, nameOrConfig) {
|
|
1462
|
+
return {
|
|
1463
|
+
ngModule: AngularFirebaseAuthModule,
|
|
1464
|
+
providers: [
|
|
1465
|
+
{ provide: fire.FIREBASE_OPTIONS, useValue: options },
|
|
1466
|
+
{ provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig },
|
|
1467
|
+
],
|
|
1468
|
+
};
|
|
1469
|
+
};
|
|
1470
|
+
return AngularFirebaseAuthModule;
|
|
1471
|
+
}());
|
|
1472
|
+
AngularFirebaseAuthModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirebaseAuthModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
1473
|
+
AngularFirebaseAuthModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirebaseAuthModule, imports: [fire.AngularFireModule] });
|
|
1474
|
+
AngularFirebaseAuthModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirebaseAuthModule, providers: [
|
|
1475
|
+
{
|
|
1476
|
+
provide: 'Authentication',
|
|
1477
|
+
useFactory: function (authenticationService, userRepository) {
|
|
1478
|
+
return new i3.Authentication(authenticationService, userRepository);
|
|
1479
|
+
},
|
|
1480
|
+
deps: ['AuthenticationService', 'UserRepository'],
|
|
1481
|
+
},
|
|
1482
|
+
{
|
|
1483
|
+
provide: 'AuthenticationService',
|
|
1484
|
+
useFactory: function (angularFireAuth) {
|
|
1485
|
+
return new i3.AuthenticationFirebaseAuthService(angularFireAuth);
|
|
1486
|
+
},
|
|
1487
|
+
deps: [i1.AngularFireAuth],
|
|
1488
|
+
},
|
|
1489
|
+
{
|
|
1490
|
+
provide: 'Register',
|
|
1491
|
+
useFactory: function (registerService, userRepository) {
|
|
1492
|
+
return new i3.Register(registerService, userRepository);
|
|
1493
|
+
},
|
|
1494
|
+
deps: ['RegisterService', 'UserRepository'],
|
|
1495
|
+
},
|
|
1496
|
+
{
|
|
1497
|
+
provide: 'RegisterService',
|
|
1498
|
+
useFactory: function (angularFireAuth) {
|
|
1499
|
+
return new i3.RegisterFirebaseAuthService(angularFireAuth);
|
|
1500
|
+
},
|
|
1501
|
+
deps: [i1.AngularFireAuth],
|
|
1502
|
+
},
|
|
1503
|
+
{
|
|
1504
|
+
provide: 'SignOut',
|
|
1505
|
+
useFactory: function (authenticationService) {
|
|
1506
|
+
return new i3.SignOut(authenticationService);
|
|
1507
|
+
},
|
|
1508
|
+
deps: ['AuthenticationService'],
|
|
1509
|
+
},
|
|
1510
|
+
{
|
|
1511
|
+
provide: 'RecoveryPassword',
|
|
1512
|
+
useFactory: function (authenticationService) {
|
|
1513
|
+
return new i3.RecoveryPassword(authenticationService);
|
|
1514
|
+
},
|
|
1515
|
+
deps: ['AuthenticationService'],
|
|
1516
|
+
},
|
|
1517
|
+
], imports: [[fire.AngularFireModule]] });
|
|
1518
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirebaseAuthModule, decorators: [{
|
|
1519
|
+
type: i0.NgModule,
|
|
1520
|
+
args: [{
|
|
1521
|
+
imports: [fire.AngularFireModule],
|
|
1522
|
+
providers: [
|
|
1523
|
+
{
|
|
1524
|
+
provide: 'Authentication',
|
|
1525
|
+
useFactory: function (authenticationService, userRepository) {
|
|
1526
|
+
return new i3.Authentication(authenticationService, userRepository);
|
|
1527
|
+
},
|
|
1528
|
+
deps: ['AuthenticationService', 'UserRepository'],
|
|
1529
|
+
},
|
|
1530
|
+
{
|
|
1531
|
+
provide: 'AuthenticationService',
|
|
1532
|
+
useFactory: function (angularFireAuth) {
|
|
1533
|
+
return new i3.AuthenticationFirebaseAuthService(angularFireAuth);
|
|
1534
|
+
},
|
|
1535
|
+
deps: [i1.AngularFireAuth],
|
|
1536
|
+
},
|
|
1537
|
+
{
|
|
1538
|
+
provide: 'Register',
|
|
1539
|
+
useFactory: function (registerService, userRepository) {
|
|
1540
|
+
return new i3.Register(registerService, userRepository);
|
|
1541
|
+
},
|
|
1542
|
+
deps: ['RegisterService', 'UserRepository'],
|
|
1543
|
+
},
|
|
1544
|
+
{
|
|
1545
|
+
provide: 'RegisterService',
|
|
1546
|
+
useFactory: function (angularFireAuth) {
|
|
1547
|
+
return new i3.RegisterFirebaseAuthService(angularFireAuth);
|
|
1548
|
+
},
|
|
1549
|
+
deps: [i1.AngularFireAuth],
|
|
1550
|
+
},
|
|
1551
|
+
{
|
|
1552
|
+
provide: 'SignOut',
|
|
1553
|
+
useFactory: function (authenticationService) {
|
|
1554
|
+
return new i3.SignOut(authenticationService);
|
|
1555
|
+
},
|
|
1556
|
+
deps: ['AuthenticationService'],
|
|
1557
|
+
},
|
|
1558
|
+
{
|
|
1559
|
+
provide: 'RecoveryPassword',
|
|
1560
|
+
useFactory: function (authenticationService) {
|
|
1561
|
+
return new i3.RecoveryPassword(authenticationService);
|
|
1562
|
+
},
|
|
1563
|
+
deps: ['AuthenticationService'],
|
|
1564
|
+
},
|
|
1565
|
+
],
|
|
1566
|
+
}]
|
|
1658
1567
|
}] });
|
|
1659
1568
|
|
|
1660
|
-
var AngularElasticSeachModule = /** @class */ (function () {
|
|
1661
|
-
function AngularElasticSeachModule() {
|
|
1662
|
-
}
|
|
1663
|
-
AngularElasticSeachModule.initializeApp = function (options) {
|
|
1664
|
-
return {
|
|
1665
|
-
ngModule: AngularElasticSeachModule,
|
|
1666
|
-
providers: [{ provide: ES_CONFIG, useValue: options }],
|
|
1667
|
-
};
|
|
1668
|
-
};
|
|
1669
|
-
return AngularElasticSeachModule;
|
|
1670
|
-
}());
|
|
1671
|
-
AngularElasticSeachModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularElasticSeachModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
1672
|
-
AngularElasticSeachModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularElasticSeachModule });
|
|
1673
|
-
AngularElasticSeachModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularElasticSeachModule, providers: [
|
|
1674
|
-
{
|
|
1675
|
-
provide: i3.ProductsIndex,
|
|
1676
|
-
useFactory: function (configuration) { return new i3.ProductsIndex(new i3.AxiosAdapter(configuration)); },
|
|
1677
|
-
deps: [ES_CONFIG],
|
|
1678
|
-
},
|
|
1679
|
-
] });
|
|
1680
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularElasticSeachModule, decorators: [{
|
|
1681
|
-
type: i0.NgModule,
|
|
1682
|
-
args: [{
|
|
1683
|
-
providers: [
|
|
1684
|
-
{
|
|
1685
|
-
provide: i3.ProductsIndex,
|
|
1686
|
-
useFactory: function (configuration) { return new i3.ProductsIndex(new i3.AxiosAdapter(configuration)); },
|
|
1687
|
-
deps: [ES_CONFIG],
|
|
1688
|
-
},
|
|
1689
|
-
],
|
|
1690
|
-
}]
|
|
1569
|
+
var AngularElasticSeachModule = /** @class */ (function () {
|
|
1570
|
+
function AngularElasticSeachModule() {
|
|
1571
|
+
}
|
|
1572
|
+
AngularElasticSeachModule.initializeApp = function (options) {
|
|
1573
|
+
return {
|
|
1574
|
+
ngModule: AngularElasticSeachModule,
|
|
1575
|
+
providers: [{ provide: ES_CONFIG, useValue: options }],
|
|
1576
|
+
};
|
|
1577
|
+
};
|
|
1578
|
+
return AngularElasticSeachModule;
|
|
1579
|
+
}());
|
|
1580
|
+
AngularElasticSeachModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularElasticSeachModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
1581
|
+
AngularElasticSeachModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularElasticSeachModule });
|
|
1582
|
+
AngularElasticSeachModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularElasticSeachModule, providers: [
|
|
1583
|
+
{
|
|
1584
|
+
provide: i3.ProductsIndex,
|
|
1585
|
+
useFactory: function (configuration) { return new i3.ProductsIndex(new i3.AxiosAdapter(configuration)); },
|
|
1586
|
+
deps: [ES_CONFIG],
|
|
1587
|
+
},
|
|
1588
|
+
] });
|
|
1589
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularElasticSeachModule, decorators: [{
|
|
1590
|
+
type: i0.NgModule,
|
|
1591
|
+
args: [{
|
|
1592
|
+
providers: [
|
|
1593
|
+
{
|
|
1594
|
+
provide: i3.ProductsIndex,
|
|
1595
|
+
useFactory: function (configuration) { return new i3.ProductsIndex(new i3.AxiosAdapter(configuration)); },
|
|
1596
|
+
deps: [ES_CONFIG],
|
|
1597
|
+
},
|
|
1598
|
+
],
|
|
1599
|
+
}]
|
|
1691
1600
|
}] });
|
|
1692
1601
|
|
|
1693
|
-
var AngularFirestoreModule = /** @class */ (function () {
|
|
1694
|
-
function AngularFirestoreModule() {
|
|
1695
|
-
}
|
|
1696
|
-
AngularFirestoreModule.initializeApp = function (options, nameOrConfig) {
|
|
1697
|
-
return {
|
|
1698
|
-
ngModule: AngularFirestoreModule,
|
|
1699
|
-
providers: [
|
|
1700
|
-
{ provide: fire.FIREBASE_OPTIONS, useValue: options.firebase },
|
|
1701
|
-
{ provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig },
|
|
1702
|
-
{ provide: ES_CONFIG, useValue: options.elasticSearch },
|
|
1703
|
-
],
|
|
1704
|
-
};
|
|
1705
|
-
};
|
|
1706
|
-
return AngularFirestoreModule;
|
|
1707
|
-
}());
|
|
1708
|
-
AngularFirestoreModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirestoreModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
1709
|
-
AngularFirestoreModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirestoreModule, imports: [fire.AngularFireModule, AngularElasticSeachModule] });
|
|
1710
|
-
AngularFirestoreModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirestoreModule, providers: [
|
|
1711
|
-
{
|
|
1712
|
-
provide: 'BeautyProfileRepository',
|
|
1713
|
-
useFactory: function (firestore, userRepository) {
|
|
1714
|
-
return new i3.UserBeautyProfileFirestoreRepository(firestore.firestore, userRepository);
|
|
1715
|
-
},
|
|
1716
|
-
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1717
|
-
},
|
|
1718
|
-
{
|
|
1719
|
-
provide: 'Buy2WinRepository',
|
|
1720
|
-
useFactory: function (firestore) {
|
|
1721
|
-
return new i3.Buy2WinFirestoreRepository(firestore.firestore);
|
|
1722
|
-
},
|
|
1723
|
-
deps: [i1$1.AngularFirestore],
|
|
1724
|
-
},
|
|
1725
|
-
{
|
|
1726
|
-
provide: i3.CategoryFirestoreRepository,
|
|
1727
|
-
useFactory: function (firestore) {
|
|
1728
|
-
return new i3.CategoryFirestoreRepository(firestore.firestore);
|
|
1729
|
-
},
|
|
1730
|
-
deps: [i1$1.AngularFirestore],
|
|
1731
|
-
},
|
|
1732
|
-
{
|
|
1733
|
-
provide: 'CheckoutRepository',
|
|
1734
|
-
useFactory: function (firestore) {
|
|
1735
|
-
return new i3.CheckoutFirestoreRepository(firestore.firestore);
|
|
1736
|
-
},
|
|
1737
|
-
deps: [i1$1.AngularFirestore],
|
|
1738
|
-
},
|
|
1739
|
-
{
|
|
1740
|
-
provide: 'CheckoutSubscriptionRepository',
|
|
1741
|
-
useFactory: function (firestore) {
|
|
1742
|
-
return new i3.CheckoutSubscriptionFirestoreRepository(firestore.firestore);
|
|
1743
|
-
},
|
|
1744
|
-
deps: [i1$1.AngularFirestore],
|
|
1745
|
-
},
|
|
1746
|
-
{
|
|
1747
|
-
provide: 'CouponRepository',
|
|
1748
|
-
useFactory: function (firestore) {
|
|
1749
|
-
return new i3.CouponFirestoreRepository(firestore.firestore);
|
|
1750
|
-
},
|
|
1751
|
-
deps: [i1$1.AngularFirestore],
|
|
1752
|
-
},
|
|
1753
|
-
{
|
|
1754
|
-
provide: 'CampaignHashtagRepository',
|
|
1755
|
-
useFactory: function (firestore) {
|
|
1756
|
-
return new i3.CampaignHashtagFirestoreRepository(firestore.firestore);
|
|
1757
|
-
},
|
|
1758
|
-
deps: [i1$1.AngularFirestore],
|
|
1759
|
-
},
|
|
1760
|
-
{
|
|
1761
|
-
provide: 'CampaignDashboardRepository',
|
|
1762
|
-
useFactory: function (firestore) {
|
|
1763
|
-
return new i3.CampaignDashboardFirestoreRepository(firestore.firestore);
|
|
1764
|
-
},
|
|
1765
|
-
deps: [i1$1.AngularFirestore],
|
|
1766
|
-
},
|
|
1767
|
-
{
|
|
1768
|
-
provide: 'EditionRepository',
|
|
1769
|
-
useFactory: function (firestore, subscriptionRepository) {
|
|
1770
|
-
return new i3.SubscriptionEditionFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
1771
|
-
},
|
|
1772
|
-
deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
|
|
1773
|
-
},
|
|
1774
|
-
{
|
|
1775
|
-
provide: 'HomeRepository',
|
|
1776
|
-
useFactory: function (firestore) {
|
|
1777
|
-
return new i3.HomeFirestoreRepository(firestore.firestore);
|
|
1778
|
-
},
|
|
1779
|
-
deps: [i1$1.AngularFirestore],
|
|
1780
|
-
},
|
|
1781
|
-
{
|
|
1782
|
-
provide: 'LeadRepository',
|
|
1783
|
-
useFactory: function (firestore) {
|
|
1784
|
-
return new i3.LeadFirestoreRepository(firestore.firestore);
|
|
1785
|
-
},
|
|
1786
|
-
deps: [i1$1.AngularFirestore],
|
|
1787
|
-
},
|
|
1788
|
-
{
|
|
1789
|
-
provide: 'LegacyOrderRepository',
|
|
1790
|
-
useFactory: function (firestore) {
|
|
1791
|
-
return new i3.LegacyOrderFirestoreRepository(firestore.firestore);
|
|
1792
|
-
},
|
|
1793
|
-
deps: [i1$1.AngularFirestore],
|
|
1794
|
-
},
|
|
1795
|
-
{
|
|
1796
|
-
provide: 'ShopMenuRepository',
|
|
1797
|
-
useFactory: function (firestore) {
|
|
1798
|
-
return new i3.ShopMenuFirestoreRepository(firestore.firestore);
|
|
1799
|
-
},
|
|
1800
|
-
deps: [i1$1.AngularFirestore],
|
|
1801
|
-
},
|
|
1802
|
-
{
|
|
1803
|
-
provide: 'OrderRepository',
|
|
1804
|
-
useFactory: function (firestore) {
|
|
1805
|
-
return new i3.OrderFirestoreRepository(firestore.firestore);
|
|
1806
|
-
},
|
|
1807
|
-
deps: [i1$1.AngularFirestore],
|
|
1808
|
-
},
|
|
1809
|
-
{
|
|
1810
|
-
provide: 'PaymentRepository',
|
|
1811
|
-
useFactory: function (firestore) {
|
|
1812
|
-
return new i3.PaymentFirestoreRepository(firestore.firestore);
|
|
1813
|
-
},
|
|
1814
|
-
deps: [i1$1.AngularFirestore],
|
|
1815
|
-
},
|
|
1816
|
-
{
|
|
1817
|
-
provide: i3.ProductFirestoreRepository,
|
|
1818
|
-
useFactory: function (firestore) {
|
|
1819
|
-
return new i3.ProductFirestoreRepository(firestore.firestore);
|
|
1820
|
-
},
|
|
1821
|
-
deps: [i1$1.AngularFirestore],
|
|
1822
|
-
},
|
|
1823
|
-
{
|
|
1824
|
-
provide: 'ShopSettingsRepository',
|
|
1825
|
-
useFactory: function (firestore) {
|
|
1826
|
-
return new i3.ShopSettingsFirestoreRepository(firestore.firestore);
|
|
1827
|
-
},
|
|
1828
|
-
deps: [i1$1.AngularFirestore],
|
|
1829
|
-
},
|
|
1830
|
-
{
|
|
1831
|
-
provide: 'SubscriptionPaymentRepository',
|
|
1832
|
-
useFactory: function (firestore, subscriptionRepository) {
|
|
1833
|
-
return new i3.SubscriptionPaymentFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
1834
|
-
},
|
|
1835
|
-
deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
|
|
1836
|
-
},
|
|
1837
|
-
{
|
|
1838
|
-
provide: 'SubscriptionPlanRepository',
|
|
1839
|
-
useFactory: function (firestore) {
|
|
1840
|
-
return new i3.SubscriptionPlanFirestoreRepository(firestore.firestore);
|
|
1841
|
-
},
|
|
1842
|
-
deps: [i1$1.AngularFirestore],
|
|
1843
|
-
},
|
|
1844
|
-
{
|
|
1845
|
-
provide: 'SubscriptionProductRepository',
|
|
1846
|
-
useFactory: function (firestore) {
|
|
1847
|
-
return new i3.SubscriptionProductFirestoreRepository(firestore.firestore);
|
|
1848
|
-
},
|
|
1849
|
-
deps: [i1$1.AngularFirestore],
|
|
1850
|
-
},
|
|
1851
|
-
{
|
|
1852
|
-
provide: 'SubscriptionRepository',
|
|
1853
|
-
useFactory: function (firestore) {
|
|
1854
|
-
return new i3.SubscriptionFirestoreRepository(firestore.firestore);
|
|
1855
|
-
},
|
|
1856
|
-
deps: [i1$1.AngularFirestore],
|
|
1857
|
-
},
|
|
1858
|
-
{
|
|
1859
|
-
provide: 'UserRepository',
|
|
1860
|
-
useFactory: function (firestore) {
|
|
1861
|
-
return new i3.UserFirestoreRepository(firestore.firestore);
|
|
1862
|
-
},
|
|
1863
|
-
deps: [i1$1.AngularFirestore],
|
|
1864
|
-
},
|
|
1865
|
-
{
|
|
1866
|
-
provide: 'UserAddressRepository',
|
|
1867
|
-
useFactory: function (firestore, userRepository) {
|
|
1868
|
-
return new i3.UserAddressFirestoreRepository(firestore.firestore, userRepository);
|
|
1869
|
-
},
|
|
1870
|
-
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1871
|
-
},
|
|
1872
|
-
{
|
|
1873
|
-
provide: 'UserPaymentMethodRepository',
|
|
1874
|
-
useFactory: function (firestore, userRepository) {
|
|
1875
|
-
return new i3.UserPaymentMethodFirestoreRepository(firestore.firestore, userRepository);
|
|
1876
|
-
},
|
|
1877
|
-
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1878
|
-
},
|
|
1879
|
-
{
|
|
1880
|
-
provide: i3.ProductVariantFirestoreRepository,
|
|
1881
|
-
useFactory: function (firestore, productRepository) {
|
|
1882
|
-
return new i3.ProductVariantFirestoreRepository(firestore.firestore, productRepository);
|
|
1883
|
-
},
|
|
1884
|
-
deps: [i1$1.AngularFirestore, i3.ProductFirestoreRepository],
|
|
1885
|
-
},
|
|
1886
|
-
{
|
|
1887
|
-
provide: i0.APP_INITIALIZER,
|
|
1888
|
-
useFactory: function (firestore) { return function () { return firestore.firestore.settings({ ignoreUndefinedProperties: true }); }; },
|
|
1889
|
-
deps: [i1$1.AngularFirestore],
|
|
1890
|
-
multi: true,
|
|
1891
|
-
},
|
|
1892
|
-
], imports: [[fire.AngularFireModule, AngularElasticSeachModule]] });
|
|
1893
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirestoreModule, decorators: [{
|
|
1894
|
-
type: i0.NgModule,
|
|
1895
|
-
args: [{
|
|
1896
|
-
imports: [fire.AngularFireModule, AngularElasticSeachModule],
|
|
1897
|
-
providers: [
|
|
1898
|
-
{
|
|
1899
|
-
provide: 'BeautyProfileRepository',
|
|
1900
|
-
useFactory: function (firestore, userRepository) {
|
|
1901
|
-
return new i3.UserBeautyProfileFirestoreRepository(firestore.firestore, userRepository);
|
|
1902
|
-
},
|
|
1903
|
-
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1904
|
-
},
|
|
1905
|
-
{
|
|
1906
|
-
provide: 'Buy2WinRepository',
|
|
1907
|
-
useFactory: function (firestore) {
|
|
1908
|
-
return new i3.Buy2WinFirestoreRepository(firestore.firestore);
|
|
1909
|
-
},
|
|
1910
|
-
deps: [i1$1.AngularFirestore],
|
|
1911
|
-
},
|
|
1912
|
-
{
|
|
1913
|
-
provide: i3.CategoryFirestoreRepository,
|
|
1914
|
-
useFactory: function (firestore) {
|
|
1915
|
-
return new i3.CategoryFirestoreRepository(firestore.firestore);
|
|
1916
|
-
},
|
|
1917
|
-
deps: [i1$1.AngularFirestore],
|
|
1918
|
-
},
|
|
1919
|
-
{
|
|
1920
|
-
provide: 'CheckoutRepository',
|
|
1921
|
-
useFactory: function (firestore) {
|
|
1922
|
-
return new i3.CheckoutFirestoreRepository(firestore.firestore);
|
|
1923
|
-
},
|
|
1924
|
-
deps: [i1$1.AngularFirestore],
|
|
1925
|
-
},
|
|
1926
|
-
{
|
|
1927
|
-
provide: 'CheckoutSubscriptionRepository',
|
|
1928
|
-
useFactory: function (firestore) {
|
|
1929
|
-
return new i3.CheckoutSubscriptionFirestoreRepository(firestore.firestore);
|
|
1930
|
-
},
|
|
1931
|
-
deps: [i1$1.AngularFirestore],
|
|
1932
|
-
},
|
|
1933
|
-
{
|
|
1934
|
-
provide: 'CouponRepository',
|
|
1935
|
-
useFactory: function (firestore) {
|
|
1936
|
-
return new i3.CouponFirestoreRepository(firestore.firestore);
|
|
1937
|
-
},
|
|
1938
|
-
deps: [i1$1.AngularFirestore],
|
|
1939
|
-
},
|
|
1940
|
-
{
|
|
1941
|
-
provide: 'CampaignHashtagRepository',
|
|
1942
|
-
useFactory: function (firestore) {
|
|
1943
|
-
return new i3.CampaignHashtagFirestoreRepository(firestore.firestore);
|
|
1944
|
-
},
|
|
1945
|
-
deps: [i1$1.AngularFirestore],
|
|
1946
|
-
},
|
|
1947
|
-
{
|
|
1948
|
-
provide: 'CampaignDashboardRepository',
|
|
1949
|
-
useFactory: function (firestore) {
|
|
1950
|
-
return new i3.CampaignDashboardFirestoreRepository(firestore.firestore);
|
|
1951
|
-
},
|
|
1952
|
-
deps: [i1$1.AngularFirestore],
|
|
1953
|
-
},
|
|
1954
|
-
{
|
|
1955
|
-
provide: 'EditionRepository',
|
|
1956
|
-
useFactory: function (firestore, subscriptionRepository) {
|
|
1957
|
-
return new i3.SubscriptionEditionFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
1958
|
-
},
|
|
1959
|
-
deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
|
|
1960
|
-
},
|
|
1961
|
-
{
|
|
1962
|
-
provide: 'HomeRepository',
|
|
1963
|
-
useFactory: function (firestore) {
|
|
1964
|
-
return new i3.HomeFirestoreRepository(firestore.firestore);
|
|
1965
|
-
},
|
|
1966
|
-
deps: [i1$1.AngularFirestore],
|
|
1967
|
-
},
|
|
1968
|
-
{
|
|
1969
|
-
provide: 'LeadRepository',
|
|
1970
|
-
useFactory: function (firestore) {
|
|
1971
|
-
return new i3.LeadFirestoreRepository(firestore.firestore);
|
|
1972
|
-
},
|
|
1973
|
-
deps: [i1$1.AngularFirestore],
|
|
1974
|
-
},
|
|
1975
|
-
{
|
|
1976
|
-
provide: 'LegacyOrderRepository',
|
|
1977
|
-
useFactory: function (firestore) {
|
|
1978
|
-
return new i3.LegacyOrderFirestoreRepository(firestore.firestore);
|
|
1979
|
-
},
|
|
1980
|
-
deps: [i1$1.AngularFirestore],
|
|
1981
|
-
},
|
|
1982
|
-
{
|
|
1983
|
-
provide: 'ShopMenuRepository',
|
|
1984
|
-
useFactory: function (firestore) {
|
|
1985
|
-
return new i3.ShopMenuFirestoreRepository(firestore.firestore);
|
|
1986
|
-
},
|
|
1987
|
-
deps: [i1$1.AngularFirestore],
|
|
1988
|
-
},
|
|
1989
|
-
{
|
|
1990
|
-
provide: 'OrderRepository',
|
|
1991
|
-
useFactory: function (firestore) {
|
|
1992
|
-
return new i3.OrderFirestoreRepository(firestore.firestore);
|
|
1993
|
-
},
|
|
1994
|
-
deps: [i1$1.AngularFirestore],
|
|
1995
|
-
},
|
|
1996
|
-
{
|
|
1997
|
-
provide: 'PaymentRepository',
|
|
1998
|
-
useFactory: function (firestore) {
|
|
1999
|
-
return new i3.PaymentFirestoreRepository(firestore.firestore);
|
|
2000
|
-
},
|
|
2001
|
-
deps: [i1$1.AngularFirestore],
|
|
2002
|
-
},
|
|
2003
|
-
{
|
|
2004
|
-
provide: i3.ProductFirestoreRepository,
|
|
2005
|
-
useFactory: function (firestore) {
|
|
2006
|
-
return new i3.ProductFirestoreRepository(firestore.firestore);
|
|
2007
|
-
},
|
|
2008
|
-
deps: [i1$1.AngularFirestore],
|
|
2009
|
-
},
|
|
2010
|
-
{
|
|
2011
|
-
provide: 'ShopSettingsRepository',
|
|
2012
|
-
useFactory: function (firestore) {
|
|
2013
|
-
return new i3.ShopSettingsFirestoreRepository(firestore.firestore);
|
|
2014
|
-
},
|
|
2015
|
-
deps: [i1$1.AngularFirestore],
|
|
2016
|
-
},
|
|
2017
|
-
{
|
|
2018
|
-
provide: 'SubscriptionPaymentRepository',
|
|
2019
|
-
useFactory: function (firestore, subscriptionRepository) {
|
|
2020
|
-
return new i3.SubscriptionPaymentFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
2021
|
-
},
|
|
2022
|
-
deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
|
|
2023
|
-
},
|
|
2024
|
-
{
|
|
2025
|
-
provide: 'SubscriptionPlanRepository',
|
|
2026
|
-
useFactory: function (firestore) {
|
|
2027
|
-
return new i3.SubscriptionPlanFirestoreRepository(firestore.firestore);
|
|
2028
|
-
},
|
|
2029
|
-
deps: [i1$1.AngularFirestore],
|
|
2030
|
-
},
|
|
2031
|
-
{
|
|
2032
|
-
provide: 'SubscriptionProductRepository',
|
|
2033
|
-
useFactory: function (firestore) {
|
|
2034
|
-
return new i3.SubscriptionProductFirestoreRepository(firestore.firestore);
|
|
2035
|
-
},
|
|
2036
|
-
deps: [i1$1.AngularFirestore],
|
|
2037
|
-
},
|
|
2038
|
-
{
|
|
2039
|
-
provide: 'SubscriptionRepository',
|
|
2040
|
-
useFactory: function (firestore) {
|
|
2041
|
-
return new i3.SubscriptionFirestoreRepository(firestore.firestore);
|
|
2042
|
-
},
|
|
2043
|
-
deps: [i1$1.AngularFirestore],
|
|
2044
|
-
},
|
|
2045
|
-
{
|
|
2046
|
-
provide: 'UserRepository',
|
|
2047
|
-
useFactory: function (firestore) {
|
|
2048
|
-
return new i3.UserFirestoreRepository(firestore.firestore);
|
|
2049
|
-
},
|
|
2050
|
-
deps: [i1$1.AngularFirestore],
|
|
2051
|
-
},
|
|
2052
|
-
{
|
|
2053
|
-
provide: 'UserAddressRepository',
|
|
2054
|
-
useFactory: function (firestore, userRepository) {
|
|
2055
|
-
return new i3.UserAddressFirestoreRepository(firestore.firestore, userRepository);
|
|
2056
|
-
},
|
|
2057
|
-
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
2058
|
-
},
|
|
2059
|
-
{
|
|
2060
|
-
provide: 'UserPaymentMethodRepository',
|
|
2061
|
-
useFactory: function (firestore, userRepository) {
|
|
2062
|
-
return new i3.UserPaymentMethodFirestoreRepository(firestore.firestore, userRepository);
|
|
2063
|
-
},
|
|
2064
|
-
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
2065
|
-
},
|
|
2066
|
-
{
|
|
2067
|
-
provide: i3.ProductVariantFirestoreRepository,
|
|
2068
|
-
useFactory: function (firestore, productRepository) {
|
|
2069
|
-
return new i3.ProductVariantFirestoreRepository(firestore.firestore, productRepository);
|
|
2070
|
-
},
|
|
2071
|
-
deps: [i1$1.AngularFirestore, i3.ProductFirestoreRepository],
|
|
2072
|
-
},
|
|
2073
|
-
{
|
|
2074
|
-
provide: i0.APP_INITIALIZER,
|
|
2075
|
-
useFactory: function (firestore) { return function () { return firestore.firestore.settings({ ignoreUndefinedProperties: true }); }; },
|
|
2076
|
-
deps: [i1$1.AngularFirestore],
|
|
2077
|
-
multi: true,
|
|
2078
|
-
},
|
|
2079
|
-
],
|
|
2080
|
-
}]
|
|
1602
|
+
var AngularFirestoreModule = /** @class */ (function () {
|
|
1603
|
+
function AngularFirestoreModule() {
|
|
1604
|
+
}
|
|
1605
|
+
AngularFirestoreModule.initializeApp = function (options, nameOrConfig) {
|
|
1606
|
+
return {
|
|
1607
|
+
ngModule: AngularFirestoreModule,
|
|
1608
|
+
providers: [
|
|
1609
|
+
{ provide: fire.FIREBASE_OPTIONS, useValue: options.firebase },
|
|
1610
|
+
{ provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig },
|
|
1611
|
+
{ provide: ES_CONFIG, useValue: options.elasticSearch },
|
|
1612
|
+
],
|
|
1613
|
+
};
|
|
1614
|
+
};
|
|
1615
|
+
return AngularFirestoreModule;
|
|
1616
|
+
}());
|
|
1617
|
+
AngularFirestoreModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirestoreModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
1618
|
+
AngularFirestoreModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirestoreModule, imports: [fire.AngularFireModule, AngularElasticSeachModule] });
|
|
1619
|
+
AngularFirestoreModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirestoreModule, providers: [
|
|
1620
|
+
{
|
|
1621
|
+
provide: 'BeautyProfileRepository',
|
|
1622
|
+
useFactory: function (firestore, userRepository) {
|
|
1623
|
+
return new i3.UserBeautyProfileFirestoreRepository(firestore.firestore, userRepository);
|
|
1624
|
+
},
|
|
1625
|
+
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1626
|
+
},
|
|
1627
|
+
{
|
|
1628
|
+
provide: 'Buy2WinRepository',
|
|
1629
|
+
useFactory: function (firestore) {
|
|
1630
|
+
return new i3.Buy2WinFirestoreRepository(firestore.firestore);
|
|
1631
|
+
},
|
|
1632
|
+
deps: [i1$1.AngularFirestore],
|
|
1633
|
+
},
|
|
1634
|
+
{
|
|
1635
|
+
provide: i3.CategoryFirestoreRepository,
|
|
1636
|
+
useFactory: function (firestore) {
|
|
1637
|
+
return new i3.CategoryFirestoreRepository(firestore.firestore);
|
|
1638
|
+
},
|
|
1639
|
+
deps: [i1$1.AngularFirestore],
|
|
1640
|
+
},
|
|
1641
|
+
{
|
|
1642
|
+
provide: 'CheckoutRepository',
|
|
1643
|
+
useFactory: function (firestore) {
|
|
1644
|
+
return new i3.CheckoutFirestoreRepository(firestore.firestore);
|
|
1645
|
+
},
|
|
1646
|
+
deps: [i1$1.AngularFirestore],
|
|
1647
|
+
},
|
|
1648
|
+
{
|
|
1649
|
+
provide: 'CheckoutSubscriptionRepository',
|
|
1650
|
+
useFactory: function (firestore) {
|
|
1651
|
+
return new i3.CheckoutSubscriptionFirestoreRepository(firestore.firestore);
|
|
1652
|
+
},
|
|
1653
|
+
deps: [i1$1.AngularFirestore],
|
|
1654
|
+
},
|
|
1655
|
+
{
|
|
1656
|
+
provide: 'CouponRepository',
|
|
1657
|
+
useFactory: function (firestore) {
|
|
1658
|
+
return new i3.CouponFirestoreRepository(firestore.firestore);
|
|
1659
|
+
},
|
|
1660
|
+
deps: [i1$1.AngularFirestore],
|
|
1661
|
+
},
|
|
1662
|
+
{
|
|
1663
|
+
provide: 'CampaignHashtagRepository',
|
|
1664
|
+
useFactory: function (firestore) {
|
|
1665
|
+
return new i3.CampaignHashtagFirestoreRepository(firestore.firestore);
|
|
1666
|
+
},
|
|
1667
|
+
deps: [i1$1.AngularFirestore],
|
|
1668
|
+
},
|
|
1669
|
+
{
|
|
1670
|
+
provide: 'CampaignDashboardRepository',
|
|
1671
|
+
useFactory: function (firestore) {
|
|
1672
|
+
return new i3.CampaignDashboardFirestoreRepository(firestore.firestore);
|
|
1673
|
+
},
|
|
1674
|
+
deps: [i1$1.AngularFirestore],
|
|
1675
|
+
},
|
|
1676
|
+
{
|
|
1677
|
+
provide: 'EditionRepository',
|
|
1678
|
+
useFactory: function (firestore, subscriptionRepository) {
|
|
1679
|
+
return new i3.SubscriptionEditionFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
1680
|
+
},
|
|
1681
|
+
deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
|
|
1682
|
+
},
|
|
1683
|
+
{
|
|
1684
|
+
provide: 'HomeRepository',
|
|
1685
|
+
useFactory: function (firestore) {
|
|
1686
|
+
return new i3.HomeFirestoreRepository(firestore.firestore);
|
|
1687
|
+
},
|
|
1688
|
+
deps: [i1$1.AngularFirestore],
|
|
1689
|
+
},
|
|
1690
|
+
{
|
|
1691
|
+
provide: 'LeadRepository',
|
|
1692
|
+
useFactory: function (firestore) {
|
|
1693
|
+
return new i3.LeadFirestoreRepository(firestore.firestore);
|
|
1694
|
+
},
|
|
1695
|
+
deps: [i1$1.AngularFirestore],
|
|
1696
|
+
},
|
|
1697
|
+
{
|
|
1698
|
+
provide: 'LegacyOrderRepository',
|
|
1699
|
+
useFactory: function (firestore) {
|
|
1700
|
+
return new i3.LegacyOrderFirestoreRepository(firestore.firestore);
|
|
1701
|
+
},
|
|
1702
|
+
deps: [i1$1.AngularFirestore],
|
|
1703
|
+
},
|
|
1704
|
+
{
|
|
1705
|
+
provide: 'ShopMenuRepository',
|
|
1706
|
+
useFactory: function (firestore) {
|
|
1707
|
+
return new i3.ShopMenuFirestoreRepository(firestore.firestore);
|
|
1708
|
+
},
|
|
1709
|
+
deps: [i1$1.AngularFirestore],
|
|
1710
|
+
},
|
|
1711
|
+
{
|
|
1712
|
+
provide: 'OrderRepository',
|
|
1713
|
+
useFactory: function (firestore) {
|
|
1714
|
+
return new i3.OrderFirestoreRepository(firestore.firestore);
|
|
1715
|
+
},
|
|
1716
|
+
deps: [i1$1.AngularFirestore],
|
|
1717
|
+
},
|
|
1718
|
+
{
|
|
1719
|
+
provide: 'PaymentRepository',
|
|
1720
|
+
useFactory: function (firestore) {
|
|
1721
|
+
return new i3.PaymentFirestoreRepository(firestore.firestore);
|
|
1722
|
+
},
|
|
1723
|
+
deps: [i1$1.AngularFirestore],
|
|
1724
|
+
},
|
|
1725
|
+
{
|
|
1726
|
+
provide: i3.ProductFirestoreRepository,
|
|
1727
|
+
useFactory: function (firestore) {
|
|
1728
|
+
return new i3.ProductFirestoreRepository(firestore.firestore);
|
|
1729
|
+
},
|
|
1730
|
+
deps: [i1$1.AngularFirestore],
|
|
1731
|
+
},
|
|
1732
|
+
{
|
|
1733
|
+
provide: 'ShopSettingsRepository',
|
|
1734
|
+
useFactory: function (firestore) {
|
|
1735
|
+
return new i3.ShopSettingsFirestoreRepository(firestore.firestore);
|
|
1736
|
+
},
|
|
1737
|
+
deps: [i1$1.AngularFirestore],
|
|
1738
|
+
},
|
|
1739
|
+
{
|
|
1740
|
+
provide: 'SubscriptionPaymentRepository',
|
|
1741
|
+
useFactory: function (firestore, subscriptionRepository) {
|
|
1742
|
+
return new i3.SubscriptionPaymentFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
1743
|
+
},
|
|
1744
|
+
deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
|
|
1745
|
+
},
|
|
1746
|
+
{
|
|
1747
|
+
provide: 'SubscriptionPlanRepository',
|
|
1748
|
+
useFactory: function (firestore) {
|
|
1749
|
+
return new i3.SubscriptionPlanFirestoreRepository(firestore.firestore);
|
|
1750
|
+
},
|
|
1751
|
+
deps: [i1$1.AngularFirestore],
|
|
1752
|
+
},
|
|
1753
|
+
{
|
|
1754
|
+
provide: 'SubscriptionProductRepository',
|
|
1755
|
+
useFactory: function (firestore) {
|
|
1756
|
+
return new i3.SubscriptionProductFirestoreRepository(firestore.firestore);
|
|
1757
|
+
},
|
|
1758
|
+
deps: [i1$1.AngularFirestore],
|
|
1759
|
+
},
|
|
1760
|
+
{
|
|
1761
|
+
provide: 'SubscriptionRepository',
|
|
1762
|
+
useFactory: function (firestore) {
|
|
1763
|
+
return new i3.SubscriptionFirestoreRepository(firestore.firestore);
|
|
1764
|
+
},
|
|
1765
|
+
deps: [i1$1.AngularFirestore],
|
|
1766
|
+
},
|
|
1767
|
+
{
|
|
1768
|
+
provide: 'UserRepository',
|
|
1769
|
+
useFactory: function (firestore) {
|
|
1770
|
+
return new i3.UserFirestoreRepository(firestore.firestore);
|
|
1771
|
+
},
|
|
1772
|
+
deps: [i1$1.AngularFirestore],
|
|
1773
|
+
},
|
|
1774
|
+
{
|
|
1775
|
+
provide: 'UserAddressRepository',
|
|
1776
|
+
useFactory: function (firestore, userRepository) {
|
|
1777
|
+
return new i3.UserAddressFirestoreRepository(firestore.firestore, userRepository);
|
|
1778
|
+
},
|
|
1779
|
+
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1780
|
+
},
|
|
1781
|
+
{
|
|
1782
|
+
provide: 'UserPaymentMethodRepository',
|
|
1783
|
+
useFactory: function (firestore, userRepository) {
|
|
1784
|
+
return new i3.UserPaymentMethodFirestoreRepository(firestore.firestore, userRepository);
|
|
1785
|
+
},
|
|
1786
|
+
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1787
|
+
},
|
|
1788
|
+
{
|
|
1789
|
+
provide: i3.ProductVariantFirestoreRepository,
|
|
1790
|
+
useFactory: function (firestore, productRepository) {
|
|
1791
|
+
return new i3.ProductVariantFirestoreRepository(firestore.firestore, productRepository);
|
|
1792
|
+
},
|
|
1793
|
+
deps: [i1$1.AngularFirestore, i3.ProductFirestoreRepository],
|
|
1794
|
+
},
|
|
1795
|
+
{
|
|
1796
|
+
provide: i0.APP_INITIALIZER,
|
|
1797
|
+
useFactory: function (firestore) { return function () { return firestore.firestore.settings({ ignoreUndefinedProperties: true }); }; },
|
|
1798
|
+
deps: [i1$1.AngularFirestore],
|
|
1799
|
+
multi: true,
|
|
1800
|
+
},
|
|
1801
|
+
], imports: [[fire.AngularFireModule, AngularElasticSeachModule]] });
|
|
1802
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirestoreModule, decorators: [{
|
|
1803
|
+
type: i0.NgModule,
|
|
1804
|
+
args: [{
|
|
1805
|
+
imports: [fire.AngularFireModule, AngularElasticSeachModule],
|
|
1806
|
+
providers: [
|
|
1807
|
+
{
|
|
1808
|
+
provide: 'BeautyProfileRepository',
|
|
1809
|
+
useFactory: function (firestore, userRepository) {
|
|
1810
|
+
return new i3.UserBeautyProfileFirestoreRepository(firestore.firestore, userRepository);
|
|
1811
|
+
},
|
|
1812
|
+
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1813
|
+
},
|
|
1814
|
+
{
|
|
1815
|
+
provide: 'Buy2WinRepository',
|
|
1816
|
+
useFactory: function (firestore) {
|
|
1817
|
+
return new i3.Buy2WinFirestoreRepository(firestore.firestore);
|
|
1818
|
+
},
|
|
1819
|
+
deps: [i1$1.AngularFirestore],
|
|
1820
|
+
},
|
|
1821
|
+
{
|
|
1822
|
+
provide: i3.CategoryFirestoreRepository,
|
|
1823
|
+
useFactory: function (firestore) {
|
|
1824
|
+
return new i3.CategoryFirestoreRepository(firestore.firestore);
|
|
1825
|
+
},
|
|
1826
|
+
deps: [i1$1.AngularFirestore],
|
|
1827
|
+
},
|
|
1828
|
+
{
|
|
1829
|
+
provide: 'CheckoutRepository',
|
|
1830
|
+
useFactory: function (firestore) {
|
|
1831
|
+
return new i3.CheckoutFirestoreRepository(firestore.firestore);
|
|
1832
|
+
},
|
|
1833
|
+
deps: [i1$1.AngularFirestore],
|
|
1834
|
+
},
|
|
1835
|
+
{
|
|
1836
|
+
provide: 'CheckoutSubscriptionRepository',
|
|
1837
|
+
useFactory: function (firestore) {
|
|
1838
|
+
return new i3.CheckoutSubscriptionFirestoreRepository(firestore.firestore);
|
|
1839
|
+
},
|
|
1840
|
+
deps: [i1$1.AngularFirestore],
|
|
1841
|
+
},
|
|
1842
|
+
{
|
|
1843
|
+
provide: 'CouponRepository',
|
|
1844
|
+
useFactory: function (firestore) {
|
|
1845
|
+
return new i3.CouponFirestoreRepository(firestore.firestore);
|
|
1846
|
+
},
|
|
1847
|
+
deps: [i1$1.AngularFirestore],
|
|
1848
|
+
},
|
|
1849
|
+
{
|
|
1850
|
+
provide: 'CampaignHashtagRepository',
|
|
1851
|
+
useFactory: function (firestore) {
|
|
1852
|
+
return new i3.CampaignHashtagFirestoreRepository(firestore.firestore);
|
|
1853
|
+
},
|
|
1854
|
+
deps: [i1$1.AngularFirestore],
|
|
1855
|
+
},
|
|
1856
|
+
{
|
|
1857
|
+
provide: 'CampaignDashboardRepository',
|
|
1858
|
+
useFactory: function (firestore) {
|
|
1859
|
+
return new i3.CampaignDashboardFirestoreRepository(firestore.firestore);
|
|
1860
|
+
},
|
|
1861
|
+
deps: [i1$1.AngularFirestore],
|
|
1862
|
+
},
|
|
1863
|
+
{
|
|
1864
|
+
provide: 'EditionRepository',
|
|
1865
|
+
useFactory: function (firestore, subscriptionRepository) {
|
|
1866
|
+
return new i3.SubscriptionEditionFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
1867
|
+
},
|
|
1868
|
+
deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
|
|
1869
|
+
},
|
|
1870
|
+
{
|
|
1871
|
+
provide: 'HomeRepository',
|
|
1872
|
+
useFactory: function (firestore) {
|
|
1873
|
+
return new i3.HomeFirestoreRepository(firestore.firestore);
|
|
1874
|
+
},
|
|
1875
|
+
deps: [i1$1.AngularFirestore],
|
|
1876
|
+
},
|
|
1877
|
+
{
|
|
1878
|
+
provide: 'LeadRepository',
|
|
1879
|
+
useFactory: function (firestore) {
|
|
1880
|
+
return new i3.LeadFirestoreRepository(firestore.firestore);
|
|
1881
|
+
},
|
|
1882
|
+
deps: [i1$1.AngularFirestore],
|
|
1883
|
+
},
|
|
1884
|
+
{
|
|
1885
|
+
provide: 'LegacyOrderRepository',
|
|
1886
|
+
useFactory: function (firestore) {
|
|
1887
|
+
return new i3.LegacyOrderFirestoreRepository(firestore.firestore);
|
|
1888
|
+
},
|
|
1889
|
+
deps: [i1$1.AngularFirestore],
|
|
1890
|
+
},
|
|
1891
|
+
{
|
|
1892
|
+
provide: 'ShopMenuRepository',
|
|
1893
|
+
useFactory: function (firestore) {
|
|
1894
|
+
return new i3.ShopMenuFirestoreRepository(firestore.firestore);
|
|
1895
|
+
},
|
|
1896
|
+
deps: [i1$1.AngularFirestore],
|
|
1897
|
+
},
|
|
1898
|
+
{
|
|
1899
|
+
provide: 'OrderRepository',
|
|
1900
|
+
useFactory: function (firestore) {
|
|
1901
|
+
return new i3.OrderFirestoreRepository(firestore.firestore);
|
|
1902
|
+
},
|
|
1903
|
+
deps: [i1$1.AngularFirestore],
|
|
1904
|
+
},
|
|
1905
|
+
{
|
|
1906
|
+
provide: 'PaymentRepository',
|
|
1907
|
+
useFactory: function (firestore) {
|
|
1908
|
+
return new i3.PaymentFirestoreRepository(firestore.firestore);
|
|
1909
|
+
},
|
|
1910
|
+
deps: [i1$1.AngularFirestore],
|
|
1911
|
+
},
|
|
1912
|
+
{
|
|
1913
|
+
provide: i3.ProductFirestoreRepository,
|
|
1914
|
+
useFactory: function (firestore) {
|
|
1915
|
+
return new i3.ProductFirestoreRepository(firestore.firestore);
|
|
1916
|
+
},
|
|
1917
|
+
deps: [i1$1.AngularFirestore],
|
|
1918
|
+
},
|
|
1919
|
+
{
|
|
1920
|
+
provide: 'ShopSettingsRepository',
|
|
1921
|
+
useFactory: function (firestore) {
|
|
1922
|
+
return new i3.ShopSettingsFirestoreRepository(firestore.firestore);
|
|
1923
|
+
},
|
|
1924
|
+
deps: [i1$1.AngularFirestore],
|
|
1925
|
+
},
|
|
1926
|
+
{
|
|
1927
|
+
provide: 'SubscriptionPaymentRepository',
|
|
1928
|
+
useFactory: function (firestore, subscriptionRepository) {
|
|
1929
|
+
return new i3.SubscriptionPaymentFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
1930
|
+
},
|
|
1931
|
+
deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
|
|
1932
|
+
},
|
|
1933
|
+
{
|
|
1934
|
+
provide: 'SubscriptionPlanRepository',
|
|
1935
|
+
useFactory: function (firestore) {
|
|
1936
|
+
return new i3.SubscriptionPlanFirestoreRepository(firestore.firestore);
|
|
1937
|
+
},
|
|
1938
|
+
deps: [i1$1.AngularFirestore],
|
|
1939
|
+
},
|
|
1940
|
+
{
|
|
1941
|
+
provide: 'SubscriptionProductRepository',
|
|
1942
|
+
useFactory: function (firestore) {
|
|
1943
|
+
return new i3.SubscriptionProductFirestoreRepository(firestore.firestore);
|
|
1944
|
+
},
|
|
1945
|
+
deps: [i1$1.AngularFirestore],
|
|
1946
|
+
},
|
|
1947
|
+
{
|
|
1948
|
+
provide: 'SubscriptionRepository',
|
|
1949
|
+
useFactory: function (firestore) {
|
|
1950
|
+
return new i3.SubscriptionFirestoreRepository(firestore.firestore);
|
|
1951
|
+
},
|
|
1952
|
+
deps: [i1$1.AngularFirestore],
|
|
1953
|
+
},
|
|
1954
|
+
{
|
|
1955
|
+
provide: 'UserRepository',
|
|
1956
|
+
useFactory: function (firestore) {
|
|
1957
|
+
return new i3.UserFirestoreRepository(firestore.firestore);
|
|
1958
|
+
},
|
|
1959
|
+
deps: [i1$1.AngularFirestore],
|
|
1960
|
+
},
|
|
1961
|
+
{
|
|
1962
|
+
provide: 'UserAddressRepository',
|
|
1963
|
+
useFactory: function (firestore, userRepository) {
|
|
1964
|
+
return new i3.UserAddressFirestoreRepository(firestore.firestore, userRepository);
|
|
1965
|
+
},
|
|
1966
|
+
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1967
|
+
},
|
|
1968
|
+
{
|
|
1969
|
+
provide: 'UserPaymentMethodRepository',
|
|
1970
|
+
useFactory: function (firestore, userRepository) {
|
|
1971
|
+
return new i3.UserPaymentMethodFirestoreRepository(firestore.firestore, userRepository);
|
|
1972
|
+
},
|
|
1973
|
+
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1974
|
+
},
|
|
1975
|
+
{
|
|
1976
|
+
provide: i3.ProductVariantFirestoreRepository,
|
|
1977
|
+
useFactory: function (firestore, productRepository) {
|
|
1978
|
+
return new i3.ProductVariantFirestoreRepository(firestore.firestore, productRepository);
|
|
1979
|
+
},
|
|
1980
|
+
deps: [i1$1.AngularFirestore, i3.ProductFirestoreRepository],
|
|
1981
|
+
},
|
|
1982
|
+
{
|
|
1983
|
+
provide: i0.APP_INITIALIZER,
|
|
1984
|
+
useFactory: function (firestore) { return function () { return firestore.firestore.settings({ ignoreUndefinedProperties: true }); }; },
|
|
1985
|
+
deps: [i1$1.AngularFirestore],
|
|
1986
|
+
multi: true,
|
|
1987
|
+
},
|
|
1988
|
+
],
|
|
1989
|
+
}]
|
|
2081
1990
|
}] });
|
|
2082
1991
|
|
|
2083
|
-
var AngularHasuraGraphQLModule = /** @class */ (function () {
|
|
2084
|
-
function AngularHasuraGraphQLModule() {
|
|
2085
|
-
}
|
|
2086
|
-
AngularHasuraGraphQLModule.initializeApp = function (options) {
|
|
2087
|
-
return {
|
|
2088
|
-
ngModule: AngularHasuraGraphQLModule,
|
|
2089
|
-
providers: [{ provide: HASURA_OPTIONS, useValue: options }],
|
|
2090
|
-
};
|
|
2091
|
-
};
|
|
2092
|
-
return AngularHasuraGraphQLModule;
|
|
2093
|
-
}());
|
|
2094
|
-
AngularHasuraGraphQLModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularHasuraGraphQLModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
2095
|
-
AngularHasuraGraphQLModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularHasuraGraphQLModule });
|
|
2096
|
-
AngularHasuraGraphQLModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularHasuraGraphQLModule, providers: [
|
|
2097
|
-
{
|
|
2098
|
-
provide: 'CategoryRepository',
|
|
2099
|
-
useExisting: i3.CategoryHasuraGraphQLRepository,
|
|
2100
|
-
},
|
|
2101
|
-
{
|
|
2102
|
-
provide: i3.CategoryHasuraGraphQLRepository,
|
|
2103
|
-
useFactory: function (options, productRepository, categoryFilterRepository) {
|
|
2104
|
-
return new i3.CategoryHasuraGraphQLRepository(options.endpoint, options.credentials, productRepository, categoryFilterRepository);
|
|
2105
|
-
},
|
|
2106
|
-
deps: [HASURA_OPTIONS, i3.ProductHasuraGraphQLRepository, i3.CategoryFilterHasuraGraphQLRepository],
|
|
2107
|
-
},
|
|
2108
|
-
{
|
|
2109
|
-
provide: 'ProductRepository',
|
|
2110
|
-
useExisting: i3.ProductHasuraGraphQLRepository,
|
|
2111
|
-
},
|
|
2112
|
-
{
|
|
2113
|
-
provide: i3.ProductHasuraGraphQLRepository,
|
|
2114
|
-
useFactory: function (options) {
|
|
2115
|
-
return new i3.ProductHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
2116
|
-
},
|
|
2117
|
-
deps: [HASURA_OPTIONS],
|
|
2118
|
-
},
|
|
2119
|
-
{
|
|
2120
|
-
provide: 'VariantRepository',
|
|
2121
|
-
useExisting: i3.VariantHasuraGraphQLRepository,
|
|
2122
|
-
},
|
|
2123
|
-
{
|
|
2124
|
-
provide: i3.VariantHasuraGraphQLRepository,
|
|
2125
|
-
useFactory: function (options) {
|
|
2126
|
-
return new i3.VariantHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
2127
|
-
},
|
|
2128
|
-
deps: [HASURA_OPTIONS],
|
|
2129
|
-
},
|
|
2130
|
-
{
|
|
2131
|
-
provide: 'CategoryFilterRepository',
|
|
2132
|
-
useExisting: i3.CategoryFilterHasuraGraphQLRepository,
|
|
2133
|
-
},
|
|
2134
|
-
{
|
|
2135
|
-
provide: i3.CategoryFilterHasuraGraphQLRepository,
|
|
2136
|
-
useFactory: function (options) {
|
|
2137
|
-
return new i3.CategoryFilterHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
2138
|
-
},
|
|
2139
|
-
deps: [HASURA_OPTIONS],
|
|
2140
|
-
},
|
|
2141
|
-
{
|
|
2142
|
-
provide: 'FilterOptionRepository',
|
|
2143
|
-
useExisting: i3.FilterOptionHasuraGraphQLRepository,
|
|
2144
|
-
},
|
|
2145
|
-
{
|
|
2146
|
-
provide: i3.FilterOptionHasuraGraphQLRepository,
|
|
2147
|
-
useFactory: function (options) {
|
|
2148
|
-
return new i3.FilterOptionHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
2149
|
-
},
|
|
2150
|
-
deps: [HASURA_OPTIONS],
|
|
2151
|
-
},
|
|
2152
|
-
{
|
|
2153
|
-
provide: 'FilterRepository',
|
|
2154
|
-
useExisting: i3.FilterHasuraGraphQLRepository,
|
|
2155
|
-
},
|
|
2156
|
-
{
|
|
2157
|
-
provide: i3.FilterHasuraGraphQLRepository,
|
|
2158
|
-
useFactory: function (options, filterOptionRepository, categoryFilterRepository) {
|
|
2159
|
-
return new i3.FilterHasuraGraphQLRepository(options.endpoint, options.credentials, filterOptionRepository, categoryFilterRepository);
|
|
2160
|
-
},
|
|
2161
|
-
deps: [HASURA_OPTIONS, i3.FilterOptionHasuraGraphQLRepository, i3.CategoryFilterHasuraGraphQLRepository],
|
|
2162
|
-
},
|
|
2163
|
-
] });
|
|
2164
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularHasuraGraphQLModule, decorators: [{
|
|
2165
|
-
type: i0.NgModule,
|
|
2166
|
-
args: [{
|
|
2167
|
-
providers: [
|
|
2168
|
-
{
|
|
2169
|
-
provide: 'CategoryRepository',
|
|
2170
|
-
useExisting: i3.CategoryHasuraGraphQLRepository,
|
|
2171
|
-
},
|
|
2172
|
-
{
|
|
2173
|
-
provide: i3.CategoryHasuraGraphQLRepository,
|
|
2174
|
-
useFactory: function (options, productRepository, categoryFilterRepository) {
|
|
2175
|
-
return new i3.CategoryHasuraGraphQLRepository(options.endpoint, options.credentials, productRepository, categoryFilterRepository);
|
|
2176
|
-
},
|
|
2177
|
-
deps: [HASURA_OPTIONS, i3.ProductHasuraGraphQLRepository, i3.CategoryFilterHasuraGraphQLRepository],
|
|
2178
|
-
},
|
|
2179
|
-
{
|
|
2180
|
-
provide: 'ProductRepository',
|
|
2181
|
-
useExisting: i3.ProductHasuraGraphQLRepository,
|
|
2182
|
-
},
|
|
2183
|
-
{
|
|
2184
|
-
provide: i3.ProductHasuraGraphQLRepository,
|
|
2185
|
-
useFactory: function (options) {
|
|
2186
|
-
return new i3.ProductHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
2187
|
-
},
|
|
2188
|
-
deps: [HASURA_OPTIONS],
|
|
2189
|
-
},
|
|
2190
|
-
{
|
|
2191
|
-
provide: 'VariantRepository',
|
|
2192
|
-
useExisting: i3.VariantHasuraGraphQLRepository,
|
|
2193
|
-
},
|
|
2194
|
-
{
|
|
2195
|
-
provide: i3.VariantHasuraGraphQLRepository,
|
|
2196
|
-
useFactory: function (options) {
|
|
2197
|
-
return new i3.VariantHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
2198
|
-
},
|
|
2199
|
-
deps: [HASURA_OPTIONS],
|
|
2200
|
-
},
|
|
2201
|
-
{
|
|
2202
|
-
provide: 'CategoryFilterRepository',
|
|
2203
|
-
useExisting: i3.CategoryFilterHasuraGraphQLRepository,
|
|
2204
|
-
},
|
|
2205
|
-
{
|
|
2206
|
-
provide: i3.CategoryFilterHasuraGraphQLRepository,
|
|
2207
|
-
useFactory: function (options) {
|
|
2208
|
-
return new i3.CategoryFilterHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
2209
|
-
},
|
|
2210
|
-
deps: [HASURA_OPTIONS],
|
|
2211
|
-
},
|
|
2212
|
-
{
|
|
2213
|
-
provide: 'FilterOptionRepository',
|
|
2214
|
-
useExisting: i3.FilterOptionHasuraGraphQLRepository,
|
|
2215
|
-
},
|
|
2216
|
-
{
|
|
2217
|
-
provide: i3.FilterOptionHasuraGraphQLRepository,
|
|
2218
|
-
useFactory: function (options) {
|
|
2219
|
-
return new i3.FilterOptionHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
2220
|
-
},
|
|
2221
|
-
deps: [HASURA_OPTIONS],
|
|
2222
|
-
},
|
|
2223
|
-
{
|
|
2224
|
-
provide: 'FilterRepository',
|
|
2225
|
-
useExisting: i3.FilterHasuraGraphQLRepository,
|
|
2226
|
-
},
|
|
2227
|
-
{
|
|
2228
|
-
provide: i3.FilterHasuraGraphQLRepository,
|
|
2229
|
-
useFactory: function (options, filterOptionRepository, categoryFilterRepository) {
|
|
2230
|
-
return new i3.FilterHasuraGraphQLRepository(options.endpoint, options.credentials, filterOptionRepository, categoryFilterRepository);
|
|
2231
|
-
},
|
|
2232
|
-
deps: [HASURA_OPTIONS, i3.FilterOptionHasuraGraphQLRepository, i3.CategoryFilterHasuraGraphQLRepository],
|
|
2233
|
-
},
|
|
2234
|
-
],
|
|
2235
|
-
}]
|
|
1992
|
+
var AngularHasuraGraphQLModule = /** @class */ (function () {
|
|
1993
|
+
function AngularHasuraGraphQLModule() {
|
|
1994
|
+
}
|
|
1995
|
+
AngularHasuraGraphQLModule.initializeApp = function (options) {
|
|
1996
|
+
return {
|
|
1997
|
+
ngModule: AngularHasuraGraphQLModule,
|
|
1998
|
+
providers: [{ provide: HASURA_OPTIONS, useValue: options }],
|
|
1999
|
+
};
|
|
2000
|
+
};
|
|
2001
|
+
return AngularHasuraGraphQLModule;
|
|
2002
|
+
}());
|
|
2003
|
+
AngularHasuraGraphQLModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularHasuraGraphQLModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
2004
|
+
AngularHasuraGraphQLModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularHasuraGraphQLModule });
|
|
2005
|
+
AngularHasuraGraphQLModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularHasuraGraphQLModule, providers: [
|
|
2006
|
+
{
|
|
2007
|
+
provide: 'CategoryRepository',
|
|
2008
|
+
useExisting: i3.CategoryHasuraGraphQLRepository,
|
|
2009
|
+
},
|
|
2010
|
+
{
|
|
2011
|
+
provide: i3.CategoryHasuraGraphQLRepository,
|
|
2012
|
+
useFactory: function (options, productRepository, categoryFilterRepository) {
|
|
2013
|
+
return new i3.CategoryHasuraGraphQLRepository(options.endpoint, options.credentials, productRepository, categoryFilterRepository);
|
|
2014
|
+
},
|
|
2015
|
+
deps: [HASURA_OPTIONS, i3.ProductHasuraGraphQLRepository, i3.CategoryFilterHasuraGraphQLRepository],
|
|
2016
|
+
},
|
|
2017
|
+
{
|
|
2018
|
+
provide: 'ProductRepository',
|
|
2019
|
+
useExisting: i3.ProductHasuraGraphQLRepository,
|
|
2020
|
+
},
|
|
2021
|
+
{
|
|
2022
|
+
provide: i3.ProductHasuraGraphQLRepository,
|
|
2023
|
+
useFactory: function (options) {
|
|
2024
|
+
return new i3.ProductHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
2025
|
+
},
|
|
2026
|
+
deps: [HASURA_OPTIONS],
|
|
2027
|
+
},
|
|
2028
|
+
{
|
|
2029
|
+
provide: 'VariantRepository',
|
|
2030
|
+
useExisting: i3.VariantHasuraGraphQLRepository,
|
|
2031
|
+
},
|
|
2032
|
+
{
|
|
2033
|
+
provide: i3.VariantHasuraGraphQLRepository,
|
|
2034
|
+
useFactory: function (options) {
|
|
2035
|
+
return new i3.VariantHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
2036
|
+
},
|
|
2037
|
+
deps: [HASURA_OPTIONS],
|
|
2038
|
+
},
|
|
2039
|
+
{
|
|
2040
|
+
provide: 'CategoryFilterRepository',
|
|
2041
|
+
useExisting: i3.CategoryFilterHasuraGraphQLRepository,
|
|
2042
|
+
},
|
|
2043
|
+
{
|
|
2044
|
+
provide: i3.CategoryFilterHasuraGraphQLRepository,
|
|
2045
|
+
useFactory: function (options) {
|
|
2046
|
+
return new i3.CategoryFilterHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
2047
|
+
},
|
|
2048
|
+
deps: [HASURA_OPTIONS],
|
|
2049
|
+
},
|
|
2050
|
+
{
|
|
2051
|
+
provide: 'FilterOptionRepository',
|
|
2052
|
+
useExisting: i3.FilterOptionHasuraGraphQLRepository,
|
|
2053
|
+
},
|
|
2054
|
+
{
|
|
2055
|
+
provide: i3.FilterOptionHasuraGraphQLRepository,
|
|
2056
|
+
useFactory: function (options) {
|
|
2057
|
+
return new i3.FilterOptionHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
2058
|
+
},
|
|
2059
|
+
deps: [HASURA_OPTIONS],
|
|
2060
|
+
},
|
|
2061
|
+
{
|
|
2062
|
+
provide: 'FilterRepository',
|
|
2063
|
+
useExisting: i3.FilterHasuraGraphQLRepository,
|
|
2064
|
+
},
|
|
2065
|
+
{
|
|
2066
|
+
provide: i3.FilterHasuraGraphQLRepository,
|
|
2067
|
+
useFactory: function (options, filterOptionRepository, categoryFilterRepository) {
|
|
2068
|
+
return new i3.FilterHasuraGraphQLRepository(options.endpoint, options.credentials, filterOptionRepository, categoryFilterRepository);
|
|
2069
|
+
},
|
|
2070
|
+
deps: [HASURA_OPTIONS, i3.FilterOptionHasuraGraphQLRepository, i3.CategoryFilterHasuraGraphQLRepository],
|
|
2071
|
+
},
|
|
2072
|
+
] });
|
|
2073
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularHasuraGraphQLModule, decorators: [{
|
|
2074
|
+
type: i0.NgModule,
|
|
2075
|
+
args: [{
|
|
2076
|
+
providers: [
|
|
2077
|
+
{
|
|
2078
|
+
provide: 'CategoryRepository',
|
|
2079
|
+
useExisting: i3.CategoryHasuraGraphQLRepository,
|
|
2080
|
+
},
|
|
2081
|
+
{
|
|
2082
|
+
provide: i3.CategoryHasuraGraphQLRepository,
|
|
2083
|
+
useFactory: function (options, productRepository, categoryFilterRepository) {
|
|
2084
|
+
return new i3.CategoryHasuraGraphQLRepository(options.endpoint, options.credentials, productRepository, categoryFilterRepository);
|
|
2085
|
+
},
|
|
2086
|
+
deps: [HASURA_OPTIONS, i3.ProductHasuraGraphQLRepository, i3.CategoryFilterHasuraGraphQLRepository],
|
|
2087
|
+
},
|
|
2088
|
+
{
|
|
2089
|
+
provide: 'ProductRepository',
|
|
2090
|
+
useExisting: i3.ProductHasuraGraphQLRepository,
|
|
2091
|
+
},
|
|
2092
|
+
{
|
|
2093
|
+
provide: i3.ProductHasuraGraphQLRepository,
|
|
2094
|
+
useFactory: function (options) {
|
|
2095
|
+
return new i3.ProductHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
2096
|
+
},
|
|
2097
|
+
deps: [HASURA_OPTIONS],
|
|
2098
|
+
},
|
|
2099
|
+
{
|
|
2100
|
+
provide: 'VariantRepository',
|
|
2101
|
+
useExisting: i3.VariantHasuraGraphQLRepository,
|
|
2102
|
+
},
|
|
2103
|
+
{
|
|
2104
|
+
provide: i3.VariantHasuraGraphQLRepository,
|
|
2105
|
+
useFactory: function (options) {
|
|
2106
|
+
return new i3.VariantHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
2107
|
+
},
|
|
2108
|
+
deps: [HASURA_OPTIONS],
|
|
2109
|
+
},
|
|
2110
|
+
{
|
|
2111
|
+
provide: 'CategoryFilterRepository',
|
|
2112
|
+
useExisting: i3.CategoryFilterHasuraGraphQLRepository,
|
|
2113
|
+
},
|
|
2114
|
+
{
|
|
2115
|
+
provide: i3.CategoryFilterHasuraGraphQLRepository,
|
|
2116
|
+
useFactory: function (options) {
|
|
2117
|
+
return new i3.CategoryFilterHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
2118
|
+
},
|
|
2119
|
+
deps: [HASURA_OPTIONS],
|
|
2120
|
+
},
|
|
2121
|
+
{
|
|
2122
|
+
provide: 'FilterOptionRepository',
|
|
2123
|
+
useExisting: i3.FilterOptionHasuraGraphQLRepository,
|
|
2124
|
+
},
|
|
2125
|
+
{
|
|
2126
|
+
provide: i3.FilterOptionHasuraGraphQLRepository,
|
|
2127
|
+
useFactory: function (options) {
|
|
2128
|
+
return new i3.FilterOptionHasuraGraphQLRepository(options.endpoint, options.credentials);
|
|
2129
|
+
},
|
|
2130
|
+
deps: [HASURA_OPTIONS],
|
|
2131
|
+
},
|
|
2132
|
+
{
|
|
2133
|
+
provide: 'FilterRepository',
|
|
2134
|
+
useExisting: i3.FilterHasuraGraphQLRepository,
|
|
2135
|
+
},
|
|
2136
|
+
{
|
|
2137
|
+
provide: i3.FilterHasuraGraphQLRepository,
|
|
2138
|
+
useFactory: function (options, filterOptionRepository, categoryFilterRepository) {
|
|
2139
|
+
return new i3.FilterHasuraGraphQLRepository(options.endpoint, options.credentials, filterOptionRepository, categoryFilterRepository);
|
|
2140
|
+
},
|
|
2141
|
+
deps: [HASURA_OPTIONS, i3.FilterOptionHasuraGraphQLRepository, i3.CategoryFilterHasuraGraphQLRepository],
|
|
2142
|
+
},
|
|
2143
|
+
],
|
|
2144
|
+
}]
|
|
2236
2145
|
}] });
|
|
2237
2146
|
|
|
2238
|
-
var AngularConnectModule = /** @class */ (function () {
|
|
2239
|
-
function AngularConnectModule() {
|
|
2240
|
-
}
|
|
2241
|
-
AngularConnectModule.initializeApp = function (defaultShop, options, nameOrConfig) {
|
|
2242
|
-
return {
|
|
2243
|
-
ngModule: AngularConnectModule,
|
|
2244
|
-
providers: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((i3.isNil(defaultShop) ? [] : [{ provide: DEFAULT_SHOP, useValue: defaultShop }]))), __read((i3.isNil(options === null || options === void 0 ? void 0 : options.firebase) ? [] : [{ provide: fire.FIREBASE_OPTIONS, useValue: options === null || options === void 0 ? void 0 : options.firebase }]))), __read((i3.isNil(options === null || options === void 0 ? void 0 : options.firebase) ? [] : [{ provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig }]))), __read((i3.isNil(options === null || options === void 0 ? void 0 : options.elasticSearch) ? [] : [{ provide: ES_CONFIG, useValue: options.elasticSearch }]))), __read((i3.isNil(options === null || options === void 0 ? void 0 : options.hasura) ? [] : [{ provide: HASURA_OPTIONS, useValue: options.hasura }]))), __read((i3.isNil(options === null || options === void 0 ? void 0 : options.backendUrl) ? [] : [{ provide: BACKEND_URL, useValue: options.backendUrl }]))),
|
|
2245
|
-
};
|
|
2246
|
-
};
|
|
2247
|
-
return AngularConnectModule;
|
|
2248
|
-
}());
|
|
2249
|
-
AngularConnectModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularConnectModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
2250
|
-
AngularConnectModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularConnectModule, imports: [fire.AngularFireModule, AngularFirestoreModule, AngularHasuraGraphQLModule] });
|
|
2251
|
-
AngularConnectModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularConnectModule, providers: [
|
|
2252
|
-
AuthService,
|
|
2253
|
-
CartService,
|
|
2254
|
-
CheckoutService,
|
|
2255
|
-
CheckoutSubscriptionService,
|
|
2256
|
-
CouponService,
|
|
2257
|
-
HomeShopService,
|
|
2258
|
-
OrderService,
|
|
2259
|
-
ShippingService,
|
|
2260
|
-
], imports: [[fire.AngularFireModule, AngularFirestoreModule, AngularHasuraGraphQLModule]] });
|
|
2261
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularConnectModule, decorators: [{
|
|
2262
|
-
type: i0.NgModule,
|
|
2263
|
-
args: [{
|
|
2264
|
-
imports: [fire.AngularFireModule, AngularFirestoreModule, AngularHasuraGraphQLModule],
|
|
2265
|
-
providers: [
|
|
2266
|
-
AuthService,
|
|
2267
|
-
CartService,
|
|
2268
|
-
CheckoutService,
|
|
2269
|
-
CheckoutSubscriptionService,
|
|
2270
|
-
CouponService,
|
|
2271
|
-
HomeShopService,
|
|
2272
|
-
OrderService,
|
|
2273
|
-
ShippingService,
|
|
2274
|
-
],
|
|
2275
|
-
}]
|
|
2147
|
+
var AngularConnectModule = /** @class */ (function () {
|
|
2148
|
+
function AngularConnectModule() {
|
|
2149
|
+
}
|
|
2150
|
+
AngularConnectModule.initializeApp = function (defaultShop, options, nameOrConfig) {
|
|
2151
|
+
return {
|
|
2152
|
+
ngModule: AngularConnectModule,
|
|
2153
|
+
providers: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((i3.isNil(defaultShop) ? [] : [{ provide: DEFAULT_SHOP, useValue: defaultShop }]))), __read((i3.isNil(options === null || options === void 0 ? void 0 : options.firebase) ? [] : [{ provide: fire.FIREBASE_OPTIONS, useValue: options === null || options === void 0 ? void 0 : options.firebase }]))), __read((i3.isNil(options === null || options === void 0 ? void 0 : options.firebase) ? [] : [{ provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig }]))), __read((i3.isNil(options === null || options === void 0 ? void 0 : options.elasticSearch) ? [] : [{ provide: ES_CONFIG, useValue: options.elasticSearch }]))), __read((i3.isNil(options === null || options === void 0 ? void 0 : options.hasura) ? [] : [{ provide: HASURA_OPTIONS, useValue: options.hasura }]))), __read((i3.isNil(options === null || options === void 0 ? void 0 : options.backendUrl) ? [] : [{ provide: BACKEND_URL, useValue: options.backendUrl }]))),
|
|
2154
|
+
};
|
|
2155
|
+
};
|
|
2156
|
+
return AngularConnectModule;
|
|
2157
|
+
}());
|
|
2158
|
+
AngularConnectModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularConnectModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
2159
|
+
AngularConnectModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularConnectModule, imports: [fire.AngularFireModule, AngularFirestoreModule, AngularHasuraGraphQLModule] });
|
|
2160
|
+
AngularConnectModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularConnectModule, providers: [
|
|
2161
|
+
AuthService,
|
|
2162
|
+
CartService,
|
|
2163
|
+
CheckoutService,
|
|
2164
|
+
CheckoutSubscriptionService,
|
|
2165
|
+
CouponService,
|
|
2166
|
+
HomeShopService,
|
|
2167
|
+
OrderService,
|
|
2168
|
+
ShippingService,
|
|
2169
|
+
], imports: [[fire.AngularFireModule, AngularFirestoreModule, AngularHasuraGraphQLModule]] });
|
|
2170
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularConnectModule, decorators: [{
|
|
2171
|
+
type: i0.NgModule,
|
|
2172
|
+
args: [{
|
|
2173
|
+
imports: [fire.AngularFireModule, AngularFirestoreModule, AngularHasuraGraphQLModule],
|
|
2174
|
+
providers: [
|
|
2175
|
+
AuthService,
|
|
2176
|
+
CartService,
|
|
2177
|
+
CheckoutService,
|
|
2178
|
+
CheckoutSubscriptionService,
|
|
2179
|
+
CouponService,
|
|
2180
|
+
HomeShopService,
|
|
2181
|
+
OrderService,
|
|
2182
|
+
ShippingService,
|
|
2183
|
+
],
|
|
2184
|
+
}]
|
|
2276
2185
|
}] });
|
|
2277
2186
|
|
|
2278
|
-
/**
|
|
2279
|
-
* Generated bundle index. Do not edit.
|
|
2187
|
+
/**
|
|
2188
|
+
* Generated bundle index. Do not edit.
|
|
2280
2189
|
*/
|
|
2281
2190
|
|
|
2282
2191
|
exports.AngularConnectModule = AngularConnectModule;
|