{"version":3,"file":"SocialLogin-CI9N39Vn.js","sources":["../../../app/javascript/components/shared/SocialLogin.vue"],"sourcesContent":["<template>\n  <div class=\"flex flex-col justify-center items-center\">\n    <div\n      v-if=\"promptText\"\n      class=\"flex w-full items-center my-5\">\n      <div class=\"h-px bg-ink-2 w-full\"></div>\n      <p class=\"typeset-4 whitespace-no-wrap mx-3 text-ink-4\">\n        {{ promptText }}\n      </p>\n      <div class=\"h-px bg-ink-2 w-full\"></div>\n    </div>\n    <div class=\"grid grid-cols-2 gap-4 w-full\">\n      <a\n        v-for=\"(provider, index) in oAuthProviders\"\n        :key=\"provider.provider\"\n        :href=\"urlWithSecretParam(provider.url)\"\n        class=\"flex items-center btn btn-large btn-secondary bg-white w-full\"\n        data-method=\"post\"\n        :class=\"columnSpan(index)\">\n        <svg-icon\n          :name=\"`${provider.provider}-icon`\"\n          height=\"18px\"\n          width=\"18px\"\n          class=\"mr-3 -mt-2\" />\n        {{ t(`login-modal.${provider.provider}`) }}\n      </a>\n    </div>\n  </div>\n</template>\n\n<script>\nimport SvgIcon from \"@/app/javascript/components/shared/SvgIcon.vue\";\n\nexport default {\n  name: \"SocialLogin\",\n  components: {\n    SvgIcon\n  },\n  props: {\n    oAuthProviders: {\n      type: Object,\n      required: true\n    },\n    queryParams: {\n      type: String,\n      // This default state will redirect the user to \"/\"\n      // We need to pass something othwerise Google sends over a hashed state propertly that has no redirect value\n      default: \"?state=eyJyZWRpcmVjdFVybCI6Ii8ifQ==\"\n    },\n    promptText: {\n      type: String,\n      default: \"Log in with\"\n    }\n  },\n  computed: {\n    urlWithSecretParam() {\n      return url => `${url}${this.queryParams}`;\n    },\n    columnSpan() {\n      return index => {\n        if (\n          this.oAuthProviders.length % 2 === 0 ||\n          (this.oAuthProviders.length % 2 === 1 &&\n            index === this.oAuthProviders.length - 1)\n        ) {\n          return \"col-span-1\";\n        }\n        return \"col-span-2\";\n      };\n    }\n  }\n};\n</script>\n"],"names":["_sfc_main","SvgIcon","url","index","_hoisted_1","_hoisted_3","_hoisted_4","_hoisted_5","_openBlock","_createElementBlock","$props","_hoisted_2","_createElementVNode","_toDisplayString","_createCommentVNode","_Fragment","_renderList","provider","$options","_normalizeClass","_createVNode","_component_svg_icon","_createTextVNode","_ctx"],"mappings":"8KAiCA,MAAKA,EAAU,CACb,KAAM,cACN,WAAY,CACVC,QAAAA,CACD,EACD,MAAO,CACL,eAAgB,CACd,KAAM,OACN,SAAU,EACX,EACD,YAAa,CACX,KAAM,OAGN,QAAS,qCACV,EACD,WAAY,CACV,KAAM,OACN,QAAS,aACX,CACD,EACD,SAAU,CACR,oBAAqB,CACnB,OAAOC,GAAO,GAAGA,CAAG,GAAG,KAAK,WAAW,EACxC,EACD,YAAa,CACX,OAAOC,GAEH,KAAK,eAAe,OAAS,IAAM,GAClC,KAAK,eAAe,OAAS,IAAM,GAClCA,IAAU,KAAK,eAAe,OAAS,EAElC,aAEF,YAEX,CACF,CACF,EAtEOC,EAAA,CAAA,MAAM,2CAA2C,KADxD,IAAA,EAIM,MAAM,iCAEHC,EAAA,CAAA,MAAM,8CAA8C,EAKpDC,EAAA,CAAA,MAAM,+BAA+B,EAX9CC,EAAA,CAAA,MAAA,gDACE,OAAAC,EAAA,EAAAC,EA0BM,MA1BNL,EA0BM,CAxBIM,EAAU,YADlBF,IAAAC,EAQM,MARNE,EAQM,aALJC,EAAwC,MAAA,CAAnC,MAAM,sBAAsB,EAAA,KAAA,EAAA,GACjCA,EAEI,IAFJP,EAEIQ,EADCH,EAAU,UAAA,EAAA,CAAA,cAEfE,EAAwC,MAAA,CAAnC,MAAM,sBAAsB,EAAA,KAAA,EAAA,MATvCE,EAAA,GAAA,EAAA,EAWIF,EAeM,MAfNN,EAeM,EAdJE,EAAA,EAAA,EAAAC,EAaIM,OAzBVC,EAaoCN,EAAA,eAbpC,CAagBO,EAAUd,SADpBM,EAaI,IAAA,CAXD,IAAKQ,EAAS,SACd,KAAMC,EAAA,mBAAmBD,EAAS,GAAG,EACtC,MAhB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