aptechka 0.11.10 → 0.11.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.
@@ -19,20 +19,20 @@ var s = (l, e, n) => (I(l, e, "read from private field"), n ? n.call(l) : e.get(
19
19
  throw TypeError("Cannot add the same private member more than once");
20
20
  e instanceof WeakSet ? e.add(l) : e.set(l, n);
21
21
  };
22
- var T = (l, e, n) => new Promise((o, t) => {
23
- var d = (h) => {
22
+ var T = (l, e, n) => new Promise((o, d) => {
23
+ var t = (h) => {
24
24
  try {
25
25
  c(n.next(h));
26
26
  } catch (r) {
27
- t(r);
27
+ d(r);
28
28
  }
29
29
  }, i = (h) => {
30
30
  try {
31
31
  c(n.throw(h));
32
32
  } catch (r) {
33
- t(r);
33
+ d(r);
34
34
  }
35
- }, c = (h) => h.done ? o(h.value) : Promise.resolve(h.value).then(d, i);
35
+ }, c = (h) => h.done ? o(h.value) : Promise.resolve(h.value).then(t, i);
36
36
  c((n = n.apply(l, e)).next());
37
37
  });
38
38
  import { E as x } from "./ElementConstructor-Be8H1POO.js";
@@ -41,7 +41,7 @@ import { c as $ } from "./string-f0Dnk0L1.js";
41
41
  import { c as E, n as k, a as y } from "./globals-DMjysUXI.js";
42
42
  import "./Store-Qr3SNOSf.js";
43
43
  import "./ticker/index.js";
44
- var p, C, a, u, v;
44
+ var p, C, a, v, u;
45
45
  class j extends HTMLElement {
46
46
  constructor(n) {
47
47
  var i;
@@ -49,22 +49,22 @@ class j extends HTMLElement {
49
49
  f(this, p, /* @__PURE__ */ new Set());
50
50
  f(this, C, /* @__PURE__ */ new Set());
51
51
  f(this, a, /* @__PURE__ */ new Map());
52
- f(this, u, () => {
52
+ f(this, v, () => {
53
53
  y.value.unshift(s(this, a));
54
54
  });
55
- f(this, v, () => {
55
+ f(this, u, () => {
56
56
  y.value = y.value.filter(
57
57
  (n) => n !== s(this, a)
58
58
  );
59
59
  });
60
60
  const o = E.value;
61
- E.value = this, s(this, u).call(this);
62
- const t = n == null ? void 0 : n.tag(w(m({}, n.attributes), {
61
+ E.value = this, s(this, v).call(this);
62
+ const d = n == null ? void 0 : n.tag(w(m({}, n.attributes), {
63
63
  this: this
64
- })), d = (i = k.value) != null && i.lightChildren ? "lightChildren" : "children";
64
+ })), t = (i = k.value) != null && i.lightChildren ? "lightChildren" : "children";
65
65
  new x(this, w(m({}, k.value), {
66
- [d]: t
67
- })), E.value = o, k.value = null, s(this, v).call(this);
66
+ [t]: d
67
+ })), E.value = o, k.value = null, s(this, u).call(this);
68
68
  }
69
69
  addConnectCallback(n) {
70
70
  s(this, p).add(n);
@@ -79,27 +79,27 @@ class j extends HTMLElement {
79
79
  E.value = this, s(this, p).forEach((n) => T(this, null, function* () {
80
80
  const o = yield n(this);
81
81
  this.isConnected && o && s(this, C).add(o);
82
- })), E.value = null, this.addEventListener("beforeChildrenChange", s(this, u)), this.addEventListener("afterChildrenChange", s(this, v));
82
+ })), E.value = null, this.addEventListener("beforeChildrenChange", s(this, v)), this.addEventListener("afterChildrenChange", s(this, u));
83
83
  }
84
84
  disconnectedCallback() {
85
85
  s(this, C).forEach((n) => {
86
86
  n(this);
87
- }), this.removeEventListener("beforeChildrenChange", s(this, u)), this.removeEventListener("afterChildrenChange", s(this, v));
87
+ }), this.removeEventListener("beforeChildrenChange", s(this, v)), this.removeEventListener("afterChildrenChange", s(this, u));
88
88
  }
89
89
  }
90
- p = new WeakMap(), C = new WeakMap(), a = new WeakMap(), u = new WeakMap(), v = new WeakMap();
90
+ p = new WeakMap(), C = new WeakMap(), a = new WeakMap(), v = new WeakMap(), u = new WeakMap();
91
91
  function q(l, e, ...n) {
92
92
  var i;
93
93
  n = n.flat().filter((c) => c != null);
94
- const o = [], t = [];
94
+ const o = [], d = [];
95
95
  e = e || {}, o.push(...n.reverse());
96
- const d = l === "instance";
97
- if (d && e.from && (l = e.from, e == null || delete e.from), typeof l == "function")
98
- if (d) {
96
+ const t = l === "instance";
97
+ if (t && e.from && (l = e.from, e == null || delete e.from), typeof l == "function")
98
+ if (e.children = o.reverse(), t) {
99
99
  let c = null;
100
- return K(l) ? c = new l() : c = l(), delete e.children, () => new x(c, e).node;
100
+ return K(l) ? c = new l() : c = l(), e.lightChildren && (e.lightChildren = e.children, delete e.children), () => new x(c, e).node;
101
101
  } else {
102
- if (e.children = o.reverse(), l === g)
102
+ if (l === g)
103
103
  return g(e.children);
104
104
  const c = {
105
105
  noCustomElement: l.noCustomElement,
@@ -124,15 +124,15 @@ function q(l, e, ...n) {
124
124
  }
125
125
  for (; o.length; ) {
126
126
  const c = o.pop();
127
- Array.isArray(c) ? o.push(...c) : c != null && t.push(c);
127
+ Array.isArray(c) ? o.push(...c) : c != null && d.push(c);
128
128
  }
129
129
  if (l === "component") {
130
- const c = g(t);
130
+ const c = g(d);
131
131
  return k.value = e, c.node;
132
132
  } else {
133
133
  const c = e != null && e.lightChildren ? "lightChildren" : "children";
134
134
  return e == null || delete e.children, l ? new x(l, w(m({}, e), {
135
- [c]: t
135
+ [c]: d
136
136
  })) : null;
137
137
  }
138
138
  }
@@ -0,0 +1 @@
1
+ "use strict";var T=Object.defineProperty,_=Object.defineProperties;var F=Object.getOwnPropertyDescriptors;var g=Object.getOwnPropertySymbols;var M=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;var y=(l,e,n)=>e in l?T(l,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):l[e]=n,m=(l,e)=>{for(var n in e||(e={}))M.call(e,n)&&y(l,n,e[n]);if(g)for(var n of g(e))R.call(e,n)&&y(l,n,e[n]);return l},k=(l,e)=>_(l,F(e));var D=(l,e,n)=>{if(!e.has(l))throw TypeError("Cannot "+n)};var o=(l,e,n)=>(D(l,e,"read from private field"),n?n.call(l):e.get(l)),u=(l,e,n)=>{if(e.has(l))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(l):e.set(l,n)};var A=(l,e,n)=>new Promise((t,d)=>{var C=s=>{try{c(n.next(s))}catch(h){d(h)}},i=s=>{try{c(n.throw(s))}catch(h){d(h)}},c=s=>s.done?t(s.value):Promise.resolve(s.value).then(C,i);c((n=n.apply(l,e)).next())});const w=require("./ElementConstructor-khLPmQ9V.cjs"),j=require("./object-CCiXnER2.cjs"),H=require("./string-DhgS_iFl.cjs"),r=require("./globals-bYKki-b9.cjs");require("./Store-Cr3VaD9G.cjs");require("./ticker/index.cjs");var x,f,E,a,v;class I extends HTMLElement{constructor(n){var i;super();u(this,x,new Set);u(this,f,new Set);u(this,E,new Map);u(this,a,()=>{r.contextStack.value.unshift(o(this,E))});u(this,v,()=>{r.contextStack.value=r.contextStack.value.filter(n=>n!==o(this,E))});const t=r.currentComponentElement.value;r.currentComponentElement.value=this,o(this,a).call(this);const d=n==null?void 0:n.tag(k(m({},n.attributes),{this:this})),C=(i=r.nextComponentAttributes.value)!=null&&i.lightChildren?"lightChildren":"children";new w.ElementConstructor(this,k(m({},r.nextComponentAttributes.value),{[C]:d})),r.currentComponentElement.value=t,r.nextComponentAttributes.value=null,o(this,v).call(this)}addConnectCallback(n){o(this,x).add(n)}addDisconnectCallback(n){o(this,f).add(n)}createContext(n,t){o(this,E).set(n,t)}connectedCallback(){r.currentComponentElement.value=this,o(this,x).forEach(n=>A(this,null,function*(){const t=yield n(this);this.isConnected&&t&&o(this,f).add(t)})),r.currentComponentElement.value=null,this.addEventListener("beforeChildrenChange",o(this,a)),this.addEventListener("afterChildrenChange",o(this,v))}disconnectedCallback(){o(this,f).forEach(n=>{n(this)}),this.removeEventListener("beforeChildrenChange",o(this,a)),this.removeEventListener("afterChildrenChange",o(this,v))}}x=new WeakMap,f=new WeakMap,E=new WeakMap,a=new WeakMap,v=new WeakMap;function q(l,e,...n){var i;n=n.flat().filter(c=>c!=null);const t=[],d=[];e=e||{},t.push(...n.reverse());const C=l==="instance";if(C&&e.from&&(l=e.from,e==null||delete e.from),typeof l=="function")if(e.children=t.reverse(),C){let c=null;return j.isESClass(l)?c=new l:c=l(),e.lightChildren&&(e.lightChildren=e.children,delete e.children),()=>new w.ElementConstructor(c,e).node}else{if(l===p)return p(e.children);const c={noCustomElement:l.noCustomElement,onlyRegister:e.__register};if(e==null||delete e.__register,c.noCustomElement){const S=l(m({},e));return()=>S}const s=`e-${H.camelToKebab(l.name)}`;let h=customElements.get(s);return h||(h=(i=class extends I{constructor(L){super(c.onlyRegister?{tag:l,attributes:e}:L)}},i.formAssociated=l.formAssociated,i),customElements.define(s,h)),()=>c.onlyRegister?h:new h({tag:l,attributes:e})}for(;t.length;){const c=t.pop();Array.isArray(c)?t.push(...c):c!=null&&d.push(c)}if(l==="component"){const c=p(d);return r.nextComponentAttributes.value=e,c.node}else{const c=e!=null&&e.lightChildren?"lightChildren":"children";return e==null||delete e.children,l?new w.ElementConstructor(l,k(m({},e),{[c]:d})):null}}function p(l){return new w.ElementConstructor(document.createDocumentFragment(),{children:l})}function K(l,e){const n=e==null?void 0:e.children,t=e==null?void 0:e.attributes;return q(l,m({},t),n)()}exports.Fragment=p;exports.h=q;exports.instantiate=K;
@@ -1 +1 @@
1
- "use strict";var g=Object.defineProperty,R=Object.defineProperties;var p=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var f=(t,e,n)=>e in t?g(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,i=(t,e)=>{for(var n in e||(e={}))E.call(e,n)&&f(t,n,e[n]);if(h)for(var n of h(e))x.call(e,n)&&f(t,n,e[n]);return t},m=(t,e)=>R(t,p(e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../instantiate-C7JiqF_y.cjs"),o=require("../globals-bYKki-b9.cjs");require("../Store-Cr3VaD9G.cjs");require("../ticker/index.cjs");const d=require("../_createStore-C75y9luu.cjs"),w=require("../tags-BdW7ATzD.cjs"),C=require("../createStylesheet-BBBiyAsF.cjs"),S=require("../onConnect-DGP866cj.cjs");function q(t,e){((e==null?void 0:e.containerElement)||document.body).appendChild(a.instantiate(t,e))}function v(t,e=null,...n){return a.h(t,m(i({},e),{__register:!0}),...n)}function T(){return o.currentComponentElement.value.attachInternals()}function b(t){return o.currentComponentElement.value.attachShadow(i({mode:"open"},t))}function _(t){o.currentComponentElement.value.shadowRoot&&o.currentComponentElement.value.shadowRoot.adoptedStyleSheets.push(C.createStylesheet(t)),S.onConnect(e=>{if(e.shadowRoot)return;const n=e.getRootNode();if(n===document){const c=w.style(t).node;if(![...document.head.querySelectorAll("style")].find(r=>r.outerHTML===c.outerHTML))return document.head.appendChild(c),()=>{c.remove()}}else if(n instanceof ShadowRoot){const c=C.createStylesheet(t),s=[];return n.adoptedStyleSheets.filter(r=>{const y=Array.from(r.cssRules);Array.from(c.cssRules).filter(u=>!y.find(l=>l.cssText===u.cssText)).forEach(u=>{const l=r.insertRule(u.cssText);s.push(()=>{r.deleteRule(l)})})}),()=>{s.forEach(r=>r())}}})}function M(t){const e=o.contextStack.value.find(n=>n.has(t));if(e)return e.get(t)}function A(t,e){o.currentComponentElement.value.createContext(t,e)}function D(t){return{current:t}}function I(t,e){const n=t.subscribe(e);d.onDisconnect(()=>{n()})}exports.Fragment=a.Fragment;exports.h=a.h;exports.instantiate=a.instantiate;exports.currentComponentElement=o.currentComponentElement;exports._createStore=d._createStore;exports.onDisconnect=d.onDisconnect;exports.onConnect=S.onConnect;exports.attachInternals=T;exports.attachShadow=b;exports.attachStylesheet=_;exports.createContext=A;exports.createRef=D;exports.getContext=M;exports.onStoreChange=I;exports.register=v;exports.render=q;
1
+ "use strict";var g=Object.defineProperty,R=Object.defineProperties;var p=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var f=(t,e,n)=>e in t?g(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,i=(t,e)=>{for(var n in e||(e={}))E.call(e,n)&&f(t,n,e[n]);if(h)for(var n of h(e))x.call(e,n)&&f(t,n,e[n]);return t},m=(t,e)=>R(t,p(e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../instantiate-DfsD19EH.cjs"),o=require("../globals-bYKki-b9.cjs");require("../Store-Cr3VaD9G.cjs");require("../ticker/index.cjs");const d=require("../_createStore-C75y9luu.cjs"),w=require("../tags-BdW7ATzD.cjs"),C=require("../createStylesheet-BBBiyAsF.cjs"),S=require("../onConnect-DGP866cj.cjs");function q(t,e){((e==null?void 0:e.containerElement)||document.body).appendChild(a.instantiate(t,e))}function v(t,e=null,...n){return a.h(t,m(i({},e),{__register:!0}),...n)}function T(){return o.currentComponentElement.value.attachInternals()}function b(t){return o.currentComponentElement.value.attachShadow(i({mode:"open"},t))}function _(t){o.currentComponentElement.value.shadowRoot&&o.currentComponentElement.value.shadowRoot.adoptedStyleSheets.push(C.createStylesheet(t)),S.onConnect(e=>{if(e.shadowRoot)return;const n=e.getRootNode();if(n===document){const c=w.style(t).node;if(![...document.head.querySelectorAll("style")].find(r=>r.outerHTML===c.outerHTML))return document.head.appendChild(c),()=>{c.remove()}}else if(n instanceof ShadowRoot){const c=C.createStylesheet(t),s=[];return n.adoptedStyleSheets.filter(r=>{const y=Array.from(r.cssRules);Array.from(c.cssRules).filter(u=>!y.find(l=>l.cssText===u.cssText)).forEach(u=>{const l=r.insertRule(u.cssText);s.push(()=>{r.deleteRule(l)})})}),()=>{s.forEach(r=>r())}}})}function M(t){const e=o.contextStack.value.find(n=>n.has(t));if(e)return e.get(t)}function A(t,e){o.currentComponentElement.value.createContext(t,e)}function D(t){return{current:t}}function I(t,e){const n=t.subscribe(e);d.onDisconnect(()=>{n()})}exports.Fragment=a.Fragment;exports.h=a.h;exports.instantiate=a.instantiate;exports.currentComponentElement=o.currentComponentElement;exports._createStore=d._createStore;exports.onDisconnect=d.onDisconnect;exports.onConnect=S.onConnect;exports.attachInternals=T;exports.attachShadow=b;exports.attachStylesheet=_;exports.createContext=A;exports.createRef=D;exports.getContext=M;exports.onStoreChange=I;exports.register=v;exports.render=q;
@@ -10,8 +10,8 @@ var f = (t, e, n) => e in t ? p(t, e, { enumerable: !0, configurable: !0, writab
10
10
  S.call(e, n) && f(t, n, e[n]);
11
11
  return t;
12
12
  }, d = (t, e) => y(t, R(e));
13
- import { i as C, h as g } from "../instantiate-DHwz5QVl.js";
14
- import { F as V } from "../instantiate-DHwz5QVl.js";
13
+ import { i as C, h as g } from "../instantiate-CfK7LHHy.js";
14
+ import { F as V } from "../instantiate-CfK7LHHy.js";
15
15
  import { c as a, a as w } from "../globals-DMjysUXI.js";
16
16
  import "../Store-Qr3SNOSf.js";
17
17
  import "../ticker/index.js";
@@ -1 +1 @@
1
- "use strict";var Z=(a,e)=>(e=Symbol[a])?e:Symbol.for("Symbol."+a);var K=(a,e,s)=>{if(!e.has(a))throw TypeError("Cannot "+s)};var t=(a,e,s)=>(K(a,e,"read from private field"),s?s.call(a):e.get(a)),r=(a,e,s)=>{if(e.has(a))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(a):e.set(a,s)},n=(a,e,s,i)=>(K(a,e,"write to private field"),i?i.call(a,s):e.set(a,s),s);var W=(a,e,s)=>(K(a,e,"access private method"),s);var M=(a,e,s)=>new Promise((i,h)=>{var o=u=>{try{f(s.next(u))}catch(w){h(w)}},c=u=>{try{f(s.throw(u))}catch(w){h(w)}},f=u=>u.done?i(u.value):Promise.resolve(u.value).then(o,c);f((s=s.apply(a,e)).next())});var Y=(a,e,s)=>(e=a[Z("asyncIterator")])?e.call(a):(a=a[Z("iterator")](),e={},s=(i,h)=>(h=a[i])&&(e[i]=o=>new Promise((c,f,u)=>(o=h.call(a,o),u=o.done,Promise.resolve(o.value).then(w=>c({value:w,done:u}),f)))),s("next"),s("return"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const at=require("urlpattern-polyfill"),rt=require("../notifier/index.cjs"),tt=require("../browser-CpzFX2xg.cjs"),ht=require("../function-MthRj-GJ.cjs"),F=require("../url-C3dWnJQg.cjs"),ot=require("../instantiate-C7JiqF_y.cjs"),$=require("../object-CCiXnER2.cjs");var R,O,A,p,d,v,S,L,b,E,x,et;class ct{constructor(e,s){r(this,x);r(this,R,void 0);r(this,O,void 0);r(this,A,void 0);r(this,p,void 0);r(this,d,void 0);r(this,v,void 0);r(this,S,void 0);r(this,L,null);r(this,b,[]);r(this,E,[]);n(this,R,e),n(this,O,s),n(this,A,new URLPattern({pathname:t(this,R)})),n(this,p,null),n(this,d,null),n(this,v,!1),n(this,S,null),tt.isBrowser&&n(this,L,new MutationObserver(i=>{i[0].addedNodes.forEach(o=>{t(this,p)?t(this,E).push(o):t(this,b).push(o)})}))}get pattern(){return t(this,R)}get urlPattern(){return t(this,A)}get isActive(){return t(this,v)}get element(){return t(this,d)}get nest(){return t(this,S)}testPathname(e){return this.urlPattern.test({pathname:e})}render(e,s){return M(this,null,function*(){var i,h;if(t(this,L).observe(document.head,{childList:!0,subtree:!0}),t(this,p))t(this,b).forEach(o=>{document.head.appendChild(o)});else{const o=yield t(this,O).call(this);if(n(this,E,[...t(this,b)]),typeof o.default=="function"&&(n(this,p,o.default),$.isESClass(o.default))){const c="e-"+((i=t(this,p))==null?void 0:i.name.toLowerCase());customElements.get(c)||customElements.define(c,o.default)}}if(yield W(this,x,et).call(this),t(this,p)){const o=t(this,A).exec({pathname:s}),c=(o==null?void 0:o.pathname.groups)||{},f=Object.fromEntries(new URLSearchParams(location.search)),u={pathnameParams:c,searchParams:f};$.isESClass(t(this,p))?n(this,d,new(t(this,p))(u)):n(this,d,ot.instantiate(t(this,p),{attributes:u})),e.appendChild(t(this,d)),n(this,S,t(this,d).querySelector("[data-nest]")||((h=t(this,d).shadowRoot)==null?void 0:h.querySelector("[data-nest]"))||t(this,d).shadowRoot||t(this,d)),n(this,v,!0)}t(this,L).disconnect()})}close(){var e;t(this,L).disconnect(),(e=t(this,d))==null||e.remove(),n(this,v,!1),t(this,E).forEach(s=>document.head.removeChild(s)),n(this,E,[])}getAnchorElements(){var s;let e=[];return t(this,d)&&(e=[...t(this,d).querySelectorAll("a")]),(s=t(this,d))!=null&&s.shadowRoot&&(e=[...e,...t(this,d).shadowRoot.querySelectorAll("a")]),e}}R=new WeakMap,O=new WeakMap,A=new WeakMap,p=new WeakMap,d=new WeakMap,v=new WeakMap,S=new WeakMap,L=new WeakMap,b=new WeakMap,E=new WeakMap,x=new WeakSet,et=function(){return M(this,null,function*(){const e=t(this,b).filter(c=>c instanceof HTMLElement?c.tagName==="STYLE"||c.tagName==="SCRIPT"||c.tagName==="LINK":!1);try{for(var s=Y(e),i,h,o;i=!(h=yield s.next()).done;i=!1){const c=h.value;yield new Promise(f=>{c.onload=()=>{f()}})}}catch(h){o=[h]}finally{try{i&&(h=s.return)&&(yield h.call(s))}finally{if(o)throw o[0]}}})};var k,m,P,U,q,j;class lt{constructor(e,s){r(this,k,void 0);r(this,m,void 0);r(this,P,void 0);r(this,U,void 0);r(this,q,void 0);r(this,j,e=>{e.preventDefault(),t(this,k).links.forEach(s=>{var i;t(this,P)===t(s,P)||(i=t(s,q))!=null&&i.includes(t(this,P))?t(s,m).classList.add("clicked"):t(s,m).classList.remove("clicked")}),t(this,k).navigate(t(this,P),t(this,U))});var o,c;n(this,k,e),n(this,m,s),n(this,P,t(this,m).getAttribute("href")||"/"),n(this,U,t(this,m).getAttribute("data-history-action")||"push"),t(this,m).addEventListener("click",t(this,j));const i=e.normalizePath(t(this,P)),h=e.normalizePath(location.pathname);n(this,q,(o=t(this,m).getAttribute("data-match-paths"))==null?void 0:o.split(",").map(f=>e.normalizePath(f.trim()).pathname)),t(this,m).hasAttribute("data-include")?h.pathname.includes(i.pathname)&&t(this,m).classList.add("current"):i.pathname===h.pathname||(c=t(this,q))!=null&&c.includes(h.pathname)?(t(this,m).classList.add("current"),t(this,m).classList.add("clicked")):t(this,m).classList.remove("clicked")}destroy(){t(this,m).removeEventListener("click",t(this,j)),t(this,m).classList.remove("current")}}k=new WeakMap,m=new WeakMap,P=new WeakMap,U=new WeakMap,q=new WeakMap,j=new WeakMap;globalThis.URLPattern=at.URLPattern;var C,N,g,z,T,y,H,B,I,_,st,D;class ut{constructor(e){r(this,_);r(this,C,null);r(this,N,null);r(this,g,[]);r(this,z,null);r(this,T,[]);r(this,y,void 0);r(this,H,null);r(this,B,new rt.Notifier);r(this,I,ht.debounce(()=>{const e=s=>s.split("/").length;n(this,g,t(this,g).sort((s,i)=>e(s.pattern)-e(i.pattern))),this.navigate(location.pathname)},0));r(this,D,e=>{e.state&&this.navigate(e.state,"none")});tt.isBrowser&&(e!=null&&e.base?n(this,N,F.normalizeBase(e.base)):n(this,N,"/"),n(this,C,(e==null?void 0:e.rootElement)||document.body),addEventListener("popstate",t(this,D)))}get currentPathname(){return t(this,H)}get candidatePathname(){return t(this,y)}get routes(){return t(this,g)}get links(){return t(this,T)}navigationEvent(e){return t(this,B).subscribe(e)}defineRoute(e,s){const i=new ct(e,s);t(this,g).push(i),t(this,I).call(this)}navigate(e,s="push"){return M(this,null,function*(){var Q,V;const i=this.normalizePath(e);let{pathname:h,hash:o,parameters:c,leaf:f}=i;if(t(this,y)===h||t(this,H)===h)return;n(this,y,h);const u=t(this,g).filter(l=>l.isActive),w=t(this,g).filter(l=>!u.includes(l)&&l.testPathname(f)),it=u.filter(l=>!l.testPathname(f)),G=u.filter(l=>l.testPathname(f));let J=!0;if(this.preprocessor)try{yield new Promise((l,nt)=>{var X;(X=this.preprocessor)==null||X.call(this,{path:i,resolve:l,reject:nt})})}catch(l){l?console.error(l):console.log("Route change canceled"),J=!1}if(J&&t(this,y)===h){n(this,z,G[G.length-1]),it.forEach(l=>{l.close()}),n(this,H,h),F.changeHistory(s,h,c,o);try{for(var ft=Y(w),pt,gt,Pt;pt=!(gt=yield ft.next()).done;pt=!1){const l=gt.value;yield l.render(((Q=t(this,z))==null?void 0:Q.nest)||t(this,C),h),n(this,z,l)}}catch(gt){Pt=[gt]}finally{try{pt&&(gt=ft.return)&&(yield gt.call(ft))}finally{if(Pt)throw Pt[0]}}W(this,_,st).call(this),(V=this.postprocessor)==null||V.call(this,{pathname:h}),t(this,B).notify({pathname:h})}})}normalizePath(e){return F.splitPath(e,t(this,N))}}C=new WeakMap,N=new WeakMap,g=new WeakMap,z=new WeakMap,T=new WeakMap,y=new WeakMap,H=new WeakMap,B=new WeakMap,I=new WeakMap,_=new WeakSet,st=function(){const e=t(this,g).filter(i=>i.isActive),s=Array.from(new Set([...t(this,C).querySelectorAll("a"),...e.map(i=>i.getAnchorElements()).flat()].filter(i=>{var h;return(h=i.getAttribute("href"))==null?void 0:h.startsWith("/")})));t(this,T).forEach(i=>{i.destroy()}),n(this,T,s.map(i=>new lt(this,i)))},D=new WeakMap;exports.Router=ut;
1
+ "use strict";var Z=(a,e)=>(e=Symbol[a])?e:Symbol.for("Symbol."+a);var K=(a,e,s)=>{if(!e.has(a))throw TypeError("Cannot "+s)};var t=(a,e,s)=>(K(a,e,"read from private field"),s?s.call(a):e.get(a)),r=(a,e,s)=>{if(e.has(a))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(a):e.set(a,s)},n=(a,e,s,i)=>(K(a,e,"write to private field"),i?i.call(a,s):e.set(a,s),s);var W=(a,e,s)=>(K(a,e,"access private method"),s);var M=(a,e,s)=>new Promise((i,h)=>{var o=u=>{try{f(s.next(u))}catch(w){h(w)}},c=u=>{try{f(s.throw(u))}catch(w){h(w)}},f=u=>u.done?i(u.value):Promise.resolve(u.value).then(o,c);f((s=s.apply(a,e)).next())});var Y=(a,e,s)=>(e=a[Z("asyncIterator")])?e.call(a):(a=a[Z("iterator")](),e={},s=(i,h)=>(h=a[i])&&(e[i]=o=>new Promise((c,f,u)=>(o=h.call(a,o),u=o.done,Promise.resolve(o.value).then(w=>c({value:w,done:u}),f)))),s("next"),s("return"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const at=require("urlpattern-polyfill"),rt=require("../notifier/index.cjs"),tt=require("../browser-CpzFX2xg.cjs"),ht=require("../function-MthRj-GJ.cjs"),F=require("../url-C3dWnJQg.cjs"),ot=require("../instantiate-DfsD19EH.cjs"),$=require("../object-CCiXnER2.cjs");var R,O,A,p,d,v,S,L,b,E,x,et;class ct{constructor(e,s){r(this,x);r(this,R,void 0);r(this,O,void 0);r(this,A,void 0);r(this,p,void 0);r(this,d,void 0);r(this,v,void 0);r(this,S,void 0);r(this,L,null);r(this,b,[]);r(this,E,[]);n(this,R,e),n(this,O,s),n(this,A,new URLPattern({pathname:t(this,R)})),n(this,p,null),n(this,d,null),n(this,v,!1),n(this,S,null),tt.isBrowser&&n(this,L,new MutationObserver(i=>{i[0].addedNodes.forEach(o=>{t(this,p)?t(this,E).push(o):t(this,b).push(o)})}))}get pattern(){return t(this,R)}get urlPattern(){return t(this,A)}get isActive(){return t(this,v)}get element(){return t(this,d)}get nest(){return t(this,S)}testPathname(e){return this.urlPattern.test({pathname:e})}render(e,s){return M(this,null,function*(){var i,h;if(t(this,L).observe(document.head,{childList:!0,subtree:!0}),t(this,p))t(this,b).forEach(o=>{document.head.appendChild(o)});else{const o=yield t(this,O).call(this);if(n(this,E,[...t(this,b)]),typeof o.default=="function"&&(n(this,p,o.default),$.isESClass(o.default))){const c="e-"+((i=t(this,p))==null?void 0:i.name.toLowerCase());customElements.get(c)||customElements.define(c,o.default)}}if(yield W(this,x,et).call(this),t(this,p)){const o=t(this,A).exec({pathname:s}),c=(o==null?void 0:o.pathname.groups)||{},f=Object.fromEntries(new URLSearchParams(location.search)),u={pathnameParams:c,searchParams:f};$.isESClass(t(this,p))?n(this,d,new(t(this,p))(u)):n(this,d,ot.instantiate(t(this,p),{attributes:u})),e.appendChild(t(this,d)),n(this,S,t(this,d).querySelector("[data-nest]")||((h=t(this,d).shadowRoot)==null?void 0:h.querySelector("[data-nest]"))||t(this,d).shadowRoot||t(this,d)),n(this,v,!0)}t(this,L).disconnect()})}close(){var e;t(this,L).disconnect(),(e=t(this,d))==null||e.remove(),n(this,v,!1),t(this,E).forEach(s=>document.head.removeChild(s)),n(this,E,[])}getAnchorElements(){var s;let e=[];return t(this,d)&&(e=[...t(this,d).querySelectorAll("a")]),(s=t(this,d))!=null&&s.shadowRoot&&(e=[...e,...t(this,d).shadowRoot.querySelectorAll("a")]),e}}R=new WeakMap,O=new WeakMap,A=new WeakMap,p=new WeakMap,d=new WeakMap,v=new WeakMap,S=new WeakMap,L=new WeakMap,b=new WeakMap,E=new WeakMap,x=new WeakSet,et=function(){return M(this,null,function*(){const e=t(this,b).filter(c=>c instanceof HTMLElement?c.tagName==="STYLE"||c.tagName==="SCRIPT"||c.tagName==="LINK":!1);try{for(var s=Y(e),i,h,o;i=!(h=yield s.next()).done;i=!1){const c=h.value;yield new Promise(f=>{c.onload=()=>{f()}})}}catch(h){o=[h]}finally{try{i&&(h=s.return)&&(yield h.call(s))}finally{if(o)throw o[0]}}})};var k,m,P,U,q,j;class lt{constructor(e,s){r(this,k,void 0);r(this,m,void 0);r(this,P,void 0);r(this,U,void 0);r(this,q,void 0);r(this,j,e=>{e.preventDefault(),t(this,k).links.forEach(s=>{var i;t(this,P)===t(s,P)||(i=t(s,q))!=null&&i.includes(t(this,P))?t(s,m).classList.add("clicked"):t(s,m).classList.remove("clicked")}),t(this,k).navigate(t(this,P),t(this,U))});var o,c;n(this,k,e),n(this,m,s),n(this,P,t(this,m).getAttribute("href")||"/"),n(this,U,t(this,m).getAttribute("data-history-action")||"push"),t(this,m).addEventListener("click",t(this,j));const i=e.normalizePath(t(this,P)),h=e.normalizePath(location.pathname);n(this,q,(o=t(this,m).getAttribute("data-match-paths"))==null?void 0:o.split(",").map(f=>e.normalizePath(f.trim()).pathname)),t(this,m).hasAttribute("data-include")?h.pathname.includes(i.pathname)&&t(this,m).classList.add("current"):i.pathname===h.pathname||(c=t(this,q))!=null&&c.includes(h.pathname)?(t(this,m).classList.add("current"),t(this,m).classList.add("clicked")):t(this,m).classList.remove("clicked")}destroy(){t(this,m).removeEventListener("click",t(this,j)),t(this,m).classList.remove("current")}}k=new WeakMap,m=new WeakMap,P=new WeakMap,U=new WeakMap,q=new WeakMap,j=new WeakMap;globalThis.URLPattern=at.URLPattern;var C,N,g,z,T,y,H,B,I,_,st,D;class ut{constructor(e){r(this,_);r(this,C,null);r(this,N,null);r(this,g,[]);r(this,z,null);r(this,T,[]);r(this,y,void 0);r(this,H,null);r(this,B,new rt.Notifier);r(this,I,ht.debounce(()=>{const e=s=>s.split("/").length;n(this,g,t(this,g).sort((s,i)=>e(s.pattern)-e(i.pattern))),this.navigate(location.pathname)},0));r(this,D,e=>{e.state&&this.navigate(e.state,"none")});tt.isBrowser&&(e!=null&&e.base?n(this,N,F.normalizeBase(e.base)):n(this,N,"/"),n(this,C,(e==null?void 0:e.rootElement)||document.body),addEventListener("popstate",t(this,D)))}get currentPathname(){return t(this,H)}get candidatePathname(){return t(this,y)}get routes(){return t(this,g)}get links(){return t(this,T)}navigationEvent(e){return t(this,B).subscribe(e)}defineRoute(e,s){const i=new ct(e,s);t(this,g).push(i),t(this,I).call(this)}navigate(e,s="push"){return M(this,null,function*(){var Q,V;const i=this.normalizePath(e);let{pathname:h,hash:o,parameters:c,leaf:f}=i;if(t(this,y)===h||t(this,H)===h)return;n(this,y,h);const u=t(this,g).filter(l=>l.isActive),w=t(this,g).filter(l=>!u.includes(l)&&l.testPathname(f)),it=u.filter(l=>!l.testPathname(f)),G=u.filter(l=>l.testPathname(f));let J=!0;if(this.preprocessor)try{yield new Promise((l,nt)=>{var X;(X=this.preprocessor)==null||X.call(this,{path:i,resolve:l,reject:nt})})}catch(l){l?console.error(l):console.log("Route change canceled"),J=!1}if(J&&t(this,y)===h){n(this,z,G[G.length-1]),it.forEach(l=>{l.close()}),n(this,H,h),F.changeHistory(s,h,c,o);try{for(var ft=Y(w),pt,gt,Pt;pt=!(gt=yield ft.next()).done;pt=!1){const l=gt.value;yield l.render(((Q=t(this,z))==null?void 0:Q.nest)||t(this,C),h),n(this,z,l)}}catch(gt){Pt=[gt]}finally{try{pt&&(gt=ft.return)&&(yield gt.call(ft))}finally{if(Pt)throw Pt[0]}}W(this,_,st).call(this),(V=this.postprocessor)==null||V.call(this,{pathname:h}),t(this,B).notify({pathname:h})}})}normalizePath(e){return F.splitPath(e,t(this,N))}}C=new WeakMap,N=new WeakMap,g=new WeakMap,z=new WeakMap,T=new WeakMap,y=new WeakMap,H=new WeakMap,B=new WeakMap,I=new WeakMap,_=new WeakSet,st=function(){const e=t(this,g).filter(i=>i.isActive),s=Array.from(new Set([...t(this,C).querySelectorAll("a"),...e.map(i=>i.getAnchorElements()).flat()].filter(i=>{var h;return(h=i.getAttribute("href"))==null?void 0:h.startsWith("/")})));t(this,T).forEach(i=>{i.destroy()}),n(this,T,s.map(i=>new lt(this,i)))},D=new WeakMap;exports.Router=ut;
@@ -31,7 +31,7 @@ import { Notifier as nt } from "../notifier/index.js";
31
31
  import { i as _ } from "../browser-0zX67oeU.js";
32
32
  import { d as ht } from "../function-C10DGppn.js";
33
33
  import { n as rt, c as ot, s as ct } from "../url-DMNfW7uN.js";
34
- import { i as lt } from "../instantiate-DHwz5QVl.js";
34
+ import { i as lt } from "../instantiate-CfK7LHHy.js";
35
35
  import { i as Z } from "../object-D6MVWB4l.js";
36
36
  var y, U, A, p, m, L, k, v, E, R, M, tt;
37
37
  class ut {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.11.10",
3
+ "version": "0.11.11",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"
@@ -1 +0,0 @@
1
- "use strict";var T=Object.defineProperty,_=Object.defineProperties;var F=Object.getOwnPropertyDescriptors;var y=Object.getOwnPropertySymbols;var M=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;var g=(t,e,n)=>e in t?T(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,C=(t,e)=>{for(var n in e||(e={}))M.call(e,n)&&g(t,n,e[n]);if(y)for(var n of y(e))R.call(e,n)&&g(t,n,e[n]);return t},k=(t,e)=>_(t,F(e));var D=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)};var o=(t,e,n)=>(D(t,e,"read from private field"),n?n.call(t):e.get(t)),u=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)};var A=(t,e,n)=>new Promise((c,d)=>{var m=s=>{try{l(n.next(s))}catch(h){d(h)}},i=s=>{try{l(n.throw(s))}catch(h){d(h)}},l=s=>s.done?c(s.value):Promise.resolve(s.value).then(m,i);l((n=n.apply(t,e)).next())});const w=require("./ElementConstructor-khLPmQ9V.cjs"),j=require("./object-CCiXnER2.cjs"),H=require("./string-DhgS_iFl.cjs"),r=require("./globals-bYKki-b9.cjs");require("./Store-Cr3VaD9G.cjs");require("./ticker/index.cjs");var x,f,a,E,v;class I extends HTMLElement{constructor(n){var i;super();u(this,x,new Set);u(this,f,new Set);u(this,a,new Map);u(this,E,()=>{r.contextStack.value.unshift(o(this,a))});u(this,v,()=>{r.contextStack.value=r.contextStack.value.filter(n=>n!==o(this,a))});const c=r.currentComponentElement.value;r.currentComponentElement.value=this,o(this,E).call(this);const d=n==null?void 0:n.tag(k(C({},n.attributes),{this:this})),m=(i=r.nextComponentAttributes.value)!=null&&i.lightChildren?"lightChildren":"children";new w.ElementConstructor(this,k(C({},r.nextComponentAttributes.value),{[m]:d})),r.currentComponentElement.value=c,r.nextComponentAttributes.value=null,o(this,v).call(this)}addConnectCallback(n){o(this,x).add(n)}addDisconnectCallback(n){o(this,f).add(n)}createContext(n,c){o(this,a).set(n,c)}connectedCallback(){r.currentComponentElement.value=this,o(this,x).forEach(n=>A(this,null,function*(){const c=yield n(this);this.isConnected&&c&&o(this,f).add(c)})),r.currentComponentElement.value=null,this.addEventListener("beforeChildrenChange",o(this,E)),this.addEventListener("afterChildrenChange",o(this,v))}disconnectedCallback(){o(this,f).forEach(n=>{n(this)}),this.removeEventListener("beforeChildrenChange",o(this,E)),this.removeEventListener("afterChildrenChange",o(this,v))}}x=new WeakMap,f=new WeakMap,a=new WeakMap,E=new WeakMap,v=new WeakMap;function q(t,e,...n){var i;n=n.flat().filter(l=>l!=null);const c=[],d=[];e=e||{},c.push(...n.reverse());const m=t==="instance";if(m&&e.from&&(t=e.from,e==null||delete e.from),typeof t=="function")if(m){let l=null;return j.isESClass(t)?l=new t:l=t(),delete e.children,()=>new w.ElementConstructor(l,e).node}else{if(e.children=c.reverse(),t===p)return p(e.children);const l={noCustomElement:t.noCustomElement,onlyRegister:e.__register};if(e==null||delete e.__register,l.noCustomElement){const S=t(C({},e));return()=>S}const s=`e-${H.camelToKebab(t.name)}`;let h=customElements.get(s);return h||(h=(i=class extends I{constructor(L){super(l.onlyRegister?{tag:t,attributes:e}:L)}},i.formAssociated=t.formAssociated,i),customElements.define(s,h)),()=>l.onlyRegister?h:new h({tag:t,attributes:e})}for(;c.length;){const l=c.pop();Array.isArray(l)?c.push(...l):l!=null&&d.push(l)}if(t==="component"){const l=p(d);return r.nextComponentAttributes.value=e,l.node}else{const l=e!=null&&e.lightChildren?"lightChildren":"children";return e==null||delete e.children,t?new w.ElementConstructor(t,k(C({},e),{[l]:d})):null}}function p(t){return new w.ElementConstructor(document.createDocumentFragment(),{children:t})}function K(t,e){const n=e==null?void 0:e.children,c=e==null?void 0:e.attributes;return q(t,C({},c),n)()}exports.Fragment=p;exports.h=q;exports.instantiate=K;