@websolutespa/bom-mixer-models 0.0.1

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.
Files changed (41) hide show
  1. package/.turbo/turbo-build.log +17 -0
  2. package/CHANGELOG.md +7 -0
  3. package/dist/index.d.ts +409 -0
  4. package/dist/index.js +2574 -0
  5. package/dist/index.mjs +2519 -0
  6. package/package.json +54 -0
  7. package/src/cart/cart.ts +31 -0
  8. package/src/category/category.service.ts +43 -0
  9. package/src/category/category.ts +26 -0
  10. package/src/checkout/checkout.service.ts +351 -0
  11. package/src/checkout/checkout.ts +65 -0
  12. package/src/country/country.service.ts +9 -0
  13. package/src/feature_type/feature_type.service.ts +10 -0
  14. package/src/feature_type/feature_type.ts +13 -0
  15. package/src/index.ts +33 -0
  16. package/src/label/label.service.ts +24 -0
  17. package/src/label/label.ts +7 -0
  18. package/src/layout/layout.service.ts +51 -0
  19. package/src/layout/layout.ts +27 -0
  20. package/src/link/link.ts +7 -0
  21. package/src/list/list.service.ts +19 -0
  22. package/src/list/list.ts +11 -0
  23. package/src/locale/locale.service.ts +11 -0
  24. package/src/locale/locale.ts +9 -0
  25. package/src/market/market.service.ts +10 -0
  26. package/src/market/market.ts +11 -0
  27. package/src/media/media.ts +14 -0
  28. package/src/menu/menu.service.ts +22 -0
  29. package/src/menu/menu.ts +11 -0
  30. package/src/order/order.service.ts +29 -0
  31. package/src/order/order.ts +31 -0
  32. package/src/page/page.service.ts +132 -0
  33. package/src/page/page.ts +53 -0
  34. package/src/province/province.service.ts +9 -0
  35. package/src/region/region.service.ts +9 -0
  36. package/src/route/route.interceptor.ts +30 -0
  37. package/src/route/route.service.ts +203 -0
  38. package/src/route/route.ts +29 -0
  39. package/src/store/store.ts +24 -0
  40. package/src/user/user.ts +57 -0
  41. package/tsconfig.json +16 -0
package/dist/index.js ADDED
@@ -0,0 +1,2574 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __commonJS = (cb, mod) => function __require() {
10
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
11
+ };
12
+ var __export = (target, all) => {
13
+ for (var name in all)
14
+ __defProp(target, name, { get: all[name], enumerable: true });
15
+ };
16
+ var __copyProps = (to, from, except, desc) => {
17
+ if (from && typeof from === "object" || typeof from === "function") {
18
+ for (let key of __getOwnPropNames(from))
19
+ if (!__hasOwnProp.call(to, key) && key !== except)
20
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21
+ }
22
+ return to;
23
+ };
24
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
+ // If the importer is in node compatibility mode or this is not an ESM
26
+ // file that has been converted to a CommonJS file using a Babel-
27
+ // compatible transform (i.e. "__esModule" has not been set), then set
28
+ // "default" to the CommonJS "module.exports" for node compatibility.
29
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30
+ mod
31
+ ));
32
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
33
+ var __publicField = (obj, key, value) => {
34
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
35
+ return value;
36
+ };
37
+
38
+ // ../../../../node_modules/next/dist/shared/lib/i18n/detect-domain-locale.js
39
+ var require_detect_domain_locale = __commonJS({
40
+ "../../../../node_modules/next/dist/shared/lib/i18n/detect-domain-locale.js"(exports) {
41
+ "use strict";
42
+ Object.defineProperty(exports, "__esModule", {
43
+ value: true
44
+ });
45
+ exports.detectDomainLocale = detectDomainLocale;
46
+ function detectDomainLocale(domainItems, hostname, detectedLocale) {
47
+ let domainItem;
48
+ if (domainItems) {
49
+ if (detectedLocale) {
50
+ detectedLocale = detectedLocale.toLowerCase();
51
+ }
52
+ for (const item of domainItems) {
53
+ var ref, ref1;
54
+ const domainHostname = (ref = item.domain) == null ? void 0 : ref.split(":")[0].toLowerCase();
55
+ if (hostname === domainHostname || detectedLocale === item.defaultLocale.toLowerCase() || ((ref1 = item.locales) == null ? void 0 : ref1.some((locale) => locale.toLowerCase() === detectedLocale))) {
56
+ domainItem = item;
57
+ break;
58
+ }
59
+ }
60
+ }
61
+ return domainItem;
62
+ }
63
+ }
64
+ });
65
+
66
+ // ../../../../node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js
67
+ var require_remove_trailing_slash = __commonJS({
68
+ "../../../../node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js"(exports) {
69
+ "use strict";
70
+ Object.defineProperty(exports, "__esModule", {
71
+ value: true
72
+ });
73
+ exports.removeTrailingSlash = removeTrailingSlash;
74
+ function removeTrailingSlash(route) {
75
+ return route.replace(/\/$/, "") || "/";
76
+ }
77
+ }
78
+ });
79
+
80
+ // ../../../../node_modules/next/dist/shared/lib/router/utils/parse-path.js
81
+ var require_parse_path = __commonJS({
82
+ "../../../../node_modules/next/dist/shared/lib/router/utils/parse-path.js"(exports) {
83
+ "use strict";
84
+ Object.defineProperty(exports, "__esModule", {
85
+ value: true
86
+ });
87
+ exports.parsePath = parsePath;
88
+ function parsePath(path) {
89
+ const hashIndex = path.indexOf("#");
90
+ const queryIndex = path.indexOf("?");
91
+ const hasQuery = queryIndex > -1 && (hashIndex < 0 || queryIndex < hashIndex);
92
+ if (hasQuery || hashIndex > -1) {
93
+ return {
94
+ pathname: path.substring(0, hasQuery ? queryIndex : hashIndex),
95
+ query: hasQuery ? path.substring(queryIndex, hashIndex > -1 ? hashIndex : void 0) : "",
96
+ hash: hashIndex > -1 ? path.slice(hashIndex) : ""
97
+ };
98
+ }
99
+ return {
100
+ pathname: path,
101
+ query: "",
102
+ hash: ""
103
+ };
104
+ }
105
+ }
106
+ });
107
+
108
+ // ../../../../node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js
109
+ var require_add_path_prefix = __commonJS({
110
+ "../../../../node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js"(exports) {
111
+ "use strict";
112
+ Object.defineProperty(exports, "__esModule", {
113
+ value: true
114
+ });
115
+ exports.addPathPrefix = addPathPrefix;
116
+ var _parsePath = require_parse_path();
117
+ function addPathPrefix(path, prefix) {
118
+ if (!path.startsWith("/") || !prefix) {
119
+ return path;
120
+ }
121
+ const { pathname, query, hash } = (0, _parsePath).parsePath(path);
122
+ return `${prefix}${pathname}${query}${hash}`;
123
+ }
124
+ }
125
+ });
126
+
127
+ // ../../../../node_modules/next/dist/shared/lib/router/utils/add-path-suffix.js
128
+ var require_add_path_suffix = __commonJS({
129
+ "../../../../node_modules/next/dist/shared/lib/router/utils/add-path-suffix.js"(exports) {
130
+ "use strict";
131
+ Object.defineProperty(exports, "__esModule", {
132
+ value: true
133
+ });
134
+ exports.addPathSuffix = addPathSuffix;
135
+ var _parsePath = require_parse_path();
136
+ function addPathSuffix(path, suffix) {
137
+ if (!path.startsWith("/") || !suffix) {
138
+ return path;
139
+ }
140
+ const { pathname, query, hash } = (0, _parsePath).parsePath(path);
141
+ return `${pathname}${suffix}${query}${hash}`;
142
+ }
143
+ }
144
+ });
145
+
146
+ // ../../../../node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js
147
+ var require_path_has_prefix = __commonJS({
148
+ "../../../../node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js"(exports) {
149
+ "use strict";
150
+ Object.defineProperty(exports, "__esModule", {
151
+ value: true
152
+ });
153
+ exports.pathHasPrefix = pathHasPrefix;
154
+ var _parsePath = require_parse_path();
155
+ function pathHasPrefix(path, prefix) {
156
+ if (typeof path !== "string") {
157
+ return false;
158
+ }
159
+ const { pathname } = (0, _parsePath).parsePath(path);
160
+ return pathname === prefix || pathname.startsWith(prefix + "/");
161
+ }
162
+ }
163
+ });
164
+
165
+ // ../../../../node_modules/next/dist/shared/lib/router/utils/add-locale.js
166
+ var require_add_locale = __commonJS({
167
+ "../../../../node_modules/next/dist/shared/lib/router/utils/add-locale.js"(exports) {
168
+ "use strict";
169
+ Object.defineProperty(exports, "__esModule", {
170
+ value: true
171
+ });
172
+ exports.addLocale = addLocale;
173
+ var _addPathPrefix = require_add_path_prefix();
174
+ var _pathHasPrefix = require_path_has_prefix();
175
+ function addLocale(path, locale, defaultLocale, ignorePrefix) {
176
+ if (locale && locale !== defaultLocale && (ignorePrefix || !(0, _pathHasPrefix).pathHasPrefix(path.toLowerCase(), `/${locale.toLowerCase()}`) && !(0, _pathHasPrefix).pathHasPrefix(path.toLowerCase(), "/api"))) {
177
+ return (0, _addPathPrefix).addPathPrefix(path, `/${locale}`);
178
+ }
179
+ return path;
180
+ }
181
+ }
182
+ });
183
+
184
+ // ../../../../node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.js
185
+ var require_format_next_pathname_info = __commonJS({
186
+ "../../../../node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.js"(exports) {
187
+ "use strict";
188
+ Object.defineProperty(exports, "__esModule", {
189
+ value: true
190
+ });
191
+ exports.formatNextPathnameInfo = formatNextPathnameInfo;
192
+ var _removeTrailingSlash = require_remove_trailing_slash();
193
+ var _addPathPrefix = require_add_path_prefix();
194
+ var _addPathSuffix = require_add_path_suffix();
195
+ var _addLocale = require_add_locale();
196
+ function formatNextPathnameInfo(info) {
197
+ let pathname = (0, _addLocale).addLocale(info.pathname, info.locale, info.buildId ? void 0 : info.defaultLocale, info.ignorePrefix);
198
+ if (info.buildId) {
199
+ pathname = (0, _addPathSuffix).addPathSuffix((0, _addPathPrefix).addPathPrefix(pathname, `/_next/data/${info.buildId}`), info.pathname === "/" ? "index.json" : ".json");
200
+ }
201
+ pathname = (0, _addPathPrefix).addPathPrefix(pathname, info.basePath);
202
+ return info.trailingSlash ? !info.buildId && !pathname.endsWith("/") ? (0, _addPathSuffix).addPathSuffix(pathname, "/") : pathname : (0, _removeTrailingSlash).removeTrailingSlash(pathname);
203
+ }
204
+ }
205
+ });
206
+
207
+ // ../../../../node_modules/next/dist/shared/lib/get-hostname.js
208
+ var require_get_hostname = __commonJS({
209
+ "../../../../node_modules/next/dist/shared/lib/get-hostname.js"(exports) {
210
+ "use strict";
211
+ Object.defineProperty(exports, "__esModule", {
212
+ value: true
213
+ });
214
+ exports.getHostname = getHostname;
215
+ function getHostname(parsed, headers) {
216
+ var ref;
217
+ return (ref = !Array.isArray(headers == null ? void 0 : headers.host) && (headers == null ? void 0 : headers.host) || parsed.hostname) == null ? void 0 : ref.split(":")[0].toLowerCase();
218
+ }
219
+ }
220
+ });
221
+
222
+ // ../../../../node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js
223
+ var require_normalize_locale_path = __commonJS({
224
+ "../../../../node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js"(exports) {
225
+ "use strict";
226
+ Object.defineProperty(exports, "__esModule", {
227
+ value: true
228
+ });
229
+ exports.normalizeLocalePath = normalizeLocalePath;
230
+ function normalizeLocalePath(pathname, locales) {
231
+ let detectedLocale;
232
+ const pathnameParts = pathname.split("/");
233
+ (locales || []).some((locale) => {
234
+ if (pathnameParts[1] && pathnameParts[1].toLowerCase() === locale.toLowerCase()) {
235
+ detectedLocale = locale;
236
+ pathnameParts.splice(1, 1);
237
+ pathname = pathnameParts.join("/") || "/";
238
+ return true;
239
+ }
240
+ return false;
241
+ });
242
+ return {
243
+ pathname,
244
+ detectedLocale
245
+ };
246
+ }
247
+ }
248
+ });
249
+
250
+ // ../../../../node_modules/next/dist/shared/lib/router/utils/remove-path-prefix.js
251
+ var require_remove_path_prefix = __commonJS({
252
+ "../../../../node_modules/next/dist/shared/lib/router/utils/remove-path-prefix.js"(exports) {
253
+ "use strict";
254
+ Object.defineProperty(exports, "__esModule", {
255
+ value: true
256
+ });
257
+ exports.removePathPrefix = removePathPrefix;
258
+ var _pathHasPrefix = require_path_has_prefix();
259
+ function removePathPrefix(path, prefix) {
260
+ if ((0, _pathHasPrefix).pathHasPrefix(path, prefix)) {
261
+ const withoutPrefix = path.slice(prefix.length);
262
+ return withoutPrefix.startsWith("/") ? withoutPrefix : `/${withoutPrefix}`;
263
+ }
264
+ return path;
265
+ }
266
+ }
267
+ });
268
+
269
+ // ../../../../node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info.js
270
+ var require_get_next_pathname_info = __commonJS({
271
+ "../../../../node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info.js"(exports) {
272
+ "use strict";
273
+ Object.defineProperty(exports, "__esModule", {
274
+ value: true
275
+ });
276
+ exports.getNextPathnameInfo = getNextPathnameInfo;
277
+ var _normalizeLocalePath = require_normalize_locale_path();
278
+ var _removePathPrefix = require_remove_path_prefix();
279
+ var _pathHasPrefix = require_path_has_prefix();
280
+ function getNextPathnameInfo(pathname, options) {
281
+ var _nextConfig;
282
+ const { basePath, i18n, trailingSlash } = (_nextConfig = options.nextConfig) != null ? _nextConfig : {};
283
+ const info = {
284
+ pathname,
285
+ trailingSlash: pathname !== "/" ? pathname.endsWith("/") : trailingSlash
286
+ };
287
+ if (basePath && (0, _pathHasPrefix).pathHasPrefix(info.pathname, basePath)) {
288
+ info.pathname = (0, _removePathPrefix).removePathPrefix(info.pathname, basePath);
289
+ info.basePath = basePath;
290
+ }
291
+ if (options.parseData === true && info.pathname.startsWith("/_next/data/") && info.pathname.endsWith(".json")) {
292
+ const paths = info.pathname.replace(/^\/_next\/data\//, "").replace(/\.json$/, "").split("/");
293
+ const buildId = paths[0];
294
+ info.pathname = paths[1] !== "index" ? `/${paths.slice(1).join("/")}` : "/";
295
+ info.buildId = buildId;
296
+ }
297
+ if (i18n) {
298
+ const pathLocale = (0, _normalizeLocalePath).normalizeLocalePath(info.pathname, i18n.locales);
299
+ info.locale = pathLocale == null ? void 0 : pathLocale.detectedLocale;
300
+ info.pathname = (pathLocale == null ? void 0 : pathLocale.pathname) || info.pathname;
301
+ }
302
+ return info;
303
+ }
304
+ }
305
+ });
306
+
307
+ // ../../../../node_modules/next/dist/server/web/next-url.js
308
+ var require_next_url = __commonJS({
309
+ "../../../../node_modules/next/dist/server/web/next-url.js"(exports) {
310
+ "use strict";
311
+ Object.defineProperty(exports, "__esModule", {
312
+ value: true
313
+ });
314
+ var _detectDomainLocale = require_detect_domain_locale();
315
+ var _formatNextPathnameInfo = require_format_next_pathname_info();
316
+ var _getHostname = require_get_hostname();
317
+ var _getNextPathnameInfo = require_get_next_pathname_info();
318
+ var FLIGHT_PARAMETERS = [
319
+ "__flight__",
320
+ "__flight_router_state_tree__",
321
+ "__flight_prefetch__"
322
+ ];
323
+ var REGEX_LOCALHOST_HOSTNAME = /(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|::1|localhost)/;
324
+ function parseURL(url, base) {
325
+ return new URL(String(url).replace(REGEX_LOCALHOST_HOSTNAME, "localhost"), base && String(base).replace(REGEX_LOCALHOST_HOSTNAME, "localhost"));
326
+ }
327
+ function parseFlightParameters(searchParams) {
328
+ let flightSearchParameters = {};
329
+ let flightSearchParametersUpdated = false;
330
+ for (const name of FLIGHT_PARAMETERS) {
331
+ const value = searchParams.get(name);
332
+ if (value === null) {
333
+ continue;
334
+ }
335
+ flightSearchParameters[name] = value;
336
+ flightSearchParametersUpdated = true;
337
+ }
338
+ if (!flightSearchParametersUpdated) {
339
+ return void 0;
340
+ }
341
+ return flightSearchParameters;
342
+ }
343
+ var Internal = Symbol("NextURLInternal");
344
+ var NextURL = class {
345
+ constructor(input, baseOrOpts, opts) {
346
+ let base;
347
+ let options;
348
+ if (typeof baseOrOpts === "object" && "pathname" in baseOrOpts || typeof baseOrOpts === "string") {
349
+ base = baseOrOpts;
350
+ options = opts || {};
351
+ } else {
352
+ options = opts || baseOrOpts || {};
353
+ }
354
+ this[Internal] = {
355
+ url: parseURL(input, base != null ? base : options.base),
356
+ options,
357
+ basePath: ""
358
+ };
359
+ this.analyzeUrl();
360
+ }
361
+ analyzeUrl() {
362
+ var ref, ref1, ref2, ref3, ref4;
363
+ const pathnameInfo = (0, _getNextPathnameInfo).getNextPathnameInfo(this[Internal].url.pathname, {
364
+ nextConfig: this[Internal].options.nextConfig,
365
+ parseData: !process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE
366
+ });
367
+ this[Internal].domainLocale = (0, _detectDomainLocale).detectDomainLocale((ref = this[Internal].options.nextConfig) == null ? void 0 : (ref1 = ref.i18n) == null ? void 0 : ref1.domains, (0, _getHostname).getHostname(this[Internal].url, this[Internal].options.headers));
368
+ const defaultLocale = ((ref2 = this[Internal].domainLocale) == null ? void 0 : ref2.defaultLocale) || ((ref3 = this[Internal].options.nextConfig) == null ? void 0 : (ref4 = ref3.i18n) == null ? void 0 : ref4.defaultLocale);
369
+ this[Internal].url.pathname = pathnameInfo.pathname;
370
+ this[Internal].defaultLocale = defaultLocale;
371
+ var _basePath;
372
+ this[Internal].basePath = (_basePath = pathnameInfo.basePath) != null ? _basePath : "";
373
+ this[Internal].buildId = pathnameInfo.buildId;
374
+ var _locale;
375
+ this[Internal].locale = (_locale = pathnameInfo.locale) != null ? _locale : defaultLocale;
376
+ this[Internal].trailingSlash = pathnameInfo.trailingSlash;
377
+ this[Internal].flightSearchParameters = parseFlightParameters(this[Internal].url.searchParams);
378
+ }
379
+ formatPathname() {
380
+ return (0, _formatNextPathnameInfo).formatNextPathnameInfo({
381
+ basePath: this[Internal].basePath,
382
+ buildId: this[Internal].buildId,
383
+ defaultLocale: !this[Internal].options.forceLocale ? this[Internal].defaultLocale : void 0,
384
+ locale: this[Internal].locale,
385
+ pathname: this[Internal].url.pathname,
386
+ trailingSlash: this[Internal].trailingSlash
387
+ });
388
+ }
389
+ formatSearch() {
390
+ const flightSearchParameters = this[Internal].flightSearchParameters;
391
+ if (!flightSearchParameters) {
392
+ return this[Internal].url.search;
393
+ }
394
+ const searchParams = new URLSearchParams(this[Internal].url.searchParams);
395
+ for (const name in flightSearchParameters) {
396
+ searchParams.set(name, flightSearchParameters[name]);
397
+ }
398
+ const params = searchParams.toString();
399
+ return params === "" ? "" : `?${params}`;
400
+ }
401
+ get buildId() {
402
+ return this[Internal].buildId;
403
+ }
404
+ set buildId(buildId) {
405
+ this[Internal].buildId = buildId;
406
+ }
407
+ get flightSearchParameters() {
408
+ return this[Internal].flightSearchParameters;
409
+ }
410
+ set flightSearchParameters(flightSearchParams) {
411
+ if (flightSearchParams) {
412
+ for (const name of FLIGHT_PARAMETERS) {
413
+ if (flightSearchParams[name]) {
414
+ this[Internal].url.searchParams.set(name, flightSearchParams[name]);
415
+ } else {
416
+ this[Internal].url.searchParams.delete(name);
417
+ }
418
+ }
419
+ } else {
420
+ for (const name of FLIGHT_PARAMETERS) {
421
+ this[Internal].url.searchParams.delete(name);
422
+ }
423
+ }
424
+ this[Internal].flightSearchParameters = flightSearchParams;
425
+ }
426
+ get locale() {
427
+ var _locale;
428
+ return (_locale = this[Internal].locale) != null ? _locale : "";
429
+ }
430
+ set locale(locale) {
431
+ var ref, ref5;
432
+ if (!this[Internal].locale || !((ref = this[Internal].options.nextConfig) == null ? void 0 : (ref5 = ref.i18n) == null ? void 0 : ref5.locales.includes(locale))) {
433
+ throw new TypeError(`The NextURL configuration includes no locale "${locale}"`);
434
+ }
435
+ this[Internal].locale = locale;
436
+ }
437
+ get defaultLocale() {
438
+ return this[Internal].defaultLocale;
439
+ }
440
+ get domainLocale() {
441
+ return this[Internal].domainLocale;
442
+ }
443
+ get searchParams() {
444
+ return this[Internal].url.searchParams;
445
+ }
446
+ get host() {
447
+ return this[Internal].url.host;
448
+ }
449
+ set host(value) {
450
+ this[Internal].url.host = value;
451
+ }
452
+ get hostname() {
453
+ return this[Internal].url.hostname;
454
+ }
455
+ set hostname(value) {
456
+ this[Internal].url.hostname = value;
457
+ }
458
+ get port() {
459
+ return this[Internal].url.port;
460
+ }
461
+ set port(value) {
462
+ this[Internal].url.port = value;
463
+ }
464
+ get protocol() {
465
+ return this[Internal].url.protocol;
466
+ }
467
+ set protocol(value) {
468
+ this[Internal].url.protocol = value;
469
+ }
470
+ get href() {
471
+ const pathname = this.formatPathname();
472
+ const search = this.formatSearch();
473
+ return `${this.protocol}//${this.host}${pathname}${search}`;
474
+ }
475
+ set href(url) {
476
+ this[Internal].url = parseURL(url);
477
+ this.analyzeUrl();
478
+ }
479
+ get origin() {
480
+ return this[Internal].url.origin;
481
+ }
482
+ get pathname() {
483
+ return this[Internal].url.pathname;
484
+ }
485
+ set pathname(value) {
486
+ this[Internal].url.pathname = value;
487
+ }
488
+ get hash() {
489
+ return this[Internal].url.hash;
490
+ }
491
+ set hash(value) {
492
+ this[Internal].url.hash = value;
493
+ }
494
+ get search() {
495
+ return this[Internal].url.search;
496
+ }
497
+ set search(value) {
498
+ this[Internal].url.search = value;
499
+ }
500
+ get password() {
501
+ return this[Internal].url.password;
502
+ }
503
+ set password(value) {
504
+ this[Internal].url.password = value;
505
+ }
506
+ get username() {
507
+ return this[Internal].url.username;
508
+ }
509
+ set username(value) {
510
+ this[Internal].url.username = value;
511
+ }
512
+ get basePath() {
513
+ return this[Internal].basePath;
514
+ }
515
+ set basePath(value) {
516
+ this[Internal].basePath = value.startsWith("/") ? value : `/${value}`;
517
+ }
518
+ toString() {
519
+ return this.href;
520
+ }
521
+ toJSON() {
522
+ return this.href;
523
+ }
524
+ [Symbol.for("edge-runtime.inspect.custom")]() {
525
+ return {
526
+ href: this.href,
527
+ origin: this.origin,
528
+ protocol: this.protocol,
529
+ username: this.username,
530
+ password: this.password,
531
+ host: this.host,
532
+ hostname: this.hostname,
533
+ port: this.port,
534
+ pathname: this.pathname,
535
+ search: this.search,
536
+ searchParams: this.searchParams,
537
+ hash: this.hash
538
+ };
539
+ }
540
+ clone() {
541
+ return new NextURL(String(this), this[Internal].options);
542
+ }
543
+ };
544
+ exports.NextURL = NextURL;
545
+ }
546
+ });
547
+
548
+ // ../../../../node_modules/next/dist/server/web/utils.js
549
+ var require_utils = __commonJS({
550
+ "../../../../node_modules/next/dist/server/web/utils.js"(exports) {
551
+ "use strict";
552
+ Object.defineProperty(exports, "__esModule", {
553
+ value: true
554
+ });
555
+ exports.fromNodeHeaders = fromNodeHeaders;
556
+ exports.splitCookiesString = splitCookiesString;
557
+ exports.toNodeHeaders = toNodeHeaders;
558
+ exports.validateURL = validateURL;
559
+ function fromNodeHeaders(object) {
560
+ const headers = new Headers();
561
+ for (let [key, value] of Object.entries(object)) {
562
+ const values = Array.isArray(value) ? value : [
563
+ value
564
+ ];
565
+ for (let v of values) {
566
+ if (v !== void 0) {
567
+ headers.append(key, v);
568
+ }
569
+ }
570
+ }
571
+ return headers;
572
+ }
573
+ function splitCookiesString(cookiesString) {
574
+ var cookiesStrings = [];
575
+ var pos = 0;
576
+ var start;
577
+ var ch;
578
+ var lastComma;
579
+ var nextStart;
580
+ var cookiesSeparatorFound;
581
+ function skipWhitespace() {
582
+ while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
583
+ pos += 1;
584
+ }
585
+ return pos < cookiesString.length;
586
+ }
587
+ function notSpecialChar() {
588
+ ch = cookiesString.charAt(pos);
589
+ return ch !== "=" && ch !== ";" && ch !== ",";
590
+ }
591
+ while (pos < cookiesString.length) {
592
+ start = pos;
593
+ cookiesSeparatorFound = false;
594
+ while (skipWhitespace()) {
595
+ ch = cookiesString.charAt(pos);
596
+ if (ch === ",") {
597
+ lastComma = pos;
598
+ pos += 1;
599
+ skipWhitespace();
600
+ nextStart = pos;
601
+ while (pos < cookiesString.length && notSpecialChar()) {
602
+ pos += 1;
603
+ }
604
+ if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
605
+ cookiesSeparatorFound = true;
606
+ pos = nextStart;
607
+ cookiesStrings.push(cookiesString.substring(start, lastComma));
608
+ start = pos;
609
+ } else {
610
+ pos = lastComma + 1;
611
+ }
612
+ } else {
613
+ pos += 1;
614
+ }
615
+ }
616
+ if (!cookiesSeparatorFound || pos >= cookiesString.length) {
617
+ cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
618
+ }
619
+ }
620
+ return cookiesStrings;
621
+ }
622
+ function toNodeHeaders(headers) {
623
+ const result = {};
624
+ if (headers) {
625
+ for (const [key, value] of headers.entries()) {
626
+ result[key] = value;
627
+ if (key.toLowerCase() === "set-cookie") {
628
+ result[key] = splitCookiesString(value);
629
+ }
630
+ }
631
+ }
632
+ return result;
633
+ }
634
+ function validateURL(url) {
635
+ try {
636
+ return String(new URL(String(url)));
637
+ } catch (error) {
638
+ throw new Error(`URLs is malformed. Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`, {
639
+ cause: error
640
+ });
641
+ }
642
+ }
643
+ }
644
+ });
645
+
646
+ // ../../../../node_modules/next/dist/server/web/error.js
647
+ var require_error = __commonJS({
648
+ "../../../../node_modules/next/dist/server/web/error.js"(exports) {
649
+ "use strict";
650
+ Object.defineProperty(exports, "__esModule", {
651
+ value: true
652
+ });
653
+ var PageSignatureError = class extends Error {
654
+ constructor({ page }) {
655
+ super(`The middleware "${page}" accepts an async API directly with the form:
656
+
657
+ export function middleware(request, event) {
658
+ return NextResponse.redirect('/new-location')
659
+ }
660
+
661
+ Read more: https://nextjs.org/docs/messages/middleware-new-signature
662
+ `);
663
+ }
664
+ };
665
+ exports.PageSignatureError = PageSignatureError;
666
+ var RemovedPageError = class extends Error {
667
+ constructor() {
668
+ super(`The request.page has been deprecated in favour of \`URLPattern\`.
669
+ Read more: https://nextjs.org/docs/messages/middleware-request-page
670
+ `);
671
+ }
672
+ };
673
+ exports.RemovedPageError = RemovedPageError;
674
+ var RemovedUAError = class extends Error {
675
+ constructor() {
676
+ super(`The request.ua has been removed in favour of \`userAgent\` function.
677
+ Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent
678
+ `);
679
+ }
680
+ };
681
+ exports.RemovedUAError = RemovedUAError;
682
+ }
683
+ });
684
+
685
+ // ../../../../node_modules/next/dist/compiled/cookie/index.js
686
+ var require_cookie = __commonJS({
687
+ "../../../../node_modules/next/dist/compiled/cookie/index.js"(exports, module2) {
688
+ (() => {
689
+ "use strict";
690
+ if (typeof __nccwpck_require__ !== "undefined")
691
+ __nccwpck_require__.ab = __dirname + "/";
692
+ var e = {};
693
+ (() => {
694
+ var r = e;
695
+ r.parse = parse;
696
+ r.serialize = serialize;
697
+ var i = decodeURIComponent;
698
+ var t = encodeURIComponent;
699
+ var a = /; */;
700
+ var n = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
701
+ function parse(e2, r2) {
702
+ if (typeof e2 !== "string") {
703
+ throw new TypeError("argument str must be a string");
704
+ }
705
+ var t2 = {};
706
+ var n2 = r2 || {};
707
+ var o = e2.split(a);
708
+ var s = n2.decode || i;
709
+ for (var p = 0; p < o.length; p++) {
710
+ var f = o[p];
711
+ var u = f.indexOf("=");
712
+ if (u < 0) {
713
+ continue;
714
+ }
715
+ var v = f.substr(0, u).trim();
716
+ var c = f.substr(++u, f.length).trim();
717
+ if ('"' == c[0]) {
718
+ c = c.slice(1, -1);
719
+ }
720
+ if (void 0 == t2[v]) {
721
+ t2[v] = tryDecode(c, s);
722
+ }
723
+ }
724
+ return t2;
725
+ }
726
+ function serialize(e2, r2, i2) {
727
+ var a2 = i2 || {};
728
+ var o = a2.encode || t;
729
+ if (typeof o !== "function") {
730
+ throw new TypeError("option encode is invalid");
731
+ }
732
+ if (!n.test(e2)) {
733
+ throw new TypeError("argument name is invalid");
734
+ }
735
+ var s = o(r2);
736
+ if (s && !n.test(s)) {
737
+ throw new TypeError("argument val is invalid");
738
+ }
739
+ var p = e2 + "=" + s;
740
+ if (null != a2.maxAge) {
741
+ var f = a2.maxAge - 0;
742
+ if (isNaN(f) || !isFinite(f)) {
743
+ throw new TypeError("option maxAge is invalid");
744
+ }
745
+ p += "; Max-Age=" + Math.floor(f);
746
+ }
747
+ if (a2.domain) {
748
+ if (!n.test(a2.domain)) {
749
+ throw new TypeError("option domain is invalid");
750
+ }
751
+ p += "; Domain=" + a2.domain;
752
+ }
753
+ if (a2.path) {
754
+ if (!n.test(a2.path)) {
755
+ throw new TypeError("option path is invalid");
756
+ }
757
+ p += "; Path=" + a2.path;
758
+ }
759
+ if (a2.expires) {
760
+ if (typeof a2.expires.toUTCString !== "function") {
761
+ throw new TypeError("option expires is invalid");
762
+ }
763
+ p += "; Expires=" + a2.expires.toUTCString();
764
+ }
765
+ if (a2.httpOnly) {
766
+ p += "; HttpOnly";
767
+ }
768
+ if (a2.secure) {
769
+ p += "; Secure";
770
+ }
771
+ if (a2.sameSite) {
772
+ var u = typeof a2.sameSite === "string" ? a2.sameSite.toLowerCase() : a2.sameSite;
773
+ switch (u) {
774
+ case true:
775
+ p += "; SameSite=Strict";
776
+ break;
777
+ case "lax":
778
+ p += "; SameSite=Lax";
779
+ break;
780
+ case "strict":
781
+ p += "; SameSite=Strict";
782
+ break;
783
+ case "none":
784
+ p += "; SameSite=None";
785
+ break;
786
+ default:
787
+ throw new TypeError("option sameSite is invalid");
788
+ }
789
+ }
790
+ return p;
791
+ }
792
+ function tryDecode(e2, r2) {
793
+ try {
794
+ return r2(e2);
795
+ } catch (r3) {
796
+ return e2;
797
+ }
798
+ }
799
+ })();
800
+ module2.exports = e;
801
+ })();
802
+ }
803
+ });
804
+
805
+ // ../../../../node_modules/next/dist/server/web/spec-extension/cookies.js
806
+ var require_cookies = __commonJS({
807
+ "../../../../node_modules/next/dist/server/web/spec-extension/cookies.js"(exports) {
808
+ "use strict";
809
+ Object.defineProperty(exports, "__esModule", {
810
+ value: true
811
+ });
812
+ var _cookie = _interopRequireDefault(require_cookie());
813
+ function _interopRequireDefault(obj) {
814
+ return obj && obj.__esModule ? obj : {
815
+ default: obj
816
+ };
817
+ }
818
+ var normalizeCookieOptions = (options) => {
819
+ options = Object.assign({}, options);
820
+ if (options.maxAge) {
821
+ options.expires = new Date(Date.now() + options.maxAge * 1e3);
822
+ }
823
+ if (options.path == null) {
824
+ options.path = "/";
825
+ }
826
+ return options;
827
+ };
828
+ var serializeValue = (value) => typeof value === "object" ? `j:${JSON.stringify(value)}` : String(value);
829
+ var serializeExpiredCookie = (key, options = {}) => _cookie.default.serialize(key, "", {
830
+ expires: /* @__PURE__ */ new Date(0),
831
+ path: "/",
832
+ ...options
833
+ });
834
+ var deserializeCookie = (input) => {
835
+ const value = input.headers.get("set-cookie");
836
+ return value !== void 0 && value !== null ? value.split(", ") : [];
837
+ };
838
+ var serializeCookie = (input) => input.join(", ");
839
+ var Cookies = class extends Map {
840
+ constructor(input) {
841
+ const parsedInput = typeof input === "string" ? _cookie.default.parse(input) : {};
842
+ super(Object.entries(parsedInput));
843
+ }
844
+ set(key, value, options = {}) {
845
+ return super.set(key, _cookie.default.serialize(key, serializeValue(value), normalizeCookieOptions(options)));
846
+ }
847
+ [Symbol.for("edge-runtime.inspect.custom")]() {
848
+ return Object.fromEntries(this.entries());
849
+ }
850
+ };
851
+ exports.Cookies = Cookies;
852
+ var NextCookies = class extends Cookies {
853
+ constructor(response) {
854
+ super(response.headers.get("cookie"));
855
+ __publicField(this, "get", (...args) => {
856
+ return this.getWithOptions(...args).value;
857
+ });
858
+ __publicField(this, "getWithOptions", (...args) => {
859
+ const raw = super.get(...args);
860
+ if (typeof raw !== "string")
861
+ return {
862
+ value: raw,
863
+ options: {}
864
+ };
865
+ const { [args[0]]: value, ...options } = _cookie.default.parse(raw);
866
+ return {
867
+ value,
868
+ options
869
+ };
870
+ });
871
+ __publicField(this, "set", (...args) => {
872
+ const isAlreadyAdded = super.has(args[0]);
873
+ super.set(...args);
874
+ const currentCookie = super.get(args[0]);
875
+ if (typeof currentCookie !== "string") {
876
+ throw new Error(`Invariant: failed to generate cookie for ${JSON.stringify(args)}`);
877
+ }
878
+ if (isAlreadyAdded) {
879
+ const setCookie = serializeCookie(deserializeCookie(this.response).filter((value) => !value.startsWith(`${args[0]}=`)));
880
+ if (setCookie) {
881
+ this.response.headers.set("set-cookie", [
882
+ currentCookie,
883
+ setCookie
884
+ ].join(", "));
885
+ } else {
886
+ this.response.headers.set("set-cookie", currentCookie);
887
+ }
888
+ } else {
889
+ this.response.headers.append("set-cookie", currentCookie);
890
+ }
891
+ return this;
892
+ });
893
+ __publicField(this, "delete", (key, options = {}) => {
894
+ const isDeleted = super.delete(key);
895
+ if (isDeleted) {
896
+ const setCookie = serializeCookie(deserializeCookie(this.response).filter((value) => !value.startsWith(`${key}=`)));
897
+ const expiredCookie = serializeExpiredCookie(key, options);
898
+ this.response.headers.set("set-cookie", [
899
+ expiredCookie,
900
+ setCookie
901
+ ].join(", "));
902
+ }
903
+ return isDeleted;
904
+ });
905
+ __publicField(this, "clear", (options = {}) => {
906
+ const expiredCookies = Array.from(super.keys()).map((key) => serializeExpiredCookie(key, options)).join(", ");
907
+ if (expiredCookies)
908
+ this.response.headers.set("set-cookie", expiredCookies);
909
+ return super.clear();
910
+ });
911
+ this.response = response;
912
+ }
913
+ };
914
+ exports.NextCookies = NextCookies;
915
+ }
916
+ });
917
+
918
+ // ../../../../node_modules/next/dist/server/web/spec-extension/request.js
919
+ var require_request = __commonJS({
920
+ "../../../../node_modules/next/dist/server/web/spec-extension/request.js"(exports) {
921
+ "use strict";
922
+ Object.defineProperty(exports, "__esModule", {
923
+ value: true
924
+ });
925
+ exports.INTERNALS = void 0;
926
+ var _nextUrl = require_next_url();
927
+ var _utils = require_utils();
928
+ var _error = require_error();
929
+ var _cookies = require_cookies();
930
+ var INTERNALS = Symbol("internal request");
931
+ exports.INTERNALS = INTERNALS;
932
+ var NextRequest2 = class extends Request {
933
+ constructor(input, init = {}) {
934
+ const url = typeof input !== "string" && "url" in input ? input.url : String(input);
935
+ (0, _utils).validateURL(url);
936
+ super(url, init);
937
+ this[INTERNALS] = {
938
+ cookies: new _cookies.NextCookies(this),
939
+ geo: init.geo || {},
940
+ ip: init.ip,
941
+ url: new _nextUrl.NextURL(url, {
942
+ headers: (0, _utils).toNodeHeaders(this.headers),
943
+ nextConfig: init.nextConfig
944
+ })
945
+ };
946
+ }
947
+ [Symbol.for("edge-runtime.inspect.custom")]() {
948
+ return {
949
+ cookies: this.cookies,
950
+ geo: this.geo,
951
+ ip: this.ip,
952
+ nextUrl: this.nextUrl,
953
+ url: this.url,
954
+ // rest of props come from Request
955
+ bodyUsed: this.bodyUsed,
956
+ cache: this.cache,
957
+ credentials: this.credentials,
958
+ destination: this.destination,
959
+ headers: Object.fromEntries(this.headers),
960
+ integrity: this.integrity,
961
+ keepalive: this.keepalive,
962
+ method: this.method,
963
+ mode: this.mode,
964
+ redirect: this.redirect,
965
+ referrer: this.referrer,
966
+ referrerPolicy: this.referrerPolicy,
967
+ signal: this.signal
968
+ };
969
+ }
970
+ get cookies() {
971
+ return this[INTERNALS].cookies;
972
+ }
973
+ get geo() {
974
+ return this[INTERNALS].geo;
975
+ }
976
+ get ip() {
977
+ return this[INTERNALS].ip;
978
+ }
979
+ get nextUrl() {
980
+ return this[INTERNALS].url;
981
+ }
982
+ /**
983
+ * @deprecated
984
+ * `page` has been deprecated in favour of `URLPattern`.
985
+ * Read more: https://nextjs.org/docs/messages/middleware-request-page
986
+ */
987
+ get page() {
988
+ throw new _error.RemovedPageError();
989
+ }
990
+ /**
991
+ * @deprecated
992
+ * `ua` has been removed in favour of \`userAgent\` function.
993
+ * Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent
994
+ */
995
+ get ua() {
996
+ throw new _error.RemovedUAError();
997
+ }
998
+ get url() {
999
+ return this[INTERNALS].url.toString();
1000
+ }
1001
+ };
1002
+ exports.NextRequest = NextRequest2;
1003
+ }
1004
+ });
1005
+
1006
+ // ../../../../node_modules/next/dist/server/web/spec-extension/response.js
1007
+ var require_response = __commonJS({
1008
+ "../../../../node_modules/next/dist/server/web/spec-extension/response.js"(exports) {
1009
+ "use strict";
1010
+ Object.defineProperty(exports, "__esModule", {
1011
+ value: true
1012
+ });
1013
+ var _nextUrl = require_next_url();
1014
+ var _utils = require_utils();
1015
+ var _cookies = require_cookies();
1016
+ var INTERNALS = Symbol("internal response");
1017
+ var REDIRECTS = /* @__PURE__ */ new Set([
1018
+ 301,
1019
+ 302,
1020
+ 303,
1021
+ 307,
1022
+ 308
1023
+ ]);
1024
+ var NextResponse2 = class extends Response {
1025
+ constructor(body, init = {}) {
1026
+ super(body, init);
1027
+ this[INTERNALS] = {
1028
+ cookies: new _cookies.NextCookies(this),
1029
+ url: init.url ? new _nextUrl.NextURL(init.url, {
1030
+ headers: (0, _utils).toNodeHeaders(this.headers),
1031
+ nextConfig: init.nextConfig
1032
+ }) : void 0
1033
+ };
1034
+ }
1035
+ [Symbol.for("edge-runtime.inspect.custom")]() {
1036
+ return {
1037
+ cookies: this.cookies,
1038
+ url: this.url,
1039
+ // rest of props come from Response
1040
+ body: this.body,
1041
+ bodyUsed: this.bodyUsed,
1042
+ headers: Object.fromEntries(this.headers),
1043
+ ok: this.ok,
1044
+ redirected: this.redirected,
1045
+ status: this.status,
1046
+ statusText: this.statusText,
1047
+ type: this.type
1048
+ };
1049
+ }
1050
+ get cookies() {
1051
+ return this[INTERNALS].cookies;
1052
+ }
1053
+ static json(body, init) {
1054
+ const response = Response.json(body, init);
1055
+ return new NextResponse2(response.body, response);
1056
+ }
1057
+ static redirect(url, init) {
1058
+ var ref;
1059
+ const status = typeof init === "number" ? init : (ref = init == null ? void 0 : init.status) != null ? ref : 307;
1060
+ if (!REDIRECTS.has(status)) {
1061
+ throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');
1062
+ }
1063
+ const initObj = typeof init === "object" ? init : {};
1064
+ const headers = new Headers(initObj == null ? void 0 : initObj.headers);
1065
+ headers.set("Location", (0, _utils).validateURL(url));
1066
+ return new NextResponse2(null, {
1067
+ ...initObj,
1068
+ headers,
1069
+ status
1070
+ });
1071
+ }
1072
+ static rewrite(destination, init) {
1073
+ const headers = new Headers(init == null ? void 0 : init.headers);
1074
+ headers.set("x-middleware-rewrite", (0, _utils).validateURL(destination));
1075
+ return new NextResponse2(null, {
1076
+ ...init,
1077
+ headers
1078
+ });
1079
+ }
1080
+ static next(init) {
1081
+ const headers = new Headers(init == null ? void 0 : init.headers);
1082
+ headers.set("x-middleware-next", "1");
1083
+ return new NextResponse2(null, {
1084
+ ...init,
1085
+ headers
1086
+ });
1087
+ }
1088
+ };
1089
+ exports.NextResponse = NextResponse2;
1090
+ }
1091
+ });
1092
+
1093
+ // ../../../../node_modules/next/dist/compiled/ua-parser-js/ua-parser.js
1094
+ var require_ua_parser = __commonJS({
1095
+ "../../../../node_modules/next/dist/compiled/ua-parser-js/ua-parser.js"(exports, module2) {
1096
+ (() => {
1097
+ var i = { 412: function(i2, s2) {
1098
+ (function(e2, o) {
1099
+ "use strict";
1100
+ var r = "0.7.28", a = "", n = "?", t = "function", l = "undefined", w = "object", d = "string", b = "major", u = "model", c = "name", m = "type", p = "vendor", f = "version", h = "architecture", g = "console", v = "mobile", x = "tablet", k = "smarttv", _ = "wearable", y = "embedded", S = 255;
1101
+ var E = { extend: function(i3, s3) {
1102
+ var e3 = {};
1103
+ for (var o2 in i3) {
1104
+ if (s3[o2] && s3[o2].length % 2 === 0) {
1105
+ e3[o2] = s3[o2].concat(i3[o2]);
1106
+ } else {
1107
+ e3[o2] = i3[o2];
1108
+ }
1109
+ }
1110
+ return e3;
1111
+ }, has: function(i3, s3) {
1112
+ return typeof i3 === d ? s3.toLowerCase().indexOf(i3.toLowerCase()) !== -1 : false;
1113
+ }, lowerize: function(i3) {
1114
+ return i3.toLowerCase();
1115
+ }, major: function(i3) {
1116
+ return typeof i3 === d ? i3.replace(/[^\d\.]/g, "").split(".")[0] : o;
1117
+ }, trim: function(i3, s3) {
1118
+ i3 = i3.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
1119
+ return typeof s3 === l ? i3 : i3.substring(0, S);
1120
+ } };
1121
+ var A = { rgx: function(i3, s3) {
1122
+ var e3 = 0, r2, a2, n2, l2, d2, b2;
1123
+ while (e3 < s3.length && !d2) {
1124
+ var u2 = s3[e3], c2 = s3[e3 + 1];
1125
+ r2 = a2 = 0;
1126
+ while (r2 < u2.length && !d2) {
1127
+ d2 = u2[r2++].exec(i3);
1128
+ if (!!d2) {
1129
+ for (n2 = 0; n2 < c2.length; n2++) {
1130
+ b2 = d2[++a2];
1131
+ l2 = c2[n2];
1132
+ if (typeof l2 === w && l2.length > 0) {
1133
+ if (l2.length == 2) {
1134
+ if (typeof l2[1] == t) {
1135
+ this[l2[0]] = l2[1].call(this, b2);
1136
+ } else {
1137
+ this[l2[0]] = l2[1];
1138
+ }
1139
+ } else if (l2.length == 3) {
1140
+ if (typeof l2[1] === t && !(l2[1].exec && l2[1].test)) {
1141
+ this[l2[0]] = b2 ? l2[1].call(this, b2, l2[2]) : o;
1142
+ } else {
1143
+ this[l2[0]] = b2 ? b2.replace(l2[1], l2[2]) : o;
1144
+ }
1145
+ } else if (l2.length == 4) {
1146
+ this[l2[0]] = b2 ? l2[3].call(this, b2.replace(l2[1], l2[2])) : o;
1147
+ }
1148
+ } else {
1149
+ this[l2] = b2 ? b2 : o;
1150
+ }
1151
+ }
1152
+ }
1153
+ }
1154
+ e3 += 2;
1155
+ }
1156
+ }, str: function(i3, s3) {
1157
+ for (var e3 in s3) {
1158
+ if (typeof s3[e3] === w && s3[e3].length > 0) {
1159
+ for (var r2 = 0; r2 < s3[e3].length; r2++) {
1160
+ if (E.has(s3[e3][r2], i3)) {
1161
+ return e3 === n ? o : e3;
1162
+ }
1163
+ }
1164
+ } else if (E.has(s3[e3], i3)) {
1165
+ return e3 === n ? o : e3;
1166
+ }
1167
+ }
1168
+ return i3;
1169
+ } };
1170
+ var N = { browser: { oldSafari: { version: { "1.0": "/8", 1.2: "/1", 1.3: "/3", "2.0": "/412", "2.0.2": "/416", "2.0.3": "/417", "2.0.4": "/419", "?": "/" } }, oldEdge: { version: { 0.1: "12.", 21: "13.", 31: "14.", 39: "15.", 41: "16.", 42: "17.", 44: "18." } } }, os: { windows: { version: { ME: "4.90", "NT 3.11": "NT3.51", "NT 4.0": "NT4.0", 2e3: "NT 5.0", XP: ["NT 5.1", "NT 5.2"], Vista: "NT 6.0", 7: "NT 6.1", 8: "NT 6.2", 8.1: "NT 6.3", 10: ["NT 6.4", "NT 10.0"], RT: "ARM" } } } };
1171
+ var T = { browser: [[/\b(?:crmo|crios)\/([\w\.]+)/i], [f, [c, "Chrome"]], [/edg(?:e|ios|a)?\/([\w\.]+)/i], [f, [c, "Edge"]], [/(opera\smini)\/([\w\.-]+)/i, /(opera\s[mobiletab]{3,6})\b.+version\/([\w\.-]+)/i, /(opera)(?:.+version\/|[\/\s]+)([\w\.]+)/i], [c, f], [/opios[\/\s]+([\w\.]+)/i], [f, [c, "Opera Mini"]], [/\sopr\/([\w\.]+)/i], [f, [c, "Opera"]], [/(kindle)\/([\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i, /(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i, /(ba?idubrowser)[\/\s]?([\w\.]+)/i, /(?:ms|\()(ie)\s([\w\.]+)/i, /(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i, /(rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([\w\.]+)/i, /(weibo)__([\d\.]+)/i], [c, f], [/(?:[\s\/]uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i], [f, [c, "UCBrowser"]], [/(?:windowswechat)?\sqbcore\/([\w\.]+)\b.*(?:windowswechat)?/i], [f, [c, "WeChat(Win) Desktop"]], [/micromessenger\/([\w\.]+)/i], [f, [c, "WeChat"]], [/konqueror\/([\w\.]+)/i], [f, [c, "Konqueror"]], [/trident.+rv[:\s]([\w\.]{1,9})\b.+like\sgecko/i], [f, [c, "IE"]], [/yabrowser\/([\w\.]+)/i], [f, [c, "Yandex"]], [/(avast|avg)\/([\w\.]+)/i], [[c, /(.+)/, "$1 Secure Browser"], f], [/focus\/([\w\.]+)/i], [f, [c, "Firefox Focus"]], [/opt\/([\w\.]+)/i], [f, [c, "Opera Touch"]], [/coc_coc_browser\/([\w\.]+)/i], [f, [c, "Coc Coc"]], [/dolfin\/([\w\.]+)/i], [f, [c, "Dolphin"]], [/coast\/([\w\.]+)/i], [f, [c, "Opera Coast"]], [/xiaomi\/miuibrowser\/([\w\.]+)/i], [f, [c, "MIUI Browser"]], [/fxios\/([\w\.-]+)/i], [f, [c, "Firefox"]], [/(qihu|qhbrowser|qihoobrowser|360browser)/i], [[c, "360 Browser"]], [/(oculus|samsung|sailfish)browser\/([\w\.]+)/i], [[c, /(.+)/, "$1 Browser"], f], [/(comodo_dragon)\/([\w\.]+)/i], [[c, /_/g, " "], f], [/\s(electron)\/([\w\.]+)\ssafari/i, /(tesla)(?:\sqtcarbrowser|\/(20[12]\d\.[\w\.-]+))/i, /m?(qqbrowser|baiduboxapp|2345Explorer)[\/\s]?([\w\.]+)/i], [c, f], [/(MetaSr)[\/\s]?([\w\.]+)/i, /(LBBROWSER)/i], [c], [/;fbav\/([\w\.]+);/i], [f, [c, "Facebook"]], [/FBAN\/FBIOS|FB_IAB\/FB4A/i], [[c, "Facebook"]], [/safari\s(line)\/([\w\.]+)/i, /\b(line)\/([\w\.]+)\/iab/i, /(chromium|instagram)[\/\s]([\w\.-]+)/i], [c, f], [/\bgsa\/([\w\.]+)\s.*safari\//i], [f, [c, "GSA"]], [/headlesschrome(?:\/([\w\.]+)|\s)/i], [f, [c, "Chrome Headless"]], [/\swv\).+(chrome)\/([\w\.]+)/i], [[c, "Chrome WebView"], f], [/droid.+\sversion\/([\w\.]+)\b.+(?:mobile\ssafari|safari)/i], [f, [c, "Android Browser"]], [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i], [c, f], [/version\/([\w\.]+)\s.*mobile\/\w+\s(safari)/i], [f, [c, "Mobile Safari"]], [/version\/([\w\.]+)\s.*(mobile\s?safari|safari)/i], [f, c], [/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i], [c, [f, A.str, N.browser.oldSafari.version]], [/(webkit|khtml)\/([\w\.]+)/i], [c, f], [/(navigator|netscape)\/([\w\.-]+)/i], [[c, "Netscape"], f], [/ile\svr;\srv:([\w\.]+)\).+firefox/i], [f, [c, "Firefox Reality"]], [/ekiohf.+(flow)\/([\w\.]+)/i, /(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i, /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i, /(firefox)\/([\w\.]+)\s[\w\s\-]+\/[\w\.]+$/i, /(mozilla)\/([\w\.]+)\s.+rv\:.+gecko\/\d+/i, /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i, /(links)\s\(([\w\.]+)/i, /(gobrowser)\/?([\w\.]*)/i, /(ice\s?browser)\/v?([\w\._]+)/i, /(mosaic)[\/\s]([\w\.]+)/i], [c, f]], cpu: [[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i], [[h, "amd64"]], [/(ia32(?=;))/i], [[h, E.lowerize]], [/((?:i[346]|x)86)[;\)]/i], [[h, "ia32"]], [/\b(aarch64|armv?8e?l?)\b/i], [[h, "arm64"]], [/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i], [[h, "armhf"]], [/windows\s(ce|mobile);\sppc;/i], [[h, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i], [[h, /ower/, "", E.lowerize]], [/(sun4\w)[;\)]/i], [[h, "sparc"]], [/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?:64|(?=v(?:[1-7]|[5-7]1)l?|;|eabi))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i], [[h, E.lowerize]]], device: [[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus\s10)/i], [u, [p, "Samsung"], [m, x]], [/\b((?:s[cgp]h|gt|sm)-\w+|galaxy\snexus)/i, /\ssamsung[\s-]([\w-]+)/i, /sec-(sgh\w+)/i], [u, [p, "Samsung"], [m, v]], [/\((ip(?:hone|od)[\s\w]*);/i], [u, [p, "Apple"], [m, v]], [/\((ipad);[\w\s\),;-]+apple/i, /applecoremedia\/[\w\.]+\s\((ipad)/i, /\b(ipad)\d\d?,\d\d?[;\]].+ios/i], [u, [p, "Apple"], [m, x]], [/\b((?:agr|ags[23]|bah2?|sht?)-a?[lw]\d{2})/i], [u, [p, "Huawei"], [m, x]], [/d\/huawei([\w\s-]+)[;\)]/i, /\b(nexus\s6p|vog-[at]?l\d\d|ane-[at]?l[x\d]\d|eml-a?l\d\da?|lya-[at]?l\d[\dc]|clt-a?l\d\di?|ele-l\d\d)/i, /\b(\w{2,4}-[atu][ln][01259][019])[;\)\s]/i], [u, [p, "Huawei"], [m, v]], [/\b(poco[\s\w]+)(?:\sbuild|\))/i, /\b;\s(\w+)\sbuild\/hm\1/i, /\b(hm[\s\-_]?note?[\s_]?(?:\d\w)?)\sbuild/i, /\b(redmi[\s\-_]?(?:note|k)?[\w\s_]+)(?:\sbuild|\))/i, /\b(mi[\s\-_]?(?:a\d|one|one[\s_]plus|note lte)?[\s_]?(?:\d?\w?)[\s_]?(?:plus)?)\sbuild/i], [[u, /_/g, " "], [p, "Xiaomi"], [m, v]], [/\b(mi[\s\-_]?(?:pad)(?:[\w\s_]+))(?:\sbuild|\))/i], [[u, /_/g, " "], [p, "Xiaomi"], [m, x]], [/;\s(\w+)\sbuild.+\soppo/i, /\s(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007)\b/i], [u, [p, "OPPO"], [m, v]], [/\svivo\s(\w+)(?:\sbuild|\))/i, /\s(v[12]\d{3}\w?[at])(?:\sbuild|;)/i], [u, [p, "Vivo"], [m, v]], [/\s(rmx[12]\d{3})(?:\sbuild|;)/i], [u, [p, "Realme"], [m, v]], [/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)\b[\w\s]+build\//i, /\smot(?:orola)?[\s-](\w*)/i, /((?:moto[\s\w\(\)]+|xt\d{3,4}|nexus\s6)(?=\sbuild|\)))/i], [u, [p, "Motorola"], [m, v]], [/\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i], [u, [p, "Motorola"], [m, x]], [/((?=lg)?[vl]k\-?\d{3})\sbuild|\s3\.[\s\w;-]{10}lg?-([06cv9]{3,4})/i], [u, [p, "LG"], [m, x]], [/(lm-?f100[nv]?|nexus\s[45])/i, /lg[e;\s\/-]+((?!browser|netcast)\w+)/i, /\blg(\-?[\d\w]+)\sbuild/i], [u, [p, "LG"], [m, v]], [/(ideatab[\w\-\s]+)/i, /lenovo\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+)|yt[\d\w-]{6}|tb[\d\w-]{6})/i], [u, [p, "Lenovo"], [m, x]], [/(?:maemo|nokia).*(n900|lumia\s\d+)/i, /nokia[\s_-]?([\w\.-]*)/i], [[u, /_/g, " "], [p, "Nokia"], [m, v]], [/droid.+;\s(pixel\sc)[\s)]/i], [u, [p, "Google"], [m, x]], [/droid.+;\s(pixel[\s\daxl]{0,6})(?:\sbuild|\))/i], [u, [p, "Google"], [m, v]], [/droid.+\s([c-g]\d{4}|so[-l]\w+|xq-a\w[4-7][12])(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i], [u, [p, "Sony"], [m, v]], [/sony\stablet\s[ps]\sbuild\//i, /(?:sony)?sgp\w+(?:\sbuild\/|\))/i], [[u, "Xperia Tablet"], [p, "Sony"], [m, x]], [/\s(kb2005|in20[12]5|be20[12][59])\b/i, /\ba000(1)\sbuild/i, /\boneplus\s(a\d{4})[\s)]/i], [u, [p, "OnePlus"], [m, v]], [/(alexa)webm/i, /(kf[a-z]{2}wi)(\sbuild\/|\))/i, /(kf[a-z]+)(\sbuild\/|\)).+silk\//i], [u, [p, "Amazon"], [m, x]], [/(sd|kf)[0349hijorstuw]+(\sbuild\/|\)).+silk\//i], [[u, "Fire Phone"], [p, "Amazon"], [m, v]], [/\((playbook);[\w\s\),;-]+(rim)/i], [u, p, [m, x]], [/((?:bb[a-f]|st[hv])100-\d)/i, /\(bb10;\s(\w+)/i], [u, [p, "BlackBerry"], [m, v]], [/(?:\b|asus_)(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus\s7|padfone|p00[cj])/i], [u, [p, "ASUS"], [m, x]], [/\s(z[es]6[027][01][km][ls]|zenfone\s\d\w?)\b/i], [u, [p, "ASUS"], [m, v]], [/(nexus\s9)/i], [u, [p, "HTC"], [m, x]], [/(htc)[;_\s-]{1,2}([\w\s]+(?=\)|\sbuild)|\w+)/i, /(zte)-(\w*)/i, /(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i], [p, [u, /_/g, " "], [m, v]], [/droid[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i], [u, [p, "Acer"], [m, x]], [/droid.+;\s(m[1-5]\snote)\sbuild/i, /\bmz-([\w-]{2,})/i], [u, [p, "Meizu"], [m, v]], [/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i, /(hp)\s([\w\s]+\w)/i, /(asus)-?(\w+)/i, /(microsoft);\s(lumia[\s\w]+)/i, /(lenovo)[_\s-]?([\w-]+)/i, /linux;.+(jolla);/i, /droid.+;\s(oppo)\s?([\w\s]+)\sbuild/i], [p, u, [m, v]], [/(archos)\s(gamepad2?)/i, /(hp).+(touchpad(?!.+tablet)|tablet)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i, /[;\/]\s?(le[\s\-]+pan)[\s\-]+(\w{1,9})\sbuild/i, /[;\/]\s?(trinity)[\-\s]*(t\d{3})\sbuild/i, /\b(gigaset)[\s\-]+(q\w{1,9})\sbuild/i, /\b(vodafone)\s([\w\s]+)(?:\)|\sbuild)/i], [p, u, [m, x]], [/\s(surface\sduo)\s/i], [u, [p, "Microsoft"], [m, x]], [/droid\s[\d\.]+;\s(fp\du?)\sbuild/i], [u, [p, "Fairphone"], [m, v]], [/\s(u304aa)\sbuild/i], [u, [p, "AT&T"], [m, v]], [/sie-(\w*)/i], [u, [p, "Siemens"], [m, v]], [/[;\/]\s?(rct\w+)\sbuild/i], [u, [p, "RCA"], [m, x]], [/[;\/\s](venue[\d\s]{2,7})\sbuild/i], [u, [p, "Dell"], [m, x]], [/[;\/]\s?(q(?:mv|ta)\w+)\sbuild/i], [u, [p, "Verizon"], [m, x]], [/[;\/]\s(?:barnes[&\s]+noble\s|bn[rt])([\w\s\+]*)\sbuild/i], [u, [p, "Barnes & Noble"], [m, x]], [/[;\/]\s(tm\d{3}\w+)\sbuild/i], [u, [p, "NuVision"], [m, x]], [/;\s(k88)\sbuild/i], [u, [p, "ZTE"], [m, x]], [/;\s(nx\d{3}j)\sbuild/i], [u, [p, "ZTE"], [m, v]], [/[;\/]\s?(gen\d{3})\sbuild.*49h/i], [u, [p, "Swiss"], [m, v]], [/[;\/]\s?(zur\d{3})\sbuild/i], [u, [p, "Swiss"], [m, x]], [/[;\/]\s?((zeki)?tb.*\b)\sbuild/i], [u, [p, "Zeki"], [m, x]], [/[;\/]\s([yr]\d{2})\sbuild/i, /[;\/]\s(dragon[\-\s]+touch\s|dt)(\w{5})\sbuild/i], [[p, "Dragon Touch"], u, [m, x]], [/[;\/]\s?(ns-?\w{0,9})\sbuild/i], [u, [p, "Insignia"], [m, x]], [/[;\/]\s?((nxa|Next)-?\w{0,9})\sbuild/i], [u, [p, "NextBook"], [m, x]], [/[;\/]\s?(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05]))\sbuild/i], [[p, "Voice"], u, [m, v]], [/[;\/]\s?(lvtel\-)?(v1[12])\sbuild/i], [[p, "LvTel"], u, [m, v]], [/;\s(ph-1)\s/i], [u, [p, "Essential"], [m, v]], [/[;\/]\s?(v(100md|700na|7011|917g).*\b)\sbuild/i], [u, [p, "Envizen"], [m, x]], [/[;\/]\s?(trio[\s\w\-\.]+)\sbuild/i], [u, [p, "MachSpeed"], [m, x]], [/[;\/]\s?tu_(1491)\sbuild/i], [u, [p, "Rotor"], [m, x]], [/(shield[\w\s]+)\sbuild/i], [u, [p, "Nvidia"], [m, x]], [/(sprint)\s(\w+)/i], [p, u, [m, v]], [/(kin\.[onetw]{3})/i], [[u, /\./g, " "], [p, "Microsoft"], [m, v]], [/droid\s[\d\.]+;\s(cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i], [u, [p, "Zebra"], [m, x]], [/droid\s[\d\.]+;\s(ec30|ps20|tc[2-8]\d[kx])\)/i], [u, [p, "Zebra"], [m, v]], [/\s(ouya)\s/i, /(nintendo)\s([wids3utch]+)/i], [p, u, [m, g]], [/droid.+;\s(shield)\sbuild/i], [u, [p, "Nvidia"], [m, g]], [/(playstation\s[345portablevi]+)/i], [u, [p, "Sony"], [m, g]], [/[\s\(;](xbox(?:\sone)?(?!;\sxbox))[\s\);]/i], [u, [p, "Microsoft"], [m, g]], [/smart-tv.+(samsung)/i], [p, [m, k]], [/hbbtv.+maple;(\d+)/i], [[u, /^/, "SmartTV"], [p, "Samsung"], [m, k]], [/(?:linux;\snetcast.+smarttv|lg\snetcast\.tv-201\d)/i], [[p, "LG"], [m, k]], [/(apple)\s?tv/i], [p, [u, "Apple TV"], [m, k]], [/crkey/i], [[u, "Chromecast"], [p, "Google"], [m, k]], [/droid.+aft([\w])(\sbuild\/|\))/i], [u, [p, "Amazon"], [m, k]], [/\(dtv[\);].+(aquos)/i], [u, [p, "Sharp"], [m, k]], [/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i], [[p, E.trim], [u, E.trim], [m, k]], [/[\s\/\(](android\s|smart[-\s]?|opera\s)tv[;\)\s]/i], [[m, k]], [/((pebble))app\/[\d\.]+\s/i], [p, u, [m, _]], [/droid.+;\s(glass)\s\d/i], [u, [p, "Google"], [m, _]], [/droid\s[\d\.]+;\s(wt63?0{2,3})\)/i], [u, [p, "Zebra"], [m, _]], [/(tesla)(?:\sqtcarbrowser|\/20[12]\d\.[\w\.-]+)/i], [p, [m, y]], [/droid .+?; ([^;]+?)(?: build|\) applewebkit).+? mobile safari/i], [u, [m, v]], [/droid .+?;\s([^;]+?)(?: build|\) applewebkit).+?(?! mobile) safari/i], [u, [m, x]], [/\s(tablet|tab)[;\/]/i, /\s(mobile)(?:[;\/]|\ssafari)/i], [[m, E.lowerize]], [/(android[\w\.\s\-]{0,9});.+build/i], [u, [p, "Generic"]], [/(phone)/i], [[m, v]]], engine: [[/windows.+\sedge\/([\w\.]+)/i], [f, [c, "EdgeHTML"]], [/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i], [f, [c, "Blink"]], [/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, /ekioh(flow)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i], [c, f], [/rv\:([\w\.]{1,9})\b.+(gecko)/i], [f, c]], os: [[/microsoft\s(windows)\s(vista|xp)/i], [c, f], [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i, /(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)(?!.+xbox)/i], [c, [f, A.str, N.os.windows.version]], [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i], [[c, "Windows"], [f, A.str, N.os.windows.version]], [/ip[honead]{2,4}\b(?:.*os\s([\w]+)\slike\smac|;\sopera)/i, /cfnetwork\/.+darwin/i], [[f, /_/g, "."], [c, "iOS"]], [/(mac\sos\sx)\s?([\w\s\.]*)/i, /(macintosh|mac(?=_powerpc)\s)(?!.+haiku)/i], [[c, "Mac OS"], [f, /_/g, "."]], [/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i, /(blackberry)\w*\/([\w\.]*)/i, /(tizen|kaios)[\/\s]([\w\.]+)/i, /\((series40);/i], [c, f], [/\(bb(10);/i], [f, [c, "BlackBerry"]], [/(?:symbian\s?os|symbos|s60(?=;)|series60)[\/\s-]?([\w\.]*)/i], [f, [c, "Symbian"]], [/mozilla.+\(mobile;.+gecko.+firefox/i], [[c, "Firefox OS"]], [/web0s;.+rt(tv)/i, /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i], [f, [c, "webOS"]], [/crkey\/([\d\.]+)/i], [f, [c, "Chromecast"]], [/(cros)\s[\w]+\s([\w\.]+\w)/i], [[c, "Chromium OS"], f], [/(nintendo|playstation)\s([wids345portablevuch]+)/i, /(xbox);\s+xbox\s([^\);]+)/i, /(mint)[\/\s\(\)]?(\w*)/i, /(mageia|vectorlinux)[;\s]/i, /(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?=\slinux)|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus|raspbian)(?:\sgnu\/linux)?(?:\slinux)?[\/\s-]?(?!chrom|package)([\w\.-]*)/i, /(hurd|linux)\s?([\w\.]*)/i, /(gnu)\s?([\w\.]*)/i, /\s([frentopc-]{0,4}bsd|dragonfly)\s?(?!amd|[ix346]{1,2}86)([\w\.]*)/i, /(haiku)\s(\w+)/i], [c, f], [/(sunos)\s?([\w\.\d]*)/i], [[c, "Solaris"], f], [/((?:open)?solaris)[\/\s-]?([\w\.]*)/i, /(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i, /(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i, /(unix)\s?([\w\.]*)/i], [c, f]] };
1172
+ var UAParser = function(i3, s3) {
1173
+ if (typeof i3 === "object") {
1174
+ s3 = i3;
1175
+ i3 = o;
1176
+ }
1177
+ if (!(this instanceof UAParser)) {
1178
+ return new UAParser(i3, s3).getResult();
1179
+ }
1180
+ var r2 = i3 || (typeof e2 !== "undefined" && e2.navigator && e2.navigator.userAgent ? e2.navigator.userAgent : a);
1181
+ var n2 = s3 ? E.extend(T, s3) : T;
1182
+ this.getBrowser = function() {
1183
+ var i4 = { name: o, version: o };
1184
+ A.rgx.call(i4, r2, n2.browser);
1185
+ i4.major = E.major(i4.version);
1186
+ return i4;
1187
+ };
1188
+ this.getCPU = function() {
1189
+ var i4 = { architecture: o };
1190
+ A.rgx.call(i4, r2, n2.cpu);
1191
+ return i4;
1192
+ };
1193
+ this.getDevice = function() {
1194
+ var i4 = { vendor: o, model: o, type: o };
1195
+ A.rgx.call(i4, r2, n2.device);
1196
+ return i4;
1197
+ };
1198
+ this.getEngine = function() {
1199
+ var i4 = { name: o, version: o };
1200
+ A.rgx.call(i4, r2, n2.engine);
1201
+ return i4;
1202
+ };
1203
+ this.getOS = function() {
1204
+ var i4 = { name: o, version: o };
1205
+ A.rgx.call(i4, r2, n2.os);
1206
+ return i4;
1207
+ };
1208
+ this.getResult = function() {
1209
+ return { ua: this.getUA(), browser: this.getBrowser(), engine: this.getEngine(), os: this.getOS(), device: this.getDevice(), cpu: this.getCPU() };
1210
+ };
1211
+ this.getUA = function() {
1212
+ return r2;
1213
+ };
1214
+ this.setUA = function(i4) {
1215
+ r2 = typeof i4 === d && i4.length > S ? E.trim(i4, S) : i4;
1216
+ return this;
1217
+ };
1218
+ this.setUA(r2);
1219
+ return this;
1220
+ };
1221
+ UAParser.VERSION = r;
1222
+ UAParser.BROWSER = { NAME: c, MAJOR: b, VERSION: f };
1223
+ UAParser.CPU = { ARCHITECTURE: h };
1224
+ UAParser.DEVICE = { MODEL: u, VENDOR: p, TYPE: m, CONSOLE: g, MOBILE: v, SMARTTV: k, TABLET: x, WEARABLE: _, EMBEDDED: y };
1225
+ UAParser.ENGINE = { NAME: c, VERSION: f };
1226
+ UAParser.OS = { NAME: c, VERSION: f };
1227
+ if (typeof s2 !== l) {
1228
+ if ("object" !== l && i2.exports) {
1229
+ s2 = i2.exports = UAParser;
1230
+ }
1231
+ s2.UAParser = UAParser;
1232
+ } else {
1233
+ if (typeof define === "function" && define.amd) {
1234
+ define(function() {
1235
+ return UAParser;
1236
+ });
1237
+ } else if (typeof e2 !== "undefined") {
1238
+ e2.UAParser = UAParser;
1239
+ }
1240
+ }
1241
+ var z = typeof e2 !== "undefined" && (e2.jQuery || e2.Zepto);
1242
+ if (z && !z.ua) {
1243
+ var O = new UAParser();
1244
+ z.ua = O.getResult();
1245
+ z.ua.get = function() {
1246
+ return O.getUA();
1247
+ };
1248
+ z.ua.set = function(i3) {
1249
+ O.setUA(i3);
1250
+ var s3 = O.getResult();
1251
+ for (var e3 in s3) {
1252
+ z.ua[e3] = s3[e3];
1253
+ }
1254
+ };
1255
+ }
1256
+ })(typeof window === "object" ? window : this);
1257
+ } };
1258
+ var s = {};
1259
+ function __nccwpck_require__2(e2) {
1260
+ var o = s[e2];
1261
+ if (o !== void 0) {
1262
+ return o.exports;
1263
+ }
1264
+ var r = s[e2] = { exports: {} };
1265
+ var a = true;
1266
+ try {
1267
+ i[e2].call(r.exports, r, r.exports, __nccwpck_require__2);
1268
+ a = false;
1269
+ } finally {
1270
+ if (a)
1271
+ delete s[e2];
1272
+ }
1273
+ return r.exports;
1274
+ }
1275
+ if (typeof __nccwpck_require__2 !== "undefined")
1276
+ __nccwpck_require__2.ab = __dirname + "/";
1277
+ var e = __nccwpck_require__2(412);
1278
+ module2.exports = e;
1279
+ })();
1280
+ }
1281
+ });
1282
+
1283
+ // ../../../../node_modules/next/dist/server/web/spec-extension/user-agent.js
1284
+ var require_user_agent = __commonJS({
1285
+ "../../../../node_modules/next/dist/server/web/spec-extension/user-agent.js"(exports) {
1286
+ "use strict";
1287
+ Object.defineProperty(exports, "__esModule", {
1288
+ value: true
1289
+ });
1290
+ exports.isBot = isBot;
1291
+ exports.userAgentFromString = userAgentFromString;
1292
+ exports.userAgent = userAgent;
1293
+ var _uaParserJs = _interopRequireDefault(require_ua_parser());
1294
+ function _interopRequireDefault(obj) {
1295
+ return obj && obj.__esModule ? obj : {
1296
+ default: obj
1297
+ };
1298
+ }
1299
+ function isBot(input) {
1300
+ return /Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(input);
1301
+ }
1302
+ function userAgentFromString(input) {
1303
+ return {
1304
+ ...(0, _uaParserJs).default(input),
1305
+ isBot: input === void 0 ? false : isBot(input)
1306
+ };
1307
+ }
1308
+ function userAgent({ headers }) {
1309
+ return userAgentFromString(headers.get("user-agent") || void 0);
1310
+ }
1311
+ }
1312
+ });
1313
+
1314
+ // ../../../../node_modules/next/server.js
1315
+ var require_server = __commonJS({
1316
+ "../../../../node_modules/next/server.js"(exports, module2) {
1317
+ var serverExports = {
1318
+ NextRequest: require_request().NextRequest,
1319
+ NextResponse: require_response().NextResponse,
1320
+ userAgentFromString: require_user_agent().userAgentFromString,
1321
+ userAgent: require_user_agent().userAgent
1322
+ };
1323
+ if (typeof URLPattern !== "undefined") {
1324
+ serverExports.URLPattern = URLPattern;
1325
+ }
1326
+ module2.exports = serverExports;
1327
+ exports.NextRequest = serverExports.NextRequest;
1328
+ exports.NextResponse = serverExports.NextResponse;
1329
+ exports.userAgentFromString = serverExports.userAgentFromString;
1330
+ exports.userAgent = serverExports.userAgent;
1331
+ exports.URLPattern = serverExports.URLPattern;
1332
+ }
1333
+ });
1334
+
1335
+ // src/index.ts
1336
+ var src_exports = {};
1337
+ __export(src_exports, {
1338
+ IOrderStatus: () => IOrderStatus,
1339
+ categoryToRouteLink: () => categoryToRouteLink,
1340
+ decorateHref: () => decorateHref,
1341
+ findPage: () => findPage,
1342
+ getBreadcrumbFromSegments: () => getBreadcrumbFromSegments,
1343
+ getCategories: () => getCategories,
1344
+ getCountries: () => getCountries,
1345
+ getDeliveries: () => getDeliveries,
1346
+ getErrorPageLayout: () => getErrorPageLayout,
1347
+ getFeatureTypes: () => getFeatureTypes,
1348
+ getInfo: () => getInfo,
1349
+ getItems: () => getItems,
1350
+ getLabels: () => getLabels,
1351
+ getLayout: () => getLayout,
1352
+ getListByKeys: () => getListByKeys,
1353
+ getLists: () => getLists,
1354
+ getLocales: () => getLocales,
1355
+ getMarkets: () => getMarkets,
1356
+ getMenu: () => getMenu,
1357
+ getMenus: () => getMenus,
1358
+ getOrder: () => getOrder,
1359
+ getOrders: () => getOrders,
1360
+ getPage: () => getPage,
1361
+ getPageCategory: () => getPageCategory,
1362
+ getPayment: () => getPayment,
1363
+ getPayments: () => getPayments,
1364
+ getProvinces: () => getProvinces,
1365
+ getRegions: () => getRegions,
1366
+ getRoute: () => getRoute,
1367
+ getRouteLinkTree: () => getRouteLinkTree,
1368
+ getRouteSegments: () => getRouteSegments,
1369
+ getRoutes: () => getRoutes,
1370
+ getRoutesForSchemas: () => getRoutesForSchemas,
1371
+ getRoutesForTemplates: () => getRoutesForTemplates,
1372
+ getSegments: () => getSegments,
1373
+ getStaticPathsForSchema: () => getStaticPathsForSchema,
1374
+ getStores: () => getStores,
1375
+ resolveLabel: () => resolveLabel,
1376
+ resolveRoute: () => resolveRoute,
1377
+ routeInterceptor: () => routeInterceptor,
1378
+ setDiscountCode: () => setDiscountCode,
1379
+ updateCheckout: () => updateCheckout
1380
+ });
1381
+ module.exports = __toCommonJS(src_exports);
1382
+
1383
+ // src/category/category.service.ts
1384
+ var import_bom_mixer_store = require("@websolutespa/bom-mixer-store");
1385
+ async function getCategories(params = {}) {
1386
+ const store = await (0, import_bom_mixer_store.getStore)();
1387
+ const categories = await store.category.findMany(params);
1388
+ return categories;
1389
+ }
1390
+ async function getSegments(item, params = {}) {
1391
+ const categories = await getCategories(params);
1392
+ return getRouteSegments(item.schema, item, categories);
1393
+ }
1394
+ function getRouteSegments(schema, item, categories) {
1395
+ const segments = [];
1396
+ let parentId = item.category || null;
1397
+ while (parentId != null) {
1398
+ const parentCategory = categories.find((c) => c.id === parentId);
1399
+ if (parentCategory) {
1400
+ if (parentCategory.slug) {
1401
+ const segment = { ...parentCategory };
1402
+ segments.unshift(segment);
1403
+ }
1404
+ parentId = parentCategory.category || null;
1405
+ } else {
1406
+ parentId = null;
1407
+ }
1408
+ }
1409
+ if (item.isDefault !== true) {
1410
+ segments.push({
1411
+ id: item.id,
1412
+ title: item.title,
1413
+ slug: item.slug,
1414
+ schema,
1415
+ page: item.id,
1416
+ media: item.media
1417
+ });
1418
+ }
1419
+ return segments;
1420
+ }
1421
+
1422
+ // src/country/country.service.ts
1423
+ var import_bom_mixer_store2 = require("@websolutespa/bom-mixer-store");
1424
+ async function getCountries(locale) {
1425
+ const store = await (0, import_bom_mixer_store2.getStore)();
1426
+ const items = await store.i18n_country.findMany({ locale });
1427
+ return items;
1428
+ }
1429
+
1430
+ // src/province/province.service.ts
1431
+ var import_bom_mixer_store3 = require("@websolutespa/bom-mixer-store");
1432
+ async function getProvinces(locale) {
1433
+ const store = await (0, import_bom_mixer_store3.getStore)();
1434
+ const items = await store.i18n_province.findMany({ locale });
1435
+ return items;
1436
+ }
1437
+
1438
+ // src/region/region.service.ts
1439
+ var import_bom_mixer_store4 = require("@websolutespa/bom-mixer-store");
1440
+ async function getRegions(locale) {
1441
+ const store = await (0, import_bom_mixer_store4.getStore)();
1442
+ const items = await store.i18n_region.findMany({ locale });
1443
+ return items;
1444
+ }
1445
+
1446
+ // src/route/route.service.ts
1447
+ var import_bom_mixer_core = require("@websolutespa/bom-mixer-core");
1448
+ var import_bom_mixer_store5 = require("@websolutespa/bom-mixer-store");
1449
+ async function getRoutes(params = {}) {
1450
+ const store = await (0, import_bom_mixer_store5.getStore)();
1451
+ const routes = await store.route.findMany(params);
1452
+ return routes;
1453
+ }
1454
+ async function getRoute(id) {
1455
+ const store = await (0, import_bom_mixer_store5.getStore)();
1456
+ const route = await store.route.findOne({
1457
+ where: {
1458
+ id: {
1459
+ equals: id
1460
+ }
1461
+ }
1462
+ });
1463
+ return route;
1464
+ }
1465
+ async function getRoutesForSchemas(schemas, market, locale) {
1466
+ const store = await (0, import_bom_mixer_store5.getStore)();
1467
+ const routes = await store.route.findMany({
1468
+ where: {
1469
+ schema: {
1470
+ in: schemas
1471
+ },
1472
+ market: {
1473
+ equals: market
1474
+ },
1475
+ locale: {
1476
+ equals: locale
1477
+ }
1478
+ },
1479
+ market,
1480
+ locale
1481
+ });
1482
+ const items = {};
1483
+ routes.forEach((route) => {
1484
+ items[route.schema] = route.id;
1485
+ });
1486
+ return items;
1487
+ }
1488
+ async function getRoutesForTemplates(templates, market, locale) {
1489
+ const store = await (0, import_bom_mixer_store5.getStore)();
1490
+ const routes = await store.route.findMany({
1491
+ where: {
1492
+ template: {
1493
+ in: templates
1494
+ },
1495
+ market: {
1496
+ equals: market
1497
+ },
1498
+ locale: {
1499
+ equals: locale
1500
+ }
1501
+ },
1502
+ market,
1503
+ locale
1504
+ });
1505
+ const items = {};
1506
+ routes.forEach((route) => {
1507
+ if (route.template) {
1508
+ items[route.template] = route.id;
1509
+ }
1510
+ });
1511
+ return items;
1512
+ }
1513
+ async function getStaticPathsForSchema(schema) {
1514
+ const store = await (0, import_bom_mixer_store5.getStore)();
1515
+ const routes = await store.route.findMany({
1516
+ where: {
1517
+ schema: {
1518
+ equals: schema
1519
+ }
1520
+ }
1521
+ });
1522
+ return routes.map((x) => ({ params: { id: x.page.toString(), market: x.market, locale: x.locale } }));
1523
+ }
1524
+ async function decorateHref(item, market = "ww", locale = "en") {
1525
+ const routes = await getRoutes({
1526
+ where: {
1527
+ schema: {
1528
+ equals: item.schema
1529
+ },
1530
+ page: {
1531
+ equals: item.id
1532
+ },
1533
+ market: {
1534
+ equals: market
1535
+ },
1536
+ locale: {
1537
+ equals: locale
1538
+ }
1539
+ }
1540
+ });
1541
+ const href = routes.length ? routes[0].id : null;
1542
+ return { ...item, href };
1543
+ }
1544
+ async function getBreadcrumbFromSegments(segments, market = "ww", locale = "en") {
1545
+ const routes = await getRoutes({
1546
+ where: {
1547
+ market: {
1548
+ equals: market
1549
+ },
1550
+ locale: {
1551
+ equals: locale
1552
+ }
1553
+ }
1554
+ });
1555
+ const tree = segments.map((segment) => {
1556
+ const route = segment.schema && segment.page ? routes.find(
1557
+ (r) => r.schema === segment.schema && r.page === segment.page
1558
+ ) : void 0;
1559
+ const href = route ? route.id.toString() : "/#";
1560
+ return { segment, href };
1561
+ }).map((x) => {
1562
+ const segment = x.segment;
1563
+ const href = x.href;
1564
+ let title = segment.title || "untitled";
1565
+ if ((0, import_bom_mixer_core.isLocalizedString)(title)) {
1566
+ title = (0, import_bom_mixer_core.localizedToString)(title, locale);
1567
+ }
1568
+ return {
1569
+ id: segment.id,
1570
+ title,
1571
+ href,
1572
+ items: []
1573
+ };
1574
+ });
1575
+ return tree;
1576
+ }
1577
+ async function getRouteLinkTree(market = "ww", locale = "en") {
1578
+ const store = await (0, import_bom_mixer_store5.getStore)();
1579
+ const routes = await store.route.findMany({
1580
+ where: {
1581
+ market: {
1582
+ equals: market
1583
+ },
1584
+ locale: {
1585
+ equals: locale
1586
+ }
1587
+ },
1588
+ market,
1589
+ locale
1590
+ });
1591
+ const categories = await store.category.findMany();
1592
+ const homepage = categories.find((x) => x.id === "homepage");
1593
+ if (homepage) {
1594
+ const root = categoryToRouteLink(routes, categories, homepage, locale);
1595
+ return root;
1596
+ }
1597
+ return void 0;
1598
+ }
1599
+ function categoryToRouteLink(routes, categories, category, locale = "en") {
1600
+ const route = routes.find(
1601
+ (r) => r.category === category.id
1602
+ );
1603
+ const href = route ? route.id.toString() : "/#";
1604
+ let title = category.title || "untitled";
1605
+ if ((0, import_bom_mixer_core.isLocalizedString)(title)) {
1606
+ title = (0, import_bom_mixer_core.localizedToString)(title, locale);
1607
+ }
1608
+ const childCategories = categories.filter((x) => {
1609
+ const parentId = x.category && typeof x.category === "object" ? x.category["id"] : x.category;
1610
+ return category.id === "homepage" ? x.id !== "homepage" && (parentId === category.id || !parentId) : parentId === category.id;
1611
+ });
1612
+ return {
1613
+ id: category.id,
1614
+ title,
1615
+ href,
1616
+ media: category.media,
1617
+ items: childCategories.map((x) => categoryToRouteLink(routes, categories, x, locale))
1618
+ };
1619
+ }
1620
+ function resolveRoute(route) {
1621
+ const routepath = route.template ? route.template : route.schema;
1622
+ const resolvedPathname = `/${route.market}/${route.locale}/${routepath}/${route.page}`;
1623
+ return resolvedPathname;
1624
+ }
1625
+
1626
+ // src/checkout/checkout.service.ts
1627
+ async function getItems(items, market, locale, user) {
1628
+ return items.map((x) => ({ ...x, fullPrice: x.price, price: x.price * 0.9 }));
1629
+ }
1630
+ async function getInfo(checkout, market, locale) {
1631
+ const countries = await getCountries(locale);
1632
+ const provinces = await getProvinces(locale);
1633
+ const regions = await getRegions(locale);
1634
+ const data = { countries, regions, provinces };
1635
+ return data;
1636
+ }
1637
+ async function getDeliveries(checkout, market, locale) {
1638
+ return [
1639
+ {
1640
+ "id": 1,
1641
+ "name": "In-store pick up",
1642
+ "abstract": "Conveniently collect from your nearest shop at no extra charge",
1643
+ "price": 0,
1644
+ "fullPrice": 0
1645
+ },
1646
+ {
1647
+ "id": 2,
1648
+ "name": "Courier delivery",
1649
+ "abstract": "Packaged goods are delivered by our trusted forwarder.",
1650
+ "price": 81,
1651
+ "fullPrice": 81
1652
+ },
1653
+ {
1654
+ "id": 3,
1655
+ "name": "In-home courier delivery",
1656
+ "abstract": "Packaged goods are delivered inside at front door. <br>White glove delivery, unpacking, assembly, or removal of debris is optional on request.",
1657
+ "price": 156,
1658
+ "fullPrice": 156
1659
+ }
1660
+ ];
1661
+ }
1662
+ async function getStores(checkout, market, locale) {
1663
+ return [
1664
+ {
1665
+ "id": 10366,
1666
+ "category": { "id": "store_category_distributor", "name": "Hexagon Distributor" },
1667
+ "name": "Di Paolo Arredamenti",
1668
+ "address": "Viale Cesare Battisti",
1669
+ "streetNumber": "80",
1670
+ "zipCode": "64020",
1671
+ "city": "Bellante",
1672
+ "country": { "id": "it", "name": "Italy" },
1673
+ "phoneNumber": "+39 0861 616436",
1674
+ "timetable": [],
1675
+ "position": {
1676
+ "latitude": 0,
1677
+ "longitude": 0
1678
+ },
1679
+ "distance": 151.84174300013095,
1680
+ "rank": 1
1681
+ },
1682
+ {
1683
+ "id": 7430,
1684
+ "category": { "id": "store_category_distributor", "name": "Hexagon Distributor" },
1685
+ "name": "Mancini Italian Design & Art S.r.l.",
1686
+ "address": "Via Ascari",
1687
+ "streetNumber": "2",
1688
+ "zipCode": "41053",
1689
+ "city": "Maranello",
1690
+ "country": { "id": "it", "name": "Italy" },
1691
+ "email": "info@mancinimida.com",
1692
+ "timetable": [],
1693
+ "position": {
1694
+ "latitude": 0,
1695
+ "longitude": 0
1696
+ },
1697
+ "distance": 170.6551472799284,
1698
+ "rank": 2
1699
+ },
1700
+ {
1701
+ "id": 325,
1702
+ "category": { "id": "store_category_distributor", "name": "Hexagon Distributor" },
1703
+ "name": "AD dal Pozzo",
1704
+ "address": "Via Mazzini",
1705
+ "streetNumber": "24",
1706
+ "zipCode": "36040",
1707
+ "city": "Grisignano Di Zocco",
1708
+ "country": { "id": "it", "name": "Italy" },
1709
+ "phoneNumber": "+39 0444 614521",
1710
+ "email": "mfort@websolute.it",
1711
+ "timetable": [],
1712
+ "position": {
1713
+ "latitude": 0,
1714
+ "longitude": 0
1715
+ },
1716
+ "distance": 196.0600048738732,
1717
+ "rank": 3
1718
+ }
1719
+ ];
1720
+ }
1721
+ async function getPayments(checkout, market, locale) {
1722
+ return [
1723
+ {
1724
+ "id": "alipay",
1725
+ "name": "Alipay",
1726
+ "media": {
1727
+ "type": "image",
1728
+ "src": "/assets/payment/alipay.svg"
1729
+ }
1730
+ },
1731
+ {
1732
+ "id": "amex",
1733
+ "name": "American Express",
1734
+ "media": {
1735
+ "type": "image",
1736
+ "src": "/assets/payment/american-express.svg"
1737
+ }
1738
+ },
1739
+ {
1740
+ "id": "apple-pay",
1741
+ "name": "Apple Pay",
1742
+ "media": {
1743
+ "type": "image",
1744
+ "src": "/assets/payment/apple-pay.svg"
1745
+ }
1746
+ },
1747
+ {
1748
+ "id": "bank-transfer",
1749
+ "name": "Bank Transfer",
1750
+ "media": {
1751
+ "type": "image",
1752
+ "src": "/assets/payment/bank-transfer.svg"
1753
+ }
1754
+ },
1755
+ {
1756
+ "id": "cbc",
1757
+ "name": "CBC",
1758
+ "media": {
1759
+ "type": "image",
1760
+ "src": "/assets/payment/cbc.svg"
1761
+ }
1762
+ },
1763
+ {
1764
+ "id": "direct-debit",
1765
+ "name": "Direct Debit",
1766
+ "media": {
1767
+ "type": "image",
1768
+ "src": "/assets/payment/direct-debit.svg"
1769
+ }
1770
+ },
1771
+ {
1772
+ "id": "googlepay",
1773
+ "name": "Google Pay",
1774
+ "media": {
1775
+ "type": "image",
1776
+ "src": "/assets/payment/googlepay.svg"
1777
+ }
1778
+ },
1779
+ {
1780
+ "id": "ideal",
1781
+ "name": "iDEAL",
1782
+ "media": {
1783
+ "type": "image",
1784
+ "src": "/assets/payment/ideal.svg"
1785
+ }
1786
+ },
1787
+ {
1788
+ "id": "maestro",
1789
+ "name": "Maestro",
1790
+ "media": {
1791
+ "type": "image",
1792
+ "src": "/assets/payment/maestro.svg"
1793
+ }
1794
+ },
1795
+ {
1796
+ "id": "mastercard",
1797
+ "name": "MasterCard",
1798
+ "abstract": "<p>You can use your Mastercard credit card. The 3DS authentication procedure will be used when the order is concluded, and you will be redirected to the bank's web page. To complete the order, follow the required steps.</p>",
1799
+ "media": {
1800
+ "type": "image",
1801
+ "src": "/assets/payment/mastercard.svg"
1802
+ }
1803
+ },
1804
+ {
1805
+ "id": "mybank",
1806
+ "name": "MyBank",
1807
+ "media": {
1808
+ "type": "image",
1809
+ "src": "/assets/payment/mybank.svg"
1810
+ }
1811
+ },
1812
+ {
1813
+ "id": "paypal",
1814
+ "name": "PayPal",
1815
+ "media": {
1816
+ "type": "image",
1817
+ "src": "/assets/payment/paypal.svg"
1818
+ }
1819
+ },
1820
+ {
1821
+ "id": "trustly",
1822
+ "name": "Trustly",
1823
+ "media": {
1824
+ "type": "image",
1825
+ "src": "/assets/payment/trustly.svg"
1826
+ }
1827
+ },
1828
+ {
1829
+ "id": "visa",
1830
+ "name": "Visa",
1831
+ "abstract": "<p>You can use your Visa credit card. The 3DS authentication procedure will be used when the order is concluded, and you will be redirected to the bank's web page. To complete the order, follow the required steps.</p>",
1832
+ "media": {
1833
+ "type": "image",
1834
+ "src": "/assets/payment/visa.svg"
1835
+ }
1836
+ },
1837
+ {
1838
+ "id": "wechatpay",
1839
+ "name": "WeChat Pay",
1840
+ "media": {
1841
+ "type": "image",
1842
+ "src": "/assets/payment/wechatpay.svg"
1843
+ }
1844
+ },
1845
+ {
1846
+ "id": "wire-transfer",
1847
+ "name": "Wire Transfer",
1848
+ "abstract": "<p>The order confirmation will contain a summary of the total amount to be paid and the details of the bank to which the payment is to be made..</p><p> Once the payment has been made, the order will be activated and the delivery terms indicated for the various items ordered will apply. The successful completion of the payment will be communicated by email to the email address indicated during registration.</p>",
1849
+ "media": {
1850
+ "type": "image",
1851
+ "src": "/assets/payment/wire-transfer.svg"
1852
+ }
1853
+ }
1854
+ ];
1855
+ }
1856
+ async function updateCheckout(checkout, action, market, locale) {
1857
+ const subTotal = checkout.items ? checkout.items.reduce((p, c) => {
1858
+ return p + c.price * c.qty;
1859
+ }, 0) : 0;
1860
+ const subTotalFull = checkout.items ? checkout.items.reduce((p, c) => {
1861
+ return p + c.fullPrice * c.qty;
1862
+ }, 0) : 0;
1863
+ const subTotalDiscountPrice = checkout.discounts ? checkout.discounts.reduce((p, c) => {
1864
+ let value = 0;
1865
+ switch (c.id) {
1866
+ case "coupon10":
1867
+ value = subTotal * 0.1 * -1;
1868
+ c.price = value;
1869
+ break;
1870
+ case "coupon50":
1871
+ value = subTotal * 0.5 * -1;
1872
+ c.price = value;
1873
+ break;
1874
+ }
1875
+ return p + value;
1876
+ }, 0) : 0;
1877
+ const deliveryPrice = checkout.delivery?.price || 0;
1878
+ const afterTaxesDiscountPrice = checkout.discounts ? checkout.discounts.reduce((p, c) => {
1879
+ let value = 0;
1880
+ switch (c.id) {
1881
+ case "shipping":
1882
+ value = deliveryPrice * -1;
1883
+ c.price = value;
1884
+ break;
1885
+ }
1886
+ return p + value;
1887
+ }, 0) : 0;
1888
+ const taxes = (subTotal + subTotalDiscountPrice) * 0.2;
1889
+ const total = subTotal + subTotalDiscountPrice + taxes + deliveryPrice + afterTaxesDiscountPrice;
1890
+ checkout.subTotal = subTotal;
1891
+ checkout.subTotalFull = subTotalFull;
1892
+ checkout.taxes = taxes;
1893
+ checkout.total = total;
1894
+ return checkout;
1895
+ }
1896
+ async function setDiscountCode(discountCode, checkout, market, locale) {
1897
+ const discounts = [];
1898
+ if (discountCode === "shipping") {
1899
+ discounts.push({
1900
+ "id": "shipping",
1901
+ "name": "shipping",
1902
+ "abstract": "Free shipping",
1903
+ "price": (checkout.delivery?.price || 0) * -1,
1904
+ "validFrom": /* @__PURE__ */ new Date(),
1905
+ "validTo": /* @__PURE__ */ new Date()
1906
+ });
1907
+ }
1908
+ if (discountCode === "coupon10") {
1909
+ discounts.push({
1910
+ "id": "coupon10",
1911
+ "name": "coupon10",
1912
+ "abstract": "10%",
1913
+ "price": (checkout.items?.reduce((p, c) => p + c.price * c.qty * 0.1, 0) || 0) * -1,
1914
+ "validFrom": /* @__PURE__ */ new Date(),
1915
+ "validTo": /* @__PURE__ */ new Date()
1916
+ });
1917
+ }
1918
+ if (discountCode === "coupon50") {
1919
+ discounts.push({
1920
+ "id": "coupon50",
1921
+ "name": "coupon50",
1922
+ "abstract": "50%",
1923
+ "price": (checkout.items?.reduce((p, c) => p + c.price * c.qty * 0.5, 0) || 0) * -1,
1924
+ "validFrom": /* @__PURE__ */ new Date(),
1925
+ "validTo": /* @__PURE__ */ new Date()
1926
+ });
1927
+ }
1928
+ return await updateCheckout({ ...checkout, discounts }, "discount", market, locale);
1929
+ }
1930
+ async function getPayment(checkout, market, locale) {
1931
+ const knownRoutes = await getRoutesForSchemas(["checkout_result"], market, locale);
1932
+ const redirectUrl = `${knownRoutes.checkout_result}?orderId=1&status=OK`;
1933
+ return { redirectUrl };
1934
+ }
1935
+
1936
+ // src/feature_type/feature_type.service.ts
1937
+ var import_bom_mixer_store6 = require("@websolutespa/bom-mixer-store");
1938
+ async function getFeatureTypes(params = {}) {
1939
+ const store = await (0, import_bom_mixer_store6.getStore)();
1940
+ const items = await store.feature_type.findMany(params);
1941
+ return items;
1942
+ }
1943
+
1944
+ // src/label/label.service.ts
1945
+ var import_bom_mixer_store7 = require("@websolutespa/bom-mixer-store");
1946
+ async function getLabels(params = {}) {
1947
+ const store = await (0, import_bom_mixer_store7.getStore)();
1948
+ const items = await store.label.findMany(params);
1949
+ return items;
1950
+ }
1951
+ function resolveLabel(labels, id) {
1952
+ const label = labels.find((x) => x.id === id);
1953
+ return label && label.text ? label.text.toString() : id;
1954
+ }
1955
+
1956
+ // src/locale/locale.service.ts
1957
+ var import_bom_mixer_store8 = require("@websolutespa/bom-mixer-store");
1958
+ async function getLocales(params = {}) {
1959
+ const store = await (0, import_bom_mixer_store8.getStore)();
1960
+ const items = await store.locale.findMany(params);
1961
+ return items;
1962
+ }
1963
+
1964
+ // src/market/market.service.ts
1965
+ var import_bom_mixer_store9 = require("@websolutespa/bom-mixer-store");
1966
+ async function getMarkets(params = {}) {
1967
+ const store = await (0, import_bom_mixer_store9.getStore)();
1968
+ const items = await store.market.findMany(params);
1969
+ return items;
1970
+ }
1971
+
1972
+ // src/layout/layout.service.ts
1973
+ async function getLayout(market, locale) {
1974
+ const markets = await getMarkets({ locale });
1975
+ const locales = await getLocales({ locale });
1976
+ const labels = await getLabels({ locale });
1977
+ const tree = await getRouteLinkTree(market, locale);
1978
+ const firstLevelRoutes = tree?.items || [];
1979
+ const flatTopLevelRoutes = tree ? [tree, ...firstLevelRoutes] : [];
1980
+ const topLevelRoutes = flatTopLevelRoutes.reduce((object, route) => {
1981
+ object[route.id] = route;
1982
+ return object;
1983
+ }, {});
1984
+ const topLevelHrefs = flatTopLevelRoutes.reduce((object, route) => {
1985
+ if (route.href) {
1986
+ object[route.id] = route.href;
1987
+ }
1988
+ return object;
1989
+ }, {});
1990
+ const navs = {
1991
+ primary: tree && tree.items ? tree.items : [],
1992
+ secondary: [],
1993
+ footer: []
1994
+ };
1995
+ return {
1996
+ markets,
1997
+ market,
1998
+ locales,
1999
+ locale,
2000
+ labels,
2001
+ tree,
2002
+ navs,
2003
+ topLevelRoutes,
2004
+ topLevelHrefs
2005
+ };
2006
+ }
2007
+
2008
+ // src/list/list.service.ts
2009
+ var import_bom_mixer_store10 = require("@websolutespa/bom-mixer-store");
2010
+ async function getLists(locale) {
2011
+ const store = await (0, import_bom_mixer_store10.getStore)();
2012
+ const items = await store.list.findMany({ locale });
2013
+ return items;
2014
+ }
2015
+ async function getListByKeys(keys, locale) {
2016
+ const store = await (0, import_bom_mixer_store10.getStore)();
2017
+ const items = await store.list.findMany({ locale });
2018
+ const lists = {};
2019
+ items.filter((x) => x.key && keys.includes(x.key)).forEach((x) => {
2020
+ lists[x.key] = items.filter((i) => i.listId === x.id);
2021
+ });
2022
+ return lists;
2023
+ }
2024
+
2025
+ // src/menu/menu.service.ts
2026
+ var import_bom_mixer_store11 = require("@websolutespa/bom-mixer-store");
2027
+ async function getMenu(id) {
2028
+ const store = await (0, import_bom_mixer_store11.getStore)();
2029
+ const item = await store.menu.findOne({
2030
+ where: {
2031
+ id: {
2032
+ equals: id
2033
+ }
2034
+ }
2035
+ });
2036
+ return item;
2037
+ }
2038
+ async function getMenus() {
2039
+ const store = await (0, import_bom_mixer_store11.getStore)();
2040
+ const items = await store.menu.findMany();
2041
+ return items;
2042
+ }
2043
+
2044
+ // src/order/order.ts
2045
+ var IOrderStatus = {
2046
+ Pending: "pending",
2047
+ // Customer started the checkout process but did not complete it. Incomplete orders are assigned a "Pending" status and can be found under the More tab in the View Orders screen.
2048
+ AwaitingPayment: "awaitingPayment",
2049
+ // Customer has completed the checkout process, but payment has yet to be confirmed. Authorize only transactions that are not yet captured have this status.
2050
+ AwaitingFulfillment: "awaitingFulfillment",
2051
+ // Customer has completed the checkout process and payment has been confirmed.
2052
+ AwaitingShipment: "awaitingShipment",
2053
+ // Order has been pulled and packaged and is awaiting collection from a shipping provider.
2054
+ AwaitingPickup: "awaitingPickup",
2055
+ // Order has been packaged and is awaiting customer pickup from a seller-specified location.
2056
+ PartiallyShipped: "partiallyShipped",
2057
+ // Only some items in the order have been shipped.
2058
+ Completed: "completed",
2059
+ // Order has been shipped/picked up, and receipt is confirmed; client has paid for their digital product, and their file(s) are available for download.
2060
+ Shipped: "shipped",
2061
+ // Order has been shipped, but receipt has not been confirmed; seller has used the Ship Items action. A listing of all orders with a "Shipped" status can be found under the More tab of the View Orders screen.
2062
+ Cancelled: "cancelled",
2063
+ // Seller has cancelled an order, due to a stock inconsistency or other reasons. Stock levels will automatically update depending on your Inventory Settings. Cancelling an order will not refund the order. This status is triggered automatically when an order using an authorize-only payment gateway is voided in the control panel before capturing payment.
2064
+ Declined: "declined",
2065
+ // Seller has marked the order as declined.
2066
+ Refunded: "refunded",
2067
+ // Seller has used the Refund action to refund the whole order. A listing of all orders with a "Refunded" status can be found under the More tab of the View Orders screen.
2068
+ Disputed: "disputed",
2069
+ // Customer has initiated a dispute resolution process for the PayPal transaction that paid for the order or the seller has marked the order as a fraudulent order.
2070
+ ManualVerificationRequired: "manualVerificationRequired",
2071
+ // Order on hold while some aspect, such as tax-exempt documentation, is manually confirmed. Orders with this status must be updated manually. Capturing funds or other order actions will not automatically update the status of an order marked Manual Verification Required.
2072
+ PartiallyRefunded: "partiallyRefunded"
2073
+ // Seller has partially refunded the order.
2074
+ };
2075
+
2076
+ // ../mock/src/order.json
2077
+ var order_default = {
2078
+ items: [
2079
+ {
2080
+ id: 1,
2081
+ date: "2022-10-25T10:59:54.420Z",
2082
+ status: "awaitingFulfillment",
2083
+ items: [
2084
+ {
2085
+ title: "Cabinet Large dark oak",
2086
+ media: {
2087
+ type: "image",
2088
+ src: "/assets/shop_detail/2693_n_Cabinet_large_dark_oak_440px_a.jpg"
2089
+ },
2090
+ category: "shop_category_furniture",
2091
+ collection: "Accents Accessories",
2092
+ designer: "Oeo Studio",
2093
+ categoryName: "Accents Accessories by Oeo Studio",
2094
+ description: "<p>Mobiletto in legno di rovere e cinghie in pelle da appendere a Rack 72/192.</p> <p>Colore: Rovere scuro + Pelle conciata al vegetale<br />Misure: 14,7 x 48 x 40,5 (H) cm</p>",
2095
+ price: 2318.4,
2096
+ availability: 6,
2097
+ slug: "cabinet-large-dark-oak",
2098
+ id: 156,
2099
+ schema: "shop_detail",
2100
+ href: "/ww/en/shop/furniture/cabinet-large-dark-oak",
2101
+ qty: 1,
2102
+ fullPrice: 2576
2103
+ },
2104
+ {
2105
+ media: {
2106
+ type: "image",
2107
+ src: "/assets/shop_detail/2697_n_Cabinet-Large-Light-oak-Vegetable-tanned-leather-14,7-x-48-x-40,5-H-cm_DETTAGLIO.jpg"
2108
+ },
2109
+ category: "shop_category_furniture",
2110
+ collection: "Accents Accessories",
2111
+ designer: "Oeo Studio",
2112
+ categoryName: "Accents Accessories by Oeo Studio",
2113
+ title: "Cabinet Large light oak",
2114
+ price: 2318.4,
2115
+ availability: 6,
2116
+ slug: "cabinet-large-light-oak",
2117
+ id: 157,
2118
+ schema: "shop_detail",
2119
+ href: "/ww/en/shop/furniture/cabinet-large-light-oak",
2120
+ qty: 1,
2121
+ fullPrice: 2576
2122
+ }
2123
+ ],
2124
+ user: {
2125
+ id: 1,
2126
+ schema: "user",
2127
+ firstName: "Jhon",
2128
+ lastName: "Appleseed",
2129
+ email: "jhon.appleseed@gmail.com"
2130
+ },
2131
+ shippingAddress: {
2132
+ firstName: "Jhon",
2133
+ lastName: "Appleseed",
2134
+ email: "jhon.appleseed@gmail.com",
2135
+ phoneNumber: "0721411112",
2136
+ country: {
2137
+ id: "it",
2138
+ name: "Italy"
2139
+ },
2140
+ region: {
2141
+ id: 10,
2142
+ name: "Marche"
2143
+ },
2144
+ province: {
2145
+ id: 175,
2146
+ name: "Pesaro Urbino"
2147
+ },
2148
+ address: "Strada della Campanara",
2149
+ streetNumber: "15",
2150
+ zipCode: "61122",
2151
+ city: "Pesaro"
2152
+ },
2153
+ hasInvoice: true,
2154
+ hasBilling: false,
2155
+ delivery: {
2156
+ id: 2,
2157
+ name: "Courier delivery",
2158
+ abstract: "Packaged goods are delivered by our trusted forwarder.",
2159
+ price: 81,
2160
+ fullPrice: 81
2161
+ },
2162
+ discounts: [
2163
+ {
2164
+ id: "shipping",
2165
+ name: "shipping",
2166
+ abstract: "Free shipping",
2167
+ price: -81,
2168
+ validFrom: "2022-10-31T09:17:08.309Z",
2169
+ validTo: "2022-10-31T09:17:08.309Z"
2170
+ }
2171
+ ],
2172
+ store: {
2173
+ id: 10366,
2174
+ category: {
2175
+ id: "store_category_distributor",
2176
+ name: "Hexagon Distributor"
2177
+ },
2178
+ name: "Di Paolo Arredamenti",
2179
+ address: "Viale Cesare Battisti",
2180
+ streetNumber: "80",
2181
+ zipCode: "64020",
2182
+ city: "Bellante",
2183
+ country: {
2184
+ id: "it",
2185
+ name: "Italy"
2186
+ },
2187
+ phoneNumber: "+39 0861 616436",
2188
+ timetable: [],
2189
+ position: {
2190
+ latitude: 0,
2191
+ longitude: 0
2192
+ },
2193
+ distance: 151.84174300013095,
2194
+ rank: 1
2195
+ },
2196
+ payment: {
2197
+ id: "bank-transfer",
2198
+ name: "Bank Transfer",
2199
+ media: {
2200
+ type: "image",
2201
+ src: "/assets/payment/bank-transfer.svg"
2202
+ }
2203
+ },
2204
+ subTotal: 4636.8,
2205
+ taxes: 927.3600000000001,
2206
+ total: 5564.16,
2207
+ subTotalFull: 5152
2208
+ },
2209
+ {
2210
+ id: 2,
2211
+ date: "2022-08-16T10:59:54.420Z",
2212
+ status: "completed",
2213
+ items: [
2214
+ {
2215
+ title: "Cabinet Large dark oak",
2216
+ media: {
2217
+ type: "image",
2218
+ src: "/assets/shop_detail/2693_n_Cabinet_large_dark_oak_440px_a.jpg"
2219
+ },
2220
+ category: "shop_category_furniture",
2221
+ collection: "Accents Accessories",
2222
+ designer: "Oeo Studio",
2223
+ categoryName: "Accents Accessories by Oeo Studio",
2224
+ description: "<p>Mobiletto in legno di rovere e cinghie in pelle da appendere a Rack 72/192.</p> <p>Colore: Rovere scuro + Pelle conciata al vegetale<br />Misure: 14,7 x 48 x 40,5 (H) cm</p>",
2225
+ price: 2318.4,
2226
+ availability: 6,
2227
+ slug: "cabinet-large-dark-oak",
2228
+ id: 156,
2229
+ schema: "shop_detail",
2230
+ href: "/ww/en/shop/furniture/cabinet-large-dark-oak",
2231
+ qty: 1,
2232
+ fullPrice: 2576
2233
+ },
2234
+ {
2235
+ media: {
2236
+ type: "image",
2237
+ src: "/assets/shop_detail/2697_n_Cabinet-Large-Light-oak-Vegetable-tanned-leather-14,7-x-48-x-40,5-H-cm_DETTAGLIO.jpg"
2238
+ },
2239
+ category: "shop_category_furniture",
2240
+ collection: "Accents Accessories",
2241
+ designer: "Oeo Studio",
2242
+ categoryName: "Accents Accessories by Oeo Studio",
2243
+ title: "Cabinet Large light oak",
2244
+ price: 2318.4,
2245
+ availability: 6,
2246
+ slug: "cabinet-large-light-oak",
2247
+ id: 157,
2248
+ schema: "shop_detail",
2249
+ href: "/ww/en/shop/furniture/cabinet-large-light-oak",
2250
+ qty: 1,
2251
+ fullPrice: 2576
2252
+ }
2253
+ ],
2254
+ user: {
2255
+ id: 1,
2256
+ schema: "user",
2257
+ firstName: "Jhon",
2258
+ lastName: "Appleseed",
2259
+ email: "jhon.appleseed@gmail.com"
2260
+ },
2261
+ shippingAddress: {
2262
+ firstName: "Jhon",
2263
+ lastName: "Appleseed",
2264
+ email: "jhon.appleseed@gmail.com",
2265
+ phoneNumber: "0721411112",
2266
+ country: {
2267
+ id: "it",
2268
+ name: "Italy"
2269
+ },
2270
+ region: {
2271
+ id: 10,
2272
+ name: "Marche"
2273
+ },
2274
+ province: {
2275
+ id: 175,
2276
+ name: "Pesaro Urbino"
2277
+ },
2278
+ address: "Strada della Campanara",
2279
+ streetNumber: "15",
2280
+ zipCode: "61122",
2281
+ city: "Pesaro"
2282
+ },
2283
+ hasInvoice: true,
2284
+ hasBilling: false,
2285
+ delivery: {
2286
+ id: 2,
2287
+ name: "Courier delivery",
2288
+ abstract: "Packaged goods are delivered by our trusted forwarder.",
2289
+ price: 81,
2290
+ fullPrice: 81
2291
+ },
2292
+ discounts: [
2293
+ {
2294
+ id: "shipping",
2295
+ name: "shipping",
2296
+ abstract: "Free shipping",
2297
+ price: -81,
2298
+ validFrom: "2022-10-31T09:17:08.309Z",
2299
+ validTo: "2022-10-31T09:17:08.309Z"
2300
+ }
2301
+ ],
2302
+ store: {
2303
+ id: 10366,
2304
+ category: {
2305
+ id: "store_category_distributor",
2306
+ name: "Hexagon Distributor"
2307
+ },
2308
+ name: "Di Paolo Arredamenti",
2309
+ address: "Viale Cesare Battisti",
2310
+ streetNumber: "80",
2311
+ zipCode: "64020",
2312
+ city: "Bellante",
2313
+ country: {
2314
+ id: "it",
2315
+ name: "Italy"
2316
+ },
2317
+ phoneNumber: "+39 0861 616436",
2318
+ timetable: [],
2319
+ position: {
2320
+ latitude: 0,
2321
+ longitude: 0
2322
+ },
2323
+ distance: 151.84174300013095,
2324
+ rank: 1
2325
+ },
2326
+ payment: {
2327
+ id: "bank-transfer",
2328
+ name: "Bank Transfer",
2329
+ media: {
2330
+ type: "image",
2331
+ src: "/assets/payment/bank-transfer.svg"
2332
+ }
2333
+ },
2334
+ subTotal: 4636.8,
2335
+ taxes: 927.3600000000001,
2336
+ total: 5564.16,
2337
+ subTotalFull: 5152
2338
+ }
2339
+ ]
2340
+ };
2341
+
2342
+ // src/order/order.service.ts
2343
+ async function getOrders(market, locale) {
2344
+ const knownRoutes = await getRoutesForTemplates(["reserved_area_order_detail"], market, locale);
2345
+ return order_default.items.map((x) => {
2346
+ const orderDetail = {
2347
+ ...x,
2348
+ href: `${knownRoutes.reserved_area_order_detail}?orderId=${x.id}`
2349
+ };
2350
+ return orderDetail;
2351
+ });
2352
+ }
2353
+ async function getOrder(id, market, locale) {
2354
+ const knownRoutes = await getRoutesForTemplates(["reserved_area_order_detail"], market, locale);
2355
+ const order = order_default.items.find((x) => String(x.id) === String(id)) || null;
2356
+ if (order) {
2357
+ const orderDetail = {
2358
+ ...order,
2359
+ href: `${knownRoutes.reserved_area_order_detail}?orderId=${order.id}`
2360
+ };
2361
+ return orderDetail;
2362
+ }
2363
+ return order;
2364
+ }
2365
+
2366
+ // src/page/page.service.ts
2367
+ var import_bom_mixer_store12 = require("@websolutespa/bom-mixer-store");
2368
+ async function findPage(schema, params) {
2369
+ const store = await (0, import_bom_mixer_store12.getStore)();
2370
+ const collection = store[schema];
2371
+ if (!collection) {
2372
+ throw `PageService.findPage: Collection not found [${schema}]`;
2373
+ }
2374
+ const page = await collection.findOne(params);
2375
+ if (page) {
2376
+ return page;
2377
+ } else {
2378
+ console.log("PageService.getPage.notfound", schema, params);
2379
+ return;
2380
+ }
2381
+ }
2382
+ async function getPage(schema, id, market, locale) {
2383
+ const store = await (0, import_bom_mixer_store12.getStore)();
2384
+ const page = await findPage(schema, {
2385
+ where: {
2386
+ id: {
2387
+ equals: id
2388
+ }
2389
+ },
2390
+ market,
2391
+ locale
2392
+ });
2393
+ if (page) {
2394
+ const routes = await store.route.findMany({
2395
+ where: {
2396
+ page: {
2397
+ equals: id
2398
+ },
2399
+ schema: {
2400
+ equals: schema
2401
+ }
2402
+ }
2403
+ });
2404
+ const currentRoute = routes.find((x) => x.market === market && x.locale === locale);
2405
+ if (!currentRoute) {
2406
+ throw "No route found for page " + schema + ":" + id + " in market " + market + " and locale " + locale;
2407
+ }
2408
+ const alternates = routes.filter((x) => x.market !== market || x.locale !== locale);
2409
+ const segments = await getSegments(page);
2410
+ const breadcrumb = await getBreadcrumbFromSegments(segments, market, locale);
2411
+ const parentRoute = breadcrumb.length > 1 ? breadcrumb[breadcrumb.length - 2] : void 0;
2412
+ return {
2413
+ ...page,
2414
+ href: currentRoute.id,
2415
+ // !!! route?
2416
+ alternates,
2417
+ breadcrumb,
2418
+ parentRoute
2419
+ };
2420
+ } else {
2421
+ console.log("PageService.getPage.notfound", schema, id, locale);
2422
+ return;
2423
+ }
2424
+ }
2425
+ async function getPageCategory(schema, page, market, locale) {
2426
+ if (!page) {
2427
+ return;
2428
+ }
2429
+ const store = await (0, import_bom_mixer_store12.getStore)();
2430
+ const category = await findPage(schema, {
2431
+ where: {
2432
+ category: {
2433
+ equals: typeof page.category === "object" ? page.category.id : page.category
2434
+ }
2435
+ },
2436
+ market,
2437
+ locale
2438
+ });
2439
+ if (category) {
2440
+ const routes = await store.route.findMany({
2441
+ where: {
2442
+ schema: {
2443
+ equals: schema
2444
+ },
2445
+ page: {
2446
+ equals: category.id
2447
+ }
2448
+ }
2449
+ });
2450
+ const currentRoute = routes.find((x) => x.market === market && x.locale === locale);
2451
+ if (!currentRoute) {
2452
+ throw "No route found for page " + schema + ":" + category.id + " in market " + market + " and locale " + locale;
2453
+ }
2454
+ return {
2455
+ ...category,
2456
+ href: currentRoute.id
2457
+ };
2458
+ } else {
2459
+ console.log("PageService.getPageCategory.notfound", schema, locale);
2460
+ return;
2461
+ }
2462
+ }
2463
+ async function getErrorPageLayout() {
2464
+ const defaultMarket = "ww";
2465
+ const defaultLocale = "en";
2466
+ const layout = await getLayout(defaultMarket, defaultLocale);
2467
+ const title = resolveLabel(layout.labels, "notfound.title");
2468
+ const abstract = resolveLabel(layout.labels, "notfound.abstract");
2469
+ const page = {
2470
+ id: "notfound",
2471
+ schema: "notfound",
2472
+ href: "",
2473
+ alternates: [],
2474
+ breadcrumb: [],
2475
+ title,
2476
+ abstract,
2477
+ category: "homepage",
2478
+ meta: {
2479
+ title,
2480
+ description: abstract,
2481
+ keywords: "",
2482
+ robots: "all"
2483
+ }
2484
+ };
2485
+ return { layout, page };
2486
+ }
2487
+
2488
+ // src/route/route.interceptor.ts
2489
+ var import_bom_mixer_core2 = require("@websolutespa/bom-mixer-core");
2490
+ var import_server = __toESM(require_server());
2491
+ async function routeInterceptor(request, next) {
2492
+ let url = request.nextUrl;
2493
+ let route;
2494
+ try {
2495
+ route = await (0, import_bom_mixer_core2.apiPost)("/route", { pathname: url.pathname });
2496
+ if (!route) {
2497
+ console.log("routeInterceptor.route.notfound", url.pathname);
2498
+ return;
2499
+ }
2500
+ } catch (error) {
2501
+ console.log("routeInterceptor.error", url.pathname, error, error.url, error.status, error.statusText);
2502
+ return;
2503
+ }
2504
+ url = request.nextUrl.clone();
2505
+ const resolvedPathname = resolveRoute(route);
2506
+ url.pathname = resolvedPathname;
2507
+ const response = import_server.NextResponse.rewrite(url);
2508
+ return response;
2509
+ }
2510
+ // Annotate the CommonJS export names for ESM import in node:
2511
+ 0 && (module.exports = {
2512
+ IOrderStatus,
2513
+ categoryToRouteLink,
2514
+ decorateHref,
2515
+ findPage,
2516
+ getBreadcrumbFromSegments,
2517
+ getCategories,
2518
+ getCountries,
2519
+ getDeliveries,
2520
+ getErrorPageLayout,
2521
+ getFeatureTypes,
2522
+ getInfo,
2523
+ getItems,
2524
+ getLabels,
2525
+ getLayout,
2526
+ getListByKeys,
2527
+ getLists,
2528
+ getLocales,
2529
+ getMarkets,
2530
+ getMenu,
2531
+ getMenus,
2532
+ getOrder,
2533
+ getOrders,
2534
+ getPage,
2535
+ getPageCategory,
2536
+ getPayment,
2537
+ getPayments,
2538
+ getProvinces,
2539
+ getRegions,
2540
+ getRoute,
2541
+ getRouteLinkTree,
2542
+ getRouteSegments,
2543
+ getRoutes,
2544
+ getRoutesForSchemas,
2545
+ getRoutesForTemplates,
2546
+ getSegments,
2547
+ getStaticPathsForSchema,
2548
+ getStores,
2549
+ resolveLabel,
2550
+ resolveRoute,
2551
+ routeInterceptor,
2552
+ setDiscountCode,
2553
+ updateCheckout
2554
+ });
2555
+ /*! Bundled license information:
2556
+
2557
+ next/dist/compiled/cookie/index.js:
2558
+ (*!
2559
+ * cookie
2560
+ * Copyright(c) 2012-2014 Roman Shtylman
2561
+ * Copyright(c) 2015 Douglas Christopher Wilson
2562
+ * MIT Licensed
2563
+ *)
2564
+
2565
+ next/dist/compiled/ua-parser-js/ua-parser.js:
2566
+ (*!@license
2567
+ * UAParser.js v0.7.28
2568
+ * Lightweight JavaScript-based User-Agent string parser
2569
+ * https://github.com/faisalman/ua-parser-js
2570
+ *
2571
+ * Copyright © 2012-2021 Faisal Salman <f@faisalman.com>
2572
+ * Licensed under MIT License
2573
+ *)
2574
+ */