@depict-ai/ui 2.0.21 → 2.0.23
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/ES10/index.cjs +234 -209
- package/ES10/index.d.ts +45 -37
- package/ES10/index.js +234 -211
- package/latest/index.cjs +225 -198
- package/latest/index.d.ts +45 -37
- package/latest/index.js +225 -200
- package/package.json +2 -2
- package/server/ES10/index.cjs +228 -206
- package/server/ES10/index.d.ts +45 -37
- package/server/ES10/index.js +228 -208
- package/server/latest/index.cjs +219 -195
- package/server/latest/index.d.ts +45 -37
- package/server/latest/index.js +219 -197
package/ES10/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { add_to_version_info as $8tj43$add_to_version_info, queueMacroTask as $8tj43$queueMacroTask, catchify as $8tj43$catchify, is_safari as $8tj43$is_safari, observer as $8tj43$observer, Amazing_Slider as $8tj43$Amazing_Slider, slider_snap_css as $8tj43$slider_snap_css, slider_fading_factory as $8tj43$slider_fading_factory, slider_fractional_factory as $8tj43$slider_fractional_factory,
|
|
1
|
+
import { add_to_version_info as $8tj43$add_to_version_info, base64_encode_unicode as $8tj43$base64_encode_unicode, base64_decode_unicode as $8tj43$base64_decode_unicode, dlog as $8tj43$dlog, queueMacroTask as $8tj43$queueMacroTask, catchify as $8tj43$catchify, is_safari as $8tj43$is_safari, observer as $8tj43$observer, Amazing_Slider as $8tj43$Amazing_Slider, slider_snap_css as $8tj43$slider_snap_css, slider_fading_factory as $8tj43$slider_fading_factory, slider_fractional_factory as $8tj43$slider_fractional_factory, camelCasifyObject as $8tj43$camelCasifyObject, make_random_classname as $8tj43$make_random_classname, n_col_styling_with_dist as $8tj43$n_col_styling_with_dist, layout_get_visible_recs_without_partial_rows as $8tj43$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $8tj43$layout_get_total_rec_amount_for_row, layout_media_query_header as $8tj43$layout_media_query_header, report as $8tj43$report, useExpandingContainer as $8tj43$useExpandingContainer, standard_price_format as $8tj43$standard_price_format, hex_to_rgb as $8tj43$hex_to_rgb, relative_luminance_from_rgb as $8tj43$relative_luminance_from_rgb, fetch_recs as $8tj43$fetch_recs, snakeCasifyObject as $8tj43$snakeCasifyObject, instant_exec_on_suspect_history_change as $8tj43$instant_exec_on_suspect_history_change, base_url as $8tj43$base_url, get_depict_id as $8tj43$get_depict_id, get_user_id as $8tj43$get_user_id, get_session_id as $8tj43$get_session_id, make_url_with_query_params as $8tj43$make_url_with_query_params, fetch_retry as $8tj43$fetch_retry, add_version_query_params as $8tj43$add_version_query_params, dwarn as $8tj43$dwarn, sort_obj as $8tj43$sort_obj, edit_current_page_meta_tags as $8tj43$edit_current_page_meta_tags, javascript_media_query as $8tj43$javascript_media_query, use_href_accessor as $8tj43$use_href_accessor, is_debug as $8tj43$is_debug, make_asyncIterable_exiter as $8tj43$make_asyncIterable_exiter, href_change_ipns as $8tj43$href_change_ipns, ContainedImage as $8tj43$ContainedImage, buildThresholdList as $8tj43$buildThresholdList, deparallelize_no_drop as $8tj43$deparallelize_no_drop, ListenableSet as $8tj43$ListenableSet, insert_surfaces as $8tj43$insert_surfaces } from "@depict-ai/utilishared/ES10";
|
|
2
2
|
import { createComponent as $8tj43$createComponent, template as $8tj43$template, getNextElement as $8tj43$getNextElement, effect as $8tj43$effect, style as $8tj43$style, spread as $8tj43$spread, mergeProps as $8tj43$mergeProps, runHydrationEvents as $8tj43$runHydrationEvents, insert as $8tj43$insert, setAttribute as $8tj43$setAttribute, isServer as $8tj43$isServer, addEventListener as $8tj43$addEventListener, className as $8tj43$className, memo as $8tj43$memo, delegateEvents as $8tj43$delegateEvents, classList as $8tj43$classList, getNextMarker as $8tj43$getNextMarker, Dynamic as $8tj43$Dynamic, use as $8tj43$use } from "solid-js/web";
|
|
3
3
|
import { createSignal as $8tj43$createSignal, getOwner as $8tj43$getOwner, createEffect as $8tj43$createEffect, runWithOwner as $8tj43$runWithOwner, onCleanup as $8tj43$onCleanup, createMemo as $8tj43$createMemo, createContext as $8tj43$createContext, useContext as $8tj43$useContext, createResource as $8tj43$createResource, Suspense as $8tj43$Suspense, Show as $8tj43$Show, createRenderEffect as $8tj43$createRenderEffect, createRoot as $8tj43$createRoot, For as $8tj43$For, createUniqueId as $8tj43$createUniqueId, untrack as $8tj43$untrack, createComputed as $8tj43$createComputed, ErrorBoundary as $8tj43$ErrorBoundary, Index as $8tj43$Index, on as $8tj43$on, batch as $8tj43$batch, createReaction as $8tj43$createReaction } from "solid-js";
|
|
4
4
|
import $8tj43$babelruntimehelpersclassPrivateFieldSet from "@babel/runtime/helpers/classPrivateFieldSet";
|
|
@@ -8,7 +8,185 @@ import $8tj43$babelruntimehelpersdefineProperty from "@babel/runtime/helpers/def
|
|
|
8
8
|
/*! Depict.ai search and product listing SDK */
|
|
9
9
|
import { register_es_version } from "../multi_import_deduplicator.mjs";
|
|
10
10
|
register_es_version("ui", "ES10");
|
|
11
|
-
const $8db9a15135765c11$export$83d89fbfd8236492 = "2.0.
|
|
11
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "2.0.23";
|
|
12
|
+
const $2855bffe06ef7a03$var$fallback_operator = "in";
|
|
13
|
+
const $2855bffe06ef7a03$var$fallback_token = "";
|
|
14
|
+
const $2855bffe06ef7a03$var$legacy_filter_prefix = "filter_";
|
|
15
|
+
const $2855bffe06ef7a03$var$operator_map = {
|
|
16
|
+
"eq": "≡",
|
|
17
|
+
"neq": "≠",
|
|
18
|
+
"in": "∈",
|
|
19
|
+
"nin": "∉",
|
|
20
|
+
"leq": "≤",
|
|
21
|
+
"geq": "≥",
|
|
22
|
+
"inrange": "\uD83D\uDD22"
|
|
23
|
+
};
|
|
24
|
+
const $2855bffe06ef7a03$var$ascending_token = "\uD83D\uDCC8";
|
|
25
|
+
const $2855bffe06ef7a03$var$descending_token = "\uD83D\uDCC9";
|
|
26
|
+
const $2855bffe06ef7a03$var$range_delimiter = "-";
|
|
27
|
+
const $2855bffe06ef7a03$var$string_item_delimiter = "‚"; // This is not a comma but a comma-like character that browsers will render in the URL bar.
|
|
28
|
+
const $2855bffe06ef7a03$var$array_item_delimiter = "‣"; // FIXME: decide on a character. Could theoretically be a double string delimiter.
|
|
29
|
+
const $2855bffe06ef7a03$var$empty_item_replacement = "0️⃣";
|
|
30
|
+
const $2855bffe06ef7a03$var$op_to_token = op => {
|
|
31
|
+
if (op === $2855bffe06ef7a03$var$fallback_operator) return $2855bffe06ef7a03$var$fallback_token;
|
|
32
|
+
return $2855bffe06ef7a03$var$operator_map[op];
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Checks if a given array of filter data can be neatly serialized into an URL query parameter, or if it should fall back to JSON+base64.
|
|
36
|
+
* The requirements are either an array of strings, containing no reserved characters, or an array of arrays of strings, containing no reserved characters.
|
|
37
|
+
* No deep or mixed nesting levels are supported.
|
|
38
|
+
*/
|
|
39
|
+
function $2855bffe06ef7a03$var$array_is_serializable(array) {
|
|
40
|
+
let is_root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
41
|
+
if (array.every(item => Array.isArray(item))) {
|
|
42
|
+
if (!is_root)
|
|
43
|
+
// Deeply nested arrays are not supported, but also don't exist as filters (yet)
|
|
44
|
+
return false;
|
|
45
|
+
return array.every(item => $2855bffe06ef7a03$var$array_is_serializable(item, false));
|
|
46
|
+
}
|
|
47
|
+
if (array.some(item => typeof item !== "string"))
|
|
48
|
+
// Numbers are not supported, since 1 and "1" would encode to the same thing
|
|
49
|
+
return false;
|
|
50
|
+
// Encoding reserved characters is not supported
|
|
51
|
+
return !array.some(item => item.includes($2855bffe06ef7a03$var$array_item_delimiter) || item.includes($2855bffe06ef7a03$var$string_item_delimiter) || item === $2855bffe06ef7a03$var$empty_item_replacement);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Human readable string[] or string[][] serialization for URLs.
|
|
55
|
+
* @param array
|
|
56
|
+
* @returns
|
|
57
|
+
*/
|
|
58
|
+
function $2855bffe06ef7a03$var$encode_array(array) {
|
|
59
|
+
const is_nested = array.every(item => Array.isArray(item));
|
|
60
|
+
if (is_nested) return array.map($2855bffe06ef7a03$var$encode_array).join($2855bffe06ef7a03$var$array_item_delimiter) + $2855bffe06ef7a03$var$array_item_delimiter; // Nested arrays require a suffix to close nesting levels
|
|
61
|
+
return array.map(item => item === "" ? $2855bffe06ef7a03$var$empty_item_replacement : item).join($2855bffe06ef7a03$var$string_item_delimiter);
|
|
62
|
+
}
|
|
63
|
+
function $2855bffe06ef7a03$var$decode_array(encoded_array) {
|
|
64
|
+
const is_nested = encoded_array.includes($2855bffe06ef7a03$var$array_item_delimiter);
|
|
65
|
+
if (is_nested) return encoded_array.split($2855bffe06ef7a03$var$array_item_delimiter).filter(s => s !== "") // Remove empty segments, caused by trailing delimiter
|
|
66
|
+
.map($2855bffe06ef7a03$var$decode_array);
|
|
67
|
+
return encoded_array.split($2855bffe06ef7a03$var$string_item_delimiter).filter(s => s !== "") // Remove empty segments, caused by trailing delimiter in the single item special case
|
|
68
|
+
.map(item => item === $2855bffe06ef7a03$var$empty_item_replacement ? "" : item);
|
|
69
|
+
}
|
|
70
|
+
function $2855bffe06ef7a03$var$encode_filter_data(op, data) {
|
|
71
|
+
if (data === "true")
|
|
72
|
+
// boolean encoding
|
|
73
|
+
return "1";
|
|
74
|
+
if (data === "false")
|
|
75
|
+
// boolean encoding
|
|
76
|
+
return "0";
|
|
77
|
+
const data_is_array = Array.isArray(data);
|
|
78
|
+
if (op === "inrange" && data_is_array && data.every(item => typeof item === "number"))
|
|
79
|
+
// numeric range filter encoding
|
|
80
|
+
return data.join($2855bffe06ef7a03$var$range_delimiter);
|
|
81
|
+
if (data_is_array && $2855bffe06ef7a03$var$array_is_serializable(data)) {
|
|
82
|
+
const encoded_data = $2855bffe06ef7a03$var$encode_array(data);
|
|
83
|
+
if (!encoded_data.includes($2855bffe06ef7a03$var$array_item_delimiter) && !encoded_data.includes($2855bffe06ef7a03$var$string_item_delimiter))
|
|
84
|
+
// A string[] with only one item will encode without delimiters, which is indistinguishable from a plain string during decoding
|
|
85
|
+
// In that case we add a delimiter suffix at the end
|
|
86
|
+
return encoded_data + $2855bffe06ef7a03$var$string_item_delimiter;
|
|
87
|
+
return encoded_data;
|
|
88
|
+
}
|
|
89
|
+
// Fallback encoding
|
|
90
|
+
return $8tj43$base64_encode_unicode(JSON.stringify(data));
|
|
91
|
+
}
|
|
92
|
+
function $2855bffe06ef7a03$var$decode_filter_data(op, encoded_data) {
|
|
93
|
+
if (encoded_data === "1") return "true";
|
|
94
|
+
if (encoded_data === "0") return "false";
|
|
95
|
+
if (op === "inrange" && encoded_data.includes($2855bffe06ef7a03$var$range_delimiter)) return encoded_data.split($2855bffe06ef7a03$var$range_delimiter).map(x => parseFloat(x));
|
|
96
|
+
if (encoded_data.includes($2855bffe06ef7a03$var$string_item_delimiter) || encoded_data.includes($2855bffe06ef7a03$var$array_item_delimiter)) return $2855bffe06ef7a03$var$decode_array(encoded_data);
|
|
97
|
+
try {
|
|
98
|
+
return JSON.parse($8tj43$base64_decode_unicode(encoded_data));
|
|
99
|
+
} catch (e) {
|
|
100
|
+
$8tj43$dlog("Failed to fallback parse filter data", op, encoded_data, e);
|
|
101
|
+
}
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
function $2855bffe06ef7a03$export$58aa3f171519b6d7(filters, search_params, filter_query_param_prefix) {
|
|
105
|
+
for (const filter of filters) {
|
|
106
|
+
const {
|
|
107
|
+
field: field,
|
|
108
|
+
op: op,
|
|
109
|
+
data: data
|
|
110
|
+
} = filter;
|
|
111
|
+
const encoded_data = $2855bffe06ef7a03$var$encode_filter_data(op, data);
|
|
112
|
+
search_params.set(filter_query_param_prefix + field + $2855bffe06ef7a03$var$op_to_token(op), encoded_data);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function $2855bffe06ef7a03$export$f934fa24c3a86811(search_params, filter_query_param_prefix) {
|
|
116
|
+
const found_filters = [];
|
|
117
|
+
for (const key of search_params.keys()) {
|
|
118
|
+
// Allow for backwards compatibility with the old filter query param prefix
|
|
119
|
+
let chosen_prefix = filter_query_param_prefix;
|
|
120
|
+
if (!key.startsWith(chosen_prefix)) {
|
|
121
|
+
chosen_prefix = $2855bffe06ef7a03$var$legacy_filter_prefix;
|
|
122
|
+
if (!key.startsWith(chosen_prefix)) continue;
|
|
123
|
+
}
|
|
124
|
+
const encoded_data = search_params.get(key);
|
|
125
|
+
if (!encoded_data) continue;
|
|
126
|
+
const [op, token] = Object.entries($2855bffe06ef7a03$var$operator_map).find(_ref => {
|
|
127
|
+
let [, token] = _ref;
|
|
128
|
+
return key.endsWith(token);
|
|
129
|
+
}) || [$2855bffe06ef7a03$var$fallback_operator, $2855bffe06ef7a03$var$fallback_token];
|
|
130
|
+
const data = $2855bffe06ef7a03$var$decode_filter_data(op, encoded_data);
|
|
131
|
+
if (!data) continue;
|
|
132
|
+
const field = key.slice(chosen_prefix.length, token ? -token.length : undefined);
|
|
133
|
+
found_filters.push({
|
|
134
|
+
field: field,
|
|
135
|
+
op: op,
|
|
136
|
+
data: data
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
return found_filters;
|
|
140
|
+
}
|
|
141
|
+
function $2855bffe06ef7a03$export$62acb285a7579555(sorting, search_params, sorting_query_param) {
|
|
142
|
+
if (!sorting) return;
|
|
143
|
+
const {
|
|
144
|
+
field: field,
|
|
145
|
+
order: order
|
|
146
|
+
} = sorting;
|
|
147
|
+
const ascending = order === "asc";
|
|
148
|
+
search_params.set(sorting_query_param, field + (ascending ? $2855bffe06ef7a03$var$ascending_token : $2855bffe06ef7a03$var$descending_token));
|
|
149
|
+
}
|
|
150
|
+
function $2855bffe06ef7a03$export$766e9676e74997d3(search_params, sorting_query_param_) {
|
|
151
|
+
const encoded_sorting = search_params.get(sorting_query_param_);
|
|
152
|
+
if (!encoded_sorting) return;
|
|
153
|
+
if (encoded_sorting.endsWith($2855bffe06ef7a03$var$ascending_token)) return {
|
|
154
|
+
field: encoded_sorting.slice(0, -$2855bffe06ef7a03$var$ascending_token.length),
|
|
155
|
+
order: "asc"
|
|
156
|
+
};
|
|
157
|
+
if (encoded_sorting.endsWith($2855bffe06ef7a03$var$descending_token)) return {
|
|
158
|
+
field: encoded_sorting.slice(0, -$2855bffe06ef7a03$var$descending_token.length),
|
|
159
|
+
order: "desc"
|
|
160
|
+
};
|
|
161
|
+
$8tj43$dlog("Invalid sorting query param value", encoded_sorting);
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
function $2855bffe06ef7a03$export$916e6850778505f6(search_params, filter_query_param_prefix, sorting_query_param) {
|
|
165
|
+
// We'll be modifying the URLSearchParams object, so we need to make a copy of the keys first
|
|
166
|
+
const keys = [...search_params.keys()];
|
|
167
|
+
for (const key of keys) if (key.startsWith(filter_query_param_prefix) || key === sorting_query_param || key.startsWith($2855bffe06ef7a03$var$legacy_filter_prefix)) search_params.delete(key);
|
|
168
|
+
}
|
|
169
|
+
const $2855bffe06ef7a03$export$cf5feb2102aec7f2 = "went_sideways_clear_filters";
|
|
170
|
+
function $2855bffe06ef7a03$export$43cd1e747fecd42e(_ref2) {
|
|
171
|
+
let {
|
|
172
|
+
to_url_: to_url_,
|
|
173
|
+
set_clearing_flag_: set_clearing_flag_,
|
|
174
|
+
from_search_params_ = new URLSearchParams(location.search),
|
|
175
|
+
sorting_query_param_: sorting_query_param_,
|
|
176
|
+
filter_query_param_prefix_: filter_query_param_prefix_
|
|
177
|
+
} = _ref2;
|
|
178
|
+
if (!to_url_) return to_url_;
|
|
179
|
+
const was_url_object = to_url_ instanceof URL;
|
|
180
|
+
const url_object = was_url_object ? to_url_ : new URL(to_url_, location.origin);
|
|
181
|
+
const {
|
|
182
|
+
searchParams: searchParams
|
|
183
|
+
} = url_object;
|
|
184
|
+
if (set_clearing_flag_) searchParams.set($2855bffe06ef7a03$export$cf5feb2102aec7f2, "true");
|
|
185
|
+
if (from_search_params_.has(sorting_query_param_)) searchParams.set(sorting_query_param_, from_search_params_.get(sorting_query_param_));
|
|
186
|
+
for (const key of from_search_params_.keys()) if (key.startsWith(filter_query_param_prefix_)) searchParams.set(key, from_search_params_.get(key));
|
|
187
|
+
if (was_url_object) return url_object;
|
|
188
|
+
return url_object.href;
|
|
189
|
+
}
|
|
12
190
|
const $5441862cd2f5e111$var$ListingContext = /*@__PURE__*/$8tj43$createContext();
|
|
13
191
|
function $5441862cd2f5e111$export$e68cff63f76bd15b(props) {
|
|
14
192
|
const our_object = {};
|
|
@@ -1250,6 +1428,14 @@ function $9783d437ad61594c$export$3b621d86b1566b2() {
|
|
|
1250
1428
|
return _el$;
|
|
1251
1429
|
})();
|
|
1252
1430
|
}
|
|
1431
|
+
|
|
1432
|
+
/**
|
|
1433
|
+
* Lower cases a string if possible. Mostly used to make the filter url values case-insensitive.
|
|
1434
|
+
*/
|
|
1435
|
+
function $af5d8e0b7d97a7f6$export$325f75597868c4f0(stuff) {
|
|
1436
|
+
if (typeof stuff !== "string") return stuff;
|
|
1437
|
+
return stuff.toLowerCase();
|
|
1438
|
+
}
|
|
1253
1439
|
const $4711a82d08d2021b$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<button class="clear-all-filters minor"></button>`, 2),
|
|
1254
1440
|
$4711a82d08d2021b$var$_tmpl$2 = /*#__PURE__*/$8tj43$template(`<div class="inner"><span class="title"><!#><!/>: </span><!#><!/></div>`, 8),
|
|
1255
1441
|
$4711a82d08d2021b$var$_tmpl$3 = /*#__PURE__*/$8tj43$template(`<button class="clear-filter major"><!#><!/><span><!#><!/><!#><!/><!#><!/> – <!#><!/><!#><!/><!#><!/></span></button>`, 18),
|
|
@@ -1340,7 +1526,7 @@ function $4711a82d08d2021b$export$fecbb157621501bd(_ref) {
|
|
|
1340
1526
|
let created_an_object = false;
|
|
1341
1527
|
for (let j = 0; j < value.length; j++) {
|
|
1342
1528
|
var _pointer;
|
|
1343
|
-
const this_categories_name = value[j];
|
|
1529
|
+
const this_categories_name = $af5d8e0b7d97a7f6$export$325f75597868c4f0(value[j]);
|
|
1344
1530
|
const obj = (_pointer = pointer)[this_categories_name] || (_pointer[this_categories_name] = (() => {
|
|
1345
1531
|
const value_as_string = value.map(v => typeof v === "number" ? v + "" : v); // don't think backend will ever send numbers but technically it's allowed;
|
|
1346
1532
|
const created_obj = {
|
|
@@ -1446,7 +1632,7 @@ function $4711a82d08d2021b$export$fecbb157621501bd(_ref) {
|
|
|
1446
1632
|
var _meta, _meta$values;
|
|
1447
1633
|
const sel_d = selected_data();
|
|
1448
1634
|
return (_meta = meta()) === null || _meta === void 0 ? void 0 : (_meta$values = _meta.values) === null || _meta$values === void 0 ? void 0 : _meta$values.findIndex(value => {
|
|
1449
|
-
return value === sel_d || Array.isArray(value) && Array.isArray(sel_d) && value.length === sel_d.length && value.every((item, index) => sel_d[index] === item);
|
|
1635
|
+
return $af5d8e0b7d97a7f6$export$325f75597868c4f0(value) === $af5d8e0b7d97a7f6$export$325f75597868c4f0(sel_d) || Array.isArray(value) && Array.isArray(sel_d) && value.length === sel_d.length && value.every((item, index) => $af5d8e0b7d97a7f6$export$325f75597868c4f0(sel_d[index]) === $af5d8e0b7d97a7f6$export$325f75597868c4f0(item));
|
|
1450
1636
|
});
|
|
1451
1637
|
});
|
|
1452
1638
|
const name = $8tj43$createMemo(() => {
|
|
@@ -1462,7 +1648,7 @@ function $4711a82d08d2021b$export$fecbb157621501bd(_ref) {
|
|
|
1462
1648
|
let pointer = structure;
|
|
1463
1649
|
for (const step of selected_data()) {
|
|
1464
1650
|
var _pointer2, _we_in_structure;
|
|
1465
|
-
we_in_structure = (_pointer2 = pointer) === null || _pointer2 === void 0 ? void 0 : _pointer2[step];
|
|
1651
|
+
we_in_structure = (_pointer2 = pointer) === null || _pointer2 === void 0 ? void 0 : _pointer2[$af5d8e0b7d97a7f6$export$325f75597868c4f0(step)];
|
|
1466
1652
|
pointer = (_we_in_structure = we_in_structure) === null || _we_in_structure === void 0 ? void 0 : _we_in_structure.children_;
|
|
1467
1653
|
}
|
|
1468
1654
|
return we_in_structure;
|
|
@@ -1477,7 +1663,7 @@ function $4711a82d08d2021b$export$fecbb157621501bd(_ref) {
|
|
|
1477
1663
|
let {
|
|
1478
1664
|
value_: value_
|
|
1479
1665
|
} = _ref2;
|
|
1480
|
-
return (_iterable_selected_fi = iterable_selected_filter_data()) === null || _iterable_selected_fi === void 0 ? void 0 : _iterable_selected_fi.some(v => Array.isArray(v) && v.length === value_.length && value_.every((val, index) => v[index] === val));
|
|
1666
|
+
return (_iterable_selected_fi = iterable_selected_filter_data()) === null || _iterable_selected_fi === void 0 ? void 0 : _iterable_selected_fi.some(v => Array.isArray(v) && v.length === value_.length && value_.every((val, index) => $af5d8e0b7d97a7f6$export$325f75597868c4f0(v[index]) === $af5d8e0b7d97a7f6$export$325f75597868c4f0(val)));
|
|
1481
1667
|
});
|
|
1482
1668
|
return false;
|
|
1483
1669
|
});
|
|
@@ -1500,7 +1686,7 @@ function $4711a82d08d2021b$export$fecbb157621501bd(_ref) {
|
|
|
1500
1686
|
cloned_selected_filters.splice(index_in_selected_filters, 1);
|
|
1501
1687
|
const data = filter().data;
|
|
1502
1688
|
const cloned_data = Array.isArray(data) ? [...data] : [data];
|
|
1503
|
-
const index_of_item = cloned_data.findIndex(item => item === to_remove);
|
|
1689
|
+
const index_of_item = cloned_data.findIndex(item => $af5d8e0b7d97a7f6$export$325f75597868c4f0(item) === $af5d8e0b7d97a7f6$export$325f75597868c4f0(to_remove));
|
|
1504
1690
|
if (index_of_item >= 0) cloned_data.splice(index_of_item, 1);
|
|
1505
1691
|
const in_structure = us_in_structure();
|
|
1506
1692
|
if (in_structure) {
|
|
@@ -1511,7 +1697,7 @@ function $4711a82d08d2021b$export$fecbb157621501bd(_ref) {
|
|
|
1511
1697
|
const {
|
|
1512
1698
|
value_: value_
|
|
1513
1699
|
} = kid;
|
|
1514
|
-
const index_to_remove = cloned_data.findIndex(item => Array.isArray(item) && item.length === value_.length && value_.every((val, index) => item[index] === val));
|
|
1700
|
+
const index_to_remove = cloned_data.findIndex(item => Array.isArray(item) && item.length === value_.length && value_.every((val, index) => $af5d8e0b7d97a7f6$export$325f75597868c4f0(item[index]) === $af5d8e0b7d97a7f6$export$325f75597868c4f0(val)));
|
|
1515
1701
|
if (index_to_remove >= 0) cloned_data.splice(index_to_remove, 1);
|
|
1516
1702
|
recursive_kids.push(...Object.values(kid.children_));
|
|
1517
1703
|
}
|
|
@@ -1702,6 +1888,12 @@ function $133484ef10e4e954$export$dd948f91abc3a1c4(_ref) {
|
|
|
1702
1888
|
});
|
|
1703
1889
|
const render_checkbox = checkbox => {
|
|
1704
1890
|
// Checkbox always calls the getters in props, so we don't wrap these values into memos
|
|
1891
|
+
const is_checked = $8tj43$createMemo(() => {
|
|
1892
|
+
var _existing_filter;
|
|
1893
|
+
const data = (_existing_filter = existing_filter()) === null || _existing_filter === void 0 ? void 0 : _existing_filter.data;
|
|
1894
|
+
const value = $af5d8e0b7d97a7f6$export$325f75597868c4f0(checkbox().value_);
|
|
1895
|
+
return !!(data !== null && data !== void 0 && data.some(item => $af5d8e0b7d97a7f6$export$325f75597868c4f0(item) === value));
|
|
1896
|
+
});
|
|
1705
1897
|
return $8tj43$createComponent((0, $19e828709c7723a0$export$48513f6b9f8ce62d), {
|
|
1706
1898
|
get value_() {
|
|
1707
1899
|
return checkbox().value_;
|
|
@@ -1713,8 +1905,7 @@ function $133484ef10e4e954$export$dd948f91abc3a1c4(_ref) {
|
|
|
1713
1905
|
return checkbox().count_;
|
|
1714
1906
|
},
|
|
1715
1907
|
get checked_() {
|
|
1716
|
-
|
|
1717
|
-
return (_existing_filter = existing_filter()) === null || _existing_filter === void 0 ? void 0 : (_existing_filter$data = _existing_filter.data) === null || _existing_filter$data === void 0 ? void 0 : _existing_filter$data.includes(checkbox().value_);
|
|
1908
|
+
return is_checked();
|
|
1718
1909
|
}
|
|
1719
1910
|
});
|
|
1720
1911
|
};
|
|
@@ -1881,7 +2072,7 @@ function $b54fc842e721c9eb$export$430444115f70a734(_ref) {
|
|
|
1881
2072
|
var _existing_filter;
|
|
1882
2073
|
const v = value();
|
|
1883
2074
|
const data = (_existing_filter = existing_filter()) === null || _existing_filter === void 0 ? void 0 : _existing_filter.data;
|
|
1884
|
-
if (data === v) return true;
|
|
2075
|
+
if ($af5d8e0b7d97a7f6$export$325f75597868c4f0(data) === $af5d8e0b7d97a7f6$export$325f75597868c4f0(v)) return true;
|
|
1885
2076
|
return Array.isArray(data) && data.every((item, index) => item === v[index]);
|
|
1886
2077
|
})());
|
|
1887
2078
|
return _el$2;
|
|
@@ -2650,7 +2841,7 @@ function $0ae614c5c7babb43$var$create_updating_signal(_ref3) {
|
|
|
2650
2841
|
var _existing_filter_$dat, _existing_filter_$dat2;
|
|
2651
2842
|
// wait for the children to have populated and us to have received the correct value_ and name_ values
|
|
2652
2843
|
let updating_blocked = false;
|
|
2653
|
-
const index_of_us_in_selected_filter = existing_filter_ === null || existing_filter_ === void 0 ? void 0 : (_existing_filter_$dat = existing_filter_.data) === null || _existing_filter_$dat === void 0 ? void 0 : (_existing_filter_$dat2 = _existing_filter_$dat.findIndex) === null || _existing_filter_$dat2 === void 0 ? void 0 : _existing_filter_$dat2.call(_existing_filter_$dat, el => el.length === self_.value_.length && el.every((sub_el, index) => self_.value_[index] === sub_el));
|
|
2844
|
+
const index_of_us_in_selected_filter = existing_filter_ === null || existing_filter_ === void 0 ? void 0 : (_existing_filter_$dat = existing_filter_.data) === null || _existing_filter_$dat === void 0 ? void 0 : (_existing_filter_$dat2 = _existing_filter_$dat.findIndex) === null || _existing_filter_$dat2 === void 0 ? void 0 : _existing_filter_$dat2.call(_existing_filter_$dat, el => el.length === self_.value_.length && el.every((sub_el, index) => $af5d8e0b7d97a7f6$export$325f75597868c4f0(self_.value_[index]) === $af5d8e0b7d97a7f6$export$325f75597868c4f0(sub_el)));
|
|
2654
2845
|
signal_.push(...$8tj43$createSignal(index_of_us_in_selected_filter >= 0));
|
|
2655
2846
|
const [read_checked, write_checked] = signal_;
|
|
2656
2847
|
const child_objects = Object.values(self_.children_);
|
|
@@ -2842,8 +3033,10 @@ const $830ea8efda59884e$export$414f6a19d38e655c = _ref => {
|
|
|
2842
3033
|
},
|
|
2843
3034
|
children: value => {
|
|
2844
3035
|
const is_selected = $8tj43$createMemo(() => {
|
|
2845
|
-
var _existing_filter
|
|
2846
|
-
|
|
3036
|
+
var _existing_filter;
|
|
3037
|
+
const data = (_existing_filter = existing_filter()) === null || _existing_filter === void 0 ? void 0 : _existing_filter.data;
|
|
3038
|
+
const current_value = $af5d8e0b7d97a7f6$export$325f75597868c4f0(value().value_);
|
|
3039
|
+
return !!(data !== null && data !== void 0 && data.some(item => $af5d8e0b7d97a7f6$export$325f75597868c4f0(item) === current_value));
|
|
2847
3040
|
});
|
|
2848
3041
|
const MakeButton = attributes => (() => {
|
|
2849
3042
|
const _el$2 = $8tj43$getNextElement($830ea8efda59884e$var$_tmpl$3),
|
|
@@ -2879,7 +3072,10 @@ const $830ea8efda59884e$export$414f6a19d38e655c = _ref => {
|
|
|
2879
3072
|
...base_object,
|
|
2880
3073
|
data: new_data
|
|
2881
3074
|
};
|
|
2882
|
-
if (!is_selected()) new_filter_object.data.push(value().value_);else
|
|
3075
|
+
if (!is_selected()) new_filter_object.data.push(value().value_);else {
|
|
3076
|
+
const current_value_lower = $af5d8e0b7d97a7f6$export$325f75597868c4f0(value().value_);
|
|
3077
|
+
new_filter_object.data = new_filter_object.data.filter(v => $af5d8e0b7d97a7f6$export$325f75597868c4f0(v) !== current_value_lower);
|
|
3078
|
+
}
|
|
2883
3079
|
const selected_filters = [...get_selected_filters().filter(f => f !== set_filter), ...(new_filter_object.data.length ? [new_filter_object] : [])];
|
|
2884
3080
|
set_selected_filters(selected_filters);
|
|
2885
3081
|
});
|
|
@@ -2981,16 +3177,6 @@ function $830ea8efda59884e$var$adjust_sizes(container_width, sizes, set_cols_at_
|
|
|
2981
3177
|
overrides: column_to_row_result
|
|
2982
3178
|
}]]);
|
|
2983
3179
|
}
|
|
2984
|
-
function $00a5b94f0c11efbb$export$d9f36cf74e24d595(media_query) {
|
|
2985
|
-
const signal = $8tj43$createSignal(false);
|
|
2986
|
-
$8tj43$onCleanup($8tj43$javascript_media_query(media_query, _ref => {
|
|
2987
|
-
let {
|
|
2988
|
-
matches: matches
|
|
2989
|
-
} = _ref;
|
|
2990
|
-
return signal[1](matches);
|
|
2991
|
-
}).remove);
|
|
2992
|
-
return signal[0];
|
|
2993
|
-
}
|
|
2994
3180
|
const $2cb856c297c53e6c$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<form class="checkbox-color"><!#><!/><!#><!/></form>`, 6);
|
|
2995
3181
|
const $2cb856c297c53e6c$var$max_visible_without_collapsing = 30;
|
|
2996
3182
|
const $2cb856c297c53e6c$var$show_non_collapsible_when_collapsed = 8;
|
|
@@ -3001,7 +3187,6 @@ function $2cb856c297c53e6c$export$82ed4b28ecb67608(_ref) {
|
|
|
3001
3187
|
i18n_: i18n_,
|
|
3002
3188
|
view_more_button_below_group_: [_get_view_more_button_below_group_, set_view_more_button_below_group_]
|
|
3003
3189
|
} = _ref;
|
|
3004
|
-
const supports_hover = $00a5b94f0c11efbb$export$d9f36cf74e24d595("not all and (hover: none)");
|
|
3005
3190
|
// same as in CheckboxFilter, maybe we should make this DRY at some point
|
|
3006
3191
|
const existing_filter = $8tj43$createMemo(() => {
|
|
3007
3192
|
const {
|
|
@@ -3039,6 +3224,12 @@ function $2cb856c297c53e6c$export$82ed4b28ecb67608(_ref) {
|
|
|
3039
3224
|
});
|
|
3040
3225
|
const rgb_color = $8tj43$createMemo(() => $8tj43$hex_to_rgb(hex_color()));
|
|
3041
3226
|
const black_contrast_better = $8tj43$createMemo(() => rgb_color() ? $2cb856c297c53e6c$var$does_black_contrast_better(rgb_color()) : false);
|
|
3227
|
+
const is_checked = $8tj43$createMemo(() => {
|
|
3228
|
+
var _existing_filter;
|
|
3229
|
+
const data = (_existing_filter = existing_filter()) === null || _existing_filter === void 0 ? void 0 : _existing_filter.data;
|
|
3230
|
+
const value = $af5d8e0b7d97a7f6$export$325f75597868c4f0(checkbox().value_);
|
|
3231
|
+
return !!(data !== null && data !== void 0 && data.some(item => $af5d8e0b7d97a7f6$export$325f75597868c4f0(item) === value));
|
|
3232
|
+
});
|
|
3042
3233
|
const input_row = $8tj43$createComponent((0, $19e828709c7723a0$export$48513f6b9f8ce62d), {
|
|
3043
3234
|
get value_() {
|
|
3044
3235
|
return checkbox().value_;
|
|
@@ -3050,8 +3241,7 @@ function $2cb856c297c53e6c$export$82ed4b28ecb67608(_ref) {
|
|
|
3050
3241
|
return checkbox().count_;
|
|
3051
3242
|
},
|
|
3052
3243
|
get checked_() {
|
|
3053
|
-
|
|
3054
|
-
return (_existing_filter = existing_filter()) === null || _existing_filter === void 0 ? void 0 : (_existing_filter$data = _existing_filter.data) === null || _existing_filter$data === void 0 ? void 0 : _existing_filter$data.includes(checkbox().value_);
|
|
3244
|
+
return is_checked();
|
|
3055
3245
|
},
|
|
3056
3246
|
custom_indicator_ref: span => {
|
|
3057
3247
|
const {
|
|
@@ -3243,7 +3433,7 @@ function $d0ff304c14f50521$export$53c59af873b303c9(_ref) {
|
|
|
3243
3433
|
break try_specific;
|
|
3244
3434
|
}
|
|
3245
3435
|
const needle = data_is_array ? data[0] : data;
|
|
3246
|
-
const index_in_meta = meta.values.findIndex(value => needle === value || Array.isArray(needle) && Array.isArray(value) && needle.length === value.length && value.every((item, index) => needle[index] === item));
|
|
3436
|
+
const index_in_meta = meta.values.findIndex(value => $af5d8e0b7d97a7f6$export$325f75597868c4f0(needle) === $af5d8e0b7d97a7f6$export$325f75597868c4f0(value) || Array.isArray(needle) && Array.isArray(value) && needle.length === value.length && value.every((item, index) => $af5d8e0b7d97a7f6$export$325f75597868c4f0(needle[index]) === $af5d8e0b7d97a7f6$export$325f75597868c4f0(item)));
|
|
3247
3437
|
return ((_names = meta.names) === null || _names === void 0 ? void 0 : _names[index_in_meta]) || ((_values = meta.values) === null || _values === void 0 ? void 0 : _values[index_in_meta]);
|
|
3248
3438
|
}
|
|
3249
3439
|
}
|
|
@@ -3849,7 +4039,8 @@ function $972f6bce0f9d61be$export$e183a13865960371(params_to_default_value, rout
|
|
|
3849
4039
|
const signals = {};
|
|
3850
4040
|
const entries = Object.entries(params_to_default_value);
|
|
3851
4041
|
const event_handler = $8tj43$catchify((what_happened, args) => {
|
|
3852
|
-
|
|
4042
|
+
// Intentionally always update our signals to the history state to allow external control of SDK state for doing things like https://linear.app/depictai/issue/X-1432/is-this-possible-with-the-depict-sdk
|
|
4043
|
+
$972f6bce0f9d61be$var$history_state_change(signals, entries, what_happened === "popstate" ? args.state : history.state);
|
|
3853
4044
|
});
|
|
3854
4045
|
// createRenderEffect because we need the instant execution so the signals always contain values, even before solid's render phase
|
|
3855
4046
|
$8tj43$createRenderEffect(() => {
|
|
@@ -4283,6 +4474,16 @@ async function $284849364a6ef73a$var$_cached_post_request2(endpoint, input_req,
|
|
|
4283
4474
|
delete cache_obj.in_progress_[body];
|
|
4284
4475
|
}
|
|
4285
4476
|
}
|
|
4477
|
+
function $00a5b94f0c11efbb$export$d9f36cf74e24d595(media_query) {
|
|
4478
|
+
const signal = $8tj43$createSignal(false);
|
|
4479
|
+
$8tj43$onCleanup($8tj43$javascript_media_query(media_query, _ref => {
|
|
4480
|
+
let {
|
|
4481
|
+
matches: matches
|
|
4482
|
+
} = _ref;
|
|
4483
|
+
return signal[1](matches);
|
|
4484
|
+
}).remove);
|
|
4485
|
+
return signal[0];
|
|
4486
|
+
}
|
|
4286
4487
|
const $9b5022ae72f56399$var$get_available_range = (available_filters_, search_for_field) => {
|
|
4287
4488
|
var _untrack, _untrack$find;
|
|
4288
4489
|
const maybe_meta = (_untrack = $8tj43$untrack(available_filters_)) === null || _untrack === void 0 ? void 0 : (_untrack$find = _untrack.find(_ref => {
|
|
@@ -5962,184 +6163,6 @@ function $6a16b21155984cef$var$ActualFloatingButtons(_ref2) {
|
|
|
5962
6163
|
})();
|
|
5963
6164
|
}
|
|
5964
6165
|
$8tj43$delegateEvents(["click"]);
|
|
5965
|
-
const $2855bffe06ef7a03$var$fallback_operator = "in";
|
|
5966
|
-
const $2855bffe06ef7a03$var$fallback_token = "";
|
|
5967
|
-
const $2855bffe06ef7a03$var$legacy_filter_prefix = "filter_";
|
|
5968
|
-
const $2855bffe06ef7a03$var$operator_map = {
|
|
5969
|
-
"eq": "≡",
|
|
5970
|
-
"neq": "≠",
|
|
5971
|
-
"in": "∈",
|
|
5972
|
-
"nin": "∉",
|
|
5973
|
-
"leq": "≤",
|
|
5974
|
-
"geq": "≥",
|
|
5975
|
-
"inrange": "\uD83D\uDD22"
|
|
5976
|
-
};
|
|
5977
|
-
const $2855bffe06ef7a03$var$ascending_token = "\uD83D\uDCC8";
|
|
5978
|
-
const $2855bffe06ef7a03$var$descending_token = "\uD83D\uDCC9";
|
|
5979
|
-
const $2855bffe06ef7a03$var$range_delimiter = "-";
|
|
5980
|
-
const $2855bffe06ef7a03$var$string_item_delimiter = "‚"; // This is not a comma but a comma-like character that browsers will render in the URL bar.
|
|
5981
|
-
const $2855bffe06ef7a03$var$array_item_delimiter = "‣"; // FIXME: decide on a character. Could theoretically be a double string delimiter.
|
|
5982
|
-
const $2855bffe06ef7a03$var$empty_item_replacement = "0️⃣";
|
|
5983
|
-
const $2855bffe06ef7a03$var$op_to_token = op => {
|
|
5984
|
-
if (op === $2855bffe06ef7a03$var$fallback_operator) return $2855bffe06ef7a03$var$fallback_token;
|
|
5985
|
-
return $2855bffe06ef7a03$var$operator_map[op];
|
|
5986
|
-
};
|
|
5987
|
-
/**
|
|
5988
|
-
* Checks if a given array of filter data can be neatly serialized into an URL query parameter, or if it should fall back to JSON+base64.
|
|
5989
|
-
* The requirements are either an array of strings, containing no reserved characters, or an array of arrays of strings, containing no reserved characters.
|
|
5990
|
-
* No deep or mixed nesting levels are supported.
|
|
5991
|
-
*/
|
|
5992
|
-
function $2855bffe06ef7a03$var$array_is_serializable(array) {
|
|
5993
|
-
let is_root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
5994
|
-
if (array.every(item => Array.isArray(item))) {
|
|
5995
|
-
if (!is_root)
|
|
5996
|
-
// Deeply nested arrays are not supported, but also don't exist as filters (yet)
|
|
5997
|
-
return false;
|
|
5998
|
-
return array.every(item => $2855bffe06ef7a03$var$array_is_serializable(item, false));
|
|
5999
|
-
}
|
|
6000
|
-
if (array.some(item => typeof item !== "string"))
|
|
6001
|
-
// Numbers are not supported, since 1 and "1" would encode to the same thing
|
|
6002
|
-
return false;
|
|
6003
|
-
// Encoding reserved characters is not supported
|
|
6004
|
-
return !array.some(item => item.includes($2855bffe06ef7a03$var$array_item_delimiter) || item.includes($2855bffe06ef7a03$var$string_item_delimiter) || item === $2855bffe06ef7a03$var$empty_item_replacement);
|
|
6005
|
-
}
|
|
6006
|
-
/**
|
|
6007
|
-
* Human readable string[] or string[][] serialization for URLs.
|
|
6008
|
-
* @param array
|
|
6009
|
-
* @returns
|
|
6010
|
-
*/
|
|
6011
|
-
function $2855bffe06ef7a03$var$encode_array(array) {
|
|
6012
|
-
const is_nested = array.every(item => Array.isArray(item));
|
|
6013
|
-
if (is_nested) return array.map($2855bffe06ef7a03$var$encode_array).join($2855bffe06ef7a03$var$array_item_delimiter) + $2855bffe06ef7a03$var$array_item_delimiter; // Nested arrays require a suffix to close nesting levels
|
|
6014
|
-
return array.map(item => item === "" ? $2855bffe06ef7a03$var$empty_item_replacement : item).join($2855bffe06ef7a03$var$string_item_delimiter);
|
|
6015
|
-
}
|
|
6016
|
-
function $2855bffe06ef7a03$var$decode_array(encoded_array) {
|
|
6017
|
-
const is_nested = encoded_array.includes($2855bffe06ef7a03$var$array_item_delimiter);
|
|
6018
|
-
if (is_nested) return encoded_array.split($2855bffe06ef7a03$var$array_item_delimiter).filter(s => s !== "") // Remove empty segments, caused by trailing delimiter
|
|
6019
|
-
.map($2855bffe06ef7a03$var$decode_array);
|
|
6020
|
-
return encoded_array.split($2855bffe06ef7a03$var$string_item_delimiter).filter(s => s !== "") // Remove empty segments, caused by trailing delimiter in the single item special case
|
|
6021
|
-
.map(item => item === $2855bffe06ef7a03$var$empty_item_replacement ? "" : item);
|
|
6022
|
-
}
|
|
6023
|
-
function $2855bffe06ef7a03$var$encode_filter_data(op, data) {
|
|
6024
|
-
if (data === "true")
|
|
6025
|
-
// boolean encoding
|
|
6026
|
-
return "1";
|
|
6027
|
-
if (data === "false")
|
|
6028
|
-
// boolean encoding
|
|
6029
|
-
return "0";
|
|
6030
|
-
const data_is_array = Array.isArray(data);
|
|
6031
|
-
if (op === "inrange" && data_is_array && data.every(item => typeof item === "number"))
|
|
6032
|
-
// numeric range filter encoding
|
|
6033
|
-
return data.join($2855bffe06ef7a03$var$range_delimiter);
|
|
6034
|
-
if (data_is_array && $2855bffe06ef7a03$var$array_is_serializable(data)) {
|
|
6035
|
-
const encoded_data = $2855bffe06ef7a03$var$encode_array(data);
|
|
6036
|
-
if (!encoded_data.includes($2855bffe06ef7a03$var$array_item_delimiter) && !encoded_data.includes($2855bffe06ef7a03$var$string_item_delimiter))
|
|
6037
|
-
// A string[] with only one item will encode without delimiters, which is indistinguishable from a plain string during decoding
|
|
6038
|
-
// In that case we add a delimiter suffix at the end
|
|
6039
|
-
return encoded_data + $2855bffe06ef7a03$var$string_item_delimiter;
|
|
6040
|
-
return encoded_data;
|
|
6041
|
-
}
|
|
6042
|
-
// Fallback encoding
|
|
6043
|
-
return $8tj43$base64_encode_unicode(JSON.stringify(data));
|
|
6044
|
-
}
|
|
6045
|
-
function $2855bffe06ef7a03$var$decode_filter_data(op, encoded_data) {
|
|
6046
|
-
if (encoded_data === "1") return "true";
|
|
6047
|
-
if (encoded_data === "0") return "false";
|
|
6048
|
-
if (op === "inrange" && encoded_data.includes($2855bffe06ef7a03$var$range_delimiter)) return encoded_data.split($2855bffe06ef7a03$var$range_delimiter).map(x => parseFloat(x));
|
|
6049
|
-
if (encoded_data.includes($2855bffe06ef7a03$var$string_item_delimiter) || encoded_data.includes($2855bffe06ef7a03$var$array_item_delimiter)) return $2855bffe06ef7a03$var$decode_array(encoded_data);
|
|
6050
|
-
try {
|
|
6051
|
-
return JSON.parse($8tj43$base64_decode_unicode(encoded_data));
|
|
6052
|
-
} catch (e) {
|
|
6053
|
-
$8tj43$dlog("Failed to fallback parse filter data", op, encoded_data, e);
|
|
6054
|
-
}
|
|
6055
|
-
return null;
|
|
6056
|
-
}
|
|
6057
|
-
function $2855bffe06ef7a03$export$58aa3f171519b6d7(filters, search_params, filter_query_param_prefix) {
|
|
6058
|
-
for (const filter of filters) {
|
|
6059
|
-
const {
|
|
6060
|
-
field: field,
|
|
6061
|
-
op: op,
|
|
6062
|
-
data: data
|
|
6063
|
-
} = filter;
|
|
6064
|
-
const encoded_data = $2855bffe06ef7a03$var$encode_filter_data(op, data);
|
|
6065
|
-
search_params.set(filter_query_param_prefix + field + $2855bffe06ef7a03$var$op_to_token(op), encoded_data);
|
|
6066
|
-
}
|
|
6067
|
-
}
|
|
6068
|
-
function $2855bffe06ef7a03$export$f934fa24c3a86811(search_params, filter_query_param_prefix) {
|
|
6069
|
-
const found_filters = [];
|
|
6070
|
-
for (const key of search_params.keys()) {
|
|
6071
|
-
// Allow for backwards compatibility with the old filter query param prefix
|
|
6072
|
-
let chosen_prefix = filter_query_param_prefix;
|
|
6073
|
-
if (!key.startsWith(chosen_prefix)) {
|
|
6074
|
-
chosen_prefix = $2855bffe06ef7a03$var$legacy_filter_prefix;
|
|
6075
|
-
if (!key.startsWith(chosen_prefix)) continue;
|
|
6076
|
-
}
|
|
6077
|
-
const encoded_data = search_params.get(key);
|
|
6078
|
-
if (!encoded_data) continue;
|
|
6079
|
-
const [op, token] = Object.entries($2855bffe06ef7a03$var$operator_map).find(_ref => {
|
|
6080
|
-
let [, token] = _ref;
|
|
6081
|
-
return key.endsWith(token);
|
|
6082
|
-
}) || [$2855bffe06ef7a03$var$fallback_operator, $2855bffe06ef7a03$var$fallback_token];
|
|
6083
|
-
const data = $2855bffe06ef7a03$var$decode_filter_data(op, encoded_data);
|
|
6084
|
-
if (!data) continue;
|
|
6085
|
-
const field = key.slice(chosen_prefix.length, token ? -token.length : undefined);
|
|
6086
|
-
found_filters.push({
|
|
6087
|
-
field: field,
|
|
6088
|
-
op: op,
|
|
6089
|
-
data: data
|
|
6090
|
-
});
|
|
6091
|
-
}
|
|
6092
|
-
return found_filters;
|
|
6093
|
-
}
|
|
6094
|
-
function $2855bffe06ef7a03$export$62acb285a7579555(sorting, search_params, sorting_query_param) {
|
|
6095
|
-
if (!sorting) return;
|
|
6096
|
-
const {
|
|
6097
|
-
field: field,
|
|
6098
|
-
order: order
|
|
6099
|
-
} = sorting;
|
|
6100
|
-
const ascending = order === "asc";
|
|
6101
|
-
search_params.set(sorting_query_param, field + (ascending ? $2855bffe06ef7a03$var$ascending_token : $2855bffe06ef7a03$var$descending_token));
|
|
6102
|
-
}
|
|
6103
|
-
function $2855bffe06ef7a03$export$766e9676e74997d3(search_params, sorting_query_param_) {
|
|
6104
|
-
const encoded_sorting = search_params.get(sorting_query_param_);
|
|
6105
|
-
if (!encoded_sorting) return;
|
|
6106
|
-
if (encoded_sorting.endsWith($2855bffe06ef7a03$var$ascending_token)) return {
|
|
6107
|
-
field: encoded_sorting.slice(0, -$2855bffe06ef7a03$var$ascending_token.length),
|
|
6108
|
-
order: "asc"
|
|
6109
|
-
};
|
|
6110
|
-
if (encoded_sorting.endsWith($2855bffe06ef7a03$var$descending_token)) return {
|
|
6111
|
-
field: encoded_sorting.slice(0, -$2855bffe06ef7a03$var$descending_token.length),
|
|
6112
|
-
order: "desc"
|
|
6113
|
-
};
|
|
6114
|
-
$8tj43$dlog("Invalid sorting query param value", encoded_sorting);
|
|
6115
|
-
return;
|
|
6116
|
-
}
|
|
6117
|
-
function $2855bffe06ef7a03$export$916e6850778505f6(search_params, filter_query_param_prefix, sorting_query_param) {
|
|
6118
|
-
// We'll be modifying the URLSearchParams object, so we need to make a copy of the keys first
|
|
6119
|
-
const keys = [...search_params.keys()];
|
|
6120
|
-
for (const key of keys) if (key.startsWith(filter_query_param_prefix) || key === sorting_query_param || key.startsWith($2855bffe06ef7a03$var$legacy_filter_prefix)) search_params.delete(key);
|
|
6121
|
-
}
|
|
6122
|
-
const $2855bffe06ef7a03$export$cf5feb2102aec7f2 = "went_sideways_clear_filters";
|
|
6123
|
-
function $2855bffe06ef7a03$export$43cd1e747fecd42e(_ref2) {
|
|
6124
|
-
let {
|
|
6125
|
-
to_url_: to_url_,
|
|
6126
|
-
set_clearing_flag_: set_clearing_flag_,
|
|
6127
|
-
from_search_params_ = new URLSearchParams(location.search),
|
|
6128
|
-
sorting_query_param_: sorting_query_param_,
|
|
6129
|
-
filter_query_param_prefix_: filter_query_param_prefix_
|
|
6130
|
-
} = _ref2;
|
|
6131
|
-
if (!to_url_) return to_url_;
|
|
6132
|
-
const was_url_object = to_url_ instanceof URL;
|
|
6133
|
-
const url_object = was_url_object ? to_url_ : new URL(to_url_, location.origin);
|
|
6134
|
-
const {
|
|
6135
|
-
searchParams: searchParams
|
|
6136
|
-
} = url_object;
|
|
6137
|
-
if (set_clearing_flag_) searchParams.set($2855bffe06ef7a03$export$cf5feb2102aec7f2, "true");
|
|
6138
|
-
if (from_search_params_.has(sorting_query_param_)) searchParams.set(sorting_query_param_, from_search_params_.get(sorting_query_param_));
|
|
6139
|
-
for (const key of from_search_params_.keys()) if (key.startsWith(filter_query_param_prefix_)) searchParams.set(key, from_search_params_.get(key));
|
|
6140
|
-
if (was_url_object) return url_object;
|
|
6141
|
-
return url_object.href;
|
|
6142
|
-
}
|
|
6143
6166
|
const $52efc9ae4382e25a$var$_tmpl$ = /*#__PURE__*/$8tj43$template(`<nav class="crumbs"></nav>`, 2),
|
|
6144
6167
|
$52efc9ae4382e25a$var$_tmpl$2 = /*#__PURE__*/$8tj43$template(`<a class="crumb"></a>`, 2),
|
|
6145
6168
|
$52efc9ae4382e25a$var$_tmpl$3 = /*#__PURE__*/$8tj43$template(`<span class="separator"></span>`, 2);
|
|
@@ -11764,7 +11787,7 @@ function $f9fd3017c20b774a$var$_get_rendered_recs2() {
|
|
|
11764
11787
|
}
|
|
11765
11788
|
function $f9fd3017c20b774a$var$_empty_page_bugfix2() {
|
|
11766
11789
|
// Called when a "page" is "opened" using PageReplacer
|
|
11767
|
-
const on_maybe_popstate = what_happened => {
|
|
11790
|
+
const on_maybe_popstate = $8tj43$catchify(what_happened => {
|
|
11768
11791
|
if (what_happened !== "popstate") return;
|
|
11769
11792
|
const cleaned_current_url = $f9fd3017c20b774a$var$clean_url(location.href);
|
|
11770
11793
|
if (!$f9fd3017c20b774a$var$_classStaticPrivateFieldSpecGet($f9fd3017c20b774a$export$3ccaa27d81dd8556, $f9fd3017c20b774a$export$3ccaa27d81dd8556, $f9fd3017c20b774a$var$_visited_urls).has(cleaned_current_url)) {
|
|
@@ -11793,7 +11816,7 @@ function $f9fd3017c20b774a$var$_empty_page_bugfix2() {
|
|
|
11793
11816
|
$f9fd3017c20b774a$var$_classStaticPrivateFieldSpecSet($f9fd3017c20b774a$export$3ccaa27d81dd8556, $f9fd3017c20b774a$export$3ccaa27d81dd8556, $f9fd3017c20b774a$var$_reverting_permitted, false); // Disallow any reverting since we can't - it would flash a white page until the reload has finished.
|
|
11794
11817
|
$8tj43$babelruntimehelpersclassPrivateFieldGet(this, $f9fd3017c20b774a$var$_unload).call(this); // Call unload to "kill" the solid-js stuff quicker so that it stops updating - the user is expecting the next thing that happens to be a navigation to the actual page the URL says they're on.
|
|
11795
11818
|
}
|
|
11796
|
-
};
|
|
11819
|
+
});
|
|
11797
11820
|
|
|
11798
11821
|
(0, $8tj43$instant_exec_on_suspect_history_change).add(on_maybe_popstate);
|
|
11799
11822
|
$8tj43$babelruntimehelpersclassPrivateFieldGet(this, $f9fd3017c20b774a$var$_revert_fns).push(() => (0, $8tj43$instant_exec_on_suspect_history_change).delete(on_maybe_popstate)); // Don't run the bugfixer if there isn't a PageReplacer page open since I assume the bug only happens when going back from a PageReplace'd page
|
|
@@ -11827,4 +11850,4 @@ const $d399250dfa491636$export$c3834fa86c616831 = [[4], [3, 1024], [2, 901]];
|
|
|
11827
11850
|
const $d399250dfa491636$export$864d304a0bc46829 = "2%";
|
|
11828
11851
|
const $d399250dfa491636$export$7bf543b9d9be2c22 = (0, $fa332ea03168857c$export$b91cec6bdc6b32a1);
|
|
11829
11852
|
$8tj43$add_to_version_info("ui", (0, $8db9a15135765c11$export$83d89fbfd8236492));
|
|
11830
|
-
export { $4df489344a0f97c7$export$d7b7ab832c20e2f4 as shopifyContainedImageContextSymbol, $5441862cd2f5e111$export$e68cff63f76bd15b as ListingProvider, $5441862cd2f5e111$export$8d0c4fdbb05a2f2e as useListing, $4df489344a0f97c7$export$e4b984597b71e989 as ShopifyContainedImage, $002f09d00aac50b2$export$6649caad96ef8870 as SlidableItems, $0dc044cffe1e825b$export$9f191182275e9ef as make_accurate_size_accessor, $d5d7e58c5c9d8db0$export$9574e176201e5e8d as RecommendationSlider, $b432b11321ad4c97$export$9756467d34d91cdb as RecommendationGrid, $56047603f9d212b6$export$6e5611bc7e57e477 as ShopifyResponsiveImg, $56047603f9d212b6$export$e6fffe67d4cdd848 as makeSizeAccessor, $801e8845d3fa3653$export$94026ee33dbabc26 as ImageContainer, $74777e8fe65b3dcb$export$b69d0d92862de18b as SentryErrorBoundary, $ad371564683947ab$export$6c6d7a51fa9aa15d as ExpandingDetails, $e18ab2868df26f40$export$f091cbac892643a4 as accessor_of_object_to_object_with_accessor_values, $4711a82d08d2021b$export$fecbb157621501bd as SelectedFilters, $f6b0500577e1b210$export$3f1a388cc0d8fed7 as FilterBody, $44aa24b1bb793549$export$b288c38ae3fddb56 as create_modified_filters, $63f1f8dbcd07d3b0$export$d21e32dfedac04be as SolidLayout, $d5f1e6a0f9117286$export$79b1565500412d9b as general_modal_abstraction, $9783d437ad61594c$export$3b621d86b1566b2 as CrossIcon, $ca6ab5f08bd28bca$export$8be2714ec7f169ee as GenericSliderArrowButton, $5c5732ef44f05b26$export$58e808b1db15d3bc as fetchDepictRecommendations, $f5f54892fd0c7d9f$export$de035477d6fef996 as QuickLinks, $f5f54892fd0c7d9f$export$5b7c3ce0ebe51f86 as BreadCrumbs, $fa332ea03168857c$export$b91cec6bdc6b32a1 as CategoryTitle, $702d7656a373973e$export$824dde41348efed1 as embedded_num_products, $96fd967c5b358ead$export$643598a327b5833e as get_categories, $f5f54892fd0c7d9f$export$f34314aa9505732e as DepictCategory, $f5f54892fd0c7d9f$export$e2bf8ce7779e827e as CategoryPage, $eb064bc3350276c1$export$ac6237957a15b3f0 as DepictSearch, $eb064bc3350276c1$export$bde3eb976dfded9 as get_search_query_updating_blocked_signal, $eb064bc3350276c1$export$f2dc7e4e4aa11abb as SearchPage, $eb064bc3350276c1$export$316f6f283ae64765 as SearchField, $f3b7124b76123e44$export$aa14a9f43128f61f as ProductCardError, $169c13c0531d91d2$export$d86a33413558014e as open_modal_with_alignment, $5eaa00b951637e96$export$ee1733d9a8495996 as DefaultInstantCardPlaceholder, $1308a7816c3d4f2d$export$b3ad617e9036868 as align_field, $a9c7ba6087881ac2$export$6daf8749b65a1b77 as convert_sdk_cols_at_size_to_layout, $cc64aabf2c7a1f1a$export$1233ca167bf71f9a as styles_to_valid_css_string, $e56d241d0f33d459$export$fe334901e8bebd57 as disable_scrolling, $573c007c697a1831$export$d0596b5cae35ad4 as open_search_with_shift_slash, $284849364a6ef73a$export$e015ed2f2950f2e3 as DepictAPI, $00a5b94f0c11efbb$export$d9f36cf74e24d595 as media_query_to_accessor, $e60a76195ac6d408$export$689e204eadb33baf as setup_fast_leave, $a61a2051e15c8d7a$export$5196e4c01fa56fcb as show_toast, $60ec7a29849d81db$export$a71e92cfbb498adc as SolidFormatPrice, $37e8c97bb6876197$export$828dcdd425fd3231 as connect_search_field_height_to_aligner_height, $bc2337c9a05ecd18$export$acb3eaade4b23afd as BasePlaceholder, $ceafb6fb91c6f394$export$89c6019e4baa40b1 as TextPlaceholder, $3ab4aa97880fb88d$export$3f37af283f8fb843 as ImagePlaceholder, $f9fd3017c20b774a$export$3ccaa27d81dd8556 as PageReplacer, $d399250dfa491636$export$864d304a0bc46829 as defaultGridSpacing, $d399250dfa491636$export$c3834fa86c616831 as defaultColsAtSize, $d399250dfa491636$export$7bf543b9d9be2c22 as defaultCategoryTitlePlugin, $8db9a15135765c11$export$83d89fbfd8236492 as version };
|
|
11853
|
+
export { $2855bffe06ef7a03$export$58aa3f171519b6d7 as encode_filters, $2855bffe06ef7a03$export$f934fa24c3a86811 as decode_filters, $4df489344a0f97c7$export$d7b7ab832c20e2f4 as shopifyContainedImageContextSymbol, $5441862cd2f5e111$export$e68cff63f76bd15b as ListingProvider, $5441862cd2f5e111$export$8d0c4fdbb05a2f2e as useListing, $4df489344a0f97c7$export$e4b984597b71e989 as ShopifyContainedImage, $002f09d00aac50b2$export$6649caad96ef8870 as SlidableItems, $0dc044cffe1e825b$export$9f191182275e9ef as make_accurate_size_accessor, $d5d7e58c5c9d8db0$export$9574e176201e5e8d as RecommendationSlider, $b432b11321ad4c97$export$9756467d34d91cdb as RecommendationGrid, $56047603f9d212b6$export$6e5611bc7e57e477 as ShopifyResponsiveImg, $56047603f9d212b6$export$e6fffe67d4cdd848 as makeSizeAccessor, $801e8845d3fa3653$export$94026ee33dbabc26 as ImageContainer, $74777e8fe65b3dcb$export$b69d0d92862de18b as SentryErrorBoundary, $ad371564683947ab$export$6c6d7a51fa9aa15d as ExpandingDetails, $e18ab2868df26f40$export$f091cbac892643a4 as accessor_of_object_to_object_with_accessor_values, $4711a82d08d2021b$export$fecbb157621501bd as SelectedFilters, $f6b0500577e1b210$export$3f1a388cc0d8fed7 as FilterBody, $44aa24b1bb793549$export$b288c38ae3fddb56 as create_modified_filters, $63f1f8dbcd07d3b0$export$d21e32dfedac04be as SolidLayout, $d5f1e6a0f9117286$export$79b1565500412d9b as general_modal_abstraction, $9783d437ad61594c$export$3b621d86b1566b2 as CrossIcon, $ca6ab5f08bd28bca$export$8be2714ec7f169ee as GenericSliderArrowButton, $5c5732ef44f05b26$export$58e808b1db15d3bc as fetchDepictRecommendations, $f5f54892fd0c7d9f$export$de035477d6fef996 as QuickLinks, $f5f54892fd0c7d9f$export$5b7c3ce0ebe51f86 as BreadCrumbs, $fa332ea03168857c$export$b91cec6bdc6b32a1 as CategoryTitle, $702d7656a373973e$export$824dde41348efed1 as embedded_num_products, $96fd967c5b358ead$export$643598a327b5833e as get_categories, $f5f54892fd0c7d9f$export$f34314aa9505732e as DepictCategory, $f5f54892fd0c7d9f$export$e2bf8ce7779e827e as CategoryPage, $eb064bc3350276c1$export$ac6237957a15b3f0 as DepictSearch, $eb064bc3350276c1$export$bde3eb976dfded9 as get_search_query_updating_blocked_signal, $eb064bc3350276c1$export$f2dc7e4e4aa11abb as SearchPage, $eb064bc3350276c1$export$316f6f283ae64765 as SearchField, $f3b7124b76123e44$export$aa14a9f43128f61f as ProductCardError, $169c13c0531d91d2$export$d86a33413558014e as open_modal_with_alignment, $5eaa00b951637e96$export$ee1733d9a8495996 as DefaultInstantCardPlaceholder, $1308a7816c3d4f2d$export$b3ad617e9036868 as align_field, $a9c7ba6087881ac2$export$6daf8749b65a1b77 as convert_sdk_cols_at_size_to_layout, $cc64aabf2c7a1f1a$export$1233ca167bf71f9a as styles_to_valid_css_string, $e56d241d0f33d459$export$fe334901e8bebd57 as disable_scrolling, $573c007c697a1831$export$d0596b5cae35ad4 as open_search_with_shift_slash, $284849364a6ef73a$export$e015ed2f2950f2e3 as DepictAPI, $00a5b94f0c11efbb$export$d9f36cf74e24d595 as media_query_to_accessor, $e60a76195ac6d408$export$689e204eadb33baf as setup_fast_leave, $a61a2051e15c8d7a$export$5196e4c01fa56fcb as show_toast, $60ec7a29849d81db$export$a71e92cfbb498adc as SolidFormatPrice, $37e8c97bb6876197$export$828dcdd425fd3231 as connect_search_field_height_to_aligner_height, $bc2337c9a05ecd18$export$acb3eaade4b23afd as BasePlaceholder, $ceafb6fb91c6f394$export$89c6019e4baa40b1 as TextPlaceholder, $3ab4aa97880fb88d$export$3f37af283f8fb843 as ImagePlaceholder, $f9fd3017c20b774a$export$3ccaa27d81dd8556 as PageReplacer, $d399250dfa491636$export$864d304a0bc46829 as defaultGridSpacing, $d399250dfa491636$export$c3834fa86c616831 as defaultColsAtSize, $d399250dfa491636$export$7bf543b9d9be2c22 as defaultCategoryTitlePlugin, $8db9a15135765c11$export$83d89fbfd8236492 as version };
|