{"version":3,"sources":["../../src/cjs/index.cts"],"sourcesContent":["import type { create as esmCreate } from \"../methods/create.js\";\nimport type {\n  insert as esmInsert,\n  insertBatch as esmInsertBatch,\n  insertWithHooks as esmInsertWithHooks,\n} from \"../methods/insert.js\";\nimport type { load as esmLoad } from \"../methods/load.js\";\nimport type { remove as esmRemove } from \"../methods/remove.js\";\nimport type { save as esmSave } from \"../methods/save.js\";\nimport type { search as esmSearch } from \"../methods/search.js\";\nimport type { count as esmCount, getByID as esmGetByID } from \"../methods/docs.js\";\n\nexport interface LyraExport {\n  create: typeof esmCreate;\n  insert: typeof esmInsert;\n  insertWithHooks: typeof esmInsertWithHooks;\n  insertBatch: typeof esmInsertBatch;\n  remove: typeof esmRemove;\n  search: typeof esmSearch;\n  save: typeof esmSave;\n  load: typeof esmLoad;\n  count: typeof esmCount;\n  getByID: typeof esmGetByID;\n}\n\nexport type RequireCallback = (err: Error | undefined, lyra?: LyraExport) => void;\n\nlet _esmCreate: typeof esmCreate;\nlet _esmInsert: typeof esmInsert;\nlet _esmInsertWithHooks: typeof esmInsertWithHooks;\nlet _esmInsertBatch: typeof esmInsertBatch;\nlet _esmRemove: typeof esmRemove;\nlet _esmSearch: typeof esmSearch;\nlet _esmSave: typeof esmSave;\nlet _esmLoad: typeof esmLoad;\nlet _esmCount: typeof esmCount;\nlet _esmGetByID: typeof esmGetByID;\n\nexport async function create(...args: Parameters<typeof esmCreate>): ReturnType<typeof esmCreate> {\n  if (!_esmCreate) {\n    const imported = await import(\"../methods/create.js\");\n    _esmCreate = imported.create;\n  }\n\n  return _esmCreate(...args);\n}\n\nexport async function insert(...args: Parameters<typeof esmInsert>): ReturnType<typeof esmInsert> {\n  if (!_esmInsert) {\n    const imported = await import(\"../methods/insert.js\");\n    _esmInsert = imported.insert;\n  }\n\n  return _esmInsert(...args);\n}\n\nexport async function insertWithHooks(\n  ...args: Parameters<typeof esmInsertWithHooks>\n): ReturnType<typeof esmInsertWithHooks> {\n  if (!_esmInsertWithHooks) {\n    const imported = await import(\"../methods/insert.js\");\n    _esmInsertWithHooks = imported.insertWithHooks;\n  }\n\n  return _esmInsertWithHooks(...args);\n}\n\nexport async function insertBatch(...args: Parameters<typeof esmInsertBatch>): ReturnType<typeof esmInsertBatch> {\n  if (!_esmInsertBatch) {\n    const imported = await import(\"../methods/insert.js\");\n    _esmInsertBatch = imported.insertBatch;\n  }\n\n  return _esmInsertBatch(...args);\n}\n\nexport async function remove(...args: Parameters<typeof esmRemove>): ReturnType<typeof esmRemove> {\n  if (!_esmRemove) {\n    const imported = await import(\"../methods/remove.js\");\n    _esmRemove = imported.remove;\n  }\n\n  return _esmRemove(...args);\n}\n\nexport async function search(...args: Parameters<typeof esmSearch>): ReturnType<typeof esmSearch> {\n  if (!_esmSearch) {\n    const imported = await import(\"../methods/search.js\");\n    _esmSearch = imported.search;\n  }\n\n  return _esmSearch(...args);\n}\n\nexport async function save(...args: Parameters<typeof esmSave>): ReturnType<typeof esmSave> {\n  if (!_esmSave) {\n    const imported = await import(\"../methods/save.js\");\n    _esmSave = imported.save;\n  }\n\n  return _esmSave(...args);\n}\n\nexport async function load(...args: Parameters<typeof esmLoad>): ReturnType<typeof esmLoad> {\n  if (!_esmLoad) {\n    const imported = await import(\"../methods/load.js\");\n    _esmLoad = imported.load;\n  }\n\n  return _esmLoad(...args);\n}\n\nexport async function count(...args: Parameters<typeof esmCount>): ReturnType<typeof esmCount> {\n  if (!_esmCount) {\n    const imported = await import(\"../methods/docs.js\");\n    _esmCount = imported.count;\n  }\n\n  return _esmCount(...args);\n}\n\nexport async function getByID(...args: Parameters<typeof esmGetByID>): ReturnType<typeof esmGetByID> {\n  if (!_esmGetByID) {\n    const imported = await import(\"../methods/docs.js\");\n    _esmGetByID = imported.getByID;\n  }\n\n  return _esmGetByID(...args);\n}\n\nexport function requireLyra(callback: RequireCallback): void {\n  import(\"../index.js\")\n    .then((loaded: LyraExport) => setTimeout(() => callback(undefined, loaded), 1))\n    .catch((error: Error) => setTimeout(() => callback(error), 1));\n}\n"],"names":["create","insert","insertWithHooks","insertBatch","remove","search","save","load","count","getByID","requireLyra","_esmCreate","_esmInsert","_esmInsertWithHooks","_esmInsertBatch","_esmRemove","_esmSearch","_esmSave","_esmLoad","_esmCount","_esmGetByID","args","imported","callback","then","loaded","setTimeout","undefined","catch","error"],"mappings":";;;;;;;;;;;IAsCsBA,MAAM,MAANA;IASAC,MAAM,MAANA;IASAC,eAAe,MAAfA;IAWAC,WAAW,MAAXA;IASAC,MAAM,MAANA;IASAC,MAAM,MAANA;IASAC,IAAI,MAAJA;IASAC,IAAI,MAAJA;IASAC,KAAK,MAALA;IASAC,OAAO,MAAPA;IASNC,WAAW,MAAXA;;AAvGhB,IAAIC;AACJ,IAAIC;AACJ,IAAIC;AACJ,IAAIC;AACJ,IAAIC;AACJ,IAAIC;AACJ,IAAIC;AACJ,IAAIC;AACJ,IAAIC;AACJ,IAAIC;AAEG,eAAepB,OAAO,GAAGqB,IAAkC,EAAgC;IAChG,IAAI,CAACV,YAAY;QACf,MAAMW,WAAW,MAAM,MAAM,CAAC;QAC9BX,aAAaW,SAAStB,MAAM;IAC9B,CAAC;IAED,OAAOW,cAAcU;AACvB;AAEO,eAAepB,OAAO,GAAGoB,IAAkC,EAAgC;IAChG,IAAI,CAACT,YAAY;QACf,MAAMU,WAAW,MAAM,MAAM,CAAC;QAC9BV,aAAaU,SAASrB,MAAM;IAC9B,CAAC;IAED,OAAOW,cAAcS;AACvB;AAEO,eAAenB,gBACpB,GAAGmB,IAA2C,EACP;IACvC,IAAI,CAACR,qBAAqB;QACxB,MAAMS,WAAW,MAAM,MAAM,CAAC;QAC9BT,sBAAsBS,SAASpB,eAAe;IAChD,CAAC;IAED,OAAOW,uBAAuBQ;AAChC;AAEO,eAAelB,YAAY,GAAGkB,IAAuC,EAAqC;IAC/G,IAAI,CAACP,iBAAiB;QACpB,MAAMQ,WAAW,MAAM,MAAM,CAAC;QAC9BR,kBAAkBQ,SAASnB,WAAW;IACxC,CAA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