aptechka 0.7.9 → 0.7.11

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 rt=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n);var Q=(n,t,i)=>{if(!t.has(n))throw TypeError("Cannot "+i)};var e=(n,t,i)=>(Q(n,t,"read from private field"),i?i.call(n):t.get(n)),r=(n,t,i)=>{if(t.has(n))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(n):t.set(n,i)},c=(n,t,i,a)=>(Q(n,t,"write to private field"),a?a.call(n,i):t.set(n,i),i);var f=(n,t,i)=>(Q(n,t,"access private method"),i);var T=(n,t,i)=>new Promise((a,s)=>{var l=u=>{try{d(i.next(u))}catch(m){s(m)}},g=u=>{try{d(i.throw(u))}catch(m){s(m)}},d=u=>u.done?a(u.value):Promise.resolve(u.value).then(l,g);d((i=i.apply(n,t)).next())});var at=(n,t,i)=>(t=n[rt("asyncIterator")])?t.call(n):(n=n[rt("iterator")](),t={},i=(a,s)=>(s=n[a])&&(t[a]=l=>new Promise((g,d,u)=>(l=s.call(n,l),u=l.done,Promise.resolve(l.value).then(m=>g({value:m,done:u}),d)))),i("next"),i("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ht=require("../notifier/index.cjs"),dt=require("../browser-CpzFX2xg.cjs"),U=require("../url-C3dWnJQg.cjs");var w,o,p,k,P,C,A;class mt{constructor(t,i){r(this,w,void 0);r(this,o,void 0);r(this,p,void 0);r(this,k,void 0);r(this,P,void 0);r(this,C,t=>{t.preventDefault(),e(this,w).links.forEach(i=>{var a;e(this,p)===e(i,p)||(a=e(i,P))!=null&&a.includes(e(this,p))?e(i,o).classList.add("clicked"):e(i,o).classList.remove("clicked")}),e(this,w).navigate(e(this,p),e(this,k))});r(this,A,()=>{e(this,w).prefetch(e(this,p)),e(this,o).removeEventListener("pointerenter",e(this,A))});var l,g;c(this,w,i),c(this,o,t),c(this,p,e(this,o).getAttribute("href")||"/"),c(this,k,e(this,o).getAttribute("data-history-action")||"push"),e(this,o).addEventListener("click",e(this,C));const a=i.normalizePath(e(this,p)),s=i.normalizePath(location.pathname);c(this,P,(l=e(this,o).getAttribute("data-match-paths"))==null?void 0:l.split(",").map(d=>i.normalizePath(d.trim()).pathname)),e(this,o).hasAttribute("data-include")?s.pathname.includes(a.pathname)&&e(this,o).classList.add("current"):a.pathname===s.pathname||(g=e(this,P))!=null&&g.includes(s.pathname)?(e(this,o).classList.add("current"),e(this,o).classList.add("clicked")):e(this,o).classList.remove("clicked"),e(this,o).hasAttribute("data-prefetch")&&e(this,o).addEventListener("pointerenter",e(this,A))}destroy(){e(this,o).removeEventListener("click",e(this,C)),e(this,o).removeEventListener("pointerenter",e(this,A)),e(this,o).classList.remove("current")}}w=new WeakMap,o=new WeakMap,p=new WeakMap,k=new WeakMap,P=new WeakMap,C=new WeakMap,A=new WeakMap;var M,S,z,q,H,j,y,L,b,x,D,R,V,F,X,I,Z,K,ot,O,$,Y;class ft{constructor(t){r(this,R);r(this,F);r(this,I);r(this,K);r(this,O);r(this,M,null);r(this,S,null);r(this,z,null);r(this,q,null);r(this,H,[]);r(this,j,new DOMParser);r(this,y,new Map);r(this,L,void 0);r(this,b,null);r(this,x,new ht.Notifier);r(this,D,new ht.Notifier);r(this,Y,t=>{t.state&&this.navigate(t.state,"none")});dt.isBrowser&&(t!=null&&t.base?c(this,M,U.normalizeBase(t.base)):c(this,M,"/"),c(this,S,(t==null?void 0:t.waitForHeadToLoad)!==!1),c(this,z,(t==null?void 0:t.cachePages)!==!1),c(this,q,f(this,I,Z).call(this,document.body)),c(this,b,this.normalizePath(location.pathname).pathname),document.documentElement.setAttribute("data-current-pathname",e(this,b)),f(this,F,X).call(this),addEventListener("popstate",e(this,Y)))}get currentPathname(){return e(this,b)}get links(){return e(this,H)}normalizePath(t){return U.splitPath(t,e(this,M))}beforeNavigationEvent(t){return e(this,x).subscribe(t)}afterNavigationEvent(t){return e(this,D).subscribe(t)}prefetch(t){return T(this,null,function*(){const i=this.normalizePath(t);return f(this,R,V).call(this,i.pathname)})}navigate(t,i="push"){return T(this,null,function*(){var u;const a=this.normalizePath(t);let{pathname:s,hash:l,parameters:g}=a;if(e(this,L)===s||e(this,b)===s)return;c(this,L,s);const d=e(this,y).has(s);try{let m=!0;if(e(this,x).notify({pathname:s,isCached:d}),this.preprocessor)try{yield new Promise((h,E)=>{var v;(v=this.preprocessor)==null||v.call(this,{pathname:s,resolve:h,reject:E,isCached:d})})}catch(h){h?console.error(h):console.log("Route change canceled"),m=!1}if(!m||e(this,L)!==s)return;const tt=e(this,y).get(s)||(yield f(this,R,V).call(this,s));if(e(this,L)!==s)return;const et=Array.from(document.head.children),it=Array.from(tt.head.cloneNode(!0).children),st=f(this,K,ot).call(this,et,it),ct=f(this,O,$).call(this,et,st),B=f(this,O,$).call(this,it,st);B.forEach((h,E)=>{if(h.tagName==="SCRIPT"&&h.getAttribute("src")){const v=document.createElement("script");v.type="module",v.src=h.getAttribute("src"),B[E]=v}}),B.forEach(h=>{document.head.appendChild(h)});const _=B.filter(h=>h.tagName==="STYLE"||h.tagName==="SCRIPT"||h.tagName==="LINK");e(this,S)&&_.length&&(yield new Promise(h=>T(this,null,function*(){let E=0;try{for(var v=at(_),ut,G,W;ut=!(G=yield v.next()).done;ut=!1){const N=G.value;N.onload=()=>{E++,E===_.length&&h()}}}catch(G){W=[G]}finally{try{ut&&(G=v.return)&&(yield G.call(v))}finally{if(W)throw W[0]}}}))),ct.forEach(h=>{h.hasAttribute("data-permanent")||h.remove()}),c(this,b,s),U.changeHistory(i,s,g,l);const lt=f(this,I,Z).call(this,tt.body.cloneNode(!0));e(this,q).forEach((h,E)=>{const v=lt[E];let ut=[...h.childNodes],G=[...v.childNodes];ut.forEach(W=>{if(W instanceof HTMLElement){const N=W.getAttribute("data-remain");let nt;G=G.filter(J=>J instanceof HTMLElement&&N&&J.getAttribute("data-remain")===N?(nt=J,!1):!0),N&&nt||W.remove()}else W.remove()}),h.append(...G)}),f(this,F,X).call(this),document.documentElement.setAttribute("data-current-pathname",s),(u=this.postprocessor)==null||u.call(this,{pathname:s,isCached:d}),e(this,D).notify({pathname:s,isCached:d})}catch(m){console.error(m)}c(this,L,void 0)})}}M=new WeakMap,S=new WeakMap,z=new WeakMap,q=new WeakMap,H=new WeakMap,j=new WeakMap,y=new WeakMap,L=new WeakMap,b=new WeakMap,x=new WeakMap,D=new WeakMap,R=new WeakSet,V=function(t){return T(this,null,function*(){const i=e(this,y).get(t);if(i)return i;const s=yield(yield fetch(t)).text(),l=e(this,j).parseFromString(s,"text/html");return e(this,z)&&e(this,y).set(t,l),l})},F=new WeakSet,X=function(){const t=[...document.documentElement.querySelectorAll("a")].filter(i=>{var a;return(a=i.getAttribute("href"))==null?void 0:a.startsWith("/")});e(this,H).forEach(i=>i.destroy()),c(this,H,t.map(i=>new mt(i,this)))},I=new WeakSet,Z=function(t){return[...t.querySelectorAll("[data-morph]")]},K=new WeakSet,ot=function(t,i){return t.filter(a=>i.find(s=>s.outerHTML===a.outerHTML))},O=new WeakSet,$=function(t,i){return t.filter(a=>!i.find(s=>s.outerHTML===a.outerHTML))},Y=new WeakMap;exports.Morph=ft;
1
+ "use strict";var at=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n);var U=(n,t,i)=>{if(!t.has(n))throw TypeError("Cannot "+i)};var e=(n,t,i)=>(U(n,t,"read from private field"),i?i.call(n):t.get(n)),r=(n,t,i)=>{if(t.has(n))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(n):t.set(n,i)},c=(n,t,i,a)=>(U(n,t,"write to private field"),a?a.call(n,i):t.set(n,i),i);var d=(n,t,i)=>(U(n,t,"access private method"),i);var T=(n,t,i)=>new Promise((a,s)=>{var u=l=>{try{f(i.next(l))}catch(g){s(g)}},p=l=>{try{f(i.throw(l))}catch(g){s(g)}},f=l=>l.done?a(l.value):Promise.resolve(l.value).then(u,p);f((i=i.apply(n,t)).next())});var ot=(n,t,i)=>(t=n[at("asyncIterator")])?t.call(n):(n=n[at("iterator")](),t={},i=(a,s)=>(s=n[a])&&(t[a]=u=>new Promise((p,f,l)=>(u=s.call(n,u),l=u.done,Promise.resolve(u.value).then(g=>p({value:g,done:l}),f)))),i("next"),i("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ht=require("../notifier/index.cjs"),mt=require("../browser-CpzFX2xg.cjs"),V=require("../url-C3dWnJQg.cjs");var w,h,m,k,P,C,A;class ft{constructor(t,i){r(this,w,void 0);r(this,h,void 0);r(this,m,void 0);r(this,k,void 0);r(this,P,void 0);r(this,C,t=>{t.preventDefault(),e(this,w).links.forEach(i=>{var a;e(this,m)===e(i,m)||(a=e(i,P))!=null&&a.includes(e(this,m))?e(i,h).classList.add("clicked"):e(i,h).classList.remove("clicked")}),e(this,w).navigate(e(this,m),e(this,k))});r(this,A,()=>{e(this,w).prefetch(e(this,m)),e(this,h).removeEventListener("pointerenter",e(this,A))});var u,p;c(this,w,i),c(this,h,t),c(this,m,e(this,h).getAttribute("href")||"/"),c(this,k,e(this,h).getAttribute("data-history-action")||"push"),e(this,h).addEventListener("click",e(this,C));const a=i.normalizePath(e(this,m)),s=i.normalizePath(location.pathname);c(this,P,(u=e(this,h).getAttribute("data-match-paths"))==null?void 0:u.split(",").map(f=>i.normalizePath(f.trim()).pathname)),e(this,h).hasAttribute("data-include")?s.pathname.includes(a.pathname)&&e(this,h).classList.add("current"):a.pathname===s.pathname||(p=e(this,P))!=null&&p.includes(s.pathname)?(e(this,h).classList.add("current"),e(this,h).classList.add("clicked")):e(this,h).classList.remove("clicked"),e(this,h).hasAttribute("data-prefetch")&&e(this,h).addEventListener("pointerenter",e(this,A))}destroy(){e(this,h).removeEventListener("click",e(this,C)),e(this,h).removeEventListener("pointerenter",e(this,A)),e(this,h).classList.remove("current")}}w=new WeakMap,h=new WeakMap,m=new WeakMap,k=new WeakMap,P=new WeakMap,C=new WeakMap,A=new WeakMap;var M,S,z,q,H,K,y,v,L,x,D,R,X,F,Z,I,$,Y,ct,O,tt,_;class pt{constructor(t){r(this,R);r(this,F);r(this,I);r(this,Y);r(this,O);r(this,M,null);r(this,S,null);r(this,z,null);r(this,q,null);r(this,H,[]);r(this,K,new DOMParser);r(this,y,new Map);r(this,v,void 0);r(this,L,null);r(this,x,new ht.Notifier);r(this,D,new ht.Notifier);r(this,_,t=>{t.state&&this.navigate(t.state,"none")});if(mt.isBrowser){t!=null&&t.base?c(this,M,V.normalizeBase(t.base)):c(this,M,"/"),c(this,S,(t==null?void 0:t.waitForHeadToLoad)!==!1),c(this,z,(t==null?void 0:t.cachePages)!==!1),c(this,q,d(this,I,$).call(this,document.body));const i=this.normalizePath(location.pathname);c(this,L,i.pathname),document.documentElement.setAttribute("data-current-pathname",e(this,L)),document.documentElement.setAttribute("data-current-leaf",i.leaf),d(this,F,Z).call(this),addEventListener("popstate",e(this,_))}}get currentPathname(){return e(this,L)}get links(){return e(this,H)}normalizePath(t){return V.splitPath(t,e(this,M))}beforeNavigationEvent(t){return e(this,x).subscribe(t)}afterNavigationEvent(t){return e(this,D).subscribe(t)}prefetch(t){return T(this,null,function*(){const i=this.normalizePath(t);return d(this,R,X).call(this,i.pathname)})}navigate(t,i="push"){return T(this,null,function*(){var g;const a=this.normalizePath(t);let{pathname:s,hash:u,parameters:p,leaf:f}=a;if(e(this,v)===s||e(this,L)===s)return;c(this,v,s);const l=e(this,y).has(s);try{let B=!0;if(e(this,x).notify({pathname:s,isCached:l}),this.preprocessor)try{yield new Promise((o,E)=>{var b;(b=this.preprocessor)==null||b.call(this,{pathname:s,resolve:o,reject:E,isCached:l})})}catch(o){o?console.error(o):console.log("Route change canceled"),B=!1}if(!B||e(this,v)!==s)return;const et=e(this,y).get(s)||(yield d(this,R,X).call(this,s));if(e(this,v)!==s)return;const it=Array.from(document.head.children),st=Array.from(et.head.cloneNode(!0).children),nt=d(this,Y,ct).call(this,it,st),lt=d(this,O,tt).call(this,it,nt),W=d(this,O,tt).call(this,st,nt);W.forEach((o,E)=>{if(o.tagName==="SCRIPT"&&o.getAttribute("src")){const b=document.createElement("script");b.type="module",b.src=o.getAttribute("src"),W[E]=b}}),W.forEach(o=>{document.head.appendChild(o)});const G=W.filter(o=>o.tagName==="STYLE"||o.tagName==="SCRIPT"||o.tagName==="LINK");e(this,S)&&G.length&&(yield new Promise(o=>T(this,null,function*(){let E=0;try{for(var b=ot(G),dt,J,j;dt=!(J=yield b.next()).done;dt=!1){const N=J.value;N.onload=()=>{E++,E===G.length&&o()}}}catch(J){j=[J]}finally{try{dt&&(J=b.return)&&(yield J.call(b))}finally{if(j)throw j[0]}}}))),lt.forEach(o=>{o.hasAttribute("data-permanent")||o.remove()}),c(this,L,s),V.changeHistory(i,s,p,u);const ut=d(this,I,$).call(this,et.body.cloneNode(!0));e(this,q).forEach((o,E)=>{const b=ut[E];let dt=[...o.childNodes],J=[...b.childNodes];dt.forEach(j=>{if(j instanceof HTMLElement){const N=j.getAttribute("data-remain");let rt;J=J.filter(Q=>Q instanceof HTMLElement&&N&&Q.getAttribute("data-remain")===N?(rt=Q,!1):!0),N&&rt||j.remove()}else j.remove()}),o.append(...J)}),d(this,F,Z).call(this),document.documentElement.setAttribute("data-current-pathname",s),document.documentElement.setAttribute("data-current-leaf",f),(g=this.postprocessor)==null||g.call(this,{pathname:s,isCached:l}),e(this,D).notify({pathname:s,isCached:l})}catch(B){console.error(B)}c(this,v,void 0)})}}M=new WeakMap,S=new WeakMap,z=new WeakMap,q=new WeakMap,H=new WeakMap,K=new WeakMap,y=new WeakMap,v=new WeakMap,L=new WeakMap,x=new WeakMap,D=new WeakMap,R=new WeakSet,X=function(t){return T(this,null,function*(){const i=e(this,y).get(t);if(i)return i;const s=yield(yield fetch(t)).text(),u=e(this,K).parseFromString(s,"text/html");return e(this,z)&&e(this,y).set(t,u),u})},F=new WeakSet,Z=function(){const t=[...document.documentElement.querySelectorAll("a")].filter(i=>{var a;return(a=i.getAttribute("href"))==null?void 0:a.startsWith("/")});e(this,H).forEach(i=>i.destroy()),c(this,H,t.map(i=>new ft(i,this)))},I=new WeakSet,$=function(t){return[...t.querySelectorAll("[data-morph]")]},Y=new WeakSet,ct=function(t,i){return t.filter(a=>i.find(s=>s.outerHTML===a.outerHTML))},O=new WeakSet,tt=function(t,i){return t.filter(a=>!i.find(s=>s.outerHTML===a.outerHTML))},_=new WeakMap;exports.Morph=pt;
@@ -1,89 +1,96 @@
1
- var nt = (n, t) => (t = Symbol[n]) ? t : Symbol.for("Symbol." + n);
2
- var U = (n, t, i) => {
1
+ var at = (n, t) => (t = Symbol[n]) ? t : Symbol.for("Symbol." + n);
2
+ var V = (n, t, i) => {
3
3
  if (!t.has(n))
4
4
  throw TypeError("Cannot " + i);
5
5
  };
6
- var e = (n, t, i) => (U(n, t, "read from private field"), i ? i.call(n) : t.get(n)), r = (n, t, i) => {
6
+ var e = (n, t, i) => (V(n, t, "read from private field"), i ? i.call(n) : t.get(n)), a = (n, t, i) => {
7
7
  if (t.has(n))
8
8
  throw TypeError("Cannot add the same private member more than once");
9
9
  t instanceof WeakSet ? t.add(n) : t.set(n, i);
10
- }, c = (n, t, i, a) => (U(n, t, "write to private field"), a ? a.call(n, i) : t.set(n, i), i);
11
- var f = (n, t, i) => (U(n, t, "access private method"), i);
12
- var T = (n, t, i) => new Promise((a, s) => {
13
- var l = (u) => {
10
+ }, c = (n, t, i, r) => (V(n, t, "write to private field"), r ? r.call(n, i) : t.set(n, i), i);
11
+ var d = (n, t, i) => (V(n, t, "access private method"), i);
12
+ var T = (n, t, i) => new Promise((r, s) => {
13
+ var u = (l) => {
14
14
  try {
15
- d(i.next(u));
16
- } catch (m) {
17
- s(m);
15
+ f(i.next(l));
16
+ } catch (E) {
17
+ s(E);
18
18
  }
19
- }, g = (u) => {
19
+ }, p = (l) => {
20
20
  try {
21
- d(i.throw(u));
22
- } catch (m) {
23
- s(m);
21
+ f(i.throw(l));
22
+ } catch (E) {
23
+ s(E);
24
24
  }
25
- }, d = (u) => u.done ? a(u.value) : Promise.resolve(u.value).then(l, g);
26
- d((i = i.apply(n, t)).next());
25
+ }, f = (l) => l.done ? r(l.value) : Promise.resolve(l.value).then(u, p);
26
+ f((i = i.apply(n, t)).next());
27
27
  });
28
- var rt = (n, t, i) => (t = n[nt("asyncIterator")]) ? t.call(n) : (n = n[nt("iterator")](), t = {}, i = (a, s) => (s = n[a]) && (t[a] = (l) => new Promise((g, d, u) => (l = s.call(n, l), u = l.done, Promise.resolve(l.value).then((m) => g({ value: m, done: u }), d)))), i("next"), i("return"), t);
29
- import { Notifier as at } from "../notifier/index.js";
30
- import { i as ut } from "../browser-0zX67oeU.js";
31
- import { n as dt, s as mt, c as ft } from "../url-DMNfW7uN.js";
32
- var w, o, p, k, P, C, A;
33
- class pt {
28
+ var rt = (n, t, i) => (t = n[at("asyncIterator")]) ? t.call(n) : (n = n[at("iterator")](), t = {}, i = (r, s) => (s = n[r]) && (t[r] = (u) => new Promise((p, f, l) => (u = s.call(n, u), l = u.done, Promise.resolve(u.value).then((E) => p({ value: E, done: l }), f)))), i("next"), i("return"), t);
29
+ import { Notifier as ot } from "../notifier/index.js";
30
+ import { i as dt } from "../browser-0zX67oeU.js";
31
+ import { n as mt, s as ft, c as pt } from "../url-DMNfW7uN.js";
32
+ var w, h, m, k, y, C, A;
33
+ class Et {
34
34
  constructor(t, i) {
35
- r(this, w, void 0);
36
- r(this, o, void 0);
37
- r(this, p, void 0);
38
- r(this, k, void 0);
39
- r(this, P, void 0);
40
- r(this, C, (t) => {
35
+ a(this, w, void 0);
36
+ a(this, h, void 0);
37
+ a(this, m, void 0);
38
+ a(this, k, void 0);
39
+ a(this, y, void 0);
40
+ a(this, C, (t) => {
41
41
  t.preventDefault(), e(this, w).links.forEach((i) => {
42
- var a;
43
- e(this, p) === e(i, p) || (a = e(i, P)) != null && a.includes(e(this, p)) ? e(i, o).classList.add("clicked") : e(i, o).classList.remove("clicked");
44
- }), e(this, w).navigate(e(this, p), e(this, k));
42
+ var r;
43
+ e(this, m) === e(i, m) || (r = e(i, y)) != null && r.includes(e(this, m)) ? e(i, h).classList.add("clicked") : e(i, h).classList.remove("clicked");
44
+ }), e(this, w).navigate(e(this, m), e(this, k));
45
45
  });
46
- r(this, A, () => {
47
- e(this, w).prefetch(e(this, p)), e(this, o).removeEventListener("pointerenter", e(this, A));
46
+ a(this, A, () => {
47
+ e(this, w).prefetch(e(this, m)), e(this, h).removeEventListener("pointerenter", e(this, A));
48
48
  });
49
- var l, g;
50
- c(this, w, i), c(this, o, t), c(this, p, e(this, o).getAttribute("href") || "/"), c(this, k, e(this, o).getAttribute(
49
+ var u, p;
50
+ c(this, w, i), c(this, h, t), c(this, m, e(this, h).getAttribute("href") || "/"), c(this, k, e(this, h).getAttribute(
51
51
  "data-history-action"
52
- ) || "push"), e(this, o).addEventListener("click", e(this, C));
53
- const a = i.normalizePath(e(this, p)), s = i.normalizePath(location.pathname);
54
- c(this, P, (l = e(this, o).getAttribute("data-match-paths")) == null ? void 0 : l.split(",").map((d) => i.normalizePath(d.trim()).pathname)), e(this, o).hasAttribute("data-include") ? s.pathname.includes(a.pathname) && e(this, o).classList.add("current") : a.pathname === s.pathname || (g = e(this, P)) != null && g.includes(s.pathname) ? (e(this, o).classList.add("current"), e(this, o).classList.add("clicked")) : e(this, o).classList.remove("clicked"), e(this, o).hasAttribute("data-prefetch") && e(this, o).addEventListener("pointerenter", e(this, A));
52
+ ) || "push"), e(this, h).addEventListener("click", e(this, C));
53
+ const r = i.normalizePath(e(this, m)), s = i.normalizePath(location.pathname);
54
+ c(this, y, (u = e(this, h).getAttribute("data-match-paths")) == null ? void 0 : u.split(",").map((f) => i.normalizePath(f.trim()).pathname)), e(this, h).hasAttribute("data-include") ? s.pathname.includes(r.pathname) && e(this, h).classList.add("current") : r.pathname === s.pathname || (p = e(this, y)) != null && p.includes(s.pathname) ? (e(this, h).classList.add("current"), e(this, h).classList.add("clicked")) : e(this, h).classList.remove("clicked"), e(this, h).hasAttribute("data-prefetch") && e(this, h).addEventListener("pointerenter", e(this, A));
55
55
  }
56
56
  destroy() {
57
- e(this, o).removeEventListener("click", e(this, C)), e(this, o).removeEventListener("pointerenter", e(this, A)), e(this, o).classList.remove("current");
57
+ e(this, h).removeEventListener("click", e(this, C)), e(this, h).removeEventListener("pointerenter", e(this, A)), e(this, h).classList.remove("current");
58
58
  }
59
59
  }
60
- w = new WeakMap(), o = new WeakMap(), p = new WeakMap(), k = new WeakMap(), P = new WeakMap(), C = new WeakMap(), A = new WeakMap();
61
- var H, S, z, x, M, K, y, v, b, D, R, F, V, I, X, q, Z, Y, ht, B, _, j;
62
- class bt {
60
+ w = new WeakMap(), h = new WeakMap(), m = new WeakMap(), k = new WeakMap(), y = new WeakMap(), C = new WeakMap(), A = new WeakMap();
61
+ var H, z, S, x, M, Y, P, v, b, D, R, F, X, I, Z, q, _, j, ht, B, $, G;
62
+ class wt {
63
63
  constructor(t) {
64
- r(this, F);
65
- r(this, I);
66
- r(this, q);
67
- r(this, Y);
68
- r(this, B);
69
- r(this, H, null);
70
- r(this, S, null);
71
- r(this, z, null);
72
- r(this, x, null);
73
- r(this, M, []);
74
- r(this, K, new DOMParser());
75
- r(this, y, /* @__PURE__ */ new Map());
76
- r(this, v, void 0);
77
- r(this, b, null);
78
- r(this, D, new at());
79
- r(this, R, new at());
80
- r(this, j, (t) => {
64
+ a(this, F);
65
+ a(this, I);
66
+ a(this, q);
67
+ a(this, j);
68
+ a(this, B);
69
+ a(this, H, null);
70
+ a(this, z, null);
71
+ a(this, S, null);
72
+ a(this, x, null);
73
+ a(this, M, []);
74
+ a(this, Y, new DOMParser());
75
+ a(this, P, /* @__PURE__ */ new Map());
76
+ a(this, v, void 0);
77
+ a(this, b, null);
78
+ a(this, D, new ot());
79
+ a(this, R, new ot());
80
+ a(this, G, (t) => {
81
81
  t.state && this.navigate(t.state, "none");
82
82
  });
83
- ut && (t != null && t.base ? c(this, H, dt(t.base)) : c(this, H, "/"), c(this, S, (t == null ? void 0 : t.waitForHeadToLoad) !== !1), c(this, z, (t == null ? void 0 : t.cachePages) !== !1), c(this, x, f(this, q, Z).call(this, document.body)), c(this, b, this.normalizePath(location.pathname).pathname), document.documentElement.setAttribute(
84
- "data-current-pathname",
85
- e(this, b)
86
- ), f(this, I, X).call(this), addEventListener("popstate", e(this, j)));
83
+ if (dt) {
84
+ t != null && t.base ? c(this, H, mt(t.base)) : c(this, H, "/"), c(this, z, (t == null ? void 0 : t.waitForHeadToLoad) !== !1), c(this, S, (t == null ? void 0 : t.cachePages) !== !1), c(this, x, d(this, q, _).call(this, document.body));
85
+ const i = this.normalizePath(location.pathname);
86
+ c(this, b, i.pathname), document.documentElement.setAttribute(
87
+ "data-current-pathname",
88
+ e(this, b)
89
+ ), document.documentElement.setAttribute(
90
+ "data-current-leaf",
91
+ i.leaf
92
+ ), d(this, I, Z).call(this), addEventListener("popstate", e(this, G));
93
+ }
87
94
  }
88
95
  get currentPathname() {
89
96
  return e(this, b);
@@ -92,7 +99,7 @@ class bt {
92
99
  return e(this, M);
93
100
  }
94
101
  normalizePath(t) {
95
- return mt(t, e(this, H));
102
+ return ft(t, e(this, H));
96
103
  }
97
104
  beforeNavigationEvent(t) {
98
105
  return e(this, D).subscribe(t);
@@ -103,126 +110,126 @@ class bt {
103
110
  prefetch(t) {
104
111
  return T(this, null, function* () {
105
112
  const i = this.normalizePath(t);
106
- return f(this, F, V).call(this, i.pathname);
113
+ return d(this, F, X).call(this, i.pathname);
107
114
  });
108
115
  }
109
116
  navigate(t, i = "push") {
110
117
  return T(this, null, function* () {
111
- var u;
112
- const a = this.normalizePath(t);
113
- let { pathname: s, hash: l, parameters: g } = a;
118
+ var E;
119
+ const r = this.normalizePath(t);
120
+ let { pathname: s, hash: u, parameters: p, leaf: f } = r;
114
121
  if (e(this, v) === s || e(this, b) === s)
115
122
  return;
116
123
  c(this, v, s);
117
- const d = e(this, y).has(s);
124
+ const l = e(this, P).has(s);
118
125
  try {
119
- let m = !0;
126
+ let O = !0;
120
127
  if (e(this, D).notify({
121
128
  pathname: s,
122
- isCached: d
129
+ isCached: l
123
130
  }), this.preprocessor)
124
131
  try {
125
- yield new Promise((h, E) => {
132
+ yield new Promise((o, g) => {
126
133
  var L;
127
- (L = this.preprocessor) == null || L.call(this, { pathname: s, resolve: h, reject: E, isCached: d });
134
+ (L = this.preprocessor) == null || L.call(this, { pathname: s, resolve: o, reject: g, isCached: l });
128
135
  });
129
- } catch (h) {
130
- h ? console.error(h) : console.log("Route change canceled"), m = !1;
136
+ } catch (o) {
137
+ o ? console.error(o) : console.log("Route change canceled"), O = !1;
131
138
  }
132
- if (!m || e(this, v) !== s)
139
+ if (!O || e(this, v) !== s)
133
140
  return;
134
- const $ = e(this, y).get(s) || (yield f(this, F, V).call(this, s));
141
+ const tt = e(this, P).get(s) || (yield d(this, F, X).call(this, s));
135
142
  if (e(this, v) !== s)
136
143
  return;
137
- const tt = Array.from(document.head.children), et = Array.from(
138
- $.head.cloneNode(!0).children
139
- ), it = f(this, Y, ht).call(this, tt, et), ot = f(this, B, _).call(this, tt, it), O = f(this, B, _).call(this, et, it);
140
- O.forEach((h, E) => {
141
- if (h.tagName === "SCRIPT" && h.getAttribute("src")) {
144
+ const et = Array.from(document.head.children), it = Array.from(
145
+ tt.head.cloneNode(!0).children
146
+ ), st = d(this, j, ht).call(this, et, it), ct = d(this, B, $).call(this, et, st), W = d(this, B, $).call(this, it, st);
147
+ W.forEach((o, g) => {
148
+ if (o.tagName === "SCRIPT" && o.getAttribute("src")) {
142
149
  const L = document.createElement("script");
143
- L.type = "module", L.src = h.getAttribute("src"), O[E] = L;
150
+ L.type = "module", L.src = o.getAttribute("src"), W[g] = L;
144
151
  }
145
- }), O.forEach((h) => {
146
- document.head.appendChild(h);
152
+ }), W.forEach((o) => {
153
+ document.head.appendChild(o);
147
154
  });
148
- const G = O.filter(
149
- (h) => h.tagName === "STYLE" || h.tagName === "SCRIPT" || h.tagName === "LINK"
155
+ const J = W.filter(
156
+ (o) => o.tagName === "STYLE" || o.tagName === "SCRIPT" || o.tagName === "LINK"
150
157
  );
151
- e(this, S) && G.length && (yield new Promise((h) => T(this, null, function* () {
152
- let E = 0;
158
+ e(this, z) && J.length && (yield new Promise((o) => T(this, null, function* () {
159
+ let g = 0;
153
160
  try {
154
- for (var L = rt(G), lt, J, W; lt = !(J = yield L.next()).done; lt = !1) {
155
- const N = J.value;
161
+ for (var L = rt(J), ut, Q, K; ut = !(Q = yield L.next()).done; ut = !1) {
162
+ const N = Q.value;
156
163
  N.onload = () => {
157
- E++, E === G.length && h();
164
+ g++, g === J.length && o();
158
165
  };
159
166
  }
160
- } catch (J) {
161
- W = [J];
167
+ } catch (Q) {
168
+ K = [Q];
162
169
  } finally {
163
170
  try {
164
- lt && (J = L.return) && (yield J.call(L));
171
+ ut && (Q = L.return) && (yield Q.call(L));
165
172
  } finally {
166
- if (W)
167
- throw W[0];
173
+ if (K)
174
+ throw K[0];
168
175
  }
169
176
  }
170
- }))), ot.forEach((h) => {
171
- h.hasAttribute("data-permanent") || h.remove();
172
- }), c(this, b, s), ft(i, s, g, l);
173
- const ct = f(this, q, Z).call(this, $.body.cloneNode(!0));
174
- e(this, x).forEach((h, E) => {
175
- const L = ct[E];
176
- let lt = [...h.childNodes], J = [...L.childNodes];
177
- lt.forEach((W) => {
178
- if (W instanceof HTMLElement) {
179
- const N = W.getAttribute("data-remain");
180
- let st;
181
- J = J.filter(
182
- (Q) => Q instanceof HTMLElement && N && Q.getAttribute("data-remain") === N ? (st = Q, !1) : !0
183
- ), N && st || W.remove();
177
+ }))), ct.forEach((o) => {
178
+ o.hasAttribute("data-permanent") || o.remove();
179
+ }), c(this, b, s), pt(i, s, p, u);
180
+ const lt = d(this, q, _).call(this, tt.body.cloneNode(!0));
181
+ e(this, x).forEach((o, g) => {
182
+ const L = lt[g];
183
+ let ut = [...o.childNodes], Q = [...L.childNodes];
184
+ ut.forEach((K) => {
185
+ if (K instanceof HTMLElement) {
186
+ const N = K.getAttribute("data-remain");
187
+ let nt;
188
+ Q = Q.filter(
189
+ (U) => U instanceof HTMLElement && N && U.getAttribute("data-remain") === N ? (nt = U, !1) : !0
190
+ ), N && nt || K.remove();
184
191
  } else
185
- W.remove();
186
- }), h.append(...J);
187
- }), f(this, I, X).call(this), document.documentElement.setAttribute("data-current-pathname", s), (u = this.postprocessor) == null || u.call(this, { pathname: s, isCached: d }), e(this, R).notify({ pathname: s, isCached: d });
188
- } catch (m) {
189
- console.error(m);
192
+ K.remove();
193
+ }), o.append(...Q);
194
+ }), d(this, I, Z).call(this), document.documentElement.setAttribute("data-current-pathname", s), document.documentElement.setAttribute("data-current-leaf", f), (E = this.postprocessor) == null || E.call(this, { pathname: s, isCached: l }), e(this, R).notify({ pathname: s, isCached: l });
195
+ } catch (O) {
196
+ console.error(O);
190
197
  }
191
198
  c(this, v, void 0);
192
199
  });
193
200
  }
194
201
  }
195
- H = new WeakMap(), S = new WeakMap(), z = new WeakMap(), x = new WeakMap(), M = new WeakMap(), K = new WeakMap(), y = new WeakMap(), v = new WeakMap(), b = new WeakMap(), D = new WeakMap(), R = new WeakMap(), F = new WeakSet(), V = function(t) {
202
+ H = new WeakMap(), z = new WeakMap(), S = new WeakMap(), x = new WeakMap(), M = new WeakMap(), Y = new WeakMap(), P = new WeakMap(), v = new WeakMap(), b = new WeakMap(), D = new WeakMap(), R = new WeakMap(), F = new WeakSet(), X = function(t) {
196
203
  return T(this, null, function* () {
197
- const i = e(this, y).get(t);
204
+ const i = e(this, P).get(t);
198
205
  if (i)
199
206
  return i;
200
- const s = yield (yield fetch(t)).text(), l = e(this, K).parseFromString(s, "text/html");
201
- return e(this, z) && e(this, y).set(t, l), l;
207
+ const s = yield (yield fetch(t)).text(), u = e(this, Y).parseFromString(s, "text/html");
208
+ return e(this, S) && e(this, P).set(t, u), u;
202
209
  });
203
- }, I = new WeakSet(), X = function() {
210
+ }, I = new WeakSet(), Z = function() {
204
211
  const t = [
205
212
  ...document.documentElement.querySelectorAll("a")
206
213
  ].filter((i) => {
207
- var a;
208
- return (a = i.getAttribute("href")) == null ? void 0 : a.startsWith("/");
214
+ var r;
215
+ return (r = i.getAttribute("href")) == null ? void 0 : r.startsWith("/");
209
216
  });
210
- e(this, M).forEach((i) => i.destroy()), c(this, M, t.map((i) => new pt(i, this)));
211
- }, q = new WeakSet(), Z = function(t) {
217
+ e(this, M).forEach((i) => i.destroy()), c(this, M, t.map((i) => new Et(i, this)));
218
+ }, q = new WeakSet(), _ = function(t) {
212
219
  return [...t.querySelectorAll("[data-morph]")];
213
- }, Y = new WeakSet(), ht = function(t, i) {
220
+ }, j = new WeakSet(), ht = function(t, i) {
214
221
  return t.filter(
215
- (a) => i.find(
216
- (s) => s.outerHTML === a.outerHTML
222
+ (r) => i.find(
223
+ (s) => s.outerHTML === r.outerHTML
217
224
  )
218
225
  );
219
- }, B = new WeakSet(), _ = function(t, i) {
226
+ }, B = new WeakSet(), $ = function(t, i) {
220
227
  return t.filter(
221
- (a) => !i.find(
222
- (s) => s.outerHTML === a.outerHTML
228
+ (r) => !i.find(
229
+ (s) => s.outerHTML === r.outerHTML
223
230
  )
224
231
  );
225
- }, j = new WeakMap();
232
+ }, G = new WeakMap();
226
233
  export {
227
- bt as Morph
234
+ wt as Morph
228
235
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("../attribute/index.cjs"),S=require("../custom-element/index.cjs"),D=require("../Store-6s0YXK4o.cjs"),H=require("../style-At6aDoqG.cjs"),I=require("../browser-CpzFX2xg.cjs"),N=require("../tags-ld5jemJw.cjs");var R=Object.defineProperty,G=Object.getOwnPropertyDescriptor,K=(t,e,s,r)=>{for(var a=r>1?void 0:r?G(e,s):e,l=t.length-1,p;l>=0;l--)(p=t[l])&&(a=(r?p(e,s,a):p(a))||a);return r&&a&&R(e,s,a),a},b=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)},i=(t,e,s)=>(b(t,e,"read from private field"),s?s.call(t):e.get(t)),h=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},W=(t,e,s,r)=>(b(t,e,"write to private field"),e.set(t,s),s),q=(t,e,s)=>(b(t,e,"access private method"),s),M,c,g,d,v,f,O,x,u,m,w,L,y,$,E;exports.PopoverElement=class extends S.CustomElement{constructor(){super(),h(this,O),h(this,u),h(this,y),h(this,M,-1),h(this,c,new D.Store(!1)),h(this,g,void 0),h(this,d,new A.Attribute(this,"history",!1)),h(this,v,new A.Attribute(this,"single",!1)),h(this,f,!1),this.open=(e=!0)=>{if(i(this,c).current)return;i(this,c).current=!0,i(this,v).current&&(exports.PopoverElement.__opened.forEach(r=>r.close()),exports.PopoverElement.__opened=[]),exports.PopoverElement.__opened.push(this),W(this,M,exports.PopoverElement.__opened.length-1),i(this,d).current&&i(this,f)&&history.pushState("","",i(this,O,x)),clearTimeout(i(this,g)),this.classList.add("triggered"),this.style.display="block",this.dispatchEvent(new CustomEvent("popoverTriggered"));const s=()=>{addEventListener("click",i(this,w)),addEventListener("keydown",i(this,L)),this.style.opacity="1",this.classList.add("opened"),this.dispatchEvent(new CustomEvent("popoverOpened"))};e?setTimeout(s):s()},this.close=()=>{if(i(this,c).current){if(i(this,c).current=!1,exports.PopoverElement.__opened=exports.PopoverElement.__opened.filter(e=>e!==this),i(this,d).current){const e=new URL(location.href);e.searchParams.delete(i(this,u,m)),history.replaceState(null,"",e.href)}this.classList.remove("opened"),this.style.opacity="0",this.dispatchEvent(new CustomEvent("popoverClosing")),removeEventListener("click",i(this,w)),removeEventListener("keydown",i(this,L)),setTimeout(()=>{this.classList.remove("triggered"),this.style.display="none",this.dispatchEvent(new CustomEvent("popoverClosed"))},H.getElementTransitionDurationMS(this)+10)}},h(this,w,e=>{q(this,y,$).call(this,()=>{var p;const r=e.composedPath()[0],a=r instanceof HTMLElement&&(this.contains(r)||((p=this.shadowRoot)==null?void 0:p.contains(r))),l=r instanceof HTMLElement&&r.hasAttribute("outside");(!a||l)&&this.close()})}),h(this,L,e=>{q(this,y,$).call(this,()=>{e.code==="Escape"&&this.close()})}),h(this,E,()=>{W(this,f,!1),i(this,c).current&&i(this,d).current&&!location.search.includes(i(this,u,m))?this.close():!i(this,c).current&&i(this,d).current&&location.search.includes(i(this,u,m))&&this.open(),W(this,f,!0)}),this.setAttribute("popover-target",""),this.addEventListener("transitionstart",()=>{this.classList.remove("transition-end"),this.classList.add("transition-start")}),this.addEventListener("transitionend",()=>{this.classList.remove("transition-start"),this.classList.add("transition-end")})}get history(){return i(this,d)}get single(){return i(this,v)}get opened(){return i(this,c)}connectedCallback(){i(this,d).observe(),i(this,v).observe(),this.style.opacity="0",this.style.display="none",addEventListener("popstate",i(this,E)),setTimeout(()=>{i(this,E).call(this)},0)}disconnectedCallback(){i(this,d).unobserve(),i(this,v).unobserve(),exports.PopoverElement.__opened=exports.PopoverElement.__opened.filter(e=>e!==this),clearTimeout(i(this,g)),removeEventListener("popstate",i(this,E)),this.classList.remove("transition-end"),this.classList.remove("transition-start")}};M=new WeakMap;c=new WeakMap;g=new WeakMap;d=new WeakMap;v=new WeakMap;f=new WeakMap;O=new WeakSet;x=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${i(this,u,m)}`};u=new WeakSet;m=function(){return`modal-${this.id}`};w=new WeakMap;L=new WeakMap;y=new WeakSet;$=function(t){(exports.PopoverElement.__opened[i(this,M)-1]||exports.PopoverElement.__opened.length===1)&&t()};E=new WeakMap;exports.PopoverElement.__opened=[];exports.PopoverElement=K([S.define("e-popover")],exports.PopoverElement);var U=Object.defineProperty,z=Object.getOwnPropertyDescriptor,F=(t,e,s,r)=>{for(var a=r>1?void 0:r?z(e,s):e,l=t.length-1,p;l>=0;l--)(p=t[l])&&(a=(r?p(e,s,a):p(a))||a);return r&&a&&U(e,s,a),a},B=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)},n=(t,e,s)=>(B(t,e,"read from private field"),s?s.call(t):e.get(t)),_=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},J=(t,e,s,r)=>(B(t,e,"write to private field"),e.set(t,s),s),o,P,C,k,T;exports.PopoverButtonElement=class extends S.CustomElement{constructor(){super(),_(this,o,void 0),_(this,P,()=>{this.classList.add("triggered")}),_(this,C,()=>{this.classList.add("opened")}),_(this,k,()=>{this.classList.remove("opened")}),_(this,T,()=>{this.classList.remove("triggered")}),I.isBrowser&&N.element(this,{tabindex:this.getAttribute("tabindex")||"0",onClick:()=>{if(n(this,o)){const e=this.getAttribute("type")||"open";e==="open"||e==="toggle"&&!n(this,o).opened.current?n(this,o).open():(e==="close"||e==="toggle"&&n(this,o).opened.current)&&n(this,o).close()}},onKeydown:e=>{e.code==="Space"&&e.currentTarget.click()}})}get popoverElement(){return n(this,o)}connectedCallback(){var s;const e=this.getAttribute("target");if(e){let r=null;e==="parent"?r=this.closest("[popover-target]"):e==="sibling"?r=(s=this.parentElement)==null?void 0:s.querySelector("[popover-target]"):r=document.querySelector(`#${e}`)||this.getRootNode().querySelector(`#${e}`),r instanceof HTMLElement?(J(this,o,r),n(this,o).addEventListener("popoverTriggered",n(this,P)),n(this,o).addEventListener("popoverOpened",n(this,C)),n(this,o).addEventListener("popoverClosing",n(this,k)),n(this,o).addEventListener("popoverClosed",n(this,T))):console.warn(this,`target ${e} not found`)}}disconnectedCallback(){n(this,o)&&(n(this,o).removeEventListener("popoverTriggered",n(this,P)),n(this,o).removeEventListener("popoverOpened",n(this,C)),n(this,o).removeEventListener("popoverClosing",n(this,k)),n(this,o).removeEventListener("popoverClosed",n(this,T)))}};o=new WeakMap;P=new WeakMap;C=new WeakMap;k=new WeakMap;T=new WeakMap;exports.PopoverButtonElement=F([S.define("e-popover-button")],exports.PopoverButtonElement);
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("../attribute/index.cjs"),S=require("../custom-element/index.cjs"),D=require("../Store-6s0YXK4o.cjs"),H=require("../style-At6aDoqG.cjs"),I=require("../browser-CpzFX2xg.cjs"),N=require("../tags-ld5jemJw.cjs");var R=Object.defineProperty,G=Object.getOwnPropertyDescriptor,K=(t,e,s,r)=>{for(var a=r>1?void 0:r?G(e,s):e,l=t.length-1,p;l>=0;l--)(p=t[l])&&(a=(r?p(e,s,a):p(a))||a);return r&&a&&R(e,s,a),a},b=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)},i=(t,e,s)=>(b(t,e,"read from private field"),s?s.call(t):e.get(t)),h=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},W=(t,e,s,r)=>(b(t,e,"write to private field"),e.set(t,s),s),q=(t,e,s)=>(b(t,e,"access private method"),s),M,c,m,d,v,f,O,x,u,g,w,y,L,$,E;exports.PopoverElement=class extends S.CustomElement{constructor(){super(),h(this,O),h(this,u),h(this,L),h(this,M,-1),h(this,c,new D.Store(!1)),h(this,m,void 0),h(this,d,new A.Attribute(this,"history",!1)),h(this,v,new A.Attribute(this,"single",!1)),h(this,f,!1),this.open=(e=!0)=>{if(i(this,c).current)return;i(this,c).current=!0,i(this,v).current&&(exports.PopoverElement.__opened.forEach(r=>r.close()),exports.PopoverElement.__opened=[]),exports.PopoverElement.__opened.push(this),W(this,M,exports.PopoverElement.__opened.length-1),i(this,d).current&&i(this,f)&&history.pushState("","",i(this,O,x)),clearTimeout(i(this,m)),this.classList.add("triggered"),this.style.display="block",this.dispatchEvent(new CustomEvent("popoverTriggered"));const s=()=>{addEventListener("click",i(this,w)),addEventListener("keydown",i(this,y)),this.style.opacity="1",this.classList.add("opened"),this.dispatchEvent(new CustomEvent("popoverOpened"))};e?setTimeout(s):s()},this.close=()=>{if(i(this,c).current){if(i(this,c).current=!1,exports.PopoverElement.__opened=exports.PopoverElement.__opened.filter(e=>e!==this),i(this,d).current){const e=new URL(location.href);e.searchParams.delete(i(this,u,g)),history.replaceState(null,"",e.href)}this.classList.remove("opened"),this.style.opacity="0",this.dispatchEvent(new CustomEvent("popoverClosing")),removeEventListener("click",i(this,w)),removeEventListener("keydown",i(this,y)),setTimeout(()=>{this.classList.remove("triggered"),this.style.display="none",this.dispatchEvent(new CustomEvent("popoverClosed"))},H.getElementTransitionDurationMS(this)+10)}},h(this,w,e=>{q(this,L,$).call(this,()=>{var p;const r=e.composedPath()[0],a=r instanceof HTMLElement&&(this.contains(r)||((p=this.shadowRoot)==null?void 0:p.contains(r))),l=r instanceof HTMLElement&&r.hasAttribute("outside");(!a||l)&&this.close()})}),h(this,y,e=>{q(this,L,$).call(this,()=>{e.code==="Escape"&&this.close()})}),h(this,E,()=>{W(this,f,!1),i(this,c).current&&i(this,d).current&&!location.search.includes(i(this,u,g))?this.close():!i(this,c).current&&i(this,d).current&&location.search.includes(i(this,u,g))&&this.open(),W(this,f,!0)}),this.setAttribute("popover-target","")}get history(){return i(this,d)}get single(){return i(this,v)}get opened(){return i(this,c)}connectedCallback(){i(this,d).observe(),i(this,v).observe(),this.style.opacity="0",this.style.display="none",addEventListener("popstate",i(this,E)),setTimeout(()=>{i(this,E).call(this)},0)}disconnectedCallback(){i(this,d).unobserve(),i(this,v).unobserve(),exports.PopoverElement.__opened=exports.PopoverElement.__opened.filter(e=>e!==this),clearTimeout(i(this,m)),removeEventListener("popstate",i(this,E))}};M=new WeakMap;c=new WeakMap;m=new WeakMap;d=new WeakMap;v=new WeakMap;f=new WeakMap;O=new WeakSet;x=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${i(this,u,g)}`};u=new WeakSet;g=function(){return`modal-${this.id}`};w=new WeakMap;y=new WeakMap;L=new WeakSet;$=function(t){(exports.PopoverElement.__opened[i(this,M)-1]||exports.PopoverElement.__opened.length===1)&&t()};E=new WeakMap;exports.PopoverElement.__opened=[];exports.PopoverElement=K([S.define("e-popover")],exports.PopoverElement);var U=Object.defineProperty,z=Object.getOwnPropertyDescriptor,F=(t,e,s,r)=>{for(var a=r>1?void 0:r?z(e,s):e,l=t.length-1,p;l>=0;l--)(p=t[l])&&(a=(r?p(e,s,a):p(a))||a);return r&&a&&U(e,s,a),a},B=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)},o=(t,e,s)=>(B(t,e,"read from private field"),s?s.call(t):e.get(t)),_=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},J=(t,e,s,r)=>(B(t,e,"write to private field"),e.set(t,s),s),n,P,C,k,T;exports.PopoverButtonElement=class extends S.CustomElement{constructor(){super(),_(this,n,void 0),_(this,P,()=>{this.classList.add("triggered")}),_(this,C,()=>{this.classList.add("opened")}),_(this,k,()=>{this.classList.remove("opened")}),_(this,T,()=>{this.classList.remove("triggered")}),I.isBrowser&&N.element(this,{tabindex:this.getAttribute("tabindex")||"0",onClick:()=>{if(o(this,n)){const e=this.getAttribute("type")||"open";e==="open"||e==="toggle"&&!o(this,n).opened.current?o(this,n).open():(e==="close"||e==="toggle"&&o(this,n).opened.current)&&o(this,n).close()}},onKeydown:e=>{e.code==="Space"&&e.currentTarget.click()}})}get popoverElement(){return o(this,n)}connectedCallback(){var s;const e=this.getAttribute("target");if(e){let r=null;e==="parent"?r=this.closest("[popover-target]"):e==="sibling"?r=(s=this.parentElement)==null?void 0:s.querySelector("[popover-target]"):r=document.querySelector(`#${e}`)||this.getRootNode().querySelector(`#${e}`),r instanceof HTMLElement?(J(this,n,r),o(this,n).addEventListener("popoverTriggered",o(this,P)),o(this,n).addEventListener("popoverOpened",o(this,C)),o(this,n).addEventListener("popoverClosing",o(this,k)),o(this,n).addEventListener("popoverClosed",o(this,T))):console.warn(this,`target ${e} not found`)}}disconnectedCallback(){o(this,n)&&(o(this,n).removeEventListener("popoverTriggered",o(this,P)),o(this,n).removeEventListener("popoverOpened",o(this,C)),o(this,n).removeEventListener("popoverClosing",o(this,k)),o(this,n).removeEventListener("popoverClosed",o(this,T)))}};n=new WeakMap;P=new WeakMap;C=new WeakMap;k=new WeakMap;T=new WeakMap;exports.PopoverButtonElement=F([S.define("e-popover-button")],exports.PopoverButtonElement);
@@ -15,7 +15,7 @@ var U = Object.defineProperty, z = Object.getOwnPropertyDescriptor, F = (e, t, s
15
15
  if (t.has(e))
16
16
  throw TypeError("Cannot add the same private member more than once");
17
17
  t instanceof WeakSet ? t.add(e) : t.set(e, s);
18
- }, O = (e, t, s, a) => (A(e, t, "write to private field"), t.set(e, s), s), b = (e, t, s) => (A(e, t, "access private method"), s), S, l, E, d, u, g, $, I, _, w, L, y, C, P, m;
18
+ }, O = (e, t, s, a) => (A(e, t, "write to private field"), t.set(e, s), s), b = (e, t, s) => (A(e, t, "access private method"), s), S, l, E, d, u, g, $, I, _, m, L, y, C, P, w;
19
19
  let h = class extends q {
20
20
  constructor() {
21
21
  super(), p(this, $), p(this, _), p(this, C), p(this, S, -1), p(this, l, new R(!1)), p(this, E, void 0), p(this, d, new x(this, "history", !1)), p(this, u, new x(this, "single", !1)), p(this, g, !1), this.open = (e = !0) => {
@@ -30,7 +30,7 @@ let h = class extends q {
30
30
  if (i(this, l).current) {
31
31
  if (i(this, l).current = !1, h.__opened = h.__opened.filter((e) => e !== this), i(this, d).current) {
32
32
  const e = new URL(location.href);
33
- e.searchParams.delete(i(this, _, w)), history.replaceState(null, "", e.href);
33
+ e.searchParams.delete(i(this, _, m)), history.replaceState(null, "", e.href);
34
34
  }
35
35
  this.classList.remove("opened"), this.style.opacity = "0", this.dispatchEvent(new CustomEvent("popoverClosing")), removeEventListener("click", i(this, L)), removeEventListener("keydown", i(this, y)), setTimeout(() => {
36
36
  this.classList.remove("triggered"), this.style.display = "none", this.dispatchEvent(new CustomEvent("popoverClosed"));
@@ -46,13 +46,9 @@ let h = class extends q {
46
46
  b(this, C, P).call(this, () => {
47
47
  e.code === "Escape" && this.close();
48
48
  });
49
- }), p(this, m, () => {
50
- O(this, g, !1), i(this, l).current && i(this, d).current && !location.search.includes(i(this, _, w)) ? this.close() : !i(this, l).current && i(this, d).current && location.search.includes(i(this, _, w)) && this.open(), O(this, g, !0);
51
- }), this.setAttribute("popover-target", ""), this.addEventListener("transitionstart", () => {
52
- this.classList.remove("transition-end"), this.classList.add("transition-start");
53
- }), this.addEventListener("transitionend", () => {
54
- this.classList.remove("transition-start"), this.classList.add("transition-end");
55
- });
49
+ }), p(this, w, () => {
50
+ O(this, g, !1), i(this, l).current && i(this, d).current && !location.search.includes(i(this, _, m)) ? this.close() : !i(this, l).current && i(this, d).current && location.search.includes(i(this, _, m)) && this.open(), O(this, g, !0);
51
+ }), this.setAttribute("popover-target", "");
56
52
  }
57
53
  get history() {
58
54
  return i(this, d);
@@ -64,12 +60,12 @@ let h = class extends q {
64
60
  return i(this, l);
65
61
  }
66
62
  connectedCallback() {
67
- i(this, d).observe(), i(this, u).observe(), this.style.opacity = "0", this.style.display = "none", addEventListener("popstate", i(this, m)), setTimeout(() => {
68
- i(this, m).call(this);
63
+ i(this, d).observe(), i(this, u).observe(), this.style.opacity = "0", this.style.display = "none", addEventListener("popstate", i(this, w)), setTimeout(() => {
64
+ i(this, w).call(this);
69
65
  }, 0);
70
66
  }
71
67
  disconnectedCallback() {
72
- i(this, d).unobserve(), i(this, u).unobserve(), h.__opened = h.__opened.filter((e) => e !== this), clearTimeout(i(this, E)), removeEventListener("popstate", i(this, m)), this.classList.remove("transition-end"), this.classList.remove("transition-start");
68
+ i(this, d).unobserve(), i(this, u).unobserve(), h.__opened = h.__opened.filter((e) => e !== this), clearTimeout(i(this, E)), removeEventListener("popstate", i(this, w));
73
69
  }
74
70
  };
75
71
  S = /* @__PURE__ */ new WeakMap();
@@ -80,10 +76,10 @@ u = /* @__PURE__ */ new WeakMap();
80
76
  g = /* @__PURE__ */ new WeakMap();
81
77
  $ = /* @__PURE__ */ new WeakSet();
82
78
  I = function() {
83
- return `${location.pathname}${location.search ? location.search + "&" : "?"}${i(this, _, w)}`;
79
+ return `${location.pathname}${location.search ? location.search + "&" : "?"}${i(this, _, m)}`;
84
80
  };
85
81
  _ = /* @__PURE__ */ new WeakSet();
86
- w = function() {
82
+ m = function() {
87
83
  return `modal-${this.id}`;
88
84
  };
89
85
  L = /* @__PURE__ */ new WeakMap();
@@ -92,7 +88,7 @@ C = /* @__PURE__ */ new WeakSet();
92
88
  P = function(e) {
93
89
  (h.__opened[i(this, S) - 1] || h.__opened.length === 1) && e();
94
90
  };
95
- m = /* @__PURE__ */ new WeakMap();
91
+ w = /* @__PURE__ */ new WeakMap();
96
92
  h.__opened = [];
97
93
  h = F([
98
94
  H("e-popover")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.7.9",
3
+ "version": "0.7.11",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"