{"version":3,"sources":["webpack:///resources/js/src/app/components/customer/login/GuestLogin.vue","webpack:///./resources/js/src/app/components/customer/login/GuestLogin.vue?6ec3","webpack:///./resources/js/src/app/components/customer/login/GuestLogin.vue","webpack:///./resources/js/src/app/components/customer/login/GuestLogin.vue?a4f9","webpack:///./resources/js/src/app/components/customer/login/GuestLogin.vue?800f","webpack:///./resources/js/src/app/mixins/buttonSizeProperty.mixin.js"],"names":["BUTTON_SIZES","LEGACY_CLASS_MAP","ButtonSizePropertyMixin","props","buttonSize","type","String","default","validator","value","Object","keys","indexOf","computed","buttonSizeClass","hasOwnProperty"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA,oGADA;AAGA;AACA,cACA;AACA;AADA,KAFA;AAKA,kBACA;AACA,kBADA;AAEA;AAFA;AANA,GAHA;AAeA,MAfA,kBAgBA;AACA;AACA,eADA;AAEA;AAFA;AAIA,GArBA;AAuBA,SAvBA,qBAwBA;AACA,qIACA;AACA;AACA;AACA,GA7BA;AA+BA,SA/BA,qBAgCA;AAAA;;AACA,+BACA;AACA,2HADA,CAGA;;AACA,2FACA;AACA,gDACA;AACA;AACA;AACA,SAJA;AAKA;;AAEA,kFACA;AACA,+CACA;AACA;AACA,SAHA;AAIA;AACA,KArBA;AAsBA,GAvDA;AAyDA,WACA;AACA,YADA,sBAEA;AAAA;;AACA,oGACA,IADA,CACA,YACA;AACA;AACA,OAJA,EAKA,IALA,CAKA,yBACA;AACA;AACA,OARA;AASA,KAZA;AAcA,aAdA,uBAeA;AAAA;;AACA;AAEA;AAAA;AAAA,SACA,IADA,CACA,YACA;AACA,gFACA,gOADA;AAGA,OANA,EAOA,IAPA,CAOA,YACA;AACA;AACA,OAVA;AAWA;AA7BA;AA1DA,G;;;;;;;;;;;;AC7BA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;A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ADV;AAEIC,aAAO,EAAE,IAFb;AAGIC,eAAS,EAAE,mBAAAC,KAAK,EAChB;AACI,eAAO,CACH,EADG,SAEAT,YAFA,qBAGAU,MAAM,CAACC,IAAP,CAAYV,gBAAZ,CAHA,GAILW,OAJK,CAIGH,KAJH,MAIc,CAAC,CAJtB;AAKH;AAVL;AAFG,GADX;AAiBII,UAAQ,EAAE;AACNC,mBADM,6BAEN;AACI,UAAIb,gBAAgB,CAACc,cAAjB,CAAgC,KAAKX,UAArC,CAAJ,EACA;AACI,eAAOH,gBAAgB,CAAC,KAAKG,UAAN,CAAvB;AACH;;AAED,aAAO,KAAKA,UAAZ;AACH;AATK;AAjBd,CADO,C","file":"chunks/ceres-18.js","sourcesContent":["<template>\n    <div>\n        <form ref=\"form\" method=\"post\" class=\"mb-3 login-pwd-reset\">\n            <div class=\"input-unit\" data-validate=\"mail\">\n                <input type=\"email\" name=\"email\" autocomplete=\"email\" data-testing=\"guest-login-input\" :id=\"_uid\" v-model=\"email\" data-autofocus>\n                <label :for=\"_uid\">{{ $translate(\"Ceres::Template.loginEmail\") }}*</label>\n            </div>\n            <span class=\"error-msg\">{{ $translate(\"Ceres::Template.loginEnterConfirmEmail\") }}</span>\n\n            <div class=\"text-right\">\n                <button @click.prevent=\"validate\" :disabled=\"isDisabled\" class=\"btn btn-primary btn-medium btn-appearance\" :class=\"buttonSizeClass\" data-testing=\"guest-login-button\">\n                    {{ $translate(\"Ceres::Template.loginNext\") }}\n                    <icon icon=\"arrow-right\" :loading=\"isDisabled\"></icon>\n                </button>\n            </div>\n        </form>\n    </div>\n</template>\n\n<script>\nimport { ButtonSizePropertyMixin } from \"../../../mixins/buttonSizeProperty.mixin\";\n\nimport ApiService from \"../../../services/ApiService\";\nimport AutoFocusService from \"../../../services/AutoFocusService\";\nimport ValidationService from \"../../../services/ValidationService\";\nimport { navigateTo } from \"../../../services/UrlService\";\nimport { isDefined, isNullOrUndefined } from \"../../../helper/utils\";\nimport ModalService from \"../../../services/ModalService\";\n\nexport default {\n    mixins: [ButtonSizePropertyMixin],\n\n    props: {\n        backlink:\n        {\n            type: String\n        },\n        initialEmail:\n        {\n            type: String,\n            default: \"\"\n        }\n    },\n\n    data()\n    {\n        return {\n            email: \"\",\n            isDisabled: false\n        };\n    },\n\n    created()\n    {\n        if (!isNullOrUndefined(this.initialEmail) && this.initialEmail.length > 0)\n        {\n            this.email = this.initialEmail;\n        }\n    },\n\n    mounted()\n    {\n        this.$nextTick(() =>\n        {\n            const modal = ModalService.findModal(this.$parent.$refs.guestModal);\n\n            // for old login view only (input in modal)\n            if(!isNullOrUndefined(modal))\n            {\n                modal.on(\"hidden.bs.modal\", () =>\n                {\n                    this.email = \"\";\n                    ValidationService.unmarkAllFields(this.$refs.form);\n                });\n            }\n\n            if (isDefined(modal))\n            {\n                modal.on(\"shown.bs.modal\", () =>\n                {\n                    AutoFocusService.triggerAutoFocus(modal);\n                });\n            }\n        });\n    },\n\n    methods:\n    {\n        validate()\n        {\n            ValidationService.validate(this.$refs.form)\n                .done(() =>\n                {\n                    this.authGuest();\n                })\n                .fail(invalidFields =>\n                {\n                    ValidationService.markInvalidFields(invalidFields, \"error\");\n                });\n        },\n\n        authGuest()\n        {\n            this.isDisabled = true;\n\n            ApiService.post(\"/rest/io/guest\", { email: this.email })\n                .done(() =>\n                {\n                    navigateTo(\n                        isDefined(this.backlink) && this.backlink.length ? decodeURIComponent(this.backlink) : window.location.origin + (App.urls.includeLanguage ? \"/\" + App.language : \"\")\n                    );\n                })\n                .fail(() =>\n                {\n                    this.isDisabled = false;\n                });\n        }\n    }\n}\n</script>\n","var render = function() {\n  var _vm = this\n  var _h = _vm.$createElement\n  var _c = _vm._self._c || _h\n  return _c(\"div\", [\n    _c(\n      \"form\",\n      {\n        ref: \"form\",\n        staticClass: \"mb-3 login-pwd-reset\",\n        attrs: { method: \"post\" }\n      },\n      [\n        _c(\n          \"div\",\n          { staticClass: \"input-unit\", attrs: { \"data-validate\": \"mail\" } },\n          [\n            _c(\"input\", {\n              directives: [\n                {\n                  name: \"model\",\n                  rawName: \"v-model\",\n                  value: _vm.email,\n                  expression: \"email\"\n                }\n              ],\n              attrs: {\n                type: \"email\",\n                name: \"email\",\n                autocomplete: \"email\",\n                \"data-testing\": \"guest-login-input\",\n                id: _vm._uid,\n                \"data-autofocus\": \"\"\n              },\n              domProps: { value: _vm.email },\n              on: {\n                input: function($event) {\n                  if ($event.target.composing) {\n                    return\n                  }\n                  _vm.email = $event.target.value\n                }\n              }\n            }),\n            _vm._v(\" \"),\n            _c(\"label\", { attrs: { for: _vm._uid } }, [\n              _vm._v(_vm._s(_vm.$translate(\"Ceres::Template.loginEmail\")) + \"*\")\n            ])\n          ]\n        ),\n        _vm._v(\" \"),\n        _c(\"span\", { staticClass: \"error-msg\" }, [\n          _vm._v(\n            _vm._s(_vm.$translate(\"Ceres::Template.loginEnterConfirmEmail\"))\n          )\n        ]),\n        _vm._v(\" \"),\n        _c(\"div\", { staticClass: \"text-right\" }, [\n          _c(\n            \"button\",\n            {\n              staticClass: \"btn btn-primary btn-medium btn-appearance\",\n              class: _vm.buttonSizeClass,\n              attrs: {\n                disabled: _vm.isDisabled,\n                \"data-testing\": \"guest-login-button\"\n              },\n              on: {\n                click: function($event) {\n                  $event.preventDefault()\n                  return _vm.validate($event)\n                }\n              }\n            },\n            [\n              _vm._v(\n                \"\\n                \" +\n                  _vm._s(_vm.$translate(\"Ceres::Template.loginNext\")) +\n                  \"\\n                \"\n              ),\n              _c(\"icon\", {\n                attrs: { icon: \"arrow-right\", loading: _vm.isDisabled }\n              })\n            ],\n            1\n          )\n        ])\n      ]\n    )\n  ])\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","import { render, staticRenderFns } from \"./GuestLogin.vue?vue&type=template&id=3b2359c6&\"\nimport script from \"./GuestLogin.vue?vue&type=script&lang=js&\"\nexport * from \"./GuestLogin.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  null,\n  null\n  \n)\n\n/* hot reload */\nif (module.hot) {\n  var api = require(\"/home/runner/work/plugin-ceres/plugin-ceres/node_modules/vue-hot-reload-api/dist/index.js\")\n  api.install(require('vue'))\n  if (api.compatible) {\n    module.hot.accept()\n    if (!api.isRecorded('3b2359c6')) {\n      api.createRecord('3b2359c6', component.options)\n    } else {\n      api.reload('3b2359c6', component.options)\n    }\n    module.hot.accept(\"./GuestLogin.vue?vue&type=template&id=3b2359c6&\", function () {\n      api.rerender('3b2359c6', {\n        render: render,\n        staticRenderFns: staticRenderFns\n      })\n    })\n  }\n}\ncomponent.options.__file = \"resources/js/src/app/components/customer/login/GuestLogin.vue\"\nexport default component.exports","import mod from \"-!../../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./GuestLogin.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./GuestLogin.vue?vue&type=script&lang=js&\"","export * from \"-!../../../../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./GuestLogin.vue?vue&type=template&id=3b2359c6&\"","const BUTTON_SIZES = [\"btn-sm\", \"btn-lg\"];\n\nconst LEGACY_CLASS_MAP = {\n    \"sm\": \"btn-sm\",\n    \"md\": \"\",\n    \"lg\": \"btn-lg\"\n};\n\nexport const ButtonSizePropertyMixin =\n{\n    props: {\n        buttonSize:\n        {\n            type: [String, null],\n            default: null,\n            validator: value =>\n            {\n                return [\n                    \"\",\n                    ...BUTTON_SIZES,\n                    ...Object.keys(LEGACY_CLASS_MAP)\n                ].indexOf(value) !== -1;\n            }\n        }\n    },\n\n    computed: {\n        buttonSizeClass()\n        {\n            if (LEGACY_CLASS_MAP.hasOwnProperty(this.buttonSize))\n            {\n                return LEGACY_CLASS_MAP[this.buttonSize];\n            }\n\n            return this.buttonSize;\n        }\n    }\n};\n"],"sourceRoot":""}