{"version":3,"sources":["../node_modules/@aws-amplify/ui-components/dist/esm-es5/amplify-federated-buttons_2.entry.js"],"names":["AmplifyFederatedButtons","hostRef","registerInstance","this","authState","AuthState","SignIn","federated","handleAuthStateChange","dispatchAuthStateChangeEvent","prototype","componentWillLoad","Auth","configure","Error","NO_AUTH_MODULE_FOUND","_a","oauth","oauthConfig","Object","assign","auth0Config","render","values","includes","isEmpty","amazonClientId","facebookAppId","googleClientId","h","clientId","appId","config","AmplifyStrike","class","style"],"mappings":"4GAAA,kLAOIA,EAAyC,WACzC,SAASA,EAAwBC,GAC7BC,YAAiBC,KAAMF,GAEvBE,KAAKC,UAAYC,IAAUC,OAE3BH,KAAKI,UAAY,CAAC,EAIlBJ,KAAKK,sBAAwBC,GAChC,CA2BD,OA1BAT,EAAwBU,UAAUC,kBAAoB,WAClD,IAAKC,KAAkC,oBAAnBA,IAAKC,UACrB,MAAM,IAAIC,MAAMC,KAEpB,IAAIC,EAAKJ,IAAKC,YAAYI,MAAOA,OAAe,IAAPD,EAAgB,CAAC,EAAIA,EAE1DC,EAAK,OACLd,KAAKI,UAAUW,YAAcC,OAAOC,OAAOD,OAAOC,OAAO,CAAC,EAAGjB,KAAKI,UAAUW,aAAcD,GAErFA,EAAK,aACVd,KAAKI,UAAUW,YAAcC,OAAOC,OAAOD,OAAOC,OAAO,CAAC,EAAGjB,KAAKI,UAAUW,aAAcD,EAAK,aAE/FA,EAAK,QACLd,KAAKI,UAAUc,YAAcF,OAAOC,OAAOD,OAAOC,OAAO,CAAC,EAAGjB,KAAKI,UAAUc,aAAcJ,EAAK,OAEtG,EACDjB,EAAwBU,UAAUY,OAAS,WACvC,IAAKH,OAAOI,OAAOlB,KAAWmB,SAASrB,KAAKC,WACxC,OAAO,KAEX,GAAIqB,YAAQtB,KAAKI,WACb,OAAO,KAEX,IAAIS,EAAKb,KAAKI,UAAWmB,EAAiBV,EAAGU,eAAgBL,EAAcL,EAAGK,YAAaM,EAAgBX,EAAGW,cAAeC,EAAiBZ,EAAGY,eAAgBV,EAAcF,EAAGE,YAClL,OAAQW,YAAE,MAAO,KAAMD,GAAmBC,YAAE,MAAO,KAAMA,YAAE,wBAAyB,CAAEC,SAAUF,EAAgBpB,sBAAuBL,KAAKK,yBAA4BmB,GAAkBE,YAAE,MAAO,KAAMA,YAAE,0BAA2B,CAAEE,MAAOJ,EAAenB,sBAAuBL,KAAKK,yBAA4BkB,GAAmBG,YAAE,MAAO,KAAMA,YAAE,wBAAyB,CAAEC,SAAUJ,EAAgBlB,sBAAuBL,KAAKK,yBAA4BU,GAAgBW,YAAE,MAAO,KAAMA,YAAE,uBAAwB,CAAEG,OAAQd,KAAkBG,GAAgBQ,YAAE,MAAO,KAAMA,YAAE,uBAAwB,CAAEG,OAAQX,EAAab,sBAAuBL,KAAKK,yBAC3oB,EACMR,CACV,CAvC4C,GAyCzCiC,EAA+B,WAC/B,SAASA,EAAchC,GACnBC,YAAiBC,KAAMF,EAC1B,CAID,OAHAgC,EAAcvB,UAAUY,OAAS,WAC7B,OAAQO,YAAE,OAAQ,CAAEK,MAAO,kBAAoBL,YAAE,OAAQ,MAC5D,EACMI,CACV,CARkC,GASnCA,EAAcE,MAVS,uZ","file":"static/js/34.6a6b991d.chunk.js","sourcesContent":["import { r as registerInstance, h } from './index-83f2275b.js';\nimport { isEmpty } from '@aws-amplify/core';\nimport { A as AuthState } from './auth-types-78df304e.js';\nimport { Auth } from '@aws-amplify/auth';\nimport './Translations-c833f663.js';\nimport { N as NO_AUTH_MODULE_FOUND } from './constants-c8ecaa24.js';\nimport { d as dispatchAuthStateChangeEvent } from './helpers-9703fe65.js';\nvar AmplifyFederatedButtons = /** @class */ (function () {\n function AmplifyFederatedButtons(hostRef) {\n registerInstance(this, hostRef);\n /** The current authentication state. */\n this.authState = AuthState.SignIn;\n /** Federated credentials & configuration. */\n this.federated = {};\n /** Auth state change handler for this component\n * e.g. SignIn -> 'Create Account' link -> SignUp\n */\n this.handleAuthStateChange = dispatchAuthStateChangeEvent;\n }\n AmplifyFederatedButtons.prototype.componentWillLoad = function () {\n if (!Auth || typeof Auth.configure !== 'function') {\n throw new Error(NO_AUTH_MODULE_FOUND);\n }\n var _a = Auth.configure().oauth, oauth = _a === void 0 ? {} : _a;\n // backward compatibility\n if (oauth['domain']) {\n this.federated.oauthConfig = Object.assign(Object.assign({}, this.federated.oauthConfig), oauth);\n }\n else if (oauth['awsCognito']) {\n this.federated.oauthConfig = Object.assign(Object.assign({}, this.federated.oauthConfig), oauth['awsCognito']);\n }\n if (oauth['auth0']) {\n this.federated.auth0Config = Object.assign(Object.assign({}, this.federated.auth0Config), oauth['auth0']);\n }\n };\n AmplifyFederatedButtons.prototype.render = function () {\n if (!Object.values(AuthState).includes(this.authState)) {\n return null;\n }\n if (isEmpty(this.federated)) {\n return null;\n }\n var _a = this.federated, amazonClientId = _a.amazonClientId, auth0Config = _a.auth0Config, facebookAppId = _a.facebookAppId, googleClientId = _a.googleClientId, oauthConfig = _a.oauthConfig;\n return (h(\"div\", null, googleClientId && (h(\"div\", null, h(\"amplify-google-button\", { clientId: googleClientId, handleAuthStateChange: this.handleAuthStateChange }))), facebookAppId && (h(\"div\", null, h(\"amplify-facebook-button\", { appId: facebookAppId, handleAuthStateChange: this.handleAuthStateChange }))), amazonClientId && (h(\"div\", null, h(\"amplify-amazon-button\", { clientId: amazonClientId, handleAuthStateChange: this.handleAuthStateChange }))), oauthConfig && (h(\"div\", null, h(\"amplify-oauth-button\", { config: oauthConfig }))), auth0Config && (h(\"div\", null, h(\"amplify-auth0-button\", { config: auth0Config, handleAuthStateChange: this.handleAuthStateChange })))));\n };\n return AmplifyFederatedButtons;\n}());\nvar amplifyStrikeCss = \".sc-amplify-strike-h{--color:var(--amplify-grey);--border-color:var(--amplify-light-grey);--content-background:var(--amplify-white);display:block;width:100%;text-align:center;border-bottom:1px solid var(--border-color);line-height:0.1em;margin:32px 0;color:var(--color)}.strike-content.sc-amplify-strike{background:var(--content-background);padding:0 25px;font-size:var(--amplify-text-sm);font-weight:500}\";\nvar AmplifyStrike = /** @class */ (function () {\n function AmplifyStrike(hostRef) {\n registerInstance(this, hostRef);\n }\n AmplifyStrike.prototype.render = function () {\n return (h(\"span\", { class: \"strike-content\" }, h(\"slot\", null)));\n };\n return AmplifyStrike;\n}());\nAmplifyStrike.style = amplifyStrikeCss;\nexport { AmplifyFederatedButtons as amplify_federated_buttons, AmplifyStrike as amplify_strike };\n"],"sourceRoot":""}