@infrab4a/connect-angular 0.6.2 → 0.6.4
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/bundles/infrab4a-connect-angular.umd.js +962 -959
- package/bundles/infrab4a-connect-angular.umd.js.map +1 -1
- package/esm2015/infrab4a-connect-angular.js +4 -4
- package/esm2015/lib/angular-connect.module.js +30 -30
- package/esm2015/lib/angular-firebase-auth.module.js +71 -71
- package/esm2015/lib/angular-firestore.module.js +295 -295
- package/esm2015/lib/consts/default-shop.const.js +2 -2
- package/esm2015/lib/consts/index.js +2 -2
- package/esm2015/lib/index.js +5 -5
- package/esm2015/lib/services/auth.service.js +30 -27
- package/esm2015/lib/services/cart.service.js +153 -153
- package/esm2015/lib/services/checkout.service.js +57 -57
- package/esm2015/lib/services/index.js +5 -5
- package/esm2015/lib/services/order.service.js +32 -32
- package/esm2015/lib/services/types/index.js +2 -2
- package/esm2015/lib/services/types/required-checkout-data.type.js +2 -2
- package/esm2015/public-api.js +2 -2
- package/fesm2015/infrab4a-connect-angular.js +607 -604
- package/fesm2015/infrab4a-connect-angular.js.map +1 -1
- package/infrab4a-connect-angular.d.ts +5 -5
- package/lib/angular-connect.module.d.ts +12 -12
- package/lib/angular-firebase-auth.module.d.ts +10 -10
- package/lib/angular-firestore.module.d.ts +10 -10
- package/lib/consts/default-shop.const.d.ts +1 -1
- package/lib/consts/index.d.ts +1 -1
- package/lib/index.d.ts +4 -4
- package/lib/services/auth.service.d.ts +15 -13
- package/lib/services/cart.service.d.ts +35 -35
- package/lib/services/checkout.service.d.ts +18 -18
- package/lib/services/index.d.ts +4 -4
- package/lib/services/order.service.d.ts +13 -13
- package/lib/services/types/index.d.ts +1 -1
- package/lib/services/types/required-checkout-data.type.d.ts +2 -2
- package/package.json +2 -2
- package/public-api.d.ts +1 -1
|
@@ -30,983 +30,986 @@
|
|
|
30
30
|
var cookie__default = /*#__PURE__*/_interopDefaultLegacy(cookie);
|
|
31
31
|
var i1__namespace$2 = /*#__PURE__*/_interopNamespace(i1$2);
|
|
32
32
|
|
|
33
|
-
var AuthService = /** @class */ (function () {
|
|
34
|
-
function AuthService(angularFireAuth, userRepository) {
|
|
35
|
-
this.angularFireAuth = angularFireAuth;
|
|
36
|
-
this.userRepository = userRepository;
|
|
37
|
-
}
|
|
38
|
-
AuthService.prototype.getUser = function () {
|
|
39
|
-
var _this = this;
|
|
40
|
-
return
|
|
41
|
-
};
|
|
42
|
-
AuthService.prototype.getTokenId = function () {
|
|
43
|
-
return this.angularFireAuth.idToken;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
33
|
+
var AuthService = /** @class */ (function () {
|
|
34
|
+
function AuthService(angularFireAuth, userRepository) {
|
|
35
|
+
this.angularFireAuth = angularFireAuth;
|
|
36
|
+
this.userRepository = userRepository;
|
|
37
|
+
}
|
|
38
|
+
AuthService.prototype.getUser = function () {
|
|
39
|
+
var _this = this;
|
|
40
|
+
return this.getFireUser().pipe(operators.mergeMap(function (user) { return (user && !user.isAnonymous ? rxjs.of(user.uid) : rxjs.EMPTY); }), operators.mergeMap(function (id) { return _this.userRepository.get({ id: id }); }));
|
|
41
|
+
};
|
|
42
|
+
AuthService.prototype.getTokenId = function () {
|
|
43
|
+
return this.angularFireAuth.idToken;
|
|
44
|
+
};
|
|
45
|
+
AuthService.prototype.getFireUser = function () {
|
|
46
|
+
return this.angularFireAuth.user;
|
|
47
|
+
};
|
|
48
|
+
return AuthService;
|
|
49
|
+
}());
|
|
50
|
+
AuthService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AuthService, deps: [{ token: i1__namespace.AngularFireAuth }, { token: 'UserRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
51
|
+
AuthService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AuthService });
|
|
52
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AuthService, decorators: [{
|
|
53
|
+
type: i0.Injectable
|
|
54
|
+
}], ctorParameters: function () {
|
|
55
|
+
return [{ type: i1__namespace.AngularFireAuth }, { type: undefined, decorators: [{
|
|
56
|
+
type: i0.Inject,
|
|
57
|
+
args: ['UserRepository']
|
|
58
|
+
}] }];
|
|
56
59
|
} });
|
|
57
60
|
|
|
58
61
|
var DEFAULT_SHOP = 'DEFAULT_SHOP';
|
|
59
62
|
|
|
60
|
-
/*! *****************************************************************************
|
|
61
|
-
Copyright (c) Microsoft Corporation.
|
|
62
|
-
|
|
63
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
64
|
-
purpose with or without fee is hereby granted.
|
|
65
|
-
|
|
66
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
67
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
68
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
69
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
70
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
71
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
72
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
73
|
-
***************************************************************************** */
|
|
74
|
-
/* global Reflect, Promise */
|
|
75
|
-
var extendStatics = function (d, b) {
|
|
76
|
-
extendStatics = Object.setPrototypeOf ||
|
|
77
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
78
|
-
function (d, b) { for (var p in b)
|
|
79
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
80
|
-
d[p] = b[p]; };
|
|
81
|
-
return extendStatics(d, b);
|
|
82
|
-
};
|
|
83
|
-
function __extends(d, b) {
|
|
84
|
-
if (typeof b !== "function" && b !== null)
|
|
85
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
86
|
-
extendStatics(d, b);
|
|
87
|
-
function __() { this.constructor = d; }
|
|
88
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
89
|
-
}
|
|
90
|
-
var __assign = function () {
|
|
91
|
-
__assign = Object.assign || function __assign(t) {
|
|
92
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
93
|
-
s = arguments[i];
|
|
94
|
-
for (var p in s)
|
|
95
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
96
|
-
t[p] = s[p];
|
|
97
|
-
}
|
|
98
|
-
return t;
|
|
99
|
-
};
|
|
100
|
-
return __assign.apply(this, arguments);
|
|
101
|
-
};
|
|
102
|
-
function __rest(s, e) {
|
|
103
|
-
var t = {};
|
|
104
|
-
for (var p in s)
|
|
105
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
106
|
-
t[p] = s[p];
|
|
107
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
108
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
109
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
110
|
-
t[p[i]] = s[p[i]];
|
|
111
|
-
}
|
|
112
|
-
return t;
|
|
113
|
-
}
|
|
114
|
-
function __decorate(decorators, target, key, desc) {
|
|
115
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
116
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
117
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
118
|
-
else
|
|
119
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
120
|
-
if (d = decorators[i])
|
|
121
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
122
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
123
|
-
}
|
|
124
|
-
function __param(paramIndex, decorator) {
|
|
125
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
126
|
-
}
|
|
127
|
-
function __metadata(metadataKey, metadataValue) {
|
|
128
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
129
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
130
|
-
}
|
|
131
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
132
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
133
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
134
|
-
function fulfilled(value) { try {
|
|
135
|
-
step(generator.next(value));
|
|
136
|
-
}
|
|
137
|
-
catch (e) {
|
|
138
|
-
reject(e);
|
|
139
|
-
} }
|
|
140
|
-
function rejected(value) { try {
|
|
141
|
-
step(generator["throw"](value));
|
|
142
|
-
}
|
|
143
|
-
catch (e) {
|
|
144
|
-
reject(e);
|
|
145
|
-
} }
|
|
146
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
147
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
function __generator(thisArg, body) {
|
|
151
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
152
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
153
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
154
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
155
|
-
function step(op) {
|
|
156
|
-
if (f)
|
|
157
|
-
throw new TypeError("Generator is already executing.");
|
|
158
|
-
while (_)
|
|
159
|
-
try {
|
|
160
|
-
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)
|
|
161
|
-
return t;
|
|
162
|
-
if (y = 0, t)
|
|
163
|
-
op = [op[0] & 2, t.value];
|
|
164
|
-
switch (op[0]) {
|
|
165
|
-
case 0:
|
|
166
|
-
case 1:
|
|
167
|
-
t = op;
|
|
168
|
-
break;
|
|
169
|
-
case 4:
|
|
170
|
-
_.label++;
|
|
171
|
-
return { value: op[1], done: false };
|
|
172
|
-
case 5:
|
|
173
|
-
_.label++;
|
|
174
|
-
y = op[1];
|
|
175
|
-
op = [0];
|
|
176
|
-
continue;
|
|
177
|
-
case 7:
|
|
178
|
-
op = _.ops.pop();
|
|
179
|
-
_.trys.pop();
|
|
180
|
-
continue;
|
|
181
|
-
default:
|
|
182
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
183
|
-
_ = 0;
|
|
184
|
-
continue;
|
|
185
|
-
}
|
|
186
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
187
|
-
_.label = op[1];
|
|
188
|
-
break;
|
|
189
|
-
}
|
|
190
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
191
|
-
_.label = t[1];
|
|
192
|
-
t = op;
|
|
193
|
-
break;
|
|
194
|
-
}
|
|
195
|
-
if (t && _.label < t[2]) {
|
|
196
|
-
_.label = t[2];
|
|
197
|
-
_.ops.push(op);
|
|
198
|
-
break;
|
|
199
|
-
}
|
|
200
|
-
if (t[2])
|
|
201
|
-
_.ops.pop();
|
|
202
|
-
_.trys.pop();
|
|
203
|
-
continue;
|
|
204
|
-
}
|
|
205
|
-
op = body.call(thisArg, _);
|
|
206
|
-
}
|
|
207
|
-
catch (e) {
|
|
208
|
-
op = [6, e];
|
|
209
|
-
y = 0;
|
|
210
|
-
}
|
|
211
|
-
finally {
|
|
212
|
-
f = t = 0;
|
|
213
|
-
}
|
|
214
|
-
if (op[0] & 5)
|
|
215
|
-
throw op[1];
|
|
216
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
220
|
-
if (k2 === undefined)
|
|
221
|
-
k2 = k;
|
|
222
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
223
|
-
}) : (function (o, m, k, k2) {
|
|
224
|
-
if (k2 === undefined)
|
|
225
|
-
k2 = k;
|
|
226
|
-
o[k2] = m[k];
|
|
227
|
-
});
|
|
228
|
-
function __exportStar(m, o) {
|
|
229
|
-
for (var p in m)
|
|
230
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
231
|
-
__createBinding(o, m, p);
|
|
232
|
-
}
|
|
233
|
-
function __values(o) {
|
|
234
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
235
|
-
if (m)
|
|
236
|
-
return m.call(o);
|
|
237
|
-
if (o && typeof o.length === "number")
|
|
238
|
-
return {
|
|
239
|
-
next: function () {
|
|
240
|
-
if (o && i >= o.length)
|
|
241
|
-
o = void 0;
|
|
242
|
-
return { value: o && o[i++], done: !o };
|
|
243
|
-
}
|
|
244
|
-
};
|
|
245
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
246
|
-
}
|
|
247
|
-
function __read(o, n) {
|
|
248
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
249
|
-
if (!m)
|
|
250
|
-
return o;
|
|
251
|
-
var i = m.call(o), r, ar = [], e;
|
|
252
|
-
try {
|
|
253
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
254
|
-
ar.push(r.value);
|
|
255
|
-
}
|
|
256
|
-
catch (error) {
|
|
257
|
-
e = { error: error };
|
|
258
|
-
}
|
|
259
|
-
finally {
|
|
260
|
-
try {
|
|
261
|
-
if (r && !r.done && (m = i["return"]))
|
|
262
|
-
m.call(i);
|
|
263
|
-
}
|
|
264
|
-
finally {
|
|
265
|
-
if (e)
|
|
266
|
-
throw e.error;
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
return ar;
|
|
270
|
-
}
|
|
271
|
-
/** @deprecated */
|
|
272
|
-
function __spread() {
|
|
273
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
274
|
-
ar = ar.concat(__read(arguments[i]));
|
|
275
|
-
return ar;
|
|
276
|
-
}
|
|
277
|
-
/** @deprecated */
|
|
278
|
-
function __spreadArrays() {
|
|
279
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
280
|
-
s += arguments[i].length;
|
|
281
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
282
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
283
|
-
r[k] = a[j];
|
|
284
|
-
return r;
|
|
285
|
-
}
|
|
286
|
-
function __spreadArray(to, from, pack) {
|
|
287
|
-
if (pack || arguments.length === 2)
|
|
288
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
289
|
-
if (ar || !(i in from)) {
|
|
290
|
-
if (!ar)
|
|
291
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
292
|
-
ar[i] = from[i];
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
296
|
-
}
|
|
297
|
-
function __await(v) {
|
|
298
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
299
|
-
}
|
|
300
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
301
|
-
if (!Symbol.asyncIterator)
|
|
302
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
303
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
304
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
305
|
-
function verb(n) { if (g[n])
|
|
306
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
307
|
-
function resume(n, v) { try {
|
|
308
|
-
step(g[n](v));
|
|
309
|
-
}
|
|
310
|
-
catch (e) {
|
|
311
|
-
settle(q[0][3], e);
|
|
312
|
-
} }
|
|
313
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
314
|
-
function fulfill(value) { resume("next", value); }
|
|
315
|
-
function reject(value) { resume("throw", value); }
|
|
316
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
317
|
-
resume(q[0][0], q[0][1]); }
|
|
318
|
-
}
|
|
319
|
-
function __asyncDelegator(o) {
|
|
320
|
-
var i, p;
|
|
321
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
322
|
-
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; }
|
|
323
|
-
}
|
|
324
|
-
function __asyncValues(o) {
|
|
325
|
-
if (!Symbol.asyncIterator)
|
|
326
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
327
|
-
var m = o[Symbol.asyncIterator], i;
|
|
328
|
-
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);
|
|
329
|
-
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); }); }; }
|
|
330
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
331
|
-
}
|
|
332
|
-
function __makeTemplateObject(cooked, raw) {
|
|
333
|
-
if (Object.defineProperty) {
|
|
334
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
335
|
-
}
|
|
336
|
-
else {
|
|
337
|
-
cooked.raw = raw;
|
|
338
|
-
}
|
|
339
|
-
return cooked;
|
|
340
|
-
}
|
|
341
|
-
;
|
|
342
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
343
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
344
|
-
}) : function (o, v) {
|
|
345
|
-
o["default"] = v;
|
|
346
|
-
};
|
|
347
|
-
function __importStar(mod) {
|
|
348
|
-
if (mod && mod.__esModule)
|
|
349
|
-
return mod;
|
|
350
|
-
var result = {};
|
|
351
|
-
if (mod != null)
|
|
352
|
-
for (var k in mod)
|
|
353
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
354
|
-
__createBinding(result, mod, k);
|
|
355
|
-
__setModuleDefault(result, mod);
|
|
356
|
-
return result;
|
|
357
|
-
}
|
|
358
|
-
function __importDefault(mod) {
|
|
359
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
360
|
-
}
|
|
361
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
362
|
-
if (kind === "a" && !f)
|
|
363
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
364
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
365
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
366
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
367
|
-
}
|
|
368
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
369
|
-
if (kind === "m")
|
|
370
|
-
throw new TypeError("Private method is not writable");
|
|
371
|
-
if (kind === "a" && !f)
|
|
372
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
373
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
374
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
375
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
63
|
+
/*! *****************************************************************************
|
|
64
|
+
Copyright (c) Microsoft Corporation.
|
|
65
|
+
|
|
66
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
67
|
+
purpose with or without fee is hereby granted.
|
|
68
|
+
|
|
69
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
70
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
71
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
72
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
73
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
74
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
75
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
76
|
+
***************************************************************************** */
|
|
77
|
+
/* global Reflect, Promise */
|
|
78
|
+
var extendStatics = function (d, b) {
|
|
79
|
+
extendStatics = Object.setPrototypeOf ||
|
|
80
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
81
|
+
function (d, b) { for (var p in b)
|
|
82
|
+
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
83
|
+
d[p] = b[p]; };
|
|
84
|
+
return extendStatics(d, b);
|
|
85
|
+
};
|
|
86
|
+
function __extends(d, b) {
|
|
87
|
+
if (typeof b !== "function" && b !== null)
|
|
88
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
89
|
+
extendStatics(d, b);
|
|
90
|
+
function __() { this.constructor = d; }
|
|
91
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
92
|
+
}
|
|
93
|
+
var __assign = function () {
|
|
94
|
+
__assign = Object.assign || function __assign(t) {
|
|
95
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
96
|
+
s = arguments[i];
|
|
97
|
+
for (var p in s)
|
|
98
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
99
|
+
t[p] = s[p];
|
|
100
|
+
}
|
|
101
|
+
return t;
|
|
102
|
+
};
|
|
103
|
+
return __assign.apply(this, arguments);
|
|
104
|
+
};
|
|
105
|
+
function __rest(s, e) {
|
|
106
|
+
var t = {};
|
|
107
|
+
for (var p in s)
|
|
108
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
109
|
+
t[p] = s[p];
|
|
110
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
111
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
112
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
113
|
+
t[p[i]] = s[p[i]];
|
|
114
|
+
}
|
|
115
|
+
return t;
|
|
116
|
+
}
|
|
117
|
+
function __decorate(decorators, target, key, desc) {
|
|
118
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
119
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
120
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
121
|
+
else
|
|
122
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
123
|
+
if (d = decorators[i])
|
|
124
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
125
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
126
|
+
}
|
|
127
|
+
function __param(paramIndex, decorator) {
|
|
128
|
+
return function (target, key) { decorator(target, key, paramIndex); };
|
|
129
|
+
}
|
|
130
|
+
function __metadata(metadataKey, metadataValue) {
|
|
131
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
132
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
133
|
+
}
|
|
134
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
135
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
136
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
137
|
+
function fulfilled(value) { try {
|
|
138
|
+
step(generator.next(value));
|
|
139
|
+
}
|
|
140
|
+
catch (e) {
|
|
141
|
+
reject(e);
|
|
142
|
+
} }
|
|
143
|
+
function rejected(value) { try {
|
|
144
|
+
step(generator["throw"](value));
|
|
145
|
+
}
|
|
146
|
+
catch (e) {
|
|
147
|
+
reject(e);
|
|
148
|
+
} }
|
|
149
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
150
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
function __generator(thisArg, body) {
|
|
154
|
+
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
155
|
+
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
156
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
157
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
158
|
+
function step(op) {
|
|
159
|
+
if (f)
|
|
160
|
+
throw new TypeError("Generator is already executing.");
|
|
161
|
+
while (_)
|
|
162
|
+
try {
|
|
163
|
+
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)
|
|
164
|
+
return t;
|
|
165
|
+
if (y = 0, t)
|
|
166
|
+
op = [op[0] & 2, t.value];
|
|
167
|
+
switch (op[0]) {
|
|
168
|
+
case 0:
|
|
169
|
+
case 1:
|
|
170
|
+
t = op;
|
|
171
|
+
break;
|
|
172
|
+
case 4:
|
|
173
|
+
_.label++;
|
|
174
|
+
return { value: op[1], done: false };
|
|
175
|
+
case 5:
|
|
176
|
+
_.label++;
|
|
177
|
+
y = op[1];
|
|
178
|
+
op = [0];
|
|
179
|
+
continue;
|
|
180
|
+
case 7:
|
|
181
|
+
op = _.ops.pop();
|
|
182
|
+
_.trys.pop();
|
|
183
|
+
continue;
|
|
184
|
+
default:
|
|
185
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
186
|
+
_ = 0;
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
190
|
+
_.label = op[1];
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
194
|
+
_.label = t[1];
|
|
195
|
+
t = op;
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
198
|
+
if (t && _.label < t[2]) {
|
|
199
|
+
_.label = t[2];
|
|
200
|
+
_.ops.push(op);
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
if (t[2])
|
|
204
|
+
_.ops.pop();
|
|
205
|
+
_.trys.pop();
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
op = body.call(thisArg, _);
|
|
209
|
+
}
|
|
210
|
+
catch (e) {
|
|
211
|
+
op = [6, e];
|
|
212
|
+
y = 0;
|
|
213
|
+
}
|
|
214
|
+
finally {
|
|
215
|
+
f = t = 0;
|
|
216
|
+
}
|
|
217
|
+
if (op[0] & 5)
|
|
218
|
+
throw op[1];
|
|
219
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
223
|
+
if (k2 === undefined)
|
|
224
|
+
k2 = k;
|
|
225
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
226
|
+
}) : (function (o, m, k, k2) {
|
|
227
|
+
if (k2 === undefined)
|
|
228
|
+
k2 = k;
|
|
229
|
+
o[k2] = m[k];
|
|
230
|
+
});
|
|
231
|
+
function __exportStar(m, o) {
|
|
232
|
+
for (var p in m)
|
|
233
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
234
|
+
__createBinding(o, m, p);
|
|
235
|
+
}
|
|
236
|
+
function __values(o) {
|
|
237
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
238
|
+
if (m)
|
|
239
|
+
return m.call(o);
|
|
240
|
+
if (o && typeof o.length === "number")
|
|
241
|
+
return {
|
|
242
|
+
next: function () {
|
|
243
|
+
if (o && i >= o.length)
|
|
244
|
+
o = void 0;
|
|
245
|
+
return { value: o && o[i++], done: !o };
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
249
|
+
}
|
|
250
|
+
function __read(o, n) {
|
|
251
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
252
|
+
if (!m)
|
|
253
|
+
return o;
|
|
254
|
+
var i = m.call(o), r, ar = [], e;
|
|
255
|
+
try {
|
|
256
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
257
|
+
ar.push(r.value);
|
|
258
|
+
}
|
|
259
|
+
catch (error) {
|
|
260
|
+
e = { error: error };
|
|
261
|
+
}
|
|
262
|
+
finally {
|
|
263
|
+
try {
|
|
264
|
+
if (r && !r.done && (m = i["return"]))
|
|
265
|
+
m.call(i);
|
|
266
|
+
}
|
|
267
|
+
finally {
|
|
268
|
+
if (e)
|
|
269
|
+
throw e.error;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return ar;
|
|
273
|
+
}
|
|
274
|
+
/** @deprecated */
|
|
275
|
+
function __spread() {
|
|
276
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
277
|
+
ar = ar.concat(__read(arguments[i]));
|
|
278
|
+
return ar;
|
|
279
|
+
}
|
|
280
|
+
/** @deprecated */
|
|
281
|
+
function __spreadArrays() {
|
|
282
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
283
|
+
s += arguments[i].length;
|
|
284
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
285
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
286
|
+
r[k] = a[j];
|
|
287
|
+
return r;
|
|
288
|
+
}
|
|
289
|
+
function __spreadArray(to, from, pack) {
|
|
290
|
+
if (pack || arguments.length === 2)
|
|
291
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
292
|
+
if (ar || !(i in from)) {
|
|
293
|
+
if (!ar)
|
|
294
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
295
|
+
ar[i] = from[i];
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
299
|
+
}
|
|
300
|
+
function __await(v) {
|
|
301
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
302
|
+
}
|
|
303
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
304
|
+
if (!Symbol.asyncIterator)
|
|
305
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
306
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
307
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
308
|
+
function verb(n) { if (g[n])
|
|
309
|
+
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
310
|
+
function resume(n, v) { try {
|
|
311
|
+
step(g[n](v));
|
|
312
|
+
}
|
|
313
|
+
catch (e) {
|
|
314
|
+
settle(q[0][3], e);
|
|
315
|
+
} }
|
|
316
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
317
|
+
function fulfill(value) { resume("next", value); }
|
|
318
|
+
function reject(value) { resume("throw", value); }
|
|
319
|
+
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
320
|
+
resume(q[0][0], q[0][1]); }
|
|
321
|
+
}
|
|
322
|
+
function __asyncDelegator(o) {
|
|
323
|
+
var i, p;
|
|
324
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
325
|
+
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; }
|
|
326
|
+
}
|
|
327
|
+
function __asyncValues(o) {
|
|
328
|
+
if (!Symbol.asyncIterator)
|
|
329
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
330
|
+
var m = o[Symbol.asyncIterator], i;
|
|
331
|
+
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);
|
|
332
|
+
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); }); }; }
|
|
333
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
334
|
+
}
|
|
335
|
+
function __makeTemplateObject(cooked, raw) {
|
|
336
|
+
if (Object.defineProperty) {
|
|
337
|
+
Object.defineProperty(cooked, "raw", { value: raw });
|
|
338
|
+
}
|
|
339
|
+
else {
|
|
340
|
+
cooked.raw = raw;
|
|
341
|
+
}
|
|
342
|
+
return cooked;
|
|
343
|
+
}
|
|
344
|
+
;
|
|
345
|
+
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
346
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
347
|
+
}) : function (o, v) {
|
|
348
|
+
o["default"] = v;
|
|
349
|
+
};
|
|
350
|
+
function __importStar(mod) {
|
|
351
|
+
if (mod && mod.__esModule)
|
|
352
|
+
return mod;
|
|
353
|
+
var result = {};
|
|
354
|
+
if (mod != null)
|
|
355
|
+
for (var k in mod)
|
|
356
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
357
|
+
__createBinding(result, mod, k);
|
|
358
|
+
__setModuleDefault(result, mod);
|
|
359
|
+
return result;
|
|
360
|
+
}
|
|
361
|
+
function __importDefault(mod) {
|
|
362
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
363
|
+
}
|
|
364
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
365
|
+
if (kind === "a" && !f)
|
|
366
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
367
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
368
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
369
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
370
|
+
}
|
|
371
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
372
|
+
if (kind === "m")
|
|
373
|
+
throw new TypeError("Private method is not writable");
|
|
374
|
+
if (kind === "a" && !f)
|
|
375
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
376
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
377
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
378
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
376
379
|
}
|
|
377
380
|
|
|
378
|
-
var CheckoutService = /** @class */ (function () {
|
|
379
|
-
function CheckoutService(checkoutRepository, userRepository, defaultShop) {
|
|
380
|
-
this.checkoutRepository = checkoutRepository;
|
|
381
|
-
this.userRepository = userRepository;
|
|
382
|
-
this.defaultShop = defaultShop;
|
|
383
|
-
}
|
|
384
|
-
CheckoutService.prototype.getCheckout = function (checkoutData) {
|
|
385
|
-
var checkoutId = cookie__default["default"].get('checkoutId');
|
|
386
|
-
if (!i1$1.isNil(checkoutId))
|
|
387
|
-
return rxjs.from(this.checkoutRepository.get({ id: checkoutId }));
|
|
388
|
-
return rxjs.from(this.createCheckout(checkoutData));
|
|
389
|
-
};
|
|
390
|
-
CheckoutService.prototype.getUserByCheckout = function (checkoutId) {
|
|
391
|
-
var _this = this;
|
|
392
|
-
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 i1$1.NotFoundError('User is not found'); }); }));
|
|
393
|
-
};
|
|
394
|
-
CheckoutService.prototype.updateCheckoutLineItems = function (checkout) {
|
|
395
|
-
return rxjs.from(this.checkoutRepository.update(i1$1.Checkout.toInstance({ id: checkout.id, lineItems: checkout.lineItems })));
|
|
396
|
-
};
|
|
397
|
-
CheckoutService.prototype.updateCheckoutUser = function (checkout) {
|
|
398
|
-
return rxjs.from(this.checkoutRepository.update(i1$1.Checkout.toInstance({ id: checkout.id, user: checkout.user })));
|
|
399
|
-
};
|
|
400
|
-
CheckoutService.prototype.clearCheckoutFromSession = function () {
|
|
401
|
-
cookie__default["default"].remove('checkoutId');
|
|
402
|
-
return rxjs.of();
|
|
403
|
-
};
|
|
404
|
-
CheckoutService.prototype.createCheckout = function (checkoutData) {
|
|
405
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
406
|
-
var checkout;
|
|
407
|
-
return __generator(this, function (_b) {
|
|
408
|
-
switch (_b.label) {
|
|
409
|
-
case 0: return [4 /*yield*/, this.checkoutRepository.create(Object.assign(Object.assign({ createdAt: new Date() }, i1$1.Checkout.toInstance(i1$1.pick(checkoutData, ['user', 'shop'])).toPlain()), { shop: (checkoutData === null || checkoutData === void 0 ? void 0 : checkoutData.shop) || this.defaultShop }))];
|
|
410
|
-
case 1:
|
|
411
|
-
checkout = _b.sent();
|
|
412
|
-
cookie__default["default"].set('checkoutId', checkout.id);
|
|
413
|
-
return [2 /*return*/, checkout];
|
|
414
|
-
}
|
|
415
|
-
});
|
|
416
|
-
});
|
|
417
|
-
};
|
|
418
|
-
return CheckoutService;
|
|
419
|
-
}());
|
|
420
|
-
CheckoutService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: CheckoutService, deps: [{ token: 'CheckoutRepository' }, { token: 'UserRepository' }, { token: DEFAULT_SHOP }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
421
|
-
CheckoutService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: CheckoutService });
|
|
422
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: CheckoutService, decorators: [{
|
|
423
|
-
type: i0.Injectable
|
|
424
|
-
}], ctorParameters: function () {
|
|
425
|
-
return [{ type: undefined, decorators: [{
|
|
426
|
-
type: i0.Inject,
|
|
427
|
-
args: ['CheckoutRepository']
|
|
428
|
-
}] }, { type: undefined, decorators: [{
|
|
429
|
-
type: i0.Inject,
|
|
430
|
-
args: ['UserRepository']
|
|
431
|
-
}] }, { type: i1__namespace$1.Shops, decorators: [{
|
|
432
|
-
type: i0.Inject,
|
|
433
|
-
args: [DEFAULT_SHOP]
|
|
434
|
-
}] }];
|
|
381
|
+
var CheckoutService = /** @class */ (function () {
|
|
382
|
+
function CheckoutService(checkoutRepository, userRepository, defaultShop) {
|
|
383
|
+
this.checkoutRepository = checkoutRepository;
|
|
384
|
+
this.userRepository = userRepository;
|
|
385
|
+
this.defaultShop = defaultShop;
|
|
386
|
+
}
|
|
387
|
+
CheckoutService.prototype.getCheckout = function (checkoutData) {
|
|
388
|
+
var checkoutId = cookie__default["default"].get('checkoutId');
|
|
389
|
+
if (!i1$1.isNil(checkoutId))
|
|
390
|
+
return rxjs.from(this.checkoutRepository.get({ id: checkoutId }));
|
|
391
|
+
return rxjs.from(this.createCheckout(checkoutData));
|
|
392
|
+
};
|
|
393
|
+
CheckoutService.prototype.getUserByCheckout = function (checkoutId) {
|
|
394
|
+
var _this = this;
|
|
395
|
+
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 i1$1.NotFoundError('User is not found'); }); }));
|
|
396
|
+
};
|
|
397
|
+
CheckoutService.prototype.updateCheckoutLineItems = function (checkout) {
|
|
398
|
+
return rxjs.from(this.checkoutRepository.update(i1$1.Checkout.toInstance({ id: checkout.id, lineItems: checkout.lineItems })));
|
|
399
|
+
};
|
|
400
|
+
CheckoutService.prototype.updateCheckoutUser = function (checkout) {
|
|
401
|
+
return rxjs.from(this.checkoutRepository.update(i1$1.Checkout.toInstance({ id: checkout.id, user: checkout.user })));
|
|
402
|
+
};
|
|
403
|
+
CheckoutService.prototype.clearCheckoutFromSession = function () {
|
|
404
|
+
cookie__default["default"].remove('checkoutId');
|
|
405
|
+
return rxjs.of();
|
|
406
|
+
};
|
|
407
|
+
CheckoutService.prototype.createCheckout = function (checkoutData) {
|
|
408
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
409
|
+
var checkout;
|
|
410
|
+
return __generator(this, function (_b) {
|
|
411
|
+
switch (_b.label) {
|
|
412
|
+
case 0: return [4 /*yield*/, this.checkoutRepository.create(Object.assign(Object.assign({ createdAt: new Date() }, i1$1.Checkout.toInstance(i1$1.pick(checkoutData, ['user', 'shop'])).toPlain()), { shop: (checkoutData === null || checkoutData === void 0 ? void 0 : checkoutData.shop) || this.defaultShop }))];
|
|
413
|
+
case 1:
|
|
414
|
+
checkout = _b.sent();
|
|
415
|
+
cookie__default["default"].set('checkoutId', checkout.id);
|
|
416
|
+
return [2 /*return*/, checkout];
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
});
|
|
420
|
+
};
|
|
421
|
+
return CheckoutService;
|
|
422
|
+
}());
|
|
423
|
+
CheckoutService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: CheckoutService, deps: [{ token: 'CheckoutRepository' }, { token: 'UserRepository' }, { token: DEFAULT_SHOP }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
424
|
+
CheckoutService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: CheckoutService });
|
|
425
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: CheckoutService, decorators: [{
|
|
426
|
+
type: i0.Injectable
|
|
427
|
+
}], ctorParameters: function () {
|
|
428
|
+
return [{ type: undefined, decorators: [{
|
|
429
|
+
type: i0.Inject,
|
|
430
|
+
args: ['CheckoutRepository']
|
|
431
|
+
}] }, { type: undefined, decorators: [{
|
|
432
|
+
type: i0.Inject,
|
|
433
|
+
args: ['UserRepository']
|
|
434
|
+
}] }, { type: i1__namespace$1.Shops, decorators: [{
|
|
435
|
+
type: i0.Inject,
|
|
436
|
+
args: [DEFAULT_SHOP]
|
|
437
|
+
}] }];
|
|
435
438
|
} });
|
|
436
439
|
|
|
437
|
-
var CartService = /** @class */ (function () {
|
|
438
|
-
function CartService(authService, checkoutService, defaultShop) {
|
|
439
|
-
var _this = this;
|
|
440
|
-
this.authService = authService;
|
|
441
|
-
this.checkoutService = checkoutService;
|
|
442
|
-
this.defaultShop = defaultShop;
|
|
443
|
-
this.cartSubject = new rxjs.Subject();
|
|
444
|
-
this.updateLineItemInCart = function (lineItem, quantity, checkout) { return (i1$1.isNil(checkout) ? _this.checkoutService.getCheckout() : rxjs.of(checkout)).pipe(operators.concatMap(function (checkoutLoaded) {
|
|
445
|
-
var _a;
|
|
446
|
-
var items = [];
|
|
447
|
-
var index = (_a = checkoutLoaded.lineItems) === null || _a === void 0 ? void 0 : _a.map(function (checkoutItem) { return checkoutItem.sku; }).indexOf(lineItem.sku);
|
|
448
|
-
if (index > -1) {
|
|
449
|
-
checkoutLoaded.lineItems[index].quantity += quantity;
|
|
450
|
-
checkoutLoaded.lineItems[index].pricePaid = lineItem.pricePaid;
|
|
451
|
-
}
|
|
452
|
-
else
|
|
453
|
-
checkoutLoaded.lineItems = items.concat(checkoutLoaded.lineItems ? checkoutLoaded.lineItems.concat([lineItem]) : [lineItem]);
|
|
454
|
-
return _this.checkoutService
|
|
455
|
-
.updateCheckoutLineItems(checkoutLoaded)
|
|
456
|
-
.pipe(operators.map(function (updatedCheckout) { return _this.generateCartObject(updatedCheckout.lineItems); }));
|
|
457
|
-
})); };
|
|
458
|
-
this.generateCartObject = function (items) {
|
|
459
|
-
var cart = {};
|
|
460
|
-
items === null || items === void 0 ? void 0 : items.forEach(function (item) {
|
|
461
|
-
var _a;
|
|
462
|
-
return (cart[item.sku] = i1$1.LineItem.toInstance(Object.assign(Object.assign({}, (cart[item.sku] || item)), { quantity: (((_a = cart[item.sku]) === null || _a === void 0 ? void 0 : _a.quantity) || 0) + (item.quantity ? item.quantity : 1) })));
|
|
463
|
-
});
|
|
464
|
-
return cart;
|
|
465
|
-
};
|
|
466
|
-
this.buildLineItem = function (_f) {
|
|
467
|
-
var checkout = _f.checkout, item = _f.item, quantity = _f.quantity;
|
|
468
|
-
var _a, _b, _c, _d, _e;
|
|
469
|
-
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.sku === item.sku; })) === null || _b === void 0 ? void 0 : _b.quantity) || 0;
|
|
470
|
-
if (_this.checkMaxStock(item, quantity || 0))
|
|
471
|
-
throw new Error('Desculpe! Temos apenas ' + ((_c = item.stock) === null || _c === void 0 ? void 0 : _c.quantity) + ' em estoque.');
|
|
472
|
-
var image = item.image || ((_d = item.images) === null || _d === void 0 ? void 0 : _d.shift());
|
|
473
|
-
var id = item.id, name = item.name, brand = item.brand, slug = item.slug, stock = item.stock, price = item.price, weight = item.weight, categories = item.categories, sku = item.sku;
|
|
474
|
-
var isGift = item.isGift || null;
|
|
475
|
-
var pricePaid = _this.getProductPrice({
|
|
476
|
-
product: item,
|
|
477
|
-
shop: checkout.shop || _this.defaultShop,
|
|
478
|
-
isSubscriber: (_e = checkout.user) === null || _e === void 0 ? void 0 : _e.isSubscriber,
|
|
479
|
-
});
|
|
480
|
-
return i1$1.LineItem.toInstance({
|
|
481
|
-
id: id,
|
|
482
|
-
name: name,
|
|
483
|
-
brand: brand,
|
|
484
|
-
slug: slug,
|
|
485
|
-
sku: sku,
|
|
486
|
-
stock: stock,
|
|
487
|
-
price: price,
|
|
488
|
-
image: image,
|
|
489
|
-
weight: weight,
|
|
490
|
-
quantity: (item.quantity || 0) + (quantity || 0),
|
|
491
|
-
pricePaid: pricePaid,
|
|
492
|
-
categories: categories,
|
|
493
|
-
isGift: isGift,
|
|
494
|
-
});
|
|
495
|
-
};
|
|
496
|
-
this.getProductPrice = function (_f) {
|
|
497
|
-
var product = _f.product, shop = _f.shop, isSubscriber = _f.isSubscriber;
|
|
498
|
-
var info = product.getInfoByShop(shop);
|
|
499
|
-
if (product.isGift)
|
|
500
|
-
return 0;
|
|
501
|
-
return isSubscriber && info.subscriberPrice > 0 ? info.subscriberPrice : info.price;
|
|
502
|
-
};
|
|
503
|
-
this.checkMaxStock = function (item, quantity) {
|
|
504
|
-
var _a;
|
|
505
|
-
var maxStock = ((_a = item.stock) === null || _a === void 0 ? void 0 : _a.quantity) || 0;
|
|
506
|
-
var currentItemAmount = item.quantity || 0;
|
|
507
|
-
return currentItemAmount + quantity > maxStock;
|
|
508
|
-
};
|
|
509
|
-
}
|
|
510
|
-
CartService.prototype.addItem = function (item, quantity) {
|
|
511
|
-
var _this = this;
|
|
512
|
-
if (quantity === void 0) { quantity = 1; }
|
|
513
|
-
return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) { return ({ checkout: checkout, lineItem: _this.buildLineItem({ checkout: checkout, item: item, quantity: quantity || 1 }) }); }), operators.concatMap(function (_f) {
|
|
514
|
-
var checkout = _f.checkout, lineItem = _f.lineItem;
|
|
515
|
-
return _this.updateLineItemInCart(lineItem, quantity || 1, checkout);
|
|
516
|
-
}), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
|
|
517
|
-
};
|
|
518
|
-
CartService.prototype.decreaseItem = function (item) {
|
|
519
|
-
var _this = this;
|
|
520
|
-
return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) {
|
|
521
|
-
var _a;
|
|
522
|
-
var checkoutItem = (_a = checkout.lineItems) === null || _a === void 0 ? void 0 : _a.find(function (lineItem) { return lineItem.sku === item.sku; });
|
|
523
|
-
if (!i1$1.isNil(checkoutItem))
|
|
524
|
-
checkoutItem.quantity -= checkoutItem.quantity > 1 ? 1 : 0;
|
|
525
|
-
return checkout;
|
|
526
|
-
}), 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); }));
|
|
527
|
-
};
|
|
528
|
-
CartService.prototype.getCart = function (checkout) {
|
|
529
|
-
var _this = this;
|
|
530
|
-
this.buildCartFromCheckout(checkout).subscribe(function (cart) { return _this.cartSubject.next(cart); });
|
|
531
|
-
return this.cartSubject;
|
|
532
|
-
};
|
|
533
|
-
CartService.prototype.getDiscount = function (coupon) {
|
|
534
|
-
switch (coupon.type) {
|
|
535
|
-
case i1$1.CouponTypes.FINANCIAL:
|
|
536
|
-
return this.getFinancialDiscount(coupon);
|
|
537
|
-
case i1$1.CouponTypes.PRODUCT:
|
|
538
|
-
return function (subTotalPrice) { return subTotalPrice; };
|
|
539
|
-
case i1$1.CouponTypes.GIFTCARD:
|
|
540
|
-
return this.getFinancialDiscount(coupon);
|
|
541
|
-
case i1$1.CouponTypes.VOUCHER:
|
|
542
|
-
return function (subTotalPrice) { return subTotalPrice; };
|
|
543
|
-
}
|
|
544
|
-
};
|
|
545
|
-
CartService.prototype.getVariantPriceDiscount = function (item, shop) {
|
|
546
|
-
return this.authService.getUser().pipe(operators.concatMap(function (user) { return rxjs.iif(function () { return user.isSubscriber && !!item.getInfoByShop(shop).subscriberPrice; }, rxjs.of(item.getInfoByShop(shop).subscriberPrice), rxjs.of(item.getInfoByShop(shop).price)); }), operators.catchError(function () { return rxjs.of(item.getInfoByShop(shop).price); }));
|
|
547
|
-
};
|
|
548
|
-
CartService.prototype.removeItem = function (item) {
|
|
549
|
-
var _this = this;
|
|
550
|
-
return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) {
|
|
551
|
-
var index = checkout.lineItems.findIndex(function (lineItem) { return lineItem.sku === item.sku; });
|
|
552
|
-
if (index >= 0)
|
|
553
|
-
checkout.lineItems.splice(index, 1);
|
|
554
|
-
return checkout;
|
|
555
|
-
}), 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); }));
|
|
556
|
-
};
|
|
557
|
-
CartService.prototype.updateUserCart = function (user) {
|
|
558
|
-
var _this = this;
|
|
559
|
-
return this.checkoutService.getCheckout().pipe(operators.concatMap(function (checkout) { return _this.checkoutService.updateCheckoutUser(i1$1.Checkout.toInstance(Object.assign(Object.assign({}, checkout.toPlain()), { user: user }))); }), operators.concatMap(function (checkout) { return _this.checkoutService.updateCheckoutLineItems(i1$1.Checkout.toInstance(Object.assign(Object.assign({}, checkout.toPlain()), { lineItems: checkout.lineItems.map(function (item) { return _this.buildLineItem({ checkout: checkout, item: item }); }) }))); }), operators.map(function (checkout) { return _this.generateCartObject(checkout.lineItems); }), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
|
|
560
|
-
};
|
|
561
|
-
CartService.prototype.clearCart = function () {
|
|
562
|
-
var _this = this;
|
|
563
|
-
return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) {
|
|
564
|
-
_this.checkoutService.clearCheckoutFromSession();
|
|
565
|
-
return checkout;
|
|
566
|
-
}), operators.concatMap(function (oldCheckout) { return _this.buildCartFromCheckout(oldCheckout); }), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
|
|
567
|
-
};
|
|
568
|
-
CartService.prototype.buildCartFromCheckout = function (checkoutData) {
|
|
569
|
-
var _this = this;
|
|
570
|
-
return this.checkoutService.getCheckout(checkoutData).pipe(operators.map(function (checkout) { return checkout.lineItems; }), operators.concatMap(function (lineItems) { return rxjs.of(_this.generateCartObject(lineItems)); }));
|
|
571
|
-
};
|
|
572
|
-
CartService.prototype.getFinancialDiscount = function (coupon) {
|
|
573
|
-
return function (subTotalPrice) {
|
|
574
|
-
if (i1$1.FinancialCoupon.isFinancialCoupon(coupon))
|
|
575
|
-
switch (coupon.subtype) {
|
|
576
|
-
case i1$1.CouponSubtypes.ABSOLUTE:
|
|
577
|
-
return subTotalPrice - coupon.discount * 100;
|
|
578
|
-
case i1$1.CouponSubtypes.PERCENTAGE:
|
|
579
|
-
return subTotalPrice * (1 - coupon.discount / 100);
|
|
580
|
-
}
|
|
581
|
-
};
|
|
582
|
-
};
|
|
583
|
-
return CartService;
|
|
584
|
-
}());
|
|
585
|
-
CartService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: CartService, deps: [{ token: AuthService }, { token: CheckoutService }, { token: DEFAULT_SHOP }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
586
|
-
CartService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: CartService });
|
|
587
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: CartService, decorators: [{
|
|
588
|
-
type: i0.Injectable
|
|
589
|
-
}], ctorParameters: function () {
|
|
590
|
-
return [{ type: AuthService }, { type: CheckoutService }, { type: i1__namespace$1.Shops, decorators: [{
|
|
591
|
-
type: i0.Inject,
|
|
592
|
-
args: [DEFAULT_SHOP]
|
|
593
|
-
}] }];
|
|
440
|
+
var CartService = /** @class */ (function () {
|
|
441
|
+
function CartService(authService, checkoutService, defaultShop) {
|
|
442
|
+
var _this = this;
|
|
443
|
+
this.authService = authService;
|
|
444
|
+
this.checkoutService = checkoutService;
|
|
445
|
+
this.defaultShop = defaultShop;
|
|
446
|
+
this.cartSubject = new rxjs.Subject();
|
|
447
|
+
this.updateLineItemInCart = function (lineItem, quantity, checkout) { return (i1$1.isNil(checkout) ? _this.checkoutService.getCheckout() : rxjs.of(checkout)).pipe(operators.concatMap(function (checkoutLoaded) {
|
|
448
|
+
var _a;
|
|
449
|
+
var items = [];
|
|
450
|
+
var index = (_a = checkoutLoaded.lineItems) === null || _a === void 0 ? void 0 : _a.map(function (checkoutItem) { return checkoutItem.sku; }).indexOf(lineItem.sku);
|
|
451
|
+
if (index > -1) {
|
|
452
|
+
checkoutLoaded.lineItems[index].quantity += quantity;
|
|
453
|
+
checkoutLoaded.lineItems[index].pricePaid = lineItem.pricePaid;
|
|
454
|
+
}
|
|
455
|
+
else
|
|
456
|
+
checkoutLoaded.lineItems = items.concat(checkoutLoaded.lineItems ? checkoutLoaded.lineItems.concat([lineItem]) : [lineItem]);
|
|
457
|
+
return _this.checkoutService
|
|
458
|
+
.updateCheckoutLineItems(checkoutLoaded)
|
|
459
|
+
.pipe(operators.map(function (updatedCheckout) { return _this.generateCartObject(updatedCheckout.lineItems); }));
|
|
460
|
+
})); };
|
|
461
|
+
this.generateCartObject = function (items) {
|
|
462
|
+
var cart = {};
|
|
463
|
+
items === null || items === void 0 ? void 0 : items.forEach(function (item) {
|
|
464
|
+
var _a;
|
|
465
|
+
return (cart[item.sku] = i1$1.LineItem.toInstance(Object.assign(Object.assign({}, (cart[item.sku] || item)), { quantity: (((_a = cart[item.sku]) === null || _a === void 0 ? void 0 : _a.quantity) || 0) + (item.quantity ? item.quantity : 1) })));
|
|
466
|
+
});
|
|
467
|
+
return cart;
|
|
468
|
+
};
|
|
469
|
+
this.buildLineItem = function (_f) {
|
|
470
|
+
var checkout = _f.checkout, item = _f.item, quantity = _f.quantity;
|
|
471
|
+
var _a, _b, _c, _d, _e;
|
|
472
|
+
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.sku === item.sku; })) === null || _b === void 0 ? void 0 : _b.quantity) || 0;
|
|
473
|
+
if (_this.checkMaxStock(item, quantity || 0))
|
|
474
|
+
throw new Error('Desculpe! Temos apenas ' + ((_c = item.stock) === null || _c === void 0 ? void 0 : _c.quantity) + ' em estoque.');
|
|
475
|
+
var image = item.image || ((_d = item.images) === null || _d === void 0 ? void 0 : _d.shift());
|
|
476
|
+
var id = item.id, name = item.name, brand = item.brand, slug = item.slug, stock = item.stock, price = item.price, weight = item.weight, categories = item.categories, sku = item.sku;
|
|
477
|
+
var isGift = item.isGift || null;
|
|
478
|
+
var pricePaid = _this.getProductPrice({
|
|
479
|
+
product: item,
|
|
480
|
+
shop: checkout.shop || _this.defaultShop,
|
|
481
|
+
isSubscriber: (_e = checkout.user) === null || _e === void 0 ? void 0 : _e.isSubscriber,
|
|
482
|
+
});
|
|
483
|
+
return i1$1.LineItem.toInstance({
|
|
484
|
+
id: id,
|
|
485
|
+
name: name,
|
|
486
|
+
brand: brand,
|
|
487
|
+
slug: slug,
|
|
488
|
+
sku: sku,
|
|
489
|
+
stock: stock,
|
|
490
|
+
price: price,
|
|
491
|
+
image: image,
|
|
492
|
+
weight: weight,
|
|
493
|
+
quantity: (item.quantity || 0) + (quantity || 0),
|
|
494
|
+
pricePaid: pricePaid,
|
|
495
|
+
categories: categories,
|
|
496
|
+
isGift: isGift,
|
|
497
|
+
});
|
|
498
|
+
};
|
|
499
|
+
this.getProductPrice = function (_f) {
|
|
500
|
+
var product = _f.product, shop = _f.shop, isSubscriber = _f.isSubscriber;
|
|
501
|
+
var info = product.getInfoByShop(shop);
|
|
502
|
+
if (product.isGift)
|
|
503
|
+
return 0;
|
|
504
|
+
return isSubscriber && info.subscriberPrice > 0 ? info.subscriberPrice : info.price;
|
|
505
|
+
};
|
|
506
|
+
this.checkMaxStock = function (item, quantity) {
|
|
507
|
+
var _a;
|
|
508
|
+
var maxStock = ((_a = item.stock) === null || _a === void 0 ? void 0 : _a.quantity) || 0;
|
|
509
|
+
var currentItemAmount = item.quantity || 0;
|
|
510
|
+
return currentItemAmount + quantity > maxStock;
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
CartService.prototype.addItem = function (item, quantity) {
|
|
514
|
+
var _this = this;
|
|
515
|
+
if (quantity === void 0) { quantity = 1; }
|
|
516
|
+
return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) { return ({ checkout: checkout, lineItem: _this.buildLineItem({ checkout: checkout, item: item, quantity: quantity || 1 }) }); }), operators.concatMap(function (_f) {
|
|
517
|
+
var checkout = _f.checkout, lineItem = _f.lineItem;
|
|
518
|
+
return _this.updateLineItemInCart(lineItem, quantity || 1, checkout);
|
|
519
|
+
}), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
|
|
520
|
+
};
|
|
521
|
+
CartService.prototype.decreaseItem = function (item) {
|
|
522
|
+
var _this = this;
|
|
523
|
+
return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) {
|
|
524
|
+
var _a;
|
|
525
|
+
var checkoutItem = (_a = checkout.lineItems) === null || _a === void 0 ? void 0 : _a.find(function (lineItem) { return lineItem.sku === item.sku; });
|
|
526
|
+
if (!i1$1.isNil(checkoutItem))
|
|
527
|
+
checkoutItem.quantity -= checkoutItem.quantity > 1 ? 1 : 0;
|
|
528
|
+
return checkout;
|
|
529
|
+
}), 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); }));
|
|
530
|
+
};
|
|
531
|
+
CartService.prototype.getCart = function (checkout) {
|
|
532
|
+
var _this = this;
|
|
533
|
+
this.buildCartFromCheckout(checkout).subscribe(function (cart) { return _this.cartSubject.next(cart); });
|
|
534
|
+
return this.cartSubject;
|
|
535
|
+
};
|
|
536
|
+
CartService.prototype.getDiscount = function (coupon) {
|
|
537
|
+
switch (coupon.type) {
|
|
538
|
+
case i1$1.CouponTypes.FINANCIAL:
|
|
539
|
+
return this.getFinancialDiscount(coupon);
|
|
540
|
+
case i1$1.CouponTypes.PRODUCT:
|
|
541
|
+
return function (subTotalPrice) { return subTotalPrice; };
|
|
542
|
+
case i1$1.CouponTypes.GIFTCARD:
|
|
543
|
+
return this.getFinancialDiscount(coupon);
|
|
544
|
+
case i1$1.CouponTypes.VOUCHER:
|
|
545
|
+
return function (subTotalPrice) { return subTotalPrice; };
|
|
546
|
+
}
|
|
547
|
+
};
|
|
548
|
+
CartService.prototype.getVariantPriceDiscount = function (item, shop) {
|
|
549
|
+
return this.authService.getUser().pipe(operators.concatMap(function (user) { return rxjs.iif(function () { return user.isSubscriber && !!item.getInfoByShop(shop).subscriberPrice; }, rxjs.of(item.getInfoByShop(shop).subscriberPrice), rxjs.of(item.getInfoByShop(shop).price)); }), operators.catchError(function () { return rxjs.of(item.getInfoByShop(shop).price); }));
|
|
550
|
+
};
|
|
551
|
+
CartService.prototype.removeItem = function (item) {
|
|
552
|
+
var _this = this;
|
|
553
|
+
return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) {
|
|
554
|
+
var index = checkout.lineItems.findIndex(function (lineItem) { return lineItem.sku === item.sku; });
|
|
555
|
+
if (index >= 0)
|
|
556
|
+
checkout.lineItems.splice(index, 1);
|
|
557
|
+
return checkout;
|
|
558
|
+
}), 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); }));
|
|
559
|
+
};
|
|
560
|
+
CartService.prototype.updateUserCart = function (user) {
|
|
561
|
+
var _this = this;
|
|
562
|
+
return this.checkoutService.getCheckout().pipe(operators.concatMap(function (checkout) { return _this.checkoutService.updateCheckoutUser(i1$1.Checkout.toInstance(Object.assign(Object.assign({}, checkout.toPlain()), { user: user }))); }), operators.concatMap(function (checkout) { return _this.checkoutService.updateCheckoutLineItems(i1$1.Checkout.toInstance(Object.assign(Object.assign({}, checkout.toPlain()), { lineItems: checkout.lineItems.map(function (item) { return _this.buildLineItem({ checkout: checkout, item: item }); }) }))); }), operators.map(function (checkout) { return _this.generateCartObject(checkout.lineItems); }), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
|
|
563
|
+
};
|
|
564
|
+
CartService.prototype.clearCart = function () {
|
|
565
|
+
var _this = this;
|
|
566
|
+
return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) {
|
|
567
|
+
_this.checkoutService.clearCheckoutFromSession();
|
|
568
|
+
return checkout;
|
|
569
|
+
}), operators.concatMap(function (oldCheckout) { return _this.buildCartFromCheckout(oldCheckout); }), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
|
|
570
|
+
};
|
|
571
|
+
CartService.prototype.buildCartFromCheckout = function (checkoutData) {
|
|
572
|
+
var _this = this;
|
|
573
|
+
return this.checkoutService.getCheckout(checkoutData).pipe(operators.map(function (checkout) { return checkout.lineItems; }), operators.concatMap(function (lineItems) { return rxjs.of(_this.generateCartObject(lineItems)); }));
|
|
574
|
+
};
|
|
575
|
+
CartService.prototype.getFinancialDiscount = function (coupon) {
|
|
576
|
+
return function (subTotalPrice) {
|
|
577
|
+
if (i1$1.FinancialCoupon.isFinancialCoupon(coupon))
|
|
578
|
+
switch (coupon.subtype) {
|
|
579
|
+
case i1$1.CouponSubtypes.ABSOLUTE:
|
|
580
|
+
return subTotalPrice - coupon.discount * 100;
|
|
581
|
+
case i1$1.CouponSubtypes.PERCENTAGE:
|
|
582
|
+
return subTotalPrice * (1 - coupon.discount / 100);
|
|
583
|
+
}
|
|
584
|
+
};
|
|
585
|
+
};
|
|
586
|
+
return CartService;
|
|
587
|
+
}());
|
|
588
|
+
CartService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: CartService, deps: [{ token: AuthService }, { token: CheckoutService }, { token: DEFAULT_SHOP }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
589
|
+
CartService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: CartService });
|
|
590
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: CartService, decorators: [{
|
|
591
|
+
type: i0.Injectable
|
|
592
|
+
}], ctorParameters: function () {
|
|
593
|
+
return [{ type: AuthService }, { type: CheckoutService }, { type: i1__namespace$1.Shops, decorators: [{
|
|
594
|
+
type: i0.Inject,
|
|
595
|
+
args: [DEFAULT_SHOP]
|
|
596
|
+
}] }];
|
|
594
597
|
} });
|
|
595
598
|
|
|
596
|
-
var OrderService = /** @class */ (function () {
|
|
597
|
-
function OrderService(angularFirestore, orderRepository) {
|
|
598
|
-
this.angularFirestore = angularFirestore;
|
|
599
|
-
this.orderRepository = orderRepository;
|
|
600
|
-
this.orderSubject = new rxjs.Subject();
|
|
601
|
-
}
|
|
602
|
-
OrderService.prototype.getOrder = function (id) {
|
|
603
|
-
var _this = this;
|
|
604
|
-
this.angularFirestore
|
|
605
|
-
.doc(this.orderRepository.collectionName + "/" + id)
|
|
606
|
-
.valueChanges()
|
|
607
|
-
.pipe(operators.map(function (doc) { return i1$1.Order.toInstance(doc); }))
|
|
608
|
-
.subscribe(function (doc) { return _this.orderSubject.next(doc); });
|
|
609
|
-
return this.orderSubject;
|
|
610
|
-
};
|
|
611
|
-
return OrderService;
|
|
612
|
-
}());
|
|
613
|
-
OrderService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: OrderService, deps: [{ token: i1__namespace$2.AngularFirestore }, { token: 'OrderRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
614
|
-
OrderService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: OrderService });
|
|
615
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: OrderService, decorators: [{
|
|
616
|
-
type: i0.Injectable
|
|
617
|
-
}], ctorParameters: function () {
|
|
618
|
-
return [{ type: i1__namespace$2.AngularFirestore }, { type: i1__namespace$1.OrderFirestoreRepository, decorators: [{
|
|
619
|
-
type: i0.Inject,
|
|
620
|
-
args: ['OrderRepository']
|
|
621
|
-
}] }];
|
|
599
|
+
var OrderService = /** @class */ (function () {
|
|
600
|
+
function OrderService(angularFirestore, orderRepository) {
|
|
601
|
+
this.angularFirestore = angularFirestore;
|
|
602
|
+
this.orderRepository = orderRepository;
|
|
603
|
+
this.orderSubject = new rxjs.Subject();
|
|
604
|
+
}
|
|
605
|
+
OrderService.prototype.getOrder = function (id) {
|
|
606
|
+
var _this = this;
|
|
607
|
+
this.angularFirestore
|
|
608
|
+
.doc(this.orderRepository.collectionName + "/" + id)
|
|
609
|
+
.valueChanges()
|
|
610
|
+
.pipe(operators.map(function (doc) { return i1$1.Order.toInstance(doc); }))
|
|
611
|
+
.subscribe(function (doc) { return _this.orderSubject.next(doc); });
|
|
612
|
+
return this.orderSubject;
|
|
613
|
+
};
|
|
614
|
+
return OrderService;
|
|
615
|
+
}());
|
|
616
|
+
OrderService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: OrderService, deps: [{ token: i1__namespace$2.AngularFirestore }, { token: 'OrderRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
617
|
+
OrderService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: OrderService });
|
|
618
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: OrderService, decorators: [{
|
|
619
|
+
type: i0.Injectable
|
|
620
|
+
}], ctorParameters: function () {
|
|
621
|
+
return [{ type: i1__namespace$2.AngularFirestore }, { type: i1__namespace$1.OrderFirestoreRepository, decorators: [{
|
|
622
|
+
type: i0.Inject,
|
|
623
|
+
args: ['OrderRepository']
|
|
624
|
+
}] }];
|
|
622
625
|
} });
|
|
623
626
|
|
|
624
|
-
var AngularFirebaseAuthModule = /** @class */ (function () {
|
|
625
|
-
function AngularFirebaseAuthModule() {
|
|
626
|
-
}
|
|
627
|
-
AngularFirebaseAuthModule.initializeApp = function (options, nameOrConfig) {
|
|
628
|
-
return {
|
|
629
|
-
ngModule: AngularFirebaseAuthModule,
|
|
630
|
-
providers: [
|
|
631
|
-
{ provide: fire.FIREBASE_OPTIONS, useValue: options },
|
|
632
|
-
{ provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig },
|
|
633
|
-
],
|
|
634
|
-
};
|
|
635
|
-
};
|
|
636
|
-
return AngularFirebaseAuthModule;
|
|
637
|
-
}());
|
|
638
|
-
AngularFirebaseAuthModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularFirebaseAuthModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
639
|
-
AngularFirebaseAuthModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularFirebaseAuthModule, imports: [fire.AngularFireModule] });
|
|
640
|
-
AngularFirebaseAuthModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularFirebaseAuthModule, providers: [
|
|
641
|
-
{
|
|
642
|
-
provide: 'Authentication',
|
|
643
|
-
useFactory: function (authenticationService, userRepository) {
|
|
644
|
-
return new i1$1.Authentication(authenticationService, userRepository);
|
|
645
|
-
},
|
|
646
|
-
deps: ['AuthenticationService', 'UserRepository'],
|
|
647
|
-
},
|
|
648
|
-
{
|
|
649
|
-
provide: 'AuthenticationService',
|
|
650
|
-
useFactory: function (angularFireAuth) {
|
|
651
|
-
return new i1$1.AuthenticationFirebaseAuthService(angularFireAuth);
|
|
652
|
-
},
|
|
653
|
-
deps: [i1.AngularFireAuth],
|
|
654
|
-
},
|
|
655
|
-
{
|
|
656
|
-
provide: 'SignOut',
|
|
657
|
-
useFactory: function (authenticationService) {
|
|
658
|
-
return new i1$1.SignOut(authenticationService);
|
|
659
|
-
},
|
|
660
|
-
deps: ['AuthenticationService'],
|
|
661
|
-
},
|
|
662
|
-
], imports: [[fire.AngularFireModule]] });
|
|
663
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularFirebaseAuthModule, decorators: [{
|
|
664
|
-
type: i0.NgModule,
|
|
665
|
-
args: [{
|
|
666
|
-
imports: [fire.AngularFireModule],
|
|
667
|
-
providers: [
|
|
668
|
-
{
|
|
669
|
-
provide: 'Authentication',
|
|
670
|
-
useFactory: function (authenticationService, userRepository) {
|
|
671
|
-
return new i1$1.Authentication(authenticationService, userRepository);
|
|
672
|
-
},
|
|
673
|
-
deps: ['AuthenticationService', 'UserRepository'],
|
|
674
|
-
},
|
|
675
|
-
{
|
|
676
|
-
provide: 'AuthenticationService',
|
|
677
|
-
useFactory: function (angularFireAuth) {
|
|
678
|
-
return new i1$1.AuthenticationFirebaseAuthService(angularFireAuth);
|
|
679
|
-
},
|
|
680
|
-
deps: [i1.AngularFireAuth],
|
|
681
|
-
},
|
|
682
|
-
{
|
|
683
|
-
provide: 'SignOut',
|
|
684
|
-
useFactory: function (authenticationService) {
|
|
685
|
-
return new i1$1.SignOut(authenticationService);
|
|
686
|
-
},
|
|
687
|
-
deps: ['AuthenticationService'],
|
|
688
|
-
},
|
|
689
|
-
],
|
|
690
|
-
}]
|
|
627
|
+
var AngularFirebaseAuthModule = /** @class */ (function () {
|
|
628
|
+
function AngularFirebaseAuthModule() {
|
|
629
|
+
}
|
|
630
|
+
AngularFirebaseAuthModule.initializeApp = function (options, nameOrConfig) {
|
|
631
|
+
return {
|
|
632
|
+
ngModule: AngularFirebaseAuthModule,
|
|
633
|
+
providers: [
|
|
634
|
+
{ provide: fire.FIREBASE_OPTIONS, useValue: options },
|
|
635
|
+
{ provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig },
|
|
636
|
+
],
|
|
637
|
+
};
|
|
638
|
+
};
|
|
639
|
+
return AngularFirebaseAuthModule;
|
|
640
|
+
}());
|
|
641
|
+
AngularFirebaseAuthModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularFirebaseAuthModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
642
|
+
AngularFirebaseAuthModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularFirebaseAuthModule, imports: [fire.AngularFireModule] });
|
|
643
|
+
AngularFirebaseAuthModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularFirebaseAuthModule, providers: [
|
|
644
|
+
{
|
|
645
|
+
provide: 'Authentication',
|
|
646
|
+
useFactory: function (authenticationService, userRepository) {
|
|
647
|
+
return new i1$1.Authentication(authenticationService, userRepository);
|
|
648
|
+
},
|
|
649
|
+
deps: ['AuthenticationService', 'UserRepository'],
|
|
650
|
+
},
|
|
651
|
+
{
|
|
652
|
+
provide: 'AuthenticationService',
|
|
653
|
+
useFactory: function (angularFireAuth) {
|
|
654
|
+
return new i1$1.AuthenticationFirebaseAuthService(angularFireAuth);
|
|
655
|
+
},
|
|
656
|
+
deps: [i1.AngularFireAuth],
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
provide: 'SignOut',
|
|
660
|
+
useFactory: function (authenticationService) {
|
|
661
|
+
return new i1$1.SignOut(authenticationService);
|
|
662
|
+
},
|
|
663
|
+
deps: ['AuthenticationService'],
|
|
664
|
+
},
|
|
665
|
+
], imports: [[fire.AngularFireModule]] });
|
|
666
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularFirebaseAuthModule, decorators: [{
|
|
667
|
+
type: i0.NgModule,
|
|
668
|
+
args: [{
|
|
669
|
+
imports: [fire.AngularFireModule],
|
|
670
|
+
providers: [
|
|
671
|
+
{
|
|
672
|
+
provide: 'Authentication',
|
|
673
|
+
useFactory: function (authenticationService, userRepository) {
|
|
674
|
+
return new i1$1.Authentication(authenticationService, userRepository);
|
|
675
|
+
},
|
|
676
|
+
deps: ['AuthenticationService', 'UserRepository'],
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
provide: 'AuthenticationService',
|
|
680
|
+
useFactory: function (angularFireAuth) {
|
|
681
|
+
return new i1$1.AuthenticationFirebaseAuthService(angularFireAuth);
|
|
682
|
+
},
|
|
683
|
+
deps: [i1.AngularFireAuth],
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
provide: 'SignOut',
|
|
687
|
+
useFactory: function (authenticationService) {
|
|
688
|
+
return new i1$1.SignOut(authenticationService);
|
|
689
|
+
},
|
|
690
|
+
deps: ['AuthenticationService'],
|
|
691
|
+
},
|
|
692
|
+
],
|
|
693
|
+
}]
|
|
691
694
|
}] });
|
|
692
695
|
|
|
693
|
-
var AngularFirestoreModule = /** @class */ (function () {
|
|
694
|
-
function AngularFirestoreModule() {
|
|
695
|
-
}
|
|
696
|
-
AngularFirestoreModule.initializeApp = function (options, nameOrConfig) {
|
|
697
|
-
return {
|
|
698
|
-
ngModule: AngularFirestoreModule,
|
|
699
|
-
providers: [
|
|
700
|
-
{ provide: fire.FIREBASE_OPTIONS, useValue: options },
|
|
701
|
-
{ provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig },
|
|
702
|
-
],
|
|
703
|
-
};
|
|
704
|
-
};
|
|
705
|
-
return AngularFirestoreModule;
|
|
706
|
-
}());
|
|
707
|
-
AngularFirestoreModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularFirestoreModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
708
|
-
AngularFirestoreModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularFirestoreModule, imports: [fire.AngularFireModule] });
|
|
709
|
-
AngularFirestoreModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularFirestoreModule, providers: [
|
|
710
|
-
{
|
|
711
|
-
provide: 'BeautyProfileRepository',
|
|
712
|
-
useFactory: function (firestore, userRepository) {
|
|
713
|
-
return new i1$1.UserBeautyProfileFirestoreRepository(firestore.firestore, userRepository);
|
|
714
|
-
},
|
|
715
|
-
deps: [i1$2.AngularFirestore, 'UserRepository'],
|
|
716
|
-
},
|
|
717
|
-
{
|
|
718
|
-
provide: 'Buy2WinRepository',
|
|
719
|
-
useFactory: function (firestore) {
|
|
720
|
-
return new i1$1.Buy2WinFirestoreRepository(firestore.firestore);
|
|
721
|
-
},
|
|
722
|
-
deps: [i1$2.AngularFirestore],
|
|
723
|
-
},
|
|
724
|
-
{
|
|
725
|
-
provide: 'CategoryRepository',
|
|
726
|
-
useFactory: function (firestore) {
|
|
727
|
-
return new i1$1.CategoryFirestoreRepository(firestore.firestore);
|
|
728
|
-
},
|
|
729
|
-
deps: [i1$2.AngularFirestore],
|
|
730
|
-
},
|
|
731
|
-
{
|
|
732
|
-
provide: 'CheckoutRepository',
|
|
733
|
-
useFactory: function (firestore) {
|
|
734
|
-
return new i1$1.CheckoutFirestoreRepository(firestore.firestore);
|
|
735
|
-
},
|
|
736
|
-
deps: [i1$2.AngularFirestore],
|
|
737
|
-
},
|
|
738
|
-
{
|
|
739
|
-
provide: 'CheckoutSubscriptionRepository',
|
|
740
|
-
useFactory: function (firestore) {
|
|
741
|
-
return new i1$1.CheckoutSubscriptionFirestoreRepository(firestore.firestore);
|
|
742
|
-
},
|
|
743
|
-
deps: [i1$2.AngularFirestore],
|
|
744
|
-
},
|
|
745
|
-
{
|
|
746
|
-
provide: 'CouponRepository',
|
|
747
|
-
useFactory: function (firestore) {
|
|
748
|
-
return new i1$1.CouponFirestoreRepository(firestore.firestore);
|
|
749
|
-
},
|
|
750
|
-
deps: [i1$2.AngularFirestore],
|
|
751
|
-
},
|
|
752
|
-
{
|
|
753
|
-
provide: 'EditionRepository',
|
|
754
|
-
useFactory: function (firestore, subscriptionRepository) {
|
|
755
|
-
return new i1$1.SubscriptionEditionFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
756
|
-
},
|
|
757
|
-
deps: [i1$2.AngularFirestore, 'SubscriptionRepository'],
|
|
758
|
-
},
|
|
759
|
-
{
|
|
760
|
-
provide: 'HomeRepository',
|
|
761
|
-
useFactory: function (firestore) {
|
|
762
|
-
return new i1$1.HomeFirestoreRepository(firestore.firestore);
|
|
763
|
-
},
|
|
764
|
-
deps: [i1$2.AngularFirestore],
|
|
765
|
-
},
|
|
766
|
-
{
|
|
767
|
-
provide: 'LegacyOrderRepository',
|
|
768
|
-
useFactory: function (firestore) {
|
|
769
|
-
return new i1$1.LegacyOrderFirestoreRepository(firestore.firestore);
|
|
770
|
-
},
|
|
771
|
-
deps: [i1$2.AngularFirestore],
|
|
772
|
-
},
|
|
773
|
-
{
|
|
774
|
-
provide: 'ShopMenuRepository',
|
|
775
|
-
useFactory: function (firestore) {
|
|
776
|
-
return new i1$1.ShopMenuFirestoreRepository(firestore.firestore);
|
|
777
|
-
},
|
|
778
|
-
deps: [i1$2.AngularFirestore],
|
|
779
|
-
},
|
|
780
|
-
{
|
|
781
|
-
provide: 'OrderRepository',
|
|
782
|
-
useFactory: function (firestore) {
|
|
783
|
-
return new i1$1.OrderFirestoreRepository(firestore.firestore);
|
|
784
|
-
},
|
|
785
|
-
deps: [i1$2.AngularFirestore],
|
|
786
|
-
},
|
|
787
|
-
{
|
|
788
|
-
provide: 'PaymentRepository',
|
|
789
|
-
useFactory: function (firestore) {
|
|
790
|
-
return new i1$1.PaymentFirestoreRepository(firestore.firestore);
|
|
791
|
-
},
|
|
792
|
-
deps: [i1$2.AngularFirestore],
|
|
793
|
-
},
|
|
794
|
-
{
|
|
795
|
-
provide: 'ProductRepository',
|
|
796
|
-
useFactory: function (firestore) {
|
|
797
|
-
return new i1$1.ProductFirestoreRepository(firestore.firestore);
|
|
798
|
-
},
|
|
799
|
-
deps: [i1$2.AngularFirestore],
|
|
800
|
-
},
|
|
801
|
-
{
|
|
802
|
-
provide: 'SubscriptionPaymentRepository',
|
|
803
|
-
useFactory: function (firestore, subscriptionRepository) {
|
|
804
|
-
return new i1$1.SubscriptionPaymentFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
805
|
-
},
|
|
806
|
-
deps: [i1$2.AngularFirestore, 'SubscriptionRepository'],
|
|
807
|
-
},
|
|
808
|
-
{
|
|
809
|
-
provide: 'SubscriptionPlanRepository',
|
|
810
|
-
useFactory: function (firestore) {
|
|
811
|
-
return new i1$1.SubscriptionPlanFirestoreRepository(firestore.firestore);
|
|
812
|
-
},
|
|
813
|
-
deps: [i1$2.AngularFirestore],
|
|
814
|
-
},
|
|
815
|
-
{
|
|
816
|
-
provide: 'SubscriptionRepository',
|
|
817
|
-
useFactory: function (firestore) {
|
|
818
|
-
return new i1$1.SubscriptionFirestoreRepository(firestore.firestore);
|
|
819
|
-
},
|
|
820
|
-
deps: [i1$2.AngularFirestore],
|
|
821
|
-
},
|
|
822
|
-
{
|
|
823
|
-
provide: 'UserRepository',
|
|
824
|
-
useFactory: function (firestore) {
|
|
825
|
-
return new i1$1.UserFirestoreRepository(firestore.firestore);
|
|
826
|
-
},
|
|
827
|
-
deps: [i1$2.AngularFirestore],
|
|
828
|
-
},
|
|
829
|
-
{
|
|
830
|
-
provide: 'UserAddressRepository',
|
|
831
|
-
useFactory: function (firestore, userRepository) {
|
|
832
|
-
return new i1$1.UserAddressFirestoreRepository(firestore.firestore, userRepository);
|
|
833
|
-
},
|
|
834
|
-
deps: [i1$2.AngularFirestore, 'UserRepository'],
|
|
835
|
-
},
|
|
836
|
-
{
|
|
837
|
-
provide: 'VariantRepository',
|
|
838
|
-
useFactory: function (firestore, productRepository) {
|
|
839
|
-
return new i1$1.ProductVariantFirestoreRepository(firestore.firestore, productRepository);
|
|
840
|
-
},
|
|
841
|
-
deps: [i1$2.AngularFirestore, 'ProductRepository'],
|
|
842
|
-
},
|
|
843
|
-
], imports: [[fire.AngularFireModule]] });
|
|
844
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularFirestoreModule, decorators: [{
|
|
845
|
-
type: i0.NgModule,
|
|
846
|
-
args: [{
|
|
847
|
-
imports: [fire.AngularFireModule],
|
|
848
|
-
providers: [
|
|
849
|
-
{
|
|
850
|
-
provide: 'BeautyProfileRepository',
|
|
851
|
-
useFactory: function (firestore, userRepository) {
|
|
852
|
-
return new i1$1.UserBeautyProfileFirestoreRepository(firestore.firestore, userRepository);
|
|
853
|
-
},
|
|
854
|
-
deps: [i1$2.AngularFirestore, 'UserRepository'],
|
|
855
|
-
},
|
|
856
|
-
{
|
|
857
|
-
provide: 'Buy2WinRepository',
|
|
858
|
-
useFactory: function (firestore) {
|
|
859
|
-
return new i1$1.Buy2WinFirestoreRepository(firestore.firestore);
|
|
860
|
-
},
|
|
861
|
-
deps: [i1$2.AngularFirestore],
|
|
862
|
-
},
|
|
863
|
-
{
|
|
864
|
-
provide: 'CategoryRepository',
|
|
865
|
-
useFactory: function (firestore) {
|
|
866
|
-
return new i1$1.CategoryFirestoreRepository(firestore.firestore);
|
|
867
|
-
},
|
|
868
|
-
deps: [i1$2.AngularFirestore],
|
|
869
|
-
},
|
|
870
|
-
{
|
|
871
|
-
provide: 'CheckoutRepository',
|
|
872
|
-
useFactory: function (firestore) {
|
|
873
|
-
return new i1$1.CheckoutFirestoreRepository(firestore.firestore);
|
|
874
|
-
},
|
|
875
|
-
deps: [i1$2.AngularFirestore],
|
|
876
|
-
},
|
|
877
|
-
{
|
|
878
|
-
provide: 'CheckoutSubscriptionRepository',
|
|
879
|
-
useFactory: function (firestore) {
|
|
880
|
-
return new i1$1.CheckoutSubscriptionFirestoreRepository(firestore.firestore);
|
|
881
|
-
},
|
|
882
|
-
deps: [i1$2.AngularFirestore],
|
|
883
|
-
},
|
|
884
|
-
{
|
|
885
|
-
provide: 'CouponRepository',
|
|
886
|
-
useFactory: function (firestore) {
|
|
887
|
-
return new i1$1.CouponFirestoreRepository(firestore.firestore);
|
|
888
|
-
},
|
|
889
|
-
deps: [i1$2.AngularFirestore],
|
|
890
|
-
},
|
|
891
|
-
{
|
|
892
|
-
provide: 'EditionRepository',
|
|
893
|
-
useFactory: function (firestore, subscriptionRepository) {
|
|
894
|
-
return new i1$1.SubscriptionEditionFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
895
|
-
},
|
|
896
|
-
deps: [i1$2.AngularFirestore, 'SubscriptionRepository'],
|
|
897
|
-
},
|
|
898
|
-
{
|
|
899
|
-
provide: 'HomeRepository',
|
|
900
|
-
useFactory: function (firestore) {
|
|
901
|
-
return new i1$1.HomeFirestoreRepository(firestore.firestore);
|
|
902
|
-
},
|
|
903
|
-
deps: [i1$2.AngularFirestore],
|
|
904
|
-
},
|
|
905
|
-
{
|
|
906
|
-
provide: 'LegacyOrderRepository',
|
|
907
|
-
useFactory: function (firestore) {
|
|
908
|
-
return new i1$1.LegacyOrderFirestoreRepository(firestore.firestore);
|
|
909
|
-
},
|
|
910
|
-
deps: [i1$2.AngularFirestore],
|
|
911
|
-
},
|
|
912
|
-
{
|
|
913
|
-
provide: 'ShopMenuRepository',
|
|
914
|
-
useFactory: function (firestore) {
|
|
915
|
-
return new i1$1.ShopMenuFirestoreRepository(firestore.firestore);
|
|
916
|
-
},
|
|
917
|
-
deps: [i1$2.AngularFirestore],
|
|
918
|
-
},
|
|
919
|
-
{
|
|
920
|
-
provide: 'OrderRepository',
|
|
921
|
-
useFactory: function (firestore) {
|
|
922
|
-
return new i1$1.OrderFirestoreRepository(firestore.firestore);
|
|
923
|
-
},
|
|
924
|
-
deps: [i1$2.AngularFirestore],
|
|
925
|
-
},
|
|
926
|
-
{
|
|
927
|
-
provide: 'PaymentRepository',
|
|
928
|
-
useFactory: function (firestore) {
|
|
929
|
-
return new i1$1.PaymentFirestoreRepository(firestore.firestore);
|
|
930
|
-
},
|
|
931
|
-
deps: [i1$2.AngularFirestore],
|
|
932
|
-
},
|
|
933
|
-
{
|
|
934
|
-
provide: 'ProductRepository',
|
|
935
|
-
useFactory: function (firestore) {
|
|
936
|
-
return new i1$1.ProductFirestoreRepository(firestore.firestore);
|
|
937
|
-
},
|
|
938
|
-
deps: [i1$2.AngularFirestore],
|
|
939
|
-
},
|
|
940
|
-
{
|
|
941
|
-
provide: 'SubscriptionPaymentRepository',
|
|
942
|
-
useFactory: function (firestore, subscriptionRepository) {
|
|
943
|
-
return new i1$1.SubscriptionPaymentFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
944
|
-
},
|
|
945
|
-
deps: [i1$2.AngularFirestore, 'SubscriptionRepository'],
|
|
946
|
-
},
|
|
947
|
-
{
|
|
948
|
-
provide: 'SubscriptionPlanRepository',
|
|
949
|
-
useFactory: function (firestore) {
|
|
950
|
-
return new i1$1.SubscriptionPlanFirestoreRepository(firestore.firestore);
|
|
951
|
-
},
|
|
952
|
-
deps: [i1$2.AngularFirestore],
|
|
953
|
-
},
|
|
954
|
-
{
|
|
955
|
-
provide: 'SubscriptionRepository',
|
|
956
|
-
useFactory: function (firestore) {
|
|
957
|
-
return new i1$1.SubscriptionFirestoreRepository(firestore.firestore);
|
|
958
|
-
},
|
|
959
|
-
deps: [i1$2.AngularFirestore],
|
|
960
|
-
},
|
|
961
|
-
{
|
|
962
|
-
provide: 'UserRepository',
|
|
963
|
-
useFactory: function (firestore) {
|
|
964
|
-
return new i1$1.UserFirestoreRepository(firestore.firestore);
|
|
965
|
-
},
|
|
966
|
-
deps: [i1$2.AngularFirestore],
|
|
967
|
-
},
|
|
968
|
-
{
|
|
969
|
-
provide: 'UserAddressRepository',
|
|
970
|
-
useFactory: function (firestore, userRepository) {
|
|
971
|
-
return new i1$1.UserAddressFirestoreRepository(firestore.firestore, userRepository);
|
|
972
|
-
},
|
|
973
|
-
deps: [i1$2.AngularFirestore, 'UserRepository'],
|
|
974
|
-
},
|
|
975
|
-
{
|
|
976
|
-
provide: 'VariantRepository',
|
|
977
|
-
useFactory: function (firestore, productRepository) {
|
|
978
|
-
return new i1$1.ProductVariantFirestoreRepository(firestore.firestore, productRepository);
|
|
979
|
-
},
|
|
980
|
-
deps: [i1$2.AngularFirestore, 'ProductRepository'],
|
|
981
|
-
},
|
|
982
|
-
],
|
|
983
|
-
}]
|
|
696
|
+
var AngularFirestoreModule = /** @class */ (function () {
|
|
697
|
+
function AngularFirestoreModule() {
|
|
698
|
+
}
|
|
699
|
+
AngularFirestoreModule.initializeApp = function (options, nameOrConfig) {
|
|
700
|
+
return {
|
|
701
|
+
ngModule: AngularFirestoreModule,
|
|
702
|
+
providers: [
|
|
703
|
+
{ provide: fire.FIREBASE_OPTIONS, useValue: options },
|
|
704
|
+
{ provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig },
|
|
705
|
+
],
|
|
706
|
+
};
|
|
707
|
+
};
|
|
708
|
+
return AngularFirestoreModule;
|
|
709
|
+
}());
|
|
710
|
+
AngularFirestoreModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularFirestoreModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
711
|
+
AngularFirestoreModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularFirestoreModule, imports: [fire.AngularFireModule] });
|
|
712
|
+
AngularFirestoreModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularFirestoreModule, providers: [
|
|
713
|
+
{
|
|
714
|
+
provide: 'BeautyProfileRepository',
|
|
715
|
+
useFactory: function (firestore, userRepository) {
|
|
716
|
+
return new i1$1.UserBeautyProfileFirestoreRepository(firestore.firestore, userRepository);
|
|
717
|
+
},
|
|
718
|
+
deps: [i1$2.AngularFirestore, 'UserRepository'],
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
provide: 'Buy2WinRepository',
|
|
722
|
+
useFactory: function (firestore) {
|
|
723
|
+
return new i1$1.Buy2WinFirestoreRepository(firestore.firestore);
|
|
724
|
+
},
|
|
725
|
+
deps: [i1$2.AngularFirestore],
|
|
726
|
+
},
|
|
727
|
+
{
|
|
728
|
+
provide: 'CategoryRepository',
|
|
729
|
+
useFactory: function (firestore) {
|
|
730
|
+
return new i1$1.CategoryFirestoreRepository(firestore.firestore);
|
|
731
|
+
},
|
|
732
|
+
deps: [i1$2.AngularFirestore],
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
provide: 'CheckoutRepository',
|
|
736
|
+
useFactory: function (firestore) {
|
|
737
|
+
return new i1$1.CheckoutFirestoreRepository(firestore.firestore);
|
|
738
|
+
},
|
|
739
|
+
deps: [i1$2.AngularFirestore],
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
provide: 'CheckoutSubscriptionRepository',
|
|
743
|
+
useFactory: function (firestore) {
|
|
744
|
+
return new i1$1.CheckoutSubscriptionFirestoreRepository(firestore.firestore);
|
|
745
|
+
},
|
|
746
|
+
deps: [i1$2.AngularFirestore],
|
|
747
|
+
},
|
|
748
|
+
{
|
|
749
|
+
provide: 'CouponRepository',
|
|
750
|
+
useFactory: function (firestore) {
|
|
751
|
+
return new i1$1.CouponFirestoreRepository(firestore.firestore);
|
|
752
|
+
},
|
|
753
|
+
deps: [i1$2.AngularFirestore],
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
provide: 'EditionRepository',
|
|
757
|
+
useFactory: function (firestore, subscriptionRepository) {
|
|
758
|
+
return new i1$1.SubscriptionEditionFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
759
|
+
},
|
|
760
|
+
deps: [i1$2.AngularFirestore, 'SubscriptionRepository'],
|
|
761
|
+
},
|
|
762
|
+
{
|
|
763
|
+
provide: 'HomeRepository',
|
|
764
|
+
useFactory: function (firestore) {
|
|
765
|
+
return new i1$1.HomeFirestoreRepository(firestore.firestore);
|
|
766
|
+
},
|
|
767
|
+
deps: [i1$2.AngularFirestore],
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
provide: 'LegacyOrderRepository',
|
|
771
|
+
useFactory: function (firestore) {
|
|
772
|
+
return new i1$1.LegacyOrderFirestoreRepository(firestore.firestore);
|
|
773
|
+
},
|
|
774
|
+
deps: [i1$2.AngularFirestore],
|
|
775
|
+
},
|
|
776
|
+
{
|
|
777
|
+
provide: 'ShopMenuRepository',
|
|
778
|
+
useFactory: function (firestore) {
|
|
779
|
+
return new i1$1.ShopMenuFirestoreRepository(firestore.firestore);
|
|
780
|
+
},
|
|
781
|
+
deps: [i1$2.AngularFirestore],
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
provide: 'OrderRepository',
|
|
785
|
+
useFactory: function (firestore) {
|
|
786
|
+
return new i1$1.OrderFirestoreRepository(firestore.firestore);
|
|
787
|
+
},
|
|
788
|
+
deps: [i1$2.AngularFirestore],
|
|
789
|
+
},
|
|
790
|
+
{
|
|
791
|
+
provide: 'PaymentRepository',
|
|
792
|
+
useFactory: function (firestore) {
|
|
793
|
+
return new i1$1.PaymentFirestoreRepository(firestore.firestore);
|
|
794
|
+
},
|
|
795
|
+
deps: [i1$2.AngularFirestore],
|
|
796
|
+
},
|
|
797
|
+
{
|
|
798
|
+
provide: 'ProductRepository',
|
|
799
|
+
useFactory: function (firestore) {
|
|
800
|
+
return new i1$1.ProductFirestoreRepository(firestore.firestore);
|
|
801
|
+
},
|
|
802
|
+
deps: [i1$2.AngularFirestore],
|
|
803
|
+
},
|
|
804
|
+
{
|
|
805
|
+
provide: 'SubscriptionPaymentRepository',
|
|
806
|
+
useFactory: function (firestore, subscriptionRepository) {
|
|
807
|
+
return new i1$1.SubscriptionPaymentFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
808
|
+
},
|
|
809
|
+
deps: [i1$2.AngularFirestore, 'SubscriptionRepository'],
|
|
810
|
+
},
|
|
811
|
+
{
|
|
812
|
+
provide: 'SubscriptionPlanRepository',
|
|
813
|
+
useFactory: function (firestore) {
|
|
814
|
+
return new i1$1.SubscriptionPlanFirestoreRepository(firestore.firestore);
|
|
815
|
+
},
|
|
816
|
+
deps: [i1$2.AngularFirestore],
|
|
817
|
+
},
|
|
818
|
+
{
|
|
819
|
+
provide: 'SubscriptionRepository',
|
|
820
|
+
useFactory: function (firestore) {
|
|
821
|
+
return new i1$1.SubscriptionFirestoreRepository(firestore.firestore);
|
|
822
|
+
},
|
|
823
|
+
deps: [i1$2.AngularFirestore],
|
|
824
|
+
},
|
|
825
|
+
{
|
|
826
|
+
provide: 'UserRepository',
|
|
827
|
+
useFactory: function (firestore) {
|
|
828
|
+
return new i1$1.UserFirestoreRepository(firestore.firestore);
|
|
829
|
+
},
|
|
830
|
+
deps: [i1$2.AngularFirestore],
|
|
831
|
+
},
|
|
832
|
+
{
|
|
833
|
+
provide: 'UserAddressRepository',
|
|
834
|
+
useFactory: function (firestore, userRepository) {
|
|
835
|
+
return new i1$1.UserAddressFirestoreRepository(firestore.firestore, userRepository);
|
|
836
|
+
},
|
|
837
|
+
deps: [i1$2.AngularFirestore, 'UserRepository'],
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
provide: 'VariantRepository',
|
|
841
|
+
useFactory: function (firestore, productRepository) {
|
|
842
|
+
return new i1$1.ProductVariantFirestoreRepository(firestore.firestore, productRepository);
|
|
843
|
+
},
|
|
844
|
+
deps: [i1$2.AngularFirestore, 'ProductRepository'],
|
|
845
|
+
},
|
|
846
|
+
], imports: [[fire.AngularFireModule]] });
|
|
847
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularFirestoreModule, decorators: [{
|
|
848
|
+
type: i0.NgModule,
|
|
849
|
+
args: [{
|
|
850
|
+
imports: [fire.AngularFireModule],
|
|
851
|
+
providers: [
|
|
852
|
+
{
|
|
853
|
+
provide: 'BeautyProfileRepository',
|
|
854
|
+
useFactory: function (firestore, userRepository) {
|
|
855
|
+
return new i1$1.UserBeautyProfileFirestoreRepository(firestore.firestore, userRepository);
|
|
856
|
+
},
|
|
857
|
+
deps: [i1$2.AngularFirestore, 'UserRepository'],
|
|
858
|
+
},
|
|
859
|
+
{
|
|
860
|
+
provide: 'Buy2WinRepository',
|
|
861
|
+
useFactory: function (firestore) {
|
|
862
|
+
return new i1$1.Buy2WinFirestoreRepository(firestore.firestore);
|
|
863
|
+
},
|
|
864
|
+
deps: [i1$2.AngularFirestore],
|
|
865
|
+
},
|
|
866
|
+
{
|
|
867
|
+
provide: 'CategoryRepository',
|
|
868
|
+
useFactory: function (firestore) {
|
|
869
|
+
return new i1$1.CategoryFirestoreRepository(firestore.firestore);
|
|
870
|
+
},
|
|
871
|
+
deps: [i1$2.AngularFirestore],
|
|
872
|
+
},
|
|
873
|
+
{
|
|
874
|
+
provide: 'CheckoutRepository',
|
|
875
|
+
useFactory: function (firestore) {
|
|
876
|
+
return new i1$1.CheckoutFirestoreRepository(firestore.firestore);
|
|
877
|
+
},
|
|
878
|
+
deps: [i1$2.AngularFirestore],
|
|
879
|
+
},
|
|
880
|
+
{
|
|
881
|
+
provide: 'CheckoutSubscriptionRepository',
|
|
882
|
+
useFactory: function (firestore) {
|
|
883
|
+
return new i1$1.CheckoutSubscriptionFirestoreRepository(firestore.firestore);
|
|
884
|
+
},
|
|
885
|
+
deps: [i1$2.AngularFirestore],
|
|
886
|
+
},
|
|
887
|
+
{
|
|
888
|
+
provide: 'CouponRepository',
|
|
889
|
+
useFactory: function (firestore) {
|
|
890
|
+
return new i1$1.CouponFirestoreRepository(firestore.firestore);
|
|
891
|
+
},
|
|
892
|
+
deps: [i1$2.AngularFirestore],
|
|
893
|
+
},
|
|
894
|
+
{
|
|
895
|
+
provide: 'EditionRepository',
|
|
896
|
+
useFactory: function (firestore, subscriptionRepository) {
|
|
897
|
+
return new i1$1.SubscriptionEditionFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
898
|
+
},
|
|
899
|
+
deps: [i1$2.AngularFirestore, 'SubscriptionRepository'],
|
|
900
|
+
},
|
|
901
|
+
{
|
|
902
|
+
provide: 'HomeRepository',
|
|
903
|
+
useFactory: function (firestore) {
|
|
904
|
+
return new i1$1.HomeFirestoreRepository(firestore.firestore);
|
|
905
|
+
},
|
|
906
|
+
deps: [i1$2.AngularFirestore],
|
|
907
|
+
},
|
|
908
|
+
{
|
|
909
|
+
provide: 'LegacyOrderRepository',
|
|
910
|
+
useFactory: function (firestore) {
|
|
911
|
+
return new i1$1.LegacyOrderFirestoreRepository(firestore.firestore);
|
|
912
|
+
},
|
|
913
|
+
deps: [i1$2.AngularFirestore],
|
|
914
|
+
},
|
|
915
|
+
{
|
|
916
|
+
provide: 'ShopMenuRepository',
|
|
917
|
+
useFactory: function (firestore) {
|
|
918
|
+
return new i1$1.ShopMenuFirestoreRepository(firestore.firestore);
|
|
919
|
+
},
|
|
920
|
+
deps: [i1$2.AngularFirestore],
|
|
921
|
+
},
|
|
922
|
+
{
|
|
923
|
+
provide: 'OrderRepository',
|
|
924
|
+
useFactory: function (firestore) {
|
|
925
|
+
return new i1$1.OrderFirestoreRepository(firestore.firestore);
|
|
926
|
+
},
|
|
927
|
+
deps: [i1$2.AngularFirestore],
|
|
928
|
+
},
|
|
929
|
+
{
|
|
930
|
+
provide: 'PaymentRepository',
|
|
931
|
+
useFactory: function (firestore) {
|
|
932
|
+
return new i1$1.PaymentFirestoreRepository(firestore.firestore);
|
|
933
|
+
},
|
|
934
|
+
deps: [i1$2.AngularFirestore],
|
|
935
|
+
},
|
|
936
|
+
{
|
|
937
|
+
provide: 'ProductRepository',
|
|
938
|
+
useFactory: function (firestore) {
|
|
939
|
+
return new i1$1.ProductFirestoreRepository(firestore.firestore);
|
|
940
|
+
},
|
|
941
|
+
deps: [i1$2.AngularFirestore],
|
|
942
|
+
},
|
|
943
|
+
{
|
|
944
|
+
provide: 'SubscriptionPaymentRepository',
|
|
945
|
+
useFactory: function (firestore, subscriptionRepository) {
|
|
946
|
+
return new i1$1.SubscriptionPaymentFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
947
|
+
},
|
|
948
|
+
deps: [i1$2.AngularFirestore, 'SubscriptionRepository'],
|
|
949
|
+
},
|
|
950
|
+
{
|
|
951
|
+
provide: 'SubscriptionPlanRepository',
|
|
952
|
+
useFactory: function (firestore) {
|
|
953
|
+
return new i1$1.SubscriptionPlanFirestoreRepository(firestore.firestore);
|
|
954
|
+
},
|
|
955
|
+
deps: [i1$2.AngularFirestore],
|
|
956
|
+
},
|
|
957
|
+
{
|
|
958
|
+
provide: 'SubscriptionRepository',
|
|
959
|
+
useFactory: function (firestore) {
|
|
960
|
+
return new i1$1.SubscriptionFirestoreRepository(firestore.firestore);
|
|
961
|
+
},
|
|
962
|
+
deps: [i1$2.AngularFirestore],
|
|
963
|
+
},
|
|
964
|
+
{
|
|
965
|
+
provide: 'UserRepository',
|
|
966
|
+
useFactory: function (firestore) {
|
|
967
|
+
return new i1$1.UserFirestoreRepository(firestore.firestore);
|
|
968
|
+
},
|
|
969
|
+
deps: [i1$2.AngularFirestore],
|
|
970
|
+
},
|
|
971
|
+
{
|
|
972
|
+
provide: 'UserAddressRepository',
|
|
973
|
+
useFactory: function (firestore, userRepository) {
|
|
974
|
+
return new i1$1.UserAddressFirestoreRepository(firestore.firestore, userRepository);
|
|
975
|
+
},
|
|
976
|
+
deps: [i1$2.AngularFirestore, 'UserRepository'],
|
|
977
|
+
},
|
|
978
|
+
{
|
|
979
|
+
provide: 'VariantRepository',
|
|
980
|
+
useFactory: function (firestore, productRepository) {
|
|
981
|
+
return new i1$1.ProductVariantFirestoreRepository(firestore.firestore, productRepository);
|
|
982
|
+
},
|
|
983
|
+
deps: [i1$2.AngularFirestore, 'ProductRepository'],
|
|
984
|
+
},
|
|
985
|
+
],
|
|
986
|
+
}]
|
|
984
987
|
}] });
|
|
985
988
|
|
|
986
|
-
var AngularConnectModule = /** @class */ (function () {
|
|
987
|
-
function AngularConnectModule() {
|
|
988
|
-
}
|
|
989
|
-
AngularConnectModule.initializeApp = function (defaultShop, options, nameOrConfig) {
|
|
990
|
-
return {
|
|
991
|
-
ngModule: AngularConnectModule,
|
|
992
|
-
providers: __spreadArray(__spreadArray(__spreadArray([], __read((i1$1.isNil(defaultShop) ? [] : [{ provide: DEFAULT_SHOP, useValue: defaultShop }]))), __read((i1$1.isNil(options) ? [] : [{ provide: fire.FIREBASE_OPTIONS, useValue: options }]))), __read((i1$1.isNil(options) ? [] : [{ provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig }]))),
|
|
993
|
-
};
|
|
994
|
-
};
|
|
995
|
-
return AngularConnectModule;
|
|
996
|
-
}());
|
|
997
|
-
AngularConnectModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularConnectModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
998
|
-
AngularConnectModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularConnectModule, imports: [fire.AngularFireModule, AngularFirestoreModule] });
|
|
999
|
-
AngularConnectModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularConnectModule, providers: [AuthService, CartService, CheckoutService, OrderService], imports: [[fire.AngularFireModule, AngularFirestoreModule]] });
|
|
1000
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularConnectModule, decorators: [{
|
|
1001
|
-
type: i0.NgModule,
|
|
1002
|
-
args: [{
|
|
1003
|
-
imports: [fire.AngularFireModule, AngularFirestoreModule],
|
|
1004
|
-
providers: [AuthService, CartService, CheckoutService, OrderService],
|
|
1005
|
-
}]
|
|
989
|
+
var AngularConnectModule = /** @class */ (function () {
|
|
990
|
+
function AngularConnectModule() {
|
|
991
|
+
}
|
|
992
|
+
AngularConnectModule.initializeApp = function (defaultShop, options, nameOrConfig) {
|
|
993
|
+
return {
|
|
994
|
+
ngModule: AngularConnectModule,
|
|
995
|
+
providers: __spreadArray(__spreadArray(__spreadArray([], __read((i1$1.isNil(defaultShop) ? [] : [{ provide: DEFAULT_SHOP, useValue: defaultShop }]))), __read((i1$1.isNil(options) ? [] : [{ provide: fire.FIREBASE_OPTIONS, useValue: options }]))), __read((i1$1.isNil(options) ? [] : [{ provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig }]))),
|
|
996
|
+
};
|
|
997
|
+
};
|
|
998
|
+
return AngularConnectModule;
|
|
999
|
+
}());
|
|
1000
|
+
AngularConnectModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularConnectModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
1001
|
+
AngularConnectModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularConnectModule, imports: [fire.AngularFireModule, AngularFirestoreModule] });
|
|
1002
|
+
AngularConnectModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularConnectModule, providers: [AuthService, CartService, CheckoutService, OrderService], imports: [[fire.AngularFireModule, AngularFirestoreModule]] });
|
|
1003
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: AngularConnectModule, decorators: [{
|
|
1004
|
+
type: i0.NgModule,
|
|
1005
|
+
args: [{
|
|
1006
|
+
imports: [fire.AngularFireModule, AngularFirestoreModule],
|
|
1007
|
+
providers: [AuthService, CartService, CheckoutService, OrderService],
|
|
1008
|
+
}]
|
|
1006
1009
|
}] });
|
|
1007
1010
|
|
|
1008
|
-
/**
|
|
1009
|
-
* Generated bundle index. Do not edit.
|
|
1011
|
+
/**
|
|
1012
|
+
* Generated bundle index. Do not edit.
|
|
1010
1013
|
*/
|
|
1011
1014
|
|
|
1012
1015
|
exports.AngularConnectModule = AngularConnectModule;
|