@depict-ai/utilishared 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. package/README.md +130 -130
  2. package/dist/index.d.ts +2429 -2424
  3. package/dist/main.js +155 -143
  4. package/dist/module.js +155 -144
  5. package/package.json +2 -2
package/dist/main.js CHANGED
@@ -277,9 +277,10 @@ $parcel$export(module.exports, "snakeCasifyObject", () => $89758b55120b0cbd$expo
277
277
  $parcel$export(module.exports, "rgb_to_hsl", () => $d73746ee466f09ca$export$499ef00a6a3417f8);
278
278
  $parcel$export(module.exports, "hsl_to_rgb", () => $d73746ee466f09ca$export$e4fd3b61e79357a7);
279
279
  $parcel$export(module.exports, "relative_luminance_from_rgb", () => $d73746ee466f09ca$export$98c2b3491e76c1f);
280
+ $parcel$export(module.exports, "hsb_to_rgb", () => $d73746ee466f09ca$export$486b165479b9284f);
280
281
  $parcel$export(module.exports, "version", () => $815f67c61b4c0a42$export$83d89fbfd8236492);
281
282
  $parcel$export(module.exports, "add_to_version_info", () => $e4a18bf12ad092d9$export$2cefb7e61fcbae00);
282
- const $815f67c61b4c0a42$export$83d89fbfd8236492 = "1.0.8";
283
+ const $815f67c61b4c0a42$export$83d89fbfd8236492 = "1.0.9";
283
284
 
284
285
 
285
286
  const $7b5e577a60b81e60$export$55fe61489d2c7417 = /*@__PURE__*/ (()=>process.env.STRIP_DEBUG === "true" ? false : process.env.DEBUG === "true" || process.env.NODE_ENV === "development" || process.env.BUILD_TARGET !== "node" && (globalThis?.document?.currentScript?.dataset?.debug === "true" || globalThis?.localStorage?.getItem?.("debug") === "true"))();
@@ -323,8 +324,8 @@ function $e4a18bf12ad092d9$export$fe609f0216e4ebef(url) {
323
324
 
324
325
 
325
326
  // Source: https://stackoverflow.com/a/30106551
326
- /**
327
- * Encoding UTF8 ⇢ base64
327
+ /**
328
+ * Encoding UTF8 ⇢ base64
328
329
  */ function $ff7c981d968fe09a$export$a1893782a2a6be0d(str) {
329
330
  return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function(match, p1) {
330
331
  return String.fromCharCode(parseInt(p1, 16));
@@ -339,13 +340,13 @@ function $ff7c981d968fe09a$export$a7e53ec3b3fdd030(str) {
339
340
 
340
341
 
341
342
 
342
- /**
343
- * Class containing state that an IPNS operates on. It's only exported for type info and in case that you want to use it for instanceof checks.
344
- * subscribers is an array of functions that get called every time push_value is called with a new value AND all previous subscribers are done
345
- * queue is the queue of values that subscribers gets called with
346
- * last_processed_value is the last value that the subscribers were called with
347
- * push_value adds a new value to the queue and triggers the calling of the subscribers if they're done
348
- * subscriber_done decrements the number of subscribers we are waiting for, if this isn't called call_subscribers will get stuck. It also triggers a new call to call_subscribers
343
+ /**
344
+ * Class containing state that an IPNS operates on. It's only exported for type info and in case that you want to use it for instanceof checks.
345
+ * subscribers is an array of functions that get called every time push_value is called with a new value AND all previous subscribers are done
346
+ * queue is the queue of values that subscribers gets called with
347
+ * last_processed_value is the last value that the subscribers were called with
348
+ * push_value adds a new value to the queue and triggers the calling of the subscribers if they're done
349
+ * subscriber_done decrements the number of subscribers we are waiting for, if this isn't called call_subscribers will get stuck. It also triggers a new call to call_subscribers
349
350
  */ class $5a591e8156b1128c$export$e2c811ae0eb35313 {
350
351
  subscribers_ = [];
351
352
  waiting_for_update_ = 0;
@@ -421,10 +422,10 @@ function $5a591e8156b1128c$export$3e42f5078e3abfc0(state) {
421
422
  }
422
423
 
423
424
 
424
- /**
425
- * You know how you can write `break` inside of a `for await` loop to exit it? Well, this lets you break the loop from outside. Pass any async iterable that never throws and you will get back a function and a specially proxied async iterable. Whenever you call the function all for await loops iterating the returned iterable will break. Note: This will add some extra ticks because awaiting thenable objects takes more ticks than awaiting promises.
426
- * @param async_iterable The async iterable you want to make exitable
427
- * @return An array containing a function, the exit function, and a wrapped async iterable
425
+ /**
426
+ * You know how you can write `break` inside of a `for await` loop to exit it? Well, this lets you break the loop from outside. Pass any async iterable that never throws and you will get back a function and a specially proxied async iterable. Whenever you call the function all for await loops iterating the returned iterable will break. Note: This will add some extra ticks because awaiting thenable objects takes more ticks than awaiting promises.
427
+ * @param async_iterable The async iterable you want to make exitable
428
+ * @return An array containing a function, the exit function, and a wrapped async iterable
428
429
  */ function $bbe52965151ee7f0$export$927664b47117acb0(async_iterable) {
429
430
  const promise_result_setting_functions = new Map();
430
431
  const exit_function = ()=>{
@@ -905,11 +906,11 @@ function $268cbd9e4ade92db$export$f18d5b0af29128b7(msg, severity, input_data = {
905
906
  }
906
907
 
907
908
 
908
- /**
909
- * Gives a random number between min and max (potentially including min and max).
910
- * @param min The minimum number.
911
- * @param max The maximum number.
912
- * @returns a random number
909
+ /**
910
+ * Gives a random number between min and max (potentially including min and max).
911
+ * @param min The minimum number.
912
+ * @param max The maximum number.
913
+ * @returns a random number
913
914
  */ function $3f34dc07544c5857$export$bb0a9c36cf454ea0(min, max) {
914
915
  return Math.floor(Math.random() * (max - min + 1)) + min;
915
916
  }
@@ -1232,9 +1233,9 @@ class $d10801050840d92b$export$1d9c6fddbff3441f extends $d10801050840d92b$export
1232
1233
  }
1233
1234
 
1234
1235
 
1235
- /**
1236
- * Returns a random string
1237
- * @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
1236
+ /**
1237
+ * Returns a random string
1238
+ * @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
1238
1239
  */ function $650b64c1b384c895$export$656831b7e9c341c3() {
1239
1240
  return (Math.random() * 2e17).toString(36);
1240
1241
  }
@@ -1486,8 +1487,8 @@ function $dba5a9c0f6fb4324$export$6f051469dd676a8b(tenant, market, type) {
1486
1487
 
1487
1488
 
1488
1489
 
1489
- /**
1490
- * @deprecated this was a stupid idea, it's much easier to read if one just does a quick arrow function that provides the wanted arguments
1490
+ /**
1491
+ * @deprecated this was a stupid idea, it's much easier to read if one just does a quick arrow function that provides the wanted arguments
1491
1492
  */ function $ee1d22bd1fcdd4e1$export$6e7454c733fa1fb2(fn, ...args) {
1492
1493
  return function(...unimportant_args) {
1493
1494
  return fn.apply(this, [
@@ -2280,10 +2281,10 @@ async function $44909e19109bf973$export$8f66c4c7fb96eda2(e, product_id) {
2280
2281
 
2281
2282
 
2282
2283
 
2283
- /**
2284
- * Useful for the `thresholds` option of IntersectionObserver - if you want to be notified at a 10% change, call this and set num_steps to 10. Pls see https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/thresholds
2285
- * @param numSteps How many steps (notifications) there should be between 0 and 100% intersection
2286
- * @return Stuff to give to IntersectionObserver
2284
+ /**
2285
+ * Useful for the `thresholds` option of IntersectionObserver - if you want to be notified at a 10% change, call this and set num_steps to 10. Pls see https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/thresholds
2286
+ * @param numSteps How many steps (notifications) there should be between 0 and 100% intersection
2287
+ * @return Stuff to give to IntersectionObserver
2287
2288
  */ function $0da0cad4f39e8f32$export$f8ea2e7b15b5d129(numSteps) {
2288
2289
  const thresholds = [];
2289
2290
  for(let i = 1.0; i <= numSteps; i++){
@@ -2295,12 +2296,12 @@ async function $44909e19109bf973$export$8f66c4c7fb96eda2(e, product_id) {
2295
2296
  }
2296
2297
 
2297
2298
 
2298
- /**
2299
- * Elements currently intersecting with the viewport.
2300
- * If they are intersecting for the `has_to_be_intersecting_for` duration, we count it as an impression, and call the callback.
2299
+ /**
2300
+ * Elements currently intersecting with the viewport.
2301
+ * If they are intersecting for the `has_to_be_intersecting_for` duration, we count it as an impression, and call the callback.
2301
2302
  */ const $72ed530554068e4f$var$current_intersections = /*@__PURE__*/ new WeakMap();
2302
- /**
2303
- * Currently watched elements by the intersection observer with their respective callback
2303
+ /**
2304
+ * Currently watched elements by the intersection observer with their respective callback
2304
2305
  * */ const $72ed530554068e4f$var$watched_elements = /*@__PURE__*/ new WeakMap();
2305
2306
  const $72ed530554068e4f$var$unwatch_element = (element)=>{
2306
2307
  $72ed530554068e4f$var$intersection_observer?.unobserve(element);
@@ -2365,9 +2366,9 @@ const $72ed530554068e4f$var$intersection_observer_callback = (entries)=>{
2365
2366
  }
2366
2367
  }
2367
2368
  };
2368
- /**
2369
- * Global IntersectionObserver used for all impression tracking.
2370
- * It's faster to use one observer for all elements than to create a new one for each element.
2369
+ /**
2370
+ * Global IntersectionObserver used for all impression tracking.
2371
+ * It's faster to use one observer for all elements than to create a new one for each element.
2371
2372
  */ const $72ed530554068e4f$var$intersection_observer = typeof window === "object" ? /*@__PURE__*/ new IntersectionObserver((0, $268cbd9e4ade92db$export$b3bbfd758f11cfa9)($72ed530554068e4f$var$intersection_observer_callback), {
2372
2373
  threshold: /*@__PURE__*/ (0, /*@__PURE__*/$0da0cad4f39e8f32$export$f8ea2e7b15b5d129)(8)
2373
2374
  }) : undefined;
@@ -2711,17 +2712,17 @@ const $28e42b0009d694b2$export$abec7fd9f0b9cc22 = /*@__PURE__*/ (0, /*@__PURE__*
2711
2712
 
2712
2713
 
2713
2714
  const $2026711c6c2d6204$var$required_consent_level = process.env.DEPICT_TRACKING_CONSENT_LEVEL;
2714
- /*
2715
- The Optanon cookie format can vary slightly between integrations. To figure out the key values used for a particular customer,
2716
- visit their web, finish the consent dialog, then run
2717
- new URLSearchParams(document.cookie.match("(^|;)\\s*OptanonConsent\\s*=\\s*([^;]+)")?.pop()).get("groups")
2718
- in the console. You should see something like
2719
- 'NECES:1,ANALY:1,PERON:1,MARKE:1'
2720
- Which tells you what the key values for each consent level is. Enter them in the correct order, comma separated,
2721
- as OPTANON_KEYS in the tenants .env file. For the cookie output above, the .env entry would be
2722
- OPTANON_KEYS="NECES,ANALY,PERON,MARKE"
2723
- If it's not obvious which consent level each key represents, open the consent dialog again and start de-selecting consent options,
2724
- then check the cookie value again.
2715
+ /*
2716
+ The Optanon cookie format can vary slightly between integrations. To figure out the key values used for a particular customer,
2717
+ visit their web, finish the consent dialog, then run
2718
+ new URLSearchParams(document.cookie.match("(^|;)\\s*OptanonConsent\\s*=\\s*([^;]+)")?.pop()).get("groups")
2719
+ in the console. You should see something like
2720
+ 'NECES:1,ANALY:1,PERON:1,MARKE:1'
2721
+ Which tells you what the key values for each consent level is. Enter them in the correct order, comma separated,
2722
+ as OPTANON_KEYS in the tenants .env file. For the cookie output above, the .env entry would be
2723
+ OPTANON_KEYS="NECES,ANALY,PERON,MARKE"
2724
+ If it's not obvious which consent level each key represents, open the consent dialog again and start de-selecting consent options,
2725
+ then check the cookie value again.
2725
2726
  */ const $2026711c6c2d6204$var$KEY_ORDER = [
2726
2727
  "necessary",
2727
2728
  "statistics",
@@ -3082,8 +3083,8 @@ class $16f3a26cfac77a4c$export$8d42ce4827f43582 {
3082
3083
  });
3083
3084
  })();
3084
3085
  }
3085
- } /**
3086
- * This is a list of alpha-2 country codes plus some two letter combinations commonly used to describe markets
3086
+ } /**
3087
+ * This is a list of alpha-2 country codes plus some two letter combinations commonly used to describe markets
3087
3088
  */ // albania
3088
3089
 
3089
3090
 
@@ -3306,11 +3307,11 @@ const $fbb09973782881cb$export$6ebd242c09192cec = /*@__PURE__*/ (0, /*@__PURE__*
3306
3307
 
3307
3308
 
3308
3309
  // not ideal but can help when debugging via sentry
3309
- /**
3310
- * A function that attempts to "serialize" an object to a text representation that helps with debugging when using sentry
3311
- * @param anything Something to try to serialize - this function is crappy and your mileage may vary
3312
- * @param depth How deep to go when recursing
3313
- * @return An object that is somehow closer to text (better serializable by sentry) or text
3310
+ /**
3311
+ * A function that attempts to "serialize" an object to a text representation that helps with debugging when using sentry
3312
+ * @param anything Something to try to serialize - this function is crappy and your mileage may vary
3313
+ * @param depth How deep to go when recursing
3314
+ * @return An object that is somehow closer to text (better serializable by sentry) or text
3314
3315
  */ function $45e05ec4fd7f1ee7$export$39d526a1194b6499(anything, depth) {
3315
3316
  depth ??= 0;
3316
3317
  depth++;
@@ -3796,8 +3797,8 @@ function $d1ef5fbddf08305d$var$find_last_visible(items) {
3796
3797
 
3797
3798
 
3798
3799
 
3799
- /**
3800
- * @deprecated use async_iterable_ipns instead. This can skip values which yields unexpected results.
3800
+ /**
3801
+ * @deprecated use async_iterable_ipns instead. This can skip values which yields unexpected results.
3801
3802
  */ function $7198207999c01453$export$55621c1ce3cd536b() {
3802
3803
  // the idea is to have a new promise available immediately before one resolves, so to say an infinite promise
3803
3804
  let internal_resolve; // copy and pasted from iconbeauty
@@ -3909,12 +3910,12 @@ async function $8686e45614d71607$export$9eae832ae57fbf(t, css, extra_html) {
3909
3910
 
3910
3911
  // TODO: Move ArrayElement<> to better util place
3911
3912
  // All the supported markets of all the Tenants (all possible markets).
3912
- /**
3913
- * @deprecated please use TwoLetterMarket / readonly arrays/objects instead
3913
+ /**
3914
+ * @deprecated please use TwoLetterMarket / readonly arrays/objects instead
3914
3915
  */ let $e86d825ce508e342$export$3db8c5834c5aa726;
3915
3916
  // All the known locales (add more)
3916
- /**
3917
- * @deprecated please use TwoLetterMarket / readonly arrays/objects instead
3917
+ /**
3918
+ * @deprecated please use TwoLetterMarket / readonly arrays/objects instead
3918
3919
  */ (function(Market) {
3919
3920
  Market["dk"] = "dk";
3920
3921
  Market["uk"] = "uk";
@@ -4027,8 +4028,8 @@ function $e86d825ce508e342$export$47340c0b196bc0f8(market) {
4027
4028
  }
4028
4029
  function $e86d825ce508e342$export$c5b68ecd5c37aa6c(market) {
4029
4030
  return $e86d825ce508e342$export$6eea148df5c7117c[market].currency;
4030
- } /**
4031
- * @deprecated please use TwoLetterMarket / readonly arrays/objects instead
4031
+ } /**
4032
+ * @deprecated please use TwoLetterMarket / readonly arrays/objects instead
4032
4033
  */
4033
4034
 
4034
4035
 
@@ -5271,8 +5272,8 @@ class $0b6a8303b64cced1$export$1a8782481a9af507 {
5271
5272
  }
5272
5273
 
5273
5274
 
5274
- var /**
5275
- * @deprecated Please use RecommendationRenderer instead
5275
+ var /**
5276
+ * @deprecated Please use RecommendationRenderer instead
5276
5277
  */ $52d3be7ce5146924$export$2e2bcd8739ae039 = async (options)=>{
5277
5278
  const depict = new (0, $0b6a8303b64cced1$export$1a8782481a9af507)(options.options), done = new Promise((itsdone)=>{
5278
5279
  document._depict_modify = true;
@@ -5548,14 +5549,14 @@ function $765ddca135d7ab33$export$c410ce1205e5118a(_t, itms, d, slider) {
5548
5549
 
5549
5550
 
5550
5551
 
5551
- var /**
5552
- * @deprecated please use `fetch_retry()` instead
5553
- *
5554
- * Windows proof fetch factory: windows proof fetch is a utility which retries fetch requests 10 times when they fail. Reason for this is a certain windows 10 build where the network stack randomly breaks 20% of https connections
5555
- * (Note: this thing really should be rewritten with exponential backoff and a better API)
5556
- * @param dlog logging function to use
5557
- * @param error_log an array to which errors will be pushed
5558
- * @return a windows proof fetch function
5552
+ var /**
5553
+ * @deprecated please use `fetch_retry()` instead
5554
+ *
5555
+ * Windows proof fetch factory: windows proof fetch is a utility which retries fetch requests 10 times when they fail. Reason for this is a certain windows 10 build where the network stack randomly breaks 20% of https connections
5556
+ * (Note: this thing really should be rewritten with exponential backoff and a better API)
5557
+ * @param dlog logging function to use
5558
+ * @param error_log an array to which errors will be pushed
5559
+ * @return a windows proof fetch function
5559
5560
  */ $c413c7798924612a$export$2e2bcd8739ae039 = (dlog, error_log)=>{
5560
5561
  // https://sentry.io/organizations/depictai-0o/issues/2025371462/?project=5476183&query=is%3Aunresolved
5561
5562
  // https://stackoverflow.com/a/52947884
@@ -5767,10 +5768,10 @@ async function $1cc2444a0f1b992e$export$c84671f46d6a1ca({ rows: rows , container
5767
5768
  }
5768
5769
  });
5769
5770
  }
5770
- /** Getting how many recs should be displayed for a certain row (while taking override rules into account)
5771
- * This returns number of recs for this row and all the previous ones
5772
- * @param row The "index" of the row (counting from the top). Starts at 1.
5773
- * @param options Your cols_at_size layout option
5771
+ /** Getting how many recs should be displayed for a certain row (while taking override rules into account)
5772
+ * This returns number of recs for this row and all the previous ones
5773
+ * @param row The "index" of the row (counting from the top). Starts at 1.
5774
+ * @param options Your cols_at_size layout option
5774
5775
  */ function $1cc2444a0f1b992e$var$get_total_rec_amount_for_row(row, options) {
5775
5776
  const [default_cols, , , , override_obj] = options;
5776
5777
  const overrides = override_obj?.overrides || {};
@@ -5781,8 +5782,8 @@ async function $1cc2444a0f1b992e$export$c84671f46d6a1ca({ rows: rows , container
5781
5782
  }
5782
5783
  return total;
5783
5784
  }
5784
- /**
5785
- * Same as `get_total_rec_amount_for_row` but caps the result to never exceed @param max_recs
5785
+ /**
5786
+ * Same as `get_total_rec_amount_for_row` but caps the result to never exceed @param max_recs
5786
5787
  */ function $1cc2444a0f1b992e$var$get_visible_recs_without_partial_rows(rows, max_recs, options) {
5787
5788
  let visible_recs;
5788
5789
  while((visible_recs = $1cc2444a0f1b992e$var$get_total_rec_amount_for_row(rows--, options)) > max_recs);
@@ -5821,13 +5822,13 @@ function $1cc2444a0f1b992e$export$17c3166a7ebd4688(selector_beginning, default_g
5821
5822
  const overrides = override?.overrides || {};
5822
5823
  const sorted = Object.keys(overrides).sort((r1, r2)=>parseInt(r1) - parseInt(r2));
5823
5824
  const last_override_row = sorted.at(-1);
5824
- /** We run this loop up until the last override rule + 1.
5825
- * The last iteration will create styling rules that apply to every row that comes after it.
5826
- * Let's say we have one override rule for row 2.
5827
- * We:
5828
- * 1. Create styling for row 1
5829
- * 2. Create styling for row 2
5830
- * 3. Create styling for row 3 which will apply to the rest of the rows. Every row will be the same from now on.
5825
+ /** We run this loop up until the last override rule + 1.
5826
+ * The last iteration will create styling rules that apply to every row that comes after it.
5827
+ * Let's say we have one override rule for row 2.
5828
+ * We:
5829
+ * 1. Create styling for row 1
5830
+ * 2. Create styling for row 2
5831
+ * 3. Create styling for row 3 which will apply to the rest of the rows. Every row will be the same from now on.
5831
5832
  */ const max_row = last_override_row ? parseInt(last_override_row) + 1 : 1;
5832
5833
  for(let row = 1; row <= max_row; row++){
5833
5834
  const real_n_cols = overrides[row] || n_cols;
@@ -6780,12 +6781,12 @@ function $3721a5ccba25c247$export$3d04c40e7acc1a32(initial_value) {
6780
6781
 
6781
6782
 
6782
6783
 
6783
- /**
6784
- * A wrapper around window.matchMedia, basically cross browser compatibly adds an event listener to a media query that triggers when it changes
6785
- * @param query The media query (without `@media`)
6786
- * @param catchified_handler The function to execute
6787
- * @param initial_call If the handler should be called instantly with the current state of the media query
6788
- * @return An object containing `remove`, a function which removes the event listener again
6784
+ /**
6785
+ * A wrapper around window.matchMedia, basically cross browser compatibly adds an event listener to a media query that triggers when it changes
6786
+ * @param query The media query (without `@media`)
6787
+ * @param catchified_handler The function to execute
6788
+ * @param initial_call If the handler should be called instantly with the current state of the media query
6789
+ * @return An object containing `remove`, a function which removes the event listener again
6789
6790
  */
6790
6791
  function $93c499898a1702c7$export$515c3ea4d599b05a(// inspired by code in houdinisportswear modify script
6791
6792
  query, handler, initial_call = true) {
@@ -7055,9 +7056,9 @@ async function $8594d423459ba80c$export$d63b08f4f29ddba5(t, unavailability_type)
7055
7056
 
7056
7057
 
7057
7058
 
7058
- /**
7059
- * Set but you can listen for values being added or removed
7060
- * i.e. my_set.addEventListener("add", ({detail}) => console.log(detail, "was added to", my_set));
7059
+ /**
7060
+ * Set but you can listen for values being added or removed
7061
+ * i.e. my_set.addEventListener("add", ({detail}) => console.log(detail, "was added to", my_set));
7061
7062
  */ class $d343f609f5a6614f$export$74108888f38788f3 extends Set {
7062
7063
  #et = new EventTarget();
7063
7064
  addEventListener(event, callback, options) {
@@ -7085,12 +7086,12 @@ async function $8594d423459ba80c$export$d63b08f4f29ddba5(t, unavailability_type)
7085
7086
 
7086
7087
 
7087
7088
 
7088
- /**
7089
- * This does what you'd think Element.closest does. It finds the closest node in the DOM tree matching a selector. So it starts out with the siblings and then goes upwards in the DOM and checks the siblings and their children of the parent until there's no parent anymore.
7090
- * @param element Element to start out at
7091
- * @param selector Selector to search for
7092
- * @param start_right=true In what direction to start: true = right, false = left
7093
- * @return The found element or undefined
7089
+ /**
7090
+ * This does what you'd think Element.closest does. It finds the closest node in the DOM tree matching a selector. So it starts out with the siblings and then goes upwards in the DOM and checks the siblings and their children of the parent until there's no parent anymore.
7091
+ * @param element Element to start out at
7092
+ * @param selector Selector to search for
7093
+ * @param start_right=true In what direction to start: true = right, false = left
7094
+ * @return The found element or undefined
7094
7095
  */ function $14d244e5a13fa0df$export$d9fdc6ce2907f95b(element, selector, start_right = true) {
7095
7096
  for(; element; element = element.parentNode){
7096
7097
  if (element?.matches?.(selector)) return element;
@@ -7143,10 +7144,10 @@ function $1e9d51e365c02476$export$82539d9817116aff(e, url) {
7143
7144
  }
7144
7145
 
7145
7146
 
7146
- /**
7147
- * This module contains utillities for working with ecom sites using shoppify.
7148
- *
7149
- * Shopify cart API reference: https://shopify.dev/api/ajax/reference/cart
7147
+ /**
7148
+ * This module contains utillities for working with ecom sites using shoppify.
7149
+ *
7150
+ * Shopify cart API reference: https://shopify.dev/api/ajax/reference/cart
7150
7151
  */
7151
7152
 
7152
7153
  async function $7ccebf01cfe4f824$export$85be83e1935d93c2(fetch_proxy_handler, // we assume fetch is actually fetch, therefore proxy handler is typed like this
@@ -7880,8 +7881,8 @@ function $2780129735dc272e$export$2a38b176ce969e2c(orig_url_with_trailing_slash)
7880
7881
 
7881
7882
 
7882
7883
 
7883
- /**
7884
- * Recursively sorts the keys in an object (NOT in-place, returns a new object). Do not provide objects containing anything other than primitives or other objects. Do not provide objects that have cyclical values.
7884
+ /**
7885
+ * Recursively sorts the keys in an object (NOT in-place, returns a new object). Do not provide objects containing anything other than primitives or other objects. Do not provide objects that have cyclical values.
7885
7886
  */ function $24daf6f6e6529b9f$export$12b4c6cbc6b8b4e4(maybe_obj) {
7886
7887
  if (!maybe_obj) return maybe_obj;
7887
7888
  if (typeof maybe_obj != "object") return maybe_obj;
@@ -7900,18 +7901,18 @@ function $2780129735dc272e$export$2a38b176ce969e2c(orig_url_with_trailing_slash)
7900
7901
  }
7901
7902
 
7902
7903
 
7903
- /**
7904
- * Tries to figure out the tenant's market (`TwoLetterMarket` for new integrations) through various means.
7905
- *
7906
- * 1. Checks if there is a market in one of the url segments (www.tentant.se/foo/se/bar)
7907
- * 2. Checks if the market is specified in the tenant's domain name (www.tenant-se.com)
7908
- * 3. Checks the toplevel domain (www.tenant.se/foo/bar)
7909
- *
7910
- * @param allowed_markets An array the possible markets for the tenant.
7911
- * Dont forget to specify the allowed market as const (`["se", "en"] as const`) to get the best typing
7912
- * @param url Specify this to overide the url to check, defaults to the current url
7913
- * @param tenant The tenant's name
7914
- * @returns If a market specified in `allowed_markets`was found that is returned, `undefined` otherwise
7904
+ /**
7905
+ * Tries to figure out the tenant's market (`TwoLetterMarket` for new integrations) through various means.
7906
+ *
7907
+ * 1. Checks if there is a market in one of the url segments (www.tentant.se/foo/se/bar)
7908
+ * 2. Checks if the market is specified in the tenant's domain name (www.tenant-se.com)
7909
+ * 3. Checks the toplevel domain (www.tenant.se/foo/bar)
7910
+ *
7911
+ * @param allowed_markets An array the possible markets for the tenant.
7912
+ * Dont forget to specify the allowed market as const (`["se", "en"] as const`) to get the best typing
7913
+ * @param url Specify this to overide the url to check, defaults to the current url
7914
+ * @param tenant The tenant's name
7915
+ * @returns If a market specified in `allowed_markets`was found that is returned, `undefined` otherwise
7915
7916
  */ function $02a3425594231893$export$a422d714c8cb1a5d(allowed_markets, url, tenant = process.env.TENANT) {
7916
7917
  const u_o = url ? new URL(url) : location;
7917
7918
  const { hostname: hostname } = u_o;
@@ -8028,9 +8029,9 @@ function $05802e6cb0fdbdcd$export$3427ec8268623f1(listener) {
8028
8029
 
8029
8030
 
8030
8031
 
8031
- /**
8032
- * Timeout a promise after `ms` milliseconds.
8033
- * If the promise is timed out this function will return `undefined` and not throw.
8032
+ /**
8033
+ * Timeout a promise after `ms` milliseconds.
8034
+ * If the promise is timed out this function will return `undefined` and not throw.
8034
8035
  */ function $9ed7c4b0fbf9ccd8$export$cd1adfb8059b5fcd(promise, ms) {
8035
8036
  const timeout = new Promise((res)=>setTimeout(res, ms));
8036
8037
  return Promise.race([
@@ -8313,9 +8314,9 @@ const $69accc27bcbd6972$export$ddd70fdae1b350e6 = ()=>(0, $107a74aa4ea5902d$expo
8313
8314
 
8314
8315
 
8315
8316
 
8316
- /**
8317
- * Internal color circle used in ColorPicker
8318
- * @see {createColorPicker}
8317
+ /**
8318
+ * Internal color circle used in ColorPicker
8319
+ * @see {createColorPicker}
8319
8320
  */ function $af92e61c7dfccf01$var$ColorCircle({ color: color , onClick: onClick , onHoverUpdate: onHoverUpdate }) {
8320
8321
  const button = (0, $107a74aa4ea5902d$export$34b9dba7ce09269b)("button", {
8321
8322
  class: "color-circle-container",
@@ -8342,9 +8343,9 @@ function $af92e61c7dfccf01$export$590326cc34f49e2d({ colors: colors , initialCol
8342
8343
  ColorPicker () {
8343
8344
  /** The currently active ColorCircle */ let activeCircle = null;
8344
8345
  /** The currently active color object */ let activeColor = null;
8345
- /**
8346
- * Update the currently active color object and HTMLElement
8347
- * Toggles the active class.
8346
+ /**
8347
+ * Update the currently active color object and HTMLElement
8348
+ * Toggles the active class.
8348
8349
  */ const setActive = (e, color)=>{
8349
8350
  if (e !== activeCircle) {
8350
8351
  if (activeCircle) activeCircle.classList.remove("active");
@@ -8357,8 +8358,8 @@ function $af92e61c7dfccf01$export$590326cc34f49e2d({ colors: colors , initialCol
8357
8358
  if (!dontSetActiveOnClick) setActive(clicked, color);
8358
8359
  onSelect(color);
8359
8360
  };
8360
- /**
8361
- * Handles the preview logic.
8361
+ /**
8362
+ * Handles the preview logic.
8362
8363
  */ const handleSelectOnHover = (hovered, color, hovering)=>{
8363
8364
  // Don't do any selection if the hovered circle is already selected
8364
8365
  if (hovered === activeCircle) return;
@@ -8551,9 +8552,9 @@ function $ff973b2032639b5f$export$a62825542f1bfcf5({ what_to_watch: what_to_watc
8551
8552
  2048,
8552
8553
  4096
8553
8554
  ] , sizes_communicator: sizes_communicator , resolution_factor: resolution_factor , market_: market_ , sizes_setter_: sizes_setter_ } = {}) {
8554
- /**
8555
- * We support what_to_watch being optional, meaning we will take the first image we get.
8556
- * For that we need to have created the image before being able to create the sizes setter.
8555
+ /**
8556
+ * We support what_to_watch being optional, meaning we will take the first image we get.
8557
+ * For that we need to have created the image before being able to create the sizes setter.
8557
8558
  */ const local_base_url = market_ ? $ff973b2032639b5f$export$3d13beba9b52c947 + "/" + market_ : $ff973b2032639b5f$export$3d13beba9b52c947;
8558
8559
  return (image_options)=>{
8559
8560
  const raw_src = image_options?.src || image_options?.["data-src"]; // get wanted src
@@ -8735,9 +8736,9 @@ const $a656daa2fa8c279a$var$TOUCHCANCEL = "touchcancel";
8735
8736
  const $a656daa2fa8c279a$var$MOUSEOVER = "mouseover";
8736
8737
  const $a656daa2fa8c279a$var$MOUSELEAVE = "mouseleave";
8737
8738
  const $a656daa2fa8c279a$var$HOVER_CLASS = "hovering";
8738
- /** This number represents how many elements are in front of div.images-container
8739
- * Here are the elements: img.depict-img-mod, div, img.depict-img-mod, div, div.second-image-container, div.main-image-container, div.images-container
8740
- * This number is not very dynamic but much more performant than iterating
8739
+ /** This number represents how many elements are in front of div.images-container
8740
+ * Here are the elements: img.depict-img-mod, div, img.depict-img-mod, div, div.second-image-container, div.main-image-container, div.images-container
8741
+ * This number is not very dynamic but much more performant than iterating
8741
8742
  */ const $a656daa2fa8c279a$var$HOVER_IMAGE_DEPTH = 7;
8742
8743
  const $a656daa2fa8c279a$var$MAX_COLLISION_DETECTION_RATE = 70; // ms
8743
8744
  const $a656daa2fa8c279a$var$touch_hover_elements = /*@__PURE__*/ new WeakMap();
@@ -9037,11 +9038,11 @@ function $12c29616944c2fb7$export$f2ca6fc699ca1fb4(props = {}) {
9037
9038
 
9038
9039
 
9039
9040
 
9040
- /**
9041
- * Shallowly converts all keys in an object from snake_case to camelCase.
9042
- * Does not support symbol keys.
9043
- *
9044
- * @param obj the object. It will be cloned and not modified in-place.
9041
+ /**
9042
+ * Shallowly converts all keys in an object from snake_case to camelCase.
9043
+ * Does not support symbol keys.
9044
+ *
9045
+ * @param obj the object. It will be cloned and not modified in-place.
9045
9046
  */ function $89758b55120b0cbd$export$9dc8f3a0aa3efc85(obj) {
9046
9047
  return Object.fromEntries(Object.entries(obj).map(([key, value])=>[
9047
9048
  key.split("_").map((part, index)=>index ? part[0].toUpperCase() + part.slice(1) : part).join(""),
@@ -9056,9 +9057,9 @@ function $89758b55120b0cbd$export$b481488de1caa85(obj) {
9056
9057
  }
9057
9058
 
9058
9059
 
9059
- /**
9060
- * Converts RGB to HSL
9061
- * Source of function: https://www.30secondsofcode.org/js/s/rgb-to-hsl
9060
+ /**
9061
+ * Converts RGB to HSL
9062
+ * Source of function: https://www.30secondsofcode.org/js/s/rgb-to-hsl
9062
9063
  */ function $d73746ee466f09ca$export$499ef00a6a3417f8(r, g, b) {
9063
9064
  r /= 255;
9064
9065
  g /= 255;
@@ -9084,6 +9085,17 @@ function $d73746ee466f09ca$export$e4fd3b61e79357a7(h, s, l) {
9084
9085
  255 * f(4)
9085
9086
  ];
9086
9087
  }
9088
+ function $d73746ee466f09ca$export$486b165479b9284f(h, s, b) {
9089
+ s /= 100;
9090
+ b /= 100;
9091
+ const k = (n)=>(n + h / 60) % 6;
9092
+ const f = (n)=>b * (1 - s * Math.max(0, Math.min(k(n), 4 - k(n), 1)));
9093
+ return [
9094
+ 255 * f(5),
9095
+ 255 * f(3),
9096
+ 255 * f(1)
9097
+ ];
9098
+ }
9087
9099
  function $d73746ee466f09ca$export$98c2b3491e76c1f(R8bit, G8bit, B8bit) {
9088
9100
  // from from http://www.w3.org/TR/WCAG20/#relativeluminancedef
9089
9101
  const RsRGB = R8bit / 255;