@depict-ai/utilishared 1.0.34 → 1.0.36
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 +730 -728
- package/ES10/index.d.ts +1 -1
- package/ES10/index.js +730 -728
- package/latest/index.cjs +602 -599
- package/latest/index.d.ts +1 -1
- package/latest/index.js +602 -599
- package/package.json +2 -2
package/ES10/index.js
CHANGED
|
@@ -15,7 +15,7 @@ function $parcel$export(e, n, v, s) {
|
|
|
15
15
|
function $parcel$interopDefault(a) {
|
|
16
16
|
return a && a.__esModule ? a.default : a;
|
|
17
17
|
}
|
|
18
|
-
const $b9e07ce3c67aa344$export$83d89fbfd8236492 = "1.0.
|
|
18
|
+
const $b9e07ce3c67aa344$export$83d89fbfd8236492 = "1.0.36";
|
|
19
19
|
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"))();
|
|
20
20
|
const $241f2f02cc612a49$var$browser_prefix_styling = "color: #fff;";
|
|
21
21
|
let $241f2f02cc612a49$var$browser_prefix = "[Depict]";
|
|
@@ -45,7 +45,7 @@ function $241f2f02cc612a49$export$997143d41f6a0c9b() {
|
|
|
45
45
|
}
|
|
46
46
|
const $ea5707b8e7b350cf$export$60d1d0e3cfc8b9ed = {};
|
|
47
47
|
function $ea5707b8e7b350cf$export$2cefb7e61fcbae00(package_name, version) {
|
|
48
|
-
|
|
48
|
+
$241f2f02cc612a49$export$de56f1198d121036("@depict-ai/" + package_name + " version", version);
|
|
49
49
|
$ea5707b8e7b350cf$export$60d1d0e3cfc8b9ed[package_name] = version;
|
|
50
50
|
}
|
|
51
51
|
function $ea5707b8e7b350cf$export$fe609f0216e4ebef(url) {
|
|
@@ -71,15 +71,15 @@ function $5c580d87c093cc47$export$a7e53ec3b3fdd030(str) {
|
|
|
71
71
|
}
|
|
72
72
|
class $449d6683cecfa078$export$e2c811ae0eb35313 {
|
|
73
73
|
constructor() {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
$76EG6$babelruntimehelpersdefineProperty(this, "subscribers_", []);
|
|
75
|
+
$76EG6$babelruntimehelpersdefineProperty(this, "waiting_for_update_", 0);
|
|
76
|
+
$76EG6$babelruntimehelpersdefineProperty(this, "queue_", []);
|
|
77
|
+
$76EG6$babelruntimehelpersdefineProperty(this, "has_had_value_", false);
|
|
78
|
+
$76EG6$babelruntimehelpersdefineProperty(this, "push_value_", value => {
|
|
79
79
|
this.queue_.push(value);
|
|
80
80
|
this.call_subscribers_();
|
|
81
81
|
});
|
|
82
|
-
|
|
82
|
+
$76EG6$babelruntimehelpersdefineProperty(this, "call_subscribers_", () => {
|
|
83
83
|
// intentionally arrow fn so it doesn't matter what .this is when being called
|
|
84
84
|
if (this.waiting_for_update_ <= 0 && this.queue_.length) {
|
|
85
85
|
// shift value
|
|
@@ -92,7 +92,7 @@ class $449d6683cecfa078$export$e2c811ae0eb35313 {
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
});
|
|
95
|
-
|
|
95
|
+
$76EG6$babelruntimehelpersdefineProperty(this, "subscriber_done_", () => {
|
|
96
96
|
this.waiting_for_update_--;
|
|
97
97
|
this.call_subscribers_();
|
|
98
98
|
});
|
|
@@ -200,8 +200,8 @@ function $7ca6fdc721083788$export$e806c6c1615a59ae() {
|
|
|
200
200
|
let state_obj = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new (0, $449d6683cecfa078$export$e2c811ae0eb35313)();
|
|
201
201
|
// @ts-ignore
|
|
202
202
|
$7ca6fdc721083788$var$on_async_iterator_next_called({}); // work around https://github.com/swc-project/swc/issues/5530
|
|
203
|
-
const ai =
|
|
204
|
-
const [exit, exitable] =
|
|
203
|
+
const ai = $449d6683cecfa078$export$3e42f5078e3abfc0(state_obj);
|
|
204
|
+
const [exit, exitable] = $fee212025270d5b9$export$927664b47117acb0({
|
|
205
205
|
...ai
|
|
206
206
|
});
|
|
207
207
|
const obj = Object.assign(exitable, {
|
|
@@ -238,7 +238,7 @@ function $7ca6fdc721083788$export$e806c6c1615a59ae() {
|
|
|
238
238
|
yield* $7ca6fdc721083788$var$on_async_iterator_next_called(exitable_for_async_generator, unblock_state_obj, fn => stock_return_function = fn);
|
|
239
239
|
};
|
|
240
240
|
const iterator = async_generator();
|
|
241
|
-
const [exit_async_generator, exitable_for_async_generator] =
|
|
241
|
+
const [exit_async_generator, exitable_for_async_generator] = $fee212025270d5b9$export$927664b47117acb0(orig_iterator);
|
|
242
242
|
// we can't use a normal async generator since it can't be "quit" from the outside (by calling .return on the AsyncIterator) while being awaited apparently
|
|
243
243
|
// therefore we make the async iterable that it's (soon) passing control onto exitable by calling .return() (even if a .next() promise is being currently awaited)
|
|
244
244
|
iterator.return = () => {
|
|
@@ -256,11 +256,11 @@ function $7ca6fdc721083788$export$e806c6c1615a59ae() {
|
|
|
256
256
|
};
|
|
257
257
|
}
|
|
258
258
|
const callable_obj_with_everything = Object.assign(ai, obj);
|
|
259
|
-
|
|
259
|
+
$56f6527795ab68e8$export$8df876135bad6d96(callable_obj_with_everything, "state", {
|
|
260
260
|
get: () => state_obj.last_processed_value_,
|
|
261
261
|
enumerable: true
|
|
262
262
|
});
|
|
263
|
-
|
|
263
|
+
$56f6527795ab68e8$export$8df876135bad6d96(callable_obj_with_everything, "latest_call_value", {
|
|
264
264
|
get: () => {
|
|
265
265
|
var _state_obj$queue_;
|
|
266
266
|
return (_state_obj$queue_ = state_obj.queue_[state_obj.queue_.length - 1]) !== null && _state_obj$queue_ !== void 0 ? _state_obj$queue_ : callable_obj_with_everything.state;
|
|
@@ -311,7 +311,7 @@ function $7ca6fdc721083788$export$10c3e52ef388b81b(ipns) {
|
|
|
311
311
|
return $7ca6fdc721083788$export$e806c6c1615a59ae(true, internal_state_obj);
|
|
312
312
|
}
|
|
313
313
|
function $b000f5ef6ce456d9$export$8048b892d651b310(exception, error_for_stack) {
|
|
314
|
-
|
|
314
|
+
$241f2f02cc612a49$export$de56f1198d121036(exception);
|
|
315
315
|
if (0, $a5a2bdb4ae93374b$export$55fe61489d2c7417) /* eslint-disable no-console */console.trace();
|
|
316
316
|
if (process.env.BUILD_TARGET !== "node") {
|
|
317
317
|
const {
|
|
@@ -335,7 +335,7 @@ async function $2da62df28669a48a$export$2fc1a072736ae2f6(obj, property) {
|
|
|
335
335
|
}
|
|
336
336
|
async function $2da62df28669a48a$var$wait_for_variable_in_object(variable, obj) {
|
|
337
337
|
const start = new Date().getTime();
|
|
338
|
-
|
|
338
|
+
$241f2f02cc612a49$export$de56f1198d121036("waiting for definition of variable", variable, "in", obj);
|
|
339
339
|
let var_behind_the_scenes;
|
|
340
340
|
let resolve_variable_definition;
|
|
341
341
|
let was_defined = false;
|
|
@@ -363,9 +363,9 @@ async function $2da62df28669a48a$var$wait_for_variable_in_object(variable, obj)
|
|
|
363
363
|
get: get,
|
|
364
364
|
set: set
|
|
365
365
|
});
|
|
366
|
-
|
|
366
|
+
$241f2f02cc612a49$export$de56f1198d121036("everything's set up, waiting for promise by setter to resolve");
|
|
367
367
|
const result = await definition_of_var;
|
|
368
|
-
|
|
368
|
+
$241f2f02cc612a49$export$de56f1198d121036("Promise resolved, ", result, " is here. We waited", new Date().getTime() - start, "ms");
|
|
369
369
|
return result;
|
|
370
370
|
}
|
|
371
371
|
function $2da62df28669a48a$export$d5062f468a0454f3(obj, prop) {
|
|
@@ -373,7 +373,7 @@ function $2da62df28669a48a$export$d5062f468a0454f3(obj, prop) {
|
|
|
373
373
|
if (obj != null) return Object.hasOwnProperty.call(obj, prop) ? Object.getOwnPropertyDescriptor(obj, prop) : $2da62df28669a48a$export$d5062f468a0454f3(Object.getPrototypeOf(obj), prop);
|
|
374
374
|
}
|
|
375
375
|
function $2da62df28669a48a$export$79f910a98828378d(obj, variable, async_iterator_should_return_state_on_first_call) {
|
|
376
|
-
const definition_ipns =
|
|
376
|
+
const definition_ipns = $7ca6fdc721083788$export$e806c6c1615a59ae(async_iterator_should_return_state_on_first_call);
|
|
377
377
|
let var_behind_the_scenes = obj[variable];
|
|
378
378
|
definition_ipns(var_behind_the_scenes); // resolve with initial value
|
|
379
379
|
const previous_descriptor = $2da62df28669a48a$export$d5062f468a0454f3(obj, variable);
|
|
@@ -508,7 +508,7 @@ async function $e5da8b4d1e6c12b3$var$load_sentry(TENANT) {
|
|
|
508
508
|
BrowserClient: BrowserClient,
|
|
509
509
|
Hub: Hub,
|
|
510
510
|
defaultIntegrations: defaultIntegrations
|
|
511
|
-
} = await
|
|
511
|
+
} = await $2da62df28669a48a$export$2fc1a072736ae2f6(window, global_var_name);
|
|
512
512
|
delete window[global_var_name];
|
|
513
513
|
if (process.env.SENTRY_SAMPLE_RATE) {
|
|
514
514
|
var _more_options$sampleR;
|
|
@@ -531,7 +531,7 @@ async function $e5da8b4d1e6c12b3$var$load_sentry(TENANT) {
|
|
|
531
531
|
// https://github.com/getsentry/sentry-javascript/issues/2541
|
|
532
532
|
return hub;
|
|
533
533
|
}
|
|
534
|
-
const $17bb552dedcd526c$export$af2e17a20c2ea3c5 = !(process.env.SENTRY === "true" || process.env.DEPICT_ERROR_REPORTING === "true" || process.env.NEXT_PUBLIC_DEPICT_ERROR_REPORTING === "true") && (process.env.SENTRY === "false" || process.env.DEPICT_ERROR_REPORTING === "false" || process.env.NEXT_PUBLIC_DEPICT_ERROR_REPORTING === "false" || (0, $a5a2bdb4ae93374b$export$55fe61489d2c7417)) ? /*@__PURE__*/$17bb552dedcd526c$var$fakesentry() : /*@__PURE__
|
|
534
|
+
const $17bb552dedcd526c$export$af2e17a20c2ea3c5 = !(process.env.SENTRY === "true" || process.env.DEPICT_ERROR_REPORTING === "true" || process.env.NEXT_PUBLIC_DEPICT_ERROR_REPORTING === "true") && (process.env.SENTRY === "false" || process.env.DEPICT_ERROR_REPORTING === "false" || process.env.NEXT_PUBLIC_DEPICT_ERROR_REPORTING === "false" || (0, $a5a2bdb4ae93374b$export$55fe61489d2c7417)) ? /*@__PURE__*/$17bb552dedcd526c$var$fakesentry() : /*@__PURE__*/$e5da8b4d1e6c12b3$export$2e2bcd8739ae039(process.env.TENANT || "unknown", undefined, (0, $241f2f02cc612a49$export$de56f1198d121036));
|
|
535
535
|
function $17bb552dedcd526c$var$fakesentry() {
|
|
536
536
|
// // source: https://docs.sentry.io/platforms/javascript/troubleshooting/#dealing-with-ad-blockers
|
|
537
537
|
// const handler = {
|
|
@@ -601,13 +601,13 @@ function $1cd1e96fe31c935d$export$bb0a9c36cf454ea0(min, max) {
|
|
|
601
601
|
function $9c44a7238815fa47$export$535946eb77c946dd(the_function) {
|
|
602
602
|
let busy = false;
|
|
603
603
|
let current_promise;
|
|
604
|
-
return
|
|
604
|
+
return $5e1f45affc1d7def$export$b3bbfd758f11cfa9(async function () {
|
|
605
605
|
// Double awaits to make sure that if busy is true, it must also be true two ticks later.
|
|
606
606
|
// This is a fix for when a promise that finalizes immediately is passed.
|
|
607
607
|
// For context: https://javascript.info/microtask-queue
|
|
608
608
|
if (!busy || !(await await busy, busy)) {
|
|
609
609
|
busy = true;
|
|
610
|
-
const to_finally =
|
|
610
|
+
const to_finally = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(the_function)(...arguments);
|
|
611
611
|
current_promise = to_finally.finally(() => busy = false);
|
|
612
612
|
}
|
|
613
613
|
return current_promise;
|
|
@@ -617,14 +617,14 @@ function $9c44a7238815fa47$export$f241be8e610f5c77(the_function) {
|
|
|
617
617
|
let busy = false;
|
|
618
618
|
let queued;
|
|
619
619
|
let current_promise;
|
|
620
|
-
const wrapped_fn =
|
|
620
|
+
const wrapped_fn = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(async function () {
|
|
621
621
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
|
|
622
622
|
// Double awaits to make sure that if busy is true, it must also be true two ticks later.
|
|
623
623
|
// This is a fix for when a promise that finalizes immediately is passed.
|
|
624
624
|
// For context: https://javascript.info/microtask-queue
|
|
625
625
|
if (!busy || !(await await busy, busy)) {
|
|
626
626
|
busy = true;
|
|
627
|
-
const to_finally =
|
|
627
|
+
const to_finally = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(the_function)(...args);
|
|
628
628
|
current_promise = to_finally.finally(() => {
|
|
629
629
|
busy = false;
|
|
630
630
|
if (queued) {
|
|
@@ -676,24 +676,24 @@ class $4c6e595091defcd9$export$32ccf3a614c84258 {
|
|
|
676
676
|
writable: true,
|
|
677
677
|
value: Promise.resolve()
|
|
678
678
|
});
|
|
679
|
-
|
|
679
|
+
$76EG6$babelruntimehelpersdefineProperty(this, "promise", new Promise(r => $76EG6$babelruntimehelpersclassPrivateFieldSet(this, $4c6e595091defcd9$var$_internal_resolve, r)));
|
|
680
680
|
$4c6e595091defcd9$var$_classPrivateFieldInitSpec(this, $4c6e595091defcd9$var$_work_queue_max_once, {
|
|
681
681
|
writable: true,
|
|
682
|
-
value:
|
|
682
|
+
value: $9c44a7238815fa47$export$535946eb77c946dd($4c6e595091defcd9$var$_classPrivateMethodGet(this, $4c6e595091defcd9$var$_work_queue, $4c6e595091defcd9$var$_work_queue2).bind(this))
|
|
683
683
|
});
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
684
|
+
$76EG6$babelruntimehelpersdefineProperty(this, "resolve", value => {
|
|
685
|
+
$76EG6$babelruntimehelpersclassPrivateFieldGet(this, $4c6e595091defcd9$var$_values_to_resolve_with).push(value);
|
|
686
|
+
$76EG6$babelruntimehelpersclassPrivateFieldGet(this, $4c6e595091defcd9$var$_work_queue_max_once).call(this);
|
|
687
687
|
});
|
|
688
688
|
}
|
|
689
689
|
}
|
|
690
690
|
async function $4c6e595091defcd9$var$_work_queue2() {
|
|
691
|
-
const vtrw =
|
|
691
|
+
const vtrw = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $4c6e595091defcd9$var$_values_to_resolve_with);
|
|
692
692
|
for (let i = 0; i < vtrw.length; i++) {
|
|
693
|
-
await
|
|
694
|
-
const oldresolve =
|
|
695
|
-
|
|
696
|
-
this.promise = new Promise(r =>
|
|
693
|
+
await $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $4c6e595091defcd9$var$_previous_promise);
|
|
694
|
+
const oldresolve = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $4c6e595091defcd9$var$_internal_resolve);
|
|
695
|
+
$76EG6$babelruntimehelpersclassPrivateFieldSet(this, $4c6e595091defcd9$var$_previous_promise, this.promise);
|
|
696
|
+
this.promise = new Promise(r => $76EG6$babelruntimehelpersclassPrivateFieldSet(this, $4c6e595091defcd9$var$_internal_resolve, r));
|
|
697
697
|
oldresolve(vtrw[i]);
|
|
698
698
|
}
|
|
699
699
|
while (vtrw.length) vtrw.pop();
|
|
@@ -729,10 +729,10 @@ class $f5a4b8e233f0e1cd$export$1b28bc5c68cc4d77 extends EventTarget {
|
|
|
729
729
|
// WHEN MAKING CHANGES, PLEASE KEEP IN MIND THAT THIS CLASS IS ALSO USED ON THE FRONTEND
|
|
730
730
|
increase_fails() {
|
|
731
731
|
var _this$fails, _this$fails2;
|
|
732
|
-
|
|
733
|
-
if (
|
|
732
|
+
$76EG6$babelruntimehelpersclassPrivateFieldSet(this, $f5a4b8e233f0e1cd$var$_fails, (_this$fails = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $f5a4b8e233f0e1cd$var$_fails), _this$fails2 = _this$fails++, _this$fails)), _this$fails2;
|
|
733
|
+
if ($76EG6$babelruntimehelpersclassPrivateFieldGet(this, $f5a4b8e233f0e1cd$var$_fails) > $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $f5a4b8e233f0e1cd$var$_max_fails)) {
|
|
734
734
|
this.restart_ws();
|
|
735
|
-
|
|
735
|
+
$76EG6$babelruntimehelpersclassPrivateFieldSet(this, $f5a4b8e233f0e1cd$var$_fails, 0);
|
|
736
736
|
}
|
|
737
737
|
}
|
|
738
738
|
async send() {
|
|
@@ -762,7 +762,7 @@ class $f5a4b8e233f0e1cd$export$1b28bc5c68cc4d77 extends EventTarget {
|
|
|
762
762
|
});
|
|
763
763
|
$f5a4b8e233f0e1cd$var$_classPrivateFieldInitSpec(this, $f5a4b8e233f0e1cd$var$_try_again_in_ms, {
|
|
764
764
|
writable: true,
|
|
765
|
-
value:
|
|
765
|
+
value: $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $f5a4b8e233f0e1cd$var$_initial_reconnect_delay)
|
|
766
766
|
});
|
|
767
767
|
$f5a4b8e233f0e1cd$var$_classPrivateFieldInitSpec(this, $f5a4b8e233f0e1cd$var$_fails, {
|
|
768
768
|
writable: true,
|
|
@@ -776,32 +776,32 @@ class $f5a4b8e233f0e1cd$export$1b28bc5c68cc4d77 extends EventTarget {
|
|
|
776
776
|
writable: true,
|
|
777
777
|
value: $f5a4b8e233f0e1cd$var$ONE_MINUTE
|
|
778
778
|
});
|
|
779
|
-
|
|
779
|
+
$76EG6$babelruntimehelpersclassPrivateFieldSet(this, $f5a4b8e233f0e1cd$var$_ws_constructor_options, [url, protocols]);
|
|
780
780
|
const {
|
|
781
781
|
max_backoff_ms: max_backoff_ms
|
|
782
782
|
} = options;
|
|
783
|
-
if (max_backoff_ms)
|
|
783
|
+
if (max_backoff_ms) $76EG6$babelruntimehelpersclassPrivateFieldSet(this, $f5a4b8e233f0e1cd$var$_max_backoff_ms, max_backoff_ms);
|
|
784
784
|
$f5a4b8e233f0e1cd$var$_classPrivateMethodGet(this, $f5a4b8e233f0e1cd$var$_setup_dot_on_event_support, $f5a4b8e233f0e1cd$var$_setup_dot_on_event_support2).call(this);
|
|
785
785
|
$f5a4b8e233f0e1cd$var$_classPrivateMethodGet(this, $f5a4b8e233f0e1cd$var$_connect, $f5a4b8e233f0e1cd$var$_connect2).call(this);
|
|
786
|
-
$f5a4b8e233f0e1cd$var$_classPrivateMethodGet(this, $f5a4b8e233f0e1cd$var$_ensure_connection, $f5a4b8e233f0e1cd$var$_ensure_connection2).call(this).catch(e =>
|
|
787
|
-
this.addEventListener("open",
|
|
788
|
-
|
|
789
|
-
|
|
786
|
+
$f5a4b8e233f0e1cd$var$_classPrivateMethodGet(this, $f5a4b8e233f0e1cd$var$_ensure_connection, $f5a4b8e233f0e1cd$var$_ensure_connection2).call(this).catch(e => $5e1f45affc1d7def$export$f18d5b0af29128b7(e, "error"));
|
|
787
|
+
this.addEventListener("open", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => {
|
|
788
|
+
$241f2f02cc612a49$export$de56f1198d121036("Connection opened");
|
|
789
|
+
$76EG6$babelruntimehelpersclassPrivateFieldSet(this, $f5a4b8e233f0e1cd$var$_try_again_in_ms, $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $f5a4b8e233f0e1cd$var$_initial_reconnect_delay)); // reset exponential backoff
|
|
790
790
|
}));
|
|
791
791
|
}
|
|
792
792
|
}
|
|
793
793
|
|
|
794
794
|
function $f5a4b8e233f0e1cd$var$_get_initial_reconnect_delay() {
|
|
795
|
-
return
|
|
795
|
+
return $1cd1e96fe31c935d$export$bb0a9c36cf454ea0(1, 1000);
|
|
796
796
|
}
|
|
797
797
|
function $f5a4b8e233f0e1cd$var$_connect2() {
|
|
798
|
-
this.current_socket = typeof window === "object" || typeof WebSocket === "function" ? new WebSocket(
|
|
798
|
+
this.current_socket = typeof window === "object" || typeof WebSocket === "function" ? new WebSocket(...$76EG6$babelruntimehelpersclassPrivateFieldGet(this, $f5a4b8e233f0e1cd$var$_ws_constructor_options)) : {
|
|
799
799
|
readyState: 0,
|
|
800
800
|
addEventListener: () => {},
|
|
801
801
|
send: () => {}
|
|
802
802
|
};
|
|
803
|
-
|
|
804
|
-
this.current_socket.addEventListener(name,
|
|
803
|
+
$76EG6$babelruntimehelpersclassPrivateFieldGet(this, $f5a4b8e233f0e1cd$var$_possible_events).forEach(name => {
|
|
804
|
+
this.current_socket.addEventListener(name, $5e1f45affc1d7def$export$b3bbfd758f11cfa9(original_event => {
|
|
805
805
|
let fixed_event;
|
|
806
806
|
if (!(original_event instanceof Event)) {
|
|
807
807
|
var _fixed_event;
|
|
@@ -835,17 +835,17 @@ function $f5a4b8e233f0e1cd$var$_setup_dot_on_event_support2() {
|
|
|
835
835
|
// the idea is to make AutoReconnectingWS usable just like a normal WebSocket
|
|
836
836
|
// so that you can do .onmessage or .addEventListener("message", handler) on an AutoReconnectingWS. It basically abstracts away connections that can close and die to one big EventTarget where you don't need to care about the underlying connection
|
|
837
837
|
// this is how we add .onmessage, .onclose, .onopen and .onerror support to our EventTarget (this class)
|
|
838
|
-
for (const ev of
|
|
838
|
+
for (const ev of $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $f5a4b8e233f0e1cd$var$_possible_events)) {
|
|
839
839
|
Object.defineProperty(this, "on" + ev, {
|
|
840
840
|
configurable: false,
|
|
841
841
|
enumerable: true,
|
|
842
|
-
get: () =>
|
|
843
|
-
set: v =>
|
|
842
|
+
get: () => $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $f5a4b8e233f0e1cd$var$_ons)[ev],
|
|
843
|
+
set: v => $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $f5a4b8e233f0e1cd$var$_ons)[ev] = v
|
|
844
844
|
});
|
|
845
845
|
this.addEventListener(ev, e => {
|
|
846
846
|
// e can be MessageEvent | CloseEvent | ErrorEvent I think
|
|
847
|
-
const on_fn =
|
|
848
|
-
if (typeof on_fn === "function")
|
|
847
|
+
const on_fn = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $f5a4b8e233f0e1cd$var$_ons)[ev];
|
|
848
|
+
if (typeof on_fn === "function") $5e1f45affc1d7def$export$b3bbfd758f11cfa9(on_fn).call(ev, e);
|
|
849
849
|
});
|
|
850
850
|
}
|
|
851
851
|
}
|
|
@@ -861,26 +861,26 @@ async function $f5a4b8e233f0e1cd$var$_ensure_connection2() {
|
|
|
861
861
|
// 4100 means server thinks this is a scraper bot that's ignoring robots.txt
|
|
862
862
|
// @ts-ignore
|
|
863
863
|
if ((error === null || error === void 0 ? void 0 : error.code) === 4100) {
|
|
864
|
-
|
|
864
|
+
$241f2f02cc612a49$export$de56f1198d121036("Websocket connection rejected by server, won't reconnect", error);
|
|
865
865
|
return;
|
|
866
866
|
}
|
|
867
|
-
|
|
867
|
+
$241f2f02cc612a49$export$de56f1198d121036("Somehow the websocket died", error, "message:", error === null || error === void 0 ? void 0 : error.message, "code:", error === null || error === void 0 ? void 0 : error.code, "reason:", error === null || error === void 0 ? void 0 : error.reason, "reconnecting in", $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $f5a4b8e233f0e1cd$var$_try_again_in_ms));
|
|
868
868
|
await new Promise(r => {
|
|
869
869
|
// "race" the timeout and getting an https://developer.mozilla.org/en-US/docs/Web/API/Window/online_event by the browser
|
|
870
|
-
const handler =
|
|
870
|
+
const handler = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(ev => {
|
|
871
871
|
r();
|
|
872
|
-
|
|
872
|
+
$241f2f02cc612a49$export$de56f1198d121036("Retrying due to 'online' event", ev);
|
|
873
873
|
clearTimeout(timeout);
|
|
874
874
|
});
|
|
875
875
|
window.addEventListener("online", handler, {
|
|
876
876
|
once: true
|
|
877
877
|
});
|
|
878
|
-
const timeout = setTimeout(
|
|
879
|
-
|
|
880
|
-
if (
|
|
878
|
+
const timeout = setTimeout($5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => {
|
|
879
|
+
$76EG6$babelruntimehelpersclassPrivateFieldSet(this, $f5a4b8e233f0e1cd$var$_try_again_in_ms, $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $f5a4b8e233f0e1cd$var$_try_again_in_ms) * (1.5 + Math.random()));
|
|
880
|
+
if ($76EG6$babelruntimehelpersclassPrivateFieldGet(this, $f5a4b8e233f0e1cd$var$_try_again_in_ms) > $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $f5a4b8e233f0e1cd$var$_max_backoff_ms)) $76EG6$babelruntimehelpersclassPrivateFieldSet(this, $f5a4b8e233f0e1cd$var$_try_again_in_ms, $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $f5a4b8e233f0e1cd$var$_max_backoff_ms) * (1 + Math.random() / 10));
|
|
881
881
|
r();
|
|
882
882
|
window.removeEventListener("online", handler);
|
|
883
|
-
}),
|
|
883
|
+
}), $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $f5a4b8e233f0e1cd$var$_try_again_in_ms));
|
|
884
884
|
});
|
|
885
885
|
$f5a4b8e233f0e1cd$var$_classPrivateMethodGet(this, $f5a4b8e233f0e1cd$var$_connect, $f5a4b8e233f0e1cd$var$_connect2).call(this);
|
|
886
886
|
}
|
|
@@ -901,14 +901,14 @@ class $f5a4b8e233f0e1cd$export$1d9c6fddbff3441f extends $f5a4b8e233f0e1cd$export
|
|
|
901
901
|
while (true) {
|
|
902
902
|
const {
|
|
903
903
|
data: data
|
|
904
|
-
} = await
|
|
904
|
+
} = await $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $f5a4b8e233f0e1cd$var$_msg_ipns).promise;
|
|
905
905
|
let reply;
|
|
906
906
|
try {
|
|
907
907
|
reply = JSON.parse(data);
|
|
908
908
|
} catch (e) {
|
|
909
909
|
const msg = "Got malformed message (ignoring, might cause memory leak)";
|
|
910
|
-
|
|
911
|
-
|
|
910
|
+
$241f2f02cc612a49$export$de56f1198d121036(msg, data, e);
|
|
911
|
+
$5e1f45affc1d7def$export$f18d5b0af29128b7([e, msg], "error", {
|
|
912
912
|
data: data
|
|
913
913
|
});
|
|
914
914
|
continue;
|
|
@@ -920,12 +920,12 @@ class $f5a4b8e233f0e1cd$export$1d9c6fddbff3441f extends $f5a4b8e233f0e1cd$export
|
|
|
920
920
|
if (status == "ack") {
|
|
921
921
|
stop_sending();
|
|
922
922
|
continue;
|
|
923
|
-
} else if (status == "not-ok")
|
|
923
|
+
} else if (status == "not-ok") $241f2f02cc612a49$export$c2363754d4758444("Got reply not-ok reply from server for event!", payload, reply);else if (status == "ok") {
|
|
924
924
|
if (process.env.BUILD_TARGET !== "node") {
|
|
925
925
|
var _payload$event;
|
|
926
|
-
|
|
926
|
+
$241f2f02cc612a49$export$de56f1198d121036("Successfully sent ".concat(payload === null || payload === void 0 ? void 0 : (_payload$event = payload.event) === null || _payload$event === void 0 ? void 0 : _payload$event.type, " (WS)"), payload, reply);
|
|
927
927
|
}
|
|
928
|
-
} else
|
|
928
|
+
} else $241f2f02cc612a49$export$c2363754d4758444("Strange reply from WSS server to", payload, ":", reply);
|
|
929
929
|
stop_sending();
|
|
930
930
|
return [reply, data];
|
|
931
931
|
}
|
|
@@ -958,22 +958,22 @@ class $f5a4b8e233f0e1cd$export$1d9c6fddbff3441f extends $f5a4b8e233f0e1cd$export
|
|
|
958
958
|
});
|
|
959
959
|
$f5a4b8e233f0e1cd$var$_classPrivateFieldInitSpec(this, $f5a4b8e233f0e1cd$var$_start_reconnection_if_offline_process, {
|
|
960
960
|
writable: true,
|
|
961
|
-
value:
|
|
962
|
-
await new Promise(r => setTimeout(r,
|
|
961
|
+
value: $9c44a7238815fa47$export$535946eb77c946dd(async () => {
|
|
962
|
+
await new Promise(r => setTimeout(r, $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $f5a4b8e233f0e1cd$var$_reconnect_if_dead_for_ms) + $1cd1e96fe31c935d$export$bb0a9c36cf454ea0(-2, 10)));
|
|
963
963
|
// so if we are trying to send something and there's no activity ("error" which could mean the server is down or message or reconnection) we can safely assume that the internet connection is down. In that case we skip the exponential backoff since we want to know when we're connected again ASAP and just retry every like 20s
|
|
964
|
-
if (
|
|
964
|
+
if ($76EG6$babelruntimehelpersclassPrivateFieldGet(this, $f5a4b8e233f0e1cd$var$_messages_queued) === 0) return;
|
|
965
965
|
const now = +new Date();
|
|
966
|
-
if (now -
|
|
967
|
-
const reason = "No activity in ".concat(
|
|
968
|
-
|
|
966
|
+
if (now - $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $f5a4b8e233f0e1cd$var$_connection_last_active) > $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $f5a4b8e233f0e1cd$var$_reconnect_if_dead_for_ms)) {
|
|
967
|
+
const reason = "No activity in ".concat($76EG6$babelruntimehelpersclassPrivateFieldGet(this, $f5a4b8e233f0e1cd$var$_reconnect_if_dead_for_ms), " ms");
|
|
968
|
+
$241f2f02cc612a49$export$de56f1198d121036(reason, "reconnecting ws");
|
|
969
969
|
this.restart_ws(reason);
|
|
970
970
|
}
|
|
971
971
|
})
|
|
972
972
|
});
|
|
973
973
|
const option_retry_ms = (_ref = arguments.length <= 2 ? undefined : arguments[2]) === null || _ref === void 0 ? void 0 : _ref.initial_retry_ms;
|
|
974
|
-
if (option_retry_ms)
|
|
975
|
-
this.addEventListener("message",
|
|
976
|
-
["open", "error", "message"].forEach(event => this.addEventListener(event,
|
|
974
|
+
if (option_retry_ms) $76EG6$babelruntimehelpersclassPrivateFieldSet(this, $f5a4b8e233f0e1cd$var$_initial_retry_ms, option_retry_ms);
|
|
975
|
+
this.addEventListener("message", $5e1f45affc1d7def$export$b3bbfd758f11cfa9($76EG6$babelruntimehelpersclassPrivateFieldGet(this, $f5a4b8e233f0e1cd$var$_msg_ipns).resolve));
|
|
976
|
+
["open", "error", "message"].forEach(event => this.addEventListener(event, $5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => $76EG6$babelruntimehelpersclassPrivateFieldSet(this, $f5a4b8e233f0e1cd$var$_connection_last_active, +new Date()))));
|
|
977
977
|
}
|
|
978
978
|
}
|
|
979
979
|
async function $f5a4b8e233f0e1cd$var$_wait_for_open_and_send2(msg) {
|
|
@@ -986,12 +986,12 @@ async function $f5a4b8e233f0e1cd$var$_wait_for_open_and_send2(msg) {
|
|
|
986
986
|
}
|
|
987
987
|
function $f5a4b8e233f0e1cd$var$_periodic_send2(msg) {
|
|
988
988
|
var _this$messages_queued, _this$messages_queued2;
|
|
989
|
-
let delay_to_next_send =
|
|
989
|
+
let delay_to_next_send = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $f5a4b8e233f0e1cd$var$_initial_retry_ms);
|
|
990
990
|
let quit = false;
|
|
991
|
-
|
|
991
|
+
$76EG6$babelruntimehelpersclassPrivateFieldSet(this, $f5a4b8e233f0e1cd$var$_messages_queued, (_this$messages_queued = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $f5a4b8e233f0e1cd$var$_messages_queued), _this$messages_queued2 = _this$messages_queued++, _this$messages_queued)), _this$messages_queued2;
|
|
992
992
|
(async (_this$messages_queued3, _this$messages_queued4) => {
|
|
993
993
|
while (!quit) {
|
|
994
|
-
|
|
994
|
+
$76EG6$babelruntimehelpersclassPrivateFieldGet(this, $f5a4b8e233f0e1cd$var$_start_reconnection_if_offline_process).call(this);
|
|
995
995
|
await $f5a4b8e233f0e1cd$var$_classPrivateMethodGet(this, $f5a4b8e233f0e1cd$var$_wait_for_open_and_send, $f5a4b8e233f0e1cd$var$_wait_for_open_and_send2).call(this, msg);
|
|
996
996
|
const waited = await new Promise(r => {
|
|
997
997
|
const handler = () => {
|
|
@@ -1001,7 +1001,7 @@ function $f5a4b8e233f0e1cd$var$_periodic_send2(msg) {
|
|
|
1001
1001
|
// wait the correct delay
|
|
1002
1002
|
const resend_due_to_lost_message_timeout = setTimeout(
|
|
1003
1003
|
// this might actually never be needed and be from when Daniel didn't understand WebSockets as well
|
|
1004
|
-
|
|
1004
|
+
$5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => {
|
|
1005
1005
|
r(true);
|
|
1006
1006
|
this.removeEventListener("open", handler);
|
|
1007
1007
|
}), delay_to_next_send);
|
|
@@ -1018,8 +1018,8 @@ function $f5a4b8e233f0e1cd$var$_periodic_send2(msg) {
|
|
|
1018
1018
|
// this is not a proven theory and might be wrong
|
|
1019
1019
|
this.increase_fails();
|
|
1020
1020
|
}
|
|
1021
|
-
|
|
1022
|
-
})().catch(e =>
|
|
1021
|
+
$76EG6$babelruntimehelpersclassPrivateFieldSet(this, $f5a4b8e233f0e1cd$var$_messages_queued, (_this$messages_queued3 = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $f5a4b8e233f0e1cd$var$_messages_queued), _this$messages_queued4 = _this$messages_queued3--, _this$messages_queued3)), _this$messages_queued4;
|
|
1022
|
+
})().catch(e => $5e1f45affc1d7def$export$f18d5b0af29128b7(e, "error"));
|
|
1023
1023
|
return () => quit = true;
|
|
1024
1024
|
}
|
|
1025
1025
|
|
|
@@ -1047,18 +1047,18 @@ const $814c3bf8e175fa59$export$72036d950e1fae95 = /*@__PURE__*/$814c3bf8e175fa59
|
|
|
1047
1047
|
const $814c3bf8e175fa59$export$aa26019042811d4f = /*@__PURE__*/$814c3bf8e175fa59$var$c(async bodies => {
|
|
1048
1048
|
if (process.env.DEPICT === "false") return;
|
|
1049
1049
|
for (let i = 0; i < bodies.length; i++) {
|
|
1050
|
-
const id =
|
|
1050
|
+
const id = $6cb4d83127e468ea$export$656831b7e9c341c3();
|
|
1051
1051
|
$814c3bf8e175fa59$var$ws_instance === null || $814c3bf8e175fa59$var$ws_instance === void 0 || $814c3bf8e175fa59$var$ws_instance.ensure_sent({
|
|
1052
1052
|
id: id,
|
|
1053
1053
|
event: bodies[i]
|
|
1054
|
-
}).catch(e =>
|
|
1054
|
+
}).catch(e => $5e1f45affc1d7def$export$f18d5b0af29128b7(e, "error"));
|
|
1055
1055
|
}
|
|
1056
1056
|
});
|
|
1057
1057
|
const $814c3bf8e175fa59$export$608478473a3304a0 = /*@__PURE__*/$814c3bf8e175fa59$var$c(function (payload) {
|
|
1058
1058
|
let use_ws = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
1059
1059
|
if (process.env.DEPICT === "false") return;
|
|
1060
1060
|
if (use_ws && typeof WebSocket == "function" && typeof ($814c3bf8e175fa59$var$ws_instance === null || $814c3bf8e175fa59$var$ws_instance === void 0 ? void 0 : $814c3bf8e175fa59$var$ws_instance.ensure_sent) == "function") {
|
|
1061
|
-
|
|
1061
|
+
$241f2f02cc612a49$export$de56f1198d121036("Sending to depict (ws)", payload);
|
|
1062
1062
|
return $814c3bf8e175fa59$export$aa26019042811d4f(payload);
|
|
1063
1063
|
}
|
|
1064
1064
|
const url = (0, $9e4bee2e3b4b5753$export$362abebb4b313340) + "/create-events";
|
|
@@ -1067,19 +1067,19 @@ const $814c3bf8e175fa59$export$608478473a3304a0 = /*@__PURE__*/$814c3bf8e175fa59
|
|
|
1067
1067
|
const $814c3bf8e175fa59$export$cc3b6ddf805f6156 = /*@__PURE__*/$814c3bf8e175fa59$var$c((url, payload) => {
|
|
1068
1068
|
const payload_json = JSON.stringify(payload);
|
|
1069
1069
|
let success = false;
|
|
1070
|
-
|
|
1070
|
+
$241f2f02cc612a49$export$de56f1198d121036("Attempting to send (beacon)", payload);
|
|
1071
1071
|
try {
|
|
1072
1072
|
success = navigator.sendBeacon(url, new Blob([payload_json], {
|
|
1073
1073
|
type: "application/json"
|
|
1074
1074
|
}));
|
|
1075
1075
|
} catch (first_error) {
|
|
1076
|
-
|
|
1076
|
+
$241f2f02cc612a49$export$de56f1198d121036("Beacon has failed", first_error, "falling back to sending with wrong mime type which might work");
|
|
1077
1077
|
try {
|
|
1078
1078
|
success = navigator.sendBeacon(url, new Blob([payload_json], {
|
|
1079
1079
|
type: "application/x-www-form-urlencoded"
|
|
1080
1080
|
}));
|
|
1081
1081
|
} catch (e) {
|
|
1082
|
-
|
|
1082
|
+
$241f2f02cc612a49$export$de56f1198d121036("Beacon fallback has failed", e, "trying fetch");
|
|
1083
1083
|
fetch(url, {
|
|
1084
1084
|
"headers": {
|
|
1085
1085
|
"content-type": "application/json"
|
|
@@ -1088,7 +1088,7 @@ const $814c3bf8e175fa59$export$cc3b6ddf805f6156 = /*@__PURE__*/$814c3bf8e175fa59
|
|
|
1088
1088
|
"method": "POST",
|
|
1089
1089
|
"mode": "cors",
|
|
1090
1090
|
"credentials": "include"
|
|
1091
|
-
}).then(response => response.text()).then(text =>
|
|
1091
|
+
}).then(response => response.text()).then(text => $241f2f02cc612a49$export$de56f1198d121036("Beacon fallback fallback transmission result", text)).catch(fetch_error => {
|
|
1092
1092
|
(0, $17bb552dedcd526c$export$af2e17a20c2ea3c5).withScope(function (scope) {
|
|
1093
1093
|
scope.setExtra("stack", new Error().stack);
|
|
1094
1094
|
scope.setExtra("url", url);
|
|
@@ -1118,9 +1118,9 @@ let $d5f7352b58e0d737$export$6399bdb2291895e0 = () => {
|
|
|
1118
1118
|
let cookie_error;
|
|
1119
1119
|
try {
|
|
1120
1120
|
var _localStorage;
|
|
1121
|
-
id = (_localStorage = localStorage)._dep_id || (_localStorage._dep_id =
|
|
1121
|
+
id = (_localStorage = localStorage)._dep_id || (_localStorage._dep_id = $6cb4d83127e468ea$export$656831b7e9c341c3());
|
|
1122
1122
|
} catch (e) {
|
|
1123
|
-
|
|
1123
|
+
$241f2f02cc612a49$export$de56f1198d121036("Can't use localStorage", e);
|
|
1124
1124
|
localstorage_error = e;
|
|
1125
1125
|
}
|
|
1126
1126
|
if (!id) {
|
|
@@ -1133,11 +1133,11 @@ let $d5f7352b58e0d737$export$6399bdb2291895e0 = () => {
|
|
|
1133
1133
|
}, {})._dep_id;
|
|
1134
1134
|
id = get_cookie_id();
|
|
1135
1135
|
if (!id) {
|
|
1136
|
-
document.cookie = "_dep_id=".concat(
|
|
1136
|
+
document.cookie = "_dep_id=".concat($6cb4d83127e468ea$export$656831b7e9c341c3(), "; expires=Fri, 31 Dec 9999 23:59:59 GMT");
|
|
1137
1137
|
id = get_cookie_id();
|
|
1138
1138
|
}
|
|
1139
1139
|
} catch (e) {
|
|
1140
|
-
|
|
1140
|
+
$5e1f45affc1d7def$export$f18d5b0af29128b7(e, "warning");
|
|
1141
1141
|
cookie_error = e;
|
|
1142
1142
|
}
|
|
1143
1143
|
(0, $17bb552dedcd526c$export$af2e17a20c2ea3c5).withScope(function (scope) {
|
|
@@ -1148,14 +1148,14 @@ let $d5f7352b58e0d737$export$6399bdb2291895e0 = () => {
|
|
|
1148
1148
|
this.captureMessage("".concat(id ? "localStorage" : "cookie and localStorage", " failed to hold a value!"));
|
|
1149
1149
|
});
|
|
1150
1150
|
}
|
|
1151
|
-
if (!id) id =
|
|
1151
|
+
if (!id) id = $6cb4d83127e468ea$export$656831b7e9c341c3();
|
|
1152
1152
|
return id;
|
|
1153
1153
|
};
|
|
1154
1154
|
let $d5f7352b58e0d737$export$adc61a405a4cabed = $d5f7352b58e0d737$export$6399bdb2291895e0;
|
|
1155
1155
|
let $d5f7352b58e0d737$export$61e7e1f11e96692f = () => undefined;
|
|
1156
|
-
const $d5f7352b58e0d737$export$336e7ad40bae0652 = /*@__PURE__
|
|
1157
|
-
const $d5f7352b58e0d737$export$8a96793bf9f87d90 = /*@__PURE__
|
|
1158
|
-
const $d5f7352b58e0d737$export$93ae15b1ae509334 = /*@__PURE__
|
|
1156
|
+
const $d5f7352b58e0d737$export$336e7ad40bae0652 = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(newfn => $d5f7352b58e0d737$export$6399bdb2291895e0 = newfn);
|
|
1157
|
+
const $d5f7352b58e0d737$export$8a96793bf9f87d90 = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(newfn => $d5f7352b58e0d737$export$adc61a405a4cabed = newfn);
|
|
1158
|
+
const $d5f7352b58e0d737$export$93ae15b1ae509334 = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(newfn => $d5f7352b58e0d737$export$61e7e1f11e96692f = newfn);
|
|
1159
1159
|
const $d5f7352b58e0d737$export$8c6f26a5b6921b95 = /*@__PURE__*/() => {
|
|
1160
1160
|
var _document;
|
|
1161
1161
|
return {
|
|
@@ -1167,7 +1167,7 @@ const $d5f7352b58e0d737$export$8c6f26a5b6921b95 = /*@__PURE__*/() => {
|
|
|
1167
1167
|
document_referrer: (_document = document) === null || _document === void 0 ? void 0 : _document.referrer
|
|
1168
1168
|
};
|
|
1169
1169
|
};
|
|
1170
|
-
const $d5f7352b58e0d737$export$82badda1f9923310 = /*@__PURE__
|
|
1170
|
+
const $d5f7352b58e0d737$export$82badda1f9923310 = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9((vars, use_ws) => {
|
|
1171
1171
|
if (process.env.DEPICT === "false") return;
|
|
1172
1172
|
const payload = [{
|
|
1173
1173
|
...$d5f7352b58e0d737$export$8c6f26a5b6921b95(),
|
|
@@ -1177,9 +1177,9 @@ const $d5f7352b58e0d737$export$82badda1f9923310 = /*@__PURE__*/(0, $5e1f45affc1d
|
|
|
1177
1177
|
entity_price: vars === null || vars === void 0 ? void 0 : vars.sale_price,
|
|
1178
1178
|
...vars
|
|
1179
1179
|
}];
|
|
1180
|
-
return
|
|
1180
|
+
return $814c3bf8e175fa59$export$28cacbd9b4306ffc(payload, use_ws);
|
|
1181
1181
|
});
|
|
1182
|
-
const $d5f7352b58e0d737$export$15f8a0cd5a8c0ebb = /*@__PURE__
|
|
1182
|
+
const $d5f7352b58e0d737$export$15f8a0cd5a8c0ebb = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(vars => {
|
|
1183
1183
|
if (process.env.DEPICT === "false") return;
|
|
1184
1184
|
const beacon_retval = $d5f7352b58e0d737$export$82badda1f9923310({
|
|
1185
1185
|
...vars,
|
|
@@ -1195,7 +1195,7 @@ const $d5f7352b58e0d737$export$15f8a0cd5a8c0ebb = /*@__PURE__*/(0, $5e1f45affc1d
|
|
|
1195
1195
|
|
|
1196
1196
|
return beacon_retval;
|
|
1197
1197
|
});
|
|
1198
|
-
const $d5f7352b58e0d737$export$9028351cb994757e = /*@__PURE__
|
|
1198
|
+
const $d5f7352b58e0d737$export$9028351cb994757e = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(vars => {
|
|
1199
1199
|
if (process.env.DEPICT === "false") return;
|
|
1200
1200
|
return $d5f7352b58e0d737$export$82badda1f9923310({
|
|
1201
1201
|
...vars,
|
|
@@ -1210,7 +1210,7 @@ function $d5f7352b58e0d737$export$622991c71a1f52b3(cookie_name) {
|
|
|
1210
1210
|
function $3a96de5a459d34f9$export$c50e1901e8ed0615(callback) {
|
|
1211
1211
|
// https://stackoverflow.com/a/61574326
|
|
1212
1212
|
const channel = new MessageChannel();
|
|
1213
|
-
channel.port1.onmessage =
|
|
1213
|
+
channel.port1.onmessage = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(callback);
|
|
1214
1214
|
channel.port2.postMessage("");
|
|
1215
1215
|
}
|
|
1216
1216
|
function $5f4e0abe3139380e$export$6f051469dd676a8b(tenant, market, type) {
|
|
@@ -1220,11 +1220,11 @@ function $5f4e0abe3139380e$export$6f051469dd676a8b(tenant, market, type) {
|
|
|
1220
1220
|
if (!display) return;
|
|
1221
1221
|
info.set_on_index_change(() => {
|
|
1222
1222
|
current_displays.add(display);
|
|
1223
|
-
|
|
1223
|
+
$76EG6$onCleanup(() => current_displays.delete(display));
|
|
1224
1224
|
if (!queued_sending) {
|
|
1225
1225
|
queued_sending = true;
|
|
1226
|
-
|
|
1227
|
-
|
|
1226
|
+
$3a96de5a459d34f9$export$c50e1901e8ed0615(() => {
|
|
1227
|
+
$d5f7352b58e0d737$export$82badda1f9923310({
|
|
1228
1228
|
tenant: tenant,
|
|
1229
1229
|
market: market,
|
|
1230
1230
|
recommendation_type: type,
|
|
@@ -1247,7 +1247,7 @@ function $cdf4691608b4019f$export$6e7454c733fa1fb2(fn) {
|
|
|
1247
1247
|
return fn.apply(this, [...args, ...unimportant_args]);
|
|
1248
1248
|
};
|
|
1249
1249
|
}
|
|
1250
|
-
const $bcc7b73f8b96a6f0$export$8582cf3716962dc2 = /*@__PURE__
|
|
1250
|
+
const $bcc7b73f8b96a6f0$export$8582cf3716962dc2 = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(async _ref => {
|
|
1251
1251
|
let {
|
|
1252
1252
|
recs: recs,
|
|
1253
1253
|
min_recs: min_recs,
|
|
@@ -1268,11 +1268,11 @@ const $bcc7b73f8b96a6f0$export$8582cf3716962dc2 = /*@__PURE__*/(0, $5e1f45affc1d
|
|
|
1268
1268
|
if (Array.isArray(recs)) {
|
|
1269
1269
|
if (min_recs == undefined) min_recs = 10;
|
|
1270
1270
|
if (recs.length < min_recs) {
|
|
1271
|
-
|
|
1271
|
+
$241f2f02cc612a49$export$c2363754d4758444("Displays provided to check_displays is too short, it contains", recs.length, "displays which is less than", min_recs);
|
|
1272
1272
|
return false;
|
|
1273
1273
|
} else return true;
|
|
1274
|
-
} else
|
|
1275
|
-
} else
|
|
1274
|
+
} else $241f2f02cc612a49$export$c2363754d4758444(new Error("neither recs nor recs.displays are an array"));
|
|
1275
|
+
} else $241f2f02cc612a49$export$c2363754d4758444(new Error("Non object was passed to check_displays"));
|
|
1276
1276
|
});
|
|
1277
1277
|
const $a01cf8e3169d2af1$var$elem_track_id_map = /*@__PURE__*/new WeakMap();
|
|
1278
1278
|
function $a01cf8e3169d2af1$export$16d7c76794a38a4(element, event, track_id, func) {
|
|
@@ -1321,7 +1321,7 @@ function $914c6f35222c820d$var$check_if_querySelectorAll_needs_patching() {
|
|
|
1321
1321
|
}
|
|
1322
1322
|
let $2c3b8e0102339cd6$var$has_queued_microtask = false;
|
|
1323
1323
|
const $2c3b8e0102339cd6$var$queued_callbacks = /*@__PURE__*/new Map();
|
|
1324
|
-
const $2c3b8e0102339cd6$var$catchified_deduplicate_and_dispatch = /*@__PURE__
|
|
1324
|
+
const $2c3b8e0102339cd6$var$catchified_deduplicate_and_dispatch = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9($2c3b8e0102339cd6$var$deduplicate_and_dispatch, "error in observer event processing", "error");
|
|
1325
1325
|
function $2c3b8e0102339cd6$export$2b08e30396270f0b(callback, ev) {
|
|
1326
1326
|
$2c3b8e0102339cd6$var$queued_callbacks.set(ev, callback);
|
|
1327
1327
|
if (!$2c3b8e0102339cd6$var$has_queued_microtask) queueMicrotask($2c3b8e0102339cd6$var$catchified_deduplicate_and_dispatch);
|
|
@@ -1366,7 +1366,7 @@ function $2c3b8e0102339cd6$var$deduplicate_and_dispatch() {
|
|
|
1366
1366
|
}
|
|
1367
1367
|
}
|
|
1368
1368
|
function $2c3b8e0102339cd6$var$call_callback(callback, ev) {
|
|
1369
|
-
|
|
1369
|
+
$5e1f45affc1d7def$export$b3bbfd758f11cfa9(callback, "Error in observer callback")(ev);
|
|
1370
1370
|
}
|
|
1371
1371
|
class $4f10cdcba0efac85$export$ea60432919e69303 {
|
|
1372
1372
|
constructor(opts) {
|
|
@@ -1456,7 +1456,7 @@ class $7d82513db34b5d27$export$12e07a2a9f87578a {
|
|
|
1456
1456
|
});
|
|
1457
1457
|
$7d82513db34b5d27$var$_classPrivateFieldInitSpec(this, $7d82513db34b5d27$var$_weakref_finalization_registry, {
|
|
1458
1458
|
writable: true,
|
|
1459
|
-
value: typeof FinalizationRegistry === "function" && new FinalizationRegistry(
|
|
1459
|
+
value: typeof FinalizationRegistry === "function" && new FinalizationRegistry($5e1f45affc1d7def$export$b3bbfd758f11cfa9($7d82513db34b5d27$var$_classPrivateMethodGet(this, $7d82513db34b5d27$var$_finalization_registry_callback, $7d82513db34b5d27$var$_finalization_registry_callback2).bind(this)))
|
|
1460
1460
|
});
|
|
1461
1461
|
$7d82513db34b5d27$var$_classPrivateFieldInitSpec(this, $7d82513db34b5d27$var$_verbs, {
|
|
1462
1462
|
writable: true,
|
|
@@ -1466,7 +1466,7 @@ class $7d82513db34b5d27$export$12e07a2a9f87578a {
|
|
|
1466
1466
|
var _classPrivateFieldGet2, _ref;
|
|
1467
1467
|
$7d82513db34b5d27$var$_classPrivateMethodGet(this, $7d82513db34b5d27$var$_check_observer_args, $7d82513db34b5d27$var$_check_observer_args2).call(this, selector, callback, true);
|
|
1468
1468
|
if (selector instanceof Node) {
|
|
1469
|
-
if (typeof document === "object" && (
|
|
1469
|
+
if (typeof document === "object" && ($76EG6$babelruntimehelpersclassPrivateFieldGet(this, $7d82513db34b5d27$var$_territory) || document.documentElement).contains(selector))
|
|
1470
1470
|
// When the selector is a node the selector and the element are the same, dunno how we could reflect that in the typing though
|
|
1471
1471
|
$7d82513db34b5d27$var$_classPrivateMethodGet(this, $7d82513db34b5d27$var$_call_callbacks, $7d82513db34b5d27$var$_call_callbacks2).call(this, [callback], callback_ => ({
|
|
1472
1472
|
element_: selector,
|
|
@@ -1480,8 +1480,8 @@ class $7d82513db34b5d27$export$12e07a2a9f87578a {
|
|
|
1480
1480
|
}));
|
|
1481
1481
|
return;
|
|
1482
1482
|
}
|
|
1483
|
-
const our_set = (_classPrivateFieldGet2 =
|
|
1484
|
-
const elements = typeof document === "undefined" ? [] :
|
|
1483
|
+
const our_set = (_classPrivateFieldGet2 = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $7d82513db34b5d27$var$_attribute_attribution_map_object))[_ref = selector] || (_classPrivateFieldGet2[_ref] = new WeakSet());
|
|
1484
|
+
const elements = typeof document === "undefined" ? [] : $914c6f35222c820d$export$33f937d741e49339($76EG6$babelruntimehelpersclassPrivateFieldGet(this, $7d82513db34b5d27$var$_territory) || document, selector);
|
|
1485
1485
|
for (let i = 0; i < elements.length; i++) {
|
|
1486
1486
|
const element = elements[i];
|
|
1487
1487
|
our_set.add(element);
|
|
@@ -1497,13 +1497,13 @@ class $7d82513db34b5d27$export$12e07a2a9f87578a {
|
|
|
1497
1497
|
}
|
|
1498
1498
|
},
|
|
1499
1499
|
wait_for_element: (selector, timeout) => {
|
|
1500
|
-
return
|
|
1500
|
+
return $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $7d82513db34b5d27$var$_self_proxied).wait_for_listener("exists", selector, timeout);
|
|
1501
1501
|
},
|
|
1502
1502
|
wait_for_listener: (listener, selector, timeout) => {
|
|
1503
1503
|
$7d82513db34b5d27$var$_classPrivateMethodGet(this, $7d82513db34b5d27$var$_check_observer_args, $7d82513db34b5d27$var$_check_observer_args2).call(this, listener, () => {}, false);
|
|
1504
1504
|
// console.log("waiting for listener", listener, "selector", selector, "timeout", timeout);
|
|
1505
|
-
return new Promise(
|
|
1506
|
-
const stop_observing =
|
|
1505
|
+
return new Promise($5e1f45affc1d7def$export$b3bbfd758f11cfa9(r => {
|
|
1506
|
+
const stop_observing = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $7d82513db34b5d27$var$_self_proxied)["on" + listener](selector, _ref2 => {
|
|
1507
1507
|
let {
|
|
1508
1508
|
element: element,
|
|
1509
1509
|
disconnector: disconnector
|
|
@@ -1525,11 +1525,11 @@ class $7d82513db34b5d27$export$12e07a2a9f87578a {
|
|
|
1525
1525
|
value: records => {
|
|
1526
1526
|
// this is the function which needs to be as fast as possible because it is called on EVERY mutation in the DOM
|
|
1527
1527
|
try {
|
|
1528
|
-
|
|
1528
|
+
$76EG6$babelruntimehelpersclassPrivateFieldSet(this, $7d82513db34b5d27$var$_observer_callback_running, true);
|
|
1529
1529
|
const steps_to_restore_observing_cache = [];
|
|
1530
1530
|
try {
|
|
1531
|
-
const observing =
|
|
1532
|
-
const attribute_attribution_map_object =
|
|
1531
|
+
const observing = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $7d82513db34b5d27$var$_observing); // Currently observing elements. Please make sure they don't get mutated by anything except this function during the running of this function (use observer_callback_running and #execute_after_callback_ran to check for and schedule your mutations for after the run of this function). We previously cloned these on every run but that's super slow.
|
|
1532
|
+
const attribute_attribution_map_object = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $7d82513db34b5d27$var$_attribute_attribution_map_object);
|
|
1533
1533
|
for (let j = 0; j < records.length; j++) {
|
|
1534
1534
|
const record = records[j];
|
|
1535
1535
|
const {
|
|
@@ -1636,7 +1636,7 @@ class $7d82513db34b5d27$export$12e07a2a9f87578a {
|
|
|
1636
1636
|
if ((addedNodes.length || removedNodes.length) && node.hasChildNodes() &&
|
|
1637
1637
|
// @ts-ignore
|
|
1638
1638
|
node.querySelectorAll /* don't act on i.e. textnodes. Doing the check this way is actually faster than both `in` and instanceof */) {
|
|
1639
|
-
const matching_children =
|
|
1639
|
+
const matching_children = $914c6f35222c820d$export$33f937d741e49339(node, selector);
|
|
1640
1640
|
for (let m = 0; m < matching_children.length; m++) {
|
|
1641
1641
|
// always use for loops because this can't be slow and forEach takes ages
|
|
1642
1642
|
if (event == "exists") our_set.add(matching_children[m]);
|
|
@@ -1705,7 +1705,7 @@ class $7d82513db34b5d27$export$12e07a2a9f87578a {
|
|
|
1705
1705
|
const matching_nodes = [];
|
|
1706
1706
|
// @ts-ignore
|
|
1707
1707
|
if (node !== null && node !== void 0 && (_node$matches2 = node.matches) !== null && _node$matches2 !== void 0 && _node$matches2.call(node, selector)) matching_nodes.push(node);
|
|
1708
|
-
matching_nodes.push(...(
|
|
1708
|
+
matching_nodes.push(...($914c6f35222c820d$export$33f937d741e49339(node, selector) || []));
|
|
1709
1709
|
for (let v = 0; v < matching_nodes.length; v++) $7d82513db34b5d27$var$_classPrivateMethodGet(this, $7d82513db34b5d27$var$_call_callbacks, $7d82513db34b5d27$var$_call_callbacks2).call(this, callbacks, callback => ({
|
|
1710
1710
|
element_: matching_nodes[v],
|
|
1711
1711
|
selector_: selector,
|
|
@@ -1744,36 +1744,36 @@ class $7d82513db34b5d27$export$12e07a2a9f87578a {
|
|
|
1744
1744
|
} finally {
|
|
1745
1745
|
// ensure that we don't leave this.#observing in a broken state if we throw
|
|
1746
1746
|
while (steps_to_restore_observing_cache.length) steps_to_restore_observing_cache.pop()();
|
|
1747
|
-
const execute_after_run =
|
|
1747
|
+
const execute_after_run = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $7d82513db34b5d27$var$_execute_after_callback_ran);
|
|
1748
1748
|
// We need to execute these in order they were added because I'm afraid that things might rely on it
|
|
1749
1749
|
for (let i = 0; i < execute_after_run.length; i++) try {
|
|
1750
1750
|
execute_after_run[i]();
|
|
1751
1751
|
} catch (e) {
|
|
1752
|
-
|
|
1752
|
+
$5e1f45affc1d7def$export$f18d5b0af29128b7([e, "error in observer running queued function"], "error");
|
|
1753
1753
|
}
|
|
1754
1754
|
// Let the garbage collector empty the old array by creating a new one
|
|
1755
|
-
|
|
1756
|
-
|
|
1755
|
+
$76EG6$babelruntimehelpersclassPrivateFieldSet(this, $7d82513db34b5d27$var$_execute_after_callback_ran, []);
|
|
1756
|
+
$76EG6$babelruntimehelpersclassPrivateFieldSet(this, $7d82513db34b5d27$var$_observer_callback_running, false);
|
|
1757
1757
|
}
|
|
1758
1758
|
} catch (e) {
|
|
1759
|
-
|
|
1759
|
+
$5e1f45affc1d7def$export$f18d5b0af29128b7([e, "error in observer"], "error");
|
|
1760
1760
|
}
|
|
1761
1761
|
}
|
|
1762
1762
|
});
|
|
1763
1763
|
if (process.env.BUILD_TARGET !== "modern" && Proxy.toString().indexOf("[native code]") === -1) {
|
|
1764
|
-
|
|
1765
|
-
Object.keys(
|
|
1764
|
+
$76EG6$babelruntimehelpersclassPrivateFieldGet(this, $7d82513db34b5d27$var$_listeners).forEach(listener => this["on" + listener] = () => {}); // define listeners, needed for IE11 proxy polyfill
|
|
1765
|
+
Object.keys($76EG6$babelruntimehelpersclassPrivateFieldGet(this, $7d82513db34b5d27$var$_verbs)).forEach(listener => this[listener] = () => {});
|
|
1766
1766
|
}
|
|
1767
|
-
if (options.territory)
|
|
1768
|
-
return
|
|
1767
|
+
if (options.territory) $76EG6$babelruntimehelpersclassPrivateFieldSet(this, $7d82513db34b5d27$var$_territory, options.territory);
|
|
1768
|
+
return $76EG6$babelruntimehelpersclassPrivateFieldSet(this, $7d82513db34b5d27$var$_self_proxied, new Proxy(this, {
|
|
1769
1769
|
get: $7d82513db34b5d27$var$_classPrivateMethodGet(this, $7d82513db34b5d27$var$_get, $7d82513db34b5d27$var$_get2)
|
|
1770
1770
|
}));
|
|
1771
1771
|
}
|
|
1772
1772
|
}
|
|
1773
1773
|
function $7d82513db34b5d27$var$_kickstart_observer2() {
|
|
1774
1774
|
if (typeof document === "undefined") return;
|
|
1775
|
-
|
|
1776
|
-
|
|
1775
|
+
$76EG6$babelruntimehelpersclassPrivateFieldSet(this, $7d82513db34b5d27$var$_the_mutation_observer, new MutationObserver($76EG6$babelruntimehelpersclassPrivateFieldGet(this, $7d82513db34b5d27$var$_observer_callback)));
|
|
1776
|
+
$76EG6$babelruntimehelpersclassPrivateFieldGet(this, $7d82513db34b5d27$var$_the_mutation_observer).observe($76EG6$babelruntimehelpersclassPrivateFieldGet(this, $7d82513db34b5d27$var$_territory) || document, {
|
|
1777
1777
|
attributes: true,
|
|
1778
1778
|
childList: true,
|
|
1779
1779
|
subtree: true,
|
|
@@ -1790,7 +1790,7 @@ function $7d82513db34b5d27$var$_disconnect_fn2(_ref4) {
|
|
|
1790
1790
|
} = _ref4;
|
|
1791
1791
|
return () => {
|
|
1792
1792
|
const fn = () => {
|
|
1793
|
-
const observing =
|
|
1793
|
+
const observing = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $7d82513db34b5d27$var$_observing);
|
|
1794
1794
|
const selector_to_callback_array_map = observing[event_];
|
|
1795
1795
|
if (!selector_to_callback_array_map) return;
|
|
1796
1796
|
const callbacks = selector_to_callback_array_map.get(selector_);
|
|
@@ -1799,12 +1799,12 @@ function $7d82513db34b5d27$var$_disconnect_fn2(_ref4) {
|
|
|
1799
1799
|
if (selector_to_callback_array_map.size === 0) delete observing[event_];
|
|
1800
1800
|
if (!Object.keys(observing).length) {
|
|
1801
1801
|
var _classPrivateFieldGet3;
|
|
1802
|
-
(_classPrivateFieldGet3 =
|
|
1803
|
-
|
|
1802
|
+
(_classPrivateFieldGet3 = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $7d82513db34b5d27$var$_the_mutation_observer)) === null || _classPrivateFieldGet3 === void 0 || _classPrivateFieldGet3.disconnect();
|
|
1803
|
+
$76EG6$babelruntimehelpersclassPrivateFieldSet(this, $7d82513db34b5d27$var$_the_mutation_observer, undefined);
|
|
1804
1804
|
}
|
|
1805
1805
|
};
|
|
1806
1806
|
// If the observer callback is running, we need to queue every function that mutates this.#observing since we can't clone it for performance reasons
|
|
1807
|
-
if (
|
|
1807
|
+
if ($76EG6$babelruntimehelpersclassPrivateFieldGet(this, $7d82513db34b5d27$var$_observer_callback_running)) $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $7d82513db34b5d27$var$_execute_after_callback_ran).push(fn);else fn();
|
|
1808
1808
|
};
|
|
1809
1809
|
}
|
|
1810
1810
|
function $7d82513db34b5d27$var$_check_observer_args2(selector, callback, allow_nodes) {
|
|
@@ -1819,7 +1819,7 @@ function $7d82513db34b5d27$var$_add_listener2(listener) {
|
|
|
1819
1819
|
// We are probably running on the server where we can't do anything anyway so we might just return
|
|
1820
1820
|
return;
|
|
1821
1821
|
if (!listener || !selector || !callback) {
|
|
1822
|
-
|
|
1822
|
+
$241f2f02cc612a49$export$de56f1198d121036("listener, selector or callback is falsey", {
|
|
1823
1823
|
listener: listener,
|
|
1824
1824
|
selector: selector,
|
|
1825
1825
|
callback: callback
|
|
@@ -1827,17 +1827,17 @@ function $7d82513db34b5d27$var$_add_listener2(listener) {
|
|
|
1827
1827
|
return;
|
|
1828
1828
|
}
|
|
1829
1829
|
$7d82513db34b5d27$var$_classPrivateMethodGet(the_class, $7d82513db34b5d27$var$_check_observer_args, $7d82513db34b5d27$var$_check_observer_args2).call(the_class, selector, callback, listener != "change");
|
|
1830
|
-
if (
|
|
1830
|
+
if ($76EG6$babelruntimehelpersclassPrivateFieldGet(the_class, $7d82513db34b5d27$var$_observer_callback_running)) {
|
|
1831
1831
|
// Can't mutate #observing right now, queue it for when we can
|
|
1832
|
-
|
|
1832
|
+
$76EG6$babelruntimehelpersclassPrivateFieldGet(the_class, $7d82513db34b5d27$var$_execute_after_callback_ran).push(() => function_for_listener(selector, callback));
|
|
1833
1833
|
return;
|
|
1834
1834
|
}
|
|
1835
|
-
const observing =
|
|
1835
|
+
const observing = $76EG6$babelruntimehelpersclassPrivateFieldGet(the_class, $7d82513db34b5d27$var$_observing);
|
|
1836
1836
|
observing[listener] || (observing[listener] = new Map());
|
|
1837
1837
|
// create map for each listener, this is because the selectors can be objects for .onremoved, .oncreation and .onexists to take explicit nodes
|
|
1838
1838
|
const selector_map = observing[listener];
|
|
1839
1839
|
let disconnector;
|
|
1840
|
-
if (listener === "exists")
|
|
1840
|
+
if (listener === "exists") $76EG6$babelruntimehelpersclassPrivateFieldGet(the_class, $7d82513db34b5d27$var$_verbs).ifexists(selector, callback);
|
|
1841
1841
|
if (typeof selector === "string") {
|
|
1842
1842
|
// simple code for string selectors
|
|
1843
1843
|
let callback_set = selector_map.get(selector);
|
|
@@ -1886,45 +1886,45 @@ function $7d82513db34b5d27$var$_add_listener2(listener) {
|
|
|
1886
1886
|
}
|
|
1887
1887
|
callback_set_to_add_to.add(callback);
|
|
1888
1888
|
}
|
|
1889
|
-
if (
|
|
1889
|
+
if (!$76EG6$babelruntimehelpersclassPrivateFieldGet(the_class, $7d82513db34b5d27$var$_the_mutation_observer)) $7d82513db34b5d27$var$_classPrivateMethodGet(the_class, $7d82513db34b5d27$var$_kickstart_observer, $7d82513db34b5d27$var$_kickstart_observer2).call(the_class);
|
|
1890
1890
|
return disconnector;
|
|
1891
1891
|
};
|
|
1892
1892
|
return function_for_listener;
|
|
1893
1893
|
}
|
|
1894
1894
|
function $7d82513db34b5d27$var$_cleanup_weakref_when_refd_el_gcd2(listener, weakref, element) {
|
|
1895
1895
|
// we don't want to keep references to elements used as "selectors" in oncreation and onremoved
|
|
1896
|
-
if (
|
|
1897
|
-
|
|
1896
|
+
if (!$76EG6$babelruntimehelpersclassPrivateFieldGet(this, $7d82513db34b5d27$var$_weakref_finalization_registry)) return;
|
|
1897
|
+
$76EG6$babelruntimehelpersclassPrivateFieldGet(this, $7d82513db34b5d27$var$_weakref_finalization_registry).register(element, [listener, weakref]);
|
|
1898
1898
|
}
|
|
1899
1899
|
function $7d82513db34b5d27$var$_finalization_registry_callback2(_ref5) {
|
|
1900
1900
|
var _observing$listener, _observing$listener$g, _observing$listener2, _observing$listener3;
|
|
1901
1901
|
let [listener, weak_ref] = _ref5;
|
|
1902
1902
|
// element was GCd and the callbacks can never be called, remove them
|
|
1903
|
-
const observing =
|
|
1903
|
+
const observing = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $7d82513db34b5d27$var$_observing);
|
|
1904
1904
|
(_observing$listener = observing[listener]) === null || _observing$listener === void 0 || (_observing$listener$g = _observing$listener.get(weak_ref)) === null || _observing$listener$g === void 0 || _observing$listener$g.clear(); // just in case something still has a reference to this set and does something with it, clear it
|
|
1905
1905
|
(_observing$listener2 = observing[listener]) === null || _observing$listener2 === void 0 || _observing$listener2.delete(weak_ref);
|
|
1906
1906
|
if (((_observing$listener3 = observing[listener]) === null || _observing$listener3 === void 0 ? void 0 : _observing$listener3.size) === 0) delete observing[listener];
|
|
1907
1907
|
if (Object.keys(observing).length === 0) {
|
|
1908
1908
|
var _classPrivateFieldGet4;
|
|
1909
|
-
(_classPrivateFieldGet4 =
|
|
1910
|
-
|
|
1909
|
+
(_classPrivateFieldGet4 = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $7d82513db34b5d27$var$_the_mutation_observer)) === null || _classPrivateFieldGet4 === void 0 || _classPrivateFieldGet4.disconnect();
|
|
1910
|
+
$76EG6$babelruntimehelpersclassPrivateFieldSet(this, $7d82513db34b5d27$var$_the_mutation_observer, undefined);
|
|
1911
1911
|
}
|
|
1912
1912
|
}
|
|
1913
1913
|
function $7d82513db34b5d27$var$_call_callbacks2(callbacks, make_ev_data) {
|
|
1914
|
-
for (const callback of callbacks)
|
|
1914
|
+
for (const callback of callbacks) $2c3b8e0102339cd6$export$2b08e30396270f0b(callback, new (0, $4f10cdcba0efac85$export$ea60432919e69303)(make_ev_data(callback)));
|
|
1915
1915
|
}
|
|
1916
1916
|
function $7d82513db34b5d27$var$_get2(target, verb) {
|
|
1917
1917
|
// @ts-ignore
|
|
1918
|
-
const is_listener =
|
|
1919
|
-
const is_verb = Object.keys(
|
|
1920
|
-
if (is_verb) return
|
|
1918
|
+
const is_listener = $76EG6$babelruntimehelpersclassPrivateFieldGet(target, $7d82513db34b5d27$var$_listeners).includes(verb.slice(2));
|
|
1919
|
+
const is_verb = Object.keys($76EG6$babelruntimehelpersclassPrivateFieldGet(target, $7d82513db34b5d27$var$_verbs)).includes(verb);
|
|
1920
|
+
if (is_verb) return $76EG6$babelruntimehelpersclassPrivateFieldGet(target, $7d82513db34b5d27$var$_verbs)[verb];else if (is_listener) return $7d82513db34b5d27$var$_classPrivateMethodGet(target, $7d82513db34b5d27$var$_add_listener, $7d82513db34b5d27$var$_add_listener2).call(target, verb.slice(2));else throw new Error("Property " + verb + " is not valid. Valid listeners: " + $76EG6$babelruntimehelpersclassPrivateFieldGet(target, $7d82513db34b5d27$var$_listeners).join(", ") + "; valid verbs: " + Object.keys($76EG6$babelruntimehelpersclassPrivateFieldGet(target, $7d82513db34b5d27$var$_verbs)).join(", "));
|
|
1921
1921
|
}
|
|
1922
1922
|
const $90fa633a9564f115$export$b6ae1bc530f4c149 = /*@__PURE__*/$90fa633a9564f115$var$make_default_observer();
|
|
1923
1923
|
function $90fa633a9564f115$var$make_default_observer() {
|
|
1924
1924
|
try {
|
|
1925
1925
|
return new (0, $7d82513db34b5d27$export$12e07a2a9f87578a)();
|
|
1926
1926
|
} catch (error) {
|
|
1927
|
-
|
|
1927
|
+
$5e1f45affc1d7def$export$f18d5b0af29128b7([error, "error starting ElementObserver"], "error");
|
|
1928
1928
|
}
|
|
1929
1929
|
}
|
|
1930
1930
|
function $652300c6621d5500$export$925772df9b4d16e5(url, param, value) {
|
|
@@ -1957,22 +1957,22 @@ function $652300c6621d5500$export$d4bd03f19260ef1c(url) {
|
|
|
1957
1957
|
let stfu = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
1958
1958
|
let also_in_all_shadow_roots = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
1959
1959
|
if (process.env.DEBUG === "true" && location.href.includes(override_dev_url)) {
|
|
1960
|
-
const relativ_callback =
|
|
1960
|
+
const relativ_callback = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(event => {
|
|
1961
1961
|
const anchor = event.element;
|
|
1962
1962
|
if (typeof url === "string") {
|
|
1963
1963
|
if (anchor.href.includes(url)) {
|
|
1964
|
-
if (!stfu)
|
|
1964
|
+
if (!stfu) $241f2f02cc612a49$export$de56f1198d121036("RUNNING RELATIVIFY on", event);
|
|
1965
1965
|
anchor.href = anchor.href.replaceAll(url, "/");
|
|
1966
1966
|
}
|
|
1967
1967
|
} else if (url.test(anchor.href)) {
|
|
1968
|
-
if (!stfu)
|
|
1968
|
+
if (!stfu) $241f2f02cc612a49$export$de56f1198d121036("RUNNING RELATIVIFY on", event);
|
|
1969
1969
|
anchor.href = anchor.href.replace(url, "/");
|
|
1970
1970
|
}
|
|
1971
1971
|
});
|
|
1972
1972
|
const link_sel = "a[href]";
|
|
1973
1973
|
(0, $90fa633a9564f115$export$b6ae1bc530f4c149).onexists(link_sel, relativ_callback);
|
|
1974
1974
|
if (also_onchange) (0, $90fa633a9564f115$export$b6ae1bc530f4c149).onchange(link_sel, relativ_callback);
|
|
1975
|
-
if (also_in_all_shadow_roots && typeof ShadowRoot == "function") (0, $90fa633a9564f115$export$b6ae1bc530f4c149).onexists("*",
|
|
1975
|
+
if (also_in_all_shadow_roots && typeof ShadowRoot == "function") (0, $90fa633a9564f115$export$b6ae1bc530f4c149).onexists("*", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(_ref => {
|
|
1976
1976
|
let {
|
|
1977
1977
|
element: element
|
|
1978
1978
|
} = _ref;
|
|
@@ -1989,7 +1989,7 @@ function $652300c6621d5500$export$5e63aea0cac01fa0(elements, selector) {
|
|
|
1989
1989
|
const matches = [];
|
|
1990
1990
|
for (const element of elements) {
|
|
1991
1991
|
var _element$matches;
|
|
1992
|
-
if ("querySelectorAll" in element) matches.push(
|
|
1992
|
+
if ("querySelectorAll" in element) matches.push(...$914c6f35222c820d$export$33f937d741e49339(element, selector));
|
|
1993
1993
|
if ("matches" in element && (_element$matches = element.matches) !== null && _element$matches !== void 0 && _element$matches.call(element, selector)) matches.push(element);
|
|
1994
1994
|
}
|
|
1995
1995
|
return matches;
|
|
@@ -2001,18 +2001,21 @@ function $652300c6621d5500$export$cfef5d5c9ac09253(price) {
|
|
|
2001
2001
|
if (!price && price !== 0) return "";
|
|
2002
2002
|
if (typeof price === "string") {
|
|
2003
2003
|
if (!isNaN(price)) {
|
|
2004
|
-
|
|
2004
|
+
$5e1f45affc1d7def$export$f18d5b0af29128b7(new Error("standard_price_format did not expect price as a string"), "warning", {
|
|
2005
2005
|
price: price
|
|
2006
2006
|
});
|
|
2007
2007
|
price = parseFloat(price);
|
|
2008
2008
|
} else {
|
|
2009
|
-
|
|
2009
|
+
$5e1f45affc1d7def$export$f18d5b0af29128b7(new Error("standard_price_format cannot handle price string"), "error", {
|
|
2010
2010
|
price: price
|
|
2011
2011
|
});
|
|
2012
2012
|
return "";
|
|
2013
2013
|
}
|
|
2014
2014
|
}
|
|
2015
2015
|
if (places_after_comma == "auto") places_after_comma = price % 1 ? 2 : 0;
|
|
2016
|
+
// Generalized rounding for any value of places_after_comma.
|
|
2017
|
+
const multiplier = Math.pow(10, places_after_comma);
|
|
2018
|
+
price = Math.round(price * multiplier) / multiplier;
|
|
2016
2019
|
const fixed = places_after_comma < 0 ? price.toString().split(".") : price.toFixed(places_after_comma).split("."),
|
|
2017
2020
|
[...chars] = fixed[0],
|
|
2018
2021
|
reversed = chars.reverse();
|
|
@@ -2048,14 +2051,14 @@ function $6c8c963618d41bb2$export$947a20746936143d(promises) {
|
|
|
2048
2051
|
async function $df87ac5a30f7baac$export$836f70a28c317905(product_id) {
|
|
2049
2052
|
if (typeof BroadcastChannel != "function") return;
|
|
2050
2053
|
const bc = new BroadcastChannel("right_click_attribution");
|
|
2051
|
-
|
|
2054
|
+
$241f2f02cc612a49$export$de56f1198d121036("Broadcasting", product_id, "to", bc);
|
|
2052
2055
|
bc.postMessage(product_id);
|
|
2053
2056
|
bc.close();
|
|
2054
2057
|
}
|
|
2055
2058
|
function $df87ac5a30f7baac$export$58c56fe2313fdbe3(elements, display, info, get_event_listener_remover) {
|
|
2056
2059
|
if (typeof BroadcastChannel != "function") return elements;
|
|
2057
2060
|
const disconnectors = [];
|
|
2058
|
-
const handler =
|
|
2061
|
+
const handler = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(e => $df87ac5a30f7baac$export$8f66c4c7fb96eda2(e, ("variant_index" in display ? display.variant_displays[display.variant_index] : display).product_id));
|
|
2059
2062
|
const auxclick_handler = e => e.button === 1 && handler(e);
|
|
2060
2063
|
for (let i = 0; i < (elements === null || elements === void 0 ? void 0 : elements.length); i++) {
|
|
2061
2064
|
const element = elements[i];
|
|
@@ -2070,15 +2073,15 @@ function $df87ac5a30f7baac$export$58c56fe2313fdbe3(elements, display, info, get_
|
|
|
2070
2073
|
return elements;
|
|
2071
2074
|
}
|
|
2072
2075
|
async function $df87ac5a30f7baac$export$8f66c4c7fb96eda2(e, product_id) {
|
|
2073
|
-
|
|
2076
|
+
$241f2f02cc612a49$export$de56f1198d121036("Contextmenu was invoked", e);
|
|
2074
2077
|
const element = e.currentTarget || e.target;
|
|
2075
2078
|
const bc = new BroadcastChannel("right_click_attribution");
|
|
2076
|
-
const got_wanted_event = await
|
|
2077
|
-
bc.addEventListener("message",
|
|
2079
|
+
const got_wanted_event = await $6c8c963618d41bb2$export$947a20746936143d([new Promise(resolve => {
|
|
2080
|
+
bc.addEventListener("message", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(msg => {
|
|
2078
2081
|
const {
|
|
2079
2082
|
data: data
|
|
2080
2083
|
} = msg;
|
|
2081
|
-
|
|
2084
|
+
$241f2f02cc612a49$export$de56f1198d121036("Recieved broadcast channel event", data, msg);
|
|
2082
2085
|
if (data == product_id) resolve(true);
|
|
2083
2086
|
}));
|
|
2084
2087
|
}), new Promise(r => setTimeout(r, 60000, false))]);
|
|
@@ -2089,12 +2092,12 @@ async function $df87ac5a30f7baac$export$8f66c4c7fb96eda2(e, product_id) {
|
|
|
2089
2092
|
cancelable: true,
|
|
2090
2093
|
metaKey: true
|
|
2091
2094
|
});
|
|
2092
|
-
|
|
2095
|
+
$241f2f02cc612a49$export$de56f1198d121036("Someone broadcasted our product_id! Simulating a click event on the element that was contextmenu'd", element, click);
|
|
2093
2096
|
element.addEventListener("click", e => (e.preventDefault(), false), {
|
|
2094
2097
|
once: true
|
|
2095
2098
|
});
|
|
2096
2099
|
element.dispatchEvent(click);
|
|
2097
|
-
} else
|
|
2100
|
+
} else $241f2f02cc612a49$export$de56f1198d121036("Our product_id did not get broadcasted, closing channel");
|
|
2098
2101
|
bc.close();
|
|
2099
2102
|
}
|
|
2100
2103
|
|
|
@@ -2129,7 +2132,7 @@ const $20f21bee300687ff$var$unwatch_element = element => {
|
|
|
2129
2132
|
};
|
|
2130
2133
|
const $20f21bee300687ff$export$4c51576248bcdf31 = (element, callback) => {
|
|
2131
2134
|
if ($20f21bee300687ff$var$watched_elements.has(element)) {
|
|
2132
|
-
|
|
2135
|
+
$241f2f02cc612a49$export$de56f1198d121036("Not watching", element, "as it's already being watched");
|
|
2133
2136
|
return () => {};
|
|
2134
2137
|
}
|
|
2135
2138
|
$20f21bee300687ff$var$intersection_observer === null || $20f21bee300687ff$var$intersection_observer === void 0 || $20f21bee300687ff$var$intersection_observer.observe(element);
|
|
@@ -2184,7 +2187,7 @@ const $20f21bee300687ff$var$intersection_observer_callback = entries => {
|
|
|
2184
2187
|
clearTimeout(callback_timeout_);
|
|
2185
2188
|
if (time_elapsed <= (0, $d6c3e2ba045accda$export$ca8321ea61dc2544)) $20f21bee300687ff$var$current_intersections.delete(target);else {
|
|
2186
2189
|
// we intersected long enough
|
|
2187
|
-
|
|
2190
|
+
$241f2f02cc612a49$export$de56f1198d121036("intersection_observer: setTimeout lagged", time_elapsed, (0, $d6c3e2ba045accda$export$ca8321ea61dc2544), "ms", target);
|
|
2188
2191
|
callback(target);
|
|
2189
2192
|
}
|
|
2190
2193
|
}
|
|
@@ -2194,34 +2197,34 @@ const $20f21bee300687ff$var$intersection_observer_callback = entries => {
|
|
|
2194
2197
|
* Global IntersectionObserver used for all impression tracking.
|
|
2195
2198
|
* It's faster to use one observer for all elements than to create a new one for each element.
|
|
2196
2199
|
*/
|
|
2197
|
-
const $20f21bee300687ff$var$intersection_observer = typeof window === "object" ? /*@__PURE__*/new IntersectionObserver( /*@__PURE__
|
|
2198
|
-
threshold: /*@__PURE__
|
|
2200
|
+
const $20f21bee300687ff$var$intersection_observer = typeof window === "object" ? /*@__PURE__*/new IntersectionObserver( /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9($20f21bee300687ff$var$intersection_observer_callback), {
|
|
2201
|
+
threshold: /*@__PURE__*/$ab9c3dbf2bb2fbf7$export$f8ea2e7b15b5d129(8)
|
|
2199
2202
|
}) : undefined;
|
|
2200
2203
|
const $c633189b7b69d048$export$d0efd8ed14f5c33 = (items, display, info) => {
|
|
2201
2204
|
if (!(items !== null && items !== void 0 && items.length)) return items;
|
|
2202
2205
|
const node_array = Array.isArray(items) ? items : [...items]; // if it's a NodeList convert it to an array
|
|
2203
2206
|
const first_watchable_el = node_array.find(el => el instanceof Element);
|
|
2204
2207
|
if (!first_watchable_el) {
|
|
2205
|
-
|
|
2208
|
+
$241f2f02cc612a49$export$de56f1198d121036("Impression tracking: Can't observe", items, display);
|
|
2206
2209
|
return items;
|
|
2207
2210
|
}
|
|
2208
2211
|
if (!info.t) {
|
|
2209
|
-
|
|
2212
|
+
$241f2f02cc612a49$export$de56f1198d121036("Impression tracking: No tenant instance, can't track", items, display);
|
|
2210
2213
|
return items;
|
|
2211
2214
|
}
|
|
2212
2215
|
(0, $90fa633a9564f115$export$b6ae1bc530f4c149).onexists(first_watchable_el, _ref => {
|
|
2213
2216
|
let {
|
|
2214
2217
|
element: element
|
|
2215
2218
|
} = _ref;
|
|
2216
|
-
|
|
2219
|
+
$20f21bee300687ff$export$4c51576248bcdf31(element, () => {
|
|
2217
2220
|
const {
|
|
2218
2221
|
recommendation_id: recommendation_id,
|
|
2219
2222
|
search_result_id: search_result_id,
|
|
2220
2223
|
product_listing_result_id: product_listing_result_id,
|
|
2221
2224
|
suggestions_result_id: suggestions_result_id
|
|
2222
2225
|
} = display;
|
|
2223
|
-
|
|
2224
|
-
|
|
2226
|
+
$d6c3e2ba045accda$export$4205dc6835bc0d9f({
|
|
2227
|
+
...$d5f7352b58e0d737$export$8c6f26a5b6921b95(),
|
|
2225
2228
|
recommendation_type: info.rendering_options.type,
|
|
2226
2229
|
entity_price: display.sale_price,
|
|
2227
2230
|
market: info.t.market,
|
|
@@ -2244,9 +2247,9 @@ const $e89a1d249db21af0$export$37125ccc5dd98050 = _ref => {
|
|
|
2244
2247
|
} = _ref;
|
|
2245
2248
|
const disconnectors = [];
|
|
2246
2249
|
const impression_track = () => {
|
|
2247
|
-
const disconnector =
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
+
const disconnector = $20f21bee300687ff$export$4c51576248bcdf31(element, () => {
|
|
2251
|
+
$d6c3e2ba045accda$export$4205dc6835bc0d9f({
|
|
2252
|
+
...$d5f7352b58e0d737$export$8c6f26a5b6921b95(),
|
|
2250
2253
|
...data
|
|
2251
2254
|
});
|
|
2252
2255
|
});
|
|
@@ -2260,7 +2263,7 @@ const $d6c3e2ba045accda$export$c543ee4cdb0d0964 = (start, end) => $d6c3e2ba045ac
|
|
|
2260
2263
|
const $d6c3e2ba045accda$export$ca8321ea61dc2544 = 500;
|
|
2261
2264
|
const $d6c3e2ba045accda$export$4205dc6835bc0d9f = data => {
|
|
2262
2265
|
data.type = "element_visible"; // Set the type to element_visible as this is optional to pass here.
|
|
2263
|
-
|
|
2266
|
+
$814c3bf8e175fa59$export$28cacbd9b4306ffc([data], true);
|
|
2264
2267
|
};
|
|
2265
2268
|
function $bd7c9f254946941d$export$82a685f2da2fb027(a_element, product_id, recommendation_id, additional_listener) {
|
|
2266
2269
|
var _a_element$depict_tra, _a_element$depict_tra2;
|
|
@@ -2294,9 +2297,9 @@ function $bd7c9f254946941d$export$82a685f2da2fb027(a_element, product_id, recomm
|
|
|
2294
2297
|
async function $bd7c9f254946941d$export$2c34560c3749dc63(button, get_product_id, tracking_fn, unmatching_tracking, event) {
|
|
2295
2298
|
// @ts-ignore
|
|
2296
2299
|
if (!button || button.depict_tracked) return;
|
|
2297
|
-
button.addEventListener(event ? event : "click",
|
|
2300
|
+
button.addEventListener(event ? event : "click", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(async e => {
|
|
2298
2301
|
if (!e.isTrusted) {
|
|
2299
|
-
|
|
2302
|
+
$241f2f02cc612a49$export$de56f1198d121036("ignoring event", e, "because it's not user generated");
|
|
2300
2303
|
return;
|
|
2301
2304
|
}
|
|
2302
2305
|
const product_id = await get_product_id(undefined, e);
|
|
@@ -2313,8 +2316,8 @@ async function $bd7c9f254946941d$export$2c34560c3749dc63(button, get_product_id,
|
|
|
2313
2316
|
button.depict_tracked = true;
|
|
2314
2317
|
}
|
|
2315
2318
|
var $ad1dbddac6af350d$var$_globalThis$window;
|
|
2316
|
-
const $ad1dbddac6af350d$export$20e9533e68ee72e7 = /*@__PURE__
|
|
2317
|
-
const $ad1dbddac6af350d$export$a9d39e43ae273d26 = /*@__PURE__
|
|
2319
|
+
const $ad1dbddac6af350d$export$20e9533e68ee72e7 = /*@__PURE__*/$7ca6fdc721083788$export$e806c6c1615a59ae(false);
|
|
2320
|
+
const $ad1dbddac6af350d$export$a9d39e43ae273d26 = /*@__PURE__*/$7ca6fdc721083788$export$e806c6c1615a59ae();
|
|
2318
2321
|
const $ad1dbddac6af350d$export$7500cdfd37aafd43 = /*@__PURE__*/new Set();
|
|
2319
2322
|
let $ad1dbddac6af350d$var$old_url;
|
|
2320
2323
|
const $ad1dbddac6af350d$var$maybe_navigation = (what_happened, args) => {
|
|
@@ -2331,9 +2334,9 @@ const $ad1dbddac6af350d$var$maybe_navigation = (what_happened, args) => {
|
|
|
2331
2334
|
};
|
|
2332
2335
|
$ad1dbddac6af350d$export$baccefee4a395d8f((args, what_happened) => $ad1dbddac6af350d$var$maybe_navigation(what_happened, args));
|
|
2333
2336
|
$ad1dbddac6af350d$var$maybe_navigation();
|
|
2334
|
-
globalThis === null || globalThis === void 0 || ($ad1dbddac6af350d$var$_globalThis$window = globalThis.window) === null || $ad1dbddac6af350d$var$_globalThis$window === void 0 || $ad1dbddac6af350d$var$_globalThis$window.addEventListener("popstate",
|
|
2337
|
+
globalThis === null || globalThis === void 0 || ($ad1dbddac6af350d$var$_globalThis$window = globalThis.window) === null || $ad1dbddac6af350d$var$_globalThis$window === void 0 || $ad1dbddac6af350d$var$_globalThis$window.addEventListener("popstate", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(e => $ad1dbddac6af350d$var$maybe_navigation("popstate", e)));
|
|
2335
2338
|
async function $ad1dbddac6af350d$export$1cd22bab0d2c3b0b(callback) {
|
|
2336
|
-
const catchified_callback =
|
|
2339
|
+
const catchified_callback = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(callback);
|
|
2337
2340
|
for await (const href of $ad1dbddac6af350d$export$20e9533e68ee72e7) {
|
|
2338
2341
|
catchified_callback(href);
|
|
2339
2342
|
break;
|
|
@@ -2355,7 +2358,7 @@ async function $ad1dbddac6af350d$export$baccefee4a395d8f(after_navigation) {
|
|
|
2355
2358
|
try {
|
|
2356
2359
|
after_navigation(arguments_list, the_thing);
|
|
2357
2360
|
} catch (e) {
|
|
2358
|
-
|
|
2361
|
+
$b000f5ef6ce456d9$export$8048b892d651b310(e);
|
|
2359
2362
|
}
|
|
2360
2363
|
return nav_result;
|
|
2361
2364
|
}
|
|
@@ -2378,21 +2381,21 @@ async function $0897f35c3b3fbbc4$export$eee4c4d924348b05(data) {
|
|
|
2378
2381
|
} = location;
|
|
2379
2382
|
if ($0897f35c3b3fbbc4$var$last_page_pageview_sent_for !== href) {
|
|
2380
2383
|
$0897f35c3b3fbbc4$var$last_page_pageview_sent_for = href;
|
|
2381
|
-
|
|
2384
|
+
$d5f7352b58e0d737$export$82badda1f9923310({
|
|
2382
2385
|
...data,
|
|
2383
2386
|
type: "page_view"
|
|
2384
2387
|
});
|
|
2385
|
-
if (data.product_id) await
|
|
2388
|
+
if (data.product_id) await $df87ac5a30f7baac$export$836f70a28c317905(data.product_id); // this takes care of right click click attribution - broadcasts the URL of the current page
|
|
2386
2389
|
}
|
|
2387
2390
|
} catch (error) {
|
|
2388
|
-
|
|
2391
|
+
$5e1f45affc1d7def$export$f18d5b0af29128b7([error, "Sending page view failed"], "warning");
|
|
2389
2392
|
}
|
|
2390
2393
|
}
|
|
2391
2394
|
let $0897f35c3b3fbbc4$var$sending_on_navigation = false;
|
|
2392
2395
|
async function $0897f35c3b3fbbc4$export$f7cb1bd47199ec38(data) {
|
|
2393
2396
|
if (!$0897f35c3b3fbbc4$var$sending_on_navigation) {
|
|
2394
2397
|
$0897f35c3b3fbbc4$var$sending_on_navigation = true;
|
|
2395
|
-
|
|
2398
|
+
$5e1f45affc1d7def$export$b3bbfd758f11cfa9(async () => {
|
|
2396
2399
|
for await (const _href of (0, $ad1dbddac6af350d$export$a9d39e43ae273d26)) $0897f35c3b3fbbc4$export$eee4c4d924348b05({
|
|
2397
2400
|
tenant: data.tenant,
|
|
2398
2401
|
market: data.market,
|
|
@@ -2447,7 +2450,7 @@ var $be5f485da4e3f813$exports = {};
|
|
|
2447
2450
|
var $be5f485da4e3f813$var$_consent_from_cookie;
|
|
2448
2451
|
const $be5f485da4e3f813$var$required_consent_level = process.env.DEPICT_TRACKING_CONSENT_LEVEL;
|
|
2449
2452
|
function $be5f485da4e3f813$var$consent_from_cookie() {
|
|
2450
|
-
const cookie =
|
|
2453
|
+
const cookie = $d5f7352b58e0d737$export$622991c71a1f52b3("CookieConsent");
|
|
2451
2454
|
if (!cookie) return;
|
|
2452
2455
|
const consent_json = cookie.replace(/%2C/g, ",").replace(/%27/g, "'").replace(/'/g, '"').replace(/([{[,])\s*([\w]+?):/g, '$1"$2":');
|
|
2453
2456
|
try {
|
|
@@ -2455,7 +2458,7 @@ function $be5f485da4e3f813$var$consent_from_cookie() {
|
|
|
2455
2458
|
} catch ({
|
|
2456
2459
|
message: message
|
|
2457
2460
|
}) {
|
|
2458
|
-
|
|
2461
|
+
$241f2f02cc612a49$export$de56f1198d121036("Error parsing cookie json", consent_json, message);
|
|
2459
2462
|
return;
|
|
2460
2463
|
}
|
|
2461
2464
|
}
|
|
@@ -2469,10 +2472,10 @@ async function $be5f485da4e3f813$export$56c2e8be65fb14ae() {
|
|
|
2469
2472
|
}
|
|
2470
2473
|
function $be5f485da4e3f813$export$8827362e5e938d26() {
|
|
2471
2474
|
if ($be5f485da4e3f813$var$cookie_ipns) return $be5f485da4e3f813$var$cookie_ipns;
|
|
2472
|
-
$be5f485da4e3f813$var$cookie_ipns =
|
|
2475
|
+
$be5f485da4e3f813$var$cookie_ipns = $7ca6fdc721083788$export$e806c6c1615a59ae();
|
|
2473
2476
|
const existing_consent = $be5f485da4e3f813$var$consent_from_cookie();
|
|
2474
2477
|
if (existing_consent) $be5f485da4e3f813$var$cookie_ipns(existing_consent);
|
|
2475
|
-
const consent_maybe_changed =
|
|
2478
|
+
const consent_maybe_changed = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => {
|
|
2476
2479
|
const {
|
|
2477
2480
|
consent: {
|
|
2478
2481
|
marketing: marketing,
|
|
@@ -2491,29 +2494,28 @@ function $be5f485da4e3f813$export$8827362e5e938d26() {
|
|
|
2491
2494
|
var _cookie_ipns$latest_c;
|
|
2492
2495
|
return ((_cookie_ipns$latest_c = $be5f485da4e3f813$var$cookie_ipns.latest_call_value) === null || _cookie_ipns$latest_c === void 0 ? void 0 : _cookie_ipns$latest_c[k]) === new_consent_obj[k];
|
|
2493
2496
|
})) {
|
|
2494
|
-
|
|
2497
|
+
$241f2f02cc612a49$export$de56f1198d121036("Consent changed", new_consent_obj);
|
|
2495
2498
|
$be5f485da4e3f813$var$cookie_ipns(new_consent_obj);
|
|
2496
2499
|
}
|
|
2497
2500
|
}, "extracting consent failed");
|
|
2498
|
-
|
|
2501
|
+
$2da62df28669a48a$export$2fc1a072736ae2f6(window, "Cookiebot", "consent").then(consent_maybe_changed);
|
|
2499
2502
|
["CookiebotOnAccept", "CookiebotOnDecline"].forEach(e => window.addEventListener(e, consent_maybe_changed, false));
|
|
2500
2503
|
return $be5f485da4e3f813$var$cookie_ipns;
|
|
2501
2504
|
}
|
|
2502
|
-
const $be5f485da4e3f813$export$abec7fd9f0b9cc22 = /*@__PURE__
|
|
2505
|
+
const $be5f485da4e3f813$export$abec7fd9f0b9cc22 = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(async function () {
|
|
2503
2506
|
let anon_id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "anonymous";
|
|
2504
|
-
|
|
2505
|
-
if (!$be5f485da4e3f813$var$required_consent_level) return
|
|
2507
|
+
$241f2f02cc612a49$export$de56f1198d121036("Initializing Cookiebot tracking");
|
|
2508
|
+
if (!$be5f485da4e3f813$var$required_consent_level) return $241f2f02cc612a49$export$de56f1198d121036("No consent level set for Depict tracking. Ignoring consent and tracking everything.");
|
|
2506
2509
|
const original_get_depict_id = (0, $d5f7352b58e0d737$export$6399bdb2291895e0);
|
|
2507
2510
|
const original_get_user_id = (0, $d5f7352b58e0d737$export$adc61a405a4cabed);
|
|
2508
|
-
|
|
2509
|
-
|
|
2511
|
+
$d5f7352b58e0d737$export$336e7ad40bae0652(() => $be5f485da4e3f813$var$has_consent ? original_get_depict_id() : anon_id);
|
|
2512
|
+
$d5f7352b58e0d737$export$8a96793bf9f87d90(() => $be5f485da4e3f813$var$has_consent ? original_get_user_id() : anon_id);
|
|
2510
2513
|
for await (const consent_obj of $be5f485da4e3f813$export$8827362e5e938d26()) {
|
|
2511
2514
|
// Changing this will change the return value of function given to set_depict_id_fn above
|
|
2512
2515
|
$be5f485da4e3f813$var$has_consent = consent_obj[$be5f485da4e3f813$var$required_consent_level];
|
|
2513
|
-
if (!$be5f485da4e3f813$var$has_consent)
|
|
2516
|
+
if (!$be5f485da4e3f813$var$has_consent) $241f2f02cc612a49$export$de56f1198d121036('dsid/user_id will be set to, "'.concat(anon_id, '", until Cookiebot has consent for "').concat($be5f485da4e3f813$var$required_consent_level, '"'));else $241f2f02cc612a49$export$de56f1198d121036('Cookiebot obtained consent for "'.concat($be5f485da4e3f813$var$required_consent_level, '", will use true dsid/user_id'));
|
|
2514
2517
|
}
|
|
2515
2518
|
});
|
|
2516
|
-
var $d4217f56717a3207$var$_consent_from_cookie;
|
|
2517
2519
|
const $d4217f56717a3207$var$required_consent_level = process.env.DEPICT_TRACKING_CONSENT_LEVEL;
|
|
2518
2520
|
/*
|
|
2519
2521
|
The Optanon cookie format can vary slightly between integrations. To figure out the key values used for a particular customer,
|
|
@@ -2530,7 +2532,7 @@ const $d4217f56717a3207$var$required_consent_level = process.env.DEPICT_TRACKING
|
|
|
2530
2532
|
const $d4217f56717a3207$var$KEY_ORDER = ["necessary", "statistics", "preferences", "marketing"];
|
|
2531
2533
|
const $d4217f56717a3207$var$OPTANON_TO_COOKIEBOT = Object.fromEntries((process.env.OPTANON_KEYS || "").split(",").filter(k => k).map((k, i) => [k, $d4217f56717a3207$var$KEY_ORDER[i]]));
|
|
2532
2534
|
function $d4217f56717a3207$var$consent_from_cookie() {
|
|
2533
|
-
const cookie =
|
|
2535
|
+
const cookie = $d5f7352b58e0d737$export$622991c71a1f52b3("OptanonConsent");
|
|
2534
2536
|
if (!cookie) return;
|
|
2535
2537
|
const groups = new URLSearchParams(cookie).get("groups") || "";
|
|
2536
2538
|
const matches = groups.matchAll(/(\w+):(\d)/g);
|
|
@@ -2539,7 +2541,7 @@ function $d4217f56717a3207$var$consent_from_cookie() {
|
|
|
2539
2541
|
return consent;
|
|
2540
2542
|
}
|
|
2541
2543
|
let $d4217f56717a3207$var$cookie_ipns;
|
|
2542
|
-
let $d4217f56717a3207$var$has_consent = $d4217f56717a3207$var$required_consent_level ?
|
|
2544
|
+
let $d4217f56717a3207$var$has_consent = /*@__PURE__*/(_consent_from_cookie => $d4217f56717a3207$var$required_consent_level ? ((_consent_from_cookie = $d4217f56717a3207$var$consent_from_cookie()) === null || _consent_from_cookie === void 0 ? void 0 : _consent_from_cookie[$d4217f56717a3207$var$required_consent_level]) || false : true)();
|
|
2543
2545
|
const $d4217f56717a3207$export$1dd9ce50e201eff1 = () => $d4217f56717a3207$var$has_consent;
|
|
2544
2546
|
async function $d4217f56717a3207$export$7a6d436e0782c6ed() {
|
|
2545
2547
|
for await (const consent_obj of $d4217f56717a3207$export$7e4427e80d5fc619()) return consent_obj[process.env.DEPICT_TRACKING_CONSENT_LEVEL];
|
|
@@ -2548,12 +2550,12 @@ async function $d4217f56717a3207$export$7a6d436e0782c6ed() {
|
|
|
2548
2550
|
}
|
|
2549
2551
|
function $d4217f56717a3207$export$7e4427e80d5fc619() {
|
|
2550
2552
|
if ($d4217f56717a3207$var$cookie_ipns) return $d4217f56717a3207$var$cookie_ipns;
|
|
2551
|
-
$d4217f56717a3207$var$cookie_ipns =
|
|
2553
|
+
$d4217f56717a3207$var$cookie_ipns = $7ca6fdc721083788$export$e806c6c1615a59ae();
|
|
2552
2554
|
const existing_consent = $d4217f56717a3207$var$consent_from_cookie();
|
|
2553
2555
|
if (existing_consent !== null && existing_consent !== void 0 && existing_consent.necessary)
|
|
2554
2556
|
// If "necessary" isn't set, user hasn't actually given/withold consent yet.
|
|
2555
2557
|
$d4217f56717a3207$var$cookie_ipns(existing_consent);
|
|
2556
|
-
window.addEventListener("consent.onetrust",
|
|
2558
|
+
window.addEventListener("consent.onetrust", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(evt => {
|
|
2557
2559
|
const c = evt;
|
|
2558
2560
|
// Cast because TS doesn't know about the forEach coming up
|
|
2559
2561
|
const consent_obj = {};
|
|
@@ -2570,36 +2572,36 @@ function $d4217f56717a3207$export$7e4427e80d5fc619() {
|
|
|
2570
2572
|
}));
|
|
2571
2573
|
return $d4217f56717a3207$var$cookie_ipns;
|
|
2572
2574
|
}
|
|
2573
|
-
const $d4217f56717a3207$export$f0f6c846d96fdbec = /*@__PURE__
|
|
2575
|
+
const $d4217f56717a3207$export$f0f6c846d96fdbec = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(async function () {
|
|
2574
2576
|
let anon_id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "anonymous";
|
|
2575
|
-
|
|
2576
|
-
if (!$d4217f56717a3207$var$required_consent_level) return
|
|
2577
|
+
$241f2f02cc612a49$export$de56f1198d121036("Initializing OptAnon tracking");
|
|
2578
|
+
if (!$d4217f56717a3207$var$required_consent_level) return $241f2f02cc612a49$export$de56f1198d121036("No consent level set for Depict tracking. Ignoring consent and tracking everything.");
|
|
2577
2579
|
const original_get_depict_id = (0, $d5f7352b58e0d737$export$6399bdb2291895e0);
|
|
2578
2580
|
const original_get_user_id = (0, $d5f7352b58e0d737$export$adc61a405a4cabed);
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
+
$d5f7352b58e0d737$export$336e7ad40bae0652(() => $d4217f56717a3207$var$has_consent ? original_get_depict_id() : anon_id);
|
|
2582
|
+
$d5f7352b58e0d737$export$8a96793bf9f87d90(() => $d4217f56717a3207$var$has_consent ? original_get_user_id() : anon_id);
|
|
2581
2583
|
for await (const consent_obj of $d4217f56717a3207$export$7e4427e80d5fc619()) {
|
|
2582
2584
|
// Changing this will change the return value of function given to set_depict_id_fn above
|
|
2583
2585
|
$d4217f56717a3207$var$has_consent = consent_obj[$d4217f56717a3207$var$required_consent_level];
|
|
2584
|
-
if (!$d4217f56717a3207$var$has_consent)
|
|
2586
|
+
if (!$d4217f56717a3207$var$has_consent) $241f2f02cc612a49$export$de56f1198d121036('dsid/user_id will be set to, "'.concat(anon_id, '", until Optanon has consent for "').concat($d4217f56717a3207$var$required_consent_level, '"'));else $241f2f02cc612a49$export$de56f1198d121036('Optanon obtained consent for "'.concat($d4217f56717a3207$var$required_consent_level, '", will use true dsid/user_id'));
|
|
2585
2587
|
}
|
|
2586
2588
|
});
|
|
2587
2589
|
const $3674b9afc9a63520$var$g = typeof globalThis == "object" && globalThis || window;
|
|
2588
|
-
const $3674b9afc9a63520$export$f3354ec2ce95ebd9 = /*@__PURE__
|
|
2590
|
+
const $3674b9afc9a63520$export$f3354ec2ce95ebd9 = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(async (GA_ID, strict) => {
|
|
2589
2591
|
var _g$performance, _g$performance$getEnt, _g$performance$getEnt2, _g$performance$getEnt3;
|
|
2590
2592
|
if (process.env.GTAG === "false") return;
|
|
2591
2593
|
if (!GA_ID) {
|
|
2592
|
-
|
|
2594
|
+
$241f2f02cc612a49$export$c2363754d4758444("Couldn't load gtag, GA_ID not specified", GA_ID);
|
|
2593
2595
|
return;
|
|
2594
2596
|
}
|
|
2595
2597
|
const required_consent_level = process.env.GTAG_LOADING_CONSENT_LEVEL;
|
|
2596
2598
|
if (required_consent_level !== undefined) {
|
|
2597
|
-
|
|
2598
|
-
const ipns = process.env.CONSENT_FRAMEWORK == "optanon" ?
|
|
2599
|
+
$241f2f02cc612a49$export$de56f1198d121036("GTag loading waiting for consent level ".concat(required_consent_level));
|
|
2600
|
+
const ipns = process.env.CONSENT_FRAMEWORK == "optanon" ? $d4217f56717a3207$export$7e4427e80d5fc619() : $be5f485da4e3f813$export$8827362e5e938d26();
|
|
2599
2601
|
for await (const consent_status of ipns) {
|
|
2600
2602
|
const status_for_level = consent_status[required_consent_level];
|
|
2601
2603
|
if (status_for_level) {
|
|
2602
|
-
|
|
2604
|
+
$241f2f02cc612a49$export$de56f1198d121036("got consent for", required_consent_level, "loading gtag");
|
|
2603
2605
|
break;
|
|
2604
2606
|
}
|
|
2605
2607
|
}
|
|
@@ -2609,13 +2611,13 @@ const $3674b9afc9a63520$export$f3354ec2ce95ebd9 = /*@__PURE__*/(0, $5e1f45affc1d
|
|
|
2609
2611
|
const page_hasnt_loaded = ($3674b9afc9a63520$var$g === null || $3674b9afc9a63520$var$g === void 0 ? void 0 : (_g$performance = $3674b9afc9a63520$var$g.performance) === null || _g$performance === void 0 ? void 0 : (_g$performance$getEnt = _g$performance.getEntriesByType) === null || _g$performance$getEnt === void 0 ? void 0 : (_g$performance$getEnt2 = _g$performance$getEnt.call(_g$performance, "navigation")) === null || _g$performance$getEnt2 === void 0 ? void 0 : (_g$performance$getEnt3 = _g$performance$getEnt2.every) === null || _g$performance$getEnt3 === void 0 ? void 0 : _g$performance$getEnt3.call(_g$performance$getEnt2, e => e === null || e === void 0 ? void 0 : e.loadEventEnd)) === false;
|
|
2610
2612
|
// Source: comment on https://stackoverflow.com/a/53525488
|
|
2611
2613
|
// don't use readyState, source: personal experience and comment on https://stackoverflow.com/a/28093606
|
|
2612
|
-
|
|
2614
|
+
$241f2f02cc612a49$export$de56f1198d121036("Loading gtag after " + (page_hasnt_loaded ? "pageload and " : "") + "3s" + (strict ? "" : ", but setting up queues already"));
|
|
2613
2615
|
if (!strict) $3674b9afc9a63520$export$d031e55ccd4c52dc(GA_ID);
|
|
2614
2616
|
if (page_hasnt_loaded) {
|
|
2615
2617
|
const load_event = await new Promise(r => window.addEventListener("load", r, {
|
|
2616
2618
|
once: true
|
|
2617
2619
|
}));
|
|
2618
|
-
|
|
2620
|
+
$241f2f02cc612a49$export$de56f1198d121036("page has loaded", load_event);
|
|
2619
2621
|
}
|
|
2620
2622
|
await new Promise(r => setTimeout(r, 3000));
|
|
2621
2623
|
const script = document.createElement("script"),
|
|
@@ -2623,9 +2625,9 @@ const $3674b9afc9a63520$export$f3354ec2ce95ebd9 = /*@__PURE__*/(0, $5e1f45affc1d
|
|
|
2623
2625
|
script.async = true;
|
|
2624
2626
|
script.src = "https://www.googletagmanager.com/gtag/js?id=" + GA_ID;
|
|
2625
2627
|
head.appendChild(script);
|
|
2626
|
-
|
|
2628
|
+
$241f2f02cc612a49$export$de56f1198d121036("Loading gtag now", script);
|
|
2627
2629
|
});
|
|
2628
|
-
const $3674b9afc9a63520$export$d031e55ccd4c52dc = /*@__PURE__
|
|
2630
|
+
const $3674b9afc9a63520$export$d031e55ccd4c52dc = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(GA_ID => {
|
|
2629
2631
|
if (process.env.GTAG === "false") return;
|
|
2630
2632
|
$3674b9afc9a63520$var$g.dataLayer || ($3674b9afc9a63520$var$g.dataLayer = []);
|
|
2631
2633
|
function gtag() {
|
|
@@ -2636,9 +2638,9 @@ const $3674b9afc9a63520$export$d031e55ccd4c52dc = /*@__PURE__*/(0, $5e1f45affc1d
|
|
|
2636
2638
|
$3674b9afc9a63520$var$g.gtag("config", GA_ID, {
|
|
2637
2639
|
"send_page_view": false
|
|
2638
2640
|
});
|
|
2639
|
-
|
|
2641
|
+
$241f2f02cc612a49$export$de56f1198d121036("configuring gtag with", GA_ID);
|
|
2640
2642
|
});
|
|
2641
|
-
const $3674b9afc9a63520$export$7babcd5d4056b2ca = /*@__PURE__
|
|
2643
|
+
const $3674b9afc9a63520$export$7babcd5d4056b2ca = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(async (raw_displays, get_product_id, more) => {
|
|
2642
2644
|
const displays = raw_displays; // gtag tracking is "obsolete" and we don't expect any customers using something else than LegacyDisplay to use it
|
|
2643
2645
|
if (process.env.GTAG === "false") return;
|
|
2644
2646
|
if (process.env.GTAG_VIEW === "false") return;
|
|
@@ -2660,12 +2662,12 @@ const $3674b9afc9a63520$export$7babcd5d4056b2ca = /*@__PURE__*/(0, $5e1f45affc1d
|
|
|
2660
2662
|
const gtag_args = ["event", "view_item_list", {
|
|
2661
2663
|
"items": gtag_items.slice(i, i + max_products_per_request)
|
|
2662
2664
|
}];
|
|
2663
|
-
|
|
2665
|
+
$241f2f02cc612a49$export$de56f1198d121036("Sending product view to gtag", gtag_args);
|
|
2664
2666
|
$3674b9afc9a63520$var$g.gtag(...gtag_args);
|
|
2665
2667
|
}
|
|
2666
|
-
} else
|
|
2668
|
+
} else $241f2f02cc612a49$export$c2363754d4758444("not sending gtag tracking as there is no gtag");
|
|
2667
2669
|
});
|
|
2668
|
-
const $3674b9afc9a63520$export$f522672c9379e339 = /*@__PURE__
|
|
2670
|
+
const $3674b9afc9a63520$export$f522672c9379e339 = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(async (product_id, index, more) => {
|
|
2669
2671
|
if (process.env.GTAG === "false") return;
|
|
2670
2672
|
if (process.env.GTAG_EVENT_CONSENT_LEVEL !== undefined && !(await $3674b9afc9a63520$var$can_send_gtag_events(product_id, index, more))) return;
|
|
2671
2673
|
if (typeof $3674b9afc9a63520$var$g.gtag == "function") {
|
|
@@ -2678,17 +2680,17 @@ const $3674b9afc9a63520$export$f522672c9379e339 = /*@__PURE__*/(0, $5e1f45affc1d
|
|
|
2678
2680
|
...more
|
|
2679
2681
|
}]
|
|
2680
2682
|
}];
|
|
2681
|
-
|
|
2683
|
+
$241f2f02cc612a49$export$de56f1198d121036("calling gtag with arguments", gtag_args);
|
|
2682
2684
|
return $3674b9afc9a63520$var$g.gtag(...gtag_args);
|
|
2683
|
-
} else
|
|
2685
|
+
} else $241f2f02cc612a49$export$c2363754d4758444("not sending gtag tracking as there is no gtag");
|
|
2684
2686
|
});
|
|
2685
|
-
const $3674b9afc9a63520$export$f75172d2e289cd02 = /*@__PURE__
|
|
2687
|
+
const $3674b9afc9a63520$export$f75172d2e289cd02 = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(action => {
|
|
2686
2688
|
if (process.env.GA === "false") return;
|
|
2687
2689
|
if (typeof $3674b9afc9a63520$var$g.ga != "function") {
|
|
2688
|
-
|
|
2690
|
+
$241f2f02cc612a49$export$c2363754d4758444("Not sending to ga as there is no ga");
|
|
2689
2691
|
return;
|
|
2690
2692
|
}
|
|
2691
|
-
|
|
2693
|
+
$241f2f02cc612a49$export$de56f1198d121036("sending", action, "to GA");
|
|
2692
2694
|
return $3674b9afc9a63520$var$g.ga("depict.send", {
|
|
2693
2695
|
hitType: "event",
|
|
2694
2696
|
eventCategory: "Depict",
|
|
@@ -2697,36 +2699,36 @@ const $3674b9afc9a63520$export$f75172d2e289cd02 = /*@__PURE__*/(0, $5e1f45affc1d
|
|
|
2697
2699
|
nonInteraction: 1
|
|
2698
2700
|
});
|
|
2699
2701
|
});
|
|
2700
|
-
const $3674b9afc9a63520$export$ac7296527cb52311 = /*@__PURE__
|
|
2702
|
+
const $3674b9afc9a63520$export$ac7296527cb52311 = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(GAID => {
|
|
2701
2703
|
if (process.env.GA === "false") return;
|
|
2702
2704
|
if (!GAID) {
|
|
2703
|
-
|
|
2705
|
+
$241f2f02cc612a49$export$c2363754d4758444(new Error("No GAID specified"));
|
|
2704
2706
|
return;
|
|
2705
2707
|
}
|
|
2706
2708
|
if (typeof $3674b9afc9a63520$var$g.ga != "function") {
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
+
$241f2f02cc612a49$export$de56f1198d121036("Creating GA queue");
|
|
2710
|
+
$799496226e956169$export$674d8cd8b6868154();
|
|
2709
2711
|
}
|
|
2710
|
-
|
|
2712
|
+
$241f2f02cc612a49$export$de56f1198d121036("Creating ga with GA-ID", GAID);
|
|
2711
2713
|
$3674b9afc9a63520$var$g.ga("create", GAID, "auto", "depict");
|
|
2712
2714
|
$3674b9afc9a63520$export$f3354ec2ce95ebd9(GAID, false);
|
|
2713
2715
|
});
|
|
2714
|
-
const $3674b9afc9a63520$export$127751e82111fcf = /*@__PURE__
|
|
2715
|
-
const $3674b9afc9a63520$export$bf205937e5e012cb = /*@__PURE__
|
|
2716
|
+
const $3674b9afc9a63520$export$127751e82111fcf = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => $3674b9afc9a63520$export$f75172d2e289cd02("rec_bar_click"));
|
|
2717
|
+
const $3674b9afc9a63520$export$bf205937e5e012cb = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => $3674b9afc9a63520$export$f75172d2e289cd02("add_to_cart_after_rec_bar_click"));
|
|
2716
2718
|
async function $3674b9afc9a63520$var$can_send_gtag_events() {
|
|
2717
2719
|
const required_consent_level = process.env.GTAG_LOADING_CONSENT_LEVEL;
|
|
2718
2720
|
if (required_consent_level !== undefined) return true; // just in case
|
|
2719
|
-
const ipns = process.env.CONSENT_FRAMEWORK == "optanon" ?
|
|
2721
|
+
const ipns = process.env.CONSENT_FRAMEWORK == "optanon" ? $d4217f56717a3207$export$7e4427e80d5fc619() : $be5f485da4e3f813$export$8827362e5e938d26();
|
|
2720
2722
|
for (var _len = arguments.length, stuff_to_log = new Array(_len), _key = 0; _key < _len; _key++) stuff_to_log[_key] = arguments[_key];
|
|
2721
2723
|
for await (const consent_obj of ipns) {
|
|
2722
2724
|
const can_send = consent_obj[required_consent_level];
|
|
2723
|
-
if (!can_send)
|
|
2725
|
+
if (!can_send) $241f2f02cc612a49$export$de56f1198d121036("Got no consent for", required_consent_level, "not sending gtag event for", ...stuff_to_log);
|
|
2724
2726
|
return can_send;
|
|
2725
2727
|
}
|
|
2726
2728
|
}
|
|
2727
2729
|
let $1013f2e568f87406$var$existing_style_tag;
|
|
2728
2730
|
let $1013f2e568f87406$var$reactions_in_last_s = 0;
|
|
2729
|
-
const $1013f2e568f87406$export$59ba1eb2c083f0cd = /*@__PURE__
|
|
2731
|
+
const $1013f2e568f87406$export$59ba1eb2c083f0cd = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(async css => {
|
|
2730
2732
|
const style_tag = await ($1013f2e568f87406$var$existing_style_tag || ($1013f2e568f87406$var$existing_style_tag = (0, $90fa633a9564f115$export$b6ae1bc530f4c149).wait_for_element("head").then(head => {
|
|
2731
2733
|
const tag = document.createElement("style");
|
|
2732
2734
|
(0, $90fa633a9564f115$export$b6ae1bc530f4c149).onremoved(
|
|
@@ -2736,16 +2738,16 @@ const $1013f2e568f87406$export$59ba1eb2c083f0cd = /*@__PURE__*/(0, $5e1f45affc1d
|
|
|
2736
2738
|
// just make sure to not freak out if it's already been added again
|
|
2737
2739
|
return;
|
|
2738
2740
|
if ($1013f2e568f87406$var$reactions_in_last_s >= 10) {
|
|
2739
|
-
|
|
2741
|
+
$5e1f45affc1d7def$export$f18d5b0af29128b7(new Error("Someone removed our styling but insists on it (10 removals in previous second). Giving up \uD83D\uDE2B"), "error");
|
|
2740
2742
|
return;
|
|
2741
2743
|
}
|
|
2742
|
-
|
|
2744
|
+
$241f2f02cc612a49$export$de56f1198d121036("Someone removed our styling \uD83D\uDE24, reinserting", eoe);
|
|
2743
2745
|
$1013f2e568f87406$var$reactions_in_last_s++;
|
|
2744
2746
|
setTimeout(() => $1013f2e568f87406$var$reactions_in_last_s--, 1000);
|
|
2745
2747
|
document.head.append(tag); // we're sure that head exists now since we inserted it there previously
|
|
2746
2748
|
});
|
|
2747
2749
|
|
|
2748
|
-
|
|
2750
|
+
$241f2f02cc612a49$export$de56f1198d121036("inserting", tag, "into", head);
|
|
2749
2751
|
return head.appendChild(tag);
|
|
2750
2752
|
})));
|
|
2751
2753
|
style_tag.append(css);
|
|
@@ -2755,10 +2757,10 @@ const $1013f2e568f87406$export$a96c18473f2af463 = (tenant, selector, validator)
|
|
|
2755
2757
|
let {
|
|
2756
2758
|
element: element
|
|
2757
2759
|
} = _ref;
|
|
2758
|
-
return
|
|
2760
|
+
return $bd7c9f254946941d$export$2c34560c3749dc63(element, tenant.get_product_id, (p_id, r_id, was_unmatching, event) => {
|
|
2759
2761
|
if (typeof validator === "function" && !validator(event)) return;
|
|
2760
|
-
if (!was_unmatching)
|
|
2761
|
-
|
|
2762
|
+
if (!was_unmatching) $3674b9afc9a63520$export$bf205937e5e012cb();
|
|
2763
|
+
$d5f7352b58e0d737$export$9028351cb994757e({
|
|
2762
2764
|
...tenant,
|
|
2763
2765
|
product_id: p_id,
|
|
2764
2766
|
...(was_unmatching ? {
|
|
@@ -2777,11 +2779,11 @@ const $1013f2e568f87406$export$a4f97b27a0592e6c = url => {
|
|
|
2777
2779
|
const $1013f2e568f87406$export$692b606677218a16 = callback => {
|
|
2778
2780
|
if (document.depictwashere) {
|
|
2779
2781
|
if (process.env.BUILD_TARGET === "dev") {
|
|
2780
|
-
|
|
2782
|
+
$241f2f02cc612a49$export$de56f1198d121036("HMR tried to rerun us, reloading page");
|
|
2781
2783
|
/* eslint-disable no-self-assign */
|
|
2782
2784
|
location.href = location.href;
|
|
2783
2785
|
}
|
|
2784
|
-
|
|
2786
|
+
$241f2f02cc612a49$export$de56f1198d121036("Script has already ran", document.currentScript, "is exiting");
|
|
2785
2787
|
return;
|
|
2786
2788
|
}
|
|
2787
2789
|
if (process.env.BUILD_TARGET === "dev") /* eslint-disable no-console */console.clear = new Proxy(console.clear, {
|
|
@@ -2804,26 +2806,26 @@ function $1013f2e568f87406$export$328e81c44cddf3c0(callback, get_market, support
|
|
|
2804
2806
|
let localstorage_override;
|
|
2805
2807
|
const query_param_override = new URLSearchParams(location.search).get("depict-override-market");
|
|
2806
2808
|
if (query_param_override !== null) {
|
|
2807
|
-
|
|
2809
|
+
$241f2f02cc612a49$export$de56f1198d121036("Found ?depict-override-market=".concat(query_param_override, ". Using that as the market"));
|
|
2808
2810
|
get_market = () => query_param_override;
|
|
2809
2811
|
localStorage.setItem("depict-override-market", query_param_override);
|
|
2810
2812
|
} else if ((localstorage_override = localStorage.getItem("depict-override-market")) !== null) {
|
|
2811
|
-
|
|
2813
|
+
$241f2f02cc612a49$export$de56f1198d121036('Found depict-override-market="'.concat(localstorage_override, '" in localStorage. Using that as the market'));
|
|
2812
2814
|
get_market = () => localstorage_override;
|
|
2813
2815
|
}
|
|
2814
2816
|
}
|
|
2815
2817
|
const market = await get_market();
|
|
2816
2818
|
if (supported_markets.includes(market)) {
|
|
2817
|
-
|
|
2819
|
+
$241f2f02cc612a49$export$de56f1198d121036("Initializing with market: ".concat(market));
|
|
2818
2820
|
return callback(market).catch((0, $b000f5ef6ce456d9$export$8048b892d651b310));
|
|
2819
2821
|
} else if (unsupported_markets.includes(market)) {
|
|
2820
|
-
|
|
2822
|
+
$241f2f02cc612a49$export$de56f1198d121036("Unsupported market: ".concat(market, ". Exiting..."));
|
|
2821
2823
|
return;
|
|
2822
2824
|
} else if (process.env.DEBUG === "true" && location.host.endsWith(".demo.depict.ai") && preferred_demo_market) {
|
|
2823
|
-
|
|
2825
|
+
$241f2f02cc612a49$export$de56f1198d121036("On demosite with default market override. Setting market to ".concat(preferred_demo_market));
|
|
2824
2826
|
return callback(preferred_demo_market).catch((0, $b000f5ef6ce456d9$export$8048b892d651b310));
|
|
2825
2827
|
} else {
|
|
2826
|
-
|
|
2828
|
+
$b000f5ef6ce456d9$export$8048b892d651b310(new Error('Unknown market: "'.concat(market, '". Exiting...')));
|
|
2827
2829
|
return;
|
|
2828
2830
|
}
|
|
2829
2831
|
});
|
|
@@ -2844,9 +2846,9 @@ class $095a7d035ba7d7a7$export$8d42ce4827f43582 {
|
|
|
2844
2846
|
this.TYPE = options.TYPE || "normal";
|
|
2845
2847
|
this.catchify = (0, $5e1f45affc1d7def$export$b3bbfd758f11cfa9);
|
|
2846
2848
|
this.err = (0, $b000f5ef6ce456d9$export$8048b892d651b310);
|
|
2847
|
-
if (this.GA_ID)
|
|
2849
|
+
if (this.GA_ID) $3674b9afc9a63520$export$ac7296527cb52311(this.GA_ID);
|
|
2848
2850
|
// https://gitlab.com/depict-ai/depict.ai/-/merge_requests/2318#note_927887712
|
|
2849
|
-
this.get_product_id =
|
|
2851
|
+
this.get_product_id = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(function () {
|
|
2850
2852
|
const id = options.get_product_id(...arguments);
|
|
2851
2853
|
if (id instanceof Promise) return id.then(id => id || "");
|
|
2852
2854
|
return id || "";
|
|
@@ -2858,9 +2860,9 @@ class $095a7d035ba7d7a7$export$8d42ce4827f43582 {
|
|
|
2858
2860
|
this.type = this.TYPE;
|
|
2859
2861
|
this.catchify = (0, $5e1f45affc1d7def$export$b3bbfd758f11cfa9);
|
|
2860
2862
|
this.err = (0, $b000f5ef6ce456d9$export$8048b892d651b310);
|
|
2861
|
-
if (localStorage.getItem("highlight-depict") === "true")
|
|
2863
|
+
if (localStorage.getItem("highlight-depict") === "true") $1013f2e568f87406$export$59ba1eb2c083f0cd(".depict { background: #f00a !important; }");
|
|
2862
2864
|
if ((_options$pageview_tra = options.pageview_tracking) !== null && _options$pageview_tra !== void 0 ? _options$pageview_tra : true) (async () => {
|
|
2863
|
-
|
|
2865
|
+
$0897f35c3b3fbbc4$export$f7cb1bd47199ec38({
|
|
2864
2866
|
market: this.market,
|
|
2865
2867
|
tenant: this.tenant,
|
|
2866
2868
|
get_product_id: this.get_product_id
|
|
@@ -2887,7 +2889,7 @@ const $f2fce07b3a330e05$var$get_index_in_children_of_el = el => {
|
|
|
2887
2889
|
var _el$parentElement;
|
|
2888
2890
|
return [...((el === null || el === void 0 ? void 0 : (_el$parentElement = el.parentElement) === null || _el$parentElement === void 0 ? void 0 : _el$parentElement.children) || [])].indexOf(el);
|
|
2889
2891
|
};
|
|
2890
|
-
const $f2fce07b3a330e05$export$29a6094e0bd8bc5f = /*@__PURE__
|
|
2892
|
+
const $f2fce07b3a330e05$export$29a6094e0bd8bc5f = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(async (options, gtag_options) => {
|
|
2891
2893
|
var _options$t;
|
|
2892
2894
|
const {
|
|
2893
2895
|
product_selector: product_selector,
|
|
@@ -2924,14 +2926,14 @@ const $f2fce07b3a330e05$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $5e1f45affc1d
|
|
|
2924
2926
|
const gtag_view_product_ids = {};
|
|
2925
2927
|
// Page view
|
|
2926
2928
|
if (t instanceof (0, $095a7d035ba7d7a7$export$8d42ce4827f43582)) (async () => {
|
|
2927
|
-
|
|
2929
|
+
$0897f35c3b3fbbc4$export$eee4c4d924348b05({
|
|
2928
2930
|
tenant: t.tenant,
|
|
2929
2931
|
market: t.market,
|
|
2930
2932
|
product_id: await t.get_product_id()
|
|
2931
2933
|
});
|
|
2932
2934
|
})();
|
|
2933
2935
|
// Product card
|
|
2934
|
-
const add_tracking_to_product_card =
|
|
2936
|
+
const add_tracking_to_product_card = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(async _ref => {
|
|
2935
2937
|
var _Object$keys;
|
|
2936
2938
|
let {
|
|
2937
2939
|
element: elem
|
|
@@ -2943,7 +2945,7 @@ const $f2fce07b3a330e05$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $5e1f45affc1d
|
|
|
2943
2945
|
// Impression tracking
|
|
2944
2946
|
if (impression_tracking && !impression_tracked_els.has(elem)) {
|
|
2945
2947
|
impression_tracked_els.add(elem);
|
|
2946
|
-
|
|
2948
|
+
$e89a1d249db21af0$export$37125ccc5dd98050({
|
|
2947
2949
|
element: elem,
|
|
2948
2950
|
data: {
|
|
2949
2951
|
recommendation_id: data.recommendation_id,
|
|
@@ -2976,12 +2978,12 @@ const $f2fce07b3a330e05$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $5e1f45affc1d
|
|
|
2976
2978
|
index: index
|
|
2977
2979
|
})));
|
|
2978
2980
|
} catch (e) {
|
|
2979
|
-
|
|
2981
|
+
$241f2f02cc612a49$export$c2363754d4758444("Something went wrong on a product with multiple ga_ids", e);
|
|
2980
2982
|
}
|
|
2981
2983
|
}
|
|
2982
2984
|
if (typeof BroadcastChannel == "function") {
|
|
2983
2985
|
// right click and mouse wheel click tracking
|
|
2984
|
-
const handler =
|
|
2986
|
+
const handler = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(e => $df87ac5a30f7baac$export$8f66c4c7fb96eda2(e, data.product_id));
|
|
2985
2987
|
elem.addEventListener("contextmenu", handler);
|
|
2986
2988
|
elem.addEventListener("auxclick", e => e.button === 1 && handler(e)); // actual wheel click - some mouses / OS:es also dispatch auxclick on rightclick
|
|
2987
2989
|
}
|
|
@@ -2989,14 +2991,14 @@ const $f2fce07b3a330e05$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $5e1f45affc1d
|
|
|
2989
2991
|
click_tracking: {
|
|
2990
2992
|
if (click_tracked_els.has(elem)) break click_tracking;
|
|
2991
2993
|
click_tracked_els.add(elem);
|
|
2992
|
-
elem.addEventListener("click",
|
|
2994
|
+
elem.addEventListener("click", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => {
|
|
2993
2995
|
const product_id = data.product_id || "DNT";
|
|
2994
2996
|
const recommendation_id = data.recommendation_id || "not_depict";
|
|
2995
2997
|
localStorage.setItem("depict_attribution_".concat(product_id), recommendation_id);
|
|
2996
2998
|
const index = $f2fce07b3a330e05$var$get_index_in_children_of_el(elem);
|
|
2997
2999
|
const click_location = prefix + (index + 1);
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
+
$3674b9afc9a63520$export$127751e82111fcf();
|
|
3001
|
+
$d5f7352b58e0d737$export$15f8a0cd5a8c0ebb({
|
|
3000
3002
|
...(options.t || {}),
|
|
3001
3003
|
...options,
|
|
3002
3004
|
...data,
|
|
@@ -3010,7 +3012,7 @@ const $f2fce07b3a330e05$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $5e1f45affc1d
|
|
|
3010
3012
|
list_name: gtag_list_name,
|
|
3011
3013
|
...gtag_options
|
|
3012
3014
|
};
|
|
3013
|
-
|
|
3015
|
+
$3674b9afc9a63520$export$f522672c9379e339(data.product_id, index, gtag_options_with_click_location);
|
|
3014
3016
|
try {
|
|
3015
3017
|
const to_iterate = [];
|
|
3016
3018
|
if (data.ga_product_id) {
|
|
@@ -3018,10 +3020,10 @@ const $f2fce07b3a330e05$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $5e1f45affc1d
|
|
|
3018
3020
|
to_iterate.push(...((_data$ga_product_id$t = (_data$ga_product_id$t2 = (_data$ga_product_id = data.ga_product_id).toString) === null || _data$ga_product_id$t2 === void 0 ? void 0 : _data$ga_product_id$t2.call(_data$ga_product_id).split(",")) !== null && _data$ga_product_id$t !== void 0 ? _data$ga_product_id$t : []));
|
|
3019
3021
|
}
|
|
3020
3022
|
to_iterate.push(...(data.ga_product_ids || []));
|
|
3021
|
-
to_iterate.forEach(id =>
|
|
3023
|
+
to_iterate.forEach(id => $3674b9afc9a63520$export$f522672c9379e339(id, index, gtag_options_with_click_location));
|
|
3022
3024
|
} catch (e) {
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
+
$241f2f02cc612a49$export$c2363754d4758444("Something went wrong when sending gtag click tracking on a product with multiple ga_ids");
|
|
3026
|
+
$5e1f45affc1d7def$export$f18d5b0af29128b7(e, "error");
|
|
3025
3027
|
}
|
|
3026
3028
|
}
|
|
3027
3029
|
}), {
|
|
@@ -3051,8 +3053,8 @@ const $f2fce07b3a330e05$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $5e1f45affc1d
|
|
|
3051
3053
|
});
|
|
3052
3054
|
element.dispatchEvent(click);
|
|
3053
3055
|
}
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
+
$3674b9afc9a63520$export$bf205937e5e012cb();
|
|
3057
|
+
$d5f7352b58e0d737$export$9028351cb994757e({
|
|
3056
3058
|
...(options.t || {}),
|
|
3057
3059
|
...options,
|
|
3058
3060
|
...data
|
|
@@ -3065,11 +3067,11 @@ const $f2fce07b3a330e05$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $5e1f45affc1d
|
|
|
3065
3067
|
if (options.shade) $f2fce07b3a330e05$export$6ebd242c09192cec(elem);
|
|
3066
3068
|
if (options.attempt_gtag_view_tracking && (_Object$keys = Object.keys(gtag_view_product_ids)) !== null && _Object$keys !== void 0 && _Object$keys.length)
|
|
3067
3069
|
// setTimeout to batch the requests / put it all into one gtag view event
|
|
3068
|
-
setTimeout(
|
|
3070
|
+
setTimeout($5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => {
|
|
3069
3071
|
for (const key in gtag_view_product_ids) {
|
|
3070
3072
|
const product_ids = gtag_view_product_ids[key];
|
|
3071
3073
|
if (product_ids !== null && product_ids !== void 0 && product_ids.length) {
|
|
3072
|
-
|
|
3074
|
+
$3674b9afc9a63520$export$7babcd5d4056b2ca(product_ids, () => "", {
|
|
3073
3075
|
list_name: key,
|
|
3074
3076
|
...gtag_options
|
|
3075
3077
|
});
|
|
@@ -3080,15 +3082,15 @@ const $f2fce07b3a330e05$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $5e1f45affc1d
|
|
|
3080
3082
|
});
|
|
3081
3083
|
if (typeof product_selector == "string") (0, $90fa633a9564f115$export$b6ae1bc530f4c149).onexists(product_selector, add_tracking_to_product_card);else if (product_elements && typeof (product_elements === null || product_elements === void 0 ? void 0 : product_elements[Symbol.iterator]) == "function") for (const element of product_elements) add_tracking_to_product_card({
|
|
3082
3084
|
element: element
|
|
3083
|
-
});else
|
|
3085
|
+
});else $241f2f02cc612a49$export$c2363754d4758444(new Error("AIO can't find elements, try adding a selector or els")); // don't throw so that a2c tracking keeps working
|
|
3084
3086
|
// Page A2C button tracking
|
|
3085
3087
|
const a2c_handler = _ref2 => {
|
|
3086
3088
|
let {
|
|
3087
3089
|
element: element
|
|
3088
3090
|
} = _ref2;
|
|
3089
|
-
|
|
3090
|
-
if (!was_unmatching)
|
|
3091
|
-
|
|
3091
|
+
$bd7c9f254946941d$export$2c34560c3749dc63(element, get_product_id, (product_id, recommendation_id, was_unmatching) => {
|
|
3092
|
+
if (!was_unmatching) $3674b9afc9a63520$export$bf205937e5e012cb();
|
|
3093
|
+
$d5f7352b58e0d737$export$9028351cb994757e({
|
|
3092
3094
|
...(options.t || {}),
|
|
3093
3095
|
...options,
|
|
3094
3096
|
product_id: product_id,
|
|
@@ -3103,7 +3105,7 @@ const $f2fce07b3a330e05$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $5e1f45affc1d
|
|
|
3103
3105
|
};
|
|
3104
3106
|
if (typeof a2c_selector == "string") (0, $90fa633a9564f115$export$b6ae1bc530f4c149).onexists(a2c_selector, a2c_handler);else if (a2c_elements && typeof (a2c_elements === null || a2c_elements === void 0 ? void 0 : a2c_elements[Symbol.iterator]) == "function") for (const element of a2c_elements) a2c_handler({
|
|
3105
3107
|
element: element
|
|
3106
|
-
});else
|
|
3108
|
+
});else $241f2f02cc612a49$export$c2363754d4758444(new Error("Can't find a2c button, try adding a selector or els"));
|
|
3107
3109
|
return {
|
|
3108
3110
|
add_a2c_element: element => a2c_handler({
|
|
3109
3111
|
element: element
|
|
@@ -3113,7 +3115,7 @@ const $f2fce07b3a330e05$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $5e1f45affc1d
|
|
|
3113
3115
|
})
|
|
3114
3116
|
};
|
|
3115
3117
|
});
|
|
3116
|
-
const $f2fce07b3a330e05$export$6ebd242c09192cec = /*@__PURE__
|
|
3118
|
+
const $f2fce07b3a330e05$export$6ebd242c09192cec = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(element => {
|
|
3117
3119
|
element.style.boxShadow = "rgba(255,0,0,0.5) 10px 10px 30px 40px";
|
|
3118
3120
|
element.style.background = "rgba(255,0,0,0.5)";
|
|
3119
3121
|
element.style.color = "white";
|
|
@@ -3163,18 +3165,18 @@ async function $c95f8181bad32e8d$export$bcd70d5ed1cf6313(url, options) {
|
|
|
3163
3165
|
const response = await fetch(url, options);
|
|
3164
3166
|
if (!response || !response.ok || response.status !== 200) {
|
|
3165
3167
|
if (response.status === 422) {
|
|
3166
|
-
|
|
3168
|
+
$5e1f45affc1d7def$export$b3bbfd758f11cfa9($c95f8181bad32e8d$var$send_sentry_422)(response, (options === null || options === void 0 ? void 0 : options.body) || {}, stack);
|
|
3167
3169
|
has_succeeded = true;
|
|
3168
3170
|
} else if (response.status === 404) has_succeeded = true;
|
|
3169
|
-
|
|
3171
|
+
$241f2f02cc612a49$export$de56f1198d121036("Response not ok", response);
|
|
3170
3172
|
} else has_succeeded = true;
|
|
3171
3173
|
result = response;
|
|
3172
3174
|
} catch (error) {
|
|
3173
|
-
|
|
3175
|
+
$241f2f02cc612a49$export$de56f1198d121036("Error while fetching: ", error, url, options);
|
|
3174
3176
|
// Don't retry CORS
|
|
3175
3177
|
if (error.message.includes("CORS") && error.name.includes("CORS")) has_succeeded = true;
|
|
3176
3178
|
} finally {
|
|
3177
|
-
if (!has_succeeded) await
|
|
3179
|
+
if (!has_succeeded) await $57642e3bf93ac1e7$export$5c069c93d2b7493f(try_again_in_ms);
|
|
3178
3180
|
try_again_in_ms = calculate_retry(try_again_in_ms);
|
|
3179
3181
|
max_retries -= 1;
|
|
3180
3182
|
}
|
|
@@ -3183,12 +3185,12 @@ async function $c95f8181bad32e8d$export$bcd70d5ed1cf6313(url, options) {
|
|
|
3183
3185
|
async function $c95f8181bad32e8d$var$send_sentry_422(response, body, stack) {
|
|
3184
3186
|
const msg = "Validation error: got 422 from API";
|
|
3185
3187
|
const text = await response.clone().text();
|
|
3186
|
-
|
|
3188
|
+
$241f2f02cc612a49$export$de56f1198d121036(msg, "body", body, "response", response, "text", text, "stack", stack);
|
|
3187
3189
|
(0, $17bb552dedcd526c$export$af2e17a20c2ea3c5).withScope(function (scope) {
|
|
3188
3190
|
scope.setExtra("stack", stack);
|
|
3189
3191
|
scope.setExtra("request_body", body);
|
|
3190
3192
|
scope.setExtra("response", response);
|
|
3191
|
-
scope.setExtra("serialized_response",
|
|
3193
|
+
scope.setExtra("serialized_response", $d9aec442b12a1134$export$39d526a1194b6499(response));
|
|
3192
3194
|
scope.setExtra("response_text", text);
|
|
3193
3195
|
scope.setLevel("error");
|
|
3194
3196
|
this.captureException(new Error(msg));
|
|
@@ -3201,8 +3203,8 @@ async function $51dfcecbe05cc4e5$export$1bc0df10745d5412(t, options, headers) {
|
|
|
3201
3203
|
}
|
|
3202
3204
|
async function $51dfcecbe05cc4e5$export$d40679eb4cf32f09(t, options, headers) {
|
|
3203
3205
|
let get_url = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : $51dfcecbe05cc4e5$var$default_get_fetch_url;
|
|
3204
|
-
const dsid =
|
|
3205
|
-
const session_id = options.session_id ||
|
|
3206
|
+
const dsid = $d5f7352b58e0d737$export$6399bdb2291895e0();
|
|
3207
|
+
const session_id = options.session_id || $d5f7352b58e0d737$export$61e7e1f11e96692f();
|
|
3206
3208
|
const user_id = options.user_id || dsid;
|
|
3207
3209
|
const body = {
|
|
3208
3210
|
tenant: t.tenant,
|
|
@@ -3214,17 +3216,17 @@ async function $51dfcecbe05cc4e5$export$d40679eb4cf32f09(t, options, headers) {
|
|
|
3214
3216
|
...options
|
|
3215
3217
|
};
|
|
3216
3218
|
const endpoint = $51dfcecbe05cc4e5$var$get_fetch_endpoint_from_options(options);
|
|
3217
|
-
return await
|
|
3219
|
+
return await $c95f8181bad32e8d$export$bcd70d5ed1cf6313(get_url(endpoint), {
|
|
3218
3220
|
body: JSON.stringify(body),
|
|
3219
3221
|
...(headers ? {
|
|
3220
3222
|
headers: headers
|
|
3221
3223
|
} : {}),
|
|
3222
3224
|
method: "POST"
|
|
3223
3225
|
}) // @ts-ignore
|
|
3224
|
-
.then(r => r.json()).catch(e =>
|
|
3226
|
+
.then(r => r.json()).catch(e => $241f2f02cc612a49$export$de56f1198d121036("fetch_retry threw", e));
|
|
3225
3227
|
}
|
|
3226
3228
|
function $51dfcecbe05cc4e5$var$default_get_fetch_url(type) {
|
|
3227
|
-
return
|
|
3229
|
+
return $ea5707b8e7b350cf$export$fe609f0216e4ebef("".concat((0, $9e4bee2e3b4b5753$export$362abebb4b313340), "/v2/recommend/products/").concat(type));
|
|
3228
3230
|
}
|
|
3229
3231
|
function $51dfcecbe05cc4e5$var$get_fetch_endpoint_from_options(options) {
|
|
3230
3232
|
if (options["category_id"] !== undefined) return "category";else if (options["product_id"] !== undefined) return "product";else if (options["product_ids"] !== undefined) return "products";
|
|
@@ -3238,7 +3240,7 @@ async function $378c98788ab52b9c$export$a9fc160c5ed83bd7(t, rendering_options) {
|
|
|
3238
3240
|
} = rendering_options;
|
|
3239
3241
|
const displays = await $378c98788ab52b9c$var$make_sure_we_have_displays(t, rendering_options);
|
|
3240
3242
|
if (!(displays !== null && displays !== void 0 && displays.length)) {
|
|
3241
|
-
|
|
3243
|
+
$241f2f02cc612a49$export$de56f1198d121036("RR: Got no displays for type " + type + ", can't recover.", t, rendering_options);
|
|
3242
3244
|
return {};
|
|
3243
3245
|
}
|
|
3244
3246
|
// return if too few displays
|
|
@@ -3249,19 +3251,19 @@ async function $378c98788ab52b9c$export$a9fc160c5ed83bd7(t, rendering_options) {
|
|
|
3249
3251
|
if (!good_displays) return {};
|
|
3250
3252
|
const processed_displays = await $378c98788ab52b9c$export$c22e610107c5a15a(t, rendering_options, displays);
|
|
3251
3253
|
if (!processed_displays.length) {
|
|
3252
|
-
|
|
3254
|
+
$241f2f02cc612a49$export$de56f1198d121036("RR: No displays left after preprocessing");
|
|
3253
3255
|
return {};
|
|
3254
3256
|
}
|
|
3255
3257
|
const {
|
|
3256
3258
|
template: template,
|
|
3257
3259
|
post_processors = []
|
|
3258
3260
|
} = rendering_options;
|
|
3259
|
-
const caught_post_processing_functions = post_processors.map(post_pro =>
|
|
3261
|
+
const caught_post_processing_functions = post_processors.map(post_pro => $5e1f45affc1d7def$export$b3bbfd758f11cfa9(post_pro));
|
|
3260
3262
|
let a;
|
|
3261
|
-
const caught_html2elems =
|
|
3263
|
+
const caught_html2elems = $5e1f45affc1d7def$export$b3bbfd758f11cfa9((0, $652300c6621d5500$export$44951404cb8d0583));
|
|
3262
3264
|
let output_elements;
|
|
3263
3265
|
if (typeof template === "function") {
|
|
3264
|
-
const caught_template =
|
|
3266
|
+
const caught_template = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(template);
|
|
3265
3267
|
output_elements = (await Promise.allSettled(processed_displays.map(async (display, index) => {
|
|
3266
3268
|
const event_listeners = [];
|
|
3267
3269
|
let keep = true;
|
|
@@ -3282,7 +3284,7 @@ async function $378c98788ab52b9c$export$a9fc160c5ed83bd7(t, rendering_options) {
|
|
|
3282
3284
|
return Array.from(post_processed_elements);
|
|
3283
3285
|
}))).flat();
|
|
3284
3286
|
if (!output_elements.length) {
|
|
3285
|
-
|
|
3287
|
+
$241f2f02cc612a49$export$de56f1198d121036("RR: No displays left after postprocessing/rendering");
|
|
3286
3288
|
return {};
|
|
3287
3289
|
}
|
|
3288
3290
|
return {
|
|
@@ -3349,7 +3351,7 @@ async function $378c98788ab52b9c$export$c22e610107c5a15a(t, rendering_options, d
|
|
|
3349
3351
|
max_items: max_items,
|
|
3350
3352
|
pre_processors = []
|
|
3351
3353
|
} = rendering_options;
|
|
3352
|
-
const caught_pre_processors = pre_processors.map(pre_pro =>
|
|
3354
|
+
const caught_pre_processors = pre_processors.map(pre_pro => $5e1f45affc1d7def$export$b3bbfd758f11cfa9(pre_pro));
|
|
3353
3355
|
const processed_displays = [];
|
|
3354
3356
|
for (let i = 0; i < displays.length; i++) {
|
|
3355
3357
|
// classic for loop is both fast and can be stopped with break
|
|
@@ -3388,7 +3390,7 @@ class $378c98788ab52b9c$export$da854280fb61cd32 {
|
|
|
3388
3390
|
async function $378c98788ab52b9c$var$check_displays(displays, min_items_to_run) {
|
|
3389
3391
|
// don't run if too few recs
|
|
3390
3392
|
if (min_items_to_run && displays.length < min_items_to_run) {
|
|
3391
|
-
|
|
3393
|
+
$241f2f02cc612a49$export$de56f1198d121036("RR: Got too few displays, exiting");
|
|
3392
3394
|
return false;
|
|
3393
3395
|
}
|
|
3394
3396
|
return true;
|
|
@@ -3405,7 +3407,7 @@ async function $378c98788ab52b9c$var$make_sure_we_have_displays(t, rendering_opt
|
|
|
3405
3407
|
...(rendering_options.extra_api_options || {})
|
|
3406
3408
|
};
|
|
3407
3409
|
for (const key of ["product_ids", "category_id", "product_id"]) if (key in rendering_options) get_displays_options[key] = rendering_options[key];
|
|
3408
|
-
return await
|
|
3410
|
+
return await $51dfcecbe05cc4e5$export$1bc0df10745d5412(t, get_displays_options, rendering_options.headers || {}).catch(t.err);
|
|
3409
3411
|
}
|
|
3410
3412
|
async function $ddeca43328b507f6$export$c83d8da642b5104a(t, options, GWVM_opts) {
|
|
3411
3413
|
const {
|
|
@@ -3425,8 +3427,8 @@ async function $ddeca43328b507f6$export$c83d8da642b5104a(t, options, GWVM_opts)
|
|
|
3425
3427
|
only_full_rows = false,
|
|
3426
3428
|
should_preload = true
|
|
3427
3429
|
} = GWVM_opts;
|
|
3428
|
-
const outer_els = typeof container_template === "string" ? [
|
|
3429
|
-
const [root] =
|
|
3430
|
+
const outer_els = typeof container_template === "string" ? [...$652300c6621d5500$export$44951404cb8d0583(container_template)] : container_template;
|
|
3431
|
+
const [root] = $652300c6621d5500$export$5e63aea0cac01fa0(outer_els, container_selector);
|
|
3430
3432
|
const cut_off_promise_obj = /*@__PURE__*/new (0, $4c6e595091defcd9$export$32ccf3a614c84258)();
|
|
3431
3433
|
const i_observer = new IntersectionObserver(catchify($ddeca43328b507f6$var$observer_callback));
|
|
3432
3434
|
let cut_off_point = 0;
|
|
@@ -3469,8 +3471,8 @@ async function $ddeca43328b507f6$export$c83d8da642b5104a(t, options, GWVM_opts)
|
|
|
3469
3471
|
return rendering_results;
|
|
3470
3472
|
}
|
|
3471
3473
|
root.append(...rendered_elements);
|
|
3472
|
-
const load_more_cont =
|
|
3473
|
-
const button_element = button instanceof Element ? button :
|
|
3474
|
+
const load_more_cont = $652300c6621d5500$export$d3e2a0560cbf4787('<div class="load-more-container"></div>');
|
|
3475
|
+
const button_element = button instanceof Element ? button : $652300c6621d5500$export$d3e2a0560cbf4787('<button class="load_more">'.concat(button || "Visa mer", "</button>"));
|
|
3474
3476
|
button_element.addEventListener("click", load_more);
|
|
3475
3477
|
load_more_cont.append(button_element);
|
|
3476
3478
|
root.after(load_more_cont);
|
|
@@ -3491,7 +3493,7 @@ async function $ddeca43328b507f6$export$c83d8da642b5104a(t, options, GWVM_opts)
|
|
|
3491
3493
|
load_more_observer.observe(load_more_cont);
|
|
3492
3494
|
}
|
|
3493
3495
|
if (title) {
|
|
3494
|
-
const [title_el] =
|
|
3496
|
+
const [title_el] = $652300c6621d5500$export$5e63aea0cac01fa0(outer_els, title_selector || "h1.title");
|
|
3495
3497
|
if (title_el) {
|
|
3496
3498
|
if (title instanceof Element) title_el.replaceWith(title);else title_el.innerText = title;
|
|
3497
3499
|
} else if (is_debug) {
|
|
@@ -3532,7 +3534,7 @@ info, cut_off_point, i_observer, cut_off_promise_obj, load_more) {
|
|
|
3532
3534
|
const extras = info.extras || (info.extras = {});
|
|
3533
3535
|
extras.load_more || (extras.load_more = load_more);
|
|
3534
3536
|
extras.load_more_ipo || (extras.load_more_ipo = cut_off_promise_obj);
|
|
3535
|
-
|
|
3537
|
+
$652300c6621d5500$export$5e63aea0cac01fa0(elements_arr, "img:not(.filler):not(.ngl):not(.nolazy)").forEach(image => {
|
|
3536
3538
|
var _image$src, _image$dataset, _image$src2, _image$src2$substr;
|
|
3537
3539
|
// "img" also selects "image" in IE11 which can be an SVG element which doesn't have a src property, therefore optional chaining
|
|
3538
3540
|
if ((image !== null && image !== void 0 && (_image$src = image.src) !== null && _image$src !== void 0 && _image$src.length || image !== null && image !== void 0 && (_image$dataset = image.dataset) !== null && _image$dataset !== void 0 && _image$dataset.src) && (image === null || image === void 0 ? void 0 : (_image$src2 = image.src) === null || _image$src2 === void 0 ? void 0 : (_image$src2$substr = _image$src2.substr) === null || _image$src2$substr === void 0 ? void 0 : _image$src2$substr.call(_image$src2, 0, 6)) != "data:") {
|
|
@@ -3598,7 +3600,7 @@ async function $a496a9038b9c02cf$export$41de2959a8dd405d(t, options, GWVM_opts)
|
|
|
3598
3600
|
if (!parentElement) {
|
|
3599
3601
|
var _result2, _rec;
|
|
3600
3602
|
// first rec was removed
|
|
3601
|
-
[rec] =
|
|
3603
|
+
[rec] = $652300c6621d5500$export$5e63aea0cac01fa0(((_result2 = result) === null || _result2 === void 0 ? void 0 : _result2.elements) || [], rec_selector);
|
|
3602
3604
|
parentElement = (_rec = rec) === null || _rec === void 0 ? void 0 : _rec.parentElement;
|
|
3603
3605
|
if (!parentElement) throw new Error("Could not find element matching " + rec_selector + "to calculate width");
|
|
3604
3606
|
}
|
|
@@ -3635,7 +3637,7 @@ async function $a496a9038b9c02cf$export$41de2959a8dd405d(t, options, GWVM_opts)
|
|
|
3635
3637
|
}
|
|
3636
3638
|
};
|
|
3637
3639
|
// @ts-ignore
|
|
3638
|
-
result = await
|
|
3640
|
+
result = await $ddeca43328b507f6$export$c83d8da642b5104a(t, options, modified_GWVM_opts);
|
|
3639
3641
|
if (!((_result4 = result) !== null && _result4 !== void 0 && _result4.elements))
|
|
3640
3642
|
// no chance in finding any elements, API didn't return recs
|
|
3641
3643
|
return result;
|
|
@@ -3700,28 +3702,28 @@ async function $d3b90d5099bf2925$export$c0a4d29bc45a38c6(t, options, GWVM_opts)
|
|
|
3700
3702
|
$d3b90d5099bf2925$var$observe_first_el_after_dominsertion(all_rendered_elements, elements, info.extras.load_more);
|
|
3701
3703
|
return elements;
|
|
3702
3704
|
}];
|
|
3703
|
-
return await
|
|
3705
|
+
return await $a496a9038b9c02cf$export$41de2959a8dd405d(t, options, options_for_auto_gwvm, {
|
|
3704
3706
|
rec_selector: rec_selector
|
|
3705
3707
|
});
|
|
3706
3708
|
}
|
|
3707
3709
|
function $d3b90d5099bf2925$var$observe_first_el_after_dominsertion(all_rendered_elements, elements, load_more) {
|
|
3708
3710
|
const element = $d3b90d5099bf2925$var$find_html_element(elements);
|
|
3709
3711
|
if (!element) {
|
|
3710
|
-
|
|
3712
|
+
$241f2f02cc612a49$export$de56f1198d121036("Infinite scroll won't work, couldn't find element to observe", elements);
|
|
3711
3713
|
return;
|
|
3712
3714
|
}
|
|
3713
|
-
(0, $90fa633a9564f115$export$b6ae1bc530f4c149).wait_for_element(element).then(
|
|
3715
|
+
(0, $90fa633a9564f115$export$b6ae1bc530f4c149).wait_for_element(element).then($5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => {
|
|
3714
3716
|
$d3b90d5099bf2925$var$find_last_el_and_observe(all_rendered_elements, load_more);
|
|
3715
3717
|
}));
|
|
3716
3718
|
}
|
|
3717
3719
|
function $d3b90d5099bf2925$var$find_last_el_and_observe(all_rendered_elements, load_more) {
|
|
3718
3720
|
const last_visible_el = $d3b90d5099bf2925$var$find_last_visible(all_rendered_elements);
|
|
3719
3721
|
if (!last_visible_el) return;
|
|
3720
|
-
const i_o = new IntersectionObserver(
|
|
3722
|
+
const i_o = new IntersectionObserver($5e1f45affc1d7def$export$b3bbfd758f11cfa9(records => {
|
|
3721
3723
|
for (const record of records) if (record.isIntersecting) {
|
|
3722
|
-
|
|
3724
|
+
$241f2f02cc612a49$export$de56f1198d121036("loading more because of", record);
|
|
3723
3725
|
load_more();
|
|
3724
|
-
setTimeout(
|
|
3726
|
+
setTimeout($5e1f45affc1d7def$export$b3bbfd758f11cfa9($d3b90d5099bf2925$var$find_last_el_and_observe), 0, all_rendered_elements, load_more);
|
|
3725
3727
|
i_o.disconnect();
|
|
3726
3728
|
}
|
|
3727
3729
|
}));
|
|
@@ -3739,26 +3741,26 @@ function $d3b90d5099bf2925$var$find_last_visible(bunch_of_elements) {
|
|
|
3739
3741
|
for (let i = 0; i < considered_elements.length; i++) {
|
|
3740
3742
|
const respected_element = considered_elements[i];
|
|
3741
3743
|
if (!respected_element) {
|
|
3742
|
-
|
|
3744
|
+
$241f2f02cc612a49$export$de56f1198d121036("Infinite scroll error: couldn't find last visible element", bunch_of_elements);
|
|
3743
3745
|
return;
|
|
3744
3746
|
}
|
|
3745
3747
|
if (respected_element.offsetParent === null) {
|
|
3746
3748
|
if (!i) {
|
|
3747
3749
|
// if index is 0 and we are not visible don't return the element at index -1 from the array - shit will hit the fan. Return the first one and everything should work out fine
|
|
3748
|
-
|
|
3750
|
+
$241f2f02cc612a49$export$de56f1198d121036("Inf scroll: No elements visible, ", considered_elements, "will attach to first el", respected_element);
|
|
3749
3751
|
return considered_elements[i];
|
|
3750
3752
|
}
|
|
3751
3753
|
return considered_elements[i - 1];
|
|
3752
3754
|
}
|
|
3753
3755
|
}
|
|
3754
|
-
|
|
3756
|
+
$241f2f02cc612a49$export$de56f1198d121036("Seems like all elements are loaded");
|
|
3755
3757
|
}
|
|
3756
3758
|
async function $3ee6c00e6df1008f$export$9eae832ae57fbf(t, css, extra_html) {
|
|
3757
3759
|
const head = await (0, $90fa633a9564f115$export$b6ae1bc530f4c149).wait_for_element("head"),
|
|
3758
3760
|
{
|
|
3759
3761
|
dlog: dlog
|
|
3760
3762
|
} = t,
|
|
3761
|
-
elems =
|
|
3763
|
+
elems = $652300c6621d5500$export$44951404cb8d0583('<style type="text/css">'.concat(css, "</style>") + (extra_html ? extra_html : ""));
|
|
3762
3764
|
dlog("inserting", ...elems, "into", head);
|
|
3763
3765
|
head.append(...elems);
|
|
3764
3766
|
}
|
|
@@ -3792,7 +3794,7 @@ async function $e64690bc3a7de2b1$var$placeholder_worker(placeholder_elements, fi
|
|
|
3792
3794
|
}
|
|
3793
3795
|
} else {
|
|
3794
3796
|
await sanit_el_if_needed();
|
|
3795
|
-
placeholder_elements[0].addEventListener("placeholder_switch",
|
|
3797
|
+
placeholder_elements[0].addEventListener("placeholder_switch", $9c44a7238815fa47$export$535946eb77c946dd(async e => {
|
|
3796
3798
|
const new_state = e.detail.state;
|
|
3797
3799
|
if (state != new_state) {
|
|
3798
3800
|
await sanit_el_if_needed();
|
|
@@ -3812,7 +3814,7 @@ async function $e64690bc3a7de2b1$var$decide_direction_and_switch(placeholder_ele
|
|
|
3812
3814
|
if (switch_to_final) $e64690bc3a7de2b1$var$switch_elements(placeholder_elements, final_elements);else $e64690bc3a7de2b1$var$switch_elements(final_elements, placeholder_elements);
|
|
3813
3815
|
}
|
|
3814
3816
|
function $e64690bc3a7de2b1$var$switch_elements(from, to) {
|
|
3815
|
-
if (!from.length || !to.length)
|
|
3817
|
+
if (!from.length || !to.length) $241f2f02cc612a49$export$c2363754d4758444("Cannot switch elements as from or to is empty", from, to);
|
|
3816
3818
|
from[0].replaceWith(...to);
|
|
3817
3819
|
for (let i = 1; i < from.length; i++) from[i].remove();
|
|
3818
3820
|
}
|
|
@@ -3845,11 +3847,11 @@ class $5f31622ffb78bc10$export$3be7054c61590ee3 {
|
|
|
3845
3847
|
// it allows us to just add elements to the observed container and have them added to the elements array if they or their children match the selector
|
|
3846
3848
|
if (!this.container && !override_container) return;
|
|
3847
3849
|
const container = override_container !== null && override_container !== void 0 ? override_container : this.container;
|
|
3848
|
-
const mutation_observer = new MutationObserver(
|
|
3850
|
+
const mutation_observer = new MutationObserver($5e1f45affc1d7def$export$b3bbfd758f11cfa9(mutations => {
|
|
3849
3851
|
for (let i = 0; i < mutations.length; i++) {
|
|
3850
|
-
const matching_added_els =
|
|
3852
|
+
const matching_added_els = $652300c6621d5500$export$5e63aea0cac01fa0(mutations[i].addedNodes, this.selector);
|
|
3851
3853
|
if (matching_added_els.length) {
|
|
3852
|
-
if (
|
|
3854
|
+
if ($76EG6$babelruntimehelpersclassPrivateFieldGet(this, $5f31622ffb78bc10$var$_verbose)) $241f2f02cc612a49$export$de56f1198d121036("New elements", matching_added_els, " matching selector", this.selector, "were aded to", container, "lazyloading…");
|
|
3853
3855
|
this.lazyfinder.elements.push(...matching_added_els);
|
|
3854
3856
|
matching_added_els.forEach($5f31622ffb78bc10$var$_classPrivateMethodGet(this, $5f31622ffb78bc10$var$_initiate_new_image, $5f31622ffb78bc10$var$_initiate_new_image2).bind(this));
|
|
3855
3857
|
}
|
|
@@ -3914,15 +3916,15 @@ class $5f31622ffb78bc10$export$3be7054c61590ee3 {
|
|
|
3914
3916
|
}
|
|
3915
3917
|
}
|
|
3916
3918
|
},
|
|
3917
|
-
load:
|
|
3919
|
+
load: $5e1f45affc1d7def$export$b3bbfd758f11cfa9(async image => {
|
|
3918
3920
|
for (const element of [...$5f31622ffb78bc10$export$e4741190ccada479(image, "source"), image]) {
|
|
3919
3921
|
var _document, _document$body, _document$body$contai, _document$body2, _element$dataset, _element$dataset$src, _element$dataset2, _element$dataset2$src;
|
|
3920
3922
|
if ("loaded" in element) {
|
|
3921
|
-
if (
|
|
3923
|
+
if ($76EG6$babelruntimehelpersclassPrivateFieldGet(class_this, $5f31622ffb78bc10$var$_verbose)) $241f2f02cc612a49$export$de56f1198d121036(element, "is already loading, not loading again");
|
|
3922
3924
|
continue;
|
|
3923
3925
|
}
|
|
3924
3926
|
if (((_document = document) === null || _document === void 0 ? void 0 : (_document$body = _document.body) === null || _document$body === void 0 ? void 0 : (_document$body$contai = (_document$body2 = _document$body).contains) === null || _document$body$contai === void 0 ? void 0 : _document$body$contai.call(_document$body2, image)) === false) {
|
|
3925
|
-
if (
|
|
3927
|
+
if ($76EG6$babelruntimehelpersclassPrivateFieldGet(class_this, $5f31622ffb78bc10$var$_verbose)) $241f2f02cc612a49$export$de56f1198d121036(element, "has been removed from the DOM, can't load");
|
|
3926
3928
|
const {
|
|
3927
3929
|
elements: elements
|
|
3928
3930
|
} = class_this.lazyfinder;
|
|
@@ -3933,13 +3935,13 @@ class $5f31622ffb78bc10$export$3be7054c61590ee3 {
|
|
|
3933
3935
|
const has_src = (_element$dataset = element.dataset) === null || _element$dataset === void 0 ? void 0 : (_element$dataset$src = _element$dataset.src) === null || _element$dataset$src === void 0 ? void 0 : _element$dataset$src.length;
|
|
3934
3936
|
const has_srcset = (_element$dataset2 = element.dataset) === null || _element$dataset2 === void 0 ? void 0 : (_element$dataset2$src = _element$dataset2.srcset) === null || _element$dataset2$src === void 0 ? void 0 : _element$dataset2$src.length;
|
|
3935
3937
|
if (has_src || has_srcset) {
|
|
3936
|
-
if (
|
|
3938
|
+
if ($76EG6$babelruntimehelpersclassPrivateFieldGet(class_this, $5f31622ffb78bc10$var$_verbose)) $241f2f02cc612a49$export$de56f1198d121036("Loading", element);
|
|
3937
3939
|
element.loaded = false;
|
|
3938
3940
|
// here it's of importance that we give the browser the srcset first, otherwise it (safari) might start loading the fallback src at first
|
|
3939
3941
|
if (has_srcset) {
|
|
3940
3942
|
// in Safari for some reason sometimes the .sizes attribute isn't set yet, like in https://www.notion.so/depictai/Pictures-in-recommendations-are-not-displayed-88e30e0f98de421e94b9eb273aea21dc. In that case, wait up to one event loop execution for it
|
|
3941
3943
|
if (!element.sizes) await new Promise(resolve => {
|
|
3942
|
-
const mo = new MutationObserver(
|
|
3944
|
+
const mo = new MutationObserver($5e1f45affc1d7def$export$b3bbfd758f11cfa9(_records => {
|
|
3943
3945
|
if (element.sizes) {
|
|
3944
3946
|
resolve();
|
|
3945
3947
|
mo.disconnect();
|
|
@@ -3949,7 +3951,7 @@ class $5f31622ffb78bc10$export$3be7054c61590ee3 {
|
|
|
3949
3951
|
attributes: true,
|
|
3950
3952
|
attributeFilter: ["sizes"]
|
|
3951
3953
|
});
|
|
3952
|
-
setTimeout(
|
|
3954
|
+
setTimeout($5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => {
|
|
3953
3955
|
resolve(); // in case ResizeObserver doesn't set .sizes or something
|
|
3954
3956
|
mo.disconnect();
|
|
3955
3957
|
}));
|
|
@@ -3966,7 +3968,7 @@ class $5f31622ffb78bc10$export$3be7054c61590ee3 {
|
|
|
3966
3968
|
var _element$src, _element$src$startsWi, _element$src2;
|
|
3967
3969
|
if ((_element$src = element.src) !== null && _element$src !== void 0 && (_element$src$startsWi = (_element$src2 = _element$src).startsWith) !== null && _element$src$startsWi !== void 0 && _element$src$startsWi.call(_element$src2, "data:")) continue;
|
|
3968
3970
|
// This happens quite often for reasons unknown. One day we will figure out why, or replace this lazyloader with a new one/native.
|
|
3969
|
-
if (
|
|
3971
|
+
if ($76EG6$babelruntimehelpersclassPrivateFieldGet(class_this, $5f31622ffb78bc10$var$_verbose)) $241f2f02cc612a49$export$de56f1198d121036("Cannot load", element, "as it doesn't have a data-src or data-srcset attribute");
|
|
3970
3972
|
}
|
|
3971
3973
|
}
|
|
3972
3974
|
}),
|
|
@@ -3988,20 +3990,20 @@ class $5f31622ffb78bc10$export$3be7054c61590ee3 {
|
|
|
3988
3990
|
this.selector = selector;
|
|
3989
3991
|
this.only_load_intersecting = only_load_intersecting;
|
|
3990
3992
|
this.ignore_data_urls = ignore_data_urls;
|
|
3991
|
-
if (verbose)
|
|
3993
|
+
if (verbose) $76EG6$babelruntimehelpersclassPrivateFieldSet(this, $5f31622ffb78bc10$var$_verbose, true);
|
|
3992
3994
|
// make sure we have a fully-fledged lazyfinder but still allow max customizability
|
|
3993
|
-
this.lazyfinder = lazyfinder || (lazyfinder =
|
|
3994
|
-
(_lazyfinder = lazyfinder).unload || (_lazyfinder.unload =
|
|
3995
|
-
(_lazyfinder2 = lazyfinder).load || (_lazyfinder2.load =
|
|
3996
|
-
if (!("elements" in lazyfinder)) Object.defineProperty(lazyfinder, "elements", Object.getOwnPropertyDescriptor(
|
|
3995
|
+
this.lazyfinder = lazyfinder || (lazyfinder = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $5f31622ffb78bc10$var$_default_lazyfinder));
|
|
3996
|
+
(_lazyfinder = lazyfinder).unload || (_lazyfinder.unload = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $5f31622ffb78bc10$var$_default_lazyfinder).unload);
|
|
3997
|
+
(_lazyfinder2 = lazyfinder).load || (_lazyfinder2.load = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $5f31622ffb78bc10$var$_default_lazyfinder).load);
|
|
3998
|
+
if (!("elements" in lazyfinder)) Object.defineProperty(lazyfinder, "elements", Object.getOwnPropertyDescriptor($76EG6$babelruntimehelpersclassPrivateFieldGet(this, $5f31622ffb78bc10$var$_default_lazyfinder), "elements"));
|
|
3997
3999
|
$5f31622ffb78bc10$var$_classPrivateMethodGet(this, $5f31622ffb78bc10$var$_unload_images_and_add_load_listeners, $5f31622ffb78bc10$var$_unload_images_and_add_load_listeners2).call(this);
|
|
3998
4000
|
// check if we need to branch off to an async function and wait for the elements being in the DOM
|
|
3999
4001
|
if (wait_for_dominsertion) {
|
|
4000
|
-
const caught_start_obs =
|
|
4002
|
+
const caught_start_obs = $5e1f45affc1d7def$export$b3bbfd758f11cfa9($5f31622ffb78bc10$var$_classPrivateMethodGet(this, $5f31622ffb78bc10$var$_start_observer, $5f31622ffb78bc10$var$_start_observer2)).bind(this);
|
|
4001
4003
|
if (wait_for_dominsertion instanceof Promise) wait_for_dominsertion.then(caught_start_obs);else {
|
|
4002
4004
|
var _lazyfinder3, _lazyfinder3$elements;
|
|
4003
4005
|
const el_to_listen_on = container || ((_lazyfinder3 = lazyfinder) === null || _lazyfinder3 === void 0 ? void 0 : (_lazyfinder3$elements = _lazyfinder3.elements) === null || _lazyfinder3$elements === void 0 ? void 0 : _lazyfinder3$elements[0]);
|
|
4004
|
-
if (el_to_listen_on instanceof Node) (0, $90fa633a9564f115$export$b6ae1bc530f4c149).wait_for_element(el_to_listen_on).then(caught_start_obs);else
|
|
4006
|
+
if (el_to_listen_on instanceof Node) (0, $90fa633a9564f115$export$b6ae1bc530f4c149).wait_for_element(el_to_listen_on).then(caught_start_obs);else $241f2f02cc612a49$export$de56f1198d121036("Could not find element to attach event listener to", () => {}); // right click function in inspector and select "jump to definition" to get here
|
|
4005
4007
|
}
|
|
4006
4008
|
} else $5f31622ffb78bc10$var$_classPrivateMethodGet(this, $5f31622ffb78bc10$var$_start_observer, $5f31622ffb78bc10$var$_start_observer2).call(this);
|
|
4007
4009
|
}
|
|
@@ -4009,23 +4011,23 @@ class $5f31622ffb78bc10$export$3be7054c61590ee3 {
|
|
|
4009
4011
|
function $5f31622ffb78bc10$var$_initiate_new_image2(image) {
|
|
4010
4012
|
var _this$intersection_ob, _this$intersection_ob2;
|
|
4011
4013
|
if (image.loaded === true || image.loaded === false) {
|
|
4012
|
-
if (
|
|
4014
|
+
if ($76EG6$babelruntimehelpersclassPrivateFieldGet(this, $5f31622ffb78bc10$var$_verbose)) $241f2f02cc612a49$export$de56f1198d121036("Not lazyloading", image, "because it was loaded before or is loading");
|
|
4013
4015
|
return;
|
|
4014
4016
|
}
|
|
4015
|
-
|
|
4017
|
+
$5e1f45affc1d7def$export$b3bbfd758f11cfa9(this.lazyfinder.unload)(image);
|
|
4016
4018
|
$5f31622ffb78bc10$var$_classPrivateMethodGet(this, $5f31622ffb78bc10$var$_add_load_event_listener, $5f31622ffb78bc10$var$_add_load_event_listener2).call(this, image);
|
|
4017
4019
|
(_this$intersection_ob = this.intersection_observer) === null || _this$intersection_ob === void 0 || (_this$intersection_ob2 = _this$intersection_ob.observe) === null || _this$intersection_ob2 === void 0 || _this$intersection_ob2.call(_this$intersection_ob, image); // observe if observer already exists, otherwise it won't and start_observer will do it
|
|
4018
4020
|
}
|
|
4019
4021
|
|
|
4020
4022
|
function $5f31622ffb78bc10$var$_add_load_event_listener2(element) {
|
|
4021
|
-
const handler =
|
|
4023
|
+
const handler = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(e => {
|
|
4022
4024
|
// cookiebot triggers random "load" events on all elements which make the images load before the intersection observer has started
|
|
4023
4025
|
if (!element.src.length) {
|
|
4024
|
-
|
|
4026
|
+
$241f2f02cc612a49$export$de56f1198d121036("ignoring load event", e, "because image doesn't have a src");
|
|
4025
4027
|
return;
|
|
4026
4028
|
}
|
|
4027
4029
|
if (this.ignore_data_urls && element.src.startsWith("data:")) {
|
|
4028
|
-
if (
|
|
4030
|
+
if ($76EG6$babelruntimehelpersclassPrivateFieldGet(this, $5f31622ffb78bc10$var$_verbose)) $241f2f02cc612a49$export$de56f1198d121036("Ignoring load event", e, "because ignore_data_urls is truthy");
|
|
4029
4031
|
return;
|
|
4030
4032
|
}
|
|
4031
4033
|
element.removeEventListener("load", handler);
|
|
@@ -4039,7 +4041,7 @@ function $5f31622ffb78bc10$var$_unload_images_and_add_load_listeners2() {
|
|
|
4039
4041
|
elements: elements,
|
|
4040
4042
|
unload: unload
|
|
4041
4043
|
} = this.lazyfinder;
|
|
4042
|
-
const caught_unload =
|
|
4044
|
+
const caught_unload = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(unload);
|
|
4043
4045
|
for (let i = 0; i < elements.length; i++) {
|
|
4044
4046
|
caught_unload(elements[i]);
|
|
4045
4047
|
$5f31622ffb78bc10$var$_classPrivateMethodGet(this, $5f31622ffb78bc10$var$_add_load_event_listener, $5f31622ffb78bc10$var$_add_load_event_listener2).call(this, elements[i]);
|
|
@@ -4048,7 +4050,7 @@ function $5f31622ffb78bc10$var$_unload_images_and_add_load_listeners2() {
|
|
|
4048
4050
|
function $5f31622ffb78bc10$var$_start_observer2() {
|
|
4049
4051
|
let observers_first_call = true;
|
|
4050
4052
|
if (!this.intersection_observer) {
|
|
4051
|
-
this.intersection_observer = new IntersectionObserver(
|
|
4053
|
+
this.intersection_observer = new IntersectionObserver($5e1f45affc1d7def$export$b3bbfd758f11cfa9(entries => {
|
|
4052
4054
|
let any_intersected = false;
|
|
4053
4055
|
for (let i = 0; i < entries.length; i++) {
|
|
4054
4056
|
const entry = entries[i];
|
|
@@ -4058,13 +4060,13 @@ function $5f31622ffb78bc10$var$_start_observer2() {
|
|
|
4058
4060
|
if (target.loaded == null)
|
|
4059
4061
|
// if it's false it's already loading
|
|
4060
4062
|
this.lazyfinder.load(target);
|
|
4061
|
-
if (observers_first_call)
|
|
4063
|
+
if (observers_first_call) $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $5f31622ffb78bc10$var$_images_on_first_page).push(target);
|
|
4062
4064
|
}
|
|
4063
4065
|
}
|
|
4064
4066
|
if (any_intersected) observers_first_call = false;
|
|
4065
4067
|
}), {
|
|
4066
4068
|
root: this.container,
|
|
4067
|
-
threshold:
|
|
4069
|
+
threshold: $ab9c3dbf2bb2fbf7$export$f8ea2e7b15b5d129(3)
|
|
4068
4070
|
});
|
|
4069
4071
|
const {
|
|
4070
4072
|
elements: elements
|
|
@@ -4082,8 +4084,8 @@ function $5f31622ffb78bc10$var$_check_if_first_page_has_loaded2() {
|
|
|
4082
4084
|
var _elements$length;
|
|
4083
4085
|
if (elements[i].loaded === true) loaded_images.push(elements[i]);else not_loaded_or_loading.push(elements[i]);
|
|
4084
4086
|
}
|
|
4085
|
-
if (
|
|
4086
|
-
const caught_loading_fin =
|
|
4087
|
+
if ($76EG6$babelruntimehelpersclassPrivateFieldGet(this, $5f31622ffb78bc10$var$_images_on_first_page).length >= loaded_images.length) {
|
|
4088
|
+
const caught_loading_fin = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(this.lazyfinder.load);
|
|
4087
4089
|
for (let i = 0; i < not_loaded_or_loading.length; i++) caught_loading_fin(not_loaded_or_loading[i]);
|
|
4088
4090
|
}
|
|
4089
4091
|
}
|
|
@@ -4109,9 +4111,9 @@ function $5f31622ffb78bc10$export$e4741190ccada479(element, selector) {
|
|
|
4109
4111
|
}
|
|
4110
4112
|
return result;
|
|
4111
4113
|
}
|
|
4112
|
-
const $a285401a927e4306$export$eb0b9ed911409b57 = (callback, element) => (
|
|
4114
|
+
const $a285401a927e4306$export$eb0b9ed911409b57 = (callback, element) => ($5e1f45affc1d7def$export$b3bbfd758f11cfa9(callback)(element), element);
|
|
4113
4115
|
function $a285401a927e4306$export$f63fcc839cb0f734(event, handler, element) {
|
|
4114
|
-
element.addEventListener(event,
|
|
4116
|
+
element.addEventListener(event, $5e1f45affc1d7def$export$b3bbfd758f11cfa9(handler));
|
|
4115
4117
|
return element;
|
|
4116
4118
|
}
|
|
4117
4119
|
const $a285401a927e4306$export$22a65337c1b43b1f = /* @PURE */classes => classes.filter(c => c !== undefined).join(" ");
|
|
@@ -4144,7 +4146,7 @@ const $0f650018c3cbc373$export$34b9dba7ce09269b = (tag, _ref, _unknown) => {
|
|
|
4144
4146
|
const element = is_svg ? document.createElementNS(namespace, tag) : document.createElement(tag);
|
|
4145
4147
|
for (const key in props) {
|
|
4146
4148
|
const value = props[key];
|
|
4147
|
-
if (key === "onClick") element.addEventListener("click",
|
|
4149
|
+
if (key === "onClick") element.addEventListener("click", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(value));else if (key.startsWith("xlink:"))
|
|
4148
4150
|
// https://stackoverflow.com/a/23142447
|
|
4149
4151
|
// https://developer.mozilla.org/en-US/docs/Web/SVG/Namespaces_Crash_Course
|
|
4150
4152
|
element.setAttributeNS("http://www.w3.org/1999/xlink", key, value);else if (key == "xmlns" || key.startsWith("xmlns:")) element.setAttributeNS("http://www.w3.org/2000/xmlns/", key, value);else if (key.startsWith("xml:")) element.setAttributeNS("http://www.w3.org/XML/1998/namespace", key, value);else element.setAttribute(key, props[key]);
|
|
@@ -4196,7 +4198,7 @@ class $be288a83d9eabf2a$export$692b27c28639e5b9 {
|
|
|
4196
4198
|
var _target$parentElement;
|
|
4197
4199
|
const {
|
|
4198
4200
|
el_to_number_: el_to_number_
|
|
4199
|
-
} =
|
|
4201
|
+
} = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_index_cache);
|
|
4200
4202
|
const value_from_cache = el_to_number_.get(target);
|
|
4201
4203
|
if (value_from_cache) return value_from_cache;
|
|
4202
4204
|
const children = target === null || target === void 0 ? void 0 : (_target$parentElement = target.parentElement) === null || _target$parentElement === void 0 ? void 0 : _target$parentElement.children;
|
|
@@ -4216,7 +4218,7 @@ class $be288a83d9eabf2a$export$692b27c28639e5b9 {
|
|
|
4216
4218
|
}
|
|
4217
4219
|
get index_of_last_element() {
|
|
4218
4220
|
var _classPrivateFieldGet2, _classPrivateFieldGet3, _this$first_intersect, _this$first_intersect2, _this$first_intersect3, _this$first_intersect4, _this$first_intersect5, _classPrivateFieldGet4, _classPrivateFieldGet5, _classPrivateFieldGet6;
|
|
4219
|
-
return (_classPrivateFieldGet3 = (_classPrivateFieldGet2 =
|
|
4221
|
+
return (_classPrivateFieldGet3 = (_classPrivateFieldGet2 = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_index_cache)).last_el_) !== null && _classPrivateFieldGet3 !== void 0 ? _classPrivateFieldGet3 : _classPrivateFieldGet2.last_el_ = ((_this$first_intersect = (_this$first_intersect2 = this.first_intersecting) === null || _this$first_intersect2 === void 0 ? void 0 : (_this$first_intersect3 = _this$first_intersect2.target) === null || _this$first_intersect3 === void 0 ? void 0 : (_this$first_intersect4 = _this$first_intersect3.parentElement) === null || _this$first_intersect4 === void 0 ? void 0 : (_this$first_intersect5 = _this$first_intersect4.children) === null || _this$first_intersect5 === void 0 ? void 0 : _this$first_intersect5.length) !== null && _this$first_intersect !== void 0 ? _this$first_intersect : (_classPrivateFieldGet4 = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_elements)) === null || _classPrivateFieldGet4 === void 0 ? void 0 : (_classPrivateFieldGet5 = _classPrivateFieldGet4.sliding_el_) === null || _classPrivateFieldGet5 === void 0 ? void 0 : (_classPrivateFieldGet6 = _classPrivateFieldGet5.children) === null || _classPrivateFieldGet6 === void 0 ? void 0 : _classPrivateFieldGet6.length) - 1;
|
|
4220
4222
|
}
|
|
4221
4223
|
get currently_selected() {
|
|
4222
4224
|
// this tries to be what distance_to assumes is the current card when converting a relative offset into an absolute one, available for plugins
|
|
@@ -4226,7 +4228,7 @@ class $be288a83d9eabf2a$export$692b27c28639e5b9 {
|
|
|
4226
4228
|
visible_sizes: visible_sizes
|
|
4227
4229
|
} = this;
|
|
4228
4230
|
let left_offset = 0;
|
|
4229
|
-
const rectangle_of_container =
|
|
4231
|
+
const rectangle_of_container = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_elements).sliding_el_.getBoundingClientRect();
|
|
4230
4232
|
const middle_of_container = rectangle_of_container.width / 2;
|
|
4231
4233
|
for (const [element, info] of visible_sizes) {
|
|
4232
4234
|
left_offset += info.total_visible;
|
|
@@ -4237,11 +4239,11 @@ class $be288a83d9eabf2a$export$692b27c28639e5b9 {
|
|
|
4237
4239
|
} else return this.first_intersecting_index(0.9);
|
|
4238
4240
|
}
|
|
4239
4241
|
get visible_sizes() {
|
|
4240
|
-
if (
|
|
4242
|
+
if ($76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_cached_visible_sizes)) return $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_cached_visible_sizes);
|
|
4241
4243
|
const visible_sizes = new Map();
|
|
4242
4244
|
const visible_cards = Object.keys(this.intersecting_items_object).map(key => +key);
|
|
4243
4245
|
const to_calculate = [visible_cards[0] - 1, ...visible_cards, visible_cards[visible_cards.length - 1] + 1].map(index => this.element_by_index(+index)).filter(e => e);
|
|
4244
|
-
const root_el =
|
|
4246
|
+
const root_el = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_elements).sliding_el_;
|
|
4245
4247
|
const root = root_el.getBoundingClientRect();
|
|
4246
4248
|
const root_computed_style = getComputedStyle(root_el);
|
|
4247
4249
|
const root_left = root.left - parseInt(root_computed_style.marginLeft);
|
|
@@ -4277,9 +4279,9 @@ class $be288a83d9eabf2a$export$692b27c28639e5b9 {
|
|
|
4277
4279
|
rect: card
|
|
4278
4280
|
});
|
|
4279
4281
|
}
|
|
4280
|
-
|
|
4282
|
+
$76EG6$babelruntimehelpersclassPrivateFieldSet(this, $be288a83d9eabf2a$var$_cached_visible_sizes, visible_sizes);
|
|
4281
4283
|
// let's assume we can cache this for a tick since the slider scrolls smoothly so there's no point in reading it instantly again and assuming a different value
|
|
4282
|
-
queueMicrotask(
|
|
4284
|
+
queueMicrotask($5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => $76EG6$babelruntimehelpersclassPrivateFieldSet(this, $be288a83d9eabf2a$var$_cached_visible_sizes, undefined)));
|
|
4283
4285
|
return visible_sizes;
|
|
4284
4286
|
}
|
|
4285
4287
|
get cards_fitting_in_viewport() {
|
|
@@ -4306,25 +4308,25 @@ class $be288a83d9eabf2a$export$692b27c28639e5b9 {
|
|
|
4306
4308
|
// }
|
|
4307
4309
|
element_by_index(index) {
|
|
4308
4310
|
var _ref;
|
|
4309
|
-
const from_cache =
|
|
4311
|
+
const from_cache = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_index_cache).number_to_el_.get(index);
|
|
4310
4312
|
if (from_cache) return from_cache;
|
|
4311
4313
|
const {
|
|
4312
4314
|
sliding_el_: sliding_el_
|
|
4313
|
-
} =
|
|
4315
|
+
} = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_elements);
|
|
4314
4316
|
let maybe_el = (_ref = [...((sliding_el_ === null || sliding_el_ === void 0 ? void 0 : sliding_el_.children) || [])], _ref === void 0) ? void 0 : _ref[index];
|
|
4315
4317
|
if (!maybe_el) {
|
|
4316
4318
|
var _ref2, _this$first_intersect6, _this$first_intersect7, _this$first_intersect8;
|
|
4317
4319
|
// this is for plantagen which has a double whammy slider
|
|
4318
4320
|
maybe_el = (_ref2 = [...(((_this$first_intersect6 = this.first_intersecting) === null || _this$first_intersect6 === void 0 ? void 0 : (_this$first_intersect7 = _this$first_intersect6.target) === null || _this$first_intersect7 === void 0 ? void 0 : (_this$first_intersect8 = _this$first_intersect7.parentElement) === null || _this$first_intersect8 === void 0 ? void 0 : _this$first_intersect8.children) || [])], _ref2 === void 0) ? void 0 : _ref2[index];
|
|
4319
4321
|
}
|
|
4320
|
-
|
|
4322
|
+
$76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_index_cache).number_to_el_.set(index, maybe_el);
|
|
4321
4323
|
return maybe_el;
|
|
4322
4324
|
}
|
|
4323
4325
|
invalidate_cache() {
|
|
4324
4326
|
// dlog("Invalidating index cache");
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4327
|
+
$76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_index_cache).number_to_el_.clear();
|
|
4328
|
+
$76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_index_cache).el_to_number_.clear();
|
|
4329
|
+
$76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_index_cache).last_el_ = undefined;
|
|
4328
4330
|
}
|
|
4329
4331
|
scroll_to_rel(offset) {
|
|
4330
4332
|
let harsh = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
@@ -4356,39 +4358,39 @@ class $be288a83d9eabf2a$export$692b27c28639e5b9 {
|
|
|
4356
4358
|
$be288a83d9eabf2a$var$_classPrivateMethodInitSpec(this, $be288a83d9eabf2a$var$_hide_buttons_if_needed);
|
|
4357
4359
|
$be288a83d9eabf2a$var$_classPrivateMethodInitSpec(this, $be288a83d9eabf2a$var$_observer_callback);
|
|
4358
4360
|
$be288a83d9eabf2a$var$_classPrivateMethodInitSpec(this, $be288a83d9eabf2a$var$_observe_element);
|
|
4359
|
-
|
|
4361
|
+
$76EG6$babelruntimehelpersdefineProperty(this, "container", $0f650018c3cbc373$export$34b9dba7ce09269b("div", {
|
|
4360
4362
|
class: "depict-slider depict"
|
|
4361
4363
|
}));
|
|
4362
4364
|
$be288a83d9eabf2a$var$_classPrivateFieldInitSpec(this, $be288a83d9eabf2a$var$_elements, {
|
|
4363
4365
|
writable: true,
|
|
4364
4366
|
value: {
|
|
4365
|
-
sliding_el_:
|
|
4367
|
+
sliding_el_: $0f650018c3cbc373$export$34b9dba7ce09269b("div", {
|
|
4366
4368
|
class: "sliding"
|
|
4367
4369
|
}),
|
|
4368
|
-
left_:
|
|
4370
|
+
left_: $0f650018c3cbc373$export$34b9dba7ce09269b("button", {
|
|
4369
4371
|
"aria-label": "Scroll left",
|
|
4370
4372
|
class: "left d-navbutton",
|
|
4371
4373
|
type: "button"
|
|
4372
4374
|
}),
|
|
4373
|
-
right_:
|
|
4375
|
+
right_: $0f650018c3cbc373$export$34b9dba7ce09269b("button", {
|
|
4374
4376
|
"aria-label": "Scroll right",
|
|
4375
4377
|
class: "right d-navbutton",
|
|
4376
4378
|
type: "button"
|
|
4377
4379
|
})
|
|
4378
4380
|
}
|
|
4379
4381
|
});
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
+
$76EG6$babelruntimehelpersdefineProperty(this, "insert_here", $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_elements).sliding_el_);
|
|
4383
|
+
$76EG6$babelruntimehelpersdefineProperty(this, "intersecting_items_object", {});
|
|
4382
4384
|
$be288a83d9eabf2a$var$_classPrivateFieldInitSpec(this, $be288a83d9eabf2a$var$_mutation_plugins, {
|
|
4383
4385
|
writable: true,
|
|
4384
4386
|
value: []
|
|
4385
4387
|
});
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4388
|
+
$76EG6$babelruntimehelpersdefineProperty(this, "stepstoslide", 2);
|
|
4389
|
+
$76EG6$babelruntimehelpersdefineProperty(this, "dist_to_hide_left", 10);
|
|
4390
|
+
$76EG6$babelruntimehelpersdefineProperty(this, "dist_to_hide_right", 10);
|
|
4391
|
+
$76EG6$babelruntimehelpersdefineProperty(this, "center_target", false);
|
|
4392
|
+
$76EG6$babelruntimehelpersdefineProperty(this, "correct_bs_targets", true);
|
|
4393
|
+
$76EG6$babelruntimehelpersdefineProperty(this, "on_elements_changed", [$be288a83d9eabf2a$var$_classPrivateMethodGet(this, $be288a83d9eabf2a$var$_observe_element, $be288a83d9eabf2a$var$_observe_element2)]);
|
|
4392
4394
|
$be288a83d9eabf2a$var$_classPrivateFieldInitSpec(this, $be288a83d9eabf2a$var$_index_cache, {
|
|
4393
4395
|
writable: true,
|
|
4394
4396
|
value: {
|
|
@@ -4401,30 +4403,30 @@ class $be288a83d9eabf2a$export$692b27c28639e5b9 {
|
|
|
4401
4403
|
writable: true,
|
|
4402
4404
|
value: void 0
|
|
4403
4405
|
});
|
|
4404
|
-
|
|
4405
|
-
root:
|
|
4406
|
-
threshold:
|
|
4406
|
+
$76EG6$babelruntimehelpersdefineProperty(this, "observer", new IntersectionObserver($be288a83d9eabf2a$var$_classPrivateMethodGet(this, $be288a83d9eabf2a$var$_observer_callback, $be288a83d9eabf2a$var$_observer_callback2).bind(this), {
|
|
4407
|
+
root: $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_elements).sliding_el_,
|
|
4408
|
+
threshold: $ab9c3dbf2bb2fbf7$export$f8ea2e7b15b5d129(100)
|
|
4407
4409
|
}));
|
|
4408
|
-
|
|
4410
|
+
$76EG6$babelruntimehelpersdefineProperty(this, "observe", this.observer.observe.bind(this.observer));
|
|
4409
4411
|
dist_to_hide_left && (this.dist_to_hide_left = dist_to_hide_left);
|
|
4410
4412
|
dist_to_hide_right && (this.dist_to_hide_right = dist_to_hide_right);
|
|
4411
4413
|
stepstoslide && (this.stepstoslide = stepstoslide);
|
|
4412
4414
|
center_target && (this.center_target = true);
|
|
4413
|
-
_mutation_plugins2 &&
|
|
4415
|
+
_mutation_plugins2 && $76EG6$babelruntimehelpersclassPrivateFieldSet(this, $be288a83d9eabf2a$var$_mutation_plugins, _mutation_plugins2);
|
|
4414
4416
|
correct_bs_targets == false && (this.correct_bs_targets = correct_bs_targets);
|
|
4415
4417
|
if (button_elems) {
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
+
$76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_elements).right_ = button_elems.right;
|
|
4419
|
+
$76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_elements).left_ = button_elems.left;
|
|
4418
4420
|
}
|
|
4419
|
-
if (button_contents !== null && button_contents !== void 0 && button_contents.right)
|
|
4420
|
-
if (button_contents !== null && button_contents !== void 0 && button_contents.left)
|
|
4421
|
-
|
|
4421
|
+
if (button_contents !== null && button_contents !== void 0 && button_contents.right) $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_elements).right_.append(...button_contents.right);
|
|
4422
|
+
if (button_contents !== null && button_contents !== void 0 && button_contents.left) $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_elements).left_.append(...button_contents.left);
|
|
4423
|
+
$5e1f45affc1d7def$export$b3bbfd758f11cfa9($be288a83d9eabf2a$var$_classPrivateMethodGet(this, $be288a83d9eabf2a$var$_create_element_structure, $be288a83d9eabf2a$var$_create_element_structure2)).call(this, autoinvalidate_cache);
|
|
4422
4424
|
// @ts-ignore
|
|
4423
|
-
|
|
4425
|
+
$76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_elements).sliding_el_.slider = this; // dunno if this is dumb? So far nordicagolf/kondomvaruhuset depend on it
|
|
4424
4426
|
// plugin functionality i.e. for dots
|
|
4425
4427
|
const constructor_args = arguments;
|
|
4426
4428
|
constructor_plugins === null || constructor_plugins === void 0 || (_constructor_plugins$ = constructor_plugins.forEach) === null || _constructor_plugins$ === void 0 || _constructor_plugins$.call(constructor_plugins, mplugin => {
|
|
4427
|
-
|
|
4429
|
+
$5e1f45affc1d7def$export$b3bbfd758f11cfa9(mplugin).call(this, constructor_args);
|
|
4428
4430
|
});
|
|
4429
4431
|
}
|
|
4430
4432
|
}
|
|
@@ -4434,7 +4436,7 @@ function $be288a83d9eabf2a$var$_observe_element2(records) {
|
|
|
4434
4436
|
} = this;
|
|
4435
4437
|
const {
|
|
4436
4438
|
sliding_el_: sliding_el_
|
|
4437
|
-
} =
|
|
4439
|
+
} = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_elements);
|
|
4438
4440
|
for (const record of records) {
|
|
4439
4441
|
for (const node of record.addedNodes) if (node instanceof Element && node.parentElement === sliding_el_) observer.observe(node);
|
|
4440
4442
|
for (const node of record.removedNodes) if (node instanceof Element && node.parentElement === sliding_el_) observer.unobserve(node);
|
|
@@ -4450,16 +4452,16 @@ function $be288a83d9eabf2a$var$_observer_callback2(entries) {
|
|
|
4450
4452
|
const rec_idx = this.get_index_of_element(target);
|
|
4451
4453
|
if (entry.intersectionRatio <= 0) {
|
|
4452
4454
|
for (const key in intersecting_items) if (intersecting_items[key].target === target) delete intersecting_items[key];
|
|
4453
|
-
} else if (rec_idx != null) intersecting_items[rec_idx] = entry;else
|
|
4455
|
+
} else if (rec_idx != null) intersecting_items[rec_idx] = entry;else $241f2f02cc612a49$export$de56f1198d121036("Could not find index of", target, "ignoring observer record");
|
|
4454
4456
|
}
|
|
4455
|
-
|
|
4456
|
-
const mutation_plugins =
|
|
4457
|
-
for (let i = 0; i < mutation_plugins.length; i++)
|
|
4457
|
+
$5e1f45affc1d7def$export$b3bbfd758f11cfa9($be288a83d9eabf2a$var$_classPrivateMethodGet(this, $be288a83d9eabf2a$var$_hide_buttons_if_needed, $be288a83d9eabf2a$var$_hide_buttons_if_needed2)).call(this);
|
|
4458
|
+
const mutation_plugins = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_mutation_plugins);
|
|
4459
|
+
for (let i = 0; i < mutation_plugins.length; i++) $5e1f45affc1d7def$export$b3bbfd758f11cfa9(mutation_plugins[i]).call(this, entries, intersecting_items);
|
|
4458
4460
|
}
|
|
4459
4461
|
function $be288a83d9eabf2a$var$_hide_buttons_if_needed2() {
|
|
4460
4462
|
var _is$;
|
|
4461
4463
|
// it should be correct that this routine is using sliding_el because for the buttons the position of the first and last element to the main container is relevant
|
|
4462
|
-
const cont =
|
|
4464
|
+
const cont = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_elements).sliding_el_,
|
|
4463
4465
|
lastel = this.index_of_last_element,
|
|
4464
4466
|
cont_rect = cont.getBoundingClientRect(),
|
|
4465
4467
|
is = this.intersecting_items_object;
|
|
@@ -4473,17 +4475,17 @@ function $be288a83d9eabf2a$var$_hide_buttons_if_needed2() {
|
|
|
4473
4475
|
// slider is empty
|
|
4474
4476
|
dist_to_left = 0;
|
|
4475
4477
|
}
|
|
4476
|
-
if (dist_to_left >= -this.dist_to_hide_left) $be288a83d9eabf2a$var$_classPrivateMethodGet(this, $be288a83d9eabf2a$var$_visibility, $be288a83d9eabf2a$var$_visibility2).call(this,
|
|
4477
|
-
const rightmost_edge_of_last_card = Math.floor((this.element_by_index(lastel) ||
|
|
4478
|
+
if (dist_to_left >= -this.dist_to_hide_left) $be288a83d9eabf2a$var$_classPrivateMethodGet(this, $be288a83d9eabf2a$var$_visibility, $be288a83d9eabf2a$var$_visibility2).call(this, $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_elements).left_, 0);else $be288a83d9eabf2a$var$_classPrivateMethodGet(this, $be288a83d9eabf2a$var$_visibility, $be288a83d9eabf2a$var$_visibility2).call(this, $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_elements).left_, 1);
|
|
4479
|
+
const rightmost_edge_of_last_card = Math.floor((this.element_by_index(lastel) || $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_elements).sliding_el_).getBoundingClientRect().right);
|
|
4478
4480
|
const rightmost_edge_of_container = cont_rect.right,
|
|
4479
4481
|
dist_to_right = rightmost_edge_of_last_card - rightmost_edge_of_container;
|
|
4480
4482
|
// dlog("dist to right", dist_to_right, "dist to left", dist_to_left);
|
|
4481
|
-
if (dist_to_right <= this.dist_to_hide_right) $be288a83d9eabf2a$var$_classPrivateMethodGet(this, $be288a83d9eabf2a$var$_visibility, $be288a83d9eabf2a$var$_visibility2).call(this,
|
|
4483
|
+
if (dist_to_right <= this.dist_to_hide_right) $be288a83d9eabf2a$var$_classPrivateMethodGet(this, $be288a83d9eabf2a$var$_visibility, $be288a83d9eabf2a$var$_visibility2).call(this, $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_elements).right_, 0);else $be288a83d9eabf2a$var$_classPrivateMethodGet(this, $be288a83d9eabf2a$var$_visibility, $be288a83d9eabf2a$var$_visibility2).call(this, $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_elements).right_, 1);
|
|
4482
4484
|
}
|
|
4483
4485
|
function $be288a83d9eabf2a$var$_distance_to2(offset) {
|
|
4484
4486
|
let is_absolute = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
4485
4487
|
const intersecting_items = this.intersecting_items_object; // the privateFieldGet babel polyfill isn't very fast so for extra snappyness I won't get it multiple times
|
|
4486
|
-
|
|
4488
|
+
$241f2f02cc612a49$export$de56f1198d121036("intersecting_items", intersecting_items);
|
|
4487
4489
|
// I know I could have made this.intersecting_items_object a simple array instead, but maybe someone needs the boundingrect information in it some day. Also I thought I could use it, but it isn't always up to date due to the intersection observer not triggering on every scrolling move.
|
|
4488
4490
|
// Now, some months later: the triggering frequency can easily be adjusted, the problem is that the observer doesn't trigger on hidden elements, meaning when scrolling left we don't have information about the hidden element's position from the observer
|
|
4489
4491
|
let target; // absolute index to focus on
|
|
@@ -4493,7 +4495,7 @@ function $be288a83d9eabf2a$var$_distance_to2(offset) {
|
|
|
4493
4495
|
} = this;
|
|
4494
4496
|
if (currently_selected == null) {
|
|
4495
4497
|
// if for whatever reason we don't find a card, don't do anything
|
|
4496
|
-
|
|
4498
|
+
$5e1f45affc1d7def$export$f18d5b0af29128b7(new Error("can't find card in center"), "error");
|
|
4497
4499
|
return 0;
|
|
4498
4500
|
}
|
|
4499
4501
|
target = currently_selected + offset;
|
|
@@ -4508,38 +4510,38 @@ function $be288a83d9eabf2a$var$_distance_to2(offset) {
|
|
|
4508
4510
|
}
|
|
4509
4511
|
target = Math.floor(target);
|
|
4510
4512
|
let dist;
|
|
4511
|
-
|
|
4513
|
+
$241f2f02cc612a49$export$de56f1198d121036("trying to focus target", target);
|
|
4512
4514
|
let target_element = this.element_by_index(target);
|
|
4513
4515
|
if (!target_element) {
|
|
4514
4516
|
if (this.correct_bs_targets) {
|
|
4515
4517
|
if (isNaN(target)) {
|
|
4516
|
-
|
|
4518
|
+
$241f2f02cc612a49$export$de56f1198d121036("target is not a number", target, "can't correct");
|
|
4517
4519
|
return 0;
|
|
4518
4520
|
} else if (target < 0) {
|
|
4519
|
-
|
|
4521
|
+
$241f2f02cc612a49$export$de56f1198d121036("Target", target, "is < 0, correcting to 0 because correct_bs_targets is enabled");
|
|
4520
4522
|
target = 0;
|
|
4521
4523
|
target_element = this.element_by_index(target);
|
|
4522
4524
|
if (!target_element) {
|
|
4523
|
-
|
|
4525
|
+
$241f2f02cc612a49$export$de56f1198d121036("can't find element 0");
|
|
4524
4526
|
return 0;
|
|
4525
4527
|
}
|
|
4526
4528
|
} else {
|
|
4527
|
-
|
|
4529
|
+
$241f2f02cc612a49$export$de56f1198d121036("target", target, "does not exist, correcting to last sliding element \uD83E\uDD2D");
|
|
4528
4530
|
target = this.index_of_last_element;
|
|
4529
4531
|
target_element = this.element_by_index(target);
|
|
4530
4532
|
if (!target_element) {
|
|
4531
|
-
|
|
4533
|
+
$241f2f02cc612a49$export$de56f1198d121036("last element", target, "could not be found");
|
|
4532
4534
|
return 0;
|
|
4533
4535
|
}
|
|
4534
4536
|
}
|
|
4535
4537
|
} else {
|
|
4536
|
-
|
|
4538
|
+
$241f2f02cc612a49$export$de56f1198d121036("target is bs, can't find", target, "by either data-index attribute or as child of", $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_elements).sliding_el_);
|
|
4537
4539
|
return 0;
|
|
4538
4540
|
}
|
|
4539
4541
|
}
|
|
4540
4542
|
const rectangle_of_target = target_element.getBoundingClientRect();
|
|
4541
4543
|
const distance_of_li = rectangle_of_target.left + target % 1 * rectangle_of_target.width;
|
|
4542
|
-
const rectangle_of_container =
|
|
4544
|
+
const rectangle_of_container = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_elements).sliding_el_.getBoundingClientRect();
|
|
4543
4545
|
const distance_of_container = rectangle_of_container.left;
|
|
4544
4546
|
dist = distance_of_li - distance_of_container;
|
|
4545
4547
|
if (this.center_target) try {
|
|
@@ -4559,7 +4561,7 @@ function $be288a83d9eabf2a$var$_distance_to2(offset) {
|
|
|
4559
4561
|
dist += biggest_card * num_cards_off_target;
|
|
4560
4562
|
}
|
|
4561
4563
|
} catch (e) {
|
|
4562
|
-
|
|
4564
|
+
$b000f5ef6ce456d9$export$8048b892d651b310(e);
|
|
4563
4565
|
}
|
|
4564
4566
|
return dist;
|
|
4565
4567
|
}
|
|
@@ -4568,12 +4570,12 @@ function $be288a83d9eabf2a$var$_visibility2(element, should_be_visible) {
|
|
|
4568
4570
|
if (should_be_visible && ishidden) element.classList.remove("hidden");else if (!should_be_visible && !ishidden) element.classList.add("hidden");
|
|
4569
4571
|
}
|
|
4570
4572
|
function $be288a83d9eabf2a$var$_setup_buttons2() {
|
|
4571
|
-
const goleft =
|
|
4572
|
-
const goright =
|
|
4573
|
+
const goleft = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => $be288a83d9eabf2a$var$_classPrivateMethodGet(this, $be288a83d9eabf2a$var$_scroll_to, $be288a83d9eabf2a$var$_scroll_to2).call(this, -this.stepstoslide, false, -510));
|
|
4574
|
+
const goright = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => $be288a83d9eabf2a$var$_classPrivateMethodGet(this, $be288a83d9eabf2a$var$_scroll_to, $be288a83d9eabf2a$var$_scroll_to2).call(this, this.stepstoslide, false, 510));
|
|
4573
4575
|
const {
|
|
4574
4576
|
right_: right_,
|
|
4575
4577
|
left_: left_
|
|
4576
|
-
} =
|
|
4578
|
+
} = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_elements);
|
|
4577
4579
|
left_.addEventListener("click", goleft);
|
|
4578
4580
|
right_.addEventListener("click", goright);
|
|
4579
4581
|
[left_, right_].forEach(button => {
|
|
@@ -4582,12 +4584,12 @@ function $be288a83d9eabf2a$var$_setup_buttons2() {
|
|
|
4582
4584
|
}
|
|
4583
4585
|
function $be288a83d9eabf2a$var$_create_element_structure2() {
|
|
4584
4586
|
let autoinvalidate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
4585
|
-
const es =
|
|
4587
|
+
const es = $76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_elements);
|
|
4586
4588
|
$be288a83d9eabf2a$var$_classPrivateMethodGet(this, $be288a83d9eabf2a$var$_setup_buttons, $be288a83d9eabf2a$var$_setup_buttons2).call(this);
|
|
4587
4589
|
this.container.append(es.left_, es.right_);
|
|
4588
4590
|
this.container.append(es.sliding_el_);
|
|
4589
4591
|
if (autoinvalidate) {
|
|
4590
|
-
const cache_mo = new MutationObserver(
|
|
4592
|
+
const cache_mo = new MutationObserver($5e1f45affc1d7def$export$b3bbfd758f11cfa9(records => {
|
|
4591
4593
|
this.invalidate_cache();
|
|
4592
4594
|
for (const extra_fn of this.on_elements_changed) extra_fn.call(this, records);
|
|
4593
4595
|
}));
|
|
@@ -4612,14 +4614,14 @@ function $be288a83d9eabf2a$var$_scroll_to2(offset) {
|
|
|
4612
4614
|
let is_absolute = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
4613
4615
|
let fallback_scroll_distance = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 500;
|
|
4614
4616
|
let harsh = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
4615
|
-
const left =
|
|
4617
|
+
const left = $5e1f45affc1d7def$export$b3bbfd758f11cfa9($be288a83d9eabf2a$var$_classPrivateMethodGet(this, $be288a83d9eabf2a$var$_distance_to, $be288a83d9eabf2a$var$_distance_to2)).call(this, offset, is_absolute);
|
|
4616
4618
|
const distance_after_fallback_applied = Math.round(left !== null && left !== void 0 ? left : fallback_scroll_distance);
|
|
4617
|
-
if (getComputedStyle(
|
|
4618
|
-
|
|
4619
|
+
if (getComputedStyle($76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_elements).sliding_el_).scrollSnapType !== "none" && Math.abs(distance_after_fallback_applied) < 10) {
|
|
4620
|
+
$241f2f02cc612a49$export$de56f1198d121036("Not scrolling because snapping is enabled and distance not over threshold", distance_after_fallback_applied);
|
|
4619
4621
|
return;
|
|
4620
4622
|
}
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
+
$241f2f02cc612a49$export$de56f1198d121036("Trying to scroll by", left, "px", "before fallback,", distance_after_fallback_applied, "after");
|
|
4624
|
+
$76EG6$babelruntimehelpersclassPrivateFieldGet(this, $be288a83d9eabf2a$var$_elements).sliding_el_.scrollBy({
|
|
4623
4625
|
left: distance_after_fallback_applied,
|
|
4624
4626
|
top: 0,
|
|
4625
4627
|
behavior: harsh ? "auto" : "smooth"
|
|
@@ -4634,7 +4636,7 @@ class $f340c415f2e1d03a$export$68babfc5be0de5da extends (0, $be288a83d9eabf2a$ex
|
|
|
4634
4636
|
element: element,
|
|
4635
4637
|
disconnector: disconnector
|
|
4636
4638
|
} = _ref;
|
|
4637
|
-
const i_o = new IntersectionObserver(
|
|
4639
|
+
const i_o = new IntersectionObserver($5e1f45affc1d7def$export$b3bbfd758f11cfa9(records => {
|
|
4638
4640
|
for (const record of records) if (record.intersectionRatio > 0) {
|
|
4639
4641
|
r(true);
|
|
4640
4642
|
i_o.disconnect();
|
|
@@ -4644,7 +4646,7 @@ class $f340c415f2e1d03a$export$68babfc5be0de5da extends (0, $be288a83d9eabf2a$ex
|
|
|
4644
4646
|
}),
|
|
4645
4647
|
// Fixes https://gitlab.com/depict-ai/depict.ai/-/merge_requests/5816/diffs, don't understand why
|
|
4646
4648
|
{
|
|
4647
|
-
threshold:
|
|
4649
|
+
threshold: $ab9c3dbf2bb2fbf7$export$f8ea2e7b15b5d129(10)
|
|
4648
4650
|
});
|
|
4649
4651
|
i_o.observe(element);
|
|
4650
4652
|
});
|
|
@@ -4664,7 +4666,7 @@ function $943514d07f57df12$export$fb9afe9f540ae069(elements, _display, info) {
|
|
|
4664
4666
|
if (!(elements !== null && elements !== void 0 && elements.length)) return elements;
|
|
4665
4667
|
if (!info.t) return elements;
|
|
4666
4668
|
const elements_as_array = [...elements];
|
|
4667
|
-
const handler =
|
|
4669
|
+
const handler = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(async () => {
|
|
4668
4670
|
const {
|
|
4669
4671
|
rendering_options: rendering_options,
|
|
4670
4672
|
t: t
|
|
@@ -4672,7 +4674,7 @@ function $943514d07f57df12$export$fb9afe9f540ae069(elements, _display, info) {
|
|
|
4672
4674
|
if (!$943514d07f57df12$export$4b50a4de9c6bbe09.has(rendering_options) && elements_as_array.some(e => document.documentElement.contains(e)) // check, just in case
|
|
4673
4675
|
) {
|
|
4674
4676
|
$943514d07f57df12$export$4b50a4de9c6bbe09.add(rendering_options);
|
|
4675
|
-
|
|
4677
|
+
$d5f7352b58e0d737$export$82badda1f9923310({
|
|
4676
4678
|
...t,
|
|
4677
4679
|
product_id: await t.get_product_id(),
|
|
4678
4680
|
recommendation_type: info.rendering_options.type,
|
|
@@ -4694,7 +4696,7 @@ function $943514d07f57df12$export$1bffac19f9f0d6fc(elements, _display, info) {
|
|
|
4694
4696
|
// GTAG tracking is deprecated, if we're doing no-tenant recommendation rendering it's SDK anyway.
|
|
4695
4697
|
return elements;
|
|
4696
4698
|
const [first_element] = elements;
|
|
4697
|
-
const handler =
|
|
4699
|
+
const handler = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => {
|
|
4698
4700
|
const {
|
|
4699
4701
|
rendering_options: rendering_options,
|
|
4700
4702
|
displays: displays
|
|
@@ -4707,7 +4709,7 @@ function $943514d07f57df12$export$1bffac19f9f0d6fc(elements, _display, info) {
|
|
|
4707
4709
|
const {
|
|
4708
4710
|
type: type
|
|
4709
4711
|
} = rendering_options;
|
|
4710
|
-
|
|
4712
|
+
$3674b9afc9a63520$export$7babcd5d4056b2ca(displays, get_product_id /* yes this might create errors if there's no page_url in the display but don't have time to fix, sorry */, {
|
|
4711
4713
|
list_name: "depict_" + type
|
|
4712
4714
|
});
|
|
4713
4715
|
}
|
|
@@ -4722,7 +4724,7 @@ function $943514d07f57df12$export$9e1caada6901f552(elements, _display, info) {
|
|
|
4722
4724
|
} = info;
|
|
4723
4725
|
if (!t) return elements;
|
|
4724
4726
|
(async () => {
|
|
4725
|
-
|
|
4727
|
+
$0897f35c3b3fbbc4$export$eee4c4d924348b05({
|
|
4726
4728
|
tenant: t.tenant,
|
|
4727
4729
|
market: t.market,
|
|
4728
4730
|
product_id: await t.get_product_id()
|
|
@@ -4737,9 +4739,9 @@ function $943514d07f57df12$export$8d72437623fef90c(elements, display, info) {
|
|
|
4737
4739
|
ga_product_id: ga_product_id,
|
|
4738
4740
|
product_id: product_id
|
|
4739
4741
|
} = display;
|
|
4740
|
-
if (Array.isArray(ga_product_ids)) for (let i = 0; i < ga_product_ids.length; i++)
|
|
4742
|
+
if (Array.isArray(ga_product_ids)) for (let i = 0; i < ga_product_ids.length; i++) $3674b9afc9a63520$export$f522672c9379e339(ga_product_ids[i], info.index, {
|
|
4741
4743
|
list_name: "depict_" + info.rendering_options.type
|
|
4742
|
-
});else
|
|
4744
|
+
});else $3674b9afc9a63520$export$f522672c9379e339(ga_product_id || product_id, info.index, {
|
|
4743
4745
|
list_name: "depict_" + info.rendering_options.type
|
|
4744
4746
|
});
|
|
4745
4747
|
};
|
|
@@ -4756,7 +4758,7 @@ function $943514d07f57df12$export$e9106d6e723510d2(elements, display, info) {
|
|
|
4756
4758
|
index: index,
|
|
4757
4759
|
rendering_options: rendering_options
|
|
4758
4760
|
} = info;
|
|
4759
|
-
return
|
|
4761
|
+
return $d5f7352b58e0d737$export$15f8a0cd5a8c0ebb({
|
|
4760
4762
|
...t,
|
|
4761
4763
|
...rendering_options,
|
|
4762
4764
|
...display,
|
|
@@ -4781,14 +4783,14 @@ function $943514d07f57df12$export$32eb5dd18e963410(elements, display, info) {
|
|
|
4781
4783
|
} = "variant_index" in display ? display.variant_displays[display.variant_index] : display;
|
|
4782
4784
|
if (!(elements !== null && elements !== void 0 && elements.length)) return elements;
|
|
4783
4785
|
for (const element of elements) {
|
|
4784
|
-
const handler =
|
|
4786
|
+
const handler = $bd7c9f254946941d$export$82a685f2da2fb027(element, product_id, recommendation_id || search_result_id);
|
|
4785
4787
|
if (handler) $943514d07f57df12$var$push_function($943514d07f57df12$export$32eb5dd18e963410, handler);
|
|
4786
4788
|
}
|
|
4787
4789
|
return elements;
|
|
4788
4790
|
}
|
|
4789
4791
|
function $943514d07f57df12$export$dd32cb565eae0a1f(elements, display, info) {
|
|
4790
4792
|
const handler = () => {
|
|
4791
|
-
|
|
4793
|
+
$3674b9afc9a63520$export$127751e82111fcf();
|
|
4792
4794
|
};
|
|
4793
4795
|
$943514d07f57df12$var$push_function($943514d07f57df12$export$dd32cb565eae0a1f, handler);
|
|
4794
4796
|
info.register_event_listener("click", handler, {
|
|
@@ -4836,7 +4838,7 @@ async function $70017d06e57dffa8$export$50ce83ace0cdd87e(t, rendering_options) {
|
|
|
4836
4838
|
view_tracking: view_tracking,
|
|
4837
4839
|
click_tracking: click_tracking
|
|
4838
4840
|
} = rendering_options;
|
|
4839
|
-
return await
|
|
4841
|
+
return await $378c98788ab52b9c$export$a9fc160c5ed83bd7(t, {
|
|
4840
4842
|
...rendering_options,
|
|
4841
4843
|
headers: {
|
|
4842
4844
|
...((0, $20fe9624210ef635$export$deca40f48c0569f8) ? {
|
|
@@ -4859,7 +4861,7 @@ async function $d4f914b34cc77d0c$export$cab8bc58c64c2013(t, rendering_options, o
|
|
|
4859
4861
|
let {
|
|
4860
4862
|
container: container
|
|
4861
4863
|
} = options_for_us;
|
|
4862
|
-
if (typeof container == "string") container = [
|
|
4864
|
+
if (typeof container == "string") container = [...$652300c6621d5500$export$44951404cb8d0583(container)];
|
|
4863
4865
|
if (container && !Array.isArray(container)) container = [...container];
|
|
4864
4866
|
const slider = new (0, $f340c415f2e1d03a$export$68babfc5be0de5da)({
|
|
4865
4867
|
dist_to_hide_left: 10,
|
|
@@ -4869,17 +4871,17 @@ async function $d4f914b34cc77d0c$export$cab8bc58c64c2013(t, rendering_options, o
|
|
|
4869
4871
|
const recs = await local_rr(t, {
|
|
4870
4872
|
...rendering_options,
|
|
4871
4873
|
post_processors: [(elements, display) => {
|
|
4872
|
-
|
|
4874
|
+
$652300c6621d5500$export$5e63aea0cac01fa0(elements, ".rec_outer").forEach(ro => ro.classList.add("noautospacing"));
|
|
4873
4875
|
return elements;
|
|
4874
4876
|
}, ...(rendering_options.post_processors || [])]
|
|
4875
4877
|
});
|
|
4876
4878
|
if (!recs.elements) {
|
|
4877
|
-
|
|
4879
|
+
$241f2f02cc612a49$export$de56f1198d121036("Pro_Slider says bye bye cuz no recs");
|
|
4878
4880
|
return {};
|
|
4879
4881
|
}
|
|
4880
4882
|
slider.insert_here.append(...recs.elements);
|
|
4881
4883
|
if (container) {
|
|
4882
|
-
const [root] =
|
|
4884
|
+
const [root] = $652300c6621d5500$export$5e63aea0cac01fa0(container, root_selector || ".grid");
|
|
4883
4885
|
root[insertion_verb](slider.container);
|
|
4884
4886
|
}
|
|
4885
4887
|
return {
|
|
@@ -4924,7 +4926,7 @@ class $eb252431088a7c2b$export$1a8782481a9af507 {
|
|
|
4924
4926
|
type: type,
|
|
4925
4927
|
market: market
|
|
4926
4928
|
} = this.settings;
|
|
4927
|
-
|
|
4929
|
+
$51dfcecbe05cc4e5$export$1bc0df10745d5412(
|
|
4928
4930
|
// @ts-ignore - Quick workaround, as we don't have a tenant object here
|
|
4929
4931
|
{
|
|
4930
4932
|
tenant: tenant,
|
|
@@ -4934,7 +4936,7 @@ class $eb252431088a7c2b$export$1a8782481a9af507 {
|
|
|
4934
4936
|
product_id: product_id()
|
|
4935
4937
|
}).then(recs => {
|
|
4936
4938
|
this.data = recs;
|
|
4937
|
-
|
|
4939
|
+
$bcc7b73f8b96a6f0$export$8582cf3716962dc2({
|
|
4938
4940
|
...this.settings,
|
|
4939
4941
|
recs: this.data,
|
|
4940
4942
|
min_recs: this.settings.min_items || this.settings.max_items
|
|
@@ -4951,14 +4953,14 @@ class $eb252431088a7c2b$export$1a8782481a9af507 {
|
|
|
4951
4953
|
}
|
|
4952
4954
|
if (!action || action instanceof Event) action = "rec_bar_click";
|
|
4953
4955
|
if (action == "rec_bar_click" && typeof index != "undefined" && product_id) {
|
|
4954
|
-
if (Array.isArray(ga_product_ids)) for (const id of ga_product_ids)
|
|
4956
|
+
if (Array.isArray(ga_product_ids)) for (const id of ga_product_ids) $3674b9afc9a63520$export$f522672c9379e339(id, index, {
|
|
4955
4957
|
list_name: "depict_" + this.settings.type
|
|
4956
|
-
});else
|
|
4958
|
+
});else $3674b9afc9a63520$export$f522672c9379e339(product_id, index, {
|
|
4957
4959
|
list_name: "depict_" + this.settings.type
|
|
4958
4960
|
});
|
|
4959
4961
|
}
|
|
4960
4962
|
if (this.tracker === undefined) this.tracker = ga("create", this.settings.gaid, "auto", "depict");
|
|
4961
|
-
|
|
4963
|
+
$3674b9afc9a63520$export$f75172d2e289cd02(action);
|
|
4962
4964
|
}
|
|
4963
4965
|
trackPageView() {
|
|
4964
4966
|
if ($eb252431088a7c2b$var$pageview_sent) {
|
|
@@ -4969,12 +4971,12 @@ class $eb252431088a7c2b$export$1a8782481a9af507 {
|
|
|
4969
4971
|
const {
|
|
4970
4972
|
product_id: product_id
|
|
4971
4973
|
} = this.settings;
|
|
4972
|
-
|
|
4974
|
+
$0897f35c3b3fbbc4$export$eee4c4d924348b05(typeof product_id === "function" ? product_id() : product_id);
|
|
4973
4975
|
}
|
|
4974
4976
|
trackClick(index) {
|
|
4975
4977
|
const item = this.data[index];
|
|
4976
4978
|
if (item === undefined) return;
|
|
4977
|
-
return
|
|
4979
|
+
return $d5f7352b58e0d737$export$15f8a0cd5a8c0ebb({
|
|
4978
4980
|
...this.settings,
|
|
4979
4981
|
...item,
|
|
4980
4982
|
click_location: "".concat(this.settings.type, "_").concat(index + 1),
|
|
@@ -4982,7 +4984,7 @@ class $eb252431088a7c2b$export$1a8782481a9af507 {
|
|
|
4982
4984
|
});
|
|
4983
4985
|
}
|
|
4984
4986
|
trackAddToCart(pId) {
|
|
4985
|
-
return
|
|
4987
|
+
return $d5f7352b58e0d737$export$9028351cb994757e({
|
|
4986
4988
|
...this.settings,
|
|
4987
4989
|
product_id: pId && !(pId instanceof Event) ? pId : this.settings.product_id()
|
|
4988
4990
|
});
|
|
@@ -5063,9 +5065,9 @@ class $eb252431088a7c2b$export$1a8782481a9af507 {
|
|
|
5063
5065
|
if (!this.settings.DNT) for (const element of elements) {
|
|
5064
5066
|
// recommendations_inserted event
|
|
5065
5067
|
(0, $90fa633a9564f115$export$b6ae1bc530f4c149).oncreation(element, () => {
|
|
5066
|
-
if (
|
|
5067
|
-
|
|
5068
|
-
|
|
5068
|
+
if (!$76EG6$babelruntimehelpersclassPrivateFieldGet(this, $eb252431088a7c2b$var$_dispatched_recs_inserted)) {
|
|
5069
|
+
$76EG6$babelruntimehelpersclassPrivateFieldSet(this, $eb252431088a7c2b$var$_dispatched_recs_inserted, true);
|
|
5070
|
+
$d5f7352b58e0d737$export$82badda1f9923310({
|
|
5069
5071
|
...this.settings,
|
|
5070
5072
|
product_id: product_id_at_rendering,
|
|
5071
5073
|
recommendation_type: this.settings.type,
|
|
@@ -5078,8 +5080,8 @@ class $eb252431088a7c2b$export$1a8782481a9af507 {
|
|
|
5078
5080
|
this.trackGAEvent("rec_bar_click", rec_index, item.ga_product_id || item.product_id || this.settings.product_id(item.page_url), item.ga_product_ids);
|
|
5079
5081
|
};
|
|
5080
5082
|
element.addEventListener("click", listener);
|
|
5081
|
-
|
|
5082
|
-
if (this.settings.shade)
|
|
5083
|
+
$bd7c9f254946941d$export$82a685f2da2fb027(element, item.product_id, item.recommendation_id);
|
|
5084
|
+
if (this.settings.shade) $f2fce07b3a330e05$export$6ebd242c09192cec(element);
|
|
5083
5085
|
// @ts-ignore
|
|
5084
5086
|
if (!element.depict_event_listeners)
|
|
5085
5087
|
// @ts-ignore
|
|
@@ -5091,7 +5093,7 @@ class $eb252431088a7c2b$export$1a8782481a9af507 {
|
|
|
5091
5093
|
resultingElements.push(...elements);
|
|
5092
5094
|
});
|
|
5093
5095
|
this.data = recsArray;
|
|
5094
|
-
if (!this.settings.DNT)
|
|
5096
|
+
if (!this.settings.DNT) $3674b9afc9a63520$export$7babcd5d4056b2ca(recsArray, this.settings.product_id, {
|
|
5095
5097
|
list_name: "depict_" + this.settings.type
|
|
5096
5098
|
});
|
|
5097
5099
|
return resultingElements;
|
|
@@ -5147,8 +5149,8 @@ $48b0f027b215b8ad$export$2e2bcd8739ae039 = async options => {
|
|
|
5147
5149
|
};
|
|
5148
5150
|
|
|
5149
5151
|
// @ts-ignore
|
|
5150
|
-
var $
|
|
5151
|
-
$
|
|
5152
|
+
var $9c3f55fbde559b71$exports = {};
|
|
5153
|
+
$9c3f55fbde559b71$exports = ".depict .rec_outer.noautospacing {\n width: 6cm;\n max-width: 46vw;\n margin-left: 1%;\n margin-right: 1%;\n}\n\n.depict .rec_outer.noautospacing:nth-child(1) {\n margin-left: 0;\n}\n\n.depict .rec_outer.noautospacing:nth-last-child(1) {\n margin-right: 0;\n}\n\n.depict-slider .slider_snap {\n scroll-snap-type: x mandatory;\n}\n\n.depict-slider {\n width: 100%;\n position: relative;\n}\n\n.depict-slider .sliding::-webkit-scrollbar {\n display: none;\n}\n\n.depict-slider .sliding {\n scroll-behavior: smooth;\n -ms-overflow-style: none;\n scrollbar-width: none;\n flex-flow: row;\n margin-top: -1%;\n margin-bottom: -2%;\n padding-top: 1%;\n padding-bottom: 2%;\n display: flex;\n overflow-x: scroll;\n}\n\n.depict-slider .sliding > * {\n box-sizing: border-box;\n flex: none;\n}\n\n.depict-slider button.right {\n right: 0;\n}\n\n.depict-slider button.left, .depict-slider button.right {\n z-index: 2;\n touch-action: manipulation;\n width: 1cm;\n height: 1cm;\n cursor: pointer;\n background: #fff;\n border: none;\n padding: .5%;\n transition-duration: .2s;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n}\n\n.depict-slider button.left.hidden, .depict-slider button.right.hidden {\n opacity: 0;\n cursor: default;\n}\n\n.depict-slider button.left {\n left: 0;\n transform: translateY(-50%)rotate(180deg);\n}\n\n.depict-slider button.left img, .depict-slider button.right img {\n width: 100%;\n height: 100%;\n}\n\n.depict-slider .rec_outer {\n margin-top: 0 !important;\n}\n\n";
|
|
5152
5154
|
const $0342f59060b8a196$var$default_image_src = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjYsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCAxNiAxNiIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMTYgMTY7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxwb2x5Z29uIHBvaW50cz0iOSwyLjYgOC4zLDMuNCAxMi40LDcuNSAxLjYsNy41IDEuNiw4LjUgMTIuNCw4LjUgOC4zLDEyLjYgOSwxMy40IDE0LjQsOCAiLz4NCjwvc3ZnPg0K";
|
|
5153
5155
|
class $0342f59060b8a196$export$4d41c6499d53639c extends (0, $f340c415f2e1d03a$export$68babfc5be0de5da) {
|
|
5154
5156
|
constructor(static_options, override_lazyfier_options) {
|
|
@@ -5164,7 +5166,7 @@ class $0342f59060b8a196$export$4d41c6499d53639c extends (0, $f340c415f2e1d03a$ex
|
|
|
5164
5166
|
super(options, {
|
|
5165
5167
|
lazyfinder: {
|
|
5166
5168
|
unload(image) {
|
|
5167
|
-
|
|
5169
|
+
$5e1f45affc1d7def$export$b3bbfd758f11cfa9(async () => {
|
|
5168
5170
|
var _image$dataset, _image$dataset$src;
|
|
5169
5171
|
if (!(image !== null && image !== void 0 && (_image$dataset = image.dataset) !== null && _image$dataset !== void 0 && (_image$dataset$src = _image$dataset.src) !== null && _image$dataset$src !== void 0 && _image$dataset$src.length)) {
|
|
5170
5172
|
image.dataset.src = image.src;
|
|
@@ -5180,7 +5182,7 @@ class $0342f59060b8a196$export$4d41c6499d53639c extends (0, $f340c415f2e1d03a$ex
|
|
|
5180
5182
|
function $0342f59060b8a196$export$f1b8b9fd75ddcab1(slider) {
|
|
5181
5183
|
const style_elem = document.createElement("style");
|
|
5182
5184
|
style_elem.type = "text/css";
|
|
5183
|
-
style_elem.append((0, /*@__PURE__*/$parcel$interopDefault($
|
|
5185
|
+
style_elem.append((0, /*@__PURE__*/$parcel$interopDefault($9c3f55fbde559b71$exports)));
|
|
5184
5186
|
slider.container.appendChild(style_elem);
|
|
5185
5187
|
}
|
|
5186
5188
|
async function $b7b39b38d6e695e9$export$cd12721587f4f16d(t, rendering_options, options_for_us, slider_options, override_lazyfier_options) {
|
|
@@ -5197,7 +5199,7 @@ async function $b7b39b38d6e695e9$export$cd12721587f4f16d(t, rendering_options, o
|
|
|
5197
5199
|
let {
|
|
5198
5200
|
container: container
|
|
5199
5201
|
} = options_for_us;
|
|
5200
|
-
if (typeof container == "string") container = [
|
|
5202
|
+
if (typeof container == "string") container = [...$652300c6621d5500$export$44951404cb8d0583(container)];
|
|
5201
5203
|
if (container && !Array.isArray(container)) container = [...container];
|
|
5202
5204
|
const slider = new (0, $0342f59060b8a196$export$4d41c6499d53639c)({
|
|
5203
5205
|
dlog: dlog,
|
|
@@ -5209,7 +5211,7 @@ async function $b7b39b38d6e695e9$export$cd12721587f4f16d(t, rendering_options, o
|
|
|
5209
5211
|
const recs = await local_rr(t, {
|
|
5210
5212
|
...rendering_options,
|
|
5211
5213
|
post_processors: [(elements, display) => {
|
|
5212
|
-
|
|
5214
|
+
$652300c6621d5500$export$5e63aea0cac01fa0(elements, "a.rec_outer").forEach(ro => ro.classList.add("noautospacing"));
|
|
5213
5215
|
return elements;
|
|
5214
5216
|
}, ...(rendering_options.post_processors || [])]
|
|
5215
5217
|
});
|
|
@@ -5219,7 +5221,7 @@ async function $b7b39b38d6e695e9$export$cd12721587f4f16d(t, rendering_options, o
|
|
|
5219
5221
|
}
|
|
5220
5222
|
slider.insert_here.append(...recs.elements);
|
|
5221
5223
|
if (container) {
|
|
5222
|
-
const [root] =
|
|
5224
|
+
const [root] = $652300c6621d5500$export$5e63aea0cac01fa0(container, root_selector || ".grid");
|
|
5223
5225
|
root[insertion_verb](slider.container);
|
|
5224
5226
|
}
|
|
5225
5227
|
return {
|
|
@@ -5253,8 +5255,8 @@ async function $19946af5b386da54$export$30933c637c977eef(_ref) {
|
|
|
5253
5255
|
catchify: catchify,
|
|
5254
5256
|
dlog: dlog
|
|
5255
5257
|
} = t,
|
|
5256
|
-
container = [
|
|
5257
|
-
root =
|
|
5258
|
+
container = [...$652300c6621d5500$export$44951404cb8d0583(container_template)],
|
|
5259
|
+
root = $652300c6621d5500$export$5e63aea0cac01fa0(container, ".grid")[0],
|
|
5258
5260
|
internal_pre_processors = [...pre_processors],
|
|
5259
5261
|
// copy arrays so we don't unintentionally modify an array of a script calling us when doing auto postprocessor for slider if insertion_promise is defined
|
|
5260
5262
|
internal_post_processors = [...post_processors];
|
|
@@ -5267,7 +5269,7 @@ async function $19946af5b386da54$export$30933c637c977eef(_ref) {
|
|
|
5267
5269
|
root.replaceWith(slider.container);
|
|
5268
5270
|
if (insertion_promise) internal_post_processors.push((t, items, d) => {
|
|
5269
5271
|
for (const item of items) insertion_promise.then(() => {
|
|
5270
|
-
|
|
5272
|
+
$e89a1d249db21af0$export$37125ccc5dd98050({
|
|
5271
5273
|
element: item,
|
|
5272
5274
|
data: {
|
|
5273
5275
|
tenant: t.tenant,
|
|
@@ -5284,7 +5286,7 @@ async function $19946af5b386da54$export$30933c637c977eef(_ref) {
|
|
|
5284
5286
|
});
|
|
5285
5287
|
}
|
|
5286
5288
|
if (!slider || !insertion_promise) internal_post_processors.push((t, items, d) => {
|
|
5287
|
-
for (const item of items)
|
|
5289
|
+
for (const item of items) $e89a1d249db21af0$export$37125ccc5dd98050({
|
|
5288
5290
|
element: item,
|
|
5289
5291
|
data: {
|
|
5290
5292
|
tenant: t.tenant,
|
|
@@ -5298,7 +5300,7 @@ async function $19946af5b386da54$export$30933c637c977eef(_ref) {
|
|
|
5298
5300
|
});
|
|
5299
5301
|
return items;
|
|
5300
5302
|
});
|
|
5301
|
-
const template_tool = await
|
|
5303
|
+
const template_tool = await $48b0f027b215b8ad$export$2e2bcd8739ae039({
|
|
5302
5304
|
options: {
|
|
5303
5305
|
...t,
|
|
5304
5306
|
...(template_tool_options || {})
|
|
@@ -5322,7 +5324,7 @@ async function $19946af5b386da54$export$30933c637c977eef(_ref) {
|
|
|
5322
5324
|
if (with_loadmore) catchify($19946af5b386da54$var$setup_load_more)(t, root, chunk_size_for_load_more);
|
|
5323
5325
|
if (infinite_scroll) catchify($19946af5b386da54$var$setup_infinite_scroll)(t, root);
|
|
5324
5326
|
if (title) {
|
|
5325
|
-
const [title_element] =
|
|
5327
|
+
const [title_element] = $652300c6621d5500$export$5e63aea0cac01fa0(container, "h1.title, h2.title, h3.title, h4.title, h5.title, h6.title");
|
|
5326
5328
|
if (title_element) {
|
|
5327
5329
|
if (typeof title == "string") title_element.innerText = title;else title_element.replaceWith(...title);
|
|
5328
5330
|
}
|
|
@@ -5368,8 +5370,8 @@ function $19946af5b386da54$var$setup_load_more(t, root, chunk_size) {
|
|
|
5368
5370
|
const {
|
|
5369
5371
|
catchify: catchify
|
|
5370
5372
|
} = t,
|
|
5371
|
-
load_more_cont =
|
|
5372
|
-
load_button = load_more_cont.appendChild(
|
|
5373
|
+
load_more_cont = $652300c6621d5500$export$d3e2a0560cbf4787('<div class="load-more-container"></div>'),
|
|
5374
|
+
load_button = load_more_cont.appendChild($652300c6621d5500$export$d3e2a0560cbf4787('<button class="load_more">Visa mer</button>'));
|
|
5373
5375
|
load_button.addEventListener("click", catchify(load_more_recs_and_hide_button_if_needed));
|
|
5374
5376
|
root.after(load_more_cont);
|
|
5375
5377
|
load_more_recs_and_hide_button_if_needed();
|
|
@@ -5441,7 +5443,7 @@ $03021b39f80fac4b$export$2e2bcd8739ae039 = (dlog, error_log) => {
|
|
|
5441
5443
|
} : {})
|
|
5442
5444
|
}).then(async response => {
|
|
5443
5445
|
if (!response || !response.ok || response.status !== 200) {
|
|
5444
|
-
if (response.status === 422)
|
|
5446
|
+
if (response.status === 422) $5e1f45affc1d7def$export$b3bbfd758f11cfa9($03021b39f80fac4b$var$send_sentry_422)(response, body, stack);
|
|
5445
5447
|
elog("Response not ok", response);
|
|
5446
5448
|
return false;
|
|
5447
5449
|
} else return await response[decode_json ? "json" : "text"]().catch(e => elog("error while decoding json", e));
|
|
@@ -5456,32 +5458,32 @@ $03021b39f80fac4b$export$2e2bcd8739ae039 = (dlog, error_log) => {
|
|
|
5456
5458
|
async function $03021b39f80fac4b$var$send_sentry_422(response, body, stack) {
|
|
5457
5459
|
const msg = "Validation error: got 422 from API";
|
|
5458
5460
|
const text = await response.text();
|
|
5459
|
-
|
|
5461
|
+
$241f2f02cc612a49$export$de56f1198d121036(msg, "body", body, "response", response, "text", text, "stack", stack);
|
|
5460
5462
|
(0, $17bb552dedcd526c$export$af2e17a20c2ea3c5).withScope(function (scope) {
|
|
5461
5463
|
scope.setExtra("stack", stack);
|
|
5462
5464
|
scope.setExtra("request_body", body);
|
|
5463
5465
|
scope.setExtra("response", response);
|
|
5464
|
-
scope.setExtra("serialized_response",
|
|
5466
|
+
scope.setExtra("serialized_response", $d9aec442b12a1134$export$39d526a1194b6499(response));
|
|
5465
5467
|
scope.setExtra("response_text", text);
|
|
5466
5468
|
scope.setLevel("error");
|
|
5467
5469
|
this.captureException(new Error(msg));
|
|
5468
5470
|
});
|
|
5469
5471
|
}
|
|
5470
|
-
const $c755e2b0d4b18501$export$dc84183312f0c201 = /*@__PURE__*/(() =>
|
|
5472
|
+
const $c755e2b0d4b18501$export$dc84183312f0c201 = /*@__PURE__*/(() => $0f650018c3cbc373$export$25062201e9e25d76("svg", {
|
|
5471
5473
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5472
5474
|
viewBox: "0 0 320 512",
|
|
5473
|
-
children: [
|
|
5475
|
+
children: [$0f650018c3cbc373$export$34b9dba7ce09269b("desc", {
|
|
5474
5476
|
children: "Right arrow"
|
|
5475
|
-
}),
|
|
5477
|
+
}), $0f650018c3cbc373$export$34b9dba7ce09269b("path", {
|
|
5476
5478
|
d: "M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"
|
|
5477
5479
|
})]
|
|
5478
5480
|
}))();
|
|
5479
|
-
const $c755e2b0d4b18501$export$6038895ac52bd044 = /*@__PURE__*/(() =>
|
|
5481
|
+
const $c755e2b0d4b18501$export$6038895ac52bd044 = /*@__PURE__*/(() => $0f650018c3cbc373$export$25062201e9e25d76("svg", {
|
|
5480
5482
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5481
5483
|
viewBox: "0 0 320 512",
|
|
5482
|
-
children: [
|
|
5484
|
+
children: [$0f650018c3cbc373$export$34b9dba7ce09269b("desc", {
|
|
5483
5485
|
children: "Left arrow"
|
|
5484
|
-
}),
|
|
5486
|
+
}), $0f650018c3cbc373$export$34b9dba7ce09269b("path", {
|
|
5485
5487
|
d: "M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z"
|
|
5486
5488
|
})]
|
|
5487
5489
|
}))();
|
|
@@ -5499,7 +5501,7 @@ const $0fe3923936d40f55$export$68c017fd93791405 = function () {
|
|
|
5499
5501
|
container.append(content);
|
|
5500
5502
|
const expand = () => {
|
|
5501
5503
|
container.style.height = content.clientHeight + "px";
|
|
5502
|
-
setTimeout(
|
|
5504
|
+
setTimeout($5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => {
|
|
5503
5505
|
container.style.overflow = "unset";
|
|
5504
5506
|
container.style.height = "auto";
|
|
5505
5507
|
}), duration);
|
|
@@ -5511,14 +5513,14 @@ const $0fe3923936d40f55$export$68c017fd93791405 = function () {
|
|
|
5511
5513
|
};
|
|
5512
5514
|
};
|
|
5513
5515
|
function $07beada135e5f5e8$export$f8913c8a18f7ca21(iterables) {
|
|
5514
|
-
const ourselves =
|
|
5516
|
+
const ourselves = $7ca6fdc721083788$export$e806c6c1615a59ae();
|
|
5515
5517
|
const values = new Array(iterables.length);
|
|
5516
|
-
Promise.all(iterables.map(
|
|
5518
|
+
Promise.all(iterables.map($5e1f45affc1d7def$export$b3bbfd758f11cfa9(async (iterable, index) => {
|
|
5517
5519
|
for await (const value of iterable) {
|
|
5518
5520
|
values[index] = value;
|
|
5519
5521
|
ourselves([...values]);
|
|
5520
5522
|
}
|
|
5521
|
-
}))).then(
|
|
5523
|
+
}))).then($5e1f45affc1d7def$export$b3bbfd758f11cfa9(ourselves.exit));
|
|
5522
5524
|
return ourselves;
|
|
5523
5525
|
}
|
|
5524
5526
|
let $df6d080cba513381$var$_Symbol$iterator, $df6d080cba513381$var$_Symbol$toPrimitive;
|
|
@@ -5543,16 +5545,16 @@ async function $df6d080cba513381$export$c84671f46d6a1ca(_ref) {
|
|
|
5543
5545
|
ipns: ipns
|
|
5544
5546
|
} = rows_or_empty_object;
|
|
5545
5547
|
const is_static = !ipns && !button;
|
|
5546
|
-
const our_style_el =
|
|
5548
|
+
const our_style_el = $0f650018c3cbc373$export$34b9dba7ce09269b("style", {
|
|
5547
5549
|
type: "text/css"
|
|
5548
5550
|
});
|
|
5549
|
-
const container_class =
|
|
5551
|
+
const container_class = $6cb4d83127e468ea$export$a6db784f019668ba();
|
|
5550
5552
|
const selector_beginning = ".depict .".concat(container_class, ">");
|
|
5551
|
-
const el_count_ipns =
|
|
5553
|
+
const el_count_ipns = $7ca6fdc721083788$export$e806c6c1615a59ae();
|
|
5552
5554
|
const set_length = () => el_count_ipns(container_element.children.length);
|
|
5553
5555
|
const col_styling = $df6d080cba513381$export$17c3166a7ebd4688(selector_beginning, grid_spacing, cols_at_size, layout, override_vertical_spacing);
|
|
5554
5556
|
let button_class;
|
|
5555
|
-
ipns || (ipns =
|
|
5557
|
+
ipns || (ipns = $7ca6fdc721083788$export$e806c6c1615a59ae());
|
|
5556
5558
|
container_element.after(our_style_el);
|
|
5557
5559
|
container_element.classList.add(container_class);
|
|
5558
5560
|
if (rows === "all") {
|
|
@@ -5562,7 +5564,7 @@ async function $df6d080cba513381$export$c84671f46d6a1ca(_ref) {
|
|
|
5562
5564
|
}
|
|
5563
5565
|
ipns(start_rows);
|
|
5564
5566
|
set_length();
|
|
5565
|
-
const mutation_observer = new MutationObserver(
|
|
5567
|
+
const mutation_observer = new MutationObserver($5e1f45affc1d7def$export$b3bbfd758f11cfa9(set_length));
|
|
5566
5568
|
(0, $90fa633a9564f115$export$b6ae1bc530f4c149).oncreation(container_element, _ref2 => {
|
|
5567
5569
|
let {
|
|
5568
5570
|
element: element
|
|
@@ -5583,10 +5585,10 @@ async function $df6d080cba513381$export$c84671f46d6a1ca(_ref) {
|
|
|
5583
5585
|
ipns.exit();
|
|
5584
5586
|
});
|
|
5585
5587
|
if (button) {
|
|
5586
|
-
button_class =
|
|
5587
|
-
const button_container =
|
|
5588
|
+
button_class = $6cb4d83127e468ea$export$a6db784f019668ba();
|
|
5589
|
+
const button_container = $0f650018c3cbc373$export$34b9dba7ce09269b("div", {
|
|
5588
5590
|
class: "load-more-container " + button_class,
|
|
5589
|
-
children:
|
|
5591
|
+
children: $a285401a927e4306$export$f63fcc839cb0f734("click", () => {
|
|
5590
5592
|
var _rows_or_empty_object;
|
|
5591
5593
|
return ipns(ipns.state + ((_rows_or_empty_object = rows_or_empty_object.rows_per_click) !== null && _rows_or_empty_object !== void 0 ? _rows_or_empty_object : 1));
|
|
5592
5594
|
}, button)
|
|
@@ -5594,7 +5596,7 @@ async function $df6d080cba513381$export$c84671f46d6a1ca(_ref) {
|
|
|
5594
5596
|
container_element.after(button_container);
|
|
5595
5597
|
}
|
|
5596
5598
|
(0, $90fa633a9564f115$export$b6ae1bc530f4c149).oncreation(container_element, async () => {
|
|
5597
|
-
for await (const [currently_showing_rows, number_of_els] of
|
|
5599
|
+
for await (const [currently_showing_rows, number_of_els] of $07beada135e5f5e8$export$f8913c8a18f7ca21([
|
|
5598
5600
|
// start for await loop when the container element gets inserted into the DOM
|
|
5599
5601
|
// the loop is broken by an observer.onremoved above calling .exit on the IPNS this depends on
|
|
5600
5602
|
// @ts-ignore
|
|
@@ -5739,7 +5741,7 @@ class $df6d080cba513381$var$CSSMeasurement {
|
|
|
5739
5741
|
return hint == "number" ? this.valueOf() : this.toString();
|
|
5740
5742
|
}
|
|
5741
5743
|
constructor(measurement) {
|
|
5742
|
-
|
|
5744
|
+
$76EG6$babelruntimehelpersdefineProperty(this, $df6d080cba513381$var$_Symbol$iterator, function* () {
|
|
5743
5745
|
if (this.is_fe) throw new Error("Function expression isn't iterable: " + this.e);
|
|
5744
5746
|
yield this.v;
|
|
5745
5747
|
yield this.u;
|
|
@@ -5765,7 +5767,7 @@ async function $297a08bac2d81fab$export$b0a773486c1c2312(t, recommendation_rende
|
|
|
5765
5767
|
eager_images: eager_images,
|
|
5766
5768
|
...options_for_grid
|
|
5767
5769
|
} = _ref;
|
|
5768
|
-
const [insertion_point] =
|
|
5770
|
+
const [insertion_point] = $652300c6621d5500$export$5e63aea0cac01fa0(container_elements, container_selector || ".grid");
|
|
5769
5771
|
const rendering_result = await (override_rec_renderer || (0, $70017d06e57dffa8$export$2e2bcd8739ae039))(t, recommendation_renderer_options);
|
|
5770
5772
|
const {
|
|
5771
5773
|
elements: elements
|
|
@@ -5776,7 +5778,7 @@ async function $297a08bac2d81fab$export$b0a773486c1c2312(t, recommendation_rende
|
|
|
5776
5778
|
// when the elements are in the DOM starts IntersectionObserver on whole grid
|
|
5777
5779
|
// when grid intersects starts Lazyfier
|
|
5778
5780
|
// this is because Lazyfier is fucking stupid
|
|
5779
|
-
(0, $90fa633a9564f115$export$b6ae1bc530f4c149).wait_for_element(insertion_point).then(
|
|
5781
|
+
(0, $90fa633a9564f115$export$b6ae1bc530f4c149).wait_for_element(insertion_point).then($5e1f45affc1d7def$export$b3bbfd758f11cfa9(element => {
|
|
5780
5782
|
let start_lazy_loading;
|
|
5781
5783
|
const lazy_loading_promise = new Promise(r => start_lazy_loading = r);
|
|
5782
5784
|
const lf = new (0, $5f31622ffb78bc10$export$3be7054c61590ee3)({
|
|
@@ -5785,7 +5787,7 @@ async function $297a08bac2d81fab$export$b0a773486c1c2312(t, recommendation_rende
|
|
|
5785
5787
|
...lazyfier_options
|
|
5786
5788
|
});
|
|
5787
5789
|
lf.start_observing_for_new_children_(element);
|
|
5788
|
-
const i_o = new IntersectionObserver(
|
|
5790
|
+
const i_o = new IntersectionObserver($5e1f45affc1d7def$export$b3bbfd758f11cfa9(records => {
|
|
5789
5791
|
for (const record of records) if (record.intersectionRatio > 0) {
|
|
5790
5792
|
start_lazy_loading();
|
|
5791
5793
|
i_o.disconnect();
|
|
@@ -5795,7 +5797,7 @@ async function $297a08bac2d81fab$export$b0a773486c1c2312(t, recommendation_rende
|
|
|
5795
5797
|
i_o.observe(insertion_point);
|
|
5796
5798
|
}));
|
|
5797
5799
|
insertion_point.append(...elements);
|
|
5798
|
-
|
|
5800
|
+
$df6d080cba513381$export$c84671f46d6a1ca({
|
|
5799
5801
|
...options_for_grid,
|
|
5800
5802
|
container_element: insertion_point,
|
|
5801
5803
|
layout: "grid"
|
|
@@ -5807,8 +5809,8 @@ async function $297a08bac2d81fab$export$b0a773486c1c2312(t, recommendation_rende
|
|
|
5807
5809
|
}
|
|
5808
5810
|
|
|
5809
5811
|
// @ts-ignore
|
|
5810
|
-
var $
|
|
5811
|
-
$
|
|
5812
|
+
var $9f7f2b36a558e2bd$exports = {};
|
|
5813
|
+
$9f7f2b36a558e2bd$exports = ".depict-slider {\n width: 100%;\n position: relative;\n}\n\n.depict-slider .sliding {\n scroll-behavior: smooth;\n -ms-overflow-style: none;\n scrollbar-width: none;\n flex-flow: row;\n display: flex;\n overflow-x: scroll;\n}\n\n.depict-slider .sliding::-webkit-scrollbar {\n display: none;\n}\n\n.depict-slider .sliding > * {\n box-sizing: border-box;\n flex: none;\n}\n\n";
|
|
5812
5814
|
let $d89e3aaeb9270095$var$slider_styling_was_inserted = false;
|
|
5813
5815
|
async function $d89e3aaeb9270095$export$82cfdc85a4d15688(t, recommendation_renderer_options, _ref) {
|
|
5814
5816
|
let {
|
|
@@ -5823,7 +5825,7 @@ async function $d89e3aaeb9270095$export$82cfdc85a4d15688(t, recommendation_rende
|
|
|
5823
5825
|
rows = "all",
|
|
5824
5826
|
...slider_options
|
|
5825
5827
|
} = _ref;
|
|
5826
|
-
const [insertion_point] =
|
|
5828
|
+
const [insertion_point] = $652300c6621d5500$export$5e63aea0cac01fa0(container_elements, container_selector || ".grid");
|
|
5827
5829
|
const slider = eager_images ? new (0, $be288a83d9eabf2a$export$692b27c28639e5b9)(slider_options) : new (0, $f340c415f2e1d03a$export$68babfc5be0de5da)(slider_options, lazyfier_options);
|
|
5828
5830
|
const rendering_result = await (override_rec_renderer || (0, $70017d06e57dffa8$export$2e2bcd8739ae039))(t, recommendation_renderer_options);
|
|
5829
5831
|
const {
|
|
@@ -5832,18 +5834,18 @@ async function $d89e3aaeb9270095$export$82cfdc85a4d15688(t, recommendation_rende
|
|
|
5832
5834
|
if (!elements) return rendering_result;
|
|
5833
5835
|
if (!$d89e3aaeb9270095$var$slider_styling_was_inserted) {
|
|
5834
5836
|
$d89e3aaeb9270095$var$slider_styling_was_inserted = true;
|
|
5835
|
-
|
|
5837
|
+
$1013f2e568f87406$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($9f7f2b36a558e2bd$exports)));
|
|
5836
5838
|
}
|
|
5837
5839
|
insertion_point.replaceWith(slider.container);
|
|
5838
5840
|
slider.insert_here.append(...elements);
|
|
5839
|
-
|
|
5841
|
+
$df6d080cba513381$export$c84671f46d6a1ca({
|
|
5840
5842
|
grid_spacing: grid_spacing,
|
|
5841
5843
|
cols_at_size: cols_at_size,
|
|
5842
5844
|
container_element: slider.insert_here,
|
|
5843
5845
|
rows: rows,
|
|
5844
5846
|
layout: "slider",
|
|
5845
5847
|
override_vertical_spacing: override_vertical_spacing
|
|
5846
|
-
}).catch(e =>
|
|
5848
|
+
}).catch(e => $5e1f45affc1d7def$export$f18d5b0af29128b7([e, "Grid had an error"], "warning"));
|
|
5847
5849
|
return {
|
|
5848
5850
|
...rendering_result,
|
|
5849
5851
|
slider: slider,
|
|
@@ -5868,11 +5870,11 @@ function $b109421811582f8c$export$8cbd8aa1c70f9a13() {
|
|
|
5868
5870
|
return {
|
|
5869
5871
|
constructor_plugin() {
|
|
5870
5872
|
const set_scroll_int = interval_scroll.bind(this);
|
|
5871
|
-
this.container.addEventListener("click",
|
|
5873
|
+
this.container.addEventListener("click", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => {
|
|
5872
5874
|
clearInterval(timer);
|
|
5873
5875
|
set_scroll_int();
|
|
5874
5876
|
}));
|
|
5875
|
-
this.container.addEventListener("mousedown",
|
|
5877
|
+
this.container.addEventListener("mousedown", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => {
|
|
5876
5878
|
clearInterval(timer);
|
|
5877
5879
|
}));
|
|
5878
5880
|
set_scroll_int();
|
|
@@ -5889,7 +5891,7 @@ function $090af64928922937$export$80039a49055269fb() {
|
|
|
5889
5891
|
return Object.fromEntries(["left", "right"].map(side => [side, [new_arrowimage()]]));
|
|
5890
5892
|
}
|
|
5891
5893
|
function $66c5b496f7887c00$export$af88b4929c2dc86() {
|
|
5892
|
-
const img =
|
|
5894
|
+
const img = $0f650018c3cbc373$export$34b9dba7ce09269b("img", {
|
|
5893
5895
|
src: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHN0eWxlPSJkaXNwbGF5OiBpbmxpbmUtYmxvY2s7IHZlcnRpY2FsLWFsaWduOiBtaWRkbGU7IiB3aWR0aD0iMTZweCIgaGVpZ2h0PSIxNnB4IiB2aWV3Qm94PSIwIDAgOCAxNSI+PHBhdGggc3R5bGU9ImZpbGw6IHJnYigwLCAwLCAwKTsiIGQ9Ik0uNjI5LjAwMWMuMTUuMDA4LjI5My4wNzIuMzk4LjE4bDYuNzkyIDYuODlhLjYwMS42MDEgMCAwIDEgMCAuODZsLTYuNzkyIDYuODg4YS41ODYuNTg2IDAgMCAxLS44NDYgMCAuNjAxLjYwMSAwIDAgMSAwLS44Nkw2LjU1NCA3LjUuMjExIDEuMDAxYS42MDEuNjAxIDAgMCAxIDAtLjg2Yy4xMTUtLjEuMjY2LS4xNS40MTgtLjE0Ij48L3BhdGg+PC9zdmc+"
|
|
5894
5896
|
});
|
|
5895
5897
|
return {
|
|
@@ -5989,12 +5991,12 @@ function $d3c54fdf1bfb087a$export$1d17a045bcc711b1(_ref) {
|
|
|
5989
5991
|
};
|
|
5990
5992
|
}
|
|
5991
5993
|
function $d3c54fdf1bfb087a$export$a09282b33e69b43f(unique_name) {
|
|
5992
|
-
return
|
|
5994
|
+
return $0f650018c3cbc373$export$25062201e9e25d76("label", {
|
|
5993
5995
|
class: "checkbox_container",
|
|
5994
|
-
children: [
|
|
5996
|
+
children: [$0f650018c3cbc373$export$34b9dba7ce09269b("input", {
|
|
5995
5997
|
type: "radio",
|
|
5996
5998
|
name: "radio-".concat(unique_name)
|
|
5997
|
-
}),
|
|
5999
|
+
}), $0f650018c3cbc373$export$34b9dba7ce09269b("span", {
|
|
5998
6000
|
class: "checkmark"
|
|
5999
6001
|
})]
|
|
6000
6002
|
});
|
|
@@ -6078,7 +6080,7 @@ function $3ad897e1659ee6d7$export$411b0f20794697ce(t) {
|
|
|
6078
6080
|
}
|
|
6079
6081
|
function mutation_plugin(intersections, intersecting_mutations) {}
|
|
6080
6082
|
function instant_post_pro(items) {
|
|
6081
|
-
|
|
6083
|
+
$652300c6621d5500$export$5e63aea0cac01fa0(items, "a, img, canvas").forEach(el => {
|
|
6082
6084
|
// @ts-ignore
|
|
6083
6085
|
el.draggable = false;
|
|
6084
6086
|
el.addEventListener("dragstart", e => {
|
|
@@ -6145,10 +6147,10 @@ function $0cbf24ae3e670238$export$5723caf9a8335aa6(_t) {
|
|
|
6145
6147
|
configurable: true,
|
|
6146
6148
|
enumerable: true,
|
|
6147
6149
|
set(v) {
|
|
6148
|
-
|
|
6150
|
+
$b000f5ef6ce456d9$export$8048b892d651b310(new Error("Cannot set steps to slide manually when using fractional scroll"));
|
|
6149
6151
|
return v;
|
|
6150
6152
|
},
|
|
6151
|
-
get:
|
|
6153
|
+
get: $5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => {
|
|
6152
6154
|
const sliding_width = sliding.getBoundingClientRect().width;
|
|
6153
6155
|
const first_rec = sliding.firstElementChild;
|
|
6154
6156
|
if (!first_rec)
|
|
@@ -6160,7 +6162,7 @@ function $0cbf24ae3e670238$export$5723caf9a8335aa6(_t) {
|
|
|
6160
6162
|
const stepsize_limited_up = max_steps && calculated_stepsize > max_steps ? max_steps : calculated_stepsize;
|
|
6161
6163
|
const stepsize_limited_up_and_down = min_steps && stepsize_limited_up < min_steps ? min_steps : stepsize_limited_up;
|
|
6162
6164
|
const stepby = stepsize_limited_up_and_down || fallback_stepsize;
|
|
6163
|
-
if (stepby != calculated_stepsize)
|
|
6165
|
+
if (stepby != calculated_stepsize) $241f2f02cc612a49$export$de56f1198d121036("going by", stepby, "because of max_steps or invalid stepsize");
|
|
6164
6166
|
return stepby;
|
|
6165
6167
|
})
|
|
6166
6168
|
});
|
|
@@ -6174,10 +6176,10 @@ function $0cbf24ae3e670238$export$5723caf9a8335aa6(_t) {
|
|
|
6174
6176
|
function $4837ebe61ecec421$export$93223e488e7ee078(options) {
|
|
6175
6177
|
function constructor_plugin(_slider_options) {
|
|
6176
6178
|
var _options$scroll_bar_c, _options$scroll_conta;
|
|
6177
|
-
const scroll_bar =
|
|
6179
|
+
const scroll_bar = $0f650018c3cbc373$export$34b9dba7ce09269b("div", {
|
|
6178
6180
|
class: "depict_slider_scroll_bar"
|
|
6179
6181
|
});
|
|
6180
|
-
const scroll_container =
|
|
6182
|
+
const scroll_container = $0f650018c3cbc373$export$34b9dba7ce09269b("div", {
|
|
6181
6183
|
class: "depict_slider_scroll_container"
|
|
6182
6184
|
});
|
|
6183
6185
|
if ((_options$scroll_bar_c = options.scroll_bar_classes) !== null && _options$scroll_bar_c !== void 0 && _options$scroll_bar_c.length) scroll_bar.classList.add(...options.scroll_bar_classes);
|
|
@@ -6213,14 +6215,14 @@ function $ff905d87817a07f4$export$b36d2489a5a16728(_t) {
|
|
|
6213
6215
|
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
6214
6216
|
function constructor_plugin(_slider_options) {
|
|
6215
6217
|
const slider_this = this;
|
|
6216
|
-
const random_classname = "x" +
|
|
6218
|
+
const random_classname = "x" + $6cb4d83127e468ea$export$656831b7e9c341c3().replaceAll(".", "");
|
|
6217
6219
|
slider_this.insert_here.classList.add(random_classname);
|
|
6218
6220
|
const style = document.createElement("style");
|
|
6219
6221
|
style.append(".depict .".concat(random_classname, "{scroll-snap-type:x mandatory}.depict .").concat(random_classname, ">*:nth-child(").concat(snapEvery !== null && snapEvery !== void 0 ? snapEvery : 1, "n + 1){scroll-snap-align:").concat(align || "start", "}"));
|
|
6220
6222
|
slider_this.snap_style = slider_this.container.appendChild(style);
|
|
6221
6223
|
$ff905d87817a07f4$export$49b950309ab787ad().then(we_can => {
|
|
6222
6224
|
if (!we_can) {
|
|
6223
|
-
|
|
6225
|
+
$241f2f02cc612a49$export$de56f1198d121036("Disabling slider snapping due browser where it's impossible to have working buttons and css snapping");
|
|
6224
6226
|
style.remove();
|
|
6225
6227
|
delete slider_this["snap_style"];
|
|
6226
6228
|
}
|
|
@@ -6236,9 +6238,9 @@ function $ff905d87817a07f4$export$b36d2489a5a16728(_t) {
|
|
|
6236
6238
|
}
|
|
6237
6239
|
async function $ff905d87817a07f4$export$49b950309ab787ad() {
|
|
6238
6240
|
if ("scrollBehavior" in document.documentElement.style) return true;
|
|
6239
|
-
const test_div =
|
|
6241
|
+
const test_div = $0f650018c3cbc373$export$34b9dba7ce09269b("div", {
|
|
6240
6242
|
style: "position: absolute; width: 1em; overflow: scroll; scroll-snap-type: x mandatory;",
|
|
6241
|
-
children:
|
|
6243
|
+
children: $0f650018c3cbc373$export$34b9dba7ce09269b("div", {
|
|
6242
6244
|
style: "scroll-snap-align: start; color: transparent;",
|
|
6243
6245
|
children: "test"
|
|
6244
6246
|
})
|
|
@@ -6275,14 +6277,14 @@ function $e1af55c2112926b7$export$dac64fd35a4805a4() {
|
|
|
6275
6277
|
insert_here: sliding
|
|
6276
6278
|
} = this;
|
|
6277
6279
|
const scroll_abs_no_negative = target => this.scroll_to_abs(target < 0 ? 0 : target); // the slider ignores everything < 0 but we want it to move to the first card
|
|
6278
|
-
sliding.addEventListener("mousedown",
|
|
6280
|
+
sliding.addEventListener("mousedown", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => {
|
|
6279
6281
|
lock_on_element.lock_active = true;
|
|
6280
6282
|
const starting_ratio_left = ratio_left.ratio;
|
|
6281
6283
|
lock_on_element.left = ratio_left.element;
|
|
6282
6284
|
const starting_ratio_right = ratio_right.ratio;
|
|
6283
6285
|
lock_on_element.right = ratio_right.element;
|
|
6284
6286
|
const scroll_left_start = sliding.scrollLeft;
|
|
6285
|
-
const mouseup_listener =
|
|
6287
|
+
const mouseup_listener = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(e => {
|
|
6286
6288
|
lock_on_element.lock_active = false;
|
|
6287
6289
|
const delta_left = Math.abs(ratio_left.ratio - starting_ratio_left);
|
|
6288
6290
|
const delta_right = Math.abs(ratio_right.ratio - starting_ratio_right);
|
|
@@ -6294,7 +6296,7 @@ function $e1af55c2112926b7$export$dac64fd35a4805a4() {
|
|
|
6294
6296
|
try {
|
|
6295
6297
|
currently_visible = Math.floor(this.insert_here.getBoundingClientRect().width / this.insert_here.firstElementChild.getBoundingClientRect().width);
|
|
6296
6298
|
} catch (e) {
|
|
6297
|
-
|
|
6299
|
+
$5e1f45affc1d7def$export$f18d5b0af29128b7(e, "warning");
|
|
6298
6300
|
}
|
|
6299
6301
|
const stepsize = options.stepsize || currently_visible || 4;
|
|
6300
6302
|
if (scrolled_right) scroll_abs_no_negative(+currently_left + stepsize);else scroll_abs_no_negative(+currently_left - stepsize);
|
|
@@ -6339,8 +6341,8 @@ function $e1af55c2112926b7$export$dac64fd35a4805a4() {
|
|
|
6339
6341
|
}
|
|
6340
6342
|
}
|
|
6341
6343
|
return {
|
|
6342
|
-
constructor_plugin:
|
|
6343
|
-
mutation_plugin:
|
|
6344
|
+
constructor_plugin: $5e1f45affc1d7def$export$b3bbfd758f11cfa9(constructor_plugin),
|
|
6345
|
+
mutation_plugin: $5e1f45affc1d7def$export$b3bbfd758f11cfa9(mutation_plugin)
|
|
6344
6346
|
};
|
|
6345
6347
|
}
|
|
6346
6348
|
function $c7030fdb9bcc361f$export$53306504b987cbf7() {
|
|
@@ -6364,7 +6366,7 @@ function $c7030fdb9bcc361f$export$53306504b987cbf7() {
|
|
|
6364
6366
|
let are_far_right = false;
|
|
6365
6367
|
let inactive_checker_timeout;
|
|
6366
6368
|
// let elgreen;
|
|
6367
|
-
const check_if_we_inactive =
|
|
6369
|
+
const check_if_we_inactive = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(function () {
|
|
6368
6370
|
var _window2, _window2$performance, _window2$performance$;
|
|
6369
6371
|
// const { insert_here: sliding } = this;
|
|
6370
6372
|
const now = ((_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$performance = _window2.performance) === null || _window2$performance === void 0 ? void 0 : (_window2$performance$ = _window2$performance.now) === null || _window2$performance$ === void 0 ? void 0 : _window2$performance$.call(_window2$performance)) || +new Date();
|
|
@@ -6376,7 +6378,7 @@ function $c7030fdb9bcc361f$export$53306504b987cbf7() {
|
|
|
6376
6378
|
// sliding.style.background = "green";
|
|
6377
6379
|
// elgreen = true;
|
|
6378
6380
|
// }
|
|
6379
|
-
|
|
6381
|
+
$5e1f45affc1d7def$export$b3bbfd758f11cfa9($c7030fdb9bcc361f$var$scroll_idle)(this, originally_rendered_elements.length, clones_per_side);
|
|
6380
6382
|
inactive_checker_running = false;
|
|
6381
6383
|
} else {
|
|
6382
6384
|
// if (elgreen !== false) {
|
|
@@ -6390,11 +6392,11 @@ function $c7030fdb9bcc361f$export$53306504b987cbf7() {
|
|
|
6390
6392
|
function constructor_plugin() {
|
|
6391
6393
|
window.addEventListener("touchstart", () => touches++);
|
|
6392
6394
|
window.addEventListener("touchend", () => touches--);
|
|
6393
|
-
this.insert_here.addEventListener("scroll",
|
|
6395
|
+
this.insert_here.addEventListener("scroll", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => {
|
|
6394
6396
|
var _window3, _window3$performance, _window3$performance$;
|
|
6395
6397
|
last_move = ((_window3 = window) === null || _window3 === void 0 ? void 0 : (_window3$performance = _window3.performance) === null || _window3$performance === void 0 ? void 0 : (_window3$performance$ = _window3$performance.now) === null || _window3$performance$ === void 0 ? void 0 : _window3$performance$.call(_window3$performance)) || +new Date();
|
|
6396
6398
|
}));
|
|
6397
|
-
const mo = new MutationObserver(
|
|
6399
|
+
const mo = new MutationObserver($5e1f45affc1d7def$export$b3bbfd758f11cfa9(records => {
|
|
6398
6400
|
for (const record of records) for (const node of record.removedNodes) {
|
|
6399
6401
|
if (removed_by_us.has(node)) {
|
|
6400
6402
|
removed_by_us.delete(node);
|
|
@@ -6403,7 +6405,7 @@ function $c7030fdb9bcc361f$export$53306504b987cbf7() {
|
|
|
6403
6405
|
for (const a_set of sets_of_els) {
|
|
6404
6406
|
const index_in_el_set = a_set.indexOf(node);
|
|
6405
6407
|
if (index_in_el_set >= 0) {
|
|
6406
|
-
|
|
6408
|
+
$241f2f02cc612a49$export$de56f1198d121036("Removing", node, "from el set", a_set);
|
|
6407
6409
|
a_set.splice(index_in_el_set, 1);
|
|
6408
6410
|
}
|
|
6409
6411
|
}
|
|
@@ -6433,7 +6435,7 @@ function $c7030fdb9bcc361f$export$53306504b987cbf7() {
|
|
|
6433
6435
|
// calculate how many cards including margin the slider fits
|
|
6434
6436
|
const first_rect = first_element.getBoundingClientRect();
|
|
6435
6437
|
if (!first_rect.width) {
|
|
6436
|
-
|
|
6438
|
+
$241f2f02cc612a49$export$de56f1198d121036(first_rect);
|
|
6437
6439
|
throw new Error("First rect doesn't have width");
|
|
6438
6440
|
}
|
|
6439
6441
|
const second_rect = second_element.getBoundingClientRect();
|
|
@@ -6451,7 +6453,7 @@ function $c7030fdb9bcc361f$export$53306504b987cbf7() {
|
|
|
6451
6453
|
}
|
|
6452
6454
|
if (dont_wraparound) {
|
|
6453
6455
|
if (surplus_in_body) {
|
|
6454
|
-
|
|
6456
|
+
$241f2f02cc612a49$export$de56f1198d121036("Removing surplus of els. Total els: ", sets_of_els);
|
|
6455
6457
|
// @ts-ignore
|
|
6456
6458
|
for (let i = (sets_of_els.length || 1) - 1; i--;) for (let j = 0; j < sets_of_els[i].length; j++) {
|
|
6457
6459
|
const el = sets_of_els[i][j];
|
|
@@ -6467,7 +6469,7 @@ function $c7030fdb9bcc361f$export$53306504b987cbf7() {
|
|
|
6467
6469
|
return;
|
|
6468
6470
|
}
|
|
6469
6471
|
if (!surplus_in_body) {
|
|
6470
|
-
|
|
6472
|
+
$241f2f02cc612a49$export$de56f1198d121036("Adding surplus of els");
|
|
6471
6473
|
this.insert_here.append(...sets_of_els.slice(0, -1).flat());
|
|
6472
6474
|
this.invalidate_cache();
|
|
6473
6475
|
surplus_in_body = true;
|
|
@@ -6505,11 +6507,11 @@ function $c7030fdb9bcc361f$export$53306504b987cbf7() {
|
|
|
6505
6507
|
if (our_index >= 0) post_processors.splice(our_index, 1);else {
|
|
6506
6508
|
const msg = "Couldn't find ourselves in post processors, infinite loop might ensue. Exiting. Wraparound will be broken.";
|
|
6507
6509
|
(0, $17bb552dedcd526c$export$af2e17a20c2ea3c5).captureException(new Error(msg));
|
|
6508
|
-
|
|
6510
|
+
$241f2f02cc612a49$export$de56f1198d121036(msg, () => {});
|
|
6509
6511
|
return elements;
|
|
6510
6512
|
}
|
|
6511
6513
|
for (let i = 0; i < clones_per_side * 2; i++) {
|
|
6512
|
-
const additional_render = await
|
|
6514
|
+
const additional_render = await $378c98788ab52b9c$export$a9fc160c5ed83bd7(info.t, {
|
|
6513
6515
|
...rendering_options,
|
|
6514
6516
|
post_processors: post_processors,
|
|
6515
6517
|
pre_processors: [],
|
|
@@ -6625,7 +6627,7 @@ function $26dbd7db7fd1bc2c$export$515c3ea4d599b05a(
|
|
|
6625
6627
|
query, handler) {
|
|
6626
6628
|
var _window, _window$matchMedia;
|
|
6627
6629
|
let initial_call = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
6628
|
-
const catchified_handler =
|
|
6630
|
+
const catchified_handler = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(handler, "Error in media query listener callback");
|
|
6629
6631
|
if (typeof window !== "object") {
|
|
6630
6632
|
// on server call the handler in case nothing is rendered if it isn't called, then do nothing
|
|
6631
6633
|
catchified_handler({
|
|
@@ -6654,9 +6656,9 @@ async function $aadc6d9eeb8e8a56$export$417ef0ab13d8b984(_ref) {
|
|
|
6654
6656
|
let resolve_success_promise;
|
|
6655
6657
|
const success_promise = new Promise(r => resolve_success_promise = r);
|
|
6656
6658
|
const cache = new Map();
|
|
6657
|
-
const [template_els, _get, set_els] =
|
|
6658
|
-
const catchified_switch_to_surface =
|
|
6659
|
-
|
|
6659
|
+
const [template_els, _get, set_els] = $2b6304d4ce419ed5$export$3d04c40e7acc1a32();
|
|
6660
|
+
const catchified_switch_to_surface = $5e1f45affc1d7def$export$b3bbfd758f11cfa9($aadc6d9eeb8e8a56$var$switch_to_surface);
|
|
6661
|
+
$5e1f45affc1d7def$export$b3bbfd758f11cfa9(async () => {
|
|
6660
6662
|
for await (const surface of current_surface_) {
|
|
6661
6663
|
const rendering_function = surface_rendering_functions_[surface];
|
|
6662
6664
|
catchified_switch_to_surface(surface, rendering_function, current_surface_, cache, set_els, resolve_success_promise);
|
|
@@ -6675,9 +6677,9 @@ async function $aadc6d9eeb8e8a56$var$switch_to_surface(surface_index, rendering_
|
|
|
6675
6677
|
const {
|
|
6676
6678
|
cache_until_: cache_until_,
|
|
6677
6679
|
surface_: surface_
|
|
6678
|
-
} = await rendering_function().catch(e => (
|
|
6680
|
+
} = await rendering_function().catch(e => ($5e1f45affc1d7def$export$f18d5b0af29128b7([e, "error in rendering"], "warning"), {}));
|
|
6679
6681
|
if (!surface_ || !(surface_ !== null && surface_ !== void 0 && (_surface_$elements = surface_.elements) !== null && _surface_$elements !== void 0 && _surface_$elements.length)) {
|
|
6680
|
-
|
|
6682
|
+
$241f2f02cc612a49$export$de56f1198d121036("Got no/empty surface, not switching");
|
|
6681
6683
|
// also tell insert_surface that we didn't get recs so it can revert, dunno if we want this
|
|
6682
6684
|
resolve_success_promise(false);
|
|
6683
6685
|
return;
|
|
@@ -6685,17 +6687,17 @@ async function $aadc6d9eeb8e8a56$var$switch_to_surface(surface_index, rendering_
|
|
|
6685
6687
|
rendered_surface = surface_;
|
|
6686
6688
|
if (cache_until_ instanceof Promise) {
|
|
6687
6689
|
cache.set(surface_index, surface_);
|
|
6688
|
-
cache_until_.then(
|
|
6690
|
+
cache_until_.then($5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => cache.delete(surface_index)));
|
|
6689
6691
|
}
|
|
6690
6692
|
}
|
|
6691
6693
|
if (current_surface_ipns.state !== surface_index) {
|
|
6692
|
-
|
|
6694
|
+
$241f2f02cc612a49$export$de56f1198d121036("Surface switched to", current_surface_ipns.state, "while rendering surface", surface_index, "discarding results");
|
|
6693
6695
|
return;
|
|
6694
6696
|
}
|
|
6695
6697
|
set_els(rendered_surface.elements);
|
|
6696
6698
|
if (rendered_surface.should_stay_inserted instanceof Promise)
|
|
6697
6699
|
// if there is promise that says if surface succeeded or not, use that
|
|
6698
|
-
rendered_surface.should_stay_inserted.then(
|
|
6700
|
+
rendered_surface.should_stay_inserted.then($5e1f45affc1d7def$export$b3bbfd758f11cfa9(success => {
|
|
6699
6701
|
resolve_success_promise(success);
|
|
6700
6702
|
}));else
|
|
6701
6703
|
// otherwise let's just assume it suceeded since there are elements
|
|
@@ -6703,12 +6705,12 @@ async function $aadc6d9eeb8e8a56$var$switch_to_surface(surface_index, rendering_
|
|
|
6703
6705
|
}
|
|
6704
6706
|
function $aadc6d9eeb8e8a56$export$419f84efad7d9fe(surface_per_size, cleanup_promise) {
|
|
6705
6707
|
let microtask_queued = false;
|
|
6706
|
-
const ipns =
|
|
6708
|
+
const ipns = $7ca6fdc721083788$export$e806c6c1615a59ae();
|
|
6707
6709
|
const target_indexes = new Set();
|
|
6708
|
-
const dedupe_overlapping_queries =
|
|
6710
|
+
const dedupe_overlapping_queries = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => {
|
|
6709
6711
|
microtask_queued = false;
|
|
6710
6712
|
const first_value = target_indexes[Symbol.iterator]().next().value;
|
|
6711
|
-
if (first_value === ipns.latest_call_value)
|
|
6713
|
+
if (first_value === ipns.latest_call_value) $241f2f02cc612a49$export$de56f1198d121036("surface", first_value, "is already selected");else ipns(first_value);
|
|
6712
6714
|
if (target_indexes.size > 1) {
|
|
6713
6715
|
const error_string = "Multiple matching media queries detected, used first one: " + JSON.stringify(surface_per_size.filter(_ref2 => {
|
|
6714
6716
|
let [index] = _ref2;
|
|
@@ -6721,10 +6723,10 @@ function $aadc6d9eeb8e8a56$export$419f84efad7d9fe(surface_per_size, cleanup_prom
|
|
|
6721
6723
|
});
|
|
6722
6724
|
surface_per_size.forEach(_ref3 => {
|
|
6723
6725
|
let [surface_index, min, max] = _ref3;
|
|
6724
|
-
const media_query =
|
|
6726
|
+
const media_query = $df6d080cba513381$export$717f13d9ba00ca19(min, max).split("@media ").pop();
|
|
6725
6727
|
const {
|
|
6726
6728
|
remove: remove
|
|
6727
|
-
} =
|
|
6729
|
+
} = $26dbd7db7fd1bc2c$export$515c3ea4d599b05a(media_query, _ref4 => {
|
|
6728
6730
|
let {
|
|
6729
6731
|
matches: matches
|
|
6730
6732
|
} = _ref4;
|
|
@@ -6735,21 +6737,21 @@ function $aadc6d9eeb8e8a56$export$419f84efad7d9fe(surface_per_size, cleanup_prom
|
|
|
6735
6737
|
microtask_queued = true;
|
|
6736
6738
|
}
|
|
6737
6739
|
});
|
|
6738
|
-
if (cleanup_promise instanceof Promise) cleanup_promise.then(remove);else
|
|
6740
|
+
if (cleanup_promise instanceof Promise) cleanup_promise.then(remove);else $ad1dbddac6af350d$export$1cd22bab0d2c3b0b(remove);
|
|
6739
6741
|
});
|
|
6740
6742
|
return ipns;
|
|
6741
6743
|
}
|
|
6742
6744
|
function $aadc6d9eeb8e8a56$export$be95cb0e8cfd099e() {
|
|
6743
|
-
return new Promise(r =>
|
|
6745
|
+
return new Promise(r => $ad1dbddac6af350d$export$1cd22bab0d2c3b0b(r));
|
|
6744
6746
|
}
|
|
6745
6747
|
function $f991aad8d6175c9b$export$3ebd86018b39d9d2(t, selector, filter) {
|
|
6746
6748
|
(0, $90fa633a9564f115$export$b6ae1bc530f4c149).onexists(selector, eoe => {
|
|
6747
|
-
|
|
6749
|
+
$241f2f02cc612a49$export$de56f1198d121036("Order confirmation element showed up!", eoe);
|
|
6748
6750
|
const {
|
|
6749
6751
|
element: element
|
|
6750
6752
|
} = eoe;
|
|
6751
6753
|
const the_id = element.innerText;
|
|
6752
|
-
$f991aad8d6175c9b$export$1ac466d53a6636ac(t, the_id,
|
|
6754
|
+
$f991aad8d6175c9b$export$1ac466d53a6636ac(t, the_id, $d5f7352b58e0d737$export$6399bdb2291895e0(), filter);
|
|
6753
6755
|
});
|
|
6754
6756
|
}
|
|
6755
6757
|
function $f991aad8d6175c9b$export$b11248fa13a8a86c(tenant, id_extractor) {
|
|
@@ -6767,7 +6769,7 @@ function $f991aad8d6175c9b$export$b11248fa13a8a86c(tenant, id_extractor) {
|
|
|
6767
6769
|
try {
|
|
6768
6770
|
maybe_send_entries(args_list);
|
|
6769
6771
|
} catch (e) {
|
|
6770
|
-
|
|
6772
|
+
$5e1f45affc1d7def$export$f18d5b0af29128b7([e, "Extracting and sending transaction IDs from dataLayer failed"], "warning");
|
|
6771
6773
|
}
|
|
6772
6774
|
return target.apply(this_arg, args_list);
|
|
6773
6775
|
}
|
|
@@ -6779,17 +6781,17 @@ function $f991aad8d6175c9b$export$ff8673d5dea82bd4(tenant, id_extractor) {
|
|
|
6779
6781
|
const order_id = id_extractor(new URL(href));
|
|
6780
6782
|
if (order_id && typeof order_id === "string") $f991aad8d6175c9b$export$1ac466d53a6636ac(tenant, order_id);
|
|
6781
6783
|
}
|
|
6782
|
-
})().catch(e =>
|
|
6784
|
+
})().catch(e => $5e1f45affc1d7def$export$f18d5b0af29128b7([e, "Extracting and sending transaction IDs from URL failed"], "warning"));
|
|
6783
6785
|
}
|
|
6784
6786
|
function $f991aad8d6175c9b$export$1ac466d53a6636ac(t, input_id) {
|
|
6785
|
-
let dsid = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] :
|
|
6787
|
+
let dsid = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : $d5f7352b58e0d737$export$6399bdb2291895e0();
|
|
6786
6788
|
let filter = arguments.length > 3 ? arguments[3] : undefined;
|
|
6787
6789
|
const transaction_id = typeof filter == "function" ? filter(input_id) : input_id;
|
|
6788
6790
|
if (!transaction_id) {
|
|
6789
|
-
|
|
6791
|
+
$241f2f02cc612a49$export$de56f1198d121036("Not sending", transaction_id, "because it didn't pass filter");
|
|
6790
6792
|
return;
|
|
6791
6793
|
}
|
|
6792
|
-
|
|
6794
|
+
$241f2f02cc612a49$export$de56f1198d121036("Sending this order id:", transaction_id, "(before filtering it was", input_id, ")");
|
|
6793
6795
|
const payload = {
|
|
6794
6796
|
"tenant": t.tenant,
|
|
6795
6797
|
"market": t.market,
|
|
@@ -6799,37 +6801,37 @@ function $f991aad8d6175c9b$export$1ac466d53a6636ac(t, input_id) {
|
|
|
6799
6801
|
dsid: dsid
|
|
6800
6802
|
}]
|
|
6801
6803
|
};
|
|
6802
|
-
|
|
6804
|
+
$814c3bf8e175fa59$export$cc3b6ddf805f6156((0, $9e4bee2e3b4b5753$export$362abebb4b313340) + "/v2/track", payload);
|
|
6803
6805
|
}
|
|
6804
6806
|
function $ed8073ecbced6e7e$export$1ff14fec60ed5697(t, filter) {
|
|
6805
6807
|
try {
|
|
6806
|
-
|
|
6807
|
-
ga(
|
|
6808
|
+
$799496226e956169$export$674d8cd8b6868154();
|
|
6809
|
+
ga($5e1f45affc1d7def$export$b3bbfd758f11cfa9(async function (tracker) {
|
|
6808
6810
|
var _window, _window$ga;
|
|
6809
6811
|
let get_all_function = (_window = window) === null || _window === void 0 ? void 0 : (_window$ga = _window.ga) === null || _window$ga === void 0 ? void 0 : _window$ga.getAll; // https://sentry.io/organizations/depictai-0o/issues/3621911835/?project=5476183&referrer=slack
|
|
6810
|
-
if (typeof get_all_function !== "function") get_all_function = await
|
|
6812
|
+
if (typeof get_all_function !== "function") get_all_function = await $2da62df28669a48a$export$2fc1a072736ae2f6(window, "ga", "getAll");
|
|
6811
6813
|
const all_trackers = get_all_function.call(ga);
|
|
6812
|
-
|
|
6814
|
+
$241f2f02cc612a49$export$de56f1198d121036("we have trackers", all_trackers);
|
|
6813
6815
|
// @ts-ignore
|
|
6814
6816
|
const {
|
|
6815
6817
|
P: P
|
|
6816
6818
|
} = ga;
|
|
6817
|
-
|
|
6819
|
+
$5e1f45affc1d7def$export$b3bbfd758f11cfa9(modify_trackers_of_iterable)(all_trackers);
|
|
6818
6820
|
if (typeof (P === null || P === void 0 ? void 0 : P.push) === "function")
|
|
6819
6821
|
// this check is just so we don't fail if this doesn't exist for some reason, but it always should
|
|
6820
6822
|
P.push = new Proxy(P.push, {
|
|
6821
6823
|
apply(target, this_arg, args_list) {
|
|
6822
6824
|
const retval = target.apply(this_arg, args_list);
|
|
6823
|
-
|
|
6825
|
+
$5e1f45affc1d7def$export$b3bbfd758f11cfa9(modify_trackers_of_iterable)(args_list);
|
|
6824
6826
|
return retval;
|
|
6825
6827
|
}
|
|
6826
6828
|
});
|
|
6827
6829
|
function modify_trackers_of_iterable(array) {
|
|
6828
|
-
for (const tracker of array)
|
|
6830
|
+
for (const tracker of array) $5e1f45affc1d7def$export$b3bbfd758f11cfa9($ed8073ecbced6e7e$var$make_tracker_send_to_depict)(tracker, t, filter);
|
|
6829
6831
|
}
|
|
6830
6832
|
}));
|
|
6831
6833
|
} catch (error) {
|
|
6832
|
-
|
|
6834
|
+
$5e1f45affc1d7def$export$f18d5b0af29128b7(error, "error");
|
|
6833
6835
|
}
|
|
6834
6836
|
}
|
|
6835
6837
|
function $ed8073ecbced6e7e$var$make_tracker_send_to_depict(ga_tracker, t, filter) {
|
|
@@ -6841,22 +6843,22 @@ function $ed8073ecbced6e7e$var$make_tracker_send_to_depict(ga_tracker, t, filter
|
|
|
6841
6843
|
originalSendHitTask(model);
|
|
6842
6844
|
// console.log('Sent original hit, now sending to depict');
|
|
6843
6845
|
try {
|
|
6844
|
-
const dsid =
|
|
6846
|
+
const dsid = $d5f7352b58e0d737$export$6399bdb2291895e0();
|
|
6845
6847
|
const payload = model.get("hitPayload");
|
|
6846
6848
|
const sp = new URLSearchParams(payload);
|
|
6847
6849
|
const id = sp.get("ti");
|
|
6848
6850
|
if (id) {
|
|
6849
|
-
|
|
6850
|
-
|
|
6851
|
+
$241f2f02cc612a49$export$de56f1198d121036("Got interesting analytics request", payload, id);
|
|
6852
|
+
$f991aad8d6175c9b$export$1ac466d53a6636ac(t, id, dsid, filter);
|
|
6851
6853
|
}
|
|
6852
6854
|
} catch (e) {
|
|
6853
|
-
|
|
6855
|
+
$5e1f45affc1d7def$export$f18d5b0af29128b7(e, "error");
|
|
6854
6856
|
}
|
|
6855
6857
|
});
|
|
6856
6858
|
}
|
|
6857
6859
|
async function $a9d475787bc4d10e$export$d63b08f4f29ddba5(t, unavailability_type) {
|
|
6858
6860
|
const product_id = await t.get_product_id();
|
|
6859
|
-
|
|
6861
|
+
$241f2f02cc612a49$export$de56f1198d121036("Notifying Depict that product id: ".concat(product_id, " is ").concat(unavailability_type));
|
|
6860
6862
|
const payload = {
|
|
6861
6863
|
"tenant": t.tenant,
|
|
6862
6864
|
"market": t.market,
|
|
@@ -6864,11 +6866,11 @@ async function $a9d475787bc4d10e$export$d63b08f4f29ddba5(t, unavailability_type)
|
|
|
6864
6866
|
event_type: "product_unavailable",
|
|
6865
6867
|
product_id: product_id,
|
|
6866
6868
|
unavailability_type: unavailability_type,
|
|
6867
|
-
user_id:
|
|
6868
|
-
dsid:
|
|
6869
|
+
user_id: $d5f7352b58e0d737$export$adc61a405a4cabed(),
|
|
6870
|
+
dsid: $d5f7352b58e0d737$export$6399bdb2291895e0()
|
|
6869
6871
|
}]
|
|
6870
6872
|
};
|
|
6871
|
-
|
|
6873
|
+
$814c3bf8e175fa59$export$cc3b6ddf805f6156((0, $9e4bee2e3b4b5753$export$362abebb4b313340) + "/v2/track", payload);
|
|
6872
6874
|
}
|
|
6873
6875
|
function $429b4383ef3d586f$var$_classPrivateFieldInitSpec(obj, privateMap, value) {
|
|
6874
6876
|
$429b4383ef3d586f$var$_checkPrivateRedeclaration(obj, privateMap);
|
|
@@ -6887,21 +6889,21 @@ class $429b4383ef3d586f$export$74108888f38788f3 extends Set {
|
|
|
6887
6889
|
});
|
|
6888
6890
|
}
|
|
6889
6891
|
addEventListener(event, callback, options) {
|
|
6890
|
-
|
|
6892
|
+
$76EG6$babelruntimehelpersclassPrivateFieldGet(this, $429b4383ef3d586f$var$_et).addEventListener(event, callback, options);
|
|
6891
6893
|
}
|
|
6892
6894
|
removeEventListener(event, callback) {
|
|
6893
|
-
|
|
6895
|
+
$76EG6$babelruntimehelpersclassPrivateFieldGet(this, $429b4383ef3d586f$var$_et).removeEventListener(event, callback);
|
|
6894
6896
|
}
|
|
6895
6897
|
add(property) {
|
|
6896
6898
|
Set.prototype.add.call(this, property);
|
|
6897
|
-
|
|
6899
|
+
$76EG6$babelruntimehelpersclassPrivateFieldGet(this, $429b4383ef3d586f$var$_et).dispatchEvent(new CustomEvent("add", {
|
|
6898
6900
|
detail: property
|
|
6899
6901
|
}));
|
|
6900
6902
|
return this;
|
|
6901
6903
|
}
|
|
6902
6904
|
delete(property) {
|
|
6903
6905
|
const return_value = Set.prototype.delete.call(this, property);
|
|
6904
|
-
|
|
6906
|
+
$76EG6$babelruntimehelpersclassPrivateFieldGet(this, $429b4383ef3d586f$var$_et).dispatchEvent(new CustomEvent("delete", {
|
|
6905
6907
|
detail: property
|
|
6906
6908
|
}));
|
|
6907
6909
|
return return_value;
|
|
@@ -6941,11 +6943,11 @@ const $45d268baa2df1ba1$export$9426572bd5645bc1 = (arr1, arr2) => $45d268baa2df1
|
|
|
6941
6943
|
function $8183c177c3bdf94d$export$82539d9817116aff(e, url) {
|
|
6942
6944
|
var _window, _window$next;
|
|
6943
6945
|
if (e.button) {
|
|
6944
|
-
|
|
6946
|
+
$241f2f02cc612a49$export$de56f1198d121036("Not single page navigating because button is not 0", e);
|
|
6945
6947
|
return;
|
|
6946
6948
|
}
|
|
6947
6949
|
if (e.metaKey || e.ctrlKey) {
|
|
6948
|
-
|
|
6950
|
+
$241f2f02cc612a49$export$de56f1198d121036("Someone command-clicked a link, not single page navigating");
|
|
6949
6951
|
return;
|
|
6950
6952
|
}
|
|
6951
6953
|
// single page navigate
|
|
@@ -7008,7 +7010,7 @@ class $201e455525e1fa49$export$f8da66bc4f1d059e extends Response {
|
|
|
7008
7010
|
}
|
|
7009
7011
|
}
|
|
7010
7012
|
function $f69445e469425bcb$export$ab0f802c05dd969b(on_request) {
|
|
7011
|
-
|
|
7013
|
+
$201e455525e1fa49$export$85be83e1935d93c2(async (target, this_arg, argument_list) => {
|
|
7012
7014
|
const response_promise = target.apply(this_arg, argument_list);
|
|
7013
7015
|
try {
|
|
7014
7016
|
const input = argument_list[0];
|
|
@@ -7045,7 +7047,7 @@ function $f69445e469425bcb$export$ab0f802c05dd969b(on_request) {
|
|
|
7045
7047
|
break;
|
|
7046
7048
|
}
|
|
7047
7049
|
} catch (e) {
|
|
7048
|
-
|
|
7050
|
+
$5e1f45affc1d7def$export$f18d5b0af29128b7([e, "error in shopify interception logic"], "warning");
|
|
7049
7051
|
}
|
|
7050
7052
|
return await response_promise;
|
|
7051
7053
|
}, true);
|
|
@@ -7078,8 +7080,8 @@ async function $f69445e469425bcb$export$337197b94b3bd680() {
|
|
|
7078
7080
|
const json = await response.json();
|
|
7079
7081
|
if (Array.isArray(json.items)) return json.items;else if (typeof json.status === "number") return json;else throw new Error("Shopify ".concat(url, " did not respond as expected"));
|
|
7080
7082
|
}
|
|
7081
|
-
const $f69445e469425bcb$export$783ef16647773b3d = /*@__PURE__
|
|
7082
|
-
const meta = await
|
|
7083
|
+
const $f69445e469425bcb$export$783ef16647773b3d = /*@__PURE__*/$9c44a7238815fa47$export$535946eb77c946dd( /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(async () => {
|
|
7084
|
+
const meta = await $2da62df28669a48a$export$2fc1a072736ae2f6(window, "ShopifyAnalytics", "meta");
|
|
7083
7085
|
return meta === null || meta === void 0 ? void 0 : meta.product;
|
|
7084
7086
|
}));
|
|
7085
7087
|
async function $073645eedb3f65a8$export$b404e20f3c4a490e(_ref) {
|
|
@@ -7094,7 +7096,7 @@ async function $073645eedb3f65a8$export$b404e20f3c4a490e(_ref) {
|
|
|
7094
7096
|
Sentry: Sentry
|
|
7095
7097
|
} = t,
|
|
7096
7098
|
start = new Date().getTime(),
|
|
7097
|
-
optimize = await
|
|
7099
|
+
optimize = await $2da62df28669a48a$export$2fc1a072736ae2f6(window, "google_optimize"),
|
|
7098
7100
|
end = new Date().getTime();
|
|
7099
7101
|
dlog("Waited for google_optimize for", end - start, "ms");
|
|
7100
7102
|
// if (!optimize.get) {
|
|
@@ -7121,20 +7123,20 @@ async function $073645eedb3f65a8$export$b404e20f3c4a490e(_ref) {
|
|
|
7121
7123
|
function $c1590f86e0eca625$export$2c2f50b30b7b2576(el, attribute_name, async_iterable) {
|
|
7122
7124
|
let quit_after_navigation = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
7123
7125
|
(async () => {
|
|
7124
|
-
const [exit, exitable_iterable] =
|
|
7125
|
-
if (quit_after_navigation)
|
|
7126
|
+
const [exit, exitable_iterable] = $fee212025270d5b9$export$927664b47117acb0(async_iterable);
|
|
7127
|
+
if (quit_after_navigation) $ad1dbddac6af350d$export$1cd22bab0d2c3b0b(exit);
|
|
7126
7128
|
for await (const new_value of exitable_iterable) el.setAttribute(attribute_name, new_value);
|
|
7127
|
-
})().catch(e =>
|
|
7129
|
+
})().catch(e => $5e1f45affc1d7def$export$f18d5b0af29128b7([e, "Failed to set attribute"], "error"));
|
|
7128
7130
|
return el;
|
|
7129
7131
|
}
|
|
7130
7132
|
function $332ef338faf216a4$export$7c081fdbc65b6a2a(async_iterable) {
|
|
7131
7133
|
let quit_after_navigation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
7132
|
-
const [template_els, _get, set] =
|
|
7134
|
+
const [template_els, _get, set] = $2b6304d4ce419ed5$export$3d04c40e7acc1a32();
|
|
7133
7135
|
(async () => {
|
|
7134
|
-
const [exit, exitable_iterable] =
|
|
7135
|
-
if (quit_after_navigation)
|
|
7136
|
+
const [exit, exitable_iterable] = $fee212025270d5b9$export$927664b47117acb0(async_iterable);
|
|
7137
|
+
if (quit_after_navigation) $ad1dbddac6af350d$export$1cd22bab0d2c3b0b(exit);
|
|
7136
7138
|
for await (const els of exitable_iterable) set(els);
|
|
7137
|
-
})().catch(e =>
|
|
7139
|
+
})().catch(e => $5e1f45affc1d7def$export$f18d5b0af29128b7([e, "Failed to convert AsyncIterable to elements"], "error"));
|
|
7138
7140
|
return template_els;
|
|
7139
7141
|
}
|
|
7140
7142
|
let $2c22b027931240e6$var$context_counter = 0; // last context that was created (unless 0), to make sure we don't have two of the same
|
|
@@ -7195,10 +7197,10 @@ function $2c22b027931240e6$export$f811d2ce0aa6019b(_ref) {
|
|
|
7195
7197
|
(_disconnect_reinserti = disconnect_reinsertion_observers) === null || _disconnect_reinserti === void 0 || _disconnect_reinserti(); // Not sure if necessary? But if we re-insert in the same container and don't disconnect preserve_elements observers before it might lead to two observers acting on one element
|
|
7196
7198
|
disconnect_reinsertion_observers = $2c22b027931240e6$var$actual_insertion(element, verb, surfaces, try_forever, href, context, remove_after_navigation, preserve_elements);
|
|
7197
7199
|
});
|
|
7198
|
-
if (!try_forever)
|
|
7200
|
+
if (!try_forever) $ad1dbddac6af350d$export$1cd22bab0d2c3b0b(disconnect_observer);
|
|
7199
7201
|
} else {
|
|
7200
7202
|
if (!context && verb !== "replaceChildren") throw new Error("insert_surface, provided an element, may not be called without a context." + (process.env.DEBUG === "true" ? " Please wrap the function calling it into prevent_infinite_loop(). If you have already done that, make sure that there's no `await` before the calling of insert_surface" : ""));
|
|
7201
|
-
|
|
7203
|
+
$5e1f45affc1d7def$export$b3bbfd758f11cfa9($2c22b027931240e6$var$actual_insertion)(target, verb, surfaces, try_forever, href, context, remove_after_navigation, preserve_elements);
|
|
7202
7204
|
}
|
|
7203
7205
|
return surfaces.map(_ref3 => {
|
|
7204
7206
|
let {
|
|
@@ -7207,14 +7209,14 @@ function $2c22b027931240e6$export$f811d2ce0aa6019b(_ref) {
|
|
|
7207
7209
|
return promise_;
|
|
7208
7210
|
});
|
|
7209
7211
|
}
|
|
7210
|
-
const $2c22b027931240e6$export$e3f70ef7e3d00501 = /*@__PURE__
|
|
7212
|
+
const $2c22b027931240e6$export$e3f70ef7e3d00501 = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(async (target, should_stay_inserted) => {
|
|
7211
7213
|
const per_el_fn = (el, disconnect_observer) => {
|
|
7212
7214
|
const comment_node = document.createComment("Old recs were here // Depict");
|
|
7213
|
-
|
|
7215
|
+
$241f2f02cc612a49$export$de56f1198d121036("Replacing", el, "with", comment_node);
|
|
7214
7216
|
el.replaceWith(comment_node);
|
|
7215
7217
|
should_stay_inserted.then(keep => {
|
|
7216
7218
|
if (!keep) {
|
|
7217
|
-
|
|
7219
|
+
$241f2f02cc612a49$export$de56f1198d121036("Reverting", comment_node, "to", el);
|
|
7218
7220
|
comment_node.replaceWith(el);
|
|
7219
7221
|
disconnect_observer === null || disconnect_observer === void 0 || disconnect_observer();
|
|
7220
7222
|
}
|
|
@@ -7228,7 +7230,7 @@ const $2c22b027931240e6$export$e3f70ef7e3d00501 = /*@__PURE__*/(0, $5e1f45affc1d
|
|
|
7228
7230
|
} = _ref4;
|
|
7229
7231
|
return per_el_fn(element, disconnector);
|
|
7230
7232
|
});
|
|
7231
|
-
|
|
7233
|
+
$ad1dbddac6af350d$export$1cd22bab0d2c3b0b(disconnect_observer);
|
|
7232
7234
|
} else {
|
|
7233
7235
|
let did_already_fail = false;
|
|
7234
7236
|
should_stay_inserted.then(should_stay_inserted => {
|
|
@@ -7236,7 +7238,7 @@ const $2c22b027931240e6$export$e3f70ef7e3d00501 = /*@__PURE__*/(0, $5e1f45affc1d
|
|
|
7236
7238
|
});
|
|
7237
7239
|
await 0;
|
|
7238
7240
|
if (did_already_fail) {
|
|
7239
|
-
|
|
7241
|
+
$241f2f02cc612a49$export$de56f1198d121036("Not removing", target, should_stay_inserted, "is already resolved to false");
|
|
7240
7242
|
return;
|
|
7241
7243
|
}
|
|
7242
7244
|
if (Array.isArray(target)) for (let i = 0; i < target.length; i++) per_el_fn(target[i]);else per_el_fn(target);
|
|
@@ -7251,7 +7253,7 @@ function $2c22b027931240e6$var$actual_insertion(target, verb, surfaces, try_fore
|
|
|
7251
7253
|
const disconnect_all_observers = () => disconnectors.forEach(disconnector => disconnector());
|
|
7252
7254
|
const check_if_revert_whole = () => {
|
|
7253
7255
|
if (failed_surfaces !== surfaces.length) return; // we didn't fail
|
|
7254
|
-
|
|
7256
|
+
$241f2f02cc612a49$export$de56f1198d121036("All surfaces", surfaces, "failed. ".concat(was_replaced ? "Reverting to old els" : "removing els"));
|
|
7255
7257
|
$2c22b027931240e6$var$failed_contexts.add(context);
|
|
7256
7258
|
disconnect_all_observers();
|
|
7257
7259
|
const flat_tnodes = template_nodes.flat();
|
|
@@ -7265,29 +7267,29 @@ function $2c22b027931240e6$var$actual_insertion(target, verb, surfaces, try_fore
|
|
|
7265
7267
|
surface_: surface_,
|
|
7266
7268
|
resolve_promise_: resolve_promise_
|
|
7267
7269
|
} = _ref5;
|
|
7268
|
-
const [template_els, _get, set] =
|
|
7270
|
+
const [template_els, _get, set] = $2b6304d4ce419ed5$export$3d04c40e7acc1a32();
|
|
7269
7271
|
(async _surface => {
|
|
7270
7272
|
let surface;
|
|
7271
7273
|
try {
|
|
7272
7274
|
surface = await surface_;
|
|
7273
7275
|
} catch (e) {
|
|
7274
|
-
|
|
7276
|
+
$5e1f45affc1d7def$export$f18d5b0af29128b7([e, "A surface promise rejected" + (process.env.DEBUG === "true" ? " please catch this earlier" : "")], "warning");
|
|
7275
7277
|
}
|
|
7276
7278
|
if (!try_forever && location.href !== starting_href)
|
|
7277
7279
|
// navigated away
|
|
7278
7280
|
return;
|
|
7279
7281
|
// @ts-ignore
|
|
7280
7282
|
if ((_surface = surface) !== null && _surface !== void 0 && _surface.elements) {
|
|
7281
|
-
|
|
7283
|
+
$241f2f02cc612a49$export$de56f1198d121036("insert_surface:", target, "." + verb, surface);
|
|
7282
7284
|
set(surface.elements);
|
|
7283
|
-
if (surface.should_stay_inserted instanceof Promise) surface.should_stay_inserted.then(
|
|
7285
|
+
if (surface.should_stay_inserted instanceof Promise) surface.should_stay_inserted.then($5e1f45affc1d7def$export$b3bbfd758f11cfa9(keep => {
|
|
7284
7286
|
if (keep)
|
|
7285
7287
|
// @ts-ignore
|
|
7286
7288
|
resolve_promise_({
|
|
7287
7289
|
surface: surface,
|
|
7288
7290
|
succeeded: true
|
|
7289
7291
|
});else {
|
|
7290
|
-
|
|
7292
|
+
$241f2f02cc612a49$export$de56f1198d121036("Removing surface", surface, "because it failed");
|
|
7291
7293
|
set("");
|
|
7292
7294
|
// @ts-ignore
|
|
7293
7295
|
resolve_promise_({
|
|
@@ -7310,7 +7312,7 @@ function $2c22b027931240e6$var$actual_insertion(target, verb, surfaces, try_fore
|
|
|
7310
7312
|
failed_surfaces++;
|
|
7311
7313
|
check_if_revert_whole();
|
|
7312
7314
|
}
|
|
7313
|
-
})().catch(e =>
|
|
7315
|
+
})().catch(e => $5e1f45affc1d7def$export$f18d5b0af29128b7([e, "insert_surface failed due to technical errors"], "error"));
|
|
7314
7316
|
return template_els;
|
|
7315
7317
|
});
|
|
7316
7318
|
target[verb](...template_nodes.flat());
|
|
@@ -7319,10 +7321,10 @@ function $2c22b027931240e6$var$actual_insertion(target, verb, surfaces, try_fore
|
|
|
7319
7321
|
const already_observing_nodes = new WeakSet();
|
|
7320
7322
|
$2c22b027931240e6$var$deal_w_removal_of_node_array(node_array, disconnectors.push.bind(disconnectors), already_observing_nodes);
|
|
7321
7323
|
}
|
|
7322
|
-
if (remove_after_navigation)
|
|
7324
|
+
if (remove_after_navigation) $ad1dbddac6af350d$export$1cd22bab0d2c3b0b(() => {
|
|
7323
7325
|
disconnect_all_observers();
|
|
7324
7326
|
template_nodes.flat().forEach(tn => tn.remove());
|
|
7325
|
-
|
|
7327
|
+
$241f2f02cc612a49$export$de56f1198d121036("Removed", template_nodes, "due to navigation");
|
|
7326
7328
|
});
|
|
7327
7329
|
return disconnect_all_observers;
|
|
7328
7330
|
}
|
|
@@ -7346,7 +7348,7 @@ function $2c22b027931240e6$var$deal_w_removal_of_node_array(node_array, push_dis
|
|
|
7346
7348
|
target: target
|
|
7347
7349
|
} = mutation_record;
|
|
7348
7350
|
if (previous_parent !== target) {
|
|
7349
|
-
|
|
7351
|
+
$241f2f02cc612a49$export$de56f1198d121036(element, "was removed", eoe, "but because a parent got removed we're keeping it that way");
|
|
7350
7352
|
return;
|
|
7351
7353
|
}
|
|
7352
7354
|
if (node_array.every(node => target.contains(node))) {
|
|
@@ -7354,18 +7356,18 @@ function $2c22b027931240e6$var$deal_w_removal_of_node_array(node_array, push_dis
|
|
|
7354
7356
|
// node_array is a reference to an updating array
|
|
7355
7357
|
// it has always updated once this callback is ran, so we can just check if the new value are currently in the DOM
|
|
7356
7358
|
// here we don't check the order but I don't think it's going to be an issue?
|
|
7357
|
-
|
|
7359
|
+
$241f2f02cc612a49$export$de56f1198d121036("Ignoring removal of", element, eoe, "because it seems to come from reactive_template change");
|
|
7358
7360
|
// protect future nodes
|
|
7359
7361
|
$2c22b027931240e6$var$deal_w_removal_of_node_array(node_array, push_disconnector, already_observing_nodes);
|
|
7360
7362
|
} else if (!target.contains(element)) {
|
|
7361
7363
|
// it's possible that the element already was re-inserted at the same time (this callback is executed a tick late), we obv. don't want to attempt to reinsert then
|
|
7362
7364
|
if (removals_in_last_s > 10) {
|
|
7363
|
-
|
|
7365
|
+
$241f2f02cc612a49$export$de56f1198d121036("More than 10 reinsertions in last second, ignoring");
|
|
7364
7366
|
return;
|
|
7365
7367
|
}
|
|
7366
7368
|
removals_in_last_s++;
|
|
7367
7369
|
setTimeout(() => removals_in_last_s--, 1000);
|
|
7368
|
-
|
|
7370
|
+
$241f2f02cc612a49$export$de56f1198d121036(element, "was removed from DOM,", eoe, "reinserting");
|
|
7369
7371
|
const {
|
|
7370
7372
|
documentElement: documentElement
|
|
7371
7373
|
} = document;
|
|
@@ -7378,7 +7380,7 @@ function $2c22b027931240e6$var$deal_w_removal_of_node_array(node_array, push_dis
|
|
|
7378
7380
|
push_disconnector(disconnect_observer);
|
|
7379
7381
|
}
|
|
7380
7382
|
}
|
|
7381
|
-
const $07ddf7dfff112d01$export$3b75288f46cadd96 = () => new Array(
|
|
7383
|
+
const $07ddf7dfff112d01$export$3b75288f46cadd96 = () => new Array($1cd1e96fe31c935d$export$bb0a9c36cf454ea0(3, 8)).fill("⬜").join("");
|
|
7382
7384
|
const $07ddf7dfff112d01$var$make_sel = (image_url, attribute) => "[".concat(attribute, "=").concat(JSON.stringify(image_url), "]");
|
|
7383
7385
|
const $07ddf7dfff112d01$export$a4eccf92efefa04d = function (image_width, image_height) {
|
|
7384
7386
|
let color = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "#f6f7f8";
|
|
@@ -7420,9 +7422,9 @@ async function $07ddf7dfff112d01$export$2dd69958012e3e49() {
|
|
|
7420
7422
|
var _classList, _classList$add, _classList2;
|
|
7421
7423
|
if (elem instanceof HTMLElement) elem.style.cursor = "default";
|
|
7422
7424
|
elem === null || elem === void 0 || (_classList = elem.classList) === null || _classList === void 0 || (_classList$add = (_classList2 = _classList).add) === null || _classList$add === void 0 || _classList$add.call(_classList2, "placeholder");
|
|
7423
|
-
elem.addEventListener("click", e => (
|
|
7425
|
+
elem.addEventListener("click", e => ($241f2f02cc612a49$export$de56f1198d121036("Supressing placeholder click", e), e.preventDefault(), e.stopPropagation(), false), true);
|
|
7424
7426
|
}
|
|
7425
|
-
for (const img of
|
|
7427
|
+
for (const img of $652300c6621d5500$export$5e63aea0cac01fa0(elems, ["src", "srcset", "data-src", "data-srcset"].map(attribute => $07ddf7dfff112d01$var$make_sel(image_url, attribute)).join(", "))) img.classList.add("nolazy"); // this gets ignored by all lazyloaders
|
|
7426
7428
|
return elems;
|
|
7427
7429
|
}]
|
|
7428
7430
|
};
|
|
@@ -7431,9 +7433,9 @@ async function $07ddf7dfff112d01$export$2dd69958012e3e49() {
|
|
|
7431
7433
|
let set_should_stay_inserted;
|
|
7432
7434
|
const should_stay_inserted = new Promise(r => set_should_stay_inserted = r);
|
|
7433
7435
|
if (placeholder_rendering !== null && placeholder_rendering !== void 0 && placeholder_rendering.elements) {
|
|
7434
|
-
const [template_els, _get_state, set_state] =
|
|
7436
|
+
const [template_els, _get_state, set_state] = $2b6304d4ce419ed5$export$3d04c40e7acc1a32(placeholder_rendering.elements);
|
|
7435
7437
|
actual_rendering.then(async rendering_result => {
|
|
7436
|
-
if (typeof post_rendering == "function") await
|
|
7438
|
+
if (typeof post_rendering == "function") await $5e1f45affc1d7def$export$b3bbfd758f11cfa9(post_rendering)(rendering_result);
|
|
7437
7439
|
const {
|
|
7438
7440
|
elements: elements
|
|
7439
7441
|
} = rendering_result || {};
|
|
@@ -7453,7 +7455,7 @@ async function $07ddf7dfff112d01$export$2dd69958012e3e49() {
|
|
|
7453
7455
|
should_stay_inserted: should_stay_inserted
|
|
7454
7456
|
};
|
|
7455
7457
|
} else {
|
|
7456
|
-
|
|
7458
|
+
$241f2f02cc612a49$export$de56f1198d121036("Placeholder rendering went wrong, this is bad! Ditching placeholders");
|
|
7457
7459
|
return (await actual_rendering) || {};
|
|
7458
7460
|
}
|
|
7459
7461
|
};
|
|
@@ -7467,7 +7469,7 @@ function $243da8b4990520aa$export$8ec5c86406f333ff() {
|
|
|
7467
7469
|
try {
|
|
7468
7470
|
return target.apply(this_arg, arguments_list);
|
|
7469
7471
|
} catch (e) {
|
|
7470
|
-
|
|
7472
|
+
$241f2f02cc612a49$export$de56f1198d121036("Swallowing error of removal of node that we have removed or created", e, el);
|
|
7471
7473
|
}
|
|
7472
7474
|
return el;
|
|
7473
7475
|
}
|
|
@@ -7504,7 +7506,7 @@ function $9c0a16930ae6750f$export$38e89c688f9d553a() {
|
|
|
7504
7506
|
const w = window;
|
|
7505
7507
|
let da_promise = w[$9c0a16930ae6750f$var$promise_as_string];
|
|
7506
7508
|
let iframe_promise;
|
|
7507
|
-
if ((typeof da_promise.allSettled !== "function" || typeof ((_da_promise = da_promise) === null || _da_promise === void 0 ? void 0 : (_da_promise$prototype = _da_promise.prototype) === null || _da_promise$prototype === void 0 ? void 0 : _da_promise$prototype.finally) !== "function") &&
|
|
7509
|
+
if ((typeof da_promise.allSettled !== "function" || typeof ((_da_promise = da_promise) === null || _da_promise === void 0 ? void 0 : (_da_promise$prototype = _da_promise.prototype) === null || _da_promise$prototype === void 0 ? void 0 : _da_promise$prototype.finally) !== "function") && !$735ac9fa5091ab33$export$4fbbab6c30e664d5(da_promise) && (iframe_promise = $9c0a16930ae6750f$export$e647444ed9403635())) da_promise = iframe_promise;
|
|
7508
7510
|
if (da_promise) {
|
|
7509
7511
|
var _Object$getOwnPropert;
|
|
7510
7512
|
if (((_Object$getOwnPropert = Object.getOwnPropertyDescriptor(w, $9c0a16930ae6750f$var$promise_as_string)) === null || _Object$getOwnPropert === void 0 ? void 0 : _Object$getOwnPropert.configurable) !== false) Object.defineProperty(w, $9c0a16930ae6750f$var$promise_as_string, {
|
|
@@ -7516,10 +7518,10 @@ function $9c0a16930ae6750f$export$38e89c688f9d553a() {
|
|
|
7516
7518
|
set(value) {
|
|
7517
7519
|
return value;
|
|
7518
7520
|
}
|
|
7519
|
-
});else
|
|
7521
|
+
});else $241f2f02cc612a49$export$de56f1198d121036("Unable to redefine " + $9c0a16930ae6750f$var$promise_as_string + ", it's already nonconfigurable");
|
|
7520
7522
|
}
|
|
7521
7523
|
} catch (e) {
|
|
7522
|
-
|
|
7524
|
+
$b000f5ef6ce456d9$export$8048b892d651b310(e);
|
|
7523
7525
|
}
|
|
7524
7526
|
}
|
|
7525
7527
|
function $9c0a16930ae6750f$export$e647444ed9403635() {
|
|
@@ -7530,7 +7532,7 @@ function $9c0a16930ae6750f$export$e647444ed9403635() {
|
|
|
7530
7532
|
return iframe === null || iframe === void 0 ? void 0 : (_iframe$contentWindow = iframe.contentWindow) === null || _iframe$contentWindow === void 0 ? void 0 : _iframe$contentWindow[$9c0a16930ae6750f$var$promise_as_string];
|
|
7531
7533
|
}
|
|
7532
7534
|
function $24528b2f119d82fb$export$33d1643df63073a8(fetch_handler) {
|
|
7533
|
-
fetch_handler =
|
|
7535
|
+
fetch_handler = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(fetch_handler);
|
|
7534
7536
|
const {
|
|
7535
7537
|
prototype: prototype
|
|
7536
7538
|
} = XMLHttpRequest;
|
|
@@ -7539,17 +7541,17 @@ function $24528b2f119d82fb$export$33d1643df63073a8(fetch_handler) {
|
|
|
7539
7541
|
if (Array.isArray(arg_array)) {
|
|
7540
7542
|
const request = this_arg;
|
|
7541
7543
|
const [method, url] = arg_array;
|
|
7542
|
-
|
|
7544
|
+
$5e1f45affc1d7def$export$b3bbfd758f11cfa9(fetch_handler)(request, method, url, arg_array);
|
|
7543
7545
|
}
|
|
7544
7546
|
return target.apply(this_arg, arg_array);
|
|
7545
7547
|
}
|
|
7546
7548
|
});
|
|
7547
7549
|
}
|
|
7548
7550
|
function $24528b2f119d82fb$export$f314addd5f976083(handler) {
|
|
7549
|
-
$24528b2f119d82fb$export$33d1643df63073a8((req, method, url) => req.addEventListener("load",
|
|
7551
|
+
$24528b2f119d82fb$export$33d1643df63073a8((req, method, url) => req.addEventListener("load", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(event => handler(req, method, url, event))));
|
|
7550
7552
|
}
|
|
7551
7553
|
async function $24528b2f119d82fb$export$c74578d2cd47a84a(send_callback) {
|
|
7552
|
-
const catchified_callback =
|
|
7554
|
+
const catchified_callback = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(send_callback);
|
|
7553
7555
|
const requests = new WeakMap();
|
|
7554
7556
|
$24528b2f119d82fb$export$33d1643df63073a8((request, _method, _url, arg_array) => {
|
|
7555
7557
|
requests.set(request, arg_array);
|
|
@@ -7562,14 +7564,14 @@ async function $24528b2f119d82fb$export$c74578d2cd47a84a(send_callback) {
|
|
|
7562
7564
|
try {
|
|
7563
7565
|
if (requests.has(this_request)) catchified_callback(this_request, requests.get(this_request), arg_list);
|
|
7564
7566
|
} catch (e) {
|
|
7565
|
-
|
|
7567
|
+
$b000f5ef6ce456d9$export$8048b892d651b310(e);
|
|
7566
7568
|
}
|
|
7567
7569
|
return target.apply(this_request, arg_list);
|
|
7568
7570
|
}
|
|
7569
7571
|
});
|
|
7570
7572
|
}
|
|
7571
7573
|
async function $24528b2f119d82fb$export$8e16c51fd2b6507(read_callback) {
|
|
7572
|
-
const catchified_read_callback =
|
|
7574
|
+
const catchified_read_callback = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(read_callback);
|
|
7573
7575
|
const open_send_arg_map = new WeakMap();
|
|
7574
7576
|
const {
|
|
7575
7577
|
prototype: prototype
|
|
@@ -7590,7 +7592,7 @@ async function $24528b2f119d82fb$export$8e16c51fd2b6507(read_callback) {
|
|
|
7590
7592
|
return catchified_read_callback(this_arg, open_args, send_args, default_value, n) || default_value;
|
|
7591
7593
|
} catch (e) {
|
|
7592
7594
|
// in case the weakmaps fail for some reason
|
|
7593
|
-
|
|
7595
|
+
$b000f5ef6ce456d9$export$8048b892d651b310(e);
|
|
7594
7596
|
return default_value;
|
|
7595
7597
|
}
|
|
7596
7598
|
}
|
|
@@ -7611,11 +7613,11 @@ async function $f82333cd2ffc1582$export$83ec13b10b391f13() {
|
|
|
7611
7613
|
const orig_url_with_trailing_slash = o_u_u_o.protocol + "//" + o_u_u_o.host + "/";
|
|
7612
7614
|
if (orig_url) {
|
|
7613
7615
|
// change links
|
|
7614
|
-
|
|
7616
|
+
$652300c6621d5500$export$d4bd03f19260ef1c(orig_url_with_trailing_slash, false, location.hostname);
|
|
7615
7617
|
$f82333cd2ffc1582$export$2a1cc61cffa1f36f(orig_url_with_trailing_slash);
|
|
7616
7618
|
$f82333cd2ffc1582$export$2a38b176ce969e2c(orig_url_with_trailing_slash);
|
|
7617
7619
|
$f82333cd2ffc1582$export$f14a775632a826c4(orig_url_with_trailing_slash);
|
|
7618
|
-
} else
|
|
7620
|
+
} else $241f2f02cc612a49$export$de56f1198d121036(new Error("No ORIG_URL env var was set, demo fixes not gonna work."));
|
|
7619
7621
|
}
|
|
7620
7622
|
function $f82333cd2ffc1582$export$f14a775632a826c4(orig_url_with_trailing_slash) {
|
|
7621
7623
|
// rewrite history.pushState and history.replaceState so that it works if someone calls it with absolute URLs
|
|
@@ -7632,21 +7634,21 @@ function $f82333cd2ffc1582$export$f14a775632a826c4(orig_url_with_trailing_slash)
|
|
|
7632
7634
|
}
|
|
7633
7635
|
function $f82333cd2ffc1582$export$2a1cc61cffa1f36f(orig_url_with_trailing_slash) {
|
|
7634
7636
|
// rewrite fetch requests just in case, maybe we should also rewrite responses
|
|
7635
|
-
|
|
7637
|
+
$201e455525e1fa49$export$85be83e1935d93c2(async (target, this_arg, arg_list) => {
|
|
7636
7638
|
try {
|
|
7637
7639
|
const [url] = arg_list;
|
|
7638
7640
|
if (typeof url == "string") arg_list[0] = url.replaceAll(orig_url_with_trailing_slash, "/");else if (url instanceof Request) {
|
|
7639
7641
|
if (url.url.includes(orig_url_with_trailing_slash)) arg_list[0] = new Request(url.url.replaceAll(orig_url_with_trailing_slash, "/"), url);
|
|
7640
7642
|
}
|
|
7641
7643
|
} catch (e) {
|
|
7642
|
-
|
|
7644
|
+
$b000f5ef6ce456d9$export$8048b892d651b310(e);
|
|
7643
7645
|
}
|
|
7644
7646
|
return target.apply(this_arg, arg_list);
|
|
7645
7647
|
});
|
|
7646
7648
|
}
|
|
7647
7649
|
function $f82333cd2ffc1582$export$2a38b176ce969e2c(orig_url_with_trailing_slash) {
|
|
7648
7650
|
// rewrite xhr requests just in case
|
|
7649
|
-
|
|
7651
|
+
$24528b2f119d82fb$export$33d1643df63073a8((request, method, url, arg_array) => {
|
|
7650
7652
|
if (url instanceof URL) url.href = url.href.replaceAll(orig_url_with_trailing_slash, "/");else if (typeof url == "string") arg_array[1] = url.replaceAll(orig_url_with_trailing_slash, "");
|
|
7651
7653
|
});
|
|
7652
7654
|
}
|
|
@@ -7723,11 +7725,11 @@ function $95b71532fa7f905c$export$a422d714c8cb1a5d(allowed_markets, url) {
|
|
|
7723
7725
|
return "se";
|
|
7724
7726
|
}
|
|
7725
7727
|
function $cb3a51d87cbe5eff$export$3427ec8268623f1(listener) {
|
|
7726
|
-
if (
|
|
7727
|
-
|
|
7728
|
+
if (!$5f31622ffb78bc10$export$b87d7e0da8b5cbe3()) {
|
|
7729
|
+
$241f2f02cc612a49$export$de56f1198d121036("Not hooking localStorage as it would freeze it due to lacking Proxy support");
|
|
7728
7730
|
return;
|
|
7729
7731
|
}
|
|
7730
|
-
const caught_listener =
|
|
7732
|
+
const caught_listener = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(listener);
|
|
7731
7733
|
let changed_instance;
|
|
7732
7734
|
const update_changed_instance = () => changed_instance = Storage.prototype.setItem !== localStorage.setItem;
|
|
7733
7735
|
update_changed_instance();
|
|
@@ -7795,7 +7797,7 @@ function $cb3a51d87cbe5eff$export$3427ec8268623f1(listener) {
|
|
|
7795
7797
|
changed_this_args.add(fn_with_changed_this_arg);
|
|
7796
7798
|
}
|
|
7797
7799
|
} catch (e) {
|
|
7798
|
-
if (key !== "length")
|
|
7800
|
+
if (key !== "length") $241f2f02cc612a49$export$de56f1198d121036(e);
|
|
7799
7801
|
}
|
|
7800
7802
|
}
|
|
7801
7803
|
|
|
@@ -7810,17 +7812,17 @@ function $26145caeb41f1f7b$export$cd1adfb8059b5fcd(promise, ms) {
|
|
|
7810
7812
|
const $8a812fa4638e2832$var$get_voyado_id = () => {
|
|
7811
7813
|
var _exec;
|
|
7812
7814
|
const va = (_exec = /\b_vaI=([^;]+)/.exec(document.cookie)) === null || _exec === void 0 ? void 0 : _exec[1];
|
|
7813
|
-
return va ||
|
|
7815
|
+
return va || $d5f7352b58e0d737$export$6399bdb2291895e0();
|
|
7814
7816
|
};
|
|
7815
|
-
const $8a812fa4638e2832$export$a739d9a07da7f9ce = /*@__PURE__
|
|
7816
|
-
|
|
7817
|
+
const $8a812fa4638e2832$export$a739d9a07da7f9ce = /*@__PURE__*/$5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => {
|
|
7818
|
+
$d5f7352b58e0d737$export$336e7ad40bae0652($8a812fa4638e2832$var$get_voyado_id);
|
|
7817
7819
|
});
|
|
7818
7820
|
function $c40fc6dc2c22b3c4$export$4a3043e508dd72f0(_ref) {
|
|
7819
7821
|
let {
|
|
7820
7822
|
children: children,
|
|
7821
7823
|
...attributes
|
|
7822
7824
|
} = _ref;
|
|
7823
|
-
const button =
|
|
7825
|
+
const button = $0f650018c3cbc373$export$34b9dba7ce09269b("button", {
|
|
7824
7826
|
...attributes,
|
|
7825
7827
|
type: "button",
|
|
7826
7828
|
children: children
|
|
@@ -7838,30 +7840,30 @@ async function $a59cde169150d10b$export$8a0e4d6f6abf7e90(_ref) {
|
|
|
7838
7840
|
let close_;
|
|
7839
7841
|
const open_promise = new Promise(r => close_ = r);
|
|
7840
7842
|
const body = await (0, $90fa633a9564f115$export$b6ae1bc530f4c149).wait_for_element("body");
|
|
7841
|
-
const backdrop =
|
|
7843
|
+
const backdrop = $0f650018c3cbc373$export$34b9dba7ce09269b("div", {
|
|
7842
7844
|
class: "slidein-backdrop",
|
|
7843
7845
|
onClick: close_
|
|
7844
7846
|
});
|
|
7845
|
-
const [exit_title_iterator, exitable_title_iterator] =
|
|
7847
|
+
const [exit_title_iterator, exitable_title_iterator] = $fee212025270d5b9$export$927664b47117acb0(title_);
|
|
7846
7848
|
const closing_handlers = [exit_title_iterator];
|
|
7847
|
-
const slidein =
|
|
7849
|
+
const slidein = $0f650018c3cbc373$export$25062201e9e25d76("div", {
|
|
7848
7850
|
class: "slidein",
|
|
7849
|
-
children: [
|
|
7851
|
+
children: [$0f650018c3cbc373$export$25062201e9e25d76("div", {
|
|
7850
7852
|
class: "header",
|
|
7851
|
-
children: [
|
|
7853
|
+
children: [$0f650018c3cbc373$export$34b9dba7ce09269b("span", {
|
|
7852
7854
|
class: "title",
|
|
7853
|
-
children:
|
|
7854
|
-
}),
|
|
7855
|
+
children: $332ef338faf216a4$export$7c081fdbc65b6a2a(exitable_title_iterator, false)
|
|
7856
|
+
}), $0f650018c3cbc373$export$34b9dba7ce09269b("button", {
|
|
7855
7857
|
class: "close",
|
|
7856
7858
|
onClick: close_,
|
|
7857
7859
|
children: CloseIcon()
|
|
7858
7860
|
})]
|
|
7859
|
-
}),
|
|
7861
|
+
}), $0f650018c3cbc373$export$34b9dba7ce09269b("div", {
|
|
7860
7862
|
class: "body",
|
|
7861
7863
|
children: children
|
|
7862
7864
|
})]
|
|
7863
7865
|
});
|
|
7864
|
-
const elements_in_container =
|
|
7866
|
+
const elements_in_container = $0f650018c3cbc373$export$25062201e9e25d76("div", {
|
|
7865
7867
|
class: "depict",
|
|
7866
7868
|
children: [backdrop, slidein]
|
|
7867
7869
|
});
|
|
@@ -7879,7 +7881,7 @@ async function $a59cde169150d10b$export$8a0e4d6f6abf7e90(_ref) {
|
|
|
7879
7881
|
easing: "ease-in",
|
|
7880
7882
|
duration: 220
|
|
7881
7883
|
});
|
|
7882
|
-
const handler =
|
|
7884
|
+
const handler = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(_ref2 => {
|
|
7883
7885
|
let {
|
|
7884
7886
|
key: key
|
|
7885
7887
|
} = _ref2;
|
|
@@ -7888,7 +7890,7 @@ async function $a59cde169150d10b$export$8a0e4d6f6abf7e90(_ref) {
|
|
|
7888
7890
|
close_();
|
|
7889
7891
|
});
|
|
7890
7892
|
window.addEventListener("keydown", handler);
|
|
7891
|
-
open_promise.then(
|
|
7893
|
+
open_promise.then($5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => {
|
|
7892
7894
|
window.removeEventListener("keydown", handler);
|
|
7893
7895
|
backdrop.animate({
|
|
7894
7896
|
opacity: [1, 0]
|
|
@@ -7903,7 +7905,7 @@ async function $a59cde169150d10b$export$8a0e4d6f6abf7e90(_ref) {
|
|
|
7903
7905
|
}, {
|
|
7904
7906
|
easing: "ease-out",
|
|
7905
7907
|
duration: 220
|
|
7906
|
-
}).addEventListener("finish",
|
|
7908
|
+
}).addEventListener("finish", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => {
|
|
7907
7909
|
elements_in_container.remove();
|
|
7908
7910
|
closing_handlers.forEach(handler => handler());
|
|
7909
7911
|
}));
|
|
@@ -7920,16 +7922,16 @@ async function $24f3fd73864991c0$export$c068ad5361be7646(_ref) {
|
|
|
7920
7922
|
out_of_stock_text_: out_of_stock_text_,
|
|
7921
7923
|
CloseIcon: CloseIcon
|
|
7922
7924
|
} = _ref;
|
|
7923
|
-
const [exit_oos_iterator, exitable_oos_iterator] =
|
|
7925
|
+
const [exit_oos_iterator, exitable_oos_iterator] = $fee212025270d5b9$export$927664b47117acb0(out_of_stock_text_);
|
|
7924
7926
|
// eslint-disable-line no-async-promise-executor
|
|
7925
|
-
return new Promise(
|
|
7927
|
+
return new Promise($5e1f45affc1d7def$export$b3bbfd758f11cfa9(async size_selected => {
|
|
7926
7928
|
const {
|
|
7927
7929
|
close_: close_,
|
|
7928
7930
|
on_close_: on_close_
|
|
7929
|
-
} = await
|
|
7931
|
+
} = await $a59cde169150d10b$export$8a0e4d6f6abf7e90({
|
|
7930
7932
|
CloseIcon: CloseIcon,
|
|
7931
7933
|
title_: title_,
|
|
7932
|
-
children: [
|
|
7934
|
+
children: [$0f650018c3cbc373$export$34b9dba7ce09269b("div", {
|
|
7933
7935
|
class: "option-list",
|
|
7934
7936
|
children: items_.map(_ref2 => {
|
|
7935
7937
|
let {
|
|
@@ -7937,19 +7939,19 @@ async function $24f3fd73864991c0$export$c068ad5361be7646(_ref) {
|
|
|
7937
7939
|
is_available_: is_available_,
|
|
7938
7940
|
id_: id_
|
|
7939
7941
|
} = _ref2;
|
|
7940
|
-
const button =
|
|
7942
|
+
const button = $0f650018c3cbc373$export$25062201e9e25d76("button", {
|
|
7941
7943
|
type: "button",
|
|
7942
7944
|
class: "option" + (is_available_ ? " available" : ""),
|
|
7943
7945
|
onClick: () => {
|
|
7944
7946
|
size_selected(id_);
|
|
7945
7947
|
close_();
|
|
7946
7948
|
},
|
|
7947
|
-
children: [
|
|
7949
|
+
children: [$0f650018c3cbc373$export$34b9dba7ce09269b("span", {
|
|
7948
7950
|
class: "size",
|
|
7949
7951
|
children: size_name_
|
|
7950
|
-
}), !is_available_ &&
|
|
7952
|
+
}), !is_available_ && $0f650018c3cbc373$export$34b9dba7ce09269b("span", {
|
|
7951
7953
|
class: "sold-out",
|
|
7952
|
-
children:
|
|
7954
|
+
children: $332ef338faf216a4$export$7c081fdbc65b6a2a(exitable_oos_iterator)
|
|
7953
7955
|
})]
|
|
7954
7956
|
});
|
|
7955
7957
|
if (!is_available_) button.disabled = true;
|
|
@@ -7961,8 +7963,8 @@ async function $24f3fd73864991c0$export$c068ad5361be7646(_ref) {
|
|
|
7961
7963
|
on_close_(exit_oos_iterator);
|
|
7962
7964
|
}));
|
|
7963
7965
|
}
|
|
7964
|
-
var $
|
|
7965
|
-
$
|
|
7966
|
+
var $4ef779af61421f56$exports = {};
|
|
7967
|
+
$4ef779af61421f56$exports = ".depict-placeholder {\n will-change: mask, -webkit-mask;\n mask-position-x: 125%;\n mask-position-y: center;\n background: #ddd;\n animation: 1.5s linear infinite depict-placeholder;\n display: inline-block;\n position: relative;\n overflow: hidden;\n -webkit-mask: linear-gradient(-60deg, #000 30%, #0005, #000 70%) 125% / 300% 100%;\n -webkit-mask-image: ;\n mask-image: ;\n -webkit-mask-size: ;\n mask-size: ;\n}\n\n@keyframes depict-placeholder {\n 0% {\n mask-position-x: 125%;\n -webkit-mask-position-x: 125%;\n }\n\n 10% {\n mask-position-x: 125%;\n -webkit-mask-position-x: 125%;\n }\n\n 90% {\n mask-position-x: -25%;\n -webkit-mask-position-x: -25%;\n }\n\n 100% {\n mask-position-x: -25%;\n -webkit-mask-position-x: -25%;\n }\n}\n\n";
|
|
7966
7968
|
let $adc0bb548fdb574f$var$inserted = false;
|
|
7967
7969
|
const $adc0bb548fdb574f$export$84712d0562a614b8 = _ref => {
|
|
7968
7970
|
let {
|
|
@@ -7974,12 +7976,12 @@ const $adc0bb548fdb574f$export$84712d0562a614b8 = _ref => {
|
|
|
7974
7976
|
} = _ref;
|
|
7975
7977
|
if (!$adc0bb548fdb574f$var$inserted) {
|
|
7976
7978
|
// Insert styling on first import
|
|
7977
|
-
|
|
7979
|
+
$1013f2e568f87406$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($4ef779af61421f56$exports)));
|
|
7978
7980
|
$adc0bb548fdb574f$var$inserted = true;
|
|
7979
7981
|
}
|
|
7980
7982
|
return (
|
|
7981
7983
|
// @ts-ignore
|
|
7982
|
-
|
|
7984
|
+
$0f650018c3cbc373$export$34b9dba7ce09269b("div", {
|
|
7983
7985
|
class: "depict-placeholder".concat(extra_classes ? " " + extra_classes : ""),
|
|
7984
7986
|
style: style ? style : "width:".concat(width, ";height:").concat(height, ";"),
|
|
7985
7987
|
...attributes
|
|
@@ -7991,36 +7993,36 @@ const $adc0bb548fdb574f$export$d613f5b6d0a331a8 = _ref2 => {
|
|
|
7991
7993
|
aspect_ratio: aspect_ratio,
|
|
7992
7994
|
...attributes
|
|
7993
7995
|
} = _ref2;
|
|
7994
|
-
return
|
|
7996
|
+
return $0f650018c3cbc373$export$34b9dba7ce09269b($adc0bb548fdb574f$export$84712d0562a614b8, {
|
|
7995
7997
|
style: "position:relative;width:100%;padding-bottom:".concat(1 / aspect_ratio * 100, "%"),
|
|
7996
7998
|
...attributes
|
|
7997
7999
|
});
|
|
7998
8000
|
};
|
|
7999
8001
|
const $2e6ca552eb0e0b2b$export$97f31f44c68c1d5 = function (title) {
|
|
8000
8002
|
let surface_classes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
8001
|
-
return
|
|
8003
|
+
return $a285401a927e4306$export$eb0b9ed911409b57(e => e.classList.add(...surface_classes), $0f650018c3cbc373$export$25062201e9e25d76("div", {
|
|
8002
8004
|
class: "depict recommendation_container",
|
|
8003
|
-
children: [title && typeof title === "string" ?
|
|
8005
|
+
children: [title && typeof title === "string" ? $0f650018c3cbc373$export$34b9dba7ce09269b("h4", {
|
|
8004
8006
|
class: "recs_header",
|
|
8005
8007
|
children: title
|
|
8006
|
-
}) : title,
|
|
8008
|
+
}) : title, $0f650018c3cbc373$export$34b9dba7ce09269b("div", {
|
|
8007
8009
|
class: "grid"
|
|
8008
8010
|
})]
|
|
8009
8011
|
}));
|
|
8010
8012
|
};
|
|
8011
|
-
const $ad0b2591dac160be$export$32a55d57d151bc5a = () =>
|
|
8013
|
+
const $ad0b2591dac160be$export$32a55d57d151bc5a = () => $0f650018c3cbc373$export$25062201e9e25d76("svg", {
|
|
8012
8014
|
viewBox: "0 0 320 512",
|
|
8013
|
-
children: [
|
|
8015
|
+
children: [$0f650018c3cbc373$export$34b9dba7ce09269b("desc", {
|
|
8014
8016
|
children: "Right arrow"
|
|
8015
|
-
}),
|
|
8017
|
+
}), $0f650018c3cbc373$export$34b9dba7ce09269b("path", {
|
|
8016
8018
|
d: "M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"
|
|
8017
8019
|
})]
|
|
8018
8020
|
});
|
|
8019
|
-
const $ad0b2591dac160be$export$ddd70fdae1b350e6 = () =>
|
|
8021
|
+
const $ad0b2591dac160be$export$ddd70fdae1b350e6 = () => $0f650018c3cbc373$export$25062201e9e25d76("svg", {
|
|
8020
8022
|
viewBox: "0 0 320 512",
|
|
8021
|
-
children: [
|
|
8023
|
+
children: [$0f650018c3cbc373$export$34b9dba7ce09269b("desc", {
|
|
8022
8024
|
children: "Left arrow"
|
|
8023
|
-
}),
|
|
8025
|
+
}), $0f650018c3cbc373$export$34b9dba7ce09269b("path", {
|
|
8024
8026
|
d: "M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z"
|
|
8025
8027
|
})]
|
|
8026
8028
|
});
|
|
@@ -8035,21 +8037,21 @@ function $9a74c17d1ef21fdf$var$ColorCircle(_ref) {
|
|
|
8035
8037
|
onClick: onClick,
|
|
8036
8038
|
onHoverUpdate: onHoverUpdate
|
|
8037
8039
|
} = _ref;
|
|
8038
|
-
const button =
|
|
8040
|
+
const button = $0f650018c3cbc373$export$34b9dba7ce09269b("button", {
|
|
8039
8041
|
class: "color-circle-container",
|
|
8040
8042
|
onClick: e => onClick(e.currentTarget, color),
|
|
8041
8043
|
title: color.label || "",
|
|
8042
|
-
children:
|
|
8044
|
+
children: $0f650018c3cbc373$export$34b9dba7ce09269b("div", {
|
|
8043
8045
|
class: "outer-circle",
|
|
8044
8046
|
style: "border-color: ".concat(color.value, ";"),
|
|
8045
|
-
children:
|
|
8047
|
+
children: $0f650018c3cbc373$export$34b9dba7ce09269b("div", {
|
|
8046
8048
|
class: "inner-circle",
|
|
8047
8049
|
style: "background-color: ".concat(color.value, ";")
|
|
8048
8050
|
})
|
|
8049
8051
|
})
|
|
8050
8052
|
});
|
|
8051
|
-
button.addEventListener("mouseenter",
|
|
8052
|
-
button.addEventListener("mouseleave",
|
|
8053
|
+
button.addEventListener("mouseenter", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => onHoverUpdate(button, color, true)));
|
|
8054
|
+
button.addEventListener("mouseleave", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => onHoverUpdate(button, color, false)));
|
|
8053
8055
|
return button;
|
|
8054
8056
|
}
|
|
8055
8057
|
function $9a74c17d1ef21fdf$export$590326cc34f49e2d(_ref2) {
|
|
@@ -8106,7 +8108,7 @@ function $9a74c17d1ef21fdf$export$590326cc34f49e2d(_ref2) {
|
|
|
8106
8108
|
if (selectOnHover) handleSelectOnHover(hovered, color, hovering);
|
|
8107
8109
|
};
|
|
8108
8110
|
// Create the color circles
|
|
8109
|
-
const circles = colors.map(color =>
|
|
8111
|
+
const circles = colors.map(color => $0f650018c3cbc373$export$34b9dba7ce09269b($9a74c17d1ef21fdf$var$ColorCircle, {
|
|
8110
8112
|
color: color,
|
|
8111
8113
|
onClick: handleClick,
|
|
8112
8114
|
onHoverUpdate: handleHoverUpdate
|
|
@@ -8117,7 +8119,7 @@ function $9a74c17d1ef21fdf$export$590326cc34f49e2d(_ref2) {
|
|
|
8117
8119
|
const initial_index = initialColor == undefined ? -1 : colors.findIndex(c => typeof initialColor === "string" ? c.value === initialColor : c.value === initialColor.value && c.label === initialColor.label);
|
|
8118
8120
|
if (initial_index > -1) setActiveIndex(initial_index);
|
|
8119
8121
|
if (onlyCircles) return circles;
|
|
8120
|
-
return
|
|
8122
|
+
return $0f650018c3cbc373$export$34b9dba7ce09269b("div", {
|
|
8121
8123
|
class: "color-picker",
|
|
8122
8124
|
role: "form",
|
|
8123
8125
|
"aria-label": "Color picker",
|
|
@@ -8151,17 +8153,17 @@ const $0f55c2bc0a7b363b$export$237455ad7e59d4e5 = function () {
|
|
|
8151
8153
|
children: children
|
|
8152
8154
|
} = _ref;
|
|
8153
8155
|
if (Array.isArray(children) && children.length === 1) children = children[0];
|
|
8154
|
-
innerRef =
|
|
8156
|
+
innerRef = $0f650018c3cbc373$export$34b9dba7ce09269b("div", {
|
|
8155
8157
|
children: children
|
|
8156
8158
|
});
|
|
8157
|
-
outerRef =
|
|
8159
|
+
outerRef = $0f650018c3cbc373$export$34b9dba7ce09269b("div", {
|
|
8158
8160
|
style: "overflow:hidden;height:0px;visibility:hidden",
|
|
8159
8161
|
"aria-hidden": "true",
|
|
8160
8162
|
children: innerRef
|
|
8161
8163
|
});
|
|
8162
8164
|
return outerRef;
|
|
8163
8165
|
};
|
|
8164
|
-
const expand =
|
|
8166
|
+
const expand = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(async function () {
|
|
8165
8167
|
var _current_animation, _current_animation$ca;
|
|
8166
8168
|
let expanding_delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : delay;
|
|
8167
8169
|
let time_to_expand = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : duration;
|
|
@@ -8177,14 +8179,14 @@ const $0f55c2bc0a7b363b$export$237455ad7e59d4e5 = function () {
|
|
|
8177
8179
|
easing: "ease-in"
|
|
8178
8180
|
});
|
|
8179
8181
|
current_animation = animation;
|
|
8180
|
-
animation.addEventListener("finish",
|
|
8182
|
+
animation.addEventListener("finish", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => {
|
|
8181
8183
|
current_animation = undefined;
|
|
8182
8184
|
outerRef.style.overflow = "";
|
|
8183
8185
|
outerRef.style.height = "auto";
|
|
8184
8186
|
}));
|
|
8185
8187
|
return animation;
|
|
8186
8188
|
});
|
|
8187
|
-
const collapse =
|
|
8189
|
+
const collapse = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(async function () {
|
|
8188
8190
|
var _current_animation2, _current_animation2$c;
|
|
8189
8191
|
let collapsing_delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : delay;
|
|
8190
8192
|
let time_to_collapse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : duration;
|
|
@@ -8200,7 +8202,7 @@ const $0f55c2bc0a7b363b$export$237455ad7e59d4e5 = function () {
|
|
|
8200
8202
|
easing: "ease-out"
|
|
8201
8203
|
});
|
|
8202
8204
|
current_animation = animation;
|
|
8203
|
-
animation.addEventListener("finish",
|
|
8205
|
+
animation.addEventListener("finish", $5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => {
|
|
8204
8206
|
current_animation = undefined;
|
|
8205
8207
|
outerRef.style.height = "0";
|
|
8206
8208
|
outerRef.style.visibility = "hidden";
|
|
@@ -8213,15 +8215,15 @@ const $0f55c2bc0a7b363b$export$237455ad7e59d4e5 = function () {
|
|
|
8213
8215
|
collapse: collapse
|
|
8214
8216
|
};
|
|
8215
8217
|
};
|
|
8216
|
-
var $
|
|
8217
|
-
$
|
|
8218
|
+
var $bb22ceba3718f8e9$exports = {};
|
|
8219
|
+
$bb22ceba3718f8e9$exports = ".depict-img-cont {\n width: 100%;\n height: 100%;\n position: absolute;\n}\n\n.depict-img-filler {\n width: 100%;\n height: auto;\n display: inline-block;\n}\n\n.depict-img-comp {\n width: auto;\n height: auto;\n max-width: 100%;\n max-height: 100%;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n\n.depict-img-mod {\n width: 100%;\n height: 100%;\n object-fit: contain;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n\n";
|
|
8218
8220
|
const $9ef5ce4804a3b61b$export$3d13beba9b52c947 = "https://img.depict.ai/ResizeImage" + (process.env.TENANT ? "/" + process.env.TENANT : "");
|
|
8219
8221
|
const $9ef5ce4804a3b61b$export$a98fc8a2c818d3d8 = /*@__PURE__*/(() => typeof navigator === "undefined" ? false : /^((?!chrome|android).)*safari/i.test(navigator.userAgent))(); // https://stackoverflow.com/a/23522755
|
|
8220
8222
|
function $9ef5ce4804a3b61b$export$f39a7d0667e924a(what_to_watch) {
|
|
8221
|
-
let sizes_communicator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] :
|
|
8223
|
+
let sizes_communicator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $7ca6fdc721083788$export$e806c6c1615a59ae();
|
|
8222
8224
|
let resolution_factor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
8223
8225
|
let currently_live = false;
|
|
8224
|
-
const ro = new ResizeObserver(
|
|
8226
|
+
const ro = new ResizeObserver($5e1f45affc1d7def$export$b3bbfd758f11cfa9(records => {
|
|
8225
8227
|
for (let j = 0; j < records.length; j++) {
|
|
8226
8228
|
const {
|
|
8227
8229
|
width: width
|
|
@@ -8295,9 +8297,9 @@ function $9ef5ce4804a3b61b$export$a62825542f1bfcf5() {
|
|
|
8295
8297
|
const raw_src = (image_options === null || image_options === void 0 ? void 0 : image_options.src) || (image_options === null || image_options === void 0 ? void 0 : image_options["data-src"]); // get wanted src
|
|
8296
8298
|
const src = new URL(raw_src, location.origin).href;
|
|
8297
8299
|
if (!src) {
|
|
8298
|
-
|
|
8299
|
-
|
|
8300
|
-
return
|
|
8300
|
+
$241f2f02cc612a49$export$de56f1198d121036(image_options, () => {}); // noop function is to allow to get here quickly by "jump to function definition"
|
|
8301
|
+
$b000f5ef6ce456d9$export$8048b892d651b310(new Error("no image src provided: " + src));
|
|
8302
|
+
return $0f650018c3cbc373$export$34b9dba7ce09269b("img", {
|
|
8301
8303
|
...image_options
|
|
8302
8304
|
}); // we don't want everything to fail if someone misused this component
|
|
8303
8305
|
}
|
|
@@ -8310,7 +8312,7 @@ function $9ef5ce4804a3b61b$export$a62825542f1bfcf5() {
|
|
|
8310
8312
|
const srcset = $9ef5ce4804a3b61b$var$make_srcset(src, format, resolutions);
|
|
8311
8313
|
sources.push(
|
|
8312
8314
|
// 0px important because chrome will load the biggest size otherwise until sizes attribute is set to the correct value
|
|
8313
|
-
|
|
8315
|
+
$0f650018c3cbc373$export$34b9dba7ce09269b("source", {
|
|
8314
8316
|
sizes: "0px",
|
|
8315
8317
|
type: "image/".concat(format),
|
|
8316
8318
|
...(set_dataset ? {
|
|
@@ -8325,7 +8327,7 @@ function $9ef5ce4804a3b61b$export$a62825542f1bfcf5() {
|
|
|
8325
8327
|
}; // Prevents the image from instantly loading the original source
|
|
8326
8328
|
delete opts_without_src["src"];
|
|
8327
8329
|
delete opts_without_src["srcset"];
|
|
8328
|
-
const the_image =
|
|
8330
|
+
const the_image = $0f650018c3cbc373$export$34b9dba7ce09269b("img", {
|
|
8329
8331
|
...opts_without_src
|
|
8330
8332
|
}); // create image
|
|
8331
8333
|
sources.push(the_image); // chrome seems to be the dumbest piece of cake that has ever existed and just load the first source?????
|
|
@@ -8334,7 +8336,7 @@ function $9ef5ce4804a3b61b$export$a62825542f1bfcf5() {
|
|
|
8334
8336
|
// start a sizes_setter for every source (including fallback image)
|
|
8335
8337
|
for (let i = 0; i < sources.length; i++) sizes_setter_(sources[i]).catch((0, $b000f5ef6ce456d9$export$8048b892d651b310));
|
|
8336
8338
|
// embed all sources into a <picture> so that the browser understands they're "together"
|
|
8337
|
-
const picture =
|
|
8339
|
+
const picture = $0f650018c3cbc373$export$34b9dba7ce09269b("picture", {
|
|
8338
8340
|
children: sources
|
|
8339
8341
|
});
|
|
8340
8342
|
// Create src and srcset for fallback image and set it.
|
|
@@ -8377,13 +8379,13 @@ const $c987460cedc0d7ec$export$788756b42446dc2d = _ref => {
|
|
|
8377
8379
|
} = _ref;
|
|
8378
8380
|
if (!$c987460cedc0d7ec$var$inserted) {
|
|
8379
8381
|
// Insert styling on first import
|
|
8380
|
-
|
|
8382
|
+
$1013f2e568f87406$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($bb22ceba3718f8e9$exports)));
|
|
8381
8383
|
$c987460cedc0d7ec$var$inserted = true;
|
|
8382
8384
|
}
|
|
8383
8385
|
const img = process.env.BUILD_TARGET === "modern" || process.env.BUILD_TARGET === "dev" ? $c987460cedc0d7ec$var$Image(options) : $c987460cedc0d7ec$var$CompatibleImage(options);
|
|
8384
8386
|
if (init_with_placeholder)
|
|
8385
8387
|
// 10000 is a magic value, that is just supposed to be bigger than the size of the actual image.
|
|
8386
|
-
img.querySelectorAll("img").forEach(i => i.src =
|
|
8388
|
+
img.querySelectorAll("img").forEach(i => i.src = $07ddf7dfff112d01$export$a4eccf92efefa04d(10000 * options.aspect_ratio, 10000));
|
|
8387
8389
|
return img;
|
|
8388
8390
|
};
|
|
8389
8391
|
function $c987460cedc0d7ec$var$Image(_ref2) {
|
|
@@ -8397,20 +8399,20 @@ function $c987460cedc0d7ec$var$Image(_ref2) {
|
|
|
8397
8399
|
init_with_placeholder: _,
|
|
8398
8400
|
...image_options
|
|
8399
8401
|
} = _ref2;
|
|
8400
|
-
const div =
|
|
8402
|
+
const div = $0f650018c3cbc373$export$34b9dba7ce09269b("div", {
|
|
8401
8403
|
style: "position:relative;width:100%;padding-bottom:".concat(1 / aspect_ratio * 100, "%")
|
|
8402
8404
|
});
|
|
8403
8405
|
const sourceset_component = $c987460cedc0d7ec$var$srcset_comp_from_map_or_new(rendering_options, srcset_opts, div);
|
|
8404
8406
|
const IMG_tag = (_image_options$src = image_options.src) !== null && _image_options$src !== void 0 && _image_options$src.startsWith("data:") || !sourceset_component ? "img" : sourceset_component;
|
|
8405
8407
|
div.append(
|
|
8406
8408
|
// @ts-ignore
|
|
8407
|
-
|
|
8409
|
+
$0f650018c3cbc373$export$34b9dba7ce09269b(IMG_tag, {
|
|
8408
8410
|
alt: alt,
|
|
8409
8411
|
...(remove_on_error ? {
|
|
8410
8412
|
onerror: "this.remove()"
|
|
8411
8413
|
} : {}),
|
|
8412
8414
|
...image_options,
|
|
8413
|
-
class:
|
|
8415
|
+
class: $a285401a927e4306$export$22a65337c1b43b1f(["depict-img-mod ", image_options.class, $c987460cedc0d7ec$var$add_nolazy_to_placeholder(rendering_options === null || rendering_options === void 0 ? void 0 : rendering_options.type)])
|
|
8414
8416
|
}));
|
|
8415
8417
|
return div;
|
|
8416
8418
|
}
|
|
@@ -8424,24 +8426,24 @@ function $c987460cedc0d7ec$var$CompatibleImage(_ref3) {
|
|
|
8424
8426
|
srcset_opts: srcset_opts,
|
|
8425
8427
|
...image_options
|
|
8426
8428
|
} = _ref3;
|
|
8427
|
-
const canvas =
|
|
8429
|
+
const canvas = $0f650018c3cbc373$export$34b9dba7ce09269b("canvas", {
|
|
8428
8430
|
class: "depict-img-filler",
|
|
8429
8431
|
width: 3000 * aspect_ratio,
|
|
8430
8432
|
height: 3000
|
|
8431
8433
|
});
|
|
8432
8434
|
const sourceset_component = $c987460cedc0d7ec$var$srcset_comp_from_map_or_new(rendering_options, srcset_opts, canvas);
|
|
8433
8435
|
const IMG_tag = (_image_options$src2 = image_options.src) !== null && _image_options$src2 !== void 0 && _image_options$src2.startsWith("data:") || !sourceset_component ? "img" : sourceset_component;
|
|
8434
|
-
return
|
|
8436
|
+
return $0f650018c3cbc373$export$25062201e9e25d76("div", {
|
|
8435
8437
|
style: "position:relative",
|
|
8436
|
-
children: [
|
|
8438
|
+
children: [$0f650018c3cbc373$export$34b9dba7ce09269b("div", {
|
|
8437
8439
|
class: "depict-img-cont",
|
|
8438
|
-
children:
|
|
8440
|
+
children: $0f650018c3cbc373$export$34b9dba7ce09269b(IMG_tag, {
|
|
8439
8441
|
alt: alt,
|
|
8440
8442
|
...(remove_on_error ? {
|
|
8441
8443
|
onerror: "this.remove()"
|
|
8442
8444
|
} : {}),
|
|
8443
8445
|
...image_options,
|
|
8444
|
-
class:
|
|
8446
|
+
class: $a285401a927e4306$export$22a65337c1b43b1f(["depict-img-comp", image_options.class, $c987460cedc0d7ec$var$add_nolazy_to_placeholder(rendering_options === null || rendering_options === void 0 ? void 0 : rendering_options.type)])
|
|
8445
8447
|
})
|
|
8446
8448
|
}), canvas]
|
|
8447
8449
|
});
|
|
@@ -8458,14 +8460,14 @@ function $c987460cedc0d7ec$var$srcset_comp_from_map_or_new(rendering_options) {
|
|
|
8458
8460
|
...srcset_opts
|
|
8459
8461
|
};
|
|
8460
8462
|
cloned_opts.what_to_watch = canvas;
|
|
8461
|
-
sourceset_component =
|
|
8463
|
+
sourceset_component = $9ef5ce4804a3b61b$export$a62825542f1bfcf5(cloned_opts);
|
|
8462
8464
|
$c987460cedc0d7ec$var$rendering_options_to_sourceset_component.set(rendering_options, new WeakRef(sourceset_component));
|
|
8463
8465
|
}
|
|
8464
8466
|
}
|
|
8465
8467
|
return sourceset_component;
|
|
8466
8468
|
}
|
|
8467
|
-
var $
|
|
8468
|
-
$
|
|
8469
|
+
var $9dac835b40ad5f94$exports = {};
|
|
8470
|
+
$9dac835b40ad5f94$exports = ".depict .images-container {\n position: relative;\n}\n\n.depict .second-image-container {\n width: 100%;\n opacity: 0;\n position: absolute;\n top: 0;\n}\n\n.depict .hovering .main-image-container {\n opacity: 0;\n}\n\n.depict .hovering .second-image-container {\n opacity: 1;\n}\n\n";
|
|
8469
8471
|
|
|
8470
8472
|
// Saving bytez
|
|
8471
8473
|
// Maybe? @Daniel
|
|
@@ -8495,7 +8497,7 @@ function $73f0a7e385687d5d$var$register_element_for_touch_hover(el, navigation_m
|
|
|
8495
8497
|
}
|
|
8496
8498
|
function $73f0a7e385687d5d$var$start_checking_for_touch_hover() {
|
|
8497
8499
|
const currently_hovering = new Map();
|
|
8498
|
-
const handle_touch_start =
|
|
8500
|
+
const handle_touch_start = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(evt => {
|
|
8499
8501
|
var _evt$changedTouches;
|
|
8500
8502
|
const touch = evt === null || evt === void 0 ? void 0 : (_evt$changedTouches = evt.changedTouches) === null || _evt$changedTouches === void 0 ? void 0 : _evt$changedTouches[0];
|
|
8501
8503
|
if (!touch) return; // Eytys dispatches fake touch events without changedTouches
|
|
@@ -8520,7 +8522,7 @@ function $73f0a7e385687d5d$var$start_checking_for_touch_hover() {
|
|
|
8520
8522
|
}
|
|
8521
8523
|
});
|
|
8522
8524
|
let last_collision_check = +new Date();
|
|
8523
|
-
const handle_touch_move =
|
|
8525
|
+
const handle_touch_move = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(evt => {
|
|
8524
8526
|
var _evt$changedTouches2;
|
|
8525
8527
|
const first_touch = evt === null || evt === void 0 ? void 0 : (_evt$changedTouches2 = evt.changedTouches) === null || _evt$changedTouches2 === void 0 ? void 0 : _evt$changedTouches2[0];
|
|
8526
8528
|
if (!first_touch) return;
|
|
@@ -8537,7 +8539,7 @@ function $73f0a7e385687d5d$var$start_checking_for_touch_hover() {
|
|
|
8537
8539
|
if (get_hover_element_from_coords(clientX, clientY) !== our_touch_data.element_) clear_hover(identifier, our_touch_data, clientX, clientY);
|
|
8538
8540
|
}
|
|
8539
8541
|
});
|
|
8540
|
-
const handle_touch_cancel =
|
|
8542
|
+
const handle_touch_cancel = $5e1f45affc1d7def$export$b3bbfd758f11cfa9(evt => {
|
|
8541
8543
|
var _evt$changedTouches3;
|
|
8542
8544
|
const touch = evt === null || evt === void 0 ? void 0 : (_evt$changedTouches3 = evt.changedTouches) === null || _evt$changedTouches3 === void 0 ? void 0 : _evt$changedTouches3[0];
|
|
8543
8545
|
if (!touch) return;
|
|
@@ -8550,7 +8552,7 @@ function $73f0a7e385687d5d$var$start_checking_for_touch_hover() {
|
|
|
8550
8552
|
const hover_element = elements[$73f0a7e385687d5d$var$HOVER_IMAGE_DEPTH - 1];
|
|
8551
8553
|
return hover_element && $73f0a7e385687d5d$var$touch_hover_elements.has(hover_element) ? hover_element : null;
|
|
8552
8554
|
};
|
|
8553
|
-
const clear_hover =
|
|
8555
|
+
const clear_hover = $5e1f45affc1d7def$export$b3bbfd758f11cfa9((id, info_about_touch, now_x, now_y) => {
|
|
8554
8556
|
const {
|
|
8555
8557
|
element_: element_,
|
|
8556
8558
|
start_y_: start_y_,
|
|
@@ -8599,25 +8601,25 @@ const $73f0a7e385687d5d$export$2369f6fc1c911576 = _ref => {
|
|
|
8599
8601
|
...options
|
|
8600
8602
|
} = _ref;
|
|
8601
8603
|
if (!$73f0a7e385687d5d$var$styling_inserted) {
|
|
8602
|
-
|
|
8604
|
+
$1013f2e568f87406$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($9dac835b40ad5f94$exports)));
|
|
8603
8605
|
$73f0a7e385687d5d$var$styling_inserted = true;
|
|
8604
8606
|
}
|
|
8605
|
-
const main_image =
|
|
8607
|
+
const main_image = $c987460cedc0d7ec$export$788756b42446dc2d({
|
|
8606
8608
|
...options
|
|
8607
8609
|
});
|
|
8608
|
-
const second_image =
|
|
8610
|
+
const second_image = $c987460cedc0d7ec$export$788756b42446dc2d({
|
|
8609
8611
|
...options,
|
|
8610
8612
|
[(second_srcset_opts === null || second_srcset_opts === void 0 ? void 0 : second_srcset_opts.set_dataset) === false ? "src" : "data-src"]: second_src || "",
|
|
8611
8613
|
[(second_srcset_opts === null || second_srcset_opts === void 0 ? void 0 : second_srcset_opts.set_dataset) === false ? "srcset" : "data-srcset"]: second_srcset || "",
|
|
8612
8614
|
srcset_opts: second_srcset_opts || {}
|
|
8613
8615
|
});
|
|
8614
8616
|
const no_second_img = !second_src && !second_srcset && !second_srcset_opts;
|
|
8615
|
-
const images_container =
|
|
8617
|
+
const images_container = $0f650018c3cbc373$export$25062201e9e25d76("div", {
|
|
8616
8618
|
class: "images-container",
|
|
8617
|
-
children: [!no_second_img &&
|
|
8619
|
+
children: [!no_second_img && $0f650018c3cbc373$export$34b9dba7ce09269b("div", {
|
|
8618
8620
|
class: "second-image-container",
|
|
8619
8621
|
children: second_image
|
|
8620
|
-
}),
|
|
8622
|
+
}), $0f650018c3cbc373$export$34b9dba7ce09269b("div", {
|
|
8621
8623
|
class: "main-image-container",
|
|
8622
8624
|
children: main_image
|
|
8623
8625
|
})]
|
|
@@ -8768,11 +8770,11 @@ let $656899961fd22692$var$running_writers = 0;
|
|
|
8768
8770
|
function $656899961fd22692$export$ef73ea4f975745ba(meta_data) {
|
|
8769
8771
|
if ($656899961fd22692$var$running_writers >= 1) return;
|
|
8770
8772
|
$656899961fd22692$var$running_writers++;
|
|
8771
|
-
|
|
8773
|
+
$76EG6$onCleanup(() => $656899961fd22692$var$running_writers--);
|
|
8772
8774
|
const disconnectors = [];
|
|
8773
|
-
|
|
8775
|
+
$76EG6$createEffect($5e1f45affc1d7def$export$b3bbfd758f11cfa9(() => {
|
|
8774
8776
|
if (!meta_data()) return;
|
|
8775
|
-
|
|
8777
|
+
$76EG6$onCleanup(() => {
|
|
8776
8778
|
disconnectors.forEach(d => d());
|
|
8777
8779
|
});
|
|
8778
8780
|
for (const [type, content] of Object.entries(meta_data())) for (const opts of $656899961fd22692$var$tags[type]) {
|
|
@@ -8783,7 +8785,7 @@ function $656899961fd22692$export$ef73ea4f975745ba(meta_data) {
|
|
|
8783
8785
|
* It's preferred not to kill any conflicting meta tags because frameworks might go apeshit.
|
|
8784
8786
|
* Things seem to work when only changing the meta values though */
|
|
8785
8787
|
const sync_elements_to_head = () => {
|
|
8786
|
-
if (retries++ > $656899961fd22692$var$MAX_SYNC_RETRIES) return
|
|
8788
|
+
if (retries++ > $656899961fd22692$var$MAX_SYNC_RETRIES) return $241f2f02cc612a49$export$de56f1198d121036("Failed to sync meta tag to head. Hit max retries.", opts.selector, content);
|
|
8787
8789
|
const existing_elements = document.head.querySelectorAll(opts.selector);
|
|
8788
8790
|
const elements = existing_elements.length ? existing_elements : [opts.create()];
|
|
8789
8791
|
elements.forEach(el => {
|
|
@@ -8806,5 +8808,5 @@ function $656899961fd22692$export$ef73ea4f975745ba(meta_data) {
|
|
|
8806
8808
|
}
|
|
8807
8809
|
}, "Meta tag writing crashed"));
|
|
8808
8810
|
}
|
|
8809
|
-
|
|
8811
|
+
$ea5707b8e7b350cf$export$2cefb7e61fcbae00("utilishared", (0, $b9e07ce3c67aa344$export$83d89fbfd8236492));
|
|
8810
8812
|
export { $5c580d87c093cc47$export$a7e53ec3b3fdd030 as base64_decode_unicode, $5c580d87c093cc47$export$a1893782a2a6be0d as base64_encode_unicode, $5f4e0abe3139380e$export$6f051469dd676a8b as make_plp_recommendations_inserted_handler, $ea5707b8e7b350cf$export$60d1d0e3cfc8b9ed as version_info, $ea5707b8e7b350cf$export$fe609f0216e4ebef as add_version_query_params, $cdf4691608b4019f$export$6e7454c733fa1fb2 as cache_args, $bcc7b73f8b96a6f0$export$8582cf3716962dc2 as check_displays, $b000f5ef6ce456d9$export$8048b892d651b310 as err, $a01cf8e3169d2af1$export$16d7c76794a38a4 as require_event_listener, $a496a9038b9c02cf$export$41de2959a8dd405d as Auto_GWVM, $ddeca43328b507f6$export$c83d8da642b5104a as GWVM_Renderer, $6a44fa3f1acf7693$export$55621c1ce3cd536b as infinite_promise_creator, $4c6e595091defcd9$export$32ccf3a614c84258 as infinite_promise_no_skip, $d3b90d5099bf2925$export$c0a4d29bc45a38c6 as infinite_renderer, $3ee6c00e6df1008f$export$9eae832ae57fbf as deprecated_insert_styling, $e64690bc3a7de2b1$export$c7187bbd1a7a9244 as placeholder, $d4f914b34cc77d0c$export$cab8bc58c64c2013 as Pro_Slider, $48b0f027b215b8ad$export$2e2bcd8739ae039 as simplified_template_tool, $0342f59060b8a196$export$f1b8b9fd75ddcab1 as insert_styling_into_slider, $b7b39b38d6e695e9$export$cd12721587f4f16d as RR_Slider, $eb252431088a7c2b$export$1a8782481a9af507 as Depict, $19946af5b386da54$export$30933c637c977eef as get_recs_with_template, $19946af5b386da54$export$c410ce1205e5118a as default_post_processor, $19946af5b386da54$export$4f39078bdc72ecd0 as default_pre_processor, $03021b39f80fac4b$export$2e2bcd8739ae039 as wpff, $7d82513db34b5d27$export$12e07a2a9f87578a as ElementObserver, $90fa633a9564f115$export$b6ae1bc530f4c149 as observer, $0f650018c3cbc373$export$34b9dba7ce09269b as jsx, $0f650018c3cbc373$export$25062201e9e25d76 as jsxs, $a285401a927e4306$export$eb0b9ed911409b57 as use_element, $a285401a927e4306$export$f63fcc839cb0f734 as use_listener, $a285401a927e4306$export$22a65337c1b43b1f as classlist, $241f2f02cc612a49$export$de56f1198d121036 as dlog, $241f2f02cc612a49$export$997143d41f6a0c9b as derror, $241f2f02cc612a49$export$c2363754d4758444 as dwarn, $241f2f02cc612a49$export$2dd75a6b038dc8cb as set_browser_prefix, $5e1f45affc1d7def$export$b3bbfd758f11cfa9 as catchify, $5e1f45affc1d7def$export$f18d5b0af29128b7 as report, $a5a2bdb4ae93374b$export$55fe61489d2c7417 as is_debug, $c755e2b0d4b18501$export$6038895ac52bd044 as chevronLeft, $c755e2b0d4b18501$export$dc84183312f0c201 as chevronRight, $0fe3923936d40f55$export$68c017fd93791405 as expandingContainer, $5f31622ffb78bc10$export$3be7054c61590ee3 as Lazyfier, $5f31622ffb78bc10$export$b87d7e0da8b5cbe3 as test_array_proxy_support, $be288a83d9eabf2a$export$692b27c28639e5b9 as Amazing_Slider, $20fe9624210ef635$export$16501883f477737a as colorize_elements, $20fe9624210ef635$export$deca40f48c0569f8 as should_colorizeLogics, $70017d06e57dffa8$export$50ce83ace0cdd87e as default_rr, $51dfcecbe05cc4e5$export$1bc0df10745d5412 as fetch_recs, $51dfcecbe05cc4e5$export$d40679eb4cf32f09 as fetch_recs_whole_response, $378c98788ab52b9c$export$c42139a43c877ecd as clone_deep, $378c98788ab52b9c$export$e0009e7da572f99b as regex_templating, $378c98788ab52b9c$export$a9fc160c5ed83bd7 as Rec_Renderer, $df6d080cba513381$export$17c3166a7ebd4688 as n_col_styling_with_dist, $df6d080cba513381$export$c84671f46d6a1ca as Layout, $df6d080cba513381$export$483bdd1f1186de13 as layout_get_visible_recs_without_partial_rows, $df6d080cba513381$export$3dc5e2383c924ebf as layout_get_total_rec_amount_for_row, $df6d080cba513381$export$717f13d9ba00ca19 as layout_media_query_header, $297a08bac2d81fab$export$b0a773486c1c2312 as RecommendationGrid, $d89e3aaeb9270095$export$82cfdc85a4d15688 as RecommendationSlider, $943514d07f57df12$export$6830ae1fbe21e589 as default_click_tracking, $943514d07f57df12$export$f37c58ab3d3e3b75 as default_view_tracking, $943514d07f57df12$export$dd32cb565eae0a1f as ga_click, $943514d07f57df12$export$8d72437623fef90c as gtag_click_post_processor, $943514d07f57df12$export$1bffac19f9f0d6fc as gtag_view_post_processor, $943514d07f57df12$export$e9106d6e723510d2 as depict_click_tracking_post_processor, $943514d07f57df12$export$fb9afe9f540ae069 as recs_inserted_tracking, $943514d07f57df12$export$32eb5dd18e963410 as add_to_localstorage, $943514d07f57df12$export$9e1caada6901f552 as depict_page_view, $b109421811582f8c$export$8cbd8aa1c70f9a13 as slider_autoscroll_factory, $090af64928922937$export$80039a49055269fb as make_button1, $66c5b496f7887c00$export$af88b4929c2dc86 as make_button2, $d3c54fdf1bfb087a$export$1d17a045bcc711b1 as slider_dots_factory, $d3c54fdf1bfb087a$export$a09282b33e69b43f as navdot, $3ad897e1659ee6d7$export$411b0f20794697ce as slider_draggable_factory, $21afac8db3f98820$export$5129719c04a52f8c as slider_fading_factory, $0cbf24ae3e670238$export$5723caf9a8335aa6 as slider_fractional_factory, $4837ebe61ecec421$export$93223e488e7ee078 as slider_show_scroll, $ff905d87817a07f4$export$b36d2489a5a16728 as slider_snap_css, $ff905d87817a07f4$export$49b950309ab787ad as can_use_snapping_and_still_scroll, $e1af55c2112926b7$export$dac64fd35a4805a4 as slider_snapping_factory, $f340c415f2e1d03a$export$68babfc5be0de5da as Amazing_Lazy_Slider, $c7030fdb9bcc361f$export$53306504b987cbf7 as slider_wraparound_factory, $aadc6d9eeb8e8a56$export$419f84efad7d9fe as sizes_to_surface, $aadc6d9eeb8e8a56$export$417ef0ab13d8b984 as surface_mixer, $aadc6d9eeb8e8a56$export$be95cb0e8cfd099e as promise_until_next_navigation, $f2fce07b3a330e05$export$29a6094e0bd8bc5f as AIO, $f2fce07b3a330e05$export$6ebd242c09192cec as paint_red, $bd7c9f254946941d$export$2c34560c3749dc63 as bind_to_a2c_button, $bd7c9f254946941d$export$82a685f2da2fb027 as bind_tracking_to_link, $d5f7352b58e0d737$export$336e7ad40bae0652 as set_depict_id_fn, $d5f7352b58e0d737$export$8a96793bf9f87d90 as set_user_id_fn, $d5f7352b58e0d737$export$6399bdb2291895e0 as get_depict_id, $d5f7352b58e0d737$export$adc61a405a4cabed as get_user_id, $d5f7352b58e0d737$export$15f8a0cd5a8c0ebb as depict_click, $d5f7352b58e0d737$export$82badda1f9923310 as depict_prefilled, $d5f7352b58e0d737$export$9028351cb994757e as depict_add_to_cart, $d5f7352b58e0d737$export$93ae15b1ae509334 as set_session_id_fn, $d5f7352b58e0d737$export$61e7e1f11e96692f as get_session_id, $d5f7352b58e0d737$export$622991c71a1f52b3 as get_cookie, $d5f7352b58e0d737$export$8c6f26a5b6921b95 as get_tracking_event_context_data, $814c3bf8e175fa59$export$72036d950e1fae95 as filter_depict_payload, $814c3bf8e175fa59$export$28cacbd9b4306ffc as send_depict, $814c3bf8e175fa59$export$cc3b6ddf805f6156 as foolproof_send_beacon, $814c3bf8e175fa59$export$608478473a3304a0 as send_depict_unfiltered, $814c3bf8e175fa59$export$aa26019042811d4f as send_websocket, $799496226e956169$export$674d8cd8b6868154 as create_ga_queue, $799496226e956169$export$edfedd0557ca5a2d as make_tracker_send_to_depict, $ed8073ecbced6e7e$export$1ff14fec60ed5697 as ga_to_transaction_api, $3674b9afc9a63520$export$f75172d2e289cd02 as send_ga, $3674b9afc9a63520$export$ac7296527cb52311 as setup_ga, $3674b9afc9a63520$export$d031e55ccd4c52dc as setup_gtag, $3674b9afc9a63520$export$f522672c9379e339 as gtag_click, $3674b9afc9a63520$export$bf205937e5e012cb as ga_purchase_click, $3674b9afc9a63520$export$127751e82111fcf as ga_rec_click, $3674b9afc9a63520$export$7babcd5d4056b2ca as gtag_view, $3674b9afc9a63520$export$f3354ec2ce95ebd9 as load_gtag, $d6c3e2ba045accda$export$4205dc6835bc0d9f as send_impression_event, $e89a1d249db21af0$export$37125ccc5dd98050 as impression_track_element, $c633189b7b69d048$export$d0efd8ed14f5c33 as impression_tracking_post_processor, $d6c3e2ba045accda$export$c543ee4cdb0d0964 as set_impression_threshold, $d6c3e2ba045accda$export$135da44d0ba958bc as impression_threshold, $d6c3e2ba045accda$export$ca8321ea61dc2544 as has_to_be_intersecting_for, $df87ac5a30f7baac$export$58c56fe2313fdbe3 as add_new_tab_listener, $df87ac5a30f7baac$export$836f70a28c317905 as broadcast_product_id, $df87ac5a30f7baac$export$8f66c4c7fb96eda2 as contextmenu_callback, $d4217f56717a3207$export$7e4427e80d5fc619 as optanon_get_cookie_ipns, $d4217f56717a3207$export$f0f6c846d96fdbec as init_optanon_tracking, $d4217f56717a3207$export$1dd9ce50e201eff1 as optanon_get_consent, $d4217f56717a3207$export$7a6d436e0782c6ed as optanon_wait_for_consent, $f991aad8d6175c9b$export$1ac466d53a6636ac as send_transaction_id_to_depict, $f991aad8d6175c9b$export$b11248fa13a8a86c as datalayer_transaction_id_extractor, $f991aad8d6175c9b$export$3ebd86018b39d9d2 as orderpage_transaction_id_extractor, $f991aad8d6175c9b$export$ff8673d5dea82bd4 as url_transaction_id_extractor, $a9d475787bc4d10e$export$d63b08f4f29ddba5 as send_product_unavailable_to_depict, $0897f35c3b3fbbc4$export$eee4c4d924348b05 as send_page_view_if_needed, $0897f35c3b3fbbc4$export$f7cb1bd47199ec38 as send_page_view_on_navigation, $f5a4b8e233f0e1cd$export$1d9c6fddbff3441f as DepictAPIWS, $429b4383ef3d586f$export$74108888f38788f3 as ListenableSet, $9c44a7238815fa47$export$535946eb77c946dd as deparallelize, $9c44a7238815fa47$export$f241be8e610f5c77 as deparallelize_no_drop, $ab9c3dbf2bb2fbf7$export$f8ea2e7b15b5d129 as buildThresholdList, $85906d121f53bacd$export$d9fdc6ce2907f95b as chaotic_closest, $652300c6621d5500$export$cfef5d5c9ac09253 as standard_price_format, $652300c6621d5500$export$9590700a594aef08 as ensure_object_path, $652300c6621d5500$export$925772df9b4d16e5 as ensure_parameter_in_url, $652300c6621d5500$export$44951404cb8d0583 as html2elems, $652300c6621d5500$export$d3e2a0560cbf4787 as html2elem, $652300c6621d5500$export$5e63aea0cac01fa0 as querySelectorAllElements, $652300c6621d5500$export$785f04709990c4ec as querySelectorUpwards, $652300c6621d5500$export$f124e3ee16e6b45d as intl_number_format_with_fallback, $652300c6621d5500$export$d4bd03f19260ef1c as relativify, $45d268baa2df1ba1$export$6b75200e58bc97d0 as deduplicate, $45d268baa2df1ba1$export$9426572bd5645bc1 as dedup_products, $8183c177c3bdf94d$export$82539d9817116aff as navigate_with_next_router, $f69445e469425bcb$export$774bc87373c4fc6c as add_item, $f69445e469425bcb$export$337197b94b3bd680 as get_items_in_cart, $f69445e469425bcb$export$783ef16647773b3d as get_shopify_analytics_meta_product, $f69445e469425bcb$export$ab0f802c05dd969b as intercept, $201e455525e1fa49$export$85be83e1935d93c2 as fetch_replacer, $201e455525e1fa49$export$f8da66bc4f1d059e as FakeResponse, $c95f8181bad32e8d$export$bcd70d5ed1cf6313 as fetch_retry, $073645eedb3f65a8$export$b404e20f3c4a490e as get_optimize_variant, $ad1dbddac6af350d$export$20e9533e68ee72e7 as stateless_href_change_ipns, $ad1dbddac6af350d$export$a9d39e43ae273d26 as href_change_ipns, $ad1dbddac6af350d$export$baccefee4a395d8f as history_replacer, $ad1dbddac6af350d$export$1cd22bab0d2c3b0b as on_next_navigation, $ad1dbddac6af350d$export$7500cdfd37aafd43 as instant_exec_on_suspect_history_change, $7ca6fdc721083788$export$e806c6c1615a59ae as async_iterable_ipns, $7ca6fdc721083788$export$10c3e52ef388b81b as make_ipns_stateful, $7ca6fdc721083788$export$90740b5bc9c2b3b7 as make_ipns_stateless, $449d6683cecfa078$export$3e42f5078e3abfc0 as make_simple_async_iterable, $449d6683cecfa078$export$e2c811ae0eb35313 as RawObservableInformation, $c1590f86e0eca625$export$2c2f50b30b7b2576 as iterable_to_attribute, $332ef338faf216a4$export$7c081fdbc65b6a2a as iterable_to_elems, $fee212025270d5b9$export$927664b47117acb0 as make_asyncIterable_exiter, $07beada135e5f5e8$export$f8913c8a18f7ca21 as zip_async_iterables, $2c22b027931240e6$export$f811d2ce0aa6019b as insert_surfaces, $2c22b027931240e6$export$b8d1e1d07a3f3776 as prevent_infinite_loop, $2c22b027931240e6$export$e3f70ef7e3d00501 as revertable_remove, $1013f2e568f87406$export$59ba1eb2c083f0cd as insert_styling, $1013f2e568f87406$export$692b606677218a16 as depict_init, $1013f2e568f87406$export$328e81c44cddf3c0 as depict_init_with_market_logic, $1013f2e568f87406$export$a4f97b27a0592e6c as normal_get_product_id, $1013f2e568f87406$export$a96c18473f2af463 as track_a2c, $26dbd7db7fd1bc2c$export$515c3ea4d599b05a as javascript_media_query, $914c6f35222c820d$export$33f937d741e49339 as patched_querySelectorAll, $07ddf7dfff112d01$export$a4eccf92efefa04d as placeholder_svg, $07ddf7dfff112d01$export$2dd69958012e3e49 as make_placeholder_rr, $07ddf7dfff112d01$export$3b75288f46cadd96 as random_text_placeholder, $6c8c963618d41bb2$export$947a20746936143d as Promise_Any, $3a96de5a459d34f9$export$c50e1901e8ed0615 as queueMacroTask, $1cd1e96fe31c935d$export$bb0a9c36cf454ea0 as rand, $6cb4d83127e468ea$export$656831b7e9c341c3 as random_string, $6cb4d83127e468ea$export$a6db784f019668ba as make_random_classname, $2b6304d4ce419ed5$export$3d04c40e7acc1a32 as reactive_template, $243da8b4990520aa$export$8ec5c86406f333ff as removeChild_error_swallowing_factory, $9c0a16930ae6750f$export$38e89c688f9d553a as replace_promise_with_native_if_exists_and_enforce, $9c0a16930ae6750f$export$e647444ed9403635 as get_iframe_promise, $f82333cd2ffc1582$export$2a1cc61cffa1f36f as rp_relativify_fetch, $f82333cd2ffc1582$export$f14a775632a826c4 as rp_relativify_history, $f82333cd2ffc1582$export$2a38b176ce969e2c as rp_relativify_xhr, $f82333cd2ffc1582$export$83ec13b10b391f13 as default_rp_fixes, $d9aec442b12a1134$export$39d526a1194b6499 as serialize_object, $b2c9f99c083a1182$export$12b4c6cbc6b8b4e4 as sort_obj, $95b71532fa7f905c$export$a422d714c8cb1a5d as standard_get_market, $cb3a51d87cbe5eff$export$3427ec8268623f1 as listenToLocalStorage, $095a7d035ba7d7a7$export$8d42ce4827f43582 as Tenant, $26145caeb41f1f7b$export$cd1adfb8059b5fcd as timeout_promise, $2da62df28669a48a$export$79f910a98828378d as variable_setter_to_ipns, $2da62df28669a48a$export$d5062f468a0454f3 as find_descriptor, $2da62df28669a48a$export$2fc1a072736ae2f6 as is_available_in, $8a812fa4638e2832$export$a739d9a07da7f9ce as use_voyado_id, $57642e3bf93ac1e7$export$5c069c93d2b7493f as wait, $24528b2f119d82fb$export$f314addd5f976083 as xhr_load, $24528b2f119d82fb$export$8e16c51fd2b6507 as xhr_read_interceptor, $24528b2f119d82fb$export$c74578d2cd47a84a as xhr_send_interceptor, $24528b2f119d82fb$export$33d1643df63073a8 as xhr_replace, $c40fc6dc2c22b3c4$export$4a3043e508dd72f0 as DefaultViewMoreButton, $a59cde169150d10b$export$8a0e4d6f6abf7e90 as GeneralSideSlidein, $24f3fd73864991c0$export$c068ad5361be7646 as GeneralSizeSelector, $adc0bb548fdb574f$export$84712d0562a614b8 as Placeholder, $adc0bb548fdb574f$export$d613f5b6d0a331a8 as ContainedPlaceholderImage, $2e6ca552eb0e0b2b$export$97f31f44c68c1d5 as RecommendationContainer, $ad0b2591dac160be$export$ddd70fdae1b350e6 as LeftChevron, $ad0b2591dac160be$export$32a55d57d151bc5a as RightChevron, $9a74c17d1ef21fdf$export$590326cc34f49e2d as createColorPicker, $0f55c2bc0a7b363b$export$237455ad7e59d4e5 as useExpandingContainer, $73f0a7e385687d5d$export$2369f6fc1c911576 as ContainedHoverImage, $c987460cedc0d7ec$export$788756b42446dc2d as ContainedImage, $9ef5ce4804a3b61b$export$f39a7d0667e924a as make_sizes_setter, $9ef5ce4804a3b61b$export$a62825542f1bfcf5 as make_sourceset_component, $9ef5ce4804a3b61b$export$a98fc8a2c818d3d8 as is_safari, $9ef5ce4804a3b61b$export$f7c915448031deac as make_url_with_query_params, $9ef5ce4804a3b61b$export$3d13beba9b52c947 as resize_base_url, $9e4bee2e3b4b5753$export$362abebb4b313340 as base_url, $17bb552dedcd526c$export$af2e17a20c2ea3c5 as Sentry, $c07f1f2ffdcaec61$export$9dc8f3a0aa3efc85 as camelCasifyObject, $c07f1f2ffdcaec61$export$b481488de1caa85 as snakeCasifyObject, $40a5a98adc907fe0$export$499ef00a6a3417f8 as rgb_to_hsl, $40a5a98adc907fe0$export$e4fd3b61e79357a7 as hsl_to_rgb, $40a5a98adc907fe0$export$98c2b3491e76c1f as relative_luminance_from_rgb, $40a5a98adc907fe0$export$486b165479b9284f as hsb_to_rgb, $40a5a98adc907fe0$export$ca305c142c6fc3cf as hex_to_rgb, $b9e07ce3c67aa344$export$83d89fbfd8236492 as version, $ea5707b8e7b350cf$export$2cefb7e61fcbae00 as add_to_version_info, $656899961fd22692$export$ef73ea4f975745ba as edit_current_page_meta_tags, $be5f485da4e3f813$export$fce59460a1699957 as cookiebot_get_consent, $be5f485da4e3f813$export$56c2e8be65fb14ae as cookiebot_wait_for_consent, $be5f485da4e3f813$export$8827362e5e938d26 as cookiebot_get_cookie_ipns, $be5f485da4e3f813$export$abec7fd9f0b9cc22 as init_cookiebot_tracking };
|