@infrab4a/connect-angular 1.0.0-beta.19 → 1.0.0-beta.2
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 +1144 -1558
- package/bundles/infrab4a-connect-angular.umd.js.map +1 -1
- package/esm2015/infrab4a-connect-angular.js +5 -5
- package/esm2015/lib/angular-connect.module.js +30 -0
- package/esm2015/lib/angular-firebase-auth.module.js +99 -0
- package/esm2015/lib/angular-firestore.module.js +337 -0
- package/esm2015/lib/consts/default-shop.const.js +2 -0
- package/esm2015/lib/consts/index.js +2 -0
- package/esm2015/lib/index.js +5 -0
- package/esm2015/lib/services/auth.service.js +42 -0
- package/esm2015/lib/services/cart.service.js +127 -0
- package/esm2015/lib/services/checkout-subscription.service.js +37 -0
- package/esm2015/lib/services/coupon.service.js +51 -0
- package/esm2015/lib/services/errors/index.js +2 -0
- package/esm2015/lib/services/errors/invalid-coupon.error.js +7 -0
- package/esm2015/lib/services/index.js +7 -0
- package/esm2015/lib/services/order.service.js +32 -0
- package/esm2015/lib/services/store-checkout.service.js +83 -0
- package/esm2015/lib/services/types/index.js +3 -0
- package/esm2015/lib/services/types/required-checkout-data.type.js +2 -0
- package/esm2015/lib/services/types/required-checkout-subscription-data.type.js +2 -0
- package/esm2015/public-api.js +2 -0
- package/fesm2015/infrab4a-connect-angular.js +765 -1123
- package/fesm2015/infrab4a-connect-angular.js.map +1 -1
- package/infrab4a-connect-angular.d.ts +5 -5
- package/{angular-connect.module.d.ts → lib/angular-connect.module.d.ts} +12 -18
- package/{angular-firebase-auth.module.d.ts → lib/angular-firebase-auth.module.d.ts} +10 -10
- package/{angular-firestore.module.d.ts → lib/angular-firestore.module.d.ts} +10 -15
- package/{consts → lib/consts}/default-shop.const.d.ts +1 -1
- package/lib/consts/index.d.ts +1 -0
- package/{index.d.ts → lib/index.d.ts} +4 -5
- package/{services → lib/services}/auth.service.d.ts +19 -19
- package/{services → lib/services}/cart.service.d.ts +28 -42
- package/{services → lib/services}/checkout-subscription.service.d.ts +13 -18
- package/{services → lib/services}/coupon.service.d.ts +13 -14
- package/lib/services/errors/index.d.ts +1 -0
- package/lib/services/errors/invalid-coupon.error.d.ts +4 -0
- package/{services → lib/services}/index.d.ts +6 -7
- package/{services → lib/services}/order.service.d.ts +13 -13
- package/{services/checkout.service.d.ts → lib/services/store-checkout.service.d.ts} +22 -22
- package/{services → lib/services}/types/index.d.ts +2 -2
- package/{services → lib/services}/types/required-checkout-data.type.d.ts +2 -2
- package/{services → lib/services}/types/required-checkout-subscription-data.type.d.ts +2 -2
- package/package.json +3 -3
- package/public-api.d.ts +1 -0
- package/angular-elastic-search.module.d.ts +0 -9
- package/angular-hasura-graphql.module.d.ts +0 -16
- package/consts/es-config.const.d.ts +0 -1
- package/consts/hasura-options.const.d.ts +0 -1
- package/consts/index.d.ts +0 -3
- package/esm2015/angular-connect.module.js +0 -49
- package/esm2015/angular-elastic-search.module.js +0 -38
- package/esm2015/angular-firebase-auth.module.js +0 -113
- package/esm2015/angular-firestore.module.js +0 -340
- package/esm2015/angular-hasura-graphql.module.js +0 -68
- package/esm2015/consts/default-shop.const.js +0 -2
- package/esm2015/consts/es-config.const.js +0 -2
- package/esm2015/consts/hasura-options.const.js +0 -2
- package/esm2015/consts/index.js +0 -4
- package/esm2015/index.js +0 -6
- package/esm2015/services/auth.service.js +0 -42
- package/esm2015/services/cart.service.js +0 -198
- package/esm2015/services/checkout-subscription.service.js +0 -70
- package/esm2015/services/checkout.service.js +0 -81
- package/esm2015/services/coupon.service.js +0 -70
- package/esm2015/services/errors/group-invalid-coupon.error.js +0 -8
- package/esm2015/services/errors/index.js +0 -3
- package/esm2015/services/errors/invalid-coupon.error.js +0 -8
- package/esm2015/services/home-shop.service.js +0 -108
- package/esm2015/services/index.js +0 -8
- package/esm2015/services/order.service.js +0 -32
- package/esm2015/services/types/index.js +0 -3
- package/esm2015/services/types/required-checkout-data.type.js +0 -2
- package/esm2015/services/types/required-checkout-subscription-data.type.js +0 -2
- package/services/errors/group-invalid-coupon.error.d.ts +0 -6
- package/services/errors/index.d.ts +0 -2
- package/services/errors/invalid-coupon.error.d.ts +0 -5
- package/services/home-shop.service.d.ts +0 -24
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@angular/fire/auth'), require('@infrab4a/connect'), require('js-cookie'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@infrab4a/connect-angular', ['exports', '@angular/core', 'rxjs', 'rxjs/operators', '@angular/fire/auth', '@infrab4a/connect', 'js-cookie', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.infrab4a = global.infrab4a || {}, global.infrab4a["connect-angular"] = {}), global.ng.core, global.rxjs, global.rxjs.operators, global.ng.fire.auth, global["@infrab4a/connect"], global["js-cookie"], global
|
|
5
|
-
})(this, (function (exports, i0, rxjs, operators, i1, i2, cookie,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('rxjs/operators'), require('@angular/fire/auth'), require('@infrab4a/connect'), require('js-cookie'), require('@angular/fire/firestore'), require('@angular/fire')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@infrab4a/connect-angular', ['exports', '@angular/core', 'rxjs', 'rxjs/operators', '@angular/fire/auth', '@infrab4a/connect', 'js-cookie', '@angular/fire/firestore', '@angular/fire'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.infrab4a = global.infrab4a || {}, global.infrab4a["connect-angular"] = {}), global.ng.core, global.rxjs, global.rxjs.operators, global.ng.fire.auth, global["@infrab4a/connect"], global["js-cookie"], global.ng.fire.firestore, global.ng.fire));
|
|
5
|
+
})(this, (function (exports, i0, rxjs, operators, i1, i2, cookie, i1$1, fire) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -30,1593 +30,1179 @@
|
|
|
30
30
|
var cookie__default = /*#__PURE__*/_interopDefaultLegacy(cookie);
|
|
31
31
|
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
|
32
32
|
|
|
33
|
-
/*! *****************************************************************************
|
|
34
|
-
Copyright (c) Microsoft Corporation.
|
|
35
|
-
|
|
36
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
37
|
-
purpose with or without fee is hereby granted.
|
|
38
|
-
|
|
39
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
40
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
41
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
42
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
43
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
44
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
45
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
46
|
-
***************************************************************************** */
|
|
47
|
-
/* global Reflect, Promise */
|
|
48
|
-
var extendStatics = function (d, b) {
|
|
49
|
-
extendStatics = Object.setPrototypeOf ||
|
|
50
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
51
|
-
function (d, b) { for (var p in b)
|
|
52
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
53
|
-
d[p] = b[p]; };
|
|
54
|
-
return extendStatics(d, b);
|
|
55
|
-
};
|
|
56
|
-
function __extends(d, b) {
|
|
57
|
-
if (typeof b !== "function" && b !== null)
|
|
58
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
59
|
-
extendStatics(d, b);
|
|
60
|
-
function __() { this.constructor = d; }
|
|
61
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
62
|
-
}
|
|
63
|
-
var __assign = function () {
|
|
64
|
-
__assign = Object.assign || function __assign(t) {
|
|
65
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
66
|
-
s = arguments[i];
|
|
67
|
-
for (var p in s)
|
|
68
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
69
|
-
t[p] = s[p];
|
|
70
|
-
}
|
|
71
|
-
return t;
|
|
72
|
-
};
|
|
73
|
-
return __assign.apply(this, arguments);
|
|
74
|
-
};
|
|
75
|
-
function __rest(s, e) {
|
|
76
|
-
var t = {};
|
|
77
|
-
for (var p in s)
|
|
78
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
79
|
-
t[p] = s[p];
|
|
80
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
81
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
82
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
83
|
-
t[p[i]] = s[p[i]];
|
|
84
|
-
}
|
|
85
|
-
return t;
|
|
86
|
-
}
|
|
87
|
-
function __decorate(decorators, target, key, desc) {
|
|
88
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
89
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
90
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
91
|
-
else
|
|
92
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
93
|
-
if (d = decorators[i])
|
|
94
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
95
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
96
|
-
}
|
|
97
|
-
function __param(paramIndex, decorator) {
|
|
98
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
99
|
-
}
|
|
100
|
-
function __metadata(metadataKey, metadataValue) {
|
|
101
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
102
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
103
|
-
}
|
|
104
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
105
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
106
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
107
|
-
function fulfilled(value) { try {
|
|
108
|
-
step(generator.next(value));
|
|
109
|
-
}
|
|
110
|
-
catch (e) {
|
|
111
|
-
reject(e);
|
|
112
|
-
} }
|
|
113
|
-
function rejected(value) { try {
|
|
114
|
-
step(generator["throw"](value));
|
|
115
|
-
}
|
|
116
|
-
catch (e) {
|
|
117
|
-
reject(e);
|
|
118
|
-
} }
|
|
119
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
120
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
function __generator(thisArg, body) {
|
|
124
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
125
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
126
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
127
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
128
|
-
function step(op) {
|
|
129
|
-
if (f)
|
|
130
|
-
throw new TypeError("Generator is already executing.");
|
|
131
|
-
while (_)
|
|
132
|
-
try {
|
|
133
|
-
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)
|
|
134
|
-
return t;
|
|
135
|
-
if (y = 0, t)
|
|
136
|
-
op = [op[0] & 2, t.value];
|
|
137
|
-
switch (op[0]) {
|
|
138
|
-
case 0:
|
|
139
|
-
case 1:
|
|
140
|
-
t = op;
|
|
141
|
-
break;
|
|
142
|
-
case 4:
|
|
143
|
-
_.label++;
|
|
144
|
-
return { value: op[1], done: false };
|
|
145
|
-
case 5:
|
|
146
|
-
_.label++;
|
|
147
|
-
y = op[1];
|
|
148
|
-
op = [0];
|
|
149
|
-
continue;
|
|
150
|
-
case 7:
|
|
151
|
-
op = _.ops.pop();
|
|
152
|
-
_.trys.pop();
|
|
153
|
-
continue;
|
|
154
|
-
default:
|
|
155
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
156
|
-
_ = 0;
|
|
157
|
-
continue;
|
|
158
|
-
}
|
|
159
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
160
|
-
_.label = op[1];
|
|
161
|
-
break;
|
|
162
|
-
}
|
|
163
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
164
|
-
_.label = t[1];
|
|
165
|
-
t = op;
|
|
166
|
-
break;
|
|
167
|
-
}
|
|
168
|
-
if (t && _.label < t[2]) {
|
|
169
|
-
_.label = t[2];
|
|
170
|
-
_.ops.push(op);
|
|
171
|
-
break;
|
|
172
|
-
}
|
|
173
|
-
if (t[2])
|
|
174
|
-
_.ops.pop();
|
|
175
|
-
_.trys.pop();
|
|
176
|
-
continue;
|
|
177
|
-
}
|
|
178
|
-
op = body.call(thisArg, _);
|
|
179
|
-
}
|
|
180
|
-
catch (e) {
|
|
181
|
-
op = [6, e];
|
|
182
|
-
y = 0;
|
|
183
|
-
}
|
|
184
|
-
finally {
|
|
185
|
-
f = t = 0;
|
|
186
|
-
}
|
|
187
|
-
if (op[0] & 5)
|
|
188
|
-
throw op[1];
|
|
189
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
193
|
-
if (k2 === undefined)
|
|
194
|
-
k2 = k;
|
|
195
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
196
|
-
}) : (function (o, m, k, k2) {
|
|
197
|
-
if (k2 === undefined)
|
|
198
|
-
k2 = k;
|
|
199
|
-
o[k2] = m[k];
|
|
200
|
-
});
|
|
201
|
-
function __exportStar(m, o) {
|
|
202
|
-
for (var p in m)
|
|
203
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
204
|
-
__createBinding(o, m, p);
|
|
205
|
-
}
|
|
206
|
-
function __values(o) {
|
|
207
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
208
|
-
if (m)
|
|
209
|
-
return m.call(o);
|
|
210
|
-
if (o && typeof o.length === "number")
|
|
211
|
-
return {
|
|
212
|
-
next: function () {
|
|
213
|
-
if (o && i >= o.length)
|
|
214
|
-
o = void 0;
|
|
215
|
-
return { value: o && o[i++], done: !o };
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
219
|
-
}
|
|
220
|
-
function __read(o, n) {
|
|
221
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
222
|
-
if (!m)
|
|
223
|
-
return o;
|
|
224
|
-
var i = m.call(o), r, ar = [], e;
|
|
225
|
-
try {
|
|
226
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
227
|
-
ar.push(r.value);
|
|
228
|
-
}
|
|
229
|
-
catch (error) {
|
|
230
|
-
e = { error: error };
|
|
231
|
-
}
|
|
232
|
-
finally {
|
|
233
|
-
try {
|
|
234
|
-
if (r && !r.done && (m = i["return"]))
|
|
235
|
-
m.call(i);
|
|
236
|
-
}
|
|
237
|
-
finally {
|
|
238
|
-
if (e)
|
|
239
|
-
throw e.error;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
return ar;
|
|
243
|
-
}
|
|
244
|
-
/** @deprecated */
|
|
245
|
-
function __spread() {
|
|
246
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
247
|
-
ar = ar.concat(__read(arguments[i]));
|
|
248
|
-
return ar;
|
|
249
|
-
}
|
|
250
|
-
/** @deprecated */
|
|
251
|
-
function __spreadArrays() {
|
|
252
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
253
|
-
s += arguments[i].length;
|
|
254
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
255
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
256
|
-
r[k] = a[j];
|
|
257
|
-
return r;
|
|
258
|
-
}
|
|
259
|
-
function __spreadArray(to, from, pack) {
|
|
260
|
-
if (pack || arguments.length === 2)
|
|
261
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
262
|
-
if (ar || !(i in from)) {
|
|
263
|
-
if (!ar)
|
|
264
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
265
|
-
ar[i] = from[i];
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
269
|
-
}
|
|
270
|
-
function __await(v) {
|
|
271
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
272
|
-
}
|
|
273
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
274
|
-
if (!Symbol.asyncIterator)
|
|
275
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
276
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
277
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
278
|
-
function verb(n) { if (g[n])
|
|
279
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
280
|
-
function resume(n, v) { try {
|
|
281
|
-
step(g[n](v));
|
|
282
|
-
}
|
|
283
|
-
catch (e) {
|
|
284
|
-
settle(q[0][3], e);
|
|
285
|
-
} }
|
|
286
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
287
|
-
function fulfill(value) { resume("next", value); }
|
|
288
|
-
function reject(value) { resume("throw", value); }
|
|
289
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
290
|
-
resume(q[0][0], q[0][1]); }
|
|
291
|
-
}
|
|
292
|
-
function __asyncDelegator(o) {
|
|
293
|
-
var i, p;
|
|
294
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
295
|
-
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; }
|
|
296
|
-
}
|
|
297
|
-
function __asyncValues(o) {
|
|
298
|
-
if (!Symbol.asyncIterator)
|
|
299
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
300
|
-
var m = o[Symbol.asyncIterator], i;
|
|
301
|
-
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);
|
|
302
|
-
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); }); }; }
|
|
303
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
304
|
-
}
|
|
305
|
-
function __makeTemplateObject(cooked, raw) {
|
|
306
|
-
if (Object.defineProperty) {
|
|
307
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
308
|
-
}
|
|
309
|
-
else {
|
|
310
|
-
cooked.raw = raw;
|
|
311
|
-
}
|
|
312
|
-
return cooked;
|
|
313
|
-
}
|
|
314
|
-
;
|
|
315
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
316
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
317
|
-
}) : function (o, v) {
|
|
318
|
-
o["default"] = v;
|
|
319
|
-
};
|
|
320
|
-
function __importStar(mod) {
|
|
321
|
-
if (mod && mod.__esModule)
|
|
322
|
-
return mod;
|
|
323
|
-
var result = {};
|
|
324
|
-
if (mod != null)
|
|
325
|
-
for (var k in mod)
|
|
326
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
327
|
-
__createBinding(result, mod, k);
|
|
328
|
-
__setModuleDefault(result, mod);
|
|
329
|
-
return result;
|
|
330
|
-
}
|
|
331
|
-
function __importDefault(mod) {
|
|
332
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
333
|
-
}
|
|
334
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
335
|
-
if (kind === "a" && !f)
|
|
336
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
337
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
338
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
339
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
340
|
-
}
|
|
341
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
342
|
-
if (kind === "m")
|
|
343
|
-
throw new TypeError("Private method is not writable");
|
|
344
|
-
if (kind === "a" && !f)
|
|
345
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
346
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
347
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
348
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
33
|
+
/*! *****************************************************************************
|
|
34
|
+
Copyright (c) Microsoft Corporation.
|
|
35
|
+
|
|
36
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
37
|
+
purpose with or without fee is hereby granted.
|
|
38
|
+
|
|
39
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
40
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
41
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
42
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
43
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
44
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
45
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
46
|
+
***************************************************************************** */
|
|
47
|
+
/* global Reflect, Promise */
|
|
48
|
+
var extendStatics = function (d, b) {
|
|
49
|
+
extendStatics = Object.setPrototypeOf ||
|
|
50
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
51
|
+
function (d, b) { for (var p in b)
|
|
52
|
+
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
53
|
+
d[p] = b[p]; };
|
|
54
|
+
return extendStatics(d, b);
|
|
55
|
+
};
|
|
56
|
+
function __extends(d, b) {
|
|
57
|
+
if (typeof b !== "function" && b !== null)
|
|
58
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
59
|
+
extendStatics(d, b);
|
|
60
|
+
function __() { this.constructor = d; }
|
|
61
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
62
|
+
}
|
|
63
|
+
var __assign = function () {
|
|
64
|
+
__assign = Object.assign || function __assign(t) {
|
|
65
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
66
|
+
s = arguments[i];
|
|
67
|
+
for (var p in s)
|
|
68
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
69
|
+
t[p] = s[p];
|
|
70
|
+
}
|
|
71
|
+
return t;
|
|
72
|
+
};
|
|
73
|
+
return __assign.apply(this, arguments);
|
|
74
|
+
};
|
|
75
|
+
function __rest(s, e) {
|
|
76
|
+
var t = {};
|
|
77
|
+
for (var p in s)
|
|
78
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
79
|
+
t[p] = s[p];
|
|
80
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
81
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
82
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
83
|
+
t[p[i]] = s[p[i]];
|
|
84
|
+
}
|
|
85
|
+
return t;
|
|
86
|
+
}
|
|
87
|
+
function __decorate(decorators, target, key, desc) {
|
|
88
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
89
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
90
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
91
|
+
else
|
|
92
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
93
|
+
if (d = decorators[i])
|
|
94
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
95
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
96
|
+
}
|
|
97
|
+
function __param(paramIndex, decorator) {
|
|
98
|
+
return function (target, key) { decorator(target, key, paramIndex); };
|
|
99
|
+
}
|
|
100
|
+
function __metadata(metadataKey, metadataValue) {
|
|
101
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
102
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
103
|
+
}
|
|
104
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
105
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
106
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
107
|
+
function fulfilled(value) { try {
|
|
108
|
+
step(generator.next(value));
|
|
109
|
+
}
|
|
110
|
+
catch (e) {
|
|
111
|
+
reject(e);
|
|
112
|
+
} }
|
|
113
|
+
function rejected(value) { try {
|
|
114
|
+
step(generator["throw"](value));
|
|
115
|
+
}
|
|
116
|
+
catch (e) {
|
|
117
|
+
reject(e);
|
|
118
|
+
} }
|
|
119
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
120
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
function __generator(thisArg, body) {
|
|
124
|
+
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
125
|
+
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
126
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
127
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
128
|
+
function step(op) {
|
|
129
|
+
if (f)
|
|
130
|
+
throw new TypeError("Generator is already executing.");
|
|
131
|
+
while (_)
|
|
132
|
+
try {
|
|
133
|
+
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)
|
|
134
|
+
return t;
|
|
135
|
+
if (y = 0, t)
|
|
136
|
+
op = [op[0] & 2, t.value];
|
|
137
|
+
switch (op[0]) {
|
|
138
|
+
case 0:
|
|
139
|
+
case 1:
|
|
140
|
+
t = op;
|
|
141
|
+
break;
|
|
142
|
+
case 4:
|
|
143
|
+
_.label++;
|
|
144
|
+
return { value: op[1], done: false };
|
|
145
|
+
case 5:
|
|
146
|
+
_.label++;
|
|
147
|
+
y = op[1];
|
|
148
|
+
op = [0];
|
|
149
|
+
continue;
|
|
150
|
+
case 7:
|
|
151
|
+
op = _.ops.pop();
|
|
152
|
+
_.trys.pop();
|
|
153
|
+
continue;
|
|
154
|
+
default:
|
|
155
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
156
|
+
_ = 0;
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
160
|
+
_.label = op[1];
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
164
|
+
_.label = t[1];
|
|
165
|
+
t = op;
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
if (t && _.label < t[2]) {
|
|
169
|
+
_.label = t[2];
|
|
170
|
+
_.ops.push(op);
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
if (t[2])
|
|
174
|
+
_.ops.pop();
|
|
175
|
+
_.trys.pop();
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
op = body.call(thisArg, _);
|
|
179
|
+
}
|
|
180
|
+
catch (e) {
|
|
181
|
+
op = [6, e];
|
|
182
|
+
y = 0;
|
|
183
|
+
}
|
|
184
|
+
finally {
|
|
185
|
+
f = t = 0;
|
|
186
|
+
}
|
|
187
|
+
if (op[0] & 5)
|
|
188
|
+
throw op[1];
|
|
189
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
193
|
+
if (k2 === undefined)
|
|
194
|
+
k2 = k;
|
|
195
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
196
|
+
}) : (function (o, m, k, k2) {
|
|
197
|
+
if (k2 === undefined)
|
|
198
|
+
k2 = k;
|
|
199
|
+
o[k2] = m[k];
|
|
200
|
+
});
|
|
201
|
+
function __exportStar(m, o) {
|
|
202
|
+
for (var p in m)
|
|
203
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
204
|
+
__createBinding(o, m, p);
|
|
205
|
+
}
|
|
206
|
+
function __values(o) {
|
|
207
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
208
|
+
if (m)
|
|
209
|
+
return m.call(o);
|
|
210
|
+
if (o && typeof o.length === "number")
|
|
211
|
+
return {
|
|
212
|
+
next: function () {
|
|
213
|
+
if (o && i >= o.length)
|
|
214
|
+
o = void 0;
|
|
215
|
+
return { value: o && o[i++], done: !o };
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
219
|
+
}
|
|
220
|
+
function __read(o, n) {
|
|
221
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
222
|
+
if (!m)
|
|
223
|
+
return o;
|
|
224
|
+
var i = m.call(o), r, ar = [], e;
|
|
225
|
+
try {
|
|
226
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
227
|
+
ar.push(r.value);
|
|
228
|
+
}
|
|
229
|
+
catch (error) {
|
|
230
|
+
e = { error: error };
|
|
231
|
+
}
|
|
232
|
+
finally {
|
|
233
|
+
try {
|
|
234
|
+
if (r && !r.done && (m = i["return"]))
|
|
235
|
+
m.call(i);
|
|
236
|
+
}
|
|
237
|
+
finally {
|
|
238
|
+
if (e)
|
|
239
|
+
throw e.error;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return ar;
|
|
243
|
+
}
|
|
244
|
+
/** @deprecated */
|
|
245
|
+
function __spread() {
|
|
246
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
247
|
+
ar = ar.concat(__read(arguments[i]));
|
|
248
|
+
return ar;
|
|
249
|
+
}
|
|
250
|
+
/** @deprecated */
|
|
251
|
+
function __spreadArrays() {
|
|
252
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
253
|
+
s += arguments[i].length;
|
|
254
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
255
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
256
|
+
r[k] = a[j];
|
|
257
|
+
return r;
|
|
258
|
+
}
|
|
259
|
+
function __spreadArray(to, from, pack) {
|
|
260
|
+
if (pack || arguments.length === 2)
|
|
261
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
262
|
+
if (ar || !(i in from)) {
|
|
263
|
+
if (!ar)
|
|
264
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
265
|
+
ar[i] = from[i];
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
269
|
+
}
|
|
270
|
+
function __await(v) {
|
|
271
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
272
|
+
}
|
|
273
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
274
|
+
if (!Symbol.asyncIterator)
|
|
275
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
276
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
277
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
278
|
+
function verb(n) { if (g[n])
|
|
279
|
+
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
280
|
+
function resume(n, v) { try {
|
|
281
|
+
step(g[n](v));
|
|
282
|
+
}
|
|
283
|
+
catch (e) {
|
|
284
|
+
settle(q[0][3], e);
|
|
285
|
+
} }
|
|
286
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
287
|
+
function fulfill(value) { resume("next", value); }
|
|
288
|
+
function reject(value) { resume("throw", value); }
|
|
289
|
+
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
290
|
+
resume(q[0][0], q[0][1]); }
|
|
291
|
+
}
|
|
292
|
+
function __asyncDelegator(o) {
|
|
293
|
+
var i, p;
|
|
294
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
295
|
+
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; }
|
|
296
|
+
}
|
|
297
|
+
function __asyncValues(o) {
|
|
298
|
+
if (!Symbol.asyncIterator)
|
|
299
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
300
|
+
var m = o[Symbol.asyncIterator], i;
|
|
301
|
+
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);
|
|
302
|
+
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); }); }; }
|
|
303
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
304
|
+
}
|
|
305
|
+
function __makeTemplateObject(cooked, raw) {
|
|
306
|
+
if (Object.defineProperty) {
|
|
307
|
+
Object.defineProperty(cooked, "raw", { value: raw });
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
cooked.raw = raw;
|
|
311
|
+
}
|
|
312
|
+
return cooked;
|
|
313
|
+
}
|
|
314
|
+
;
|
|
315
|
+
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
316
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
317
|
+
}) : function (o, v) {
|
|
318
|
+
o["default"] = v;
|
|
319
|
+
};
|
|
320
|
+
function __importStar(mod) {
|
|
321
|
+
if (mod && mod.__esModule)
|
|
322
|
+
return mod;
|
|
323
|
+
var result = {};
|
|
324
|
+
if (mod != null)
|
|
325
|
+
for (var k in mod)
|
|
326
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
327
|
+
__createBinding(result, mod, k);
|
|
328
|
+
__setModuleDefault(result, mod);
|
|
329
|
+
return result;
|
|
330
|
+
}
|
|
331
|
+
function __importDefault(mod) {
|
|
332
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
333
|
+
}
|
|
334
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
335
|
+
if (kind === "a" && !f)
|
|
336
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
337
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
338
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
339
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
340
|
+
}
|
|
341
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
342
|
+
if (kind === "m")
|
|
343
|
+
throw new TypeError("Private method is not writable");
|
|
344
|
+
if (kind === "a" && !f)
|
|
345
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
346
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
347
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
348
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
349
349
|
}
|
|
350
350
|
|
|
351
|
-
var AuthService = /** @class */ (function () {
|
|
352
|
-
function AuthService(angularFireAuth, userRepository) {
|
|
353
|
-
this.angularFireAuth = angularFireAuth;
|
|
354
|
-
this.userRepository = userRepository;
|
|
355
|
-
}
|
|
356
|
-
AuthService.prototype.getAuthstate = function () {
|
|
357
|
-
var observables = [
|
|
358
|
-
this.angularFireAuth.authState.pipe(operators.catchError(function () { return rxjs.of(null); })),
|
|
359
|
-
this.getUser().pipe(operators.catchError(function () { return rxjs.of(null); })),
|
|
360
|
-
];
|
|
361
|
-
return rxjs.combineLatest(observables).pipe(operators.map(function (_a) {
|
|
362
|
-
var _b = __read(_a, 2), fireUser = _b[0], user = _b[1];
|
|
363
|
-
return {
|
|
364
|
-
user: user,
|
|
365
|
-
isAnonymous: fireUser === null || fireUser === void 0 ? void 0 : fireUser.isAnonymous,
|
|
366
|
-
};
|
|
367
|
-
}));
|
|
368
|
-
};
|
|
369
|
-
AuthService.prototype.getUser = function () {
|
|
370
|
-
var _this = this;
|
|
371
|
-
return this.getFireUser().pipe(operators.map(function (user) { return user === null || user === void 0 ? void 0 : user.uid; }), operators.mergeMap(function (id) { return (id ? _this.userRepository.get({ id: id }) : rxjs.of(null)); }));
|
|
372
|
-
};
|
|
373
|
-
AuthService.prototype.getTokenId = function () {
|
|
374
|
-
return this.angularFireAuth.idToken;
|
|
375
|
-
};
|
|
376
|
-
AuthService.prototype.getFireUser = function () {
|
|
377
|
-
return this.angularFireAuth.user.pipe(operators.catchError(function () { return rxjs.of(null); }));
|
|
378
|
-
};
|
|
379
|
-
return AuthService;
|
|
380
|
-
}());
|
|
381
|
-
AuthService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AuthService, deps: [{ token: i1__namespace.AngularFireAuth }, { token: 'UserRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
382
|
-
AuthService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AuthService });
|
|
383
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AuthService, decorators: [{
|
|
384
|
-
type: i0.Injectable
|
|
385
|
-
}], ctorParameters: function () {
|
|
386
|
-
return [{ type: i1__namespace.AngularFireAuth }, { type: undefined, decorators: [{
|
|
387
|
-
type: i0.Inject,
|
|
388
|
-
args: ['UserRepository']
|
|
389
|
-
}] }];
|
|
351
|
+
var AuthService = /** @class */ (function () {
|
|
352
|
+
function AuthService(angularFireAuth, userRepository) {
|
|
353
|
+
this.angularFireAuth = angularFireAuth;
|
|
354
|
+
this.userRepository = userRepository;
|
|
355
|
+
}
|
|
356
|
+
AuthService.prototype.getAuthstate = function () {
|
|
357
|
+
var observables = [
|
|
358
|
+
this.angularFireAuth.authState.pipe(operators.catchError(function () { return rxjs.of(null); })),
|
|
359
|
+
this.getUser().pipe(operators.catchError(function () { return rxjs.of(null); })),
|
|
360
|
+
];
|
|
361
|
+
return rxjs.combineLatest(observables).pipe(operators.map(function (_a) {
|
|
362
|
+
var _b = __read(_a, 2), fireUser = _b[0], user = _b[1];
|
|
363
|
+
return {
|
|
364
|
+
user: user,
|
|
365
|
+
isAnonymous: fireUser === null || fireUser === void 0 ? void 0 : fireUser.isAnonymous,
|
|
366
|
+
};
|
|
367
|
+
}));
|
|
368
|
+
};
|
|
369
|
+
AuthService.prototype.getUser = function () {
|
|
370
|
+
var _this = this;
|
|
371
|
+
return this.getFireUser().pipe(operators.map(function (user) { return user === null || user === void 0 ? void 0 : user.uid; }), operators.mergeMap(function (id) { return (id ? _this.userRepository.get({ id: id }) : rxjs.of(null)); }));
|
|
372
|
+
};
|
|
373
|
+
AuthService.prototype.getTokenId = function () {
|
|
374
|
+
return this.angularFireAuth.idToken;
|
|
375
|
+
};
|
|
376
|
+
AuthService.prototype.getFireUser = function () {
|
|
377
|
+
return this.angularFireAuth.user.pipe(operators.catchError(function () { return rxjs.of(null); }));
|
|
378
|
+
};
|
|
379
|
+
return AuthService;
|
|
380
|
+
}());
|
|
381
|
+
AuthService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AuthService, deps: [{ token: i1__namespace.AngularFireAuth }, { token: 'UserRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
382
|
+
AuthService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AuthService });
|
|
383
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AuthService, decorators: [{
|
|
384
|
+
type: i0.Injectable
|
|
385
|
+
}], ctorParameters: function () {
|
|
386
|
+
return [{ type: i1__namespace.AngularFireAuth }, { type: undefined, decorators: [{
|
|
387
|
+
type: i0.Inject,
|
|
388
|
+
args: ['UserRepository']
|
|
389
|
+
}] }];
|
|
390
390
|
} });
|
|
391
391
|
|
|
392
392
|
var DEFAULT_SHOP = 'DEFAULT_SHOP';
|
|
393
393
|
|
|
394
|
-
var
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
return _this;
|
|
404
|
-
}
|
|
405
|
-
return InvalidCouponError;
|
|
406
|
-
}(tsCustomError.CustomError));
|
|
407
|
-
|
|
408
|
-
var GroupInvalidCouponError = /** @class */ (function (_super) {
|
|
409
|
-
__extends(GroupInvalidCouponError, _super);
|
|
410
|
-
function GroupInvalidCouponError(errors) {
|
|
411
|
-
var _this = _super.call(this, 'Many coupon errors throw') || this;
|
|
412
|
-
_this.errors = errors;
|
|
413
|
-
return _this;
|
|
414
|
-
}
|
|
415
|
-
return GroupInvalidCouponError;
|
|
416
|
-
}(tsCustomError.CustomError));
|
|
417
|
-
|
|
418
|
-
var CouponService = /** @class */ (function () {
|
|
419
|
-
function CouponService(couponRepository, defaultShop) {
|
|
420
|
-
var _this = this;
|
|
421
|
-
this.couponRepository = couponRepository;
|
|
422
|
-
this.defaultShop = defaultShop;
|
|
423
|
-
this.emailIsFromCollaborator = function (userEmail) { return !!(userEmail === null || userEmail === void 0 ? void 0 : userEmail.match(/@b4a.com.br/g)); };
|
|
424
|
-
this.separateValidCoupons = function (coupons, userEmail) { return coupons
|
|
425
|
-
.map(function (coupon) {
|
|
426
|
-
try {
|
|
427
|
-
if (!i2.FinancialCoupon.isFinancialCoupon(coupon))
|
|
428
|
-
throw new InvalidCouponError('Coupon is not valid');
|
|
429
|
-
if (_this.isValidCoupon(coupon, userEmail))
|
|
430
|
-
return coupon;
|
|
431
|
-
}
|
|
432
|
-
catch (error) {
|
|
433
|
-
return error;
|
|
434
|
-
}
|
|
435
|
-
})
|
|
436
|
-
.reduce(function (current, coupon) { return (Object.assign(Object.assign({}, current), (i2.FinancialCoupon.isFinancialCoupon(coupon)
|
|
437
|
-
? { valids: __spreadArray(__spreadArray([], __read(current.valids)), [coupon]) }
|
|
438
|
-
: { invalids: __spreadArray(__spreadArray([], __read(current.invalids)), [coupon]) }))); }, {
|
|
439
|
-
valids: [],
|
|
440
|
-
invalids: [],
|
|
441
|
-
}); };
|
|
442
|
-
}
|
|
443
|
-
CouponService.prototype.checkCoupon = function (nickname, userEmail, checkoutType) {
|
|
444
|
-
var _this = this;
|
|
445
|
-
return rxjs.from(this.couponRepository.find({
|
|
446
|
-
filters: {
|
|
447
|
-
nickname: { operator: i2.Where.EQUALS, value: nickname },
|
|
448
|
-
shopAvailability: { operator: i2.Where.EQUALS, value: this.defaultShop },
|
|
449
|
-
checkoutType: { operator: i2.Where.EQUALS, value: checkoutType },
|
|
450
|
-
},
|
|
451
|
-
})).pipe(operators.concatMap(function (coupons) { return coupons.count < 1 ? rxjs.throwError(function () { return new i2.NotFoundError('Coupon not found'); }) : rxjs.of(coupons.data); }), operators.map(function (coupons) { return _this.separateValidCoupons(coupons, userEmail); }), operators.map(function (_a) {
|
|
452
|
-
var valids = _a.valids, invalids = _a.invalids;
|
|
453
|
-
if (!valids.length)
|
|
454
|
-
throw new GroupInvalidCouponError(invalids);
|
|
455
|
-
return valids;
|
|
456
|
-
}));
|
|
457
|
-
};
|
|
458
|
-
CouponService.prototype.isValidCoupon = function (coupon, userEmail) {
|
|
459
|
-
if (!this.emailIsFromCollaborator(userEmail) && coupon.exclusivityType === i2.Exclusivities.COLLABORATORS)
|
|
460
|
-
throw new InvalidCouponError('User is not a collaborator');
|
|
461
|
-
if (coupon.exclusivityType === i2.Exclusivities.SPECIFIC_USER && coupon.recipient !== userEmail)
|
|
462
|
-
throw new InvalidCouponError('Coupon is not valid for user');
|
|
463
|
-
if ((coupon === null || coupon === void 0 ? void 0 : coupon.expiresIn) < new Date())
|
|
464
|
-
throw new InvalidCouponError('Coupon is expired');
|
|
465
|
-
return true;
|
|
466
|
-
};
|
|
467
|
-
return CouponService;
|
|
468
|
-
}());
|
|
469
|
-
CouponService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CouponService, deps: [{ token: 'CouponRepository' }, { token: DEFAULT_SHOP }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
470
|
-
CouponService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CouponService, providedIn: 'root' });
|
|
471
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CouponService, decorators: [{
|
|
472
|
-
type: i0.Injectable,
|
|
473
|
-
args: [{
|
|
474
|
-
providedIn: 'root',
|
|
475
|
-
}]
|
|
476
|
-
}], ctorParameters: function () {
|
|
477
|
-
return [{ type: undefined, decorators: [{
|
|
478
|
-
type: i0.Inject,
|
|
479
|
-
args: ['CouponRepository']
|
|
480
|
-
}] }, { type: i2__namespace.Shops, decorators: [{
|
|
481
|
-
type: i0.Inject,
|
|
482
|
-
args: [DEFAULT_SHOP]
|
|
483
|
-
}] }];
|
|
484
|
-
} });
|
|
394
|
+
var InvalidCouponError = /** @class */ (function (_super) {
|
|
395
|
+
__extends(InvalidCouponError, _super);
|
|
396
|
+
function InvalidCouponError(message) {
|
|
397
|
+
var _this = _super.call(this, message) || this;
|
|
398
|
+
_this.message = message;
|
|
399
|
+
return _this;
|
|
400
|
+
}
|
|
401
|
+
return InvalidCouponError;
|
|
402
|
+
}(Error));
|
|
485
403
|
|
|
486
|
-
var
|
|
487
|
-
function
|
|
488
|
-
this.
|
|
489
|
-
this.
|
|
490
|
-
this.
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
return
|
|
513
|
-
};
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
};
|
|
532
|
-
CheckoutService.prototype.createCheckout = function (checkoutData) {
|
|
533
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
534
|
-
var checkout;
|
|
535
|
-
return __generator(this, function (_c) {
|
|
536
|
-
switch (_c.label) {
|
|
537
|
-
case 0: return [4 /*yield*/, this.checkoutRepository.create(Object.assign(Object.assign({ createdAt: new Date() }, i2.Checkout.toInstance(i2.pick(checkoutData, ['user', 'shop'])).toPlain()), { shop: (checkoutData === null || checkoutData === void 0 ? void 0 : checkoutData.shop) || this.defaultShop }))];
|
|
538
|
-
case 1:
|
|
539
|
-
checkout = _c.sent();
|
|
540
|
-
cookie__default["default"].set('checkoutId', checkout.id);
|
|
541
|
-
return [2 /*return*/, checkout];
|
|
542
|
-
}
|
|
543
|
-
});
|
|
544
|
-
});
|
|
545
|
-
};
|
|
546
|
-
return CheckoutService;
|
|
547
|
-
}());
|
|
548
|
-
CheckoutService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CheckoutService, deps: [{ token: CouponService }, { token: 'CheckoutRepository' }, { token: 'OrderRepository' }, { token: 'UserRepository' }, { token: DEFAULT_SHOP }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
549
|
-
CheckoutService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CheckoutService });
|
|
550
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CheckoutService, decorators: [{
|
|
551
|
-
type: i0.Injectable
|
|
552
|
-
}], ctorParameters: function () {
|
|
553
|
-
return [{ type: CouponService }, { type: undefined, decorators: [{
|
|
554
|
-
type: i0.Inject,
|
|
555
|
-
args: ['CheckoutRepository']
|
|
556
|
-
}] }, { type: undefined, decorators: [{
|
|
557
|
-
type: i0.Inject,
|
|
558
|
-
args: ['OrderRepository']
|
|
559
|
-
}] }, { type: undefined, decorators: [{
|
|
560
|
-
type: i0.Inject,
|
|
561
|
-
args: ['UserRepository']
|
|
562
|
-
}] }, { type: i2__namespace.Shops, decorators: [{
|
|
563
|
-
type: i0.Inject,
|
|
564
|
-
args: [DEFAULT_SHOP]
|
|
565
|
-
}] }];
|
|
404
|
+
var CouponService = /** @class */ (function () {
|
|
405
|
+
function CouponService(couponRepository, defaultShop) {
|
|
406
|
+
this.couponRepository = couponRepository;
|
|
407
|
+
this.defaultShop = defaultShop;
|
|
408
|
+
this.emailIsFromCollaborator = function (userEmail) { return !!(userEmail === null || userEmail === void 0 ? void 0 : userEmail.match(/@b4a.com.br/g)); };
|
|
409
|
+
}
|
|
410
|
+
CouponService.prototype.checkCoupon = function (nickname, userEmail) {
|
|
411
|
+
var _this = this;
|
|
412
|
+
return rxjs.from(this.couponRepository.find([
|
|
413
|
+
{
|
|
414
|
+
nickname: { operator: i2.Where.EQUALS, value: nickname },
|
|
415
|
+
shopAvailability: { operator: i2.Where.EQUALS, value: this.defaultShop },
|
|
416
|
+
},
|
|
417
|
+
])).pipe(operators.concatMap(function (coupons) { return coupons.count < 1 ? rxjs.throwError(function () { return new i2.NotFoundError('Coupon not found'); }) : rxjs.of(coupons.data[0]); }), operators.concatMap(function (coupon) { return _this.isValidCoupon(coupon, userEmail)
|
|
418
|
+
? rxjs.of(coupon)
|
|
419
|
+
: rxjs.throwError(function () { return new InvalidCouponError('Coupon is not valid'); }); }));
|
|
420
|
+
};
|
|
421
|
+
CouponService.prototype.isValidCoupon = function (coupon, userEmail) {
|
|
422
|
+
if (!this.emailIsFromCollaborator(userEmail) && coupon.exclusivityType === i2.Exclusivities.COLLABORATORS)
|
|
423
|
+
throw new InvalidCouponError('User is not a collaborator');
|
|
424
|
+
if (coupon.exclusivityType === i2.Exclusivities.SPECIFIC_USER && coupon.recipient !== userEmail)
|
|
425
|
+
throw new InvalidCouponError('Coupon is not valid for user');
|
|
426
|
+
if ((coupon === null || coupon === void 0 ? void 0 : coupon.beginAt) > new Date())
|
|
427
|
+
throw new InvalidCouponError('Coupon is not active');
|
|
428
|
+
if ((coupon === null || coupon === void 0 ? void 0 : coupon.expiresAt) < new Date())
|
|
429
|
+
throw new InvalidCouponError('Coupon is expired');
|
|
430
|
+
return true;
|
|
431
|
+
};
|
|
432
|
+
return CouponService;
|
|
433
|
+
}());
|
|
434
|
+
CouponService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CouponService, deps: [{ token: 'CouponRepository' }, { token: DEFAULT_SHOP }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
435
|
+
CouponService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CouponService, providedIn: 'root' });
|
|
436
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CouponService, decorators: [{
|
|
437
|
+
type: i0.Injectable,
|
|
438
|
+
args: [{
|
|
439
|
+
providedIn: 'root',
|
|
440
|
+
}]
|
|
441
|
+
}], ctorParameters: function () {
|
|
442
|
+
return [{ type: undefined, decorators: [{
|
|
443
|
+
type: i0.Inject,
|
|
444
|
+
args: ['CouponRepository']
|
|
445
|
+
}] }, { type: i2__namespace.Shops, decorators: [{
|
|
446
|
+
type: i0.Inject,
|
|
447
|
+
args: [DEFAULT_SHOP]
|
|
448
|
+
}] }];
|
|
566
449
|
} });
|
|
567
450
|
|
|
568
|
-
var
|
|
569
|
-
function
|
|
570
|
-
|
|
571
|
-
this.
|
|
572
|
-
this.
|
|
573
|
-
this.
|
|
574
|
-
this.
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
return
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
});
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
}));
|
|
651
|
-
return [2 /*return*/, i2.LineItem.toInstance({
|
|
652
|
-
id: id,
|
|
653
|
-
name: name,
|
|
654
|
-
EAN: EAN,
|
|
655
|
-
brand: product.brand,
|
|
656
|
-
slug: slug,
|
|
657
|
-
sku: sku,
|
|
658
|
-
stock: stock,
|
|
659
|
-
price: price,
|
|
660
|
-
image: image,
|
|
661
|
-
weight: weight,
|
|
662
|
-
quantity: (item.quantity || 0) + (quantity || 0),
|
|
663
|
-
pricePaid: pricePaid,
|
|
664
|
-
categories: (_g = product.categories) !== null && _g !== void 0 ? _g : [],
|
|
665
|
-
isGift: isGift,
|
|
666
|
-
costPrice: item === null || item === void 0 ? void 0 : item.costPrice,
|
|
667
|
-
})];
|
|
668
|
-
}
|
|
669
|
-
});
|
|
670
|
-
});
|
|
671
|
-
};
|
|
672
|
-
this.getProductPrice = function (_h) {
|
|
673
|
-
var product = _h.product, shop = _h.shop, isSubscriber = _h.isSubscriber;
|
|
674
|
-
var info = product.getInfoByShop(shop);
|
|
675
|
-
if (product.isGift)
|
|
676
|
-
return 0;
|
|
677
|
-
return isSubscriber && info.subscriberPrice > 0 ? info.subscriberPrice : info.price;
|
|
678
|
-
};
|
|
679
|
-
this.checkMaxStock = function (item, quantity) {
|
|
680
|
-
var _a;
|
|
681
|
-
var maxStock = ((_a = item.stock) === null || _a === void 0 ? void 0 : _a.quantity) || 0;
|
|
682
|
-
var currentItemAmount = item.quantity || 0;
|
|
683
|
-
return currentItemAmount + quantity > maxStock;
|
|
684
|
-
};
|
|
685
|
-
}
|
|
686
|
-
CartService.prototype.addItem = function (item, quantity) {
|
|
687
|
-
var _this = this;
|
|
688
|
-
if (quantity === void 0) { quantity = 1; }
|
|
689
|
-
return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) { return ({
|
|
690
|
-
checkout: checkout,
|
|
691
|
-
lineItem: _this.buildLineItem({ checkout: checkout, item: item, quantity: quantity || 1 }),
|
|
692
|
-
}); }), operators.concatMap(function (_h) {
|
|
693
|
-
var checkout = _h.checkout, lineItem = _h.lineItem;
|
|
694
|
-
return _this.updateLineItemInCart(lineItem, quantity || 1, checkout);
|
|
695
|
-
}), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
|
|
696
|
-
};
|
|
697
|
-
CartService.prototype.decreaseItem = function (item) {
|
|
698
|
-
var _this = this;
|
|
699
|
-
return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) {
|
|
700
|
-
var _a;
|
|
701
|
-
var checkoutItem = (_a = checkout.lineItems) === null || _a === void 0 ? void 0 : _a.find(function (lineItem) { return lineItem.sku === item.sku; });
|
|
702
|
-
if (!i2.isNil(checkoutItem))
|
|
703
|
-
checkoutItem.quantity -= checkoutItem.quantity > 1 ? 1 : 0;
|
|
704
|
-
return checkout;
|
|
705
|
-
}), 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); }));
|
|
706
|
-
};
|
|
707
|
-
CartService.prototype.getCart = function (checkout) {
|
|
708
|
-
var _this = this;
|
|
709
|
-
this.buildCartFromCheckout(checkout).subscribe(function (cart) { return _this.cartSubject.next(cart); });
|
|
710
|
-
return this.cartSubject;
|
|
711
|
-
};
|
|
712
|
-
/**
|
|
713
|
-
* @deprecated The method should not be used
|
|
714
|
-
*/
|
|
715
|
-
CartService.prototype.getDiscount = function (coupon) {
|
|
716
|
-
switch (coupon.type) {
|
|
717
|
-
case i2.CouponTypes.FINANCIAL:
|
|
718
|
-
return this.getFinancialDiscount(coupon);
|
|
719
|
-
case i2.CouponTypes.PRODUCT:
|
|
720
|
-
return function (subTotalPrice) { return subTotalPrice; };
|
|
721
|
-
case i2.CouponTypes.GIFTCARD:
|
|
722
|
-
return this.getFinancialDiscount(coupon);
|
|
723
|
-
case i2.CouponTypes.VOUCHER:
|
|
724
|
-
return function (subTotalPrice) { return subTotalPrice; };
|
|
725
|
-
}
|
|
726
|
-
};
|
|
727
|
-
/**
|
|
728
|
-
* @deprecated The method should not be used
|
|
729
|
-
*/
|
|
730
|
-
CartService.prototype.getVariantPriceDiscount = function (item, shop) {
|
|
731
|
-
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); }));
|
|
732
|
-
};
|
|
733
|
-
CartService.prototype.removeItem = function (item) {
|
|
734
|
-
var _this = this;
|
|
735
|
-
return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) {
|
|
736
|
-
var index = checkout.lineItems.findIndex(function (lineItem) { return lineItem.sku === item.sku; });
|
|
737
|
-
if (index >= 0)
|
|
738
|
-
checkout.lineItems.splice(index, 1);
|
|
739
|
-
return checkout;
|
|
740
|
-
}), 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); }));
|
|
741
|
-
};
|
|
742
|
-
CartService.prototype.updateUserCart = function (user) {
|
|
743
|
-
var _this = this;
|
|
744
|
-
return this.checkoutService.getCheckout().pipe(operators.concatMap(function (checkout) { return _this.checkoutService.updateCheckoutUser(i2.Checkout.toInstance(Object.assign(Object.assign({}, checkout.toPlain()), { user: user }))); }), operators.concatMap(function (checkout) {
|
|
745
|
-
var _a;
|
|
746
|
-
return _this.checkoutService.updateCheckoutLineItems(i2.Checkout.toInstance(Object.assign(Object.assign({}, checkout.toPlain()), { lineItems: ((_a = checkout.lineItems) === null || _a === void 0 ? void 0 : _a.map(function (item) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_h) {
|
|
747
|
-
switch (_h.label) {
|
|
748
|
-
case 0: return [4 /*yield*/, this.buildLineItem({ checkout: checkout, item: item })];
|
|
749
|
-
case 1: return [2 /*return*/, _h.sent()];
|
|
750
|
-
}
|
|
751
|
-
}); }); })) || [] })));
|
|
752
|
-
}), operators.map(function (checkout) { return _this.generateCartObject(checkout.lineItems); }), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
|
|
753
|
-
};
|
|
754
|
-
CartService.prototype.clearCart = function () {
|
|
755
|
-
var _this = this;
|
|
756
|
-
return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) {
|
|
757
|
-
_this.checkoutService.clearCheckoutFromSession();
|
|
758
|
-
return checkout;
|
|
759
|
-
}), operators.concatMap(function (oldCheckout) { return _this.buildCartFromCheckout(oldCheckout); }), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
|
|
760
|
-
};
|
|
761
|
-
CartService.prototype.buildCartFromCheckout = function (checkoutData) {
|
|
762
|
-
var _this = this;
|
|
763
|
-
return this.checkoutService.getCheckout(checkoutData).pipe(operators.map(function (checkout) { return checkout.lineItems; }), operators.concatMap(function (lineItems) { return rxjs.of(_this.generateCartObject(lineItems)); }));
|
|
764
|
-
};
|
|
765
|
-
CartService.prototype.getFinancialDiscount = function (coupon) {
|
|
766
|
-
return function (subTotalPrice) {
|
|
767
|
-
if (i2.FinancialCoupon.isFinancialCoupon(coupon))
|
|
768
|
-
switch (coupon.subtype) {
|
|
769
|
-
case i2.CouponSubtypes.ABSOLUTE:
|
|
770
|
-
return subTotalPrice - coupon.discount * 100;
|
|
771
|
-
case i2.CouponSubtypes.PERCENTAGE:
|
|
772
|
-
return subTotalPrice * (1 - coupon.discount / 100);
|
|
773
|
-
}
|
|
774
|
-
};
|
|
775
|
-
};
|
|
776
|
-
return CartService;
|
|
777
|
-
}());
|
|
778
|
-
CartService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CartService, deps: [{ token: AuthService }, { token: CheckoutService }, { token: DEFAULT_SHOP }, { token: 'ProductRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
779
|
-
CartService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CartService });
|
|
780
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CartService, decorators: [{
|
|
781
|
-
type: i0.Injectable
|
|
782
|
-
}], ctorParameters: function () {
|
|
783
|
-
return [{ type: AuthService }, { type: CheckoutService }, { type: i2__namespace.Shops, decorators: [{
|
|
784
|
-
type: i0.Inject,
|
|
785
|
-
args: [DEFAULT_SHOP]
|
|
786
|
-
}] }, { type: undefined, decorators: [{
|
|
787
|
-
type: i0.Inject,
|
|
788
|
-
args: ['ProductRepository']
|
|
789
|
-
}] }];
|
|
451
|
+
var StoreCheckoutService = /** @class */ (function () {
|
|
452
|
+
function StoreCheckoutService(couponService, checkoutRepository, orderRepository, userRepository, defaultShop) {
|
|
453
|
+
this.couponService = couponService;
|
|
454
|
+
this.checkoutRepository = checkoutRepository;
|
|
455
|
+
this.orderRepository = orderRepository;
|
|
456
|
+
this.userRepository = userRepository;
|
|
457
|
+
this.defaultShop = defaultShop;
|
|
458
|
+
}
|
|
459
|
+
StoreCheckoutService.prototype.getCheckout = function (checkoutData) {
|
|
460
|
+
var checkoutId = cookie__default["default"].get('checkoutId');
|
|
461
|
+
if (!i2.isNil(checkoutId))
|
|
462
|
+
return rxjs.from(this.checkoutRepository.get({ id: checkoutId }));
|
|
463
|
+
return rxjs.from(this.createCheckout(checkoutData));
|
|
464
|
+
};
|
|
465
|
+
StoreCheckoutService.prototype.getUserByCheckout = function (checkoutId) {
|
|
466
|
+
var _this = this;
|
|
467
|
+
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 i2.NotFoundError('User is not found'); }); }));
|
|
468
|
+
};
|
|
469
|
+
StoreCheckoutService.prototype.updateCheckoutLineItems = function (checkout) {
|
|
470
|
+
return rxjs.from(this.checkoutRepository.update(i2.Checkout.toInstance({ id: checkout.id, lineItems: checkout.lineItems })));
|
|
471
|
+
};
|
|
472
|
+
StoreCheckoutService.prototype.updateCheckoutUser = function (checkout) {
|
|
473
|
+
return rxjs.from(this.checkoutRepository.update(i2.Checkout.toInstance({ id: checkout.id, user: checkout.user })));
|
|
474
|
+
};
|
|
475
|
+
StoreCheckoutService.prototype.clearCheckoutFromSession = function () {
|
|
476
|
+
cookie__default["default"].remove('checkoutId');
|
|
477
|
+
return rxjs.of();
|
|
478
|
+
};
|
|
479
|
+
StoreCheckoutService.prototype.checkCoupon = function (nickname) {
|
|
480
|
+
var _this = this;
|
|
481
|
+
return this.getCheckout().pipe(operators.concatMap(function (checkout) {
|
|
482
|
+
var _a;
|
|
483
|
+
return _this.couponService.checkCoupon(nickname, (_a = checkout.user) === null || _a === void 0 ? void 0 : _a.email).pipe(operators.concatMap(function (coupon) { return i2.StoreCoupon.isStoreCoupon(coupon) ? rxjs.of(coupon) : rxjs.throwError(function () { return new Error('Coupon is invalid'); }); }), operators.concatMap(function (coupon) {
|
|
484
|
+
var _a, _b;
|
|
485
|
+
return !!((_a = checkout.user) === null || _a === void 0 ? void 0 : _a.email)
|
|
486
|
+
? rxjs.from(_this.orderRepository.find([{ user: { email: (_b = checkout.user) === null || _b === void 0 ? void 0 : _b.email }, coupon: { id: coupon.id } }])).pipe(operators.concatMap(function (orders) {
|
|
487
|
+
if (orders.data.length >= (coupon.quantityPerUser || Infinity))
|
|
488
|
+
return rxjs.throwError(function () { return new Error('Coupon is already applied'); });
|
|
489
|
+
return rxjs.of(coupon);
|
|
490
|
+
}))
|
|
491
|
+
: rxjs.of(coupon);
|
|
492
|
+
}), operators.concatMap(function (coupon) { return rxjs.from(_this.orderRepository.find([{ coupon: { id: coupon.id } }])).pipe(operators.concatMap(function (orders) {
|
|
493
|
+
if (orders.data.length >= (coupon.useLimit || Infinity))
|
|
494
|
+
return rxjs.throwError(function () { return new Error('Coupon is invalid'); });
|
|
495
|
+
return rxjs.of(coupon);
|
|
496
|
+
})); }));
|
|
497
|
+
}));
|
|
498
|
+
};
|
|
499
|
+
StoreCheckoutService.prototype.createCheckout = function (checkoutData) {
|
|
500
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
501
|
+
var checkout;
|
|
502
|
+
return __generator(this, function (_c) {
|
|
503
|
+
switch (_c.label) {
|
|
504
|
+
case 0: return [4 /*yield*/, this.checkoutRepository.create(Object.assign(Object.assign({ createdAt: new Date() }, i2.Checkout.toInstance(i2.pick(checkoutData, ['user', 'shop'])).toPlain()), { shop: (checkoutData === null || checkoutData === void 0 ? void 0 : checkoutData.shop) || this.defaultShop }))];
|
|
505
|
+
case 1:
|
|
506
|
+
checkout = _c.sent();
|
|
507
|
+
cookie__default["default"].set('checkoutId', checkout.id);
|
|
508
|
+
return [2 /*return*/, checkout];
|
|
509
|
+
}
|
|
510
|
+
});
|
|
511
|
+
});
|
|
512
|
+
};
|
|
513
|
+
return StoreCheckoutService;
|
|
514
|
+
}());
|
|
515
|
+
StoreCheckoutService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: StoreCheckoutService, deps: [{ token: CouponService }, { token: 'CheckoutRepository' }, { token: 'OrderRepository' }, { token: 'UserRepository' }, { token: DEFAULT_SHOP }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
516
|
+
StoreCheckoutService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: StoreCheckoutService });
|
|
517
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: StoreCheckoutService, decorators: [{
|
|
518
|
+
type: i0.Injectable
|
|
519
|
+
}], ctorParameters: function () {
|
|
520
|
+
return [{ type: CouponService }, { type: undefined, decorators: [{
|
|
521
|
+
type: i0.Inject,
|
|
522
|
+
args: ['CheckoutRepository']
|
|
523
|
+
}] }, { type: undefined, decorators: [{
|
|
524
|
+
type: i0.Inject,
|
|
525
|
+
args: ['OrderRepository']
|
|
526
|
+
}] }, { type: undefined, decorators: [{
|
|
527
|
+
type: i0.Inject,
|
|
528
|
+
args: ['UserRepository']
|
|
529
|
+
}] }, { type: i2__namespace.Shops, decorators: [{
|
|
530
|
+
type: i0.Inject,
|
|
531
|
+
args: [DEFAULT_SHOP]
|
|
532
|
+
}] }];
|
|
790
533
|
} });
|
|
791
534
|
|
|
792
|
-
var
|
|
793
|
-
function
|
|
794
|
-
var _this = this;
|
|
795
|
-
this.
|
|
796
|
-
this.
|
|
797
|
-
this.
|
|
798
|
-
this.
|
|
799
|
-
var _a;
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
}); }
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
});
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
535
|
+
var CartService = /** @class */ (function () {
|
|
536
|
+
function CartService(checkoutService, defaultShop) {
|
|
537
|
+
var _this = this;
|
|
538
|
+
this.checkoutService = checkoutService;
|
|
539
|
+
this.defaultShop = defaultShop;
|
|
540
|
+
this.cartSubject = new rxjs.Subject();
|
|
541
|
+
this.updateLineItemInCart = function (lineItem, quantity, checkout) { return (i2.isNil(checkout) ? _this.checkoutService.getCheckout() : rxjs.of(checkout)).pipe(operators.concatMap(function (checkoutLoaded) {
|
|
542
|
+
var _a;
|
|
543
|
+
var items = [];
|
|
544
|
+
var index = (_a = checkoutLoaded.lineItems) === null || _a === void 0 ? void 0 : _a.map(function (checkoutItem) { return checkoutItem.sku; }).indexOf(lineItem.sku);
|
|
545
|
+
if (index > -1) {
|
|
546
|
+
checkoutLoaded.lineItems[index].quantity += quantity;
|
|
547
|
+
checkoutLoaded.lineItems[index].pricePaid = lineItem.pricePaid;
|
|
548
|
+
}
|
|
549
|
+
else
|
|
550
|
+
checkoutLoaded.lineItems = items.concat(checkoutLoaded.lineItems ? checkoutLoaded.lineItems.concat([lineItem]) : [lineItem]);
|
|
551
|
+
return _this.checkoutService
|
|
552
|
+
.updateCheckoutLineItems(checkoutLoaded)
|
|
553
|
+
.pipe(operators.map(function (updatedCheckout) { return _this.generateCartObject(updatedCheckout.lineItems); }));
|
|
554
|
+
})); };
|
|
555
|
+
this.generateCartObject = function (items) {
|
|
556
|
+
var cart = {};
|
|
557
|
+
items === null || items === void 0 ? void 0 : items.forEach(function (item) {
|
|
558
|
+
var _a;
|
|
559
|
+
return (cart[item.sku] = i2.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) })));
|
|
560
|
+
});
|
|
561
|
+
return cart;
|
|
562
|
+
};
|
|
563
|
+
this.buildLineItem = function (_f) {
|
|
564
|
+
var checkout = _f.checkout, item = _f.item, quantity = _f.quantity;
|
|
565
|
+
var _a, _b, _c, _d, _e;
|
|
566
|
+
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;
|
|
567
|
+
if (_this.checkMaxStock(item, quantity || 0))
|
|
568
|
+
throw new Error('Desculpe! Temos apenas ' + ((_c = item.stock) === null || _c === void 0 ? void 0 : _c.quantity) + ' em estoque.');
|
|
569
|
+
var image = item.image || ((_d = item.images) === null || _d === void 0 ? void 0 : _d.shift());
|
|
570
|
+
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;
|
|
571
|
+
var isGift = item.isGift || null;
|
|
572
|
+
var pricePaid = _this.getProductPrice({
|
|
573
|
+
product: item,
|
|
574
|
+
shop: checkout.shop || _this.defaultShop,
|
|
575
|
+
isSubscriber: (_e = checkout.user) === null || _e === void 0 ? void 0 : _e.isSubscriber,
|
|
576
|
+
});
|
|
577
|
+
return i2.LineItem.toInstance({
|
|
578
|
+
id: id,
|
|
579
|
+
name: name,
|
|
580
|
+
brand: brand,
|
|
581
|
+
slug: slug,
|
|
582
|
+
sku: sku,
|
|
583
|
+
stock: stock,
|
|
584
|
+
price: price,
|
|
585
|
+
image: image,
|
|
586
|
+
weight: weight,
|
|
587
|
+
quantity: (item.quantity || 0) + (quantity || 0),
|
|
588
|
+
pricePaid: pricePaid,
|
|
589
|
+
categories: categories,
|
|
590
|
+
isGift: isGift,
|
|
591
|
+
});
|
|
592
|
+
};
|
|
593
|
+
this.getProductPrice = function (_f) {
|
|
594
|
+
var product = _f.product, shop = _f.shop, isSubscriber = _f.isSubscriber;
|
|
595
|
+
var info = product.getInfoByShop(shop);
|
|
596
|
+
if (product.isGift)
|
|
597
|
+
return 0;
|
|
598
|
+
return isSubscriber && info.subscriberPrice > 0 ? info.subscriberPrice : info.price;
|
|
599
|
+
};
|
|
600
|
+
this.checkMaxStock = function (item, quantity) {
|
|
601
|
+
var _a;
|
|
602
|
+
var maxStock = ((_a = item.stock) === null || _a === void 0 ? void 0 : _a.quantity) || 0;
|
|
603
|
+
var currentItemAmount = item.quantity || 0;
|
|
604
|
+
return currentItemAmount + quantity > maxStock;
|
|
605
|
+
};
|
|
606
|
+
}
|
|
607
|
+
CartService.prototype.addItem = function (item, quantity) {
|
|
608
|
+
var _this = this;
|
|
609
|
+
if (quantity === void 0) { quantity = 1; }
|
|
610
|
+
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) {
|
|
611
|
+
var checkout = _f.checkout, lineItem = _f.lineItem;
|
|
612
|
+
return _this.updateLineItemInCart(lineItem, quantity || 1, checkout);
|
|
613
|
+
}), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
|
|
614
|
+
};
|
|
615
|
+
CartService.prototype.decreaseItem = function (item) {
|
|
616
|
+
var _this = this;
|
|
617
|
+
return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) {
|
|
618
|
+
var _a;
|
|
619
|
+
var checkoutItem = (_a = checkout.lineItems) === null || _a === void 0 ? void 0 : _a.find(function (lineItem) { return lineItem.sku === item.sku; });
|
|
620
|
+
if (!i2.isNil(checkoutItem))
|
|
621
|
+
checkoutItem.quantity -= checkoutItem.quantity > 1 ? 1 : 0;
|
|
622
|
+
return checkout;
|
|
623
|
+
}), 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); }));
|
|
624
|
+
};
|
|
625
|
+
CartService.prototype.getCart = function (checkout) {
|
|
626
|
+
var _this = this;
|
|
627
|
+
this.buildCartFromCheckout(checkout).subscribe(function (cart) { return _this.cartSubject.next(cart); });
|
|
628
|
+
return this.cartSubject;
|
|
629
|
+
};
|
|
630
|
+
CartService.prototype.removeItem = function (item) {
|
|
631
|
+
var _this = this;
|
|
632
|
+
return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) {
|
|
633
|
+
var index = checkout.lineItems.findIndex(function (lineItem) { return lineItem.sku === item.sku; });
|
|
634
|
+
if (index >= 0)
|
|
635
|
+
checkout.lineItems.splice(index, 1);
|
|
636
|
+
return checkout;
|
|
637
|
+
}), 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); }));
|
|
638
|
+
};
|
|
639
|
+
CartService.prototype.updateUserCart = function (user) {
|
|
640
|
+
var _this = this;
|
|
641
|
+
return this.checkoutService.getCheckout().pipe(operators.concatMap(function (checkout) { return _this.checkoutService.updateCheckoutUser(i2.Checkout.toInstance(Object.assign(Object.assign({}, checkout.toPlain()), { user: user }))); }), operators.concatMap(function (checkout) {
|
|
642
|
+
var _a;
|
|
643
|
+
return _this.checkoutService.updateCheckoutLineItems(i2.Checkout.toInstance(Object.assign(Object.assign({}, checkout.toPlain()), { lineItems: ((_a = checkout.lineItems) === null || _a === void 0 ? void 0 : _a.map(function (item) { return _this.buildLineItem({ checkout: checkout, item: item }); })) || [] })));
|
|
644
|
+
}), operators.map(function (checkout) { return _this.generateCartObject(checkout.lineItems); }), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
|
|
645
|
+
};
|
|
646
|
+
CartService.prototype.clearCart = function () {
|
|
647
|
+
var _this = this;
|
|
648
|
+
return this.checkoutService.getCheckout().pipe(operators.map(function (checkout) {
|
|
649
|
+
_this.checkoutService.clearCheckoutFromSession();
|
|
650
|
+
return checkout;
|
|
651
|
+
}), operators.concatMap(function (oldCheckout) { return _this.buildCartFromCheckout(oldCheckout); }), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
|
|
652
|
+
};
|
|
653
|
+
CartService.prototype.buildCartFromCheckout = function (checkoutData) {
|
|
654
|
+
var _this = this;
|
|
655
|
+
return this.checkoutService.getCheckout(checkoutData).pipe(operators.map(function (checkout) { return checkout.lineItems; }), operators.concatMap(function (lineItems) { return rxjs.of(_this.generateCartObject(lineItems)); }));
|
|
656
|
+
};
|
|
657
|
+
return CartService;
|
|
658
|
+
}());
|
|
659
|
+
CartService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CartService, deps: [{ token: StoreCheckoutService }, { token: DEFAULT_SHOP }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
660
|
+
CartService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CartService });
|
|
661
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CartService, decorators: [{
|
|
662
|
+
type: i0.Injectable
|
|
663
|
+
}], ctorParameters: function () {
|
|
664
|
+
return [{ type: StoreCheckoutService }, { type: i2__namespace.Shops, decorators: [{
|
|
665
|
+
type: i0.Inject,
|
|
666
|
+
args: [DEFAULT_SHOP]
|
|
667
|
+
}] }];
|
|
866
668
|
} });
|
|
867
669
|
|
|
868
|
-
var
|
|
869
|
-
function
|
|
870
|
-
this.
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
this.
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
670
|
+
var CheckoutSubscriptionService = /** @class */ (function () {
|
|
671
|
+
function CheckoutSubscriptionService(checkoutSubscriptionRepository) {
|
|
672
|
+
this.checkoutSubscriptionRepository = checkoutSubscriptionRepository;
|
|
673
|
+
}
|
|
674
|
+
CheckoutSubscriptionService.prototype.getCheckoutSubscription = function (checkoutData) {
|
|
675
|
+
var checkoutId = cookie__default["default"].get('checkoutSubscriptionId');
|
|
676
|
+
if (!i2.isNil(checkoutId))
|
|
677
|
+
return rxjs.from(this.checkoutSubscriptionRepository.get({ id: checkoutId }));
|
|
678
|
+
return rxjs.from(this.createCheckoutSubscription(checkoutData));
|
|
679
|
+
};
|
|
680
|
+
CheckoutSubscriptionService.prototype.createCheckoutSubscription = function (checkoutData) {
|
|
681
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
682
|
+
var checkout;
|
|
683
|
+
return __generator(this, function (_a) {
|
|
684
|
+
switch (_a.label) {
|
|
685
|
+
case 0: return [4 /*yield*/, this.checkoutSubscriptionRepository.create(Object.assign({ createdAt: new Date() }, i2.CheckoutSubscription.toInstance(i2.pick(checkoutData, ['user', 'shop'])).toPlain()))];
|
|
686
|
+
case 1:
|
|
687
|
+
checkout = _a.sent();
|
|
688
|
+
cookie__default["default"].set('checkoutSubscriptionId', checkout.id);
|
|
689
|
+
return [2 /*return*/, checkout];
|
|
690
|
+
}
|
|
691
|
+
});
|
|
692
|
+
});
|
|
693
|
+
};
|
|
694
|
+
CheckoutSubscriptionService.prototype.clearCheckoutSubscriptionFromSession = function () {
|
|
695
|
+
cookie__default["default"].remove('checkoutSubscriptionId');
|
|
696
|
+
return rxjs.of();
|
|
697
|
+
};
|
|
698
|
+
return CheckoutSubscriptionService;
|
|
699
|
+
}());
|
|
700
|
+
CheckoutSubscriptionService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CheckoutSubscriptionService, deps: [{ token: 'CheckoutSubscriptionRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
701
|
+
CheckoutSubscriptionService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CheckoutSubscriptionService });
|
|
702
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: CheckoutSubscriptionService, decorators: [{
|
|
703
|
+
type: i0.Injectable
|
|
704
|
+
}], ctorParameters: function () {
|
|
705
|
+
return [{ type: undefined, decorators: [{
|
|
706
|
+
type: i0.Inject,
|
|
707
|
+
args: ['CheckoutSubscriptionRepository']
|
|
708
|
+
}] }];
|
|
894
709
|
} });
|
|
895
710
|
|
|
896
|
-
var
|
|
897
|
-
function
|
|
898
|
-
this.
|
|
899
|
-
this.
|
|
900
|
-
this.
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
}
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
if (this.defaultShop === i2.Shops.GLAMSHOP)
|
|
923
|
-
return 'glamshop';
|
|
924
|
-
if (this.defaultShop === i2.Shops.MENSMARKET)
|
|
925
|
-
return 'mens_market';
|
|
926
|
-
return null;
|
|
927
|
-
},
|
|
928
|
-
enumerable: false,
|
|
929
|
-
configurable: true
|
|
930
|
-
});
|
|
931
|
-
HomeShopService.prototype.getHomeData = function () {
|
|
932
|
-
var _this = this;
|
|
933
|
-
return this.getHomeConfiguration().pipe(operators.map(function (home) { var _a; return (((_a = home === null || home === void 0 ? void 0 : home.data) === null || _a === void 0 ? void 0 : _a.expiresAt) > new Date() ? home : null); }), operators.concatMap(function (home) { return home
|
|
934
|
-
? rxjs.of(home)
|
|
935
|
-
: rxjs.forkJoin([_this.getDiscoverProducts(), _this.getFeaturedProducts(), _this.getVerticalProducts()]).pipe(operators.map(function (_b) {
|
|
936
|
-
var _c = __read(_b, 3), discoverProducts = _c[0], featuredProducts = _c[1], verticalProducts = _c[2];
|
|
937
|
-
return ({
|
|
938
|
-
discoverProducts: discoverProducts,
|
|
939
|
-
featuredProducts: featuredProducts,
|
|
940
|
-
verticalProducts: verticalProducts,
|
|
941
|
-
});
|
|
942
|
-
}), operators.concatMap(function (data) { return _this.saveHomeData(data); })); }));
|
|
943
|
-
};
|
|
944
|
-
HomeShopService.prototype.getBanners = function (type) {
|
|
945
|
-
return this.getHomeConfiguration().pipe(operators.map(function (home) {
|
|
946
|
-
if (type === 'brand')
|
|
947
|
-
return home.brandsCarousel;
|
|
948
|
-
if (type === 'buyToWin')
|
|
949
|
-
return [home.buyToWinBanner];
|
|
950
|
-
if (type === 'block')
|
|
951
|
-
return home.blockBanners;
|
|
952
|
-
if (type === 'blog')
|
|
953
|
-
return [home.blogBanner];
|
|
954
|
-
}));
|
|
955
|
-
};
|
|
956
|
-
HomeShopService.prototype.getDiscoverProducts = function () {
|
|
957
|
-
var _this = this;
|
|
958
|
-
return this.getHomeConfiguration().pipe(operators.concatMap(function (home) { return rxjs.from(_this.categoryRepository.getCategoriesForHome(home.discoverCategories)).pipe(operators.map(function (groups) { return groups.map(_this.buildCategoryGroupWithRequiredData); })); }));
|
|
959
|
-
};
|
|
960
|
-
HomeShopService.prototype.getFeaturedProducts = function () {
|
|
961
|
-
var _this = this;
|
|
962
|
-
return this.getHomeConfiguration().pipe(operators.concatMap(function (home) { return rxjs.from(_this.categoryRepository.getCategoriesForHome(home.featuredCategories)).pipe(operators.map(function (groups) { return groups.map(_this.buildCategoryGroupWithRequiredData); })); }));
|
|
963
|
-
};
|
|
964
|
-
HomeShopService.prototype.getVerticalProducts = function () {
|
|
965
|
-
var _this = this;
|
|
966
|
-
return this.getHomeConfiguration().pipe(operators.concatMap(function (home) { return rxjs.forkJoin(home.verticalCarousels.filter(Boolean).map(function (id) { return rxjs.from(_this.categoryRepository.get({ id: id })).pipe(operators.concatMap(function (category) { return rxjs.from(_this.productRepository.find({
|
|
967
|
-
filters: { categories: { operator: i2.Where.IN, value: [category.id] } },
|
|
968
|
-
limits: { limit: 12 },
|
|
969
|
-
})).pipe(operators.map(function (products) { return ({ category: category, products: products }); })); }), operators.map(function (_b) {
|
|
970
|
-
var category = _b.category, products = _b.products;
|
|
971
|
-
return ({ category: category, products: products.data });
|
|
972
|
-
}), operators.map(_this.buildCategoryGroupWithRequiredData)); })); }));
|
|
973
|
-
};
|
|
974
|
-
HomeShopService.prototype.getHomeConfiguration = function () {
|
|
975
|
-
var _this = this;
|
|
976
|
-
return rxjs.of(this.homeConfiguration).pipe(operators.concatMap(function (home) { return home
|
|
977
|
-
? rxjs.of(home)
|
|
978
|
-
: !_this.homeId
|
|
979
|
-
? rxjs.throwError(new i2.RequiredArgumentError(['homeId']))
|
|
980
|
-
: rxjs.from(_this.homeRepository.get({ id: _this.homeId })).pipe(operators.tap(function (homeLoaded) { return (_this.homeConfiguration = homeLoaded); })); }));
|
|
981
|
-
};
|
|
982
|
-
HomeShopService.prototype.saveHomeData = function (homeData) {
|
|
983
|
-
var _this = this;
|
|
984
|
-
var data = {
|
|
985
|
-
createdAt: new Date(),
|
|
986
|
-
expiresAt: i2.add(new Date(), { hours: 1 }),
|
|
987
|
-
data: homeData,
|
|
988
|
-
};
|
|
989
|
-
return rxjs.from(this.homeRepository.update({
|
|
990
|
-
id: this.homeId,
|
|
991
|
-
data: data,
|
|
992
|
-
})).pipe(operators.tap(function () { return (_this.homeConfiguration.data = data); }), operators.map(function () { return _this.homeConfiguration; }));
|
|
993
|
-
};
|
|
994
|
-
return HomeShopService;
|
|
995
|
-
}());
|
|
996
|
-
HomeShopService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: HomeShopService, deps: [{ token: 'CategoryRepository' }, { token: 'HomeRepository' }, { token: 'ProductRepository' }, { token: DEFAULT_SHOP }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
997
|
-
HomeShopService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: HomeShopService });
|
|
998
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: HomeShopService, decorators: [{
|
|
999
|
-
type: i0.Injectable
|
|
1000
|
-
}], ctorParameters: function () {
|
|
1001
|
-
return [{ type: undefined, decorators: [{
|
|
1002
|
-
type: i0.Inject,
|
|
1003
|
-
args: ['CategoryRepository']
|
|
1004
|
-
}] }, { type: undefined, decorators: [{
|
|
1005
|
-
type: i0.Inject,
|
|
1006
|
-
args: ['HomeRepository']
|
|
1007
|
-
}] }, { type: undefined, decorators: [{
|
|
1008
|
-
type: i0.Inject,
|
|
1009
|
-
args: ['ProductRepository']
|
|
1010
|
-
}] }, { type: i2__namespace.Shops, decorators: [{
|
|
1011
|
-
type: i0.Inject,
|
|
1012
|
-
args: [DEFAULT_SHOP]
|
|
1013
|
-
}] }];
|
|
711
|
+
var OrderService = /** @class */ (function () {
|
|
712
|
+
function OrderService(angularFirestore, orderRepository) {
|
|
713
|
+
this.angularFirestore = angularFirestore;
|
|
714
|
+
this.orderRepository = orderRepository;
|
|
715
|
+
this.orderSubject = new rxjs.Subject();
|
|
716
|
+
}
|
|
717
|
+
OrderService.prototype.getOrder = function (id) {
|
|
718
|
+
var _this = this;
|
|
719
|
+
this.angularFirestore
|
|
720
|
+
.doc(this.orderRepository.collectionName + "/" + id)
|
|
721
|
+
.valueChanges()
|
|
722
|
+
.pipe(operators.map(function (doc) { return i2.Order.toInstance(doc); }))
|
|
723
|
+
.subscribe(function (doc) { return _this.orderSubject.next(doc); });
|
|
724
|
+
return this.orderSubject;
|
|
725
|
+
};
|
|
726
|
+
return OrderService;
|
|
727
|
+
}());
|
|
728
|
+
OrderService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService, deps: [{ token: i1__namespace$1.AngularFirestore }, { token: 'OrderRepository' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
729
|
+
OrderService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService });
|
|
730
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: OrderService, decorators: [{
|
|
731
|
+
type: i0.Injectable
|
|
732
|
+
}], ctorParameters: function () {
|
|
733
|
+
return [{ type: i1__namespace$1.AngularFirestore }, { type: i2__namespace.OrderFirestoreRepository, decorators: [{
|
|
734
|
+
type: i0.Inject,
|
|
735
|
+
args: ['OrderRepository']
|
|
736
|
+
}] }];
|
|
1014
737
|
} });
|
|
1015
738
|
|
|
1016
|
-
var AngularFirebaseAuthModule = /** @class */ (function () {
|
|
1017
|
-
function AngularFirebaseAuthModule() {
|
|
1018
|
-
}
|
|
1019
|
-
AngularFirebaseAuthModule.initializeApp = function (options, nameOrConfig) {
|
|
1020
|
-
return {
|
|
1021
|
-
ngModule: AngularFirebaseAuthModule,
|
|
1022
|
-
providers: [
|
|
1023
|
-
{ provide: fire.FIREBASE_OPTIONS, useValue: options },
|
|
1024
|
-
{ provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig },
|
|
1025
|
-
],
|
|
1026
|
-
};
|
|
1027
|
-
};
|
|
1028
|
-
return AngularFirebaseAuthModule;
|
|
1029
|
-
}());
|
|
1030
|
-
AngularFirebaseAuthModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirebaseAuthModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
1031
|
-
AngularFirebaseAuthModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirebaseAuthModule, imports: [fire.AngularFireModule] });
|
|
1032
|
-
AngularFirebaseAuthModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirebaseAuthModule, providers: [
|
|
1033
|
-
{
|
|
1034
|
-
provide: 'Authentication',
|
|
1035
|
-
useFactory: function (authenticationService, userRepository) {
|
|
1036
|
-
return new i2.Authentication(authenticationService, userRepository);
|
|
1037
|
-
},
|
|
1038
|
-
deps: ['AuthenticationService', 'UserRepository'],
|
|
1039
|
-
},
|
|
1040
|
-
{
|
|
1041
|
-
provide: 'AuthenticationService',
|
|
1042
|
-
useFactory: function (angularFireAuth) {
|
|
1043
|
-
return new i2.AuthenticationFirebaseAuthService(angularFireAuth);
|
|
1044
|
-
},
|
|
1045
|
-
deps: [i1.AngularFireAuth],
|
|
1046
|
-
},
|
|
1047
|
-
{
|
|
1048
|
-
provide: 'Register',
|
|
1049
|
-
useFactory: function (registerService, userRepository) {
|
|
1050
|
-
return new i2.Register(registerService, userRepository);
|
|
1051
|
-
},
|
|
1052
|
-
deps: ['RegisterService', 'UserRepository'],
|
|
1053
|
-
},
|
|
1054
|
-
{
|
|
1055
|
-
provide: 'RegisterService',
|
|
1056
|
-
useFactory: function (angularFireAuth) {
|
|
1057
|
-
return new i2.RegisterFirebaseAuthService(angularFireAuth);
|
|
1058
|
-
},
|
|
1059
|
-
deps: [i1.AngularFireAuth],
|
|
1060
|
-
},
|
|
1061
|
-
{
|
|
1062
|
-
provide: 'SignOut',
|
|
1063
|
-
useFactory: function (authenticationService) {
|
|
1064
|
-
return new i2.SignOut(authenticationService);
|
|
1065
|
-
},
|
|
1066
|
-
deps: ['AuthenticationService'],
|
|
1067
|
-
},
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
{
|
|
1082
|
-
provide: '
|
|
1083
|
-
useFactory: function (
|
|
1084
|
-
return new i2.
|
|
1085
|
-
},
|
|
1086
|
-
deps: [
|
|
1087
|
-
},
|
|
1088
|
-
{
|
|
1089
|
-
provide: '
|
|
1090
|
-
useFactory: function (
|
|
1091
|
-
return new i2.
|
|
1092
|
-
},
|
|
1093
|
-
deps: [
|
|
1094
|
-
},
|
|
1095
|
-
{
|
|
1096
|
-
provide: '
|
|
1097
|
-
useFactory: function (
|
|
1098
|
-
return new i2.
|
|
1099
|
-
},
|
|
1100
|
-
deps: [
|
|
1101
|
-
},
|
|
1102
|
-
{
|
|
1103
|
-
provide: '
|
|
1104
|
-
useFactory: function (
|
|
1105
|
-
return new i2.
|
|
1106
|
-
},
|
|
1107
|
-
deps: [
|
|
1108
|
-
},
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
useFactory: function (authenticationService) {
|
|
1112
|
-
return new i2.SignOut(authenticationService);
|
|
1113
|
-
},
|
|
1114
|
-
deps: ['AuthenticationService'],
|
|
1115
|
-
},
|
|
1116
|
-
{
|
|
1117
|
-
provide: 'RecoveryPassword',
|
|
1118
|
-
useFactory: function (authenticationService) {
|
|
1119
|
-
return new i2.RecoveryPassword(authenticationService);
|
|
1120
|
-
},
|
|
1121
|
-
deps: ['AuthenticationService'],
|
|
1122
|
-
},
|
|
1123
|
-
],
|
|
1124
|
-
}]
|
|
1125
|
-
}] });
|
|
1126
|
-
|
|
1127
|
-
var AngularElasticSeachModule = /** @class */ (function () {
|
|
1128
|
-
function AngularElasticSeachModule() {
|
|
1129
|
-
}
|
|
1130
|
-
AngularElasticSeachModule.initializeApp = function (options) {
|
|
1131
|
-
return {
|
|
1132
|
-
ngModule: AngularElasticSeachModule,
|
|
1133
|
-
providers: [{ provide: ES_CONFIG, useValue: options }],
|
|
1134
|
-
};
|
|
1135
|
-
};
|
|
1136
|
-
return AngularElasticSeachModule;
|
|
1137
|
-
}());
|
|
1138
|
-
AngularElasticSeachModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularElasticSeachModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
1139
|
-
AngularElasticSeachModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularElasticSeachModule });
|
|
1140
|
-
AngularElasticSeachModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularElasticSeachModule, providers: [
|
|
1141
|
-
{
|
|
1142
|
-
provide: i2.ProductsIndex,
|
|
1143
|
-
useFactory: function (configuration) {
|
|
1144
|
-
return new i2.ProductsIndex(new i2.AxiosAdapter(configuration));
|
|
1145
|
-
},
|
|
1146
|
-
deps: [ES_CONFIG],
|
|
1147
|
-
},
|
|
1148
|
-
] });
|
|
1149
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularElasticSeachModule, decorators: [{
|
|
1150
|
-
type: i0.NgModule,
|
|
1151
|
-
args: [{
|
|
1152
|
-
providers: [
|
|
1153
|
-
{
|
|
1154
|
-
provide: i2.ProductsIndex,
|
|
1155
|
-
useFactory: function (configuration) {
|
|
1156
|
-
return new i2.ProductsIndex(new i2.AxiosAdapter(configuration));
|
|
1157
|
-
},
|
|
1158
|
-
deps: [ES_CONFIG],
|
|
1159
|
-
},
|
|
1160
|
-
],
|
|
1161
|
-
}]
|
|
1162
|
-
}] });
|
|
1163
|
-
|
|
1164
|
-
var AngularFirestoreModule = /** @class */ (function () {
|
|
1165
|
-
function AngularFirestoreModule() {
|
|
1166
|
-
}
|
|
1167
|
-
AngularFirestoreModule.initializeApp = function (options, nameOrConfig) {
|
|
1168
|
-
return {
|
|
1169
|
-
ngModule: AngularFirestoreModule,
|
|
1170
|
-
providers: [
|
|
1171
|
-
{ provide: fire.FIREBASE_OPTIONS, useValue: options.firebase },
|
|
1172
|
-
{ provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig },
|
|
1173
|
-
{ provide: ES_CONFIG, useValue: options.elasticSearch },
|
|
1174
|
-
],
|
|
1175
|
-
};
|
|
1176
|
-
};
|
|
1177
|
-
return AngularFirestoreModule;
|
|
1178
|
-
}());
|
|
1179
|
-
AngularFirestoreModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirestoreModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
1180
|
-
AngularFirestoreModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirestoreModule, imports: [fire.AngularFireModule, AngularElasticSeachModule] });
|
|
1181
|
-
AngularFirestoreModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirestoreModule, providers: [
|
|
1182
|
-
{
|
|
1183
|
-
provide: 'BeautyProfileRepository',
|
|
1184
|
-
useFactory: function (firestore, userRepository) {
|
|
1185
|
-
return new i2.UserBeautyProfileFirestoreRepository(firestore.firestore, userRepository);
|
|
1186
|
-
},
|
|
1187
|
-
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1188
|
-
},
|
|
1189
|
-
{
|
|
1190
|
-
provide: 'Buy2WinRepository',
|
|
1191
|
-
useFactory: function (firestore) {
|
|
1192
|
-
return new i2.Buy2WinFirestoreRepository(firestore.firestore);
|
|
1193
|
-
},
|
|
1194
|
-
deps: [i1$1.AngularFirestore],
|
|
1195
|
-
},
|
|
1196
|
-
{
|
|
1197
|
-
provide: i2.CategoryFirestoreRepository,
|
|
1198
|
-
useFactory: function (firestore) {
|
|
1199
|
-
return new i2.CategoryFirestoreRepository(firestore.firestore);
|
|
1200
|
-
},
|
|
1201
|
-
deps: [i1$1.AngularFirestore],
|
|
1202
|
-
},
|
|
1203
|
-
{
|
|
1204
|
-
provide: 'CheckoutRepository',
|
|
1205
|
-
useFactory: function (firestore) {
|
|
1206
|
-
return new i2.CheckoutFirestoreRepository(firestore.firestore);
|
|
1207
|
-
},
|
|
1208
|
-
deps: [i1$1.AngularFirestore],
|
|
1209
|
-
},
|
|
1210
|
-
{
|
|
1211
|
-
provide: 'CheckoutSubscriptionRepository',
|
|
1212
|
-
useFactory: function (firestore) {
|
|
1213
|
-
return new i2.CheckoutSubscriptionFirestoreRepository(firestore.firestore);
|
|
1214
|
-
},
|
|
1215
|
-
deps: [i1$1.AngularFirestore],
|
|
1216
|
-
},
|
|
1217
|
-
{
|
|
1218
|
-
provide: 'CouponRepository',
|
|
1219
|
-
useFactory: function (firestore) {
|
|
1220
|
-
return new i2.CouponFirestoreRepository(firestore.firestore);
|
|
1221
|
-
},
|
|
1222
|
-
deps: [i1$1.AngularFirestore],
|
|
1223
|
-
},
|
|
1224
|
-
{
|
|
1225
|
-
provide: 'EditionRepository',
|
|
1226
|
-
useFactory: function (firestore, subscriptionRepository) {
|
|
1227
|
-
return new i2.SubscriptionEditionFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
1228
|
-
},
|
|
1229
|
-
deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
|
|
1230
|
-
},
|
|
1231
|
-
{
|
|
1232
|
-
provide: 'HomeRepository',
|
|
1233
|
-
useFactory: function (firestore) {
|
|
1234
|
-
return new i2.HomeFirestoreRepository(firestore.firestore);
|
|
1235
|
-
},
|
|
1236
|
-
deps: [i1$1.AngularFirestore],
|
|
1237
|
-
},
|
|
1238
|
-
{
|
|
1239
|
-
provide: 'LeadRepository',
|
|
1240
|
-
useFactory: function (firestore) {
|
|
1241
|
-
return new i2.LeadFirestoreRepository(firestore.firestore);
|
|
1242
|
-
},
|
|
1243
|
-
deps: [i1$1.AngularFirestore],
|
|
1244
|
-
},
|
|
1245
|
-
{
|
|
1246
|
-
provide: 'LegacyOrderRepository',
|
|
1247
|
-
useFactory: function (firestore) {
|
|
1248
|
-
return new i2.LegacyOrderFirestoreRepository(firestore.firestore);
|
|
1249
|
-
},
|
|
1250
|
-
deps: [i1$1.AngularFirestore],
|
|
1251
|
-
},
|
|
1252
|
-
{
|
|
1253
|
-
provide: 'ShopMenuRepository',
|
|
1254
|
-
useFactory: function (firestore) {
|
|
1255
|
-
return new i2.ShopMenuFirestoreRepository(firestore.firestore);
|
|
1256
|
-
},
|
|
1257
|
-
deps: [i1$1.AngularFirestore],
|
|
1258
|
-
},
|
|
1259
|
-
{
|
|
1260
|
-
provide: 'OrderRepository',
|
|
1261
|
-
useFactory: function (firestore) {
|
|
1262
|
-
return new i2.OrderFirestoreRepository(firestore.firestore);
|
|
1263
|
-
},
|
|
1264
|
-
deps: [i1$1.AngularFirestore],
|
|
1265
|
-
},
|
|
1266
|
-
{
|
|
1267
|
-
provide: 'PaymentRepository',
|
|
1268
|
-
useFactory: function (firestore) {
|
|
1269
|
-
return new i2.PaymentFirestoreRepository(firestore.firestore);
|
|
1270
|
-
},
|
|
1271
|
-
deps: [i1$1.AngularFirestore],
|
|
1272
|
-
},
|
|
1273
|
-
{
|
|
1274
|
-
provide: i2.ProductFirestoreRepository,
|
|
1275
|
-
useFactory: function (firestore) {
|
|
1276
|
-
return new i2.ProductFirestoreRepository(firestore.firestore);
|
|
1277
|
-
},
|
|
1278
|
-
deps: [i1$1.AngularFirestore],
|
|
1279
|
-
},
|
|
1280
|
-
{
|
|
1281
|
-
provide: 'SubscriptionPaymentRepository',
|
|
1282
|
-
useFactory: function (firestore, subscriptionRepository) {
|
|
1283
|
-
return new i2.SubscriptionPaymentFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
1284
|
-
},
|
|
1285
|
-
deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
|
|
1286
|
-
},
|
|
1287
|
-
{
|
|
1288
|
-
provide: 'SubscriptionPlanRepository',
|
|
1289
|
-
useFactory: function (firestore) {
|
|
1290
|
-
return new i2.SubscriptionPlanFirestoreRepository(firestore.firestore);
|
|
1291
|
-
},
|
|
1292
|
-
deps: [i1$1.AngularFirestore],
|
|
1293
|
-
},
|
|
1294
|
-
{
|
|
1295
|
-
provide: 'SubscriptionProductRepository',
|
|
1296
|
-
useFactory: function (firestore) {
|
|
1297
|
-
return new i2.SubscriptionProductFirestoreRepository(firestore.firestore);
|
|
1298
|
-
},
|
|
1299
|
-
deps: [i1$1.AngularFirestore],
|
|
1300
|
-
},
|
|
1301
|
-
{
|
|
1302
|
-
provide: 'SubscriptionRepository',
|
|
1303
|
-
useFactory: function (firestore) {
|
|
1304
|
-
return new i2.SubscriptionFirestoreRepository(firestore.firestore);
|
|
1305
|
-
},
|
|
1306
|
-
deps: [i1$1.AngularFirestore],
|
|
1307
|
-
},
|
|
1308
|
-
{
|
|
1309
|
-
provide: 'UserRepository',
|
|
1310
|
-
useFactory: function (firestore) {
|
|
1311
|
-
return new i2.UserFirestoreRepository(firestore.firestore);
|
|
1312
|
-
},
|
|
1313
|
-
deps: [i1$1.AngularFirestore],
|
|
1314
|
-
},
|
|
1315
|
-
{
|
|
1316
|
-
provide: 'UserAddressRepository',
|
|
1317
|
-
useFactory: function (firestore, userRepository) {
|
|
1318
|
-
return new i2.UserAddressFirestoreRepository(firestore.firestore, userRepository);
|
|
1319
|
-
},
|
|
1320
|
-
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1321
|
-
},
|
|
1322
|
-
{
|
|
1323
|
-
provide: 'UserPaymentMethodRepository',
|
|
1324
|
-
useFactory: function (firestore, userRepository) {
|
|
1325
|
-
return new i2.UserPaymentMethodFirestoreRepository(firestore.firestore, userRepository);
|
|
1326
|
-
},
|
|
1327
|
-
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1328
|
-
},
|
|
1329
|
-
{
|
|
1330
|
-
provide: 'VariantRepository',
|
|
1331
|
-
useFactory: function (firestore, productRepository) {
|
|
1332
|
-
return new i2.ProductVariantFirestoreRepository(firestore.firestore, productRepository);
|
|
1333
|
-
},
|
|
1334
|
-
deps: [i1$1.AngularFirestore, i2.ProductFirestoreRepository],
|
|
1335
|
-
},
|
|
1336
|
-
], imports: [[fire.AngularFireModule, AngularElasticSeachModule]] });
|
|
1337
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirestoreModule, decorators: [{
|
|
1338
|
-
type: i0.NgModule,
|
|
1339
|
-
args: [{
|
|
1340
|
-
imports: [fire.AngularFireModule, AngularElasticSeachModule],
|
|
1341
|
-
providers: [
|
|
1342
|
-
{
|
|
1343
|
-
provide: 'BeautyProfileRepository',
|
|
1344
|
-
useFactory: function (firestore, userRepository) {
|
|
1345
|
-
return new i2.UserBeautyProfileFirestoreRepository(firestore.firestore, userRepository);
|
|
1346
|
-
},
|
|
1347
|
-
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1348
|
-
},
|
|
1349
|
-
{
|
|
1350
|
-
provide: 'Buy2WinRepository',
|
|
1351
|
-
useFactory: function (firestore) {
|
|
1352
|
-
return new i2.Buy2WinFirestoreRepository(firestore.firestore);
|
|
1353
|
-
},
|
|
1354
|
-
deps: [i1$1.AngularFirestore],
|
|
1355
|
-
},
|
|
1356
|
-
{
|
|
1357
|
-
provide: i2.CategoryFirestoreRepository,
|
|
1358
|
-
useFactory: function (firestore) {
|
|
1359
|
-
return new i2.CategoryFirestoreRepository(firestore.firestore);
|
|
1360
|
-
},
|
|
1361
|
-
deps: [i1$1.AngularFirestore],
|
|
1362
|
-
},
|
|
1363
|
-
{
|
|
1364
|
-
provide: 'CheckoutRepository',
|
|
1365
|
-
useFactory: function (firestore) {
|
|
1366
|
-
return new i2.CheckoutFirestoreRepository(firestore.firestore);
|
|
1367
|
-
},
|
|
1368
|
-
deps: [i1$1.AngularFirestore],
|
|
1369
|
-
},
|
|
1370
|
-
{
|
|
1371
|
-
provide: 'CheckoutSubscriptionRepository',
|
|
1372
|
-
useFactory: function (firestore) {
|
|
1373
|
-
return new i2.CheckoutSubscriptionFirestoreRepository(firestore.firestore);
|
|
1374
|
-
},
|
|
1375
|
-
deps: [i1$1.AngularFirestore],
|
|
1376
|
-
},
|
|
1377
|
-
{
|
|
1378
|
-
provide: 'CouponRepository',
|
|
1379
|
-
useFactory: function (firestore) {
|
|
1380
|
-
return new i2.CouponFirestoreRepository(firestore.firestore);
|
|
1381
|
-
},
|
|
1382
|
-
deps: [i1$1.AngularFirestore],
|
|
1383
|
-
},
|
|
1384
|
-
{
|
|
1385
|
-
provide: 'EditionRepository',
|
|
1386
|
-
useFactory: function (firestore, subscriptionRepository) {
|
|
1387
|
-
return new i2.SubscriptionEditionFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
1388
|
-
},
|
|
1389
|
-
deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
|
|
1390
|
-
},
|
|
1391
|
-
{
|
|
1392
|
-
provide: 'HomeRepository',
|
|
1393
|
-
useFactory: function (firestore) {
|
|
1394
|
-
return new i2.HomeFirestoreRepository(firestore.firestore);
|
|
1395
|
-
},
|
|
1396
|
-
deps: [i1$1.AngularFirestore],
|
|
1397
|
-
},
|
|
1398
|
-
{
|
|
1399
|
-
provide: 'LeadRepository',
|
|
1400
|
-
useFactory: function (firestore) {
|
|
1401
|
-
return new i2.LeadFirestoreRepository(firestore.firestore);
|
|
1402
|
-
},
|
|
1403
|
-
deps: [i1$1.AngularFirestore],
|
|
1404
|
-
},
|
|
1405
|
-
{
|
|
1406
|
-
provide: 'LegacyOrderRepository',
|
|
1407
|
-
useFactory: function (firestore) {
|
|
1408
|
-
return new i2.LegacyOrderFirestoreRepository(firestore.firestore);
|
|
1409
|
-
},
|
|
1410
|
-
deps: [i1$1.AngularFirestore],
|
|
1411
|
-
},
|
|
1412
|
-
{
|
|
1413
|
-
provide: 'ShopMenuRepository',
|
|
1414
|
-
useFactory: function (firestore) {
|
|
1415
|
-
return new i2.ShopMenuFirestoreRepository(firestore.firestore);
|
|
1416
|
-
},
|
|
1417
|
-
deps: [i1$1.AngularFirestore],
|
|
1418
|
-
},
|
|
1419
|
-
{
|
|
1420
|
-
provide: 'OrderRepository',
|
|
1421
|
-
useFactory: function (firestore) {
|
|
1422
|
-
return new i2.OrderFirestoreRepository(firestore.firestore);
|
|
1423
|
-
},
|
|
1424
|
-
deps: [i1$1.AngularFirestore],
|
|
1425
|
-
},
|
|
1426
|
-
{
|
|
1427
|
-
provide: 'PaymentRepository',
|
|
1428
|
-
useFactory: function (firestore) {
|
|
1429
|
-
return new i2.PaymentFirestoreRepository(firestore.firestore);
|
|
1430
|
-
},
|
|
1431
|
-
deps: [i1$1.AngularFirestore],
|
|
1432
|
-
},
|
|
1433
|
-
{
|
|
1434
|
-
provide: i2.ProductFirestoreRepository,
|
|
1435
|
-
useFactory: function (firestore) {
|
|
1436
|
-
return new i2.ProductFirestoreRepository(firestore.firestore);
|
|
1437
|
-
},
|
|
1438
|
-
deps: [i1$1.AngularFirestore],
|
|
1439
|
-
},
|
|
1440
|
-
{
|
|
1441
|
-
provide: 'SubscriptionPaymentRepository',
|
|
1442
|
-
useFactory: function (firestore, subscriptionRepository) {
|
|
1443
|
-
return new i2.SubscriptionPaymentFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
1444
|
-
},
|
|
1445
|
-
deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
|
|
1446
|
-
},
|
|
1447
|
-
{
|
|
1448
|
-
provide: 'SubscriptionPlanRepository',
|
|
1449
|
-
useFactory: function (firestore) {
|
|
1450
|
-
return new i2.SubscriptionPlanFirestoreRepository(firestore.firestore);
|
|
1451
|
-
},
|
|
1452
|
-
deps: [i1$1.AngularFirestore],
|
|
1453
|
-
},
|
|
1454
|
-
{
|
|
1455
|
-
provide: 'SubscriptionProductRepository',
|
|
1456
|
-
useFactory: function (firestore) {
|
|
1457
|
-
return new i2.SubscriptionProductFirestoreRepository(firestore.firestore);
|
|
1458
|
-
},
|
|
1459
|
-
deps: [i1$1.AngularFirestore],
|
|
1460
|
-
},
|
|
1461
|
-
{
|
|
1462
|
-
provide: 'SubscriptionRepository',
|
|
1463
|
-
useFactory: function (firestore) {
|
|
1464
|
-
return new i2.SubscriptionFirestoreRepository(firestore.firestore);
|
|
1465
|
-
},
|
|
1466
|
-
deps: [i1$1.AngularFirestore],
|
|
1467
|
-
},
|
|
1468
|
-
{
|
|
1469
|
-
provide: 'UserRepository',
|
|
1470
|
-
useFactory: function (firestore) {
|
|
1471
|
-
return new i2.UserFirestoreRepository(firestore.firestore);
|
|
1472
|
-
},
|
|
1473
|
-
deps: [i1$1.AngularFirestore],
|
|
1474
|
-
},
|
|
1475
|
-
{
|
|
1476
|
-
provide: 'UserAddressRepository',
|
|
1477
|
-
useFactory: function (firestore, userRepository) {
|
|
1478
|
-
return new i2.UserAddressFirestoreRepository(firestore.firestore, userRepository);
|
|
1479
|
-
},
|
|
1480
|
-
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1481
|
-
},
|
|
1482
|
-
{
|
|
1483
|
-
provide: 'UserPaymentMethodRepository',
|
|
1484
|
-
useFactory: function (firestore, userRepository) {
|
|
1485
|
-
return new i2.UserPaymentMethodFirestoreRepository(firestore.firestore, userRepository);
|
|
1486
|
-
},
|
|
1487
|
-
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1488
|
-
},
|
|
1489
|
-
{
|
|
1490
|
-
provide: 'VariantRepository',
|
|
1491
|
-
useFactory: function (firestore, productRepository) {
|
|
1492
|
-
return new i2.ProductVariantFirestoreRepository(firestore.firestore, productRepository);
|
|
1493
|
-
},
|
|
1494
|
-
deps: [i1$1.AngularFirestore, i2.ProductFirestoreRepository],
|
|
1495
|
-
},
|
|
1496
|
-
],
|
|
1497
|
-
}]
|
|
739
|
+
var AngularFirebaseAuthModule = /** @class */ (function () {
|
|
740
|
+
function AngularFirebaseAuthModule() {
|
|
741
|
+
}
|
|
742
|
+
AngularFirebaseAuthModule.initializeApp = function (options, nameOrConfig) {
|
|
743
|
+
return {
|
|
744
|
+
ngModule: AngularFirebaseAuthModule,
|
|
745
|
+
providers: [
|
|
746
|
+
{ provide: fire.FIREBASE_OPTIONS, useValue: options },
|
|
747
|
+
{ provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig },
|
|
748
|
+
],
|
|
749
|
+
};
|
|
750
|
+
};
|
|
751
|
+
return AngularFirebaseAuthModule;
|
|
752
|
+
}());
|
|
753
|
+
AngularFirebaseAuthModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirebaseAuthModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
754
|
+
AngularFirebaseAuthModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirebaseAuthModule, imports: [fire.AngularFireModule] });
|
|
755
|
+
AngularFirebaseAuthModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirebaseAuthModule, providers: [
|
|
756
|
+
{
|
|
757
|
+
provide: 'Authentication',
|
|
758
|
+
useFactory: function (authenticationService, userRepository) {
|
|
759
|
+
return new i2.Authentication(authenticationService, userRepository);
|
|
760
|
+
},
|
|
761
|
+
deps: ['AuthenticationService', 'UserRepository'],
|
|
762
|
+
},
|
|
763
|
+
{
|
|
764
|
+
provide: 'AuthenticationService',
|
|
765
|
+
useFactory: function (angularFireAuth) {
|
|
766
|
+
return new i2.AuthenticationFirebaseAuthService(angularFireAuth);
|
|
767
|
+
},
|
|
768
|
+
deps: [i1.AngularFireAuth],
|
|
769
|
+
},
|
|
770
|
+
{
|
|
771
|
+
provide: 'Register',
|
|
772
|
+
useFactory: function (registerService, userRepository) {
|
|
773
|
+
return new i2.Register(registerService, userRepository);
|
|
774
|
+
},
|
|
775
|
+
deps: ['RegisterService', 'UserRepository'],
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
provide: 'RegisterService',
|
|
779
|
+
useFactory: function (angularFireAuth) {
|
|
780
|
+
return new i2.RegisterFirebaseAuthService(angularFireAuth);
|
|
781
|
+
},
|
|
782
|
+
deps: [i1.AngularFireAuth],
|
|
783
|
+
},
|
|
784
|
+
{
|
|
785
|
+
provide: 'SignOut',
|
|
786
|
+
useFactory: function (authenticationService) {
|
|
787
|
+
return new i2.SignOut(authenticationService);
|
|
788
|
+
},
|
|
789
|
+
deps: ['AuthenticationService'],
|
|
790
|
+
},
|
|
791
|
+
], imports: [[fire.AngularFireModule]] });
|
|
792
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirebaseAuthModule, decorators: [{
|
|
793
|
+
type: i0.NgModule,
|
|
794
|
+
args: [{
|
|
795
|
+
imports: [fire.AngularFireModule],
|
|
796
|
+
providers: [
|
|
797
|
+
{
|
|
798
|
+
provide: 'Authentication',
|
|
799
|
+
useFactory: function (authenticationService, userRepository) {
|
|
800
|
+
return new i2.Authentication(authenticationService, userRepository);
|
|
801
|
+
},
|
|
802
|
+
deps: ['AuthenticationService', 'UserRepository'],
|
|
803
|
+
},
|
|
804
|
+
{
|
|
805
|
+
provide: 'AuthenticationService',
|
|
806
|
+
useFactory: function (angularFireAuth) {
|
|
807
|
+
return new i2.AuthenticationFirebaseAuthService(angularFireAuth);
|
|
808
|
+
},
|
|
809
|
+
deps: [i1.AngularFireAuth],
|
|
810
|
+
},
|
|
811
|
+
{
|
|
812
|
+
provide: 'Register',
|
|
813
|
+
useFactory: function (registerService, userRepository) {
|
|
814
|
+
return new i2.Register(registerService, userRepository);
|
|
815
|
+
},
|
|
816
|
+
deps: ['RegisterService', 'UserRepository'],
|
|
817
|
+
},
|
|
818
|
+
{
|
|
819
|
+
provide: 'RegisterService',
|
|
820
|
+
useFactory: function (angularFireAuth) {
|
|
821
|
+
return new i2.RegisterFirebaseAuthService(angularFireAuth);
|
|
822
|
+
},
|
|
823
|
+
deps: [i1.AngularFireAuth],
|
|
824
|
+
},
|
|
825
|
+
{
|
|
826
|
+
provide: 'SignOut',
|
|
827
|
+
useFactory: function (authenticationService) {
|
|
828
|
+
return new i2.SignOut(authenticationService);
|
|
829
|
+
},
|
|
830
|
+
deps: ['AuthenticationService'],
|
|
831
|
+
},
|
|
832
|
+
],
|
|
833
|
+
}]
|
|
1498
834
|
}] });
|
|
1499
835
|
|
|
1500
|
-
var
|
|
1501
|
-
function
|
|
1502
|
-
}
|
|
1503
|
-
|
|
1504
|
-
return {
|
|
1505
|
-
ngModule:
|
|
1506
|
-
providers: [
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
836
|
+
var AngularFirestoreModule = /** @class */ (function () {
|
|
837
|
+
function AngularFirestoreModule() {
|
|
838
|
+
}
|
|
839
|
+
AngularFirestoreModule.initializeApp = function (options, nameOrConfig) {
|
|
840
|
+
return {
|
|
841
|
+
ngModule: AngularFirestoreModule,
|
|
842
|
+
providers: [
|
|
843
|
+
{ provide: fire.FIREBASE_OPTIONS, useValue: options },
|
|
844
|
+
{ provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig },
|
|
845
|
+
],
|
|
846
|
+
};
|
|
847
|
+
};
|
|
848
|
+
return AngularFirestoreModule;
|
|
849
|
+
}());
|
|
850
|
+
AngularFirestoreModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirestoreModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
851
|
+
AngularFirestoreModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirestoreModule, imports: [fire.AngularFireModule] });
|
|
852
|
+
AngularFirestoreModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirestoreModule, providers: [
|
|
853
|
+
{
|
|
854
|
+
provide: 'BeautyProfileRepository',
|
|
855
|
+
useFactory: function (firestore, userRepository) {
|
|
856
|
+
return new i2.UserBeautyProfileFirestoreRepository(firestore.firestore, userRepository);
|
|
857
|
+
},
|
|
858
|
+
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
859
|
+
},
|
|
860
|
+
{
|
|
861
|
+
provide: 'Buy2WinRepository',
|
|
862
|
+
useFactory: function (firestore) {
|
|
863
|
+
return new i2.Buy2WinFirestoreRepository(firestore.firestore);
|
|
864
|
+
},
|
|
865
|
+
deps: [i1$1.AngularFirestore],
|
|
866
|
+
},
|
|
867
|
+
{
|
|
868
|
+
provide: 'CategoryRepository',
|
|
869
|
+
useFactory: function (firestore) {
|
|
870
|
+
return new i2.CategoryFirestoreRepository(firestore.firestore);
|
|
871
|
+
},
|
|
872
|
+
deps: [i1$1.AngularFirestore],
|
|
873
|
+
},
|
|
874
|
+
{
|
|
875
|
+
provide: 'CheckoutRepository',
|
|
876
|
+
useFactory: function (firestore) {
|
|
877
|
+
return new i2.CheckoutFirestoreRepository(firestore.firestore);
|
|
878
|
+
},
|
|
879
|
+
deps: [i1$1.AngularFirestore],
|
|
880
|
+
},
|
|
881
|
+
{
|
|
882
|
+
provide: 'CheckoutSubscriptionRepository',
|
|
883
|
+
useFactory: function (firestore) {
|
|
884
|
+
return new i2.CheckoutSubscriptionFirestoreRepository(firestore.firestore);
|
|
885
|
+
},
|
|
886
|
+
deps: [i1$1.AngularFirestore],
|
|
887
|
+
},
|
|
888
|
+
{
|
|
889
|
+
provide: 'CouponRepository',
|
|
890
|
+
useFactory: function (firestore) {
|
|
891
|
+
return new i2.CouponFirestoreRepository(firestore.firestore);
|
|
892
|
+
},
|
|
893
|
+
deps: [i1$1.AngularFirestore],
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
provide: 'EditionRepository',
|
|
897
|
+
useFactory: function (firestore, subscriptionRepository) {
|
|
898
|
+
return new i2.SubscriptionEditionFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
899
|
+
},
|
|
900
|
+
deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
|
|
901
|
+
},
|
|
902
|
+
{
|
|
903
|
+
provide: 'HomeRepository',
|
|
904
|
+
useFactory: function (firestore) {
|
|
905
|
+
return new i2.HomeFirestoreRepository(firestore.firestore);
|
|
906
|
+
},
|
|
907
|
+
deps: [i1$1.AngularFirestore],
|
|
908
|
+
},
|
|
909
|
+
{
|
|
910
|
+
provide: 'LeadRepository',
|
|
911
|
+
useFactory: function (firestore) {
|
|
912
|
+
return new i2.LeadFirestoreRepository(firestore.firestore);
|
|
913
|
+
},
|
|
914
|
+
deps: [i1$1.AngularFirestore],
|
|
915
|
+
},
|
|
916
|
+
{
|
|
917
|
+
provide: 'LegacyOrderRepository',
|
|
918
|
+
useFactory: function (firestore) {
|
|
919
|
+
return new i2.LegacyOrderFirestoreRepository(firestore.firestore);
|
|
920
|
+
},
|
|
921
|
+
deps: [i1$1.AngularFirestore],
|
|
922
|
+
},
|
|
923
|
+
{
|
|
924
|
+
provide: 'ShopMenuRepository',
|
|
925
|
+
useFactory: function (firestore) {
|
|
926
|
+
return new i2.ShopMenuFirestoreRepository(firestore.firestore);
|
|
927
|
+
},
|
|
928
|
+
deps: [i1$1.AngularFirestore],
|
|
929
|
+
},
|
|
930
|
+
{
|
|
931
|
+
provide: 'OrderRepository',
|
|
932
|
+
useFactory: function (firestore) {
|
|
933
|
+
return new i2.OrderFirestoreRepository(firestore.firestore);
|
|
934
|
+
},
|
|
935
|
+
deps: [i1$1.AngularFirestore],
|
|
936
|
+
},
|
|
937
|
+
{
|
|
938
|
+
provide: 'PaymentRepository',
|
|
939
|
+
useFactory: function (firestore) {
|
|
940
|
+
return new i2.PaymentFirestoreRepository(firestore.firestore);
|
|
941
|
+
},
|
|
942
|
+
deps: [i1$1.AngularFirestore],
|
|
943
|
+
},
|
|
944
|
+
{
|
|
945
|
+
provide: 'ProductRepository',
|
|
946
|
+
useFactory: function (firestore) {
|
|
947
|
+
return new i2.ProductFirestoreRepository(firestore.firestore);
|
|
948
|
+
},
|
|
949
|
+
deps: [i1$1.AngularFirestore],
|
|
950
|
+
},
|
|
951
|
+
{
|
|
952
|
+
provide: 'SubscriptionPaymentRepository',
|
|
953
|
+
useFactory: function (firestore, subscriptionRepository) {
|
|
954
|
+
return new i2.SubscriptionPaymentFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
955
|
+
},
|
|
956
|
+
deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
|
|
957
|
+
},
|
|
958
|
+
{
|
|
959
|
+
provide: 'SubscriptionPlanRepository',
|
|
960
|
+
useFactory: function (firestore) {
|
|
961
|
+
return new i2.SubscriptionPlanFirestoreRepository(firestore.firestore);
|
|
962
|
+
},
|
|
963
|
+
deps: [i1$1.AngularFirestore],
|
|
964
|
+
},
|
|
965
|
+
{
|
|
966
|
+
provide: 'SubscriptionProductRepository',
|
|
967
|
+
useFactory: function (firestore) {
|
|
968
|
+
return new i2.SubscriptionProductFirestoreRepository(firestore.firestore);
|
|
969
|
+
},
|
|
970
|
+
deps: [i1$1.AngularFirestore],
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
provide: 'SubscriptionRepository',
|
|
974
|
+
useFactory: function (firestore) {
|
|
975
|
+
return new i2.SubscriptionFirestoreRepository(firestore.firestore);
|
|
976
|
+
},
|
|
977
|
+
deps: [i1$1.AngularFirestore],
|
|
978
|
+
},
|
|
979
|
+
{
|
|
980
|
+
provide: 'UserRepository',
|
|
981
|
+
useFactory: function (firestore) {
|
|
982
|
+
return new i2.UserFirestoreRepository(firestore.firestore);
|
|
983
|
+
},
|
|
984
|
+
deps: [i1$1.AngularFirestore],
|
|
985
|
+
},
|
|
986
|
+
{
|
|
987
|
+
provide: 'UserAddressRepository',
|
|
988
|
+
useFactory: function (firestore, userRepository) {
|
|
989
|
+
return new i2.UserAddressFirestoreRepository(firestore.firestore, userRepository);
|
|
990
|
+
},
|
|
991
|
+
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
992
|
+
},
|
|
993
|
+
{
|
|
994
|
+
provide: 'UserPaymentMethodRepository',
|
|
995
|
+
useFactory: function (firestore, userRepository) {
|
|
996
|
+
return new i2.UserPaymentMethodFirestoreRepository(firestore.firestore, userRepository);
|
|
997
|
+
},
|
|
998
|
+
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
999
|
+
},
|
|
1000
|
+
{
|
|
1001
|
+
provide: 'VariantRepository',
|
|
1002
|
+
useFactory: function (firestore, productRepository) {
|
|
1003
|
+
return new i2.ProductVariantFirestoreRepository(firestore.firestore, productRepository);
|
|
1004
|
+
},
|
|
1005
|
+
deps: [i1$1.AngularFirestore, 'ProductRepository'],
|
|
1006
|
+
},
|
|
1007
|
+
], imports: [[fire.AngularFireModule]] });
|
|
1008
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularFirestoreModule, decorators: [{
|
|
1009
|
+
type: i0.NgModule,
|
|
1010
|
+
args: [{
|
|
1011
|
+
imports: [fire.AngularFireModule],
|
|
1012
|
+
providers: [
|
|
1013
|
+
{
|
|
1014
|
+
provide: 'BeautyProfileRepository',
|
|
1015
|
+
useFactory: function (firestore, userRepository) {
|
|
1016
|
+
return new i2.UserBeautyProfileFirestoreRepository(firestore.firestore, userRepository);
|
|
1017
|
+
},
|
|
1018
|
+
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1019
|
+
},
|
|
1020
|
+
{
|
|
1021
|
+
provide: 'Buy2WinRepository',
|
|
1022
|
+
useFactory: function (firestore) {
|
|
1023
|
+
return new i2.Buy2WinFirestoreRepository(firestore.firestore);
|
|
1024
|
+
},
|
|
1025
|
+
deps: [i1$1.AngularFirestore],
|
|
1026
|
+
},
|
|
1027
|
+
{
|
|
1028
|
+
provide: 'CategoryRepository',
|
|
1029
|
+
useFactory: function (firestore) {
|
|
1030
|
+
return new i2.CategoryFirestoreRepository(firestore.firestore);
|
|
1031
|
+
},
|
|
1032
|
+
deps: [i1$1.AngularFirestore],
|
|
1033
|
+
},
|
|
1034
|
+
{
|
|
1035
|
+
provide: 'CheckoutRepository',
|
|
1036
|
+
useFactory: function (firestore) {
|
|
1037
|
+
return new i2.CheckoutFirestoreRepository(firestore.firestore);
|
|
1038
|
+
},
|
|
1039
|
+
deps: [i1$1.AngularFirestore],
|
|
1040
|
+
},
|
|
1041
|
+
{
|
|
1042
|
+
provide: 'CheckoutSubscriptionRepository',
|
|
1043
|
+
useFactory: function (firestore) {
|
|
1044
|
+
return new i2.CheckoutSubscriptionFirestoreRepository(firestore.firestore);
|
|
1045
|
+
},
|
|
1046
|
+
deps: [i1$1.AngularFirestore],
|
|
1047
|
+
},
|
|
1048
|
+
{
|
|
1049
|
+
provide: 'CouponRepository',
|
|
1050
|
+
useFactory: function (firestore) {
|
|
1051
|
+
return new i2.CouponFirestoreRepository(firestore.firestore);
|
|
1052
|
+
},
|
|
1053
|
+
deps: [i1$1.AngularFirestore],
|
|
1054
|
+
},
|
|
1055
|
+
{
|
|
1056
|
+
provide: 'EditionRepository',
|
|
1057
|
+
useFactory: function (firestore, subscriptionRepository) {
|
|
1058
|
+
return new i2.SubscriptionEditionFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
1059
|
+
},
|
|
1060
|
+
deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
|
|
1061
|
+
},
|
|
1062
|
+
{
|
|
1063
|
+
provide: 'HomeRepository',
|
|
1064
|
+
useFactory: function (firestore) {
|
|
1065
|
+
return new i2.HomeFirestoreRepository(firestore.firestore);
|
|
1066
|
+
},
|
|
1067
|
+
deps: [i1$1.AngularFirestore],
|
|
1068
|
+
},
|
|
1069
|
+
{
|
|
1070
|
+
provide: 'LeadRepository',
|
|
1071
|
+
useFactory: function (firestore) {
|
|
1072
|
+
return new i2.LeadFirestoreRepository(firestore.firestore);
|
|
1073
|
+
},
|
|
1074
|
+
deps: [i1$1.AngularFirestore],
|
|
1075
|
+
},
|
|
1076
|
+
{
|
|
1077
|
+
provide: 'LegacyOrderRepository',
|
|
1078
|
+
useFactory: function (firestore) {
|
|
1079
|
+
return new i2.LegacyOrderFirestoreRepository(firestore.firestore);
|
|
1080
|
+
},
|
|
1081
|
+
deps: [i1$1.AngularFirestore],
|
|
1082
|
+
},
|
|
1083
|
+
{
|
|
1084
|
+
provide: 'ShopMenuRepository',
|
|
1085
|
+
useFactory: function (firestore) {
|
|
1086
|
+
return new i2.ShopMenuFirestoreRepository(firestore.firestore);
|
|
1087
|
+
},
|
|
1088
|
+
deps: [i1$1.AngularFirestore],
|
|
1089
|
+
},
|
|
1090
|
+
{
|
|
1091
|
+
provide: 'OrderRepository',
|
|
1092
|
+
useFactory: function (firestore) {
|
|
1093
|
+
return new i2.OrderFirestoreRepository(firestore.firestore);
|
|
1094
|
+
},
|
|
1095
|
+
deps: [i1$1.AngularFirestore],
|
|
1096
|
+
},
|
|
1097
|
+
{
|
|
1098
|
+
provide: 'PaymentRepository',
|
|
1099
|
+
useFactory: function (firestore) {
|
|
1100
|
+
return new i2.PaymentFirestoreRepository(firestore.firestore);
|
|
1101
|
+
},
|
|
1102
|
+
deps: [i1$1.AngularFirestore],
|
|
1103
|
+
},
|
|
1104
|
+
{
|
|
1105
|
+
provide: 'ProductRepository',
|
|
1106
|
+
useFactory: function (firestore) {
|
|
1107
|
+
return new i2.ProductFirestoreRepository(firestore.firestore);
|
|
1108
|
+
},
|
|
1109
|
+
deps: [i1$1.AngularFirestore],
|
|
1110
|
+
},
|
|
1111
|
+
{
|
|
1112
|
+
provide: 'SubscriptionPaymentRepository',
|
|
1113
|
+
useFactory: function (firestore, subscriptionRepository) {
|
|
1114
|
+
return new i2.SubscriptionPaymentFirestoreRepository(firestore.firestore, subscriptionRepository);
|
|
1115
|
+
},
|
|
1116
|
+
deps: [i1$1.AngularFirestore, 'SubscriptionRepository'],
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
provide: 'SubscriptionPlanRepository',
|
|
1120
|
+
useFactory: function (firestore) {
|
|
1121
|
+
return new i2.SubscriptionPlanFirestoreRepository(firestore.firestore);
|
|
1122
|
+
},
|
|
1123
|
+
deps: [i1$1.AngularFirestore],
|
|
1124
|
+
},
|
|
1125
|
+
{
|
|
1126
|
+
provide: 'SubscriptionProductRepository',
|
|
1127
|
+
useFactory: function (firestore) {
|
|
1128
|
+
return new i2.SubscriptionProductFirestoreRepository(firestore.firestore);
|
|
1129
|
+
},
|
|
1130
|
+
deps: [i1$1.AngularFirestore],
|
|
1131
|
+
},
|
|
1132
|
+
{
|
|
1133
|
+
provide: 'SubscriptionRepository',
|
|
1134
|
+
useFactory: function (firestore) {
|
|
1135
|
+
return new i2.SubscriptionFirestoreRepository(firestore.firestore);
|
|
1136
|
+
},
|
|
1137
|
+
deps: [i1$1.AngularFirestore],
|
|
1138
|
+
},
|
|
1139
|
+
{
|
|
1140
|
+
provide: 'UserRepository',
|
|
1141
|
+
useFactory: function (firestore) {
|
|
1142
|
+
return new i2.UserFirestoreRepository(firestore.firestore);
|
|
1143
|
+
},
|
|
1144
|
+
deps: [i1$1.AngularFirestore],
|
|
1145
|
+
},
|
|
1146
|
+
{
|
|
1147
|
+
provide: 'UserAddressRepository',
|
|
1148
|
+
useFactory: function (firestore, userRepository) {
|
|
1149
|
+
return new i2.UserAddressFirestoreRepository(firestore.firestore, userRepository);
|
|
1150
|
+
},
|
|
1151
|
+
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1152
|
+
},
|
|
1153
|
+
{
|
|
1154
|
+
provide: 'UserPaymentMethodRepository',
|
|
1155
|
+
useFactory: function (firestore, userRepository) {
|
|
1156
|
+
return new i2.UserPaymentMethodFirestoreRepository(firestore.firestore, userRepository);
|
|
1157
|
+
},
|
|
1158
|
+
deps: [i1$1.AngularFirestore, 'UserRepository'],
|
|
1159
|
+
},
|
|
1160
|
+
{
|
|
1161
|
+
provide: 'VariantRepository',
|
|
1162
|
+
useFactory: function (firestore, productRepository) {
|
|
1163
|
+
return new i2.ProductVariantFirestoreRepository(firestore.firestore, productRepository);
|
|
1164
|
+
},
|
|
1165
|
+
deps: [i1$1.AngularFirestore, 'ProductRepository'],
|
|
1166
|
+
},
|
|
1167
|
+
],
|
|
1168
|
+
}]
|
|
1565
1169
|
}] });
|
|
1566
1170
|
|
|
1567
|
-
var AngularConnectModule = /** @class */ (function () {
|
|
1568
|
-
function AngularConnectModule() {
|
|
1569
|
-
}
|
|
1570
|
-
AngularConnectModule.initializeApp = function (defaultShop, options, nameOrConfig) {
|
|
1571
|
-
return {
|
|
1572
|
-
ngModule: AngularConnectModule,
|
|
1573
|
-
providers: __spreadArray(__spreadArray(__spreadArray(
|
|
1574
|
-
};
|
|
1575
|
-
};
|
|
1576
|
-
return AngularConnectModule;
|
|
1577
|
-
}());
|
|
1578
|
-
AngularConnectModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularConnectModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
1579
|
-
AngularConnectModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularConnectModule, imports: [fire.AngularFireModule, AngularFirestoreModule
|
|
1580
|
-
AngularConnectModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularConnectModule, providers: [
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
OrderService,
|
|
1588
|
-
], imports: [[fire.AngularFireModule, AngularFirestoreModule, AngularHasuraGraphQLModule]] });
|
|
1589
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularConnectModule, decorators: [{
|
|
1590
|
-
type: i0.NgModule,
|
|
1591
|
-
args: [{
|
|
1592
|
-
imports: [fire.AngularFireModule, AngularFirestoreModule, AngularHasuraGraphQLModule],
|
|
1593
|
-
providers: [
|
|
1594
|
-
AuthService,
|
|
1595
|
-
CartService,
|
|
1596
|
-
CheckoutService,
|
|
1597
|
-
CheckoutSubscriptionService,
|
|
1598
|
-
CouponService,
|
|
1599
|
-
HomeShopService,
|
|
1600
|
-
OrderService,
|
|
1601
|
-
],
|
|
1602
|
-
}]
|
|
1171
|
+
var AngularConnectModule = /** @class */ (function () {
|
|
1172
|
+
function AngularConnectModule() {
|
|
1173
|
+
}
|
|
1174
|
+
AngularConnectModule.initializeApp = function (defaultShop, options, nameOrConfig) {
|
|
1175
|
+
return {
|
|
1176
|
+
ngModule: AngularConnectModule,
|
|
1177
|
+
providers: __spreadArray(__spreadArray(__spreadArray([], __read((i2.isNil(defaultShop) ? [] : [{ provide: DEFAULT_SHOP, useValue: defaultShop }]))), __read((i2.isNil(options) ? [] : [{ provide: fire.FIREBASE_OPTIONS, useValue: options }]))), __read((i2.isNil(options) ? [] : [{ provide: fire.FIREBASE_APP_NAME, useValue: nameOrConfig }]))),
|
|
1178
|
+
};
|
|
1179
|
+
};
|
|
1180
|
+
return AngularConnectModule;
|
|
1181
|
+
}());
|
|
1182
|
+
AngularConnectModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularConnectModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
1183
|
+
AngularConnectModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularConnectModule, imports: [fire.AngularFireModule, AngularFirestoreModule] });
|
|
1184
|
+
AngularConnectModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularConnectModule, providers: [AuthService, CartService, StoreCheckoutService, CheckoutSubscriptionService, CouponService, OrderService], imports: [[fire.AngularFireModule, AngularFirestoreModule]] });
|
|
1185
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: AngularConnectModule, decorators: [{
|
|
1186
|
+
type: i0.NgModule,
|
|
1187
|
+
args: [{
|
|
1188
|
+
imports: [fire.AngularFireModule, AngularFirestoreModule],
|
|
1189
|
+
providers: [AuthService, CartService, StoreCheckoutService, CheckoutSubscriptionService, CouponService, OrderService],
|
|
1190
|
+
}]
|
|
1603
1191
|
}] });
|
|
1604
1192
|
|
|
1605
|
-
/**
|
|
1606
|
-
* Generated bundle index. Do not edit.
|
|
1193
|
+
/**
|
|
1194
|
+
* Generated bundle index. Do not edit.
|
|
1607
1195
|
*/
|
|
1608
1196
|
|
|
1609
1197
|
exports.AngularConnectModule = AngularConnectModule;
|
|
1610
1198
|
exports.AngularFirebaseAuthModule = AngularFirebaseAuthModule;
|
|
1611
1199
|
exports.AngularFirestoreModule = AngularFirestoreModule;
|
|
1612
|
-
exports.AngularHasuraGraphQLModule = AngularHasuraGraphQLModule;
|
|
1613
1200
|
exports.AuthService = AuthService;
|
|
1614
1201
|
exports.CartService = CartService;
|
|
1615
|
-
exports.CheckoutService = CheckoutService;
|
|
1616
1202
|
exports.CheckoutSubscriptionService = CheckoutSubscriptionService;
|
|
1617
1203
|
exports.CouponService = CouponService;
|
|
1618
|
-
exports.HomeShopService = HomeShopService;
|
|
1619
1204
|
exports.OrderService = OrderService;
|
|
1205
|
+
exports.StoreCheckoutService = StoreCheckoutService;
|
|
1620
1206
|
|
|
1621
1207
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
1622
1208
|
|