{"version":3,"sources":["jsdelivr-header.js","/npm/@atroo/capacitor-secure-storage-plugin@7.0.0/dist/esm/definitions.js","/npm/@atroo/capacitor-secure-storage-plugin@7.0.0/dist/esm/index.js","/npm/@atroo/capacitor-secure-storage-plugin@7.0.0/dist/esm/sessionCookie.js","/npm/@atroo/capacitor-secure-storage-plugin@7.0.0/dist/esm/web.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,wGCNY,MAAC,qBAAuB,CAChC,mBACA,iCACA,eACA,6BACA,SACA,uBACA,iCAEO,iCACX,SAAW,GACP,EAAgC,aAAI,eACpC,EAAkC,eAAI,iBACtC,EAAiC,cAAI,eACxC,CAJD,CAIG,4BAAsB,0BAAoB,KCbxC,MAAC,sBAAsB,oBAAe,sBAAuB,CAC9D,IAAK,IAAM,QAAA,UAAA,MAAA,kBAAA,GAAA,IAAgB,MAAK,GAAK,IAAI,EAAE,2BCKxC,SAAS,iBAAiB,EAAM,EAAO,EAAU,IAEpD,MAAM,EAAiB,CACnB,KAAM,IACN,OAAqC,WAA7B,OAAO,SAAS,SACxB,SAAU,OAGR,EAAgB,OAAO,OAAO,OAAO,OAAO,GAAI,GAAiB,GAEvE,IAAI,EAAe,GAAG,mBAAmB,MAAS,mBAAmB,KAEjE,EAAc,SACd,GAAgB,aAAa,EAAc,UAE3C,EAAc,OACd,GAAgB,UAAU,EAAc,QAExC,EAAc,SACd,GAAgB,YAAY,EAAc,UAE1C,EAAc,SACd,GAAgB,YAEhB,EAAc,WACd,GAAgB,cAAc,EAAc,YAGhD,SAAS,OAAS,CACtB,CAoBA,SAAS,0BAA0B,GAC/B,MAAM,EAAU,SAAS,OAAO,MAAM,KAChC,EAAM,GACZ,IAAK,MAAM,KAAK,EAAS,CACrB,MAAM,EAAS,EAAE,OAEjB,GAAI,EAAO,WAAW,GAAS,CAE3B,MAAM,EAAM,EAAO,MAAM,KACzB,EAAI,EAAI,GAAG,UAAU,EAAO,SAAW,mBAAmB,EAAI,GAC1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AAO,GACxC,CACI,KAAA,GACI,MAAM,EAAU,KAAK,2BACrB,IAAK,MAAM,KAAO,EACmB,IAA7B,EAAI,QAAQ,KAAK,SACjB,EAAQ,WAAW,GAK3B,OADA,aAAa,WAAW,KAAK,qBACtB,QAAQ,QAAQ,CAAE,OAAO,GACxC,CACI,IAAA,GACI,MAAM,EAAU,KAAK,2BACf,EAAO,OAAO,KAAK,GAAS,QAAO,GAAgC,IAA3B,EAAE,QAAQ,KAAK,UAC7D,OAAO,QAAQ,QAAQ,CAAE,MAAO,GACxC,CACI,WAAA,GACI,OAAO,QAAQ,QAAQ,CAAE,MAAO,OACxC,EAEA,MAAM,oBAAsB,IAAI,uB","file":"/npm/@atroo/capacitor-secure-storage-plugin@7.0.0/dist/plugin.cjs.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@atroo/capacitor-secure-storage-plugin@7.0.0/dist/plugin.cjs.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","export const accessibilityOptions = [\n    'afterFirstUnlock',\n    'afterFirstUnlockThisDeviceOnly',\n    'whenUnlocked',\n    'whenUnlockedThisDeviceOnly',\n    'always',\n    'alwaysThisDeviceOnly',\n    'whenPasscodeSetThisDeviceOnly'\n];\nexport var WebStorageAdapter;\n(function (WebStorageAdapter) {\n    WebStorageAdapter[\"LocalStorage\"] = \"LocalStorage\";\n    WebStorageAdapter[\"SessionStorage\"] = \"SessionStorage\";\n    WebStorageAdapter[\"SessionCookie\"] = \"SessionCookie\";\n})(WebStorageAdapter || (WebStorageAdapter = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst SecureStoragePlugin = registerPlugin('SecureStoragePlugin', {\n    web: () => import('./web').then(m => new m.SecureStoragePluginWeb()),\n});\nexport * from './definitions';\nexport { SecureStoragePlugin };\n//# sourceMappingURL=index.js.map","/**\n * Sets a session cookie in the browser\n * @param name - The name of the cookie\n * @param value - The value to store in the cookie\n * @param options - Optional configuration parameters\n * @returns void\n */\nexport function setSessionCookie(name, value, options = {}) {\n    // Default options\n    const defaultOptions = {\n        path: '/',\n        secure: window.location.protocol === 'https:',\n        sameSite: 'lax'\n    };\n    // Merge default options with provided options\n    const cookieOptions = Object.assign(Object.assign({}, defaultOptions), options);\n    // Start building the cookie string\n    let cookieString = `${encodeURIComponent(name)}=${encodeURIComponent(value)}`;\n    // Add cookie options to the cookie string\n    if (cookieOptions.maxAge) {\n        cookieString += `; max-age=${cookieOptions.maxAge}`;\n    }\n    if (cookieOptions.path) {\n        cookieString += `; path=${cookieOptions.path}`;\n    }\n    if (cookieOptions.domain) {\n        cookieString += `; domain=${cookieOptions.domain}`;\n    }\n    if (cookieOptions.secure) {\n        cookieString += '; secure';\n    }\n    if (cookieOptions.sameSite) {\n        cookieString += `; samesite=${cookieOptions.sameSite}`;\n    }\n    // Set the cookie\n    document.cookie = cookieString;\n}\n/**\n * Gets a cookie value by name\n * @param name - The name of the cookie to retrieve\n * @returns The cookie value if found, null otherwise\n */\nexport function getSessionCookie(name) {\n    const cookieName = encodeURIComponent(name) + '=';\n    const cookies = document.cookie.split(';');\n    for (const c of cookies) {\n        const cookie = c.trim();\n        // Check if this cookie string begins with the name we want\n        if (cookie.indexOf(cookieName) === 0) {\n            // Return the cookie value (everything after the equals sign)\n            return decodeURIComponent(cookie.substring(cookieName.length));\n        }\n    }\n    // Cookie not found\n    return null;\n}\nfunction getPrefixedSessionCookies(prefix) {\n    const cookies = document.cookie.split(';');\n    const val = {};\n    for (const c of cookies) {\n        const cookie = c.trim();\n        // Check if this cookie string begins with the name we want\n        if (cookie.startsWith(prefix)) {\n            // Return the cookie value (everything after the equals sign)\n            const tmp = cookie.split('=');\n            val[tmp[0].substring(prefix.length)] = decodeURIComponent(tmp[1]);\n        }\n    }\n    return val;\n}\n/**\n * A custom implementation of the Storage interface\n */\nclass CustomStorage {\n    constructor() {\n        this.PREFIX = \"SCS_\";\n    }\n    // Use a Proxy to intercept property access and operations\n    static create() {\n        const storage = new CustomStorage();\n        return new Proxy(storage, {\n            // This intercepts Object.keys() calls\n            ownKeys() {\n                // Return only the keys from the internal store\n                return Object.keys(getPrefixedSessionCookies(storage.PREFIX));\n            },\n            // Required for Object.keys() to work properly with the proxy\n            getOwnPropertyDescriptor(target, prop) {\n                const store = getPrefixedSessionCookies(storage.PREFIX);\n                if (typeof prop === 'string' && prop in store) {\n                    return {\n                        value: store[prop],\n                        writable: true,\n                        enumerable: true,\n                        configurable: true\n                    };\n                }\n                return Reflect.getOwnPropertyDescriptor(target, prop);\n            },\n            // Intercept property access\n            get(target, prop, receiver) {\n                // Handle special case for length property\n                if (prop === 'length') {\n                    return target.length;\n                }\n                // Handle Storage interface methods\n                if (prop === 'getItem' ||\n                    prop === 'setItem' ||\n                    prop === 'removeItem' ||\n                    prop === 'clear' ||\n                    prop === 'key') {\n                    return target[prop].bind(target);\n                }\n                // For regular property access, check the store\n                if (typeof prop === 'string') {\n                    return target.getItem(prop);\n                }\n                return Reflect.get(target, prop, receiver);\n            },\n            // Intercept property assignment\n            set(target, prop, value, receiver) {\n                if (typeof prop === 'string' &&\n                    prop !== 'length' &&\n                    prop !== 'getItem' &&\n                    prop !== 'setItem' &&\n                    prop !== 'removeItem' &&\n                    prop !== 'clear' &&\n                    prop !== 'key') {\n                    target.setItem(prop, value);\n                    return true;\n                }\n                return Reflect.set(target, prop, value, receiver);\n            },\n            // Intercept property deletion\n            deleteProperty(target, prop) {\n                if (typeof prop === 'string') {\n                    target.removeItem(prop);\n                    return true;\n                }\n                return Reflect.deleteProperty(target, prop);\n            },\n            // Check if property exists\n            has(target, prop) {\n                const store = getPrefixedSessionCookies(storage.PREFIX);\n                if (typeof prop === 'string') {\n                    return prop in store || prop in target;\n                }\n                return Reflect.has(target, prop);\n            }\n        });\n    }\n    // Storage interface implementation\n    get length() {\n        const store = getPrefixedSessionCookies(this.PREFIX);\n        return Object.keys(store).length;\n    }\n    key(index) {\n        const store = getPrefixedSessionCookies(this.PREFIX);\n        const keys = Object.keys(store);\n        return index >= 0 && index < keys.length ? keys[index] : null;\n    }\n    getItem(key) {\n        const store = getPrefixedSessionCookies(this.PREFIX);\n        return key in store ? store[key] : null;\n    }\n    setItem(key, value) {\n        setSessionCookie(this.PREFIX + key, value);\n    }\n    removeItem(key) {\n        setSessionCookie(this.PREFIX + key, '', {\n            maxAge: -1\n        });\n    }\n    clear() {\n        const store = getPrefixedSessionCookies(this.PREFIX);\n        Object.keys(store).forEach((_, key) => {\n            setSessionCookie(this.PREFIX + key, '', {\n                maxAge: -1\n            });\n        });\n    }\n}\n// Usage example\nexport const sessionCookie = CustomStorage.create();\n//# sourceMappingURL=sessionCookie.js.map","import { WebPlugin } from '@capacitor/core';\nimport { WebStorageAdapter } from './definitions';\nimport { sessionCookie } from './sessionCookie';\nexport class SecureStoragePluginWeb extends WebPlugin {\n    constructor() {\n        super(...arguments);\n        this.PREFIX = 'cap_sec_';\n        this.STORAGE_ADAPTER_KEY = 'cap_sec_adapter';\n        this.addPrefix = (key) => this.PREFIX + key;\n    }\n    getCurrentStorageAdapter() {\n        const adapter = localStorage.getItem(this.STORAGE_ADAPTER_KEY);\n        switch (adapter) {\n            case WebStorageAdapter.SessionStorage:\n                return sessionStorage;\n            case WebStorageAdapter.SessionCookie:\n                return sessionCookie;\n            default:\n                return localStorage;\n        }\n    }\n    async setStorageAdapter(options) {\n        localStorage.setItem(this.STORAGE_ADAPTER_KEY, options.web.adapter);\n        return {\n            value: true,\n        };\n    }\n    async getStorageAdapter() {\n        const adapter = (localStorage.getItem(this.STORAGE_ADAPTER_KEY) ||\n            WebStorageAdapter.LocalStorage);\n        return {\n            adapter,\n        };\n    }\n    get(options) {\n        const storage = this.getCurrentStorageAdapter();\n        const item = storage.getItem(this.addPrefix(options.key));\n        if (item !== null) {\n            return Promise.resolve({\n                value: atob(item),\n            });\n        }\n        else {\n            return Promise.reject('Item with given key does not exist');\n        }\n    }\n    getAccessibility( /*_options: { key: string }*/) {\n        // Always rejects on web\n        return Promise.reject('not implemented on web');\n    }\n    set(options) {\n        const storage = this.getCurrentStorageAdapter();\n        storage.setItem(this.addPrefix(options.key), btoa(options.value));\n        return Promise.resolve({ value: true });\n    }\n    remove(options) {\n        const storage = this.getCurrentStorageAdapter();\n        storage.removeItem(this.addPrefix(options.key));\n        return Promise.resolve({ value: true });\n    }\n    clear() {\n        const storage = this.getCurrentStorageAdapter();\n        for (const key in storage) {\n            if (key.indexOf(this.PREFIX) === 0) {\n                storage.removeItem(key);\n            }\n        }\n        // remove eventually set storageAdapter key\n        localStorage.removeItem(this.STORAGE_ADAPTER_KEY);\n        return Promise.resolve({ value: true });\n    }\n    keys() {\n        const storage = this.getCurrentStorageAdapter();\n        const keys = Object.keys(storage).filter(k => k.indexOf(this.PREFIX) === 0);\n        return Promise.resolve({ value: keys });\n    }\n    getPlatform() {\n        return Promise.resolve({ value: 'web' });\n    }\n}\nconst SecureStoragePlugin = new SecureStoragePluginWeb();\nexport { SecureStoragePlugin };\n//# sourceMappingURL=web.js.map"]}