aptechka 0.66.0 → 0.66.2

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.
@@ -5,6 +5,7 @@ export interface PointerParameters {
5
5
  damped?: DampedOptions;
6
6
  cartesian?: boolean;
7
7
  normalize?: boolean;
8
+ fullScreen?: boolean;
8
9
  }
9
10
  export declare class Pointer {
10
11
  #private;
@@ -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 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-Cd1GlEmZ.cjs");const M=require("../coordinates-D8Np3cPD.cjs"),Q=require("../dom-JBOkFLTh.cjs"),W=require("../math-GDWEqu7y.cjs");require("construct-style-sheets-polyfill");const U=require("../index-DekP7OZe.cjs");require("../ticker/index.cjs");const T=require("../Damped-z9Uaw2MJ.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,q,p,E,k;class G{constructor(s){r(this,E);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,E,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,q,s=>{e(this,g)||e(this,z).call(this,s);const t=_(this,E,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,q)),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,q)),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,q=new WeakMap,p=new WeakMap,E=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;
1
+ "use strict";var I=Object.defineProperty;var B=Object.getOwnPropertySymbols;var J=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable;var j=i=>{throw TypeError(i)};var W=(i,s,t)=>s in i?I(i,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[s]=t,O=(i,s)=>{for(var t in s||(s={}))J.call(s,t)&&W(i,t,s[t]);if(B)for(var t of B(s))K.call(s,t)&&W(i,t,s[t]);return i};var _=(i,s,t)=>s.has(i)||j("Cannot "+t);var e=(i,s,t)=>(_(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),h=(i,s,t,l)=>(_(i,s,"write to private field"),l?l.call(i,t):s.set(i,t),t),H=(i,s,t)=>(_(i,s,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-Cd1GlEmZ.cjs");const M=require("../coordinates-D8Np3cPD.cjs"),N=require("../dom-JBOkFLTh.cjs"),X=require("../math-GDWEqu7y.cjs");require("construct-style-sheets-polyfill");const Q=require("../index-DekP7OZe.cjs");require("../ticker/index.cjs");const T=require("../Damped-z9Uaw2MJ.cjs"),Y=require("../element-resizer/index.cjs"),A=require("../window-resizer/index.cjs"),C=require("../css-property/index.cjs");var c,u,a,f,m,d,g,y,p,S,z,E,q,b,L,k;class F{constructor(s){r(this,L);r(this,c);r(this,u);r(this,a);r(this,f);r(this,m);r(this,d);r(this,g,!1);r(this,y,0);r(this,p,0);r(this,S,!1);r(this,z,s=>{h(this,S,!0);const t=H(this,L,k).call(this,s);e(this,u).set(t.x,{equalize:!0}),e(this,a).set(t.y,{equalize:!0}),e(this,f).set(1)});r(this,E,s=>{h(this,S,!1),e(this,f).set(0)});r(this,q,s=>{e(this,S)||e(this,z).call(this,s);const t=H(this,L,k).call(this,s);e(this,u).set(t.x),e(this,a).set(t.y)});r(this,b,()=>{e(this,g)?(h(this,y,document.documentElement.clientWidth),h(this,p,innerHeight)):(h(this,y,this.element.clientWidth),h(this,p,this.element.clientHeight));let s=0,t=0,l=0,o=0;e(this,m)?e(this,d)?(s=-1,t=1,l=-1,o=1):(s=e(this,y)/2*-1,t=e(this,y)/2*1,l=e(this,p)/2*-1,o=e(this,p)/2*1):e(this,d)?(s=0,t=1,l=0,o=1):(s=0,t=e(this,y),l=0,o=e(this,p)),e(this,u).min=s,e(this,u).max=t,e(this,a).min=l,e(this,a).max=o});h(this,c,N.getElement(s.element)),h(this,u,new T.Damped(0,s.damped)),h(this,a,new T.Damped(0,s.damped)),h(this,f,new T.Damped(0,O({min:0,max:1},s.damped))),h(this,m,s.cartesian||!1),h(this,d,s.normalize||!1),h(this,g,s.fullScreen||!1)}get element(){return e(this,c)}get x(){return e(this,u)}get y(){return e(this,a)}get z(){return e(this,f)}get cartesian(){return e(this,m)}set cartesian(s){h(this,m,s),e(this,b).call(this)}get normalize(){return e(this,d)}set normalize(s){h(this,d,s),e(this,b).call(this)}connect(){e(this,c).addEventListener("pointerenter",e(this,z)),e(this,c).addEventListener("pointerleave",e(this,E)),e(this,c).addEventListener("pointermove",e(this,q)),Y.elementResizer.subscribe(e(this,c),e(this,b)),A.windowResizer.subscribe(e(this,b))}disconnect(){e(this,c).removeEventListener("pointerenter",e(this,z)),e(this,c).removeEventListener("pointerleave",e(this,E)),e(this,c).removeEventListener("pointermove",e(this,q)),Y.elementResizer.unsubscribe(e(this,b)),A.windowResizer.unsubscribe(e(this,b)),e(this,u).reset(),e(this,a).reset(),e(this,f).reset()}}c=new WeakMap,u=new WeakMap,a=new WeakMap,f=new WeakMap,m=new WeakMap,d=new WeakMap,g=new WeakMap,y=new WeakMap,p=new WeakMap,S=new WeakMap,z=new WeakMap,E=new WeakMap,q=new WeakMap,b=new WeakMap,L=new WeakSet,k=function(s){let t=null;e(this,g)?t={x:s.clientX,y:s.clientY}:t=M.getPointerPosition(s,e(this,c).getBoundingClientRect());const l={width:e(this,y),height:e(this,p)},o={x:t.x,y:t.y};if(e(this,m)){const x=M.screenToCartesian(o,l);o.x=x.x,o.y=x.y}if(e(this,d)){const x=M.normalize(o,l);e(this,m)?(o.x=X.clamp(x.x*2,-1,1),o.y=X.clamp(x.y*2,-1,1)):(o.x=x.x,o.y=x.y)}return o};var n,P,v,w,R,D;class G extends HTMLElement{constructor(){super();r(this,n);r(this,P,new C.CSSProperty(this,"--damping",20));r(this,v,new C.CSSProperty(this,"--mass",0));r(this,w,new C.CSSProperty(this,"--stiffness",0));r(this,R,new C.CSSProperty(this,"--cartesian",!1));r(this,D,new C.CSSProperty(this,"--normalize",!1));h(this,n,new F({element:this})),e(this,P).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,R).subscribe(t=>{e(this,n).cartesian=t.current}),e(this,D).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,w).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,P).observe(),e(this,v).observe(),e(this,w).observe()}disconnectedCallback(){e(this,n).disconnect(),e(this,P).unobserve(),e(this,v).unobserve(),e(this,w).unobserve(),this.style.removeProperty("--x"),this.style.removeProperty("--y"),this.style.removeProperty("--z")}}n=new WeakMap,P=new WeakMap,v=new WeakMap,w=new WeakMap,R=new WeakMap,D=new WeakMap;Q.isBrowser&&!customElements.get("e-pointer")&&customElements.define("e-pointer",G);exports.Pointer=F;exports.PointerElement=G;
@@ -1,139 +1,142 @@
1
- var I = Object.defineProperty;
2
- var M = Object.getOwnPropertySymbols;
3
- var J = Object.prototype.hasOwnProperty, K = Object.prototype.propertyIsEnumerable;
4
- var W = (i) => {
1
+ var G = Object.defineProperty;
2
+ var T = Object.getOwnPropertySymbols;
3
+ var I = Object.prototype.hasOwnProperty, J = Object.prototype.propertyIsEnumerable;
4
+ var X = (i) => {
5
5
  throw TypeError(i);
6
6
  };
7
- var T = (i, s, e) => s in i ? I(i, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[s] = e, j = (i, s) => {
7
+ var W = (i, s, e) => s in i ? G(i, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[s] = e, Y = (i, s) => {
8
8
  for (var e in s || (s = {}))
9
- J.call(s, e) && T(i, e, s[e]);
10
- if (M)
11
- for (var e of M(s))
12
- K.call(s, e) && T(i, e, s[e]);
9
+ I.call(s, e) && W(i, e, s[e]);
10
+ if (T)
11
+ for (var e of T(s))
12
+ J.call(s, e) && W(i, e, s[e]);
13
13
  return i;
14
14
  };
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, c) => (q(i, s, "write to private field"), c ? c.call(i, e) : s.set(i, e), e), B = (i, s, e) => (q(i, s, "access private method"), e);
15
+ var q = (i, s, e) => s.has(i) || X("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) ? X("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(i) : s.set(i, e), h = (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-0BVty6AZ.js";
18
- import { g as N, s as O, n as Q } from "../coordinates-CgdGoSYs.js";
19
- import { g as U } from "../dom-CVWzyXPH.js";
20
- import { c as A } from "../math-BOBiC4TN.js";
18
+ import { g as K, s as N, n as O } from "../coordinates-CgdGoSYs.js";
19
+ import { g as Q } from "../dom-CVWzyXPH.js";
20
+ import { c as j } from "../math-BOBiC4TN.js";
21
21
  import "construct-style-sheets-polyfill";
22
- import { i as V } from "../index-Bv9zgfdb.js";
22
+ import { i as U } from "../index-Bv9zgfdb.js";
23
23
  import "../ticker/index.js";
24
24
  import { D } from "../Damped-CtQmJ52v.js";
25
- import { elementResizer as F } from "../element-resizer/index.js";
26
- import { windowResizer as G } from "../window-resizer/index.js";
27
- import { CSSProperty as w } from "../css-property/index.js";
28
- var m, a, l, f, u, p, b, d, g, v, E, L, y, C, H;
29
- class X {
25
+ import { elementResizer as A } from "../element-resizer/index.js";
26
+ import { windowResizer as F } from "../window-resizer/index.js";
27
+ import { CSSProperty as E } from "../css-property/index.js";
28
+ var c, l, a, b, u, p, g, f, y, v, z, L, C, d, H, M;
29
+ class V {
30
30
  constructor(s) {
31
- r(this, C);
32
- r(this, m);
33
- r(this, a);
31
+ r(this, H);
32
+ r(this, c);
34
33
  r(this, l);
35
- r(this, f);
34
+ r(this, a);
35
+ r(this, b);
36
36
  r(this, u);
37
37
  r(this, p);
38
- r(this, b, 0);
39
- r(this, d, 0);
40
38
  r(this, g, !1);
41
- r(this, v, (s) => {
42
- o(this, g, !0);
43
- const e = B(this, C, H).call(this, s);
44
- t(this, a).set(e.x, { equalize: !0 }), t(this, l).set(e.y, { equalize: !0 }), t(this, f).set(1);
45
- });
46
- r(this, E, (s) => {
47
- o(this, g, !1), t(this, f).set(0);
39
+ r(this, f, 0);
40
+ r(this, y, 0);
41
+ r(this, v, !1);
42
+ r(this, z, (s) => {
43
+ h(this, v, !0);
44
+ const e = B(this, H, M).call(this, s);
45
+ t(this, l).set(e.x, { equalize: !0 }), t(this, a).set(e.y, { equalize: !0 }), t(this, b).set(1);
48
46
  });
49
47
  r(this, L, (s) => {
50
- t(this, g) || t(this, v).call(this, s);
51
- const e = B(this, C, H).call(this, s);
52
- t(this, a).set(e.x), t(this, l).set(e.y);
48
+ h(this, v, !1), t(this, b).set(0);
53
49
  });
54
- r(this, y, () => {
55
- o(this, b, this.element.clientWidth), o(this, d, this.element.clientHeight);
56
- let s = 0, e = 0, c = 0, h = 0;
57
- t(this, u) ? t(this, p) ? (s = -1, e = 1, c = -1, h = 1) : (s = t(this, b) / 2 * -1, e = t(this, b) / 2 * 1, c = t(this, d) / 2 * -1, h = t(this, d) / 2 * 1) : t(this, p) ? (s = 0, e = 1, c = 0, h = 1) : (s = 0, e = t(this, b), c = 0, h = t(this, d)), t(this, a).min = s, t(this, a).max = e, t(this, l).min = c, t(this, l).max = h;
50
+ r(this, C, (s) => {
51
+ t(this, v) || t(this, z).call(this, s);
52
+ const e = B(this, H, M).call(this, s);
53
+ t(this, l).set(e.x), t(this, a).set(e.y);
58
54
  });
59
- o(this, m, 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);
55
+ r(this, d, () => {
56
+ t(this, g) ? (h(this, f, document.documentElement.clientWidth), h(this, y, innerHeight)) : (h(this, f, this.element.clientWidth), h(this, y, this.element.clientHeight));
57
+ let s = 0, e = 0, m = 0, o = 0;
58
+ t(this, u) ? t(this, p) ? (s = -1, e = 1, m = -1, o = 1) : (s = t(this, f) / 2 * -1, e = t(this, f) / 2 * 1, m = t(this, y) / 2 * -1, o = t(this, y) / 2 * 1) : t(this, p) ? (s = 0, e = 1, m = 0, o = 1) : (s = 0, e = t(this, f), m = 0, o = t(this, y)), t(this, l).min = s, t(this, l).max = e, t(this, a).min = m, t(this, a).max = o;
59
+ });
60
+ h(this, c, Q(s.element)), h(this, l, new D(0, s.damped)), h(this, a, new D(0, s.damped)), h(this, b, new D(0, Y({ min: 0, max: 1 }, s.damped))), h(this, u, s.cartesian || !1), h(this, p, s.normalize || !1), h(this, g, s.fullScreen || !1);
60
61
  }
61
62
  get element() {
62
- return t(this, m);
63
+ return t(this, c);
63
64
  }
64
65
  get x() {
65
- return t(this, a);
66
+ return t(this, l);
66
67
  }
67
68
  get y() {
68
- return t(this, l);
69
+ return t(this, a);
69
70
  }
70
71
  get z() {
71
- return t(this, f);
72
+ return t(this, b);
72
73
  }
73
74
  get cartesian() {
74
75
  return t(this, u);
75
76
  }
76
77
  set cartesian(s) {
77
- o(this, u, s), t(this, y).call(this);
78
+ h(this, u, s), t(this, d).call(this);
78
79
  }
79
80
  get normalize() {
80
81
  return t(this, p);
81
82
  }
82
83
  set normalize(s) {
83
- o(this, p, s), t(this, y).call(this);
84
+ h(this, p, s), t(this, d).call(this);
84
85
  }
85
86
  connect() {
86
- t(this, m).addEventListener("pointerenter", t(this, v)), t(this, m).addEventListener("pointerleave", t(this, E)), t(this, m).addEventListener("pointermove", t(this, L)), F.subscribe(t(this, m), t(this, y)), G.subscribe(t(this, y));
87
+ t(this, c).addEventListener("pointerenter", t(this, z)), t(this, c).addEventListener("pointerleave", t(this, L)), t(this, c).addEventListener("pointermove", t(this, C)), A.subscribe(t(this, c), t(this, d)), F.subscribe(t(this, d));
87
88
  }
88
89
  disconnect() {
89
- t(this, m).removeEventListener(
90
+ t(this, c).removeEventListener(
90
91
  "pointerenter",
91
- t(this, v)
92
- ), t(this, m).removeEventListener(
92
+ t(this, z)
93
+ ), t(this, c).removeEventListener(
93
94
  "pointerleave",
94
- t(this, E)
95
- ), t(this, m).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();
95
+ t(this, L)
96
+ ), t(this, c).removeEventListener("pointermove", t(this, C)), A.unsubscribe(t(this, d)), F.unsubscribe(t(this, d)), t(this, l).reset(), t(this, a).reset(), t(this, b).reset();
96
97
  }
97
98
  }
98
- m = 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) {
99
- const e = N(s, t(this, m).getBoundingClientRect()), c = {
100
- width: t(this, b),
101
- height: t(this, d)
102
- }, h = {
99
+ c = new WeakMap(), l = new WeakMap(), a = new WeakMap(), b = new WeakMap(), u = new WeakMap(), p = new WeakMap(), g = new WeakMap(), f = new WeakMap(), y = new WeakMap(), v = new WeakMap(), z = new WeakMap(), L = new WeakMap(), C = new WeakMap(), d = new WeakMap(), H = new WeakSet(), M = function(s) {
100
+ let e = null;
101
+ t(this, g) ? e = { x: s.clientX, y: s.clientY } : e = K(s, t(this, c).getBoundingClientRect());
102
+ const m = {
103
+ width: t(this, f),
104
+ height: t(this, y)
105
+ }, o = {
103
106
  x: e.x,
104
107
  y: e.y
105
108
  };
106
109
  if (t(this, u)) {
107
- const x = O(h, c);
108
- h.x = x.x, h.y = x.y;
110
+ const x = N(o, m);
111
+ o.x = x.x, o.y = x.y;
109
112
  }
110
113
  if (t(this, p)) {
111
- const x = Q(h, c);
112
- t(this, u) ? (h.x = A(x.x * 2, -1, 1), h.y = A(x.y * 2, -1, 1)) : (h.x = x.x, h.y = x.y);
114
+ const x = O(o, m);
115
+ t(this, u) ? (o.x = j(x.x * 2, -1, 1), o.y = j(x.y * 2, -1, 1)) : (o.x = x.x, o.y = x.y);
113
116
  }
114
- return h;
117
+ return o;
115
118
  };
116
- var n, z, P, S, R, k;
117
- class Y extends HTMLElement {
119
+ var n, P, S, w, R, k;
120
+ class Z extends HTMLElement {
118
121
  constructor() {
119
122
  super();
120
123
  r(this, n);
121
- r(this, z, new w(this, "--damping", 20));
122
- r(this, P, new w(this, "--mass", 0));
123
- r(this, S, new w(this, "--stiffness", 0));
124
- r(this, R, new w(this, "--cartesian", !1));
125
- r(this, k, new w(this, "--normalize", !1));
126
- o(this, n, new X({
124
+ r(this, P, new E(this, "--damping", 20));
125
+ r(this, S, new E(this, "--mass", 0));
126
+ r(this, w, new E(this, "--stiffness", 0));
127
+ r(this, R, new E(this, "--cartesian", !1));
128
+ r(this, k, new E(this, "--normalize", !1));
129
+ h(this, n, new V({
127
130
  element: this
128
- })), t(this, z).subscribe((e) => {
131
+ })), t(this, P).subscribe((e) => {
129
132
  t(this, n).x.damping = e.current, t(this, n).y.damping = e.current, t(this, n).z.damping = e.current;
130
133
  }), t(this, R).subscribe((e) => {
131
134
  t(this, n).cartesian = e.current;
132
135
  }), t(this, k).subscribe((e) => {
133
136
  t(this, n).normalize = e.current;
134
- }), t(this, P).subscribe((e) => {
135
- t(this, n).x.mass = e.current, t(this, n).y.mass = e.current, t(this, n).z.mass = e.current;
136
137
  }), t(this, S).subscribe((e) => {
138
+ t(this, n).x.mass = e.current, t(this, n).y.mass = e.current, t(this, n).z.mass = e.current;
139
+ }), t(this, w).subscribe((e) => {
137
140
  t(this, n).x.stiffness = e.current, t(this, n).y.stiffness = e.current, t(this, n).z.stiffness = e.current;
138
141
  }), t(this, n).x.subscribe((e) => {
139
142
  this.style.setProperty("--x", e.current.toString());
@@ -147,15 +150,15 @@ class Y extends HTMLElement {
147
150
  return t(this, n);
148
151
  }
149
152
  connectedCallback() {
150
- t(this, n).connect(), t(this, z).observe(), t(this, P).observe(), t(this, S).observe();
153
+ t(this, n).connect(), t(this, P).observe(), t(this, S).observe(), t(this, w).observe();
151
154
  }
152
155
  disconnectedCallback() {
153
- 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");
156
+ t(this, n).disconnect(), t(this, P).unobserve(), t(this, S).unobserve(), t(this, w).unobserve(), this.style.removeProperty("--x"), this.style.removeProperty("--y"), this.style.removeProperty("--z");
154
157
  }
155
158
  }
156
- n = new WeakMap(), z = new WeakMap(), P = new WeakMap(), S = new WeakMap(), R = new WeakMap(), k = new WeakMap();
157
- V && !customElements.get("e-pointer") && customElements.define("e-pointer", Y);
159
+ n = new WeakMap(), P = new WeakMap(), S = new WeakMap(), w = new WeakMap(), R = new WeakMap(), k = new WeakMap();
160
+ U && !customElements.get("e-pointer") && customElements.define("e-pointer", Z);
158
161
  export {
159
- X as Pointer,
160
- Y as PointerElement
162
+ V as Pointer,
163
+ Z as PointerElement
161
164
  };
@@ -14,6 +14,7 @@ export declare class PopoverElement extends HTMLElement {
14
14
  private static stack;
15
15
  urlValue: string;
16
16
  constructor();
17
+ get openClass(): string | null;
17
18
  get history(): CSSProperty<false>;
18
19
  get restore(): CSSProperty<false>;
19
20
  get closeRest(): CSSProperty<boolean>;
@@ -1 +1 @@
1
- "use strict";var te=l=>{throw TypeError(l)};var K=(l,o,t)=>o.has(l)||te("Cannot "+t);var e=(l,o,t)=>(K(l,o,"read from private field"),t?t.call(l):o.get(l)),r=(l,o,t)=>o.has(l)?te("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(l):o.set(l,t),n=(l,o,t,s)=>(K(l,o,"write to private field"),s?s.call(l,t):o.set(l,t),t),y=(l,o,t)=>(K(l,o,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const he=require("../element-linked-store/index.cjs"),g=require("../css-property/index.cjs"),_=require("../index-DekP7OZe.cjs"),X=require("../events-KVanG9sR.cjs"),ce=require("../function-MthRj-GJ.cjs"),se=require("../style-At6aDoqG.cjs");require("construct-style-sheets-polyfill");const ie=require("../url-lnBE_6yf.cjs"),re=require("../window-resizer/index.cjs"),Y=require("../Viewport-DB0qAZPJ.cjs");var u,b,I,J;class le{constructor(){r(this,u,new Map);r(this,b,[]);r(this,I,o=>{var s;const t=[...e(this,b)].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 c=i[0],p=c instanceof Node&&(t.contains(c)||((s=t.shadowRoot)==null?void 0:s.contains(c))),H=c instanceof HTMLElement&&c.hasAttribute("data-outside");(!p||H)&&t.close()}});r(this,J,o=>{if(o.code==="Escape"){const t=[...e(this,b)].reverse().find(s=>s.escape.current);t&&t.close()}});document.documentElement.addEventListener("click",e(this,I)),addEventListener("keydown",e(this,J))}get groups(){return e(this,u)}get stack(){return e(this,b)}add(o,t){if(t.closeRest.current)e(this,u).forEach(i=>{i.forEach(c=>{c.close()})});else if(t.closeRestInGroup.current){let i=e(this,u).get(o);i==null||i.forEach(c=>{c.close()})}let s=e(this,u).get(o);s!=null&&s.length||(s=[],e(this,u).set(o,s)),e(this,b).push(t),s.push(t)}remove(o,t){if(n(this,b,e(this,b).filter(s=>s!==t)),t.closeRest.current){let s=[];e(this,u).forEach(i=>{i.forEach(c=>s.push(c))}),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,b=new WeakMap,I=new WeakMap,J=new WeakMap;var f,$,M,A,B,v,w,C,x,m,R,q,L,T,O,a,P,oe,F,V,S,W,G;const E=class E extends HTMLElement{constructor(){super();r(this,P);r(this,f);r(this,$);r(this,M);r(this,A);r(this,B);r(this,v);r(this,w);r(this,C);r(this,x);r(this,m);r(this,R);r(this,q);r(this,L);r(this,T);r(this,O);r(this,a);r(this,V);r(this,S);r(this,W);r(this,G);this.urlValue="",n(this,f,!1),n(this,v,new g.CSSProperty(this,"--history",!1)),n(this,w,new g.CSSProperty(this,"--restore",!1)),n(this,C,new g.CSSProperty(this,"--close-rest",!1)),n(this,x,new g.CSSProperty(this,"--close-rest-in-group",!1)),n(this,m,new g.CSSProperty(this,"--group","")),n(this,R,new g.CSSProperty(this,"--click-outside",!1)),n(this,q,new g.CSSProperty(this,"--escape",!1)),n(this,L,new g.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,V,()=>{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>Y.viewport.width?s=Y.viewport.width-t.right:t.left<0&&(s=t.left*-1),t.bottom>Y.viewport.height?i=Y.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,m).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(c=>c.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,C)}get closeRestInGroup(){return e(this,x)}get group(){return e(this,m)}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,$)),clearTimeout(e(this,M)),this.hasAttribute("data-document-class")&&this.getAttribute("data-document-class").split(" ").map(c=>{document.documentElement.classList.add(c.trim())}),e(this,a).set("closing",!1),e(this,a).set("triggered",!0),X.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,m).current,this),e(this,S).call(this),e(this,a).set("opened",!0),X.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,O)}}),n(this,A,void 0),n(this,B,setTimeout(()=>{e(this,a).set("transitionend",!0)},se.getElementTransitionDurationMS(this)+10))};t!=null&&t.skipTransition?s():n(this,A,setTimeout(s,10))}close(){e(this,f)&&(clearTimeout(e(this,A)),clearTimeout(e(this,B)),E.stack.remove(e(this,m).current,this),n(this,f,!1),y(this,P,F).call(this),this.hasAttribute("data-document-class")&&this.getAttribute("data-document-class").split(" ").map(s=>{document.documentElement.classList.remove(s.trim())}),e(this,a).set("transitionend",!1),n(this,$,setTimeout(()=>{e(this,a).set("opened",!1),e(this,a).set("closing",!0),X.dispatchEvent(this,"popoverClosing",{custom:!0}),n(this,M,setTimeout(()=>{e(this,a).set("triggered",!1),e(this,a).set("closing",!1),X.dispatchEvent(this,"popoverClosed",{custom:!0})},se.getElementTransitionDurationMS(this)+10))},10)))}connectedCallback(){e(this,v).observe(),e(this,w).observe(),e(this,C).observe(),e(this,x).observe(),e(this,m).observe(),e(this,R).observe(),e(this,q).observe(),e(this,L).observe(),this.setAttribute("role","dialog"),addEventListener("popstate",e(this,V)),setTimeout(()=>{e(this,w).current?(this.urlValue=ie.parseSearchParameters(location.search)[this.id],e(this,V).call(this)):(y(this,P,F).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,m).current,this),re.windowResizer.unsubscribe(e(this,S)),e(this,a).close(),e(this,v).close(),e(this,w).close(),e(this,C).close(),e(this,x).close(),e(this,m).close(),e(this,R).close(),e(this,q).close(),e(this,L).close(),this.removeAttribute("role"),clearTimeout(e(this,$)),clearTimeout(e(this,M)),clearTimeout(e(this,A)),clearTimeout(e(this,B)),removeEventListener("popstate",e(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)}};f=new WeakMap,$=new WeakMap,M=new WeakMap,A=new WeakMap,B=new WeakMap,v=new WeakMap,w=new WeakMap,C=new WeakMap,x=new WeakMap,m=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}`},F=function(){if(e(this,v).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},V=new WeakMap,S=new WeakMap,W=new WeakMap,G=new WeakMap,E.stack=new le;let z=E;_.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",z);var h,d,k,Q,D,N,U,j,Z;class ne extends HTMLElement{constructor(){super();r(this,k);r(this,h);r(this,d,new g.CSSProperty(this,"--type","open"));r(this,D,()=>{e(this,d).current!=="close"&&this.classList.add("triggered")});r(this,N,()=>{e(this,d).current!=="close"&&(this.classList.add("opened"),this.setAttribute("aria-expanded","true"))});r(this,U,()=>{e(this,d).current!=="close"&&this.classList.remove("opened")});r(this,j,()=>{e(this,d).current!=="close"&&(this.classList.remove("triggered"),this.setAttribute("aria-expanded","false"))});_.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(y(this,k,Q).call(this),t){let i=null;if(t==="parent"){const c=this.closest("[data-popover]");if(c)i=c;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 c=p=>{if(!p)return null;let H=p.querySelector("[data-popover]");return!H&&(p!=null&&p.parentElement)&&(H=c(p.parentElement)),H};i=c(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,N)),e(this,h).addEventListener("popoverClosing",e(this,U)),e(this,h).addEventListener("popoverClosed",e(this,j))):console.warn(this,`target ${t} not found`)}y(this,k,Z).call(this,e(this,d).current)}connectedCallback(){e(this,d).subscribe(s=>{y(this,k,Z).call(this,s.current)}),this.hasAttribute("tabindex")||(this.tabIndex=0),this.hasAttribute("role")||this.setAttribute("role","button");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"),this.removeAttribute("role"),this.removeAttribute("tabindex"),y(this,k,Q).call(this)}}h=new WeakMap,d=new WeakMap,k=new WeakSet,Q=function(){e(this,h)&&(e(this,h).removeEventListener("popoverTriggered",e(this,D)),e(this,h).removeEventListener("popoverOpened",e(this,N)),e(this,h).removeEventListener("popoverClosing",e(this,U)),e(this,h).removeEventListener("popoverClosed",e(this,j)))},D=new WeakMap,N=new WeakMap,U=new WeakMap,j=new WeakMap,Z=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")))};_.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),y=(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"),_=require("../index-DekP7OZe.cjs"),Y=require("../events-KVanG9sR.cjs"),ce=require("../function-MthRj-GJ.cjs"),se=require("../style-At6aDoqG.cjs");require("construct-style-sheets-polyfill");const ie=require("../url-lnBE_6yf.cjs"),re=require("../window-resizer/index.cjs"),F=require("../Viewport-DB0qAZPJ.cjs");var u,b,J,K;class le{constructor(){r(this,u,new Map);r(this,b,[]);r(this,J,o=>{var s;const t=[...e(this,b)].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,b)].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,b)}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,b).push(t),s.push(t)}remove(o,t){if(n(this,b,e(this,b).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,b=new WeakMap,J=new WeakMap,K=new WeakMap;var f,$,M,C,B,v,w,A,x,g,R,q,L,T,O,a,P,oe,I,V,S,W,G;const E=class E extends HTMLElement{constructor(){super();r(this,P);r(this,f);r(this,$);r(this,M);r(this,C);r(this,B);r(this,v);r(this,w);r(this,A);r(this,x);r(this,g);r(this,R);r(this,q);r(this,L);r(this,T);r(this,O);r(this,a);r(this,V);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,A,new m.CSSProperty(this,"--close-rest",!1)),n(this,x,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,V,()=>{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 openClass(){return this.getAttribute("data-open-global-class")}get history(){return e(this,v)}get restore(){return e(this,w)}get closeRest(){return e(this,A)}get closeRestInGroup(){return e(this,x)}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,$)),clearTimeout(e(this,M)),this.openClass&&this.openClass.split(" ").map(i=>{document.documentElement.classList.add(i.trim())}),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)},bubbles:!0}),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),y(this,P,I).call(this),this.openClass&&this.openClass.split(" ").map(t=>{document.documentElement.classList.remove(t.trim())}),e(this,a).set("transitionend",!1),n(this,$,setTimeout(()=>{e(this,a).set("opened",!1),e(this,a).set("closing",!0),Y.dispatchEvent(this,"popoverClosing",{custom:!0,bubbles:!0}),n(this,M,setTimeout(()=>{e(this,a).set("triggered",!1),e(this,a).set("closing",!1),Y.dispatchEvent(this,"popoverClosed",{custom:!0,bubbles:!0})},se.getElementTransitionDurationMS(this)+10))},10)))}connectedCallback(){e(this,v).observe(),e(this,w).observe(),e(this,A).observe(),e(this,x).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,V)),setTimeout(()=>{e(this,w).current?(this.urlValue=ie.parseSearchParameters(location.search)[this.id],e(this,V).call(this)):(y(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,A).close(),e(this,x).close(),e(this,g).close(),e(this,R).close(),e(this,q).close(),e(this,L).close(),this.removeAttribute("role"),clearTimeout(e(this,$)),clearTimeout(e(this,M)),clearTimeout(e(this,C)),clearTimeout(e(this,B)),removeEventListener("popstate",e(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,I).call(this)}};f=new WeakMap,$=new WeakMap,M=new WeakMap,C=new WeakMap,B=new WeakMap,v=new WeakMap,w=new WeakMap,A=new WeakMap,x=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)}},V=new WeakMap,S=new WeakMap,W=new WeakMap,G=new WeakMap,E.stack=new le;let z=E;_.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",z);var h,d,k,Z,D,U,j,X,N;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"))});_.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(y(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`)}y(this,k,N).call(this,e(this,d).current)}connectedCallback(){e(this,d).subscribe(s=>{y(this,k,N).call(this,s.current)}),this.hasAttribute("tabindex")||(this.tabIndex=0),this.hasAttribute("role")||this.setAttribute("role","button");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"),this.removeAttribute("role"),this.removeAttribute("tabindex"),y(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,N=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")))};_.isBrowser&&!customElements.get("e-popover-button")&&customElements.define("e-popover-button",ne);exports.PopoverButtonElement=ne;exports.PopoverElement=z;
@@ -1,24 +1,24 @@
1
- var et = (a) => {
2
- throw TypeError(a);
1
+ var et = (c) => {
2
+ throw TypeError(c);
3
3
  };
4
- var K = (a, o, e) => o.has(a) || et("Cannot " + e);
5
- var t = (a, o, e) => (K(a, o, "read from private field"), e ? e.call(a) : o.get(a)), r = (a, o, e) => o.has(a) ? et("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(a) : o.set(a, e), h = (a, o, e, s) => (K(a, o, "write to private field"), s ? s.call(a, e) : o.set(a, e), e), y = (a, o, e) => (K(a, o, "access private method"), e);
4
+ var Q = (c, o, e) => o.has(c) || et("Cannot " + e);
5
+ var t = (c, o, e) => (Q(c, o, "read from private field"), e ? e.call(c) : o.get(c)), r = (c, o, e) => o.has(c) ? et("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(c) : o.set(c, e), h = (c, o, e, s) => (Q(c, o, "write to private field"), s ? s.call(c, e) : o.set(c, e), e), y = (c, o, e) => (Q(c, o, "access private method"), e);
6
6
  import { ElementLinkedStore as ot } from "../element-linked-store/index.js";
7
- import { CSSProperty as g } from "../css-property/index.js";
7
+ import { CSSProperty as v } from "../css-property/index.js";
8
8
  import { i as _ } from "../index-Bv9zgfdb.js";
9
- import { d as X } from "../events-CsVF98U6.js";
9
+ import { d as Y } from "../events-CsVF98U6.js";
10
10
  import { d as ht } from "../function-C10DGppn.js";
11
11
  import { g as st } from "../style-j2TwriJ_.js";
12
12
  import "construct-style-sheets-polyfill";
13
13
  import { u as nt, p as ct } from "../url-Cc-RVfii.js";
14
14
  import { windowResizer as it } from "../window-resizer/index.js";
15
- import { v as Y } from "../Viewport-DA10iWAO.js";
16
- var u, b, I, J;
17
- class at {
15
+ import { v as j } from "../Viewport-DA10iWAO.js";
16
+ var u, b, J, K;
17
+ class lt {
18
18
  constructor() {
19
19
  r(this, u, /* @__PURE__ */ new Map());
20
20
  r(this, b, []);
21
- r(this, I, (o) => {
21
+ r(this, J, (o) => {
22
22
  var s;
23
23
  const e = [...t(this, b)].reverse().find((i) => i.clickOutside.current);
24
24
  if (e) {
@@ -27,11 +27,11 @@ class at {
27
27
  (tt) => tt instanceof HTMLElement && tt.hasAttribute("data-popover-content")
28
28
  ))
29
29
  return;
30
- const c = i[0], p = c instanceof Node && (e.contains(c) || ((s = e.shadowRoot) == null ? void 0 : s.contains(c))), G = c instanceof HTMLElement && c.hasAttribute("data-outside");
30
+ const l = i[0], p = l instanceof Node && (e.contains(l) || ((s = e.shadowRoot) == null ? void 0 : s.contains(l))), G = l instanceof HTMLElement && l.hasAttribute("data-outside");
31
31
  (!p || G) && e.close();
32
32
  }
33
33
  });
34
- r(this, J, (o) => {
34
+ r(this, K, (o) => {
35
35
  if (o.code === "Escape") {
36
36
  const e = [...t(this, b)].reverse().find((s) => s.escape.current);
37
37
  e && e.close();
@@ -39,8 +39,8 @@ class at {
39
39
  });
40
40
  document.documentElement.addEventListener(
41
41
  "click",
42
- t(this, I)
43
- ), addEventListener("keydown", t(this, J));
42
+ t(this, J)
43
+ ), addEventListener("keydown", t(this, K));
44
44
  }
45
45
  get groups() {
46
46
  return t(this, u);
@@ -51,14 +51,14 @@ class at {
51
51
  add(o, e) {
52
52
  if (e.closeRest.current)
53
53
  t(this, u).forEach((i) => {
54
- i.forEach((c) => {
55
- c.close();
54
+ i.forEach((l) => {
55
+ l.close();
56
56
  });
57
57
  });
58
58
  else if (e.closeRestInGroup.current) {
59
59
  let i = t(this, u).get(o);
60
- i == null || i.forEach((c) => {
61
- c.close();
60
+ i == null || i.forEach((l) => {
61
+ l.close();
62
62
  });
63
63
  }
64
64
  let s = t(this, u).get(o);
@@ -68,7 +68,7 @@ class at {
68
68
  if (h(this, b, t(this, b).filter((s) => s !== e)), e.closeRest.current) {
69
69
  let s = [];
70
70
  t(this, u).forEach((i) => {
71
- i.forEach((c) => s.push(c));
71
+ i.forEach((l) => s.push(l));
72
72
  }), t(this, u).clear(), s.forEach((i) => i.close());
73
73
  } else if (e.closeRestInGroup.current) {
74
74
  const s = t(this, u).get(o);
@@ -81,8 +81,8 @@ class at {
81
81
  }
82
82
  }
83
83
  }
84
- u = new WeakMap(), b = new WeakMap(), I = new WeakMap(), J = new WeakMap();
85
- var f, M, H, x, W, m, w, S, C, v, R, $, L, T, O, l, A, rt, j, V, k, q, z;
84
+ u = new WeakMap(), b = new WeakMap(), J = new WeakMap(), K = new WeakMap();
85
+ var f, M, H, C, W, m, w, x, S, g, R, $, L, T, O, a, A, rt, F, V, k, q, z;
86
86
  const E = class E extends HTMLElement {
87
87
  constructor() {
88
88
  super();
@@ -90,28 +90,28 @@ const E = class E extends HTMLElement {
90
90
  r(this, f);
91
91
  r(this, M);
92
92
  r(this, H);
93
- r(this, x);
93
+ r(this, C);
94
94
  r(this, W);
95
95
  r(this, m);
96
96
  r(this, w);
97
+ r(this, x);
97
98
  r(this, S);
98
- r(this, C);
99
- r(this, v);
99
+ r(this, g);
100
100
  r(this, R);
101
101
  r(this, $);
102
102
  r(this, L);
103
103
  r(this, T);
104
104
  r(this, O);
105
- r(this, l);
105
+ r(this, a);
106
106
  r(this, V);
107
107
  r(this, k);
108
108
  r(this, q);
109
109
  r(this, z);
110
- this.urlValue = "", h(this, f, !1), h(this, m, new g(this, "--history", !1)), h(this, w, new g(this, "--restore", !1)), h(this, S, new g(this, "--close-rest", !1)), h(this, C, new g(
110
+ this.urlValue = "", h(this, f, !1), h(this, m, new v(this, "--history", !1)), h(this, w, new v(this, "--restore", !1)), h(this, x, new v(this, "--close-rest", !1)), h(this, S, new v(
111
111
  this,
112
112
  "--close-rest-in-group",
113
113
  !1
114
- )), h(this, v, new g(this, "--group", "")), h(this, R, new g(this, "--click-outside", !1)), h(this, $, new g(this, "--escape", !1)), h(this, L, new g(this, "--check-viewport-bounds", !1)), h(this, T, !1), h(this, l, new ot(this, {
114
+ )), h(this, g, new v(this, "--group", "")), h(this, R, new v(this, "--click-outside", !1)), h(this, $, new v(this, "--escape", !1)), h(this, L, new v(this, "--check-viewport-bounds", !1)), h(this, T, !1), h(this, a, new ot(this, {
115
115
  opened: !1,
116
116
  closing: !1,
117
117
  triggered: !1,
@@ -126,21 +126,21 @@ const E = class E extends HTMLElement {
126
126
  if (this.style.setProperty("--content-width", this.scrollWidth + "px"), this.style.setProperty("--content-height", this.scrollHeight + "px"), t(this, L).current) {
127
127
  const e = this.getBoundingClientRect();
128
128
  let s = 0, i = 0;
129
- e.right > Y.width ? s = Y.width - e.right : e.left < 0 && (s = e.left * -1), e.bottom > Y.height ? i = Y.height - e.bottom : e.top < 0 && (i = e.top * -1), this.style.setProperty("--viewport-offset-x", s + "px"), this.style.setProperty("--viewport-offset-y", i + "px");
129
+ e.right > j.width ? s = j.width - e.right : e.left < 0 && (s = e.left * -1), e.bottom > j.height ? i = j.height - e.bottom : e.top < 0 && (i = e.top * -1), this.style.setProperty("--viewport-offset-x", s + "px"), this.style.setProperty("--viewport-offset-y", i + "px");
130
130
  }
131
- }), t(this, v).subscribe((e) => {
131
+ }), t(this, g).subscribe((e) => {
132
132
  e.previous && (E.stack.remove(e.previous, this), e.current || (document.documentElement.classList.remove(
133
133
  `${this.group.previous}-closing`
134
134
  ), document.documentElement.classList.remove(
135
135
  `${this.group.previous}-opened`
136
136
  )));
137
- }), t(this, l).subscribe((e) => {
137
+ }), t(this, a).subscribe((e) => {
138
138
  if (this.group.current) {
139
139
  document.documentElement.classList.toggle(
140
140
  `${this.group.current}-closing`,
141
141
  e.current.closing
142
142
  );
143
- const s = E.stack.groups.get(this.group.current), i = s == null ? void 0 : s.find((c) => c.opened);
143
+ const s = E.stack.groups.get(this.group.current), i = s == null ? void 0 : s.find((l) => l.opened);
144
144
  document.documentElement.classList.toggle(
145
145
  `${this.group.current}-opened`,
146
146
  !!i
@@ -148,6 +148,9 @@ const E = class E extends HTMLElement {
148
148
  }
149
149
  });
150
150
  }
151
+ get openClass() {
152
+ return this.getAttribute("data-open-global-class");
153
+ }
151
154
  get history() {
152
155
  return t(this, m);
153
156
  }
@@ -155,13 +158,13 @@ const E = class E extends HTMLElement {
155
158
  return t(this, w);
156
159
  }
157
160
  get closeRest() {
158
- return t(this, S);
161
+ return t(this, x);
159
162
  }
160
163
  get closeRestInGroup() {
161
- return t(this, C);
164
+ return t(this, S);
162
165
  }
163
166
  get group() {
164
- return t(this, v);
167
+ return t(this, g);
165
168
  }
166
169
  get clickOutside() {
167
170
  return t(this, R);
@@ -184,77 +187,80 @@ const E = class E extends HTMLElement {
184
187
  open(e) {
185
188
  if (t(this, f))
186
189
  return;
187
- h(this, O, e == null ? void 0 : e.trigger), clearTimeout(t(this, M)), clearTimeout(t(this, H)), this.hasAttribute("data-document-class") && this.getAttribute("data-document-class").split(" ").map((c) => {
188
- document.documentElement.classList.add(c.trim());
189
- }), t(this, l).set("closing", !1), t(this, l).set("triggered", !0), X(this, "popoverTriggered", {
190
+ h(this, O, e == null ? void 0 : e.trigger), clearTimeout(t(this, M)), clearTimeout(t(this, H)), this.openClass && this.openClass.split(" ").map((i) => {
191
+ document.documentElement.classList.add(i.trim());
192
+ }), t(this, a).set("closing", !1), t(this, a).set("triggered", !0), Y(this, "popoverTriggered", {
190
193
  custom: !0,
191
194
  detail: {
192
195
  trigger: t(this, O)
193
196
  }
194
197
  }), t(this, m).current && t(this, T) && history.pushState(history.state, "", t(this, A, rt)), h(this, f, !0);
195
198
  const s = () => {
196
- E.stack.add(t(this, v).current, this), t(this, k).call(this), t(this, l).set("opened", !0), X(this, "popoverOpened", {
199
+ E.stack.add(t(this, g).current, this), t(this, k).call(this), t(this, a).set("opened", !0), Y(this, "popoverOpened", {
197
200
  custom: !0,
198
201
  detail: {
199
202
  trigger: t(this, O)
200
- }
201
- }), h(this, x, void 0), h(this, W, setTimeout(() => {
202
- t(this, l).set("transitionend", !0);
203
+ },
204
+ bubbles: !0
205
+ }), h(this, C, void 0), h(this, W, setTimeout(() => {
206
+ t(this, a).set("transitionend", !0);
203
207
  }, st(this) + 10));
204
208
  };
205
- e != null && e.skipTransition ? s() : h(this, x, setTimeout(s, 10));
209
+ e != null && e.skipTransition ? s() : h(this, C, setTimeout(s, 10));
206
210
  }
207
211
  close() {
208
- t(this, f) && (clearTimeout(t(this, x)), clearTimeout(t(this, W)), E.stack.remove(t(this, v).current, this), h(this, f, !1), y(this, A, j).call(this), this.hasAttribute("data-document-class") && this.getAttribute("data-document-class").split(" ").map((s) => {
209
- document.documentElement.classList.remove(s.trim());
210
- }), t(this, l).set("transitionend", !1), h(this, M, setTimeout(() => {
211
- t(this, l).set("opened", !1), t(this, l).set("closing", !0), X(this, "popoverClosing", {
212
- custom: !0
212
+ t(this, f) && (clearTimeout(t(this, C)), clearTimeout(t(this, W)), E.stack.remove(t(this, g).current, this), h(this, f, !1), y(this, A, F).call(this), this.openClass && this.openClass.split(" ").map((e) => {
213
+ document.documentElement.classList.remove(e.trim());
214
+ }), t(this, a).set("transitionend", !1), h(this, M, setTimeout(() => {
215
+ t(this, a).set("opened", !1), t(this, a).set("closing", !0), Y(this, "popoverClosing", {
216
+ custom: !0,
217
+ bubbles: !0
213
218
  }), h(this, H, setTimeout(() => {
214
- t(this, l).set("triggered", !1), t(this, l).set("closing", !1), X(this, "popoverClosed", {
215
- custom: !0
219
+ t(this, a).set("triggered", !1), t(this, a).set("closing", !1), Y(this, "popoverClosed", {
220
+ custom: !0,
221
+ bubbles: !0
216
222
  });
217
223
  }, st(this) + 10));
218
224
  }, 10)));
219
225
  }
220
226
  connectedCallback() {
221
- t(this, m).observe(), t(this, w).observe(), t(this, S).observe(), t(this, C).observe(), t(this, v).observe(), t(this, R).observe(), t(this, $).observe(), t(this, L).observe(), this.setAttribute("role", "dialog"), addEventListener("popstate", t(this, V)), setTimeout(() => {
222
- t(this, w).current ? (this.urlValue = ct(location.search)[this.id], t(this, V).call(this)) : (y(this, A, j).call(this), h(this, T, !0));
227
+ t(this, m).observe(), t(this, w).observe(), t(this, x).observe(), t(this, S).observe(), t(this, g).observe(), t(this, R).observe(), t(this, $).observe(), t(this, L).observe(), this.setAttribute("role", "dialog"), addEventListener("popstate", t(this, V)), setTimeout(() => {
228
+ t(this, w).current ? (this.urlValue = ct(location.search)[this.id], t(this, V).call(this)) : (y(this, A, F).call(this), h(this, T, !0));
223
229
  }, 0), t(this, L).subscribe(() => {
224
230
  t(this, k).call(this);
225
231
  }), it.subscribe(t(this, k));
226
232
  }
227
233
  disconnectedCallback() {
228
- E.stack.remove(t(this, v).current, this), it.unsubscribe(t(this, k)), t(this, l).close(), t(this, m).close(), t(this, w).close(), t(this, S).close(), t(this, C).close(), t(this, v).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, A, j).call(this);
234
+ 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, x).close(), t(this, S).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, C)), 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, A, F).call(this);
229
235
  }
230
236
  };
231
- 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(), v = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), L = new WeakMap(), T = new WeakMap(), O = new WeakMap(), l = new WeakMap(), A = new WeakSet(), rt = function() {
237
+ f = new WeakMap(), M = new WeakMap(), H = new WeakMap(), C = new WeakMap(), W = new WeakMap(), m = new WeakMap(), w = new WeakMap(), x = new WeakMap(), S = new WeakMap(), g = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), L = new WeakMap(), T = new WeakMap(), O = new WeakMap(), a = new WeakMap(), A = new WeakSet(), rt = function() {
232
238
  return `${location.pathname}${location.search ? location.search + "&" : "?"}${this.idWithValue}`;
233
- }, j = function() {
239
+ }, F = function() {
234
240
  if (t(this, m).current) {
235
241
  const e = new URL(location.href);
236
242
  e.searchParams.delete(this.id), history.replaceState(history.state, "", e.href);
237
243
  }
238
- }, V = new WeakMap(), k = new WeakMap(), q = new WeakMap(), z = new WeakMap(), E.stack = new at();
239
- let F = E;
240
- _ && !customElements.get("e-popover") && customElements.define("e-popover", F);
241
- var n, d, P, Q, B, N, D, U, Z;
242
- class lt extends HTMLElement {
244
+ }, V = new WeakMap(), k = new WeakMap(), q = new WeakMap(), z = new WeakMap(), E.stack = new lt();
245
+ let I = E;
246
+ _ && !customElements.get("e-popover") && customElements.define("e-popover", I);
247
+ var n, d, P, Z, B, D, U, X, N;
248
+ class at extends HTMLElement {
243
249
  constructor() {
244
250
  super();
245
251
  r(this, P);
246
252
  r(this, n);
247
- r(this, d, new g(this, "--type", "open"));
253
+ r(this, d, new v(this, "--type", "open"));
248
254
  r(this, B, () => {
249
255
  t(this, d).current !== "close" && this.classList.add("triggered");
250
256
  });
251
- r(this, N, () => {
257
+ r(this, D, () => {
252
258
  t(this, d).current !== "close" && (this.classList.add("opened"), this.setAttribute("aria-expanded", "true"));
253
259
  });
254
- r(this, D, () => {
260
+ r(this, U, () => {
255
261
  t(this, d).current !== "close" && this.classList.remove("opened");
256
262
  });
257
- r(this, U, () => {
263
+ r(this, X, () => {
258
264
  t(this, d).current !== "close" && (this.classList.remove("triggered"), this.setAttribute("aria-expanded", "false"));
259
265
  });
260
266
  _ && (this.addEventListener("click", () => {
@@ -274,12 +280,12 @@ class lt extends HTMLElement {
274
280
  }
275
281
  changePopover(e) {
276
282
  var s;
277
- if (y(this, P, Q).call(this), e) {
283
+ if (y(this, P, Z).call(this), e) {
278
284
  let i = null;
279
285
  if (e === "parent") {
280
- const c = this.closest("[data-popover]");
281
- if (c)
282
- i = c;
286
+ const l = this.closest("[data-popover]");
287
+ if (l)
288
+ i = l;
283
289
  else {
284
290
  const p = this.getRootNode();
285
291
  p instanceof ShadowRoot ? i = p.host.closest("[data-popover]") : p instanceof HTMLElement && (i = p.closest("[data-popover]"));
@@ -287,13 +293,13 @@ class lt extends HTMLElement {
287
293
  } else if (e === "sibling")
288
294
  i = (s = this.parentElement) == null ? void 0 : s.querySelector("[data-popover]");
289
295
  else if (e === "ancestor-child") {
290
- const c = (p) => {
296
+ const l = (p) => {
291
297
  if (!p)
292
298
  return null;
293
299
  let G = p.querySelector("[data-popover]");
294
- return !G && (p != null && p.parentElement) && (G = c(p.parentElement)), G;
300
+ return !G && (p != null && p.parentElement) && (G = l(p.parentElement)), G;
295
301
  };
296
- i = c(this.parentElement) || null;
302
+ i = l(this.parentElement) || null;
297
303
  } else
298
304
  !e.startsWith(".") && !e.startsWith("[") && (e = `#${e}`), i = document.querySelector(e) || this.getRootNode().querySelector(e);
299
305
  i instanceof HTMLElement ? (h(this, n, i), t(this, n).addEventListener(
@@ -301,50 +307,50 @@ class lt extends HTMLElement {
301
307
  t(this, B)
302
308
  ), t(this, n).addEventListener(
303
309
  "popoverOpened",
304
- t(this, N)
310
+ t(this, D)
305
311
  ), t(this, n).addEventListener(
306
312
  "popoverClosing",
307
- t(this, D)
313
+ t(this, U)
308
314
  ), t(this, n).addEventListener(
309
315
  "popoverClosed",
310
- t(this, U)
316
+ t(this, X)
311
317
  )) : console.warn(this, `target ${e} not found`);
312
318
  }
313
- y(this, P, Z).call(this, t(this, d).current);
319
+ y(this, P, N).call(this, t(this, d).current);
314
320
  }
315
321
  connectedCallback() {
316
322
  t(this, d).subscribe((s) => {
317
- y(this, P, Z).call(this, s.current);
323
+ y(this, P, N).call(this, s.current);
318
324
  }), this.hasAttribute("tabindex") || (this.tabIndex = 0), this.hasAttribute("role") || this.setAttribute("role", "button");
319
325
  const e = this.getAttribute("target");
320
326
  e && this.changePopover(e), this.isConnected && t(this, d).observe();
321
327
  }
322
328
  disconnectedCallback() {
323
- t(this, d).unobserve(), this.removeAttribute("aria-haspopup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls"), this.removeAttribute("role"), this.removeAttribute("tabindex"), y(this, P, Q).call(this);
329
+ t(this, d).unobserve(), this.removeAttribute("aria-haspopup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls"), this.removeAttribute("role"), this.removeAttribute("tabindex"), y(this, P, Z).call(this);
324
330
  }
325
331
  }
326
- n = new WeakMap(), d = new WeakMap(), P = new WeakSet(), Q = function() {
332
+ n = new WeakMap(), d = new WeakMap(), P = new WeakSet(), Z = function() {
327
333
  t(this, n) && (t(this, n).removeEventListener(
328
334
  "popoverTriggered",
329
335
  t(this, B)
330
336
  ), t(this, n).removeEventListener(
331
337
  "popoverOpened",
332
- t(this, N)
338
+ t(this, D)
333
339
  ), t(this, n).removeEventListener(
334
340
  "popoverClosing",
335
- t(this, D)
341
+ t(this, U)
336
342
  ), t(this, n).removeEventListener(
337
343
  "popoverClosed",
338
- t(this, U)
344
+ t(this, X)
339
345
  ));
340
- }, B = new WeakMap(), N = new WeakMap(), D = new WeakMap(), U = new WeakMap(), Z = function(e) {
341
- t(this, n) instanceof F && (e !== "close" ? (this.setAttribute("aria-haspopup", "true"), this.setAttribute(
346
+ }, B = new WeakMap(), D = new WeakMap(), U = new WeakMap(), X = new WeakMap(), N = function(e) {
347
+ t(this, n) instanceof I && (e !== "close" ? (this.setAttribute("aria-haspopup", "true"), this.setAttribute(
342
348
  "aria-expanded",
343
349
  t(this, n).opened ? "true" : "false"
344
350
  ), this.setAttribute("aria-controls", t(this, n).id || "")) : (this.removeAttribute("aria-haspopup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls")));
345
351
  };
346
- _ && !customElements.get("e-popover-button") && customElements.define("e-popover-button", lt);
352
+ _ && !customElements.get("e-popover-button") && customElements.define("e-popover-button", at);
347
353
  export {
348
- lt as PopoverButtonElement,
349
- F as PopoverElement
354
+ at as PopoverButtonElement,
355
+ I as PopoverElement
350
356
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.66.0",
3
+ "version": "0.66.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"