{"version":3,"file":"web-Dz3dQas2.js","sources":["../../node_modules/@evva/capacitor-secure-storage-plugin/dist/esm/web.js"],"sourcesContent":["import { WebPlugin } from \"@capacitor/core\";\nexport class SecureStoragePluginWeb extends WebPlugin {\n PREFIX = \"cap_sec_\";\n async get(options) {\n const value = localStorage.getItem(this.addPrefix(options.key));\n return value !== null\n ? {\n value: atob(value),\n }\n : await Promise.reject(new Error(\"Item with given key does not exist\"));\n }\n async set(options) {\n localStorage.setItem(this.addPrefix(options.key), btoa(options.value));\n return { value: true };\n }\n async remove(options) {\n if (localStorage.getItem(this.addPrefix(options.key)) != null) {\n localStorage.removeItem(this.addPrefix(options.key));\n return { value: true };\n }\n else {\n throw new Error(\"Item with given key does not exist\");\n }\n }\n async clear() {\n for (const key in localStorage) {\n if (key.indexOf(this.PREFIX) === 0) {\n localStorage.removeItem(key);\n }\n }\n return { value: true };\n }\n async keys() {\n const keys = Object.keys(localStorage)\n .filter((k) => k.indexOf(this.PREFIX) === 0)\n .map(this.removePrefix);\n return { value: keys };\n }\n async getPlatform() {\n return { value: \"web\" };\n }\n addPrefix = (key) => this.PREFIX + key;\n removePrefix = (key) => key.replace(this.PREFIX, \"\");\n}\n//# sourceMappingURL=web.js.map"],"names":["SecureStoragePluginWeb","WebPlugin","options","value","key","k"],"mappings":"wCACO,MAAMA,UAA+BC,CAAU,CAClD,OAAS,WACT,MAAM,IAAIC,EAAS,CACf,MAAMC,EAAQ,aAAa,QAAQ,KAAK,UAAUD,EAAQ,GAAG,CAAC,EAC9D,OAAOC,IAAU,KACX,CACE,MAAO,KAAKA,CAAK,CACjC,EACc,MAAM,QAAQ,OAAO,IAAI,MAAM,oCAAoC,CAAC,CAClF,CACI,MAAM,IAAID,EAAS,CACf,oBAAa,QAAQ,KAAK,UAAUA,EAAQ,GAAG,EAAG,KAAKA,EAAQ,KAAK,CAAC,EAC9D,CAAE,MAAO,EAAM,CAC9B,CACI,MAAM,OAAOA,EAAS,CAClB,GAAI,aAAa,QAAQ,KAAK,UAAUA,EAAQ,GAAG,CAAC,GAAK,KACrD,oBAAa,WAAW,KAAK,UAAUA,EAAQ,GAAG,CAAC,EAC5C,CAAE,MAAO,EAAM,EAGtB,MAAM,IAAI,MAAM,oCAAoC,CAEhE,CACI,MAAM,OAAQ,CACV,UAAWE,KAAO,aACVA,EAAI,QAAQ,KAAK,MAAM,IAAM,GAC7B,aAAa,WAAWA,CAAG,EAGnC,MAAO,CAAE,MAAO,EAAM,CAC9B,CACI,MAAM,MAAO,CAIT,MAAO,CAAE,MAHI,OAAO,KAAK,YAAY,EAChC,OAAQC,GAAMA,EAAE,QAAQ,KAAK,MAAM,IAAM,CAAC,EAC1C,IAAI,KAAK,YAAY,CACJ,CAC9B,CACI,MAAM,aAAc,CAChB,MAAO,CAAE,MAAO,KAAO,CAC/B,CACI,UAAaD,GAAQ,KAAK,OAASA,EACnC,aAAgBA,GAAQA,EAAI,QAAQ,KAAK,OAAQ,EAAE,CACvD","x_google_ignoreList":[0]}