@luzmo/lucero 0.0.11 → 0.0.12
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/components/accordion/index.cjs +5 -5
- package/components/accordion/index.js +9 -10
- package/components/action-bar/index.cjs +4 -4
- package/components/action-bar/index.js +10 -10
- package/components/action-button/index.cjs +2 -2
- package/components/action-button/index.js +4 -4
- package/components/action-group/index.cjs +1 -1
- package/components/action-group/index.js +1 -1
- package/components/action-group-B59CWNnT.cjs +20 -0
- package/components/{action-group-Bf28z235.js → action-group-DzT5e9uS.js} +8 -9
- package/components/action-menu/index.cjs +9 -9
- package/components/action-menu/index.js +8 -9
- package/components/avatar/index.cjs +3 -3
- package/components/avatar/index.js +6 -7
- package/components/base-CCsOyfm4.js +632 -0
- package/components/base-CaRKlVkL.cjs +36 -0
- package/components/button/index.cjs +2 -2
- package/components/button/index.js +7 -7
- package/components/{button-base-CDLQV7Vk.js → button-base-BUylwU1F.js} +5 -6
- package/components/button-base-D62oiPcu.cjs +25 -0
- package/components/button-group/index.cjs +1 -1
- package/components/button-group/index.js +6 -6
- package/components/checkbox/index.cjs +4 -4
- package/components/checkbox/index.js +4 -4
- package/components/{checkbox-mixin-DXUIwtea.js → checkbox-mixin-CM4VUJxF.js} +9 -10
- package/components/{checkbox-mixin-DaXMsrtV.cjs → checkbox-mixin-CifGmiLR.cjs} +3 -3
- package/components/{clear-button-Dh2Mq0cc.js → clear-button-BmUyRVoz.js} +4 -4
- package/components/clear-button-Cc5-XUOJ.cjs +18 -0
- package/components/{close-button-BsYkXOVh.js → close-button-BekXo6bQ.js} +10 -10
- package/components/close-button-Bf8yzpLd.cjs +18 -0
- package/components/color-area/index.cjs +6 -6
- package/components/color-area/index.js +10 -11
- package/components/color-field/index.cjs +2 -2
- package/components/color-field/index.js +3 -3
- package/components/color-handle/index.cjs +2 -2
- package/components/color-handle/index.js +6 -6
- package/components/color-loupe/index.cjs +1 -1
- package/components/color-loupe/index.js +1 -1
- package/components/color-loupe-CLzp2MiI.cjs +56 -0
- package/components/{color-loupe-BCfIVFkB.js → color-loupe-DiegGLZu.js} +4 -4
- package/components/color-menu/index.cjs +5 -5
- package/components/color-menu/index.js +5 -7
- package/components/color-picker/index.cjs +4 -4
- package/components/color-picker/index.js +11 -13
- package/components/color-slider/index.cjs +7 -7
- package/components/color-slider/index.js +6 -7
- package/components/divider/index.cjs +1 -1
- package/components/divider/index.js +6 -6
- package/components/field-group/index.cjs +1 -1
- package/components/field-group/index.js +1 -1
- package/components/{field-group-CwZULltm.js → field-group-BPZvGJi1.js} +6 -6
- package/components/field-group-CodR_26L.cjs +23 -0
- package/components/field-label/index.cjs +1 -1
- package/components/field-label/index.js +1 -1
- package/components/{field-label-C3HFlH91.js → field-label-6AaW05kA.js} +7 -8
- package/components/field-label-B91K6moC.cjs +25 -0
- package/components/focusable-BFdecx5l.cjs +18 -0
- package/components/{focusable-zT9NFFYs.js → focusable-CxA_NMK_.js} +2 -1
- package/components/icon/index.cjs +1 -1
- package/components/icon/index.js +6 -6
- package/components/index-Cg_y7WKM.cjs +77 -0
- package/components/{index-C2qG2Sm8.js → index-QeYYAZQR.js} +15 -18
- package/components/index.cjs +1 -1
- package/components/index.js +16 -16
- package/components/infield-button/index.cjs +2 -2
- package/components/infield-button/index.js +4 -4
- package/components/label/index.cjs +1 -1
- package/components/label/index.js +5 -5
- package/components/{like-anchor-DoJWh4Uu.js → like-anchor-D7tY6am5.js} +21 -21
- package/components/like-anchor-b3cNzw52.cjs +32 -0
- package/components/{manage-help-text-BzWK2v8i.js → manage-help-text-CmE_nfjl.js} +8 -8
- package/components/{manage-help-text-BKlmmlgp.cjs → manage-help-text-CoX77cTJ.cjs} +3 -3
- package/components/menu/index.cjs +1 -1
- package/components/menu/index.js +1 -1
- package/components/multi-language-field/index.cjs +2 -2
- package/components/multi-language-field/index.js +7 -7
- package/components/number-field/index.cjs +4 -4
- package/components/number-field/index.js +16 -17
- package/components/observe-slot-text-ByPG1Lqw.cjs +18 -0
- package/components/{observe-slot-text-BG0H7bQK.js → observe-slot-text-CugmOzNZ.js} +20 -21
- package/components/overlay/index.cjs +7 -7
- package/components/overlay/index.js +45 -49
- package/components/overlay-BWBJGJN_.cjs +47 -0
- package/components/{overlay-D7EbnA6E.js → overlay-CtdbWiFs.js} +71 -74
- package/components/{pending-state-DHXuiejX.js → pending-state-B_JeaE62.js} +2 -2
- package/components/{pending-state-BHCOneQ7.cjs → pending-state-DWvTsSoS.cjs} +2 -2
- package/components/picker/index.cjs +1 -1
- package/components/picker/index.js +2 -2
- package/components/picker-CaC1rQOK.cjs +123 -0
- package/components/{picker-ChtCbFLB.js → picker-DwbcFve2.js} +109 -140
- package/components/popover/index.cjs +1 -1
- package/components/popover/index.js +1 -1
- package/components/popover-C4w3aY8m.cjs +30 -0
- package/components/{popover-bg0EQQ8p.js → popover-DLFHilGS.js} +6 -7
- package/components/progress-circle/index.cjs +1 -1
- package/components/progress-circle/index.js +1 -1
- package/components/progress-circle-BXyXtMcs.cjs +33 -0
- package/components/{progress-circle-BT2qW7LK.js → progress-circle-CUCJ_Ehs.js} +6 -7
- package/components/radio/index.cjs +2 -2
- package/components/radio/index.js +9 -10
- package/components/search/index.cjs +7 -7
- package/components/search/index.js +4 -5
- package/components/{base-BjTwmyRF.cjs → sized-mixin-DcvJLFeo.cjs} +1 -5
- package/components/{sized-mixin-PyCYpyQq.js → sized-mixin-cJbo3PKR.js} +5 -5
- package/components/slider/index.cjs +1 -1
- package/components/slider/index.js +6 -6
- package/components/{streaming-listener-wjMvsv4N.js → streaming-listener-BgCzt2TI.js} +5 -6
- package/components/streaming-listener-C2bsIc4J.cjs +18 -0
- package/components/swatch/index.cjs +7 -7
- package/components/swatch/index.js +11 -12
- package/components/switch/index.cjs +2 -2
- package/components/switch/index.js +5 -5
- package/components/tags/index.cjs +4 -4
- package/components/tags/index.js +12 -13
- package/components/text-field/index.cjs +3 -3
- package/components/text-field/index.js +8 -8
- package/components/text-field-BX_aHXSW.js +288 -0
- package/components/text-field-DAr2RyH9.cjs +81 -0
- package/components/toast/index.cjs +5 -5
- package/components/toast/index.js +5 -5
- package/components/tooltip/index.cjs +4 -4
- package/components/tooltip/index.js +6 -7
- package/components/unit-input/index.cjs +6 -6
- package/components/unit-input/index.js +5 -6
- package/components/utils.cjs +1 -1
- package/components/utils.js +4 -4
- package/package.json +1 -1
- package/components/action-group-BBoV2VL9.cjs +0 -20
- package/components/async-directive-CV2MII86.cjs +0 -22
- package/components/async-directive-FGzMycjH.js +0 -82
- package/components/base-D76d76ww.js +0 -26
- package/components/base-DNrOP9L3.js +0 -391
- package/components/base-DzbGOAPo.cjs +0 -30
- package/components/button-base-C1ceE1LF.cjs +0 -25
- package/components/clear-button-pnT9_M8M.cjs +0 -18
- package/components/close-button-CPtjRQ0R.cjs +0 -18
- package/components/color-loupe-DIBrhG1Y.cjs +0 -56
- package/components/directive-C7oCP5Bh.cjs +0 -22
- package/components/directive-helpers-BLDZnGQv.js +0 -28
- package/components/directive-helpers-C2vOfhFx.cjs +0 -22
- package/components/directive-oAbCiebi.js +0 -44
- package/components/field-group-eICRTHzI.cjs +0 -23
- package/components/field-label-DOIVL4S4.cjs +0 -25
- package/components/focusable-zn6qaMtV.cjs +0 -18
- package/components/if-defined-CYpcjGCb.js +0 -27
- package/components/if-defined-Cv6xanXh.cjs +0 -22
- package/components/index-BYumXRH5.cjs +0 -77
- package/components/like-anchor-CmIcmz5k.cjs +0 -32
- package/components/lit-html-B3ugcwD9.js +0 -248
- package/components/lit-html-p4Oxv2-5.cjs +0 -24
- package/components/observe-slot-text-CP_EB97X.cjs +0 -18
- package/components/overlay-B1JDPmUJ.cjs +0 -47
- package/components/picker-CLKdhX0B.cjs +0 -127
- package/components/popover-CdkB6GFb.cjs +0 -30
- package/components/progress-circle-DTeqfeun.cjs +0 -33
- package/components/query-BL-TJj7K.cjs +0 -22
- package/components/query-D_KR_GUc.js +0 -51
- package/components/query-assigned-elements-DjfhL1cl.js +0 -36
- package/components/query-assigned-elements-DsKsfk7G.cjs +0 -22
- package/components/query-assigned-nodes-BcKWmGzy.cjs +0 -22
- package/components/query-assigned-nodes-C76XVPWY.js +0 -36
- package/components/sized-mixin-BEemErtP.cjs +0 -18
- package/components/state-BG4JQVA1.js +0 -29
- package/components/state-DHaIxrnQ.cjs +0 -22
- package/components/streaming-listener-BQxEN4sL.cjs +0 -18
- package/components/style-map-BjBGQ_u3.cjs +0 -22
- package/components/style-map-BqvQDFJt.js +0 -53
- package/components/text-field-7ITo3Lac.js +0 -315
- package/components/text-field-CtUKbEQN.cjs +0 -85
- package/components/when-CDK1Tt5Y.js +0 -28
- package/components/when-CDZyJPvd.cjs +0 -22
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/*! * Lucero - The design system for Luzmo.
|
|
2
|
-
*
|
|
3
|
-
* Copyright © 2025 Luzmo
|
|
4
|
-
* All rights reserved.
|
|
5
|
-
* Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
|
|
6
|
-
* This license allows users with a current active Luzmo account to use Lucero.
|
|
7
|
-
* This license terminates automatically if a user no longer has an active Luzmo account.
|
|
8
|
-
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
9
|
-
*
|
|
10
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
11
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
12
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
13
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
14
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
15
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
|
-
* SOFTWARE.
|
|
17
|
-
* */
|
|
18
|
-
"use strict";const h=require("lit"),t=require("./base-DzbGOAPo.cjs"),r=require("./if-defined-Cv6xanXh.cjs");var f=Object.defineProperty,i=(l,e,s,d)=>{for(var o=void 0,n=l.length-1,a;n>=0;n--)(a=l[n])&&(o=a(e,s,o)||o);return o&&f(e,s,o),o};function $(l){class e extends l{renderAnchor({id:d,className:o,ariaHidden:n,labelledby:a,tabindex:p,anchorContent:c=h.html`<slot></slot>`}){return h.html`
|
|
19
|
-
<a
|
|
20
|
-
id=${d}
|
|
21
|
-
class=${r.o(o)}
|
|
22
|
-
href=${r.o(this.href)}
|
|
23
|
-
download=${r.o(this.download)}
|
|
24
|
-
target=${r.o(this.target)}
|
|
25
|
-
aria-label=${r.o(this.label)}
|
|
26
|
-
aria-labelledby=${r.o(a)}
|
|
27
|
-
aria-hidden=${r.o(n?"true":void 0)}
|
|
28
|
-
tabindex=${r.o(p)}
|
|
29
|
-
referrerpolicy=${r.o(this.referrerpolicy)}
|
|
30
|
-
rel=${r.o(this.rel)}
|
|
31
|
-
>${c}</a>
|
|
32
|
-
`}}return i([t.n()],e.prototype,"download"),i([t.n()],e.prototype,"label"),i([t.n()],e.prototype,"href"),i([t.n()],e.prototype,"target"),i([t.n()],e.prototype,"referrerpolicy"),i([t.n()],e.prototype,"rel"),e}exports.LikeAnchor=$;
|
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
/*! * Lucero - The design system for Luzmo.
|
|
2
|
-
*
|
|
3
|
-
* Copyright © 2025 Luzmo
|
|
4
|
-
* All rights reserved.
|
|
5
|
-
* Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
|
|
6
|
-
* This license allows users with a current active Luzmo account to use Lucero.
|
|
7
|
-
* This license terminates automatically if a user no longer has an active Luzmo account.
|
|
8
|
-
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
9
|
-
*
|
|
10
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
11
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
12
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
13
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
14
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
15
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
|
-
* SOFTWARE.
|
|
17
|
-
* */
|
|
18
|
-
/**
|
|
19
|
-
* @license
|
|
20
|
-
* Copyright 2017 Google LLC
|
|
21
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
-
*/
|
|
23
|
-
const y = globalThis, b = y.trustedTypes, U = b ? b.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, W = "$lit$", p = `lit$${Math.random().toFixed(9).slice(2)}$`, k = "?" + p, D = `<${k}>`, f = document, C = () => f.createComment(""), x = (r) => r === null || typeof r != "object" && typeof r != "function", I = Array.isArray, z = (r) => I(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", w = `[
|
|
24
|
-
\f\r]`, v = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, O = /-->/g, R = />/g, u = RegExp(`>|${w}(?:([^\\s"'>=/]+)(${w}*=${w}*(?:[^
|
|
25
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), B = /'/g, L = /"/g, V = /^(?:script|style|textarea|title)$/i, H = Symbol.for("lit-noChange"), A = Symbol.for("lit-nothing"), P = /* @__PURE__ */ new WeakMap(), g = f.createTreeWalker(f, 129);
|
|
26
|
-
function j(r, t) {
|
|
27
|
-
if (!I(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
28
|
-
return U !== void 0 ? U.createHTML(t) : t;
|
|
29
|
-
}
|
|
30
|
-
const Z = (r, t) => {
|
|
31
|
-
const s = r.length - 1, i = [];
|
|
32
|
-
let e, h = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = v;
|
|
33
|
-
for (let a = 0; a < s; a++) {
|
|
34
|
-
const o = r[a];
|
|
35
|
-
let $, _, l = -1, c = 0;
|
|
36
|
-
for (; c < o.length && (n.lastIndex = c, _ = n.exec(o), _ !== null); ) c = n.lastIndex, n === v ? _[1] === "!--" ? n = O : _[1] !== void 0 ? n = R : _[2] !== void 0 ? (V.test(_[2]) && (e = RegExp("</" + _[2], "g")), n = u) : _[3] !== void 0 && (n = u) : n === u ? _[0] === ">" ? (n = e ?? v, l = -1) : _[1] === void 0 ? l = -2 : (l = n.lastIndex - _[2].length, $ = _[1], n = _[3] === void 0 ? u : _[3] === '"' ? L : B) : n === L || n === B ? n = u : n === O || n === R ? n = v : (n = u, e = void 0);
|
|
37
|
-
const d = n === u && r[a + 1].startsWith("/>") ? " " : "";
|
|
38
|
-
h += n === v ? o + D : l >= 0 ? (i.push($), o.slice(0, l) + W + o.slice(l) + p + d) : o + p + (l === -2 ? a : d);
|
|
39
|
-
}
|
|
40
|
-
return [j(r, h + (r[s] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
|
|
41
|
-
};
|
|
42
|
-
class N {
|
|
43
|
-
constructor({ strings: t, _$litType$: s }, i) {
|
|
44
|
-
let e;
|
|
45
|
-
this.parts = [];
|
|
46
|
-
let h = 0, n = 0;
|
|
47
|
-
const a = t.length - 1, o = this.parts, [$, _] = Z(t, s);
|
|
48
|
-
if (this.el = N.createElement($, i), g.currentNode = this.el.content, s === 2 || s === 3) {
|
|
49
|
-
const l = this.el.content.firstChild;
|
|
50
|
-
l.replaceWith(...l.childNodes);
|
|
51
|
-
}
|
|
52
|
-
for (; (e = g.nextNode()) !== null && o.length < a; ) {
|
|
53
|
-
if (e.nodeType === 1) {
|
|
54
|
-
if (e.hasAttributes()) for (const l of e.getAttributeNames()) if (l.endsWith(W)) {
|
|
55
|
-
const c = _[n++], d = e.getAttribute(l).split(p), T = /([.?@])?(.*)/.exec(c);
|
|
56
|
-
o.push({ type: 1, index: h, name: T[2], strings: d, ctor: T[1] === "." ? q : T[1] === "?" ? G : T[1] === "@" ? J : S }), e.removeAttribute(l);
|
|
57
|
-
} else l.startsWith(p) && (o.push({ type: 6, index: h }), e.removeAttribute(l));
|
|
58
|
-
if (V.test(e.tagName)) {
|
|
59
|
-
const l = e.textContent.split(p), c = l.length - 1;
|
|
60
|
-
if (c > 0) {
|
|
61
|
-
e.textContent = b ? b.emptyScript : "";
|
|
62
|
-
for (let d = 0; d < c; d++) e.append(l[d], C()), g.nextNode(), o.push({ type: 2, index: ++h });
|
|
63
|
-
e.append(l[c], C());
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
} else if (e.nodeType === 8) if (e.data === k) o.push({ type: 2, index: h });
|
|
67
|
-
else {
|
|
68
|
-
let l = -1;
|
|
69
|
-
for (; (l = e.data.indexOf(p, l + 1)) !== -1; ) o.push({ type: 7, index: h }), l += p.length - 1;
|
|
70
|
-
}
|
|
71
|
-
h++;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
static createElement(t, s) {
|
|
75
|
-
const i = f.createElement("template");
|
|
76
|
-
return i.innerHTML = t, i;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
function m(r, t, s = r, i) {
|
|
80
|
-
var n, a;
|
|
81
|
-
if (t === H) return t;
|
|
82
|
-
let e = i !== void 0 ? (n = s._$Co) == null ? void 0 : n[i] : s._$Cl;
|
|
83
|
-
const h = x(t) ? void 0 : t._$litDirective$;
|
|
84
|
-
return (e == null ? void 0 : e.constructor) !== h && ((a = e == null ? void 0 : e._$AO) == null || a.call(e, !1), h === void 0 ? e = void 0 : (e = new h(r), e._$AT(r, s, i)), i !== void 0 ? (s._$Co ?? (s._$Co = []))[i] = e : s._$Cl = e), e !== void 0 && (t = m(r, e._$AS(r, t.values), e, i)), t;
|
|
85
|
-
}
|
|
86
|
-
class F {
|
|
87
|
-
constructor(t, s) {
|
|
88
|
-
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = s;
|
|
89
|
-
}
|
|
90
|
-
get parentNode() {
|
|
91
|
-
return this._$AM.parentNode;
|
|
92
|
-
}
|
|
93
|
-
get _$AU() {
|
|
94
|
-
return this._$AM._$AU;
|
|
95
|
-
}
|
|
96
|
-
u(t) {
|
|
97
|
-
const { el: { content: s }, parts: i } = this._$AD, e = ((t == null ? void 0 : t.creationScope) ?? f).importNode(s, !0);
|
|
98
|
-
g.currentNode = e;
|
|
99
|
-
let h = g.nextNode(), n = 0, a = 0, o = i[0];
|
|
100
|
-
for (; o !== void 0; ) {
|
|
101
|
-
if (n === o.index) {
|
|
102
|
-
let $;
|
|
103
|
-
o.type === 2 ? $ = new M(h, h.nextSibling, this, t) : o.type === 1 ? $ = new o.ctor(h, o.name, o.strings, this, t) : o.type === 6 && ($ = new K(h, this, t)), this._$AV.push($), o = i[++a];
|
|
104
|
-
}
|
|
105
|
-
n !== (o == null ? void 0 : o.index) && (h = g.nextNode(), n++);
|
|
106
|
-
}
|
|
107
|
-
return g.currentNode = f, e;
|
|
108
|
-
}
|
|
109
|
-
p(t) {
|
|
110
|
-
let s = 0;
|
|
111
|
-
for (const i of this._$AV) i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, s), s += i.strings.length - 2) : i._$AI(t[s])), s++;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
class M {
|
|
115
|
-
get _$AU() {
|
|
116
|
-
var t;
|
|
117
|
-
return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
|
|
118
|
-
}
|
|
119
|
-
constructor(t, s, i, e) {
|
|
120
|
-
this.type = 2, this._$AH = A, this._$AN = void 0, this._$AA = t, this._$AB = s, this._$AM = i, this.options = e, this._$Cv = (e == null ? void 0 : e.isConnected) ?? !0;
|
|
121
|
-
}
|
|
122
|
-
get parentNode() {
|
|
123
|
-
let t = this._$AA.parentNode;
|
|
124
|
-
const s = this._$AM;
|
|
125
|
-
return s !== void 0 && (t == null ? void 0 : t.nodeType) === 11 && (t = s.parentNode), t;
|
|
126
|
-
}
|
|
127
|
-
get startNode() {
|
|
128
|
-
return this._$AA;
|
|
129
|
-
}
|
|
130
|
-
get endNode() {
|
|
131
|
-
return this._$AB;
|
|
132
|
-
}
|
|
133
|
-
_$AI(t, s = this) {
|
|
134
|
-
t = m(this, t, s), x(t) ? t === A || t == null || t === "" ? (this._$AH !== A && this._$AR(), this._$AH = A) : t !== this._$AH && t !== H && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : z(t) ? this.k(t) : this._(t);
|
|
135
|
-
}
|
|
136
|
-
O(t) {
|
|
137
|
-
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
138
|
-
}
|
|
139
|
-
T(t) {
|
|
140
|
-
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
141
|
-
}
|
|
142
|
-
_(t) {
|
|
143
|
-
this._$AH !== A && x(this._$AH) ? this._$AA.nextSibling.data = t : this.T(f.createTextNode(t)), this._$AH = t;
|
|
144
|
-
}
|
|
145
|
-
$(t) {
|
|
146
|
-
var h;
|
|
147
|
-
const { values: s, _$litType$: i } = t, e = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = N.createElement(j(i.h, i.h[0]), this.options)), i);
|
|
148
|
-
if (((h = this._$AH) == null ? void 0 : h._$AD) === e) this._$AH.p(s);
|
|
149
|
-
else {
|
|
150
|
-
const n = new F(e, this), a = n.u(this.options);
|
|
151
|
-
n.p(s), this.T(a), this._$AH = n;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
_$AC(t) {
|
|
155
|
-
let s = P.get(t.strings);
|
|
156
|
-
return s === void 0 && P.set(t.strings, s = new N(t)), s;
|
|
157
|
-
}
|
|
158
|
-
k(t) {
|
|
159
|
-
I(this._$AH) || (this._$AH = [], this._$AR());
|
|
160
|
-
const s = this._$AH;
|
|
161
|
-
let i, e = 0;
|
|
162
|
-
for (const h of t) e === s.length ? s.push(i = new M(this.O(C()), this.O(C()), this, this.options)) : i = s[e], i._$AI(h), e++;
|
|
163
|
-
e < s.length && (this._$AR(i && i._$AB.nextSibling, e), s.length = e);
|
|
164
|
-
}
|
|
165
|
-
_$AR(t = this._$AA.nextSibling, s) {
|
|
166
|
-
var i;
|
|
167
|
-
for ((i = this._$AP) == null ? void 0 : i.call(this, !1, !0, s); t && t !== this._$AB; ) {
|
|
168
|
-
const e = t.nextSibling;
|
|
169
|
-
t.remove(), t = e;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
setConnected(t) {
|
|
173
|
-
var s;
|
|
174
|
-
this._$AM === void 0 && (this._$Cv = t, (s = this._$AP) == null || s.call(this, t));
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
class S {
|
|
178
|
-
get tagName() {
|
|
179
|
-
return this.element.tagName;
|
|
180
|
-
}
|
|
181
|
-
get _$AU() {
|
|
182
|
-
return this._$AM._$AU;
|
|
183
|
-
}
|
|
184
|
-
constructor(t, s, i, e, h) {
|
|
185
|
-
this.type = 1, this._$AH = A, this._$AN = void 0, this.element = t, this.name = s, this._$AM = e, this.options = h, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = A;
|
|
186
|
-
}
|
|
187
|
-
_$AI(t, s = this, i, e) {
|
|
188
|
-
const h = this.strings;
|
|
189
|
-
let n = !1;
|
|
190
|
-
if (h === void 0) t = m(this, t, s, 0), n = !x(t) || t !== this._$AH && t !== H, n && (this._$AH = t);
|
|
191
|
-
else {
|
|
192
|
-
const a = t;
|
|
193
|
-
let o, $;
|
|
194
|
-
for (t = h[0], o = 0; o < h.length - 1; o++) $ = m(this, a[i + o], s, o), $ === H && ($ = this._$AH[o]), n || (n = !x($) || $ !== this._$AH[o]), $ === A ? t = A : t !== A && (t += ($ ?? "") + h[o + 1]), this._$AH[o] = $;
|
|
195
|
-
}
|
|
196
|
-
n && !e && this.j(t);
|
|
197
|
-
}
|
|
198
|
-
j(t) {
|
|
199
|
-
t === A ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
class q extends S {
|
|
203
|
-
constructor() {
|
|
204
|
-
super(...arguments), this.type = 3;
|
|
205
|
-
}
|
|
206
|
-
j(t) {
|
|
207
|
-
this.element[this.name] = t === A ? void 0 : t;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
class G extends S {
|
|
211
|
-
constructor() {
|
|
212
|
-
super(...arguments), this.type = 4;
|
|
213
|
-
}
|
|
214
|
-
j(t) {
|
|
215
|
-
this.element.toggleAttribute(this.name, !!t && t !== A);
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
class J extends S {
|
|
219
|
-
constructor(t, s, i, e, h) {
|
|
220
|
-
super(t, s, i, e, h), this.type = 5;
|
|
221
|
-
}
|
|
222
|
-
_$AI(t, s = this) {
|
|
223
|
-
if ((t = m(this, t, s, 0) ?? A) === H) return;
|
|
224
|
-
const i = this._$AH, e = t === A && i !== A || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, h = t !== A && (i === A || e);
|
|
225
|
-
e && this.element.removeEventListener(this.name, this, i), h && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
226
|
-
}
|
|
227
|
-
handleEvent(t) {
|
|
228
|
-
var s;
|
|
229
|
-
typeof this._$AH == "function" ? this._$AH.call(((s = this.options) == null ? void 0 : s.host) ?? this.element, t) : this._$AH.handleEvent(t);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
class K {
|
|
233
|
-
constructor(t, s, i) {
|
|
234
|
-
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = s, this.options = i;
|
|
235
|
-
}
|
|
236
|
-
get _$AU() {
|
|
237
|
-
return this._$AM._$AU;
|
|
238
|
-
}
|
|
239
|
-
_$AI(t) {
|
|
240
|
-
m(this, t);
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
const E = y.litHtmlPolyfillSupport;
|
|
244
|
-
E == null || E(N, M), (y.litHtmlVersions ?? (y.litHtmlVersions = [])).push("3.2.1");
|
|
245
|
-
export {
|
|
246
|
-
A as E,
|
|
247
|
-
H as T
|
|
248
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/*! * Lucero - The design system for Luzmo.
|
|
2
|
-
*
|
|
3
|
-
* Copyright © 2025 Luzmo
|
|
4
|
-
* All rights reserved.
|
|
5
|
-
* Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
|
|
6
|
-
* This license allows users with a current active Luzmo account to use Lucero.
|
|
7
|
-
* This license terminates automatically if a user no longer has an active Luzmo account.
|
|
8
|
-
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
9
|
-
*
|
|
10
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
11
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
12
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
13
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
14
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
15
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
|
-
* SOFTWARE.
|
|
17
|
-
* */
|
|
18
|
-
"use strict";/**
|
|
19
|
-
* @license
|
|
20
|
-
* Copyright 2017 Google LLC
|
|
21
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
-
*/const H=globalThis,b=H.trustedTypes,U=b?b.createPolicy("lit-html",{createHTML:r=>r}):void 0,W="$lit$",p=`lit$${Math.random().toFixed(9).slice(2)}$`,k="?"+p,D=`<${k}>`,f=document,C=()=>f.createComment(""),x=r=>r===null||typeof r!="object"&&typeof r!="function",I=Array.isArray,z=r=>I(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",E=`[
|
|
23
|
-
\f\r]`,y=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,O=/-->/g,R=/>/g,u=RegExp(`>|${E}(?:([^\\s"'>=/]+)(${E}*=${E}*(?:[^
|
|
24
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),B=/'/g,L=/"/g,V=/^(?:script|style|textarea|title)$/i,m=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),P=new WeakMap,g=f.createTreeWalker(f,129);function j(r,t){if(!I(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return U!==void 0?U.createHTML(t):t}const Z=(r,t)=>{const s=r.length-1,i=[];let e,h=t===2?"<svg>":t===3?"<math>":"",n=y;for(let a=0;a<s;a++){const o=r[a];let A,c,l=-1,_=0;for(;_<o.length&&(n.lastIndex=_,c=n.exec(o),c!==null);)_=n.lastIndex,n===y?c[1]==="!--"?n=O:c[1]!==void 0?n=R:c[2]!==void 0?(V.test(c[2])&&(e=RegExp("</"+c[2],"g")),n=u):c[3]!==void 0&&(n=u):n===u?c[0]===">"?(n=e??y,l=-1):c[1]===void 0?l=-2:(l=n.lastIndex-c[2].length,A=c[1],n=c[3]===void 0?u:c[3]==='"'?L:B):n===L||n===B?n=u:n===O||n===R?n=y:(n=u,e=void 0);const d=n===u&&r[a+1].startsWith("/>")?" ":"";h+=n===y?o+D:l>=0?(i.push(A),o.slice(0,l)+W+o.slice(l)+p+d):o+p+(l===-2?a:d)}return[j(r,h+(r[s]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]};class N{constructor({strings:t,_$litType$:s},i){let e;this.parts=[];let h=0,n=0;const a=t.length-1,o=this.parts,[A,c]=Z(t,s);if(this.el=N.createElement(A,i),g.currentNode=this.el.content,s===2||s===3){const l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(e=g.nextNode())!==null&&o.length<a;){if(e.nodeType===1){if(e.hasAttributes())for(const l of e.getAttributeNames())if(l.endsWith(W)){const _=c[n++],d=e.getAttribute(l).split(p),T=/([.?@])?(.*)/.exec(_);o.push({type:1,index:h,name:T[2],strings:d,ctor:T[1]==="."?q:T[1]==="?"?G:T[1]==="@"?J:S}),e.removeAttribute(l)}else l.startsWith(p)&&(o.push({type:6,index:h}),e.removeAttribute(l));if(V.test(e.tagName)){const l=e.textContent.split(p),_=l.length-1;if(_>0){e.textContent=b?b.emptyScript:"";for(let d=0;d<_;d++)e.append(l[d],C()),g.nextNode(),o.push({type:2,index:++h});e.append(l[_],C())}}}else if(e.nodeType===8)if(e.data===k)o.push({type:2,index:h});else{let l=-1;for(;(l=e.data.indexOf(p,l+1))!==-1;)o.push({type:7,index:h}),l+=p.length-1}h++}}static createElement(t,s){const i=f.createElement("template");return i.innerHTML=t,i}}function v(r,t,s=r,i){var n,a;if(t===m)return t;let e=i!==void 0?(n=s._$Co)==null?void 0:n[i]:s._$Cl;const h=x(t)?void 0:t._$litDirective$;return(e==null?void 0:e.constructor)!==h&&((a=e==null?void 0:e._$AO)==null||a.call(e,!1),h===void 0?e=void 0:(e=new h(r),e._$AT(r,s,i)),i!==void 0?(s._$Co??(s._$Co=[]))[i]=e:s._$Cl=e),e!==void 0&&(t=v(r,e._$AS(r,t.values),e,i)),t}class F{constructor(t,s){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=s}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:s},parts:i}=this._$AD,e=((t==null?void 0:t.creationScope)??f).importNode(s,!0);g.currentNode=e;let h=g.nextNode(),n=0,a=0,o=i[0];for(;o!==void 0;){if(n===o.index){let A;o.type===2?A=new M(h,h.nextSibling,this,t):o.type===1?A=new o.ctor(h,o.name,o.strings,this,t):o.type===6&&(A=new K(h,this,t)),this._$AV.push(A),o=i[++a]}n!==(o==null?void 0:o.index)&&(h=g.nextNode(),n++)}return g.currentNode=f,e}p(t){let s=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,s),s+=i.strings.length-2):i._$AI(t[s])),s++}}class M{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,s,i,e){this.type=2,this._$AH=$,this._$AN=void 0,this._$AA=t,this._$AB=s,this._$AM=i,this.options=e,this._$Cv=(e==null?void 0:e.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const s=this._$AM;return s!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=s.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,s=this){t=v(this,t,s),x(t)?t===$||t==null||t===""?(this._$AH!==$&&this._$AR(),this._$AH=$):t!==this._$AH&&t!==m&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):z(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==$&&x(this._$AH)?this._$AA.nextSibling.data=t:this.T(f.createTextNode(t)),this._$AH=t}$(t){var h;const{values:s,_$litType$:i}=t,e=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=N.createElement(j(i.h,i.h[0]),this.options)),i);if(((h=this._$AH)==null?void 0:h._$AD)===e)this._$AH.p(s);else{const n=new F(e,this),a=n.u(this.options);n.p(s),this.T(a),this._$AH=n}}_$AC(t){let s=P.get(t.strings);return s===void 0&&P.set(t.strings,s=new N(t)),s}k(t){I(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let i,e=0;for(const h of t)e===s.length?s.push(i=new M(this.O(C()),this.O(C()),this,this.options)):i=s[e],i._$AI(h),e++;e<s.length&&(this._$AR(i&&i._$AB.nextSibling,e),s.length=e)}_$AR(t=this._$AA.nextSibling,s){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,s);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var s;this._$AM===void 0&&(this._$Cv=t,(s=this._$AP)==null||s.call(this,t))}}class S{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,s,i,e,h){this.type=1,this._$AH=$,this._$AN=void 0,this.element=t,this.name=s,this._$AM=e,this.options=h,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=$}_$AI(t,s=this,i,e){const h=this.strings;let n=!1;if(h===void 0)t=v(this,t,s,0),n=!x(t)||t!==this._$AH&&t!==m,n&&(this._$AH=t);else{const a=t;let o,A;for(t=h[0],o=0;o<h.length-1;o++)A=v(this,a[i+o],s,o),A===m&&(A=this._$AH[o]),n||(n=!x(A)||A!==this._$AH[o]),A===$?t=$:t!==$&&(t+=(A??"")+h[o+1]),this._$AH[o]=A}n&&!e&&this.j(t)}j(t){t===$?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class q extends S{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===$?void 0:t}}class G extends S{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==$)}}class J extends S{constructor(t,s,i,e,h){super(t,s,i,e,h),this.type=5}_$AI(t,s=this){if((t=v(this,t,s,0)??$)===m)return;const i=this._$AH,e=t===$&&i!==$||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,h=t!==$&&(i===$||e);e&&this.element.removeEventListener(this.name,this,i),h&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var s;typeof this._$AH=="function"?this._$AH.call(((s=this.options)==null?void 0:s.host)??this.element,t):this._$AH.handleEvent(t)}}class K{constructor(t,s,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=s,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){v(this,t)}}const w=H.litHtmlPolyfillSupport;w==null||w(N,M),(H.litHtmlVersions??(H.litHtmlVersions=[])).push("3.2.1");exports.E=$;exports.T=m;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*! * Lucero - The design system for Luzmo.
|
|
2
|
-
*
|
|
3
|
-
* Copyright © 2025 Luzmo
|
|
4
|
-
* All rights reserved.
|
|
5
|
-
* Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
|
|
6
|
-
* This license allows users with a current active Luzmo account to use Lucero.
|
|
7
|
-
* This license terminates automatically if a user no longer has an active Luzmo account.
|
|
8
|
-
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
9
|
-
*
|
|
10
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
11
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
12
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
13
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
14
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
15
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
|
-
* SOFTWARE.
|
|
17
|
-
* */
|
|
18
|
-
"use strict";const b=require("./mutation-controller-DkOMCW-c.cjs"),g=require("./base-DzbGOAPo.cjs"),x=require("./query-assigned-nodes-BcKWmGzy.cjs");var m=Object.defineProperty,h=(d,n,i,u)=>{for(var t=void 0,r=d.length-1,o;r>=0;r--)(o=d[r])&&(t=o(n,i,t)||t);return t&&m(n,i,t),t};const c=Symbol("assignedNodes");function v(d,n,i=[]){var u,t;const r=f=>e=>f.matches(e);class o extends(t=d,u=c,t){constructor(...e){super(e),this.slotHasContent=!1,new b.s(this,{config:{characterData:!0,subtree:!0},callback:l=>{for(const s of l)if(s.type==="characterData"){this.manageTextObservedSlot();return}}})}manageTextObservedSlot(){if(!this[c])return;const e=[...this[c]].filter(l=>{const s=l;return s.tagName?!i.some(r(s)):s.textContent?s.textContent.trim():!1});this.slotHasContent=e.length>0}update(e){if(!this.hasUpdated){const{childNodes:l}=this,s=[...l].filter(p=>{const a=p;return a.tagName?i.some(r(a))?!1:n?a.getAttribute("slot")===n:!a.hasAttribute("slot"):a.textContent?a.textContent.trim():!1});this.slotHasContent=s.length>0}super.update(e)}firstUpdated(e){super.firstUpdated(e),this.updateComplete.then(()=>{this.manageTextObservedSlot()})}}return h([g.n({type:Boolean,attribute:!1})],o.prototype,"slotHasContent"),h([x.n({slot:n,flatten:!0})],o.prototype,u),o}exports.ObserveSlotText=v;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/*! * Lucero - The design system for Luzmo.
|
|
2
|
-
*
|
|
3
|
-
* Copyright © 2025 Luzmo
|
|
4
|
-
* All rights reserved.
|
|
5
|
-
* Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
|
|
6
|
-
* This license allows users with a current active Luzmo account to use Lucero.
|
|
7
|
-
* This license terminates automatically if a user no longer has an active Luzmo account.
|
|
8
|
-
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
9
|
-
*
|
|
10
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
11
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
12
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
13
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
14
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
15
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
|
-
* SOFTWARE.
|
|
17
|
-
* */
|
|
18
|
-
"use strict";const lt=require("lit"),D=require("./base-DzbGOAPo.cjs"),Ee=require("./state-DHaIxrnQ.cjs"),ne=require("./query-BL-TJj7K.cjs"),Ce=require("./query-assigned-elements-DsKsfk7G.cjs"),At=require("./if-defined-Cv6xanXh.cjs"),Ut=require("./style-map-BjBGQ_u3.cjs"),Ft=require("./random-id-CqvckpWe.cjs"),jt=require("./element-resolution-BvRLGqIU.cjs"),ht=require("./focusable-selectors-BgFlyFcY.cjs"),Kt=require("./slottable-request-event-BfUUt1Mh.cjs"),Dt=require("./condition-attribute-with-id-DrQYZzFS.cjs"),Yt=require("./platform-BiXhwqk3.cjs");function Pe(e,t,i=[]){for(const[n,o]of t.entries()){const s=e[n],r=s.parentElement||s.getRootNode();i[n]&&i[n](o),r&&r!==s&&s.replaceWith(o),delete e[n]}return t}const Oe=(e,t,{position:i,prepareCallback:n}={position:"beforeend"})=>{let{length:o}=e;if(o===0)return()=>e;let s=1,r=0;(i==="afterbegin"||i==="afterend")&&(s=-1,r=o-1);const l=new Array(o),a=new Array(o),h=document.createComment("placeholder for reparented element");do{const c=e[r];n&&(a[r]=n(c)),l[r]=h.cloneNode();const d=c.parentElement||c.getRootNode();d&&d!==c&&d.replaceChild(l[r],c),t.insertAdjacentElement(i,c),r+=s}while(--o>0);return function(){return Pe(l,e,a)}},Te=1e3,Ae=1e3;class Re{constructor(t={}){this.warmUpDelay=Te,this.coolDownDelay=Ae,this.isWarm=!1,this.timeout=0,Object.assign(this,t)}openTimer(t){if(this.cancelCooldownTimer(),!this.component||t!==this.component)return this.component&&(this.close(this.component),this.cancelCooldownTimer()),this.component=t,this.isWarm?Promise.resolve(!1):(this.promise=new Promise(i=>{this.resolve=i,this.timeout=window.setTimeout(()=>{this.resolve&&(this.resolve(!1),this.isWarm=!0)},this.warmUpDelay)}),this.promise);if(this.promise)return this.promise;throw new Error("Inconsistent state")}close(t){this.component&&this.component===t&&(this.resetCooldownTimer(),this.timeout>0&&(clearTimeout(this.timeout),this.timeout=0),this.resolve&&(this.resolve(!0),delete this.resolve),delete this.promise,delete this.component)}resetCooldownTimer(){this.isWarm&&(this.cooldownTimeout&&window.clearTimeout(this.cooldownTimeout),this.cooldownTimeout=window.setTimeout(()=>{this.isWarm=!1,delete this.cooldownTimeout},this.coolDownDelay))}cancelCooldownTimer(){this.cooldownTimeout&&window.clearTimeout(this.cooldownTimeout),delete this.cooldownTimeout}}const at=new Re,Y=()=>{},Et=(e,t,i)=>{const n=new AbortController,o=new Map,s=()=>{n.abort(),i()};let r,l;const a=requestAnimationFrame(()=>{r=requestAnimationFrame(()=>{l=requestAnimationFrame(()=>{s()})})}),h=d=>{d.target===e&&(o.set(d.propertyName,o.get(d.propertyName)-1),o.get(d.propertyName)||o.delete(d.propertyName),o.size===0&&s())},c=d=>{d.target===e&&(o.has(d.propertyName)||o.set(d.propertyName,0),o.set(d.propertyName,o.get(d.propertyName)+1),cancelAnimationFrame(a),cancelAnimationFrame(r),cancelAnimationFrame(l))};e.addEventListener("transitionrun",c,{signal:n.signal}),e.addEventListener("transitionend",h,{signal:n.signal}),e.addEventListener("transitioncancel",h,{signal:n.signal}),t()};function A(){return new Promise(e=>requestAnimationFrame(()=>e()))}class it extends D.LuzmoElement{constructor(){super(...arguments),this.dispose=Y,this.offset=0,this.willPreventClose=!1}applyFocus(t,i){}get delayed(){return!1}set delayed(t){}get disabled(){return!1}set disabled(t){}get elementResolver(){return this._elementResolver}set elementResolver(t){this._elementResolver=t}ensureOnDOM(t){}makeTransition(t){return null}manageDelay(t){}manageDialogOpen(){}managePopoverOpen(){}managePosition(){}get open(){return!1}set open(t){}get placementController(){return this._placementController}set placementController(t){this._placementController=t}requestSlottable(){}returnFocus(){}get state(){return"closed"}set state(t){}manuallyKeepOpen(){}static update(){const t=new CustomEvent("luzmo-update-overlays",{bubbles:!0,composed:!0,cancelable:!0});document.dispatchEvent(t)}static async open(t,i,n,o){await Promise.resolve().then(()=>xt);const s=arguments.length===2,r=n||t,l=new this;let a=!1;const h=Oe([r],l,{position:"beforeend",prepareCallback:f=>{const u=f.slot;return f.removeAttribute("slot"),()=>{f.slot=u}}});if(l.dispose=()=>{l.addEventListener("luzmo-closed",()=>{a||(h(),a=!0),requestAnimationFrame(()=>{l.remove()})}),l.open=!1,l.dispose=Y},!s&&r&&o){const f=t,u=i,p=o;return it.applyOptions(l,{...p,delayed:p.delayed||r.hasAttribute("delayed"),trigger:p.virtualTrigger||f,type:u==="modal"?"modal":u==="hover"?"hint":"auto"}),f.after(l),await l.updateComplete,l.open=!0,l.dispose}const d=i;return l.append(r),it.applyOptions(l,{...d,delayed:d.delayed||r.hasAttribute("delayed")}),l.updateComplete.then(()=>{l.open=!0}),l}static applyOptions(t,i){t.delayed=!!i.delayed,t.receivesFocus=i.receivesFocus??"auto",t.triggerElement=i.trigger||null,t.type=i.type||"modal",t.offset=i.offset??0,t.placement=i.placement,t.willPreventClose=!!i.notImmediatelyClosable}}const zt=e=>e.querySelector(ht.userFocusableSelector),Nt=e=>e.assignedElements().find(i=>i.matches(ht.userFocusableSelector));class _t extends Event{constructor(){super("beforetoggle",{bubbles:!1,composed:!1}),this.currentState="open",this.newState="closed"}}class qt extends Event{constructor(){super("beforetoggle",{bubbles:!1,composed:!1}),this.currentState="closed",this.newState="open"}}class k extends Event{constructor(t,i,{publish:n,interaction:o,reason:s}){super(t,{bubbles:n,composed:n}),this.overlay=i,this.detail={interaction:o,reason:s}}}class dt{constructor(t,i){this.x=0,this.y=0,this.x=t,this.y=i}updateBoundingClientRect(t,i){this.x=t,this.y=i,it.update()}getBoundingClientRect(){return{width:0,height:0,top:this.y,right:this.x,y:this.y,x:this.x,bottom:this.y,left:this.x,toJSON(){}}}}function De(e){class t extends e{async manageDialogOpen(){const n=this.open;if(await A(),await this.managePosition(),this.open!==n)return;const o=await this.dialogMakeTransition(n);this.open===n&&await this.dialogApplyFocus(n,o)}dialogMakeTransition(n){let o=null;const s=(l,a)=>()=>{if(l.open=n,!n){const c=()=>{l.removeEventListener("close",c)};l.addEventListener("close",c)}if(a>0)return;const h=n?qt:_t;this.dispatchEvent(new h),n&&(l.matches(ht.userFocusableSelector)&&(o=l),o=o||zt(l),o||l.querySelectorAll("slot").forEach(d=>{o||(o=Nt(d))}),!(!this.isConnected||this.dialogEl.open)&&this.dialogEl.showModal())},r=(l,a)=>()=>{if(this.open!==n)return;const h=n?"luzmo-opened":"luzmo-closed";if(a>0){l.dispatchEvent(new k(h,this,{interaction:this.type,publish:!1}));return}if(!this.isConnected||n!==this.open)return;const c=async()=>{const d=this.triggerElement instanceof dt;this.dispatchEvent(new k(h,this,{interaction:this.type,publish:d})),l.dispatchEvent(new k(h,this,{interaction:this.type,publish:!1})),this.triggerElement&&!d&&this.triggerElement.dispatchEvent(new k(h,this,{interaction:this.type,publish:!0})),this.state=n?"opened":"closed",this.returnFocus(),await A(),await A(),n===this.open&&n===!1&&this.requestSlottable()};!n&&this.dialogEl.open?(this.dialogEl.addEventListener("close",()=>{c()},{once:!0}),this.dialogEl.close()):c()};return this.elements.forEach((l,a)=>{Et(l,s(l,a),r(l,a))}),o}dialogApplyFocus(n,o){this.applyFocus(n,o)}}return t}function Le(e){class t extends e{async managePopoverOpen(){await this.managePosition()}async manageDelay(n){if(n===!1||n!==this.open){at.close(this);return}this.delayed&&await at.openTimer(this)&&(this.open=!n)}ensureOnDOM(n){document.body.offsetHeight}makeTransition(n){if(this.open!==n)return null;let o=null;const s=(l,a)=>()=>{if(n!==this.open)return;if(l.open=n,a===0){const c=n?qt:_t;this.dispatchEvent(new c)}if(n!==!0||(l.matches(ht.userFocusableSelector)&&(o=l),o=o||zt(l),o))return;l.querySelectorAll("slot").forEach(c=>{o||(o=Nt(c))})},r=(l,a)=>async()=>{if(this.open!==n)return;const h=n?"luzmo-opened":"luzmo-closed";if(l.dispatchEvent(new k(h,this,{interaction:this.type})),a>0)return;const c=this.triggerElement instanceof dt;this.dispatchEvent(new k(h,this,{interaction:this.type,publish:c})),this.triggerElement&&!c&&this.triggerElement.dispatchEvent(new k(h,this,{interaction:this.type,publish:!0})),this.state=n?"opened":"closed",this.returnFocus(),await A(),await A(),n===this.open&&n===!1&&this.requestSlottable()};return this.elements.forEach((l,a)=>{Et(l,s(l,a),r(l,a))}),o}}return t}const Se=CSS.supports("(overlay: auto)");function Gt(e){let t=!1;try{t=e.matches(":popover-open")}catch{}let i=!1;try{i=e.matches(":open")}catch{}return t||i}function ke(e){class t extends e{async manageDelay(n){if(n===!1||n!==this.open){at.close(this);return}this.delayed&&await at.openTimer(this)&&(this.open=!n)}shouldHidePopover(n){if(n&&this.open!==n)return;const o=async({newState:s}={})=>{s!=="open"&&await this.placementController.resetOverlayPosition()};if(!Gt(this.dialogEl)){o();return}this.dialogEl.addEventListener("toggle",o,{once:!0})}shouldShowPopover(n){let o=!1;try{o=this.dialogEl.matches(":popover-open")}catch{}let s=!1;try{s=this.dialogEl.matches(":open")}catch{}n&&this.open===n&&!o&&!s&&this.isConnected&&(this.dialogEl.showPopover(),this.managePosition())}async ensureOnDOM(n){await A(),Se||await this.shouldHidePopover(n),this.shouldShowPopover(n),await A()}makeTransition(n){if(this.open!==n)return null;let o=null;const s=(l,a)=>()=>{if(l.open=n,a===0){const c=n?qt:_t;this.dispatchEvent(new c)}if(!n||(l.matches(ht.userFocusableSelector)&&(o=l),o=o||zt(l),o))return;l.querySelectorAll("slot").forEach(c=>{o||(o=Nt(c))})},r=(l,a)=>()=>{if(this.open!==n)return;const h=n?"luzmo-opened":"luzmo-closed";if(a>0){l.dispatchEvent(new k(h,this,{interaction:this.type,publish:!1}));return}const c=async()=>{if(this.open!==n)return;await A();const f=this.triggerElement instanceof dt;this.dispatchEvent(new k(h,this,{interaction:this.type,publish:f})),l.dispatchEvent(new k(h,this,{interaction:this.type,publish:!1})),this.triggerElement&&!f&&this.triggerElement.dispatchEvent(new k(h,this,{interaction:this.type,publish:!0})),this.state=n?"opened":"closed",this.returnFocus(),await A(),await A(),n===this.open&&n===!1&&this.requestSlottable()};if(this.open!==n)return;const d=Gt(this.dialogEl);n!==!0&&d&&this.isConnected?(this.dialogEl.addEventListener("beforetoggle",()=>{c()},{once:!0}),this.dialogEl.hidePopover()):c()};return this.elements.forEach((l,a)=>{Et(l,s(l,a),r(l,a))}),o}}return t}const Fe="showPopover"in document.createElement("div");class ze{constructor(){this.root=document.body,this.stack=[],this.handlePointerdown=t=>{this.pointerdownPath=t.composedPath(),this.lastOverlay=this.stack.at(-1)},this.handlePointerup=()=>{const t=this.pointerdownPath;if(this.pointerdownPath=void 0,this.stack.length===0||!(t!=null&&t.length))return;const i=this.lastOverlay;this.lastOverlay=void 0;const n=this.stack.length-1,o=this.stack.filter((s,r)=>!t.find(a=>a===s||a===(s==null?void 0:s.triggerElement)&&(s==null?void 0:s.type)==="hint"||r===n&&s!==i&&s.triggerInteraction==="longpress")&&!s.shouldPreventClose()&&s.type!=="manual"&&!(s.type==="modal"&&i!==s));o.reverse(),o.forEach(s=>{this.closeOverlay(s);let r=s.parentOverlayToForceClose;for(;r;)this.closeOverlay(r),r=r.parentOverlayToForceClose})},this.handleBeforetoggle=t=>{const{target:i,newState:n}=t;n!=="open"&&this.closeOverlay(i)},this.handleKeydown=t=>{if(t.code!=="Escape"||this.stack.length===0)return;const i=this.stack.at(-1);if((i==null?void 0:i.type)==="page"){t.preventDefault();return}Fe||(i==null?void 0:i.type)!=="manual"&&i&&this.closeOverlay(i)},this.bindEvents()}get document(){return this.root.ownerDocument||document}bindEvents(){this.document.addEventListener("pointerdown",this.handlePointerdown),this.document.addEventListener("pointerup",this.handlePointerup),this.document.addEventListener("keydown",this.handleKeydown)}closeOverlay(t){const i=this.stack.indexOf(t);i!==-1&&this.stack.splice(i,1),t.open=!1}overlaysByTriggerElement(t){return this.stack.filter(i=>i.triggerElement===t)}add(t){if(this.stack.includes(t)){const i=this.stack.indexOf(t);i!==-1&&(this.stack.splice(i,1),this.stack.push(t));return}if(t.type==="auto"||t.type==="modal"||t.type==="page"){const i="luzmo-overlay-query-path",n=new Event(i,{composed:!0,bubbles:!0});t.addEventListener(i,o=>{const s=o.composedPath();this.stack.forEach(r=>{!s.find(a=>a===r)&&r.type!=="manual"&&r.type!=="modal"&&this.closeOverlay(r)})},{once:!0}),t.dispatchEvent(n)}else if(t.type==="hint"){if(this.stack.some(n=>n.type!=="manual"&&n.triggerElement&&n.triggerElement===t.triggerElement)){t.open=!1;return}this.stack.forEach(n=>{n.type==="hint"&&this.closeOverlay(n)})}requestAnimationFrame(()=>{this.stack.push(t),t.addEventListener("beforetoggle",this.handleBeforetoggle,{once:!0})})}remove(t){this.closeOverlay(t)}}const Xt=new ze,Ne=':host{display:contents;pointer-events:none;--luzmo-overlay-animation-distance: .5rem}:host(:has(> luzmo-tooltip)){--luzmo-overlay-animation-distance: var( --luzmo-tooltip-animation-distance, 4px )}.dialog{margin:0;border:0;background:none;padding:0;position:fixed;overflow:visible;opacity:1!important;box-sizing:border-box;max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);max-width:calc(100vw - 16px);height:auto;inset:auto;top:0;left:0;display:flex;--luzmo-overlay-open: true}.dialog:not([is-visible]){display:none}.dialog:focus{outline:none}dialog:modal{--luzmo-popover-filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, .15))}:host(:not([open])) .dialog{--luzmo-overlay-open: false}.dialog::backdrop{display:none}.dialog:before{position:absolute;top:-999em;right:-999em;bottom:-999em;left:-999em;content:"";pointer-events:auto!important}.dialog:not(.not-immediately-closable):before{display:none}.dialog>div{width:100%}::slotted(*){pointer-events:auto;visibility:visible!important}::slotted(luzmo-popover){position:static}.dialog:not([actual-placement])[placement*=top]{padding-block:var(--luzmo-overlay-animation-distance);margin-top:var(--luzmo-overlay-animation-distance)}.dialog:not([actual-placement])[placement*=right]{padding-inline:var(--luzmo-overlay-animation-distance);margin-left:calc(-1 * var(--luzmo-overlay-animation-distance))}.dialog:not([actual-placement])[placement*=bottom]{padding-block:var(--luzmo-overlay-animation-distance);margin-top:calc(-1 * var(--luzmo-overlay-animation-distance))}.dialog:not([actual-placement])[placement*=left]{padding-inline:var(--luzmo-overlay-animation-distance);margin-left:var(--luzmo-overlay-animation-distance)}.dialog[actual-placement*=top]{padding-block:var(--luzmo-overlay-animation-distance);margin-top:var(--luzmo-overlay-animation-distance)}.dialog[actual-placement*=right]{padding-inline:var(--luzmo-overlay-animation-distance);margin-left:calc(-1 * var(--luzmo-overlay-animation-distance))}.dialog[actual-placement*=bottom]{padding-block:var(--luzmo-overlay-animation-distance);margin-top:calc(-1 * var(--luzmo-overlay-animation-distance))}.dialog[actual-placement*=left]{padding-inline:var(--luzmo-overlay-animation-distance);margin-left:var(--luzmo-overlay-animation-distance)}slot[name=longpress-describedby-descriptor]{display:none}@supports selector(:open){.dialog{opacity:0}.dialog:open{opacity:1;--luzmo-popover-filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, .15))}}@supports selector(:popover-open){.dialog{opacity:0}.dialog:popover-open{opacity:1;--luzmo-popover-filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, .15))}}@supports (overlay: auto){.dialog{display:none;transition:all var(--luzmo-overlay-animation-duration, .13s),translate 0s,display var(--luzmo-overlay-animation-duration, .13s);transition-behavior:allow-discrete}.dialog:popover-open,.dialog:modal{display:flex}}@supports (not selector(:open)) and (not selector(:popover-open)){:host:not([open]) .dialog{pointer-events:none}.dialog[actual-placement]{z-index:calc(var(--luzmo-overlay-z-index-base, 1000) + var(--luzmo-overlay-open-count))}}',G=Math.min,T=Math.max,yt=Math.round,ft=Math.floor,M=e=>({x:e,y:e}),_e={left:"right",right:"left",bottom:"top",top:"bottom"},qe={start:"end",end:"start"};function Lt(e,t,i){return T(e,G(t,i))}function ot(e,t){return typeof e=="function"?e(t):e}function X(e){return e.split("-")[0]}function st(e){return e.split("-")[1]}function oe(e){return e==="x"?"y":"x"}function Mt(e){return e==="y"?"height":"width"}function Q(e){return["top","bottom"].includes(X(e))?"y":"x"}function $t(e){return oe(Q(e))}function Me(e,t,i){i===void 0&&(i=!1);const n=st(e),o=$t(e),s=Mt(o);let r=o==="x"?n===(i?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=wt(r)),[r,wt(r)]}function $e(e){const t=wt(e);return[St(e),t,St(t)]}function St(e){return e.replace(/start|end/g,t=>qe[t])}function We(e,t,i){const n=["left","right"],o=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return i?t?o:n:t?n:o;case"left":case"right":return t?s:r;default:return[]}}function He(e,t,i,n){const o=st(e);let s=We(X(e),i==="start",n);return o&&(s=s.map(r=>r+"-"+o),t&&(s=s.concat(s.map(St)))),s}function wt(e){return e.replace(/left|right|bottom|top/g,t=>_e[t])}function Ie(e){return{top:0,right:0,bottom:0,left:0,...e}}function se(e){return typeof e!="number"?Ie(e):{top:e,right:e,bottom:e,left:e}}function bt(e){const{x:t,y:i,width:n,height:o}=e;return{width:n,height:o,top:i,left:t,right:t+n,bottom:i+o,x:t,y:i}}function Jt(e,t,i){let{reference:n,floating:o}=e;const s=Q(t),r=$t(t),l=Mt(r),a=X(t),h=s==="y",c=n.x+n.width/2-o.width/2,d=n.y+n.height/2-o.height/2,f=n[l]/2-o[l]/2;let u;switch(a){case"top":u={x:c,y:n.y-o.height};break;case"bottom":u={x:c,y:n.y+n.height};break;case"right":u={x:n.x+n.width,y:d};break;case"left":u={x:n.x-o.width,y:d};break;default:u={x:n.x,y:n.y}}switch(st(t)){case"start":u[r]-=f*(i&&h?-1:1);break;case"end":u[r]+=f*(i&&h?-1:1);break}return u}const Be=async(e,t,i)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:r}=i,l=s.filter(Boolean),a=await(r.isRTL==null?void 0:r.isRTL(t));let h=await r.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=Jt(h,n,a),f=n,u={},p=0;for(let m=0;m<l.length;m++){const{name:v,fn:g}=l[m],{x:y,y:w,data:x,reset:b}=await g({x:c,y:d,initialPlacement:n,placement:f,strategy:o,middlewareData:u,rects:h,platform:r,elements:{reference:e,floating:t}});c=y??c,d=w??d,u={...u,[v]:{...u[v],...x}},b&&p<=50&&(p++,typeof b=="object"&&(b.placement&&(f=b.placement),b.rects&&(h=b.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:o}):b.rects),{x:c,y:d}=Jt(h,f,a)),m=-1)}return{x:c,y:d,placement:f,strategy:o,middlewareData:u}};async function Wt(e,t){var i;t===void 0&&(t={});const{x:n,y:o,platform:s,rects:r,elements:l,strategy:a}=e,{boundary:h="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:u=0}=ot(t,e),p=se(u),v=l[f?d==="floating"?"reference":"floating":d],g=bt(await s.getClippingRect({element:(i=await(s.isElement==null?void 0:s.isElement(v)))==null||i?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:h,rootBoundary:c,strategy:a})),y=d==="floating"?{x:n,y:o,width:r.floating.width,height:r.floating.height}:r.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),x=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},b=bt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:w,strategy:a}):y);return{top:(g.top-b.top+p.top)/x.y,bottom:(b.bottom-g.bottom+p.bottom)/x.y,left:(g.left-b.left+p.left)/x.x,right:(b.right-g.right+p.right)/x.x}}const Ve=e=>({name:"arrow",options:e,async fn(t){const{x:i,y:n,placement:o,rects:s,platform:r,elements:l,middlewareData:a}=t,{element:h,padding:c=0}=ot(e,t)||{};if(h==null)return{};const d=se(c),f={x:i,y:n},u=$t(o),p=Mt(u),m=await r.getDimensions(h),v=u==="y",g=v?"top":"left",y=v?"bottom":"right",w=v?"clientHeight":"clientWidth",x=s.reference[p]+s.reference[u]-f[u]-s.floating[p],b=f[u]-s.reference[u],L=await(r.getOffsetParent==null?void 0:r.getOffsetParent(h));let E=L?L[w]:0;(!E||!await(r.isElement==null?void 0:r.isElement(L)))&&(E=l.floating[w]||s.floating[p]);const H=x/2-b/2,N=E/2-m[p]/2-1,S=G(d[g],N),V=G(d[y],N),_=S,U=E-m[p]-V,P=E/2-m[p]/2+H,tt=Lt(_,P,U),I=!a.arrow&&st(o)!=null&&P!==tt&&s.reference[p]/2-(P<_?S:V)-m[p]/2<0,q=I?P<_?P-_:P-U:0;return{[u]:f[u]+q,data:{[u]:tt,centerOffset:P-tt-q,...I&&{alignmentOffset:q}},reset:I}}}),Ue=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var i,n;const{placement:o,middlewareData:s,rects:r,initialPlacement:l,platform:a,elements:h}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...v}=ot(e,t);if((i=s.arrow)!=null&&i.alignmentOffset)return{};const g=X(o),y=Q(l),w=X(l)===l,x=await(a.isRTL==null?void 0:a.isRTL(h.floating)),b=f||(w||!m?[wt(l)]:$e(l)),L=p!=="none";!f&&L&&b.push(...He(l,m,p,x));const E=[l,...b],H=await Wt(t,v),N=[];let S=((n=s.flip)==null?void 0:n.overflows)||[];if(c&&N.push(H[g]),d){const P=Me(o,r,x);N.push(H[P[0]],H[P[1]])}if(S=[...S,{placement:o,overflows:N}],!N.every(P=>P<=0)){var V,_;const P=(((V=s.flip)==null?void 0:V.index)||0)+1,tt=E[P];if(tt)return{data:{index:P,overflows:S},reset:{placement:tt}};let I=(_=S.filter(q=>q.overflows[0]<=0).sort((q,j)=>q.overflows[1]-j.overflows[1])[0])==null?void 0:_.placement;if(!I)switch(u){case"bestFit":{var U;const q=(U=S.filter(j=>{if(L){const K=Q(j.placement);return K===y||K==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(K=>K>0).reduce((K,xe)=>K+xe,0)]).sort((j,K)=>j[1]-K[1])[0])==null?void 0:U[0];q&&(I=q);break}case"initialPlacement":I=l;break}if(o!==I)return{reset:{placement:I}}}return{}}}};async function je(e,t){const{placement:i,platform:n,elements:o}=e,s=await(n.isRTL==null?void 0:n.isRTL(o.floating)),r=X(i),l=st(i),a=Q(i)==="y",h=["left","top"].includes(r)?-1:1,c=s&&a?-1:1,d=ot(t,e);let{mainAxis:f,crossAxis:u,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof p=="number"&&(u=l==="end"?p*-1:p),a?{x:u*c,y:f*h}:{x:f*h,y:u*c}}const Ke=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var i,n;const{x:o,y:s,placement:r,middlewareData:l}=t,a=await je(t,e);return r===((i=l.offset)==null?void 0:i.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+a.x,y:s+a.y,data:{...a,placement:r}}}}},Ye=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:n,placement:o}=t,{mainAxis:s=!0,crossAxis:r=!1,limiter:l={fn:v=>{let{x:g,y}=v;return{x:g,y}}},...a}=ot(e,t),h={x:i,y:n},c=await Wt(t,a),d=Q(X(o)),f=oe(d);let u=h[f],p=h[d];if(s){const v=f==="y"?"top":"left",g=f==="y"?"bottom":"right",y=u+c[v],w=u-c[g];u=Lt(y,u,w)}if(r){const v=d==="y"?"top":"left",g=d==="y"?"bottom":"right",y=p+c[v],w=p-c[g];p=Lt(y,p,w)}const m=l.fn({...t,[f]:u,[d]:p});return{...m,data:{x:m.x-i,y:m.y-n,enabled:{[f]:s,[d]:r}}}}}},Ge=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var i,n;const{placement:o,rects:s,platform:r,elements:l}=t,{apply:a=()=>{},...h}=ot(e,t),c=await Wt(t,h),d=X(o),f=st(o),u=Q(o)==="y",{width:p,height:m}=s.floating;let v,g;d==="top"||d==="bottom"?(v=d,g=f===(await(r.isRTL==null?void 0:r.isRTL(l.floating))?"start":"end")?"left":"right"):(g=d,v=f==="end"?"top":"bottom");const y=m-c.top-c.bottom,w=p-c.left-c.right,x=G(m-c[v],y),b=G(p-c[g],w),L=!t.middlewareData.shift;let E=x,H=b;if((i=t.middlewareData.shift)!=null&&i.enabled.x&&(H=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(E=y),L&&!f){const S=T(c.left,0),V=T(c.right,0),_=T(c.top,0),U=T(c.bottom,0);u?H=p-2*(S!==0||V!==0?S+V:T(c.left,c.right)):E=m-2*(_!==0||U!==0?_+U:T(c.top,c.bottom))}await a({...t,availableWidth:H,availableHeight:E});const N=await r.getDimensions(l.floating);return p!==N.width||m!==N.height?{reset:{rects:!0}}:{}}}};function Ct(){return typeof window<"u"}function rt(e){return re(e)?(e.nodeName||"").toLowerCase():"#document"}function R(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function W(e){var t;return(t=(re(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function re(e){return Ct()?e instanceof Node||e instanceof R(e).Node:!1}function F(e){return Ct()?e instanceof Element||e instanceof R(e).Element:!1}function $(e){return Ct()?e instanceof HTMLElement||e instanceof R(e).HTMLElement:!1}function Qt(e){return!Ct()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof R(e).ShadowRoot}function ut(e){const{overflow:t,overflowX:i,overflowY:n,display:o}=z(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+i)&&!["inline","contents"].includes(o)}function Xe(e){return["table","td","th"].includes(rt(e))}function Pt(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Ht(e){const t=It(),i=F(e)?z(e):e;return["transform","translate","scale","rotate","perspective"].some(n=>i[n]?i[n]!=="none":!1)||(i.containerType?i.containerType!=="normal":!1)||!t&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!t&&(i.filter?i.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(i.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(i.contain||"").includes(n))}function Je(e){let t=J(e);for(;$(t)&&!nt(t);){if(Ht(t))return t;if(Pt(t))return null;t=J(t)}return null}function It(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function nt(e){return["html","body","#document"].includes(rt(e))}function z(e){return R(e).getComputedStyle(e)}function Ot(e){return F(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function J(e){if(rt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Qt(e)&&e.host||W(e);return Qt(t)?t.host:t}function le(e){const t=J(e);return nt(t)?e.ownerDocument?e.ownerDocument.body:e.body:$(t)&&ut(t)?t:le(t)}function ct(e,t,i){var n;t===void 0&&(t=[]),i===void 0&&(i=!0);const o=le(e),s=o===((n=e.ownerDocument)==null?void 0:n.body),r=R(o);if(s){const l=kt(r);return t.concat(r,r.visualViewport||[],ut(o)?o:[],l&&i?ct(l):[])}return t.concat(o,ct(o,[],i))}function kt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ae(e){const t=z(e);let i=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=$(e),s=o?e.offsetWidth:i,r=o?e.offsetHeight:n,l=yt(i)!==s||yt(n)!==r;return l&&(i=s,n=r),{width:i,height:n,$:l}}function Bt(e){return F(e)?e:e.contextElement}function et(e){const t=Bt(e);if(!$(t))return M(1);const i=t.getBoundingClientRect(),{width:n,height:o,$:s}=ae(t);let r=(s?yt(i.width):i.width)/n,l=(s?yt(i.height):i.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}const Qe=M(0);function ce(e){const t=R(e);return!It()||!t.visualViewport?Qe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ze(e,t,i){return t===void 0&&(t=!1),!i||t&&i!==R(e)?!1:t}function Z(e,t,i,n){t===void 0&&(t=!1),i===void 0&&(i=!1);const o=e.getBoundingClientRect(),s=Bt(e);let r=M(1);t&&(n?F(n)&&(r=et(n)):r=et(e));const l=Ze(s,i,n)?ce(s):M(0);let a=(o.left+l.x)/r.x,h=(o.top+l.y)/r.y,c=o.width/r.x,d=o.height/r.y;if(s){const f=R(s),u=n&&F(n)?R(n):n;let p=f,m=kt(p);for(;m&&n&&u!==p;){const v=et(m),g=m.getBoundingClientRect(),y=z(m),w=g.left+(m.clientLeft+parseFloat(y.paddingLeft))*v.x,x=g.top+(m.clientTop+parseFloat(y.paddingTop))*v.y;a*=v.x,h*=v.y,c*=v.x,d*=v.y,a+=w,h+=x,p=R(m),m=kt(p)}}return bt({width:c,height:d,x:a,y:h})}function Vt(e,t){const i=Ot(e).scrollLeft;return t?t.left+i:Z(W(e)).left+i}function he(e,t,i){i===void 0&&(i=!1);const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-(i?0:Vt(e,n)),s=n.top+t.scrollTop;return{x:o,y:s}}function ti(e){let{elements:t,rect:i,offsetParent:n,strategy:o}=e;const s=o==="fixed",r=W(n),l=t?Pt(t.floating):!1;if(n===r||l&&s)return i;let a={scrollLeft:0,scrollTop:0},h=M(1);const c=M(0),d=$(n);if((d||!d&&!s)&&((rt(n)!=="body"||ut(r))&&(a=Ot(n)),$(n))){const u=Z(n);h=et(n),c.x=u.x+n.clientLeft,c.y=u.y+n.clientTop}const f=r&&!d&&!s?he(r,a,!0):M(0);return{width:i.width*h.x,height:i.height*h.y,x:i.x*h.x-a.scrollLeft*h.x+c.x+f.x,y:i.y*h.y-a.scrollTop*h.y+c.y+f.y}}function ei(e){return Array.from(e.getClientRects())}function ii(e){const t=W(e),i=Ot(e),n=e.ownerDocument.body,o=T(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=T(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let r=-i.scrollLeft+Vt(e);const l=-i.scrollTop;return z(n).direction==="rtl"&&(r+=T(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:r,y:l}}function ni(e,t){const i=R(e),n=W(e),o=i.visualViewport;let s=n.clientWidth,r=n.clientHeight,l=0,a=0;if(o){s=o.width,r=o.height;const h=It();(!h||h&&t==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}return{width:s,height:r,x:l,y:a}}function oi(e,t){const i=Z(e,!0,t==="fixed"),n=i.top+e.clientTop,o=i.left+e.clientLeft,s=$(e)?et(e):M(1),r=e.clientWidth*s.x,l=e.clientHeight*s.y,a=o*s.x,h=n*s.y;return{width:r,height:l,x:a,y:h}}function Zt(e,t,i){let n;if(t==="viewport")n=ni(e,i);else if(t==="document")n=ii(W(e));else if(F(t))n=oi(t,i);else{const o=ce(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return bt(n)}function de(e,t){const i=J(e);return i===t||!F(i)||nt(i)?!1:z(i).position==="fixed"||de(i,t)}function si(e,t){const i=t.get(e);if(i)return i;let n=ct(e,[],!1).filter(l=>F(l)&&rt(l)!=="body"),o=null;const s=z(e).position==="fixed";let r=s?J(e):e;for(;F(r)&&!nt(r);){const l=z(r),a=Ht(r);!a&&l.position==="fixed"&&(o=null),(s?!a&&!o:!a&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||ut(r)&&!a&&de(e,r))?n=n.filter(c=>c!==r):o=l,r=J(r)}return t.set(e,n),n}function ri(e){let{element:t,boundary:i,rootBoundary:n,strategy:o}=e;const r=[...i==="clippingAncestors"?Pt(t)?[]:si(t,this._c):[].concat(i),n],l=r[0],a=r.reduce((h,c)=>{const d=Zt(t,c,o);return h.top=T(d.top,h.top),h.right=G(d.right,h.right),h.bottom=G(d.bottom,h.bottom),h.left=T(d.left,h.left),h},Zt(t,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function li(e){const{width:t,height:i}=ae(e);return{width:t,height:i}}function ai(e,t,i){const n=$(t),o=W(t),s=i==="fixed",r=Z(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const a=M(0);if(n||!n&&!s)if((rt(t)!=="body"||ut(o))&&(l=Ot(t)),n){const f=Z(t,!0,s,t);a.x=f.x+t.clientLeft,a.y=f.y+t.clientTop}else o&&(a.x=Vt(o));const h=o&&!n&&!s?he(o,l):M(0),c=r.left+l.scrollLeft-a.x-h.x,d=r.top+l.scrollTop-a.y-h.y;return{x:c,y:d,width:r.width,height:r.height}}function Rt(e){return z(e).position==="static"}function te(e,t){if(!$(e)||z(e).position==="fixed")return null;if(t)return t(e);let i=e.offsetParent;return W(e)===i&&(i=i.ownerDocument.body),i}function ue(e,t){const i=R(e);if(Pt(e))return i;if(!$(e)){let o=J(e);for(;o&&!nt(o);){if(F(o)&&!Rt(o))return o;o=J(o)}return i}let n=te(e,t);for(;n&&Xe(n)&&Rt(n);)n=te(n,t);return n&&nt(n)&&Rt(n)&&!Ht(n)?i:n||Je(e)||i}const ci=async function(e){const t=this.getOffsetParent||ue,i=this.getDimensions,n=await i(e.floating);return{reference:ai(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function hi(e){return z(e).direction==="rtl"}const di={convertOffsetParentRelativeRectToViewportRelativeRect:ti,getDocumentElement:W,getClippingRect:ri,getOffsetParent:ue,getElementRects:ci,getClientRects:ei,getDimensions:li,getScale:et,isElement:F,isRTL:hi};function pe(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ui(e,t){let i=null,n;const o=W(e);function s(){var l;clearTimeout(n),(l=i)==null||l.disconnect(),i=null}function r(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),s();const h=e.getBoundingClientRect(),{left:c,top:d,width:f,height:u}=h;if(l||t(),!f||!u)return;const p=ft(d),m=ft(o.clientWidth-(c+f)),v=ft(o.clientHeight-(d+u)),g=ft(c),w={rootMargin:-p+"px "+-m+"px "+-v+"px "+-g+"px",threshold:T(0,G(1,a))||1};let x=!0;function b(L){const E=L[0].intersectionRatio;if(E!==a){if(!x)return r();E?r(!1,E):n=setTimeout(()=>{r(!1,1e-7)},1e3)}E===1&&!pe(h,e.getBoundingClientRect())&&r(),x=!1}try{i=new IntersectionObserver(b,{...w,root:o.ownerDocument})}catch{i=new IntersectionObserver(b,w)}i.observe(e)}return r(!0),s}function ee(e,t,i,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=n,h=Bt(e),c=o||s?[...h?ct(h):[],...ct(t)]:[];c.forEach(g=>{o&&g.addEventListener("scroll",i,{passive:!0}),s&&g.addEventListener("resize",i)});const d=h&&l?ui(h,i):null;let f=-1,u=null;r&&(u=new ResizeObserver(g=>{let[y]=g;y&&y.target===h&&u&&(u.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=u)==null||w.observe(t)})),i()}),h&&!a&&u.observe(h),u.observe(t));let p,m=a?Z(e):null;a&&v();function v(){const g=Z(e);m&&!pe(m,g)&&i(),m=g,p=requestAnimationFrame(v)}return i(),()=>{var g;c.forEach(y=>{o&&y.removeEventListener("scroll",i),s&&y.removeEventListener("resize",i)}),d==null||d(),(g=u)==null||g.disconnect(),u=null,a&&cancelAnimationFrame(p)}}const pi=Ke,fi=Ye,ie=Ue,mi=Ge,gi=Ve,vi=(e,t,i)=>{const n=new Map,o={platform:di,...i},s={...o.platform,_c:n};return Be(e,t,{...o,platform:s})};function mt(e){if(e===void 0)return 0;const t=window.devicePixelRatio||1;return Math.round(e*t)/t}const gt=8,yi=100,wi=e=>({left:["right","bottom","top"],"left-start":["right-start","bottom","top"],"left-end":["right-end","bottom","top"],right:["left","bottom","top"],"right-start":["left-start","bottom","top"],"right-end":["left-end","bottom","top"],top:["bottom","left","right"],"top-start":["bottom-start","left","right"],"top-end":["bottom-end","left","right"],bottom:["top","left","right"],"bottom-start":["top-start","left","right"],"bottom-end":["top-end","left","right"]})[e]??[e],bi=Symbol("placement updated");class fe{constructor(t){this.originalPlacements=new WeakMap,this.allowPlacementUpdate=!1,this.closeForAncestorUpdate=()=>{!this.allowPlacementUpdate&&this.options.type!=="modal"&&this.cleanup&&this.target.dispatchEvent(new Event("close",{bubbles:!0})),this.allowPlacementUpdate=!1},this.updatePlacement=()=>{this.computePlacement()},this.resetOverlayPosition=()=>{!this.target||!this.options||(this.clearOverlayPosition(),this.host.offsetHeight,this.computePlacement())},this.host=t,this.host.addController(this)}placeOverlay(t=this.target,i=this.options){if(this.target=t,this.options=i,!t||!i)return;const n=ee(i.trigger,t,this.closeForAncestorUpdate,{ancestorResize:!1,elementResize:!1,layoutShift:!1}),o=ee(i.trigger,t,this.updatePlacement,{ancestorScroll:!1});this.cleanup=()=>{var s;(s=this.host.elements)==null||s.forEach(r=>{r.addEventListener("luzmo-closed",()=>{const l=this.originalPlacements.get(r);l&&r.setAttribute("placement",l),this.originalPlacements.delete(r)},{once:!0})}),n(),o()}}async computePlacement(){var f,u;const{options:t,target:i}=this;await(document.fonts?document.fonts.ready:Promise.resolve());const n=t.trigger instanceof HTMLElement?ie():ie({padding:gt,fallbackPlacements:wi(t.placement)}),[o=0,s=0]=Array.isArray(t==null?void 0:t.offset)?t.offset:[t.offset,0],r=(f=this.host.elements.find(p=>p.tipElement))==null?void 0:f.tipElement,l=[pi({mainAxis:o,crossAxis:s}),fi({padding:gt}),n,mi({padding:gt,apply:({availableWidth:p,availableHeight:m,rects:{floating:v}})=>{const g=Math.max(yi,Math.floor(m)),y=v.height;this.initialHeight=this.isConstrained&&this.initialHeight||y,this.isConstrained=y<this.initialHeight||g<=y;const w=this.isConstrained?`${g}px`:"";Object.assign(i.style,{maxWidth:`${Math.floor(p)}px`,maxHeight:w})}}),...r?[gi({element:r,padding:t.tipPadding||gt})]:[]],{x:a,y:h,placement:c,middlewareData:d}=await vi(t.trigger,i,{placement:t.placement,middleware:l,strategy:"fixed"});if(Object.assign(i.style,{top:"0px",left:"0px",translate:`${mt(a)}px ${mt(h)}px`}),i.setAttribute("actual-placement",c),(u=this.host.elements)==null||u.forEach(p=>{this.originalPlacements.has(p)||this.originalPlacements.set(p,p.getAttribute("placement")),p.setAttribute("placement",c)}),r&&d.arrow){const{x:p,y:m}=d.arrow;Object.assign(r.style,{top:c.startsWith("right")||c.startsWith("left")?"0px":"",left:c.startsWith("bottom")||c.startsWith("top")?"0px":"",translate:`${mt(p)}px ${mt(m)}px`})}}clearOverlayPosition(){this.target&&(this.target.style.removeProperty("max-height"),this.target.style.removeProperty("max-width"),this.initialHeight=void 0,this.isConstrained=!1)}hostConnected(){document.addEventListener("luzmo-update-overlays",this.resetOverlayPosition)}hostUpdated(){var t;this.host.open||((t=this.cleanup)==null||t.call(this),this.cleanup=void 0)}hostDisconnected(){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0,document.removeEventListener("luzmo-update-overlays",this.resetOverlayPosition)}}var pt=(e=>(e[e.click=0]="click",e[e.hover=1]="hover",e[e.longpress=2]="longpress",e))(pt||{});class Tt{constructor(t,{overlay:i,isPersistent:n,handleOverlayReady:o}){this.target=t,this.isLazilyOpen=!1,this.isPersistent=!1,this.isPersistent=!!n,this.handleOverlayReady=o,this.isPersistent&&this.init(),this.overlay=i}get activelyOpening(){return!1}get open(){var t;return((t=this.overlay)==null?void 0:t.open)??this.isLazilyOpen}set open(t){if(t!==this.open){if(this.isLazilyOpen=t,this.overlay){this.overlay.open=t;return}t&&(customElements.whenDefined("luzmo-overlay").then(async()=>{const{LuzmoOverlay:i}=await Promise.resolve().then(()=>xt);this.overlay=new i,this.overlay.open=!0}),Promise.resolve().then(()=>xt))}}get overlay(){return this._overlay}set overlay(t){var i;t&&this.overlay!==t&&(this.overlay&&this.overlay.removeController(this),this._overlay=t,this.overlay.addController(this),this.initOverlay(),this.prepareDescription(this.target),(i=this.handleOverlayReady)==null||i.call(this,this.overlay))}prepareDescription(t){}releaseDescription(){}shouldCompleteOpen(){}init(){}initOverlay(){}abort(){var t;this.releaseDescription(),(t=this.abortController)==null||t.abort()}hostConnected(){this.init()}hostDisconnected(){this.isPersistent||this.abort()}}class me extends Tt{constructor(){super(...arguments),this.type=pt.click,this.preventNextToggle=!1}handleClick(){this.preventNextToggle||(this.open=!this.open),this.preventNextToggle=!1}handlePointerdown(){this.preventNextToggle=this.open}init(){var i;(i=this.abortController)==null||i.abort(),this.abortController=new AbortController;const{signal:t}=this.abortController;this.target.addEventListener("click",()=>this.handleClick(),{signal:t}),this.target.addEventListener("pointerdown",()=>this.handlePointerdown(),{signal:t})}}const xi=300;class ge extends Tt{constructor(){super(...arguments),this.type=pt.hover,this.elementIds=[],this.focusedin=!1,this.pointerentered=!1}handleTargetFocusin(){this.target.matches(":focus-visible")&&(this.open=!0,this.focusedin=!0)}handleTargetFocusout(){this.focusedin=!1,!this.pointerentered&&(this.open=!1)}handleTargetPointerenter(){var t;this.hoverTimeout&&(clearTimeout(this.hoverTimeout),this.hoverTimeout=void 0),!((t=this.overlay)!=null&&t.disabled)&&(this.open=!0,this.pointerentered=!0)}handleTargetPointerleave(){this.doPointerleave()}handleHostPointerenter(){this.hoverTimeout&&(clearTimeout(this.hoverTimeout),this.hoverTimeout=void 0)}handleHostPointerleave(){this.doPointerleave()}prepareDescription(){if(this.overlay.elements.length===0)return;const t=this.target.getRootNode(),i=this.overlay.elements[0].getRootNode(),n=this.overlay.getRootNode();t===n?this.prepareOverlayRelativeDescription():t===i&&this.prepareContentRelativeDescription()}prepareOverlayRelativeDescription(){const t=Dt.conditionAttributeWithId(this.target,"aria-describedby",[this.overlay.id]);this.releaseDescription=()=>{t(),this.releaseDescription=Y}}prepareContentRelativeDescription(){const t=[],i=this.overlay.elements.map(o=>(t.push(o.id),o.id||(o.id=`${this.overlay.tagName.toLowerCase()}-helper-${Ft.randomID()}`),o.id));this.elementIds=t;const n=Dt.conditionAttributeWithId(this.target,"aria-describedby",i);this.releaseDescription=()=>{n(),this.overlay.elements.map((o,s)=>{o.id=this.elementIds[s]}),this.releaseDescription=Y}}doPointerleave(){this.pointerentered=!1;const t=this.target;this.focusedin&&t.matches(":focus-visible")||(this.hoverTimeout=setTimeout(()=>{this.open=!1},xi))}init(){var i;(i=this.abortController)==null||i.abort(),this.abortController=new AbortController;const{signal:t}=this.abortController;this.target.addEventListener("focusin",()=>this.handleTargetFocusin(),{signal:t}),this.target.addEventListener("focusout",()=>this.handleTargetFocusout(),{signal:t}),this.target.addEventListener("pointerenter",()=>this.handleTargetPointerenter(),{signal:t}),this.target.addEventListener("pointerleave",()=>this.handleTargetPointerleave(),{signal:t}),this.overlay&&this.initOverlay()}initOverlay(){if(!this.abortController)return;const{signal:t}=this.abortController;this.overlay.addEventListener("pointerenter",()=>this.handleHostPointerenter(),{signal:t}),this.overlay.addEventListener("pointerleave",()=>this.handleHostPointerleave(),{signal:t})}}const Ei=300,ve={touch:"Double tap and long press for additional options",keyboard:"Press Space or Alt+Down Arrow for additional options",mouse:"Click and hold for additional options"};class ye extends Tt{constructor(){super(...arguments),this.type=pt.longpress,this.longpressState=null,this.releaseDescription=Y,this.handlePointerup=()=>{var t;clearTimeout(this.timeout),this.target&&(this.longpressState=((t=this.overlay)==null?void 0:t.state)==="opening"?"pressed":null,document.removeEventListener("pointerup",this.handlePointerup),document.removeEventListener("pointercancel",this.handlePointerup))}}get activelyOpening(){return this.longpressState==="opening"||this.longpressState==="pressed"}handleLongpress(){this.open=!0,this.longpressState=this.longpressState==="potential"?"opening":"pressed"}handlePointerdown(t){!this.target||t.button!==0||(this.longpressState="potential",document.addEventListener("pointerup",this.handlePointerup),document.addEventListener("pointercancel",this.handlePointerup),"holdAffordance"in this.target)||(this.timeout=setTimeout(()=>{this.target&&this.target.dispatchEvent(new CustomEvent("longpress",{bubbles:!0,composed:!0,detail:{source:"pointer"}}))},Ei))}handleKeydown(t){const{code:i,altKey:n}=t;n&&i==="ArrowDown"&&(t.stopPropagation(),t.stopImmediatePropagation())}handleKeyup(t){const{code:i,altKey:n}=t;if(i==="Space"||n&&i==="ArrowDown"){if(!this.target)return;t.stopPropagation(),this.target.dispatchEvent(new CustomEvent("longpress",{bubbles:!0,composed:!0,detail:{source:"keyboard"}})),setTimeout(()=>{this.longpressState=null})}}prepareDescription(t){if(this.releaseDescription!==Y||this.overlay.elements.length===0)return;const i=document.createElement("div");i.id=`longpress-describedby-descriptor-${Ft.randomID()}`;const n=Yt.isIOS()||Yt.isAndroid()?"touch":"keyboard";i.textContent=ve[n],i.slot="longpress-describedby-descriptor";const o=t.getRootNode(),s=this.overlay.getRootNode();o===s?this.overlay.append(i):(i.hidden=!("host"in o),t.after(i));const r=Dt.conditionAttributeWithId(t,"aria-describedby",[i.id]);this.releaseDescription=()=>{r(),i.remove(),this.releaseDescription=Y}}shouldCompleteOpen(){this.longpressState=this.longpressState==="pressed"?null:this.longpressState}init(){var i;(i=this.abortController)==null||i.abort(),this.abortController=new AbortController;const{signal:t}=this.abortController;this.target.addEventListener("longpress",()=>this.handleLongpress(),{signal:t}),this.target.addEventListener("pointerdown",n=>this.handlePointerdown(n),{signal:t}),this.prepareDescription(this.target),!this.target.holdAffordance&&(this.target.addEventListener("keydown",n=>this.handleKeydown(n),{signal:t}),this.target.addEventListener("keyup",n=>this.handleKeyup(n),{signal:t}))}}const we={click:me,longpress:ye,hover:ge};var Ci=Object.defineProperty,Pi=Object.getOwnPropertyDescriptor,O=(e,t,i,n)=>{for(var o=n>1?void 0:n?Pi(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=(n?r(t,i,o):r(o))||o);return n&&o&&Ci(t,i,o),o};const Oi="showPopover"in document.createElement("div");let vt=De(it);vt=Oi?ke(vt):Le(vt);var B;const C=(B=class extends vt{constructor(){super(...arguments),this._delayed=!1,this._disabled=!1,this.offset=0,this._open=!1,this.lastRequestSlottableState=!1,this.receivesFocus="auto",this._state="closed",this.triggerElement=null,this.type="auto",this.wasOpen=!1,this.closeOnFocusOut=t=>{if(!t.relatedTarget)return;const i=new Event("overlay-relation-query",{bubbles:!0,composed:!0});t.relatedTarget.addEventListener(i.type,n=>{n.composedPath().includes(this)||(this.open=!1)}),t.relatedTarget.dispatchEvent(i)}}get delayed(){var t;return((t=this.elements.at(-1))==null?void 0:t.hasAttribute("delayed"))||this._delayed}set delayed(t){this._delayed=t}get disabled(){return this._disabled}set disabled(t){var i;this._disabled=t,t?((i=this.strategy)==null||i.abort(),this.wasOpen=this.open,this.open=!1):(this.bindEvents(),this.open=this.open||this.wasOpen,this.wasOpen=!1)}get hasNonVirtualTrigger(){return!!this.triggerElement&&!(this.triggerElement instanceof dt)}get placementController(){return this._placementController||(this._placementController=new fe(this)),this._placementController}get open(){return this._open}set open(t){var i;t&&this.disabled||t!==this.open&&((i=this.strategy)!=null&&i.activelyOpening&&!t||(this._open=t,this.open&&(B.openCount+=1),this.requestUpdate("open",!this.open),this.open&&this.requestSlottable()))}get state(){return this._state}set state(t){var n;if(t===this.state)return;const i=this.state;this._state=t,(this.state==="opened"||this.state==="closed")&&((n=this.strategy)==null||n.shouldCompleteOpen()),this.requestUpdate("state",i)}get elementResolver(){return this._elementResolver||(this._elementResolver=new jt.ElementResolutionController(this)),this._elementResolver}get usesDialog(){return this.type==="modal"||this.type==="page"}get popoverValue(){if("popover"in this)switch(this.type){case"modal":case"page":return;case"hint":return"manual";default:return this.type}}get requiresPositioning(){return!(this.type==="page"||!this.open||!this.triggerElement||!this.placement&&this.type!=="hint")}managePosition(){if(!this.requiresPositioning||!this.open)return;const t=this.offset||0,i=this.triggerElement,n=this.placement||"right",o=this.tipPadding;this.placementController.placeOverlay(this.dialogEl,{offset:t,placement:n,tipPadding:o,trigger:i,type:this.type})}async managePopoverOpen(){super.managePopoverOpen();const t=this.open;if(this.open!==t||(await this.manageDelay(t),this.open!==t)||(await this.ensureOnDOM(t),this.open!==t))return;const i=await this.makeTransition(t);this.open===t&&await this.applyFocus(t,i)}async applyFocus(t,i){if(!(this.receivesFocus==="false"||this.type==="hint")){if(await A(),await A(),t===this.open&&!this.open){this.hasNonVirtualTrigger&&this.contains(this.getRootNode().activeElement)&&this.triggerElement.focus();return}i==null||i.focus()}}returnFocus(){var i;if(this.open||this.type==="hint")return;const t=()=>{var s,r;const n=[];let o=document.activeElement;for(;(s=o==null?void 0:o.shadowRoot)!=null&&s.activeElement;)o=o.shadowRoot.activeElement;for(;o;){const l=o.assignedSlot||o.parentElement||((r=o.getRootNode())==null?void 0:r.host);l&&n.push(l),o=l}return n};this.receivesFocus!=="false"&&((i=this.triggerElement)!=null&&i.focus)&&(this.contains(this.getRootNode().activeElement)||t().includes(this)||document.activeElement===document.body)&&this.triggerElement.focus()}async manageOpen(t){if(!(!this.isConnected&&this.open)&&(this.hasUpdated||await this.updateComplete,this.open?(Xt.add(this),this.willPreventClose&&(document.addEventListener("pointerup",()=>{this.dialogEl.classList.toggle("not-immediately-closable",!1),this.willPreventClose=!1},{once:!0}),this.dialogEl.classList.toggle("not-immediately-closable",!0))):(t&&this.dispose(),Xt.remove(this)),this.open&&this.state!=="opened"?this.state="opening":!this.open&&this.state!=="closed"&&(this.state="closing"),this.usesDialog?this.manageDialogOpen():this.managePopoverOpen(),this.type==="auto")){const i=this.getRootNode();this.open?i.addEventListener("focusout",this.closeOnFocusOut,{capture:!0}):i.removeEventListener("focusout",this.closeOnFocusOut,{capture:!0})}}bindEvents(){var t;(t=this.strategy)==null||t.abort(),this.strategy=void 0,this.hasNonVirtualTrigger&&this.triggerInteraction&&(this.strategy=new we[this.triggerInteraction](this.triggerElement,{overlay:this}))}handleBeforetoggle(t){t.newState!=="open"&&this.handleBrowserClose(t)}handleBrowserClose(t){var i;if(t.stopPropagation(),!((i=this.strategy)!=null&&i.activelyOpening)){this.open=!1;return}this.manuallyKeepOpen()}manuallyKeepOpen(){this.open=!0,this.placementController.allowPlacementUpdate=!0,this.manageOpen(!1)}handleSlotchange(){var t,i;this.elements.length===0?(t=this.strategy)==null||t.releaseDescription():this.hasNonVirtualTrigger&&((i=this.strategy)==null||i.prepareDescription(this.triggerElement))}shouldPreventClose(){const t=this.willPreventClose;return this.willPreventClose=!1,t}requestSlottable(){this.lastRequestSlottableState!==this.open&&(this.open||document.body.offsetHeight,this.dispatchEvent(new Kt.SlottableRequestEvent("overlay-content",this.open?{}:Kt.removeSlottableRequest)),this.lastRequestSlottableState=this.open)}willUpdate(t){var n;if(this.hasAttribute("id")||this.setAttribute("id",`${this.tagName.toLowerCase()}-${Ft.randomID()}`),t.has("open")&&(this.hasUpdated||this.open)&&this.manageOpen(t.get("open")),t.has("trigger")){const[o,s]=((n=this.trigger)==null?void 0:n.split("@"))||[];this.elementResolver.selector=o?`#${o}`:"",this.triggerInteraction=s}let i=!1;t.has(jt.elementResolverUpdatedSymbol)&&(i=this.triggerElement,this.triggerElement=this.elementResolver.element),t.has("triggerElement")&&(i=t.get("triggerElement")),i!==!1&&this.bindEvents()}updated(t){super.updated(t),t.has("placement")&&(this.placement?this.dialogEl.setAttribute("actual-placement",this.placement):this.dialogEl.removeAttribute("actual-placement"),this.open&&t.get("placement")!==void 0&&this.placementController.resetOverlayPosition()),t.has("state")&&this.state==="closed"&&t.get("state")!==void 0&&this.placementController.clearOverlayPosition()}renderContent(){return lt.html` <slot @slotchange=${this.handleSlotchange}></slot> `}get dialogStyleMap(){return{"--luzmo-overlay-open-count":B.openCount.toString()}}renderDialog(){return lt.html`
|
|
19
|
-
<dialog
|
|
20
|
-
class="dialog"
|
|
21
|
-
part="dialog"
|
|
22
|
-
placement=${At.o(this.requiresPositioning?this.placement||"right":void 0)}
|
|
23
|
-
style=${Ut.o(this.dialogStyleMap)}
|
|
24
|
-
@close=${this.handleBrowserClose}
|
|
25
|
-
@cancel=${this.handleBrowserClose}
|
|
26
|
-
@beforetoggle=${this.handleBeforetoggle}
|
|
27
|
-
?is-visible=${this.state!=="closed"}
|
|
28
|
-
>
|
|
29
|
-
${this.renderContent()}
|
|
30
|
-
</dialog>
|
|
31
|
-
`}renderPopover(){return lt.html`
|
|
32
|
-
<div
|
|
33
|
-
class="dialog"
|
|
34
|
-
part="dialog"
|
|
35
|
-
placement=${At.o(this.requiresPositioning?this.placement||"right":void 0)}
|
|
36
|
-
popover=${At.o(this.popoverValue)}
|
|
37
|
-
style=${Ut.o(this.dialogStyleMap)}
|
|
38
|
-
@beforetoggle=${this.handleBeforetoggle}
|
|
39
|
-
@close=${this.handleBrowserClose}
|
|
40
|
-
?is-visible=${this.state!=="closed"}
|
|
41
|
-
>
|
|
42
|
-
${this.renderContent()}
|
|
43
|
-
</div>
|
|
44
|
-
`}render(){const t=this.type==="modal"||this.type==="page";return lt.html`
|
|
45
|
-
${t?this.renderDialog():this.renderPopover()}
|
|
46
|
-
<slot name="longpress-describedby-descriptor"></slot>
|
|
47
|
-
`}connectedCallback(){super.connectedCallback(),this.addEventListener("close",()=>{this.open=!1}),this.hasUpdated&&this.bindEvents()}disconnectedCallback(){var t;(t=this.strategy)==null||t.releaseDescription(),this.open=!1,super.disconnectedCallback()}},B.styles=[lt.unsafeCSS(Ne)],B.openCount=1,B);O([D.n({type:Boolean})],C.prototype,"delayed",1);O([ne.e(".dialog")],C.prototype,"dialogEl",2);O([D.n({type:Boolean})],C.prototype,"disabled",1);O([Ce.o({flatten:!0,selector:':not([slot="longpress-describedby-descriptor"], slot)'})],C.prototype,"elements",2);O([D.n({type:Number})],C.prototype,"offset",2);O([D.n({type:Boolean,reflect:!0})],C.prototype,"open",1);O([D.n()],C.prototype,"placement",2);O([D.n({attribute:"receives-focus"})],C.prototype,"receivesFocus",2);O([ne.e("slot")],C.prototype,"slotEl",2);O([Ee.r()],C.prototype,"state",1);O([D.n({type:Number,attribute:"tip-padding"})],C.prototype,"tipPadding",2);O([D.n()],C.prototype,"trigger",2);O([D.n({attribute:!1})],C.prototype,"triggerElement",2);O([D.n({attribute:!1})],C.prototype,"triggerInteraction",2);O([D.n()],C.prototype,"type",2);let be=C;const xt=Object.freeze(Object.defineProperty({__proto__:null,LuzmoOverlay:be},Symbol.toStringTag,{value:"Module"}));exports.ClickController=me;exports.HoverController=ge;exports.InteractionController=Tt;exports.InteractionTypes=pt;exports.LONGPRESS_INSTRUCTIONS=ve;exports.LongpressController=ye;exports.LuzmoAbstractOverlay=it;exports.LuzmoOverlay=be;exports.PlacementController=fe;exports.VirtualTrigger=dt;exports.guaranteedAllTransitionend=Et;exports.nextFrame=A;exports.noop=Y;exports.overlay=xt;exports.overlayTimer=at;exports.placementUpdatedSymbol=bi;exports.strategies=we;
|