attaform 0.21.2 → 0.23.0

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.
Files changed (101) hide show
  1. package/README.md +7 -10
  2. package/dist/chunks/dev-key-collision-warnings.cjs +0 -33
  3. package/dist/chunks/dev-key-collision-warnings.cjs.map +1 -1
  4. package/dist/chunks/dev-key-collision-warnings.mjs +1 -33
  5. package/dist/chunks/dev-key-collision-warnings.mjs.map +1 -1
  6. package/dist/chunks/devtools.cjs +3 -5
  7. package/dist/chunks/devtools.cjs.map +1 -1
  8. package/dist/chunks/devtools.mjs +3 -5
  9. package/dist/chunks/devtools.mjs.map +1 -1
  10. package/dist/chunks/fingerprint2.cjs +1 -1
  11. package/dist/chunks/fingerprint2.mjs +1 -1
  12. package/dist/index.cjs +3 -5
  13. package/dist/index.cjs.map +1 -1
  14. package/dist/index.d.cts +6 -41
  15. package/dist/index.d.mts +6 -41
  16. package/dist/index.d.ts +6 -41
  17. package/dist/index.mjs +5 -5
  18. package/dist/nuxt.d.cts +1 -1
  19. package/dist/nuxt.d.mts +1 -1
  20. package/dist/nuxt.d.ts +1 -1
  21. package/dist/runtime/components/AttaformDevtoolsPanel.vue +3 -11
  22. package/dist/runtime/plugins/attaform.cjs +2 -2
  23. package/dist/runtime/plugins/attaform.mjs +2 -2
  24. package/dist/shared/{attaform.BGf_J22U.d.ts → attaform.BGMRvckW.d.ts} +11 -70
  25. package/dist/shared/{attaform.ory-3WhV.d.mts → attaform.BJnNK75Y.d.cts} +41 -491
  26. package/dist/shared/{attaform.ory-3WhV.d.ts → attaform.BJnNK75Y.d.mts} +41 -491
  27. package/dist/shared/{attaform.ory-3WhV.d.cts → attaform.BJnNK75Y.d.ts} +41 -491
  28. package/dist/shared/{attaform.DP-u7_tk.mjs → attaform.BhI9Icek.mjs} +17 -291
  29. package/dist/shared/attaform.BhI9Icek.mjs.map +1 -0
  30. package/dist/shared/{attaform.BwLp9KM7.cjs → attaform.BibT5AS_.cjs} +2 -2
  31. package/dist/shared/{attaform.BwLp9KM7.cjs.map → attaform.BibT5AS_.cjs.map} +1 -1
  32. package/dist/shared/{attaform.DkA5J8NW.d.cts → attaform.CO0e7YVY.d.cts} +1 -46
  33. package/dist/shared/{attaform.DkA5J8NW.d.ts → attaform.CO0e7YVY.d.mts} +1 -46
  34. package/dist/shared/{attaform.DkA5J8NW.d.mts → attaform.CO0e7YVY.d.ts} +1 -46
  35. package/dist/shared/{attaform.BwrowMp2.cjs → attaform.CaYj3ZfY.cjs} +3 -3
  36. package/dist/shared/{attaform.BwrowMp2.cjs.map → attaform.CaYj3ZfY.cjs.map} +1 -1
  37. package/dist/shared/{attaform.BBDIKtKY.cjs → attaform.Cmb_LCie.cjs} +4 -4
  38. package/dist/shared/{attaform.BVeLgfEh.mjs.map → attaform.Cmb_LCie.cjs.map} +1 -1
  39. package/dist/shared/{attaform.CTheKoTc.mjs → attaform.CtJOd7ox.mjs} +446 -525
  40. package/dist/shared/attaform.CtJOd7ox.mjs.map +1 -0
  41. package/dist/shared/{attaform.CrD73S4m.mjs → attaform.CzVta5o2.mjs} +116 -47
  42. package/dist/shared/attaform.CzVta5o2.mjs.map +1 -0
  43. package/dist/shared/{attaform.CnEl--PF.d.mts → attaform.D52oJiYC.d.cts} +1 -1
  44. package/dist/shared/{attaform.BoY6RZUl.d.cts → attaform.DCkSNnPr.d.mts} +1 -1
  45. package/dist/shared/{attaform.B5LNzqQh.cjs → attaform.Db4E4IW6.cjs} +18 -297
  46. package/dist/shared/attaform.Db4E4IW6.cjs.map +1 -0
  47. package/dist/shared/{attaform.CcnF1AKJ.cjs → attaform.DbyTD8N2.cjs} +116 -47
  48. package/dist/shared/attaform.DbyTD8N2.cjs.map +1 -0
  49. package/dist/shared/{attaform.D6GYGshL.mjs → attaform.Dd1Kmmaj.mjs} +3 -3
  50. package/dist/shared/{attaform.D6GYGshL.mjs.map → attaform.Dd1Kmmaj.mjs.map} +1 -1
  51. package/dist/shared/{attaform.BCcrLApm.d.mts → attaform.DrY8srOp.d.mts} +11 -70
  52. package/dist/shared/{attaform.D2ZuIOCf.cjs → attaform.DsQkXE3o.cjs} +445 -534
  53. package/dist/shared/attaform.DsQkXE3o.cjs.map +1 -0
  54. package/dist/shared/{attaform.BkjJfMvJ.d.cts → attaform.DuPneYR0.d.cts} +11 -70
  55. package/dist/shared/{attaform.C41gjp-a.mjs → attaform.Dx9-QQE2.mjs} +2 -2
  56. package/dist/shared/{attaform.C41gjp-a.mjs.map → attaform.Dx9-QQE2.mjs.map} +1 -1
  57. package/dist/shared/{attaform.BYgioWLF.d.ts → attaform.WEwfXcHq.d.ts} +1 -1
  58. package/dist/shared/{attaform.BVeLgfEh.mjs → attaform.alpG7rT7.mjs} +4 -4
  59. package/dist/shared/{attaform.BBDIKtKY.cjs.map → attaform.alpG7rT7.mjs.map} +1 -1
  60. package/dist/zod-v3.cjs +2 -2
  61. package/dist/zod-v3.d.cts +3 -3
  62. package/dist/zod-v3.d.mts +3 -3
  63. package/dist/zod-v3.d.ts +3 -3
  64. package/dist/zod-v3.mjs +2 -2
  65. package/dist/zod-v4.cjs +2 -2
  66. package/dist/zod-v4.d.cts +5 -5
  67. package/dist/zod-v4.d.mts +5 -5
  68. package/dist/zod-v4.d.ts +5 -5
  69. package/dist/zod-v4.mjs +2 -2
  70. package/dist/zod.cjs +5 -5
  71. package/dist/zod.d.cts +5 -5
  72. package/dist/zod.d.mts +5 -5
  73. package/dist/zod.d.ts +5 -5
  74. package/dist/zod.mjs +5 -5
  75. package/package.json +2 -2
  76. package/dist/chunks/indexeddb.cjs +0 -119
  77. package/dist/chunks/indexeddb.cjs.map +0 -1
  78. package/dist/chunks/indexeddb.mjs +0 -117
  79. package/dist/chunks/indexeddb.mjs.map +0 -1
  80. package/dist/chunks/local-storage.cjs +0 -58
  81. package/dist/chunks/local-storage.cjs.map +0 -1
  82. package/dist/chunks/local-storage.mjs +0 -56
  83. package/dist/chunks/local-storage.mjs.map +0 -1
  84. package/dist/chunks/multi-tab-sync.cjs +0 -367
  85. package/dist/chunks/multi-tab-sync.cjs.map +0 -1
  86. package/dist/chunks/multi-tab-sync.mjs +0 -364
  87. package/dist/chunks/multi-tab-sync.mjs.map +0 -1
  88. package/dist/chunks/session-storage.cjs +0 -58
  89. package/dist/chunks/session-storage.cjs.map +0 -1
  90. package/dist/chunks/session-storage.mjs +0 -56
  91. package/dist/chunks/session-storage.mjs.map +0 -1
  92. package/dist/chunks/wire-persistence.cjs +0 -396
  93. package/dist/chunks/wire-persistence.cjs.map +0 -1
  94. package/dist/chunks/wire-persistence.mjs +0 -394
  95. package/dist/chunks/wire-persistence.mjs.map +0 -1
  96. package/dist/shared/attaform.B5LNzqQh.cjs.map +0 -1
  97. package/dist/shared/attaform.CTheKoTc.mjs.map +0 -1
  98. package/dist/shared/attaform.CcnF1AKJ.cjs.map +0 -1
  99. package/dist/shared/attaform.CrD73S4m.mjs.map +0 -1
  100. package/dist/shared/attaform.D2ZuIOCf.cjs.map +0 -1
  101. package/dist/shared/attaform.DP-u7_tk.mjs.map +0 -1
@@ -2,9 +2,6 @@ import { shallowReactive, getCurrentInstance, inject, isRef, effectScope, watch,
2
2
 
3
3
  const __DEV__ = (typeof process !== "undefined" ? process.env.NODE_ENV : "production") !== "production";
4
4
 
5
- var __defProp = Object.defineProperty;
6
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
8
5
  class AttaformError extends Error {
9
6
  constructor(message, options) {
10
7
  super(message, options);
@@ -48,24 +45,6 @@ class ReservedFormKeyError extends AttaformError {
48
45
  );
49
46
  }
50
47
  }
51
- class AnonPersistError extends AttaformError {
52
- constructor(opts) {
53
- super(formatAnonPersistMessage(opts));
54
- __publicField(this, "schemaFields");
55
- __publicField(this, "callSite");
56
- __publicField(this, "cause");
57
- this.schemaFields = opts.schemaFields;
58
- this.callSite = opts.callSite;
59
- this.cause = opts.cause;
60
- }
61
- }
62
- function formatAnonPersistMessage(opts) {
63
- const head = opts.cause === "no-key" ? `useForm({ persist: ... }) requires an explicit \`key:\`. Anonymous synthetic keys (\`__atta:anon:*\`) drift across mounts and can collide between unrelated forms \u2014 refusing to persist to a non-deterministic location.` : `register(_, { persist: true }) declared on a form whose useForm() options have no \`persist:\` configured. The opt-in is recorded but nothing would ever land in storage.`;
64
- const fields = opts.schemaFields !== void 0 && opts.schemaFields.length > 0 ? ` Form fields: { ${opts.schemaFields.join(", ")} }.` : "";
65
- const fix = opts.cause === "no-key" ? ` Fix: add \`key: '<stable-id>'\` to useForm().` : ` Fix: add \`persist: 'session'\` (or 'local') and \`key:\` to useForm(), or remove \`{ persist: true }\` from this register() call.`;
66
- const where = opts.callSite !== void 0 ? ` ${opts.callSite}` : "";
67
- return `[attaform] ${head}${fields}${fix}${where}`;
68
- }
69
48
 
70
49
  function detectSSR(options = {}) {
71
50
  if (options.ssr !== void 0) return options.ssr;
@@ -617,21 +596,6 @@ function readFilesFromInput(el) {
617
596
  if (files === null || files.length === 0) return null;
618
597
  return files.item(0);
619
598
  }
620
- const warnedPersistedFileForms = __DEV__ ? /* @__PURE__ */ new WeakMap() : null;
621
- function maybeWarnPersistedFile(value) {
622
- if (!__DEV__ || warnedPersistedFileForms === null) return;
623
- if (value.persist !== true) return;
624
- let warnedPaths = warnedPersistedFileForms.get(value.persistOptIns);
625
- if (warnedPaths === void 0) {
626
- warnedPaths = /* @__PURE__ */ new Set();
627
- warnedPersistedFileForms.set(value.persistOptIns, warnedPaths);
628
- }
629
- if (warnedPaths.has(value.path)) return;
630
- warnedPaths.add(value.path);
631
- warn(
632
- `[attaform] register('${value.path}', { persist: true }) on <input type="file"> \u2014 files can't ride a refresh (browsers block programmatic writes to <input type="file">), so this path won't be saved. For long-lived flows, upload on selection and persist the resulting URL or ID in a sibling string field.`
633
- );
634
- }
635
599
  const fileScopeKey = Symbol.for("attaform:file-scope");
636
600
  const vRegisterFile = {
637
601
  created(el, { value }, vnode) {
@@ -639,7 +603,6 @@ const vRegisterFile = {
639
603
  const input = el;
640
604
  value.registerElement(input);
641
605
  setAssignFunction(input, vnode, value);
642
- maybeWarnPersistedFile(value);
643
606
  const currentRaw = value.innerRef.value;
644
607
  if (isBlankFileValue(currentRaw)) {
645
608
  const blankShape = isMultipleInput(input, vnode) ? [] : null;
@@ -689,250 +652,11 @@ const vRegisterFile = {
689
652
  }
690
653
  };
691
654
 
692
- const idGenerator = /* @__PURE__ */ (() => {
693
- let counter = 0;
694
- return () => `el-${++counter}`;
695
- })();
696
- const elementIds = /* @__PURE__ */ new WeakMap();
697
- function getOrAssignElementId(el) {
698
- let id = elementIds.get(el);
699
- if (id === void 0) {
700
- id = idGenerator();
701
- elementIds.set(el, id);
702
- }
703
- return id;
704
- }
705
- function createPersistOptInRegistry() {
706
- const byPath = /* @__PURE__ */ new Map();
707
- function add(elementId, path) {
708
- const existing = byPath.get(path);
709
- if (existing === void 0) {
710
- byPath.set(path, /* @__PURE__ */ new Set([elementId]));
711
- return;
712
- }
713
- existing.add(elementId);
714
- }
715
- function remove(elementId, path) {
716
- const existing = byPath.get(path);
717
- if (existing === void 0) return;
718
- existing.delete(elementId);
719
- if (existing.size === 0) byPath.delete(path);
720
- }
721
- function removeAllFor(elementId) {
722
- for (const [path, ids] of byPath) {
723
- if (!ids.delete(elementId)) continue;
724
- if (ids.size === 0) byPath.delete(path);
725
- }
726
- }
727
- function hasOptIn(elementId, path) {
728
- return byPath.get(path)?.has(elementId) ?? false;
729
- }
730
- function hasAnyOptInForPath(path) {
731
- const ids = byPath.get(path);
732
- return ids !== void 0 && ids.size > 0;
733
- }
734
- function optedInPaths() {
735
- return byPath.keys();
736
- }
737
- function isEmpty() {
738
- return byPath.size === 0;
739
- }
740
- function clear() {
741
- byPath.clear();
742
- }
743
- return {
744
- add,
745
- remove,
746
- removeAllFor,
747
- hasOptIn,
748
- hasAnyOptInForPath,
749
- optedInPaths,
750
- isEmpty,
751
- clear
752
- };
753
- }
754
-
755
- const DEFAULT_SENSITIVE_NAMES = Object.freeze([
756
- // Passwords + PIN-like
757
- "password",
758
- "passwd",
759
- "pwd",
760
- "pin",
761
- // Card / payment
762
- "cvv",
763
- "cvc",
764
- "card_number",
765
- "card_num",
766
- "card",
767
- "iban",
768
- "routing_number",
769
- "account_number",
770
- // Government / identity
771
- "ssn",
772
- "social_security",
773
- "dob",
774
- "date_of_birth",
775
- "passport",
776
- "driver_license",
777
- // Tax IDs
778
- "tin",
779
- "ein",
780
- "itin",
781
- "tax_id",
782
- // Tokens / secrets / API auth
783
- "token",
784
- "tokens",
785
- "secret",
786
- "secrets",
787
- "api_key",
788
- "api_secret",
789
- "api_token",
790
- "private_key",
791
- "bearer",
792
- "oauth",
793
- "auth_token",
794
- "access_token",
795
- "refresh_token",
796
- "session_id",
797
- "session_key",
798
- "session_token",
799
- // MFA / OTP
800
- "otp",
801
- "one_time_password",
802
- "one_time_code",
803
- "mfa_secret",
804
- "mfa_seed",
805
- "mfa_code",
806
- "mfa_token",
807
- "two_factor_code",
808
- "two_factor_token",
809
- "2fa",
810
- "2fa_code",
811
- "2fa_token",
812
- "recovery_code",
813
- "backup_code"
814
- ]);
815
- const WORD_BOUNDARY_THRESHOLD = 5;
816
- function escapeRegex(s) {
817
- return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
818
- }
819
- function nameToRegex(name) {
820
- const parts = name.split(/[_\s-]/).filter((p) => p.length > 0);
821
- if (parts.length === 0) {
822
- return /(?!)/;
823
- }
824
- const escaped = parts.map(escapeRegex).join("[_\\s-]?");
825
- const compactLength = parts.reduce((sum, p) => sum + p.length, 0);
826
- const useBoundary = compactLength <= WORD_BOUNDARY_THRESHOLD;
827
- const source = useBoundary ? `\\b${escaped}\\b` : escaped;
828
- return new RegExp(source, "i");
829
- }
830
- function namesToPatterns(names) {
831
- const patterns = [];
832
- for (const name of names) {
833
- if (typeof name !== "string" || name.length === 0) continue;
834
- patterns.push(nameToRegex(name));
835
- }
836
- return patterns;
837
- }
838
- const DEFAULT_PATTERNS = namesToPatterns(DEFAULT_SENSITIVE_NAMES);
839
- function createSegmentMatchesSensitive(names = DEFAULT_SENSITIVE_NAMES) {
840
- const patterns = names === DEFAULT_SENSITIVE_NAMES ? DEFAULT_PATTERNS : namesToPatterns(names);
841
- return (segment) => {
842
- if (typeof segment !== "string") return false;
843
- for (const p of patterns) {
844
- if (p.test(segment)) return true;
845
- }
846
- return false;
847
- };
848
- }
849
- function createIsSensitivePath(names = DEFAULT_SENSITIVE_NAMES) {
850
- const segmentMatches = createSegmentMatchesSensitive(names);
851
- return (path) => {
852
- if (typeof path !== "string") {
853
- for (const segment of path) {
854
- if (segmentMatches(segment)) return true;
855
- }
856
- return false;
857
- }
858
- if (path.startsWith("[")) {
859
- try {
860
- const parsed = JSON.parse(path);
861
- if (Array.isArray(parsed)) {
862
- for (const segment of parsed) {
863
- if (segmentMatches(segment)) return true;
864
- }
865
- return false;
866
- }
867
- } catch {
868
- }
869
- }
870
- for (const segment of path.split(".")) {
871
- if (segmentMatches(segment)) return true;
872
- }
873
- return false;
874
- };
875
- }
876
- const defaultIsSensitivePath = createIsSensitivePath();
877
- function isSensitivePath(path) {
878
- return defaultIsSensitivePath(path);
879
- }
880
- const warnedSensitivePersist = __DEV__ ? /* @__PURE__ */ new Set() : null;
881
- function allowSensitivePersist(path, acknowledged, isSensitive = defaultIsSensitivePath) {
882
- if (acknowledged) return true;
883
- if (!isSensitive(path)) return true;
884
- if (warnedSensitivePersist !== null) {
885
- const display = Array.isArray(path) ? path.join(".") : String(path);
886
- if (!warnedSensitivePersist.has(display)) {
887
- warnedSensitivePersist.add(display);
888
- console.warn(
889
- `[attaform] Not persisting "${display}" \u2014 it matches a sensitive-name pattern (password / cvv / ssn / token / etc.) and was opted into persistence without \`acknowledgeSensitive: true\`. Storing sensitive data in client-side storage is a compliance risk (PII / PCI-DSS / HIPAA / SOC2). Persist it server-side, or pass \`acknowledgeSensitive: true\` to register() / form.persist() if this is intentional.`
890
- );
891
- }
892
- }
893
- return false;
894
- }
895
-
896
- function syncPersistOptIn(el, value, oldValue, vnodeType) {
897
- const wasOptedIn = isRegisterValue(oldValue) && oldValue.persist === true;
898
- const isFileInput = el.tagName === "INPUT" && (vnodeType === "file" || el.type === "file");
899
- const wantsOptIn = !isFileInput && isRegisterValue(value) && value.persist === true;
900
- if (!wasOptedIn && !wantsOptIn) return;
901
- const elementId = getOrAssignElementId(el);
902
- if (wasOptedIn) {
903
- const old = oldValue;
904
- const samePathAndRegistry = wantsOptIn && value.path === old.path && value.persistOptIns === old.persistOptIns;
905
- if (!samePathAndRegistry) {
906
- old.persistOptIns.remove(elementId, old.path);
907
- }
908
- }
909
- if (wantsOptIn) {
910
- const v = value;
911
- if (allowSensitivePersist(v.path, v.acknowledgeSensitive, v.isSensitivePath)) {
912
- v.persistOptIns.add(elementId, v.path);
913
- }
914
- }
915
- }
916
- function syncMultiTabOptOut(value, oldValue) {
917
- const wasOptedOut = isRegisterValue(oldValue) && oldValue.unmarkNoSync !== void 0;
918
- const wantsOptOut = isRegisterValue(value) && value.markNoSync !== void 0;
919
- if (!wasOptedOut && !wantsOptOut) return;
920
- if (wasOptedOut) {
921
- const old = oldValue;
922
- const samePath = wantsOptOut && value.path === old.path;
923
- if (!samePath) old.unmarkNoSync?.();
924
- }
925
- if (wantsOptOut) {
926
- const v = value;
927
- const samePathOld = wasOptedOut && oldValue.path === v.path;
928
- if (!samePathOld) v.markNoSync?.();
929
- }
930
- }
931
655
  function syncElementRegistration(el, value, oldValue) {
932
656
  const wasRegistered = isRegisterValue(oldValue);
933
657
  const isRegistered = isRegisterValue(value);
934
658
  if (!wasRegistered && !isRegistered) return;
935
- const samePathAndStore = wasRegistered && isRegistered && oldValue.path === value.path && oldValue.persistOptIns === value.persistOptIns;
659
+ const samePathAndStore = wasRegistered && isRegistered && oldValue.path === value.path && oldValue.formKey === value.formKey;
936
660
  if (wasRegistered && !samePathAndStore) {
937
661
  oldValue.deregisterElement(el);
938
662
  }
@@ -1453,8 +1177,6 @@ function getCheckboxValue(el, checked) {
1453
1177
  const warnedUnsupportedElements = __DEV__ ? /* @__PURE__ */ new WeakSet() : null;
1454
1178
  const vRegisterDynamic = {
1455
1179
  created(el, binding, vnode) {
1456
- syncPersistOptIn(el, binding.value, void 0, vnode.props?.["type"]);
1457
- syncMultiTabOptOut(binding.value, void 0);
1458
1180
  callModelHook(el, binding, vnode, null, "created");
1459
1181
  if (isRegisterValue(binding.value)) setupAria(el, binding.value, vnode);
1460
1182
  },
@@ -1476,8 +1198,6 @@ const vRegisterDynamic = {
1476
1198
  }
1477
1199
  },
1478
1200
  beforeUpdate(el, binding, vnode, prevVNode) {
1479
- syncPersistOptIn(el, binding.value, binding.oldValue, vnode.props?.["type"]);
1480
- syncMultiTabOptOut(binding.value, binding.oldValue);
1481
1201
  syncElementRegistration(el, binding.value, binding.oldValue);
1482
1202
  callModelHook(el, binding, vnode, prevVNode, "beforeUpdate");
1483
1203
  const ariaEl = el;
@@ -1503,10 +1223,6 @@ const vRegisterDynamic = {
1503
1223
  removeTrackedListeners(el);
1504
1224
  teardownAria(el);
1505
1225
  teardownValueSync(el);
1506
- if (isRegisterValue(value)) {
1507
- value.persistOptIns.removeAllFor(getOrAssignElementId(el));
1508
- value.unmarkNoSync?.();
1509
- }
1510
1226
  if (!isRegisterValue(value)) return;
1511
1227
  value.deregisterElement(el);
1512
1228
  delete el.composing;
@@ -1670,17 +1386,20 @@ function canonicalizePath(input) {
1670
1386
  if (typeof input === "string") {
1671
1387
  const cached = canonicalStringCache.get(input);
1672
1388
  if (cached !== void 0) return cached;
1673
- const segments2 = parseDottedPath(input);
1674
- const key2 = JSON.stringify(segments2);
1675
- const entry = { segments: segments2, key: key2 };
1389
+ const segments = parseDottedPath(input);
1390
+ const key = JSON.stringify(segments);
1391
+ const entry = { segments, key };
1676
1392
  if (canonicalStringCache.size >= CANONICAL_STRING_CACHE_MAX) {
1677
1393
  const oldest = canonicalStringCache.keys().next().value;
1678
1394
  if (oldest !== void 0) canonicalStringCache.delete(oldest);
1679
1395
  }
1680
1396
  canonicalStringCache.set(input, entry);
1681
- rememberSegmentsForPathKey(key2, segments2);
1397
+ rememberSegmentsForPathKey(key, segments);
1682
1398
  return entry;
1683
1399
  }
1400
+ return keyForSegments(input);
1401
+ }
1402
+ function keyForSegments(input) {
1684
1403
  const segments = Array.from(input).map(normalizeSegment);
1685
1404
  const key = JSON.stringify(segments);
1686
1405
  rememberSegmentsForPathKey(key, segments);
@@ -1717,6 +1436,13 @@ function isPathPrefix(prefix, path) {
1717
1436
  }
1718
1437
  return true;
1719
1438
  }
1439
+ function pathsEqual(a, b) {
1440
+ if (a.length !== b.length) return false;
1441
+ for (let i = 0; i < a.length; i++) {
1442
+ if (a[i] !== b[i]) return false;
1443
+ }
1444
+ return true;
1445
+ }
1720
1446
 
1721
- export { AnonPersistError as A, createPersistOptInRegistry as B, ensureAttaformInstalled as C, DEFAULT_SENSITIVE_NAMES as D, kFormContext as E, FORM_ERRORS_PATH_KEY as F, kFormInstanceId as G, createIsSensitivePath as H, InvalidPathError as I, REGISTER_OWNER_MARKER as J, kAttaformAncestorWizard as K, OutsideSetupError as O, ROOT_PATH as R, SubmitErrorHandlerError as S, V_REGISTER_MARKER as V, __DEV__ as _, canonicalizePath as a, AttaformError as b, createAttaform as c, InvalidUseFormConfigError as d, ROOT_PATH_KEY as e, RegistryNotInstalledError as f, getRegistryFromApp as g, ReservedFormKeyError as h, assignKey as i, createRegistry as j, kAttaformWizardActiveStepResolver as k, isPathPrefix as l, isRegisterValue as m, kAttaformRegistry as n, pathKeyToDotted as o, parseDottedPath as p, INTERACTIVE_TAG_NAMES as q, getOrAssignElementId as r, segmentsForPathKey as s, toError as t, useRegistry as u, vRegister as v, allowSensitivePersist as w, FORM_ERRORS_PATH as x, coerceToPathKey as y, isSensitivePath as z };
1722
- //# sourceMappingURL=attaform.DP-u7_tk.mjs.map
1447
+ export { AttaformError as A, kFormInstanceId as B, REGISTER_OWNER_MARKER as C, kAttaformAncestorWizard as D, FORM_ERRORS_PATH_KEY as F, InvalidPathError as I, OutsideSetupError as O, ROOT_PATH as R, SubmitErrorHandlerError as S, V_REGISTER_MARKER as V, __DEV__ as _, canonicalizePath as a, InvalidUseFormConfigError as b, createAttaform as c, ROOT_PATH_KEY as d, RegistryNotInstalledError as e, ReservedFormKeyError as f, getRegistryFromApp as g, assignKey as h, createRegistry as i, isPathPrefix as j, kAttaformWizardActiveStepResolver as k, isRegisterValue as l, kAttaformRegistry as m, pathKeyToDotted as n, pathsEqual as o, parseDottedPath as p, keyForSegments as q, INTERACTIVE_TAG_NAMES as r, segmentsForPathKey as s, toError as t, useRegistry as u, vRegister as v, FORM_ERRORS_PATH as w, coerceToPathKey as x, ensureAttaformInstalled as y, kFormContext as z };
1448
+ //# sourceMappingURL=attaform.BhI9Icek.mjs.map