@depict-ai/ui 1.3.5 → 1.3.7
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/dist/client/main.cjs +158 -99
- package/dist/client/module.js +158 -99
- package/dist/index.d.ts +12 -3
- package/dist/server/main.cjs +157 -98
- package/dist/server/module.js +157 -98
- package/package.json +1 -1
package/dist/server/main.cjs
CHANGED
|
@@ -44,7 +44,7 @@ $parcel$export(module.exports, "defaultGridSpacing", () => $a3280f0aad997933$exp
|
|
|
44
44
|
$parcel$export(module.exports, "defaultColsAtSize", () => $a3280f0aad997933$export$c3834fa86c616831);
|
|
45
45
|
$parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad997933$export$7bf543b9d9be2c22);
|
|
46
46
|
$parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
|
|
47
|
-
/*! Depict.ai search and product listing SDK */ const $b757f75811f3261f$export$83d89fbfd8236492 = "1.3.
|
|
47
|
+
/*! Depict.ai search and product listing SDK */ const $b757f75811f3261f$export$83d89fbfd8236492 = "1.3.7";
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
|
|
@@ -351,18 +351,30 @@ function $6e22b5314fb52f4c$var$history_state_change(signals, entries, state) {
|
|
|
351
351
|
}
|
|
352
352
|
|
|
353
353
|
|
|
354
|
-
function $26a56f6b44703084$export$9862539c89138352(get_default_values_, router_) {
|
|
355
|
-
const
|
|
354
|
+
function $26a56f6b44703084$export$9862539c89138352({ get_default_values_: get_default_values_ , router_: router_ , prefix_: prefix_ }) {
|
|
355
|
+
const get_prefixed_default_values_ = ()=>{
|
|
356
|
+
const default_values = get_default_values_();
|
|
357
|
+
return Object.fromEntries(Object.entries(default_values).map(([key, value])=>[
|
|
358
|
+
prefix_ + key,
|
|
359
|
+
value
|
|
360
|
+
]));
|
|
361
|
+
};
|
|
362
|
+
const prefixed_state = (0, $6e22b5314fb52f4c$export$e183a13865960371)(get_prefixed_default_values_(), router_);
|
|
356
363
|
const reset_state = ()=>{
|
|
357
|
-
const new_defaults =
|
|
358
|
-
for(const key in
|
|
364
|
+
const new_defaults = get_prefixed_default_values_();
|
|
365
|
+
for(const key in prefixed_state){
|
|
359
366
|
const new_value = new_defaults[key];
|
|
360
|
-
|
|
367
|
+
prefixed_state[key][1](new_value);
|
|
361
368
|
}
|
|
362
369
|
};
|
|
370
|
+
let unprefixed_state;
|
|
371
|
+
unprefixed_state = Object.fromEntries(Object.entries(prefixed_state).map(([key, value])=>[
|
|
372
|
+
key.slice(prefix_.length),
|
|
373
|
+
value
|
|
374
|
+
]));
|
|
363
375
|
return [
|
|
364
376
|
reset_state,
|
|
365
|
-
|
|
377
|
+
unprefixed_state
|
|
366
378
|
];
|
|
367
379
|
}
|
|
368
380
|
|
|
@@ -419,7 +431,8 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
|
419
431
|
]
|
|
420
432
|
});
|
|
421
433
|
this.#guard_url_creator_length(category_suggestions, page_urls);
|
|
422
|
-
while(page_urls.length)
|
|
434
|
+
while(page_urls.length)// Copy over getters so we sneakily can make this reactive
|
|
435
|
+
Object.defineProperties(category_suggestions.pop(), Object.getOwnPropertyDescriptors(page_urls.pop()));
|
|
423
436
|
return response;
|
|
424
437
|
}
|
|
425
438
|
async #run_url_creator_for_rest(merchant1, market1, input_data) {
|
|
@@ -465,7 +478,8 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
|
465
478
|
]
|
|
466
479
|
});
|
|
467
480
|
this.#guard_url_creator_length(category_display_array, page_urls);
|
|
468
|
-
for(let i = 0; i < category_display_array.length; i++)
|
|
481
|
+
for(let i = 0; i < category_display_array.length; i++)// Copy over getters so we sneakily can make this reactive
|
|
482
|
+
Object.defineProperties(category_display_array[i], Object.getOwnPropertyDescriptors(page_urls[i]));
|
|
469
483
|
}
|
|
470
484
|
return input_data;
|
|
471
485
|
}
|
|
@@ -4130,10 +4144,8 @@ const $1ab22f2cd39b3061$var$operator_map = {
|
|
|
4130
4144
|
"geq": "≥",
|
|
4131
4145
|
"inrange": "\uD83D\uDD22"
|
|
4132
4146
|
};
|
|
4133
|
-
const $1ab22f2cd39b3061$var$sorting_query_param = "sorting";
|
|
4134
4147
|
const $1ab22f2cd39b3061$var$ascending_token = "\uD83D\uDCC8";
|
|
4135
4148
|
const $1ab22f2cd39b3061$var$descending_token = "\uD83D\uDCC9";
|
|
4136
|
-
const $1ab22f2cd39b3061$var$filter_query_param_prefix = "filter_";
|
|
4137
4149
|
const $1ab22f2cd39b3061$var$range_delimiter = "-";
|
|
4138
4150
|
const $1ab22f2cd39b3061$var$string_item_delimiter = "‚"; // This is not a comma but a comma-like character that browsers will render in the URL bar.
|
|
4139
4151
|
const $1ab22f2cd39b3061$var$array_item_delimiter = "‣"; // FIXME: decide on a character. Could theoretically be a double string delimiter.
|
|
@@ -4199,17 +4211,17 @@ function $1ab22f2cd39b3061$var$decode_filter_data(op, encoded_data) {
|
|
|
4199
4211
|
}
|
|
4200
4212
|
return null;
|
|
4201
4213
|
}
|
|
4202
|
-
function $1ab22f2cd39b3061$export$58aa3f171519b6d7(filters, search_params) {
|
|
4214
|
+
function $1ab22f2cd39b3061$export$58aa3f171519b6d7(filters, search_params, filter_query_param_prefix) {
|
|
4203
4215
|
for (const filter of filters){
|
|
4204
4216
|
const { field: field , op: op , data: data } = filter;
|
|
4205
4217
|
const encoded_data = $1ab22f2cd39b3061$var$encode_filter_data(op, data);
|
|
4206
|
-
search_params.set(
|
|
4218
|
+
search_params.set(filter_query_param_prefix + field + $1ab22f2cd39b3061$var$operator_map[op], encoded_data);
|
|
4207
4219
|
}
|
|
4208
4220
|
}
|
|
4209
|
-
function $1ab22f2cd39b3061$export$f934fa24c3a86811(search_params) {
|
|
4221
|
+
function $1ab22f2cd39b3061$export$f934fa24c3a86811(search_params, filter_query_param_prefix) {
|
|
4210
4222
|
const found_filters = [];
|
|
4211
4223
|
for (const key of search_params.keys()){
|
|
4212
|
-
if (!key.startsWith(
|
|
4224
|
+
if (!key.startsWith(filter_query_param_prefix)) continue;
|
|
4213
4225
|
const encoded_data = search_params.get(key);
|
|
4214
4226
|
if (!encoded_data) continue;
|
|
4215
4227
|
for (const op of Object.keys($1ab22f2cd39b3061$var$operator_map)){
|
|
@@ -4217,7 +4229,7 @@ function $1ab22f2cd39b3061$export$f934fa24c3a86811(search_params) {
|
|
|
4217
4229
|
if (!key.endsWith(token)) continue;
|
|
4218
4230
|
const data = $1ab22f2cd39b3061$var$decode_filter_data(op, encoded_data);
|
|
4219
4231
|
if (!data) continue;
|
|
4220
|
-
const field = key.slice(
|
|
4232
|
+
const field = key.slice(filter_query_param_prefix.length, -token.length);
|
|
4221
4233
|
found_filters.push({
|
|
4222
4234
|
field: field,
|
|
4223
4235
|
op: op,
|
|
@@ -4227,14 +4239,14 @@ function $1ab22f2cd39b3061$export$f934fa24c3a86811(search_params) {
|
|
|
4227
4239
|
}
|
|
4228
4240
|
return found_filters;
|
|
4229
4241
|
}
|
|
4230
|
-
function $1ab22f2cd39b3061$export$62acb285a7579555(sorting, search_params) {
|
|
4242
|
+
function $1ab22f2cd39b3061$export$62acb285a7579555(sorting, search_params, sorting_query_param) {
|
|
4231
4243
|
if (!sorting) return;
|
|
4232
4244
|
const { field: field , order: order } = sorting;
|
|
4233
4245
|
const ascending = order === "asc";
|
|
4234
|
-
search_params.set(
|
|
4246
|
+
search_params.set(sorting_query_param, field + (ascending ? $1ab22f2cd39b3061$var$ascending_token : $1ab22f2cd39b3061$var$descending_token));
|
|
4235
4247
|
}
|
|
4236
|
-
function $1ab22f2cd39b3061$export$766e9676e74997d3(search_params) {
|
|
4237
|
-
const encoded_sorting = search_params.get(
|
|
4248
|
+
function $1ab22f2cd39b3061$export$766e9676e74997d3(search_params, sorting_query_param_) {
|
|
4249
|
+
const encoded_sorting = search_params.get(sorting_query_param_);
|
|
4238
4250
|
if (!encoded_sorting) return;
|
|
4239
4251
|
if (encoded_sorting.endsWith($1ab22f2cd39b3061$var$ascending_token)) return {
|
|
4240
4252
|
field: encoded_sorting.slice(0, -$1ab22f2cd39b3061$var$ascending_token.length),
|
|
@@ -4247,22 +4259,22 @@ function $1ab22f2cd39b3061$export$766e9676e74997d3(search_params) {
|
|
|
4247
4259
|
(0, $diwD4$depictaiutilishared.dlog)("Invalid sorting query param value", encoded_sorting);
|
|
4248
4260
|
return;
|
|
4249
4261
|
}
|
|
4250
|
-
function $1ab22f2cd39b3061$export$
|
|
4262
|
+
function $1ab22f2cd39b3061$export$916e6850778505f6(search_params, filter_query_param_prefix, sorting_query_param) {
|
|
4251
4263
|
// We'll be modifying the URLSearchParams object, so we need to make a copy of the keys first
|
|
4252
4264
|
const keys = [
|
|
4253
4265
|
...search_params.keys()
|
|
4254
4266
|
];
|
|
4255
|
-
for (const key of keys)if (key.startsWith(
|
|
4267
|
+
for (const key of keys)if (key.startsWith(filter_query_param_prefix) || key === sorting_query_param) search_params.delete(key);
|
|
4256
4268
|
}
|
|
4257
4269
|
const $1ab22f2cd39b3061$export$cf5feb2102aec7f2 = "went_sideways_clear_filters";
|
|
4258
|
-
function $1ab22f2cd39b3061$export$43cd1e747fecd42e(
|
|
4259
|
-
if (!
|
|
4260
|
-
const was_url_object =
|
|
4261
|
-
const url_object = was_url_object ?
|
|
4270
|
+
function $1ab22f2cd39b3061$export$43cd1e747fecd42e({ to_url_: to_url_ , set_clearing_flag_: set_clearing_flag_ , from_search_params_: from_search_params_ = new URLSearchParams(location.search) , sorting_query_param_: sorting_query_param_ , filter_query_param_prefix_: filter_query_param_prefix_ }) {
|
|
4271
|
+
if (!to_url_) return to_url_;
|
|
4272
|
+
const was_url_object = to_url_ instanceof URL;
|
|
4273
|
+
const url_object = was_url_object ? to_url_ : new URL(to_url_, location.origin);
|
|
4262
4274
|
const { searchParams: searchParams } = url_object;
|
|
4263
|
-
if (
|
|
4264
|
-
if (
|
|
4265
|
-
for (const key of
|
|
4275
|
+
if (set_clearing_flag_) searchParams.set($1ab22f2cd39b3061$export$cf5feb2102aec7f2, "true");
|
|
4276
|
+
if (from_search_params_.has(sorting_query_param_)) searchParams.set(sorting_query_param_, from_search_params_.get(sorting_query_param_));
|
|
4277
|
+
for (const key of from_search_params_.keys())if (key.startsWith(filter_query_param_prefix_)) searchParams.set(key, from_search_params_.get(key));
|
|
4266
4278
|
if (was_url_object) return url_object;
|
|
4267
4279
|
return url_object.href;
|
|
4268
4280
|
}
|
|
@@ -4284,7 +4296,7 @@ const $e53b2e7e632ac4cb$var$_tmpl$ = [
|
|
|
4284
4296
|
' class="separator">',
|
|
4285
4297
|
"</span>"
|
|
4286
4298
|
];
|
|
4287
|
-
function $e53b2e7e632ac4cb$export$5646050d516e06bc({ crumb_data_: get_api_crumb_data , router_: router_ , i18n_: i18n_ }) {
|
|
4299
|
+
function $e53b2e7e632ac4cb$export$5646050d516e06bc({ crumb_data_: get_api_crumb_data , router_: router_ , i18n_: i18n_ , filter_query_param_prefix_: filter_query_param_prefix_ , sorting_query_param_: sorting_query_param_ }) {
|
|
4288
4300
|
const placeholder_crumb_data = [
|
|
4289
4301
|
,
|
|
4290
4302
|
,
|
|
@@ -4300,7 +4312,11 @@ function $e53b2e7e632ac4cb$export$5646050d516e06bc({ crumb_data_: get_api_crumb_
|
|
|
4300
4312
|
return crumb_data();
|
|
4301
4313
|
},
|
|
4302
4314
|
children: (display_accessor, index)=>{
|
|
4303
|
-
const href = (0, $diwD4$solidjs.createMemo)(()=>(0, $1ab22f2cd39b3061$export$43cd1e747fecd42e)(
|
|
4315
|
+
const href = (0, $diwD4$solidjs.createMemo)(()=>(0, $1ab22f2cd39b3061$export$43cd1e747fecd42e)({
|
|
4316
|
+
to_url_: display_accessor()?.page_url,
|
|
4317
|
+
filter_query_param_prefix_: filter_query_param_prefix_,
|
|
4318
|
+
sorting_query_param_: sorting_query_param_
|
|
4319
|
+
}));
|
|
4304
4320
|
return [
|
|
4305
4321
|
(0, $diwD4$solidjsweb.createComponent)((0, $diwD4$solidjs.Show), {
|
|
4306
4322
|
get when () {
|
|
@@ -4357,7 +4373,7 @@ const $8cceb1d3a967f369$var$_tmpl$ = [
|
|
|
4357
4373
|
">",
|
|
4358
4374
|
"</a>"
|
|
4359
4375
|
];
|
|
4360
|
-
function $8cceb1d3a967f369$export$466cdc317043f6cb({ quicklinks_data_: quicklinks_data_ , router_: router_ , current_query_id_: current_query_id_ , breadcrumb_data_: breadcrumb_data_ , i18n_: i18n_ }) {
|
|
4376
|
+
function $8cceb1d3a967f369$export$466cdc317043f6cb({ quicklinks_data_: quicklinks_data_ , router_: router_ , current_query_id_: current_query_id_ , breadcrumb_data_: breadcrumb_data_ , i18n_: i18n_ , sorting_query_param_: sorting_query_param_ , filter_query_param_prefix_: filter_query_param_prefix_ }) {
|
|
4361
4377
|
let scrolling_logic_ran_for_query_id = false;
|
|
4362
4378
|
let last_scroll_position;
|
|
4363
4379
|
let scroll_to_element_on_dom_insertion;
|
|
@@ -4491,7 +4507,12 @@ function $8cceb1d3a967f369$export$466cdc317043f6cb({ quicklinks_data_: quicklink
|
|
|
4491
4507
|
return quicklinks_data_()?.some(({ query_id: query_id })=>query_id === current_id);
|
|
4492
4508
|
});
|
|
4493
4509
|
const href = (0, $diwD4$solidjs.createMemo)(()=>// We don't want these links to delete the sort and filter state by default, only if `clear_filters_when_going_sideways` explicitly clears them
|
|
4494
|
-
(0, $1ab22f2cd39b3061$export$43cd1e747fecd42e)(
|
|
4510
|
+
(0, $1ab22f2cd39b3061$export$43cd1e747fecd42e)({
|
|
4511
|
+
to_url_: display_accessor()?.page_url,
|
|
4512
|
+
set_clearing_flag_: is_sibling(),
|
|
4513
|
+
sorting_query_param_: sorting_query_param_,
|
|
4514
|
+
filter_query_param_prefix_: filter_query_param_prefix_
|
|
4515
|
+
}));
|
|
4495
4516
|
return (0, $diwD4$solidjsweb.ssr)($8cceb1d3a967f369$var$_tmpl$3, (0, $diwD4$solidjsweb.ssrHydrationKey)(), `quicklink ${is_selected() ? "selected" : ""}`, (0, $diwD4$solidjsweb.ssrAttribute)("href", (0, $diwD4$solidjsweb.escape)(href(), true), false), (0, $diwD4$solidjsweb.escape)(display_accessor()?.title) || (0, $diwD4$solidjsweb.escape)((0, $diwD4$solidjsweb.createComponent)((0, $061ff5b4c3d36171$export$89c6019e4baa40b1), {
|
|
4496
4517
|
height: "1em",
|
|
4497
4518
|
width: "10ch"
|
|
@@ -4795,7 +4816,7 @@ const $840d88a04b2d22a7$var$_tmpl$ = [
|
|
|
4795
4816
|
"<!--/--><!--#-->",
|
|
4796
4817
|
"<!--/--></div>"
|
|
4797
4818
|
];
|
|
4798
|
-
function $840d88a04b2d22a7$export$f7d2f673fc2f091d({ depict_api_: depict_api_ , query_id_: query_id_ , listing_type_: listing_type_ , current_sorting_: current_sorting_ , min_products_to_fetch_: min_products_to_fetch_ , category_filters_open_: category_filters_open_ , category_sorting_open_: category_sorting_open_ , expanded_filters_: expanded_filters_ , selected_filters_: selected_filters_ , get_quicklinks_accessor_: get_quicklinks_accessor_ , i18n_: incoming_i18n , get_breadcrumb_accessor_: get_breadcrumb_accessor_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , local_filter_cache_: local_filter_cache_ , tenant_: tenant_ , market_: market_ , router_: router_ , show_quicklinks_: show_quicklinks_ , category_title_: category_title_ , show_breadcrumbs_: show_breadcrumbs_ , layout_options_: layout_options_ , scroll_restoration_data_: scroll_restoration_data_ , product_card_template_: product_card_template_ , sideways_filter_clearing_flag_: sideways_filter_clearing_flag_ }) {
|
|
4819
|
+
function $840d88a04b2d22a7$export$f7d2f673fc2f091d({ depict_api_: depict_api_ , query_id_: query_id_ , listing_type_: listing_type_ , current_sorting_: current_sorting_ , min_products_to_fetch_: min_products_to_fetch_ , category_filters_open_: category_filters_open_ , category_sorting_open_: category_sorting_open_ , expanded_filters_: expanded_filters_ , selected_filters_: selected_filters_ , get_quicklinks_accessor_: get_quicklinks_accessor_ , i18n_: incoming_i18n , get_breadcrumb_accessor_: get_breadcrumb_accessor_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , local_filter_cache_: local_filter_cache_ , tenant_: tenant_ , market_: market_ , router_: router_ , show_quicklinks_: show_quicklinks_ , category_title_: category_title_ , show_breadcrumbs_: show_breadcrumbs_ , layout_options_: layout_options_ , scroll_restoration_data_: scroll_restoration_data_ , product_card_template_: product_card_template_ , sideways_filter_clearing_flag_: sideways_filter_clearing_flag_ , sorting_query_param_: sorting_query_param_ , filter_query_param_prefix_: filter_query_param_prefix_ }) {
|
|
4799
4820
|
let results_for;
|
|
4800
4821
|
let only_show_filters_opener_;
|
|
4801
4822
|
let middle_elements_;
|
|
@@ -4978,7 +4999,9 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
|
|
|
4978
4999
|
return (0, $diwD4$solidjsweb.createComponent)((0, $e53b2e7e632ac4cb$export$5646050d516e06bc), {
|
|
4979
5000
|
crumb_data_: crumb_data_,
|
|
4980
5001
|
router_: router_,
|
|
4981
|
-
i18n_: i18n_
|
|
5002
|
+
i18n_: i18n_,
|
|
5003
|
+
sorting_query_param_: sorting_query_param_,
|
|
5004
|
+
filter_query_param_prefix_: filter_query_param_prefix_
|
|
4982
5005
|
});
|
|
4983
5006
|
}
|
|
4984
5007
|
})), (0, $diwD4$solidjsweb.escape)((0, $diwD4$solidjsweb.createComponent)((0, $diwD4$solidjs.Show), {
|
|
@@ -4991,7 +5014,9 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
|
|
|
4991
5014
|
current_query_id_: query_id_,
|
|
4992
5015
|
router_: router_,
|
|
4993
5016
|
breadcrumb_data_: crumb_data_,
|
|
4994
|
-
i18n_: i18n_
|
|
5017
|
+
i18n_: i18n_,
|
|
5018
|
+
sorting_query_param_: sorting_query_param_,
|
|
5019
|
+
filter_query_param_prefix_: filter_query_param_prefix_
|
|
4995
5020
|
});
|
|
4996
5021
|
}
|
|
4997
5022
|
})), (0, $diwD4$solidjsweb.escape)(observed_results_filters_elements()), (0, $diwD4$solidjsweb.escape)(results_filters()), (0, $diwD4$solidjsweb.escape)((0, $diwD4$solidjsweb.createComponent)((0, $diwD4$solidjs.Show), {
|
|
@@ -5225,19 +5250,20 @@ function $c79fd10a3ab7d6e0$export$477caf01aecaeb2a(options) {
|
|
|
5225
5250
|
const [get_current_href, set_current_href] = (0, $diwD4$solidjs.createSignal)(globalThis?.location?.href ?? "https://example.com");
|
|
5226
5251
|
const history_change_handler = (0, $diwD4$depictaiutilishared.catchify)(()=>set_current_href(location.href));
|
|
5227
5252
|
const owner = (0, $diwD4$solidjs.getOwner)() || (0, $diwD4$solidjs.createRoot)(()=>(0, $diwD4$solidjs.getOwner)());
|
|
5253
|
+
const { sorting_query_param_: sorting_query_param_ , filter_query_param_prefix_: filter_query_param_prefix_ } = options;
|
|
5228
5254
|
let writer_started = false;
|
|
5229
5255
|
(0, $diwD4$depictaiutilishared.instant_exec_on_suspect_history_change).add(history_change_handler);
|
|
5230
5256
|
(0, $diwD4$solidjs.onCleanup)(()=>(0, $diwD4$depictaiutilishared.instant_exec_on_suspect_history_change).delete(history_change_handler));
|
|
5231
5257
|
(0, $diwD4$solidjs.createComputed)(()=>{
|
|
5232
5258
|
const { searchParams: searchParams } = new URL(get_current_href());
|
|
5233
5259
|
(0, $diwD4$solidjs.batch)(()=>{
|
|
5234
|
-
const found_sorting = (0, $1ab22f2cd39b3061$export$766e9676e74997d3)(searchParams);
|
|
5260
|
+
const found_sorting = (0, $1ab22f2cd39b3061$export$766e9676e74997d3)(searchParams, sorting_query_param_);
|
|
5235
5261
|
if (found_sorting) {
|
|
5236
5262
|
const current_sorting = (0, $diwD4$solidjs.untrack)(get_sorting_);
|
|
5237
5263
|
// Do some diffing since we might assume in certain places of the code that if the signal changes it means the sorting has changed
|
|
5238
5264
|
if (current_sorting?.field !== found_sorting.field || current_sorting?.order !== found_sorting.order) set_sorting(found_sorting);
|
|
5239
5265
|
} else set_sorting();
|
|
5240
|
-
const found_filters = (0, $1ab22f2cd39b3061$export$f934fa24c3a86811)(searchParams);
|
|
5266
|
+
const found_filters = (0, $1ab22f2cd39b3061$export$f934fa24c3a86811)(searchParams, filter_query_param_prefix_);
|
|
5241
5267
|
const selected_filters = (0, $diwD4$solidjs.untrack)(get_selected_filters_);
|
|
5242
5268
|
const found_filters_map = new Map(found_filters.map(({ field: field , op: op , data: data })=>[
|
|
5243
5269
|
JSON.stringify([
|
|
@@ -5262,7 +5288,9 @@ function $c79fd10a3ab7d6e0$export$477caf01aecaeb2a(options) {
|
|
|
5262
5288
|
get_sorting_: get_sorting_,
|
|
5263
5289
|
get_selected_filters_: get_selected_filters_,
|
|
5264
5290
|
router_: router_,
|
|
5265
|
-
get_has_sideways_filter_clearing_flag_: get_has_sideways_filter_clearing_flag_
|
|
5291
|
+
get_has_sideways_filter_clearing_flag_: get_has_sideways_filter_clearing_flag_,
|
|
5292
|
+
sorting_query_param_: sorting_query_param_,
|
|
5293
|
+
filter_query_param_prefix_: filter_query_param_prefix_
|
|
5266
5294
|
}));
|
|
5267
5295
|
writer_started = true;
|
|
5268
5296
|
}
|
|
@@ -5281,7 +5309,7 @@ function $c79fd10a3ab7d6e0$export$477caf01aecaeb2a(options) {
|
|
|
5281
5309
|
}
|
|
5282
5310
|
/**
|
|
5283
5311
|
* Writes the sorting and filters to the URL query parameters when they change.
|
|
5284
|
-
*/ function $c79fd10a3ab7d6e0$var$start_href_writer({ get_sorting_: get_sorting_ , get_selected_filters_: get_selected_filters_ , router_: router_ , get_has_sideways_filter_clearing_flag_: get_has_sideways_filter_clearing_flag_ }) {
|
|
5312
|
+
*/ function $c79fd10a3ab7d6e0$var$start_href_writer({ get_sorting_: get_sorting_ , get_selected_filters_: get_selected_filters_ , router_: router_ , get_has_sideways_filter_clearing_flag_: get_has_sideways_filter_clearing_flag_ , sorting_query_param_: sorting_query_param_ , filter_query_param_prefix_: filter_query_param_prefix_ }) {
|
|
5285
5313
|
(0, $diwD4$solidjs.createEffect)((0, $diwD4$solidjs.on)([
|
|
5286
5314
|
get_sorting_,
|
|
5287
5315
|
get_selected_filters_,
|
|
@@ -5290,9 +5318,9 @@ function $c79fd10a3ab7d6e0$export$477caf01aecaeb2a(options) {
|
|
|
5290
5318
|
const current_href = location.href;
|
|
5291
5319
|
const url_object = new URL(current_href);
|
|
5292
5320
|
const { searchParams: searchParams } = url_object;
|
|
5293
|
-
(0, $1ab22f2cd39b3061$export$
|
|
5294
|
-
(0, $1ab22f2cd39b3061$export$62acb285a7579555)(sorting, searchParams);
|
|
5295
|
-
(0, $1ab22f2cd39b3061$export$58aa3f171519b6d7)(filters, searchParams);
|
|
5321
|
+
(0, $1ab22f2cd39b3061$export$916e6850778505f6)(searchParams, filter_query_param_prefix_, sorting_query_param_);
|
|
5322
|
+
(0, $1ab22f2cd39b3061$export$62acb285a7579555)(sorting, searchParams, sorting_query_param_);
|
|
5323
|
+
(0, $1ab22f2cd39b3061$export$58aa3f171519b6d7)(filters, searchParams, filter_query_param_prefix_);
|
|
5296
5324
|
if (!has_sideways_filter_clearing_flag) $c79fd10a3ab7d6e0$var$delete_sideways_param_flag(searchParams);
|
|
5297
5325
|
// We can't just check if the URL is equal since sometimes the order of the parameters in the URL changes (randomly?) so we need to compare them one by one
|
|
5298
5326
|
const unmodified_search_params = [
|
|
@@ -5323,6 +5351,8 @@ function $c79fd10a3ab7d6e0$var$delete_sideways_param_flag(searchParams) {
|
|
|
5323
5351
|
class $e96dd13889871fc0$export$7e1297a3a19f10d8 {
|
|
5324
5352
|
/**
|
|
5325
5353
|
* Function that will be called when we want to navigate, or a string saying it's not an SPA. You can change this OTG
|
|
5354
|
+
*/ /**
|
|
5355
|
+
* We store query_id in history.state and do operate on this both here and in js-ui, this is the key to be used which js-ui provides
|
|
5326
5356
|
*/ #throwing_on_navigation(...args) {
|
|
5327
5357
|
const { on_navigation_: on_navigation_ } = this;
|
|
5328
5358
|
if (typeof on_navigation_ !== "function") throw new Error("on_navigation_ is not a function");
|
|
@@ -5385,8 +5415,11 @@ class $e96dd13889871fc0$export$7e1297a3a19f10d8 {
|
|
|
5385
5415
|
if (force_spa_navigation_ && wants_hard_navigation) {
|
|
5386
5416
|
// Don't allow hard navigation if we're forcing SPA navigation, which we do for things where PageReplacer can be used for performance
|
|
5387
5417
|
const new_state = history.state;
|
|
5388
|
-
if (category_query_id_)
|
|
5389
|
-
|
|
5418
|
+
if (category_query_id_) {
|
|
5419
|
+
// In JS-UI we need to know the query_id of the current category, therefore push it into state
|
|
5420
|
+
if (!this.query_id_state_key) (0, $diwD4$depictaiutilishared.report)(new Error("query_id_state_key is not set"), "error");
|
|
5421
|
+
new_state[this.query_id_state_key] = category_query_id_;
|
|
5422
|
+
}
|
|
5390
5423
|
history[is_replace_ ? "replaceState" : "pushState"](new_state, "", new_url_);
|
|
5391
5424
|
} else this.#throwing_on_navigation.call(this, {
|
|
5392
5425
|
is_replace: is_replace_,
|
|
@@ -5396,7 +5429,8 @@ class $e96dd13889871fc0$export$7e1297a3a19f10d8 {
|
|
|
5396
5429
|
await promise;
|
|
5397
5430
|
})
|
|
5398
5431
|
};
|
|
5399
|
-
constructor(on_navigation){
|
|
5432
|
+
constructor(on_navigation, query_id_state_key){
|
|
5433
|
+
this.query_id_state_key = query_id_state_key;
|
|
5400
5434
|
this.on_navigation_ = on_navigation;
|
|
5401
5435
|
}
|
|
5402
5436
|
}
|
|
@@ -5412,13 +5446,13 @@ const $48567ac5b39bac56$var$min_products_to_fetch_ = 20;
|
|
|
5412
5446
|
const $48567ac5b39bac56$var$privately_shared_properties = /*@__PURE__*/ new WeakMap();
|
|
5413
5447
|
const $48567ac5b39bac56$var$InExternalAreaDiv = ({ children: children })=>(0, $diwD4$solidjsweb.ssr)($48567ac5b39bac56$var$_tmpl$, (0, $diwD4$solidjsweb.ssrHydrationKey)() + (0, $diwD4$solidjsweb.ssrAttribute)("id", (0, $diwD4$solidjsweb.escape)((0, $0b6e2070a98de347$export$44dad306455dddf).PLP_CATEGORY, true), false), (0, $diwD4$solidjsweb.escape)(children));
|
|
5414
5448
|
class $48567ac5b39bac56$export$f34314aa9505732e {
|
|
5415
|
-
#router
|
|
5449
|
+
#router;
|
|
5416
5450
|
#locale_signal = (0, $diwD4$solidjs.createSignal)();
|
|
5417
5451
|
#merchant_signal = (0, $diwD4$solidjs.createSignal)();
|
|
5418
5452
|
#market_signal = (0, $diwD4$solidjs.createSignal)();
|
|
5419
5453
|
#query_id_signal = (0, $diwD4$solidjs.createSignal)("");
|
|
5420
5454
|
#listing_type_signal = (0, $diwD4$solidjs.createSignal)();
|
|
5421
|
-
static #
|
|
5455
|
+
static #keys_constructed_with = [];
|
|
5422
5456
|
get localization() {
|
|
5423
5457
|
// allow reactive access
|
|
5424
5458
|
return this.#locale_signal[0]();
|
|
@@ -5457,27 +5491,35 @@ class $48567ac5b39bac56$export$f34314aa9505732e {
|
|
|
5457
5491
|
set on_navigation(new_function) {
|
|
5458
5492
|
this.#router.on_navigation_ = new_function;
|
|
5459
5493
|
}
|
|
5460
|
-
constructor({ api: api , on_navigation: on_navigation , page_url_creator: page_url_creator , ...props_on_class }){
|
|
5494
|
+
constructor({ api: api , on_navigation: on_navigation , page_url_creator: page_url_creator , unique_instance_key_for_state: unique_instance_key_for_state = "" , query_id_state_key: query_id_state_key , ...props_on_class }){
|
|
5461
5495
|
const owner = (0, $diwD4$solidjs.getOwner)() || (0, $diwD4$solidjs.createRoot)(()=>(0, $diwD4$solidjs.getOwner)()); // we might have an owner, if so, pass it on. Otherwise, create one so solid doesn't print warnings to the console
|
|
5462
5496
|
(0, $diwD4$solidjs.runWithOwner)(owner, ()=>{
|
|
5463
|
-
if ($48567ac5b39bac56$export$f34314aa9505732e.#
|
|
5497
|
+
if ($48567ac5b39bac56$export$f34314aa9505732e.#keys_constructed_with.includes(unique_instance_key_for_state) && !(0, $diwD4$solidjsweb.isServer)) // on the server we can't write stuff to history.state anyway so can have multiple
|
|
5464
5498
|
throw new Error("You can only have one instance of DepictCategory due to state limitations");
|
|
5465
|
-
$48567ac5b39bac56$export$f34314aa9505732e.#has_been_constructed = true;
|
|
5466
5499
|
Object.assign(this, props_on_class); // set initial signal values
|
|
5467
5500
|
(0, $d84fe647b84b5dc5$export$5162a71f252e6122)();
|
|
5501
|
+
this.#router = new (0, $e96dd13889871fc0$export$7e1297a3a19f10d8)("hard_navigation", query_id_state_key);
|
|
5468
5502
|
if (on_navigation) this.#router.on_navigation_ = on_navigation;
|
|
5503
|
+
const sorting_query_param_ = "sorting" + unique_instance_key_for_state;
|
|
5504
|
+
const filter_query_param_prefix_ = "filter" + unique_instance_key_for_state + "_";
|
|
5469
5505
|
const { selected_filters_: selected_filters_ , current_sorting_: current_sorting_ , sideways_filter_clearing_flag_: sideways_filter_clearing_flag_ } = (0, $c79fd10a3ab7d6e0$export$477caf01aecaeb2a)({
|
|
5470
|
-
router_: this.#router
|
|
5506
|
+
router_: this.#router,
|
|
5507
|
+
sorting_query_param_: sorting_query_param_,
|
|
5508
|
+
filter_query_param_prefix_: filter_query_param_prefix_
|
|
5509
|
+
});
|
|
5510
|
+
const [reset_history_state_, state_] = (0, $26a56f6b44703084$export$9862539c89138352)({
|
|
5511
|
+
get_default_values_: ()=>({
|
|
5512
|
+
filters_open: false,
|
|
5513
|
+
sorting_open: false,
|
|
5514
|
+
expanded_filters: [],
|
|
5515
|
+
// Please make sure that the signal created by below line always updates AFTER selected_filters_ updates on a "popstate" event. If the filter cache is popped before the selected filters are the code in create_modified_filters() is going to re-calculate search_local_filter_cache without knowing the real value of search_selected_filters, and we'll end up with too few filters in search_local_filter_cache in some cases
|
|
5516
|
+
local_filter_cache: [],
|
|
5517
|
+
expanded_hierarchical_filters: [],
|
|
5518
|
+
scroll_restoration_data: []
|
|
5519
|
+
}),
|
|
5520
|
+
router_: this.#router,
|
|
5521
|
+
prefix_: "category" + unique_instance_key_for_state + "_"
|
|
5471
5522
|
});
|
|
5472
|
-
const [reset_history_state_, state_] = (0, $26a56f6b44703084$export$9862539c89138352)(()=>({
|
|
5473
|
-
category_filters_open: false,
|
|
5474
|
-
category_sorting_open: false,
|
|
5475
|
-
category_expanded_filters: [],
|
|
5476
|
-
// Please make sure that the signal created by below line always updates AFTER selected_filters_ updates on a "popstate" event. If the filter cache is popped before the selected filters are the code in create_modified_filters() is going to re-calculate search_local_filter_cache without knowing the real value of search_selected_filters, and we'll end up with too few filters in search_local_filter_cache in some cases
|
|
5477
|
-
category_local_filter_cache: [],
|
|
5478
|
-
category_expanded_hierarchical_filters: [],
|
|
5479
|
-
category_scroll_restoration_data: []
|
|
5480
|
-
}), this.#router);
|
|
5481
5523
|
const i18n_ = (0, $0785f4c9947d9b5f$export$f091cbac892643a4)(this.#locale_signal[0]);
|
|
5482
5524
|
$48567ac5b39bac56$var$privately_shared_properties.set(this, {
|
|
5483
5525
|
state_: state_,
|
|
@@ -5491,8 +5533,11 @@ class $48567ac5b39bac56$export$f34314aa9505732e {
|
|
|
5491
5533
|
router_: this.#router,
|
|
5492
5534
|
selected_filters_: selected_filters_,
|
|
5493
5535
|
current_sorting_: current_sorting_,
|
|
5494
|
-
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
|
|
5536
|
+
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
|
|
5537
|
+
sorting_query_param_: sorting_query_param_,
|
|
5538
|
+
filter_query_param_prefix_: filter_query_param_prefix_
|
|
5495
5539
|
});
|
|
5540
|
+
$48567ac5b39bac56$export$f34314aa9505732e.#keys_constructed_with.push(unique_instance_key_for_state);
|
|
5496
5541
|
});
|
|
5497
5542
|
}
|
|
5498
5543
|
}
|
|
@@ -5509,7 +5554,7 @@ function $48567ac5b39bac56$export$e2bf8ce7779e827e(props) {
|
|
|
5509
5554
|
grid_spacing: grid_spacing.horizontal
|
|
5510
5555
|
};
|
|
5511
5556
|
});
|
|
5512
|
-
const { state_: {
|
|
5557
|
+
const { state_: { local_filter_cache: local_filter_cache_ , filters_open: category_filters_open_ , sorting_open: category_sorting_open_ , expanded_filters: expanded_filters_ , expanded_hierarchical_filters: expanded_hierarchical_filters_ , scroll_restoration_data: scroll_restoration_data_ } , current_sorting_: current_sorting_ , selected_filters_: selected_filters_ , reset_history_state_: reset_history_state_ , depict_api_: depict_api_ , i18n_: i18n_ , router_: router_ , breadcrumb_signal_: breadcrumb_signal_ , quicklinks_signal_: quicklinks_signal_ , sideways_filter_clearing_flag_: sideways_filter_clearing_flag_ , sorting_query_param_: sorting_query_param_ , filter_query_param_prefix_: filter_query_param_prefix_ } = shared_properties;
|
|
5513
5558
|
(0, $diwD4$solidjs.onCleanup)(reset_history_state_);
|
|
5514
5559
|
return (0, $840d88a04b2d22a7$export$f7d2f673fc2f091d)({
|
|
5515
5560
|
tenant_: ()=>depict_category.merchant,
|
|
@@ -5538,24 +5583,28 @@ function $48567ac5b39bac56$export$e2bf8ce7779e827e(props) {
|
|
|
5538
5583
|
cols_at_size: (0, $4e04be41243c3d80$export$6daf8749b65a1b77)(props.cols_at_size),
|
|
5539
5584
|
...grid_spacing_override()
|
|
5540
5585
|
})),
|
|
5541
|
-
product_card_template_: product_card_template
|
|
5586
|
+
product_card_template_: product_card_template,
|
|
5587
|
+
sorting_query_param_: sorting_query_param_,
|
|
5588
|
+
filter_query_param_prefix_: filter_query_param_prefix_
|
|
5542
5589
|
});
|
|
5543
5590
|
}, "Entire CategoryPage failed");
|
|
5544
5591
|
}
|
|
5545
5592
|
function $48567ac5b39bac56$export$5b7c3ce0ebe51f86({ depict_category: depict_category }) {
|
|
5546
|
-
const { i18n_: i18n_ , breadcrumb_signal_: [crumb_data_] , router_: router_ } = $48567ac5b39bac56$var$get_shared_properties(depict_category);
|
|
5593
|
+
const { i18n_: i18n_ , breadcrumb_signal_: [crumb_data_] , router_: router_ , sorting_query_param_: sorting_query_param_ , filter_query_param_prefix_: filter_query_param_prefix_ } = $48567ac5b39bac56$var$get_shared_properties(depict_category);
|
|
5547
5594
|
return (0, $diwD4$solidjsweb.createComponent)($48567ac5b39bac56$var$InExternalAreaDiv, {
|
|
5548
5595
|
get children () {
|
|
5549
5596
|
return (0, $e53b2e7e632ac4cb$export$5646050d516e06bc)({
|
|
5550
5597
|
i18n_: i18n_,
|
|
5551
5598
|
crumb_data_: crumb_data_,
|
|
5552
|
-
router_: router_
|
|
5599
|
+
router_: router_,
|
|
5600
|
+
sorting_query_param_: sorting_query_param_,
|
|
5601
|
+
filter_query_param_prefix_: filter_query_param_prefix_
|
|
5553
5602
|
});
|
|
5554
5603
|
}
|
|
5555
5604
|
});
|
|
5556
5605
|
}
|
|
5557
5606
|
function $48567ac5b39bac56$export$de035477d6fef996({ depict_category: depict_category }) {
|
|
5558
|
-
const { i18n_: i18n_ , quicklinks_signal_: [quicklinks_data_] , breadcrumb_signal_: [breadcrumb_data_] , router_: router_ } = $48567ac5b39bac56$var$get_shared_properties(depict_category);
|
|
5607
|
+
const { i18n_: i18n_ , quicklinks_signal_: [quicklinks_data_] , breadcrumb_signal_: [breadcrumb_data_] , router_: router_ , sorting_query_param_: sorting_query_param_ , filter_query_param_prefix_: filter_query_param_prefix_ } = $48567ac5b39bac56$var$get_shared_properties(depict_category);
|
|
5559
5608
|
return (0, $diwD4$solidjsweb.createComponent)($48567ac5b39bac56$var$InExternalAreaDiv, {
|
|
5560
5609
|
get children () {
|
|
5561
5610
|
return (0, $8cceb1d3a967f369$export$466cdc317043f6cb)({
|
|
@@ -5563,7 +5612,9 @@ function $48567ac5b39bac56$export$de035477d6fef996({ depict_category: depict_cat
|
|
|
5563
5612
|
quicklinks_data_: quicklinks_data_,
|
|
5564
5613
|
router_: router_,
|
|
5565
5614
|
current_query_id_: ()=>depict_category.category_id,
|
|
5566
|
-
breadcrumb_data_: breadcrumb_data_
|
|
5615
|
+
breadcrumb_data_: breadcrumb_data_,
|
|
5616
|
+
sorting_query_param_: sorting_query_param_,
|
|
5617
|
+
filter_query_param_prefix_: filter_query_param_prefix_
|
|
5567
5618
|
});
|
|
5568
5619
|
}
|
|
5569
5620
|
});
|
|
@@ -7627,31 +7678,39 @@ class $2c61e4cd8229c49a$export$ac6237957a15b3f0 {
|
|
|
7627
7678
|
#merchant_signal = (0, $diwD4$solidjs.createSignal)();
|
|
7628
7679
|
#market_signal = (0, $diwD4$solidjs.createSignal)();
|
|
7629
7680
|
#modal_open_signal = (0, $diwD4$solidjs.createSignal)(false);
|
|
7630
|
-
static #
|
|
7681
|
+
static #keys_constructed_with = [];
|
|
7631
7682
|
#router = new (0, $e96dd13889871fc0$export$7e1297a3a19f10d8)("hard_navigation");
|
|
7632
|
-
constructor({ search_query_url_param_name: search_query_url_param_name_ = "query" , url_transformer: url_transformer , on_navigation: on_navigation , enable_category_suggestions: enable_category_suggestions = true , page_url_creator: page_url_creator , disable_scrolling_during_modal: // Stuff needed for non-standard customer deployments that we shouldn't actually expose
|
|
7683
|
+
constructor({ unique_instance_key_for_state: unique_instance_key_for_state = "" , search_query_url_param_name: search_query_url_param_name_ = "query" + unique_instance_key_for_state , url_transformer: url_transformer , on_navigation: on_navigation , enable_category_suggestions: enable_category_suggestions = true , page_url_creator: page_url_creator , disable_scrolling_during_modal: // Stuff needed for non-standard customer deployments that we shouldn't actually expose
|
|
7633
7684
|
disable_scrolling_during_modal = true , api: api , bottom_distance_under_modal: bottom_distance_under_modal , render_instant_card: render_instant_card , ...props_on_class }){
|
|
7634
7685
|
const owner = (0, $diwD4$solidjs.getOwner)() || (0, $diwD4$solidjs.createRoot)(()=>(0, $diwD4$solidjs.getOwner)()); // we might have an owner, if so, pass it on. Otherwise, create one so solid doesn't print warnings to the console
|
|
7635
7686
|
(0, $diwD4$solidjs.runWithOwner)(owner, ()=>{
|
|
7636
|
-
if ($2c61e4cd8229c49a$export$ac6237957a15b3f0.#
|
|
7687
|
+
if ($2c61e4cd8229c49a$export$ac6237957a15b3f0.#keys_constructed_with.includes(unique_instance_key_for_state) && !(0, $diwD4$solidjsweb.isServer)) // on the server we can't write stuff to history.state anyway so can have multiple
|
|
7637
7688
|
throw new Error("You can only have one instance of DepictSearch");
|
|
7638
7689
|
Object.assign(this, props_on_class);
|
|
7639
7690
|
if (on_navigation) this.#router.on_navigation_ = on_navigation;
|
|
7691
|
+
const sorting_query_param_ = "sorting" + unique_instance_key_for_state;
|
|
7692
|
+
const filter_query_param_prefix_ = "filter" + unique_instance_key_for_state + "_";
|
|
7640
7693
|
const { current_sorting_: current_sorting_ , selected_filters_: selected_filters_ , search_query_accessor_: raw_search_query_accessor } = (0, $c79fd10a3ab7d6e0$export$477caf01aecaeb2a)({
|
|
7641
7694
|
search_query_url_param_name_: search_query_url_param_name_,
|
|
7642
|
-
router_: this.#router
|
|
7695
|
+
router_: this.#router,
|
|
7696
|
+
sorting_query_param_: sorting_query_param_,
|
|
7697
|
+
filter_query_param_prefix_: filter_query_param_prefix_
|
|
7698
|
+
});
|
|
7699
|
+
const [reset_history_state_, state_] = (0, $26a56f6b44703084$export$9862539c89138352)({
|
|
7700
|
+
get_default_values_: ()=>({
|
|
7701
|
+
field_value: (globalThis?.location && new URLSearchParams(location.search).get(search_query_url_param_name_)) ?? "",
|
|
7702
|
+
filters_open: false,
|
|
7703
|
+
sorting_open: false,
|
|
7704
|
+
expanded_filters: [],
|
|
7705
|
+
// Please make sure that the signal created by below line always updates AFTER selected_filters_ updates on a "popstate" event. If the filter cache is popped before the selected filters are the code in create_modified_filters() is going to re-calculate search_local_filter_cache without knowing the real value of search_selected_filters, and we'll end up with too few filters in search_local_filter_cache in some cases
|
|
7706
|
+
local_filter_cache: [],
|
|
7707
|
+
expanded_hierarchical_filters: [],
|
|
7708
|
+
showing_recommendation_rows: (0, $fb29c6201c369e39$export$1c8c715550dc689d),
|
|
7709
|
+
scroll_restoration_data: []
|
|
7710
|
+
}),
|
|
7711
|
+
router_: this.#router,
|
|
7712
|
+
prefix_: "search" + unique_instance_key_for_state + "_"
|
|
7643
7713
|
});
|
|
7644
|
-
const [reset_history_state_, state_] = (0, $26a56f6b44703084$export$9862539c89138352)(()=>({
|
|
7645
|
-
search_field_value: (globalThis?.location && new URLSearchParams(location.search).get(search_query_url_param_name_)) ?? "",
|
|
7646
|
-
search_filters_open: false,
|
|
7647
|
-
search_sorting_open: false,
|
|
7648
|
-
search_expanded_filters: [],
|
|
7649
|
-
// Please make sure that the signal created by below line always updates AFTER selected_filters_ updates on a "popstate" event. If the filter cache is popped before the selected filters are the code in create_modified_filters() is going to re-calculate search_local_filter_cache without knowing the real value of search_selected_filters, and we'll end up with too few filters in search_local_filter_cache in some cases
|
|
7650
|
-
search_local_filter_cache: [],
|
|
7651
|
-
search_expanded_hierarchical_filters: [],
|
|
7652
|
-
search_showing_recommendation_rows: (0, $fb29c6201c369e39$export$1c8c715550dc689d),
|
|
7653
|
-
search_scroll_restoration_data: []
|
|
7654
|
-
}), this.#router);
|
|
7655
7714
|
const search_query_updating_blocked_ = (0, $diwD4$solidjs.createSignal)(false);
|
|
7656
7715
|
const [get_search_query_updating_blocked] = search_query_updating_blocked_;
|
|
7657
7716
|
const get_search_query_ = (0, $diwD4$solidjs.createMemo)((previous_value)=>{
|
|
@@ -7662,10 +7721,10 @@ class $2c61e4cd8229c49a$export$ac6237957a15b3f0 {
|
|
|
7662
7721
|
page_url_creator: page_url_creator
|
|
7663
7722
|
});
|
|
7664
7723
|
const previous_searches = (0, $2b7a005a65221045$export$84bba84a7b837187)(get_search_query_);
|
|
7665
|
-
const [, set_search_showing_recommendation_rows] = state_.
|
|
7724
|
+
const [, set_search_showing_recommendation_rows] = state_.showing_recommendation_rows;
|
|
7666
7725
|
const after_submit_ = ()=>set_search_showing_recommendation_rows((0, $fb29c6201c369e39$export$1c8c715550dc689d)); // do this every time after we have submitted a new query - otherwise there might already be a saved number of rows in the state
|
|
7667
7726
|
const on_submit_with_unchanged_value_ = ()=>this.modal_open = false;
|
|
7668
|
-
const [get_search_field_value_, set_search_field_value_] = state_.
|
|
7727
|
+
const [get_search_field_value_, set_search_field_value_] = state_.field_value;
|
|
7669
7728
|
const configured_submit_query_ = (new_query)=>(0, $f328bd45f8ede33c$export$e16630ecb9644a1c)({
|
|
7670
7729
|
on_submit_with_unchanged_value_: on_submit_with_unchanged_value_,
|
|
7671
7730
|
set_search_field_value_: set_search_field_value_,
|
|
@@ -7681,9 +7740,9 @@ class $2c61e4cd8229c49a$export$ac6237957a15b3f0 {
|
|
|
7681
7740
|
selected_filters_: selected_filters_,
|
|
7682
7741
|
get_search_query_: get_search_query_,
|
|
7683
7742
|
current_sorting_: current_sorting_,
|
|
7684
|
-
expanded_hierarchical_filters_: state_.
|
|
7743
|
+
expanded_hierarchical_filters_: state_.expanded_hierarchical_filters,
|
|
7685
7744
|
i18n_: i18n_,
|
|
7686
|
-
local_filter_cache_: state_.
|
|
7745
|
+
local_filter_cache_: state_.local_filter_cache
|
|
7687
7746
|
});
|
|
7688
7747
|
$2c61e4cd8229c49a$var$privately_shared_properties.set(this, {
|
|
7689
7748
|
search_query_url_param_name_: search_query_url_param_name_,
|
|
@@ -7707,7 +7766,7 @@ class $2c61e4cd8229c49a$export$ac6237957a15b3f0 {
|
|
|
7707
7766
|
(0, $diwD4$solidjs.onCleanup)(()=>this.modal_open = false);
|
|
7708
7767
|
return (0, $f40a47a30a358305$export$1c593cbd6f1e10bc)(...args);
|
|
7709
7768
|
}, {
|
|
7710
|
-
search_field_value_: state_.
|
|
7769
|
+
search_field_value_: state_.field_value,
|
|
7711
7770
|
get_search_query_: get_search_query_,
|
|
7712
7771
|
search_query_url_param_name_: search_query_url_param_name_,
|
|
7713
7772
|
previous_searches_: previous_searches,
|
|
@@ -7776,7 +7835,7 @@ class $2c61e4cd8229c49a$export$ac6237957a15b3f0 {
|
|
|
7776
7835
|
};
|
|
7777
7836
|
(0, $diwD4$solidjs.runWithOwner)(owner, ()=>(0, $diwD4$solidjs.createEffect)(modal_opening_effect));
|
|
7778
7837
|
})();
|
|
7779
|
-
$2c61e4cd8229c49a$export$ac6237957a15b3f0.#
|
|
7838
|
+
$2c61e4cd8229c49a$export$ac6237957a15b3f0.#keys_constructed_with.push(unique_instance_key_for_state);
|
|
7780
7839
|
});
|
|
7781
7840
|
}
|
|
7782
7841
|
get on_navigation() {
|
|
@@ -7850,8 +7909,8 @@ function $2c61e4cd8229c49a$export$f2dc7e4e4aa11abb(props) {
|
|
|
7850
7909
|
market_: ()=>depict_search.market,
|
|
7851
7910
|
depict_api_: shared_properties.depict_api_,
|
|
7852
7911
|
min_products_to_fetch_: $2c61e4cd8229c49a$var$min_products_to_fetch_,
|
|
7853
|
-
local_filter_cache_: state_.
|
|
7854
|
-
search_field_value_: state_.
|
|
7912
|
+
local_filter_cache_: state_.local_filter_cache,
|
|
7913
|
+
search_field_value_: state_.field_value,
|
|
7855
7914
|
get_search_query_: shared_properties.get_search_query_,
|
|
7856
7915
|
clear_filters_on_next_submit_: shared_properties.clear_filters_on_next_submit_,
|
|
7857
7916
|
open_modal_: (...args)=>depict_search.modal_open = args,
|
|
@@ -7874,19 +7933,19 @@ function $2c61e4cd8229c49a$export$f2dc7e4e4aa11abb(props) {
|
|
|
7874
7933
|
});
|
|
7875
7934
|
},
|
|
7876
7935
|
current_sorting_: shared_properties.current_sorting_,
|
|
7877
|
-
search_filters_open_: state_.
|
|
7878
|
-
search_sorting_open_: state_.
|
|
7879
|
-
expanded_filters_: state_.
|
|
7936
|
+
search_filters_open_: state_.filters_open,
|
|
7937
|
+
search_sorting_open_: state_.sorting_open,
|
|
7938
|
+
expanded_filters_: state_.expanded_filters,
|
|
7880
7939
|
make_category_suggestion_card_: shared_properties.enable_category_suggestions_ ? (category_suggestion_)=>{
|
|
7881
7940
|
return (0, $dae23104ba8bb78c$export$d757d54550ebfb3d)({
|
|
7882
7941
|
category_suggestion_: category_suggestion_,
|
|
7883
7942
|
router_: shared_properties.router_
|
|
7884
7943
|
});
|
|
7885
7944
|
} : false,
|
|
7886
|
-
expanded_hierarchical_filters_: state_.
|
|
7945
|
+
expanded_hierarchical_filters_: state_.expanded_hierarchical_filters,
|
|
7887
7946
|
selected_filters_: shared_properties.selected_filters_,
|
|
7888
|
-
showing_recommendation_rows_: state_.
|
|
7889
|
-
scroll_restoration_data_: state_.
|
|
7947
|
+
showing_recommendation_rows_: state_.showing_recommendation_rows,
|
|
7948
|
+
scroll_restoration_data_: state_.scroll_restoration_data,
|
|
7890
7949
|
include_input_field_: ()=>props.include_input_field,
|
|
7891
7950
|
layout_options_: (0, $diwD4$solidjs.createMemo)(()=>({
|
|
7892
7951
|
cols_at_size: (0, $4e04be41243c3d80$export$6daf8749b65a1b77)(props.cols_at_size),
|
|
@@ -7910,7 +7969,7 @@ function $2c61e4cd8229c49a$export$316f6f283ae64765(props) {
|
|
|
7910
7969
|
let input_element;
|
|
7911
7970
|
const search_field = (0, $diwD4$solidjsweb.createComponent)((0, $66b8b9a9613c141d$export$b94867ecbd698f21), {
|
|
7912
7971
|
get search_field_value_ () {
|
|
7913
|
-
return shared_properties.state_.
|
|
7972
|
+
return shared_properties.state_.field_value;
|
|
7914
7973
|
},
|
|
7915
7974
|
get submit_query_ () {
|
|
7916
7975
|
return shared_properties.configured_submit_query_;
|