@depict-ai/utilishared 1.0.35 → 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 +716 -717
- package/ES10/index.d.ts +1 -1
- package/ES10/index.js +716 -717
- package/latest/index.cjs +588 -588
- package/latest/index.d.ts +1 -1
- package/latest/index.js +588 -588
- package/package.json +2 -2
package/ES10/index.cjs
CHANGED
|
@@ -275,7 +275,7 @@ $parcel$export(module.exports, "hex_to_rgb", () => $b5388c1e3ff41e88$export$ca30
|
|
|
275
275
|
$parcel$export(module.exports, "version", () => $ce0ab19b284b64fa$export$83d89fbfd8236492);
|
|
276
276
|
$parcel$export(module.exports, "add_to_version_info", () => $045fb30107c9eecc$export$2cefb7e61fcbae00);
|
|
277
277
|
$parcel$export(module.exports, "edit_current_page_meta_tags", () => $0126fdc29a9f7f2d$export$ef73ea4f975745ba);
|
|
278
|
-
const $ce0ab19b284b64fa$export$83d89fbfd8236492 = "1.0.
|
|
278
|
+
const $ce0ab19b284b64fa$export$83d89fbfd8236492 = "1.0.36";
|
|
279
279
|
const $9e9538f4aff6f83c$export$55fe61489d2c7417 = /*@__PURE__*/((_globalThis$document, _globalThis$document$, _globalThis$document$2, _globalThis$localStor, _globalThis$localStor2) => process.env.STRIP_DEBUG === "true" ? false : process.env.DEBUG === "true" || process.env.NODE_ENV === "development" || process.env.BUILD_TARGET !== "node" && ((globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : (_globalThis$document$ = _globalThis$document.currentScript) === null || _globalThis$document$ === void 0 ? void 0 : (_globalThis$document$2 = _globalThis$document$.dataset) === null || _globalThis$document$2 === void 0 ? void 0 : _globalThis$document$2.debug) === "true" || (globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$localStor = globalThis.localStorage) === null || _globalThis$localStor === void 0 ? void 0 : (_globalThis$localStor2 = _globalThis$localStor.getItem) === null || _globalThis$localStor2 === void 0 ? void 0 : _globalThis$localStor2.call(_globalThis$localStor, "debug")) === "true"))();
|
|
280
280
|
const $7f95f77417d06249$var$browser_prefix_styling = "color: #fff;";
|
|
281
281
|
let $7f95f77417d06249$var$browser_prefix = "[Depict]";
|
|
@@ -305,7 +305,7 @@ function $7f95f77417d06249$export$997143d41f6a0c9b() {
|
|
|
305
305
|
}
|
|
306
306
|
const $045fb30107c9eecc$export$60d1d0e3cfc8b9ed = {};
|
|
307
307
|
function $045fb30107c9eecc$export$2cefb7e61fcbae00(package_name, version) {
|
|
308
|
-
|
|
308
|
+
$7f95f77417d06249$export$de56f1198d121036("@depict-ai/" + package_name + " version", version);
|
|
309
309
|
$045fb30107c9eecc$export$60d1d0e3cfc8b9ed[package_name] = version;
|
|
310
310
|
}
|
|
311
311
|
function $045fb30107c9eecc$export$fe609f0216e4ebef(url) {
|
|
@@ -331,15 +331,15 @@ function $6a427682b105a299$export$a7e53ec3b3fdd030(str) {
|
|
|
331
331
|
}
|
|
332
332
|
class $1bf4c150117205e7$export$e2c811ae0eb35313 {
|
|
333
333
|
constructor() {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
334
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersdefineProperty)(this, "subscribers_", []);
|
|
335
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersdefineProperty)(this, "waiting_for_update_", 0);
|
|
336
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersdefineProperty)(this, "queue_", []);
|
|
337
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersdefineProperty)(this, "has_had_value_", false);
|
|
338
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersdefineProperty)(this, "push_value_", value => {
|
|
339
339
|
this.queue_.push(value);
|
|
340
340
|
this.call_subscribers_();
|
|
341
341
|
});
|
|
342
|
-
|
|
342
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersdefineProperty)(this, "call_subscribers_", () => {
|
|
343
343
|
// intentionally arrow fn so it doesn't matter what .this is when being called
|
|
344
344
|
if (this.waiting_for_update_ <= 0 && this.queue_.length) {
|
|
345
345
|
// shift value
|
|
@@ -352,7 +352,7 @@ class $1bf4c150117205e7$export$e2c811ae0eb35313 {
|
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
354
|
});
|
|
355
|
-
|
|
355
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersdefineProperty)(this, "subscriber_done_", () => {
|
|
356
356
|
this.waiting_for_update_--;
|
|
357
357
|
this.call_subscribers_();
|
|
358
358
|
});
|
|
@@ -460,8 +460,8 @@ function $76a59c6ce18c8fd3$export$e806c6c1615a59ae() {
|
|
|
460
460
|
let state_obj = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new (0, $1bf4c150117205e7$export$e2c811ae0eb35313)();
|
|
461
461
|
// @ts-ignore
|
|
462
462
|
$76a59c6ce18c8fd3$var$on_async_iterator_next_called({}); // work around https://github.com/swc-project/swc/issues/5530
|
|
463
|
-
const ai =
|
|
464
|
-
const [exit, exitable] =
|
|
463
|
+
const ai = $1bf4c150117205e7$export$3e42f5078e3abfc0(state_obj);
|
|
464
|
+
const [exit, exitable] = $c0c977a0f691adf3$export$927664b47117acb0({
|
|
465
465
|
...ai
|
|
466
466
|
});
|
|
467
467
|
const obj = Object.assign(exitable, {
|
|
@@ -498,7 +498,7 @@ function $76a59c6ce18c8fd3$export$e806c6c1615a59ae() {
|
|
|
498
498
|
yield* $76a59c6ce18c8fd3$var$on_async_iterator_next_called(exitable_for_async_generator, unblock_state_obj, fn => stock_return_function = fn);
|
|
499
499
|
};
|
|
500
500
|
const iterator = async_generator();
|
|
501
|
-
const [exit_async_generator, exitable_for_async_generator] =
|
|
501
|
+
const [exit_async_generator, exitable_for_async_generator] = $c0c977a0f691adf3$export$927664b47117acb0(orig_iterator);
|
|
502
502
|
// 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
|
|
503
503
|
// 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)
|
|
504
504
|
iterator.return = () => {
|
|
@@ -516,11 +516,11 @@ function $76a59c6ce18c8fd3$export$e806c6c1615a59ae() {
|
|
|
516
516
|
};
|
|
517
517
|
}
|
|
518
518
|
const callable_obj_with_everything = Object.assign(ai, obj);
|
|
519
|
-
|
|
519
|
+
$0acacd60499b60a9$export$8df876135bad6d96(callable_obj_with_everything, "state", {
|
|
520
520
|
get: () => state_obj.last_processed_value_,
|
|
521
521
|
enumerable: true
|
|
522
522
|
});
|
|
523
|
-
|
|
523
|
+
$0acacd60499b60a9$export$8df876135bad6d96(callable_obj_with_everything, "latest_call_value", {
|
|
524
524
|
get: () => {
|
|
525
525
|
var _state_obj$queue_;
|
|
526
526
|
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;
|
|
@@ -571,7 +571,7 @@ function $76a59c6ce18c8fd3$export$10c3e52ef388b81b(ipns) {
|
|
|
571
571
|
return $76a59c6ce18c8fd3$export$e806c6c1615a59ae(true, internal_state_obj);
|
|
572
572
|
}
|
|
573
573
|
function $46b94b232dc792af$export$8048b892d651b310(exception, error_for_stack) {
|
|
574
|
-
|
|
574
|
+
$7f95f77417d06249$export$de56f1198d121036(exception);
|
|
575
575
|
if (0, $9e9538f4aff6f83c$export$55fe61489d2c7417) /* eslint-disable no-console */console.trace();
|
|
576
576
|
if (process.env.BUILD_TARGET !== "node") {
|
|
577
577
|
const {
|
|
@@ -595,7 +595,7 @@ async function $6bf620c74776aef6$export$2fc1a072736ae2f6(obj, property) {
|
|
|
595
595
|
}
|
|
596
596
|
async function $6bf620c74776aef6$var$wait_for_variable_in_object(variable, obj) {
|
|
597
597
|
const start = new Date().getTime();
|
|
598
|
-
|
|
598
|
+
$7f95f77417d06249$export$de56f1198d121036("waiting for definition of variable", variable, "in", obj);
|
|
599
599
|
let var_behind_the_scenes;
|
|
600
600
|
let resolve_variable_definition;
|
|
601
601
|
let was_defined = false;
|
|
@@ -623,9 +623,9 @@ async function $6bf620c74776aef6$var$wait_for_variable_in_object(variable, obj)
|
|
|
623
623
|
get: get,
|
|
624
624
|
set: set
|
|
625
625
|
});
|
|
626
|
-
|
|
626
|
+
$7f95f77417d06249$export$de56f1198d121036("everything's set up, waiting for promise by setter to resolve");
|
|
627
627
|
const result = await definition_of_var;
|
|
628
|
-
|
|
628
|
+
$7f95f77417d06249$export$de56f1198d121036("Promise resolved, ", result, " is here. We waited", new Date().getTime() - start, "ms");
|
|
629
629
|
return result;
|
|
630
630
|
}
|
|
631
631
|
function $6bf620c74776aef6$export$d5062f468a0454f3(obj, prop) {
|
|
@@ -633,7 +633,7 @@ function $6bf620c74776aef6$export$d5062f468a0454f3(obj, prop) {
|
|
|
633
633
|
if (obj != null) return Object.hasOwnProperty.call(obj, prop) ? Object.getOwnPropertyDescriptor(obj, prop) : $6bf620c74776aef6$export$d5062f468a0454f3(Object.getPrototypeOf(obj), prop);
|
|
634
634
|
}
|
|
635
635
|
function $6bf620c74776aef6$export$79f910a98828378d(obj, variable, async_iterator_should_return_state_on_first_call) {
|
|
636
|
-
const definition_ipns =
|
|
636
|
+
const definition_ipns = $76a59c6ce18c8fd3$export$e806c6c1615a59ae(async_iterator_should_return_state_on_first_call);
|
|
637
637
|
let var_behind_the_scenes = obj[variable];
|
|
638
638
|
definition_ipns(var_behind_the_scenes); // resolve with initial value
|
|
639
639
|
const previous_descriptor = $6bf620c74776aef6$export$d5062f468a0454f3(obj, variable);
|
|
@@ -768,7 +768,7 @@ async function $6c406c863286f6e9$var$load_sentry(TENANT) {
|
|
|
768
768
|
BrowserClient: BrowserClient,
|
|
769
769
|
Hub: Hub,
|
|
770
770
|
defaultIntegrations: defaultIntegrations
|
|
771
|
-
} = await
|
|
771
|
+
} = await $6bf620c74776aef6$export$2fc1a072736ae2f6(window, global_var_name);
|
|
772
772
|
delete window[global_var_name];
|
|
773
773
|
if (process.env.SENTRY_SAMPLE_RATE) {
|
|
774
774
|
var _more_options$sampleR;
|
|
@@ -791,7 +791,7 @@ async function $6c406c863286f6e9$var$load_sentry(TENANT) {
|
|
|
791
791
|
// https://github.com/getsentry/sentry-javascript/issues/2541
|
|
792
792
|
return hub;
|
|
793
793
|
}
|
|
794
|
-
const $902c0e005afb7319$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, $9e9538f4aff6f83c$export$55fe61489d2c7417)) ? /*@__PURE__*/$902c0e005afb7319$var$fakesentry() : /*@__PURE__
|
|
794
|
+
const $902c0e005afb7319$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, $9e9538f4aff6f83c$export$55fe61489d2c7417)) ? /*@__PURE__*/$902c0e005afb7319$var$fakesentry() : /*@__PURE__*/$6c406c863286f6e9$export$2e2bcd8739ae039(process.env.TENANT || "unknown", undefined, (0, $7f95f77417d06249$export$de56f1198d121036));
|
|
795
795
|
function $902c0e005afb7319$var$fakesentry() {
|
|
796
796
|
// // source: https://docs.sentry.io/platforms/javascript/troubleshooting/#dealing-with-ad-blockers
|
|
797
797
|
// const handler = {
|
|
@@ -861,13 +861,13 @@ function $c0c9a890763623b3$export$bb0a9c36cf454ea0(min, max) {
|
|
|
861
861
|
function $9cefb304a1734a6b$export$535946eb77c946dd(the_function) {
|
|
862
862
|
let busy = false;
|
|
863
863
|
let current_promise;
|
|
864
|
-
return
|
|
864
|
+
return $3b52ccc10510b32a$export$b3bbfd758f11cfa9(async function () {
|
|
865
865
|
// Double awaits to make sure that if busy is true, it must also be true two ticks later.
|
|
866
866
|
// This is a fix for when a promise that finalizes immediately is passed.
|
|
867
867
|
// For context: https://javascript.info/microtask-queue
|
|
868
868
|
if (!busy || !(await await busy, busy)) {
|
|
869
869
|
busy = true;
|
|
870
|
-
const to_finally =
|
|
870
|
+
const to_finally = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(the_function)(...arguments);
|
|
871
871
|
current_promise = to_finally.finally(() => busy = false);
|
|
872
872
|
}
|
|
873
873
|
return current_promise;
|
|
@@ -877,14 +877,14 @@ function $9cefb304a1734a6b$export$f241be8e610f5c77(the_function) {
|
|
|
877
877
|
let busy = false;
|
|
878
878
|
let queued;
|
|
879
879
|
let current_promise;
|
|
880
|
-
const wrapped_fn =
|
|
880
|
+
const wrapped_fn = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(async function () {
|
|
881
881
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
|
|
882
882
|
// Double awaits to make sure that if busy is true, it must also be true two ticks later.
|
|
883
883
|
// This is a fix for when a promise that finalizes immediately is passed.
|
|
884
884
|
// For context: https://javascript.info/microtask-queue
|
|
885
885
|
if (!busy || !(await await busy, busy)) {
|
|
886
886
|
busy = true;
|
|
887
|
-
const to_finally =
|
|
887
|
+
const to_finally = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(the_function)(...args);
|
|
888
888
|
current_promise = to_finally.finally(() => {
|
|
889
889
|
busy = false;
|
|
890
890
|
if (queued) {
|
|
@@ -936,24 +936,24 @@ class $f3ec1bb29cf43251$export$32ccf3a614c84258 {
|
|
|
936
936
|
writable: true,
|
|
937
937
|
value: Promise.resolve()
|
|
938
938
|
});
|
|
939
|
-
|
|
939
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersdefineProperty)(this, "promise", new Promise(r => $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldSet)(this, $f3ec1bb29cf43251$var$_internal_resolve, r)));
|
|
940
940
|
$f3ec1bb29cf43251$var$_classPrivateFieldInitSpec(this, $f3ec1bb29cf43251$var$_work_queue_max_once, {
|
|
941
941
|
writable: true,
|
|
942
|
-
value:
|
|
942
|
+
value: $9cefb304a1734a6b$export$535946eb77c946dd($f3ec1bb29cf43251$var$_classPrivateMethodGet(this, $f3ec1bb29cf43251$var$_work_queue, $f3ec1bb29cf43251$var$_work_queue2).bind(this))
|
|
943
943
|
});
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
944
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersdefineProperty)(this, "resolve", value => {
|
|
945
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $f3ec1bb29cf43251$var$_values_to_resolve_with).push(value);
|
|
946
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $f3ec1bb29cf43251$var$_work_queue_max_once).call(this);
|
|
947
947
|
});
|
|
948
948
|
}
|
|
949
949
|
}
|
|
950
950
|
async function $f3ec1bb29cf43251$var$_work_queue2() {
|
|
951
|
-
const vtrw =
|
|
951
|
+
const vtrw = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $f3ec1bb29cf43251$var$_values_to_resolve_with);
|
|
952
952
|
for (let i = 0; i < vtrw.length; i++) {
|
|
953
|
-
await
|
|
954
|
-
const oldresolve =
|
|
955
|
-
|
|
956
|
-
this.promise = new Promise(r =>
|
|
953
|
+
await $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $f3ec1bb29cf43251$var$_previous_promise);
|
|
954
|
+
const oldresolve = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $f3ec1bb29cf43251$var$_internal_resolve);
|
|
955
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldSet)(this, $f3ec1bb29cf43251$var$_previous_promise, this.promise);
|
|
956
|
+
this.promise = new Promise(r => $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldSet)(this, $f3ec1bb29cf43251$var$_internal_resolve, r));
|
|
957
957
|
oldresolve(vtrw[i]);
|
|
958
958
|
}
|
|
959
959
|
while (vtrw.length) vtrw.pop();
|
|
@@ -989,10 +989,10 @@ class $bd0a305620de4c2a$export$1b28bc5c68cc4d77 extends EventTarget {
|
|
|
989
989
|
// WHEN MAKING CHANGES, PLEASE KEEP IN MIND THAT THIS CLASS IS ALSO USED ON THE FRONTEND
|
|
990
990
|
increase_fails() {
|
|
991
991
|
var _this$fails, _this$fails2;
|
|
992
|
-
|
|
993
|
-
if (
|
|
992
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldSet)(this, $bd0a305620de4c2a$var$_fails, (_this$fails = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bd0a305620de4c2a$var$_fails), _this$fails2 = _this$fails++, _this$fails)), _this$fails2;
|
|
993
|
+
if ($parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bd0a305620de4c2a$var$_fails) > $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bd0a305620de4c2a$var$_max_fails)) {
|
|
994
994
|
this.restart_ws();
|
|
995
|
-
|
|
995
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldSet)(this, $bd0a305620de4c2a$var$_fails, 0);
|
|
996
996
|
}
|
|
997
997
|
}
|
|
998
998
|
async send() {
|
|
@@ -1022,7 +1022,7 @@ class $bd0a305620de4c2a$export$1b28bc5c68cc4d77 extends EventTarget {
|
|
|
1022
1022
|
});
|
|
1023
1023
|
$bd0a305620de4c2a$var$_classPrivateFieldInitSpec(this, $bd0a305620de4c2a$var$_try_again_in_ms, {
|
|
1024
1024
|
writable: true,
|
|
1025
|
-
value:
|
|
1025
|
+
value: $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bd0a305620de4c2a$var$_initial_reconnect_delay)
|
|
1026
1026
|
});
|
|
1027
1027
|
$bd0a305620de4c2a$var$_classPrivateFieldInitSpec(this, $bd0a305620de4c2a$var$_fails, {
|
|
1028
1028
|
writable: true,
|
|
@@ -1036,32 +1036,32 @@ class $bd0a305620de4c2a$export$1b28bc5c68cc4d77 extends EventTarget {
|
|
|
1036
1036
|
writable: true,
|
|
1037
1037
|
value: $bd0a305620de4c2a$var$ONE_MINUTE
|
|
1038
1038
|
});
|
|
1039
|
-
|
|
1039
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldSet)(this, $bd0a305620de4c2a$var$_ws_constructor_options, [url, protocols]);
|
|
1040
1040
|
const {
|
|
1041
1041
|
max_backoff_ms: max_backoff_ms
|
|
1042
1042
|
} = options;
|
|
1043
|
-
if (max_backoff_ms)
|
|
1043
|
+
if (max_backoff_ms) $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldSet)(this, $bd0a305620de4c2a$var$_max_backoff_ms, max_backoff_ms);
|
|
1044
1044
|
$bd0a305620de4c2a$var$_classPrivateMethodGet(this, $bd0a305620de4c2a$var$_setup_dot_on_event_support, $bd0a305620de4c2a$var$_setup_dot_on_event_support2).call(this);
|
|
1045
1045
|
$bd0a305620de4c2a$var$_classPrivateMethodGet(this, $bd0a305620de4c2a$var$_connect, $bd0a305620de4c2a$var$_connect2).call(this);
|
|
1046
|
-
$bd0a305620de4c2a$var$_classPrivateMethodGet(this, $bd0a305620de4c2a$var$_ensure_connection, $bd0a305620de4c2a$var$_ensure_connection2).call(this).catch(e =>
|
|
1047
|
-
this.addEventListener("open",
|
|
1048
|
-
|
|
1049
|
-
|
|
1046
|
+
$bd0a305620de4c2a$var$_classPrivateMethodGet(this, $bd0a305620de4c2a$var$_ensure_connection, $bd0a305620de4c2a$var$_ensure_connection2).call(this).catch(e => $3b52ccc10510b32a$export$f18d5b0af29128b7(e, "error"));
|
|
1047
|
+
this.addEventListener("open", $3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => {
|
|
1048
|
+
$7f95f77417d06249$export$de56f1198d121036("Connection opened");
|
|
1049
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldSet)(this, $bd0a305620de4c2a$var$_try_again_in_ms, $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bd0a305620de4c2a$var$_initial_reconnect_delay)); // reset exponential backoff
|
|
1050
1050
|
}));
|
|
1051
1051
|
}
|
|
1052
1052
|
}
|
|
1053
1053
|
|
|
1054
1054
|
function $bd0a305620de4c2a$var$_get_initial_reconnect_delay() {
|
|
1055
|
-
return
|
|
1055
|
+
return $c0c9a890763623b3$export$bb0a9c36cf454ea0(1, 1000);
|
|
1056
1056
|
}
|
|
1057
1057
|
function $bd0a305620de4c2a$var$_connect2() {
|
|
1058
|
-
this.current_socket = typeof window === "object" || typeof WebSocket === "function" ? new WebSocket(
|
|
1058
|
+
this.current_socket = typeof window === "object" || typeof WebSocket === "function" ? new WebSocket(...$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bd0a305620de4c2a$var$_ws_constructor_options)) : {
|
|
1059
1059
|
readyState: 0,
|
|
1060
1060
|
addEventListener: () => {},
|
|
1061
1061
|
send: () => {}
|
|
1062
1062
|
};
|
|
1063
|
-
|
|
1064
|
-
this.current_socket.addEventListener(name,
|
|
1063
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bd0a305620de4c2a$var$_possible_events).forEach(name => {
|
|
1064
|
+
this.current_socket.addEventListener(name, $3b52ccc10510b32a$export$b3bbfd758f11cfa9(original_event => {
|
|
1065
1065
|
let fixed_event;
|
|
1066
1066
|
if (!(original_event instanceof Event)) {
|
|
1067
1067
|
var _fixed_event;
|
|
@@ -1095,17 +1095,17 @@ function $bd0a305620de4c2a$var$_setup_dot_on_event_support2() {
|
|
|
1095
1095
|
// the idea is to make AutoReconnectingWS usable just like a normal WebSocket
|
|
1096
1096
|
// 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
|
|
1097
1097
|
// this is how we add .onmessage, .onclose, .onopen and .onerror support to our EventTarget (this class)
|
|
1098
|
-
for (const ev of
|
|
1098
|
+
for (const ev of $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bd0a305620de4c2a$var$_possible_events)) {
|
|
1099
1099
|
Object.defineProperty(this, "on" + ev, {
|
|
1100
1100
|
configurable: false,
|
|
1101
1101
|
enumerable: true,
|
|
1102
|
-
get: () =>
|
|
1103
|
-
set: v =>
|
|
1102
|
+
get: () => $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bd0a305620de4c2a$var$_ons)[ev],
|
|
1103
|
+
set: v => $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bd0a305620de4c2a$var$_ons)[ev] = v
|
|
1104
1104
|
});
|
|
1105
1105
|
this.addEventListener(ev, e => {
|
|
1106
1106
|
// e can be MessageEvent | CloseEvent | ErrorEvent I think
|
|
1107
|
-
const on_fn =
|
|
1108
|
-
if (typeof on_fn === "function")
|
|
1107
|
+
const on_fn = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bd0a305620de4c2a$var$_ons)[ev];
|
|
1108
|
+
if (typeof on_fn === "function") $3b52ccc10510b32a$export$b3bbfd758f11cfa9(on_fn).call(ev, e);
|
|
1109
1109
|
});
|
|
1110
1110
|
}
|
|
1111
1111
|
}
|
|
@@ -1121,26 +1121,26 @@ async function $bd0a305620de4c2a$var$_ensure_connection2() {
|
|
|
1121
1121
|
// 4100 means server thinks this is a scraper bot that's ignoring robots.txt
|
|
1122
1122
|
// @ts-ignore
|
|
1123
1123
|
if ((error === null || error === void 0 ? void 0 : error.code) === 4100) {
|
|
1124
|
-
|
|
1124
|
+
$7f95f77417d06249$export$de56f1198d121036("Websocket connection rejected by server, won't reconnect", error);
|
|
1125
1125
|
return;
|
|
1126
1126
|
}
|
|
1127
|
-
|
|
1127
|
+
$7f95f77417d06249$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", $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bd0a305620de4c2a$var$_try_again_in_ms));
|
|
1128
1128
|
await new Promise(r => {
|
|
1129
1129
|
// "race" the timeout and getting an https://developer.mozilla.org/en-US/docs/Web/API/Window/online_event by the browser
|
|
1130
|
-
const handler =
|
|
1130
|
+
const handler = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(ev => {
|
|
1131
1131
|
r();
|
|
1132
|
-
|
|
1132
|
+
$7f95f77417d06249$export$de56f1198d121036("Retrying due to 'online' event", ev);
|
|
1133
1133
|
clearTimeout(timeout);
|
|
1134
1134
|
});
|
|
1135
1135
|
window.addEventListener("online", handler, {
|
|
1136
1136
|
once: true
|
|
1137
1137
|
});
|
|
1138
|
-
const timeout = setTimeout(
|
|
1139
|
-
|
|
1140
|
-
if (
|
|
1138
|
+
const timeout = setTimeout($3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => {
|
|
1139
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldSet)(this, $bd0a305620de4c2a$var$_try_again_in_ms, $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bd0a305620de4c2a$var$_try_again_in_ms) * (1.5 + Math.random()));
|
|
1140
|
+
if ($parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bd0a305620de4c2a$var$_try_again_in_ms) > $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bd0a305620de4c2a$var$_max_backoff_ms)) $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldSet)(this, $bd0a305620de4c2a$var$_try_again_in_ms, $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bd0a305620de4c2a$var$_max_backoff_ms) * (1 + Math.random() / 10));
|
|
1141
1141
|
r();
|
|
1142
1142
|
window.removeEventListener("online", handler);
|
|
1143
|
-
}),
|
|
1143
|
+
}), $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bd0a305620de4c2a$var$_try_again_in_ms));
|
|
1144
1144
|
});
|
|
1145
1145
|
$bd0a305620de4c2a$var$_classPrivateMethodGet(this, $bd0a305620de4c2a$var$_connect, $bd0a305620de4c2a$var$_connect2).call(this);
|
|
1146
1146
|
}
|
|
@@ -1161,14 +1161,14 @@ class $bd0a305620de4c2a$export$1d9c6fddbff3441f extends $bd0a305620de4c2a$export
|
|
|
1161
1161
|
while (true) {
|
|
1162
1162
|
const {
|
|
1163
1163
|
data: data
|
|
1164
|
-
} = await
|
|
1164
|
+
} = await $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bd0a305620de4c2a$var$_msg_ipns).promise;
|
|
1165
1165
|
let reply;
|
|
1166
1166
|
try {
|
|
1167
1167
|
reply = JSON.parse(data);
|
|
1168
1168
|
} catch (e) {
|
|
1169
1169
|
const msg = "Got malformed message (ignoring, might cause memory leak)";
|
|
1170
|
-
|
|
1171
|
-
|
|
1170
|
+
$7f95f77417d06249$export$de56f1198d121036(msg, data, e);
|
|
1171
|
+
$3b52ccc10510b32a$export$f18d5b0af29128b7([e, msg], "error", {
|
|
1172
1172
|
data: data
|
|
1173
1173
|
});
|
|
1174
1174
|
continue;
|
|
@@ -1180,12 +1180,12 @@ class $bd0a305620de4c2a$export$1d9c6fddbff3441f extends $bd0a305620de4c2a$export
|
|
|
1180
1180
|
if (status == "ack") {
|
|
1181
1181
|
stop_sending();
|
|
1182
1182
|
continue;
|
|
1183
|
-
} else if (status == "not-ok")
|
|
1183
|
+
} else if (status == "not-ok") $7f95f77417d06249$export$c2363754d4758444("Got reply not-ok reply from server for event!", payload, reply);else if (status == "ok") {
|
|
1184
1184
|
if (process.env.BUILD_TARGET !== "node") {
|
|
1185
1185
|
var _payload$event;
|
|
1186
|
-
|
|
1186
|
+
$7f95f77417d06249$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);
|
|
1187
1187
|
}
|
|
1188
|
-
} else
|
|
1188
|
+
} else $7f95f77417d06249$export$c2363754d4758444("Strange reply from WSS server to", payload, ":", reply);
|
|
1189
1189
|
stop_sending();
|
|
1190
1190
|
return [reply, data];
|
|
1191
1191
|
}
|
|
@@ -1218,22 +1218,22 @@ class $bd0a305620de4c2a$export$1d9c6fddbff3441f extends $bd0a305620de4c2a$export
|
|
|
1218
1218
|
});
|
|
1219
1219
|
$bd0a305620de4c2a$var$_classPrivateFieldInitSpec(this, $bd0a305620de4c2a$var$_start_reconnection_if_offline_process, {
|
|
1220
1220
|
writable: true,
|
|
1221
|
-
value:
|
|
1222
|
-
await new Promise(r => setTimeout(r,
|
|
1221
|
+
value: $9cefb304a1734a6b$export$535946eb77c946dd(async () => {
|
|
1222
|
+
await new Promise(r => setTimeout(r, $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bd0a305620de4c2a$var$_reconnect_if_dead_for_ms) + $c0c9a890763623b3$export$bb0a9c36cf454ea0(-2, 10)));
|
|
1223
1223
|
// 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
|
|
1224
|
-
if (
|
|
1224
|
+
if ($parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bd0a305620de4c2a$var$_messages_queued) === 0) return;
|
|
1225
1225
|
const now = +new Date();
|
|
1226
|
-
if (now -
|
|
1227
|
-
const reason = "No activity in ".concat(
|
|
1228
|
-
|
|
1226
|
+
if (now - $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bd0a305620de4c2a$var$_connection_last_active) > $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bd0a305620de4c2a$var$_reconnect_if_dead_for_ms)) {
|
|
1227
|
+
const reason = "No activity in ".concat($parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bd0a305620de4c2a$var$_reconnect_if_dead_for_ms), " ms");
|
|
1228
|
+
$7f95f77417d06249$export$de56f1198d121036(reason, "reconnecting ws");
|
|
1229
1229
|
this.restart_ws(reason);
|
|
1230
1230
|
}
|
|
1231
1231
|
})
|
|
1232
1232
|
});
|
|
1233
1233
|
const option_retry_ms = (_ref = arguments.length <= 2 ? undefined : arguments[2]) === null || _ref === void 0 ? void 0 : _ref.initial_retry_ms;
|
|
1234
|
-
if (option_retry_ms)
|
|
1235
|
-
this.addEventListener("message",
|
|
1236
|
-
["open", "error", "message"].forEach(event => this.addEventListener(event,
|
|
1234
|
+
if (option_retry_ms) $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldSet)(this, $bd0a305620de4c2a$var$_initial_retry_ms, option_retry_ms);
|
|
1235
|
+
this.addEventListener("message", $3b52ccc10510b32a$export$b3bbfd758f11cfa9($parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bd0a305620de4c2a$var$_msg_ipns).resolve));
|
|
1236
|
+
["open", "error", "message"].forEach(event => this.addEventListener(event, $3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldSet)(this, $bd0a305620de4c2a$var$_connection_last_active, +new Date()))));
|
|
1237
1237
|
}
|
|
1238
1238
|
}
|
|
1239
1239
|
async function $bd0a305620de4c2a$var$_wait_for_open_and_send2(msg) {
|
|
@@ -1246,12 +1246,12 @@ async function $bd0a305620de4c2a$var$_wait_for_open_and_send2(msg) {
|
|
|
1246
1246
|
}
|
|
1247
1247
|
function $bd0a305620de4c2a$var$_periodic_send2(msg) {
|
|
1248
1248
|
var _this$messages_queued, _this$messages_queued2;
|
|
1249
|
-
let delay_to_next_send =
|
|
1249
|
+
let delay_to_next_send = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bd0a305620de4c2a$var$_initial_retry_ms);
|
|
1250
1250
|
let quit = false;
|
|
1251
|
-
|
|
1251
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldSet)(this, $bd0a305620de4c2a$var$_messages_queued, (_this$messages_queued = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bd0a305620de4c2a$var$_messages_queued), _this$messages_queued2 = _this$messages_queued++, _this$messages_queued)), _this$messages_queued2;
|
|
1252
1252
|
(async (_this$messages_queued3, _this$messages_queued4) => {
|
|
1253
1253
|
while (!quit) {
|
|
1254
|
-
|
|
1254
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bd0a305620de4c2a$var$_start_reconnection_if_offline_process).call(this);
|
|
1255
1255
|
await $bd0a305620de4c2a$var$_classPrivateMethodGet(this, $bd0a305620de4c2a$var$_wait_for_open_and_send, $bd0a305620de4c2a$var$_wait_for_open_and_send2).call(this, msg);
|
|
1256
1256
|
const waited = await new Promise(r => {
|
|
1257
1257
|
const handler = () => {
|
|
@@ -1261,7 +1261,7 @@ function $bd0a305620de4c2a$var$_periodic_send2(msg) {
|
|
|
1261
1261
|
// wait the correct delay
|
|
1262
1262
|
const resend_due_to_lost_message_timeout = setTimeout(
|
|
1263
1263
|
// this might actually never be needed and be from when Daniel didn't understand WebSockets as well
|
|
1264
|
-
|
|
1264
|
+
$3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => {
|
|
1265
1265
|
r(true);
|
|
1266
1266
|
this.removeEventListener("open", handler);
|
|
1267
1267
|
}), delay_to_next_send);
|
|
@@ -1278,8 +1278,8 @@ function $bd0a305620de4c2a$var$_periodic_send2(msg) {
|
|
|
1278
1278
|
// this is not a proven theory and might be wrong
|
|
1279
1279
|
this.increase_fails();
|
|
1280
1280
|
}
|
|
1281
|
-
|
|
1282
|
-
})().catch(e =>
|
|
1281
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldSet)(this, $bd0a305620de4c2a$var$_messages_queued, (_this$messages_queued3 = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bd0a305620de4c2a$var$_messages_queued), _this$messages_queued4 = _this$messages_queued3--, _this$messages_queued3)), _this$messages_queued4;
|
|
1282
|
+
})().catch(e => $3b52ccc10510b32a$export$f18d5b0af29128b7(e, "error"));
|
|
1283
1283
|
return () => quit = true;
|
|
1284
1284
|
}
|
|
1285
1285
|
|
|
@@ -1307,18 +1307,18 @@ const $49880c4ce4bb7db2$export$72036d950e1fae95 = /*@__PURE__*/$49880c4ce4bb7db2
|
|
|
1307
1307
|
const $49880c4ce4bb7db2$export$aa26019042811d4f = /*@__PURE__*/$49880c4ce4bb7db2$var$c(async bodies => {
|
|
1308
1308
|
if (process.env.DEPICT === "false") return;
|
|
1309
1309
|
for (let i = 0; i < bodies.length; i++) {
|
|
1310
|
-
const id =
|
|
1310
|
+
const id = $a13f25507f352177$export$656831b7e9c341c3();
|
|
1311
1311
|
$49880c4ce4bb7db2$var$ws_instance === null || $49880c4ce4bb7db2$var$ws_instance === void 0 || $49880c4ce4bb7db2$var$ws_instance.ensure_sent({
|
|
1312
1312
|
id: id,
|
|
1313
1313
|
event: bodies[i]
|
|
1314
|
-
}).catch(e =>
|
|
1314
|
+
}).catch(e => $3b52ccc10510b32a$export$f18d5b0af29128b7(e, "error"));
|
|
1315
1315
|
}
|
|
1316
1316
|
});
|
|
1317
1317
|
const $49880c4ce4bb7db2$export$608478473a3304a0 = /*@__PURE__*/$49880c4ce4bb7db2$var$c(function (payload) {
|
|
1318
1318
|
let use_ws = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
1319
1319
|
if (process.env.DEPICT === "false") return;
|
|
1320
1320
|
if (use_ws && typeof WebSocket == "function" && typeof ($49880c4ce4bb7db2$var$ws_instance === null || $49880c4ce4bb7db2$var$ws_instance === void 0 ? void 0 : $49880c4ce4bb7db2$var$ws_instance.ensure_sent) == "function") {
|
|
1321
|
-
|
|
1321
|
+
$7f95f77417d06249$export$de56f1198d121036("Sending to depict (ws)", payload);
|
|
1322
1322
|
return $49880c4ce4bb7db2$export$aa26019042811d4f(payload);
|
|
1323
1323
|
}
|
|
1324
1324
|
const url = (0, $62869a3ed703f236$export$362abebb4b313340) + "/create-events";
|
|
@@ -1327,19 +1327,19 @@ const $49880c4ce4bb7db2$export$608478473a3304a0 = /*@__PURE__*/$49880c4ce4bb7db2
|
|
|
1327
1327
|
const $49880c4ce4bb7db2$export$cc3b6ddf805f6156 = /*@__PURE__*/$49880c4ce4bb7db2$var$c((url, payload) => {
|
|
1328
1328
|
const payload_json = JSON.stringify(payload);
|
|
1329
1329
|
let success = false;
|
|
1330
|
-
|
|
1330
|
+
$7f95f77417d06249$export$de56f1198d121036("Attempting to send (beacon)", payload);
|
|
1331
1331
|
try {
|
|
1332
1332
|
success = navigator.sendBeacon(url, new Blob([payload_json], {
|
|
1333
1333
|
type: "application/json"
|
|
1334
1334
|
}));
|
|
1335
1335
|
} catch (first_error) {
|
|
1336
|
-
|
|
1336
|
+
$7f95f77417d06249$export$de56f1198d121036("Beacon has failed", first_error, "falling back to sending with wrong mime type which might work");
|
|
1337
1337
|
try {
|
|
1338
1338
|
success = navigator.sendBeacon(url, new Blob([payload_json], {
|
|
1339
1339
|
type: "application/x-www-form-urlencoded"
|
|
1340
1340
|
}));
|
|
1341
1341
|
} catch (e) {
|
|
1342
|
-
|
|
1342
|
+
$7f95f77417d06249$export$de56f1198d121036("Beacon fallback has failed", e, "trying fetch");
|
|
1343
1343
|
fetch(url, {
|
|
1344
1344
|
"headers": {
|
|
1345
1345
|
"content-type": "application/json"
|
|
@@ -1348,7 +1348,7 @@ const $49880c4ce4bb7db2$export$cc3b6ddf805f6156 = /*@__PURE__*/$49880c4ce4bb7db2
|
|
|
1348
1348
|
"method": "POST",
|
|
1349
1349
|
"mode": "cors",
|
|
1350
1350
|
"credentials": "include"
|
|
1351
|
-
}).then(response => response.text()).then(text =>
|
|
1351
|
+
}).then(response => response.text()).then(text => $7f95f77417d06249$export$de56f1198d121036("Beacon fallback fallback transmission result", text)).catch(fetch_error => {
|
|
1352
1352
|
(0, $902c0e005afb7319$export$af2e17a20c2ea3c5).withScope(function (scope) {
|
|
1353
1353
|
scope.setExtra("stack", new Error().stack);
|
|
1354
1354
|
scope.setExtra("url", url);
|
|
@@ -1378,9 +1378,9 @@ let $335c248bb07a3509$export$6399bdb2291895e0 = () => {
|
|
|
1378
1378
|
let cookie_error;
|
|
1379
1379
|
try {
|
|
1380
1380
|
var _localStorage;
|
|
1381
|
-
id = (_localStorage = localStorage)._dep_id || (_localStorage._dep_id =
|
|
1381
|
+
id = (_localStorage = localStorage)._dep_id || (_localStorage._dep_id = $a13f25507f352177$export$656831b7e9c341c3());
|
|
1382
1382
|
} catch (e) {
|
|
1383
|
-
|
|
1383
|
+
$7f95f77417d06249$export$de56f1198d121036("Can't use localStorage", e);
|
|
1384
1384
|
localstorage_error = e;
|
|
1385
1385
|
}
|
|
1386
1386
|
if (!id) {
|
|
@@ -1393,11 +1393,11 @@ let $335c248bb07a3509$export$6399bdb2291895e0 = () => {
|
|
|
1393
1393
|
}, {})._dep_id;
|
|
1394
1394
|
id = get_cookie_id();
|
|
1395
1395
|
if (!id) {
|
|
1396
|
-
document.cookie = "_dep_id=".concat(
|
|
1396
|
+
document.cookie = "_dep_id=".concat($a13f25507f352177$export$656831b7e9c341c3(), "; expires=Fri, 31 Dec 9999 23:59:59 GMT");
|
|
1397
1397
|
id = get_cookie_id();
|
|
1398
1398
|
}
|
|
1399
1399
|
} catch (e) {
|
|
1400
|
-
|
|
1400
|
+
$3b52ccc10510b32a$export$f18d5b0af29128b7(e, "warning");
|
|
1401
1401
|
cookie_error = e;
|
|
1402
1402
|
}
|
|
1403
1403
|
(0, $902c0e005afb7319$export$af2e17a20c2ea3c5).withScope(function (scope) {
|
|
@@ -1408,14 +1408,14 @@ let $335c248bb07a3509$export$6399bdb2291895e0 = () => {
|
|
|
1408
1408
|
this.captureMessage("".concat(id ? "localStorage" : "cookie and localStorage", " failed to hold a value!"));
|
|
1409
1409
|
});
|
|
1410
1410
|
}
|
|
1411
|
-
if (!id) id =
|
|
1411
|
+
if (!id) id = $a13f25507f352177$export$656831b7e9c341c3();
|
|
1412
1412
|
return id;
|
|
1413
1413
|
};
|
|
1414
1414
|
let $335c248bb07a3509$export$adc61a405a4cabed = $335c248bb07a3509$export$6399bdb2291895e0;
|
|
1415
1415
|
let $335c248bb07a3509$export$61e7e1f11e96692f = () => undefined;
|
|
1416
|
-
const $335c248bb07a3509$export$336e7ad40bae0652 = /*@__PURE__
|
|
1417
|
-
const $335c248bb07a3509$export$8a96793bf9f87d90 = /*@__PURE__
|
|
1418
|
-
const $335c248bb07a3509$export$93ae15b1ae509334 = /*@__PURE__
|
|
1416
|
+
const $335c248bb07a3509$export$336e7ad40bae0652 = /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9(newfn => $335c248bb07a3509$export$6399bdb2291895e0 = newfn);
|
|
1417
|
+
const $335c248bb07a3509$export$8a96793bf9f87d90 = /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9(newfn => $335c248bb07a3509$export$adc61a405a4cabed = newfn);
|
|
1418
|
+
const $335c248bb07a3509$export$93ae15b1ae509334 = /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9(newfn => $335c248bb07a3509$export$61e7e1f11e96692f = newfn);
|
|
1419
1419
|
const $335c248bb07a3509$export$8c6f26a5b6921b95 = /*@__PURE__*/() => {
|
|
1420
1420
|
var _document;
|
|
1421
1421
|
return {
|
|
@@ -1427,7 +1427,7 @@ const $335c248bb07a3509$export$8c6f26a5b6921b95 = /*@__PURE__*/() => {
|
|
|
1427
1427
|
document_referrer: (_document = document) === null || _document === void 0 ? void 0 : _document.referrer
|
|
1428
1428
|
};
|
|
1429
1429
|
};
|
|
1430
|
-
const $335c248bb07a3509$export$82badda1f9923310 = /*@__PURE__
|
|
1430
|
+
const $335c248bb07a3509$export$82badda1f9923310 = /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9((vars, use_ws) => {
|
|
1431
1431
|
if (process.env.DEPICT === "false") return;
|
|
1432
1432
|
const payload = [{
|
|
1433
1433
|
...$335c248bb07a3509$export$8c6f26a5b6921b95(),
|
|
@@ -1437,9 +1437,9 @@ const $335c248bb07a3509$export$82badda1f9923310 = /*@__PURE__*/(0, $3b52ccc10510
|
|
|
1437
1437
|
entity_price: vars === null || vars === void 0 ? void 0 : vars.sale_price,
|
|
1438
1438
|
...vars
|
|
1439
1439
|
}];
|
|
1440
|
-
return
|
|
1440
|
+
return $49880c4ce4bb7db2$export$28cacbd9b4306ffc(payload, use_ws);
|
|
1441
1441
|
});
|
|
1442
|
-
const $335c248bb07a3509$export$15f8a0cd5a8c0ebb = /*@__PURE__
|
|
1442
|
+
const $335c248bb07a3509$export$15f8a0cd5a8c0ebb = /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9(vars => {
|
|
1443
1443
|
if (process.env.DEPICT === "false") return;
|
|
1444
1444
|
const beacon_retval = $335c248bb07a3509$export$82badda1f9923310({
|
|
1445
1445
|
...vars,
|
|
@@ -1455,7 +1455,7 @@ const $335c248bb07a3509$export$15f8a0cd5a8c0ebb = /*@__PURE__*/(0, $3b52ccc10510
|
|
|
1455
1455
|
|
|
1456
1456
|
return beacon_retval;
|
|
1457
1457
|
});
|
|
1458
|
-
const $335c248bb07a3509$export$9028351cb994757e = /*@__PURE__
|
|
1458
|
+
const $335c248bb07a3509$export$9028351cb994757e = /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9(vars => {
|
|
1459
1459
|
if (process.env.DEPICT === "false") return;
|
|
1460
1460
|
return $335c248bb07a3509$export$82badda1f9923310({
|
|
1461
1461
|
...vars,
|
|
@@ -1470,7 +1470,7 @@ function $335c248bb07a3509$export$622991c71a1f52b3(cookie_name) {
|
|
|
1470
1470
|
function $dde98b3a25fbc838$export$c50e1901e8ed0615(callback) {
|
|
1471
1471
|
// https://stackoverflow.com/a/61574326
|
|
1472
1472
|
const channel = new MessageChannel();
|
|
1473
|
-
channel.port1.onmessage =
|
|
1473
|
+
channel.port1.onmessage = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(callback);
|
|
1474
1474
|
channel.port2.postMessage("");
|
|
1475
1475
|
}
|
|
1476
1476
|
function $504f4aeb15759a69$export$6f051469dd676a8b(tenant, market, type) {
|
|
@@ -1480,11 +1480,11 @@ function $504f4aeb15759a69$export$6f051469dd676a8b(tenant, market, type) {
|
|
|
1480
1480
|
if (!display) return;
|
|
1481
1481
|
info.set_on_index_change(() => {
|
|
1482
1482
|
current_displays.add(display);
|
|
1483
|
-
|
|
1483
|
+
$bBfCy$solidjs.onCleanup(() => current_displays.delete(display));
|
|
1484
1484
|
if (!queued_sending) {
|
|
1485
1485
|
queued_sending = true;
|
|
1486
|
-
|
|
1487
|
-
|
|
1486
|
+
$dde98b3a25fbc838$export$c50e1901e8ed0615(() => {
|
|
1487
|
+
$335c248bb07a3509$export$82badda1f9923310({
|
|
1488
1488
|
tenant: tenant,
|
|
1489
1489
|
market: market,
|
|
1490
1490
|
recommendation_type: type,
|
|
@@ -1507,7 +1507,7 @@ function $ca65e31d7f756206$export$6e7454c733fa1fb2(fn) {
|
|
|
1507
1507
|
return fn.apply(this, [...args, ...unimportant_args]);
|
|
1508
1508
|
};
|
|
1509
1509
|
}
|
|
1510
|
-
const $954922240a743f34$export$8582cf3716962dc2 = /*@__PURE__
|
|
1510
|
+
const $954922240a743f34$export$8582cf3716962dc2 = /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9(async _ref => {
|
|
1511
1511
|
let {
|
|
1512
1512
|
recs: recs,
|
|
1513
1513
|
min_recs: min_recs,
|
|
@@ -1528,11 +1528,11 @@ const $954922240a743f34$export$8582cf3716962dc2 = /*@__PURE__*/(0, $3b52ccc10510
|
|
|
1528
1528
|
if (Array.isArray(recs)) {
|
|
1529
1529
|
if (min_recs == undefined) min_recs = 10;
|
|
1530
1530
|
if (recs.length < min_recs) {
|
|
1531
|
-
|
|
1531
|
+
$7f95f77417d06249$export$c2363754d4758444("Displays provided to check_displays is too short, it contains", recs.length, "displays which is less than", min_recs);
|
|
1532
1532
|
return false;
|
|
1533
1533
|
} else return true;
|
|
1534
|
-
} else
|
|
1535
|
-
} else
|
|
1534
|
+
} else $7f95f77417d06249$export$c2363754d4758444(new Error("neither recs nor recs.displays are an array"));
|
|
1535
|
+
} else $7f95f77417d06249$export$c2363754d4758444(new Error("Non object was passed to check_displays"));
|
|
1536
1536
|
});
|
|
1537
1537
|
const $bada18c179c0c105$var$elem_track_id_map = /*@__PURE__*/new WeakMap();
|
|
1538
1538
|
function $bada18c179c0c105$export$16d7c76794a38a4(element, event, track_id, func) {
|
|
@@ -1581,7 +1581,7 @@ function $c64b3d92c99cdd73$var$check_if_querySelectorAll_needs_patching() {
|
|
|
1581
1581
|
}
|
|
1582
1582
|
let $5e0fc3a8b68f26c7$var$has_queued_microtask = false;
|
|
1583
1583
|
const $5e0fc3a8b68f26c7$var$queued_callbacks = /*@__PURE__*/new Map();
|
|
1584
|
-
const $5e0fc3a8b68f26c7$var$catchified_deduplicate_and_dispatch = /*@__PURE__
|
|
1584
|
+
const $5e0fc3a8b68f26c7$var$catchified_deduplicate_and_dispatch = /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9($5e0fc3a8b68f26c7$var$deduplicate_and_dispatch, "error in observer event processing", "error");
|
|
1585
1585
|
function $5e0fc3a8b68f26c7$export$2b08e30396270f0b(callback, ev) {
|
|
1586
1586
|
$5e0fc3a8b68f26c7$var$queued_callbacks.set(ev, callback);
|
|
1587
1587
|
if (!$5e0fc3a8b68f26c7$var$has_queued_microtask) queueMicrotask($5e0fc3a8b68f26c7$var$catchified_deduplicate_and_dispatch);
|
|
@@ -1626,7 +1626,7 @@ function $5e0fc3a8b68f26c7$var$deduplicate_and_dispatch() {
|
|
|
1626
1626
|
}
|
|
1627
1627
|
}
|
|
1628
1628
|
function $5e0fc3a8b68f26c7$var$call_callback(callback, ev) {
|
|
1629
|
-
|
|
1629
|
+
$3b52ccc10510b32a$export$b3bbfd758f11cfa9(callback, "Error in observer callback")(ev);
|
|
1630
1630
|
}
|
|
1631
1631
|
class $d82393b9dfe50322$export$ea60432919e69303 {
|
|
1632
1632
|
constructor(opts) {
|
|
@@ -1716,7 +1716,7 @@ class $523564fcfb9c3bb9$export$12e07a2a9f87578a {
|
|
|
1716
1716
|
});
|
|
1717
1717
|
$523564fcfb9c3bb9$var$_classPrivateFieldInitSpec(this, $523564fcfb9c3bb9$var$_weakref_finalization_registry, {
|
|
1718
1718
|
writable: true,
|
|
1719
|
-
value: typeof FinalizationRegistry === "function" && new FinalizationRegistry(
|
|
1719
|
+
value: typeof FinalizationRegistry === "function" && new FinalizationRegistry($3b52ccc10510b32a$export$b3bbfd758f11cfa9($523564fcfb9c3bb9$var$_classPrivateMethodGet(this, $523564fcfb9c3bb9$var$_finalization_registry_callback, $523564fcfb9c3bb9$var$_finalization_registry_callback2).bind(this)))
|
|
1720
1720
|
});
|
|
1721
1721
|
$523564fcfb9c3bb9$var$_classPrivateFieldInitSpec(this, $523564fcfb9c3bb9$var$_verbs, {
|
|
1722
1722
|
writable: true,
|
|
@@ -1726,7 +1726,7 @@ class $523564fcfb9c3bb9$export$12e07a2a9f87578a {
|
|
|
1726
1726
|
var _classPrivateFieldGet2, _ref;
|
|
1727
1727
|
$523564fcfb9c3bb9$var$_classPrivateMethodGet(this, $523564fcfb9c3bb9$var$_check_observer_args, $523564fcfb9c3bb9$var$_check_observer_args2).call(this, selector, callback, true);
|
|
1728
1728
|
if (selector instanceof Node) {
|
|
1729
|
-
if (typeof document === "object" && (
|
|
1729
|
+
if (typeof document === "object" && ($parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $523564fcfb9c3bb9$var$_territory) || document.documentElement).contains(selector))
|
|
1730
1730
|
// When the selector is a node the selector and the element are the same, dunno how we could reflect that in the typing though
|
|
1731
1731
|
$523564fcfb9c3bb9$var$_classPrivateMethodGet(this, $523564fcfb9c3bb9$var$_call_callbacks, $523564fcfb9c3bb9$var$_call_callbacks2).call(this, [callback], callback_ => ({
|
|
1732
1732
|
element_: selector,
|
|
@@ -1740,8 +1740,8 @@ class $523564fcfb9c3bb9$export$12e07a2a9f87578a {
|
|
|
1740
1740
|
}));
|
|
1741
1741
|
return;
|
|
1742
1742
|
}
|
|
1743
|
-
const our_set = (_classPrivateFieldGet2 =
|
|
1744
|
-
const elements = typeof document === "undefined" ? [] :
|
|
1743
|
+
const our_set = (_classPrivateFieldGet2 = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $523564fcfb9c3bb9$var$_attribute_attribution_map_object))[_ref = selector] || (_classPrivateFieldGet2[_ref] = new WeakSet());
|
|
1744
|
+
const elements = typeof document === "undefined" ? [] : $c64b3d92c99cdd73$export$33f937d741e49339($parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $523564fcfb9c3bb9$var$_territory) || document, selector);
|
|
1745
1745
|
for (let i = 0; i < elements.length; i++) {
|
|
1746
1746
|
const element = elements[i];
|
|
1747
1747
|
our_set.add(element);
|
|
@@ -1757,13 +1757,13 @@ class $523564fcfb9c3bb9$export$12e07a2a9f87578a {
|
|
|
1757
1757
|
}
|
|
1758
1758
|
},
|
|
1759
1759
|
wait_for_element: (selector, timeout) => {
|
|
1760
|
-
return
|
|
1760
|
+
return $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $523564fcfb9c3bb9$var$_self_proxied).wait_for_listener("exists", selector, timeout);
|
|
1761
1761
|
},
|
|
1762
1762
|
wait_for_listener: (listener, selector, timeout) => {
|
|
1763
1763
|
$523564fcfb9c3bb9$var$_classPrivateMethodGet(this, $523564fcfb9c3bb9$var$_check_observer_args, $523564fcfb9c3bb9$var$_check_observer_args2).call(this, listener, () => {}, false);
|
|
1764
1764
|
// console.log("waiting for listener", listener, "selector", selector, "timeout", timeout);
|
|
1765
|
-
return new Promise(
|
|
1766
|
-
const stop_observing =
|
|
1765
|
+
return new Promise($3b52ccc10510b32a$export$b3bbfd758f11cfa9(r => {
|
|
1766
|
+
const stop_observing = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $523564fcfb9c3bb9$var$_self_proxied)["on" + listener](selector, _ref2 => {
|
|
1767
1767
|
let {
|
|
1768
1768
|
element: element,
|
|
1769
1769
|
disconnector: disconnector
|
|
@@ -1785,11 +1785,11 @@ class $523564fcfb9c3bb9$export$12e07a2a9f87578a {
|
|
|
1785
1785
|
value: records => {
|
|
1786
1786
|
// this is the function which needs to be as fast as possible because it is called on EVERY mutation in the DOM
|
|
1787
1787
|
try {
|
|
1788
|
-
|
|
1788
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldSet)(this, $523564fcfb9c3bb9$var$_observer_callback_running, true);
|
|
1789
1789
|
const steps_to_restore_observing_cache = [];
|
|
1790
1790
|
try {
|
|
1791
|
-
const observing =
|
|
1792
|
-
const attribute_attribution_map_object =
|
|
1791
|
+
const observing = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $523564fcfb9c3bb9$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.
|
|
1792
|
+
const attribute_attribution_map_object = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $523564fcfb9c3bb9$var$_attribute_attribution_map_object);
|
|
1793
1793
|
for (let j = 0; j < records.length; j++) {
|
|
1794
1794
|
const record = records[j];
|
|
1795
1795
|
const {
|
|
@@ -1896,7 +1896,7 @@ class $523564fcfb9c3bb9$export$12e07a2a9f87578a {
|
|
|
1896
1896
|
if ((addedNodes.length || removedNodes.length) && node.hasChildNodes() &&
|
|
1897
1897
|
// @ts-ignore
|
|
1898
1898
|
node.querySelectorAll /* don't act on i.e. textnodes. Doing the check this way is actually faster than both `in` and instanceof */) {
|
|
1899
|
-
const matching_children =
|
|
1899
|
+
const matching_children = $c64b3d92c99cdd73$export$33f937d741e49339(node, selector);
|
|
1900
1900
|
for (let m = 0; m < matching_children.length; m++) {
|
|
1901
1901
|
// always use for loops because this can't be slow and forEach takes ages
|
|
1902
1902
|
if (event == "exists") our_set.add(matching_children[m]);
|
|
@@ -1965,7 +1965,7 @@ class $523564fcfb9c3bb9$export$12e07a2a9f87578a {
|
|
|
1965
1965
|
const matching_nodes = [];
|
|
1966
1966
|
// @ts-ignore
|
|
1967
1967
|
if (node !== null && node !== void 0 && (_node$matches2 = node.matches) !== null && _node$matches2 !== void 0 && _node$matches2.call(node, selector)) matching_nodes.push(node);
|
|
1968
|
-
matching_nodes.push(...(
|
|
1968
|
+
matching_nodes.push(...($c64b3d92c99cdd73$export$33f937d741e49339(node, selector) || []));
|
|
1969
1969
|
for (let v = 0; v < matching_nodes.length; v++) $523564fcfb9c3bb9$var$_classPrivateMethodGet(this, $523564fcfb9c3bb9$var$_call_callbacks, $523564fcfb9c3bb9$var$_call_callbacks2).call(this, callbacks, callback => ({
|
|
1970
1970
|
element_: matching_nodes[v],
|
|
1971
1971
|
selector_: selector,
|
|
@@ -2004,36 +2004,36 @@ class $523564fcfb9c3bb9$export$12e07a2a9f87578a {
|
|
|
2004
2004
|
} finally {
|
|
2005
2005
|
// ensure that we don't leave this.#observing in a broken state if we throw
|
|
2006
2006
|
while (steps_to_restore_observing_cache.length) steps_to_restore_observing_cache.pop()();
|
|
2007
|
-
const execute_after_run =
|
|
2007
|
+
const execute_after_run = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $523564fcfb9c3bb9$var$_execute_after_callback_ran);
|
|
2008
2008
|
// We need to execute these in order they were added because I'm afraid that things might rely on it
|
|
2009
2009
|
for (let i = 0; i < execute_after_run.length; i++) try {
|
|
2010
2010
|
execute_after_run[i]();
|
|
2011
2011
|
} catch (e) {
|
|
2012
|
-
|
|
2012
|
+
$3b52ccc10510b32a$export$f18d5b0af29128b7([e, "error in observer running queued function"], "error");
|
|
2013
2013
|
}
|
|
2014
2014
|
// Let the garbage collector empty the old array by creating a new one
|
|
2015
|
-
|
|
2016
|
-
|
|
2015
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldSet)(this, $523564fcfb9c3bb9$var$_execute_after_callback_ran, []);
|
|
2016
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldSet)(this, $523564fcfb9c3bb9$var$_observer_callback_running, false);
|
|
2017
2017
|
}
|
|
2018
2018
|
} catch (e) {
|
|
2019
|
-
|
|
2019
|
+
$3b52ccc10510b32a$export$f18d5b0af29128b7([e, "error in observer"], "error");
|
|
2020
2020
|
}
|
|
2021
2021
|
}
|
|
2022
2022
|
});
|
|
2023
2023
|
if (process.env.BUILD_TARGET !== "modern" && Proxy.toString().indexOf("[native code]") === -1) {
|
|
2024
|
-
|
|
2025
|
-
Object.keys(
|
|
2024
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $523564fcfb9c3bb9$var$_listeners).forEach(listener => this["on" + listener] = () => {}); // define listeners, needed for IE11 proxy polyfill
|
|
2025
|
+
Object.keys($parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $523564fcfb9c3bb9$var$_verbs)).forEach(listener => this[listener] = () => {});
|
|
2026
2026
|
}
|
|
2027
|
-
if (options.territory)
|
|
2028
|
-
return
|
|
2027
|
+
if (options.territory) $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldSet)(this, $523564fcfb9c3bb9$var$_territory, options.territory);
|
|
2028
|
+
return $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldSet)(this, $523564fcfb9c3bb9$var$_self_proxied, new Proxy(this, {
|
|
2029
2029
|
get: $523564fcfb9c3bb9$var$_classPrivateMethodGet(this, $523564fcfb9c3bb9$var$_get, $523564fcfb9c3bb9$var$_get2)
|
|
2030
2030
|
}));
|
|
2031
2031
|
}
|
|
2032
2032
|
}
|
|
2033
2033
|
function $523564fcfb9c3bb9$var$_kickstart_observer2() {
|
|
2034
2034
|
if (typeof document === "undefined") return;
|
|
2035
|
-
|
|
2036
|
-
|
|
2035
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldSet)(this, $523564fcfb9c3bb9$var$_the_mutation_observer, new MutationObserver($parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $523564fcfb9c3bb9$var$_observer_callback)));
|
|
2036
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $523564fcfb9c3bb9$var$_the_mutation_observer).observe($parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $523564fcfb9c3bb9$var$_territory) || document, {
|
|
2037
2037
|
attributes: true,
|
|
2038
2038
|
childList: true,
|
|
2039
2039
|
subtree: true,
|
|
@@ -2050,7 +2050,7 @@ function $523564fcfb9c3bb9$var$_disconnect_fn2(_ref4) {
|
|
|
2050
2050
|
} = _ref4;
|
|
2051
2051
|
return () => {
|
|
2052
2052
|
const fn = () => {
|
|
2053
|
-
const observing =
|
|
2053
|
+
const observing = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $523564fcfb9c3bb9$var$_observing);
|
|
2054
2054
|
const selector_to_callback_array_map = observing[event_];
|
|
2055
2055
|
if (!selector_to_callback_array_map) return;
|
|
2056
2056
|
const callbacks = selector_to_callback_array_map.get(selector_);
|
|
@@ -2059,12 +2059,12 @@ function $523564fcfb9c3bb9$var$_disconnect_fn2(_ref4) {
|
|
|
2059
2059
|
if (selector_to_callback_array_map.size === 0) delete observing[event_];
|
|
2060
2060
|
if (!Object.keys(observing).length) {
|
|
2061
2061
|
var _classPrivateFieldGet3;
|
|
2062
|
-
(_classPrivateFieldGet3 =
|
|
2063
|
-
|
|
2062
|
+
(_classPrivateFieldGet3 = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $523564fcfb9c3bb9$var$_the_mutation_observer)) === null || _classPrivateFieldGet3 === void 0 || _classPrivateFieldGet3.disconnect();
|
|
2063
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldSet)(this, $523564fcfb9c3bb9$var$_the_mutation_observer, undefined);
|
|
2064
2064
|
}
|
|
2065
2065
|
};
|
|
2066
2066
|
// 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
|
|
2067
|
-
if (
|
|
2067
|
+
if ($parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $523564fcfb9c3bb9$var$_observer_callback_running)) $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $523564fcfb9c3bb9$var$_execute_after_callback_ran).push(fn);else fn();
|
|
2068
2068
|
};
|
|
2069
2069
|
}
|
|
2070
2070
|
function $523564fcfb9c3bb9$var$_check_observer_args2(selector, callback, allow_nodes) {
|
|
@@ -2079,7 +2079,7 @@ function $523564fcfb9c3bb9$var$_add_listener2(listener) {
|
|
|
2079
2079
|
// We are probably running on the server where we can't do anything anyway so we might just return
|
|
2080
2080
|
return;
|
|
2081
2081
|
if (!listener || !selector || !callback) {
|
|
2082
|
-
|
|
2082
|
+
$7f95f77417d06249$export$de56f1198d121036("listener, selector or callback is falsey", {
|
|
2083
2083
|
listener: listener,
|
|
2084
2084
|
selector: selector,
|
|
2085
2085
|
callback: callback
|
|
@@ -2087,17 +2087,17 @@ function $523564fcfb9c3bb9$var$_add_listener2(listener) {
|
|
|
2087
2087
|
return;
|
|
2088
2088
|
}
|
|
2089
2089
|
$523564fcfb9c3bb9$var$_classPrivateMethodGet(the_class, $523564fcfb9c3bb9$var$_check_observer_args, $523564fcfb9c3bb9$var$_check_observer_args2).call(the_class, selector, callback, listener != "change");
|
|
2090
|
-
if (
|
|
2090
|
+
if ($parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(the_class, $523564fcfb9c3bb9$var$_observer_callback_running)) {
|
|
2091
2091
|
// Can't mutate #observing right now, queue it for when we can
|
|
2092
|
-
|
|
2092
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(the_class, $523564fcfb9c3bb9$var$_execute_after_callback_ran).push(() => function_for_listener(selector, callback));
|
|
2093
2093
|
return;
|
|
2094
2094
|
}
|
|
2095
|
-
const observing =
|
|
2095
|
+
const observing = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(the_class, $523564fcfb9c3bb9$var$_observing);
|
|
2096
2096
|
observing[listener] || (observing[listener] = new Map());
|
|
2097
2097
|
// create map for each listener, this is because the selectors can be objects for .onremoved, .oncreation and .onexists to take explicit nodes
|
|
2098
2098
|
const selector_map = observing[listener];
|
|
2099
2099
|
let disconnector;
|
|
2100
|
-
if (listener === "exists")
|
|
2100
|
+
if (listener === "exists") $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(the_class, $523564fcfb9c3bb9$var$_verbs).ifexists(selector, callback);
|
|
2101
2101
|
if (typeof selector === "string") {
|
|
2102
2102
|
// simple code for string selectors
|
|
2103
2103
|
let callback_set = selector_map.get(selector);
|
|
@@ -2146,45 +2146,45 @@ function $523564fcfb9c3bb9$var$_add_listener2(listener) {
|
|
|
2146
2146
|
}
|
|
2147
2147
|
callback_set_to_add_to.add(callback);
|
|
2148
2148
|
}
|
|
2149
|
-
if (
|
|
2149
|
+
if (!$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(the_class, $523564fcfb9c3bb9$var$_the_mutation_observer)) $523564fcfb9c3bb9$var$_classPrivateMethodGet(the_class, $523564fcfb9c3bb9$var$_kickstart_observer, $523564fcfb9c3bb9$var$_kickstart_observer2).call(the_class);
|
|
2150
2150
|
return disconnector;
|
|
2151
2151
|
};
|
|
2152
2152
|
return function_for_listener;
|
|
2153
2153
|
}
|
|
2154
2154
|
function $523564fcfb9c3bb9$var$_cleanup_weakref_when_refd_el_gcd2(listener, weakref, element) {
|
|
2155
2155
|
// we don't want to keep references to elements used as "selectors" in oncreation and onremoved
|
|
2156
|
-
if (
|
|
2157
|
-
|
|
2156
|
+
if (!$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $523564fcfb9c3bb9$var$_weakref_finalization_registry)) return;
|
|
2157
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $523564fcfb9c3bb9$var$_weakref_finalization_registry).register(element, [listener, weakref]);
|
|
2158
2158
|
}
|
|
2159
2159
|
function $523564fcfb9c3bb9$var$_finalization_registry_callback2(_ref5) {
|
|
2160
2160
|
var _observing$listener, _observing$listener$g, _observing$listener2, _observing$listener3;
|
|
2161
2161
|
let [listener, weak_ref] = _ref5;
|
|
2162
2162
|
// element was GCd and the callbacks can never be called, remove them
|
|
2163
|
-
const observing =
|
|
2163
|
+
const observing = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $523564fcfb9c3bb9$var$_observing);
|
|
2164
2164
|
(_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
|
|
2165
2165
|
(_observing$listener2 = observing[listener]) === null || _observing$listener2 === void 0 || _observing$listener2.delete(weak_ref);
|
|
2166
2166
|
if (((_observing$listener3 = observing[listener]) === null || _observing$listener3 === void 0 ? void 0 : _observing$listener3.size) === 0) delete observing[listener];
|
|
2167
2167
|
if (Object.keys(observing).length === 0) {
|
|
2168
2168
|
var _classPrivateFieldGet4;
|
|
2169
|
-
(_classPrivateFieldGet4 =
|
|
2170
|
-
|
|
2169
|
+
(_classPrivateFieldGet4 = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $523564fcfb9c3bb9$var$_the_mutation_observer)) === null || _classPrivateFieldGet4 === void 0 || _classPrivateFieldGet4.disconnect();
|
|
2170
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldSet)(this, $523564fcfb9c3bb9$var$_the_mutation_observer, undefined);
|
|
2171
2171
|
}
|
|
2172
2172
|
}
|
|
2173
2173
|
function $523564fcfb9c3bb9$var$_call_callbacks2(callbacks, make_ev_data) {
|
|
2174
|
-
for (const callback of callbacks)
|
|
2174
|
+
for (const callback of callbacks) $5e0fc3a8b68f26c7$export$2b08e30396270f0b(callback, new (0, $d82393b9dfe50322$export$ea60432919e69303)(make_ev_data(callback)));
|
|
2175
2175
|
}
|
|
2176
2176
|
function $523564fcfb9c3bb9$var$_get2(target, verb) {
|
|
2177
2177
|
// @ts-ignore
|
|
2178
|
-
const is_listener =
|
|
2179
|
-
const is_verb = Object.keys(
|
|
2180
|
-
if (is_verb) return
|
|
2178
|
+
const is_listener = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(target, $523564fcfb9c3bb9$var$_listeners).includes(verb.slice(2));
|
|
2179
|
+
const is_verb = Object.keys($parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(target, $523564fcfb9c3bb9$var$_verbs)).includes(verb);
|
|
2180
|
+
if (is_verb) return $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(target, $523564fcfb9c3bb9$var$_verbs)[verb];else if (is_listener) return $523564fcfb9c3bb9$var$_classPrivateMethodGet(target, $523564fcfb9c3bb9$var$_add_listener, $523564fcfb9c3bb9$var$_add_listener2).call(target, verb.slice(2));else throw new Error("Property " + verb + " is not valid. Valid listeners: " + $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(target, $523564fcfb9c3bb9$var$_listeners).join(", ") + "; valid verbs: " + Object.keys($parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(target, $523564fcfb9c3bb9$var$_verbs)).join(", "));
|
|
2181
2181
|
}
|
|
2182
2182
|
const $03c157d68c9fcbac$export$b6ae1bc530f4c149 = /*@__PURE__*/$03c157d68c9fcbac$var$make_default_observer();
|
|
2183
2183
|
function $03c157d68c9fcbac$var$make_default_observer() {
|
|
2184
2184
|
try {
|
|
2185
2185
|
return new (0, $523564fcfb9c3bb9$export$12e07a2a9f87578a)();
|
|
2186
2186
|
} catch (error) {
|
|
2187
|
-
|
|
2187
|
+
$3b52ccc10510b32a$export$f18d5b0af29128b7([error, "error starting ElementObserver"], "error");
|
|
2188
2188
|
}
|
|
2189
2189
|
}
|
|
2190
2190
|
function $8b27923e1d1e6b99$export$925772df9b4d16e5(url, param, value) {
|
|
@@ -2217,22 +2217,22 @@ function $8b27923e1d1e6b99$export$d4bd03f19260ef1c(url) {
|
|
|
2217
2217
|
let stfu = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
2218
2218
|
let also_in_all_shadow_roots = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
2219
2219
|
if (process.env.DEBUG === "true" && location.href.includes(override_dev_url)) {
|
|
2220
|
-
const relativ_callback =
|
|
2220
|
+
const relativ_callback = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(event => {
|
|
2221
2221
|
const anchor = event.element;
|
|
2222
2222
|
if (typeof url === "string") {
|
|
2223
2223
|
if (anchor.href.includes(url)) {
|
|
2224
|
-
if (!stfu)
|
|
2224
|
+
if (!stfu) $7f95f77417d06249$export$de56f1198d121036("RUNNING RELATIVIFY on", event);
|
|
2225
2225
|
anchor.href = anchor.href.replaceAll(url, "/");
|
|
2226
2226
|
}
|
|
2227
2227
|
} else if (url.test(anchor.href)) {
|
|
2228
|
-
if (!stfu)
|
|
2228
|
+
if (!stfu) $7f95f77417d06249$export$de56f1198d121036("RUNNING RELATIVIFY on", event);
|
|
2229
2229
|
anchor.href = anchor.href.replace(url, "/");
|
|
2230
2230
|
}
|
|
2231
2231
|
});
|
|
2232
2232
|
const link_sel = "a[href]";
|
|
2233
2233
|
(0, $03c157d68c9fcbac$export$b6ae1bc530f4c149).onexists(link_sel, relativ_callback);
|
|
2234
2234
|
if (also_onchange) (0, $03c157d68c9fcbac$export$b6ae1bc530f4c149).onchange(link_sel, relativ_callback);
|
|
2235
|
-
if (also_in_all_shadow_roots && typeof ShadowRoot == "function") (0, $03c157d68c9fcbac$export$b6ae1bc530f4c149).onexists("*",
|
|
2235
|
+
if (also_in_all_shadow_roots && typeof ShadowRoot == "function") (0, $03c157d68c9fcbac$export$b6ae1bc530f4c149).onexists("*", $3b52ccc10510b32a$export$b3bbfd758f11cfa9(_ref => {
|
|
2236
2236
|
let {
|
|
2237
2237
|
element: element
|
|
2238
2238
|
} = _ref;
|
|
@@ -2249,7 +2249,7 @@ function $8b27923e1d1e6b99$export$5e63aea0cac01fa0(elements, selector) {
|
|
|
2249
2249
|
const matches = [];
|
|
2250
2250
|
for (const element of elements) {
|
|
2251
2251
|
var _element$matches;
|
|
2252
|
-
if ("querySelectorAll" in element) matches.push(
|
|
2252
|
+
if ("querySelectorAll" in element) matches.push(...$c64b3d92c99cdd73$export$33f937d741e49339(element, selector));
|
|
2253
2253
|
if ("matches" in element && (_element$matches = element.matches) !== null && _element$matches !== void 0 && _element$matches.call(element, selector)) matches.push(element);
|
|
2254
2254
|
}
|
|
2255
2255
|
return matches;
|
|
@@ -2261,12 +2261,12 @@ function $8b27923e1d1e6b99$export$cfef5d5c9ac09253(price) {
|
|
|
2261
2261
|
if (!price && price !== 0) return "";
|
|
2262
2262
|
if (typeof price === "string") {
|
|
2263
2263
|
if (!isNaN(price)) {
|
|
2264
|
-
|
|
2264
|
+
$3b52ccc10510b32a$export$f18d5b0af29128b7(new Error("standard_price_format did not expect price as a string"), "warning", {
|
|
2265
2265
|
price: price
|
|
2266
2266
|
});
|
|
2267
2267
|
price = parseFloat(price);
|
|
2268
2268
|
} else {
|
|
2269
|
-
|
|
2269
|
+
$3b52ccc10510b32a$export$f18d5b0af29128b7(new Error("standard_price_format cannot handle price string"), "error", {
|
|
2270
2270
|
price: price
|
|
2271
2271
|
});
|
|
2272
2272
|
return "";
|
|
@@ -2311,14 +2311,14 @@ function $ca80d3a3f70d4752$export$947a20746936143d(promises) {
|
|
|
2311
2311
|
async function $04bba294678834bc$export$836f70a28c317905(product_id) {
|
|
2312
2312
|
if (typeof BroadcastChannel != "function") return;
|
|
2313
2313
|
const bc = new BroadcastChannel("right_click_attribution");
|
|
2314
|
-
|
|
2314
|
+
$7f95f77417d06249$export$de56f1198d121036("Broadcasting", product_id, "to", bc);
|
|
2315
2315
|
bc.postMessage(product_id);
|
|
2316
2316
|
bc.close();
|
|
2317
2317
|
}
|
|
2318
2318
|
function $04bba294678834bc$export$58c56fe2313fdbe3(elements, display, info, get_event_listener_remover) {
|
|
2319
2319
|
if (typeof BroadcastChannel != "function") return elements;
|
|
2320
2320
|
const disconnectors = [];
|
|
2321
|
-
const handler =
|
|
2321
|
+
const handler = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(e => $04bba294678834bc$export$8f66c4c7fb96eda2(e, ("variant_index" in display ? display.variant_displays[display.variant_index] : display).product_id));
|
|
2322
2322
|
const auxclick_handler = e => e.button === 1 && handler(e);
|
|
2323
2323
|
for (let i = 0; i < (elements === null || elements === void 0 ? void 0 : elements.length); i++) {
|
|
2324
2324
|
const element = elements[i];
|
|
@@ -2333,15 +2333,15 @@ function $04bba294678834bc$export$58c56fe2313fdbe3(elements, display, info, get_
|
|
|
2333
2333
|
return elements;
|
|
2334
2334
|
}
|
|
2335
2335
|
async function $04bba294678834bc$export$8f66c4c7fb96eda2(e, product_id) {
|
|
2336
|
-
|
|
2336
|
+
$7f95f77417d06249$export$de56f1198d121036("Contextmenu was invoked", e);
|
|
2337
2337
|
const element = e.currentTarget || e.target;
|
|
2338
2338
|
const bc = new BroadcastChannel("right_click_attribution");
|
|
2339
|
-
const got_wanted_event = await
|
|
2340
|
-
bc.addEventListener("message",
|
|
2339
|
+
const got_wanted_event = await $ca80d3a3f70d4752$export$947a20746936143d([new Promise(resolve => {
|
|
2340
|
+
bc.addEventListener("message", $3b52ccc10510b32a$export$b3bbfd758f11cfa9(msg => {
|
|
2341
2341
|
const {
|
|
2342
2342
|
data: data
|
|
2343
2343
|
} = msg;
|
|
2344
|
-
|
|
2344
|
+
$7f95f77417d06249$export$de56f1198d121036("Recieved broadcast channel event", data, msg);
|
|
2345
2345
|
if (data == product_id) resolve(true);
|
|
2346
2346
|
}));
|
|
2347
2347
|
}), new Promise(r => setTimeout(r, 60000, false))]);
|
|
@@ -2352,12 +2352,12 @@ async function $04bba294678834bc$export$8f66c4c7fb96eda2(e, product_id) {
|
|
|
2352
2352
|
cancelable: true,
|
|
2353
2353
|
metaKey: true
|
|
2354
2354
|
});
|
|
2355
|
-
|
|
2355
|
+
$7f95f77417d06249$export$de56f1198d121036("Someone broadcasted our product_id! Simulating a click event on the element that was contextmenu'd", element, click);
|
|
2356
2356
|
element.addEventListener("click", e => (e.preventDefault(), false), {
|
|
2357
2357
|
once: true
|
|
2358
2358
|
});
|
|
2359
2359
|
element.dispatchEvent(click);
|
|
2360
|
-
} else
|
|
2360
|
+
} else $7f95f77417d06249$export$de56f1198d121036("Our product_id did not get broadcasted, closing channel");
|
|
2361
2361
|
bc.close();
|
|
2362
2362
|
}
|
|
2363
2363
|
|
|
@@ -2392,7 +2392,7 @@ const $6221808291a088c4$var$unwatch_element = element => {
|
|
|
2392
2392
|
};
|
|
2393
2393
|
const $6221808291a088c4$export$4c51576248bcdf31 = (element, callback) => {
|
|
2394
2394
|
if ($6221808291a088c4$var$watched_elements.has(element)) {
|
|
2395
|
-
|
|
2395
|
+
$7f95f77417d06249$export$de56f1198d121036("Not watching", element, "as it's already being watched");
|
|
2396
2396
|
return () => {};
|
|
2397
2397
|
}
|
|
2398
2398
|
$6221808291a088c4$var$intersection_observer === null || $6221808291a088c4$var$intersection_observer === void 0 || $6221808291a088c4$var$intersection_observer.observe(element);
|
|
@@ -2447,7 +2447,7 @@ const $6221808291a088c4$var$intersection_observer_callback = entries => {
|
|
|
2447
2447
|
clearTimeout(callback_timeout_);
|
|
2448
2448
|
if (time_elapsed <= (0, $4b9808e8f3ab50d9$export$ca8321ea61dc2544)) $6221808291a088c4$var$current_intersections.delete(target);else {
|
|
2449
2449
|
// we intersected long enough
|
|
2450
|
-
|
|
2450
|
+
$7f95f77417d06249$export$de56f1198d121036("intersection_observer: setTimeout lagged", time_elapsed, (0, $4b9808e8f3ab50d9$export$ca8321ea61dc2544), "ms", target);
|
|
2451
2451
|
callback(target);
|
|
2452
2452
|
}
|
|
2453
2453
|
}
|
|
@@ -2457,34 +2457,34 @@ const $6221808291a088c4$var$intersection_observer_callback = entries => {
|
|
|
2457
2457
|
* Global IntersectionObserver used for all impression tracking.
|
|
2458
2458
|
* It's faster to use one observer for all elements than to create a new one for each element.
|
|
2459
2459
|
*/
|
|
2460
|
-
const $6221808291a088c4$var$intersection_observer = typeof window === "object" ? /*@__PURE__*/new IntersectionObserver( /*@__PURE__
|
|
2461
|
-
threshold: /*@__PURE__
|
|
2460
|
+
const $6221808291a088c4$var$intersection_observer = typeof window === "object" ? /*@__PURE__*/new IntersectionObserver( /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9($6221808291a088c4$var$intersection_observer_callback), {
|
|
2461
|
+
threshold: /*@__PURE__*/$4e1f5263dceb9802$export$f8ea2e7b15b5d129(8)
|
|
2462
2462
|
}) : undefined;
|
|
2463
2463
|
const $e61e4fdc357cece9$export$d0efd8ed14f5c33 = (items, display, info) => {
|
|
2464
2464
|
if (!(items !== null && items !== void 0 && items.length)) return items;
|
|
2465
2465
|
const node_array = Array.isArray(items) ? items : [...items]; // if it's a NodeList convert it to an array
|
|
2466
2466
|
const first_watchable_el = node_array.find(el => el instanceof Element);
|
|
2467
2467
|
if (!first_watchable_el) {
|
|
2468
|
-
|
|
2468
|
+
$7f95f77417d06249$export$de56f1198d121036("Impression tracking: Can't observe", items, display);
|
|
2469
2469
|
return items;
|
|
2470
2470
|
}
|
|
2471
2471
|
if (!info.t) {
|
|
2472
|
-
|
|
2472
|
+
$7f95f77417d06249$export$de56f1198d121036("Impression tracking: No tenant instance, can't track", items, display);
|
|
2473
2473
|
return items;
|
|
2474
2474
|
}
|
|
2475
2475
|
(0, $03c157d68c9fcbac$export$b6ae1bc530f4c149).onexists(first_watchable_el, _ref => {
|
|
2476
2476
|
let {
|
|
2477
2477
|
element: element
|
|
2478
2478
|
} = _ref;
|
|
2479
|
-
|
|
2479
|
+
$6221808291a088c4$export$4c51576248bcdf31(element, () => {
|
|
2480
2480
|
const {
|
|
2481
2481
|
recommendation_id: recommendation_id,
|
|
2482
2482
|
search_result_id: search_result_id,
|
|
2483
2483
|
product_listing_result_id: product_listing_result_id,
|
|
2484
2484
|
suggestions_result_id: suggestions_result_id
|
|
2485
2485
|
} = display;
|
|
2486
|
-
|
|
2487
|
-
|
|
2486
|
+
$4b9808e8f3ab50d9$export$4205dc6835bc0d9f({
|
|
2487
|
+
...$335c248bb07a3509$export$8c6f26a5b6921b95(),
|
|
2488
2488
|
recommendation_type: info.rendering_options.type,
|
|
2489
2489
|
entity_price: display.sale_price,
|
|
2490
2490
|
market: info.t.market,
|
|
@@ -2507,9 +2507,9 @@ const $89969f18db4020d7$export$37125ccc5dd98050 = _ref => {
|
|
|
2507
2507
|
} = _ref;
|
|
2508
2508
|
const disconnectors = [];
|
|
2509
2509
|
const impression_track = () => {
|
|
2510
|
-
const disconnector =
|
|
2511
|
-
|
|
2512
|
-
|
|
2510
|
+
const disconnector = $6221808291a088c4$export$4c51576248bcdf31(element, () => {
|
|
2511
|
+
$4b9808e8f3ab50d9$export$4205dc6835bc0d9f({
|
|
2512
|
+
...$335c248bb07a3509$export$8c6f26a5b6921b95(),
|
|
2513
2513
|
...data
|
|
2514
2514
|
});
|
|
2515
2515
|
});
|
|
@@ -2523,7 +2523,7 @@ const $4b9808e8f3ab50d9$export$c543ee4cdb0d0964 = (start, end) => $4b9808e8f3ab5
|
|
|
2523
2523
|
const $4b9808e8f3ab50d9$export$ca8321ea61dc2544 = 500;
|
|
2524
2524
|
const $4b9808e8f3ab50d9$export$4205dc6835bc0d9f = data => {
|
|
2525
2525
|
data.type = "element_visible"; // Set the type to element_visible as this is optional to pass here.
|
|
2526
|
-
|
|
2526
|
+
$49880c4ce4bb7db2$export$28cacbd9b4306ffc([data], true);
|
|
2527
2527
|
};
|
|
2528
2528
|
function $1ea91dfed6983398$export$82a685f2da2fb027(a_element, product_id, recommendation_id, additional_listener) {
|
|
2529
2529
|
var _a_element$depict_tra, _a_element$depict_tra2;
|
|
@@ -2557,9 +2557,9 @@ function $1ea91dfed6983398$export$82a685f2da2fb027(a_element, product_id, recomm
|
|
|
2557
2557
|
async function $1ea91dfed6983398$export$2c34560c3749dc63(button, get_product_id, tracking_fn, unmatching_tracking, event) {
|
|
2558
2558
|
// @ts-ignore
|
|
2559
2559
|
if (!button || button.depict_tracked) return;
|
|
2560
|
-
button.addEventListener(event ? event : "click",
|
|
2560
|
+
button.addEventListener(event ? event : "click", $3b52ccc10510b32a$export$b3bbfd758f11cfa9(async e => {
|
|
2561
2561
|
if (!e.isTrusted) {
|
|
2562
|
-
|
|
2562
|
+
$7f95f77417d06249$export$de56f1198d121036("ignoring event", e, "because it's not user generated");
|
|
2563
2563
|
return;
|
|
2564
2564
|
}
|
|
2565
2565
|
const product_id = await get_product_id(undefined, e);
|
|
@@ -2576,8 +2576,8 @@ async function $1ea91dfed6983398$export$2c34560c3749dc63(button, get_product_id,
|
|
|
2576
2576
|
button.depict_tracked = true;
|
|
2577
2577
|
}
|
|
2578
2578
|
var $8b0f4f54739f2574$var$_globalThis$window;
|
|
2579
|
-
const $8b0f4f54739f2574$export$20e9533e68ee72e7 = /*@__PURE__
|
|
2580
|
-
const $8b0f4f54739f2574$export$a9d39e43ae273d26 = /*@__PURE__
|
|
2579
|
+
const $8b0f4f54739f2574$export$20e9533e68ee72e7 = /*@__PURE__*/$76a59c6ce18c8fd3$export$e806c6c1615a59ae(false);
|
|
2580
|
+
const $8b0f4f54739f2574$export$a9d39e43ae273d26 = /*@__PURE__*/$76a59c6ce18c8fd3$export$e806c6c1615a59ae();
|
|
2581
2581
|
const $8b0f4f54739f2574$export$7500cdfd37aafd43 = /*@__PURE__*/new Set();
|
|
2582
2582
|
let $8b0f4f54739f2574$var$old_url;
|
|
2583
2583
|
const $8b0f4f54739f2574$var$maybe_navigation = (what_happened, args) => {
|
|
@@ -2594,9 +2594,9 @@ const $8b0f4f54739f2574$var$maybe_navigation = (what_happened, args) => {
|
|
|
2594
2594
|
};
|
|
2595
2595
|
$8b0f4f54739f2574$export$baccefee4a395d8f((args, what_happened) => $8b0f4f54739f2574$var$maybe_navigation(what_happened, args));
|
|
2596
2596
|
$8b0f4f54739f2574$var$maybe_navigation();
|
|
2597
|
-
globalThis === null || globalThis === void 0 || ($8b0f4f54739f2574$var$_globalThis$window = globalThis.window) === null || $8b0f4f54739f2574$var$_globalThis$window === void 0 || $8b0f4f54739f2574$var$_globalThis$window.addEventListener("popstate",
|
|
2597
|
+
globalThis === null || globalThis === void 0 || ($8b0f4f54739f2574$var$_globalThis$window = globalThis.window) === null || $8b0f4f54739f2574$var$_globalThis$window === void 0 || $8b0f4f54739f2574$var$_globalThis$window.addEventListener("popstate", $3b52ccc10510b32a$export$b3bbfd758f11cfa9(e => $8b0f4f54739f2574$var$maybe_navigation("popstate", e)));
|
|
2598
2598
|
async function $8b0f4f54739f2574$export$1cd22bab0d2c3b0b(callback) {
|
|
2599
|
-
const catchified_callback =
|
|
2599
|
+
const catchified_callback = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(callback);
|
|
2600
2600
|
for await (const href of $8b0f4f54739f2574$export$20e9533e68ee72e7) {
|
|
2601
2601
|
catchified_callback(href);
|
|
2602
2602
|
break;
|
|
@@ -2618,7 +2618,7 @@ async function $8b0f4f54739f2574$export$baccefee4a395d8f(after_navigation) {
|
|
|
2618
2618
|
try {
|
|
2619
2619
|
after_navigation(arguments_list, the_thing);
|
|
2620
2620
|
} catch (e) {
|
|
2621
|
-
|
|
2621
|
+
$46b94b232dc792af$export$8048b892d651b310(e);
|
|
2622
2622
|
}
|
|
2623
2623
|
return nav_result;
|
|
2624
2624
|
}
|
|
@@ -2641,21 +2641,21 @@ async function $c15d2edce69e632a$export$eee4c4d924348b05(data) {
|
|
|
2641
2641
|
} = location;
|
|
2642
2642
|
if ($c15d2edce69e632a$var$last_page_pageview_sent_for !== href) {
|
|
2643
2643
|
$c15d2edce69e632a$var$last_page_pageview_sent_for = href;
|
|
2644
|
-
|
|
2644
|
+
$335c248bb07a3509$export$82badda1f9923310({
|
|
2645
2645
|
...data,
|
|
2646
2646
|
type: "page_view"
|
|
2647
2647
|
});
|
|
2648
|
-
if (data.product_id) await
|
|
2648
|
+
if (data.product_id) await $04bba294678834bc$export$836f70a28c317905(data.product_id); // this takes care of right click click attribution - broadcasts the URL of the current page
|
|
2649
2649
|
}
|
|
2650
2650
|
} catch (error) {
|
|
2651
|
-
|
|
2651
|
+
$3b52ccc10510b32a$export$f18d5b0af29128b7([error, "Sending page view failed"], "warning");
|
|
2652
2652
|
}
|
|
2653
2653
|
}
|
|
2654
2654
|
let $c15d2edce69e632a$var$sending_on_navigation = false;
|
|
2655
2655
|
async function $c15d2edce69e632a$export$f7cb1bd47199ec38(data) {
|
|
2656
2656
|
if (!$c15d2edce69e632a$var$sending_on_navigation) {
|
|
2657
2657
|
$c15d2edce69e632a$var$sending_on_navigation = true;
|
|
2658
|
-
|
|
2658
|
+
$3b52ccc10510b32a$export$b3bbfd758f11cfa9(async () => {
|
|
2659
2659
|
for await (const _href of (0, $8b0f4f54739f2574$export$a9d39e43ae273d26)) $c15d2edce69e632a$export$eee4c4d924348b05({
|
|
2660
2660
|
tenant: data.tenant,
|
|
2661
2661
|
market: data.market,
|
|
@@ -2710,7 +2710,7 @@ $parcel$export($2e81c18d82b25372$exports, "init_cookiebot_tracking", () => $2e81
|
|
|
2710
2710
|
var $2e81c18d82b25372$var$_consent_from_cookie;
|
|
2711
2711
|
const $2e81c18d82b25372$var$required_consent_level = process.env.DEPICT_TRACKING_CONSENT_LEVEL;
|
|
2712
2712
|
function $2e81c18d82b25372$var$consent_from_cookie() {
|
|
2713
|
-
const cookie =
|
|
2713
|
+
const cookie = $335c248bb07a3509$export$622991c71a1f52b3("CookieConsent");
|
|
2714
2714
|
if (!cookie) return;
|
|
2715
2715
|
const consent_json = cookie.replace(/%2C/g, ",").replace(/%27/g, "'").replace(/'/g, '"').replace(/([{[,])\s*([\w]+?):/g, '$1"$2":');
|
|
2716
2716
|
try {
|
|
@@ -2718,7 +2718,7 @@ function $2e81c18d82b25372$var$consent_from_cookie() {
|
|
|
2718
2718
|
} catch ({
|
|
2719
2719
|
message: message
|
|
2720
2720
|
}) {
|
|
2721
|
-
|
|
2721
|
+
$7f95f77417d06249$export$de56f1198d121036("Error parsing cookie json", consent_json, message);
|
|
2722
2722
|
return;
|
|
2723
2723
|
}
|
|
2724
2724
|
}
|
|
@@ -2732,10 +2732,10 @@ async function $2e81c18d82b25372$export$56c2e8be65fb14ae() {
|
|
|
2732
2732
|
}
|
|
2733
2733
|
function $2e81c18d82b25372$export$8827362e5e938d26() {
|
|
2734
2734
|
if ($2e81c18d82b25372$var$cookie_ipns) return $2e81c18d82b25372$var$cookie_ipns;
|
|
2735
|
-
$2e81c18d82b25372$var$cookie_ipns =
|
|
2735
|
+
$2e81c18d82b25372$var$cookie_ipns = $76a59c6ce18c8fd3$export$e806c6c1615a59ae();
|
|
2736
2736
|
const existing_consent = $2e81c18d82b25372$var$consent_from_cookie();
|
|
2737
2737
|
if (existing_consent) $2e81c18d82b25372$var$cookie_ipns(existing_consent);
|
|
2738
|
-
const consent_maybe_changed =
|
|
2738
|
+
const consent_maybe_changed = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => {
|
|
2739
2739
|
const {
|
|
2740
2740
|
consent: {
|
|
2741
2741
|
marketing: marketing,
|
|
@@ -2754,29 +2754,28 @@ function $2e81c18d82b25372$export$8827362e5e938d26() {
|
|
|
2754
2754
|
var _cookie_ipns$latest_c;
|
|
2755
2755
|
return ((_cookie_ipns$latest_c = $2e81c18d82b25372$var$cookie_ipns.latest_call_value) === null || _cookie_ipns$latest_c === void 0 ? void 0 : _cookie_ipns$latest_c[k]) === new_consent_obj[k];
|
|
2756
2756
|
})) {
|
|
2757
|
-
|
|
2757
|
+
$7f95f77417d06249$export$de56f1198d121036("Consent changed", new_consent_obj);
|
|
2758
2758
|
$2e81c18d82b25372$var$cookie_ipns(new_consent_obj);
|
|
2759
2759
|
}
|
|
2760
2760
|
}, "extracting consent failed");
|
|
2761
|
-
|
|
2761
|
+
$6bf620c74776aef6$export$2fc1a072736ae2f6(window, "Cookiebot", "consent").then(consent_maybe_changed);
|
|
2762
2762
|
["CookiebotOnAccept", "CookiebotOnDecline"].forEach(e => window.addEventListener(e, consent_maybe_changed, false));
|
|
2763
2763
|
return $2e81c18d82b25372$var$cookie_ipns;
|
|
2764
2764
|
}
|
|
2765
|
-
const $2e81c18d82b25372$export$abec7fd9f0b9cc22 = /*@__PURE__
|
|
2765
|
+
const $2e81c18d82b25372$export$abec7fd9f0b9cc22 = /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9(async function () {
|
|
2766
2766
|
let anon_id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "anonymous";
|
|
2767
|
-
|
|
2768
|
-
if (!$2e81c18d82b25372$var$required_consent_level) return
|
|
2767
|
+
$7f95f77417d06249$export$de56f1198d121036("Initializing Cookiebot tracking");
|
|
2768
|
+
if (!$2e81c18d82b25372$var$required_consent_level) return $7f95f77417d06249$export$de56f1198d121036("No consent level set for Depict tracking. Ignoring consent and tracking everything.");
|
|
2769
2769
|
const original_get_depict_id = (0, $335c248bb07a3509$export$6399bdb2291895e0);
|
|
2770
2770
|
const original_get_user_id = (0, $335c248bb07a3509$export$adc61a405a4cabed);
|
|
2771
|
-
|
|
2772
|
-
|
|
2771
|
+
$335c248bb07a3509$export$336e7ad40bae0652(() => $2e81c18d82b25372$var$has_consent ? original_get_depict_id() : anon_id);
|
|
2772
|
+
$335c248bb07a3509$export$8a96793bf9f87d90(() => $2e81c18d82b25372$var$has_consent ? original_get_user_id() : anon_id);
|
|
2773
2773
|
for await (const consent_obj of $2e81c18d82b25372$export$8827362e5e938d26()) {
|
|
2774
2774
|
// Changing this will change the return value of function given to set_depict_id_fn above
|
|
2775
2775
|
$2e81c18d82b25372$var$has_consent = consent_obj[$2e81c18d82b25372$var$required_consent_level];
|
|
2776
|
-
if (!$2e81c18d82b25372$var$has_consent)
|
|
2776
|
+
if (!$2e81c18d82b25372$var$has_consent) $7f95f77417d06249$export$de56f1198d121036('dsid/user_id will be set to, "'.concat(anon_id, '", until Cookiebot has consent for "').concat($2e81c18d82b25372$var$required_consent_level, '"'));else $7f95f77417d06249$export$de56f1198d121036('Cookiebot obtained consent for "'.concat($2e81c18d82b25372$var$required_consent_level, '", will use true dsid/user_id'));
|
|
2777
2777
|
}
|
|
2778
2778
|
});
|
|
2779
|
-
var $e9ab1681652f3fca$var$_consent_from_cookie;
|
|
2780
2779
|
const $e9ab1681652f3fca$var$required_consent_level = process.env.DEPICT_TRACKING_CONSENT_LEVEL;
|
|
2781
2780
|
/*
|
|
2782
2781
|
The Optanon cookie format can vary slightly between integrations. To figure out the key values used for a particular customer,
|
|
@@ -2793,7 +2792,7 @@ const $e9ab1681652f3fca$var$required_consent_level = process.env.DEPICT_TRACKING
|
|
|
2793
2792
|
const $e9ab1681652f3fca$var$KEY_ORDER = ["necessary", "statistics", "preferences", "marketing"];
|
|
2794
2793
|
const $e9ab1681652f3fca$var$OPTANON_TO_COOKIEBOT = Object.fromEntries((process.env.OPTANON_KEYS || "").split(",").filter(k => k).map((k, i) => [k, $e9ab1681652f3fca$var$KEY_ORDER[i]]));
|
|
2795
2794
|
function $e9ab1681652f3fca$var$consent_from_cookie() {
|
|
2796
|
-
const cookie =
|
|
2795
|
+
const cookie = $335c248bb07a3509$export$622991c71a1f52b3("OptanonConsent");
|
|
2797
2796
|
if (!cookie) return;
|
|
2798
2797
|
const groups = new URLSearchParams(cookie).get("groups") || "";
|
|
2799
2798
|
const matches = groups.matchAll(/(\w+):(\d)/g);
|
|
@@ -2802,7 +2801,7 @@ function $e9ab1681652f3fca$var$consent_from_cookie() {
|
|
|
2802
2801
|
return consent;
|
|
2803
2802
|
}
|
|
2804
2803
|
let $e9ab1681652f3fca$var$cookie_ipns;
|
|
2805
|
-
let $e9ab1681652f3fca$var$has_consent = $e9ab1681652f3fca$var$required_consent_level ?
|
|
2804
|
+
let $e9ab1681652f3fca$var$has_consent = /*@__PURE__*/(_consent_from_cookie => $e9ab1681652f3fca$var$required_consent_level ? ((_consent_from_cookie = $e9ab1681652f3fca$var$consent_from_cookie()) === null || _consent_from_cookie === void 0 ? void 0 : _consent_from_cookie[$e9ab1681652f3fca$var$required_consent_level]) || false : true)();
|
|
2806
2805
|
const $e9ab1681652f3fca$export$1dd9ce50e201eff1 = () => $e9ab1681652f3fca$var$has_consent;
|
|
2807
2806
|
async function $e9ab1681652f3fca$export$7a6d436e0782c6ed() {
|
|
2808
2807
|
for await (const consent_obj of $e9ab1681652f3fca$export$7e4427e80d5fc619()) return consent_obj[process.env.DEPICT_TRACKING_CONSENT_LEVEL];
|
|
@@ -2811,12 +2810,12 @@ async function $e9ab1681652f3fca$export$7a6d436e0782c6ed() {
|
|
|
2811
2810
|
}
|
|
2812
2811
|
function $e9ab1681652f3fca$export$7e4427e80d5fc619() {
|
|
2813
2812
|
if ($e9ab1681652f3fca$var$cookie_ipns) return $e9ab1681652f3fca$var$cookie_ipns;
|
|
2814
|
-
$e9ab1681652f3fca$var$cookie_ipns =
|
|
2813
|
+
$e9ab1681652f3fca$var$cookie_ipns = $76a59c6ce18c8fd3$export$e806c6c1615a59ae();
|
|
2815
2814
|
const existing_consent = $e9ab1681652f3fca$var$consent_from_cookie();
|
|
2816
2815
|
if (existing_consent !== null && existing_consent !== void 0 && existing_consent.necessary)
|
|
2817
2816
|
// If "necessary" isn't set, user hasn't actually given/withold consent yet.
|
|
2818
2817
|
$e9ab1681652f3fca$var$cookie_ipns(existing_consent);
|
|
2819
|
-
window.addEventListener("consent.onetrust",
|
|
2818
|
+
window.addEventListener("consent.onetrust", $3b52ccc10510b32a$export$b3bbfd758f11cfa9(evt => {
|
|
2820
2819
|
const c = evt;
|
|
2821
2820
|
// Cast because TS doesn't know about the forEach coming up
|
|
2822
2821
|
const consent_obj = {};
|
|
@@ -2833,36 +2832,36 @@ function $e9ab1681652f3fca$export$7e4427e80d5fc619() {
|
|
|
2833
2832
|
}));
|
|
2834
2833
|
return $e9ab1681652f3fca$var$cookie_ipns;
|
|
2835
2834
|
}
|
|
2836
|
-
const $e9ab1681652f3fca$export$f0f6c846d96fdbec = /*@__PURE__
|
|
2835
|
+
const $e9ab1681652f3fca$export$f0f6c846d96fdbec = /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9(async function () {
|
|
2837
2836
|
let anon_id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "anonymous";
|
|
2838
|
-
|
|
2839
|
-
if (!$e9ab1681652f3fca$var$required_consent_level) return
|
|
2837
|
+
$7f95f77417d06249$export$de56f1198d121036("Initializing OptAnon tracking");
|
|
2838
|
+
if (!$e9ab1681652f3fca$var$required_consent_level) return $7f95f77417d06249$export$de56f1198d121036("No consent level set for Depict tracking. Ignoring consent and tracking everything.");
|
|
2840
2839
|
const original_get_depict_id = (0, $335c248bb07a3509$export$6399bdb2291895e0);
|
|
2841
2840
|
const original_get_user_id = (0, $335c248bb07a3509$export$adc61a405a4cabed);
|
|
2842
|
-
|
|
2843
|
-
|
|
2841
|
+
$335c248bb07a3509$export$336e7ad40bae0652(() => $e9ab1681652f3fca$var$has_consent ? original_get_depict_id() : anon_id);
|
|
2842
|
+
$335c248bb07a3509$export$8a96793bf9f87d90(() => $e9ab1681652f3fca$var$has_consent ? original_get_user_id() : anon_id);
|
|
2844
2843
|
for await (const consent_obj of $e9ab1681652f3fca$export$7e4427e80d5fc619()) {
|
|
2845
2844
|
// Changing this will change the return value of function given to set_depict_id_fn above
|
|
2846
2845
|
$e9ab1681652f3fca$var$has_consent = consent_obj[$e9ab1681652f3fca$var$required_consent_level];
|
|
2847
|
-
if (!$e9ab1681652f3fca$var$has_consent)
|
|
2846
|
+
if (!$e9ab1681652f3fca$var$has_consent) $7f95f77417d06249$export$de56f1198d121036('dsid/user_id will be set to, "'.concat(anon_id, '", until Optanon has consent for "').concat($e9ab1681652f3fca$var$required_consent_level, '"'));else $7f95f77417d06249$export$de56f1198d121036('Optanon obtained consent for "'.concat($e9ab1681652f3fca$var$required_consent_level, '", will use true dsid/user_id'));
|
|
2848
2847
|
}
|
|
2849
2848
|
});
|
|
2850
2849
|
const $99b61a0622560fcf$var$g = typeof globalThis == "object" && globalThis || window;
|
|
2851
|
-
const $99b61a0622560fcf$export$f3354ec2ce95ebd9 = /*@__PURE__
|
|
2850
|
+
const $99b61a0622560fcf$export$f3354ec2ce95ebd9 = /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9(async (GA_ID, strict) => {
|
|
2852
2851
|
var _g$performance, _g$performance$getEnt, _g$performance$getEnt2, _g$performance$getEnt3;
|
|
2853
2852
|
if (process.env.GTAG === "false") return;
|
|
2854
2853
|
if (!GA_ID) {
|
|
2855
|
-
|
|
2854
|
+
$7f95f77417d06249$export$c2363754d4758444("Couldn't load gtag, GA_ID not specified", GA_ID);
|
|
2856
2855
|
return;
|
|
2857
2856
|
}
|
|
2858
2857
|
const required_consent_level = process.env.GTAG_LOADING_CONSENT_LEVEL;
|
|
2859
2858
|
if (required_consent_level !== undefined) {
|
|
2860
|
-
|
|
2861
|
-
const ipns = process.env.CONSENT_FRAMEWORK == "optanon" ?
|
|
2859
|
+
$7f95f77417d06249$export$de56f1198d121036("GTag loading waiting for consent level ".concat(required_consent_level));
|
|
2860
|
+
const ipns = process.env.CONSENT_FRAMEWORK == "optanon" ? $e9ab1681652f3fca$export$7e4427e80d5fc619() : $2e81c18d82b25372$export$8827362e5e938d26();
|
|
2862
2861
|
for await (const consent_status of ipns) {
|
|
2863
2862
|
const status_for_level = consent_status[required_consent_level];
|
|
2864
2863
|
if (status_for_level) {
|
|
2865
|
-
|
|
2864
|
+
$7f95f77417d06249$export$de56f1198d121036("got consent for", required_consent_level, "loading gtag");
|
|
2866
2865
|
break;
|
|
2867
2866
|
}
|
|
2868
2867
|
}
|
|
@@ -2872,13 +2871,13 @@ const $99b61a0622560fcf$export$f3354ec2ce95ebd9 = /*@__PURE__*/(0, $3b52ccc10510
|
|
|
2872
2871
|
const page_hasnt_loaded = ($99b61a0622560fcf$var$g === null || $99b61a0622560fcf$var$g === void 0 ? void 0 : (_g$performance = $99b61a0622560fcf$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;
|
|
2873
2872
|
// Source: comment on https://stackoverflow.com/a/53525488
|
|
2874
2873
|
// don't use readyState, source: personal experience and comment on https://stackoverflow.com/a/28093606
|
|
2875
|
-
|
|
2874
|
+
$7f95f77417d06249$export$de56f1198d121036("Loading gtag after " + (page_hasnt_loaded ? "pageload and " : "") + "3s" + (strict ? "" : ", but setting up queues already"));
|
|
2876
2875
|
if (!strict) $99b61a0622560fcf$export$d031e55ccd4c52dc(GA_ID);
|
|
2877
2876
|
if (page_hasnt_loaded) {
|
|
2878
2877
|
const load_event = await new Promise(r => window.addEventListener("load", r, {
|
|
2879
2878
|
once: true
|
|
2880
2879
|
}));
|
|
2881
|
-
|
|
2880
|
+
$7f95f77417d06249$export$de56f1198d121036("page has loaded", load_event);
|
|
2882
2881
|
}
|
|
2883
2882
|
await new Promise(r => setTimeout(r, 3000));
|
|
2884
2883
|
const script = document.createElement("script"),
|
|
@@ -2886,9 +2885,9 @@ const $99b61a0622560fcf$export$f3354ec2ce95ebd9 = /*@__PURE__*/(0, $3b52ccc10510
|
|
|
2886
2885
|
script.async = true;
|
|
2887
2886
|
script.src = "https://www.googletagmanager.com/gtag/js?id=" + GA_ID;
|
|
2888
2887
|
head.appendChild(script);
|
|
2889
|
-
|
|
2888
|
+
$7f95f77417d06249$export$de56f1198d121036("Loading gtag now", script);
|
|
2890
2889
|
});
|
|
2891
|
-
const $99b61a0622560fcf$export$d031e55ccd4c52dc = /*@__PURE__
|
|
2890
|
+
const $99b61a0622560fcf$export$d031e55ccd4c52dc = /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9(GA_ID => {
|
|
2892
2891
|
if (process.env.GTAG === "false") return;
|
|
2893
2892
|
$99b61a0622560fcf$var$g.dataLayer || ($99b61a0622560fcf$var$g.dataLayer = []);
|
|
2894
2893
|
function gtag() {
|
|
@@ -2899,9 +2898,9 @@ const $99b61a0622560fcf$export$d031e55ccd4c52dc = /*@__PURE__*/(0, $3b52ccc10510
|
|
|
2899
2898
|
$99b61a0622560fcf$var$g.gtag("config", GA_ID, {
|
|
2900
2899
|
"send_page_view": false
|
|
2901
2900
|
});
|
|
2902
|
-
|
|
2901
|
+
$7f95f77417d06249$export$de56f1198d121036("configuring gtag with", GA_ID);
|
|
2903
2902
|
});
|
|
2904
|
-
const $99b61a0622560fcf$export$7babcd5d4056b2ca = /*@__PURE__
|
|
2903
|
+
const $99b61a0622560fcf$export$7babcd5d4056b2ca = /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9(async (raw_displays, get_product_id, more) => {
|
|
2905
2904
|
const displays = raw_displays; // gtag tracking is "obsolete" and we don't expect any customers using something else than LegacyDisplay to use it
|
|
2906
2905
|
if (process.env.GTAG === "false") return;
|
|
2907
2906
|
if (process.env.GTAG_VIEW === "false") return;
|
|
@@ -2923,12 +2922,12 @@ const $99b61a0622560fcf$export$7babcd5d4056b2ca = /*@__PURE__*/(0, $3b52ccc10510
|
|
|
2923
2922
|
const gtag_args = ["event", "view_item_list", {
|
|
2924
2923
|
"items": gtag_items.slice(i, i + max_products_per_request)
|
|
2925
2924
|
}];
|
|
2926
|
-
|
|
2925
|
+
$7f95f77417d06249$export$de56f1198d121036("Sending product view to gtag", gtag_args);
|
|
2927
2926
|
$99b61a0622560fcf$var$g.gtag(...gtag_args);
|
|
2928
2927
|
}
|
|
2929
|
-
} else
|
|
2928
|
+
} else $7f95f77417d06249$export$c2363754d4758444("not sending gtag tracking as there is no gtag");
|
|
2930
2929
|
});
|
|
2931
|
-
const $99b61a0622560fcf$export$f522672c9379e339 = /*@__PURE__
|
|
2930
|
+
const $99b61a0622560fcf$export$f522672c9379e339 = /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9(async (product_id, index, more) => {
|
|
2932
2931
|
if (process.env.GTAG === "false") return;
|
|
2933
2932
|
if (process.env.GTAG_EVENT_CONSENT_LEVEL !== undefined && !(await $99b61a0622560fcf$var$can_send_gtag_events(product_id, index, more))) return;
|
|
2934
2933
|
if (typeof $99b61a0622560fcf$var$g.gtag == "function") {
|
|
@@ -2941,17 +2940,17 @@ const $99b61a0622560fcf$export$f522672c9379e339 = /*@__PURE__*/(0, $3b52ccc10510
|
|
|
2941
2940
|
...more
|
|
2942
2941
|
}]
|
|
2943
2942
|
}];
|
|
2944
|
-
|
|
2943
|
+
$7f95f77417d06249$export$de56f1198d121036("calling gtag with arguments", gtag_args);
|
|
2945
2944
|
return $99b61a0622560fcf$var$g.gtag(...gtag_args);
|
|
2946
|
-
} else
|
|
2945
|
+
} else $7f95f77417d06249$export$c2363754d4758444("not sending gtag tracking as there is no gtag");
|
|
2947
2946
|
});
|
|
2948
|
-
const $99b61a0622560fcf$export$f75172d2e289cd02 = /*@__PURE__
|
|
2947
|
+
const $99b61a0622560fcf$export$f75172d2e289cd02 = /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9(action => {
|
|
2949
2948
|
if (process.env.GA === "false") return;
|
|
2950
2949
|
if (typeof $99b61a0622560fcf$var$g.ga != "function") {
|
|
2951
|
-
|
|
2950
|
+
$7f95f77417d06249$export$c2363754d4758444("Not sending to ga as there is no ga");
|
|
2952
2951
|
return;
|
|
2953
2952
|
}
|
|
2954
|
-
|
|
2953
|
+
$7f95f77417d06249$export$de56f1198d121036("sending", action, "to GA");
|
|
2955
2954
|
return $99b61a0622560fcf$var$g.ga("depict.send", {
|
|
2956
2955
|
hitType: "event",
|
|
2957
2956
|
eventCategory: "Depict",
|
|
@@ -2960,36 +2959,36 @@ const $99b61a0622560fcf$export$f75172d2e289cd02 = /*@__PURE__*/(0, $3b52ccc10510
|
|
|
2960
2959
|
nonInteraction: 1
|
|
2961
2960
|
});
|
|
2962
2961
|
});
|
|
2963
|
-
const $99b61a0622560fcf$export$ac7296527cb52311 = /*@__PURE__
|
|
2962
|
+
const $99b61a0622560fcf$export$ac7296527cb52311 = /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9(GAID => {
|
|
2964
2963
|
if (process.env.GA === "false") return;
|
|
2965
2964
|
if (!GAID) {
|
|
2966
|
-
|
|
2965
|
+
$7f95f77417d06249$export$c2363754d4758444(new Error("No GAID specified"));
|
|
2967
2966
|
return;
|
|
2968
2967
|
}
|
|
2969
2968
|
if (typeof $99b61a0622560fcf$var$g.ga != "function") {
|
|
2970
|
-
|
|
2971
|
-
|
|
2969
|
+
$7f95f77417d06249$export$de56f1198d121036("Creating GA queue");
|
|
2970
|
+
$f812c921818adbe0$export$674d8cd8b6868154();
|
|
2972
2971
|
}
|
|
2973
|
-
|
|
2972
|
+
$7f95f77417d06249$export$de56f1198d121036("Creating ga with GA-ID", GAID);
|
|
2974
2973
|
$99b61a0622560fcf$var$g.ga("create", GAID, "auto", "depict");
|
|
2975
2974
|
$99b61a0622560fcf$export$f3354ec2ce95ebd9(GAID, false);
|
|
2976
2975
|
});
|
|
2977
|
-
const $99b61a0622560fcf$export$127751e82111fcf = /*@__PURE__
|
|
2978
|
-
const $99b61a0622560fcf$export$bf205937e5e012cb = /*@__PURE__
|
|
2976
|
+
const $99b61a0622560fcf$export$127751e82111fcf = /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => $99b61a0622560fcf$export$f75172d2e289cd02("rec_bar_click"));
|
|
2977
|
+
const $99b61a0622560fcf$export$bf205937e5e012cb = /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => $99b61a0622560fcf$export$f75172d2e289cd02("add_to_cart_after_rec_bar_click"));
|
|
2979
2978
|
async function $99b61a0622560fcf$var$can_send_gtag_events() {
|
|
2980
2979
|
const required_consent_level = process.env.GTAG_LOADING_CONSENT_LEVEL;
|
|
2981
2980
|
if (required_consent_level !== undefined) return true; // just in case
|
|
2982
|
-
const ipns = process.env.CONSENT_FRAMEWORK == "optanon" ?
|
|
2981
|
+
const ipns = process.env.CONSENT_FRAMEWORK == "optanon" ? $e9ab1681652f3fca$export$7e4427e80d5fc619() : $2e81c18d82b25372$export$8827362e5e938d26();
|
|
2983
2982
|
for (var _len = arguments.length, stuff_to_log = new Array(_len), _key = 0; _key < _len; _key++) stuff_to_log[_key] = arguments[_key];
|
|
2984
2983
|
for await (const consent_obj of ipns) {
|
|
2985
2984
|
const can_send = consent_obj[required_consent_level];
|
|
2986
|
-
if (!can_send)
|
|
2985
|
+
if (!can_send) $7f95f77417d06249$export$de56f1198d121036("Got no consent for", required_consent_level, "not sending gtag event for", ...stuff_to_log);
|
|
2987
2986
|
return can_send;
|
|
2988
2987
|
}
|
|
2989
2988
|
}
|
|
2990
2989
|
let $e45474c7d6e21cfa$var$existing_style_tag;
|
|
2991
2990
|
let $e45474c7d6e21cfa$var$reactions_in_last_s = 0;
|
|
2992
|
-
const $e45474c7d6e21cfa$export$59ba1eb2c083f0cd = /*@__PURE__
|
|
2991
|
+
const $e45474c7d6e21cfa$export$59ba1eb2c083f0cd = /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9(async css => {
|
|
2993
2992
|
const style_tag = await ($e45474c7d6e21cfa$var$existing_style_tag || ($e45474c7d6e21cfa$var$existing_style_tag = (0, $03c157d68c9fcbac$export$b6ae1bc530f4c149).wait_for_element("head").then(head => {
|
|
2994
2993
|
const tag = document.createElement("style");
|
|
2995
2994
|
(0, $03c157d68c9fcbac$export$b6ae1bc530f4c149).onremoved(
|
|
@@ -2999,16 +2998,16 @@ const $e45474c7d6e21cfa$export$59ba1eb2c083f0cd = /*@__PURE__*/(0, $3b52ccc10510
|
|
|
2999
2998
|
// just make sure to not freak out if it's already been added again
|
|
3000
2999
|
return;
|
|
3001
3000
|
if ($e45474c7d6e21cfa$var$reactions_in_last_s >= 10) {
|
|
3002
|
-
|
|
3001
|
+
$3b52ccc10510b32a$export$f18d5b0af29128b7(new Error("Someone removed our styling but insists on it (10 removals in previous second). Giving up \uD83D\uDE2B"), "error");
|
|
3003
3002
|
return;
|
|
3004
3003
|
}
|
|
3005
|
-
|
|
3004
|
+
$7f95f77417d06249$export$de56f1198d121036("Someone removed our styling \uD83D\uDE24, reinserting", eoe);
|
|
3006
3005
|
$e45474c7d6e21cfa$var$reactions_in_last_s++;
|
|
3007
3006
|
setTimeout(() => $e45474c7d6e21cfa$var$reactions_in_last_s--, 1000);
|
|
3008
3007
|
document.head.append(tag); // we're sure that head exists now since we inserted it there previously
|
|
3009
3008
|
});
|
|
3010
3009
|
|
|
3011
|
-
|
|
3010
|
+
$7f95f77417d06249$export$de56f1198d121036("inserting", tag, "into", head);
|
|
3012
3011
|
return head.appendChild(tag);
|
|
3013
3012
|
})));
|
|
3014
3013
|
style_tag.append(css);
|
|
@@ -3018,10 +3017,10 @@ const $e45474c7d6e21cfa$export$a96c18473f2af463 = (tenant, selector, validator)
|
|
|
3018
3017
|
let {
|
|
3019
3018
|
element: element
|
|
3020
3019
|
} = _ref;
|
|
3021
|
-
return
|
|
3020
|
+
return $1ea91dfed6983398$export$2c34560c3749dc63(element, tenant.get_product_id, (p_id, r_id, was_unmatching, event) => {
|
|
3022
3021
|
if (typeof validator === "function" && !validator(event)) return;
|
|
3023
|
-
if (!was_unmatching)
|
|
3024
|
-
|
|
3022
|
+
if (!was_unmatching) $99b61a0622560fcf$export$bf205937e5e012cb();
|
|
3023
|
+
$335c248bb07a3509$export$9028351cb994757e({
|
|
3025
3024
|
...tenant,
|
|
3026
3025
|
product_id: p_id,
|
|
3027
3026
|
...(was_unmatching ? {
|
|
@@ -3040,11 +3039,11 @@ const $e45474c7d6e21cfa$export$a4f97b27a0592e6c = url => {
|
|
|
3040
3039
|
const $e45474c7d6e21cfa$export$692b606677218a16 = callback => {
|
|
3041
3040
|
if (document.depictwashere) {
|
|
3042
3041
|
if (process.env.BUILD_TARGET === "dev") {
|
|
3043
|
-
|
|
3042
|
+
$7f95f77417d06249$export$de56f1198d121036("HMR tried to rerun us, reloading page");
|
|
3044
3043
|
/* eslint-disable no-self-assign */
|
|
3045
3044
|
location.href = location.href;
|
|
3046
3045
|
}
|
|
3047
|
-
|
|
3046
|
+
$7f95f77417d06249$export$de56f1198d121036("Script has already ran", document.currentScript, "is exiting");
|
|
3048
3047
|
return;
|
|
3049
3048
|
}
|
|
3050
3049
|
if (process.env.BUILD_TARGET === "dev") /* eslint-disable no-console */console.clear = new Proxy(console.clear, {
|
|
@@ -3067,26 +3066,26 @@ function $e45474c7d6e21cfa$export$328e81c44cddf3c0(callback, get_market, support
|
|
|
3067
3066
|
let localstorage_override;
|
|
3068
3067
|
const query_param_override = new URLSearchParams(location.search).get("depict-override-market");
|
|
3069
3068
|
if (query_param_override !== null) {
|
|
3070
|
-
|
|
3069
|
+
$7f95f77417d06249$export$de56f1198d121036("Found ?depict-override-market=".concat(query_param_override, ". Using that as the market"));
|
|
3071
3070
|
get_market = () => query_param_override;
|
|
3072
3071
|
localStorage.setItem("depict-override-market", query_param_override);
|
|
3073
3072
|
} else if ((localstorage_override = localStorage.getItem("depict-override-market")) !== null) {
|
|
3074
|
-
|
|
3073
|
+
$7f95f77417d06249$export$de56f1198d121036('Found depict-override-market="'.concat(localstorage_override, '" in localStorage. Using that as the market'));
|
|
3075
3074
|
get_market = () => localstorage_override;
|
|
3076
3075
|
}
|
|
3077
3076
|
}
|
|
3078
3077
|
const market = await get_market();
|
|
3079
3078
|
if (supported_markets.includes(market)) {
|
|
3080
|
-
|
|
3079
|
+
$7f95f77417d06249$export$de56f1198d121036("Initializing with market: ".concat(market));
|
|
3081
3080
|
return callback(market).catch((0, $46b94b232dc792af$export$8048b892d651b310));
|
|
3082
3081
|
} else if (unsupported_markets.includes(market)) {
|
|
3083
|
-
|
|
3082
|
+
$7f95f77417d06249$export$de56f1198d121036("Unsupported market: ".concat(market, ". Exiting..."));
|
|
3084
3083
|
return;
|
|
3085
3084
|
} else if (process.env.DEBUG === "true" && location.host.endsWith(".demo.depict.ai") && preferred_demo_market) {
|
|
3086
|
-
|
|
3085
|
+
$7f95f77417d06249$export$de56f1198d121036("On demosite with default market override. Setting market to ".concat(preferred_demo_market));
|
|
3087
3086
|
return callback(preferred_demo_market).catch((0, $46b94b232dc792af$export$8048b892d651b310));
|
|
3088
3087
|
} else {
|
|
3089
|
-
|
|
3088
|
+
$46b94b232dc792af$export$8048b892d651b310(new Error('Unknown market: "'.concat(market, '". Exiting...')));
|
|
3090
3089
|
return;
|
|
3091
3090
|
}
|
|
3092
3091
|
});
|
|
@@ -3107,9 +3106,9 @@ class $db6c2abf3fef4d7d$export$8d42ce4827f43582 {
|
|
|
3107
3106
|
this.TYPE = options.TYPE || "normal";
|
|
3108
3107
|
this.catchify = (0, $3b52ccc10510b32a$export$b3bbfd758f11cfa9);
|
|
3109
3108
|
this.err = (0, $46b94b232dc792af$export$8048b892d651b310);
|
|
3110
|
-
if (this.GA_ID)
|
|
3109
|
+
if (this.GA_ID) $99b61a0622560fcf$export$ac7296527cb52311(this.GA_ID);
|
|
3111
3110
|
// https://gitlab.com/depict-ai/depict.ai/-/merge_requests/2318#note_927887712
|
|
3112
|
-
this.get_product_id =
|
|
3111
|
+
this.get_product_id = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(function () {
|
|
3113
3112
|
const id = options.get_product_id(...arguments);
|
|
3114
3113
|
if (id instanceof Promise) return id.then(id => id || "");
|
|
3115
3114
|
return id || "";
|
|
@@ -3121,9 +3120,9 @@ class $db6c2abf3fef4d7d$export$8d42ce4827f43582 {
|
|
|
3121
3120
|
this.type = this.TYPE;
|
|
3122
3121
|
this.catchify = (0, $3b52ccc10510b32a$export$b3bbfd758f11cfa9);
|
|
3123
3122
|
this.err = (0, $46b94b232dc792af$export$8048b892d651b310);
|
|
3124
|
-
if (localStorage.getItem("highlight-depict") === "true")
|
|
3123
|
+
if (localStorage.getItem("highlight-depict") === "true") $e45474c7d6e21cfa$export$59ba1eb2c083f0cd(".depict { background: #f00a !important; }");
|
|
3125
3124
|
if ((_options$pageview_tra = options.pageview_tracking) !== null && _options$pageview_tra !== void 0 ? _options$pageview_tra : true) (async () => {
|
|
3126
|
-
|
|
3125
|
+
$c15d2edce69e632a$export$f7cb1bd47199ec38({
|
|
3127
3126
|
market: this.market,
|
|
3128
3127
|
tenant: this.tenant,
|
|
3129
3128
|
get_product_id: this.get_product_id
|
|
@@ -3150,7 +3149,7 @@ const $7c971cc277292c10$var$get_index_in_children_of_el = el => {
|
|
|
3150
3149
|
var _el$parentElement;
|
|
3151
3150
|
return [...((el === null || el === void 0 ? void 0 : (_el$parentElement = el.parentElement) === null || _el$parentElement === void 0 ? void 0 : _el$parentElement.children) || [])].indexOf(el);
|
|
3152
3151
|
};
|
|
3153
|
-
const $7c971cc277292c10$export$29a6094e0bd8bc5f = /*@__PURE__
|
|
3152
|
+
const $7c971cc277292c10$export$29a6094e0bd8bc5f = /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9(async (options, gtag_options) => {
|
|
3154
3153
|
var _options$t;
|
|
3155
3154
|
const {
|
|
3156
3155
|
product_selector: product_selector,
|
|
@@ -3187,14 +3186,14 @@ const $7c971cc277292c10$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $3b52ccc10510
|
|
|
3187
3186
|
const gtag_view_product_ids = {};
|
|
3188
3187
|
// Page view
|
|
3189
3188
|
if (t instanceof (0, $db6c2abf3fef4d7d$export$8d42ce4827f43582)) (async () => {
|
|
3190
|
-
|
|
3189
|
+
$c15d2edce69e632a$export$eee4c4d924348b05({
|
|
3191
3190
|
tenant: t.tenant,
|
|
3192
3191
|
market: t.market,
|
|
3193
3192
|
product_id: await t.get_product_id()
|
|
3194
3193
|
});
|
|
3195
3194
|
})();
|
|
3196
3195
|
// Product card
|
|
3197
|
-
const add_tracking_to_product_card =
|
|
3196
|
+
const add_tracking_to_product_card = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(async _ref => {
|
|
3198
3197
|
var _Object$keys;
|
|
3199
3198
|
let {
|
|
3200
3199
|
element: elem
|
|
@@ -3206,7 +3205,7 @@ const $7c971cc277292c10$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $3b52ccc10510
|
|
|
3206
3205
|
// Impression tracking
|
|
3207
3206
|
if (impression_tracking && !impression_tracked_els.has(elem)) {
|
|
3208
3207
|
impression_tracked_els.add(elem);
|
|
3209
|
-
|
|
3208
|
+
$89969f18db4020d7$export$37125ccc5dd98050({
|
|
3210
3209
|
element: elem,
|
|
3211
3210
|
data: {
|
|
3212
3211
|
recommendation_id: data.recommendation_id,
|
|
@@ -3239,12 +3238,12 @@ const $7c971cc277292c10$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $3b52ccc10510
|
|
|
3239
3238
|
index: index
|
|
3240
3239
|
})));
|
|
3241
3240
|
} catch (e) {
|
|
3242
|
-
|
|
3241
|
+
$7f95f77417d06249$export$c2363754d4758444("Something went wrong on a product with multiple ga_ids", e);
|
|
3243
3242
|
}
|
|
3244
3243
|
}
|
|
3245
3244
|
if (typeof BroadcastChannel == "function") {
|
|
3246
3245
|
// right click and mouse wheel click tracking
|
|
3247
|
-
const handler =
|
|
3246
|
+
const handler = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(e => $04bba294678834bc$export$8f66c4c7fb96eda2(e, data.product_id));
|
|
3248
3247
|
elem.addEventListener("contextmenu", handler);
|
|
3249
3248
|
elem.addEventListener("auxclick", e => e.button === 1 && handler(e)); // actual wheel click - some mouses / OS:es also dispatch auxclick on rightclick
|
|
3250
3249
|
}
|
|
@@ -3252,14 +3251,14 @@ const $7c971cc277292c10$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $3b52ccc10510
|
|
|
3252
3251
|
click_tracking: {
|
|
3253
3252
|
if (click_tracked_els.has(elem)) break click_tracking;
|
|
3254
3253
|
click_tracked_els.add(elem);
|
|
3255
|
-
elem.addEventListener("click",
|
|
3254
|
+
elem.addEventListener("click", $3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => {
|
|
3256
3255
|
const product_id = data.product_id || "DNT";
|
|
3257
3256
|
const recommendation_id = data.recommendation_id || "not_depict";
|
|
3258
3257
|
localStorage.setItem("depict_attribution_".concat(product_id), recommendation_id);
|
|
3259
3258
|
const index = $7c971cc277292c10$var$get_index_in_children_of_el(elem);
|
|
3260
3259
|
const click_location = prefix + (index + 1);
|
|
3261
|
-
|
|
3262
|
-
|
|
3260
|
+
$99b61a0622560fcf$export$127751e82111fcf();
|
|
3261
|
+
$335c248bb07a3509$export$15f8a0cd5a8c0ebb({
|
|
3263
3262
|
...(options.t || {}),
|
|
3264
3263
|
...options,
|
|
3265
3264
|
...data,
|
|
@@ -3273,7 +3272,7 @@ const $7c971cc277292c10$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $3b52ccc10510
|
|
|
3273
3272
|
list_name: gtag_list_name,
|
|
3274
3273
|
...gtag_options
|
|
3275
3274
|
};
|
|
3276
|
-
|
|
3275
|
+
$99b61a0622560fcf$export$f522672c9379e339(data.product_id, index, gtag_options_with_click_location);
|
|
3277
3276
|
try {
|
|
3278
3277
|
const to_iterate = [];
|
|
3279
3278
|
if (data.ga_product_id) {
|
|
@@ -3281,10 +3280,10 @@ const $7c971cc277292c10$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $3b52ccc10510
|
|
|
3281
3280
|
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 : []));
|
|
3282
3281
|
}
|
|
3283
3282
|
to_iterate.push(...(data.ga_product_ids || []));
|
|
3284
|
-
to_iterate.forEach(id =>
|
|
3283
|
+
to_iterate.forEach(id => $99b61a0622560fcf$export$f522672c9379e339(id, index, gtag_options_with_click_location));
|
|
3285
3284
|
} catch (e) {
|
|
3286
|
-
|
|
3287
|
-
|
|
3285
|
+
$7f95f77417d06249$export$c2363754d4758444("Something went wrong when sending gtag click tracking on a product with multiple ga_ids");
|
|
3286
|
+
$3b52ccc10510b32a$export$f18d5b0af29128b7(e, "error");
|
|
3288
3287
|
}
|
|
3289
3288
|
}
|
|
3290
3289
|
}), {
|
|
@@ -3314,8 +3313,8 @@ const $7c971cc277292c10$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $3b52ccc10510
|
|
|
3314
3313
|
});
|
|
3315
3314
|
element.dispatchEvent(click);
|
|
3316
3315
|
}
|
|
3317
|
-
|
|
3318
|
-
|
|
3316
|
+
$99b61a0622560fcf$export$bf205937e5e012cb();
|
|
3317
|
+
$335c248bb07a3509$export$9028351cb994757e({
|
|
3319
3318
|
...(options.t || {}),
|
|
3320
3319
|
...options,
|
|
3321
3320
|
...data
|
|
@@ -3328,11 +3327,11 @@ const $7c971cc277292c10$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $3b52ccc10510
|
|
|
3328
3327
|
if (options.shade) $7c971cc277292c10$export$6ebd242c09192cec(elem);
|
|
3329
3328
|
if (options.attempt_gtag_view_tracking && (_Object$keys = Object.keys(gtag_view_product_ids)) !== null && _Object$keys !== void 0 && _Object$keys.length)
|
|
3330
3329
|
// setTimeout to batch the requests / put it all into one gtag view event
|
|
3331
|
-
setTimeout(
|
|
3330
|
+
setTimeout($3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => {
|
|
3332
3331
|
for (const key in gtag_view_product_ids) {
|
|
3333
3332
|
const product_ids = gtag_view_product_ids[key];
|
|
3334
3333
|
if (product_ids !== null && product_ids !== void 0 && product_ids.length) {
|
|
3335
|
-
|
|
3334
|
+
$99b61a0622560fcf$export$7babcd5d4056b2ca(product_ids, () => "", {
|
|
3336
3335
|
list_name: key,
|
|
3337
3336
|
...gtag_options
|
|
3338
3337
|
});
|
|
@@ -3343,15 +3342,15 @@ const $7c971cc277292c10$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $3b52ccc10510
|
|
|
3343
3342
|
});
|
|
3344
3343
|
if (typeof product_selector == "string") (0, $03c157d68c9fcbac$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({
|
|
3345
3344
|
element: element
|
|
3346
|
-
});else
|
|
3345
|
+
});else $7f95f77417d06249$export$c2363754d4758444(new Error("AIO can't find elements, try adding a selector or els")); // don't throw so that a2c tracking keeps working
|
|
3347
3346
|
// Page A2C button tracking
|
|
3348
3347
|
const a2c_handler = _ref2 => {
|
|
3349
3348
|
let {
|
|
3350
3349
|
element: element
|
|
3351
3350
|
} = _ref2;
|
|
3352
|
-
|
|
3353
|
-
if (!was_unmatching)
|
|
3354
|
-
|
|
3351
|
+
$1ea91dfed6983398$export$2c34560c3749dc63(element, get_product_id, (product_id, recommendation_id, was_unmatching) => {
|
|
3352
|
+
if (!was_unmatching) $99b61a0622560fcf$export$bf205937e5e012cb();
|
|
3353
|
+
$335c248bb07a3509$export$9028351cb994757e({
|
|
3355
3354
|
...(options.t || {}),
|
|
3356
3355
|
...options,
|
|
3357
3356
|
product_id: product_id,
|
|
@@ -3366,7 +3365,7 @@ const $7c971cc277292c10$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $3b52ccc10510
|
|
|
3366
3365
|
};
|
|
3367
3366
|
if (typeof a2c_selector == "string") (0, $03c157d68c9fcbac$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({
|
|
3368
3367
|
element: element
|
|
3369
|
-
});else
|
|
3368
|
+
});else $7f95f77417d06249$export$c2363754d4758444(new Error("Can't find a2c button, try adding a selector or els"));
|
|
3370
3369
|
return {
|
|
3371
3370
|
add_a2c_element: element => a2c_handler({
|
|
3372
3371
|
element: element
|
|
@@ -3376,7 +3375,7 @@ const $7c971cc277292c10$export$29a6094e0bd8bc5f = /*@__PURE__*/(0, $3b52ccc10510
|
|
|
3376
3375
|
})
|
|
3377
3376
|
};
|
|
3378
3377
|
});
|
|
3379
|
-
const $7c971cc277292c10$export$6ebd242c09192cec = /*@__PURE__
|
|
3378
|
+
const $7c971cc277292c10$export$6ebd242c09192cec = /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9(element => {
|
|
3380
3379
|
element.style.boxShadow = "rgba(255,0,0,0.5) 10px 10px 30px 40px";
|
|
3381
3380
|
element.style.background = "rgba(255,0,0,0.5)";
|
|
3382
3381
|
element.style.color = "white";
|
|
@@ -3426,18 +3425,18 @@ async function $8f0b9bb45dd059c3$export$bcd70d5ed1cf6313(url, options) {
|
|
|
3426
3425
|
const response = await fetch(url, options);
|
|
3427
3426
|
if (!response || !response.ok || response.status !== 200) {
|
|
3428
3427
|
if (response.status === 422) {
|
|
3429
|
-
|
|
3428
|
+
$3b52ccc10510b32a$export$b3bbfd758f11cfa9($8f0b9bb45dd059c3$var$send_sentry_422)(response, (options === null || options === void 0 ? void 0 : options.body) || {}, stack);
|
|
3430
3429
|
has_succeeded = true;
|
|
3431
3430
|
} else if (response.status === 404) has_succeeded = true;
|
|
3432
|
-
|
|
3431
|
+
$7f95f77417d06249$export$de56f1198d121036("Response not ok", response);
|
|
3433
3432
|
} else has_succeeded = true;
|
|
3434
3433
|
result = response;
|
|
3435
3434
|
} catch (error) {
|
|
3436
|
-
|
|
3435
|
+
$7f95f77417d06249$export$de56f1198d121036("Error while fetching: ", error, url, options);
|
|
3437
3436
|
// Don't retry CORS
|
|
3438
3437
|
if (error.message.includes("CORS") && error.name.includes("CORS")) has_succeeded = true;
|
|
3439
3438
|
} finally {
|
|
3440
|
-
if (!has_succeeded) await
|
|
3439
|
+
if (!has_succeeded) await $1a15d4d13e0d0cf9$export$5c069c93d2b7493f(try_again_in_ms);
|
|
3441
3440
|
try_again_in_ms = calculate_retry(try_again_in_ms);
|
|
3442
3441
|
max_retries -= 1;
|
|
3443
3442
|
}
|
|
@@ -3446,12 +3445,12 @@ async function $8f0b9bb45dd059c3$export$bcd70d5ed1cf6313(url, options) {
|
|
|
3446
3445
|
async function $8f0b9bb45dd059c3$var$send_sentry_422(response, body, stack) {
|
|
3447
3446
|
const msg = "Validation error: got 422 from API";
|
|
3448
3447
|
const text = await response.clone().text();
|
|
3449
|
-
|
|
3448
|
+
$7f95f77417d06249$export$de56f1198d121036(msg, "body", body, "response", response, "text", text, "stack", stack);
|
|
3450
3449
|
(0, $902c0e005afb7319$export$af2e17a20c2ea3c5).withScope(function (scope) {
|
|
3451
3450
|
scope.setExtra("stack", stack);
|
|
3452
3451
|
scope.setExtra("request_body", body);
|
|
3453
3452
|
scope.setExtra("response", response);
|
|
3454
|
-
scope.setExtra("serialized_response",
|
|
3453
|
+
scope.setExtra("serialized_response", $a1dd43178e1da976$export$39d526a1194b6499(response));
|
|
3455
3454
|
scope.setExtra("response_text", text);
|
|
3456
3455
|
scope.setLevel("error");
|
|
3457
3456
|
this.captureException(new Error(msg));
|
|
@@ -3464,8 +3463,8 @@ async function $d72c9a0d8e9c5a95$export$1bc0df10745d5412(t, options, headers) {
|
|
|
3464
3463
|
}
|
|
3465
3464
|
async function $d72c9a0d8e9c5a95$export$d40679eb4cf32f09(t, options, headers) {
|
|
3466
3465
|
let get_url = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : $d72c9a0d8e9c5a95$var$default_get_fetch_url;
|
|
3467
|
-
const dsid =
|
|
3468
|
-
const session_id = options.session_id ||
|
|
3466
|
+
const dsid = $335c248bb07a3509$export$6399bdb2291895e0();
|
|
3467
|
+
const session_id = options.session_id || $335c248bb07a3509$export$61e7e1f11e96692f();
|
|
3469
3468
|
const user_id = options.user_id || dsid;
|
|
3470
3469
|
const body = {
|
|
3471
3470
|
tenant: t.tenant,
|
|
@@ -3477,17 +3476,17 @@ async function $d72c9a0d8e9c5a95$export$d40679eb4cf32f09(t, options, headers) {
|
|
|
3477
3476
|
...options
|
|
3478
3477
|
};
|
|
3479
3478
|
const endpoint = $d72c9a0d8e9c5a95$var$get_fetch_endpoint_from_options(options);
|
|
3480
|
-
return await
|
|
3479
|
+
return await $8f0b9bb45dd059c3$export$bcd70d5ed1cf6313(get_url(endpoint), {
|
|
3481
3480
|
body: JSON.stringify(body),
|
|
3482
3481
|
...(headers ? {
|
|
3483
3482
|
headers: headers
|
|
3484
3483
|
} : {}),
|
|
3485
3484
|
method: "POST"
|
|
3486
3485
|
}) // @ts-ignore
|
|
3487
|
-
.then(r => r.json()).catch(e =>
|
|
3486
|
+
.then(r => r.json()).catch(e => $7f95f77417d06249$export$de56f1198d121036("fetch_retry threw", e));
|
|
3488
3487
|
}
|
|
3489
3488
|
function $d72c9a0d8e9c5a95$var$default_get_fetch_url(type) {
|
|
3490
|
-
return
|
|
3489
|
+
return $045fb30107c9eecc$export$fe609f0216e4ebef("".concat((0, $62869a3ed703f236$export$362abebb4b313340), "/v2/recommend/products/").concat(type));
|
|
3491
3490
|
}
|
|
3492
3491
|
function $d72c9a0d8e9c5a95$var$get_fetch_endpoint_from_options(options) {
|
|
3493
3492
|
if (options["category_id"] !== undefined) return "category";else if (options["product_id"] !== undefined) return "product";else if (options["product_ids"] !== undefined) return "products";
|
|
@@ -3501,7 +3500,7 @@ async function $8f0d01ff20cfba68$export$a9fc160c5ed83bd7(t, rendering_options) {
|
|
|
3501
3500
|
} = rendering_options;
|
|
3502
3501
|
const displays = await $8f0d01ff20cfba68$var$make_sure_we_have_displays(t, rendering_options);
|
|
3503
3502
|
if (!(displays !== null && displays !== void 0 && displays.length)) {
|
|
3504
|
-
|
|
3503
|
+
$7f95f77417d06249$export$de56f1198d121036("RR: Got no displays for type " + type + ", can't recover.", t, rendering_options);
|
|
3505
3504
|
return {};
|
|
3506
3505
|
}
|
|
3507
3506
|
// return if too few displays
|
|
@@ -3512,19 +3511,19 @@ async function $8f0d01ff20cfba68$export$a9fc160c5ed83bd7(t, rendering_options) {
|
|
|
3512
3511
|
if (!good_displays) return {};
|
|
3513
3512
|
const processed_displays = await $8f0d01ff20cfba68$export$c22e610107c5a15a(t, rendering_options, displays);
|
|
3514
3513
|
if (!processed_displays.length) {
|
|
3515
|
-
|
|
3514
|
+
$7f95f77417d06249$export$de56f1198d121036("RR: No displays left after preprocessing");
|
|
3516
3515
|
return {};
|
|
3517
3516
|
}
|
|
3518
3517
|
const {
|
|
3519
3518
|
template: template,
|
|
3520
3519
|
post_processors = []
|
|
3521
3520
|
} = rendering_options;
|
|
3522
|
-
const caught_post_processing_functions = post_processors.map(post_pro =>
|
|
3521
|
+
const caught_post_processing_functions = post_processors.map(post_pro => $3b52ccc10510b32a$export$b3bbfd758f11cfa9(post_pro));
|
|
3523
3522
|
let a;
|
|
3524
|
-
const caught_html2elems =
|
|
3523
|
+
const caught_html2elems = $3b52ccc10510b32a$export$b3bbfd758f11cfa9((0, $8b27923e1d1e6b99$export$44951404cb8d0583));
|
|
3525
3524
|
let output_elements;
|
|
3526
3525
|
if (typeof template === "function") {
|
|
3527
|
-
const caught_template =
|
|
3526
|
+
const caught_template = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(template);
|
|
3528
3527
|
output_elements = (await Promise.allSettled(processed_displays.map(async (display, index) => {
|
|
3529
3528
|
const event_listeners = [];
|
|
3530
3529
|
let keep = true;
|
|
@@ -3545,7 +3544,7 @@ async function $8f0d01ff20cfba68$export$a9fc160c5ed83bd7(t, rendering_options) {
|
|
|
3545
3544
|
return Array.from(post_processed_elements);
|
|
3546
3545
|
}))).flat();
|
|
3547
3546
|
if (!output_elements.length) {
|
|
3548
|
-
|
|
3547
|
+
$7f95f77417d06249$export$de56f1198d121036("RR: No displays left after postprocessing/rendering");
|
|
3549
3548
|
return {};
|
|
3550
3549
|
}
|
|
3551
3550
|
return {
|
|
@@ -3612,7 +3611,7 @@ async function $8f0d01ff20cfba68$export$c22e610107c5a15a(t, rendering_options, d
|
|
|
3612
3611
|
max_items: max_items,
|
|
3613
3612
|
pre_processors = []
|
|
3614
3613
|
} = rendering_options;
|
|
3615
|
-
const caught_pre_processors = pre_processors.map(pre_pro =>
|
|
3614
|
+
const caught_pre_processors = pre_processors.map(pre_pro => $3b52ccc10510b32a$export$b3bbfd758f11cfa9(pre_pro));
|
|
3616
3615
|
const processed_displays = [];
|
|
3617
3616
|
for (let i = 0; i < displays.length; i++) {
|
|
3618
3617
|
// classic for loop is both fast and can be stopped with break
|
|
@@ -3651,7 +3650,7 @@ class $8f0d01ff20cfba68$export$da854280fb61cd32 {
|
|
|
3651
3650
|
async function $8f0d01ff20cfba68$var$check_displays(displays, min_items_to_run) {
|
|
3652
3651
|
// don't run if too few recs
|
|
3653
3652
|
if (min_items_to_run && displays.length < min_items_to_run) {
|
|
3654
|
-
|
|
3653
|
+
$7f95f77417d06249$export$de56f1198d121036("RR: Got too few displays, exiting");
|
|
3655
3654
|
return false;
|
|
3656
3655
|
}
|
|
3657
3656
|
return true;
|
|
@@ -3668,7 +3667,7 @@ async function $8f0d01ff20cfba68$var$make_sure_we_have_displays(t, rendering_opt
|
|
|
3668
3667
|
...(rendering_options.extra_api_options || {})
|
|
3669
3668
|
};
|
|
3670
3669
|
for (const key of ["product_ids", "category_id", "product_id"]) if (key in rendering_options) get_displays_options[key] = rendering_options[key];
|
|
3671
|
-
return await
|
|
3670
|
+
return await $d72c9a0d8e9c5a95$export$1bc0df10745d5412(t, get_displays_options, rendering_options.headers || {}).catch(t.err);
|
|
3672
3671
|
}
|
|
3673
3672
|
async function $b764ad4e777fb225$export$c83d8da642b5104a(t, options, GWVM_opts) {
|
|
3674
3673
|
const {
|
|
@@ -3688,8 +3687,8 @@ async function $b764ad4e777fb225$export$c83d8da642b5104a(t, options, GWVM_opts)
|
|
|
3688
3687
|
only_full_rows = false,
|
|
3689
3688
|
should_preload = true
|
|
3690
3689
|
} = GWVM_opts;
|
|
3691
|
-
const outer_els = typeof container_template === "string" ? [
|
|
3692
|
-
const [root] =
|
|
3690
|
+
const outer_els = typeof container_template === "string" ? [...$8b27923e1d1e6b99$export$44951404cb8d0583(container_template)] : container_template;
|
|
3691
|
+
const [root] = $8b27923e1d1e6b99$export$5e63aea0cac01fa0(outer_els, container_selector);
|
|
3693
3692
|
const cut_off_promise_obj = /*@__PURE__*/new (0, $f3ec1bb29cf43251$export$32ccf3a614c84258)();
|
|
3694
3693
|
const i_observer = new IntersectionObserver(catchify($b764ad4e777fb225$var$observer_callback));
|
|
3695
3694
|
let cut_off_point = 0;
|
|
@@ -3732,8 +3731,8 @@ async function $b764ad4e777fb225$export$c83d8da642b5104a(t, options, GWVM_opts)
|
|
|
3732
3731
|
return rendering_results;
|
|
3733
3732
|
}
|
|
3734
3733
|
root.append(...rendered_elements);
|
|
3735
|
-
const load_more_cont =
|
|
3736
|
-
const button_element = button instanceof Element ? button :
|
|
3734
|
+
const load_more_cont = $8b27923e1d1e6b99$export$d3e2a0560cbf4787('<div class="load-more-container"></div>');
|
|
3735
|
+
const button_element = button instanceof Element ? button : $8b27923e1d1e6b99$export$d3e2a0560cbf4787('<button class="load_more">'.concat(button || "Visa mer", "</button>"));
|
|
3737
3736
|
button_element.addEventListener("click", load_more);
|
|
3738
3737
|
load_more_cont.append(button_element);
|
|
3739
3738
|
root.after(load_more_cont);
|
|
@@ -3754,7 +3753,7 @@ async function $b764ad4e777fb225$export$c83d8da642b5104a(t, options, GWVM_opts)
|
|
|
3754
3753
|
load_more_observer.observe(load_more_cont);
|
|
3755
3754
|
}
|
|
3756
3755
|
if (title) {
|
|
3757
|
-
const [title_el] =
|
|
3756
|
+
const [title_el] = $8b27923e1d1e6b99$export$5e63aea0cac01fa0(outer_els, title_selector || "h1.title");
|
|
3758
3757
|
if (title_el) {
|
|
3759
3758
|
if (title instanceof Element) title_el.replaceWith(title);else title_el.innerText = title;
|
|
3760
3759
|
} else if (is_debug) {
|
|
@@ -3795,7 +3794,7 @@ info, cut_off_point, i_observer, cut_off_promise_obj, load_more) {
|
|
|
3795
3794
|
const extras = info.extras || (info.extras = {});
|
|
3796
3795
|
extras.load_more || (extras.load_more = load_more);
|
|
3797
3796
|
extras.load_more_ipo || (extras.load_more_ipo = cut_off_promise_obj);
|
|
3798
|
-
|
|
3797
|
+
$8b27923e1d1e6b99$export$5e63aea0cac01fa0(elements_arr, "img:not(.filler):not(.ngl):not(.nolazy)").forEach(image => {
|
|
3799
3798
|
var _image$src, _image$dataset, _image$src2, _image$src2$substr;
|
|
3800
3799
|
// "img" also selects "image" in IE11 which can be an SVG element which doesn't have a src property, therefore optional chaining
|
|
3801
3800
|
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:") {
|
|
@@ -3861,7 +3860,7 @@ async function $8cdb31ce9b00f5a0$export$41de2959a8dd405d(t, options, GWVM_opts)
|
|
|
3861
3860
|
if (!parentElement) {
|
|
3862
3861
|
var _result2, _rec;
|
|
3863
3862
|
// first rec was removed
|
|
3864
|
-
[rec] =
|
|
3863
|
+
[rec] = $8b27923e1d1e6b99$export$5e63aea0cac01fa0(((_result2 = result) === null || _result2 === void 0 ? void 0 : _result2.elements) || [], rec_selector);
|
|
3865
3864
|
parentElement = (_rec = rec) === null || _rec === void 0 ? void 0 : _rec.parentElement;
|
|
3866
3865
|
if (!parentElement) throw new Error("Could not find element matching " + rec_selector + "to calculate width");
|
|
3867
3866
|
}
|
|
@@ -3898,7 +3897,7 @@ async function $8cdb31ce9b00f5a0$export$41de2959a8dd405d(t, options, GWVM_opts)
|
|
|
3898
3897
|
}
|
|
3899
3898
|
};
|
|
3900
3899
|
// @ts-ignore
|
|
3901
|
-
result = await
|
|
3900
|
+
result = await $b764ad4e777fb225$export$c83d8da642b5104a(t, options, modified_GWVM_opts);
|
|
3902
3901
|
if (!((_result4 = result) !== null && _result4 !== void 0 && _result4.elements))
|
|
3903
3902
|
// no chance in finding any elements, API didn't return recs
|
|
3904
3903
|
return result;
|
|
@@ -3963,28 +3962,28 @@ async function $a0ab88605730ded3$export$c0a4d29bc45a38c6(t, options, GWVM_opts)
|
|
|
3963
3962
|
$a0ab88605730ded3$var$observe_first_el_after_dominsertion(all_rendered_elements, elements, info.extras.load_more);
|
|
3964
3963
|
return elements;
|
|
3965
3964
|
}];
|
|
3966
|
-
return await
|
|
3965
|
+
return await $8cdb31ce9b00f5a0$export$41de2959a8dd405d(t, options, options_for_auto_gwvm, {
|
|
3967
3966
|
rec_selector: rec_selector
|
|
3968
3967
|
});
|
|
3969
3968
|
}
|
|
3970
3969
|
function $a0ab88605730ded3$var$observe_first_el_after_dominsertion(all_rendered_elements, elements, load_more) {
|
|
3971
3970
|
const element = $a0ab88605730ded3$var$find_html_element(elements);
|
|
3972
3971
|
if (!element) {
|
|
3973
|
-
|
|
3972
|
+
$7f95f77417d06249$export$de56f1198d121036("Infinite scroll won't work, couldn't find element to observe", elements);
|
|
3974
3973
|
return;
|
|
3975
3974
|
}
|
|
3976
|
-
(0, $03c157d68c9fcbac$export$b6ae1bc530f4c149).wait_for_element(element).then(
|
|
3975
|
+
(0, $03c157d68c9fcbac$export$b6ae1bc530f4c149).wait_for_element(element).then($3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => {
|
|
3977
3976
|
$a0ab88605730ded3$var$find_last_el_and_observe(all_rendered_elements, load_more);
|
|
3978
3977
|
}));
|
|
3979
3978
|
}
|
|
3980
3979
|
function $a0ab88605730ded3$var$find_last_el_and_observe(all_rendered_elements, load_more) {
|
|
3981
3980
|
const last_visible_el = $a0ab88605730ded3$var$find_last_visible(all_rendered_elements);
|
|
3982
3981
|
if (!last_visible_el) return;
|
|
3983
|
-
const i_o = new IntersectionObserver(
|
|
3982
|
+
const i_o = new IntersectionObserver($3b52ccc10510b32a$export$b3bbfd758f11cfa9(records => {
|
|
3984
3983
|
for (const record of records) if (record.isIntersecting) {
|
|
3985
|
-
|
|
3984
|
+
$7f95f77417d06249$export$de56f1198d121036("loading more because of", record);
|
|
3986
3985
|
load_more();
|
|
3987
|
-
setTimeout(
|
|
3986
|
+
setTimeout($3b52ccc10510b32a$export$b3bbfd758f11cfa9($a0ab88605730ded3$var$find_last_el_and_observe), 0, all_rendered_elements, load_more);
|
|
3988
3987
|
i_o.disconnect();
|
|
3989
3988
|
}
|
|
3990
3989
|
}));
|
|
@@ -4002,26 +4001,26 @@ function $a0ab88605730ded3$var$find_last_visible(bunch_of_elements) {
|
|
|
4002
4001
|
for (let i = 0; i < considered_elements.length; i++) {
|
|
4003
4002
|
const respected_element = considered_elements[i];
|
|
4004
4003
|
if (!respected_element) {
|
|
4005
|
-
|
|
4004
|
+
$7f95f77417d06249$export$de56f1198d121036("Infinite scroll error: couldn't find last visible element", bunch_of_elements);
|
|
4006
4005
|
return;
|
|
4007
4006
|
}
|
|
4008
4007
|
if (respected_element.offsetParent === null) {
|
|
4009
4008
|
if (!i) {
|
|
4010
4009
|
// 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
|
|
4011
|
-
|
|
4010
|
+
$7f95f77417d06249$export$de56f1198d121036("Inf scroll: No elements visible, ", considered_elements, "will attach to first el", respected_element);
|
|
4012
4011
|
return considered_elements[i];
|
|
4013
4012
|
}
|
|
4014
4013
|
return considered_elements[i - 1];
|
|
4015
4014
|
}
|
|
4016
4015
|
}
|
|
4017
|
-
|
|
4016
|
+
$7f95f77417d06249$export$de56f1198d121036("Seems like all elements are loaded");
|
|
4018
4017
|
}
|
|
4019
4018
|
async function $033efa5601489887$export$9eae832ae57fbf(t, css, extra_html) {
|
|
4020
4019
|
const head = await (0, $03c157d68c9fcbac$export$b6ae1bc530f4c149).wait_for_element("head"),
|
|
4021
4020
|
{
|
|
4022
4021
|
dlog: dlog
|
|
4023
4022
|
} = t,
|
|
4024
|
-
elems =
|
|
4023
|
+
elems = $8b27923e1d1e6b99$export$44951404cb8d0583('<style type="text/css">'.concat(css, "</style>") + (extra_html ? extra_html : ""));
|
|
4025
4024
|
dlog("inserting", ...elems, "into", head);
|
|
4026
4025
|
head.append(...elems);
|
|
4027
4026
|
}
|
|
@@ -4055,7 +4054,7 @@ async function $628cae9fd43bb48b$var$placeholder_worker(placeholder_elements, fi
|
|
|
4055
4054
|
}
|
|
4056
4055
|
} else {
|
|
4057
4056
|
await sanit_el_if_needed();
|
|
4058
|
-
placeholder_elements[0].addEventListener("placeholder_switch",
|
|
4057
|
+
placeholder_elements[0].addEventListener("placeholder_switch", $9cefb304a1734a6b$export$535946eb77c946dd(async e => {
|
|
4059
4058
|
const new_state = e.detail.state;
|
|
4060
4059
|
if (state != new_state) {
|
|
4061
4060
|
await sanit_el_if_needed();
|
|
@@ -4075,7 +4074,7 @@ async function $628cae9fd43bb48b$var$decide_direction_and_switch(placeholder_ele
|
|
|
4075
4074
|
if (switch_to_final) $628cae9fd43bb48b$var$switch_elements(placeholder_elements, final_elements);else $628cae9fd43bb48b$var$switch_elements(final_elements, placeholder_elements);
|
|
4076
4075
|
}
|
|
4077
4076
|
function $628cae9fd43bb48b$var$switch_elements(from, to) {
|
|
4078
|
-
if (!from.length || !to.length)
|
|
4077
|
+
if (!from.length || !to.length) $7f95f77417d06249$export$c2363754d4758444("Cannot switch elements as from or to is empty", from, to);
|
|
4079
4078
|
from[0].replaceWith(...to);
|
|
4080
4079
|
for (let i = 1; i < from.length; i++) from[i].remove();
|
|
4081
4080
|
}
|
|
@@ -4108,11 +4107,11 @@ class $bc463df3122a418b$export$3be7054c61590ee3 {
|
|
|
4108
4107
|
// 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
|
|
4109
4108
|
if (!this.container && !override_container) return;
|
|
4110
4109
|
const container = override_container !== null && override_container !== void 0 ? override_container : this.container;
|
|
4111
|
-
const mutation_observer = new MutationObserver(
|
|
4110
|
+
const mutation_observer = new MutationObserver($3b52ccc10510b32a$export$b3bbfd758f11cfa9(mutations => {
|
|
4112
4111
|
for (let i = 0; i < mutations.length; i++) {
|
|
4113
|
-
const matching_added_els =
|
|
4112
|
+
const matching_added_els = $8b27923e1d1e6b99$export$5e63aea0cac01fa0(mutations[i].addedNodes, this.selector);
|
|
4114
4113
|
if (matching_added_els.length) {
|
|
4115
|
-
if (
|
|
4114
|
+
if ($parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bc463df3122a418b$var$_verbose)) $7f95f77417d06249$export$de56f1198d121036("New elements", matching_added_els, " matching selector", this.selector, "were aded to", container, "lazyloading…");
|
|
4116
4115
|
this.lazyfinder.elements.push(...matching_added_els);
|
|
4117
4116
|
matching_added_els.forEach($bc463df3122a418b$var$_classPrivateMethodGet(this, $bc463df3122a418b$var$_initiate_new_image, $bc463df3122a418b$var$_initiate_new_image2).bind(this));
|
|
4118
4117
|
}
|
|
@@ -4177,15 +4176,15 @@ class $bc463df3122a418b$export$3be7054c61590ee3 {
|
|
|
4177
4176
|
}
|
|
4178
4177
|
}
|
|
4179
4178
|
},
|
|
4180
|
-
load:
|
|
4179
|
+
load: $3b52ccc10510b32a$export$b3bbfd758f11cfa9(async image => {
|
|
4181
4180
|
for (const element of [...$bc463df3122a418b$export$e4741190ccada479(image, "source"), image]) {
|
|
4182
4181
|
var _document, _document$body, _document$body$contai, _document$body2, _element$dataset, _element$dataset$src, _element$dataset2, _element$dataset2$src;
|
|
4183
4182
|
if ("loaded" in element) {
|
|
4184
|
-
if (
|
|
4183
|
+
if ($parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(class_this, $bc463df3122a418b$var$_verbose)) $7f95f77417d06249$export$de56f1198d121036(element, "is already loading, not loading again");
|
|
4185
4184
|
continue;
|
|
4186
4185
|
}
|
|
4187
4186
|
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) {
|
|
4188
|
-
if (
|
|
4187
|
+
if ($parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(class_this, $bc463df3122a418b$var$_verbose)) $7f95f77417d06249$export$de56f1198d121036(element, "has been removed from the DOM, can't load");
|
|
4189
4188
|
const {
|
|
4190
4189
|
elements: elements
|
|
4191
4190
|
} = class_this.lazyfinder;
|
|
@@ -4196,13 +4195,13 @@ class $bc463df3122a418b$export$3be7054c61590ee3 {
|
|
|
4196
4195
|
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;
|
|
4197
4196
|
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;
|
|
4198
4197
|
if (has_src || has_srcset) {
|
|
4199
|
-
if (
|
|
4198
|
+
if ($parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(class_this, $bc463df3122a418b$var$_verbose)) $7f95f77417d06249$export$de56f1198d121036("Loading", element);
|
|
4200
4199
|
element.loaded = false;
|
|
4201
4200
|
// here it's of importance that we give the browser the srcset first, otherwise it (safari) might start loading the fallback src at first
|
|
4202
4201
|
if (has_srcset) {
|
|
4203
4202
|
// 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
|
|
4204
4203
|
if (!element.sizes) await new Promise(resolve => {
|
|
4205
|
-
const mo = new MutationObserver(
|
|
4204
|
+
const mo = new MutationObserver($3b52ccc10510b32a$export$b3bbfd758f11cfa9(_records => {
|
|
4206
4205
|
if (element.sizes) {
|
|
4207
4206
|
resolve();
|
|
4208
4207
|
mo.disconnect();
|
|
@@ -4212,7 +4211,7 @@ class $bc463df3122a418b$export$3be7054c61590ee3 {
|
|
|
4212
4211
|
attributes: true,
|
|
4213
4212
|
attributeFilter: ["sizes"]
|
|
4214
4213
|
});
|
|
4215
|
-
setTimeout(
|
|
4214
|
+
setTimeout($3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => {
|
|
4216
4215
|
resolve(); // in case ResizeObserver doesn't set .sizes or something
|
|
4217
4216
|
mo.disconnect();
|
|
4218
4217
|
}));
|
|
@@ -4229,7 +4228,7 @@ class $bc463df3122a418b$export$3be7054c61590ee3 {
|
|
|
4229
4228
|
var _element$src, _element$src$startsWi, _element$src2;
|
|
4230
4229
|
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;
|
|
4231
4230
|
// This happens quite often for reasons unknown. One day we will figure out why, or replace this lazyloader with a new one/native.
|
|
4232
|
-
if (
|
|
4231
|
+
if ($parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(class_this, $bc463df3122a418b$var$_verbose)) $7f95f77417d06249$export$de56f1198d121036("Cannot load", element, "as it doesn't have a data-src or data-srcset attribute");
|
|
4233
4232
|
}
|
|
4234
4233
|
}
|
|
4235
4234
|
}),
|
|
@@ -4251,20 +4250,20 @@ class $bc463df3122a418b$export$3be7054c61590ee3 {
|
|
|
4251
4250
|
this.selector = selector;
|
|
4252
4251
|
this.only_load_intersecting = only_load_intersecting;
|
|
4253
4252
|
this.ignore_data_urls = ignore_data_urls;
|
|
4254
|
-
if (verbose)
|
|
4253
|
+
if (verbose) $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldSet)(this, $bc463df3122a418b$var$_verbose, true);
|
|
4255
4254
|
// make sure we have a fully-fledged lazyfinder but still allow max customizability
|
|
4256
|
-
this.lazyfinder = lazyfinder || (lazyfinder =
|
|
4257
|
-
(_lazyfinder = lazyfinder).unload || (_lazyfinder.unload =
|
|
4258
|
-
(_lazyfinder2 = lazyfinder).load || (_lazyfinder2.load =
|
|
4259
|
-
if (!("elements" in lazyfinder)) Object.defineProperty(lazyfinder, "elements", Object.getOwnPropertyDescriptor(
|
|
4255
|
+
this.lazyfinder = lazyfinder || (lazyfinder = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bc463df3122a418b$var$_default_lazyfinder));
|
|
4256
|
+
(_lazyfinder = lazyfinder).unload || (_lazyfinder.unload = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bc463df3122a418b$var$_default_lazyfinder).unload);
|
|
4257
|
+
(_lazyfinder2 = lazyfinder).load || (_lazyfinder2.load = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bc463df3122a418b$var$_default_lazyfinder).load);
|
|
4258
|
+
if (!("elements" in lazyfinder)) Object.defineProperty(lazyfinder, "elements", Object.getOwnPropertyDescriptor($parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bc463df3122a418b$var$_default_lazyfinder), "elements"));
|
|
4260
4259
|
$bc463df3122a418b$var$_classPrivateMethodGet(this, $bc463df3122a418b$var$_unload_images_and_add_load_listeners, $bc463df3122a418b$var$_unload_images_and_add_load_listeners2).call(this);
|
|
4261
4260
|
// check if we need to branch off to an async function and wait for the elements being in the DOM
|
|
4262
4261
|
if (wait_for_dominsertion) {
|
|
4263
|
-
const caught_start_obs =
|
|
4262
|
+
const caught_start_obs = $3b52ccc10510b32a$export$b3bbfd758f11cfa9($bc463df3122a418b$var$_classPrivateMethodGet(this, $bc463df3122a418b$var$_start_observer, $bc463df3122a418b$var$_start_observer2)).bind(this);
|
|
4264
4263
|
if (wait_for_dominsertion instanceof Promise) wait_for_dominsertion.then(caught_start_obs);else {
|
|
4265
4264
|
var _lazyfinder3, _lazyfinder3$elements;
|
|
4266
4265
|
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]);
|
|
4267
|
-
if (el_to_listen_on instanceof Node) (0, $03c157d68c9fcbac$export$b6ae1bc530f4c149).wait_for_element(el_to_listen_on).then(caught_start_obs);else
|
|
4266
|
+
if (el_to_listen_on instanceof Node) (0, $03c157d68c9fcbac$export$b6ae1bc530f4c149).wait_for_element(el_to_listen_on).then(caught_start_obs);else $7f95f77417d06249$export$de56f1198d121036("Could not find element to attach event listener to", () => {}); // right click function in inspector and select "jump to definition" to get here
|
|
4268
4267
|
}
|
|
4269
4268
|
} else $bc463df3122a418b$var$_classPrivateMethodGet(this, $bc463df3122a418b$var$_start_observer, $bc463df3122a418b$var$_start_observer2).call(this);
|
|
4270
4269
|
}
|
|
@@ -4272,23 +4271,23 @@ class $bc463df3122a418b$export$3be7054c61590ee3 {
|
|
|
4272
4271
|
function $bc463df3122a418b$var$_initiate_new_image2(image) {
|
|
4273
4272
|
var _this$intersection_ob, _this$intersection_ob2;
|
|
4274
4273
|
if (image.loaded === true || image.loaded === false) {
|
|
4275
|
-
if (
|
|
4274
|
+
if ($parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bc463df3122a418b$var$_verbose)) $7f95f77417d06249$export$de56f1198d121036("Not lazyloading", image, "because it was loaded before or is loading");
|
|
4276
4275
|
return;
|
|
4277
4276
|
}
|
|
4278
|
-
|
|
4277
|
+
$3b52ccc10510b32a$export$b3bbfd758f11cfa9(this.lazyfinder.unload)(image);
|
|
4279
4278
|
$bc463df3122a418b$var$_classPrivateMethodGet(this, $bc463df3122a418b$var$_add_load_event_listener, $bc463df3122a418b$var$_add_load_event_listener2).call(this, image);
|
|
4280
4279
|
(_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
|
|
4281
4280
|
}
|
|
4282
4281
|
|
|
4283
4282
|
function $bc463df3122a418b$var$_add_load_event_listener2(element) {
|
|
4284
|
-
const handler =
|
|
4283
|
+
const handler = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(e => {
|
|
4285
4284
|
// cookiebot triggers random "load" events on all elements which make the images load before the intersection observer has started
|
|
4286
4285
|
if (!element.src.length) {
|
|
4287
|
-
|
|
4286
|
+
$7f95f77417d06249$export$de56f1198d121036("ignoring load event", e, "because image doesn't have a src");
|
|
4288
4287
|
return;
|
|
4289
4288
|
}
|
|
4290
4289
|
if (this.ignore_data_urls && element.src.startsWith("data:")) {
|
|
4291
|
-
if (
|
|
4290
|
+
if ($parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bc463df3122a418b$var$_verbose)) $7f95f77417d06249$export$de56f1198d121036("Ignoring load event", e, "because ignore_data_urls is truthy");
|
|
4292
4291
|
return;
|
|
4293
4292
|
}
|
|
4294
4293
|
element.removeEventListener("load", handler);
|
|
@@ -4302,7 +4301,7 @@ function $bc463df3122a418b$var$_unload_images_and_add_load_listeners2() {
|
|
|
4302
4301
|
elements: elements,
|
|
4303
4302
|
unload: unload
|
|
4304
4303
|
} = this.lazyfinder;
|
|
4305
|
-
const caught_unload =
|
|
4304
|
+
const caught_unload = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(unload);
|
|
4306
4305
|
for (let i = 0; i < elements.length; i++) {
|
|
4307
4306
|
caught_unload(elements[i]);
|
|
4308
4307
|
$bc463df3122a418b$var$_classPrivateMethodGet(this, $bc463df3122a418b$var$_add_load_event_listener, $bc463df3122a418b$var$_add_load_event_listener2).call(this, elements[i]);
|
|
@@ -4311,7 +4310,7 @@ function $bc463df3122a418b$var$_unload_images_and_add_load_listeners2() {
|
|
|
4311
4310
|
function $bc463df3122a418b$var$_start_observer2() {
|
|
4312
4311
|
let observers_first_call = true;
|
|
4313
4312
|
if (!this.intersection_observer) {
|
|
4314
|
-
this.intersection_observer = new IntersectionObserver(
|
|
4313
|
+
this.intersection_observer = new IntersectionObserver($3b52ccc10510b32a$export$b3bbfd758f11cfa9(entries => {
|
|
4315
4314
|
let any_intersected = false;
|
|
4316
4315
|
for (let i = 0; i < entries.length; i++) {
|
|
4317
4316
|
const entry = entries[i];
|
|
@@ -4321,13 +4320,13 @@ function $bc463df3122a418b$var$_start_observer2() {
|
|
|
4321
4320
|
if (target.loaded == null)
|
|
4322
4321
|
// if it's false it's already loading
|
|
4323
4322
|
this.lazyfinder.load(target);
|
|
4324
|
-
if (observers_first_call)
|
|
4323
|
+
if (observers_first_call) $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bc463df3122a418b$var$_images_on_first_page).push(target);
|
|
4325
4324
|
}
|
|
4326
4325
|
}
|
|
4327
4326
|
if (any_intersected) observers_first_call = false;
|
|
4328
4327
|
}), {
|
|
4329
4328
|
root: this.container,
|
|
4330
|
-
threshold:
|
|
4329
|
+
threshold: $4e1f5263dceb9802$export$f8ea2e7b15b5d129(3)
|
|
4331
4330
|
});
|
|
4332
4331
|
const {
|
|
4333
4332
|
elements: elements
|
|
@@ -4345,8 +4344,8 @@ function $bc463df3122a418b$var$_check_if_first_page_has_loaded2() {
|
|
|
4345
4344
|
var _elements$length;
|
|
4346
4345
|
if (elements[i].loaded === true) loaded_images.push(elements[i]);else not_loaded_or_loading.push(elements[i]);
|
|
4347
4346
|
}
|
|
4348
|
-
if (
|
|
4349
|
-
const caught_loading_fin =
|
|
4347
|
+
if ($parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $bc463df3122a418b$var$_images_on_first_page).length >= loaded_images.length) {
|
|
4348
|
+
const caught_loading_fin = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(this.lazyfinder.load);
|
|
4350
4349
|
for (let i = 0; i < not_loaded_or_loading.length; i++) caught_loading_fin(not_loaded_or_loading[i]);
|
|
4351
4350
|
}
|
|
4352
4351
|
}
|
|
@@ -4372,9 +4371,9 @@ function $bc463df3122a418b$export$e4741190ccada479(element, selector) {
|
|
|
4372
4371
|
}
|
|
4373
4372
|
return result;
|
|
4374
4373
|
}
|
|
4375
|
-
const $51b78ec2cb40f07e$export$eb0b9ed911409b57 = (callback, element) => (
|
|
4374
|
+
const $51b78ec2cb40f07e$export$eb0b9ed911409b57 = (callback, element) => ($3b52ccc10510b32a$export$b3bbfd758f11cfa9(callback)(element), element);
|
|
4376
4375
|
function $51b78ec2cb40f07e$export$f63fcc839cb0f734(event, handler, element) {
|
|
4377
|
-
element.addEventListener(event,
|
|
4376
|
+
element.addEventListener(event, $3b52ccc10510b32a$export$b3bbfd758f11cfa9(handler));
|
|
4378
4377
|
return element;
|
|
4379
4378
|
}
|
|
4380
4379
|
const $51b78ec2cb40f07e$export$22a65337c1b43b1f = /* @PURE */classes => classes.filter(c => c !== undefined).join(" ");
|
|
@@ -4407,7 +4406,7 @@ const $f0d9ae7bf9bd697d$export$34b9dba7ce09269b = (tag, _ref, _unknown) => {
|
|
|
4407
4406
|
const element = is_svg ? document.createElementNS(namespace, tag) : document.createElement(tag);
|
|
4408
4407
|
for (const key in props) {
|
|
4409
4408
|
const value = props[key];
|
|
4410
|
-
if (key === "onClick") element.addEventListener("click",
|
|
4409
|
+
if (key === "onClick") element.addEventListener("click", $3b52ccc10510b32a$export$b3bbfd758f11cfa9(value));else if (key.startsWith("xlink:"))
|
|
4411
4410
|
// https://stackoverflow.com/a/23142447
|
|
4412
4411
|
// https://developer.mozilla.org/en-US/docs/Web/SVG/Namespaces_Crash_Course
|
|
4413
4412
|
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]);
|
|
@@ -4459,7 +4458,7 @@ class $08a94efe56c2b35f$export$692b27c28639e5b9 {
|
|
|
4459
4458
|
var _target$parentElement;
|
|
4460
4459
|
const {
|
|
4461
4460
|
el_to_number_: el_to_number_
|
|
4462
|
-
} =
|
|
4461
|
+
} = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_index_cache);
|
|
4463
4462
|
const value_from_cache = el_to_number_.get(target);
|
|
4464
4463
|
if (value_from_cache) return value_from_cache;
|
|
4465
4464
|
const children = target === null || target === void 0 ? void 0 : (_target$parentElement = target.parentElement) === null || _target$parentElement === void 0 ? void 0 : _target$parentElement.children;
|
|
@@ -4479,7 +4478,7 @@ class $08a94efe56c2b35f$export$692b27c28639e5b9 {
|
|
|
4479
4478
|
}
|
|
4480
4479
|
get index_of_last_element() {
|
|
4481
4480
|
var _classPrivateFieldGet2, _classPrivateFieldGet3, _this$first_intersect, _this$first_intersect2, _this$first_intersect3, _this$first_intersect4, _this$first_intersect5, _classPrivateFieldGet4, _classPrivateFieldGet5, _classPrivateFieldGet6;
|
|
4482
|
-
return (_classPrivateFieldGet3 = (_classPrivateFieldGet2 =
|
|
4481
|
+
return (_classPrivateFieldGet3 = (_classPrivateFieldGet2 = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$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 = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$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;
|
|
4483
4482
|
}
|
|
4484
4483
|
get currently_selected() {
|
|
4485
4484
|
// this tries to be what distance_to assumes is the current card when converting a relative offset into an absolute one, available for plugins
|
|
@@ -4489,7 +4488,7 @@ class $08a94efe56c2b35f$export$692b27c28639e5b9 {
|
|
|
4489
4488
|
visible_sizes: visible_sizes
|
|
4490
4489
|
} = this;
|
|
4491
4490
|
let left_offset = 0;
|
|
4492
|
-
const rectangle_of_container =
|
|
4491
|
+
const rectangle_of_container = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_elements).sliding_el_.getBoundingClientRect();
|
|
4493
4492
|
const middle_of_container = rectangle_of_container.width / 2;
|
|
4494
4493
|
for (const [element, info] of visible_sizes) {
|
|
4495
4494
|
left_offset += info.total_visible;
|
|
@@ -4500,11 +4499,11 @@ class $08a94efe56c2b35f$export$692b27c28639e5b9 {
|
|
|
4500
4499
|
} else return this.first_intersecting_index(0.9);
|
|
4501
4500
|
}
|
|
4502
4501
|
get visible_sizes() {
|
|
4503
|
-
if (
|
|
4502
|
+
if ($parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_cached_visible_sizes)) return $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_cached_visible_sizes);
|
|
4504
4503
|
const visible_sizes = new Map();
|
|
4505
4504
|
const visible_cards = Object.keys(this.intersecting_items_object).map(key => +key);
|
|
4506
4505
|
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);
|
|
4507
|
-
const root_el =
|
|
4506
|
+
const root_el = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_elements).sliding_el_;
|
|
4508
4507
|
const root = root_el.getBoundingClientRect();
|
|
4509
4508
|
const root_computed_style = getComputedStyle(root_el);
|
|
4510
4509
|
const root_left = root.left - parseInt(root_computed_style.marginLeft);
|
|
@@ -4540,9 +4539,9 @@ class $08a94efe56c2b35f$export$692b27c28639e5b9 {
|
|
|
4540
4539
|
rect: card
|
|
4541
4540
|
});
|
|
4542
4541
|
}
|
|
4543
|
-
|
|
4542
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldSet)(this, $08a94efe56c2b35f$var$_cached_visible_sizes, visible_sizes);
|
|
4544
4543
|
// 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
|
|
4545
|
-
queueMicrotask(
|
|
4544
|
+
queueMicrotask($3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldSet)(this, $08a94efe56c2b35f$var$_cached_visible_sizes, undefined)));
|
|
4546
4545
|
return visible_sizes;
|
|
4547
4546
|
}
|
|
4548
4547
|
get cards_fitting_in_viewport() {
|
|
@@ -4569,25 +4568,25 @@ class $08a94efe56c2b35f$export$692b27c28639e5b9 {
|
|
|
4569
4568
|
// }
|
|
4570
4569
|
element_by_index(index) {
|
|
4571
4570
|
var _ref;
|
|
4572
|
-
const from_cache =
|
|
4571
|
+
const from_cache = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_index_cache).number_to_el_.get(index);
|
|
4573
4572
|
if (from_cache) return from_cache;
|
|
4574
4573
|
const {
|
|
4575
4574
|
sliding_el_: sliding_el_
|
|
4576
|
-
} =
|
|
4575
|
+
} = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_elements);
|
|
4577
4576
|
let maybe_el = (_ref = [...((sliding_el_ === null || sliding_el_ === void 0 ? void 0 : sliding_el_.children) || [])], _ref === void 0) ? void 0 : _ref[index];
|
|
4578
4577
|
if (!maybe_el) {
|
|
4579
4578
|
var _ref2, _this$first_intersect6, _this$first_intersect7, _this$first_intersect8;
|
|
4580
4579
|
// this is for plantagen which has a double whammy slider
|
|
4581
4580
|
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];
|
|
4582
4581
|
}
|
|
4583
|
-
|
|
4582
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_index_cache).number_to_el_.set(index, maybe_el);
|
|
4584
4583
|
return maybe_el;
|
|
4585
4584
|
}
|
|
4586
4585
|
invalidate_cache() {
|
|
4587
4586
|
// dlog("Invalidating index cache");
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4587
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_index_cache).number_to_el_.clear();
|
|
4588
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_index_cache).el_to_number_.clear();
|
|
4589
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_index_cache).last_el_ = undefined;
|
|
4591
4590
|
}
|
|
4592
4591
|
scroll_to_rel(offset) {
|
|
4593
4592
|
let harsh = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
@@ -4619,39 +4618,39 @@ class $08a94efe56c2b35f$export$692b27c28639e5b9 {
|
|
|
4619
4618
|
$08a94efe56c2b35f$var$_classPrivateMethodInitSpec(this, $08a94efe56c2b35f$var$_hide_buttons_if_needed);
|
|
4620
4619
|
$08a94efe56c2b35f$var$_classPrivateMethodInitSpec(this, $08a94efe56c2b35f$var$_observer_callback);
|
|
4621
4620
|
$08a94efe56c2b35f$var$_classPrivateMethodInitSpec(this, $08a94efe56c2b35f$var$_observe_element);
|
|
4622
|
-
|
|
4621
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersdefineProperty)(this, "container", $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("div", {
|
|
4623
4622
|
class: "depict-slider depict"
|
|
4624
4623
|
}));
|
|
4625
4624
|
$08a94efe56c2b35f$var$_classPrivateFieldInitSpec(this, $08a94efe56c2b35f$var$_elements, {
|
|
4626
4625
|
writable: true,
|
|
4627
4626
|
value: {
|
|
4628
|
-
sliding_el_:
|
|
4627
|
+
sliding_el_: $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("div", {
|
|
4629
4628
|
class: "sliding"
|
|
4630
4629
|
}),
|
|
4631
|
-
left_:
|
|
4630
|
+
left_: $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("button", {
|
|
4632
4631
|
"aria-label": "Scroll left",
|
|
4633
4632
|
class: "left d-navbutton",
|
|
4634
4633
|
type: "button"
|
|
4635
4634
|
}),
|
|
4636
|
-
right_:
|
|
4635
|
+
right_: $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("button", {
|
|
4637
4636
|
"aria-label": "Scroll right",
|
|
4638
4637
|
class: "right d-navbutton",
|
|
4639
4638
|
type: "button"
|
|
4640
4639
|
})
|
|
4641
4640
|
}
|
|
4642
4641
|
});
|
|
4643
|
-
|
|
4644
|
-
|
|
4642
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersdefineProperty)(this, "insert_here", $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_elements).sliding_el_);
|
|
4643
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersdefineProperty)(this, "intersecting_items_object", {});
|
|
4645
4644
|
$08a94efe56c2b35f$var$_classPrivateFieldInitSpec(this, $08a94efe56c2b35f$var$_mutation_plugins, {
|
|
4646
4645
|
writable: true,
|
|
4647
4646
|
value: []
|
|
4648
4647
|
});
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4648
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersdefineProperty)(this, "stepstoslide", 2);
|
|
4649
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersdefineProperty)(this, "dist_to_hide_left", 10);
|
|
4650
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersdefineProperty)(this, "dist_to_hide_right", 10);
|
|
4651
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersdefineProperty)(this, "center_target", false);
|
|
4652
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersdefineProperty)(this, "correct_bs_targets", true);
|
|
4653
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersdefineProperty)(this, "on_elements_changed", [$08a94efe56c2b35f$var$_classPrivateMethodGet(this, $08a94efe56c2b35f$var$_observe_element, $08a94efe56c2b35f$var$_observe_element2)]);
|
|
4655
4654
|
$08a94efe56c2b35f$var$_classPrivateFieldInitSpec(this, $08a94efe56c2b35f$var$_index_cache, {
|
|
4656
4655
|
writable: true,
|
|
4657
4656
|
value: {
|
|
@@ -4664,30 +4663,30 @@ class $08a94efe56c2b35f$export$692b27c28639e5b9 {
|
|
|
4664
4663
|
writable: true,
|
|
4665
4664
|
value: void 0
|
|
4666
4665
|
});
|
|
4667
|
-
|
|
4668
|
-
root:
|
|
4669
|
-
threshold:
|
|
4666
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersdefineProperty)(this, "observer", new IntersectionObserver($08a94efe56c2b35f$var$_classPrivateMethodGet(this, $08a94efe56c2b35f$var$_observer_callback, $08a94efe56c2b35f$var$_observer_callback2).bind(this), {
|
|
4667
|
+
root: $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_elements).sliding_el_,
|
|
4668
|
+
threshold: $4e1f5263dceb9802$export$f8ea2e7b15b5d129(100)
|
|
4670
4669
|
}));
|
|
4671
|
-
|
|
4670
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersdefineProperty)(this, "observe", this.observer.observe.bind(this.observer));
|
|
4672
4671
|
dist_to_hide_left && (this.dist_to_hide_left = dist_to_hide_left);
|
|
4673
4672
|
dist_to_hide_right && (this.dist_to_hide_right = dist_to_hide_right);
|
|
4674
4673
|
stepstoslide && (this.stepstoslide = stepstoslide);
|
|
4675
4674
|
center_target && (this.center_target = true);
|
|
4676
|
-
_mutation_plugins2 &&
|
|
4675
|
+
_mutation_plugins2 && $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldSet)(this, $08a94efe56c2b35f$var$_mutation_plugins, _mutation_plugins2);
|
|
4677
4676
|
correct_bs_targets == false && (this.correct_bs_targets = correct_bs_targets);
|
|
4678
4677
|
if (button_elems) {
|
|
4679
|
-
|
|
4680
|
-
|
|
4678
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_elements).right_ = button_elems.right;
|
|
4679
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_elements).left_ = button_elems.left;
|
|
4681
4680
|
}
|
|
4682
|
-
if (button_contents !== null && button_contents !== void 0 && button_contents.right)
|
|
4683
|
-
if (button_contents !== null && button_contents !== void 0 && button_contents.left)
|
|
4684
|
-
|
|
4681
|
+
if (button_contents !== null && button_contents !== void 0 && button_contents.right) $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_elements).right_.append(...button_contents.right);
|
|
4682
|
+
if (button_contents !== null && button_contents !== void 0 && button_contents.left) $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_elements).left_.append(...button_contents.left);
|
|
4683
|
+
$3b52ccc10510b32a$export$b3bbfd758f11cfa9($08a94efe56c2b35f$var$_classPrivateMethodGet(this, $08a94efe56c2b35f$var$_create_element_structure, $08a94efe56c2b35f$var$_create_element_structure2)).call(this, autoinvalidate_cache);
|
|
4685
4684
|
// @ts-ignore
|
|
4686
|
-
|
|
4685
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_elements).sliding_el_.slider = this; // dunno if this is dumb? So far nordicagolf/kondomvaruhuset depend on it
|
|
4687
4686
|
// plugin functionality i.e. for dots
|
|
4688
4687
|
const constructor_args = arguments;
|
|
4689
4688
|
constructor_plugins === null || constructor_plugins === void 0 || (_constructor_plugins$ = constructor_plugins.forEach) === null || _constructor_plugins$ === void 0 || _constructor_plugins$.call(constructor_plugins, mplugin => {
|
|
4690
|
-
|
|
4689
|
+
$3b52ccc10510b32a$export$b3bbfd758f11cfa9(mplugin).call(this, constructor_args);
|
|
4691
4690
|
});
|
|
4692
4691
|
}
|
|
4693
4692
|
}
|
|
@@ -4697,7 +4696,7 @@ function $08a94efe56c2b35f$var$_observe_element2(records) {
|
|
|
4697
4696
|
} = this;
|
|
4698
4697
|
const {
|
|
4699
4698
|
sliding_el_: sliding_el_
|
|
4700
|
-
} =
|
|
4699
|
+
} = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_elements);
|
|
4701
4700
|
for (const record of records) {
|
|
4702
4701
|
for (const node of record.addedNodes) if (node instanceof Element && node.parentElement === sliding_el_) observer.observe(node);
|
|
4703
4702
|
for (const node of record.removedNodes) if (node instanceof Element && node.parentElement === sliding_el_) observer.unobserve(node);
|
|
@@ -4713,16 +4712,16 @@ function $08a94efe56c2b35f$var$_observer_callback2(entries) {
|
|
|
4713
4712
|
const rec_idx = this.get_index_of_element(target);
|
|
4714
4713
|
if (entry.intersectionRatio <= 0) {
|
|
4715
4714
|
for (const key in intersecting_items) if (intersecting_items[key].target === target) delete intersecting_items[key];
|
|
4716
|
-
} else if (rec_idx != null) intersecting_items[rec_idx] = entry;else
|
|
4715
|
+
} else if (rec_idx != null) intersecting_items[rec_idx] = entry;else $7f95f77417d06249$export$de56f1198d121036("Could not find index of", target, "ignoring observer record");
|
|
4717
4716
|
}
|
|
4718
|
-
|
|
4719
|
-
const mutation_plugins =
|
|
4720
|
-
for (let i = 0; i < mutation_plugins.length; i++)
|
|
4717
|
+
$3b52ccc10510b32a$export$b3bbfd758f11cfa9($08a94efe56c2b35f$var$_classPrivateMethodGet(this, $08a94efe56c2b35f$var$_hide_buttons_if_needed, $08a94efe56c2b35f$var$_hide_buttons_if_needed2)).call(this);
|
|
4718
|
+
const mutation_plugins = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_mutation_plugins);
|
|
4719
|
+
for (let i = 0; i < mutation_plugins.length; i++) $3b52ccc10510b32a$export$b3bbfd758f11cfa9(mutation_plugins[i]).call(this, entries, intersecting_items);
|
|
4721
4720
|
}
|
|
4722
4721
|
function $08a94efe56c2b35f$var$_hide_buttons_if_needed2() {
|
|
4723
4722
|
var _is$;
|
|
4724
4723
|
// 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
|
|
4725
|
-
const cont =
|
|
4724
|
+
const cont = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_elements).sliding_el_,
|
|
4726
4725
|
lastel = this.index_of_last_element,
|
|
4727
4726
|
cont_rect = cont.getBoundingClientRect(),
|
|
4728
4727
|
is = this.intersecting_items_object;
|
|
@@ -4736,17 +4735,17 @@ function $08a94efe56c2b35f$var$_hide_buttons_if_needed2() {
|
|
|
4736
4735
|
// slider is empty
|
|
4737
4736
|
dist_to_left = 0;
|
|
4738
4737
|
}
|
|
4739
|
-
if (dist_to_left >= -this.dist_to_hide_left) $08a94efe56c2b35f$var$_classPrivateMethodGet(this, $08a94efe56c2b35f$var$_visibility, $08a94efe56c2b35f$var$_visibility2).call(this,
|
|
4740
|
-
const rightmost_edge_of_last_card = Math.floor((this.element_by_index(lastel) ||
|
|
4738
|
+
if (dist_to_left >= -this.dist_to_hide_left) $08a94efe56c2b35f$var$_classPrivateMethodGet(this, $08a94efe56c2b35f$var$_visibility, $08a94efe56c2b35f$var$_visibility2).call(this, $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_elements).left_, 0);else $08a94efe56c2b35f$var$_classPrivateMethodGet(this, $08a94efe56c2b35f$var$_visibility, $08a94efe56c2b35f$var$_visibility2).call(this, $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_elements).left_, 1);
|
|
4739
|
+
const rightmost_edge_of_last_card = Math.floor((this.element_by_index(lastel) || $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_elements).sliding_el_).getBoundingClientRect().right);
|
|
4741
4740
|
const rightmost_edge_of_container = cont_rect.right,
|
|
4742
4741
|
dist_to_right = rightmost_edge_of_last_card - rightmost_edge_of_container;
|
|
4743
4742
|
// dlog("dist to right", dist_to_right, "dist to left", dist_to_left);
|
|
4744
|
-
if (dist_to_right <= this.dist_to_hide_right) $08a94efe56c2b35f$var$_classPrivateMethodGet(this, $08a94efe56c2b35f$var$_visibility, $08a94efe56c2b35f$var$_visibility2).call(this,
|
|
4743
|
+
if (dist_to_right <= this.dist_to_hide_right) $08a94efe56c2b35f$var$_classPrivateMethodGet(this, $08a94efe56c2b35f$var$_visibility, $08a94efe56c2b35f$var$_visibility2).call(this, $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_elements).right_, 0);else $08a94efe56c2b35f$var$_classPrivateMethodGet(this, $08a94efe56c2b35f$var$_visibility, $08a94efe56c2b35f$var$_visibility2).call(this, $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_elements).right_, 1);
|
|
4745
4744
|
}
|
|
4746
4745
|
function $08a94efe56c2b35f$var$_distance_to2(offset) {
|
|
4747
4746
|
let is_absolute = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
4748
4747
|
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
|
|
4749
|
-
|
|
4748
|
+
$7f95f77417d06249$export$de56f1198d121036("intersecting_items", intersecting_items);
|
|
4750
4749
|
// 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.
|
|
4751
4750
|
// 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
|
|
4752
4751
|
let target; // absolute index to focus on
|
|
@@ -4756,7 +4755,7 @@ function $08a94efe56c2b35f$var$_distance_to2(offset) {
|
|
|
4756
4755
|
} = this;
|
|
4757
4756
|
if (currently_selected == null) {
|
|
4758
4757
|
// if for whatever reason we don't find a card, don't do anything
|
|
4759
|
-
|
|
4758
|
+
$3b52ccc10510b32a$export$f18d5b0af29128b7(new Error("can't find card in center"), "error");
|
|
4760
4759
|
return 0;
|
|
4761
4760
|
}
|
|
4762
4761
|
target = currently_selected + offset;
|
|
@@ -4771,38 +4770,38 @@ function $08a94efe56c2b35f$var$_distance_to2(offset) {
|
|
|
4771
4770
|
}
|
|
4772
4771
|
target = Math.floor(target);
|
|
4773
4772
|
let dist;
|
|
4774
|
-
|
|
4773
|
+
$7f95f77417d06249$export$de56f1198d121036("trying to focus target", target);
|
|
4775
4774
|
let target_element = this.element_by_index(target);
|
|
4776
4775
|
if (!target_element) {
|
|
4777
4776
|
if (this.correct_bs_targets) {
|
|
4778
4777
|
if (isNaN(target)) {
|
|
4779
|
-
|
|
4778
|
+
$7f95f77417d06249$export$de56f1198d121036("target is not a number", target, "can't correct");
|
|
4780
4779
|
return 0;
|
|
4781
4780
|
} else if (target < 0) {
|
|
4782
|
-
|
|
4781
|
+
$7f95f77417d06249$export$de56f1198d121036("Target", target, "is < 0, correcting to 0 because correct_bs_targets is enabled");
|
|
4783
4782
|
target = 0;
|
|
4784
4783
|
target_element = this.element_by_index(target);
|
|
4785
4784
|
if (!target_element) {
|
|
4786
|
-
|
|
4785
|
+
$7f95f77417d06249$export$de56f1198d121036("can't find element 0");
|
|
4787
4786
|
return 0;
|
|
4788
4787
|
}
|
|
4789
4788
|
} else {
|
|
4790
|
-
|
|
4789
|
+
$7f95f77417d06249$export$de56f1198d121036("target", target, "does not exist, correcting to last sliding element \uD83E\uDD2D");
|
|
4791
4790
|
target = this.index_of_last_element;
|
|
4792
4791
|
target_element = this.element_by_index(target);
|
|
4793
4792
|
if (!target_element) {
|
|
4794
|
-
|
|
4793
|
+
$7f95f77417d06249$export$de56f1198d121036("last element", target, "could not be found");
|
|
4795
4794
|
return 0;
|
|
4796
4795
|
}
|
|
4797
4796
|
}
|
|
4798
4797
|
} else {
|
|
4799
|
-
|
|
4798
|
+
$7f95f77417d06249$export$de56f1198d121036("target is bs, can't find", target, "by either data-index attribute or as child of", $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_elements).sliding_el_);
|
|
4800
4799
|
return 0;
|
|
4801
4800
|
}
|
|
4802
4801
|
}
|
|
4803
4802
|
const rectangle_of_target = target_element.getBoundingClientRect();
|
|
4804
4803
|
const distance_of_li = rectangle_of_target.left + target % 1 * rectangle_of_target.width;
|
|
4805
|
-
const rectangle_of_container =
|
|
4804
|
+
const rectangle_of_container = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_elements).sliding_el_.getBoundingClientRect();
|
|
4806
4805
|
const distance_of_container = rectangle_of_container.left;
|
|
4807
4806
|
dist = distance_of_li - distance_of_container;
|
|
4808
4807
|
if (this.center_target) try {
|
|
@@ -4822,7 +4821,7 @@ function $08a94efe56c2b35f$var$_distance_to2(offset) {
|
|
|
4822
4821
|
dist += biggest_card * num_cards_off_target;
|
|
4823
4822
|
}
|
|
4824
4823
|
} catch (e) {
|
|
4825
|
-
|
|
4824
|
+
$46b94b232dc792af$export$8048b892d651b310(e);
|
|
4826
4825
|
}
|
|
4827
4826
|
return dist;
|
|
4828
4827
|
}
|
|
@@ -4831,12 +4830,12 @@ function $08a94efe56c2b35f$var$_visibility2(element, should_be_visible) {
|
|
|
4831
4830
|
if (should_be_visible && ishidden) element.classList.remove("hidden");else if (!should_be_visible && !ishidden) element.classList.add("hidden");
|
|
4832
4831
|
}
|
|
4833
4832
|
function $08a94efe56c2b35f$var$_setup_buttons2() {
|
|
4834
|
-
const goleft =
|
|
4835
|
-
const goright =
|
|
4833
|
+
const goleft = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => $08a94efe56c2b35f$var$_classPrivateMethodGet(this, $08a94efe56c2b35f$var$_scroll_to, $08a94efe56c2b35f$var$_scroll_to2).call(this, -this.stepstoslide, false, -510));
|
|
4834
|
+
const goright = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => $08a94efe56c2b35f$var$_classPrivateMethodGet(this, $08a94efe56c2b35f$var$_scroll_to, $08a94efe56c2b35f$var$_scroll_to2).call(this, this.stepstoslide, false, 510));
|
|
4836
4835
|
const {
|
|
4837
4836
|
right_: right_,
|
|
4838
4837
|
left_: left_
|
|
4839
|
-
} =
|
|
4838
|
+
} = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_elements);
|
|
4840
4839
|
left_.addEventListener("click", goleft);
|
|
4841
4840
|
right_.addEventListener("click", goright);
|
|
4842
4841
|
[left_, right_].forEach(button => {
|
|
@@ -4845,12 +4844,12 @@ function $08a94efe56c2b35f$var$_setup_buttons2() {
|
|
|
4845
4844
|
}
|
|
4846
4845
|
function $08a94efe56c2b35f$var$_create_element_structure2() {
|
|
4847
4846
|
let autoinvalidate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
4848
|
-
const es =
|
|
4847
|
+
const es = $parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_elements);
|
|
4849
4848
|
$08a94efe56c2b35f$var$_classPrivateMethodGet(this, $08a94efe56c2b35f$var$_setup_buttons, $08a94efe56c2b35f$var$_setup_buttons2).call(this);
|
|
4850
4849
|
this.container.append(es.left_, es.right_);
|
|
4851
4850
|
this.container.append(es.sliding_el_);
|
|
4852
4851
|
if (autoinvalidate) {
|
|
4853
|
-
const cache_mo = new MutationObserver(
|
|
4852
|
+
const cache_mo = new MutationObserver($3b52ccc10510b32a$export$b3bbfd758f11cfa9(records => {
|
|
4854
4853
|
this.invalidate_cache();
|
|
4855
4854
|
for (const extra_fn of this.on_elements_changed) extra_fn.call(this, records);
|
|
4856
4855
|
}));
|
|
@@ -4875,14 +4874,14 @@ function $08a94efe56c2b35f$var$_scroll_to2(offset) {
|
|
|
4875
4874
|
let is_absolute = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
4876
4875
|
let fallback_scroll_distance = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 500;
|
|
4877
4876
|
let harsh = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
4878
|
-
const left =
|
|
4877
|
+
const left = $3b52ccc10510b32a$export$b3bbfd758f11cfa9($08a94efe56c2b35f$var$_classPrivateMethodGet(this, $08a94efe56c2b35f$var$_distance_to, $08a94efe56c2b35f$var$_distance_to2)).call(this, offset, is_absolute);
|
|
4879
4878
|
const distance_after_fallback_applied = Math.round(left !== null && left !== void 0 ? left : fallback_scroll_distance);
|
|
4880
|
-
if (getComputedStyle(
|
|
4881
|
-
|
|
4879
|
+
if (getComputedStyle($parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_elements).sliding_el_).scrollSnapType !== "none" && Math.abs(distance_after_fallback_applied) < 10) {
|
|
4880
|
+
$7f95f77417d06249$export$de56f1198d121036("Not scrolling because snapping is enabled and distance not over threshold", distance_after_fallback_applied);
|
|
4882
4881
|
return;
|
|
4883
4882
|
}
|
|
4884
|
-
|
|
4885
|
-
|
|
4883
|
+
$7f95f77417d06249$export$de56f1198d121036("Trying to scroll by", left, "px", "before fallback,", distance_after_fallback_applied, "after");
|
|
4884
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $08a94efe56c2b35f$var$_elements).sliding_el_.scrollBy({
|
|
4886
4885
|
left: distance_after_fallback_applied,
|
|
4887
4886
|
top: 0,
|
|
4888
4887
|
behavior: harsh ? "auto" : "smooth"
|
|
@@ -4897,7 +4896,7 @@ class $817cb0cb4b98187e$export$68babfc5be0de5da extends (0, $08a94efe56c2b35f$ex
|
|
|
4897
4896
|
element: element,
|
|
4898
4897
|
disconnector: disconnector
|
|
4899
4898
|
} = _ref;
|
|
4900
|
-
const i_o = new IntersectionObserver(
|
|
4899
|
+
const i_o = new IntersectionObserver($3b52ccc10510b32a$export$b3bbfd758f11cfa9(records => {
|
|
4901
4900
|
for (const record of records) if (record.intersectionRatio > 0) {
|
|
4902
4901
|
r(true);
|
|
4903
4902
|
i_o.disconnect();
|
|
@@ -4907,7 +4906,7 @@ class $817cb0cb4b98187e$export$68babfc5be0de5da extends (0, $08a94efe56c2b35f$ex
|
|
|
4907
4906
|
}),
|
|
4908
4907
|
// Fixes https://gitlab.com/depict-ai/depict.ai/-/merge_requests/5816/diffs, don't understand why
|
|
4909
4908
|
{
|
|
4910
|
-
threshold:
|
|
4909
|
+
threshold: $4e1f5263dceb9802$export$f8ea2e7b15b5d129(10)
|
|
4911
4910
|
});
|
|
4912
4911
|
i_o.observe(element);
|
|
4913
4912
|
});
|
|
@@ -4927,7 +4926,7 @@ function $7fe962cfdca74c2f$export$fb9afe9f540ae069(elements, _display, info) {
|
|
|
4927
4926
|
if (!(elements !== null && elements !== void 0 && elements.length)) return elements;
|
|
4928
4927
|
if (!info.t) return elements;
|
|
4929
4928
|
const elements_as_array = [...elements];
|
|
4930
|
-
const handler =
|
|
4929
|
+
const handler = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(async () => {
|
|
4931
4930
|
const {
|
|
4932
4931
|
rendering_options: rendering_options,
|
|
4933
4932
|
t: t
|
|
@@ -4935,7 +4934,7 @@ function $7fe962cfdca74c2f$export$fb9afe9f540ae069(elements, _display, info) {
|
|
|
4935
4934
|
if (!$7fe962cfdca74c2f$export$4b50a4de9c6bbe09.has(rendering_options) && elements_as_array.some(e => document.documentElement.contains(e)) // check, just in case
|
|
4936
4935
|
) {
|
|
4937
4936
|
$7fe962cfdca74c2f$export$4b50a4de9c6bbe09.add(rendering_options);
|
|
4938
|
-
|
|
4937
|
+
$335c248bb07a3509$export$82badda1f9923310({
|
|
4939
4938
|
...t,
|
|
4940
4939
|
product_id: await t.get_product_id(),
|
|
4941
4940
|
recommendation_type: info.rendering_options.type,
|
|
@@ -4957,7 +4956,7 @@ function $7fe962cfdca74c2f$export$1bffac19f9f0d6fc(elements, _display, info) {
|
|
|
4957
4956
|
// GTAG tracking is deprecated, if we're doing no-tenant recommendation rendering it's SDK anyway.
|
|
4958
4957
|
return elements;
|
|
4959
4958
|
const [first_element] = elements;
|
|
4960
|
-
const handler =
|
|
4959
|
+
const handler = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => {
|
|
4961
4960
|
const {
|
|
4962
4961
|
rendering_options: rendering_options,
|
|
4963
4962
|
displays: displays
|
|
@@ -4970,7 +4969,7 @@ function $7fe962cfdca74c2f$export$1bffac19f9f0d6fc(elements, _display, info) {
|
|
|
4970
4969
|
const {
|
|
4971
4970
|
type: type
|
|
4972
4971
|
} = rendering_options;
|
|
4973
|
-
|
|
4972
|
+
$99b61a0622560fcf$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 */, {
|
|
4974
4973
|
list_name: "depict_" + type
|
|
4975
4974
|
});
|
|
4976
4975
|
}
|
|
@@ -4985,7 +4984,7 @@ function $7fe962cfdca74c2f$export$9e1caada6901f552(elements, _display, info) {
|
|
|
4985
4984
|
} = info;
|
|
4986
4985
|
if (!t) return elements;
|
|
4987
4986
|
(async () => {
|
|
4988
|
-
|
|
4987
|
+
$c15d2edce69e632a$export$eee4c4d924348b05({
|
|
4989
4988
|
tenant: t.tenant,
|
|
4990
4989
|
market: t.market,
|
|
4991
4990
|
product_id: await t.get_product_id()
|
|
@@ -5000,9 +4999,9 @@ function $7fe962cfdca74c2f$export$8d72437623fef90c(elements, display, info) {
|
|
|
5000
4999
|
ga_product_id: ga_product_id,
|
|
5001
5000
|
product_id: product_id
|
|
5002
5001
|
} = display;
|
|
5003
|
-
if (Array.isArray(ga_product_ids)) for (let i = 0; i < ga_product_ids.length; i++)
|
|
5002
|
+
if (Array.isArray(ga_product_ids)) for (let i = 0; i < ga_product_ids.length; i++) $99b61a0622560fcf$export$f522672c9379e339(ga_product_ids[i], info.index, {
|
|
5004
5003
|
list_name: "depict_" + info.rendering_options.type
|
|
5005
|
-
});else
|
|
5004
|
+
});else $99b61a0622560fcf$export$f522672c9379e339(ga_product_id || product_id, info.index, {
|
|
5006
5005
|
list_name: "depict_" + info.rendering_options.type
|
|
5007
5006
|
});
|
|
5008
5007
|
};
|
|
@@ -5019,7 +5018,7 @@ function $7fe962cfdca74c2f$export$e9106d6e723510d2(elements, display, info) {
|
|
|
5019
5018
|
index: index,
|
|
5020
5019
|
rendering_options: rendering_options
|
|
5021
5020
|
} = info;
|
|
5022
|
-
return
|
|
5021
|
+
return $335c248bb07a3509$export$15f8a0cd5a8c0ebb({
|
|
5023
5022
|
...t,
|
|
5024
5023
|
...rendering_options,
|
|
5025
5024
|
...display,
|
|
@@ -5044,14 +5043,14 @@ function $7fe962cfdca74c2f$export$32eb5dd18e963410(elements, display, info) {
|
|
|
5044
5043
|
} = "variant_index" in display ? display.variant_displays[display.variant_index] : display;
|
|
5045
5044
|
if (!(elements !== null && elements !== void 0 && elements.length)) return elements;
|
|
5046
5045
|
for (const element of elements) {
|
|
5047
|
-
const handler =
|
|
5046
|
+
const handler = $1ea91dfed6983398$export$82a685f2da2fb027(element, product_id, recommendation_id || search_result_id);
|
|
5048
5047
|
if (handler) $7fe962cfdca74c2f$var$push_function($7fe962cfdca74c2f$export$32eb5dd18e963410, handler);
|
|
5049
5048
|
}
|
|
5050
5049
|
return elements;
|
|
5051
5050
|
}
|
|
5052
5051
|
function $7fe962cfdca74c2f$export$dd32cb565eae0a1f(elements, display, info) {
|
|
5053
5052
|
const handler = () => {
|
|
5054
|
-
|
|
5053
|
+
$99b61a0622560fcf$export$127751e82111fcf();
|
|
5055
5054
|
};
|
|
5056
5055
|
$7fe962cfdca74c2f$var$push_function($7fe962cfdca74c2f$export$dd32cb565eae0a1f, handler);
|
|
5057
5056
|
info.register_event_listener("click", handler, {
|
|
@@ -5099,7 +5098,7 @@ async function $9eba3ee394000bb7$export$50ce83ace0cdd87e(t, rendering_options) {
|
|
|
5099
5098
|
view_tracking: view_tracking,
|
|
5100
5099
|
click_tracking: click_tracking
|
|
5101
5100
|
} = rendering_options;
|
|
5102
|
-
return await
|
|
5101
|
+
return await $8f0d01ff20cfba68$export$a9fc160c5ed83bd7(t, {
|
|
5103
5102
|
...rendering_options,
|
|
5104
5103
|
headers: {
|
|
5105
5104
|
...((0, $8884ea38c83d7452$export$deca40f48c0569f8) ? {
|
|
@@ -5122,7 +5121,7 @@ async function $61a203c77123a21c$export$cab8bc58c64c2013(t, rendering_options, o
|
|
|
5122
5121
|
let {
|
|
5123
5122
|
container: container
|
|
5124
5123
|
} = options_for_us;
|
|
5125
|
-
if (typeof container == "string") container = [
|
|
5124
|
+
if (typeof container == "string") container = [...$8b27923e1d1e6b99$export$44951404cb8d0583(container)];
|
|
5126
5125
|
if (container && !Array.isArray(container)) container = [...container];
|
|
5127
5126
|
const slider = new (0, $817cb0cb4b98187e$export$68babfc5be0de5da)({
|
|
5128
5127
|
dist_to_hide_left: 10,
|
|
@@ -5132,17 +5131,17 @@ async function $61a203c77123a21c$export$cab8bc58c64c2013(t, rendering_options, o
|
|
|
5132
5131
|
const recs = await local_rr(t, {
|
|
5133
5132
|
...rendering_options,
|
|
5134
5133
|
post_processors: [(elements, display) => {
|
|
5135
|
-
|
|
5134
|
+
$8b27923e1d1e6b99$export$5e63aea0cac01fa0(elements, ".rec_outer").forEach(ro => ro.classList.add("noautospacing"));
|
|
5136
5135
|
return elements;
|
|
5137
5136
|
}, ...(rendering_options.post_processors || [])]
|
|
5138
5137
|
});
|
|
5139
5138
|
if (!recs.elements) {
|
|
5140
|
-
|
|
5139
|
+
$7f95f77417d06249$export$de56f1198d121036("Pro_Slider says bye bye cuz no recs");
|
|
5141
5140
|
return {};
|
|
5142
5141
|
}
|
|
5143
5142
|
slider.insert_here.append(...recs.elements);
|
|
5144
5143
|
if (container) {
|
|
5145
|
-
const [root] =
|
|
5144
|
+
const [root] = $8b27923e1d1e6b99$export$5e63aea0cac01fa0(container, root_selector || ".grid");
|
|
5146
5145
|
root[insertion_verb](slider.container);
|
|
5147
5146
|
}
|
|
5148
5147
|
return {
|
|
@@ -5187,7 +5186,7 @@ class $a782ed55f4206a68$export$1a8782481a9af507 {
|
|
|
5187
5186
|
type: type,
|
|
5188
5187
|
market: market
|
|
5189
5188
|
} = this.settings;
|
|
5190
|
-
|
|
5189
|
+
$d72c9a0d8e9c5a95$export$1bc0df10745d5412(
|
|
5191
5190
|
// @ts-ignore - Quick workaround, as we don't have a tenant object here
|
|
5192
5191
|
{
|
|
5193
5192
|
tenant: tenant,
|
|
@@ -5197,7 +5196,7 @@ class $a782ed55f4206a68$export$1a8782481a9af507 {
|
|
|
5197
5196
|
product_id: product_id()
|
|
5198
5197
|
}).then(recs => {
|
|
5199
5198
|
this.data = recs;
|
|
5200
|
-
|
|
5199
|
+
$954922240a743f34$export$8582cf3716962dc2({
|
|
5201
5200
|
...this.settings,
|
|
5202
5201
|
recs: this.data,
|
|
5203
5202
|
min_recs: this.settings.min_items || this.settings.max_items
|
|
@@ -5214,14 +5213,14 @@ class $a782ed55f4206a68$export$1a8782481a9af507 {
|
|
|
5214
5213
|
}
|
|
5215
5214
|
if (!action || action instanceof Event) action = "rec_bar_click";
|
|
5216
5215
|
if (action == "rec_bar_click" && typeof index != "undefined" && product_id) {
|
|
5217
|
-
if (Array.isArray(ga_product_ids)) for (const id of ga_product_ids)
|
|
5216
|
+
if (Array.isArray(ga_product_ids)) for (const id of ga_product_ids) $99b61a0622560fcf$export$f522672c9379e339(id, index, {
|
|
5218
5217
|
list_name: "depict_" + this.settings.type
|
|
5219
|
-
});else
|
|
5218
|
+
});else $99b61a0622560fcf$export$f522672c9379e339(product_id, index, {
|
|
5220
5219
|
list_name: "depict_" + this.settings.type
|
|
5221
5220
|
});
|
|
5222
5221
|
}
|
|
5223
5222
|
if (this.tracker === undefined) this.tracker = ga("create", this.settings.gaid, "auto", "depict");
|
|
5224
|
-
|
|
5223
|
+
$99b61a0622560fcf$export$f75172d2e289cd02(action);
|
|
5225
5224
|
}
|
|
5226
5225
|
trackPageView() {
|
|
5227
5226
|
if ($a782ed55f4206a68$var$pageview_sent) {
|
|
@@ -5232,12 +5231,12 @@ class $a782ed55f4206a68$export$1a8782481a9af507 {
|
|
|
5232
5231
|
const {
|
|
5233
5232
|
product_id: product_id
|
|
5234
5233
|
} = this.settings;
|
|
5235
|
-
|
|
5234
|
+
$c15d2edce69e632a$export$eee4c4d924348b05(typeof product_id === "function" ? product_id() : product_id);
|
|
5236
5235
|
}
|
|
5237
5236
|
trackClick(index) {
|
|
5238
5237
|
const item = this.data[index];
|
|
5239
5238
|
if (item === undefined) return;
|
|
5240
|
-
return
|
|
5239
|
+
return $335c248bb07a3509$export$15f8a0cd5a8c0ebb({
|
|
5241
5240
|
...this.settings,
|
|
5242
5241
|
...item,
|
|
5243
5242
|
click_location: "".concat(this.settings.type, "_").concat(index + 1),
|
|
@@ -5245,7 +5244,7 @@ class $a782ed55f4206a68$export$1a8782481a9af507 {
|
|
|
5245
5244
|
});
|
|
5246
5245
|
}
|
|
5247
5246
|
trackAddToCart(pId) {
|
|
5248
|
-
return
|
|
5247
|
+
return $335c248bb07a3509$export$9028351cb994757e({
|
|
5249
5248
|
...this.settings,
|
|
5250
5249
|
product_id: pId && !(pId instanceof Event) ? pId : this.settings.product_id()
|
|
5251
5250
|
});
|
|
@@ -5326,9 +5325,9 @@ class $a782ed55f4206a68$export$1a8782481a9af507 {
|
|
|
5326
5325
|
if (!this.settings.DNT) for (const element of elements) {
|
|
5327
5326
|
// recommendations_inserted event
|
|
5328
5327
|
(0, $03c157d68c9fcbac$export$b6ae1bc530f4c149).oncreation(element, () => {
|
|
5329
|
-
if (
|
|
5330
|
-
|
|
5331
|
-
|
|
5328
|
+
if (!$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $a782ed55f4206a68$var$_dispatched_recs_inserted)) {
|
|
5329
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldSet)(this, $a782ed55f4206a68$var$_dispatched_recs_inserted, true);
|
|
5330
|
+
$335c248bb07a3509$export$82badda1f9923310({
|
|
5332
5331
|
...this.settings,
|
|
5333
5332
|
product_id: product_id_at_rendering,
|
|
5334
5333
|
recommendation_type: this.settings.type,
|
|
@@ -5341,8 +5340,8 @@ class $a782ed55f4206a68$export$1a8782481a9af507 {
|
|
|
5341
5340
|
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);
|
|
5342
5341
|
};
|
|
5343
5342
|
element.addEventListener("click", listener);
|
|
5344
|
-
|
|
5345
|
-
if (this.settings.shade)
|
|
5343
|
+
$1ea91dfed6983398$export$82a685f2da2fb027(element, item.product_id, item.recommendation_id);
|
|
5344
|
+
if (this.settings.shade) $7c971cc277292c10$export$6ebd242c09192cec(element);
|
|
5346
5345
|
// @ts-ignore
|
|
5347
5346
|
if (!element.depict_event_listeners)
|
|
5348
5347
|
// @ts-ignore
|
|
@@ -5354,7 +5353,7 @@ class $a782ed55f4206a68$export$1a8782481a9af507 {
|
|
|
5354
5353
|
resultingElements.push(...elements);
|
|
5355
5354
|
});
|
|
5356
5355
|
this.data = recsArray;
|
|
5357
|
-
if (!this.settings.DNT)
|
|
5356
|
+
if (!this.settings.DNT) $99b61a0622560fcf$export$7babcd5d4056b2ca(recsArray, this.settings.product_id, {
|
|
5358
5357
|
list_name: "depict_" + this.settings.type
|
|
5359
5358
|
});
|
|
5360
5359
|
return resultingElements;
|
|
@@ -5427,7 +5426,7 @@ class $3f49f9b73bfc2a38$export$4d41c6499d53639c extends (0, $817cb0cb4b98187e$ex
|
|
|
5427
5426
|
super(options, {
|
|
5428
5427
|
lazyfinder: {
|
|
5429
5428
|
unload(image) {
|
|
5430
|
-
|
|
5429
|
+
$3b52ccc10510b32a$export$b3bbfd758f11cfa9(async () => {
|
|
5431
5430
|
var _image$dataset, _image$dataset$src;
|
|
5432
5431
|
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)) {
|
|
5433
5432
|
image.dataset.src = image.src;
|
|
@@ -5460,7 +5459,7 @@ async function $bbf8331c74194de9$export$cd12721587f4f16d(t, rendering_options, o
|
|
|
5460
5459
|
let {
|
|
5461
5460
|
container: container
|
|
5462
5461
|
} = options_for_us;
|
|
5463
|
-
if (typeof container == "string") container = [
|
|
5462
|
+
if (typeof container == "string") container = [...$8b27923e1d1e6b99$export$44951404cb8d0583(container)];
|
|
5464
5463
|
if (container && !Array.isArray(container)) container = [...container];
|
|
5465
5464
|
const slider = new (0, $3f49f9b73bfc2a38$export$4d41c6499d53639c)({
|
|
5466
5465
|
dlog: dlog,
|
|
@@ -5472,7 +5471,7 @@ async function $bbf8331c74194de9$export$cd12721587f4f16d(t, rendering_options, o
|
|
|
5472
5471
|
const recs = await local_rr(t, {
|
|
5473
5472
|
...rendering_options,
|
|
5474
5473
|
post_processors: [(elements, display) => {
|
|
5475
|
-
|
|
5474
|
+
$8b27923e1d1e6b99$export$5e63aea0cac01fa0(elements, "a.rec_outer").forEach(ro => ro.classList.add("noautospacing"));
|
|
5476
5475
|
return elements;
|
|
5477
5476
|
}, ...(rendering_options.post_processors || [])]
|
|
5478
5477
|
});
|
|
@@ -5482,7 +5481,7 @@ async function $bbf8331c74194de9$export$cd12721587f4f16d(t, rendering_options, o
|
|
|
5482
5481
|
}
|
|
5483
5482
|
slider.insert_here.append(...recs.elements);
|
|
5484
5483
|
if (container) {
|
|
5485
|
-
const [root] =
|
|
5484
|
+
const [root] = $8b27923e1d1e6b99$export$5e63aea0cac01fa0(container, root_selector || ".grid");
|
|
5486
5485
|
root[insertion_verb](slider.container);
|
|
5487
5486
|
}
|
|
5488
5487
|
return {
|
|
@@ -5516,8 +5515,8 @@ async function $51509cd9b5d4acc7$export$30933c637c977eef(_ref) {
|
|
|
5516
5515
|
catchify: catchify,
|
|
5517
5516
|
dlog: dlog
|
|
5518
5517
|
} = t,
|
|
5519
|
-
container = [
|
|
5520
|
-
root =
|
|
5518
|
+
container = [...$8b27923e1d1e6b99$export$44951404cb8d0583(container_template)],
|
|
5519
|
+
root = $8b27923e1d1e6b99$export$5e63aea0cac01fa0(container, ".grid")[0],
|
|
5521
5520
|
internal_pre_processors = [...pre_processors],
|
|
5522
5521
|
// 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
|
|
5523
5522
|
internal_post_processors = [...post_processors];
|
|
@@ -5530,7 +5529,7 @@ async function $51509cd9b5d4acc7$export$30933c637c977eef(_ref) {
|
|
|
5530
5529
|
root.replaceWith(slider.container);
|
|
5531
5530
|
if (insertion_promise) internal_post_processors.push((t, items, d) => {
|
|
5532
5531
|
for (const item of items) insertion_promise.then(() => {
|
|
5533
|
-
|
|
5532
|
+
$89969f18db4020d7$export$37125ccc5dd98050({
|
|
5534
5533
|
element: item,
|
|
5535
5534
|
data: {
|
|
5536
5535
|
tenant: t.tenant,
|
|
@@ -5547,7 +5546,7 @@ async function $51509cd9b5d4acc7$export$30933c637c977eef(_ref) {
|
|
|
5547
5546
|
});
|
|
5548
5547
|
}
|
|
5549
5548
|
if (!slider || !insertion_promise) internal_post_processors.push((t, items, d) => {
|
|
5550
|
-
for (const item of items)
|
|
5549
|
+
for (const item of items) $89969f18db4020d7$export$37125ccc5dd98050({
|
|
5551
5550
|
element: item,
|
|
5552
5551
|
data: {
|
|
5553
5552
|
tenant: t.tenant,
|
|
@@ -5561,7 +5560,7 @@ async function $51509cd9b5d4acc7$export$30933c637c977eef(_ref) {
|
|
|
5561
5560
|
});
|
|
5562
5561
|
return items;
|
|
5563
5562
|
});
|
|
5564
|
-
const template_tool = await
|
|
5563
|
+
const template_tool = await $ebe64dbcfb106f16$export$2e2bcd8739ae039({
|
|
5565
5564
|
options: {
|
|
5566
5565
|
...t,
|
|
5567
5566
|
...(template_tool_options || {})
|
|
@@ -5585,7 +5584,7 @@ async function $51509cd9b5d4acc7$export$30933c637c977eef(_ref) {
|
|
|
5585
5584
|
if (with_loadmore) catchify($51509cd9b5d4acc7$var$setup_load_more)(t, root, chunk_size_for_load_more);
|
|
5586
5585
|
if (infinite_scroll) catchify($51509cd9b5d4acc7$var$setup_infinite_scroll)(t, root);
|
|
5587
5586
|
if (title) {
|
|
5588
|
-
const [title_element] =
|
|
5587
|
+
const [title_element] = $8b27923e1d1e6b99$export$5e63aea0cac01fa0(container, "h1.title, h2.title, h3.title, h4.title, h5.title, h6.title");
|
|
5589
5588
|
if (title_element) {
|
|
5590
5589
|
if (typeof title == "string") title_element.innerText = title;else title_element.replaceWith(...title);
|
|
5591
5590
|
}
|
|
@@ -5631,8 +5630,8 @@ function $51509cd9b5d4acc7$var$setup_load_more(t, root, chunk_size) {
|
|
|
5631
5630
|
const {
|
|
5632
5631
|
catchify: catchify
|
|
5633
5632
|
} = t,
|
|
5634
|
-
load_more_cont =
|
|
5635
|
-
load_button = load_more_cont.appendChild(
|
|
5633
|
+
load_more_cont = $8b27923e1d1e6b99$export$d3e2a0560cbf4787('<div class="load-more-container"></div>'),
|
|
5634
|
+
load_button = load_more_cont.appendChild($8b27923e1d1e6b99$export$d3e2a0560cbf4787('<button class="load_more">Visa mer</button>'));
|
|
5636
5635
|
load_button.addEventListener("click", catchify(load_more_recs_and_hide_button_if_needed));
|
|
5637
5636
|
root.after(load_more_cont);
|
|
5638
5637
|
load_more_recs_and_hide_button_if_needed();
|
|
@@ -5704,7 +5703,7 @@ $a68e8b02bee90bb2$export$2e2bcd8739ae039 = (dlog, error_log) => {
|
|
|
5704
5703
|
} : {})
|
|
5705
5704
|
}).then(async response => {
|
|
5706
5705
|
if (!response || !response.ok || response.status !== 200) {
|
|
5707
|
-
if (response.status === 422)
|
|
5706
|
+
if (response.status === 422) $3b52ccc10510b32a$export$b3bbfd758f11cfa9($a68e8b02bee90bb2$var$send_sentry_422)(response, body, stack);
|
|
5708
5707
|
elog("Response not ok", response);
|
|
5709
5708
|
return false;
|
|
5710
5709
|
} else return await response[decode_json ? "json" : "text"]().catch(e => elog("error while decoding json", e));
|
|
@@ -5719,32 +5718,32 @@ $a68e8b02bee90bb2$export$2e2bcd8739ae039 = (dlog, error_log) => {
|
|
|
5719
5718
|
async function $a68e8b02bee90bb2$var$send_sentry_422(response, body, stack) {
|
|
5720
5719
|
const msg = "Validation error: got 422 from API";
|
|
5721
5720
|
const text = await response.text();
|
|
5722
|
-
|
|
5721
|
+
$7f95f77417d06249$export$de56f1198d121036(msg, "body", body, "response", response, "text", text, "stack", stack);
|
|
5723
5722
|
(0, $902c0e005afb7319$export$af2e17a20c2ea3c5).withScope(function (scope) {
|
|
5724
5723
|
scope.setExtra("stack", stack);
|
|
5725
5724
|
scope.setExtra("request_body", body);
|
|
5726
5725
|
scope.setExtra("response", response);
|
|
5727
|
-
scope.setExtra("serialized_response",
|
|
5726
|
+
scope.setExtra("serialized_response", $a1dd43178e1da976$export$39d526a1194b6499(response));
|
|
5728
5727
|
scope.setExtra("response_text", text);
|
|
5729
5728
|
scope.setLevel("error");
|
|
5730
5729
|
this.captureException(new Error(msg));
|
|
5731
5730
|
});
|
|
5732
5731
|
}
|
|
5733
|
-
const $5638de1dd37b2d4d$export$dc84183312f0c201 = /*@__PURE__*/(() =>
|
|
5732
|
+
const $5638de1dd37b2d4d$export$dc84183312f0c201 = /*@__PURE__*/(() => $f0d9ae7bf9bd697d$export$25062201e9e25d76("svg", {
|
|
5734
5733
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5735
5734
|
viewBox: "0 0 320 512",
|
|
5736
|
-
children: [
|
|
5735
|
+
children: [$f0d9ae7bf9bd697d$export$34b9dba7ce09269b("desc", {
|
|
5737
5736
|
children: "Right arrow"
|
|
5738
|
-
}),
|
|
5737
|
+
}), $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("path", {
|
|
5739
5738
|
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"
|
|
5740
5739
|
})]
|
|
5741
5740
|
}))();
|
|
5742
|
-
const $5638de1dd37b2d4d$export$6038895ac52bd044 = /*@__PURE__*/(() =>
|
|
5741
|
+
const $5638de1dd37b2d4d$export$6038895ac52bd044 = /*@__PURE__*/(() => $f0d9ae7bf9bd697d$export$25062201e9e25d76("svg", {
|
|
5743
5742
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5744
5743
|
viewBox: "0 0 320 512",
|
|
5745
|
-
children: [
|
|
5744
|
+
children: [$f0d9ae7bf9bd697d$export$34b9dba7ce09269b("desc", {
|
|
5746
5745
|
children: "Left arrow"
|
|
5747
|
-
}),
|
|
5746
|
+
}), $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("path", {
|
|
5748
5747
|
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"
|
|
5749
5748
|
})]
|
|
5750
5749
|
}))();
|
|
@@ -5762,7 +5761,7 @@ const $591ebabd2d3823ef$export$68c017fd93791405 = function () {
|
|
|
5762
5761
|
container.append(content);
|
|
5763
5762
|
const expand = () => {
|
|
5764
5763
|
container.style.height = content.clientHeight + "px";
|
|
5765
|
-
setTimeout(
|
|
5764
|
+
setTimeout($3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => {
|
|
5766
5765
|
container.style.overflow = "unset";
|
|
5767
5766
|
container.style.height = "auto";
|
|
5768
5767
|
}), duration);
|
|
@@ -5774,14 +5773,14 @@ const $591ebabd2d3823ef$export$68c017fd93791405 = function () {
|
|
|
5774
5773
|
};
|
|
5775
5774
|
};
|
|
5776
5775
|
function $12a8c4258d1dd80f$export$f8913c8a18f7ca21(iterables) {
|
|
5777
|
-
const ourselves =
|
|
5776
|
+
const ourselves = $76a59c6ce18c8fd3$export$e806c6c1615a59ae();
|
|
5778
5777
|
const values = new Array(iterables.length);
|
|
5779
|
-
Promise.all(iterables.map(
|
|
5778
|
+
Promise.all(iterables.map($3b52ccc10510b32a$export$b3bbfd758f11cfa9(async (iterable, index) => {
|
|
5780
5779
|
for await (const value of iterable) {
|
|
5781
5780
|
values[index] = value;
|
|
5782
5781
|
ourselves([...values]);
|
|
5783
5782
|
}
|
|
5784
|
-
}))).then(
|
|
5783
|
+
}))).then($3b52ccc10510b32a$export$b3bbfd758f11cfa9(ourselves.exit));
|
|
5785
5784
|
return ourselves;
|
|
5786
5785
|
}
|
|
5787
5786
|
let $0c2e69f971c62390$var$_Symbol$iterator, $0c2e69f971c62390$var$_Symbol$toPrimitive;
|
|
@@ -5806,16 +5805,16 @@ async function $0c2e69f971c62390$export$c84671f46d6a1ca(_ref) {
|
|
|
5806
5805
|
ipns: ipns
|
|
5807
5806
|
} = rows_or_empty_object;
|
|
5808
5807
|
const is_static = !ipns && !button;
|
|
5809
|
-
const our_style_el =
|
|
5808
|
+
const our_style_el = $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("style", {
|
|
5810
5809
|
type: "text/css"
|
|
5811
5810
|
});
|
|
5812
|
-
const container_class =
|
|
5811
|
+
const container_class = $a13f25507f352177$export$a6db784f019668ba();
|
|
5813
5812
|
const selector_beginning = ".depict .".concat(container_class, ">");
|
|
5814
|
-
const el_count_ipns =
|
|
5813
|
+
const el_count_ipns = $76a59c6ce18c8fd3$export$e806c6c1615a59ae();
|
|
5815
5814
|
const set_length = () => el_count_ipns(container_element.children.length);
|
|
5816
5815
|
const col_styling = $0c2e69f971c62390$export$17c3166a7ebd4688(selector_beginning, grid_spacing, cols_at_size, layout, override_vertical_spacing);
|
|
5817
5816
|
let button_class;
|
|
5818
|
-
ipns || (ipns =
|
|
5817
|
+
ipns || (ipns = $76a59c6ce18c8fd3$export$e806c6c1615a59ae());
|
|
5819
5818
|
container_element.after(our_style_el);
|
|
5820
5819
|
container_element.classList.add(container_class);
|
|
5821
5820
|
if (rows === "all") {
|
|
@@ -5825,7 +5824,7 @@ async function $0c2e69f971c62390$export$c84671f46d6a1ca(_ref) {
|
|
|
5825
5824
|
}
|
|
5826
5825
|
ipns(start_rows);
|
|
5827
5826
|
set_length();
|
|
5828
|
-
const mutation_observer = new MutationObserver(
|
|
5827
|
+
const mutation_observer = new MutationObserver($3b52ccc10510b32a$export$b3bbfd758f11cfa9(set_length));
|
|
5829
5828
|
(0, $03c157d68c9fcbac$export$b6ae1bc530f4c149).oncreation(container_element, _ref2 => {
|
|
5830
5829
|
let {
|
|
5831
5830
|
element: element
|
|
@@ -5846,10 +5845,10 @@ async function $0c2e69f971c62390$export$c84671f46d6a1ca(_ref) {
|
|
|
5846
5845
|
ipns.exit();
|
|
5847
5846
|
});
|
|
5848
5847
|
if (button) {
|
|
5849
|
-
button_class =
|
|
5850
|
-
const button_container =
|
|
5848
|
+
button_class = $a13f25507f352177$export$a6db784f019668ba();
|
|
5849
|
+
const button_container = $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("div", {
|
|
5851
5850
|
class: "load-more-container " + button_class,
|
|
5852
|
-
children:
|
|
5851
|
+
children: $51b78ec2cb40f07e$export$f63fcc839cb0f734("click", () => {
|
|
5853
5852
|
var _rows_or_empty_object;
|
|
5854
5853
|
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));
|
|
5855
5854
|
}, button)
|
|
@@ -5857,7 +5856,7 @@ async function $0c2e69f971c62390$export$c84671f46d6a1ca(_ref) {
|
|
|
5857
5856
|
container_element.after(button_container);
|
|
5858
5857
|
}
|
|
5859
5858
|
(0, $03c157d68c9fcbac$export$b6ae1bc530f4c149).oncreation(container_element, async () => {
|
|
5860
|
-
for await (const [currently_showing_rows, number_of_els] of
|
|
5859
|
+
for await (const [currently_showing_rows, number_of_els] of $12a8c4258d1dd80f$export$f8913c8a18f7ca21([
|
|
5861
5860
|
// start for await loop when the container element gets inserted into the DOM
|
|
5862
5861
|
// the loop is broken by an observer.onremoved above calling .exit on the IPNS this depends on
|
|
5863
5862
|
// @ts-ignore
|
|
@@ -6002,7 +6001,7 @@ class $0c2e69f971c62390$var$CSSMeasurement {
|
|
|
6002
6001
|
return hint == "number" ? this.valueOf() : this.toString();
|
|
6003
6002
|
}
|
|
6004
6003
|
constructor(measurement) {
|
|
6005
|
-
|
|
6004
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersdefineProperty)(this, $0c2e69f971c62390$var$_Symbol$iterator, function* () {
|
|
6006
6005
|
if (this.is_fe) throw new Error("Function expression isn't iterable: " + this.e);
|
|
6007
6006
|
yield this.v;
|
|
6008
6007
|
yield this.u;
|
|
@@ -6028,7 +6027,7 @@ async function $79e67f88d50f1879$export$b0a773486c1c2312(t, recommendation_rende
|
|
|
6028
6027
|
eager_images: eager_images,
|
|
6029
6028
|
...options_for_grid
|
|
6030
6029
|
} = _ref;
|
|
6031
|
-
const [insertion_point] =
|
|
6030
|
+
const [insertion_point] = $8b27923e1d1e6b99$export$5e63aea0cac01fa0(container_elements, container_selector || ".grid");
|
|
6032
6031
|
const rendering_result = await (override_rec_renderer || (0, $9eba3ee394000bb7$export$2e2bcd8739ae039))(t, recommendation_renderer_options);
|
|
6033
6032
|
const {
|
|
6034
6033
|
elements: elements
|
|
@@ -6039,7 +6038,7 @@ async function $79e67f88d50f1879$export$b0a773486c1c2312(t, recommendation_rende
|
|
|
6039
6038
|
// when the elements are in the DOM starts IntersectionObserver on whole grid
|
|
6040
6039
|
// when grid intersects starts Lazyfier
|
|
6041
6040
|
// this is because Lazyfier is fucking stupid
|
|
6042
|
-
(0, $03c157d68c9fcbac$export$b6ae1bc530f4c149).wait_for_element(insertion_point).then(
|
|
6041
|
+
(0, $03c157d68c9fcbac$export$b6ae1bc530f4c149).wait_for_element(insertion_point).then($3b52ccc10510b32a$export$b3bbfd758f11cfa9(element => {
|
|
6043
6042
|
let start_lazy_loading;
|
|
6044
6043
|
const lazy_loading_promise = new Promise(r => start_lazy_loading = r);
|
|
6045
6044
|
const lf = new (0, $bc463df3122a418b$export$3be7054c61590ee3)({
|
|
@@ -6048,7 +6047,7 @@ async function $79e67f88d50f1879$export$b0a773486c1c2312(t, recommendation_rende
|
|
|
6048
6047
|
...lazyfier_options
|
|
6049
6048
|
});
|
|
6050
6049
|
lf.start_observing_for_new_children_(element);
|
|
6051
|
-
const i_o = new IntersectionObserver(
|
|
6050
|
+
const i_o = new IntersectionObserver($3b52ccc10510b32a$export$b3bbfd758f11cfa9(records => {
|
|
6052
6051
|
for (const record of records) if (record.intersectionRatio > 0) {
|
|
6053
6052
|
start_lazy_loading();
|
|
6054
6053
|
i_o.disconnect();
|
|
@@ -6058,7 +6057,7 @@ async function $79e67f88d50f1879$export$b0a773486c1c2312(t, recommendation_rende
|
|
|
6058
6057
|
i_o.observe(insertion_point);
|
|
6059
6058
|
}));
|
|
6060
6059
|
insertion_point.append(...elements);
|
|
6061
|
-
|
|
6060
|
+
$0c2e69f971c62390$export$c84671f46d6a1ca({
|
|
6062
6061
|
...options_for_grid,
|
|
6063
6062
|
container_element: insertion_point,
|
|
6064
6063
|
layout: "grid"
|
|
@@ -6086,7 +6085,7 @@ async function $87dd73b8c244f3d2$export$82cfdc85a4d15688(t, recommendation_rende
|
|
|
6086
6085
|
rows = "all",
|
|
6087
6086
|
...slider_options
|
|
6088
6087
|
} = _ref;
|
|
6089
|
-
const [insertion_point] =
|
|
6088
|
+
const [insertion_point] = $8b27923e1d1e6b99$export$5e63aea0cac01fa0(container_elements, container_selector || ".grid");
|
|
6090
6089
|
const slider = eager_images ? new (0, $08a94efe56c2b35f$export$692b27c28639e5b9)(slider_options) : new (0, $817cb0cb4b98187e$export$68babfc5be0de5da)(slider_options, lazyfier_options);
|
|
6091
6090
|
const rendering_result = await (override_rec_renderer || (0, $9eba3ee394000bb7$export$2e2bcd8739ae039))(t, recommendation_renderer_options);
|
|
6092
6091
|
const {
|
|
@@ -6095,18 +6094,18 @@ async function $87dd73b8c244f3d2$export$82cfdc85a4d15688(t, recommendation_rende
|
|
|
6095
6094
|
if (!elements) return rendering_result;
|
|
6096
6095
|
if (!$87dd73b8c244f3d2$var$slider_styling_was_inserted) {
|
|
6097
6096
|
$87dd73b8c244f3d2$var$slider_styling_was_inserted = true;
|
|
6098
|
-
|
|
6097
|
+
$e45474c7d6e21cfa$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($260179121984179c$exports)));
|
|
6099
6098
|
}
|
|
6100
6099
|
insertion_point.replaceWith(slider.container);
|
|
6101
6100
|
slider.insert_here.append(...elements);
|
|
6102
|
-
|
|
6101
|
+
$0c2e69f971c62390$export$c84671f46d6a1ca({
|
|
6103
6102
|
grid_spacing: grid_spacing,
|
|
6104
6103
|
cols_at_size: cols_at_size,
|
|
6105
6104
|
container_element: slider.insert_here,
|
|
6106
6105
|
rows: rows,
|
|
6107
6106
|
layout: "slider",
|
|
6108
6107
|
override_vertical_spacing: override_vertical_spacing
|
|
6109
|
-
}).catch(e =>
|
|
6108
|
+
}).catch(e => $3b52ccc10510b32a$export$f18d5b0af29128b7([e, "Grid had an error"], "warning"));
|
|
6110
6109
|
return {
|
|
6111
6110
|
...rendering_result,
|
|
6112
6111
|
slider: slider,
|
|
@@ -6131,11 +6130,11 @@ function $87effbd9207038ed$export$8cbd8aa1c70f9a13() {
|
|
|
6131
6130
|
return {
|
|
6132
6131
|
constructor_plugin() {
|
|
6133
6132
|
const set_scroll_int = interval_scroll.bind(this);
|
|
6134
|
-
this.container.addEventListener("click",
|
|
6133
|
+
this.container.addEventListener("click", $3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => {
|
|
6135
6134
|
clearInterval(timer);
|
|
6136
6135
|
set_scroll_int();
|
|
6137
6136
|
}));
|
|
6138
|
-
this.container.addEventListener("mousedown",
|
|
6137
|
+
this.container.addEventListener("mousedown", $3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => {
|
|
6139
6138
|
clearInterval(timer);
|
|
6140
6139
|
}));
|
|
6141
6140
|
set_scroll_int();
|
|
@@ -6152,7 +6151,7 @@ function $554d31c9eaabf6ae$export$80039a49055269fb() {
|
|
|
6152
6151
|
return Object.fromEntries(["left", "right"].map(side => [side, [new_arrowimage()]]));
|
|
6153
6152
|
}
|
|
6154
6153
|
function $e193cbc89f3a1c6f$export$af88b4929c2dc86() {
|
|
6155
|
-
const img =
|
|
6154
|
+
const img = $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("img", {
|
|
6156
6155
|
src: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHN0eWxlPSJkaXNwbGF5OiBpbmxpbmUtYmxvY2s7IHZlcnRpY2FsLWFsaWduOiBtaWRkbGU7IiB3aWR0aD0iMTZweCIgaGVpZ2h0PSIxNnB4IiB2aWV3Qm94PSIwIDAgOCAxNSI+PHBhdGggc3R5bGU9ImZpbGw6IHJnYigwLCAwLCAwKTsiIGQ9Ik0uNjI5LjAwMWMuMTUuMDA4LjI5My4wNzIuMzk4LjE4bDYuNzkyIDYuODlhLjYwMS42MDEgMCAwIDEgMCAuODZsLTYuNzkyIDYuODg4YS41ODYuNTg2IDAgMCAxLS44NDYgMCAuNjAxLjYwMSAwIDAgMSAwLS44Nkw2LjU1NCA3LjUuMjExIDEuMDAxYS42MDEuNjAxIDAgMCAxIDAtLjg2Yy4xMTUtLjEuMjY2LS4xNS40MTgtLjE0Ij48L3BhdGg+PC9zdmc+"
|
|
6157
6156
|
});
|
|
6158
6157
|
return {
|
|
@@ -6252,12 +6251,12 @@ function $6f926ca76dc3b69a$export$1d17a045bcc711b1(_ref) {
|
|
|
6252
6251
|
};
|
|
6253
6252
|
}
|
|
6254
6253
|
function $6f926ca76dc3b69a$export$a09282b33e69b43f(unique_name) {
|
|
6255
|
-
return
|
|
6254
|
+
return $f0d9ae7bf9bd697d$export$25062201e9e25d76("label", {
|
|
6256
6255
|
class: "checkbox_container",
|
|
6257
|
-
children: [
|
|
6256
|
+
children: [$f0d9ae7bf9bd697d$export$34b9dba7ce09269b("input", {
|
|
6258
6257
|
type: "radio",
|
|
6259
6258
|
name: "radio-".concat(unique_name)
|
|
6260
|
-
}),
|
|
6259
|
+
}), $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("span", {
|
|
6261
6260
|
class: "checkmark"
|
|
6262
6261
|
})]
|
|
6263
6262
|
});
|
|
@@ -6341,7 +6340,7 @@ function $c99b1fa9d6971fd3$export$411b0f20794697ce(t) {
|
|
|
6341
6340
|
}
|
|
6342
6341
|
function mutation_plugin(intersections, intersecting_mutations) {}
|
|
6343
6342
|
function instant_post_pro(items) {
|
|
6344
|
-
|
|
6343
|
+
$8b27923e1d1e6b99$export$5e63aea0cac01fa0(items, "a, img, canvas").forEach(el => {
|
|
6345
6344
|
// @ts-ignore
|
|
6346
6345
|
el.draggable = false;
|
|
6347
6346
|
el.addEventListener("dragstart", e => {
|
|
@@ -6408,10 +6407,10 @@ function $e243e127ad19fbf8$export$5723caf9a8335aa6(_t) {
|
|
|
6408
6407
|
configurable: true,
|
|
6409
6408
|
enumerable: true,
|
|
6410
6409
|
set(v) {
|
|
6411
|
-
|
|
6410
|
+
$46b94b232dc792af$export$8048b892d651b310(new Error("Cannot set steps to slide manually when using fractional scroll"));
|
|
6412
6411
|
return v;
|
|
6413
6412
|
},
|
|
6414
|
-
get:
|
|
6413
|
+
get: $3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => {
|
|
6415
6414
|
const sliding_width = sliding.getBoundingClientRect().width;
|
|
6416
6415
|
const first_rec = sliding.firstElementChild;
|
|
6417
6416
|
if (!first_rec)
|
|
@@ -6423,7 +6422,7 @@ function $e243e127ad19fbf8$export$5723caf9a8335aa6(_t) {
|
|
|
6423
6422
|
const stepsize_limited_up = max_steps && calculated_stepsize > max_steps ? max_steps : calculated_stepsize;
|
|
6424
6423
|
const stepsize_limited_up_and_down = min_steps && stepsize_limited_up < min_steps ? min_steps : stepsize_limited_up;
|
|
6425
6424
|
const stepby = stepsize_limited_up_and_down || fallback_stepsize;
|
|
6426
|
-
if (stepby != calculated_stepsize)
|
|
6425
|
+
if (stepby != calculated_stepsize) $7f95f77417d06249$export$de56f1198d121036("going by", stepby, "because of max_steps or invalid stepsize");
|
|
6427
6426
|
return stepby;
|
|
6428
6427
|
})
|
|
6429
6428
|
});
|
|
@@ -6437,10 +6436,10 @@ function $e243e127ad19fbf8$export$5723caf9a8335aa6(_t) {
|
|
|
6437
6436
|
function $c051348670fb93e1$export$93223e488e7ee078(options) {
|
|
6438
6437
|
function constructor_plugin(_slider_options) {
|
|
6439
6438
|
var _options$scroll_bar_c, _options$scroll_conta;
|
|
6440
|
-
const scroll_bar =
|
|
6439
|
+
const scroll_bar = $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("div", {
|
|
6441
6440
|
class: "depict_slider_scroll_bar"
|
|
6442
6441
|
});
|
|
6443
|
-
const scroll_container =
|
|
6442
|
+
const scroll_container = $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("div", {
|
|
6444
6443
|
class: "depict_slider_scroll_container"
|
|
6445
6444
|
});
|
|
6446
6445
|
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);
|
|
@@ -6476,14 +6475,14 @@ function $d46a5140a5630463$export$b36d2489a5a16728(_t) {
|
|
|
6476
6475
|
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
6477
6476
|
function constructor_plugin(_slider_options) {
|
|
6478
6477
|
const slider_this = this;
|
|
6479
|
-
const random_classname = "x" +
|
|
6478
|
+
const random_classname = "x" + $a13f25507f352177$export$656831b7e9c341c3().replaceAll(".", "");
|
|
6480
6479
|
slider_this.insert_here.classList.add(random_classname);
|
|
6481
6480
|
const style = document.createElement("style");
|
|
6482
6481
|
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", "}"));
|
|
6483
6482
|
slider_this.snap_style = slider_this.container.appendChild(style);
|
|
6484
6483
|
$d46a5140a5630463$export$49b950309ab787ad().then(we_can => {
|
|
6485
6484
|
if (!we_can) {
|
|
6486
|
-
|
|
6485
|
+
$7f95f77417d06249$export$de56f1198d121036("Disabling slider snapping due browser where it's impossible to have working buttons and css snapping");
|
|
6487
6486
|
style.remove();
|
|
6488
6487
|
delete slider_this["snap_style"];
|
|
6489
6488
|
}
|
|
@@ -6499,9 +6498,9 @@ function $d46a5140a5630463$export$b36d2489a5a16728(_t) {
|
|
|
6499
6498
|
}
|
|
6500
6499
|
async function $d46a5140a5630463$export$49b950309ab787ad() {
|
|
6501
6500
|
if ("scrollBehavior" in document.documentElement.style) return true;
|
|
6502
|
-
const test_div =
|
|
6501
|
+
const test_div = $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("div", {
|
|
6503
6502
|
style: "position: absolute; width: 1em; overflow: scroll; scroll-snap-type: x mandatory;",
|
|
6504
|
-
children:
|
|
6503
|
+
children: $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("div", {
|
|
6505
6504
|
style: "scroll-snap-align: start; color: transparent;",
|
|
6506
6505
|
children: "test"
|
|
6507
6506
|
})
|
|
@@ -6538,14 +6537,14 @@ function $4d2c7d8b06c8c95a$export$dac64fd35a4805a4() {
|
|
|
6538
6537
|
insert_here: sliding
|
|
6539
6538
|
} = this;
|
|
6540
6539
|
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
|
|
6541
|
-
sliding.addEventListener("mousedown",
|
|
6540
|
+
sliding.addEventListener("mousedown", $3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => {
|
|
6542
6541
|
lock_on_element.lock_active = true;
|
|
6543
6542
|
const starting_ratio_left = ratio_left.ratio;
|
|
6544
6543
|
lock_on_element.left = ratio_left.element;
|
|
6545
6544
|
const starting_ratio_right = ratio_right.ratio;
|
|
6546
6545
|
lock_on_element.right = ratio_right.element;
|
|
6547
6546
|
const scroll_left_start = sliding.scrollLeft;
|
|
6548
|
-
const mouseup_listener =
|
|
6547
|
+
const mouseup_listener = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(e => {
|
|
6549
6548
|
lock_on_element.lock_active = false;
|
|
6550
6549
|
const delta_left = Math.abs(ratio_left.ratio - starting_ratio_left);
|
|
6551
6550
|
const delta_right = Math.abs(ratio_right.ratio - starting_ratio_right);
|
|
@@ -6557,7 +6556,7 @@ function $4d2c7d8b06c8c95a$export$dac64fd35a4805a4() {
|
|
|
6557
6556
|
try {
|
|
6558
6557
|
currently_visible = Math.floor(this.insert_here.getBoundingClientRect().width / this.insert_here.firstElementChild.getBoundingClientRect().width);
|
|
6559
6558
|
} catch (e) {
|
|
6560
|
-
|
|
6559
|
+
$3b52ccc10510b32a$export$f18d5b0af29128b7(e, "warning");
|
|
6561
6560
|
}
|
|
6562
6561
|
const stepsize = options.stepsize || currently_visible || 4;
|
|
6563
6562
|
if (scrolled_right) scroll_abs_no_negative(+currently_left + stepsize);else scroll_abs_no_negative(+currently_left - stepsize);
|
|
@@ -6602,8 +6601,8 @@ function $4d2c7d8b06c8c95a$export$dac64fd35a4805a4() {
|
|
|
6602
6601
|
}
|
|
6603
6602
|
}
|
|
6604
6603
|
return {
|
|
6605
|
-
constructor_plugin:
|
|
6606
|
-
mutation_plugin:
|
|
6604
|
+
constructor_plugin: $3b52ccc10510b32a$export$b3bbfd758f11cfa9(constructor_plugin),
|
|
6605
|
+
mutation_plugin: $3b52ccc10510b32a$export$b3bbfd758f11cfa9(mutation_plugin)
|
|
6607
6606
|
};
|
|
6608
6607
|
}
|
|
6609
6608
|
function $69c09f3898892de3$export$53306504b987cbf7() {
|
|
@@ -6627,7 +6626,7 @@ function $69c09f3898892de3$export$53306504b987cbf7() {
|
|
|
6627
6626
|
let are_far_right = false;
|
|
6628
6627
|
let inactive_checker_timeout;
|
|
6629
6628
|
// let elgreen;
|
|
6630
|
-
const check_if_we_inactive =
|
|
6629
|
+
const check_if_we_inactive = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(function () {
|
|
6631
6630
|
var _window2, _window2$performance, _window2$performance$;
|
|
6632
6631
|
// const { insert_here: sliding } = this;
|
|
6633
6632
|
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();
|
|
@@ -6639,7 +6638,7 @@ function $69c09f3898892de3$export$53306504b987cbf7() {
|
|
|
6639
6638
|
// sliding.style.background = "green";
|
|
6640
6639
|
// elgreen = true;
|
|
6641
6640
|
// }
|
|
6642
|
-
|
|
6641
|
+
$3b52ccc10510b32a$export$b3bbfd758f11cfa9($69c09f3898892de3$var$scroll_idle)(this, originally_rendered_elements.length, clones_per_side);
|
|
6643
6642
|
inactive_checker_running = false;
|
|
6644
6643
|
} else {
|
|
6645
6644
|
// if (elgreen !== false) {
|
|
@@ -6653,11 +6652,11 @@ function $69c09f3898892de3$export$53306504b987cbf7() {
|
|
|
6653
6652
|
function constructor_plugin() {
|
|
6654
6653
|
window.addEventListener("touchstart", () => touches++);
|
|
6655
6654
|
window.addEventListener("touchend", () => touches--);
|
|
6656
|
-
this.insert_here.addEventListener("scroll",
|
|
6655
|
+
this.insert_here.addEventListener("scroll", $3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => {
|
|
6657
6656
|
var _window3, _window3$performance, _window3$performance$;
|
|
6658
6657
|
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();
|
|
6659
6658
|
}));
|
|
6660
|
-
const mo = new MutationObserver(
|
|
6659
|
+
const mo = new MutationObserver($3b52ccc10510b32a$export$b3bbfd758f11cfa9(records => {
|
|
6661
6660
|
for (const record of records) for (const node of record.removedNodes) {
|
|
6662
6661
|
if (removed_by_us.has(node)) {
|
|
6663
6662
|
removed_by_us.delete(node);
|
|
@@ -6666,7 +6665,7 @@ function $69c09f3898892de3$export$53306504b987cbf7() {
|
|
|
6666
6665
|
for (const a_set of sets_of_els) {
|
|
6667
6666
|
const index_in_el_set = a_set.indexOf(node);
|
|
6668
6667
|
if (index_in_el_set >= 0) {
|
|
6669
|
-
|
|
6668
|
+
$7f95f77417d06249$export$de56f1198d121036("Removing", node, "from el set", a_set);
|
|
6670
6669
|
a_set.splice(index_in_el_set, 1);
|
|
6671
6670
|
}
|
|
6672
6671
|
}
|
|
@@ -6696,7 +6695,7 @@ function $69c09f3898892de3$export$53306504b987cbf7() {
|
|
|
6696
6695
|
// calculate how many cards including margin the slider fits
|
|
6697
6696
|
const first_rect = first_element.getBoundingClientRect();
|
|
6698
6697
|
if (!first_rect.width) {
|
|
6699
|
-
|
|
6698
|
+
$7f95f77417d06249$export$de56f1198d121036(first_rect);
|
|
6700
6699
|
throw new Error("First rect doesn't have width");
|
|
6701
6700
|
}
|
|
6702
6701
|
const second_rect = second_element.getBoundingClientRect();
|
|
@@ -6714,7 +6713,7 @@ function $69c09f3898892de3$export$53306504b987cbf7() {
|
|
|
6714
6713
|
}
|
|
6715
6714
|
if (dont_wraparound) {
|
|
6716
6715
|
if (surplus_in_body) {
|
|
6717
|
-
|
|
6716
|
+
$7f95f77417d06249$export$de56f1198d121036("Removing surplus of els. Total els: ", sets_of_els);
|
|
6718
6717
|
// @ts-ignore
|
|
6719
6718
|
for (let i = (sets_of_els.length || 1) - 1; i--;) for (let j = 0; j < sets_of_els[i].length; j++) {
|
|
6720
6719
|
const el = sets_of_els[i][j];
|
|
@@ -6730,7 +6729,7 @@ function $69c09f3898892de3$export$53306504b987cbf7() {
|
|
|
6730
6729
|
return;
|
|
6731
6730
|
}
|
|
6732
6731
|
if (!surplus_in_body) {
|
|
6733
|
-
|
|
6732
|
+
$7f95f77417d06249$export$de56f1198d121036("Adding surplus of els");
|
|
6734
6733
|
this.insert_here.append(...sets_of_els.slice(0, -1).flat());
|
|
6735
6734
|
this.invalidate_cache();
|
|
6736
6735
|
surplus_in_body = true;
|
|
@@ -6768,11 +6767,11 @@ function $69c09f3898892de3$export$53306504b987cbf7() {
|
|
|
6768
6767
|
if (our_index >= 0) post_processors.splice(our_index, 1);else {
|
|
6769
6768
|
const msg = "Couldn't find ourselves in post processors, infinite loop might ensue. Exiting. Wraparound will be broken.";
|
|
6770
6769
|
(0, $902c0e005afb7319$export$af2e17a20c2ea3c5).captureException(new Error(msg));
|
|
6771
|
-
|
|
6770
|
+
$7f95f77417d06249$export$de56f1198d121036(msg, () => {});
|
|
6772
6771
|
return elements;
|
|
6773
6772
|
}
|
|
6774
6773
|
for (let i = 0; i < clones_per_side * 2; i++) {
|
|
6775
|
-
const additional_render = await
|
|
6774
|
+
const additional_render = await $8f0d01ff20cfba68$export$a9fc160c5ed83bd7(info.t, {
|
|
6776
6775
|
...rendering_options,
|
|
6777
6776
|
post_processors: post_processors,
|
|
6778
6777
|
pre_processors: [],
|
|
@@ -6888,7 +6887,7 @@ function $afa8ff8cb08175b9$export$515c3ea4d599b05a(
|
|
|
6888
6887
|
query, handler) {
|
|
6889
6888
|
var _window, _window$matchMedia;
|
|
6890
6889
|
let initial_call = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
6891
|
-
const catchified_handler =
|
|
6890
|
+
const catchified_handler = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(handler, "Error in media query listener callback");
|
|
6892
6891
|
if (typeof window !== "object") {
|
|
6893
6892
|
// on server call the handler in case nothing is rendered if it isn't called, then do nothing
|
|
6894
6893
|
catchified_handler({
|
|
@@ -6917,9 +6916,9 @@ async function $e1cfe4c7c02bb32a$export$417ef0ab13d8b984(_ref) {
|
|
|
6917
6916
|
let resolve_success_promise;
|
|
6918
6917
|
const success_promise = new Promise(r => resolve_success_promise = r);
|
|
6919
6918
|
const cache = new Map();
|
|
6920
|
-
const [template_els, _get, set_els] =
|
|
6921
|
-
const catchified_switch_to_surface =
|
|
6922
|
-
|
|
6919
|
+
const [template_els, _get, set_els] = $12ec80c27422ece4$export$3d04c40e7acc1a32();
|
|
6920
|
+
const catchified_switch_to_surface = $3b52ccc10510b32a$export$b3bbfd758f11cfa9($e1cfe4c7c02bb32a$var$switch_to_surface);
|
|
6921
|
+
$3b52ccc10510b32a$export$b3bbfd758f11cfa9(async () => {
|
|
6923
6922
|
for await (const surface of current_surface_) {
|
|
6924
6923
|
const rendering_function = surface_rendering_functions_[surface];
|
|
6925
6924
|
catchified_switch_to_surface(surface, rendering_function, current_surface_, cache, set_els, resolve_success_promise);
|
|
@@ -6938,9 +6937,9 @@ async function $e1cfe4c7c02bb32a$var$switch_to_surface(surface_index, rendering_
|
|
|
6938
6937
|
const {
|
|
6939
6938
|
cache_until_: cache_until_,
|
|
6940
6939
|
surface_: surface_
|
|
6941
|
-
} = await rendering_function().catch(e => (
|
|
6940
|
+
} = await rendering_function().catch(e => ($3b52ccc10510b32a$export$f18d5b0af29128b7([e, "error in rendering"], "warning"), {}));
|
|
6942
6941
|
if (!surface_ || !(surface_ !== null && surface_ !== void 0 && (_surface_$elements = surface_.elements) !== null && _surface_$elements !== void 0 && _surface_$elements.length)) {
|
|
6943
|
-
|
|
6942
|
+
$7f95f77417d06249$export$de56f1198d121036("Got no/empty surface, not switching");
|
|
6944
6943
|
// also tell insert_surface that we didn't get recs so it can revert, dunno if we want this
|
|
6945
6944
|
resolve_success_promise(false);
|
|
6946
6945
|
return;
|
|
@@ -6948,17 +6947,17 @@ async function $e1cfe4c7c02bb32a$var$switch_to_surface(surface_index, rendering_
|
|
|
6948
6947
|
rendered_surface = surface_;
|
|
6949
6948
|
if (cache_until_ instanceof Promise) {
|
|
6950
6949
|
cache.set(surface_index, surface_);
|
|
6951
|
-
cache_until_.then(
|
|
6950
|
+
cache_until_.then($3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => cache.delete(surface_index)));
|
|
6952
6951
|
}
|
|
6953
6952
|
}
|
|
6954
6953
|
if (current_surface_ipns.state !== surface_index) {
|
|
6955
|
-
|
|
6954
|
+
$7f95f77417d06249$export$de56f1198d121036("Surface switched to", current_surface_ipns.state, "while rendering surface", surface_index, "discarding results");
|
|
6956
6955
|
return;
|
|
6957
6956
|
}
|
|
6958
6957
|
set_els(rendered_surface.elements);
|
|
6959
6958
|
if (rendered_surface.should_stay_inserted instanceof Promise)
|
|
6960
6959
|
// if there is promise that says if surface succeeded or not, use that
|
|
6961
|
-
rendered_surface.should_stay_inserted.then(
|
|
6960
|
+
rendered_surface.should_stay_inserted.then($3b52ccc10510b32a$export$b3bbfd758f11cfa9(success => {
|
|
6962
6961
|
resolve_success_promise(success);
|
|
6963
6962
|
}));else
|
|
6964
6963
|
// otherwise let's just assume it suceeded since there are elements
|
|
@@ -6966,12 +6965,12 @@ async function $e1cfe4c7c02bb32a$var$switch_to_surface(surface_index, rendering_
|
|
|
6966
6965
|
}
|
|
6967
6966
|
function $e1cfe4c7c02bb32a$export$419f84efad7d9fe(surface_per_size, cleanup_promise) {
|
|
6968
6967
|
let microtask_queued = false;
|
|
6969
|
-
const ipns =
|
|
6968
|
+
const ipns = $76a59c6ce18c8fd3$export$e806c6c1615a59ae();
|
|
6970
6969
|
const target_indexes = new Set();
|
|
6971
|
-
const dedupe_overlapping_queries =
|
|
6970
|
+
const dedupe_overlapping_queries = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => {
|
|
6972
6971
|
microtask_queued = false;
|
|
6973
6972
|
const first_value = target_indexes[Symbol.iterator]().next().value;
|
|
6974
|
-
if (first_value === ipns.latest_call_value)
|
|
6973
|
+
if (first_value === ipns.latest_call_value) $7f95f77417d06249$export$de56f1198d121036("surface", first_value, "is already selected");else ipns(first_value);
|
|
6975
6974
|
if (target_indexes.size > 1) {
|
|
6976
6975
|
const error_string = "Multiple matching media queries detected, used first one: " + JSON.stringify(surface_per_size.filter(_ref2 => {
|
|
6977
6976
|
let [index] = _ref2;
|
|
@@ -6984,10 +6983,10 @@ function $e1cfe4c7c02bb32a$export$419f84efad7d9fe(surface_per_size, cleanup_prom
|
|
|
6984
6983
|
});
|
|
6985
6984
|
surface_per_size.forEach(_ref3 => {
|
|
6986
6985
|
let [surface_index, min, max] = _ref3;
|
|
6987
|
-
const media_query =
|
|
6986
|
+
const media_query = $0c2e69f971c62390$export$717f13d9ba00ca19(min, max).split("@media ").pop();
|
|
6988
6987
|
const {
|
|
6989
6988
|
remove: remove
|
|
6990
|
-
} =
|
|
6989
|
+
} = $afa8ff8cb08175b9$export$515c3ea4d599b05a(media_query, _ref4 => {
|
|
6991
6990
|
let {
|
|
6992
6991
|
matches: matches
|
|
6993
6992
|
} = _ref4;
|
|
@@ -6998,21 +6997,21 @@ function $e1cfe4c7c02bb32a$export$419f84efad7d9fe(surface_per_size, cleanup_prom
|
|
|
6998
6997
|
microtask_queued = true;
|
|
6999
6998
|
}
|
|
7000
6999
|
});
|
|
7001
|
-
if (cleanup_promise instanceof Promise) cleanup_promise.then(remove);else
|
|
7000
|
+
if (cleanup_promise instanceof Promise) cleanup_promise.then(remove);else $8b0f4f54739f2574$export$1cd22bab0d2c3b0b(remove);
|
|
7002
7001
|
});
|
|
7003
7002
|
return ipns;
|
|
7004
7003
|
}
|
|
7005
7004
|
function $e1cfe4c7c02bb32a$export$be95cb0e8cfd099e() {
|
|
7006
|
-
return new Promise(r =>
|
|
7005
|
+
return new Promise(r => $8b0f4f54739f2574$export$1cd22bab0d2c3b0b(r));
|
|
7007
7006
|
}
|
|
7008
7007
|
function $78fd85c1f4513422$export$3ebd86018b39d9d2(t, selector, filter) {
|
|
7009
7008
|
(0, $03c157d68c9fcbac$export$b6ae1bc530f4c149).onexists(selector, eoe => {
|
|
7010
|
-
|
|
7009
|
+
$7f95f77417d06249$export$de56f1198d121036("Order confirmation element showed up!", eoe);
|
|
7011
7010
|
const {
|
|
7012
7011
|
element: element
|
|
7013
7012
|
} = eoe;
|
|
7014
7013
|
const the_id = element.innerText;
|
|
7015
|
-
$78fd85c1f4513422$export$1ac466d53a6636ac(t, the_id,
|
|
7014
|
+
$78fd85c1f4513422$export$1ac466d53a6636ac(t, the_id, $335c248bb07a3509$export$6399bdb2291895e0(), filter);
|
|
7016
7015
|
});
|
|
7017
7016
|
}
|
|
7018
7017
|
function $78fd85c1f4513422$export$b11248fa13a8a86c(tenant, id_extractor) {
|
|
@@ -7030,7 +7029,7 @@ function $78fd85c1f4513422$export$b11248fa13a8a86c(tenant, id_extractor) {
|
|
|
7030
7029
|
try {
|
|
7031
7030
|
maybe_send_entries(args_list);
|
|
7032
7031
|
} catch (e) {
|
|
7033
|
-
|
|
7032
|
+
$3b52ccc10510b32a$export$f18d5b0af29128b7([e, "Extracting and sending transaction IDs from dataLayer failed"], "warning");
|
|
7034
7033
|
}
|
|
7035
7034
|
return target.apply(this_arg, args_list);
|
|
7036
7035
|
}
|
|
@@ -7042,17 +7041,17 @@ function $78fd85c1f4513422$export$ff8673d5dea82bd4(tenant, id_extractor) {
|
|
|
7042
7041
|
const order_id = id_extractor(new URL(href));
|
|
7043
7042
|
if (order_id && typeof order_id === "string") $78fd85c1f4513422$export$1ac466d53a6636ac(tenant, order_id);
|
|
7044
7043
|
}
|
|
7045
|
-
})().catch(e =>
|
|
7044
|
+
})().catch(e => $3b52ccc10510b32a$export$f18d5b0af29128b7([e, "Extracting and sending transaction IDs from URL failed"], "warning"));
|
|
7046
7045
|
}
|
|
7047
7046
|
function $78fd85c1f4513422$export$1ac466d53a6636ac(t, input_id) {
|
|
7048
|
-
let dsid = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] :
|
|
7047
|
+
let dsid = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : $335c248bb07a3509$export$6399bdb2291895e0();
|
|
7049
7048
|
let filter = arguments.length > 3 ? arguments[3] : undefined;
|
|
7050
7049
|
const transaction_id = typeof filter == "function" ? filter(input_id) : input_id;
|
|
7051
7050
|
if (!transaction_id) {
|
|
7052
|
-
|
|
7051
|
+
$7f95f77417d06249$export$de56f1198d121036("Not sending", transaction_id, "because it didn't pass filter");
|
|
7053
7052
|
return;
|
|
7054
7053
|
}
|
|
7055
|
-
|
|
7054
|
+
$7f95f77417d06249$export$de56f1198d121036("Sending this order id:", transaction_id, "(before filtering it was", input_id, ")");
|
|
7056
7055
|
const payload = {
|
|
7057
7056
|
"tenant": t.tenant,
|
|
7058
7057
|
"market": t.market,
|
|
@@ -7062,37 +7061,37 @@ function $78fd85c1f4513422$export$1ac466d53a6636ac(t, input_id) {
|
|
|
7062
7061
|
dsid: dsid
|
|
7063
7062
|
}]
|
|
7064
7063
|
};
|
|
7065
|
-
|
|
7064
|
+
$49880c4ce4bb7db2$export$cc3b6ddf805f6156((0, $62869a3ed703f236$export$362abebb4b313340) + "/v2/track", payload);
|
|
7066
7065
|
}
|
|
7067
7066
|
function $138f1061348967b4$export$1ff14fec60ed5697(t, filter) {
|
|
7068
7067
|
try {
|
|
7069
|
-
|
|
7070
|
-
ga(
|
|
7068
|
+
$f812c921818adbe0$export$674d8cd8b6868154();
|
|
7069
|
+
ga($3b52ccc10510b32a$export$b3bbfd758f11cfa9(async function (tracker) {
|
|
7071
7070
|
var _window, _window$ga;
|
|
7072
7071
|
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
|
|
7073
|
-
if (typeof get_all_function !== "function") get_all_function = await
|
|
7072
|
+
if (typeof get_all_function !== "function") get_all_function = await $6bf620c74776aef6$export$2fc1a072736ae2f6(window, "ga", "getAll");
|
|
7074
7073
|
const all_trackers = get_all_function.call(ga);
|
|
7075
|
-
|
|
7074
|
+
$7f95f77417d06249$export$de56f1198d121036("we have trackers", all_trackers);
|
|
7076
7075
|
// @ts-ignore
|
|
7077
7076
|
const {
|
|
7078
7077
|
P: P
|
|
7079
7078
|
} = ga;
|
|
7080
|
-
|
|
7079
|
+
$3b52ccc10510b32a$export$b3bbfd758f11cfa9(modify_trackers_of_iterable)(all_trackers);
|
|
7081
7080
|
if (typeof (P === null || P === void 0 ? void 0 : P.push) === "function")
|
|
7082
7081
|
// this check is just so we don't fail if this doesn't exist for some reason, but it always should
|
|
7083
7082
|
P.push = new Proxy(P.push, {
|
|
7084
7083
|
apply(target, this_arg, args_list) {
|
|
7085
7084
|
const retval = target.apply(this_arg, args_list);
|
|
7086
|
-
|
|
7085
|
+
$3b52ccc10510b32a$export$b3bbfd758f11cfa9(modify_trackers_of_iterable)(args_list);
|
|
7087
7086
|
return retval;
|
|
7088
7087
|
}
|
|
7089
7088
|
});
|
|
7090
7089
|
function modify_trackers_of_iterable(array) {
|
|
7091
|
-
for (const tracker of array)
|
|
7090
|
+
for (const tracker of array) $3b52ccc10510b32a$export$b3bbfd758f11cfa9($138f1061348967b4$var$make_tracker_send_to_depict)(tracker, t, filter);
|
|
7092
7091
|
}
|
|
7093
7092
|
}));
|
|
7094
7093
|
} catch (error) {
|
|
7095
|
-
|
|
7094
|
+
$3b52ccc10510b32a$export$f18d5b0af29128b7(error, "error");
|
|
7096
7095
|
}
|
|
7097
7096
|
}
|
|
7098
7097
|
function $138f1061348967b4$var$make_tracker_send_to_depict(ga_tracker, t, filter) {
|
|
@@ -7104,22 +7103,22 @@ function $138f1061348967b4$var$make_tracker_send_to_depict(ga_tracker, t, filter
|
|
|
7104
7103
|
originalSendHitTask(model);
|
|
7105
7104
|
// console.log('Sent original hit, now sending to depict');
|
|
7106
7105
|
try {
|
|
7107
|
-
const dsid =
|
|
7106
|
+
const dsid = $335c248bb07a3509$export$6399bdb2291895e0();
|
|
7108
7107
|
const payload = model.get("hitPayload");
|
|
7109
7108
|
const sp = new URLSearchParams(payload);
|
|
7110
7109
|
const id = sp.get("ti");
|
|
7111
7110
|
if (id) {
|
|
7112
|
-
|
|
7113
|
-
|
|
7111
|
+
$7f95f77417d06249$export$de56f1198d121036("Got interesting analytics request", payload, id);
|
|
7112
|
+
$78fd85c1f4513422$export$1ac466d53a6636ac(t, id, dsid, filter);
|
|
7114
7113
|
}
|
|
7115
7114
|
} catch (e) {
|
|
7116
|
-
|
|
7115
|
+
$3b52ccc10510b32a$export$f18d5b0af29128b7(e, "error");
|
|
7117
7116
|
}
|
|
7118
7117
|
});
|
|
7119
7118
|
}
|
|
7120
7119
|
async function $3cb1cfeb94b7f96b$export$d63b08f4f29ddba5(t, unavailability_type) {
|
|
7121
7120
|
const product_id = await t.get_product_id();
|
|
7122
|
-
|
|
7121
|
+
$7f95f77417d06249$export$de56f1198d121036("Notifying Depict that product id: ".concat(product_id, " is ").concat(unavailability_type));
|
|
7123
7122
|
const payload = {
|
|
7124
7123
|
"tenant": t.tenant,
|
|
7125
7124
|
"market": t.market,
|
|
@@ -7127,11 +7126,11 @@ async function $3cb1cfeb94b7f96b$export$d63b08f4f29ddba5(t, unavailability_type)
|
|
|
7127
7126
|
event_type: "product_unavailable",
|
|
7128
7127
|
product_id: product_id,
|
|
7129
7128
|
unavailability_type: unavailability_type,
|
|
7130
|
-
user_id:
|
|
7131
|
-
dsid:
|
|
7129
|
+
user_id: $335c248bb07a3509$export$adc61a405a4cabed(),
|
|
7130
|
+
dsid: $335c248bb07a3509$export$6399bdb2291895e0()
|
|
7132
7131
|
}]
|
|
7133
7132
|
};
|
|
7134
|
-
|
|
7133
|
+
$49880c4ce4bb7db2$export$cc3b6ddf805f6156((0, $62869a3ed703f236$export$362abebb4b313340) + "/v2/track", payload);
|
|
7135
7134
|
}
|
|
7136
7135
|
function $89eca8044393f350$var$_classPrivateFieldInitSpec(obj, privateMap, value) {
|
|
7137
7136
|
$89eca8044393f350$var$_checkPrivateRedeclaration(obj, privateMap);
|
|
@@ -7150,21 +7149,21 @@ class $89eca8044393f350$export$74108888f38788f3 extends Set {
|
|
|
7150
7149
|
});
|
|
7151
7150
|
}
|
|
7152
7151
|
addEventListener(event, callback, options) {
|
|
7153
|
-
|
|
7152
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $89eca8044393f350$var$_et).addEventListener(event, callback, options);
|
|
7154
7153
|
}
|
|
7155
7154
|
removeEventListener(event, callback) {
|
|
7156
|
-
|
|
7155
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $89eca8044393f350$var$_et).removeEventListener(event, callback);
|
|
7157
7156
|
}
|
|
7158
7157
|
add(property) {
|
|
7159
7158
|
Set.prototype.add.call(this, property);
|
|
7160
|
-
|
|
7159
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $89eca8044393f350$var$_et).dispatchEvent(new CustomEvent("add", {
|
|
7161
7160
|
detail: property
|
|
7162
7161
|
}));
|
|
7163
7162
|
return this;
|
|
7164
7163
|
}
|
|
7165
7164
|
delete(property) {
|
|
7166
7165
|
const return_value = Set.prototype.delete.call(this, property);
|
|
7167
|
-
|
|
7166
|
+
$parcel$interopDefault($bBfCy$babelruntimehelpersclassPrivateFieldGet)(this, $89eca8044393f350$var$_et).dispatchEvent(new CustomEvent("delete", {
|
|
7168
7167
|
detail: property
|
|
7169
7168
|
}));
|
|
7170
7169
|
return return_value;
|
|
@@ -7204,11 +7203,11 @@ const $8d5f2590ee4a4ec9$export$9426572bd5645bc1 = (arr1, arr2) => $8d5f2590ee4a4
|
|
|
7204
7203
|
function $d32733ed2d9db863$export$82539d9817116aff(e, url) {
|
|
7205
7204
|
var _window, _window$next;
|
|
7206
7205
|
if (e.button) {
|
|
7207
|
-
|
|
7206
|
+
$7f95f77417d06249$export$de56f1198d121036("Not single page navigating because button is not 0", e);
|
|
7208
7207
|
return;
|
|
7209
7208
|
}
|
|
7210
7209
|
if (e.metaKey || e.ctrlKey) {
|
|
7211
|
-
|
|
7210
|
+
$7f95f77417d06249$export$de56f1198d121036("Someone command-clicked a link, not single page navigating");
|
|
7212
7211
|
return;
|
|
7213
7212
|
}
|
|
7214
7213
|
// single page navigate
|
|
@@ -7271,7 +7270,7 @@ class $fe05042754d72fbc$export$f8da66bc4f1d059e extends Response {
|
|
|
7271
7270
|
}
|
|
7272
7271
|
}
|
|
7273
7272
|
function $675e948221f082fe$export$ab0f802c05dd969b(on_request) {
|
|
7274
|
-
|
|
7273
|
+
$fe05042754d72fbc$export$85be83e1935d93c2(async (target, this_arg, argument_list) => {
|
|
7275
7274
|
const response_promise = target.apply(this_arg, argument_list);
|
|
7276
7275
|
try {
|
|
7277
7276
|
const input = argument_list[0];
|
|
@@ -7308,7 +7307,7 @@ function $675e948221f082fe$export$ab0f802c05dd969b(on_request) {
|
|
|
7308
7307
|
break;
|
|
7309
7308
|
}
|
|
7310
7309
|
} catch (e) {
|
|
7311
|
-
|
|
7310
|
+
$3b52ccc10510b32a$export$f18d5b0af29128b7([e, "error in shopify interception logic"], "warning");
|
|
7312
7311
|
}
|
|
7313
7312
|
return await response_promise;
|
|
7314
7313
|
}, true);
|
|
@@ -7341,8 +7340,8 @@ async function $675e948221f082fe$export$337197b94b3bd680() {
|
|
|
7341
7340
|
const json = await response.json();
|
|
7342
7341
|
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"));
|
|
7343
7342
|
}
|
|
7344
|
-
const $675e948221f082fe$export$783ef16647773b3d = /*@__PURE__
|
|
7345
|
-
const meta = await
|
|
7343
|
+
const $675e948221f082fe$export$783ef16647773b3d = /*@__PURE__*/$9cefb304a1734a6b$export$535946eb77c946dd( /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9(async () => {
|
|
7344
|
+
const meta = await $6bf620c74776aef6$export$2fc1a072736ae2f6(window, "ShopifyAnalytics", "meta");
|
|
7346
7345
|
return meta === null || meta === void 0 ? void 0 : meta.product;
|
|
7347
7346
|
}));
|
|
7348
7347
|
async function $62dc027339ca682b$export$b404e20f3c4a490e(_ref) {
|
|
@@ -7357,7 +7356,7 @@ async function $62dc027339ca682b$export$b404e20f3c4a490e(_ref) {
|
|
|
7357
7356
|
Sentry: Sentry
|
|
7358
7357
|
} = t,
|
|
7359
7358
|
start = new Date().getTime(),
|
|
7360
|
-
optimize = await
|
|
7359
|
+
optimize = await $6bf620c74776aef6$export$2fc1a072736ae2f6(window, "google_optimize"),
|
|
7361
7360
|
end = new Date().getTime();
|
|
7362
7361
|
dlog("Waited for google_optimize for", end - start, "ms");
|
|
7363
7362
|
// if (!optimize.get) {
|
|
@@ -7384,20 +7383,20 @@ async function $62dc027339ca682b$export$b404e20f3c4a490e(_ref) {
|
|
|
7384
7383
|
function $31fdda675c3d3017$export$2c2f50b30b7b2576(el, attribute_name, async_iterable) {
|
|
7385
7384
|
let quit_after_navigation = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
7386
7385
|
(async () => {
|
|
7387
|
-
const [exit, exitable_iterable] =
|
|
7388
|
-
if (quit_after_navigation)
|
|
7386
|
+
const [exit, exitable_iterable] = $c0c977a0f691adf3$export$927664b47117acb0(async_iterable);
|
|
7387
|
+
if (quit_after_navigation) $8b0f4f54739f2574$export$1cd22bab0d2c3b0b(exit);
|
|
7389
7388
|
for await (const new_value of exitable_iterable) el.setAttribute(attribute_name, new_value);
|
|
7390
|
-
})().catch(e =>
|
|
7389
|
+
})().catch(e => $3b52ccc10510b32a$export$f18d5b0af29128b7([e, "Failed to set attribute"], "error"));
|
|
7391
7390
|
return el;
|
|
7392
7391
|
}
|
|
7393
7392
|
function $fbf41b4abc726dbe$export$7c081fdbc65b6a2a(async_iterable) {
|
|
7394
7393
|
let quit_after_navigation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
7395
|
-
const [template_els, _get, set] =
|
|
7394
|
+
const [template_els, _get, set] = $12ec80c27422ece4$export$3d04c40e7acc1a32();
|
|
7396
7395
|
(async () => {
|
|
7397
|
-
const [exit, exitable_iterable] =
|
|
7398
|
-
if (quit_after_navigation)
|
|
7396
|
+
const [exit, exitable_iterable] = $c0c977a0f691adf3$export$927664b47117acb0(async_iterable);
|
|
7397
|
+
if (quit_after_navigation) $8b0f4f54739f2574$export$1cd22bab0d2c3b0b(exit);
|
|
7399
7398
|
for await (const els of exitable_iterable) set(els);
|
|
7400
|
-
})().catch(e =>
|
|
7399
|
+
})().catch(e => $3b52ccc10510b32a$export$f18d5b0af29128b7([e, "Failed to convert AsyncIterable to elements"], "error"));
|
|
7401
7400
|
return template_els;
|
|
7402
7401
|
}
|
|
7403
7402
|
let $51fea29d5f0a339b$var$context_counter = 0; // last context that was created (unless 0), to make sure we don't have two of the same
|
|
@@ -7458,10 +7457,10 @@ function $51fea29d5f0a339b$export$f811d2ce0aa6019b(_ref) {
|
|
|
7458
7457
|
(_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
|
|
7459
7458
|
disconnect_reinsertion_observers = $51fea29d5f0a339b$var$actual_insertion(element, verb, surfaces, try_forever, href, context, remove_after_navigation, preserve_elements);
|
|
7460
7459
|
});
|
|
7461
|
-
if (!try_forever)
|
|
7460
|
+
if (!try_forever) $8b0f4f54739f2574$export$1cd22bab0d2c3b0b(disconnect_observer);
|
|
7462
7461
|
} else {
|
|
7463
7462
|
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" : ""));
|
|
7464
|
-
|
|
7463
|
+
$3b52ccc10510b32a$export$b3bbfd758f11cfa9($51fea29d5f0a339b$var$actual_insertion)(target, verb, surfaces, try_forever, href, context, remove_after_navigation, preserve_elements);
|
|
7465
7464
|
}
|
|
7466
7465
|
return surfaces.map(_ref3 => {
|
|
7467
7466
|
let {
|
|
@@ -7470,14 +7469,14 @@ function $51fea29d5f0a339b$export$f811d2ce0aa6019b(_ref) {
|
|
|
7470
7469
|
return promise_;
|
|
7471
7470
|
});
|
|
7472
7471
|
}
|
|
7473
|
-
const $51fea29d5f0a339b$export$e3f70ef7e3d00501 = /*@__PURE__
|
|
7472
|
+
const $51fea29d5f0a339b$export$e3f70ef7e3d00501 = /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9(async (target, should_stay_inserted) => {
|
|
7474
7473
|
const per_el_fn = (el, disconnect_observer) => {
|
|
7475
7474
|
const comment_node = document.createComment("Old recs were here // Depict");
|
|
7476
|
-
|
|
7475
|
+
$7f95f77417d06249$export$de56f1198d121036("Replacing", el, "with", comment_node);
|
|
7477
7476
|
el.replaceWith(comment_node);
|
|
7478
7477
|
should_stay_inserted.then(keep => {
|
|
7479
7478
|
if (!keep) {
|
|
7480
|
-
|
|
7479
|
+
$7f95f77417d06249$export$de56f1198d121036("Reverting", comment_node, "to", el);
|
|
7481
7480
|
comment_node.replaceWith(el);
|
|
7482
7481
|
disconnect_observer === null || disconnect_observer === void 0 || disconnect_observer();
|
|
7483
7482
|
}
|
|
@@ -7491,7 +7490,7 @@ const $51fea29d5f0a339b$export$e3f70ef7e3d00501 = /*@__PURE__*/(0, $3b52ccc10510
|
|
|
7491
7490
|
} = _ref4;
|
|
7492
7491
|
return per_el_fn(element, disconnector);
|
|
7493
7492
|
});
|
|
7494
|
-
|
|
7493
|
+
$8b0f4f54739f2574$export$1cd22bab0d2c3b0b(disconnect_observer);
|
|
7495
7494
|
} else {
|
|
7496
7495
|
let did_already_fail = false;
|
|
7497
7496
|
should_stay_inserted.then(should_stay_inserted => {
|
|
@@ -7499,7 +7498,7 @@ const $51fea29d5f0a339b$export$e3f70ef7e3d00501 = /*@__PURE__*/(0, $3b52ccc10510
|
|
|
7499
7498
|
});
|
|
7500
7499
|
await 0;
|
|
7501
7500
|
if (did_already_fail) {
|
|
7502
|
-
|
|
7501
|
+
$7f95f77417d06249$export$de56f1198d121036("Not removing", target, should_stay_inserted, "is already resolved to false");
|
|
7503
7502
|
return;
|
|
7504
7503
|
}
|
|
7505
7504
|
if (Array.isArray(target)) for (let i = 0; i < target.length; i++) per_el_fn(target[i]);else per_el_fn(target);
|
|
@@ -7514,7 +7513,7 @@ function $51fea29d5f0a339b$var$actual_insertion(target, verb, surfaces, try_fore
|
|
|
7514
7513
|
const disconnect_all_observers = () => disconnectors.forEach(disconnector => disconnector());
|
|
7515
7514
|
const check_if_revert_whole = () => {
|
|
7516
7515
|
if (failed_surfaces !== surfaces.length) return; // we didn't fail
|
|
7517
|
-
|
|
7516
|
+
$7f95f77417d06249$export$de56f1198d121036("All surfaces", surfaces, "failed. ".concat(was_replaced ? "Reverting to old els" : "removing els"));
|
|
7518
7517
|
$51fea29d5f0a339b$var$failed_contexts.add(context);
|
|
7519
7518
|
disconnect_all_observers();
|
|
7520
7519
|
const flat_tnodes = template_nodes.flat();
|
|
@@ -7528,29 +7527,29 @@ function $51fea29d5f0a339b$var$actual_insertion(target, verb, surfaces, try_fore
|
|
|
7528
7527
|
surface_: surface_,
|
|
7529
7528
|
resolve_promise_: resolve_promise_
|
|
7530
7529
|
} = _ref5;
|
|
7531
|
-
const [template_els, _get, set] =
|
|
7530
|
+
const [template_els, _get, set] = $12ec80c27422ece4$export$3d04c40e7acc1a32();
|
|
7532
7531
|
(async _surface => {
|
|
7533
7532
|
let surface;
|
|
7534
7533
|
try {
|
|
7535
7534
|
surface = await surface_;
|
|
7536
7535
|
} catch (e) {
|
|
7537
|
-
|
|
7536
|
+
$3b52ccc10510b32a$export$f18d5b0af29128b7([e, "A surface promise rejected" + (process.env.DEBUG === "true" ? " please catch this earlier" : "")], "warning");
|
|
7538
7537
|
}
|
|
7539
7538
|
if (!try_forever && location.href !== starting_href)
|
|
7540
7539
|
// navigated away
|
|
7541
7540
|
return;
|
|
7542
7541
|
// @ts-ignore
|
|
7543
7542
|
if ((_surface = surface) !== null && _surface !== void 0 && _surface.elements) {
|
|
7544
|
-
|
|
7543
|
+
$7f95f77417d06249$export$de56f1198d121036("insert_surface:", target, "." + verb, surface);
|
|
7545
7544
|
set(surface.elements);
|
|
7546
|
-
if (surface.should_stay_inserted instanceof Promise) surface.should_stay_inserted.then(
|
|
7545
|
+
if (surface.should_stay_inserted instanceof Promise) surface.should_stay_inserted.then($3b52ccc10510b32a$export$b3bbfd758f11cfa9(keep => {
|
|
7547
7546
|
if (keep)
|
|
7548
7547
|
// @ts-ignore
|
|
7549
7548
|
resolve_promise_({
|
|
7550
7549
|
surface: surface,
|
|
7551
7550
|
succeeded: true
|
|
7552
7551
|
});else {
|
|
7553
|
-
|
|
7552
|
+
$7f95f77417d06249$export$de56f1198d121036("Removing surface", surface, "because it failed");
|
|
7554
7553
|
set("");
|
|
7555
7554
|
// @ts-ignore
|
|
7556
7555
|
resolve_promise_({
|
|
@@ -7573,7 +7572,7 @@ function $51fea29d5f0a339b$var$actual_insertion(target, verb, surfaces, try_fore
|
|
|
7573
7572
|
failed_surfaces++;
|
|
7574
7573
|
check_if_revert_whole();
|
|
7575
7574
|
}
|
|
7576
|
-
})().catch(e =>
|
|
7575
|
+
})().catch(e => $3b52ccc10510b32a$export$f18d5b0af29128b7([e, "insert_surface failed due to technical errors"], "error"));
|
|
7577
7576
|
return template_els;
|
|
7578
7577
|
});
|
|
7579
7578
|
target[verb](...template_nodes.flat());
|
|
@@ -7582,10 +7581,10 @@ function $51fea29d5f0a339b$var$actual_insertion(target, verb, surfaces, try_fore
|
|
|
7582
7581
|
const already_observing_nodes = new WeakSet();
|
|
7583
7582
|
$51fea29d5f0a339b$var$deal_w_removal_of_node_array(node_array, disconnectors.push.bind(disconnectors), already_observing_nodes);
|
|
7584
7583
|
}
|
|
7585
|
-
if (remove_after_navigation)
|
|
7584
|
+
if (remove_after_navigation) $8b0f4f54739f2574$export$1cd22bab0d2c3b0b(() => {
|
|
7586
7585
|
disconnect_all_observers();
|
|
7587
7586
|
template_nodes.flat().forEach(tn => tn.remove());
|
|
7588
|
-
|
|
7587
|
+
$7f95f77417d06249$export$de56f1198d121036("Removed", template_nodes, "due to navigation");
|
|
7589
7588
|
});
|
|
7590
7589
|
return disconnect_all_observers;
|
|
7591
7590
|
}
|
|
@@ -7609,7 +7608,7 @@ function $51fea29d5f0a339b$var$deal_w_removal_of_node_array(node_array, push_dis
|
|
|
7609
7608
|
target: target
|
|
7610
7609
|
} = mutation_record;
|
|
7611
7610
|
if (previous_parent !== target) {
|
|
7612
|
-
|
|
7611
|
+
$7f95f77417d06249$export$de56f1198d121036(element, "was removed", eoe, "but because a parent got removed we're keeping it that way");
|
|
7613
7612
|
return;
|
|
7614
7613
|
}
|
|
7615
7614
|
if (node_array.every(node => target.contains(node))) {
|
|
@@ -7617,18 +7616,18 @@ function $51fea29d5f0a339b$var$deal_w_removal_of_node_array(node_array, push_dis
|
|
|
7617
7616
|
// node_array is a reference to an updating array
|
|
7618
7617
|
// it has always updated once this callback is ran, so we can just check if the new value are currently in the DOM
|
|
7619
7618
|
// here we don't check the order but I don't think it's going to be an issue?
|
|
7620
|
-
|
|
7619
|
+
$7f95f77417d06249$export$de56f1198d121036("Ignoring removal of", element, eoe, "because it seems to come from reactive_template change");
|
|
7621
7620
|
// protect future nodes
|
|
7622
7621
|
$51fea29d5f0a339b$var$deal_w_removal_of_node_array(node_array, push_disconnector, already_observing_nodes);
|
|
7623
7622
|
} else if (!target.contains(element)) {
|
|
7624
7623
|
// 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
|
|
7625
7624
|
if (removals_in_last_s > 10) {
|
|
7626
|
-
|
|
7625
|
+
$7f95f77417d06249$export$de56f1198d121036("More than 10 reinsertions in last second, ignoring");
|
|
7627
7626
|
return;
|
|
7628
7627
|
}
|
|
7629
7628
|
removals_in_last_s++;
|
|
7630
7629
|
setTimeout(() => removals_in_last_s--, 1000);
|
|
7631
|
-
|
|
7630
|
+
$7f95f77417d06249$export$de56f1198d121036(element, "was removed from DOM,", eoe, "reinserting");
|
|
7632
7631
|
const {
|
|
7633
7632
|
documentElement: documentElement
|
|
7634
7633
|
} = document;
|
|
@@ -7641,7 +7640,7 @@ function $51fea29d5f0a339b$var$deal_w_removal_of_node_array(node_array, push_dis
|
|
|
7641
7640
|
push_disconnector(disconnect_observer);
|
|
7642
7641
|
}
|
|
7643
7642
|
}
|
|
7644
|
-
const $bb8d2c77db19a4c0$export$3b75288f46cadd96 = () => new Array(
|
|
7643
|
+
const $bb8d2c77db19a4c0$export$3b75288f46cadd96 = () => new Array($c0c9a890763623b3$export$bb0a9c36cf454ea0(3, 8)).fill("⬜").join("");
|
|
7645
7644
|
const $bb8d2c77db19a4c0$var$make_sel = (image_url, attribute) => "[".concat(attribute, "=").concat(JSON.stringify(image_url), "]");
|
|
7646
7645
|
const $bb8d2c77db19a4c0$export$a4eccf92efefa04d = function (image_width, image_height) {
|
|
7647
7646
|
let color = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "#f6f7f8";
|
|
@@ -7683,9 +7682,9 @@ async function $bb8d2c77db19a4c0$export$2dd69958012e3e49() {
|
|
|
7683
7682
|
var _classList, _classList$add, _classList2;
|
|
7684
7683
|
if (elem instanceof HTMLElement) elem.style.cursor = "default";
|
|
7685
7684
|
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");
|
|
7686
|
-
elem.addEventListener("click", e => (
|
|
7685
|
+
elem.addEventListener("click", e => ($7f95f77417d06249$export$de56f1198d121036("Supressing placeholder click", e), e.preventDefault(), e.stopPropagation(), false), true);
|
|
7687
7686
|
}
|
|
7688
|
-
for (const img of
|
|
7687
|
+
for (const img of $8b27923e1d1e6b99$export$5e63aea0cac01fa0(elems, ["src", "srcset", "data-src", "data-srcset"].map(attribute => $bb8d2c77db19a4c0$var$make_sel(image_url, attribute)).join(", "))) img.classList.add("nolazy"); // this gets ignored by all lazyloaders
|
|
7689
7688
|
return elems;
|
|
7690
7689
|
}]
|
|
7691
7690
|
};
|
|
@@ -7694,9 +7693,9 @@ async function $bb8d2c77db19a4c0$export$2dd69958012e3e49() {
|
|
|
7694
7693
|
let set_should_stay_inserted;
|
|
7695
7694
|
const should_stay_inserted = new Promise(r => set_should_stay_inserted = r);
|
|
7696
7695
|
if (placeholder_rendering !== null && placeholder_rendering !== void 0 && placeholder_rendering.elements) {
|
|
7697
|
-
const [template_els, _get_state, set_state] =
|
|
7696
|
+
const [template_els, _get_state, set_state] = $12ec80c27422ece4$export$3d04c40e7acc1a32(placeholder_rendering.elements);
|
|
7698
7697
|
actual_rendering.then(async rendering_result => {
|
|
7699
|
-
if (typeof post_rendering == "function") await
|
|
7698
|
+
if (typeof post_rendering == "function") await $3b52ccc10510b32a$export$b3bbfd758f11cfa9(post_rendering)(rendering_result);
|
|
7700
7699
|
const {
|
|
7701
7700
|
elements: elements
|
|
7702
7701
|
} = rendering_result || {};
|
|
@@ -7716,7 +7715,7 @@ async function $bb8d2c77db19a4c0$export$2dd69958012e3e49() {
|
|
|
7716
7715
|
should_stay_inserted: should_stay_inserted
|
|
7717
7716
|
};
|
|
7718
7717
|
} else {
|
|
7719
|
-
|
|
7718
|
+
$7f95f77417d06249$export$de56f1198d121036("Placeholder rendering went wrong, this is bad! Ditching placeholders");
|
|
7720
7719
|
return (await actual_rendering) || {};
|
|
7721
7720
|
}
|
|
7722
7721
|
};
|
|
@@ -7730,7 +7729,7 @@ function $1d2ed456f93472ff$export$8ec5c86406f333ff() {
|
|
|
7730
7729
|
try {
|
|
7731
7730
|
return target.apply(this_arg, arguments_list);
|
|
7732
7731
|
} catch (e) {
|
|
7733
|
-
|
|
7732
|
+
$7f95f77417d06249$export$de56f1198d121036("Swallowing error of removal of node that we have removed or created", e, el);
|
|
7734
7733
|
}
|
|
7735
7734
|
return el;
|
|
7736
7735
|
}
|
|
@@ -7767,7 +7766,7 @@ function $b974eed89abc6d3e$export$38e89c688f9d553a() {
|
|
|
7767
7766
|
const w = window;
|
|
7768
7767
|
let da_promise = w[$b974eed89abc6d3e$var$promise_as_string];
|
|
7769
7768
|
let iframe_promise;
|
|
7770
|
-
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") &&
|
|
7769
|
+
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") && !$b442466266a70c7c$export$4fbbab6c30e664d5(da_promise) && (iframe_promise = $b974eed89abc6d3e$export$e647444ed9403635())) da_promise = iframe_promise;
|
|
7771
7770
|
if (da_promise) {
|
|
7772
7771
|
var _Object$getOwnPropert;
|
|
7773
7772
|
if (((_Object$getOwnPropert = Object.getOwnPropertyDescriptor(w, $b974eed89abc6d3e$var$promise_as_string)) === null || _Object$getOwnPropert === void 0 ? void 0 : _Object$getOwnPropert.configurable) !== false) Object.defineProperty(w, $b974eed89abc6d3e$var$promise_as_string, {
|
|
@@ -7779,10 +7778,10 @@ function $b974eed89abc6d3e$export$38e89c688f9d553a() {
|
|
|
7779
7778
|
set(value) {
|
|
7780
7779
|
return value;
|
|
7781
7780
|
}
|
|
7782
|
-
});else
|
|
7781
|
+
});else $7f95f77417d06249$export$de56f1198d121036("Unable to redefine " + $b974eed89abc6d3e$var$promise_as_string + ", it's already nonconfigurable");
|
|
7783
7782
|
}
|
|
7784
7783
|
} catch (e) {
|
|
7785
|
-
|
|
7784
|
+
$46b94b232dc792af$export$8048b892d651b310(e);
|
|
7786
7785
|
}
|
|
7787
7786
|
}
|
|
7788
7787
|
function $b974eed89abc6d3e$export$e647444ed9403635() {
|
|
@@ -7793,7 +7792,7 @@ function $b974eed89abc6d3e$export$e647444ed9403635() {
|
|
|
7793
7792
|
return iframe === null || iframe === void 0 ? void 0 : (_iframe$contentWindow = iframe.contentWindow) === null || _iframe$contentWindow === void 0 ? void 0 : _iframe$contentWindow[$b974eed89abc6d3e$var$promise_as_string];
|
|
7794
7793
|
}
|
|
7795
7794
|
function $8fe58c8c6c67bb13$export$33d1643df63073a8(fetch_handler) {
|
|
7796
|
-
fetch_handler =
|
|
7795
|
+
fetch_handler = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(fetch_handler);
|
|
7797
7796
|
const {
|
|
7798
7797
|
prototype: prototype
|
|
7799
7798
|
} = XMLHttpRequest;
|
|
@@ -7802,17 +7801,17 @@ function $8fe58c8c6c67bb13$export$33d1643df63073a8(fetch_handler) {
|
|
|
7802
7801
|
if (Array.isArray(arg_array)) {
|
|
7803
7802
|
const request = this_arg;
|
|
7804
7803
|
const [method, url] = arg_array;
|
|
7805
|
-
|
|
7804
|
+
$3b52ccc10510b32a$export$b3bbfd758f11cfa9(fetch_handler)(request, method, url, arg_array);
|
|
7806
7805
|
}
|
|
7807
7806
|
return target.apply(this_arg, arg_array);
|
|
7808
7807
|
}
|
|
7809
7808
|
});
|
|
7810
7809
|
}
|
|
7811
7810
|
function $8fe58c8c6c67bb13$export$f314addd5f976083(handler) {
|
|
7812
|
-
$8fe58c8c6c67bb13$export$33d1643df63073a8((req, method, url) => req.addEventListener("load",
|
|
7811
|
+
$8fe58c8c6c67bb13$export$33d1643df63073a8((req, method, url) => req.addEventListener("load", $3b52ccc10510b32a$export$b3bbfd758f11cfa9(event => handler(req, method, url, event))));
|
|
7813
7812
|
}
|
|
7814
7813
|
async function $8fe58c8c6c67bb13$export$c74578d2cd47a84a(send_callback) {
|
|
7815
|
-
const catchified_callback =
|
|
7814
|
+
const catchified_callback = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(send_callback);
|
|
7816
7815
|
const requests = new WeakMap();
|
|
7817
7816
|
$8fe58c8c6c67bb13$export$33d1643df63073a8((request, _method, _url, arg_array) => {
|
|
7818
7817
|
requests.set(request, arg_array);
|
|
@@ -7825,14 +7824,14 @@ async function $8fe58c8c6c67bb13$export$c74578d2cd47a84a(send_callback) {
|
|
|
7825
7824
|
try {
|
|
7826
7825
|
if (requests.has(this_request)) catchified_callback(this_request, requests.get(this_request), arg_list);
|
|
7827
7826
|
} catch (e) {
|
|
7828
|
-
|
|
7827
|
+
$46b94b232dc792af$export$8048b892d651b310(e);
|
|
7829
7828
|
}
|
|
7830
7829
|
return target.apply(this_request, arg_list);
|
|
7831
7830
|
}
|
|
7832
7831
|
});
|
|
7833
7832
|
}
|
|
7834
7833
|
async function $8fe58c8c6c67bb13$export$8e16c51fd2b6507(read_callback) {
|
|
7835
|
-
const catchified_read_callback =
|
|
7834
|
+
const catchified_read_callback = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(read_callback);
|
|
7836
7835
|
const open_send_arg_map = new WeakMap();
|
|
7837
7836
|
const {
|
|
7838
7837
|
prototype: prototype
|
|
@@ -7853,7 +7852,7 @@ async function $8fe58c8c6c67bb13$export$8e16c51fd2b6507(read_callback) {
|
|
|
7853
7852
|
return catchified_read_callback(this_arg, open_args, send_args, default_value, n) || default_value;
|
|
7854
7853
|
} catch (e) {
|
|
7855
7854
|
// in case the weakmaps fail for some reason
|
|
7856
|
-
|
|
7855
|
+
$46b94b232dc792af$export$8048b892d651b310(e);
|
|
7857
7856
|
return default_value;
|
|
7858
7857
|
}
|
|
7859
7858
|
}
|
|
@@ -7874,11 +7873,11 @@ async function $acd094fc3e72ffe6$export$83ec13b10b391f13() {
|
|
|
7874
7873
|
const orig_url_with_trailing_slash = o_u_u_o.protocol + "//" + o_u_u_o.host + "/";
|
|
7875
7874
|
if (orig_url) {
|
|
7876
7875
|
// change links
|
|
7877
|
-
|
|
7876
|
+
$8b27923e1d1e6b99$export$d4bd03f19260ef1c(orig_url_with_trailing_slash, false, location.hostname);
|
|
7878
7877
|
$acd094fc3e72ffe6$export$2a1cc61cffa1f36f(orig_url_with_trailing_slash);
|
|
7879
7878
|
$acd094fc3e72ffe6$export$2a38b176ce969e2c(orig_url_with_trailing_slash);
|
|
7880
7879
|
$acd094fc3e72ffe6$export$f14a775632a826c4(orig_url_with_trailing_slash);
|
|
7881
|
-
} else
|
|
7880
|
+
} else $7f95f77417d06249$export$de56f1198d121036(new Error("No ORIG_URL env var was set, demo fixes not gonna work."));
|
|
7882
7881
|
}
|
|
7883
7882
|
function $acd094fc3e72ffe6$export$f14a775632a826c4(orig_url_with_trailing_slash) {
|
|
7884
7883
|
// rewrite history.pushState and history.replaceState so that it works if someone calls it with absolute URLs
|
|
@@ -7895,21 +7894,21 @@ function $acd094fc3e72ffe6$export$f14a775632a826c4(orig_url_with_trailing_slash)
|
|
|
7895
7894
|
}
|
|
7896
7895
|
function $acd094fc3e72ffe6$export$2a1cc61cffa1f36f(orig_url_with_trailing_slash) {
|
|
7897
7896
|
// rewrite fetch requests just in case, maybe we should also rewrite responses
|
|
7898
|
-
|
|
7897
|
+
$fe05042754d72fbc$export$85be83e1935d93c2(async (target, this_arg, arg_list) => {
|
|
7899
7898
|
try {
|
|
7900
7899
|
const [url] = arg_list;
|
|
7901
7900
|
if (typeof url == "string") arg_list[0] = url.replaceAll(orig_url_with_trailing_slash, "/");else if (url instanceof Request) {
|
|
7902
7901
|
if (url.url.includes(orig_url_with_trailing_slash)) arg_list[0] = new Request(url.url.replaceAll(orig_url_with_trailing_slash, "/"), url);
|
|
7903
7902
|
}
|
|
7904
7903
|
} catch (e) {
|
|
7905
|
-
|
|
7904
|
+
$46b94b232dc792af$export$8048b892d651b310(e);
|
|
7906
7905
|
}
|
|
7907
7906
|
return target.apply(this_arg, arg_list);
|
|
7908
7907
|
});
|
|
7909
7908
|
}
|
|
7910
7909
|
function $acd094fc3e72ffe6$export$2a38b176ce969e2c(orig_url_with_trailing_slash) {
|
|
7911
7910
|
// rewrite xhr requests just in case
|
|
7912
|
-
|
|
7911
|
+
$8fe58c8c6c67bb13$export$33d1643df63073a8((request, method, url, arg_array) => {
|
|
7913
7912
|
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, "");
|
|
7914
7913
|
});
|
|
7915
7914
|
}
|
|
@@ -7986,11 +7985,11 @@ function $82e4feda1a863e5a$export$a422d714c8cb1a5d(allowed_markets, url) {
|
|
|
7986
7985
|
return "se";
|
|
7987
7986
|
}
|
|
7988
7987
|
function $84f9aef36e5f9e6e$export$3427ec8268623f1(listener) {
|
|
7989
|
-
if (
|
|
7990
|
-
|
|
7988
|
+
if (!$bc463df3122a418b$export$b87d7e0da8b5cbe3()) {
|
|
7989
|
+
$7f95f77417d06249$export$de56f1198d121036("Not hooking localStorage as it would freeze it due to lacking Proxy support");
|
|
7991
7990
|
return;
|
|
7992
7991
|
}
|
|
7993
|
-
const caught_listener =
|
|
7992
|
+
const caught_listener = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(listener);
|
|
7994
7993
|
let changed_instance;
|
|
7995
7994
|
const update_changed_instance = () => changed_instance = Storage.prototype.setItem !== localStorage.setItem;
|
|
7996
7995
|
update_changed_instance();
|
|
@@ -8058,7 +8057,7 @@ function $84f9aef36e5f9e6e$export$3427ec8268623f1(listener) {
|
|
|
8058
8057
|
changed_this_args.add(fn_with_changed_this_arg);
|
|
8059
8058
|
}
|
|
8060
8059
|
} catch (e) {
|
|
8061
|
-
if (key !== "length")
|
|
8060
|
+
if (key !== "length") $7f95f77417d06249$export$de56f1198d121036(e);
|
|
8062
8061
|
}
|
|
8063
8062
|
}
|
|
8064
8063
|
|
|
@@ -8073,17 +8072,17 @@ function $dc92594b01eacde3$export$cd1adfb8059b5fcd(promise, ms) {
|
|
|
8073
8072
|
const $eedabd28f7a8a073$var$get_voyado_id = () => {
|
|
8074
8073
|
var _exec;
|
|
8075
8074
|
const va = (_exec = /\b_vaI=([^;]+)/.exec(document.cookie)) === null || _exec === void 0 ? void 0 : _exec[1];
|
|
8076
|
-
return va ||
|
|
8075
|
+
return va || $335c248bb07a3509$export$6399bdb2291895e0();
|
|
8077
8076
|
};
|
|
8078
|
-
const $eedabd28f7a8a073$export$a739d9a07da7f9ce = /*@__PURE__
|
|
8079
|
-
|
|
8077
|
+
const $eedabd28f7a8a073$export$a739d9a07da7f9ce = /*@__PURE__*/$3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => {
|
|
8078
|
+
$335c248bb07a3509$export$336e7ad40bae0652($eedabd28f7a8a073$var$get_voyado_id);
|
|
8080
8079
|
});
|
|
8081
8080
|
function $102c3c26150518b7$export$4a3043e508dd72f0(_ref) {
|
|
8082
8081
|
let {
|
|
8083
8082
|
children: children,
|
|
8084
8083
|
...attributes
|
|
8085
8084
|
} = _ref;
|
|
8086
|
-
const button =
|
|
8085
|
+
const button = $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("button", {
|
|
8087
8086
|
...attributes,
|
|
8088
8087
|
type: "button",
|
|
8089
8088
|
children: children
|
|
@@ -8101,30 +8100,30 @@ async function $b99c603a5341f0ae$export$8a0e4d6f6abf7e90(_ref) {
|
|
|
8101
8100
|
let close_;
|
|
8102
8101
|
const open_promise = new Promise(r => close_ = r);
|
|
8103
8102
|
const body = await (0, $03c157d68c9fcbac$export$b6ae1bc530f4c149).wait_for_element("body");
|
|
8104
|
-
const backdrop =
|
|
8103
|
+
const backdrop = $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("div", {
|
|
8105
8104
|
class: "slidein-backdrop",
|
|
8106
8105
|
onClick: close_
|
|
8107
8106
|
});
|
|
8108
|
-
const [exit_title_iterator, exitable_title_iterator] =
|
|
8107
|
+
const [exit_title_iterator, exitable_title_iterator] = $c0c977a0f691adf3$export$927664b47117acb0(title_);
|
|
8109
8108
|
const closing_handlers = [exit_title_iterator];
|
|
8110
|
-
const slidein =
|
|
8109
|
+
const slidein = $f0d9ae7bf9bd697d$export$25062201e9e25d76("div", {
|
|
8111
8110
|
class: "slidein",
|
|
8112
|
-
children: [
|
|
8111
|
+
children: [$f0d9ae7bf9bd697d$export$25062201e9e25d76("div", {
|
|
8113
8112
|
class: "header",
|
|
8114
|
-
children: [
|
|
8113
|
+
children: [$f0d9ae7bf9bd697d$export$34b9dba7ce09269b("span", {
|
|
8115
8114
|
class: "title",
|
|
8116
|
-
children:
|
|
8117
|
-
}),
|
|
8115
|
+
children: $fbf41b4abc726dbe$export$7c081fdbc65b6a2a(exitable_title_iterator, false)
|
|
8116
|
+
}), $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("button", {
|
|
8118
8117
|
class: "close",
|
|
8119
8118
|
onClick: close_,
|
|
8120
8119
|
children: CloseIcon()
|
|
8121
8120
|
})]
|
|
8122
|
-
}),
|
|
8121
|
+
}), $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("div", {
|
|
8123
8122
|
class: "body",
|
|
8124
8123
|
children: children
|
|
8125
8124
|
})]
|
|
8126
8125
|
});
|
|
8127
|
-
const elements_in_container =
|
|
8126
|
+
const elements_in_container = $f0d9ae7bf9bd697d$export$25062201e9e25d76("div", {
|
|
8128
8127
|
class: "depict",
|
|
8129
8128
|
children: [backdrop, slidein]
|
|
8130
8129
|
});
|
|
@@ -8142,7 +8141,7 @@ async function $b99c603a5341f0ae$export$8a0e4d6f6abf7e90(_ref) {
|
|
|
8142
8141
|
easing: "ease-in",
|
|
8143
8142
|
duration: 220
|
|
8144
8143
|
});
|
|
8145
|
-
const handler =
|
|
8144
|
+
const handler = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(_ref2 => {
|
|
8146
8145
|
let {
|
|
8147
8146
|
key: key
|
|
8148
8147
|
} = _ref2;
|
|
@@ -8151,7 +8150,7 @@ async function $b99c603a5341f0ae$export$8a0e4d6f6abf7e90(_ref) {
|
|
|
8151
8150
|
close_();
|
|
8152
8151
|
});
|
|
8153
8152
|
window.addEventListener("keydown", handler);
|
|
8154
|
-
open_promise.then(
|
|
8153
|
+
open_promise.then($3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => {
|
|
8155
8154
|
window.removeEventListener("keydown", handler);
|
|
8156
8155
|
backdrop.animate({
|
|
8157
8156
|
opacity: [1, 0]
|
|
@@ -8166,7 +8165,7 @@ async function $b99c603a5341f0ae$export$8a0e4d6f6abf7e90(_ref) {
|
|
|
8166
8165
|
}, {
|
|
8167
8166
|
easing: "ease-out",
|
|
8168
8167
|
duration: 220
|
|
8169
|
-
}).addEventListener("finish",
|
|
8168
|
+
}).addEventListener("finish", $3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => {
|
|
8170
8169
|
elements_in_container.remove();
|
|
8171
8170
|
closing_handlers.forEach(handler => handler());
|
|
8172
8171
|
}));
|
|
@@ -8183,16 +8182,16 @@ async function $468dbae10b24d59f$export$c068ad5361be7646(_ref) {
|
|
|
8183
8182
|
out_of_stock_text_: out_of_stock_text_,
|
|
8184
8183
|
CloseIcon: CloseIcon
|
|
8185
8184
|
} = _ref;
|
|
8186
|
-
const [exit_oos_iterator, exitable_oos_iterator] =
|
|
8185
|
+
const [exit_oos_iterator, exitable_oos_iterator] = $c0c977a0f691adf3$export$927664b47117acb0(out_of_stock_text_);
|
|
8187
8186
|
// eslint-disable-line no-async-promise-executor
|
|
8188
|
-
return new Promise(
|
|
8187
|
+
return new Promise($3b52ccc10510b32a$export$b3bbfd758f11cfa9(async size_selected => {
|
|
8189
8188
|
const {
|
|
8190
8189
|
close_: close_,
|
|
8191
8190
|
on_close_: on_close_
|
|
8192
|
-
} = await
|
|
8191
|
+
} = await $b99c603a5341f0ae$export$8a0e4d6f6abf7e90({
|
|
8193
8192
|
CloseIcon: CloseIcon,
|
|
8194
8193
|
title_: title_,
|
|
8195
|
-
children: [
|
|
8194
|
+
children: [$f0d9ae7bf9bd697d$export$34b9dba7ce09269b("div", {
|
|
8196
8195
|
class: "option-list",
|
|
8197
8196
|
children: items_.map(_ref2 => {
|
|
8198
8197
|
let {
|
|
@@ -8200,19 +8199,19 @@ async function $468dbae10b24d59f$export$c068ad5361be7646(_ref) {
|
|
|
8200
8199
|
is_available_: is_available_,
|
|
8201
8200
|
id_: id_
|
|
8202
8201
|
} = _ref2;
|
|
8203
|
-
const button =
|
|
8202
|
+
const button = $f0d9ae7bf9bd697d$export$25062201e9e25d76("button", {
|
|
8204
8203
|
type: "button",
|
|
8205
8204
|
class: "option" + (is_available_ ? " available" : ""),
|
|
8206
8205
|
onClick: () => {
|
|
8207
8206
|
size_selected(id_);
|
|
8208
8207
|
close_();
|
|
8209
8208
|
},
|
|
8210
|
-
children: [
|
|
8209
|
+
children: [$f0d9ae7bf9bd697d$export$34b9dba7ce09269b("span", {
|
|
8211
8210
|
class: "size",
|
|
8212
8211
|
children: size_name_
|
|
8213
|
-
}), !is_available_ &&
|
|
8212
|
+
}), !is_available_ && $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("span", {
|
|
8214
8213
|
class: "sold-out",
|
|
8215
|
-
children:
|
|
8214
|
+
children: $fbf41b4abc726dbe$export$7c081fdbc65b6a2a(exitable_oos_iterator)
|
|
8216
8215
|
})]
|
|
8217
8216
|
});
|
|
8218
8217
|
if (!is_available_) button.disabled = true;
|
|
@@ -8237,12 +8236,12 @@ const $ba9b4cd7e24de87e$export$84712d0562a614b8 = _ref => {
|
|
|
8237
8236
|
} = _ref;
|
|
8238
8237
|
if (!$ba9b4cd7e24de87e$var$inserted) {
|
|
8239
8238
|
// Insert styling on first import
|
|
8240
|
-
|
|
8239
|
+
$e45474c7d6e21cfa$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($8b5f3bb1185264e0$exports)));
|
|
8241
8240
|
$ba9b4cd7e24de87e$var$inserted = true;
|
|
8242
8241
|
}
|
|
8243
8242
|
return (
|
|
8244
8243
|
// @ts-ignore
|
|
8245
|
-
|
|
8244
|
+
$f0d9ae7bf9bd697d$export$34b9dba7ce09269b("div", {
|
|
8246
8245
|
class: "depict-placeholder".concat(extra_classes ? " " + extra_classes : ""),
|
|
8247
8246
|
style: style ? style : "width:".concat(width, ";height:").concat(height, ";"),
|
|
8248
8247
|
...attributes
|
|
@@ -8254,36 +8253,36 @@ const $ba9b4cd7e24de87e$export$d613f5b6d0a331a8 = _ref2 => {
|
|
|
8254
8253
|
aspect_ratio: aspect_ratio,
|
|
8255
8254
|
...attributes
|
|
8256
8255
|
} = _ref2;
|
|
8257
|
-
return
|
|
8256
|
+
return $f0d9ae7bf9bd697d$export$34b9dba7ce09269b($ba9b4cd7e24de87e$export$84712d0562a614b8, {
|
|
8258
8257
|
style: "position:relative;width:100%;padding-bottom:".concat(1 / aspect_ratio * 100, "%"),
|
|
8259
8258
|
...attributes
|
|
8260
8259
|
});
|
|
8261
8260
|
};
|
|
8262
8261
|
const $d500491aef2925c7$export$97f31f44c68c1d5 = function (title) {
|
|
8263
8262
|
let surface_classes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
8264
|
-
return
|
|
8263
|
+
return $51b78ec2cb40f07e$export$eb0b9ed911409b57(e => e.classList.add(...surface_classes), $f0d9ae7bf9bd697d$export$25062201e9e25d76("div", {
|
|
8265
8264
|
class: "depict recommendation_container",
|
|
8266
|
-
children: [title && typeof title === "string" ?
|
|
8265
|
+
children: [title && typeof title === "string" ? $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("h4", {
|
|
8267
8266
|
class: "recs_header",
|
|
8268
8267
|
children: title
|
|
8269
|
-
}) : title,
|
|
8268
|
+
}) : title, $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("div", {
|
|
8270
8269
|
class: "grid"
|
|
8271
8270
|
})]
|
|
8272
8271
|
}));
|
|
8273
8272
|
};
|
|
8274
|
-
const $98ca99ff2fa5a542$export$32a55d57d151bc5a = () =>
|
|
8273
|
+
const $98ca99ff2fa5a542$export$32a55d57d151bc5a = () => $f0d9ae7bf9bd697d$export$25062201e9e25d76("svg", {
|
|
8275
8274
|
viewBox: "0 0 320 512",
|
|
8276
|
-
children: [
|
|
8275
|
+
children: [$f0d9ae7bf9bd697d$export$34b9dba7ce09269b("desc", {
|
|
8277
8276
|
children: "Right arrow"
|
|
8278
|
-
}),
|
|
8277
|
+
}), $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("path", {
|
|
8279
8278
|
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"
|
|
8280
8279
|
})]
|
|
8281
8280
|
});
|
|
8282
|
-
const $98ca99ff2fa5a542$export$ddd70fdae1b350e6 = () =>
|
|
8281
|
+
const $98ca99ff2fa5a542$export$ddd70fdae1b350e6 = () => $f0d9ae7bf9bd697d$export$25062201e9e25d76("svg", {
|
|
8283
8282
|
viewBox: "0 0 320 512",
|
|
8284
|
-
children: [
|
|
8283
|
+
children: [$f0d9ae7bf9bd697d$export$34b9dba7ce09269b("desc", {
|
|
8285
8284
|
children: "Left arrow"
|
|
8286
|
-
}),
|
|
8285
|
+
}), $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("path", {
|
|
8287
8286
|
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"
|
|
8288
8287
|
})]
|
|
8289
8288
|
});
|
|
@@ -8298,21 +8297,21 @@ function $57a111eb846a8d6a$var$ColorCircle(_ref) {
|
|
|
8298
8297
|
onClick: onClick,
|
|
8299
8298
|
onHoverUpdate: onHoverUpdate
|
|
8300
8299
|
} = _ref;
|
|
8301
|
-
const button =
|
|
8300
|
+
const button = $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("button", {
|
|
8302
8301
|
class: "color-circle-container",
|
|
8303
8302
|
onClick: e => onClick(e.currentTarget, color),
|
|
8304
8303
|
title: color.label || "",
|
|
8305
|
-
children:
|
|
8304
|
+
children: $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("div", {
|
|
8306
8305
|
class: "outer-circle",
|
|
8307
8306
|
style: "border-color: ".concat(color.value, ";"),
|
|
8308
|
-
children:
|
|
8307
|
+
children: $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("div", {
|
|
8309
8308
|
class: "inner-circle",
|
|
8310
8309
|
style: "background-color: ".concat(color.value, ";")
|
|
8311
8310
|
})
|
|
8312
8311
|
})
|
|
8313
8312
|
});
|
|
8314
|
-
button.addEventListener("mouseenter",
|
|
8315
|
-
button.addEventListener("mouseleave",
|
|
8313
|
+
button.addEventListener("mouseenter", $3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => onHoverUpdate(button, color, true)));
|
|
8314
|
+
button.addEventListener("mouseleave", $3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => onHoverUpdate(button, color, false)));
|
|
8316
8315
|
return button;
|
|
8317
8316
|
}
|
|
8318
8317
|
function $57a111eb846a8d6a$export$590326cc34f49e2d(_ref2) {
|
|
@@ -8369,7 +8368,7 @@ function $57a111eb846a8d6a$export$590326cc34f49e2d(_ref2) {
|
|
|
8369
8368
|
if (selectOnHover) handleSelectOnHover(hovered, color, hovering);
|
|
8370
8369
|
};
|
|
8371
8370
|
// Create the color circles
|
|
8372
|
-
const circles = colors.map(color =>
|
|
8371
|
+
const circles = colors.map(color => $f0d9ae7bf9bd697d$export$34b9dba7ce09269b($57a111eb846a8d6a$var$ColorCircle, {
|
|
8373
8372
|
color: color,
|
|
8374
8373
|
onClick: handleClick,
|
|
8375
8374
|
onHoverUpdate: handleHoverUpdate
|
|
@@ -8380,7 +8379,7 @@ function $57a111eb846a8d6a$export$590326cc34f49e2d(_ref2) {
|
|
|
8380
8379
|
const initial_index = initialColor == undefined ? -1 : colors.findIndex(c => typeof initialColor === "string" ? c.value === initialColor : c.value === initialColor.value && c.label === initialColor.label);
|
|
8381
8380
|
if (initial_index > -1) setActiveIndex(initial_index);
|
|
8382
8381
|
if (onlyCircles) return circles;
|
|
8383
|
-
return
|
|
8382
|
+
return $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("div", {
|
|
8384
8383
|
class: "color-picker",
|
|
8385
8384
|
role: "form",
|
|
8386
8385
|
"aria-label": "Color picker",
|
|
@@ -8414,17 +8413,17 @@ const $151f8676c5d42e80$export$237455ad7e59d4e5 = function () {
|
|
|
8414
8413
|
children: children
|
|
8415
8414
|
} = _ref;
|
|
8416
8415
|
if (Array.isArray(children) && children.length === 1) children = children[0];
|
|
8417
|
-
innerRef =
|
|
8416
|
+
innerRef = $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("div", {
|
|
8418
8417
|
children: children
|
|
8419
8418
|
});
|
|
8420
|
-
outerRef =
|
|
8419
|
+
outerRef = $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("div", {
|
|
8421
8420
|
style: "overflow:hidden;height:0px;visibility:hidden",
|
|
8422
8421
|
"aria-hidden": "true",
|
|
8423
8422
|
children: innerRef
|
|
8424
8423
|
});
|
|
8425
8424
|
return outerRef;
|
|
8426
8425
|
};
|
|
8427
|
-
const expand =
|
|
8426
|
+
const expand = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(async function () {
|
|
8428
8427
|
var _current_animation, _current_animation$ca;
|
|
8429
8428
|
let expanding_delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : delay;
|
|
8430
8429
|
let time_to_expand = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : duration;
|
|
@@ -8440,14 +8439,14 @@ const $151f8676c5d42e80$export$237455ad7e59d4e5 = function () {
|
|
|
8440
8439
|
easing: "ease-in"
|
|
8441
8440
|
});
|
|
8442
8441
|
current_animation = animation;
|
|
8443
|
-
animation.addEventListener("finish",
|
|
8442
|
+
animation.addEventListener("finish", $3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => {
|
|
8444
8443
|
current_animation = undefined;
|
|
8445
8444
|
outerRef.style.overflow = "";
|
|
8446
8445
|
outerRef.style.height = "auto";
|
|
8447
8446
|
}));
|
|
8448
8447
|
return animation;
|
|
8449
8448
|
});
|
|
8450
|
-
const collapse =
|
|
8449
|
+
const collapse = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(async function () {
|
|
8451
8450
|
var _current_animation2, _current_animation2$c;
|
|
8452
8451
|
let collapsing_delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : delay;
|
|
8453
8452
|
let time_to_collapse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : duration;
|
|
@@ -8463,7 +8462,7 @@ const $151f8676c5d42e80$export$237455ad7e59d4e5 = function () {
|
|
|
8463
8462
|
easing: "ease-out"
|
|
8464
8463
|
});
|
|
8465
8464
|
current_animation = animation;
|
|
8466
|
-
animation.addEventListener("finish",
|
|
8465
|
+
animation.addEventListener("finish", $3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => {
|
|
8467
8466
|
current_animation = undefined;
|
|
8468
8467
|
outerRef.style.height = "0";
|
|
8469
8468
|
outerRef.style.visibility = "hidden";
|
|
@@ -8481,10 +8480,10 @@ $69f5592a9d3b3d0b$exports = ".depict-img-cont {\n width: 100%;\n height: 100%;
|
|
|
8481
8480
|
const $b42b9f62e8b6cb2d$export$3d13beba9b52c947 = "https://img.depict.ai/ResizeImage" + (process.env.TENANT ? "/" + process.env.TENANT : "");
|
|
8482
8481
|
const $b42b9f62e8b6cb2d$export$a98fc8a2c818d3d8 = /*@__PURE__*/(() => typeof navigator === "undefined" ? false : /^((?!chrome|android).)*safari/i.test(navigator.userAgent))(); // https://stackoverflow.com/a/23522755
|
|
8483
8482
|
function $b42b9f62e8b6cb2d$export$f39a7d0667e924a(what_to_watch) {
|
|
8484
|
-
let sizes_communicator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] :
|
|
8483
|
+
let sizes_communicator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $76a59c6ce18c8fd3$export$e806c6c1615a59ae();
|
|
8485
8484
|
let resolution_factor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
8486
8485
|
let currently_live = false;
|
|
8487
|
-
const ro = new ResizeObserver(
|
|
8486
|
+
const ro = new ResizeObserver($3b52ccc10510b32a$export$b3bbfd758f11cfa9(records => {
|
|
8488
8487
|
for (let j = 0; j < records.length; j++) {
|
|
8489
8488
|
const {
|
|
8490
8489
|
width: width
|
|
@@ -8558,9 +8557,9 @@ function $b42b9f62e8b6cb2d$export$a62825542f1bfcf5() {
|
|
|
8558
8557
|
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
|
|
8559
8558
|
const src = new URL(raw_src, location.origin).href;
|
|
8560
8559
|
if (!src) {
|
|
8561
|
-
|
|
8562
|
-
|
|
8563
|
-
return
|
|
8560
|
+
$7f95f77417d06249$export$de56f1198d121036(image_options, () => {}); // noop function is to allow to get here quickly by "jump to function definition"
|
|
8561
|
+
$46b94b232dc792af$export$8048b892d651b310(new Error("no image src provided: " + src));
|
|
8562
|
+
return $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("img", {
|
|
8564
8563
|
...image_options
|
|
8565
8564
|
}); // we don't want everything to fail if someone misused this component
|
|
8566
8565
|
}
|
|
@@ -8573,7 +8572,7 @@ function $b42b9f62e8b6cb2d$export$a62825542f1bfcf5() {
|
|
|
8573
8572
|
const srcset = $b42b9f62e8b6cb2d$var$make_srcset(src, format, resolutions);
|
|
8574
8573
|
sources.push(
|
|
8575
8574
|
// 0px important because chrome will load the biggest size otherwise until sizes attribute is set to the correct value
|
|
8576
|
-
|
|
8575
|
+
$f0d9ae7bf9bd697d$export$34b9dba7ce09269b("source", {
|
|
8577
8576
|
sizes: "0px",
|
|
8578
8577
|
type: "image/".concat(format),
|
|
8579
8578
|
...(set_dataset ? {
|
|
@@ -8588,7 +8587,7 @@ function $b42b9f62e8b6cb2d$export$a62825542f1bfcf5() {
|
|
|
8588
8587
|
}; // Prevents the image from instantly loading the original source
|
|
8589
8588
|
delete opts_without_src["src"];
|
|
8590
8589
|
delete opts_without_src["srcset"];
|
|
8591
|
-
const the_image =
|
|
8590
|
+
const the_image = $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("img", {
|
|
8592
8591
|
...opts_without_src
|
|
8593
8592
|
}); // create image
|
|
8594
8593
|
sources.push(the_image); // chrome seems to be the dumbest piece of cake that has ever existed and just load the first source?????
|
|
@@ -8597,7 +8596,7 @@ function $b42b9f62e8b6cb2d$export$a62825542f1bfcf5() {
|
|
|
8597
8596
|
// start a sizes_setter for every source (including fallback image)
|
|
8598
8597
|
for (let i = 0; i < sources.length; i++) sizes_setter_(sources[i]).catch((0, $46b94b232dc792af$export$8048b892d651b310));
|
|
8599
8598
|
// embed all sources into a <picture> so that the browser understands they're "together"
|
|
8600
|
-
const picture =
|
|
8599
|
+
const picture = $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("picture", {
|
|
8601
8600
|
children: sources
|
|
8602
8601
|
});
|
|
8603
8602
|
// Create src and srcset for fallback image and set it.
|
|
@@ -8640,13 +8639,13 @@ const $dfce76a4aeb41067$export$788756b42446dc2d = _ref => {
|
|
|
8640
8639
|
} = _ref;
|
|
8641
8640
|
if (!$dfce76a4aeb41067$var$inserted) {
|
|
8642
8641
|
// Insert styling on first import
|
|
8643
|
-
|
|
8642
|
+
$e45474c7d6e21cfa$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($69f5592a9d3b3d0b$exports)));
|
|
8644
8643
|
$dfce76a4aeb41067$var$inserted = true;
|
|
8645
8644
|
}
|
|
8646
8645
|
const img = process.env.BUILD_TARGET === "modern" || process.env.BUILD_TARGET === "dev" ? $dfce76a4aeb41067$var$Image(options) : $dfce76a4aeb41067$var$CompatibleImage(options);
|
|
8647
8646
|
if (init_with_placeholder)
|
|
8648
8647
|
// 10000 is a magic value, that is just supposed to be bigger than the size of the actual image.
|
|
8649
|
-
img.querySelectorAll("img").forEach(i => i.src =
|
|
8648
|
+
img.querySelectorAll("img").forEach(i => i.src = $bb8d2c77db19a4c0$export$a4eccf92efefa04d(10000 * options.aspect_ratio, 10000));
|
|
8650
8649
|
return img;
|
|
8651
8650
|
};
|
|
8652
8651
|
function $dfce76a4aeb41067$var$Image(_ref2) {
|
|
@@ -8660,20 +8659,20 @@ function $dfce76a4aeb41067$var$Image(_ref2) {
|
|
|
8660
8659
|
init_with_placeholder: _,
|
|
8661
8660
|
...image_options
|
|
8662
8661
|
} = _ref2;
|
|
8663
|
-
const div =
|
|
8662
|
+
const div = $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("div", {
|
|
8664
8663
|
style: "position:relative;width:100%;padding-bottom:".concat(1 / aspect_ratio * 100, "%")
|
|
8665
8664
|
});
|
|
8666
8665
|
const sourceset_component = $dfce76a4aeb41067$var$srcset_comp_from_map_or_new(rendering_options, srcset_opts, div);
|
|
8667
8666
|
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;
|
|
8668
8667
|
div.append(
|
|
8669
8668
|
// @ts-ignore
|
|
8670
|
-
|
|
8669
|
+
$f0d9ae7bf9bd697d$export$34b9dba7ce09269b(IMG_tag, {
|
|
8671
8670
|
alt: alt,
|
|
8672
8671
|
...(remove_on_error ? {
|
|
8673
8672
|
onerror: "this.remove()"
|
|
8674
8673
|
} : {}),
|
|
8675
8674
|
...image_options,
|
|
8676
|
-
class:
|
|
8675
|
+
class: $51b78ec2cb40f07e$export$22a65337c1b43b1f(["depict-img-mod ", image_options.class, $dfce76a4aeb41067$var$add_nolazy_to_placeholder(rendering_options === null || rendering_options === void 0 ? void 0 : rendering_options.type)])
|
|
8677
8676
|
}));
|
|
8678
8677
|
return div;
|
|
8679
8678
|
}
|
|
@@ -8687,24 +8686,24 @@ function $dfce76a4aeb41067$var$CompatibleImage(_ref3) {
|
|
|
8687
8686
|
srcset_opts: srcset_opts,
|
|
8688
8687
|
...image_options
|
|
8689
8688
|
} = _ref3;
|
|
8690
|
-
const canvas =
|
|
8689
|
+
const canvas = $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("canvas", {
|
|
8691
8690
|
class: "depict-img-filler",
|
|
8692
8691
|
width: 3000 * aspect_ratio,
|
|
8693
8692
|
height: 3000
|
|
8694
8693
|
});
|
|
8695
8694
|
const sourceset_component = $dfce76a4aeb41067$var$srcset_comp_from_map_or_new(rendering_options, srcset_opts, canvas);
|
|
8696
8695
|
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;
|
|
8697
|
-
return
|
|
8696
|
+
return $f0d9ae7bf9bd697d$export$25062201e9e25d76("div", {
|
|
8698
8697
|
style: "position:relative",
|
|
8699
|
-
children: [
|
|
8698
|
+
children: [$f0d9ae7bf9bd697d$export$34b9dba7ce09269b("div", {
|
|
8700
8699
|
class: "depict-img-cont",
|
|
8701
|
-
children:
|
|
8700
|
+
children: $f0d9ae7bf9bd697d$export$34b9dba7ce09269b(IMG_tag, {
|
|
8702
8701
|
alt: alt,
|
|
8703
8702
|
...(remove_on_error ? {
|
|
8704
8703
|
onerror: "this.remove()"
|
|
8705
8704
|
} : {}),
|
|
8706
8705
|
...image_options,
|
|
8707
|
-
class:
|
|
8706
|
+
class: $51b78ec2cb40f07e$export$22a65337c1b43b1f(["depict-img-comp", image_options.class, $dfce76a4aeb41067$var$add_nolazy_to_placeholder(rendering_options === null || rendering_options === void 0 ? void 0 : rendering_options.type)])
|
|
8708
8707
|
})
|
|
8709
8708
|
}), canvas]
|
|
8710
8709
|
});
|
|
@@ -8721,7 +8720,7 @@ function $dfce76a4aeb41067$var$srcset_comp_from_map_or_new(rendering_options) {
|
|
|
8721
8720
|
...srcset_opts
|
|
8722
8721
|
};
|
|
8723
8722
|
cloned_opts.what_to_watch = canvas;
|
|
8724
|
-
sourceset_component =
|
|
8723
|
+
sourceset_component = $b42b9f62e8b6cb2d$export$a62825542f1bfcf5(cloned_opts);
|
|
8725
8724
|
$dfce76a4aeb41067$var$rendering_options_to_sourceset_component.set(rendering_options, new WeakRef(sourceset_component));
|
|
8726
8725
|
}
|
|
8727
8726
|
}
|
|
@@ -8758,7 +8757,7 @@ function $8928a1027461fba4$var$register_element_for_touch_hover(el, navigation_m
|
|
|
8758
8757
|
}
|
|
8759
8758
|
function $8928a1027461fba4$var$start_checking_for_touch_hover() {
|
|
8760
8759
|
const currently_hovering = new Map();
|
|
8761
|
-
const handle_touch_start =
|
|
8760
|
+
const handle_touch_start = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(evt => {
|
|
8762
8761
|
var _evt$changedTouches;
|
|
8763
8762
|
const touch = evt === null || evt === void 0 ? void 0 : (_evt$changedTouches = evt.changedTouches) === null || _evt$changedTouches === void 0 ? void 0 : _evt$changedTouches[0];
|
|
8764
8763
|
if (!touch) return; // Eytys dispatches fake touch events without changedTouches
|
|
@@ -8783,7 +8782,7 @@ function $8928a1027461fba4$var$start_checking_for_touch_hover() {
|
|
|
8783
8782
|
}
|
|
8784
8783
|
});
|
|
8785
8784
|
let last_collision_check = +new Date();
|
|
8786
|
-
const handle_touch_move =
|
|
8785
|
+
const handle_touch_move = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(evt => {
|
|
8787
8786
|
var _evt$changedTouches2;
|
|
8788
8787
|
const first_touch = evt === null || evt === void 0 ? void 0 : (_evt$changedTouches2 = evt.changedTouches) === null || _evt$changedTouches2 === void 0 ? void 0 : _evt$changedTouches2[0];
|
|
8789
8788
|
if (!first_touch) return;
|
|
@@ -8800,7 +8799,7 @@ function $8928a1027461fba4$var$start_checking_for_touch_hover() {
|
|
|
8800
8799
|
if (get_hover_element_from_coords(clientX, clientY) !== our_touch_data.element_) clear_hover(identifier, our_touch_data, clientX, clientY);
|
|
8801
8800
|
}
|
|
8802
8801
|
});
|
|
8803
|
-
const handle_touch_cancel =
|
|
8802
|
+
const handle_touch_cancel = $3b52ccc10510b32a$export$b3bbfd758f11cfa9(evt => {
|
|
8804
8803
|
var _evt$changedTouches3;
|
|
8805
8804
|
const touch = evt === null || evt === void 0 ? void 0 : (_evt$changedTouches3 = evt.changedTouches) === null || _evt$changedTouches3 === void 0 ? void 0 : _evt$changedTouches3[0];
|
|
8806
8805
|
if (!touch) return;
|
|
@@ -8813,7 +8812,7 @@ function $8928a1027461fba4$var$start_checking_for_touch_hover() {
|
|
|
8813
8812
|
const hover_element = elements[$8928a1027461fba4$var$HOVER_IMAGE_DEPTH - 1];
|
|
8814
8813
|
return hover_element && $8928a1027461fba4$var$touch_hover_elements.has(hover_element) ? hover_element : null;
|
|
8815
8814
|
};
|
|
8816
|
-
const clear_hover =
|
|
8815
|
+
const clear_hover = $3b52ccc10510b32a$export$b3bbfd758f11cfa9((id, info_about_touch, now_x, now_y) => {
|
|
8817
8816
|
const {
|
|
8818
8817
|
element_: element_,
|
|
8819
8818
|
start_y_: start_y_,
|
|
@@ -8862,25 +8861,25 @@ const $8928a1027461fba4$export$2369f6fc1c911576 = _ref => {
|
|
|
8862
8861
|
...options
|
|
8863
8862
|
} = _ref;
|
|
8864
8863
|
if (!$8928a1027461fba4$var$styling_inserted) {
|
|
8865
|
-
|
|
8864
|
+
$e45474c7d6e21cfa$export$59ba1eb2c083f0cd((0, /*@__PURE__*/$parcel$interopDefault($5ab0a60ded6a2bd2$exports)));
|
|
8866
8865
|
$8928a1027461fba4$var$styling_inserted = true;
|
|
8867
8866
|
}
|
|
8868
|
-
const main_image =
|
|
8867
|
+
const main_image = $dfce76a4aeb41067$export$788756b42446dc2d({
|
|
8869
8868
|
...options
|
|
8870
8869
|
});
|
|
8871
|
-
const second_image =
|
|
8870
|
+
const second_image = $dfce76a4aeb41067$export$788756b42446dc2d({
|
|
8872
8871
|
...options,
|
|
8873
8872
|
[(second_srcset_opts === null || second_srcset_opts === void 0 ? void 0 : second_srcset_opts.set_dataset) === false ? "src" : "data-src"]: second_src || "",
|
|
8874
8873
|
[(second_srcset_opts === null || second_srcset_opts === void 0 ? void 0 : second_srcset_opts.set_dataset) === false ? "srcset" : "data-srcset"]: second_srcset || "",
|
|
8875
8874
|
srcset_opts: second_srcset_opts || {}
|
|
8876
8875
|
});
|
|
8877
8876
|
const no_second_img = !second_src && !second_srcset && !second_srcset_opts;
|
|
8878
|
-
const images_container =
|
|
8877
|
+
const images_container = $f0d9ae7bf9bd697d$export$25062201e9e25d76("div", {
|
|
8879
8878
|
class: "images-container",
|
|
8880
|
-
children: [!no_second_img &&
|
|
8879
|
+
children: [!no_second_img && $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("div", {
|
|
8881
8880
|
class: "second-image-container",
|
|
8882
8881
|
children: second_image
|
|
8883
|
-
}),
|
|
8882
|
+
}), $f0d9ae7bf9bd697d$export$34b9dba7ce09269b("div", {
|
|
8884
8883
|
class: "main-image-container",
|
|
8885
8884
|
children: main_image
|
|
8886
8885
|
})]
|
|
@@ -9031,11 +9030,11 @@ let $0126fdc29a9f7f2d$var$running_writers = 0;
|
|
|
9031
9030
|
function $0126fdc29a9f7f2d$export$ef73ea4f975745ba(meta_data) {
|
|
9032
9031
|
if ($0126fdc29a9f7f2d$var$running_writers >= 1) return;
|
|
9033
9032
|
$0126fdc29a9f7f2d$var$running_writers++;
|
|
9034
|
-
|
|
9033
|
+
$bBfCy$solidjs.onCleanup(() => $0126fdc29a9f7f2d$var$running_writers--);
|
|
9035
9034
|
const disconnectors = [];
|
|
9036
|
-
|
|
9035
|
+
$bBfCy$solidjs.createEffect($3b52ccc10510b32a$export$b3bbfd758f11cfa9(() => {
|
|
9037
9036
|
if (!meta_data()) return;
|
|
9038
|
-
|
|
9037
|
+
$bBfCy$solidjs.onCleanup(() => {
|
|
9039
9038
|
disconnectors.forEach(d => d());
|
|
9040
9039
|
});
|
|
9041
9040
|
for (const [type, content] of Object.entries(meta_data())) for (const opts of $0126fdc29a9f7f2d$var$tags[type]) {
|
|
@@ -9046,7 +9045,7 @@ function $0126fdc29a9f7f2d$export$ef73ea4f975745ba(meta_data) {
|
|
|
9046
9045
|
* It's preferred not to kill any conflicting meta tags because frameworks might go apeshit.
|
|
9047
9046
|
* Things seem to work when only changing the meta values though */
|
|
9048
9047
|
const sync_elements_to_head = () => {
|
|
9049
|
-
if (retries++ > $0126fdc29a9f7f2d$var$MAX_SYNC_RETRIES) return
|
|
9048
|
+
if (retries++ > $0126fdc29a9f7f2d$var$MAX_SYNC_RETRIES) return $7f95f77417d06249$export$de56f1198d121036("Failed to sync meta tag to head. Hit max retries.", opts.selector, content);
|
|
9050
9049
|
const existing_elements = document.head.querySelectorAll(opts.selector);
|
|
9051
9050
|
const elements = existing_elements.length ? existing_elements : [opts.create()];
|
|
9052
9051
|
elements.forEach(el => {
|
|
@@ -9069,5 +9068,5 @@ function $0126fdc29a9f7f2d$export$ef73ea4f975745ba(meta_data) {
|
|
|
9069
9068
|
}
|
|
9070
9069
|
}, "Meta tag writing crashed"));
|
|
9071
9070
|
}
|
|
9072
|
-
|
|
9071
|
+
$045fb30107c9eecc$export$2cefb7e61fcbae00("utilishared", (0, $ce0ab19b284b64fa$export$83d89fbfd8236492));
|
|
9073
9072
|
$parcel$exportWildcard(module.exports, $2e81c18d82b25372$exports);
|