!function (e) {
    var t = {};

    function n(r) {
        if (t[r]) return t[r].exports;
        var o = t[r] = {i: r, l: !1, exports: {}};
        return e[r].call(o.exports, o, o.exports, n), o.l = !0, o.exports
    }

    n.m = e, n.c = t, n.d = function (e, t, r) {
        n.o(e, t) || Object.defineProperty(e, t, {enumerable: !0, get: r})
    }, n.r = function (e) {
        "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {value: "Module"}), Object.defineProperty(e, "__esModule", {value: !0})
    }, n.t = function (e, t) {
        if (1 & t && (e = n(e)), 8 & t) return e;
        if (4 & t && "object" == typeof e && e && e.__esModule) return e;
        var r = Object.create(null);
        if (n.r(r), Object.defineProperty(r, "default", {
            enumerable: !0, value: e
        }), 2 & t && "string" != typeof e) for (var o in e) n.d(r, o, function (t) {
            return e[t]
        }.bind(null, o));
        return r
    }, n.n = function (e) {
        var t = e && e.__esModule ? function () {
            return e.default
        } : function () {
            return e
        };
        return n.d(t, "a", t), t
    }, n.o = function (e, t) {
        return Object.prototype.hasOwnProperty.call(e, t)
    }, n.p = "", n(n.s = 3)
}([function (e, t, n) {
    "use strict";

    function r(e) {
        return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
            return typeof e
        } : function (e) {
            return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
        })(e)
    }

    var o = function (e) {
        return function (e) {
            return !!e && "object" === r(e)
        }(e) && !function (e) {
            var t = Object.prototype.toString.call(e);
            return "[object RegExp]" === t || "[object Date]" === t || function (e) {
                return e.$$typeof === i
            }(e)
        }(e)
    };
    var i = "function" == typeof Symbol && Symbol.for ? Symbol.for("react.element") : 60103;

    function a(e, t) {
        return !1 !== t.clone && t.isMergeableObject(e) ? p((n = e, Array.isArray(n) ? [] : {}), e, t) : e;
        var n
    }

    function s(e, t, n) {
        return e.concat(t).map((function (e) {
            return a(e, n)
        }))
    }

    function c(e) {
        return Object.keys(e).concat(function (e) {
            return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e).filter((function (t) {
                return e.propertyIsEnumerable(t)
            })) : []
        }(e))
    }

    function u(e, t) {
        try {
            return t in e
        } catch (e) {
            return !1
        }
    }

    function l(e, t, n) {
        var r = {};
        return n.isMergeableObject(e) && c(e).forEach((function (t) {
            r[t] = a(e[t], n)
        })), c(t).forEach((function (o) {
            (function (e, t) {
                return u(e, t) && !(Object.hasOwnProperty.call(e, t) && Object.propertyIsEnumerable.call(e, t))
            })(e, o) || (u(e, o) && n.isMergeableObject(t[o]) ? r[o] = function (e, t) {
                if (!t.customMerge) return p;
                var n = t.customMerge(e);
                return "function" == typeof n ? n : p
            }(o, n)(e[o], t[o], n) : r[o] = a(t[o], n))
        })), r
    }

    function p(e, t, n) {
        (n = n || {}).arrayMerge = n.arrayMerge || s, n.isMergeableObject = n.isMergeableObject || o, n.cloneUnlessOtherwiseSpecified = a;
        var r = Array.isArray(t);
        return r === Array.isArray(e) ? r ? n.arrayMerge(e, t, n) : l(e, t, n) : a(t, n)
    }

    p.all = function (e, t) {
        if (!Array.isArray(e)) throw new Error("first argument should be an array");
        return e.reduce((function (e, n) {
            return p(e, n, t)
        }), {})
    };
    var f = p;
    e.exports = f
}, function (e, t, n) {
    (function (e) {
        function t(e) {
            return (t = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
                return typeof e
            } : function (e) {
                return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
            })(e)
        }

        var n = function (e) {
            "use strict";
            var n = Object.prototype, r = n.hasOwnProperty, o = "function" == typeof Symbol ? Symbol : {},
                i = o.iterator || "@@iterator", a = o.asyncIterator || "@@asyncIterator", s = o.toStringTag || "@@toStringTag";

            function c(e, t, n) {
                return Object.defineProperty(e, t, {value: n, enumerable: !0, configurable: !0, writable: !0}), e[t]
            }

            try {
                c({}, "")
            } catch (e) {
                c = function (e, t, n) {
                    return e[t] = n
                }
            }

            function u(e, t, n, r) {
                var o = t && t.prototype instanceof f ? t : f, i = Object.create(o.prototype), a = new O(r || []);
                return i._invoke = function (e, t, n) {
                    var r = "suspendedStart";
                    return function (o, i) {
                        if ("executing" === r) throw new Error("Generator is already running");
                        if ("completed" === r) {
                            if ("throw" === o) throw i;
                            return _()
                        }
                        for (n.method = o, n.arg = i; ;) {
                            var a = n.delegate;
                            if (a) {
                                var s = k(a, n);
                                if (s) {
                                    if (s === p) continue;
                                    return s
                                }
                            }
                            if ("next" === n.method) n.sent = n._sent = n.arg; else if ("throw" === n.method) {
                                if ("suspendedStart" === r) throw r = "completed", n.arg;
                                n.dispatchException(n.arg)
                            } else "return" === n.method && n.abrupt("return", n.arg);
                            r = "executing";
                            var c = l(e, t, n);
                            if ("normal" === c.type) {
                                if (r = n.done ? "completed" : "suspendedYield", c.arg === p) continue;
                                return {value: c.arg, done: n.done}
                            }
                            "throw" === c.type && (r = "completed", n.method = "throw", n.arg = c.arg)
                        }
                    }
                }(e, n, a), i
            }

            function l(e, t, n) {
                try {
                    return {type: "normal", arg: e.call(t, n)}
                } catch (e) {
                    return {type: "throw", arg: e}
                }
            }

            e.wrap = u;
            var p = {};

            function f() {
            }

            function h() {
            }

            function d() {
            }

            var y = {};
            y[i] = function () {
                return this
            };
            var m = Object.getPrototypeOf, v = m && m(m(P([])));
            v && v !== n && r.call(v, i) && (y = v);
            var b = d.prototype = f.prototype = Object.create(y);

            function g(e) {
                ["next", "throw", "return"].forEach((function (t) {
                    c(e, t, (function (e) {
                        return this._invoke(t, e)
                    }))
                }))
            }

            function w(e, n) {
                var o;
                this._invoke = function (i, a) {
                    function s() {
                        return new n((function (o, s) {
                            !function o(i, a, s, c) {
                                var u = l(e[i], e, a);
                                if ("throw" !== u.type) {
                                    var p = u.arg, f = p.value;
                                    return f && "object" === t(f) && r.call(f, "__await") ? n.resolve(f.__await).then((function (e) {
                                        o("next", e, s, c)
                                    }), (function (e) {
                                        o("throw", e, s, c)
                                    })) : n.resolve(f).then((function (e) {
                                        p.value = e, s(p)
                                    }), (function (e) {
                                        return o("throw", e, s, c)
                                    }))
                                }
                                c(u.arg)
                            }(i, a, o, s)
                        }))
                    }

                    return o = o ? o.then(s, s) : s()
                }
            }

            function k(e, t) {
                var n = e.iterator[t.method];
                if (void 0 === n) {
                    if (t.delegate = null, "throw" === t.method) {
                        if (e.iterator.return && (t.method = "return", t.arg = void 0, k(e, t), "throw" === t.method)) return p;
                        t.method = "throw", t.arg = new TypeError("The iterator does not provide a 'throw' method")
                    }
                    return p
                }
                var r = l(n, e.iterator, t.arg);
                if ("throw" === r.type) return t.method = "throw", t.arg = r.arg, t.delegate = null, p;
                var o = r.arg;
                return o ? o.done ? (t[e.resultName] = o.value, t.next = e.nextLoc, "return" !== t.method && (t.method = "next", t.arg = void 0), t.delegate = null, p) : o : (t.method = "throw", t.arg = new TypeError("iterator result is not an object"), t.delegate = null, p)
            }

            function S(e) {
                var t = {tryLoc: e[0]};
                1 in e && (t.catchLoc = e[1]), 2 in e && (t.finallyLoc = e[2], t.afterLoc = e[3]), this.tryEntries.push(t)
            }

            function E(e) {
                var t = e.completion || {};
                t.type = "normal", delete t.arg, e.completion = t
            }

            function O(e) {
                this.tryEntries = [{tryLoc: "root"}], e.forEach(S, this), this.reset(!0)
            }

            function P(e) {
                if (e) {
                    var t = e[i];
                    if (t) return t.call(e);
                    if ("function" == typeof e.next) return e;
                    if (!isNaN(e.length)) {
                        var n = -1, o = function t() {
                            for (; ++n < e.length;) if (r.call(e, n)) return t.value = e[n], t.done = !1, t;
                            return t.value = void 0, t.done = !0, t
                        };
                        return o.next = o
                    }
                }
                return {next: _}
            }

            function _() {
                return {value: void 0, done: !0}
            }

            return h.prototype = b.constructor = d, d.constructor = h, h.displayName = c(d, s, "GeneratorFunction"), e.isGeneratorFunction = function (e) {
                var t = "function" == typeof e && e.constructor;
                return !!t && (t === h || "GeneratorFunction" === (t.displayName || t.name))
            }, e.mark = function (e) {
                return Object.setPrototypeOf ? Object.setPrototypeOf(e, d) : (e.__proto__ = d, c(e, s, "GeneratorFunction")), e.prototype = Object.create(b), e
            }, e.awrap = function (e) {
                return {__await: e}
            }, g(w.prototype), w.prototype[a] = function () {
                return this
            }, e.AsyncIterator = w, e.async = function (t, n, r, o, i) {
                void 0 === i && (i = Promise);
                var a = new w(u(t, n, r, o), i);
                return e.isGeneratorFunction(n) ? a : a.next().then((function (e) {
                    return e.done ? e.value : a.next()
                }))
            }, g(b), c(b, s, "Generator"), b[i] = function () {
                return this
            }, b.toString = function () {
                return "[object Generator]"
            }, e.keys = function (e) {
                var t = [];
                for (var n in e) t.push(n);
                return t.reverse(), function n() {
                    for (; t.length;) {
                        var r = t.pop();
                        if (r in e) return n.value = r, n.done = !1, n
                    }
                    return n.done = !0, n
                }
            }, e.values = P, O.prototype = {
                constructor: O, reset: function (e) {
                    if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = !1, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(E), !e) for (var t in this) "t" === t.charAt(0) && r.call(this, t) && !isNaN(+t.slice(1)) && (this[t] = void 0)
                }, stop: function () {
                    this.done = !0;
                    var e = this.tryEntries[0].completion;
                    if ("throw" === e.type) throw e.arg;
                    return this.rval
                }, dispatchException: function (e) {
                    if (this.done) throw e;
                    var t = this;

                    function n(n, r) {
                        return a.type = "throw", a.arg = e, t.next = n, r && (t.method = "next", t.arg = void 0), !!r
                    }

                    for (var o = this.tryEntries.length - 1; o >= 0; --o) {
                        var i = this.tryEntries[o], a = i.completion;
                        if ("root" === i.tryLoc) return n("end");
                        if (i.tryLoc <= this.prev) {
                            var s = r.call(i, "catchLoc"), c = r.call(i, "finallyLoc");
                            if (s && c) {
                                if (this.prev < i.catchLoc) return n(i.catchLoc, !0);
                                if (this.prev < i.finallyLoc) return n(i.finallyLoc)
                            } else if (s) {
                                if (this.prev < i.catchLoc) return n(i.catchLoc, !0)
                            } else {
                                if (!c) throw new Error("try statement without catch or finally");
                                if (this.prev < i.finallyLoc) return n(i.finallyLoc)
                            }
                        }
                    }
                }, abrupt: function (e, t) {
                    for (var n = this.tryEntries.length - 1; n >= 0; --n) {
                        var o = this.tryEntries[n];
                        if (o.tryLoc <= this.prev && r.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
                            var i = o;
                            break
                        }
                    }
                    i && ("break" === e || "continue" === e) && i.tryLoc <= t && t <= i.finallyLoc && (i = null);
                    var a = i ? i.completion : {};
                    return a.type = e, a.arg = t, i ? (this.method = "next", this.next = i.finallyLoc, p) : this.complete(a)
                }, complete: function (e, t) {
                    if ("throw" === e.type) throw e.arg;
                    return "break" === e.type || "continue" === e.type ? this.next = e.arg : "return" === e.type ? (this.rval = this.arg = e.arg, this.method = "return", this.next = "end") : "normal" === e.type && t && (this.next = t), p
                }, finish: function (e) {
                    for (var t = this.tryEntries.length - 1; t >= 0; --t) {
                        var n = this.tryEntries[t];
                        if (n.finallyLoc === e) return this.complete(n.completion, n.afterLoc), E(n), p
                    }
                }, catch: function (e) {
                    for (var t = this.tryEntries.length - 1; t >= 0; --t) {
                        var n = this.tryEntries[t];
                        if (n.tryLoc === e) {
                            var r = n.completion;
                            if ("throw" === r.type) {
                                var o = r.arg;
                                E(n)
                            }
                            return o
                        }
                    }
                    throw new Error("illegal catch attempt")
                }, delegateYield: function (e, t, n) {
                    return this.delegate = {
                        iterator: P(e), resultName: t, nextLoc: n
                    }, "next" === this.method && (this.arg = void 0), p
                }
            }, e
        }("object" === t(e) ? e.exports : {});
        try {
            regeneratorRuntime = n
        } catch (e) {
            Function("r", "regeneratorRuntime = r")(n)
        }
    }).call(this, n(2)(e))
}, function (e, t) {
    e.exports = function (e) {
        return e.webpackPolyfill || (e.deprecate = function () {
        }, e.paths = [], e.children || (e.children = []), Object.defineProperty(e, "loaded", {
            enumerable: !0, get: function () {
                return e.l
            }
        }), Object.defineProperty(e, "id", {
            enumerable: !0, get: function () {
                return e.i
            }
        }), e.webpackPolyfill = 1), e
    }
}, function (e, t, n) {
    "use strict";
    n.r(t);
    n(1);

    function r(e, t) {
        for (var n = 0; n < t.length; n++) {
            var r = t[n];
            r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
        }
    }

    var o = function () {
        function e() {
            !function (e, t) {
                if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
            }(this, e), this._request = null
        }

        var t, n, o;
        return t = e, (n = [{
            key: "get", value: function (e, t) {
                var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "application/json",
                    r = this._createPreparedRequest("GET", e, n);
                return this._sendRequest(r, null, t)
            }
        }, {
            key: "post", value: function (e, t, n) {
                var r = this, o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : "application/json",
                    i = !(arguments.length > 4 && void 0 !== arguments[4]) || arguments[4];
                o = this._getContentType(t, o);
                var a = this._createPreparedRequest("POST", e, o);
                return i
            }
        }, {
            key: "delete", value: function (e, t, n) {
                var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : "application/json";
                r = this._getContentType(t, r);
                var o = this._createPreparedRequest("DELETE", e, r);
                return this._sendRequest(o, t, n)
            }
        }, {
            key: "patch", value: function (e, t, n) {
                var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : "application/json";
                r = this._getContentType(t, r);
                var o = this._createPreparedRequest("PATCH", e, r);
                return this._sendRequest(o, t, n)
            }
        }, {
            key: "abort", value: function () {
                if (this._request) return this._request.abort()
            }
        }, {
            key: "_registerOnLoaded", value: function (e, t) {
                t && e.addEventListener("loadend", (function () {
                    t(e.responseText, e)
                }))
            }
        }, {
            key: "_sendRequest", value: function (e, t, n) {
                return this._registerOnLoaded(e, n), e.send(t), e
            }
        }, {
            key: "_getContentType", value: function (e, t) {
                return e instanceof FormData && (t = !1), t
            }
        }, {
            key: "_createPreparedRequest", value: function (e, t, n) {
                return this._request = new XMLHttpRequest, this._request.open(e, t), this._request.setRequestHeader("X-Requested-With", "XMLHttpRequest"), n && this._request.setRequestHeader("Content-type", n), this._request
            }
        }]) && r(t.prototype, n), o && r(t, o), e
    }();

    function i(e, t) {
        for (var n = 0; n < t.length; n++) {
            var r = t[n];
            r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
        }
    }

    var a = function () {
        function e() {
            !function (e, t) {
                if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
            }(this, e)
        }

        var t, n, r;
        return t = e, r = [{
            key: "isTouchDevice", value: function () {
                return "ontouchstart" in document.documentElement
            }
        }, {
            key: "isIOSDevice", value: function () {
                return e.isIPhoneDevice() || e.isIPadDevice()
            }
        }, {
            key: "isNativeWindowsBrowser", value: function () {
                return e.isIEBrowser() || e.isEdgeBrowser()
            }
        }, {
            key: "isIPhoneDevice", value: function () {
                return !!navigator.userAgent.match(/iPhone/i)
            }
        }, {
            key: "isIPadDevice", value: function () {
                return !!navigator.userAgent.match(/iPad/i)
            }
        }, {
            key: "isIEBrowser", value: function () {
                return -1 !== navigator.userAgent.toLowerCase().indexOf("msie") || !!navigator.userAgent.match(/Trident.*rv:\d+\./)
            }
        }, {
            key: "isEdgeBrowser", value: function () {
                return !!navigator.userAgent.match(/Edge\/\d+/i)
            }
        }, {
            key: "getList", value: function () {
                return {
                    "is-touch": e.isTouchDevice(),
                    "is-ios": e.isIOSDevice(),
                    "is-native-windows": e.isNativeWindowsBrowser(),
                    "is-iphone": e.isIPhoneDevice(),
                    "is-ipad": e.isIPadDevice(),
                    "is-ie": e.isIEBrowser(),
                    "is-edge": e.isEdgeBrowser()
                }
            }
        }], (n = null) && i(t.prototype, n), r && i(t, r), e
    }();

    function s(e) {
        return (s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
            return typeof e
        } : function (e) {
            return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
        })(e)
    }

    function c(e, t) {
        var n = "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
        if (!n) {
            if (Array.isArray(e) || (n = function (e, t) {
                if (!e) return;
                if ("string" == typeof e) return u(e, t);
                var n = Object.prototype.toString.call(e).slice(8, -1);
                "Object" === n && e.constructor && (n = e.constructor.name);
                if ("Map" === n || "Set" === n) return Array.from(e);
                if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return u(e, t)
            }(e)) || t && e && "number" == typeof e.length) {
                n && (e = n);
                var r = 0, o = function () {
                };
                return {
                    s: o, n: function () {
                        return r >= e.length ? {done: !0} : {done: !1, value: e[r++]}
                    }, e: function (e) {
                        throw e
                    }, f: o
                }
            }
            throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
        }
        var i, a = !0, s = !1;
        return {
            s: function () {
                n = n.call(e)
            }, n: function () {
                var e = n.next();
                return a = e.done, e
            }, e: function (e) {
                s = !0, i = e
            }, f: function () {
                try {
                    a || null == n.return || n.return()
                } finally {
                    if (s) throw i
                }
            }
        }
    }

    function u(e, t) {
        (null == t || t > e.length) && (t = e.length);
        for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n];
        return r
    }

    function l(e, t) {
        for (var n = 0; n < t.length; n++) {
            var r = t[n];
            r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
        }
    }

    var p = function () {
        function e() {
            !function (e, t) {
                if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
            }(this, e)
        }

        var t, n, r;
        return t = e, r = [{
            key: "iterate", value: function (e, t) {
                if (e instanceof Map) return e.forEach(t);
                if (Array.isArray(e)) return e.forEach(t);
                if (!(e instanceof FormData)) {
                    if (e instanceof NodeList) return e.forEach(t);
                    if (e instanceof Object) return Object.keys(e).forEach((function (n) {
                        t(e[n], n)
                    }));
                    throw new Error("The element type ".concat(s(e), " is not iterable!"))
                }
                var n, r = c(e.entries());
                try {
                    for (r.s(); !(n = r.n()).done;) {
                        var o = n.value;
                        t(o[1], o[0])
                    }
                } catch (e) {
                    r.e(e)
                } finally {
                    r.f()
                }
            }
        }], (n = null) && l(t.prototype, n), r && l(t, r), e
    }();

    function f(e, t) {
        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
    }

    function h(e, t) {
        for (var n = 0; n < t.length; n++) {
            var r = t[n];
            r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
        }
    }

    function d(e, t, n) {
        return t && h(e.prototype, t), n && h(e, n), e
    }

    var y = "backdrop/onclick", m = function () {
        function e() {
            return f(this, e), e.instance || (e.instance = this), e.instance
        }

        return d(e, [{
            key: "create", value: function (e) {
                this._removeExistingBackdrops(), document.body.insertAdjacentHTML("beforeend", this._getTemplate());
                var t = document.body.lastChild;
                document.documentElement.classList.add("no-scroll"), setTimeout((function () {
                    t.classList.add("modal-backdrop-open"), "function" == typeof e && e()
                }), 75), this._dispatchEvents()
            }
        }, {
            key: "remove", value: function () {
                var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 350, t = this._getBackdrops();
                p.iterate(t, (function (e) {
                    return e.classList.remove("modal-backdrop-open")
                })), setTimeout(this._removeExistingBackdrops.bind(this), e), document.documentElement.classList.remove("no-scroll")
            }
        }, {
            key: "_dispatchEvents", value: function () {
                var e = a.isTouchDevice() ? "touchstart" : "click";
                document.addEventListener(e, (function (e) {
                    e.target.classList.contains("modal-backdrop") && document.dispatchEvent(new CustomEvent(y))
                }))
            }
        }, {
            key: "_getBackdrops", value: function () {
                return document.querySelectorAll(".".concat("modal-backdrop"))
            }
        }, {
            key: "_removeExistingBackdrops", value: function () {
                if (!1 !== this._exists()) {
                    var e = this._getBackdrops();
                    p.iterate(e, (function (e) {
                        return e.remove()
                    }))
                }
            }
        }, {
            key: "_exists", value: function () {
                return document.querySelectorAll(".".concat("modal-backdrop")).length > 0
            }
        }, {
            key: "_getTemplate", value: function () {
                return '<div class="'.concat("modal-backdrop", '"></div>')
            }
        }]), e
    }(), v = Object.freeze(new m), b = function () {
        function e() {
            f(this, e)
        }

        return d(e, null, [{
            key: "create", value: function () {
                var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null;
                v.create(e)
            }
        }, {
            key: "remove", value: function () {
                var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 350;
                v.remove(e)
            }
        }, {
            key: "SELECTOR_CLASS", value: function () {
                return "modal-backdrop"
            }
        }]), e
    }();

    function g(e, t) {
        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
    }

    function w(e, t) {
        for (var n = 0; n < t.length; n++) {
            var r = t[n];
            r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
        }
    }

    var k = function () {
        function e(t) {
            var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "before";
            g(this, e), this.parent = t instanceof Element ? t : document.body.querySelector(t), this.position = n
        }

        var t, n, r;
        return t = e, r = [{
            key: "getTemplate", value: function () {
                return '<div class="'.concat("loader", '" role="status">\n                    <span class="sr-only">Loading...</span>\n                </div>')
            }
        }, {
            key: "SELECTOR_CLASS", value: function () {
                return "loader"
            }
        }], (n = [{
            key: "create", value: function () {
                this.exists() || this.parent.insertAdjacentHTML(this._getPosition(), e.getTemplate())
            }
        }, {
            key: "remove", value: function () {
                var e = this.parent.querySelectorAll(".".concat("loader"));
                p.iterate(e, (function (e) {
                    return e.remove()
                }))
            }
        }, {
            key: "exists", value: function () {
                return this.parent.querySelectorAll(".".concat("loader")).length > 0
            }
        }, {
            key: "_getPosition", value: function () {
                return "before" === this.position ? "afterbegin" : "beforeend"
            }
        }]) && w(t.prototype, n), r && w(t, r), e
    }();

    function S(e) {
        return (S = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
            return typeof e
        } : function (e) {
            return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
        })(e)
    }

    function E(e, t) {
        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
    }

    function O(e, t) {
        for (var n = 0; n < t.length; n++) {
            var r = t[n];
            r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
        }
    }

    function P(e, t, n) {
        return t && O(e.prototype, t), n && O(e, n), e
    }

    function _() {
        return (_ = "undefined" != typeof Reflect && Reflect.get ? Reflect.get : function (e, t, n) {
            var r = C(e, t);
            if (r) {
                var o = Object.getOwnPropertyDescriptor(r, t);
                return o.get ? o.get.call(arguments.length < 3 ? e : n) : o.value
            }
        }).apply(this, arguments)
    }

    function C(e, t) {
        for (; !Object.prototype.hasOwnProperty.call(e, t) && null !== (e = x(e));) ;
        return e
    }

    function j(e, t) {
        return (j = Object.setPrototypeOf || function (e, t) {
            return e.__proto__ = t, e
        })(e, t)
    }

    function A(e) {
        var t = function () {
            if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
            if (Reflect.construct.sham) return !1;
            if ("function" == typeof Proxy) return !0;
            try {
                return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function () {
                }))), !0
            } catch (e) {
                return !1
            }
        }();
        return function () {
            var n, r = x(e);
            if (t) {
                var o = x(this).constructor;
                n = Reflect.construct(r, arguments, o)
            } else n = r.apply(this, arguments);
            return F(this, n)
        }
    }

    function F(e, t) {
        if (t && ("object" === S(t) || "function" == typeof t)) return t;
        if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
        return function (e) {
            if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            return e
        }(e)
    }

    function x(e) {
        return (x = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
            return e.__proto__ || Object.getPrototypeOf(e)
        })(e)
    }

    var T = function (e) {
        !function (e, t) {
            if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
            e.prototype = Object.create(t && t.prototype, {
                constructor: {
                    value: e, writable: !0, configurable: !0
                }
            }), t && j(e, t)
        }(n, e);
        var t = A(n);

        function n() {
            return E(this, n), t.call(this, document.body)
        }

        return P(n, [{
            key: "create", value: function () {
                var e = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0];
                if (!this.exists() && e) {
                    b.create();
                    var t = document.querySelector(".".concat(b.SELECTOR_CLASS()));
                    t.insertAdjacentHTML("beforeend", k.getTemplate())
                }
            }
        }, {
            key: "remove", value: function () {
                var e = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0];
                _(x(n.prototype), "remove", this).call(this), e && b.remove()
            }
        }]), n
    }(k), L = (Object.freeze(new T), n(0)), M = n.n(L);

    function R(e, t) {
        for (var n = 0; n < t.length; n++) {
            var r = t[n];
            r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
        }
    }

    var B = function () {
        function e() {
            !function (e, t) {
                if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
            }(this, e)
        }

        var t, n, r;
        return t = e, r = [{
            key: "ucFirst", value: function (e) {
                return e.charAt(0).toUpperCase() + e.slice(1)
            }
        }, {
            key: "lcFirst", value: function (e) {
                return e.charAt(0).toLowerCase() + e.slice(1)
            }
        }, {
            key: "toDashCase", value: function (e) {
                return e.replace(/([A-Z])/g, "-$1").replace(/^-/, "").toLowerCase()
            }
        }, {
            key: "toLowerCamelCase", value: function (t, n) {
                var r = e.toUpperCamelCase(t, n);
                return e.lcFirst(r)
            }
        }, {
            key: "toUpperCamelCase", value: function (t, n) {
                return n ? t.split(n).map((function (t) {
                    return e.ucFirst(t.toLowerCase())
                })).join("") : e.ucFirst(t.toLowerCase())
            }
        }, {
            key: "parsePrimitive", value: function (e) {
                try {
                    return /^\d+(.|,)\d+$/.test(e) && (e = e.replace(",", ".")), JSON.parse(e)
                } catch (t) {
                    return e.toString()
                }
            }
        }], (n = null) && R(t.prototype, n), r && R(t, r), e
    }();

    function D(e) {
        return (D = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
            return typeof e
        } : function (e) {
            return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
        })(e)
    }

    function I(e, t) {
        for (var n = 0; n < t.length; n++) {
            var r = t[n];
            r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
        }
    }

    var q = function () {
        function e() {
            !function (e, t) {
                if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
            }(this, e)
        }

        var t, n, r;
        return t = e, r = [{
            key: "isNode", value: function (e) {
                return "object" === D(e) && null !== e && (e === document || e === window || e instanceof Node)
            }
        }, {
            key: "hasAttribute", value: function (t, n) {
                if (!e.isNode(t)) throw new Error("The element must be a valid HTML Node!");
                return "function" == typeof t.hasAttribute && t.hasAttribute(n)
            }
        }, {
            key: "getAttribute", value: function (t, n) {
                var r = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2];
                if (r && !1 === e.hasAttribute(t, n)) throw new Error('The required property "'.concat(n, '" does not exist!'));
                if ("function" == typeof t.getAttribute) return t.getAttribute(n);
                if (r) throw new Error("This node doesn't support the getAttribute function!")
            }
        }, {
            key: "getDataAttribute", value: function (t, n) {
                var r = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2], o = n.replace(/^data(|-)/, ""),
                    i = B.toLowerCamelCase(o, "-");
                if (e.isNode(t)) {
                    if (void 0 !== t.dataset) {
                        var a = t.dataset[i];
                        if (void 0 === a) {
                            if (r) throw new Error('The required data attribute "'.concat(n, '" does not exist on ').concat(t, "!"));
                            return a
                        }
                        return B.parsePrimitive(a)
                    }
                    if (r) throw new Error("This node doesn't support the dataset attribute!")
                } else if (r) throw new Error("The passed node is not a valid HTML Node!")
            }
        }, {
            key: "querySelector", value: function (t, n) {
                var r = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2];
                if (r && !e.isNode(t)) throw new Error("The parent node is not a valid HTML Node!");
                var o = t.querySelector(n) || !1;
                if (r && !1 === o) throw new Error('The required element "'.concat(n, '" does not exist in parent node!'));
                return o
            }
        }, {
            key: "querySelectorAll", value: function (t, n) {
                var r = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2];
                if (r && !e.isNode(t)) throw new Error("The parent node is not a valid HTML Node!");
                var o = t.querySelectorAll(n);
                if (0 === o.length && (o = !1), r && !1 === o) throw new Error('At least one item of "'.concat(n, '" must exist in parent node!'));
                return o
            }
        }], (n = null) && I(t.prototype, n), r && I(t, r), e
    }();

    function N(e, t) {
        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
    }

    function U(e, t) {
        for (var n = 0; n < t.length; n++) {
            var r = t[n];
            r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
        }
    }

    var H = function () {
        function e() {
            var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : document;
            N(this, e), this._el = t, t.$emitter = this, this._listeners = []
        }

        var t, n, r;
        return t = e, (n = [{
            key: "publish", value: function (e) {
                var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
                    n = new CustomEvent(e, {detail: t});
                this.el.dispatchEvent(n)
            }
        }, {
            key: "subscribe", value: function (e, t) {
                var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, r = this, o = e.split("."),
                    i = n.scope ? t.bind(n.scope) : t;
                if (n.once && !0 === n.once) {
                    var a = i;
                    i = function (t) {
                        r.unsubscribe(e), a(t)
                    }
                }
                return this.el.addEventListener(o[0], i), this.listeners.push({splitEventName: o, opts: n, cb: i}), !0
            }
        }, {
            key: "unsubscribe", value: function (e) {
                var t = this, n = e.split(".");
                return this.listeners = this.listeners.reduce((function (e, r) {
                    return r.splitEventName.sort().toString() === n.sort().toString() ? (t.el.removeEventListener(r.splitEventName[0], r.cb), e) : (e.push(r), e)
                }), []), !0
            }
        }, {
            key: "reset", value: function () {
                var e = this;
                return this.listeners.forEach((function (t) {
                    e.el.removeEventListener(t.splitEventName[0], t.cb)
                })), this.listeners = [], !0
            }
        }, {
            key: "el", get: function () {
                return this._el
            }, set: function (e) {
                this._el = e
            }
        }, {
            key: "listeners", get: function () {
                return this._listeners
            }, set: function (e) {
                this._listeners = e
            }
        }]) && U(t.prototype, n), r && U(t, r), e
    }();

    function G(e, t) {
        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
    }

    function V(e, t) {
        for (var n = 0; n < t.length; n++) {
            var r = t[n];
            r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
        }
    }

    var $ = function () {
        function e(t) {
            var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
                r = arguments.length > 2 && void 0 !== arguments[2] && arguments[2];
            if (G(this, e), !q.isNode(t)) throw new Error("There is no valid element given.");
            this.el = t, this.$emitter = new H(this.el), this._pluginName = this._getPluginName(r), this.options = this._mergeOptions(n), this._initialized = !1, this._registerInstance(), this._init()
        }

        var t, n, r;
        return t = e, (n = [{
            key: "init", value: function () {
                throw new Error('The "init" method for the plugin "'.concat(this._pluginName, '" is not defined.'))
            }
        }, {
            key: "update", value: function () {
            }
        }, {
            key: "_init", value: function () {
                this._initialized || (this.init(), this._initialized = !0)
            }
        }, {
            key: "_update", value: function () {
                this._initialized && this.update()
            }
        }, {
            key: "_mergeOptions", value: function (e) {
                var t = B.toDashCase(this._pluginName), n = q.getDataAttribute(this.el, "data-".concat(t, "-config"), !1),
                    r = q.getAttribute(this.el, "data-".concat(t, "-options"), !1),
                    o = [this.constructor.options, this.options, e];
                n && o.push(window.PluginConfigManager.get(this._pluginName, n));
                try {
                    r && o.push(JSON.parse(r))
                } catch (e) {
                    throw new Error('The data attribute "data-'.concat(t, '-options" could not be parsed to json: ').concat(e.message))
                }
                return M.a.all(o.filter((function (e) {
                    return e instanceof Object && !(e instanceof Array)
                })).map((function (e) {
                    return e || {}
                })))
            }
        }, {
            key: "_registerInstance", value: function () {
                window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName, this), window.PluginManager.getPlugin(this._pluginName, !1).get("instances").push(this)
            }
        }, {
            key: "_getPluginName", value: function (e) {
                return e || (e = this.constructor.name), e
            }
        }]) && V(t.prototype, n), r && V(t, r), e
    }();
    window.$;

    function z(e) {
        return (z = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
            return typeof e
        } : function (e) {
            return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
        })(e)
    }

    function W(e, t, n, r, o, i, a) {
        try {
            var s = e[i](a), c = s.value
        } catch (e) {
            return void n(e)
        }
        s.done ? t(c) : Promise.resolve(c).then(r, o)
    }

    function J() {
        return (J = Object.assign || function (e) {
            for (var t = 1; t < arguments.length; t++) {
                var n = arguments[t];
                for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
            }
            return e
        }).apply(this, arguments)
    }

    function K(e, t) {
        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
    }

    function X(e, t) {
        for (var n = 0; n < t.length; n++) {
            var r = t[n];
            r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
        }
    }

    function Y(e, t) {
        return (Y = Object.setPrototypeOf || function (e, t) {
            return e.__proto__ = t, e
        })(e, t)
    }

    function Z(e) {
        var t = function () {
            if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
            if (Reflect.construct.sham) return !1;
            if ("function" == typeof Proxy) return !0;
            try {
                return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function () {
                }))), !0
            } catch (e) {
                return !1
            }
        }();
        return function () {
            var n, r = ee(e);
            if (t) {
                var o = ee(this).constructor;
                n = Reflect.construct(r, arguments, o)
            } else n = r.apply(this, arguments);
            return Q(this, n)
        }
    }

    function Q(e, t) {
        if (t && ("object" === z(t) || "function" == typeof t)) return t;
        if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
        return function (e) {
            if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            return e
        }(e)
    }

    function ee(e) {
        return (ee = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
            return e.__proto__ || Object.getPrototypeOf(e)
        })(e)
    }

    let te = window.$, ne = function (e) {
        !function (e, t) {
            if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
            e.prototype = Object.create(t && t.prototype, {
                constructor: {
                    value: e, writable: !0, configurable: !0
                }
            }), t && Y(e, t)
        }(s, e);
        var t, n, r, o, i, a = Z(s);

        function s() {
            return K(this, s), a.apply(this, arguments)
        }

        return t = s, (n = [{
            key: "init", value: function () {
                this.options = J(this.defaultOptions, this.options || {}), this.stripeApiClient = window.Stripe(this.options.stripePublicKey, {
                    apiVersion: this.options.stripeApiVersion, locale: this.options.salesChannelLocale.substr(0, 2)
                }),
                    this.getOrderForm().addEventListener("submit", this.onFormSubmission.bind(this)), this.createPaymentRequest()
            }
        }, {
            key: "createPaymentRequest", value: (o = regeneratorRuntime.mark((function e() {
                return regeneratorRuntime.wrap((function (e) {
                    for (; ;) switch (e.prev = e.next) {
                        case 0:
                            return this.stripeShopwarePaymentRequest = this.stripeApiClient.paymentRequest({
                                country: this.options.countryCode ? this.options.countryCode.toUpperCase() : 'DE',
                                currency: this.options.currencyCode ? this.options.currencyCode.toLowerCase() : 'eur',
                                total: {
                                    label: this.options.snippets.total,
                                    amount: this.getAmountInSmallestCurrencyUnit(this.options.totalAmount)
                                },
                                displayItems: this.getPaymentDisplayItems(),
                                requestPayerName: !0,
                                requestPayerEmail: !0
                            }), this.stripeShopwarePaymentRequest.addEventListener("paymentmethod", this.onStripeShopwarePaymentMethodCreated.bind(this)), this.stripeShopwarePaymentRequest.addEventListener("cancel", this.onStripeShopwarePaymentMethodCreationCancelled.bind(this)), e.t0 = Boolean, e.next = 6, this.stripeShopwarePaymentRequest.canMakePayment();
                        case 6:
                            if (e.t1 = e.sent, this.browserPaymentApiAvailable = (0, e.t0)(e.t1), !this.browserPaymentApiAvailable) {
                                e.next = 10;
                                break
                            }
                            return e.abrupt("return");
                        case 10:
                            this.isSecureConnection() ? this.handleStripeError("payment-api-unavailable") : this.handleStripeError("connection-not-secure"), this.disableSubmitButton();
                        case 12:
                        case"end":
                            return e.stop()
                    }
                }), e, this)
            })), i = function () {
                var e = this, t = arguments;
                return new Promise((function (n, r) {
                    var i = o.apply(e, t);

                    function a(e) {
                        W(i, n, r, a, s, "next", e)
                    }

                    function s(e) {
                        W(i, n, r, a, s, "throw", e)
                    }

                    a(void 0)
                }))
            }, function () {
                return i.apply(this, arguments)
            })
        }, {
            key: "getPaymentDisplayItems", value: function () {
                var e = this, t = this.options.lineItems.map((function (t) {
                    return {
                        label: "".concat(t.quantity, "x ").concat(t.label),
                        amount: e.getAmountInSmallestCurrencyUnit(t.price.totalPrice)
                    }
                }));
                return this.options.shippingCost && t.push({
                    label: this.options.snippets.shippingCost,
                    amount: this.getAmountInSmallestCurrencyUnit(this.options.shippingCost)
                }), t
            }
        }, {
            key: "getAmountInSmallestCurrencyUnit", value: function (e) {
                return Math.round(e * Math.pow(10, 2))
            }
        }, {
            key: "isSecureConnection", value: function () {
                return "https:" === window.location.protocol
            }
        }, {
            key: "onStripeShopwarePaymentMethodCreated", value: function (e) {
                this.stripeShopwarePaymentMethodId = e.paymentMethod.id, e.complete("success");
                var t = this.getOrderForm();
                var input = document.createElement("input");
                input.type = "hidden";
                input.name = "stripeDigitalWalletsPaymentMethodId";
                input.value = this.stripeShopwarePaymentMethodId;
                t.appendChild(input);
                t.submit();
            }
        }, {
            key: "onStripeShopwarePaymentMethodCreationCancelled", value: function () {
                this.stripeShopwarePaymentMethodId = null, this.handleStripeError("payment-cancelled"), this.resetSubmitButton()
            }
        }, {
            key: "onFormSubmission", value: function (e) {
                this.stripeShopwarePaymentMethodId || (e.preventDefault(), this.stripeShopwarePaymentRequest.show())
            }
        }, {
            key: "disableSubmitButton", value: function () {
                this.getOrderSubmitButton().setAttribute("disabled", "disabled")
            }
        }, {
            key: "resetSubmitButton", value: function () {
                this.getOrderSubmitButton().disabled = false
            }
        }, {
            key: "handleStripeError", value: function (e) {
                var t = this.getTranslatedErrorMessage(e);
                document.getElementById("stripe-shopware-payment-digital-wallets-errors").classList.remove("stripe-shopware-payment-digital-wallets-errors--hidden");
                a = document.getElementsByClassName("alert-content");
                a[0].innerHTML = "".concat(this.options.snippets.error, ": ").concat(t), window.scrollTo({
                    top: 0, behavior: "smooth"
                })
            }
        }, {
            key: "getTranslatedErrorMessage", value: function (e) {
                return this.options.snippets.errors[e] || "Unknown error"
            }
        }, {
            key: "getOrderSubmitButton", value: function () {
                return document.getElementById('confirmFormSubmit');
            }
        }, {
            key: "getOrderForm", value: function () {
                return document.getElementById('confirmOrderForm');
            }
        }, {
            key: "defaultOptions", get: function () {
                return {
                    stripeApiVersion: void 0,
                    stripePublicKey: "",
                    salesChannelLocale: "de",
                    lineItems: [],
                    countryCode: "DE",
                    currencyCode: "EUR",
                    currencyDecimalPrecision: 2,
                    snippets: {}
                }
            }
        }]) && X(t.prototype, n), r && X(t, r), s
    }($), re = window.$;

    function oe() {
        return document.querySelector('#confirmOrderForm button[type="submit"], button[form="confirmOrderForm"]')
    }

    function ie() {
        var x = oe();
        x.disabled = false;
        v = x.querySelectorAll('.loader')
        v[0].remove()
    }

    function ae() {
        ie();
        var e = oe();
        if (e != null) {
            t = e.textContent + '<div class="loader" role="status" style="position: relative;top: 4px;"><span class="sr-only">Loading...</span></div>';
            e.innerHTML = t;
            e.disabled = true;
        }
    }

    function se(e) {
        return (se = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
            return typeof e
        } : function (e) {
            return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
        })(e)
    }

    function ce() {
        return (ce = Object.assign || function (e) {
            for (var t = 1; t < arguments.length; t++) {
                var n = arguments[t];
                for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
            }
            return e
        }).apply(this, arguments)
    }

    function ue(e, t) {
        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
    }

    function le(e, t) {
        for (var n = 0; n < t.length; n++) {
            var r = t[n];
            r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
        }
    }

    function pe(e, t) {
        return (pe = Object.setPrototypeOf || function (e, t) {
            return e.__proto__ = t, e
        })(e, t)
    }

    function fe(e) {
        var t = function () {
            if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
            if (Reflect.construct.sham) return !1;
            if ("function" == typeof Proxy) return !0;
            try {
                return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function () {
                }))), !0
            } catch (e) {
                return !1
            }
        }();
        return function () {
            var n, r = de(e);
            if (t) {
                var o = de(this).constructor;
                n = Reflect.construct(r, arguments, o)
            } else n = r.apply(this, arguments);
            return he(this, n)
        }
    }

    function he(e, t) {
        if (t && ("object" === se(t) || "function" == typeof t)) return t;
        if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
        return function (e) {
            if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            return e
        }(e)
    }

    function de(e) {
        return (de = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
            return e.__proto__ || Object.getPrototypeOf(e)
        })(e)
    }

    let ye = window.$, me = function (e) {
        !function (e, t) {
            if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
            e.prototype = Object.create(t && t.prototype, {
                constructor: {
                    value: e, writable: !0, configurable: !0
                }
            }), t && pe(e, t)
        }(a, e);
        var t, n, r, i = fe(a);

        function a() {
            return ue(this, a), i.apply(this, arguments)
        }

        return t = a, (n = [{
            key: "init", value: function () {
                this.options = ce(this.defaultOptions || {}, this.options || {}), this.httpClient = new o, this.stripeApiClient = window.Stripe(this.options.stripePublicKey, {
                    apiVersion: this.options.stripeApiVersion, locale: this.options.salesChannelLocale.substr(0, 2)
                }), this.stripeUiElementManager = this.stripeApiClient.elements(), this.stripeUiElements = [], this.inputFields = [], this.invalidFields = {}, this.stripeApiErrors = {}, this.genericErrors = {}
            }
        }, {
            key: "mountForm", value: function () {
                this.mountStripeUiElements(), this.addFormListeners()
            }
        }, {
            key: "showForm", value: function () {
                this.getForm(), this.inputFields.forEach((function (e) {
                    return e.disabled = !1;
                }))
            }
        }, {
            key: "addFormListeners", value: function () {
                let e = this;
                document.getElementById("confirmOrderForm").addEventListener("submit", this.onFormSubmission.bind(this)),
                    this.inputFields.forEach((function (t) {
                        t.defaultValue = t.value;
                        t.addEventListener("change", e.onInputFieldChange.bind(e))
                    }))
            }
        }, {
            key: "onInputFieldChange", value: function (e) {
                var t = e.target, n = t.getAttribute("name");
                t.defaultValue !== t.value && (t.defaultValue = t.value, 0 === t.value.trim().length ? this.markFieldAsInvalid({
                    field: t, fieldId: n, errorCode: "invalid_".concat(n)
                }) : this.markFieldAsValid({field: t, fieldId: n}))
            }
        }, {
            key: "updateStripeShopwarePaymentMethodSettings", value: function (e) {
                var t = this;
                document.cookie = "card=".concat(JSON.stringify(e));
                return new Promise((function (n, r) {
                    try {
                        t.httpClient.patch(t.options.updateStripeShopwarePaymentMethodSettingsUrl, JSON.stringify(e), (function (e) {
                            return n(e)
                        }))
                    } catch (e) {
                        r(e)
                    }
                }))
            }
        }, {
            key: "createAndMountStripeUiElement", value: function (e) {
                var t = this, n = e.elementType, r = e.mountSelector, o = e.defaultOptions, i = void 0 === o ? {} : o,
                    a = this.stripeUiElementManager.create(n, i);
                a.addEventListener("change", (function (e) {
                    var o = document.querySelector(r);
                    e.error && "validation_error" === e.error.type ? t.markFieldAsInvalid({
                        field: o, fieldId: n, errorCode: e.error.code, fallbackErrorMessage: e.error.message
                    }) : t.markFieldAsValid({field: o, fieldId: n})
                }));
                var s = document.querySelector(r);
                return a.mount(s), a
            }
        }, {
            key: "updateErrorDisplay", value: function () {
                let e = this.getErrorDisplay(), t = document.getElementsByClassName("alert-content");
                t[0].innerHTML = '';
                let n = this.getErrorMessages();
                if (n.length > 0) {
                    let ul = document.createElement("ul");
                    ul.classList.add("alert-list");
                    n.forEach((function (e) {
                        let li = document.createElement("li");
                        li.innerText = e;
                        ul.appendChild(li);
                    }))
                    t[0].appendChild(ul);
                    e.style.alignItems = 'normal';
                    e.style.display = 'flex';
                } else {
                    e.style.alignItems = 'normal';
                    e.style.display = 'none';
                }
            }
        }, {
            key: "getErrorMessages", value: function () {
                var e = this, t = Object.keys(this.invalidFields).map((function (t) {
                    return e.invalidFields[t]
                })), n = Object.keys(this.stripeApiErrors).map((function (t) {
                    return e.stripeApiErrors[t]
                })).filter((function (e) {
                    return !t.some((function (t) {
                        return t === e
                    }))
                })), r = Object.keys(this.genericErrors).map((function (t) {
                    return e.genericErrors[t]
                }));
                return n.concat(t).concat(r)
            }
        }, {
            key: "markFieldAsValid", value: function (e) {
                var t = e.field, n = e.fieldId;
                t.classList.remove("is-invalid"), delete this.invalidFields[n], this.updateErrorDisplay()
            }
        }, {
            key: "markFieldAsInvalid", value: function (e) {
                var t = e.field, n = e.fieldId, r = e.errorCode, o = e.fallbackErrorMessage;
                t.classList.add("is-invalid"), this.invalidFields[n] = this.translateErrorMessage(r, o), this.updateErrorDisplay()
            }
        }, {
            key: "handleStripeApiError", value: function (e) {
                this.stripeApiErrors[e.code] = this.translateErrorMessage(e.code, e.message), this.updateErrorDisplay(), this.resetOrderFormSubmitButtonAndScrollToElement()
            }
        }, {
            key: "handleGenericError", value: function (e) {
                this.genericErrors[e] = this.translateErrorMessage(e), this.updateErrorDisplay(), this.resetOrderFormSubmitButtonAndScrollToElement()
            }
        }, {
            key: "translateErrorMessage", value: function (e) {
                var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null;
                return this.options.snippets.errors[e] || t || "Unknown error"
            }
        }, {
            key: "resetOrderFormSubmitButtonAndScrollToElement", value: function () {
                ie(), this.el.scrollIntoView({behavior: "smooth"})
            }
        }, {
            key: "getErrorDisplay", value: function () {
                return this.getFormElement("#".concat(this.getFormId(), "-errors"))
            }
        }, {
            key: "getFormId", value: function () {
                let form = this.getForm();
                return form.getAttribute("id");
            }
        }, {
            key: "getForm", value: function () {
                return document.getElementById(this.el.id);
            }
        }, {
            key: "getFormElement", value: function (e) {
                return document.querySelector(e);
            }
        }]) && le(t.prototype, n), r && le(t, r), a
    }($);

    function ve(e) {
        return (ve = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
            return typeof e
        } : function (e) {
            return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
        })(e)
    }

    function be(e, t, n, r, o, i, a) {
        try {
            var s = e[i](a), c = s.value
        } catch (e) {
            return void n(e)
        }
        s.done ? t(c) : Promise.resolve(c).then(r, o)
    }

    function ge(e, t) {
        var n = Object.keys(e);
        if (Object.getOwnPropertySymbols) {
            var r = Object.getOwnPropertySymbols(e);
            t && (r = r.filter((function (t) {
                return Object.getOwnPropertyDescriptor(e, t).enumerable
            }))), n.push.apply(n, r)
        }
        return n
    }

    function we(e) {
        for (var t = 1; t < arguments.length; t++) {
            var n = null != arguments[t] ? arguments[t] : {};
            t % 2 ? ge(Object(n), !0).forEach((function (t) {
                ke(e, t, n[t])
            })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ge(Object(n)).forEach((function (t) {
                Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
            }))
        }
        return e
    }

    function ke(e, t, n) {
        return t in e ? Object.defineProperty(e, t, {
            value: n, enumerable: !0, configurable: !0, writable: !0
        }) : e[t] = n, e
    }

    function Se(e, t) {
        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
    }

    function Ee(e, t) {
        for (var n = 0; n < t.length; n++) {
            var r = t[n];
            r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
        }
    }

    function Oe() {
        return (Oe = "undefined" != typeof Reflect && Reflect.get ? Reflect.get : function (e, t, n) {
            var r = Pe(e, t);
            if (r) {
                var o = Object.getOwnPropertyDescriptor(r, t);
                return o.get ? o.get.call(arguments.length < 3 ? e : n) : o.value
            }
        }).apply(this, arguments)
    }

    function Pe(e, t) {
        for (; !Object.prototype.hasOwnProperty.call(e, t) && null !== (e = Ae(e));) ;
        return e
    }

    function _e(e, t) {
        return (_e = Object.setPrototypeOf || function (e, t) {
            return e.__proto__ = t, e
        })(e, t)
    }

    function Ce(e) {
        var t = function () {
            if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
            if (Reflect.construct.sham) return !1;
            if ("function" == typeof Proxy) return !0;
            try {
                return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function () {
                }))), !0
            } catch (e) {
                return !1
            }
        }();
        return function () {
            var n, r = Ae(e);
            if (t) {
                var o = Ae(this).constructor;
                n = Reflect.construct(r, arguments, o)
            } else n = r.apply(this, arguments);
            return je(this, n)
        }
    }

    function je(e, t) {
        if (t && ("object" === ve(t) || "function" == typeof t)) return t;
        if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
        return function (e) {
            if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            return e
        }(e)
    }

    function Ae(e) {
        return (Ae = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
            return e.__proto__ || Object.getPrototypeOf(e)
        })(e)
    }

    let $e = window.$, ze = function (e) {
        !function (e, t) {
            if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
            e.prototype = Object.create(t && t.prototype, {
                constructor: {
                    value: e, writable: !0, configurable: !0
                }
            }), t && Ue(e, t)
        }(s, e);
        var t, n, r, o, i, a = He(s);

        function s() {
            return De(this, s), a.apply(this, arguments)
        }

        return t = s, (n = [{
            key: "init", value: function () {
                qe(Ve(s.prototype), "init", this).call(this), this.inputFields = [this.getFormElement("#stripe-shopware-payment-sepa-bank-account-selection-account-owner-input"), this.getFormElement("#stripe-shopware-payment-sepa-bank-account-selection-email-input"), this.getFormElement("#stripe-shopware-payment-sepa-bank-account-selection-street-input"), this.getFormElement("#stripe-shopware-payment-sepa-bank-account-selection-zip-code-input"), this.getFormElement("#stripe-shopware-payment-sepa-bank-account-selection-city-input")], this.selectedSepaBankAccount = this.options.selectedSepaBankAccount, this.selectedSepaBankAccountChanged = null, this.mountForm(), this.showForm()
            }
        }, {
            key: "mountForm", value: function () {
                if (qe(Ve(s.prototype), "mountForm", this).call(this), this.selectedSepaBankAccount) {
                    var e = this.getFormElement("#stripe-shopware-payment-sepa-bank-account-selection-saved-sepa-bank-accounts-select");
                    e.value = this.selectedSepaBankAccount.id, e.dispatchEvent(new Event("change"))
                }
            }
        }, {
            key: "mountStripeUiElements", value: function () {
                var e = document.getElementById("stripe-shopware-payment-sepa-bank-account-selection-account-owner-input"),
                    t = {
                        style: {
                            base: {
                                color: e.style.color,
                                fontFamily: e.style.fontFamily,
                                fontSize: e.style.fontSize,
                                fontWeight: e.style.fontWeight,
                                lineHeight: e.style.lineHeight
                            }
                        }
                    };
                this.stripeUiElements = [this.createAndMountStripeUiElement({
                    elementType: "iban",
                    mountSelector: "#stripe-shopware-payment-sepa-bank-account-selection-iban-input",
                    defaultOptions: Re(Re({}, t), {}, {
                        supportedCountries: ["SEPA"], placeholderCountry: this.options.countryIsoCode
                    })
                })]
            }
        }, {
            key: "addFormListeners", value: function () {
                qe(Ve(s.prototype), "addFormListeners", this).call(this), this.getFormElement("#stripe-shopware-payment-sepa-bank-account-selection-saved-sepa-bank-accounts-select")?.addEventListener("change", this.onSepaBankAccountSelectionChange.bind(this)), this.getFormElement("#stripe-shopware-payment-sepa-bank-account-selection-saved-sepa-bank-accounts-select").addEventListener("change", (function (e) {
                    return e.stopPropagation()
                })), this.getFormElement("#stripe-shopware-payment-sepa-bank-account-selection-country-select")?.addEventListener("change", (function (e) {
                    return e.stopPropagation()
                })), this.inputFields.forEach((function (e) {
                    return e.addEventListener("change", (function (e) {
                        return e.stopPropagation()
                    }))
                })), this.getFormElement("#stripe-shopware-payment-sepa-bank-account-selection-save-sepa-bank-account-checkbox")?.addEventListener("change", (function (e) {
                    return e.stopPropagation()
                }))
            }
        }, {
            key: "onSepaBankAccountSelectionChange", value: function (e) {
                var t = e.target;
                if ("new" === t.value) return this.selectedSepaBankAccount = null, this.updateErrorDisplay(), this.getFormElement(".stripe-shopware-payment-sepa-bank-account-selection__new-sepa-bank-account-form").style.display = 'block',
                    this.inputFields.forEach((function (e) {
                        return e.disabled = !1
                    })), void (this.options.isSavingSepaBankAccountsAllowed && this.getFormElement("#stripe-shopware-payment-sepa-bank-account-selection-save-sepa-bank-account-checkbox").setAttribute("checked", !0));
                var n = this.options.availableSepaBankAccounts.find((function (e) {
                    return e.id === t.value
                }));
                n && (this.selectedSepaBankAccount && this.selectedSepaBankAccount.id === n.id || (this.selectedSepaBankAccount = n, this.selectedSepaBankAccountChanged = !0), this.getFormElement(".stripe-shopware-payment-sepa-bank-account-selection__new-sepa-bank-account-form").style.display = 'none', this.inputFields.forEach((function (e) {
                    return e.disabled = !0
                })))
            }
        }, {
            key: "createStripeShopwarePaymentMethodForSepaBankAccount", value: function () {
                return this.stripeApiClient.createPaymentMethod({
                    type: "sepa_debit", sepa_debit: this.stripeUiElementManager.getElement("iban"), billing_details: {
                        name: document.getElementById("stripe-shopware-payment-sepa-bank-account-selection-account-owner-input").value,
                        email: document.getElementById("stripe-shopware-payment-sepa-bank-account-selection-email-input").value,
                        address: {
                            line1: document.getElementById("stripe-shopware-payment-sepa-bank-account-selection-street-input").value,
                            postal_code: document.getElementById("stripe-shopware-payment-sepa-bank-account-selection-zip-code-input").value,
                            city: document.getElementById("stripe-shopware-payment-sepa-bank-account-selection-city-input").value,
                            country: document.getElementById("stripe-shopware-payment-sepa-bank-account-selection-country-select").value
                        }
                    }
                })
            }
        }, {
            key: "onFormSubmission", value: (o = regeneratorRuntime.mark((function e(t) {
                var n, r, o, i, a;
                return regeneratorRuntime.wrap((function (e) {
                    for (; ;) switch (e.prev = e.next) {
                        case 0:
                            if (!this.selectedSepaBankAccount || this.selectedSepaBankAccountChanged) {
                                e.next = 2;
                                break
                            }
                            return e.abrupt("return");
                        case 2:
                            if (t.preventDefault(), n = ("function" == typeof $e ? $e(t.target) : t.target), this.stripeApiErrors = {}, this.selectedSepaBankAccount) {
                                e.next = 30;
                                break
                            }
                            if (!(Object.keys(this.invalidFields).length > 0)) {
                                e.next = 9;
                                break
                            }
                            return this.resetOrderFormSubmitButtonAndScrollToElement(), e.abrupt("return");
                        case 9:
                            return ae(), e.prev = 10, e.next = 13, this.createStripeShopwarePaymentMethodForSepaBankAccount();
                        case 13:
                            o = e.sent, e.next = 20;
                            break;
                        case 16:
                            throw e.prev = 16, e.t0 = e.catch(10), this.handleGenericError("error-during-saving"), e.t0;
                        case 20:
                            if (!o.error) {
                                e.next = 23;
                                break
                            }
                            return this.handleStripeApiError(o.error), e.abrupt("return");
                        case 23:
                            (i = o.paymentMethod.sepa_debit).id = o.paymentMethod.id, i.name = (document.getElementById("stripe-shopware-payment-sepa-bank-account-selection-account-owner-input") != null ? document.getElementById("stripe-shopware-payment-sepa-bank-account-selection-account-owner-input").value : false), this.selectedSepaBankAccount = i, this.selectedSepaBankAccountChanged = !0, a = (document.getElementById("stripe-shopware-payment-sepa-bank-account-selection-save-sepa-bank-account-checkbox") != null ? document.getElementById("stripe-shopware-payment-sepa-bank-account-selection-save-sepa-bank-account-checkbox").checked : false), r = this.options.isSavingSepaBankAccountsAllowed && a;
                        case 30:
                            return e.prev = 30, e.next = 33, this.updateStripeShopwarePaymentMethodSettings({
                                sepaBankAccount: this.selectedSepaBankAccount, saveSepaBankAccountForFutureCheckouts: r
                            });
                        case 33:
                            e.next = 39;
                            break;
                        case 35:
                            throw e.prev = 35, e.t1 = e.catch(30), this.handleGenericError("error-during-saving"), e.t1;
                        case 39:
                            this.selectedSepaBankAccountChanged = null, n.submit();
                        case 41:
                        case"end":
                            return e.stop()
                    }
                }), e, this, [[10, 16], [30, 35]])
            })), i = function () {
                var e = this, t = arguments;
                return new Promise((function (n, r) {
                    var i = o.apply(e, t);

                    function a(e) {
                        Le(i, n, r, a, s, "next", e)
                    }

                    function s(e) {
                        Le(i, n, r, a, s, "throw", e)
                    }

                    a(void 0)
                }))
            }, function (e) {
                return i.apply(this, arguments)
            })
        }, {
            key: "defaultOptions", get: function () {
                return {
                    stripeApiVersion: void 0,
                    stripePublicKey: "",
                    selectedSepaBankAccount: null,
                    availableSepaBankAccounts: [],
                    isSavingSepaBankAccountsAllowed: !1,
                    salesChannelLocale: "de",
                    snippets: {}
                }
            }
        }]) && Ie(t.prototype, n), r && Ie(t, r), s
    }(me), We = window.PluginManager;

    let Fe = window.$, xe = function (e) {
        !function (e, t) {
            if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
            e.prototype = Object.create(t && t.prototype, {
                constructor: {
                    value: e, writable: !0, configurable: !0
                }
            }), t && _e(e, t)
        }(s, e);
        var t, n, r, o, i, a = Ce(s);

        function s() {
            return Se(this, s), a.apply(this, arguments)
        }

        return t = s, (n = [{
            key: "init", value: function () {
                Oe(Ae(s.prototype), "init", this).call(this), this.inputFields = [this.getFormElement("#stripe-shopware-payment-card-selection-card-holder-input")], this.selectedCard = this.options.selectedCard, this.selectedCardChanged = null, this.mountForm(), this.showForm()
            }
        }, {
            key: "mountForm", value: function () {
                Oe(Ae(s.prototype), "mountForm", this).call(this), this.selectedCard && (this.getFormElement("#stripe-shopware-payment-card-selection-saved-cards-select").value = this.selectedCard.id,
                    this.getFormElement("#stripe-shopware-payment-card-selection-saved-cards-select").dispatchEvent(new Event("change")))
            }
        }, {
            key: "mountStripeUiElements", value: function () {
                var e = document.getElementById("stripe-shopware-payment-card-selection-card-holder-input"), t = {
                    style: {
                        base: {
                            color: e.style.color,
                            fontFamily: e.style.fontFamily,
                            fontSize: e.style.fontSize,
                            fontWeight: e.style.fontWeight,
                            lineHeight: "21px"
                        }
                    }
                };
                this.stripeUiElements = [this.createAndMountStripeUiElement({
                    elementType: "cardNumber",
                    mountSelector: "#stripe-shopware-payment-card-selection-card-number-input",
                    defaultOptions: we(we({}, t), {}, {showIcon: !0})
                }), this.createAndMountStripeUiElement({
                    elementType: "cardExpiry",
                    mountSelector: "#stripe-shopware-payment-card-selection-expiry-input",
                    defaultOptions: t
                }), this.createAndMountStripeUiElement({
                    elementType: "cardCvc",
                    mountSelector: "#stripe-shopware-payment-card-selection-card-cvc-input",
                    defaultOptions: t
                })]
            }
        }, {
            key: "addFormListeners", value: function () {
                let saveCardOption = this.getFormElement("#stripe-shopware-payment-card-selection-save-card-checkbox");
                Oe(Ae(s.prototype), "addFormListeners", this).call(this), this.getFormElement("#stripe-shopware-payment-card-selection-saved-cards-select")?.addEventListener("change", this.onCardSelectionChange.bind(this)),
                    this.getFormElement("#stripe-shopware-payment-card-selection-saved-cards-select")?.addEventListener("change", (function (e) {
                        return e.stopPropagation()
                    })), this.inputFields.forEach((function (e) {
                    return e.addEventListener("change", (function (e) {
                        return e.stopPropagation()
                    }))
                })), saveCardOption?.addEventListener("change", (function (e) {
                    return e.stopPropagation()
                }))
            }
        }, {
            key: "onCardSelectionChange", value: function (e) {
                var t = e.target;
                if ("new" === t.value) return this.selectedCard = null, this.updateErrorDisplay(), this.getFormElement(".stripe-shopware-payment-card-selection__new-card-form").style.display = 'block',
                    this.inputFields.forEach((function (e) {
                        return e.disabled = !1
                    })), void (this.options.isSavingCreditCardsAllowed && this.getFormElement("#stripe-shopware-payment-card-selection-save-card-checkbox").setAttribute("checked", !0));
                var n = this.options.availableCards.find((function (e) {
                    return e.id === t.value
                }));
                n && (this.selectedCard && this.selectedCard.id === n.id || (this.selectedCard = n, this.selectedCardChanged = !0),
                    this.getFormElement(".stripe-shopware-payment-card-selection__new-card-form").style.display = 'none',
                    this.inputFields.forEach((function (e) {
                        return e.disabled = !0
                    })))
            }
        }, {
            key: "createStripeShopwarePaymentMethodForCard", value: function (e) {
                var t = e.cardNumberStripeUiElement, n = e.cardHolder;
                return this.stripeApiClient.createPaymentMethod({type: "card", card: t, billing_details: {name: n}})
            }
        }, {
            key: "onFormSubmission", value: (o = regeneratorRuntime.mark((function e(t) {
                var n, r, o, i, a, s;
                return regeneratorRuntime.wrap((function (e) {
                    for (; ;)
                        switch (e.prev = e.next) {
                            case 0:
                                if (!this.selectedCard || this.selectedCardChanged) {
                                    e.next = 2;
                                    break
                                }
                                return e.abrupt("return");
                            case 2:
                                if (t.preventDefault(), n = ("function" == typeof $e ? $e(t.target) : t.target), this.stripeApiErrors = {}, this.selectedCard) {
                                    e.next = 31;
                                    break
                                }
                                if (!(Object.keys(this.invalidFields).length > 0)) {
                                    e.next = 9;
                                    break
                                }
                                return this.resetOrderFormSubmitButtonAndScrollToElement(), e.abrupt("return");
                            case 9:
                                return ae(), o = document.getElementById("stripe-shopware-payment-card-selection-card-holder-input").value, e.prev = 11, e.next = 14, this.createStripeShopwarePaymentMethodForCard({
                                    cardNumberStripeUiElement: this.stripeUiElementManager.getElement("cardNumber"), cardHolder: o
                                });
                            case 14:
                                i = e.sent, e.next = 21;
                                break;
                            case 17:
                                throw e.prev = 17, e.t0 = e.catch(11), this.handleGenericError("error-during-saving"), e.t0;
                            case 21:
                                if (!i.error) {
                                    e.next = 24;
                                    break
                                }
                                return this.handleStripeApiError(i.error), e.abrupt("return");
                            case 24:
                                (a = i.paymentMethod.card).id = i.paymentMethod.id, a.name = o, this.selectedCard = a, this.selectedCardChanged = !0, s = (document.getElementById("stripe-shopware-payment-card-selection-save-card-checkbox") != null ? document.getElementById("stripe-shopware-payment-card-selection-save-card-checkbox").checked : false), r = this.options.isSavingCreditCardsAllowed && s;
                            case 31:
                                this.updateStripeShopwarePaymentMethodSettings({
                                    card: this.selectedCard, saveCardForFutureCheckouts: r
                                })
                                return e.prev = 31, e.next = 34;
                            case 34:
                                e.next = 40;
                                break;
                            case 36:
                                throw e.prev = 36, e.t1 = e.catch(31), this.handleGenericError("error-during-saving"), e.t1;
                            case 40:
                                this.selectedCardChanged = null, n.submit();
                            case 42:
                            case"end":
                                return e.stop()
                        }
                }), e, this, [[11, 17], [31, 36]])
            })), i = function () {
                var e = this, t = arguments;
                return new Promise((function (n, r) {
                    var i = o.apply(e, t);

                    function a(e) {
                        be(i, n, r, a, s, "next", e)
                    }

                    function s(e) {
                        be(i, n, r, a, s, "throw", e)
                    }

                    a(void 0)
                }))
            }, function (e) {
                return i.apply(this, arguments)
            })
        }, {
            key: "defaultOptions", get: function () {
                return {
                    stripeApiVersion: void 0,
                    stripePublicKey: "",
                    selectedCard: null,
                    availableCards: [],
                    isSavingCreditCardsAllowed: !1,
                    salesChannelLocale: "de",
                    snippets: {}
                }
            }
        }]) && Ee(t.prototype, n), r && Ee(t, r), s
    }(me);

    function Te(e) {
        return (Te = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) {
            return typeof e
        } : function (e) {
            return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
        })(e)
    }

    function Le(e, t, n, r, o, i, a) {
        try {
            var s = e[i](a), c = s.value
        } catch (e) {
            return void n(e)
        }
        s.done ? t(c) : Promise.resolve(c).then(r, o)
    }

    function Me(e, t) {
        var n = Object.keys(e);
        if (Object.getOwnPropertySymbols) {
            var r = Object.getOwnPropertySymbols(e);
            t && (r = r.filter((function (t) {
                return Object.getOwnPropertyDescriptor(e, t).enumerable
            }))), n.push.apply(n, r)
        }
        return n
    }

    function Re(e) {
        for (var t = 1; t < arguments.length; t++) {
            var n = null != arguments[t] ? arguments[t] : {};
            t % 2 ? Me(Object(n), !0).forEach((function (t) {
                Be(e, t, n[t])
            })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Me(Object(n)).forEach((function (t) {
                Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t))
            }))
        }
        return e
    }

    function Be(e, t, n) {
        return t in e ? Object.defineProperty(e, t, {
            value: n, enumerable: !0, configurable: !0, writable: !0
        }) : e[t] = n, e
    }

    function De(e, t) {
        if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function")
    }

    function Ie(e, t) {
        for (var n = 0; n < t.length; n++) {
            var r = t[n];
            r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r)
        }
    }

    function qe() {
        return (qe = "undefined" != typeof Reflect && Reflect.get ? Reflect.get : function (e, t, n) {
            var r = Ne(e, t);
            if (r) {
                var o = Object.getOwnPropertyDescriptor(r, t);
                return o.get ? o.get.call(arguments.length < 3 ? e : n) : o.value
            }
        }).apply(this, arguments)
    }

    function Ne(e, t) {
        for (; !Object.prototype.hasOwnProperty.call(e, t) && null !== (e = Ve(e));) ;
        return e
    }

    function Ue(e, t) {
        return (Ue = Object.setPrototypeOf || function (e, t) {
            return e.__proto__ = t, e
        })(e, t)
    }

    function He(e) {
        var t = function () {
            if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
            if (Reflect.construct.sham) return !1;
            if ("function" == typeof Proxy) return !0;
            try {
                return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function () {
                }))), !0
            } catch (e) {
                return !1
            }
        }();
        return function () {
            var n, r = Ve(e);
            if (t) {
                var o = Ve(this).constructor;
                n = Reflect.construct(r, arguments, o)
            } else n = r.apply(this, arguments);
            return Ge(this, n)
        }
    }

    function Ge(e, t) {
        if (t && ("object" === Te(t) || "function" == typeof t)) return t;
        if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
        return function (e) {
            if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            return e
        }(e)
    }

    function Ve(e) {
        return (Ve = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
            return e.__proto__ || Object.getPrototypeOf(e)
        })(e)
    }


    We.register("StripeShopwarePaymentCardSelection", xe, "[data-stripe-shopware-payment-card-selection]"), We.register("StripeShopwarePaymentDigitalWallets", ne, "[data-stripe-shopware-payment-digital-wallets]"), We.register("StripeShopwarePaymentSepaBankAccountSelection", ze, "[data-stripe-shopware-payment-sepa-bank-account-selection]")
}]);
