{"version":3,"sources":["jsdelivr-header.js","/npm/alessandroolivieri-lucid-mongo@3.2.5/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aAiBA,MAAM,EAAI,QAAQ,UACZ,YAAc,QAAQ,qBAC5B,IAAI,OAAS,KAKb,MAAM,OACJ,WAAA,CAAa,GACX,KAAK,KAAO,CACd,CAEA,GAAA,CAAK,GACH,OAAO,EAAE,IAAI,KAAK,KAAM,EAC1B,EAGF,MAAM,IACJ,WAAA,GACE,KAAK,UAAY,CAAC,CACpB,CAEA,IAAA,CAAM,EAAM,GACV,KAAK,UAAU,GAAQ,CACzB,CAEA,GAAA,CAAK,GACH,OAAO,KAAK,UAAU,EACxB,CAEA,IAAA,CAAM,GACJ,OAAO,KAAK,UAAU,EACxB,EAGF,MAAM,SACJ,MAAA,GACA,EAGF,MAAM,IAAM,IAAI,IACV,SAAW,IAAI,SAErB,YAAY,QAAQ,CAAE,QAAK,oBAE3B,OAAO,QAAU,SAAU,GACzB,OAAS,IAAI,OAAO,CAAE,SAAU,IAEhC,MAAM,EAAW,QAAQ,0BACnB,EAAQ,QAAQ,0BAChB,EAAS,QAAQ,gBACjB,EAAY,QAAQ,mBACpB,EAAU,QAAQ,iBAClB,EAAK,IAAI,EAAS,QAGxB,OAFA,IAAI,KAAK,sBAAuB,GAEzB,CACL,KACA,QACA,SACA,YACA,UACA,OAAQ,CACN,GAAA,CAAK,EAAM,GAGT,OAFA,EAAe,mBACf,IAAI,KAAK,SAAS,IAAQ,GACnB,IACT,EAEA,IAAK,GACI,IAAI,IAAI,SAAS,KAG1B,KAAA,GACE,EAAE,KAAK,IAAI,WAAW,CAAC,EAAO,KACxB,EAAK,WAAW,kBACX,IAAI,UAAU,EACvB,GAEJ,GAGN","file":"/npm/alessandroolivieri-lucid-mongo@3.2.5/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/alessandroolivieri-lucid-mongo@3.2.5/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict'\n\n/*\n * adonis-fold\n *\n * (c) Harminder Virk <virk@adonisjs.com>\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n*/\n\n/**\n * This file is used when you are not using lucid\n * with adonis framework, since framework will\n * use the providers.\n */\n\nconst _ = require('lodash')\nconst iocResolver = require('./lib/iocResolver')\nlet config = null\n\n/**\n * The config class for using lucid standalone\n */\nclass Config {\n  constructor (map) {\n    this._map = map\n  }\n\n  get (connection) {\n    return _.get(this._map, connection)\n  }\n}\n\nclass Ioc {\n  constructor () {\n    this._bindings = {}\n  }\n\n  bind (name, implementation) {\n    this._bindings[name] = implementation\n  }\n\n  use (name) {\n    return this._bindings[name]\n  }\n\n  make (name) {\n    return this._bindings[name]\n  }\n}\n\nclass Resolver {\n  forDir () {\n  }\n}\n\nconst ioc = new Ioc()\nconst resolver = new Resolver()\n\niocResolver.setFold({ ioc, resolver })\n\nmodule.exports = function (configMap) {\n  config = new Config({ database: configMap })\n\n  const Database = require('./src/Database/Manager')\n  const Model = require('./src/LucidMongo/Model')\n  const Schema = require('./src/Schema')\n  const Migration = require('./src/Migration')\n  const Factory = require('./src/Factory')\n  const db = new Database(config)\n  ioc.bind('Adonis/Src/Database', db)\n\n  return {\n    db,\n    Model,\n    Schema,\n    Migration,\n    Factory,\n    Models: {\n      add (name, implementation) {\n        implementation._bootIfNotBooted()\n        ioc.bind(`model:${name}`, implementation)\n        return this\n      },\n\n      get (name) {\n        return ioc.use(`model:${name}`)\n      },\n\n      clear () {\n        _.each(ioc._bindings, (value, name) => {\n          if (name.startsWith('model:')) {\n            delete ioc._bindings[name]\n          }\n        })\n      }\n    }\n  }\n}\n"]}