@luzmo/lucero 0.0.10 → 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.
Files changed (172) hide show
  1. package/components/accordion/index.cjs +5 -5
  2. package/components/accordion/index.js +9 -10
  3. package/components/action-bar/index.cjs +4 -4
  4. package/components/action-bar/index.js +10 -10
  5. package/components/action-button/index.cjs +2 -2
  6. package/components/action-button/index.js +4 -4
  7. package/components/action-group/index.cjs +1 -1
  8. package/components/action-group/index.js +1 -1
  9. package/components/action-group-B59CWNnT.cjs +20 -0
  10. package/components/{action-group-Bf28z235.js → action-group-DzT5e9uS.js} +8 -9
  11. package/components/action-menu/index.cjs +9 -9
  12. package/components/action-menu/index.js +8 -9
  13. package/components/avatar/index.cjs +3 -3
  14. package/components/avatar/index.js +6 -7
  15. package/components/base-CCsOyfm4.js +632 -0
  16. package/components/base-CaRKlVkL.cjs +36 -0
  17. package/components/button/index.cjs +2 -2
  18. package/components/button/index.js +7 -7
  19. package/components/{button-base-CDLQV7Vk.js → button-base-BUylwU1F.js} +5 -6
  20. package/components/button-base-D62oiPcu.cjs +25 -0
  21. package/components/button-group/index.cjs +1 -1
  22. package/components/button-group/index.js +6 -6
  23. package/components/checkbox/index.cjs +4 -4
  24. package/components/checkbox/index.js +4 -4
  25. package/components/{checkbox-mixin-DXUIwtea.js → checkbox-mixin-CM4VUJxF.js} +9 -10
  26. package/components/{checkbox-mixin-DaXMsrtV.cjs → checkbox-mixin-CifGmiLR.cjs} +3 -3
  27. package/components/{clear-button-Dh2Mq0cc.js → clear-button-BmUyRVoz.js} +4 -4
  28. package/components/clear-button-Cc5-XUOJ.cjs +18 -0
  29. package/components/{close-button-BsYkXOVh.js → close-button-BekXo6bQ.js} +10 -10
  30. package/components/close-button-Bf8yzpLd.cjs +18 -0
  31. package/components/color-area/index.cjs +6 -6
  32. package/components/color-area/index.js +10 -11
  33. package/components/color-field/index.cjs +2 -2
  34. package/components/color-field/index.js +3 -3
  35. package/components/color-handle/index.cjs +2 -2
  36. package/components/color-handle/index.js +6 -6
  37. package/components/color-loupe/index.cjs +1 -1
  38. package/components/color-loupe/index.js +1 -1
  39. package/components/color-loupe-CLzp2MiI.cjs +56 -0
  40. package/components/{color-loupe-BCfIVFkB.js → color-loupe-DiegGLZu.js} +4 -4
  41. package/components/color-menu/index.cjs +5 -5
  42. package/components/color-menu/index.js +5 -7
  43. package/components/color-picker/index.cjs +4 -4
  44. package/components/color-picker/index.js +11 -13
  45. package/components/color-slider/index.cjs +7 -7
  46. package/components/color-slider/index.js +6 -7
  47. package/components/divider/index.cjs +1 -1
  48. package/components/divider/index.js +6 -6
  49. package/components/field-group/index.cjs +1 -1
  50. package/components/field-group/index.js +1 -1
  51. package/components/{field-group-CwZULltm.js → field-group-BPZvGJi1.js} +6 -6
  52. package/components/field-group-CodR_26L.cjs +23 -0
  53. package/components/field-label/index.cjs +1 -1
  54. package/components/field-label/index.js +1 -1
  55. package/components/{field-label-C3HFlH91.js → field-label-6AaW05kA.js} +7 -8
  56. package/components/field-label-B91K6moC.cjs +25 -0
  57. package/components/focusable-BFdecx5l.cjs +18 -0
  58. package/components/{focusable-zT9NFFYs.js → focusable-CxA_NMK_.js} +2 -1
  59. package/components/icon/index.cjs +1 -1
  60. package/components/icon/index.js +6 -6
  61. package/components/index-Cg_y7WKM.cjs +77 -0
  62. package/components/{index-C2qG2Sm8.js → index-QeYYAZQR.js} +15 -18
  63. package/components/index.cjs +1 -1
  64. package/components/index.js +16 -16
  65. package/components/infield-button/index.cjs +2 -2
  66. package/components/infield-button/index.js +4 -4
  67. package/components/label/index.cjs +1 -1
  68. package/components/label/index.js +5 -5
  69. package/components/{like-anchor-DoJWh4Uu.js → like-anchor-D7tY6am5.js} +21 -21
  70. package/components/like-anchor-b3cNzw52.cjs +32 -0
  71. package/components/{manage-help-text-BzWK2v8i.js → manage-help-text-CmE_nfjl.js} +8 -8
  72. package/components/{manage-help-text-BKlmmlgp.cjs → manage-help-text-CoX77cTJ.cjs} +3 -3
  73. package/components/menu/index.cjs +1 -1
  74. package/components/menu/index.js +1 -1
  75. package/components/multi-language-field/index.cjs +2 -2
  76. package/components/multi-language-field/index.js +7 -7
  77. package/components/number-field/index.cjs +4 -4
  78. package/components/number-field/index.js +16 -17
  79. package/components/observe-slot-text-ByPG1Lqw.cjs +18 -0
  80. package/components/{observe-slot-text-BG0H7bQK.js → observe-slot-text-CugmOzNZ.js} +20 -21
  81. package/components/overlay/index.cjs +7 -7
  82. package/components/overlay/index.js +45 -49
  83. package/components/overlay-BWBJGJN_.cjs +47 -0
  84. package/components/{overlay-D7EbnA6E.js → overlay-CtdbWiFs.js} +71 -74
  85. package/components/{pending-state-DHXuiejX.js → pending-state-B_JeaE62.js} +2 -2
  86. package/components/{pending-state-BHCOneQ7.cjs → pending-state-DWvTsSoS.cjs} +2 -2
  87. package/components/picker/index.cjs +1 -1
  88. package/components/picker/index.js +2 -2
  89. package/components/picker-CaC1rQOK.cjs +123 -0
  90. package/components/{picker-ChtCbFLB.js → picker-DwbcFve2.js} +109 -140
  91. package/components/popover/index.cjs +1 -1
  92. package/components/popover/index.js +1 -1
  93. package/components/popover-C4w3aY8m.cjs +30 -0
  94. package/components/{popover-bg0EQQ8p.js → popover-DLFHilGS.js} +6 -7
  95. package/components/progress-circle/index.cjs +1 -1
  96. package/components/progress-circle/index.js +1 -1
  97. package/components/progress-circle-BXyXtMcs.cjs +33 -0
  98. package/components/{progress-circle-BT2qW7LK.js → progress-circle-CUCJ_Ehs.js} +6 -7
  99. package/components/radio/index.cjs +2 -2
  100. package/components/radio/index.js +9 -10
  101. package/components/search/index.cjs +7 -7
  102. package/components/search/index.js +4 -5
  103. package/components/{base-BjTwmyRF.cjs → sized-mixin-DcvJLFeo.cjs} +1 -5
  104. package/components/{sized-mixin-PyCYpyQq.js → sized-mixin-cJbo3PKR.js} +5 -5
  105. package/components/slider/index.cjs +1 -1
  106. package/components/slider/index.js +6 -6
  107. package/components/{streaming-listener-wjMvsv4N.js → streaming-listener-BgCzt2TI.js} +5 -6
  108. package/components/streaming-listener-C2bsIc4J.cjs +18 -0
  109. package/components/swatch/index.cjs +7 -7
  110. package/components/swatch/index.js +11 -12
  111. package/components/switch/index.cjs +2 -2
  112. package/components/switch/index.js +5 -5
  113. package/components/tags/index.cjs +4 -4
  114. package/components/tags/index.js +12 -13
  115. package/components/text-field/index.cjs +3 -3
  116. package/components/text-field/index.js +8 -8
  117. package/components/text-field-BX_aHXSW.js +288 -0
  118. package/components/text-field-DAr2RyH9.cjs +81 -0
  119. package/components/toast/index.cjs +5 -5
  120. package/components/toast/index.js +5 -5
  121. package/components/tooltip/index.cjs +4 -4
  122. package/components/tooltip/index.js +6 -7
  123. package/components/unit-input/index.cjs +6 -6
  124. package/components/unit-input/index.js +5 -6
  125. package/components/utils.cjs +1 -1
  126. package/components/utils.js +4 -4
  127. package/custom-elements.json +1 -1
  128. package/package.json +2 -1
  129. package/components/action-group-BBoV2VL9.cjs +0 -20
  130. package/components/async-directive-CV2MII86.cjs +0 -22
  131. package/components/async-directive-FGzMycjH.js +0 -82
  132. package/components/base-D76d76ww.js +0 -26
  133. package/components/base-DNrOP9L3.js +0 -391
  134. package/components/base-DzbGOAPo.cjs +0 -30
  135. package/components/button-base-C1ceE1LF.cjs +0 -25
  136. package/components/clear-button-pnT9_M8M.cjs +0 -18
  137. package/components/close-button-CPtjRQ0R.cjs +0 -18
  138. package/components/color-loupe-DIBrhG1Y.cjs +0 -56
  139. package/components/directive-C7oCP5Bh.cjs +0 -22
  140. package/components/directive-helpers-BLDZnGQv.js +0 -28
  141. package/components/directive-helpers-C2vOfhFx.cjs +0 -22
  142. package/components/directive-oAbCiebi.js +0 -44
  143. package/components/field-group-eICRTHzI.cjs +0 -23
  144. package/components/field-label-DOIVL4S4.cjs +0 -25
  145. package/components/focusable-zn6qaMtV.cjs +0 -18
  146. package/components/if-defined-CYpcjGCb.js +0 -27
  147. package/components/if-defined-Cv6xanXh.cjs +0 -22
  148. package/components/index-BYumXRH5.cjs +0 -77
  149. package/components/like-anchor-CmIcmz5k.cjs +0 -32
  150. package/components/lit-html-B3ugcwD9.js +0 -248
  151. package/components/lit-html-p4Oxv2-5.cjs +0 -24
  152. package/components/observe-slot-text-CP_EB97X.cjs +0 -18
  153. package/components/overlay-B1JDPmUJ.cjs +0 -47
  154. package/components/picker-CLKdhX0B.cjs +0 -127
  155. package/components/popover-CdkB6GFb.cjs +0 -30
  156. package/components/progress-circle-DTeqfeun.cjs +0 -33
  157. package/components/query-BL-TJj7K.cjs +0 -22
  158. package/components/query-D_KR_GUc.js +0 -51
  159. package/components/query-assigned-elements-DjfhL1cl.js +0 -36
  160. package/components/query-assigned-elements-DsKsfk7G.cjs +0 -22
  161. package/components/query-assigned-nodes-BcKWmGzy.cjs +0 -22
  162. package/components/query-assigned-nodes-C76XVPWY.js +0 -36
  163. package/components/sized-mixin-BEemErtP.cjs +0 -18
  164. package/components/state-BG4JQVA1.js +0 -29
  165. package/components/state-DHaIxrnQ.cjs +0 -22
  166. package/components/streaming-listener-BQxEN4sL.cjs +0 -18
  167. package/components/style-map-BjBGQ_u3.cjs +0 -22
  168. package/components/style-map-BqvQDFJt.js +0 -53
  169. package/components/text-field-7ITo3Lac.js +0 -315
  170. package/components/text-field-CtUKbEQN.cjs +0 -85
  171. package/components/when-CDK1Tt5Y.js +0 -28
  172. package/components/when-CDZyJPvd.cjs +0 -22
@@ -16,26 +16,25 @@
16
16
  * SOFTWARE.
17
17
  * */
18
18
  import { s as m } from "./mutation-controller-DH7YOCyj.js";
19
- import { n as x } from "./base-DNrOP9L3.js";
20
- import { n as b } from "./query-assigned-nodes-C76XVPWY.js";
21
- var g = Object.defineProperty, p = (d, n, i, f) => {
22
- for (var t = void 0, o = d.length - 1, r; o >= 0; o--)
23
- (r = d[o]) && (t = r(n, i, t) || t);
24
- return t && g(n, i, t), t;
19
+ import { property as g, queryAssignedNodes as x } from "lit/decorators.js";
20
+ var b = Object.defineProperty, p = (l, n, i, u) => {
21
+ for (var t = void 0, o = l.length - 1, r; o >= 0; o--)
22
+ (r = l[o]) && (t = r(n, i, t) || t);
23
+ return t && b(n, i, t), t;
25
24
  };
26
- const u = Symbol("assignedNodes");
27
- function y(d, n, i = []) {
28
- var f, t;
25
+ const f = Symbol("assignedNodes");
26
+ function O(l, n, i = []) {
27
+ var u, t;
29
28
  const o = (c) => (e) => c.matches(e);
30
- class r extends (t = d, f = u, t) {
29
+ class r extends (t = l, u = f, t) {
31
30
  constructor(...e) {
32
31
  super(e), this.slotHasContent = !1, new m(this, {
33
32
  config: {
34
33
  characterData: !0,
35
34
  subtree: !0
36
35
  },
37
- callback: (l) => {
38
- for (const s of l)
36
+ callback: (d) => {
37
+ for (const s of d)
39
38
  if (s.type === "characterData") {
40
39
  this.manageTextObservedSlot();
41
40
  return;
@@ -44,11 +43,11 @@ function y(d, n, i = []) {
44
43
  });
45
44
  }
46
45
  manageTextObservedSlot() {
47
- if (!this[u])
46
+ if (!this[f])
48
47
  return;
49
- const e = [...this[u]].filter(
50
- (l) => {
51
- const s = l;
48
+ const e = [...this[f]].filter(
49
+ (d) => {
50
+ const s = d;
52
51
  return s.tagName ? !i.some(o(s)) : s.textContent ? s.textContent.trim() : !1;
53
52
  }
54
53
  );
@@ -56,7 +55,7 @@ function y(d, n, i = []) {
56
55
  }
57
56
  update(e) {
58
57
  if (!this.hasUpdated) {
59
- const { childNodes: l } = this, s = [...l].filter((h) => {
58
+ const { childNodes: d } = this, s = [...d].filter((h) => {
60
59
  const a = h;
61
60
  return a.tagName ? i.some(o(a)) ? !1 : (
62
61
  // Confirm it would exist in a targeted slot if there was one supplied.
@@ -74,14 +73,14 @@ function y(d, n, i = []) {
74
73
  }
75
74
  }
76
75
  return p([
77
- x({ type: Boolean, attribute: !1 })
76
+ g({ type: Boolean, attribute: !1 })
78
77
  ], r.prototype, "slotHasContent"), p([
79
- b({
78
+ x({
80
79
  slot: n,
81
80
  flatten: !0
82
81
  })
83
- ], r.prototype, f), r;
82
+ ], r.prototype, u), r;
84
83
  }
85
84
  export {
86
- y as O
85
+ O
87
86
  };
@@ -15,9 +15,9 @@
15
15
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
16
16
  * SOFTWARE.
17
17
  * */
18
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../overlay-B1JDPmUJ.cjs"),l=require("lit"),c=require("../base-DzbGOAPo.cjs"),u=require("../state-DHaIxrnQ.cjs"),v=require("../query-BL-TJj7K.cjs");require("../lit-html-p4Oxv2-5.cjs");const b=require("../directive-C7oCP5Bh.cjs"),S=require("../async-directive-CV2MII86.cjs"),d=require("../slottable-request-event-BfUUt1Mh.cjs"),$=":host([disabled]) ::slotted([slot=trigger]){pointer-events:none}slot[name=longpress-describedby-descriptor]{display:none}";var k=Object.defineProperty,i=(g,e,t,r)=>{for(var s=void 0,a=g.length-1,h;a>=0;a--)(h=g[a])&&(s=h(e,t,s)||s);return s&&k(e,t,s),s};class o extends c.LuzmoElement{constructor(){super(...arguments),this.content="click hover longpress",this.offset=6,this.disabled=!1,this.receivesFocus="auto",this.clickContent=[],this.longpressContent=[],this.hoverContent=[],this.targetContent=[]}static get styles(){return[l.unsafeCSS($)]}getAssignedElementsFromSlot(e){return e.assignedElements({flatten:!0})}handleTriggerContent(e){this.targetContent=this.getAssignedElementsFromSlot(e.target)}handleSlotContent(e){switch(e.target.name){case"click-content":{this.clickContent=this.getAssignedElementsFromSlot(e.target);break}case"longpress-content":{this.longpressContent=this.getAssignedElementsFromSlot(e.target);break}case"hover-content":{this.hoverContent=this.getAssignedElementsFromSlot(e.target);break}}}handleBeforetoggle(e){const{target:t}=e;let r;if(t===this.clickOverlayElement)r="click";else if(t===this.longpressOverlayElement)r="longpress";else if(t===this.hoverOverlayElement)r="hover";else return;e.newState==="open"?this.open=r:this.open===r&&(this.open=void 0)}update(e){var t,r,s,a,h,p;e.has("clickContent")&&(this.clickPlacement=((t=this.clickContent[0])==null?void 0:t.getAttribute("placement"))||((r=this.clickContent[0])==null?void 0:r.getAttribute("direction"))||void 0),e.has("hoverContent")&&(this.hoverPlacement=((s=this.hoverContent[0])==null?void 0:s.getAttribute("placement"))||((a=this.hoverContent[0])==null?void 0:a.getAttribute("direction"))||void 0),e.has("longpressContent")&&(this.longpressPlacement=((h=this.longpressContent[0])==null?void 0:h.getAttribute("placement"))||((p=this.longpressContent[0])==null?void 0:p.getAttribute("direction"))||void 0),super.update(e)}renderSlot(e){return l.html`
18
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../overlay-BWBJGJN_.cjs"),i=require("../base-CaRKlVkL.cjs"),l=require("lit/decorators.js"),d=require("lit/async-directive.js"),u=require("../slottable-request-event-BfUUt1Mh.cjs"),C=":host([disabled]) ::slotted([slot=trigger]){pointer-events:none}slot[name=longpress-describedby-descriptor]{display:none}";var O=Object.defineProperty,a=(g,e,t,r)=>{for(var n=void 0,h=g.length-1,c;h>=0;h--)(c=g[h])&&(n=c(e,t,n)||n);return n&&O(e,t,n),n};class s extends i.LuzmoElement{constructor(){super(...arguments),this.content="click hover longpress",this.offset=6,this.disabled=!1,this.receivesFocus="auto",this.clickContent=[],this.longpressContent=[],this.hoverContent=[],this.targetContent=[]}static get styles(){return[i.r(C)]}getAssignedElementsFromSlot(e){return e.assignedElements({flatten:!0})}handleTriggerContent(e){this.targetContent=this.getAssignedElementsFromSlot(e.target)}handleSlotContent(e){switch(e.target.name){case"click-content":{this.clickContent=this.getAssignedElementsFromSlot(e.target);break}case"longpress-content":{this.longpressContent=this.getAssignedElementsFromSlot(e.target);break}case"hover-content":{this.hoverContent=this.getAssignedElementsFromSlot(e.target);break}}}handleBeforetoggle(e){const{target:t}=e;let r;if(t===this.clickOverlayElement)r="click";else if(t===this.longpressOverlayElement)r="longpress";else if(t===this.hoverOverlayElement)r="hover";else return;e.newState==="open"?this.open=r:this.open===r&&(this.open=void 0)}update(e){var t,r,n,h,c,p;e.has("clickContent")&&(this.clickPlacement=((t=this.clickContent[0])==null?void 0:t.getAttribute("placement"))||((r=this.clickContent[0])==null?void 0:r.getAttribute("direction"))||void 0),e.has("hoverContent")&&(this.hoverPlacement=((n=this.hoverContent[0])==null?void 0:n.getAttribute("placement"))||((h=this.hoverContent[0])==null?void 0:h.getAttribute("direction"))||void 0),e.has("longpressContent")&&(this.longpressPlacement=((c=this.longpressContent[0])==null?void 0:c.getAttribute("placement"))||((p=this.longpressContent[0])==null?void 0:p.getAttribute("direction"))||void 0),super.update(e)}renderSlot(e){return i.x`
19
19
  <slot name=${e} @slotchange=${this.handleSlotContent}></slot>
20
- `}renderClickOverlay(){Promise.resolve().then(()=>require("../overlay-B1JDPmUJ.cjs")).then(t=>t.overlay);const e=this.renderSlot("click-content");return this.clickContent.length===0?e:l.html`
20
+ `}renderClickOverlay(){Promise.resolve().then(()=>require("../overlay-BWBJGJN_.cjs")).then(t=>t.overlay);const e=this.renderSlot("click-content");return this.clickContent.length===0?e:i.x`
21
21
  <luzmo-overlay
22
22
  id="click-overlay"
23
23
  ?disabled=${this.disabled||this.clickContent.length===0}
@@ -32,7 +32,7 @@
32
32
  >
33
33
  ${e}
34
34
  </luzmo-overlay>
35
- `}renderHoverOverlay(){Promise.resolve().then(()=>require("../overlay-B1JDPmUJ.cjs")).then(t=>t.overlay);const e=this.renderSlot("hover-content");return this.hoverContent.length===0?e:l.html`
35
+ `}renderHoverOverlay(){Promise.resolve().then(()=>require("../overlay-BWBJGJN_.cjs")).then(t=>t.overlay);const e=this.renderSlot("hover-content");return this.hoverContent.length===0?e:i.x`
36
36
  <luzmo-overlay
37
37
  id="hover-overlay"
38
38
  ?open=${this.open==="hover"&&this.hoverContent.length>0}
@@ -47,7 +47,7 @@
47
47
  >
48
48
  ${e}
49
49
  </luzmo-overlay>
50
- `}renderLongpressOverlay(){Promise.resolve().then(()=>require("../overlay-B1JDPmUJ.cjs")).then(t=>t.overlay);const e=this.renderSlot("longpress-content");return this.longpressContent.length===0?e:l.html`
50
+ `}renderLongpressOverlay(){Promise.resolve().then(()=>require("../overlay-BWBJGJN_.cjs")).then(t=>t.overlay);const e=this.renderSlot("longpress-content");return this.longpressContent.length===0?e:i.x`
51
51
  <luzmo-overlay
52
52
  id="longpress-overlay"
53
53
  ?disabled=${this.disabled||this.longpressContent.length===0}
@@ -63,11 +63,11 @@
63
63
  ${e}
64
64
  </luzmo-overlay>
65
65
  <slot name="longpress-describedby-descriptor"></slot>
66
- `}render(){const e=this.content.split(" ");return l.html`
66
+ `}render(){const e=this.content.split(" ");return i.x`
67
67
  <slot
68
68
  id="trigger"
69
69
  name="trigger"
70
70
  @slotchange=${this.handleTriggerContent}
71
71
  ></slot>
72
- ${[e.includes("click")?this.renderClickOverlay():l.html``,e.includes("hover")?this.renderHoverOverlay():l.html``,e.includes("longpress")?this.renderLongpressOverlay():l.html``]}
73
- `}updated(e){if(super.updated(e),this.disabled&&e.has("disabled")){this.open=void 0;return}}async getUpdateComplete(){return await super.getUpdateComplete()}}i([c.n()],o.prototype,"content");i([c.n({reflect:!0})],o.prototype,"placement");i([c.n()],o.prototype,"type");i([c.n({type:Number})],o.prototype,"offset");i([c.n({reflect:!0})],o.prototype,"open");i([c.n({type:Boolean,reflect:!0})],o.prototype,"disabled");i([c.n({attribute:"receives-focus"})],o.prototype,"receivesFocus");i([u.r()],o.prototype,"clickContent");i([u.r()],o.prototype,"longpressContent");i([u.r()],o.prototype,"hoverContent");i([u.r()],o.prototype,"targetContent");i([v.e("#click-overlay",!0)],o.prototype,"clickOverlayElement");i([v.e("#longpress-overlay",!0)],o.prototype,"longpressOverlayElement");i([v.e("#hover-overlay",!0)],o.prototype,"hoverOverlayElement");function q(g,e,t,r){return n.LuzmoOverlay.open(g,e,t,r)}class m extends S.f{render(e){return l.nothing}update(e,[t]){this.template=t,this.target!==e.element&&(this.target=e.element,this.renderBefore=this.target.children[0]),this.listenerHost=this.target,this.init()}handleSlottableRequest(e){if(e.target!==e.currentTarget)return;const t=e.data===d.removeSlottableRequest;l.render(t?void 0:this.template(),this.target,{renderBefore:this.renderBefore})}init(){var t;(t=this.listeners)==null||t.abort(),this.listeners=new AbortController;const{signal:e}=this.listeners;this.listenerHost.addEventListener("slottable-request",r=>this.handleSlottableRequest(r),{signal:e})}disconnected(){var e;(e=this.listeners)==null||e.abort()}reconnected(){this.init()}}const E=b.e(m);class C extends m{constructor(){super(...arguments),this.defaultOptions={triggerInteraction:"click",overlayOptions:{type:"auto",offset:0}},this.options={...this.defaultOptions.overlayOptions}}render(e,t){return l.nothing}update(e,[t,r]){var p,y,f;this.options={...this.defaultOptions.overlayOptions,...r==null?void 0:r.overlayOptions},this.insertionOptions=r==null?void 0:r.insertionOptions,this.template=t,this.host=(p=e.options)==null?void 0:p.host;let s=!1;const a=(r==null?void 0:r.triggerInteraction)||this.defaultOptions.triggerInteraction,h=n.InteractionTypes[(y=this.strategy)==null?void 0:y.type]!==a;this.target!==e.element&&(this.target=e.element,s=!0),(s||h)&&((f=this.strategy)==null||f.abort(),this.strategy=new n.strategies[a](this.target,{isPersistent:!0,handleOverlayReady:O=>{this.listenerHost=this.overlay=O,this.init()}})),this.strategy.open=(r==null?void 0:r.open)??!1}handleSlottableRequest(e){var s,a;if(e.target!==e.currentTarget)return;const t=e.data===d.removeSlottableRequest,r={};if(this.host&&(r.host=this.host),l.render(t?void 0:this.template(),this.overlay,r),t)this.overlay.remove();else{n.LuzmoAbstractOverlay.applyOptions(this.overlay,{...this.options,trigger:this.target});const h=typeof((s=this.insertionOptions)==null?void 0:s.el)=="function"?this.insertionOptions.el():((a=this.insertionOptions)==null?void 0:a.el)||this.target,{where:p="afterend"}=this.insertionOptions||{};h.insertAdjacentElement(p,this.overlay)}}}const T=b.e(C);customElements.get("luzmo-overlay")||customElements.define("luzmo-overlay",n.LuzmoOverlay);customElements.get("luzmo-overlay-trigger")||customElements.define("luzmo-overlay-trigger",o);exports.ClickController=n.ClickController;exports.HoverController=n.HoverController;exports.InteractionController=n.InteractionController;exports.InteractionTypes=n.InteractionTypes;exports.LONGPRESS_INSTRUCTIONS=n.LONGPRESS_INSTRUCTIONS;exports.LongpressController=n.LongpressController;exports.LuzmoAbstractOverlay=n.LuzmoAbstractOverlay;exports.LuzmoOverlay=n.LuzmoOverlay;exports.PlacementController=n.PlacementController;exports.VirtualTrigger=n.VirtualTrigger;exports.guaranteedAllTransitionend=n.guaranteedAllTransitionend;exports.nextFrame=n.nextFrame;exports.noop=n.noop;exports.overlayTimer=n.overlayTimer;exports.placementUpdatedSymbol=n.placementUpdatedSymbol;exports.SlottableRequestEvent=d.SlottableRequestEvent;exports.removeSlottableRequest=d.removeSlottableRequest;exports.LuzmoOverlayTrigger=o;exports.OverlayTriggerDirective=C;exports.SlottableRequestDirective=m;exports.openOverlay=q;exports.slottableRequest=E;exports.trigger=T;
72
+ ${[e.includes("click")?this.renderClickOverlay():i.x``,e.includes("hover")?this.renderHoverOverlay():i.x``,e.includes("longpress")?this.renderLongpressOverlay():i.x``]}
73
+ `}updated(e){if(super.updated(e),this.disabled&&e.has("disabled")){this.open=void 0;return}}async getUpdateComplete(){return await super.getUpdateComplete()}}a([l.property()],s.prototype,"content");a([l.property({reflect:!0})],s.prototype,"placement");a([l.property()],s.prototype,"type");a([l.property({type:Number})],s.prototype,"offset");a([l.property({reflect:!0})],s.prototype,"open");a([l.property({type:Boolean,reflect:!0})],s.prototype,"disabled");a([l.property({attribute:"receives-focus"})],s.prototype,"receivesFocus");a([l.state()],s.prototype,"clickContent");a([l.state()],s.prototype,"longpressContent");a([l.state()],s.prototype,"hoverContent");a([l.state()],s.prototype,"targetContent");a([l.query("#click-overlay",!0)],s.prototype,"clickOverlayElement");a([l.query("#longpress-overlay",!0)],s.prototype,"longpressOverlayElement");a([l.query("#hover-overlay",!0)],s.prototype,"hoverOverlayElement");function S(g,e,t,r){return o.LuzmoOverlay.open(g,e,t,r)}class v extends d.AsyncDirective{render(e){return i.E}update(e,[t]){this.template=t,this.target!==e.element&&(this.target=e.element,this.renderBefore=this.target.children[0]),this.listenerHost=this.target,this.init()}handleSlottableRequest(e){if(e.target!==e.currentTarget)return;const t=e.data===u.removeSlottableRequest;i.B(t?void 0:this.template(),this.target,{renderBefore:this.renderBefore})}init(){var t;(t=this.listeners)==null||t.abort(),this.listeners=new AbortController;const{signal:e}=this.listeners;this.listenerHost.addEventListener("slottable-request",r=>this.handleSlottableRequest(r),{signal:e})}disconnected(){var e;(e=this.listeners)==null||e.abort()}reconnected(){this.init()}}const $=d.directive(v);class f extends v{constructor(){super(...arguments),this.defaultOptions={triggerInteraction:"click",overlayOptions:{type:"auto",offset:0}},this.options={...this.defaultOptions.overlayOptions}}render(e,t){return i.E}update(e,[t,r]){var p,y,m;this.options={...this.defaultOptions.overlayOptions,...r==null?void 0:r.overlayOptions},this.insertionOptions=r==null?void 0:r.insertionOptions,this.template=t,this.host=(p=e.options)==null?void 0:p.host;let n=!1;const h=(r==null?void 0:r.triggerInteraction)||this.defaultOptions.triggerInteraction,c=o.InteractionTypes[(y=this.strategy)==null?void 0:y.type]!==h;this.target!==e.element&&(this.target=e.element,n=!0),(n||c)&&((m=this.strategy)==null||m.abort(),this.strategy=new o.strategies[h](this.target,{isPersistent:!0,handleOverlayReady:b=>{this.listenerHost=this.overlay=b,this.init()}})),this.strategy.open=(r==null?void 0:r.open)??!1}handleSlottableRequest(e){var n,h;if(e.target!==e.currentTarget)return;const t=e.data===u.removeSlottableRequest,r={};if(this.host&&(r.host=this.host),i.B(t?void 0:this.template(),this.overlay,r),t)this.overlay.remove();else{o.LuzmoAbstractOverlay.applyOptions(this.overlay,{...this.options,trigger:this.target});const c=typeof((n=this.insertionOptions)==null?void 0:n.el)=="function"?this.insertionOptions.el():((h=this.insertionOptions)==null?void 0:h.el)||this.target,{where:p="afterend"}=this.insertionOptions||{};c.insertAdjacentElement(p,this.overlay)}}}const k=d.directive(f);customElements.get("luzmo-overlay")||customElements.define("luzmo-overlay",o.LuzmoOverlay);customElements.get("luzmo-overlay-trigger")||customElements.define("luzmo-overlay-trigger",s);exports.ClickController=o.ClickController;exports.HoverController=o.HoverController;exports.InteractionController=o.InteractionController;exports.InteractionTypes=o.InteractionTypes;exports.LONGPRESS_INSTRUCTIONS=o.LONGPRESS_INSTRUCTIONS;exports.LongpressController=o.LongpressController;exports.LuzmoAbstractOverlay=o.LuzmoAbstractOverlay;exports.LuzmoOverlay=o.LuzmoOverlay;exports.PlacementController=o.PlacementController;exports.VirtualTrigger=o.VirtualTrigger;exports.guaranteedAllTransitionend=o.guaranteedAllTransitionend;exports.nextFrame=o.nextFrame;exports.noop=o.noop;exports.overlayTimer=o.overlayTimer;exports.placementUpdatedSymbol=o.placementUpdatedSymbol;exports.SlottableRequestEvent=u.SlottableRequestEvent;exports.removeSlottableRequest=u.removeSlottableRequest;exports.LuzmoOverlayTrigger=s;exports.OverlayTriggerDirective=f;exports.SlottableRequestDirective=v;exports.openOverlay=S;exports.slottableRequest=$;exports.trigger=k;
@@ -15,17 +15,13 @@
15
15
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
16
16
  * SOFTWARE.
17
17
  * */
18
- import { e as f, I as O, s as S, L as $ } from "../overlay-D7EbnA6E.js";
19
- import { C as J, H as K, b as Q, c as W, d as X, P as Y, V as Z, g as ee, a as te, n as oe, o as re, p as le } from "../overlay-D7EbnA6E.js";
20
- import { unsafeCSS as E, html as c, nothing as z, render as b } from "lit";
21
- import { a as w, n as u } from "../base-DNrOP9L3.js";
22
- import { r as h } from "../state-BG4JQVA1.js";
23
- import { e as g } from "../query-D_KR_GUc.js";
24
- import "../lit-html-B3ugcwD9.js";
25
- import { e as v } from "../directive-oAbCiebi.js";
26
- import { f as A } from "../async-directive-FGzMycjH.js";
18
+ import { e as f, I as O, s as S, L as $ } from "../overlay-CtdbWiFs.js";
19
+ import { C as V, H as j, b as G, c as M, d as J, P as K, V as Q, g as W, a as X, n as Y, o as Z, p as ee } from "../overlay-CtdbWiFs.js";
20
+ import { a as E, r as w, x as c, E as z, B as v } from "../base-CCsOyfm4.js";
21
+ import { property as m, state as h, query as g } from "lit/decorators.js";
22
+ import { directive as b, AsyncDirective as A } from "lit/async-directive.js";
27
23
  import { r as y } from "../slottable-request-event-DggLA4Rx.js";
28
- import { S as ne } from "../slottable-request-event-DggLA4Rx.js";
24
+ import { S as oe } from "../slottable-request-event-DggLA4Rx.js";
29
25
  const k = () => {
30
26
  if (typeof document < "u" && !document.querySelector("style[data-luzmo-vars]")) {
31
27
  const i = document.createElement("style");
@@ -39,12 +35,12 @@ var T = Object.defineProperty, s = (i, e, t, o) => {
39
35
  (a = i[n]) && (r = a(e, t, r) || r);
40
36
  return r && T(e, t, r), r;
41
37
  };
42
- class l extends w {
38
+ class l extends E {
43
39
  constructor() {
44
40
  super(...arguments), this.content = "click hover longpress", this.offset = 6, this.disabled = !1, this.receivesFocus = "auto", this.clickContent = [], this.longpressContent = [], this.hoverContent = [], this.targetContent = [];
45
41
  }
46
42
  static get styles() {
47
- return [E(F)];
43
+ return [w(F)];
48
44
  }
49
45
  getAssignedElementsFromSlot(e) {
50
46
  return e.assignedElements({ flatten: !0 });
@@ -82,8 +78,8 @@ class l extends w {
82
78
  e.newState === "open" ? this.open = o : this.open === o && (this.open = void 0);
83
79
  }
84
80
  update(e) {
85
- var t, o, r, n, a, m;
86
- e.has("clickContent") && (this.clickPlacement = ((t = this.clickContent[0]) == null ? void 0 : t.getAttribute("placement")) || ((o = this.clickContent[0]) == null ? void 0 : o.getAttribute("direction")) || void 0), e.has("hoverContent") && (this.hoverPlacement = ((r = this.hoverContent[0]) == null ? void 0 : r.getAttribute("placement")) || ((n = this.hoverContent[0]) == null ? void 0 : n.getAttribute("direction")) || void 0), e.has("longpressContent") && (this.longpressPlacement = ((a = this.longpressContent[0]) == null ? void 0 : a.getAttribute("placement")) || ((m = this.longpressContent[0]) == null ? void 0 : m.getAttribute("direction")) || void 0), super.update(e);
81
+ var t, o, r, n, a, u;
82
+ e.has("clickContent") && (this.clickPlacement = ((t = this.clickContent[0]) == null ? void 0 : t.getAttribute("placement")) || ((o = this.clickContent[0]) == null ? void 0 : o.getAttribute("direction")) || void 0), e.has("hoverContent") && (this.hoverPlacement = ((r = this.hoverContent[0]) == null ? void 0 : r.getAttribute("placement")) || ((n = this.hoverContent[0]) == null ? void 0 : n.getAttribute("direction")) || void 0), e.has("longpressContent") && (this.longpressPlacement = ((a = this.longpressContent[0]) == null ? void 0 : a.getAttribute("placement")) || ((u = this.longpressContent[0]) == null ? void 0 : u.getAttribute("direction")) || void 0), super.update(e);
87
83
  }
88
84
  renderSlot(e) {
89
85
  return c`
@@ -91,7 +87,7 @@ class l extends w {
91
87
  `;
92
88
  }
93
89
  renderClickOverlay() {
94
- import("../overlay-D7EbnA6E.js").then((t) => t.f);
90
+ import("../overlay-CtdbWiFs.js").then((t) => t.f);
95
91
  const e = this.renderSlot("click-content");
96
92
  return this.clickContent.length === 0 ? e : c`
97
93
  <luzmo-overlay
@@ -111,7 +107,7 @@ class l extends w {
111
107
  `;
112
108
  }
113
109
  renderHoverOverlay() {
114
- import("../overlay-D7EbnA6E.js").then((t) => t.f);
110
+ import("../overlay-CtdbWiFs.js").then((t) => t.f);
115
111
  const e = this.renderSlot("hover-content");
116
112
  return this.hoverContent.length === 0 ? e : c`
117
113
  <luzmo-overlay
@@ -131,7 +127,7 @@ class l extends w {
131
127
  `;
132
128
  }
133
129
  renderLongpressOverlay() {
134
- import("../overlay-D7EbnA6E.js").then((t) => t.f);
130
+ import("../overlay-CtdbWiFs.js").then((t) => t.f);
135
131
  const e = this.renderSlot("longpress-content");
136
132
  return this.longpressContent.length === 0 ? e : c`
137
133
  <luzmo-overlay
@@ -177,25 +173,25 @@ class l extends w {
177
173
  }
178
174
  }
179
175
  s([
180
- u()
176
+ m()
181
177
  ], l.prototype, "content");
182
178
  s([
183
- u({ reflect: !0 })
179
+ m({ reflect: !0 })
184
180
  ], l.prototype, "placement");
185
181
  s([
186
- u()
182
+ m()
187
183
  ], l.prototype, "type");
188
184
  s([
189
- u({ type: Number })
185
+ m({ type: Number })
190
186
  ], l.prototype, "offset");
191
187
  s([
192
- u({ reflect: !0 })
188
+ m({ reflect: !0 })
193
189
  ], l.prototype, "open");
194
190
  s([
195
- u({ type: Boolean, reflect: !0 })
191
+ m({ type: Boolean, reflect: !0 })
196
192
  ], l.prototype, "disabled");
197
193
  s([
198
- u({ attribute: "receives-focus" })
194
+ m({ attribute: "receives-focus" })
199
195
  ], l.prototype, "receivesFocus");
200
196
  s([
201
197
  h()
@@ -218,7 +214,7 @@ s([
218
214
  s([
219
215
  g("#hover-overlay", !0)
220
216
  ], l.prototype, "hoverOverlayElement");
221
- function V(i, e, t, o) {
217
+ function H(i, e, t, o) {
222
218
  return f.open(
223
219
  i,
224
220
  e,
@@ -238,7 +234,7 @@ class x extends A {
238
234
  if (e.target !== e.currentTarget)
239
235
  return;
240
236
  const t = e.data === y;
241
- b(t ? void 0 : this.template(), this.target, {
237
+ v(t ? void 0 : this.template(), this.target, {
242
238
  renderBefore: this.renderBefore
243
239
  });
244
240
  }
@@ -261,7 +257,7 @@ class x extends A {
261
257
  this.init();
262
258
  }
263
259
  }
264
- const j = v(x);
260
+ const _ = b(x);
265
261
  class I extends x {
266
262
  constructor() {
267
263
  super(...arguments), this.defaultOptions = {
@@ -279,11 +275,11 @@ class I extends x {
279
275
  return z;
280
276
  }
281
277
  update(e, [t, o]) {
282
- var m, d, p;
278
+ var u, d, p;
283
279
  this.options = {
284
280
  ...this.defaultOptions.overlayOptions,
285
281
  ...o == null ? void 0 : o.overlayOptions
286
- }, this.insertionOptions = o == null ? void 0 : o.insertionOptions, this.template = t, this.host = (m = e.options) == null ? void 0 : m.host;
282
+ }, this.insertionOptions = o == null ? void 0 : o.insertionOptions, this.template = t, this.host = (u = e.options) == null ? void 0 : u.host;
287
283
  let r = !1;
288
284
  const n = (o == null ? void 0 : o.triggerInteraction) || this.defaultOptions.triggerInteraction, a = O[(d = this.strategy) == null ? void 0 : d.type] !== n;
289
285
  this.target !== e.element && (this.target = e.element, r = !0), (r || a) && ((p = this.strategy) == null || p.abort(), this.strategy = new S[n](this.target, {
@@ -298,7 +294,7 @@ class I extends x {
298
294
  if (e.target !== e.currentTarget)
299
295
  return;
300
296
  const t = e.data === y, o = {};
301
- if (this.host && (o.host = this.host), b(
297
+ if (this.host && (o.host = this.host), v(
302
298
  t ? void 0 : this.template(),
303
299
  this.overlay,
304
300
  o
@@ -309,36 +305,36 @@ class I extends x {
309
305
  ...this.options,
310
306
  trigger: this.target
311
307
  });
312
- const a = typeof ((r = this.insertionOptions) == null ? void 0 : r.el) == "function" ? this.insertionOptions.el() : ((n = this.insertionOptions) == null ? void 0 : n.el) || this.target, { where: m = "afterend" } = this.insertionOptions || {};
313
- a.insertAdjacentElement(m, this.overlay);
308
+ const a = typeof ((r = this.insertionOptions) == null ? void 0 : r.el) == "function" ? this.insertionOptions.el() : ((n = this.insertionOptions) == null ? void 0 : n.el) || this.target, { where: u = "afterend" } = this.insertionOptions || {};
309
+ a.insertAdjacentElement(u, this.overlay);
314
310
  }
315
311
  }
316
312
  }
317
- const D = v(I);
313
+ const U = b(I);
318
314
  customElements.get("luzmo-overlay") || customElements.define("luzmo-overlay", f);
319
315
  customElements.get("luzmo-overlay-trigger") || customElements.define("luzmo-overlay-trigger", l);
320
316
  export {
321
- J as ClickController,
322
- K as HoverController,
323
- Q as InteractionController,
317
+ V as ClickController,
318
+ j as HoverController,
319
+ G as InteractionController,
324
320
  O as InteractionTypes,
325
- W as LONGPRESS_INSTRUCTIONS,
326
- X as LongpressController,
321
+ M as LONGPRESS_INSTRUCTIONS,
322
+ J as LongpressController,
327
323
  $ as LuzmoAbstractOverlay,
328
324
  f as LuzmoOverlay,
329
325
  l as LuzmoOverlayTrigger,
330
326
  I as OverlayTriggerDirective,
331
- Y as PlacementController,
327
+ K as PlacementController,
332
328
  x as SlottableRequestDirective,
333
- ne as SlottableRequestEvent,
334
- Z as VirtualTrigger,
335
- ee as guaranteedAllTransitionend,
336
- te as nextFrame,
337
- oe as noop,
338
- V as openOverlay,
339
- re as overlayTimer,
340
- le as placementUpdatedSymbol,
329
+ oe as SlottableRequestEvent,
330
+ Q as VirtualTrigger,
331
+ W as guaranteedAllTransitionend,
332
+ X as nextFrame,
333
+ Y as noop,
334
+ H as openOverlay,
335
+ Z as overlayTimer,
336
+ ee as placementUpdatedSymbol,
341
337
  y as removeSlottableRequest,
342
- j as slottableRequest,
343
- D as trigger
338
+ _ as slottableRequest,
339
+ U as trigger
344
340
  };
@@ -0,0 +1,47 @@
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 et=require("./base-CaRKlVkL.cjs"),O=require("lit/decorators.js"),At=require("lit/directives/if-defined.js"),Ut=require("lit/directives/style-map.js"),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 xe(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 Ee=(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 xe(l,e,a)}},Ce=1e3,Pe=1e3;class Oe{constructor(t={}){this.warmUpDelay=Ce,this.coolDownDelay=Pe,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 Oe,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 R(){return new Promise(e=>requestAnimationFrame(()=>e()))}class nt extends et.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=Ee([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 nt.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),nt.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,nt.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 Te(e){class t extends e{async manageDialogOpen(){const n=this.open;if(await R(),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 R(),await R(),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 Ae(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 R(),await R(),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 Re=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 De(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 R(),Re||await this.shouldHidePopover(n),this.shouldShowPopover(n),await R()}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 R();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 R(),await R(),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 Le="showPopover"in document.createElement("div");class Se{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}Le||(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 Se,ke=':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,A=Math.max,yt=Math.round,ft=Math.floor,M=e=>({x:e,y:e}),Fe={left:"right",right:"left",bottom:"top",top:"bottom"},ze={start:"end",end:"start"};function Lt(e,t,i){return A(e,G(t,i))}function st(e,t){return typeof e=="function"?e(t):e}function X(e){return e.split("-")[0]}function rt(e){return e.split("-")[1]}function ne(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 ne(Q(e))}function Ne(e,t,i){i===void 0&&(i=!1);const n=rt(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=>ze[t])}function qe(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 Me(e,t,i,n){const o=rt(e);let s=qe(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=>Fe[t])}function $e(e){return{top:0,right:0,bottom:0,left:0,...e}}function oe(e){return typeof e!="number"?$e(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(rt(t)){case"start":u[r]-=f*(i&&h?-1:1);break;case"end":u[r]+=f*(i&&h?-1:1);break}return u}const We=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}=st(t,e),p=oe(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 He=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}=st(e,t)||{};if(h==null)return{};const d=oe(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&&rt(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}}}),Ie=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}=st(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(...Me(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=Ne(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,be)=>K+be,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 Be(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=rt(i),a=Q(i)==="y",h=["left","top"].includes(r)?-1:1,c=s&&a?-1:1,d=st(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 Ve=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 Be(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}}}}},Ue=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}=st(e,t),h={x:i,y:n},c=await Wt(t,a),d=Q(X(o)),f=ne(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}}}}}},je=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}=st(e,t),c=await Wt(t,h),d=X(o),f=rt(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=A(c.left,0),V=A(c.right,0),_=A(c.top,0),U=A(c.bottom,0);u?H=p-2*(S!==0||V!==0?S+V:A(c.left,c.right)):E=m-2*(_!==0||U!==0?_+U:A(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 lt(e){return se(e)?(e.nodeName||"").toLowerCase():"#document"}function D(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function W(e){var t;return(t=(se(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function se(e){return Ct()?e instanceof Node||e instanceof D(e).Node:!1}function F(e){return Ct()?e instanceof Element||e instanceof D(e).Element:!1}function $(e){return Ct()?e instanceof HTMLElement||e instanceof D(e).HTMLElement:!1}function Qt(e){return!Ct()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof D(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 Ke(e){return["table","td","th"].includes(lt(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 Ye(e){let t=J(e);for(;$(t)&&!ot(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 ot(e){return["html","body","#document"].includes(lt(e))}function z(e){return D(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(lt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Qt(e)&&e.host||W(e);return Qt(t)?t.host:t}function re(e){const t=J(e);return ot(t)?e.ownerDocument?e.ownerDocument.body:e.body:$(t)&&ut(t)?t:re(t)}function ct(e,t,i){var n;t===void 0&&(t=[]),i===void 0&&(i=!0);const o=re(e),s=o===((n=e.ownerDocument)==null?void 0:n.body),r=D(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 le(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 it(e){const t=Bt(e);if(!$(t))return M(1);const i=t.getBoundingClientRect(),{width:n,height:o,$:s}=le(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 Ge=M(0);function ae(e){const t=D(e);return!It()||!t.visualViewport?Ge:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Xe(e,t,i){return t===void 0&&(t=!1),!i||t&&i!==D(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=it(n)):r=it(e));const l=Xe(s,i,n)?ae(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=D(s),u=n&&F(n)?D(n):n;let p=f,m=kt(p);for(;m&&n&&u!==p;){const v=it(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=D(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 ce(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 Je(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)&&((lt(n)!=="body"||ut(r))&&(a=Ot(n)),$(n))){const u=Z(n);h=it(n),c.x=u.x+n.clientLeft,c.y=u.y+n.clientTop}const f=r&&!d&&!s?ce(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 Qe(e){return Array.from(e.getClientRects())}function Ze(e){const t=W(e),i=Ot(e),n=e.ownerDocument.body,o=A(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=A(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let r=-i.scrollLeft+Vt(e);const l=-i.scrollTop;return z(n).direction==="rtl"&&(r+=A(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:r,y:l}}function ti(e,t){const i=D(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 ei(e,t){const i=Z(e,!0,t==="fixed"),n=i.top+e.clientTop,o=i.left+e.clientLeft,s=$(e)?it(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=ti(e,i);else if(t==="document")n=Ze(W(e));else if(F(t))n=ei(t,i);else{const o=ae(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return bt(n)}function he(e,t){const i=J(e);return i===t||!F(i)||ot(i)?!1:z(i).position==="fixed"||he(i,t)}function ii(e,t){const i=t.get(e);if(i)return i;let n=ct(e,[],!1).filter(l=>F(l)&&lt(l)!=="body"),o=null;const s=z(e).position==="fixed";let r=s?J(e):e;for(;F(r)&&!ot(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&&he(e,r))?n=n.filter(c=>c!==r):o=l,r=J(r)}return t.set(e,n),n}function ni(e){let{element:t,boundary:i,rootBoundary:n,strategy:o}=e;const r=[...i==="clippingAncestors"?Pt(t)?[]:ii(t,this._c):[].concat(i),n],l=r[0],a=r.reduce((h,c)=>{const d=Zt(t,c,o);return h.top=A(d.top,h.top),h.right=G(d.right,h.right),h.bottom=G(d.bottom,h.bottom),h.left=A(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 oi(e){const{width:t,height:i}=le(e);return{width:t,height:i}}function si(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((lt(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?ce(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 de(e,t){const i=D(e);if(Pt(e))return i;if(!$(e)){let o=J(e);for(;o&&!ot(o);){if(F(o)&&!Rt(o))return o;o=J(o)}return i}let n=te(e,t);for(;n&&Ke(n)&&Rt(n);)n=te(n,t);return n&&ot(n)&&Rt(n)&&!Ht(n)?i:n||Ye(e)||i}const ri=async function(e){const t=this.getOffsetParent||de,i=this.getDimensions,n=await i(e.floating);return{reference:si(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function li(e){return z(e).direction==="rtl"}const ai={convertOffsetParentRelativeRectToViewportRelativeRect:Je,getDocumentElement:W,getClippingRect:ni,getOffsetParent:de,getElementRects:ri,getClientRects:Qe,getDimensions:oi,getScale:it,isElement:F,isRTL:li};function ue(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ci(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:A(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&&!ue(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?ci(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&&!ue(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 hi=Ve,di=Ue,ie=Ie,ui=je,pi=He,fi=(e,t,i)=>{const n=new Map,o={platform:ai,...i},s={...o.platform,_c:n};return We(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,mi=100,gi=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],vi=Symbol("placement updated");class pe{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:gi(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=[hi({mainAxis:o,crossAxis:s}),di({padding:gt}),n,ui({padding:gt,apply:({availableWidth:p,availableHeight:m,rects:{floating:v}})=>{const g=Math.max(mi,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?[pi({element:r,padding:t.tipPadding||gt})]:[]],{x:a,y:h,placement:c,middlewareData:d}=await fi(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 fe 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 yi=300;class me 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},yi))}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 wi=300,ge={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 ve 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"}}))},wi))}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=ge[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 ye={click:fe,longpress:ve,hover:me};var bi=Object.defineProperty,xi=Object.getOwnPropertyDescriptor,T=(e,t,i,n)=>{for(var o=n>1?void 0:n?xi(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&&bi(t,i,o),o};const Ei="showPopover"in document.createElement("div");let vt=Te(nt);vt=Ei?De(vt):Ae(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 pe(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 R(),await R(),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 ye[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 et.x` <slot @slotchange=${this.handleSlotchange}></slot> `}get dialogStyleMap(){return{"--luzmo-overlay-open-count":B.openCount.toString()}}renderDialog(){return et.x`
19
+ <dialog
20
+ class="dialog"
21
+ part="dialog"
22
+ placement=${At.ifDefined(this.requiresPositioning?this.placement||"right":void 0)}
23
+ style=${Ut.styleMap(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 et.x`
32
+ <div
33
+ class="dialog"
34
+ part="dialog"
35
+ placement=${At.ifDefined(this.requiresPositioning?this.placement||"right":void 0)}
36
+ popover=${At.ifDefined(this.popoverValue)}
37
+ style=${Ut.styleMap(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 et.x`
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=[et.r(ke)],B.openCount=1,B);T([O.property({type:Boolean})],C.prototype,"delayed",1);T([O.query(".dialog")],C.prototype,"dialogEl",2);T([O.property({type:Boolean})],C.prototype,"disabled",1);T([O.queryAssignedElements({flatten:!0,selector:':not([slot="longpress-describedby-descriptor"], slot)'})],C.prototype,"elements",2);T([O.property({type:Number})],C.prototype,"offset",2);T([O.property({type:Boolean,reflect:!0})],C.prototype,"open",1);T([O.property()],C.prototype,"placement",2);T([O.property({attribute:"receives-focus"})],C.prototype,"receivesFocus",2);T([O.query("slot")],C.prototype,"slotEl",2);T([O.state()],C.prototype,"state",1);T([O.property({type:Number,attribute:"tip-padding"})],C.prototype,"tipPadding",2);T([O.property()],C.prototype,"trigger",2);T([O.property({attribute:!1})],C.prototype,"triggerElement",2);T([O.property({attribute:!1})],C.prototype,"triggerInteraction",2);T([O.property()],C.prototype,"type",2);let we=C;const xt=Object.freeze(Object.defineProperty({__proto__:null,LuzmoOverlay:we},Symbol.toStringTag,{value:"Module"}));exports.ClickController=fe;exports.HoverController=me;exports.InteractionController=Tt;exports.InteractionTypes=pt;exports.LONGPRESS_INSTRUCTIONS=ge;exports.LongpressController=ve;exports.LuzmoAbstractOverlay=nt;exports.LuzmoOverlay=we;exports.PlacementController=pe;exports.VirtualTrigger=dt;exports.guaranteedAllTransitionend=Et;exports.nextFrame=R;exports.noop=Y;exports.overlay=xt;exports.overlayTimer=at;exports.placementUpdatedSymbol=vi;exports.strategies=ye;