attaform 0.31.0 → 0.31.2
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/abstract.d.mts +5 -5
- package/dist/abstract.mjs +5 -4
- package/dist/dev/abstract.mjs +5 -4
- package/dist/dev/chunks/devtools.mjs +1 -1
- package/dist/dev/directive.mjs +1 -1
- package/dist/dev/history.mjs +126 -6
- package/dist/dev/index.mjs +6 -5
- package/dist/dev/runtime/plugins/attaform.mjs +1 -1
- package/dist/dev/shared/{attaform-dev.zlvDr0WB.mjs → attaform-dev.04aupFBW.mjs} +3 -2
- package/dist/dev/shared/{attaform-dev.CtyqGia7.mjs → attaform-dev.BKWPjEB2.mjs} +5 -4
- package/dist/dev/shared/{attaform-dev.DlaT4xGd.mjs → attaform-dev.BnLLxX2l.mjs} +4 -4
- package/dist/dev/shared/{attaform-dev.B1q-x9R9.mjs → attaform-dev.Bu6wgrA5.mjs} +1 -1
- package/dist/dev/shared/{attaform-dev.k5X47GMD.mjs → attaform-dev.CKSqs_xQ.mjs} +3 -2
- package/dist/dev/shared/{attaform-dev.DJ3nsWw6.mjs → attaform-dev.Cf_hZfbT.mjs} +18 -9
- package/dist/dev/shared/{attaform-dev.y9x9Vp9F.mjs → attaform-dev.DLk51W7-.mjs} +565 -926
- package/dist/dev/shared/attaform-dev.DoG8mZTq.mjs +127 -0
- package/dist/dev/shared/attaform-dev.G-3XDl9F.mjs +1192 -0
- package/dist/dev/shared/{attaform-dev.Caibt7sb.mjs → attaform-dev.oguHqv1W.mjs} +11 -10
- package/dist/dev/zod-v3.mjs +7 -6
- package/dist/dev/zod-v4.mjs +7 -6
- package/dist/dev/zod.mjs +6 -5
- package/dist/directive.d.mts +2 -2
- package/dist/directive.mjs +1 -1
- package/dist/history.d.mts +1 -1
- package/dist/history.mjs +126 -6
- package/dist/index.d.mts +16 -55
- package/dist/index.mjs +6 -5
- package/dist/runtime/plugins/attaform.mjs +1 -1
- package/dist/shared/{attaform.DL2nl_QR.mjs → attaform.3kV6PqVJ.mjs} +11 -10
- package/dist/shared/{attaform.L011tHgJ.mjs → attaform.BJeiuJE2.mjs} +4 -4
- package/dist/shared/attaform.BNUhW4qC.mjs +103 -0
- package/dist/shared/{attaform.CdZIEf7_.mjs → attaform.BhtAZysa.mjs} +3 -2
- package/dist/shared/{attaform.BWUn8Kjy.mjs → attaform.BlAmZ-WU.mjs} +18 -9
- package/dist/shared/{attaform.LUPC-2Qg.mjs → attaform.CMzc4bPI.mjs} +5 -4
- package/dist/shared/{attaform.C4shmwyJ.mjs → attaform.CdA9bfRv.mjs} +1 -1
- package/dist/shared/attaform.CgyyJVuq.mjs +1187 -0
- package/dist/shared/{attaform.DAo0QBmS.d.mts → attaform.CibLYe9-.d.mts} +214 -173
- package/dist/shared/{attaform.DNPJPOO7.mjs → attaform.DCUJCKyG.mjs} +562 -925
- package/dist/shared/{attaform.D9RqPgGu.d.mts → attaform.DCyZT7u-.d.mts} +1 -1
- package/dist/shared/{attaform.CRVe8s82.d.mts → attaform.DD0Y8krq.d.mts} +43 -19
- package/dist/shared/{attaform.DxKQsqFZ.mjs → attaform.T0YjhjPU.mjs} +3 -2
- package/dist/shared/{attaform.DZnrDrNb.d.mts → attaform.bI_4nKZp.d.mts} +119 -8
- package/dist/zod-v3.d.mts +4 -4
- package/dist/zod-v3.mjs +7 -6
- package/dist/zod-v4.d.mts +15 -11
- package/dist/zod-v4.mjs +7 -6
- package/dist/zod.d.mts +4 -4
- package/dist/zod.mjs +6 -5
- package/package.json +2 -1
- package/skills/attaform/SKILL.md +1 -0
- package/dist/dev/shared/attaform-dev.CZz4GYZ6.mjs +0 -386
- package/dist/shared/attaform.8mfKZCwH.mjs +0 -358
|
@@ -1,386 +0,0 @@
|
|
|
1
|
-
import { m as mapSegmentKeys, f as pathsEqual, i as isPathPrefix } from './attaform-dev.zlvDr0WB.mjs';
|
|
2
|
-
|
|
3
|
-
const DEFAULT_FIELD_VALIDATION_DEBOUNCE_MS = 0;
|
|
4
|
-
const DEFAULT_HISTORY_MAX_SNAPSHOTS = 128;
|
|
5
|
-
const RESERVED_KEY_PREFIX = "__atta:";
|
|
6
|
-
const ANONYMOUS_FORM_KEY_PREFIX = `${RESERVED_KEY_PREFIX}anon:`;
|
|
7
|
-
const ANONYMOUS_WIZARD_KEY_PREFIX = `${RESERVED_KEY_PREFIX}anon-wizard:`;
|
|
8
|
-
const DEFAULT_MAX_RECURSION_DEPTH = 64;
|
|
9
|
-
function normalizeNumericOption(config) {
|
|
10
|
-
const { value, source, min, defaultValue } = config;
|
|
11
|
-
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
12
|
-
{
|
|
13
|
-
console.warn(
|
|
14
|
-
`[attaform] ${source} must be a non-negative finite integer; got ${String(value)}. Falling back to ${String(defaultValue)}.`
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
|
-
return defaultValue;
|
|
18
|
-
}
|
|
19
|
-
return Math.max(min, Math.floor(value));
|
|
20
|
-
}
|
|
21
|
-
function pickDefined(bag) {
|
|
22
|
-
const out = {};
|
|
23
|
-
for (const key of Object.keys(bag)) {
|
|
24
|
-
if (bag[key] !== void 0) out[key] = bag[key];
|
|
25
|
-
}
|
|
26
|
-
return out;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const reported = /* @__PURE__ */ new Set() ;
|
|
30
|
-
function reportConsumerThrow(site, detail, err) {
|
|
31
|
-
const key = detail === void 0 ? site : `${site}|${detail}`;
|
|
32
|
-
if (reported === null || reported.has(key)) return;
|
|
33
|
-
reported.add(key);
|
|
34
|
-
const at = detail === void 0 ? "" : ` at \`${detail}\``;
|
|
35
|
-
const advice = {
|
|
36
|
-
"default-factory": "a `.default(() => ...)` factory threw. Attaform used `undefined` for that field's initial value.",
|
|
37
|
-
"catch-factory": "a `.catch(() => ...)` fallback threw. Attaform used `undefined` for that value.",
|
|
38
|
-
"lazy-getter": "a `z.lazy(() => ...)` factory threw. Attaform stopped descending at that node, so paths below it will not resolve.",
|
|
39
|
-
"wizard-slot": `a function step slot threw${at}. Attaform dropped that step from the compiled list; the rest of the flow still navigates.`,
|
|
40
|
-
"wizard-lazy-slot": `a \`lazy()\` step resolver threw${at}. Attaform dropped that step from the compiled list until the resolver's own dependencies change.`,
|
|
41
|
-
"wizard-progress": "a `useWizard({ progress })` override threw. Attaform fell back to its own valid-step ratio.",
|
|
42
|
-
"wizard-restore": "a `useWizard({ restore })` callback threw. Attaform read no step from it, so the wizard stays where it is.",
|
|
43
|
-
"wizard-persist": "a `useWizard({ persist })` callback threw. Attaform navigated anyway, so the step is live but unrecorded.",
|
|
44
|
-
"wizard-default-statuses": "a `useWizard({ defaultStatuses })` factory threw or rejected. Attaform seeded no statuses, the same as omitting the option."
|
|
45
|
-
};
|
|
46
|
-
console.error(
|
|
47
|
-
`[attaform] ${advice[site]} Attaform has nowhere to surface this, so it must not throw; wrap your own try/catch if the failure is recoverable. Original error:`,
|
|
48
|
-
err
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
function callConsumerFn(fn, fallback, site, detail) {
|
|
52
|
-
try {
|
|
53
|
-
return fn();
|
|
54
|
-
} catch (err) {
|
|
55
|
-
reportConsumerThrow(site, detail, err);
|
|
56
|
-
return fallback;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
function readConsumerProp(obj, key) {
|
|
60
|
-
try {
|
|
61
|
-
return obj[key];
|
|
62
|
-
} catch {
|
|
63
|
-
return void 0;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
function consumerKeys(obj) {
|
|
67
|
-
try {
|
|
68
|
-
return Object.keys(obj);
|
|
69
|
-
} catch {
|
|
70
|
-
return [];
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
function readConsumerIndex(arr, i) {
|
|
74
|
-
try {
|
|
75
|
-
return arr[i];
|
|
76
|
-
} catch {
|
|
77
|
-
return void 0;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
function consumerSymbolKeys(obj) {
|
|
81
|
-
try {
|
|
82
|
-
return Object.getOwnPropertySymbols(obj);
|
|
83
|
-
} catch {
|
|
84
|
-
return [];
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
function consumerHas(obj, key) {
|
|
88
|
-
try {
|
|
89
|
-
return key in obj;
|
|
90
|
-
} catch {
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function safeAssign(target, key, value) {
|
|
96
|
-
if (key === "__proto__") {
|
|
97
|
-
Object.defineProperty(target, key, {
|
|
98
|
-
value,
|
|
99
|
-
writable: true,
|
|
100
|
-
enumerable: true,
|
|
101
|
-
configurable: true
|
|
102
|
-
});
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
target[key] = value;
|
|
106
|
-
}
|
|
107
|
-
const SHADOWED_KEYS = new Set(Object.getOwnPropertyNames(Object.prototype));
|
|
108
|
-
function isShadowedKey(key) {
|
|
109
|
-
return SHADOWED_KEYS.has(key);
|
|
110
|
-
}
|
|
111
|
-
function safeOwnRead(target, key) {
|
|
112
|
-
if (isShadowedKey(key)) {
|
|
113
|
-
const desc = Object.getOwnPropertyDescriptor(target, key);
|
|
114
|
-
if (desc === void 0) return void 0;
|
|
115
|
-
return "value" in desc ? desc.value : readConsumerProp(target, key);
|
|
116
|
-
}
|
|
117
|
-
return readConsumerProp(target, key);
|
|
118
|
-
}
|
|
119
|
-
function safeOwnHas(target, key) {
|
|
120
|
-
try {
|
|
121
|
-
return Object.prototype.hasOwnProperty.call(target, key);
|
|
122
|
-
} catch {
|
|
123
|
-
return false;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
function spreadConsumerRecord(src) {
|
|
127
|
-
try {
|
|
128
|
-
return { ...src };
|
|
129
|
-
} catch {
|
|
130
|
-
const out = {};
|
|
131
|
-
for (const key of Object.keys(src)) {
|
|
132
|
-
safeAssign(out, key, readConsumerProp(src, key));
|
|
133
|
-
}
|
|
134
|
-
return out;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
function copyConsumerArray(src) {
|
|
138
|
-
try {
|
|
139
|
-
return src.slice();
|
|
140
|
-
} catch {
|
|
141
|
-
const out = new Array(src.length);
|
|
142
|
-
for (let i = 0; i < src.length; i++) out[i] = readConsumerIndex(src, i);
|
|
143
|
-
return out;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
function isDescendable(value) {
|
|
148
|
-
if (value === null || typeof value !== "object") return false;
|
|
149
|
-
if (Array.isArray(value)) return true;
|
|
150
|
-
if (value instanceof Map) return mapSegmentKeys(value) !== null;
|
|
151
|
-
const proto = Object.getPrototypeOf(value);
|
|
152
|
-
return proto === null || proto === Object.prototype;
|
|
153
|
-
}
|
|
154
|
-
function appendSegment(prefix, segment) {
|
|
155
|
-
const next = new Array(prefix.length + 1);
|
|
156
|
-
for (let i = 0; i < prefix.length; i++) {
|
|
157
|
-
const s = prefix[i];
|
|
158
|
-
next[i] = s;
|
|
159
|
-
}
|
|
160
|
-
next[prefix.length] = segment;
|
|
161
|
-
return next;
|
|
162
|
-
}
|
|
163
|
-
function diffAndApply(oldValue, newValue, prefix, visit) {
|
|
164
|
-
if (Object.is(oldValue, newValue)) return;
|
|
165
|
-
const oldIsDescendable = isDescendable(oldValue);
|
|
166
|
-
const newIsDescendable = isDescendable(newValue);
|
|
167
|
-
if (oldValue === void 0 && newIsDescendable) {
|
|
168
|
-
walkNewDescendable(newValue, prefix, visit);
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
if (oldIsDescendable && newValue === void 0) {
|
|
172
|
-
walkOldDescendable(oldValue, prefix, visit);
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
if (oldIsDescendable && newIsDescendable) {
|
|
176
|
-
const oldIsMap = oldValue instanceof Map;
|
|
177
|
-
const newIsMap = newValue instanceof Map;
|
|
178
|
-
if (oldIsMap && newIsMap) {
|
|
179
|
-
diffMapsLockstep(oldValue, newValue, prefix, visit);
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
if (oldIsMap !== newIsMap) {
|
|
183
|
-
visit({ kind: "changed", path: prefix, oldValue, newValue });
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
const oldIsArray = Array.isArray(oldValue);
|
|
187
|
-
const newIsArray = Array.isArray(newValue);
|
|
188
|
-
if (oldIsArray && newIsArray) {
|
|
189
|
-
diffArraysLockstep(oldValue, newValue, prefix, visit);
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
if (!oldIsArray && !newIsArray) {
|
|
193
|
-
diffObjectsLockstep(
|
|
194
|
-
oldValue,
|
|
195
|
-
newValue,
|
|
196
|
-
prefix,
|
|
197
|
-
visit
|
|
198
|
-
);
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
visit({ kind: "changed", path: prefix, oldValue, newValue });
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
if (oldIsDescendable && !newIsDescendable) {
|
|
205
|
-
visit({ kind: "changed", path: prefix, oldValue, newValue });
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
if (!oldIsDescendable && newIsDescendable) {
|
|
209
|
-
visit({ kind: "changed", path: prefix, oldValue, newValue });
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
|
-
if (oldValue === void 0) {
|
|
213
|
-
visit({ kind: "added", path: prefix, newValue });
|
|
214
|
-
return;
|
|
215
|
-
}
|
|
216
|
-
if (newValue === void 0) {
|
|
217
|
-
visit({ kind: "removed", path: prefix, oldValue });
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
|
-
visit({ kind: "changed", path: prefix, oldValue, newValue });
|
|
221
|
-
}
|
|
222
|
-
function walkNewDescendable(newValue, prefix, visit) {
|
|
223
|
-
if (Array.isArray(newValue)) {
|
|
224
|
-
for (let i = 0; i < newValue.length; i++) {
|
|
225
|
-
diffAndApply(void 0, readConsumerIndex(newValue, i), appendSegment(prefix, i), visit);
|
|
226
|
-
}
|
|
227
|
-
} else if (newValue instanceof Map) {
|
|
228
|
-
for (const [key, entry] of newValue) {
|
|
229
|
-
diffAndApply(void 0, entry, appendSegment(prefix, key), visit);
|
|
230
|
-
}
|
|
231
|
-
} else {
|
|
232
|
-
const rec = newValue;
|
|
233
|
-
for (const k of consumerKeys(rec)) {
|
|
234
|
-
diffAndApply(void 0, readConsumerProp(rec, k), appendSegment(prefix, k), visit);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
function walkOldDescendable(oldValue, prefix, visit) {
|
|
239
|
-
if (Array.isArray(oldValue)) {
|
|
240
|
-
for (let i = 0; i < oldValue.length; i++) {
|
|
241
|
-
diffAndApply(readConsumerIndex(oldValue, i), void 0, appendSegment(prefix, i), visit);
|
|
242
|
-
}
|
|
243
|
-
} else if (oldValue instanceof Map) {
|
|
244
|
-
for (const [key, entry] of oldValue) {
|
|
245
|
-
diffAndApply(entry, void 0, appendSegment(prefix, key), visit);
|
|
246
|
-
}
|
|
247
|
-
} else {
|
|
248
|
-
const rec = oldValue;
|
|
249
|
-
for (const k of consumerKeys(rec)) {
|
|
250
|
-
diffAndApply(readConsumerProp(rec, k), void 0, appendSegment(prefix, k), visit);
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
function diffMapsLockstep(oldMap, newMap, prefix, visit) {
|
|
255
|
-
for (const [key, entry] of newMap) {
|
|
256
|
-
diffAndApply(oldMap.get(key), entry, appendSegment(prefix, key), visit);
|
|
257
|
-
}
|
|
258
|
-
for (const [key, entry] of oldMap) {
|
|
259
|
-
if (newMap.has(key)) continue;
|
|
260
|
-
diffAndApply(entry, void 0, appendSegment(prefix, key), visit);
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
function diffArraysLockstep(oldArr, newArr, prefix, visit) {
|
|
264
|
-
const max = Math.max(oldArr.length, newArr.length);
|
|
265
|
-
for (let i = 0; i < max; i++) {
|
|
266
|
-
diffAndApply(
|
|
267
|
-
readConsumerIndex(oldArr, i),
|
|
268
|
-
readConsumerIndex(newArr, i),
|
|
269
|
-
appendSegment(prefix, i),
|
|
270
|
-
visit
|
|
271
|
-
);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
function diffObjectsLockstep(oldRec, newRec, prefix, visit) {
|
|
275
|
-
const seen = /* @__PURE__ */ new Set();
|
|
276
|
-
for (const k of consumerKeys(oldRec)) {
|
|
277
|
-
seen.add(k);
|
|
278
|
-
diffAndApply(
|
|
279
|
-
readConsumerProp(oldRec, k),
|
|
280
|
-
readConsumerProp(newRec, k),
|
|
281
|
-
appendSegment(prefix, k),
|
|
282
|
-
visit
|
|
283
|
-
);
|
|
284
|
-
}
|
|
285
|
-
for (const k of consumerKeys(newRec)) {
|
|
286
|
-
if (seen.has(k)) continue;
|
|
287
|
-
diffAndApply(
|
|
288
|
-
readConsumerProp(oldRec, k),
|
|
289
|
-
readConsumerProp(newRec, k),
|
|
290
|
-
appendSegment(prefix, k),
|
|
291
|
-
visit
|
|
292
|
-
);
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
function applyChangedKeys(target, source, arrayOpPath, currentPath, patches) {
|
|
296
|
-
if (!isDescendable(target) || !isDescendable(source)) return false;
|
|
297
|
-
if (target instanceof Map || source instanceof Map) return false;
|
|
298
|
-
const targetIsArray = Array.isArray(target);
|
|
299
|
-
const sourceIsArray = Array.isArray(source);
|
|
300
|
-
if (targetIsArray !== sourceIsArray) return false;
|
|
301
|
-
const depth = currentPath.length;
|
|
302
|
-
const changedFirstSegments = /* @__PURE__ */ new Set();
|
|
303
|
-
for (const patch of patches) {
|
|
304
|
-
if (patch.path.length === depth) return false;
|
|
305
|
-
changedFirstSegments.add(patch.path[depth]);
|
|
306
|
-
}
|
|
307
|
-
if (targetIsArray) {
|
|
308
|
-
const t = target;
|
|
309
|
-
const s = source;
|
|
310
|
-
if (arrayOpPath === null || pathsEqual(currentPath, arrayOpPath)) {
|
|
311
|
-
if (t.length > s.length) t.length = s.length;
|
|
312
|
-
for (const idx of changedFirstSegments) {
|
|
313
|
-
const i = typeof idx === "number" ? idx : Number(idx);
|
|
314
|
-
if (i >= s.length) continue;
|
|
315
|
-
t[i] = s[i];
|
|
316
|
-
}
|
|
317
|
-
} else {
|
|
318
|
-
for (const idx of changedFirstSegments) {
|
|
319
|
-
const i = typeof idx === "number" ? idx : Number(idx);
|
|
320
|
-
if (i >= s.length) continue;
|
|
321
|
-
const childPath = appendSegment(currentPath, i);
|
|
322
|
-
const curEl = t[i];
|
|
323
|
-
const nextEl = s[i];
|
|
324
|
-
if (isPathPrefix(childPath, arrayOpPath) && isDescendable(curEl) && isDescendable(nextEl) && applyChangedKeys(
|
|
325
|
-
curEl,
|
|
326
|
-
nextEl,
|
|
327
|
-
arrayOpPath,
|
|
328
|
-
childPath,
|
|
329
|
-
patches.filter((p) => isPathPrefix(childPath, p.path))
|
|
330
|
-
)) {
|
|
331
|
-
continue;
|
|
332
|
-
}
|
|
333
|
-
t[i] = nextEl;
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
} else {
|
|
337
|
-
const t = target;
|
|
338
|
-
const s = source;
|
|
339
|
-
const sourceKeys = new Set(Object.keys(s));
|
|
340
|
-
for (const k of Object.keys(t)) {
|
|
341
|
-
if (!sourceKeys.has(k)) delete t[k];
|
|
342
|
-
}
|
|
343
|
-
for (const k of changedFirstSegments) {
|
|
344
|
-
const key = String(k);
|
|
345
|
-
const nextVal = safeOwnRead(s, key);
|
|
346
|
-
if (arrayOpPath !== null) {
|
|
347
|
-
const curVal = safeOwnRead(t, key);
|
|
348
|
-
const childPath = appendSegment(currentPath, key);
|
|
349
|
-
if (isDescendable(curVal) && isDescendable(nextVal) && applyChangedKeys(
|
|
350
|
-
curVal,
|
|
351
|
-
nextVal,
|
|
352
|
-
arrayOpPath,
|
|
353
|
-
childPath,
|
|
354
|
-
patches.filter((p) => isPathPrefix(childPath, p.path))
|
|
355
|
-
)) {
|
|
356
|
-
continue;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
safeAssign(t, key, nextVal);
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
return true;
|
|
363
|
-
}
|
|
364
|
-
function structuralSnapshot(value) {
|
|
365
|
-
if (!isDescendable(value)) return value;
|
|
366
|
-
if (value instanceof Map) {
|
|
367
|
-
const out2 = /* @__PURE__ */ new Map();
|
|
368
|
-
for (const [k, v] of value) out2.set(k, structuralSnapshot(v));
|
|
369
|
-
return out2;
|
|
370
|
-
}
|
|
371
|
-
if (Array.isArray(value)) {
|
|
372
|
-
const out2 = new Array(value.length);
|
|
373
|
-
for (let i = 0; i < value.length; i++) {
|
|
374
|
-
out2[i] = structuralSnapshot(value[i]);
|
|
375
|
-
}
|
|
376
|
-
return out2;
|
|
377
|
-
}
|
|
378
|
-
const src = value;
|
|
379
|
-
const out = {};
|
|
380
|
-
for (const k of Object.keys(src)) {
|
|
381
|
-
safeAssign(out, k, structuralSnapshot(safeOwnRead(src, k)));
|
|
382
|
-
}
|
|
383
|
-
return out;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
export { ANONYMOUS_FORM_KEY_PREFIX as A, DEFAULT_HISTORY_MAX_SNAPSHOTS as D, RESERVED_KEY_PREFIX as R, safeOwnRead as a, safeAssign as b, callConsumerFn as c, safeOwnHas as d, consumerHas as e, spreadConsumerRecord as f, copyConsumerArray as g, consumerKeys as h, isShadowedKey as i, readConsumerProp as j, diffAndApply as k, DEFAULT_FIELD_VALIDATION_DEBOUNCE_MS as l, consumerSymbolKeys as m, normalizeNumericOption as n, applyChangedKeys as o, pickDefined as p, DEFAULT_MAX_RECURSION_DEPTH as q, readConsumerIndex as r, structuralSnapshot as s, reportConsumerThrow as t, ANONYMOUS_WIZARD_KEY_PREFIX as u };
|