aptechka 0.82.6 → 0.83.0

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 f=i=>{throw TypeError(i)};var h=(i,e,t)=>e.has(i)||f("Cannot "+t);var n=(i,e,t)=>(h(i,e,"read from private field"),t?t.call(i):e.get(i)),u=(i,e,t)=>e.has(i)?f("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),m=(i,e,t,r)=>(h(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),d=(i,e,t)=>(h(i,e,"access private method"),t);const v=require("./morph-B6sGhLCi.cjs");require("construct-style-sheets-polyfill");require("./index-OE2INULi.cjs");const L=require("./url-CPgw9bd5.cjs");var s,o,E,k,a;class S{constructor(e){u(this,o);u(this,s);u(this,a,e=>{var c,l,p;e.preventDefault();const{url:t,options:r={}}=(c=d(this,o,k).call(this,e))!=null?c:{};t&&(e.preventDefault(),(p=(l=n(this,s)).onClick)==null||p.call(l,t,r))});m(this,s,e),window.addEventListener("click",n(this,a))}destroy(){window.removeEventListener("click",n(this,a))}update(){document.querySelectorAll("a").forEach(e=>{L.normalizeURL(e.getAttribute("href"),{base:n(this,s).base,trailingSlash:n(this,s).trailingSlash}).pathname===location.pathname?e.classList.add("current"):e.classList.remove("current")})}}s=new WeakMap,o=new WeakSet,E=function(e){return(e==null?void 0:e.nodeType)===v.NODE_TYPE_ELEMENT},k=function(e){const t=e.composedPath()[0];if(!d(this,o,E).call(this,t))return;const r=t.closest("a");if(!r||typeof n(this,s).includeAnchor=="function"&&!n(this,s).includeAnchor(r)||r.closest("[data-router-ignore]"))return;const{href:c}=r;if(!L.isLocalUrl(c))return;const l={keepScrollPosition:"keepScrollPosition"in r.dataset,cache:"cache"in r.dataset,revalidate:"revalidate"in r.dataset};return{url:L.normalizeURL(new URL(c),{base:n(this,s).base,trailingSlash:n(this,s).trailingSlash}),options:l}},a=new WeakMap;exports.LocalLinks=S;
1
+ "use strict";var f=i=>{throw TypeError(i)};var h=(i,e,t)=>e.has(i)||f("Cannot "+t);var n=(i,e,t)=>(h(i,e,"read from private field"),t?t.call(i):e.get(i)),u=(i,e,t)=>e.has(i)?f("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),m=(i,e,t,r)=>(h(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),d=(i,e,t)=>(h(i,e,"access private method"),t);const v=require("./morph-B6sGhLCi.cjs");require("construct-style-sheets-polyfill");require("./index-OE2INULi.cjs");const L=require("./url-CHgcNwJ1.cjs");var s,o,E,k,a;class S{constructor(e){u(this,o);u(this,s);u(this,a,e=>{var c,l,p;e.preventDefault();const{url:t,options:r={}}=(c=d(this,o,k).call(this,e))!=null?c:{};t&&(e.preventDefault(),(p=(l=n(this,s)).onClick)==null||p.call(l,t,r))});m(this,s,e),window.addEventListener("click",n(this,a))}destroy(){window.removeEventListener("click",n(this,a))}update(){document.querySelectorAll("a").forEach(e=>{L.normalizeURL(e.getAttribute("href"),{base:n(this,s).base,trailingSlash:n(this,s).trailingSlash}).pathname===location.pathname?e.classList.add("current"):e.classList.remove("current")})}}s=new WeakMap,o=new WeakSet,E=function(e){return(e==null?void 0:e.nodeType)===v.NODE_TYPE_ELEMENT},k=function(e){const t=e.composedPath()[0];if(!d(this,o,E).call(this,t))return;const r=t.closest("a");if(!r||typeof n(this,s).includeAnchor=="function"&&!n(this,s).includeAnchor(r)||r.closest("[data-router-ignore]"))return;const{href:c}=r;if(!L.isLocalUrl(c))return;const l={keepScrollPosition:"keepScrollPosition"in r.dataset,cache:"cache"in r.dataset,revalidate:"revalidate"in r.dataset};return{url:L.normalizeURL(new URL(c),{base:n(this,s).base,trailingSlash:n(this,s).trailingSlash}),options:l}},a=new WeakMap;exports.LocalLinks=S;
@@ -6,7 +6,7 @@ var n = (i, t, e) => (u(i, t, "read from private field"), e ? e.call(i) : t.get(
6
6
  import { N as v } from "./morph-D_ybmXWR.js";
7
7
  import "construct-style-sheets-polyfill";
8
8
  import "./index-e9eDuagL.js";
9
- import { n as L, i as S } from "./url-DAl-mgbC.js";
9
+ import { n as L, i as S } from "./url-CYgo5vrG.js";
10
10
  var r, o, E, k, c;
11
11
  class P {
12
12
  constructor(t) {
@@ -0,0 +1 @@
1
+ "use strict";var C=Object.defineProperty,S=Object.defineProperties;var o=Object.getOwnPropertyDescriptors;var D=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var y=(a,e,r)=>e in a?C(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r,l=(a,e)=>{for(var r in e||(e={}))q.call(e,r)&&y(a,r,e[r]);if(D)for(var r of D(e))x.call(e,r)&&y(a,r,e[r]);return a},i=(a,e)=>S(a,o(e));var b=(a,e,r)=>new Promise((n,f)=>{var w=c=>{try{s(r.next(c))}catch(d){f(d)}},t=c=>{try{s(r.throw(c))}catch(d){f(d)}},s=c=>c.done?n(c.value):Promise.resolve(c.value).then(w,t);s((r=r.apply(a,e)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("../cache/index.cjs");require("construct-style-sheets-polyfill");require("../index-OE2INULi.cjs");const O=require("../url-CHgcNwJ1.cjs"),g=new M.Cache;function $(a,e){return b(this,null,function*(){var f,w;const r=Date.now(),n={data:null,error:null,status:"unknown",headers:new Headers};try{let t=a;if(e!=null&&e.params){const h=O.searchParamsObjectToString(e.params);if(h){const j=t.includes("?")?"&":"?";t+=`${j}${h}`}}const s=(f=e==null?void 0:e.cacheKey)!=null?f:t,c=(w=e==null?void 0:e.cacheTTLMinutes)!=null?w:0,d=c>0;if((e!=null&&e.forceClearCache||globalThis.forceClearCache)&&g.delete(s),d){const h=g.get(s);if(h)return i(l({},n),{data:h,cached:!0,status:"success",time:Date.now()-r})}const u=yield fetch(t,e==null?void 0:e.init);if(!u.ok){const h=yield u.text();return i(l({},n),{error:h,status:"error",time:Date.now()-r,headers:u.headers})}const m=u.headers.get("content-type");if(!(m!=null&&m.includes("application/json")))return i(l({},n),{error:"Endpoint did not return JSON",status:"error",time:Date.now()-r,headers:u.headers});const T=yield u.json();return d&&g.set(s,T,c),i(l({},n),{data:T,status:"success",time:Date.now()-r,headers:u.headers})}catch(t){const s=t instanceof Error?t.message:String(t);return i(l({},n),{error:s,status:"error",time:Date.now()-r})}})}exports.apiFetcher=$;
@@ -0,0 +1,16 @@
1
+ export interface IAPIFetcherOptions<Params extends object = {}> {
2
+ init?: RequestInit;
3
+ cacheKey?: string;
4
+ cacheTTLMinutes?: number;
5
+ forceClearCache?: boolean;
6
+ params?: Params;
7
+ }
8
+ export interface IAPIResponseJSON<T = null> {
9
+ status: 'success' | 'unknown' | 'error';
10
+ data: T | null;
11
+ error: string | null;
12
+ time: number;
13
+ cached?: boolean;
14
+ headers: Headers;
15
+ }
16
+ export declare function apiFetcher<Params extends object = {}, Result = any>(input: string, options?: IAPIFetcherOptions<Params>): Promise<IAPIResponseJSON<Result>>;
@@ -0,0 +1,100 @@
1
+ var y = Object.defineProperty, b = Object.defineProperties;
2
+ var x = Object.getOwnPropertyDescriptors;
3
+ var T = Object.getOwnPropertySymbols;
4
+ var S = Object.prototype.hasOwnProperty, k = Object.prototype.propertyIsEnumerable;
5
+ var o = (a, e, r) => e in a ? y(a, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[e] = r, l = (a, e) => {
6
+ for (var r in e || (e = {}))
7
+ S.call(e, r) && o(a, r, e[r]);
8
+ if (T)
9
+ for (var r of T(e))
10
+ k.call(e, r) && o(a, r, e[r]);
11
+ return a;
12
+ }, m = (a, e) => b(a, x(e));
13
+ var C = (a, e, r) => new Promise((n, f) => {
14
+ var w = (c) => {
15
+ try {
16
+ s(r.next(c));
17
+ } catch (d) {
18
+ f(d);
19
+ }
20
+ }, t = (c) => {
21
+ try {
22
+ s(r.throw(c));
23
+ } catch (d) {
24
+ f(d);
25
+ }
26
+ }, s = (c) => c.done ? n(c.value) : Promise.resolve(c.value).then(w, t);
27
+ s((r = r.apply(a, e)).next());
28
+ });
29
+ import { Cache as E } from "../cache/index.js";
30
+ import "construct-style-sheets-polyfill";
31
+ import "../index-e9eDuagL.js";
32
+ import { s as K } from "../url-CYgo5vrG.js";
33
+ const g = new E();
34
+ function F(a, e) {
35
+ return C(this, null, function* () {
36
+ var f, w;
37
+ const r = Date.now(), n = {
38
+ data: null,
39
+ error: null,
40
+ status: "unknown",
41
+ headers: new Headers()
42
+ };
43
+ try {
44
+ let t = a;
45
+ if (e != null && e.params) {
46
+ const u = K(e.params);
47
+ if (u) {
48
+ const j = t.includes("?") ? "&" : "?";
49
+ t += `${j}${u}`;
50
+ }
51
+ }
52
+ const s = (f = e == null ? void 0 : e.cacheKey) != null ? f : t, c = (w = e == null ? void 0 : e.cacheTTLMinutes) != null ? w : 0, d = c > 0;
53
+ if ((e != null && e.forceClearCache || globalThis.forceClearCache) && g.delete(s), d) {
54
+ const u = g.get(s);
55
+ if (u)
56
+ return m(l({}, n), {
57
+ data: u,
58
+ cached: !0,
59
+ status: "success",
60
+ time: Date.now() - r
61
+ });
62
+ }
63
+ const h = yield fetch(t, e == null ? void 0 : e.init);
64
+ if (!h.ok) {
65
+ const u = yield h.text();
66
+ return m(l({}, n), {
67
+ error: u,
68
+ status: "error",
69
+ time: Date.now() - r,
70
+ headers: h.headers
71
+ });
72
+ }
73
+ const i = h.headers.get("content-type");
74
+ if (!(i != null && i.includes("application/json")))
75
+ return m(l({}, n), {
76
+ error: "Endpoint did not return JSON",
77
+ status: "error",
78
+ time: Date.now() - r,
79
+ headers: h.headers
80
+ });
81
+ const D = yield h.json();
82
+ return d && g.set(s, D, c), m(l({}, n), {
83
+ data: D,
84
+ status: "success",
85
+ time: Date.now() - r,
86
+ headers: h.headers
87
+ });
88
+ } catch (t) {
89
+ const s = t instanceof Error ? t.message : String(t);
90
+ return m(l({}, n), {
91
+ error: s,
92
+ status: "error",
93
+ time: Date.now() - r
94
+ });
95
+ }
96
+ });
97
+ }
98
+ export {
99
+ F as apiFetcher
100
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../LocalLinks-Baf0xWZ3.cjs");exports.LocalLinks=e.LocalLinks;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../LocalLinks-BxhSFv_Q.cjs");exports.LocalLinks=e.LocalLinks;
@@ -1,4 +1,4 @@
1
- import { L as a } from "../LocalLinks-Z9pxKguG.js";
1
+ import { L as a } from "../LocalLinks-DRAQ-fxE.js";
2
2
  export {
3
3
  a as LocalLinks
4
4
  };
@@ -1 +1 @@
1
- "use strict";var ge=Object.defineProperty,Ee=Object.defineProperties;var ve=Object.getOwnPropertyDescriptors;var te=Object.getOwnPropertySymbols;var Le=Object.prototype.hasOwnProperty,Se=Object.prototype.propertyIsEnumerable;var ee=(o,e)=>(e=Symbol[o])?e:Symbol.for("Symbol."+o),ae=o=>{throw TypeError(o)};var se=(o,e,s)=>e in o?ge(o,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[e]=s,Ht=(o,e)=>{for(var s in e||(e={}))Le.call(e,s)&&se(o,s,e[s]);if(te)for(var s of te(e))Se.call(e,s)&&se(o,s,e[s]);return o},zt=(o,e)=>Ee(o,ve(e));var It=(o,e,s)=>e.has(o)||ae("Cannot "+s);var t=(o,e,s)=>(It(o,e,"read from private field"),s?s.call(o):e.get(o)),h=(o,e,s)=>e.has(o)?ae("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,s),r=(o,e,s,a)=>(It(o,e,"write to private field"),a?a.call(o,s):e.set(o,s),s),y=(o,e,s)=>(It(o,e,"access private method"),s);var J=(o,e,s)=>new Promise((a,l)=>{var v=c=>{try{f(s.next(c))}catch(p){l(p)}},S=c=>{try{f(s.throw(c))}catch(p){l(p)}},f=c=>c.done?a(c.value):Promise.resolve(c.value).then(v,S);f((s=s.apply(o,e)).next())});var ie=(o,e,s)=>(e=o[ee("asyncIterator")])?e.call(o):(o=o[ee("iterator")](),e={},s=(a,l)=>(l=o[a])&&(e[a]=v=>new Promise((S,f,c)=>(v=l.call(o,v),c=v.done,Promise.resolve(v.value).then(p=>S({value:p,done:c}),f)))),s("next"),s("return"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const oe=require("../index-OE2INULi.cjs"),ft=require("../dom-CBLlqORw.cjs"),z=require("../events-KVanG9sR.cjs"),ne=require("../scroll-BA2WnUrb.cjs");require("construct-style-sheets-polyfill");const pt=require("../url-CPgw9bd5.cjs"),ye=require("../css-value-parser/index.cjs"),he=require("../string-DUXXtU8v.cjs");class le extends HTMLElement{connectedCallback(){const e={"aria-live":"assertive","aria-atomic":"true",style:"position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"};for(const[s,a]of Object.entries(e))this.setAttribute(s,a)}}oe.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",le);var M,i,D,it,ce,vt,nt;class Vt{constructor(e,s){h(this,D);h(this,M);h(this,i);h(this,vt,e=>{e.preventDefault(),y(this,D,ce).call(this)});h(this,nt,()=>{const e=t(this,i).hasAttribute("data-revalidate");t(this,M).prefetch(t(this,D,it),e),t(this,i).removeEventListener("pointerenter",t(this,nt))});r(this,M,s),r(this,i,e),t(this,i).addEventListener("click",t(this,vt)),this.checkCurrent(location.href.replace(location.origin,"")),t(this,i).hasAttribute("data-prefetch")&&t(this,i).addEventListener("pointerenter",t(this,nt))}get element(){return t(this,i)}checkCurrent(e){var p,st;const s=t(this,M).normalizePath(e),a=t(this,M).normalizePath(t(this,D,it));t(this,i).hasAttribute("data-include")&&s.pathname.includes(a.pathname)?t(this,i).classList.add("current"):a.pathname===s.pathname?t(this,i).classList.add("current"):(p=t(this,i).getAttribute("data-associated-paths"))!=null&&p.split(",").find(A=>s.pathname.includes(A))?t(this,i).classList.add("current"):t(this,i).classList.remove("current"),s.path===a.path?t(this,i).classList.add("exact"):t(this,i).classList.remove("exact");const[l,v]=(st=t(this,D,it).split("#")[0])==null?void 0:st.split("?"),S=new URLSearchParams(v),f=new URLSearchParams(location.search);let c=0;for(const[A]of f)S.has(A)&&f.get(A)===S.get(A)&&c++;c?(t(this,i).classList.toggle("all-params-matched",f.size===c),t(this,i).classList.toggle("some-params-matched",f.size!==c)):!f.size&&t(this,i).hasAttribute("data-match-no-params")?t(this,i).classList.add("all-params-matched"):(t(this,i).classList.remove("all-params-matched"),t(this,i).classList.remove("some-params-matched"));for(const A in t(this,i).dataset){const at=he.camelToKebab(A);if(at.startsWith("match-param-")){const q=at.split("match-param-")[1],w=t(this,i).dataset[A],G=`param-${q}-matched`;f.has(q)&&f.get(q)===w||!f.has(q)&&(w===""||w==="*"||w==="all"||w==="any"||w==="vse")?t(this,i).classList.add(G):t(this,i).classList.remove(G)}}}destroy(){t(this,i).removeEventListener("click",t(this,vt)),t(this,i).removeEventListener("pointerenter",t(this,nt)),t(this,i).classList.remove("current","exact")}}M=new WeakMap,i=new WeakMap,D=new WeakSet,it=function(){const e=new URL(t(this,i).href);return t(this,M).normalizePath(e.pathname+e.search+e.hash).path},ce=function(){var s;if(document.documentElement.classList.contains("click-disabled"))return;if(t(this,i).hasAttribute("data-back")&&t(this,M).previousURL)history.back();else{const a=t(this,i).getAttribute("data-history-action")||"push",l=t(this,i).hasAttribute("data-center-scroll"),v=getComputedStyle(t(this,i)).getPropertyValue("--offset-scroll").trim(),S=v?ye.cssValueParser.parse(v):void 0,f=t(this,i).hasAttribute("data-revalidate")||t(this,i).hasAttribute("data-pagination-more-link")||t(this,i).hasAttribute("data-pagination-set-link")||t(this,i).hasAttribute("data-pagination-next-link")||t(this,i).hasAttribute("data-pagination-prev-link"),c=t(this,i).hasAttribute("data-keep-search-parameters"),p=t(this,i).hasAttribute("data-keep-scroll-position")||t(this,i).hasAttribute("data-pagination-more-link"),st=t(this,i).getAttribute("data-scroll-behaviour"),A=(s=t(this,i).getAttribute("data-submorph")||t(this,i).getAttribute("data-submorph-append"))==null?void 0:s.split(",").map(w=>w.trim()),at=t(this,i).hasAttribute("data-clear-state");let q=t(this,D,it);if(t(this,i).hasAttribute("data-toggle-params")){const[w,G]=t(this,D,it).split("?"),Rt=new URLSearchParams(G),F=new URLSearchParams(location.search),d=new URLSearchParams;for(const[R]of Rt)(!F.has(R)||F.has(R)&&F.get(R)!==Rt.get(R))&&d.append(R,Rt.get(R));if(t(this,i).hasAttribute("data-merge-params"))for(const[R]of F)Rt.has(R)||d.append(R,F.get(R));q=`${w}?${d.toString()}`}t(this,M).navigate(q,{historyAction:a,centerScroll:l,offsetScroll:S,revalidate:f,keepSearchParameters:c,submorph:A,clearState:at,keepScrollPosition:p,scrollBehaviour:st,submorphAppend:t(this,i).hasAttribute("data-submorph-append"),mergeParams:t(this,i).hasAttribute("data-merge-params")&&!t(this,i).hasAttribute("data-toggle-params"),detail:t(this,i).getAttribute("data-detail"),removeParams:t(this,i).getAttribute("data-remove-params")||void 0,scrollTo:t(this,i).getAttribute("data-scroll-to")||void 0})}},vt=new WeakMap,nt=new WeakMap;var C,rt,Lt,Wt,St;class be{constructor(e){h(this,Lt);h(this,C);h(this,rt,[]);h(this,St,()=>{y(this,Lt,Wt).call(this)});r(this,C,e);for(const s in t(this,C).dataset){const a=he.camelToKebab(s);if(a.startsWith("param-")){const l=a.split("param-")[1],v=t(this,C).dataset[s];t(this,rt).push({name:l,value:v})}}document.addEventListener("morphURLParametersChange",t(this,St)),y(this,Lt,Wt).call(this)}destroy(){document.removeEventListener("morphURLParametersChange",t(this,St))}}C=new WeakMap,rt=new WeakMap,Lt=new WeakSet,Wt=function(){const e=new URLSearchParams(location.search);let s=!!t(this,rt).find(l=>e.has(l.name)&&(e.get(l.name)===l.value||l.value==="*"||l.value==="all"||l.value==="any"||l.value==="vse"||e.get(l.name)==="*"||e.get(l.name)==="all"||e.get(l.name)==="any"||e.get(l.name)==="vse"));!s&&t(this,C).hasAttribute("data-match-no-params")&&(s=!t(this,rt).filter(l=>e.has(l.name)).length);const a=t(this,C).getAttribute("data-hide-class");s?a?t(this,C).classList.remove(a):t(this,C).style.display="":a?t(this,C).classList.add(a):t(this,C).style.display="none"},St=new WeakMap;const we=new DOMParser;var I,Q,U,V,Z,K,ot,_,Y,yt,ht;class re{constructor(e,s){h(this,I);h(this,Q);h(this,U,{x:0,y:0});h(this,V,null);h(this,Z,null);h(this,K,null);h(this,ot,null);h(this,_,null);h(this,Y,null);h(this,yt);h(this,ht,!1);r(this,I,e),r(this,Q,s)}get pathname(){return t(this,Q)}get scrollState(){return t(this,U)}get document(){return t(this,K)}needRavalidation(){r(this,ht,!0)}setHeaders(e){r(this,yt,e)}setInitialDocument(e){r(this,V,e.cloneNode(!0))}abort(){var e;return(e=t(this,_))==null?void 0:e.abort(`[${t(this,Q)}] page loading cancelled`)}fetch(e,s,a){return J(this,null,function*(){var l;if(!a&&!t(this,ht)){const f=((l=t(this,V))==null?void 0:l.documentElement.getAttribute("data-cache"))&&s!==e,c=t(this,V)&&t(this,I).isPopstateNavigation;if(t(this,Y)||f||c)return t(this,Y)}return r(this,Y,new Promise(v=>J(this,null,function*(){try{r(this,_,new AbortController);const f=yield(yield fetch(e,{signal:t(this,_).signal,headers:Ht({"X-MORPH":"true","X-MORPH-REVALIDATE":a?"true":"false","X-MORPH-CURRENT-PATH":encodeURIComponent(s),"X-MORPH-NEW-PATH":encodeURIComponent(e)},t(this,yt))})).text(),c=we.parseFromString(f,"text/html");this.setInitialDocument(c),r(this,ht,!1)}catch(S){console.warn(S)}finally{r(this,_,null),r(this,Y,null),v()}}))),t(this,Y)})}cloneDocument(){r(this,K,(t(this,Z)||t(this,V)).cloneNode(!0))}get title(){let e="";if(t(this,K).title)e=t(this,K).title;else{const s=t(this,K).querySelector("h1");e=(s==null?void 0:s.innerText)||(s==null?void 0:s.textContent)||t(this,Q)}return e}clearScrollState(){t(this,U).x=0,t(this,U).y=0}clearDocumentState(){r(this,Z,null)}saveScrollState(){t(this,V).documentElement.hasAttribute("data-no-scroll-restoration")?(t(this,U).x=0,t(this,U).y=0):(t(this,U).x=t(this,I).scrollValue.left,t(this,U).y=t(this,I).scrollValue.top)}restoreScrollPosition(){t(this,I).scrollElement.scroll({top:t(this,U).y,left:t(this,U).x,behavior:"instant"})}saveDocumentState(){t(this,V).documentElement.hasAttribute("data-no-page-restoration")?r(this,Z,null):r(this,Z,document.cloneNode(!0))}renewScrollPosition(){t(this,I).scrollElement.scroll({top:0,left:0,behavior:"instant"})}saveState(e){r(this,ot,e)}clearState(){const e=t(this,ot);return r(this,ot,null),e}}I=new WeakMap,Q=new WeakMap,U=new WeakMap,V=new WeakMap,Z=new WeakMap,K=new WeakMap,ot=new WeakMap,_=new WeakMap,Y=new WeakMap,yt=new WeakMap,ht=new WeakMap;var T,lt,b,$,m,tt,W,j,H,bt,O,wt,et,ct,dt,Pt,ut,At,kt,E,gt,Ft,Xt,Bt,Nt,Mt,mt;const Et=class Et{constructor(e){h(this,E);h(this,T,null);h(this,lt,null);h(this,b,[]);h(this,$);h(this,m,null);h(this,tt);h(this,W,[]);h(this,j,!1);h(this,H,null);h(this,bt,!1);h(this,O,new Map);h(this,wt,[]);h(this,et,null);h(this,ct,0);h(this,dt,0);h(this,Pt);h(this,ut);h(this,At);h(this,kt,e=>{var s,a;return(((s=e.getAttribute("href"))==null?void 0:s.startsWith("/"))||((a=e.getAttribute("href"))==null?void 0:a.startsWith("?")))&&!e.hasAttribute("download")&&!e.hasAttribute("data-morph-skip")&&!e.closest("[data-morph-skip]")&&e.getAttribute("target")!=="_blank"});h(this,Mt,e=>J(this,null,function*(){e.preventDefault(),r(this,j,!0),yield this.navigate(location.href.replace(location.origin,""),{historyAction:"none",submorph:t(this,ut)?void 0:t(this,Pt),revalidate:t(this,ut),keepScrollPosition:t(this,At)}),r(this,j,!1)}));h(this,mt,()=>{const{left:e,top:s}=this.scrollValue,a=s-t(this,dt),l=e-t(this,ct);r(this,dt,s),r(this,ct,e),document.documentElement.classList.toggle("scroll-y",s>0),document.documentElement.classList.toggle("scroll-x",e>0),document.documentElement.classList.toggle("scroll-y-forward",a>0),document.documentElement.classList.toggle("scroll-y-backward",a<0),document.documentElement.classList.toggle("scroll-x-forward",l>0),document.documentElement.classList.toggle("scroll-x-backward",l<0),z.dispatchEvent(document,"morphScroll",{detail:{left:e,top:s}})});if(oe.isBrowser&&!Et.instance){Et.instance=this,r(this,T,{base:pt.normalizeBase(e==null?void 0:e.base),waitForHeadToLoad:(e==null?void 0:e.waitForHeadToLoad)!==!1,trailingSlash:(e==null?void 0:e.trailingSlash)||!1,scrollSelector:e==null?void 0:e.scrollSelector,morphInsideScrollContainer:(e==null?void 0:e.morphInsideScrollContainer)||!1}),r(this,lt,y(this,E,Ft).call(this,document.body));const s=this.normalizePath(location.pathname+location.search+location.hash);r(this,m,s);const a=new re(this,t(this,m).pathname);a.setInitialDocument(document),t(this,O).set(t(this,m).pathname,a),document.documentElement.setAttribute("data-current-pathname",t(this,m).pathname),document.documentElement.setAttribute("data-current-leaf",s.leaf),this.findLinks(),this.findParamsDependent(),history.scrollRestoration="manual",addEventListener("popstate",t(this,Mt)),pt.changeHistory({action:"replace",pathname:s.pathname,searchParameters:s.parameters,hash:s.hash}),r(this,et,new le),y(this,E,Bt).call(this,document)}}get currentURL(){return t(this,m)}get previousURL(){return t(this,tt)}get links(){return t(this,b)}get scrollElement(){return t(this,H)}get isPopstateNavigation(){return t(this,j)}get scrollValue(){let e=0,s=0;return t(this,bt)?(e=window.scrollY,s=window.scrollX):(e=t(this,H).scrollTop,s=t(this,H).scrollLeft),{top:e,left:s}}get isNavigating(){return!!t(this,W).length}saveState(e){const s=t(this,O).get(t(this,m).path);s&&s.saveState(e)}getState(){const e=t(this,O).get(t(this,m).path);return e==null?void 0:e.clearState()}normalizePath(e,s){return pt.splitPath(e,{base:t(this,T).base,trailingSlash:t(this,T).trailingSlash,mergeParams:s!=null&&s.mergeParams?location.search:"",removeParams:s==null?void 0:s.removeParams})}prefetch(e,s){return J(this,null,function*(){var l;if(t(this,W).length)return;e=((l=this.pathnameModifier)==null?void 0:l.call(this,e))||e;const a=y(this,E,gt).call(this,e);a==null||a.fetch(e,t(this,m).path,s)})}excludeHeadChild(e){return!1}setHeaders(e){}needRavalidation(e){const s=this.normalizePath(e),a=y(this,E,gt).call(this,s.path);a==null||a.needRavalidation()}navigate(Rt){return J(this,arguments,function*(e,{historyAction:s="push",centerScroll:a,offsetScroll:l,scrollBehaviour:v,revalidate:S,keepSearchParameters:f,submorph:c,submorphAppend:p,clearState:st,keepScrollPosition:A,mergeParams:at,removeParams:q,detail:w,scrollTo:G}={}){var R,Kt,Yt,$t;if(t(this,W).length)return;r(this,Pt,c),r(this,ut,S),r(this,At,A);const F=((R=this.pathnameModifier)==null?void 0:R.call(this,e))||e,d=this.normalizePath(F,{mergeParams:at,removeParams:q});if(!S&&(((Kt=t(this,$))==null?void 0:Kt.pathname)===d.pathname||t(this,m).pathname===d.pathname)){A||y(this,E,Nt).call(this,d.hash||0,{centerScroll:a,offsetScroll:l,behavior:"smooth"}),z.dispatchEvent(document,"morphSamePath",{detail:{detail:w}}),((Yt=t(this,m))==null?void 0:Yt.parameters)!==d.parameters&&(r(this,tt,t(this,m)),r(this,m,d),pt.changeHistory({action:(($t=t(this,m))==null?void 0:$t.hash)!==d.hash?"replace":s,pathname:d.pathname,searchParameters:d.parameters,hash:d.hash}),z.dispatchEvent(document,"morphURLParametersChange",{detail:{newURL:t(this,m),previousURL:t(this,tt),detail:w}})),t(this,b).forEach(X=>{X.checkCurrent(d.path)});return}else t(this,b).forEach(X=>{X.checkCurrent(d.path)});r(this,$,d);try{let X=!0;if(this.preprocessor)try{yield new Promise((n,P)=>{var x;(x=this.preprocessor)==null||x.call(this,{url:d,resolve:n,reject:P,submorph:c,detail:w})})}catch(n){n?console.error(n):console.log("Route change canceled"),X=!1}if(!X||t(this,$).pathname!==d.pathname){t(this,b).forEach(n=>{n.checkCurrent(t(this,m).path)});return}const jt={url:d,submorph:c,detail:w};c?p||c.forEach(n=>{document.querySelectorAll(n).forEach(P=>{P.classList.add("out"),P.setAttribute("data-morph-out","")})}):t(this,lt).forEach(n=>{var P,x;(P=n.firstElementChild)==null||P.classList.add("out"),(x=n.firstElementChild)==null||x.setAttribute("data-morph-out","")}),z.dispatchEvent(document,"morphNavigation",{detail:jt});const Tt=y(this,E,gt).call(this,t(this,m).pathname),L=y(this,E,gt).call(this,d.pathname);if(t(this,O).forEach(n=>{n.pathname!==d.pathname&&n.abort()}),yield L==null?void 0:L.fetch(F,t(this,m).path,S),t(this,$).pathname!==d.pathname){t(this,b).forEach(n=>{n.checkCurrent(t(this,m).path)});return}Tt.clearState(),Tt.saveScrollState(),Tt.saveDocumentState(),(!t(this,j)||S)&&(L.clearScrollState(),L.clearDocumentState()),st&&L.clearState(),L.cloneDocument(),t(this,et).textContent=L.title,document.body.appendChild(t(this,et));const Ct=zt(Ht({},jt),{document:L.document});p||Ct.document.querySelectorAll("[data-morph-out]").forEach(n=>{n.classList.remove("out")}),z.dispatchEvent(document,"morphStart",{detail:Ct});const Gt=Array.from(document.head.children),Jt=Array.from(L.document.head.children),Qt=ft.intersectElements(Gt,Jt),de=ft.excludeElements(Gt,Qt),Ut=ft.excludeElements(Jt,Qt).filter(n=>!this.excludeHeadChild(n));Ut.forEach((n,P)=>{n.tagName==="SCRIPT"&&(Ut[P]=ft.createScriptElement(n))}),Ut.forEach(n=>{document.head.appendChild(n)});const Dt=Ut.filter(n=>{if(n.hasAttribute("data-no-waiting"))return!1;if(y(this,E,Xt).call(this,n))return!0});t(this,T).waitForHeadToLoad&&Dt.length&&(yield new Promise(n=>J(this,null,function*(){let P=0;try{for(var x=ie(Dt),me,B,N;me=!(B=yield x.next()).done;me=!1){const xt=B.value;xt.onload=()=>{P++,P===Dt.length&&n()}}}catch(B){N=[B]}finally{try{me&&(B=x.return)&&(yield B.call(x))}finally{if(N)throw N[0]}}}))),yield ne.wait(10);const Zt=[];p||de.forEach(n=>{n.hasAttribute("data-permanent")||(y(this,E,Xt).call(this,n)?Zt.push(n):n.remove())});const ue=y(this,E,Ft).call(this,L.document.body);!t(this,T).morphInsideScrollContainer&&!c&&y(this,E,Bt).call(this,L.document),document.documentElement.setAttribute("data-current-pathname",d.pathname),document.documentElement.setAttribute("data-current-leaf",d.leaf),pt.changeHistory({action:s,pathname:d.pathname,searchParameters:d.parameters||(f?location.search:""),hash:d.hash}),t(this,et).remove(),r(this,tt,t(this,m)),r(this,m,d);const qt=[];t(this,lt).forEach((n,P)=>{const x=ue[P],me=getComputedStyle(n).getPropertyValue("--morph-duration");let B=[],N=[];c?(c.forEach(u=>{const g=n.querySelector(u),k=x.querySelector(u);g&&k&&(N.push(g),B.push(k))}),N.forEach(u=>{u.parentElement&&qt.push(u.parentElement)})):(B.push(...x.childNodes),N.push(...n.childNodes),qt.push(n));const xt=[];p||N.forEach(u=>{u instanceof HTMLElement&&(this.destroyOldLinks(u),u.classList.add("old"),u.querySelectorAll("[data-morph-transfer]").forEach(k=>{const pe=k.getAttribute("data-morph-transfer");xt.push({element:k,selector:pe})}))}),B.forEach(u=>{u instanceof HTMLElement&&(xt.forEach(g=>{const k=u.querySelector(g.selector);k&&k.replaceWith(L.document.importNode(g.element,!0))}),this.findNewLinks(u),u.classList.add("new"))}),c?p?B.forEach((u,g)=>{N[g]instanceof HTMLElement&&N[g].append(...u.childNodes)}):B.forEach((u,g)=>{var k;(k=N[g].parentElement)==null||k.insertBefore(u,N[g])}):n.prepend(...B),setTimeout(()=>{p||N.forEach(u=>{u instanceof HTMLElement&&u.classList.add("old-idle")}),B.forEach(u=>{var g;u instanceof HTMLElement&&((g=u.parentElement)==null||g.style.setProperty("--new-content-height",u.offsetHeight+"px"),u.classList.add("new-idle"))})},0);const _t=zt(Ht({},Ct),{morphElement:n});z.dispatchEvent(document,"morphNewChildrenAdded",{detail:_t});const fe=new Promise(u=>{setTimeout(()=>{p||N.forEach(g=>{g.remove()}),B.forEach(g=>{var k;g instanceof HTMLElement&&((k=g.parentElement)==null||k.style.removeProperty("--new-content-height"),g.classList.remove("new-idle","new"))}),p||z.dispatchEvent(document,"morphOldChildrenRemoved",{detail:_t}),u()},(parseFloat(me)||0)*1e3+10)});t(this,W).push(fe)}),this.isPopstateNavigation?document.documentElement.style.setProperty("--new-document-scroll-position",(this.scrollValue.top-L.scrollState.y)*1+"px"):document.documentElement.style.setProperty("--new-document-scroll-position",this.scrollValue.top+"px"),z.dispatchEvent(document,"morphBeforeNavigationScroll",{detail:L.scrollState}),G?(L.clearScrollState(),y(this,E,Nt).call(this,G,{centerScroll:a,offsetScroll:l,behavior:v})):d.hash?(L.clearScrollState(),y(this,E,Nt).call(this,d.hash,{centerScroll:a,offsetScroll:l,behavior:v})):t(this,j)?L.restoreScrollPosition():A||L.renewScrollPosition(),yield Promise.all(t(this,W)),p||Zt.forEach(n=>n.remove()),r(this,W,[]),qt.forEach(n=>{n.querySelectorAll("script").forEach(x=>{x.replaceWith(ft.createScriptElement(x))})}),t(this,b).forEach(n=>{n.checkCurrent(t(this,m).path)}),this.findParamsDependent(),z.dispatchEvent(document,"morphComplete",{detail:Ct}),document.documentElement.style.removeProperty("--new-document-scroll-position"),window.dispatchEvent(new Event("resize"))}catch(X){console.error(X)}r(this,$,void 0)})}addLink(e){t(this,b).push(new Vt(e,this))}addLinks(e){e.forEach(s=>{this.addLink(s)})}removeLink(e){r(this,b,t(this,b).filter(s=>s.element===e?(s.destroy(),!1):!0))}destroyOldLinks(e){r(this,b,t(this,b).filter(s=>e.contains(s.element)?(s.destroy(),!1):!0))}findNewLinks(e){const s=[...e.querySelectorAll("a")].filter(t(this,kt));t(this,b).push(...s.map(a=>new Vt(a,this)))}findLinks(){const e=[...document.documentElement.querySelectorAll("a")].filter(t(this,kt));t(this,b).forEach(s=>s.destroy()),r(this,b,e.map(s=>new Vt(s,this)))}findParamsDependent(){const e=[...document.documentElement.querySelectorAll("[data-morph-params-dependent]")];t(this,wt).forEach(s=>s.destroy()),r(this,wt,e.map(s=>new be(s)))}};T=new WeakMap,lt=new WeakMap,b=new WeakMap,$=new WeakMap,m=new WeakMap,tt=new WeakMap,W=new WeakMap,j=new WeakMap,H=new WeakMap,bt=new WeakMap,O=new WeakMap,wt=new WeakMap,et=new WeakMap,ct=new WeakMap,dt=new WeakMap,Pt=new WeakMap,ut=new WeakMap,At=new WeakMap,kt=new WeakMap,E=new WeakSet,gt=function(e){const s=this.normalizePath(e);let a=t(this,O).get(s.pathname);return a||(a=new re(this,s.pathname),t(this,O).set(s.pathname,a)),a},Ft=function(e){const s=[...e.querySelectorAll("[data-morph]")];return s.length?s:[e]},Xt=function(e){return e.tagName==="SCRIPT"||e.tagName==="STYLE"||e.tagName==="LINK"&&e.getAttribute("rel")==="stylesheet"},Bt=function(e){var s,a;(s=t(this,H))==null||s.removeEventListener("scroll",t(this,mt)),r(this,dt,0),r(this,ct,0),r(this,H,t(this,T).scrollSelector&&e.querySelector(t(this,T).scrollSelector)||window),r(this,bt,t(this,H)===window),(a=t(this,H))==null||a.addEventListener("scroll",t(this,mt)),t(this,mt).call(this)},Nt=function(e,s){const a=typeof e=="string"?document.getElementById(e):e;(typeof a=="number"||a)&&ne.scrollToElement(a,{scrollElement:t(this,H),behavior:(s==null?void 0:s.behavior)||"instant",center:s==null?void 0:s.centerScroll,offset:s==null?void 0:s.offsetScroll})},Mt=new WeakMap,mt=new WeakMap,Et.instance=null;let Ot=Et;exports.Morph=Ot;
1
+ "use strict";var ge=Object.defineProperty,Ee=Object.defineProperties;var ve=Object.getOwnPropertyDescriptors;var te=Object.getOwnPropertySymbols;var Le=Object.prototype.hasOwnProperty,Se=Object.prototype.propertyIsEnumerable;var ee=(o,e)=>(e=Symbol[o])?e:Symbol.for("Symbol."+o),ae=o=>{throw TypeError(o)};var se=(o,e,s)=>e in o?ge(o,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[e]=s,Ht=(o,e)=>{for(var s in e||(e={}))Le.call(e,s)&&se(o,s,e[s]);if(te)for(var s of te(e))Se.call(e,s)&&se(o,s,e[s]);return o},zt=(o,e)=>Ee(o,ve(e));var It=(o,e,s)=>e.has(o)||ae("Cannot "+s);var t=(o,e,s)=>(It(o,e,"read from private field"),s?s.call(o):e.get(o)),h=(o,e,s)=>e.has(o)?ae("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,s),r=(o,e,s,a)=>(It(o,e,"write to private field"),a?a.call(o,s):e.set(o,s),s),y=(o,e,s)=>(It(o,e,"access private method"),s);var J=(o,e,s)=>new Promise((a,l)=>{var v=c=>{try{f(s.next(c))}catch(p){l(p)}},S=c=>{try{f(s.throw(c))}catch(p){l(p)}},f=c=>c.done?a(c.value):Promise.resolve(c.value).then(v,S);f((s=s.apply(o,e)).next())});var ie=(o,e,s)=>(e=o[ee("asyncIterator")])?e.call(o):(o=o[ee("iterator")](),e={},s=(a,l)=>(l=o[a])&&(e[a]=v=>new Promise((S,f,c)=>(v=l.call(o,v),c=v.done,Promise.resolve(v.value).then(p=>S({value:p,done:c}),f)))),s("next"),s("return"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const oe=require("../index-OE2INULi.cjs"),ft=require("../dom-CBLlqORw.cjs"),z=require("../events-KVanG9sR.cjs"),ne=require("../scroll-BA2WnUrb.cjs");require("construct-style-sheets-polyfill");const pt=require("../url-CHgcNwJ1.cjs"),ye=require("../css-value-parser/index.cjs"),he=require("../string-DUXXtU8v.cjs");class le extends HTMLElement{connectedCallback(){const e={"aria-live":"assertive","aria-atomic":"true",style:"position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"};for(const[s,a]of Object.entries(e))this.setAttribute(s,a)}}oe.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",le);var M,i,D,it,ce,vt,nt;class Vt{constructor(e,s){h(this,D);h(this,M);h(this,i);h(this,vt,e=>{e.preventDefault(),y(this,D,ce).call(this)});h(this,nt,()=>{const e=t(this,i).hasAttribute("data-revalidate");t(this,M).prefetch(t(this,D,it),e),t(this,i).removeEventListener("pointerenter",t(this,nt))});r(this,M,s),r(this,i,e),t(this,i).addEventListener("click",t(this,vt)),this.checkCurrent(location.href.replace(location.origin,"")),t(this,i).hasAttribute("data-prefetch")&&t(this,i).addEventListener("pointerenter",t(this,nt))}get element(){return t(this,i)}checkCurrent(e){var p,st;const s=t(this,M).normalizePath(e),a=t(this,M).normalizePath(t(this,D,it));t(this,i).hasAttribute("data-include")&&s.pathname.includes(a.pathname)?t(this,i).classList.add("current"):a.pathname===s.pathname?t(this,i).classList.add("current"):(p=t(this,i).getAttribute("data-associated-paths"))!=null&&p.split(",").find(A=>s.pathname.includes(A))?t(this,i).classList.add("current"):t(this,i).classList.remove("current"),s.path===a.path?t(this,i).classList.add("exact"):t(this,i).classList.remove("exact");const[l,v]=(st=t(this,D,it).split("#")[0])==null?void 0:st.split("?"),S=new URLSearchParams(v),f=new URLSearchParams(location.search);let c=0;for(const[A]of f)S.has(A)&&f.get(A)===S.get(A)&&c++;c?(t(this,i).classList.toggle("all-params-matched",f.size===c),t(this,i).classList.toggle("some-params-matched",f.size!==c)):!f.size&&t(this,i).hasAttribute("data-match-no-params")?t(this,i).classList.add("all-params-matched"):(t(this,i).classList.remove("all-params-matched"),t(this,i).classList.remove("some-params-matched"));for(const A in t(this,i).dataset){const at=he.camelToKebab(A);if(at.startsWith("match-param-")){const q=at.split("match-param-")[1],w=t(this,i).dataset[A],G=`param-${q}-matched`;f.has(q)&&f.get(q)===w||!f.has(q)&&(w===""||w==="*"||w==="all"||w==="any"||w==="vse")?t(this,i).classList.add(G):t(this,i).classList.remove(G)}}}destroy(){t(this,i).removeEventListener("click",t(this,vt)),t(this,i).removeEventListener("pointerenter",t(this,nt)),t(this,i).classList.remove("current","exact")}}M=new WeakMap,i=new WeakMap,D=new WeakSet,it=function(){const e=new URL(t(this,i).href);return t(this,M).normalizePath(e.pathname+e.search+e.hash).path},ce=function(){var s;if(document.documentElement.classList.contains("click-disabled"))return;if(t(this,i).hasAttribute("data-back")&&t(this,M).previousURL)history.back();else{const a=t(this,i).getAttribute("data-history-action")||"push",l=t(this,i).hasAttribute("data-center-scroll"),v=getComputedStyle(t(this,i)).getPropertyValue("--offset-scroll").trim(),S=v?ye.cssValueParser.parse(v):void 0,f=t(this,i).hasAttribute("data-revalidate")||t(this,i).hasAttribute("data-pagination-more-link")||t(this,i).hasAttribute("data-pagination-set-link")||t(this,i).hasAttribute("data-pagination-next-link")||t(this,i).hasAttribute("data-pagination-prev-link"),c=t(this,i).hasAttribute("data-keep-search-parameters"),p=t(this,i).hasAttribute("data-keep-scroll-position")||t(this,i).hasAttribute("data-pagination-more-link"),st=t(this,i).getAttribute("data-scroll-behaviour"),A=(s=t(this,i).getAttribute("data-submorph")||t(this,i).getAttribute("data-submorph-append"))==null?void 0:s.split(",").map(w=>w.trim()),at=t(this,i).hasAttribute("data-clear-state");let q=t(this,D,it);if(t(this,i).hasAttribute("data-toggle-params")){const[w,G]=t(this,D,it).split("?"),Rt=new URLSearchParams(G),F=new URLSearchParams(location.search),d=new URLSearchParams;for(const[R]of Rt)(!F.has(R)||F.has(R)&&F.get(R)!==Rt.get(R))&&d.append(R,Rt.get(R));if(t(this,i).hasAttribute("data-merge-params"))for(const[R]of F)Rt.has(R)||d.append(R,F.get(R));q=`${w}?${d.toString()}`}t(this,M).navigate(q,{historyAction:a,centerScroll:l,offsetScroll:S,revalidate:f,keepSearchParameters:c,submorph:A,clearState:at,keepScrollPosition:p,scrollBehaviour:st,submorphAppend:t(this,i).hasAttribute("data-submorph-append"),mergeParams:t(this,i).hasAttribute("data-merge-params")&&!t(this,i).hasAttribute("data-toggle-params"),detail:t(this,i).getAttribute("data-detail"),removeParams:t(this,i).getAttribute("data-remove-params")||void 0,scrollTo:t(this,i).getAttribute("data-scroll-to")||void 0})}},vt=new WeakMap,nt=new WeakMap;var C,rt,Lt,Wt,St;class be{constructor(e){h(this,Lt);h(this,C);h(this,rt,[]);h(this,St,()=>{y(this,Lt,Wt).call(this)});r(this,C,e);for(const s in t(this,C).dataset){const a=he.camelToKebab(s);if(a.startsWith("param-")){const l=a.split("param-")[1],v=t(this,C).dataset[s];t(this,rt).push({name:l,value:v})}}document.addEventListener("morphURLParametersChange",t(this,St)),y(this,Lt,Wt).call(this)}destroy(){document.removeEventListener("morphURLParametersChange",t(this,St))}}C=new WeakMap,rt=new WeakMap,Lt=new WeakSet,Wt=function(){const e=new URLSearchParams(location.search);let s=!!t(this,rt).find(l=>e.has(l.name)&&(e.get(l.name)===l.value||l.value==="*"||l.value==="all"||l.value==="any"||l.value==="vse"||e.get(l.name)==="*"||e.get(l.name)==="all"||e.get(l.name)==="any"||e.get(l.name)==="vse"));!s&&t(this,C).hasAttribute("data-match-no-params")&&(s=!t(this,rt).filter(l=>e.has(l.name)).length);const a=t(this,C).getAttribute("data-hide-class");s?a?t(this,C).classList.remove(a):t(this,C).style.display="":a?t(this,C).classList.add(a):t(this,C).style.display="none"},St=new WeakMap;const we=new DOMParser;var I,Q,U,V,Z,K,ot,_,Y,yt,ht;class re{constructor(e,s){h(this,I);h(this,Q);h(this,U,{x:0,y:0});h(this,V,null);h(this,Z,null);h(this,K,null);h(this,ot,null);h(this,_,null);h(this,Y,null);h(this,yt);h(this,ht,!1);r(this,I,e),r(this,Q,s)}get pathname(){return t(this,Q)}get scrollState(){return t(this,U)}get document(){return t(this,K)}needRavalidation(){r(this,ht,!0)}setHeaders(e){r(this,yt,e)}setInitialDocument(e){r(this,V,e.cloneNode(!0))}abort(){var e;return(e=t(this,_))==null?void 0:e.abort(`[${t(this,Q)}] page loading cancelled`)}fetch(e,s,a){return J(this,null,function*(){var l;if(!a&&!t(this,ht)){const f=((l=t(this,V))==null?void 0:l.documentElement.getAttribute("data-cache"))&&s!==e,c=t(this,V)&&t(this,I).isPopstateNavigation;if(t(this,Y)||f||c)return t(this,Y)}return r(this,Y,new Promise(v=>J(this,null,function*(){try{r(this,_,new AbortController);const f=yield(yield fetch(e,{signal:t(this,_).signal,headers:Ht({"X-MORPH":"true","X-MORPH-REVALIDATE":a?"true":"false","X-MORPH-CURRENT-PATH":encodeURIComponent(s),"X-MORPH-NEW-PATH":encodeURIComponent(e)},t(this,yt))})).text(),c=we.parseFromString(f,"text/html");this.setInitialDocument(c),r(this,ht,!1)}catch(S){console.warn(S)}finally{r(this,_,null),r(this,Y,null),v()}}))),t(this,Y)})}cloneDocument(){r(this,K,(t(this,Z)||t(this,V)).cloneNode(!0))}get title(){let e="";if(t(this,K).title)e=t(this,K).title;else{const s=t(this,K).querySelector("h1");e=(s==null?void 0:s.innerText)||(s==null?void 0:s.textContent)||t(this,Q)}return e}clearScrollState(){t(this,U).x=0,t(this,U).y=0}clearDocumentState(){r(this,Z,null)}saveScrollState(){t(this,V).documentElement.hasAttribute("data-no-scroll-restoration")?(t(this,U).x=0,t(this,U).y=0):(t(this,U).x=t(this,I).scrollValue.left,t(this,U).y=t(this,I).scrollValue.top)}restoreScrollPosition(){t(this,I).scrollElement.scroll({top:t(this,U).y,left:t(this,U).x,behavior:"instant"})}saveDocumentState(){t(this,V).documentElement.hasAttribute("data-no-page-restoration")?r(this,Z,null):r(this,Z,document.cloneNode(!0))}renewScrollPosition(){t(this,I).scrollElement.scroll({top:0,left:0,behavior:"instant"})}saveState(e){r(this,ot,e)}clearState(){const e=t(this,ot);return r(this,ot,null),e}}I=new WeakMap,Q=new WeakMap,U=new WeakMap,V=new WeakMap,Z=new WeakMap,K=new WeakMap,ot=new WeakMap,_=new WeakMap,Y=new WeakMap,yt=new WeakMap,ht=new WeakMap;var T,lt,b,$,m,tt,W,j,H,bt,O,wt,et,ct,dt,Pt,ut,At,kt,E,gt,Ft,Xt,Bt,Nt,Mt,mt;const Et=class Et{constructor(e){h(this,E);h(this,T,null);h(this,lt,null);h(this,b,[]);h(this,$);h(this,m,null);h(this,tt);h(this,W,[]);h(this,j,!1);h(this,H,null);h(this,bt,!1);h(this,O,new Map);h(this,wt,[]);h(this,et,null);h(this,ct,0);h(this,dt,0);h(this,Pt);h(this,ut);h(this,At);h(this,kt,e=>{var s,a;return(((s=e.getAttribute("href"))==null?void 0:s.startsWith("/"))||((a=e.getAttribute("href"))==null?void 0:a.startsWith("?")))&&!e.hasAttribute("download")&&!e.hasAttribute("data-morph-skip")&&!e.closest("[data-morph-skip]")&&e.getAttribute("target")!=="_blank"});h(this,Mt,e=>J(this,null,function*(){e.preventDefault(),r(this,j,!0),yield this.navigate(location.href.replace(location.origin,""),{historyAction:"none",submorph:t(this,ut)?void 0:t(this,Pt),revalidate:t(this,ut),keepScrollPosition:t(this,At)}),r(this,j,!1)}));h(this,mt,()=>{const{left:e,top:s}=this.scrollValue,a=s-t(this,dt),l=e-t(this,ct);r(this,dt,s),r(this,ct,e),document.documentElement.classList.toggle("scroll-y",s>0),document.documentElement.classList.toggle("scroll-x",e>0),document.documentElement.classList.toggle("scroll-y-forward",a>0),document.documentElement.classList.toggle("scroll-y-backward",a<0),document.documentElement.classList.toggle("scroll-x-forward",l>0),document.documentElement.classList.toggle("scroll-x-backward",l<0),z.dispatchEvent(document,"morphScroll",{detail:{left:e,top:s}})});if(oe.isBrowser&&!Et.instance){Et.instance=this,r(this,T,{base:pt.normalizeBase(e==null?void 0:e.base),waitForHeadToLoad:(e==null?void 0:e.waitForHeadToLoad)!==!1,trailingSlash:(e==null?void 0:e.trailingSlash)||!1,scrollSelector:e==null?void 0:e.scrollSelector,morphInsideScrollContainer:(e==null?void 0:e.morphInsideScrollContainer)||!1}),r(this,lt,y(this,E,Ft).call(this,document.body));const s=this.normalizePath(location.pathname+location.search+location.hash);r(this,m,s);const a=new re(this,t(this,m).pathname);a.setInitialDocument(document),t(this,O).set(t(this,m).pathname,a),document.documentElement.setAttribute("data-current-pathname",t(this,m).pathname),document.documentElement.setAttribute("data-current-leaf",s.leaf),this.findLinks(),this.findParamsDependent(),history.scrollRestoration="manual",addEventListener("popstate",t(this,Mt)),pt.changeHistory({action:"replace",pathname:s.pathname,searchParameters:s.parameters,hash:s.hash}),r(this,et,new le),y(this,E,Bt).call(this,document)}}get currentURL(){return t(this,m)}get previousURL(){return t(this,tt)}get links(){return t(this,b)}get scrollElement(){return t(this,H)}get isPopstateNavigation(){return t(this,j)}get scrollValue(){let e=0,s=0;return t(this,bt)?(e=window.scrollY,s=window.scrollX):(e=t(this,H).scrollTop,s=t(this,H).scrollLeft),{top:e,left:s}}get isNavigating(){return!!t(this,W).length}saveState(e){const s=t(this,O).get(t(this,m).path);s&&s.saveState(e)}getState(){const e=t(this,O).get(t(this,m).path);return e==null?void 0:e.clearState()}normalizePath(e,s){return pt.splitPath(e,{base:t(this,T).base,trailingSlash:t(this,T).trailingSlash,mergeParams:s!=null&&s.mergeParams?location.search:"",removeParams:s==null?void 0:s.removeParams})}prefetch(e,s){return J(this,null,function*(){var l;if(t(this,W).length)return;e=((l=this.pathnameModifier)==null?void 0:l.call(this,e))||e;const a=y(this,E,gt).call(this,e);a==null||a.fetch(e,t(this,m).path,s)})}excludeHeadChild(e){return!1}setHeaders(e){}needRavalidation(e){const s=this.normalizePath(e),a=y(this,E,gt).call(this,s.path);a==null||a.needRavalidation()}navigate(Rt){return J(this,arguments,function*(e,{historyAction:s="push",centerScroll:a,offsetScroll:l,scrollBehaviour:v,revalidate:S,keepSearchParameters:f,submorph:c,submorphAppend:p,clearState:st,keepScrollPosition:A,mergeParams:at,removeParams:q,detail:w,scrollTo:G}={}){var R,Kt,Yt,$t;if(t(this,W).length)return;r(this,Pt,c),r(this,ut,S),r(this,At,A);const F=((R=this.pathnameModifier)==null?void 0:R.call(this,e))||e,d=this.normalizePath(F,{mergeParams:at,removeParams:q});if(!S&&(((Kt=t(this,$))==null?void 0:Kt.pathname)===d.pathname||t(this,m).pathname===d.pathname)){A||y(this,E,Nt).call(this,d.hash||0,{centerScroll:a,offsetScroll:l,behavior:"smooth"}),z.dispatchEvent(document,"morphSamePath",{detail:{detail:w}}),((Yt=t(this,m))==null?void 0:Yt.parameters)!==d.parameters&&(r(this,tt,t(this,m)),r(this,m,d),pt.changeHistory({action:(($t=t(this,m))==null?void 0:$t.hash)!==d.hash?"replace":s,pathname:d.pathname,searchParameters:d.parameters,hash:d.hash}),z.dispatchEvent(document,"morphURLParametersChange",{detail:{newURL:t(this,m),previousURL:t(this,tt),detail:w}})),t(this,b).forEach(X=>{X.checkCurrent(d.path)});return}else t(this,b).forEach(X=>{X.checkCurrent(d.path)});r(this,$,d);try{let X=!0;if(this.preprocessor)try{yield new Promise((n,P)=>{var x;(x=this.preprocessor)==null||x.call(this,{url:d,resolve:n,reject:P,submorph:c,detail:w})})}catch(n){n?console.error(n):console.log("Route change canceled"),X=!1}if(!X||t(this,$).pathname!==d.pathname){t(this,b).forEach(n=>{n.checkCurrent(t(this,m).path)});return}const jt={url:d,submorph:c,detail:w};c?p||c.forEach(n=>{document.querySelectorAll(n).forEach(P=>{P.classList.add("out"),P.setAttribute("data-morph-out","")})}):t(this,lt).forEach(n=>{var P,x;(P=n.firstElementChild)==null||P.classList.add("out"),(x=n.firstElementChild)==null||x.setAttribute("data-morph-out","")}),z.dispatchEvent(document,"morphNavigation",{detail:jt});const Tt=y(this,E,gt).call(this,t(this,m).pathname),L=y(this,E,gt).call(this,d.pathname);if(t(this,O).forEach(n=>{n.pathname!==d.pathname&&n.abort()}),yield L==null?void 0:L.fetch(F,t(this,m).path,S),t(this,$).pathname!==d.pathname){t(this,b).forEach(n=>{n.checkCurrent(t(this,m).path)});return}Tt.clearState(),Tt.saveScrollState(),Tt.saveDocumentState(),(!t(this,j)||S)&&(L.clearScrollState(),L.clearDocumentState()),st&&L.clearState(),L.cloneDocument(),t(this,et).textContent=L.title,document.body.appendChild(t(this,et));const Ct=zt(Ht({},jt),{document:L.document});p||Ct.document.querySelectorAll("[data-morph-out]").forEach(n=>{n.classList.remove("out")}),z.dispatchEvent(document,"morphStart",{detail:Ct});const Gt=Array.from(document.head.children),Jt=Array.from(L.document.head.children),Qt=ft.intersectElements(Gt,Jt),de=ft.excludeElements(Gt,Qt),Ut=ft.excludeElements(Jt,Qt).filter(n=>!this.excludeHeadChild(n));Ut.forEach((n,P)=>{n.tagName==="SCRIPT"&&(Ut[P]=ft.createScriptElement(n))}),Ut.forEach(n=>{document.head.appendChild(n)});const Dt=Ut.filter(n=>{if(n.hasAttribute("data-no-waiting"))return!1;if(y(this,E,Xt).call(this,n))return!0});t(this,T).waitForHeadToLoad&&Dt.length&&(yield new Promise(n=>J(this,null,function*(){let P=0;try{for(var x=ie(Dt),me,B,N;me=!(B=yield x.next()).done;me=!1){const xt=B.value;xt.onload=()=>{P++,P===Dt.length&&n()}}}catch(B){N=[B]}finally{try{me&&(B=x.return)&&(yield B.call(x))}finally{if(N)throw N[0]}}}))),yield ne.wait(10);const Zt=[];p||de.forEach(n=>{n.hasAttribute("data-permanent")||(y(this,E,Xt).call(this,n)?Zt.push(n):n.remove())});const ue=y(this,E,Ft).call(this,L.document.body);!t(this,T).morphInsideScrollContainer&&!c&&y(this,E,Bt).call(this,L.document),document.documentElement.setAttribute("data-current-pathname",d.pathname),document.documentElement.setAttribute("data-current-leaf",d.leaf),pt.changeHistory({action:s,pathname:d.pathname,searchParameters:d.parameters||(f?location.search:""),hash:d.hash}),t(this,et).remove(),r(this,tt,t(this,m)),r(this,m,d);const qt=[];t(this,lt).forEach((n,P)=>{const x=ue[P],me=getComputedStyle(n).getPropertyValue("--morph-duration");let B=[],N=[];c?(c.forEach(u=>{const g=n.querySelector(u),k=x.querySelector(u);g&&k&&(N.push(g),B.push(k))}),N.forEach(u=>{u.parentElement&&qt.push(u.parentElement)})):(B.push(...x.childNodes),N.push(...n.childNodes),qt.push(n));const xt=[];p||N.forEach(u=>{u instanceof HTMLElement&&(this.destroyOldLinks(u),u.classList.add("old"),u.querySelectorAll("[data-morph-transfer]").forEach(k=>{const pe=k.getAttribute("data-morph-transfer");xt.push({element:k,selector:pe})}))}),B.forEach(u=>{u instanceof HTMLElement&&(xt.forEach(g=>{const k=u.querySelector(g.selector);k&&k.replaceWith(L.document.importNode(g.element,!0))}),this.findNewLinks(u),u.classList.add("new"))}),c?p?B.forEach((u,g)=>{N[g]instanceof HTMLElement&&N[g].append(...u.childNodes)}):B.forEach((u,g)=>{var k;(k=N[g].parentElement)==null||k.insertBefore(u,N[g])}):n.prepend(...B),setTimeout(()=>{p||N.forEach(u=>{u instanceof HTMLElement&&u.classList.add("old-idle")}),B.forEach(u=>{var g;u instanceof HTMLElement&&((g=u.parentElement)==null||g.style.setProperty("--new-content-height",u.offsetHeight+"px"),u.classList.add("new-idle"))})},0);const _t=zt(Ht({},Ct),{morphElement:n});z.dispatchEvent(document,"morphNewChildrenAdded",{detail:_t});const fe=new Promise(u=>{setTimeout(()=>{p||N.forEach(g=>{g.remove()}),B.forEach(g=>{var k;g instanceof HTMLElement&&((k=g.parentElement)==null||k.style.removeProperty("--new-content-height"),g.classList.remove("new-idle","new"))}),p||z.dispatchEvent(document,"morphOldChildrenRemoved",{detail:_t}),u()},(parseFloat(me)||0)*1e3+10)});t(this,W).push(fe)}),this.isPopstateNavigation?document.documentElement.style.setProperty("--new-document-scroll-position",(this.scrollValue.top-L.scrollState.y)*1+"px"):document.documentElement.style.setProperty("--new-document-scroll-position",this.scrollValue.top+"px"),z.dispatchEvent(document,"morphBeforeNavigationScroll",{detail:L.scrollState}),G?(L.clearScrollState(),y(this,E,Nt).call(this,G,{centerScroll:a,offsetScroll:l,behavior:v})):d.hash?(L.clearScrollState(),y(this,E,Nt).call(this,d.hash,{centerScroll:a,offsetScroll:l,behavior:v})):t(this,j)?L.restoreScrollPosition():A||L.renewScrollPosition(),yield Promise.all(t(this,W)),p||Zt.forEach(n=>n.remove()),r(this,W,[]),qt.forEach(n=>{n.querySelectorAll("script").forEach(x=>{x.replaceWith(ft.createScriptElement(x))})}),t(this,b).forEach(n=>{n.checkCurrent(t(this,m).path)}),this.findParamsDependent(),z.dispatchEvent(document,"morphComplete",{detail:Ct}),document.documentElement.style.removeProperty("--new-document-scroll-position"),window.dispatchEvent(new Event("resize"))}catch(X){console.error(X)}r(this,$,void 0)})}addLink(e){t(this,b).push(new Vt(e,this))}addLinks(e){e.forEach(s=>{this.addLink(s)})}removeLink(e){r(this,b,t(this,b).filter(s=>s.element===e?(s.destroy(),!1):!0))}destroyOldLinks(e){r(this,b,t(this,b).filter(s=>e.contains(s.element)?(s.destroy(),!1):!0))}findNewLinks(e){const s=[...e.querySelectorAll("a")].filter(t(this,kt));t(this,b).push(...s.map(a=>new Vt(a,this)))}findLinks(){const e=[...document.documentElement.querySelectorAll("a")].filter(t(this,kt));t(this,b).forEach(s=>s.destroy()),r(this,b,e.map(s=>new Vt(s,this)))}findParamsDependent(){const e=[...document.documentElement.querySelectorAll("[data-morph-params-dependent]")];t(this,wt).forEach(s=>s.destroy()),r(this,wt,e.map(s=>new be(s)))}};T=new WeakMap,lt=new WeakMap,b=new WeakMap,$=new WeakMap,m=new WeakMap,tt=new WeakMap,W=new WeakMap,j=new WeakMap,H=new WeakMap,bt=new WeakMap,O=new WeakMap,wt=new WeakMap,et=new WeakMap,ct=new WeakMap,dt=new WeakMap,Pt=new WeakMap,ut=new WeakMap,At=new WeakMap,kt=new WeakMap,E=new WeakSet,gt=function(e){const s=this.normalizePath(e);let a=t(this,O).get(s.pathname);return a||(a=new re(this,s.pathname),t(this,O).set(s.pathname,a)),a},Ft=function(e){const s=[...e.querySelectorAll("[data-morph]")];return s.length?s:[e]},Xt=function(e){return e.tagName==="SCRIPT"||e.tagName==="STYLE"||e.tagName==="LINK"&&e.getAttribute("rel")==="stylesheet"},Bt=function(e){var s,a;(s=t(this,H))==null||s.removeEventListener("scroll",t(this,mt)),r(this,dt,0),r(this,ct,0),r(this,H,t(this,T).scrollSelector&&e.querySelector(t(this,T).scrollSelector)||window),r(this,bt,t(this,H)===window),(a=t(this,H))==null||a.addEventListener("scroll",t(this,mt)),t(this,mt).call(this)},Nt=function(e,s){const a=typeof e=="string"?document.getElementById(e):e;(typeof a=="number"||a)&&ne.scrollToElement(a,{scrollElement:t(this,H),behavior:(s==null?void 0:s.behavior)||"instant",center:s==null?void 0:s.centerScroll,offset:s==null?void 0:s.offsetScroll})},Mt=new WeakMap,mt=new WeakMap,Et.instance=null;let Ot=Et;exports.Morph=Ot;
@@ -37,7 +37,7 @@ import { i as ye, e as ae, c as ie } from "../dom-BETkVSSZ.js";
37
37
  import { d as q } from "../events-CsVF98U6.js";
38
38
  import { w as we, s as be } from "../scroll-DY5senkF.js";
39
39
  import "construct-style-sheets-polyfill";
40
- import { a as Pe, c as qt, s as Ae } from "../url-DAl-mgbC.js";
40
+ import { a as Pe, c as qt, d as Ae } from "../url-CYgo5vrG.js";
41
41
  import { cssValueParser as ke } from "../css-value-parser/index.js";
42
42
  import { c as he } from "../string-BlMQbe8b.js";
43
43
  class le extends HTMLElement {
@@ -1 +1 @@
1
- "use strict";var he=c=>{throw TypeError(c)};var se=(c,n,t)=>n.has(c)||he("Cannot "+t);var e=(c,n,t)=>(se(c,n,"read from private field"),t?t.call(c):n.get(c)),r=(c,n,t)=>n.has(c)?he("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(c):n.set(c,t),o=(c,n,t,s)=>(se(c,n,"write to private field"),s?s.call(c,t):n.set(c,t),t),p=(c,n,t)=>(se(c,n,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("../css-property/index.cjs"),Z=require("../Viewport-BxCr0GlB.cjs"),fe=require("../element-linked-store/index.cjs"),oe=require("../index-OE2INULi.cjs"),W=require("../events-KVanG9sR.cjs"),ge=require("../function-MthRj-GJ.cjs"),le=require("../style-At6aDoqG.cjs");require("construct-style-sheets-polyfill");const ce=require("../url-CPgw9bd5.cjs"),ae=require("../window-resizer/index.cjs");var f,w,ee,te;class ve{constructor(){r(this,f,new Map);r(this,w,[]);r(this,ee,n=>{var s;const t=[...e(this,w)].reverse().find(i=>i.clickOutside.current);if(t){const i=n.composedPath();if(i.find(Q=>Q instanceof HTMLElement&&Q.hasAttribute("data-popover-content")))return;const l=i[0],d=l instanceof Node&&(t.contains(l)||((s=t.shadowRoot)==null?void 0:s.contains(l))),L=l instanceof HTMLElement&&l.hasAttribute("data-outside");(!d||L)&&t.close()}});r(this,te,n=>{if(n.code==="Escape"){const t=[...e(this,w)].reverse().find(s=>s.escape.current);t&&t.close()}});document.documentElement.addEventListener("click",e(this,ee)),addEventListener("keydown",e(this,te))}get groups(){return e(this,f)}get stack(){return e(this,w)}add(n,t){if(t.closeRest.current)e(this,f).forEach(i=>{i.forEach(l=>{l.close()})});else if(t.closeRestInGroup.current){let i=e(this,f).get(n);i==null||i.forEach(l=>{l.close()})}let s=e(this,f).get(n);s!=null&&s.length||(s=[],e(this,f).set(n,s)),e(this,w).push(t),s.push(t)}remove(n,t){if(setTimeout(()=>{o(this,w,e(this,w).filter(s=>s!==t))}),t.closeRest.current){let s=[];e(this,f).forEach(i=>{i.forEach(l=>s.push(l))}),e(this,f).clear(),s.forEach(i=>i.close())}else if(t.closeRestInGroup.current){const s=e(this,f).get(n);e(this,f).delete(n),s==null||s.forEach(i=>{i.close()})}else{let s=e(this,f).get(n);s&&(s=s.filter(i=>i!==t),e(this,f).set(n,s))}}}f=new WeakMap,w=new WeakMap,ee=new WeakMap,te=new WeakMap;var v,B,H,R,G,m,T,P,q,$,b,V,O,k,E,z,a,M,D,u,ue,S,_,F,A,I,X,U;const C=class C extends HTMLElement{constructor(){super();r(this,u);r(this,v);r(this,B);r(this,H);r(this,R);r(this,G);r(this,m);r(this,T);r(this,P);r(this,q);r(this,$);r(this,b);r(this,V);r(this,O);r(this,k);r(this,E);r(this,z);r(this,a);r(this,M);r(this,D);r(this,F);r(this,A);r(this,I);r(this,X);r(this,U);this.urlValue="",o(this,v,!1),o(this,m,new y.CSSProperty(this,"--history",!1)),o(this,T,new y.CSSProperty(this,"--restore",!1)),o(this,P,new y.CSSProperty(this,"--dispatch-resize",!1)),o(this,q,new y.CSSProperty(this,"--close-rest",!1)),o(this,$,new y.CSSProperty(this,"--close-rest-in-group",!1)),o(this,b,new y.CSSProperty(this,"--group","")),o(this,V,new y.CSSProperty(this,"--click-outside",!1)),o(this,O,new y.CSSProperty(this,"--escape",!1)),o(this,k,new y.CSSProperty(this,"--check-viewport-bounds",!1)),o(this,E,!0),o(this,a,new fe.ElementLinkedStore(this,{triggered:!1,beforeopen:!1,opened:!1,closing:!1,transitionend:!1})),o(this,M,[]),o(this,D,[]),o(this,F,()=>{o(this,E,!1),e(this,v)&&e(this,m).current&&!location.search.includes(this.id)?this.close():!e(this,v)&&e(this,m).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),o(this,E,!0)}),o(this,A,()=>{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,I).call(this)}),o(this,I,ge.debounce(()=>{e(this,X).call(this)},10)),o(this,X,()=>{if(this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px"),e(this,k).current){const t=this.getBoundingClientRect();let s=0,i=0;t.right>Z.viewport.width?s=Z.viewport.width-t.right:t.left<0&&(s=t.left*-1),t.bottom>Z.viewport.height?i=Z.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")}}),o(this,U,()=>{this.close()}),e(this,b).subscribe(t=>{t.previous&&(C.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=C.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 closingClass(){return this.getAttribute("data-closing-global-class")}get history(){return e(this,m)}get restore(){return e(this,T)}get dispatchResize(){return e(this,P)}get closeRest(){return e(this,q)}get closeRestInGroup(){return e(this,$)}get group(){return e(this,b)}get clickOutside(){return e(this,V)}get escape(){return e(this,O)}get opened(){return e(this,v)}get lastTrigger(){return e(this,z)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,v)&&ce.updateSearchParameter(this.id,t)}open(t){if(e(this,v))return;o(this,z,t==null?void 0:t.trigger),clearTimeout(e(this,B)),clearTimeout(e(this,H)),p(this,u,S).call(this,!1,this.closingClass),e(this,a).set("closing",!1),e(this,a).set("triggered",!0),W.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,z)}}),e(this,m).current&&e(this,E)&&history.pushState(history.state,"",e(this,u,ue)),e(this,a).set("beforeopen",!0),o(this,v,!0);const s=()=>{C.stack.add(e(this,b).current,this),e(this,D).forEach(i=>{i.scroll({top:0,left:0,behavior:"instant"})}),p(this,u,S).call(this,!0,this.openClass),e(this,a).set("opened",!0),e(this,P).current?W.dispatchEvent(window,"resize",{custom:!0}):e(this,A).call(this),W.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,z)},bubbles:!0}),o(this,R,void 0),o(this,G,setTimeout(()=>{e(this,a).set("transitionend",!0),W.dispatchEvent(this,"popoverTransitionend")},le.getElementTransitionDurationMS(this)+10))};t!=null&&t.skipTransition?s():o(this,R,requestAnimationFrame(s))}close(){e(this,v)&&(o(this,v,!1),cancelAnimationFrame(e(this,R)),clearTimeout(e(this,G)),C.stack.remove(e(this,b).current,this),p(this,u,_).call(this),o(this,B,setTimeout(()=>{e(this,a).set("transitionend",!1),e(this,a).set("opened",!1),e(this,a).set("closing",!0),p(this,u,S).call(this,!1,this.openClass),p(this,u,S).call(this,!0,this.closingClass),W.dispatchEvent(this,"popoverClosing",{custom:!0,bubbles:!0}),o(this,H,setTimeout(()=>{e(this,a).set("triggered",!1),e(this,a).set("beforeopen",!1),e(this,a).set("closing",!1),p(this,u,S).call(this,!1,this.closingClass),W.dispatchEvent(this,"popoverClosed",{custom:!0,bubbles:!0})},le.getElementTransitionDurationMS(this)+10))},10)))}connectedCallback(){o(this,M,[...this.querySelectorAll(`[data-popover-close${this.id?`="${this.id}"`:""}]`)]),e(this,M).forEach(t=>{t.addEventListener("click",e(this,U))}),o(this,D,[...this.querySelectorAll(`[data-popover-reset-scroll${this.id?`="${this.id}"`:""}]`)]),e(this,m).observe(),e(this,T).observe(),e(this,P).observe(),e(this,q).observe(),e(this,$).observe(),e(this,b).observe(),e(this,V).observe(),e(this,O).observe(),e(this,k).observe(),this.setAttribute("role","dialog"),addEventListener("popstate",e(this,F)),setTimeout(()=>{e(this,T).current?(o(this,E,!1),this.urlValue=ce.parseSearchParameters(location.search)[this.id],location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),o(this,E,!0)):(p(this,u,_).call(this),o(this,E,!0))},0),e(this,k).subscribe(()=>{e(this,A).call(this)}),ae.windowResizer.subscribe(e(this,A))}disconnectedCallback(){e(this,M).forEach(t=>{t.removeEventListener("click",e(this,U))}),C.stack.remove(e(this,b).current,this),ae.windowResizer.unsubscribe(e(this,A)),e(this,m).close(),e(this,T).close(),e(this,P).close(),e(this,q).close(),e(this,$).close(),e(this,b).close(),e(this,V).close(),e(this,O).close(),e(this,k).close(),this.removeAttribute("role"),p(this,u,S).call(this,!1,this.openClass),p(this,u,S).call(this,!1,this.closingClass),clearTimeout(e(this,B)),clearTimeout(e(this,H)),clearTimeout(e(this,R)),clearTimeout(e(this,G)),removeEventListener("popstate",e(this,F)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),this.style.removeProperty("--viewport-offset-x"),this.style.removeProperty("--viewport-offset-y"),p(this,u,_).call(this)}};v=new WeakMap,B=new WeakMap,H=new WeakMap,R=new WeakMap,G=new WeakMap,m=new WeakMap,T=new WeakMap,P=new WeakMap,q=new WeakMap,$=new WeakMap,b=new WeakMap,V=new WeakMap,O=new WeakMap,k=new WeakMap,E=new WeakMap,z=new WeakMap,a=new WeakMap,M=new WeakMap,D=new WeakMap,u=new WeakSet,ue=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},S=function(t,s){s&&s.split(" ").map(i=>{document.documentElement.classList.toggle(i.trim(),t)})},_=function(){if(e(this,m).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},F=new WeakMap,A=new WeakMap,I=new WeakMap,X=new WeakMap,U=new WeakMap,C.stack=new ve;let j=C;oe.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",j);var h,g,x,ie,Y,J,K,N,re;class pe extends HTMLElement{constructor(){super();r(this,x);r(this,h);r(this,g,new y.CSSProperty(this,"--type","open"));r(this,Y,t=>{t.target===e(this,h)&&e(this,g).current!=="close"&&this.classList.add("triggered")});r(this,J,t=>{t.target===e(this,h)&&e(this,g).current!=="close"&&(this.classList.add("opened"),this.setAttribute("aria-expanded","true"))});r(this,K,t=>{t.target===e(this,h)&&e(this,g).current!=="close"&&this.classList.remove("opened")});r(this,N,t=>{t.target===e(this,h)&&e(this,g).current!=="close"&&(this.classList.remove("triggered"),this.setAttribute("aria-expanded","false"))});oe.isBrowser&&(this.addEventListener("click",()=>{if(e(this,h)){const t=e(this,g).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,g)}get popoverElement(){return e(this,h)}changePopover(t){var s;if(p(this,x,ie).call(this),t){let i=null;if(t==="parent"){const l=this.closest("[data-popover]");if(l)i=l;else{const d=this.getRootNode();d instanceof ShadowRoot?i=d.host.closest("[data-popover]"):d instanceof HTMLElement&&(i=d.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=d=>{if(!d)return null;let L=d.querySelector("[data-popover]");return!L&&(d!=null&&d.parentElement)&&(L=l(d.parentElement)),L};i=l(this.parentElement)||null}else{let l=t;if(isNaN(parseInt(l))&&(!t.startsWith(".")&&!t.startsWith("[")&&!t.startsWith("#")&&(l=`#${t}`),i=document.querySelector(l)||this.getRootNode().querySelector(l)),!i){const L=[...document.querySelectorAll("[data-popover-ids]")].find(Q=>{var ne;return(ne=Q.getAttribute("data-popover-ids"))==null?void 0:ne.split(",").find(de=>de.trim()===t)});L&&(i=L)}}i instanceof HTMLElement?(o(this,h,i),e(this,h).addEventListener("popoverTriggered",e(this,Y)),e(this,h).addEventListener("popoverOpened",e(this,J)),e(this,h).addEventListener("popoverClosing",e(this,K)),e(this,h).addEventListener("popoverClosed",e(this,N))):console.warn(this,`target ${t} not found`)}p(this,x,re).call(this,e(this,g).current)}connectedCallback(){e(this,g).subscribe(s=>{p(this,x,re).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,g).observe()}disconnectedCallback(){e(this,g).unobserve(),this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls"),this.removeAttribute("role"),this.removeAttribute("tabindex"),p(this,x,ie).call(this)}}h=new WeakMap,g=new WeakMap,x=new WeakSet,ie=function(){e(this,h)&&(e(this,h).removeEventListener("popoverTriggered",e(this,Y)),e(this,h).removeEventListener("popoverOpened",e(this,J)),e(this,h).removeEventListener("popoverClosing",e(this,K)),e(this,h).removeEventListener("popoverClosed",e(this,N)))},Y=new WeakMap,J=new WeakMap,K=new WeakMap,N=new WeakMap,re=function(t){e(this,h)instanceof j&&(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")))};oe.isBrowser&&!customElements.get("e-popover-button")&&customElements.define("e-popover-button",pe);exports.PopoverButtonElement=pe;exports.PopoverElement=j;
1
+ "use strict";var he=c=>{throw TypeError(c)};var se=(c,n,t)=>n.has(c)||he("Cannot "+t);var e=(c,n,t)=>(se(c,n,"read from private field"),t?t.call(c):n.get(c)),r=(c,n,t)=>n.has(c)?he("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(c):n.set(c,t),o=(c,n,t,s)=>(se(c,n,"write to private field"),s?s.call(c,t):n.set(c,t),t),p=(c,n,t)=>(se(c,n,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("../css-property/index.cjs"),Z=require("../Viewport-BxCr0GlB.cjs"),fe=require("../element-linked-store/index.cjs"),oe=require("../index-OE2INULi.cjs"),W=require("../events-KVanG9sR.cjs"),ge=require("../function-MthRj-GJ.cjs"),le=require("../style-At6aDoqG.cjs");require("construct-style-sheets-polyfill");const ce=require("../url-CHgcNwJ1.cjs"),ae=require("../window-resizer/index.cjs");var f,w,ee,te;class ve{constructor(){r(this,f,new Map);r(this,w,[]);r(this,ee,n=>{var s;const t=[...e(this,w)].reverse().find(i=>i.clickOutside.current);if(t){const i=n.composedPath();if(i.find(Q=>Q instanceof HTMLElement&&Q.hasAttribute("data-popover-content")))return;const l=i[0],d=l instanceof Node&&(t.contains(l)||((s=t.shadowRoot)==null?void 0:s.contains(l))),L=l instanceof HTMLElement&&l.hasAttribute("data-outside");(!d||L)&&t.close()}});r(this,te,n=>{if(n.code==="Escape"){const t=[...e(this,w)].reverse().find(s=>s.escape.current);t&&t.close()}});document.documentElement.addEventListener("click",e(this,ee)),addEventListener("keydown",e(this,te))}get groups(){return e(this,f)}get stack(){return e(this,w)}add(n,t){if(t.closeRest.current)e(this,f).forEach(i=>{i.forEach(l=>{l.close()})});else if(t.closeRestInGroup.current){let i=e(this,f).get(n);i==null||i.forEach(l=>{l.close()})}let s=e(this,f).get(n);s!=null&&s.length||(s=[],e(this,f).set(n,s)),e(this,w).push(t),s.push(t)}remove(n,t){if(setTimeout(()=>{o(this,w,e(this,w).filter(s=>s!==t))}),t.closeRest.current){let s=[];e(this,f).forEach(i=>{i.forEach(l=>s.push(l))}),e(this,f).clear(),s.forEach(i=>i.close())}else if(t.closeRestInGroup.current){const s=e(this,f).get(n);e(this,f).delete(n),s==null||s.forEach(i=>{i.close()})}else{let s=e(this,f).get(n);s&&(s=s.filter(i=>i!==t),e(this,f).set(n,s))}}}f=new WeakMap,w=new WeakMap,ee=new WeakMap,te=new WeakMap;var v,B,H,R,G,m,T,P,q,$,b,V,O,k,E,z,a,M,D,u,ue,S,_,F,A,I,X,U;const C=class C extends HTMLElement{constructor(){super();r(this,u);r(this,v);r(this,B);r(this,H);r(this,R);r(this,G);r(this,m);r(this,T);r(this,P);r(this,q);r(this,$);r(this,b);r(this,V);r(this,O);r(this,k);r(this,E);r(this,z);r(this,a);r(this,M);r(this,D);r(this,F);r(this,A);r(this,I);r(this,X);r(this,U);this.urlValue="",o(this,v,!1),o(this,m,new y.CSSProperty(this,"--history",!1)),o(this,T,new y.CSSProperty(this,"--restore",!1)),o(this,P,new y.CSSProperty(this,"--dispatch-resize",!1)),o(this,q,new y.CSSProperty(this,"--close-rest",!1)),o(this,$,new y.CSSProperty(this,"--close-rest-in-group",!1)),o(this,b,new y.CSSProperty(this,"--group","")),o(this,V,new y.CSSProperty(this,"--click-outside",!1)),o(this,O,new y.CSSProperty(this,"--escape",!1)),o(this,k,new y.CSSProperty(this,"--check-viewport-bounds",!1)),o(this,E,!0),o(this,a,new fe.ElementLinkedStore(this,{triggered:!1,beforeopen:!1,opened:!1,closing:!1,transitionend:!1})),o(this,M,[]),o(this,D,[]),o(this,F,()=>{o(this,E,!1),e(this,v)&&e(this,m).current&&!location.search.includes(this.id)?this.close():!e(this,v)&&e(this,m).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),o(this,E,!0)}),o(this,A,()=>{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,I).call(this)}),o(this,I,ge.debounce(()=>{e(this,X).call(this)},10)),o(this,X,()=>{if(this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px"),e(this,k).current){const t=this.getBoundingClientRect();let s=0,i=0;t.right>Z.viewport.width?s=Z.viewport.width-t.right:t.left<0&&(s=t.left*-1),t.bottom>Z.viewport.height?i=Z.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")}}),o(this,U,()=>{this.close()}),e(this,b).subscribe(t=>{t.previous&&(C.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=C.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 closingClass(){return this.getAttribute("data-closing-global-class")}get history(){return e(this,m)}get restore(){return e(this,T)}get dispatchResize(){return e(this,P)}get closeRest(){return e(this,q)}get closeRestInGroup(){return e(this,$)}get group(){return e(this,b)}get clickOutside(){return e(this,V)}get escape(){return e(this,O)}get opened(){return e(this,v)}get lastTrigger(){return e(this,z)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,v)&&ce.updateSearchParameter(this.id,t)}open(t){if(e(this,v))return;o(this,z,t==null?void 0:t.trigger),clearTimeout(e(this,B)),clearTimeout(e(this,H)),p(this,u,S).call(this,!1,this.closingClass),e(this,a).set("closing",!1),e(this,a).set("triggered",!0),W.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,z)}}),e(this,m).current&&e(this,E)&&history.pushState(history.state,"",e(this,u,ue)),e(this,a).set("beforeopen",!0),o(this,v,!0);const s=()=>{C.stack.add(e(this,b).current,this),e(this,D).forEach(i=>{i.scroll({top:0,left:0,behavior:"instant"})}),p(this,u,S).call(this,!0,this.openClass),e(this,a).set("opened",!0),e(this,P).current?W.dispatchEvent(window,"resize",{custom:!0}):e(this,A).call(this),W.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,z)},bubbles:!0}),o(this,R,void 0),o(this,G,setTimeout(()=>{e(this,a).set("transitionend",!0),W.dispatchEvent(this,"popoverTransitionend")},le.getElementTransitionDurationMS(this)+10))};t!=null&&t.skipTransition?s():o(this,R,requestAnimationFrame(s))}close(){e(this,v)&&(o(this,v,!1),cancelAnimationFrame(e(this,R)),clearTimeout(e(this,G)),C.stack.remove(e(this,b).current,this),p(this,u,_).call(this),o(this,B,setTimeout(()=>{e(this,a).set("transitionend",!1),e(this,a).set("opened",!1),e(this,a).set("closing",!0),p(this,u,S).call(this,!1,this.openClass),p(this,u,S).call(this,!0,this.closingClass),W.dispatchEvent(this,"popoverClosing",{custom:!0,bubbles:!0}),o(this,H,setTimeout(()=>{e(this,a).set("triggered",!1),e(this,a).set("beforeopen",!1),e(this,a).set("closing",!1),p(this,u,S).call(this,!1,this.closingClass),W.dispatchEvent(this,"popoverClosed",{custom:!0,bubbles:!0})},le.getElementTransitionDurationMS(this)+10))},10)))}connectedCallback(){o(this,M,[...this.querySelectorAll(`[data-popover-close${this.id?`="${this.id}"`:""}]`)]),e(this,M).forEach(t=>{t.addEventListener("click",e(this,U))}),o(this,D,[...this.querySelectorAll(`[data-popover-reset-scroll${this.id?`="${this.id}"`:""}]`)]),e(this,m).observe(),e(this,T).observe(),e(this,P).observe(),e(this,q).observe(),e(this,$).observe(),e(this,b).observe(),e(this,V).observe(),e(this,O).observe(),e(this,k).observe(),this.setAttribute("role","dialog"),addEventListener("popstate",e(this,F)),setTimeout(()=>{e(this,T).current?(o(this,E,!1),this.urlValue=ce.parseSearchParameters(location.search)[this.id],location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),o(this,E,!0)):(p(this,u,_).call(this),o(this,E,!0))},0),e(this,k).subscribe(()=>{e(this,A).call(this)}),ae.windowResizer.subscribe(e(this,A))}disconnectedCallback(){e(this,M).forEach(t=>{t.removeEventListener("click",e(this,U))}),C.stack.remove(e(this,b).current,this),ae.windowResizer.unsubscribe(e(this,A)),e(this,m).close(),e(this,T).close(),e(this,P).close(),e(this,q).close(),e(this,$).close(),e(this,b).close(),e(this,V).close(),e(this,O).close(),e(this,k).close(),this.removeAttribute("role"),p(this,u,S).call(this,!1,this.openClass),p(this,u,S).call(this,!1,this.closingClass),clearTimeout(e(this,B)),clearTimeout(e(this,H)),clearTimeout(e(this,R)),clearTimeout(e(this,G)),removeEventListener("popstate",e(this,F)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),this.style.removeProperty("--viewport-offset-x"),this.style.removeProperty("--viewport-offset-y"),p(this,u,_).call(this)}};v=new WeakMap,B=new WeakMap,H=new WeakMap,R=new WeakMap,G=new WeakMap,m=new WeakMap,T=new WeakMap,P=new WeakMap,q=new WeakMap,$=new WeakMap,b=new WeakMap,V=new WeakMap,O=new WeakMap,k=new WeakMap,E=new WeakMap,z=new WeakMap,a=new WeakMap,M=new WeakMap,D=new WeakMap,u=new WeakSet,ue=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},S=function(t,s){s&&s.split(" ").map(i=>{document.documentElement.classList.toggle(i.trim(),t)})},_=function(){if(e(this,m).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},F=new WeakMap,A=new WeakMap,I=new WeakMap,X=new WeakMap,U=new WeakMap,C.stack=new ve;let j=C;oe.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",j);var h,g,x,ie,Y,J,K,N,re;class pe extends HTMLElement{constructor(){super();r(this,x);r(this,h);r(this,g,new y.CSSProperty(this,"--type","open"));r(this,Y,t=>{t.target===e(this,h)&&e(this,g).current!=="close"&&this.classList.add("triggered")});r(this,J,t=>{t.target===e(this,h)&&e(this,g).current!=="close"&&(this.classList.add("opened"),this.setAttribute("aria-expanded","true"))});r(this,K,t=>{t.target===e(this,h)&&e(this,g).current!=="close"&&this.classList.remove("opened")});r(this,N,t=>{t.target===e(this,h)&&e(this,g).current!=="close"&&(this.classList.remove("triggered"),this.setAttribute("aria-expanded","false"))});oe.isBrowser&&(this.addEventListener("click",()=>{if(e(this,h)){const t=e(this,g).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,g)}get popoverElement(){return e(this,h)}changePopover(t){var s;if(p(this,x,ie).call(this),t){let i=null;if(t==="parent"){const l=this.closest("[data-popover]");if(l)i=l;else{const d=this.getRootNode();d instanceof ShadowRoot?i=d.host.closest("[data-popover]"):d instanceof HTMLElement&&(i=d.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=d=>{if(!d)return null;let L=d.querySelector("[data-popover]");return!L&&(d!=null&&d.parentElement)&&(L=l(d.parentElement)),L};i=l(this.parentElement)||null}else{let l=t;if(isNaN(parseInt(l))&&(!t.startsWith(".")&&!t.startsWith("[")&&!t.startsWith("#")&&(l=`#${t}`),i=document.querySelector(l)||this.getRootNode().querySelector(l)),!i){const L=[...document.querySelectorAll("[data-popover-ids]")].find(Q=>{var ne;return(ne=Q.getAttribute("data-popover-ids"))==null?void 0:ne.split(",").find(de=>de.trim()===t)});L&&(i=L)}}i instanceof HTMLElement?(o(this,h,i),e(this,h).addEventListener("popoverTriggered",e(this,Y)),e(this,h).addEventListener("popoverOpened",e(this,J)),e(this,h).addEventListener("popoverClosing",e(this,K)),e(this,h).addEventListener("popoverClosed",e(this,N))):console.warn(this,`target ${t} not found`)}p(this,x,re).call(this,e(this,g).current)}connectedCallback(){e(this,g).subscribe(s=>{p(this,x,re).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,g).observe()}disconnectedCallback(){e(this,g).unobserve(),this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls"),this.removeAttribute("role"),this.removeAttribute("tabindex"),p(this,x,ie).call(this)}}h=new WeakMap,g=new WeakMap,x=new WeakSet,ie=function(){e(this,h)&&(e(this,h).removeEventListener("popoverTriggered",e(this,Y)),e(this,h).removeEventListener("popoverOpened",e(this,J)),e(this,h).removeEventListener("popoverClosing",e(this,K)),e(this,h).removeEventListener("popoverClosed",e(this,N)))},Y=new WeakMap,J=new WeakMap,K=new WeakMap,N=new WeakMap,re=function(t){e(this,h)instanceof j&&(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")))};oe.isBrowser&&!customElements.get("e-popover-button")&&customElements.define("e-popover-button",pe);exports.PopoverButtonElement=pe;exports.PopoverElement=j;
@@ -11,7 +11,7 @@ import { d as W } from "../events-CsVF98U6.js";
11
11
  import { d as dt } from "../function-C10DGppn.js";
12
12
  import { g as lt } from "../style-j2TwriJ_.js";
13
13
  import "construct-style-sheets-polyfill";
14
- import { u as ft, p as gt } from "../url-DAl-mgbC.js";
14
+ import { u as ft, p as gt } from "../url-CYgo5vrG.js";
15
15
  import { windowResizer as ct } from "../window-resizer/index.js";
16
16
  var f, w, tt, et;
17
17
  class mt {
@@ -1 +1 @@
1
- "use strict";var ue=Object.defineProperty,ce=Object.defineProperties;var de=Object.getOwnPropertyDescriptors;var K=Object.getOwnPropertySymbols;var me=Object.prototype.hasOwnProperty,fe=Object.prototype.propertyIsEnumerable;var Y=i=>{throw TypeError(i)};var W=(i,e,s)=>e in i?ue(i,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[e]=s,$=(i,e)=>{for(var s in e||(e={}))me.call(e,s)&&W(i,s,e[s]);if(K)for(var s of K(e))fe.call(e,s)&&W(i,s,e[s]);return i},G=(i,e)=>ce(i,de(e));var U=(i,e,s)=>e.has(i)||Y("Cannot "+s);var t=(i,e,s)=>(U(i,e,"read from private field"),s?s.call(i):e.get(i)),n=(i,e,s)=>e.has(i)?Y("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,s),h=(i,e,s,r)=>(U(i,e,"write to private field"),r?r.call(i,s):e.set(i,s),s),d=(i,e,s)=>(U(i,e,"access private method"),s);var J=(i,e,s,r)=>({set _(a){h(i,e,a,s)},get _(){return t(i,e,r)}});var R=(i,e,s)=>new Promise((r,a)=>{var o=f=>{try{g(s.next(f))}catch(N){a(N)}},C=f=>{try{g(s.throw(f))}catch(N){a(N)}},g=f=>f.done?r(f.value):Promise.resolve(f.value).then(o,C);g((s=s.apply(i,e)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const pe=require("../history/index.cjs"),ge=require("../LocalLinks-Baf0xWZ3.cjs"),Re=require("../PageAnnouncerElement-AQ0Ja6HM.cjs"),we=require("../PageScroll-BXJUQwG7.cjs");require("construct-style-sheets-polyfill");require("../index-OE2INULi.cjs");const Q=require("../url-CPgw9bd5.cjs"),ve=require("urlpattern-polyfill"),Pe=require("../render-BIOfUddT.cjs"),be=require("../object-baN9pgbU.cjs");var S,H,q,p,u,T,M,v,P,b,l,X,Z,ee,te,se,ie,re,ae,B,y;class ye{constructor(e,s){n(this,l);n(this,S);n(this,H);n(this,q);n(this,p,null);n(this,u,null);n(this,T,!1);n(this,M,null);n(this,v);n(this,P,[]);n(this,b,[]);n(this,y,e=>{t(this,u).removeEventListener("__hmrInstanceReplace",t(this,y)),h(this,u,e.detail.element),t(this,u).addEventListener("__hmrInstanceReplace",t(this,y))});h(this,S,e),h(this,H,s),h(this,q,new URLPattern({pathname:t(this,S)})),h(this,v,new MutationObserver(d(this,l,re).bind(this)))}get pattern(){return t(this,S)}get isActive(){return t(this,T)}get element(){return t(this,u)}get nest(){return t(this,M)}testPathname(e){return t(this,q).test({pathname:e})}render(e,s){return R(this,null,function*(){t(this,v).observe(document.head,{childList:!0,subtree:!0}),t(this,p)?d(this,l,Z).call(this):yield d(this,l,X).call(this),yield d(this,l,ae).call(this),t(this,p)&&(yield d(this,l,ee).call(this,e,s)),t(this,v).disconnect()})}close(){d(this,l,se).call(this)}}S=new WeakMap,H=new WeakMap,q=new WeakMap,p=new WeakMap,u=new WeakMap,T=new WeakMap,M=new WeakMap,v=new WeakMap,P=new WeakMap,b=new WeakMap,l=new WeakSet,X=function(){return R(this,null,function*(){const e=yield t(this,H).call(this);h(this,b,[...t(this,P)]),typeof e.default=="function"&&h(this,p,e.default)})},Z=function(){t(this,P).forEach(e=>{document.head.appendChild(e.cloneNode(!0))})},ee=function(e,s){return R(this,null,function*(){var o;const a={urlPatternResult:t(this,q).exec({pathname:s.pathname})};be.isESClass(t(this,p))?(h(this,u,new(t(this,p))(a)),e.appendChild(t(this,u))):h(this,u,Pe.render(e,t(this,p),a)),(o=t(this,u))==null||o.addEventListener("__hmrInstanceReplace",t(this,y)),d(this,l,te).call(this),h(this,T,!0)})},te=function(){var e;t(this,u)&&h(this,M,t(this,u).querySelector("[data-nest]")||((e=t(this,u).shadowRoot)==null?void 0:e.querySelector("[data-nest]"))||t(this,u).shadowRoot||t(this,u))},se=function(){t(this,v).disconnect(),t(this,u)&&(t(this,u).removeEventListener("__hmrInstanceReplace",t(this,y)),t(this,u).remove()),h(this,T,!1),d(this,l,ie).call(this)},ie=function(){t(this,b).forEach(e=>{e.parentNode===document.head&&document.head.removeChild(e)}),h(this,b,[])},re=function(e){e.forEach(s=>{s.addedNodes.forEach(r=>{t(this,p)?t(this,b).push(r):t(this,P).push(r)})})},ae=function(){return R(this,null,function*(){const e=t(this,P).filter(d(this,l,B));yield Promise.all(e.map(s=>new Promise(r=>{d(this,l,B).call(this,s)?s.onload=()=>r():r()})))})},B=function(e){return e instanceof HTMLElement&&(e.tagName==="STYLE"||e.tagName==="SCRIPT"||e.tagName==="LINK")},y=new WeakMap;globalThis.URLPattern=ve.URLPattern;var c,L,k,E,I,_,w,A,m,ne,he,le,z,oe;class Le{constructor(e){n(this,m);n(this,c,null);n(this,L,null);n(this,k,null);n(this,E,null);n(this,I,null);n(this,_,0);n(this,w,[]);n(this,A,null);h(this,c,G($({},e),{rootElement:(e==null?void 0:e.rootElement)||document.body,base:Q.normalizeBase(e==null?void 0:e.base)})),h(this,I,new Re.PageAnnouncerElement),h(this,L,new we.PageScroll(t(this,c).scrollSelector)),t(this,L).update(),h(this,k,new ge.LocalLinks({base:t(this,c).base,trailingSlash:t(this,c).trailingSlash,includeAnchor:e==null?void 0:e.includeAnchor,onClick:(s,r)=>{try{this.navigate(s,r)}catch(a){window.location.assign(s)}}})),t(this,k).update(),h(this,E,new pe.History({onPop:s=>{this.navigate(s)}}))}history(){return t(this,E)}get scroll(){return scroll}get routes(){return t(this,w)}run(){d(this,m,oe).call(this),this.navigate(new URL(location.href),{revalidate:!0})}defineRoute(e,s){const r=new ye(e,s);t(this,w).push(r)}navigate(e,s){return R(this,null,function*(){var O,j,x,V,D,F;const r=t(this,E).isBack,a=++J(this,_)._;let o=Q.normalizeURL(e,{base:t(this,c).base,trailingSlash:t(this,c).trailingSlash});if(t(this,c).urlModifier&&(o=t(this,c).urlModifier(o)),!(yield d(this,m,ne).call(this,o))||t(this,_)!==a||(yield(j=(O=t(this,c)).beforeNavigation)==null?void 0:j.call(O),t(this,_)!==a))return;const{activeRoutes:C,newRoutes:g,oldRoutes:f,keepRoutes:N}=d(this,m,he).call(this,o);h(this,A,(x=N[N.length-1])!=null?x:null),r||(t(this,E).push(o),((V=s==null?void 0:s.keepScrollPosition)==null||V)&&t(this,L).element.scrollTo({top:0,behavior:"instant"})),t(this,I).create(document,o.pathname),t(this,c).viewTransition&&document.startViewTransition?yield document.startViewTransition(()=>d(this,m,z).call(this,f,g,o)).finished:yield d(this,m,z).call(this,f,g,o),t(this,L).update(),t(this,k).update(),t(this,I).done(),yield(F=(D=t(this,c)).afterNavigation)==null?void 0:F.call(D)})}}c=new WeakMap,L=new WeakMap,k=new WeakMap,E=new WeakMap,I=new WeakMap,_=new WeakMap,w=new WeakMap,A=new WeakMap,m=new WeakSet,ne=function(e){return R(this,null,function*(){if(!t(this,c).preprocessor)return!0;try{return yield new Promise((s,r)=>{var a,o;(o=(a=t(this,c)).preprocessor)==null||o.call(a,{url:e,resolve:s,reject:r})}),!0}catch(s){return console.error(s!=null?s:"Route change canceled"),!1}})},he=function(e){let s=e.pathname.replace(t(this,c).base,"");s.startsWith("/")||(s=`/${s}`);const r=t(this,w).filter(a=>a.isActive);return{activeRoutes:r,newRoutes:t(this,w).filter(a=>!r.includes(a)&&a.testPathname(s)),oldRoutes:r.filter(a=>!a.testPathname(s)),keepRoutes:r.filter(a=>a.testPathname(s))}},le=function(e){e.forEach(s=>s.close())},z=function(e,s,r){return R(this,null,function*(){var a,o;d(this,m,le).call(this,e);for(const C of s){const g=(o=(a=t(this,A))==null?void 0:a.nest)!=null?o:t(this,c).rootElement;yield C.render(g,r),h(this,A,C)}})},oe=function(){t(this,w).sort((e,s)=>{const r=e.pattern.split("/").length,a=s.pattern.split("/").length;return r-a})};exports.Router=Le;
1
+ "use strict";var ue=Object.defineProperty,ce=Object.defineProperties;var de=Object.getOwnPropertyDescriptors;var K=Object.getOwnPropertySymbols;var me=Object.prototype.hasOwnProperty,fe=Object.prototype.propertyIsEnumerable;var Y=i=>{throw TypeError(i)};var W=(i,e,s)=>e in i?ue(i,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[e]=s,$=(i,e)=>{for(var s in e||(e={}))me.call(e,s)&&W(i,s,e[s]);if(K)for(var s of K(e))fe.call(e,s)&&W(i,s,e[s]);return i},G=(i,e)=>ce(i,de(e));var U=(i,e,s)=>e.has(i)||Y("Cannot "+s);var t=(i,e,s)=>(U(i,e,"read from private field"),s?s.call(i):e.get(i)),n=(i,e,s)=>e.has(i)?Y("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,s),h=(i,e,s,r)=>(U(i,e,"write to private field"),r?r.call(i,s):e.set(i,s),s),d=(i,e,s)=>(U(i,e,"access private method"),s);var J=(i,e,s,r)=>({set _(a){h(i,e,a,s)},get _(){return t(i,e,r)}});var R=(i,e,s)=>new Promise((r,a)=>{var o=f=>{try{g(s.next(f))}catch(N){a(N)}},C=f=>{try{g(s.throw(f))}catch(N){a(N)}},g=f=>f.done?r(f.value):Promise.resolve(f.value).then(o,C);g((s=s.apply(i,e)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const pe=require("../history/index.cjs"),ge=require("../LocalLinks-BxhSFv_Q.cjs"),Re=require("../PageAnnouncerElement-AQ0Ja6HM.cjs"),we=require("../PageScroll-BXJUQwG7.cjs");require("construct-style-sheets-polyfill");require("../index-OE2INULi.cjs");const Q=require("../url-CHgcNwJ1.cjs"),ve=require("urlpattern-polyfill"),Pe=require("../render-BIOfUddT.cjs"),be=require("../object-baN9pgbU.cjs");var S,H,q,p,u,T,M,v,P,b,l,X,Z,ee,te,se,ie,re,ae,B,y;class ye{constructor(e,s){n(this,l);n(this,S);n(this,H);n(this,q);n(this,p,null);n(this,u,null);n(this,T,!1);n(this,M,null);n(this,v);n(this,P,[]);n(this,b,[]);n(this,y,e=>{t(this,u).removeEventListener("__hmrInstanceReplace",t(this,y)),h(this,u,e.detail.element),t(this,u).addEventListener("__hmrInstanceReplace",t(this,y))});h(this,S,e),h(this,H,s),h(this,q,new URLPattern({pathname:t(this,S)})),h(this,v,new MutationObserver(d(this,l,re).bind(this)))}get pattern(){return t(this,S)}get isActive(){return t(this,T)}get element(){return t(this,u)}get nest(){return t(this,M)}testPathname(e){return t(this,q).test({pathname:e})}render(e,s){return R(this,null,function*(){t(this,v).observe(document.head,{childList:!0,subtree:!0}),t(this,p)?d(this,l,Z).call(this):yield d(this,l,X).call(this),yield d(this,l,ae).call(this),t(this,p)&&(yield d(this,l,ee).call(this,e,s)),t(this,v).disconnect()})}close(){d(this,l,se).call(this)}}S=new WeakMap,H=new WeakMap,q=new WeakMap,p=new WeakMap,u=new WeakMap,T=new WeakMap,M=new WeakMap,v=new WeakMap,P=new WeakMap,b=new WeakMap,l=new WeakSet,X=function(){return R(this,null,function*(){const e=yield t(this,H).call(this);h(this,b,[...t(this,P)]),typeof e.default=="function"&&h(this,p,e.default)})},Z=function(){t(this,P).forEach(e=>{document.head.appendChild(e.cloneNode(!0))})},ee=function(e,s){return R(this,null,function*(){var o;const a={urlPatternResult:t(this,q).exec({pathname:s.pathname})};be.isESClass(t(this,p))?(h(this,u,new(t(this,p))(a)),e.appendChild(t(this,u))):h(this,u,Pe.render(e,t(this,p),a)),(o=t(this,u))==null||o.addEventListener("__hmrInstanceReplace",t(this,y)),d(this,l,te).call(this),h(this,T,!0)})},te=function(){var e;t(this,u)&&h(this,M,t(this,u).querySelector("[data-nest]")||((e=t(this,u).shadowRoot)==null?void 0:e.querySelector("[data-nest]"))||t(this,u).shadowRoot||t(this,u))},se=function(){t(this,v).disconnect(),t(this,u)&&(t(this,u).removeEventListener("__hmrInstanceReplace",t(this,y)),t(this,u).remove()),h(this,T,!1),d(this,l,ie).call(this)},ie=function(){t(this,b).forEach(e=>{e.parentNode===document.head&&document.head.removeChild(e)}),h(this,b,[])},re=function(e){e.forEach(s=>{s.addedNodes.forEach(r=>{t(this,p)?t(this,b).push(r):t(this,P).push(r)})})},ae=function(){return R(this,null,function*(){const e=t(this,P).filter(d(this,l,B));yield Promise.all(e.map(s=>new Promise(r=>{d(this,l,B).call(this,s)?s.onload=()=>r():r()})))})},B=function(e){return e instanceof HTMLElement&&(e.tagName==="STYLE"||e.tagName==="SCRIPT"||e.tagName==="LINK")},y=new WeakMap;globalThis.URLPattern=ve.URLPattern;var c,L,k,E,I,_,w,A,m,ne,he,le,z,oe;class Le{constructor(e){n(this,m);n(this,c,null);n(this,L,null);n(this,k,null);n(this,E,null);n(this,I,null);n(this,_,0);n(this,w,[]);n(this,A,null);h(this,c,G($({},e),{rootElement:(e==null?void 0:e.rootElement)||document.body,base:Q.normalizeBase(e==null?void 0:e.base)})),h(this,I,new Re.PageAnnouncerElement),h(this,L,new we.PageScroll(t(this,c).scrollSelector)),t(this,L).update(),h(this,k,new ge.LocalLinks({base:t(this,c).base,trailingSlash:t(this,c).trailingSlash,includeAnchor:e==null?void 0:e.includeAnchor,onClick:(s,r)=>{try{this.navigate(s,r)}catch(a){window.location.assign(s)}}})),t(this,k).update(),h(this,E,new pe.History({onPop:s=>{this.navigate(s)}}))}history(){return t(this,E)}get scroll(){return scroll}get routes(){return t(this,w)}run(){d(this,m,oe).call(this),this.navigate(new URL(location.href),{revalidate:!0})}defineRoute(e,s){const r=new ye(e,s);t(this,w).push(r)}navigate(e,s){return R(this,null,function*(){var O,j,x,V,D,F;const r=t(this,E).isBack,a=++J(this,_)._;let o=Q.normalizeURL(e,{base:t(this,c).base,trailingSlash:t(this,c).trailingSlash});if(t(this,c).urlModifier&&(o=t(this,c).urlModifier(o)),!(yield d(this,m,ne).call(this,o))||t(this,_)!==a||(yield(j=(O=t(this,c)).beforeNavigation)==null?void 0:j.call(O),t(this,_)!==a))return;const{activeRoutes:C,newRoutes:g,oldRoutes:f,keepRoutes:N}=d(this,m,he).call(this,o);h(this,A,(x=N[N.length-1])!=null?x:null),r||(t(this,E).push(o),((V=s==null?void 0:s.keepScrollPosition)==null||V)&&t(this,L).element.scrollTo({top:0,behavior:"instant"})),t(this,I).create(document,o.pathname),t(this,c).viewTransition&&document.startViewTransition?yield document.startViewTransition(()=>d(this,m,z).call(this,f,g,o)).finished:yield d(this,m,z).call(this,f,g,o),t(this,L).update(),t(this,k).update(),t(this,I).done(),yield(F=(D=t(this,c)).afterNavigation)==null?void 0:F.call(D)})}}c=new WeakMap,L=new WeakMap,k=new WeakMap,E=new WeakMap,I=new WeakMap,_=new WeakMap,w=new WeakMap,A=new WeakMap,m=new WeakSet,ne=function(e){return R(this,null,function*(){if(!t(this,c).preprocessor)return!0;try{return yield new Promise((s,r)=>{var a,o;(o=(a=t(this,c)).preprocessor)==null||o.call(a,{url:e,resolve:s,reject:r})}),!0}catch(s){return console.error(s!=null?s:"Route change canceled"),!1}})},he=function(e){let s=e.pathname.replace(t(this,c).base,"");s.startsWith("/")||(s=`/${s}`);const r=t(this,w).filter(a=>a.isActive);return{activeRoutes:r,newRoutes:t(this,w).filter(a=>!r.includes(a)&&a.testPathname(s)),oldRoutes:r.filter(a=>!a.testPathname(s)),keepRoutes:r.filter(a=>a.testPathname(s))}},le=function(e){e.forEach(s=>s.close())},z=function(e,s,r){return R(this,null,function*(){var a,o;d(this,m,le).call(this,e);for(const C of s){const g=(o=(a=t(this,A))==null?void 0:a.nest)!=null?o:t(this,c).rootElement;yield C.render(g,r),h(this,A,C)}})},oe=function(){t(this,w).sort((e,s)=>{const r=e.pattern.split("/").length,a=s.pattern.split("/").length;return r-a})};exports.Router=Le;
@@ -40,12 +40,12 @@ var w = (i, t, s) => new Promise((a, r) => {
40
40
  R((s = s.apply(i, t)).next());
41
41
  });
42
42
  import { History as ft } from "../history/index.js";
43
- import { L as pt } from "../LocalLinks-Z9pxKguG.js";
43
+ import { L as pt } from "../LocalLinks-DRAQ-fxE.js";
44
44
  import { P as Rt } from "../PageAnnouncerElement-0LxZjtVH.js";
45
45
  import { P as wt } from "../PageScroll-0LxFblry.js";
46
46
  import "construct-style-sheets-polyfill";
47
47
  import "../index-e9eDuagL.js";
48
- import { a as gt, n as vt } from "../url-DAl-mgbC.js";
48
+ import { a as gt, n as vt } from "../url-CYgo5vrG.js";
49
49
  import { URLPattern as Pt } from "urlpattern-polyfill";
50
50
  import { r as Lt } from "../render-1u700s93.js";
51
51
  import { i as bt } from "../object-CcMK4y_r.js";
package/lib/spa/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var X=Object.defineProperty,$=Object.defineProperties;var G=Object.getOwnPropertyDescriptors;var M=Object.getOwnPropertySymbols;var J=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable;var D=i=>{throw TypeError(i)};var z=(i,t,e)=>t in i?X(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,R=(i,t)=>{for(var e in t||(t={}))J.call(t,e)&&z(i,e,t[e]);if(M)for(var e of M(t))K.call(t,e)&&z(i,e,t[e]);return i},I=(i,t)=>$(i,G(t));var O=(i,t,e)=>t.has(i)||D("Cannot "+e);var r=(i,t,e)=>(O(i,t,"read from private field"),e?e.call(i):t.get(i)),u=(i,t,e)=>t.has(i)?D("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,e),f=(i,t,e,c)=>(O(i,t,"write to private field"),c?c.call(i,e):t.set(i,e),e);var V=(i,t,e,c)=>({set _(o){f(i,t,o,e)},get _(){return r(i,t,c)}});var j=(i,t,e)=>new Promise((c,o)=>{var s=a=>{try{l(e.next(a))}catch(w){o(w)}},m=a=>{try{l(e.throw(a))}catch(w){o(w)}},l=a=>a.done?c(a.value):Promise.resolve(a.value).then(s,m);l((e=e.apply(i,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("../cache/index.cjs"),Q=require("../history/index.cjs"),W=require("../LocalLinks-Baf0xWZ3.cjs"),Y=require("../PageAnnouncerElement-AQ0Ja6HM.cjs"),Z=require("../PageScroll-BXJUQwG7.cjs"),F=require("../events-KVanG9sR.cjs"),H=require("../morph-B6sGhLCi.cjs");require("construct-style-sheets-polyfill");require("../index-OE2INULi.cjs");const k=require("../url-CPgw9bd5.cjs");var y,P,n,d,S,g,v,q;const b=class b{constructor(t){u(this,y,new N.Cache);u(this,P,new DOMParser);u(this,n,null);u(this,d,null);u(this,S,null);u(this,g,null);u(this,v,null);u(this,q,0);b.instance||(b.instance=this,f(this,n,I(R({},t),{base:k.normalizeBase(t==null?void 0:t.base)})),f(this,v,new Y.PageAnnouncerElement),f(this,d,new Z.PageScroll(r(this,n).scrollSelector)),r(this,d).update(),f(this,S,new W.LocalLinks({base:r(this,n).base,trailingSlash:r(this,n).trailingSlash,includeAnchor:t==null?void 0:t.includeAnchor,onClick:(e,c)=>{try{this.navigate(e,c)}catch(o){window.location.assign(e)}}})),r(this,S).update(),f(this,g,new Q.History({onPop:e=>{this.navigate(e)}})))}history(){return r(this,g)}get scroll(){return r(this,d)}navigate(t,e){return j(this,null,function*(){var w,L,T,A,E,U,B,C;const c=r(this,g).isBack,o=++V(this,q)._;let s=k.normalizeURL(t,{base:r(this,n).base,trailingSlash:r(this,n).trailingSlash});r(this,n).urlModifier&&(s=r(this,n).urlModifier(s));let m=r(this,y).get(s.toString());if((!m||e!=null&&e.revalidate)&&(m=yield fetch(`${s}`,{headers:{"X-SPA":"true"}}).then(h=>h.text()).catch(()=>{window.location.assign(s)})),!m||(e!=null&&e.cache&&r(this,y).set(s.toString(),m),r(this,q)!==o))return;c||(r(this,g).push(s),((w=e==null?void 0:e.keepScrollPosition)==null||w)&&r(this,d).element.scrollTo({top:0,behavior:"instant"}));const l=r(this,P).parseFromString(m,"text/html");if(k.normalizeRelativeURLs(l,s),yield(T=(L=r(this,n)).beforeDiff)==null?void 0:T.call(L,l),r(this,q)!==o)return;F.dispatchEvent(document,"spaBeforeUpdate",{custom:!0});let a=(A=l.querySelector("title"))==null?void 0:A.textContent;if(a)document.title=a;else{const h=document.querySelector("h1");a=(U=(E=h==null?void 0:h.innerText)!=null?E:h==null?void 0:h.textContent)!=null?U:s.pathname}r(this,v).create(l,a),r(this,n).viewTransition&&document.startViewTransition?yield document.startViewTransition(()=>H.morph(document,l)).finished:yield H.morph(document,l),r(this,d).update(),r(this,S).update(),r(this,v).done(),yield(C=(B=r(this,n)).afterDiff)==null?void 0:C.call(B),F.dispatchEvent(document,"spaAfterUpdate",{custom:!0})})}};y=new WeakMap,P=new WeakMap,n=new WeakMap,d=new WeakMap,S=new WeakMap,g=new WeakMap,v=new WeakMap,q=new WeakMap,b.instance=null;let x=b;exports.SPA=x;
1
+ "use strict";var X=Object.defineProperty,$=Object.defineProperties;var G=Object.getOwnPropertyDescriptors;var M=Object.getOwnPropertySymbols;var J=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable;var D=i=>{throw TypeError(i)};var z=(i,t,e)=>t in i?X(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,R=(i,t)=>{for(var e in t||(t={}))J.call(t,e)&&z(i,e,t[e]);if(M)for(var e of M(t))K.call(t,e)&&z(i,e,t[e]);return i},I=(i,t)=>$(i,G(t));var O=(i,t,e)=>t.has(i)||D("Cannot "+e);var r=(i,t,e)=>(O(i,t,"read from private field"),e?e.call(i):t.get(i)),u=(i,t,e)=>t.has(i)?D("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,e),f=(i,t,e,c)=>(O(i,t,"write to private field"),c?c.call(i,e):t.set(i,e),e);var V=(i,t,e,c)=>({set _(o){f(i,t,o,e)},get _(){return r(i,t,c)}});var j=(i,t,e)=>new Promise((c,o)=>{var s=a=>{try{l(e.next(a))}catch(w){o(w)}},m=a=>{try{l(e.throw(a))}catch(w){o(w)}},l=a=>a.done?c(a.value):Promise.resolve(a.value).then(s,m);l((e=e.apply(i,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("../cache/index.cjs"),Q=require("../history/index.cjs"),W=require("../LocalLinks-BxhSFv_Q.cjs"),Y=require("../PageAnnouncerElement-AQ0Ja6HM.cjs"),Z=require("../PageScroll-BXJUQwG7.cjs"),F=require("../events-KVanG9sR.cjs"),H=require("../morph-B6sGhLCi.cjs");require("construct-style-sheets-polyfill");require("../index-OE2INULi.cjs");const k=require("../url-CHgcNwJ1.cjs");var y,P,n,d,S,g,v,q;const b=class b{constructor(t){u(this,y,new N.Cache);u(this,P,new DOMParser);u(this,n,null);u(this,d,null);u(this,S,null);u(this,g,null);u(this,v,null);u(this,q,0);b.instance||(b.instance=this,f(this,n,I(R({},t),{base:k.normalizeBase(t==null?void 0:t.base)})),f(this,v,new Y.PageAnnouncerElement),f(this,d,new Z.PageScroll(r(this,n).scrollSelector)),r(this,d).update(),f(this,S,new W.LocalLinks({base:r(this,n).base,trailingSlash:r(this,n).trailingSlash,includeAnchor:t==null?void 0:t.includeAnchor,onClick:(e,c)=>{try{this.navigate(e,c)}catch(o){window.location.assign(e)}}})),r(this,S).update(),f(this,g,new Q.History({onPop:e=>{this.navigate(e)}})))}history(){return r(this,g)}get scroll(){return r(this,d)}navigate(t,e){return j(this,null,function*(){var w,L,T,A,E,U,B,C;const c=r(this,g).isBack,o=++V(this,q)._;let s=k.normalizeURL(t,{base:r(this,n).base,trailingSlash:r(this,n).trailingSlash});r(this,n).urlModifier&&(s=r(this,n).urlModifier(s));let m=r(this,y).get(s.toString());if((!m||e!=null&&e.revalidate)&&(m=yield fetch(`${s}`,{headers:{"X-SPA":"true"}}).then(h=>h.text()).catch(()=>{window.location.assign(s)})),!m||(e!=null&&e.cache&&r(this,y).set(s.toString(),m),r(this,q)!==o))return;c||(r(this,g).push(s),((w=e==null?void 0:e.keepScrollPosition)==null||w)&&r(this,d).element.scrollTo({top:0,behavior:"instant"}));const l=r(this,P).parseFromString(m,"text/html");if(k.normalizeRelativeURLs(l,s),yield(T=(L=r(this,n)).beforeDiff)==null?void 0:T.call(L,l),r(this,q)!==o)return;F.dispatchEvent(document,"spaBeforeUpdate",{custom:!0});let a=(A=l.querySelector("title"))==null?void 0:A.textContent;if(a)document.title=a;else{const h=document.querySelector("h1");a=(U=(E=h==null?void 0:h.innerText)!=null?E:h==null?void 0:h.textContent)!=null?U:s.pathname}r(this,v).create(l,a),r(this,n).viewTransition&&document.startViewTransition?yield document.startViewTransition(()=>H.morph(document,l)).finished:yield H.morph(document,l),r(this,d).update(),r(this,S).update(),r(this,v).done(),yield(C=(B=r(this,n)).afterDiff)==null?void 0:C.call(B),F.dispatchEvent(document,"spaAfterUpdate",{custom:!0})})}};y=new WeakMap,P=new WeakMap,n=new WeakMap,d=new WeakMap,S=new WeakMap,g=new WeakMap,v=new WeakMap,q=new WeakMap,b.instance=null;let x=b;exports.SPA=x;
package/lib/spa/index.js CHANGED
@@ -41,14 +41,14 @@ var I = (i, e, t) => new Promise((l, m) => {
41
41
  });
42
42
  import { Cache as J } from "../cache/index.js";
43
43
  import { History as K } from "../history/index.js";
44
- import { L as N } from "../LocalLinks-Z9pxKguG.js";
44
+ import { L as N } from "../LocalLinks-DRAQ-fxE.js";
45
45
  import { P as Q } from "../PageAnnouncerElement-0LxZjtVH.js";
46
46
  import { P as W } from "../PageScroll-0LxFblry.js";
47
47
  import { d as V } from "../events-CsVF98U6.js";
48
48
  import { m as F } from "../morph-D_ybmXWR.js";
49
49
  import "construct-style-sheets-polyfill";
50
50
  import "../index-e9eDuagL.js";
51
- import { a as Y, n as Z, b as _ } from "../url-DAl-mgbC.js";
51
+ import { a as Y, n as Z, b as _ } from "../url-CYgo5vrG.js";
52
52
  var P, k, r, o, S, w, v, b;
53
53
  const y = class y {
54
54
  constructor(e) {
@@ -0,0 +1 @@
1
+ "use strict";var U=Object.defineProperty,y=Object.defineProperties;var w=Object.getOwnPropertyDescriptors;var p=Object.getOwnPropertySymbols;var $=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable;var m=(t,e,r)=>e in t?U(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,S=(t,e)=>{for(var r in e||(e={}))$.call(e,r)&&m(t,r,e[r]);if(p)for(var r of p(e))W.call(e,r)&&m(t,r,e[r]);return t},g=(t,e)=>y(t,w(e));function j(t,{base:e="",trailingSlash:r=!1,mergeParams:n,removeParams:s}={}){e=e.endsWith("/")?e.slice(0,-1):e,t=t.replace(e,""),t.startsWith("/")&&(t=t.slice(1));const i=t.split("#"),l=i[0].split("?");let a=l[0].startsWith("/")?l[0]:"/"+l[0];r?a=!a.endsWith("/")&&a!=="/"?a+"/":a:a=a.endsWith("/")&&a!=="/"?a.slice(0,-1):a;let c=l[1]||"";if(n){const o=new URLSearchParams(c),P=new URLSearchParams(n);for(const[h,R]of P)o.has(h)||o.set(h,R);s==null||s.split(",").forEach(h=>{o.has(h)&&o.delete(h)}),c=o.toString()}const u=e+a,f=i[1],L=`${u}${c?"?"+c:""}${f?"#"+f:""}`;return{leaf:a,pathname:u,parameters:c,hash:f,path:L}}function z(t="/"){return t.endsWith("/")||(t+="/"),t.startsWith("/")||(t+="/"),t}function O(t){if(t.action==="none")return;const e=t==null?void 0:t.searchParameters,r=t.hash?t.hash.startsWith("#")?t.hash:"#"+t.hash:"",n=e?e.startsWith("?")?e:"?"+e:"",s=`${t.pathname}${n}${r}`,i=g(S({},t.state),{path:s});t.action==="push"?history.pushState(i,"",s):t.action==="replace"&&history.replaceState(i,"",s)}function A(t){const e=new URLSearchParams(t),r={};for(const[n,s]of e)r[n]=s;return r}function k(t,e){const r=new URL(location.href),n=(e==null?void 0:e.toString())||"";r.searchParams.set(t,n),history.replaceState(history.state,"",r.href)}function d(t,e,r){t.setAttribute(e,new URL(t.getAttribute(e),r).pathname)}function T(t,e){t.querySelectorAll('[href^="./"], [href^="../"]').forEach(r=>d(r,"href",e)),t.querySelectorAll('[src^="./"], [src^="../"]').forEach(r=>d(r,"src",e))}function E(t,{base:e="",trailingSlash:r=!1}={}){e=e.replace(/^\/|\/$/g,"");const n=typeof t=="string"?t.replace(/^\/|\/$/g,""):t.pathname.replace(/^\/|\/$/g,"");let s="";return n.includes(e)?s=`/${n}`:s=`${e}/${n}`,r&&!s.endsWith("/")&&(s+="/"),new URL(s,location.origin)}function q(t){try{const e=new URL(t);if(window.location.origin===e.origin)return e.pathname===window.location.pathname?!e.hash:!0}catch(e){}return!1}function B(t){if(!t)return"";const e=new URLSearchParams;for(const[r,n]of Object.entries(t))n!=null&&n!==!1&&n!==""&&e.append(r,String(n));return e.toString()}function H(t){const e={};for(const[r,n]of t.entries())n!=null&&(e[r]=n);return e}exports.changeHistory=O;exports.isLocalUrl=q;exports.normalizeBase=z;exports.normalizeRelativeURLs=T;exports.normalizeURL=E;exports.parseSearchParameters=A;exports.searchParamsObjectToString=B;exports.searchParamsToObject=H;exports.splitPath=j;exports.updateSearchParameter=k;
@@ -0,0 +1,113 @@
1
+ var R = Object.defineProperty, U = Object.defineProperties;
2
+ var $ = Object.getOwnPropertyDescriptors;
3
+ var p = Object.getOwnPropertySymbols;
4
+ var P = Object.prototype.hasOwnProperty, W = Object.prototype.propertyIsEnumerable;
5
+ var S = (t, e, n) => e in t ? R(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, g = (t, e) => {
6
+ for (var n in e || (e = {}))
7
+ P.call(e, n) && S(t, n, e[n]);
8
+ if (p)
9
+ for (var n of p(e))
10
+ W.call(e, n) && S(t, n, e[n]);
11
+ return t;
12
+ }, d = (t, e) => U(t, $(e));
13
+ function k(t, {
14
+ base: e = "",
15
+ trailingSlash: n = !1,
16
+ mergeParams: s,
17
+ removeParams: r
18
+ } = {}) {
19
+ e = e.endsWith("/") ? e.slice(0, -1) : e, t = t.replace(e, ""), t.startsWith("/") && (t = t.slice(1));
20
+ const i = t.split("#"), f = i[0].split("?");
21
+ let a = f[0].startsWith("/") ? f[0] : "/" + f[0];
22
+ n ? a = !a.endsWith("/") && a !== "/" ? a + "/" : a : a = a.endsWith("/") && a !== "/" ? a.slice(0, -1) : a;
23
+ let o = f[1] || "";
24
+ if (s) {
25
+ const c = new URLSearchParams(o), w = new URLSearchParams(s);
26
+ for (const [h, L] of w)
27
+ c.has(h) || c.set(h, L);
28
+ r == null || r.split(",").forEach((h) => {
29
+ c.has(h) && c.delete(h);
30
+ }), o = c.toString();
31
+ }
32
+ const u = e + a, l = i[1], y = `${u}${o ? "?" + o : ""}${l ? "#" + l : ""}`;
33
+ return {
34
+ leaf: a,
35
+ pathname: u,
36
+ parameters: o,
37
+ hash: l,
38
+ path: y
39
+ };
40
+ }
41
+ function O(t = "/") {
42
+ return t.endsWith("/") || (t += "/"), t.startsWith("/") || (t += "/"), t;
43
+ }
44
+ function z(t) {
45
+ if (t.action === "none")
46
+ return;
47
+ const e = t == null ? void 0 : t.searchParameters, n = t.hash ? t.hash.startsWith("#") ? t.hash : "#" + t.hash : "", s = e ? e.startsWith("?") ? e : "?" + e : "", r = `${t.pathname}${s}${n}`, i = d(g({}, t.state), { path: r });
48
+ t.action === "push" ? history.pushState(i, "", r) : t.action === "replace" && history.replaceState(i, "", r);
49
+ }
50
+ function E(t) {
51
+ const e = new URLSearchParams(t), n = {};
52
+ for (const [s, r] of e)
53
+ n[s] = r;
54
+ return n;
55
+ }
56
+ function q(t, e) {
57
+ const n = new URL(location.href), s = (e == null ? void 0 : e.toString()) || "";
58
+ n.searchParams.set(t, s), history.replaceState(history.state, "", n.href);
59
+ }
60
+ function m(t, e, n) {
61
+ t.setAttribute(e, new URL(t.getAttribute(e), n).pathname);
62
+ }
63
+ function x(t, e) {
64
+ t.querySelectorAll('[href^="./"], [href^="../"]').forEach(
65
+ (n) => m(n, "href", e)
66
+ ), t.querySelectorAll('[src^="./"], [src^="../"]').forEach(
67
+ (n) => m(n, "src", e)
68
+ );
69
+ }
70
+ function T(t, {
71
+ base: e = "",
72
+ trailingSlash: n = !1
73
+ } = {}) {
74
+ e = e.replace(/^\/|\/$/g, "");
75
+ const s = typeof t == "string" ? t.replace(/^\/|\/$/g, "") : t.pathname.replace(/^\/|\/$/g, "");
76
+ let r = "";
77
+ return s.includes(e) ? r = `/${s}` : r = `${e}/${s}`, n && !r.endsWith("/") && (r += "/"), new URL(r, location.origin);
78
+ }
79
+ function B(t) {
80
+ try {
81
+ const e = new URL(t);
82
+ if (window.location.origin === e.origin)
83
+ return e.pathname === window.location.pathname ? !e.hash : !0;
84
+ } catch (e) {
85
+ }
86
+ return !1;
87
+ }
88
+ function H(t) {
89
+ if (!t)
90
+ return "";
91
+ const e = new URLSearchParams();
92
+ for (const [n, s] of Object.entries(t))
93
+ s != null && s !== !1 && s !== "" && e.append(n, String(s));
94
+ return e.toString();
95
+ }
96
+ function C(t) {
97
+ const e = {};
98
+ for (const [n, s] of t.entries())
99
+ s != null && (e[n] = s);
100
+ return e;
101
+ }
102
+ export {
103
+ O as a,
104
+ x as b,
105
+ z as c,
106
+ k as d,
107
+ C as e,
108
+ B as i,
109
+ T as n,
110
+ E as p,
111
+ H as s,
112
+ q as u
113
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("../attributes-Bf2svn4j.cjs"),y=require("../index-OE2INULi.cjs"),C=require("../canvas-CU5Xjahf.cjs"),b=require("../coordinates-D8Np3cPD.cjs"),v=require("../custom-elements-Dh4TWRDJ.cjs"),u=require("../dom-CBLlqORw.cjs"),s=require("../easings-GegIwET5.cjs"),D=require("../element-yhcBhsho.cjs"),q=require("../events-KVanG9sR.cjs"),N=require("../file-DSpfWdd9.cjs"),P=require("../function-MthRj-GJ.cjs"),w=require("../gestures-C7gbKx11.cjs"),A=require("../stylesheet-5_o7PFzM.cjs"),O=require("../layout-Ctc2p3uz.cjs"),l=require("../math-GDWEqu7y.cjs"),M=require("../metadata-BcYZ5w3T.cjs"),a=require("../morph-B6sGhLCi.cjs"),p=require("../number-ChAm68cm.cjs"),d=require("../object-baN9pgbU.cjs"),S=require("../polyfills-Df4r-ETT.cjs"),x=require("../scroll-BA2WnUrb.cjs"),c=require("../string-DUXXtU8v.cjs"),R=require("../style-At6aDoqG.cjs"),m=require("../url-CPgw9bd5.cjs");function Q(t,e,...n){return[...t.slice(0,e),...n,...t.slice(e)]}function B(t,e){const n=t.length;e=e%n;const o=new Array(n);for(let r=0;r<n;r++){const i=(r+e)%n;o[i]=t[r]}return o}function U(t,e=2){if(!+t)return"0 Bytes";const n=1024,o=e<0?0:e,r=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],i=Math.floor(Math.log(t)/Math.log(n));return`${parseFloat((t/Math.pow(n,i)).toFixed(o))} ${r[i]}`}function z(t){if(navigator.clipboard)navigator.clipboard.writeText(t).then(()=>{console.log("Text copied to clipboard successfully!")}).catch(e=>{console.error("Failed to copy text to clipboard:",e)});else{const e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.top="0",e.style.left="0",document.body.appendChild(e),e.select();try{document.execCommand("copy")?console.log("Text copied to clipboard successfully!"):console.error("Failed to copy text to clipboard.")}catch(n){console.error("Failed to copy text to clipboard:",n)}document.body.removeChild(e)}}function V(t,e){return t.x<e.x+e.width&&t.x>e.x&&t.y<e.y+e.height&&t.y>e.y}function L(t,e){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)<e.radius}function j(t,e){let n=!1;const{x:o,y:r}=t;for(let i=0,E=e.length-1;i<e.length;E=i++){const T=e[i].x,f=e[i].y,h=e[E].x,g=e[E].y;f>r!=g>r&&o<(h-T)*(r-f)/(g-f)+T&&(n=!n)}return n}function _(t,e){const n=t.style.getPropertyValue(e);if(n){const o=n.toString();return o.startsWith("var")?_(t,o.slice(4,-1)):o}}function Y(...t){const e={};return Array.from(document.styleSheets).forEach(n=>{Array.from(n.cssRules).forEach(o=>{o instanceof CSSStyleRule&&o.selectorText===":root"&&t.forEach(r=>{const i=_(o,r);i&&(e[r]=i)})})}),t.forEach(n=>{e[n]||console.warn(`variable named ${n} not found`)}),e}function k(t){const e=window.atob(t);return decodeURIComponent(window.escape(e))}function F(t){const e=window.unescape(encodeURIComponent(t));return window.btoa(e)}const $=/^(\+?\d{1,3}[-.\s]?)?(\(?\d{3}\)?[-.\s]?)?\d{1,4}[-.\s]?\d{2,4}[-.\s]?\d{2,4}$/,H=/^[\w.-]+@[a-zA-Z\d.-]+\.[a-zA-Z]{2,}$/;function K(t){let e,n;return H.test(t)?(e=`mailto:${t.trim()}`,n="email"):$.test(t)&&(e=`tel:${t.replace(/[^0-9\\.\\+]+/g,"")}`,n="phone"),{href:e,type:n,contact:t}}function W(t,e){if(t){const o=t.content.cloneNode(!0).firstElementChild;return o&&(e==null||e(o)),o}return null}function Z(t,e,n,o){let r,i=!1,E=0;const T=()=>{clearInterval(r),o!=null&&o.restartCounter&&(E=0),i&&(r=setInterval(()=>{n(E++)},e))},f=y.intersector.subscribe(t,h=>{i=h.isIntersecting,T()});return()=>{f(),clearInterval(r)}}exports.parseAttribute=I.parseAttribute;exports.parseAttributeValue=I.parseAttributeValue;exports.isBrowser=y.isBrowser;exports.contain=C.contain;exports.cover=C.cover;exports.fixPosition=C.fixPosition;exports.measureText=C.measureText;exports.getPointerPosition=b.getPointerPosition;exports.normalize=b.normalize;exports.screenToCartesian=b.screenToCartesian;exports.whenDefined=v.whenDefined;exports.createScriptElement=u.createScriptElement;exports.excludeElements=u.excludeElements;exports.findParentElement=u.findParentElement;exports.findScrollParentElement=u.findScrollParentElement;exports.getAllParentElements=u.getAllParentElements;exports.getElement=u.getElement;exports.intersectElements=u.intersectElements;exports.traverseNodes=u.traverseNodes;exports.traverseShadowRoots=u.traverseShadowRoots;exports.easeInCubic=s.easeInCubic;exports.easeInExpo=s.easeInExpo;exports.easeInOutCubic=s.easeInOutCubic;exports.easeInOutExpo=s.easeInOutExpo;exports.easeInOutQuad=s.easeInOutQuad;exports.easeInOutQuart=s.easeInOutQuart;exports.easeInOutQuint=s.easeInOutQuint;exports.easeInQuad=s.easeInQuad;exports.easeInQuart=s.easeInQuart;exports.easeInQuint=s.easeInQuint;exports.easeOutCubic=s.easeOutCubic;exports.easeOutExpo=s.easeOutExpo;exports.easeOutQuad=s.easeOutQuad;exports.easeOutQuart=s.easeOutQuart;exports.easeOutQuint=s.easeOutQuint;exports.linear=s.linear;exports.isElementVisible=D.isElementVisible;exports.dispatchEvent=q.dispatchEvent;exports.createJSONAndSave=N.createJSONAndSave;exports.downloadURI=N.downloadURI;exports.debounce=P.debounce;exports.throttle=P.throttle;exports.setupDrag=w.setupDrag;exports.createStylesheet=A.createStylesheet;exports.styleToString=A.styleToString;exports.getCumulativeOffsetLeft=O.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=O.getCumulativeOffsetTop;exports.getCumulativePosition=O.getCumulativePosition;exports.getStickyOffset=O.getStickyOffset;exports.calculateDistance=l.calculateDistance;exports.calculateDistanceWithRadius=l.calculateDistanceWithRadius;exports.clamp=l.clamp;exports.damp=l.damp;exports.lerp=l.lerp;exports.mapRange=l.mapRange;exports.round=l.round;exports.smootherstep=l.smootherstep;exports.smoothstep=l.smoothstep;exports.step=l.step;exports.formatMediaDuration=M.formatMediaDuration;exports.ACTION_CREATE=a.ACTION_CREATE;exports.ACTION_PRESERVE=a.ACTION_PRESERVE;exports.ACTION_REMOVE=a.ACTION_REMOVE;exports.ACTION_REMOVE_ATTR=a.ACTION_REMOVE_ATTR;exports.ACTION_REPLACE=a.ACTION_REPLACE;exports.ACTION_SET_ATTR=a.ACTION_SET_ATTR;exports.ACTION_SKIP=a.ACTION_SKIP;exports.ACTION_UPDATE=a.ACTION_UPDATE;exports.NODE_TYPE_COMMENT=a.NODE_TYPE_COMMENT;exports.NODE_TYPE_DOCUMENT=a.NODE_TYPE_DOCUMENT;exports.NODE_TYPE_ELEMENT=a.NODE_TYPE_ELEMENT;exports.NODE_TYPE_TEXT=a.NODE_TYPE_TEXT;exports.diff=a.diff;exports.morph=a.morph;exports.patch=a.patch;exports.beautifyNumber=p.beautifyNumber;exports.loopNumber=p.loopNumber;exports.preciseNumber=p.preciseNumber;exports.roundNumberTo=p.roundNumberTo;exports.toStep=p.toStep;exports.cloneDeep=d.cloneDeep;exports.compareObjects=d.compareObjects;exports.isESClass=d.isESClass;exports.isNullish=d.isNullish;exports.isObject=d.isObject;exports.mergeDeep=d.mergeDeep;exports.mixin=d.mixin;exports.omit=d.omit;exports.pick=d.pick;exports.nullishCoalescing=S.nullishCoalescing;exports.requestIdleCallback=S.requestIdleCallback;exports.scrollToElement=x.scrollToElement;exports.wait=x.wait;exports.camelToKebab=c.camelToKebab;exports.capitalize=c.capitalize;exports.declension=c.declension;exports.decodeHtmlEntities=c.decodeHtmlEntities;exports.generateId=c.generateId;exports.isUppercase=c.isUppercase;exports.kebabToCamel=c.kebabToCamel;exports.snakeToDotted=c.snakeToDotted;exports.toPascalCase=c.toPascalCase;exports.uncapitalize=c.uncapitalize;exports.getElementTransitionDurationMS=R.getElementTransitionDurationMS;exports.getElementTransitionDurationS=R.getElementTransitionDurationS;exports.changeHistory=m.changeHistory;exports.isLocalUrl=m.isLocalUrl;exports.normalizeBase=m.normalizeBase;exports.normalizeRelativeURLs=m.normalizeRelativeURLs;exports.normalizeURL=m.normalizeURL;exports.parseSearchParameters=m.parseSearchParameters;exports.splitPath=m.splitPath;exports.updateSearchParameter=m.updateSearchParameter;exports.cloneTemplateContent=W;exports.copyTextToClipboard=z;exports.decode=F;exports.dotCircleCollision=L;exports.dotPolygonCollision=j;exports.dotRectCollision=V;exports.encode=k;exports.formatBytes=U;exports.getRootVariables=Y;exports.insert=Q;exports.setIntervalOnIntersection=Z;exports.shiftArray=B;exports.tryCreateHrefFromContact=K;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("../attributes-Bf2svn4j.cjs"),y=require("../index-OE2INULi.cjs"),C=require("../canvas-CU5Xjahf.cjs"),b=require("../coordinates-D8Np3cPD.cjs"),v=require("../custom-elements-Dh4TWRDJ.cjs"),d=require("../dom-CBLlqORw.cjs"),s=require("../easings-GegIwET5.cjs"),D=require("../element-yhcBhsho.cjs"),q=require("../events-KVanG9sR.cjs"),P=require("../file-DSpfWdd9.cjs"),N=require("../function-MthRj-GJ.cjs"),w=require("../gestures-C7gbKx11.cjs"),S=require("../stylesheet-5_o7PFzM.cjs"),O=require("../layout-Ctc2p3uz.cjs"),l=require("../math-GDWEqu7y.cjs"),M=require("../metadata-BcYZ5w3T.cjs"),a=require("../morph-B6sGhLCi.cjs"),p=require("../number-ChAm68cm.cjs"),m=require("../object-baN9pgbU.cjs"),A=require("../polyfills-Df4r-ETT.cjs"),x=require("../scroll-BA2WnUrb.cjs"),c=require("../string-DUXXtU8v.cjs"),R=require("../style-At6aDoqG.cjs"),u=require("../url-CHgcNwJ1.cjs");function Q(t,e,...n){return[...t.slice(0,e),...n,...t.slice(e)]}function B(t,e){const n=t.length;e=e%n;const r=new Array(n);for(let o=0;o<n;o++){const i=(o+e)%n;r[i]=t[o]}return r}function U(t,e=2){if(!+t)return"0 Bytes";const n=1024,r=e<0?0:e,o=["Bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],i=Math.floor(Math.log(t)/Math.log(n));return`${parseFloat((t/Math.pow(n,i)).toFixed(r))} ${o[i]}`}function z(t){if(navigator.clipboard)navigator.clipboard.writeText(t).then(()=>{console.log("Text copied to clipboard successfully!")}).catch(e=>{console.error("Failed to copy text to clipboard:",e)});else{const e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.top="0",e.style.left="0",document.body.appendChild(e),e.select();try{document.execCommand("copy")?console.log("Text copied to clipboard successfully!"):console.error("Failed to copy text to clipboard.")}catch(n){console.error("Failed to copy text to clipboard:",n)}document.body.removeChild(e)}}function V(t,e){return t.x<e.x+e.width&&t.x>e.x&&t.y<e.y+e.height&&t.y>e.y}function j(t,e){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)<e.radius}function L(t,e){let n=!1;const{x:r,y:o}=t;for(let i=0,E=e.length-1;i<e.length;E=i++){const T=e[i].x,f=e[i].y,h=e[E].x,g=e[E].y;f>o!=g>o&&r<(h-T)*(o-f)/(g-f)+T&&(n=!n)}return n}function _(t,e){const n=t.style.getPropertyValue(e);if(n){const r=n.toString();return r.startsWith("var")?_(t,r.slice(4,-1)):r}}function Y(...t){const e={};return Array.from(document.styleSheets).forEach(n=>{Array.from(n.cssRules).forEach(r=>{r instanceof CSSStyleRule&&r.selectorText===":root"&&t.forEach(o=>{const i=_(r,o);i&&(e[o]=i)})})}),t.forEach(n=>{e[n]||console.warn(`variable named ${n} not found`)}),e}function k(t){const e=window.atob(t);return decodeURIComponent(window.escape(e))}function F(t){const e=window.unescape(encodeURIComponent(t));return window.btoa(e)}const $=/^(\+?\d{1,3}[-.\s]?)?(\(?\d{3}\)?[-.\s]?)?\d{1,4}[-.\s]?\d{2,4}[-.\s]?\d{2,4}$/,H=/^[\w.-]+@[a-zA-Z\d.-]+\.[a-zA-Z]{2,}$/;function K(t){let e,n;return H.test(t)?(e=`mailto:${t.trim()}`,n="email"):$.test(t)&&(e=`tel:${t.replace(/[^0-9\\.\\+]+/g,"")}`,n="phone"),{href:e,type:n,contact:t}}function W(t,e){if(t){const r=t.content.cloneNode(!0).firstElementChild;return r&&(e==null||e(r)),r}return null}function Z(t,e,n,r){let o,i=!1,E=0;const T=()=>{clearInterval(o),r!=null&&r.restartCounter&&(E=0),i&&(o=setInterval(()=>{n(E++)},e))},f=y.intersector.subscribe(t,h=>{i=h.isIntersecting,T()});return()=>{f(),clearInterval(o)}}exports.parseAttribute=I.parseAttribute;exports.parseAttributeValue=I.parseAttributeValue;exports.isBrowser=y.isBrowser;exports.contain=C.contain;exports.cover=C.cover;exports.fixPosition=C.fixPosition;exports.measureText=C.measureText;exports.getPointerPosition=b.getPointerPosition;exports.normalize=b.normalize;exports.screenToCartesian=b.screenToCartesian;exports.whenDefined=v.whenDefined;exports.createScriptElement=d.createScriptElement;exports.excludeElements=d.excludeElements;exports.findParentElement=d.findParentElement;exports.findScrollParentElement=d.findScrollParentElement;exports.getAllParentElements=d.getAllParentElements;exports.getElement=d.getElement;exports.intersectElements=d.intersectElements;exports.traverseNodes=d.traverseNodes;exports.traverseShadowRoots=d.traverseShadowRoots;exports.easeInCubic=s.easeInCubic;exports.easeInExpo=s.easeInExpo;exports.easeInOutCubic=s.easeInOutCubic;exports.easeInOutExpo=s.easeInOutExpo;exports.easeInOutQuad=s.easeInOutQuad;exports.easeInOutQuart=s.easeInOutQuart;exports.easeInOutQuint=s.easeInOutQuint;exports.easeInQuad=s.easeInQuad;exports.easeInQuart=s.easeInQuart;exports.easeInQuint=s.easeInQuint;exports.easeOutCubic=s.easeOutCubic;exports.easeOutExpo=s.easeOutExpo;exports.easeOutQuad=s.easeOutQuad;exports.easeOutQuart=s.easeOutQuart;exports.easeOutQuint=s.easeOutQuint;exports.linear=s.linear;exports.isElementVisible=D.isElementVisible;exports.dispatchEvent=q.dispatchEvent;exports.createJSONAndSave=P.createJSONAndSave;exports.downloadURI=P.downloadURI;exports.debounce=N.debounce;exports.throttle=N.throttle;exports.setupDrag=w.setupDrag;exports.createStylesheet=S.createStylesheet;exports.styleToString=S.styleToString;exports.getCumulativeOffsetLeft=O.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=O.getCumulativeOffsetTop;exports.getCumulativePosition=O.getCumulativePosition;exports.getStickyOffset=O.getStickyOffset;exports.calculateDistance=l.calculateDistance;exports.calculateDistanceWithRadius=l.calculateDistanceWithRadius;exports.clamp=l.clamp;exports.damp=l.damp;exports.lerp=l.lerp;exports.mapRange=l.mapRange;exports.round=l.round;exports.smootherstep=l.smootherstep;exports.smoothstep=l.smoothstep;exports.step=l.step;exports.formatMediaDuration=M.formatMediaDuration;exports.ACTION_CREATE=a.ACTION_CREATE;exports.ACTION_PRESERVE=a.ACTION_PRESERVE;exports.ACTION_REMOVE=a.ACTION_REMOVE;exports.ACTION_REMOVE_ATTR=a.ACTION_REMOVE_ATTR;exports.ACTION_REPLACE=a.ACTION_REPLACE;exports.ACTION_SET_ATTR=a.ACTION_SET_ATTR;exports.ACTION_SKIP=a.ACTION_SKIP;exports.ACTION_UPDATE=a.ACTION_UPDATE;exports.NODE_TYPE_COMMENT=a.NODE_TYPE_COMMENT;exports.NODE_TYPE_DOCUMENT=a.NODE_TYPE_DOCUMENT;exports.NODE_TYPE_ELEMENT=a.NODE_TYPE_ELEMENT;exports.NODE_TYPE_TEXT=a.NODE_TYPE_TEXT;exports.diff=a.diff;exports.morph=a.morph;exports.patch=a.patch;exports.beautifyNumber=p.beautifyNumber;exports.loopNumber=p.loopNumber;exports.preciseNumber=p.preciseNumber;exports.roundNumberTo=p.roundNumberTo;exports.toStep=p.toStep;exports.cloneDeep=m.cloneDeep;exports.compareObjects=m.compareObjects;exports.isESClass=m.isESClass;exports.isNullish=m.isNullish;exports.isObject=m.isObject;exports.mergeDeep=m.mergeDeep;exports.mixin=m.mixin;exports.omit=m.omit;exports.pick=m.pick;exports.nullishCoalescing=A.nullishCoalescing;exports.requestIdleCallback=A.requestIdleCallback;exports.scrollToElement=x.scrollToElement;exports.wait=x.wait;exports.camelToKebab=c.camelToKebab;exports.capitalize=c.capitalize;exports.declension=c.declension;exports.decodeHtmlEntities=c.decodeHtmlEntities;exports.generateId=c.generateId;exports.isUppercase=c.isUppercase;exports.kebabToCamel=c.kebabToCamel;exports.snakeToDotted=c.snakeToDotted;exports.toPascalCase=c.toPascalCase;exports.uncapitalize=c.uncapitalize;exports.getElementTransitionDurationMS=R.getElementTransitionDurationMS;exports.getElementTransitionDurationS=R.getElementTransitionDurationS;exports.changeHistory=u.changeHistory;exports.isLocalUrl=u.isLocalUrl;exports.normalizeBase=u.normalizeBase;exports.normalizeRelativeURLs=u.normalizeRelativeURLs;exports.normalizeURL=u.normalizeURL;exports.parseSearchParameters=u.parseSearchParameters;exports.searchParamsObjectToString=u.searchParamsObjectToString;exports.searchParamsToObject=u.searchParamsToObject;exports.splitPath=u.splitPath;exports.updateSearchParameter=u.updateSearchParameter;exports.cloneTemplateContent=W;exports.copyTextToClipboard=z;exports.decode=F;exports.dotCircleCollision=j;exports.dotPolygonCollision=L;exports.dotRectCollision=V;exports.encode=k;exports.formatBytes=U;exports.getRootVariables=Y;exports.insert=Q;exports.setIntervalOnIntersection=Z;exports.shiftArray=B;exports.tryCreateHrefFromContact=K;
@@ -1,28 +1,28 @@
1
1
  import { a as _, p as D } from "../attributes-69we3byR.js";
2
2
  import { a as d } from "../index-e9eDuagL.js";
3
3
  import { i as B } from "../index-e9eDuagL.js";
4
- import { a as Q, c as U, f as V, m as j } from "../canvas-DeZ0SLUJ.js";
4
+ import { a as z, c as Q, f as U, m as V } from "../canvas-DeZ0SLUJ.js";
5
5
  import { g as F, n as L, s as k } from "../coordinates-CgdGoSYs.js";
6
6
  import { w as q } from "../custom-elements-DBnCK7Zx.js";
7
7
  import { c as K, e as Z, b as W, f as G, a as J, g as X, i as ee, t as te, d as se } from "../dom-BETkVSSZ.js";
8
8
  import { d as oe, o as re, g as ne, q as ie, c as ce, j as le, n as ue, a as fe, h as de, k as me, f as pe, p as xe, b as Ee, i as he, m as Te, l as be } from "../easings-BEmRlrDd.js";
9
9
  import { i as Ce } from "../element-CGVl1jA-.js";
10
- import { d as Ie } from "../events-CsVF98U6.js";
11
- import { c as Ae, d as Ne } from "../file-GHShUlue.js";
12
- import { d as ve, t as Pe } from "../function-C10DGppn.js";
10
+ import { d as Oe } from "../events-CsVF98U6.js";
11
+ import { c as Ae, d as Pe } from "../file-GHShUlue.js";
12
+ import { d as Ne, t as ve } from "../function-C10DGppn.js";
13
13
  import { s as we } from "../gestures-CcXV6fCp.js";
14
14
  import { c as De, s as Me } from "../stylesheet-DdBzowZY.js";
15
- import { g as ze, a as Qe, c as Ue, b as Ve } from "../layout-BSMtwCga.js";
15
+ import { g as je, a as ze, c as Qe, b as Ue } from "../layout-BSMtwCga.js";
16
16
  import { e as $e, f as Fe, c as Le, d as ke, l as Ye, m as qe, r as He, b as Ke, a as Ze, s as We } from "../math-BOBiC4TN.js";
17
17
  import { f as Je } from "../metadata-jfowcCyz.js";
18
18
  import { A as et, k as tt, e as st, i as at, f as ot, h as rt, j as nt, g as it, b as ct, c as lt, N as ut, a as ft, d as dt, m as mt, p as pt } from "../morph-D_ybmXWR.js";
19
19
  import { b as Et, l as ht, p as Tt, r as bt, t as gt } from "../number-CumqY64S.js";
20
- import { c as yt, d as It, i as Ot, b as At, a as Nt, m as St, e as vt, o as Pt, p as Rt } from "../object-CcMK4y_r.js";
20
+ import { c as yt, d as Ot, i as It, b as At, a as Pt, m as St, e as Nt, o as vt, p as Rt } from "../object-CcMK4y_r.js";
21
21
  import { n as _t, r as Dt } from "../polyfills-DJrTJQky.js";
22
- import { s as Bt, w as zt } from "../scroll-DY5senkF.js";
23
- import { c as Ut, a as Vt, b as jt, d as $t, g as Ft, i as Lt, k as kt, s as Yt, t as qt, u as Ht } from "../string-BlMQbe8b.js";
22
+ import { s as Bt, w as jt } from "../scroll-DY5senkF.js";
23
+ import { c as Qt, a as Ut, b as Vt, d as $t, g as Ft, i as Lt, k as kt, s as Yt, t as qt, u as Ht } from "../string-BlMQbe8b.js";
24
24
  import { g as Zt, a as Wt } from "../style-j2TwriJ_.js";
25
- import { c as Jt, i as Xt, a as es, b as ts, n as ss, p as as, s as os, u as rs } from "../url-DAl-mgbC.js";
25
+ import { c as Jt, i as Xt, a as es, b as ts, n as ss, p as as, s as os, e as rs, d as ns, u as is } from "../url-CYgo5vrG.js";
26
26
  function h(t, e, ...s) {
27
27
  return [...t.slice(0, e), ...s, ...t.slice(e)];
28
28
  }
@@ -75,7 +75,7 @@ function C(t, e) {
75
75
  function y(t, e) {
76
76
  return Math.sqrt((t.x - e.x) ** 2 + (t.y - e.y) ** 2) < e.radius;
77
77
  }
78
- function I(t, e) {
78
+ function O(t, e) {
79
79
  let s = !1;
80
80
  const { x: a, y: o } = t;
81
81
  for (let r = 0, n = e.length - 1; r < e.length; n = r++) {
@@ -91,7 +91,7 @@ function f(t, e) {
91
91
  return a.startsWith("var") ? f(t, a.slice(4, -1)) : a;
92
92
  }
93
93
  }
94
- function O(...t) {
94
+ function I(...t) {
95
95
  const e = {};
96
96
  return Array.from(document.styleSheets).forEach((s) => {
97
97
  Array.from(s.cssRules).forEach((a) => {
@@ -108,7 +108,7 @@ function A(t) {
108
108
  const e = window.atob(t);
109
109
  return decodeURIComponent(window.escape(e));
110
110
  }
111
- function N(t) {
111
+ function P(t) {
112
112
  const e = window.unescape(encodeURIComponent(t));
113
113
  return window.btoa(e);
114
114
  }
@@ -117,14 +117,14 @@ function S(t) {
117
117
  let e, s;
118
118
  return p.test(t) ? (e = `mailto:${t.trim()}`, s = "email") : m.test(t) && (e = `tel:${t.replace(/[^0-9\\.\\+]+/g, "")}`, s = "phone"), { href: e, type: s, contact: t };
119
119
  }
120
- function v(t, e) {
120
+ function N(t, e) {
121
121
  if (t) {
122
122
  const a = t.content.cloneNode(!0).firstElementChild;
123
123
  return a && (e == null || e(a)), a;
124
124
  }
125
125
  return null;
126
126
  }
127
- function P(t, e, s, a) {
127
+ function v(t, e, s, a) {
128
128
  let o, r = !1, n = 0;
129
129
  const c = () => {
130
130
  clearInterval(o), a != null && a.restartCounter && (n = 0), r && (o = setInterval(() => {
@@ -153,30 +153,30 @@ export {
153
153
  Et as beautifyNumber,
154
154
  $e as calculateDistance,
155
155
  Fe as calculateDistanceWithRadius,
156
- Ut as camelToKebab,
157
- Vt as capitalize,
156
+ Qt as camelToKebab,
157
+ Ut as capitalize,
158
158
  Jt as changeHistory,
159
159
  Le as clamp,
160
160
  yt as cloneDeep,
161
- v as cloneTemplateContent,
162
- It as compareObjects,
163
- Q as contain,
161
+ N as cloneTemplateContent,
162
+ Ot as compareObjects,
163
+ z as contain,
164
164
  g as copyTextToClipboard,
165
- U as cover,
165
+ Q as cover,
166
166
  Ae as createJSONAndSave,
167
167
  K as createScriptElement,
168
168
  De as createStylesheet,
169
169
  ke as damp,
170
- ve as debounce,
171
- jt as declension,
172
- N as decode,
170
+ Ne as debounce,
171
+ Vt as declension,
172
+ P as decode,
173
173
  $t as decodeHtmlEntities,
174
174
  dt as diff,
175
- Ie as dispatchEvent,
175
+ Oe as dispatchEvent,
176
176
  y as dotCircleCollision,
177
- I as dotPolygonCollision,
177
+ O as dotPolygonCollision,
178
178
  C as dotRectCollision,
179
- Ne as downloadURI,
179
+ Pe as downloadURI,
180
180
  oe as easeInCubic,
181
181
  re as easeInExpo,
182
182
  ne as easeInOutCubic,
@@ -196,44 +196,44 @@ export {
196
196
  Z as excludeElements,
197
197
  W as findParentElement,
198
198
  G as findScrollParentElement,
199
- V as fixPosition,
199
+ U as fixPosition,
200
200
  b as formatBytes,
201
201
  Je as formatMediaDuration,
202
202
  Ft as generateId,
203
203
  J as getAllParentElements,
204
- ze as getCumulativeOffsetLeft,
205
- Qe as getCumulativeOffsetTop,
206
- Ue as getCumulativePosition,
204
+ je as getCumulativeOffsetLeft,
205
+ ze as getCumulativeOffsetTop,
206
+ Qe as getCumulativePosition,
207
207
  X as getElement,
208
208
  Zt as getElementTransitionDurationMS,
209
209
  Wt as getElementTransitionDurationS,
210
210
  F as getPointerPosition,
211
- O as getRootVariables,
212
- Ve as getStickyOffset,
211
+ I as getRootVariables,
212
+ Ue as getStickyOffset,
213
213
  h as insert,
214
214
  ee as intersectElements,
215
215
  B as isBrowser,
216
- Ot as isESClass,
216
+ It as isESClass,
217
217
  Ce as isElementVisible,
218
218
  Xt as isLocalUrl,
219
219
  At as isNullish,
220
- Nt as isObject,
220
+ Pt as isObject,
221
221
  Lt as isUppercase,
222
222
  kt as kebabToCamel,
223
223
  Ye as lerp,
224
224
  be as linear,
225
225
  ht as loopNumber,
226
226
  qe as mapRange,
227
- j as measureText,
227
+ V as measureText,
228
228
  St as mergeDeep,
229
- vt as mixin,
229
+ Nt as mixin,
230
230
  mt as morph,
231
231
  L as normalize,
232
232
  es as normalizeBase,
233
233
  ts as normalizeRelativeURLs,
234
234
  ss as normalizeURL,
235
235
  _t as nullishCoalescing,
236
- Pt as omit,
236
+ vt as omit,
237
237
  _ as parseAttribute,
238
238
  D as parseAttributeValue,
239
239
  as as parseSearchParameters,
@@ -245,23 +245,25 @@ export {
245
245
  bt as roundNumberTo,
246
246
  k as screenToCartesian,
247
247
  Bt as scrollToElement,
248
- P as setIntervalOnIntersection,
248
+ os as searchParamsObjectToString,
249
+ rs as searchParamsToObject,
250
+ v as setIntervalOnIntersection,
249
251
  we as setupDrag,
250
252
  T as shiftArray,
251
253
  Ke as smootherstep,
252
254
  Ze as smoothstep,
253
255
  Yt as snakeToDotted,
254
- os as splitPath,
256
+ ns as splitPath,
255
257
  We as step,
256
258
  Me as styleToString,
257
- Pe as throttle,
259
+ ve as throttle,
258
260
  qt as toPascalCase,
259
261
  gt as toStep,
260
262
  te as traverseNodes,
261
263
  se as traverseShadowRoots,
262
264
  S as tryCreateHrefFromContact,
263
265
  Ht as uncapitalize,
264
- rs as updateSearchParameter,
265
- zt as wait,
266
+ is as updateSearchParameter,
267
+ jt as wait,
266
268
  q as whenDefined
267
269
  };
@@ -34,3 +34,9 @@ export declare function normalizeURL(url: URL | string, { base, trailingSlash, }
34
34
  trailingSlash?: boolean;
35
35
  }): URL;
36
36
  export declare function isLocalUrl(href: string): boolean;
37
+ export declare function searchParamsObjectToString(parameters?: {
38
+ [key: string]: any;
39
+ }): string;
40
+ export declare function searchParamsToObject(params: URLSearchParams): {
41
+ [key: string]: any;
42
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.82.6",
3
+ "version": "0.83.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"
@@ -28,6 +28,11 @@
28
28
  "require": "./lib/animation/index.cjs",
29
29
  "default": "./lib/animation/index.js"
30
30
  },
31
+ "./api-fetcher": {
32
+ "types": "./lib/api-fetcher/index.d.ts",
33
+ "require": "./lib/api-fetcher/index.cjs",
34
+ "default": "./lib/api-fetcher/index.js"
35
+ },
31
36
  "./attribute": {
32
37
  "types": "./lib/attribute/index.d.ts",
33
38
  "require": "./lib/attribute/index.cjs",
@@ -287,6 +292,9 @@
287
292
  "animation": [
288
293
  "lib/animation/index.d.ts"
289
294
  ],
295
+ "api-fetcher": [
296
+ "lib/api-fetcher/index.d.ts"
297
+ ],
290
298
  "attribute": [
291
299
  "lib/attribute/index.d.ts"
292
300
  ],
@@ -449,12 +457,12 @@
449
457
  "dev": "vite --host --mode site"
450
458
  },
451
459
  "devDependencies": {
452
- "@types/node": "^24.1.0",
460
+ "@types/node": "^24.3.0",
453
461
  "@types/three": "^0.179.0",
454
- "tsx": "^4.20.3",
455
- "vite": "^7.0.6",
462
+ "tsx": "^4.20.5",
463
+ "vite": "^7.1.3",
456
464
  "vite-plugin-dts": "^4.5.4",
457
- "vite-plugin-htmc": "0.1.16",
465
+ "vite-plugin-htmc": "0.1.17",
458
466
  "prettier-plugin-organize-imports": "^4.2.0",
459
467
  "csstype": "^3.1.3"
460
468
  },
@@ -1 +0,0 @@
1
- "use strict";var y=Object.defineProperty,$=Object.defineProperties;var w=Object.getOwnPropertyDescriptors;var p=Object.getOwnPropertySymbols;var P=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable;var m=(t,e,r)=>e in t?y(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,S=(t,e)=>{for(var r in e||(e={}))P.call(e,r)&&m(t,r,e[r]);if(p)for(var r of p(e))W.call(e,r)&&m(t,r,e[r]);return t},g=(t,e)=>$(t,w(e));function z(t,{base:e="",trailingSlash:r=!1,mergeParams:s,removeParams:n}={}){e=e.endsWith("/")?e.slice(0,-1):e,t=t.replace(e,""),t.startsWith("/")&&(t=t.slice(1));const i=t.split("#"),l=i[0].split("?");let a=l[0].startsWith("/")?l[0]:"/"+l[0];r?a=!a.endsWith("/")&&a!=="/"?a+"/":a:a=a.endsWith("/")&&a!=="/"?a.slice(0,-1):a;let c=l[1]||"";if(s){const o=new URLSearchParams(c),U=new URLSearchParams(s);for(const[h,d]of U)o.has(h)||o.set(h,d);n==null||n.split(",").forEach(h=>{o.has(h)&&o.delete(h)}),c=o.toString()}const u=e+a,f=i[1],R=`${u}${c?"?"+c:""}${f?"#"+f:""}`;return{leaf:a,pathname:u,parameters:c,hash:f,path:R}}function A(t="/"){return t.endsWith("/")||(t+="/"),t.startsWith("/")||(t+="/"),t}function E(t){if(t.action==="none")return;const e=t==null?void 0:t.searchParameters,r=t.hash?t.hash.startsWith("#")?t.hash:"#"+t.hash:"",s=e?e.startsWith("?")?e:"?"+e:"",n=`${t.pathname}${s}${r}`,i=g(S({},t.state),{path:n});t.action==="push"?history.pushState(i,"",n):t.action==="replace"&&history.replaceState(i,"",n)}function k(t){const e=new URLSearchParams(t),r={};for(const[s,n]of e)r[s]=n;return r}function q(t,e){const r=new URL(location.href),s=(e==null?void 0:e.toString())||"";r.searchParams.set(t,s),history.replaceState(history.state,"",r.href)}function L(t,e,r){t.setAttribute(e,new URL(t.getAttribute(e),r).pathname)}function B(t,e){t.querySelectorAll('[href^="./"], [href^="../"]').forEach(r=>L(r,"href",e)),t.querySelectorAll('[src^="./"], [src^="../"]').forEach(r=>L(r,"src",e))}function H(t,{base:e="",trailingSlash:r=!1}={}){e=e.replace(/^\/|\/$/g,"");const s=typeof t=="string"?t.replace(/^\/|\/$/g,""):t.pathname.replace(/^\/|\/$/g,"");let n="";return s.includes(e)?n=`/${s}`:n=`${e}/${s}`,r&&!n.endsWith("/")&&(n+="/"),new URL(n,location.origin)}function j(t){try{const e=new URL(t);if(window.location.origin===e.origin)return e.pathname===window.location.pathname?!e.hash:!0}catch(e){}return!1}exports.changeHistory=E;exports.isLocalUrl=j;exports.normalizeBase=A;exports.normalizeRelativeURLs=B;exports.normalizeURL=H;exports.parseSearchParameters=k;exports.splitPath=z;exports.updateSearchParameter=q;
@@ -1,97 +0,0 @@
1
- var L = Object.defineProperty, R = Object.defineProperties;
2
- var U = Object.getOwnPropertyDescriptors;
3
- var p = Object.getOwnPropertySymbols;
4
- var W = Object.prototype.hasOwnProperty, P = Object.prototype.propertyIsEnumerable;
5
- var g = (t, e, s) => e in t ? L(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s, S = (t, e) => {
6
- for (var s in e || (e = {}))
7
- W.call(e, s) && g(t, s, e[s]);
8
- if (p)
9
- for (var s of p(e))
10
- P.call(e, s) && g(t, s, e[s]);
11
- return t;
12
- }, $ = (t, e) => R(t, U(e));
13
- function E(t, {
14
- base: e = "",
15
- trailingSlash: s = !1,
16
- mergeParams: r,
17
- removeParams: n
18
- } = {}) {
19
- e = e.endsWith("/") ? e.slice(0, -1) : e, t = t.replace(e, ""), t.startsWith("/") && (t = t.slice(1));
20
- const i = t.split("#"), f = i[0].split("?");
21
- let a = f[0].startsWith("/") ? f[0] : "/" + f[0];
22
- s ? a = !a.endsWith("/") && a !== "/" ? a + "/" : a : a = a.endsWith("/") && a !== "/" ? a.slice(0, -1) : a;
23
- let c = f[1] || "";
24
- if (r) {
25
- const o = new URLSearchParams(c), w = new URLSearchParams(r);
26
- for (const [h, y] of w)
27
- o.has(h) || o.set(h, y);
28
- n == null || n.split(",").forEach((h) => {
29
- o.has(h) && o.delete(h);
30
- }), c = o.toString();
31
- }
32
- const u = e + a, l = i[1], m = `${u}${c ? "?" + c : ""}${l ? "#" + l : ""}`;
33
- return {
34
- leaf: a,
35
- pathname: u,
36
- parameters: c,
37
- hash: l,
38
- path: m
39
- };
40
- }
41
- function k(t = "/") {
42
- return t.endsWith("/") || (t += "/"), t.startsWith("/") || (t += "/"), t;
43
- }
44
- function q(t) {
45
- if (t.action === "none")
46
- return;
47
- const e = t == null ? void 0 : t.searchParameters, s = t.hash ? t.hash.startsWith("#") ? t.hash : "#" + t.hash : "", r = e ? e.startsWith("?") ? e : "?" + e : "", n = `${t.pathname}${r}${s}`, i = $(S({}, t.state), { path: n });
48
- t.action === "push" ? history.pushState(i, "", n) : t.action === "replace" && history.replaceState(i, "", n);
49
- }
50
- function x(t) {
51
- const e = new URLSearchParams(t), s = {};
52
- for (const [r, n] of e)
53
- s[r] = n;
54
- return s;
55
- }
56
- function j(t, e) {
57
- const s = new URL(location.href), r = (e == null ? void 0 : e.toString()) || "";
58
- s.searchParams.set(t, r), history.replaceState(history.state, "", s.href);
59
- }
60
- function d(t, e, s) {
61
- t.setAttribute(e, new URL(t.getAttribute(e), s).pathname);
62
- }
63
- function B(t, e) {
64
- t.querySelectorAll('[href^="./"], [href^="../"]').forEach(
65
- (s) => d(s, "href", e)
66
- ), t.querySelectorAll('[src^="./"], [src^="../"]').forEach(
67
- (s) => d(s, "src", e)
68
- );
69
- }
70
- function H(t, {
71
- base: e = "",
72
- trailingSlash: s = !1
73
- } = {}) {
74
- e = e.replace(/^\/|\/$/g, "");
75
- const r = typeof t == "string" ? t.replace(/^\/|\/$/g, "") : t.pathname.replace(/^\/|\/$/g, "");
76
- let n = "";
77
- return r.includes(e) ? n = `/${r}` : n = `${e}/${r}`, s && !n.endsWith("/") && (n += "/"), new URL(n, location.origin);
78
- }
79
- function O(t) {
80
- try {
81
- const e = new URL(t);
82
- if (window.location.origin === e.origin)
83
- return e.pathname === window.location.pathname ? !e.hash : !0;
84
- } catch (e) {
85
- }
86
- return !1;
87
- }
88
- export {
89
- k as a,
90
- B as b,
91
- q as c,
92
- O as i,
93
- H as n,
94
- x as p,
95
- E as s,
96
- j as u
97
- };