this.me 3.0.31 → 3.0.34

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/me.es.js CHANGED
@@ -1,8 +1,44 @@
1
- var ce = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2
- function ae(E) {
3
- return E && E.__esModule && Object.prototype.hasOwnProperty.call(E, "default") ? E.default : E;
1
+ function ve(c) {
2
+ return { __ptr: c };
4
3
  }
5
- var Ut = { exports: {} };
4
+ function Yt(c) {
5
+ return !!c && typeof c == "object" && typeof c.__ptr == "string" && c.__ptr.length > 0;
6
+ }
7
+ function ge(c) {
8
+ return { __id: c };
9
+ }
10
+ function te(c) {
11
+ return !!c && typeof c == "object" && typeof c.__id == "string" && c.__id.length > 0;
12
+ }
13
+ function be(c) {
14
+ return !!c && typeof c == "object" && typeof c.path == "string" && typeof c.hash == "string" && typeof c.timestamp == "number";
15
+ }
16
+ function N(c) {
17
+ return c.length === 0 ? { scope: [], leaf: null } : { scope: c.slice(0, -1), leaf: c[c.length - 1] };
18
+ }
19
+ function le(c, r) {
20
+ if (r.length > c.length) return !1;
21
+ for (let e = 0; e < r.length; e++)
22
+ if (c[e] !== r[e]) return !1;
23
+ return !0;
24
+ }
25
+ function ce(c) {
26
+ const r = c.trim().toLowerCase();
27
+ if (r.length < 3 || r.length > 63)
28
+ throw new Error(`Invalid username length: ${r.length}. Expected 3..63 characters.`);
29
+ if (!/^[a-z0-9][a-z0-9-]*[a-z0-9]$/.test(r))
30
+ throw new Error(
31
+ `Invalid username. Use only [a-z0-9-], and start/end with [a-z0-9]. Got: ${c}`
32
+ );
33
+ if (r.includes("--"))
34
+ throw new Error(`Invalid username. "--" is not allowed. Got: ${c}`);
35
+ return r;
36
+ }
37
+ var Se = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
38
+ function ke(c) {
39
+ return c && c.__esModule && Object.prototype.hasOwnProperty.call(c, "default") ? c.default : c;
40
+ }
41
+ var ee = { exports: {} };
6
42
  /**
7
43
  * [js-sha3]{@link https://github.com/emn178/js-sha3}
8
44
  *
@@ -11,15 +47,15 @@ var Ut = { exports: {} };
11
47
  * @copyright Chen, Yi-Cyuan 2015-2023
12
48
  * @license MIT
13
49
  */
14
- var Qt;
15
- function he() {
16
- return Qt || (Qt = 1, (function(E) {
50
+ var ae;
51
+ function me() {
52
+ return ae || (ae = 1, (function(c) {
17
53
  (function() {
18
- var i = "input is invalid type", o = "finalize already called", l = typeof window == "object", c = l ? window : {};
19
- c.JS_SHA3_NO_WINDOW && (l = !1);
20
- var y = !l && typeof self == "object", b = !c.JS_SHA3_NO_NODE_JS && typeof process == "object" && process.versions && process.versions.node;
21
- b ? c = ce : y && (c = self);
22
- for (var P = !c.JS_SHA3_NO_COMMON_JS && !0 && E.exports, p = !c.JS_SHA3_NO_ARRAY_BUFFER && typeof ArrayBuffer < "u", d = "0123456789abcdef".split(""), B = [31, 7936, 2031616, 520093696], k = [4, 1024, 262144, 67108864], F = [1, 256, 65536, 16777216], w = [6, 1536, 393216, 100663296], v = [0, 8, 16, 24], _ = [
54
+ var r = "input is invalid type", e = "finalize already called", a = typeof window == "object", i = a ? window : {};
55
+ i.JS_SHA3_NO_WINDOW && (a = !1);
56
+ var f = !a && typeof self == "object", p = !i.JS_SHA3_NO_NODE_JS && typeof process == "object" && process.versions && process.versions.node;
57
+ p ? i = Se : f && (i = self);
58
+ for (var b = !i.JS_SHA3_NO_COMMON_JS && !0 && c.exports, y = !i.JS_SHA3_NO_ARRAY_BUFFER && typeof ArrayBuffer < "u", g = "0123456789abcdef".split(""), S = [31, 7936, 2031616, 520093696], O = [4, 1024, 262144, 67108864], W = [1, 256, 65536, 16777216], z = [6, 1536, 393216, 100663296], P = [0, 8, 16, 24], D = [
23
59
  1,
24
60
  0,
25
61
  32898,
@@ -68,490 +104,673 @@ function he() {
68
104
  0,
69
105
  2147516424,
70
106
  2147483648
71
- ], j = [224, 256, 384, 512], C = [128, 256], A = ["hex", "buffer", "arrayBuffer", "array", "digest"], K = {
107
+ ], E = [224, 256, 384, 512], J = [128, 256], $ = ["hex", "buffer", "arrayBuffer", "array", "digest"], q = {
72
108
  128: 168,
73
109
  256: 136
74
- }, ee = c.JS_SHA3_NO_NODE_JS || !Array.isArray ? function(t) {
110
+ }, Zt = i.JS_SHA3_NO_NODE_JS || !Array.isArray ? function(t) {
75
111
  return Object.prototype.toString.call(t) === "[object Array]";
76
- } : Array.isArray, re = p && (c.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView) ? function(t) {
112
+ } : Array.isArray, L = y && (i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView) ? function(t) {
77
113
  return typeof t == "object" && t.buffer && t.buffer.constructor === ArrayBuffer;
78
- } : ArrayBuffer.isView, Vt = function(t) {
79
- var e = typeof t;
80
- if (e === "string")
114
+ } : ArrayBuffer.isView, k = function(t) {
115
+ var n = typeof t;
116
+ if (n === "string")
81
117
  return [t, !0];
82
- if (e !== "object" || t === null)
83
- throw new Error(i);
84
- if (p && t.constructor === ArrayBuffer)
118
+ if (n !== "object" || t === null)
119
+ throw new Error(r);
120
+ if (y && t.constructor === ArrayBuffer)
85
121
  return [new Uint8Array(t), !1];
86
- if (!ee(t) && !re(t))
87
- throw new Error(i);
122
+ if (!Zt(t) && !L(t))
123
+ throw new Error(r);
88
124
  return [t, !1];
89
- }, mt = function(t) {
90
- return Vt(t)[0].length === 0;
91
- }, Jt = function(t) {
92
- for (var e = [], r = 0; r < t.length; ++r)
93
- e[r] = t[r];
94
- return e;
95
- }, Gt = function(t, e, r) {
96
- return function(n) {
97
- return new g(t, e, t).update(n)[r]();
125
+ }, x = function(t) {
126
+ return k(t)[0].length === 0;
127
+ }, C = function(t) {
128
+ for (var n = [], o = 0; o < t.length; ++o)
129
+ n[o] = t[o];
130
+ return n;
131
+ }, w = function(t, n, o) {
132
+ return function(l) {
133
+ return new B(t, n, t).update(l)[o]();
98
134
  };
99
- }, Yt = function(t, e, r) {
100
- return function(n, a) {
101
- return new g(t, e, a).update(n)[r]();
135
+ }, _ = function(t, n, o) {
136
+ return function(l, u) {
137
+ return new B(t, n, u).update(l)[o]();
102
138
  };
103
- }, qt = function(t, e, r) {
104
- return function(n, a, h, u) {
105
- return T["cshake" + t].update(n, a, h, u)[r]();
139
+ }, F = function(t, n, o) {
140
+ return function(l, u, h, d) {
141
+ return M["cshake" + t].update(l, u, h, d)[o]();
106
142
  };
107
- }, $t = function(t, e, r) {
108
- return function(n, a, h, u) {
109
- return T["kmac" + t].update(n, a, h, u)[r]();
143
+ }, I = function(t, n, o) {
144
+ return function(l, u, h, d) {
145
+ return M["kmac" + t].update(l, u, h, d)[o]();
110
146
  };
111
- }, I = function(t, e, r, n) {
112
- for (var a = 0; a < A.length; ++a) {
113
- var h = A[a];
114
- t[h] = e(r, n, h);
147
+ }, j = function(t, n, o, l) {
148
+ for (var u = 0; u < $.length; ++u) {
149
+ var h = $[u];
150
+ t[h] = n(o, l, h);
115
151
  }
116
152
  return t;
117
- }, Lt = function(t, e) {
118
- var r = Gt(t, e, "hex");
119
- return r.create = function() {
120
- return new g(t, e, t);
121
- }, r.update = function(n) {
122
- return r.create().update(n);
123
- }, I(r, Gt, t, e);
124
- }, ne = function(t, e) {
125
- var r = Yt(t, e, "hex");
126
- return r.create = function(n) {
127
- return new g(t, e, n);
128
- }, r.update = function(n, a) {
129
- return r.create(a).update(n);
130
- }, I(r, Yt, t, e);
131
- }, oe = function(t, e) {
132
- var r = K[t], n = qt(t, e, "hex");
133
- return n.create = function(a, h, u) {
134
- return mt(h) && mt(u) ? T["shake" + t].create(a) : new g(t, e, a).bytepad([h, u], r);
135
- }, n.update = function(a, h, u, f) {
136
- return n.create(h, u, f).update(a);
137
- }, I(n, qt, t, e);
138
- }, ie = function(t, e) {
139
- var r = K[t], n = $t(t, e, "hex");
140
- return n.create = function(a, h, u) {
141
- return new Wt(t, e, h).bytepad(["KMAC", u], r).bytepad([a], r);
142
- }, n.update = function(a, h, u, f) {
143
- return n.create(a, u, f).update(h);
144
- }, I(n, $t, t, e);
145
- }, Xt = [
146
- { name: "keccak", padding: F, bits: j, createMethod: Lt },
147
- { name: "sha3", padding: w, bits: j, createMethod: Lt },
148
- { name: "shake", padding: B, bits: C, createMethod: ne },
149
- { name: "cshake", padding: k, bits: C, createMethod: oe },
150
- { name: "kmac", padding: k, bits: C, createMethod: ie }
151
- ], T = {}, M = [], R = 0; R < Xt.length; ++R)
152
- for (var N = Xt[R], V = N.bits, D = 0; D < V.length; ++D) {
153
- var zt = N.name + "_" + V[D];
154
- if (M.push(zt), T[zt] = N.createMethod(V[D], N.padding), N.name !== "sha3") {
155
- var Zt = N.name + V[D];
156
- M.push(Zt), T[Zt] = T[zt];
153
+ }, K = function(t, n) {
154
+ var o = w(t, n, "hex");
155
+ return o.create = function() {
156
+ return new B(t, n, t);
157
+ }, o.update = function(l) {
158
+ return o.create().update(l);
159
+ }, j(o, w, t, n);
160
+ }, de = function(t, n) {
161
+ var o = _(t, n, "hex");
162
+ return o.create = function(l) {
163
+ return new B(t, n, l);
164
+ }, o.update = function(l, u) {
165
+ return o.create(u).update(l);
166
+ }, j(o, _, t, n);
167
+ }, pe = function(t, n) {
168
+ var o = q[t], l = F(t, n, "hex");
169
+ return l.create = function(u, h, d) {
170
+ return x(h) && x(d) ? M["shake" + t].create(u) : new B(t, n, u).bytepad([h, d], o);
171
+ }, l.update = function(u, h, d, s) {
172
+ return l.create(h, d, s).update(u);
173
+ }, j(l, F, t, n);
174
+ }, ye = function(t, n) {
175
+ var o = q[t], l = I(t, n, "hex");
176
+ return l.create = function(u, h, d) {
177
+ return new Xt(t, n, h).bytepad(["KMAC", d], o).bytepad([u], o);
178
+ }, l.update = function(u, h, d, s) {
179
+ return l.create(u, d, s).update(h);
180
+ }, j(l, I, t, n);
181
+ }, ie = [
182
+ { name: "keccak", padding: W, bits: E, createMethod: K },
183
+ { name: "sha3", padding: z, bits: E, createMethod: K },
184
+ { name: "shake", padding: S, bits: J, createMethod: de },
185
+ { name: "cshake", padding: O, bits: J, createMethod: pe },
186
+ { name: "kmac", padding: O, bits: J, createMethod: ye }
187
+ ], M = {}, U = [], T = 0; T < ie.length; ++T)
188
+ for (var H = ie[T], Y = H.bits, V = 0; V < Y.length; ++V) {
189
+ var Qt = H.name + "_" + Y[V];
190
+ if (U.push(Qt), M[Qt] = H.createMethod(Y[V], H.padding), H.name !== "sha3") {
191
+ var oe = H.name + Y[V];
192
+ U.push(oe), M[oe] = M[Qt];
157
193
  }
158
194
  }
159
- function g(t, e, r) {
160
- this.blocks = [], this.s = [], this.padding = e, this.outputBits = r, this.reset = !0, this.finalized = !1, this.block = 0, this.start = 0, this.blockCount = 1600 - (t << 1) >> 5, this.byteCount = this.blockCount << 2, this.outputBlocks = r >> 5, this.extraBytes = (r & 31) >> 3;
161
- for (var n = 0; n < 50; ++n)
162
- this.s[n] = 0;
195
+ function B(t, n, o) {
196
+ this.blocks = [], this.s = [], this.padding = n, this.outputBits = o, this.reset = !0, this.finalized = !1, this.block = 0, this.start = 0, this.blockCount = 1600 - (t << 1) >> 5, this.byteCount = this.blockCount << 2, this.outputBlocks = o >> 5, this.extraBytes = (o & 31) >> 3;
197
+ for (var l = 0; l < 50; ++l)
198
+ this.s[l] = 0;
163
199
  }
164
- g.prototype.update = function(t) {
200
+ B.prototype.update = function(t) {
165
201
  if (this.finalized)
166
- throw new Error(o);
167
- var e = Vt(t);
168
- t = e[0];
169
- for (var r = e[1], n = this.blocks, a = this.byteCount, h = t.length, u = this.blockCount, f = 0, S = this.s, s, x; f < h; ) {
202
+ throw new Error(e);
203
+ var n = k(t);
204
+ t = n[0];
205
+ for (var o = n[1], l = this.blocks, u = this.byteCount, h = t.length, d = this.blockCount, s = 0, A = this.s, v, m; s < h; ) {
170
206
  if (this.reset)
171
- for (this.reset = !1, n[0] = this.block, s = 1; s < u + 1; ++s)
172
- n[s] = 0;
173
- if (r)
174
- for (s = this.start; f < h && s < a; ++f)
175
- x = t.charCodeAt(f), x < 128 ? n[s >> 2] |= x << v[s++ & 3] : x < 2048 ? (n[s >> 2] |= (192 | x >> 6) << v[s++ & 3], n[s >> 2] |= (128 | x & 63) << v[s++ & 3]) : x < 55296 || x >= 57344 ? (n[s >> 2] |= (224 | x >> 12) << v[s++ & 3], n[s >> 2] |= (128 | x >> 6 & 63) << v[s++ & 3], n[s >> 2] |= (128 | x & 63) << v[s++ & 3]) : (x = 65536 + ((x & 1023) << 10 | t.charCodeAt(++f) & 1023), n[s >> 2] |= (240 | x >> 18) << v[s++ & 3], n[s >> 2] |= (128 | x >> 12 & 63) << v[s++ & 3], n[s >> 2] |= (128 | x >> 6 & 63) << v[s++ & 3], n[s >> 2] |= (128 | x & 63) << v[s++ & 3]);
207
+ for (this.reset = !1, l[0] = this.block, v = 1; v < d + 1; ++v)
208
+ l[v] = 0;
209
+ if (o)
210
+ for (v = this.start; s < h && v < u; ++s)
211
+ m = t.charCodeAt(s), m < 128 ? l[v >> 2] |= m << P[v++ & 3] : m < 2048 ? (l[v >> 2] |= (192 | m >> 6) << P[v++ & 3], l[v >> 2] |= (128 | m & 63) << P[v++ & 3]) : m < 55296 || m >= 57344 ? (l[v >> 2] |= (224 | m >> 12) << P[v++ & 3], l[v >> 2] |= (128 | m >> 6 & 63) << P[v++ & 3], l[v >> 2] |= (128 | m & 63) << P[v++ & 3]) : (m = 65536 + ((m & 1023) << 10 | t.charCodeAt(++s) & 1023), l[v >> 2] |= (240 | m >> 18) << P[v++ & 3], l[v >> 2] |= (128 | m >> 12 & 63) << P[v++ & 3], l[v >> 2] |= (128 | m >> 6 & 63) << P[v++ & 3], l[v >> 2] |= (128 | m & 63) << P[v++ & 3]);
176
212
  else
177
- for (s = this.start; f < h && s < a; ++f)
178
- n[s >> 2] |= t[f] << v[s++ & 3];
179
- if (this.lastByteIndex = s, s >= a) {
180
- for (this.start = s - a, this.block = n[u], s = 0; s < u; ++s)
181
- S[s] ^= n[s];
182
- H(S), this.reset = !0;
213
+ for (v = this.start; s < h && v < u; ++s)
214
+ l[v >> 2] |= t[s] << P[v++ & 3];
215
+ if (this.lastByteIndex = v, v >= u) {
216
+ for (this.start = v - u, this.block = l[d], v = 0; v < d; ++v)
217
+ A[v] ^= l[v];
218
+ G(A), this.reset = !0;
183
219
  } else
184
- this.start = s;
220
+ this.start = v;
185
221
  }
186
222
  return this;
187
- }, g.prototype.encode = function(t, e) {
188
- var r = t & 255, n = 1, a = [r];
189
- for (t = t >> 8, r = t & 255; r > 0; )
190
- a.unshift(r), t = t >> 8, r = t & 255, ++n;
191
- return e ? a.push(n) : a.unshift(n), this.update(a), a.length;
192
- }, g.prototype.encodeString = function(t) {
193
- var e = Vt(t);
194
- t = e[0];
195
- var r = e[1], n = 0, a = t.length;
196
- if (r)
223
+ }, B.prototype.encode = function(t, n) {
224
+ var o = t & 255, l = 1, u = [o];
225
+ for (t = t >> 8, o = t & 255; o > 0; )
226
+ u.unshift(o), t = t >> 8, o = t & 255, ++l;
227
+ return n ? u.push(l) : u.unshift(l), this.update(u), u.length;
228
+ }, B.prototype.encodeString = function(t) {
229
+ var n = k(t);
230
+ t = n[0];
231
+ var o = n[1], l = 0, u = t.length;
232
+ if (o)
197
233
  for (var h = 0; h < t.length; ++h) {
198
- var u = t.charCodeAt(h);
199
- u < 128 ? n += 1 : u < 2048 ? n += 2 : u < 55296 || u >= 57344 ? n += 3 : (u = 65536 + ((u & 1023) << 10 | t.charCodeAt(++h) & 1023), n += 4);
234
+ var d = t.charCodeAt(h);
235
+ d < 128 ? l += 1 : d < 2048 ? l += 2 : d < 55296 || d >= 57344 ? l += 3 : (d = 65536 + ((d & 1023) << 10 | t.charCodeAt(++h) & 1023), l += 4);
200
236
  }
201
237
  else
202
- n = a;
203
- return n += this.encode(n * 8), this.update(t), n;
204
- }, g.prototype.bytepad = function(t, e) {
205
- for (var r = this.encode(e), n = 0; n < t.length; ++n)
206
- r += this.encodeString(t[n]);
207
- var a = (e - r % e) % e, h = [];
208
- return h.length = a, this.update(h), this;
209
- }, g.prototype.finalize = function() {
238
+ l = u;
239
+ return l += this.encode(l * 8), this.update(t), l;
240
+ }, B.prototype.bytepad = function(t, n) {
241
+ for (var o = this.encode(n), l = 0; l < t.length; ++l)
242
+ o += this.encodeString(t[l]);
243
+ var u = (n - o % n) % n, h = [];
244
+ return h.length = u, this.update(h), this;
245
+ }, B.prototype.finalize = function() {
210
246
  if (!this.finalized) {
211
247
  this.finalized = !0;
212
- var t = this.blocks, e = this.lastByteIndex, r = this.blockCount, n = this.s;
213
- if (t[e >> 2] |= this.padding[e & 3], this.lastByteIndex === this.byteCount)
214
- for (t[0] = t[r], e = 1; e < r + 1; ++e)
215
- t[e] = 0;
216
- for (t[r - 1] |= 2147483648, e = 0; e < r; ++e)
217
- n[e] ^= t[e];
218
- H(n);
248
+ var t = this.blocks, n = this.lastByteIndex, o = this.blockCount, l = this.s;
249
+ if (t[n >> 2] |= this.padding[n & 3], this.lastByteIndex === this.byteCount)
250
+ for (t[0] = t[o], n = 1; n < o + 1; ++n)
251
+ t[n] = 0;
252
+ for (t[o - 1] |= 2147483648, n = 0; n < o; ++n)
253
+ l[n] ^= t[n];
254
+ G(l);
219
255
  }
220
- }, g.prototype.toString = g.prototype.hex = function() {
256
+ }, B.prototype.toString = B.prototype.hex = function() {
221
257
  this.finalize();
222
- for (var t = this.blockCount, e = this.s, r = this.outputBlocks, n = this.extraBytes, a = 0, h = 0, u = "", f; h < r; ) {
223
- for (a = 0; a < t && h < r; ++a, ++h)
224
- f = e[a], u += d[f >> 4 & 15] + d[f & 15] + d[f >> 12 & 15] + d[f >> 8 & 15] + d[f >> 20 & 15] + d[f >> 16 & 15] + d[f >> 28 & 15] + d[f >> 24 & 15];
225
- h % t === 0 && (e = Jt(e), H(e), a = 0);
258
+ for (var t = this.blockCount, n = this.s, o = this.outputBlocks, l = this.extraBytes, u = 0, h = 0, d = "", s; h < o; ) {
259
+ for (u = 0; u < t && h < o; ++u, ++h)
260
+ s = n[u], d += g[s >> 4 & 15] + g[s & 15] + g[s >> 12 & 15] + g[s >> 8 & 15] + g[s >> 20 & 15] + g[s >> 16 & 15] + g[s >> 28 & 15] + g[s >> 24 & 15];
261
+ h % t === 0 && (n = C(n), G(n), u = 0);
226
262
  }
227
- return n && (f = e[a], u += d[f >> 4 & 15] + d[f & 15], n > 1 && (u += d[f >> 12 & 15] + d[f >> 8 & 15]), n > 2 && (u += d[f >> 20 & 15] + d[f >> 16 & 15])), u;
228
- }, g.prototype.arrayBuffer = function() {
263
+ return l && (s = n[u], d += g[s >> 4 & 15] + g[s & 15], l > 1 && (d += g[s >> 12 & 15] + g[s >> 8 & 15]), l > 2 && (d += g[s >> 20 & 15] + g[s >> 16 & 15])), d;
264
+ }, B.prototype.arrayBuffer = function() {
229
265
  this.finalize();
230
- var t = this.blockCount, e = this.s, r = this.outputBlocks, n = this.extraBytes, a = 0, h = 0, u = this.outputBits >> 3, f;
231
- n ? f = new ArrayBuffer(r + 1 << 2) : f = new ArrayBuffer(u);
232
- for (var S = new Uint32Array(f); h < r; ) {
233
- for (a = 0; a < t && h < r; ++a, ++h)
234
- S[h] = e[a];
235
- h % t === 0 && (e = Jt(e), H(e));
266
+ var t = this.blockCount, n = this.s, o = this.outputBlocks, l = this.extraBytes, u = 0, h = 0, d = this.outputBits >> 3, s;
267
+ l ? s = new ArrayBuffer(o + 1 << 2) : s = new ArrayBuffer(d);
268
+ for (var A = new Uint32Array(s); h < o; ) {
269
+ for (u = 0; u < t && h < o; ++u, ++h)
270
+ A[h] = n[u];
271
+ h % t === 0 && (n = C(n), G(n));
236
272
  }
237
- return n && (S[h] = e[a], f = f.slice(0, u)), f;
238
- }, g.prototype.buffer = g.prototype.arrayBuffer, g.prototype.digest = g.prototype.array = function() {
273
+ return l && (A[h] = n[u], s = s.slice(0, d)), s;
274
+ }, B.prototype.buffer = B.prototype.arrayBuffer, B.prototype.digest = B.prototype.array = function() {
239
275
  this.finalize();
240
- for (var t = this.blockCount, e = this.s, r = this.outputBlocks, n = this.extraBytes, a = 0, h = 0, u = [], f, S; h < r; ) {
241
- for (a = 0; a < t && h < r; ++a, ++h)
242
- f = h << 2, S = e[a], u[f] = S & 255, u[f + 1] = S >> 8 & 255, u[f + 2] = S >> 16 & 255, u[f + 3] = S >> 24 & 255;
243
- h % t === 0 && (e = Jt(e), H(e));
276
+ for (var t = this.blockCount, n = this.s, o = this.outputBlocks, l = this.extraBytes, u = 0, h = 0, d = [], s, A; h < o; ) {
277
+ for (u = 0; u < t && h < o; ++u, ++h)
278
+ s = h << 2, A = n[u], d[s] = A & 255, d[s + 1] = A >> 8 & 255, d[s + 2] = A >> 16 & 255, d[s + 3] = A >> 24 & 255;
279
+ h % t === 0 && (n = C(n), G(n));
244
280
  }
245
- return n && (f = h << 2, S = e[a], u[f] = S & 255, n > 1 && (u[f + 1] = S >> 8 & 255), n > 2 && (u[f + 2] = S >> 16 & 255)), u;
281
+ return l && (s = h << 2, A = n[u], d[s] = A & 255, l > 1 && (d[s + 1] = A >> 8 & 255), l > 2 && (d[s + 2] = A >> 16 & 255)), d;
246
282
  };
247
- function Wt(t, e, r) {
248
- g.call(this, t, e, r);
283
+ function Xt(t, n, o) {
284
+ B.call(this, t, n, o);
249
285
  }
250
- Wt.prototype = new g(), Wt.prototype.finalize = function() {
251
- return this.encode(this.outputBits, !0), g.prototype.finalize.call(this);
286
+ Xt.prototype = new B(), Xt.prototype.finalize = function() {
287
+ return this.encode(this.outputBits, !0), B.prototype.finalize.call(this);
252
288
  };
253
- var H = function(t) {
254
- var e, r, n, a, h, u, f, S, s, x, J, z, W, U, m, G, Y, q, $, L, X, Z, Q, tt, et, rt, nt, ot, it, ct, at, ht, ft, lt, ut, st, yt, dt, bt, pt, vt, xt, gt, St, Bt, Pt, kt, At, Ft, wt, _t, jt, Ct, Ot, Et, Tt, Rt, Kt, Nt, Mt, Dt, Ht, It;
255
- for (n = 0; n < 48; n += 2)
256
- a = t[0] ^ t[10] ^ t[20] ^ t[30] ^ t[40], h = t[1] ^ t[11] ^ t[21] ^ t[31] ^ t[41], u = t[2] ^ t[12] ^ t[22] ^ t[32] ^ t[42], f = t[3] ^ t[13] ^ t[23] ^ t[33] ^ t[43], S = t[4] ^ t[14] ^ t[24] ^ t[34] ^ t[44], s = t[5] ^ t[15] ^ t[25] ^ t[35] ^ t[45], x = t[6] ^ t[16] ^ t[26] ^ t[36] ^ t[46], J = t[7] ^ t[17] ^ t[27] ^ t[37] ^ t[47], z = t[8] ^ t[18] ^ t[28] ^ t[38] ^ t[48], W = t[9] ^ t[19] ^ t[29] ^ t[39] ^ t[49], e = z ^ (u << 1 | f >>> 31), r = W ^ (f << 1 | u >>> 31), t[0] ^= e, t[1] ^= r, t[10] ^= e, t[11] ^= r, t[20] ^= e, t[21] ^= r, t[30] ^= e, t[31] ^= r, t[40] ^= e, t[41] ^= r, e = a ^ (S << 1 | s >>> 31), r = h ^ (s << 1 | S >>> 31), t[2] ^= e, t[3] ^= r, t[12] ^= e, t[13] ^= r, t[22] ^= e, t[23] ^= r, t[32] ^= e, t[33] ^= r, t[42] ^= e, t[43] ^= r, e = u ^ (x << 1 | J >>> 31), r = f ^ (J << 1 | x >>> 31), t[4] ^= e, t[5] ^= r, t[14] ^= e, t[15] ^= r, t[24] ^= e, t[25] ^= r, t[34] ^= e, t[35] ^= r, t[44] ^= e, t[45] ^= r, e = S ^ (z << 1 | W >>> 31), r = s ^ (W << 1 | z >>> 31), t[6] ^= e, t[7] ^= r, t[16] ^= e, t[17] ^= r, t[26] ^= e, t[27] ^= r, t[36] ^= e, t[37] ^= r, t[46] ^= e, t[47] ^= r, e = x ^ (a << 1 | h >>> 31), r = J ^ (h << 1 | a >>> 31), t[8] ^= e, t[9] ^= r, t[18] ^= e, t[19] ^= r, t[28] ^= e, t[29] ^= r, t[38] ^= e, t[39] ^= r, t[48] ^= e, t[49] ^= r, U = t[0], m = t[1], Pt = t[11] << 4 | t[10] >>> 28, kt = t[10] << 4 | t[11] >>> 28, ot = t[20] << 3 | t[21] >>> 29, it = t[21] << 3 | t[20] >>> 29, Mt = t[31] << 9 | t[30] >>> 23, Dt = t[30] << 9 | t[31] >>> 23, xt = t[40] << 18 | t[41] >>> 14, gt = t[41] << 18 | t[40] >>> 14, lt = t[2] << 1 | t[3] >>> 31, ut = t[3] << 1 | t[2] >>> 31, G = t[13] << 12 | t[12] >>> 20, Y = t[12] << 12 | t[13] >>> 20, At = t[22] << 10 | t[23] >>> 22, Ft = t[23] << 10 | t[22] >>> 22, ct = t[33] << 13 | t[32] >>> 19, at = t[32] << 13 | t[33] >>> 19, Ht = t[42] << 2 | t[43] >>> 30, It = t[43] << 2 | t[42] >>> 30, Ot = t[5] << 30 | t[4] >>> 2, Et = t[4] << 30 | t[5] >>> 2, st = t[14] << 6 | t[15] >>> 26, yt = t[15] << 6 | t[14] >>> 26, q = t[25] << 11 | t[24] >>> 21, $ = t[24] << 11 | t[25] >>> 21, wt = t[34] << 15 | t[35] >>> 17, _t = t[35] << 15 | t[34] >>> 17, ht = t[45] << 29 | t[44] >>> 3, ft = t[44] << 29 | t[45] >>> 3, tt = t[6] << 28 | t[7] >>> 4, et = t[7] << 28 | t[6] >>> 4, Tt = t[17] << 23 | t[16] >>> 9, Rt = t[16] << 23 | t[17] >>> 9, dt = t[26] << 25 | t[27] >>> 7, bt = t[27] << 25 | t[26] >>> 7, L = t[36] << 21 | t[37] >>> 11, X = t[37] << 21 | t[36] >>> 11, jt = t[47] << 24 | t[46] >>> 8, Ct = t[46] << 24 | t[47] >>> 8, St = t[8] << 27 | t[9] >>> 5, Bt = t[9] << 27 | t[8] >>> 5, rt = t[18] << 20 | t[19] >>> 12, nt = t[19] << 20 | t[18] >>> 12, Kt = t[29] << 7 | t[28] >>> 25, Nt = t[28] << 7 | t[29] >>> 25, pt = t[38] << 8 | t[39] >>> 24, vt = t[39] << 8 | t[38] >>> 24, Z = t[48] << 14 | t[49] >>> 18, Q = t[49] << 14 | t[48] >>> 18, t[0] = U ^ ~G & q, t[1] = m ^ ~Y & $, t[10] = tt ^ ~rt & ot, t[11] = et ^ ~nt & it, t[20] = lt ^ ~st & dt, t[21] = ut ^ ~yt & bt, t[30] = St ^ ~Pt & At, t[31] = Bt ^ ~kt & Ft, t[40] = Ot ^ ~Tt & Kt, t[41] = Et ^ ~Rt & Nt, t[2] = G ^ ~q & L, t[3] = Y ^ ~$ & X, t[12] = rt ^ ~ot & ct, t[13] = nt ^ ~it & at, t[22] = st ^ ~dt & pt, t[23] = yt ^ ~bt & vt, t[32] = Pt ^ ~At & wt, t[33] = kt ^ ~Ft & _t, t[42] = Tt ^ ~Kt & Mt, t[43] = Rt ^ ~Nt & Dt, t[4] = q ^ ~L & Z, t[5] = $ ^ ~X & Q, t[14] = ot ^ ~ct & ht, t[15] = it ^ ~at & ft, t[24] = dt ^ ~pt & xt, t[25] = bt ^ ~vt & gt, t[34] = At ^ ~wt & jt, t[35] = Ft ^ ~_t & Ct, t[44] = Kt ^ ~Mt & Ht, t[45] = Nt ^ ~Dt & It, t[6] = L ^ ~Z & U, t[7] = X ^ ~Q & m, t[16] = ct ^ ~ht & tt, t[17] = at ^ ~ft & et, t[26] = pt ^ ~xt & lt, t[27] = vt ^ ~gt & ut, t[36] = wt ^ ~jt & St, t[37] = _t ^ ~Ct & Bt, t[46] = Mt ^ ~Ht & Ot, t[47] = Dt ^ ~It & Et, t[8] = Z ^ ~U & G, t[9] = Q ^ ~m & Y, t[18] = ht ^ ~tt & rt, t[19] = ft ^ ~et & nt, t[28] = xt ^ ~lt & st, t[29] = gt ^ ~ut & yt, t[38] = jt ^ ~St & Pt, t[39] = Ct ^ ~Bt & kt, t[48] = Ht ^ ~Ot & Tt, t[49] = It ^ ~Et & Rt, t[0] ^= _[n], t[1] ^= _[n + 1];
289
+ var G = function(t) {
290
+ var n, o, l, u, h, d, s, A, v, m, Z, Q, X, tt, et, rt, nt, it, ot, lt, ct, at, ft, ut, ht, st, dt, pt, yt, vt, gt, bt, St, kt, mt, _t, xt, Bt, At, Pt, wt, Ct, Et, Ot, It, Ft, Nt, jt, Kt, Mt, Tt, zt, Dt, Rt, Wt, Jt, Ht, Ut, Vt, Gt, $t, qt, Lt;
291
+ for (l = 0; l < 48; l += 2)
292
+ u = t[0] ^ t[10] ^ t[20] ^ t[30] ^ t[40], h = t[1] ^ t[11] ^ t[21] ^ t[31] ^ t[41], d = t[2] ^ t[12] ^ t[22] ^ t[32] ^ t[42], s = t[3] ^ t[13] ^ t[23] ^ t[33] ^ t[43], A = t[4] ^ t[14] ^ t[24] ^ t[34] ^ t[44], v = t[5] ^ t[15] ^ t[25] ^ t[35] ^ t[45], m = t[6] ^ t[16] ^ t[26] ^ t[36] ^ t[46], Z = t[7] ^ t[17] ^ t[27] ^ t[37] ^ t[47], Q = t[8] ^ t[18] ^ t[28] ^ t[38] ^ t[48], X = t[9] ^ t[19] ^ t[29] ^ t[39] ^ t[49], n = Q ^ (d << 1 | s >>> 31), o = X ^ (s << 1 | d >>> 31), t[0] ^= n, t[1] ^= o, t[10] ^= n, t[11] ^= o, t[20] ^= n, t[21] ^= o, t[30] ^= n, t[31] ^= o, t[40] ^= n, t[41] ^= o, n = u ^ (A << 1 | v >>> 31), o = h ^ (v << 1 | A >>> 31), t[2] ^= n, t[3] ^= o, t[12] ^= n, t[13] ^= o, t[22] ^= n, t[23] ^= o, t[32] ^= n, t[33] ^= o, t[42] ^= n, t[43] ^= o, n = d ^ (m << 1 | Z >>> 31), o = s ^ (Z << 1 | m >>> 31), t[4] ^= n, t[5] ^= o, t[14] ^= n, t[15] ^= o, t[24] ^= n, t[25] ^= o, t[34] ^= n, t[35] ^= o, t[44] ^= n, t[45] ^= o, n = A ^ (Q << 1 | X >>> 31), o = v ^ (X << 1 | Q >>> 31), t[6] ^= n, t[7] ^= o, t[16] ^= n, t[17] ^= o, t[26] ^= n, t[27] ^= o, t[36] ^= n, t[37] ^= o, t[46] ^= n, t[47] ^= o, n = m ^ (u << 1 | h >>> 31), o = Z ^ (h << 1 | u >>> 31), t[8] ^= n, t[9] ^= o, t[18] ^= n, t[19] ^= o, t[28] ^= n, t[29] ^= o, t[38] ^= n, t[39] ^= o, t[48] ^= n, t[49] ^= o, tt = t[0], et = t[1], Ft = t[11] << 4 | t[10] >>> 28, Nt = t[10] << 4 | t[11] >>> 28, pt = t[20] << 3 | t[21] >>> 29, yt = t[21] << 3 | t[20] >>> 29, Gt = t[31] << 9 | t[30] >>> 23, $t = t[30] << 9 | t[31] >>> 23, Ct = t[40] << 18 | t[41] >>> 14, Et = t[41] << 18 | t[40] >>> 14, kt = t[2] << 1 | t[3] >>> 31, mt = t[3] << 1 | t[2] >>> 31, rt = t[13] << 12 | t[12] >>> 20, nt = t[12] << 12 | t[13] >>> 20, jt = t[22] << 10 | t[23] >>> 22, Kt = t[23] << 10 | t[22] >>> 22, vt = t[33] << 13 | t[32] >>> 19, gt = t[32] << 13 | t[33] >>> 19, qt = t[42] << 2 | t[43] >>> 30, Lt = t[43] << 2 | t[42] >>> 30, Rt = t[5] << 30 | t[4] >>> 2, Wt = t[4] << 30 | t[5] >>> 2, _t = t[14] << 6 | t[15] >>> 26, xt = t[15] << 6 | t[14] >>> 26, it = t[25] << 11 | t[24] >>> 21, ot = t[24] << 11 | t[25] >>> 21, Mt = t[34] << 15 | t[35] >>> 17, Tt = t[35] << 15 | t[34] >>> 17, bt = t[45] << 29 | t[44] >>> 3, St = t[44] << 29 | t[45] >>> 3, ut = t[6] << 28 | t[7] >>> 4, ht = t[7] << 28 | t[6] >>> 4, Jt = t[17] << 23 | t[16] >>> 9, Ht = t[16] << 23 | t[17] >>> 9, Bt = t[26] << 25 | t[27] >>> 7, At = t[27] << 25 | t[26] >>> 7, lt = t[36] << 21 | t[37] >>> 11, ct = t[37] << 21 | t[36] >>> 11, zt = t[47] << 24 | t[46] >>> 8, Dt = t[46] << 24 | t[47] >>> 8, Ot = t[8] << 27 | t[9] >>> 5, It = t[9] << 27 | t[8] >>> 5, st = t[18] << 20 | t[19] >>> 12, dt = t[19] << 20 | t[18] >>> 12, Ut = t[29] << 7 | t[28] >>> 25, Vt = t[28] << 7 | t[29] >>> 25, Pt = t[38] << 8 | t[39] >>> 24, wt = t[39] << 8 | t[38] >>> 24, at = t[48] << 14 | t[49] >>> 18, ft = t[49] << 14 | t[48] >>> 18, t[0] = tt ^ ~rt & it, t[1] = et ^ ~nt & ot, t[10] = ut ^ ~st & pt, t[11] = ht ^ ~dt & yt, t[20] = kt ^ ~_t & Bt, t[21] = mt ^ ~xt & At, t[30] = Ot ^ ~Ft & jt, t[31] = It ^ ~Nt & Kt, t[40] = Rt ^ ~Jt & Ut, t[41] = Wt ^ ~Ht & Vt, t[2] = rt ^ ~it & lt, t[3] = nt ^ ~ot & ct, t[12] = st ^ ~pt & vt, t[13] = dt ^ ~yt & gt, t[22] = _t ^ ~Bt & Pt, t[23] = xt ^ ~At & wt, t[32] = Ft ^ ~jt & Mt, t[33] = Nt ^ ~Kt & Tt, t[42] = Jt ^ ~Ut & Gt, t[43] = Ht ^ ~Vt & $t, t[4] = it ^ ~lt & at, t[5] = ot ^ ~ct & ft, t[14] = pt ^ ~vt & bt, t[15] = yt ^ ~gt & St, t[24] = Bt ^ ~Pt & Ct, t[25] = At ^ ~wt & Et, t[34] = jt ^ ~Mt & zt, t[35] = Kt ^ ~Tt & Dt, t[44] = Ut ^ ~Gt & qt, t[45] = Vt ^ ~$t & Lt, t[6] = lt ^ ~at & tt, t[7] = ct ^ ~ft & et, t[16] = vt ^ ~bt & ut, t[17] = gt ^ ~St & ht, t[26] = Pt ^ ~Ct & kt, t[27] = wt ^ ~Et & mt, t[36] = Mt ^ ~zt & Ot, t[37] = Tt ^ ~Dt & It, t[46] = Gt ^ ~qt & Rt, t[47] = $t ^ ~Lt & Wt, t[8] = at ^ ~tt & rt, t[9] = ft ^ ~et & nt, t[18] = bt ^ ~ut & st, t[19] = St ^ ~ht & dt, t[28] = Ct ^ ~kt & _t, t[29] = Et ^ ~mt & xt, t[38] = zt ^ ~Ot & Ft, t[39] = Dt ^ ~It & Nt, t[48] = qt ^ ~Rt & Jt, t[49] = Lt ^ ~Wt & Ht, t[0] ^= D[l], t[1] ^= D[l + 1];
257
293
  };
258
- if (P)
259
- E.exports = T;
294
+ if (b)
295
+ c.exports = M;
260
296
  else
261
- for (R = 0; R < M.length; ++R)
262
- c[M[R]] = T[M[R]];
297
+ for (T = 0; T < U.length; ++T)
298
+ i[U[T]] = M[U[T]];
263
299
  })();
264
- })(Ut)), Ut.exports;
300
+ })(ee)), ee.exports;
301
+ }
302
+ var _e = me();
303
+ const xe = /* @__PURE__ */ ke(_e), { keccak256: he } = xe;
304
+ function ne(c) {
305
+ return new TextEncoder().encode(c);
306
+ }
307
+ function Be(c) {
308
+ const r = c.startsWith("0x") ? c.slice(2) : c, e = new Uint8Array(r.length / 2);
309
+ for (let a = 0; a < e.length; a++)
310
+ e[a] = parseInt(r.substring(a * 2, a * 2 + 2), 16);
311
+ return e;
312
+ }
313
+ function Ae(c) {
314
+ let r = "";
315
+ for (let e = 0; e < c.length; e++)
316
+ r += c[e].toString(16).padStart(2, "0");
317
+ return "0x" + r;
318
+ }
319
+ function fe(c, r, e) {
320
+ const a = JSON.stringify(c), i = ne(a), f = he(r + ":" + e.join(".")), p = ne(f), b = new Uint8Array(i.length);
321
+ for (let y = 0; y < i.length; y++)
322
+ b[y] = i[y] ^ p[y % p.length];
323
+ return Ae(b);
265
324
  }
266
- var fe = he();
267
- const le = /* @__PURE__ */ ae(fe), { keccak256: O } = le;
268
- class te {
269
- constructor(i, o, l) {
270
- this.payload = {}, this.declarations = [], this.secrets = {}, this.branchVersions = {}, this.username = i, this.secret = o, this.blockchain = l, this.identityRoot = "0x" + O(o), this.publicKey = "0x" + O("public:" + o), this.identityHash = "0x" + O(this.publicKey + this.username), this.secrets[""] = o;
271
- const c = this.createProxy([]);
272
- return Object.setPrototypeOf(c, te.prototype), Object.assign(c, this), c;
325
+ function re(c, r, e) {
326
+ try {
327
+ const a = Be(c), i = he(r + ":" + e.join(".")), f = ne(i), p = new Uint8Array(a.length);
328
+ for (let y = 0; y < a.length; y++)
329
+ p[y] = a[y] ^ f[y % f.length];
330
+ const b = new TextDecoder().decode(p);
331
+ return JSON.parse(b);
332
+ } catch {
333
+ return null;
273
334
  }
274
- /**
275
- * Create a proxy bound to a specific path, e.g. ["wallet", "income"]
276
- * The proxy itself is callable (function) and also expandable via property access.
277
- */
278
- createProxy(i) {
279
- const o = this, l = (...c) => o.handleCall(i, c);
280
- return new Proxy(l, {
281
- get(c, y) {
282
- if (typeof y == "symbol") return c[y];
283
- if (y === "secret") return o.createProxy([...i, String(y)]);
284
- if (y in o) return o[y];
285
- const b = [...i, String(y)];
286
- return o.createProxy(b);
287
- },
288
- apply(c, y, b) {
289
- return o.handleCall(i, b);
335
+ }
336
+ function Pe(c) {
337
+ if (typeof c != "string" || !c.startsWith("0x")) return !1;
338
+ const r = c.slice(2);
339
+ return r.length < 2 || r.length % 2 !== 0 ? !1 : /^[0-9a-fA-F]+$/.test(r);
340
+ }
341
+ function we(c, r, e) {
342
+ if (r.length === 0) {
343
+ if (e.length === 1 && typeof e[0] == "string") {
344
+ const S = e[0].trim(), O = S.startsWith("_") || S.startsWith("~") || S.startsWith("@"), W = S.includes("."), z = /^[a-zA-Z][a-zA-Z0-9_-]*$/.test(S);
345
+ if (W || O || z) {
346
+ const P = S.split(".").filter(Boolean);
347
+ return c.readPath(P);
290
348
  }
291
- });
349
+ }
350
+ if (e.length === 0)
351
+ return c.createProxy([]);
352
+ const y = c.normalizeArgs(e), g = c.postulate([], y);
353
+ return g !== void 0 ? g : c.createProxy([]);
354
+ }
355
+ const a = c.normalizeArgs(e), i = c.postulate(r, a), { scope: f, leaf: p } = c.splitPath(r), b = p ? c.opKind(p) : null;
356
+ if (c.isThought(i)) {
357
+ const y = b ? f : r;
358
+ return c.createProxy(y);
292
359
  }
360
+ return i !== void 0 ? i : c.createProxy(r);
361
+ }
362
+ const ue = "+";
363
+ function R(c) {
364
+ let r = 2166136261;
365
+ for (let e = 0; e < c.length; e++)
366
+ r ^= c.charCodeAt(e), r = Math.imul(r, 16777619);
367
+ return ("00000000" + (r >>> 0).toString(16)).slice(-8);
368
+ }
369
+ class se {
293
370
  /**
294
- * Handle a call at a given path.
295
- * Examples:
296
- * me.wallet.income(200) → set encrypted payload at wallet.income
297
- * me.wallet.secret("abc123") → set secret for path "wallet"
298
- * me.wallet.ptr() return pointer object { __ptr: "wallet" }
371
+ * Constructor base:
372
+ * me = new ME(expression?)
373
+ *
374
+ * Esto es equivalente a llamar:
375
+ * me(expression) en la raíz.
299
376
  */
300
- handleCall(i, o) {
301
- if (i.length === 0) {
302
- if (o.length === 1 && typeof o[0] == "string") {
303
- const p = o[0].split(".").filter(Boolean);
304
- return this.exportBranch(p.join("."));
305
- }
306
- return this.createProxy([]);
307
- }
308
- const l = i[i.length - 1];
309
- if (l === "secret") {
310
- const p = i.slice(0, -1), d = p.join("."), B = String(o[0] ?? "");
311
- if (!B) return this.createProxy(p);
312
- this.secrets[d] = B;
313
- const k = "0x" + O(this.secret + d + "::secret-set");
314
- return this.declarations.push({
315
- key: d + ".secret",
316
- value: "<secret-set>",
317
- signature: k,
318
- timestamp: Date.now()
319
- }), this.createProxy(p);
377
+ constructor(r) {
378
+ this.localSecrets = {}, this.localNoises = {}, this.encryptedBranches = {}, this.index = {}, this._shortTermMemory = [], this.operators = {
379
+ _: { kind: "secret" },
380
+ "~": { kind: "noise" },
381
+ __: { kind: "pointer" },
382
+ "->": { kind: "pointer" },
383
+ "@": { kind: "identity" },
384
+ "=": { kind: "eval" },
385
+ "?": { kind: "query" },
386
+ "-": { kind: "remove" }
387
+ }, this.localSecrets = {}, this.localNoises = {}, this.encryptedBranches = {}, this.index = {}, this.operators = {
388
+ _: { kind: "secret" },
389
+ "~": { kind: "noise" },
390
+ __: { kind: "pointer" },
391
+ "->": { kind: "pointer" },
392
+ "@": { kind: "identity" },
393
+ "=": { kind: "eval" },
394
+ "?": { kind: "query" },
395
+ "-": { kind: "remove" }
396
+ }, this._shortTermMemory = [], r !== void 0 && this.postulate([], r), this.rebuildIndex();
397
+ const e = this.createProxy([]);
398
+ return Object.setPrototypeOf(e, se.prototype), Object.assign(e, this), e;
399
+ }
400
+ // semantic accessor (property-style)
401
+ get shortTermMemory() {
402
+ return this._shortTermMemory;
403
+ }
404
+ isRemoveCall(r, e) {
405
+ if (r.length === 0) return null;
406
+ const { scope: a, leaf: i } = N(r);
407
+ if (!i || this.opKind(i) !== "remove") return null;
408
+ if (e == null)
409
+ return { targetPath: a };
410
+ if (typeof e == "string") {
411
+ const f = e.split(".").filter(Boolean);
412
+ return { targetPath: [...a, ...f] };
320
413
  }
321
- if (l === "ptr")
322
- return { __ptr: i.slice(0, -1).join(".") };
323
- const c = i.join(".");
324
- let y;
325
- o.length === 0 ? y = void 0 : o.length === 1 ? y = o[0] : y = o, this.ensurePath(i, y);
326
- const b = this.resolveSecret(i), P = "0x" + O(
327
- b + c + JSON.stringify(y)
414
+ return null;
415
+ }
416
+ // ---------------------------------------------------------
417
+ // Proxy infinito: me.foo.bar(...triada)
418
+ // ---------------------------------------------------------
419
+ createProxy(r) {
420
+ const e = this, a = (...i) => we(
421
+ {
422
+ createProxy: (f) => e.createProxy(f),
423
+ normalizeArgs: (f) => e.normalizeArgs(f),
424
+ readPath: (f) => e.readPath(f),
425
+ postulate: (f, p) => e.postulate(f, p),
426
+ opKind: (f) => e.opKind(f),
427
+ splitPath: N,
428
+ isThought: be
429
+ },
430
+ r,
431
+ i
328
432
  );
329
- return this.declarations.push({
330
- key: c,
331
- value: y,
332
- signature: P,
333
- timestamp: Date.now()
334
- }), this.createProxy(i);
433
+ return new Proxy(a, {
434
+ get(i, f) {
435
+ if (typeof f == "symbol") return i[f];
436
+ if (f in e) {
437
+ const b = e[f];
438
+ return typeof b == "function" ? b.bind(e) : b;
439
+ }
440
+ const p = [...r, String(f)];
441
+ return e.createProxy(p);
442
+ },
443
+ apply(i, f, p) {
444
+ return Reflect.apply(i, void 0, p);
445
+ }
446
+ });
335
447
  }
336
- /**
337
- * Secret scope resolution with path:
338
- * - Find the most specific path that has a secret.
339
- * - Return both the secret and the path at which it was defined.
340
- * - If none, fall back to root secret with empty path.
341
- */
342
- resolveSecretWithPath(i) {
343
- for (let o = i.length; o >= 0; o--) {
344
- const l = i.slice(0, o).join(".");
345
- if (this.secrets[l])
346
- return { secret: this.secrets[l], secretPath: i.slice(0, o) };
448
+ // Normaliza args:
449
+ // () → expression = undefined
450
+ // (expr) → expr
451
+ // Preserve operator multi-arg calls like:
452
+ // me["+"]("=", "eval")
453
+ // me["?"](["a.b"], fn)
454
+ // For normal writes, keep single-arg semantics.
455
+ // NOTE: secrets are declared structurally via _("..."), not as args.
456
+ normalizeArgs(r) {
457
+ if (r.length !== 0)
458
+ return r.length === 1 ? r[0] : r;
459
+ }
460
+ opKind(r) {
461
+ return this.operators[r]?.kind ?? null;
462
+ }
463
+ isSecretScopeCall(r, e) {
464
+ if (r.length === 0) return null;
465
+ const { scope: a, leaf: i } = N(r);
466
+ return !i || this.opKind(i) !== "secret" || typeof e != "string" ? null : { scopeKey: a.join(".") };
467
+ }
468
+ isNoiseScopeCall(r, e) {
469
+ if (r.length === 0) return null;
470
+ const { scope: a, leaf: i } = N(r);
471
+ return !i || this.opKind(i) !== "noise" || typeof e != "string" ? null : { scopeKey: a.join(".") };
472
+ }
473
+ isPointerCall(r, e) {
474
+ if (r.length === 0) return null;
475
+ const { leaf: a } = N(r);
476
+ if (!a || this.opKind(a) !== "pointer" || typeof e != "string") return null;
477
+ const i = e.trim().replace(/^\./, "");
478
+ return i ? { targetPath: i } : null;
479
+ }
480
+ isIdentityCall(r, e) {
481
+ if (r.length === 1 && this.opKind(r[0]) === "identity")
482
+ return typeof e != "string" ? null : { id: ce(e), targetPath: [] };
483
+ const { scope: a, leaf: i } = N(r);
484
+ return !i || this.opKind(i) !== "identity" || typeof e != "string" ? null : { id: ce(e), targetPath: a };
485
+ }
486
+ isEvalCall(r, e) {
487
+ if (r.length === 0) return null;
488
+ const { scope: a, leaf: i } = N(r);
489
+ if (!i || this.opKind(i) !== "eval") return null;
490
+ if (typeof e == "function")
491
+ return { mode: "thunk", targetPath: a, thunk: e };
492
+ if (Array.isArray(e) && e.length >= 2) {
493
+ const f = String(e[0] ?? "").trim(), p = String(e[1] ?? "").trim();
494
+ return !f || !p ? null : { mode: "assign", targetPath: a, name: f, expr: p };
347
495
  }
348
- return { secret: this.secret, secretPath: [] };
496
+ return null;
349
497
  }
350
- /**
351
- * Backwards-compatible helper: only return the secret string.
352
- */
353
- resolveSecret(i) {
354
- return this.resolveSecretWithPath(i).secret;
498
+ isQueryCall(r, e) {
499
+ if (r.length === 0) return null;
500
+ const { scope: a, leaf: i } = N(r);
501
+ if (!i || this.opKind(i) !== "query") return null;
502
+ let f = null, p;
503
+ if (Array.isArray(e) && e.length > 0)
504
+ Array.isArray(e[0]) && (e.length === 1 || typeof e[1] == "function") ? (f = e[0], p = typeof e[1] == "function" ? e[1] : void 0) : f = e;
505
+ else
506
+ return null;
507
+ if (!Array.isArray(f) || f.length === 0) return null;
508
+ const b = f.map((y) => String(y)).map((y) => y.trim()).filter((y) => y.length > 0);
509
+ return b.length === 0 ? null : { targetPath: a, paths: b, fn: p };
355
510
  }
356
- /**
357
- * Encrypt and store the value at the given path inside `payload`.
358
- *
359
- * If there is a non-root secret defined for some ancestor path P of `path`,
360
- * we treat that ancestor path P as the "branch root" and store the ENTIRE
361
- * subtree under P as ONE encrypted blob at that location.
362
- *
363
- * This means that to re-enter that channel you need both:
364
- * - the full expression for P, and
365
- * - the secret used at P.
366
- */
367
- ensurePath(i, o) {
368
- const { secret: l, secretPath: c } = this.resolveSecretWithPath(i), y = c.join("."), b = O(l);
369
- if (c.length > 0) {
370
- let k = {};
371
- const F = this.branchVersions[y]?.[b], w = this.getSubPayload(c);
372
- if (F) {
373
- const A = this.decryptForPath(c, F);
374
- A && typeof A == "object" && (k = A);
375
- } else if (typeof w == "string") {
376
- const A = this.decryptForPath(c, w);
377
- A && typeof A == "object" && (k = A);
378
- } else w && typeof w == "object" && (k = w);
379
- const v = i.slice(c.length);
380
- let _ = k;
381
- for (let A = 0; A < v.length - 1; A++) {
382
- const K = v[A];
383
- (!_[K] || typeof _[K] != "object") && (_[K] = {}), _ = _[K];
384
- }
385
- const j = v[v.length - 1];
386
- _[j] = o;
387
- const C = this.encryptForPath(c, k);
388
- this.branchVersions[y] || (this.branchVersions[y] = {}), this.branchVersions[y][b] = C, this.writeBranchBlob(c, C);
511
+ isDefineOpCall(r, e) {
512
+ if (r.length !== 1 || r[0] !== ue || !Array.isArray(e) || e.length < 2) return null;
513
+ const i = String(e[0] ?? "").trim(), f = String(e[1] ?? "").trim();
514
+ return !i || !f || i === ue ? null : { op: i, kind: f };
515
+ }
516
+ // ---------------------------------------------------------
517
+ // Postulate: semantic write at a given path
518
+ // ---------------------------------------------------------
519
+ postulate(r, e, a = null) {
520
+ let i = r, f = e;
521
+ const p = this.isDefineOpCall(i, e);
522
+ if (p) {
523
+ this.operators[p.op] = { kind: p.kind };
389
524
  return;
390
525
  }
391
- const p = this.encryptForPath(i, o);
392
- let d = this.payload;
393
- for (let k = 0; k < i.length - 1; k++) {
394
- const F = i[k];
395
- (!d[F] || typeof d[F] != "object") && (d[F] = {}), d = d[F];
526
+ const b = this.isEvalCall(i, e);
527
+ if (b) {
528
+ if (b.mode === "thunk") {
529
+ const x = b.thunk();
530
+ return b.targetPath.length === 0 ? x : this.postulate(b.targetPath, x, "=");
531
+ }
532
+ const k = [...b.targetPath, b.name];
533
+ return this.postulate(k, b.expr, "=");
396
534
  }
397
- const B = i[i.length - 1];
398
- d[B] = p;
399
- }
400
- /**
401
- * Set a value at a nested path inside `payload`.
402
- */
403
- setSubPayload(i, o) {
404
- if (i.length === 0) {
405
- this.payload = o;
535
+ const y = this.isQueryCall(i, e);
536
+ if (y) {
537
+ const k = y.paths.map((C) => this.readPath(C.split(".").filter(Boolean))), x = y.fn ? y.fn(...k) : k;
538
+ return y.targetPath.length === 0 ? x : this.postulate(y.targetPath, x, "?");
539
+ }
540
+ const g = this.isRemoveCall(i, e);
541
+ if (g) {
542
+ this.removeSubtree(g.targetPath);
406
543
  return;
407
544
  }
408
- let l = this.payload;
409
- for (let y = 0; y < i.length - 1; y++) {
410
- const b = i[y];
411
- (!l[b] || typeof l[b] != "object") && (l[b] = {}), l = l[b];
545
+ const S = this.isSecretScopeCall(i, e);
546
+ if (S) {
547
+ this.localSecrets[S.scopeKey] = e;
548
+ const k = S.scopeKey ? S.scopeKey.split(".").filter(Boolean) : [], x = k.join("."), C = this.computeEffectiveSecret(k), w = "***", _ = "***", F = JSON.stringify({
549
+ path: x,
550
+ operator: "_",
551
+ expression: w,
552
+ value: _,
553
+ effectiveSecret: C
554
+ }), I = R(F), j = Date.now(), K = {
555
+ path: x,
556
+ operator: "_",
557
+ expression: w,
558
+ value: _,
559
+ effectiveSecret: C,
560
+ hash: I,
561
+ timestamp: j
562
+ };
563
+ return this._shortTermMemory.push(K), this.rebuildIndex(), K;
412
564
  }
413
- const c = i[i.length - 1];
414
- l[c] = o;
415
- }
416
- /**
417
- * Find the nearest ancestor path that represents an encrypted branch blob.
418
- */
419
- findNearestBranchAncestor(i) {
420
- for (let o = i.length - 1; o >= 1; o--) {
421
- const l = i.slice(0, o), c = l.join(".");
422
- if (this.branchVersions[c])
423
- return { path: l, secret: this.resolveSecret(l) };
565
+ const O = this.isNoiseScopeCall(i, e);
566
+ if (O) {
567
+ this.localNoises[O.scopeKey] = e;
568
+ const k = O.scopeKey ? O.scopeKey.split(".").filter(Boolean) : [], x = k.join("."), C = this.computeEffectiveSecret(k), w = "***", _ = "***", F = JSON.stringify({
569
+ path: x,
570
+ operator: "~",
571
+ expression: w,
572
+ value: _,
573
+ effectiveSecret: C
574
+ }), I = R(F), j = Date.now(), K = {
575
+ path: x,
576
+ operator: "~",
577
+ expression: w,
578
+ value: _,
579
+ effectiveSecret: C,
580
+ hash: I,
581
+ timestamp: j
582
+ };
583
+ return this._shortTermMemory.push(K), this.rebuildIndex(), K;
424
584
  }
425
- return null;
426
- }
427
- /**
428
- * Write an encrypted branch blob while preserving any encrypted ancestor branches.
429
- */
430
- writeBranchBlob(i, o) {
431
- let l = i, c = o;
432
- for (; ; ) {
433
- const y = this.findNearestBranchAncestor(l);
434
- if (!y) {
435
- this.setSubPayload(l, c);
436
- return;
585
+ const W = this.isPointerCall(i, e);
586
+ if (W) {
587
+ const { scope: k } = N(i);
588
+ i = k, e = ve(W.targetPath), f = e, a === null && (a = "__");
589
+ }
590
+ const z = this.isIdentityCall(i, e);
591
+ z && (i = z.targetPath, e = ge(z.id), f = e, a === null && (a = "@"));
592
+ const P = i.join("."), D = this.computeEffectiveSecret(i), E = this.resolveBranchScope(i);
593
+ if (E && E.length === 0 && this.localSecrets[""] && this.localSecrets[P], E && E.length > 0) {
594
+ const k = this.computeEffectiveSecret(E), x = i.slice(E.length), C = this.getBranchBlob(E);
595
+ let w = {};
596
+ if (C && k) {
597
+ const _ = re(C, k, E);
598
+ _ && typeof _ == "object" && (w = _);
599
+ }
600
+ if (x.length === 0)
601
+ (typeof w != "object" || w === null) && (w = {}), w.expression = e;
602
+ else {
603
+ let _ = w;
604
+ for (let F = 0; F < x.length - 1; F++) {
605
+ const I = x[F];
606
+ (!_[I] || typeof _[I] != "object") && (_[I] = {}), _ = _[I];
607
+ }
608
+ _[x[x.length - 1]] = e;
437
609
  }
438
- const { path: b, secret: P } = y, p = b.join("."), d = O(P), B = this.getSubPayload(b), k = this.branchVersions[p]?.[d] ?? (typeof B == "string" ? B : void 0);
439
- let F = {};
440
610
  if (k) {
441
- const j = this.decryptForPath(b, k);
442
- j && typeof j == "object" && (F = j);
611
+ const _ = fe(w, k, E);
612
+ this.setBranchBlob(E, _);
443
613
  }
444
- const w = l.slice(b.length);
445
- let v = F;
446
- for (let j = 0; j < w.length - 1; j++) {
447
- const C = w[j];
448
- (!v[C] || typeof v[C] != "object") && (v[C] = {}), v = v[C];
614
+ f = e;
615
+ } else if (D) {
616
+ const k = a !== "=" && a !== "?";
617
+ Yt(e) || te(e) || !k ? f = e : f = fe(e, D, i);
618
+ } else
619
+ f = e;
620
+ const J = f, $ = JSON.stringify({
621
+ path: P,
622
+ operator: a,
623
+ expression: e,
624
+ value: J,
625
+ effectiveSecret: D
626
+ }), q = R($), Zt = Date.now(), L = {
627
+ path: P,
628
+ operator: a,
629
+ expression: e,
630
+ value: J,
631
+ effectiveSecret: D,
632
+ hash: q,
633
+ timestamp: Zt
634
+ };
635
+ return this._shortTermMemory.push(L), this.rebuildIndex(), L;
636
+ }
637
+ removeSubtree(r) {
638
+ const e = r.join(".");
639
+ for (const g of Object.keys(this.localSecrets)) {
640
+ if (e === "") {
641
+ delete this.localSecrets[g];
642
+ continue;
449
643
  }
450
- v[w[w.length - 1]] = c;
451
- const _ = this.encryptForPath(b, F);
452
- this.branchVersions[p] || (this.branchVersions[p] = {}), this.branchVersions[p][d] = _, l = b, c = _;
644
+ (g === e || g.startsWith(e + ".")) && delete this.localSecrets[g];
453
645
  }
454
- }
455
- getSubPayload(i) {
456
- let o = this.payload;
457
- for (const l of i) {
458
- if (!o || typeof o != "object") return;
459
- o = o[l];
646
+ for (const g of Object.keys(this.localNoises)) {
647
+ if (e === "") {
648
+ delete this.localNoises[g];
649
+ continue;
650
+ }
651
+ (g === e || g.startsWith(e + ".")) && delete this.localNoises[g];
652
+ }
653
+ for (const g of Object.keys(this.encryptedBranches)) {
654
+ if (e === "") {
655
+ delete this.encryptedBranches[g];
656
+ continue;
657
+ }
658
+ (g === e || g.startsWith(e + ".")) && delete this.encryptedBranches[g];
460
659
  }
461
- return o;
660
+ const a = r.join("."), i = Date.now(), f = this.computeEffectiveSecret(r), p = JSON.stringify({ path: a, operator: "-", expression: "-", value: "-", effectiveSecret: f }), b = R(p), y = {
661
+ path: a,
662
+ operator: "-",
663
+ expression: "-",
664
+ value: "-",
665
+ effectiveSecret: f,
666
+ hash: b,
667
+ timestamp: i
668
+ };
669
+ this._shortTermMemory.push(y), this.rebuildIndex();
462
670
  }
463
- /**
464
- * Recursively decrypt a node of the encrypted payload tree.
465
- */
466
- decryptTree(i, o) {
467
- if (o == null) return o;
468
- if (typeof o == "string") {
469
- if (!this.isHexString(o)) return o;
470
- const c = this.decryptForPath(i, o);
471
- return c === null ? o : c;
671
+ // ---------------------------------------------------------
672
+ // Fractal secret: combina todos los secrets a lo largo de la ruta, o noise acts as a new root for chaining
673
+ // ---------------------------------------------------------
674
+ computeEffectiveSecret(r) {
675
+ let e = null, a = null;
676
+ this.localNoises[""] !== void 0 && (e = "", a = this.localNoises[""]);
677
+ for (let f = 1; f <= r.length; f++) {
678
+ const p = r.slice(0, f).join(".");
679
+ this.localNoises[p] !== void 0 && (e = p, a = this.localNoises[p]);
472
680
  }
473
- if (typeof o != "object")
474
- return o;
475
- const l = Array.isArray(o) ? [] : {};
476
- for (const c of Object.keys(o)) {
477
- const y = [...i, c];
478
- l[c] = this.decryptTree(y, o[c]);
681
+ let i = "root";
682
+ a ? i = R("noise::" + a) : this.localSecrets[""] && (i = R(i + "::" + this.localSecrets[""])), e === null || e === "" || e.split(".").filter(Boolean).length;
683
+ for (let f = 1; f <= r.length; f++) {
684
+ const p = r.slice(0, f).join(".");
685
+ if (this.localSecrets[p]) {
686
+ if (e !== null && e !== "") {
687
+ const b = e + ".";
688
+ if (!(p === e || p.startsWith(b))) continue;
689
+ }
690
+ i = R(i + "::" + this.localSecrets[p]);
691
+ }
479
692
  }
480
- return l;
481
- }
482
- /**
483
- * Encrypt a value (object or primitive) using the secret resolved for the given path.
484
- * Produces a hex string compatible with decryptForPath().
485
- */
486
- encryptForPath(i, o) {
487
- const l = this.resolveSecret(i), c = JSON.stringify(o), y = new TextEncoder().encode(c), b = O(l + ":" + i.join(".")), P = this.asciiToBytes(b), p = new Uint8Array(y.length);
488
- for (let B = 0; B < y.length; B++)
489
- p[B] = y[B] ^ P[B % P.length];
490
- let d = "";
491
- for (let B = 0; B < p.length; B++)
492
- d += p[B].toString(16).padStart(2, "0");
493
- return d;
693
+ return i === "root" ? "" : i;
494
694
  }
495
- /**
496
- * Decrypt a single encrypted blob using the secret resolved for the given path.
497
- */
498
- decryptForPath(i, o) {
499
- const l = this.resolveSecret(i);
500
- try {
501
- const c = this.hexToBytes(o), y = O(l + ":" + i.join(".")), b = this.asciiToBytes(y), P = new Uint8Array(c.length);
502
- for (let d = 0; d < c.length; d++)
503
- P[d] = c[d] ^ b[d % b.length];
504
- const p = new TextDecoder().decode(P);
505
- return JSON.parse(p);
506
- } catch {
507
- return null;
695
+ // ---------------------------------------------------------
696
+ // Índice derivado
697
+ // ---------------------------------------------------------
698
+ rebuildIndex() {
699
+ const r = {};
700
+ for (const e of this._shortTermMemory) {
701
+ const a = e.path, i = a.split(".").filter(Boolean), f = this.resolveBranchScope(i), p = f && f.length > 0 && le(i, f);
702
+ if (e.operator === "-") {
703
+ if (a === "") {
704
+ for (const y of Object.keys(r)) delete r[y];
705
+ continue;
706
+ }
707
+ const b = a + ".";
708
+ for (const y of Object.keys(r))
709
+ (y === a || y.startsWith(b)) && delete r[y];
710
+ continue;
711
+ }
712
+ p || (r[a] = e.value);
508
713
  }
714
+ this.index = r;
509
715
  }
510
- asciiToBytes(i) {
511
- return new TextEncoder().encode(i);
716
+ getIndex(r) {
717
+ return this.index[r.join(".")];
512
718
  }
513
- hexToBytes(i) {
514
- const o = i.startsWith("0x") ? i.slice(2) : i, l = new Uint8Array(o.length / 2);
515
- for (let c = 0; c < l.length; c++)
516
- l[c] = parseInt(o.substr(c * 2, 2), 16);
517
- return l;
719
+ setIndex(r, e) {
720
+ this.index[r.join(".")] = e;
518
721
  }
519
- isHexString(i) {
520
- const o = i.startsWith("0x") ? i.slice(2) : i;
521
- return o.length > 0 && o.length % 2 === 0 && /^[0-9a-fA-F]+$/.test(o);
722
+ resolveIndexPointerPath(r, e = 8) {
723
+ let a = r;
724
+ for (let i = 0; i < e; i++) {
725
+ const f = this.getIndex(a);
726
+ if (!Yt(f)) return { path: a, raw: f };
727
+ a = f.__ptr.split(".").filter(Boolean);
728
+ }
729
+ return { path: a, raw: void 0 };
522
730
  }
523
- /**
524
- * Export the encrypted payload and declaration metadata.
525
- */
526
- export() {
527
- return {
528
- identityRoot: this.identityRoot,
529
- publicKey: this.publicKey,
530
- identityHash: this.identityHash,
531
- declarations: this.declarations,
532
- payload: this.payload
533
- };
731
+ setBranchBlob(r, e) {
732
+ const a = r.join(".");
733
+ this.encryptedBranches[a] = e;
534
734
  }
535
- /**
536
- * Export and decrypt a specific branch using the currently active secret
537
- * resolved for that path.
538
- */
539
- exportBranch(i) {
540
- const o = i ? i.split(".").filter(Boolean) : [], l = o.join("."), c = this.resolveSecret(o), y = O(c), b = this.branchVersions[l]?.[y];
541
- if (b) {
542
- const p = this.decryptForPath(o, b);
543
- return this.decryptTree(o, p);
735
+ getBranchBlob(r) {
736
+ const e = r.join(".");
737
+ return this.encryptedBranches[e];
738
+ }
739
+ resolveBranchScope(r) {
740
+ let e = null;
741
+ this.localSecrets[""] && (e = []);
742
+ for (let a = 1; a <= r.length; a++) {
743
+ const i = r.slice(0, a), f = i.join(".");
744
+ this.localSecrets[f] && (e = i);
544
745
  }
545
- const P = this.getSubPayload(o);
546
- if (P !== void 0) {
547
- if (typeof P == "string") {
548
- const p = this.decryptForPath(o, P);
549
- return this.decryptTree(o, p);
746
+ return e;
747
+ }
748
+ readPath(r) {
749
+ const e = this.resolveBranchScope(r);
750
+ if (e && e.length > 0 && le(r, e)) {
751
+ if (r.length === e.length) return;
752
+ const p = this.computeEffectiveSecret(e);
753
+ if (!p) return null;
754
+ const b = this.getBranchBlob(e);
755
+ if (!b) return;
756
+ const y = re(b, p, e);
757
+ if (!y || typeof y != "object") return;
758
+ const g = r.slice(e.length);
759
+ let S = y;
760
+ for (const O of g) {
761
+ if (!S || typeof S != "object") return;
762
+ S = S[O];
550
763
  }
551
- return this.decryptTree(o, P);
764
+ return Yt(S) ? this.readPath(S.__ptr.split(".").filter(Boolean)) : (te(S), S);
552
765
  }
766
+ const i = this.resolveIndexPointerPath(r).raw;
767
+ if (i === void 0) return;
768
+ if (Yt(i)) return this.readPath(i.__ptr.split(".").filter(Boolean));
769
+ if (te(i) || !Pe(i)) return i;
770
+ const f = this.computeEffectiveSecret(r);
771
+ return f ? re(i, f, r) : null;
553
772
  }
554
773
  }
555
774
  export {
556
- te as ME
775
+ se as default
557
776
  };