@record-evolution/widget-form 1.0.33 → 1.0.34
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/dist/widget-form.d.ts +9 -0
- package/dist/widget-form.js +343 -331
- package/dist/widget-form.js.map +1 -1
- package/package.json +1 -1
- package/src/widget-form.ts +25 -11
package/dist/widget-form.js
CHANGED
|
@@ -10,16 +10,16 @@ import "@material/web/select/outlined-select.js";
|
|
|
10
10
|
import "@material/web/select/select-option.js";
|
|
11
11
|
const R = globalThis, W = R.ShadowRoot && (R.ShadyCSS === void 0 || R.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, K = /* @__PURE__ */ Symbol(), Y = /* @__PURE__ */ new WeakMap();
|
|
12
12
|
let me = class {
|
|
13
|
-
constructor(e,
|
|
13
|
+
constructor(e, r, i) {
|
|
14
14
|
if (this._$cssResult$ = !0, i !== K) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
15
|
-
this.cssText = e, this.t =
|
|
15
|
+
this.cssText = e, this.t = r;
|
|
16
16
|
}
|
|
17
17
|
get styleSheet() {
|
|
18
18
|
let e = this.o;
|
|
19
|
-
const
|
|
19
|
+
const r = this.t;
|
|
20
20
|
if (W && e === void 0) {
|
|
21
|
-
const i =
|
|
22
|
-
i && (e = Y.get(
|
|
21
|
+
const i = r !== void 0 && r.length === 1;
|
|
22
|
+
i && (e = Y.get(r)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), i && Y.set(r, e));
|
|
23
23
|
}
|
|
24
24
|
return e;
|
|
25
25
|
}
|
|
@@ -28,24 +28,24 @@ let me = class {
|
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
const Ae = (t) => new me(typeof t == "string" ? t : t + "", void 0, K), xe = (t, ...e) => {
|
|
31
|
-
const
|
|
31
|
+
const r = t.length === 1 ? t[0] : e.reduce(((i, s, o) => i + ((n) => {
|
|
32
32
|
if (n._$cssResult$ === !0) return n.cssText;
|
|
33
33
|
if (typeof n == "number") return n;
|
|
34
34
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + n + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
35
|
-
})(
|
|
36
|
-
return new me(
|
|
35
|
+
})(s) + t[o + 1]), t[0]);
|
|
36
|
+
return new me(r, t, K);
|
|
37
37
|
}, we = (t, e) => {
|
|
38
|
-
if (W) t.adoptedStyleSheets = e.map(((
|
|
39
|
-
else for (const
|
|
40
|
-
const i = document.createElement("style"),
|
|
41
|
-
|
|
38
|
+
if (W) t.adoptedStyleSheets = e.map(((r) => r instanceof CSSStyleSheet ? r : r.styleSheet));
|
|
39
|
+
else for (const r of e) {
|
|
40
|
+
const i = document.createElement("style"), s = R.litNonce;
|
|
41
|
+
s !== void 0 && i.setAttribute("nonce", s), i.textContent = r.cssText, t.appendChild(i);
|
|
42
42
|
}
|
|
43
43
|
}, ee = W ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((e) => {
|
|
44
|
-
let
|
|
45
|
-
for (const i of e.cssRules)
|
|
46
|
-
return Ae(
|
|
44
|
+
let r = "";
|
|
45
|
+
for (const i of e.cssRules) r += i.cssText;
|
|
46
|
+
return Ae(r);
|
|
47
47
|
})(t) : t;
|
|
48
|
-
const { is: Se, defineProperty: Ee, getOwnPropertyDescriptor: Ce, getOwnPropertyNames:
|
|
48
|
+
const { is: Se, defineProperty: Ee, getOwnPropertyDescriptor: Ce, getOwnPropertyNames: ke, getOwnPropertySymbols: De, getPrototypeOf: Pe } = Object, N = globalThis, te = N.trustedTypes, Ve = te ? te.emptyScript : "", Fe = N.reactiveElementPolyfillSupport, V = (t, e) => t, H = { toAttribute(t, e) {
|
|
49
49
|
switch (e) {
|
|
50
50
|
case Boolean:
|
|
51
51
|
t = t ? Ve : null;
|
|
@@ -56,24 +56,24 @@ const { is: Se, defineProperty: Ee, getOwnPropertyDescriptor: Ce, getOwnProperty
|
|
|
56
56
|
}
|
|
57
57
|
return t;
|
|
58
58
|
}, fromAttribute(t, e) {
|
|
59
|
-
let
|
|
59
|
+
let r = t;
|
|
60
60
|
switch (e) {
|
|
61
61
|
case Boolean:
|
|
62
|
-
|
|
62
|
+
r = t !== null;
|
|
63
63
|
break;
|
|
64
64
|
case Number:
|
|
65
|
-
|
|
65
|
+
r = t === null ? null : Number(t);
|
|
66
66
|
break;
|
|
67
67
|
case Object:
|
|
68
68
|
case Array:
|
|
69
69
|
try {
|
|
70
|
-
|
|
70
|
+
r = JSON.parse(t);
|
|
71
71
|
} catch {
|
|
72
|
-
|
|
72
|
+
r = null;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
return
|
|
76
|
-
} }, Z = (t, e) => !Se(t, e),
|
|
75
|
+
return r;
|
|
76
|
+
} }, Z = (t, e) => !Se(t, e), re = { attribute: !0, type: String, converter: H, reflect: !1, useDefault: !1, hasChanged: Z };
|
|
77
77
|
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), N.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
78
78
|
let E = class extends HTMLElement {
|
|
79
79
|
static addInitializer(e) {
|
|
@@ -82,25 +82,25 @@ let E = class extends HTMLElement {
|
|
|
82
82
|
static get observedAttributes() {
|
|
83
83
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
84
84
|
}
|
|
85
|
-
static createProperty(e,
|
|
86
|
-
if (
|
|
87
|
-
const i = /* @__PURE__ */ Symbol(),
|
|
88
|
-
|
|
85
|
+
static createProperty(e, r = re) {
|
|
86
|
+
if (r.state && (r.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((r = Object.create(r)).wrapped = !0), this.elementProperties.set(e, r), !r.noAccessor) {
|
|
87
|
+
const i = /* @__PURE__ */ Symbol(), s = this.getPropertyDescriptor(e, i, r);
|
|
88
|
+
s !== void 0 && Ee(this.prototype, e, s);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
static getPropertyDescriptor(e,
|
|
92
|
-
const { get:
|
|
93
|
-
return this[
|
|
91
|
+
static getPropertyDescriptor(e, r, i) {
|
|
92
|
+
const { get: s, set: o } = Ce(this.prototype, e) ?? { get() {
|
|
93
|
+
return this[r];
|
|
94
94
|
}, set(n) {
|
|
95
|
-
this[
|
|
95
|
+
this[r] = n;
|
|
96
96
|
} };
|
|
97
|
-
return { get:
|
|
98
|
-
const
|
|
99
|
-
o?.call(this, n), this.requestUpdate(e,
|
|
97
|
+
return { get: s, set(n) {
|
|
98
|
+
const h = s?.call(this);
|
|
99
|
+
o?.call(this, n), this.requestUpdate(e, h, i);
|
|
100
100
|
}, configurable: !0, enumerable: !0 };
|
|
101
101
|
}
|
|
102
102
|
static getPropertyOptions(e) {
|
|
103
|
-
return this.elementProperties.get(e) ??
|
|
103
|
+
return this.elementProperties.get(e) ?? re;
|
|
104
104
|
}
|
|
105
105
|
static _$Ei() {
|
|
106
106
|
if (this.hasOwnProperty(V("elementProperties"))) return;
|
|
@@ -110,31 +110,31 @@ let E = class extends HTMLElement {
|
|
|
110
110
|
static finalize() {
|
|
111
111
|
if (this.hasOwnProperty(V("finalized"))) return;
|
|
112
112
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(V("properties"))) {
|
|
113
|
-
const
|
|
114
|
-
for (const
|
|
113
|
+
const r = this.properties, i = [...ke(r), ...De(r)];
|
|
114
|
+
for (const s of i) this.createProperty(s, r[s]);
|
|
115
115
|
}
|
|
116
116
|
const e = this[Symbol.metadata];
|
|
117
117
|
if (e !== null) {
|
|
118
|
-
const
|
|
119
|
-
if (
|
|
118
|
+
const r = litPropertyMetadata.get(e);
|
|
119
|
+
if (r !== void 0) for (const [i, s] of r) this.elementProperties.set(i, s);
|
|
120
120
|
}
|
|
121
121
|
this._$Eh = /* @__PURE__ */ new Map();
|
|
122
|
-
for (const [
|
|
123
|
-
const
|
|
124
|
-
|
|
122
|
+
for (const [r, i] of this.elementProperties) {
|
|
123
|
+
const s = this._$Eu(r, i);
|
|
124
|
+
s !== void 0 && this._$Eh.set(s, r);
|
|
125
125
|
}
|
|
126
126
|
this.elementStyles = this.finalizeStyles(this.styles);
|
|
127
127
|
}
|
|
128
128
|
static finalizeStyles(e) {
|
|
129
|
-
const
|
|
129
|
+
const r = [];
|
|
130
130
|
if (Array.isArray(e)) {
|
|
131
131
|
const i = new Set(e.flat(1 / 0).reverse());
|
|
132
|
-
for (const
|
|
133
|
-
} else e !== void 0 &&
|
|
134
|
-
return
|
|
132
|
+
for (const s of i) r.unshift(ee(s));
|
|
133
|
+
} else e !== void 0 && r.push(ee(e));
|
|
134
|
+
return r;
|
|
135
135
|
}
|
|
136
|
-
static _$Eu(e,
|
|
137
|
-
const i =
|
|
136
|
+
static _$Eu(e, r) {
|
|
137
|
+
const i = r.attribute;
|
|
138
138
|
return i === !1 ? void 0 : typeof i == "string" ? i : typeof e == "string" ? e.toLowerCase() : void 0;
|
|
139
139
|
}
|
|
140
140
|
constructor() {
|
|
@@ -150,8 +150,8 @@ let E = class extends HTMLElement {
|
|
|
150
150
|
this._$EO?.delete(e);
|
|
151
151
|
}
|
|
152
152
|
_$E_() {
|
|
153
|
-
const e = /* @__PURE__ */ new Map(),
|
|
154
|
-
for (const i of
|
|
153
|
+
const e = /* @__PURE__ */ new Map(), r = this.constructor.elementProperties;
|
|
154
|
+
for (const i of r.keys()) this.hasOwnProperty(i) && (e.set(i, this[i]), delete this[i]);
|
|
155
155
|
e.size > 0 && (this._$Ep = e);
|
|
156
156
|
}
|
|
157
157
|
createRenderRoot() {
|
|
@@ -166,40 +166,40 @@ let E = class extends HTMLElement {
|
|
|
166
166
|
disconnectedCallback() {
|
|
167
167
|
this._$EO?.forEach(((e) => e.hostDisconnected?.()));
|
|
168
168
|
}
|
|
169
|
-
attributeChangedCallback(e,
|
|
169
|
+
attributeChangedCallback(e, r, i) {
|
|
170
170
|
this._$AK(e, i);
|
|
171
171
|
}
|
|
172
|
-
_$ET(e,
|
|
173
|
-
const i = this.constructor.elementProperties.get(e),
|
|
174
|
-
if (
|
|
175
|
-
const o = (i.converter?.toAttribute !== void 0 ? i.converter : H).toAttribute(
|
|
176
|
-
this._$Em = e, o == null ? this.removeAttribute(
|
|
172
|
+
_$ET(e, r) {
|
|
173
|
+
const i = this.constructor.elementProperties.get(e), s = this.constructor._$Eu(e, i);
|
|
174
|
+
if (s !== void 0 && i.reflect === !0) {
|
|
175
|
+
const o = (i.converter?.toAttribute !== void 0 ? i.converter : H).toAttribute(r, i.type);
|
|
176
|
+
this._$Em = e, o == null ? this.removeAttribute(s) : this.setAttribute(s, o), this._$Em = null;
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
-
_$AK(e,
|
|
180
|
-
const i = this.constructor,
|
|
181
|
-
if (
|
|
182
|
-
const o = i.getPropertyOptions(
|
|
183
|
-
this._$Em =
|
|
179
|
+
_$AK(e, r) {
|
|
180
|
+
const i = this.constructor, s = i._$Eh.get(e);
|
|
181
|
+
if (s !== void 0 && this._$Em !== s) {
|
|
182
|
+
const o = i.getPropertyOptions(s), n = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : H;
|
|
183
|
+
this._$Em = s, this[s] = n.fromAttribute(r, o.type) ?? this._$Ej?.get(s) ?? null, this._$Em = null;
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
|
-
requestUpdate(e,
|
|
186
|
+
requestUpdate(e, r, i) {
|
|
187
187
|
if (e !== void 0) {
|
|
188
|
-
const
|
|
189
|
-
if (i ??=
|
|
190
|
-
this.C(e,
|
|
188
|
+
const s = this.constructor, o = this[e];
|
|
189
|
+
if (i ??= s.getPropertyOptions(e), !((i.hasChanged ?? Z)(o, r) || i.useDefault && i.reflect && o === this._$Ej?.get(e) && !this.hasAttribute(s._$Eu(e, i)))) return;
|
|
190
|
+
this.C(e, r, i);
|
|
191
191
|
}
|
|
192
192
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
193
193
|
}
|
|
194
|
-
C(e,
|
|
195
|
-
i && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, n ??
|
|
194
|
+
C(e, r, { useDefault: i, reflect: s, wrapped: o }, n) {
|
|
195
|
+
i && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, n ?? r ?? this[e]), o !== !0 || n !== void 0) || (this._$AL.has(e) || (this.hasUpdated || i || (r = void 0), this._$AL.set(e, r)), s === !0 && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e));
|
|
196
196
|
}
|
|
197
197
|
async _$EP() {
|
|
198
198
|
this.isUpdatePending = !0;
|
|
199
199
|
try {
|
|
200
200
|
await this._$ES;
|
|
201
|
-
} catch (
|
|
202
|
-
Promise.reject(
|
|
201
|
+
} catch (r) {
|
|
202
|
+
Promise.reject(r);
|
|
203
203
|
}
|
|
204
204
|
const e = this.scheduleUpdate();
|
|
205
205
|
return e != null && await e, !this.isUpdatePending;
|
|
@@ -211,28 +211,28 @@ let E = class extends HTMLElement {
|
|
|
211
211
|
if (!this.isUpdatePending) return;
|
|
212
212
|
if (!this.hasUpdated) {
|
|
213
213
|
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
214
|
-
for (const [
|
|
214
|
+
for (const [s, o] of this._$Ep) this[s] = o;
|
|
215
215
|
this._$Ep = void 0;
|
|
216
216
|
}
|
|
217
217
|
const i = this.constructor.elementProperties;
|
|
218
|
-
if (i.size > 0) for (const [
|
|
219
|
-
const { wrapped: n } = o,
|
|
220
|
-
n !== !0 || this._$AL.has(
|
|
218
|
+
if (i.size > 0) for (const [s, o] of i) {
|
|
219
|
+
const { wrapped: n } = o, h = this[s];
|
|
220
|
+
n !== !0 || this._$AL.has(s) || h === void 0 || this.C(s, void 0, o, h);
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
let e = !1;
|
|
224
|
-
const
|
|
224
|
+
const r = this._$AL;
|
|
225
225
|
try {
|
|
226
|
-
e = this.shouldUpdate(
|
|
226
|
+
e = this.shouldUpdate(r), e ? (this.willUpdate(r), this._$EO?.forEach(((i) => i.hostUpdate?.())), this.update(r)) : this._$EM();
|
|
227
227
|
} catch (i) {
|
|
228
228
|
throw e = !1, this._$EM(), i;
|
|
229
229
|
}
|
|
230
|
-
e && this._$AE(
|
|
230
|
+
e && this._$AE(r);
|
|
231
231
|
}
|
|
232
232
|
willUpdate(e) {
|
|
233
233
|
}
|
|
234
234
|
_$AE(e) {
|
|
235
|
-
this._$EO?.forEach(((
|
|
235
|
+
this._$EO?.forEach(((r) => r.hostUpdated?.())), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
|
|
236
236
|
}
|
|
237
237
|
_$EM() {
|
|
238
238
|
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
@@ -247,7 +247,7 @@ let E = class extends HTMLElement {
|
|
|
247
247
|
return !0;
|
|
248
248
|
}
|
|
249
249
|
update(e) {
|
|
250
|
-
this._$Eq &&= this._$Eq.forEach(((
|
|
250
|
+
this._$Eq &&= this._$Eq.forEach(((r) => this._$ET(r, this[r]))), this._$EM();
|
|
251
251
|
}
|
|
252
252
|
updated(e) {
|
|
253
253
|
}
|
|
@@ -255,71 +255,71 @@ let E = class extends HTMLElement {
|
|
|
255
255
|
}
|
|
256
256
|
};
|
|
257
257
|
E.elementStyles = [], E.shadowRootOptions = { mode: "open" }, E[V("elementProperties")] = /* @__PURE__ */ new Map(), E[V("finalized")] = /* @__PURE__ */ new Map(), Fe?.({ ReactiveElement: E }), (N.reactiveElementVersions ??= []).push("2.1.0");
|
|
258
|
-
const J = globalThis, B = J.trustedTypes, ie = B ? B.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, fe = "$lit$",
|
|
259
|
-
\f\r]`,
|
|
260
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), ne = /'/g,
|
|
258
|
+
const J = globalThis, B = J.trustedTypes, ie = B ? B.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, fe = "$lit$", y = `lit$${Math.random().toFixed(9).slice(2)}$`, $e = "?" + y, Oe = `<${$e}>`, w = document, O = () => w.createComment(""), T = (t) => t === null || typeof t != "object" && typeof t != "function", Q = Array.isArray, Te = (t) => Q(t) || typeof t?.[Symbol.iterator] == "function", I = `[
|
|
259
|
+
\f\r]`, D = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, se = /-->/g, oe = />/g, v = RegExp(`>|${I}(?:([^\\s"'>=/]+)(${I}*=${I}*(?:[^
|
|
260
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), ne = /'/g, ae = /"/g, be = /^(?:script|style|textarea|title)$/i, Ue = (t) => (e, ...r) => ({ _$litType$: t, strings: e, values: r }), $ = Ue(1), S = /* @__PURE__ */ Symbol.for("lit-noChange"), d = /* @__PURE__ */ Symbol.for("lit-nothing"), le = /* @__PURE__ */ new WeakMap(), x = w.createTreeWalker(w, 129);
|
|
261
261
|
function ge(t, e) {
|
|
262
262
|
if (!Q(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
263
263
|
return ie !== void 0 ? ie.createHTML(e) : e;
|
|
264
264
|
}
|
|
265
265
|
const Me = (t, e) => {
|
|
266
|
-
const
|
|
267
|
-
let
|
|
268
|
-
for (let
|
|
269
|
-
const
|
|
270
|
-
let u, m,
|
|
271
|
-
for (; p <
|
|
272
|
-
const
|
|
273
|
-
o += n ===
|
|
274
|
-
}
|
|
275
|
-
return [ge(t, o + (t[
|
|
266
|
+
const r = t.length - 1, i = [];
|
|
267
|
+
let s, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", n = D;
|
|
268
|
+
for (let h = 0; h < r; h++) {
|
|
269
|
+
const a = t[h];
|
|
270
|
+
let u, m, l = -1, p = 0;
|
|
271
|
+
for (; p < a.length && (n.lastIndex = p, m = n.exec(a), m !== null); ) p = n.lastIndex, n === D ? m[1] === "!--" ? n = se : m[1] !== void 0 ? n = oe : m[2] !== void 0 ? (be.test(m[2]) && (s = RegExp("</" + m[2], "g")), n = v) : m[3] !== void 0 && (n = v) : n === v ? m[0] === ">" ? (n = s ?? D, l = -1) : m[1] === void 0 ? l = -2 : (l = n.lastIndex - m[2].length, u = m[1], n = m[3] === void 0 ? v : m[3] === '"' ? ae : ne) : n === ae || n === ne ? n = v : n === se || n === oe ? n = D : (n = v, s = void 0);
|
|
272
|
+
const c = n === v && t[h + 1].startsWith("/>") ? " " : "";
|
|
273
|
+
o += n === D ? a + Oe : l >= 0 ? (i.push(u), a.slice(0, l) + fe + a.slice(l) + y + c) : a + y + (l === -2 ? h : c);
|
|
274
|
+
}
|
|
275
|
+
return [ge(t, o + (t[r] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), i];
|
|
276
276
|
};
|
|
277
277
|
class U {
|
|
278
|
-
constructor({ strings: e, _$litType$:
|
|
279
|
-
let
|
|
278
|
+
constructor({ strings: e, _$litType$: r }, i) {
|
|
279
|
+
let s;
|
|
280
280
|
this.parts = [];
|
|
281
281
|
let o = 0, n = 0;
|
|
282
|
-
const
|
|
283
|
-
if (this.el = U.createElement(u, i), x.currentNode = this.el.content,
|
|
284
|
-
const
|
|
285
|
-
|
|
282
|
+
const h = e.length - 1, a = this.parts, [u, m] = Me(e, r);
|
|
283
|
+
if (this.el = U.createElement(u, i), x.currentNode = this.el.content, r === 2 || r === 3) {
|
|
284
|
+
const l = this.el.content.firstChild;
|
|
285
|
+
l.replaceWith(...l.childNodes);
|
|
286
286
|
}
|
|
287
|
-
for (; (
|
|
288
|
-
if (
|
|
289
|
-
if (
|
|
290
|
-
const p = m[n++],
|
|
291
|
-
|
|
292
|
-
} else
|
|
293
|
-
if (be.test(
|
|
294
|
-
const
|
|
287
|
+
for (; (s = x.nextNode()) !== null && a.length < h; ) {
|
|
288
|
+
if (s.nodeType === 1) {
|
|
289
|
+
if (s.hasAttributes()) for (const l of s.getAttributeNames()) if (l.endsWith(fe)) {
|
|
290
|
+
const p = m[n++], c = s.getAttribute(l).split(y), f = /([.?@])?(.*)/.exec(p);
|
|
291
|
+
a.push({ type: 1, index: o, name: f[2], strings: c, ctor: f[1] === "." ? He : f[1] === "?" ? Be : f[1] === "@" ? Ne : j }), s.removeAttribute(l);
|
|
292
|
+
} else l.startsWith(y) && (a.push({ type: 6, index: o }), s.removeAttribute(l));
|
|
293
|
+
if (be.test(s.tagName)) {
|
|
294
|
+
const l = s.textContent.split(y), p = l.length - 1;
|
|
295
295
|
if (p > 0) {
|
|
296
|
-
|
|
297
|
-
for (let
|
|
298
|
-
|
|
296
|
+
s.textContent = B ? B.emptyScript : "";
|
|
297
|
+
for (let c = 0; c < p; c++) s.append(l[c], O()), x.nextNode(), a.push({ type: 2, index: ++o });
|
|
298
|
+
s.append(l[p], O());
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
|
-
} else if (
|
|
301
|
+
} else if (s.nodeType === 8) if (s.data === $e) a.push({ type: 2, index: o });
|
|
302
302
|
else {
|
|
303
|
-
let
|
|
304
|
-
for (; (
|
|
303
|
+
let l = -1;
|
|
304
|
+
for (; (l = s.data.indexOf(y, l + 1)) !== -1; ) a.push({ type: 7, index: o }), l += y.length - 1;
|
|
305
305
|
}
|
|
306
306
|
o++;
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
|
-
static createElement(e,
|
|
309
|
+
static createElement(e, r) {
|
|
310
310
|
const i = w.createElement("template");
|
|
311
311
|
return i.innerHTML = e, i;
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
|
-
function C(t, e,
|
|
314
|
+
function C(t, e, r = t, i) {
|
|
315
315
|
if (e === S) return e;
|
|
316
|
-
let
|
|
316
|
+
let s = i !== void 0 ? r._$Co?.[i] : r._$Cl;
|
|
317
317
|
const o = T(e) ? void 0 : e._$litDirective$;
|
|
318
|
-
return
|
|
318
|
+
return s?.constructor !== o && (s?._$AO?.(!1), o === void 0 ? s = void 0 : (s = new o(t), s._$AT(t, r, i)), i !== void 0 ? (r._$Co ??= [])[i] = s : r._$Cl = s), s !== void 0 && (e = C(t, s._$AS(t, e.values), s, i)), e;
|
|
319
319
|
}
|
|
320
320
|
let Re = class {
|
|
321
|
-
constructor(e,
|
|
322
|
-
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM =
|
|
321
|
+
constructor(e, r) {
|
|
322
|
+
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = r;
|
|
323
323
|
}
|
|
324
324
|
get parentNode() {
|
|
325
325
|
return this._$AM.parentNode;
|
|
@@ -328,34 +328,34 @@ let Re = class {
|
|
|
328
328
|
return this._$AM._$AU;
|
|
329
329
|
}
|
|
330
330
|
u(e) {
|
|
331
|
-
const { el: { content:
|
|
332
|
-
x.currentNode =
|
|
333
|
-
let o = x.nextNode(), n = 0,
|
|
334
|
-
for (;
|
|
335
|
-
if (n ===
|
|
331
|
+
const { el: { content: r }, parts: i } = this._$AD, s = (e?.creationScope ?? w).importNode(r, !0);
|
|
332
|
+
x.currentNode = s;
|
|
333
|
+
let o = x.nextNode(), n = 0, h = 0, a = i[0];
|
|
334
|
+
for (; a !== void 0; ) {
|
|
335
|
+
if (n === a.index) {
|
|
336
336
|
let u;
|
|
337
|
-
|
|
337
|
+
a.type === 2 ? u = new k(o, o.nextSibling, this, e) : a.type === 1 ? u = new a.ctor(o, a.name, a.strings, this, e) : a.type === 6 && (u = new je(o, this, e)), this._$AV.push(u), a = i[++h];
|
|
338
338
|
}
|
|
339
|
-
n !==
|
|
339
|
+
n !== a?.index && (o = x.nextNode(), n++);
|
|
340
340
|
}
|
|
341
|
-
return x.currentNode = w,
|
|
341
|
+
return x.currentNode = w, s;
|
|
342
342
|
}
|
|
343
343
|
p(e) {
|
|
344
|
-
let
|
|
345
|
-
for (const i of this._$AV) i !== void 0 && (i.strings !== void 0 ? (i._$AI(e, i,
|
|
344
|
+
let r = 0;
|
|
345
|
+
for (const i of this._$AV) i !== void 0 && (i.strings !== void 0 ? (i._$AI(e, i, r), r += i.strings.length - 2) : i._$AI(e[r])), r++;
|
|
346
346
|
}
|
|
347
347
|
};
|
|
348
|
-
class
|
|
348
|
+
class k {
|
|
349
349
|
get _$AU() {
|
|
350
350
|
return this._$AM?._$AU ?? this._$Cv;
|
|
351
351
|
}
|
|
352
|
-
constructor(e,
|
|
353
|
-
this.type = 2, this._$AH = d, this._$AN = void 0, this._$AA = e, this._$AB =
|
|
352
|
+
constructor(e, r, i, s) {
|
|
353
|
+
this.type = 2, this._$AH = d, this._$AN = void 0, this._$AA = e, this._$AB = r, this._$AM = i, this.options = s, this._$Cv = s?.isConnected ?? !0;
|
|
354
354
|
}
|
|
355
355
|
get parentNode() {
|
|
356
356
|
let e = this._$AA.parentNode;
|
|
357
|
-
const
|
|
358
|
-
return
|
|
357
|
+
const r = this._$AM;
|
|
358
|
+
return r !== void 0 && e?.nodeType === 11 && (e = r.parentNode), e;
|
|
359
359
|
}
|
|
360
360
|
get startNode() {
|
|
361
361
|
return this._$AA;
|
|
@@ -363,8 +363,8 @@ class D {
|
|
|
363
363
|
get endNode() {
|
|
364
364
|
return this._$AB;
|
|
365
365
|
}
|
|
366
|
-
_$AI(e,
|
|
367
|
-
e = C(this, e,
|
|
366
|
+
_$AI(e, r = this) {
|
|
367
|
+
e = C(this, e, r), T(e) ? e === d || e == null || e === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : e !== this._$AH && e !== S && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Te(e) ? this.k(e) : this._(e);
|
|
368
368
|
}
|
|
369
369
|
O(e) {
|
|
370
370
|
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
@@ -376,26 +376,26 @@ class D {
|
|
|
376
376
|
this._$AH !== d && T(this._$AH) ? this._$AA.nextSibling.data = e : this.T(w.createTextNode(e)), this._$AH = e;
|
|
377
377
|
}
|
|
378
378
|
$(e) {
|
|
379
|
-
const { values:
|
|
380
|
-
if (this._$AH?._$AD ===
|
|
379
|
+
const { values: r, _$litType$: i } = e, s = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el = U.createElement(ge(i.h, i.h[0]), this.options)), i);
|
|
380
|
+
if (this._$AH?._$AD === s) this._$AH.p(r);
|
|
381
381
|
else {
|
|
382
|
-
const o = new Re(
|
|
383
|
-
o.p(
|
|
382
|
+
const o = new Re(s, this), n = o.u(this.options);
|
|
383
|
+
o.p(r), this.T(n), this._$AH = o;
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
386
|
_$AC(e) {
|
|
387
|
-
let
|
|
388
|
-
return
|
|
387
|
+
let r = le.get(e.strings);
|
|
388
|
+
return r === void 0 && le.set(e.strings, r = new U(e)), r;
|
|
389
389
|
}
|
|
390
390
|
k(e) {
|
|
391
391
|
Q(this._$AH) || (this._$AH = [], this._$AR());
|
|
392
|
-
const
|
|
393
|
-
let i,
|
|
394
|
-
for (const o of e)
|
|
395
|
-
|
|
392
|
+
const r = this._$AH;
|
|
393
|
+
let i, s = 0;
|
|
394
|
+
for (const o of e) s === r.length ? r.push(i = new k(this.O(O()), this.O(O()), this, this.options)) : i = r[s], i._$AI(o), s++;
|
|
395
|
+
s < r.length && (this._$AR(i && i._$AB.nextSibling, s), r.length = s);
|
|
396
396
|
}
|
|
397
|
-
_$AR(e = this._$AA.nextSibling,
|
|
398
|
-
for (this._$AP?.(!1, !0,
|
|
397
|
+
_$AR(e = this._$AA.nextSibling, r) {
|
|
398
|
+
for (this._$AP?.(!1, !0, r); e && e !== this._$AB; ) {
|
|
399
399
|
const i = e.nextSibling;
|
|
400
400
|
e.remove(), e = i;
|
|
401
401
|
}
|
|
@@ -411,19 +411,19 @@ class j {
|
|
|
411
411
|
get _$AU() {
|
|
412
412
|
return this._$AM._$AU;
|
|
413
413
|
}
|
|
414
|
-
constructor(e,
|
|
415
|
-
this.type = 1, this._$AH = d, this._$AN = void 0, this.element = e, this.name =
|
|
414
|
+
constructor(e, r, i, s, o) {
|
|
415
|
+
this.type = 1, this._$AH = d, this._$AN = void 0, this.element = e, this.name = r, this._$AM = s, this.options = o, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = d;
|
|
416
416
|
}
|
|
417
|
-
_$AI(e,
|
|
417
|
+
_$AI(e, r = this, i, s) {
|
|
418
418
|
const o = this.strings;
|
|
419
419
|
let n = !1;
|
|
420
|
-
if (o === void 0) e = C(this, e,
|
|
420
|
+
if (o === void 0) e = C(this, e, r, 0), n = !T(e) || e !== this._$AH && e !== S, n && (this._$AH = e);
|
|
421
421
|
else {
|
|
422
|
-
const
|
|
423
|
-
let
|
|
424
|
-
for (e = o[0],
|
|
422
|
+
const h = e;
|
|
423
|
+
let a, u;
|
|
424
|
+
for (e = o[0], a = 0; a < o.length - 1; a++) u = C(this, h[i + a], r, a), u === S && (u = this._$AH[a]), n ||= !T(u) || u !== this._$AH[a], u === d ? e = d : e !== d && (e += (u ?? "") + o[a + 1]), this._$AH[a] = u;
|
|
425
425
|
}
|
|
426
|
-
n && !
|
|
426
|
+
n && !s && this.j(e);
|
|
427
427
|
}
|
|
428
428
|
j(e) {
|
|
429
429
|
e === d ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
@@ -446,21 +446,21 @@ class Be extends j {
|
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
448
|
class Ne extends j {
|
|
449
|
-
constructor(e,
|
|
450
|
-
super(e,
|
|
449
|
+
constructor(e, r, i, s, o) {
|
|
450
|
+
super(e, r, i, s, o), this.type = 5;
|
|
451
451
|
}
|
|
452
|
-
_$AI(e,
|
|
453
|
-
if ((e = C(this, e,
|
|
454
|
-
const i = this._$AH,
|
|
455
|
-
|
|
452
|
+
_$AI(e, r = this) {
|
|
453
|
+
if ((e = C(this, e, r, 0) ?? d) === S) return;
|
|
454
|
+
const i = this._$AH, s = e === d && i !== d || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive, o = e !== d && (i === d || s);
|
|
455
|
+
s && this.element.removeEventListener(this.name, this, i), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
456
456
|
}
|
|
457
457
|
handleEvent(e) {
|
|
458
458
|
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
461
|
class je {
|
|
462
|
-
constructor(e,
|
|
463
|
-
this.element = e, this.type = 6, this._$AN = void 0, this._$AM =
|
|
462
|
+
constructor(e, r, i) {
|
|
463
|
+
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = r, this.options = i;
|
|
464
464
|
}
|
|
465
465
|
get _$AU() {
|
|
466
466
|
return this._$AM._$AU;
|
|
@@ -469,16 +469,16 @@ class je {
|
|
|
469
469
|
C(this, e);
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
|
-
const
|
|
473
|
-
|
|
474
|
-
const Ie = (t, e,
|
|
475
|
-
const i =
|
|
476
|
-
let
|
|
477
|
-
if (
|
|
478
|
-
const o =
|
|
479
|
-
i._$litPart$ =
|
|
472
|
+
const qe = { I: k }, ze = J.litHtmlPolyfillSupport;
|
|
473
|
+
ze?.(U, k), (J.litHtmlVersions ??= []).push("3.3.0");
|
|
474
|
+
const Ie = (t, e, r) => {
|
|
475
|
+
const i = r?.renderBefore ?? e;
|
|
476
|
+
let s = i._$litPart$;
|
|
477
|
+
if (s === void 0) {
|
|
478
|
+
const o = r?.renderBefore ?? null;
|
|
479
|
+
i._$litPart$ = s = new k(e.insertBefore(O(), o), o, void 0, r ?? {});
|
|
480
480
|
}
|
|
481
|
-
return
|
|
481
|
+
return s._$AI(t), s;
|
|
482
482
|
};
|
|
483
483
|
const G = globalThis;
|
|
484
484
|
let F = class extends E {
|
|
@@ -490,8 +490,8 @@ let F = class extends E {
|
|
|
490
490
|
return this.renderOptions.renderBefore ??= e.firstChild, e;
|
|
491
491
|
}
|
|
492
492
|
update(e) {
|
|
493
|
-
const
|
|
494
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Ie(
|
|
493
|
+
const r = this.render();
|
|
494
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Ie(r, this.renderRoot, this.renderOptions);
|
|
495
495
|
}
|
|
496
496
|
connectedCallback() {
|
|
497
497
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -507,177 +507,177 @@ F._$litElement$ = !0, F.finalized = !0, G.litElementHydrateSupport?.({ LitElemen
|
|
|
507
507
|
const Le = G.litElementPolyfillSupport;
|
|
508
508
|
Le?.({ LitElement: F });
|
|
509
509
|
(G.litElementVersions ??= []).push("4.2.0");
|
|
510
|
-
const We = { CHILD: 2 },
|
|
511
|
-
let
|
|
510
|
+
const We = { CHILD: 2 }, _e = (t) => (...e) => ({ _$litDirective$: t, values: e });
|
|
511
|
+
let ye = class {
|
|
512
512
|
constructor(e) {
|
|
513
513
|
}
|
|
514
514
|
get _$AU() {
|
|
515
515
|
return this._$AM._$AU;
|
|
516
516
|
}
|
|
517
|
-
_$AT(e,
|
|
518
|
-
this._$Ct = e, this._$AM =
|
|
517
|
+
_$AT(e, r, i) {
|
|
518
|
+
this._$Ct = e, this._$AM = r, this._$Ci = i;
|
|
519
519
|
}
|
|
520
|
-
_$AS(e,
|
|
521
|
-
return this.update(e,
|
|
520
|
+
_$AS(e, r) {
|
|
521
|
+
return this.update(e, r);
|
|
522
522
|
}
|
|
523
|
-
update(e,
|
|
524
|
-
return this.render(...
|
|
523
|
+
update(e, r) {
|
|
524
|
+
return this.render(...r);
|
|
525
525
|
}
|
|
526
526
|
};
|
|
527
|
-
const { I: Ke } =
|
|
528
|
-
const i = t._$AA.parentNode,
|
|
529
|
-
if (
|
|
530
|
-
const o = i.insertBefore(
|
|
531
|
-
|
|
527
|
+
const { I: Ke } = qe, he = () => document.createComment(""), P = (t, e, r) => {
|
|
528
|
+
const i = t._$AA.parentNode, s = e === void 0 ? t._$AB : e._$AA;
|
|
529
|
+
if (r === void 0) {
|
|
530
|
+
const o = i.insertBefore(he(), s), n = i.insertBefore(he(), s);
|
|
531
|
+
r = new Ke(o, n, t, t.options);
|
|
532
532
|
} else {
|
|
533
|
-
const o =
|
|
534
|
-
if (
|
|
535
|
-
let
|
|
536
|
-
|
|
533
|
+
const o = r._$AB.nextSibling, n = r._$AM, h = n !== t;
|
|
534
|
+
if (h) {
|
|
535
|
+
let a;
|
|
536
|
+
r._$AQ?.(t), r._$AM = t, r._$AP !== void 0 && (a = t._$AU) !== n._$AU && r._$AP(a);
|
|
537
537
|
}
|
|
538
|
-
if (o !==
|
|
539
|
-
let
|
|
540
|
-
for (;
|
|
541
|
-
const u =
|
|
542
|
-
i.insertBefore(
|
|
538
|
+
if (o !== s || h) {
|
|
539
|
+
let a = r._$AA;
|
|
540
|
+
for (; a !== o; ) {
|
|
541
|
+
const u = a.nextSibling;
|
|
542
|
+
i.insertBefore(a, s), a = u;
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
|
-
return
|
|
547
|
-
}, A = (t, e,
|
|
546
|
+
return r;
|
|
547
|
+
}, A = (t, e, r = t) => (t._$AI(e, r), t), Ze = {}, ve = (t, e = Ze) => t._$AH = e, Je = (t) => t._$AH, L = (t) => {
|
|
548
548
|
t._$AP?.(!1, !0);
|
|
549
549
|
let e = t._$AA;
|
|
550
|
-
const
|
|
551
|
-
for (; e !==
|
|
550
|
+
const r = t._$AB.nextSibling;
|
|
551
|
+
for (; e !== r; ) {
|
|
552
552
|
const i = e.nextSibling;
|
|
553
553
|
e.remove(), e = i;
|
|
554
554
|
}
|
|
555
555
|
};
|
|
556
|
-
const
|
|
556
|
+
const ce = (t, e, r) => {
|
|
557
557
|
const i = /* @__PURE__ */ new Map();
|
|
558
|
-
for (let
|
|
558
|
+
for (let s = e; s <= r; s++) i.set(t[s], s);
|
|
559
559
|
return i;
|
|
560
|
-
}, ue =
|
|
560
|
+
}, ue = _e(class extends ye {
|
|
561
561
|
constructor(t) {
|
|
562
562
|
if (super(t), t.type !== We.CHILD) throw Error("repeat() can only be used in text expressions");
|
|
563
563
|
}
|
|
564
|
-
dt(t, e,
|
|
564
|
+
dt(t, e, r) {
|
|
565
565
|
let i;
|
|
566
|
-
|
|
567
|
-
const
|
|
566
|
+
r === void 0 ? r = e : e !== void 0 && (i = e);
|
|
567
|
+
const s = [], o = [];
|
|
568
568
|
let n = 0;
|
|
569
|
-
for (const
|
|
570
|
-
return { values: o, keys:
|
|
571
|
-
}
|
|
572
|
-
render(t, e,
|
|
573
|
-
return this.dt(t, e,
|
|
574
|
-
}
|
|
575
|
-
update(t, [e,
|
|
576
|
-
const
|
|
577
|
-
if (!Array.isArray(
|
|
578
|
-
const
|
|
579
|
-
let u, m,
|
|
580
|
-
for (;
|
|
581
|
-
else if (
|
|
582
|
-
else if (
|
|
583
|
-
else if (
|
|
584
|
-
else if (
|
|
585
|
-
else if (
|
|
586
|
-
else if (u === void 0 && (u =
|
|
587
|
-
const
|
|
588
|
-
if (
|
|
589
|
-
const X = P(t,
|
|
590
|
-
A(X, o[
|
|
591
|
-
} else
|
|
592
|
-
|
|
593
|
-
} else L(
|
|
594
|
-
else L(
|
|
595
|
-
for (;
|
|
596
|
-
const
|
|
597
|
-
A(
|
|
569
|
+
for (const h of t) s[n] = i ? i(h, n) : n, o[n] = r(h, n), n++;
|
|
570
|
+
return { values: o, keys: s };
|
|
571
|
+
}
|
|
572
|
+
render(t, e, r) {
|
|
573
|
+
return this.dt(t, e, r).values;
|
|
574
|
+
}
|
|
575
|
+
update(t, [e, r, i]) {
|
|
576
|
+
const s = Je(t), { values: o, keys: n } = this.dt(e, r, i);
|
|
577
|
+
if (!Array.isArray(s)) return this.ut = n, o;
|
|
578
|
+
const h = this.ut ??= [], a = [];
|
|
579
|
+
let u, m, l = 0, p = s.length - 1, c = 0, f = o.length - 1;
|
|
580
|
+
for (; l <= p && c <= f; ) if (s[l] === null) l++;
|
|
581
|
+
else if (s[p] === null) p--;
|
|
582
|
+
else if (h[l] === n[c]) a[c] = A(s[l], o[c]), l++, c++;
|
|
583
|
+
else if (h[p] === n[f]) a[f] = A(s[p], o[f]), p--, f--;
|
|
584
|
+
else if (h[l] === n[f]) a[f] = A(s[l], o[f]), P(t, a[f + 1], s[l]), l++, f--;
|
|
585
|
+
else if (h[p] === n[c]) a[c] = A(s[p], o[c]), P(t, s[l], s[p]), p--, c++;
|
|
586
|
+
else if (u === void 0 && (u = ce(n, c, f), m = ce(h, l, p)), u.has(h[l])) if (u.has(h[p])) {
|
|
587
|
+
const _ = m.get(n[c]), z = _ !== void 0 ? s[_] : null;
|
|
588
|
+
if (z === null) {
|
|
589
|
+
const X = P(t, s[l]);
|
|
590
|
+
A(X, o[c]), a[c] = X;
|
|
591
|
+
} else a[c] = A(z, o[c]), P(t, s[l], z), s[_] = null;
|
|
592
|
+
c++;
|
|
593
|
+
} else L(s[p]), p--;
|
|
594
|
+
else L(s[l]), l++;
|
|
595
|
+
for (; c <= f; ) {
|
|
596
|
+
const _ = P(t, a[f + 1]);
|
|
597
|
+
A(_, o[c]), a[c++] = _;
|
|
598
598
|
}
|
|
599
|
-
for (;
|
|
600
|
-
const
|
|
601
|
-
|
|
599
|
+
for (; l <= p; ) {
|
|
600
|
+
const _ = s[l++];
|
|
601
|
+
_ !== null && L(_);
|
|
602
602
|
}
|
|
603
|
-
return this.ut = n, ve(t,
|
|
603
|
+
return this.ut = n, ve(t, a), S;
|
|
604
604
|
}
|
|
605
605
|
});
|
|
606
|
-
const Qe =
|
|
606
|
+
const Qe = _e(class extends ye {
|
|
607
607
|
constructor() {
|
|
608
608
|
super(...arguments), this.key = d;
|
|
609
609
|
}
|
|
610
610
|
render(t, e) {
|
|
611
611
|
return this.key = t, e;
|
|
612
612
|
}
|
|
613
|
-
update(t, [e,
|
|
614
|
-
return e !== this.key && (ve(t), this.key = e),
|
|
613
|
+
update(t, [e, r]) {
|
|
614
|
+
return e !== this.key && (ve(t), this.key = e), r;
|
|
615
615
|
}
|
|
616
616
|
});
|
|
617
|
-
const Ge = (t) => (e,
|
|
618
|
-
|
|
617
|
+
const Ge = (t) => (e, r) => {
|
|
618
|
+
r !== void 0 ? r.addInitializer((() => {
|
|
619
619
|
customElements.define(t, e);
|
|
620
620
|
})) : customElements.define(t, e);
|
|
621
621
|
};
|
|
622
|
-
const Xe = { attribute: !0, type: String, converter: H, reflect: !1, hasChanged: Z }, Ye = (t = Xe, e,
|
|
623
|
-
const { kind: i, metadata:
|
|
624
|
-
let o = globalThis.litPropertyMetadata.get(
|
|
625
|
-
if (o === void 0 && globalThis.litPropertyMetadata.set(
|
|
626
|
-
const { name: n } =
|
|
627
|
-
return { set(
|
|
628
|
-
const
|
|
629
|
-
e.set.call(this,
|
|
630
|
-
}, init(
|
|
631
|
-
return
|
|
622
|
+
const Xe = { attribute: !0, type: String, converter: H, reflect: !1, hasChanged: Z }, Ye = (t = Xe, e, r) => {
|
|
623
|
+
const { kind: i, metadata: s } = r;
|
|
624
|
+
let o = globalThis.litPropertyMetadata.get(s);
|
|
625
|
+
if (o === void 0 && globalThis.litPropertyMetadata.set(s, o = /* @__PURE__ */ new Map()), i === "setter" && ((t = Object.create(t)).wrapped = !0), o.set(r.name, t), i === "accessor") {
|
|
626
|
+
const { name: n } = r;
|
|
627
|
+
return { set(h) {
|
|
628
|
+
const a = e.get.call(this);
|
|
629
|
+
e.set.call(this, h), this.requestUpdate(n, a, t);
|
|
630
|
+
}, init(h) {
|
|
631
|
+
return h !== void 0 && this.C(n, void 0, t, h), h;
|
|
632
632
|
} };
|
|
633
633
|
}
|
|
634
634
|
if (i === "setter") {
|
|
635
|
-
const { name: n } =
|
|
636
|
-
return function(
|
|
637
|
-
const
|
|
638
|
-
e.call(this,
|
|
635
|
+
const { name: n } = r;
|
|
636
|
+
return function(h) {
|
|
637
|
+
const a = this[n];
|
|
638
|
+
e.call(this, h), this.requestUpdate(n, a, t);
|
|
639
639
|
};
|
|
640
640
|
}
|
|
641
641
|
throw Error("Unsupported decorator location: " + i);
|
|
642
642
|
};
|
|
643
|
-
function
|
|
644
|
-
return (e,
|
|
645
|
-
const n =
|
|
646
|
-
return
|
|
647
|
-
})(t, e,
|
|
643
|
+
function q(t) {
|
|
644
|
+
return (e, r) => typeof r == "object" ? Ye(t, e, r) : ((i, s, o) => {
|
|
645
|
+
const n = s.hasOwnProperty(o);
|
|
646
|
+
return s.constructor.createProperty(o, i), n ? Object.getOwnPropertyDescriptor(s, o) : void 0;
|
|
647
|
+
})(t, e, r);
|
|
648
648
|
}
|
|
649
649
|
function M(t) {
|
|
650
|
-
return
|
|
650
|
+
return q({ ...t, state: !0, attribute: !1 });
|
|
651
651
|
}
|
|
652
|
-
const et = (t, e,
|
|
652
|
+
const et = (t, e, r) => (r.configurable = !0, r.enumerable = !0, Reflect.decorate && typeof e != "object" && Object.defineProperty(t, e, r), r);
|
|
653
653
|
function tt(t, e) {
|
|
654
|
-
return (
|
|
654
|
+
return (r, i, s) => {
|
|
655
655
|
const o = (n) => n.renderRoot?.querySelector(t) ?? null;
|
|
656
|
-
return et(
|
|
656
|
+
return et(r, i, { get() {
|
|
657
657
|
return o(this);
|
|
658
658
|
} });
|
|
659
659
|
};
|
|
660
660
|
}
|
|
661
|
-
var
|
|
662
|
-
for (var
|
|
663
|
-
(n = t[o]) && (
|
|
664
|
-
return i &&
|
|
661
|
+
var rt = Object.defineProperty, it = Object.getOwnPropertyDescriptor, g = (t, e, r, i) => {
|
|
662
|
+
for (var s = i > 1 ? void 0 : i ? it(e, r) : e, o = t.length - 1, n; o >= 0; o--)
|
|
663
|
+
(n = t[o]) && (s = (i ? n(e, r, s) : n(s)) || s);
|
|
664
|
+
return i && s && rt(e, r, s), s;
|
|
665
665
|
};
|
|
666
|
-
const
|
|
667
|
-
let e = "",
|
|
668
|
-
for (let
|
|
669
|
-
const o = t[
|
|
666
|
+
const st = /* @__PURE__ */ new Set(["(", ")", "[", "{", "}", "/", "|"]), ot = (t) => {
|
|
667
|
+
let e = "", r = !1, i = 0;
|
|
668
|
+
for (let s = 0; s < t.length; s++) {
|
|
669
|
+
const o = t[s];
|
|
670
670
|
if (o === "\\")
|
|
671
|
-
e += o + (t[
|
|
672
|
-
else if (!
|
|
673
|
-
o === "[" && (
|
|
671
|
+
e += o + (t[s + 1] ?? ""), s++;
|
|
672
|
+
else if (!r)
|
|
673
|
+
o === "[" && (r = !0, i = t[s + 1] === "^" ? s + 2 : s + 1), e += o;
|
|
674
674
|
else if (o === "]")
|
|
675
|
-
|
|
675
|
+
r = !1, e += o;
|
|
676
676
|
else if (o === "-") {
|
|
677
|
-
const n =
|
|
677
|
+
const n = s > i && s < t.length - 1 && t[s + 1] !== "]";
|
|
678
678
|
e += n ? o : "\\-";
|
|
679
679
|
} else
|
|
680
|
-
e +=
|
|
680
|
+
e += st.has(o) ? "\\" + o : o;
|
|
681
681
|
}
|
|
682
682
|
return e;
|
|
683
683
|
}, de = (t) => {
|
|
@@ -689,14 +689,14 @@ const rt = /* @__PURE__ */ new Set(["(", ")", "[", "{", "}", "/", "|"]), ot = (t
|
|
|
689
689
|
}, pe = /* @__PURE__ */ new Map(), nt = (t) => {
|
|
690
690
|
const e = t?.trim();
|
|
691
691
|
if (!e) return "";
|
|
692
|
-
const
|
|
693
|
-
if (
|
|
692
|
+
const r = pe.get(e);
|
|
693
|
+
if (r !== void 0) return r;
|
|
694
694
|
let i = "";
|
|
695
695
|
if (de(e))
|
|
696
696
|
i = e;
|
|
697
697
|
else {
|
|
698
|
-
const
|
|
699
|
-
de(
|
|
698
|
+
const s = ot(e);
|
|
699
|
+
de(s) ? i = s : console.warn(
|
|
700
700
|
`widget-form: ignoring validation regex "${e}" — it is not a valid regular expression under the "v" flag the HTML pattern attribute uses.`
|
|
701
701
|
);
|
|
702
702
|
}
|
|
@@ -704,7 +704,7 @@ const rt = /* @__PURE__ */ new Set(["(", ")", "[", "{", "}", "/", "|"]), ot = (t
|
|
|
704
704
|
};
|
|
705
705
|
let b = class extends F {
|
|
706
706
|
constructor() {
|
|
707
|
-
super(...arguments), this.dialogOpen = !1, this.formKey = 0, this.fieldValues = {}, this.version = "1.0.
|
|
707
|
+
super(...arguments), this.dialogOpen = !1, this.formKey = 0, this.fieldValues = {}, this.version = "1.0.34", this.dialogScrimPatched = !1;
|
|
708
708
|
}
|
|
709
709
|
update(t) {
|
|
710
710
|
t.has("theme") && this.registerTheme(this.theme), super.update(t);
|
|
@@ -742,37 +742,36 @@ let b = class extends F {
|
|
|
742
742
|
`), t.adoptedStyleSheets = [...t.adoptedStyleSheets, e], this.dialogScrimPatched = !0;
|
|
743
743
|
}
|
|
744
744
|
registerTheme(t) {
|
|
745
|
-
|
|
746
|
-
this.themeBgColor = s || this.theme?.theme_object?.backgroundColor, this.themeTitleColor = e || this.theme?.theme_object?.title?.textStyle?.color;
|
|
745
|
+
this.themeBgColor = `var(--re-tile-background-color, ${this.theme?.theme_object?.backgroundColor || "transparent"})`, this.themeTitleColor = `var(--re-text-color, ${this.theme?.theme_object?.title?.textStyle?.color || "inherit"})`;
|
|
747
746
|
}
|
|
748
747
|
openFormDialog() {
|
|
749
748
|
this.dialogOpen = !0;
|
|
750
749
|
}
|
|
751
750
|
handleFormSubmit(t) {
|
|
752
751
|
t.preventDefault();
|
|
753
|
-
const
|
|
754
|
-
const
|
|
752
|
+
const r = t.submitter?.getAttribute("value") ?? "submit", i = t.target, s = new FormData(i), o = this.inputData?.formFields?.map((n, h) => {
|
|
753
|
+
const a = {
|
|
755
754
|
swarm_app_databackend_key: n.targetColumn?.swarm_app_databackend_key,
|
|
756
755
|
table_name: n.targetColumn?.tablename,
|
|
757
756
|
column_name: n.targetColumn?.column
|
|
758
757
|
};
|
|
759
758
|
if (!n.hiddenField && !this.isFieldVisible(n))
|
|
760
|
-
return { ...
|
|
761
|
-
const u = this.currentRawValue(n,
|
|
762
|
-
return { ...
|
|
759
|
+
return { ...a, value: null };
|
|
760
|
+
const u = this.currentRawValue(n, h, s);
|
|
761
|
+
return { ...a, value: this.formatValue(u, n.type ?? "textfield") };
|
|
763
762
|
});
|
|
764
763
|
if (this.inputData?.deleteFlagColumn && o?.push({
|
|
765
764
|
swarm_app_databackend_key: this.inputData?.deleteFlagColumn?.swarm_app_databackend_key,
|
|
766
765
|
table_name: this.inputData?.deleteFlagColumn?.tablename,
|
|
767
766
|
column_name: this.inputData?.deleteFlagColumn?.column,
|
|
768
|
-
value:
|
|
767
|
+
value: r === "delete"
|
|
769
768
|
}), this.dispatchEvent(
|
|
770
769
|
new CustomEvent("data-submit", {
|
|
771
770
|
detail: o,
|
|
772
771
|
bubbles: !1,
|
|
773
772
|
composed: !1
|
|
774
773
|
})
|
|
775
|
-
),
|
|
774
|
+
), r === "delete") {
|
|
776
775
|
const n = this.resolveRoute({
|
|
777
776
|
route: this.inputData?.deleteNavigationRoute,
|
|
778
777
|
variables: this.inputData?.variables
|
|
@@ -804,8 +803,8 @@ let b = class extends F {
|
|
|
804
803
|
switch (e) {
|
|
805
804
|
case "numberfield": {
|
|
806
805
|
if (t === "" || t === null || t === void 0) return null;
|
|
807
|
-
const
|
|
808
|
-
return Number.isNaN(
|
|
806
|
+
const r = parseFloat(t);
|
|
807
|
+
return Number.isNaN(r) ? null : r;
|
|
809
808
|
}
|
|
810
809
|
case "checkbox":
|
|
811
810
|
return t === "on" || t === "true";
|
|
@@ -818,13 +817,13 @@ let b = class extends F {
|
|
|
818
817
|
// submission agree. Checkbox is normalized to 'true'/'false' (matching the
|
|
819
818
|
// literals designers use in a condition list); a field absent from the DOM
|
|
820
819
|
// (hidden by its own condition) yields its effective default value.
|
|
821
|
-
currentRawValue(t, e,
|
|
820
|
+
currentRawValue(t, e, r) {
|
|
822
821
|
const i = `column-${e}`;
|
|
823
822
|
if (t.hiddenField)
|
|
824
823
|
return this.effectivePreFilledValue(t) ?? this.effectiveDefaultValue(t) ?? "";
|
|
825
|
-
if (t.type === "checkbox") return
|
|
826
|
-
const
|
|
827
|
-
return
|
|
824
|
+
if (t.type === "checkbox") return r.has(i) ? "true" : "false";
|
|
825
|
+
const s = r.get(i);
|
|
826
|
+
return s === null || s === "" ? this.effectiveDefaultValue(t) ?? "" : String(s);
|
|
828
827
|
}
|
|
829
828
|
// Rebuild the label→value map on every input/change so conditional-display
|
|
830
829
|
// rules re-evaluate live. A single delegated listener on the <form> catches
|
|
@@ -832,9 +831,9 @@ let b = class extends F {
|
|
|
832
831
|
handleFieldChange(t) {
|
|
833
832
|
const e = t.currentTarget;
|
|
834
833
|
if (!e) return;
|
|
835
|
-
const
|
|
836
|
-
this.inputData?.formFields?.forEach((
|
|
837
|
-
|
|
834
|
+
const r = new FormData(e), i = {};
|
|
835
|
+
this.inputData?.formFields?.forEach((s, o) => {
|
|
836
|
+
s.label && (i[s.label] = this.currentRawValue(s, o, r));
|
|
838
837
|
}), this.fieldValues = i;
|
|
839
838
|
}
|
|
840
839
|
// A field is visible unless it declares a conditional-display rule whose
|
|
@@ -844,12 +843,12 @@ let b = class extends F {
|
|
|
844
843
|
isFieldVisible(t) {
|
|
845
844
|
const e = t.conditionalDisplay?.conditionField?.trim();
|
|
846
845
|
if (!e) return !0;
|
|
847
|
-
const
|
|
848
|
-
if (
|
|
846
|
+
const r = (t.conditionalDisplay?.conditionValues ?? "").split(",").map((o) => o.trim()).filter((o) => o !== "");
|
|
847
|
+
if (r.length === 0) return !0;
|
|
849
848
|
const i = this.inputData?.formFields?.find((o) => o.label === e);
|
|
850
849
|
if (!i) return !0;
|
|
851
|
-
const
|
|
852
|
-
return
|
|
850
|
+
const s = this.fieldValues[e] ?? this.effectivePreFilledValue(i) ?? this.effectiveDefaultValue(i) ?? "";
|
|
851
|
+
return r.includes(String(s));
|
|
853
852
|
}
|
|
854
853
|
renderTextField(t, e) {
|
|
855
854
|
return $`
|
|
@@ -884,14 +883,14 @@ let b = class extends F {
|
|
|
884
883
|
`;
|
|
885
884
|
}
|
|
886
885
|
renderCheckbox(t, e) {
|
|
887
|
-
const
|
|
886
|
+
const r = this.effectivePreFilledValue(t), i = this.effectiveDefaultValue(t);
|
|
888
887
|
return $`
|
|
889
888
|
<div class="checkbox-container">
|
|
890
889
|
<md-checkbox
|
|
891
890
|
name="column-${e}"
|
|
892
891
|
aria-label=${t.label ?? ""}
|
|
893
|
-
?checked=${String(
|
|
894
|
-
?required=${t.required && !i && !
|
|
892
|
+
?checked=${String(r ?? i) === "true"}
|
|
893
|
+
?required=${t.required && !i && !r}
|
|
895
894
|
></md-checkbox>
|
|
896
895
|
<label class="label">
|
|
897
896
|
${t.label}
|
|
@@ -901,16 +900,16 @@ let b = class extends F {
|
|
|
901
900
|
`;
|
|
902
901
|
}
|
|
903
902
|
renderTextArea(t, e) {
|
|
904
|
-
const
|
|
903
|
+
const r = this.effectivePreFilledValue(t), i = this.effectiveDefaultValue(t);
|
|
905
904
|
return $`
|
|
906
905
|
<md-outlined-text-field
|
|
907
906
|
.name="column-${e}"
|
|
908
907
|
.label="${t.label ?? ""}"
|
|
909
908
|
type="textarea"
|
|
910
|
-
.value="${
|
|
909
|
+
.value="${r ?? ""}"
|
|
911
910
|
.placeholder="${i ?? ""}"
|
|
912
911
|
rows="3"
|
|
913
|
-
?required=${t.required && !i && !
|
|
912
|
+
?required=${t.required && !i && !r}
|
|
914
913
|
supporting-text=${t.description ?? ""}
|
|
915
914
|
></md-outlined-text-field>
|
|
916
915
|
`;
|
|
@@ -927,10 +926,10 @@ let b = class extends F {
|
|
|
927
926
|
>
|
|
928
927
|
${ue(
|
|
929
928
|
t.values ?? [],
|
|
930
|
-
(
|
|
931
|
-
(
|
|
932
|
-
<md-select-option .value="${
|
|
933
|
-
${
|
|
929
|
+
(r) => r.value,
|
|
930
|
+
(r) => $`
|
|
931
|
+
<md-select-option .value="${r.value ?? ""}">
|
|
932
|
+
${r.displayLabel}
|
|
934
933
|
</md-select-option>
|
|
935
934
|
`
|
|
936
935
|
)}
|
|
@@ -958,12 +957,12 @@ let b = class extends F {
|
|
|
958
957
|
let e = t?.route ?? "";
|
|
959
958
|
if (e) {
|
|
960
959
|
if (t?.variables)
|
|
961
|
-
for (const
|
|
962
|
-
|
|
960
|
+
for (const r of t.variables)
|
|
961
|
+
r.label && (e = e.split(`{{${r.label}}}`).join(encodeURIComponent(String(r.value ?? ""))));
|
|
963
962
|
if (e.includes("*")) {
|
|
964
|
-
const
|
|
965
|
-
for (let
|
|
966
|
-
i[
|
|
963
|
+
const r = (this.route || "").split("/").filter(Boolean), i = e.split("/").filter(Boolean);
|
|
964
|
+
for (let s = 0; s < i.length; s++)
|
|
965
|
+
i[s] === "*" && (i[s] = r[s] ?? "");
|
|
967
966
|
e = (e.startsWith("/") ? "/" : "") + i.filter(Boolean).join("/");
|
|
968
967
|
}
|
|
969
968
|
return e;
|
|
@@ -972,21 +971,34 @@ let b = class extends F {
|
|
|
972
971
|
cancelEdit(t) {
|
|
973
972
|
this.resetForm(), this.dialogOpen = !1;
|
|
974
973
|
}
|
|
974
|
+
/**
|
|
975
|
+
* Resolved background colour, for the alpha-stripping below.
|
|
976
|
+
*
|
|
977
|
+
* themeBgColor holds a var() chain so the tile tracks the host's
|
|
978
|
+
* --re-tile-background-color live, but a chain cannot be picked apart in
|
|
979
|
+
* JS. The opaque variant therefore resolves the colour here, at render
|
|
980
|
+
* time, instead of reading a value cached at the last theme change.
|
|
981
|
+
*/
|
|
982
|
+
resolvedBgColor() {
|
|
983
|
+
return getComputedStyle(this).getPropertyValue("--re-tile-background-color").trim() || this.theme?.theme_object?.backgroundColor;
|
|
984
|
+
}
|
|
975
985
|
render() {
|
|
976
|
-
const t = this.themeTitleColor
|
|
986
|
+
const t = this.themeTitleColor;
|
|
987
|
+
this.themeBgColor;
|
|
988
|
+
const e = this.resolvedBgColor(), r = e?.startsWith("rgba") ? e.replace(/rgba\(([^)]+),\s*[\d.]+\)/, "rgb($1)") : e?.startsWith("#") && e.length === 9 ? e.substring(0, 7) : e?.startsWith("#") && e.length === 5 ? e.substring(0, 4) : e;
|
|
977
989
|
return $`
|
|
978
990
|
<style>
|
|
979
991
|
:host {
|
|
980
992
|
--md-sys-color-on-surface: ${t};
|
|
981
993
|
--md-sys-color-on-surface-variant: ${t};
|
|
982
994
|
--md-sys-color-outline: ${t};
|
|
983
|
-
--md-sys-color-surface-container: ${
|
|
995
|
+
--md-sys-color-surface-container: ${r};
|
|
984
996
|
/* Dialog container and select dropdown panel always use the
|
|
985
997
|
alpha-stripped color so they stay fully opaque regardless of
|
|
986
998
|
the theme's (possibly translucent) background. */
|
|
987
|
-
--md-dialog-container-color: ${
|
|
988
|
-
--md-menu-container-color: ${
|
|
989
|
-
--md-menu-item-selected-container-color: ${
|
|
999
|
+
--md-dialog-container-color: ${r};
|
|
1000
|
+
--md-menu-container-color: ${r};
|
|
1001
|
+
--md-menu-item-selected-container-color: ${r};
|
|
990
1002
|
--md-menu-item-selected-label-text-color: ${t};
|
|
991
1003
|
color: ${t};
|
|
992
1004
|
}
|
|
@@ -1270,13 +1282,13 @@ b.styles = xe`
|
|
|
1270
1282
|
}
|
|
1271
1283
|
`;
|
|
1272
1284
|
g([
|
|
1273
|
-
|
|
1285
|
+
q({ type: Object })
|
|
1274
1286
|
], b.prototype, "inputData", 2);
|
|
1275
1287
|
g([
|
|
1276
|
-
|
|
1288
|
+
q({ type: Object })
|
|
1277
1289
|
], b.prototype, "theme", 2);
|
|
1278
1290
|
g([
|
|
1279
|
-
|
|
1291
|
+
q({ type: String })
|
|
1280
1292
|
], b.prototype, "route", 2);
|
|
1281
1293
|
g([
|
|
1282
1294
|
M()
|
|
@@ -1297,7 +1309,7 @@ g([
|
|
|
1297
1309
|
M()
|
|
1298
1310
|
], b.prototype, "fieldValues", 2);
|
|
1299
1311
|
b = g([
|
|
1300
|
-
Ge("widget-form-1.0.
|
|
1312
|
+
Ge("widget-form-1.0.34")
|
|
1301
1313
|
], b);
|
|
1302
1314
|
export {
|
|
1303
1315
|
b as WidgetForm
|