/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/b2-sdk@1.7.0/build/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";var __awaiter=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(s,i){function a(e){try{o(n.next(e))}catch(e){i(e)}}function c(e){try{o(n.throw(e))}catch(e){i(e)}}function o(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,c)}o((n=n.apply(e,t||[])).next())}))};Object.defineProperty(exports,"__esModule",{value:!0});const client_1=require("./client"),config_1=require("./config"),file_1=require("./file"),controller_1=require("./controller"),schema_1=require("./schema"),archive_1=require("./archive"),env_1=require("./env"),asset_1=require("./asset");class B2Entry{constructor(e,t,r){this.meta=t;let{path:n,refs:s}=t;const i=s.includes("page");n="/"===n?"/__root":n,this._path=n,this._file=new file_1.B2File(e,n,i),this._controller=new controller_1.B2Controller(e,n,i),this._schema=new schema_1.B2Schema(e,n,s.includes("schema")),this._env=new env_1.B2Env(e,n,s.includes("basics")),r&&(this._asset=new asset_1.B2Asset(e,`${n}/asset`))}get name(){return this.meta.name}get path(){return this._path}get file(){return this._file}get controller(){return this._controller}get schema(){return this._schema}get env(){return this._env}get asset(){return this._asset}}exports.B2Entry=B2Entry;class B2{constructor(e){this.c=new client_1.B2Client(e),this._archive=new archive_1.B2Archive(this.c),this._asset=new asset_1.B2Asset(this.c),this.entryMap=new Map}init(){return __awaiter(this,void 0,void 0,(function*(){this.meta=yield this.c.inspect(),this.meta.entries.forEach((e=>{const t=this.meta.allModules.asset.find((t=>t.path===e.path||"__root"===t.path&&"/"===e.path));this.entryMap.set(e.name,new B2Entry(this.c,e,!!t))}))}))}get publicURL(){return this.meta.publicURL}get entries(){return this.meta.entries}get name(){return this.meta.name}get referencedModules(){return this.meta.referencedModules}get modules(){return this.meta.allModules}get archive(){return this._archive}get asset(){return this._asset}entry(e){const t=this.entryMap.get(e);if(!t){const t=Array.from(this.entryMap.keys()).map((e=>`'${e}'`)).join(", ");throw new Error(`Entry '${e}' was not found. Avaliable entries are: ${t}`)}return t}}function connect(e){return __awaiter(this,void 0,void 0,(function*(){let t;return t=new B2("string"==typeof e?yield config_1.readConfig(e):e),yield t.init(),t}))}exports.B2=B2,exports.connect=connect;
//# sourceMappingURL=/sm/6733ea285e527f2a4c3a341a4a3314135d55df2642d60e165ab3f0bac2fce12b.map