{"version":3,"sources":["webpack:///./resources/js/src/app/mixins/buttonSizeProperty.mixin.js","webpack:///./resources/js/src/app/components/customer/login/GuestLogin.vue?6ec3","webpack:///./resources/js/src/app/components/customer/login/GuestLogin.vue?a4f9","webpack:///resources/js/src/app/components/customer/login/GuestLogin.vue","webpack:///./resources/js/src/app/components/customer/login/GuestLogin.vue"],"names":["BUTTON_SIZES","LEGACY_CLASS_MAP","ButtonSizePropertyMixin","props","buttonSize","type","String","default","validator","value","Object","keys","indexOf","computed","buttonSizeClass","hasOwnProperty","this","render","_vm","_h","$createElement","_c","_self","ref","staticClass","attrs","method","directives","name","rawName","email","expression","autocomplete","id","_uid","domProps","on","input","$event","target","composing","_v","for","_s","$translate","class","disabled","isDisabled","click","preventDefault","validate","icon","loading","_withStripped","component","options","__file"],"mappings":"26BAAA,IAAMA,EAAe,CAAC,SAAU,UAE1BC,EAAmB,CACrB,GAAM,SACN,GAAM,GACN,GAAM,UAGGC,EACb,CACIC,MAAO,CACHC,WACA,CACIC,KAAM,CAACC,OAAQ,MACfC,QAAS,KACTC,UAAW,SAAAC,GAEP,OAIsB,IAJf,CACH,IADG,OAEAT,EAFA,EAGAU,OAAOC,KAAKV,KACjBW,QAAQH,MAKtBI,SAAU,CACNC,gBADM,WAGF,OAAIb,EAAiBc,eAAeC,KAAKZ,YAE9BH,EAAiBe,KAAKZ,YAG1BY,KAAKZ,e,wCClCxB,IAAIa,EAAS,WACX,IAAIC,EAAMF,KACNG,EAAKD,EAAIE,eACTC,EAAKH,EAAII,MAAMD,IAAMF,EACzB,OAAOE,EAAG,MAAO,CACfA,EACE,OACA,CACEE,IAAK,OACLC,YAAa,uBACbC,MAAO,CAAEC,OAAQ,SAEnB,CACEL,EACE,MACA,CAAEG,YAAa,aAAcC,MAAO,CAAE,gBAAiB,SACvD,CACEJ,EAAG,QAAS,CACVM,WAAY,CACV,CACEC,KAAM,QACNC,QAAS,UACTpB,MAAOS,EAAIY,MACXC,WAAY,UAGhBN,MAAO,CACL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CACI,SADJ,WAEM,IAAN,OACM,EAAN,kCACA,iBAEQ,EAAR,eAEA,kBAEQ,EAAR,yCAII,UAdJ,WAeM,IAAN,OACM,KAAN,cAEM,EAAN,+BAAQ,MAAR,aACA,iBAEQ,OAAR,IAAQ,CACR,oJAGA,iBAEQ,EAAR,oB,OC3GIC,EAAY,YACd,EACArC,EHkFoB,IGhFpB,EACA,KACA,KACA,MAuBFqC,EAAUC,QAAQC,OAAS,gEACZ,UAAAF,E","file":"chunks/ceres-10.min.js","sourcesContent":["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","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 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&\"","<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","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"],"sourceRoot":""}