@lehnihon/bit-form 2.2.7 → 2.2.8
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/README.md +6 -6
- package/dist/angular/index.cjs +1 -1
- package/dist/angular/index.cjs.map +1 -1
- package/dist/angular/index.d.cts +10 -8
- package/dist/angular/index.d.ts +10 -8
- package/dist/angular/index.js +1 -1
- package/dist/angular/index.js.map +1 -1
- package/dist/{array-controller-DtkmcnUr.d.ts → array-controller-B5bfXV1W.d.cts} +4 -4
- package/dist/{array-controller-C1A5VKYd.d.cts → array-controller-Cx-DMH7Y.d.ts} +4 -4
- package/dist/bus-B2VEKrPI.d.ts +19 -0
- package/dist/bus-ZLQeq4Vr.d.cts +19 -0
- package/dist/chunk-5NA2TFPG.js +1 -0
- package/dist/chunk-5NA2TFPG.js.map +1 -0
- package/dist/chunk-63OJBMKK.js +2 -0
- package/dist/chunk-63OJBMKK.js.map +1 -0
- package/dist/chunk-BSGJ3T5S.cjs +2 -0
- package/dist/chunk-BSGJ3T5S.cjs.map +1 -0
- package/dist/chunk-CPP7ELA5.js +2 -0
- package/dist/chunk-CPP7ELA5.js.map +1 -0
- package/dist/chunk-D7JQWF6V.cjs +2 -0
- package/dist/chunk-D7JQWF6V.cjs.map +1 -0
- package/dist/chunk-E2NZR44P.js +2 -0
- package/dist/chunk-E2NZR44P.js.map +1 -0
- package/dist/chunk-EQ55DKX2.js +2 -0
- package/dist/chunk-EQ55DKX2.js.map +1 -0
- package/dist/chunk-JC4R5WCC.js +2 -0
- package/dist/chunk-JC4R5WCC.js.map +1 -0
- package/dist/chunk-M6WBNHIT.cjs +2 -0
- package/dist/chunk-M6WBNHIT.cjs.map +1 -0
- package/dist/chunk-MFSQATNZ.cjs +2 -0
- package/dist/chunk-MFSQATNZ.cjs.map +1 -0
- package/dist/chunk-MFTWAFMG.cjs +2 -0
- package/dist/chunk-MFTWAFMG.cjs.map +1 -0
- package/dist/chunk-P2YWYBWG.cjs +2 -0
- package/dist/chunk-P2YWYBWG.cjs.map +1 -0
- package/dist/chunk-RD73EBSN.js +2 -0
- package/dist/chunk-RD73EBSN.js.map +1 -0
- package/dist/chunk-T2JRSWQU.cjs +2 -0
- package/dist/chunk-T2JRSWQU.cjs.map +1 -0
- package/dist/chunk-UQ3DSUWC.js +2 -0
- package/dist/chunk-UQ3DSUWC.js.map +1 -0
- package/dist/chunk-VZHG372Q.cjs +2 -0
- package/dist/chunk-VZHG372Q.cjs.map +1 -0
- package/dist/chunk-W2E5UIXT.js +2 -0
- package/dist/chunk-W2E5UIXT.js.map +1 -0
- package/dist/chunk-W5CLDRRE.cjs +1 -0
- package/dist/chunk-W5CLDRRE.cjs.map +1 -0
- package/dist/core/bindings.cjs +2 -0
- package/dist/core/bindings.cjs.map +1 -0
- package/dist/core/bindings.d.cts +81 -0
- package/dist/core/bindings.d.ts +81 -0
- package/dist/core/bindings.js +2 -0
- package/dist/core/bindings.js.map +1 -0
- package/dist/core/status.cjs +2 -0
- package/dist/core/status.cjs.map +1 -0
- package/dist/core/status.d.cts +44 -0
- package/dist/core/status.d.ts +44 -0
- package/dist/core/status.js +2 -0
- package/dist/core/status.js.map +1 -0
- package/dist/core/store.cjs +2 -0
- package/dist/core/store.cjs.map +1 -0
- package/dist/core/store.d.cts +84 -0
- package/dist/core/store.d.ts +84 -0
- package/dist/core/store.js +2 -0
- package/dist/core/store.js.map +1 -0
- package/dist/core/utils.cjs +2 -0
- package/dist/core/utils.cjs.map +1 -0
- package/dist/core/utils.d.cts +81 -0
- package/dist/core/utils.d.ts +81 -0
- package/dist/core/utils.js +2 -0
- package/dist/core/utils.js.map +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +14 -122
- package/dist/core.d.ts +14 -122
- package/dist/core.js +1 -1
- package/dist/devtools/bridge.cjs +1 -1
- package/dist/devtools/bridge.cjs.map +1 -1
- package/dist/devtools/bridge.d.cts +3 -2
- package/dist/devtools/bridge.d.ts +3 -2
- package/dist/devtools/bridge.js +1 -1
- package/dist/devtools/index.cjs +2 -2
- package/dist/devtools/index.cjs.map +1 -1
- package/dist/devtools/index.d.cts +3 -2
- package/dist/devtools/index.d.ts +3 -2
- package/dist/devtools/index.js +1 -1
- package/dist/devtools/index.js.map +1 -1
- package/dist/{field-binding-X5TkvfUt.d.cts → field-binding-B_OX3bjp.d.cts} +1 -1
- package/dist/{field-binding-Bi1g-D8X.d.ts → field-binding-MX6jVQbT.d.ts} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -85
- package/dist/index.d.ts +8 -85
- package/dist/index.js +1 -1
- package/dist/mask.d.cts +2 -2
- package/dist/mask.d.ts +2 -2
- package/dist/meta-types-Bzmm21TP.d.cts +18 -0
- package/dist/meta-types-Bzmm21TP.d.ts +18 -0
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +11 -9
- package/dist/react/index.d.ts +11 -9
- package/dist/react/index.js +1 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react-native/index.cjs +1 -1
- package/dist/react-native/index.cjs.map +1 -1
- package/dist/react-native/index.d.cts +9 -7
- package/dist/react-native/index.d.ts +9 -7
- package/dist/react-native/index.js +1 -1
- package/dist/react-native/index.js.map +1 -1
- package/dist/resolvers/index.cjs +1 -1
- package/dist/resolvers/index.cjs.map +1 -1
- package/dist/resolvers/index.d.cts +3 -2
- package/dist/resolvers/index.d.ts +3 -2
- package/dist/resolvers/index.js +1 -1
- package/dist/resolvers/joi.d.cts +3 -2
- package/dist/resolvers/joi.d.ts +3 -2
- package/dist/resolvers/yup.d.cts +3 -2
- package/dist/resolvers/yup.d.ts +3 -2
- package/dist/resolvers/zod.d.cts +3 -2
- package/dist/resolvers/zod.d.ts +3 -2
- package/dist/store-api-types-D-ZHxzRy.d.cts +161 -0
- package/dist/store-api-types-DPi30jQF.d.ts +161 -0
- package/dist/{bus-DgilLszS.d.ts → types-CG5nYeRk.d.ts} +76 -45
- package/dist/{bus-rcUiufS7.d.cts → types-D6LhF5GC.d.cts} +76 -45
- package/dist/{types-CUXh7PqD.d.cts → types-D8DgIUhJ.d.cts} +1 -1
- package/dist/{types-CUXh7PqD.d.ts → types-D8DgIUhJ.d.ts} +1 -1
- package/dist/{upload-EXnJLq8k.d.cts → upload-C2mpfhp1.d.cts} +1 -1
- package/dist/{upload-EXnJLq8k.d.ts → upload-C2mpfhp1.d.ts} +1 -1
- package/dist/{use-bit-persist-CIKFwtdM.d.cts → use-bit-persist-BTwy8kvA.d.ts} +8 -6
- package/dist/{use-bit-persist-Bc06fmqZ.d.ts → use-bit-persist-C2LHNTVv.d.cts} +8 -6
- package/dist/utils.cjs +2 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.cts +6 -0
- package/dist/utils.d.ts +6 -0
- package/dist/utils.js +2 -0
- package/dist/utils.js.map +1 -0
- package/dist/vue/index.cjs +1 -1
- package/dist/vue/index.cjs.map +1 -1
- package/dist/vue/index.d.cts +9 -7
- package/dist/vue/index.d.ts +9 -7
- package/dist/vue/index.js +1 -1
- package/dist/vue/index.js.map +1 -1
- package/package.json +32 -10
- package/dist/chunk-DIEE6LUO.js +0 -2
- package/dist/chunk-DIEE6LUO.js.map +0 -1
- package/dist/chunk-FUUQB4DV.cjs +0 -2
- package/dist/chunk-FUUQB4DV.cjs.map +0 -1
- package/dist/chunk-KWLLYQOL.cjs +0 -2
- package/dist/chunk-KWLLYQOL.cjs.map +0 -1
- package/dist/chunk-LIYZPSWM.js +0 -2
- package/dist/chunk-LIYZPSWM.js.map +0 -1
- package/dist/chunk-QAL6J5GQ.cjs +0 -2
- package/dist/chunk-QAL6J5GQ.cjs.map +0 -1
- package/dist/chunk-SA47B5OP.js +0 -2
- package/dist/chunk-SA47B5OP.js.map +0 -1
- package/dist/store-api-types-9ipdute1.d.ts +0 -187
- package/dist/store-api-types-B6_bPoVI.d.cts +0 -187
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8; var _class9; var _class10; var _class11; var _class12; var _class13; var _class14; var _class15; var _class16; var _class17; var _class18;var _chunkD7JQWF6Vcjs = require('./chunk-D7JQWF6V.cjs');var _chunkT2JRSWQUcjs = require('./chunk-T2JRSWQU.cjs');var M=Symbol.for("bit-form.framework-store-api");var k=Symbol.for("bit-form.hooks-api");function $e(r,t){if((!r||r.length===0)&&(!t||t.length===0))return;let e=new Set(_nullishCoalesce(r, () => ([])));return _optionalChain([t, 'optionalAccess', _2 => _2.forEach, 'call', _3 => _3(i=>e.add(i))]),Array.from(e)}function At(r){let{values:t,entries:e,deriveValue:i}=r,s=[];for(let a of e){let o=_chunkT2JRSWQUcjs.f.call(void 0, t,a.path),n=i(a,o);_chunkT2JRSWQUcjs.c.call(void 0, o,n)||s.push([a.path,n])}return s}function Je(r){let t=_nullishCoalesce(_optionalChain([r, 'optionalAccess', _4 => _4.includes, 'call', _5 => _5("*")]), () => (!1));return e=>!r||r.length===0||t?!0:r.some(i=>e===i||e.startsWith(`${i}.`)||i.startsWith(`${e}.`))}function Ge(r,t){if(!t||t.length===0||t.includes("*"))return r;let e=Je(t);return r.filter(i=>i.dependsOn.some(s=>e(s)))}function O(r){let{values:t,changedPaths:e,normalizerEntries:i,applyComputed:s}=r,a=Ge(i,e);if(a.length===0)return s(t,e);let o=At({values:t,entries:a,deriveValue:(p,l)=>p.normalize(l,t)}),n=o.length>0?_chunkT2JRSWQUcjs.h.call(void 0, t,o):t,d=$e(e,o.map(([p])=>p));return s(n,d)}function Rt(r){let{values:t,sourceValues:e,transformEntries:i}=r;if(i.length===0)return t;let s=At({values:t,entries:i.map(([a,o])=>({path:a,transform:o})),deriveValue:(a,o)=>a.transform(o,e)});return s.length===0?t:_chunkT2JRSWQUcjs.h.call(void 0, t,s)}var j= (_class =class{constructor(t){;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);this.getComputedEntries=t}__init() {this.equalityCache=new Map}__init2() {this.reverseDepsCache=null}__init3() {this.childDepsIndex=null}__init4() {this.validatedEntriesSignature=null}__init5() {this.orderedAllEntriesCache=null}isCacheableScalar(t){return t===null||typeof t!="object"&&typeof t!="function"}invalidateReverseDeps(){this.reverseDepsCache=null,this.childDepsIndex=null,this.orderedAllEntriesCache=null,this.validatedEntriesSignature=null,this.equalityCache.clear()}apply(t,e){let i=this.getComputedEntries();if(i.length===0)return t;this.ensureEntriesAreValid(i);let s=this.resolveEntriesToRun(i,e);if(s.length===0)return t;let a=t;for(let o of s){let n=o.compute(a),d=_chunkT2JRSWQUcjs.f.call(void 0, a,o.path),p=this.equalityCache.get(o.path),l,c=this.isCacheableScalar(d)&&this.isCacheableScalar(n);c&&p&&p.current===d&&p.next===n?l=p.equal:(l=_chunkT2JRSWQUcjs.d.call(void 0, d,n),c?this.equalityCache.set(o.path,{current:d,next:n,equal:l}):this.equalityCache.delete(o.path)),l||(a=_chunkT2JRSWQUcjs.g.call(void 0, a,o.path,n))}return a}getReverseDependencies(t){if(this.reverseDepsCache)return this.reverseDepsCache;let e=new Map;for(let s of t)for(let a of s.dependsOn){let o=e.get(a);o||(o=new Set,e.set(a,o)),o.add(s.path)}let i=new Map;for(let s of e.keys()){let a=s.split(".");for(let o=1;o<a.length;o++){let n=a.slice(0,o).join("."),d=i.get(n);d||(d=new Set,i.set(n,d)),d.add(s)}}return this.reverseDepsCache=e,this.childDepsIndex=i,e}resolveEntriesToRun(t,e){if(!e||e.length===0||e.includes("*"))return this.getOrderedAllEntries(t);let i=this.getReverseDependencies(t),s=new Set,a=[...e];for(;a.length>0;){let n=a.shift(),d=this.getDependentsForPath(i,n);if(d)for(let p of d)s.has(p)||(s.add(p),a.push(p))}return s.size===0?[]:this.getOrderedAllEntries(t).filter(n=>s.has(n.path))}orderEntries(t){if(t.length<=1)return t;let e=new Map(t.map(n=>[n.path,n])),i=new Map,s=new Map;t.forEach(n=>i.set(n.path,0)),t.forEach(n=>{n.dependsOn.forEach(d=>{if(!e.has(d))return;let p=_nullishCoalesce(s.get(d), () => (new Set));p.has(n.path)||(p.add(n.path),s.set(d,p),i.set(n.path,(_nullishCoalesce(i.get(n.path), () => (0)))+1))})});let a=t.filter(n=>(_nullishCoalesce(i.get(n.path), () => (0)))===0).map(n=>n.path),o=[];for(;a.length>0;){let n=a.shift();o.push(n);let d=s.get(n);d&&d.forEach(p=>{let l=(_nullishCoalesce(i.get(p), () => (0)))-1;i.set(p,l),l===0&&a.push(p)})}if(o.length!==t.length)throw new Error("BitStore: cyclic computed dependencies detected. Check computedDependsOn definitions.");return o.map(n=>e.get(n))}getOrderedAllEntries(t){let e=this.createEntriesSignature(t);if(this.orderedAllEntriesCache&&this.orderedAllEntriesCache.signature===e)return this.orderedAllEntriesCache.ordered;let i=this.orderEntries(t);return this.orderedAllEntriesCache={signature:e,ordered:i},i}ensureEntriesAreValid(t){let e=this.createEntriesSignature(t);this.validatedEntriesSignature!==e&&(t.forEach(i=>this.assertDependencies(i)),this.validatedEntriesSignature=e,this.invalidateReverseDeps())}createEntriesSignature(t){return t.map(e=>`${e.path}:${e.dependsOn.join(",")}`).join("|")}getDependentsForPath(t,e){let i=new Set,s=n=>{let d=t.get(n);d&&d.forEach(p=>i.add(p))};s(e);let a=e.split(".");for(;a.length>1;)a.pop(),s(a.join("."));let o=_optionalChain([this, 'access', _6 => _6.childDepsIndex, 'optionalAccess', _7 => _7.get, 'call', _8 => _8(e)]);if(o)for(let n of o)s(n);return i}assertDependencies(t){if(t.dependsOn.length===0)throw new Error(`BitStore: computed field \`${t.path}\` requires explicit computedDependsOn in v4.`);if(t.dependsOn.includes(t.path))throw new Error(`BitStore: computed field \`${t.path}\` cannot depend on itself.`)}}, _class);var H= (_class2 =class{constructor() { _class2.prototype.__init6.call(this);_class2.prototype.__init7.call(this);_class2.prototype.__init8.call(this);_class2.prototype.__init9.call(this); }__init6() {this.dirtyPaths=new Set}__init7() {this.dirtyPathIndex=new Set}__init8() {this.dirtyPrefixRefCount=new Map}__init9() {this.childrenByPrefix=new Map}updateForPath(t,e,i){this.removeDirtyChildren(t);let s=_chunkT2JRSWQUcjs.f.call(void 0, e,t),a=_chunkT2JRSWQUcjs.f.call(void 0, i,t);return _chunkT2JRSWQUcjs.c.call(void 0, s,a)?this.removeDirtyPath(t):this.addDirtyPath(t),this.dirtyPaths.size>0}rebuild(t,e){return this.dirtyPaths=_chunkT2JRSWQUcjs.e.call(void 0, t,e),this.dirtyPrefixRefCount.clear(),this.rebuildIndex(),this.dirtyPaths.size>0}clear(){this.dirtyPaths.clear(),this.dirtyPathIndex.clear(),this.dirtyPrefixRefCount.clear(),this.childrenByPrefix.clear()}get isDirty(){return this.dirtyPaths.size>0}getDirtyPaths(){return this.dirtyPaths}isPathDirty(t){if(this.dirtyPathIndex.has(t))return!0;let e=t.lastIndexOf(".");for(;e>-1;){let i=t.slice(0,e);if((_nullishCoalesce(this.dirtyPrefixRefCount.get(i), () => (0)))>0)return!0;e=t.lastIndexOf(".",e-1)}return!1}buildDirtyValues(t){if(this.dirtyPaths.size===0)return{};let e={},i=new Set;for(let s of this.dirtyPaths){let a=s.match(/^(.+)\.\d+/);if(a){let o=a[1];if(i.has(o))continue;i.add(o);let n=_chunkT2JRSWQUcjs.f.call(void 0, t,o);e=_chunkT2JRSWQUcjs.g.call(void 0, e,o,n)}else{let o=_chunkT2JRSWQUcjs.f.call(void 0, t,s);e=_chunkT2JRSWQUcjs.g.call(void 0, e,s,o)}}return e}rebuildIndex(){let t=new Set,e=new Map,i=new Map;for(let s of this.dirtyPaths)this.forEachPathPrefix(s,a=>{t.add(a),e.set(a,(_nullishCoalesce(e.get(a), () => (0)))+1)}),this.forEachAncestorPrefix(s,a=>{let o=i.get(a);o?o.add(s):i.set(a,new Set([s]))});this.dirtyPathIndex=t,this.dirtyPrefixRefCount=e,this.childrenByPrefix=i}removeDirtyChildren(t){let e=this.childrenByPrefix.get(t);if(!(!e||e.size===0))for(let i of[...e])this.removeDirtyPath(i)}addDirtyPath(t){this.dirtyPaths.has(t)||(this.dirtyPaths.add(t),this.forEachPathPrefix(t,e=>{this.dirtyPathIndex.add(e),this.dirtyPrefixRefCount.set(e,(_nullishCoalesce(this.dirtyPrefixRefCount.get(e), () => (0)))+1)}),this.forEachAncestorPrefix(t,e=>{let i=this.childrenByPrefix.get(e);i?i.add(t):this.childrenByPrefix.set(e,new Set([t]))}))}removeDirtyPath(t){this.dirtyPaths.has(t)&&(this.dirtyPaths.delete(t),this.forEachPathPrefix(t,e=>{let i=(_nullishCoalesce(this.dirtyPrefixRefCount.get(e), () => (0)))-1;if(i<=0){this.dirtyPrefixRefCount.delete(e),this.dirtyPathIndex.delete(e);return}this.dirtyPrefixRefCount.set(e,i)}),this.forEachAncestorPrefix(t,e=>{_optionalChain([this, 'access', _9 => _9.childrenByPrefix, 'access', _10 => _10.get, 'call', _11 => _11(e), 'optionalAccess', _12 => _12.delete, 'call', _13 => _13(t)])}))}forEachPathPrefix(t,e){let i=t.split("."),s="";for(let a of i)s=s?`${s}.${a}`:a,e(s)}forEachAncestorPrefix(t,e){let i=t.split("."),s="";for(let a=0;a<i.length-1;a++)s=s?`${s}.${i[a]}`:i[a],e(s)}}, _class2);var q= (_class3 =class{constructor() { _class3.prototype.__init10.call(this); }__init10() {this.masks=new Map}registerMask(t,e){this.masks.set(t,e)}unregisterMask(t){this.masks.has(t)&&this.masks.delete(t)}resolveMask(t){return this.masks.get(t)}getAllMasks(){return Object.fromEntries(this.masks.entries())}clear(){this.masks.clear()}}, _class3);var z= (_class4 =class{constructor() { _class4.prototype.__init11.call(this);_class4.prototype.__init12.call(this);_class4.prototype.__init13.call(this);_class4.prototype.__init14.call(this);_class4.prototype.__init15.call(this); }__init11() {this.fieldConfigs=new Map}__init12() {this.scopeFieldsIndex=null}__init13() {this.computedEntriesCache=null}__init14() {this.normalizerEntriesCache=null}__init15() {this.transformEntriesCache=null}get(t){return this.fieldConfigs.get(t)}set(t,e){this.fieldConfigs.set(t,e),this.registerCachedIndexes(t,e)}delete(t){let e=this.fieldConfigs.get(t);return this.fieldConfigs.delete(t),this.unregisterCachedIndexes(t,e),e}has(t){return this.fieldConfigs.has(t)}forEach(t){this.fieldConfigs.forEach((e,i)=>t(e,i))}entries(){return Array.from(this.fieldConfigs.entries())}getScopeFields(t){if(!this.scopeFieldsIndex){let e=new Map;this.forEach((i,s)=>{if(!i.scope)return;let a=_nullishCoalesce(e.get(i.scope), () => (new Set));a.add(s),e.set(i.scope,a)}),this.scopeFieldsIndex=e}return Array.from(_nullishCoalesce(this.scopeFieldsIndex.get(t), () => ([])))}getComputedEntries(){if(!this.computedEntriesCache){let t=[];this.forEach((e,i)=>{e.computed&&t.push({path:i,compute:e.computed,dependsOn:e.computedDependsOn})}),this.computedEntriesCache=t}return this.computedEntriesCache}getTransformEntries(){if(!this.transformEntriesCache){let t=[];this.forEach((e,i)=>{e.transform&&t.push([i,e.transform])}),this.transformEntriesCache=t}return this.transformEntriesCache}getNormalizerEntries(){if(!this.normalizerEntriesCache){let t=[];this.forEach((e,i)=>{e.normalize&&t.push({path:i,normalize:e.normalize,dependsOn:_optionalChain([e, 'access', _14 => _14.normalizeDependsOn, 'optionalAccess', _15 => _15.length])?e.normalizeDependsOn:[i]})}),this.normalizerEntriesCache=t}return this.normalizerEntriesCache}invalidateIndexes(){this.scopeFieldsIndex=null,this.computedEntriesCache=null,this.normalizerEntriesCache=null,this.transformEntriesCache=null}registerCachedIndexes(t,e){if(this.scopeFieldsIndex&&e.scope){let i=_nullishCoalesce(this.scopeFieldsIndex.get(e.scope), () => (new Set));i.add(t),this.scopeFieldsIndex.set(e.scope,i)}this.computedEntriesCache&&e.computed&&this.computedEntriesCache.push({path:t,compute:e.computed,dependsOn:e.computedDependsOn}),this.normalizerEntriesCache&&e.normalize&&this.normalizerEntriesCache.push({path:t,normalize:e.normalize,dependsOn:_optionalChain([e, 'access', _16 => _16.normalizeDependsOn, 'optionalAccess', _17 => _17.length])?e.normalizeDependsOn:[t]}),this.transformEntriesCache&&e.transform&&this.transformEntriesCache.push([t,e.transform])}unregisterCachedIndexes(t,e){if(!e){this.invalidateIndexes();return}if(this.scopeFieldsIndex&&e.scope){let i=this.scopeFieldsIndex.get(e.scope);i&&(i.delete(t),i.size>0?this.scopeFieldsIndex.set(e.scope,i):this.scopeFieldsIndex.delete(e.scope))}this.computedEntriesCache&&e.computed&&(this.computedEntriesCache=this.computedEntriesCache.filter(i=>i.path!==t)),this.normalizerEntriesCache&&e.normalize&&(this.normalizerEntriesCache=this.normalizerEntriesCache.filter(i=>i.path!==t)),this.transformEntriesCache&&e.transform&&(this.transformEntriesCache=this.transformEntriesCache.filter(([i])=>i!==t))}}, _class4);var U= (_class5 =class{constructor(t){;_class5.prototype.__init16.call(this);_class5.prototype.__init17.call(this);_class5.prototype.__init18.call(this);_class5.prototype.__init19.call(this);_class5.prototype.__init20.call(this);_class5.prototype.__init21.call(this);_class5.prototype.__init22.call(this);this.getFieldConfig=t}__init16() {this.dependencies=new Map}__init17() {this.hiddenFields=new Set}__init18() {this.conditionalVisibilityPaths=new Set}__init19() {this.requiredPathsByDependency=new Map}__init20() {this.requiredConditionalPaths=new Set}__init21() {this.requiredEvaluationVersion=0}__init22() {this.requiredEvaluationCache=new Map}getHiddenFields(){return this.hiddenFields}onRegister(t,e,i){_optionalChain([e, 'access', _18 => _18.conditional, 'optionalAccess', _19 => _19.showIf])&&this.conditionalVisibilityPaths.add(t);let s=_optionalChain([e, 'access', _20 => _20.conditional, 'optionalAccess', _21 => _21.dependsOn]);s&&s.forEach(a=>{this.dependencies.has(a)||this.dependencies.set(a,new Set),this.dependencies.get(a).add(t)}),s&&_optionalChain([e, 'access', _22 => _22.conditional, 'optionalAccess', _23 => _23.requiredIf])&&(this.requiredConditionalPaths.add(t),s.forEach(a=>{this.requiredPathsByDependency.has(a)||this.requiredPathsByDependency.set(a,new Set),this.requiredPathsByDependency.get(a).add(t)})),this.requiredEvaluationVersion+=1,this.requiredEvaluationCache.clear(),this.evaluateFieldCondition(t,i)}onUnregister(t,e){this.hiddenFields.delete(t),this.conditionalVisibilityPaths.delete(t),this.dependencies.delete(t),this.requiredEvaluationVersion+=1,this.requiredEvaluationCache.clear(),this.requiredConditionalPaths.delete(t),_optionalChain([e, 'optionalAccess', _24 => _24.conditional, 'optionalAccess', _25 => _25.dependsOn, 'optionalAccess', _26 => _26.forEach, 'call', _27 => _27(i=>{let s=this.requiredPathsByDependency.get(i);s&&(s.delete(t),s.size===0&&this.requiredPathsByDependency.delete(i))})]),this.dependencies.forEach(i=>{i.delete(t)})}isHidden(t){return this.hiddenFields.has(t)}hasDependents(t){return(_nullishCoalesce(_optionalChain([this, 'access', _28 => _28.dependencies, 'access', _29 => _29.get, 'call', _30 => _30(t), 'optionalAccess', _31 => _31.size]), () => (0)))>0}isRequired(t,e){let i=this.getFieldConfig(t);if(!i||this.isHidden(t)||!_optionalChain([i, 'access', _32 => _32.conditional, 'optionalAccess', _33 => _33.requiredIf]))return!1;let s=this.requiredEvaluationCache.get(t);if(s&&s.version===this.requiredEvaluationVersion&&s.valuesRef===e)return s.result;let a=!!i.conditional.requiredIf(e);return this.requiredEvaluationCache.set(t,{version:this.requiredEvaluationVersion,valuesRef:e,result:a}),a}getRequiredErrors(t){let e={};return this.requiredConditionalPaths.forEach(i=>{let s=this.getFieldConfig(i);if(s&&this.isRequired(i,t)){let a=_chunkT2JRSWQUcjs.f.call(void 0, t,i);this.isEmpty(a)&&(e[i]=_nullishCoalesce(_optionalChain([s, 'access', _34 => _34.conditional, 'optionalAccess', _35 => _35.requiredMessage]), () => ("required field")))}}),e}evaluateAll(t){this.conditionalVisibilityPaths.forEach(e=>{this.evaluateFieldCondition(e,t)})}updateDependencies(t,e,i){let s=new Set,a=new Set,o=new Set,n=[t],d=new Set;for(;n.length>0;){let p=n.shift();if(d.has(p))continue;d.add(p);let l=this.dependencies.get(p);l&&l.forEach(c=>{s.add(c);let u=this.isHidden(c),h=this.isRequired(c,e);this.evaluateFieldCondition(c,i);let S=this.isHidden(c),B=this.isRequired(c,i);u!==S&&a.add(c),h!==B&&o.add(c),n.push(c)})}return{affectedFields:Array.from(s),visibilityChanged:Array.from(a),requiredChanged:Array.from(o)}}evaluateFieldCondition(t,e){let s=_optionalChain([this, 'access', _36 => _36.getFieldConfig, 'call', _37 => _37(t), 'optionalAccess', _38 => _38.conditional, 'optionalAccess', _39 => _39.showIf]);s&&(s(e)?this.hiddenFields.delete(t):this.hiddenFields.add(t))}isEmpty(t){return t==null||typeof t=="string"&&t.trim()===""||Array.isArray(t)&&t.length===0}}, _class5);function Ye(r){return r.replace(/\.+$/g,"")}function E(r){return Ye(r.trim())}function v(r,t){let e=E(t);return e.length===0?!1:r===e||r.startsWith(`${e}.`)}function bt(r,t){return E(t===void 0?r:`${r}.${t}`)}var N= (_class6 =class{constructor() { _class6.prototype.__init23.call(this);_class6.prototype.__init24.call(this); }__init23() {this.catalog=new z}__init24() {this.conditions=new U(t=>this.catalog.get(t))}getFieldConfig(t){return this.catalog.get(t)}forEachFieldConfig(t){this.catalog.forEach((e,i)=>t(e,i))}hasFieldConfig(t){return this.catalog.has(t)}getHiddenFields(){return this.conditions.getHiddenFields()}register(t,e,i){this.catalog.set(t,e),this.conditions.onRegister(t,e,i)}unregister(t){let e=this.catalog.delete(t);this.conditions.onUnregister(t,e)}unregisterPrefix(t){let e=[],i=E(t);return i.length===0||(this.catalog.forEach((s,a)=>{v(a,i)&&e.push([a,s])}),e.forEach(([s,a])=>{this.catalog.delete(s),this.conditions.onUnregister(s,a)})),e}isHidden(t){return this.conditions.isHidden(t)}hasDependents(t){return this.conditions.hasDependents(t)}isRequired(t,e){return this.conditions.isRequired(t,e)}getRequiredErrors(t){return this.conditions.getRequiredErrors(t)}evaluateAll(t){this.conditions.evaluateAll(t)}updateDependencies(t,e,i){return this.conditions.updateDependencies(t,e,i)}getScopeFields(t){return this.catalog.getScopeFields(t)}getComputedEntries(){return this.catalog.getComputedEntries()}getTransformEntries(){return this.catalog.getTransformEntries()}getNormalizerEntries(){return this.catalog.getNormalizerEntries()}invalidateIndexes(){this.catalog.invalidateIndexes()}}, _class6);function Xe(){return`bit-form-${Math.random().toString(36).slice(2,9)}`}function Ze(r){typeof console<"u"&&typeof console.error=="function"&&console.error(r)}function Mt(r={}){let t=_nullishCoalesce(r.initialValues, () => ({})),e=r.validation,i=r.history,s=r.name?`bit-form:${r.name}:draft`:"bit-form:draft",a=_nullishCoalesce(r.onUnhandledError, () => (Ze)),o=_optionalChain([r, 'access', _40 => _40.persist, 'optionalAccess', _41 => _41.onError]),n={enabled:_nullishCoalesce(_optionalChain([r, 'access', _42 => _42.persist, 'optionalAccess', _43 => _43.enabled]), () => (!1)),key:_nullishCoalesce(_optionalChain([r, 'access', _44 => _44.persist, 'optionalAccess', _45 => _45.key]), () => (s)),storage:_optionalChain([r, 'access', _46 => _46.persist, 'optionalAccess', _47 => _47.storage]),autoSave:_nullishCoalesce(_optionalChain([r, 'access', _48 => _48.persist, 'optionalAccess', _49 => _49.autoSave]), () => (!0)),debounceMs:_nullishCoalesce(_optionalChain([r, 'access', _50 => _50.persist, 'optionalAccess', _51 => _51.debounceMs]), () => (300)),mode:_nullishCoalesce(_optionalChain([r, 'access', _52 => _52.persist, 'optionalAccess', _53 => _53.mode]), () => ("values")),serialize:_nullishCoalesce(_optionalChain([r, 'access', _54 => _54.persist, 'optionalAccess', _55 => _55.serialize]), () => (JSON.stringify)),deserialize:_nullishCoalesce(_optionalChain([r, 'access', _56 => _56.persist, 'optionalAccess', _57 => _57.deserialize]), () => ((d=>JSON.parse(d)))),onError:d=>{_optionalChain([o, 'optionalCall', _58 => _58(d)]),a(d,"persist")}};return{name:r.name,initialValues:_chunkT2JRSWQUcjs.a.call(void 0, t),resolver:_optionalChain([e, 'optionalAccess', _59 => _59.resolver]),validationDelay:_nullishCoalesce(_optionalChain([e, 'optionalAccess', _60 => _60.delay]), () => (300)),history:{enabled:_nullishCoalesce(_optionalChain([i, 'optionalAccess', _61 => _61.enabled]), () => (!1)),limit:_nullishCoalesce(_optionalChain([i, 'optionalAccess', _62 => _62.limit]), () => (50))},masks:r.masks,fields:r.fields,devTools:r.devTools,persist:n,idFactory:_nullishCoalesce(r.idFactory, () => (Xe)),plugins:_nullishCoalesce(r.plugins, () => ([])),scheduler:r.scheduler,subscriptionCacheSize:r.subscriptionCacheSize,bus:r.bus,onUnhandledError:a}}function Qe(){if(typeof globalThis>"u")return;let r=globalThis.localStorage;if(r)return{getItem:t=>r.getItem(t),setItem:(t,e)=>r.setItem(t,e),removeItem:t=>r.removeItem(t)}}var _=class{constructor(t,e,i,s){this.config=t;this.getValues=e;this.getDirtyValues=i;this.applyRestoredValues=s}getStorage(){return this.config.storage||Qe()}canPersist(){return!!(this.config.enabled&&this.config.key&&this.getStorage())}handleError(t){_optionalChain([this, 'access', _63 => _63.config, 'access', _64 => _64.onError, 'optionalCall', _65 => _65(t)])}async saveNow(){if(!this.canPersist())return;let t=this.getStorage();if(t)try{let e=this.config.mode==="dirtyValues"?this.getDirtyValues():this.getValues(),i=this.config.serialize(e);await t.setItem(this.config.key,i)}catch(e){this.handleError(e)}}queueSave(){!this.canPersist()||!this.config.autoSave||(this.timer&&clearTimeout(this.timer),this.timer=setTimeout(()=>{this.saveNow()},this.config.debounceMs))}async restore(){if(!this.canPersist())return!1;let t=this.getStorage();if(!t)return!1;try{let e=await t.getItem(this.config.key);if(!e)return!1;let i=this.config.deserialize(e);return!i||typeof i!="object"?!1:(this.applyRestoredValues(i),!0)}catch(e){return this.handleError(e),!1}}async clear(){if(!this.canPersist())return;let t=this.getStorage();if(t)try{await t.removeItem(this.config.key)}catch(e){this.handleError(e)}}destroy(){this.timer&&(clearTimeout(this.timer),this.timer=void 0)}};var L= (_class7 =class{constructor(t,e){;_class7.prototype.__init25.call(this);_class7.prototype.__init26.call(this);_class7.prototype.__init27.call(this);this.plugins=t;this.contextFactory=e}__init25() {this.teardownFns=[]}__init26() {this.notifyingError=!1}__init27() {this.cachedContext=null}setupAll(){let t=this.getContext();this.plugins.forEach(e=>{if(e.setup)try{let i=e.setup(t);typeof i=="function"&&this.teardownFns.push(i)}catch(i){this.reportError("setup",i,void 0,e.name)}})}async beforeValidate(t){await this.emitHook("beforeValidate",t)}async afterValidate(t){await this.emitHook("afterValidate",t)}async beforeSubmit(t){await this.emitHook("beforeSubmit",t)}async afterSubmit(t){await this.emitHook("afterSubmit",t)}onFieldChange(t){let e=this.getContext();this.plugins.forEach(i=>{let s=_optionalChain([i, 'access', _66 => _66.hooks, 'optionalAccess', _67 => _67.onFieldChange]);if(s)try{let a=s(t,e);Promise.resolve(a).catch(o=>{this.reportError("onFieldChange",o,t,i.name)})}catch(a){this.reportError("onFieldChange",a,t,i.name)}})}async reportError(t,e,i,s){if(this.notifyingError)return;this.notifyingError=!0;let a=this.getContext(),o={source:t,pluginName:s,error:e,event:i,values:a.getState().values,state:a.getState()};for(let n of this.plugins){let d=_optionalChain([n, 'access', _68 => _68.hooks, 'optionalAccess', _69 => _69.onError]);if(d)try{await d(o,a)}catch (e2){}}this.notifyingError=!1}destroy(){for(let t=this.teardownFns.length-1;t>=0;t-=1){let e=this.teardownFns[t];try{e()}catch(i){this.reportError("teardown",i)}}this.teardownFns=[],this.cachedContext=null}async emitHook(t,e){let i=this.getContext();for(let s of this.plugins){let a=_optionalChain([s, 'access', _70 => _70.hooks, 'optionalAccess', _71 => _71[t]]);if(a)try{await a(e,i)}catch(o){await this.reportError(t,o,e,s.name)}}}getContext(){return this.cachedContext||(this.cachedContext=this.contextFactory()),this.cachedContext}}, _class7);var W=class{constructor(t){this.persistManager=t}onStateUpdated(t,e){e&&this.persistManager.queueSave()}restorePersisted(){return this.persistManager.restore()}savePersistedNow(){return this.persistManager.saveNow()}clearPersisted(){return this.persistManager.clear()}destroy(){this.persistManager.destroy()}};var K=class{constructor(t){this.pluginManager=t}initialize(){this.pluginManager.setupAll()}beforeValidate(t){return this.pluginManager.beforeValidate(t)}afterValidate(t){return this.pluginManager.afterValidate(t)}beforeSubmit(t){return this.pluginManager.beforeSubmit(t)}afterSubmit(t){return this.pluginManager.afterSubmit(t)}onFieldChange(t){this.pluginManager.onFieldChange(t)}reportOperationalError(t){return this.pluginManager.reportError(t.source,t.error,t.payload)}destroy(){this.pluginManager.destroy()}};var $=class{constructor(t,e,i,s=!0){this.storeId=t;this.storeBusPort=e;this.bus=i;this.enableBusDispatch=s}initialize(){this.enableBusDispatch&&(this.bus.stores[this.storeId]=this.storeBusPort)}onStateUpdated(t){this.enableBusDispatch&&this.bus.dispatch(this.storeId,t)}destroy(){this.enableBusDispatch&&delete this.bus.stores[this.storeId]}};var J=class{constructor(t,e,i,s,a,o=!0){this.persistEffects=new W(s),this.pluginEffects=new K(a),this.busEffects=new $(t,e,i,o)}initialize(){this.pluginEffects.initialize(),this.busEffects.initialize()}onStateUpdated(t,e){this.persistEffects.onStateUpdated(t,e),this.busEffects.onStateUpdated(t)}restorePersisted(){return this.persistEffects.restorePersisted()}savePersistedNow(){return this.persistEffects.savePersistedNow()}clearPersisted(){return this.persistEffects.clearPersisted()}beforeValidate(t){return this.pluginEffects.beforeValidate(t)}afterValidate(t){return this.pluginEffects.afterValidate(t)}beforeSubmit(t){return this.pluginEffects.beforeSubmit(t)}afterSubmit(t){return this.pluginEffects.afterSubmit(t)}onFieldChange(t){this.pluginEffects.onFieldChange(t)}reportOperationalError(t){return this.pluginEffects.reportOperationalError(t)}destroy(){this.persistEffects.destroy(),this.pluginEffects.destroy(),this.busEffects.destroy()}};var Bt=typeof globalThis<"u"?globalThis:typeof global<"u"?global:window;Bt.__BIT_FORM__||(Bt.__BIT_FORM__={stores:{},listeners:new Set,dispatch(r,t){this.listeners.forEach(e=>e(r,t))},subscribe(r){return this.listeners.add(r),()=>{this.listeners.delete(r)}}});var Tt=Bt.__BIT_FORM__,ti={stores:{},listeners:new Set,dispatch:()=>{},subscribe:()=>()=>{}};function kt(){return ti}function ei(){let r=new Set;return{stores:{},listeners:r,dispatch(t,e){r.forEach(i=>i(t,e))},subscribe(t){return r.add(t),()=>r.delete(t)}}}function ii(r){return r.bus?!0:typeof r.devTools=="boolean"?r.devTools:r.devTools&&typeof r.devTools=="object"?r.devTools.enabled!==!1:!1}function It(r){let{storeId:t,storeBusPort:e,config:i,getState:s,getConfig:a,getValues:o,getDirtyValues:n,applyPersistedValues:d}=r,p=new _(i.persist,o,n,d),l=new L([...i.plugins],()=>({storeId:t,getState:()=>s(),getConfig:()=>a()})),c=ii(i),u=c?_nullishCoalesce(i.bus, () => (Tt)):kt(),h=new J(t,e,u,p,l,c);return h.initialize(),h}function Ot(r){let{state:t,path:e}=r,i={...t.errors},s={...t.touched},a=!1;return i[e]&&(delete i[e],a=!0),s[e]&&(delete s[e],a=!0),a?{errors:i,touched:s}:null}function f(r,t,e){return{kind:"state.patch",partialState:r,changedPaths:t,skipComputed:_optionalChain([e, 'optionalAccess', _72 => _72.skipComputed])}}function vt(r){return{kind:"field.touchMany",paths:r}}function P(r){return{kind:"form.persistMeta",patch:r}}function w(r,t){return{kind:"validation.commit",errors:r,isValid:t}}function jt(r){let{path:t,config:e,state:i,fieldRegistry:s,subscriptions:a,stateReader:o,invalidateFieldIndexes:n}=r;s.register(t,e,i.values),n(),a.invalidatePathExpansionCache(t),o.invalidatePath(t),e.scope&&a.notify(i,[_chunkD7JQWF6Vcjs.d.call(void 0, e.scope)]),s.isHidden(t)&&a.notify(i,[t])}function Ht(r){let{path:t,state:e,hasStaticConfig:i,fieldRegistry:s,subscriptions:a,validationCleanupField:o,invalidateFieldIndexes:n,dispatch:d}=r;if(i)return;let p=s.getFieldConfig(t);o(t),s.unregister(t),n(),a.invalidatePathExpansionCache(t),_optionalChain([p, 'optionalAccess', _73 => _73.scope])&&a.notify(e,[_chunkD7JQWF6Vcjs.d.call(void 0, p.scope)]);let l=Ot({state:e,path:t});l&&d(f({errors:l.errors,touched:l.touched}))}function G(r){let{prefix:t,state:e,fieldRegistry:i,subscriptions:s,validationCleanupPrefix:a,invalidateFieldIndexes:o}=r;a(t);let n=i.unregisterPrefix(t);o(),s.invalidatePathExpansionCache(t),new Set(n.map(([,p])=>p.scope).filter(p=>!!p)).forEach(p=>{s.notify(e,[_chunkD7JQWF6Vcjs.d.call(void 0, p)])})}async function qt(r){let{dispatch:t,effects:e}=r;t(P({isRestoring:!0,error:null}));try{return await e.restorePersisted()}catch(i){return t(P({isRestoring:!1,error:i instanceof Error?i:new Error(String(i))})),!1}finally{t(P({isRestoring:!1}))}}async function zt(r){let{dispatch:t,effects:e}=r;t(P({isSaving:!0,error:null}));try{await e.savePersistedNow()}catch(i){t(P({isSaving:!1,error:i instanceof Error?i:new Error(String(i))}));return}t(P({isSaving:!1}))}async function Ut(r){let{dispatch:t,effects:e}=r;t(P({error:null}));try{await e.clearPersisted()}catch(i){t(P({error:i instanceof Error?i:new Error(String(i))}))}}function Nt(r){let{values:t,state:e,initialValues:i,validation:s,fieldRegistry:a,dirtyManager:o,dispatch:n,saveHistorySnapshot:d}=r,p=_chunkT2JRSWQUcjs.a.call(void 0, _chunkT2JRSWQUcjs.b.call(void 0, i,t));s.cancelAll(),a.evaluateAll(p);let l=o.rebuild(p,i);n(f({values:p,errors:{},touched:{},isValidating:{},persist:{...e.persist,error:null},isValid:!0,isDirty:l,isSubmitting:!1})),d(),s.validate()}var Y= (_class8 =class{constructor(t,e=500){;_class8.prototype.__init28.call(this);_class8.prototype.__init29.call(this);_class8.prototype.__init30.call(this);_class8.prototype.__init31.call(this);_class8.prototype.__init32.call(this);_class8.prototype.__init33.call(this);_class8.prototype.__init34.call(this);_class8.prototype.__init35.call(this);this.getState=t;this.MAX_PATH_EXPANSION_CACHE_SIZE=e}__init28() {this.listeners=new Set}__init29() {this.pathScopedSubscriptions=new Map}__init30() {this.pathSelectorIndex=new Map}__init31() {this.pathExpansionCache=new Map}__init32() {this.expandedPathCache=this.pathExpansionCache}__init33() {this.changedPathLookupCache=this.pathExpansionCache}__init34() {this.subscriptionSeenVersion=new Map}__init35() {this.notifyVersion=0}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}subscribeSelector(t,e,i,s){let a=t(this.getState()),o={notify:d=>{let p=t(d);s(a,p)||(a=p,e(p))}},n=this.normalizeSubscriptionPaths(_optionalChain([i, 'optionalAccess', _74 => _74.paths]));if(n.length===0)throw new Error("BitStore: subscribeSelector requires explicit `paths`.");return this.pathScopedSubscriptions.set(o,n),n.forEach(d=>{this.forEachIndexPath(d,p=>{let l=_nullishCoalesce(this.pathSelectorIndex.get(p), () => (new Set));l.add(o),this.pathSelectorIndex.set(p,l)})}),_optionalChain([i, 'optionalAccess', _75 => _75.emitImmediately])&&e(a),()=>{this.subscriptionSeenVersion.delete(o);let d=this.pathScopedSubscriptions.get(o);d&&(d.forEach(p=>{this.forEachIndexPath(p,l=>{let c=this.pathSelectorIndex.get(l);c&&(c.delete(o),c.size===0&&this.pathSelectorIndex.delete(l))})}),this.pathScopedSubscriptions.delete(o))}}notify(t,e){if(this.listeners.forEach(a=>a()),this.pathScopedSubscriptions.size===0)return;let i=e?this.normalizeSubscriptionPaths(Array.from(e)):[];if(i.length===0||i.includes("*")){this.pathScopedSubscriptions.forEach((a,o)=>{o.notify(t)});return}this.collectSubscribersForChangedPaths(i).forEach(a=>{a.notify(t)})}destroy(){this.listeners.clear(),this.pathScopedSubscriptions.clear(),this.pathSelectorIndex.clear(),this.pathExpansionCache.clear(),this.subscriptionSeenVersion.clear()}invalidatePathExpansionCache(t){if(!t){this.pathExpansionCache.clear();return}let e=E(t);if(e.length===0){this.pathExpansionCache.clear();return}for(let i of this.pathExpansionCache.keys())(v(i,e)||v(e,i))&&this.pathExpansionCache.delete(i)}normalizeSubscriptionPaths(t){if(!t||t.length===0)return[];let e=new Set,i=[];for(let s of t){let a=s.trim();a.length===0||e.has(a)||(e.add(a),i.push(a))}return i}collectSubscribersForChangedPaths(t){let e=[],i=++this.notifyVersion,s=a=>{let o=this.pathSelectorIndex.get(a);o&&o.forEach(n=>{(_nullishCoalesce(this.subscriptionSeenVersion.get(n), () => (0)))>=i||(this.subscriptionSeenVersion.set(n,i),e.push(n))})};return t.forEach(a=>{this.forEachLookupPath(a,s)}),e}expandChangedPathForLookup(t){return this.expandPathGeneric(t)}expandPathForIndexing(t){return this.expandPathGeneric(t)}forEachIndexPath(t,e){if(!this.isSimplePath(t)){this.expandPathForIndexing(t).forEach(e);return}let i=t.split("."),s="";for(let a=0;a<i.length;a+=1)s=s?`${s}.${i[a]}`:i[a],e(s)}forEachLookupPath(t,e){if(!this.isSimplePath(t)){this.expandChangedPathForLookup(t).forEach(e);return}e(t);let i=t.lastIndexOf(".");for(;i>-1;)e(t.slice(0,i)),i=t.lastIndexOf(".",i-1)}isSimplePath(t){return!t.includes("*")&&!t.includes("[")&&!t.includes("]")}expandPathGeneric(t){let e=this.pathExpansionCache.get(t);if(e)return e;let i=t.split("."),s=[];for(let a=1;a<=i.length;a++)s.push(i.slice(0,a).join("."));return this.setBoundedCacheEntry(this.pathExpansionCache,t,s,this.MAX_PATH_EXPANSION_CACHE_SIZE),s}setBoundedCacheEntry(t,e,i,s){if(t.size>=s){let a=t.keys().next().value;a!==void 0&&t.delete(a)}t.set(e,i)}}, _class8);var D=class{constructor(t){this.steps=t}async run(t){for(let e of this.steps){if(t.halted)break;await e.run(t)}}},X=class{constructor(t){this.steps=t}run(t){for(let e of this.steps){if(t.halted)break;let i=e.run(t);i!=null&&typeof i.then=="function"&&typeof process<"u"&&_optionalChain([process, 'access', _76 => _76.env, 'optionalAccess', _77 => _77.NODE_ENV])!=="production"&&console.warn(`BitSyncPipelineRunner: step "${e.name}" returned a Promise and will not be awaited.`)}}};function x(r){for(let t in r)return!0;return!1}function _t(r){let{targetFields:t,currentErrors:e,allErrors:i,asyncErrors:s}=r;if(t&&t.length>0){let o={...e};t.forEach(d=>{i[d]?o[d]=i[d]:s.has(d)?o[d]=s.get(d):delete o[d]});let n=t.every(d=>!i[d]&&!s.has(d));return{committedErrors:o,result:n,mode:"scoped"}}return{committedErrors:{...Object.fromEntries(s.entries()),...i},result:void 0,mode:"global"}}function Lt(r){let{targetFields:t,hiddenFields:e,getFieldConfig:i,forEachFieldConfig:s}=r,a=[];if(t&&t.length>0){for(let o of t){if(e.has(o))continue;_optionalChain([i, 'call', _78 => _78(o), 'optionalAccess', _79 => _79.validation, 'optionalAccess', _80 => _80.asyncValidate])&&a.push(o)}return a}return s&&s((o,n)=>{!_optionalChain([o, 'access', _81 => _81.validation, 'optionalAccess', _82 => _82.asyncValidate])||e.has(n)||a.push(n)}),a}async function Wt(r){let{path:t,values:e,validationId:i,currentValidationId:s,getFieldConfig:a,cancelFieldAsync:o,createAbortController:n,setAbortController:d,clearAbortController:p,setFieldValidating:l,setAsyncError:c,clearAsyncError:u}=r,h=_optionalChain([a, 'call', _83 => _83(t), 'optionalAccess', _84 => _84.validation, 'optionalAccess', _85 => _85.asyncValidate]);if(!h){u(t);return}o(t);let S=n();d(t,S),l(t,!0);try{let B=await h(_chunkT2JRSWQUcjs.f.call(void 0, e,t),e);if(S.signal.aborted||i!==s)return;B?c(t,B):u(t)}finally{!S.signal.aborted&&i===s&&l(t,!1),p(t)}}var Z= (_class9 =class{constructor(t){;_class9.prototype.__init36.call(this);_class9.prototype.__init37.call(this);this.port=t}__init36() {this.abortControllers=new Map}__init37() {this.pendingJobs=new Map}handle(t,e,i,s){if(!i){this.cancel(t),this.port.setFieldValidating(t,!1);return}this.cancel(t),this.port.setFieldValidating(t,!0);let a=new AbortController;this.abortControllers.set(t,a),this.pendingJobs.set(t,{value:e,dueAt:Date.now()+s,validate:i,controller:a}),this.schedulePendingJobs()}cancel(t){this.pendingJobs.has(t)&&(this.pendingJobs.delete(t),this.schedulePendingJobs());let e=this.abortControllers.get(t);e&&(e.abort(),this.abortControllers.delete(t))}cleanupPrefix(t){for(let e of this.pendingJobs.keys())v(e,t)&&(this.cancel(e),this.port.clearAsyncError(e),this.port.setFieldValidating(e,!1))}cancelAll(){this.cancelSchedulerTimeout&&(this.cancelSchedulerTimeout(),this.cancelSchedulerTimeout=void 0),this.pendingJobs.clear(),this.abortControllers.forEach(t=>t.abort()),this.abortControllers.clear()}schedulePendingJobs(){this.cancelSchedulerTimeout&&(this.cancelSchedulerTimeout(),this.cancelSchedulerTimeout=void 0);let t=Number.POSITIVE_INFINITY;for(let e of this.pendingJobs.values())e.dueAt<t&&(t=e.dueAt);Number.isFinite(t)&&(this.cancelSchedulerTimeout=this.port.schedule(()=>{this.cancelSchedulerTimeout=void 0,this.flushPendingJobs()},Math.max(0,t-Date.now())))}async flushPendingJobs(){this.cancelSchedulerTimeout=void 0;let t=Date.now(),e=Array.from(this.pendingJobs.entries()).filter(([,i])=>i.dueAt<=t);if(e.length===0){this.schedulePendingJobs();return}e.forEach(([i])=>{this.pendingJobs.delete(i)}),await Promise.all(e.map(([i,s])=>this.runJob(i,s))),this.schedulePendingJobs()}async runJob(t,e){if(!e.controller.signal.aborted)try{let i=await e.validate(e.value,this.port.getValues());if(e.controller.signal.aborted)return;i?this.port.setAsyncError(t,i):(this.port.clearAsyncError(t),await this.port.onValidationPassed(t))}finally{e.controller.signal.aborted||this.port.setFieldValidating(t,!1),this.abortControllers.delete(t)}}}, _class9);var Q= (_class10 =class{constructor(t){;_class10.prototype.__init38.call(this);this.port=t}__init38() {this.pendingScopeFields=null}trigger(t,e){this.cancelTimeout&&(this.cancelTimeout(),this.cancelTimeout=void 0);let i=_nullishCoalesce(this.port.validationDelay, () => (300)),s=_optionalChain([e, 'optionalAccess', _86 => _86.forceDebounce])?Math.max(1,i):i;if(s>0){if(t&&t.length>0)if(!this.pendingScopeFields)this.pendingScopeFields=new Set(t);else for(let o of t)this.pendingScopeFields.add(o);else this.pendingScopeFields=null;let a=this.pendingScopeFields?Array.from(this.pendingScopeFields):void 0;this.cancelTimeout=this.port.schedule(()=>{this.pendingScopeFields=null,this.cancelTimeout=void 0,this.port.validate({scopeFields:a})},s)}else this.pendingScopeFields=null,this.port.validate({scopeFields:t})}cancelPending(){this.cancelTimeout&&(this.cancelTimeout(),this.cancelTimeout=void 0),this.pendingScopeFields=null}}, _class10);function Kt(r){let{ctx:t,deps:e}=r;if(_optionalChain([t, 'access', _87 => _87.options, 'optionalAccess', _88 => _88.scope])){let i=e.store.getScopeFields(t.options.scope);i.length>0&&(t.targetFields=i)}}async function $t(r){let{ctx:t,deps:e}=r;await e.store.emitBeforeValidate({values:t.currentState.values,state:t.currentState,scope:_optionalChain([t, 'access', _89 => _89.options, 'optionalAccess', _90 => _90.scope]),scopeFields:t.targetFields})}async function Jt(r){let{ctx:t,deps:e}=r,i=e.store.config.resolver?await e.store.config.resolver(t.currentState.values,{scopeFields:t.targetFields}):{},s=e.store.getRequiredErrors(t.currentState.values);t.allErrors={...i,...s},e.store.getHiddenFields().forEach(a=>{delete t.allErrors[a],e.asyncErrors.delete(a)})}async function Gt(r){let{ctx:t,deps:e}=r,i=Lt({targetFields:t.targetFields,hiddenFields:e.store.getHiddenFields(),getFieldConfig:s=>e.store.getFieldConfig(s),forEachFieldConfig:e.store.forEachFieldConfig});i.length!==0&&await Promise.all(i.map(s=>e.runImmediateAsyncValidation(s,t.currentState.values,t.validationId)))}function Yt(r){let{ctx:t,deps:e}=r,i=_t({targetFields:t.targetFields,currentErrors:t.currentState.errors,allErrors:t.allErrors,asyncErrors:e.asyncErrors});t.committedErrors=i.committedErrors,t.isValid=!x(i.committedErrors),t.result=i.mode==="scoped"?i.result:t.isValid}async function Pt(r){let{ctx:t,deps:e}=r;t.validationId!==e.getCurrentValidationId()&&(t.aborted=!0,t.result=t.currentState.isValid,t.halted=!0)}async function Xt(r){let{ctx:t,deps:e}=r;e.store.dispatch(w(t.committedErrors,t.isValid)),await e.store.emitAfterValidate({values:e.store.getState().values,state:e.store.getState(),scope:_optionalChain([t, 'access', _91 => _91.options, 'optionalAccess', _92 => _92.scope]),scopeFields:t.targetFields,errors:t.committedErrors,result:t.result}),t.halted=!0}async function Zt(r){let{scopeFields:t,store:e,asyncErrors:i}=r,s=e.getState(),a=e.config.resolver?await e.config.resolver(s.values,{scopeFields:t}):{},o=e.getRequiredErrors(s.values),n={...a,...o};e.getHiddenFields().forEach(p=>{delete n[p],i.delete(p)});let d={...s.errors};t.forEach(p=>{n[p]?d[p]=n[p]:i.has(p)?d[p]=i.get(p):delete d[p]}),e.dispatch(w(d,!x(d)))}var tt= (_class11 =class{constructor() { _class11.prototype.__init39.call(this);_class11.prototype.__init40.call(this); }__init39() {this.currentValidationId=0}__init40() {this.immediateAbortControllers=new Map}beginValidation(){return this.currentValidationId+=1,this.currentValidationId}getCurrentValidationId(){return this.currentValidationId}isValidationCurrent(t){return t===this.currentValidationId}setImmediateController(t,e){this.immediateAbortControllers.set(t,e)}clearImmediateController(t){this.immediateAbortControllers.delete(t)}cancelImmediate(t){let e=this.immediateAbortControllers.get(t);e&&(e.abort(),this.immediateAbortControllers.delete(t))}cancelImmediatePrefix(t,e){for(let i of this.immediateAbortControllers.keys())v(i,t)&&(this.cancelImmediate(i),e(i))}cancelAllImmediate(){this.immediateAbortControllers.forEach(t=>{t.abort()}),this.immediateAbortControllers.clear()}}, _class11);var et= (_class12 =class{constructor(t){;_class12.prototype.__init41.call(this);_class12.prototype.__init42.call(this);_class12.prototype.__init43.call(this);this.store=t;this.schedule=_nullishCoalesce(_optionalChain([t, 'access', _93 => _93.config, 'access', _94 => _94.scheduler, 'optionalAccess', _95 => _95.schedule]), () => (((i,s)=>{let a=setTimeout(i,s);return()=>clearTimeout(a)}))),this.debouncer=new Q({schedule:(i,s)=>this.schedule(i,s),validate:i=>this.validate(i),validationDelay:_nullishCoalesce(t.config.validationDelay, () => (300))}),this.asyncScheduler=new Z({schedule:(i,s)=>this.schedule(i,s),getValues:()=>this.store.getState().values,setFieldValidating:(i,s)=>this.updateFieldValidating(i,s),setAsyncError:(i,s)=>{this.asyncErrors.set(i,s),this.store.setError(i,s)},clearAsyncError:i=>{this.asyncErrors.delete(i)},onValidationPassed:async i=>{await Zt({scopeFields:[i],store:this.store,asyncErrors:this.asyncErrors})}});let e={store:this.store,asyncErrors:this.asyncErrors,getCurrentValidationId:()=>this.coordinator.getCurrentValidationId(),runImmediateAsyncValidation:(i,s,a)=>this.runImmediateAsyncValidation(i,s,a)};this.validationPipeline=new D([{name:"validate:resolve-target-fields",run:i=>Kt({ctx:i,deps:e})},{name:"validate:before-hooks",run:async i=>$t({ctx:i,deps:e})},{name:"validate:sync-track",run:async i=>Jt({ctx:i,deps:e})},{name:"validate:abort-check-pre-async",run:async i=>Pt({ctx:i,deps:e})},{name:"validate:async-track",run:async i=>Gt({ctx:i,deps:e})},{name:"validate:abort-check",run:async i=>Pt({ctx:i,deps:e})},{name:"validate:async-track-merge",run:i=>Yt({ctx:i,deps:e})},{name:"validate:commit",run:async i=>Xt({ctx:i,deps:e})}])}__init41() {this.validatingCount=0}__init42() {this.asyncErrors=new Map}__init43() {this.coordinator=new tt}updateFieldValidating(t,e){let i=this.store.getState();if(!!i.isValidating[t]===e)return;let a={...i.isValidating};e?(a[t]=!0,this.validatingCount+=1):(delete a[t],this.validatingCount=Math.max(0,this.validatingCount-1)),this.store.dispatch(f({isValidating:a}))}cancelFieldAsync(t){this.asyncScheduler.cancel(t),this.coordinator.cancelImmediate(t)}cleanupField(t){this.cancelFieldAsync(t),this.asyncErrors.delete(t),this.updateFieldValidating(t,!1)}cleanupPrefix(t){this.asyncScheduler.cleanupPrefix(t),this.coordinator.cancelImmediatePrefix(t,e=>{this.asyncErrors.delete(e),this.updateFieldValidating(e,!1)})}beginExternalValidation(t){this.cancelFieldAsync(t),this.updateFieldValidating(t,!0)}endExternalValidation(t){this.updateFieldValidating(t,!1)}async setExternalError(t,e){if(e){this.asyncErrors.set(t,e),this.store.setError(t,e);return}if(this.asyncErrors.delete(t),this.store.validate){await this.store.validate({scopeFields:[t]});return}let i={...this.store.getState().errors};delete i[t],this.store.dispatch(w(i,!x(i)))}handleAsync(t,e){let i=this.store.getFieldConfig(t),s=_optionalChain([i, 'optionalAccess', _96 => _96.validation, 'optionalAccess', _97 => _97.asyncValidate]),a=_nullishCoalesce(_optionalChain([i, 'optionalAccess', _98 => _98.validation, 'optionalAccess', _99 => _99.asyncValidateOn]), () => ("blur"));if(!s||a!=="change"){this.cancelFieldAsync(t),this.updateFieldValidating(t,!1);return}let o=_nullishCoalesce(_optionalChain([i, 'access', _100 => _100.validation, 'optionalAccess', _101 => _101.asyncValidateDelay]), () => (500));this.asyncScheduler.handle(t,e,s,o)}hasValidationsInProgress(t){let e=this.store.getState();return t&&t.length>0?t.some(i=>!!e.isValidating[i]):this.validatingCount>0}trigger(t,e){this.debouncer.trigger(t,e)}async validate(t){try{_optionalChain([t, 'optionalAccess', _102 => _102.scopeFields, 'optionalAccess', _103 => _103.length])&&t.scopeFields.forEach(i=>this.cancelFieldAsync(i));let e={options:t,validationId:this.coordinator.beginValidation(),currentState:this.store.getState(),targetFields:_optionalChain([t, 'optionalAccess', _104 => _104.scopeFields]),allErrors:{},committedErrors:{},isValid:!0,result:!0,aborted:!1};return await this.validationPipeline.run(e),e.aborted&&await this.store.emitAfterValidate({values:this.store.getState().values,state:this.store.getState(),scope:_optionalChain([e, 'access', _105 => _105.options, 'optionalAccess', _106 => _106.scope]),scopeFields:e.targetFields,errors:this.store.getState().errors,result:e.currentState.isValid,aborted:!0}),e.result}catch(e){return this.store.config.onUnhandledError(e,"validation"),!1}}clear(t){this.cancelFieldAsync(t),this.updateFieldValidating(t,!1),this.asyncErrors.delete(t)}cancelAll(){this.validatingCount=0,this.debouncer.cancelPending(),this.asyncScheduler.cancelAll(),this.asyncErrors.clear(),this.coordinator.cancelAllImmediate(),this.store.dispatch(f({isValidating:{}}))}async runImmediateAsyncValidation(t,e,i){await Wt({path:t,values:e,validationId:i,currentValidationId:this.coordinator.getCurrentValidationId(),getFieldConfig:s=>this.store.getFieldConfig(s),cancelFieldAsync:s=>this.cancelFieldAsync(s),createAbortController:()=>new AbortController,setAbortController:(s,a)=>{this.coordinator.setImmediateController(s,a)},clearAbortController:s=>{this.coordinator.clearImmediateController(s)},setFieldValidating:(s,a)=>this.updateFieldValidating(s,a),setAsyncError:(s,a)=>{this.asyncErrors.set(s,a)},clearAsyncError:s=>{this.asyncErrors.delete(s)}})}}, _class12);function xt(r,t,e){if(!Object.prototype.hasOwnProperty.call(r,t))return[r,e];let s=r,a=e;return a||(s={...r},a=!0),delete s[t],[s,a]}var it=class{constructor(t){this.store=t;this.fieldUpdatePipeline=new X([{name:"field:clear-current-error",run:e=>this.clearCurrentError(e)},{name:"field:update-dependencies",run:e=>this.updateDependencies(e)},{name:"field:update-dirty",run:e=>this.updateDirtyState(e)},{name:"field:commit-state",run:e=>this.commitFieldState(e)},{name:"field:emit-change",run:e=>this.emitFieldChange(e)},{name:"field:trigger-validate",run:e=>this.triggerResolverValidation(e)},{name:"field:trigger-async-validate",run:e=>this.triggerAsyncValidation(e)}])}updateField(t,e,i={origin:"setField"}){let s=this.store.getState(),a={path:t,value:e,meta:i,previousValue:_chunkT2JRSWQUcjs.f.call(void 0, s.values,t),nextValues:_chunkT2JRSWQUcjs.g.call(void 0, s.values,t,e),nextErrors:s.errors,hasMutatedErrors:!1,dependencyDiff:{affectedFields:[],visibilityChanged:[],requiredChanged:[]},isDirty:!1};this.fieldUpdatePipeline.run(a)}clearCurrentError(t){[t.nextErrors,t.hasMutatedErrors]=xt(t.nextErrors,t.path,t.hasMutatedErrors),this.store.clearFieldValidation(t.path)}updateDependencies(t){if(typeof this.store.hasDependentFields=="function"&&!this.store.hasDependentFields(t.path)){t.dependencyDiff.affectedFields.length=0,t.dependencyDiff.visibilityChanged.length=0,t.dependencyDiff.requiredChanged.length=0;return}t.dependencyDiff=this.store.updateDependencies(t.path,this.store.getState().values,t.nextValues),new Set([...t.dependencyDiff.visibilityChanged,...t.dependencyDiff.requiredChanged]).forEach(i=>{[t.nextErrors,t.hasMutatedErrors]=xt(t.nextErrors,i,t.hasMutatedErrors),this.store.clearFieldValidation(i)})}updateDirtyState(t){t.isDirty=this.store.updateDirtyForPath(t.path,t.nextValues,this.store.getBaselineValues())}commitFieldState(t){let e=Array.from(new Set([t.path,...t.dependencyDiff.visibilityChanged,...t.dependencyDiff.requiredChanged]));this.store.dispatch(f({values:t.nextValues,errors:t.nextErrors,isDirty:t.isDirty},e))}emitFieldChange(t){this.store.emitFieldChange({path:t.path,previousValue:t.previousValue,nextValue:t.value,values:this.store.getState().values,state:this.store.getState(),meta:t.meta})}triggerResolverValidation(t){let e=Array.from(new Set([t.path,...t.dependencyDiff.visibilityChanged,...t.dependencyDiff.requiredChanged]));(this.store.config.resolver||t.dependencyDiff.visibilityChanged.length>0||t.dependencyDiff.requiredChanged.length>0)&&this.store.triggerValidation(e)}triggerAsyncValidation(t){(typeof this.store.getFieldConfig=="function"?_optionalChain([this, 'access', _107 => _107.store, 'access', _108 => _108.getFieldConfig, 'call', _109 => _109(t.path), 'optionalAccess', _110 => _110.validation, 'optionalAccess', _111 => _111.asyncValidateOn]):void 0)==="change"&&this.store.handleFieldAsyncValidation(t.path,t.value)}};var rt=class{constructor(t){this.store=t}collectChangedPaths(t,e=""){let i=[];return Object.entries(t).forEach(([s,a])=>{let o=e?`${e}.${s}`:s;if(a&&typeof a=="object"&&!Array.isArray(a)&&Object.keys(a).length>0){i.push(...this.collectChangedPaths(a,o));return}i.push(o)}),i}setValues(t,e){if(_optionalChain([e, 'optionalAccess', _112 => _112.rebase])){this.rebaseValues(t);return}if(_optionalChain([e, 'optionalAccess', _113 => _113.partial])){this.hydrateValues(t);return}this.replaceValuesInternal(t,"replaceValues")}hydrateValues(t){let e=_chunkT2JRSWQUcjs.b.call(void 0, this.store.getState().values,t),i=this.collectChangedPaths(t);this.replaceValuesInternal(e,"hydrate",i.length>0?i:["*"])}rebaseValues(t){let e=this.store.getState().values,i=_chunkT2JRSWQUcjs.a.call(void 0, t);this.store.setBaselineValues(_chunkT2JRSWQUcjs.a.call(void 0, i)),this.store.cancelAllValidations(),this.store.evaluateAllDependencies(i),this.store.clearDirtyState(),this.store.dispatch(f({values:i,errors:{},touched:{},isValidating:{},isValid:!0,isDirty:!1,isSubmitting:!1},["*"])),this.store.resetHistory(i),this.store.validateNow(),this.store.emitFieldChange({path:"*",previousValue:e,nextValue:i,values:this.store.getState().values,state:this.store.getState(),meta:{origin:"rebase"}})}applyHistoryState(t){let e=this.store.rebuildDirtyState(t,this.store.getBaselineValues());this.store.dispatch(f({values:t,isDirty:e},["*"])),this.store.triggerValidation(void 0,{forceDebounce:!0})}reset(){this.store.cancelAllValidations();let t=_chunkT2JRSWQUcjs.a.call(void 0, this.store.getBaselineValues());this.store.evaluateAllDependencies(t),this.store.clearDirtyState(),this.store.dispatch(f({values:t,errors:{},touched:{},isValidating:{},isValid:!0,isDirty:!1,isSubmitting:!1},["*"])),this.store.resetHistory(t)}replaceValuesInternal(t,e="replaceValues",i=["*"]){let s=this.store.getState().values,a=_chunkT2JRSWQUcjs.a.call(void 0, t);this.store.cancelAllValidations(),this.store.evaluateAllDependencies(a);let o=this.store.rebuildDirtyState(a,this.store.getBaselineValues());this.store.dispatch(f({values:a,errors:{},isValidating:{},isValid:!0,isDirty:o,isSubmitting:!1},i)),this.store.internalSaveSnapshot(),this.store.validateNow(),this.store.emitFieldChange({path:"*",previousValue:s,nextValue:a,values:this.store.getState().values,state:this.store.getState(),meta:{origin:e}})}};var st=class{constructor(t){this.store=t;this.submitPipeline=new D([{name:"submit:start",run:async e=>this.startSubmit(e)},{name:"submit:invalid",run:async e=>this.handleInvalidSubmit(e)},{name:"submit:prepare",run:e=>this.prepareSubmitValues(e)},{name:"submit:before-hooks",run:async e=>this.runBeforeSubmitHooks(e)},{name:"submit:user-handler",run:async e=>this.runSubmitHandler(e)},{name:"submit:after-hooks",run:async e=>this.runAfterSubmitHooks(e)}])}async submit(t){if(this.store.getState().isSubmitting)return{status:"blocked",reason:"isSubmitting"};if(this.store.hasValidationsInProgress())return{status:"blocked",reason:"validating"};this.store.cancelAllValidations();let i={onSuccess:t,isValid:!1,valuesToSubmit:_chunkT2JRSWQUcjs.a.call(void 0, this.store.getState().values),dirtyValues:{}};try{return await this.submitPipeline.run(i),i.invalid?{status:"invalid"}:{status:"submitted"}}catch(s){return i.error=s,await this.store.emitOperationalError({source:"submit",error:s}),await this.store.emitAfterSubmit({values:this.store.getState().values,dirtyValues:this.store.buildDirtyValues(this.store.getState().values),state:this.store.getState(),success:!1,error:s}),this.store.config.onUnhandledError(s,"submit"),{status:"failed",error:s}}finally{this.store.dispatch(f({isSubmitting:!1}))}}async startSubmit(t){this.store.dispatch(f({isSubmitting:!0})),t.isValid=await this.store.validateNow()}async handleInvalidSubmit(t){if(t.isValid)return;let e=this.store.getState().errors,i={...this.store.getState().touched};Object.keys(e).forEach(s=>{i[s]=!0}),this.store.batchStateUpdates(()=>{this.store.dispatch(f({touched:i}))}),t.dirtyValues=this.store.buildDirtyValues(this.store.getState().values),t.invalid=!0,await this.store.emitAfterSubmit({values:this.store.getState().values,dirtyValues:t.dirtyValues,state:this.store.getState(),success:!1,invalid:!0}),t.halted=!0}prepareSubmitValues(t){let e=[];this.store.getHiddenFields().forEach(i=>{e.push([i,void 0])}),t.valuesToSubmit=Rt({values:t.valuesToSubmit,sourceValues:this.store.getState().values,transformEntries:this.store.getTransformEntries()}),e.length>0&&(t.valuesToSubmit=_chunkT2JRSWQUcjs.h.call(void 0, t.valuesToSubmit,e)),t.dirtyValues=this.store.buildDirtyValues(t.valuesToSubmit)}async runBeforeSubmitHooks(t){await this.store.emitBeforeSubmit({values:t.valuesToSubmit,dirtyValues:t.dirtyValues,state:this.store.getState()})}async runSubmitHandler(t){await t.onSuccess(t.valuesToSubmit,t.dirtyValues)}async runAfterSubmitHooks(t){await this.store.emitAfterSubmit({values:t.valuesToSubmit,dirtyValues:t.dirtyValues,state:this.store.getState(),success:!0})}};var at=class{constructor(t){this.ports=t;this.fieldUpdate=new it(t.fieldUpdate),this.values=new rt(t.values),this.submitFlow=new st(t.submit)}updateField(t,e,i={origin:"setField"}){this.fieldUpdate.updateField(t,e,i)}setValues(t,e){this.values.setValues(t,e)}hydrateValues(t){this.values.hydrateValues(t)}rebaseValues(t){this.values.rebaseValues(t)}applyHistoryState(t){this.values.applyHistoryState(t)}async submit(t){return this.submitFlow.submit(t)}reset(){this.values.reset()}};function Qt(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof Date)&&!(r instanceof RegExp)}function te(r,t){let e=[],i=(s,a,o,n,d)=>{if(!(n&&d&&_chunkT2JRSWQUcjs.d.call(void 0, s,a))){if(Qt(s)&&Qt(a)&&n&&d){let p=new Set([...Object.keys(s),...Object.keys(a)]);for(let l of p){let c=o?`${o}.${l}`:l,u=Object.prototype.hasOwnProperty.call(s,l),h=Object.prototype.hasOwnProperty.call(a,l);i(s[l],a[l],c,u,h)}return}e.push({path:o,previousValue:_chunkT2JRSWQUcjs.a.call(void 0, s),nextValue:_chunkT2JRSWQUcjs.a.call(void 0, a),hadPreviousValue:n,hasNextValue:d})}};return i(r,t,"",!0,!0),{operations:e}}function ot(r,t,e){let i=r;for(let s of t.operations){let a=e==="undo"?s.hadPreviousValue:s.hasNextValue,o=e==="undo"?s.previousValue:s.nextValue;if(!s.path){i=a?_chunkT2JRSWQUcjs.a.call(void 0, o):{};continue}i=a?_chunkT2JRSWQUcjs.g.call(void 0, i,s.path,_chunkT2JRSWQUcjs.a.call(void 0, o)):_chunkT2JRSWQUcjs.i.call(void 0, i,s.path)}return i}var nt= (_class13 =class{constructor(t,e){;_class13.prototype.__init44.call(this);_class13.prototype.__init45.call(this);_class13.prototype.__init46.call(this);_class13.prototype.__init47.call(this);_class13.prototype.__init48.call(this);this.enableHistory=t;this.maxHistory=e}__init44() {this.baseSnapshot=null}__init45() {this.currentSnapshot=null}__init46() {this.patches=[]}__init47() {this.historyIndex=-1}__init48() {this.historySize=0}saveSnapshot(t){if(!this.enableHistory)return;if(!this.currentSnapshot||this.baseSnapshot===null){this.reset(t);return}if(_chunkT2JRSWQUcjs.d.call(void 0, this.currentSnapshot,t))return;this.historyIndex<this.historySize-1&&(this.patches.splice(this.historyIndex),this.historySize=this.historyIndex+1);let e=te(this.currentSnapshot,t);if(e.operations.length!==0)for(this.patches.push(e),this.currentSnapshot=_chunkT2JRSWQUcjs.a.call(void 0, t),this.historyIndex+=1,this.historySize=this.historyIndex+1;this.historySize>this.getCapacity();)this.compactOldestSnapshot()}get canUndo(){return this.enableHistory?this.historyIndex>0:!1}get canRedo(){return this.enableHistory?this.historyIndex<this.historySize-1:!1}undo(){if(!this.canUndo||!this.currentSnapshot)return null;let t=this.patches[this.historyIndex-1],e=ot(this.currentSnapshot,t,"undo");return this.currentSnapshot=_chunkT2JRSWQUcjs.a.call(void 0, e),this.historyIndex-=1,e}redo(){if(!this.canRedo||!this.currentSnapshot)return null;let t=this.patches[this.historyIndex],e=ot(this.currentSnapshot,t,"redo");return this.currentSnapshot=_chunkT2JRSWQUcjs.a.call(void 0, e),this.historyIndex+=1,e}reset(t){if(!this.enableHistory){this.baseSnapshot=null,this.currentSnapshot=null,this.patches=[],this.historyIndex=-1,this.historySize=0;return}this.baseSnapshot=_chunkT2JRSWQUcjs.a.call(void 0, t),this.currentSnapshot=_chunkT2JRSWQUcjs.a.call(void 0, t),this.patches=[],this.historyIndex=0,this.historySize=1}getMetadata(){return{enabled:this.enableHistory,canUndo:this.canUndo,canRedo:this.canRedo,historyIndex:this.historyIndex,historySize:this.historySize}}compactOldestSnapshot(){let t=this.patches.shift();!t||this.baseSnapshot===null||(this.baseSnapshot=ot(this.baseSnapshot,t,"redo"),this.historySize=Math.max(1,this.historySize-1),this.historyIndex=Math.max(0,this.historyIndex-1))}getCapacity(){return Math.max(1,this.maxHistory)}}, _class13);var lt=class{constructor(t){this.store=t}pushItem(t,e){this.mutateArrayWithSetField(t,i=>[...i,e],{origin:"array",operation:"push"})}prependItem(t,e){this.mutateArrayWithSetField(t,i=>[e,...i],{origin:"array",operation:"prepend"})}insertItem(t,e,i){this.mutateArrayWithSetField(t,s=>{let a=[...s];return a.splice(e,0,i),a},{origin:"array",operation:"insert",index:e})}removeItem(t,e){let i=this.store.getState(),s=_chunkT2JRSWQUcjs.f.call(void 0, i.values,t);if(!Array.isArray(s))return;let a=[...s];this.store.unregisterPrefix&&this.store.unregisterPrefix(bt(t,e));let o=s.filter((n,d)=>d!==e);this.commitArrayMutationWithFieldPipeline({path:t,nextArray:o,meta:{origin:"array",operation:"remove",index:e},reindex:n=>n===e?null:n>e?n-1:n})}swapItems(t,e,i){let s=this.store.getState(),a=[..._chunkT2JRSWQUcjs.f.call(void 0, s.values,t)||[]];[a[e],a[i]]=[a[i],a[e]],this.commitArrayMutationWithFieldPipeline({path:t,nextArray:a,meta:{origin:"array",operation:"swap",from:e,to:i},reindex:o=>o===e?i:o===i?e:o})}moveItem(t,e,i){let s=this.store.getState(),a=[..._chunkT2JRSWQUcjs.f.call(void 0, s.values,t)||[]],[o]=a.splice(e,1);a.splice(i,0,o),this.commitArrayMutationWithFieldPipeline({path:t,nextArray:a,meta:{origin:"array",operation:"move",from:e,to:i},reindex:n=>n===e?i:e<i&&n>e&&n<=i?n-1:e>i&&n>=i&&n<e?n+1:n})}replaceItems(t,e){this.commitArrayMutationWithFieldPipeline({path:t,nextArray:e,meta:{origin:"array",operation:"replace"},reindex:i=>i<e.length?i:null})}clearItems(t){this.store.unregisterPrefix&&this.store.unregisterPrefix(bt(t)),this.commitArrayMutationWithFieldPipeline({path:t,nextArray:[],meta:{origin:"array",operation:"clear"},reindex:()=>null})}mutateArrayWithSetField(t,e,i){let s=_chunkT2JRSWQUcjs.f.call(void 0, this.store.getState().values,t)||[];this.store.setFieldWithMeta(t,e(s),i),this.store.internalSaveSnapshot()}commitArrayMutationWithFieldPipeline(t){let{path:e,nextArray:i,meta:s,reindex:a}=t,o=this.store.getState();this.store.setFieldWithMeta(e,i,s);let n=_chunkT2JRSWQUcjs.k.call(void 0, o,e,a);this.store.dispatch(f({errors:n.errors,touched:n.touched,isValidating:n.isValidating},[e])),this.store.internalSaveSnapshot()}};var dt=class{constructor(t,e,i,s){this.getState=t;this.getInitialValues=e;this.getScopeFields=i;this.isPathDirty=s}getScopeStatus(t){let e=this.getScopeFields(t),i=this.getState(),s=e.some(n=>!!i.errors[n]),a=e.some(n=>this.isPathDirty(n)),o=this.getScopeErrors(t);return{hasErrors:s,isDirty:a,errors:o}}getScopeErrors(t){let e=this.getScopeFields(t),i=this.getState(),s={};for(let a of e){let o=i.errors[a];o&&(s[a]=o)}return s}};var ct= (_class14 =class{constructor(t,e,i){;_class14.prototype.__init49.call(this);this.fieldMetadataProvider=t;this.getState=e;this.isPathDirty=i}__init49() {this.requiredValuesRef=null}isHidden(t){return this.fieldMetadataProvider.isHidden(t)}isRequired(t){let e=this.getState().values;return this.requiredValuesRef!==e&&(this.requiredValuesRef=e),this.fieldMetadataProvider.isRequired(t,e)}isFieldDirty(t){return this.isPathDirty(t)}isFieldValidating(t){return!!this.getState().isValidating[t]}isTouched(t){return!!this.getState().touched[t]}}, _class14);var pt=class{constructor(t,e){this.getState=t;this.dispatch=e}setError(t,e){let i={...this.getState().errors,[t]:e};e||delete i[t],this.dispatch(f({errors:i}))}setErrors(t){this.dispatch(f({errors:{...this.getState().errors,...t}}))}setServerErrors(t){let e={};for(let[i,s]of Object.entries(t))e[i]=Array.isArray(s)?s[0]:s;this.setErrors(e)}};function ee(r){let t=[],e=new Map;for(let o of r)if(e.has(o.path)||e.set(o.path,new Set),o.dependsOn)for(let n of o.dependsOn)r.find(p=>p.path===n)&&e.get(o.path).add(n);let i=new Set,s=new Set,a=(o,n)=>{i.add(o),s.add(o),n.push(o);let d=e.get(o)||new Set;for(let p of d)if(i.has(p)){if(s.has(p)){let l=n.indexOf(p),c=[...n.slice(l),p];return{cycle:c,paths:Array.from(e.keys()).filter(u=>c.includes(u)),message:`Circular dependency detected: ${c.join(" \u2192 ")}. Check your computed field definitions.`}}}else{let l=a(p,[...n]);if(l)return l}return s.delete(o),null};for(let o of e.keys())if(!i.has(o)){let n=a(o,[]);n&&!t.some(d=>d.message===n.message)&&t.push(n)}return t}var Et= (_class15 =class{constructor() { _class15.prototype.__init50.call(this); }__init50() {this.entries=new Map}register(t,e){this.entries.set(t,e)}resolve(t){let e=this.entries.get(t);if(!e)throw new Error(`BitStore capability "${String(t)}" n\xE3o foi registrada.`);return e}toCapabilities(){return{validation:this.resolve("validation"),lifecycle:this.resolve("lifecycle"),history:this.resolve("history"),arrays:this.resolve("arrays"),scope:this.resolve("scope"),query:this.resolve("query"),error:this.resolve("error")}}}, _class15);function ie(){return new Et}function ri(r){let{registry:t,ports:e,fieldRegistry:i}=r;t.register("validation",new et(e.validationPort)),t.register("lifecycle",new at(e.lifecyclePorts)),t.register("history",new nt(!!e.config.history.enabled,_nullishCoalesce(e.config.history.limit, () => (50)))),t.register("arrays",new lt(e.arrayPort)),t.register("scope",new dt(()=>e.getState(),()=>e.getBaselineValues(),s=>e.getScopeFields(s),s=>e.isPathDirty(s))),t.register("query",new ct(i,()=>e.getState(),s=>e.isPathDirty(s))),t.register("error",new pt(()=>e.getState(),s=>e.dispatch(s)))}function re(r){let{ports:t,fieldRegistry:e}=r,i=ie();return ri({registry:i,ports:t,fieldRegistry:e}),{registry:i,capabilities:i.toCapabilities()}}function se(r){let{config:t,fieldRegistry:e,computedManager:i}=r,s=_chunkT2JRSWQUcjs.a.call(void 0, t.initialValues);t.fields&&Object.entries(t.fields).forEach(([n,d])=>{e.register(n,d,s)});let a=ee(e.getComputedEntries());if(a.length>0)throw new Error(a[0].message);return{values:O({values:s,normalizerEntries:e.getNormalizerEntries(),applyComputed:(n,d)=>i.apply(n,d)}),errors:{},touched:{},isValidating:{},persist:{isSaving:!1,isRestoring:!1,error:null},isValid:!0,isSubmitting:!1,isDirty:!1}}function ae(r){return{getState:r.getState,dispatch:r.dispatch,setError:r.setError,validate:r.validate,getFieldConfig:r.getFieldConfig,forEachFieldConfig:t=>r.fieldRegistry.forEachFieldConfig((e,i)=>t(e,i)),getScopeFields:r.getScopeFields,config:r.config,getRequiredErrors:t=>r.fieldRegistry.getRequiredErrors(t),getHiddenFields:()=>r.fieldRegistry.getHiddenFields(),emitBeforeValidate:t=>r.getEffects().beforeValidate(t),emitAfterValidate:t=>r.getEffects().afterValidate(t)}}function oe(r){let t={getState:r.getState,dispatch:r.dispatch,config:r.config,getFieldConfig:s=>r.fieldRegistry.getFieldConfig(s),updateDependencies:(s,a,o)=>r.fieldRegistry.updateDependencies(s,a,o),hasDependentFields:s=>r.fieldRegistry.hasDependents(s),isFieldHidden:s=>r.fieldRegistry.isHidden(s),clearFieldValidation:s=>r.getValidation().clear(s),triggerValidation:(s,a)=>r.getValidation().trigger(s,a),handleFieldAsyncValidation:(s,a)=>r.getValidation().handleAsync(s,a),updateDirtyForPath:(s,a,o)=>r.dirtyManager.updateForPath(s,a,o),getBaselineValues:r.getBaselineValues,emitFieldChange:s=>r.getEffects().onFieldChange(s)},e={getState:r.getState,dispatch:r.dispatch,internalSaveSnapshot:r.saveHistorySnapshot,evaluateAllDependencies:s=>r.fieldRegistry.evaluateAll(s),cancelAllValidations:()=>r.getValidation().cancelAll(),validateNow:s=>r.getValidation().validate(s),rebuildDirtyState:(s,a)=>r.dirtyManager.rebuild(s,a),clearDirtyState:r.dirtyManager.clear.bind(r.dirtyManager),getBaselineValues:r.getBaselineValues,setBaselineValues:r.setBaselineValues,resetHistory:s=>r.getHistory().reset(s),emitFieldChange:s=>r.getEffects().onFieldChange(s),triggerValidation:(s,a)=>r.getValidation().trigger(s,a)},i={getState:r.getState,dispatch:r.dispatch,batchStateUpdates:r.runStateBatch,config:r.config,getTransformEntries:r.getTransformEntries,getHiddenFields:()=>r.fieldRegistry.getHiddenFields(),cancelAllValidations:()=>r.getValidation().cancelAll(),validateNow:s=>r.getValidation().validate(s),hasValidationsInProgress:s=>r.getValidation().hasValidationsInProgress(s),buildDirtyValues:s=>r.dirtyManager.buildDirtyValues(s),emitBeforeSubmit:s=>r.getEffects().beforeSubmit(s),emitAfterSubmit:s=>r.getEffects().afterSubmit(s),emitOperationalError:s=>r.getEffects().reportOperationalError(s)};return{fieldUpdate:t,values:e,submit:i}}function ne(r){return{getState:r.getState,setFieldWithMeta:r.setFieldWithMeta,dispatch:r.dispatch,internalSaveSnapshot:r.saveHistorySnapshot,unregisterPrefix:r.unregisterPrefix}}function le(r){let{config:t,fieldRegistry:e,dirtyManager:i,baselineManager:s,runtimeContext:a}=r,{stateAccess:o,fieldAccess:n,featureAccess:d,actions:p}=a,l=ae({config:t,fieldRegistry:e,getState:o.getState,dispatch:o.dispatch,setError:p.setError,validate:p.validate,getFieldConfig:n.getFieldConfig,getScopeFields:n.getScopeFields,getEffects:d.getEffects}),c=oe({config:t,fieldRegistry:e,dirtyManager:i,getState:o.getState,dispatch:o.dispatch,saveHistorySnapshot:o.saveHistorySnapshot,runStateBatch:o.runStateBatch,getTransformEntries:n.getTransformEntries,getBaselineValues:()=>s.getValues(),setBaselineValues:h=>s.setValues(h),getValidation:d.getValidation,getHistory:d.getHistory,getEffects:d.getEffects}),u=ne({getState:o.getState,dispatch:o.dispatch,setFieldWithMeta:(h,S,B)=>p.setFieldWithMeta(h,S,B),unregisterPrefix:p.unregisterPrefix,saveHistorySnapshot:o.saveHistorySnapshot});return re({ports:{validationPort:l,lifecyclePorts:c,arrayPort:u,config:t,getScopeFields:n.getScopeFields,getState:o.getState,dispatch:o.dispatch,getBaselineValues:()=>s.getValues(),isPathDirty:h=>i.isPathDirty(h)},fieldRegistry:e})}function de(r){let{config:t,fieldRegistry:e,dirtyManager:i,computedManager:s,rawConfig:a,baselineManager:o,runtimeContext:n}=r,{stateAccess:d,fieldAccess:p,featureAccess:l,actions:c}=n,u=le({config:t,fieldRegistry:e,dirtyManager:i,baselineManager:o,runtimeContext:{stateAccess:d,fieldAccess:p,featureAccess:l,actions:c}}),h=se({config:t,fieldRegistry:e,computedManager:s}),S=new Y(d.getState,t.subscriptionCacheSize),B=a.storeId||t.name||t.idFactory({scope:"store",storeName:t.name});return{state:h,subscriptions:S,capabilityRegistry:u.registry,storeId:B}}function ce(){return{depth:0,pendingState:null,changedPathSet:null,valuesChanged:!1,pendingHistorySnapshot:!1}}function pe(r){r.depth+=1}function ue(r){return r.depth-=1,r.depth===0}function ut(r,t){return _nullishCoalesce(t.pendingState, () => (r))}function he(r,t){if(r.pendingState=t.nextState,r.valuesChanged||=t.valuesChanged,t.valuesChanged&&(r.pendingHistorySnapshot=!0),t.changedPaths&&t.changedPaths.length>0){let e=_nullishCoalesce(r.changedPathSet, () => (new Set));t.changedPaths.forEach(i=>e.add(i)),r.changedPathSet=e}}function ge(r){let{currentState:t,batchState:e,applyValueDerivations:i}=r;if(!e.pendingState)return e.pendingHistorySnapshot=!1,null;let s=e.pendingState,a=_nullishCoalesce(e.changedPathSet, () => (void 0)),o=e.valuesChanged;return o&&(s={...s,values:i(s.values,a?[...a]:void 0)}),e.pendingState=null,e.changedPathSet=null,e.valuesChanged=!1,{nextState:_nullishCoalesce(s, () => (t)),changedPaths:a,valuesChanged:o}}function si(r){let t=!1;for(let i of Object.values(r))if(i===void 0){t=!0;break}if(!t)return r;let e={};return Object.entries(r).forEach(([i,s])=>{let a=s;a!==void 0&&(e[i]=a)}),e}function fe(r){let{currentState:t,partialState:e,changedPaths:i,applyValueDerivations:s,applyComputedValues:a}=r,o=_nullishCoalesce(s, () => ((u=>a?a(u):u))),n={...t,...e},d=!!e.values;e.values&&(n.values=o(e.values,i)),e.errors&&(n.errors=si(e.errors),n.isValid=!x(n.errors));let p=i&&i.length>0?i:void 0,l=ai(e),c=oi(p,l);return{nextState:n,changedPaths:c,valuesChanged:d}}function ai(r){let t=new Set,e=[r.errors,r.touched,r.isValidating];for(let i of e)if(i)for(let s in i)t.add(s);return r.persist&&t.add("persist"),"isValid"in r&&t.add("isValid"),"isDirty"in r&&t.add("isDirty"),"isSubmitting"in r&&t.add("isSubmitting"),t.size>0?Array.from(t):void 0}function oi(r,t){if(!_optionalChain([r, 'optionalAccess', _114 => _114.length]))return t;if(!_optionalChain([t, 'optionalAccess', _115 => _115.length]))return r;let e=new Set;for(let i of r)e.add(i);for(let i of t)e.add(i);return Array.from(e)}function ni(r){throw new Error(`BitStore: unsupported operation kind: ${String(r.kind)}`)}function li(r,t){switch(t.kind){case"state.patch":return t;case"field.touchMany":{if(t.paths.length===0)return null;let e={...r.touched};for(let i of t.paths)e[i]=!0;return f({touched:e},t.paths)}case"form.persistMeta":return f({persist:{...r.persist,...t.patch}});case"history.apply":return f({values:t.values,isDirty:t.isDirty},["*"]);case"validation.commit":return f({errors:t.errors,isValid:t.isValid});default:return ni(t)}}function di(r){let{currentState:t,operation:e,applyValueDerivations:i}=r,s=Object.prototype.hasOwnProperty.call(e.partialState,"values"),a=_nullishCoalesce(e.changedPaths, () => ((s?["*"]:void 0)));return fe({currentState:t,partialState:e.partialState,changedPaths:a,applyValueDerivations:i})}function me(r){let{currentState:t,operation:e,applyValueDerivations:i}=r,s=li(t,e);return s?di({currentState:t,operation:s,applyValueDerivations:(a,o)=>s.skipComputed?a:i(a,o)}):null}function ye(r){let{state:t,batchState:e,operation:i,applyValueDerivations:s,onStateCommitted:a}=r,o=ut(t,e);if(e.depth>0){let d=me({currentState:o,operation:i,applyValueDerivations:p=>p});return d&&he(e,d),t}let n=me({currentState:t,operation:i,applyValueDerivations:s});return n?(a({nextState:n.nextState,changedPaths:n.changedPaths,valuesChanged:n.valuesChanged}),n.nextState):t}function Se(r){let{state:t,batchState:e,applyValueDerivations:i,onStateCommitted:s}=r,a=ge({currentState:t,batchState:e,applyValueDerivations:i});return a?(s({nextState:a.nextState,changedPaths:a.changedPaths,valuesChanged:a.valuesChanged}),a.nextState):t}function be(r){let{batchState:t,callback:e,flushBatchedStateUpdates:i}=r;pe(t);try{return e()}finally{ue(t)&&i()}}function Be(r){let{payload:t,setState:e,notifySubscriptions:i,notifyEffects:s}=r;e(t.nextState),i(t.nextState,t.changedPaths),s(t.nextState,t.valuesChanged)}function Te(r){let{state:t,batchState:e,operation:i,applyValueDerivations:s,onStateCommitted:a}=r;return ye({state:t,batchState:e,operation:i,applyValueDerivations:s,onStateCommitted:a})}function ve(r){let{batchState:t,values:e,saveHistory:i}=r;if(t.depth>0){t.pendingHistorySnapshot=!0;return}i(e)}function Pe(r){let{state:t,batchState:e,applyValueDerivations:i,onStateCommitted:s,saveHistory:a}=r,o=Se({state:t,batchState:e,applyValueDerivations:i,onStateCommitted:s});return e.pendingHistorySnapshot&&(e.pendingHistorySnapshot=!1,a(o.values)),o}var ht= (_class16 =class{constructor(t){;_class16.prototype.__init51.call(this);this.args=t;this.state=t.state,this.subscriptions=t.subscriptions,this.effects=t.effects,this.capabilityRegistry=t.capabilityRegistry,this.capabilities=t.capabilityRegistry.toCapabilities()}__init51() {this.batchState=ce()}getCapability(t){return this.capabilityRegistry.resolve(t)}getState(){return ut(this.state,this.batchState)}runBatch(t){return be({batchState:this.batchState,callback:t,flushBatchedStateUpdates:()=>this.flushBatchedStateUpdates()})}dispatch(t){this.state=Te({state:this.state,batchState:this.batchState,operation:t,applyValueDerivations:(e,i)=>this.applyValueDerivations(e,i),onStateCommitted:e=>this.onStateCommitted(e)})}saveHistorySnapshot(){let t=this.capabilities.history.getMetadata();ve({batchState:this.batchState,values:this.state.values,saveHistory:i=>this.capabilities.history.saveSnapshot(i)});let e=this.capabilities.history.getMetadata();(t.canUndo!==e.canUndo||t.canRedo!==e.canRedo||t.historyIndex!==e.historyIndex||t.historySize!==e.historySize)&&this.subscriptions.notify(this.getState(),[_chunkD7JQWF6Vcjs.h.call(void 0, )])}cleanup(){this.subscriptions.destroy(),this.capabilities.validation.cancelAll(),this.effects.destroy()}onStateCommitted(t){Be({payload:t,setState:e=>{this.state=e},notifySubscriptions:(e,i)=>this.subscriptions.notify(e,i),notifyEffects:(e,i)=>this.effects.onStateUpdated(e,i)})}flushBatchedStateUpdates(){let t=this.capabilities.history.getMetadata();this.state=Pe({state:this.state,batchState:this.batchState,applyValueDerivations:(i,s)=>this.applyValueDerivations(i,s),onStateCommitted:i=>this.onStateCommitted(i),saveHistory:i=>this.capabilities.history.saveSnapshot(i)});let e=this.capabilities.history.getMetadata();(t.canUndo!==e.canUndo||t.canRedo!==e.canRedo||t.historyIndex!==e.historyIndex||t.historySize!==e.historySize)&&this.subscriptions.notify(this.getState(),[_chunkD7JQWF6Vcjs.h.call(void 0, )])}applyValueDerivations(t,e){return this.args.applyValueDerivations?this.args.applyValueDerivations(t,e):t}}, _class16);var gt=class{constructor(t){this.baselineValues=_chunkT2JRSWQUcjs.a.call(void 0, t)}getValues(){return _chunkT2JRSWQUcjs.a.call(void 0, this.baselineValues)}setValues(t){this.baselineValues=_chunkT2JRSWQUcjs.a.call(void 0, t)}};function xe(r){let{rawConfig:t,storeBusPort:e}=r,i=Mt(t),s=new gt(i.initialValues),a=new N,o=new j(()=>a.getComputedEntries()),n=new H,d=new q;i.masks&&Object.entries(i.masks).forEach(([m,b])=>{d.registerMask(m,b)});let p=()=>{a.invalidateIndexes(),o.invalidateReverseDeps()},l,c=()=>{if(!l)throw new Error("BitStore runtime kernel is not initialized yet.");return l},u=de({rawConfig:t,config:i,fieldRegistry:a,computedManager:o,dirtyManager:n,baselineManager:s,runtimeContext:{stateAccess:{getState:()=>_nullishCoalesce(_optionalChain([l, 'optionalAccess', _116 => _116.getState, 'call', _117 => _117()]), () => (u.state)),dispatch:m=>c().dispatch(m),saveHistorySnapshot:()=>c().saveHistorySnapshot(),runStateBatch:m=>c().runBatch(m)},fieldAccess:{getFieldConfig:m=>a.getFieldConfig(m),getScopeFields:m=>a.getScopeFields(m),getNormalizerEntries:()=>a.getNormalizerEntries(),getTransformEntries:()=>a.getTransformEntries()},featureAccess:{getEffects:()=>c().effects,getHistory:()=>c().getCapability("history"),getValidation:()=>c().getCapability("validation")},actions:{setError:(m,b)=>{c().getCapability("error").setError(m,b)},validate:m=>c().getCapability("validation").validate(m),setFieldWithMeta:(m,b,yt={origin:"setField"})=>{c().runBatch(()=>{c().getCapability("lifecycle").updateField(m,b,yt)})},unregisterPrefix:m=>{G({prefix:m,state:c().getState(),fieldRegistry:a,subscriptions:c().subscriptions,validationCleanupPrefix:b=>c().getCapability("validation").cleanupPrefix(b),invalidateFieldIndexes:p})},triggerValidation:(m,b)=>{c().getCapability("validation").trigger(m,b)}}}}),h=()=>{let m=_nullishCoalesce(_optionalChain([l, 'optionalAccess', _118 => _118.getState, 'call', _119 => _119()]), () => (u.state));return n.buildDirtyValues(m.values)},S=m=>{Nt({values:m,state:c().getState(),initialValues:s.getValues(),validation:c().getCapability("validation"),fieldRegistry:a,dirtyManager:n,dispatch:b=>c().dispatch(b),saveHistorySnapshot:()=>c().saveHistorySnapshot()})},B=It({storeId:u.storeId,storeBusPort:e,config:i,getState:()=>_nullishCoalesce(_optionalChain([l, 'optionalAccess', _120 => _120.getState, 'call', _121 => _121()]), () => (u.state)),getConfig:()=>i,getValues:()=>(_nullishCoalesce(_optionalChain([l, 'optionalAccess', _122 => _122.getState, 'call', _123 => _123()]), () => (u.state))).values,getDirtyValues:h,applyPersistedValues:S});return l=new ht({state:u.state,subscriptions:u.subscriptions,effects:B,capabilityRegistry:u.capabilityRegistry,applyValueDerivations:(m,b)=>O({values:m,changedPaths:b,normalizerEntries:a.getNormalizerEntries(),applyComputed:(yt,Ke)=>o.apply(yt,Ke)})}),l.saveHistorySnapshot(),{config:i,storeId:u.storeId,runtime:l,fieldRegistry:a,computedManager:o,dirtyManager:n,maskManager:d,baselineManager:s}}function Ee(r){let{path:t,getFieldConfig:e,masks:i}=r,s=_optionalChain([e, 'call', _124 => _124(t), 'optionalAccess', _125 => _125.mask]);if(s)return typeof s=="string"?_optionalChain([i, 'optionalAccess', _126 => _126[s]]):s}function Fe(r){let{state:t,path:e,value:i,isHidden:s,isRequired:a,isDirty:o,isValidating:n}=r,d=e;return{value:i,error:t.errors[d],touched:!!t.touched[d],isHidden:s,isRequired:a,isDirty:o,isValidating:n}}function Ce(r){let t=()=>r.read.getState();return{read:{get storeId(){return r.identity.storeId},get config(){return r.identity.config},get isValid(){return r.read.getIsValid()},get isSubmitting(){return r.read.getIsSubmitting()},get isDirty(){return r.read.getIsDirty()},getState:t,getFieldConfig:o=>r.getFieldConfig(o),getFieldState:o=>r.read.getFieldState(o),isHidden:o=>r.read.isHidden(o),isRequired:o=>r.read.isRequired(o),isFieldDirty:o=>r.read.isFieldDirty(o),isFieldValidating:o=>r.read.isFieldValidating(o),getDirtyValues:()=>r.read.getDirtyValues(),getPersistMetadata:()=>r.read.getPersistMetadata(),getHistoryMetadata:()=>r.read.getHistoryMetadata(),getScopeStatus:o=>r.read.getScopeStatus(o),getScopeErrors:o=>r.read.getScopeErrors(o),getScopeFields:o=>r.read.getScopeFields(o)},observe:{getState:t,subscribe:o=>r.observe.subscribe(o),subscribePersistMeta:o=>r.observe.subscribePersistMeta(o),subscribeHistoryMeta:o=>r.observe.subscribeHistoryMeta(o),subscribeScopeStatus:(o,n)=>r.observe.subscribeScopeStatus(o,n),subscribeFormMeta:o=>r.observe.subscribeFormMeta(o),subscribeSelector:(o,n,d)=>r.observe.subscribeSelector(o,n,d),subscribePath:(o,n,d)=>r.observe.subscribePath(o,n,d),subscribeFieldState:(o,n)=>r.observe.subscribeFieldState(o,n)},write:{setField:(o,n)=>r.write.setField(o,n),blurField:o=>r.write.blurField(o),markFieldsTouched:o=>r.write.markFieldsTouched(o),setValues:(o,n)=>r.write.setValues(o,n),setError:(o,n)=>r.write.setError(o,n),setErrors:o=>r.write.setErrors(o),setServerErrors:o=>r.write.setServerErrors(o),validate:o=>r.feature.validate(o),triggerValidation:(o,n)=>r.feature.triggerValidation(o,n),reset:()=>r.write.reset(),transaction:o=>r.write.transaction(o),submit:o=>r.write.submit(o)},feature:{cleanup:()=>r.feature.cleanup(),getPersistMetadata:()=>r.read.getPersistMetadata(),restorePersisted:()=>r.feature.restorePersisted(),forceSave:()=>r.feature.forceSave(),clearPersisted:()=>r.feature.clearPersisted(),registerField:(o,n)=>r.write.registerField(o,n),unregisterField:o=>r.write.unregisterField(o),unregisterPrefix:o=>r.write.unregisterPrefix(o),pushItem:(o,n)=>r.write.pushItem(o,n),prependItem:(o,n)=>r.write.prependItem(o,n),insertItem:(o,n,d)=>r.write.insertItem(o,n,d),removeItem:(o,n)=>r.write.removeItem(o,n),moveItem:(o,n,d)=>r.write.moveItem(o,n,d),swapItems:(o,n,d)=>r.write.swapItems(o,n,d),replaceItems:(o,n)=>r.write.replaceItems(o,n),clearItems:o=>r.write.clearItems(o),get canUndo(){return r.read.getCanUndo()},get canRedo(){return r.read.getCanRedo()},hasValidationsInProgress:o=>r.feature.hasValidationsInProgress(o),resolveMask:o=>r.resolveMask(o),createArrayItemId:(o,n)=>r.createArrayItemId(o,n),undo:()=>r.feature.undo(),redo:()=>r.feature.redo()}}}function Ve(r){let{dispatch:t,effects:e}=r;return qt({dispatch:t,effects:e})}function we(r){let{dispatch:t,effects:e}=r;return zt({dispatch:t,effects:e})}function De(r){let{dispatch:t,effects:e}=r;return Ut({dispatch:t,effects:e})}function Ae(r){let{history:t,applyHistoryState:e}=r,i=t.undo();i&&e(i)}function Re(r){let{history:t,applyHistoryState:e}=r,i=t.redo();i&&e(i)}function Me(r){return r.history.getMetadata()}function ke(r,t){let e=new Set,i=(o,n)=>o===null||typeof o!="object"?o:new Proxy(o,{get:(d,p,l)=>{if(typeof p=="symbol")return Reflect.get(d,p,l);let c=String(p),u=n?`${n}.${c}`:c;e.add(u);let h=Reflect.get(d,p,l);return i(h,u)}}),s=i(r,"");t(s);let a=new Set;return e.forEach(o=>{let n=ci(o);n&&a.add(n)}),Array.from(a)}function ci(r){if(r)return r==="values"?"*":r.startsWith("values.")?r.slice(7):r==="errors"||r==="touched"||r==="isValidating"?"*":r.startsWith("errors.")?r.slice(7):r.startsWith("touched.")?r.slice(8):r.startsWith("isValidating.")?r.slice(13):r==="persist"||r.startsWith("persist.")?"persist":r}function pi(r,t){if(r.length!==t.length)return!1;let e=new Set(t);for(let i of r)if(!e.has(i))return!1;return!0}function ui(r,t){return r.length===0?{emitImmediately:_optionalChain([t, 'optionalAccess', _127 => _127.emitImmediately]),equalityFn:_optionalChain([t, 'optionalAccess', _128 => _128.equalityFn]),mode:"scoped",paths:["*"]}:{emitImmediately:_optionalChain([t, 'optionalAccess', _129 => _129.emitImmediately]),equalityFn:_optionalChain([t, 'optionalAccess', _130 => _130.equalityFn]),mode:"scoped",paths:r}}function Ie(r){let{getState:t,subscribeSelector:e,selector:i,listener:s,options:a}=r,o=null,n=ke(t(),i),d=!1,p=!1,l=c=>{o=e(i,u=>{s(u);let h=ke(t(),i);pi(n,h)||(n=h,!(p||d)&&(p=!0,queueMicrotask(()=>{p=!1,!d&&(_optionalChain([o, 'optionalCall', _131 => _131()]),l(n))})))},ui(c,a))};return l(n),()=>{d=!0,_optionalChain([o, 'optionalCall', _132 => _132()]),o=null}}function Oe(r){let{getState:t,subscriptions:e,selector:i,listener:s,options:a}=r,o=_nullishCoalesce(_optionalChain([a, 'optionalAccess', _133 => _133.equalityFn]), () => (_chunkT2JRSWQUcjs.c));return _optionalChain([a, 'optionalAccess', _134 => _134.mode])==="tracked"?Ie({getState:t,subscribeSelector:(n,d,p)=>e.subscribeSelector(n,d,p,o),selector:i,listener:s,options:a}):e.subscribeSelector(i,s,a,o)}function je(r){let{path:t,listener:e,options:i,subscribeSelector:s}=r,a=[..._nullishCoalesce(_optionalChain([i, 'optionalAccess', _135 => _135.paths]), () => ([])),t];return s(o=>_chunkT2JRSWQUcjs.f.call(void 0, o.values,t),e,{...i,paths:a})}function He(r){let{path:t,listener:e,getFieldState:i,subscribeSelector:s}=r;return s(()=>i(t),e,{paths:[t],equalityFn:(a,o)=>a.value===o.value&&a.error===o.error&&a.touched===o.touched&&a.isHidden===o.isHidden&&a.isRequired===o.isRequired&&a.isDirty===o.isDirty&&a.isValidating===o.isValidating})}function qe(r){let{listener:t,subscribeSelector:e}=r;return e(i=>({isValid:i.isValid,isDirty:i.isDirty,isSubmitting:i.isSubmitting}),t,{paths:["isValid","isDirty","isSubmitting"],equalityFn:(i,s)=>i.isValid===s.isValid&&i.isDirty===s.isDirty&&i.isSubmitting===s.isSubmitting})}function ze(r){let{listener:t,subscribeSelector:e}=r;return e(i=>i.persist,t,{paths:["persist"],equalityFn:(i,s)=>i.isSaving===s.isSaving&&i.isRestoring===s.isRestoring&&i.error===s.error})}function Ue(r){let{readHistoryMeta:t,subscribeSelector:e,listener:i}=r;return e(()=>t(),i,{paths:[_chunkD7JQWF6Vcjs.h.call(void 0, )],equalityFn:(s,a)=>_chunkD7JQWF6Vcjs.e.call(void 0, s,a)})}function Ne(r){let{scopeName:t,getScopeFields:e,readScopeStatus:i,subscribeSelector:s,listener:a}=r,o=_chunkD7JQWF6Vcjs.d.call(void 0, t),n=i(t),d=()=>{},p=()=>{d();let c=_chunkD7JQWF6Vcjs.c.call(void 0, e(t));d=s(()=>i(t),u=>{_chunkD7JQWF6Vcjs.b.call(void 0, n,u)||(n=u,a(u))},{paths:[...c,o]})};p();let l=s(()=>e(t).length,()=>{p();let c=i(t);_chunkD7JQWF6Vcjs.b.call(void 0, n,c)||(n=c,a(c))},{paths:[o]});return()=>{d(),l()}}function _e(r){let{runtime:t,config:e,fieldRegistry:i,dirtyManager:s,stateReader:a}=r,o={getState:()=>a.getState(),getFieldState:l=>a.getFieldState(l),getIsValid:()=>a.getFlag("isValid"),getIsSubmitting:()=>a.getFlag("isSubmitting"),getIsDirty:()=>a.getFlag("isDirty"),isHidden:l=>t.capabilities.query.isHidden(l),isRequired:l=>t.capabilities.query.isRequired(l),isFieldDirty:l=>t.capabilities.query.isFieldDirty(l),isFieldValidating:l=>t.capabilities.query.isFieldValidating(l),getDirtyValues:()=>s.buildDirtyValues(a.getState().values),getPersistMetadata:()=>a.getPersistMetadata(),getHistoryMetadata:()=>Me({history:t.capabilities.history}),getScopeStatus:l=>t.capabilities.scope.getScopeStatus(l),getScopeErrors:l=>t.capabilities.scope.getScopeErrors(l),getCanUndo:()=>t.capabilities.history.canUndo,getCanRedo:()=>t.capabilities.history.canRedo,getScopeFields:l=>i.getScopeFields(l)},n={subscribe:l=>t.subscriptions.subscribe(l),subscribePersistMeta:l=>ze({listener:l,subscribeSelector:(c,u,h)=>n.subscribeSelector(c,u,h)}),subscribeHistoryMeta:l=>Ue({readHistoryMeta:()=>o.getHistoryMetadata(),subscribeSelector:(c,u,h)=>n.subscribeSelector(c,u,h),listener:l}),subscribeScopeStatus:(l,c)=>Ne({scopeName:l,getScopeFields:u=>o.getScopeFields(u),readScopeStatus:u=>o.getScopeStatus(u),subscribeSelector:(u,h,S)=>n.subscribeSelector(u,h,S),listener:c}),subscribeSelector:(l,c,u)=>Oe({getState:()=>o.getState(),subscriptions:t.subscriptions,selector:l,listener:c,options:u}),subscribePath:(l,c,u)=>je({path:l,listener:c,options:u,subscribeSelector:(h,S,B)=>n.subscribeSelector(h,S,B)}),subscribeFieldState:(l,c)=>He({path:l,listener:c,getFieldState:u=>o.getFieldState(u),subscribeSelector:(u,h,S)=>n.subscribeSelector(u,h,S)}),subscribeFormMeta:l=>qe({listener:l,subscribeSelector:(c,u,h)=>n.subscribeSelector(c,u,h)})};return{read:o,observe:n,write:{registerField:(l,c)=>{jt({path:l,config:c,state:t.getState(),fieldRegistry:i,subscriptions:t.subscriptions,stateReader:a,invalidateFieldIndexes:()=>{i.invalidateIndexes()}})},unregisterField:l=>{Ht({path:l,state:t.getState(),hasStaticConfig:!!_optionalChain([e, 'access', _136 => _136.fields, 'optionalAccess', _137 => _137[l]]),fieldRegistry:i,subscriptions:t.subscriptions,validationCleanupField:c=>t.capabilities.validation.cleanupField(c),invalidateFieldIndexes:()=>{i.invalidateIndexes()},dispatch:c=>t.dispatch(c)})},unregisterPrefix:l=>{G({prefix:l,state:t.getState(),fieldRegistry:i,subscriptions:t.subscriptions,validationCleanupPrefix:c=>t.capabilities.validation.cleanupPrefix(c),invalidateFieldIndexes:()=>{i.invalidateIndexes()}})},setField:(l,c)=>{t.runBatch(()=>{t.capabilities.lifecycle.updateField(l,c,{origin:"setField"})})},blurField:l=>{t.capabilities.query.isTouched(l)||t.runBatch(()=>{t.dispatch(vt([l]))}),t.capabilities.validation.trigger([l])},markFieldsTouched:l=>{l.length!==0&&t.dispatch(vt(l))},setValues:(l,c)=>{t.capabilities.lifecycle.setValues(l,c)},setError:(l,c)=>{t.capabilities.error.setError(l,c)},setErrors:l=>{t.capabilities.error.setErrors(l)},setServerErrors:l=>{t.capabilities.error.setServerErrors(l)},reset:()=>{t.runBatch(()=>{t.capabilities.lifecycle.reset()})},transaction:l=>t.runBatch(l),submit:l=>t.capabilities.lifecycle.submit(l),pushItem:(l,c)=>t.capabilities.arrays.pushItem(l,c),prependItem:(l,c)=>t.capabilities.arrays.prependItem(l,c),insertItem:(l,c,u)=>t.capabilities.arrays.insertItem(l,c,u),removeItem:(l,c)=>t.capabilities.arrays.removeItem(l,c),swapItems:(l,c,u)=>t.capabilities.arrays.swapItems(l,c,u),moveItem:(l,c,u)=>t.capabilities.arrays.moveItem(l,c,u),replaceItems:(l,c)=>t.capabilities.arrays.replaceItems(l,c),clearItems:l=>t.capabilities.arrays.clearItems(l)},feature:{undo:()=>{Ae({history:t.capabilities.history,applyHistoryState:l=>t.capabilities.lifecycle.applyHistoryState(l)})},redo:()=>{Re({history:t.capabilities.history,applyHistoryState:l=>t.capabilities.lifecycle.applyHistoryState(l)})},validate:l=>t.capabilities.validation.validate(l),hasValidationsInProgress:l=>t.capabilities.validation.hasValidationsInProgress(l),triggerValidation:(l,c)=>t.capabilities.validation.trigger(l,c),restorePersisted:()=>Ve({dispatch:l=>t.dispatch(l),effects:t.effects}),forceSave:()=>we({dispatch:l=>t.dispatch(l),effects:t.effects}),clearPersisted:()=>De({dispatch:l=>t.dispatch(l),effects:t.effects}),cleanup:()=>t.cleanup()}}}var ft= (_class17 =class{constructor(t){;_class17.prototype.__init52.call(this);this.deps=t}__init52() {this.fieldStateCache=new Map}getState(){return this.deps.getState()}getFlag(t){return this.deps.getState()[t]}getPersistMetadata(){return this.deps.getState().persist}getFieldState(t){let e=t,i=this.deps.getState(),s=this.fieldStateCache.get(e);if(_optionalChain([s, 'optionalAccess', _138 => _138.state])===i)return s.snapshot;let a=_chunkT2JRSWQUcjs.f.call(void 0, i.values,e),o=Fe({state:i,path:t,value:a,isHidden:this.deps.isHidden(e),isRequired:this.deps.isRequired(e),isDirty:this.deps.isFieldDirty(e),isValidating:this.deps.isFieldValidating(e)});return this.fieldStateCache.set(e,{state:i,snapshot:o}),o}invalidatePath(t){this.fieldStateCache.delete(t)}}, _class17);var mt= (_class18 =class{__init53() {this[k]=!0}__init54() {this[M]=!0}constructor(t={}){;_class18.prototype.__init53.call(this);_class18.prototype.__init54.call(this);let i=xe({rawConfig:t,storeBusPort:{getState:()=>this.read.getState(),getHistoryMetadata:()=>this.read.getHistoryMetadata(),undo:()=>this.feature.undo(),redo:()=>this.feature.redo(),reset:()=>this.write.reset()}});this._config=i.config,this.storeId=i.storeId;let s=new ft({getState:()=>i.runtime.getState(),isHidden:n=>i.runtime.capabilities.query.isHidden(n),isRequired:n=>i.runtime.capabilities.query.isRequired(n),isFieldDirty:n=>i.runtime.capabilities.query.isFieldDirty(n),isFieldValidating:n=>i.runtime.capabilities.query.isFieldValidating(n)}),a=_e({runtime:i.runtime,config:this._config,fieldRegistry:i.fieldRegistry,dirtyManager:i.dirtyManager,stateReader:s}),o=Ce({identity:{storeId:this.storeId,config:this._config},read:a.read,observe:a.observe,write:a.write,feature:a.feature,getFieldConfig:n=>i.fieldRegistry.getFieldConfig(n),resolveMask:n=>Ee({path:n,getFieldConfig:d=>i.fieldRegistry.getFieldConfig(d),masks:i.maskManager.getAllMasks()}),createArrayItemId:(n,d)=>this._config.idFactory({scope:"array",path:n,index:d})});this.read=o.read,this.observe=o.observe,this.write=o.write,this.feature=o.feature}}, _class18);function Le(r={}){return new mt(r)}function We(r){if(!r||typeof r!="object")return!1;let t=r;return t[k]===!0&&!!t.read&&!!t.observe&&!!t.write&&!!t.feature}function hi(r){if(We(r))return r;throw new Error("BitForm: o store informado n\xE3o exp\xF5e a API necess\xE1ria para hooks/framework bindings.")}function gi(r){return!r||typeof r!="object"?!1:r[M]===!0}function fi(r){if(!We(r))throw new Error("BitForm: o store informado n\xE3o possui branding de hooks (BIT_HOOKS_API_SYMBOL).");if(!gi(r))throw new Error("BitForm: o store informado n\xE3o possui branding de framework (BIT_FRAMEWORK_STORE_SYMBOL).");return r}function mi(r){return Object.defineProperty(r,k,{value:!0,enumerable:!1,configurable:!1,writable:!1}),Object.defineProperty(r,M,{value:!0,enumerable:!1,configurable:!1,writable:!1}),r}function yi(r={}){let t=Le(r),e={read:t.read,observe:t.observe,write:t.write,feature:t.feature};return mi(e)}function Si(r){return r.read}function bi(r){return r.observe}function Bi(r){return r.write}function Ti(r){return r.feature}function vi(r,t){let e={};for(let i of t)e[i]=r[i];return e}exports.a = Tt; exports.b = ei; exports.c = hi; exports.d = fi; exports.e = yi; exports.f = Si; exports.g = bi; exports.h = Bi; exports.i = Ti; exports.j = vi;
|
|
2
|
+
//# sourceMappingURL=chunk-VZHG372Q.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/bit-form/bit-form/dist/chunk-VZHG372Q.cjs","../src/core/store/orchestration/framework-store-brand.ts","../src/core/store/orchestration/hook-brand.ts","../src/core/store/shared/value-derivation-pipeline.ts"],"names":["BIT_FRAMEWORK_STORE_SYMBOL","BIT_HOOKS_API_SYMBOL","mergeChangedPaths","previous","next","merged","path","collectChangedValueUpdates","args","values","entries","deriveValue","updates","entry","currentValue","getDeepValue","derivedValue","valueEqual","createDependencyImpactChecker","changedPaths","hasWildcardChange","dependencyPath","changedPath"],"mappings":"AAAA,29BAAuE,wDAA2G,ICArKA,CAAAA,CAA6B,MAAA,CAAO,GAAA,CAC/C,8BACF,CAAA,CCFO,IAAMC,CAAAA,CAAuB,MAAA,CAAO,GAAA,CAAI,oBAAoB,CAAA,CCSnE,SAASC,EAAAA,CACPC,CAAAA,CACAC,CAAAA,CACsB,CACtB,EAAA,CAAA,CAAK,CAACD,CAAAA,EAAYA,CAAAA,CAAS,MAAA,GAAW,CAAA,CAAA,EAAA,CAAO,CAACC,CAAAA,EAAQA,CAAAA,CAAK,MAAA,GAAW,CAAA,CAAA,CACpE,MAAA,CAGF,IAAMC,CAAAA,CAAS,IAAI,GAAA,kBAAYF,CAAAA,SAAY,CAAC,GAAC,CAAA,CAC7C,uBAAAC,CAAAA,6BAAM,OAAA,mBAASE,CAAAA,EAASD,CAAAA,CAAO,GAAA,CAAIC,CAAI,CAAC,GAAA,CACjC,KAAA,CAAM,IAAA,CAAKD,CAAM,CAC1B,CAEA,SAASE,EAAAA,CAGPC,CAAAA,CAI2B,CAC3B,GAAM,CAAE,MAAA,CAAAC,CAAAA,CAAQ,OAAA,CAAAC,CAAAA,CAAS,WAAA,CAAAC,CAAY,CAAA,CAAIH,CAAAA,CACnCI,CAAAA,CAAoC,CAAC,CAAA,CAE3C,GAAA,CAAA,IAAWC,EAAAA,GAASH,CAAAA,CAAS,CAC3B,IAAMI,CAAAA,CAAeC,iCAAAA,CAAaN,CAAQI,CAAAA,CAAM,IAAI,CAAA,CAC9CG,CAAAA,CAAeL,CAAAA,CAAYE,CAAAA,CAAOC,CAAY,CAAA,CAE/CG,iCAAAA,CAAWH,CAAcE,CAAY,CAAA,EACxCJ,CAAAA,CAAQ,IAAA,CAAK,CAACC,CAAAA,CAAM,IAAA,CAAMG,CAAY,CAAC,CAE3C,CAEA,OAAOJ,CACT,CAEO,SAASM,EAAAA,CACdC,CAAAA,CACA,CACA,IAAMC,CAAAA,kCAAoBD,CAAAA,6BAAc,QAAA,mBAAS,GAAG,GAAA,SAAK,CAAA,GAAA,CAEzD,OAAQE,CAAAA,EACF,CAACF,CAAAA,EAAgBA,CAAAA,CAAa,MAAA,GAAW,CAAA,EAAKC,CAAAA,CACzC,CAAA,CAAA,CAGFD,CAAAA,CAAa,IAAA,CACjBG,CAAAA,EACCD,CAAAA,GAAmBC,CAAAA,EACnBD,CAAAA,CAAe,UAAA,CAAW,CAAA,EAAA","file":"/home/runner/work/bit-form/bit-form/dist/chunk-VZHG372Q.cjs","sourcesContent":[null,"export const BIT_FRAMEWORK_STORE_SYMBOL = Symbol.for(\n \"bit-form.framework-store-api\",\n);\n","export const BIT_HOOKS_API_SYMBOL = Symbol.for(\"bit-form.hooks-api\");\n","import { getDeepValue, setDeepValues, valueEqual } from \"../../utils\";\nimport type { BitTransformFn } from \"../contracts/types\";\nimport type { BitNormalizerEntry } from \"../registry/field-catalog\";\n\ninterface BitDependencyAwareEntry {\n path: string;\n dependsOn: readonly string[];\n}\n\nfunction mergeChangedPaths(\n previous?: readonly string[],\n next?: readonly string[],\n): string[] | undefined {\n if ((!previous || previous.length === 0) && (!next || next.length === 0)) {\n return undefined;\n }\n\n const merged = new Set<string>(previous ?? []);\n next?.forEach((path) => merged.add(path));\n return Array.from(merged);\n}\n\nfunction collectChangedValueUpdates<\n T extends object,\n TEntry extends { path: string },\n>(args: {\n values: T;\n entries: readonly TEntry[];\n deriveValue: (entry: TEntry, currentValue: unknown) => unknown;\n}): Array<[string, unknown]> {\n const { values, entries, deriveValue } = args;\n const updates: Array<[string, unknown]> = [];\n\n for (const entry of entries) {\n const currentValue = getDeepValue(values, entry.path);\n const derivedValue = deriveValue(entry, currentValue);\n\n if (!valueEqual(currentValue, derivedValue)) {\n updates.push([entry.path, derivedValue]);\n }\n }\n\n return updates;\n}\n\nexport function createDependencyImpactChecker(\n changedPaths?: readonly string[],\n) {\n const hasWildcardChange = changedPaths?.includes(\"*\") ?? false;\n\n return (dependencyPath: string) => {\n if (!changedPaths || changedPaths.length === 0 || hasWildcardChange) {\n return true;\n }\n\n return changedPaths.some(\n (changedPath) =>\n dependencyPath === changedPath ||\n dependencyPath.startsWith(`${changedPath}.`) ||\n changedPath.startsWith(`${dependencyPath}.`),\n );\n };\n}\n\nexport function filterDependencyEntries<TEntry extends BitDependencyAwareEntry>(\n entries: readonly TEntry[],\n changedPaths?: readonly string[],\n): readonly TEntry[] {\n if (\n !changedPaths ||\n changedPaths.length === 0 ||\n changedPaths.includes(\"*\")\n ) {\n return entries;\n }\n\n const isDependencyImpacted = createDependencyImpactChecker(changedPaths);\n return entries.filter((entry) =>\n entry.dependsOn.some((dependencyPath) =>\n isDependencyImpacted(dependencyPath),\n ),\n );\n}\n\nexport function applyValueDerivations<T extends object>(args: {\n values: T;\n changedPaths?: readonly string[];\n normalizerEntries: readonly BitNormalizerEntry<T>[];\n applyComputed: (values: T, changedPaths?: readonly string[]) => T;\n}): T {\n const { values, changedPaths, normalizerEntries, applyComputed } = args;\n\n const targetedNormalizers = filterDependencyEntries(\n normalizerEntries,\n changedPaths,\n );\n\n if (targetedNormalizers.length === 0) {\n return applyComputed(values, changedPaths);\n }\n\n const normalizerUpdates = collectChangedValueUpdates({\n values,\n entries: targetedNormalizers,\n deriveValue: (entry, currentValue) => entry.normalize(currentValue, values),\n });\n\n const normalizedValues =\n normalizerUpdates.length > 0\n ? setDeepValues(values, normalizerUpdates)\n : values;\n const nextChangedPaths = mergeChangedPaths(\n changedPaths,\n normalizerUpdates.map(([path]) => path),\n );\n\n return applyComputed(normalizedValues, nextChangedPaths);\n}\n\nexport function applyTransformDerivations<T extends object>(args: {\n values: T;\n sourceValues: T;\n transformEntries: readonly [string, BitTransformFn<T>][];\n}): T {\n const { values, sourceValues, transformEntries } = args;\n if (transformEntries.length === 0) {\n return values;\n }\n\n const updates = collectChangedValueUpdates({\n values,\n entries: transformEntries.map(([path, transform]) => ({ path, transform })),\n deriveValue: (entry, currentValue) =>\n entry.transform(currentValue, sourceValues),\n });\n\n if (updates.length === 0) {\n return values;\n }\n\n return setDeepValues(values, updates);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/scope-status.ts"],"sourcesContent":["import type { ScopeStatus } from \"./store/contracts/types\";\nexport {\n areScopeErrorsEqual,\n isScopeStatusEqual,\n getScopeSubscriptionPaths,\n} from \"./store/shared/scope-status\";\n\nexport function observeScopeStatusSnapshot(\n store: {\n read: {\n getScopeStatus(scopeName: string): ScopeStatus;\n };\n observe: {\n subscribeScopeStatus(\n scopeName: string,\n listener: (status: ScopeStatus) => void,\n ): () => void;\n };\n },\n scopeName: string,\n listener: (status: ScopeStatus) => void,\n): () => void {\n listener(store.read.getScopeStatus(scopeName));\n\n return store.observe.subscribeScopeStatus(scopeName, listener);\n}\n"],"mappings":"AAOO,SAASA,EACdC,EAWAC,EACAC,EACY,CACZ,OAAAA,EAASF,EAAM,KAAK,eAAeC,CAAS,CAAC,EAEtCD,EAAM,QAAQ,qBAAqBC,EAAWC,CAAQ,CAC/D","names":["observeScopeStatusSnapshot","store","scopeName","listener"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";//# sourceMappingURL=chunk-W5CLDRRE.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/bit-form/bit-form/dist/chunk-W5CLDRRE.cjs"],"names":[],"mappings":"AAAA","file":"/home/runner/work/bit-form/bit-form/dist/chunk-W5CLDRRE.cjs"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkMFTWAFMGcjs = require('../chunk-MFTWAFMG.cjs');require('../chunk-T2JRSWQU.cjs');var _chunkPFPGASVZcjs = require('../chunk-PFPGASVZ.cjs');exports.cleanupRegisteredField = _chunkMFTWAFMGcjs.j; exports.cleanupRegisteredPrefix = _chunkMFTWAFMGcjs.k; exports.createArrayBindingController = _chunkMFTWAFMGcjs.i; exports.createFrameworkFormBinding = _chunkMFTWAFMGcjs.g; exports.createFrameworkMaskedFieldBinding = _chunkMFTWAFMGcjs.h; exports.formatMaskedValue = _chunkPFPGASVZcjs.b; exports.isBitFieldInputEventObject = _chunkPFPGASVZcjs.a; exports.observeFormMetaSnapshot = _chunkMFTWAFMGcjs.c; exports.observePersistMetaSnapshot = _chunkMFTWAFMGcjs.f; exports.parseMaskedInput = _chunkPFPGASVZcjs.c; exports.readFormMetaSnapshot = _chunkMFTWAFMGcjs.a; exports.readPersistMetaSnapshot = _chunkMFTWAFMGcjs.d; exports.subscribeFormMetaSnapshot = _chunkMFTWAFMGcjs.b; exports.subscribePersistMetaSnapshot = _chunkMFTWAFMGcjs.e;
|
|
2
|
+
//# sourceMappingURL=bindings.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/bit-form/bit-form/dist/core/bindings.cjs"],"names":[],"mappings":"AAAA,kIAA4E,iCAA8B,yDAAwD,+wBAA4a","file":"/home/runner/work/bit-form/bit-form/dist/core/bindings.cjs"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { B as BitFormMeta, b as BitValidationOptions } from '../meta-types-Bzmm21TP.cjs';
|
|
2
|
+
import { e as BitStoreApi } from '../store-api-types-D-ZHxzRy.cjs';
|
|
3
|
+
import { x as BitPersistMetadata, u as BitPath, v as BitPathValue, L as DeepPartial } from '../types-D6LhF5GC.cjs';
|
|
4
|
+
import '../bus-ZLQeq4Vr.cjs';
|
|
5
|
+
export { B as BitArrayBindingController, a as BitArrayBindingField, c as createArrayBindingController } from '../array-controller-B5bfXV1W.cjs';
|
|
6
|
+
export { B as BitFieldInputEvent, f as formatMaskedValue, i as isBitFieldInputEventObject, p as parseMaskedInput } from '../field-binding-B_OX3bjp.cjs';
|
|
7
|
+
export { B as BitDeleteUploadFn, a as BitUploadFn, b as BitUploadResult } from '../upload-C2mpfhp1.cjs';
|
|
8
|
+
import '../types-D8DgIUhJ.cjs';
|
|
9
|
+
|
|
10
|
+
declare function readFormMetaSnapshot<T extends object>(store: BitStoreApi<T>): BitFormMeta;
|
|
11
|
+
declare function subscribeFormMetaSnapshot<T extends object>(store: BitStoreApi<T>, listener: () => void): () => void;
|
|
12
|
+
declare function observeFormMetaSnapshot<T extends object>(store: BitStoreApi<T>, listener: (meta: BitFormMeta) => void): () => void;
|
|
13
|
+
|
|
14
|
+
declare function readPersistMetaSnapshot(store: {
|
|
15
|
+
read: {
|
|
16
|
+
getPersistMetadata(): BitPersistMetadata;
|
|
17
|
+
};
|
|
18
|
+
}): BitPersistMetadata;
|
|
19
|
+
declare function subscribePersistMetaSnapshot(store: BitStoreApi<any>, listener: () => void): () => void;
|
|
20
|
+
declare function observePersistMetaSnapshot(store: BitStoreApi<any>, listener: (meta: BitPersistMetadata) => void): () => void;
|
|
21
|
+
|
|
22
|
+
type BitFormDomEvent = {
|
|
23
|
+
preventDefault?: () => void;
|
|
24
|
+
stopPropagation?: () => void;
|
|
25
|
+
};
|
|
26
|
+
interface BitFormControllerRuntime {
|
|
27
|
+
clearSubmissionState: () => void;
|
|
28
|
+
setSubmissionResult: (result: unknown) => void;
|
|
29
|
+
setSubmissionError: (error: Error | null) => void;
|
|
30
|
+
}
|
|
31
|
+
interface BitFormControllerOptions {
|
|
32
|
+
stopPropagation?: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
declare function createFrameworkFormBinding<T extends object>(store: BitStoreApi<T>, runtime: BitFormControllerRuntime, options?: BitFormControllerOptions): {
|
|
36
|
+
controller: {
|
|
37
|
+
submit: (onSuccess: (values: T, dirtyValues?: Partial<T> | undefined) => void | Promise<void>) => (event?: BitFormDomEvent) => Promise<void>;
|
|
38
|
+
onSubmit: (handler: (values: T, dirtyValues?: Partial<T> | undefined) => Promise<unknown>) => (event?: BitFormDomEvent) => Promise<void>;
|
|
39
|
+
reset: () => void;
|
|
40
|
+
getValues: () => T;
|
|
41
|
+
getErrors: () => Partial<Record<BitPath<T, "">, string | undefined>>;
|
|
42
|
+
getTouched: () => Partial<Record<BitPath<T, "">, boolean | undefined>>;
|
|
43
|
+
getDirtyValues: () => Partial<T>;
|
|
44
|
+
};
|
|
45
|
+
actions: {
|
|
46
|
+
setField: <P extends BitPath<T, "">>(path: P, value: BitPathValue<T, P>) => void;
|
|
47
|
+
blurField: <P extends BitPath<T, "">>(path: P) => void;
|
|
48
|
+
setValues: (values: T | DeepPartial<T>, options?: {
|
|
49
|
+
partial?: boolean;
|
|
50
|
+
rebase?: boolean;
|
|
51
|
+
}) => void;
|
|
52
|
+
setError: (path: string, message: string | undefined) => void;
|
|
53
|
+
setErrors: (errors: Partial<Record<BitPath<T, "">, string | undefined>>) => void;
|
|
54
|
+
setServerErrors: (serverErrors: Record<string, string[] | string>) => void;
|
|
55
|
+
validate: (options?: BitValidationOptions) => Promise<boolean>;
|
|
56
|
+
transaction: <TResult>(callback: () => TResult) => TResult;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
declare function createFrameworkMaskedFieldBinding<TForm extends object, P extends BitPath<TForm>>(store: BitStoreApi<TForm>, path: P): {
|
|
61
|
+
fieldController: {
|
|
62
|
+
setValue: (value: unknown) => void;
|
|
63
|
+
setBlur: () => void;
|
|
64
|
+
displayValue: (value: unknown) => string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
type FieldCleanupStore = {
|
|
69
|
+
feature?: {
|
|
70
|
+
unregisterField?: (path: string) => void;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
type PrefixCleanupStore = {
|
|
74
|
+
feature?: {
|
|
75
|
+
unregisterPrefix?: (prefix: string) => void;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
declare function cleanupRegisteredField(store: FieldCleanupStore, path: string): void;
|
|
79
|
+
declare function cleanupRegisteredPrefix(store: PrefixCleanupStore, prefix: string): void;
|
|
80
|
+
|
|
81
|
+
export { cleanupRegisteredField, cleanupRegisteredPrefix, createFrameworkFormBinding, createFrameworkMaskedFieldBinding, observeFormMetaSnapshot, observePersistMetaSnapshot, readFormMetaSnapshot, readPersistMetaSnapshot, subscribeFormMetaSnapshot, subscribePersistMetaSnapshot };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { B as BitFormMeta, b as BitValidationOptions } from '../meta-types-Bzmm21TP.js';
|
|
2
|
+
import { e as BitStoreApi } from '../store-api-types-DPi30jQF.js';
|
|
3
|
+
import { x as BitPersistMetadata, u as BitPath, v as BitPathValue, L as DeepPartial } from '../types-CG5nYeRk.js';
|
|
4
|
+
import '../bus-B2VEKrPI.js';
|
|
5
|
+
export { B as BitArrayBindingController, a as BitArrayBindingField, c as createArrayBindingController } from '../array-controller-Cx-DMH7Y.js';
|
|
6
|
+
export { B as BitFieldInputEvent, f as formatMaskedValue, i as isBitFieldInputEventObject, p as parseMaskedInput } from '../field-binding-MX6jVQbT.js';
|
|
7
|
+
export { B as BitDeleteUploadFn, a as BitUploadFn, b as BitUploadResult } from '../upload-C2mpfhp1.js';
|
|
8
|
+
import '../types-D8DgIUhJ.js';
|
|
9
|
+
|
|
10
|
+
declare function readFormMetaSnapshot<T extends object>(store: BitStoreApi<T>): BitFormMeta;
|
|
11
|
+
declare function subscribeFormMetaSnapshot<T extends object>(store: BitStoreApi<T>, listener: () => void): () => void;
|
|
12
|
+
declare function observeFormMetaSnapshot<T extends object>(store: BitStoreApi<T>, listener: (meta: BitFormMeta) => void): () => void;
|
|
13
|
+
|
|
14
|
+
declare function readPersistMetaSnapshot(store: {
|
|
15
|
+
read: {
|
|
16
|
+
getPersistMetadata(): BitPersistMetadata;
|
|
17
|
+
};
|
|
18
|
+
}): BitPersistMetadata;
|
|
19
|
+
declare function subscribePersistMetaSnapshot(store: BitStoreApi<any>, listener: () => void): () => void;
|
|
20
|
+
declare function observePersistMetaSnapshot(store: BitStoreApi<any>, listener: (meta: BitPersistMetadata) => void): () => void;
|
|
21
|
+
|
|
22
|
+
type BitFormDomEvent = {
|
|
23
|
+
preventDefault?: () => void;
|
|
24
|
+
stopPropagation?: () => void;
|
|
25
|
+
};
|
|
26
|
+
interface BitFormControllerRuntime {
|
|
27
|
+
clearSubmissionState: () => void;
|
|
28
|
+
setSubmissionResult: (result: unknown) => void;
|
|
29
|
+
setSubmissionError: (error: Error | null) => void;
|
|
30
|
+
}
|
|
31
|
+
interface BitFormControllerOptions {
|
|
32
|
+
stopPropagation?: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
declare function createFrameworkFormBinding<T extends object>(store: BitStoreApi<T>, runtime: BitFormControllerRuntime, options?: BitFormControllerOptions): {
|
|
36
|
+
controller: {
|
|
37
|
+
submit: (onSuccess: (values: T, dirtyValues?: Partial<T> | undefined) => void | Promise<void>) => (event?: BitFormDomEvent) => Promise<void>;
|
|
38
|
+
onSubmit: (handler: (values: T, dirtyValues?: Partial<T> | undefined) => Promise<unknown>) => (event?: BitFormDomEvent) => Promise<void>;
|
|
39
|
+
reset: () => void;
|
|
40
|
+
getValues: () => T;
|
|
41
|
+
getErrors: () => Partial<Record<BitPath<T, "">, string | undefined>>;
|
|
42
|
+
getTouched: () => Partial<Record<BitPath<T, "">, boolean | undefined>>;
|
|
43
|
+
getDirtyValues: () => Partial<T>;
|
|
44
|
+
};
|
|
45
|
+
actions: {
|
|
46
|
+
setField: <P extends BitPath<T, "">>(path: P, value: BitPathValue<T, P>) => void;
|
|
47
|
+
blurField: <P extends BitPath<T, "">>(path: P) => void;
|
|
48
|
+
setValues: (values: T | DeepPartial<T>, options?: {
|
|
49
|
+
partial?: boolean;
|
|
50
|
+
rebase?: boolean;
|
|
51
|
+
}) => void;
|
|
52
|
+
setError: (path: string, message: string | undefined) => void;
|
|
53
|
+
setErrors: (errors: Partial<Record<BitPath<T, "">, string | undefined>>) => void;
|
|
54
|
+
setServerErrors: (serverErrors: Record<string, string[] | string>) => void;
|
|
55
|
+
validate: (options?: BitValidationOptions) => Promise<boolean>;
|
|
56
|
+
transaction: <TResult>(callback: () => TResult) => TResult;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
declare function createFrameworkMaskedFieldBinding<TForm extends object, P extends BitPath<TForm>>(store: BitStoreApi<TForm>, path: P): {
|
|
61
|
+
fieldController: {
|
|
62
|
+
setValue: (value: unknown) => void;
|
|
63
|
+
setBlur: () => void;
|
|
64
|
+
displayValue: (value: unknown) => string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
type FieldCleanupStore = {
|
|
69
|
+
feature?: {
|
|
70
|
+
unregisterField?: (path: string) => void;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
type PrefixCleanupStore = {
|
|
74
|
+
feature?: {
|
|
75
|
+
unregisterPrefix?: (prefix: string) => void;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
declare function cleanupRegisteredField(store: FieldCleanupStore, path: string): void;
|
|
79
|
+
declare function cleanupRegisteredPrefix(store: PrefixCleanupStore, prefix: string): void;
|
|
80
|
+
|
|
81
|
+
export { cleanupRegisteredField, cleanupRegisteredPrefix, createFrameworkFormBinding, createFrameworkMaskedFieldBinding, observeFormMetaSnapshot, observePersistMetaSnapshot, readFormMetaSnapshot, readPersistMetaSnapshot, subscribeFormMetaSnapshot, subscribePersistMetaSnapshot };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g,h as k,i as l,j as m,k as n}from"../chunk-E2NZR44P.js";import"../chunk-RD73EBSN.js";import{a as h,b as i,c as j}from"../chunk-3NUJVIAM.js";export{m as cleanupRegisteredField,n as cleanupRegisteredPrefix,l as createArrayBindingController,g as createFrameworkFormBinding,k as createFrameworkMaskedFieldBinding,i as formatMaskedValue,h as isBitFieldInputEventObject,c as observeFormMetaSnapshot,f as observePersistMetaSnapshot,j as parseMaskedInput,a as readFormMetaSnapshot,d as readPersistMetaSnapshot,b as subscribeFormMetaSnapshot,e as subscribePersistMetaSnapshot};
|
|
2
|
+
//# sourceMappingURL=bindings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBSGJ3T5Scjs = require('../chunk-BSGJ3T5S.cjs');var _chunkD7JQWF6Vcjs = require('../chunk-D7JQWF6V.cjs');exports.areScopeErrorsEqual = _chunkD7JQWF6Vcjs.a; exports.getScopeSubscriptionPaths = _chunkD7JQWF6Vcjs.c; exports.isHistoryMetaEqual = _chunkD7JQWF6Vcjs.e; exports.isScopeStatusEqual = _chunkD7JQWF6Vcjs.b; exports.observeHistoryMetaSnapshot = _chunkD7JQWF6Vcjs.g; exports.observeScopeStatusSnapshot = _chunkBSGJ3T5Scjs.a; exports.readHistoryMetaSnapshot = _chunkD7JQWF6Vcjs.f;
|
|
2
|
+
//# sourceMappingURL=status.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/bit-form/bit-form/dist/core/status.cjs"],"names":[],"mappings":"AAAA,kIAAyC,yDAA8D,0XAA6M","file":"/home/runner/work/bit-form/bit-form/dist/core/status.cjs"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { a as BitHistoryMetadata } from '../meta-types-Bzmm21TP.cjs';
|
|
2
|
+
import { S as ScopeStatus } from '../types-D6LhF5GC.cjs';
|
|
3
|
+
export { V as ValidateScopeResult } from '../types-D6LhF5GC.cjs';
|
|
4
|
+
import '../types-D8DgIUhJ.cjs';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Subconjunto relevante de BitHistoryMetadata para comparação de igualdade.
|
|
8
|
+
* Evita re-renders/updates desnecessários quando o estado de histórico não muda.
|
|
9
|
+
*/
|
|
10
|
+
type HistoryMeta = Pick<BitHistoryMetadata, "canUndo" | "canRedo" | "historyIndex" | "historySize">;
|
|
11
|
+
/**
|
|
12
|
+
* Compara dois snapshots de metadata de histórico por valor.
|
|
13
|
+
* Retorna `true` quando todos os campos relevantes são idênticos,
|
|
14
|
+
* permitindo que os bindings de framework ignorem atualizações não relacionadas.
|
|
15
|
+
*/
|
|
16
|
+
declare function isHistoryMetaEqual(a: HistoryMeta, b: HistoryMeta): boolean;
|
|
17
|
+
declare function readHistoryMetaSnapshot<T extends object>(store: {
|
|
18
|
+
read: {
|
|
19
|
+
getHistoryMetadata(): BitHistoryMetadata;
|
|
20
|
+
};
|
|
21
|
+
}): HistoryMeta;
|
|
22
|
+
declare function observeHistoryMetaSnapshot<T extends object>(store: {
|
|
23
|
+
read: {
|
|
24
|
+
getHistoryMetadata(): BitHistoryMetadata;
|
|
25
|
+
};
|
|
26
|
+
observe: {
|
|
27
|
+
subscribeHistoryMeta(listener: (meta: BitHistoryMetadata) => void): () => void;
|
|
28
|
+
};
|
|
29
|
+
}, listener: (meta: HistoryMeta) => void): () => void;
|
|
30
|
+
|
|
31
|
+
declare function areScopeErrorsEqual(currentErrors: Record<string, string>, nextErrors: Record<string, string>): boolean;
|
|
32
|
+
declare function isScopeStatusEqual(currentStatus: ScopeStatus, nextStatus: ScopeStatus): boolean;
|
|
33
|
+
declare function getScopeSubscriptionPaths(scopeFields: readonly string[]): string[];
|
|
34
|
+
|
|
35
|
+
declare function observeScopeStatusSnapshot(store: {
|
|
36
|
+
read: {
|
|
37
|
+
getScopeStatus(scopeName: string): ScopeStatus;
|
|
38
|
+
};
|
|
39
|
+
observe: {
|
|
40
|
+
subscribeScopeStatus(scopeName: string, listener: (status: ScopeStatus) => void): () => void;
|
|
41
|
+
};
|
|
42
|
+
}, scopeName: string, listener: (status: ScopeStatus) => void): () => void;
|
|
43
|
+
|
|
44
|
+
export { type HistoryMeta, ScopeStatus, areScopeErrorsEqual, getScopeSubscriptionPaths, isHistoryMetaEqual, isScopeStatusEqual, observeHistoryMetaSnapshot, observeScopeStatusSnapshot, readHistoryMetaSnapshot };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { a as BitHistoryMetadata } from '../meta-types-Bzmm21TP.js';
|
|
2
|
+
import { S as ScopeStatus } from '../types-CG5nYeRk.js';
|
|
3
|
+
export { V as ValidateScopeResult } from '../types-CG5nYeRk.js';
|
|
4
|
+
import '../types-D8DgIUhJ.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Subconjunto relevante de BitHistoryMetadata para comparação de igualdade.
|
|
8
|
+
* Evita re-renders/updates desnecessários quando o estado de histórico não muda.
|
|
9
|
+
*/
|
|
10
|
+
type HistoryMeta = Pick<BitHistoryMetadata, "canUndo" | "canRedo" | "historyIndex" | "historySize">;
|
|
11
|
+
/**
|
|
12
|
+
* Compara dois snapshots de metadata de histórico por valor.
|
|
13
|
+
* Retorna `true` quando todos os campos relevantes são idênticos,
|
|
14
|
+
* permitindo que os bindings de framework ignorem atualizações não relacionadas.
|
|
15
|
+
*/
|
|
16
|
+
declare function isHistoryMetaEqual(a: HistoryMeta, b: HistoryMeta): boolean;
|
|
17
|
+
declare function readHistoryMetaSnapshot<T extends object>(store: {
|
|
18
|
+
read: {
|
|
19
|
+
getHistoryMetadata(): BitHistoryMetadata;
|
|
20
|
+
};
|
|
21
|
+
}): HistoryMeta;
|
|
22
|
+
declare function observeHistoryMetaSnapshot<T extends object>(store: {
|
|
23
|
+
read: {
|
|
24
|
+
getHistoryMetadata(): BitHistoryMetadata;
|
|
25
|
+
};
|
|
26
|
+
observe: {
|
|
27
|
+
subscribeHistoryMeta(listener: (meta: BitHistoryMetadata) => void): () => void;
|
|
28
|
+
};
|
|
29
|
+
}, listener: (meta: HistoryMeta) => void): () => void;
|
|
30
|
+
|
|
31
|
+
declare function areScopeErrorsEqual(currentErrors: Record<string, string>, nextErrors: Record<string, string>): boolean;
|
|
32
|
+
declare function isScopeStatusEqual(currentStatus: ScopeStatus, nextStatus: ScopeStatus): boolean;
|
|
33
|
+
declare function getScopeSubscriptionPaths(scopeFields: readonly string[]): string[];
|
|
34
|
+
|
|
35
|
+
declare function observeScopeStatusSnapshot(store: {
|
|
36
|
+
read: {
|
|
37
|
+
getScopeStatus(scopeName: string): ScopeStatus;
|
|
38
|
+
};
|
|
39
|
+
observe: {
|
|
40
|
+
subscribeScopeStatus(scopeName: string, listener: (status: ScopeStatus) => void): () => void;
|
|
41
|
+
};
|
|
42
|
+
}, scopeName: string, listener: (status: ScopeStatus) => void): () => void;
|
|
43
|
+
|
|
44
|
+
export { type HistoryMeta, ScopeStatus, areScopeErrorsEqual, getScopeSubscriptionPaths, isHistoryMetaEqual, isScopeStatusEqual, observeHistoryMetaSnapshot, observeScopeStatusSnapshot, readHistoryMetaSnapshot };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as g}from"../chunk-W2E5UIXT.js";import{a,b,c,e as d,f as e,g as f}from"../chunk-EQ55DKX2.js";export{a as areScopeErrorsEqual,c as getScopeSubscriptionPaths,d as isHistoryMetaEqual,b as isScopeStatusEqual,f as observeHistoryMetaSnapshot,g as observeScopeStatusSnapshot,e as readHistoryMetaSnapshot};
|
|
2
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkVZHG372Qcjs = require('../chunk-VZHG372Q.cjs');require('../chunk-D7JQWF6V.cjs');require('../chunk-T2JRSWQU.cjs');exports.bitBus = _chunkVZHG372Qcjs.a; exports.createBitBus = _chunkVZHG372Qcjs.b; exports.createBitStore = _chunkVZHG372Qcjs.e; exports.createFrameworkStoreAdapter = _chunkVZHG372Qcjs.d; exports.extractFeatureSlice = _chunkVZHG372Qcjs.i; exports.extractObserveSlice = _chunkVZHG372Qcjs.g; exports.extractReadSlice = _chunkVZHG372Qcjs.f; exports.extractSlices = _chunkVZHG372Qcjs.j; exports.extractWriteSlice = _chunkVZHG372Qcjs.h; exports.resolveBitStoreForHooks = _chunkVZHG372Qcjs.c;
|
|
2
|
+
//# sourceMappingURL=store.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/bit-form/bit-form/dist/core/store.cjs"],"names":[],"mappings":"AAAA,kIAAsD,iCAA8B,iCAA8B,qeAA0O","file":"/home/runner/work/bit-form/bit-form/dist/core/store.cjs"}
|