aptechka 0.57.3 → 0.57.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";var J=s=>{throw TypeError(s)};var O=(s,r,e)=>r.has(s)||J("Cannot "+e);var t=(s,r,e)=>(O(s,r,"read from private field"),e?e.call(s):r.get(s)),n=(s,r,e)=>r.has(s)?J("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(s):r.set(s,e),a=(s,r,e,i)=>(O(s,r,"write to private field"),i?i.call(s,e):r.set(s,e),e),b=(s,r,e)=>(O(s,r,"access private method"),e);var K=(s,r,e)=>new Promise((i,l)=>{var d=C=>{try{F(e.next(C))}catch(N){l(N)}},P=C=>{try{F(e.throw(C))}catch(N){l(N)}},F=C=>C.done?i(C.value):Promise.resolve(C.value).then(d,P);F((e=e.apply(s,r)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("../index-Cqw2NKev.cjs"),G=require("../dom-JBOkFLTh.cjs"),q=require("../css-property/index.cjs"),V=require("../events-KVanG9sR.cjs"),W=require("../gestures-C7gbKx11.cjs"),X=require("../math-GDWEqu7y.cjs"),Y=require("../number-DyefJ5a1.cjs");var k,p,v,L,x,c,o,h,$,H,w,_,D,j,z;class A extends HTMLElement{constructor(){super(...arguments);n(this,h);n(this,k,new q.CSSProperty(this,"--loop",!0));n(this,p,new q.CSSProperty(this,"--autoplay",!1));n(this,v,new q.CSSProperty(this,"--swipe","x"));n(this,L);n(this,x,!1);n(this,c,[]);n(this,o,0);n(this,w,e=>{a(this,x,e.isIntersecting),t(this,x)?b(this,h,H).call(this):clearInterval(t(this,L))});n(this,_,()=>{clearInterval(t(this,L)),t(this,x)&&a(this,L,setInterval(t(this,j),parseFloat(t(this,p).current||"0")*1e3))});n(this,j,()=>{b(this,h,D).call(this,t(this,o)+1)});n(this,z,e=>{if(!t(this,v).current)return;let i=0;W.setupDrag(l=>{const d=e.x-l.x,P=e.y-l.y;t(this,v).current==="x"?Math.abs(d)>Math.abs(P)&&(i=Math.sign(d)):t(this,v).current==="y"&&Math.abs(P)>Math.abs(d)&&(i=Math.sign(P))},()=>{this.shift(i)})})}get counter(){return t(this,o)}get itemElements(){return t(this,c)}addItem(e){t(this,c).push(e),b(this,h,$).call(this)}set(e){(!this.handleSet||this.handleSet(e))&&(b(this,h,D).call(this,e),b(this,h,H).call(this))}shift(e){this.set(t(this,o)+e)}connectedCallback(){var e;a(this,c,[...this.querySelectorAll(`[data-billboard-item="${this.id||""}"]`)]),(e=t(this,c)[0])==null||e.classList.add("current"),b(this,h,$).call(this),t(this,p).subscribe(i=>{i.current?(S.intersector.subscribe(this,t(this,w)),b(this,h,H).call(this)):(a(this,x,!0),S.intersector.unsubscribe(t(this,w)),clearInterval(t(this,L)),b(this,h,D).call(this,0))}),t(this,p).observe(),t(this,v).observe(),t(this,k).observe(),this.addEventListener("pointerdown",t(this,z))}disconnectedCallback(){t(this,p).unobserve(),t(this,v).unobserve(),t(this,k).unobserve(),S.intersector.unsubscribe(t(this,w)),clearInterval(t(this,L))}}k=new WeakMap,p=new WeakMap,v=new WeakMap,L=new WeakMap,x=new WeakMap,c=new WeakMap,o=new WeakMap,h=new WeakSet,$=function(){t(this,c).length>1?this.classList.add("has-length"):this.classList.remove("has-length")},H=function(){t(this,p).current!==!1&&t(this,_).call(this)},w=new WeakMap,_=new WeakMap,D=function(e){t(this,k).current?a(this,o,Y.loopNumber(e,t(this,c).length)):a(this,o,X.clamp(e,0,t(this,c).length-1)),t(this,c).forEach((i,l)=>{i.classList.remove("current","previous","next"),l===t(this,o)?i.classList.add("current"):l<t(this,o)?i.classList.add("previous"):l>t(this,o)&&i.classList.add("next")}),V.dispatchEvent(this,"billboardChange",{detail:{counter:t(this,o)}}),setTimeout(()=>{window.dispatchEvent(new Event("resize"))},0)},j=new WeakMap,z=new WeakMap;customElements.get("e-billboard")||customElements.define("e-billboard",A);var u,y,m,T,B;class Q extends HTMLElement{constructor(){super(...arguments);n(this,u,null);n(this,y,null);n(this,m,[]);n(this,T,e=>{const i=e.currentTarget,l=t(this,m).findIndex(d=>d===i);l>=0&&t(this,u).set(l)});n(this,B,()=>{t(this,m).forEach((e,i)=>{i===t(this,u).counter?e.classList.add("current"):e.classList.remove("current")})})}connectedCallback(){return K(this,null,function*(){var e;if(a(this,u,G.findParentElement(this,A)),t(this,u)&&(yield customElements.whenDefined("e-billboard"),this.isConnected)){const i=t(this,u).itemElements.length;a(this,y,document.createElement("div"));for(let l=0;l<i;l++){const d=document.createElement("button");t(this,m).push(d),t(this,y).appendChild(d)}this.appendChild(t(this,y)),t(this,m).forEach(l=>{l.addEventListener("click",t(this,T))}),(e=t(this,u))==null||e.addEventListener("billboardChange",t(this,B)),t(this,B).call(this)}})}disconnectedCallback(){var e;t(this,m).forEach(i=>{i.removeEventListener("click",t(this,T))}),(e=t(this,u))==null||e.removeEventListener("billboardChange",t(this,B)),this.innerHTML="",a(this,m,[])}}u=new WeakMap,y=new WeakMap,m=new WeakMap,T=new WeakMap,B=new WeakMap;S.isBrowser&&!customElements.get("e-billboard-bullets")&&customElements.define("e-billboard-bullets",Q);var f,E,g;class R extends HTMLElement{constructor(){super();n(this,f,new q.CSSProperty(this,"--index",0));n(this,E,null);n(this,g,()=>{var e;t(this,f).current===((e=t(this,E))==null?void 0:e.counter)?this.classList.add("current"):this.classList.remove("current")});this.addEventListener("click",e=>{t(this,E)&&(!this.handleClick||this.handleClick(e))&&t(this,E).set(t(this,f).current)})}connectedCallback(){var e;this.tabIndex=0,a(this,E,G.findParentElement(this,A)),(e=t(this,E))==null||e.addEventListener("billboardChange",t(this,g)),customElements.whenDefined("e-billboard").then(()=>{this.isConnected&&t(this,g).call(this)}),t(this,f).subscribe(t(this,g)),t(this,f).observe()}disconnectedCallback(){var e;this.removeAttribute("tabindex"),t(this,f).unsubscribe(t(this,g)),t(this,f).unobserve(),(e=t(this,E))==null||e.removeEventListener("billboardChange",t(this,g))}}f=new WeakMap,E=new WeakMap,g=new WeakMap;S.isBrowser&&!customElements.get("e-billboard-set-button")&&customElements.define("e-billboard-set-button",R);var I,M;class U extends HTMLElement{constructor(){super();n(this,I,new q.CSSProperty(this,"--step",1));n(this,M,null);this.addEventListener("click",e=>{t(this,M)&&(!this.handleClick||this.handleClick(e))&&t(this,M).shift(t(this,I).current)})}connectedCallback(){this.tabIndex=0,a(this,M,G.findParentElement(this,A)),t(this,I).observe()}disconnectedCallback(){this.removeAttribute("tabindex"),t(this,I).unobserve()}}I=new WeakMap,M=new WeakMap;S.isBrowser&&!customElements.get("e-billboard-step-button")&&customElements.define("e-billboard-step-button",U);exports.BillboardBulletsElement=Q;exports.BillboardElement=A;exports.BillboardSetButtonElement=R;exports.BillboardStepButtonElement=U;
1
+ "use strict";var J=i=>{throw TypeError(i)};var O=(i,r,e)=>r.has(i)||J("Cannot "+e);var t=(i,r,e)=>(O(i,r,"read from private field"),e?e.call(i):r.get(i)),n=(i,r,e)=>r.has(i)?J("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(i):r.set(i,e),a=(i,r,e,s)=>(O(i,r,"write to private field"),s?s.call(i,e):r.set(i,e),e),u=(i,r,e)=>(O(i,r,"access private method"),e);var K=(i,r,e)=>new Promise((s,l)=>{var c=C=>{try{F(e.next(C))}catch(N){l(N)}},S=C=>{try{F(e.throw(C))}catch(N){l(N)}},F=C=>C.done?s(C.value):Promise.resolve(C.value).then(c,S);F((e=e.apply(i,r)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("../index-Cqw2NKev.cjs"),G=require("../dom-JBOkFLTh.cjs"),q=require("../css-property/index.cjs"),V=require("../events-KVanG9sR.cjs"),W=require("../gestures-C7gbKx11.cjs"),X=require("../math-GDWEqu7y.cjs"),Y=require("../number-DyefJ5a1.cjs");var w,p,v,L,x,d,o,h,$,H,y,_,D,j,z;class A extends HTMLElement{constructor(){super(...arguments);n(this,h);n(this,w,new q.CSSProperty(this,"--loop",!0));n(this,p,new q.CSSProperty(this,"--autoplay",!1));n(this,v,new q.CSSProperty(this,"--swipe","x"));n(this,L);n(this,x,!1);n(this,d,[]);n(this,o,0);n(this,y,e=>{a(this,x,e.isIntersecting),t(this,x)?u(this,h,H).call(this):clearInterval(t(this,L))});n(this,_,()=>{clearInterval(t(this,L)),t(this,x)&&a(this,L,setInterval(t(this,j),parseFloat(t(this,p).current||"0")*1e3))});n(this,j,()=>{u(this,h,D).call(this,t(this,o)+1)});n(this,z,e=>{if(!t(this,v).current)return;let s=0;W.setupDrag(l=>{const c=e.x-l.x,S=e.y-l.y;t(this,v).current==="x"?Math.abs(c)>Math.abs(S)&&Math.abs(c)>10&&(s=Math.sign(c)):t(this,v).current==="y"&&Math.abs(S)>Math.abs(c)&&Math.abs(S)>10&&(s=Math.sign(S))},()=>{s&&this.shift(s)})})}get counter(){return t(this,o)}get itemElements(){return t(this,d)}addItem(e){t(this,d).push(e),u(this,h,$).call(this)}set(e){(!this.handleSet||this.handleSet(e))&&(u(this,h,D).call(this,e),u(this,h,H).call(this))}shift(e){this.set(t(this,o)+e)}connectedCallback(){var e;a(this,d,[...this.querySelectorAll(`[data-billboard-item="${this.id||""}"]`)]),(e=t(this,d)[0])==null||e.classList.add("current"),u(this,h,$).call(this),t(this,p).subscribe(s=>{s.current?(k.intersector.subscribe(this,t(this,y)),u(this,h,H).call(this)):(a(this,x,!0),k.intersector.unsubscribe(t(this,y)),clearInterval(t(this,L)),u(this,h,D).call(this,0))}),t(this,p).observe(),t(this,v).observe(),t(this,w).observe(),this.addEventListener("pointerdown",t(this,z))}disconnectedCallback(){t(this,p).unobserve(),t(this,v).unobserve(),t(this,w).unobserve(),k.intersector.unsubscribe(t(this,y)),clearInterval(t(this,L))}}w=new WeakMap,p=new WeakMap,v=new WeakMap,L=new WeakMap,x=new WeakMap,d=new WeakMap,o=new WeakMap,h=new WeakSet,$=function(){t(this,d).length>1?this.classList.add("has-length"):this.classList.remove("has-length")},H=function(){t(this,p).current!==!1&&t(this,_).call(this)},y=new WeakMap,_=new WeakMap,D=function(e){t(this,w).current?a(this,o,Y.loopNumber(e,t(this,d).length)):a(this,o,X.clamp(e,0,t(this,d).length-1)),t(this,d).forEach((s,l)=>{s.classList.remove("current","previous","next"),l===t(this,o)?s.classList.add("current"):l<t(this,o)?s.classList.add("previous"):l>t(this,o)&&s.classList.add("next")}),V.dispatchEvent(this,"billboardChange",{detail:{counter:t(this,o)}}),setTimeout(()=>{window.dispatchEvent(new Event("resize"))},0)},j=new WeakMap,z=new WeakMap;customElements.get("e-billboard")||customElements.define("e-billboard",A);var b,B,m,T,M;class Q extends HTMLElement{constructor(){super(...arguments);n(this,b,null);n(this,B,null);n(this,m,[]);n(this,T,e=>{const s=e.currentTarget,l=t(this,m).findIndex(c=>c===s);l>=0&&t(this,b).set(l)});n(this,M,()=>{t(this,m).forEach((e,s)=>{s===t(this,b).counter?e.classList.add("current"):e.classList.remove("current")})})}connectedCallback(){return K(this,null,function*(){var e;if(a(this,b,G.findParentElement(this,A)),t(this,b)&&(yield customElements.whenDefined("e-billboard"),this.isConnected)){const s=t(this,b).itemElements.length;a(this,B,document.createElement("div"));for(let l=0;l<s;l++){const c=document.createElement("button");t(this,m).push(c),t(this,B).appendChild(c)}this.appendChild(t(this,B)),t(this,m).forEach(l=>{l.addEventListener("click",t(this,T))}),(e=t(this,b))==null||e.addEventListener("billboardChange",t(this,M)),t(this,M).call(this)}})}disconnectedCallback(){var e;t(this,m).forEach(s=>{s.removeEventListener("click",t(this,T))}),(e=t(this,b))==null||e.removeEventListener("billboardChange",t(this,M)),this.innerHTML="",a(this,m,[])}}b=new WeakMap,B=new WeakMap,m=new WeakMap,T=new WeakMap,M=new WeakMap;k.isBrowser&&!customElements.get("e-billboard-bullets")&&customElements.define("e-billboard-bullets",Q);var f,E,g;class R extends HTMLElement{constructor(){super();n(this,f,new q.CSSProperty(this,"--index",0));n(this,E,null);n(this,g,()=>{var e;t(this,f).current===((e=t(this,E))==null?void 0:e.counter)?this.classList.add("current"):this.classList.remove("current")});this.addEventListener("click",e=>{t(this,E)&&(!this.handleClick||this.handleClick(e))&&t(this,E).set(t(this,f).current)})}connectedCallback(){var e;this.tabIndex=0,a(this,E,G.findParentElement(this,A)),(e=t(this,E))==null||e.addEventListener("billboardChange",t(this,g)),customElements.whenDefined("e-billboard").then(()=>{this.isConnected&&t(this,g).call(this)}),t(this,f).subscribe(t(this,g)),t(this,f).observe()}disconnectedCallback(){var e;this.removeAttribute("tabindex"),t(this,f).unsubscribe(t(this,g)),t(this,f).unobserve(),(e=t(this,E))==null||e.removeEventListener("billboardChange",t(this,g))}}f=new WeakMap,E=new WeakMap,g=new WeakMap;k.isBrowser&&!customElements.get("e-billboard-set-button")&&customElements.define("e-billboard-set-button",R);var I,P;class U extends HTMLElement{constructor(){super();n(this,I,new q.CSSProperty(this,"--step",1));n(this,P,null);this.addEventListener("click",e=>{t(this,P)&&(!this.handleClick||this.handleClick(e))&&t(this,P).shift(t(this,I).current)})}connectedCallback(){this.tabIndex=0,a(this,P,G.findParentElement(this,A)),t(this,I).observe()}disconnectedCallback(){this.removeAttribute("tabindex"),t(this,I).unobserve()}}I=new WeakMap,P=new WeakMap;k.isBrowser&&!customElements.get("e-billboard-step-button")&&customElements.define("e-billboard-step-button",U);exports.BillboardBulletsElement=Q;exports.BillboardElement=A;exports.BillboardSetButtonElement=R;exports.BillboardStepButtonElement=U;
@@ -1,23 +1,23 @@
1
- var Q = (s) => {
2
- throw TypeError(s);
1
+ var Q = (i) => {
2
+ throw TypeError(i);
3
3
  };
4
- var j = (s, l, e) => l.has(s) || Q("Cannot " + e);
5
- var t = (s, l, e) => (j(s, l, "read from private field"), e ? e.call(s) : l.get(s)), n = (s, l, e) => l.has(s) ? Q("Cannot add the same private member more than once") : l instanceof WeakSet ? l.add(s) : l.set(s, e), a = (s, l, e, i) => (j(s, l, "write to private field"), i ? i.call(s, e) : l.set(s, e), e), u = (s, l, e) => (j(s, l, "access private method"), e);
6
- var R = (s, l, e) => new Promise((i, r) => {
7
- var d = (C) => {
4
+ var j = (i, h, e) => h.has(i) || Q("Cannot " + e);
5
+ var t = (i, h, e) => (j(i, h, "read from private field"), e ? e.call(i) : h.get(i)), n = (i, h, e) => h.has(i) ? Q("Cannot add the same private member more than once") : h instanceof WeakSet ? h.add(i) : h.set(i, e), a = (i, h, e, s) => (j(i, h, "write to private field"), s ? s.call(i, e) : h.set(i, e), e), u = (i, h, e) => (j(i, h, "access private method"), e);
6
+ var R = (i, h, e) => new Promise((s, l) => {
7
+ var o = (C) => {
8
8
  try {
9
9
  N(e.next(C));
10
10
  } catch ($) {
11
- r($);
11
+ l($);
12
12
  }
13
- }, S = (C) => {
13
+ }, k = (C) => {
14
14
  try {
15
15
  N(e.throw(C));
16
16
  } catch ($) {
17
- r($);
17
+ l($);
18
18
  }
19
- }, N = (C) => C.done ? i(C.value) : Promise.resolve(C.value).then(d, S);
20
- N((e = e.apply(s, l)).next());
19
+ }, N = (C) => C.done ? s(C.value) : Promise.resolve(C.value).then(o, k);
20
+ N((e = e.apply(i, h)).next());
21
21
  });
22
22
  import { a as G, i as K } from "../index-euf5anj6.js";
23
23
  import { b as O } from "../dom-CVWzyXPH.js";
@@ -26,20 +26,20 @@ import { d as U } from "../events-CsVF98U6.js";
26
26
  import { s as V } from "../gestures-CcXV6fCp.js";
27
27
  import { c as W } from "../math-BOBiC4TN.js";
28
28
  import { l as X } from "../number-CbdpfO3u.js";
29
- var k, E, v, L, x, o, c, h, J, H, w, P, D, q, z;
29
+ var w, E, v, L, x, d, c, r, J, H, I, P, D, q, z;
30
30
  class F extends HTMLElement {
31
31
  constructor() {
32
32
  super(...arguments);
33
- n(this, h);
34
- n(this, k, new T(this, "--loop", !0));
33
+ n(this, r);
34
+ n(this, w, new T(this, "--loop", !0));
35
35
  n(this, E, new T(this, "--autoplay", !1));
36
36
  n(this, v, new T(this, "--swipe", "x"));
37
37
  n(this, L);
38
38
  n(this, x, !1);
39
- n(this, o, []);
39
+ n(this, d, []);
40
40
  n(this, c, 0);
41
- n(this, w, (e) => {
42
- a(this, x, e.isIntersecting), t(this, x) ? u(this, h, H).call(this) : clearInterval(t(this, L));
41
+ n(this, I, (e) => {
42
+ a(this, x, e.isIntersecting), t(this, x) ? u(this, r, H).call(this) : clearInterval(t(this, L));
43
43
  });
44
44
  n(this, P, () => {
45
45
  clearInterval(t(this, L)), t(this, x) && a(this, L, setInterval(
@@ -48,19 +48,19 @@ class F extends HTMLElement {
48
48
  ));
49
49
  });
50
50
  n(this, q, () => {
51
- u(this, h, D).call(this, t(this, c) + 1);
51
+ u(this, r, D).call(this, t(this, c) + 1);
52
52
  });
53
53
  n(this, z, (e) => {
54
54
  if (!t(this, v).current)
55
55
  return;
56
- let i = 0;
56
+ let s = 0;
57
57
  V(
58
- (r) => {
59
- const d = e.x - r.x, S = e.y - r.y;
60
- t(this, v).current === "x" ? Math.abs(d) > Math.abs(S) && (i = Math.sign(d)) : t(this, v).current === "y" && Math.abs(S) > Math.abs(d) && (i = Math.sign(S));
58
+ (l) => {
59
+ const o = e.x - l.x, k = e.y - l.y;
60
+ t(this, v).current === "x" ? Math.abs(o) > Math.abs(k) && Math.abs(o) > 10 && (s = Math.sign(o)) : t(this, v).current === "y" && Math.abs(k) > Math.abs(o) && Math.abs(k) > 10 && (s = Math.sign(k));
61
61
  },
62
62
  () => {
63
- this.shift(i);
63
+ s && this.shift(s);
64
64
  }
65
65
  );
66
66
  });
@@ -69,38 +69,38 @@ class F extends HTMLElement {
69
69
  return t(this, c);
70
70
  }
71
71
  get itemElements() {
72
- return t(this, o);
72
+ return t(this, d);
73
73
  }
74
74
  addItem(e) {
75
- t(this, o).push(e), u(this, h, J).call(this);
75
+ t(this, d).push(e), u(this, r, J).call(this);
76
76
  }
77
77
  set(e) {
78
- (!this.handleSet || this.handleSet(e)) && (u(this, h, D).call(this, e), u(this, h, H).call(this));
78
+ (!this.handleSet || this.handleSet(e)) && (u(this, r, D).call(this, e), u(this, r, H).call(this));
79
79
  }
80
80
  shift(e) {
81
81
  this.set(t(this, c) + e);
82
82
  }
83
83
  connectedCallback() {
84
84
  var e;
85
- a(this, o, [
85
+ a(this, d, [
86
86
  ...this.querySelectorAll(
87
87
  `[data-billboard-item="${this.id || ""}"]`
88
88
  )
89
- ]), (e = t(this, o)[0]) == null || e.classList.add("current"), u(this, h, J).call(this), t(this, E).subscribe((i) => {
90
- i.current ? (G.subscribe(this, t(this, w)), u(this, h, H).call(this)) : (a(this, x, !0), G.unsubscribe(t(this, w)), clearInterval(t(this, L)), u(this, h, D).call(this, 0));
91
- }), t(this, E).observe(), t(this, v).observe(), t(this, k).observe(), this.addEventListener("pointerdown", t(this, z));
89
+ ]), (e = t(this, d)[0]) == null || e.classList.add("current"), u(this, r, J).call(this), t(this, E).subscribe((s) => {
90
+ s.current ? (G.subscribe(this, t(this, I)), u(this, r, H).call(this)) : (a(this, x, !0), G.unsubscribe(t(this, I)), clearInterval(t(this, L)), u(this, r, D).call(this, 0));
91
+ }), t(this, E).observe(), t(this, v).observe(), t(this, w).observe(), this.addEventListener("pointerdown", t(this, z));
92
92
  }
93
93
  disconnectedCallback() {
94
- t(this, E).unobserve(), t(this, v).unobserve(), t(this, k).unobserve(), G.unsubscribe(t(this, w)), clearInterval(t(this, L));
94
+ t(this, E).unobserve(), t(this, v).unobserve(), t(this, w).unobserve(), G.unsubscribe(t(this, I)), clearInterval(t(this, L));
95
95
  }
96
96
  }
97
- k = new WeakMap(), E = new WeakMap(), v = new WeakMap(), L = new WeakMap(), x = new WeakMap(), o = new WeakMap(), c = new WeakMap(), h = new WeakSet(), J = function() {
98
- t(this, o).length > 1 ? this.classList.add("has-length") : this.classList.remove("has-length");
97
+ w = new WeakMap(), E = new WeakMap(), v = new WeakMap(), L = new WeakMap(), x = new WeakMap(), d = new WeakMap(), c = new WeakMap(), r = new WeakSet(), J = function() {
98
+ t(this, d).length > 1 ? this.classList.add("has-length") : this.classList.remove("has-length");
99
99
  }, H = function() {
100
100
  t(this, E).current !== !1 && t(this, P).call(this);
101
- }, w = new WeakMap(), P = new WeakMap(), D = function(e) {
102
- t(this, k).current ? a(this, c, X(e, t(this, o).length)) : a(this, c, W(e, 0, t(this, o).length - 1)), t(this, o).forEach((i, r) => {
103
- i.classList.remove("current", "previous", "next"), r === t(this, c) ? i.classList.add("current") : r < t(this, c) ? i.classList.add("previous") : r > t(this, c) && i.classList.add("next");
101
+ }, I = new WeakMap(), P = new WeakMap(), D = function(e) {
102
+ t(this, w).current ? a(this, c, X(e, t(this, d).length)) : a(this, c, W(e, 0, t(this, d).length - 1)), t(this, d).forEach((s, l) => {
103
+ s.classList.remove("current", "previous", "next"), l === t(this, c) ? s.classList.add("current") : l < t(this, c) ? s.classList.add("previous") : l > t(this, c) && s.classList.add("next");
104
104
  }), U(this, "billboardChange", {
105
105
  detail: {
106
106
  counter: t(this, c)
@@ -110,20 +110,20 @@ k = new WeakMap(), E = new WeakMap(), v = new WeakMap(), L = new WeakMap(), x =
110
110
  }, 0);
111
111
  }, q = new WeakMap(), z = new WeakMap();
112
112
  customElements.get("e-billboard") || customElements.define("e-billboard", F);
113
- var b, I, m, A, y;
113
+ var b, M, m, A, y;
114
114
  class Y extends HTMLElement {
115
115
  constructor() {
116
116
  super(...arguments);
117
117
  n(this, b, null);
118
- n(this, I, null);
118
+ n(this, M, null);
119
119
  n(this, m, []);
120
120
  n(this, A, (e) => {
121
- const i = e.currentTarget, r = t(this, m).findIndex((d) => d === i);
122
- r >= 0 && t(this, b).set(r);
121
+ const s = e.currentTarget, l = t(this, m).findIndex((o) => o === s);
122
+ l >= 0 && t(this, b).set(l);
123
123
  });
124
124
  n(this, y, () => {
125
- t(this, m).forEach((e, i) => {
126
- i === t(this, b).counter ? e.classList.add("current") : e.classList.remove("current");
125
+ t(this, m).forEach((e, s) => {
126
+ s === t(this, b).counter ? e.classList.add("current") : e.classList.remove("current");
127
127
  });
128
128
  });
129
129
  }
@@ -131,14 +131,14 @@ class Y extends HTMLElement {
131
131
  return R(this, null, function* () {
132
132
  var e;
133
133
  if (a(this, b, O(this, F)), t(this, b) && (yield customElements.whenDefined("e-billboard"), this.isConnected)) {
134
- const i = t(this, b).itemElements.length;
135
- a(this, I, document.createElement("div"));
136
- for (let r = 0; r < i; r++) {
137
- const d = document.createElement("button");
138
- t(this, m).push(d), t(this, I).appendChild(d);
134
+ const s = t(this, b).itemElements.length;
135
+ a(this, M, document.createElement("div"));
136
+ for (let l = 0; l < s; l++) {
137
+ const o = document.createElement("button");
138
+ t(this, m).push(o), t(this, M).appendChild(o);
139
139
  }
140
- this.appendChild(t(this, I)), t(this, m).forEach((r) => {
141
- r.addEventListener("click", t(this, A));
140
+ this.appendChild(t(this, M)), t(this, m).forEach((l) => {
141
+ l.addEventListener("click", t(this, A));
142
142
  }), (e = t(this, b)) == null || e.addEventListener(
143
143
  "billboardChange",
144
144
  t(this, y)
@@ -148,15 +148,15 @@ class Y extends HTMLElement {
148
148
  }
149
149
  disconnectedCallback() {
150
150
  var e;
151
- t(this, m).forEach((i) => {
152
- i.removeEventListener("click", t(this, A));
151
+ t(this, m).forEach((s) => {
152
+ s.removeEventListener("click", t(this, A));
153
153
  }), (e = t(this, b)) == null || e.removeEventListener(
154
154
  "billboardChange",
155
155
  t(this, y)
156
156
  ), this.innerHTML = "", a(this, m, []);
157
157
  }
158
158
  }
159
- b = new WeakMap(), I = new WeakMap(), m = new WeakMap(), A = new WeakMap(), y = new WeakMap();
159
+ b = new WeakMap(), M = new WeakMap(), m = new WeakMap(), A = new WeakMap(), y = new WeakMap();
160
160
  K && !customElements.get("e-billboard-bullets") && customElements.define("e-billboard-bullets", Y);
161
161
  var f, p, g;
162
162
  class Z extends HTMLElement {
@@ -191,24 +191,24 @@ class Z extends HTMLElement {
191
191
  }
192
192
  f = new WeakMap(), p = new WeakMap(), g = new WeakMap();
193
193
  K && !customElements.get("e-billboard-set-button") && customElements.define("e-billboard-set-button", Z);
194
- var M, B;
194
+ var B, S;
195
195
  class _ extends HTMLElement {
196
196
  constructor() {
197
197
  super();
198
- n(this, M, new T(this, "--step", 1));
199
- n(this, B, null);
198
+ n(this, B, new T(this, "--step", 1));
199
+ n(this, S, null);
200
200
  this.addEventListener("click", (e) => {
201
- t(this, B) && (!this.handleClick || this.handleClick(e)) && t(this, B).shift(t(this, M).current);
201
+ t(this, S) && (!this.handleClick || this.handleClick(e)) && t(this, S).shift(t(this, B).current);
202
202
  });
203
203
  }
204
204
  connectedCallback() {
205
- this.tabIndex = 0, a(this, B, O(this, F)), t(this, M).observe();
205
+ this.tabIndex = 0, a(this, S, O(this, F)), t(this, B).observe();
206
206
  }
207
207
  disconnectedCallback() {
208
- this.removeAttribute("tabindex"), t(this, M).unobserve();
208
+ this.removeAttribute("tabindex"), t(this, B).unobserve();
209
209
  }
210
210
  }
211
- M = new WeakMap(), B = new WeakMap();
211
+ B = new WeakMap(), S = new WeakMap();
212
212
  K && !customElements.get("e-billboard-step-button") && customElements.define("e-billboard-step-button", _);
213
213
  export {
214
214
  Y as BillboardBulletsElement,
@@ -1 +1 @@
1
- "use strict";var N=c=>{throw TypeError(c)};var K=(c,r,t)=>r.has(c)||N("Cannot "+t);var e=(c,r,t)=>(K(c,r,"read from private field"),t?t.call(c):r.get(c)),i=(c,r,t)=>r.has(c)?N("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(c):r.set(c,t),n=(c,r,t,s)=>(K(c,r,"write to private field"),s?s.call(c,t):r.set(c,t),t),m=(c,r,t)=>(K(c,r,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const oe=require("../element-linked-store/index.cjs"),b=require("../css-property/index.cjs"),Y=require("../index-Cqw2NKev.cjs"),j=require("../events-KVanG9sR.cjs"),ne=require("../function-MthRj-GJ.cjs"),_=require("../style-At6aDoqG.cjs"),ee=require("../url-D1CgmwZ_.cjs"),te=require("../window-resizer/index.cjs");var u,v,F,J;class he{constructor(){i(this,u,new Map);i(this,v,[]);i(this,F,r=>{var s;const t=[...e(this,v)].reverse().find(o=>o.clickOutside.current);if(t){const o=r.composedPath();if(o.find(Z=>Z instanceof HTMLElement&&Z.hasAttribute("data-popover-content")))return;const l=o[0],q=l instanceof Node&&(t.contains(l)||((s=t.shadowRoot)==null?void 0:s.contains(l))),re=l instanceof HTMLElement&&l.hasAttribute("data-outside");(!q||re)&&t.close()}});i(this,J,r=>{if(r.code==="Escape"){const t=[...e(this,v)].reverse().find(s=>s.escape.current);t&&t.close()}});addEventListener("click",e(this,F)),addEventListener("keydown",e(this,J))}get groups(){return e(this,u)}get stack(){return e(this,v)}add(r,t){if(t.closeRest.current)e(this,u).forEach(o=>{o.forEach(l=>{l.close()})});else if(t.closeRestInGroup.current){let o=e(this,u).get(r);o==null||o.forEach(l=>{l.close()})}let s=e(this,u).get(r);s!=null&&s.length||(s=[],e(this,u).set(r,s)),e(this,v).push(t),s.push(t)}remove(r,t){if(n(this,v,e(this,v).filter(s=>s!==t)),t.closeRest.current){let s=[];e(this,u).forEach(o=>{o.forEach(l=>s.push(l))}),e(this,u).clear(),s.forEach(o=>o.close())}else if(t.closeRestInGroup.current){const s=e(this,u).get(r);e(this,u).delete(r),s==null||s.forEach(o=>{o.close()})}else{let s=e(this,u).get(r);s&&(s=s.filter(o=>o!==t),e(this,u).set(r,s))}}}u=new WeakMap,v=new WeakMap,F=new WeakMap,J=new WeakMap;var d,$,M,w,O,f,y,P,k,g,C,A,L,R,a,T,se,I,x,V,W,H;const E=class E extends HTMLElement{constructor(){super();i(this,T);i(this,d);i(this,$);i(this,M);i(this,w);i(this,O);i(this,f);i(this,y);i(this,P);i(this,k);i(this,g);i(this,C);i(this,A);i(this,L);i(this,R);i(this,a);i(this,x);i(this,V);i(this,W);i(this,H);this.urlValue="",n(this,d,!1),n(this,f,new b.CSSProperty(this,"--history",!1)),n(this,y,new b.CSSProperty(this,"--restore",!1)),n(this,P,new b.CSSProperty(this,"--close-rest",!1)),n(this,k,new b.CSSProperty(this,"--close-rest-in-group",!1)),n(this,g,new b.CSSProperty(this,"--group","")),n(this,C,new b.CSSProperty(this,"--click-outside",!1)),n(this,A,new b.CSSProperty(this,"--escape",!1)),n(this,L,!1),n(this,a,new oe.ElementLinkedStore(this,{opened:!1,closing:!1,triggered:!1,transitionend:!1})),n(this,x,()=>{n(this,L,!1),e(this,d)&&e(this,f).current&&!location.search.includes(this.id)?this.close():!e(this,d)&&e(this,f).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),n(this,L,!0)}),n(this,V,()=>{this.style.setProperty("--content-width","initial"),this.style.setProperty("--content-height","initial"),e(this,W).call(this)}),n(this,W,ne.debounce(()=>{e(this,H).call(this)},10)),n(this,H,()=>{this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px")}),e(this,g).subscribe(t=>{t.previous&&(E.stack.remove(t.previous,this),t.current||(document.documentElement.classList.remove(`${this.group.previous}-closing`),document.documentElement.classList.remove(`${this.group.previous}-opened`)))}),e(this,a).subscribe(t=>{if(this.group.current){document.documentElement.classList.toggle(`${this.group.current}-closing`,t.current.closing);const s=E.stack.groups.get(this.group.current),o=s==null?void 0:s.find(l=>l.opened);document.documentElement.classList.toggle(`${this.group.current}-opened`,!!o)}})}get history(){return e(this,f)}get restore(){return e(this,y)}get closeRest(){return e(this,P)}get closeRestInGroup(){return e(this,k)}get group(){return e(this,g)}get clickOutside(){return e(this,C)}get escape(){return e(this,A)}get opened(){return e(this,d)}get lastTrigger(){return e(this,R)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,d)&&ee.updateSearchParameter(this.id,t)}open(t){if(e(this,d))return;n(this,R,t==null?void 0:t.trigger),clearTimeout(e(this,$)),clearTimeout(e(this,M)),e(this,a).set("closing",!1),e(this,a).set("triggered",!0),j.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,R)}}),e(this,f).current&&e(this,L)&&history.pushState(history.state,"",e(this,T,se)),n(this,d,!0);const s=()=>{E.stack.add(e(this,g).current,this),e(this,H).call(this),e(this,a).set("opened",!0),j.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,R)}}),n(this,w,void 0),n(this,O,setTimeout(()=>{e(this,a).set("transitionend",!0)},_.getElementTransitionDurationMS(this)+10))};t!=null&&t.skipTransition?s():n(this,w,setTimeout(s,10))}close(){e(this,d)&&(clearTimeout(e(this,w)),clearTimeout(e(this,O)),E.stack.remove(e(this,g).current,this),n(this,d,!1),m(this,T,I).call(this),e(this,a).set("transitionend",!1),n(this,$,setTimeout(()=>{e(this,a).set("opened",!1),e(this,a).set("closing",!0),j.dispatchEvent(this,"popoverClosing",{custom:!0}),n(this,M,setTimeout(()=>{e(this,a).set("triggered",!1),e(this,a).set("closing",!1),j.dispatchEvent(this,"popoverClosed",{custom:!0})},_.getElementTransitionDurationMS(this)+10))},10)))}connectedCallback(){e(this,f).observe(),e(this,y).observe(),e(this,P).observe(),e(this,k).observe(),e(this,g).observe(),e(this,C).observe(),e(this,A).observe(),this.setAttribute("role","dialog"),addEventListener("popstate",e(this,x)),setTimeout(()=>{e(this,y).current?(this.urlValue=ee.parseSearchParameters(location.search)[this.id],e(this,x).call(this)):(m(this,T,I).call(this),n(this,L,!0))},0),te.windowResizer.subscribe(e(this,V))}disconnectedCallback(){E.stack.remove(e(this,g).current,this),te.windowResizer.unsubscribe(e(this,V)),e(this,a).close(),e(this,f).close(),e(this,y).close(),e(this,P).close(),e(this,k).close(),e(this,g).close(),e(this,C).close(),e(this,A).close(),this.removeAttribute("role"),clearTimeout(e(this,$)),clearTimeout(e(this,M)),clearTimeout(e(this,w)),clearTimeout(e(this,O)),removeEventListener("popstate",e(this,x)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),m(this,T,I).call(this)}};d=new WeakMap,$=new WeakMap,M=new WeakMap,w=new WeakMap,O=new WeakMap,f=new WeakMap,y=new WeakMap,P=new WeakMap,k=new WeakMap,g=new WeakMap,C=new WeakMap,A=new WeakMap,L=new WeakMap,R=new WeakMap,a=new WeakMap,T=new WeakSet,se=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},I=function(){if(e(this,f).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},x=new WeakMap,V=new WeakMap,W=new WeakMap,H=new WeakMap,E.stack=new he;let z=E;Y.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",z);var h,p,S,Q,B,G,D,U,X;class ie extends HTMLElement{constructor(){super();i(this,S);i(this,h);i(this,p,new b.CSSProperty(this,"--type","open"));i(this,B,()=>{e(this,p).current!=="close"&&this.classList.add("triggered")});i(this,G,()=>{e(this,p).current!=="close"&&(this.classList.add("opened"),this.setAttribute("aria-expanded","true"))});i(this,D,()=>{e(this,p).current!=="close"&&this.classList.remove("opened")});i(this,U,()=>{e(this,p).current!=="close"&&(this.classList.remove("triggered"),this.setAttribute("aria-expanded","false"))});Y.isBrowser&&(this.addEventListener("click",()=>{if(e(this,h)){const t=e(this,p).current;t==="open"||t==="toggle"&&!e(this,h).opened?e(this,h).open({trigger:this}):(t==="close"||t==="toggle"&&e(this,h).opened)&&e(this,h).close()}}),this.addEventListener("keydown",t=>{t.code==="Space"&&t.currentTarget.click()}))}get type(){return e(this,p)}get popoverElement(){return e(this,h)}changePopover(t){var s;if(m(this,S,Q).call(this),t){let o=null;if(t==="parent"){const l=this.closest("[data-popover]");if(l)o=l;else{const q=this.getRootNode();q instanceof ShadowRoot?o=q.host.closest("[data-popover]"):q instanceof HTMLElement&&(o=q.closest("[data-popover]"))}}else t==="sibling"?o=(s=this.parentElement)==null?void 0:s.querySelector("[data-popover]"):(!t.startsWith(".")&&!t.startsWith("[")&&(t=`#${t}`),o=document.querySelector(t)||this.getRootNode().querySelector(t));o instanceof HTMLElement?(n(this,h,o),e(this,h).addEventListener("popoverTriggered",e(this,B)),e(this,h).addEventListener("popoverOpened",e(this,G)),e(this,h).addEventListener("popoverClosing",e(this,D)),e(this,h).addEventListener("popoverClosed",e(this,U))):console.warn(this,`target ${t} not found`)}m(this,S,X).call(this,e(this,p).current)}connectedCallback(){e(this,p).subscribe(s=>{m(this,S,X).call(this,s.current)}),this.hasAttribute("tabindex")||(this.tabIndex=0);const t=this.getAttribute("target");t&&this.changePopover(t),this.isConnected&&e(this,p).observe()}disconnectedCallback(){e(this,p).unobserve(),this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls"),m(this,S,Q).call(this)}}h=new WeakMap,p=new WeakMap,S=new WeakSet,Q=function(){e(this,h)&&(e(this,h).removeEventListener("popoverTriggered",e(this,B)),e(this,h).removeEventListener("popoverOpened",e(this,G)),e(this,h).removeEventListener("popoverClosing",e(this,D)),e(this,h).removeEventListener("popoverClosed",e(this,U)))},B=new WeakMap,G=new WeakMap,D=new WeakMap,U=new WeakMap,X=function(t){e(this,h)instanceof z&&(t!=="close"?(this.setAttribute("aria-haspopup","true"),this.setAttribute("aria-expanded",e(this,h).opened?"true":"false"),this.setAttribute("aria-controls",e(this,h).id||"")):(this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls")))};Y.isBrowser&&!customElements.get("e-popover-button")&&customElements.define("e-popover-button",ie);exports.PopoverButtonElement=ie;exports.PopoverElement=z;
1
+ "use strict";var _=c=>{throw TypeError(c)};var Q=(c,r,t)=>r.has(c)||_("Cannot "+t);var e=(c,r,t)=>(Q(c,r,"read from private field"),t?t.call(c):r.get(c)),i=(c,r,t)=>r.has(c)?_("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(c):r.set(c,t),n=(c,r,t,s)=>(Q(c,r,"write to private field"),s?s.call(c,t):r.set(c,t),t),E=(c,r,t)=>(Q(c,r,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const oe=require("../element-linked-store/index.cjs"),b=require("../css-property/index.cjs"),Z=require("../index-Cqw2NKev.cjs"),F=require("../events-KVanG9sR.cjs"),ne=require("../function-MthRj-GJ.cjs"),ee=require("../style-At6aDoqG.cjs"),te=require("../url-D1CgmwZ_.cjs"),se=require("../window-resizer/index.cjs");var u,m,J,K;class he{constructor(){i(this,u,new Map);i(this,m,[]);i(this,J,r=>{var s;const t=[...e(this,m)].reverse().find(o=>o.clickOutside.current);if(t){const o=r.composedPath();if(o.find(N=>N instanceof HTMLElement&&N.hasAttribute("data-popover-content")))return;const a=o[0],p=a instanceof Node&&(t.contains(a)||((s=t.shadowRoot)==null?void 0:s.contains(a))),z=a instanceof HTMLElement&&a.hasAttribute("data-outside");(!p||z)&&t.close()}});i(this,K,r=>{if(r.code==="Escape"){const t=[...e(this,m)].reverse().find(s=>s.escape.current);t&&t.close()}});addEventListener("click",e(this,J)),addEventListener("keydown",e(this,K))}get groups(){return e(this,u)}get stack(){return e(this,m)}add(r,t){if(t.closeRest.current)e(this,u).forEach(o=>{o.forEach(a=>{a.close()})});else if(t.closeRestInGroup.current){let o=e(this,u).get(r);o==null||o.forEach(a=>{a.close()})}let s=e(this,u).get(r);s!=null&&s.length||(s=[],e(this,u).set(r,s)),e(this,m).push(t),s.push(t)}remove(r,t){if(n(this,m,e(this,m).filter(s=>s!==t)),t.closeRest.current){let s=[];e(this,u).forEach(o=>{o.forEach(a=>s.push(a))}),e(this,u).clear(),s.forEach(o=>o.close())}else if(t.closeRestInGroup.current){const s=e(this,u).get(r);e(this,u).delete(r),s==null||s.forEach(o=>{o.close()})}else{let s=e(this,u).get(r);s&&(s=s.filter(o=>o!==t),e(this,u).set(r,s))}}}u=new WeakMap,m=new WeakMap,J=new WeakMap,K=new WeakMap;var f,$,M,P,O,g,L,k,C,v,A,R,T,x,l,S,ie,I,q,V,B,H;const y=class y extends HTMLElement{constructor(){super();i(this,S);i(this,f);i(this,$);i(this,M);i(this,P);i(this,O);i(this,g);i(this,L);i(this,k);i(this,C);i(this,v);i(this,A);i(this,R);i(this,T);i(this,x);i(this,l);i(this,q);i(this,V);i(this,B);i(this,H);this.urlValue="",n(this,f,!1),n(this,g,new b.CSSProperty(this,"--history",!1)),n(this,L,new b.CSSProperty(this,"--restore",!1)),n(this,k,new b.CSSProperty(this,"--close-rest",!1)),n(this,C,new b.CSSProperty(this,"--close-rest-in-group",!1)),n(this,v,new b.CSSProperty(this,"--group","")),n(this,A,new b.CSSProperty(this,"--click-outside",!1)),n(this,R,new b.CSSProperty(this,"--escape",!1)),n(this,T,!1),n(this,l,new oe.ElementLinkedStore(this,{opened:!1,closing:!1,triggered:!1,transitionend:!1})),n(this,q,()=>{n(this,T,!1),e(this,f)&&e(this,g).current&&!location.search.includes(this.id)?this.close():!e(this,f)&&e(this,g).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),n(this,T,!0)}),n(this,V,()=>{this.style.setProperty("--content-width","initial"),this.style.setProperty("--content-height","initial"),e(this,B).call(this)}),n(this,B,ne.debounce(()=>{e(this,H).call(this)},10)),n(this,H,()=>{this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px")}),e(this,v).subscribe(t=>{t.previous&&(y.stack.remove(t.previous,this),t.current||(document.documentElement.classList.remove(`${this.group.previous}-closing`),document.documentElement.classList.remove(`${this.group.previous}-opened`)))}),e(this,l).subscribe(t=>{if(this.group.current){document.documentElement.classList.toggle(`${this.group.current}-closing`,t.current.closing);const s=y.stack.groups.get(this.group.current),o=s==null?void 0:s.find(a=>a.opened);document.documentElement.classList.toggle(`${this.group.current}-opened`,!!o)}})}get history(){return e(this,g)}get restore(){return e(this,L)}get closeRest(){return e(this,k)}get closeRestInGroup(){return e(this,C)}get group(){return e(this,v)}get clickOutside(){return e(this,A)}get escape(){return e(this,R)}get opened(){return e(this,f)}get lastTrigger(){return e(this,x)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,f)&&te.updateSearchParameter(this.id,t)}open(t){if(e(this,f))return;n(this,x,t==null?void 0:t.trigger),clearTimeout(e(this,$)),clearTimeout(e(this,M)),e(this,l).set("closing",!1),e(this,l).set("triggered",!0),F.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,x)}}),e(this,g).current&&e(this,T)&&history.pushState(history.state,"",e(this,S,ie)),n(this,f,!0);const s=()=>{y.stack.add(e(this,v).current,this),e(this,H).call(this),e(this,l).set("opened",!0),F.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,x)}}),n(this,P,void 0),n(this,O,setTimeout(()=>{e(this,l).set("transitionend",!0)},ee.getElementTransitionDurationMS(this)+10))};t!=null&&t.skipTransition?s():n(this,P,setTimeout(s,10))}close(){e(this,f)&&(clearTimeout(e(this,P)),clearTimeout(e(this,O)),y.stack.remove(e(this,v).current,this),n(this,f,!1),E(this,S,I).call(this),e(this,l).set("transitionend",!1),n(this,$,setTimeout(()=>{e(this,l).set("opened",!1),e(this,l).set("closing",!0),F.dispatchEvent(this,"popoverClosing",{custom:!0}),n(this,M,setTimeout(()=>{e(this,l).set("triggered",!1),e(this,l).set("closing",!1),F.dispatchEvent(this,"popoverClosed",{custom:!0})},ee.getElementTransitionDurationMS(this)+10))},10)))}connectedCallback(){e(this,g).observe(),e(this,L).observe(),e(this,k).observe(),e(this,C).observe(),e(this,v).observe(),e(this,A).observe(),e(this,R).observe(),this.setAttribute("role","dialog"),addEventListener("popstate",e(this,q)),setTimeout(()=>{e(this,L).current?(this.urlValue=te.parseSearchParameters(location.search)[this.id],e(this,q).call(this)):(E(this,S,I).call(this),n(this,T,!0))},0),se.windowResizer.subscribe(e(this,V))}disconnectedCallback(){y.stack.remove(e(this,v).current,this),se.windowResizer.unsubscribe(e(this,V)),e(this,l).close(),e(this,g).close(),e(this,L).close(),e(this,k).close(),e(this,C).close(),e(this,v).close(),e(this,A).close(),e(this,R).close(),this.removeAttribute("role"),clearTimeout(e(this,$)),clearTimeout(e(this,M)),clearTimeout(e(this,P)),clearTimeout(e(this,O)),removeEventListener("popstate",e(this,q)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),E(this,S,I).call(this)}};f=new WeakMap,$=new WeakMap,M=new WeakMap,P=new WeakMap,O=new WeakMap,g=new WeakMap,L=new WeakMap,k=new WeakMap,C=new WeakMap,v=new WeakMap,A=new WeakMap,R=new WeakMap,T=new WeakMap,x=new WeakMap,l=new WeakMap,S=new WeakSet,ie=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},I=function(){if(e(this,g).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},q=new WeakMap,V=new WeakMap,B=new WeakMap,H=new WeakMap,y.stack=new he;let W=y;Z.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",W);var h,d,w,X,G,D,U,j,Y;class re extends HTMLElement{constructor(){super();i(this,w);i(this,h);i(this,d,new b.CSSProperty(this,"--type","open"));i(this,G,()=>{e(this,d).current!=="close"&&this.classList.add("triggered")});i(this,D,()=>{e(this,d).current!=="close"&&(this.classList.add("opened"),this.setAttribute("aria-expanded","true"))});i(this,U,()=>{e(this,d).current!=="close"&&this.classList.remove("opened")});i(this,j,()=>{e(this,d).current!=="close"&&(this.classList.remove("triggered"),this.setAttribute("aria-expanded","false"))});Z.isBrowser&&(this.addEventListener("click",()=>{if(e(this,h)){const t=e(this,d).current;t==="open"||t==="toggle"&&!e(this,h).opened?e(this,h).open({trigger:this}):(t==="close"||t==="toggle"&&e(this,h).opened)&&e(this,h).close()}}),this.addEventListener("keydown",t=>{t.code==="Space"&&t.currentTarget.click()}))}get type(){return e(this,d)}get popoverElement(){return e(this,h)}changePopover(t){var s;if(E(this,w,X).call(this),t){let o=null;if(t==="parent"){const a=this.closest("[data-popover]");if(a)o=a;else{const p=this.getRootNode();p instanceof ShadowRoot?o=p.host.closest("[data-popover]"):p instanceof HTMLElement&&(o=p.closest("[data-popover]"))}}else if(t==="sibling")o=(s=this.parentElement)==null?void 0:s.querySelector("[data-popover]");else if(t==="ancestor-child"){const a=p=>{if(!p)return null;let z=p.querySelector("[data-popover]");return!z&&(p!=null&&p.parentElement)&&(z=a(p.parentElement)),z};o=a(this.parentElement)||null}else!t.startsWith(".")&&!t.startsWith("[")&&(t=`#${t}`),o=document.querySelector(t)||this.getRootNode().querySelector(t);o instanceof HTMLElement?(n(this,h,o),e(this,h).addEventListener("popoverTriggered",e(this,G)),e(this,h).addEventListener("popoverOpened",e(this,D)),e(this,h).addEventListener("popoverClosing",e(this,U)),e(this,h).addEventListener("popoverClosed",e(this,j))):console.warn(this,`target ${t} not found`)}E(this,w,Y).call(this,e(this,d).current)}connectedCallback(){e(this,d).subscribe(s=>{E(this,w,Y).call(this,s.current)}),this.hasAttribute("tabindex")||(this.tabIndex=0);const t=this.getAttribute("target");t&&this.changePopover(t),this.isConnected&&e(this,d).observe()}disconnectedCallback(){e(this,d).unobserve(),this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls"),E(this,w,X).call(this)}}h=new WeakMap,d=new WeakMap,w=new WeakSet,X=function(){e(this,h)&&(e(this,h).removeEventListener("popoverTriggered",e(this,G)),e(this,h).removeEventListener("popoverOpened",e(this,D)),e(this,h).removeEventListener("popoverClosing",e(this,U)),e(this,h).removeEventListener("popoverClosed",e(this,j)))},G=new WeakMap,D=new WeakMap,U=new WeakMap,j=new WeakMap,Y=function(t){e(this,h)instanceof W&&(t!=="close"?(this.setAttribute("aria-haspopup","true"),this.setAttribute("aria-expanded",e(this,h).opened?"true":"false"),this.setAttribute("aria-controls",e(this,h).id||"")):(this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls")))};Z.isBrowser&&!customElements.get("e-popover-button")&&customElements.define("e-popover-button",re);exports.PopoverButtonElement=re;exports.PopoverElement=W;
@@ -1,47 +1,47 @@
1
- var N = (c) => {
1
+ var _ = (c) => {
2
2
  throw TypeError(c);
3
3
  };
4
- var K = (c, r, t) => r.has(c) || N("Cannot " + t);
5
- var e = (c, r, t) => (K(c, r, "read from private field"), t ? t.call(c) : r.get(c)), i = (c, r, t) => r.has(c) ? N("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(c) : r.set(c, t), h = (c, r, t, s) => (K(c, r, "write to private field"), s ? s.call(c, t) : r.set(c, t), t), v = (c, r, t) => (K(c, r, "access private method"), t);
4
+ var Q = (c, r, t) => r.has(c) || _("Cannot " + t);
5
+ var e = (c, r, t) => (Q(c, r, "read from private field"), t ? t.call(c) : r.get(c)), i = (c, r, t) => r.has(c) ? _("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(c) : r.set(c, t), h = (c, r, t, s) => (Q(c, r, "write to private field"), s ? s.call(c, t) : r.set(c, t), t), b = (c, r, t) => (Q(c, r, "access private method"), t);
6
6
  import { ElementLinkedStore as ie } from "../element-linked-store/index.js";
7
- import { CSSProperty as b } from "../css-property/index.js";
8
- import { i as Y } from "../index-euf5anj6.js";
9
- import { d as D } from "../events-CsVF98U6.js";
7
+ import { CSSProperty as E } from "../css-property/index.js";
8
+ import { i as Z } from "../index-euf5anj6.js";
9
+ import { d as j } from "../events-CsVF98U6.js";
10
10
  import { d as re } from "../function-C10DGppn.js";
11
- import { g as _ } from "../style-j2TwriJ_.js";
11
+ import { g as ee } from "../style-j2TwriJ_.js";
12
12
  import { u as oe, p as he } from "../url-B6BNcw6_.js";
13
- import { windowResizer as ee } from "../window-resizer/index.js";
14
- var u, m, F, J;
13
+ import { windowResizer as te } from "../window-resizer/index.js";
14
+ var u, v, J, K;
15
15
  class ne {
16
16
  constructor() {
17
17
  i(this, u, /* @__PURE__ */ new Map());
18
- i(this, m, []);
19
- i(this, F, (r) => {
18
+ i(this, v, []);
19
+ i(this, J, (r) => {
20
20
  var s;
21
- const t = [...e(this, m)].reverse().find((o) => o.clickOutside.current);
21
+ const t = [...e(this, v)].reverse().find((o) => o.clickOutside.current);
22
22
  if (t) {
23
23
  const o = r.composedPath();
24
24
  if (o.find(
25
- (Z) => Z instanceof HTMLElement && Z.hasAttribute("data-popover-content")
25
+ (N) => N instanceof HTMLElement && N.hasAttribute("data-popover-content")
26
26
  ))
27
27
  return;
28
- const a = o[0], $ = a instanceof Node && (t.contains(a) || ((s = t.shadowRoot) == null ? void 0 : s.contains(a))), se = a instanceof HTMLElement && a.hasAttribute("data-outside");
29
- (!$ || se) && t.close();
28
+ const a = o[0], p = a instanceof Node && (t.contains(a) || ((s = t.shadowRoot) == null ? void 0 : s.contains(a))), G = a instanceof HTMLElement && a.hasAttribute("data-outside");
29
+ (!p || G) && t.close();
30
30
  }
31
31
  });
32
- i(this, J, (r) => {
32
+ i(this, K, (r) => {
33
33
  if (r.code === "Escape") {
34
- const t = [...e(this, m)].reverse().find((s) => s.escape.current);
34
+ const t = [...e(this, v)].reverse().find((s) => s.escape.current);
35
35
  t && t.close();
36
36
  }
37
37
  });
38
- addEventListener("click", e(this, F)), addEventListener("keydown", e(this, J));
38
+ addEventListener("click", e(this, J)), addEventListener("keydown", e(this, K));
39
39
  }
40
40
  get groups() {
41
41
  return e(this, u);
42
42
  }
43
43
  get stack() {
44
- return e(this, m);
44
+ return e(this, v);
45
45
  }
46
46
  add(r, t) {
47
47
  if (t.closeRest.current)
@@ -57,10 +57,10 @@ class ne {
57
57
  });
58
58
  }
59
59
  let s = e(this, u).get(r);
60
- s != null && s.length || (s = [], e(this, u).set(r, s)), e(this, m).push(t), s.push(t);
60
+ s != null && s.length || (s = [], e(this, u).set(r, s)), e(this, v).push(t), s.push(t);
61
61
  }
62
62
  remove(r, t) {
63
- if (h(this, m, e(this, m).filter((s) => s !== t)), t.closeRest.current) {
63
+ if (h(this, v, e(this, v).filter((s) => s !== t)), t.closeRest.current) {
64
64
  let s = [];
65
65
  e(this, u).forEach((o) => {
66
66
  o.forEach((a) => s.push(a));
@@ -76,50 +76,50 @@ class ne {
76
76
  }
77
77
  }
78
78
  }
79
- u = new WeakMap(), m = new WeakMap(), F = new WeakMap(), J = new WeakMap();
80
- var d, V, M, w, O, f, L, A, P, g, S, C, T, R, l, y, te, I, x, H, G, W;
81
- const E = class E extends HTMLElement {
79
+ u = new WeakMap(), v = new WeakMap(), J = new WeakMap(), K = new WeakMap();
80
+ var f, V, M, A, O, g, T, P, S, m, C, R, y, x, l, k, se, F, $, H, q, W;
81
+ const L = class L extends HTMLElement {
82
82
  constructor() {
83
83
  super();
84
- i(this, y);
85
- i(this, d);
84
+ i(this, k);
85
+ i(this, f);
86
86
  i(this, V);
87
87
  i(this, M);
88
- i(this, w);
89
- i(this, O);
90
- i(this, f);
91
- i(this, L);
92
88
  i(this, A);
93
- i(this, P);
89
+ i(this, O);
94
90
  i(this, g);
91
+ i(this, T);
92
+ i(this, P);
95
93
  i(this, S);
94
+ i(this, m);
96
95
  i(this, C);
97
- i(this, T);
98
96
  i(this, R);
99
- i(this, l);
97
+ i(this, y);
100
98
  i(this, x);
99
+ i(this, l);
100
+ i(this, $);
101
101
  i(this, H);
102
- i(this, G);
102
+ i(this, q);
103
103
  i(this, W);
104
- this.urlValue = "", h(this, d, !1), h(this, f, new b(this, "--history", !1)), h(this, L, new b(this, "--restore", !1)), h(this, A, new b(this, "--close-rest", !1)), h(this, P, new b(
104
+ this.urlValue = "", h(this, f, !1), h(this, g, new E(this, "--history", !1)), h(this, T, new E(this, "--restore", !1)), h(this, P, new E(this, "--close-rest", !1)), h(this, S, new E(
105
105
  this,
106
106
  "--close-rest-in-group",
107
107
  !1
108
- )), h(this, g, new b(this, "--group", "")), h(this, S, new b(this, "--click-outside", !1)), h(this, C, new b(this, "--escape", !1)), h(this, T, !1), h(this, l, new ie(this, {
108
+ )), h(this, m, new E(this, "--group", "")), h(this, C, new E(this, "--click-outside", !1)), h(this, R, new E(this, "--escape", !1)), h(this, y, !1), h(this, l, new ie(this, {
109
109
  opened: !1,
110
110
  closing: !1,
111
111
  triggered: !1,
112
112
  transitionend: !1
113
- })), h(this, x, () => {
114
- h(this, T, !1), e(this, d) && e(this, f).current && !location.search.includes(this.id) ? this.close() : !e(this, d) && e(this, f).current && location.search.includes(this.id) && this.open({ trigger: this.idWithValue }), h(this, T, !0);
113
+ })), h(this, $, () => {
114
+ h(this, y, !1), e(this, f) && e(this, g).current && !location.search.includes(this.id) ? this.close() : !e(this, f) && e(this, g).current && location.search.includes(this.id) && this.open({ trigger: this.idWithValue }), h(this, y, !0);
115
115
  }), h(this, H, () => {
116
- this.style.setProperty("--content-width", "initial"), this.style.setProperty("--content-height", "initial"), e(this, G).call(this);
117
- }), h(this, G, re(() => {
116
+ this.style.setProperty("--content-width", "initial"), this.style.setProperty("--content-height", "initial"), e(this, q).call(this);
117
+ }), h(this, q, re(() => {
118
118
  e(this, W).call(this);
119
119
  }, 10)), h(this, W, () => {
120
120
  this.style.setProperty("--content-width", this.scrollWidth + "px"), this.style.setProperty("--content-height", this.scrollHeight + "px");
121
- }), e(this, g).subscribe((t) => {
122
- t.previous && (E.stack.remove(t.previous, this), t.current || (document.documentElement.classList.remove(
121
+ }), e(this, m).subscribe((t) => {
122
+ t.previous && (L.stack.remove(t.previous, this), t.current || (document.documentElement.classList.remove(
123
123
  `${this.group.previous}-closing`
124
124
  ), document.documentElement.classList.remove(
125
125
  `${this.group.previous}-opened`
@@ -130,7 +130,7 @@ const E = class E extends HTMLElement {
130
130
  `${this.group.current}-closing`,
131
131
  t.current.closing
132
132
  );
133
- const s = E.stack.groups.get(this.group.current), o = s == null ? void 0 : s.find((a) => a.opened);
133
+ const s = L.stack.groups.get(this.group.current), o = s == null ? void 0 : s.find((a) => a.opened);
134
134
  document.documentElement.classList.toggle(
135
135
  `${this.group.current}-opened`,
136
136
  !!o
@@ -139,111 +139,111 @@ const E = class E extends HTMLElement {
139
139
  });
140
140
  }
141
141
  get history() {
142
- return e(this, f);
142
+ return e(this, g);
143
143
  }
144
144
  get restore() {
145
- return e(this, L);
145
+ return e(this, T);
146
146
  }
147
147
  get closeRest() {
148
- return e(this, A);
148
+ return e(this, P);
149
149
  }
150
150
  get closeRestInGroup() {
151
- return e(this, P);
151
+ return e(this, S);
152
152
  }
153
153
  get group() {
154
- return e(this, g);
154
+ return e(this, m);
155
155
  }
156
156
  get clickOutside() {
157
- return e(this, S);
157
+ return e(this, C);
158
158
  }
159
159
  get escape() {
160
- return e(this, C);
160
+ return e(this, R);
161
161
  }
162
162
  get opened() {
163
- return e(this, d);
163
+ return e(this, f);
164
164
  }
165
165
  get lastTrigger() {
166
- return e(this, R);
166
+ return e(this, x);
167
167
  }
168
168
  get idWithValue() {
169
169
  return `${this.id}${this.urlValue ? "=" + this.urlValue : ""}`;
170
170
  }
171
171
  updateUrlValue(t) {
172
- this.urlValue = (t == null ? void 0 : t.toString()) || "", e(this, d) && oe(this.id, t);
172
+ this.urlValue = (t == null ? void 0 : t.toString()) || "", e(this, f) && oe(this.id, t);
173
173
  }
174
174
  open(t) {
175
- if (e(this, d))
175
+ if (e(this, f))
176
176
  return;
177
- h(this, R, t == null ? void 0 : t.trigger), clearTimeout(e(this, V)), clearTimeout(e(this, M)), e(this, l).set("closing", !1), e(this, l).set("triggered", !0), D(this, "popoverTriggered", {
177
+ h(this, x, t == null ? void 0 : t.trigger), clearTimeout(e(this, V)), clearTimeout(e(this, M)), e(this, l).set("closing", !1), e(this, l).set("triggered", !0), j(this, "popoverTriggered", {
178
178
  custom: !0,
179
179
  detail: {
180
- trigger: e(this, R)
180
+ trigger: e(this, x)
181
181
  }
182
- }), e(this, f).current && e(this, T) && history.pushState(history.state, "", e(this, y, te)), h(this, d, !0);
182
+ }), e(this, g).current && e(this, y) && history.pushState(history.state, "", e(this, k, se)), h(this, f, !0);
183
183
  const s = () => {
184
- E.stack.add(e(this, g).current, this), e(this, W).call(this), e(this, l).set("opened", !0), D(this, "popoverOpened", {
184
+ L.stack.add(e(this, m).current, this), e(this, W).call(this), e(this, l).set("opened", !0), j(this, "popoverOpened", {
185
185
  custom: !0,
186
186
  detail: {
187
- trigger: e(this, R)
187
+ trigger: e(this, x)
188
188
  }
189
- }), h(this, w, void 0), h(this, O, setTimeout(() => {
189
+ }), h(this, A, void 0), h(this, O, setTimeout(() => {
190
190
  e(this, l).set("transitionend", !0);
191
- }, _(this) + 10));
191
+ }, ee(this) + 10));
192
192
  };
193
- t != null && t.skipTransition ? s() : h(this, w, setTimeout(s, 10));
193
+ t != null && t.skipTransition ? s() : h(this, A, setTimeout(s, 10));
194
194
  }
195
195
  close() {
196
- e(this, d) && (clearTimeout(e(this, w)), clearTimeout(e(this, O)), E.stack.remove(e(this, g).current, this), h(this, d, !1), v(this, y, I).call(this), e(this, l).set("transitionend", !1), h(this, V, setTimeout(() => {
197
- e(this, l).set("opened", !1), e(this, l).set("closing", !0), D(this, "popoverClosing", {
196
+ e(this, f) && (clearTimeout(e(this, A)), clearTimeout(e(this, O)), L.stack.remove(e(this, m).current, this), h(this, f, !1), b(this, k, F).call(this), e(this, l).set("transitionend", !1), h(this, V, setTimeout(() => {
197
+ e(this, l).set("opened", !1), e(this, l).set("closing", !0), j(this, "popoverClosing", {
198
198
  custom: !0
199
199
  }), h(this, M, setTimeout(() => {
200
- e(this, l).set("triggered", !1), e(this, l).set("closing", !1), D(this, "popoverClosed", {
200
+ e(this, l).set("triggered", !1), e(this, l).set("closing", !1), j(this, "popoverClosed", {
201
201
  custom: !0
202
202
  });
203
- }, _(this) + 10));
203
+ }, ee(this) + 10));
204
204
  }, 10)));
205
205
  }
206
206
  connectedCallback() {
207
- e(this, f).observe(), e(this, L).observe(), e(this, A).observe(), e(this, P).observe(), e(this, g).observe(), e(this, S).observe(), e(this, C).observe(), this.setAttribute("role", "dialog"), addEventListener("popstate", e(this, x)), setTimeout(() => {
208
- e(this, L).current ? (this.urlValue = he(location.search)[this.id], e(this, x).call(this)) : (v(this, y, I).call(this), h(this, T, !0));
209
- }, 0), ee.subscribe(e(this, H));
207
+ e(this, g).observe(), e(this, T).observe(), e(this, P).observe(), e(this, S).observe(), e(this, m).observe(), e(this, C).observe(), e(this, R).observe(), this.setAttribute("role", "dialog"), addEventListener("popstate", e(this, $)), setTimeout(() => {
208
+ e(this, T).current ? (this.urlValue = he(location.search)[this.id], e(this, $).call(this)) : (b(this, k, F).call(this), h(this, y, !0));
209
+ }, 0), te.subscribe(e(this, H));
210
210
  }
211
211
  disconnectedCallback() {
212
- E.stack.remove(e(this, g).current, this), ee.unsubscribe(e(this, H)), e(this, l).close(), e(this, f).close(), e(this, L).close(), e(this, A).close(), e(this, P).close(), e(this, g).close(), e(this, S).close(), e(this, C).close(), this.removeAttribute("role"), clearTimeout(e(this, V)), clearTimeout(e(this, M)), clearTimeout(e(this, w)), clearTimeout(e(this, O)), removeEventListener("popstate", e(this, x)), this.style.removeProperty("--content-width"), this.style.removeProperty("--content-height"), v(this, y, I).call(this);
212
+ L.stack.remove(e(this, m).current, this), te.unsubscribe(e(this, H)), e(this, l).close(), e(this, g).close(), e(this, T).close(), e(this, P).close(), e(this, S).close(), e(this, m).close(), e(this, C).close(), e(this, R).close(), this.removeAttribute("role"), clearTimeout(e(this, V)), clearTimeout(e(this, M)), clearTimeout(e(this, A)), clearTimeout(e(this, O)), removeEventListener("popstate", e(this, $)), this.style.removeProperty("--content-width"), this.style.removeProperty("--content-height"), b(this, k, F).call(this);
213
213
  }
214
214
  };
215
- d = new WeakMap(), V = new WeakMap(), M = new WeakMap(), w = new WeakMap(), O = new WeakMap(), f = new WeakMap(), L = new WeakMap(), A = new WeakMap(), P = new WeakMap(), g = new WeakMap(), S = new WeakMap(), C = new WeakMap(), T = new WeakMap(), R = new WeakMap(), l = new WeakMap(), y = new WeakSet(), te = function() {
215
+ f = new WeakMap(), V = new WeakMap(), M = new WeakMap(), A = new WeakMap(), O = new WeakMap(), g = new WeakMap(), T = new WeakMap(), P = new WeakMap(), S = new WeakMap(), m = new WeakMap(), C = new WeakMap(), R = new WeakMap(), y = new WeakMap(), x = new WeakMap(), l = new WeakMap(), k = new WeakSet(), se = function() {
216
216
  return `${location.pathname}${location.search ? location.search + "&" : "?"}${this.idWithValue}`;
217
- }, I = function() {
218
- if (e(this, f).current) {
217
+ }, F = function() {
218
+ if (e(this, g).current) {
219
219
  const t = new URL(location.href);
220
220
  t.searchParams.delete(this.id), history.replaceState(history.state, "", t.href);
221
221
  }
222
- }, x = new WeakMap(), H = new WeakMap(), G = new WeakMap(), W = new WeakMap(), E.stack = new ne();
223
- let j = E;
224
- Y && !customElements.get("e-popover") && customElements.define("e-popover", j);
225
- var n, p, k, Q, z, q, B, U, X;
222
+ }, $ = new WeakMap(), H = new WeakMap(), q = new WeakMap(), W = new WeakMap(), L.stack = new ne();
223
+ let I = L;
224
+ Z && !customElements.get("e-popover") && customElements.define("e-popover", I);
225
+ var n, d, w, X, z, B, U, D, Y;
226
226
  class ce extends HTMLElement {
227
227
  constructor() {
228
228
  super();
229
- i(this, k);
229
+ i(this, w);
230
230
  i(this, n);
231
- i(this, p, new b(this, "--type", "open"));
231
+ i(this, d, new E(this, "--type", "open"));
232
232
  i(this, z, () => {
233
- e(this, p).current !== "close" && this.classList.add("triggered");
234
- });
235
- i(this, q, () => {
236
- e(this, p).current !== "close" && (this.classList.add("opened"), this.setAttribute("aria-expanded", "true"));
233
+ e(this, d).current !== "close" && this.classList.add("triggered");
237
234
  });
238
235
  i(this, B, () => {
239
- e(this, p).current !== "close" && this.classList.remove("opened");
236
+ e(this, d).current !== "close" && (this.classList.add("opened"), this.setAttribute("aria-expanded", "true"));
240
237
  });
241
238
  i(this, U, () => {
242
- e(this, p).current !== "close" && (this.classList.remove("triggered"), this.setAttribute("aria-expanded", "false"));
239
+ e(this, d).current !== "close" && this.classList.remove("opened");
240
+ });
241
+ i(this, D, () => {
242
+ e(this, d).current !== "close" && (this.classList.remove("triggered"), this.setAttribute("aria-expanded", "false"));
243
243
  });
244
- Y && (this.addEventListener("click", () => {
244
+ Z && (this.addEventListener("click", () => {
245
245
  if (e(this, n)) {
246
- const t = e(this, p).current;
246
+ const t = e(this, d).current;
247
247
  t === "open" || t === "toggle" && !e(this, n).opened ? e(this, n).open({ trigger: this }) : (t === "close" || t === "toggle" && e(this, n).opened) && e(this, n).close();
248
248
  }
249
249
  }), this.addEventListener("keydown", (t) => {
@@ -251,73 +251,84 @@ class ce extends HTMLElement {
251
251
  }));
252
252
  }
253
253
  get type() {
254
- return e(this, p);
254
+ return e(this, d);
255
255
  }
256
256
  get popoverElement() {
257
257
  return e(this, n);
258
258
  }
259
259
  changePopover(t) {
260
260
  var s;
261
- if (v(this, k, Q).call(this), t) {
261
+ if (b(this, w, X).call(this), t) {
262
262
  let o = null;
263
263
  if (t === "parent") {
264
264
  const a = this.closest("[data-popover]");
265
265
  if (a)
266
266
  o = a;
267
267
  else {
268
- const $ = this.getRootNode();
269
- $ instanceof ShadowRoot ? o = $.host.closest("[data-popover]") : $ instanceof HTMLElement && (o = $.closest("[data-popover]"));
268
+ const p = this.getRootNode();
269
+ p instanceof ShadowRoot ? o = p.host.closest("[data-popover]") : p instanceof HTMLElement && (o = p.closest("[data-popover]"));
270
270
  }
271
- } else t === "sibling" ? o = (s = this.parentElement) == null ? void 0 : s.querySelector("[data-popover]") : (!t.startsWith(".") && !t.startsWith("[") && (t = `#${t}`), o = document.querySelector(t) || this.getRootNode().querySelector(t));
271
+ } else if (t === "sibling")
272
+ o = (s = this.parentElement) == null ? void 0 : s.querySelector("[data-popover]");
273
+ else if (t === "ancestor-child") {
274
+ const a = (p) => {
275
+ if (!p)
276
+ return null;
277
+ let G = p.querySelector("[data-popover]");
278
+ return !G && (p != null && p.parentElement) && (G = a(p.parentElement)), G;
279
+ };
280
+ o = a(this.parentElement) || null;
281
+ } else
282
+ !t.startsWith(".") && !t.startsWith("[") && (t = `#${t}`), o = document.querySelector(t) || this.getRootNode().querySelector(t);
272
283
  o instanceof HTMLElement ? (h(this, n, o), e(this, n).addEventListener(
273
284
  "popoverTriggered",
274
285
  e(this, z)
275
286
  ), e(this, n).addEventListener(
276
287
  "popoverOpened",
277
- e(this, q)
288
+ e(this, B)
278
289
  ), e(this, n).addEventListener(
279
290
  "popoverClosing",
280
- e(this, B)
291
+ e(this, U)
281
292
  ), e(this, n).addEventListener(
282
293
  "popoverClosed",
283
- e(this, U)
294
+ e(this, D)
284
295
  )) : console.warn(this, `target ${t} not found`);
285
296
  }
286
- v(this, k, X).call(this, e(this, p).current);
297
+ b(this, w, Y).call(this, e(this, d).current);
287
298
  }
288
299
  connectedCallback() {
289
- e(this, p).subscribe((s) => {
290
- v(this, k, X).call(this, s.current);
300
+ e(this, d).subscribe((s) => {
301
+ b(this, w, Y).call(this, s.current);
291
302
  }), this.hasAttribute("tabindex") || (this.tabIndex = 0);
292
303
  const t = this.getAttribute("target");
293
- t && this.changePopover(t), this.isConnected && e(this, p).observe();
304
+ t && this.changePopover(t), this.isConnected && e(this, d).observe();
294
305
  }
295
306
  disconnectedCallback() {
296
- e(this, p).unobserve(), this.removeAttribute("aria-haspopup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls"), v(this, k, Q).call(this);
307
+ e(this, d).unobserve(), this.removeAttribute("aria-haspopup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls"), b(this, w, X).call(this);
297
308
  }
298
309
  }
299
- n = new WeakMap(), p = new WeakMap(), k = new WeakSet(), Q = function() {
310
+ n = new WeakMap(), d = new WeakMap(), w = new WeakSet(), X = function() {
300
311
  e(this, n) && (e(this, n).removeEventListener(
301
312
  "popoverTriggered",
302
313
  e(this, z)
303
314
  ), e(this, n).removeEventListener(
304
315
  "popoverOpened",
305
- e(this, q)
316
+ e(this, B)
306
317
  ), e(this, n).removeEventListener(
307
318
  "popoverClosing",
308
- e(this, B)
319
+ e(this, U)
309
320
  ), e(this, n).removeEventListener(
310
321
  "popoverClosed",
311
- e(this, U)
322
+ e(this, D)
312
323
  ));
313
- }, z = new WeakMap(), q = new WeakMap(), B = new WeakMap(), U = new WeakMap(), X = function(t) {
314
- e(this, n) instanceof j && (t !== "close" ? (this.setAttribute("aria-haspopup", "true"), this.setAttribute(
324
+ }, z = new WeakMap(), B = new WeakMap(), U = new WeakMap(), D = new WeakMap(), Y = function(t) {
325
+ e(this, n) instanceof I && (t !== "close" ? (this.setAttribute("aria-haspopup", "true"), this.setAttribute(
315
326
  "aria-expanded",
316
327
  e(this, n).opened ? "true" : "false"
317
328
  ), this.setAttribute("aria-controls", e(this, n).id || "")) : (this.removeAttribute("aria-haspopup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls")));
318
329
  };
319
- Y && !customElements.get("e-popover-button") && customElements.define("e-popover-button", ce);
330
+ Z && !customElements.get("e-popover-button") && customElements.define("e-popover-button", ce);
320
331
  export {
321
332
  ce as PopoverButtonElement,
322
- j as PopoverElement
333
+ I as PopoverElement
323
334
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.57.3",
3
+ "version": "0.57.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"