class l{constructor(e=i()){this.area=e}async get(e){return(await this.area.get([e]))[e]}async put(e,a){await this.area.set({[e]:a})}async delete(e){await this.area.remove(e)}async listPrefix(e){const a=await this.area.get(null),s=[];for(const t of Object.keys(a))t.startsWith(e)&&s.push({key:t,value:a[t]});return s.sort((t,o)=>t.key<o.key?-1:t.key>o.key?1:0),s}async deletePrefix(e){const a=await this.area.get(null),s=Object.keys(a).filter(t=>t.startsWith(e));return s.length&&await this.area.remove(s),s.length}}function i(){const r=globalThis.chrome;if(!r?.storage?.local)throw new Error("ChromeStorageKV: chrome.storage.local is missing — this adapter is only valid in the MV3 SW. Use MemoryKV for tests or MessageProxyKV for popup / sidepanel surfaces.");return r.storage.local}export{l as ChromeStorageKV};
//# sourceMappingURL=chrome_storage_kv-CO14W-3-.js.map
