@manyducks.co/dolla 2.0.0-alpha.11 → 2.0.0-alpha.13

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.
package/dist/index.js CHANGED
@@ -1,22 +1,22 @@
1
- var wt = Object.defineProperty;
2
- var tt = (a) => {
3
- throw TypeError(a);
1
+ var kt = Object.defineProperty;
2
+ var st = (i) => {
3
+ throw TypeError(i);
4
4
  };
5
- var bt = (a, e, t) => e in a ? wt(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
6
- var k = (a, e, t) => bt(a, typeof e != "symbol" ? e + "" : e, t), Ge = (a, e, t) => e.has(a) || tt("Cannot " + t);
7
- var n = (a, e, t) => (Ge(a, e, "read from private field"), t ? t.call(a) : e.get(a)), f = (a, e, t) => e.has(a) ? tt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(a) : e.set(a, t), y = (a, e, t, r) => (Ge(a, e, "write to private field"), r ? r.call(a, t) : e.set(a, t), t), P = (a, e, t) => (Ge(a, e, "access private method"), t);
8
- var rt = (a, e, t, r) => ({
9
- set _(i) {
10
- y(a, e, i, t);
5
+ var Et = (i, e, t) => e in i ? kt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
6
+ var P = (i, e, t) => Et(i, typeof e != "symbol" ? e + "" : e, t), Be = (i, e, t) => e.has(i) || st("Cannot " + t);
7
+ var s = (i, e, t) => (Be(i, e, "read from private field"), t ? t.call(i) : e.get(i)), f = (i, e, t) => e.has(i) ? st("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, t), b = (i, e, t, r) => (Be(i, e, "write to private field"), r ? r.call(i, t) : e.set(i, t), t), k = (i, e, t) => (Be(i, e, "access private method"), t);
8
+ var it = (i, e, t, r) => ({
9
+ set _(a) {
10
+ b(i, e, a, t);
11
11
  },
12
12
  get _() {
13
- return n(a, e, r);
13
+ return s(i, e, r);
14
14
  }
15
15
  });
16
- import { h as nt, c as vt, i as Be, t as Ke, d as me, a as $t, b as et, e as U, f as Q, g as ct, j as Et, w as ut, P as ht, k as at, l as kt, m as Pt, v as St, n as Lt, o as Rt, p as st, q as it, r as xt, s as Ae, u as De, x as Mt, y as Nt, z as Ot } from "./passthrough-Bu7iYKPr.js";
17
- import { A as ar, B as sr, C as ir } from "./passthrough-Bu7iYKPr.js";
18
- function Tt(a) {
19
- return nt`
16
+ import { h as ot, c as Pt, i as Ke, t as Qe, d as ye, a as St, b as at, e as F, f as lt, g as ie, j as pt, k as Rt, w as gt, P as mt, l as ct, m as xt, n as Lt, v as Nt, o as Ot, p as Mt, q as ut, r as ht, s as Tt, u as Ae, x as De, y as jt, z as At, A as Dt } from "./passthrough-Bz5ZF4jn.js";
17
+ import { B as cr, C as ur, D as hr } from "./passthrough-Bz5ZF4jn.js";
18
+ function _t(i) {
19
+ return ot`
20
20
  <div
21
21
  style=${{
22
22
  backgroundColor: "#880000",
@@ -29,8 +29,8 @@ function Tt(a) {
29
29
  >
30
30
  <h1 style=${{ marginBottom: "0.5rem" }}>The app has crashed</h1>
31
31
  <p style=${{ marginBottom: "0.25rem" }}>
32
- <span style=${{ fontFamily: "monospace" }}>${a.loggerName}</span>
33
- ${vt(a.uid, nt`<span style=${{ fontFamily: "monospace", opacity: 0.5 }}> [uid: ${a.uid}]</span>`)}
32
+ <span style=${{ fontFamily: "monospace" }}>${i.loggerName}</span>
33
+ ${Pt(i.uid, ot`<span style=${{ fontFamily: "monospace", opacity: 0.5 }}> [uid: ${i.uid}]</span>`)}
34
34
  ${" "}says:
35
35
  </p>
36
36
  <blockquote
@@ -53,21 +53,21 @@ function Tt(a) {
53
53
  fontWeight: "bold"
54
54
  }}
55
55
  >
56
- ${a.error.name}
56
+ ${i.error.name}
57
57
  </span>
58
- ${a.error.message}
58
+ ${i.error.message}
59
59
  </blockquote>
60
60
 
61
61
  <p>Please see the browser console for details.</p>
62
62
  </div>
63
63
  `;
64
64
  }
65
- var J, We, T, j;
66
- class At {
65
+ var Y, Ge, T, _;
66
+ class Ct {
67
67
  constructor() {
68
68
  f(this, T);
69
- f(this, J, []);
70
- f(this, We, Dt());
69
+ f(this, Y, []);
70
+ f(this, Ge, Vt());
71
71
  }
72
72
  /**
73
73
  * Adds a new middleware that will apply to subsequent requests.
@@ -76,229 +76,303 @@ class At {
76
76
  * @param middleware - A middleware function that will intercept requests.
77
77
  */
78
78
  use(e) {
79
- return n(this, J).push(e), () => {
80
- n(this, J).splice(n(this, J).indexOf(e), 1);
79
+ return s(this, Y).push(e), () => {
80
+ s(this, Y).splice(s(this, Y).indexOf(e), 1);
81
81
  };
82
82
  }
83
83
  async get(e, t) {
84
- return P(this, T, j).call(this, "get", e, t);
84
+ return k(this, T, _).call(this, "get", e, t);
85
85
  }
86
86
  async put(e, t) {
87
- return P(this, T, j).call(this, "put", e, t);
87
+ return k(this, T, _).call(this, "put", e, t);
88
88
  }
89
89
  async patch(e, t) {
90
- return P(this, T, j).call(this, "patch", e, t);
90
+ return k(this, T, _).call(this, "patch", e, t);
91
91
  }
92
92
  async post(e, t) {
93
- return P(this, T, j).call(this, "post", e, t);
93
+ return k(this, T, _).call(this, "post", e, t);
94
94
  }
95
95
  async delete(e, t) {
96
- return P(this, T, j).call(this, "delete", e, t);
96
+ return k(this, T, _).call(this, "delete", e, t);
97
97
  }
98
98
  async head(e, t) {
99
- return P(this, T, j).call(this, "head", e, t);
99
+ return k(this, T, _).call(this, "head", e, t);
100
100
  }
101
101
  async options(e, t) {
102
- return P(this, T, j).call(this, "options", e, t);
102
+ return k(this, T, _).call(this, "options", e, t);
103
103
  }
104
104
  async trace(e, t) {
105
- return P(this, T, j).call(this, "trace", e, t);
105
+ return k(this, T, _).call(this, "trace", e, t);
106
106
  }
107
107
  }
108
- J = new WeakMap(), We = new WeakMap(), T = new WeakSet(), j = async function(e, t, r) {
109
- return jt({
108
+ Y = new WeakMap(), Ge = new WeakMap(), T = new WeakSet(), _ = async function(e, t, r) {
109
+ return qt({
110
110
  ...r,
111
111
  method: e,
112
112
  uri: t,
113
- middleware: n(this, J),
114
- fetch: n(this, We)
113
+ middleware: s(this, Y),
114
+ fetch: s(this, Ge)
115
115
  });
116
116
  };
117
- function Dt() {
117
+ function Vt() {
118
118
  if (typeof window < "u" && window.fetch)
119
119
  return window.fetch.bind(window);
120
120
  if (typeof global < "u" && global.fetch)
121
121
  return global.fetch.bind(global);
122
122
  throw new Error("Running in neither browser nor node. Please run this app in one of the supported environments.");
123
123
  }
124
- class Ct extends Error {
124
+ class Ft extends Error {
125
125
  constructor(t) {
126
- const { status: r, statusText: i, method: s, uri: o } = t, u = `${r} ${i}: Request failed (${s.toUpperCase()} ${o})`;
126
+ const { status: r, statusText: a, method: n, uri: o } = t, u = `${r} ${a}: Request failed (${n.toUpperCase()} ${o})`;
127
127
  super(u);
128
- k(this, "response");
128
+ P(this, "response");
129
129
  this.response = t;
130
130
  }
131
131
  }
132
- async function jt(a) {
133
- const { headers: e, query: t, fetch: r, middleware: i } = a, s = {
134
- method: a.method,
135
- uri: a.uri,
132
+ async function qt(i) {
133
+ const { headers: e, query: t, fetch: r, middleware: a } = i, n = {
134
+ method: i.method,
135
+ uri: i.uri,
136
136
  get sameOrigin() {
137
- return !s.uri.startsWith("http");
137
+ return !n.uri.startsWith("http");
138
138
  },
139
139
  query: new URLSearchParams(),
140
140
  headers: new Headers(),
141
- body: a.body
141
+ body: i.body
142
142
  };
143
143
  if (e)
144
144
  if (e instanceof Map || e instanceof Headers)
145
- e.forEach((l, w) => {
146
- s.headers.set(w, l);
145
+ e.forEach((l, g) => {
146
+ n.headers.set(g, l);
147
147
  });
148
148
  else if (e != null && typeof e == "object" && !Array.isArray(e))
149
149
  for (const l in e) {
150
- const w = e[l];
151
- w instanceof Date ? s.headers.set(l, w.toISOString()) : w != null && s.headers.set(l, String(w));
150
+ const g = e[l];
151
+ g instanceof Date ? n.headers.set(l, g.toISOString()) : g != null && n.headers.set(l, String(g));
152
152
  }
153
153
  else
154
154
  throw new TypeError(`Unknown headers type. Got: ${e}`);
155
155
  if (t)
156
156
  if (t instanceof Map || t instanceof URLSearchParams)
157
- t.forEach((l, w) => {
158
- s.query.set(w, l);
157
+ t.forEach((l, g) => {
158
+ n.query.set(g, l);
159
159
  });
160
160
  else if (t != null && typeof t == "object" && !Array.isArray(t))
161
161
  for (const l in t) {
162
- const w = t[l];
163
- w instanceof Date ? s.query.set(l, w.toISOString()) : w != null && s.query.set(l, String(w));
162
+ const g = t[l];
163
+ g instanceof Date ? n.query.set(l, g.toISOString()) : g != null && n.query.set(l, String(g));
164
164
  }
165
165
  else
166
166
  throw new TypeError(`Unknown query params type. Got: ${t}`);
167
167
  let o;
168
168
  const u = async () => {
169
- const l = s.query.toString(), w = l.length > 0 ? s.uri + "?" + l : s.uri;
170
- let g;
171
- !s.headers.has("content-type") && Be(s.body) ? (s.headers.set("content-type", "application/json"), g = JSON.stringify(s.body)) : g = s.body;
172
- const b = await r(w, {
173
- method: s.method,
174
- headers: s.headers,
175
- body: g
176
- }), d = Object.fromEntries(b.headers.entries()), p = d["content-type"];
169
+ const l = n.query.toString(), g = l.length > 0 ? n.uri + "?" + l : n.uri;
170
+ let m;
171
+ !n.headers.has("content-type") && Ke(n.body) ? (n.headers.set("content-type", "application/json"), m = JSON.stringify(n.body)) : m = n.body;
172
+ const p = await r(g, {
173
+ method: n.method,
174
+ headers: n.headers,
175
+ body: m
176
+ }), h = Object.fromEntries(p.headers.entries()), y = h["content-type"];
177
177
  let S;
178
- p != null && p.includes("application/json") ? S = await b.json() : p != null && p.includes("application/x-www-form-urlencoded") ? S = await b.formData() : S = await b.text(), o = {
179
- method: s.method,
180
- uri: s.uri,
181
- status: b.status,
182
- statusText: b.statusText,
183
- headers: d,
178
+ y != null && y.includes("application/json") ? S = await p.json() : y != null && y.includes("application/x-www-form-urlencoded") ? S = await p.formData() : S = await p.text(), o = {
179
+ method: n.method,
180
+ uri: n.uri,
181
+ status: p.status,
182
+ statusText: p.statusText,
183
+ headers: h,
184
184
  body: S
185
185
  };
186
186
  };
187
- if (i.length > 0) {
188
- const l = (w = 0) => {
189
- const g = i[w], b = i[w + 1] ? l(w + 1) : u;
190
- return async () => g(s, async () => (await b(), o));
187
+ if (a.length > 0) {
188
+ const l = (g = 0) => {
189
+ const m = a[g], p = a[g + 1] ? l(g + 1) : u;
190
+ return async () => m(n, async () => (await p(), o));
191
191
  };
192
192
  await l()();
193
193
  } else
194
194
  await u();
195
195
  if (o.status < 200 || o.status >= 400)
196
- throw new Ct(o);
196
+ throw new Ft(o);
197
197
  return o;
198
198
  }
199
- const _t = Ke("[NO LANGUAGE SET]");
200
- class qt {
199
+ const Ut = Qe("[NO LANGUAGE SET]");
200
+ var We, oe, re, Je, wt;
201
+ class Ht {
201
202
  constructor(e, t) {
202
- k(this, "dolla");
203
- k(this, "config");
204
- k(this, "strings");
203
+ f(this, re);
204
+ P(this, "dolla");
205
+ P(this, "config");
206
+ f(this, We, !1);
207
+ f(this, oe, /* @__PURE__ */ new Map());
205
208
  this.config = e, this.dolla = t;
206
209
  }
207
210
  async load() {
208
- if (this.strings == null) {
209
- if (et(this.config.fetch)) {
210
- const e = await this.config.fetch();
211
- if (Be(e))
212
- this.strings = e;
213
- else
211
+ let e;
212
+ if (!s(this, We)) {
213
+ if (at(this.config.fetch)) {
214
+ if (e = await this.config.fetch(), !Ke(e))
214
215
  throw new Error(`Fetch function did not return an object of language strings: ${e}`);
215
- } else if (U(this.config.path)) {
216
- const e = await this.dolla.http.get(this.config.path);
217
- if (e.status >= 200 && e.status < 300)
218
- if (Be(e.body))
219
- this.strings = e.body;
216
+ } else if (F(this.config.path)) {
217
+ const t = await this.dolla.http.get(this.config.path);
218
+ if (t.status >= 200 && t.status < 300)
219
+ if (Ke(t.body))
220
+ e = t.body;
220
221
  else
221
222
  throw new Error(
222
- `Language path '${this.config.path}' did not return an object of language strings: ${e.body}`
223
+ `Language path '${this.config.path}' did not return an object of language strings: ${t.body}`
223
224
  );
224
225
  else
225
226
  throw new Error("HTTP request failed.");
226
227
  }
227
228
  }
228
- if (this.strings == null)
229
+ if (e == null)
229
230
  throw new Error("Language could not be loaded.");
230
- return this.strings;
231
+ {
232
+ const t = k(this, re, Je).call(this, e);
233
+ for (const r of t)
234
+ s(this, oe).set(r[0], r[1]);
235
+ }
236
+ }
237
+ getTemplate(e) {
238
+ return s(this, oe).get(e) ?? null;
239
+ }
240
+ hasTemplate(e) {
241
+ return s(this, oe).has(e);
231
242
  }
232
243
  }
233
- var we, Y, x, se, be, ve, $e, Ee, O, Qe, ft, dt, pt, gt;
234
- class Ut {
244
+ We = new WeakMap(), oe = new WeakMap(), re = new WeakSet(), Je = function(e, t = []) {
245
+ const r = [];
246
+ for (const a in e)
247
+ switch (lt(e[a])) {
248
+ case "string":
249
+ r.push([[...t, a].join("."), k(this, re, wt).call(this, e[a])]);
250
+ break;
251
+ case "object":
252
+ r.push(...k(this, re, Je).call(this, e[a], [...t, a]));
253
+ break;
254
+ default:
255
+ throw new Error(
256
+ `Expected to find a string or object at ${[...t, a].join(".")}. Got: ${lt(e[a])}`
257
+ );
258
+ }
259
+ return r;
260
+ }, wt = function(e) {
261
+ let t;
262
+ ((h) => {
263
+ h[h.Static = 0] = "Static", h[h.ValueName = 1] = "ValueName", h[h.FormatName = 2] = "FormatName", h[h.FormatOptionName = 3] = "FormatOptionName", h[h.FormatOptionValue = 4] = "FormatOptionValue", h[h.FormatOptionEnd = 5] = "FormatOptionEnd";
264
+ })(t || (t = {}));
265
+ const r = {
266
+ segments: []
267
+ };
268
+ let a = "", n = 0, o = 0, u, l, g;
269
+ const m = () => {
270
+ u = {
271
+ type: 1,
272
+ name: "",
273
+ formats: []
274
+ };
275
+ }, p = () => {
276
+ l = {
277
+ name: "",
278
+ options: {}
279
+ };
280
+ };
281
+ for (; n < e.length; ) {
282
+ if (o !== 0 && e[n] === " ") {
283
+ n++;
284
+ continue;
285
+ }
286
+ switch (o) {
287
+ case 0:
288
+ e[n] === "{" && e[n + 1] === "{" ? (o = 1, n += 2, a.length > 0 && (r.segments.push({ type: 0, text: a }), a = ""), m()) : (a += e[n], n++);
289
+ break;
290
+ case 1:
291
+ e[n] === "|" ? (o = 2, n += 1, u.name = a, a = "", p()) : e[n] === "}" && e[n + 1] === "}" ? (o = 0, n += 2, u.name = a, a = "", r.segments.push(u)) : (a += e[n], n++);
292
+ break;
293
+ case 2:
294
+ e[n] === "(" ? (o = 3, n += 1, l.name = a, a = "") : e[n] === "}" && e[n + 1] === "}" ? (o = 0, n += 2, u.formats.push(l), r.segments.push(u)) : (a += e[n], n++);
295
+ break;
296
+ case 3:
297
+ e[n] === ")" || (e[n] === ":" ? (o = 4, n += 1, g = a, a = "") : e[n] === "}" && e[n + 1] === "}" || (a += e[n], n++));
298
+ break;
299
+ case 4:
300
+ e[n] === ")" ? (o = 5, n += 1, l.options[g] = a, a = "", u.formats.push(l)) : e[n] === "," ? (o = 3, n += 1, l.options[g] = a, a = "") : e[n] === "}" && e[n + 1] === "}" || (a += e[n], n++);
301
+ break;
302
+ case 5:
303
+ e[n] === "|" ? (o = 2, n += 1, p()) : e[n] === "}" && e[n + 1] === "}" && (o = 0, n += 2, r.segments.push(u));
304
+ break;
305
+ }
306
+ }
307
+ return o === 0 && a.length > 0 && r.segments.push({ type: 0, text: a }), r;
308
+ };
309
+ var ve, q, L, $e, U, ke, Ee, N, yt, Ye, Xe, Ze, bt;
310
+ class It {
235
311
  constructor(e) {
236
- f(this, O);
237
- f(this, we);
238
- f(this, Y);
239
- f(this, x, /* @__PURE__ */ new Map());
240
- f(this, se, []);
241
- f(this, be, "auto");
242
- k(this, "$locale");
312
+ f(this, N);
243
313
  f(this, ve);
244
- f(this, $e);
314
+ f(this, q);
315
+ f(this, L, /* @__PURE__ */ new Map());
316
+ f(this, $e, []);
317
+ f(this, U, /* @__PURE__ */ new Map());
318
+ f(this, ke, "auto");
319
+ P(this, "$locale");
245
320
  f(this, Ee);
246
- y(this, we, e), y(this, Y, e.createLogger("dolla/i18n"));
247
- const [t, r] = Q(), [i, s] = Q();
248
- this.$locale = t, y(this, ve, r), y(this, $e, i), y(this, Ee, s), e.beforeMount(async () => {
249
- n(this, x).size > 0 && await this.setLocale(n(this, be));
321
+ b(this, ve, e), b(this, q, e.createLogger("dolla/i18n"));
322
+ const [t, r] = ie();
323
+ this.$locale = t, b(this, Ee, r), s(this, U).set("number", (a, n, o) => k(this, N, Ye).call(this, Number(n), o)), s(this, U).set("datetime", (a, n, o) => k(this, N, Xe).call(this, n, o)), s(this, U).set("list", (a, n, o) => k(this, N, Ze).call(this, n, o)), e.beforeMount(async () => {
324
+ s(this, L).size > 0 && await this.setLocale(s(this, ke));
250
325
  });
251
326
  }
252
327
  get locales() {
253
- return [...n(this, x).keys()];
328
+ return [...s(this, L).keys()];
254
329
  }
255
330
  setup(e) {
256
331
  if (e.translations.forEach((t) => {
257
- n(this, x).set(t.locale, new qt(t, n(this, we)));
332
+ s(this, L).set(t.locale, new Ht(t, s(this, ve)));
258
333
  }), e.locale && e.locale !== "auto") {
259
334
  if (!e.translations.some((r) => r.locale === e.locale))
260
335
  throw new Error(`Initial locale '${e.locale}' is not registered in the locales array.`);
261
- y(this, be, e.locale);
336
+ b(this, ke, e.locale);
262
337
  }
263
- n(this, Y).info(
264
- `${n(this, x).size} language${n(this, x).size === 1 ? "" : "s"} supported: '${[...n(this, x).keys()].join("', '")}'`
338
+ s(this, q).info(
339
+ `${s(this, L).size} language${s(this, L).size === 1 ? "" : "s"} supported: '${[...s(this, L).keys()].join("', '")}'`
265
340
  );
266
341
  }
267
342
  async setLocale(e) {
268
- var i;
343
+ var a;
269
344
  let t;
270
345
  if (e === "auto") {
271
- let s = [];
346
+ let n = [];
272
347
  if (typeof navigator == "object") {
273
348
  const o = navigator;
274
- ((i = o.languages) == null ? void 0 : i.length) > 0 ? s.push(...o.languages) : o.language ? s.push(o.language) : o.browserLanguage ? s.push(o.browserLanguage) : o.userLanguage && s.push(o.userLanguage);
349
+ ((a = o.languages) == null ? void 0 : a.length) > 0 ? n.push(...o.languages) : o.language ? n.push(o.language) : o.browserLanguage ? n.push(o.browserLanguage) : o.userLanguage && n.push(o.userLanguage);
275
350
  }
276
- for (const o of s)
277
- n(this, x).has(o) && (t = o);
351
+ for (const o of n)
352
+ s(this, L).has(o) && (t = o);
278
353
  } else
279
- n(this, x).has(e) && (t = e);
354
+ s(this, L).has(e) && (t = e);
280
355
  if (t == null) {
281
- const s = n(this, x).keys().next().value;
282
- s && (t = s);
356
+ const n = s(this, L).keys().next().value;
357
+ n && (t = n);
283
358
  }
284
- if (!t || !n(this, x).has(t))
359
+ if (!t || !s(this, L).has(t))
285
360
  throw new Error(`Language '${e}' is not configured for this app.`);
286
- const r = n(this, x).get(t);
361
+ const r = s(this, L).get(t);
287
362
  try {
288
- const s = await r.load();
289
- y(this, se, []), n(this, Ee).call(this, s), n(this, ve).call(this, t), n(this, Y).info("set language to " + t);
290
- } catch (s) {
291
- s instanceof Error && n(this, Y).crash(s);
363
+ await r.load(), b(this, $e, []), s(this, Ee).call(this, t), s(this, q).info("set language to " + t);
364
+ } catch (n) {
365
+ n instanceof Error && s(this, q).crash(n);
292
366
  }
293
367
  }
294
368
  /**
295
369
  * Returns a State containing the value at `key`.
296
370
 
297
- * @param key - Key to the translated value.
298
- * @param options - A map of {{placeholder}} names and the values to replace them with.
371
+ * @param selector - Key to the translated value.
372
+ * @param options - A map of `{{placeholder}}` names and the values to replace them with.
299
373
  *
300
374
  * @example
301
- * const $value = t("your.key.here");
375
+ * const $value = t("your.key.here", { count: 5 });
302
376
  */
303
377
  t(e, t) {
304
378
  if (this === void 0)
@@ -306,30 +380,34 @@ class Ut {
306
380
  `The 't' function cannot be destructured. If you need a standalone version you can import it like so: 'import { t } from "@manyducks.co/dolla"'`
307
381
  );
308
382
  if (!this.$locale.get())
309
- return _t;
310
- let r = [], i = [];
311
- for (const s in t)
312
- r.push(s), i.push(t[s]);
313
- return me([this.$locale, ...i], (s, ...o) => {
383
+ return Ut;
384
+ let r = [], a = [];
385
+ for (const n in t)
386
+ r.push(n), a.push(t[n]);
387
+ return ye([this.$locale, ...a], (n, ...o) => {
314
388
  const u = {};
315
- for (let p = 0; p < o.length; p++)
316
- u[r[p]] = o[p];
317
- const l = P(this, O, pt).call(this, e, u);
318
- if (l) return l;
319
- const w = n(this, $e).get();
320
- let g = e;
321
- if (u.context != null && (g += "_" + u.context), u.count != null)
322
- if (u.ordinal) {
323
- const p = `${g}_ordinal_(=${u.count})`;
324
- Ce(w, p) != null ? g = p : g += "_ordinal_" + new Intl.PluralRules(s, { type: "ordinal" }).select(u.count);
325
- } else {
326
- const p = `${g}_(=${u.count})`;
327
- Ce(w, p) != null ? g = p : g += "_" + new Intl.PluralRules(s).select(u.count);
328
- }
329
- const b = Ce(w, g) || `[MISSING: ${g}]`, d = P(this, O, gt).call(this, b, u);
330
- return n(this, se).push([e, u, d]), d;
389
+ for (let l = 0; l < o.length; l++)
390
+ u[r[l]] = o[l];
391
+ return k(this, N, yt).call(this, n, e, u);
331
392
  });
332
393
  }
394
+ /**
395
+ * Add a custom format callback.
396
+ *
397
+ * @example
398
+ * Dolla.i18n.addFormat("uppercase", (locale, value, options) => {
399
+ * return value.toUpperCase();
400
+ * });
401
+ *
402
+ * {
403
+ * "greeting": "Hello, {{name|uppercase}}!"
404
+ * }
405
+ *
406
+ * t("greeting", {name: "world"}); // State<"Hello, WORLD!">
407
+ */
408
+ addFormat(e, t) {
409
+ s(this, U).set(e, t);
410
+ }
333
411
  /**
334
412
  * Creates an `Intl.Collator` configured for the current locale.
335
413
  * NOTE: The Collator remains bound to the locale it was created with, even when the app's locale changes.
@@ -345,7 +423,7 @@ class Ut {
345
423
  * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options
346
424
  */
347
425
  number(e, t) {
348
- return me([this.$locale, e], (r, i) => P(this, O, Qe).call(this, i, t));
426
+ return ye([this.$locale, e], (r, a) => k(this, N, Ye).call(this, a, t));
349
427
  }
350
428
  /**
351
429
  * Returns a State containing the date formatted for the current locale. Uses `Intl.DateTimeFormat` under the hood.
@@ -357,7 +435,7 @@ class Ut {
357
435
  * const $formatted = Dolla.i18n.dateTime(date, { dateFormat: "short" });
358
436
  */
359
437
  dateTime(e, t) {
360
- return me([this.$locale, e], (r, i) => P(this, O, ft).call(this, i, t));
438
+ return ye([this.$locale, e], (r, a) => k(this, N, Xe).call(this, a, t));
361
439
  }
362
440
  /**
363
441
  * Returns a State containing the date formatted for the current locale. Uses `Intl.DateTimeFormat` under the hood.
@@ -369,55 +447,84 @@ class Ut {
369
447
  * const $formatted = Dolla.i18n.list(list, { });
370
448
  */
371
449
  list(e, t) {
372
- return me([this.$locale, e], (r, i) => P(this, O, dt).call(this, i, t));
450
+ return ye([this.$locale, e], (r, a) => k(this, N, Ze).call(this, a, t));
373
451
  }
374
452
  }
375
- we = new WeakMap(), Y = new WeakMap(), x = new WeakMap(), se = new WeakMap(), be = new WeakMap(), ve = new WeakMap(), $e = new WeakMap(), Ee = new WeakMap(), O = new WeakSet(), Qe = function(e, t) {
453
+ ve = new WeakMap(), q = new WeakMap(), L = new WeakMap(), $e = new WeakMap(), U = new WeakMap(), ke = new WeakMap(), Ee = new WeakMap(), N = new WeakSet(), yt = function(e, t, r) {
454
+ const a = k(this, N, bt).call(this, t, r);
455
+ if (a) return a;
456
+ const n = s(this, L).get(e);
457
+ if (r.context != null && (t += "_" + r.context), r.count != null)
458
+ if (r.ordinal) {
459
+ const l = `${t}_ordinal_(=${r.count})`;
460
+ n.hasTemplate(l) ? t = l : t += "_ordinal_" + new Intl.PluralRules(e, { type: "ordinal" }).select(r.count);
461
+ } else {
462
+ const l = `${t}_(=${r.count})`;
463
+ n.hasTemplate(l) ? t = l : t += "_" + new Intl.PluralRules(e).select(r.count);
464
+ }
465
+ const o = n.getTemplate(t) || {
466
+ segments: [{ type: 0, text: `[MISSING: ${t}]` }]
467
+ };
468
+ let u = "";
469
+ for (const l of o.segments)
470
+ if (l.type === 0)
471
+ u += l.text;
472
+ else if (l.type === 1) {
473
+ const g = [...l.formats];
474
+ let m = Gt(r, l.name);
475
+ l.name === "count" && g.length === 0 && g.push({ name: "number", options: {} });
476
+ for (const p of g) {
477
+ const h = s(this, U).get(p.name);
478
+ if (h == null) {
479
+ const y = new Error(
480
+ `Failed to load format '${p.name}' when processing '${t}', template: ${o}`
481
+ );
482
+ throw s(this, q).crash(y), y;
483
+ }
484
+ m = h(e, m, p.options);
485
+ }
486
+ u += m;
487
+ }
488
+ return u;
489
+ }, Ye = function(e, t) {
376
490
  return new Intl.NumberFormat(this.$locale.get(), t).format(e);
377
- }, ft = function(e, t) {
491
+ }, Xe = function(e, t) {
378
492
  return new Intl.DateTimeFormat(this.$locale.get(), t).format(
379
493
  typeof e == "string" ? new Date(e) : e
380
494
  );
381
- }, dt = function(e, t) {
495
+ }, Ze = function(e, t) {
382
496
  return new Intl.ListFormat(this.$locale.get(), t).format(e);
383
497
  }, // relativeTime(): State<string> {
384
498
  // }
385
- pt = function(e, t) {
386
- for (const r of n(this, se))
387
- if (r[0] === e && $t(r[1], t))
499
+ bt = function(e, t) {
500
+ for (const r of s(this, $e))
501
+ if (r[0] === e && St(r[1], t))
388
502
  return r[2];
389
- }, /**
390
- * Replaces {{placeholders}} with values in translated strings.
391
- */
392
- gt = function(e, t) {
393
- for (const r in t)
394
- r === "count" ? e = e.replace(`{{${r}}}`, P(this, O, Qe).call(this, Number(t[r]), t)) : e = e.replace(`{{${r}}}`, String(Ce(t, r)));
395
- return e;
396
503
  };
397
- function Ce(a, e) {
398
- const t = String(e).split(/[\.\[\]]/).filter((i) => i.trim() !== "");
399
- let r = a;
504
+ function Gt(i, e) {
505
+ const t = String(e).split(/[\.\[\]]/).filter((a) => a.trim() !== "");
506
+ let r = i;
400
507
  for (; t.length > 0; ) {
401
- const i = t.shift();
402
- r != null ? r = r[i] : r = void 0;
508
+ const a = t.shift();
509
+ r != null ? r = r[a] : r = void 0;
403
510
  }
404
511
  return r;
405
512
  }
406
- var X, ke, V, H, ie, _, oe, je;
407
- class Vt {
513
+ var X, Pe, H, I, le, C, ce, _e;
514
+ class Wt {
408
515
  constructor(e) {
409
- f(this, oe);
516
+ f(this, ce);
410
517
  f(this, X);
411
- f(this, ke);
518
+ f(this, Pe);
412
519
  // Keyed updates ensure only the most recent callback queued with a certain key
413
520
  // will be called, keeping DOM operations to a minimum.
414
- f(this, V, /* @__PURE__ */ new Map());
521
+ f(this, H, /* @__PURE__ */ new Map());
415
522
  // All unkeyed updates are run on every batch.
416
- f(this, H, []);
523
+ f(this, I, []);
417
524
  // All read callbacks are run before updates on every batch.
418
- f(this, ie, []);
419
- f(this, _, !1);
420
- y(this, X, e), y(this, ke, e.createLogger("dolla/render"));
525
+ f(this, le, []);
526
+ f(this, C, !1);
527
+ b(this, X, e), b(this, Pe, e.createLogger("dolla/render"));
421
528
  }
422
529
  /**
423
530
  * Queues a callback to run in the next render batch.
@@ -426,11 +533,11 @@ class Vt {
426
533
  */
427
534
  update(e, t) {
428
535
  return new Promise((r) => {
429
- t ? n(this, V).set(t, () => {
536
+ t ? s(this, H).set(t, () => {
430
537
  e(), r();
431
- }) : n(this, H).push(() => {
538
+ }) : s(this, I).push(() => {
432
539
  e(), r();
433
- }), !n(this, _) && n(this, X).isMounted && (y(this, _, !0), P(this, oe, je).call(this));
540
+ }), !s(this, C) && s(this, X).isMounted && (b(this, C, !0), k(this, ce, _e).call(this));
434
541
  });
435
542
  }
436
543
  /**
@@ -440,50 +547,50 @@ class Vt {
440
547
  */
441
548
  read(e) {
442
549
  return new Promise((t) => {
443
- n(this, ie).push(() => {
550
+ s(this, le).push(() => {
444
551
  e(), t();
445
- }), !n(this, _) && n(this, X).isMounted && (y(this, _, !0), P(this, oe, je).call(this));
552
+ }), !s(this, C) && s(this, X).isMounted && (b(this, C, !0), k(this, ce, _e).call(this));
446
553
  });
447
554
  }
448
555
  }
449
- X = new WeakMap(), ke = new WeakMap(), V = new WeakMap(), H = new WeakMap(), ie = new WeakMap(), _ = new WeakMap(), oe = new WeakSet(), je = function() {
450
- const e = n(this, V).size + n(this, H).length;
451
- if ((!n(this, X).isMounted || e === 0) && y(this, _, !1), !n(this, _)) {
452
- for (const t of n(this, ie))
556
+ X = new WeakMap(), Pe = new WeakMap(), H = new WeakMap(), I = new WeakMap(), le = new WeakMap(), C = new WeakMap(), ce = new WeakSet(), _e = function() {
557
+ const e = s(this, H).size + s(this, I).length;
558
+ if ((!s(this, X).isMounted || e === 0) && b(this, C, !1), !s(this, C)) {
559
+ for (const t of s(this, le))
453
560
  t();
454
- y(this, ie, []);
561
+ b(this, le, []);
455
562
  return;
456
563
  }
457
564
  requestAnimationFrame(() => {
458
- n(this, ke).info(`Batching ${n(this, V).size + n(this, H).length} queued DOM update(s).`);
459
- for (const t of n(this, V).values())
565
+ s(this, Pe).info(`Batching ${s(this, H).size + s(this, I).length} queued DOM update(s).`);
566
+ for (const t of s(this, H).values())
460
567
  t();
461
- n(this, V).clear();
462
- for (const t of n(this, H))
568
+ s(this, H).clear();
569
+ for (const t of s(this, I))
463
570
  t();
464
- y(this, H, []), P(this, oe, je).call(this);
571
+ b(this, I, []), k(this, ce, _e).call(this);
465
572
  });
466
573
  };
467
- function he() {
468
- return he = Object.assign ? Object.assign.bind() : function(a) {
574
+ function de() {
575
+ return de = Object.assign ? Object.assign.bind() : function(i) {
469
576
  for (var e = 1; e < arguments.length; e++) {
470
577
  var t = arguments[e];
471
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (a[r] = t[r]);
578
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (i[r] = t[r]);
472
579
  }
473
- return a;
474
- }, he.apply(null, arguments);
580
+ return i;
581
+ }, de.apply(null, arguments);
475
582
  }
476
- var D;
477
- (function(a) {
478
- a.Pop = "POP", a.Push = "PUSH", a.Replace = "REPLACE";
479
- })(D || (D = {}));
480
- var Ve = process.env.NODE_ENV !== "production" ? function(a) {
481
- return Object.freeze(a);
482
- } : function(a) {
483
- return a;
583
+ var A;
584
+ (function(i) {
585
+ i.Pop = "POP", i.Push = "PUSH", i.Replace = "REPLACE";
586
+ })(A || (A = {}));
587
+ var qe = process.env.NODE_ENV !== "production" ? function(i) {
588
+ return Object.freeze(i);
589
+ } : function(i) {
590
+ return i;
484
591
  };
485
- function _e(a, e) {
486
- if (!a) {
592
+ function Ce(i, e) {
593
+ if (!i) {
487
594
  typeof console < "u" && console.warn(e);
488
595
  try {
489
596
  throw new Error(e);
@@ -491,15 +598,15 @@ function _e(a, e) {
491
598
  }
492
599
  }
493
600
  }
494
- var He = "beforeunload", Ht = "hashchange", mt = "popstate";
495
- function It(a) {
496
- a === void 0 && (a = {});
497
- var e = a, t = e.window, r = t === void 0 ? document.defaultView : t, i = r.history;
498
- function s() {
499
- var m = r.location, c = m.pathname, h = m.search, v = m.hash, $ = i.state || {};
500
- return [$.idx, Ve({
601
+ var Ue = "beforeunload", zt = "hashchange", vt = "popstate";
602
+ function Bt(i) {
603
+ i === void 0 && (i = {});
604
+ var e = i, t = e.window, r = t === void 0 ? document.defaultView : t, a = r.history;
605
+ function n() {
606
+ var w = r.location, c = w.pathname, d = w.search, v = w.hash, $ = a.state || {};
607
+ return [$.idx, qe({
501
608
  pathname: c,
502
- search: h,
609
+ search: d,
503
610
  hash: v,
504
611
  state: $.usr || null,
505
612
  key: $.key || "default"
@@ -508,21 +615,21 @@ function It(a) {
508
615
  var o = null;
509
616
  function u() {
510
617
  if (o)
511
- p.call(o), o = null;
618
+ y.call(o), o = null;
512
619
  else {
513
- var m = D.Pop, c = s(), h = c[0], v = c[1];
514
- if (p.length)
515
- if (h != null) {
516
- var $ = g - h;
620
+ var w = A.Pop, c = n(), d = c[0], v = c[1];
621
+ if (y.length)
622
+ if (d != null) {
623
+ var $ = m - d;
517
624
  $ && (o = {
518
- action: m,
625
+ action: w,
519
626
  location: v,
520
627
  retry: function() {
521
- q($ * -1);
628
+ V($ * -1);
522
629
  }
523
- }, q($));
630
+ }, V($));
524
631
  } else
525
- process.env.NODE_ENV !== "production" && _e(
632
+ process.env.NODE_ENV !== "production" && Ce(
526
633
  !1,
527
634
  // TODO: Write up a doc that explains our blocking strategy in
528
635
  // detail and link to it here so people can understand better what
@@ -530,137 +637,137 @@ function It(a) {
530
637
  "You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."
531
638
  );
532
639
  else
533
- re(m);
640
+ ne(w);
534
641
  }
535
642
  }
536
- r.addEventListener(mt, u);
537
- var l = D.Pop, w = s(), g = w[0], b = w[1], d = Fe(), p = Fe();
538
- g == null && (g = 0, i.replaceState(he({}, i.state, {
539
- idx: g
643
+ r.addEventListener(vt, u);
644
+ var l = A.Pop, g = n(), m = g[0], p = g[1], h = Ie(), y = Ie();
645
+ m == null && (m = 0, a.replaceState(de({}, a.state, {
646
+ idx: m
540
647
  }), ""));
541
- function S(m) {
542
- return typeof m == "string" ? m : qe(m);
648
+ function S(w) {
649
+ return typeof w == "string" ? w : Ve(w);
543
650
  }
544
- function fe(m, c) {
545
- return c === void 0 && (c = null), Ve(he({
546
- pathname: b.pathname,
651
+ function pe(w, c) {
652
+ return c === void 0 && (c = null), qe(de({
653
+ pathname: p.pathname,
547
654
  hash: "",
548
655
  search: ""
549
- }, typeof m == "string" ? Je(m) : m, {
656
+ }, typeof w == "string" ? et(w) : w, {
550
657
  state: c,
551
- key: yt()
658
+ key: $t()
552
659
  }));
553
660
  }
554
- function de(m, c) {
661
+ function ge(w, c) {
555
662
  return [{
556
- usr: m.state,
557
- key: m.key,
663
+ usr: w.state,
664
+ key: w.key,
558
665
  idx: c
559
- }, S(m)];
666
+ }, S(w)];
560
667
  }
561
- function pe(m, c, h) {
562
- return !p.length || (p.call({
563
- action: m,
668
+ function me(w, c, d) {
669
+ return !y.length || (y.call({
670
+ action: w,
564
671
  location: c,
565
- retry: h
672
+ retry: d
566
673
  }), !1);
567
674
  }
568
- function re(m) {
569
- l = m;
570
- var c = s();
571
- g = c[0], b = c[1], d.call({
675
+ function ne(w) {
676
+ l = w;
677
+ var c = n();
678
+ m = c[0], p = c[1], h.call({
572
679
  action: l,
573
- location: b
680
+ location: p
574
681
  });
575
682
  }
576
- function ne(m, c) {
577
- var h = D.Push, v = fe(m, c);
683
+ function ae(w, c) {
684
+ var d = A.Push, v = pe(w, c);
578
685
  function $() {
579
- ne(m, c);
686
+ ae(w, c);
580
687
  }
581
- if (pe(h, v, $)) {
582
- var L = de(v, g + 1), M = L[0], A = L[1];
688
+ if (me(d, v, $)) {
689
+ var R = ge(v, m + 1), O = R[0], j = R[1];
583
690
  try {
584
- i.pushState(M, "", A);
691
+ a.pushState(O, "", j);
585
692
  } catch {
586
- r.location.assign(A);
693
+ r.location.assign(j);
587
694
  }
588
- re(h);
695
+ ne(d);
589
696
  }
590
697
  }
591
- function ge(m, c) {
592
- var h = D.Replace, v = fe(m, c);
698
+ function we(w, c) {
699
+ var d = A.Replace, v = pe(w, c);
593
700
  function $() {
594
- ge(m, c);
701
+ we(w, c);
595
702
  }
596
- if (pe(h, v, $)) {
597
- var L = de(v, g), M = L[0], A = L[1];
598
- i.replaceState(M, "", A), re(h);
703
+ if (me(d, v, $)) {
704
+ var R = ge(v, m), O = R[0], j = R[1];
705
+ a.replaceState(O, "", j), ne(d);
599
706
  }
600
707
  }
601
- function q(m) {
602
- i.go(m);
708
+ function V(w) {
709
+ a.go(w);
603
710
  }
604
- var K = {
711
+ var J = {
605
712
  get action() {
606
713
  return l;
607
714
  },
608
715
  get location() {
609
- return b;
716
+ return p;
610
717
  },
611
718
  createHref: S,
612
- push: ne,
613
- replace: ge,
614
- go: q,
719
+ push: ae,
720
+ replace: we,
721
+ go: V,
615
722
  back: function() {
616
- q(-1);
723
+ V(-1);
617
724
  },
618
725
  forward: function() {
619
- q(1);
726
+ V(1);
620
727
  },
621
728
  listen: function(c) {
622
- return d.push(c);
729
+ return h.push(c);
623
730
  },
624
731
  block: function(c) {
625
- var h = p.push(c);
626
- return p.length === 1 && r.addEventListener(He, Ie), function() {
627
- h(), p.length || r.removeEventListener(He, Ie);
732
+ var d = y.push(c);
733
+ return y.length === 1 && r.addEventListener(Ue, He), function() {
734
+ d(), y.length || r.removeEventListener(Ue, He);
628
735
  };
629
736
  }
630
737
  };
631
- return K;
738
+ return J;
632
739
  }
633
- function Ft(a) {
634
- a === void 0 && (a = {});
635
- var e = a, t = e.window, r = t === void 0 ? document.defaultView : t, i = r.history;
636
- function s() {
637
- var c = Je(r.location.hash.substr(1)), h = c.pathname, v = h === void 0 ? "/" : h, $ = c.search, L = $ === void 0 ? "" : $, M = c.hash, A = M === void 0 ? "" : M, C = i.state || {};
638
- return [C.idx, Ve({
740
+ function Kt(i) {
741
+ i === void 0 && (i = {});
742
+ var e = i, t = e.window, r = t === void 0 ? document.defaultView : t, a = r.history;
743
+ function n() {
744
+ var c = et(r.location.hash.substr(1)), d = c.pathname, v = d === void 0 ? "/" : d, $ = c.search, R = $ === void 0 ? "" : $, O = c.hash, j = O === void 0 ? "" : O, D = a.state || {};
745
+ return [D.idx, qe({
639
746
  pathname: v,
640
- search: L,
641
- hash: A,
642
- state: C.usr || null,
643
- key: C.key || "default"
747
+ search: R,
748
+ hash: j,
749
+ state: D.usr || null,
750
+ key: D.key || "default"
644
751
  })];
645
752
  }
646
753
  var o = null;
647
754
  function u() {
648
755
  if (o)
649
- p.call(o), o = null;
756
+ y.call(o), o = null;
650
757
  else {
651
- var c = D.Pop, h = s(), v = h[0], $ = h[1];
652
- if (p.length)
758
+ var c = A.Pop, d = n(), v = d[0], $ = d[1];
759
+ if (y.length)
653
760
  if (v != null) {
654
- var L = g - v;
655
- L && (o = {
761
+ var R = m - v;
762
+ R && (o = {
656
763
  action: c,
657
764
  location: $,
658
765
  retry: function() {
659
- K(L * -1);
766
+ J(R * -1);
660
767
  }
661
- }, K(L));
768
+ }, J(R));
662
769
  } else
663
- process.env.NODE_ENV !== "production" && _e(
770
+ process.env.NODE_ENV !== "production" && Ce(
664
771
  !1,
665
772
  // TODO: Write up a doc that explains our blocking strategy in
666
773
  // detail and link to it here so people can understand better
@@ -668,179 +775,179 @@ function Ft(a) {
668
775
  "You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."
669
776
  );
670
777
  else
671
- ne(c);
778
+ ae(c);
672
779
  }
673
780
  }
674
- r.addEventListener(mt, u), r.addEventListener(Ht, function() {
675
- var c = s(), h = c[1];
676
- qe(h) !== qe(b) && u();
781
+ r.addEventListener(vt, u), r.addEventListener(zt, function() {
782
+ var c = n(), d = c[1];
783
+ Ve(d) !== Ve(p) && u();
677
784
  });
678
- var l = D.Pop, w = s(), g = w[0], b = w[1], d = Fe(), p = Fe();
679
- g == null && (g = 0, i.replaceState(he({}, i.state, {
680
- idx: g
785
+ var l = A.Pop, g = n(), m = g[0], p = g[1], h = Ie(), y = Ie();
786
+ m == null && (m = 0, a.replaceState(de({}, a.state, {
787
+ idx: m
681
788
  }), ""));
682
789
  function S() {
683
- var c = document.querySelector("base"), h = "";
790
+ var c = document.querySelector("base"), d = "";
684
791
  if (c && c.getAttribute("href")) {
685
792
  var v = r.location.href, $ = v.indexOf("#");
686
- h = $ === -1 ? v : v.slice(0, $);
793
+ d = $ === -1 ? v : v.slice(0, $);
687
794
  }
688
- return h;
795
+ return d;
689
796
  }
690
- function fe(c) {
691
- return S() + "#" + (typeof c == "string" ? c : qe(c));
797
+ function pe(c) {
798
+ return S() + "#" + (typeof c == "string" ? c : Ve(c));
692
799
  }
693
- function de(c, h) {
694
- return h === void 0 && (h = null), Ve(he({
695
- pathname: b.pathname,
800
+ function ge(c, d) {
801
+ return d === void 0 && (d = null), qe(de({
802
+ pathname: p.pathname,
696
803
  hash: "",
697
804
  search: ""
698
- }, typeof c == "string" ? Je(c) : c, {
699
- state: h,
700
- key: yt()
805
+ }, typeof c == "string" ? et(c) : c, {
806
+ state: d,
807
+ key: $t()
701
808
  }));
702
809
  }
703
- function pe(c, h) {
810
+ function me(c, d) {
704
811
  return [{
705
812
  usr: c.state,
706
813
  key: c.key,
707
- idx: h
708
- }, fe(c)];
814
+ idx: d
815
+ }, pe(c)];
709
816
  }
710
- function re(c, h, v) {
711
- return !p.length || (p.call({
817
+ function ne(c, d, v) {
818
+ return !y.length || (y.call({
712
819
  action: c,
713
- location: h,
820
+ location: d,
714
821
  retry: v
715
822
  }), !1);
716
823
  }
717
- function ne(c) {
824
+ function ae(c) {
718
825
  l = c;
719
- var h = s();
720
- g = h[0], b = h[1], d.call({
826
+ var d = n();
827
+ m = d[0], p = d[1], h.call({
721
828
  action: l,
722
- location: b
829
+ location: p
723
830
  });
724
831
  }
725
- function ge(c, h) {
726
- var v = D.Push, $ = de(c, h);
727
- function L() {
728
- ge(c, h);
832
+ function we(c, d) {
833
+ var v = A.Push, $ = ge(c, d);
834
+ function R() {
835
+ we(c, d);
729
836
  }
730
- if (process.env.NODE_ENV !== "production" && _e($.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.push(" + JSON.stringify(c) + ")"), re(v, $, L)) {
731
- var M = pe($, g + 1), A = M[0], C = M[1];
837
+ if (process.env.NODE_ENV !== "production" && Ce($.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.push(" + JSON.stringify(c) + ")"), ne(v, $, R)) {
838
+ var O = me($, m + 1), j = O[0], D = O[1];
732
839
  try {
733
- i.pushState(A, "", C);
840
+ a.pushState(j, "", D);
734
841
  } catch {
735
- r.location.assign(C);
842
+ r.location.assign(D);
736
843
  }
737
- ne(v);
844
+ ae(v);
738
845
  }
739
846
  }
740
- function q(c, h) {
741
- var v = D.Replace, $ = de(c, h);
742
- function L() {
743
- q(c, h);
847
+ function V(c, d) {
848
+ var v = A.Replace, $ = ge(c, d);
849
+ function R() {
850
+ V(c, d);
744
851
  }
745
- if (process.env.NODE_ENV !== "production" && _e($.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(c) + ")"), re(v, $, L)) {
746
- var M = pe($, g), A = M[0], C = M[1];
747
- i.replaceState(A, "", C), ne(v);
852
+ if (process.env.NODE_ENV !== "production" && Ce($.pathname.charAt(0) === "/", "Relative pathnames are not supported in hash history.replace(" + JSON.stringify(c) + ")"), ne(v, $, R)) {
853
+ var O = me($, m), j = O[0], D = O[1];
854
+ a.replaceState(j, "", D), ae(v);
748
855
  }
749
856
  }
750
- function K(c) {
751
- i.go(c);
857
+ function J(c) {
858
+ a.go(c);
752
859
  }
753
- var m = {
860
+ var w = {
754
861
  get action() {
755
862
  return l;
756
863
  },
757
864
  get location() {
758
- return b;
865
+ return p;
759
866
  },
760
- createHref: fe,
761
- push: ge,
762
- replace: q,
763
- go: K,
867
+ createHref: pe,
868
+ push: we,
869
+ replace: V,
870
+ go: J,
764
871
  back: function() {
765
- K(-1);
872
+ J(-1);
766
873
  },
767
874
  forward: function() {
768
- K(1);
875
+ J(1);
769
876
  },
770
- listen: function(h) {
771
- return d.push(h);
877
+ listen: function(d) {
878
+ return h.push(d);
772
879
  },
773
- block: function(h) {
774
- var v = p.push(h);
775
- return p.length === 1 && r.addEventListener(He, Ie), function() {
776
- v(), p.length || r.removeEventListener(He, Ie);
880
+ block: function(d) {
881
+ var v = y.push(d);
882
+ return y.length === 1 && r.addEventListener(Ue, He), function() {
883
+ v(), y.length || r.removeEventListener(Ue, He);
777
884
  };
778
885
  }
779
886
  };
780
- return m;
887
+ return w;
781
888
  }
782
- function Ie(a) {
783
- a.preventDefault(), a.returnValue = "";
889
+ function He(i) {
890
+ i.preventDefault(), i.returnValue = "";
784
891
  }
785
- function Fe() {
786
- var a = [];
892
+ function Ie() {
893
+ var i = [];
787
894
  return {
788
895
  get length() {
789
- return a.length;
896
+ return i.length;
790
897
  },
791
898
  push: function(t) {
792
- return a.push(t), function() {
793
- a = a.filter(function(r) {
899
+ return i.push(t), function() {
900
+ i = i.filter(function(r) {
794
901
  return r !== t;
795
902
  });
796
903
  };
797
904
  },
798
905
  call: function(t) {
799
- a.forEach(function(r) {
906
+ i.forEach(function(r) {
800
907
  return r && r(t);
801
908
  });
802
909
  }
803
910
  };
804
911
  }
805
- function yt() {
912
+ function $t() {
806
913
  return Math.random().toString(36).substr(2, 8);
807
914
  }
808
- function qe(a) {
809
- var e = a.pathname, t = e === void 0 ? "/" : e, r = a.search, i = r === void 0 ? "" : r, s = a.hash, o = s === void 0 ? "" : s;
810
- return i && i !== "?" && (t += i.charAt(0) === "?" ? i : "?" + i), o && o !== "#" && (t += o.charAt(0) === "#" ? o : "#" + o), t;
915
+ function Ve(i) {
916
+ var e = i.pathname, t = e === void 0 ? "/" : e, r = i.search, a = r === void 0 ? "" : r, n = i.hash, o = n === void 0 ? "" : n;
917
+ return a && a !== "?" && (t += a.charAt(0) === "?" ? a : "?" + a), o && o !== "#" && (t += o.charAt(0) === "#" ? o : "#" + o), t;
811
918
  }
812
- function Je(a) {
919
+ function et(i) {
813
920
  var e = {};
814
- if (a) {
815
- var t = a.indexOf("#");
816
- t >= 0 && (e.hash = a.substr(t), a = a.substr(0, t));
817
- var r = a.indexOf("?");
818
- r >= 0 && (e.search = a.substr(r), a = a.substr(0, r)), a && (e.pathname = a);
921
+ if (i) {
922
+ var t = i.indexOf("#");
923
+ t >= 0 && (e.hash = i.substr(t), i = i.substr(0, t));
924
+ var r = i.indexOf("?");
925
+ r >= 0 && (e.search = i.substr(r), i = i.substr(0, r)), i && (e.pathname = i);
819
926
  }
820
927
  return e;
821
928
  }
822
- function ye(a) {
823
- return ct(a, "Expected `path` to be a string. Got type: %t, value: %v"), a.split("/").map((e) => e.trim()).filter((e) => e !== "");
929
+ function be(i) {
930
+ return pt(i, "Expected `path` to be a string. Got type: %t, value: %v"), i.split("/").map((e) => e.trim()).filter((e) => e !== "");
824
931
  }
825
- function ae(a) {
932
+ function se(i) {
826
933
  var t;
827
- Et(
828
- (r) => et(r == null ? void 0 : r.toString),
829
- a,
934
+ Rt(
935
+ (r) => at(r == null ? void 0 : r.toString),
936
+ i,
830
937
  "Expected `parts` to be an array of objects with a .toString() method. Got type: %t, value: %v"
831
- ), a = a.filter((r) => r).flatMap(String);
832
- let e = (t = a.shift()) == null ? void 0 : t.toString();
938
+ ), i = i.filter((r) => r).flatMap(String);
939
+ let e = (t = i.shift()) == null ? void 0 : t.toString();
833
940
  if (e) {
834
- for (const r of a.map((i) => i.toString()))
835
- r.startsWith(".") ? e = Ue(e, r) : e[e.length - 1] !== "/" ? r[0] !== "/" ? e += "/" + r : e += r : r[0] === "/" ? e += r.slice(1) : e += r;
941
+ for (const r of i.map((a) => a.toString()))
942
+ r.startsWith(".") ? e = Fe(e, r) : e[e.length - 1] !== "/" ? r[0] !== "/" ? e += "/" + r : e += r : r[0] === "/" ? e += r.slice(1) : e += r;
836
943
  e && e !== "/" && e.endsWith("/") && (e = e.slice(0, e.length - 1));
837
944
  }
838
945
  return e ?? "";
839
946
  }
840
- function Ue(a, e) {
841
- if (ct(a, "Expected `base` to be a string. Got type: %t, value: %v"), e == null && (e = a, a = ""), e.startsWith("/"))
947
+ function Fe(i, e) {
948
+ if (pt(i, "Expected `base` to be a string. Got type: %t, value: %v"), e == null && (e = i, i = ""), e.startsWith("/"))
842
949
  return e;
843
- let t = a;
950
+ let t = i;
844
951
  for (; ; )
845
952
  if (e.startsWith("..")) {
846
953
  for (let r = t.length; r > 0; --r)
@@ -852,71 +959,71 @@ function Ue(a, e) {
852
959
  e = e.replace(/^\.\/?/, "");
853
960
  else
854
961
  break;
855
- return ae([t, e]);
962
+ return se([t, e]);
856
963
  }
857
- function Ye(a) {
858
- if (!a) return {};
859
- a.startsWith("?") && (a = a.slice(1));
860
- const e = a.split("&").filter((t) => t.trim() !== "").map((t) => {
861
- const [r, i] = t.split("=").map((s) => s.trim());
862
- return i.toLowerCase() === "true" ? [r, !0] : i.toLowerCase() === "false" ? [r, !1] : isNaN(Number(i)) ? [r, i] : [r, Number(i)];
964
+ function tt(i) {
965
+ if (!i) return {};
966
+ i.startsWith("?") && (i = i.slice(1));
967
+ const e = i.split("&").filter((t) => t.trim() !== "").map((t) => {
968
+ const [r, a] = t.split("=").map((n) => n.trim());
969
+ return a.toLowerCase() === "true" ? [r, !0] : a.toLowerCase() === "false" ? [r, !1] : isNaN(Number(a)) ? [r, a] : [r, Number(a)];
863
970
  });
864
971
  return Object.fromEntries(e);
865
972
  }
866
- function ot(a, e, t = {}) {
973
+ function ft(i, e, t = {}) {
867
974
  var o;
868
- const [r, i] = e.split("?"), s = ye(r);
869
- e: for (const u of a) {
975
+ const [r, a] = e.split("?"), n = be(r);
976
+ e: for (const u of i) {
870
977
  const { fragments: l } = u;
871
- if (!(((o = l[l.length - 1]) == null ? void 0 : o.type) === 3) && l.length !== s.length || t.willMatch && !t.willMatch(u))
978
+ if (!(((o = l[l.length - 1]) == null ? void 0 : o.type) === 3) && l.length !== n.length || t.willMatch && !t.willMatch(u))
872
979
  continue e;
873
- const g = [];
874
- t: for (let d = 0; d < l.length; d++) {
875
- const p = s[d], S = l[d];
876
- if (p == null && S.type !== 3)
980
+ const m = [];
981
+ t: for (let h = 0; h < l.length; h++) {
982
+ const y = n[h], S = l[h];
983
+ if (y == null && S.type !== 3)
877
984
  continue e;
878
985
  switch (S.type) {
879
986
  case 1:
880
- if (S.name.toLowerCase() === p.toLowerCase()) {
881
- g.push(S);
987
+ if (S.name.toLowerCase() === y.toLowerCase()) {
988
+ m.push(S);
882
989
  break;
883
990
  } else
884
991
  continue e;
885
992
  case 2:
886
- g.push({ ...S, value: p });
993
+ m.push({ ...S, value: y });
887
994
  break;
888
995
  case 3:
889
- g.push({ ...S, value: s.slice(d).join("/") });
996
+ m.push({ ...S, value: n.slice(h).join("/") });
890
997
  break t;
891
998
  case 4:
892
- if (isNaN(Number(p)))
999
+ if (isNaN(Number(y)))
893
1000
  continue e;
894
- g.push({ ...S, value: Number(p) });
1001
+ m.push({ ...S, value: Number(y) });
895
1002
  break;
896
1003
  default:
897
1004
  throw new Error(`Unknown fragment type: ${S.type}`);
898
1005
  }
899
1006
  }
900
- const b = /* @__PURE__ */ Object.create(null);
901
- for (const d of g)
902
- d.type === 2 && (b[d.name] = decodeURIComponent(d.value)), d.type === 4 && (b[d.name] = d.value), d.type === 3 && (b.wildcard = "/" + decodeURIComponent(d.value));
1007
+ const p = /* @__PURE__ */ Object.create(null);
1008
+ for (const h of m)
1009
+ h.type === 2 && (p[h.name] = decodeURIComponent(h.value)), h.type === 4 && (p[h.name] = h.value), h.type === 3 && (p.wildcard = "/" + decodeURIComponent(h.value));
903
1010
  return {
904
- path: "/" + g.map((d) => d.value).join("/"),
905
- pattern: "/" + l.map((d) => d.type === 2 ? `{${d.name}}` : d.type === 4 ? `{#${d.name}}` : d.name).join("/"),
906
- params: b,
907
- query: Ye(i),
1011
+ path: "/" + m.map((h) => h.value).join("/"),
1012
+ pattern: "/" + l.map((h) => h.type === 2 ? `{${h.name}}` : h.type === 4 ? `{#${h.name}}` : h.name).join("/"),
1013
+ params: p,
1014
+ query: tt(a),
908
1015
  meta: u.meta
909
1016
  };
910
1017
  }
911
1018
  }
912
- function Wt(a) {
913
- const e = [], t = [], r = [], i = [];
914
- for (const o of a) {
1019
+ function Qt(i) {
1020
+ const e = [], t = [], r = [], a = [];
1021
+ for (const o of i) {
915
1022
  const { fragments: u } = o;
916
1023
  u.some(
917
1024
  (l) => l.type === 3
918
1025
  /* Wildcard */
919
- ) ? i.push(o) : u.some(
1026
+ ) ? a.push(o) : u.some(
920
1027
  (l) => l.type === 4
921
1028
  /* NumericParam */
922
1029
  ) ? t.push(o) : u.some(
@@ -924,115 +1031,115 @@ function Wt(a) {
924
1031
  /* Param */
925
1032
  ) ? r.push(o) : e.push(o);
926
1033
  }
927
- const s = (o, u) => o.fragments.length > u.fragments.length ? -1 : 1;
928
- return e.sort(s), t.sort(s), r.sort(s), i.sort(s), [...e, ...t, ...r, ...i];
1034
+ const n = (o, u) => o.fragments.length > u.fragments.length ? -1 : 1;
1035
+ return e.sort(n), t.sort(n), r.sort(n), a.sort(n), [...e, ...t, ...r, ...a];
929
1036
  }
930
- function zt(a) {
931
- const e = ye(a), t = [];
1037
+ function Jt(i) {
1038
+ const e = be(i), t = [];
932
1039
  for (let r = 0; r < e.length; r++) {
933
- const i = e[r];
934
- if (i === "*") {
1040
+ const a = e[r];
1041
+ if (a === "*") {
935
1042
  if (r !== e.length - 1)
936
- throw new Error(`Wildcard must be at the end of a pattern. Received: ${a}`);
1043
+ throw new Error(`Wildcard must be at the end of a pattern. Received: ${i}`);
937
1044
  t.push({
938
1045
  type: 3,
939
1046
  name: "*",
940
1047
  value: null
941
1048
  });
942
- } else i.at(0) === "{" && i.at(-1) === "}" ? t.push({
943
- type: i[1] === "#" ? 4 : 2,
944
- name: i[1] === "#" ? i.slice(2, -1) : i.slice(1, -1),
1049
+ } else a.at(0) === "{" && a.at(-1) === "}" ? t.push({
1050
+ type: a[1] === "#" ? 4 : 2,
1051
+ name: a[1] === "#" ? a.slice(2, -1) : a.slice(1, -1),
945
1052
  value: null
946
1053
  }) : t.push({
947
1054
  type: 1,
948
- name: i,
949
- value: i
1055
+ name: a,
1056
+ value: a
950
1057
  });
951
1058
  }
952
1059
  return t;
953
1060
  }
954
- var Pe, N, Z, E, ze, I, Se, ee, F, le, ce, ue, Le, B, Xe, Ze;
955
- class Gt {
1061
+ var Se, M, Z, E, ze, G, Re, ee, W, ue, he, fe, xe, Q, rt, nt;
1062
+ class Yt {
956
1063
  constructor(e, t) {
957
- f(this, B);
958
- f(this, Pe);
959
- f(this, N);
1064
+ f(this, Q);
1065
+ f(this, Se);
1066
+ f(this, M);
960
1067
  f(this, Z);
961
1068
  f(this, E);
962
1069
  f(this, ze, 0);
963
- f(this, I, []);
964
- f(this, Se);
1070
+ f(this, G, []);
1071
+ f(this, Re);
965
1072
  f(this, ee, []);
966
1073
  // Callbacks that need to be called on unmount.
967
- f(this, F, []);
1074
+ f(this, W, []);
968
1075
  /**
969
1076
  * The currently matched route pattern, if any.
970
1077
  */
971
- k(this, "$pattern");
972
- f(this, le);
1078
+ P(this, "$pattern");
1079
+ f(this, ue);
973
1080
  /**
974
1081
  * The current URL path.
975
1082
  */
976
- k(this, "$path");
977
- f(this, ce);
1083
+ P(this, "$path");
1084
+ f(this, he);
978
1085
  /**
979
1086
  * The current named path params.
980
1087
  */
981
- k(this, "$params");
982
- f(this, ue);
1088
+ P(this, "$params");
1089
+ f(this, fe);
983
1090
  /**
984
1091
  * The current query params. Changes to this object will be reflected in the URL.
985
1092
  */
986
- k(this, "$query");
987
- f(this, Le);
988
- y(this, Pe, e), y(this, N, e.createLogger("dolla/router")), y(this, Z, t);
989
- const [r, i] = Q(null), [s, o] = Q(""), [u, l] = Q({}), [w, g] = Q(
990
- Ye(typeof window > "u" ? "" : window.location.search ?? "")
1093
+ P(this, "$query");
1094
+ f(this, xe);
1095
+ b(this, Se, e), b(this, M, e.createLogger("dolla/router")), b(this, Z, t);
1096
+ const [r, a] = ie(null), [n, o] = ie(""), [u, l] = ie({}), [g, m] = ie(
1097
+ tt(typeof window > "u" ? "" : window.location.search ?? "")
991
1098
  );
992
- this.$pattern = r, y(this, le, i), this.$path = s, y(this, ce, o), this.$params = u, y(this, ue, l), this.$query = w, y(this, Le, g), e.beforeMount(() => {
993
- n(this, E) != null && (n(this, F).push(
994
- ut([w], (b) => {
995
- const d = new URLSearchParams();
996
- for (const S in b)
997
- d.set(S, String(b[S]));
998
- const p = "?" + d.toString();
999
- p != n(this, E).location.search && n(this, E).replace({
1000
- pathname: n(this, E).location.pathname,
1001
- search: p
1099
+ this.$pattern = r, b(this, ue, a), this.$path = n, b(this, he, o), this.$params = u, b(this, fe, l), this.$query = g, b(this, xe, m), e.beforeMount(() => {
1100
+ s(this, E) != null && (s(this, W).push(
1101
+ gt([g], (p) => {
1102
+ const h = new URLSearchParams();
1103
+ for (const S in p)
1104
+ h.set(S, String(p[S]));
1105
+ const y = "?" + h.toString();
1106
+ y != s(this, E).location.search && s(this, E).replace({
1107
+ pathname: s(this, E).location.pathname,
1108
+ search: y
1002
1109
  });
1003
1110
  })
1004
- ), n(this, F).push(n(this, E).listen(P(this, B, Ze).bind(this))), P(this, B, Ze).call(this, n(this, E)), n(this, F).push(
1005
- Qt(n(this, Z).rootElement, (b) => {
1006
- let d = b.getAttribute("href");
1007
- n(this, N).info("Intercepted link click", b, d), /^https?:\/\/|^\//.test(d) || (d = ae([n(this, E).location.pathname, d])), n(this, E).push(d);
1111
+ ), s(this, W).push(s(this, E).listen(k(this, Q, nt).bind(this))), k(this, Q, nt).call(this, s(this, E)), s(this, W).push(
1112
+ er(s(this, Z).rootElement, (p) => {
1113
+ let h = p.getAttribute("href");
1114
+ s(this, M).info("Intercepted link click", p, h), /^https?:\/\/|^\//.test(h) || (h = se([s(this, E).location.pathname, h])), s(this, E).push(h);
1008
1115
  })
1009
- ), n(this, N).info("Intercepting <a> clicks within root element:", n(this, Z).rootElement));
1116
+ ), s(this, M).info("Intercepting <a> clicks within root element:", s(this, Z).rootElement));
1010
1117
  }), e.onUnmount(() => {
1011
- for (; n(this, F).length > 0; )
1012
- n(this, F).pop()();
1118
+ for (; s(this, W).length > 0; )
1119
+ s(this, W).pop()();
1013
1120
  });
1014
1121
  }
1015
1122
  setup(e) {
1016
- if (n(this, Pe).isMounted) {
1017
- n(this, N).crash(
1123
+ if (s(this, Se).isMounted) {
1124
+ s(this, M).crash(
1018
1125
  new Error("Dolla is already mounted. Router setup must be called before Dolla.mount is called.")
1019
1126
  );
1020
1127
  return;
1021
1128
  }
1022
- e.style === "hash" ? y(this, E, Ft()) : y(this, E, It()), y(this, ee, Wt(
1023
- e.routes.flatMap((t) => P(this, B, Xe).call(this, t)).map((t) => ({
1129
+ e.style === "hash" ? b(this, E, Kt()) : b(this, E, Bt()), b(this, ee, Qt(
1130
+ e.routes.flatMap((t) => k(this, Q, rt).call(this, t)).map((t) => ({
1024
1131
  pattern: t.pattern,
1025
1132
  meta: t.meta,
1026
- fragments: zt(t.pattern)
1133
+ fragments: Jt(t.pattern)
1027
1134
  }))
1028
1135
  ));
1029
- for (const t of n(this, ee))
1136
+ for (const t of s(this, ee))
1030
1137
  if (t.meta.redirect) {
1031
1138
  let r;
1032
- if (!et(t.meta.redirect)) if (U(t.meta.redirect)) {
1033
- if (r = t.meta.redirect, !ot(n(this, ee), r, {
1034
- willMatch(s) {
1035
- return s !== t;
1139
+ if (!at(t.meta.redirect)) if (F(t.meta.redirect)) {
1140
+ if (r = t.meta.redirect, !ft(s(this, ee), r, {
1141
+ willMatch(n) {
1142
+ return n !== t;
1036
1143
  }
1037
1144
  }))
1038
1145
  throw new Error(
@@ -1050,8 +1157,8 @@ class Gt {
1050
1157
  * Dolla.router.go["/users", 215], { replace: true }); // replace current history entry with `/users/215`
1051
1158
  */
1052
1159
  go(e, t = {}) {
1053
- if (n(this, E) == null) {
1054
- n(this, N).crash(
1160
+ if (s(this, E) == null) {
1161
+ s(this, M).crash(
1055
1162
  new Error(
1056
1163
  "Router.go was called, but the router was never configured! Run 'Dolla.router.setup' before 'Dolla.mount' to configure routes."
1057
1164
  )
@@ -1059,44 +1166,44 @@ class Gt {
1059
1166
  return;
1060
1167
  }
1061
1168
  let r;
1062
- Array.isArray(e) ? r = ae(e) : r = e.toString(), r = Ue(n(this, E).location.pathname, r), t.preserveQuery && (r += n(this, E).location.search), t.replace ? n(this, E).replace(r) : n(this, E).push(r);
1169
+ Array.isArray(e) ? r = se(e) : r = e.toString(), r = Fe(s(this, E).location.pathname, r), t.preserveQuery && (r += s(this, E).location.search), t.replace ? s(this, E).replace(r) : s(this, E).push(r);
1063
1170
  }
1064
1171
  /**
1065
1172
  * Navigate backward. Pass a number of steps to hit the back button that many times.
1066
1173
  */
1067
1174
  back(e = 1) {
1068
- if (n(this, E) == null) {
1069
- n(this, N).crash(
1175
+ if (s(this, E) == null) {
1176
+ s(this, M).crash(
1070
1177
  new Error(
1071
1178
  "Router.back was called, but the router was never configured! Run 'Dolla.router.setup' before 'Dolla.mount' to configure routes."
1072
1179
  )
1073
1180
  );
1074
1181
  return;
1075
1182
  }
1076
- n(this, E).go(-e);
1183
+ s(this, E).go(-e);
1077
1184
  }
1078
1185
  /**
1079
1186
  * Navigate forward. Pass a number of steps to hit the forward button that many times.
1080
1187
  */
1081
1188
  forward(e = 1) {
1082
- if (n(this, E) == null) {
1083
- n(this, N).crash(
1189
+ if (s(this, E) == null) {
1190
+ s(this, M).crash(
1084
1191
  new Error(
1085
1192
  "Router.forward was called, but the router was never configured! Run 'Dolla.router.setup' before 'Dolla.mount' to configure routes."
1086
1193
  )
1087
1194
  );
1088
1195
  return;
1089
1196
  }
1090
- n(this, E).go(e);
1197
+ s(this, E).go(e);
1091
1198
  }
1092
1199
  }
1093
- Pe = new WeakMap(), N = new WeakMap(), Z = new WeakMap(), E = new WeakMap(), ze = new WeakMap(), I = new WeakMap(), Se = new WeakMap(), ee = new WeakMap(), F = new WeakMap(), le = new WeakMap(), ce = new WeakMap(), ue = new WeakMap(), Le = new WeakMap(), B = new WeakSet(), /**
1200
+ Se = new WeakMap(), M = new WeakMap(), Z = new WeakMap(), E = new WeakMap(), ze = new WeakMap(), G = new WeakMap(), Re = new WeakMap(), ee = new WeakMap(), W = new WeakMap(), ue = new WeakMap(), he = new WeakMap(), fe = new WeakMap(), xe = new WeakMap(), Q = new WeakSet(), /**
1094
1201
  * Parses a route definition object into a set of matchable routes.
1095
1202
  *
1096
1203
  * @param route - Route config object.
1097
1204
  * @param layers - Array of parent layers. Passed when this function calls itself on nested routes.
1098
1205
  */
1099
- Xe = function(e, t = [], r = []) {
1206
+ rt = function(e, t = [], r = []) {
1100
1207
  if (!(typeof e == "object" && !Array.isArray(e)) || typeof e.path != "string")
1101
1208
  throw new TypeError(`Route configs must be objects with a 'path' string property. Got: ${e}`);
1102
1209
  if (e.redirect && e.routes)
@@ -1105,44 +1212,44 @@ Xe = function(e, t = [], r = []) {
1105
1212
  throw new Error("Route cannot have both a 'redirect' and a 'view'.");
1106
1213
  if (!e.view && !e.routes && !e.redirect)
1107
1214
  throw new Error("Route must have a 'view', a 'redirect', or a set of nested 'routes'.");
1108
- let i = [];
1215
+ let a = [];
1109
1216
  for (const l of t)
1110
- i.push(...ye(l.path));
1111
- i.push(...ye(e.path)), i[i.length - 1] === "*" && i.pop();
1112
- const s = [];
1217
+ a.push(...be(l.path));
1218
+ a.push(...be(e.path)), a[a.length - 1] === "*" && a.pop();
1219
+ const n = [];
1113
1220
  if (e.redirect) {
1114
1221
  let l = e.redirect;
1115
- return U(l) && (l = Ue(ae(i), l), l.startsWith("/") || (l = "/" + l)), s.push({
1116
- pattern: "/" + ae([...i, ...ye(e.path)]),
1222
+ return F(l) && (l = Fe(se(a), l), l.startsWith("/") || (l = "/" + l)), n.push({
1223
+ pattern: "/" + se([...a, ...be(e.path)]),
1117
1224
  meta: {
1118
1225
  redirect: l
1119
1226
  }
1120
- }), s;
1227
+ }), n;
1121
1228
  }
1122
- let o = ht;
1229
+ let o = mt;
1123
1230
  if (typeof e.view == "function")
1124
1231
  o = e.view;
1125
1232
  else if (e.view)
1126
1233
  throw new TypeError(`Route '${e.path}' expected a view function or undefined. Got: ${e.view}`);
1127
- const u = { id: rt(this, ze)._++, view: o };
1234
+ const u = { id: it(this, ze)._++, view: o };
1128
1235
  if (e.routes)
1129
1236
  for (const l of e.routes)
1130
- s.push(...P(this, B, Xe).call(this, l, [...t, e], [...r, u]));
1237
+ n.push(...k(this, Q, rt).call(this, l, [...t, e], [...r, u]));
1131
1238
  else
1132
- s.push({
1133
- pattern: parent ? ae([...t.map((l) => l.path), e.path]) : e.path,
1239
+ n.push({
1240
+ pattern: parent ? se([...t.map((l) => l.path), e.path]) : e.path,
1134
1241
  meta: {
1135
1242
  pattern: e.path,
1136
1243
  layers: [...r, u],
1137
1244
  beforeMatch: e.beforeMatch
1138
1245
  }
1139
1246
  });
1140
- return s;
1141
- }, Ze = async function({ location: e }) {
1142
- e.search !== n(this, Se) && (y(this, Se, e.search), n(this, Le).call(this, Ye(e.search)));
1143
- const t = ot(n(this, ee), e.pathname);
1247
+ return n;
1248
+ }, nt = async function({ location: e }) {
1249
+ e.search !== s(this, Re) && (b(this, Re, e.search), s(this, xe).call(this, tt(e.search)));
1250
+ const t = ft(s(this, ee), e.pathname);
1144
1251
  if (!t) {
1145
- n(this, le).call(this, null), n(this, ce).call(this, e.pathname), n(this, ue).call(this, {
1252
+ s(this, ue).call(this, null), s(this, he).call(this, e.pathname), s(this, fe).call(this, {
1146
1253
  wildcard: e.pathname
1147
1254
  });
1148
1255
  return;
@@ -1154,8 +1261,8 @@ Xe = function(e, t = [], r = []) {
1154
1261
  }
1155
1262
  }), t.meta.redirect != null)
1156
1263
  if (typeof t.meta.redirect == "string") {
1157
- const r = Jt(t.meta.redirect, t.params);
1158
- n(this, N).info(`↩️ redirecting from '${t.path}' to '${r}'`), n(this, E).replace(r);
1264
+ const r = tr(t.meta.redirect, t.params);
1265
+ s(this, M).info(`↩️ redirecting from '${t.path}' to '${r}'`), s(this, E).replace(r);
1159
1266
  } else if (typeof t.meta.redirect == "function") {
1160
1267
  const r = {
1161
1268
  path: t.path,
@@ -1163,88 +1270,88 @@ Xe = function(e, t = [], r = []) {
1163
1270
  params: t.params,
1164
1271
  query: t.query
1165
1272
  };
1166
- let i = await t.meta.redirect(r);
1167
- if (typeof i != "string")
1273
+ let a = await t.meta.redirect(r);
1274
+ if (typeof a != "string")
1168
1275
  throw new Error("Redirect function must return a path to redirect to.");
1169
- i.startsWith("/") || (i = Ue(t.path, i)), n(this, N).info(`Redirecting to: '${i}'`), n(this, E).replace(i);
1276
+ a.startsWith("/") || (a = Fe(t.path, a)), s(this, M).info(`Redirecting to: '${a}'`), s(this, E).replace(a);
1170
1277
  } else
1171
1278
  throw new TypeError("Redirect must either be a path string or a function.");
1172
- else if (n(this, N).info(`📍 navigating to '${t.path}'`), n(this, ce).call(this, t.path), n(this, ue).call(this, t.params), t.pattern !== this.$pattern.get()) {
1173
- n(this, le).call(this, t.pattern);
1279
+ else if (s(this, M).info(`📍 navigating to '${t.path}'`), s(this, he).call(this, t.path), s(this, fe).call(this, t.params), t.pattern !== this.$pattern.get()) {
1280
+ s(this, ue).call(this, t.pattern);
1174
1281
  const r = t.meta.layers;
1175
- for (let i = 0; i < r.length; i++) {
1176
- const s = r[i], o = n(this, I)[i];
1177
- if ((o == null ? void 0 : o.id) !== s.id) {
1178
- y(this, I, n(this, I).slice(0, i));
1179
- const u = n(this, I).at(-1);
1282
+ for (let a = 0; a < r.length; a++) {
1283
+ const n = r[a], o = s(this, G)[a];
1284
+ if ((o == null ? void 0 : o.id) !== n.id) {
1285
+ b(this, G, s(this, G).slice(0, a));
1286
+ const u = s(this, G).at(-1);
1180
1287
  o && o.node.isMounted && o.node.unmount();
1181
1288
  let l;
1182
- u ? l = u.node.setChildView(s.view) : l = n(this, Z).rootView.setChildView(s.view), n(this, I).push({ id: s.id, node: l });
1289
+ u ? l = u.node.setChildView(n.view) : l = s(this, Z).rootView.setChildView(n.view), s(this, G).push({ id: n.id, node: l });
1183
1290
  }
1184
1291
  }
1185
1292
  }
1186
1293
  };
1187
- const Bt = /(noopener|noreferrer) (noopener|noreferrer)/, Kt = /^[\w-_]+:/;
1188
- function Qt(a, e, t = window) {
1189
- function r(s) {
1190
- return !s || s === a ? null : s.localName !== "a" || s.href === void 0 ? r(s.parentNode) : s;
1294
+ const Xt = /(noopener|noreferrer) (noopener|noreferrer)/, Zt = /^[\w-_]+:/;
1295
+ function er(i, e, t = window) {
1296
+ function r(n) {
1297
+ return !n || n === i ? null : n.localName !== "a" || n.href === void 0 ? r(n.parentNode) : n;
1191
1298
  }
1192
- function i(s) {
1193
- if (s.button && s.button !== 0 || s.ctrlKey || s.metaKey || s.altKey || s.shiftKey || s.defaultPrevented)
1299
+ function a(n) {
1300
+ if (n.button && n.button !== 0 || n.ctrlKey || n.metaKey || n.altKey || n.shiftKey || n.defaultPrevented)
1194
1301
  return;
1195
- const o = r(s.target);
1196
- o && (t.location.protocol !== o.protocol || t.location.hostname !== o.hostname || t.location.port !== o.port || o.hasAttribute("data-router-ignore") || o.hasAttribute("download") || o.getAttribute("target") === "_blank" && Bt.test(o.getAttribute("rel")) || Kt.test(o.getAttribute("href")) || (s.preventDefault(), e(o)));
1302
+ const o = r(n.target);
1303
+ o && (t.location.protocol !== o.protocol || t.location.hostname !== o.hostname || t.location.port !== o.port || o.hasAttribute("data-router-ignore") || o.hasAttribute("download") || o.getAttribute("target") === "_blank" && Xt.test(o.getAttribute("rel")) || Zt.test(o.getAttribute("href")) || (n.preventDefault(), e(o)));
1197
1304
  }
1198
- return a.addEventListener("click", i), function() {
1199
- a.removeEventListener("click", i);
1305
+ return i.addEventListener("click", a), function() {
1306
+ i.removeEventListener("click", a);
1200
1307
  };
1201
1308
  }
1202
- function Jt(a, e) {
1309
+ function tr(i, e) {
1203
1310
  for (const t in e) {
1204
1311
  const r = e[t].toString();
1205
- a = a.replace(`{${t}}`, r).replace(`{#${t}}`, r);
1312
+ i = i.replace(`{${t}}`, r).replace(`{#${t}}`, r);
1206
1313
  }
1207
- return a;
1314
+ return i;
1208
1315
  }
1209
- var W, Re, z, te, xe, Me, Ne, Oe, Te, R, G;
1210
- class Yt {
1316
+ var z, Le, B, te, Ne, Oe, Me, Te, je, x, K;
1317
+ class rr {
1211
1318
  constructor() {
1212
- k(this, "http");
1213
- k(this, "i18n");
1214
- k(this, "render");
1215
- k(this, "router");
1216
- f(this, W, !1);
1217
- f(this, Re, "production");
1218
- f(this, z);
1319
+ P(this, "http");
1320
+ P(this, "i18n");
1321
+ P(this, "render");
1322
+ P(this, "router");
1323
+ f(this, z, !1);
1324
+ f(this, Le, "production");
1325
+ f(this, B);
1219
1326
  f(this, te);
1220
- f(this, xe, Tt);
1221
- f(this, Me, []);
1222
- f(this, Ne, []);
1327
+ f(this, Ne, _t);
1223
1328
  f(this, Oe, []);
1329
+ f(this, Me, []);
1224
1330
  f(this, Te, []);
1225
- f(this, R, {
1331
+ f(this, je, []);
1332
+ f(this, x, {
1226
1333
  info: "development",
1227
1334
  log: "development",
1228
1335
  warn: "development",
1229
1336
  error: !0
1230
1337
  });
1231
- f(this, G, at("*,-dolla/*"));
1232
- k(this, "createState", Q);
1233
- k(this, "createSettableState", kt);
1234
- k(this, "toSettableState", Pt);
1235
- k(this, "toState", Ke);
1236
- k(this, "valueOf", St);
1237
- k(this, "derive", me);
1238
- k(this, "watch", ut);
1239
- k(this, "createRef", Lt);
1240
- k(this, "isRef", Rt);
1338
+ f(this, K, ct("*,-dolla/*"));
1339
+ P(this, "createState", ie);
1340
+ P(this, "createSettableState", xt);
1341
+ P(this, "toSettableState", Lt);
1342
+ P(this, "toState", Qe);
1343
+ P(this, "valueOf", Nt);
1344
+ P(this, "derive", ye);
1345
+ P(this, "watch", gt);
1346
+ P(this, "createRef", Ot);
1347
+ P(this, "isRef", Mt);
1241
1348
  const e = this;
1242
- this.http = new At(), this.i18n = new Ut(this), this.render = new Vt(this), this.router = new Gt(this, {
1349
+ this.http = new Ct(), this.i18n = new It(this), this.render = new Wt(this), this.router = new Yt(this, {
1243
1350
  get rootElement() {
1244
- return n(e, z);
1351
+ return s(e, B);
1245
1352
  },
1246
1353
  get rootView() {
1247
- return n(e, te);
1354
+ return s(e, te);
1248
1355
  }
1249
1356
  });
1250
1357
  }
@@ -1252,47 +1359,47 @@ class Yt {
1252
1359
  * True when the app is connected to a DOM node and displayed to the user.
1253
1360
  */
1254
1361
  get isMounted() {
1255
- return n(this, W);
1362
+ return s(this, z);
1256
1363
  }
1257
1364
  /**
1258
1365
  * Get the current environment that this app is running in.
1259
1366
  * Environment affects which log messages will print and how much debugging info is included in the DOM.
1260
1367
  */
1261
1368
  getEnv() {
1262
- return n(this, Re);
1369
+ return s(this, Le);
1263
1370
  }
1264
1371
  /**
1265
1372
  * Sets the environment that this app is running in.
1266
1373
  * Environment affects which log messages will print and how much debugging info is included in the DOM.
1267
1374
  */
1268
1375
  setEnv(e) {
1269
- y(this, Re, e);
1376
+ b(this, Le, e);
1270
1377
  }
1271
1378
  /**
1272
1379
  * Sets the view that will be shown when the `crash` method is called on any logger.
1273
1380
  * When a crash is reported the app will be unmounted and replaced with this crash page.
1274
1381
  */
1275
1382
  setCrashView(e) {
1276
- y(this, xe, e);
1383
+ b(this, Ne, e);
1277
1384
  }
1278
1385
  async mount(e, t) {
1279
- if (n(this, W))
1386
+ if (s(this, z))
1280
1387
  throw new Error("Dolla is already mounted.");
1281
- if (U(e)) {
1282
- const i = document.querySelector(e);
1283
- st(HTMLElement, i, `Selector '${e}' did not match any element.`), y(this, z, i);
1388
+ if (F(e)) {
1389
+ const a = document.querySelector(e);
1390
+ ut(HTMLElement, a, `Selector '${e}' did not match any element.`), b(this, B, a);
1284
1391
  } else
1285
- st(HTMLElement, e, "Expected an HTML element or a selector string. Got type: %t, value: %v"), y(this, z, e);
1392
+ ut(HTMLElement, e, "Expected an HTML element or a selector string. Got type: %t, value: %v"), b(this, B, e);
1286
1393
  let r;
1287
- t ? r = it(t) : r = it(ht), y(this, te, this.constructView(r.type, r.props)), await Promise.all(n(this, Me).map((i) => i())), n(this, te).mount(n(this, z)), y(this, W, !0);
1288
- for (const i of n(this, Ne))
1289
- i();
1394
+ t ? r = ht(t) : r = ht(mt), b(this, te, this.constructView(r.type, r.props)), await Promise.all(s(this, Oe).map((a) => a())), s(this, te).mount(s(this, B)), b(this, z, !0);
1395
+ for (const a of s(this, Me))
1396
+ a();
1290
1397
  }
1291
1398
  async unmount() {
1292
1399
  var e;
1293
- if (n(this, W)) {
1294
- await Promise.all(n(this, Oe).map((t) => t())), (e = n(this, te)) == null || e.unmount(), y(this, W, !1);
1295
- for (const t of n(this, Te))
1400
+ if (s(this, z)) {
1401
+ await Promise.all(s(this, Te).map((t) => t())), (e = s(this, te)) == null || e.unmount(), b(this, z, !1);
1402
+ for (const t of s(this, je))
1296
1403
  t();
1297
1404
  }
1298
1405
  }
@@ -1301,26 +1408,26 @@ class Yt {
1301
1408
  * it will be awaited before mounting finishes. Use this to perform initial setup before the app is displayed to the user.
1302
1409
  */
1303
1410
  beforeMount(e) {
1304
- n(this, Me).push(e);
1411
+ s(this, Oe).push(e);
1305
1412
  }
1306
1413
  /**
1307
1414
  * Registers a `callback` to run after the app is mounted.
1308
1415
  */
1309
1416
  onMount(e) {
1310
- n(this, Ne).push(e);
1417
+ s(this, Me).push(e);
1311
1418
  }
1312
1419
  /**
1313
1420
  * Registers a `callback` to run after `Dolla.unmount` is called, before the app is unmounted. If `callback` returns a Promise,
1314
1421
  * it will be awaited before unmounting finishes. Use this to perform cleanup.
1315
1422
  */
1316
1423
  beforeUnmount(e) {
1317
- n(this, Oe).push(e);
1424
+ s(this, Te).push(e);
1318
1425
  }
1319
1426
  /**
1320
1427
  * Registers a `callback` to run after the app is unmounted.
1321
1428
  */
1322
1429
  onUnmount(e) {
1323
- n(this, Te).push(e);
1430
+ s(this, je).push(e);
1324
1431
  }
1325
1432
  /**
1326
1433
  * Update log type toggles. Values that are not passed will remain unchanged.
@@ -1328,24 +1435,24 @@ class Yt {
1328
1435
  setLoggles(e) {
1329
1436
  for (const t in e) {
1330
1437
  const r = e[t];
1331
- r && (n(this, R)[t] = r);
1438
+ r && (s(this, x)[t] = r);
1332
1439
  }
1333
1440
  }
1334
1441
  setLogFilter(e) {
1335
- y(this, G, at(e));
1442
+ b(this, K, ct(e));
1336
1443
  }
1337
1444
  createLogger(e, t) {
1338
- const r = Ke(e), i = (t == null ? void 0 : t.console) ?? xt(), s = this;
1445
+ const r = Qe(e), a = (t == null ? void 0 : t.console) ?? Tt(), n = this;
1339
1446
  return {
1340
1447
  get info() {
1341
1448
  var u;
1342
1449
  const o = r.get();
1343
- if (n(s, R).info === !1 || U(n(s, R).info) && n(s, R).info !== s.getEnv() || !n(u = s, G).call(u, o))
1450
+ if (s(n, x).info === !1 || F(s(n, x).info) && s(n, x).info !== n.getEnv() || !s(u = n, K).call(u, o))
1344
1451
  return Ae;
1345
1452
  {
1346
1453
  let l = `%c${o}`;
1347
- return t != null && t.uid ? l += ` %c[uid: %c${t.uid}%c]` : l += "%c%c%c", i.info.bind(
1348
- i,
1454
+ return t != null && t.uid ? l += ` %c[uid: %c${t.uid}%c]` : l += "%c%c%c", a.info.bind(
1455
+ a,
1349
1456
  l,
1350
1457
  `color:${De(l)};font-weight:bold`,
1351
1458
  "color:#777",
@@ -1357,12 +1464,12 @@ class Yt {
1357
1464
  get log() {
1358
1465
  var u;
1359
1466
  const o = r.get();
1360
- if (n(s, R).log === !1 || U(n(s, R).log) && n(s, R).log !== s.getEnv() || !n(u = s, G).call(u, o))
1467
+ if (s(n, x).log === !1 || F(s(n, x).log) && s(n, x).log !== n.getEnv() || !s(u = n, K).call(u, o))
1361
1468
  return Ae;
1362
1469
  {
1363
1470
  let l = `%c${o}`;
1364
- return t != null && t.uid ? l += ` %c[uid: %c${t.uid}%c]` : l += "%c%c%c", i.log.bind(
1365
- i,
1471
+ return t != null && t.uid ? l += ` %c[uid: %c${t.uid}%c]` : l += "%c%c%c", a.log.bind(
1472
+ a,
1366
1473
  l,
1367
1474
  `color:${De(l)};font-weight:bold`,
1368
1475
  "color:#777",
@@ -1374,12 +1481,12 @@ class Yt {
1374
1481
  get warn() {
1375
1482
  var u;
1376
1483
  const o = r.get();
1377
- if (n(s, R).warn === !1 || U(n(s, R).warn) && n(s, R).warn !== s.getEnv() || !n(u = s, G).call(u, o))
1484
+ if (s(n, x).warn === !1 || F(s(n, x).warn) && s(n, x).warn !== n.getEnv() || !s(u = n, K).call(u, o))
1378
1485
  return Ae;
1379
1486
  {
1380
1487
  let l = `%c${o}`;
1381
- return t != null && t.uid ? l += ` %c[uid: %c${t.uid}%c]` : l += "%c%c%c", i.warn.bind(
1382
- i,
1488
+ return t != null && t.uid ? l += ` %c[uid: %c${t.uid}%c]` : l += "%c%c%c", a.warn.bind(
1489
+ a,
1383
1490
  l,
1384
1491
  `color:${De(l)};font-weight:bold`,
1385
1492
  "color:#777",
@@ -1391,12 +1498,12 @@ class Yt {
1391
1498
  get error() {
1392
1499
  var u;
1393
1500
  const o = r.get();
1394
- if (n(s, R).error === !1 || U(n(s, R).error) && n(s, R).error !== s.getEnv() || !n(u = s, G).call(u, o))
1501
+ if (s(n, x).error === !1 || F(s(n, x).error) && s(n, x).error !== n.getEnv() || !s(u = n, K).call(u, o))
1395
1502
  return Ae;
1396
1503
  {
1397
1504
  let l = `%c${o}`;
1398
- return t != null && t.uid ? l += ` %c[uid: %c${t.uid}%c]` : l += "%c%c%c", i.error.bind(
1399
- i,
1505
+ return t != null && t.uid ? l += ` %c[uid: %c${t.uid}%c]` : l += "%c%c%c", a.error.bind(
1506
+ a,
1400
1507
  l,
1401
1508
  `color:${De(l)};font-weight:bold`,
1402
1509
  "color:#777",
@@ -1406,11 +1513,11 @@ class Yt {
1406
1513
  }
1407
1514
  },
1408
1515
  crash(o) {
1409
- throw s.isMounted && (s.unmount(), s.constructView(n(s, xe), {
1516
+ throw n.isMounted && (n.unmount(), n.constructView(s(n, Ne), {
1410
1517
  error: o,
1411
1518
  loggerName: r.get(),
1412
1519
  uid: t == null ? void 0 : t.uid
1413
- }).mount(n(s, z))), o;
1520
+ }).mount(s(n, B))), o;
1414
1521
  }
1415
1522
  };
1416
1523
  }
@@ -1418,33 +1525,33 @@ class Yt {
1418
1525
  *
1419
1526
  */
1420
1527
  constructView(e, t, r = []) {
1421
- return Mt({ root: this, data: {} }, e, t, r);
1528
+ return jt({ root: this, data: {} }, e, t, r);
1422
1529
  }
1423
1530
  /**
1424
1531
  *
1425
1532
  */
1426
1533
  constructMarkup(e) {
1427
- return Nt(Ot({ root: this, data: {} }, e));
1534
+ return At(Dt({ root: this, data: {} }, e));
1428
1535
  }
1429
1536
  }
1430
- W = new WeakMap(), Re = new WeakMap(), z = new WeakMap(), te = new WeakMap(), xe = new WeakMap(), Me = new WeakMap(), Ne = new WeakMap(), Oe = new WeakMap(), Te = new WeakMap(), R = new WeakMap(), G = new WeakMap();
1431
- const lt = new Yt(), tr = lt.i18n.t.bind(lt.i18n);
1537
+ z = new WeakMap(), Le = new WeakMap(), B = new WeakMap(), te = new WeakMap(), Ne = new WeakMap(), Oe = new WeakMap(), Me = new WeakMap(), Te = new WeakMap(), je = new WeakMap(), x = new WeakMap(), K = new WeakMap();
1538
+ const dt = new rr(), ir = dt.i18n.t.bind(dt.i18n);
1432
1539
  export {
1433
- vt as cond,
1434
- it as createMarkup,
1435
- Lt as createRef,
1436
- kt as createSettableState,
1437
- ar as createSetter,
1438
- Q as createState,
1439
- lt as default,
1440
- me as derive,
1441
- nt as html,
1442
- Rt as isRef,
1443
- sr as portal,
1444
- ir as repeat,
1445
- tr as t,
1446
- Pt as toSettableState,
1447
- Ke as toState,
1448
- St as valueOf
1540
+ Pt as cond,
1541
+ ht as createMarkup,
1542
+ Ot as createRef,
1543
+ xt as createSettableState,
1544
+ cr as createSetter,
1545
+ ie as createState,
1546
+ dt as default,
1547
+ ye as derive,
1548
+ ot as html,
1549
+ Mt as isRef,
1550
+ ur as portal,
1551
+ hr as repeat,
1552
+ ir as t,
1553
+ Lt as toSettableState,
1554
+ Qe as toState,
1555
+ Nt as valueOf
1449
1556
  };
1450
1557
  //# sourceMappingURL=index.js.map