aptechka 0.63.1 → 0.63.3

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 Q=i=>{throw TypeError(i)};var O=(i,r,e)=>r.has(i)||Q("Cannot "+e);var t=(i,r,e)=>(O(i,r,"read from private field"),e?e.call(i):r.get(i)),s=(i,r,e)=>r.has(i)?Q("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(i):r.set(i,e),d=(i,r,e,n)=>(O(i,r,"write to private field"),n?n.call(i,e):r.set(i,e),e),m=(i,r,e)=>(O(i,r,"access private method"),e);var J=(i,r,e)=>new Promise((n,h)=>{var a=y=>{try{G(e.next(y))}catch(N){h(N)}},k=y=>{try{G(e.throw(y))}catch(N){h(N)}},G=y=>y.done?n(y.value):Promise.resolve(y.value).then(a,k);G((e=e.apply(i,r)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("../index-Cqw2NKev.cjs"),K=require("../dom-JBOkFLTh.cjs"),M=require("../css-property/index.cjs"),W=require("../events-KVanG9sR.cjs"),X=require("../gestures-C7gbKx11.cjs"),Y=require("../math-GDWEqu7y.cjs"),Z=require("../number-DyefJ5a1.cjs");var P,S,f,E,L,x,o,l,u,$,T,_,B,j,F;class z extends HTMLElement{constructor(){super(...arguments);s(this,u);s(this,P,new M.CSSProperty(this,"--resize",!0));s(this,S,new M.CSSProperty(this,"--loop",!0));s(this,f,new M.CSSProperty(this,"--autoplay",!1));s(this,E,new M.CSSProperty(this,"--swipe","x"));s(this,L);s(this,x,!1);s(this,o,[]);s(this,l,0);s(this,T,e=>{d(this,x,e.isIntersecting),t(this,x)?m(this,u,$).call(this):clearInterval(t(this,L))});s(this,_,()=>{clearInterval(t(this,L)),t(this,x)&&d(this,L,setInterval(t(this,j),parseFloat(t(this,f).current||"0")*1e3))});s(this,j,()=>{m(this,u,B).call(this,t(this,l)+1)});s(this,F,e=>{if(!t(this,E).current)return;let n=0;X.setupDrag(h=>{const a=e.x-h.x,k=e.y-h.y;t(this,E).current==="x"?Math.abs(a)>Math.abs(k)&&Math.abs(a)>10&&(n=Math.sign(a)):t(this,E).current==="y"&&Math.abs(k)>Math.abs(a)&&Math.abs(k)>10&&(n=Math.sign(k))},()=>{n&&this.shift(n)})})}get counter(){return t(this,l)}get loop(){return t(this,S)}get autoplay(){return t(this,f)}get swipe(){return t(this,E)}get itemElements(){return t(this,o)}addItem(e){t(this,o).push(e),m(this,u,B).call(this)}set(e){(!this.handleSet||this.handleSet(e))&&(m(this,u,B).call(this,e),m(this,u,$).call(this))}shift(e){this.set(t(this,l)+e)}connectedCallback(){var e;d(this,o,[...this.querySelectorAll(`[data-billboard-item${this.id?`="${this.id}"`:""}]`)]),(e=t(this,o)[0])==null||e.classList.add("current"),t(this,f).subscribe(n=>{n.current?(I.intersector.subscribe(this,t(this,T)),m(this,u,$).call(this)):(d(this,x,!0),I.intersector.unsubscribe(t(this,T)),clearInterval(t(this,L)),m(this,u,B).call(this,0))}),t(this,f).observe(),t(this,E).observe(),t(this,S).observe(),t(this,P).observe(),m(this,u,B).call(this,0),this.addEventListener("pointerdown",t(this,F))}disconnectedCallback(){t(this,f).unobserve(),t(this,E).unobserve(),t(this,S).unobserve(),t(this,P).unobserve(),I.intersector.unsubscribe(t(this,T)),clearInterval(t(this,L))}}P=new WeakMap,S=new WeakMap,f=new WeakMap,E=new WeakMap,L=new WeakMap,x=new WeakMap,o=new WeakMap,l=new WeakMap,u=new WeakSet,$=function(){t(this,f).current!==!1&&t(this,_).call(this)},T=new WeakMap,_=new WeakMap,B=function(e=t(this,l)){const n=t(this,l);t(this,S).current?d(this,l,Z.loopNumber(e,t(this,o).length)):d(this,l,Y.clamp(e,0,t(this,o).length-1)),this.classList.remove("forward","backward"),t(this,l)-n>=0?this.classList.add("forward"):t(this,l)-n<0&&this.classList.add("backward"),t(this,o).forEach((h,a)=>{h.classList.remove("current","previous","next"),a===t(this,l)?h.classList.add("current"):a<t(this,l)?h.classList.add("previous"):a>t(this,l)&&h.classList.add("next")}),this.classList.toggle("has-length",t(this,o).length>1),this.classList.toggle("start",t(this,l)===0),this.classList.toggle("end",t(this,l)===t(this,o).length-1),this.style.setProperty("--counter",t(this,l).toString()),this.style.setProperty("--sections",t(this,o).length.toString()),t(this,l)!==n&&(W.dispatchEvent(this,"billboardChange",{detail:{counter:t(this,l)}}),t(this,P).current&&setTimeout(()=>{window.dispatchEvent(new Event("resize"))},0))},j=new WeakMap,F=new WeakMap;customElements.get("e-billboard")||customElements.define("e-billboard",z);var b,q,p,D,A;class R extends HTMLElement{constructor(){super(...arguments);s(this,b,null);s(this,q,null);s(this,p,[]);s(this,D,e=>{const n=e.currentTarget,h=t(this,p).findIndex(a=>a===n);h>=0&&t(this,b).set(h)});s(this,A,()=>{t(this,p).forEach((e,n)=>{n===t(this,b).counter?e.classList.add("current"):e.classList.remove("current")})})}connectedCallback(){return J(this,null,function*(){var e;if(d(this,b,K.findParentElement(this,z)),t(this,b)&&(yield customElements.whenDefined("e-billboard"),this.isConnected)){this.innerHTML="";const n=t(this,b).itemElements.length;d(this,q,document.createElement("div"));for(let h=0;h<n;h++){const a=document.createElement("button");a.setAttribute("aria-label",`Go to item ${h+1}`),t(this,p).push(a),t(this,q).appendChild(a)}this.appendChild(t(this,q)),t(this,p).forEach(h=>{h.addEventListener("click",t(this,D))}),(e=t(this,b))==null||e.addEventListener("billboardChange",t(this,A)),t(this,A).call(this)}})}disconnectedCallback(){var e;t(this,p).forEach(n=>{n.removeEventListener("click",t(this,D))}),(e=t(this,b))==null||e.removeEventListener("billboardChange",t(this,A)),this.innerHTML="",d(this,p,[])}}b=new WeakMap,q=new WeakMap,p=new WeakMap,D=new WeakMap,A=new WeakMap;I.isBrowser&&!customElements.get("e-billboard-bullets")&&customElements.define("e-billboard-bullets",R);var v,g,C;class U extends HTMLElement{constructor(){super();s(this,v,new M.CSSProperty(this,"--index",0));s(this,g,null);s(this,C,()=>{var e;t(this,v).current===((e=t(this,g))==null?void 0:e.counter)?this.classList.add("current"):this.classList.remove("current")});this.addEventListener("click",e=>{t(this,g)&&(!this.handleClick||this.handleClick(e))&&t(this,g).set(t(this,v).current)})}connectedCallback(){var e;this.tabIndex=0,d(this,g,K.findParentElement(this,z)),(e=t(this,g))==null||e.addEventListener("billboardChange",t(this,C)),customElements.whenDefined("e-billboard").then(()=>{this.isConnected&&t(this,C).call(this)}),t(this,v).subscribe(t(this,C)),t(this,v).observe()}disconnectedCallback(){var e;this.removeAttribute("tabindex"),t(this,v).unsubscribe(t(this,C)),t(this,v).unobserve(),(e=t(this,g))==null||e.removeEventListener("billboardChange",t(this,C))}}v=new WeakMap,g=new WeakMap,C=new WeakMap;I.isBrowser&&!customElements.get("e-billboard-set-button")&&customElements.define("e-billboard-set-button",U);var w,c,H;class V extends HTMLElement{constructor(){super();s(this,w,new M.CSSProperty(this,"--step",1));s(this,c,null);s(this,H,()=>{t(this,c)&&(!t(this,c).loop.current&&(t(this,c).counter===0&&t(this,w).current<=0||t(this,c).counter===t(this,c).itemElements.length-1&&t(this,w).current>=0)?this.setAttribute("disabled",""):this.removeAttribute("disabled"))});this.addEventListener("click",e=>{t(this,c)&&(!this.handleClick||this.handleClick(e))&&t(this,c).shift(t(this,w).current)})}connectedCallback(){return J(this,null,function*(){var e;yield customElements.whenDefined("e-billboard"),t(this,w).observe(),this.tabIndex=0,d(this,c,K.findParentElement(this,z)),(e=t(this,c))==null||e.addEventListener("billboardChange",t(this,H)),setTimeout(()=>{t(this,H).call(this)},0)})}disconnectedCallback(){var e;this.removeAttribute("tabindex"),t(this,w).unobserve(),(e=t(this,c))==null||e.removeEventListener("billboardChange",t(this,H))}}w=new WeakMap,c=new WeakMap,H=new WeakMap;I.isBrowser&&!customElements.get("e-billboard-step-button")&&customElements.define("e-billboard-step-button",V);exports.BillboardBulletsElement=R;exports.BillboardElement=z;exports.BillboardSetButtonElement=U;exports.BillboardStepButtonElement=V;
1
+ "use strict";var Q=i=>{throw TypeError(i)};var O=(i,r,e)=>r.has(i)||Q("Cannot "+e);var t=(i,r,e)=>(O(i,r,"read from private field"),e?e.call(i):r.get(i)),s=(i,r,e)=>r.has(i)?Q("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(i):r.set(i,e),d=(i,r,e,n)=>(O(i,r,"write to private field"),n?n.call(i,e):r.set(i,e),e),m=(i,r,e)=>(O(i,r,"access private method"),e);var J=(i,r,e)=>new Promise((n,l)=>{var a=y=>{try{G(e.next(y))}catch(N){l(N)}},x=y=>{try{G(e.throw(y))}catch(N){l(N)}},G=y=>y.done?n(y.value):Promise.resolve(y.value).then(a,x);G((e=e.apply(i,r)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("../index-Cqw2NKev.cjs"),K=require("../dom-JBOkFLTh.cjs"),M=require("../css-property/index.cjs"),W=require("../events-KVanG9sR.cjs"),X=require("../gestures-C7gbKx11.cjs"),Y=require("../math-GDWEqu7y.cjs"),Z=require("../number-DyefJ5a1.cjs");var P,k,f,E,L,S,o,h,u,$,A,_,B,j,F;class z extends HTMLElement{constructor(){super(...arguments);s(this,u);s(this,P,new M.CSSProperty(this,"--resize",!0));s(this,k,new M.CSSProperty(this,"--loop",!0));s(this,f,new M.CSSProperty(this,"--autoplay",!1));s(this,E,new M.CSSProperty(this,"--swipe","x"));s(this,L);s(this,S,!1);s(this,o,[]);s(this,h,0);s(this,A,e=>{d(this,S,e.isIntersecting),t(this,S)?m(this,u,$).call(this):clearInterval(t(this,L))});s(this,_,()=>{clearInterval(t(this,L)),t(this,S)&&d(this,L,setInterval(t(this,j),parseFloat(t(this,f).current||"0")*1e3))});s(this,j,()=>{m(this,u,B).call(this,t(this,h)+1)});s(this,F,e=>{if(!t(this,E).current)return;let n=0;X.setupDrag(l=>{const a=e.x-l.x,x=e.y-l.y;t(this,E).current==="x"?Math.abs(a)>Math.abs(x)&&Math.abs(a)>10&&(n=Math.sign(a)):t(this,E).current==="y"&&Math.abs(x)>Math.abs(a)&&Math.abs(x)>10&&(n=Math.sign(x))},()=>{n&&this.shift(n)})})}get counter(){return t(this,h)}get loop(){return t(this,k)}get autoplay(){return t(this,f)}get swipe(){return t(this,E)}get itemElements(){return t(this,o)}addItem(e){t(this,o).push(e),m(this,u,B).call(this)}set(e){(!this.handleSet||this.handleSet(e))&&(m(this,u,B).call(this,e),m(this,u,$).call(this))}shift(e){this.set(t(this,h)+e)}connectedCallback(){var e;d(this,o,[...this.querySelectorAll(`[data-billboard-item${this.id?`="${this.id}"`:""}]`)]),(e=t(this,o)[0])==null||e.classList.add("current"),t(this,f).subscribe(n=>{n.current?(I.intersector.subscribe(this,t(this,A)),m(this,u,$).call(this)):(d(this,S,!0),I.intersector.unsubscribe(t(this,A)),clearInterval(t(this,L)),m(this,u,B).call(this,0))}),t(this,f).observe(),t(this,E).observe(),t(this,k).observe(),t(this,P).observe(),m(this,u,B).call(this,0),this.addEventListener("pointerdown",t(this,F))}disconnectedCallback(){t(this,f).unobserve(),t(this,E).unobserve(),t(this,k).unobserve(),t(this,P).unobserve(),I.intersector.unsubscribe(t(this,A)),clearInterval(t(this,L))}}P=new WeakMap,k=new WeakMap,f=new WeakMap,E=new WeakMap,L=new WeakMap,S=new WeakMap,o=new WeakMap,h=new WeakMap,u=new WeakSet,$=function(){t(this,f).current!==!1&&t(this,_).call(this)},A=new WeakMap,_=new WeakMap,B=function(e=t(this,h)){const n=t(this,h);t(this,k).current?d(this,h,Z.loopNumber(e,t(this,o).length)):d(this,h,Y.clamp(e,0,t(this,o).length-1)),this.classList.remove("forward","backward"),t(this,h)-n>=0?this.classList.add("forward"):t(this,h)-n<0&&this.classList.add("backward"),t(this,o).forEach((l,a)=>{l.classList.remove("current","previous","next"),a===t(this,h)?l.classList.add("current"):a<t(this,h)?l.classList.add("previous"):a>t(this,h)&&l.classList.add("next")}),this.classList.toggle("has-length",t(this,o).length>1),this.classList.toggle("start",t(this,h)===0),this.classList.toggle("end",t(this,h)===t(this,o).length-1),this.style.setProperty("--counter",t(this,h).toString()),this.style.setProperty("--sections",t(this,o).length.toString()),t(this,h)!==n&&(W.dispatchEvent(this,"billboardChange",{detail:{counter:t(this,h)}}),t(this,P).current&&setTimeout(()=>{window.dispatchEvent(new Event("resize"))},0))},j=new WeakMap,F=new WeakMap;customElements.get("e-billboard")||customElements.define("e-billboard",z);var b,T,p,H,q;class R extends HTMLElement{constructor(){super(...arguments);s(this,b,null);s(this,T,null);s(this,p,[]);s(this,H,e=>{const n=e.currentTarget,l=t(this,p).findIndex(a=>a===n);l>=0&&t(this,b).set(l)});s(this,q,()=>{t(this,p).forEach((e,n)=>{n===t(this,b).counter?e.classList.add("current"):e.classList.remove("current")})})}connectedCallback(){return J(this,null,function*(){var e;if(d(this,b,K.findParentElement(this,z)),t(this,b)&&(yield customElements.whenDefined("e-billboard"),this.isConnected)){this.innerHTML="";const n=t(this,b).itemElements.length;d(this,T,document.createElement("div"));for(let l=0;l<n;l++){const a=document.createElement("button");a.setAttribute("aria-label",`Go to item ${l+1}`),t(this,p).push(a),t(this,T).appendChild(a)}this.appendChild(t(this,T)),t(this,p).forEach(l=>{l.addEventListener("click",t(this,H))}),(e=t(this,b))==null||e.addEventListener("billboardChange",t(this,q)),t(this,q).call(this)}})}disconnectedCallback(){var e;t(this,p).forEach(n=>{n.removeEventListener("click",t(this,H))}),(e=t(this,b))==null||e.removeEventListener("billboardChange",t(this,q)),this.innerHTML="",d(this,p,[])}}b=new WeakMap,T=new WeakMap,p=new WeakMap,H=new WeakMap,q=new WeakMap;I.isBrowser&&!customElements.get("e-billboard-bullets")&&customElements.define("e-billboard-bullets",R);var v,g,w;class U extends HTMLElement{constructor(){super();s(this,v,new M.CSSProperty(this,"--index",0));s(this,g,null);s(this,w,()=>{var e;t(this,v).current===((e=t(this,g))==null?void 0:e.counter)?this.classList.add("current"):this.classList.remove("current")});this.addEventListener("click",e=>{t(this,g)&&(!this.handleClick||this.handleClick(e))&&t(this,g).set(t(this,v).current)}),this.addEventListener("keydown",e=>{e.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(e.preventDefault(),this.click())})}connectedCallback(){var e;this.tabIndex=0,d(this,g,K.findParentElement(this,z)),(e=t(this,g))==null||e.addEventListener("billboardChange",t(this,w)),customElements.whenDefined("e-billboard").then(()=>{this.isConnected&&t(this,w).call(this)}),t(this,v).subscribe(t(this,w)),t(this,v).observe()}disconnectedCallback(){var e;this.removeAttribute("tabindex"),t(this,v).unsubscribe(t(this,w)),t(this,v).unobserve(),(e=t(this,g))==null||e.removeEventListener("billboardChange",t(this,w))}}v=new WeakMap,g=new WeakMap,w=new WeakMap;I.isBrowser&&!customElements.get("e-billboard-set-button")&&customElements.define("e-billboard-set-button",U);var C,c,D;class V extends HTMLElement{constructor(){super();s(this,C,new M.CSSProperty(this,"--step",1));s(this,c,null);s(this,D,()=>{t(this,c)&&(!t(this,c).loop.current&&(t(this,c).counter===0&&t(this,C).current<=0||t(this,c).counter===t(this,c).itemElements.length-1&&t(this,C).current>=0)?this.setAttribute("disabled",""):this.removeAttribute("disabled"))});this.addEventListener("click",e=>{t(this,c)&&(!this.handleClick||this.handleClick(e))&&t(this,c).shift(t(this,C).current)}),this.addEventListener("keydown",e=>{e.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(e.preventDefault(),this.click())})}connectedCallback(){return J(this,null,function*(){var e;yield customElements.whenDefined("e-billboard"),t(this,C).observe(),this.tabIndex=0,d(this,c,K.findParentElement(this,z)),(e=t(this,c))==null||e.addEventListener("billboardChange",t(this,D)),setTimeout(()=>{t(this,D).call(this)},0)})}disconnectedCallback(){var e;this.removeAttribute("tabindex"),t(this,C).unobserve(),(e=t(this,c))==null||e.removeEventListener("billboardChange",t(this,D))}}C=new WeakMap,c=new WeakMap,D=new WeakMap;I.isBrowser&&!customElements.get("e-billboard-step-button")&&customElements.define("e-billboard-step-button",V);exports.BillboardBulletsElement=R;exports.BillboardElement=z;exports.BillboardSetButtonElement=U;exports.BillboardStepButtonElement=V;
@@ -4,19 +4,19 @@ var U = (i) => {
4
4
  var J = (i, r, e) => r.has(i) || U("Cannot " + e);
5
5
  var t = (i, r, e) => (J(i, r, "read from private field"), e ? e.call(i) : r.get(i)), s = (i, r, e) => r.has(i) ? U("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(i) : r.set(i, e), d = (i, r, e, n) => (J(i, r, "write to private field"), n ? n.call(i, e) : r.set(i, e), e), m = (i, r, e) => (J(i, r, "access private method"), e);
6
6
  var K = (i, r, e) => new Promise((n, l) => {
7
- var a = (x) => {
7
+ var a = (C) => {
8
8
  try {
9
- N(e.next(x));
9
+ N(e.next(C));
10
10
  } catch (j) {
11
11
  l(j);
12
12
  }
13
- }, M = (x) => {
13
+ }, M = (C) => {
14
14
  try {
15
- N(e.throw(x));
15
+ N(e.throw(C));
16
16
  } catch (j) {
17
17
  l(j);
18
18
  }
19
- }, N = (x) => x.done ? n(x.value) : Promise.resolve(x.value).then(a, M);
19
+ }, N = (C) => C.done ? n(C.value) : Promise.resolve(C.value).then(a, M);
20
20
  N((e = e.apply(i, r)).next());
21
21
  });
22
22
  import { a as O, i as Q } from "../index-euf5anj6.js";
@@ -26,20 +26,20 @@ import { d as V } from "../events-CsVF98U6.js";
26
26
  import { s as W } from "../gestures-CcXV6fCp.js";
27
27
  import { c as X } from "../math-BOBiC4TN.js";
28
28
  import { l as Y } from "../number-CbdpfO3u.js";
29
- var T, k, f, p, L, y, o, h, b, z, A, $, I, q, F;
29
+ var A, x, f, p, L, y, o, h, b, z, T, $, I, q, F;
30
30
  class G extends HTMLElement {
31
31
  constructor() {
32
32
  super(...arguments);
33
33
  s(this, b);
34
- s(this, T, new S(this, "--resize", !0));
35
- s(this, k, new S(this, "--loop", !0));
34
+ s(this, A, new S(this, "--resize", !0));
35
+ s(this, x, new S(this, "--loop", !0));
36
36
  s(this, f, new S(this, "--autoplay", !1));
37
37
  s(this, p, new S(this, "--swipe", "x"));
38
38
  s(this, L);
39
39
  s(this, y, !1);
40
40
  s(this, o, []);
41
41
  s(this, h, 0);
42
- s(this, A, (e) => {
42
+ s(this, T, (e) => {
43
43
  d(this, y, e.isIntersecting), t(this, y) ? m(this, b, z).call(this) : clearInterval(t(this, L));
44
44
  });
45
45
  s(this, $, () => {
@@ -70,7 +70,7 @@ class G extends HTMLElement {
70
70
  return t(this, h);
71
71
  }
72
72
  get loop() {
73
- return t(this, k);
73
+ return t(this, x);
74
74
  }
75
75
  get autoplay() {
76
76
  return t(this, f);
@@ -97,18 +97,18 @@ class G extends HTMLElement {
97
97
  `[data-billboard-item${this.id ? `="${this.id}"` : ""}]`
98
98
  )
99
99
  ]), (e = t(this, o)[0]) == null || e.classList.add("current"), t(this, f).subscribe((n) => {
100
- n.current ? (O.subscribe(this, t(this, A)), m(this, b, z).call(this)) : (d(this, y, !0), O.unsubscribe(t(this, A)), clearInterval(t(this, L)), m(this, b, I).call(this, 0));
101
- }), t(this, f).observe(), t(this, p).observe(), t(this, k).observe(), t(this, T).observe(), m(this, b, I).call(this, 0), this.addEventListener("pointerdown", t(this, F));
100
+ n.current ? (O.subscribe(this, t(this, T)), m(this, b, z).call(this)) : (d(this, y, !0), O.unsubscribe(t(this, T)), clearInterval(t(this, L)), m(this, b, I).call(this, 0));
101
+ }), t(this, f).observe(), t(this, p).observe(), t(this, x).observe(), t(this, A).observe(), m(this, b, I).call(this, 0), this.addEventListener("pointerdown", t(this, F));
102
102
  }
103
103
  disconnectedCallback() {
104
- t(this, f).unobserve(), t(this, p).unobserve(), t(this, k).unobserve(), t(this, T).unobserve(), O.unsubscribe(t(this, A)), clearInterval(t(this, L));
104
+ t(this, f).unobserve(), t(this, p).unobserve(), t(this, x).unobserve(), t(this, A).unobserve(), O.unsubscribe(t(this, T)), clearInterval(t(this, L));
105
105
  }
106
106
  }
107
- T = new WeakMap(), k = new WeakMap(), f = new WeakMap(), p = new WeakMap(), L = new WeakMap(), y = new WeakMap(), o = new WeakMap(), h = new WeakMap(), b = new WeakSet(), z = function() {
107
+ A = new WeakMap(), x = new WeakMap(), f = new WeakMap(), p = new WeakMap(), L = new WeakMap(), y = new WeakMap(), o = new WeakMap(), h = new WeakMap(), b = new WeakSet(), z = function() {
108
108
  t(this, f).current !== !1 && t(this, $).call(this);
109
- }, A = new WeakMap(), $ = new WeakMap(), I = function(e = t(this, h)) {
109
+ }, T = new WeakMap(), $ = new WeakMap(), I = function(e = t(this, h)) {
110
110
  const n = t(this, h);
111
- t(this, k).current ? d(this, h, Y(e, t(this, o).length)) : d(this, h, X(e, 0, t(this, o).length - 1)), this.classList.remove("forward", "backward"), t(this, h) - n >= 0 ? this.classList.add("forward") : t(this, h) - n < 0 && this.classList.add("backward"), t(this, o).forEach((l, a) => {
111
+ t(this, x).current ? d(this, h, Y(e, t(this, o).length)) : d(this, h, X(e, 0, t(this, o).length - 1)), this.classList.remove("forward", "backward"), t(this, h) - n >= 0 ? this.classList.add("forward") : t(this, h) - n < 0 && this.classList.add("backward"), t(this, o).forEach((l, a) => {
112
112
  l.classList.remove("current", "previous", "next"), a === t(this, h) ? l.classList.add("current") : a < t(this, h) ? l.classList.add("previous") : a > t(this, h) && l.classList.add("next");
113
113
  }), this.classList.toggle("has-length", t(this, o).length > 1), this.classList.toggle("start", t(this, h) === 0), this.classList.toggle(
114
114
  "end",
@@ -117,24 +117,24 @@ T = new WeakMap(), k = new WeakMap(), f = new WeakMap(), p = new WeakMap(), L =
117
117
  detail: {
118
118
  counter: t(this, h)
119
119
  }
120
- }), t(this, T).current && setTimeout(() => {
120
+ }), t(this, A).current && setTimeout(() => {
121
121
  window.dispatchEvent(new Event("resize"));
122
122
  }, 0));
123
123
  }, q = new WeakMap(), F = new WeakMap();
124
124
  customElements.get("e-billboard") || customElements.define("e-billboard", G);
125
- var u, B, E, P, H;
125
+ var u, B, v, P, D;
126
126
  class Z extends HTMLElement {
127
127
  constructor() {
128
128
  super(...arguments);
129
129
  s(this, u, null);
130
130
  s(this, B, null);
131
- s(this, E, []);
131
+ s(this, v, []);
132
132
  s(this, P, (e) => {
133
- const n = e.currentTarget, l = t(this, E).findIndex((a) => a === n);
133
+ const n = e.currentTarget, l = t(this, v).findIndex((a) => a === n);
134
134
  l >= 0 && t(this, u).set(l);
135
135
  });
136
- s(this, H, () => {
137
- t(this, E).forEach((e, n) => {
136
+ s(this, D, () => {
137
+ t(this, v).forEach((e, n) => {
138
138
  n === t(this, u).counter ? e.classList.add("current") : e.classList.remove("current");
139
139
  });
140
140
  });
@@ -148,95 +148,99 @@ class Z extends HTMLElement {
148
148
  d(this, B, document.createElement("div"));
149
149
  for (let l = 0; l < n; l++) {
150
150
  const a = document.createElement("button");
151
- a.setAttribute("aria-label", `Go to item ${l + 1}`), t(this, E).push(a), t(this, B).appendChild(a);
151
+ a.setAttribute("aria-label", `Go to item ${l + 1}`), t(this, v).push(a), t(this, B).appendChild(a);
152
152
  }
153
- this.appendChild(t(this, B)), t(this, E).forEach((l) => {
153
+ this.appendChild(t(this, B)), t(this, v).forEach((l) => {
154
154
  l.addEventListener("click", t(this, P));
155
155
  }), (e = t(this, u)) == null || e.addEventListener(
156
156
  "billboardChange",
157
- t(this, H)
158
- ), t(this, H).call(this);
157
+ t(this, D)
158
+ ), t(this, D).call(this);
159
159
  }
160
160
  });
161
161
  }
162
162
  disconnectedCallback() {
163
163
  var e;
164
- t(this, E).forEach((n) => {
164
+ t(this, v).forEach((n) => {
165
165
  n.removeEventListener("click", t(this, P));
166
166
  }), (e = t(this, u)) == null || e.removeEventListener(
167
167
  "billboardChange",
168
- t(this, H)
169
- ), this.innerHTML = "", d(this, E, []);
168
+ t(this, D)
169
+ ), this.innerHTML = "", d(this, v, []);
170
170
  }
171
171
  }
172
- u = new WeakMap(), B = new WeakMap(), E = new WeakMap(), P = new WeakMap(), H = new WeakMap();
172
+ u = new WeakMap(), B = new WeakMap(), v = new WeakMap(), P = new WeakMap(), D = new WeakMap();
173
173
  Q && !customElements.get("e-billboard-bullets") && customElements.define("e-billboard-bullets", Z);
174
- var v, g, C;
174
+ var E, g, w;
175
175
  class _ extends HTMLElement {
176
176
  constructor() {
177
177
  super();
178
- s(this, v, new S(this, "--index", 0));
178
+ s(this, E, new S(this, "--index", 0));
179
179
  s(this, g, null);
180
- s(this, C, () => {
180
+ s(this, w, () => {
181
181
  var e;
182
- t(this, v).current === ((e = t(this, g)) == null ? void 0 : e.counter) ? this.classList.add("current") : this.classList.remove("current");
182
+ t(this, E).current === ((e = t(this, g)) == null ? void 0 : e.counter) ? this.classList.add("current") : this.classList.remove("current");
183
183
  });
184
184
  this.addEventListener("click", (e) => {
185
- t(this, g) && (!this.handleClick || this.handleClick(e)) && t(this, g).set(t(this, v).current);
185
+ t(this, g) && (!this.handleClick || this.handleClick(e)) && t(this, g).set(t(this, E).current);
186
+ }), this.addEventListener("keydown", (e) => {
187
+ e.code === "Space" && !this.hasAttribute("keydown-disabled") && (e.preventDefault(), this.click());
186
188
  });
187
189
  }
188
190
  connectedCallback() {
189
191
  var e;
190
192
  this.tabIndex = 0, d(this, g, R(this, G)), (e = t(this, g)) == null || e.addEventListener(
191
193
  "billboardChange",
192
- t(this, C)
194
+ t(this, w)
193
195
  ), customElements.whenDefined("e-billboard").then(() => {
194
- this.isConnected && t(this, C).call(this);
195
- }), t(this, v).subscribe(t(this, C)), t(this, v).observe();
196
+ this.isConnected && t(this, w).call(this);
197
+ }), t(this, E).subscribe(t(this, w)), t(this, E).observe();
196
198
  }
197
199
  disconnectedCallback() {
198
200
  var e;
199
- this.removeAttribute("tabindex"), t(this, v).unsubscribe(t(this, C)), t(this, v).unobserve(), (e = t(this, g)) == null || e.removeEventListener(
201
+ this.removeAttribute("tabindex"), t(this, E).unsubscribe(t(this, w)), t(this, E).unobserve(), (e = t(this, g)) == null || e.removeEventListener(
200
202
  "billboardChange",
201
- t(this, C)
203
+ t(this, w)
202
204
  );
203
205
  }
204
206
  }
205
- v = new WeakMap(), g = new WeakMap(), C = new WeakMap();
207
+ E = new WeakMap(), g = new WeakMap(), w = new WeakMap();
206
208
  Q && !customElements.get("e-billboard-set-button") && customElements.define("e-billboard-set-button", _);
207
- var w, c, D;
209
+ var k, c, H;
208
210
  class tt extends HTMLElement {
209
211
  constructor() {
210
212
  super();
211
- s(this, w, new S(this, "--step", 1));
213
+ s(this, k, new S(this, "--step", 1));
212
214
  s(this, c, null);
213
- s(this, D, () => {
214
- t(this, c) && (!t(this, c).loop.current && (t(this, c).counter === 0 && t(this, w).current <= 0 || t(this, c).counter === t(this, c).itemElements.length - 1 && t(this, w).current >= 0) ? this.setAttribute("disabled", "") : this.removeAttribute("disabled"));
215
+ s(this, H, () => {
216
+ t(this, c) && (!t(this, c).loop.current && (t(this, c).counter === 0 && t(this, k).current <= 0 || t(this, c).counter === t(this, c).itemElements.length - 1 && t(this, k).current >= 0) ? this.setAttribute("disabled", "") : this.removeAttribute("disabled"));
215
217
  });
216
218
  this.addEventListener("click", (e) => {
217
- t(this, c) && (!this.handleClick || this.handleClick(e)) && t(this, c).shift(t(this, w).current);
219
+ t(this, c) && (!this.handleClick || this.handleClick(e)) && t(this, c).shift(t(this, k).current);
220
+ }), this.addEventListener("keydown", (e) => {
221
+ e.code === "Space" && !this.hasAttribute("keydown-disabled") && (e.preventDefault(), this.click());
218
222
  });
219
223
  }
220
224
  connectedCallback() {
221
225
  return K(this, null, function* () {
222
226
  var e;
223
- yield customElements.whenDefined("e-billboard"), t(this, w).observe(), this.tabIndex = 0, d(this, c, R(this, G)), (e = t(this, c)) == null || e.addEventListener(
227
+ yield customElements.whenDefined("e-billboard"), t(this, k).observe(), this.tabIndex = 0, d(this, c, R(this, G)), (e = t(this, c)) == null || e.addEventListener(
224
228
  "billboardChange",
225
- t(this, D)
229
+ t(this, H)
226
230
  ), setTimeout(() => {
227
- t(this, D).call(this);
231
+ t(this, H).call(this);
228
232
  }, 0);
229
233
  });
230
234
  }
231
235
  disconnectedCallback() {
232
236
  var e;
233
- this.removeAttribute("tabindex"), t(this, w).unobserve(), (e = t(this, c)) == null || e.removeEventListener(
237
+ this.removeAttribute("tabindex"), t(this, k).unobserve(), (e = t(this, c)) == null || e.removeEventListener(
234
238
  "billboardChange",
235
- t(this, D)
239
+ t(this, H)
236
240
  );
237
241
  }
238
242
  }
239
- w = new WeakMap(), c = new WeakMap(), D = new WeakMap();
243
+ k = new WeakMap(), c = new WeakMap(), H = new WeakMap();
240
244
  Q && !customElements.get("e-billboard-step-button") && customElements.define("e-billboard-step-button", tt);
241
245
  export {
242
246
  Z as BillboardBulletsElement,
@@ -1 +1 @@
1
- "use strict";var J=Object.defineProperty;var B=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var j=i=>{throw TypeError(i)};var H=(i,s,t)=>s in i?J(i,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[s]=t,O=(i,s)=>{for(var t in s||(s={}))K.call(s,t)&&H(i,t,s[t]);if(B)for(var t of B(s))N.call(s,t)&&H(i,t,s[t]);return i};var R=(i,s,t)=>s.has(i)||j("Cannot "+t);var e=(i,s,t)=>(R(i,s,"read from private field"),t?t.call(i):s.get(i)),r=(i,s,t)=>s.has(i)?j("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(i):s.set(i,t),c=(i,s,t,u)=>(R(i,s,"write to private field"),u?u.call(i,t):s.set(i,t),t),D=(i,s,t)=>(R(i,s,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-GokLe_g-.cjs");const _=require("../coordinates-D8Np3cPD.cjs"),Q=require("../dom-JBOkFLTh.cjs"),W=require("../math-GDWEqu7y.cjs"),U=require("../index-Cqw2NKev.cjs");require("../ticker/index.cjs");const M=require("../Damped-B8bmTxAr.cjs"),A=require("../element-resizer/index.cjs"),F=require("../window-resizer/index.cjs"),S=require("../css-property/index.cjs");var o,a,l,d,m,p,b,x,k,f,w,C,y,q,T;class G{constructor(s){r(this,q);r(this,o);r(this,a);r(this,l);r(this,d);r(this,m);r(this,p);r(this,b,0);r(this,x,0);r(this,k,!1);r(this,f,s=>{const t=D(this,q,T).call(this,s);e(this,a).set(t.x,{equalize:!0}),e(this,l).set(t.y,{equalize:!0}),e(this,d).set(1)});r(this,w,s=>{e(this,d).set(0)});r(this,C,s=>{const t=D(this,q,T).call(this,s);e(this,a).set(t.x),e(this,l).set(t.y)});r(this,y,()=>{c(this,b,this.element.clientWidth),c(this,x,this.element.clientHeight);let s=0,t=0,u=0,h=0;e(this,m)?e(this,p)?(s=-1,t=1,u=-1,h=1):(s=e(this,b)/2*-1,t=e(this,b)/2*1,u=e(this,x)/2*-1,h=e(this,x)/2*1):e(this,p)?(s=0,t=1,u=0,h=1):(s=0,t=e(this,b),u=0,h=e(this,x)),e(this,a).min=s,e(this,a).max=t,e(this,l).min=u,e(this,l).max=h});c(this,o,Q.getElement(s.element)),c(this,a,new M.Damped(0,s.damped)),c(this,l,new M.Damped(0,s.damped)),c(this,d,new M.Damped(0,O({min:0,max:1},s.damped))),c(this,m,s.cartesian||!1),c(this,p,s.normalize||!1)}get element(){return e(this,o)}get x(){return e(this,a)}get y(){return e(this,l)}get z(){return e(this,d)}get cartesian(){return e(this,m)}set cartesian(s){c(this,m,s),e(this,y).call(this)}get normalize(){return e(this,p)}set normalize(s){c(this,p,s),e(this,y).call(this)}connect(){e(this,o).addEventListener("pointerenter",e(this,f)),e(this,o).addEventListener("pointerleave",e(this,w)),e(this,o).addEventListener("pointermove",e(this,C)),A.elementResizer.subscribe(e(this,o),e(this,y)),F.windowResizer.subscribe(e(this,y))}disconnect(){e(this,o).removeEventListener("pointerenter",e(this,f)),e(this,o).removeEventListener("pointerleave",e(this,w)),e(this,o).removeEventListener("pointermove",e(this,C)),A.elementResizer.unsubscribe(e(this,y)),F.windowResizer.unsubscribe(e(this,y)),e(this,a).reset(),e(this,l).reset(),e(this,d).reset()}}o=new WeakMap,a=new WeakMap,l=new WeakMap,d=new WeakMap,m=new WeakMap,p=new WeakMap,b=new WeakMap,x=new WeakMap,k=new WeakMap,f=new WeakMap,w=new WeakMap,C=new WeakMap,y=new WeakMap,q=new WeakSet,T=function(s){const t=_.getPointerPosition(s,e(this,o).getBoundingClientRect()),u={width:e(this,b),height:e(this,x)},h={x:t.x,y:t.y};if(e(this,m)){const z=_.screenToCartesian(h,u);h.x=z.x,h.y=z.y}if(e(this,p)){const z=_.normalize(h,u);e(this,m)?(h.x=W.clamp(z.x*2,-1,1),h.y=W.clamp(z.y*2,-1,1)):(h.x=z.x,h.y=z.y)}return h};var n,g,v,P,E,L;class I extends HTMLElement{constructor(){super();r(this,n);r(this,g,new S.CSSProperty(this,"--damping",20));r(this,v,new S.CSSProperty(this,"--mass",0));r(this,P,new S.CSSProperty(this,"--stiffness",0));r(this,E,new S.CSSProperty(this,"--cartesian",!1));r(this,L,new S.CSSProperty(this,"--normalize",!1));c(this,n,new G({element:this})),e(this,g).subscribe(t=>{e(this,n).x.damping=t.current,e(this,n).y.damping=t.current,e(this,n).z.damping=t.current}),e(this,E).subscribe(t=>{e(this,n).cartesian=t.current}),e(this,L).subscribe(t=>{e(this,n).normalize=t.current}),e(this,v).subscribe(t=>{e(this,n).x.mass=t.current,e(this,n).y.mass=t.current,e(this,n).z.mass=t.current}),e(this,P).subscribe(t=>{e(this,n).x.stiffness=t.current,e(this,n).y.stiffness=t.current,e(this,n).z.stiffness=t.current}),e(this,n).x.subscribe(t=>{this.style.setProperty("--x",t.current.toString())}),e(this,n).y.subscribe(t=>{this.style.setProperty("--y",t.current.toString())}),e(this,n).z.subscribe(t=>{this.style.setProperty("--z",t.current.toString())})}get pointer(){return e(this,n)}connectedCallback(){e(this,n).connect(),e(this,g).observe(),e(this,v).observe(),e(this,P).observe()}disconnectedCallback(){e(this,n).disconnect(),e(this,g).unobserve(),e(this,v).unobserve(),e(this,P).unobserve(),this.style.removeProperty("--x"),this.style.removeProperty("--y"),this.style.removeProperty("--z")}}n=new WeakMap,g=new WeakMap,v=new WeakMap,P=new WeakMap,E=new WeakMap,L=new WeakMap;U.isBrowser&&!customElements.get("e-pointer")&&customElements.define("e-pointer",I);exports.Pointer=G;exports.PointerElement=I;
1
+ "use strict";var J=Object.defineProperty;var B=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var j=i=>{throw TypeError(i)};var H=(i,s,t)=>s in i?J(i,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[s]=t,O=(i,s)=>{for(var t in s||(s={}))K.call(s,t)&&H(i,t,s[t]);if(B)for(var t of B(s))N.call(s,t)&&H(i,t,s[t]);return i};var D=(i,s,t)=>s.has(i)||j("Cannot "+t);var e=(i,s,t)=>(D(i,s,"read from private field"),t?t.call(i):s.get(i)),r=(i,s,t)=>s.has(i)?j("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(i):s.set(i,t),o=(i,s,t,u)=>(D(i,s,"write to private field"),u?u.call(i,t):s.set(i,t),t),_=(i,s,t)=>(D(i,s,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-GokLe_g-.cjs");const M=require("../coordinates-D8Np3cPD.cjs"),Q=require("../dom-JBOkFLTh.cjs"),W=require("../math-GDWEqu7y.cjs"),U=require("../index-Cqw2NKev.cjs");require("../ticker/index.cjs");const T=require("../Damped-B8bmTxAr.cjs"),A=require("../element-resizer/index.cjs"),F=require("../window-resizer/index.cjs"),w=require("../css-property/index.cjs");var c,a,l,y,m,d,b,x,g,z,C,E,p,q,k;class G{constructor(s){r(this,q);r(this,c);r(this,a);r(this,l);r(this,y);r(this,m);r(this,d);r(this,b,0);r(this,x,0);r(this,g,!1);r(this,z,s=>{o(this,g,!0);const t=_(this,q,k).call(this,s);e(this,a).set(t.x,{equalize:!0}),e(this,l).set(t.y,{equalize:!0}),e(this,y).set(1)});r(this,C,s=>{o(this,g,!1),e(this,y).set(0)});r(this,E,s=>{e(this,g)||e(this,z).call(this,s);const t=_(this,q,k).call(this,s);e(this,a).set(t.x),e(this,l).set(t.y)});r(this,p,()=>{o(this,b,this.element.clientWidth),o(this,x,this.element.clientHeight);let s=0,t=0,u=0,h=0;e(this,m)?e(this,d)?(s=-1,t=1,u=-1,h=1):(s=e(this,b)/2*-1,t=e(this,b)/2*1,u=e(this,x)/2*-1,h=e(this,x)/2*1):e(this,d)?(s=0,t=1,u=0,h=1):(s=0,t=e(this,b),u=0,h=e(this,x)),e(this,a).min=s,e(this,a).max=t,e(this,l).min=u,e(this,l).max=h});o(this,c,Q.getElement(s.element)),o(this,a,new T.Damped(0,s.damped)),o(this,l,new T.Damped(0,s.damped)),o(this,y,new T.Damped(0,O({min:0,max:1},s.damped))),o(this,m,s.cartesian||!1),o(this,d,s.normalize||!1)}get element(){return e(this,c)}get x(){return e(this,a)}get y(){return e(this,l)}get z(){return e(this,y)}get cartesian(){return e(this,m)}set cartesian(s){o(this,m,s),e(this,p).call(this)}get normalize(){return e(this,d)}set normalize(s){o(this,d,s),e(this,p).call(this)}connect(){e(this,c).addEventListener("pointerenter",e(this,z)),e(this,c).addEventListener("pointerleave",e(this,C)),e(this,c).addEventListener("pointermove",e(this,E)),A.elementResizer.subscribe(e(this,c),e(this,p)),F.windowResizer.subscribe(e(this,p))}disconnect(){e(this,c).removeEventListener("pointerenter",e(this,z)),e(this,c).removeEventListener("pointerleave",e(this,C)),e(this,c).removeEventListener("pointermove",e(this,E)),A.elementResizer.unsubscribe(e(this,p)),F.windowResizer.unsubscribe(e(this,p)),e(this,a).reset(),e(this,l).reset(),e(this,y).reset()}}c=new WeakMap,a=new WeakMap,l=new WeakMap,y=new WeakMap,m=new WeakMap,d=new WeakMap,b=new WeakMap,x=new WeakMap,g=new WeakMap,z=new WeakMap,C=new WeakMap,E=new WeakMap,p=new WeakMap,q=new WeakSet,k=function(s){const t=M.getPointerPosition(s,e(this,c).getBoundingClientRect()),u={width:e(this,b),height:e(this,x)},h={x:t.x,y:t.y};if(e(this,m)){const f=M.screenToCartesian(h,u);h.x=f.x,h.y=f.y}if(e(this,d)){const f=M.normalize(h,u);e(this,m)?(h.x=W.clamp(f.x*2,-1,1),h.y=W.clamp(f.y*2,-1,1)):(h.x=f.x,h.y=f.y)}return h};var n,v,P,S,L,R;class I extends HTMLElement{constructor(){super();r(this,n);r(this,v,new w.CSSProperty(this,"--damping",20));r(this,P,new w.CSSProperty(this,"--mass",0));r(this,S,new w.CSSProperty(this,"--stiffness",0));r(this,L,new w.CSSProperty(this,"--cartesian",!1));r(this,R,new w.CSSProperty(this,"--normalize",!1));o(this,n,new G({element:this})),e(this,v).subscribe(t=>{e(this,n).x.damping=t.current,e(this,n).y.damping=t.current,e(this,n).z.damping=t.current}),e(this,L).subscribe(t=>{e(this,n).cartesian=t.current}),e(this,R).subscribe(t=>{e(this,n).normalize=t.current}),e(this,P).subscribe(t=>{e(this,n).x.mass=t.current,e(this,n).y.mass=t.current,e(this,n).z.mass=t.current}),e(this,S).subscribe(t=>{e(this,n).x.stiffness=t.current,e(this,n).y.stiffness=t.current,e(this,n).z.stiffness=t.current}),e(this,n).x.subscribe(t=>{this.style.setProperty("--x",t.current.toString())}),e(this,n).y.subscribe(t=>{this.style.setProperty("--y",t.current.toString())}),e(this,n).z.subscribe(t=>{this.style.setProperty("--z",t.current.toString())})}get pointer(){return e(this,n)}connectedCallback(){e(this,n).connect(),e(this,v).observe(),e(this,P).observe(),e(this,S).observe()}disconnectedCallback(){e(this,n).disconnect(),e(this,v).unobserve(),e(this,P).unobserve(),e(this,S).unobserve(),this.style.removeProperty("--x"),this.style.removeProperty("--y"),this.style.removeProperty("--z")}}n=new WeakMap,v=new WeakMap,P=new WeakMap,S=new WeakMap,L=new WeakMap,R=new WeakMap;U.isBrowser&&!customElements.get("e-pointer")&&customElements.define("e-pointer",I);exports.Pointer=G;exports.PointerElement=I;
@@ -12,51 +12,53 @@ var T = (i, s, e) => s in i ? I(i, s, { enumerable: !0, configurable: !0, writab
12
12
  K.call(s, e) && T(i, e, s[e]);
13
13
  return i;
14
14
  };
15
- var R = (i, s, e) => s.has(i) || W("Cannot " + e);
16
- var t = (i, s, e) => (R(i, s, "read from private field"), e ? e.call(i) : s.get(i)), r = (i, s, e) => s.has(i) ? W("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(i) : s.set(i, e), c = (i, s, e, m) => (R(i, s, "write to private field"), m ? m.call(i, e) : s.set(i, e), e), k = (i, s, e) => (R(i, s, "access private method"), e);
15
+ var q = (i, s, e) => s.has(i) || W("Cannot " + e);
16
+ var t = (i, s, e) => (q(i, s, "read from private field"), e ? e.call(i) : s.get(i)), r = (i, s, e) => s.has(i) ? W("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(i) : s.set(i, e), o = (i, s, e, m) => (q(i, s, "write to private field"), m ? m.call(i, e) : s.set(i, e), e), B = (i, s, e) => (q(i, s, "access private method"), e);
17
17
  import "../Store-swP_0ymB.js";
18
18
  import { g as N, s as O, n as Q } from "../coordinates-CgdGoSYs.js";
19
19
  import { g as U } from "../dom-CVWzyXPH.js";
20
20
  import { c as A } from "../math-BOBiC4TN.js";
21
21
  import { i as V } from "../index-euf5anj6.js";
22
22
  import "../ticker/index.js";
23
- import { D as B } from "../Damped-ByZFbNSt.js";
23
+ import { D } from "../Damped-ByZFbNSt.js";
24
24
  import { elementResizer as F } from "../element-resizer/index.js";
25
25
  import { windowResizer as G } from "../window-resizer/index.js";
26
- import { CSSProperty as P } from "../css-property/index.js";
27
- var o, a, l, b, u, p, d, f, H, S, w, E, y, L, D;
26
+ import { CSSProperty as w } from "../css-property/index.js";
27
+ var c, a, l, f, u, p, b, d, g, v, E, L, y, C, H;
28
28
  class X {
29
29
  constructor(s) {
30
- r(this, L);
31
- r(this, o);
30
+ r(this, C);
31
+ r(this, c);
32
32
  r(this, a);
33
33
  r(this, l);
34
- r(this, b);
34
+ r(this, f);
35
35
  r(this, u);
36
36
  r(this, p);
37
+ r(this, b, 0);
37
38
  r(this, d, 0);
38
- r(this, f, 0);
39
- r(this, H, !1);
40
- r(this, S, (s) => {
41
- const e = k(this, L, D).call(this, s);
42
- t(this, a).set(e.x, { equalize: !0 }), t(this, l).set(e.y, { equalize: !0 }), t(this, b).set(1);
43
- });
44
- r(this, w, (s) => {
45
- t(this, b).set(0);
39
+ r(this, g, !1);
40
+ r(this, v, (s) => {
41
+ o(this, g, !0);
42
+ const e = B(this, C, H).call(this, s);
43
+ t(this, a).set(e.x, { equalize: !0 }), t(this, l).set(e.y, { equalize: !0 }), t(this, f).set(1);
46
44
  });
47
45
  r(this, E, (s) => {
48
- const e = k(this, L, D).call(this, s);
46
+ o(this, g, !1), t(this, f).set(0);
47
+ });
48
+ r(this, L, (s) => {
49
+ t(this, g) || t(this, v).call(this, s);
50
+ const e = B(this, C, H).call(this, s);
49
51
  t(this, a).set(e.x), t(this, l).set(e.y);
50
52
  });
51
53
  r(this, y, () => {
52
- c(this, d, this.element.clientWidth), c(this, f, this.element.clientHeight);
54
+ o(this, b, this.element.clientWidth), o(this, d, this.element.clientHeight);
53
55
  let s = 0, e = 0, m = 0, h = 0;
54
- t(this, u) ? t(this, p) ? (s = -1, e = 1, m = -1, h = 1) : (s = t(this, d) / 2 * -1, e = t(this, d) / 2 * 1, m = t(this, f) / 2 * -1, h = t(this, f) / 2 * 1) : t(this, p) ? (s = 0, e = 1, m = 0, h = 1) : (s = 0, e = t(this, d), m = 0, h = t(this, f)), t(this, a).min = s, t(this, a).max = e, t(this, l).min = m, t(this, l).max = h;
56
+ t(this, u) ? t(this, p) ? (s = -1, e = 1, m = -1, h = 1) : (s = t(this, b) / 2 * -1, e = t(this, b) / 2 * 1, m = t(this, d) / 2 * -1, h = t(this, d) / 2 * 1) : t(this, p) ? (s = 0, e = 1, m = 0, h = 1) : (s = 0, e = t(this, b), m = 0, h = t(this, d)), t(this, a).min = s, t(this, a).max = e, t(this, l).min = m, t(this, l).max = h;
55
57
  });
56
- c(this, o, U(s.element)), c(this, a, new B(0, s.damped)), c(this, l, new B(0, s.damped)), c(this, b, new B(0, j({ min: 0, max: 1 }, s.damped))), c(this, u, s.cartesian || !1), c(this, p, s.normalize || !1);
58
+ o(this, c, U(s.element)), o(this, a, new D(0, s.damped)), o(this, l, new D(0, s.damped)), o(this, f, new D(0, j({ min: 0, max: 1 }, s.damped))), o(this, u, s.cartesian || !1), o(this, p, s.normalize || !1);
57
59
  }
58
60
  get element() {
59
- return t(this, o);
61
+ return t(this, c);
60
62
  }
61
63
  get x() {
62
64
  return t(this, a);
@@ -65,37 +67,37 @@ class X {
65
67
  return t(this, l);
66
68
  }
67
69
  get z() {
68
- return t(this, b);
70
+ return t(this, f);
69
71
  }
70
72
  get cartesian() {
71
73
  return t(this, u);
72
74
  }
73
75
  set cartesian(s) {
74
- c(this, u, s), t(this, y).call(this);
76
+ o(this, u, s), t(this, y).call(this);
75
77
  }
76
78
  get normalize() {
77
79
  return t(this, p);
78
80
  }
79
81
  set normalize(s) {
80
- c(this, p, s), t(this, y).call(this);
82
+ o(this, p, s), t(this, y).call(this);
81
83
  }
82
84
  connect() {
83
- t(this, o).addEventListener("pointerenter", t(this, S)), t(this, o).addEventListener("pointerleave", t(this, w)), t(this, o).addEventListener("pointermove", t(this, E)), F.subscribe(t(this, o), t(this, y)), G.subscribe(t(this, y));
85
+ t(this, c).addEventListener("pointerenter", t(this, v)), t(this, c).addEventListener("pointerleave", t(this, E)), t(this, c).addEventListener("pointermove", t(this, L)), F.subscribe(t(this, c), t(this, y)), G.subscribe(t(this, y));
84
86
  }
85
87
  disconnect() {
86
- t(this, o).removeEventListener(
88
+ t(this, c).removeEventListener(
87
89
  "pointerenter",
88
- t(this, S)
89
- ), t(this, o).removeEventListener(
90
+ t(this, v)
91
+ ), t(this, c).removeEventListener(
90
92
  "pointerleave",
91
- t(this, w)
92
- ), t(this, o).removeEventListener("pointermove", t(this, E)), F.unsubscribe(t(this, y)), G.unsubscribe(t(this, y)), t(this, a).reset(), t(this, l).reset(), t(this, b).reset();
93
+ t(this, E)
94
+ ), t(this, c).removeEventListener("pointermove", t(this, L)), F.unsubscribe(t(this, y)), G.unsubscribe(t(this, y)), t(this, a).reset(), t(this, l).reset(), t(this, f).reset();
93
95
  }
94
96
  }
95
- o = new WeakMap(), a = new WeakMap(), l = new WeakMap(), b = new WeakMap(), u = new WeakMap(), p = new WeakMap(), d = new WeakMap(), f = new WeakMap(), H = new WeakMap(), S = new WeakMap(), w = new WeakMap(), E = new WeakMap(), y = new WeakMap(), L = new WeakSet(), D = function(s) {
96
- const e = N(s, t(this, o).getBoundingClientRect()), m = {
97
- width: t(this, d),
98
- height: t(this, f)
97
+ c = new WeakMap(), a = new WeakMap(), l = new WeakMap(), f = new WeakMap(), u = new WeakMap(), p = new WeakMap(), b = new WeakMap(), d = new WeakMap(), g = new WeakMap(), v = new WeakMap(), E = new WeakMap(), L = new WeakMap(), y = new WeakMap(), C = new WeakSet(), H = function(s) {
98
+ const e = N(s, t(this, c).getBoundingClientRect()), m = {
99
+ width: t(this, b),
100
+ height: t(this, d)
99
101
  }, h = {
100
102
  x: e.x,
101
103
  y: e.y
@@ -110,27 +112,27 @@ o = new WeakMap(), a = new WeakMap(), l = new WeakMap(), b = new WeakMap(), u =
110
112
  }
111
113
  return h;
112
114
  };
113
- var n, g, v, z, C, q;
115
+ var n, z, P, S, R, k;
114
116
  class Y extends HTMLElement {
115
117
  constructor() {
116
118
  super();
117
119
  r(this, n);
118
- r(this, g, new P(this, "--damping", 20));
119
- r(this, v, new P(this, "--mass", 0));
120
- r(this, z, new P(this, "--stiffness", 0));
121
- r(this, C, new P(this, "--cartesian", !1));
122
- r(this, q, new P(this, "--normalize", !1));
123
- c(this, n, new X({
120
+ r(this, z, new w(this, "--damping", 20));
121
+ r(this, P, new w(this, "--mass", 0));
122
+ r(this, S, new w(this, "--stiffness", 0));
123
+ r(this, R, new w(this, "--cartesian", !1));
124
+ r(this, k, new w(this, "--normalize", !1));
125
+ o(this, n, new X({
124
126
  element: this
125
- })), t(this, g).subscribe((e) => {
127
+ })), t(this, z).subscribe((e) => {
126
128
  t(this, n).x.damping = e.current, t(this, n).y.damping = e.current, t(this, n).z.damping = e.current;
127
- }), t(this, C).subscribe((e) => {
129
+ }), t(this, R).subscribe((e) => {
128
130
  t(this, n).cartesian = e.current;
129
- }), t(this, q).subscribe((e) => {
131
+ }), t(this, k).subscribe((e) => {
130
132
  t(this, n).normalize = e.current;
131
- }), t(this, v).subscribe((e) => {
133
+ }), t(this, P).subscribe((e) => {
132
134
  t(this, n).x.mass = e.current, t(this, n).y.mass = e.current, t(this, n).z.mass = e.current;
133
- }), t(this, z).subscribe((e) => {
135
+ }), t(this, S).subscribe((e) => {
134
136
  t(this, n).x.stiffness = e.current, t(this, n).y.stiffness = e.current, t(this, n).z.stiffness = e.current;
135
137
  }), t(this, n).x.subscribe((e) => {
136
138
  this.style.setProperty("--x", e.current.toString());
@@ -144,13 +146,13 @@ class Y extends HTMLElement {
144
146
  return t(this, n);
145
147
  }
146
148
  connectedCallback() {
147
- t(this, n).connect(), t(this, g).observe(), t(this, v).observe(), t(this, z).observe();
149
+ t(this, n).connect(), t(this, z).observe(), t(this, P).observe(), t(this, S).observe();
148
150
  }
149
151
  disconnectedCallback() {
150
- t(this, n).disconnect(), t(this, g).unobserve(), t(this, v).unobserve(), t(this, z).unobserve(), this.style.removeProperty("--x"), this.style.removeProperty("--y"), this.style.removeProperty("--z");
152
+ t(this, n).disconnect(), t(this, z).unobserve(), t(this, P).unobserve(), t(this, S).unobserve(), this.style.removeProperty("--x"), this.style.removeProperty("--y"), this.style.removeProperty("--z");
151
153
  }
152
154
  }
153
- n = new WeakMap(), g = new WeakMap(), v = new WeakMap(), z = new WeakMap(), C = new WeakMap(), q = new WeakMap();
155
+ n = new WeakMap(), z = new WeakMap(), P = new WeakMap(), S = new WeakMap(), R = new WeakMap(), k = new WeakMap();
154
156
  V && !customElements.get("e-pointer") && customElements.define("e-pointer", Y);
155
157
  export {
156
158
  X as Pointer,
@@ -1 +1 @@
1
- "use strict";var te=c=>{throw TypeError(c)};var Q=(c,o,t)=>o.has(c)||te("Cannot "+t);var e=(c,o,t)=>(Q(c,o,"read from private field"),t?t.call(c):o.get(c)),r=(c,o,t)=>o.has(c)?te("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(c):o.set(c,t),n=(c,o,t,s)=>(Q(c,o,"write to private field"),s?s.call(c,t):o.set(c,t),t),b=(c,o,t)=>(Q(c,o,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const he=require("../element-linked-store/index.cjs"),m=require("../css-property/index.cjs"),N=require("../index-Cqw2NKev.cjs"),Y=require("../events-KVanG9sR.cjs"),ce=require("../function-MthRj-GJ.cjs"),se=require("../style-At6aDoqG.cjs"),ie=require("../url-lnBE_6yf.cjs"),re=require("../window-resizer/index.cjs"),F=require("../device/index.cjs");var u,y,J,K;class le{constructor(){r(this,u,new Map);r(this,y,[]);r(this,J,o=>{var s;const t=[...e(this,y)].reverse().find(i=>i.clickOutside.current);if(t){const i=o.composedPath();if(i.find(ee=>ee instanceof HTMLElement&&ee.hasAttribute("data-popover-content")))return;const l=i[0],p=l instanceof Node&&(t.contains(l)||((s=t.shadowRoot)==null?void 0:s.contains(l))),H=l instanceof HTMLElement&&l.hasAttribute("data-outside");(!p||H)&&t.close()}});r(this,K,o=>{if(o.code==="Escape"){const t=[...e(this,y)].reverse().find(s=>s.escape.current);t&&t.close()}});document.documentElement.addEventListener("click",e(this,J)),addEventListener("keydown",e(this,K))}get groups(){return e(this,u)}get stack(){return e(this,y)}add(o,t){if(t.closeRest.current)e(this,u).forEach(i=>{i.forEach(l=>{l.close()})});else if(t.closeRestInGroup.current){let i=e(this,u).get(o);i==null||i.forEach(l=>{l.close()})}let s=e(this,u).get(o);s!=null&&s.length||(s=[],e(this,u).set(o,s)),e(this,y).push(t),s.push(t)}remove(o,t){if(n(this,y,e(this,y).filter(s=>s!==t)),t.closeRest.current){let s=[];e(this,u).forEach(i=>{i.forEach(l=>s.push(l))}),e(this,u).clear(),s.forEach(i=>i.close())}else if(t.closeRestInGroup.current){const s=e(this,u).get(o);e(this,u).delete(o),s==null||s.forEach(i=>{i.close()})}else{let s=e(this,u).get(o);s&&(s=s.filter(i=>i!==t),e(this,u).set(o,s))}}}u=new WeakMap,y=new WeakMap,J=new WeakMap,K=new WeakMap;var f,M,V,C,B,v,w,x,A,g,R,q,L,T,O,a,P,oe,I,$,S,W,G;const E=class E extends HTMLElement{constructor(){super();r(this,P);r(this,f);r(this,M);r(this,V);r(this,C);r(this,B);r(this,v);r(this,w);r(this,x);r(this,A);r(this,g);r(this,R);r(this,q);r(this,L);r(this,T);r(this,O);r(this,a);r(this,$);r(this,S);r(this,W);r(this,G);this.urlValue="",n(this,f,!1),n(this,v,new m.CSSProperty(this,"--history",!1)),n(this,w,new m.CSSProperty(this,"--restore",!1)),n(this,x,new m.CSSProperty(this,"--close-rest",!1)),n(this,A,new m.CSSProperty(this,"--close-rest-in-group",!1)),n(this,g,new m.CSSProperty(this,"--group","")),n(this,R,new m.CSSProperty(this,"--click-outside",!1)),n(this,q,new m.CSSProperty(this,"--escape",!1)),n(this,L,new m.CSSProperty(this,"--check-viewport-bounds",!1)),n(this,T,!1),n(this,a,new he.ElementLinkedStore(this,{opened:!1,closing:!1,triggered:!1,transitionend:!1})),n(this,$,()=>{n(this,T,!1),e(this,f)&&e(this,v).current&&!location.search.includes(this.id)?this.close():!e(this,f)&&e(this,v).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),n(this,T,!0)}),n(this,S,()=>{this.style.setProperty("--content-width","initial"),this.style.setProperty("--content-height","initial"),this.style.setProperty("--viewport-offset-x","0px"),this.style.setProperty("--viewport-offset-y","0px"),e(this,W).call(this)}),n(this,W,ce.debounce(()=>{e(this,G).call(this)},10)),n(this,G,()=>{if(this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px"),e(this,L).current){const t=this.getBoundingClientRect();let s=0,i=0;t.right>F.viewport.width?s=F.viewport.width-t.right:t.left<0&&(s=t.left*-1),t.bottom>F.viewport.height?i=F.viewport.height-t.bottom:t.top<0&&(i=t.top*-1),this.style.setProperty("--viewport-offset-x",s+"px"),this.style.setProperty("--viewport-offset-y",i+"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),i=s==null?void 0:s.find(l=>l.opened);document.documentElement.classList.toggle(`${this.group.current}-opened`,!!i)}})}get history(){return e(this,v)}get restore(){return e(this,w)}get closeRest(){return e(this,x)}get closeRestInGroup(){return e(this,A)}get group(){return e(this,g)}get clickOutside(){return e(this,R)}get escape(){return e(this,q)}get opened(){return e(this,f)}get lastTrigger(){return e(this,O)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,f)&&ie.updateSearchParameter(this.id,t)}open(t){if(e(this,f))return;n(this,O,t==null?void 0:t.trigger),clearTimeout(e(this,M)),clearTimeout(e(this,V)),e(this,a).set("closing",!1),e(this,a).set("triggered",!0),Y.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,O)}}),e(this,v).current&&e(this,T)&&history.pushState(history.state,"",e(this,P,oe)),n(this,f,!0);const s=()=>{E.stack.add(e(this,g).current,this),e(this,S).call(this),e(this,a).set("opened",!0),Y.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,O)}}),n(this,C,void 0),n(this,B,setTimeout(()=>{e(this,a).set("transitionend",!0)},se.getElementTransitionDurationMS(this)+10))};t!=null&&t.skipTransition?s():n(this,C,setTimeout(s,10))}close(){e(this,f)&&(clearTimeout(e(this,C)),clearTimeout(e(this,B)),E.stack.remove(e(this,g).current,this),n(this,f,!1),b(this,P,I).call(this),e(this,a).set("transitionend",!1),n(this,M,setTimeout(()=>{e(this,a).set("opened",!1),e(this,a).set("closing",!0),Y.dispatchEvent(this,"popoverClosing",{custom:!0}),n(this,V,setTimeout(()=>{e(this,a).set("triggered",!1),e(this,a).set("closing",!1),Y.dispatchEvent(this,"popoverClosed",{custom:!0})},se.getElementTransitionDurationMS(this)+10))},10)))}connectedCallback(){e(this,v).observe(),e(this,w).observe(),e(this,x).observe(),e(this,A).observe(),e(this,g).observe(),e(this,R).observe(),e(this,q).observe(),e(this,L).observe(),this.setAttribute("role","dialog"),addEventListener("popstate",e(this,$)),setTimeout(()=>{e(this,w).current?(this.urlValue=ie.parseSearchParameters(location.search)[this.id],e(this,$).call(this)):(b(this,P,I).call(this),n(this,T,!0))},0),e(this,L).subscribe(()=>{e(this,S).call(this)}),re.windowResizer.subscribe(e(this,S))}disconnectedCallback(){E.stack.remove(e(this,g).current,this),re.windowResizer.unsubscribe(e(this,S)),e(this,a).close(),e(this,v).close(),e(this,w).close(),e(this,x).close(),e(this,A).close(),e(this,g).close(),e(this,R).close(),e(this,q).close(),e(this,L).close(),this.removeAttribute("role"),clearTimeout(e(this,M)),clearTimeout(e(this,V)),clearTimeout(e(this,C)),clearTimeout(e(this,B)),removeEventListener("popstate",e(this,$)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),this.style.removeProperty("--viewport-offset-x"),this.style.removeProperty("--viewport-offset-y"),b(this,P,I).call(this)}};f=new WeakMap,M=new WeakMap,V=new WeakMap,C=new WeakMap,B=new WeakMap,v=new WeakMap,w=new WeakMap,x=new WeakMap,A=new WeakMap,g=new WeakMap,R=new WeakMap,q=new WeakMap,L=new WeakMap,T=new WeakMap,O=new WeakMap,a=new WeakMap,P=new WeakSet,oe=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},I=function(){if(e(this,v).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},$=new WeakMap,S=new WeakMap,W=new WeakMap,G=new WeakMap,E.stack=new le;let z=E;N.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",z);var h,d,k,Z,D,U,j,X,_;class ne extends HTMLElement{constructor(){super();r(this,k);r(this,h);r(this,d,new m.CSSProperty(this,"--type","open"));r(this,D,()=>{e(this,d).current!=="close"&&this.classList.add("triggered")});r(this,U,()=>{e(this,d).current!=="close"&&(this.classList.add("opened"),this.setAttribute("aria-expanded","true"))});r(this,j,()=>{e(this,d).current!=="close"&&this.classList.remove("opened")});r(this,X,()=>{e(this,d).current!=="close"&&(this.classList.remove("triggered"),this.setAttribute("aria-expanded","false"))});N.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=>{console.log(this.hasAttribute("keydown-disabled")),t.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(t.preventDefault(),this.click())}))}get type(){return e(this,d)}get popoverElement(){return e(this,h)}changePopover(t){var s;if(b(this,k,Z).call(this),t){let i=null;if(t==="parent"){const l=this.closest("[data-popover]");if(l)i=l;else{const p=this.getRootNode();p instanceof ShadowRoot?i=p.host.closest("[data-popover]"):p instanceof HTMLElement&&(i=p.closest("[data-popover]"))}}else if(t==="sibling")i=(s=this.parentElement)==null?void 0:s.querySelector("[data-popover]");else if(t==="ancestor-child"){const l=p=>{if(!p)return null;let H=p.querySelector("[data-popover]");return!H&&(p!=null&&p.parentElement)&&(H=l(p.parentElement)),H};i=l(this.parentElement)||null}else!t.startsWith(".")&&!t.startsWith("[")&&(t=`#${t}`),i=document.querySelector(t)||this.getRootNode().querySelector(t);i instanceof HTMLElement?(n(this,h,i),e(this,h).addEventListener("popoverTriggered",e(this,D)),e(this,h).addEventListener("popoverOpened",e(this,U)),e(this,h).addEventListener("popoverClosing",e(this,j)),e(this,h).addEventListener("popoverClosed",e(this,X))):console.warn(this,`target ${t} not found`)}b(this,k,_).call(this,e(this,d).current)}connectedCallback(){e(this,d).subscribe(s=>{b(this,k,_).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"),b(this,k,Z).call(this)}}h=new WeakMap,d=new WeakMap,k=new WeakSet,Z=function(){e(this,h)&&(e(this,h).removeEventListener("popoverTriggered",e(this,D)),e(this,h).removeEventListener("popoverOpened",e(this,U)),e(this,h).removeEventListener("popoverClosing",e(this,j)),e(this,h).removeEventListener("popoverClosed",e(this,X)))},D=new WeakMap,U=new WeakMap,j=new WeakMap,X=new WeakMap,_=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")))};N.isBrowser&&!customElements.get("e-popover-button")&&customElements.define("e-popover-button",ne);exports.PopoverButtonElement=ne;exports.PopoverElement=z;
1
+ "use strict";var te=c=>{throw TypeError(c)};var Q=(c,o,t)=>o.has(c)||te("Cannot "+t);var e=(c,o,t)=>(Q(c,o,"read from private field"),t?t.call(c):o.get(c)),r=(c,o,t)=>o.has(c)?te("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(c):o.set(c,t),n=(c,o,t,s)=>(Q(c,o,"write to private field"),s?s.call(c,t):o.set(c,t),t),b=(c,o,t)=>(Q(c,o,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const he=require("../element-linked-store/index.cjs"),m=require("../css-property/index.cjs"),N=require("../index-Cqw2NKev.cjs"),Y=require("../events-KVanG9sR.cjs"),ce=require("../function-MthRj-GJ.cjs"),se=require("../style-At6aDoqG.cjs"),ie=require("../url-lnBE_6yf.cjs"),re=require("../window-resizer/index.cjs"),F=require("../device/index.cjs");var u,y,J,K;class le{constructor(){r(this,u,new Map);r(this,y,[]);r(this,J,o=>{var s;const t=[...e(this,y)].reverse().find(i=>i.clickOutside.current);if(t){const i=o.composedPath();if(i.find(ee=>ee instanceof HTMLElement&&ee.hasAttribute("data-popover-content")))return;const l=i[0],p=l instanceof Node&&(t.contains(l)||((s=t.shadowRoot)==null?void 0:s.contains(l))),H=l instanceof HTMLElement&&l.hasAttribute("data-outside");(!p||H)&&t.close()}});r(this,K,o=>{if(o.code==="Escape"){const t=[...e(this,y)].reverse().find(s=>s.escape.current);t&&t.close()}});document.documentElement.addEventListener("click",e(this,J)),addEventListener("keydown",e(this,K))}get groups(){return e(this,u)}get stack(){return e(this,y)}add(o,t){if(t.closeRest.current)e(this,u).forEach(i=>{i.forEach(l=>{l.close()})});else if(t.closeRestInGroup.current){let i=e(this,u).get(o);i==null||i.forEach(l=>{l.close()})}let s=e(this,u).get(o);s!=null&&s.length||(s=[],e(this,u).set(o,s)),e(this,y).push(t),s.push(t)}remove(o,t){if(n(this,y,e(this,y).filter(s=>s!==t)),t.closeRest.current){let s=[];e(this,u).forEach(i=>{i.forEach(l=>s.push(l))}),e(this,u).clear(),s.forEach(i=>i.close())}else if(t.closeRestInGroup.current){const s=e(this,u).get(o);e(this,u).delete(o),s==null||s.forEach(i=>{i.close()})}else{let s=e(this,u).get(o);s&&(s=s.filter(i=>i!==t),e(this,u).set(o,s))}}}u=new WeakMap,y=new WeakMap,J=new WeakMap,K=new WeakMap;var f,M,V,C,B,v,w,x,A,g,R,q,L,T,O,a,P,oe,I,$,S,W,G;const E=class E extends HTMLElement{constructor(){super();r(this,P);r(this,f);r(this,M);r(this,V);r(this,C);r(this,B);r(this,v);r(this,w);r(this,x);r(this,A);r(this,g);r(this,R);r(this,q);r(this,L);r(this,T);r(this,O);r(this,a);r(this,$);r(this,S);r(this,W);r(this,G);this.urlValue="",n(this,f,!1),n(this,v,new m.CSSProperty(this,"--history",!1)),n(this,w,new m.CSSProperty(this,"--restore",!1)),n(this,x,new m.CSSProperty(this,"--close-rest",!1)),n(this,A,new m.CSSProperty(this,"--close-rest-in-group",!1)),n(this,g,new m.CSSProperty(this,"--group","")),n(this,R,new m.CSSProperty(this,"--click-outside",!1)),n(this,q,new m.CSSProperty(this,"--escape",!1)),n(this,L,new m.CSSProperty(this,"--check-viewport-bounds",!1)),n(this,T,!1),n(this,a,new he.ElementLinkedStore(this,{opened:!1,closing:!1,triggered:!1,transitionend:!1})),n(this,$,()=>{n(this,T,!1),e(this,f)&&e(this,v).current&&!location.search.includes(this.id)?this.close():!e(this,f)&&e(this,v).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),n(this,T,!0)}),n(this,S,()=>{this.style.setProperty("--content-width","initial"),this.style.setProperty("--content-height","initial"),this.style.setProperty("--viewport-offset-x","0px"),this.style.setProperty("--viewport-offset-y","0px"),e(this,W).call(this)}),n(this,W,ce.debounce(()=>{e(this,G).call(this)},10)),n(this,G,()=>{if(this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px"),e(this,L).current){const t=this.getBoundingClientRect();let s=0,i=0;t.right>F.viewport.width?s=F.viewport.width-t.right:t.left<0&&(s=t.left*-1),t.bottom>F.viewport.height?i=F.viewport.height-t.bottom:t.top<0&&(i=t.top*-1),this.style.setProperty("--viewport-offset-x",s+"px"),this.style.setProperty("--viewport-offset-y",i+"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),i=s==null?void 0:s.find(l=>l.opened);document.documentElement.classList.toggle(`${this.group.current}-opened`,!!i)}})}get history(){return e(this,v)}get restore(){return e(this,w)}get closeRest(){return e(this,x)}get closeRestInGroup(){return e(this,A)}get group(){return e(this,g)}get clickOutside(){return e(this,R)}get escape(){return e(this,q)}get opened(){return e(this,f)}get lastTrigger(){return e(this,O)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,f)&&ie.updateSearchParameter(this.id,t)}open(t){if(e(this,f))return;n(this,O,t==null?void 0:t.trigger),clearTimeout(e(this,M)),clearTimeout(e(this,V)),e(this,a).set("closing",!1),e(this,a).set("triggered",!0),Y.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,O)}}),e(this,v).current&&e(this,T)&&history.pushState(history.state,"",e(this,P,oe)),n(this,f,!0);const s=()=>{E.stack.add(e(this,g).current,this),e(this,S).call(this),e(this,a).set("opened",!0),Y.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,O)}}),n(this,C,void 0),n(this,B,setTimeout(()=>{e(this,a).set("transitionend",!0)},se.getElementTransitionDurationMS(this)+10))};t!=null&&t.skipTransition?s():n(this,C,setTimeout(s,10))}close(){e(this,f)&&(clearTimeout(e(this,C)),clearTimeout(e(this,B)),E.stack.remove(e(this,g).current,this),n(this,f,!1),b(this,P,I).call(this),e(this,a).set("transitionend",!1),n(this,M,setTimeout(()=>{e(this,a).set("opened",!1),e(this,a).set("closing",!0),Y.dispatchEvent(this,"popoverClosing",{custom:!0}),n(this,V,setTimeout(()=>{e(this,a).set("triggered",!1),e(this,a).set("closing",!1),Y.dispatchEvent(this,"popoverClosed",{custom:!0})},se.getElementTransitionDurationMS(this)+10))},10)))}connectedCallback(){e(this,v).observe(),e(this,w).observe(),e(this,x).observe(),e(this,A).observe(),e(this,g).observe(),e(this,R).observe(),e(this,q).observe(),e(this,L).observe(),this.setAttribute("role","dialog"),addEventListener("popstate",e(this,$)),setTimeout(()=>{e(this,w).current?(this.urlValue=ie.parseSearchParameters(location.search)[this.id],e(this,$).call(this)):(b(this,P,I).call(this),n(this,T,!0))},0),e(this,L).subscribe(()=>{e(this,S).call(this)}),re.windowResizer.subscribe(e(this,S))}disconnectedCallback(){E.stack.remove(e(this,g).current,this),re.windowResizer.unsubscribe(e(this,S)),e(this,a).close(),e(this,v).close(),e(this,w).close(),e(this,x).close(),e(this,A).close(),e(this,g).close(),e(this,R).close(),e(this,q).close(),e(this,L).close(),this.removeAttribute("role"),clearTimeout(e(this,M)),clearTimeout(e(this,V)),clearTimeout(e(this,C)),clearTimeout(e(this,B)),removeEventListener("popstate",e(this,$)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),this.style.removeProperty("--viewport-offset-x"),this.style.removeProperty("--viewport-offset-y"),b(this,P,I).call(this)}};f=new WeakMap,M=new WeakMap,V=new WeakMap,C=new WeakMap,B=new WeakMap,v=new WeakMap,w=new WeakMap,x=new WeakMap,A=new WeakMap,g=new WeakMap,R=new WeakMap,q=new WeakMap,L=new WeakMap,T=new WeakMap,O=new WeakMap,a=new WeakMap,P=new WeakSet,oe=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},I=function(){if(e(this,v).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},$=new WeakMap,S=new WeakMap,W=new WeakMap,G=new WeakMap,E.stack=new le;let z=E;N.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",z);var h,d,k,Z,D,U,j,X,_;class ne extends HTMLElement{constructor(){super();r(this,k);r(this,h);r(this,d,new m.CSSProperty(this,"--type","open"));r(this,D,()=>{e(this,d).current!=="close"&&this.classList.add("triggered")});r(this,U,()=>{e(this,d).current!=="close"&&(this.classList.add("opened"),this.setAttribute("aria-expanded","true"))});r(this,j,()=>{e(this,d).current!=="close"&&this.classList.remove("opened")});r(this,X,()=>{e(this,d).current!=="close"&&(this.classList.remove("triggered"),this.setAttribute("aria-expanded","false"))});N.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"&&!this.hasAttribute("keydown-disabled")&&(t.preventDefault(),this.click())}))}get type(){return e(this,d)}get popoverElement(){return e(this,h)}changePopover(t){var s;if(b(this,k,Z).call(this),t){let i=null;if(t==="parent"){const l=this.closest("[data-popover]");if(l)i=l;else{const p=this.getRootNode();p instanceof ShadowRoot?i=p.host.closest("[data-popover]"):p instanceof HTMLElement&&(i=p.closest("[data-popover]"))}}else if(t==="sibling")i=(s=this.parentElement)==null?void 0:s.querySelector("[data-popover]");else if(t==="ancestor-child"){const l=p=>{if(!p)return null;let H=p.querySelector("[data-popover]");return!H&&(p!=null&&p.parentElement)&&(H=l(p.parentElement)),H};i=l(this.parentElement)||null}else!t.startsWith(".")&&!t.startsWith("[")&&(t=`#${t}`),i=document.querySelector(t)||this.getRootNode().querySelector(t);i instanceof HTMLElement?(n(this,h,i),e(this,h).addEventListener("popoverTriggered",e(this,D)),e(this,h).addEventListener("popoverOpened",e(this,U)),e(this,h).addEventListener("popoverClosing",e(this,j)),e(this,h).addEventListener("popoverClosed",e(this,X))):console.warn(this,`target ${t} not found`)}b(this,k,_).call(this,e(this,d).current)}connectedCallback(){e(this,d).subscribe(s=>{b(this,k,_).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"),b(this,k,Z).call(this)}}h=new WeakMap,d=new WeakMap,k=new WeakSet,Z=function(){e(this,h)&&(e(this,h).removeEventListener("popoverTriggered",e(this,D)),e(this,h).removeEventListener("popoverOpened",e(this,U)),e(this,h).removeEventListener("popoverClosing",e(this,j)),e(this,h).removeEventListener("popoverClosed",e(this,X)))},D=new WeakMap,U=new WeakMap,j=new WeakMap,X=new WeakMap,_=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")))};N.isBrowser&&!customElements.get("e-popover-button")&&customElements.define("e-popover-button",ne);exports.PopoverButtonElement=ne;exports.PopoverElement=z;
@@ -81,7 +81,7 @@ class lt {
81
81
  }
82
82
  }
83
83
  u = new WeakMap(), b = new WeakMap(), J = new WeakMap(), K = new WeakMap();
84
- var f, M, H, x, W, m, w, S, C, g, R, $, L, T, O, a, P, rt, F, V, k, q, z;
84
+ var f, M, H, A, W, m, w, S, C, g, R, $, L, T, O, a, P, rt, F, V, k, q, z;
85
85
  const E = class E extends HTMLElement {
86
86
  constructor() {
87
87
  super();
@@ -89,7 +89,7 @@ const E = class E extends HTMLElement {
89
89
  r(this, f);
90
90
  r(this, M);
91
91
  r(this, H);
92
- r(this, x);
92
+ r(this, A);
93
93
  r(this, W);
94
94
  r(this, m);
95
95
  r(this, w);
@@ -195,14 +195,14 @@ const E = class E extends HTMLElement {
195
195
  detail: {
196
196
  trigger: t(this, O)
197
197
  }
198
- }), h(this, x, void 0), h(this, W, setTimeout(() => {
198
+ }), h(this, A, void 0), h(this, W, setTimeout(() => {
199
199
  t(this, a).set("transitionend", !0);
200
200
  }, st(this) + 10));
201
201
  };
202
- e != null && e.skipTransition ? s() : h(this, x, setTimeout(s, 10));
202
+ e != null && e.skipTransition ? s() : h(this, A, setTimeout(s, 10));
203
203
  }
204
204
  close() {
205
- t(this, f) && (clearTimeout(t(this, x)), clearTimeout(t(this, W)), E.stack.remove(t(this, g).current, this), h(this, f, !1), y(this, P, F).call(this), t(this, a).set("transitionend", !1), h(this, M, setTimeout(() => {
205
+ t(this, f) && (clearTimeout(t(this, A)), clearTimeout(t(this, W)), E.stack.remove(t(this, g).current, this), h(this, f, !1), y(this, P, F).call(this), t(this, a).set("transitionend", !1), h(this, M, setTimeout(() => {
206
206
  t(this, a).set("opened", !1), t(this, a).set("closing", !0), Y(this, "popoverClosing", {
207
207
  custom: !0
208
208
  }), h(this, H, setTimeout(() => {
@@ -220,10 +220,10 @@ const E = class E extends HTMLElement {
220
220
  }), it.subscribe(t(this, k));
221
221
  }
222
222
  disconnectedCallback() {
223
- E.stack.remove(t(this, g).current, this), it.unsubscribe(t(this, k)), t(this, a).close(), t(this, m).close(), t(this, w).close(), t(this, S).close(), t(this, C).close(), t(this, g).close(), t(this, R).close(), t(this, $).close(), t(this, L).close(), this.removeAttribute("role"), clearTimeout(t(this, M)), clearTimeout(t(this, H)), clearTimeout(t(this, x)), clearTimeout(t(this, W)), removeEventListener("popstate", t(this, V)), this.style.removeProperty("--content-width"), this.style.removeProperty("--content-height"), this.style.removeProperty("--viewport-offset-x"), this.style.removeProperty("--viewport-offset-y"), y(this, P, F).call(this);
223
+ E.stack.remove(t(this, g).current, this), it.unsubscribe(t(this, k)), t(this, a).close(), t(this, m).close(), t(this, w).close(), t(this, S).close(), t(this, C).close(), t(this, g).close(), t(this, R).close(), t(this, $).close(), t(this, L).close(), this.removeAttribute("role"), clearTimeout(t(this, M)), clearTimeout(t(this, H)), clearTimeout(t(this, A)), clearTimeout(t(this, W)), removeEventListener("popstate", t(this, V)), this.style.removeProperty("--content-width"), this.style.removeProperty("--content-height"), this.style.removeProperty("--viewport-offset-x"), this.style.removeProperty("--viewport-offset-y"), y(this, P, F).call(this);
224
224
  }
225
225
  };
226
- f = new WeakMap(), M = new WeakMap(), H = new WeakMap(), x = new WeakMap(), W = new WeakMap(), m = new WeakMap(), w = new WeakMap(), S = new WeakMap(), C = new WeakMap(), g = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), L = new WeakMap(), T = new WeakMap(), O = new WeakMap(), a = new WeakMap(), P = new WeakSet(), rt = function() {
226
+ f = new WeakMap(), M = new WeakMap(), H = new WeakMap(), A = new WeakMap(), W = new WeakMap(), m = new WeakMap(), w = new WeakMap(), S = new WeakMap(), C = new WeakMap(), g = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), L = new WeakMap(), T = new WeakMap(), O = new WeakMap(), a = new WeakMap(), P = new WeakSet(), rt = function() {
227
227
  return `${location.pathname}${location.search ? location.search + "&" : "?"}${this.idWithValue}`;
228
228
  }, F = function() {
229
229
  if (t(this, m).current) {
@@ -233,11 +233,11 @@ f = new WeakMap(), M = new WeakMap(), H = new WeakMap(), x = new WeakMap(), W =
233
233
  }, V = new WeakMap(), k = new WeakMap(), q = new WeakMap(), z = new WeakMap(), E.stack = new lt();
234
234
  let I = E;
235
235
  _ && !customElements.get("e-popover") && customElements.define("e-popover", I);
236
- var n, d, A, Z, B, D, U, X, N;
236
+ var n, d, x, Z, B, D, U, X, N;
237
237
  class at extends HTMLElement {
238
238
  constructor() {
239
239
  super();
240
- r(this, A);
240
+ r(this, x);
241
241
  r(this, n);
242
242
  r(this, d, new v(this, "--type", "open"));
243
243
  r(this, B, () => {
@@ -258,7 +258,7 @@ class at extends HTMLElement {
258
258
  e === "open" || e === "toggle" && !t(this, n).opened ? t(this, n).open({ trigger: this }) : (e === "close" || e === "toggle" && t(this, n).opened) && t(this, n).close();
259
259
  }
260
260
  }), this.addEventListener("keydown", (e) => {
261
- console.log(this.hasAttribute("keydown-disabled")), e.code === "Space" && !this.hasAttribute("keydown-disabled") && (e.preventDefault(), this.click());
261
+ e.code === "Space" && !this.hasAttribute("keydown-disabled") && (e.preventDefault(), this.click());
262
262
  }));
263
263
  }
264
264
  get type() {
@@ -269,7 +269,7 @@ class at extends HTMLElement {
269
269
  }
270
270
  changePopover(e) {
271
271
  var s;
272
- if (y(this, A, Z).call(this), e) {
272
+ if (y(this, x, Z).call(this), e) {
273
273
  let i = null;
274
274
  if (e === "parent") {
275
275
  const l = this.closest("[data-popover]");
@@ -305,20 +305,20 @@ class at extends HTMLElement {
305
305
  t(this, X)
306
306
  )) : console.warn(this, `target ${e} not found`);
307
307
  }
308
- y(this, A, N).call(this, t(this, d).current);
308
+ y(this, x, N).call(this, t(this, d).current);
309
309
  }
310
310
  connectedCallback() {
311
311
  t(this, d).subscribe((s) => {
312
- y(this, A, N).call(this, s.current);
312
+ y(this, x, N).call(this, s.current);
313
313
  }), this.hasAttribute("tabindex") || (this.tabIndex = 0);
314
314
  const e = this.getAttribute("target");
315
315
  e && this.changePopover(e), this.isConnected && t(this, d).observe();
316
316
  }
317
317
  disconnectedCallback() {
318
- t(this, d).unobserve(), this.removeAttribute("aria-haspopup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls"), y(this, A, Z).call(this);
318
+ t(this, d).unobserve(), this.removeAttribute("aria-haspopup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls"), y(this, x, Z).call(this);
319
319
  }
320
320
  }
321
- n = new WeakMap(), d = new WeakMap(), A = new WeakSet(), Z = function() {
321
+ n = new WeakMap(), d = new WeakMap(), x = new WeakSet(), Z = function() {
322
322
  t(this, n) && (t(this, n).removeEventListener(
323
323
  "popoverTriggered",
324
324
  t(this, B)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.63.1",
3
+ "version": "0.63.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"