@everymatrix/casino-game-page 1.77.4 → 1.77.6

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.
@@ -1,86 +0,0 @@
1
- import { r as n, h as t, H as r, g as a } from "./index-242ac81a-BqeIndhr.js";
2
- const h = ".HostContainer{display:block}.UiContainer{height:100%;width:100%;border-radius:inherit;object-fit:inherit}.UiContainer .Image{border-radius:inherit}.Hidden{opacity:0;transition:opacity 0.5s ease-in-out}.Visible{opacity:1;border-radius:var(--emw--border-radius-medium, 10px);transition:opacity 0.5s ease-in-out}", o = h, d = class {
3
- constructor(e) {
4
- n(this, e), this.hasStarted = !1, this.src = void 0, this.width = void 0, this.height = void 0, this.alt = void 0, this.styles = void 0, this.detectDistance = "200px", this.loading = "lazy", this.imgLoaded = !1;
5
- }
6
- onSrcChange() {
7
- this.loading !== "eager" && (this.imgLoaded = !1, this.hasStarted = !1, (typeof window == "undefined" || !("IntersectionObserver" in window)) && this.beginLoad());
8
- }
9
- onLoadingChange(e, i) {
10
- e !== i && (this.cleanupObserver(), this.detachImgHandlers(), e === "eager" ? (this.imgEl && this.src && (this.imgEl.src = this.src), this.hasStarted = !0) : (this.imgLoaded = !1, this.hasStarted = !1, this.setupObserver()));
11
- }
12
- componentDidLoad() {
13
- this.loading !== "eager" && this.setupObserver();
14
- }
15
- disconnectedCallback() {
16
- this.cleanupObserver(), this.detachImgHandlers();
17
- }
18
- canUseIO() {
19
- return typeof window != "undefined" && "IntersectionObserver" in window;
20
- }
21
- setupObserver() {
22
- if (this.loading !== "eager") {
23
- if (!this.canUseIO()) {
24
- this.beginLoad();
25
- return;
26
- }
27
- this.io = new IntersectionObserver((e) => {
28
- var i;
29
- for (const s of e)
30
- if (s.isIntersecting) {
31
- this.beginLoad(), (i = this.io) === null || i === void 0 || i.unobserve(s.target), this.cleanupObserver();
32
- break;
33
- }
34
- }, { root: null, rootMargin: this.detectDistance, threshold: 0 }), this.io.observe(this.el);
35
- }
36
- }
37
- cleanupObserver() {
38
- var e;
39
- (e = this.io) === null || e === void 0 || e.disconnect(), this.io = void 0;
40
- }
41
- wireOnceHandlers() {
42
- this.imgEl && (this.detachImgHandlers(), this._onLoad = () => {
43
- var e;
44
- this.currentSrc && (!((e = this.imgEl) === null || e === void 0) && e.currentSrc) && !this.imgEl.currentSrc.includes(this.currentSrc) || (this.imgLoaded = !0);
45
- }, this._onError = () => {
46
- console.error("Load image failed:", this.src);
47
- }, this.imgEl.addEventListener("load", this._onLoad, { once: !0 }), this.imgEl.addEventListener("error", this._onError, { once: !0 }));
48
- }
49
- detachImgHandlers() {
50
- this.imgEl && (this._onLoad && this.imgEl.removeEventListener("load", this._onLoad), this._onError && this.imgEl.removeEventListener("error", this._onError), this._onLoad = void 0, this._onError = void 0);
51
- }
52
- beginLoad() {
53
- if (!this.hasStarted && this.imgEl && this.src) {
54
- if (this.hasStarted = !0, this.wireOnceHandlers(), this.imgEl.complete && this.imgEl.naturalWidth > 0) {
55
- this.imgLoaded = !0;
56
- return;
57
- }
58
- this.currentSrc = this.src, this.imgEl.src = this.src, this.imgEl.complete && this.imgEl.naturalWidth > 0 && (this.imgLoaded = !0);
59
- }
60
- }
61
- get showSkeleton() {
62
- return this.loading !== "eager" && !this.imgLoaded;
63
- }
64
- renderEager() {
65
- return t(r, { class: "HostContainer" }, t("img", { src: this.src, decoding: "async", style: this.styles, class: "UiContainer Visible", alt: this.alt, width: this.width, height: this.height, loading: "eager" }));
66
- }
67
- renderLazy() {
68
- return t(r, { class: "HostContainer", "aria-busy": this.imgLoaded ? "false" : "true" }, this.showSkeleton && t("ui-skeleton", { class: "UiContainer", structure: "image", width: "100%", height: "100%" }), t("img", { ref: (e) => this.imgEl = e, src: void 0, decoding: "async", style: this.styles, class: `UiContainer ${this.imgLoaded ? "Visible" : "Hidden"}`, alt: this.alt, width: this.width, height: this.height, loading: "lazy" }));
69
- }
70
- render() {
71
- return this.loading === "eager" ? this.renderEager() : this.renderLazy();
72
- }
73
- get el() {
74
- return a(this);
75
- }
76
- static get watchers() {
77
- return {
78
- src: ["onSrcChange"],
79
- loading: ["onLoadingChange"]
80
- };
81
- }
82
- };
83
- d.style = o;
84
- export {
85
- d as U
86
- };