{"version":3,"sources":["jsdelivr-header.js","/npm/@tashelix/capacitor-msal-auth@0.0.11/dist/esm/web.js","/npm/@tashelix/capacitor-msal-auth@0.0.11/dist/esm/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,4FCJA,IAAI,SACG,MAAM,sBAAsB,eAC/B,UAAM,CAAK,GAEP,OADA,QAAQ,IAAI,OAAQ,GACb,CACf,CACI,oBAAM,CAAe,GACjB,QAAQ,MAAM,yCACtB,CACI,2BAAM,CAAsB,GACpB,WAEJ,SAAW,IAAI,oCAAwB,CACnC,KAAM,OAAO,OAAO,OAAO,OAAO,CAAE,aAAc,EAAQ,aAAc,kBAAmB,EAAQ,kBAAmB,SAAU,EAAQ,SAAU,UAAW,EAAQ,cAAgB,qCAAqC,EAAQ,QAAU,aAAgB,EAAQ,iBAAmB,CAAE,iBAAkB,EAAQ,kBAAqB,IAAM,CAAE,YAAa,EAAQ,aAAe,OAAO,SAAS,WAExY,KAAK,WAAa,QACZ,SAAS,aACvB,CACI,WAAM,CAAM,GACR,IAAK,SACD,MAAM,IAAI,MAAM,2CAEpB,IAAK,KAAK,WACN,MAAM,IAAI,MAAM,+BAEpB,IACI,GAAI,aAAiD,EAAS,EAAY,WAAY,CAClF,MAAM,EAAU,SAAS,mBAAmB,EAAY,aACpD,SAAS,oBAAoB,EAAY,aACzC,SAAS,qBAAqB,EAAY,YAC9C,GAAI,EACA,aAAa,KAAK,qBAAqB,GAAS,OAAM,eACrC,KAAK,0BAA0B,aAAiD,EAAS,EAAY,YAG1I,CACY,aAAa,KAAK,0BAA0B,aAAiD,EAAS,EAAY,UAC9H,CACQ,MAAO,GAEH,MADA,QAAQ,MAAM,mBAAoB,GAC5B,CAClB,CACA,CACI,YAAM,GACF,IAAK,SACD,MAAM,IAAI,MAAM,2CAEpB,aAAa,SAAS,aAC9B,CACI,iBAAM,GACF,IAAK,SACD,MAAM,IAAI,MAAM,2CAEpB,MAAO,CAAE,SAAU,SAAS,iBACpC,CACI,oBAAM,GACF,MAAO,CAAE,gBAAgB,EACjC,CACI,mCAAM,GACF,MAAO,CAAE,2BAA4B,GAC7C,CACI,+BAAM,CAA0B,GAC5B,IAAI,EAAI,EAAI,EAAI,EAChB,IAAK,SACD,MAAM,IAAI,MAAM,2CAEpB,IAAK,KAAK,WACN,MAAM,IAAI,MAAM,+BAQpB,aAAa,SAAS,WAAW,OAAO,OAAO,OAAO,OAAO,CAAE,OAAyF,QAAhF,EAAgC,QAA1B,EAAK,KAAK,kBAA+B,IAAP,OAAgB,EAAS,EAAG,cAA2B,IAAP,EAAgB,EAAK,GAAI,cAA0C,QAA1B,EAAK,KAAK,kBAA+B,IAAP,OAAgB,EAAS,EAAG,YAAc,CAAE,qBAAsB,CAAE,YAAa,KAAK,WAAW,aAAiB,IAAM,CAAE,OAAmC,QAA1B,EAAK,KAAK,kBAA+B,IAAP,OAAgB,EAAS,EAAG,SACpb,CACI,0BAAM,CAAqB,GACvB,IAAI,EAAI,EAAI,EACZ,IAAK,SACD,MAAM,IAAI,MAAM,2CAEpB,IAAK,KAAK,WACN,MAAM,IAAI,MAAM,+BAEpB,aAAa,SAAS,mBAAmB,OAAO,OAAO,OAAO,OAAO,CAAE,OAAyF,QAAhF,EAAgC,QAA1B,EAAK,KAAK,kBAA+B,IAAP,OAAgB,EAAS,EAAG,cAA2B,IAAP,EAAgB,EAAK,KAAmC,QAA1B,EAAK,KAAK,kBAA+B,IAAP,OAAgB,EAAS,EAAG,YAAc,CAAE,qBAAsB,CAAE,YAAa,KAAK,WAAW,aAAiB,IAAM,CAAE,YAC1W,ECtFK,MAAC,WAAa,oBAAe,aAAc,CAC5C,IAAK,IAAM,IAAI,gB","file":"/npm/@tashelix/capacitor-msal-auth@0.0.11/dist/plugin.cjs.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@tashelix/capacitor-msal-auth@0.0.11/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","import { PublicClientApplication } from '@azure/msal-browser';\nimport { WebPlugin } from '@capacitor/core';\nlet instance;\nexport class MsalPluginWeb extends WebPlugin {\n    async echo(options) {\n        console.log('ECHO', options);\n        return options;\n    }\n    async deleteDatabase(_options) {\n        console.error('deleteDatabase is not supported on web');\n    }\n    async initializePcaInstance(options) {\n        if (instance)\n            return;\n        instance = new PublicClientApplication({\n            auth: Object.assign(Object.assign({ protocolMode: options.protocolMode, authorityMetadata: options.authorityMetadata, clientId: options.clientId, authority: options.authorityUrl || `https://login.microsoftonline.com/${options.tenant || 'common'}/` }, (options.knownAuthorities ? { knownAuthorities: options.knownAuthorities } : {})), { redirectUri: options.redirectUri || window.location.origin }),\n        });\n        this.baseConfig = options;\n        await instance.initialize();\n    }\n    async login(accountData) {\n        if (!instance) {\n            throw new Error('PublicClientApplication not initialized');\n        }\n        if (!this.baseConfig) {\n            throw new Error('BaseOptions not initialized');\n        }\n        try {\n            if (accountData === null || accountData === void 0 ? void 0 : accountData.identifier) {\n                const account = instance.getAccountByHomeId(accountData.identifier) ||\n                    instance.getAccountByLocalId(accountData.identifier) ||\n                    instance.getAccountByUsername(accountData.identifier);\n                if (account) {\n                    return await this.acquireTokenSilently(account).catch(async () => {\n                        return await this.acquireTokenInteractively(accountData === null || accountData === void 0 ? void 0 : accountData.loginHint);\n                    });\n                }\n            }\n            return await this.acquireTokenInteractively(accountData === null || accountData === void 0 ? void 0 : accountData.loginHint);\n        }\n        catch (error) {\n            console.error('Error logging in', error);\n            throw error;\n        }\n    }\n    async logout() {\n        if (!instance) {\n            throw new Error('PublicClientApplication not initialized');\n        }\n        return await instance.logoutPopup();\n    }\n    async getAccounts() {\n        if (!instance) {\n            throw new Error('PublicClientApplication not initialized');\n        }\n        return { accounts: instance.getAllAccounts() };\n    }\n    async isSharedDevice() {\n        return { isSharedDevice: false }; // Shared device functionality is not applicable for web\n    }\n    async getPreferredAuthConfiguration() {\n        return { preferredAuthConfiguration: '' };\n    }\n    async acquireTokenInteractively(loginHint) {\n        var _a, _b, _c, _d;\n        if (!instance) {\n            throw new Error('PublicClientApplication not initialized');\n        }\n        if (!this.baseConfig) {\n            throw new Error('BaseOptions not initialized');\n        }\n        // return await instance.loginPopup({\n        //   scopes: this.baseConfig?.scopes ?? [],\n        //   loginHint: this.baseConfig?.loginHint,\n        //   ...(this.baseConfig?.domainHint ? { extraQueryParameters: { domain_hint: this.baseConfig.domainHint } } : {}),\n        //   prompt: this.baseConfig?.prompt,\n        // });\n        return await instance.loginPopup(Object.assign(Object.assign({ scopes: (_b = (_a = this.baseConfig) === null || _a === void 0 ? void 0 : _a.scopes) !== null && _b !== void 0 ? _b : [], loginHint }, (((_c = this.baseConfig) === null || _c === void 0 ? void 0 : _c.domainHint) ? { extraQueryParameters: { domain_hint: this.baseConfig.domainHint } } : {})), { prompt: (_d = this.baseConfig) === null || _d === void 0 ? void 0 : _d.prompt }));\n    }\n    async acquireTokenSilently(account) {\n        var _a, _b, _c;\n        if (!instance) {\n            throw new Error('PublicClientApplication not initialized');\n        }\n        if (!this.baseConfig) {\n            throw new Error('BaseOptions not initialized');\n        }\n        return await instance.acquireTokenSilent(Object.assign(Object.assign({ scopes: (_b = (_a = this.baseConfig) === null || _a === void 0 ? void 0 : _a.scopes) !== null && _b !== void 0 ? _b : [] }, (((_c = this.baseConfig) === null || _c === void 0 ? void 0 : _c.domainHint) ? { extraQueryParameters: { domain_hint: this.baseConfig.domainHint } } : {})), { account }));\n    }\n}\n//# sourceMappingURL=web.js.map","import { registerPlugin } from '@capacitor/core';\nimport { MsalPluginWeb } from './web';\nconst MsalPlugin = registerPlugin('MsalPlugin', {\n    web: () => new MsalPluginWeb(),\n});\nexport * from './definitions';\nexport { MsalPlugin };\n//# sourceMappingURL=index.js.map"]}