aptechka 0.4.14 → 0.4.16

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.
@@ -27,7 +27,7 @@ import { S as M } from "./Store-Cd-E5W1z.js";
27
27
  import { ticker as R } from "./ticker/index.js";
28
28
  var d, f, F, g, y;
29
29
  class E extends M {
30
- constructor(t, h) {
30
+ constructor(t) {
31
31
  super(t || 0);
32
32
  a(this, d, void 0);
33
33
  a(this, f, void 0);
@@ -36,7 +36,6 @@ class E extends M {
36
36
  a(this, y, (t) => {
37
37
  this.handleAnimationFrame(t);
38
38
  });
39
- this.updateOptions(h);
40
39
  }
41
40
  get isRunning() {
42
41
  return s(this, g);
@@ -47,9 +46,6 @@ class E extends M {
47
46
  close() {
48
47
  super.close(), this.unlistenAnimationFrame();
49
48
  }
50
- updateOptions(t) {
51
- r(this, d, c(t == null ? void 0 : t.maxFPS, s(this, d))), r(this, f, c(t == null ? void 0 : t.order, s(this, f))), r(this, F, c(t == null ? void 0 : t.culling, s(this, F)));
52
- }
53
49
  listenAnimationFrame() {
54
50
  s(this, g).current || (s(this, g).current = !0, R.subscribe(s(this, y), {
55
51
  maxFPS: s(this, d),
@@ -60,12 +56,15 @@ class E extends M {
60
56
  unlistenAnimationFrame() {
61
57
  s(this, g).current && (s(this, g).current = !1, R.unsubscribe(s(this, y)));
62
58
  }
59
+ updateOptions(t) {
60
+ r(this, d, c(t == null ? void 0 : t.maxFPS, s(this, d))), r(this, f, c(t == null ? void 0 : t.order, s(this, f))), r(this, F, c(t == null ? void 0 : t.culling, s(this, F)));
61
+ }
63
62
  }
64
63
  d = new WeakMap(), f = new WeakMap(), F = new WeakMap(), g = new WeakMap(), y = new WeakMap();
65
64
  var n, A, m, u, l, x, b;
66
65
  class V extends E {
67
66
  constructor(t, h) {
68
- super(t || 0, h);
67
+ super(t || 0);
69
68
  a(this, n, void 0);
70
69
  a(this, A, void 0);
71
70
  a(this, m, void 0);
@@ -75,7 +74,7 @@ class V extends E {
75
74
  a(this, b, void 0);
76
75
  this.damping = 0.01, this.stiffness = 0, this.mass = 0, r(this, n, 0), r(this, A, 0), r(this, m, 0), r(this, u, 0), r(this, l, 0), r(this, x, 0), r(this, b, () => {
77
76
  this.set(s(this, n), !0);
78
- }), r(this, m, c(h == null ? void 0 : h.min, -1 / 0)), r(this, u, c(h == null ? void 0 : h.max, 1 / 0)), r(this, n, this.current);
77
+ }), r(this, m, c(h == null ? void 0 : h.min, -1 / 0)), r(this, u, c(h == null ? void 0 : h.max, 1 / 0)), r(this, n, this.current), this.updateOptions(h);
79
78
  }
80
79
  get target() {
81
80
  return s(this, n);
@@ -0,0 +1 @@
1
+ "use strict";var w=Object.defineProperty,L=Object.defineProperties;var _=Object.getOwnPropertyDescriptors;var O=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var k=(s,e,t)=>e in s?w(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,N=(s,e)=>{for(var t in e||(e={}))j.call(e,t)&&k(s,t,e[t]);if(O)for(var t of O(e))z.call(e,t)&&k(s,t,e[t]);return s},P=(s,e)=>L(s,_(e));var v=(s,e,t)=>{if(!e.has(s))throw TypeError("Cannot "+t)};var i=(s,e,t)=>(v(s,e,"read from private field"),t?t.call(s):e.get(s)),a=(s,e,t)=>{if(e.has(s))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(s):e.set(s,t)},r=(s,e,t,h)=>(v(s,e,"write to private field"),h?h.call(s,t):e.set(s,t),t);const D=require("./math-GDWEqu7y.cjs"),S=require("./number-yVpzMdbQ.cjs"),c=require("./polyfills-CrcS4RcO.cjs");require("./path-data-polyfill-CXsOR7Oc.cjs");const I=require("./Store-BQGNOHlY.cjs"),M=require("./ticker/index.cjs");var d,f,F,m,C;class R extends I.Store{constructor(t){super(t||0);a(this,d,void 0);a(this,f,void 0);a(this,F,void 0);a(this,m,new I.Store(!1));a(this,C,t=>{this.handleAnimationFrame(t)})}get isRunning(){return i(this,m)}reset(){this.unlistenAnimationFrame(),super.reset()}close(){super.close(),this.unlistenAnimationFrame()}listenAnimationFrame(){i(this,m).current||(i(this,m).current=!0,M.ticker.subscribe(i(this,C),{maxFPS:i(this,d),order:i(this,f),culling:i(this,F)}))}unlistenAnimationFrame(){i(this,m).current&&(i(this,m).current=!1,M.ticker.unsubscribe(i(this,C)))}updateOptions(t){r(this,d,c.nullishCoalescing(t==null?void 0:t.maxFPS,i(this,d))),r(this,f,c.nullishCoalescing(t==null?void 0:t.order,i(this,f))),r(this,F,c.nullishCoalescing(t==null?void 0:t.culling,i(this,F)))}}d=new WeakMap,f=new WeakMap,F=new WeakMap,m=new WeakMap,C=new WeakMap;var n,A,u,l,g,x,b;class B extends R{constructor(t,h){super(t||0);a(this,n,void 0);a(this,A,void 0);a(this,u,void 0);a(this,l,void 0);a(this,g,void 0);a(this,x,void 0);a(this,b,void 0);this.damping=.01,this.stiffness=0,this.mass=0,r(this,n,0),r(this,A,0),r(this,u,0),r(this,l,0),r(this,g,0),r(this,x,0),r(this,b,()=>{this.set(i(this,n),!0)}),r(this,u,c.nullishCoalescing(h==null?void 0:h.min,-1/0)),r(this,l,c.nullishCoalescing(h==null?void 0:h.max,1/0)),r(this,n,this.current),this.updateOptions(h)}get target(){return i(this,n)}get direction(){return i(this,A)}get min(){return i(this,u)}set min(t){r(this,u,t),i(this,b).call(this)}get max(){return i(this,l)}set max(t){r(this,l,t),i(this,b).call(this)}get velocity(){return i(this,g)}get speed(){return i(this,x)}get length(){return i(this,l)-i(this,u)}get progress(){return this.length?S.preciseNumber((this.current-i(this,u))/this.length,6):0}get entry(){return P(N({},super.entry),{min:i(this,u),max:i(this,l),length:this.length,direction:this.direction,progress:this.progress})}set(t,h=!1){const y=i(this,n);r(this,n,D.clamp(t,i(this,u),i(this,l))),h&&(this.current=i(this,n)),i(this,n)!==y&&(r(this,A,Math.sign(t-i(this,n))||1),this.listenAnimationFrame())}shift(t,h=!1){this.set(i(this,n)+t,h)}reset(){this.set(this.initial,!0),super.reset()}listenAnimationFrame(){this.current!==this.target&&super.listenAnimationFrame()}updateOptions(t){super.updateOptions(t),this.damping=c.nullishCoalescing(t==null?void 0:t.damping,this.damping),this.mass=c.nullishCoalescing(t==null?void 0:t.damping,this.mass),this.stiffness=c.nullishCoalescing(t==null?void 0:t.damping,this.stiffness)}handleAnimationFrame(t){S.preciseNumber(this.current,4)===S.preciseNumber(this.target,4)&&(this.unlistenAnimationFrame(),this.current=this.target);const h=this.current,y=Math.abs(h-this.target);r(this,x,y/t.elapsed);const q=t.elapsed/1e3;if(this.mass||this.stiffness){const p=(i(this,n)-this.current)*this.stiffness-i(this,g)*this.damping;r(this,g,i(this,g)+p/this.mass*q),this.current+=i(this,g)*q}else this.current=D.damp(this.current,this.target,this.damping,q)}}n=new WeakMap,A=new WeakMap,u=new WeakMap,l=new WeakMap,g=new WeakMap,x=new WeakMap,b=new WeakMap;exports.Animation=R;exports.Damped=B;
@@ -10,14 +10,14 @@ export interface AnimationOptions extends TickerAddOptions, StoreOptions<number>
10
10
  }
11
11
  export declare abstract class Animation<Options extends AnimationOptions, Entry extends StoreEntry<number> = StoreEntry<number>> extends Store<number, 'number', Entry> {
12
12
  #private;
13
- constructor(initial?: number, options?: Options);
13
+ constructor(initial?: number);
14
14
  get isRunning(): Store<boolean, keyof import('../store').StoreManagers, StoreEntry<boolean>>;
15
15
  abstract set(value: number): void;
16
16
  abstract shift(value: number): void;
17
17
  reset(): void;
18
18
  close(): void;
19
- updateOptions(options?: Omit<Options, keyof StoreOptions<number>>): void;
20
19
  listenAnimationFrame(): void;
21
20
  unlistenAnimationFrame(): void;
21
+ updateOptions(options?: Omit<Options, keyof StoreOptions<number>>): void;
22
22
  protected abstract handleAnimationFrame(e: TickerCallbackEntry): void;
23
23
  }
@@ -1 +1 @@
1
- "use strict";var F=Object.defineProperty,O=Object.defineProperties;var T=Object.getOwnPropertyDescriptors;var g=Object.getOwnPropertySymbols;var D=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var d=(i,t,e)=>t in i?F(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,f=(i,t)=>{for(var e in t||(t={}))D.call(t,e)&&d(i,e,t[e]);if(g)for(var e of g(t))w.call(t,e)&&d(i,e,t[e]);return i},p=(i,t)=>O(i,T(t));var o=(i,t,e)=>{if(!t.has(i))throw TypeError("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)=>{if(t.has(i))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(i):t.set(i,e)},l=(i,t,e,s)=>(o(i,t,"write to private field"),s?s.call(i,e):t.set(i,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../Damped-DK3CSBXb.cjs"),C=require("../easings-DsS5-Kqc.cjs"),M=require("../math-GDWEqu7y.cjs"),q=require("../number-yVpzMdbQ.cjs"),A=require("../polyfills-CrcS4RcO.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");var c,h,n,a,m;class N extends b.Animation{constructor(e,s){super(e||0,s);u(this,c,C.linear);u(this,h,1e3);u(this,n,0);u(this,a,0);u(this,m,0)}get direction(){return r(this,m)}get length(){return r(this,a)-r(this,n)}get progress(){return this.length?q.preciseNumber((this.current-r(this,n))/this.length,6):0}get entry(){return p(f({},super.entry),{length:this.length,direction:this.direction,progress:this.progress})}set(e,s){s!=null&&s.restart&&(this.current=this.initial),l(this,n,this.current),l(this,a,e),l(this,m,Math.sign(this.length)),this.updateOptions(s),r(this,h)?(this.unlistenAnimationFrame(),this.listenAnimationFrame()):(this.current=r(this,a),this.unlistenAnimationFrame())}shift(e,s){this.set(this.current+e,s)}updateOptions(e){super.updateOptions(e),l(this,c,A.nullishCoalescing(e==null?void 0:e.easing,r(this,c))),l(this,h,A.nullishCoalescing(e==null?void 0:e.duration,r(this,h)))}handleAnimationFrame(e){const s=(e.timestamp-e.startTimestamp)/1e3/(r(this,h)/1e3),y=r(this,c).call(this,M.clamp(s,0,1));this.current=q.preciseNumber(r(this,n)+(r(this,a)-r(this,n))*y,6),s>1&&this.unlistenAnimationFrame()}}c=new WeakMap,h=new WeakMap,n=new WeakMap,a=new WeakMap,m=new WeakMap;exports.Damped=b.Damped;exports.Tweened=N;
1
+ "use strict";var F=Object.defineProperty,O=Object.defineProperties;var T=Object.getOwnPropertyDescriptors;var g=Object.getOwnPropertySymbols;var D=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var d=(i,e,t)=>e in i?F(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,p=(i,e)=>{for(var t in e||(e={}))D.call(e,t)&&d(i,t,e[t]);if(g)for(var t of g(e))w.call(e,t)&&d(i,t,e[t]);return i},f=(i,e)=>O(i,T(e));var o=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var r=(i,e,t)=>(o(i,e,"read from private field"),t?t.call(i):e.get(i)),u=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},l=(i,e,t,s)=>(o(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../Damped-D2k3SbmP.cjs"),C=require("../easings-DsS5-Kqc.cjs"),M=require("../math-GDWEqu7y.cjs"),q=require("../number-yVpzMdbQ.cjs"),A=require("../polyfills-CrcS4RcO.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");var c,h,n,a,m;class N extends b.Animation{constructor(t,s){super(t||0);u(this,c,C.linear);u(this,h,1e3);u(this,n,0);u(this,a,0);u(this,m,0);this.updateOptions(s)}get direction(){return r(this,m)}get length(){return r(this,a)-r(this,n)}get progress(){return this.length?q.preciseNumber((this.current-r(this,n))/this.length,6):0}get entry(){return f(p({},super.entry),{length:this.length,direction:this.direction,progress:this.progress})}set(t,s){s!=null&&s.restart&&(this.current=this.initial),l(this,n,this.current),l(this,a,t),l(this,m,Math.sign(this.length)),this.updateOptions(s),r(this,h)?(this.unlistenAnimationFrame(),this.listenAnimationFrame()):(this.current=r(this,a),this.unlistenAnimationFrame())}shift(t,s){this.set(this.current+t,s)}updateOptions(t){super.updateOptions(t),l(this,c,A.nullishCoalescing(t==null?void 0:t.easing,r(this,c))),l(this,h,A.nullishCoalescing(t==null?void 0:t.duration,r(this,h)))}handleAnimationFrame(t){const s=(t.timestamp-t.startTimestamp)/1e3/(r(this,h)/1e3),y=r(this,c).call(this,M.clamp(s,0,1));this.current=q.preciseNumber(r(this,n)+(r(this,a)-r(this,n))*y,6),s>1&&this.unlistenAnimationFrame()}}c=new WeakMap,h=new WeakMap,n=new WeakMap,a=new WeakMap,m=new WeakMap;exports.Damped=b.Damped;exports.Tweened=N;
@@ -1,26 +1,26 @@
1
- var O = Object.defineProperty, y = Object.defineProperties;
1
+ var x = Object.defineProperty, y = Object.defineProperties;
2
2
  var D = Object.getOwnPropertyDescriptors;
3
3
  var g = Object.getOwnPropertySymbols;
4
4
  var T = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable;
5
- var d = (e, i, t) => i in e ? O(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t, f = (e, i) => {
5
+ var d = (e, i, t) => i in e ? x(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t, p = (e, i) => {
6
6
  for (var t in i || (i = {}))
7
7
  T.call(i, t) && d(e, t, i[t]);
8
8
  if (g)
9
9
  for (var t of g(i))
10
10
  b.call(i, t) && d(e, t, i[t]);
11
11
  return e;
12
- }, p = (e, i) => y(e, D(i));
12
+ }, f = (e, i) => y(e, D(i));
13
13
  var o = (e, i, t) => {
14
14
  if (!i.has(e))
15
15
  throw TypeError("Cannot " + t);
16
16
  };
17
- var s = (e, i, t) => (o(e, i, "read from private field"), t ? t.call(e) : i.get(e)), m = (e, i, t) => {
17
+ var r = (e, i, t) => (o(e, i, "read from private field"), t ? t.call(e) : i.get(e)), m = (e, i, t) => {
18
18
  if (i.has(e))
19
19
  throw TypeError("Cannot add the same private member more than once");
20
20
  i instanceof WeakSet ? i.add(e) : i.set(e, t);
21
- }, u = (e, i, t, r) => (o(e, i, "write to private field"), r ? r.call(e, t) : i.set(e, t), t);
22
- import { A as w } from "../Damped-BZujMwuv.js";
23
- import { D as I } from "../Damped-BZujMwuv.js";
21
+ }, u = (e, i, t, s) => (o(e, i, "write to private field"), s ? s.call(e, t) : i.set(e, t), t);
22
+ import { A as w } from "../Damped-B91XlC1a.js";
23
+ import { D as I } from "../Damped-B91XlC1a.js";
24
24
  import { l as C } from "../easings-BKi40vHz.js";
25
25
  import { c as M } from "../math-BOBiC4TN.js";
26
26
  import { p as A } from "../number-Bo5RdrA1.js";
@@ -28,42 +28,43 @@ import { n as F } from "../polyfills-DJUYczFm.js";
28
28
  import "../path-data-polyfill-DgeDWYeI.js";
29
29
  var l, n, h, a, c;
30
30
  class E extends w {
31
- constructor(t, r) {
32
- super(t || 0, r);
31
+ constructor(t, s) {
32
+ super(t || 0);
33
33
  m(this, l, C);
34
34
  m(this, n, 1e3);
35
35
  m(this, h, 0);
36
36
  m(this, a, 0);
37
37
  m(this, c, 0);
38
+ this.updateOptions(s);
38
39
  }
39
40
  get direction() {
40
- return s(this, c);
41
+ return r(this, c);
41
42
  }
42
43
  get length() {
43
- return s(this, a) - s(this, h);
44
+ return r(this, a) - r(this, h);
44
45
  }
45
46
  get progress() {
46
- return this.length ? A((this.current - s(this, h)) / this.length, 6) : 0;
47
+ return this.length ? A((this.current - r(this, h)) / this.length, 6) : 0;
47
48
  }
48
49
  get entry() {
49
- return p(f({}, super.entry), {
50
+ return f(p({}, super.entry), {
50
51
  length: this.length,
51
52
  direction: this.direction,
52
53
  progress: this.progress
53
54
  });
54
55
  }
55
- set(t, r) {
56
- r != null && r.restart && (this.current = this.initial), u(this, h, this.current), u(this, a, t), u(this, c, Math.sign(this.length)), this.updateOptions(r), s(this, n) ? (this.unlistenAnimationFrame(), this.listenAnimationFrame()) : (this.current = s(this, a), this.unlistenAnimationFrame());
56
+ set(t, s) {
57
+ s != null && s.restart && (this.current = this.initial), u(this, h, this.current), u(this, a, t), u(this, c, Math.sign(this.length)), this.updateOptions(s), r(this, n) ? (this.unlistenAnimationFrame(), this.listenAnimationFrame()) : (this.current = r(this, a), this.unlistenAnimationFrame());
57
58
  }
58
- shift(t, r) {
59
- this.set(this.current + t, r);
59
+ shift(t, s) {
60
+ this.set(this.current + t, s);
60
61
  }
61
62
  updateOptions(t) {
62
- super.updateOptions(t), u(this, l, F(t == null ? void 0 : t.easing, s(this, l))), u(this, n, F(t == null ? void 0 : t.duration, s(this, n)));
63
+ super.updateOptions(t), u(this, l, F(t == null ? void 0 : t.easing, r(this, l))), u(this, n, F(t == null ? void 0 : t.duration, r(this, n)));
63
64
  }
64
65
  handleAnimationFrame(t) {
65
- const r = (t.timestamp - t.startTimestamp) / 1e3 / (s(this, n) / 1e3), x = s(this, l).call(this, M(r, 0, 1));
66
- this.current = A(s(this, h) + (s(this, a) - s(this, h)) * x, 6), r > 1 && this.unlistenAnimationFrame();
66
+ const s = (t.timestamp - t.startTimestamp) / 1e3 / (r(this, n) / 1e3), O = r(this, l).call(this, M(s, 0, 1));
67
+ this.current = A(r(this, h) + (r(this, a) - r(this, h)) * O, 6), s > 1 && this.unlistenAnimationFrame();
67
68
  }
68
69
  }
69
70
  l = new WeakMap(), n = new WeakMap(), h = new WeakMap(), a = new WeakMap(), c = new WeakMap();
@@ -2,6 +2,6 @@ import { Morph } from './Morph';
2
2
 
3
3
  export declare class Link {
4
4
  #private;
5
- constructor(element: HTMLAnchorElement, morph: Morph);
5
+ constructor(element: HTMLAnchorElement, morph: Morph, base: string);
6
6
  destroy(): void;
7
7
  }
@@ -22,6 +22,6 @@ export declare class Morph {
22
22
  constructor(parameters?: MorphParameters);
23
23
  beforeNavigationEvent(callback: MorphNavigationCallback): () => void;
24
24
  afterNavigationEvent(callback: MorphNavigationCallback): () => void;
25
- prefetch(pathname: string): Promise<Document>;
26
- navigate(pathname: string, historyAction?: MorphHistoryAction): Promise<void>;
25
+ prefetch(path: string): Promise<Document>;
26
+ navigate(path: string, historyAction?: MorphHistoryAction): Promise<void>;
27
27
  }
@@ -1 +1 @@
1
- "use strict";var V=(s,t)=>(t=Symbol[s])?t:Symbol.for("Symbol."+s);var m=(s,t,e)=>{if(!t.has(s))throw TypeError("Cannot "+e)};var i=(s,t,e)=>(m(s,t,"read from private field"),e?e.call(s):t.get(s)),n=(s,t,e)=>{if(t.has(s))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(s):t.set(s,e)},o=(s,t,e,r)=>(m(s,t,"write to private field"),r?r.call(s,e):t.set(s,e),e);var f=(s,t,e)=>(m(s,t,"access private method"),e);var T=(s,t,e)=>new Promise((r,c)=>{var l=u=>{try{g(e.next(u))}catch(v){c(v)}},y=u=>{try{g(e.throw(u))}catch(v){c(v)}},g=u=>u.done?r(u.value):Promise.resolve(u.value).then(l,y);g((e=e.apply(s,t)).next())});var X=(s,t,e)=>(t=s[V("asyncIterator")])?t.call(s):(s=s[V("iterator")](),t={},e=(r,c)=>(c=s[r])&&(t[r]=l=>new Promise((y,g,u)=>(l=c.call(s,l),u=l.done,Promise.resolve(l.value).then(v=>y({value:v,done:u}),g)))),e("next"),e("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Z=require("../notifier/index.cjs"),st=require("../browser-CpzFX2xg.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");var M,d,w,N,P,S;class nt{constructor(t,e){n(this,M,void 0);n(this,d,void 0);n(this,w,void 0);n(this,N,void 0);n(this,P,t=>{t.preventDefault(),i(this,M).navigate(i(this,w),i(this,N))});n(this,S,()=>{i(this,M).prefetch(i(this,w))});o(this,M,e),o(this,d,t),o(this,w,i(this,d).getAttribute("href")||"/"),o(this,N,i(this,d).getAttribute("data-history-action")||"push"),i(this,d).addEventListener("click",i(this,P)),i(this,w)===location.pathname&&i(this,d).classList.add("current"),i(this,d).hasAttribute("data-prefetch")&&i(this,d).addEventListener("pointerenter",i(this,S))}destroy(){i(this,d).removeEventListener("click",i(this,P)),i(this,d).removeEventListener("pointerenter",i(this,S)),i(this,d).classList.remove("current")}}M=new WeakMap,d=new WeakMap,w=new WeakMap,N=new WeakMap,P=new WeakMap,S=new WeakMap;var a,k,A,C,q,j,E,L,H,x,D,R,z,B,$,W,G,F,J,K,p,O,Q,Y;class rt{constructor(t){n(this,R);n(this,B);n(this,W);n(this,F);n(this,K);n(this,O);n(this,a,null);n(this,k,null);n(this,A,null);n(this,C,null);n(this,q,[]);n(this,j,new DOMParser);n(this,E,new Map);n(this,L,void 0);n(this,H,null);n(this,x,new Z.Notifier);n(this,D,new Z.Notifier);n(this,Y,t=>{t.state&&this.navigate(t.state,"none")});st.isBrowser&&(o(this,a,(t==null?void 0:t.base)||"/"),t!=null&&t.base?(o(this,a,t.base),t.base.endsWith("/")||o(this,a,i(this,a)+"/")):o(this,a,"/"),o(this,k,(t==null?void 0:t.waitForHeadToLoad)!==!1),o(this,A,(t==null?void 0:t.cachePages)!==!1),o(this,C,f(this,F,J).call(this,document)),o(this,H,location.pathname),f(this,W,G).call(this),addEventListener("popstate",i(this,Y)))}beforeNavigationEvent(t){return i(this,x).subscribe(t)}afterNavigationEvent(t){return i(this,D).subscribe(t)}prefetch(t){return T(this,null,function*(){return f(this,R,z).call(this,t)})}navigate(t,e="push"){return T(this,null,function*(){var c;if(t=f(this,B,$).call(this,t),i(this,L)===t||i(this,H)===t)return;o(this,L,t);const r=i(this,E).has(t);try{let l=!0;if(this.preprocessor)try{yield new Promise((h,b)=>{var I;(I=this.preprocessor)==null||I.call(this,{pathname:t,resolve:h,reject:b,isCached:r})})}catch(h){h?console.error(h):console.log("Route change canceled"),l=!1}if(i(this,x).notify({pathname:t,isCached:r}),!l||i(this,L)!==t)return;const y=i(this,E).get(t)||(yield f(this,R,z).call(this,t));if(i(this,L)!==t)return;const g=Array.from(document.head.children),u=Array.from(y.head.cloneNode(!0).children),v=f(this,K,p).call(this,g,u),tt=f(this,O,Q).call(this,g,v),U=f(this,O,Q).call(this,u,v);tt.forEach(h=>h.remove()),U.forEach(h=>document.head.appendChild(h));const _=U.filter(h=>h.tagName==="STYLE"||h.tagName==="SCRIPT"||h.tagName==="LINK");i(this,k)&&_.length&&(yield new Promise(h=>T(this,null,function*(){let b=0;try{for(var I=X(_),ct,lt,ut;ct=!(lt=yield I.next()).done;ct=!1){const it=lt.value;it.onload=()=>{b++,b===_.length&&h()}}}catch(lt){ut=[lt]}finally{try{ct&&(lt=I.return)&&(yield lt.call(I))}finally{if(ut)throw ut[0]}}})));const et=f(this,F,J).call(this,y);i(this,C).forEach((h,b)=>{const I=et[b];h.innerHTML=I.innerHTML}),o(this,H,t),e==="push"?history.pushState(t,"",t+location.search):e==="replace"&&history.replaceState(t,"",t+location.search),f(this,W,G).call(this),(c=this.postprocessor)==null||c.call(this,{pathname:t,isCached:r}),i(this,D).notify({pathname:t,isCached:r})}catch(l){console.error(l)}o(this,L,void 0)})}}a=new WeakMap,k=new WeakMap,A=new WeakMap,C=new WeakMap,q=new WeakMap,j=new WeakMap,E=new WeakMap,L=new WeakMap,H=new WeakMap,x=new WeakMap,D=new WeakMap,R=new WeakSet,z=function(t){return T(this,null,function*(){const e=i(this,E).get(t);if(e)return e;const c=yield(yield fetch(t)).text(),l=i(this,j).parseFromString(c,"text/html");return i(this,A)&&i(this,E).set(t,l),l})},B=new WeakSet,$=function(t){return t=t.replace(i(this,a),""),t.startsWith("/")&&(t=t.slice(1)),i(this,a)+t},W=new WeakSet,G=function(){const t=[...document.documentElement.querySelectorAll("a")].filter(e=>{var r;return(r=e.getAttribute("href"))==null?void 0:r.startsWith("/")});i(this,q).forEach(e=>e.destroy()),o(this,q,t.map(e=>new nt(e,this)))},F=new WeakSet,J=function(t){const e=t.querySelectorAll("[data-morph]");return e.length?[...e]:[t.body]},K=new WeakSet,p=function(t,e){return t.filter(r=>e.find(c=>c.outerHTML===r.outerHTML))},O=new WeakSet,Q=function(t,e){return t.filter(r=>!e.find(c=>c.outerHTML===r.outerHTML))},Y=new WeakMap;exports.Morph=rt;
1
+ "use strict";var st=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n);var _=(n,t,e)=>{if(!t.has(n))throw TypeError("Cannot "+e)};var s=(n,t,e)=>(_(n,t,"read from private field"),e?e.call(n):t.get(n)),r=(n,t,e)=>{if(t.has(n))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(n):t.set(n,e)},c=(n,t,e,o)=>(_(n,t,"write to private field"),o?o.call(n,e):t.set(n,e),e);var d=(n,t,e)=>(_(n,t,"access private method"),e);var T=(n,t,e)=>new Promise((o,i)=>{var a=l=>{try{f(e.next(l))}catch(m){i(m)}},w=l=>{try{f(e.throw(l))}catch(m){i(m)}},f=l=>l.done?o(l.value):Promise.resolve(l.value).then(a,w);f((e=e.apply(n,t)).next())});var it=(n,t,e)=>(t=n[st("asyncIterator")])?t.call(n):(n=n[st("iterator")](),t={},e=(o,i)=>(i=n[o])&&(t[o]=a=>new Promise((w,f,l)=>(a=i.call(n,a),l=a.done,Promise.resolve(a.value).then(m=>w({value:m,done:l}),f)))),e("next"),e("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const nt=require("../notifier/index.cjs"),ut=require("../browser-CpzFX2xg.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");var y,u,L,H,P,S;class dt{constructor(t,e,o){r(this,y,void 0);r(this,u,void 0);r(this,L,void 0);r(this,H,void 0);r(this,P,t=>{t.preventDefault(),s(this,y).navigate(s(this,L),s(this,H))});r(this,S,()=>{s(this,y).prefetch(s(this,L))});c(this,y,e),c(this,u,t),c(this,L,s(this,u).getAttribute("href")||"/"),c(this,H,s(this,u).getAttribute("data-history-action")||"push"),s(this,u).addEventListener("click",s(this,P)),s(this,L)===location.pathname.replace(o.slice(0,-1),"")&&s(this,u).classList.add("current"),s(this,u).hasAttribute("data-prefetch")&&s(this,u).addEventListener("pointerenter",s(this,S))}destroy(){s(this,u).removeEventListener("click",s(this,P)),s(this,u).removeEventListener("pointerenter",s(this,S)),s(this,u).classList.remove("current")}}y=new WeakMap,u=new WeakMap,L=new WeakMap,H=new WeakMap,P=new WeakMap,S=new WeakMap;var g,N,A,C,k,j,b,v,M,x,W,q,z,D,G,R,J,F,Q,B,rt,I,U,K;class ft{constructor(t){r(this,q);r(this,D);r(this,R);r(this,F);r(this,B);r(this,I);r(this,g,null);r(this,N,null);r(this,A,null);r(this,C,null);r(this,k,[]);r(this,j,new DOMParser);r(this,b,new Map);r(this,v,void 0);r(this,M,null);r(this,x,new nt.Notifier);r(this,W,new nt.Notifier);r(this,K,t=>{t.state&&this.navigate(t.state,"none")});ut.isBrowser&&(c(this,g,(t==null?void 0:t.base)||"/"),t!=null&&t.base?(c(this,g,t.base),t.base.endsWith("/")||c(this,g,s(this,g)+"/")):c(this,g,"/"),c(this,N,(t==null?void 0:t.waitForHeadToLoad)!==!1),c(this,A,(t==null?void 0:t.cachePages)!==!1),c(this,C,d(this,F,Q).call(this,document)),c(this,M,location.pathname),d(this,R,J).call(this),addEventListener("popstate",s(this,K)))}beforeNavigationEvent(t){return s(this,x).subscribe(t)}afterNavigationEvent(t){return s(this,W).subscribe(t)}prefetch(t){return T(this,null,function*(){const e=d(this,D,G).call(this,t);return d(this,q,z).call(this,e.pathname)})}navigate(t,e="push"){return T(this,null,function*(){var l;const o=d(this,D,G).call(this,t);let{pathname:i,hash:a,parameters:w}=o;if(s(this,v)===i||s(this,M)===i)return;c(this,v,i);const f=s(this,b).has(i);try{let m=!0;if(s(this,x).notify({pathname:i,isCached:f}),this.preprocessor)try{yield new Promise((h,p)=>{var E;(E=this.preprocessor)==null||E.call(this,{pathname:i,resolve:h,reject:p,isCached:f})})}catch(h){h?console.error(h):console.log("Route change canceled"),m=!1}if(!m||s(this,v)!==i)return;const V=s(this,b).get(i)||(yield d(this,q,z).call(this,i));if(s(this,v)!==i)return;const X=Array.from(document.head.children),Z=Array.from(V.head.cloneNode(!0).children),tt=d(this,B,rt).call(this,X,Z),ot=d(this,I,U).call(this,X,tt),O=d(this,I,U).call(this,Z,tt);ot.forEach(h=>{h.remove()}),O.forEach((h,p)=>{if(h.tagName==="SCRIPT"&&h.getAttribute("src")){const E=document.createElement("script");E.type="module",E.src=h.getAttribute("src"),O[p]=E}}),O.forEach((h,p)=>{document.head.appendChild(h)});const Y=O.filter(h=>h.tagName==="STYLE"||h.tagName==="SCRIPT"||h.tagName==="LINK");s(this,N)&&Y.length&&(yield new Promise(h=>T(this,null,function*(){let p=0;try{for(var E=it(Y),pt,Et,vt;pt=!(Et=yield E.next()).done;pt=!1){const lt=Et.value;lt.onload=()=>{p++,p===Y.length&&h()}}}catch(Et){vt=[Et]}finally{try{pt&&(Et=E.return)&&(yield Et.call(E))}finally{if(vt)throw vt[0]}}}))),c(this,M,i);const $=w||location.search,ht=a?a.startsWith("#")?a:"#"+a:"",ct=$?$.startsWith("?")?$:"?"+$:"",et=`${i}${ht}${ct}`;e==="push"?history.pushState(i,"",et):e==="replace"&&history.replaceState(i,"",et);const at=d(this,F,Q).call(this,V);s(this,C).forEach((h,p)=>{const E=at[p];h.innerHTML=E.innerHTML}),d(this,R,J).call(this),(l=this.postprocessor)==null||l.call(this,{pathname:i,isCached:f}),s(this,W).notify({pathname:i,isCached:f})}catch(m){console.error(m)}c(this,v,void 0)})}}g=new WeakMap,N=new WeakMap,A=new WeakMap,C=new WeakMap,k=new WeakMap,j=new WeakMap,b=new WeakMap,v=new WeakMap,M=new WeakMap,x=new WeakMap,W=new WeakMap,q=new WeakSet,z=function(t){return T(this,null,function*(){const e=s(this,b).get(t);if(e)return e;const i=yield(yield fetch(t)).text(),a=s(this,j).parseFromString(i,"text/html");return s(this,A)&&s(this,b).set(t,a),a})},D=new WeakSet,G=function(t){t=t.replace(s(this,g),""),t.startsWith("/")&&(t=t.slice(1));const e=t.split("#"),o=e[0].split("?"),i=s(this,g)+o[0],a=o==null?void 0:o[1],w=e==null?void 0:e[1];return{pathname:i,parameters:a,hash:w}},R=new WeakSet,J=function(){const t=[...document.documentElement.querySelectorAll("a")].filter(e=>{var o;return(o=e.getAttribute("href"))==null?void 0:o.startsWith("/")});s(this,k).forEach(e=>e.destroy()),c(this,k,t.map(e=>new dt(e,this,s(this,g))))},F=new WeakSet,Q=function(t){const e=t.querySelectorAll("[data-morph]");return e.length?[...e]:[t.body]},B=new WeakSet,rt=function(t,e){return t.filter(o=>e.find(i=>i.outerHTML===o.outerHTML))},I=new WeakSet,U=function(t,e){return t.filter(o=>!e.find(i=>i.outerHTML===o.outerHTML))},K=new WeakMap;exports.Morph=ft;
@@ -1,191 +1,213 @@
1
- var X = (s, t) => (t = Symbol[s]) ? t : Symbol.for("Symbol." + s);
2
- var z = (s, t, e) => {
3
- if (!t.has(s))
1
+ var st = (n, t) => (t = Symbol[n]) ? t : Symbol.for("Symbol." + n);
2
+ var z = (n, t, e) => {
3
+ if (!t.has(n))
4
4
  throw TypeError("Cannot " + e);
5
5
  };
6
- var i = (s, t, e) => (z(s, t, "read from private field"), e ? e.call(s) : t.get(s)), n = (s, t, e) => {
7
- if (t.has(s))
6
+ var s = (n, t, e) => (z(n, t, "read from private field"), e ? e.call(n) : t.get(n)), o = (n, t, e) => {
7
+ if (t.has(n))
8
8
  throw TypeError("Cannot add the same private member more than once");
9
- t instanceof WeakSet ? t.add(s) : t.set(s, e);
10
- }, r = (s, t, e, o) => (z(s, t, "write to private field"), o ? o.call(s, e) : t.set(s, e), e);
11
- var d = (s, t, e) => (z(s, t, "access private method"), e);
12
- var T = (s, t, e) => new Promise((o, c) => {
13
- var l = (f) => {
9
+ t instanceof WeakSet ? t.add(n) : t.set(n, e);
10
+ }, c = (n, t, e, r) => (z(n, t, "write to private field"), r ? r.call(n, e) : t.set(n, e), e);
11
+ var f = (n, t, e) => (z(n, t, "access private method"), e);
12
+ var T = (n, t, e) => new Promise((r, i) => {
13
+ var a = (l) => {
14
14
  try {
15
- g(e.next(f));
16
- } catch (L) {
17
- c(L);
15
+ d(e.next(l));
16
+ } catch (m) {
17
+ i(m);
18
18
  }
19
- }, y = (f) => {
19
+ }, v = (l) => {
20
20
  try {
21
- g(e.throw(f));
22
- } catch (L) {
23
- c(L);
21
+ d(e.throw(l));
22
+ } catch (m) {
23
+ i(m);
24
24
  }
25
- }, g = (f) => f.done ? o(f.value) : Promise.resolve(f.value).then(l, y);
26
- g((e = e.apply(s, t)).next());
25
+ }, d = (l) => l.done ? r(l.value) : Promise.resolve(l.value).then(a, v);
26
+ d((e = e.apply(n, t)).next());
27
27
  });
28
- var Z = (s, t, e) => (t = s[X("asyncIterator")]) ? t.call(s) : (s = s[X("iterator")](), t = {}, e = (o, c) => (c = s[o]) && (t[o] = (l) => new Promise((y, g, f) => (l = c.call(s, l), f = l.done, Promise.resolve(l.value).then((L) => y({ value: L, done: f }), g)))), e("next"), e("return"), t);
29
- import { Notifier as _ } from "../notifier/index.js";
30
- import { i as st } from "../browser-0zX67oeU.js";
28
+ var it = (n, t, e) => (t = n[st("asyncIterator")]) ? t.call(n) : (n = n[st("iterator")](), t = {}, e = (r, i) => (i = n[r]) && (t[r] = (a) => new Promise((v, d, l) => (a = i.call(n, a), l = a.done, Promise.resolve(a.value).then((m) => v({ value: m, done: l }), d)))), e("next"), e("return"), t);
29
+ import { Notifier as nt } from "../notifier/index.js";
30
+ import { i as ut } from "../browser-0zX67oeU.js";
31
31
  import "../path-data-polyfill-DgeDWYeI.js";
32
- var H, u, E, N, P, S;
33
- class nt {
34
- constructor(t, e) {
35
- n(this, H, void 0);
36
- n(this, u, void 0);
37
- n(this, E, void 0);
38
- n(this, N, void 0);
39
- n(this, P, (t) => {
40
- t.preventDefault(), i(this, H).navigate(i(this, E), i(this, N));
32
+ var b, u, w, M, P, N;
33
+ class ft {
34
+ constructor(t, e, r) {
35
+ o(this, b, void 0);
36
+ o(this, u, void 0);
37
+ o(this, w, void 0);
38
+ o(this, M, void 0);
39
+ o(this, P, (t) => {
40
+ t.preventDefault(), s(this, b).navigate(s(this, w), s(this, M));
41
41
  });
42
- n(this, S, () => {
43
- i(this, H).prefetch(i(this, E));
42
+ o(this, N, () => {
43
+ s(this, b).prefetch(s(this, w));
44
44
  });
45
- r(this, H, e), r(this, u, t), r(this, E, i(this, u).getAttribute("href") || "/"), r(this, N, i(this, u).getAttribute(
45
+ c(this, b, e), c(this, u, t), c(this, w, s(this, u).getAttribute("href") || "/"), c(this, M, s(this, u).getAttribute(
46
46
  "data-history-action"
47
- ) || "push"), i(this, u).addEventListener("click", i(this, P)), i(this, E) === location.pathname && i(this, u).classList.add("current"), i(this, u).hasAttribute("data-prefetch") && i(this, u).addEventListener("pointerenter", i(this, S));
47
+ ) || "push"), s(this, u).addEventListener("click", s(this, P)), s(this, w) === location.pathname.replace(r.slice(0, -1), "") && s(this, u).classList.add("current"), s(this, u).hasAttribute("data-prefetch") && s(this, u).addEventListener("pointerenter", s(this, N));
48
48
  }
49
49
  destroy() {
50
- i(this, u).removeEventListener("click", i(this, P)), i(this, u).removeEventListener("pointerenter", i(this, S)), i(this, u).classList.remove("current");
50
+ s(this, u).removeEventListener("click", s(this, P)), s(this, u).removeEventListener("pointerenter", s(this, N)), s(this, u).classList.remove("current");
51
51
  }
52
52
  }
53
- H = new WeakMap(), u = new WeakMap(), E = new WeakMap(), N = new WeakMap(), P = new WeakMap(), S = new WeakMap();
54
- var a, k, A, C, x, O, w, v, M, D, m, R, G, B, $, W, J, F, Q, K, p, q, U, Y;
55
- class lt {
53
+ b = new WeakMap(), u = new WeakMap(), w = new WeakMap(), M = new WeakMap(), P = new WeakMap(), N = new WeakMap();
54
+ var p, S, A, C, k, B, y, L, H, x, W, D, G, R, J, F, Q, I, U, K, ot, $, V, Y;
55
+ class Et {
56
56
  constructor(t) {
57
- n(this, R);
58
- n(this, B);
59
- n(this, W);
60
- n(this, F);
61
- n(this, K);
62
- n(this, q);
63
- n(this, a, null);
64
- n(this, k, null);
65
- n(this, A, null);
66
- n(this, C, null);
67
- n(this, x, []);
68
- n(this, O, new DOMParser());
69
- n(this, w, /* @__PURE__ */ new Map());
70
- n(this, v, void 0);
71
- n(this, M, null);
72
- n(this, D, new _());
73
- n(this, m, new _());
74
- n(this, Y, (t) => {
57
+ o(this, D);
58
+ o(this, R);
59
+ o(this, F);
60
+ o(this, I);
61
+ o(this, K);
62
+ o(this, $);
63
+ o(this, p, null);
64
+ o(this, S, null);
65
+ o(this, A, null);
66
+ o(this, C, null);
67
+ o(this, k, []);
68
+ o(this, B, new DOMParser());
69
+ o(this, y, /* @__PURE__ */ new Map());
70
+ o(this, L, void 0);
71
+ o(this, H, null);
72
+ o(this, x, new nt());
73
+ o(this, W, new nt());
74
+ o(this, Y, (t) => {
75
75
  t.state && this.navigate(t.state, "none");
76
76
  });
77
- st && (r(this, a, (t == null ? void 0 : t.base) || "/"), t != null && t.base ? (r(this, a, t.base), t.base.endsWith("/") || r(this, a, i(this, a) + "/")) : r(this, a, "/"), r(this, k, (t == null ? void 0 : t.waitForHeadToLoad) !== !1), r(this, A, (t == null ? void 0 : t.cachePages) !== !1), r(this, C, d(this, F, Q).call(this, document)), r(this, M, location.pathname), d(this, W, J).call(this), addEventListener("popstate", i(this, Y)));
77
+ ut && (c(this, p, (t == null ? void 0 : t.base) || "/"), t != null && t.base ? (c(this, p, t.base), t.base.endsWith("/") || c(this, p, s(this, p) + "/")) : c(this, p, "/"), c(this, S, (t == null ? void 0 : t.waitForHeadToLoad) !== !1), c(this, A, (t == null ? void 0 : t.cachePages) !== !1), c(this, C, f(this, I, U).call(this, document)), c(this, H, location.pathname), f(this, F, Q).call(this), addEventListener("popstate", s(this, Y)));
78
78
  }
79
79
  beforeNavigationEvent(t) {
80
- return i(this, D).subscribe(t);
80
+ return s(this, x).subscribe(t);
81
81
  }
82
82
  afterNavigationEvent(t) {
83
- return i(this, m).subscribe(t);
83
+ return s(this, W).subscribe(t);
84
84
  }
85
85
  prefetch(t) {
86
86
  return T(this, null, function* () {
87
- return d(this, R, G).call(this, t);
87
+ const e = f(this, R, J).call(this, t);
88
+ return f(this, D, G).call(this, e.pathname);
88
89
  });
89
90
  }
90
91
  navigate(t, e = "push") {
91
92
  return T(this, null, function* () {
92
- var c;
93
- if (t = d(this, B, $).call(this, t), i(this, v) === t || i(this, M) === t)
93
+ var l;
94
+ const r = f(this, R, J).call(this, t);
95
+ let { pathname: i, hash: a, parameters: v } = r;
96
+ if (s(this, L) === i || s(this, H) === i)
94
97
  return;
95
- r(this, v, t);
96
- const o = i(this, w).has(t);
98
+ c(this, L, i);
99
+ const d = s(this, y).has(i);
97
100
  try {
98
- let l = !0;
99
- if (this.preprocessor)
101
+ let m = !0;
102
+ if (s(this, x).notify({
103
+ pathname: i,
104
+ isCached: d
105
+ }), this.preprocessor)
100
106
  try {
101
- yield new Promise((h, b) => {
102
- var I;
103
- (I = this.preprocessor) == null || I.call(this, { pathname: t, resolve: h, reject: b, isCached: o });
107
+ yield new Promise((h, g) => {
108
+ var E;
109
+ (E = this.preprocessor) == null || E.call(this, { pathname: i, resolve: h, reject: g, isCached: d });
104
110
  });
105
111
  } catch (h) {
106
- h ? console.error(h) : console.log("Route change canceled"), l = !1;
112
+ h ? console.error(h) : console.log("Route change canceled"), m = !1;
107
113
  }
108
- if (i(this, D).notify({
109
- pathname: t,
110
- isCached: o
111
- }), !l || i(this, v) !== t)
114
+ if (!m || s(this, L) !== i)
112
115
  return;
113
- const y = i(this, w).get(t) || (yield d(this, R, G).call(this, t));
114
- if (i(this, v) !== t)
116
+ const X = s(this, y).get(i) || (yield f(this, D, G).call(this, i));
117
+ if (s(this, L) !== i)
115
118
  return;
116
- const g = Array.from(document.head.children), f = Array.from(
117
- y.head.cloneNode(!0).children
118
- ), L = d(this, K, p).call(this, g, f), tt = d(this, q, U).call(this, g, L), V = d(this, q, U).call(this, f, L);
119
- tt.forEach((h) => h.remove()), V.forEach((h) => document.head.appendChild(h));
120
- const j = V.filter(
119
+ const Z = Array.from(document.head.children), _ = Array.from(
120
+ X.head.cloneNode(!0).children
121
+ ), tt = f(this, K, ot).call(this, Z, _), rt = f(this, $, V).call(this, Z, tt), q = f(this, $, V).call(this, _, tt);
122
+ rt.forEach((h) => {
123
+ h.remove();
124
+ }), q.forEach((h, g) => {
125
+ if (h.tagName === "SCRIPT" && h.getAttribute("src")) {
126
+ const E = document.createElement("script");
127
+ E.type = "module", E.src = h.getAttribute("src"), q[g] = E;
128
+ }
129
+ }), q.forEach((h, g) => {
130
+ document.head.appendChild(h);
131
+ });
132
+ const j = q.filter(
121
133
  (h) => h.tagName === "STYLE" || h.tagName === "SCRIPT" || h.tagName === "LINK"
122
134
  );
123
- i(this, k) && j.length && (yield new Promise((h) => T(this, null, function* () {
124
- let b = 0;
135
+ s(this, S) && j.length && (yield new Promise((h) => T(this, null, function* () {
136
+ let g = 0;
125
137
  try {
126
- for (var I = Z(j), dt, at, gt; dt = !(at = yield I.next()).done; dt = !1) {
127
- const it = at.value;
128
- it.onload = () => {
129
- b++, b === j.length && h();
138
+ for (var E = it(j), wt, yt, bt; wt = !(yt = yield E.next()).done; wt = !1) {
139
+ const lt = yt.value;
140
+ lt.onload = () => {
141
+ g++, g === j.length && h();
130
142
  };
131
143
  }
132
- } catch (at) {
133
- gt = [at];
144
+ } catch (yt) {
145
+ bt = [yt];
134
146
  } finally {
135
147
  try {
136
- dt && (at = I.return) && (yield at.call(I));
148
+ wt && (yt = E.return) && (yield yt.call(E));
137
149
  } finally {
138
- if (gt)
139
- throw gt[0];
150
+ if (bt)
151
+ throw bt[0];
140
152
  }
141
153
  }
142
- })));
143
- const et = d(this, F, Q).call(this, y);
144
- i(this, C).forEach((h, b) => {
145
- const I = et[b];
146
- h.innerHTML = I.innerHTML;
147
- }), r(this, M, t), e === "push" ? history.pushState(t, "", t + location.search) : e === "replace" && history.replaceState(t, "", t + location.search), d(this, W, J).call(this), (c = this.postprocessor) == null || c.call(this, { pathname: t, isCached: o }), i(this, m).notify({ pathname: t, isCached: o });
148
- } catch (l) {
149
- console.error(l);
154
+ }))), c(this, H, i);
155
+ const O = v || location.search, ht = a ? a.startsWith("#") ? a : "#" + a : "", ct = O ? O.startsWith("?") ? O : "?" + O : "", et = `${i}${ht}${ct}`;
156
+ e === "push" ? history.pushState(i, "", et) : e === "replace" && history.replaceState(i, "", et);
157
+ const at = f(this, I, U).call(this, X);
158
+ s(this, C).forEach((h, g) => {
159
+ const E = at[g];
160
+ h.innerHTML = E.innerHTML;
161
+ }), f(this, F, Q).call(this), (l = this.postprocessor) == null || l.call(this, { pathname: i, isCached: d }), s(this, W).notify({ pathname: i, isCached: d });
162
+ } catch (m) {
163
+ console.error(m);
150
164
  }
151
- r(this, v, void 0);
165
+ c(this, L, void 0);
152
166
  });
153
167
  }
154
168
  }
155
- a = new WeakMap(), k = new WeakMap(), A = new WeakMap(), C = new WeakMap(), x = new WeakMap(), O = new WeakMap(), w = new WeakMap(), v = new WeakMap(), M = new WeakMap(), D = new WeakMap(), m = new WeakMap(), R = new WeakSet(), G = function(t) {
169
+ p = new WeakMap(), S = new WeakMap(), A = new WeakMap(), C = new WeakMap(), k = new WeakMap(), B = new WeakMap(), y = new WeakMap(), L = new WeakMap(), H = new WeakMap(), x = new WeakMap(), W = new WeakMap(), D = new WeakSet(), G = function(t) {
156
170
  return T(this, null, function* () {
157
- const e = i(this, w).get(t);
171
+ const e = s(this, y).get(t);
158
172
  if (e)
159
173
  return e;
160
- const c = yield (yield fetch(t)).text(), l = i(this, O).parseFromString(c, "text/html");
161
- return i(this, A) && i(this, w).set(t, l), l;
174
+ const i = yield (yield fetch(t)).text(), a = s(this, B).parseFromString(i, "text/html");
175
+ return s(this, A) && s(this, y).set(t, a), a;
162
176
  });
163
- }, B = new WeakSet(), $ = function(t) {
164
- return t = t.replace(i(this, a), ""), t.startsWith("/") && (t = t.slice(1)), i(this, a) + t;
165
- }, W = new WeakSet(), J = function() {
177
+ }, R = new WeakSet(), J = function(t) {
178
+ t = t.replace(s(this, p), ""), t.startsWith("/") && (t = t.slice(1));
179
+ const e = t.split("#"), r = e[0].split("?"), i = s(this, p) + r[0], a = r == null ? void 0 : r[1], v = e == null ? void 0 : e[1];
180
+ return {
181
+ pathname: i,
182
+ parameters: a,
183
+ hash: v
184
+ };
185
+ }, F = new WeakSet(), Q = function() {
166
186
  const t = [
167
187
  ...document.documentElement.querySelectorAll("a")
168
188
  ].filter((e) => {
169
- var o;
170
- return (o = e.getAttribute("href")) == null ? void 0 : o.startsWith("/");
189
+ var r;
190
+ return (r = e.getAttribute("href")) == null ? void 0 : r.startsWith("/");
171
191
  });
172
- i(this, x).forEach((e) => e.destroy()), r(this, x, t.map((e) => new nt(e, this)));
173
- }, F = new WeakSet(), Q = function(t) {
192
+ s(this, k).forEach((e) => e.destroy()), c(this, k, t.map(
193
+ (e) => new ft(e, this, s(this, p))
194
+ ));
195
+ }, I = new WeakSet(), U = function(t) {
174
196
  const e = t.querySelectorAll("[data-morph]");
175
197
  return e.length ? [...e] : [t.body];
176
- }, K = new WeakSet(), p = function(t, e) {
198
+ }, K = new WeakSet(), ot = function(t, e) {
177
199
  return t.filter(
178
- (o) => e.find(
179
- (c) => c.outerHTML === o.outerHTML
200
+ (r) => e.find(
201
+ (i) => i.outerHTML === r.outerHTML
180
202
  )
181
203
  );
182
- }, q = new WeakSet(), U = function(t, e) {
204
+ }, $ = new WeakSet(), V = function(t, e) {
183
205
  return t.filter(
184
- (o) => !e.find(
185
- (c) => c.outerHTML === o.outerHTML
206
+ (r) => !e.find(
207
+ (i) => i.outerHTML === r.outerHTML
186
208
  )
187
209
  );
188
210
  }, Y = new WeakMap();
189
211
  export {
190
- lt as Morph
212
+ Et as Morph
191
213
  };