@record-evolution/widget-image 1.1.12 → 1.1.14
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/README.md +16 -5
- package/dist/widget-image.js +605 -613
- package/dist/widget-image.js.map +1 -1
- package/package.json +8 -13
- package/src/definition-schema.d.ts +32 -0
- package/src/definition-schema.json +59 -4
- package/src/widget-image.ts +240 -23
- package/dist/src/widget-image.d.ts +0 -20
- package/dist/tsconfig.tsbuildinfo +0 -1
package/dist/widget-image.js
CHANGED
|
@@ -1,52 +1,15 @@
|
|
|
1
|
-
/* @
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */
|
|
16
|
-
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
17
|
-
|
|
18
|
-
function __decorate(decorators, target, key, desc) {
|
|
19
|
-
var c = arguments.length,
|
|
20
|
-
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
21
|
-
d;
|
|
22
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
23
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
24
|
-
}
|
|
25
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
26
|
-
var e = new Error(message);
|
|
27
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @license
|
|
32
|
-
* Copyright 2019 Google LLC
|
|
33
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
34
|
-
*/
|
|
35
|
-
const t$2 = globalThis,
|
|
36
|
-
e$2 = t$2.ShadowRoot && (void 0 === t$2.ShadyCSS || t$2.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype,
|
|
37
|
-
s$2 = Symbol(),
|
|
38
|
-
o$4 = new WeakMap();
|
|
39
|
-
let n$3 = class n {
|
|
40
|
-
constructor(t, e, o) {
|
|
41
|
-
if (this._$cssResult$ = !0, o !== s$2) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
1
|
+
const z = globalThis, V = z.ShadowRoot && (z.ShadyCSS === void 0 || z.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, G = /* @__PURE__ */ Symbol(), Y = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
let pt = class {
|
|
3
|
+
constructor(t, e, i) {
|
|
4
|
+
if (this._$cssResult$ = !0, i !== G) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
42
5
|
this.cssText = t, this.t = e;
|
|
43
6
|
}
|
|
44
7
|
get styleSheet() {
|
|
45
8
|
let t = this.o;
|
|
46
|
-
const
|
|
47
|
-
if (
|
|
48
|
-
const
|
|
49
|
-
|
|
9
|
+
const e = this.t;
|
|
10
|
+
if (V && t === void 0) {
|
|
11
|
+
const i = e !== void 0 && e.length === 1;
|
|
12
|
+
i && (t = Y.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && Y.set(e, t));
|
|
50
13
|
}
|
|
51
14
|
return t;
|
|
52
15
|
}
|
|
@@ -54,239 +17,182 @@ let n$3 = class n {
|
|
|
54
17
|
return this.cssText;
|
|
55
18
|
}
|
|
56
19
|
};
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
case Boolean:
|
|
101
|
-
t = t ? l$1 : null;
|
|
102
|
-
break;
|
|
103
|
-
case Object:
|
|
104
|
-
case Array:
|
|
105
|
-
t = null == t ? t : JSON.stringify(t);
|
|
20
|
+
const gt = (r) => new pt(typeof r == "string" ? r : r + "", void 0, G), mt = (r, ...t) => {
|
|
21
|
+
const e = r.length === 1 ? r[0] : t.reduce(((i, s, n) => i + ((o) => {
|
|
22
|
+
if (o._$cssResult$ === !0) return o.cssText;
|
|
23
|
+
if (typeof o == "number") return o;
|
|
24
|
+
throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
25
|
+
})(s) + r[n + 1]), r[0]);
|
|
26
|
+
return new pt(e, r, G);
|
|
27
|
+
}, _t = (r, t) => {
|
|
28
|
+
if (V) r.adoptedStyleSheets = t.map(((e) => e instanceof CSSStyleSheet ? e : e.styleSheet));
|
|
29
|
+
else for (const e of t) {
|
|
30
|
+
const i = document.createElement("style"), s = z.litNonce;
|
|
31
|
+
s !== void 0 && i.setAttribute("nonce", s), i.textContent = e.cssText, r.appendChild(i);
|
|
32
|
+
}
|
|
33
|
+
}, tt = V ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
|
|
34
|
+
let e = "";
|
|
35
|
+
for (const i of t.cssRules) e += i.cssText;
|
|
36
|
+
return gt(e);
|
|
37
|
+
})(r) : r;
|
|
38
|
+
const { is: yt, defineProperty: At, getOwnPropertyDescriptor: vt, getOwnPropertyNames: bt, getOwnPropertySymbols: wt, getPrototypeOf: xt } = Object, k = globalThis, et = k.trustedTypes, St = et ? et.emptyScript : "", Et = k.reactiveElementPolyfillSupport, T = (r, t) => r, j = { toAttribute(r, t) {
|
|
39
|
+
switch (t) {
|
|
40
|
+
case Boolean:
|
|
41
|
+
r = r ? St : null;
|
|
42
|
+
break;
|
|
43
|
+
case Object:
|
|
44
|
+
case Array:
|
|
45
|
+
r = r == null ? r : JSON.stringify(r);
|
|
46
|
+
}
|
|
47
|
+
return r;
|
|
48
|
+
}, fromAttribute(r, t) {
|
|
49
|
+
let e = r;
|
|
50
|
+
switch (t) {
|
|
51
|
+
case Boolean:
|
|
52
|
+
e = r !== null;
|
|
53
|
+
break;
|
|
54
|
+
case Number:
|
|
55
|
+
e = r === null ? null : Number(r);
|
|
56
|
+
break;
|
|
57
|
+
case Object:
|
|
58
|
+
case Array:
|
|
59
|
+
try {
|
|
60
|
+
e = JSON.parse(r);
|
|
61
|
+
} catch {
|
|
62
|
+
e = null;
|
|
106
63
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
case Boolean:
|
|
113
|
-
i = null !== t;
|
|
114
|
-
break;
|
|
115
|
-
case Number:
|
|
116
|
-
i = null === t ? null : Number(t);
|
|
117
|
-
break;
|
|
118
|
-
case Object:
|
|
119
|
-
case Array:
|
|
120
|
-
try {
|
|
121
|
-
i = JSON.parse(t);
|
|
122
|
-
} catch (t) {
|
|
123
|
-
i = null;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
return i;
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
f$1 = (t, s) => !i$2(t, s),
|
|
130
|
-
b = {
|
|
131
|
-
attribute: !0,
|
|
132
|
-
type: String,
|
|
133
|
-
converter: u$1,
|
|
134
|
-
reflect: !1,
|
|
135
|
-
useDefault: !1,
|
|
136
|
-
hasChanged: f$1
|
|
137
|
-
};
|
|
138
|
-
Symbol.metadata ??= Symbol("metadata"), a$1.litPropertyMetadata ??= new WeakMap();
|
|
139
|
-
let y$1 = class y extends HTMLElement {
|
|
64
|
+
}
|
|
65
|
+
return e;
|
|
66
|
+
} }, Z = (r, t) => !yt(r, t), it = { attribute: !0, type: String, converter: j, reflect: !1, useDefault: !1, hasChanged: Z };
|
|
67
|
+
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), k.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
68
|
+
let S = class extends HTMLElement {
|
|
140
69
|
static addInitializer(t) {
|
|
141
70
|
this._$Ei(), (this.l ??= []).push(t);
|
|
142
71
|
}
|
|
143
72
|
static get observedAttributes() {
|
|
144
73
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
145
74
|
}
|
|
146
|
-
static createProperty(t,
|
|
147
|
-
if (
|
|
148
|
-
const i = Symbol(),
|
|
149
|
-
|
|
150
|
-
void 0 !== h && e$1(this.prototype, t, h);
|
|
75
|
+
static createProperty(t, e = it) {
|
|
76
|
+
if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
77
|
+
const i = /* @__PURE__ */ Symbol(), s = this.getPropertyDescriptor(t, i, e);
|
|
78
|
+
s !== void 0 && At(this.prototype, t, s);
|
|
151
79
|
}
|
|
152
80
|
}
|
|
153
|
-
static getPropertyDescriptor(t,
|
|
154
|
-
const {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
return {
|
|
166
|
-
get: e,
|
|
167
|
-
set(s) {
|
|
168
|
-
const h = e?.call(this);
|
|
169
|
-
r?.call(this, s), this.requestUpdate(t, h, i);
|
|
170
|
-
},
|
|
171
|
-
configurable: !0,
|
|
172
|
-
enumerable: !0
|
|
173
|
-
};
|
|
81
|
+
static getPropertyDescriptor(t, e, i) {
|
|
82
|
+
const { get: s, set: n } = vt(this.prototype, t) ?? { get() {
|
|
83
|
+
return this[e];
|
|
84
|
+
}, set(o) {
|
|
85
|
+
this[e] = o;
|
|
86
|
+
} };
|
|
87
|
+
return { get: s, set(o) {
|
|
88
|
+
const l = s?.call(this);
|
|
89
|
+
n?.call(this, o), this.requestUpdate(t, l, i);
|
|
90
|
+
}, configurable: !0, enumerable: !0 };
|
|
174
91
|
}
|
|
175
92
|
static getPropertyOptions(t) {
|
|
176
|
-
return this.elementProperties.get(t) ??
|
|
93
|
+
return this.elementProperties.get(t) ?? it;
|
|
177
94
|
}
|
|
178
95
|
static _$Ei() {
|
|
179
|
-
if (this.hasOwnProperty(
|
|
180
|
-
const t =
|
|
181
|
-
t.finalize(), void 0
|
|
96
|
+
if (this.hasOwnProperty(T("elementProperties"))) return;
|
|
97
|
+
const t = xt(this);
|
|
98
|
+
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
182
99
|
}
|
|
183
100
|
static finalize() {
|
|
184
|
-
if (this.hasOwnProperty(
|
|
185
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
186
|
-
const
|
|
187
|
-
|
|
188
|
-
for (const i of s) this.createProperty(i, t[i]);
|
|
101
|
+
if (this.hasOwnProperty(T("finalized"))) return;
|
|
102
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(T("properties"))) {
|
|
103
|
+
const e = this.properties, i = [...bt(e), ...wt(e)];
|
|
104
|
+
for (const s of i) this.createProperty(s, e[s]);
|
|
189
105
|
}
|
|
190
106
|
const t = this[Symbol.metadata];
|
|
191
|
-
if (
|
|
192
|
-
const
|
|
193
|
-
if (void 0
|
|
107
|
+
if (t !== null) {
|
|
108
|
+
const e = litPropertyMetadata.get(t);
|
|
109
|
+
if (e !== void 0) for (const [i, s] of e) this.elementProperties.set(i, s);
|
|
194
110
|
}
|
|
195
|
-
this._$Eh = new Map();
|
|
196
|
-
for (const [
|
|
197
|
-
const
|
|
198
|
-
void 0
|
|
111
|
+
this._$Eh = /* @__PURE__ */ new Map();
|
|
112
|
+
for (const [e, i] of this.elementProperties) {
|
|
113
|
+
const s = this._$Eu(e, i);
|
|
114
|
+
s !== void 0 && this._$Eh.set(s, e);
|
|
199
115
|
}
|
|
200
116
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
201
117
|
}
|
|
202
|
-
static finalizeStyles(
|
|
203
|
-
const
|
|
204
|
-
if (Array.isArray(
|
|
205
|
-
const
|
|
206
|
-
for (const s of
|
|
207
|
-
} else void 0
|
|
208
|
-
return
|
|
118
|
+
static finalizeStyles(t) {
|
|
119
|
+
const e = [];
|
|
120
|
+
if (Array.isArray(t)) {
|
|
121
|
+
const i = new Set(t.flat(1 / 0).reverse());
|
|
122
|
+
for (const s of i) e.unshift(tt(s));
|
|
123
|
+
} else t !== void 0 && e.push(tt(t));
|
|
124
|
+
return e;
|
|
209
125
|
}
|
|
210
|
-
static _$Eu(t,
|
|
211
|
-
const i =
|
|
212
|
-
return
|
|
126
|
+
static _$Eu(t, e) {
|
|
127
|
+
const i = e.attribute;
|
|
128
|
+
return i === !1 ? void 0 : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : void 0;
|
|
213
129
|
}
|
|
214
130
|
constructor() {
|
|
215
131
|
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
216
132
|
}
|
|
217
133
|
_$Ev() {
|
|
218
|
-
this._$ES = new Promise(t => this.enableUpdating = t), this._$AL = new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(t => t(this));
|
|
134
|
+
this._$ES = new Promise(((t) => this.enableUpdating = t)), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(((t) => t(this)));
|
|
219
135
|
}
|
|
220
136
|
addController(t) {
|
|
221
|
-
(this._$EO ??= new Set()).add(t), void 0
|
|
137
|
+
(this._$EO ??= /* @__PURE__ */ new Set()).add(t), this.renderRoot !== void 0 && this.isConnected && t.hostConnected?.();
|
|
222
138
|
}
|
|
223
139
|
removeController(t) {
|
|
224
140
|
this._$EO?.delete(t);
|
|
225
141
|
}
|
|
226
142
|
_$E_() {
|
|
227
|
-
const t = new Map(),
|
|
228
|
-
|
|
229
|
-
for (const i of s.keys()) this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
|
|
143
|
+
const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
|
|
144
|
+
for (const i of e.keys()) this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
|
|
230
145
|
t.size > 0 && (this._$Ep = t);
|
|
231
146
|
}
|
|
232
147
|
createRenderRoot() {
|
|
233
148
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
234
|
-
return
|
|
149
|
+
return _t(t, this.constructor.elementStyles), t;
|
|
235
150
|
}
|
|
236
151
|
connectedCallback() {
|
|
237
|
-
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(t => t.hostConnected?.());
|
|
152
|
+
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((t) => t.hostConnected?.()));
|
|
153
|
+
}
|
|
154
|
+
enableUpdating(t) {
|
|
238
155
|
}
|
|
239
|
-
enableUpdating(t) {}
|
|
240
156
|
disconnectedCallback() {
|
|
241
|
-
this._$EO?.forEach(t => t.hostDisconnected?.());
|
|
157
|
+
this._$EO?.forEach(((t) => t.hostDisconnected?.()));
|
|
242
158
|
}
|
|
243
|
-
attributeChangedCallback(t,
|
|
159
|
+
attributeChangedCallback(t, e, i) {
|
|
244
160
|
this._$AK(t, i);
|
|
245
161
|
}
|
|
246
|
-
_$ET(t,
|
|
247
|
-
const i = this.constructor.elementProperties.get(t),
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
this._$Em = t, null == h ? this.removeAttribute(e) : this.setAttribute(e, h), this._$Em = null;
|
|
162
|
+
_$ET(t, e) {
|
|
163
|
+
const i = this.constructor.elementProperties.get(t), s = this.constructor._$Eu(t, i);
|
|
164
|
+
if (s !== void 0 && i.reflect === !0) {
|
|
165
|
+
const n = (i.converter?.toAttribute !== void 0 ? i.converter : j).toAttribute(e, i.type);
|
|
166
|
+
this._$Em = t, n == null ? this.removeAttribute(s) : this.setAttribute(s, n), this._$Em = null;
|
|
252
167
|
}
|
|
253
168
|
}
|
|
254
|
-
_$AK(t,
|
|
255
|
-
const i = this.constructor,
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
h = "function" == typeof t.converter ? {
|
|
260
|
-
fromAttribute: t.converter
|
|
261
|
-
} : void 0 !== t.converter?.fromAttribute ? t.converter : u$1;
|
|
262
|
-
this._$Em = e, this[e] = h.fromAttribute(s, t.type) ?? this._$Ej?.get(e) ?? null, this._$Em = null;
|
|
169
|
+
_$AK(t, e) {
|
|
170
|
+
const i = this.constructor, s = i._$Eh.get(t);
|
|
171
|
+
if (s !== void 0 && this._$Em !== s) {
|
|
172
|
+
const n = i.getPropertyOptions(s), o = typeof n.converter == "function" ? { fromAttribute: n.converter } : n.converter?.fromAttribute !== void 0 ? n.converter : j;
|
|
173
|
+
this._$Em = s, this[s] = o.fromAttribute(e, n.type) ?? this._$Ej?.get(s) ?? null, this._$Em = null;
|
|
263
174
|
}
|
|
264
175
|
}
|
|
265
|
-
requestUpdate(t,
|
|
266
|
-
if (void 0
|
|
267
|
-
const
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
this.C(t, s, i);
|
|
176
|
+
requestUpdate(t, e, i) {
|
|
177
|
+
if (t !== void 0) {
|
|
178
|
+
const s = this.constructor, n = this[t];
|
|
179
|
+
if (i ??= s.getPropertyOptions(t), !((i.hasChanged ?? Z)(n, e) || i.useDefault && i.reflect && n === this._$Ej?.get(t) && !this.hasAttribute(s._$Eu(t, i)))) return;
|
|
180
|
+
this.C(t, e, i);
|
|
271
181
|
}
|
|
272
|
-
|
|
182
|
+
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
273
183
|
}
|
|
274
|
-
C(t, s, {
|
|
275
|
-
|
|
276
|
-
reflect: e,
|
|
277
|
-
wrapped: h
|
|
278
|
-
}, r) {
|
|
279
|
-
i && !(this._$Ej ??= new Map()).has(t) && (this._$Ej.set(t, r ?? s ?? this[t]), !0 !== h || void 0 !== r) || (this._$AL.has(t) || (this.hasUpdated || i || (s = void 0), this._$AL.set(t, s)), !0 === e && this._$Em !== t && (this._$Eq ??= new Set()).add(t));
|
|
184
|
+
C(t, e, { useDefault: i, reflect: s, wrapped: n }, o) {
|
|
185
|
+
i && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, o ?? e ?? this[t]), n !== !0 || o !== void 0) || (this._$AL.has(t) || (this.hasUpdated || i || (e = void 0), this._$AL.set(t, e)), s === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
|
|
280
186
|
}
|
|
281
187
|
async _$EP() {
|
|
282
188
|
this.isUpdatePending = !0;
|
|
283
189
|
try {
|
|
284
190
|
await this._$ES;
|
|
285
|
-
} catch (
|
|
286
|
-
Promise.reject(
|
|
191
|
+
} catch (e) {
|
|
192
|
+
Promise.reject(e);
|
|
287
193
|
}
|
|
288
194
|
const t = this.scheduleUpdate();
|
|
289
|
-
return
|
|
195
|
+
return t != null && await t, !this.isUpdatePending;
|
|
290
196
|
}
|
|
291
197
|
scheduleUpdate() {
|
|
292
198
|
return this.performUpdate();
|
|
@@ -295,33 +201,31 @@ let y$1 = class y extends HTMLElement {
|
|
|
295
201
|
if (!this.isUpdatePending) return;
|
|
296
202
|
if (!this.hasUpdated) {
|
|
297
203
|
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
298
|
-
for (const [
|
|
204
|
+
for (const [s, n] of this._$Ep) this[s] = n;
|
|
299
205
|
this._$Ep = void 0;
|
|
300
206
|
}
|
|
301
|
-
const
|
|
302
|
-
if (
|
|
303
|
-
const {
|
|
304
|
-
|
|
305
|
-
} = i,
|
|
306
|
-
e = this[s];
|
|
307
|
-
!0 !== t || this._$AL.has(s) || void 0 === e || this.C(s, void 0, i, e);
|
|
207
|
+
const i = this.constructor.elementProperties;
|
|
208
|
+
if (i.size > 0) for (const [s, n] of i) {
|
|
209
|
+
const { wrapped: o } = n, l = this[s];
|
|
210
|
+
o !== !0 || this._$AL.has(s) || l === void 0 || this.C(s, void 0, n, l);
|
|
308
211
|
}
|
|
309
212
|
}
|
|
310
213
|
let t = !1;
|
|
311
|
-
const
|
|
214
|
+
const e = this._$AL;
|
|
312
215
|
try {
|
|
313
|
-
t = this.shouldUpdate(
|
|
314
|
-
} catch (
|
|
315
|
-
throw t = !1, this._$EM(),
|
|
216
|
+
t = this.shouldUpdate(e), t ? (this.willUpdate(e), this._$EO?.forEach(((i) => i.hostUpdate?.())), this.update(e)) : this._$EM();
|
|
217
|
+
} catch (i) {
|
|
218
|
+
throw t = !1, this._$EM(), i;
|
|
316
219
|
}
|
|
317
|
-
t && this._$AE(
|
|
220
|
+
t && this._$AE(e);
|
|
221
|
+
}
|
|
222
|
+
willUpdate(t) {
|
|
318
223
|
}
|
|
319
|
-
willUpdate(t) {}
|
|
320
224
|
_$AE(t) {
|
|
321
|
-
this._$EO?.forEach(
|
|
225
|
+
this._$EO?.forEach(((e) => e.hostUpdated?.())), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
|
322
226
|
}
|
|
323
227
|
_$EM() {
|
|
324
|
-
this._$AL = new Map(), this.isUpdatePending = !1;
|
|
228
|
+
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
325
229
|
}
|
|
326
230
|
get updateComplete() {
|
|
327
231
|
return this.getUpdateComplete();
|
|
@@ -333,148 +237,79 @@ let y$1 = class y extends HTMLElement {
|
|
|
333
237
|
return !0;
|
|
334
238
|
}
|
|
335
239
|
update(t) {
|
|
336
|
-
this._$Eq &&= this._$Eq.forEach(
|
|
240
|
+
this._$Eq &&= this._$Eq.forEach(((e) => this._$ET(e, this[e]))), this._$EM();
|
|
241
|
+
}
|
|
242
|
+
updated(t) {
|
|
243
|
+
}
|
|
244
|
+
firstUpdated(t) {
|
|
337
245
|
}
|
|
338
|
-
updated(t) {}
|
|
339
|
-
firstUpdated(t) {}
|
|
340
246
|
};
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
* @license
|
|
349
|
-
* Copyright 2017 Google LLC
|
|
350
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
351
|
-
*/
|
|
352
|
-
const t$1 = globalThis,
|
|
353
|
-
i$1 = t$1.trustedTypes,
|
|
354
|
-
s$1 = i$1 ? i$1.createPolicy("lit-html", {
|
|
355
|
-
createHTML: t => t
|
|
356
|
-
}) : void 0,
|
|
357
|
-
e = "$lit$",
|
|
358
|
-
h = `lit$${Math.random().toFixed(9).slice(2)}$`,
|
|
359
|
-
o$2 = "?" + h,
|
|
360
|
-
n$1 = `<${o$2}>`,
|
|
361
|
-
r$2 = document,
|
|
362
|
-
l = () => r$2.createComment(""),
|
|
363
|
-
c = t => null === t || "object" != typeof t && "function" != typeof t,
|
|
364
|
-
a = Array.isArray,
|
|
365
|
-
u = t => a(t) || "function" == typeof t?.[Symbol.iterator],
|
|
366
|
-
d = "[ \t\n\f\r]",
|
|
367
|
-
f = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
368
|
-
v = /-->/g,
|
|
369
|
-
_ = />/g,
|
|
370
|
-
m = RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
371
|
-
p = /'/g,
|
|
372
|
-
g = /"/g,
|
|
373
|
-
$ = /^(?:script|style|textarea|title)$/i,
|
|
374
|
-
y = t => (i, ...s) => ({
|
|
375
|
-
_$litType$: t,
|
|
376
|
-
strings: i,
|
|
377
|
-
values: s
|
|
378
|
-
}),
|
|
379
|
-
x = y(1),
|
|
380
|
-
T = Symbol.for("lit-noChange"),
|
|
381
|
-
E = Symbol.for("lit-nothing"),
|
|
382
|
-
A = new WeakMap(),
|
|
383
|
-
C = r$2.createTreeWalker(r$2, 129);
|
|
384
|
-
function P(t, i) {
|
|
385
|
-
if (!a(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
386
|
-
return void 0 !== s$1 ? s$1.createHTML(i) : i;
|
|
247
|
+
S.elementStyles = [], S.shadowRootOptions = { mode: "open" }, S[T("elementProperties")] = /* @__PURE__ */ new Map(), S[T("finalized")] = /* @__PURE__ */ new Map(), Et?.({ ReactiveElement: S }), (k.reactiveElementVersions ??= []).push("2.1.0");
|
|
248
|
+
const F = globalThis, I = F.trustedTypes, st = I ? I.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, dt = "$lit$", y = `lit$${Math.random().toFixed(9).slice(2)}$`, ut = "?" + y, Ct = `<${ut}>`, w = document, D = () => w.createComment(""), M = (r) => r === null || typeof r != "object" && typeof r != "function", J = Array.isArray, Pt = (r) => J(r) || typeof r?.[Symbol.iterator] == "function", W = `[
|
|
249
|
+
\f\r]`, P = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, rt = /-->/g, nt = />/g, A = RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^
|
|
250
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), ot = /'/g, ht = /"/g, $t = /^(?:script|style|textarea|title)$/i, Ut = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), U = Ut(1), x = /* @__PURE__ */ Symbol.for("lit-noChange"), $ = /* @__PURE__ */ Symbol.for("lit-nothing"), at = /* @__PURE__ */ new WeakMap(), b = w.createTreeWalker(w, 129);
|
|
251
|
+
function ft(r, t) {
|
|
252
|
+
if (!J(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
253
|
+
return st !== void 0 ? st.createHTML(t) : t;
|
|
387
254
|
}
|
|
388
|
-
const
|
|
389
|
-
const
|
|
390
|
-
|
|
391
|
-
let
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
const
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
y = 0;
|
|
400
|
-
for (; y < s.length && (c.lastIndex = y, u = c.exec(s), null !== u);) y = c.lastIndex, c === f ? "!--" === u[1] ? c = v : void 0 !== u[1] ? c = _ : void 0 !== u[2] ? ($.test(u[2]) && (r = RegExp("</" + u[2], "g")), c = m) : void 0 !== u[3] && (c = m) : c === m ? ">" === u[0] ? (c = r ?? f, d = -1) : void 0 === u[1] ? d = -2 : (d = c.lastIndex - u[2].length, a = u[1], c = void 0 === u[3] ? m : '"' === u[3] ? g : p) : c === g || c === p ? c = m : c === v || c === _ ? c = f : (c = m, r = void 0);
|
|
401
|
-
const x = c === m && t[i + 1].startsWith("/>") ? " " : "";
|
|
402
|
-
l += c === f ? s + n$1 : d >= 0 ? (o.push(a), s.slice(0, d) + e + s.slice(d) + h + x) : s + h + (-2 === d ? i : x);
|
|
403
|
-
}
|
|
404
|
-
return [P(t, l + (t[s] || "<?>") + (2 === i ? "</svg>" : 3 === i ? "</math>" : "")), o];
|
|
255
|
+
const Ot = (r, t) => {
|
|
256
|
+
const e = r.length - 1, i = [];
|
|
257
|
+
let s, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = P;
|
|
258
|
+
for (let l = 0; l < e; l++) {
|
|
259
|
+
const h = r[l];
|
|
260
|
+
let p, u, a = -1, d = 0;
|
|
261
|
+
for (; d < h.length && (o.lastIndex = d, u = o.exec(h), u !== null); ) d = o.lastIndex, o === P ? u[1] === "!--" ? o = rt : u[1] !== void 0 ? o = nt : u[2] !== void 0 ? ($t.test(u[2]) && (s = RegExp("</" + u[2], "g")), o = A) : u[3] !== void 0 && (o = A) : o === A ? u[0] === ">" ? (o = s ?? P, a = -1) : u[1] === void 0 ? a = -2 : (a = o.lastIndex - u[2].length, p = u[1], o = u[3] === void 0 ? A : u[3] === '"' ? ht : ot) : o === ht || o === ot ? o = A : o === rt || o === nt ? o = P : (o = A, s = void 0);
|
|
262
|
+
const c = o === A && r[l + 1].startsWith("/>") ? " " : "";
|
|
263
|
+
n += o === P ? h + Ct : a >= 0 ? (i.push(p), h.slice(0, a) + dt + h.slice(a) + y + c) : h + y + (a === -2 ? l : c);
|
|
264
|
+
}
|
|
265
|
+
return [ft(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
|
|
405
266
|
};
|
|
406
|
-
class
|
|
407
|
-
constructor({
|
|
408
|
-
|
|
409
|
-
_$litType$: s
|
|
410
|
-
}, n) {
|
|
411
|
-
let r;
|
|
267
|
+
class R {
|
|
268
|
+
constructor({ strings: t, _$litType$: e }, i) {
|
|
269
|
+
let s;
|
|
412
270
|
this.parts = [];
|
|
413
|
-
let
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
if (this.el = N.createElement(f, n), C.currentNode = this.el.content, 2 === s || 3 === s) {
|
|
419
|
-
const t = this.el.content.firstChild;
|
|
420
|
-
t.replaceWith(...t.childNodes);
|
|
271
|
+
let n = 0, o = 0;
|
|
272
|
+
const l = t.length - 1, h = this.parts, [p, u] = Ot(t, e);
|
|
273
|
+
if (this.el = R.createElement(p, i), b.currentNode = this.el.content, e === 2 || e === 3) {
|
|
274
|
+
const a = this.el.content.firstChild;
|
|
275
|
+
a.replaceWith(...a.childNodes);
|
|
421
276
|
}
|
|
422
|
-
for (;
|
|
423
|
-
if (
|
|
424
|
-
if (
|
|
425
|
-
const
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
}), r.removeAttribute(t);
|
|
435
|
-
} else t.startsWith(h) && (d.push({
|
|
436
|
-
type: 6,
|
|
437
|
-
index: c
|
|
438
|
-
}), r.removeAttribute(t));
|
|
439
|
-
if ($.test(r.tagName)) {
|
|
440
|
-
const t = r.textContent.split(h),
|
|
441
|
-
s = t.length - 1;
|
|
442
|
-
if (s > 0) {
|
|
443
|
-
r.textContent = i$1 ? i$1.emptyScript : "";
|
|
444
|
-
for (let i = 0; i < s; i++) r.append(t[i], l()), C.nextNode(), d.push({
|
|
445
|
-
type: 2,
|
|
446
|
-
index: ++c
|
|
447
|
-
});
|
|
448
|
-
r.append(t[s], l());
|
|
277
|
+
for (; (s = b.nextNode()) !== null && h.length < l; ) {
|
|
278
|
+
if (s.nodeType === 1) {
|
|
279
|
+
if (s.hasAttributes()) for (const a of s.getAttributeNames()) if (a.endsWith(dt)) {
|
|
280
|
+
const d = u[o++], c = s.getAttribute(a).split(y), f = /([.?@])?(.*)/.exec(d);
|
|
281
|
+
h.push({ type: 1, index: n, name: f[2], strings: c, ctor: f[1] === "." ? Ht : f[1] === "?" ? Dt : f[1] === "@" ? Mt : L }), s.removeAttribute(a);
|
|
282
|
+
} else a.startsWith(y) && (h.push({ type: 6, index: n }), s.removeAttribute(a));
|
|
283
|
+
if ($t.test(s.tagName)) {
|
|
284
|
+
const a = s.textContent.split(y), d = a.length - 1;
|
|
285
|
+
if (d > 0) {
|
|
286
|
+
s.textContent = I ? I.emptyScript : "";
|
|
287
|
+
for (let c = 0; c < d; c++) s.append(a[c], D()), b.nextNode(), h.push({ type: 2, index: ++n });
|
|
288
|
+
s.append(a[d], D());
|
|
449
289
|
}
|
|
450
290
|
}
|
|
451
|
-
} else if (
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
let t = -1;
|
|
456
|
-
for (; -1 !== (t = r.data.indexOf(h, t + 1));) d.push({
|
|
457
|
-
type: 7,
|
|
458
|
-
index: c
|
|
459
|
-
}), t += h.length - 1;
|
|
291
|
+
} else if (s.nodeType === 8) if (s.data === ut) h.push({ type: 2, index: n });
|
|
292
|
+
else {
|
|
293
|
+
let a = -1;
|
|
294
|
+
for (; (a = s.data.indexOf(y, a + 1)) !== -1; ) h.push({ type: 7, index: n }), a += y.length - 1;
|
|
460
295
|
}
|
|
461
|
-
|
|
296
|
+
n++;
|
|
462
297
|
}
|
|
463
298
|
}
|
|
464
|
-
static createElement(t,
|
|
465
|
-
const
|
|
466
|
-
return
|
|
299
|
+
static createElement(t, e) {
|
|
300
|
+
const i = w.createElement("template");
|
|
301
|
+
return i.innerHTML = t, i;
|
|
467
302
|
}
|
|
468
303
|
}
|
|
469
|
-
function
|
|
470
|
-
if (
|
|
471
|
-
let
|
|
472
|
-
const
|
|
473
|
-
return
|
|
304
|
+
function E(r, t, e = r, i) {
|
|
305
|
+
if (t === x) return t;
|
|
306
|
+
let s = i !== void 0 ? e._$Co?.[i] : e._$Cl;
|
|
307
|
+
const n = M(t) ? void 0 : t._$litDirective$;
|
|
308
|
+
return s?.constructor !== n && (s?._$AO?.(!1), n === void 0 ? s = void 0 : (s = new n(r), s._$AT(r, e, i)), i !== void 0 ? (e._$Co ??= [])[i] = s : e._$Cl = s), s !== void 0 && (t = E(r, s._$AS(r, t.values), s, i)), t;
|
|
474
309
|
}
|
|
475
|
-
class
|
|
476
|
-
constructor(t,
|
|
477
|
-
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM =
|
|
310
|
+
let Tt = class {
|
|
311
|
+
constructor(t, e) {
|
|
312
|
+
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
478
313
|
}
|
|
479
314
|
get parentNode() {
|
|
480
315
|
return this._$AM.parentNode;
|
|
@@ -483,43 +318,34 @@ class M {
|
|
|
483
318
|
return this._$AM._$AU;
|
|
484
319
|
}
|
|
485
320
|
u(t) {
|
|
486
|
-
const {
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
C.currentNode = e;
|
|
494
|
-
let h = C.nextNode(),
|
|
495
|
-
o = 0,
|
|
496
|
-
n = 0,
|
|
497
|
-
l = s[0];
|
|
498
|
-
for (; void 0 !== l;) {
|
|
499
|
-
if (o === l.index) {
|
|
500
|
-
let i;
|
|
501
|
-
2 === l.type ? i = new R(h, h.nextSibling, this, t) : 1 === l.type ? i = new l.ctor(h, l.name, l.strings, this, t) : 6 === l.type && (i = new z(h, this, t)), this._$AV.push(i), l = s[++n];
|
|
321
|
+
const { el: { content: e }, parts: i } = this._$AD, s = (t?.creationScope ?? w).importNode(e, !0);
|
|
322
|
+
b.currentNode = s;
|
|
323
|
+
let n = b.nextNode(), o = 0, l = 0, h = i[0];
|
|
324
|
+
for (; h !== void 0; ) {
|
|
325
|
+
if (o === h.index) {
|
|
326
|
+
let p;
|
|
327
|
+
h.type === 2 ? p = new C(n, n.nextSibling, this, t) : h.type === 1 ? p = new h.ctor(n, h.name, h.strings, this, t) : h.type === 6 && (p = new Rt(n, this, t)), this._$AV.push(p), h = i[++l];
|
|
502
328
|
}
|
|
503
|
-
o !==
|
|
329
|
+
o !== h?.index && (n = b.nextNode(), o++);
|
|
504
330
|
}
|
|
505
|
-
return
|
|
331
|
+
return b.currentNode = w, s;
|
|
506
332
|
}
|
|
507
333
|
p(t) {
|
|
508
|
-
let
|
|
509
|
-
for (const
|
|
334
|
+
let e = 0;
|
|
335
|
+
for (const i of this._$AV) i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
|
|
510
336
|
}
|
|
511
|
-
}
|
|
512
|
-
class
|
|
337
|
+
};
|
|
338
|
+
class C {
|
|
513
339
|
get _$AU() {
|
|
514
340
|
return this._$AM?._$AU ?? this._$Cv;
|
|
515
341
|
}
|
|
516
|
-
constructor(t, i, s
|
|
517
|
-
this.type = 2, this._$AH =
|
|
342
|
+
constructor(t, e, i, s) {
|
|
343
|
+
this.type = 2, this._$AH = $, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = s, this._$Cv = s?.isConnected ?? !0;
|
|
518
344
|
}
|
|
519
345
|
get parentNode() {
|
|
520
346
|
let t = this._$AA.parentNode;
|
|
521
|
-
const
|
|
522
|
-
return void 0
|
|
347
|
+
const e = this._$AM;
|
|
348
|
+
return e !== void 0 && t?.nodeType === 11 && (t = e.parentNode), t;
|
|
523
349
|
}
|
|
524
350
|
get startNode() {
|
|
525
351
|
return this._$AA;
|
|
@@ -527,8 +353,8 @@ class R {
|
|
|
527
353
|
get endNode() {
|
|
528
354
|
return this._$AB;
|
|
529
355
|
}
|
|
530
|
-
_$AI(t,
|
|
531
|
-
t =
|
|
356
|
+
_$AI(t, e = this) {
|
|
357
|
+
t = E(this, t, e), M(t) ? t === $ || t == null || t === "" ? (this._$AH !== $ && this._$AR(), this._$AH = $) : t !== this._$AH && t !== x && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Pt(t) ? this.k(t) : this._(t);
|
|
532
358
|
}
|
|
533
359
|
O(t) {
|
|
534
360
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -537,139 +363,125 @@ class R {
|
|
|
537
363
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
538
364
|
}
|
|
539
365
|
_(t) {
|
|
540
|
-
this._$AH !==
|
|
366
|
+
this._$AH !== $ && M(this._$AH) ? this._$AA.nextSibling.data = t : this.T(w.createTextNode(t)), this._$AH = t;
|
|
541
367
|
}
|
|
542
368
|
$(t) {
|
|
543
|
-
const {
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
if (this._$AH?._$AD === e) this._$AH.p(i);else {
|
|
549
|
-
const t = new M(e, this),
|
|
550
|
-
s = t.u(this.options);
|
|
551
|
-
t.p(i), this.T(s), this._$AH = t;
|
|
369
|
+
const { values: e, _$litType$: i } = t, s = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = R.createElement(ft(i.h, i.h[0]), this.options)), i);
|
|
370
|
+
if (this._$AH?._$AD === s) this._$AH.p(e);
|
|
371
|
+
else {
|
|
372
|
+
const n = new Tt(s, this), o = n.u(this.options);
|
|
373
|
+
n.p(e), this.T(o), this._$AH = n;
|
|
552
374
|
}
|
|
553
375
|
}
|
|
554
376
|
_$AC(t) {
|
|
555
|
-
let
|
|
556
|
-
return void 0
|
|
377
|
+
let e = at.get(t.strings);
|
|
378
|
+
return e === void 0 && at.set(t.strings, e = new R(t)), e;
|
|
557
379
|
}
|
|
558
380
|
k(t) {
|
|
559
|
-
|
|
560
|
-
const
|
|
561
|
-
let s
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
for (this._$AP?.(!1, !0, i); t && t !== this._$AB;) {
|
|
381
|
+
J(this._$AH) || (this._$AH = [], this._$AR());
|
|
382
|
+
const e = this._$AH;
|
|
383
|
+
let i, s = 0;
|
|
384
|
+
for (const n of t) s === e.length ? e.push(i = new C(this.O(D()), this.O(D()), this, this.options)) : i = e[s], i._$AI(n), s++;
|
|
385
|
+
s < e.length && (this._$AR(i && i._$AB.nextSibling, s), e.length = s);
|
|
386
|
+
}
|
|
387
|
+
_$AR(t = this._$AA.nextSibling, e) {
|
|
388
|
+
for (this._$AP?.(!1, !0, e); t && t !== this._$AB; ) {
|
|
568
389
|
const i = t.nextSibling;
|
|
569
390
|
t.remove(), t = i;
|
|
570
391
|
}
|
|
571
392
|
}
|
|
572
393
|
setConnected(t) {
|
|
573
|
-
|
|
394
|
+
this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
|
|
574
395
|
}
|
|
575
396
|
}
|
|
576
|
-
class
|
|
397
|
+
class L {
|
|
577
398
|
get tagName() {
|
|
578
399
|
return this.element.tagName;
|
|
579
400
|
}
|
|
580
401
|
get _$AU() {
|
|
581
402
|
return this._$AM._$AU;
|
|
582
403
|
}
|
|
583
|
-
constructor(t, i, s,
|
|
584
|
-
this.type = 1, this._$AH =
|
|
404
|
+
constructor(t, e, i, s, n) {
|
|
405
|
+
this.type = 1, this._$AH = $, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = n, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = $;
|
|
585
406
|
}
|
|
586
|
-
_$AI(t,
|
|
587
|
-
const
|
|
407
|
+
_$AI(t, e = this, i, s) {
|
|
408
|
+
const n = this.strings;
|
|
588
409
|
let o = !1;
|
|
589
|
-
if (void 0
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
410
|
+
if (n === void 0) t = E(this, t, e, 0), o = !M(t) || t !== this._$AH && t !== x, o && (this._$AH = t);
|
|
411
|
+
else {
|
|
412
|
+
const l = t;
|
|
413
|
+
let h, p;
|
|
414
|
+
for (t = n[0], h = 0; h < n.length - 1; h++) p = E(this, l[i + h], e, h), p === x && (p = this._$AH[h]), o ||= !M(p) || p !== this._$AH[h], p === $ ? t = $ : t !== $ && (t += (p ?? "") + n[h + 1]), this._$AH[h] = p;
|
|
593
415
|
}
|
|
594
|
-
o && !
|
|
416
|
+
o && !s && this.j(t);
|
|
595
417
|
}
|
|
596
418
|
j(t) {
|
|
597
|
-
t ===
|
|
419
|
+
t === $ ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
598
420
|
}
|
|
599
421
|
}
|
|
600
|
-
class
|
|
422
|
+
class Ht extends L {
|
|
601
423
|
constructor() {
|
|
602
424
|
super(...arguments), this.type = 3;
|
|
603
425
|
}
|
|
604
426
|
j(t) {
|
|
605
|
-
this.element[this.name] = t ===
|
|
427
|
+
this.element[this.name] = t === $ ? void 0 : t;
|
|
606
428
|
}
|
|
607
429
|
}
|
|
608
|
-
class
|
|
430
|
+
class Dt extends L {
|
|
609
431
|
constructor() {
|
|
610
432
|
super(...arguments), this.type = 4;
|
|
611
433
|
}
|
|
612
434
|
j(t) {
|
|
613
|
-
this.element.toggleAttribute(this.name, !!t && t !==
|
|
435
|
+
this.element.toggleAttribute(this.name, !!t && t !== $);
|
|
614
436
|
}
|
|
615
437
|
}
|
|
616
|
-
class
|
|
617
|
-
constructor(t, i, s,
|
|
618
|
-
super(t, i, s,
|
|
438
|
+
class Mt extends L {
|
|
439
|
+
constructor(t, e, i, s, n) {
|
|
440
|
+
super(t, e, i, s, n), this.type = 5;
|
|
619
441
|
}
|
|
620
|
-
_$AI(t,
|
|
621
|
-
if ((t =
|
|
622
|
-
const
|
|
623
|
-
|
|
624
|
-
h = t !== E && (s === E || e);
|
|
625
|
-
e && this.element.removeEventListener(this.name, this, s), h && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
442
|
+
_$AI(t, e = this) {
|
|
443
|
+
if ((t = E(this, t, e, 0) ?? $) === x) return;
|
|
444
|
+
const i = this._$AH, s = t === $ && i !== $ || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, n = t !== $ && (i === $ || s);
|
|
445
|
+
s && this.element.removeEventListener(this.name, this, i), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
626
446
|
}
|
|
627
447
|
handleEvent(t) {
|
|
628
|
-
|
|
448
|
+
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
|
|
629
449
|
}
|
|
630
450
|
}
|
|
631
|
-
class
|
|
632
|
-
constructor(t,
|
|
633
|
-
this.element = t, this.type = 6, this._$AN = void 0, this._$AM =
|
|
451
|
+
class Rt {
|
|
452
|
+
constructor(t, e, i) {
|
|
453
|
+
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i;
|
|
634
454
|
}
|
|
635
455
|
get _$AU() {
|
|
636
456
|
return this._$AM._$AU;
|
|
637
457
|
}
|
|
638
458
|
_$AI(t) {
|
|
639
|
-
|
|
459
|
+
E(this, t);
|
|
640
460
|
}
|
|
641
461
|
}
|
|
642
|
-
const
|
|
643
|
-
|
|
644
|
-
const
|
|
645
|
-
const
|
|
646
|
-
let
|
|
647
|
-
if (void 0
|
|
648
|
-
const
|
|
649
|
-
|
|
650
|
-
}
|
|
651
|
-
return
|
|
462
|
+
const Nt = { I: C }, zt = F.litHtmlPolyfillSupport;
|
|
463
|
+
zt?.(R, C), (F.litHtmlVersions ??= []).push("3.3.0");
|
|
464
|
+
const jt = (r, t, e) => {
|
|
465
|
+
const i = e?.renderBefore ?? t;
|
|
466
|
+
let s = i._$litPart$;
|
|
467
|
+
if (s === void 0) {
|
|
468
|
+
const n = e?.renderBefore ?? null;
|
|
469
|
+
i._$litPart$ = s = new C(t.insertBefore(D(), n), n, void 0, e ?? {});
|
|
470
|
+
}
|
|
471
|
+
return s._$AI(r), s;
|
|
652
472
|
};
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
* @license
|
|
656
|
-
* Copyright 2017 Google LLC
|
|
657
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
658
|
-
*/
|
|
659
|
-
const s = globalThis;
|
|
660
|
-
class i extends y$1 {
|
|
473
|
+
const K = globalThis;
|
|
474
|
+
let H = class extends S {
|
|
661
475
|
constructor() {
|
|
662
|
-
super(...arguments), this.renderOptions = {
|
|
663
|
-
host: this
|
|
664
|
-
}, this._$Do = void 0;
|
|
476
|
+
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
665
477
|
}
|
|
666
478
|
createRenderRoot() {
|
|
667
479
|
const t = super.createRenderRoot();
|
|
668
480
|
return this.renderOptions.renderBefore ??= t.firstChild, t;
|
|
669
481
|
}
|
|
670
482
|
update(t) {
|
|
671
|
-
const
|
|
672
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do =
|
|
483
|
+
const e = this.render();
|
|
484
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = jt(e, this.renderRoot, this.renderOptions);
|
|
673
485
|
}
|
|
674
486
|
connectedCallback() {
|
|
675
487
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -678,148 +490,287 @@ class i extends y$1 {
|
|
|
678
490
|
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
679
491
|
}
|
|
680
492
|
render() {
|
|
681
|
-
return
|
|
493
|
+
return x;
|
|
494
|
+
}
|
|
495
|
+
};
|
|
496
|
+
H._$litElement$ = !0, H.finalized = !0, K.litElementHydrateSupport?.({ LitElement: H });
|
|
497
|
+
const It = K.litElementPolyfillSupport;
|
|
498
|
+
It?.({ LitElement: H });
|
|
499
|
+
(K.litElementVersions ??= []).push("4.2.0");
|
|
500
|
+
const kt = { CHILD: 2 }, Lt = (r) => (...t) => ({ _$litDirective$: r, values: t });
|
|
501
|
+
class Bt {
|
|
502
|
+
constructor(t) {
|
|
503
|
+
}
|
|
504
|
+
get _$AU() {
|
|
505
|
+
return this._$AM._$AU;
|
|
506
|
+
}
|
|
507
|
+
_$AT(t, e, i) {
|
|
508
|
+
this._$Ct = t, this._$AM = e, this._$Ci = i;
|
|
509
|
+
}
|
|
510
|
+
_$AS(t, e) {
|
|
511
|
+
return this.update(t, e);
|
|
512
|
+
}
|
|
513
|
+
update(t, e) {
|
|
514
|
+
return this.render(...e);
|
|
682
515
|
}
|
|
683
516
|
}
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
const o
|
|
688
|
-
o
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
const
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
517
|
+
const { I: Wt } = Nt, lt = () => document.createComment(""), O = (r, t, e) => {
|
|
518
|
+
const i = r._$AA.parentNode, s = t === void 0 ? r._$AB : t._$AA;
|
|
519
|
+
if (e === void 0) {
|
|
520
|
+
const n = i.insertBefore(lt(), s), o = i.insertBefore(lt(), s);
|
|
521
|
+
e = new Wt(n, o, r, r.options);
|
|
522
|
+
} else {
|
|
523
|
+
const n = e._$AB.nextSibling, o = e._$AM, l = o !== r;
|
|
524
|
+
if (l) {
|
|
525
|
+
let h;
|
|
526
|
+
e._$AQ?.(r), e._$AM = r, e._$AP !== void 0 && (h = r._$AU) !== o._$AU && e._$AP(h);
|
|
527
|
+
}
|
|
528
|
+
if (n !== s || l) {
|
|
529
|
+
let h = e._$AA;
|
|
530
|
+
for (; h !== n; ) {
|
|
531
|
+
const p = h.nextSibling;
|
|
532
|
+
i.insertBefore(h, s), h = p;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
return e;
|
|
537
|
+
}, v = (r, t, e = r) => (r._$AI(t, e), r), qt = {}, Vt = (r, t = qt) => r._$AH = t, Gt = (r) => r._$AH, q = (r) => {
|
|
538
|
+
r._$AP?.(!1, !0);
|
|
539
|
+
let t = r._$AA;
|
|
540
|
+
const e = r._$AB.nextSibling;
|
|
541
|
+
for (; t !== e; ) {
|
|
542
|
+
const i = t.nextSibling;
|
|
543
|
+
t.remove(), t = i;
|
|
544
|
+
}
|
|
702
545
|
};
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
546
|
+
const ct = (r, t, e) => {
|
|
547
|
+
const i = /* @__PURE__ */ new Map();
|
|
548
|
+
for (let s = t; s <= e; s++) i.set(r[s], s);
|
|
549
|
+
return i;
|
|
550
|
+
}, Zt = Lt(class extends Bt {
|
|
551
|
+
constructor(r) {
|
|
552
|
+
if (super(r), r.type !== kt.CHILD) throw Error("repeat() can only be used in text expressions");
|
|
553
|
+
}
|
|
554
|
+
dt(r, t, e) {
|
|
555
|
+
let i;
|
|
556
|
+
e === void 0 ? e = t : t !== void 0 && (i = t);
|
|
557
|
+
const s = [], n = [];
|
|
558
|
+
let o = 0;
|
|
559
|
+
for (const l of r) s[o] = i ? i(l, o) : o, n[o] = e(l, o), o++;
|
|
560
|
+
return { values: n, keys: s };
|
|
561
|
+
}
|
|
562
|
+
render(r, t, e) {
|
|
563
|
+
return this.dt(r, t, e).values;
|
|
564
|
+
}
|
|
565
|
+
update(r, [t, e, i]) {
|
|
566
|
+
const s = Gt(r), { values: n, keys: o } = this.dt(t, e, i);
|
|
567
|
+
if (!Array.isArray(s)) return this.ut = o, n;
|
|
568
|
+
const l = this.ut ??= [], h = [];
|
|
569
|
+
let p, u, a = 0, d = s.length - 1, c = 0, f = n.length - 1;
|
|
570
|
+
for (; a <= d && c <= f; ) if (s[a] === null) a++;
|
|
571
|
+
else if (s[d] === null) d--;
|
|
572
|
+
else if (l[a] === o[c]) h[c] = v(s[a], n[c]), a++, c++;
|
|
573
|
+
else if (l[d] === o[f]) h[f] = v(s[d], n[f]), d--, f--;
|
|
574
|
+
else if (l[a] === o[f]) h[f] = v(s[a], n[f]), O(r, h[f + 1], s[a]), a++, f--;
|
|
575
|
+
else if (l[d] === o[c]) h[c] = v(s[d], n[c]), O(r, s[a], s[d]), d--, c++;
|
|
576
|
+
else if (p === void 0 && (p = ct(o, c, f), u = ct(l, a, d)), p.has(l[a])) if (p.has(l[d])) {
|
|
577
|
+
const m = u.get(o[c]), B = m !== void 0 ? s[m] : null;
|
|
578
|
+
if (B === null) {
|
|
579
|
+
const X = O(r, s[a]);
|
|
580
|
+
v(X, n[c]), h[c] = X;
|
|
581
|
+
} else h[c] = v(B, n[c]), O(r, s[a], B), s[m] = null;
|
|
582
|
+
c++;
|
|
583
|
+
} else q(s[d]), d--;
|
|
584
|
+
else q(s[a]), a++;
|
|
585
|
+
for (; c <= f; ) {
|
|
586
|
+
const m = O(r, h[f + 1]);
|
|
587
|
+
v(m, n[c]), h[c++] = m;
|
|
735
588
|
}
|
|
736
|
-
|
|
737
|
-
const
|
|
738
|
-
|
|
739
|
-
} = r;
|
|
740
|
-
return function (r) {
|
|
741
|
-
const n = this[o];
|
|
742
|
-
e.call(this, r), this.requestUpdate(o, n, t);
|
|
743
|
-
};
|
|
589
|
+
for (; a <= d; ) {
|
|
590
|
+
const m = s[a++];
|
|
591
|
+
m !== null && q(m);
|
|
744
592
|
}
|
|
745
|
-
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
593
|
+
return this.ut = o, Vt(r, h), x;
|
|
594
|
+
}
|
|
595
|
+
});
|
|
596
|
+
const Ft = (r) => r ?? $;
|
|
597
|
+
const Jt = (r) => (t, e) => {
|
|
598
|
+
e !== void 0 ? e.addInitializer((() => {
|
|
599
|
+
customElements.define(r, t);
|
|
600
|
+
})) : customElements.define(r, t);
|
|
601
|
+
};
|
|
602
|
+
const Kt = { attribute: !0, type: String, converter: j, reflect: !1, hasChanged: Z }, Qt = (r = Kt, t, e) => {
|
|
603
|
+
const { kind: i, metadata: s } = e;
|
|
604
|
+
let n = globalThis.litPropertyMetadata.get(s);
|
|
605
|
+
if (n === void 0 && globalThis.litPropertyMetadata.set(s, n = /* @__PURE__ */ new Map()), i === "setter" && ((r = Object.create(r)).wrapped = !0), n.set(e.name, r), i === "accessor") {
|
|
606
|
+
const { name: o } = e;
|
|
607
|
+
return { set(l) {
|
|
608
|
+
const h = t.get.call(this);
|
|
609
|
+
t.set.call(this, l), this.requestUpdate(o, h, r);
|
|
610
|
+
}, init(l) {
|
|
611
|
+
return l !== void 0 && this.C(o, void 0, r, l), l;
|
|
612
|
+
} };
|
|
613
|
+
}
|
|
614
|
+
if (i === "setter") {
|
|
615
|
+
const { name: o } = e;
|
|
616
|
+
return function(l) {
|
|
617
|
+
const h = this[o];
|
|
618
|
+
t.call(this, l), this.requestUpdate(o, h, r);
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
throw Error("Unsupported decorator location: " + i);
|
|
622
|
+
};
|
|
623
|
+
function Q(r) {
|
|
624
|
+
return (t, e) => typeof e == "object" ? Qt(r, t, e) : ((i, s, n) => {
|
|
625
|
+
const o = s.hasOwnProperty(n);
|
|
626
|
+
return s.constructor.createProperty(n, i), o ? Object.getOwnPropertyDescriptor(s, n) : void 0;
|
|
627
|
+
})(r, t, e);
|
|
752
628
|
}
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
* @license
|
|
756
|
-
* Copyright 2017 Google LLC
|
|
757
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
758
|
-
*/
|
|
759
|
-
function r(r) {
|
|
760
|
-
return n({
|
|
761
|
-
...r,
|
|
762
|
-
state: !0,
|
|
763
|
-
attribute: !1
|
|
764
|
-
});
|
|
629
|
+
function N(r) {
|
|
630
|
+
return Q({ ...r, state: !0, attribute: !1 });
|
|
765
631
|
}
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
632
|
+
const Xt = (r, t, e) => (e.configurable = !0, e.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(r, t, e), e);
|
|
633
|
+
function Yt(r, t) {
|
|
634
|
+
return (e, i, s) => {
|
|
635
|
+
const n = (o) => o.renderRoot?.querySelector(r) ?? null;
|
|
636
|
+
return Xt(e, i, { get() {
|
|
637
|
+
return n(this);
|
|
638
|
+
} });
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
var te = Object.defineProperty, ee = Object.getOwnPropertyDescriptor, _ = (r, t, e, i) => {
|
|
642
|
+
for (var s = i > 1 ? void 0 : i ? ee(t, e) : t, n = r.length - 1, o; n >= 0; n--)
|
|
643
|
+
(o = r[n]) && (s = (i ? o(t, e, s) : o(s)) || s);
|
|
644
|
+
return i && s && te(t, e, s), s;
|
|
645
|
+
};
|
|
646
|
+
let g = class extends H {
|
|
647
|
+
constructor() {
|
|
648
|
+
super(...arguments), this.elementWidth = 0, this.elementHeight = 0, this.version = "1.1.14";
|
|
649
|
+
}
|
|
650
|
+
disconnectedCallback() {
|
|
651
|
+
super.disconnectedCallback(), this.resizeObserver && this.resizeObserver.disconnect();
|
|
652
|
+
}
|
|
653
|
+
update(r) {
|
|
654
|
+
r.has("inputData") && this.updateGridLayout(), r.has("theme") && this.registerTheme(this.theme), super.update(r);
|
|
655
|
+
}
|
|
656
|
+
firstUpdated(r) {
|
|
657
|
+
this.registerTheme(this.theme), this.wrapper && (this.resizeObserver = new ResizeObserver(() => {
|
|
658
|
+
this.updateGridLayout();
|
|
659
|
+
}), this.resizeObserver.observe(this.wrapper), this.updateGridLayout());
|
|
660
|
+
}
|
|
661
|
+
registerTheme(r) {
|
|
662
|
+
const t = getComputedStyle(this).getPropertyValue("--re-text-color").trim(), e = getComputedStyle(this).getPropertyValue("--re-tile-background-color").trim();
|
|
663
|
+
this.themeBgColor = e || this.theme?.theme_object?.backgroundColor, this.themeTitleColor = t || this.theme?.theme_object?.title?.textStyle?.color, this.themeSubtitleColor = t || this.theme?.theme_object?.title?.subtextStyle?.color || this.themeTitleColor;
|
|
664
|
+
}
|
|
665
|
+
/**
|
|
666
|
+
* Update grid layout based on container size and number of elements
|
|
667
|
+
*/
|
|
668
|
+
updateGridLayout() {
|
|
669
|
+
if (!this.wrapper) return;
|
|
670
|
+
const r = this.inputData?.useUpload ? typeof this.inputData?.image == "string" ? this.inputData.image : "" : this.inputData?.imageUrl ?? "", e = (this.inputData?.multiImage ? this.inputData?.data ?? [] : [{ imageUrl: r, title: this.inputData?.title ?? "" }]).length;
|
|
671
|
+
if (e === 0) return;
|
|
672
|
+
const i = this.wrapper.getBoundingClientRect(), s = i.width * 0.04, n = i.height * 0.04, o = i.width - s, l = i.height - n;
|
|
673
|
+
if (o <= 0 || l <= 0) return;
|
|
674
|
+
const h = this.optimizeLayout(
|
|
675
|
+
o,
|
|
676
|
+
l,
|
|
677
|
+
e,
|
|
678
|
+
(u, a) => Math.abs(u / a - 1 / 1),
|
|
679
|
+
this.inputData?.gap ?? 12
|
|
680
|
+
);
|
|
681
|
+
this.elementWidth = h.elementWidth, this.elementHeight = h.elementHeight, this.wrapper.querySelectorAll(".image-item").forEach((u) => {
|
|
682
|
+
u.style.width = `${h.elementWidth}px`, u.style.height = `${h.elementHeight}px`;
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* Optimize grid layout by minimizing an error function
|
|
687
|
+
* @param containerWidth - Available width for the grid
|
|
688
|
+
* @param containerHeight - Available height for the grid
|
|
689
|
+
* @param numElements - Number of elements to arrange
|
|
690
|
+
* @param errorFn - Error function that takes (element_width, element_height) and returns error value
|
|
691
|
+
* @param gap - Gap between elements (default: 12)
|
|
692
|
+
* @returns Optimal layout configuration
|
|
693
|
+
*/
|
|
694
|
+
optimizeLayout(r, t, e, i, s = 12) {
|
|
695
|
+
let n = {
|
|
696
|
+
elementWidth: 0,
|
|
697
|
+
elementHeight: 0,
|
|
698
|
+
numCols: 1,
|
|
699
|
+
numRows: e,
|
|
700
|
+
error: 1 / 0
|
|
701
|
+
};
|
|
702
|
+
for (let o = 1; o <= e; o++) {
|
|
703
|
+
const l = Math.ceil(e / o), h = s * (o - 1), p = s * (l - 1), u = r - h, a = t - p;
|
|
704
|
+
if (u <= 0 || a <= 0) continue;
|
|
705
|
+
const d = u / o, c = a / l, f = i(d, c);
|
|
706
|
+
f < n.error && (n = {
|
|
707
|
+
elementWidth: d,
|
|
708
|
+
elementHeight: c,
|
|
709
|
+
numCols: o,
|
|
710
|
+
numRows: l,
|
|
711
|
+
error: f
|
|
712
|
+
});
|
|
789
713
|
}
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
714
|
+
return n;
|
|
715
|
+
}
|
|
716
|
+
render() {
|
|
717
|
+
const r = this.inputData?.useUpload ? typeof this.inputData?.image == "string" ? this.inputData.image : "" : this.inputData?.imageUrl ?? "", t = this.inputData?.multiImage ? this.inputData?.data ?? [] : [{ imageUrl: r, title: this.inputData?.title ?? "" }], e = t.length > 1, i = t.filter((n) => n.title).length > 0, s = t.some((n) => n.imageUrl);
|
|
718
|
+
return U`
|
|
719
|
+
<div
|
|
720
|
+
class="wrapper"
|
|
721
|
+
style="background-color: ${this.themeBgColor}; color: ${this.themeTitleColor}; gap: ${e ? `${this.inputData?.gap ?? 12}px` : "0px"}; ${e ? "" : "flex-direction: column;"}"
|
|
722
|
+
>
|
|
723
|
+
${!e && this.inputData?.title ? U`
|
|
724
|
+
<h3
|
|
725
|
+
class="paging"
|
|
726
|
+
?active=${this.inputData?.title}
|
|
727
|
+
style="color: ${this.themeTitleColor};"
|
|
728
|
+
>
|
|
729
|
+
${this.inputData?.title}
|
|
730
|
+
</h3>
|
|
731
|
+
` : $}
|
|
732
|
+
${!e && this.inputData?.subTitle ? U`
|
|
733
|
+
<p
|
|
734
|
+
class="paging"
|
|
735
|
+
?active=${this.inputData?.subTitle}
|
|
736
|
+
style="color: ${this.themeSubtitleColor};"
|
|
737
|
+
>
|
|
738
|
+
${this.inputData?.subTitle}
|
|
739
|
+
</p>
|
|
740
|
+
` : $}
|
|
741
|
+
<div class="paging no-data" ?active=${!s} style="color: ${this.themeTitleColor};">
|
|
808
742
|
No Image
|
|
809
743
|
</div>
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
744
|
+
${Zt(
|
|
745
|
+
t,
|
|
746
|
+
(n) => n.imageUrl,
|
|
747
|
+
(n) => U`
|
|
748
|
+
<div
|
|
749
|
+
class="image-item"
|
|
750
|
+
style="width: ${this.elementWidth}px; height: ${this.elementHeight}px;"
|
|
751
|
+
>
|
|
752
|
+
${i ? U`<h2 class="title">${n.title ?? ""}</h2>` : $}
|
|
753
|
+
<div class="img-container paging" ?active="${n.imageUrl}">
|
|
754
|
+
<img
|
|
755
|
+
src="${Ft(n.imageUrl)}"
|
|
756
|
+
alt="${n.title || "Image Widget"}"
|
|
757
|
+
style="object-fit: ${this.inputData?.stretchToFit ? "fill" : "contain"}"
|
|
758
|
+
/>
|
|
759
|
+
</div>
|
|
760
|
+
</div>
|
|
761
|
+
`
|
|
762
|
+
)}
|
|
813
763
|
</div>
|
|
814
764
|
`;
|
|
815
|
-
|
|
765
|
+
}
|
|
816
766
|
};
|
|
817
|
-
|
|
767
|
+
g.styles = mt`
|
|
818
768
|
:host {
|
|
819
769
|
display: block;
|
|
820
770
|
font-family: sans-serif;
|
|
821
771
|
box-sizing: border-box;
|
|
822
772
|
margin: auto;
|
|
773
|
+
container-type: size;
|
|
823
774
|
}
|
|
824
775
|
|
|
825
776
|
.paging:not([active]) {
|
|
@@ -828,11 +779,40 @@ WidgetImage.styles = i$3 `
|
|
|
828
779
|
|
|
829
780
|
.wrapper {
|
|
830
781
|
display: flex;
|
|
831
|
-
flex-
|
|
782
|
+
flex-wrap: wrap;
|
|
832
783
|
height: 100%;
|
|
833
784
|
width: 100%;
|
|
834
|
-
padding:
|
|
785
|
+
padding: 2cqh 2cqw;
|
|
786
|
+
box-sizing: border-box;
|
|
787
|
+
gap: 12px;
|
|
788
|
+
align-content: flex-start;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
.wrapper > * {
|
|
792
|
+
flex-shrink: 1;
|
|
793
|
+
min-width: 0;
|
|
794
|
+
min-height: 0;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
.image-item {
|
|
798
|
+
display: flex;
|
|
799
|
+
flex-direction: column;
|
|
835
800
|
box-sizing: border-box;
|
|
801
|
+
max-width: 100%;
|
|
802
|
+
max-height: 100%;
|
|
803
|
+
overflow: hidden;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
.title {
|
|
807
|
+
height: 24px;
|
|
808
|
+
font-size: 18px;
|
|
809
|
+
margin: 0;
|
|
810
|
+
padding: 0 4px;
|
|
811
|
+
overflow: hidden;
|
|
812
|
+
text-overflow: ellipsis;
|
|
813
|
+
text-align: center;
|
|
814
|
+
flex: 0 0 auto;
|
|
815
|
+
white-space: nowrap;
|
|
836
816
|
}
|
|
837
817
|
|
|
838
818
|
h3 {
|
|
@@ -856,10 +836,12 @@ WidgetImage.styles = i$3 `
|
|
|
856
836
|
flex: 1;
|
|
857
837
|
box-sizing: border-box;
|
|
858
838
|
overflow: hidden;
|
|
839
|
+
min-width: 0;
|
|
840
|
+
min-height: 0;
|
|
859
841
|
}
|
|
860
842
|
|
|
861
843
|
img {
|
|
862
|
-
width: 100%;
|
|
844
|
+
width: 100%;
|
|
863
845
|
height: 100%;
|
|
864
846
|
object-fit: contain;
|
|
865
847
|
}
|
|
@@ -873,24 +855,34 @@ WidgetImage.styles = i$3 `
|
|
|
873
855
|
justify-content: center;
|
|
874
856
|
}
|
|
875
857
|
`;
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
],
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
],
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
],
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
],
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
],
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
],
|
|
894
|
-
|
|
895
|
-
|
|
858
|
+
_([
|
|
859
|
+
Q({ type: Object })
|
|
860
|
+
], g.prototype, "inputData", 2);
|
|
861
|
+
_([
|
|
862
|
+
Q({ type: Object })
|
|
863
|
+
], g.prototype, "theme", 2);
|
|
864
|
+
_([
|
|
865
|
+
N()
|
|
866
|
+
], g.prototype, "themeBgColor", 2);
|
|
867
|
+
_([
|
|
868
|
+
N()
|
|
869
|
+
], g.prototype, "themeTitleColor", 2);
|
|
870
|
+
_([
|
|
871
|
+
N()
|
|
872
|
+
], g.prototype, "themeSubtitleColor", 2);
|
|
873
|
+
_([
|
|
874
|
+
N()
|
|
875
|
+
], g.prototype, "elementWidth", 2);
|
|
876
|
+
_([
|
|
877
|
+
N()
|
|
878
|
+
], g.prototype, "elementHeight", 2);
|
|
879
|
+
_([
|
|
880
|
+
Yt(".wrapper")
|
|
881
|
+
], g.prototype, "wrapper", 2);
|
|
882
|
+
g = _([
|
|
883
|
+
Jt("widget-image-1.1.14")
|
|
884
|
+
], g);
|
|
885
|
+
export {
|
|
886
|
+
g as WidgetImage
|
|
887
|
+
};
|
|
896
888
|
//# sourceMappingURL=widget-image.js.map
|