aptechka 0.4.14 → 0.4.15

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();
@@ -23,5 +23,5 @@ export declare class Morph {
23
23
  beforeNavigationEvent(callback: MorphNavigationCallback): () => void;
24
24
  afterNavigationEvent(callback: MorphNavigationCallback): () => void;
25
25
  prefetch(pathname: string): Promise<Document>;
26
- navigate(pathname: string, historyAction?: MorphHistoryAction): Promise<void>;
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 et=(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 P=(n,t,e)=>new Promise((o,i)=>{var a=l=>{try{f(e.next(l))}catch(g){i(g)}},w=l=>{try{f(e.throw(l))}catch(g){i(g)}},f=l=>l.done?o(l.value):Promise.resolve(l.value).then(a,w);f((e=e.apply(n,t)).next())});var st=(n,t,e)=>(t=n[et("asyncIterator")])?t.call(n):(n=n[et("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(g=>w({value:g,done:l}),f)))),e("next"),e("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const it=require("../notifier/index.cjs"),ut=require("../browser-CpzFX2xg.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");var y,u,L,T,H,S;class dt{constructor(t,e){r(this,y,void 0);r(this,u,void 0);r(this,L,void 0);r(this,T,void 0);r(this,H,t=>{t.preventDefault(),s(this,y).navigate(s(this,L),s(this,T))});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,T,s(this,u).getAttribute("data-history-action")||"push"),s(this,u).addEventListener("click",s(this,H)),s(this,L)===location.pathname&&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,H)),s(this,u).removeEventListener("pointerenter",s(this,S)),s(this,u).classList.remove("current")}}y=new WeakMap,u=new WeakMap,L=new WeakMap,T=new WeakMap,H=new WeakMap,S=new WeakMap;var p,N,A,C,k,$,b,v,M,x,W,q,z,j,nt,D,G,R,J,B,rt,F,Q,K;class ft{constructor(t){r(this,q);r(this,j);r(this,D);r(this,R);r(this,B);r(this,F);r(this,p,null);r(this,N,null);r(this,A,null);r(this,C,null);r(this,k,[]);r(this,$,new DOMParser);r(this,b,new Map);r(this,v,void 0);r(this,M,null);r(this,x,new it.Notifier);r(this,W,new it.Notifier);r(this,K,t=>{t.state&&this.navigate(t.state,"none")});ut.isBrowser&&(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,N,(t==null?void 0:t.waitForHeadToLoad)!==!1),c(this,A,(t==null?void 0:t.cachePages)!==!1),c(this,C,d(this,R,J).call(this,document)),c(this,M,location.pathname),d(this,D,G).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 P(this,null,function*(){return d(this,q,z).call(this,t)})}navigate(t,e="push"){return P(this,null,function*(){var l;const o=d(this,j,nt).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 g=!0;if(s(this,x).notify({pathname:i,isCached:f}),this.preprocessor)try{yield new Promise((h,m)=>{var E;(E=this.preprocessor)==null||E.call(this,{pathname:i,resolve:h,reject:m,isCached:f})})}catch(h){h?console.error(h):console.log("Route change canceled"),g=!1}if(!g||s(this,v)!==i)return;const U=s(this,b).get(i)||(yield d(this,q,z).call(this,i));if(s(this,v)!==i)return;const V=Array.from(document.head.children),X=Array.from(U.head.cloneNode(!0).children),Z=d(this,B,rt).call(this,V,X),ot=d(this,F,Q).call(this,V,Z),I=d(this,F,Q).call(this,X,Z);ot.forEach(h=>{h.remove()}),I.forEach((h,m)=>{if(h.tagName==="SCRIPT"&&h.getAttribute("src")){const E=document.createElement("script");E.type="module",E.src=h.getAttribute("src"),I[m]=E}}),I.forEach((h,m)=>{document.head.appendChild(h)});const Y=I.filter(h=>h.tagName==="STYLE"||h.tagName==="SCRIPT"||h.tagName==="LINK");s(this,N)&&Y.length&&(yield new Promise(h=>P(this,null,function*(){let m=0;try{for(var E=st(Y),pt,Et,vt;pt=!(Et=yield E.next()).done;pt=!1){const lt=Et.value;lt.onload=()=>{m++,m===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 O=w||location.search,ht=a?a.startsWith("#")?a:"#"+a:"",ct=O?O.startsWith("?")?O:"?"+O:"",tt=`${i}${ht}${ct}`;e==="push"?history.pushState(i,"",tt):e==="replace"&&history.replaceState(i,"",tt);const at=d(this,R,J).call(this,U);s(this,C).forEach((h,m)=>{const E=at[m];h.innerHTML=E.innerHTML}),d(this,D,G).call(this),(l=this.postprocessor)==null||l.call(this,{pathname:i,isCached:f}),s(this,W).notify({pathname:i,isCached:f})}catch(g){console.error(g)}c(this,v,void 0)})}}p=new WeakMap,N=new WeakMap,A=new WeakMap,C=new WeakMap,k=new WeakMap,$=new WeakMap,b=new WeakMap,v=new WeakMap,M=new WeakMap,x=new WeakMap,W=new WeakMap,q=new WeakSet,z=function(t){return P(this,null,function*(){const e=s(this,b).get(t);if(e)return e;const i=yield(yield fetch(t)).text(),a=s(this,$).parseFromString(i,"text/html");return s(this,A)&&s(this,b).set(t,a),a})},j=new WeakSet,nt=function(t){t=t.replace(s(this,p),""),t.startsWith("/")&&(t=t.slice(1));const e=t.split("#"),o=e[0].split("?"),i=s(this,p)+o[0],a=o==null?void 0:o[1],w=e==null?void 0:e[1];return{pathname:i,parameters:a,hash:w}},D=new WeakSet,G=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)))},R=new WeakSet,J=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))},F=new WeakSet,Q=function(t,e){return t.filter(o=>!e.find(i=>i.outerHTML===o.outerHTML))},K=new WeakMap;exports.Morph=ft;
@@ -1,191 +1,210 @@
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 et = (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 P = (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 st = (n, t, e) => (t = n[et("asyncIterator")]) ? t.call(n) : (n = n[et("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 it } 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 {
32
+ var b, u, w, T, M, N;
33
+ class ft {
34
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));
35
+ o(this, b, void 0);
36
+ o(this, u, void 0);
37
+ o(this, w, void 0);
38
+ o(this, T, void 0);
39
+ o(this, M, (t) => {
40
+ t.preventDefault(), s(this, b).navigate(s(this, w), s(this, T));
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, T, 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, M)), s(this, w) === location.pathname && 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, M)), 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(), T = new WeakMap(), M = new WeakMap(), N = new WeakMap();
54
+ var p, S, A, C, k, O, y, L, H, x, W, D, G, B, nt, R, J, F, Q, K, ot, I, U, 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, B);
59
+ o(this, R);
60
+ o(this, F);
61
+ o(this, K);
62
+ o(this, I);
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, O, 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 it());
73
+ o(this, W, new it());
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, F, Q).call(this, document)), c(this, H, location.pathname), f(this, R, J).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
- return T(this, null, function* () {
87
- return d(this, R, G).call(this, t);
86
+ return P(this, null, function* () {
87
+ return f(this, D, G).call(this, t);
88
88
  });
89
89
  }
90
90
  navigate(t, e = "push") {
91
- 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)
91
+ return P(this, null, function* () {
92
+ var l;
93
+ const r = f(this, B, nt).call(this, t);
94
+ let { pathname: i, hash: a, parameters: v } = r;
95
+ if (s(this, L) === i || s(this, H) === i)
94
96
  return;
95
- r(this, v, t);
96
- const o = i(this, w).has(t);
97
+ c(this, L, i);
98
+ const d = s(this, y).has(i);
97
99
  try {
98
- let l = !0;
99
- if (this.preprocessor)
100
+ let m = !0;
101
+ if (s(this, x).notify({
102
+ pathname: i,
103
+ isCached: d
104
+ }), this.preprocessor)
100
105
  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 });
106
+ yield new Promise((h, g) => {
107
+ var E;
108
+ (E = this.preprocessor) == null || E.call(this, { pathname: i, resolve: h, reject: g, isCached: d });
104
109
  });
105
110
  } catch (h) {
106
- h ? console.error(h) : console.log("Route change canceled"), l = !1;
111
+ h ? console.error(h) : console.log("Route change canceled"), m = !1;
107
112
  }
108
- if (i(this, D).notify({
109
- pathname: t,
110
- isCached: o
111
- }), !l || i(this, v) !== t)
113
+ if (!m || s(this, L) !== i)
112
114
  return;
113
- const y = i(this, w).get(t) || (yield d(this, R, G).call(this, t));
114
- if (i(this, v) !== t)
115
+ const V = s(this, y).get(i) || (yield f(this, D, G).call(this, i));
116
+ if (s(this, L) !== i)
115
117
  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(
118
+ const X = Array.from(document.head.children), Z = Array.from(
119
+ V.head.cloneNode(!0).children
120
+ ), _ = f(this, K, ot).call(this, X, Z), rt = f(this, I, U).call(this, X, _), $ = f(this, I, U).call(this, Z, _);
121
+ rt.forEach((h) => {
122
+ h.remove();
123
+ }), $.forEach((h, g) => {
124
+ if (h.tagName === "SCRIPT" && h.getAttribute("src")) {
125
+ const E = document.createElement("script");
126
+ E.type = "module", E.src = h.getAttribute("src"), $[g] = E;
127
+ }
128
+ }), $.forEach((h, g) => {
129
+ document.head.appendChild(h);
130
+ });
131
+ const j = $.filter(
121
132
  (h) => h.tagName === "STYLE" || h.tagName === "SCRIPT" || h.tagName === "LINK"
122
133
  );
123
- i(this, k) && j.length && (yield new Promise((h) => T(this, null, function* () {
124
- let b = 0;
134
+ s(this, S) && j.length && (yield new Promise((h) => P(this, null, function* () {
135
+ let g = 0;
125
136
  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();
137
+ for (var E = st(j), wt, yt, bt; wt = !(yt = yield E.next()).done; wt = !1) {
138
+ const lt = yt.value;
139
+ lt.onload = () => {
140
+ g++, g === j.length && h();
130
141
  };
131
142
  }
132
- } catch (at) {
133
- gt = [at];
143
+ } catch (yt) {
144
+ bt = [yt];
134
145
  } finally {
135
146
  try {
136
- dt && (at = I.return) && (yield at.call(I));
147
+ wt && (yt = E.return) && (yield yt.call(E));
137
148
  } finally {
138
- if (gt)
139
- throw gt[0];
149
+ if (bt)
150
+ throw bt[0];
140
151
  }
141
152
  }
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);
153
+ }))), c(this, H, i);
154
+ const q = v || location.search, ht = a ? a.startsWith("#") ? a : "#" + a : "", ct = q ? q.startsWith("?") ? q : "?" + q : "", tt = `${i}${ht}${ct}`;
155
+ e === "push" ? history.pushState(i, "", tt) : e === "replace" && history.replaceState(i, "", tt);
156
+ const at = f(this, F, Q).call(this, V);
157
+ s(this, C).forEach((h, g) => {
158
+ const E = at[g];
159
+ h.innerHTML = E.innerHTML;
160
+ }), f(this, R, J).call(this), (l = this.postprocessor) == null || l.call(this, { pathname: i, isCached: d }), s(this, W).notify({ pathname: i, isCached: d });
161
+ } catch (m) {
162
+ console.error(m);
150
163
  }
151
- r(this, v, void 0);
164
+ c(this, L, void 0);
152
165
  });
153
166
  }
154
167
  }
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) {
156
- return T(this, null, function* () {
157
- const e = i(this, w).get(t);
168
+ p = new WeakMap(), S = new WeakMap(), A = new WeakMap(), C = new WeakMap(), k = new WeakMap(), O = new WeakMap(), y = new WeakMap(), L = new WeakMap(), H = new WeakMap(), x = new WeakMap(), W = new WeakMap(), D = new WeakSet(), G = function(t) {
169
+ return P(this, null, function* () {
170
+ const e = s(this, y).get(t);
158
171
  if (e)
159
172
  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;
173
+ const i = yield (yield fetch(t)).text(), a = s(this, O).parseFromString(i, "text/html");
174
+ return s(this, A) && s(this, y).set(t, a), a;
162
175
  });
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() {
176
+ }, B = new WeakSet(), nt = function(t) {
177
+ t = t.replace(s(this, p), ""), t.startsWith("/") && (t = t.slice(1));
178
+ 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];
179
+ return {
180
+ pathname: i,
181
+ parameters: a,
182
+ hash: v
183
+ };
184
+ }, R = new WeakSet(), J = function() {
166
185
  const t = [
167
186
  ...document.documentElement.querySelectorAll("a")
168
187
  ].filter((e) => {
169
- var o;
170
- return (o = e.getAttribute("href")) == null ? void 0 : o.startsWith("/");
188
+ var r;
189
+ return (r = e.getAttribute("href")) == null ? void 0 : r.startsWith("/");
171
190
  });
172
- i(this, x).forEach((e) => e.destroy()), r(this, x, t.map((e) => new nt(e, this)));
191
+ s(this, k).forEach((e) => e.destroy()), c(this, k, t.map((e) => new ft(e, this)));
173
192
  }, F = new WeakSet(), Q = function(t) {
174
193
  const e = t.querySelectorAll("[data-morph]");
175
194
  return e.length ? [...e] : [t.body];
176
- }, K = new WeakSet(), p = function(t, e) {
195
+ }, K = new WeakSet(), ot = function(t, e) {
177
196
  return t.filter(
178
- (o) => e.find(
179
- (c) => c.outerHTML === o.outerHTML
197
+ (r) => e.find(
198
+ (i) => i.outerHTML === r.outerHTML
180
199
  )
181
200
  );
182
- }, q = new WeakSet(), U = function(t, e) {
201
+ }, I = new WeakSet(), U = function(t, e) {
183
202
  return t.filter(
184
- (o) => !e.find(
185
- (c) => c.outerHTML === o.outerHTML
203
+ (r) => !e.find(
204
+ (i) => i.outerHTML === r.outerHTML
186
205
  )
187
206
  );
188
207
  }, Y = new WeakMap();
189
208
  export {
190
- lt as Morph
209
+ Et as Morph
191
210
  };