@depict-ai/utilishared 2.6.22 → 2.6.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 CHANGED
@@ -213,7 +213,7 @@ $parcel$export(module.exports, "version", () => $ce0ab19b284b64fa$export$83d89fb
213
213
  $parcel$export(module.exports, "add_to_version_info", () => $045fb30107c9eecc$export$2cefb7e61fcbae00);
214
214
  $parcel$export(module.exports, "sync_el_content_with_accessor", () => $84d13ab567309a50$export$c3f56a35e076f139);
215
215
  $parcel$export(module.exports, "use_href_accessor", () => $59b7011b96010a8e$export$e35115e6d0715f77);
216
- const $ce0ab19b284b64fa$export$83d89fbfd8236492 = "2.6.22";
216
+ const $ce0ab19b284b64fa$export$83d89fbfd8236492 = "2.6.23";
217
217
  const $9e9538f4aff6f83c$export$55fe61489d2c7417 = /*@__PURE__*/((_globalThis$document, _globalThis$document$, _globalThis$document$2, _globalThis$localStor, _globalThis$localStor2) => process.env.STRIP_DEBUG === "true" ? false : process.env.DEBUG === "true" || process.env.NODE_ENV === "development" || process.env.BUILD_TARGET !== "node" && ((globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : (_globalThis$document$ = _globalThis$document.currentScript) === null || _globalThis$document$ === void 0 ? void 0 : (_globalThis$document$2 = _globalThis$document$.dataset) === null || _globalThis$document$2 === void 0 ? void 0 : _globalThis$document$2.debug) === "true" || (globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$localStor = globalThis.localStorage) === null || _globalThis$localStor === void 0 ? void 0 : (_globalThis$localStor2 = _globalThis$localStor.getItem) === null || _globalThis$localStor2 === void 0 ? void 0 : _globalThis$localStor2.call(_globalThis$localStor, "debug")) === "true"))();
218
218
  const $7f95f77417d06249$var$browser_prefix_styling = "color: #fff;";
219
219
  let $7f95f77417d06249$var$browser_prefix = "[Depict]";
@@ -1373,16 +1373,19 @@ function $c9b040323c0805db$export$aad1b28cf2e0eea6(data, ts) {
1373
1373
  };
1374
1374
  }
1375
1375
  const $62869a3ed703f236$export$362abebb4b313340 = process.env.DEPICT_BASE_URL || "https://api.depict.ai";
1376
-
1377
- /**
1378
- * Returns a random string
1379
- * @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
1380
- */
1381
- function $a13f25507f352177$export$656831b7e9c341c3() {
1382
- return (Math.random() * 2e17).toString(36);
1383
- }
1384
- function $a13f25507f352177$export$a6db784f019668ba() {
1385
- return "x" + $a13f25507f352177$export$656831b7e9c341c3().replaceAll(".", "");
1376
+ function $974549040d011258$export$46cf5f54d4d7518() {
1377
+ try {
1378
+ var _globalThis$crypto, _globalThis$crypto2;
1379
+ if (typeof ((_globalThis$crypto = globalThis.crypto) === null || _globalThis$crypto === void 0 ? void 0 : _globalThis$crypto.randomUUID) === "function") return globalThis.crypto.randomUUID();
1380
+ const bytes = (_globalThis$crypto2 = globalThis.crypto) === null || _globalThis$crypto2 === void 0 ? void 0 : _globalThis$crypto2.getRandomValues(new Uint8Array(16));
1381
+ if (!bytes) return undefined;
1382
+ bytes[6] = bytes[6] & 0x0f | 0x40;
1383
+ bytes[8] = bytes[8] & 0x3f | 0x80;
1384
+ const hex = Array.from(bytes, byte => (byte + 0x100).toString(16).slice(1)).join("");
1385
+ return hex.replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/, "$1-$2-$3-$4-$5");
1386
+ } catch {
1387
+ return undefined;
1388
+ }
1386
1389
  }
1387
1390
 
1388
1391
  /** HTTP is the default; both also sends identical events over a canary socket. */
@@ -1518,7 +1521,7 @@ function $bccbc7bdec4799cf$export$fb18f6dbe1c6f251(payload) {
1518
1521
  for (const raw of payload) {
1519
1522
  const event = {
1520
1523
  ...raw,
1521
- deduplication_id: raw.deduplication_id || $a13f25507f352177$export$656831b7e9c341c3()
1524
+ deduplication_id: raw.deduplication_id || $974549040d011258$export$46cf5f54d4d7518()
1522
1525
  };
1523
1526
  const native = $bccbc7bdec4799cf$var$event_api === "v4" ? $c9b040323c0805db$export$537c002f32ae6f61(event, ts) : undefined;
1524
1527
  const json = JSON.stringify(native ? native.event : event);
@@ -1607,6 +1610,17 @@ const $49880c4ce4bb7db2$export$28cacbd9b4306ffc = /*@__PURE__*/$49880c4ce4bb7db2
1607
1610
  // filter_depict_payload will only return undefined if process.env.DEPICT === "false"
1608
1611
  return $49880c4ce4bb7db2$export$608478473a3304a0($49880c4ce4bb7db2$export$72036d950e1fae95(payload), use_ws);
1609
1612
  });
1613
+
1614
+ /**
1615
+ * Returns a random string
1616
+ * @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
1617
+ */
1618
+ function $a13f25507f352177$export$656831b7e9c341c3() {
1619
+ return (Math.random() * 2e17).toString(36);
1620
+ }
1621
+ function $a13f25507f352177$export$a6db784f019668ba() {
1622
+ return "x" + $a13f25507f352177$export$656831b7e9c341c3().replaceAll(".", "");
1623
+ }
1610
1624
  let $335c248bb07a3509$export$61e7e1f11e96692f = () => {
1611
1625
  if (typeof document === "undefined") return "server";
1612
1626
  let id = "";
package/ES10/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { JSX, Accessor } from "solid-js";
2
- export const version = "2.6.22";
2
+ export const version = "2.6.23";
3
3
  export const is_debug: boolean;
4
4
  /**
5
5
  * Sets the prefix of dlog, dwarn, and derror messages in the browser console. Defaults to `[Depict]`.
@@ -283,12 +283,6 @@ export function native_purchase_event(data: {
283
283
  }[];
284
284
  }, ts: string): NativeEvent | undefined;
285
285
  export const base_url: string;
286
- /**
287
- * Returns a random string
288
- * @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
289
- */
290
- export function random_string(): string;
291
- export function make_random_classname(): string;
292
286
  /** HTTP is the default; both also sends identical events over a canary socket. */
293
287
  export type EventTransport = "http" | "both";
294
288
  /** Configure before tracking starts; shared by users of this utilishared module.
@@ -323,6 +317,12 @@ export const foolproof_send_beacon: (url: string, payload: {
323
317
  [key: string]: any;
324
318
  }) => boolean | undefined;
325
319
  export const send_depict: (payload: noisy_depict_payload, use_ws?: boolean | undefined) => boolean | Promise<void | undefined> | undefined;
320
+ /**
321
+ * Returns a random string
322
+ * @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
323
+ */
324
+ export function random_string(): string;
325
+ export function make_random_classname(): string;
326
326
  export let get_session_id: () => string;
327
327
  export const set_session_id_fn: (newfn: () => string) => (() => string) | undefined;
328
328
  export type TrackingEventContextData = {
@@ -336,10 +336,10 @@ export const get_tracking_event_context_data: () => TrackingEventContextData;
336
336
  * Sends a depict tracking event with prefilled data
337
337
  */
338
338
  export const depict_prefilled: (vars: Partial<{
339
+ currency: any;
339
340
  type: any;
340
341
  detail: any;
341
342
  url: any;
342
- currency: any;
343
343
  deduplication_id: any;
344
344
  tenant: any;
345
345
  market: any;
@@ -363,10 +363,10 @@ export const depict_prefilled: (vars: Partial<{
363
363
  [key: string]: any;
364
364
  }, use_ws?: boolean | undefined) => boolean | Promise<void | undefined> | undefined;
365
365
  export const depict_click: (vars: Partial<{
366
+ currency: any;
366
367
  type: any;
367
368
  detail: any;
368
369
  url: any;
369
- currency: any;
370
370
  deduplication_id: any;
371
371
  tenant: any;
372
372
  market: any;
@@ -390,10 +390,10 @@ export const depict_click: (vars: Partial<{
390
390
  [key: string]: any;
391
391
  }) => boolean | Promise<void | undefined> | undefined;
392
392
  export const depict_add_to_cart: (vars: Partial<{
393
+ currency: any;
393
394
  type: any;
394
395
  detail: any;
395
396
  url: any;
396
- currency: any;
397
397
  deduplication_id: any;
398
398
  tenant: any;
399
399
  market: any;
@@ -511,7 +511,7 @@ export const check_displays: (args_0: {
511
511
  } | Promise<Display[] | {
512
512
  displays: Display[];
513
513
  }>;
514
- min_recs?: number | undefined;
514
+ min_recs?: number;
515
515
  market: string;
516
516
  type: string;
517
517
  product_id: string | string[] | Promise<string> | Promise<string[]> | ((arg0?: string) => string | string[] | Promise<string> | Promise<string[]>) | undefined;
@@ -1314,10 +1314,11 @@ export function navigate_with_next_router(e: MouseEvent, url: string): false | u
1314
1314
  */
1315
1315
  export function fetch_replacer(fetch_proxy_handler: (target: typeof window.fetch, this_arg: typeof window, arguments_list: Parameters<typeof window.fetch>) => Promise<Response | FakeResponse>, unsafe_throw_up?: boolean): Promise<void>;
1316
1316
  declare const FakeResponse_base: {
1317
- new (body?: BodyInit | null | undefined, init?: ResponseInit | undefined): Response;
1317
+ new (body?: BodyInit | null, init?: ResponseInit): Response;
1318
1318
  prototype: Response;
1319
1319
  error(): Response;
1320
- redirect(url: string | URL, status?: number | undefined): Response;
1320
+ json(data: any, init?: ResponseInit): Response;
1321
+ redirect(url: string | URL, status?: number): Response;
1321
1322
  };
1322
1323
  /**
1323
1324
  * This class extends and models the `Response` class as close as possible. Basically the only thing not being identical would be `instance_of_fake_response.constructor` and some other stuff, but nothing connected to how you're usually using a `Response` object.
@@ -1482,7 +1483,7 @@ export function iterable_to_elems(async_iterable: AsyncIterable<ReactiveTemplate
1482
1483
  * @param ...args Any arguments that will also be passed on to the wrapped function. If the wrapped function takes an ElementObserverEvent the disconnector on it will also be called if a context should be "stopped";
1483
1484
  * @return A wrapped function that now executes in a context
1484
1485
  */
1485
- export const prevent_infinite_loop: <A extends any[], B>(cb: (...args: A) => void | B) => (...args: A) => void | B;
1486
+ export const prevent_infinite_loop: <A extends any[], B>(cb: (...args: A) => B | void) => (...args: A) => void | B;
1486
1487
  /**
1487
1488
  * Inserts one or multiple surfaces into the DOM.
1488
1489
  * Will also revert (if verb is `replaceWith`) or remove the inserted elements again if placeholder rendering fails. This happens by a promise inside of the `Surface`s
@@ -1527,7 +1528,7 @@ export function replace_promise_with_native_if_exists_and_enforce(): void;
1527
1528
  * Creates a blank iframe inside <head> and returns window.Promise out of it
1528
1529
  * @return a pristine, unpolyfilled window.Promise
1529
1530
  */
1530
- export function get_iframe_promise(): PromiseConstructor;
1531
+ export function get_iframe_promise(): typeof window.Promise;
1531
1532
  /**
1532
1533
  * Proxies XMLHttpRequest.prototype.open to an open function which also calls the provided `fetch_handler` with useful information as parameter
1533
1534
  * @param fetch_handler A function which is catchified and which's return value is ignored. It gets called every time an XHR request gets opened
@@ -1717,7 +1718,7 @@ export const useExpandingContainer: ({
1717
1718
  ExpandingContainer: ({
1718
1719
  children
1719
1720
  }: {
1720
- children?: Elem | Elem[] | undefined;
1721
+ children?: Elem | Elem[];
1721
1722
  }) => HTMLElement;
1722
1723
  expand: (expanding_delay?: any, time_to_expand?: any) => Promise<Animation | undefined>;
1723
1724
  collapse: (collapsing_delay?: any, time_to_collapse?: any) => Promise<Animation | undefined>;
package/ES10/index.js CHANGED
@@ -8,7 +8,7 @@ register_es_version("utilishared", "ES10");
8
8
  function $parcel$interopDefault(a) {
9
9
  return a && a.__esModule ? a.default : a;
10
10
  }
11
- const $b9e07ce3c67aa344$export$83d89fbfd8236492 = "2.6.22";
11
+ const $b9e07ce3c67aa344$export$83d89fbfd8236492 = "2.6.23";
12
12
  const $a5a2bdb4ae93374b$export$55fe61489d2c7417 = /*@__PURE__*/((_globalThis$document, _globalThis$document$, _globalThis$document$2, _globalThis$localStor, _globalThis$localStor2) => process.env.STRIP_DEBUG === "true" ? false : process.env.DEBUG === "true" || process.env.NODE_ENV === "development" || process.env.BUILD_TARGET !== "node" && ((globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : (_globalThis$document$ = _globalThis$document.currentScript) === null || _globalThis$document$ === void 0 ? void 0 : (_globalThis$document$2 = _globalThis$document$.dataset) === null || _globalThis$document$2 === void 0 ? void 0 : _globalThis$document$2.debug) === "true" || (globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$localStor = globalThis.localStorage) === null || _globalThis$localStor === void 0 ? void 0 : (_globalThis$localStor2 = _globalThis$localStor.getItem) === null || _globalThis$localStor2 === void 0 ? void 0 : _globalThis$localStor2.call(_globalThis$localStor, "debug")) === "true"))();
13
13
  const $241f2f02cc612a49$var$browser_prefix_styling = "color: #fff;";
14
14
  let $241f2f02cc612a49$var$browser_prefix = "[Depict]";
@@ -1168,16 +1168,19 @@ function $7df31a72ef93d2cc$export$aad1b28cf2e0eea6(data, ts) {
1168
1168
  };
1169
1169
  }
1170
1170
  const $9e4bee2e3b4b5753$export$362abebb4b313340 = process.env.DEPICT_BASE_URL || "https://api.depict.ai";
1171
-
1172
- /**
1173
- * Returns a random string
1174
- * @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
1175
- */
1176
- function $6cb4d83127e468ea$export$656831b7e9c341c3() {
1177
- return (Math.random() * 2e17).toString(36);
1178
- }
1179
- function $6cb4d83127e468ea$export$a6db784f019668ba() {
1180
- return "x" + $6cb4d83127e468ea$export$656831b7e9c341c3().replaceAll(".", "");
1171
+ function $441af18fc90b6bd6$export$46cf5f54d4d7518() {
1172
+ try {
1173
+ var _globalThis$crypto, _globalThis$crypto2;
1174
+ if (typeof ((_globalThis$crypto = globalThis.crypto) === null || _globalThis$crypto === void 0 ? void 0 : _globalThis$crypto.randomUUID) === "function") return globalThis.crypto.randomUUID();
1175
+ const bytes = (_globalThis$crypto2 = globalThis.crypto) === null || _globalThis$crypto2 === void 0 ? void 0 : _globalThis$crypto2.getRandomValues(new Uint8Array(16));
1176
+ if (!bytes) return undefined;
1177
+ bytes[6] = bytes[6] & 0x0f | 0x40;
1178
+ bytes[8] = bytes[8] & 0x3f | 0x80;
1179
+ const hex = Array.from(bytes, byte => (byte + 0x100).toString(16).slice(1)).join("");
1180
+ return hex.replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/, "$1-$2-$3-$4-$5");
1181
+ } catch {
1182
+ return undefined;
1183
+ }
1181
1184
  }
1182
1185
 
1183
1186
  /** HTTP is the default; both also sends identical events over a canary socket. */
@@ -1313,7 +1316,7 @@ function $455443b05f201064$export$fb18f6dbe1c6f251(payload) {
1313
1316
  for (const raw of payload) {
1314
1317
  const event = {
1315
1318
  ...raw,
1316
- deduplication_id: raw.deduplication_id || $6cb4d83127e468ea$export$656831b7e9c341c3()
1319
+ deduplication_id: raw.deduplication_id || $441af18fc90b6bd6$export$46cf5f54d4d7518()
1317
1320
  };
1318
1321
  const native = $455443b05f201064$var$event_api === "v4" ? $7df31a72ef93d2cc$export$537c002f32ae6f61(event, ts) : undefined;
1319
1322
  const json = JSON.stringify(native ? native.event : event);
@@ -1402,6 +1405,17 @@ const $814c3bf8e175fa59$export$28cacbd9b4306ffc = /*@__PURE__*/$814c3bf8e175fa59
1402
1405
  // filter_depict_payload will only return undefined if process.env.DEPICT === "false"
1403
1406
  return $814c3bf8e175fa59$export$608478473a3304a0($814c3bf8e175fa59$export$72036d950e1fae95(payload), use_ws);
1404
1407
  });
1408
+
1409
+ /**
1410
+ * Returns a random string
1411
+ * @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
1412
+ */
1413
+ function $6cb4d83127e468ea$export$656831b7e9c341c3() {
1414
+ return (Math.random() * 2e17).toString(36);
1415
+ }
1416
+ function $6cb4d83127e468ea$export$a6db784f019668ba() {
1417
+ return "x" + $6cb4d83127e468ea$export$656831b7e9c341c3().replaceAll(".", "");
1418
+ }
1405
1419
  let $d5f7352b58e0d737$export$61e7e1f11e96692f = () => {
1406
1420
  if (typeof document === "undefined") return "server";
1407
1421
  let id = "";
package/latest/index.cjs CHANGED
@@ -210,7 +210,7 @@ $parcel$export(module.exports, "version", () => $815f67c61b4c0a42$export$83d89fb
210
210
  $parcel$export(module.exports, "add_to_version_info", () => $e4a18bf12ad092d9$export$2cefb7e61fcbae00);
211
211
  $parcel$export(module.exports, "sync_el_content_with_accessor", () => $35303d72263038db$export$c3f56a35e076f139);
212
212
  $parcel$export(module.exports, "use_href_accessor", () => $da35c7e27be2a442$export$e35115e6d0715f77);
213
- const $815f67c61b4c0a42$export$83d89fbfd8236492 = "2.6.22";
213
+ const $815f67c61b4c0a42$export$83d89fbfd8236492 = "2.6.23";
214
214
  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"))();
215
215
  const $e6c6e7929ea385ae$var$browser_prefix_styling = "color: #fff;";
216
216
  let $e6c6e7929ea385ae$var$browser_prefix = "[Depict]";
@@ -1218,16 +1218,18 @@ function $cf5d1b4537e0340b$export$aad1b28cf2e0eea6(data, ts) {
1218
1218
  };
1219
1219
  }
1220
1220
  const $4c6861fbcd3a0611$export$362abebb4b313340 = process.env.DEPICT_BASE_URL || "https://api.depict.ai";
1221
-
1222
- /**
1223
- * Returns a random string
1224
- * @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
1225
- */
1226
- function $650b64c1b384c895$export$656831b7e9c341c3() {
1227
- return (Math.random() * 2e17).toString(36);
1228
- }
1229
- function $650b64c1b384c895$export$a6db784f019668ba() {
1230
- return "x" + $650b64c1b384c895$export$656831b7e9c341c3().replaceAll(".", "");
1221
+ function $8506906daf2f2149$export$46cf5f54d4d7518() {
1222
+ try {
1223
+ if (typeof globalThis.crypto?.randomUUID === "function") return globalThis.crypto.randomUUID();
1224
+ const bytes = globalThis.crypto?.getRandomValues(new Uint8Array(16));
1225
+ if (!bytes) return undefined;
1226
+ bytes[6] = bytes[6] & 0x0f | 0x40;
1227
+ bytes[8] = bytes[8] & 0x3f | 0x80;
1228
+ const hex = Array.from(bytes, byte => (byte + 0x100).toString(16).slice(1)).join("");
1229
+ return hex.replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/, "$1-$2-$3-$4-$5");
1230
+ } catch {
1231
+ return undefined;
1232
+ }
1231
1233
  }
1232
1234
 
1233
1235
  /** HTTP is the default; both also sends identical events over a canary socket. */
@@ -1361,7 +1363,7 @@ function $92e75e76b1a9e331$export$fb18f6dbe1c6f251(payload) {
1361
1363
  for (const raw of payload) {
1362
1364
  const event = {
1363
1365
  ...raw,
1364
- deduplication_id: raw.deduplication_id || $650b64c1b384c895$export$656831b7e9c341c3()
1366
+ deduplication_id: raw.deduplication_id || $8506906daf2f2149$export$46cf5f54d4d7518()
1365
1367
  };
1366
1368
  const native = $92e75e76b1a9e331$var$event_api === "v4" ? $cf5d1b4537e0340b$export$537c002f32ae6f61(event, ts) : undefined;
1367
1369
  const json = JSON.stringify(native ? native.event : event);
@@ -1444,6 +1446,17 @@ const $0c84f8e99aac5765$export$28cacbd9b4306ffc = /*@__PURE__*/$0c84f8e99aac5765
1444
1446
  // filter_depict_payload will only return undefined if process.env.DEPICT === "false"
1445
1447
  return $0c84f8e99aac5765$export$608478473a3304a0($0c84f8e99aac5765$export$72036d950e1fae95(payload), use_ws);
1446
1448
  });
1449
+
1450
+ /**
1451
+ * Returns a random string
1452
+ * @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
1453
+ */
1454
+ function $650b64c1b384c895$export$656831b7e9c341c3() {
1455
+ return (Math.random() * 2e17).toString(36);
1456
+ }
1457
+ function $650b64c1b384c895$export$a6db784f019668ba() {
1458
+ return "x" + $650b64c1b384c895$export$656831b7e9c341c3().replaceAll(".", "");
1459
+ }
1447
1460
  let $e0a87646d12cb987$export$61e7e1f11e96692f = () => {
1448
1461
  if (typeof document === "undefined") return "server";
1449
1462
  let id = "";
package/latest/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { JSX, Accessor } from "solid-js";
2
- export const version = "2.6.22";
2
+ export const version = "2.6.23";
3
3
  export const is_debug: boolean;
4
4
  /**
5
5
  * Sets the prefix of dlog, dwarn, and derror messages in the browser console. Defaults to `[Depict]`.
@@ -283,12 +283,6 @@ export function native_purchase_event(data: {
283
283
  }[];
284
284
  }, ts: string): NativeEvent | undefined;
285
285
  export const base_url: string;
286
- /**
287
- * Returns a random string
288
- * @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
289
- */
290
- export function random_string(): string;
291
- export function make_random_classname(): string;
292
286
  /** HTTP is the default; both also sends identical events over a canary socket. */
293
287
  export type EventTransport = "http" | "both";
294
288
  /** Configure before tracking starts; shared by users of this utilishared module.
@@ -323,6 +317,12 @@ export const foolproof_send_beacon: (url: string, payload: {
323
317
  [key: string]: any;
324
318
  }) => boolean | undefined;
325
319
  export const send_depict: (payload: noisy_depict_payload, use_ws?: boolean | undefined) => boolean | Promise<void | undefined> | undefined;
320
+ /**
321
+ * Returns a random string
322
+ * @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
323
+ */
324
+ export function random_string(): string;
325
+ export function make_random_classname(): string;
326
326
  export let get_session_id: () => string;
327
327
  export const set_session_id_fn: (newfn: () => string) => (() => string) | undefined;
328
328
  export type TrackingEventContextData = {
@@ -336,10 +336,10 @@ export const get_tracking_event_context_data: () => TrackingEventContextData;
336
336
  * Sends a depict tracking event with prefilled data
337
337
  */
338
338
  export const depict_prefilled: (vars: Partial<{
339
+ currency: any;
339
340
  type: any;
340
341
  detail: any;
341
342
  url: any;
342
- currency: any;
343
343
  deduplication_id: any;
344
344
  tenant: any;
345
345
  market: any;
@@ -363,10 +363,10 @@ export const depict_prefilled: (vars: Partial<{
363
363
  [key: string]: any;
364
364
  }, use_ws?: boolean | undefined) => boolean | Promise<void | undefined> | undefined;
365
365
  export const depict_click: (vars: Partial<{
366
+ currency: any;
366
367
  type: any;
367
368
  detail: any;
368
369
  url: any;
369
- currency: any;
370
370
  deduplication_id: any;
371
371
  tenant: any;
372
372
  market: any;
@@ -390,10 +390,10 @@ export const depict_click: (vars: Partial<{
390
390
  [key: string]: any;
391
391
  }) => boolean | Promise<void | undefined> | undefined;
392
392
  export const depict_add_to_cart: (vars: Partial<{
393
+ currency: any;
393
394
  type: any;
394
395
  detail: any;
395
396
  url: any;
396
- currency: any;
397
397
  deduplication_id: any;
398
398
  tenant: any;
399
399
  market: any;
@@ -511,7 +511,7 @@ export const check_displays: (args_0: {
511
511
  } | Promise<Display[] | {
512
512
  displays: Display[];
513
513
  }>;
514
- min_recs?: number | undefined;
514
+ min_recs?: number;
515
515
  market: string;
516
516
  type: string;
517
517
  product_id: string | string[] | Promise<string> | Promise<string[]> | ((arg0?: string) => string | string[] | Promise<string> | Promise<string[]>) | undefined;
@@ -1314,10 +1314,11 @@ export function navigate_with_next_router(e: MouseEvent, url: string): false | u
1314
1314
  */
1315
1315
  export function fetch_replacer(fetch_proxy_handler: (target: typeof window.fetch, this_arg: typeof window, arguments_list: Parameters<typeof window.fetch>) => Promise<Response | FakeResponse>, unsafe_throw_up?: boolean): Promise<void>;
1316
1316
  declare const FakeResponse_base: {
1317
- new (body?: BodyInit | null | undefined, init?: ResponseInit | undefined): Response;
1317
+ new (body?: BodyInit | null, init?: ResponseInit): Response;
1318
1318
  prototype: Response;
1319
1319
  error(): Response;
1320
- redirect(url: string | URL, status?: number | undefined): Response;
1320
+ json(data: any, init?: ResponseInit): Response;
1321
+ redirect(url: string | URL, status?: number): Response;
1321
1322
  };
1322
1323
  /**
1323
1324
  * This class extends and models the `Response` class as close as possible. Basically the only thing not being identical would be `instance_of_fake_response.constructor` and some other stuff, but nothing connected to how you're usually using a `Response` object.
@@ -1482,7 +1483,7 @@ export function iterable_to_elems(async_iterable: AsyncIterable<ReactiveTemplate
1482
1483
  * @param ...args Any arguments that will also be passed on to the wrapped function. If the wrapped function takes an ElementObserverEvent the disconnector on it will also be called if a context should be "stopped";
1483
1484
  * @return A wrapped function that now executes in a context
1484
1485
  */
1485
- export const prevent_infinite_loop: <A extends any[], B>(cb: (...args: A) => void | B) => (...args: A) => void | B;
1486
+ export const prevent_infinite_loop: <A extends any[], B>(cb: (...args: A) => B | void) => (...args: A) => void | B;
1486
1487
  /**
1487
1488
  * Inserts one or multiple surfaces into the DOM.
1488
1489
  * Will also revert (if verb is `replaceWith`) or remove the inserted elements again if placeholder rendering fails. This happens by a promise inside of the `Surface`s
@@ -1527,7 +1528,7 @@ export function replace_promise_with_native_if_exists_and_enforce(): void;
1527
1528
  * Creates a blank iframe inside <head> and returns window.Promise out of it
1528
1529
  * @return a pristine, unpolyfilled window.Promise
1529
1530
  */
1530
- export function get_iframe_promise(): PromiseConstructor;
1531
+ export function get_iframe_promise(): typeof window.Promise;
1531
1532
  /**
1532
1533
  * Proxies XMLHttpRequest.prototype.open to an open function which also calls the provided `fetch_handler` with useful information as parameter
1533
1534
  * @param fetch_handler A function which is catchified and which's return value is ignored. It gets called every time an XHR request gets opened
@@ -1717,7 +1718,7 @@ export const useExpandingContainer: ({
1717
1718
  ExpandingContainer: ({
1718
1719
  children
1719
1720
  }: {
1720
- children?: Elem | Elem[] | undefined;
1721
+ children?: Elem | Elem[];
1721
1722
  }) => HTMLElement;
1722
1723
  expand: (expanding_delay?: any, time_to_expand?: any) => Promise<Animation | undefined>;
1723
1724
  collapse: (collapsing_delay?: any, time_to_collapse?: any) => Promise<Animation | undefined>;
package/latest/index.js CHANGED
@@ -5,7 +5,7 @@ register_es_version("utilishared", "latest");
5
5
  function $parcel$interopDefault(a) {
6
6
  return a && a.__esModule ? a.default : a;
7
7
  }
8
- const $0766c85d387a9765$export$83d89fbfd8236492 = "2.6.22";
8
+ const $0766c85d387a9765$export$83d89fbfd8236492 = "2.6.23";
9
9
  const $571bce04eb920cd8$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"))();
10
10
  const $649f456f663da9fc$var$browser_prefix_styling = "color: #fff;";
11
11
  let $649f456f663da9fc$var$browser_prefix = "[Depict]";
@@ -1013,16 +1013,18 @@ function $aabf0c40aeab1f44$export$aad1b28cf2e0eea6(data, ts) {
1013
1013
  };
1014
1014
  }
1015
1015
  const $6c2b49f3f564b0d1$export$362abebb4b313340 = process.env.DEPICT_BASE_URL || "https://api.depict.ai";
1016
-
1017
- /**
1018
- * Returns a random string
1019
- * @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
1020
- */
1021
- function $460df8550f9d084d$export$656831b7e9c341c3() {
1022
- return (Math.random() * 2e17).toString(36);
1023
- }
1024
- function $460df8550f9d084d$export$a6db784f019668ba() {
1025
- return "x" + $460df8550f9d084d$export$656831b7e9c341c3().replaceAll(".", "");
1016
+ function $ddd2c65e5faa6ef3$export$46cf5f54d4d7518() {
1017
+ try {
1018
+ if (typeof globalThis.crypto?.randomUUID === "function") return globalThis.crypto.randomUUID();
1019
+ const bytes = globalThis.crypto?.getRandomValues(new Uint8Array(16));
1020
+ if (!bytes) return undefined;
1021
+ bytes[6] = bytes[6] & 0x0f | 0x40;
1022
+ bytes[8] = bytes[8] & 0x3f | 0x80;
1023
+ const hex = Array.from(bytes, byte => (byte + 0x100).toString(16).slice(1)).join("");
1024
+ return hex.replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/, "$1-$2-$3-$4-$5");
1025
+ } catch {
1026
+ return undefined;
1027
+ }
1026
1028
  }
1027
1029
 
1028
1030
  /** HTTP is the default; both also sends identical events over a canary socket. */
@@ -1156,7 +1158,7 @@ function $e96fc3fc5232e2e4$export$fb18f6dbe1c6f251(payload) {
1156
1158
  for (const raw of payload) {
1157
1159
  const event = {
1158
1160
  ...raw,
1159
- deduplication_id: raw.deduplication_id || $460df8550f9d084d$export$656831b7e9c341c3()
1161
+ deduplication_id: raw.deduplication_id || $ddd2c65e5faa6ef3$export$46cf5f54d4d7518()
1160
1162
  };
1161
1163
  const native = $e96fc3fc5232e2e4$var$event_api === "v4" ? $aabf0c40aeab1f44$export$537c002f32ae6f61(event, ts) : undefined;
1162
1164
  const json = JSON.stringify(native ? native.event : event);
@@ -1239,6 +1241,17 @@ const $cafa1ff1049985c2$export$28cacbd9b4306ffc = /*@__PURE__*/$cafa1ff1049985c2
1239
1241
  // filter_depict_payload will only return undefined if process.env.DEPICT === "false"
1240
1242
  return $cafa1ff1049985c2$export$608478473a3304a0($cafa1ff1049985c2$export$72036d950e1fae95(payload), use_ws);
1241
1243
  });
1244
+
1245
+ /**
1246
+ * Returns a random string
1247
+ * @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
1248
+ */
1249
+ function $460df8550f9d084d$export$656831b7e9c341c3() {
1250
+ return (Math.random() * 2e17).toString(36);
1251
+ }
1252
+ function $460df8550f9d084d$export$a6db784f019668ba() {
1253
+ return "x" + $460df8550f9d084d$export$656831b7e9c341c3().replaceAll(".", "");
1254
+ }
1242
1255
  let $43683b1103edab15$export$61e7e1f11e96692f = () => {
1243
1256
  if (typeof document === "undefined") return "server";
1244
1257
  let id = "";
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "git+https://github.com/depict-org/depict-ui.git",
6
6
  "directory": "browser-tags-v2/packages/utilishared"
7
7
  },
8
- "version": "2.6.22",
8
+ "version": "2.6.23",
9
9
  "packageManager": "yarn@3.2.2",
10
10
  "source": "src/index.ts",
11
11
  "types": "ES10/index.d.ts",
@@ -144,7 +144,7 @@
144
144
  ],
145
145
  "devDependencies": {
146
146
  "@babel/core": "latest",
147
- "@depict-ai/types": "^5.6.22",
147
+ "@depict-ai/types": "^5.6.23",
148
148
  "@parcel/resolver-default": "^2.10.3",
149
149
  "@sentry/cli": "^2.21.2",
150
150
  "@sentry/types": "^7.75.1",
@@ -213,7 +213,7 @@ $parcel$export(module.exports, "version", () => $ce0ab19b284b64fa$export$83d89fb
213
213
  $parcel$export(module.exports, "add_to_version_info", () => $045fb30107c9eecc$export$2cefb7e61fcbae00);
214
214
  $parcel$export(module.exports, "sync_el_content_with_accessor", () => $84d13ab567309a50$export$c3f56a35e076f139);
215
215
  $parcel$export(module.exports, "use_href_accessor", () => $59b7011b96010a8e$export$e35115e6d0715f77);
216
- const $ce0ab19b284b64fa$export$83d89fbfd8236492 = "2.6.22";
216
+ const $ce0ab19b284b64fa$export$83d89fbfd8236492 = "2.6.23";
217
217
  const $9e9538f4aff6f83c$export$55fe61489d2c7417 = /*@__PURE__*/((_globalThis$document, _globalThis$document$, _globalThis$document$2, _globalThis$localStor, _globalThis$localStor2) => process.env.STRIP_DEBUG === "true" ? false : process.env.DEBUG === "true" || process.env.NODE_ENV === "development" || process.env.BUILD_TARGET !== "node" && ((globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : (_globalThis$document$ = _globalThis$document.currentScript) === null || _globalThis$document$ === void 0 ? void 0 : (_globalThis$document$2 = _globalThis$document$.dataset) === null || _globalThis$document$2 === void 0 ? void 0 : _globalThis$document$2.debug) === "true" || (globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$localStor = globalThis.localStorage) === null || _globalThis$localStor === void 0 ? void 0 : (_globalThis$localStor2 = _globalThis$localStor.getItem) === null || _globalThis$localStor2 === void 0 ? void 0 : _globalThis$localStor2.call(_globalThis$localStor, "debug")) === "true"))();
218
218
  const $7f95f77417d06249$var$browser_prefix_styling = "color: #fff;";
219
219
  let $7f95f77417d06249$var$browser_prefix = "[Depict]";
@@ -1373,16 +1373,19 @@ function $c9b040323c0805db$export$aad1b28cf2e0eea6(data, ts) {
1373
1373
  };
1374
1374
  }
1375
1375
  const $62869a3ed703f236$export$362abebb4b313340 = process.env.DEPICT_BASE_URL || "https://api.depict.ai";
1376
-
1377
- /**
1378
- * Returns a random string
1379
- * @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
1380
- */
1381
- function $a13f25507f352177$export$656831b7e9c341c3() {
1382
- return (Math.random() * 2e17).toString(36);
1383
- }
1384
- function $a13f25507f352177$export$a6db784f019668ba() {
1385
- return "x" + $a13f25507f352177$export$656831b7e9c341c3().replaceAll(".", "");
1376
+ function $974549040d011258$export$46cf5f54d4d7518() {
1377
+ try {
1378
+ var _globalThis$crypto, _globalThis$crypto2;
1379
+ if (typeof ((_globalThis$crypto = globalThis.crypto) === null || _globalThis$crypto === void 0 ? void 0 : _globalThis$crypto.randomUUID) === "function") return globalThis.crypto.randomUUID();
1380
+ const bytes = (_globalThis$crypto2 = globalThis.crypto) === null || _globalThis$crypto2 === void 0 ? void 0 : _globalThis$crypto2.getRandomValues(new Uint8Array(16));
1381
+ if (!bytes) return undefined;
1382
+ bytes[6] = bytes[6] & 0x0f | 0x40;
1383
+ bytes[8] = bytes[8] & 0x3f | 0x80;
1384
+ const hex = Array.from(bytes, byte => (byte + 0x100).toString(16).slice(1)).join("");
1385
+ return hex.replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/, "$1-$2-$3-$4-$5");
1386
+ } catch {
1387
+ return undefined;
1388
+ }
1386
1389
  }
1387
1390
 
1388
1391
  /** HTTP is the default; both also sends identical events over a canary socket. */
@@ -1518,7 +1521,7 @@ function $bccbc7bdec4799cf$export$fb18f6dbe1c6f251(payload) {
1518
1521
  for (const raw of payload) {
1519
1522
  const event = {
1520
1523
  ...raw,
1521
- deduplication_id: raw.deduplication_id || $a13f25507f352177$export$656831b7e9c341c3()
1524
+ deduplication_id: raw.deduplication_id || $974549040d011258$export$46cf5f54d4d7518()
1522
1525
  };
1523
1526
  const native = $bccbc7bdec4799cf$var$event_api === "v4" ? $c9b040323c0805db$export$537c002f32ae6f61(event, ts) : undefined;
1524
1527
  const json = JSON.stringify(native ? native.event : event);
@@ -1607,6 +1610,17 @@ const $49880c4ce4bb7db2$export$28cacbd9b4306ffc = /*@__PURE__*/$49880c4ce4bb7db2
1607
1610
  // filter_depict_payload will only return undefined if process.env.DEPICT === "false"
1608
1611
  return $49880c4ce4bb7db2$export$608478473a3304a0($49880c4ce4bb7db2$export$72036d950e1fae95(payload), use_ws);
1609
1612
  });
1613
+
1614
+ /**
1615
+ * Returns a random string
1616
+ * @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
1617
+ */
1618
+ function $a13f25507f352177$export$656831b7e9c341c3() {
1619
+ return (Math.random() * 2e17).toString(36);
1620
+ }
1621
+ function $a13f25507f352177$export$a6db784f019668ba() {
1622
+ return "x" + $a13f25507f352177$export$656831b7e9c341c3().replaceAll(".", "");
1623
+ }
1610
1624
  let $335c248bb07a3509$export$61e7e1f11e96692f = () => {
1611
1625
  if (typeof document === "undefined") return "server";
1612
1626
  let id = "";
@@ -1,5 +1,5 @@
1
1
  import { JSX, Accessor } from "solid-js";
2
- export const version = "2.6.22";
2
+ export const version = "2.6.23";
3
3
  export const is_debug: boolean;
4
4
  /**
5
5
  * Sets the prefix of dlog, dwarn, and derror messages in the browser console. Defaults to `[Depict]`.
@@ -283,12 +283,6 @@ export function native_purchase_event(data: {
283
283
  }[];
284
284
  }, ts: string): NativeEvent | undefined;
285
285
  export const base_url: string;
286
- /**
287
- * Returns a random string
288
- * @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
289
- */
290
- export function random_string(): string;
291
- export function make_random_classname(): string;
292
286
  /** HTTP is the default; both also sends identical events over a canary socket. */
293
287
  export type EventTransport = "http" | "both";
294
288
  /** Configure before tracking starts; shared by users of this utilishared module.
@@ -323,6 +317,12 @@ export const foolproof_send_beacon: (url: string, payload: {
323
317
  [key: string]: any;
324
318
  }) => boolean | undefined;
325
319
  export const send_depict: (payload: noisy_depict_payload, use_ws?: boolean | undefined) => boolean | Promise<void | undefined> | undefined;
320
+ /**
321
+ * Returns a random string
322
+ * @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
323
+ */
324
+ export function random_string(): string;
325
+ export function make_random_classname(): string;
326
326
  export let get_session_id: () => string;
327
327
  export const set_session_id_fn: (newfn: () => string) => (() => string) | undefined;
328
328
  export type TrackingEventContextData = {
@@ -336,10 +336,10 @@ export const get_tracking_event_context_data: () => TrackingEventContextData;
336
336
  * Sends a depict tracking event with prefilled data
337
337
  */
338
338
  export const depict_prefilled: (vars: Partial<{
339
+ currency: any;
339
340
  type: any;
340
341
  detail: any;
341
342
  url: any;
342
- currency: any;
343
343
  deduplication_id: any;
344
344
  tenant: any;
345
345
  market: any;
@@ -363,10 +363,10 @@ export const depict_prefilled: (vars: Partial<{
363
363
  [key: string]: any;
364
364
  }, use_ws?: boolean | undefined) => boolean | Promise<void | undefined> | undefined;
365
365
  export const depict_click: (vars: Partial<{
366
+ currency: any;
366
367
  type: any;
367
368
  detail: any;
368
369
  url: any;
369
- currency: any;
370
370
  deduplication_id: any;
371
371
  tenant: any;
372
372
  market: any;
@@ -390,10 +390,10 @@ export const depict_click: (vars: Partial<{
390
390
  [key: string]: any;
391
391
  }) => boolean | Promise<void | undefined> | undefined;
392
392
  export const depict_add_to_cart: (vars: Partial<{
393
+ currency: any;
393
394
  type: any;
394
395
  detail: any;
395
396
  url: any;
396
- currency: any;
397
397
  deduplication_id: any;
398
398
  tenant: any;
399
399
  market: any;
@@ -511,7 +511,7 @@ export const check_displays: (args_0: {
511
511
  } | Promise<Display[] | {
512
512
  displays: Display[];
513
513
  }>;
514
- min_recs?: number | undefined;
514
+ min_recs?: number;
515
515
  market: string;
516
516
  type: string;
517
517
  product_id: string | string[] | Promise<string> | Promise<string[]> | ((arg0?: string) => string | string[] | Promise<string> | Promise<string[]>) | undefined;
@@ -1314,10 +1314,11 @@ export function navigate_with_next_router(e: MouseEvent, url: string): false | u
1314
1314
  */
1315
1315
  export function fetch_replacer(fetch_proxy_handler: (target: typeof window.fetch, this_arg: typeof window, arguments_list: Parameters<typeof window.fetch>) => Promise<Response | FakeResponse>, unsafe_throw_up?: boolean): Promise<void>;
1316
1316
  declare const FakeResponse_base: {
1317
- new (body?: BodyInit | null | undefined, init?: ResponseInit | undefined): Response;
1317
+ new (body?: BodyInit | null, init?: ResponseInit): Response;
1318
1318
  prototype: Response;
1319
1319
  error(): Response;
1320
- redirect(url: string | URL, status?: number | undefined): Response;
1320
+ json(data: any, init?: ResponseInit): Response;
1321
+ redirect(url: string | URL, status?: number): Response;
1321
1322
  };
1322
1323
  /**
1323
1324
  * This class extends and models the `Response` class as close as possible. Basically the only thing not being identical would be `instance_of_fake_response.constructor` and some other stuff, but nothing connected to how you're usually using a `Response` object.
@@ -1482,7 +1483,7 @@ export function iterable_to_elems(async_iterable: AsyncIterable<ReactiveTemplate
1482
1483
  * @param ...args Any arguments that will also be passed on to the wrapped function. If the wrapped function takes an ElementObserverEvent the disconnector on it will also be called if a context should be "stopped";
1483
1484
  * @return A wrapped function that now executes in a context
1484
1485
  */
1485
- export const prevent_infinite_loop: <A extends any[], B>(cb: (...args: A) => void | B) => (...args: A) => void | B;
1486
+ export const prevent_infinite_loop: <A extends any[], B>(cb: (...args: A) => B | void) => (...args: A) => void | B;
1486
1487
  /**
1487
1488
  * Inserts one or multiple surfaces into the DOM.
1488
1489
  * Will also revert (if verb is `replaceWith`) or remove the inserted elements again if placeholder rendering fails. This happens by a promise inside of the `Surface`s
@@ -1527,7 +1528,7 @@ export function replace_promise_with_native_if_exists_and_enforce(): void;
1527
1528
  * Creates a blank iframe inside <head> and returns window.Promise out of it
1528
1529
  * @return a pristine, unpolyfilled window.Promise
1529
1530
  */
1530
- export function get_iframe_promise(): PromiseConstructor;
1531
+ export function get_iframe_promise(): typeof window.Promise;
1531
1532
  /**
1532
1533
  * Proxies XMLHttpRequest.prototype.open to an open function which also calls the provided `fetch_handler` with useful information as parameter
1533
1534
  * @param fetch_handler A function which is catchified and which's return value is ignored. It gets called every time an XHR request gets opened
@@ -1717,7 +1718,7 @@ export const useExpandingContainer: ({
1717
1718
  ExpandingContainer: ({
1718
1719
  children
1719
1720
  }: {
1720
- children?: Elem | Elem[] | undefined;
1721
+ children?: Elem | Elem[];
1721
1722
  }) => HTMLElement;
1722
1723
  expand: (expanding_delay?: any, time_to_expand?: any) => Promise<Animation | undefined>;
1723
1724
  collapse: (collapsing_delay?: any, time_to_collapse?: any) => Promise<Animation | undefined>;
@@ -8,7 +8,7 @@ register_es_version("utilishared", "ES10");
8
8
  function $parcel$interopDefault(a) {
9
9
  return a && a.__esModule ? a.default : a;
10
10
  }
11
- const $b9e07ce3c67aa344$export$83d89fbfd8236492 = "2.6.22";
11
+ const $b9e07ce3c67aa344$export$83d89fbfd8236492 = "2.6.23";
12
12
  const $a5a2bdb4ae93374b$export$55fe61489d2c7417 = /*@__PURE__*/((_globalThis$document, _globalThis$document$, _globalThis$document$2, _globalThis$localStor, _globalThis$localStor2) => process.env.STRIP_DEBUG === "true" ? false : process.env.DEBUG === "true" || process.env.NODE_ENV === "development" || process.env.BUILD_TARGET !== "node" && ((globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : (_globalThis$document$ = _globalThis$document.currentScript) === null || _globalThis$document$ === void 0 ? void 0 : (_globalThis$document$2 = _globalThis$document$.dataset) === null || _globalThis$document$2 === void 0 ? void 0 : _globalThis$document$2.debug) === "true" || (globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$localStor = globalThis.localStorage) === null || _globalThis$localStor === void 0 ? void 0 : (_globalThis$localStor2 = _globalThis$localStor.getItem) === null || _globalThis$localStor2 === void 0 ? void 0 : _globalThis$localStor2.call(_globalThis$localStor, "debug")) === "true"))();
13
13
  const $241f2f02cc612a49$var$browser_prefix_styling = "color: #fff;";
14
14
  let $241f2f02cc612a49$var$browser_prefix = "[Depict]";
@@ -1168,16 +1168,19 @@ function $7df31a72ef93d2cc$export$aad1b28cf2e0eea6(data, ts) {
1168
1168
  };
1169
1169
  }
1170
1170
  const $9e4bee2e3b4b5753$export$362abebb4b313340 = process.env.DEPICT_BASE_URL || "https://api.depict.ai";
1171
-
1172
- /**
1173
- * Returns a random string
1174
- * @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
1175
- */
1176
- function $6cb4d83127e468ea$export$656831b7e9c341c3() {
1177
- return (Math.random() * 2e17).toString(36);
1178
- }
1179
- function $6cb4d83127e468ea$export$a6db784f019668ba() {
1180
- return "x" + $6cb4d83127e468ea$export$656831b7e9c341c3().replaceAll(".", "");
1171
+ function $441af18fc90b6bd6$export$46cf5f54d4d7518() {
1172
+ try {
1173
+ var _globalThis$crypto, _globalThis$crypto2;
1174
+ if (typeof ((_globalThis$crypto = globalThis.crypto) === null || _globalThis$crypto === void 0 ? void 0 : _globalThis$crypto.randomUUID) === "function") return globalThis.crypto.randomUUID();
1175
+ const bytes = (_globalThis$crypto2 = globalThis.crypto) === null || _globalThis$crypto2 === void 0 ? void 0 : _globalThis$crypto2.getRandomValues(new Uint8Array(16));
1176
+ if (!bytes) return undefined;
1177
+ bytes[6] = bytes[6] & 0x0f | 0x40;
1178
+ bytes[8] = bytes[8] & 0x3f | 0x80;
1179
+ const hex = Array.from(bytes, byte => (byte + 0x100).toString(16).slice(1)).join("");
1180
+ return hex.replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/, "$1-$2-$3-$4-$5");
1181
+ } catch {
1182
+ return undefined;
1183
+ }
1181
1184
  }
1182
1185
 
1183
1186
  /** HTTP is the default; both also sends identical events over a canary socket. */
@@ -1313,7 +1316,7 @@ function $455443b05f201064$export$fb18f6dbe1c6f251(payload) {
1313
1316
  for (const raw of payload) {
1314
1317
  const event = {
1315
1318
  ...raw,
1316
- deduplication_id: raw.deduplication_id || $6cb4d83127e468ea$export$656831b7e9c341c3()
1319
+ deduplication_id: raw.deduplication_id || $441af18fc90b6bd6$export$46cf5f54d4d7518()
1317
1320
  };
1318
1321
  const native = $455443b05f201064$var$event_api === "v4" ? $7df31a72ef93d2cc$export$537c002f32ae6f61(event, ts) : undefined;
1319
1322
  const json = JSON.stringify(native ? native.event : event);
@@ -1402,6 +1405,17 @@ const $814c3bf8e175fa59$export$28cacbd9b4306ffc = /*@__PURE__*/$814c3bf8e175fa59
1402
1405
  // filter_depict_payload will only return undefined if process.env.DEPICT === "false"
1403
1406
  return $814c3bf8e175fa59$export$608478473a3304a0($814c3bf8e175fa59$export$72036d950e1fae95(payload), use_ws);
1404
1407
  });
1408
+
1409
+ /**
1410
+ * Returns a random string
1411
+ * @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
1412
+ */
1413
+ function $6cb4d83127e468ea$export$656831b7e9c341c3() {
1414
+ return (Math.random() * 2e17).toString(36);
1415
+ }
1416
+ function $6cb4d83127e468ea$export$a6db784f019668ba() {
1417
+ return "x" + $6cb4d83127e468ea$export$656831b7e9c341c3().replaceAll(".", "");
1418
+ }
1405
1419
  let $d5f7352b58e0d737$export$61e7e1f11e96692f = () => {
1406
1420
  if (typeof document === "undefined") return "server";
1407
1421
  let id = "";
@@ -210,7 +210,7 @@ $parcel$export(module.exports, "version", () => $815f67c61b4c0a42$export$83d89fb
210
210
  $parcel$export(module.exports, "add_to_version_info", () => $e4a18bf12ad092d9$export$2cefb7e61fcbae00);
211
211
  $parcel$export(module.exports, "sync_el_content_with_accessor", () => $35303d72263038db$export$c3f56a35e076f139);
212
212
  $parcel$export(module.exports, "use_href_accessor", () => $da35c7e27be2a442$export$e35115e6d0715f77);
213
- const $815f67c61b4c0a42$export$83d89fbfd8236492 = "2.6.22";
213
+ const $815f67c61b4c0a42$export$83d89fbfd8236492 = "2.6.23";
214
214
  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"))();
215
215
  const $e6c6e7929ea385ae$var$browser_prefix_styling = "color: #fff;";
216
216
  let $e6c6e7929ea385ae$var$browser_prefix = "[Depict]";
@@ -1218,16 +1218,18 @@ function $cf5d1b4537e0340b$export$aad1b28cf2e0eea6(data, ts) {
1218
1218
  };
1219
1219
  }
1220
1220
  const $4c6861fbcd3a0611$export$362abebb4b313340 = process.env.DEPICT_BASE_URL || "https://api.depict.ai";
1221
-
1222
- /**
1223
- * Returns a random string
1224
- * @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
1225
- */
1226
- function $650b64c1b384c895$export$656831b7e9c341c3() {
1227
- return (Math.random() * 2e17).toString(36);
1228
- }
1229
- function $650b64c1b384c895$export$a6db784f019668ba() {
1230
- return "x" + $650b64c1b384c895$export$656831b7e9c341c3().replaceAll(".", "");
1221
+ function $8506906daf2f2149$export$46cf5f54d4d7518() {
1222
+ try {
1223
+ if (typeof globalThis.crypto?.randomUUID === "function") return globalThis.crypto.randomUUID();
1224
+ const bytes = globalThis.crypto?.getRandomValues(new Uint8Array(16));
1225
+ if (!bytes) return undefined;
1226
+ bytes[6] = bytes[6] & 0x0f | 0x40;
1227
+ bytes[8] = bytes[8] & 0x3f | 0x80;
1228
+ const hex = Array.from(bytes, byte => (byte + 0x100).toString(16).slice(1)).join("");
1229
+ return hex.replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/, "$1-$2-$3-$4-$5");
1230
+ } catch {
1231
+ return undefined;
1232
+ }
1231
1233
  }
1232
1234
 
1233
1235
  /** HTTP is the default; both also sends identical events over a canary socket. */
@@ -1361,7 +1363,7 @@ function $92e75e76b1a9e331$export$fb18f6dbe1c6f251(payload) {
1361
1363
  for (const raw of payload) {
1362
1364
  const event = {
1363
1365
  ...raw,
1364
- deduplication_id: raw.deduplication_id || $650b64c1b384c895$export$656831b7e9c341c3()
1366
+ deduplication_id: raw.deduplication_id || $8506906daf2f2149$export$46cf5f54d4d7518()
1365
1367
  };
1366
1368
  const native = $92e75e76b1a9e331$var$event_api === "v4" ? $cf5d1b4537e0340b$export$537c002f32ae6f61(event, ts) : undefined;
1367
1369
  const json = JSON.stringify(native ? native.event : event);
@@ -1444,6 +1446,17 @@ const $0c84f8e99aac5765$export$28cacbd9b4306ffc = /*@__PURE__*/$0c84f8e99aac5765
1444
1446
  // filter_depict_payload will only return undefined if process.env.DEPICT === "false"
1445
1447
  return $0c84f8e99aac5765$export$608478473a3304a0($0c84f8e99aac5765$export$72036d950e1fae95(payload), use_ws);
1446
1448
  });
1449
+
1450
+ /**
1451
+ * Returns a random string
1452
+ * @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
1453
+ */
1454
+ function $650b64c1b384c895$export$656831b7e9c341c3() {
1455
+ return (Math.random() * 2e17).toString(36);
1456
+ }
1457
+ function $650b64c1b384c895$export$a6db784f019668ba() {
1458
+ return "x" + $650b64c1b384c895$export$656831b7e9c341c3().replaceAll(".", "");
1459
+ }
1447
1460
  let $e0a87646d12cb987$export$61e7e1f11e96692f = () => {
1448
1461
  if (typeof document === "undefined") return "server";
1449
1462
  let id = "";
@@ -1,5 +1,5 @@
1
1
  import { JSX, Accessor } from "solid-js";
2
- export const version = "2.6.22";
2
+ export const version = "2.6.23";
3
3
  export const is_debug: boolean;
4
4
  /**
5
5
  * Sets the prefix of dlog, dwarn, and derror messages in the browser console. Defaults to `[Depict]`.
@@ -283,12 +283,6 @@ export function native_purchase_event(data: {
283
283
  }[];
284
284
  }, ts: string): NativeEvent | undefined;
285
285
  export const base_url: string;
286
- /**
287
- * Returns a random string
288
- * @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
289
- */
290
- export function random_string(): string;
291
- export function make_random_classname(): string;
292
286
  /** HTTP is the default; both also sends identical events over a canary socket. */
293
287
  export type EventTransport = "http" | "both";
294
288
  /** Configure before tracking starts; shared by users of this utilishared module.
@@ -323,6 +317,12 @@ export const foolproof_send_beacon: (url: string, payload: {
323
317
  [key: string]: any;
324
318
  }) => boolean | undefined;
325
319
  export const send_depict: (payload: noisy_depict_payload, use_ws?: boolean | undefined) => boolean | Promise<void | undefined> | undefined;
320
+ /**
321
+ * Returns a random string
322
+ * @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
323
+ */
324
+ export function random_string(): string;
325
+ export function make_random_classname(): string;
326
326
  export let get_session_id: () => string;
327
327
  export const set_session_id_fn: (newfn: () => string) => (() => string) | undefined;
328
328
  export type TrackingEventContextData = {
@@ -336,10 +336,10 @@ export const get_tracking_event_context_data: () => TrackingEventContextData;
336
336
  * Sends a depict tracking event with prefilled data
337
337
  */
338
338
  export const depict_prefilled: (vars: Partial<{
339
+ currency: any;
339
340
  type: any;
340
341
  detail: any;
341
342
  url: any;
342
- currency: any;
343
343
  deduplication_id: any;
344
344
  tenant: any;
345
345
  market: any;
@@ -363,10 +363,10 @@ export const depict_prefilled: (vars: Partial<{
363
363
  [key: string]: any;
364
364
  }, use_ws?: boolean | undefined) => boolean | Promise<void | undefined> | undefined;
365
365
  export const depict_click: (vars: Partial<{
366
+ currency: any;
366
367
  type: any;
367
368
  detail: any;
368
369
  url: any;
369
- currency: any;
370
370
  deduplication_id: any;
371
371
  tenant: any;
372
372
  market: any;
@@ -390,10 +390,10 @@ export const depict_click: (vars: Partial<{
390
390
  [key: string]: any;
391
391
  }) => boolean | Promise<void | undefined> | undefined;
392
392
  export const depict_add_to_cart: (vars: Partial<{
393
+ currency: any;
393
394
  type: any;
394
395
  detail: any;
395
396
  url: any;
396
- currency: any;
397
397
  deduplication_id: any;
398
398
  tenant: any;
399
399
  market: any;
@@ -511,7 +511,7 @@ export const check_displays: (args_0: {
511
511
  } | Promise<Display[] | {
512
512
  displays: Display[];
513
513
  }>;
514
- min_recs?: number | undefined;
514
+ min_recs?: number;
515
515
  market: string;
516
516
  type: string;
517
517
  product_id: string | string[] | Promise<string> | Promise<string[]> | ((arg0?: string) => string | string[] | Promise<string> | Promise<string[]>) | undefined;
@@ -1314,10 +1314,11 @@ export function navigate_with_next_router(e: MouseEvent, url: string): false | u
1314
1314
  */
1315
1315
  export function fetch_replacer(fetch_proxy_handler: (target: typeof window.fetch, this_arg: typeof window, arguments_list: Parameters<typeof window.fetch>) => Promise<Response | FakeResponse>, unsafe_throw_up?: boolean): Promise<void>;
1316
1316
  declare const FakeResponse_base: {
1317
- new (body?: BodyInit | null | undefined, init?: ResponseInit | undefined): Response;
1317
+ new (body?: BodyInit | null, init?: ResponseInit): Response;
1318
1318
  prototype: Response;
1319
1319
  error(): Response;
1320
- redirect(url: string | URL, status?: number | undefined): Response;
1320
+ json(data: any, init?: ResponseInit): Response;
1321
+ redirect(url: string | URL, status?: number): Response;
1321
1322
  };
1322
1323
  /**
1323
1324
  * This class extends and models the `Response` class as close as possible. Basically the only thing not being identical would be `instance_of_fake_response.constructor` and some other stuff, but nothing connected to how you're usually using a `Response` object.
@@ -1482,7 +1483,7 @@ export function iterable_to_elems(async_iterable: AsyncIterable<ReactiveTemplate
1482
1483
  * @param ...args Any arguments that will also be passed on to the wrapped function. If the wrapped function takes an ElementObserverEvent the disconnector on it will also be called if a context should be "stopped";
1483
1484
  * @return A wrapped function that now executes in a context
1484
1485
  */
1485
- export const prevent_infinite_loop: <A extends any[], B>(cb: (...args: A) => void | B) => (...args: A) => void | B;
1486
+ export const prevent_infinite_loop: <A extends any[], B>(cb: (...args: A) => B | void) => (...args: A) => void | B;
1486
1487
  /**
1487
1488
  * Inserts one or multiple surfaces into the DOM.
1488
1489
  * Will also revert (if verb is `replaceWith`) or remove the inserted elements again if placeholder rendering fails. This happens by a promise inside of the `Surface`s
@@ -1527,7 +1528,7 @@ export function replace_promise_with_native_if_exists_and_enforce(): void;
1527
1528
  * Creates a blank iframe inside <head> and returns window.Promise out of it
1528
1529
  * @return a pristine, unpolyfilled window.Promise
1529
1530
  */
1530
- export function get_iframe_promise(): PromiseConstructor;
1531
+ export function get_iframe_promise(): typeof window.Promise;
1531
1532
  /**
1532
1533
  * Proxies XMLHttpRequest.prototype.open to an open function which also calls the provided `fetch_handler` with useful information as parameter
1533
1534
  * @param fetch_handler A function which is catchified and which's return value is ignored. It gets called every time an XHR request gets opened
@@ -1717,7 +1718,7 @@ export const useExpandingContainer: ({
1717
1718
  ExpandingContainer: ({
1718
1719
  children
1719
1720
  }: {
1720
- children?: Elem | Elem[] | undefined;
1721
+ children?: Elem | Elem[];
1721
1722
  }) => HTMLElement;
1722
1723
  expand: (expanding_delay?: any, time_to_expand?: any) => Promise<Animation | undefined>;
1723
1724
  collapse: (collapsing_delay?: any, time_to_collapse?: any) => Promise<Animation | undefined>;
@@ -5,7 +5,7 @@ register_es_version("utilishared", "latest");
5
5
  function $parcel$interopDefault(a) {
6
6
  return a && a.__esModule ? a.default : a;
7
7
  }
8
- const $0766c85d387a9765$export$83d89fbfd8236492 = "2.6.22";
8
+ const $0766c85d387a9765$export$83d89fbfd8236492 = "2.6.23";
9
9
  const $571bce04eb920cd8$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"))();
10
10
  const $649f456f663da9fc$var$browser_prefix_styling = "color: #fff;";
11
11
  let $649f456f663da9fc$var$browser_prefix = "[Depict]";
@@ -1013,16 +1013,18 @@ function $aabf0c40aeab1f44$export$aad1b28cf2e0eea6(data, ts) {
1013
1013
  };
1014
1014
  }
1015
1015
  const $6c2b49f3f564b0d1$export$362abebb4b313340 = process.env.DEPICT_BASE_URL || "https://api.depict.ai";
1016
-
1017
- /**
1018
- * Returns a random string
1019
- * @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
1020
- */
1021
- function $460df8550f9d084d$export$656831b7e9c341c3() {
1022
- return (Math.random() * 2e17).toString(36);
1023
- }
1024
- function $460df8550f9d084d$export$a6db784f019668ba() {
1025
- return "x" + $460df8550f9d084d$export$656831b7e9c341c3().replaceAll(".", "");
1016
+ function $ddd2c65e5faa6ef3$export$46cf5f54d4d7518() {
1017
+ try {
1018
+ if (typeof globalThis.crypto?.randomUUID === "function") return globalThis.crypto.randomUUID();
1019
+ const bytes = globalThis.crypto?.getRandomValues(new Uint8Array(16));
1020
+ if (!bytes) return undefined;
1021
+ bytes[6] = bytes[6] & 0x0f | 0x40;
1022
+ bytes[8] = bytes[8] & 0x3f | 0x80;
1023
+ const hex = Array.from(bytes, byte => (byte + 0x100).toString(16).slice(1)).join("");
1024
+ return hex.replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/, "$1-$2-$3-$4-$5");
1025
+ } catch {
1026
+ return undefined;
1027
+ }
1026
1028
  }
1027
1029
 
1028
1030
  /** HTTP is the default; both also sends identical events over a canary socket. */
@@ -1156,7 +1158,7 @@ function $e96fc3fc5232e2e4$export$fb18f6dbe1c6f251(payload) {
1156
1158
  for (const raw of payload) {
1157
1159
  const event = {
1158
1160
  ...raw,
1159
- deduplication_id: raw.deduplication_id || $460df8550f9d084d$export$656831b7e9c341c3()
1161
+ deduplication_id: raw.deduplication_id || $ddd2c65e5faa6ef3$export$46cf5f54d4d7518()
1160
1162
  };
1161
1163
  const native = $e96fc3fc5232e2e4$var$event_api === "v4" ? $aabf0c40aeab1f44$export$537c002f32ae6f61(event, ts) : undefined;
1162
1164
  const json = JSON.stringify(native ? native.event : event);
@@ -1239,6 +1241,17 @@ const $cafa1ff1049985c2$export$28cacbd9b4306ffc = /*@__PURE__*/$cafa1ff1049985c2
1239
1241
  // filter_depict_payload will only return undefined if process.env.DEPICT === "false"
1240
1242
  return $cafa1ff1049985c2$export$608478473a3304a0($cafa1ff1049985c2$export$72036d950e1fae95(payload), use_ws);
1241
1243
  });
1244
+
1245
+ /**
1246
+ * Returns a random string
1247
+ * @return A random string, containing a-z, 0-9 and occasionally a dot (`.`)
1248
+ */
1249
+ function $460df8550f9d084d$export$656831b7e9c341c3() {
1250
+ return (Math.random() * 2e17).toString(36);
1251
+ }
1252
+ function $460df8550f9d084d$export$a6db784f019668ba() {
1253
+ return "x" + $460df8550f9d084d$export$656831b7e9c341c3().replaceAll(".", "");
1254
+ }
1242
1255
  let $43683b1103edab15$export$61e7e1f11e96692f = () => {
1243
1256
  if (typeof document === "undefined") return "server";
1244
1257
  let id = "";