"use strict";
function _createForOfIteratorHelper(n, t) {
    var i = "undefined" != typeof Symbol && n[Symbol.iterator] || n["@@iterator"], r, t, e, u, f;
    if (!i) {
        if (Array.isArray(n) || (i = _unsupportedIterableToArray(n)) || t && n && "number" == typeof n.length)
            return i && (n = i),
            r = 0,
            t = function() {}
            ,
            {
                s: t,
                n: function() {
                    return r >= n.length ? {
                        done: !0
                    } : {
                        done: !1,
                        value: n[r++]
                    }
                },
                e: function(n) {
                    throw n;
                },
                f: t
            };
        throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
    }
    return u = !0,
    f = !1,
    {
        s: function() {
            i = i.call(n)
        },
        n: function() {
            var n = i.next();
            return u = n.done,
            n
        },
        e: function(n) {
            f = !0;
            e = n
        },
        f: function() {
            try {
                u || null == i.return || i.return()
            } finally {
                if (f)
                    throw e;
            }
        }
    }
}
function _unsupportedIterableToArray(n, t) {
    if (n) {
        if ("string" == typeof n)
            return _arrayLikeToArray(n, t);
        var i = Object.prototype.toString.call(n).slice(8, -1);
        return "Map" === (i = "Object" === i && n.constructor ? n.constructor.name : i) || "Set" === i ? Array.from(n) : "Arguments" === i || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i) ? _arrayLikeToArray(n, t) : void 0
    }
}
function _arrayLikeToArray(n, t) {
    (null == t || t > n.length) && (t = n.length);
    for (var i = 0, r = new Array(t); i < t; i++)
        r[i] = n[i];
    return r
}
function ownKeys(n, t) {
    var i, r = Object.keys(n);
    return Object.getOwnPropertySymbols && (i = Object.getOwnPropertySymbols(n),
    t && (i = i.filter(function(t) {
        return Object.getOwnPropertyDescriptor(n, t).enumerable
    })),
    r.push.apply(r, i)),
    r
}
function _objectSpread(n) {
    for (var i, t = 1; t < arguments.length; t++)
        i = null != arguments[t] ? arguments[t] : {},
        t % 2 ? ownKeys(Object(i), !0).forEach(function(t) {
            _defineProperty(n, t, i[t])
        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(i)) : ownKeys(Object(i)).forEach(function(t) {
            Object.defineProperty(n, t, Object.getOwnPropertyDescriptor(i, t))
        });
    return n
}
function _defineProperty(n, t, i) {
    return t in n ? Object.defineProperty(n, t, {
        value: i,
        enumerable: !0,
        configurable: !0,
        writable: !0
    }) : n[t] = i,
    n
}
function _typeof(n) {
    return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(n) {
        return typeof n
    }
    : function(n) {
        return n && "function" == typeof Symbol && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n
    }
    )(n)
}
function dashboardActivationDataLayer(n) {
    if (window.dataLayer = window.dataLayer || [],
    window.dataLayer && n)
        if (n = n[0].dataset,
        null != n && n.analyticsPersonalisationCode) {
            var t = {
                event: "personalisation",
                personalisation_code: null == n ? void 0 : n.analyticsPersonalisationCode,
                personalisation_name: null == n ? void 0 : n.analyticsPersonalisationName,
                platform: null == n ? void 0 : n.analyticsPlatform,
                personalisation_rule: null == n ? void 0 : n.analyticsPersonalisationRule,
                placement: null == n ? void 0 : n.analyticsPlacement,
                module: null == n ? void 0 : n.analyticsModule
            };
            Object.keys(t).forEach(function(n) {
                return void 0 === t[n] ? delete t[n] : {}
            });
            try {
                window.dataLayer.push(_objectSpread({}, t))
            } catch (n) {}
        } else
            console.log("analyticsPersonalisationCode required")
}
function setDeviceLogCookie(n, t) {
    document.cookie = n + "=" + t + "; ; path=/; secure;"
}
function isAcceptTermsAndConditionsChecked(n, t) {
    t = document.getElementById(t);
    t.disabled = !0 === n.checked ? "" : "disabled"
}
function getInputFieldClasses(n) {
    return n.target.classList.toString()
}
function getInputFieldText(n) {
    return 0 < $("#" + n).val().length ? "Value present" : "Value empty"
}
function getFormStep() {
    return 0 < $(".doc-form.drivers-licence").length ? "Drivers licence" : 0 < $(".doc-form.medicare-card").length ? "Medicare card" : 0 < $(".doc-form.passport").length ? "Passport" : void 0
}
function getInputFieldType(n) {
    return "StateOfIssue" === n || "ReferenceNumber" === n ? "SELECT" : "INPUT"
}
function getInputFieldIndex(n) {
    return 0 < $(".doc-form.drivers-licence").length ? getInputFieldIndexLicence(n) : 0 < $(".doc-form.medicare-card").length ? getInputFieldIndexMedicare(n) : 0 < $(".doc-form.passport").length ? getInputFieldIndexPassport(n) : void 0
}
function getInputFieldIndexLicence(n) {
    return "StateOfIssue" === n ? "1" : "MiddleName" === n ? "2" : "NoMiddleName" === n ? "3" : "LicenceNumber" === n ? "4" : "CardNumber" === n ? "5" : "IdentityVerificationConsent" === n ? "6" : void 0
}
function getInputFieldIndexPassport(n) {
    return "MiddleName" === n ? "1" : "NoMiddleName" === n ? "2" : "PassportNumber" === n ? "3" : "IdentityVerificationConsent" === n ? "4" : void 0
}
function getInputFieldIndexMedicare(n) {
    return "CardColour" === n ? $(CardColour)[0].checked ? "1" : $(CardColour)[1].checked ? "2" : "3" : "MedicareCard" === n ? "4" : "ReferenceNumber" === n ? "5" : "MiddleName" === n ? "6" : "NoMiddleName" === n ? "7" : "MedicareValidTo" === n ? "8" : "IdentityVerificationConsent" === n ? "9" : void 0
}
function getInputFieldLabel(n) {
    return "StateOfIssue" === n ? "State of issue" : "MedicareCard" === n ? "Medicare card number" : "CardColour" === n ? "Card colour" : "MiddleName" === n ? "Middle name" : "NoMiddleName" === n ? "I do not have a middle name" : "LicenceNumber" === n ? "Licence number" : "ReferenceNumber" === n ? "Reference number" : "PassportNumber" === n ? "Passport number" : "CardNumber" === n ? "Card number" : "MedicareValidTo" === n ? "Valid to" : "IdentityVerificationConsent" === n ? "[Member consent]" : void 0
}
function isEmpty(n) {
    return null == n || "" === n
}
function hideCardNumber() {
    document.getElementById("form-group-card-number").style = "display:none";
    document.getElementById("CardNumber").classList.remove("is-valid");
    document.getElementById("CardNumber").value = ""
}
function showCardNumber() {
    document.getElementById("form-group-card-number").style = "display:normal";
    document.getElementById("CardNumber").classList.remove("is-invalid");
    document.getElementById("CardNumber").value = ""
}
function getRulesJsonObjState(n) {
    var r = $(document.getElementById("StateOfIssue")).val()
      , t = JSON.parse(n)
      , i = t.ACT;
    switch (r) {
    case "ACT":
        i = t.ACT;
        break;
    case "NSW":
        i = t.NSW;
        break;
    case "NT":
        i = t.NT;
        break;
    case "QLD":
        i = t.QLD;
        break;
    case "SA":
        i = t.SA;
        break;
    case "TAS":
        i = t.TAS;
        break;
    case "VIC":
        i = t.VIC;
        break;
    case "WA":
        i = t.WA
    }
    return i
}
function setCardNumber(n) {
    isEmpty(n) ? hideCardNumber() : isEmpty(n = document.getElementById("PoiDrivingLicenceRules").value) || ((n = getRulesJsonObjState(n)).IsLive ? (document.getElementById("CardNumberLabel").innerText = n.CardNumberDescriptionText,
    showCardNumber()) : hideCardNumber())
}
function initPOIJourneyTimer() {
    sessionStorage.getItem("TimeInitialEnteryPOI") || sessionStorage.setItem("TimeInitialEnteryPOI", moment())
}
function timeElapsedSincePOIStart() {
    var t = moment()
      , n = sessionStorage.getItem("TimeInitialEnteryPOI")
      , n = t.diff(n, "seconds", !0);
    return Math.round(10 * n) / 10
}
function clearPOIJourneyTimer() {
    sessionStorage.removeItem("TimeInitialEnteryPOI")
}
function initPOIConfirmTimer() {
    sessionStorage.getItem("TimeInitialPOIConfirm") || sessionStorage.setItem("TimeInitialPOIConfirm", moment())
}
function timeElapsedPOIConfirmed() {
    var n = sessionStorage.getItem("TimeInitialPOIConfirm");
    return n ? (n = moment().diff(n, "seconds", !0),
    Math.round(10 * n) / 10) : null
}
function clearPOIConfirmTimer() {
    sessionStorage.removeItem("TimeInitialPOIConfirm")
}
function incrementPOIInteractionsCounter() {
    var n;
    sessionStorage.getItem("IncrementPOIInteractionsCounter") ? (n = parseInt(sessionStorage.getItem("IncrementPOIInteractionsCounter")) + 1,
    sessionStorage.setItem("IncrementPOIInteractionsCounter", n)) : sessionStorage.setItem("IncrementPOIInteractionsCounter", 1)
}
function clearPOIInteractionsCounter() {
    sessionStorage.removeItem("IncrementPOIInteractionsCounter")
}
function getPOIInteractionsCounter() {
    return sessionStorage.getItem("IncrementPOIInteractionsCounter") ? parseInt(sessionStorage.getItem("IncrementPOIInteractionsCounter")) : parseInt("0")
}
function initDatePicker() {
    $(".date-picker").each(function() {
        var n = {
            dateformat: this.dataset.dateformat,
            startDate: this.dataset.startdate,
            endDate: this.dataset.enddate,
            startView: this.dataset.startview,
            minViewMode: this.dataset.minviewmode,
            maxViewMode: this.dataset.maxviewmode,
            autoclose: this.dataset.autoclose
        };
        $(this).data("momentcurrentdate") && (n.todaysDate = moment().format("DD/MM/YYYY"));
        $(this.getElementsByTagName("input")[0]).datepicker({
            format: n.dateformat,
            startDate: n.todaysDate || n.startDate,
            endDate: n.endDate,
            minViewMode: n.minViewMode,
            maxViewMode: n.maxViewMode,
            autoclose: n.autoclose,
            startView: n.startView
        })
    })
}
var abandonSession, triggerGoal, tracking, PushTrackingData, InitPrintLink, InitHelpLink, getInvestmentsOptionPageUrl, loginOnSubmit, showTrusteeSearchNotFoundError, isProd, app, MemberPortal, b, VeeValidateConfig;
!function(n) {
    "function" == typeof define && define.amd ? define(["jquery"], n) : "object" === ("undefined" == typeof exports ? "undefined" : _typeof(exports)) ? n(require("jquery")) : n(jQuery)
}(function(n, t) {
    function f() {
        return new Date(Date.UTC.apply(Date, arguments))
    }
    function o() {
        var n = new Date;
        return f(n.getFullYear(), n.getMonth(), n.getDate())
    }
    function l(n, t) {
        return n.getUTCFullYear() === t.getUTCFullYear() && n.getUTCMonth() === t.getUTCMonth() && n.getUTCDate() === t.getUTCDate()
    }
    function h(i, r) {
        return function() {
            return r !== t && n.fn.datepicker.deprecated(r),
            this[i].apply(this, arguments)
        }
    }
    function u(t, r) {
        n.data(t, "datepicker", this);
        this._events = [];
        this._secondaryEvents = [];
        this._process_options(r);
        this.dates = new v;
        this.viewDate = this.o.defaultViewDate;
        this.focusDate = null;
        this.element = n(t);
        this.isInput = this.element.is("input");
        this.inputField = this.isInput ? this.element : this.element.find("input");
        this.component = !!this.element.hasClass("date") && this.element.find(".add-on, .input-group-addon, .input-group-append, .input-group-prepend, .btn");
        this.component && 0 === this.component.length && (this.component = !1);
        this.isInline = !this.component && this.element.is("div");
        this.picker = n(i.template);
        this._check_template(this.o.templates.leftArrow) && this.picker.find(".prev").html(this.o.templates.leftArrow);
        this._check_template(this.o.templates.rightArrow) && this.picker.find(".next").html(this.o.templates.rightArrow);
        this._buildEvents();
        this._attachEvents();
        this.isInline ? this.picker.addClass("datepicker-inline").appendTo(this.element) : this.picker.addClass("datepicker-dropdown dropdown-menu");
        this.o.rtl && this.picker.addClass("datepicker-rtl");
        this.o.calendarWeeks && this.picker.find(".datepicker-days .datepicker-switch, thead .datepicker-title, tfoot .today, tfoot .clear").attr("colspan", function(n, t) {
            return Number(t) + 1
        });
        this._process_options({
            startDate: this._o.startDate,
            endDate: this._o.endDate,
            daysOfWeekDisabled: this.o.daysOfWeekDisabled,
            daysOfWeekHighlighted: this.o.daysOfWeekHighlighted,
            datesDisabled: this.o.datesDisabled
        });
        this._allow_update = !1;
        this.setViewMode(this.o.startView);
        this._allow_update = !0;
        this.fillDow();
        this.fillMonths();
        this.update();
        this.isInline && this.show()
    }
    function c(t, i) {
        n.data(t, "datepicker", this);
        this.element = n(t);
        this.inputs = n.map(i.inputs, function(n) {
            return n.jquery ? n[0] : n
        });
        delete i.inputs;
        this.keepEmptyValues = i.keepEmptyValues;
        delete i.keepEmptyValues;
        s.call(n(this.inputs), i).on("changeDate", n.proxy(this.dateUpdated, this));
        this.pickers = n.map(this.inputs, function(t) {
            return n.data(t, "datepicker")
        });
        this.updateDates()
    }
    var a, v = (a = {
        get: function(n) {
            return this.slice(n)[0]
        },
        contains: function(n) {
            for (var i = n && n.valueOf(), t = 0, r = this.length; t < r; t++)
                if (0 <= this[t].valueOf() - i && this[t].valueOf() - i < 864e5)
                    return t;
            return -1
        },
        remove: function(n) {
            this.splice(n, 1)
        },
        replace: function(t) {
            t && (n.isArray(t) || (t = [t]),
            this.clear(),
            this.push.apply(this, t))
        },
        clear: function() {
            this.length = 0
        },
        copy: function() {
            var n = new v;
            return n.replace(this),
            n
        }
    },
    function() {
        var t = [];
        return t.push.apply(t, arguments),
        n.extend(t, a),
        t
    }
    ), y, s, e, p, r, i;
    u.prototype = {
        constructor: u,
        _resolveViewName: function(t) {
            return n.each(i.viewModes, function(i, r) {
                if (t === i || -1 !== n.inArray(t, r.names))
                    return t = i,
                    !1
            }),
            t
        },
        _resolveDaysOfWeek: function(t) {
            return n.isArray(t) || (t = t.split(/[,\s]*/)),
            n.map(t, Number)
        },
        _check_template: function(i) {
            try {
                return i === t || "" === i ? !1 : (i.match(/[<>]/g) || []).length <= 0 || 0 < n(i).length
            } catch (i) {
                return !1
            }
        },
        _process_options: function(t) {
            var u, s, l;
            this._o = n.extend({}, this._o, t);
            u = this.o = n.extend({}, this._o);
            s = u.language;
            r[s] || (s = s.split("-")[0],
            r[s] || (s = e.language));
            u.language = s;
            u.startView = this._resolveViewName(u.startView);
            u.minViewMode = this._resolveViewName(u.minViewMode);
            u.maxViewMode = this._resolveViewName(u.maxViewMode);
            u.startView = Math.max(this.o.minViewMode, Math.min(this.o.maxViewMode, u.startView));
            !0 !== u.multidate && (u.multidate = Number(u.multidate) || !1,
            !1 !== u.multidate && (u.multidate = Math.max(0, u.multidate)));
            u.multidateSeparator = String(u.multidateSeparator);
            u.weekStart %= 7;
            u.weekEnd = (u.weekStart + 6) % 7;
            l = i.parseFormat(u.format);
            u.startDate !== -1 / 0 && (u.startDate = u.startDate ? u.startDate instanceof Date ? this._local_to_utc(this._zero_time(u.startDate)) : i.parseDate(u.startDate, l, u.language, u.assumeNearbyYear) : -1 / 0);
            u.endDate !== 1 / 0 && (u.endDate = u.endDate ? u.endDate instanceof Date ? this._local_to_utc(this._zero_time(u.endDate)) : i.parseDate(u.endDate, l, u.language, u.assumeNearbyYear) : 1 / 0);
            u.daysOfWeekDisabled = this._resolveDaysOfWeek(u.daysOfWeekDisabled || []);
            u.daysOfWeekHighlighted = this._resolveDaysOfWeek(u.daysOfWeekHighlighted || []);
            u.datesDisabled = u.datesDisabled || [];
            n.isArray(u.datesDisabled) || (u.datesDisabled = u.datesDisabled.split(","));
            u.datesDisabled = n.map(u.datesDisabled, function(n) {
                return i.parseDate(n, l, u.language, u.assumeNearbyYear)
            });
            var c = String(u.orientation).toLowerCase().split(/\s+/g)
              , h = u.orientation.toLowerCase()
              , c = n.grep(c, function(n) {
                return /^auto|left|right|top|bottom$/.test(n)
            });
            if (u.orientation = {
                x: "auto",
                y: "auto"
            },
            h && "auto" !== h)
                if (1 === c.length)
                    switch (c[0]) {
                    case "top":
                    case "bottom":
                        u.orientation.y = c[0];
                        break;
                    case "left":
                    case "right":
                        u.orientation.x = c[0]
                    }
                else
                    h = n.grep(c, function(n) {
                        return /^left|right$/.test(n)
                    }),
                    u.orientation.x = h[0] || "auto",
                    h = n.grep(c, function(n) {
                        return /^top|bottom$/.test(n)
                    }),
                    u.orientation.y = h[0] || "auto";
            u.defaultViewDate instanceof Date || "string" == typeof u.defaultViewDate ? u.defaultViewDate = i.parseDate(u.defaultViewDate, l, u.language, u.assumeNearbyYear) : u.defaultViewDate ? (t = u.defaultViewDate.year || (new Date).getFullYear(),
            s = u.defaultViewDate.month || 0,
            h = u.defaultViewDate.day || 1,
            u.defaultViewDate = f(t, s, h)) : u.defaultViewDate = o()
        },
        _applyEvents: function(n) {
            for (var f, r, u, i = 0; i < n.length; i++)
                f = n[i][0],
                2 === n[i].length ? (r = t,
                u = n[i][1]) : 3 === n[i].length && (r = n[i][1],
                u = n[i][2]),
                f.on(u, r)
        },
        _unapplyEvents: function(n) {
            for (var f, r, u, i = 0; i < n.length; i++)
                f = n[i][0],
                2 === n[i].length ? (u = t,
                r = n[i][1]) : 3 === n[i].length && (u = n[i][1],
                r = n[i][2]),
                f.off(r, u)
        },
        _buildEvents: function() {
            var t = {
                keyup: n.proxy(function(t) {
                    -1 === n.inArray(t.keyCode, [27, 37, 39, 38, 40, 32, 13, 9]) && this.update()
                }, this),
                keydown: n.proxy(this.keydown, this),
                paste: n.proxy(this.paste, this)
            };
            !0 === this.o.showOnFocus && (t.focus = n.proxy(this.show, this));
            this._events = this.isInput ? [[this.element, t]] : this.component && this.inputField.length ? [[this.inputField, t], [this.component, {
                click: n.proxy(this.show, this)
            }]] : [[this.element, {
                click: n.proxy(this.show, this),
                keydown: n.proxy(this.keydown, this)
            }]];
            this._events.push([this.element, "*", {
                blur: n.proxy(function(n) {
                    this._focused_from = n.target
                }, this)
            }], [this.element, {
                blur: n.proxy(function(n) {
                    this._focused_from = n.target
                }, this)
            }]);
            this.o.immediateUpdates && this._events.push([this.element, {
                "changeYear changeMonth": n.proxy(function(n) {
                    this.update(n.date)
                }, this)
            }]);
            this._secondaryEvents = [[this.picker, {
                click: n.proxy(this.click, this)
            }], [this.picker, ".prev, .next", {
                click: n.proxy(this.navArrowsClick, this)
            }], [this.picker, ".day:not(.disabled)", {
                click: n.proxy(this.dayCellClick, this)
            }], [n(window), {
                resize: n.proxy(this.place, this)
            }], [n(document), {
                "mousedown touchstart": n.proxy(function(n) {
                    this.element.is(n.target) || this.element.find(n.target).length || this.picker.is(n.target) || this.picker.find(n.target).length || this.isInline || this.hide()
                }, this)
            }]]
        },
        _attachEvents: function() {
            this._detachEvents();
            this._applyEvents(this._events)
        },
        _detachEvents: function() {
            this._unapplyEvents(this._events)
        },
        _attachSecondaryEvents: function() {
            this._detachSecondaryEvents();
            this._applyEvents(this._secondaryEvents)
        },
        _detachSecondaryEvents: function() {
            this._unapplyEvents(this._secondaryEvents)
        },
        _trigger: function(t, r) {
            r = r || this.dates.get(-1);
            r = this._utc_to_local(r);
            this.element.trigger({
                type: t,
                date: r,
                viewMode: this.viewMode,
                dates: n.map(this.dates, this._utc_to_local),
                format: n.proxy(function(n, t) {
                    return 0 === arguments.length ? (n = this.dates.length - 1,
                    t = this.o.format) : "string" == typeof n && (t = n,
                    n = this.dates.length - 1),
                    t = t || this.o.format,
                    n = this.dates.get(n),
                    i.formatDate(n, t, this.o.language)
                }, this)
            })
        },
        show: function() {
            if (!(this.inputField.is(":disabled") || this.inputField.prop("readonly") && !1 === this.o.enableOnReadonly))
                return this.isInline || this.picker.appendTo(this.o.container),
                this.place(),
                this.picker.show(),
                this._attachSecondaryEvents(),
                this._trigger("show"),
                (window.navigator.msMaxTouchPoints || "ontouchstart"in document) && this.o.disableTouchKeyboard && n(this.element).blur(),
                this
        },
        hide: function() {
            return this.isInline || !this.picker.is(":visible") || (this.focusDate = null,
            this.picker.hide().detach(),
            this._detachSecondaryEvents(),
            this.setViewMode(this.o.startView),
            this.o.forceParse && this.inputField.val() && this.setValue(),
            this._trigger("hide")),
            this
        },
        destroy: function() {
            return this.hide(),
            this._detachEvents(),
            this._detachSecondaryEvents(),
            this.picker.remove(),
            delete this.element.data().datepicker,
            this.isInput || delete this.element.data().date,
            this
        },
        paste: function(t) {
            var i;
            if (t.originalEvent.clipboardData && t.originalEvent.clipboardData.types && -1 !== n.inArray("text/plain", t.originalEvent.clipboardData.types))
                i = t.originalEvent.clipboardData.getData("text/plain");
            else {
                if (!window.clipboardData)
                    return;
                i = window.clipboardData.getData("Text")
            }
            this.setDate(i);
            this.update();
            t.preventDefault()
        },
        _utc_to_local: function(n) {
            if (!n)
                return n;
            var t = new Date(n.getTime() + 6e4 * n.getTimezoneOffset());
            return t.getTimezoneOffset() !== n.getTimezoneOffset() ? new Date(n.getTime() + 6e4 * t.getTimezoneOffset()) : t
        },
        _local_to_utc: function(n) {
            return n && new Date(n.getTime() - 6e4 * n.getTimezoneOffset())
        },
        _zero_time: function(n) {
            return n && new Date(n.getFullYear(),n.getMonth(),n.getDate())
        },
        _zero_utc_time: function(n) {
            return n && f(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate())
        },
        getDates: function() {
            return n.map(this.dates, this._utc_to_local)
        },
        getUTCDates: function() {
            return n.map(this.dates, function(n) {
                return new Date(n)
            })
        },
        getDate: function() {
            return this._utc_to_local(this.getUTCDate())
        },
        getUTCDate: function() {
            var n = this.dates.get(-1);
            return n !== t ? new Date(n) : null
        },
        clearDates: function() {
            this.inputField.val("");
            this.update();
            this._trigger("changeDate");
            this.o.autoclose && this.hide()
        },
        setDates: function() {
            var t = n.isArray(arguments[0]) ? arguments[0] : arguments;
            return this.update.apply(this, t),
            this._trigger("changeDate"),
            this.setValue(),
            this
        },
        setUTCDates: function() {
            var t = n.isArray(arguments[0]) ? arguments[0] : arguments;
            return this.setDates.apply(this, n.map(t, this._utc_to_local)),
            this
        },
        setDate: h("setDates"),
        setUTCDate: h("setUTCDates"),
        remove: h("destroy", "Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead"),
        setValue: function() {
            var n = this.getFormattedDate();
            return this.inputField.val(n),
            this
        },
        getFormattedDate: function(r) {
            r === t && (r = this.o.format);
            var u = this.o.language;
            return n.map(this.dates, function(n) {
                return i.formatDate(n, r, u)
            }).join(this.o.multidateSeparator)
        },
        getStartDate: function() {
            return this.o.startDate
        },
        setStartDate: function(n) {
            return this._process_options({
                startDate: n
            }),
            this.update(),
            this.updateNavArrows(),
            this
        },
        getEndDate: function() {
            return this.o.endDate
        },
        setEndDate: function(n) {
            return this._process_options({
                endDate: n
            }),
            this.update(),
            this.updateNavArrows(),
            this
        },
        setDaysOfWeekDisabled: function(n) {
            return this._process_options({
                daysOfWeekDisabled: n
            }),
            this.update(),
            this
        },
        setDaysOfWeekHighlighted: function(n) {
            return this._process_options({
                daysOfWeekHighlighted: n
            }),
            this.update(),
            this
        },
        setDatesDisabled: function(n) {
            return this._process_options({
                datesDisabled: n
            }),
            this.update(),
            this
        },
        place: function() {
            if (this.isInline)
                return this;
            var i = this.picker.outerWidth()
              , e = this.picker.outerHeight()
              , t = n(this.o.container)
              , o = t.width()
              , s = ("body" === this.o.container ? n(document) : t).scrollTop()
              , r = t.offset()
              , h = [0];
            this.element.parents().each(function() {
                var t = n(this).css("z-index");
                "auto" !== t && 0 !== Number(t) && h.push(Number(t))
            });
            var c = Math.max.apply(Math, h) + this.o.zIndexOffset
              , u = (this.component ? this.component.parent() : this.element).offset()
              , l = this.component ? this.component.outerHeight(!0) : this.element.outerHeight(!1)
              , f = this.component ? this.component.outerWidth(!0) : this.element.outerWidth(!1)
              , t = u.left - r.left
              , r = u.top - r.top;
            return "body" !== this.o.container && (r += s),
            this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left"),
            "auto" !== this.o.orientation.x ? (this.picker.addClass("datepicker-orient-" + this.o.orientation.x),
            "right" === this.o.orientation.x && (t -= i - f)) : u.left < 0 ? (this.picker.addClass("datepicker-orient-left"),
            t -= u.left - 10) : o < t + i ? (this.picker.addClass("datepicker-orient-right"),
            t += f - i) : this.o.rtl ? this.picker.addClass("datepicker-orient-right") : this.picker.addClass("datepicker-orient-left"),
            i = this.o.orientation.y,
            "auto" === i && (i = -s + r - e < 0 ? "bottom" : "top"),
            this.picker.addClass("datepicker-orient-" + i),
            "top" === i ? r -= e + parseInt(this.picker.css("padding-top")) : r += l,
            this.o.rtl ? this.picker.css({
                top: r,
                right: o - (t + f),
                zIndex: c
            }) : this.picker.css({
                top: r,
                left: t,
                zIndex: c
            }),
            this
        },
        _allow_update: !0,
        update: function() {
            if (!this._allow_update)
                return this;
            var u = this.dates.copy()
              , t = []
              , r = !1;
            return arguments.length ? (n.each(arguments, n.proxy(function(n, i) {
                i instanceof Date && (i = this._local_to_utc(i));
                t.push(i)
            }, this)),
            r = !0) : (t = (t = this.isInput ? this.element.val() : this.element.data("date") || this.inputField.val()) && this.o.multidate ? t.split(this.o.multidateSeparator) : [t],
            delete this.element.data().date),
            t = n.map(t, n.proxy(function(n) {
                return i.parseDate(n, this.o.format, this.o.language, this.o.assumeNearbyYear)
            }, this)),
            t = n.grep(t, n.proxy(function(n) {
                return !this.dateWithinRange(n) || !n
            }, this), !0),
            this.dates.replace(t),
            this.o.updateViewDate && (this.viewDate = this.dates.length ? new Date(this.dates.get(-1)) : this.viewDate < this.o.startDate ? new Date(this.o.startDate) : this.viewDate > this.o.endDate ? new Date(this.o.endDate) : this.o.defaultViewDate),
            r ? (this.setValue(),
            this.element.change()) : this.dates.length && String(u) !== String(this.dates) && r && (this._trigger("changeDate"),
            this.element.change()),
            !this.dates.length && u.length && (this._trigger("clearDate"),
            this.element.change()),
            this.fill(),
            this
        },
        fillDow: function() {
            if (this.o.showWeekDays) {
                var i = this.o.weekStart
                  , t = "<tr>";
                for (this.o.calendarWeeks && (t += '<th class="cw">&#160;<\/th>'); i < this.o.weekStart + 7; )
                    t += '<th class="dow',
                    -1 !== n.inArray(i, this.o.daysOfWeekDisabled) && (t += " disabled"),
                    t += '">' + r[this.o.language].daysMin[i++ % 7] + "<\/th>";
                t += "<\/tr>";
                this.picker.find(".datepicker-days thead").append(t)
            }
        },
        fillMonths: function() {
            for (var t = this._utc_to_local(this.viewDate), i = "", n = 0; n < 12; n++)
                i += '<span class="month' + (t && t.getMonth() === n ? " focused" : "") + '">' + r[this.o.language].monthsShort[n] + "<\/span>";
            this.picker.find(".datepicker-months td").html(i)
        },
        setRange: function(t) {
            t && t.length ? this.range = n.map(t, function(n) {
                return n.valueOf()
            }) : delete this.range;
            this.fill()
        },
        getClassNames: function(t) {
            var i = []
              , r = this.viewDate.getUTCFullYear()
              , u = this.viewDate.getUTCMonth()
              , f = o();
            return t.getUTCFullYear() < r || t.getUTCFullYear() === r && t.getUTCMonth() < u ? i.push("old") : (t.getUTCFullYear() > r || t.getUTCFullYear() === r && t.getUTCMonth() > u) && i.push("new"),
            this.focusDate && t.valueOf() === this.focusDate.valueOf() && i.push("focused"),
            this.o.todayHighlight && l(t, f) && i.push("today"),
            -1 !== this.dates.contains(t) && i.push("active"),
            this.dateWithinRange(t) || i.push("disabled"),
            this.dateIsDisabled(t) && i.push("disabled", "disabled-date"),
            -1 !== n.inArray(t.getUTCDay(), this.o.daysOfWeekHighlighted) && i.push("highlighted"),
            this.range && (t > this.range[0] && t < this.range[this.range.length - 1] && i.push("range"),
            -1 !== n.inArray(t.valueOf(), this.range) && i.push("selected"),
            t.valueOf() === this.range[0] && i.push("range-start"),
            t.valueOf() === this.range[this.range.length - 1] && i.push("range-end")),
            i
        },
        _fill_yearsView: function(i, r, u, f, e, o, s) {
            for (var c, v, h, w = "", l = u / 10, i = this.picker.find(i), y = Math.floor(f / u) * u, p = y + 9 * l, b = Math.floor(this.viewDate.getFullYear() / l) * l, k = n.map(this.dates, function(n) {
                return Math.floor(n.getUTCFullYear() / l) * l
            }), a = y - l; a <= p + l; a += l)
                c = [r],
                v = null,
                a === y - l ? c.push("old") : a === p + l && c.push("new"),
                -1 !== n.inArray(a, k) && c.push("active"),
                (a < e || o < a) && c.push("disabled"),
                a === b && c.push("focused"),
                s !== n.noop && ((h = s(new Date(a,0,1))) === t ? h = {} : "boolean" == typeof h ? h = {
                    enabled: h
                } : "string" == typeof h && (h = {
                    classes: h
                }),
                !1 === h.enabled && c.push("disabled"),
                h.classes && (c = c.concat(h.classes.split(/\s+/))),
                h.tooltip && (v = h.tooltip)),
                w += '<span class="' + c.join(" ") + '"' + (v ? ' title="' + v + '"' : "") + ">" + a + "<\/span>";
            i.find(".datepicker-switch").text(y + "-" + p);
            i.find("td").html(w)
        },
        fill: function() {
            var b, d = new Date(this.viewDate), s = d.getUTCFullYear(), l = d.getUTCMonth(), p = this.o.startDate !== -1 / 0 ? this.o.startDate.getUTCFullYear() : -1 / 0, tt = this.o.startDate !== -1 / 0 ? this.o.startDate.getUTCMonth() : -1 / 0, w = this.o.endDate !== 1 / 0 ? this.o.endDate.getUTCFullYear() : 1 / 0, it = this.o.endDate !== 1 / 0 ? this.o.endDate.getUTCMonth() : 1 / 0, rt = r[this.o.language].today || r.en.today || "", ut = r[this.o.language].clear || r.en.clear || "", ft = r[this.o.language].titleFormat || r.en.titleFormat, k = o(), k = (!0 === this.o.todayBtn || "linked" === this.o.todayBtn) && k >= this.o.startDate && k <= this.o.endDate && !this.weekOfDateIsDisabled(k), e, h, u, g, c, a, v, nt, y;
            if (!isNaN(s) && !isNaN(l)) {
                for (this.picker.find(".datepicker-days .datepicker-switch").text(i.formatDate(d, ft, this.o.language)),
                this.picker.find("tfoot .today").text(rt).css("display", k ? "table-cell" : "none"),
                this.picker.find("tfoot .clear").text(ut).css("display", !0 === this.o.clearBtn ? "table-cell" : "none"),
                this.picker.find("thead .datepicker-title").text(this.o.title).css("display", "string" == typeof this.o.title && "" !== this.o.title ? "table-cell" : "none"),
                this.updateNavArrows(),
                this.fillMonths(),
                e = f(s, l, 0),
                l = e.getUTCDate(),
                e.setUTCDate(l - (e.getUTCDay() - this.o.weekStart + 7) % 7),
                c = new Date(e),
                e.getUTCFullYear() < 100 && c.setUTCFullYear(e.getUTCFullYear()),
                c.setUTCDate(c.getUTCDate() + 42),
                c = c.valueOf(),
                a = []; e.valueOf() < c; )
                    (g = e.getUTCDay()) === this.o.weekStart && (a.push("<tr>"),
                    this.o.calendarWeeks && (h = new Date(+e + (this.o.weekStart - g - 7) % 7 * 864e5),
                    v = new Date(Number(h) + (11 - h.getUTCDay()) % 7 * 864e5),
                    u = new Date(Number(u = f(v.getUTCFullYear(), 0, 1)) + (11 - u.getUTCDay()) % 7 * 864e5),
                    a.push('<td class="cw">' + ((v - u) / 6048e5 + 1) + "<\/td>"))),
                    (h = this.getClassNames(e)).push("day"),
                    v = e.getUTCDate(),
                    this.o.beforeShowDay !== n.noop && ((u = this.o.beforeShowDay(this._utc_to_local(e))) === t ? u = {} : "boolean" == typeof u ? u = {
                        enabled: u
                    } : "string" == typeof u && (u = {
                        classes: u
                    }),
                    !1 === u.enabled && h.push("disabled"),
                    u.classes && (h = h.concat(u.classes.split(/\s+/))),
                    u.tooltip && (b = u.tooltip),
                    u.content && (v = u.content)),
                    h = n.isFunction(n.uniqueSort) ? n.uniqueSort(h) : n.unique(h),
                    a.push('<td class="' + h.join(" ") + '"' + (b ? ' title="' + b + '"' : "") + ' data-date="' + e.getTime().toString() + '">' + v + "<\/td>"),
                    b = null,
                    g === this.o.weekEnd && a.push("<\/tr>"),
                    e.setUTCDate(e.getUTCDate() + 1);
                this.picker.find(".datepicker-days tbody").html(a.join(""));
                l = r[this.o.language].monthsTitle || r.en.monthsTitle || "Months";
                y = this.picker.find(".datepicker-months").find(".datepicker-switch").text(this.o.maxViewMode < 2 ? l : s).end().find("tbody span").removeClass("active");
                n.each(this.dates, function(n, t) {
                    t.getUTCFullYear() === s && y.eq(t.getUTCMonth()).addClass("active")
                });
                (s < p || w < s) && y.addClass("disabled");
                s === p && y.slice(0, tt).addClass("disabled");
                s === w && y.slice(it + 1).addClass("disabled");
                this.o.beforeShowMonth !== n.noop && (nt = this,
                n.each(y, function(i, r) {
                    i = new Date(s,i,1);
                    i = nt.o.beforeShowMonth(i);
                    i === t ? i = {} : "boolean" == typeof i ? i = {
                        enabled: i
                    } : "string" == typeof i && (i = {
                        classes: i
                    });
                    !1 !== i.enabled || n(r).hasClass("disabled") || n(r).addClass("disabled");
                    i.classes && n(r).addClass(i.classes);
                    i.tooltip && n(r).prop("title", i.tooltip)
                }));
                this._fill_yearsView(".datepicker-years", "year", 10, s, p, w, this.o.beforeShowYear);
                this._fill_yearsView(".datepicker-decades", "decade", 100, s, p, w, this.o.beforeShowDecade);
                this._fill_yearsView(".datepicker-centuries", "century", 1e3, s, p, w, this.o.beforeShowCentury)
            }
        },
        updateNavArrows: function() {
            if (this._allow_update) {
                var i, r, u = new Date(this.viewDate), t = u.getUTCFullYear(), f = u.getUTCMonth(), e = this.o.startDate !== -1 / 0 ? this.o.startDate.getUTCFullYear() : -1 / 0, s = this.o.startDate !== -1 / 0 ? this.o.startDate.getUTCMonth() : -1 / 0, o = this.o.endDate !== 1 / 0 ? this.o.endDate.getUTCFullYear() : 1 / 0, h = this.o.endDate !== 1 / 0 ? this.o.endDate.getUTCMonth() : 1 / 0, n = 1;
                switch (this.viewMode) {
                case 4:
                    n *= 10;
                case 3:
                    n *= 10;
                case 2:
                    n *= 10;
                case 1:
                    i = Math.floor(t / n) * n <= e;
                    r = Math.floor(t / n) * n + n > o;
                    break;
                case 0:
                    i = t <= e && f <= s;
                    r = o <= t && h <= f
                }
                this.picker.find(".prev").toggleClass("disabled", i);
                this.picker.find(".next").toggleClass("disabled", r)
            }
        },
        click: function(t) {
            var r, u;
            t.preventDefault();
            t.stopPropagation();
            (t = n(t.target)).hasClass("datepicker-switch") && this.viewMode !== this.o.maxViewMode && this.setViewMode(this.viewMode + 1);
            t.hasClass("today") && !t.hasClass("day") && (this.setViewMode(0),
            this._setDate(o(), "linked" === this.o.todayBtn ? null : "view"));
            t.hasClass("clear") && this.clearDates();
            t.hasClass("disabled") || (t.hasClass("month") || t.hasClass("year") || t.hasClass("decade") || t.hasClass("century")) && (this.viewDate.setUTCDate(1),
            1 === this.viewMode ? (u = t.parent().find("span").index(t),
            r = this.viewDate.getUTCFullYear(),
            this.viewDate.setUTCMonth(u)) : (u = 0,
            r = Number(t.text()),
            this.viewDate.setUTCFullYear(r)),
            this._trigger(i.viewModes[this.viewMode - 1].e, this.viewDate),
            this.viewMode === this.o.minViewMode ? this._setDate(f(r, u, 1)) : (this.setViewMode(this.viewMode - 1),
            this.fill()));
            this.picker.is(":visible") && this._focused_from && this._focused_from.focus();
            delete this._focused_from
        },
        dayCellClick: function(t) {
            t = n(t.currentTarget).data("date");
            t = new Date(t);
            this.o.updateViewDate && (t.getUTCFullYear() !== this.viewDate.getUTCFullYear() && this._trigger("changeYear", this.viewDate),
            t.getUTCMonth() !== this.viewDate.getUTCMonth() && this._trigger("changeMonth", this.viewDate));
            this._setDate(t)
        },
        navArrowsClick: function(t) {
            t = n(t.currentTarget).hasClass("prev") ? -1 : 1;
            0 !== this.viewMode && (t *= 12 * i.viewModes[this.viewMode].navStep);
            this.viewDate = this.moveMonth(this.viewDate, t);
            this._trigger(i.viewModes[this.viewMode].e, this.viewDate);
            this.fill()
        },
        _toggle_multidate: function(n) {
            var t = this.dates.contains(n);
            if (n || this.dates.clear(),
            -1 !== t ? (!0 === this.o.multidate || 1 < this.o.multidate || this.o.toggleActive) && this.dates.remove(t) : (!1 === this.o.multidate && this.dates.clear(),
            this.dates.push(n)),
            "number" == typeof this.o.multidate)
                for (; this.dates.length > this.o.multidate; )
                    this.dates.remove(0)
        },
        _setDate: function(n, t) {
            t && "date" !== t || this._toggle_multidate(n && new Date(n));
            (!t && this.o.updateViewDate || "view" === t) && (this.viewDate = n && new Date(n));
            this.fill();
            this.setValue();
            t && "view" === t || this._trigger("changeDate");
            this.inputField.trigger("change");
            !this.o.autoclose || t && "date" !== t || this.hide()
        },
        moveDay: function(n, t) {
            var i = new Date(n);
            return i.setUTCDate(n.getUTCDate() + t),
            i
        },
        moveWeek: function(n, t) {
            return this.moveDay(n, 7 * t)
        },
        moveMonth: function(n, t) {
            var e, f;
            if (!(e = n) || isNaN(e.getTime()))
                return this.o.defaultViewDate;
            if (!t)
                return n;
            var r, u, i = new Date(n.valueOf()), o = i.getUTCDate(), s = i.getUTCMonth(), h = Math.abs(t);
            if (t = 0 < t ? 1 : -1,
            1 === h)
                u = -1 === t ? function() {
                    return i.getUTCMonth() === s
                }
                : function() {
                    return i.getUTCMonth() !== r
                }
                ,
                r = s + t,
                i.setUTCMonth(r),
                r = (r + 12) % 12;
            else {
                for (f = 0; f < h; f++)
                    i = this.moveMonth(i, t);
                r = i.getUTCMonth();
                i.setUTCDate(o);
                u = function() {
                    return r !== i.getUTCMonth()
                }
            }
            for (; u(); )
                i.setUTCDate(--o),
                i.setUTCMonth(r);
            return i
        },
        moveYear: function(n, t) {
            return this.moveMonth(n, 12 * t)
        },
        moveAvailableDate: function(n, t, i) {
            do
                if (n = this[i](n, t),
                !this.dateWithinRange(n))
                    return !1;
            while (i = "moveDay",
            this.dateIsDisabled(n));
            return n
        },
        weekOfDateIsDisabled: function(t) {
            return -1 !== n.inArray(t.getUTCDay(), this.o.daysOfWeekDisabled)
        },
        dateIsDisabled: function(t) {
            return this.weekOfDateIsDisabled(t) || 0 < n.grep(this.o.datesDisabled, function(n) {
                return l(t, n)
            }).length
        },
        dateWithinRange: function(n) {
            return n >= this.o.startDate && n <= this.o.endDate
        },
        keydown: function(n) {
            if (this.picker.is(":visible")) {
                var t, r, u = !1, i = this.focusDate || this.viewDate;
                switch (n.keyCode) {
                case 27:
                    this.focusDate ? (this.focusDate = null,
                    this.viewDate = this.dates.get(-1) || this.viewDate,
                    this.fill()) : this.hide();
                    n.preventDefault();
                    n.stopPropagation();
                    break;
                case 37:
                case 38:
                case 39:
                case 40:
                    if (!this.o.keyboardNavigation || 7 === this.o.daysOfWeekDisabled.length)
                        break;
                    t = 37 === n.keyCode || 38 === n.keyCode ? -1 : 1;
                    0 === this.viewMode ? n.ctrlKey ? (r = this.moveAvailableDate(i, t, "moveYear")) && this._trigger("changeYear", this.viewDate) : n.shiftKey ? (r = this.moveAvailableDate(i, t, "moveMonth")) && this._trigger("changeMonth", this.viewDate) : 37 === n.keyCode || 39 === n.keyCode ? r = this.moveAvailableDate(i, t, "moveDay") : this.weekOfDateIsDisabled(i) || (r = this.moveAvailableDate(i, t, "moveWeek")) : 1 === this.viewMode ? (38 !== n.keyCode && 40 !== n.keyCode || (t *= 4),
                    r = this.moveAvailableDate(i, t, "moveMonth")) : 2 === this.viewMode && (38 !== n.keyCode && 40 !== n.keyCode || (t *= 4),
                    r = this.moveAvailableDate(i, t, "moveYear"));
                    r && (this.focusDate = this.viewDate = r,
                    this.setValue(),
                    this.fill(),
                    n.preventDefault());
                    break;
                case 13:
                    if (!this.o.forceParse)
                        break;
                    i = this.focusDate || this.dates.get(-1) || this.viewDate;
                    this.o.keyboardNavigation && (this._toggle_multidate(i),
                    u = !0);
                    this.focusDate = null;
                    this.viewDate = this.dates.get(-1) || this.viewDate;
                    this.setValue();
                    this.fill();
                    this.picker.is(":visible") && (n.preventDefault(),
                    n.stopPropagation(),
                    this.o.autoclose && this.hide());
                    break;
                case 9:
                    this.focusDate = null;
                    this.viewDate = this.dates.get(-1) || this.viewDate;
                    this.fill();
                    this.hide()
                }
                u && (this.dates.length ? this._trigger("changeDate") : this._trigger("clearDate"),
                this.inputField.trigger("change"))
            } else
                40 !== n.keyCode && 27 !== n.keyCode || (this.show(),
                n.stopPropagation())
        },
        setViewMode: function(n) {
            this.viewMode = n;
            this.picker.children("div").hide().filter(".datepicker-" + i.viewModes[this.viewMode].clsName).show();
            this.updateNavArrows();
            this._trigger("changeViewMode", new Date(this.viewDate))
        }
    };
    c.prototype = {
        updateDates: function() {
            this.dates = n.map(this.pickers, function(n) {
                return n.getUTCDate()
            });
            this.updateRanges()
        },
        updateRanges: function() {
            var t = n.map(this.dates, function(n) {
                return n.valueOf()
            });
            n.each(this.pickers, function(n, i) {
                i.setRange(t)
            })
        },
        clearDates: function() {
            n.each(this.pickers, function(n, t) {
                t.clearDates()
            })
        },
        dateUpdated: function(i) {
            var u;
            if (!this.updating && (this.updating = !0,
            u = n.data(i.target, "datepicker"),
            u !== t)) {
                var r = u.getUTCDate()
                  , o = this.keepEmptyValues
                  , i = n.inArray(i.target, this.inputs)
                  , f = i - 1
                  , e = i + 1
                  , s = this.inputs.length;
                if (-1 !== i) {
                    if (n.each(this.pickers, function(n, t) {
                        t.getUTCDate() || t !== u && o || t.setUTCDate(r)
                    }),
                    r < this.dates[f])
                        for (; 0 <= f && r < this.dates[f]; )
                            this.pickers[f--].setUTCDate(r);
                    else if (r > this.dates[e])
                        for (; e < s && r > this.dates[e]; )
                            this.pickers[e++].setUTCDate(r);
                    this.updateDates();
                    delete this.updating
                }
            }
        },
        destroy: function() {
            n.map(this.pickers, function(n) {
                n.destroy()
            });
            n(this.inputs).off("changeDate", this.dateUpdated);
            delete this.element.data().datepicker
        },
        remove: h("destroy", "Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead")
    };
    y = n.fn.datepicker;
    s = function(i) {
        var f, o = Array.apply(null, arguments);
        if (o.shift(),
        this.each(function() {
            var l, a, h = n(this), s = h.data("datepicker"), t = "object" === _typeof(i) && i;
            s || (l = function(t, i) {
                function o(n, t) {
                    return t.toLowerCase()
                }
                var r, u = n(t).data(), f = {}, e = new RegExp("^" + i.toLowerCase() + "([A-Z])");
                for (r in i = new RegExp("^" + i.toLowerCase()),
                u)
                    i.test(r) && (f[r.replace(e, o)] = u[r]);
                return f
            }(this, "date"),
            a = function(t) {
                var u = {}, i;
                if (r[t] || (t = t.split("-")[0],
                r[t]))
                    return i = r[t],
                    n.each(p, function(n, t) {
                        t in i && (u[t] = i[t])
                    }),
                    u
            }(n.extend({}, e, l, t).language),
            t = n.extend({}, e, a, l, t),
            s = h.hasClass("input-daterange") || t.inputs ? (n.extend(t, {
                inputs: t.inputs || h.find("input").toArray()
            }),
            new c(this,t)) : new u(this,t),
            h.data("datepicker", s));
            "string" == typeof i && "function" == typeof s[i] && (f = s[i].apply(s, o))
        }),
        f === t || f instanceof u || f instanceof c)
            return this;
        if (1 < this.length)
            throw new Error("Using only allowed for the collection of a single element (" + i + " function)");
        return f
    }
    ;
    n.fn.datepicker = s;
    e = n.fn.datepicker.defaults = {
        assumeNearbyYear: !1,
        autoclose: !1,
        beforeShowDay: n.noop,
        beforeShowMonth: n.noop,
        beforeShowYear: n.noop,
        beforeShowDecade: n.noop,
        beforeShowCentury: n.noop,
        calendarWeeks: !1,
        clearBtn: !1,
        toggleActive: !1,
        daysOfWeekDisabled: [],
        daysOfWeekHighlighted: [],
        datesDisabled: [],
        endDate: 1 / 0,
        forceParse: !0,
        format: "mm/dd/yyyy",
        keepEmptyValues: !1,
        keyboardNavigation: !0,
        language: "en",
        minViewMode: 0,
        maxViewMode: 4,
        multidate: !1,
        multidateSeparator: ",",
        orientation: "auto",
        rtl: !1,
        startDate: -1 / 0,
        startView: 0,
        todayBtn: !1,
        todayHighlight: !1,
        updateViewDate: !0,
        weekStart: 0,
        disableTouchKeyboard: !1,
        enableOnReadonly: !0,
        showOnFocus: !0,
        zIndexOffset: 10,
        container: "body",
        immediateUpdates: !1,
        title: "",
        templates: {
            leftArrow: "&#x00AB;",
            rightArrow: "&#x00BB;"
        },
        showWeekDays: !0
    };
    p = n.fn.datepicker.locale_opts = ["format", "rtl", "weekStart"];
    n.fn.datepicker.Constructor = u;
    r = n.fn.datepicker.dates = {
        en: {
            days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
            daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
            daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
            months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
            monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
            today: "Today",
            clear: "Clear",
            titleFormat: "MM yyyy"
        }
    };
    i = {
        viewModes: [{
            names: ["days", "month"],
            clsName: "days",
            e: "changeMonth"
        }, {
            names: ["months", "year"],
            clsName: "months",
            e: "changeYear",
            navStep: 1
        }, {
            names: ["years", "decade"],
            clsName: "years",
            e: "changeDecade",
            navStep: 10
        }, {
            names: ["decades", "century"],
            clsName: "decades",
            e: "changeCentury",
            navStep: 100
        }, {
            names: ["centuries", "millennium"],
            clsName: "centuries",
            e: "changeMillennium",
            navStep: 1e3
        }],
        validParts: /dd?|DD?|mm?|MM?|yy(?:yy)?/g,
        nonpunctuation: /[^ -\/:-@\u5e74\u6708\u65e5\[-`{-~\t\n\r]+/g,
        parseFormat: function(n) {
            if ("function" == typeof n.toValue && "function" == typeof n.toDisplay)
                return n;
            var t = n.replace(this.validParts, "\0").split("\0")
              , n = n.match(this.validParts);
            if (!t || !t.length || !n || 0 === n.length)
                throw new Error("Invalid date format.");
            return {
                separators: t,
                parts: n
            }
        },
        parseDate: function(f, e, s, h) {
            function ut() {
                var n = this.slice(0, a[c].length)
                  , t = a[c].slice(0, n.length);
                return n.toLowerCase() === t.toLowerCase()
            }
            var y, tt, it, rt, g, v, k, d, c, ft;
            if (!f)
                return t;
            if (f instanceof Date)
                return f;
            if ((e = "string" == typeof e ? i.parseFormat(e) : e).toValue)
                return e.toValue(f, e, s);
            if (rt = {
                d: "moveDay",
                m: "moveMonth",
                w: "moveWeek",
                y: "moveYear"
            },
            g = {
                yesterday: "-1d",
                today: "+0d",
                tomorrow: "+1d"
            },
            /^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/i.test(f = f in g ? g[f] : f)) {
                for (a = f.match(/([\-+]\d+)([dmwy])/gi),
                f = new Date,
                c = 0; c < a.length; c++)
                    y = a[c].match(/([\-+]\d+)([dmwy])/i),
                    tt = Number(y[1]),
                    it = rt[y[2].toLowerCase()],
                    f = u.prototype[it](f, tt);
                return u.prototype._zero_utc_time(f)
            }
            var p, w, a = f && f.match(this.nonpunctuation) || [], b = {}, nt = ["yyyy", "yy", "M", "MM", "m", "mm", "d", "dd"], l = {
                yyyy: function(n, t) {
                    return n.setUTCFullYear(h ? (!0 === (i = h) && (i = 10),
                    (n = t) < 100 && (n += 2e3) > (new Date).getFullYear() + i && (n -= 100),
                    n) : t);
                    var i
                },
                m: function(n, t) {
                    if (isNaN(n))
                        return n;
                    for (--t; t < 0; )
                        t += 12;
                    for (n.setUTCMonth(t %= 12); n.getUTCMonth() !== t; )
                        n.setUTCDate(n.getUTCDate() - 1);
                    return n
                },
                d: function(n, t) {
                    return n.setUTCDate(t)
                }
            };
            if (l.yy = l.yyyy,
            l.M = l.MM = l.mm = l.m,
            l.dd = l.d,
            f = o(),
            v = e.parts.slice(),
            a.length !== v.length && (v = n(v).filter(function(t, i) {
                return -1 !== n.inArray(i, nt)
            }).toArray()),
            a.length === v.length) {
                for (c = 0,
                ft = v.length; c < ft; c++) {
                    if (p = parseInt(a[c], 10),
                    y = v[c],
                    isNaN(p))
                        switch (y) {
                        case "MM":
                            w = n(r[s].months).filter(ut);
                            p = n.inArray(w[0], r[s].months) + 1;
                            break;
                        case "M":
                            w = n(r[s].monthsShort).filter(ut);
                            p = n.inArray(w[0], r[s].monthsShort) + 1
                        }
                    b[y] = p
                }
                for (c = 0; c < nt.length; c++)
                    (d = nt[c])in b && !isNaN(b[d]) && (k = new Date(f),
                    l[d](k, b[d]),
                    isNaN(k) || (f = k))
            }
            return f
        },
        formatDate: function(t, u, f) {
            var e;
            if (!t)
                return "";
            if ((u = "string" == typeof u ? i.parseFormat(u) : u).toDisplay)
                return u.toDisplay(t, u, f);
            e = {
                d: t.getUTCDate(),
                D: r[f].daysShort[t.getUTCDay()],
                DD: r[f].days[t.getUTCDay()],
                m: t.getUTCMonth() + 1,
                M: r[f].monthsShort[t.getUTCMonth()],
                MM: r[f].months[t.getUTCMonth()],
                yy: t.getUTCFullYear().toString().substring(2),
                yyyy: t.getUTCFullYear()
            };
            e.dd = (e.d < 10 ? "0" : "") + e.d;
            e.mm = (e.m < 10 ? "0" : "") + e.m;
            t = [];
            for (var s = n.extend([], u.separators), o = 0, h = u.parts.length; o <= h; o++)
                s.length && t.push(s.shift()),
                t.push(e[u.parts[o]]);
            return t.join("")
        },
        headTemplate: '<thead><tr><th colspan="7" class="datepicker-title"><\/th><\/tr><tr><th class="prev">' + e.templates.leftArrow + '<\/th><th colspan="5" class="datepicker-switch"><\/th><th class="next">' + e.templates.rightArrow + "<\/th><\/tr><\/thead>",
        contTemplate: '<tbody><tr><td colspan="7"><\/td><\/tr><\/tbody>',
        footTemplate: '<tfoot><tr><th colspan="7" class="today"><\/th><\/tr><tr><th colspan="7" class="clear"><\/th><\/tr><\/tfoot>'
    };
    i.template = '<div class="datepicker"><div class="datepicker-days"><table class="table-condensed">' + i.headTemplate + "<tbody><\/tbody>" + i.footTemplate + '<\/table><\/div><div class="datepicker-months"><table class="table-condensed">' + i.headTemplate + i.contTemplate + i.footTemplate + '<\/table><\/div><div class="datepicker-years"><table class="table-condensed">' + i.headTemplate + i.contTemplate + i.footTemplate + '<\/table><\/div><div class="datepicker-decades"><table class="table-condensed">' + i.headTemplate + i.contTemplate + i.footTemplate + '<\/table><\/div><div class="datepicker-centuries"><table class="table-condensed">' + i.headTemplate + i.contTemplate + i.footTemplate + "<\/table><\/div><\/div>";
    n.fn.datepicker.DPGlobal = i;
    n.fn.datepicker.noConflict = function() {
        return n.fn.datepicker = y,
        this
    }
    ;
    n.fn.datepicker.version = "1.9.0";
    n.fn.datepicker.deprecated = function(n) {
        var t = window.console;
        t && t.warn && t.warn("DEPRECATED: " + n)
    }
    ;
    n(document).on("focus.datepicker.data-api click.datepicker.data-api", '[data-provide="datepicker"]', function(t) {
        var i = n(this);
        i.data("datepicker") || (t.preventDefault(),
        s.call(i, "show"))
    });
    n(function() {
        s.call(n('[data-provide="datepicker-inline"]'))
    })
}),
function(n) {
    "function" == typeof define && define.amd ? define(["jquery"], n) : n("object" == ("undefined" == typeof exports ? "undefined" : _typeof(exports)) ? require("jquery") : jQuery)
}(function(n, t) {
    function f() {
        return new Date(Date.UTC.apply(Date, arguments))
    }
    function o() {
        var n = new Date;
        return f(n.getFullYear(), n.getMonth(), n.getDate())
    }
    function l(n, t) {
        return n.getUTCFullYear() === t.getUTCFullYear() && n.getUTCMonth() === t.getUTCMonth() && n.getUTCDate() === t.getUTCDate()
    }
    function h(i, r) {
        return function() {
            return r !== t && n.fn.datepicker.deprecated(r),
            this[i].apply(this, arguments)
        }
    }
    function u(t, r) {
        n.data(t, "datepicker", this);
        this._events = [];
        this._secondaryEvents = [];
        this._process_options(r);
        this.dates = new v;
        this.viewDate = this.o.defaultViewDate;
        this.focusDate = null;
        this.element = n(t);
        this.isInput = this.element.is("input");
        this.inputField = this.isInput ? this.element : this.element.find("input");
        this.component = !!this.element.hasClass("date") && this.element.find(".add-on, .input-group-addon, .input-group-append, .input-group-prepend, .btn");
        this.component && 0 === this.component.length && (this.component = !1);
        this.isInline = !this.component && this.element.is("div");
        this.picker = n(i.template);
        this._check_template(this.o.templates.leftArrow) && this.picker.find(".prev").html(this.o.templates.leftArrow);
        this._check_template(this.o.templates.rightArrow) && this.picker.find(".next").html(this.o.templates.rightArrow);
        this._buildEvents();
        this._attachEvents();
        this.isInline ? this.picker.addClass("datepicker-inline").appendTo(this.element) : this.picker.addClass("datepicker-dropdown dropdown-menu");
        this.o.rtl && this.picker.addClass("datepicker-rtl");
        this.o.calendarWeeks && this.picker.find(".datepicker-days .datepicker-switch, thead .datepicker-title, tfoot .today, tfoot .clear").attr("colspan", function(n, t) {
            return Number(t) + 1
        });
        this._process_options({
            startDate: this._o.startDate,
            endDate: this._o.endDate,
            daysOfWeekDisabled: this.o.daysOfWeekDisabled,
            daysOfWeekHighlighted: this.o.daysOfWeekHighlighted,
            datesDisabled: this.o.datesDisabled
        });
        this._allow_update = !1;
        this.setViewMode(this.o.startView);
        this._allow_update = !0;
        this.fillDow();
        this.fillMonths();
        this.update();
        this.isInline && this.show()
    }
    function c(t, i) {
        n.data(t, "datepicker", this);
        this.element = n(t);
        this.inputs = n.map(i.inputs, function(n) {
            return n.jquery ? n[0] : n
        });
        delete i.inputs;
        this.keepEmptyValues = i.keepEmptyValues;
        delete i.keepEmptyValues;
        s.call(n(this.inputs), i).on("changeDate", n.proxy(this.dateUpdated, this));
        this.pickers = n.map(this.inputs, function(t) {
            return n.data(t, "datepicker")
        });
        this.updateDates()
    }
    var a, v = (a = {
        get: function(n) {
            return this.slice(n)[0]
        },
        contains: function(n) {
            for (var i = n && n.valueOf(), t = 0, r = this.length; t < r; t++)
                if (0 <= this[t].valueOf() - i && this[t].valueOf() - i < 864e5)
                    return t;
            return -1
        },
        remove: function(n) {
            this.splice(n, 1)
        },
        replace: function(t) {
            t && (n.isArray(t) || (t = [t]),
            this.clear(),
            this.push.apply(this, t))
        },
        clear: function() {
            this.length = 0
        },
        copy: function() {
            var n = new v;
            return n.replace(this),
            n
        }
    },
    function() {
        var t = [];
        return t.push.apply(t, arguments),
        n.extend(t, a),
        t
    }
    ), y, s, e, p, r, i;
    u.prototype = {
        constructor: u,
        _resolveViewName: function(t) {
            return n.each(i.viewModes, function(i, r) {
                if (t === i || -1 !== n.inArray(t, r.names))
                    return t = i,
                    !1
            }),
            t
        },
        _resolveDaysOfWeek: function(t) {
            return n.isArray(t) || (t = t.split(/[,\s]*/)),
            n.map(t, Number)
        },
        _check_template: function(i) {
            try {
                return i === t || "" === i ? !1 : (i.match(/[<>]/g) || []).length <= 0 || 0 < n(i).length
            } catch (i) {
                return !1
            }
        },
        _process_options: function(t) {
            var u, s, l;
            this._o = n.extend({}, this._o, t);
            u = this.o = n.extend({}, this._o);
            s = u.language;
            r[s] || (s = s.split("-")[0],
            r[s] || (s = e.language));
            u.language = s;
            u.startView = this._resolveViewName(u.startView);
            u.minViewMode = this._resolveViewName(u.minViewMode);
            u.maxViewMode = this._resolveViewName(u.maxViewMode);
            u.startView = Math.max(this.o.minViewMode, Math.min(this.o.maxViewMode, u.startView));
            !0 !== u.multidate && (u.multidate = Number(u.multidate) || !1,
            !1 !== u.multidate && (u.multidate = Math.max(0, u.multidate)));
            u.multidateSeparator = String(u.multidateSeparator);
            u.weekStart %= 7;
            u.weekEnd = (u.weekStart + 6) % 7;
            l = i.parseFormat(u.format);
            u.startDate !== -1 / 0 && (u.startDate = u.startDate ? u.startDate instanceof Date ? this._local_to_utc(this._zero_time(u.startDate)) : i.parseDate(u.startDate, l, u.language, u.assumeNearbyYear) : -1 / 0);
            u.endDate !== 1 / 0 && (u.endDate = u.endDate ? u.endDate instanceof Date ? this._local_to_utc(this._zero_time(u.endDate)) : i.parseDate(u.endDate, l, u.language, u.assumeNearbyYear) : 1 / 0);
            u.daysOfWeekDisabled = this._resolveDaysOfWeek(u.daysOfWeekDisabled || []);
            u.daysOfWeekHighlighted = this._resolveDaysOfWeek(u.daysOfWeekHighlighted || []);
            u.datesDisabled = u.datesDisabled || [];
            n.isArray(u.datesDisabled) || (u.datesDisabled = u.datesDisabled.split(","));
            u.datesDisabled = n.map(u.datesDisabled, function(n) {
                return i.parseDate(n, l, u.language, u.assumeNearbyYear)
            });
            var c = String(u.orientation).toLowerCase().split(/\s+/g)
              , h = u.orientation.toLowerCase()
              , c = n.grep(c, function(n) {
                return /^auto|left|right|top|bottom$/.test(n)
            });
            if (u.orientation = {
                x: "auto",
                y: "auto"
            },
            h && "auto" !== h)
                if (1 === c.length)
                    switch (c[0]) {
                    case "top":
                    case "bottom":
                        u.orientation.y = c[0];
                        break;
                    case "left":
                    case "right":
                        u.orientation.x = c[0]
                    }
                else
                    h = n.grep(c, function(n) {
                        return /^left|right$/.test(n)
                    }),
                    u.orientation.x = h[0] || "auto",
                    h = n.grep(c, function(n) {
                        return /^top|bottom$/.test(n)
                    }),
                    u.orientation.y = h[0] || "auto";
            u.defaultViewDate instanceof Date || "string" == typeof u.defaultViewDate ? u.defaultViewDate = i.parseDate(u.defaultViewDate, l, u.language, u.assumeNearbyYear) : u.defaultViewDate ? (t = u.defaultViewDate.year || (new Date).getFullYear(),
            s = u.defaultViewDate.month || 0,
            h = u.defaultViewDate.day || 1,
            u.defaultViewDate = f(t, s, h)) : u.defaultViewDate = o()
        },
        _applyEvents: function(n) {
            for (var f, r, u, i = 0; i < n.length; i++)
                f = n[i][0],
                2 === n[i].length ? (r = t,
                u = n[i][1]) : 3 === n[i].length && (r = n[i][1],
                u = n[i][2]),
                f.on(u, r)
        },
        _unapplyEvents: function(n) {
            for (var f, r, u, i = 0; i < n.length; i++)
                f = n[i][0],
                2 === n[i].length ? (u = t,
                r = n[i][1]) : 3 === n[i].length && (u = n[i][1],
                r = n[i][2]),
                f.off(r, u)
        },
        _buildEvents: function() {
            var t = {
                keyup: n.proxy(function(t) {
                    -1 === n.inArray(t.keyCode, [27, 37, 39, 38, 40, 32, 13, 9]) && this.update()
                }, this),
                keydown: n.proxy(this.keydown, this),
                paste: n.proxy(this.paste, this)
            };
            !0 === this.o.showOnFocus && (t.focus = n.proxy(this.show, this));
            this._events = this.isInput ? [[this.element, t]] : this.component && this.inputField.length ? [[this.inputField, t], [this.component, {
                click: n.proxy(this.show, this)
            }]] : [[this.element, {
                click: n.proxy(this.show, this),
                keydown: n.proxy(this.keydown, this)
            }]];
            this._events.push([this.element, "*", {
                blur: n.proxy(function(n) {
                    this._focused_from = n.target
                }, this)
            }], [this.element, {
                blur: n.proxy(function(n) {
                    this._focused_from = n.target
                }, this)
            }]);
            this.o.immediateUpdates && this._events.push([this.element, {
                "changeYear changeMonth": n.proxy(function(n) {
                    this.update(n.date)
                }, this)
            }]);
            this._secondaryEvents = [[this.picker, {
                click: n.proxy(this.click, this)
            }], [this.picker, ".prev, .next", {
                click: n.proxy(this.navArrowsClick, this)
            }], [this.picker, ".day:not(.disabled)", {
                click: n.proxy(this.dayCellClick, this)
            }], [n(window), {
                resize: n.proxy(this.place, this)
            }], [n(document), {
                "mousedown touchstart": n.proxy(function(n) {
                    this.element.is(n.target) || this.element.find(n.target).length || this.picker.is(n.target) || this.picker.find(n.target).length || this.isInline || this.hide()
                }, this)
            }]]
        },
        _attachEvents: function() {
            this._detachEvents();
            this._applyEvents(this._events)
        },
        _detachEvents: function() {
            this._unapplyEvents(this._events)
        },
        _attachSecondaryEvents: function() {
            this._detachSecondaryEvents();
            this._applyEvents(this._secondaryEvents)
        },
        _detachSecondaryEvents: function() {
            this._unapplyEvents(this._secondaryEvents)
        },
        _trigger: function(t, r) {
            r = r || this.dates.get(-1);
            r = this._utc_to_local(r);
            this.element.trigger({
                type: t,
                date: r,
                viewMode: this.viewMode,
                dates: n.map(this.dates, this._utc_to_local),
                format: n.proxy(function(n, t) {
                    return 0 === arguments.length ? (n = this.dates.length - 1,
                    t = this.o.format) : "string" == typeof n && (t = n,
                    n = this.dates.length - 1),
                    t = t || this.o.format,
                    n = this.dates.get(n),
                    i.formatDate(n, t, this.o.language)
                }, this)
            })
        },
        show: function() {
            if (!(this.inputField.is(":disabled") || this.inputField.prop("readonly") && !1 === this.o.enableOnReadonly))
                return this.isInline || this.picker.appendTo(this.o.container),
                this.place(),
                this.picker.show(),
                this._attachSecondaryEvents(),
                this._trigger("show"),
                (window.navigator.msMaxTouchPoints || "ontouchstart"in document) && this.o.disableTouchKeyboard && n(this.element).blur(),
                this
        },
        hide: function() {
            return this.isInline || !this.picker.is(":visible") || (this.focusDate = null,
            this.picker.hide().detach(),
            this._detachSecondaryEvents(),
            this.setViewMode(this.o.startView),
            this.o.forceParse && this.inputField.val() && this.setValue(),
            this._trigger("hide")),
            this
        },
        destroy: function() {
            return this.hide(),
            this._detachEvents(),
            this._detachSecondaryEvents(),
            this.picker.remove(),
            delete this.element.data().datepicker,
            this.isInput || delete this.element.data().date,
            this
        },
        paste: function(t) {
            var i;
            if (t.originalEvent.clipboardData && t.originalEvent.clipboardData.types && -1 !== n.inArray("text/plain", t.originalEvent.clipboardData.types))
                i = t.originalEvent.clipboardData.getData("text/plain");
            else {
                if (!window.clipboardData)
                    return;
                i = window.clipboardData.getData("Text")
            }
            this.setDate(i);
            this.update();
            t.preventDefault()
        },
        _utc_to_local: function(n) {
            if (!n)
                return n;
            var t = new Date(n.getTime() + 6e4 * n.getTimezoneOffset());
            return t.getTimezoneOffset() !== n.getTimezoneOffset() ? new Date(n.getTime() + 6e4 * t.getTimezoneOffset()) : t
        },
        _local_to_utc: function(n) {
            return n && new Date(n.getTime() - 6e4 * n.getTimezoneOffset())
        },
        _zero_time: function(n) {
            return n && new Date(n.getFullYear(),n.getMonth(),n.getDate())
        },
        _zero_utc_time: function(n) {
            return n && f(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate())
        },
        getDates: function() {
            return n.map(this.dates, this._utc_to_local)
        },
        getUTCDates: function() {
            return n.map(this.dates, function(n) {
                return new Date(n)
            })
        },
        getDate: function() {
            return this._utc_to_local(this.getUTCDate())
        },
        getUTCDate: function() {
            var n = this.dates.get(-1);
            return n !== t ? new Date(n) : null
        },
        clearDates: function() {
            this.inputField.val("");
            this.update();
            this._trigger("changeDate");
            this.o.autoclose && this.hide()
        },
        setDates: function() {
            var t = n.isArray(arguments[0]) ? arguments[0] : arguments;
            return this.update.apply(this, t),
            this._trigger("changeDate"),
            this.setValue(),
            this
        },
        setUTCDates: function() {
            var t = n.isArray(arguments[0]) ? arguments[0] : arguments;
            return this.setDates.apply(this, n.map(t, this._utc_to_local)),
            this
        },
        setDate: h("setDates"),
        setUTCDate: h("setUTCDates"),
        remove: h("destroy", "Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead"),
        setValue: function() {
            var n = this.getFormattedDate();
            return this.inputField.val(n),
            this
        },
        getFormattedDate: function(r) {
            r === t && (r = this.o.format);
            var u = this.o.language;
            return n.map(this.dates, function(n) {
                return i.formatDate(n, r, u)
            }).join(this.o.multidateSeparator)
        },
        getStartDate: function() {
            return this.o.startDate
        },
        setStartDate: function(n) {
            return this._process_options({
                startDate: n
            }),
            this.update(),
            this.updateNavArrows(),
            this
        },
        getEndDate: function() {
            return this.o.endDate
        },
        setEndDate: function(n) {
            return this._process_options({
                endDate: n
            }),
            this.update(),
            this.updateNavArrows(),
            this
        },
        setDaysOfWeekDisabled: function(n) {
            return this._process_options({
                daysOfWeekDisabled: n
            }),
            this.update(),
            this
        },
        setDaysOfWeekHighlighted: function(n) {
            return this._process_options({
                daysOfWeekHighlighted: n
            }),
            this.update(),
            this
        },
        setDatesDisabled: function(n) {
            return this._process_options({
                datesDisabled: n
            }),
            this.update(),
            this
        },
        place: function() {
            if (this.isInline)
                return this;
            var i = this.picker.outerWidth()
              , e = this.picker.outerHeight()
              , t = n(this.o.container)
              , o = t.width()
              , s = ("body" === this.o.container ? n(document) : t).scrollTop()
              , r = t.offset()
              , h = [0];
            this.element.parents().each(function() {
                var t = n(this).css("z-index");
                "auto" !== t && 0 !== Number(t) && h.push(Number(t))
            });
            var c = Math.max.apply(Math, h) + this.o.zIndexOffset
              , u = (this.component ? this.component.parent() : this.element).offset()
              , l = this.component ? this.component.outerHeight(!0) : this.element.outerHeight(!1)
              , f = this.component ? this.component.outerWidth(!0) : this.element.outerWidth(!1)
              , t = u.left - r.left
              , r = u.top - r.top;
            return "body" !== this.o.container && (r += s),
            this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left"),
            "auto" !== this.o.orientation.x ? (this.picker.addClass("datepicker-orient-" + this.o.orientation.x),
            "right" === this.o.orientation.x && (t -= i - f)) : u.left < 0 ? (this.picker.addClass("datepicker-orient-left"),
            t -= u.left - 10) : o < t + i ? (this.picker.addClass("datepicker-orient-right"),
            t += f - i) : this.o.rtl ? this.picker.addClass("datepicker-orient-right") : this.picker.addClass("datepicker-orient-left"),
            i = this.o.orientation.y,
            "auto" === i && (i = -s + r - e < 0 ? "bottom" : "top"),
            this.picker.addClass("datepicker-orient-" + i),
            "top" === i ? r -= e + parseInt(this.picker.css("padding-top")) : r += l,
            this.o.rtl ? this.picker.css({
                top: r,
                right: o - (t + f),
                zIndex: c
            }) : this.picker.css({
                top: r,
                left: t,
                zIndex: c
            }),
            this
        },
        _allow_update: !0,
        update: function() {
            if (!this._allow_update)
                return this;
            var u = this.dates.copy()
              , t = []
              , r = !1;
            return arguments.length ? (n.each(arguments, n.proxy(function(n, i) {
                i instanceof Date && (i = this._local_to_utc(i));
                t.push(i)
            }, this)),
            r = !0) : (t = (t = this.isInput ? this.element.val() : this.element.data("date") || this.inputField.val()) && this.o.multidate ? t.split(this.o.multidateSeparator) : [t],
            delete this.element.data().date),
            t = n.map(t, n.proxy(function(n) {
                return i.parseDate(n, this.o.format, this.o.language, this.o.assumeNearbyYear)
            }, this)),
            t = n.grep(t, n.proxy(function(n) {
                return !this.dateWithinRange(n) || !n
            }, this), !0),
            this.dates.replace(t),
            this.o.updateViewDate && (this.viewDate = this.dates.length ? new Date(this.dates.get(-1)) : this.viewDate < this.o.startDate ? new Date(this.o.startDate) : this.viewDate > this.o.endDate ? new Date(this.o.endDate) : this.o.defaultViewDate),
            r ? (this.setValue(),
            this.element.change()) : this.dates.length && String(u) !== String(this.dates) && r && (this._trigger("changeDate"),
            this.element.change()),
            !this.dates.length && u.length && (this._trigger("clearDate"),
            this.element.change()),
            this.fill(),
            this
        },
        fillDow: function() {
            if (this.o.showWeekDays) {
                var i = this.o.weekStart
                  , t = "<tr>";
                for (this.o.calendarWeeks && (t += '<th class="cw">&#160;<\/th>'); i < this.o.weekStart + 7; )
                    t += '<th class="dow',
                    -1 !== n.inArray(i, this.o.daysOfWeekDisabled) && (t += " disabled"),
                    t += '">' + r[this.o.language].daysMin[i++ % 7] + "<\/th>";
                t += "<\/tr>";
                this.picker.find(".datepicker-days thead").append(t)
            }
        },
        fillMonths: function() {
            for (var t = this._utc_to_local(this.viewDate), i = "", n = 0; n < 12; n++)
                i += '<span class="month' + (t && t.getMonth() === n ? " focused" : "") + '">' + r[this.o.language].monthsShort[n] + "<\/span>";
            this.picker.find(".datepicker-months td").html(i)
        },
        setRange: function(t) {
            t && t.length ? this.range = n.map(t, function(n) {
                return n.valueOf()
            }) : delete this.range;
            this.fill()
        },
        getClassNames: function(t) {
            var i = []
              , r = this.viewDate.getUTCFullYear()
              , u = this.viewDate.getUTCMonth()
              , f = o();
            return t.getUTCFullYear() < r || t.getUTCFullYear() === r && t.getUTCMonth() < u ? i.push("old") : (t.getUTCFullYear() > r || t.getUTCFullYear() === r && t.getUTCMonth() > u) && i.push("new"),
            this.focusDate && t.valueOf() === this.focusDate.valueOf() && i.push("focused"),
            this.o.todayHighlight && l(t, f) && i.push("today"),
            -1 !== this.dates.contains(t) && i.push("active"),
            this.dateWithinRange(t) || i.push("disabled"),
            this.dateIsDisabled(t) && i.push("disabled", "disabled-date"),
            -1 !== n.inArray(t.getUTCDay(), this.o.daysOfWeekHighlighted) && i.push("highlighted"),
            this.range && (t > this.range[0] && t < this.range[this.range.length - 1] && i.push("range"),
            -1 !== n.inArray(t.valueOf(), this.range) && i.push("selected"),
            t.valueOf() === this.range[0] && i.push("range-start"),
            t.valueOf() === this.range[this.range.length - 1] && i.push("range-end")),
            i
        },
        _fill_yearsView: function(i, r, u, f, e, o, s) {
            for (var c, v, h, w = "", l = u / 10, i = this.picker.find(i), y = Math.floor(f / u) * u, p = y + 9 * l, b = Math.floor(this.viewDate.getFullYear() / l) * l, k = n.map(this.dates, function(n) {
                return Math.floor(n.getUTCFullYear() / l) * l
            }), a = y - l; a <= p + l; a += l)
                c = [r],
                v = null,
                a === y - l ? c.push("old") : a === p + l && c.push("new"),
                -1 !== n.inArray(a, k) && c.push("active"),
                (a < e || o < a) && c.push("disabled"),
                a === b && c.push("focused"),
                s !== n.noop && ((h = s(new Date(a,0,1))) === t ? h = {} : "boolean" == typeof h ? h = {
                    enabled: h
                } : "string" == typeof h && (h = {
                    classes: h
                }),
                !1 === h.enabled && c.push("disabled"),
                h.classes && (c = c.concat(h.classes.split(/\s+/))),
                h.tooltip && (v = h.tooltip)),
                w += '<span class="' + c.join(" ") + '"' + (v ? ' title="' + v + '"' : "") + ">" + a + "<\/span>";
            i.find(".datepicker-switch").text(y + "-" + p);
            i.find("td").html(w)
        },
        fill: function() {
            var b, d = new Date(this.viewDate), s = d.getUTCFullYear(), l = d.getUTCMonth(), p = this.o.startDate !== -1 / 0 ? this.o.startDate.getUTCFullYear() : -1 / 0, tt = this.o.startDate !== -1 / 0 ? this.o.startDate.getUTCMonth() : -1 / 0, w = this.o.endDate !== 1 / 0 ? this.o.endDate.getUTCFullYear() : 1 / 0, it = this.o.endDate !== 1 / 0 ? this.o.endDate.getUTCMonth() : 1 / 0, rt = r[this.o.language].today || r.en.today || "", ut = r[this.o.language].clear || r.en.clear || "", ft = r[this.o.language].titleFormat || r.en.titleFormat, k = o(), k = (!0 === this.o.todayBtn || "linked" === this.o.todayBtn) && k >= this.o.startDate && k <= this.o.endDate && !this.weekOfDateIsDisabled(k), e, g, h, u, c, a, v, nt, y;
            if (!isNaN(s) && !isNaN(l)) {
                for (this.picker.find(".datepicker-days .datepicker-switch").text(i.formatDate(d, ft, this.o.language)),
                this.picker.find("tfoot .today").text(rt).css("display", k ? "table-cell" : "none"),
                this.picker.find("tfoot .clear").text(ut).css("display", !0 === this.o.clearBtn ? "table-cell" : "none"),
                this.picker.find("thead .datepicker-title").text(this.o.title).css("display", "string" == typeof this.o.title && "" !== this.o.title ? "table-cell" : "none"),
                this.updateNavArrows(),
                this.fillMonths(),
                e = f(s, l, 0),
                l = e.getUTCDate(),
                e.setUTCDate(l - (e.getUTCDay() - this.o.weekStart + 7) % 7),
                c = new Date(e),
                e.getUTCFullYear() < 100 && c.setUTCFullYear(e.getUTCFullYear()),
                c.setUTCDate(c.getUTCDate() + 42),
                c = c.valueOf(),
                a = []; e.valueOf() < c; )
                    (g = e.getUTCDay()) === this.o.weekStart && (a.push("<tr>"),
                    this.o.calendarWeeks) && (h = new Date(+e + (this.o.weekStart - g - 7) % 7 * 864e5),
                    v = new Date(Number(h) + (11 - h.getUTCDay()) % 7 * 864e5),
                    u = new Date(Number(u = f(v.getUTCFullYear(), 0, 1)) + (11 - u.getUTCDay()) % 7 * 864e5),
                    a.push('<td class="cw">' + ((v - u) / 6048e5 + 1) + "<\/td>")),
                    (h = this.getClassNames(e)).push("day"),
                    v = e.getUTCDate(),
                    this.o.beforeShowDay !== n.noop && ((u = this.o.beforeShowDay(this._utc_to_local(e))) === t ? u = {} : "boolean" == typeof u ? u = {
                        enabled: u
                    } : "string" == typeof u && (u = {
                        classes: u
                    }),
                    !1 === u.enabled && h.push("disabled"),
                    u.classes && (h = h.concat(u.classes.split(/\s+/))),
                    u.tooltip && (b = u.tooltip),
                    u.content && (v = u.content)),
                    h = n.isFunction(n.uniqueSort) ? n.uniqueSort(h) : n.unique(h),
                    a.push('<td class="' + h.join(" ") + '"' + (b ? ' title="' + b + '"' : "") + ' data-date="' + e.getTime().toString() + '">' + v + "<\/td>"),
                    b = null,
                    g === this.o.weekEnd && a.push("<\/tr>"),
                    e.setUTCDate(e.getUTCDate() + 1);
                this.picker.find(".datepicker-days tbody").html(a.join(""));
                l = r[this.o.language].monthsTitle || r.en.monthsTitle || "Months";
                y = this.picker.find(".datepicker-months").find(".datepicker-switch").text(this.o.maxViewMode < 2 ? l : s).end().find("tbody span").removeClass("active");
                n.each(this.dates, function(n, t) {
                    t.getUTCFullYear() === s && y.eq(t.getUTCMonth()).addClass("active")
                });
                (s < p || w < s) && y.addClass("disabled");
                s === p && y.slice(0, tt).addClass("disabled");
                s === w && y.slice(it + 1).addClass("disabled");
                this.o.beforeShowMonth !== n.noop && (nt = this,
                n.each(y, function(i, r) {
                    i = new Date(s,i,1);
                    i = nt.o.beforeShowMonth(i);
                    i === t ? i = {} : "boolean" == typeof i ? i = {
                        enabled: i
                    } : "string" == typeof i && (i = {
                        classes: i
                    });
                    !1 !== i.enabled || n(r).hasClass("disabled") || n(r).addClass("disabled");
                    i.classes && n(r).addClass(i.classes);
                    i.tooltip && n(r).prop("title", i.tooltip)
                }));
                this._fill_yearsView(".datepicker-years", "year", 10, s, p, w, this.o.beforeShowYear);
                this._fill_yearsView(".datepicker-decades", "decade", 100, s, p, w, this.o.beforeShowDecade);
                this._fill_yearsView(".datepicker-centuries", "century", 1e3, s, p, w, this.o.beforeShowCentury)
            }
        },
        updateNavArrows: function() {
            if (this._allow_update) {
                var i, r, u = new Date(this.viewDate), t = u.getUTCFullYear(), f = u.getUTCMonth(), e = this.o.startDate !== -1 / 0 ? this.o.startDate.getUTCFullYear() : -1 / 0, s = this.o.startDate !== -1 / 0 ? this.o.startDate.getUTCMonth() : -1 / 0, o = this.o.endDate !== 1 / 0 ? this.o.endDate.getUTCFullYear() : 1 / 0, h = this.o.endDate !== 1 / 0 ? this.o.endDate.getUTCMonth() : 1 / 0, n = 1;
                switch (this.viewMode) {
                case 4:
                    n *= 10;
                case 3:
                    n *= 10;
                case 2:
                    n *= 10;
                case 1:
                    i = Math.floor(t / n) * n <= e;
                    r = Math.floor(t / n) * n + n > o;
                    break;
                case 0:
                    i = t <= e && f <= s;
                    r = o <= t && h <= f
                }
                this.picker.find(".prev").toggleClass("disabled", i);
                this.picker.find(".next").toggleClass("disabled", r)
            }
        },
        click: function(t) {
            var r, u;
            t.preventDefault();
            t.stopPropagation();
            (t = n(t.target)).hasClass("datepicker-switch") && this.viewMode !== this.o.maxViewMode && this.setViewMode(this.viewMode + 1);
            t.hasClass("today") && !t.hasClass("day") && (this.setViewMode(0),
            this._setDate(o(), "linked" === this.o.todayBtn ? null : "view"));
            t.hasClass("clear") && this.clearDates();
            t.hasClass("disabled") || (t.hasClass("month") || t.hasClass("year") || t.hasClass("decade") || t.hasClass("century")) && (this.viewDate.setUTCDate(1),
            1 === this.viewMode ? (u = t.parent().find("span").index(t),
            r = this.viewDate.getUTCFullYear(),
            this.viewDate.setUTCMonth(u)) : (u = 0,
            r = Number(t.text()),
            this.viewDate.setUTCFullYear(r)),
            this._trigger(i.viewModes[this.viewMode - 1].e, this.viewDate),
            this.viewMode === this.o.minViewMode ? this._setDate(f(r, u, 1)) : (this.setViewMode(this.viewMode - 1),
            this.fill()));
            this.picker.is(":visible") && this._focused_from && this._focused_from.focus();
            delete this._focused_from
        },
        dayCellClick: function(t) {
            t = n(t.currentTarget).data("date");
            t = new Date(t);
            this.o.updateViewDate && (t.getUTCFullYear() !== this.viewDate.getUTCFullYear() && this._trigger("changeYear", this.viewDate),
            t.getUTCMonth() !== this.viewDate.getUTCMonth() && this._trigger("changeMonth", this.viewDate));
            this._setDate(t)
        },
        navArrowsClick: function(t) {
            t = n(t.currentTarget).hasClass("prev") ? -1 : 1;
            0 !== this.viewMode && (t *= 12 * i.viewModes[this.viewMode].navStep);
            this.viewDate = this.moveMonth(this.viewDate, t);
            this._trigger(i.viewModes[this.viewMode].e, this.viewDate);
            this.fill()
        },
        _toggle_multidate: function(n) {
            var t = this.dates.contains(n);
            if (n || this.dates.clear(),
            -1 !== t ? (!0 === this.o.multidate || 1 < this.o.multidate || this.o.toggleActive) && this.dates.remove(t) : (!1 === this.o.multidate && this.dates.clear(),
            this.dates.push(n)),
            "number" == typeof this.o.multidate)
                for (; this.dates.length > this.o.multidate; )
                    this.dates.remove(0)
        },
        _setDate: function(n, t) {
            t && "date" !== t || this._toggle_multidate(n && new Date(n));
            (!t && this.o.updateViewDate || "view" === t) && (this.viewDate = n && new Date(n));
            this.fill();
            this.setValue();
            t && "view" === t || this._trigger("changeDate");
            this.inputField.trigger("change");
            !this.o.autoclose || t && "date" !== t || this.hide()
        },
        moveDay: function(n, t) {
            var i = new Date(n);
            return i.setUTCDate(n.getUTCDate() + t),
            i
        },
        moveWeek: function(n, t) {
            return this.moveDay(n, 7 * t)
        },
        moveMonth: function(n, t) {
            var e, f;
            if (!(e = n) || isNaN(e.getTime()))
                return this.o.defaultViewDate;
            if (!t)
                return n;
            var r, u, i = new Date(n.valueOf()), o = i.getUTCDate(), s = i.getUTCMonth(), h = Math.abs(t);
            if (t = 0 < t ? 1 : -1,
            1 === h)
                u = -1 === t ? function() {
                    return i.getUTCMonth() === s
                }
                : function() {
                    return i.getUTCMonth() !== r
                }
                ,
                r = s + t,
                i.setUTCMonth(r),
                r = (r + 12) % 12;
            else {
                for (f = 0; f < h; f++)
                    i = this.moveMonth(i, t);
                r = i.getUTCMonth();
                i.setUTCDate(o);
                u = function() {
                    return r !== i.getUTCMonth()
                }
            }
            for (; u(); )
                i.setUTCDate(--o),
                i.setUTCMonth(r);
            return i
        },
        moveYear: function(n, t) {
            return this.moveMonth(n, 12 * t)
        },
        moveAvailableDate: function(n, t, i) {
            do
                if (n = this[i](n, t),
                !this.dateWithinRange(n))
                    return !1;
            while (i = "moveDay",
            this.dateIsDisabled(n));
            return n
        },
        weekOfDateIsDisabled: function(t) {
            return -1 !== n.inArray(t.getUTCDay(), this.o.daysOfWeekDisabled)
        },
        dateIsDisabled: function(t) {
            return this.weekOfDateIsDisabled(t) || 0 < n.grep(this.o.datesDisabled, function(n) {
                return l(t, n)
            }).length
        },
        dateWithinRange: function(n) {
            return n >= this.o.startDate && n <= this.o.endDate
        },
        keydown: function(n) {
            if (this.picker.is(":visible")) {
                var t, r, u = !1, i = this.focusDate || this.viewDate;
                switch (n.keyCode) {
                case 27:
                    this.focusDate ? (this.focusDate = null,
                    this.viewDate = this.dates.get(-1) || this.viewDate,
                    this.fill()) : this.hide();
                    n.preventDefault();
                    n.stopPropagation();
                    break;
                case 37:
                case 38:
                case 39:
                case 40:
                    if (!this.o.keyboardNavigation || 7 === this.o.daysOfWeekDisabled.length)
                        break;
                    t = 37 === n.keyCode || 38 === n.keyCode ? -1 : 1;
                    0 === this.viewMode ? n.ctrlKey ? (r = this.moveAvailableDate(i, t, "moveYear")) && this._trigger("changeYear", this.viewDate) : n.shiftKey ? (r = this.moveAvailableDate(i, t, "moveMonth")) && this._trigger("changeMonth", this.viewDate) : 37 === n.keyCode || 39 === n.keyCode ? r = this.moveAvailableDate(i, t, "moveDay") : this.weekOfDateIsDisabled(i) || (r = this.moveAvailableDate(i, t, "moveWeek")) : 1 === this.viewMode ? (38 !== n.keyCode && 40 !== n.keyCode || (t *= 4),
                    r = this.moveAvailableDate(i, t, "moveMonth")) : 2 === this.viewMode && (38 !== n.keyCode && 40 !== n.keyCode || (t *= 4),
                    r = this.moveAvailableDate(i, t, "moveYear"));
                    r && (this.focusDate = this.viewDate = r,
                    this.setValue(),
                    this.fill(),
                    n.preventDefault());
                    break;
                case 13:
                    if (!this.o.forceParse)
                        break;
                    i = this.focusDate || this.dates.get(-1) || this.viewDate;
                    this.o.keyboardNavigation && (this._toggle_multidate(i),
                    u = !0);
                    this.focusDate = null;
                    this.viewDate = this.dates.get(-1) || this.viewDate;
                    this.setValue();
                    this.fill();
                    this.picker.is(":visible") && (n.preventDefault(),
                    n.stopPropagation(),
                    this.o.autoclose && this.hide());
                    break;
                case 9:
                    this.focusDate = null;
                    this.viewDate = this.dates.get(-1) || this.viewDate;
                    this.fill();
                    this.hide()
                }
                u && (this.dates.length ? this._trigger("changeDate") : this._trigger("clearDate"),
                this.inputField.trigger("change"))
            } else
                40 !== n.keyCode && 27 !== n.keyCode || (this.show(),
                n.stopPropagation())
        },
        setViewMode: function(n) {
            this.viewMode = n;
            this.picker.children("div").hide().filter(".datepicker-" + i.viewModes[this.viewMode].clsName).show();
            this.updateNavArrows();
            this._trigger("changeViewMode", new Date(this.viewDate))
        }
    };
    c.prototype = {
        updateDates: function() {
            this.dates = n.map(this.pickers, function(n) {
                return n.getUTCDate()
            });
            this.updateRanges()
        },
        updateRanges: function() {
            var t = n.map(this.dates, function(n) {
                return n.valueOf()
            });
            n.each(this.pickers, function(n, i) {
                i.setRange(t)
            })
        },
        clearDates: function() {
            n.each(this.pickers, function(n, t) {
                t.clearDates()
            })
        },
        dateUpdated: function(i) {
            var u;
            if (!this.updating && (this.updating = !0,
            u = n.data(i.target, "datepicker"),
            u !== t)) {
                var r = u.getUTCDate()
                  , o = this.keepEmptyValues
                  , i = n.inArray(i.target, this.inputs)
                  , f = i - 1
                  , e = i + 1
                  , s = this.inputs.length;
                if (-1 !== i) {
                    if (n.each(this.pickers, function(n, t) {
                        t.getUTCDate() || t !== u && o || t.setUTCDate(r)
                    }),
                    r < this.dates[f])
                        for (; 0 <= f && r < this.dates[f]; )
                            this.pickers[f--].setUTCDate(r);
                    else if (r > this.dates[e])
                        for (; e < s && r > this.dates[e]; )
                            this.pickers[e++].setUTCDate(r);
                    this.updateDates();
                    delete this.updating
                }
            }
        },
        destroy: function() {
            n.map(this.pickers, function(n) {
                n.destroy()
            });
            n(this.inputs).off("changeDate", this.dateUpdated);
            delete this.element.data().datepicker
        },
        remove: h("destroy", "Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead")
    };
    y = n.fn.datepicker;
    s = function(i) {
        var f, o = Array.apply(null, arguments);
        if (o.shift(),
        this.each(function() {
            var l, a, h = n(this), s = h.data("datepicker"), t = "object" == _typeof(i) && i;
            s || (l = function(t, i) {
                function e(n, t) {
                    return t.toLowerCase()
                }
                var r, u = n(t).data(), f = {}, o = new RegExp("^" + i.toLowerCase() + "([A-Z])");
                for (r in i = new RegExp("^" + i.toLowerCase()),
                u)
                    i.test(r) && (f[r.replace(o, e)] = u[r]);
                return f
            }(this, "date"),
            a = function(t) {
                var u = {}, i;
                if (r[t] || (t = t.split("-")[0],
                r[t]))
                    return i = r[t],
                    n.each(p, function(n, t) {
                        t in i && (u[t] = i[t])
                    }),
                    u
            }(n.extend({}, e, l, t).language),
            t = n.extend({}, e, a, l, t),
            s = h.hasClass("input-daterange") || t.inputs ? (n.extend(t, {
                inputs: t.inputs || h.find("input").toArray()
            }),
            new c(this,t)) : new u(this,t),
            h.data("datepicker", s));
            "string" == typeof i && "function" == typeof s[i] && (f = s[i].apply(s, o))
        }),
        f === t || f instanceof u || f instanceof c)
            return this;
        if (1 < this.length)
            throw new Error("Using only allowed for the collection of a single element (" + i + " function)");
        return f
    }
    ;
    n.fn.datepicker = s;
    e = n.fn.datepicker.defaults = {
        assumeNearbyYear: !1,
        autoclose: !1,
        beforeShowDay: n.noop,
        beforeShowMonth: n.noop,
        beforeShowYear: n.noop,
        beforeShowDecade: n.noop,
        beforeShowCentury: n.noop,
        calendarWeeks: !1,
        clearBtn: !1,
        toggleActive: !1,
        daysOfWeekDisabled: [],
        daysOfWeekHighlighted: [],
        datesDisabled: [],
        endDate: 1 / 0,
        forceParse: !0,
        format: "mm/dd/yyyy",
        keepEmptyValues: !1,
        keyboardNavigation: !0,
        language: "en",
        minViewMode: 0,
        maxViewMode: 4,
        multidate: !1,
        multidateSeparator: ",",
        orientation: "auto",
        rtl: !1,
        startDate: -1 / 0,
        startView: 0,
        todayBtn: !1,
        todayHighlight: !1,
        updateViewDate: !0,
        weekStart: 0,
        disableTouchKeyboard: !1,
        enableOnReadonly: !0,
        showOnFocus: !0,
        zIndexOffset: 10,
        container: "body",
        immediateUpdates: !1,
        title: "",
        templates: {
            leftArrow: "&#x00AB;",
            rightArrow: "&#x00BB;"
        },
        showWeekDays: !0
    };
    p = n.fn.datepicker.locale_opts = ["format", "rtl", "weekStart"];
    n.fn.datepicker.Constructor = u;
    r = n.fn.datepicker.dates = {
        en: {
            days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
            daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
            daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
            months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
            monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
            today: "Today",
            clear: "Clear",
            titleFormat: "MM yyyy"
        }
    };
    i = {
        viewModes: [{
            names: ["days", "month"],
            clsName: "days",
            e: "changeMonth"
        }, {
            names: ["months", "year"],
            clsName: "months",
            e: "changeYear",
            navStep: 1
        }, {
            names: ["years", "decade"],
            clsName: "years",
            e: "changeDecade",
            navStep: 10
        }, {
            names: ["decades", "century"],
            clsName: "decades",
            e: "changeCentury",
            navStep: 100
        }, {
            names: ["centuries", "millennium"],
            clsName: "centuries",
            e: "changeMillennium",
            navStep: 1e3
        }],
        validParts: /dd?|DD?|mm?|MM?|yy(?:yy)?/g,
        nonpunctuation: /[^ -\/:-@\u5e74\u6708\u65e5\[-`{-~\t\n\r]+/g,
        parseFormat: function(n) {
            if ("function" == typeof n.toValue && "function" == typeof n.toDisplay)
                return n;
            var t = n.replace(this.validParts, "\0").split("\0")
              , n = n.match(this.validParts);
            if (!t || !t.length || !n || 0 === n.length)
                throw new Error("Invalid date format.");
            return {
                separators: t,
                parts: n
            }
        },
        parseDate: function(f, e, s, h) {
            function tt() {
                var n = this.slice(0, a[c].length)
                  , t = a[c].slice(0, n.length);
                return n.toLowerCase() === t.toLowerCase()
            }
            var y, it, rt, ut, g, v, k, d, c, ft;
            if (!f)
                return t;
            if (f instanceof Date)
                return f;
            if ((e = "string" == typeof e ? i.parseFormat(e) : e).toValue)
                return e.toValue(f, e, s);
            if (ut = {
                d: "moveDay",
                m: "moveMonth",
                w: "moveWeek",
                y: "moveYear"
            },
            g = {
                yesterday: "-1d",
                today: "+0d",
                tomorrow: "+1d"
            },
            /^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/i.test(f = f in g ? g[f] : f)) {
                for (a = f.match(/([\-+]\d+)([dmwy])/gi),
                f = new Date,
                c = 0; c < a.length; c++)
                    y = a[c].match(/([\-+]\d+)([dmwy])/i),
                    it = Number(y[1]),
                    rt = ut[y[2].toLowerCase()],
                    f = u.prototype[rt](f, it);
                return u.prototype._zero_utc_time(f)
            }
            var p, w, a = f && f.match(this.nonpunctuation) || [], b = {}, nt = ["yyyy", "yy", "M", "MM", "m", "mm", "d", "dd"], l = {
                yyyy: function(n, t) {
                    return n.setUTCFullYear(h ? (!0 === (i = h) && (i = 10),
                    (n = t) < 100 && (n += 2e3) > (new Date).getFullYear() + i && (n -= 100),
                    n) : t);
                    var i
                },
                m: function(n, t) {
                    if (isNaN(n))
                        return n;
                    for (--t; t < 0; )
                        t += 12;
                    for (n.setUTCMonth(t %= 12); n.getUTCMonth() !== t; )
                        n.setUTCDate(n.getUTCDate() - 1);
                    return n
                },
                d: function(n, t) {
                    return n.setUTCDate(t)
                }
            };
            if (l.yy = l.yyyy,
            l.M = l.MM = l.mm = l.m,
            l.dd = l.d,
            f = o(),
            v = e.parts.slice(),
            a.length !== v.length && (v = n(v).filter(function(t, i) {
                return -1 !== n.inArray(i, nt)
            }).toArray()),
            a.length === v.length) {
                for (c = 0,
                ft = v.length; c < ft; c++) {
                    if (p = parseInt(a[c], 10),
                    y = v[c],
                    isNaN(p))
                        switch (y) {
                        case "MM":
                            w = n(r[s].months).filter(tt);
                            p = n.inArray(w[0], r[s].months) + 1;
                            break;
                        case "M":
                            w = n(r[s].monthsShort).filter(tt);
                            p = n.inArray(w[0], r[s].monthsShort) + 1
                        }
                    b[y] = p
                }
                for (c = 0; c < nt.length; c++)
                    (d = nt[c])in b && !isNaN(b[d]) && (k = new Date(f),
                    l[d](k, b[d]),
                    isNaN(k) || (f = k))
            }
            return f
        },
        formatDate: function(t, u, f) {
            var e;
            if (!t)
                return "";
            if ((u = "string" == typeof u ? i.parseFormat(u) : u).toDisplay)
                return u.toDisplay(t, u, f);
            e = {
                d: t.getUTCDate(),
                D: r[f].daysShort[t.getUTCDay()],
                DD: r[f].days[t.getUTCDay()],
                m: t.getUTCMonth() + 1,
                M: r[f].monthsShort[t.getUTCMonth()],
                MM: r[f].months[t.getUTCMonth()],
                yy: t.getUTCFullYear().toString().substring(2),
                yyyy: t.getUTCFullYear()
            };
            e.dd = (e.d < 10 ? "0" : "") + e.d;
            e.mm = (e.m < 10 ? "0" : "") + e.m;
            t = [];
            for (var s = n.extend([], u.separators), o = 0, h = u.parts.length; o <= h; o++)
                s.length && t.push(s.shift()),
                t.push(e[u.parts[o]]);
            return t.join("")
        },
        headTemplate: '<thead><tr><th colspan="7" class="datepicker-title"><\/th><\/tr><tr><th class="prev">' + e.templates.leftArrow + '<\/th><th colspan="5" class="datepicker-switch"><\/th><th class="next">' + e.templates.rightArrow + "<\/th><\/tr><\/thead>",
        contTemplate: '<tbody><tr><td colspan="7"><\/td><\/tr><\/tbody>',
        footTemplate: '<tfoot><tr><th colspan="7" class="today"><\/th><\/tr><tr><th colspan="7" class="clear"><\/th><\/tr><\/tfoot>'
    };
    i.template = '<div class="datepicker"><div class="datepicker-days"><table class="table-condensed">' + i.headTemplate + "<tbody><\/tbody>" + i.footTemplate + '<\/table><\/div><div class="datepicker-months"><table class="table-condensed">' + i.headTemplate + i.contTemplate + i.footTemplate + '<\/table><\/div><div class="datepicker-years"><table class="table-condensed">' + i.headTemplate + i.contTemplate + i.footTemplate + '<\/table><\/div><div class="datepicker-decades"><table class="table-condensed">' + i.headTemplate + i.contTemplate + i.footTemplate + '<\/table><\/div><div class="datepicker-centuries"><table class="table-condensed">' + i.headTemplate + i.contTemplate + i.footTemplate + "<\/table><\/div><\/div>";
    n.fn.datepicker.DPGlobal = i;
    n.fn.datepicker.noConflict = function() {
        return n.fn.datepicker = y,
        this
    }
    ;
    n.fn.datepicker.version = "1.9.0";
    n.fn.datepicker.deprecated = function(n) {
        var t = window.console;
        t && t.warn && t.warn("DEPRECATED: " + n)
    }
    ;
    n(document).on("focus.datepicker.data-api click.datepicker.data-api", '[data-provide="datepicker"]', function(t) {
        var i = n(this);
        i.data("datepicker") || (t.preventDefault(),
        s.call(i, "show"))
    });
    n(function() {
        s.call(n('[data-provide="datepicker-inline"]'))
    })
});
abandonSession = function() {
    $.ajax({
        url: "/memberaccount/abandonsession",
        contentType: "application/json",
        type: "GET",
        success: function(n) {
            return n
        },
        error: function() {
            console.log("There was an error abandoning session")
        }
    })
}
;
Vue.component("global-account-switcher", {
    template: '\n<div class="dropdown">\n    <button type="button" data-privacy="true" class="data-privacy" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\n        <span v-if="selected">{{getDisplayText(selected)}}<\/span>\n    <\/button>\n    <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">\n        <a class="dropdown-item data-privacy" data-privacy="true" href="#" v-for="(row, index) in rows" v-on:click="select(row)"\n            data-trigger="gaModule"\n            data-module="Account switcher"\n            data-label="Switch to account"\n            :data-position="index + 1">{{getDisplayText(row)}}<\/a>\n    <\/div>\n<\/div>\n',
    props: ["accounts", "requestedAccountNumber", "requestedProductCode"],
    data: function() {
        return {
            selected: null
        }
    },
    computed: {
        rows: function() {
            return this.accounts ? this.accounts.sort(function(n, t) {
                return n.displayOrder - t.displayOrder
            }) : []
        }
    },
    methods: {
        getDisplayText: function(n) {
            return n.isNoBalance || n.isLifeTimePension || n.hideBalance ? n.accountNumber + " - " + n.accountName : n.accountNumber + " - " + n.accountName + ": " + MemberPortal.currencyFormat.format(n.balanceAmount)
        },
        select: function(n) {
            this.selected = n;
            this.$emit("selection:changed", n);
            localStorage.lastAccountNumber = n.accountNumber;
            localStorage.lastProductCode = n.productCode;
            this.pushToDataLayer(n)
        },
        pushToDataLayer: function(n) {
            try {
                window.dataLayer = window.dataLayer || [];
                window.dataLayer.push({
                    event: "form_submit",
                    form_name: "Account Selection",
                    form_step: "Filter results",
                    form_step_number: "1",
                    field_type: "SELECT",
                    element_id: "dropdownMenuButton",
                    element_classes: "dropdown-item",
                    element_text: n.accountName,
                    platform: "sitecore",
                    product: "Member online",
                    brand: "ART"
                })
            } catch (n) {
                console.error("error pushing data to tag manager", n)
            }
        }
    },
    mounted: function() {
        var n, t, i;
        this.accounts && this.accounts.length && (n = this.requestedAccountNumber || localStorage.lastAccountNumber,
        t = this.requestedProductCode || localStorage.lastProductCode,
        i = this.accounts.find(function(i) {
            return i.accountNumber === n && i.productCode === t
        }) || this.accounts.find(function(n) {
            return n.isSelected
        }),
        this.select(i))
    }
});
triggerGoal = function(n) {
    var t = $('input[name="__RequestVerificationToken"]').val();
    $.ajax({
        type: "POST",
        url: "/Analytics/TriggerGoal",
        data: {
            __RequestVerificationToken: t,
            goalId: n
        },
        success: function(n) {
            console.log("trigger goal success " + n)
        },
        error: function(n) {
            console.log("trigger goal error " + n)
        }
    })
}
;
Vue.component("global-async-html-request", {
    props: ["url"],
    render: function() {
        return this.loading ? this.$scopedSlots.loading({}) : this.error ? this.$scopedSlots.error({}) : this.$scopedSlots.default({
            response: this.response
        })
    },
    data: function() {
        return {
            loading: !0,
            error: !1,
            response: null
        }
    },
    watch: {
        url: {
            immediate: !0,
            handler: function(n) {
                var t;
                n && ((t = this).loading = !0,
                t.error = !1,
                t.response = null,
                $.ajax({
                    url: n,
                    type: "GET",
                    xhrFields: {
                        withCredentials: !0
                    },
                    error: function(i, r, u) {
                        u ? console.error(u) : console.error("Failed to retrieve data at %s", n);
                        t.loading = !1;
                        t.error = !0
                    },
                    success: function(n) {
                        n.status && "success" !== n.status ? n.message ? console.error(n.message, n) : console.error(n) : (t.response = n,
                        t.loading = !1)
                    }
                }))
            }
        }
    }
});
Vue.component("global-deeplink-cookies", {
    template: "<span><\/span>",
    mounted: function() {
        var n = this;
        this.isMOLCookiesSet || $.ajax({
            url: "/api/proxy/getmoldeeplink",
            type: "GET",
            xhrFields: {
                withCredentials: !0
            },
            error: function(n, t, i) {
                i ? console.error(i) : console.error("Failed to retrieve data at %s", source)
            },
            success: function(t) {
                t.status && "success" === t.status && !n.isMOLCookiesSet && t.cookies.forEach(n.setCookie)
            }
        })
    },
    computed: {
        isMOLCookiesSet: function() {
            return null !== this.getCookie("am-auth-jwt")
        }
    },
    methods: {
        getCookie: function(n) {
            var t = document.cookie, r = n + "=", n = t.indexOf("; " + r), i;
            if (-1 == n) {
                if (0 != (n = t.indexOf(r)))
                    return null
            } else
                n += 2,
                i = document.cookie.indexOf(";", n),
                -1 == i && (i = t.length);
            return decodeURI(t.substring(n + r.length, i))
        },
        setCookie: function(n) {
            var t = new Date;
            t.setHours(t.getHours() + 1);
            document.cookie = n.name + "=" + n.value + ";expires=" + t + ";domain=" + n.domain + ";path=/"
        }
    }
});
Vue.component("global-deeplink", {
    template: '\n<div class="iframe-container">\n    <div class="iframe-loading">\n        <h1 class="skeleton-w-30"><\/h1>\n        <p>&nbsp;<\/p>\n        <p class="skeleton-w-100"><\/p>\n        <p class="skeleton-w-100"><\/p>\n        <p class="skeleton-w-80"><\/p>\n        <p class="skeleton-w-100"><\/p>\n        <p class="skeleton-w-100"><\/p>\n        <p class="skeleton-w-50"><\/p>\n    <\/div>\n    <div class="iframe-loaded">\n        <iframe style="position:relative; top:0; left:0; min-width: 100%; width: 1px; overflow: hidden;" name="mvpframe" id="mvpframe" :src="targetUrl" allowtransparency="false"><\/iframe>\n        <input type="hidden" id="iframeurl" :value="targetUrl" />\n    <\/div>\n<\/div>\n    ',
    props: ["url", "base"],
    data: function() {
        return {
            memberNumber: null,
            productCode: null,
            updatingMemberNumber: !1,
            noAccountSelector: !1
        }
    },
    computed: {
        targetUrl: function() {
            return this.memberNumber && !this.updatingMemberNumber ? this.productCode ? this.url.endsWith("/#/") ? this.url + this.productCode : -1 === this.url.indexOf("?") ? this.url + "?accountCode=" + this.productCode : this.url + "&accountCode=" + this.productCode : this.url : this.noAccountSelector ? this.url : null
        },
        delegateUrl: function() {
            return this.base + "/DelegateMembership/Member/" + this.memberNumber
        }
    },
    mounted: function() {
        var n, t, i = this.$root.$refs["account-switcher"], r = this.$root.$refs["member-number-switcher"];
        i ? (n = this,
        i.selected && (n.memberNumber = i.selected.accountNumber,
        n.productCode = i.selected.productCode),
        i.$on("selection:changed", function(t) {
            n.memberNumber = t.accountNumber;
            n.productCode = t.productCode
        })) : r ? (t = this,
        r.selected && (t.memberNumber = r.selected.accountNumber,
        t.productCode = null),
        r.$on("selection:changed", function(n) {
            t.memberNumber = n.accountNumber;
            t.productCode = null
        })) : this.noAccountSelector = !0;
        iFrameResize({
            log: !1,
            checkOrigin: !1
        }, "#mvpframe")
    },
    watch: {
        memberNumber: {
            handler: function() {
                this.updatingMemberNumber = !0
            }
        },
        delegateUrl: {
            handler: function(n) {
                var t = this;
                $.ajax({
                    url: n,
                    type: "GET",
                    xhrFields: {
                        withCredentials: !0
                    },
                    error: function(t, i, r) {
                        r ? console.error(r) : console.error("Failed to invoke delegate URL at %s", n)
                    }
                }).always(function() {
                    t.updatingMemberNumber = !1
                })
            }
        }
    }
});
Vue.use(VeeValidate);
Vue.component("global-feedback", {
    template: '\n    <div class="website-feedback d-print-none">\n        <div class="content">\n            <span v-if="!feedbackSent && !feedbackError && !showModal">{{sitecore.canThisPageBetter}}<\/span>\n            <span v-if="feedbackSent">{{sitecore.successMessage}}<\/span>\n            <span v-if="feedbackError">{{sitecore.errorMessage}}<\/span>\n            <span v-if="!feedbackSent && !feedbackError && !showModal">\n                <a v-on:click.prevent="showModal=true;" href="" class="feedback-button"\n                    data-trigger="gaModule"\n                    :data-module="sitecore.canThisPageBetter"\n                    :data-label="sitecore.betterYes">\n                    {{sitecore.betterYes}}\n                <\/a>\n                <a v-on:click.prevent="submitFeedback(false)" href="" class="feedback-button"\n                    data-trigger="gaModule"\n                    :data-module="sitecore.canThisPageBetter"\n                    :data-label="sitecore.betterNo">\n                    {{sitecore.betterNo}}\n                <\/a>\n            <\/span>\n        <\/div>\n        <div class="feedback-modal memberportal-form" v-if="showModal">\n            <div class="close-button" @click="showModal = false">X<\/div>\n            <h2 id="feedback-label">{{sitecore.canWeDoBetter}}<\/h2>\n\n            <textarea name="feedback" id="feedback-question" v-model="feedbackQuestion" title="feedback-question" :placeholder="sitecore.placeholderMessage" v-validate="\'required\'" :maxlength="sitecore.maxLengthField" aria-required="true" aria-describedby="feedback-question-error"><\/textarea>\n            <span class="error" v-if="errors.has(\'feedback\')">{{sitecore.emptyErrorMessage}}<\/span>\n            <button type="button" class="btn art orange-yoke" v-on:click.prevent="submitFeedback(true)" >\n                {{sitecore.sendFeedback}}\n                <span class="icon">\n                    <svg role="img" title="arrow">\n                        <use xlink:href="/Assets/resources/images/icons/sprite.svg#icn-arrow"><\/use>\n                    <\/svg>\n                <\/span>\n            <\/button>\n        <\/div>\n    <\/div>\n    ',
    props: ["data", "sitecore"],
    data: function() {
        return {
            feedbackSent: !1,
            feedbackError: !1,
            showModal: !1,
            feedbackQuestion: ""
        }
    },
    computed: {},
    methods: {
        submitFeedback: function(n) {
            var i = this
              , t = this;
            this.showModal ? this.$validator.validateAll().then(function() {
                t.errors.any() || t.postFeedbackToBackEnd(t, i.feedbackQuestion, n)
            }) : this.postFeedbackToBackEnd(t, "", n)
        },
        postFeedbackToBackEnd: function(n, t, i) {
            $.ajax({
                type: "POST",
                url: "/ProvideFeedback/ProvideFeedback",
                data: {
                    __RequestVerificationToken: $("input[name=__RequestVerificationToken]").val(),
                    CanThisPageBeBetter: i,
                    FeedbackText: t,
                    PageTitle: document.title,
                    Application: "MemberPortal",
                    PageUrl: window.location.href
                },
                success: function() {
                    n.feedbackSent = !0;
                    n.showModal = !1
                },
                error: function() {
                    throw n.feedbackError = !0,
                    Error(response.statusText);
                }
            })
        }
    }
});
Vue.component("global-last-visited-load", {
    template: '<p class="dashboard-header-call-to-action" v-if="message" v-html="message"><\/p>',
    props: ["format"],
    computed: {
        message: function() {
            var n = localStorage.last_visited;
            return n && (n = JSON.parse(n),
            n.title && n.url) ? (n = '<a href="' + n.url + '" data-trigger="gaModule" data-module="You were last looking at" data-label="' + n.title + '">' + n.title + "<\/a>",
            this.format.format(n)) : null
        }
    }
});
Vue.component("global-last-visited-save", {
    template: "<!-- nothing to render -->",
    props: ["title", "url"],
    computed: {
        lastVisited: function() {
            return this.title && this.url ? {
                title: this.title,
                url: this.url
            } : {}
        }
    },
    watch: {
        lastVisited: {
            immediate: !0,
            handler: function(n) {
                n && (localStorage.last_visited = JSON.stringify(n))
            }
        }
    }
});
Vue.component("global-link-with-arrow", {
    template: '\n<a class="link-with-arrow" \n    :href="href" \n    :target="target" \n    :data-toggle="dataToggle" \n    :data-target="dataTarget"\n    :data-trigger="trigger"\n    :data-module="module"\n    :data-label="label"\n    :data-position="position">\n    <span class="icon">\n        <svg role="img" title="arrow">\n            <use xlink:href="/Assets/resources/images/icons/sprite.svg#icn-arrow"><\/use>\n        <\/svg>\n    <\/span><span><slot><\/slot><\/span>\n<\/a>\n    ',
    props: ["url", "target", "modal", "trigger", "module", "label", "position"],
    computed: {
        href: function() {
            return this.modal ? "#" : this.url
        },
        dataToggle: function() {
            return this.modal ? "modal" : null
        },
        dataTarget: function() {
            return this.modal || null
        }
    }
});
Vue.component("global-member-number-switcher", {
    template: '\n<div class="dropdown">\n    <button type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\n        <span v-if="selected">{{getDisplayText(selected)}}<\/span>\n    <\/button>\n    <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">\n        <a class="dropdown-item" href="#" v-for="(row, index) in rows" v-on:click="select(row)"\n            data-trigger="gaModule"\n            data-module="Member number switcher"\n            data-label="Switch to member number"\n            :data-position="index + 1">\n            {{getDisplayText(row)}}\n        <\/a>\n    <\/div>\n<\/div>\n',
    props: ["accounts", "requestedMemberNumber"],
    data: function() {
        return {
            selected: null
        }
    },
    computed: {
        rows: function() {
            return this.accounts ? this.accounts.sort(function(n, t) {
                return n.displayOrder - t.displayOrder
            }) : []
        }
    },
    methods: {
        getDisplayText: function(n) {
            return n.accountNumber
        },
        select: function(n) {
            this.selected = n;
            this.$emit("selection:changed", n);
            localStorage.lastAccountNumber = n.accountNumber;
            localStorage.lastProductCode = null;
            $.ajax({
                url: "/DeepLinks/UpdateMemberNumber",
                type: "POST",
                contentType: "application/json; charset=utf-8",
                data: JSON.stringify({
                    memberNumber: n.accountNumber
                }),
                error: function(n, t, i) {
                    i ? console.error(i) : console.error("Failed to update member number at %s", source)
                }
            });
            setTimeout(function() {
                var t = $(".react-important-fund-details-data .member-number");
                "undefined" !== t && 0 < t.length && (t[0].innerText = n.accountNumber)
            }, 2e3)
        }
    },
    mounted: function() {
        var n, t;
        this.accounts && this.accounts.length && (n = this.requestedMemberNumber || localStorage.lastAccountNumber,
        t = this.accounts.find(function(t) {
            return t.accountNumber === n
        }) || this.accounts.find(function(n) {
            return n.isSelected
        }),
        this.select(t))
    }
});
Vue.component("global-modal-container", {
    template: '\n<div class="global-modal-container">\n    <global-modal v-for="modal in modals" \n                :key="modal.referral" \n                :referral="modal.referral"\n                :hideHeader="modal.hideHeader"\n                :hideBody="modal.hideBody"\n                :hideFooter="modal.hideFooter">\n        <template v-slot:header v-if="modal.header">\n            <div v-html="modal.header"><\/div>\n        <\/template>\n        <template v-slot:close v-if="modal.close">\n            <div v-html="modal.close"><\/div>\n        <\/template>\n        <template v-slot:body v-if="modal.body">\n            <div v-html="modal.body"><\/div>\n        <\/template>\n        <template v-slot:footer v-if="modal.footer">\n            <div v-html="modal.footer"><\/div>\n        <\/template>\n    <\/global-modal>\n    <slot><\/slot>\n<\/div>\n    ',
    data: function() {
        return {
            modals: []
        }
    },
    methods: {
        attach: function(n) {
            n && n.referral && this.modals.push(n)
        },
        detach: function(n) {
            n && n.referral && (this.modals = this.modals.filter(function(t) {
                return t.referral !== n.referral
            }))
        }
    }
});
Vue.component("global-modal", {
    template: '\n<div class="modal fade global-modal" :id="referral" tabindex="-1" role="dialog" aria-hidden="true">\n    <div class="modal-dialog modal-dialog-centered" role="document">\n        <div class="modal-content">\n            <div class="modal-header" v-if="!hideHeader">\n                <slot name="header" />\n                <button type="button" class="close" data-dismiss="modal" aria-label="Close">\n                <\/button>\n            <\/div>\n            <div class="modal-body" v-if="!hideBody">\n                <slot name="body" />\n            <\/div>\n            <div class="modal-footer" v-if="!hideFooter">\n                <slot name="footer">\n                    <button type="button" class="btn btn-secondary" data-dismiss="modal">Close<\/button>\n                    <button type="button" class="btn btn-primary">Save changes<\/button>\n                <\/slot>\n            <\/div>\n            <div class="modal-close">\n                <slot name="close">\n                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">\n                        <div>\n                            <span aria-hidden="true">Close<\/span>\n                            <span aria-hidden="true">&times;<\/span>\n                        <\/div>\n                    <\/button>\n                <\/slot>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/div>\n    ',
    props: ["referral", "hideHeader", "hideBody", "hideFooter"]
});
Vue.component("global-nudge-container", {
    template: '\n<div class="global-nudge-container">\n    <div class="modal fade global-modal" id="nudgeModal" tabindex="-1" role="dialog" aria-hidden="false">\n        <div class="modal-dialog modal-dialog-centered" role="document">\n            <div class="modal-content">\n                <div class="modal-body" :class="{ \'big-margin\': useBiggerMargin }">\n                    <slot />\n                <\/div>\n                <div class="tab-switcher" v-if="showTabSwitcher">\n                    <a href="#" v-for="i in numberOfTabs" v-on:click="selectTab(i-1)"\n                        data-trigger="gaExperience"\n                        data-module="Switch nudge splash screen tab to"\n                        :data-label="getLabel(i-1)"\n                        :data-position="i">\n                        <div :class="{ \'active\': tabIndex === (i-1) }"/>\n                    <\/a>\n                <\/div>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/div>\n',
    props: ["data", "sitecore"],
    data: function() {
        return {
            tabIndex: 0,
            numberOfTabs: 0,
            showTabSwitcher: !0,
            useBrightCloseButton: !0,
            useBiggerMargin: !0,
            continueButtonType: "btn-continue",
            closeModalbuttonType: "btn-close-modal",
            nudgeHeadClass: "nudge-head",
            viewportSize: "desktop",
            hasBackgroundImage: null,
            initialized: !1,
            refresh: null
        }
    },
    methods: {
        getLabel: function(n) {
            return n = $("#nudgeModal div.modal-body >*").eq(n).attr("data-nudge-id"),
            n = JSON.parse(n),
            1e3 === n ? "Welcome message" : 1 === n ? "Find My Super" : 2 === n ? "We Found Some Super" : null
        },
        showTab: function(n) {
            var t = $("#nudgeModal div.modal-body >*").eq(n)
              , i = t.attr("data-nudge-id");
            JSON.parse(i);
            this.pushTrackingData(t.attr("data-analytics-trigger"), t.attr("data-analytics-modal-id"), t.attr("data-analytics-modal-name"));
            t.show();
            this.tabIndex = n
        },
        hideTab: function(n) {
            $("#nudgeModal div.modal-body >*").eq(n).hide()
        },
        selectTab: function(n) {
            $("#nudgeModal div.modal-body >*").each(this.hideTab);
            this.showTab(n)
        },
        letsGo: function() {
            var n = $("#nudgeModal div.modal-body >*").find(":visible").index();
            n + 1 >= this.numberOfTabs ? $("#nudgeModal").modal("hide") : this.selectTab(n + 1)
        },
        dismissNudges: function() {
            $(".global-nudge-container input[type=checkbox][data-nudge-rule-id]:checked").each(function() {
                var n = "/api/proxy/postmembernudges"
                  , t = parseInt($(this).attr("data-nudge-rule-id"), 10);
                $.ajax({
                    url: n,
                    type: "POST",
                    data: JSON.stringify({
                        ruleID: t
                    }),
                    dataType: "json",
                    processData: !1,
                    xhrFields: {
                        withCredentials: !0
                    },
                    headers: {
                        "Content-Type": "application/json"
                    },
                    error: function(t, i, r) {
                        r ? console.error(r) : console.error("Failed to invoke member nudges URL at %s", n)
                    },
                    success: function(n) {
                        n.status && "success" !== n.status && (n.message ? console.error(n.message, n) : console.error(n))
                    }
                })
            })
        },
        "continue": function(n) {
            n.preventDefault();
            n = $("#nudgeModal div.modal-body > div:visible").index();
            n + 1 >= this.numberOfTabs ? $("#nudgeModal").modal("hide") : this.selectTab(n + 1)
        },
        closeModal: function(n) {
            n.preventDefault();
            $("#nudgeModal").modal("hide")
        },
        bindActions: function(n, t) {
            if (null == n || null == n.length || n.length < 1 || null == t)
                return !1;
            n.length && n.each(function() {
                $(this).on("click", t)
            })
        },
        pushTrackingData: function(n, t, i) {
            (null != n && void 0 !== n || null != t && void 0 !== t || null != i && void 0 !== i) && (window.dataLayer = window.dataLayer || [],
            dataLayer.push({
                event: n,
                modalId: t,
                modalName: i
            }))
        },
        refreshBackgroundImage: function() {
            var t, n;
            (this.hasBackgroundImage && this.getViewportSize() != this.viewportSize || !this.initialized) && (t = $("." + this.nudgeHeadClass),
            n = this,
            t.length && t.each(function() {
                var r, i, u = "", t = $(this).data("has-image");
                null == t || 1 != t && "true" != t || (r = "",
                null != (i = $(this).data("bg-image")) && "" != i && (r = i),
                t = "",
                null != (i = $(this).data("bg-image-mobile")) && "" != i && (t = i),
                u = r,
                n.viewportSize = n.getViewportSize(),
                "desktop" == n.viewportSize && "" != r ? u = r : "" != t && (u = t),
                $(this).css("background-image", "url(" + u + ")"),
                n.hasBackgroundImage = !0)
            }))
        },
        getViewportSize: function() {
            return 600 <= window.innerWidth ? "desktop" : "mobile"
        }
    },
    mounted: function() {
        var r, i, u, n, t;
        this.numberOfTabs = $("#nudgeModal div.modal-body >*").length;
        this.showTabSwitcher = 1 < this.numberOfTabs;
        this.numberOfTabs && (this.selectTab(0),
        r = $(".global-nudge-container a"),
        i = $("#nudgeModal"),
        (n = $("#letsgo")).length && (u = this.letsGo,
        n.each(function() {
            $(this).on("click", u)
        })),
        (n = $('[data-predefined-action="' + this.continueButtonType + '"]')).length && this.bindActions(n, this.continue),
        (n = $('[data-predefined-action="' + this.closeModalbuttonType + '"]')).length && this.bindActions(n, this.closeModal),
        this.refreshBackgroundImage(),
        (t = this).hasBackgroundImage && window.addEventListener("resize", function() {
            clearTimeout(t.refresh);
            t.refresh = setTimeout(t.refreshBackgroundImage, 300)
        }),
        r.on("click", this.dismissNudges),
        i.on("hidden.bs.modal", this.dismissNudges),
        i.modal({
            backdrop: "static",
            keyboard: !1
        }),
        this.initialized = !0)
    },
    destroyed: function() {
        var n;
        this.hasBackgroundImage && (n = this,
        window.removeEventListener("resize", function() {
            clearTimeout(n.refresh);
            n.refresh = setTimeout(n.refreshBackgroundImage, 100)
        }))
    }
});
Vue.component("global-popover", {
    template: '\n<a class="global-popover" \n   tabindex="0" \n   role="button"\n   ref="popoverRoot"\n   v-if="content"\n   data-analytics-click-action="tooltip_open"\n   :data-trigger="trigger"\n   :data-module="module"\n   :data-label="label"\n   :data-position="position">\n    <slot>\n        <svg class="global-popover-i" role="img" title="information">\n            <use xlink:href="/Assets/resources/images/icons/mol-sprite.svg#icn-info-inherit"><\/use>\n        <\/svg>\n    <\/slot>\n<\/a>\n    ',
    props: ["content", "trigger", "module", "label", "position"],
    mounted: function() {
        this.$refs.popoverRoot && $(this.$refs.popoverRoot).popover({
            container: "body",
            content: this.$props.content,
            placement: "auto",
            trigger: "focus",
            html: !0,
            delay: {
                show: 0,
                hide: 200
            }
        })
    }
});
Vue.component("global-session-expiry", {
    template: '\n<div v-on:click="extend" class="modal fade global-modal" id="sessionExpiry" tabindex="-1" role="dialog" aria-hidden="true" data-analytics-modal-id="sessionExpiry" data-analytics-module-type="modal" data-analytics-module-name="Your session is about to expire">\n    <div class="modal-dialog modal-dialog-centered" role="document">\n        <div class="modal-content expiry-content">\n            <div class="modal-body">\n                <h1 v-if="sitecore.header" v-html="sitecore.header"><\/h1>\n                <p v-if="sitecore.content" v-html="sitecore.content"><\/p>\n                <p v-if="sessionExpiresIn" v-html="sessionExpiresIn"><\/p>\n                <div class="actions">\n                    <a  v-on:click="extend" href="#keepalive" class="btn art yellow plain"\n                        data-trigger="gaModule"\n                        data-module="Session expiry"\n                        :data-label="sitecore.continueTitle"\n                        data-analytics-click-action="submit">\n                        {{sitecore.continueTitle}}\n                    <\/a>\n                    <a :href="sitecore.logoutUrl"\n                        data-trigger="gaModule"\n                        data-module="Session expiry"\n                        :data-label="sitecore.logoutTitle">\n                        {{sitecore.logoutTitle}}\n                    <\/a>\n                <\/div>\n            <\/div>\n            \n        <\/div>\n    <\/div>\n<\/div>\n    ',
    props: ["timeout", "sitecore"],
    data: function() {
        return {
            createdAt: moment(),
            showTimer: null,
            tickTimer: null,
            deadTimer: null,
            remaining: null
        }
    },
    computed: {
        expiresAt: function() {
            return moment(this.createdAt).add(this.timeout, "minutes")
        },
        showsAt: function() {
            return moment(this.expiresAt).add(-2, "minutes")
        },
        sessionExpiresIn: function() {
            return this.remaining ? this.sitecore.sessionExpiresFormat.format(moment.utc(this.remaining.asMilliseconds()).format("mm:ss")) : null
        }
    },
    methods: {
        show: function() {
            this.resetTimers();
            this.tick();
            this.tickTimer = setInterval(this.tick, 500);
            this.deadTimer = setInterval(this.dead, moment.duration(this.expiresAt.diff(moment())).asMilliseconds());
            $("#sessionExpiry").modal("show");
            window.dataLayer.push({
                event: "modal_open",
                modal_name: "Your session is about to expire",
                modal_id: "sessionExpiry"
            })
        },
        tick: function() {
            this.remaining = moment.duration(this.expiresAt.diff(moment()))
        },
        dead: function() {
            this.resetTimers();
            window.location.href = this.sitecore.logoutUrl
        },
        resetTimers: function() {
            this.showTimer && clearInterval(this.showTimer);
            this.tickTimer && clearInterval(this.tickTimer);
            this.deadTimer && clearInterval(this.deadTimer)
        },
        extend: function() {
            var n = this;
            window.dataLayer.push({
                event: "modal_close",
                modal_name: "Your session is about to expire",
                modal_id: "sessionExpiry"
            });
            $.ajax({
                url: "/api/keepsessionalive",
                type: "GET",
                processData: !1,
                xhrFields: {
                    withCredentials: !0
                },
                headers: {
                    "Content-Type": "application/json"
                },
                error: function(n, t, i) {
                    i ? console.error(i) : console.error("Failed to post data to %s", source)
                },
                success: function() {
                    n.resetTimers();
                    n.createdAt = moment();
                    $("#sessionExpiry").modal("hide")
                }
            })
        },
        close: function() {
            window.dataLayer.push({
                event: "modal_close",
                modal_name: "Your session is about to expire",
                modal_id: "sessionExpiry"
            })
        }
    },
    watch: {
        showsAt: {
            immediate: !0,
            handler: function(n) {
                this.showTimer && clearInterval(this.showTimer);
                this.showTimer = setInterval(this.show, moment.duration(n.diff(moment())).asMilliseconds())
            }
        }
    },
    beforeDestroy: function() {
        this.resetTimers()
    }
});
Vue.component("global-slide-container", {
    template: '\n<div class="global-slide-container">\n    <slot><\/slot>\n<\/div>\n    ',
    methods: {
        show: function(n, t) {
            var i;
            n ? (i = this.$root.$refs[n]) ? (i.setData(t),
            $(i.$el).modal("show")) : console.error("No slide found with referral: '".concat(n, "'")) : console.error("No slide is displayed as no referral was provided")
        }
    }
});
Vue.component("global-slide-link", {
    template: '\n<a href="#" v-on:click="openSlide"\n    :data-trigger="trigger"\n    :data-module="module"\n    :data-label="label"\n    :data-position="position">\n    <slot><\/slot>\n<\/a>\n    ',
    props: ["referral", "data", "trigger", "module", "label", "position"],
    methods: {
        openSlide: function() {
            this.$root.$refs.slides.show(this.referral, this.data)
        }
    }
});
Vue.component("global-slide", {
    template: '\n<div class="modal global-slide" :id="referral" tabindex="-1" role="dialog" aria-hidden="true">\n    <div class="modal-dialog" role="document">\n        <div class="modal-content">\n            <div class="modal-body">\n                <slot :data="content"><\/slot>\n            <\/div>\n            <div class="modal-close">\n                <slot name="close">\n                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">\n                        <div>\n                            <span aria-hidden="true">Close<\/span>\n                            <span aria-hidden="true">&times;<\/span>\n                        <\/div>\n                    <\/button>\n                <\/slot>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/div>\n    ',
    props: ["referral"],
    data: function() {
        return {
            content: null
        }
    },
    methods: {
        setData: function(n) {
            this.content = n
        }
    }
});
Vue.component("global-toolbar", {
    template: '\n<div class="global-toolbar d-print-none">\n    <a href="#" v-on:click="onPrint">{{sitecore.printText}}<\/a>\n    <a href="#" v-on:click="onHelp">{{sitecore.helpText}}<\/a>\n<\/div>\n    ',
    props: ["sitecore"],
    methods: {
        onPrint: function() {
            var n = $("#iframeurl");
            0 === n.length || "/your-account/transaction-history" == window.location.pathname ? window.print() : this.printIframe(n.val())
        },
        onHelp: function() {
            window.open(this.sitecore.helpUrl, "newwindow", "width=500,height=500")
        },
        printIframe: function(n) {
            var t = document.createElement("iframe");
            document.getElementsByTagName("body")[0].appendChild(t);
            t.style.width = "100%";
            t.style.height = "100%";
            t.style.display = "none";
            var i = $("#mvpframe")[0].style.height
              , i = (parseInt(i.replace("px", "")) + 850).toString() + "px"
              , t = t.contentWindow;
            t.document.open();
            t.document.write('<iframe src="' + n + '" onload="print();" frameborder="0" marginheight="0" marginwidth="0" style="position:relative; top:0; left:0; min-width: 100%; width: 1px; height:' + i + '; overflow: hidden;" scrolling="no" allowtransparency="false"><\/iframe>');
            t.document.close()
        }
    }
});
tracking = function(n) {
    n = n.dataset.analyticsGoal.split("|");
    $.ajax({
        type: "POST",
        url: "".concat(window.location.origin, "/api/triggergoals"),
        data: JSON.stringify({
            goalid: n
        }),
        contentType: "application/json;",
        processData: !1
    })
}
;
$(document).ready(function() {
    var n = $("div.trackable-tile");
    null != n && 0 < n.length && n.each(function() {
        PushTrackingData($(this).attr("data-analytics-trigger"), $(this).attr("data-analytics-tile-id"), $(this).attr("data-analytics-tile-name"))
    });
    n = document.querySelectorAll("[data-analytics-goal]");
    n.length && n.forEach(function(n) {
        n.addEventListener("click", function() {
            return tracking(n)
        })
    })
});
PushTrackingData = function(n, t, i) {
    (null != n && void 0 !== n || null != t && void 0 !== t || null != i && void 0 !== i) && (window.dataLayer = window.dataLayer || [],
    dataLayer.push({
        event: n,
        tileId: t,
        tileName: i
    }))
}
;
Vue.component("global-view-error", {
    template: "\n<span>An error has occurred<\/span>\n    "
});
Vue.component("global-view-loading", {
    template: "\n<span>Loading...<\/span>\n    "
}),
function(n) {
    "function" == typeof define && define.amd ? define(["jquery"], n) : n("object" == ("undefined" == typeof exports ? "undefined" : _typeof(exports)) ? require("jquery") : jQuery)
}(function(n) {
    var i, t = navigator.userAgent, u = /iphone/i.test(t), f = /chrome/i.test(t), r = /android/i.test(t);
    n.mask = {
        definitions: {
            9: "[0-9]",
            a: "[A-Za-z]",
            "*": "[A-Za-z0-9]",
            "+": "[0-9+]"
        },
        autoclear: !0,
        dataName: "rawMaskFn",
        placeholder: "_"
    };
    n.fn.extend({
        caret: function(n, t) {
            var i;
            if (0 !== this.length && !this.is(":hidden"))
                return "number" == typeof n ? (t = "number" == typeof t ? t : n,
                this.each(function() {
                    this.setSelectionRange ? this.setSelectionRange(n, t) : this.createTextRange && ((i = this.createTextRange()).collapse(!0),
                    i.moveEnd("character", t),
                    i.moveStart("character", n),
                    i.select())
                })) : (this[0].setSelectionRange ? (n = this[0].selectionStart,
                t = this[0].selectionEnd) : document.selection && document.selection.createRange && (i = document.selection.createRange(),
                n = 0 - i.duplicate().moveStart("character", -1e5),
                t = n + i.text.length),
                {
                    begin: n,
                    end: t
                })
        },
        unmask: function() {
            return this.trigger("unmask")
        },
        mask: function(t, e) {
            var l, o, c, h, a, s, y, v;
            return !t && 0 < this.length ? (v = n(this[0]).data(n.mask.dataName),
            v ? v() : void 0) : (e = n.extend({
                autoclear: n.mask.autoclear,
                placeholder: n.mask.placeholder,
                completed: null
            }, e),
            l = n.mask.definitions,
            o = [],
            c = s = t.length,
            h = null,
            n.each(t.split(""), function(n, t) {
                "?" == t ? (s--,
                c = n) : l[t] ? (o.push(new RegExp(l[t])),
                null === h && (h = o.length - 1),
                n < c && (a = o.length - 1)) : o.push(null)
            }),
            this.trigger("unmask").each(function() {
                function nt() {
                    if (e.completed) {
                        for (var n = h; n <= a; n++)
                            if (o[n] && p[n] === w(n))
                                return;
                        e.completed.call(v)
                    }
                }
                function w(n) {
                    return e.placeholder.charAt(n < e.placeholder.length ? n : 0)
                }
                function b(n) {
                    for (; ++n < s && !o[n]; )
                        ;
                    return n
                }
                function it(n, t) {
                    var r, i;
                    if (!(n < 0)) {
                        for (r = n,
                        i = b(t); r < s; r++)
                            if (o[r]) {
                                if (!(i < s && o[r].test(p[i])))
                                    break;
                                p[r] = p[i];
                                p[i] = w(i);
                                i = b(i)
                            }
                        d();
                        v.caret(Math.max(h, n))
                    }
                }
                function rt() {
                    k();
                    v.val() != tt && v.change()
                }
                function g(n, t) {
                    for (var i = n; i < t && i < s; i++)
                        o[i] && (p[i] = w(i))
                }
                function d() {
                    v.val(p.join(""))
                }
                function k(n) {
                    for (var f, r = v.val(), u = -1, t = 0, i = 0; t < s; t++)
                        if (o[t]) {
                            for (p[t] = w(t); i++ < r.length; )
                                if (f = r.charAt(i - 1),
                                o[t].test(f)) {
                                    p[t] = f;
                                    u = t;
                                    break
                                }
                            if (i > r.length) {
                                g(t + 1, s);
                                break
                            }
                        } else
                            p[t] === r.charAt(i) && i++,
                            t < c && (u = t);
                    return n ? d() : u + 1 < c ? e.autoclear || p.join("") === ut ? (v.val() && v.val(""),
                    g(0, s)) : d() : (d(),
                    v.val(v.val().substring(0, u + 1))),
                    c ? t : h
                }
                var v = n(this)
                  , p = n.map(t.split(""), function(n, t) {
                    if ("?" != n)
                        return l[n] ? w(t) : n
                })
                  , ut = p.join("")
                  , tt = v.val();
                v.data(n.mask.dataName, function() {
                    return n.map(p, function(n, t) {
                        return o[t] && n != w(t) ? n : null
                    }).join("")
                });
                v.one("unmask", function() {
                    v.unbind(".mask").removeData(n.mask.dataName)
                }).bind("focus.mask", function() {
                    var n;
                    v.attr("readonly") || (clearTimeout(i),
                    tt = v.val(),
                    n = k(),
                    i = setTimeout(function() {
                        d();
                        n == t.replace("?", "").length ? v.caret(0, n) : v.caret(n)
                    }, 10))
                }).bind("blur.mask", rt).bind("keydown.mask", function(n) {
                    var r, t, i;
                    console.log(v.attr("readonly"));
                    v.attr("readonly") || (i = n.which || n.keyCode,
                    y = v.val(),
                    8 === i || 46 === i || u && 127 === i ? (r = (t = v.caret()).begin,
                    (t = t.end) - r == 0 && (r = 46 !== i ? function(n) {
                        for (; 0 <= --n && !o[n]; )
                            ;
                        return n
                    }(r) : t = b(r - 1),
                    t = 46 === i ? b(t) : t),
                    g(r, t),
                    it(r, t - 1),
                    n.preventDefault()) : 13 === i ? rt.call(this, n) : 27 === i && (v.val(tt),
                    v.caret(0, k()),
                    n.preventDefault()))
                }).bind("keypress.mask", function(t) {
                    var u, e, h, f, i;
                    v.attr("readonly") || (f = t.which || t.keyCode,
                    i = v.caret(),
                    t.ctrlKey || t.altKey || t.metaKey || f < 32 || !f || 13 === f || (i.end - i.begin != 0 && (g(i.begin, i.end),
                    it(i.begin, i.end - 1)),
                    (u = b(i.begin - 1)) < s && (e = String.fromCharCode(f),
                    o[u].test(e)) && (function(n) {
                        for (var i, r, t = n, u = w(n); t < s; t++)
                            if (o[t]) {
                                if (i = b(t),
                                r = p[t],
                                p[t] = u,
                                !(i < s && o[i].test(r)))
                                    break;
                                u = r
                            }
                    }(u),
                    p[u] = e,
                    d(),
                    h = b(u),
                    r ? setTimeout(function() {
                        n.proxy(n.fn.caret, v, h)()
                    }, 0) : v.caret(h),
                    i.begin <= a && nt()),
                    t.preventDefault()))
                }).bind("input.mask paste.mask", function() {
                    v.attr("readonly") || setTimeout(function() {
                        var n = k(!0);
                        v.caret(n);
                        nt()
                    }, 0)
                });
                f && r && v.unbind("input.mask").bind("input.mask", function() {
                    var t = v.val()
                      , n = v.caret();
                    if (t.length < y.length) {
                        for (k(!0); 0 < n.begin && !o[n.begin - 1]; )
                            n.begin--;
                        if (0 === n.begin)
                            for (; n.begin < h && !o[n.begin]; )
                                n.begin++;
                        v.caret(n.begin, n.begin)
                    } else {
                        for (k(!0); n.begin < s && !o[n.begin]; )
                            n.begin++;
                        v.caret(n.begin, n.begin)
                    }
                    nt()
                });
                k()
            }))
        }
    })
});
$(document).ready(function() {
    var r, n, t, u, i = $("#appianFormContainer");
    !i.length || null !== (n = i.find("#appianFormIFrame")) && void 0 !== n && n.length || (i.append("<iframe id='appianFormIFrame' style='width: 100%; min-height: 800px;' frameborder='0' scrolling='0'><\/iframe>"),
    r = $("#appianFormIFrame"),
    n = 0 < (null === (n = localStorage) || void 0 === n || null === (t = n.lastAccountNumber) || void 0 === t ? void 0 : t.length) ? localStorage.lastAccountNumber : i.attr("recordIdentifier"),
    t = [i.attr("guid"), n],
    i.attr("recordIdentifier", n),
    t = btoa(t.join("|")),
    t = "/forms/appian-proxy?p=".concat(t),
    r.attr("src", t),
    window.onmessage = function(n) {
        "redirect" === n.data && (r.attr("src", "data:text/html;charset=utf-8,<html><h1>Redirecting...<\/h1><\/html>"),
        window.location = i.attr("submitRedirectUrl"))
    }
    ,
    u = 800,
    setInterval(function() {
        var n, t = $("#appianFormIFrame")[0];
        "complete" === t.contentWindow.document.readyState && (n = t.contentWindow.document.body.scrollHeight,
        u !== n && (t.style.height = n + "px",
        u = n))
    }, 2e3))
});
$(function(n) {
    function u() {
        t = new Date
    }
    function e(f) {
        var e;
        i || (i = !0,
        t = new Date,
        e = n.extend({
            keepAliveUrl: f.appianKeepAliveUrl,
            inactiveLimitInMinutes: 15
        }, f),
        r || (r = !0,
        window.addEventListener("keydown", u),
        window.addEventListener("click", u)),
        setTimeout(function() {
            !function r(u) {
                var f = new Date - t;
                Math.round(f % 864e5 % 36e5 / 6e4) > u.inactiveLimitInMinutes ? i = !1 : (console.log("Hitting keep alive."),
                n.ajax({
                    url: u.keepAliveUrl,
                    method: "GET"
                }),
                setTimeout(function() {
                    r(u)
                }, 6e4))
            }(e)
        }, 6e4))
    }
    var t, f = 0, i = !1, r = !1;
    n.fn.embedAppianForm = function(t) {
        var i = n.extend({
            isError: !1,
            actionType: "action"
        }, t);
        return e(i),
        t = "embeddedAppian" + f++,
        i.isError ? this.html("") : (i.actionType && "related-action" === i.actionType.toLowerCase() ? this.html("<appian-related-action id='" + t + "' processModelUuid='" + i.processModuleUuid + "' recordIdentifier='" + i.recordIdentifier + "' recordTypeUrlStub='CcF-Jw'><\/appian-related-action>") : i.actionType && "report" === i.actionType.toLowerCase() ? this.html("<appian-report id='" + t + "' reportUrlStub='" + i.processModuleUuid + "'><\/appian-report>") : this.html("<appian-action id='" + t + "' processModelUuid='" + i.processModuleUuid + "'><\/appian-action>"),
        n("#" + t).submit(function() {
            n(this).html("");
            window.location.href = i.submitRedirectUrl;
            window.top.postMessage("redirect", "*")
        }),
        n("#" + t).bind("DOMSubtreeModified", function() {
            n(this).find("button").click(function() {
                n(i.scrollTopElement.tagName).get(0).scrollIntoView({
                    behavior: "smooth",
                    block: "nearest"
                })
            })
        })),
        this.unbind("error"),
        this.on("error", function(t) {
            i.loggingUrl && n.ajax({
                url: i.loggingUrl,
                method: "POST",
                data: {
                    errorMessage: JSON.stringify(t.originalEvent.detail) + " , " + JSON.stringify(t.detail)
                }
            }).always(function() {
                window.top.location.replace(i.errorRedirectUrl)
            });
            n(this).embedAppianForm(n.extend(i, {
                isError: !0
            }))
        }),
        this
    }
}(jQuery));
Vue.component("concessional-contributions-data-content", {
    template: '\n<div class="concessional-contributions-data">\n    <table>\n        <thead>\n            <tr>\n                <td>{{sitecore.contributionType}}<\/td>\n                <td>{{sitecore.upToDate}} <global-popover v-if="sitecore.upToDateTooltip" :content="sitecore.upToDateTooltip" trigger="gaModule" module="Concessional contributions" :label="sitecore.upToDate"/><\/td>\n                <td class="amount">{{sitecore.amount}}<\/td>\n            <\/tr>\n        <\/thead>\n        <tbody>\n            <tr v-if="skeleton">\n                <td><span class="skeleton"/><\/td>\n                <td><span class="skeleton"/><\/td>\n                <td><span class="skeleton"/><\/td>\n            <\/tr>\n            <tr v-if="rows" v-for="row in rows">\n                <td>{{row.description}}<\/td>\n                <td>{{(row.informationAsAt ? formatDate(row.informationAsAt) : "")}}<\/td>\n                <td class="amount">{{formatAmount(row.amount)}}<\/td>\n            <\/tr>\n            <tr class="important">\n                <td>{{sitecore.totalConcessionalContributions}}<\/td>\n                <td><\/td>\n                <td class="amount"><span :class="{ \'skeleton\': skeleton }">{{total}}<\/span><\/td>\n            <\/tr>\n            <tr>\n                <td>{{sitecore.annualCap}} <global-popover v-if="sitecore.annualCapTooltip" :content="sitecore.annualCapTooltip" trigger="gaModule" module="Concessional contributions" :label="sitecore.annualCap"/><\/td>\n                <td><\/td>\n                <td class="amount"><span :class="{ \'skeleton\': skeleton }">{{cap}}<\/span><\/td>\n            <\/tr>\n            <tr class="important">\n                <td>{{sitecore.difference}}<\/td>\n                <td><\/td>\n                <td class="amount"><span :class="{ \'skeleton\': skeleton }">{{diff}}<\/span><\/td>\n            <\/tr>\n        <\/tbody>\n    <\/table>\n    <div v-if="exceedingCap" v-html="sitecore.exceedingCapText"><\/div>\n    <div v-if="exceededCap" v-html="sitecore.exceededCapText"><\/div>\n\n        <global-async-html-request url="/api/proxy/memberaccounts">\n            <concessional-contributions-data-notes :sitecore="sitecore"  slot-scope="slotProps" :data="slotProps.response" :hasNTC="hasAnnualNotionalTaxedContributions" :reviewedNTC="isNTCReviewed">\n            <\/concessional-contributions-data-notes>\n            <template v-slot:loading>\n            <\/template>\n            <template v-slot:error>\n            <\/template>\n        <\/global-async-html-request>\n\n    <\/div>\n    ',
    props: ["sitecore", "data", "skeleton"],
    computed: {
        rows: function() {
            if (this.data && this.data.contributions) {
                var n = this.sitecore.alwaysShowContributionTypes.split(",");
                return this.data.contributions.filter(function(t) {
                    return 0 < t.amount || n.includes(t.description)
                }).sort(function(n, t) {
                    return n.displayOrder - t.displayOrder
                })
            }
            return []
        },
        total: function() {
            return this.data ? this.formatAmount(this.data.totalAmount) : null
        },
        diff: function() {
            return this.data ? this.formatAmount(this.data.difference) : null
        },
        cap: function() {
            return this.data ? this.formatAmount(this.data.contributionCap) : null
        },
        exceedingCap: function() {
            return this.data && 0 < this.data.contributionCap && this.data.totalAmount >= .8 * this.data.contributionCap && this.data.totalAmount < this.data.contributionCap
        },
        exceededCap: function() {
            return this.data && 0 < this.data.contributionCap && this.data.totalAmount >= this.data.contributionCap
        },
        hasAnnualNotionalTaxedContributions: function() {
            var t = !1, n;
            if (this.data && this.data.contributions)
                for (n = 0; n < this.data.contributions.length; n++)
                    this.data.contributions[n].description.toLowerCase() === this.sitecore.notionalTaxedContributionLabel && (t = !0);
            return t
        },
        isNTCReviewed: function() {
            var t = !1, n;
            if (this.data && this.data.contributions)
                for (n = 0; n < this.data.contributions.length; n++)
                    this.data.contributions[n].description.toLowerCase() === this.sitecore.notionalTaxedContributionLabel && (t = this.data.contributions[n].reviewedNTC);
            return t
        }
    },
    methods: {
        formatAmount: function(n) {
            return null !== n ? MemberPortal.currencyFormat.format(n) : null
        },
        formatDate: function(n) {
            return null !== n ? moment(n, MemberPortal.apiDateFormat).locale("en-AU").format(MemberPortal.humanShortDateFormat) : null
        }
    }
});
Vue.component("concessional-contributions-data-notes", {
    template: '\n    <div>\n        <div class="concessional-contributions-notes" v-if="hasRBAccount" v-html="sitecore.rbSuperWithAnnualNotionalTaxedContributions">\n        <\/div>\n        <div class="generic-content-rich-text">\n            <div v-if="hasPensionAccount" v-html="sitecore.disclaimerWithPension"><\/div>\n            <div v-html="sitecore.disclaimerBody"><\/div>\n            <div v-show="hasNTC">\n                <div v-if="reviewedNTC" v-html="sitecore.disclaimerReviewedNTC"><\/div>\n                <div v-else v-html="sitecore.disclaimerProjectNTC"><\/div>\n            <\/div>\n            <div v-html="sitecore.disclaimerFooterPart"><\/div>\n        <\/div>\n<\/div>\n    ',
    props: ["sitecore", "data", "hasNTC", "reviewedNTC"],
    computed: {
        hasRBAccount: function() {
            if (this.data && this.data.accounts)
                for (var n = 0; n < this.data.accounts.length; n++)
                    if ("C59364" === this.data.accounts[n].productCode.toUpperCase())
                        return !0;
            return !1
        },
        hasPensionAccount: function() {
            if (this.data && this.data.accounts)
                for (var n = 0; n < this.data.accounts.length; n++)
                    if ("INC" === this.data.accounts[n].accountType)
                        return !0;
            return !1
        }
    },
    methods: {}
});
Vue.component("concessional-contributions-data", {
    template: '\n<div class="concessional-contributions-data">\n    <h2 v-if="sitecore.header">{{sitecore.header}}<\/h2>\n    <label for="finYearDropDown" class="dropdown" v-if="sitecore.selectFinancialYear">{{sitecore.selectFinancialYear}}<\/label>\n    <div id="finYearDropDown" class="dropdown">\n        <button type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\n            <span v-if="selected">{{selected.display}}<\/span>\n        <\/button>\n        <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">\n            <a class="dropdown-item" href="#" v-for="(period, index) in periods" v-on:click="select(period)"\n                data-trigger="gaModule"\n                data-module="Concessional contributions"\n                :data-label="period.display"\n                :data-position="index + 1">{{period.display}}<\/a>\n        <\/div>\n    <\/div>\n    <p class="table-legend" v-if="forThePeriod">{{forThePeriod}}<\/p>\n    <global-async-html-request v-if="url" :url="url">\n        <concessional-contributions-data-content slot-scope="slotProps" :sitecore="sitecore" :data="slotProps.response"><\/concessional-contributions-data-content>\n        <template v-slot:loading>\n            <concessional-contributions-data-content :sitecore="sitecore" :skeleton="true"><\/concessional-contributions-data-content>\n        <\/template>\n        <template v-slot:error>\n            <concessional-contributions-data-content :sitecore="sitecore" :skeleton="true"><\/concessional-contributions-data-content>\n        <\/template>\n    <\/global-async-html-request>\n<\/div>\n\n    ',
    props: ["sitecore"],
    data: function() {
        return {
            selected: null
        }
    },
    computed: {
        periods: function() {
            var n = moment()
              , t = moment([n.year(), 5, 30]);
            return t < n ? [{
                display: n.year() - 1 + " - " + n.year(),
                value: n.year() - 1 + "-" + n.year(),
                begin: moment([n.year() - 1, 6, 1]),
                end: t
            }, {
                display: n.year() + " - " + (n.year() + 1),
                value: n.year() + "-" + (n.year() + 1),
                begin: moment([n.year(), 6, 1]),
                end: moment([n.year() + 1, 5, 30])
            }] : [{
                display: n.year() - 2 + " - " + (n.year() - 1),
                value: n.year() - 2 + "-" + (n.year() - 1),
                begin: moment([n.year() - 2, 6, 1]),
                end: moment([n.year() - 1, 5, 30])
            }, {
                display: n.year() - 1 + " - " + n.year(),
                value: n.year() - 1 + "-" + n.year(),
                begin: moment([n.year() - 1, 6, 1]),
                end: moment([n.year(), 5, 30])
            }]
        },
        forThePeriod: function() {
            return this.sitecore.forThePeriodFormat && this.selected ? this.sitecore.forThePeriodFormat.format(this.selected.begin.locale("en-AU").format(MemberPortal.humanShortDateFormat), this.selected.end.locale("en-AU").format(MemberPortal.humanShortDateFormat)) : null
        },
        url: function() {
            return this.selected && this.selected.value ? "/api/proxy/memberconscontributions?financialYear=" + this.selected.value : null
        }
    },
    methods: {
        select: function(n) {
            this.selected = n
        }
    },
    mounted: function() {
        this.periods && this.periods.length && this.select(this.periods[this.periods.length - 1])
    }
});
InitPrintLink = function() {
    $("#aPrintLink").on("click", function() {
        window.print()
    })
}
;
InitHelpLink = function() {
    $("#aHelpLink").on("click", function() {
        var n = $("#aHelpLink").data("help-link");
        "undefined" !== n && 0 < n.length && window.open(n, "newwindow", "width=500,height=500")
    })
}
;
$(document).ready(function() {
    InitPrintLink();
    InitHelpLink()
});
Vue.component("dashboard-account", {
    template: '\n<div class="dashboard-account">\n    <hr />\n    <a :href="href" \n        data-trigger="gaModule" \n        data-module="Member account"\n        :data-label="accountName" >\n        <div :class="className">\n            <svg role="img" title="arrow" v-if="isLTPorDB">\n                <use xlink:href="/Assets/resources/images/icons/mol-sprite.svg#icn-wallet"><\/use>\n            <\/svg>\n        <\/div>\n        <span class="acctName" :class="{ \'skeleton\': skeleton }">{{accountName}}<\/span>\n        <span class="acctBal">\n            <span :class="{ \'skeleton\': skeleton }" v-if="skeleton || !hideBalance">{{accountBalance}}<\/span>\n            <svg role="img" title="arrow">\n                <use xlink:href="/Assets/resources/images/icons/sprite.svg#icn-chevron-down"><\/use>\n            <\/svg>\n        <\/span>\n    <\/a>\n<\/div>\n    ',
    props: ["data", "sitecore", "skeleton"],
    computed: {
        href: function() {
            if (this.data) {
                if (this.data.isDefinedBenefit || this.data.isReserveBankDefinedBenefit) {
                    if (this.sitecore.benefitEstimateUrl && 0 < this.sitecore.benefitEstimateUrl.length)
                        return this.sitecore.benefitEstimateUrl
                } else if (this.data.isLifeTimePension && 0 < this.data.accountName.toLowerCase().indexOf("rb super"))
                    return this.sitecore.lifeTimePensionUrl;
                return this.sitecore.isNewTransactionToggleEnabled && this.sitecore.isValidForNewTransactionHistoryPage ? this.sitecore.newTransactionHistoryUrl + "?a=" + this.data.accountNumber + "&p=" + this.data.productCode : this.sitecore.transactionHistoryUrl + "?a=" + this.data.accountNumber + "&p=" + this.data.productCode
            }
            return null
        },
        className: function() {
            return this.data ? this.isLTPorDB ? "ltp" : "dashboard-account-color-" + this.data.transparentIndex : "dashboard-account-color-0"
        },
        accountName: function() {
            return this.data ? this.data.accountName : null
        },
        accountBalance: function() {
            return this.data ? MemberPortal.currencyFormat.format(this.data.balanceAmount) : null
        },
        isNoBalance: function() {
            return this.data ? this.data.isNoBalance : null
        },
        isLTPorDB: function() {
            return !!this.data && (this.data.isLifeTimePension || this.data.isDefinedBenefit) && !this.data.isReserveBankDefinedBenefit
        },
        hideBalance: function() {
            return !!this.data && (this.data.isNoBalance || this.data.hideBalance || this.data.isLifeTimePension)
        }
    }
});
Vue.component("dashboard-accounts", {
    template: '\n<div class="dashboard-accounts-container" v-if="skeleton">\n    <section class="dashboard-box dashboard-accounts">\n        <p>\n            <span>\n                <svg role="img" title="arrow">\n                    <use xlink:href="/Assets/resources/images/icons/mol-sprite.svg#icn-profile-outline"><\/use>\n                <\/svg>\n            <\/span>\n            <span>{{sitecore.memberNumber}}<\/span>\n            <strong :class="{ \'skeleton-w-50\': skeleton }"><\/strong>\n            <span class="spacer"><\/span>\n            <span>\n                <span :class="{ \'skeleton-w-100\': skeleton }"><\/span>\n                <\/br>\n                <span :class="{ \'skeleton-w-100\': skeleton }"><\/span>\n            <\/span>\n        <\/p>\n        <dashboard-account :skeleton="skeleton"><\/dashboard-account>\n    <\/section>            \n<\/div>\n<div class="dashboard-accounts-container" v-else>\n    <section class="dashboard-box dashboard-accounts" v-for="(item, index) in data.memberNumbers" v-bind:key="item.memberNumber">\n        <p>\n            <span>\n                <svg role="img" title="arrow">\n                    <use xlink:href="/Assets/resources/images/icons/mol-sprite.svg#icn-profile-outline"><\/use>\n                <\/svg>\n            <\/span>\n            <span>{{sitecore.memberNumber}}<\/span>\n            <strong>{{item.memberNumber}}<\/strong>\n            <span class="spacer"><\/span>\n            <span class="mr-2" v-if="!isNoBalance(index)">{{balancesAsOf(index)}}<\/span>\n            <global-popover v-if="!isNoBalance(index)" :content="popOverBody(index)" trigger="gaModule" :label="popOverTitle(index)" />\n        <\/p>\n        <dashboard-account v-for="account in item.accountsSorted" v-bind:key="account.accountNumber + account.productCode" :sitecore="sitecore" :data="account"><\/dashboard-account>\n    <\/section>\n<\/div>\n\n    ',
    props: ["data", "sitecore", "skeleton"],
    methods: {
        isNoBalance: function(n) {
            return this.data && (n = this.data.memberNumbers[n],
            n) ? n.accounts.reduce(function(n, t) {
                return n && t.isNoBalance
            }, !0) : null
        },
        hasDBAccount: function(n) {
            return this.data && (n = this.data.memberNumbers[n],
            n) ? 0 < n.accounts.filter(function(n) {
                return !0 === n.isDefinedBenefit
            }).length : null
        },
        popOverTitle: function(n) {
            return this.hasDBAccount(n) ? this.sitecore.dbAccountPopoverTitle : this.sitecore.accountPopoverTitle
        },
        popOverBody: function(n) {
            if (this.data) {
                if (this.hasDBAccount(n))
                    return this.sitecore.dbAccountPopoverBody;
                var t = this.sitecore.accountPopoverBody
                  , i = this.data.memberNumbers[n].accounts[0].balanceDate
                  , n = MemberPortal.longDateFormat;
                return this.textUpdateWithDate(t, i, n)
            }
            return null
        },
        balancesAsOf: function(n) {
            if (this.data) {
                if (this.hasDBAccount(n))
                    return this.sitecore.dbAccountBalancesDateFormat;
                var t = this.sitecore.balancesDateFormat
                  , i = this.data.memberNumbers[n].accounts[0].balanceDate
                  , n = MemberPortal.regularDateFormat;
                return this.textUpdateWithDate(t, i, n)
            }
            return null
        },
        textUpdateWithDate: function(n, t, i) {
            if (n && t && i) {
                var r = i.resolvedOptions()
                  , u = new Intl.DateTimeFormat(r.locale,{
                    month: r.month
                })
                  , i = new Intl.DateTimeFormat(r.locale,{
                    year: r.year
                })
                  , r = new Intl.DateTimeFormat(r.locale,{
                    day: r.day
                })
                  , t = new Date(t)
                  , t = r.format(t) + " " + u.format(t) + " " + i.format(t);
                return n.format(t)
            }
            return null
        }
    },
    watch: {
        data: {
            immediate: !0,
            handler: function(n) {
                var t, u, i, r;
                if (n && n.memberNumbers) {
                    for (t = 0; t < n.memberNumbers.length; ++t)
                        n.memberNumbers[t].accountsSorted = this.data.memberNumbers[t].accounts.sort(function(n, t) {
                            return n.displayOrder - t.displayOrder
                        });
                    for (u = 0,
                    i = 0; i < n.memberNumbers.length; ++i)
                        for (r = 0; r < n.memberNumbers[i].accountsSorted.length; ++r)
                            n.memberNumbers[i].accountsSorted[r].transparentIndex = u++
                }
            }
        }
    }
});
window.addEventListener("load", function() {
    var n = document.getElementsByClassName("dashboard-ma-container");
    0 < n.length && dashboardActivationDataLayer(n)
});
Vue.component("dashboard-balances", {
    template: '\n<section class="dashboard-box dashboard-balances">\n    <h1 v-if="sitecore.balanceOverTimeHead">{{sitecore.balanceOverTimeHead}}<\/h1>\n    <p v-if="sitecore.balanceOverTimeDesc">{{sitecore.balanceOverTimeDesc}}<\/p>\n    <div class="chart-container">\n        <canvas id="balancesChart" ref="balancesChart"><\/canvas>\n    <\/div>\n    <a href="#" v-if="sitecore.howItIsCalculatedShort" \n        data-toggle="modal" \n        data-target="#howItIsCalculatedModal"\n        data-trigger="gaModule" \n        data-module="Balance over time"\n        data-label="Modal">\n        {{sitecore.howItIsCalculatedShort}}\n    <\/a>\n    <p class="remark" v-if="hasRemarkTwo">{{sitecore.areJustEstimatesShort}}<\/p>\n<\/section>\n    ',
    props: ["data", "sitecore", "skeleton"],
    data: function() {
        return {
            chart: null,
            modal: {
                referral: "howItIsCalculatedModal",
                hideHeader: !0,
                hideFooter: !0
            }
        }
    },
    computed: {
        balancesDates: function() {
            var t, f, i;
            if (this.data) {
                for (var r = [], u = this.data, n = 0; n < u.memberNumbers.length; ++n)
                    for (t = 0; t < u.memberNumbers[n].accounts.length; ++t)
                        for (f = u.memberNumbers[n].accounts[t],
                        i = 0; i < f.historicalBalances.length; ++i)
                            !function(n) {
                                var n = f.historicalBalances[n]
                                  , t = moment(n.balanceDate, MemberPortal.apiDateFormat).locale("en-AU");
                                t.isValid() && (r.some(function(n) {
                                    return t.isSame(n, "date")
                                }) || r.push(t))
                            }(i);
                return r
            }
            return null
        },
        balancesAsOf: function() {
            if (this.data && this.data.memberNumbers && this.data.memberNumbers[0].accounts) {
                var n = this.data.memberNumbers[0].accounts[0].balanceDate
                  , n = moment(n, MemberPortal.apiDateFormat).locale("en-AU");
                return n.isValid() ? n : null
            }
            return null
        },
        labels: function() {
            return this.balancesDates ? this.balancesAsOf ? this.balancesDates.concat(this.balancesAsOf) : this.balancesDates : this.balancesAsOf ? [this.balancesAsOf] : null
        },
        remarkOneIndex: function() {
            return this.labels && this.labels.length && this.balancesDates ? this.labels.length - 1 : null
        },
        remarkTwoIndex: function() {
            return this.balancesDates && this.balancesDates.length ? this.balancesDates.length - 1 : null
        },
        hasRemarkTwo: function() {
            if (null == this.remarkOneIndex || null == this.remarkTwoIndex)
                return !1;
            var n = this.labels[this.remarkOneIndex]
              , t = this.labels[this.remarkTwoIndex];
            return n.diff(t, "days") <= 30
        }
    },
    methods: {
        updateChart: function() {
            var f = this.$refs.balancesChart, e, i, n, r, u, l;
            if (f && (e = f.getContext("2d"),
            e && this.$props.data)) {
                for (var s = ["#0051FF", "#A1D0F9", "#F24E49", "#1C355E", "#D1F2FF", "#EECBBC", "#5386EF", "#19A5A4", "#095A6D", "#CA0813", "#AC7EF6", "#6F25FB"], o = this.$props.data, h = this.$props.sitecore, c = [], a = 0, t = 0; t < o.memberNumbers.length; ++t)
                    for (i = 0; i < o.memberNumbers[t].accounts.length; ++i)
                        if (n = o.memberNumbers[t].accounts[i],
                        !n.isLifeTimePension) {
                            for (r = [],
                            u = 0; u < n.historicalBalances.length; ++u)
                                l = n.historicalBalances[u],
                                r.push(l.balanceAmount);
                            r.push(n.balanceAmount);
                            c.push({
                                label: n.accountName,
                                data: r,
                                backgroundColor: s[a++ % s.length]
                            })
                        }
                var f = this.labels
                  , v = this.remarkOneIndex
                  , y = this.remarkTwoIndex
                  , p = this.hasRemarkTwo;
                this.chart = new Chart(e,{
                    type: "bar",
                    data: {
                        labels: f,
                        datasets: c
                    },
                    options: {
                        maintainAspectRatio: !1,
                        legend: {
                            display: !0,
                            fullWidth: !0,
                            labels: {
                                boxWidth: 5,
                                position: "top",
                                align: "left",
                                usePointStyle: !0,
                                fontColor: "#4B4C4D",
                                fontFamily: '"Noto Sans", sans-serif',
                                fontSize: 11
                            }
                        },
                        tooltips: {
                            enabled: !0,
                            callbacks: {
                                title: function() {},
                                label: function(n, t) {
                                    var i;
                                    return (i = t.datasets[n.datasetIndex].label || "") && (i += ": "),
                                    i + ("$" + Math.round(100 * n.yLabel) / 100)
                                }
                            }
                        },
                        hover: {
                            mode: null
                        },
                        scales: {
                            yAxes: [{
                                ticks: {
                                    callback: function(n) {
                                        return "$".concat(MemberPortal.balanceFormat.format(n / 1e3), "K")
                                    },
                                    autoSkip: !0,
                                    beginAtZero: !0,
                                    maxTicksLimit: 10,
                                    suggestedMax: 1e4,
                                    fontColor: "#4B4C4D",
                                    fontFamily: '"Noto Sans", sans-serif',
                                    fontSize: 11
                                },
                                stacked: !0
                            }],
                            xAxes: [{
                                ticks: {
                                    callback: function(n, t) {
                                        var i = n.format("DD MMM")
                                          , n = n.format("YYYY");
                                        return t === v ? n += h.howItIsCalculatedReference : t === y && p && (n += h.areJustEstimatesReference),
                                        [i, n]
                                    },
                                    fontColor: "#4B4C4D",
                                    fontFamily: '"Noto Sans", sans-serif',
                                    fontSize: 11
                                },
                                stacked: !0
                            }]
                        }
                    }
                })
            }
        }
    },
    mounted: function() {
        this.updateChart()
    },
    watch: {
        data: {
            immediate: !0,
            handler: function() {
                this.updateChart()
            }
        },
        sitecore: {
            immediate: !0,
            handler: function(n) {
                this.$root.$refs.modals.detach(this.modal);
                this.modal.body = n.howItIsCalculatedLong;
                this.$root.$refs.modals.attach(this.modal)
            }
        }
    }
});
Vue.component("dashboard-contributions", {
    template: '\n<section class="dashboard-box dashboard-contibutions">\n    <h1 v-if="totalBalanceValue && sitecore && sitecore.totalBalanceHead">{{sitecore.totalBalanceHead}}<\/h1>\n    <p v-if="totalBalanceValue && sitecore && sitecore.totalBalanceDesc">{{sitecore.totalBalanceDesc}}<\/p>\n    <p v-if="totalBalanceValue"><big id="total-balance-value">{{totalBalanceValue}}<\/big><\/p>\n\n    <section v-if="!hideTotalInvestment">\n    <h1 v-if="sitecore && sitecore.investmentEarningsHead">\n        {{sitecore.investmentEarningsHead}}\n        <global-popover v-if="sitecore.investmentEarningsTooltip" :content="sitecore.investmentEarningsTooltip" trigger="gaModule" :label="(\'Tooltip - \' + sitecore.investmentEarningsHead)" :module="sitecore.totalBalanceHead"/>\n    <\/h1>\n    <p v-if="investmentEarningsDesc">{{investmentEarningsDesc}}<\/p>\n    <p v-if="investmentEarningsValue || skeleton"><big id="investment-earnings-value" :class="{ \'skeleton\': skeleton }">{{investmentEarningsValue}}<\/big><\/p>\n    <\/section>\n\n    <section v-if="!hideConcessionalContribution" class="concessional">\n    <h1 v-if="sitecore && sitecore.concessionalContributionsHead">\n        {{sitecore.concessionalContributionsHead}}\n        <global-popover v-if="concessionalContributionsTooltip" :content="concessionalContributionsTooltip" trigger="gaModule" :label="(\'Tooltip - \' + sitecore.concessionalContributionsHead)" :module="sitecore.totalBalanceHead"/>\n    <\/h1>\n    <p v-if="concessionalContributionsDesc">{{concessionalContributionsDesc}}<\/p>\n    <p v-if="contributionsValue || skeleton">\n        <big id="contibutions-value" v-bind:class="{ \'almost-there\': isNearCap, \'too-much\': isOverCap, \'skeleton\': skeleton }">{{contributionsValue}}<\/big>\n        <span v-if="contributionCap">{{contributionCap}}<\/span>\n    <\/p>\n    <div v-if="contributionsValue" class="bar" v-bind:class="{ \'almost-there\': isNearCap, \'too-much\': isOverCap }">\n        <div :style="contributionBar"><\/div>\n    <\/div>\n    <\/section>\n\n    <div class="spacer"><\/div>\n    <p>{{sitecore.warning}}<\/p>\n<\/section>\n    ',
    props: ["data", "sitecore", "skeleton", "hideConcessionalContribution"],
    computed: {
        thisFinancialYearBeginYear: function() {
            var n = moment()
              , t = moment({
                year: n.year(),
                month: 5,
                days: 30
            });
            return 0 < n.diff(t, "days") ? n.year() : n.year() - 1
        },
        thisFinancialYearEndYear: function() {
            return this.thisFinancialYearBeginYear + 1
        },
        investmentEarningsDesc: function() {
            return this.data && this.sitecore.investmentEarningsDesc ? this.sitecore.investmentEarningsDesc.format(moment(this.data.investmentEarningsFromDate, "YYYY-MM-DD").format("MMM DD, YYYY"), moment(this.data.investmentEarningsToDate, "YYYY-MM-DD").format("MMM DD, YYYY")) : null
        },
        concessionalContributionsDesc: function() {
            return this.sitecore && this.sitecore.concessionalContributionsDesc ? this.sitecore.concessionalContributionsDesc.format(this.thisFinancialYearBeginYear, this.thisFinancialYearEndYear) : null
        },
        concessionalContributionsTooltip: function() {
            return this.data ? this.sitecore.concessionalContributionsTooltip.format("$".concat(MemberPortal.balanceFormat.format(this.data.contributionCap))) : null
        },
        totalBalanceValue: function() {
            var t;
            if (this.data && this.data.memberNumbers && this.data.memberNumbers.length) {
                for (var i = 0, r = 0, n = 0; n < this.data.memberNumbers.length; ++n)
                    for (t = 0; t < this.data.memberNumbers[n].accounts.length; ++t)
                        i += this.data.memberNumbers[n].accounts[t].balanceAmount,
                        ++r;
                if (1 < r)
                    return MemberPortal.currencyFormat.format(i)
            }
            return null
        },
        investmentEarningsValue: function() {
            return this.data ? MemberPortal.currencyFormat.format(this.data.investmentEarnings) : null
        },
        contributionsValue: function() {
            return !this.data || this.hideConcessionalContribution ? null : MemberPortal.currencyFormat.format(this.data.contributions)
        },
        contributionCap: function() {
            return this.data ? "$".concat(MemberPortal.balanceFormat.format(this.data.contributionCap / 1e3), "K") : null
        },
        contributionBar: function() {
            if (this.data && this.data.contributionCap) {
                var n = this.data.contributions / this.data.contributionCap;
                return 1 < n ? n = 1 : n < 0 && (n = 0),
                "width: ".concat(MemberPortal.percentFormat.format(n))
            }
            return null
        },
        isOverCap: function() {
            return !!this.data && this.data.contributions >= this.data.contributionCap
        },
        isNearCap: function() {
            return !(!this.data || this.data.isOverCap) && this.data.contributions > .8 * this.data.contributionCap
        },
        hasAccumAccount: function() {
            var n, t;
            if (this.data && this.data.memberNumbers)
                for (n = 0; n < this.data.memberNumbers.length; ++n)
                    for (t = 0; t < this.data.memberNumbers[n].accounts.length; ++t)
                        if ("SOL" == this.data.memberNumbers[n].accounts[t].productCode || !this.data.memberNumbers[n].accounts[t].isDefinedBenefit && !this.data.memberNumbers[n].accounts[t].isLifeTimePension && this.data.memberNumbers[n].accounts[t].productCode.startsWith("C"))
                            return !0;
            return !1
        },
        hideTotalInvestment: function() {
            var n = this.data && this.data.memberNumbers.map(function(n) {
                return n.accounts
            }).flat();
            return n && 0 < n.filter(function(n) {
                return n.isDefinedBenefit
            }).length
        }
    }
});
Vue.component("dashboard-error", {
    template: '\n<div class="dashboard-error" v-html="message"><\/div>\n',
    props: ["message"]
});
Vue.component("dashboard-experience-content", {
    template: '\n<div class="dashboard-experience-container" ref="dashboardTilesContainer">\n    <slot :data="data"><\/slot>\n<\/div>\n    ',
    props: ["sitecore", "data", "skeleton"],
    data: function() {
        return {
            numberOfTiles: 0
        }
    },
    methods: {},
    mounted: function() {}
});
Vue.component("dashboard-experience", {
    template: '\n<global-async-html-request url="/api/proxy/memberinvestment">\n    <dashboard-experience-content slot-scope="slotProps" :sitecore="sitecore" :data="slotProps.response">\n        <slot slot-scope="slotProps" :data="slotProps.data" :skeleton="false"><\/slot>\n    <\/dashboard-experience-content>\n    <template v-slot:loading>\n        <dashboard-experience-content :sitecore="sitecore" :skeleton="true">\n            <slot slot-scope="slotProps" :data="slotProps.data" :skeleton="true"><\/slot>\n        <\/dashboard-experience-content>\n    <\/template>\n    <template v-slot:error>\n        <dashboard-experience-content :sitecore="sitecore" :skeleton="true">\n            <slot slot-scope="slotProps" :data="slotProps.data" :skeleton="true"><\/slot>\n        <\/dashboard-experience-content>\n    <\/template>\n<\/global-async-html-request>\n    ',
    props: ["sitecore"]
});
Vue.component("dashboard-income-payments", {
    template: '\n<section class="dashboard-box dashboard-income-payments">\n    <h1 v-if="sitecore.head">{{sitecore.head}}<\/h1>\n    <p v-if="sitecore.desc">{{sitecore.desc}}<\/p>\n    <div class="figure" v-if="!skeleton">\n        <svg role="img" title="arrow">\n            <use xlink:href="/Assets/resources/images/icons/mol-sprite.svg#icn-wallet"><\/use>\n        <\/svg>\n    <\/div>\n    <div class="content" v-html="sitecore.content" v-if="sitecore.content"><\/div>\n    <hr />\n    <div>\n        <a :href="sitecore.detailsUrl" \n            class="more-link"\n            data-trigger="gaModule" \n            :data-module="sitecore.head"\n            :data-label="sitecore.detailsText">\n            <span class="icon">\n                <svg role="img" title="arrow">\n                    <use xlink:href="/Assets/resources/images/icons/sprite.svg#icn-arrow"><\/use>\n                <\/svg>\n            <\/span><span>{{sitecore.detailsText}}<\/span>\n        <\/a>\n    <\/div>\n<\/section>\n    ',
    props: ["data", "sitecore", "skeleton"]
});
Vue.component("dashboard-insurance-content", {
    template: '\n<section class="dashboard-box dashboard-insurance">\n    <h1 v-if="header || skeleton" :class="{ \'skeleton\': skeleton }">{{header}}<\/h1>\n    <div class="description" v-if="!skeleton">\n        <img v-if="sitecore.imageUrl" :src="sitecore.imageUrl" />\n        <p v-if="description" v-html="description"><\/p>\n    <\/div>\n    <div class="spacer"><\/div>\n    <div>\n        <hr/>\n        <a :href="linkUrl" class="more-link"\n            data-trigger="gaModule" \n            data-module="Insurance"\n            :data-label="linkText">\n            <span class="icon">\n                <svg role="img" title="arrow">\n                    <use xlink:href="/Assets/resources/images/icons/sprite.svg#icn-arrow"><\/use>\n                <\/svg>\n            <\/span><span :class="{ \'skeleton\': skeleton }">{{linkText}}<\/span>\n        <\/a>\n    <\/div>\n<\/section>\n    ',
    props: ["sitecore", "data", "skeleton"],
    computed: {
        hasInsurance: function() {
            if (this.data) {
                var n = jsonpath.query(this.data, "$..accountInsurances..insurancePolicy.policy");
                if (n)
                    return 0 < n.filter(function(n) {
                        return "ACT" === n.policyStatus
                    }).length
            }
            return !1
        },
        hasRecentlyJoined: function() {
            var t, n;
            return this.data && (n = jsonpath.query(this.data, "$..insuranceStartDate"),
            n) ? (t = Date.parse(n[0]),
            n = new Date,
            Math.round(Math.abs((n - t) / 864e5)) <= 120) : !1
        },
        header: function() {
            return this.hasRecentlyJoined ? this.sitecore.headerWelcome : this.hasInsurance ? this.sitecore.headerWithInsurance : this.data ? this.sitecore.headerWithoutInsurance : null
        },
        description: function() {
            return this.hasRecentlyJoined ? this.sitecore.descriptionWelcome : this.hasInsurance ? this.sitecore.hasInsuranceContent : this.data ? this.sitecore.noInsuranceContent : null
        },
        linkText: function() {
            return this.hasInsurance ? this.sitecore.reviewCoverageLinkText : this.data ? this.sitecore.reviewOptionsLinkText : null
        },
        linkUrl: function() {
            return this.hasInsurance ? this.sitecore.reviewCoverageLinkUrl : this.data ? this.sitecore.reviewOptionsLinkUrl : null
        }
    }
});
Vue.component("dashboard-insurance", {
    template: '\n<global-async-html-request url="/api/proxy/memberinsurance">\n    <div class="dashboard-insurance-container" slot-scope="slotProps">\n        <dashboard-insurance-content :sitecore="sitecore" :data="slotProps.response"><\/dashboard-insurance-content>\n    <\/div>\n    <template v-slot:loading>\n        <div class="dashboard-insurance-container">\n            <dashboard-insurance-content :sitecore="sitecore" :skeleton="true"><\/dashboard-insurance-content>\n        <\/div>\n    <\/template>\n    <template v-slot:error>\n        <div class="dashboard-insurance-container">\n            <section class="dashboard-box w-100">\n                <dashboard-error :message="sitecore.error"><\/dashboard-error>\n            <\/section>\n        <\/div>\n    <\/template>\n<\/global-async-html-request>\n',
    props: ["sitecore"]
});
Vue.component("dashboard-last-transaction", {
    template: '\n<div class="details" v-if="hasData || skeleton">\n    <div class="logo">\n        <svg role="img" title="arrow">\n            <use v-bind="{\'xlink:href\': transactionIcon}"><\/use>\n        <\/svg>\n    <\/div>\n    <div class="desc">\n        <p v-if="hasData || skeleton" :class="{ \'skeleton\': skeleton }">{{transactionDate}}<\/p>\n        <p><strong :class="{ \'skeleton-w-60\': skeleton }">{{transactionDesc}}<\/strong><\/p>\n        <p :class="{ \'skeleton-w-70\': skeleton }">{{transactionAccount}}<\/p>\n    <\/div>\n    <div class="amount" :class="{ \'positive\': isPositive, \'negative\': isNegative }">\n        <p :class="{ \'skeleton\': skeleton }" :style="skeleton ? \'--skeleton-width: 10rem\' : null">{{transactionAmount}}<\/p>\n    <\/div>\n<\/div>\n    ',
    props: ["data", "sitecore", "skeleton"],
    computed: {
        transactionDate: function() {
            if (this.data && this.data.transactionDate) {
                var n = moment(this.data.transactionDate, MemberPortal.apiDateFormat).locale("en-AU").format(MemberPortal.shortDateFormat);
                return this.sitecore.dateFormat ? this.sitecore.dateFormat.format(n) : n
            }
            return null
        },
        transactionDesc: function() {
            return this.data ? this.data.transactionDescription : null
        },
        transactionAccount: function() {
            if (this.data) {
                if (this.data.accountName && this.data.accountNumber)
                    return this.data.accountName + " - " + this.data.accountNumber;
                if (this.data.accountName)
                    return this.data.accountName;
                if (this.data.accountNumber)
                    return this.data.accountNumber
            }
            return null
        },
        transactionAmount: function() {
            return this.data ? this.data.transactionAmount < 0 ? MemberPortal.currencyFormat.format(-this.data.transactionAmount) : MemberPortal.currencyFormat.format(this.data.transactionAmount) : null
        },
        transactionIcon: function() {
            if (this.data)
                switch (this.data.transactionType) {
                case 38:
                    return '/Assets/resources/images/icons/mol-sprite.svg#icn-money-circle"';
                case 16:
                    return "/Assets/resources/images/icons/mol-sprite.svg#icn-wallet-circle";
                case 39:
                    return "/Assets/resources/images/icons/mol-sprite.svg#icn-retire-bonus-circle";
                case 43:
                    return "/Assets/resources/images/icons/mol-sprite.svg#icn-salary-sac-circle"
                }
            return "/Assets/resources/images/icons/mol-sprite.svg#icn-money-circle"
        },
        hasData: function() {
            return !!this.data
        },
        isNegative: function() {
            return !!(this.data && this.data.transactionAmount < 0)
        },
        isPositive: function() {
            return !!(this.data && 0 < this.data.transactionAmount)
        }
    }
});
Vue.component("dashboard-last-transactions", {
    template: '\n<section class="dashboard-box dashboard-last-transaction">\n    <div class="head">\n        <div>\n            <h1>{{sitecore.head}}<\/h1>\n        <\/div>\n        <a :href="sitecore.viewMoreUrl"\n            data-trigger="gaModule"\n            data-module="Last transactions"\n            data-label="View more">\n            <span>{{sitecore.viewMoreText}}<\/span>\n            <span class="icon">\n                <svg role="img" title="arrow">\n                    <use xlink:href="/Assets/resources/images/icons/sprite.svg#icn-chevron-down"><\/use>\n                <\/svg>\n            <\/span>\n        <\/a>\n    <\/div>\n    <hr />\n    <dashboard-last-transaction :data="transactionOne" :sitecore="sitecore" :skeleton="skeleton" v-if="transactionOne || skeleton" />\n    <dashboard-last-transaction :data="transactionTwo" :sitecore="sitecore" :skeleton="skeleton" v-if="transactionTwo" />\n    <p v-if="!hasData && !skeleton">{{sitecore.noData}}<\/p>\n<\/section>\n    ',
    props: ["data", "sitecore", "skeleton"],
    computed: {
        transactionOne: function() {
            return this.data && this.data.lastTransactions && 0 < this.data.lastTransactions.length ? this.data.lastTransactions[0] : null
        },
        transactionTwo: function() {
            return this.data && this.data.lastTransactions && 1 < this.data.lastTransactions.length ? this.data.lastTransactions[1] : null
        },
        hasData: function() {
            return !!(this.data && this.data.lastTransactions && this.data.lastTransactions.length)
        }
    },
    watch: {
        data: {
            immediate: !0,
            handler: function(n) {
                n && n.lastTransactions && n.lastTransactions.length && (n.lastTransactionsSorted = this.data.lastTransactions.sort(function(n, t) {
                    return n.transactionDate == t.transactionDate ? t.transactionAmount - n.transactionAmount : moment(t.transactionDate) - moment(n.transactionDate)
                }))
            }
        }
    }
});
$(document).ready(function() {
    var n;
    "true" === $("#login-success").val() && (n = null === (n = document.cookie.split("; ").find(function(n) {
        return n.startsWith("ahsid=")
    })) || void 0 === n ? void 0 : n.split("=")[1],
    void 0 !== window.dataLayer && window.dataLayer.push({
        event: "login",
        method: "password",
        user_id: n,
        process_name: "login",
        product: "Member Online",
        brand: "ART"
    }))
});
Vue.component("dashboard-messages-content", {
    template: '\n    <div class="dashboard-messages">\n        <a :href="sitecore.messagesUrl" class="icon"\n            data-trigger="gaModule"\n            data-module="Messages">\n            <svg role="img" title="messages">\n                <use xlink:href="/Assets/resources/images/icons/mol-sprite.svg#icn-mail"><\/use>\n            <\/svg>\n            <span class="count" v-if="count">{{count}}<\/span>\n        <\/a>\n    <\/div>\n    ',
    props: ["sitecore", "data", "skeleton"],
    computed: {
        count: function() {
            return this.data && this.data.count ? this.data.count : null
        }
    }
});
Vue.component("dashboard-messages", {
    template: '\n<global-async-html-request url="/api/proxy/membermessagescount">\n    <dashboard-messages-content slot-scope="slotProps" :sitecore="sitecore" :data="slotProps.response"><\/dashboard-messages-content>\n    <template v-slot:loading>\n        <dashboard-messages-content :sitecore="sitecore" :skeleton="true"><\/dashboard-messages-content>\n    <\/template>\n    <template v-slot:error>\n        <dashboard-messages-content :sitecore="sitecore" :skeleton="true"><\/dashboard-messages-content>\n    <\/template>\n<\/global-async-html-request>\n    ',
    props: ["sitecore"]
});
Vue.component("dashboard-profile-content", {
    template: '\n<section class="dashboard-box dashboard-profile">\n    <div class="head">\n        <h1>{{sitecore.sectionTitle}}<\/h1>\n        <p v-if="!isComplete && !skeleton">{{sitecore.sectionDescription}}<\/p>\n        <div class="profile-field" v-if="isComplete || skeleton">\n            <span class="field-value compact" :class="{ \'skeleton\': skeleton }">{{email}}<\/span>\n            <span class="field-status compact valid" v-if="!skeleton">Verified<\/span>\n            <span class="field-status skeleton-w-25" v-if="skeleton"><\/span>\n        <\/div>\n        <div class="profile-field" v-if="isComplete || skeleton">\n            <span class="field-value compact" :class="{ \'skeleton\': skeleton }">{{phone}}<\/span>\n            <span class="field-status compact valid" v-if="!skeleton">Verified<\/span>\n            <span class="field-status skeleton-w-25" v-if="skeleton"><\/span>\n        <\/div>\n    <\/div>\n    <div class="radial-progress" :data-progress="completionPercent" :class="{ \'skeleton\': skeleton }">\n        <div class="circle" v-if="!skeleton">\n            <div class="mask full">\n                <div class="fill" :class="{ \'complete\': isComplete }"><\/div>\n            <\/div>\n            <div class="mask half">\n                <div class="fill" :class="{ \'complete\': isComplete }"><\/div>\n                <div class="fill fix"><\/div>\n            <\/div>\n        <\/div>\n        <div class="inset" :class="{ \'complete\': isComplete }" v-if="!skeleton">\n            <div class="percentage">\n                <div class="numbers">\n                    <span id="profile-percentage-value" class="value" :class="{ \'compact\': isComplete }">{{completionPercent}}<i class="percent-sign">%<\/i><\/span>\n                    <span class="complete">complete<\/span>\n                <\/div>\n            <\/div>\n        <\/div>\n    <\/div>\n    <div class="profile-field" v-if="!isComplete && !skeleton">\n        <span class="field-label">{{sitecore.tfnLabel}}<\/span> \n        <span id="profile-tfn-supplied" class="field-status valid" v-if="isTFNSupplied">Supplied<\/span>\n        <span id="profile-tfn-notsupplied" class="field-status invalid" v-if="!isTFNSupplied">Not supplied<\/span>\n    <\/div>\n    <div class="profile-field" v-if="!isComplete && !skeleton">\n        <div>\n            <span class="field-label">{{sitecore.emailLabel}}<\/span> \n            <span id="profile-email-value" class="field-value lowercase">{{email}}<\/span>\n        <\/div>\n        <span id="profile-email-verified" class="field-status valid" v-if="isEmailVerified">Verified<\/span>\n        <span id="profile-email-notverified" class="field-status invalid" v-if="!isEmailVerified">Unverified<\/span>\n    <\/div>\n    <div class="profile-field" v-if="!isComplete && !skeleton">\n        <div>\n            <span class="field-label">{{sitecore.mobileLabel}}<\/span>\n            <span id="profile-phone-value" class="field-value lowercase">{{phone}}<\/span>\n        <\/div>\n        <span id="profile-phone-verified" class="field-status valid" v-if="isPhoneVerified && isPhoneSupplied">Verified<\/span>\n        <span id="profile-phone-notverified" class="field-status invalid" v-if="!isPhoneVerified && isPhoneSupplied">Unverified<\/span>\n        <span id="profile-phone-notverified" class="field-status invalid" v-if="!isPhoneSupplied">Not supplied<\/span>\n    <\/div>\n    <div class="profile-field" v-if="!isComplete && !skeleton">\n        <div>\n            <span class="field-label">{{sitecore.addressLabel}}<\/span>\n            <span id="profile-address" class="field-value">{{address}}<\/span>\n        <\/div>\n        <span id="profile-address-supplied"  class="valid field-status" v-if="isAddressSupplied && !isAddressInvalid">Supplied<\/span>\n        <span id="profile-address-supplied-invalid"  class="invalid field-status" v-if="isAddressSupplied && isAddressInvalid">Invalid<\/span>\n        <span id="profile-address-notsupplied" class="field-status invalid" v-if="!isAddressSupplied">Not supplied<\/span>\n    <\/div>\n    <hr/> \n    <div class="text-left">\n        <span class="icon">\n            <svg role="img" title="arrow">\n                <use xlink:href="/Assets/resources/images/icons/sprite.svg#icn-arrow"><\/use>\n            <\/svg>\n        <\/span>\n        <a :href="sitecore.profileLink.url" class="profile-link"\n            data-trigger="gaModule"\n            data-module="Profile"\n            :data-label="sitecore.profileLink.text">\n            {{sitecore.profileLink.text}}\n        <\/a>\n    <\/div>\n<\/section>\n    ',
    props: ["sitecore", "data", "skeleton"],
    computed: {
        email: function() {
            var n;
            return this.data && 0 < (n = jsonpath.query(this.data, '$.electronic[?(@.code=="EML")]')).length ? n[0].value : null
        },
        phone: function() {
            var n;
            return this.data && 0 < (n = jsonpath.query(this.data, '$.electronic[?(@.code=="MBL")]')).length ? n[0].value : null
        },
        address: function() {
            if (this.data) {
                var n, t = jsonpath.query(this.data, '$.physical[?(@.code=="POS" && @.status!=null)]');
                if (0 < t.length)
                    return [[((n = t[0]).addressLine1 || "").trim(), (n.addressLine2 || "").trim(), (n.addressLine3 || "").trim(), (n.addressLine4 || "").trim()].join(" ").trim(), [(n.suburb || "").trim(), (n.postcode || "").trim(), (n.state || "").trim()].join(" ").trim(), (n.country || "").trim()].filter(function(n) {
                        return n
                    }).join(", ").trim()
            }
            return null
        },
        completionPercent: function() {
            return this.data ? this.data.profilePercentageCompleted : null
        },
        isPhoneVerified: function() {
            if (this.data) {
                var n = jsonpath.query(this.data, '$.electronic[?(@.code=="MBL")]');
                return 0 < n.length ? n[0].isVerified : null
            }
            return null
        },
        isPhoneSupplied: function() {
            if (this.data) {
                var n = jsonpath.query(this.data, '$.electronic[?(@.code=="MBL")]');
                return 0 < n.length && null !== n[0].value
            }
            return !1
        },
        isEmailVerified: function() {
            if (this.data) {
                var n = jsonpath.query(this.data, '$.electronic[?(@.code=="EML")]');
                return 0 < n.length ? n[0].isVerified : null
            }
            return null
        },
        isAddressSupplied: function() {
            return this.data ? 0 < jsonpath.query(this.data, '$.physical[?(@.code=="POS" && @.status!=null)]').length : null
        },
        isAddressInvalid: function() {
            if (this.data) {
                var n = jsonpath.query(this.data, '$.physical[?(@.code=="POS" && @.status!=null)]');
                if (0 < n.length && "Invalid" === n[0].status)
                    return !0
            }
            return !1
        },
        isComplete: function() {
            return this.data && 100 <= this.data.profilePercentageCompleted
        },
        isTFNSupplied: function() {
            return !!this.data && this.data.isTFNOnRecord
        }
    }
});
Vue.component("dashboard-profile", {
    template: '\n<global-async-html-request url="/api/proxy/memberprofile">\n    <div class="dashboard-profile-container" slot-scope="slotProps">\n        <dashboard-profile-content :sitecore="sitecore" :data="slotProps.response"><\/dashboard-profile-content>\n    <\/div>\n    <template v-slot:loading>\n        <div class="dashboard-profile-container">\n            <dashboard-profile-content :sitecore="sitecore" :skeleton="true"><\/dashboard-profile-content>\n        <\/div>\n    <\/template>\n    <template v-slot:error>\n        <div class="dashboard-profile-container">\n            <section class="dashboard-box w-100">\n                <dashboard-error :message="sitecore.error"><\/dashboard-error>\n            <\/section>\n        <\/div>\n    <\/template>\n<\/global-async-html-request>\n',
    props: ["sitecore"]
});
Vue.component("dashboard-summary-content", {
    template: '\n<div class="dashboard-summary-container">\n    <div class="dashboard-essentials-container">\n        <dashboard-accounts :sitecore="sitecore.accounts" :data="data" :skeleton="skeleton"><\/dashboard-accounts>\n        <div class="dashboard-transaction-container">\n            <dashboard-last-transactions :sitecore="sitecore.lastTransaction" :data="data" :skeleton="skeleton"><\/dashboard-last-transactions>\n        <\/div>\n    <\/div>\n    <div class="dashboard-balance-container">\n        <dashboard-balances :sitecore="sitecore.balances" :data="data" :skeleton="skeleton"><\/dashboard-balances>\n    <\/div>\n    <div class="dashboard-contributions-container" v-if="!hideConcessionalConstTile">\n        <dashboard-contributions :sitecore="sitecore.contributions" :data="data" :skeleton="skeleton" :hideConcessionalContribution="sitecore.hideConcessionalContribution"><\/dashboard-contributions>\n    <\/div>\n    <div class="dashboard-income-container">\n        <dashboard-income-payments :sitecore="sitecore.incomePayments" :data="data" :skeleton="skeleton"><\/dashboard-income-payments>\n    <\/div>\n<\/div>\n',
    props: ["sitecore", "data", "skeleton"],
    computed: {
        hideConcessionalConstTile: function() {
            var n = this.data && this.data.memberNumbers.map(function(n) {
                return n.accounts
            }).flat()
              , t = n && n.length <= 1
              , n = n && 0 < n.filter(function(n) {
                return n.isDefinedBenefit
            }).length;
            return t && n && this.sitecore.hideConcessionalContribution
        }
    }
});
Vue.component("dashboard-summary", {
    template: '\n<global-async-html-request url="/api/proxy/memberdashboard">\n    <dashboard-summary-content slot-scope="slotProps" :sitecore="sitecore" :data="slotProps.response"><\/dashboard-summary-content>\n    <template v-slot:loading>\n        <dashboard-summary-content :sitecore="sitecore" :skeleton="true"><\/dashboard-summary-content>\n    <\/template>\n    <template v-slot:error>\n        <div class="dashboard-summary-container">\n            <div class="dashboard-essentials-container">\n                <section class="dashboard-box w-100">\n                    <dashboard-error :message="sitecore.errors.accounts"><\/dashboard-error>\n                <\/section>\n            <\/div>\n            <div class="dashboard-balance-container">\n                <section class="dashboard-box w-100">\n                    <dashboard-error :message="sitecore.errors.balances"><\/dashboard-error>\n                <\/section>\n            <\/div>\n            <div class="dashboard-contributions-container">\n                <section class="dashboard-box w-100">\n                    <dashboard-error :message="sitecore.errors.contributions"><\/dashboard-error>\n                <\/section>\n            <\/div>\n            <div class="dashboard-income-container">\n                <dashboard-income-payments :sitecore="sitecore.incomePayments" :skeleton="false"><\/dashboard-income-payments>\n            <\/div>\n        <\/div>\n    <\/template>\n<\/global-async-html-request>\n    ',
    props: ["sitecore"]
});
getInvestmentsOptionPageUrl = function(n, t) {
    return n.find(function(n) {
        return n.fundCode === t
    })
}
;
Vue.component("investment-returns-content", {
    template: '\n<div class="investment-returns-content" v-if="apiData">\n    <div v-if="account?.accountUnitHoldings.length > 0" class="account" v-for="account in rows" :key="account.accountNumber + account.productCode">\n        <h3 v-if="account.accountUnitHoldings.length">{{account.accountNumber}} - {{account.accountName}}<\/h3>\n        <p v-if="account.accountUnitHoldings.length">{{formatDescription(account.balanceAmount, account.accountUnitHoldings[0].unitPrice.unitPriceDate)}}<\/p>\n        <div class="table-responsive">\n            <table v-if="account.accountUnitHoldings.length" class="table table-borderless">\n                <thead>\n                    <tr class="table__labels">\n                        <th colspan="2"><\/th>\n                        <th class="table__labels--left" colspan="5">{{formatBalancesAt(returnsDate)}}<\/th>\n                        <th class="table__labels--right">{{formatFYTDBalancesAt(fytdReturnsDate)}}<\/th>\n                    <\/tr>\n                    <tr>\n                        <th scope="col">{{sitecore.InvestmentOption}}<\/th>\n                        <th scope="col">{{sitecore.Allocation}}<\/th>\n                        <th scope="col">10 years<\/th>\n                        <th scope="col">7 years<\/th>\n                        <th scope="col">5 years<\/th>\n                        <th scope="col">3 years<\/th>\n                        <th scope="col">1 year<\/th>\n                        <th scope="col">FYTD<\/th>\n                    <\/tr>\n                <\/thead>\n                <tbody>\n                    <template v-for="holding in account.accountUnitHoldings">\n                        <tr>\n                            <th scope="row">\n                                <a :href="formatUrl(holding)"\n                                    :target="targetType(holding)"\n                                    data-trigger="gaModule"\n                                    data-module="Investment returns"\n                                    :data-label="holding.investmentOptionDescription">\n                                    {{holding.investmentOptionDescription}}\n                                <\/a>\n                            <\/th>\n                            <td>{{formatAllocation(holding.investmentOptionPercentageOfTotal)}}<\/td>\n                            <td>{{getReturn(holding, \'10 years\')}}<\/td>\n                            <td>{{getReturn(holding, \'7 years\')}}<\/td>\n                            <td>{{getReturn(holding, \'5 years\')}}<\/td>\n                            <td>{{getReturn(holding, \'3 years\')}}<\/td>\n                            <td>{{getReturn(holding, \'1 year\')}}<\/td>\n                            <td>{{getReturn(holding, \'FYTD\')}}<\/td>\n                        <\/tr>\n                    <\/template>\n                <\/tbody>\n            <\/table>\n        <\/div>\n    <\/div>\n    <div class="ttr" v-if="isTTR && sitecore.TransitionToRetirementNote" v-html="sitecore.TransitionToRetirementNote"><\/div>\n<\/div>\n<div class="investment-returns-content failure" v-else-if="apiError">\n    <svg role="img" title="information">\n        <use xlink:href="/Assets/resources/images/icons/mol-sprite.svg#icn-info"><\/use>\n    <\/svg>\n    <div v-html="sitecore.Failure">\n    <\/div>\n<\/div>\n    ',
    props: ["sitecore"],
    data: function() {
        return {
            apiData: null,
            apiError: !1
        }
    },
    mounted: function() {
        var n = this;
        fetch("/api/proxy/memberinvestment").then(function(n) {
            return n.json()
        }).then(function(t) {
            return n.apiData = t
        }).catch(function(t) {
            console.log("Error: ".concat(t));
            n.apiError = !0
        })
    },
    watch: {
        data: function(n) {
            this.apiData = n
        }
    },
    computed: {
        isTTR: function() {
            return !!this.apiData && 0 < this.apiData.accounts.filter(function(n) {
                return "R00002" == n.productCode
            }).length
        },
        rows: function() {
            return this.apiData && this.apiData.accounts ? this.apiData.accounts.sort(function(n, t) {
                return n.displayOrder - t.displayOrder
            }) : []
        },
        hasReturns: function() {
            if (this.apiData && this.apiData.accounts && 0 < this.apiData.accounts.length) {
                var n = this.apiData.accounts;
                if (0 < n.length && n[0].accountUnitHoldings && 0 < n[0].accountUnitHoldings.length)
                    return null != n[0].accountUnitHoldings[0].returnsDate
            }
            return !1
        },
        returnsDate: function() {
            if (this.apiData && this.apiData.accounts && 0 < this.apiData.accounts.length) {
                var n = this.apiData.accounts;
                if (0 < n.length && n[0].accountUnitHoldings && 0 < n[0].accountUnitHoldings.length)
                    return n[0].accountUnitHoldings[0].returnsDate
            }
            return null
        },
        fytdReturnsDate: function() {
            if (this.apiData && this.apiData.accounts && 0 < this.apiData.accounts.length) {
                var n = this.apiData.accounts;
                if (0 < n.length && n[0].accountUnitHoldings && 0 < n[0].accountUnitHoldings.length)
                    return n[0].accountUnitHoldings[0].fytdAsAt
            }
            return null
        }
    },
    methods: {
        formatUrl: function(n) {
            var t, i, n = getInvestmentsOptionPageUrl(this.sitecore.InvestmentOptionFolder.Children, n.investmentOptionCode);
            return null != n && null !== (t = n.investmentOptionLink) && void 0 !== t && t.Url ? null == n || null === (i = n.investmentOptionLink) || void 0 === i ? void 0 : i.Url : "#"
        },
        targetType: function(n) {
            var t, i, n = getInvestmentsOptionPageUrl(this.sitecore.InvestmentOptionFolder.Children, n.investmentOptionCode);
            return null != n && null !== (t = n.investmentOptionLink) && void 0 !== t && t.Target ? null == n || null === (i = n.investmentOptionLink) || void 0 === i ? void 0 : i.Target : "_self"
        },
        formatBalancesAt: function(n) {
            return this.sitecore && this.sitecore.ReturnsAsAtFormat && n ? (n = moment(n, MemberPortal.apiDateFormat).locale("en-AU").format(MemberPortal.humanShortDateFormat),
            this.sitecore.ReturnsAsAtFormat.format(n)) : null
        },
        formatFYTDBalancesAt: function(n) {
            return this.sitecore && this.sitecore.FYTDReturnsAsAtFormat && n ? (n = moment(n, MemberPortal.apiDateFormat).locale("en-AU").format(MemberPortal.humanShortDateFormat),
            this.sitecore.FYTDReturnsAsAtFormat.format(n)) : null
        },
        formatDescription: function(n, t) {
            return this.sitecore && this.sitecore.HowYourBalanceWasInvestedFormat ? (n = MemberPortal.currencyFormat.format(n),
            t = moment(t, MemberPortal.apiDateFormat).locale("en-AU").format(MemberPortal.humanDateFormat),
            this.sitecore.HowYourBalanceWasInvestedFormat.format(n, t)) : null
        },
        formatAllocation: function(n) {
            return MemberPortal.allocationFormat.format(n)
        },
        getReturn: function(n, t) {
            return null == n.returns || 0 === n.returns.length ? "-" : (n = null === (n = n.returns.find(function(n) {
                return n.period.toUpperCase() === t.toUpperCase()
            })) || void 0 === n ? void 0 : n.return,
            null != n ? n + "%" : "-")
        }
    }
});
Vue.component("investment-returns-tile", {
    template: '\n<div :class="[\'tile trackable-tile investment-returns \'+ (sitecore.cssClass)]" :data-tile-name="sitecore.tileName" v-bind="trackingString">\n    <h1 v-if="header" v-html="header"><\/h1>\n    <p v-if="summary" v-html="summary"><\/p>\n    <h2 v-if="subHeader" v-html="subHeader"><\/h2>\n    <div v-if="!showNoReturnMessage">\n        <div class="returns" :class="{ \'skeleton-v2\': skeleton, \'max-w-225\': hasTwoItems }">\n            <div class="single-returns" v-for="item in selectedReturns" v-if="item !== null">\n                <span>{{item.return}}%<\/span>\n                {{item.period}}\n            <\/div>\n        <\/div>\n    <\/div>\n    <div v-if="showNoReturnMessage" v-html="noReturnDataMessage"><\/div>\n    <div class="more" v-if="subSummary" v-html="subSummary"><\/div>\n    <a :href="sitecore.link" v-if="!skeleton && sitecore.callToActionText" data-trigger="gaExperience" data-module="Investments" :data-label="sitecore.callToActionText">\n        <span class="link-position">\n            <span class="icon">\n                <svg role="img" title="arrow">\n                    <use xlink:href="/Assets/resources/images/icons/sprite.svg#icn-arrow"><\/use>\n                <\/svg>\n            <\/span><span>{{sitecore.callToActionText}}<\/span>\n        <\/span>\n    <\/a>\n<\/div>\n    ',
    props: ["data", "sitecore", "skeleton", "referral"],
    data: function() {
        return {
            selectedAccount: null,
            selectedSpread: null,
            selectedOption: null,
            selectedReturns: [],
            hasTwoItems: !1
        }
    },
    computed: {
        selectedPercentage: function() {
            return this.formatAllocation(this.selectedSpread)
        },
        header: function() {
            return this.sitecore && this.sitecore.header ? this.sitecore.header : null
        },
        summary: function() {
            if (this.sitecore && this.sitecore.summaryFormat && this.selectedOption) {
                var n = moment(this.selectedOption.returnsDate, "YYYY-MM-DD");
                return this.sitecore.summaryFormat.format(this.selectedAccount.accountNumber, this.selectedAccount.accountName, this.selectedPercentage, this.selectedOption.investmentOptionDescription, n.format("MMM DD, YYYY"))
            }
            return null
        },
        showNoReturnMessage: function() {
            return !this.selectedReturns.length && null != this.selectedOption
        },
        noReturnDataMessage: function() {
            return this.sitecore && this.sitecore.noReturnDataMessage && this.selectedOption ? this.sitecore.noReturnDataMessage.format(this.selectedOption.investmentOptionDescription) : null
        },
        subHeader: function() {
            if (this.sitecore && this.sitecore.subHeaderFormat && this.selectedOption) {
                var n = moment(this.selectedOption.returnsDate, "YYYY-MM-DD");
                return this.sitecore.subHeaderFormat.format(this.selectedOption.investmentOptionDescription, n.format("MMM DD, YYYY"))
            }
            return null
        },
        subSummary: function() {
            return this.sitecore && this.sitecore.subSummaryFormat ? this.sitecore.subSummaryFormat.format() : null
        },
        trackingString: function() {
            if (null != this.sitecore.trackingString && "" != this.sitecore.trackingString)
                return JSON.parse(this.sitecore.trackingString)
        }
    },
    methods: {
        formatAllocation: function(n) {
            return MemberPortal.percentFormat.format(n)
        },
        formatReturn: function(n) {
            return MemberPortal.returnFormat.format(n) + "%"
        }
    },
    watch: {
        data: {
            immediate: !0,
            handler: function(n) {
                var u, r, i, t;
                n && n.accounts && (this.selectedAccount = (i = n.accounts.filter(function(n) {
                    return n.isSelected
                })) && i.length ? i[0] : null,
                this.selectedAccount && this.selectedAccount.accountUnitHoldings ? (u = Math.max.apply(Math, this.selectedAccount.accountUnitHoldings.map(function(n) {
                    return n.investmentOptionPercentageOfTotal
                })),
                t = this.selectedAccount.accountUnitHoldings.find(function(n) {
                    return n.investmentOptionPercentageOfTotal === u
                }),
                this.selectedSpread = u,
                this.selectedOption = t) : (this.selectedSpread = null,
                this.selectedOption = null),
                this.selectedOption && this.selectedOption.returns && (r = this.selectedOption.returns.filter(function(n) {
                    return "10 years" == n.period
                }),
                this.selectedOption.returns.filter(function(n) {
                    return "7 years" == n.period
                }),
                n = this.selectedOption.returns.filter(function(n) {
                    return "5 years" == n.period
                }),
                i = this.selectedOption.returns.filter(function(n) {
                    return "3 years" == n.period
                }),
                t = this.selectedOption.returns.filter(function(n) {
                    return "1 year" == n.period
                }),
                t = [r.length && null != r[0].return ? r[0] : null, n.length && null != n[0].return ? n[0] : null, i.length && null != i[0].return ? i[0] : null, t.length && null != t[0].return ? t[0] : null],
                this.selectedReturns = t.filter(function(n) {
                    return null !== n
                }),
                this.hasTwoItems = 2 === this.selectedReturns.length))
            }
        }
    }
});
$(document).ready(function() {
    var n = (new DeviceUUID).parse();
    setDeviceLogCookie("hardwareID", (new DeviceUUID).get());
    setDeviceLogCookie("osVersion", n.os);
    setDeviceLogCookie("osType", n.platform);
    setDeviceLogCookie("deviceModel", n.source);
    setDeviceLogCookie("userAgent", n.source);
    setDeviceLogCookie("screenResolution", n.resolution)
});
$(document).ready(function() {
    $(".reward-area").on("click", function() {
        var t = null != $(".reward-code") ? $(".reward-code").text() : void 0
          , n = document.createElement("textarea");
        n.value = t;
        n.setAttribute("readonly", "");
        n.style.position = "absolute";
        n.style.left = "-9999px";
        document.body.appendChild(n);
        n.select();
        try {
            document.execCommand("copy")
        } catch (t) {}
        n.remove();
        $(".voucher-anim").css("display", "unset");
        $(".tooltiptext").css("opacity", 1);
        $(".tooltiptext>.copy-text").text("Copied to clipboard");
        setTimeout(function() {
            $(".tooltiptext").fadeOut("3000")
        }, 3e3)
    })
});
Vue.use(VeeValidate);
VeeValidate.Validator.extend("validEmail", {
    validate: function(n) {
        return {
            valid: 0 == n.length || /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(n).toLowerCase())
        }
    }
});
VeeValidate.Validator.extend("membernumberOrEmail", {
    validate: function(n) {
        return {
            valid: /^\d{0,9}$/.test(String(n).toLowerCase()) || /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(n).toLowerCase())
        }
    }
});
loginOnSubmit = function() {
    document.getElementById("login-form").submit()
}
;
Vue.prototype.validateLoginBeforeSubmit = function(n) {
    return n.preventDefault(),
    app.$validator.validateAll().then(function() {
        if (!app.errors.any()) {
            if (!(0 < $(".g-recaptcha").length))
                return console.log("Captcha disabled, submitting form"),
                document.getElementById("login-form").submit(),
                !0;
            $(".g-recaptcha-response").val() || (console.log("Validating captcha"),
            grecaptcha.execute())
        }
    }),
    !1
}
;
Vue.prototype.errorsByRule = function(n, t, i) {
    return 0 < n.items.filter(function(n) {
        return n.rule === t && n.field === i
    }).length
}
;
$(document).ready(function() {
    document.getElementById("login-form") && (localStorage.removeItem("lastAccountNumber"),
    localStorage.removeItem("lastProductCode"),
    localStorage.removeItem("lastSession"),
    void 0 !== window.dataLayer && ($(".alert.alert-danger").length && window.dataLayer.push({
        event: "login_failure",
        method: "password",
        reason: $(".alert.alert-danger p").text(),
        process_name: "login",
        product: "Member Online",
        brand: "ART"
    }),
    $("#btnLogin").on("click", function() {
        setTimeout(function() {
            $(".error").each(function() {
                var t = ((t = Number($("#login-form").find(".form-group").index($(this).parent()))) + 1).toString()
                  , r = $(this).parent().find("label").text()
                  , u = $(this).parent().find("input").attr("id")
                  , f = $(this).parent().find("input").val()
                  , n = null != (n = $(this).parent().find("input").attr("class")) ? n.toString() : ""
                  , i = "Value empty";
                0 < f.length && (i = "Value present");
                window.dataLayer.push({
                    event: "form_validation",
                    form_name: "Login",
                    form_id: "login-form",
                    form_step: "Member Online",
                    form_step_number: "1",
                    field_label: r,
                    field_type: "INPUT",
                    field_sequence_index: t,
                    element_id: u,
                    element_classes: n,
                    element_text: i,
                    platform: "sitecore",
                    process_name: "login",
                    product: "Member Online",
                    brand: "ART"
                })
            })
        }, 1e3)
    })))
});
document.addEventListener("DOMContentLoaded", function() {
    document.getElementById("logoutBtn").addEventListener("click", function() {
        localStorage.removeItem("lastAccountNumber");
        localStorage.removeItem("lastProductCode");
        localStorage.removeItem("lastSession")
    })
});
Vue.use(VeeValidate, {
    classes: !0,
    classNames: {
        valid: "is-valid",
        invalid: "is-invalid"
    }
});
Vue.prototype.validateTFNBeforeSubmit = function(n) {
    n.preventDefault();
    app.$validator.validateAll().then(function() {
        app.errors.any() ? console.log("Form doesn't validate. Can't submit.") : app.$refs.VerifyTFNForm.submit()
    })
}
;
Vue.prototype.validateIDDocumentCheckBeforeSubmit = function(n) {
    n.preventDefault();
    app.$validator.validateAll().then(function(n) {
        var f, e = 0 < app.$refs.IDDocumentCheckForm.querySelectorAll("div.doc-form.drivers-licence").length, h = 0 < app.$refs.IDDocumentCheckForm.querySelectorAll("div.doc-form.medicare-card").length, c = 0 < app.$refs.IDDocumentCheckForm.querySelectorAll("div.doc-form.passport").length, r = !1, u;
        if (e && (isEmpty(f = document.getElementById("PoiDrivingLicenceRules").value) || (t = getRulesJsonObjState(f),
        r = 1 === app.errors.items.length && "CardNumber" === app.errors.items[0].field && !t.IsLive)),
        !app.errors.any() || r) {
            var o, t = "", r = $("#statusPopUp"), s = new URLSearchParams, i = _createForOfIteratorHelper(new FormData(app.$refs.IDDocumentCheckForm));
            try {
                for (i.s(); !(o = i.n()).done; )
                    u = o.value,
                    s.append(u[0], u[1])
            } catch (n) {
                i.e(n)
            } finally {
                i.f()
            }
            e ? t = "/POIWizard/DriversLicense" : h ? t = "/POIWizard/MedicareCard" : c && (t = "/POIWizard/Passport");
            initPOIConfirmTimer();
            PushPOIFormSubmissionDataLayer("form_submit", getFormStep(), "2", null, "BUTTON", null, "btnSubmit", "btn btn-primary transition-all", "Confirm your identity", null, null, getFormStep().toLowerCase());
            clearPOIInteractionsCounter();
            "" !== t ? (r.modal({
                backdrop: "static",
                keyboard: !1
            }),
            PushPOIModalTracking("modal_open", "POI Confirming", "identity-check-loading"),
            fetch(t, {
                method: "POST",
                cache: "no-cache",
                body: s
            }).then(function(n) {
                return n.json().then(function(t) {
                    return {
                        status: n.status,
                        data: t
                    }
                })
            }).then(function(n) {
                var t = document.getElementById("identity-check-loading")
                  , u = document.getElementById("identity-check-success")
                  , r = document.getElementById("identity-check-unsuccessful")
                  , i = "POI failed attempt";
                !n.data.IsSuccessResult && n.data.IsRetryAllowed ? (t.classList.add("hidden"),
                r.classList.remove("hidden"),
                null != n.data.ErrorMessage && 0 < n.data.ErrorMessage.length && (i = n.data.ErrorMessage),
                PushPOIFormSubmissionDataLayer("form_failure", getFormStep(), "2", null, null, null, null, null, null, null, null, "", "Could not verify your identity with this ID"),
                PushPOIModalTracking("modal_open", "POI Unsuccessful", "identity-check-unsuccessful"),
                $("#statusPopUp").on("hide.bs.modal", function() {
                    PushPOIModalTracking("modal_close", "POI Unsuccessful", "identity-check-unsuccessful");
                    window.location.href = n.data.RedirectToPage
                })) : (n.data.IsSuccessResult || n.data.IsRetryAllowed) && 0 < n.data.RedirectToPage.length ? (t.classList.add("hidden"),
                u.classList.remove("hidden"),
                PushPOIModalTracking("modal_open", "POI Success", "identity-check-success"),
                $("#statusPopUp").on("hide.bs.modal", function() {
                    window.location.href = n.data.RedirectToPage
                })) : (t.classList.add("hidden"),
                r.classList.remove("hidden"),
                null != n.data.ErrorMessage && 0 < n.data.ErrorMessage.length && (i = n.data.ErrorMessage),
                PushPOIFormSubmissionDataLayer("form_failure", getFormStep(), "2", null, null, null, null, null, null, null, null, "", i),
                PushPOIModalTracking("modal_open", "POI Unsuccessful", "identity-check-unsuccessful"),
                $("#statusPopUp").on("hide.bs.modal", function() {
                    PushPOIModalTracking("modal_close", "POI Unsuccessful", "identity-check-unsuccessful");
                    window.location.href = n.data.RedirectToPage
                }))
            })) : console.log("Form doesn't exist. Can't submit.")
        } else
            console.log("Form doesn't validate. Can't submit.")
    }).catch(function(n) {
        return console.log(n)
    })
}
;
$(document).on("click", "#NoMiddleName", function() {
    var t, n = $(this).data("toggle-target");
    this.checked && (document.getElementById(n).value = "");
    $("#" + n).prop("disabled", this.checked);
    document.getElementById(n).classList.remove("is-invalid");
    this.checked || ((t = document.getElementById(n)).dispatchEvent(new Event("blur",{
        bubbles: !0
    })),
    t.classList.add("is-invalid"),
    app.$validator.reset(),
    $("#" + n).focus())
});
$(function() {
    var n = document.getElementById("StateOfIssue");
    n && (n = $(n).val(),
    $("<label id='CardNumberLabel' for='CardNumber' class='form-check-label'><\/label>").insertAfter("#form-group-card-number > label"),
    setCardNumber(n))
});
$(document).on("change", "#StateOfIssue", function() {
    var n, u, t, i, r;
    console.log("Handler for .change() called.");
    n = $(this).val();
    setCardNumber(n);
    i = $("#image-drivers-license");
    r = $("#image-drivers-license-back");
    "" === n ? (i.hide(),
    r.hide()) : (u = "/Assets/resources/images/drivers-licence-",
    t = "".concat(n, ".png"),
    n = "".concat(u).concat(t),
    i.attr("src", n),
    i.show(),
    t = "".concat(u, "back-").concat(t),
    r.attr("src", t),
    r.show())
});
$(document).on("focus", ".tfn-input", function() {
    $(".error-message-box").remove()
});
$(document).on("keyup", ".tfn-input", function() {
    3 !== $(this).val().length || $(this).hasClass("is-invalid") || $(this).next().focus()
});
var driversLicenceSubmitToggle = function() {
    if (0 !== document.getElementsByClassName("drivers-licence").length)
        try {
            var n, u = document.getElementById("btnSubmit"), f = document.getElementById("StateOfIssue"), t = document.getElementById("MiddleName"), e = document.getElementById("LicenceNumber"), o = document.getElementById("IdentityVerificationConsent"), s = document.getElementById("CardNumber"), h = 0 === document.getElementsByClassName("is-invalid").length, i = !0, r = document.getElementById("PoiDrivingLicenceRules").value;
            isEmpty(r) || (i = !(n = getRulesJsonObjState(r)).IsLive || !(!n.IsCardNumberMandatory || 0 === s.value.length));
            u.disabled = (t.disabled || 0 !== t.value.length) && 0 !== f.value.length && 0 !== e.value.length && o.checked && h && i ? !1 : !0
        } catch (n) {}
}
  , medicareSubmitToggle = function() {
    if (0 !== document.getElementsByClassName("medicare-card").length)
        try {
            var t = document.getElementById("btnSubmit")
              , i = 0 !== document.getElementById("MedicareCard").value.length
              , r = 0 !== document.getElementById("ReferenceNumber").value.length
              , n = document.getElementById("MiddleInitial")
              , u = 0 !== document.getElementById("MedicareValidTo").value.length
              , f = document.getElementById("IdentityVerificationConsent")
              , e = 0 === document.getElementsByClassName("is-invalid").length;
            t.disabled = (n.disabled || 0 !== n.value.length) && i && r && u && f.checked && e ? !1 : !0
        } catch (t) {}
}
  , passportSubmitToggle = function() {
    if (0 !== document.getElementsByClassName("passport").length)
        try {
            var i = document.getElementById("btnSubmit")
              , n = document.getElementById("MiddleName")
              , t = 0 !== document.getElementById("PassportNumber").value.length
              , r = document.getElementById("IdentityVerificationConsent")
              , u = 0 === document.getElementsByClassName("is-invalid").length;
            i.disabled = (n.disabled && t || 0 !== n.value.length && t) && r.checked && u ? !1 : !0
        } catch (i) {}
}
  , taxFileSubmitToggle = function() {
    if (0 !== document.getElementsByClassName("verify-tfn-form").length)
        try {
            var n = document.getElementById("btnVerifyTFN")
              , t = document.getElementById("TFN1").value.length
              , i = document.getElementById("TFN2").value.length
              , r = document.getElementById("TFN3").value.length
              , u = 0 === document.getElementsByClassName("is-invalid").length;
            n.disabled = 3 !== t || 3 !== i || 3 !== r || !u
        } catch (n) {}
}
  , medicareCardSelection = function(n) {
    var r = n.currentTarget.getElementsByTagName("input")[0]
      , i = r.value
      , u = document.getElementById("image-medicare-card")
      , f = "/Assets/resources/images/medicare-" + i.toLowerCase() + ".png"
      , t = r.dataset.dateformat
      , e = "dd/mm/yyyy" == t ? 0 : 2
      , o = "dd/mm/yyyy" == t ? 0 : "months"
      , s = "dd/mm/yyyy" == t ? "31/12/2040" : "12/2040"
      , n = document.getElementById("MedicareValidToPicker")
      , i = n.getElementsByTagName("input")[0];
    r.checked = !0;
    u.src = f;
    $(i).datepicker("clearDates");
    $(i).datepicker("destroy");
    i.placeholder = t;
    n.dataset.dateformat = t;
    n.dataset.startview = e;
    n.dataset.minviewmode = o;
    n.dataset.enddate = s;
    initDatePicker()
}
  , PushFormSubmissionToDataLayer = function(n, t, i, r) {
    r = {
        event: n,
        responseType: t,
        responseCode: i,
        responseMessage: null !== r && 0 < r.length ? r : ""
    };
    PushToDataLayer(r)
}
  , PushPOIFormSubmissionDataLayer = function(n, t, i, r, u, f, e, o, s, h, c, l, a) {
    "form_field_interaction" === n && incrementPOIInteractionsCounter();
    n = {
        event: n,
        form_name: "Proof of Identity",
        form_id: "ConfirmIdentityForm",
        form_step: t,
        form_step_number: i,
        field_label: r,
        field_type: u,
        field_sequence_index: f,
        element_id: e,
        element_classes: o,
        element_text: s,
        platform: "sitecore",
        process_name: "poi",
        product: "Member Online",
        brand: "ART",
        time_since_enter: timeElapsedSincePOIStart(),
        error_id: h,
        message: c,
        form_data_idtype: l,
        reason: a,
        total_interactions: "form_failure" === n ? null : getPOIInteractionsCounter(),
        form_response_duration: timeElapsedPOIConfirmed()
    };
    PushToDataLayer(n)
}
  , PushPOIModalTracking = function(n, t, i) {
    PushToDataLayer({
        event: n,
        modal_name: t,
        modal_id: i,
        product: "Member Online",
        brand: "ART"
    })
}
  , PushFormFieldValidationToDataLayer = function(n, t, i, r) {
    PushToDataLayer({
        event: n,
        fieldElement: t,
        validationStatus: i,
        validationMessage: r
    })
}
  , PushToDataLayer = function(n) {
    window.dataLayer = window.dataLayer || [];
    window.dataLayer.push(n)
}
  , closeBtnModal = function() {
    PushPOIModalTracking("modal_open", "POI close confirmation", "poi_close_modal");
    $("#closeSuperMatch").modal()
}
  , closeDiscardBtnModal = function() {
    clearPOIJourneyTimer();
    clearPOIInteractionsCounter();
    clearPOIConfirmTimer();
    PushPOIModalTracking("modal_success", "POI close confirmation", "poi_close_modal")
}
  , closeCancelBtnModal = function() {
    PushPOIModalTracking("modal_close", "POI close confirmation", "poi_close_modal")
};
$(document).ready(function() {
    initDatePicker();
    $("#calendar-icon").click(function() {
        $("#MedicareValidTo").datepicker("show")
    });
    driversLicenceSubmitToggle();
    medicareSubmitToggle();
    passportSubmitToggle();
    taxFileSubmitToggle();
    $("#ModalCloseDiscard").on("click", function() {
        closeDiscardBtnModal()
    });
    $("#ModalCancel").on("click", function() {
        closeCancelBtnModal()
    });
    $("#StateOfIssue, #MiddleName, #NoMiddleName, #LicenceNumber, #CardNumber, #IdentityVerificationConsent, #CardColour, #MedicareCard, #ReferenceNumber, #MiddleInitial, #MedicareValidTo, #PassportNumber").on("change", function(n) {
        var t = n.target.id;
        PushPOIFormSubmissionDataLayer("form_field_interaction", getFormStep(), "2", getInputFieldLabel(t), getInputFieldType(t), getInputFieldIndex(t), t, getInputFieldClasses(n), getInputFieldText(t))
    });
    $("#btnContinue").on("click", function(n) {
        var t = document.getElementById("btnContinue").classList.toString();
        PushPOIFormSubmissionDataLayer("form_start", "Confirm your Identity", "1", null, "BUTTON", null, n.target.id, t, "Continue")
    });
    $(".wizard #btnClose").on("click", function(n) {
        n.preventDefault();
        closeBtnModal()
    });
    $("#ConfirmIdentityForm").on("input", function() {
        window.setTimeout(function() {
            driversLicenceSubmitToggle();
            medicareSubmitToggle();
            passportSubmitToggle()
        }, 200)
    });
    $("#ConfirmIdentityForm input").on("blur", function(n) {
        n.currentTarget.classList.contains("is-invalid") && app.$validator.errors.items.forEach(function(t) {
            t.field === n.currentTarget.id && PushPOIFormSubmissionDataLayer("form_validation", getFormStep(), "2", getInputFieldLabel(t.field), getInputFieldType(t.field), getInputFieldIndex(t.field), t.field, getInputFieldClasses(n), getInputFieldText(t.field), t.msg, t.msg)
        })
    });
    $("#VerifyTFNForm").on("input", function() {
        taxFileSubmitToggle()
    });
    $("#VerifyTFNForm input").on("blur", function(n) {
        var t;
        n.currentTarget.classList.contains("is-invalid") ? (t = document.getElementsByClassName("invalid-feedback")[0].getElementsByTagName("div"),
        Array.prototype.forEach.call(t, function(n) {
            n.classList.add("d-none")
        }),
        app.$validator.errors.items.forEach(function(t) {
            t.field === n.currentTarget.id && PushFormFieldValidationToDataLayer("tfn.form.validation", n.currentTarget, "failed", t.msg)
        }),
        document.getElementsByClassName(n.currentTarget.id)[0].classList.remove("d-none"),
        taxFileSubmitToggle()) : PushFormFieldValidationToDataLayer("tfn.form.validation", n.currentTarget, "success", "")
    });
    0 < $("#VerifyTFNForm .error-message-box").length && PushFormSubmissionToDataLayer("tfn.api.response", "failed", "500", $("#VerifyTFNForm .error-message-box").children().last()[0].innerText);
    0 < $(".wizard-confirmation").length && 0 < document.referrer.lastIndexOf("tfn-") && PushFormSubmissionToDataLayer("tfn.api.response", "success", "200", "");
    document.querySelector(".wizard-confirmation") && (PushPOIFormSubmissionDataLayer("form_step_change", "Identity confirmed", "3"),
    PushPOIFormSubmissionDataLayer("form_complete", "Identity confirmed", "3"),
    clearPOIConfirmTimer());
    document.querySelector(".wizard-unconfirmed") && (clearPOIConfirmTimer(),
    PushPOIFormSubmissionDataLayer("form_step_change", "Identity unconfirmed", "99"),
    PushPOIFormSubmissionDataLayer("form_failure", "Identity unconfirmed", "99", null, null, null, null, null, null, null, null, null, "Retry's exceeded"));
    $("#MedicareValidToPicker").on("change", function() {
        medicareSubmitToggle()
    });
    $("#ConfirmIdentityForm .medicare-card-colour .form-radio").on("click", function(n) {
        medicareCardSelection(n)
    });
    document.getElementById("ConfirmIdentityForm") && document.getElementById("CardColour") && (document.getElementById("CardColour").checked = !0);
    $("#documentSelector .card").each(function() {
        var n = $(this).data("doc-form-target");
        $("#ConfirmIdentityForm");
        $(".doc-form." + n)
    });
    app.$validator.localize("en", {
        custom: {
            StateOfIssue: {
                required: "Please enter the State of issue"
            },
            MiddleName: {
                required: 'Please enter your middle name or select "I don\'t have a middle name"',
                regex: "Please enter a valid middle name"
            },
            LicenceNumber: {
                required: "Please enter your licence number",
                alpha_dash: "Your licence number may contain letters, numbers, dashes and underscores",
                min: "Your licence number may only contain 6 to 10 letters or numbers",
                max: "Your licence number may only contain 6 to 10 letters or numbers",
                regex: "Please enter a valid licence number"
            },
            MedicareCard: {
                required: "Please enter your medicare card number",
                digits: "Please enter your 10 digit medicare card number"
            },
            ReferenceNumber: {
                required: "Please enter your reference number",
                max: "Please enter your 1 digit reference number",
                regex: "Please enter a valid reference number"
            },
            MiddleInitial: {
                required: 'Please enter your middle initial or name or select "I don\'t have a middle name"',
                regex: "Please enter a valid middle initial or name"
            },
            PassportNumber: {
                required: "Please enter your passport number",
                alpha_num: "Your passport number may only contain 8 to 9 letters and numbers",
                min: "Your passport number may only contain 8 to 9 letters and numbers",
                max: "Your passport number may only contain 8 to 9 letters and numbers",
                regex: "Please enter a valid passport number"
            },
            TFN1: {
                regex: "Please enter a valid TFN"
            },
            TFN2: {
                regex: "Please enter a valid TFN"
            },
            TFN3: {
                regex: "Please enter a valid TFN"
            }
        }
    });
    $("#closeSuperMatch").on("hide.bs.modal", function() {
        PushPOIModalTracking("modal_close", "POI close confirmation", "poi_close_modal")
    });
    document.querySelector(".wizard.wizard-identity") && (initPOIJourneyTimer(),
    document.querySelector("#ConfirmIdentityForm > #documentSelector > .selector-item") ? PushPOIFormSubmissionDataLayer("form_step_change", getFormStep(), "2") : (clearPOIInteractionsCounter(),
    PushPOIFormSubmissionDataLayer("form_enter", "Confirm your identity", "1")))
});
Vue.use(VeeValidate);
Vue.prototype.validateSendOtpBeforeSubmit = function() {
    return app.$validator.validateAll().then(function() {
        app.errors.any() || app.$refs.sendOTPform.submit()
    }),
    !1
}
;
Vue.prototype.errorsByRule = function(n, t, i) {
    return 0 < n.items.filter(function(n) {
        return n.rule === t && n.field === i
    }).length
}
;
Vue.component("terms-and-conditions-accept", {
    template: '\n        <button \n            v-on:click="sendNudge($event)"\n            :title="sitecore.button.text" \n            class="btn art" \n            :class="{\'loading\':loading, \'orange-yoke\':!loading}"\n            :disabled="loading"\n            data-trigger="gaModule"\n            data-module="Terms and Conditions"\n            :data-label="sitecore.button.text">\n                {{sitecore.button.text}} \n                <span class="icon" v-if="!loading">\n                    <svg role="img" title="arrow">\n                        <use xlink:href="/Assets/resources/images/icons/sprite.svg#icn-arrow"><\/use>\n                    <\/svg>\n                <\/span>\n                <span class="icon" v-if="loading">\n                    <i aria-hidden="true"  class="fa fa-circle-o-notch fa-spin"><\/i>\n                <\/span>\n        <\/button>\n    ',
    props: ["sitecore", "loading"],
    methods: {
        sendNudge: function(n) {
            n.preventDefault();
            this.loading = !0;
            var t = "/nudge/SendNudges"
              , n = {
                NudgeRuleId: this.sitecore.nudgeRuleId,
                skipped: !1
            }
              , i = this.sitecore.returnUrl;
            $.ajax({
                url: t,
                type: "POST",
                data: JSON.stringify(n),
                dataType: "json",
                processData: !1,
                xhrFields: {
                    withCredentials: !0
                },
                headers: {
                    "Content-Type": "application/json"
                },
                error: function(n, i, r) {
                    this.loading = !1;
                    r ? console.error(r) : console.error("Failed to post data to %s", t)
                },
                success: function() {
                    this.loading = !1;
                    document.location.href = i
                }
            })
        }
    }
});
Vue.use(VeeValidate);
VeeValidate.Validator.extend("membernumber", {
    validate: function(n) {
        return {
            valid: /^\d{0,9}$/.test(String(n).toLowerCase())
        }
    }
});
showTrusteeSearchNotFoundError = !1;
VeeValidate.Validator.extend("membernumbernotfound", {
    validate: function() {
        return {
            valid: !1 === showTrusteeSearchNotFoundError
        }
    }
});
Vue.prototype.validateSearchBeforeSubmit = function(n) {
    return n.preventDefault(),
    showTrusteeSearchNotFoundError = !1,
    app.$validator.validateAll().then(function() {
        if (app.errors.any())
            return !0;
        var n = $("form#trustee-search-form")[0].action
          , t = $("form#trustee-search-form").serialize();
        return fetch(n, {
            method: "POST",
            cache: "no-cache",
            headers: {
                "content-type": "application/x-www-form-urlencoded"
            },
            body: t
        }).then(function(n) {
            n.ok || (window.location = "/maintenance/internalerror.html");
            n.json().then(function(n) {
                n.Success ? fetch(n.InitializeUrl, {
                    method: "GET",
                    cache: "no-cache",
                    credentials: "include"
                }).then(function(t) {
                    t.ok ? window.location = n.RedirectUrl : 404 === t.status ? (showTrusteeSearchNotFoundError = !0,
                    app.$validator.validateAll()) : window.location = "/maintenance/internalerror.html"
                }) : (showTrusteeSearchNotFoundError = !0,
                app.$validator.validateAll())
            })
        }),
        !0
    }),
    !1
}
;
Vue.prototype.errorsByRule = function(n, t, i) {
    return 0 < n.items.filter(function(n) {
        return n.rule === t && n.field === i
    }).length
}
;
$(document).ready(function() {
    $("#SearchText").on("click", function() {
        $("#SearchText").prop("placeholder", "")
    })
});
Vue.use(VeeValidate);
Vue.component("verify-email-content", {
    template: '\n  <div>\n    <form class="memberportal-form" id="verify-email-form">\n        <div class="form-group">\n            <label for="email">{{sitecore.dataSource.emailLabel}}<span class="unverified">{{sitecore.dataSource.unverifiedLabel}}<\/span><\/label>\n            <input id="email" name="email" v-model="sitecore.email" type="text" class="form-control" v-validate="\'required|email\'" v-bind:class="{ \'error\': errors.has(\'sitecore.email\') }" placeholder="Your email" maxlength="50" />\n            <span id="email-error" v-show="errors.has(\'email\')" class="error">A valid email address is required.<\/span>\n            <span id="send-error" v-if="sendError" class="error">{{sendError}}<\/span>\n            <span id="duplicate-email-error" v-if="duplicateEmail" class="error" v-html="duplicateEmailText"><\/span>\n        <\/div>\n        <a href="#0" :title="sitecore.primaryButton.text" class="btn art orange-yoke" v-on:click="sendCode"\n            data-trigger="gaModule"\n            data-module="Verify email"\n            :data-label="sitecore.primaryButton.text">\n                {{sitecore.primaryButton.text}} \n            <span class="icon">\n                <svg role="img" title="arrow">\n                    <use xlink:href="/Assets/resources/images/icons/sprite.svg#icn-arrow"><\/use>\n                <\/svg>\n            <\/span>\n        <\/a>\n        <div class="p-4" v-if="sitecore.allowSkip">\n            <a :href="sitecore.returnUrl" :title="sitecore.secondaryButton.text" v-on:click="updateNudge(true)"\n                data-trigger="gaModule"\n                data-module="Verify email"\n                :data-label="sitecore.secondaryButton.text">\n                {{sitecore.secondaryButton.text}} \n            <\/a>\n        <\/div>\n    <\/form>\n    <div class="modal" tabindex="-1" role="dialog" aria-hidden="true" id="veiftyDialog">\n                <div class="modal-dialog modal-dialog-centered" role="document">\n                    <div class="modal-content">\n                        <div class="modal-body">\n                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">\n                                <div>\n                                    <span aria-hidden="true">Close<\/span>\n                                    <span aria-hidden="true">&times;<\/span>\n                                <\/div>\n                            <\/button>\n                            <h1 class="form-line">{{sitecore.modalHeading}}<\/h1>\n                            <div class="form-line">{{sitecore.dataSource.modalIntroText}}<\/div>\n                            <h2 class="form-line">{{sitecore.email}}<\/h2>\n                            <div class="form-line">{{sitecore.dataSource.actionText}}<\/div>\n                            <form class="memberportal-form form-line">\n                                <div>\n                                 <input type="text" v-model="otp" id="otp" name="otp" maxlength="6" v-validate="\'required|numeric|length:6\'" >   <\/input>\n                                 <span id="otp-error" v-show="errors.has(\'otp\')" class="error">A 6 digit code is required.<\/span>\n                                 <span id="verify-error" v-if="verifyError" class="error">{{verifyError}}<\/span>\n                                <\/div>\n                                <a href="#0" :title="sitecore.dataSource.verifyLabel" class="btn art orange-yoke" v-on:click="verifyCode"\n                                    data-trigger="gaModule"\n                                    data-module="Verify email"\n                                    :data-label="sitecore.dataSource.verifyLabel">\n                                        {{sitecore.dataSource.verifyLabel}} \n                                    <span class="icon">\n                                        <svg role="img" title="arrow">\n                                            <use xlink:href="/Assets/resources/images/icons/sprite.svg#icn-arrow"><\/use>\n                                        <\/svg>\n                                    <\/span>\n                                <\/a>\n                            <\/form>\n                            <div class="form-line">\n                                <a href="#0" v-on:click="sendCode"\n                                    data-trigger="gaModule"\n                                    data-module="Verify email"\n                                    :data-label="sitecore.dataSource.reSendLabel">\n                                    {{sitecore.dataSource.reSendLabel}}\n                                <\/a>\n                            <\/div>\n                            <div class="footer-text" v-html="sitecore.dataSource.footerText"><\/div>\n                        <\/div>\n                    <\/div>\n                <\/div>\n            <\/div>\n    <\/div>\n    ',
    props: ["sitecore", "data", "profileData"],
    data: function() {
        return {
            otp: "",
            sendError: null,
            verifyError: null,
            duplicateEmail: !1
        }
    },
    computed: {
        profileEmail: function() {
            var n = jsonpath.query(this.profileData, '$.electronic[?(@.code=="EML")]');
            return 0 < n.length ? n[0].value : null
        },
        duplicateEmailText: function() {
            return this.sitecore.dataSource.duplicateEmail.format(this.sitecore.email)
        }
    },
    methods: {
        getContextCode: function() {
            return this.profileEmail !== this.sitecore.email ? "E53" : "E03"
        },
        sendCode: function() {
            this.duplicateEmail = !1;
            var t = {
                ElectronicAddress: this.sitecore.email,
                ContextCode: this.getContextCode(),
                VerificationMode: "Email"
            }
              , n = this;
            n.sendError = null;
            n.verifyError = null;
            n.$validator.validate("email").then(function() {
                var i;
                n.errors.any() || (i = "/Account/SendCode",
                $.ajax({
                    url: i,
                    type: "POST",
                    data: JSON.stringify(t),
                    dataType: "json",
                    processData: !1,
                    xhrFields: {
                        withCredentials: !0
                    },
                    headers: {
                        "Content-Type": "application/json"
                    },
                    error: function(n, t, r) {
                        r ? console.error(r) : console.error("Failed to post data to %s", i)
                    },
                    success: function(t) {
                        null != t && null != t.SendOneTimePinResponse && null != t.SendOneTimePinResponse.Code ? "E3002" !== t.SendOneTimePinResponse.Code ? n.sendError = "An error occurred. Please try again later." : n.duplicateEmail = !0 : ($(".blur-root").removeClass("blur-root"),
                        $("#veiftyDialog").modal("show"))
                    }
                }))
            })
        },
        verifyCode: function() {
            var t = {
                ContextCode: this.getContextCode(),
                VerificationCode: this.otp
            }
              , n = this;
            n.sendError = null;
            n.verifyError = null;
            n.$validator.validate("otp").then(function() {
                n.errors.any() || $.ajax({
                    url: "/Account/VerifyCode",
                    type: "POST",
                    data: JSON.stringify(t),
                    dataType: "json",
                    processData: !1,
                    xhrFields: {
                        withCredentials: !0
                    },
                    headers: {
                        "Content-Type": "application/json"
                    },
                    error: function(n, t, i) {
                        i ? console.error(i) : console.error("Failed to post data to %s", source)
                    },
                    success: function(t) {
                        null != t && null != t.ActionOneTimePinResponse && null != t.ActionOneTimePinResponse.Code ? n.verifyError = t.ActionOneTimePinResponse.Message : n.removeNudge()
                    }
                })
            })
        },
        updateNudge: function(n) {
            var n = {
                NudgeRuleId: this.sitecore.nudgeRuleId,
                skipped: n
            }
              , t = "/nudge/SendNudges"
              , i = this.sitecore.returnUrl;
            $.ajax({
                url: t,
                type: "POST",
                data: JSON.stringify(n),
                dataType: "json",
                processData: !1,
                xhrFields: {
                    withCredentials: !0
                },
                headers: {
                    "Content-Type": "application/json"
                },
                error: function(n, i, r) {
                    r ? console.error(r) : console.error("Failed to post data to %s", t)
                },
                success: function() {
                    document.location.href = i
                }
            })
        },
        removeNudge: function() {
            var t = {
                NudgeRuleId: this.sitecore.nudgeRuleId
            }
              , n = "/nudge/RemoveNudge"
              , i = this.sitecore.returnUrl;
            $.ajax({
                url: n,
                type: "POST",
                data: JSON.stringify(t),
                dataType: "json",
                processData: !1,
                xhrFields: {
                    withCredentials: !0
                },
                headers: {
                    "Content-Type": "application/json"
                },
                error: function(t, i, r) {
                    r ? console.error(r) : console.error("Failed to post data to %s", n)
                },
                success: function() {
                    document.location.href = i
                }
            })
        }
    },
    watch: {
        profileData: {
            immediate: !0,
            handler: function() {
                var n = jsonpath.query(this.profileData, '$.electronic[?(@.code=="EML")]');
                null != this.sitecore.email && "" !== this.sitecore.email || (this.sitecore.email = 0 < n.length ? n[0].value : null);
                null != n && 0 !== n.length && null != n[0].value && "" !== n[0].value || (this.sitecore.allowSkip = !1)
            }
        }
    }
});
Vue.component("verify-email", {
    template: '\n    <global-async-html-request url="/api/proxy/memberprofile">\n        <template v-slot:loading>\n                <div>Loading...\n                <\/div>\n        <\/template>\n        <verify-email-content slot-scope="slotProps" :sitecore="sitecore" :profileData="slotProps.response"><\/verify-email-content>\n    <\/global-async-html-request>\n    ',
    props: ["sitecore"]
});
String.prototype.format ? console.error("Unable to add C#-style format method - there is already a format method registered") : String.prototype.format = function() {
    var n = arguments;
    return this.replace(/{(\d+)}/g, function(t, i) {
        return void 0 !== n[i] ? n[i] : t
    })
}
;
MemberPortal = {
    currencyFormat: new Intl.NumberFormat("en-AU",{
        style: "currency",
        currency: "AUD",
        minimumFractionDigits: 2
    }),
    balanceFormat: new Intl.NumberFormat("en-AU",{
        style: "decimal",
        minimumFractionDigits: 0
    }),
    percentFormat: new Intl.NumberFormat("en-AU",{
        style: "percent",
        minimumFractionDigits: 0
    }),
    returnFormat: new Intl.NumberFormat("en-AU",{
        style: "decimal",
        minimumFractionDigits: 2
    }),
    allocationFormat: new Intl.NumberFormat("en-AU",{
        style: "percent",
        minimumFractionDigits: 2
    }),
    longDateFormat: new Intl.DateTimeFormat("en-AU",{
        month: "long",
        day: "numeric",
        year: "numeric"
    }),
    regularDateFormat: new Intl.DateTimeFormat("en-AU",{
        month: "short",
        day: "numeric",
        year: "numeric"
    }),
    humanShortDateFormat: "DD MMM YYYY",
    humanDateFormat: "DD MMMM YYYY",
    shortDateFormat: "DD/MM/YYYY",
    apiDateFormat: "YYYY-MM-DD"
};
document.getElementById("app") && (isProd = "member.secure.sunsuper.com.au" === location.host,
Vue.config.devtools = !isProd,
Vue.config.productionTip = !isProd,
Vue.config.silent = isProd,
app = new Vue({
    el: "#app"
}));
b = 3;
VeeValidateConfig = {
    classes: !0,
    classNames: {
        valid: "is-valid",
        invalid: "is-invalid"
    }
};
console.log("Configuring VeeValidate");
VeeValidate.configure(VeeValidateConfig);
$(document).on("click", "#dropdown-menu-accordion", function(n) {
    n.stopPropagation()
})

Popular Posts