{"version":3,"file":"index.mjs","sources":["../index.mts"],"sourcesContent":["import { createForm } from './src/lib/form/form.mjs';\nimport { createGroup } from './src/lib/group/group.mjs';\n\nimport type { FormulaStores, BeakerStores, FormulaOptions, BeakerOptions } from './src/lib/shared/types.mjs';\nimport type { Formula } from './src/lib/form/form.mjs';\nimport type { Beaker } from './src/lib/group/group.mjs';\n\nexport { FormulaWebComponent } from './src/lib/webcomponent/index.mjs';\n\n/**\n * A global map of stores for elements with an `id` property and the `use` directive,\n * if no ID is used the store is not added\n */\nexport const formulaStores = new Map<string, FormulaStores>();\n\n/**\n * A global map of stores for beaker groups with an `id` property and the `use` directive,\n * if no ID is used the store is not added\n */\nexport const beakerStores = new Map<string, BeakerStores>();\n\n/**\n * The `formula` function returns a form object that can be bound to any HTML\n * element that contains form inputs. Once bound you can get the current values\n */\nexport function formula(options?: FormulaOptions): Formula & FormulaStores {\n  return createForm(options || {}, formulaStores, undefined, {}) as Formula & FormulaStores;\n}\n\n/**\n * The beaker function returns an instance of a group of elements and their stores, it also provides methods\n * to set the group value store\n */\nexport function beaker(options?: BeakerOptions): Beaker & BeakerStores {\n  return createGroup(options || {}, beakerStores) as Beaker & BeakerStores;\n}\n"],"names":["formulaStores","beakerStores","formula","options","createForm","beaker","createGroup"],"mappings":";;;AAaO,MAAMA,wBAAoB,IAAA,GAMpBC,wBAAmB,IAAA;AAMzB,SAASC,EAAQC,GAAmD;AACzE,SAAOC,EAAWD,KAAW,CAAA,GAAIH,GAAe,QAAW,CAAA,CAAE;AAC/D;AAMO,SAASK,EAAOF,GAAgD;AACrE,SAAOG,EAAYH,KAAW,CAAA,GAAIF,CAAY;AAChD;"}