@ikas/storefront 0.0.23 → 0.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var mobx = require('mobx');
|
|
6
|
-
var queryString
|
|
6
|
+
var queryString = require('querystring');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var mobxReactLite = require('mobx-react-lite');
|
|
9
9
|
var router = require('next/router');
|
|
@@ -14,7 +14,7 @@ var dynamic = require('next/dynamic');
|
|
|
14
14
|
|
|
15
15
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
16
|
|
|
17
|
-
var queryString__default = /*#__PURE__*/_interopDefaultLegacy(queryString
|
|
17
|
+
var queryString__default = /*#__PURE__*/_interopDefaultLegacy(queryString);
|
|
18
18
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
19
19
|
var Image__default = /*#__PURE__*/_interopDefaultLegacy(Image);
|
|
20
20
|
var Link__default = /*#__PURE__*/_interopDefaultLegacy(Link);
|
|
@@ -11047,505 +11047,6 @@ var IkasBrandListPropValueProvider = /** @class */ (function () {
|
|
|
11047
11047
|
return IkasBrandListPropValueProvider;
|
|
11048
11048
|
}());
|
|
11049
11049
|
|
|
11050
|
-
var strictUriEncode = str => encodeURIComponent(str).replace(/[!'()*]/g, x => `%${x.charCodeAt(0).toString(16).toUpperCase()}`);
|
|
11051
|
-
|
|
11052
|
-
var token = '%[a-f0-9]{2}';
|
|
11053
|
-
var singleMatcher = new RegExp(token, 'gi');
|
|
11054
|
-
var multiMatcher = new RegExp('(' + token + ')+', 'gi');
|
|
11055
|
-
|
|
11056
|
-
function decodeComponents(components, split) {
|
|
11057
|
-
try {
|
|
11058
|
-
// Try to decode the entire string first
|
|
11059
|
-
return decodeURIComponent(components.join(''));
|
|
11060
|
-
} catch (err) {
|
|
11061
|
-
// Do nothing
|
|
11062
|
-
}
|
|
11063
|
-
|
|
11064
|
-
if (components.length === 1) {
|
|
11065
|
-
return components;
|
|
11066
|
-
}
|
|
11067
|
-
|
|
11068
|
-
split = split || 1;
|
|
11069
|
-
|
|
11070
|
-
// Split the array in 2 parts
|
|
11071
|
-
var left = components.slice(0, split);
|
|
11072
|
-
var right = components.slice(split);
|
|
11073
|
-
|
|
11074
|
-
return Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right));
|
|
11075
|
-
}
|
|
11076
|
-
|
|
11077
|
-
function decode(input) {
|
|
11078
|
-
try {
|
|
11079
|
-
return decodeURIComponent(input);
|
|
11080
|
-
} catch (err) {
|
|
11081
|
-
var tokens = input.match(singleMatcher);
|
|
11082
|
-
|
|
11083
|
-
for (var i = 1; i < tokens.length; i++) {
|
|
11084
|
-
input = decodeComponents(tokens, i).join('');
|
|
11085
|
-
|
|
11086
|
-
tokens = input.match(singleMatcher);
|
|
11087
|
-
}
|
|
11088
|
-
|
|
11089
|
-
return input;
|
|
11090
|
-
}
|
|
11091
|
-
}
|
|
11092
|
-
|
|
11093
|
-
function customDecodeURIComponent(input) {
|
|
11094
|
-
// Keep track of all the replacements and prefill the map with the `BOM`
|
|
11095
|
-
var replaceMap = {
|
|
11096
|
-
'%FE%FF': '\uFFFD\uFFFD',
|
|
11097
|
-
'%FF%FE': '\uFFFD\uFFFD'
|
|
11098
|
-
};
|
|
11099
|
-
|
|
11100
|
-
var match = multiMatcher.exec(input);
|
|
11101
|
-
while (match) {
|
|
11102
|
-
try {
|
|
11103
|
-
// Decode as big chunks as possible
|
|
11104
|
-
replaceMap[match[0]] = decodeURIComponent(match[0]);
|
|
11105
|
-
} catch (err) {
|
|
11106
|
-
var result = decode(match[0]);
|
|
11107
|
-
|
|
11108
|
-
if (result !== match[0]) {
|
|
11109
|
-
replaceMap[match[0]] = result;
|
|
11110
|
-
}
|
|
11111
|
-
}
|
|
11112
|
-
|
|
11113
|
-
match = multiMatcher.exec(input);
|
|
11114
|
-
}
|
|
11115
|
-
|
|
11116
|
-
// Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else
|
|
11117
|
-
replaceMap['%C2'] = '\uFFFD';
|
|
11118
|
-
|
|
11119
|
-
var entries = Object.keys(replaceMap);
|
|
11120
|
-
|
|
11121
|
-
for (var i = 0; i < entries.length; i++) {
|
|
11122
|
-
// Replace all decoded components
|
|
11123
|
-
var key = entries[i];
|
|
11124
|
-
input = input.replace(new RegExp(key, 'g'), replaceMap[key]);
|
|
11125
|
-
}
|
|
11126
|
-
|
|
11127
|
-
return input;
|
|
11128
|
-
}
|
|
11129
|
-
|
|
11130
|
-
var decodeUriComponent = function (encodedURI) {
|
|
11131
|
-
if (typeof encodedURI !== 'string') {
|
|
11132
|
-
throw new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`');
|
|
11133
|
-
}
|
|
11134
|
-
|
|
11135
|
-
try {
|
|
11136
|
-
encodedURI = encodedURI.replace(/\+/g, ' ');
|
|
11137
|
-
|
|
11138
|
-
// Try the built in decoder first
|
|
11139
|
-
return decodeURIComponent(encodedURI);
|
|
11140
|
-
} catch (err) {
|
|
11141
|
-
// Fallback to a more advanced decoder
|
|
11142
|
-
return customDecodeURIComponent(encodedURI);
|
|
11143
|
-
}
|
|
11144
|
-
};
|
|
11145
|
-
|
|
11146
|
-
var splitOnFirst = (string, separator) => {
|
|
11147
|
-
if (!(typeof string === 'string' && typeof separator === 'string')) {
|
|
11148
|
-
throw new TypeError('Expected the arguments to be of type `string`');
|
|
11149
|
-
}
|
|
11150
|
-
|
|
11151
|
-
if (separator === '') {
|
|
11152
|
-
return [string];
|
|
11153
|
-
}
|
|
11154
|
-
|
|
11155
|
-
const separatorIndex = string.indexOf(separator);
|
|
11156
|
-
|
|
11157
|
-
if (separatorIndex === -1) {
|
|
11158
|
-
return [string];
|
|
11159
|
-
}
|
|
11160
|
-
|
|
11161
|
-
return [
|
|
11162
|
-
string.slice(0, separatorIndex),
|
|
11163
|
-
string.slice(separatorIndex + separator.length)
|
|
11164
|
-
];
|
|
11165
|
-
};
|
|
11166
|
-
|
|
11167
|
-
var queryString = createCommonjsModule(function (module, exports) {
|
|
11168
|
-
|
|
11169
|
-
|
|
11170
|
-
|
|
11171
|
-
|
|
11172
|
-
const isNullOrUndefined = value => value === null || value === undefined;
|
|
11173
|
-
|
|
11174
|
-
function encoderForArrayFormat(options) {
|
|
11175
|
-
switch (options.arrayFormat) {
|
|
11176
|
-
case 'index':
|
|
11177
|
-
return key => (result, value) => {
|
|
11178
|
-
const index = result.length;
|
|
11179
|
-
|
|
11180
|
-
if (
|
|
11181
|
-
value === undefined ||
|
|
11182
|
-
(options.skipNull && value === null) ||
|
|
11183
|
-
(options.skipEmptyString && value === '')
|
|
11184
|
-
) {
|
|
11185
|
-
return result;
|
|
11186
|
-
}
|
|
11187
|
-
|
|
11188
|
-
if (value === null) {
|
|
11189
|
-
return [...result, [encode(key, options), '[', index, ']'].join('')];
|
|
11190
|
-
}
|
|
11191
|
-
|
|
11192
|
-
return [
|
|
11193
|
-
...result,
|
|
11194
|
-
[encode(key, options), '[', encode(index, options), ']=', encode(value, options)].join('')
|
|
11195
|
-
];
|
|
11196
|
-
};
|
|
11197
|
-
|
|
11198
|
-
case 'bracket':
|
|
11199
|
-
return key => (result, value) => {
|
|
11200
|
-
if (
|
|
11201
|
-
value === undefined ||
|
|
11202
|
-
(options.skipNull && value === null) ||
|
|
11203
|
-
(options.skipEmptyString && value === '')
|
|
11204
|
-
) {
|
|
11205
|
-
return result;
|
|
11206
|
-
}
|
|
11207
|
-
|
|
11208
|
-
if (value === null) {
|
|
11209
|
-
return [...result, [encode(key, options), '[]'].join('')];
|
|
11210
|
-
}
|
|
11211
|
-
|
|
11212
|
-
return [...result, [encode(key, options), '[]=', encode(value, options)].join('')];
|
|
11213
|
-
};
|
|
11214
|
-
|
|
11215
|
-
case 'comma':
|
|
11216
|
-
case 'separator':
|
|
11217
|
-
return key => (result, value) => {
|
|
11218
|
-
if (value === null || value === undefined || value.length === 0) {
|
|
11219
|
-
return result;
|
|
11220
|
-
}
|
|
11221
|
-
|
|
11222
|
-
if (result.length === 0) {
|
|
11223
|
-
return [[encode(key, options), '=', encode(value, options)].join('')];
|
|
11224
|
-
}
|
|
11225
|
-
|
|
11226
|
-
return [[result, encode(value, options)].join(options.arrayFormatSeparator)];
|
|
11227
|
-
};
|
|
11228
|
-
|
|
11229
|
-
default:
|
|
11230
|
-
return key => (result, value) => {
|
|
11231
|
-
if (
|
|
11232
|
-
value === undefined ||
|
|
11233
|
-
(options.skipNull && value === null) ||
|
|
11234
|
-
(options.skipEmptyString && value === '')
|
|
11235
|
-
) {
|
|
11236
|
-
return result;
|
|
11237
|
-
}
|
|
11238
|
-
|
|
11239
|
-
if (value === null) {
|
|
11240
|
-
return [...result, encode(key, options)];
|
|
11241
|
-
}
|
|
11242
|
-
|
|
11243
|
-
return [...result, [encode(key, options), '=', encode(value, options)].join('')];
|
|
11244
|
-
};
|
|
11245
|
-
}
|
|
11246
|
-
}
|
|
11247
|
-
|
|
11248
|
-
function parserForArrayFormat(options) {
|
|
11249
|
-
let result;
|
|
11250
|
-
|
|
11251
|
-
switch (options.arrayFormat) {
|
|
11252
|
-
case 'index':
|
|
11253
|
-
return (key, value, accumulator) => {
|
|
11254
|
-
result = /\[(\d*)\]$/.exec(key);
|
|
11255
|
-
|
|
11256
|
-
key = key.replace(/\[\d*\]$/, '');
|
|
11257
|
-
|
|
11258
|
-
if (!result) {
|
|
11259
|
-
accumulator[key] = value;
|
|
11260
|
-
return;
|
|
11261
|
-
}
|
|
11262
|
-
|
|
11263
|
-
if (accumulator[key] === undefined) {
|
|
11264
|
-
accumulator[key] = {};
|
|
11265
|
-
}
|
|
11266
|
-
|
|
11267
|
-
accumulator[key][result[1]] = value;
|
|
11268
|
-
};
|
|
11269
|
-
|
|
11270
|
-
case 'bracket':
|
|
11271
|
-
return (key, value, accumulator) => {
|
|
11272
|
-
result = /(\[\])$/.exec(key);
|
|
11273
|
-
key = key.replace(/\[\]$/, '');
|
|
11274
|
-
|
|
11275
|
-
if (!result) {
|
|
11276
|
-
accumulator[key] = value;
|
|
11277
|
-
return;
|
|
11278
|
-
}
|
|
11279
|
-
|
|
11280
|
-
if (accumulator[key] === undefined) {
|
|
11281
|
-
accumulator[key] = [value];
|
|
11282
|
-
return;
|
|
11283
|
-
}
|
|
11284
|
-
|
|
11285
|
-
accumulator[key] = [].concat(accumulator[key], value);
|
|
11286
|
-
};
|
|
11287
|
-
|
|
11288
|
-
case 'comma':
|
|
11289
|
-
case 'separator':
|
|
11290
|
-
return (key, value, accumulator) => {
|
|
11291
|
-
const isArray = typeof value === 'string' && value.includes(options.arrayFormatSeparator);
|
|
11292
|
-
const isEncodedArray = (typeof value === 'string' && !isArray && decode(value, options).includes(options.arrayFormatSeparator));
|
|
11293
|
-
value = isEncodedArray ? decode(value, options) : value;
|
|
11294
|
-
const newValue = isArray || isEncodedArray ? value.split(options.arrayFormatSeparator).map(item => decode(item, options)) : value === null ? value : decode(value, options);
|
|
11295
|
-
accumulator[key] = newValue;
|
|
11296
|
-
};
|
|
11297
|
-
|
|
11298
|
-
default:
|
|
11299
|
-
return (key, value, accumulator) => {
|
|
11300
|
-
if (accumulator[key] === undefined) {
|
|
11301
|
-
accumulator[key] = value;
|
|
11302
|
-
return;
|
|
11303
|
-
}
|
|
11304
|
-
|
|
11305
|
-
accumulator[key] = [].concat(accumulator[key], value);
|
|
11306
|
-
};
|
|
11307
|
-
}
|
|
11308
|
-
}
|
|
11309
|
-
|
|
11310
|
-
function validateArrayFormatSeparator(value) {
|
|
11311
|
-
if (typeof value !== 'string' || value.length !== 1) {
|
|
11312
|
-
throw new TypeError('arrayFormatSeparator must be single character string');
|
|
11313
|
-
}
|
|
11314
|
-
}
|
|
11315
|
-
|
|
11316
|
-
function encode(value, options) {
|
|
11317
|
-
if (options.encode) {
|
|
11318
|
-
return options.strict ? strictUriEncode(value) : encodeURIComponent(value);
|
|
11319
|
-
}
|
|
11320
|
-
|
|
11321
|
-
return value;
|
|
11322
|
-
}
|
|
11323
|
-
|
|
11324
|
-
function decode(value, options) {
|
|
11325
|
-
if (options.decode) {
|
|
11326
|
-
return decodeUriComponent(value);
|
|
11327
|
-
}
|
|
11328
|
-
|
|
11329
|
-
return value;
|
|
11330
|
-
}
|
|
11331
|
-
|
|
11332
|
-
function keysSorter(input) {
|
|
11333
|
-
if (Array.isArray(input)) {
|
|
11334
|
-
return input.sort();
|
|
11335
|
-
}
|
|
11336
|
-
|
|
11337
|
-
if (typeof input === 'object') {
|
|
11338
|
-
return keysSorter(Object.keys(input))
|
|
11339
|
-
.sort((a, b) => Number(a) - Number(b))
|
|
11340
|
-
.map(key => input[key]);
|
|
11341
|
-
}
|
|
11342
|
-
|
|
11343
|
-
return input;
|
|
11344
|
-
}
|
|
11345
|
-
|
|
11346
|
-
function removeHash(input) {
|
|
11347
|
-
const hashStart = input.indexOf('#');
|
|
11348
|
-
if (hashStart !== -1) {
|
|
11349
|
-
input = input.slice(0, hashStart);
|
|
11350
|
-
}
|
|
11351
|
-
|
|
11352
|
-
return input;
|
|
11353
|
-
}
|
|
11354
|
-
|
|
11355
|
-
function getHash(url) {
|
|
11356
|
-
let hash = '';
|
|
11357
|
-
const hashStart = url.indexOf('#');
|
|
11358
|
-
if (hashStart !== -1) {
|
|
11359
|
-
hash = url.slice(hashStart);
|
|
11360
|
-
}
|
|
11361
|
-
|
|
11362
|
-
return hash;
|
|
11363
|
-
}
|
|
11364
|
-
|
|
11365
|
-
function extract(input) {
|
|
11366
|
-
input = removeHash(input);
|
|
11367
|
-
const queryStart = input.indexOf('?');
|
|
11368
|
-
if (queryStart === -1) {
|
|
11369
|
-
return '';
|
|
11370
|
-
}
|
|
11371
|
-
|
|
11372
|
-
return input.slice(queryStart + 1);
|
|
11373
|
-
}
|
|
11374
|
-
|
|
11375
|
-
function parseValue(value, options) {
|
|
11376
|
-
if (options.parseNumbers && !Number.isNaN(Number(value)) && (typeof value === 'string' && value.trim() !== '')) {
|
|
11377
|
-
value = Number(value);
|
|
11378
|
-
} else if (options.parseBooleans && value !== null && (value.toLowerCase() === 'true' || value.toLowerCase() === 'false')) {
|
|
11379
|
-
value = value.toLowerCase() === 'true';
|
|
11380
|
-
}
|
|
11381
|
-
|
|
11382
|
-
return value;
|
|
11383
|
-
}
|
|
11384
|
-
|
|
11385
|
-
function parse(query, options) {
|
|
11386
|
-
options = Object.assign({
|
|
11387
|
-
decode: true,
|
|
11388
|
-
sort: true,
|
|
11389
|
-
arrayFormat: 'none',
|
|
11390
|
-
arrayFormatSeparator: ',',
|
|
11391
|
-
parseNumbers: false,
|
|
11392
|
-
parseBooleans: false
|
|
11393
|
-
}, options);
|
|
11394
|
-
|
|
11395
|
-
validateArrayFormatSeparator(options.arrayFormatSeparator);
|
|
11396
|
-
|
|
11397
|
-
const formatter = parserForArrayFormat(options);
|
|
11398
|
-
|
|
11399
|
-
// Create an object with no prototype
|
|
11400
|
-
const ret = Object.create(null);
|
|
11401
|
-
|
|
11402
|
-
if (typeof query !== 'string') {
|
|
11403
|
-
return ret;
|
|
11404
|
-
}
|
|
11405
|
-
|
|
11406
|
-
query = query.trim().replace(/^[?#&]/, '');
|
|
11407
|
-
|
|
11408
|
-
if (!query) {
|
|
11409
|
-
return ret;
|
|
11410
|
-
}
|
|
11411
|
-
|
|
11412
|
-
for (const param of query.split('&')) {
|
|
11413
|
-
let [key, value] = splitOnFirst(options.decode ? param.replace(/\+/g, ' ') : param, '=');
|
|
11414
|
-
|
|
11415
|
-
// Missing `=` should be `null`:
|
|
11416
|
-
// http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters
|
|
11417
|
-
value = value === undefined ? null : ['comma', 'separator'].includes(options.arrayFormat) ? value : decode(value, options);
|
|
11418
|
-
formatter(decode(key, options), value, ret);
|
|
11419
|
-
}
|
|
11420
|
-
|
|
11421
|
-
for (const key of Object.keys(ret)) {
|
|
11422
|
-
const value = ret[key];
|
|
11423
|
-
if (typeof value === 'object' && value !== null) {
|
|
11424
|
-
for (const k of Object.keys(value)) {
|
|
11425
|
-
value[k] = parseValue(value[k], options);
|
|
11426
|
-
}
|
|
11427
|
-
} else {
|
|
11428
|
-
ret[key] = parseValue(value, options);
|
|
11429
|
-
}
|
|
11430
|
-
}
|
|
11431
|
-
|
|
11432
|
-
if (options.sort === false) {
|
|
11433
|
-
return ret;
|
|
11434
|
-
}
|
|
11435
|
-
|
|
11436
|
-
return (options.sort === true ? Object.keys(ret).sort() : Object.keys(ret).sort(options.sort)).reduce((result, key) => {
|
|
11437
|
-
const value = ret[key];
|
|
11438
|
-
if (Boolean(value) && typeof value === 'object' && !Array.isArray(value)) {
|
|
11439
|
-
// Sort object keys, not values
|
|
11440
|
-
result[key] = keysSorter(value);
|
|
11441
|
-
} else {
|
|
11442
|
-
result[key] = value;
|
|
11443
|
-
}
|
|
11444
|
-
|
|
11445
|
-
return result;
|
|
11446
|
-
}, Object.create(null));
|
|
11447
|
-
}
|
|
11448
|
-
|
|
11449
|
-
exports.extract = extract;
|
|
11450
|
-
exports.parse = parse;
|
|
11451
|
-
|
|
11452
|
-
exports.stringify = (object, options) => {
|
|
11453
|
-
if (!object) {
|
|
11454
|
-
return '';
|
|
11455
|
-
}
|
|
11456
|
-
|
|
11457
|
-
options = Object.assign({
|
|
11458
|
-
encode: true,
|
|
11459
|
-
strict: true,
|
|
11460
|
-
arrayFormat: 'none',
|
|
11461
|
-
arrayFormatSeparator: ','
|
|
11462
|
-
}, options);
|
|
11463
|
-
|
|
11464
|
-
validateArrayFormatSeparator(options.arrayFormatSeparator);
|
|
11465
|
-
|
|
11466
|
-
const shouldFilter = key => (
|
|
11467
|
-
(options.skipNull && isNullOrUndefined(object[key])) ||
|
|
11468
|
-
(options.skipEmptyString && object[key] === '')
|
|
11469
|
-
);
|
|
11470
|
-
|
|
11471
|
-
const formatter = encoderForArrayFormat(options);
|
|
11472
|
-
|
|
11473
|
-
const objectCopy = {};
|
|
11474
|
-
|
|
11475
|
-
for (const key of Object.keys(object)) {
|
|
11476
|
-
if (!shouldFilter(key)) {
|
|
11477
|
-
objectCopy[key] = object[key];
|
|
11478
|
-
}
|
|
11479
|
-
}
|
|
11480
|
-
|
|
11481
|
-
const keys = Object.keys(objectCopy);
|
|
11482
|
-
|
|
11483
|
-
if (options.sort !== false) {
|
|
11484
|
-
keys.sort(options.sort);
|
|
11485
|
-
}
|
|
11486
|
-
|
|
11487
|
-
return keys.map(key => {
|
|
11488
|
-
const value = object[key];
|
|
11489
|
-
|
|
11490
|
-
if (value === undefined) {
|
|
11491
|
-
return '';
|
|
11492
|
-
}
|
|
11493
|
-
|
|
11494
|
-
if (value === null) {
|
|
11495
|
-
return encode(key, options);
|
|
11496
|
-
}
|
|
11497
|
-
|
|
11498
|
-
if (Array.isArray(value)) {
|
|
11499
|
-
return value
|
|
11500
|
-
.reduce(formatter(key), [])
|
|
11501
|
-
.join('&');
|
|
11502
|
-
}
|
|
11503
|
-
|
|
11504
|
-
return encode(key, options) + '=' + encode(value, options);
|
|
11505
|
-
}).filter(x => x.length > 0).join('&');
|
|
11506
|
-
};
|
|
11507
|
-
|
|
11508
|
-
exports.parseUrl = (url, options) => {
|
|
11509
|
-
options = Object.assign({
|
|
11510
|
-
decode: true
|
|
11511
|
-
}, options);
|
|
11512
|
-
|
|
11513
|
-
const [url_, hash] = splitOnFirst(url, '#');
|
|
11514
|
-
|
|
11515
|
-
return Object.assign(
|
|
11516
|
-
{
|
|
11517
|
-
url: url_.split('?')[0] || '',
|
|
11518
|
-
query: parse(extract(url), options)
|
|
11519
|
-
},
|
|
11520
|
-
options && options.parseFragmentIdentifier && hash ? {fragmentIdentifier: decode(hash, options)} : {}
|
|
11521
|
-
);
|
|
11522
|
-
};
|
|
11523
|
-
|
|
11524
|
-
exports.stringifyUrl = (object, options) => {
|
|
11525
|
-
options = Object.assign({
|
|
11526
|
-
encode: true,
|
|
11527
|
-
strict: true
|
|
11528
|
-
}, options);
|
|
11529
|
-
|
|
11530
|
-
const url = removeHash(object.url).split('?')[0] || '';
|
|
11531
|
-
const queryFromUrl = exports.extract(object.url);
|
|
11532
|
-
const parsedQueryFromUrl = exports.parse(queryFromUrl, {sort: false});
|
|
11533
|
-
|
|
11534
|
-
const query = Object.assign(parsedQueryFromUrl, object.query);
|
|
11535
|
-
let queryString = exports.stringify(query, options);
|
|
11536
|
-
if (queryString) {
|
|
11537
|
-
queryString = `?${queryString}`;
|
|
11538
|
-
}
|
|
11539
|
-
|
|
11540
|
-
let hash = getHash(object.url);
|
|
11541
|
-
if (object.fragmentIdentifier) {
|
|
11542
|
-
hash = `#${encode(object.fragmentIdentifier, options)}`;
|
|
11543
|
-
}
|
|
11544
|
-
|
|
11545
|
-
return `${url}${queryString}${hash}`;
|
|
11546
|
-
};
|
|
11547
|
-
});
|
|
11548
|
-
|
|
11549
11050
|
var IkasBrandPropValueProvider = /** @class */ (function () {
|
|
11550
11051
|
function IkasBrandPropValueProvider(prop, pageSpecificData) {
|
|
11551
11052
|
this.brandPropValue = prop;
|
|
@@ -11899,24 +11400,16 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
11899
11400
|
};
|
|
11900
11401
|
IkasPageDataProvider.prototype.getPageSpecificData = function () {
|
|
11901
11402
|
return __awaiter(this, void 0, void 0, function () {
|
|
11902
|
-
var slug, metaDataList, metaData,
|
|
11403
|
+
var slug, metaDataList, metaData, handleBrandPage, handleCategoryPage, _a;
|
|
11903
11404
|
var _this = this;
|
|
11904
11405
|
return __generator(this, function (_b) {
|
|
11905
11406
|
switch (_b.label) {
|
|
11906
11407
|
case 0:
|
|
11907
11408
|
if (this.pageType &&
|
|
11908
|
-
[
|
|
11909
|
-
exports.IkasThemePageType.
|
|
11910
|
-
exports.IkasThemePageType.
|
|
11911
|
-
exports.IkasThemePageType.
|
|
11912
|
-
exports.IkasThemePageType.ORDERS,
|
|
11913
|
-
exports.IkasThemePageType.ORDER_DETAIL,
|
|
11914
|
-
exports.IkasThemePageType.LOGIN,
|
|
11915
|
-
exports.IkasThemePageType.REGISTER,
|
|
11916
|
-
exports.IkasThemePageType.FORGOT_PASSWORD,
|
|
11917
|
-
exports.IkasThemePageType.RECOVER_PASSWORD,
|
|
11918
|
-
exports.IkasThemePageType.CUSTOM,
|
|
11919
|
-
exports.IkasThemePageType.CART,
|
|
11409
|
+
![
|
|
11410
|
+
exports.IkasThemePageType.BRAND,
|
|
11411
|
+
exports.IkasThemePageType.PRODUCT,
|
|
11412
|
+
exports.IkasThemePageType.CATEGORY,
|
|
11920
11413
|
].includes(this.pageType))
|
|
11921
11414
|
return [2 /*return*/];
|
|
11922
11415
|
slug = this.pageParams.slug;
|
|
@@ -11924,15 +11417,9 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
11924
11417
|
case 1:
|
|
11925
11418
|
metaDataList = _b.sent();
|
|
11926
11419
|
if (!metaDataList || !metaDataList.length) {
|
|
11927
|
-
return [2 /*return
|
|
11420
|
+
return [2 /*return*/, this.getPageSpecificProduct()];
|
|
11928
11421
|
}
|
|
11929
11422
|
metaData = metaDataList[0];
|
|
11930
|
-
setPageMetaData = function () {
|
|
11931
|
-
if (_this.page) {
|
|
11932
|
-
_this.page.pageTitle = metaData.pageTitle;
|
|
11933
|
-
_this.page.description = metaData.description;
|
|
11934
|
-
}
|
|
11935
|
-
};
|
|
11936
11423
|
handleBrandPage = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
11937
11424
|
var brandsResponse, brand;
|
|
11938
11425
|
return __generator(this, function (_a) {
|
|
@@ -11947,7 +11434,7 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
11947
11434
|
brand = brandsResponse.brands[0];
|
|
11948
11435
|
this.pageSpecificData = brand;
|
|
11949
11436
|
this.pageType = exports.IkasThemePageType.BRAND;
|
|
11950
|
-
setPageMetaData();
|
|
11437
|
+
this.setPageMetaData(metaData);
|
|
11951
11438
|
return [2 /*return*/];
|
|
11952
11439
|
}
|
|
11953
11440
|
});
|
|
@@ -11966,26 +11453,7 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
11966
11453
|
category = categoriesResponse.categories[0];
|
|
11967
11454
|
this.pageSpecificData = category;
|
|
11968
11455
|
this.pageType = exports.IkasThemePageType.CATEGORY;
|
|
11969
|
-
setPageMetaData();
|
|
11970
|
-
return [2 /*return*/];
|
|
11971
|
-
}
|
|
11972
|
-
});
|
|
11973
|
-
}); };
|
|
11974
|
-
handleProductPage = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
11975
|
-
var productsResponse, product;
|
|
11976
|
-
return __generator(this, function (_a) {
|
|
11977
|
-
switch (_a.label) {
|
|
11978
|
-
case 0: return [4 /*yield*/, IkasProductAPI.listProducts({
|
|
11979
|
-
idList: [metaData.targetId],
|
|
11980
|
-
})];
|
|
11981
|
-
case 1:
|
|
11982
|
-
productsResponse = _a.sent();
|
|
11983
|
-
if (!productsResponse.products.length)
|
|
11984
|
-
return [2 /*return*/];
|
|
11985
|
-
product = productsResponse.products[0];
|
|
11986
|
-
this.pageSpecificData = new IkasProductDetail(product, product.variants[0].variantValues, true);
|
|
11987
|
-
this.pageType = exports.IkasThemePageType.PRODUCT;
|
|
11988
|
-
setPageMetaData();
|
|
11456
|
+
this.setPageMetaData(metaData);
|
|
11989
11457
|
return [2 /*return*/];
|
|
11990
11458
|
}
|
|
11991
11459
|
});
|
|
@@ -12001,7 +11469,7 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
12001
11469
|
case 3: return [2 /*return*/, _b.sent()];
|
|
12002
11470
|
case 4: return [4 /*yield*/, handleCategoryPage()];
|
|
12003
11471
|
case 5: return [2 /*return*/, _b.sent()];
|
|
12004
|
-
case 6: return [4 /*yield*/,
|
|
11472
|
+
case 6: return [4 /*yield*/, this.getPageSpecificProduct()];
|
|
12005
11473
|
case 7: return [2 /*return*/, _b.sent()];
|
|
12006
11474
|
case 8: return [3 /*break*/, 9];
|
|
12007
11475
|
case 9: return [2 /*return*/];
|
|
@@ -12009,6 +11477,82 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
12009
11477
|
});
|
|
12010
11478
|
});
|
|
12011
11479
|
};
|
|
11480
|
+
IkasPageDataProvider.prototype.getPageSpecificProduct = function () {
|
|
11481
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
11482
|
+
var slug, getProductMetaData, metaDataResponse, productsResponse, product, isMainProductSlug, selectedVariantValues, variantSlugPart, variantSlugs, _i, _a, variant, isSelectedVariant, _loop_1, _b, variantSlugs_1, variantSlug, state_1;
|
|
11483
|
+
var _this = this;
|
|
11484
|
+
return __generator(this, function (_c) {
|
|
11485
|
+
switch (_c.label) {
|
|
11486
|
+
case 0:
|
|
11487
|
+
slug = this.pageParams.slug;
|
|
11488
|
+
getProductMetaData = function (slug) { return __awaiter(_this, void 0, void 0, function () {
|
|
11489
|
+
var metaDataList, splitParts, newSlug;
|
|
11490
|
+
return __generator(this, function (_a) {
|
|
11491
|
+
switch (_a.label) {
|
|
11492
|
+
case 0: return [4 /*yield*/, IkasHTMLMetaDataAPI.listHTMLMetaData(slug)];
|
|
11493
|
+
case 1:
|
|
11494
|
+
metaDataList = _a.sent();
|
|
11495
|
+
if (!(!metaDataList || !metaDataList.length)) return [3 /*break*/, 3];
|
|
11496
|
+
splitParts = slug.split("-");
|
|
11497
|
+
newSlug = splitParts.slice(0, splitParts.length - 1).join("-");
|
|
11498
|
+
return [4 /*yield*/, getProductMetaData(newSlug)];
|
|
11499
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
11500
|
+
case 3: return [2 /*return*/, {
|
|
11501
|
+
metaData: metaDataList[0],
|
|
11502
|
+
slug: slug,
|
|
11503
|
+
}];
|
|
11504
|
+
}
|
|
11505
|
+
});
|
|
11506
|
+
}); };
|
|
11507
|
+
return [4 /*yield*/, getProductMetaData(slug)];
|
|
11508
|
+
case 1:
|
|
11509
|
+
metaDataResponse = _c.sent();
|
|
11510
|
+
if (!metaDataResponse)
|
|
11511
|
+
return [2 /*return*/];
|
|
11512
|
+
return [4 /*yield*/, IkasProductAPI.listProducts({
|
|
11513
|
+
idList: [metaDataResponse.metaData.targetId],
|
|
11514
|
+
})];
|
|
11515
|
+
case 2:
|
|
11516
|
+
productsResponse = _c.sent();
|
|
11517
|
+
if (!productsResponse.products.length)
|
|
11518
|
+
return [2 /*return*/];
|
|
11519
|
+
product = productsResponse.products[0];
|
|
11520
|
+
isMainProductSlug = slug.length === metaDataResponse.slug.length;
|
|
11521
|
+
selectedVariantValues = [];
|
|
11522
|
+
if (!isMainProductSlug) {
|
|
11523
|
+
variantSlugPart = slug.slice(metaDataResponse.slug.length + 1);
|
|
11524
|
+
variantSlugs = variantSlugPart.split("-");
|
|
11525
|
+
for (_i = 0, _a = product.variants; _i < _a.length; _i++) {
|
|
11526
|
+
variant = _a[_i];
|
|
11527
|
+
isSelectedVariant = true;
|
|
11528
|
+
_loop_1 = function (variantSlug) {
|
|
11529
|
+
if (!variant.variantValues.some(function (vv) { return vv.slug === variantSlug; })) {
|
|
11530
|
+
isSelectedVariant = false;
|
|
11531
|
+
return "break";
|
|
11532
|
+
}
|
|
11533
|
+
};
|
|
11534
|
+
for (_b = 0, variantSlugs_1 = variantSlugs; _b < variantSlugs_1.length; _b++) {
|
|
11535
|
+
variantSlug = variantSlugs_1[_b];
|
|
11536
|
+
state_1 = _loop_1(variantSlug);
|
|
11537
|
+
if (state_1 === "break")
|
|
11538
|
+
break;
|
|
11539
|
+
}
|
|
11540
|
+
if (isSelectedVariant) {
|
|
11541
|
+
selectedVariantValues = variant.variantValues;
|
|
11542
|
+
break;
|
|
11543
|
+
}
|
|
11544
|
+
}
|
|
11545
|
+
}
|
|
11546
|
+
this.pageSpecificData = new IkasProductDetail(product, selectedVariantValues.length
|
|
11547
|
+
? selectedVariantValues
|
|
11548
|
+
: product.variants[0].variantValues, true);
|
|
11549
|
+
this.pageType = exports.IkasThemePageType.PRODUCT;
|
|
11550
|
+
this.setPageMetaData(metaDataResponse.metaData);
|
|
11551
|
+
return [2 /*return*/];
|
|
11552
|
+
}
|
|
11553
|
+
});
|
|
11554
|
+
});
|
|
11555
|
+
};
|
|
12012
11556
|
IkasPageDataProvider.prototype.getPageComponentPropValues = function (pageComponent) {
|
|
12013
11557
|
return __awaiter(this, void 0, void 0, function () {
|
|
12014
11558
|
var component, result, setPageComponentPropValue;
|
|
@@ -12094,14 +11638,16 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
12094
11638
|
});
|
|
12095
11639
|
});
|
|
12096
11640
|
};
|
|
11641
|
+
IkasPageDataProvider.prototype.setPageMetaData = function (metaData) {
|
|
11642
|
+
if (this.page) {
|
|
11643
|
+
this.page.pageTitle = metaData.pageTitle;
|
|
11644
|
+
this.page.description = metaData.description;
|
|
11645
|
+
}
|
|
11646
|
+
};
|
|
12097
11647
|
IkasPageDataProvider.isServer = function () {
|
|
12098
11648
|
return typeof window === "undefined";
|
|
12099
11649
|
};
|
|
12100
|
-
IkasPageDataProvider.initPropValues = function (propValuesStr, router
|
|
12101
|
-
var _queryParams = queryParams ||
|
|
12102
|
-
(IkasPageDataProvider.isServer()
|
|
12103
|
-
? {}
|
|
12104
|
-
: queryString.parse(location.search.replace("?", "")));
|
|
11650
|
+
IkasPageDataProvider.initPropValues = function (propValuesStr, router) {
|
|
12105
11651
|
var pageComponentPropValues = JSON.parse(propValuesStr).map(function (v) { return ({
|
|
12106
11652
|
pageComponent: new IkasThemePageComponent(v.pageComponent),
|
|
12107
11653
|
component: new IkasThemeComponent(v.component),
|
|
@@ -12136,7 +11682,7 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
12136
11682
|
IkasPageDataProvider.initProductListPropValue(prop, propValue, pageComponentPropValue);
|
|
12137
11683
|
break;
|
|
12138
11684
|
case exports.IkasThemeComponentPropType.PRODUCT_DETAIL:
|
|
12139
|
-
IkasPageDataProvider.initProductDetailPropValue(prop, propValue, pageComponentPropValue,
|
|
11685
|
+
IkasPageDataProvider.initProductDetailPropValue(prop, propValue, pageComponentPropValue, router);
|
|
12140
11686
|
break;
|
|
12141
11687
|
case exports.IkasThemeComponentPropType.LINK:
|
|
12142
11688
|
case exports.IkasThemeComponentPropType.LIST_OF_LINK:
|
|
@@ -12167,47 +11713,11 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
12167
11713
|
var productList = new IkasProductList(propValue);
|
|
12168
11714
|
pageComponentPropValue.propValues[prop.name] = productList;
|
|
12169
11715
|
};
|
|
12170
|
-
IkasPageDataProvider.initProductDetailPropValue = function (prop, propValue, pageComponentPropValue,
|
|
11716
|
+
IkasPageDataProvider.initProductDetailPropValue = function (prop, propValue, pageComponentPropValue, router) {
|
|
12171
11717
|
var usePageData = propValue.usePageData;
|
|
12172
11718
|
var _propValue = propValue;
|
|
12173
11719
|
var productDetail = new IkasProductDetail(_propValue.product, _propValue.selectedVariantValues);
|
|
12174
|
-
|
|
12175
|
-
var selectedVariantValues = [];
|
|
12176
|
-
if (usePageData && product.variantTypes.length) {
|
|
12177
|
-
var vid_1 = queryParams.vid;
|
|
12178
|
-
var hasVid = false;
|
|
12179
|
-
if (vid_1 && typeof vid_1 === "string") {
|
|
12180
|
-
var variant = product.variants.find(function (v) { return v.id === vid_1; });
|
|
12181
|
-
if (variant) {
|
|
12182
|
-
selectedVariantValues = variant.variantValues;
|
|
12183
|
-
hasVid = true;
|
|
12184
|
-
}
|
|
12185
|
-
}
|
|
12186
|
-
if (!hasVid) {
|
|
12187
|
-
product.variantTypes.forEach(function (pvt) {
|
|
12188
|
-
var slug = pvt.variantType.slug;
|
|
12189
|
-
var variantValueParam = queryParams[slug];
|
|
12190
|
-
if (variantValueParam) {
|
|
12191
|
-
var variantValueSlug_1 = variantValueParam;
|
|
12192
|
-
if (Array.isArray(variantValueParam)) {
|
|
12193
|
-
variantValueSlug_1 = variantValueParam[0];
|
|
12194
|
-
}
|
|
12195
|
-
var variantValue = pvt.variantType.values.find(function (vv) { return vv.slug === variantValueSlug_1; });
|
|
12196
|
-
if (variantValue)
|
|
12197
|
-
selectedVariantValues.push(variantValue);
|
|
12198
|
-
else
|
|
12199
|
-
selectedVariantValues.push(pvt.variantType.values[0]);
|
|
12200
|
-
}
|
|
12201
|
-
else {
|
|
12202
|
-
selectedVariantValues.push(pvt.variantType.values[0]);
|
|
12203
|
-
}
|
|
12204
|
-
});
|
|
12205
|
-
}
|
|
12206
|
-
}
|
|
12207
|
-
else {
|
|
12208
|
-
selectedVariantValues = productDetail.selectedVariantValues || [];
|
|
12209
|
-
}
|
|
12210
|
-
pageComponentPropValue.propValues[prop.name] = new IkasProductDetail(productDetail.product, selectedVariantValues, usePageData, router);
|
|
11720
|
+
pageComponentPropValue.propValues[prop.name] = new IkasProductDetail(productDetail.product, productDetail.selectedVariantValues, usePageData, router);
|
|
12211
11721
|
};
|
|
12212
11722
|
IkasPageDataProvider.initLinkPropValue = function (prop, propValue, pageComponentPropValue) {
|
|
12213
11723
|
if (Array.isArray(propValue)) {
|
|
@@ -13003,6 +12513,24 @@ var IkasProductPrice = /** @class */ (function () {
|
|
|
13003
12513
|
enumerable: false,
|
|
13004
12514
|
configurable: true
|
|
13005
12515
|
});
|
|
12516
|
+
Object.defineProperty(IkasProductPrice.prototype, "discountAmount", {
|
|
12517
|
+
get: function () {
|
|
12518
|
+
if (this.hasDiscount)
|
|
12519
|
+
return this.sellPrice - this.discountPrice;
|
|
12520
|
+
return 0;
|
|
12521
|
+
},
|
|
12522
|
+
enumerable: false,
|
|
12523
|
+
configurable: true
|
|
12524
|
+
});
|
|
12525
|
+
Object.defineProperty(IkasProductPrice.prototype, "discountPercentage", {
|
|
12526
|
+
get: function () {
|
|
12527
|
+
if (this.hasDiscount)
|
|
12528
|
+
return (100 - (this.finalPrice * 100) / this.sellPrice).toFixed(0);
|
|
12529
|
+
return 0;
|
|
12530
|
+
},
|
|
12531
|
+
enumerable: false,
|
|
12532
|
+
configurable: true
|
|
12533
|
+
});
|
|
13006
12534
|
return IkasProductPrice;
|
|
13007
12535
|
}());
|
|
13008
12536
|
|
|
@@ -14083,17 +13611,13 @@ var IkasProductDetail = /** @class */ (function () {
|
|
|
14083
13611
|
});
|
|
14084
13612
|
Object.defineProperty(IkasProductDetail.prototype, "href", {
|
|
14085
13613
|
get: function () {
|
|
14086
|
-
var _this = this;
|
|
14087
13614
|
var metaData = this.product.metaData;
|
|
14088
13615
|
if (!(metaData === null || metaData === void 0 ? void 0 : metaData.slug))
|
|
14089
13616
|
return "";
|
|
14090
13617
|
if (this.product.hasVariant) {
|
|
14091
|
-
|
|
14092
|
-
|
|
14093
|
-
|
|
14094
|
-
queryParams_1[vt.variantType.slug] = vv.slug;
|
|
14095
|
-
});
|
|
14096
|
-
return "/" + metaData.slug + "?" + queryString__default['default'].stringify(queryParams_1);
|
|
13618
|
+
return "/" + metaData.slug + "-" + this.selectedVariantValues
|
|
13619
|
+
.map(function (vv) { return vv.slug; })
|
|
13620
|
+
.join("-");
|
|
14097
13621
|
}
|
|
14098
13622
|
return "/" + metaData.slug;
|
|
14099
13623
|
},
|
|
@@ -14101,20 +13625,18 @@ var IkasProductDetail = /** @class */ (function () {
|
|
|
14101
13625
|
configurable: true
|
|
14102
13626
|
});
|
|
14103
13627
|
IkasProductDetail.prototype.selectVariantValue = function (variantValue) {
|
|
14104
|
-
var _this = this;
|
|
14105
13628
|
var _a;
|
|
13629
|
+
var metaData = this.product.metaData;
|
|
14106
13630
|
var selectedVariantValues = this.selectedVariantValues.map(function (vv) {
|
|
14107
13631
|
if (vv.variantTypeId === variantValue.variantTypeId)
|
|
14108
13632
|
return variantValue;
|
|
14109
13633
|
return vv;
|
|
14110
13634
|
});
|
|
14111
|
-
var queryParams = {};
|
|
14112
|
-
selectedVariantValues.forEach(function (vv) {
|
|
14113
|
-
var vt = _this.product.variantTypes.find(function (vt) { return vt.variantType.id === vv.variantTypeId; });
|
|
14114
|
-
queryParams[vt.variantType.slug] = vv.slug;
|
|
14115
|
-
});
|
|
14116
13635
|
this.selectedVariantValues = selectedVariantValues;
|
|
14117
|
-
|
|
13636
|
+
var newUrl = "/" + metaData.slug + "-" + this.selectedVariantValues
|
|
13637
|
+
.map(function (vv) { return vv.slug; })
|
|
13638
|
+
.join("-");
|
|
13639
|
+
(_a = this.router) === null || _a === void 0 ? void 0 : _a.replace(newUrl);
|
|
14118
13640
|
};
|
|
14119
13641
|
return IkasProductDetail;
|
|
14120
13642
|
}());
|
|
@@ -23458,7 +22980,7 @@ var PageViewModel = /** @class */ (function () {
|
|
|
23458
22980
|
return [4 /*yield*/, pageDataProvider.getPageData()];
|
|
23459
22981
|
case 1:
|
|
23460
22982
|
_b.sent();
|
|
23461
|
-
pageDataProvider.pageComponentPropValues = IkasPageDataProvider.initPropValues(JSON.stringify(pageDataProvider.pageComponentPropValues), this.router
|
|
22983
|
+
pageDataProvider.pageComponentPropValues = IkasPageDataProvider.initPropValues(JSON.stringify(pageDataProvider.pageComponentPropValues), this.router);
|
|
23462
22984
|
mobx.runInAction(function () {
|
|
23463
22985
|
_this.pageDataProvider = pageDataProvider;
|
|
23464
22986
|
_this.isLoading = false;
|
|
@@ -23803,18 +23325,76 @@ var home = /*#__PURE__*/Object.freeze({
|
|
|
23803
23325
|
});
|
|
23804
23326
|
|
|
23805
23327
|
var Page$1 = function (_a) {
|
|
23806
|
-
var page = _a.page, pageSpecificDataStr = _a.pageSpecificDataStr, propValuesStr = _a.propValuesStr
|
|
23328
|
+
var page = _a.page, pageSpecificDataStr = _a.pageSpecificDataStr, propValuesStr = _a.propValuesStr;
|
|
23807
23329
|
var router$1 = router.useRouter();
|
|
23808
23330
|
var propValues = mobx.computed(function () {
|
|
23809
|
-
return IkasPageDataProvider.initPropValues(propValuesStr, router$1
|
|
23810
|
-
? queryString.parse(window.location.search.replace("?", ""))
|
|
23811
|
-
: queryParams);
|
|
23331
|
+
return IkasPageDataProvider.initPropValues(propValuesStr, router$1);
|
|
23812
23332
|
});
|
|
23813
23333
|
handleGTM(page, pageSpecificDataStr);
|
|
23814
23334
|
return React.createElement(IkasPage, { page: page, propValues: propValues.get() });
|
|
23815
23335
|
};
|
|
23816
23336
|
var index$1 = mobxReactLite.observer(Page$1);
|
|
23817
|
-
var
|
|
23337
|
+
var getStaticPaths = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
23338
|
+
var metaData, targetTypes, brandCategoryMetaData, productMetaData, productsResponse, productParams, _loop_1, _i, _a, product;
|
|
23339
|
+
return __generator(this, function (_b) {
|
|
23340
|
+
switch (_b.label) {
|
|
23341
|
+
case 0: return [4 /*yield*/, IkasHTMLMetaDataAPI.listHTMLMetaData()];
|
|
23342
|
+
case 1:
|
|
23343
|
+
metaData = _b.sent();
|
|
23344
|
+
targetTypes = [
|
|
23345
|
+
exports.IkasHTMLMetaDataTargetType.BRAND,
|
|
23346
|
+
exports.IkasHTMLMetaDataTargetType.CATEGORY,
|
|
23347
|
+
];
|
|
23348
|
+
brandCategoryMetaData = metaData.filter(function (m) { return m.targetType && targetTypes.includes(m.targetType); });
|
|
23349
|
+
productMetaData = metaData.filter(function (m) { return m.targetType && m.targetType === exports.IkasHTMLMetaDataTargetType.PRODUCT; });
|
|
23350
|
+
return [4 /*yield*/, IkasProductAPI.listProducts({
|
|
23351
|
+
idList: productMetaData.map(function (p) { return p.targetId; }),
|
|
23352
|
+
})];
|
|
23353
|
+
case 2:
|
|
23354
|
+
productsResponse = _b.sent();
|
|
23355
|
+
productParams = [];
|
|
23356
|
+
_loop_1 = function (product) {
|
|
23357
|
+
var meta = productMetaData.find(function (pm) { return pm.targetId === product.id; });
|
|
23358
|
+
if (meta) {
|
|
23359
|
+
for (var _i = 0, _a = product.variants; _i < _a.length; _i++) {
|
|
23360
|
+
var variant = _a[_i];
|
|
23361
|
+
if (product.hasVariant) {
|
|
23362
|
+
var variantSlug = variant.variantValues
|
|
23363
|
+
.map(function (vv) { return vv.slug; })
|
|
23364
|
+
.join("-");
|
|
23365
|
+
productParams.push({
|
|
23366
|
+
slug: meta.slug + "-" + variantSlug,
|
|
23367
|
+
});
|
|
23368
|
+
}
|
|
23369
|
+
else {
|
|
23370
|
+
productParams.push({
|
|
23371
|
+
slug: meta.slug,
|
|
23372
|
+
});
|
|
23373
|
+
}
|
|
23374
|
+
}
|
|
23375
|
+
}
|
|
23376
|
+
};
|
|
23377
|
+
for (_i = 0, _a = productsResponse.products; _i < _a.length; _i++) {
|
|
23378
|
+
product = _a[_i];
|
|
23379
|
+
_loop_1(product);
|
|
23380
|
+
}
|
|
23381
|
+
return [2 /*return*/, {
|
|
23382
|
+
paths: brandCategoryMetaData
|
|
23383
|
+
.map(function (m) { return ({
|
|
23384
|
+
params: {
|
|
23385
|
+
slug: m.slug,
|
|
23386
|
+
originalSlug: m.slug,
|
|
23387
|
+
},
|
|
23388
|
+
}); })
|
|
23389
|
+
.concat(productParams.map(function (pp) { return ({
|
|
23390
|
+
params: pp,
|
|
23391
|
+
}); })),
|
|
23392
|
+
fallback: "blocking",
|
|
23393
|
+
}];
|
|
23394
|
+
}
|
|
23395
|
+
});
|
|
23396
|
+
}); };
|
|
23397
|
+
var getStaticProps$1 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
23818
23398
|
var theme, provider;
|
|
23819
23399
|
return __generator(this, function (_a) {
|
|
23820
23400
|
switch (_a.label) {
|
|
@@ -23831,7 +23411,8 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
|
|
|
23831
23411
|
}];
|
|
23832
23412
|
}
|
|
23833
23413
|
return [2 /*return*/, {
|
|
23834
|
-
props: __assign(__assign({}, provider.nextPageData.props), { pageSpecificDataStr: JSON.stringify(provider.pageSpecificData || {})
|
|
23414
|
+
props: __assign(__assign({}, provider.nextPageData.props), { pageSpecificDataStr: JSON.stringify(provider.pageSpecificData || {}) }),
|
|
23415
|
+
revalidate: 60,
|
|
23835
23416
|
}];
|
|
23836
23417
|
}
|
|
23837
23418
|
});
|
|
@@ -23855,7 +23436,8 @@ function handleGTM(page, pageSpecificDataStr) {
|
|
|
23855
23436
|
var index$2 = /*#__PURE__*/Object.freeze({
|
|
23856
23437
|
__proto__: null,
|
|
23857
23438
|
'default': index$1,
|
|
23858
|
-
|
|
23439
|
+
getStaticPaths: getStaticPaths,
|
|
23440
|
+
getStaticProps: getStaticProps$1
|
|
23859
23441
|
});
|
|
23860
23442
|
|
|
23861
23443
|
var Page$2 = function (_a) {
|
|
@@ -23864,7 +23446,7 @@ var Page$2 = function (_a) {
|
|
|
23864
23446
|
var propValues = IkasPageDataProvider.initPropValues(propValuesStr, router$1);
|
|
23865
23447
|
return React.createElement(IkasPage, { page: page, propValues: propValues });
|
|
23866
23448
|
};
|
|
23867
|
-
var getStaticPaths = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
23449
|
+
var getStaticPaths$1 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
23868
23450
|
var theme, customPages, customPagePaths;
|
|
23869
23451
|
return __generator(this, function (_a) {
|
|
23870
23452
|
switch (_a.label) {
|
|
@@ -23884,7 +23466,7 @@ var getStaticPaths = function (context) { return __awaiter(void 0, void 0, void
|
|
|
23884
23466
|
}
|
|
23885
23467
|
});
|
|
23886
23468
|
}); };
|
|
23887
|
-
var getStaticProps$
|
|
23469
|
+
var getStaticProps$2 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
23888
23470
|
var theme, provider;
|
|
23889
23471
|
return __generator(this, function (_a) {
|
|
23890
23472
|
switch (_a.label) {
|
|
@@ -23903,8 +23485,8 @@ var getStaticProps$1 = function (context) { return __awaiter(void 0, void 0, voi
|
|
|
23903
23485
|
var _slug_ = /*#__PURE__*/Object.freeze({
|
|
23904
23486
|
__proto__: null,
|
|
23905
23487
|
'default': Page$2,
|
|
23906
|
-
getStaticPaths: getStaticPaths,
|
|
23907
|
-
getStaticProps: getStaticProps$
|
|
23488
|
+
getStaticPaths: getStaticPaths$1,
|
|
23489
|
+
getStaticProps: getStaticProps$2
|
|
23908
23490
|
});
|
|
23909
23491
|
|
|
23910
23492
|
var CheckoutPage = function (_a) {
|
|
@@ -23914,7 +23496,7 @@ var CheckoutPage = function (_a) {
|
|
|
23914
23496
|
return React.createElement(IkasCheckoutPage, { checkout: checkout, queryParams: queryParams });
|
|
23915
23497
|
};
|
|
23916
23498
|
var _id_ = mobxReactLite.observer(CheckoutPage);
|
|
23917
|
-
var getServerSideProps
|
|
23499
|
+
var getServerSideProps = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
23918
23500
|
var id, redirect, checkout;
|
|
23919
23501
|
return __generator(this, function (_a) {
|
|
23920
23502
|
switch (_a.label) {
|
|
@@ -23949,7 +23531,7 @@ var getServerSideProps$1 = function (context) { return __awaiter(void 0, void 0,
|
|
|
23949
23531
|
var _id_$1 = /*#__PURE__*/Object.freeze({
|
|
23950
23532
|
__proto__: null,
|
|
23951
23533
|
'default': _id_,
|
|
23952
|
-
getServerSideProps: getServerSideProps
|
|
23534
|
+
getServerSideProps: getServerSideProps
|
|
23953
23535
|
});
|
|
23954
23536
|
|
|
23955
23537
|
var Page$3 = function (_a) {
|
|
@@ -23958,7 +23540,7 @@ var Page$3 = function (_a) {
|
|
|
23958
23540
|
var propValues = IkasPageDataProvider.initPropValues(propValuesStr, router$1);
|
|
23959
23541
|
return React.createElement(IkasPage, { page: page, propValues: propValues });
|
|
23960
23542
|
};
|
|
23961
|
-
var getStaticProps$
|
|
23543
|
+
var getStaticProps$3 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
23962
23544
|
var theme, provider;
|
|
23963
23545
|
return __generator(this, function (_a) {
|
|
23964
23546
|
switch (_a.label) {
|
|
@@ -23977,7 +23559,7 @@ var getStaticProps$2 = function (context) { return __awaiter(void 0, void 0, voi
|
|
|
23977
23559
|
var index$3 = /*#__PURE__*/Object.freeze({
|
|
23978
23560
|
__proto__: null,
|
|
23979
23561
|
'default': Page$3,
|
|
23980
|
-
getStaticProps: getStaticProps$
|
|
23562
|
+
getStaticProps: getStaticProps$3
|
|
23981
23563
|
});
|
|
23982
23564
|
|
|
23983
23565
|
var Page$4 = function (_a) {
|
|
@@ -23986,7 +23568,7 @@ var Page$4 = function (_a) {
|
|
|
23986
23568
|
var propValues = IkasPageDataProvider.initPropValues(propValuesStr, router$1);
|
|
23987
23569
|
return React.createElement(IkasPage, { page: page, propValues: propValues });
|
|
23988
23570
|
};
|
|
23989
|
-
var getStaticProps$
|
|
23571
|
+
var getStaticProps$4 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
23990
23572
|
var theme, provider;
|
|
23991
23573
|
return __generator(this, function (_a) {
|
|
23992
23574
|
switch (_a.label) {
|
|
@@ -24005,7 +23587,7 @@ var getStaticProps$3 = function (context) { return __awaiter(void 0, void 0, voi
|
|
|
24005
23587
|
var addresses = /*#__PURE__*/Object.freeze({
|
|
24006
23588
|
__proto__: null,
|
|
24007
23589
|
'default': Page$4,
|
|
24008
|
-
getStaticProps: getStaticProps$
|
|
23590
|
+
getStaticProps: getStaticProps$4
|
|
24009
23591
|
});
|
|
24010
23592
|
|
|
24011
23593
|
var Page$5 = function (_a) {
|
|
@@ -24014,7 +23596,7 @@ var Page$5 = function (_a) {
|
|
|
24014
23596
|
var propValues = IkasPageDataProvider.initPropValues(propValuesStr, router$1);
|
|
24015
23597
|
return React.createElement(IkasPage, { page: page, propValues: propValues });
|
|
24016
23598
|
};
|
|
24017
|
-
var getStaticProps$
|
|
23599
|
+
var getStaticProps$5 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
24018
23600
|
var theme, provider;
|
|
24019
23601
|
return __generator(this, function (_a) {
|
|
24020
23602
|
switch (_a.label) {
|
|
@@ -24033,7 +23615,7 @@ var getStaticProps$4 = function (context) { return __awaiter(void 0, void 0, voi
|
|
|
24033
23615
|
var index$4 = /*#__PURE__*/Object.freeze({
|
|
24034
23616
|
__proto__: null,
|
|
24035
23617
|
'default': Page$5,
|
|
24036
|
-
getStaticProps: getStaticProps$
|
|
23618
|
+
getStaticProps: getStaticProps$5
|
|
24037
23619
|
});
|
|
24038
23620
|
|
|
24039
23621
|
var Page$6 = function (_a) {
|
|
@@ -24042,7 +23624,7 @@ var Page$6 = function (_a) {
|
|
|
24042
23624
|
var propValues = IkasPageDataProvider.initPropValues(propValuesStr, router$1);
|
|
24043
23625
|
return React.createElement(IkasPage, { page: page, propValues: propValues });
|
|
24044
23626
|
};
|
|
24045
|
-
var getServerSideProps$
|
|
23627
|
+
var getServerSideProps$1 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
24046
23628
|
var theme, provider;
|
|
24047
23629
|
return __generator(this, function (_a) {
|
|
24048
23630
|
switch (_a.label) {
|
|
@@ -24061,7 +23643,7 @@ var getServerSideProps$2 = function (context) { return __awaiter(void 0, void 0,
|
|
|
24061
23643
|
var _id_$2 = /*#__PURE__*/Object.freeze({
|
|
24062
23644
|
__proto__: null,
|
|
24063
23645
|
'default': Page$6,
|
|
24064
|
-
getServerSideProps: getServerSideProps$
|
|
23646
|
+
getServerSideProps: getServerSideProps$1
|
|
24065
23647
|
});
|
|
24066
23648
|
|
|
24067
23649
|
var Page$7 = function (_a) {
|
|
@@ -24070,7 +23652,7 @@ var Page$7 = function (_a) {
|
|
|
24070
23652
|
var propValues = IkasPageDataProvider.initPropValues(propValuesStr, router$1);
|
|
24071
23653
|
return React.createElement(IkasPage, { page: page, propValues: propValues });
|
|
24072
23654
|
};
|
|
24073
|
-
var getStaticProps$
|
|
23655
|
+
var getStaticProps$6 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
24074
23656
|
var theme, provider;
|
|
24075
23657
|
return __generator(this, function (_a) {
|
|
24076
23658
|
switch (_a.label) {
|
|
@@ -24089,7 +23671,7 @@ var getStaticProps$5 = function (context) { return __awaiter(void 0, void 0, voi
|
|
|
24089
23671
|
var login = /*#__PURE__*/Object.freeze({
|
|
24090
23672
|
__proto__: null,
|
|
24091
23673
|
'default': Page$7,
|
|
24092
|
-
getStaticProps: getStaticProps$
|
|
23674
|
+
getStaticProps: getStaticProps$6
|
|
24093
23675
|
});
|
|
24094
23676
|
|
|
24095
23677
|
var Page$8 = function (_a) {
|
|
@@ -24098,7 +23680,7 @@ var Page$8 = function (_a) {
|
|
|
24098
23680
|
var propValues = IkasPageDataProvider.initPropValues(propValuesStr, router$1);
|
|
24099
23681
|
return React.createElement(IkasPage, { page: page, propValues: propValues });
|
|
24100
23682
|
};
|
|
24101
|
-
var getStaticProps$
|
|
23683
|
+
var getStaticProps$7 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
24102
23684
|
var theme, provider;
|
|
24103
23685
|
return __generator(this, function (_a) {
|
|
24104
23686
|
switch (_a.label) {
|
|
@@ -24117,7 +23699,7 @@ var getStaticProps$6 = function (context) { return __awaiter(void 0, void 0, voi
|
|
|
24117
23699
|
var register = /*#__PURE__*/Object.freeze({
|
|
24118
23700
|
__proto__: null,
|
|
24119
23701
|
'default': Page$8,
|
|
24120
|
-
getStaticProps: getStaticProps$
|
|
23702
|
+
getStaticProps: getStaticProps$7
|
|
24121
23703
|
});
|
|
24122
23704
|
|
|
24123
23705
|
var Page$9 = function (_a) {
|
|
@@ -24126,7 +23708,7 @@ var Page$9 = function (_a) {
|
|
|
24126
23708
|
var propValues = IkasPageDataProvider.initPropValues(propValuesStr, router$1);
|
|
24127
23709
|
return React.createElement(IkasPage, { page: page, propValues: propValues });
|
|
24128
23710
|
};
|
|
24129
|
-
var getStaticProps$
|
|
23711
|
+
var getStaticProps$8 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
24130
23712
|
var theme, provider;
|
|
24131
23713
|
return __generator(this, function (_a) {
|
|
24132
23714
|
switch (_a.label) {
|
|
@@ -24145,7 +23727,7 @@ var getStaticProps$7 = function (context) { return __awaiter(void 0, void 0, voi
|
|
|
24145
23727
|
var forgotPassword = /*#__PURE__*/Object.freeze({
|
|
24146
23728
|
__proto__: null,
|
|
24147
23729
|
'default': Page$9,
|
|
24148
|
-
getStaticProps: getStaticProps$
|
|
23730
|
+
getStaticProps: getStaticProps$8
|
|
24149
23731
|
});
|
|
24150
23732
|
|
|
24151
23733
|
var Page$a = function (_a) {
|
|
@@ -24154,7 +23736,7 @@ var Page$a = function (_a) {
|
|
|
24154
23736
|
var propValues = IkasPageDataProvider.initPropValues(propValuesStr, router$1);
|
|
24155
23737
|
return React.createElement(IkasPage, { page: page, propValues: propValues });
|
|
24156
23738
|
};
|
|
24157
|
-
var getStaticProps$
|
|
23739
|
+
var getStaticProps$9 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
24158
23740
|
var theme, provider;
|
|
24159
23741
|
return __generator(this, function (_a) {
|
|
24160
23742
|
switch (_a.label) {
|
|
@@ -24173,7 +23755,7 @@ var getStaticProps$8 = function (context) { return __awaiter(void 0, void 0, voi
|
|
|
24173
23755
|
var recoverPassword = /*#__PURE__*/Object.freeze({
|
|
24174
23756
|
__proto__: null,
|
|
24175
23757
|
'default': Page$a,
|
|
24176
|
-
getStaticProps: getStaticProps$
|
|
23758
|
+
getStaticProps: getStaticProps$9
|
|
24177
23759
|
});
|
|
24178
23760
|
|
|
24179
23761
|
var Page$b = function (_a) {
|
|
@@ -24182,7 +23764,7 @@ var Page$b = function (_a) {
|
|
|
24182
23764
|
var propValues = IkasPageDataProvider.initPropValues(propValuesStr, router$1);
|
|
24183
23765
|
return React.createElement(IkasPage, { page: page, propValues: propValues });
|
|
24184
23766
|
};
|
|
24185
|
-
var getStaticProps$
|
|
23767
|
+
var getStaticProps$a = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
24186
23768
|
var theme, provider;
|
|
24187
23769
|
return __generator(this, function (_a) {
|
|
24188
23770
|
switch (_a.label) {
|
|
@@ -24201,7 +23783,7 @@ var getStaticProps$9 = function (context) { return __awaiter(void 0, void 0, voi
|
|
|
24201
23783
|
var cart = /*#__PURE__*/Object.freeze({
|
|
24202
23784
|
__proto__: null,
|
|
24203
23785
|
'default': Page$b,
|
|
24204
|
-
getStaticProps: getStaticProps$
|
|
23786
|
+
getStaticProps: getStaticProps$a
|
|
24205
23787
|
});
|
|
24206
23788
|
|
|
24207
23789
|
var IkasPageEditor$1 = dynamic__default['default'](function () { return Promise.resolve().then(function () { return index; }).then(function (mod) { return mod.IkasPageEditor; }); }, { ssr: false });
|