/* Minification failed. Returning unminified contents.
(757,178864-178865): run-time error JS1010: Expected identifier: .
(757,178864-178865): run-time error JS1195: Expected expression: .
(757,178880-178884): run-time error JS1034: Unmatched 'else'; no 'if' defined: else
 */
"use strict";

AccessConsciousness.appModule.controller("createAccountController", [
    "$scope", "$rootScope", "createAccountService", "locationService", "$window", "reCaptchaService", "shopPdpConstants",

    function ($scope, $rootScope, createAccountService, locationService, $window, reCaptchaService, shopPdpConstants) {

        $scope.years = AccessConsciousness.getYearsForDropdown();
        $scope.days = AccessConsciousness.getDaysForDropdown();
        $scope.months = AccessConsciousness.getMonthsForDropdown();
        $scope.dataLoaded = false;
        $scope.response = null;
        $scope.customer = {};
        $scope.emailLocal = "";
        $scope.emailSuggestion = "";
        $scope.hasSuggestion = false;
        $scope.emailChanged = true;
        $scope.source = $("#accountCreationSource").val();
        if (sessionStorage.getItem("fromVideoBlock")) {
            $scope.customer.Email = sessionStorage.getItem("blockEmail");
            sessionStorage.removeItem("fromVideoBlock");
            sessionStorage.removeItem("blockEmail");
        }

        var emailInput = $('#email');

        $scope.correctEmail = function () {
            if ($scope.hasSuggestion) {
                $scope.customer.Email = `${$scope.emailLocal}@${$scope.emailSuggestion}`;
                $scope.emailSuggestion = "";
                $scope.emailLocal = "";
                $scope.hasSuggestion = false;
                $scope.emailChanged = true;
                sendVerificationRequest();
            }
        }

        $scope.loadStatesForCountry = function (countryId) {
            $scope.selectedState = undefined;
            if (countryId > 0) {
                locationService.getStatesForCountry(countryId).then(function (states) {
                    $scope.states = states;
                });
            } else {
                $scope.states = undefined;
            }
        };

        $scope.togglePassword = function () {
            $('#eyeIcon').toggleClass("glyphicon-eye-open glyphicon-eye-close");
            var input = $("#password");
            input.attr('type') === 'password' ? input.attr('type', 'text') : input.attr('type', 'password')
        }

        var sendVerificationRequest = function () {
            if ($scope.emailChanged) {
                createAccountService.verifyEmail($scope.customer.Email, $scope.source).then((data) => {
                    if (data.IsSuccess) {
                        $scope.customer.Validity = data.Validity;
                        $scope.emailSuggestion = data.SuggestionPart;
                        $scope.emailLocal = data.LocalPart;
                        $scope.hasSuggestion = !!$scope.emailSuggestion && !!$scope.emailLocal;
                        $scope.errorMessage = data.ErrorMessage
                    } else {
                        $scope.validity = "Invalid";
                    }
                });
                $scope.emailChanged = false;
            }
        }

        var isModelValid = function () {
            if (!$scope.customer.Password) $scope.customer.Password = undefined;

            if ($scope.customer.Password != undefined && $scope.customer.Password.length < 4 && $scope.customer.Password.length > 0) {
                $scope.errorMessage = passwordPatternErrorMessage;
                return false;
            }
            if ($scope.customer.Username != undefined && $scope.customer.Username.indexOf(",") !== -1) {
                $scope.errorMessage = usernamePatternErrorMessage;
                return false;
            }
            if ($scope.customer.Phone != undefined && $scope.customer.Phone.length < 7 && $scope.customer.Phone.length > 0) {
                $scope.errorMessage = phoneInvalidErrorMessage;
                return false;
            }
            if ($scope.hasConfirmPasswordField && $scope.customer.Password !== $scope.customer.ConfirmPassword) {
                $scope.errorMessage = passwordsDoNotMatchErrorMessage;
                return false;
            }

            return true;
        };

        var setScopeCustomerData = function () {
            $scope.isLoadingEnabled = true;
            $scope.customer.CountryId = $scope.selectedCountry.Id;
            $scope.customer.State = $scope.selectedState ? $scope.selectedState.Name : "";
            $scope.customer.AgreeToTermsDate = new Date();
            $scope.customer.ReceiveEmailsDate = new Date();

            if (!$scope.birthdate || !$scope.birthdate.Year || !$scope.birthdate.Month || !$scope.birthdate.Day) {
                $scope.customer.Birthdate = new Date(1990, 0, 1);
            } else {
                $scope.customer.Birthdate =
                    new Date($scope.birthdate.Year, $scope.birthdate.Month - 1, $scope.birthdate.Day);
            }
            $scope.errorMessage = "";
        };

        $scope.submit = function () {
            $scope.recaptcha = $window.grecaptcha;
            if (isModelValid()) {
                $scope.recaptcha.execute();
            }
        };

        $scope.validateResponse = function (response) {
            reCaptchaService.validateRecaptcha(response).then(function (response) {
                if (response.success) {
                    $scope.createAccount();
                } else {
                    $scope.errorMessage = "ReCaptcha not validated!";
                }
            });
        };

        $scope.createAccount = function () {
            $scope.hasConfirmPasswordField = false;
            $scope.ReturnUrl = "";
            if ($window.sessionStorage.getItem("isPdp") == "true")
                $scope.ReturnUrl = $window.sessionStorage.getItem("returnToRegistrationUrl");

            $window.sessionStorage.removeItem("isPdp");
            $window.sessionStorage.removeItem("returnToRegistrationUrl");

            var oldPhone = $scope.customer.Phone;
            setScopeCustomerData();
            createAccountService.createAccount($scope.customer).then(function (response) {
                if (!response.success) {
                    $scope.recaptcha.reset();
                    $scope.errorMessage = response.message;
                    if (usernameExistsErrorMessage === $scope.errorMessage)
                        $scope.accountExists = true; 
                    $scope.customer.Phone = oldPhone;
                } else {
                    $scope.customer.Phone = oldPhone;
                    $rootScope.isAuthenticated = true;
                    $rootScope.loggedInUserFirstName = $scope.customer.FirstName;
                    $rootScope.loggedInUserLastName = $scope.customer.LastName;

                    if (window.location.hash.includes(shopPdpConstants.SHOP_DIGITAL_DOWNLOADS_PDP_HASH_VALUE)
                        && (document.referrer.split('/')[2] === window.location.host)) {
                        window.location = document.referrer;
                    }

                    if ($scope.ReturnUrl != "") {
                        $window.location.href = $scope.ReturnUrl;
                    }

                    $scope.showSuccess = true;
                }
                $scope.isLoadingEnabled = false;
            });
        };

        $scope.createAccountFromRoster = function (occasionId) {
            $scope.hasConfirmPasswordField = true;
            if (isModelValid()) {
                $scope.customer.AgreeToTerms = true;
                $scope.customer.ReceiveEmails = true;
                setScopeCustomerData();
                $('#createAttendeeModal').data('bs.modal').options.backdrop = 'static';
                createAccountService.createAccountFromRoster($scope.customer, occasionId).then(function (response) {
                    if (!response.Response.Success) {
                        $scope.errorMessage = response.Response.Message;
                        $scope.isLoadingEnabled = false;
                    } else {
                        $scope.createNewAttendee.$setPristine();
                        $scope.$parent.classOccasionId = occasionId;
                        $scope.$parent.netSuiteClientId = response.NetSuiteId;
                        $scope.$parent.customerFullName = $scope.customer.FirstName + " " + $scope.customer.LastName;
                        $scope.$parent.addCustomerToRosterAfterCreate().then(function () {
                            $scope.birthdate = {};
                            $scope.selectedCountry = "";
                            $scope.selectedState = "";
                            $scope.customer = {};
                            $scope.isLoadingEnabled = false;
                        });
                    }
                    $('#createAttendeeModal').data('bs.modal').options.backdrop = true;
                });
            }
        };

        var loadCountries = function () {
            locationService.getCountries().then(function (countries) {
                $scope.dataLoaded = true;
                $scope.countries = countries;
            });
        };
        loadCountries();
        emailInput.on('blur', sendVerificationRequest);
    }
]);;
"use strict";

AccessConsciousness.appModule.factory("createAccountService", [
    "$http", "$q",
    function ($http, $q) {
        var createAccount = function (createAccountModel) {
            var deferred = $q.defer();
            $http.post("/CreateAccount/CreateAccount", {
                model: createAccountModel
            }).success(function (data) {
                deferred.resolve(data);
            });
            return deferred.promise;
        },
        createAccountFromRoster = function (createAccountModel, occasionId) {
            var deferred = $q.defer();
            $http.post("/ClassRoster/CreateNewCustomer", {
                createAccountViewModel: createAccountModel,
                occasionId: occasionId
            }).success(function (data) {
                deferred.resolve(data);
            });
            return deferred.promise;
        },
        verifyEmail = function (email, source) {
            var deferred = $q.defer();
            $http.post("/EmailVerification/SendEmailVerificationRequest", {
                email: email,
                source: source
            }).success(function (data) {
                deferred.resolve(data);
            });
            return deferred.promise;
        }
        return {
        	createAccount: createAccount,
            createAccountFromRoster: createAccountFromRoster,
            verifyEmail: verifyEmail
        };
    }
]);;
"use strict";
AccessConsciousness.appModule.controller("contactInfoController", [
    "$scope", "contactInfoService", "locationService", "$rootScope",
    function ($scope, contactInfoService, locationService, $rootScope) {
        $scope.dataLoaded = false;
        $scope.hasBilling = false;
        $scope.hasShipping = false;

        //load customer info & countries
        contactInfoService.getContactInfo().then(function (data) {
            $scope.contactInfo = data.contactInfo;
            for (var i = 0; i < $scope.contactInfo.Addresses.length; i++) {
                if ($scope.contactInfo.Addresses[i].IsBilling) {
                    $scope.hasBilling = true;
                }
                if ($scope.contactInfo.Addresses[i].IsShipping) {
                    $scope.hasShipping = true;
                }
            }

            locationService.getCountries().then(function (countries) {
                $scope.countries = countries;
                $scope.dataLoaded = true;
            });
        });

        $scope.changeContactInfo = function () {
            $scope.isLoadingEnabled = true;
            var contactToSend = angular.copy($scope.contactInfo);
            for (var i = 0; i < $scope.contactInfo.Addresses.length; i++) {
                if (!angular.isString($scope.contactInfo.Addresses[i].State)) {
                    contactToSend.Addresses[i].State = $scope.contactInfo.Addresses[i].State ? $scope.contactInfo.Addresses[i].State.Name : null;
                }

                if (contactToSend.Addresses[i].CountryId != 31) {
                    contactToSend.Addresses[i].CPFCode = null;
                }
            }

            $scope.errorMessage = "";
            contactInfoService.changeContactInfo(contactToSend).then(function (response) {
                if (!response.success) {
                    $scope.errorMessage = response.errorMessage;
                } else {
                    $scope.showSuccess = true;
                    $rootScope.loggedInUserFirstName = $scope.contactInfo.FirstName;
                    $rootScope.loggedInUserLastName = $scope.contactInfo.LastName;
                }
                $scope.isLoadingEnabled = false;
            });
        };

        $scope.addAddress = function (isBilling) {
            var address;
            if (isBilling) {
                $scope.hasBilling = true;
                address = { IsBilling: true };
            } else {
                $scope.hasShipping = true;
                address = { IsShipping: true };
            }

            $scope.contactInfo.Addresses.push(address);
        };
    }
]);;
AccessConsciousness.appModule.directive("contactInfoAddress", ["locationService", function (locationService) {
    return {
        restrict: "AE",
        transclude: true,
        scope: {
            address: "=",
            countries: "=",
            loaded: "=",
            isShipping: "="
        },
        templateUrl: "/SecureTemplateHelper/AddressInfoTemplate",
        controller: [
            "$scope", function ($scope) {
                var getCountryById = function (id) {
                    var countries = $scope.countries;
                    var i, len = countries.length;
                    for (i = 0; i < len; i++) {
                        if (countries[i].Id === id) {
                            return countries[i];
                        }
                    }

                    return null;
                };

                var getStateByName = function (name, states) {
                    if (states) {
                        var i, len = states.length;
                        for (i = 0; i < len; i++) {
                            if (states[i].Name === name) {
                                return states[i];
                            }
                        }
                    }

                    return null;
                };

                var timer = window.setInterval(function () {
                    if ($scope.loaded) {
                        $scope.selectedCountry = getCountryById($scope.address.CountryId);
                        $scope.loadStatesForCountry($scope.address.CountryId);
                        window.clearInterval(timer);
                    }
                }, 200);

                $scope.countryChanged = function (countryId) {
                    if (countryId > 0) {
                        locationService.getStatesForCountry(countryId).then(function (states) {
                            $scope.states = states;
                            $scope.address.State = undefined;
                            $scope.address.CountryId = countryId;
                        });
                    } else {
                        $scope.states = undefined;
                        $scope.address.State = undefined;
                    }
                };

                $scope.loadStatesForCountry = function (countryId) {
                    if (countryId > 0) {
                        locationService.getStatesForCountry(countryId).then(function (states) {
                            $scope.states = states;
                            var state = getStateByName($scope.address.State, $scope.states);
                            $scope.address.State = state === null ? $scope.address.State : state;
                        });
                    }
                };

                $scope.computeElementId = function (idPrefix) {
                    if ($scope.address.IsBilling)
                        return idPrefix + "-billing";
                    if ($scope.address.IsShipping)
                        return idPrefix + "-shipping";

                    return idPrefix + "-residential";
                };

                $scope.selectedCountryIsBrazil = function (isShippingAddress, selectedCountry) {
                    if (isShippingAddress && selectedCountry &&
                        (selectedCountry.Id == 31 || selectedCountry.Name === "Brazil")) {
                        return true;
                    }

                    return false;
                };
            }
        ]
    };
}]);;
AccessConsciousness.appModule.directive("phoneInput", [function () {
    return {
        restrict: "AE",
        transclude: true,
        scope: {
            phone: "=",
            countries: "=",
            loaded: "=",
            required: "=",
            disabled: "=",
            refreshValidations: "=?",
            displayIcon: "=?"
        },
        templateUrl: function (elem, attrs) { return (attrs.templateUrl && attrs.templateUrl.length > 0) ? attrs.templateUrl : "/SecureTemplateHelper/PhoneInputTemplate" },
        controller: [
            "$scope", "$rootScope", "$timeout", function ($scope, $rootScope, $timeout) {
                var buildDialingCodesFromCountries = function () {
                    var i;
                    $scope.dialingCodes = [];
                    for (i = 0; i < $scope.countries.length; i++) {
                        var country = $scope.countries[i];
                        if (country.DialingCode) {
                            $scope.dialingCodes.push({
                                dialingCode: country.DialingCode,
                                country: country.DisplayName
                            });
                        }
                    }
                }

                var findDialingCodeFromPhoneNumber = function (phone) {
                    var i, current;
                    if (phone) {
                        for (i = 0; i < $scope.dialingCodes.length; i++) {
                            current = $scope.dialingCodes[i];
                            if (phone.indexOf(current.dialingCode) === 0) {
                                $scope.phoneWithoutDialingCode = $scope.phone.replace(current.dialingCode, "");
                                $scope.selectDialingCode(current);
                                return;
                            }
                        }
                    }
                    $scope.dialingCode = null;
                    $scope.dialingCodeInput = "";
                    $scope.phoneWithoutDialingCode = phone || "";
                }

                var init = function () {
                    buildDialingCodesFromCountries();
                    findDialingCodeFromPhoneNumber($scope.phone);
                };

                $scope.createPhoneNumber = function () {
                    var codeFromInput = $scope.dialingCodes.find((code) => code.dialingCode === $scope.dialingCodeInput);

                    if (typeof codeFromInput !== "undefined") {
                        $scope.phone = codeFromInput.dialingCode + $scope.phoneWithoutDialingCode;

                        return;
                    }

                    $scope.dialingCode = null;
                }

                $scope.selectDialingCode = function (dialingCode) {
                    $scope.dialingCode = dialingCode;
                    $scope.dialingCodeInput = dialingCode.dialingCode;

                    if (typeof $scope.phoneWithoutDialingCode !== "undefined" && $scope.phoneWithoutDialingCode != null && $scope.phoneWithoutDialingCode != "") {
                        $scope.phone = $scope.dialingCode.dialingCode + $scope.phoneWithoutDialingCode;
                    }
                }

                $scope.updateDialingCodeInput = function () {
                    var codeFromInput = $scope.dialingCodes.find((code) => code.dialingCode === $scope.dialingCodeInput);

                    if (typeof codeFromInput !== "undefined") {
                        $scope.dialingCode = codeFromInput;
                        $scope.createPhoneNumber();

                        return;
                    }

                    $scope.dialingCode = null;
                }

                $scope.loadDialingCode = function (dialingCode) {
                    var i, current;
                    for (i = 0; i < $scope.dialingCodes.length; i++) {
                        current = $scope.dialingCodes[i];
                        if (current.dialingCode === dialingCode) {
                            $scope.dialingCode = current;
                            return;
                        }
                    }
                }

                $scope.updatePhone = function () {
                    findDialingCodeFromPhoneNumber($scope.phone);
                }

                $scope.refreshValidations = function () {
                    $scope.dialingCode = false;
                    $scope.phoneWithoutDialingCode = false;
                };

                var timer = window.setInterval(function () {
                    if ($scope.loaded) {
                        init();
                        window.clearInterval(timer);
                    }
                }, 200);

                var computeElementId = function () {
                    var text = "";
                    var characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

                    for (var i = 0; i < 10; i++)
                        text += characters.charAt(Math.floor(Math.random() * characters.length));

                    return "phone-" + text;
                }

                $scope.elementId = computeElementId();

                $rootScope.$on('phoneUpdated', function () {
                    $timeout(function () {
                        $scope.updatePhone();
                    }, 300);
                });
            }
        ]
    };
}]);;
AccessConsciousness.appModule.directive("classHistoryTable", ["upcomingClassesService", function (upcomingClassesService) {
    return {
        restrict: "AE",
        transclude: true,
        scope: {
            classes: "=",
            header: "=",
            hidecancel: "=",
            sort: "=",
            sortby: "=",
            descendingsort: "=",
            dosort: "="
        },
        templateUrl: "/SecureTemplateHelper/ClassHistoryTemplate",
        controller: [
            "$scope", function ($scope) {
                $scope.toggle = function (currentClass) {
                    currentClass.Show = !currentClass.Show;
                };

                $scope.cancelClass = function (currentClass, index) {
                    var deleteClassConfirmText = window.deleteClassConfirmText;
                    if (currentClass.IsPopHost) {
                        deleteClassConfirmText = window.deletePopClassConfirmText;
                    } else if (currentClass.HasPopAttendance) {
                        deleteClassConfirmText = window.joinUpdeleteClassWithPopConfirmText.replace("{0}", currentClass.PopHostName);
                    } else if (currentClass.IsPop) {
                        deleteClassConfirmText = window.joinUpDeletePopClassConfirmText;
                    }

                    document.getElementById("cancelModalBody").innerHTML = deleteClassConfirmText;
                    $("#cancelClassModal").modal('toggle');
                    $scope.selectedClass = currentClass;
                    $scope.selectedIndex = index;
                };

                $scope.$on('cancelClass', function () {
                    upcomingClassesService.cancelClass($scope.selectedClass).then(function (response) {
                        if (response.success) {
                            $scope.classes.splice($scope.selectedIndex, 1);
                            if ($scope.selectedClass.IsTeleSeries || !$scope.selectedClass.IsPop) {
                                var i = 0;
                                while (i < $scope.classes.length) {
                                    if ($scope.classes[i].SeminarAttendanceNo ===
                                        $scope.selectedClass.SeminarAttendanceNo) {
                                        $scope.classes.splice(i, 1);
                                    } else {
                                        i++;
                                    }
                                }
                            }
                        } else {
                            alert(response.message);
                        }
                    });
                })
            }
        ]
    };
}]);;
"use strict";

AccessConsciousness.appModule.factory("contactInfoService", [
    "$http", "$q",
    function ($http, $q) {
        var getContactInfo = function () {
            var deferred = $q.defer();
            $http.post("/ContactInfoBlock/GetContactInfo").success(function (data) {
                deferred.resolve(data);
            });
            return deferred.promise;
        };

        var changeContactInfo = function (contactInfoModel) {
            var deferred = $q.defer();
            $http.post("/ContactInfoBlock/UpdateContactInfo", {
                contactInfoViewModel: contactInfoModel
            }).success(function (data) {
                deferred.resolve(data);
            });
            return deferred.promise;
        };
        return {
            getContactInfo: getContactInfo,
            changeContactInfo: changeContactInfo
        };
    }
]);;
"use strict";

AccessConsciousness.appModule.controller("loginController", [
    "$scope", "$rootScope", "$window", "loginService", "$location", "shopPdpConstants",
    function ($scope, $rootScope, $window, loginService, $location, shopPdpConstants) {

        var initialization = function () {
            if ($location.search() != null && $location.search().login == "true") {
                $('#loginModal').modal();
            }
            $scope.loginModel = {};
        };
        initialization();

        $scope.clearFormData = function () {
            $scope.errorMessage = null;
            $scope.loginModel = null;
            $scope.loginForm.$setPristine();
            $window.sessionStorage.removeItem("isPdp");
            $window.sessionStorage.removeItem("returnToRegistrationUrl");
        };

        $scope.login = function () {
            $scope.isLoadingEnabled = true;
            $scope.errorMessage = "";

            if ($rootScope.isPdp && !$rootScope.isPop && !$rootScope.isOffSiteDetails)
                $scope.loginModel.ReturnUrl = $rootScope.checkoutUrl;
            else {
                if ($rootScope.loginRedirectUrl !== undefined && $rootScope.loginRedirectUrl !== "")
                    $scope.loginModel.ReturnUrl = $rootScope.loginRedirectUrl;
                else
                    $scope.loginModel.ReturnUrl = $location.search().ReturnUrl;
            }
                
            loginService.login($scope.loginModel).then(function (response) {
                if (!response.success) {
                    $scope.errorMessage = response.errorMessage;
                } else {
                    $rootScope.isAuthenticated = true;
                    if (response.redirectUrl != "") {
                        $window.location.href = response.redirectUrl;
                    } else {
                        $window.location.reload();
                    }
                }
                $scope.isLoadingEnabled = false;
            }, function (response) {
                $scope.isLoadingEnabled = false;
                $scope.errorMessage = response.errorMessage;
            });

        };

        $scope.logout = function () {
            var currentUrl = $window.location.href;
            loginService.logout(currentUrl).then(function (response) {
                $rootScope.isAuthenticated = false;
                sessionStorage.removeItem("isDPASigned");
                $window.location.href = response.redirectUrl;
            });
        };

        $scope.redirectToCreateAccountPage = function (url) {
            url += "#" + shopPdpConstants.SHOP_DIGITAL_DOWNLOADS_PDP_HASH_VALUE;

            window.location = url;
        };

        $scope.dismissModal = function () {
            $('#loginModal').modal('toggle');
        };
    }
]);;
"use strict";

AccessConsciousness.appModule.factory("loginService", [
    "$http", "$q",
    function($http, $q) {
        var login = function(loginModel) {
                var deferred = $q.defer();
                $http.post("/Login/Login", {
                    loginModel: loginModel
                }).success(function(data) {
                    deferred.resolve(data);
                }).error(function (data) {
                    deferred.reject(data);
                });
                return deferred.promise;
            },
            logout = function (currentUrl) {
                var deferred = $q.defer();
                $http.post("/Login/Logout", { currentUrl: currentUrl})
                    .success(function (data) {
                    deferred.resolve(data);
                });
                return deferred.promise;
            },
            isUserAuthenticated = function() {
                var deferred = $q.defer();
                $http.post("/Login/IsUserAuthenticated")
                    .success(function(data) {
                        deferred.resolve(data);
                    });
                return deferred.promise;
            };
        return {
            login: login,
            logout: logout,
            isUserAuthenticated: isUserAuthenticated
        };
    }
]);;
"use strict";

AccessConsciousness.appModule.factory("currencyService", [
    "$http", "$q",
    function ($http, $q) {
    	var getCurrencies = function () {
    		var deferred = $q.defer();
    		$http.post("/Currency/GetCurrencies")
			    .success(function (response) {
			    	deferred.resolve(response.currencies);
			    });
    		return deferred.promise;
    	};
    	return {
    		getCurrencies: getCurrencies
    	};
    }
]);;
!function (A, e) { "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (A = A || self).html2canvas = e() }(this, function () { "use strict"; var A = function (e, t) { return (A = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (A, e) { A.__proto__ = e } || function (A, e) { for (var t in e) e.hasOwnProperty(t) && (A[t] = e[t]) })(e, t) }; function e(e, t) { function r() { this.constructor = e } A(e, t), e.prototype = null === t ? Object.create(t) : (r.prototype = t.prototype, new r) } var t = function () { return (t = Object.assign || function (A) { for (var e, t = 1, r = arguments.length; t < r; t++)for (var n in e = arguments[t]) Object.prototype.hasOwnProperty.call(e, n) && (A[n] = e[n]); return A }).apply(this, arguments) }; function r(A, e, t, r) { return new (t || (t = Promise))(function (n, B) { function s(A) { try { i(r.next(A)) } catch (A) { B(A) } } function o(A) { try { i(r.throw(A)) } catch (A) { B(A) } } function i(A) { A.done ? n(A.value) : new t(function (e) { e(A.value) }).then(s, o) } i((r = r.apply(A, e || [])).next()) }) } function n(A, e) { var t, r, n, B, s = { label: 0, sent: function () { if (1 & n[0]) throw n[1]; return n[1] }, trys: [], ops: [] }; return B = { next: o(0), throw: o(1), return: o(2) }, "function" == typeof Symbol && (B[Symbol.iterator] = function () { return this }), B; function o(B) { return function (o) { return function (B) { if (t) throw new TypeError("Generator is already executing."); for (; s;)try { if (t = 1, r && (n = 2 & B[0] ? r.return : B[0] ? r.throw || ((n = r.return) && n.call(r), 0) : r.next) && !(n = n.call(r, B[1])).done) return n; switch (r = 0, n && (B = [2 & B[0], n.value]), B[0]) { case 0: case 1: n = B; break; case 4: return s.label++, { value: B[1], done: !1 }; case 5: s.label++, r = B[1], B = [0]; continue; case 7: B = s.ops.pop(), s.trys.pop(); continue; default: if (!(n = (n = s.trys).length > 0 && n[n.length - 1]) && (6 === B[0] || 2 === B[0])) { s = 0; continue } if (3 === B[0] && (!n || B[1] > n[0] && B[1] < n[3])) { s.label = B[1]; break } if (6 === B[0] && s.label < n[1]) { s.label = n[1], n = B; break } if (n && s.label < n[2]) { s.label = n[2], s.ops.push(B); break } n[2] && s.ops.pop(), s.trys.pop(); continue }B = e.call(A, s) } catch (A) { B = [6, A], r = 0 } finally { t = n = 0 } if (5 & B[0]) throw B[1]; return { value: B[0] ? B[1] : void 0, done: !0 } }([B, o]) } } } for (var B = function () { function A(A, e, t, r) { this.left = A, this.top = e, this.width = t, this.height = r } return A.prototype.add = function (e, t, r, n) { return new A(this.left + e, this.top + t, this.width + r, this.height + n) }, A.fromClientRect = function (e) { return new A(e.left, e.top, e.width, e.height) }, A }(), s = function (A) { return B.fromClientRect(A.getBoundingClientRect()) }, o = function (A) { for (var e = [], t = 0, r = A.length; t < r;) { var n = A.charCodeAt(t++); if (n >= 55296 && n <= 56319 && t < r) { var B = A.charCodeAt(t++); 56320 == (64512 & B) ? e.push(((1023 & n) << 10) + (1023 & B) + 65536) : (e.push(n), t--) } else e.push(n) } return e }, i = function () { for (var A = [], e = 0; e < arguments.length; e++)A[e] = arguments[e]; if (String.fromCodePoint) return String.fromCodePoint.apply(String, A); var t = A.length; if (!t) return ""; for (var r = [], n = -1, B = ""; ++n < t;) { var s = A[n]; s <= 65535 ? r.push(s) : (s -= 65536, r.push(55296 + (s >> 10), s % 1024 + 56320)), (n + 1 === t || r.length > 16384) && (B += String.fromCharCode.apply(String, r), r.length = 0) } return B }, a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", c = "undefined" == typeof Uint8Array ? [] : new Uint8Array(256), Q = 0; Q < a.length; Q++)c[a.charCodeAt(Q)] = Q; var u, w = function (A, e, t) { return A.slice ? A.slice(e, t) : new Uint16Array(Array.prototype.slice.call(A, e, t)) }, U = function () { function A(A, e, t, r, n, B) { this.initialValue = A, this.errorValue = e, this.highStart = t, this.highValueIndex = r, this.index = n, this.data = B } return A.prototype.get = function (A) { var e; if (A >= 0) { if (A < 55296 || A > 56319 && A <= 65535) return e = ((e = this.index[A >> 5]) << 2) + (31 & A), this.data[e]; if (A <= 65535) return e = ((e = this.index[2048 + (A - 55296 >> 5)]) << 2) + (31 & A), this.data[e]; if (A < this.highStart) return e = 2080 + (A >> 11), e = this.index[e], e += A >> 5 & 63, e = ((e = this.index[e]) << 2) + (31 & A), this.data[e]; if (A <= 1114111) return this.data[this.highValueIndex] } return this.errorValue }, A }(), l = 10, C = 13, g = 15, E = 17, F = 18, h = 19, H = 20, d = 21, f = 22, p = 24, N = 25, K = 26, I = 27, T = 28, m = 30, R = 32, L = 33, O = 34, v = 35, D = 37, b = 38, S = 39, M = 40, y = 42, _ = "!", P = function (A) { var e, t, r, n = function (A) { var e, t, r, n, B, s = .75 * A.length, o = A.length, i = 0; "=" === A[A.length - 1] && (s--, "=" === A[A.length - 2] && s--); var a = "undefined" != typeof ArrayBuffer && "undefined" != typeof Uint8Array && void 0 !== Uint8Array.prototype.slice ? new ArrayBuffer(s) : new Array(s), Q = Array.isArray(a) ? a : new Uint8Array(a); for (e = 0; e < o; e += 4)t = c[A.charCodeAt(e)], r = c[A.charCodeAt(e + 1)], n = c[A.charCodeAt(e + 2)], B = c[A.charCodeAt(e + 3)], Q[i++] = t << 2 | r >> 4, Q[i++] = (15 & r) << 4 | n >> 2, Q[i++] = (3 & n) << 6 | 63 & B; return a }(A), B = Array.isArray(n) ? function (A) { for (var e = A.length, t = [], r = 0; r < e; r += 4)t.push(A[r + 3] << 24 | A[r + 2] << 16 | A[r + 1] << 8 | A[r]); return t }(n) : new Uint32Array(n), s = Array.isArray(n) ? function (A) { for (var e = A.length, t = [], r = 0; r < e; r += 2)t.push(A[r + 1] << 8 | A[r]); return t }(n) : new Uint16Array(n), o = w(s, 12, B[4] / 2), i = 2 === B[5] ? w(s, (24 + B[4]) / 2) : (e = B, t = Math.ceil((24 + B[4]) / 4), e.slice ? e.slice(t, r) : new Uint32Array(Array.prototype.slice.call(e, t, r))); return new U(B[0], B[1], B[2], B[3], o, i) }("KwAAAAAAAAAACA4AIDoAAPAfAAACAAAAAAAIABAAGABAAEgAUABYAF4AZgBeAGYAYABoAHAAeABeAGYAfACEAIAAiACQAJgAoACoAK0AtQC9AMUAXgBmAF4AZgBeAGYAzQDVAF4AZgDRANkA3gDmAOwA9AD8AAQBDAEUARoBIgGAAIgAJwEvATcBPwFFAU0BTAFUAVwBZAFsAXMBewGDATAAiwGTAZsBogGkAawBtAG8AcIBygHSAdoB4AHoAfAB+AH+AQYCDgIWAv4BHgImAi4CNgI+AkUCTQJTAlsCYwJrAnECeQKBAk0CiQKRApkCoQKoArACuALAAsQCzAIwANQC3ALkAjAA7AL0AvwCAQMJAxADGAMwACADJgMuAzYDPgOAAEYDSgNSA1IDUgNaA1oDYANiA2IDgACAAGoDgAByA3YDfgOAAIQDgACKA5IDmgOAAIAAogOqA4AAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAK8DtwOAAIAAvwPHA88D1wPfAyAD5wPsA/QD/AOAAIAABAQMBBIEgAAWBB4EJgQuBDMEIAM7BEEEXgBJBCADUQRZBGEEaQQwADAAcQQ+AXkEgQSJBJEEgACYBIAAoASoBK8EtwQwAL8ExQSAAIAAgACAAIAAgACgAM0EXgBeAF4AXgBeAF4AXgBeANUEXgDZBOEEXgDpBPEE+QQBBQkFEQUZBSEFKQUxBTUFPQVFBUwFVAVcBV4AYwVeAGsFcwV7BYMFiwWSBV4AmgWgBacFXgBeAF4AXgBeAKsFXgCyBbEFugW7BcIFwgXIBcIFwgXQBdQF3AXkBesF8wX7BQMGCwYTBhsGIwYrBjMGOwZeAD8GRwZNBl4AVAZbBl4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAGMGXgBqBnEGXgBeAF4AXgBeAF4AXgBeAF4AXgB5BoAG4wSGBo4GkwaAAIADHgR5AF4AXgBeAJsGgABGA4AAowarBrMGswagALsGwwbLBjAA0wbaBtoG3QbaBtoG2gbaBtoG2gblBusG8wb7BgMHCwcTBxsHCwcjBysHMAc1BzUHOgdCB9oGSgdSB1oHYAfaBloHaAfaBlIH2gbaBtoG2gbaBtoG2gbaBjUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHbQdeAF4ANQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQd1B30HNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B4MH2gaKB68EgACAAIAAgACAAIAAgACAAI8HlwdeAJ8HpweAAIAArwe3B14AXgC/B8UHygcwANAH2AfgB4AA6AfwBz4B+AcACFwBCAgPCBcIogEYAR8IJwiAAC8INwg/CCADRwhPCFcIXwhnCEoDGgSAAIAAgABvCHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIhAiLCI4IMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAANQc1BzUHNQc1BzUHNQc1BzUHNQc1B54INQc1B6II2gaqCLIIugiAAIAAvgjGCIAAgACAAIAAgACAAIAAgACAAIAAywiHAYAA0wiAANkI3QjlCO0I9Aj8CIAAgACAAAIJCgkSCRoJIgknCTYHLwk3CZYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiAAIAAAAFAAXgBeAGAAcABeAHwAQACQAKAArQC9AJ4AXgBeAE0A3gBRAN4A7AD8AMwBGgEAAKcBNwEFAUwBXAF4QkhCmEKnArcCgAHHAsABz4LAAcABwAHAAd+C6ABoAG+C/4LAAcABwAHAAc+DF4MAAcAB54M3gweDV4Nng3eDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEeDqABVg6WDqABoQ6gAaABoAHXDvcONw/3DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DncPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB7cPPwlGCU4JMACAAIAAgABWCV4JYQmAAGkJcAl4CXwJgAkwADAAMAAwAIgJgACLCZMJgACZCZ8JowmrCYAAswkwAF4AXgB8AIAAuwkABMMJyQmAAM4JgADVCTAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAqwYWBNkIMAAwADAAMADdCeAJ6AnuCR4E9gkwAP4JBQoNCjAAMACAABUK0wiAAB0KJAosCjQKgAAwADwKQwqAAEsKvQmdCVMKWwowADAAgACAALcEMACAAGMKgABrCjAAMAAwADAAMAAwADAAMAAwADAAMAAeBDAAMAAwADAAMAAwADAAMAAwADAAMAAwAIkEPQFzCnoKiQSCCooKkAqJBJgKoAqkCokEGAGsCrQKvArBCjAAMADJCtEKFQHZCuEK/gHpCvEKMAAwADAAMACAAIwE+QowAIAAPwEBCzAAMAAwADAAMACAAAkLEQswAIAAPwEZCyELgAAOCCkLMAAxCzkLMAAwADAAMAAwADAAXgBeAEELMAAwADAAMAAwADAAMAAwAEkLTQtVC4AAXAtkC4AAiQkwADAAMAAwADAAMAAwADAAbAtxC3kLgAuFC4sLMAAwAJMLlwufCzAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAApwswADAAMACAAIAAgACvC4AAgACAAIAAgACAALcLMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAvwuAAMcLgACAAIAAgACAAIAAyguAAIAAgACAAIAA0QswADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAANkLgACAAIAA4AswADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACJCR4E6AswADAAhwHwC4AA+AsADAgMEAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMACAAIAAGAwdDCUMMAAwAC0MNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQw1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHPQwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADUHNQc1BzUHNQc1BzUHNQc2BzAAMAA5DDUHNQc1BzUHNQc1BzUHNQc1BzUHNQdFDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAATQxSDFoMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAF4AXgBeAF4AXgBeAF4AYgxeAGoMXgBxDHkMfwxeAIUMXgBeAI0MMAAwADAAMAAwAF4AXgCVDJ0MMAAwADAAMABeAF4ApQxeAKsMswy7DF4Awgy9DMoMXgBeAF4AXgBeAF4AXgBeAF4AXgDRDNkMeQBqCeAM3Ax8AOYM7Az0DPgMXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgCgAAANoAAHDQ4NFg0wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAeDSYNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAC4NMABeAF4ANg0wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAD4NRg1ODVYNXg1mDTAAbQ0wADAAMAAwADAAMAAwADAA2gbaBtoG2gbaBtoG2gbaBnUNeg3CBYANwgWFDdoGjA3aBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gaUDZwNpA2oDdoG2gawDbcNvw3HDdoG2gbPDdYN3A3fDeYN2gbsDfMN2gbaBvoN/g3aBgYODg7aBl4AXgBeABYOXgBeACUG2gYeDl4AJA5eACwO2w3aBtoGMQ45DtoG2gbaBtoGQQ7aBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gZJDjUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B1EO2gY1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQdZDjUHNQc1BzUHNQc1B2EONQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHaA41BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B3AO2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gY1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B2EO2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gZJDtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBkkOeA6gAKAAoAAwADAAMAAwAKAAoACgAKAAoACgAKAAgA4wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAD//wQABAAEAAQABAAEAAQABAAEAA0AAwABAAEAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAKABMAFwAeABsAGgAeABcAFgASAB4AGwAYAA8AGAAcAEsASwBLAEsASwBLAEsASwBLAEsAGAAYAB4AHgAeABMAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAFgAbABIAHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYADQARAB4ABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkAFgAaABsAGwAbAB4AHQAdAB4ATwAXAB4ADQAeAB4AGgAbAE8ATwAOAFAAHQAdAB0ATwBPABcATwBPAE8AFgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwArAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAAQABAANAA0ASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAUAArACsAKwArACsAKwArACsABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAGgAaAFAAUABQAFAAUABMAB4AGwBQAB4AKwArACsABAAEAAQAKwBQAFAAUABQAFAAUAArACsAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUAArAFAAUAArACsABAArAAQABAAEAAQABAArACsAKwArAAQABAArACsABAAEAAQAKwArACsABAArACsAKwArACsAKwArAFAAUABQAFAAKwBQACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwAEAAQAUABQAFAABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQAKwArAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeABsAKwArACsAKwArACsAKwBQAAQABAAEAAQABAAEACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAKwArACsAKwArACsAKwArAAQABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwAEAFAAKwBQAFAAUABQAFAAUAArACsAKwBQAFAAUAArAFAAUABQAFAAKwArACsAUABQACsAUAArAFAAUAArACsAKwBQAFAAKwArACsAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQAKwArACsABAAEAAQAKwAEAAQABAAEACsAKwBQACsAKwArACsAKwArAAQAKwArACsAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAB4AHgAeAB4AHgAeABsAHgArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArAFAAUABQACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAB4AUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArACsAKwArACsAKwArAFAAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwArAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAKwBcAFwAKwBcACsAKwBcACsAKwArACsAKwArAFwAXABcAFwAKwBcAFwAXABcAFwAXABcACsAXABcAFwAKwBcACsAXAArACsAXABcACsAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgArACoAKgBcACsAKwBcAFwAXABcAFwAKwBcACsAKgAqACoAKgAqACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAFwAXABcAFwAUAAOAA4ADgAOAB4ADgAOAAkADgAOAA0ACQATABMAEwATABMACQAeABMAHgAeAB4ABAAEAB4AHgAeAB4AHgAeAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUAANAAQAHgAEAB4ABAAWABEAFgARAAQABABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAAQABAAEAAQABAANAAQABABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsADQANAB4AHgAeAB4AHgAeAAQAHgAeAB4AHgAeAB4AKwAeAB4ADgAOAA0ADgAeAB4AHgAeAB4ACQAJACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgAeAB4AHgBcAFwAXABcAFwAXAAqACoAKgAqAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAKgAqACoAKgAqACoAKgBcAFwAXAAqACoAKgAqAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAXAAqAEsASwBLAEsASwBLAEsASwBLAEsAKgAqACoAKgAqACoAUABQAFAAUABQAFAAKwBQACsAKwArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQACsAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwAEAAQABAAeAA0AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAEQArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAADQANAA0AUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAA0ADQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoADQANABUAXAANAB4ADQAbAFwAKgArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAB4AHgATABMADQANAA4AHgATABMAHgAEAAQABAAJACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAUABQAFAAUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwAeACsAKwArABMAEwBLAEsASwBLAEsASwBLAEsASwBLAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwBcAFwAXABcAFwAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcACsAKwArACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwAeAB4AXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsABABLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKgAqACoAKgAqACoAKgBcACoAKgAqACoAKgAqACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAUABQAFAAUABQAFAAUAArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4ADQANAA0ADQAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAHgAeAB4AHgBQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwANAA0ADQANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwBQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsABAAEAAQAHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAABABQAFAAUABQAAQABAAEAFAAUAAEAAQABAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAKwBQACsAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAKwArAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAKwAeAB4AHgAeAB4AHgAeAA4AHgArAA0ADQANAA0ADQANAA0ACQANAA0ADQAIAAQACwAEAAQADQAJAA0ADQAMAB0AHQAeABcAFwAWABcAFwAXABYAFwAdAB0AHgAeABQAFAAUAA0AAQABAAQABAAEAAQABAAJABoAGgAaABoAGgAaABoAGgAeABcAFwAdABUAFQAeAB4AHgAeAB4AHgAYABYAEQAVABUAFQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgANAB4ADQANAA0ADQAeAA0ADQANAAcAHgAeAB4AHgArAAQABAAEAAQABAAEAAQABAAEAAQAUABQACsAKwBPAFAAUABQAFAAUAAeAB4AHgAWABEATwBQAE8ATwBPAE8AUABQAFAAUABQAB4AHgAeABYAEQArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAGwAbABsAGwAbABsAGwAaABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAaABsAGwAbABsAGgAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgBQABoAHgAdAB4AUAAeABoAHgAeAB4AHgAeAB4AHgAeAB4ATwAeAFAAGwAeAB4AUABQAFAAUABQAB4AHgAeAB0AHQAeAFAAHgBQAB4AUAAeAFAATwBQAFAAHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AUABQAFAAUABPAE8AUABQAFAAUABQAE8AUABQAE8AUABPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAE8ATwBPAE8ATwBPAE8ATwBPAE8AUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAATwAeAB4AKwArACsAKwAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB0AHQAeAB4AHgAdAB0AHgAeAB0AHgAeAB4AHQAeAB0AGwAbAB4AHQAeAB4AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB0AHgAdAB4AHQAdAB0AHQAdAB0AHgAdAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAdAB0AHQAdAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAlACUAHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB0AHQAeAB4AHgAeAB0AHQAdAB4AHgAdAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB0AHQAeAB4AHQAeAB4AHgAeAB0AHQAeAB4AHgAeACUAJQAdAB0AJQAeACUAJQAlACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAHgAeAB4AHgAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHQAdAB0AHgAdACUAHQAdAB4AHQAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHQAdAB0AHQAlAB4AJQAlACUAHQAlACUAHQAdAB0AJQAlAB0AHQAlAB0AHQAlACUAJQAeAB0AHgAeAB4AHgAdAB0AJQAdAB0AHQAdAB0AHQAlACUAJQAlACUAHQAlACUAIAAlAB0AHQAlACUAJQAlACUAJQAlACUAHgAeAB4AJQAlACAAIAAgACAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeABcAFwAXABcAFwAXAB4AEwATACUAHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACUAJQBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwArACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAE8ATwBPAE8ATwBPAE8ATwAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeACsAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUAArACsAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQBQAFAAUABQACsAKwArACsAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAABAAEAAQAKwAEAAQAKwArACsAKwArAAQABAAEAAQAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsABAAEAAQAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsADQANAA0ADQANAA0ADQANAB4AKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAUABQAFAAUABQAA0ADQANAA0ADQANABQAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwANAA0ADQANAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAeAAQABAAEAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLACsADQArAB4AKwArAAQABAAEAAQAUABQAB4AUAArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwAEAAQABAAEAAQABAAEAAQABAAOAA0ADQATABMAHgAeAB4ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0AUABQAFAAUAAEAAQAKwArAAQADQANAB4AUAArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXABcAA0ADQANACoASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUAArACsAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANACsADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEcARwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwAeAAQABAANAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAEAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUAArACsAUAArACsAUABQACsAKwBQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAeAB4ADQANAA0ADQAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAArAAQABAArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAEAAQABAAEAAQABAAEACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAFgAWAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAKwBQACsAKwArACsAKwArAFAAKwArACsAKwBQACsAUAArAFAAKwBQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQACsAUAArAFAAKwBQACsAUABQACsAUAArACsAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAUABQAFAAUAArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUAArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAlACUAJQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeACUAJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeACUAJQAlACUAJQAeACUAJQAlACUAJQAgACAAIAAlACUAIAAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIQAhACEAIQAhACUAJQAgACAAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAIAAlACUAJQAlACAAJQAgACAAIAAgACAAIAAgACAAIAAlACUAJQAgACUAJQAlACUAIAAgACAAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeACUAHgAlAB4AJQAlACUAJQAlACAAJQAlACUAJQAeACUAHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAIAAgACAAIAAgAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFwAXABcAFQAVABUAHgAeAB4AHgAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAlACAAIAAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsA"), x = [m, 36], V = [1, 2, 3, 5], z = [l, 8], X = [I, K], J = V.concat(z), G = [b, S, M, O, v], k = [g, C], W = function (A, e, t, r) { var n = r[t]; if (Array.isArray(A) ? -1 !== A.indexOf(n) : A === n) for (var B = t; B <= r.length;) { if ((i = r[++B]) === e) return !0; if (i !== l) break } if (n === l) for (B = t; B > 0;) { var s = r[--B]; if (Array.isArray(A) ? -1 !== A.indexOf(s) : A === s) for (var o = t; o <= r.length;) { var i; if ((i = r[++o]) === e) return !0; if (i !== l) break } if (s !== l) break } return !1 }, Y = function (A, e) { for (var t = A; t >= 0;) { var r = e[t]; if (r !== l) return r; t-- } return 0 }, q = function (A, e, t, r, n) { if (0 === t[r]) return "×"; var B = r - 1; if (Array.isArray(n) && !0 === n[B]) return "×"; var s = B - 1, o = B + 1, i = e[B], a = s >= 0 ? e[s] : 0, c = e[o]; if (2 === i && 3 === c) return "×"; if (-1 !== V.indexOf(i)) return _; if (-1 !== V.indexOf(c)) return "×"; if (-1 !== z.indexOf(c)) return "×"; if (8 === Y(B, e)) return "÷"; if (11 === P.get(A[B]) && (c === D || c === R || c === L)) return "×"; if (7 === i || 7 === c) return "×"; if (9 === i) return "×"; if (-1 === [l, C, g].indexOf(i) && 9 === c) return "×"; if (-1 !== [E, F, h, p, T].indexOf(c)) return "×"; if (Y(B, e) === f) return "×"; if (W(23, f, B, e)) return "×"; if (W([E, F], d, B, e)) return "×"; if (W(12, 12, B, e)) return "×"; if (i === l) return "÷"; if (23 === i || 23 === c) return "×"; if (16 === c || 16 === i) return "÷"; if (-1 !== [C, g, d].indexOf(c) || 14 === i) return "×"; if (36 === a && -1 !== k.indexOf(i)) return "×"; if (i === T && 36 === c) return "×"; if (c === H && -1 !== x.concat(H, h, N, D, R, L).indexOf(i)) return "×"; if (-1 !== x.indexOf(c) && i === N || -1 !== x.indexOf(i) && c === N) return "×"; if (i === I && -1 !== [D, R, L].indexOf(c) || -1 !== [D, R, L].indexOf(i) && c === K) return "×"; if (-1 !== x.indexOf(i) && -1 !== X.indexOf(c) || -1 !== X.indexOf(i) && -1 !== x.indexOf(c)) return "×"; if (-1 !== [I, K].indexOf(i) && (c === N || -1 !== [f, g].indexOf(c) && e[o + 1] === N) || -1 !== [f, g].indexOf(i) && c === N || i === N && -1 !== [N, T, p].indexOf(c)) return "×"; if (-1 !== [N, T, p, E, F].indexOf(c)) for (var Q = B; Q >= 0;) { if ((u = e[Q]) === N) return "×"; if (-1 === [T, p].indexOf(u)) break; Q-- } if (-1 !== [I, K].indexOf(c)) for (Q = -1 !== [E, F].indexOf(i) ? s : B; Q >= 0;) { var u; if ((u = e[Q]) === N) return "×"; if (-1 === [T, p].indexOf(u)) break; Q-- } if (b === i && -1 !== [b, S, O, v].indexOf(c) || -1 !== [S, O].indexOf(i) && -1 !== [S, M].indexOf(c) || -1 !== [M, v].indexOf(i) && c === M) return "×"; if (-1 !== G.indexOf(i) && -1 !== [H, K].indexOf(c) || -1 !== G.indexOf(c) && i === I) return "×"; if (-1 !== x.indexOf(i) && -1 !== x.indexOf(c)) return "×"; if (i === p && -1 !== x.indexOf(c)) return "×"; if (-1 !== x.concat(N).indexOf(i) && c === f || -1 !== x.concat(N).indexOf(c) && i === F) return "×"; if (41 === i && 41 === c) { for (var w = t[B], U = 1; w > 0 && 41 === e[--w];)U++; if (U % 2 != 0) return "×" } return i === R && c === L ? "×" : "÷" }, Z = function (A, e) { e || (e = { lineBreak: "normal", wordBreak: "normal" }); var t = function (A, e) { void 0 === e && (e = "strict"); var t = [], r = [], n = []; return A.forEach(function (A, B) { var s = P.get(A); if (s > 50 ? (n.push(!0), s -= 50) : n.push(!1), -1 !== ["normal", "auto", "loose"].indexOf(e) && -1 !== [8208, 8211, 12316, 12448].indexOf(A)) return r.push(B), t.push(16); if (4 === s || 11 === s) { if (0 === B) return r.push(B), t.push(m); var o = t[B - 1]; return -1 === J.indexOf(o) ? (r.push(r[B - 1]), t.push(o)) : (r.push(B), t.push(m)) } return r.push(B), 31 === s ? t.push("strict" === e ? d : D) : s === y ? t.push(m) : 29 === s ? t.push(m) : 43 === s ? A >= 131072 && A <= 196605 || A >= 196608 && A <= 262141 ? t.push(D) : t.push(m) : void t.push(s) }), [r, t, n] }(A, e.lineBreak), r = t[0], n = t[1], B = t[2]; return "break-all" !== e.wordBreak && "break-word" !== e.wordBreak || (n = n.map(function (A) { return -1 !== [N, m, y].indexOf(A) ? D : A })), [r, n, "keep-all" === e.wordBreak ? B.map(function (e, t) { return e && A[t] >= 19968 && A[t] <= 40959 }) : void 0] }, j = function () { function A(A, e, t, r) { this.codePoints = A, this.required = e === _, this.start = t, this.end = r } return A.prototype.slice = function () { return i.apply(void 0, this.codePoints.slice(this.start, this.end)) }, A }(); !function (A) { A[A.STRING_TOKEN = 0] = "STRING_TOKEN", A[A.BAD_STRING_TOKEN = 1] = "BAD_STRING_TOKEN", A[A.LEFT_PARENTHESIS_TOKEN = 2] = "LEFT_PARENTHESIS_TOKEN", A[A.RIGHT_PARENTHESIS_TOKEN = 3] = "RIGHT_PARENTHESIS_TOKEN", A[A.COMMA_TOKEN = 4] = "COMMA_TOKEN", A[A.HASH_TOKEN = 5] = "HASH_TOKEN", A[A.DELIM_TOKEN = 6] = "DELIM_TOKEN", A[A.AT_KEYWORD_TOKEN = 7] = "AT_KEYWORD_TOKEN", A[A.PREFIX_MATCH_TOKEN = 8] = "PREFIX_MATCH_TOKEN", A[A.DASH_MATCH_TOKEN = 9] = "DASH_MATCH_TOKEN", A[A.INCLUDE_MATCH_TOKEN = 10] = "INCLUDE_MATCH_TOKEN", A[A.LEFT_CURLY_BRACKET_TOKEN = 11] = "LEFT_CURLY_BRACKET_TOKEN", A[A.RIGHT_CURLY_BRACKET_TOKEN = 12] = "RIGHT_CURLY_BRACKET_TOKEN", A[A.SUFFIX_MATCH_TOKEN = 13] = "SUFFIX_MATCH_TOKEN", A[A.SUBSTRING_MATCH_TOKEN = 14] = "SUBSTRING_MATCH_TOKEN", A[A.DIMENSION_TOKEN = 15] = "DIMENSION_TOKEN", A[A.PERCENTAGE_TOKEN = 16] = "PERCENTAGE_TOKEN", A[A.NUMBER_TOKEN = 17] = "NUMBER_TOKEN", A[A.FUNCTION = 18] = "FUNCTION", A[A.FUNCTION_TOKEN = 19] = "FUNCTION_TOKEN", A[A.IDENT_TOKEN = 20] = "IDENT_TOKEN", A[A.COLUMN_TOKEN = 21] = "COLUMN_TOKEN", A[A.URL_TOKEN = 22] = "URL_TOKEN", A[A.BAD_URL_TOKEN = 23] = "BAD_URL_TOKEN", A[A.CDC_TOKEN = 24] = "CDC_TOKEN", A[A.CDO_TOKEN = 25] = "CDO_TOKEN", A[A.COLON_TOKEN = 26] = "COLON_TOKEN", A[A.SEMICOLON_TOKEN = 27] = "SEMICOLON_TOKEN", A[A.LEFT_SQUARE_BRACKET_TOKEN = 28] = "LEFT_SQUARE_BRACKET_TOKEN", A[A.RIGHT_SQUARE_BRACKET_TOKEN = 29] = "RIGHT_SQUARE_BRACKET_TOKEN", A[A.UNICODE_RANGE_TOKEN = 30] = "UNICODE_RANGE_TOKEN", A[A.WHITESPACE_TOKEN = 31] = "WHITESPACE_TOKEN", A[A.EOF_TOKEN = 32] = "EOF_TOKEN" }(u || (u = {})); var $ = function (A) { return A >= 48 && A <= 57 }, AA = function (A) { return $(A) || A >= 65 && A <= 70 || A >= 97 && A <= 102 }, eA = function (A) { return 10 === A || 9 === A || 32 === A }, tA = function (A) { return function (A) { return function (A) { return A >= 97 && A <= 122 }(A) || function (A) { return A >= 65 && A <= 90 }(A) }(A) || function (A) { return A >= 128 }(A) || 95 === A }, rA = function (A) { return tA(A) || $(A) || 45 === A }, nA = function (A) { return A >= 0 && A <= 8 || 11 === A || A >= 14 && A <= 31 || 127 === A }, BA = function (A, e) { return 92 === A && 10 !== e }, sA = function (A, e, t) { return 45 === A ? tA(e) || BA(e, t) : !!tA(A) || !(92 !== A || !BA(A, e)) }, oA = function (A, e, t) { return 43 === A || 45 === A ? !!$(e) || 46 === e && $(t) : $(46 === A ? e : A) }, iA = function (A) { var e = 0, t = 1; 43 !== A[e] && 45 !== A[e] || (45 === A[e] && (t = -1), e++); for (var r = []; $(A[e]);)r.push(A[e++]); var n = r.length ? parseInt(i.apply(void 0, r), 10) : 0; 46 === A[e] && e++; for (var B = []; $(A[e]);)B.push(A[e++]); var s = B.length, o = s ? parseInt(i.apply(void 0, B), 10) : 0; 69 !== A[e] && 101 !== A[e] || e++; var a = 1; 43 !== A[e] && 45 !== A[e] || (45 === A[e] && (a = -1), e++); for (var c = []; $(A[e]);)c.push(A[e++]); var Q = c.length ? parseInt(i.apply(void 0, c), 10) : 0; return t * (n + o * Math.pow(10, -s)) * Math.pow(10, a * Q) }, aA = { type: u.LEFT_PARENTHESIS_TOKEN }, cA = { type: u.RIGHT_PARENTHESIS_TOKEN }, QA = { type: u.COMMA_TOKEN }, uA = { type: u.SUFFIX_MATCH_TOKEN }, wA = { type: u.PREFIX_MATCH_TOKEN }, UA = { type: u.COLUMN_TOKEN }, lA = { type: u.DASH_MATCH_TOKEN }, CA = { type: u.INCLUDE_MATCH_TOKEN }, gA = { type: u.LEFT_CURLY_BRACKET_TOKEN }, EA = { type: u.RIGHT_CURLY_BRACKET_TOKEN }, FA = { type: u.SUBSTRING_MATCH_TOKEN }, hA = { type: u.BAD_URL_TOKEN }, HA = { type: u.BAD_STRING_TOKEN }, dA = { type: u.CDO_TOKEN }, fA = { type: u.CDC_TOKEN }, pA = { type: u.COLON_TOKEN }, NA = { type: u.SEMICOLON_TOKEN }, KA = { type: u.LEFT_SQUARE_BRACKET_TOKEN }, IA = { type: u.RIGHT_SQUARE_BRACKET_TOKEN }, TA = { type: u.WHITESPACE_TOKEN }, mA = { type: u.EOF_TOKEN }, RA = function () { function A() { this._value = [] } return A.prototype.write = function (A) { this._value = this._value.concat(o(A)) }, A.prototype.read = function () { for (var A = [], e = this.consumeToken(); e !== mA;)A.push(e), e = this.consumeToken(); return A }, A.prototype.consumeToken = function () { var A = this.consumeCodePoint(); switch (A) { case 34: return this.consumeStringToken(34); case 35: var e = this.peekCodePoint(0), t = this.peekCodePoint(1), r = this.peekCodePoint(2); if (rA(e) || BA(t, r)) { var n = sA(e, t, r) ? 2 : 1, B = this.consumeName(); return { type: u.HASH_TOKEN, value: B, flags: n } } break; case 36: if (61 === this.peekCodePoint(0)) return this.consumeCodePoint(), uA; break; case 39: return this.consumeStringToken(39); case 40: return aA; case 41: return cA; case 42: if (61 === this.peekCodePoint(0)) return this.consumeCodePoint(), FA; break; case 43: if (oA(A, this.peekCodePoint(0), this.peekCodePoint(1))) return this.reconsumeCodePoint(A), this.consumeNumericToken(); break; case 44: return QA; case 45: var s = A, o = this.peekCodePoint(0), a = this.peekCodePoint(1); if (oA(s, o, a)) return this.reconsumeCodePoint(A), this.consumeNumericToken(); if (sA(s, o, a)) return this.reconsumeCodePoint(A), this.consumeIdentLikeToken(); if (45 === o && 62 === a) return this.consumeCodePoint(), this.consumeCodePoint(), fA; break; case 46: if (oA(A, this.peekCodePoint(0), this.peekCodePoint(1))) return this.reconsumeCodePoint(A), this.consumeNumericToken(); break; case 47: if (42 === this.peekCodePoint(0)) for (this.consumeCodePoint(); ;) { var c = this.consumeCodePoint(); if (42 === c && 47 === (c = this.consumeCodePoint())) return this.consumeToken(); if (-1 === c) return this.consumeToken() } break; case 58: return pA; case 59: return NA; case 60: if (33 === this.peekCodePoint(0) && 45 === this.peekCodePoint(1) && 45 === this.peekCodePoint(2)) return this.consumeCodePoint(), this.consumeCodePoint(), dA; break; case 64: var Q = this.peekCodePoint(0), w = this.peekCodePoint(1), U = this.peekCodePoint(2); if (sA(Q, w, U)) { B = this.consumeName(); return { type: u.AT_KEYWORD_TOKEN, value: B } } break; case 91: return KA; case 92: if (BA(A, this.peekCodePoint(0))) return this.reconsumeCodePoint(A), this.consumeIdentLikeToken(); break; case 93: return IA; case 61: if (61 === this.peekCodePoint(0)) return this.consumeCodePoint(), wA; break; case 123: return gA; case 125: return EA; case 117: case 85: var l = this.peekCodePoint(0), C = this.peekCodePoint(1); return 43 !== l || !AA(C) && 63 !== C || (this.consumeCodePoint(), this.consumeUnicodeRangeToken()), this.reconsumeCodePoint(A), this.consumeIdentLikeToken(); case 124: if (61 === this.peekCodePoint(0)) return this.consumeCodePoint(), lA; if (124 === this.peekCodePoint(0)) return this.consumeCodePoint(), UA; break; case 126: if (61 === this.peekCodePoint(0)) return this.consumeCodePoint(), CA; break; case -1: return mA }return eA(A) ? (this.consumeWhiteSpace(), TA) : $(A) ? (this.reconsumeCodePoint(A), this.consumeNumericToken()) : tA(A) ? (this.reconsumeCodePoint(A), this.consumeIdentLikeToken()) : { type: u.DELIM_TOKEN, value: i(A) } }, A.prototype.consumeCodePoint = function () { var A = this._value.shift(); return void 0 === A ? -1 : A }, A.prototype.reconsumeCodePoint = function (A) { this._value.unshift(A) }, A.prototype.peekCodePoint = function (A) { return A >= this._value.length ? -1 : this._value[A] }, A.prototype.consumeUnicodeRangeToken = function () { for (var A = [], e = this.consumeCodePoint(); AA(e) && A.length < 6;)A.push(e), e = this.consumeCodePoint(); for (var t = !1; 63 === e && A.length < 6;)A.push(e), e = this.consumeCodePoint(), t = !0; if (t) { var r = parseInt(i.apply(void 0, A.map(function (A) { return 63 === A ? 48 : A })), 16), n = parseInt(i.apply(void 0, A.map(function (A) { return 63 === A ? 70 : A })), 16); return { type: u.UNICODE_RANGE_TOKEN, start: r, end: n } } var B = parseInt(i.apply(void 0, A), 16); if (45 === this.peekCodePoint(0) && AA(this.peekCodePoint(1))) { this.consumeCodePoint(), e = this.consumeCodePoint(); for (var s = []; AA(e) && s.length < 6;)s.push(e), e = this.consumeCodePoint(); n = parseInt(i.apply(void 0, s), 16); return { type: u.UNICODE_RANGE_TOKEN, start: B, end: n } } return { type: u.UNICODE_RANGE_TOKEN, start: B, end: B } }, A.prototype.consumeIdentLikeToken = function () { var A = this.consumeName(); return "url" === A.toLowerCase() && 40 === this.peekCodePoint(0) ? (this.consumeCodePoint(), this.consumeUrlToken()) : 40 === this.peekCodePoint(0) ? (this.consumeCodePoint(), { type: u.FUNCTION_TOKEN, value: A }) : { type: u.IDENT_TOKEN, value: A } }, A.prototype.consumeUrlToken = function () { var A = []; if (this.consumeWhiteSpace(), -1 === this.peekCodePoint(0)) return { type: u.URL_TOKEN, value: "" }; var e = this.peekCodePoint(0); if (39 === e || 34 === e) { var t = this.consumeStringToken(this.consumeCodePoint()); return t.type === u.STRING_TOKEN && (this.consumeWhiteSpace(), -1 === this.peekCodePoint(0) || 41 === this.peekCodePoint(0)) ? (this.consumeCodePoint(), { type: u.URL_TOKEN, value: t.value }) : (this.consumeBadUrlRemnants(), hA) } for (; ;) { var r = this.consumeCodePoint(); if (-1 === r || 41 === r) return { type: u.URL_TOKEN, value: i.apply(void 0, A) }; if (eA(r)) return this.consumeWhiteSpace(), -1 === this.peekCodePoint(0) || 41 === this.peekCodePoint(0) ? (this.consumeCodePoint(), { type: u.URL_TOKEN, value: i.apply(void 0, A) }) : (this.consumeBadUrlRemnants(), hA); if (34 === r || 39 === r || 40 === r || nA(r)) return this.consumeBadUrlRemnants(), hA; if (92 === r) { if (!BA(r, this.peekCodePoint(0))) return this.consumeBadUrlRemnants(), hA; A.push(this.consumeEscapedCodePoint()) } else A.push(r) } }, A.prototype.consumeWhiteSpace = function () { for (; eA(this.peekCodePoint(0));)this.consumeCodePoint() }, A.prototype.consumeBadUrlRemnants = function () { for (; ;) { var A = this.consumeCodePoint(); if (41 === A || -1 === A) return; BA(A, this.peekCodePoint(0)) && this.consumeEscapedCodePoint() } }, A.prototype.consumeStringSlice = function (A) { for (var e = ""; A > 0;) { var t = Math.min(6e4, A); e += i.apply(void 0, this._value.splice(0, t)), A -= t } return this._value.shift(), e }, A.prototype.consumeStringToken = function (A) { for (var e = "", t = 0; ;) { var r = this._value[t]; if (-1 === r || void 0 === r || r === A) return e += this.consumeStringSlice(t), { type: u.STRING_TOKEN, value: e }; if (10 === r) return this._value.splice(0, t), HA; if (92 === r) { var n = this._value[t + 1]; -1 !== n && void 0 !== n && (10 === n ? (e += this.consumeStringSlice(t), t = -1, this._value.shift()) : BA(r, n) && (e += this.consumeStringSlice(t), e += i(this.consumeEscapedCodePoint()), t = -1)) } t++ } }, A.prototype.consumeNumber = function () { var A = [], e = 4, t = this.peekCodePoint(0); for (43 !== t && 45 !== t || A.push(this.consumeCodePoint()); $(this.peekCodePoint(0));)A.push(this.consumeCodePoint()); t = this.peekCodePoint(0); var r = this.peekCodePoint(1); if (46 === t && $(r)) for (A.push(this.consumeCodePoint(), this.consumeCodePoint()), e = 8; $(this.peekCodePoint(0));)A.push(this.consumeCodePoint()); t = this.peekCodePoint(0), r = this.peekCodePoint(1); var n = this.peekCodePoint(2); if ((69 === t || 101 === t) && ((43 === r || 45 === r) && $(n) || $(r))) for (A.push(this.consumeCodePoint(), this.consumeCodePoint()), e = 8; $(this.peekCodePoint(0));)A.push(this.consumeCodePoint()); return [iA(A), e] }, A.prototype.consumeNumericToken = function () { var A = this.consumeNumber(), e = A[0], t = A[1], r = this.peekCodePoint(0), n = this.peekCodePoint(1), B = this.peekCodePoint(2); if (sA(r, n, B)) { var s = this.consumeName(); return { type: u.DIMENSION_TOKEN, number: e, flags: t, unit: s } } return 37 === r ? (this.consumeCodePoint(), { type: u.PERCENTAGE_TOKEN, number: e, flags: t }) : { type: u.NUMBER_TOKEN, number: e, flags: t } }, A.prototype.consumeEscapedCodePoint = function () { var A = this.consumeCodePoint(); if (AA(A)) { for (var e = i(A); AA(this.peekCodePoint(0)) && e.length < 6;)e += i(this.consumeCodePoint()); eA(this.peekCodePoint(0)) && this.consumeCodePoint(); var t = parseInt(e, 16); return 0 === t || function (A) { return A >= 55296 && A <= 57343 }(t) || t > 1114111 ? 65533 : t } return -1 === A ? 65533 : A }, A.prototype.consumeName = function () { for (var A = ""; ;) { var e = this.consumeCodePoint(); if (rA(e)) A += i(e); else { if (!BA(e, this.peekCodePoint(0))) return this.reconsumeCodePoint(e), A; A += i(this.consumeEscapedCodePoint()) } } }, A }(), LA = function () { function A(A) { this._tokens = A } return A.create = function (e) { var t = new RA; return t.write(e), new A(t.read()) }, A.parseValue = function (e) { return A.create(e).parseComponentValue() }, A.parseValues = function (e) { return A.create(e).parseComponentValues() }, A.prototype.parseComponentValue = function () { for (var A = this.consumeToken(); A.type === u.WHITESPACE_TOKEN;)A = this.consumeToken(); if (A.type === u.EOF_TOKEN) throw new SyntaxError("Error parsing CSS component value, unexpected EOF"); this.reconsumeToken(A); var e = this.consumeComponentValue(); do { A = this.consumeToken() } while (A.type === u.WHITESPACE_TOKEN); if (A.type === u.EOF_TOKEN) return e; throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one") }, A.prototype.parseComponentValues = function () { for (var A = []; ;) { var e = this.consumeComponentValue(); if (e.type === u.EOF_TOKEN) return A; A.push(e), A.push() } }, A.prototype.consumeComponentValue = function () { var A = this.consumeToken(); switch (A.type) { case u.LEFT_CURLY_BRACKET_TOKEN: case u.LEFT_SQUARE_BRACKET_TOKEN: case u.LEFT_PARENTHESIS_TOKEN: return this.consumeSimpleBlock(A.type); case u.FUNCTION_TOKEN: return this.consumeFunction(A) }return A }, A.prototype.consumeSimpleBlock = function (A) { for (var e = { type: A, values: [] }, t = this.consumeToken(); ;) { if (t.type === u.EOF_TOKEN || PA(t, A)) return e; this.reconsumeToken(t), e.values.push(this.consumeComponentValue()), t = this.consumeToken() } }, A.prototype.consumeFunction = function (A) { for (var e = { name: A.value, values: [], type: u.FUNCTION }; ;) { var t = this.consumeToken(); if (t.type === u.EOF_TOKEN || t.type === u.RIGHT_PARENTHESIS_TOKEN) return e; this.reconsumeToken(t), e.values.push(this.consumeComponentValue()) } }, A.prototype.consumeToken = function () { var A = this._tokens.shift(); return void 0 === A ? mA : A }, A.prototype.reconsumeToken = function (A) { this._tokens.unshift(A) }, A }(), OA = function (A) { return A.type === u.DIMENSION_TOKEN }, vA = function (A) { return A.type === u.NUMBER_TOKEN }, DA = function (A) { return A.type === u.IDENT_TOKEN }, bA = function (A) { return A.type === u.STRING_TOKEN }, SA = function (A, e) { return DA(A) && A.value === e }, MA = function (A) { return A.type !== u.WHITESPACE_TOKEN }, yA = function (A) { return A.type !== u.WHITESPACE_TOKEN && A.type !== u.COMMA_TOKEN }, _A = function (A) { var e = [], t = []; return A.forEach(function (A) { if (A.type === u.COMMA_TOKEN) { if (0 === t.length) throw new Error("Error parsing function args, zero tokens for arg"); return e.push(t), void (t = []) } A.type !== u.WHITESPACE_TOKEN && t.push(A) }), t.length && e.push(t), e }, PA = function (A, e) { return e === u.LEFT_CURLY_BRACKET_TOKEN && A.type === u.RIGHT_CURLY_BRACKET_TOKEN || (e === u.LEFT_SQUARE_BRACKET_TOKEN && A.type === u.RIGHT_SQUARE_BRACKET_TOKEN || e === u.LEFT_PARENTHESIS_TOKEN && A.type === u.RIGHT_PARENTHESIS_TOKEN) }, xA = function (A) { return A.type === u.NUMBER_TOKEN || A.type === u.DIMENSION_TOKEN }, VA = function (A) { return A.type === u.PERCENTAGE_TOKEN || xA(A) }, zA = function (A) { return A.length > 1 ? [A[0], A[1]] : [A[0]] }, XA = { type: u.NUMBER_TOKEN, number: 0, flags: 4 }, JA = { type: u.PERCENTAGE_TOKEN, number: 50, flags: 4 }, GA = { type: u.PERCENTAGE_TOKEN, number: 100, flags: 4 }, kA = function (A, e, t) { var r = A[0], n = A[1]; return [WA(r, e), WA(void 0 !== n ? n : r, t)] }, WA = function (A, e) { if (A.type === u.PERCENTAGE_TOKEN) return A.number / 100 * e; if (OA(A)) switch (A.unit) { case "rem": case "em": return 16 * A.number; case "px": default: return A.number }return A.number }, YA = function (A) { if (A.type === u.DIMENSION_TOKEN) switch (A.unit) { case "deg": return Math.PI * A.number / 180; case "grad": return Math.PI / 200 * A.number; case "rad": return A.number; case "turn": return 2 * Math.PI * A.number }throw new Error("Unsupported angle type") }, qA = function (A) { return A.type === u.DIMENSION_TOKEN && ("deg" === A.unit || "grad" === A.unit || "rad" === A.unit || "turn" === A.unit) }, ZA = function (A) { switch (A.filter(DA).map(function (A) { return A.value }).join(" ")) { case "to bottom right": case "to right bottom": case "left top": case "top left": return [XA, XA]; case "to top": case "bottom": return jA(0); case "to bottom left": case "to left bottom": case "right top": case "top right": return [XA, GA]; case "to right": case "left": return jA(90); case "to top left": case "to left top": case "right bottom": case "bottom right": return [GA, GA]; case "to bottom": case "top": return jA(180); case "to top right": case "to right top": case "left bottom": case "bottom left": return [GA, XA]; case "to left": case "right": return jA(270) }return 0 }, jA = function (A) { return Math.PI * A / 180 }, $A = function (A) { if (A.type === u.FUNCTION) { var e = ae[A.name]; if (void 0 === e) throw new Error('Attempting to parse an unsupported color function "' + A.name + '"'); return e(A.values) } if (A.type === u.HASH_TOKEN) { if (3 === A.value.length) { var t = A.value.substring(0, 1), r = A.value.substring(1, 2), n = A.value.substring(2, 3); return te(parseInt(t + t, 16), parseInt(r + r, 16), parseInt(n + n, 16), 1) } if (4 === A.value.length) { t = A.value.substring(0, 1), r = A.value.substring(1, 2), n = A.value.substring(2, 3); var B = A.value.substring(3, 4); return te(parseInt(t + t, 16), parseInt(r + r, 16), parseInt(n + n, 16), parseInt(B + B, 16) / 255) } if (6 === A.value.length) { t = A.value.substring(0, 2), r = A.value.substring(2, 4), n = A.value.substring(4, 6); return te(parseInt(t, 16), parseInt(r, 16), parseInt(n, 16), 1) } if (8 === A.value.length) { t = A.value.substring(0, 2), r = A.value.substring(2, 4), n = A.value.substring(4, 6), B = A.value.substring(6, 8); return te(parseInt(t, 16), parseInt(r, 16), parseInt(n, 16), parseInt(B, 16) / 255) } } if (A.type === u.IDENT_TOKEN) { var s = ce[A.value.toUpperCase()]; if (void 0 !== s) return s } return ce.TRANSPARENT }, Ae = function (A) { return 0 == (255 & A) }, ee = function (A) { var e = 255 & A, t = 255 & A >> 8, r = 255 & A >> 16, n = 255 & A >> 24; return e < 255 ? "rgba(" + n + "," + r + "," + t + "," + e / 255 + ")" : "rgb(" + n + "," + r + "," + t + ")" }, te = function (A, e, t, r) { return (A << 24 | e << 16 | t << 8 | Math.round(255 * r) << 0) >>> 0 }, re = function (A, e) { if (A.type === u.NUMBER_TOKEN) return A.number; if (A.type === u.PERCENTAGE_TOKEN) { var t = 3 === e ? 1 : 255; return 3 === e ? A.number / 100 * t : Math.round(A.number / 100 * t) } return 0 }, ne = function (A) { var e = A.filter(yA); if (3 === e.length) { var t = e.map(re), r = t[0], n = t[1], B = t[2]; return te(r, n, B, 1) } if (4 === e.length) { var s = e.map(re), o = (r = s[0], n = s[1], B = s[2], s[3]); return te(r, n, B, o) } return 0 }; function Be(A, e, t) { return t < 0 && (t += 1), t >= 1 && (t -= 1), t < 1 / 6 ? (e - A) * t * 6 + A : t < .5 ? e : t < 2 / 3 ? 6 * (e - A) * (2 / 3 - t) + A : A } var se, oe, ie = function (A) { var e = A.filter(yA), t = e[0], r = e[1], n = e[2], B = e[3], s = (t.type === u.NUMBER_TOKEN ? jA(t.number) : YA(t)) / (2 * Math.PI), o = VA(r) ? r.number / 100 : 0, i = VA(n) ? n.number / 100 : 0, a = void 0 !== B && VA(B) ? WA(B, 1) : 1; if (0 === o) return te(255 * i, 255 * i, 255 * i, 1); var c = i <= .5 ? i * (o + 1) : i + o - i * o, Q = 2 * i - c, w = Be(Q, c, s + 1 / 3), U = Be(Q, c, s), l = Be(Q, c, s - 1 / 3); return te(255 * w, 255 * U, 255 * l, a) }, ae = { hsl: ie, hsla: ie, rgb: ne, rgba: ne }, ce = { ALICEBLUE: 4042850303, ANTIQUEWHITE: 4209760255, AQUA: 16777215, AQUAMARINE: 2147472639, AZURE: 4043309055, BEIGE: 4126530815, BISQUE: 4293182719, BLACK: 255, BLANCHEDALMOND: 4293643775, BLUE: 65535, BLUEVIOLET: 2318131967, BROWN: 2771004159, BURLYWOOD: 3736635391, CADETBLUE: 1604231423, CHARTREUSE: 2147418367, CHOCOLATE: 3530104575, CORAL: 4286533887, CORNFLOWERBLUE: 1687547391, CORNSILK: 4294499583, CRIMSON: 3692313855, CYAN: 16777215, DARKBLUE: 35839, DARKCYAN: 9145343, DARKGOLDENROD: 3095837695, DARKGRAY: 2846468607, DARKGREEN: 6553855, DARKGREY: 2846468607, DARKKHAKI: 3182914559, DARKMAGENTA: 2332068863, DARKOLIVEGREEN: 1433087999, DARKORANGE: 4287365375, DARKORCHID: 2570243327, DARKRED: 2332033279, DARKSALMON: 3918953215, DARKSEAGREEN: 2411499519, DARKSLATEBLUE: 1211993087, DARKSLATEGRAY: 793726975, DARKSLATEGREY: 793726975, DARKTURQUOISE: 13554175, DARKVIOLET: 2483082239, DEEPPINK: 4279538687, DEEPSKYBLUE: 12582911, DIMGRAY: 1768516095, DIMGREY: 1768516095, DODGERBLUE: 512819199, FIREBRICK: 2988581631, FLORALWHITE: 4294635775, FORESTGREEN: 579543807, FUCHSIA: 4278255615, GAINSBORO: 3705462015, GHOSTWHITE: 4177068031, GOLD: 4292280575, GOLDENROD: 3668254975, GRAY: 2155905279, GREEN: 8388863, GREENYELLOW: 2919182335, GREY: 2155905279, HONEYDEW: 4043305215, HOTPINK: 4285117695, INDIANRED: 3445382399, INDIGO: 1258324735, IVORY: 4294963455, KHAKI: 4041641215, LAVENDER: 3873897215, LAVENDERBLUSH: 4293981695, LAWNGREEN: 2096890111, LEMONCHIFFON: 4294626815, LIGHTBLUE: 2916673279, LIGHTCORAL: 4034953471, LIGHTCYAN: 3774873599, LIGHTGOLDENRODYELLOW: 4210742015, LIGHTGRAY: 3553874943, LIGHTGREEN: 2431553791, LIGHTGREY: 3553874943, LIGHTPINK: 4290167295, LIGHTSALMON: 4288707327, LIGHTSEAGREEN: 548580095, LIGHTSKYBLUE: 2278488831, LIGHTSLATEGRAY: 2005441023, LIGHTSLATEGREY: 2005441023, LIGHTSTEELBLUE: 2965692159, LIGHTYELLOW: 4294959359, LIME: 16711935, LIMEGREEN: 852308735, LINEN: 4210091775, MAGENTA: 4278255615, MAROON: 2147483903, MEDIUMAQUAMARINE: 1724754687, MEDIUMBLUE: 52735, MEDIUMORCHID: 3126187007, MEDIUMPURPLE: 2473647103, MEDIUMSEAGREEN: 1018393087, MEDIUMSLATEBLUE: 2070474495, MEDIUMSPRINGGREEN: 16423679, MEDIUMTURQUOISE: 1221709055, MEDIUMVIOLETRED: 3340076543, MIDNIGHTBLUE: 421097727, MINTCREAM: 4127193855, MISTYROSE: 4293190143, MOCCASIN: 4293178879, NAVAJOWHITE: 4292783615, NAVY: 33023, OLDLACE: 4260751103, OLIVE: 2155872511, OLIVEDRAB: 1804477439, ORANGE: 4289003775, ORANGERED: 4282712319, ORCHID: 3664828159, PALEGOLDENROD: 4008225535, PALEGREEN: 2566625535, PALETURQUOISE: 2951671551, PALEVIOLETRED: 3681588223, PAPAYAWHIP: 4293907967, PEACHPUFF: 4292524543, PERU: 3448061951, PINK: 4290825215, PLUM: 3718307327, POWDERBLUE: 2967529215, PURPLE: 2147516671, REBECCAPURPLE: 1714657791, RED: 4278190335, ROSYBROWN: 3163525119, ROYALBLUE: 1097458175, SADDLEBROWN: 2336560127, SALMON: 4202722047, SANDYBROWN: 4104413439, SEAGREEN: 780883967, SEASHELL: 4294307583, SIENNA: 2689740287, SILVER: 3233857791, SKYBLUE: 2278484991, SLATEBLUE: 1784335871, SLATEGRAY: 1887473919, SLATEGREY: 1887473919, SNOW: 4294638335, SPRINGGREEN: 16744447, STEELBLUE: 1182971135, TAN: 3535047935, TEAL: 8421631, THISTLE: 3636451583, TOMATO: 4284696575, TRANSPARENT: 0, TURQUOISE: 1088475391, VIOLET: 4001558271, WHEAT: 4125012991, WHITE: 4294967295, WHITESMOKE: 4126537215, YELLOW: 4294902015, YELLOWGREEN: 2597139199 }; !function (A) { A[A.VALUE = 0] = "VALUE", A[A.LIST = 1] = "LIST", A[A.IDENT_VALUE = 2] = "IDENT_VALUE", A[A.TYPE_VALUE = 3] = "TYPE_VALUE", A[A.TOKEN_VALUE = 4] = "TOKEN_VALUE" }(se || (se = {})), function (A) { A[A.BORDER_BOX = 0] = "BORDER_BOX", A[A.PADDING_BOX = 1] = "PADDING_BOX", A[A.CONTENT_BOX = 2] = "CONTENT_BOX" }(oe || (oe = {})); var Qe, ue = { name: "background-clip", initialValue: "border-box", prefix: !1, type: se.LIST, parse: function (A) { return A.map(function (A) { if (DA(A)) switch (A.value) { case "padding-box": return oe.PADDING_BOX; case "content-box": return oe.CONTENT_BOX }return oe.BORDER_BOX }) } }, we = { name: "background-color", initialValue: "transparent", prefix: !1, type: se.TYPE_VALUE, format: "color" }, Ue = function (A) { var e = $A(A[0]), t = A[1]; return t && VA(t) ? { color: e, stop: t } : { color: e, stop: null } }, le = function (A, e) { var t = A[0], r = A[A.length - 1]; null === t.stop && (t.stop = XA), null === r.stop && (r.stop = GA); for (var n = [], B = 0, s = 0; s < A.length; s++) { var o = A[s].stop; if (null !== o) { var i = WA(o, e); i > B ? n.push(i) : n.push(B), B = i } else n.push(null) } var a = null; for (s = 0; s < n.length; s++) { var c = n[s]; if (null === c) null === a && (a = s); else if (null !== a) { for (var Q = s - a, u = (c - n[a - 1]) / (Q + 1), w = 1; w <= Q; w++)n[a + w - 1] = u * w; a = null } } return A.map(function (A, t) { return { color: A.color, stop: Math.max(Math.min(1, n[t] / e), 0) } }) }, Ce = function (A, e, t) { var r = "number" == typeof A ? A : function (A, e, t) { var r = e / 2, n = t / 2, B = WA(A[0], e) - r, s = n - WA(A[1], t); return (Math.atan2(s, B) + 2 * Math.PI) % (2 * Math.PI) }(A, e, t), n = Math.abs(e * Math.sin(r)) + Math.abs(t * Math.cos(r)), B = e / 2, s = t / 2, o = n / 2, i = Math.sin(r - Math.PI / 2) * o, a = Math.cos(r - Math.PI / 2) * o; return [n, B - a, B + a, s - i, s + i] }, ge = function (A, e) { return Math.sqrt(A * A + e * e) }, Ee = function (A, e, t, r, n) { return [[0, 0], [0, e], [A, 0], [A, e]].reduce(function (A, e) { var B = e[0], s = e[1], o = ge(t - B, r - s); return (n ? o < A.optimumDistance : o > A.optimumDistance) ? { optimumCorner: e, optimumDistance: o } : A }, { optimumDistance: n ? 1 / 0 : -1 / 0, optimumCorner: null }).optimumCorner }, Fe = function (A) { var e = jA(180), t = []; return _A(A).forEach(function (A, r) { if (0 === r) { var n = A[0]; if (n.type === u.IDENT_TOKEN && -1 !== ["top", "left", "right", "bottom"].indexOf(n.value)) return void (e = ZA(A)); if (qA(n)) return void (e = (YA(n) + jA(270)) % jA(360)) } var B = Ue(A); t.push(B) }), { angle: e, stops: t, type: Qe.LINEAR_GRADIENT } }, he = function (A) { return 0 === A[0] && 255 === A[1] && 0 === A[2] && 255 === A[3] }, He = function (A, e, t, r, n) { var B = "http://www.w3.org/2000/svg", s = document.createElementNS(B, "svg"), o = document.createElementNS(B, "foreignObject"); return s.setAttributeNS(null, "width", A.toString()), s.setAttributeNS(null, "height", e.toString()), o.setAttributeNS(null, "width", "100%"), o.setAttributeNS(null, "height", "100%"), o.setAttributeNS(null, "x", t.toString()), o.setAttributeNS(null, "y", r.toString()), o.setAttributeNS(null, "externalResourcesRequired", "true"), s.appendChild(o), o.appendChild(n), s }, de = function (A) { return new Promise(function (e, t) { var r = new Image; r.onload = function () { return e(r) }, r.onerror = t, r.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent((new XMLSerializer).serializeToString(A)) }) }, fe = { get SUPPORT_RANGE_BOUNDS() { var A = function (A) { if (A.createRange) { var e = A.createRange(); if (e.getBoundingClientRect) { var t = A.createElement("boundtest"); t.style.height = "123px", t.style.display = "block", A.body.appendChild(t), e.selectNode(t); var r = e.getBoundingClientRect(), n = Math.round(r.height); if (A.body.removeChild(t), 123 === n) return !0 } } return !1 }(document); return Object.defineProperty(fe, "SUPPORT_RANGE_BOUNDS", { value: A }), A }, get SUPPORT_SVG_DRAWING() { var A = function (A) { var e = new Image, t = A.createElement("canvas"), r = t.getContext("2d"); if (!r) return !1; e.src = "data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>"; try { r.drawImage(e, 0, 0), t.toDataURL() } catch (A) { return !1 } return !0 }(document); return Object.defineProperty(fe, "SUPPORT_SVG_DRAWING", { value: A }), A }, get SUPPORT_FOREIGNOBJECT_DRAWING() { var A = "function" == typeof Array.from && "function" == typeof window.fetch ? function (A) { var e = A.createElement("canvas"); e.width = 100, e.height = 100; var t = e.getContext("2d"); if (!t) return Promise.reject(!1); t.fillStyle = "rgb(0, 255, 0)", t.fillRect(0, 0, 100, 100); var r = new Image, n = e.toDataURL(); r.src = n; var B = He(100, 100, 0, 0, r); return t.fillStyle = "red", t.fillRect(0, 0, 100, 100), de(B).then(function (e) { t.drawImage(e, 0, 0); var r = t.getImageData(0, 0, 100, 100).data; t.fillStyle = "red", t.fillRect(0, 0, 100, 100); var B = A.createElement("div"); return B.style.backgroundImage = "url(" + n + ")", B.style.height = "100px", he(r) ? de(He(100, 100, 0, 0, B)) : Promise.reject(!1) }).then(function (A) { return t.drawImage(A, 0, 0), he(t.getImageData(0, 0, 100, 100).data) }).catch(function () { return !1 }) }(document) : Promise.resolve(!1); return Object.defineProperty(fe, "SUPPORT_FOREIGNOBJECT_DRAWING", { value: A }), A }, get SUPPORT_CORS_IMAGES() { var A = void 0 !== (new Image).crossOrigin; return Object.defineProperty(fe, "SUPPORT_CORS_IMAGES", { value: A }), A }, get SUPPORT_RESPONSE_TYPE() { var A = "string" == typeof (new XMLHttpRequest).responseType; return Object.defineProperty(fe, "SUPPORT_RESPONSE_TYPE", { value: A }), A }, get SUPPORT_CORS_XHR() { var A = "withCredentials" in new XMLHttpRequest; return Object.defineProperty(fe, "SUPPORT_CORS_XHR", { value: A }), A } }, pe = function () { function A(A) { var e = A.id, t = A.enabled; this.id = e, this.enabled = t, this.start = Date.now() } return A.prototype.debug = function () { for (var A = [], e = 0; e < arguments.length; e++)A[e] = arguments[e]; this.enabled && ("undefined" != typeof window && window.console && "function" == typeof console.debug ? console.debug.apply(console, [this.id, this.getTime() + "ms"].concat(A)) : this.info.apply(this, A)) }, A.prototype.getTime = function () { return Date.now() - this.start }, A.create = function (e) { A.instances[e.id] = new A(e) }, A.destroy = function (e) { delete A.instances[e] }, A.getInstance = function (e) { var t = A.instances[e]; if (void 0 === t) throw new Error("No logger instance found with id " + e); return t }, A.prototype.info = function () { for (var A = [], e = 0; e < arguments.length; e++)A[e] = arguments[e]; this.enabled && "undefined" != typeof window && window.console && "function" == typeof console.info && console.info.apply(console, [this.id, this.getTime() + "ms"].concat(A)) }, A.prototype.error = function () { for (var A = [], e = 0; e < arguments.length; e++)A[e] = arguments[e]; this.enabled && ("undefined" != typeof window && window.console && "function" == typeof console.error ? console.error.apply(console, [this.id, this.getTime() + "ms"].concat(A)) : this.info.apply(this, A)) }, A.instances = {}, A }(), Ne = function () { function A() { } return A.create = function (e, t) { return A._caches[e] = new Ke(e, t) }, A.destroy = function (e) { delete A._caches[e] }, A.open = function (e) { var t = A._caches[e]; if (void 0 !== t) return t; throw new Error('Cache with key "' + e + '" not found') }, A.getOrigin = function (e) { var t = A._link; return t ? (t.href = e, t.href = t.href, t.protocol + t.hostname + t.port) : "about:blank" }, A.isSameOrigin = function (e) { return A.getOrigin(e) === A._origin }, A.setContext = function (e) { A._link = e.document.createElement("a"), A._origin = A.getOrigin(e.location.href) }, A.getInstance = function () { var e = A._current; if (null === e) throw new Error("No cache instance attached"); return e }, A.attachInstance = function (e) { A._current = e }, A.detachInstance = function () { A._current = null }, A._caches = {}, A._origin = "about:blank", A._current = null, A }(), Ke = function () { function A(A, e) { this.id = A, this._options = e, this._cache = {} } return A.prototype.addImage = function (A) { var e = Promise.resolve(); return this.has(A) ? e : ve(A) || Re(A) ? (this._cache[A] = this.loadImage(A), e) : e }, A.prototype.match = function (A) { return this._cache[A] }, A.prototype.loadImage = function (A) { return r(this, void 0, void 0, function () { var e, t, r, B, s = this; return n(this, function (n) { switch (n.label) { case 0: return e = Ne.isSameOrigin(A), t = !Le(A) && !0 === this._options.useCORS && fe.SUPPORT_CORS_IMAGES && !e, r = !Le(A) && !e && "string" == typeof this._options.proxy && fe.SUPPORT_CORS_XHR && !t, e || !1 !== this._options.allowTaint || Le(A) || r || t ? (B = A, r ? [4, this.proxy(B)] : [3, 2]) : [2]; case 1: B = n.sent(), n.label = 2; case 2: return pe.getInstance(this.id).debug("Added image " + A.substring(0, 256)), [4, new Promise(function (A, e) { var r = new Image; r.onload = function () { return A(r) }, r.onerror = e, (Oe(B) || t) && (r.crossOrigin = "anonymous"), r.src = B, !0 === r.complete && setTimeout(function () { return A(r) }, 500), s._options.imageTimeout > 0 && setTimeout(function () { return e("Timed out (" + s._options.imageTimeout + "ms) loading image") }, s._options.imageTimeout) })]; case 3: return [2, n.sent()] } }) }) }, A.prototype.has = function (A) { return void 0 !== this._cache[A] }, A.prototype.keys = function () { return Promise.resolve(Object.keys(this._cache)) }, A.prototype.proxy = function (A) { var e = this, t = this._options.proxy; if (!t) throw new Error("No proxy defined"); var r = A.substring(0, 256); return new Promise(function (n, B) { var s = fe.SUPPORT_RESPONSE_TYPE ? "blob" : "text", o = new XMLHttpRequest; if (o.onload = function () { if (200 === o.status) if ("text" === s) n(o.response); else { var A = new FileReader; A.addEventListener("load", function () { return n(A.result) }, !1), A.addEventListener("error", function (A) { return B(A) }, !1), A.readAsDataURL(o.response) } else B("Failed to proxy resource " + r + " with status code " + o.status) }, o.onerror = B, o.open("GET", t + "?url=" + encodeURIComponent(A) + "&responseType=" + s), "text" !== s && o instanceof XMLHttpRequest && (o.responseType = s), e._options.imageTimeout) { var i = e._options.imageTimeout; o.timeout = i, o.ontimeout = function () { return B("Timed out (" + i + "ms) proxying " + r) } } o.send() }) }, A }(), Ie = /^data:image\/svg\+xml/i, Te = /^data:image\/.*;base64,/i, me = /^data:image\/.*/i, Re = function (A) { return fe.SUPPORT_SVG_DRAWING || !De(A) }, Le = function (A) { return me.test(A) }, Oe = function (A) { return Te.test(A) }, ve = function (A) { return "blob" === A.substr(0, 4) }, De = function (A) { return "svg" === A.substr(-3).toLowerCase() || Ie.test(A) }, be = function (A) { var e = Se.CIRCLE, t = Me.FARTHEST_CORNER, r = [], n = []; return _A(A).forEach(function (A, B) { var s = !0; if (0 === B ? s = A.reduce(function (A, e) { if (DA(e)) switch (e.value) { case "center": return n.push(JA), !1; case "top": case "left": return n.push(XA), !1; case "right": case "bottom": return n.push(GA), !1 } else if (VA(e) || xA(e)) return n.push(e), !1; return A }, s) : 1 === B && (s = A.reduce(function (A, r) { if (DA(r)) switch (r.value) { case "circle": return e = Se.CIRCLE, !1; case "ellipse": return e = Se.ELLIPSE, !1; case "contain": case "closest-side": return t = Me.CLOSEST_SIDE, !1; case "farthest-side": return t = Me.FARTHEST_SIDE, !1; case "closest-corner": return t = Me.CLOSEST_CORNER, !1; case "cover": case "farthest-corner": return t = Me.FARTHEST_CORNER, !1 } else if (xA(r) || VA(r)) return Array.isArray(t) || (t = []), t.push(r), !1; return A }, s)), s) { var o = Ue(A); r.push(o) } }), { size: t, shape: e, stops: r, position: n, type: Qe.RADIAL_GRADIENT } }; !function (A) { A[A.URL = 0] = "URL", A[A.LINEAR_GRADIENT = 1] = "LINEAR_GRADIENT", A[A.RADIAL_GRADIENT = 2] = "RADIAL_GRADIENT" }(Qe || (Qe = {})); var Se, Me; !function (A) { A[A.CIRCLE = 0] = "CIRCLE", A[A.ELLIPSE = 1] = "ELLIPSE" }(Se || (Se = {})), function (A) { A[A.CLOSEST_SIDE = 0] = "CLOSEST_SIDE", A[A.FARTHEST_SIDE = 1] = "FARTHEST_SIDE", A[A.CLOSEST_CORNER = 2] = "CLOSEST_CORNER", A[A.FARTHEST_CORNER = 3] = "FARTHEST_CORNER" }(Me || (Me = {})); var ye = function (A) { if (A.type === u.URL_TOKEN) { var e = { url: A.value, type: Qe.URL }; return Ne.getInstance().addImage(A.value), e } if (A.type === u.FUNCTION) { var t = Pe[A.name]; if (void 0 === t) throw new Error('Attempting to parse an unsupported image function "' + A.name + '"'); return t(A.values) } throw new Error("Unsupported image type") }; var _e, Pe = { "linear-gradient": function (A) { var e = jA(180), t = []; return _A(A).forEach(function (A, r) { if (0 === r) { var n = A[0]; if (n.type === u.IDENT_TOKEN && "to" === n.value) return void (e = ZA(A)); if (qA(n)) return void (e = YA(n)) } var B = Ue(A); t.push(B) }), { angle: e, stops: t, type: Qe.LINEAR_GRADIENT } }, "-moz-linear-gradient": Fe, "-ms-linear-gradient": Fe, "-o-linear-gradient": Fe, "-webkit-linear-gradient": Fe, "radial-gradient": function (A) { var e = Se.CIRCLE, t = Me.FARTHEST_CORNER, r = [], n = []; return _A(A).forEach(function (A, B) { var s = !0; if (0 === B) { var o = !1; s = A.reduce(function (A, r) { if (o) if (DA(r)) switch (r.value) { case "center": return n.push(JA), A; case "top": case "left": return n.push(XA), A; case "right": case "bottom": return n.push(GA), A } else (VA(r) || xA(r)) && n.push(r); else if (DA(r)) switch (r.value) { case "circle": return e = Se.CIRCLE, !1; case "ellipse": return e = Se.ELLIPSE, !1; case "at": return o = !0, !1; case "closest-side": return t = Me.CLOSEST_SIDE, !1; case "cover": case "farthest-side": return t = Me.FARTHEST_SIDE, !1; case "contain": case "closest-corner": return t = Me.CLOSEST_CORNER, !1; case "farthest-corner": return t = Me.FARTHEST_CORNER, !1 } else if (xA(r) || VA(r)) return Array.isArray(t) || (t = []), t.push(r), !1; return A }, s) } if (s) { var i = Ue(A); r.push(i) } }), { size: t, shape: e, stops: r, position: n, type: Qe.RADIAL_GRADIENT } }, "-moz-radial-gradient": be, "-ms-radial-gradient": be, "-o-radial-gradient": be, "-webkit-radial-gradient": be, "-webkit-gradient": function (A) { var e = jA(180), t = [], r = Qe.LINEAR_GRADIENT, n = Se.CIRCLE, B = Me.FARTHEST_CORNER; return _A(A).forEach(function (A, e) { var n = A[0]; if (0 === e) { if (DA(n) && "linear" === n.value) return void (r = Qe.LINEAR_GRADIENT); if (DA(n) && "radial" === n.value) return void (r = Qe.RADIAL_GRADIENT) } if (n.type === u.FUNCTION) if ("from" === n.name) { var B = $A(n.values[0]); t.push({ stop: XA, color: B }) } else if ("to" === n.name) B = $A(n.values[0]), t.push({ stop: GA, color: B }); else if ("color-stop" === n.name) { var s = n.values.filter(yA); if (2 === s.length) { B = $A(s[1]); var o = s[0]; vA(o) && t.push({ stop: { type: u.PERCENTAGE_TOKEN, number: 100 * o.number, flags: o.flags }, color: B }) } } }), r === Qe.LINEAR_GRADIENT ? { angle: (e + jA(180)) % jA(360), stops: t, type: r } : { size: B, shape: n, stops: t, position: [], type: r } } }, xe = { name: "background-image", initialValue: "none", type: se.LIST, prefix: !1, parse: function (A) { if (0 === A.length) return []; var e = A[0]; return e.type === u.IDENT_TOKEN && "none" === e.value ? [] : A.filter(function (A) { return yA(A) && function (A) { return A.type !== u.FUNCTION || Pe[A.name] }(A) }).map(ye) } }, Ve = { name: "background-origin", initialValue: "border-box", prefix: !1, type: se.LIST, parse: function (A) { return A.map(function (A) { if (DA(A)) switch (A.value) { case "padding-box": return 1; case "content-box": return 2 }return 0 }) } }, ze = { name: "background-position", initialValue: "0% 0%", type: se.LIST, prefix: !1, parse: function (A) { return _A(A).map(function (A) { return A.filter(VA) }).map(zA) } }; !function (A) { A[A.REPEAT = 0] = "REPEAT", A[A.NO_REPEAT = 1] = "NO_REPEAT", A[A.REPEAT_X = 2] = "REPEAT_X", A[A.REPEAT_Y = 3] = "REPEAT_Y" }(_e || (_e = {})); var Xe, Je = { name: "background-repeat", initialValue: "repeat", prefix: !1, type: se.LIST, parse: function (A) { return _A(A).map(function (A) { return A.filter(DA).map(function (A) { return A.value }).join(" ") }).map(Ge) } }, Ge = function (A) { switch (A) { case "no-repeat": return _e.NO_REPEAT; case "repeat-x": case "repeat no-repeat": return _e.REPEAT_X; case "repeat-y": case "no-repeat repeat": return _e.REPEAT_Y; case "repeat": default: return _e.REPEAT } }; !function (A) { A.AUTO = "auto", A.CONTAIN = "contain", A.COVER = "cover" }(Xe || (Xe = {})); var ke, We = { name: "background-size", initialValue: "0", prefix: !1, type: se.LIST, parse: function (A) { return _A(A).map(function (A) { return A.filter(Ye) }) } }, Ye = function (A) { return DA(A) || VA(A) }, qe = function (A) { return { name: "border-" + A + "-color", initialValue: "transparent", prefix: !1, type: se.TYPE_VALUE, format: "color" } }, Ze = qe("top"), je = qe("right"), $e = qe("bottom"), At = qe("left"), et = function (A) { return { name: "border-radius-" + A, initialValue: "0 0", prefix: !1, type: se.LIST, parse: function (A) { return zA(A.filter(VA)) } } }, tt = et("top-left"), rt = et("top-right"), nt = et("bottom-right"), Bt = et("bottom-left"); !function (A) { A[A.NONE = 0] = "NONE", A[A.SOLID = 1] = "SOLID" }(ke || (ke = {})); var st, ot = function (A) { return { name: "border-" + A + "-style", initialValue: "solid", prefix: !1, type: se.IDENT_VALUE, parse: function (A) { switch (A) { case "none": return ke.NONE }return ke.SOLID } } }, it = ot("top"), at = ot("right"), ct = ot("bottom"), Qt = ot("left"), ut = function (A) { return { name: "border-" + A + "-width", initialValue: "0", type: se.VALUE, prefix: !1, parse: function (A) { return OA(A) ? A.number : 0 } } }, wt = ut("top"), Ut = ut("right"), lt = ut("bottom"), Ct = ut("left"), gt = { name: "color", initialValue: "transparent", prefix: !1, type: se.TYPE_VALUE, format: "color" }, Et = { name: "display", initialValue: "inline-block", prefix: !1, type: se.LIST, parse: function (A) { return A.filter(DA).reduce(function (A, e) { return A | Ft(e.value) }, 0) } }, Ft = function (A) { switch (A) { case "block": return 2; case "inline": return 4; case "run-in": return 8; case "flow": return 16; case "flow-root": return 32; case "table": return 64; case "flex": case "-webkit-flex": return 128; case "grid": case "-ms-grid": return 256; case "ruby": return 512; case "subgrid": return 1024; case "list-item": return 2048; case "table-row-group": return 4096; case "table-header-group": return 8192; case "table-footer-group": return 16384; case "table-row": return 32768; case "table-cell": return 65536; case "table-column-group": return 131072; case "table-column": return 262144; case "table-caption": return 524288; case "ruby-base": return 1048576; case "ruby-text": return 2097152; case "ruby-base-container": return 4194304; case "ruby-text-container": return 8388608; case "contents": return 16777216; case "inline-block": return 33554432; case "inline-list-item": return 67108864; case "inline-table": return 134217728; case "inline-flex": return 268435456; case "inline-grid": return 536870912 }return 0 }; !function (A) { A[A.NONE = 0] = "NONE", A[A.LEFT = 1] = "LEFT", A[A.RIGHT = 2] = "RIGHT", A[A.INLINE_START = 3] = "INLINE_START", A[A.INLINE_END = 4] = "INLINE_END" }(st || (st = {})); var ht, Ht = { name: "float", initialValue: "none", prefix: !1, type: se.IDENT_VALUE, parse: function (A) { switch (A) { case "left": return st.LEFT; case "right": return st.RIGHT; case "inline-start": return st.INLINE_START; case "inline-end": return st.INLINE_END }return st.NONE } }, dt = { name: "letter-spacing", initialValue: "0", prefix: !1, type: se.VALUE, parse: function (A) { return A.type === u.IDENT_TOKEN && "normal" === A.value ? 0 : A.type === u.NUMBER_TOKEN ? A.number : A.type === u.DIMENSION_TOKEN ? A.number : 0 } }; !function (A) { A.NORMAL = "normal", A.STRICT = "strict" }(ht || (ht = {})); var ft, pt = { name: "line-break", initialValue: "normal", prefix: !1, type: se.IDENT_VALUE, parse: function (A) { switch (A) { case "strict": return ht.STRICT; case "normal": default: return ht.NORMAL } } }, Nt = { name: "line-height", initialValue: "normal", prefix: !1, type: se.TOKEN_VALUE }, Kt = { name: "list-style-image", initialValue: "none", type: se.VALUE, prefix: !1, parse: function (A) { return A.type === u.IDENT_TOKEN && "none" === A.value ? null : ye(A) } }; !function (A) { A[A.INSIDE = 0] = "INSIDE", A[A.OUTSIDE = 1] = "OUTSIDE" }(ft || (ft = {})); var It, Tt = { name: "list-style-position", initialValue: "outside", prefix: !1, type: se.IDENT_VALUE, parse: function (A) { switch (A) { case "inside": return ft.INSIDE; case "outside": default: return ft.OUTSIDE } } }; !function (A) { A[A.NONE = -1] = "NONE", A[A.DISC = 0] = "DISC", A[A.CIRCLE = 1] = "CIRCLE", A[A.SQUARE = 2] = "SQUARE", A[A.DECIMAL = 3] = "DECIMAL", A[A.CJK_DECIMAL = 4] = "CJK_DECIMAL", A[A.DECIMAL_LEADING_ZERO = 5] = "DECIMAL_LEADING_ZERO", A[A.LOWER_ROMAN = 6] = "LOWER_ROMAN", A[A.UPPER_ROMAN = 7] = "UPPER_ROMAN", A[A.LOWER_GREEK = 8] = "LOWER_GREEK", A[A.LOWER_ALPHA = 9] = "LOWER_ALPHA", A[A.UPPER_ALPHA = 10] = "UPPER_ALPHA", A[A.ARABIC_INDIC = 11] = "ARABIC_INDIC", A[A.ARMENIAN = 12] = "ARMENIAN", A[A.BENGALI = 13] = "BENGALI", A[A.CAMBODIAN = 14] = "CAMBODIAN", A[A.CJK_EARTHLY_BRANCH = 15] = "CJK_EARTHLY_BRANCH", A[A.CJK_HEAVENLY_STEM = 16] = "CJK_HEAVENLY_STEM", A[A.CJK_IDEOGRAPHIC = 17] = "CJK_IDEOGRAPHIC", A[A.DEVANAGARI = 18] = "DEVANAGARI", A[A.ETHIOPIC_NUMERIC = 19] = "ETHIOPIC_NUMERIC", A[A.GEORGIAN = 20] = "GEORGIAN", A[A.GUJARATI = 21] = "GUJARATI", A[A.GURMUKHI = 22] = "GURMUKHI", A[A.HEBREW = 22] = "HEBREW", A[A.HIRAGANA = 23] = "HIRAGANA", A[A.HIRAGANA_IROHA = 24] = "HIRAGANA_IROHA", A[A.JAPANESE_FORMAL = 25] = "JAPANESE_FORMAL", A[A.JAPANESE_INFORMAL = 26] = "JAPANESE_INFORMAL", A[A.KANNADA = 27] = "KANNADA", A[A.KATAKANA = 28] = "KATAKANA", A[A.KATAKANA_IROHA = 29] = "KATAKANA_IROHA", A[A.KHMER = 30] = "KHMER", A[A.KOREAN_HANGUL_FORMAL = 31] = "KOREAN_HANGUL_FORMAL", A[A.KOREAN_HANJA_FORMAL = 32] = "KOREAN_HANJA_FORMAL", A[A.KOREAN_HANJA_INFORMAL = 33] = "KOREAN_HANJA_INFORMAL", A[A.LAO = 34] = "LAO", A[A.LOWER_ARMENIAN = 35] = "LOWER_ARMENIAN", A[A.MALAYALAM = 36] = "MALAYALAM", A[A.MONGOLIAN = 37] = "MONGOLIAN", A[A.MYANMAR = 38] = "MYANMAR", A[A.ORIYA = 39] = "ORIYA", A[A.PERSIAN = 40] = "PERSIAN", A[A.SIMP_CHINESE_FORMAL = 41] = "SIMP_CHINESE_FORMAL", A[A.SIMP_CHINESE_INFORMAL = 42] = "SIMP_CHINESE_INFORMAL", A[A.TAMIL = 43] = "TAMIL", A[A.TELUGU = 44] = "TELUGU", A[A.THAI = 45] = "THAI", A[A.TIBETAN = 46] = "TIBETAN", A[A.TRAD_CHINESE_FORMAL = 47] = "TRAD_CHINESE_FORMAL", A[A.TRAD_CHINESE_INFORMAL = 48] = "TRAD_CHINESE_INFORMAL", A[A.UPPER_ARMENIAN = 49] = "UPPER_ARMENIAN", A[A.DISCLOSURE_OPEN = 50] = "DISCLOSURE_OPEN", A[A.DISCLOSURE_CLOSED = 51] = "DISCLOSURE_CLOSED" }(It || (It = {})); var mt, Rt = { name: "list-style-type", initialValue: "none", prefix: !1, type: se.IDENT_VALUE, parse: function (A) { switch (A) { case "disc": return It.DISC; case "circle": return It.CIRCLE; case "square": return It.SQUARE; case "decimal": return It.DECIMAL; case "cjk-decimal": return It.CJK_DECIMAL; case "decimal-leading-zero": return It.DECIMAL_LEADING_ZERO; case "lower-roman": return It.LOWER_ROMAN; case "upper-roman": return It.UPPER_ROMAN; case "lower-greek": return It.LOWER_GREEK; case "lower-alpha": return It.LOWER_ALPHA; case "upper-alpha": return It.UPPER_ALPHA; case "arabic-indic": return It.ARABIC_INDIC; case "armenian": return It.ARMENIAN; case "bengali": return It.BENGALI; case "cambodian": return It.CAMBODIAN; case "cjk-earthly-branch": return It.CJK_EARTHLY_BRANCH; case "cjk-heavenly-stem": return It.CJK_HEAVENLY_STEM; case "cjk-ideographic": return It.CJK_IDEOGRAPHIC; case "devanagari": return It.DEVANAGARI; case "ethiopic-numeric": return It.ETHIOPIC_NUMERIC; case "georgian": return It.GEORGIAN; case "gujarati": return It.GUJARATI; case "gurmukhi": return It.GURMUKHI; case "hebrew": return It.HEBREW; case "hiragana": return It.HIRAGANA; case "hiragana-iroha": return It.HIRAGANA_IROHA; case "japanese-formal": return It.JAPANESE_FORMAL; case "japanese-informal": return It.JAPANESE_INFORMAL; case "kannada": return It.KANNADA; case "katakana": return It.KATAKANA; case "katakana-iroha": return It.KATAKANA_IROHA; case "khmer": return It.KHMER; case "korean-hangul-formal": return It.KOREAN_HANGUL_FORMAL; case "korean-hanja-formal": return It.KOREAN_HANJA_FORMAL; case "korean-hanja-informal": return It.KOREAN_HANJA_INFORMAL; case "lao": return It.LAO; case "lower-armenian": return It.LOWER_ARMENIAN; case "malayalam": return It.MALAYALAM; case "mongolian": return It.MONGOLIAN; case "myanmar": return It.MYANMAR; case "oriya": return It.ORIYA; case "persian": return It.PERSIAN; case "simp-chinese-formal": return It.SIMP_CHINESE_FORMAL; case "simp-chinese-informal": return It.SIMP_CHINESE_INFORMAL; case "tamil": return It.TAMIL; case "telugu": return It.TELUGU; case "thai": return It.THAI; case "tibetan": return It.TIBETAN; case "trad-chinese-formal": return It.TRAD_CHINESE_FORMAL; case "trad-chinese-informal": return It.TRAD_CHINESE_INFORMAL; case "upper-armenian": return It.UPPER_ARMENIAN; case "disclosure-open": return It.DISCLOSURE_OPEN; case "disclosure-closed": return It.DISCLOSURE_CLOSED; case "none": default: return It.NONE } } }, Lt = function (A) { return { name: "margin-" + A, initialValue: "0", prefix: !1, type: se.TOKEN_VALUE } }, Ot = Lt("top"), vt = Lt("right"), Dt = Lt("bottom"), bt = Lt("left"); !function (A) { A[A.VISIBLE = 0] = "VISIBLE", A[A.HIDDEN = 1] = "HIDDEN", A[A.SCROLL = 2] = "SCROLL", A[A.AUTO = 3] = "AUTO" }(mt || (mt = {})); var St, Mt = { name: "overflow", initialValue: "visible", prefix: !1, type: se.LIST, parse: function (A) { return A.filter(DA).map(function (A) { switch (A.value) { case "hidden": return mt.HIDDEN; case "scroll": return mt.SCROLL; case "auto": return mt.AUTO; case "visible": default: return mt.VISIBLE } }) } }; !function (A) { A.NORMAL = "normal", A.BREAK_WORD = "break-word" }(St || (St = {})); var yt, _t = { name: "overflow-wrap", initialValue: "normal", prefix: !1, type: se.IDENT_VALUE, parse: function (A) { switch (A) { case "break-word": return St.BREAK_WORD; case "normal": default: return St.NORMAL } } }, Pt = function (A) { return { name: "padding-" + A, initialValue: "0", prefix: !1, type: se.TYPE_VALUE, format: "length-percentage" } }, xt = Pt("top"), Vt = Pt("right"), zt = Pt("bottom"), Xt = Pt("left"); !function (A) { A[A.LEFT = 0] = "LEFT", A[A.CENTER = 1] = "CENTER", A[A.RIGHT = 2] = "RIGHT" }(yt || (yt = {})); var Jt, Gt = { name: "text-align", initialValue: "left", prefix: !1, type: se.IDENT_VALUE, parse: function (A) { switch (A) { case "right": return yt.RIGHT; case "center": case "justify": return yt.CENTER; case "left": default: return yt.LEFT } } }; !function (A) { A[A.STATIC = 0] = "STATIC", A[A.RELATIVE = 1] = "RELATIVE", A[A.ABSOLUTE = 2] = "ABSOLUTE", A[A.FIXED = 3] = "FIXED", A[A.STICKY = 4] = "STICKY" }(Jt || (Jt = {})); var kt, Wt = { name: "position", initialValue: "static", prefix: !1, type: se.IDENT_VALUE, parse: function (A) { switch (A) { case "relative": return Jt.RELATIVE; case "absolute": return Jt.ABSOLUTE; case "fixed": return Jt.FIXED; case "sticky": return Jt.STICKY }return Jt.STATIC } }, Yt = { name: "text-shadow", initialValue: "none", type: se.LIST, prefix: !1, parse: function (A) { return 1 === A.length && SA(A[0], "none") ? [] : _A(A).map(function (A) { for (var e = { color: ce.TRANSPARENT, offsetX: XA, offsetY: XA, blur: XA }, t = 0, r = 0; r < A.length; r++) { var n = A[r]; xA(n) ? (0 === t ? e.offsetX = n : 1 === t ? e.offsetY = n : e.blur = n, t++) : e.color = $A(n) } return e }) } }; !function (A) { A[A.NONE = 0] = "NONE", A[A.LOWERCASE = 1] = "LOWERCASE", A[A.UPPERCASE = 2] = "UPPERCASE", A[A.CAPITALIZE = 3] = "CAPITALIZE" }(kt || (kt = {})); var qt, Zt = { name: "text-transform", initialValue: "none", prefix: !1, type: se.IDENT_VALUE, parse: function (A) { switch (A) { case "uppercase": return kt.UPPERCASE; case "lowercase": return kt.LOWERCASE; case "capitalize": return kt.CAPITALIZE }return kt.NONE } }, jt = { name: "transform", initialValue: "none", prefix: !0, type: se.VALUE, parse: function (A) { if (A.type === u.IDENT_TOKEN && "none" === A.value) return null; if (A.type === u.FUNCTION) { var e = $t[A.name]; if (void 0 === e) throw new Error('Attempting to parse an unsupported transform function "' + A.name + '"'); return e(A.values) } return null } }, $t = { matrix: function (A) { var e = A.filter(function (A) { return A.type === u.NUMBER_TOKEN }).map(function (A) { return A.number }); return 6 === e.length ? e : null }, matrix3d: function (A) { var e = A.filter(function (A) { return A.type === u.NUMBER_TOKEN }).map(function (A) { return A.number }), t = e[0], r = e[1], n = (e[2], e[3], e[4]), B = e[5], s = (e[6], e[7], e[8], e[9], e[10], e[11], e[12]), o = e[13]; e[14], e[15]; return 16 === e.length ? [t, r, n, B, s, o] : null } }, Ar = { type: u.PERCENTAGE_TOKEN, number: 50, flags: 4 }, er = [Ar, Ar], tr = { name: "transform-origin", initialValue: "50% 50%", prefix: !0, type: se.LIST, parse: function (A) { var e = A.filter(VA); return 2 !== e.length ? er : [e[0], e[1]] } }; !function (A) { A[A.VISIBLE = 0] = "VISIBLE", A[A.HIDDEN = 1] = "HIDDEN", A[A.COLLAPSE = 2] = "COLLAPSE" }(qt || (qt = {})); var rr, nr = { name: "visible", initialValue: "none", prefix: !1, type: se.IDENT_VALUE, parse: function (A) { switch (A) { case "hidden": return qt.HIDDEN; case "collapse": return qt.COLLAPSE; case "visible": default: return qt.VISIBLE } } }; !function (A) { A.NORMAL = "normal", A.BREAK_ALL = "break-all", A.KEEP_ALL = "keep-all" }(rr || (rr = {})); var Br, sr = { name: "word-break", initialValue: "normal", prefix: !1, type: se.IDENT_VALUE, parse: function (A) { switch (A) { case "break-all": return rr.BREAK_ALL; case "keep-all": return rr.KEEP_ALL; case "normal": default: return rr.NORMAL } } }, or = { name: "z-index", initialValue: "auto", prefix: !1, type: se.VALUE, parse: function (A) { if (A.type === u.IDENT_TOKEN) return { auto: !0, order: 0 }; if (vA(A)) return { auto: !1, order: A.number }; throw new Error("Invalid z-index number parsed") } }, ir = { name: "opacity", initialValue: "1", type: se.VALUE, prefix: !1, parse: function (A) { return vA(A) ? A.number : 1 } }, ar = { name: "text-decoration-color", initialValue: "transparent", prefix: !1, type: se.TYPE_VALUE, format: "color" }, cr = { name: "text-decoration-line", initialValue: "none", prefix: !1, type: se.LIST, parse: function (A) { return A.filter(DA).map(function (A) { switch (A.value) { case "underline": return 1; case "overline": return 2; case "line-through": return 3; case "none": return 4 }return 0 }).filter(function (A) { return 0 !== A }) } }, Qr = { name: "font-family", initialValue: "", prefix: !1, type: se.LIST, parse: function (A) { var e = [], t = []; return A.forEach(function (A) { switch (A.type) { case u.IDENT_TOKEN: case u.STRING_TOKEN: e.push(A.value); break; case u.NUMBER_TOKEN: e.push(A.number.toString()); break; case u.COMMA_TOKEN: t.push(e.join(" ")), e.length = 0 } }), e.length && t.push(e.join(" ")), t.map(function (A) { return -1 === A.indexOf(" ") ? A : "'" + A + "'" }) } }, ur = { name: "font-size", initialValue: "0", prefix: !1, type: se.TYPE_VALUE, format: "length" }, wr = { name: "font-weight", initialValue: "normal", type: se.VALUE, prefix: !1, parse: function (A) { if (vA(A)) return A.number; if (DA(A)) switch (A.value) { case "bold": return 700; case "normal": default: return 400 }return 400 } }, Ur = { name: "font-variant", initialValue: "none", type: se.LIST, prefix: !1, parse: function (A) { return A.filter(DA).map(function (A) { return A.value }) } }; !function (A) { A.NORMAL = "normal", A.ITALIC = "italic", A.OBLIQUE = "oblique" }(Br || (Br = {})); var lr, Cr = { name: "font-style", initialValue: "normal", prefix: !1, type: se.IDENT_VALUE, parse: function (A) { switch (A) { case "oblique": return Br.OBLIQUE; case "italic": return Br.ITALIC; case "normal": default: return Br.NORMAL } } }, gr = function (A, e) { return 0 != (A & e) }, Er = { name: "content", initialValue: "none", type: se.LIST, prefix: !1, parse: function (A) { if (0 === A.length) return []; var e = A[0]; return e.type === u.IDENT_TOKEN && "none" === e.value ? [] : A } }, Fr = { name: "counter-increment", initialValue: "none", prefix: !0, type: se.LIST, parse: function (A) { if (0 === A.length) return null; var e = A[0]; if (e.type === u.IDENT_TOKEN && "none" === e.value) return null; for (var t = [], r = A.filter(MA), n = 0; n < r.length; n++) { var B = r[n], s = r[n + 1]; if (B.type === u.IDENT_TOKEN) { var o = s && vA(s) ? s.number : 1; t.push({ counter: B.value, increment: o }) } } return t } }, hr = { name: "counter-reset", initialValue: "none", prefix: !0, type: se.LIST, parse: function (A) { if (0 === A.length) return []; for (var e = [], t = A.filter(MA), r = 0; r < t.length; r++) { var n = t[r], B = t[r + 1]; if (DA(n) && "none" !== n.value) { var s = B && vA(B) ? B.number : 0; e.push({ counter: n.value, reset: s }) } } return e } }, Hr = { name: "quotes", initialValue: "none", prefix: !0, type: se.LIST, parse: function (A) { if (0 === A.length) return null; var e = A[0]; if (e.type === u.IDENT_TOKEN && "none" === e.value) return null; var t = [], r = A.filter(bA); if (r.length % 2 != 0) return null; for (var n = 0; n < r.length; n += 2) { var B = r[n].value, s = r[n + 1].value; t.push({ open: B, close: s }) } return t } }, dr = function (A, e, t) { if (!A) return ""; var r = A[Math.min(e, A.length - 1)]; return r ? t ? r.open : r.close : "" }, fr = { name: "box-shadow", initialValue: "none", type: se.LIST, prefix: !1, parse: function (A) { return 1 === A.length && SA(A[0], "none") ? [] : _A(A).map(function (A) { for (var e = { color: 255, offsetX: XA, offsetY: XA, blur: XA, spread: XA, inset: !1 }, t = 0, r = 0; r < A.length; r++) { var n = A[r]; SA(n, "inset") ? e.inset = !0 : xA(n) ? (0 === t ? e.offsetX = n : 1 === t ? e.offsetY = n : 2 === t ? e.blur = n : e.spread = n, t++) : e.color = $A(n) } return e }) } }, pr = function () { function A(A) { this.backgroundClip = Ir(ue, A.backgroundClip), this.backgroundColor = Ir(we, A.backgroundColor), this.backgroundImage = Ir(xe, A.backgroundImage), this.backgroundOrigin = Ir(Ve, A.backgroundOrigin), this.backgroundPosition = Ir(ze, A.backgroundPosition), this.backgroundRepeat = Ir(Je, A.backgroundRepeat), this.backgroundSize = Ir(We, A.backgroundSize), this.borderTopColor = Ir(Ze, A.borderTopColor), this.borderRightColor = Ir(je, A.borderRightColor), this.borderBottomColor = Ir($e, A.borderBottomColor), this.borderLeftColor = Ir(At, A.borderLeftColor), this.borderTopLeftRadius = Ir(tt, A.borderTopLeftRadius), this.borderTopRightRadius = Ir(rt, A.borderTopRightRadius), this.borderBottomRightRadius = Ir(nt, A.borderBottomRightRadius), this.borderBottomLeftRadius = Ir(Bt, A.borderBottomLeftRadius), this.borderTopStyle = Ir(it, A.borderTopStyle), this.borderRightStyle = Ir(at, A.borderRightStyle), this.borderBottomStyle = Ir(ct, A.borderBottomStyle), this.borderLeftStyle = Ir(Qt, A.borderLeftStyle), this.borderTopWidth = Ir(wt, A.borderTopWidth), this.borderRightWidth = Ir(Ut, A.borderRightWidth), this.borderBottomWidth = Ir(lt, A.borderBottomWidth), this.borderLeftWidth = Ir(Ct, A.borderLeftWidth), this.boxShadow = Ir(fr, A.boxShadow), this.color = Ir(gt, A.color), this.display = Ir(Et, A.display), this.float = Ir(Ht, A.cssFloat), this.fontFamily = Ir(Qr, A.fontFamily), this.fontSize = Ir(ur, A.fontSize), this.fontStyle = Ir(Cr, A.fontStyle), this.fontVariant = Ir(Ur, A.fontVariant), this.fontWeight = Ir(wr, A.fontWeight), this.letterSpacing = Ir(dt, A.letterSpacing), this.lineBreak = Ir(pt, A.lineBreak), this.lineHeight = Ir(Nt, A.lineHeight), this.listStyleImage = Ir(Kt, A.listStyleImage), this.listStylePosition = Ir(Tt, A.listStylePosition), this.listStyleType = Ir(Rt, A.listStyleType), this.marginTop = Ir(Ot, A.marginTop), this.marginRight = Ir(vt, A.marginRight), this.marginBottom = Ir(Dt, A.marginBottom), this.marginLeft = Ir(bt, A.marginLeft), this.opacity = Ir(ir, A.opacity); var e = Ir(Mt, A.overflow); this.overflowX = e[0], this.overflowY = e[e.length > 1 ? 1 : 0], this.overflowWrap = Ir(_t, A.overflowWrap), this.paddingTop = Ir(xt, A.paddingTop), this.paddingRight = Ir(Vt, A.paddingRight), this.paddingBottom = Ir(zt, A.paddingBottom), this.paddingLeft = Ir(Xt, A.paddingLeft), this.position = Ir(Wt, A.position), this.textAlign = Ir(Gt, A.textAlign), this.textDecorationColor = Ir(ar, A.textDecorationColor || A.color), this.textDecorationLine = Ir(cr, A.textDecorationLine), this.textShadow = Ir(Yt, A.textShadow), this.textTransform = Ir(Zt, A.textTransform), this.transform = Ir(jt, A.transform), this.transformOrigin = Ir(tr, A.transformOrigin), this.visibility = Ir(nr, A.visibility), this.wordBreak = Ir(sr, A.wordBreak), this.zIndex = Ir(or, A.zIndex) } return A.prototype.isVisible = function () { return this.display > 0 && this.opacity > 0 && this.visibility === qt.VISIBLE }, A.prototype.isTransparent = function () { return Ae(this.backgroundColor) }, A.prototype.isTransformed = function () { return null !== this.transform }, A.prototype.isPositioned = function () { return this.position !== Jt.STATIC }, A.prototype.isPositionedWithZIndex = function () { return this.isPositioned() && !this.zIndex.auto }, A.prototype.isFloating = function () { return this.float !== st.NONE }, A.prototype.isInlineLevel = function () { return gr(this.display, 4) || gr(this.display, 33554432) || gr(this.display, 268435456) || gr(this.display, 536870912) || gr(this.display, 67108864) || gr(this.display, 134217728) }, A }(), Nr = function () { return function (A) { this.content = Ir(Er, A.content), this.quotes = Ir(Hr, A.quotes) } }(), Kr = function () { return function (A) { this.counterIncrement = Ir(Fr, A.counterIncrement), this.counterReset = Ir(hr, A.counterReset) } }(), Ir = function (A, e) { var t = new RA, r = null != e ? e.toString() : A.initialValue; t.write(r); var n = new LA(t.read()); switch (A.type) { case se.IDENT_VALUE: var B = n.parseComponentValue(); return A.parse(DA(B) ? B.value : A.initialValue); case se.VALUE: return A.parse(n.parseComponentValue()); case se.LIST: return A.parse(n.parseComponentValues()); case se.TOKEN_VALUE: return n.parseComponentValue(); case se.TYPE_VALUE: switch (A.format) { case "angle": return YA(n.parseComponentValue()); case "color": return $A(n.parseComponentValue()); case "image": return ye(n.parseComponentValue()); case "length": var s = n.parseComponentValue(); return xA(s) ? s : XA; case "length-percentage": var o = n.parseComponentValue(); return VA(o) ? o : XA } }throw new Error("Attempting to parse unsupported css format type " + A.format) }, Tr = function () { return function (A) { this.styles = new pr(window.getComputedStyle(A, null)), this.textNodes = [], this.elements = [], null !== this.styles.transform && Qn(A) && (A.style.transform = "none"), this.bounds = s(A), this.flags = 0 } }(), mr = function () { return function (A, e) { this.text = A, this.bounds = e } }(), Rr = function (A, e, t) { var r = vr(A, e), n = [], B = 0; return r.forEach(function (A) { if (e.textDecorationLine.length || A.trim().length > 0) if (fe.SUPPORT_RANGE_BOUNDS) n.push(new mr(A, Or(t, B, A.length))); else { var r = t.splitText(A.length); n.push(new mr(A, Lr(t))), t = r } else fe.SUPPORT_RANGE_BOUNDS || (t = t.splitText(A.length)); B += A.length }), n }, Lr = function (A) { var e = A.ownerDocument; if (e) { var t = e.createElement("html2canvaswrapper"); t.appendChild(A.cloneNode(!0)); var r = A.parentNode; if (r) { r.replaceChild(t, A); var n = s(t); return t.firstChild && r.replaceChild(t.firstChild, t), n } } return new B(0, 0, 0, 0) }, Or = function (A, e, t) { var r = A.ownerDocument; if (!r) throw new Error("Node has no owner document"); var n = r.createRange(); return n.setStart(A, e), n.setEnd(A, e + t), B.fromClientRect(n.getBoundingClientRect()) }, vr = function (A, e) { return 0 !== e.letterSpacing ? o(A).map(function (A) { return i(A) }) : Dr(A, e) }, Dr = function (A, e) { for (var t, r = function (A, e) { var t = o(A), r = Z(t, e), n = r[0], B = r[1], s = r[2], i = t.length, a = 0, c = 0; return { next: function () { if (c >= i) return { done: !0, value: null }; for (var A = "×"; c < i && "×" === (A = q(t, B, n, ++c, s));); if ("×" !== A || c === i) { var e = new j(t, A, a, c); return a = c, { value: e, done: !1 } } return { done: !0, value: null } } } }(A, { lineBreak: e.lineBreak, wordBreak: e.overflowWrap === St.BREAK_WORD ? "break-word" : e.wordBreak }), n = []; !(t = r.next()).done;)t.value && n.push(t.value.slice()); return n }, br = function () { return function (A, e) { this.text = Sr(A.data, e.textTransform), this.textBounds = Rr(this.text, e, A) } }(), Sr = function (A, e) { switch (e) { case kt.LOWERCASE: return A.toLowerCase(); case kt.CAPITALIZE: return A.replace(Mr, yr); case kt.UPPERCASE: return A.toUpperCase(); default: return A } }, Mr = /(^|\s|:|-|\(|\))([a-z])/g, yr = function (A, e, t) { return A.length > 0 ? e + t.toUpperCase() : A }, _r = function (A) { function t(e) { var t = A.call(this, e) || this; return t.src = e.currentSrc || e.src, t.intrinsicWidth = e.naturalWidth, t.intrinsicHeight = e.naturalHeight, Ne.getInstance().addImage(t.src), t } return e(t, A), t }(Tr), Pr = function (A) { function t(e) { var t = A.call(this, e) || this; return t.canvas = e, t.intrinsicWidth = e.width, t.intrinsicHeight = e.height, t } return e(t, A), t }(Tr), xr = function (A) { function t(e) { var t = A.call(this, e) || this, r = new XMLSerializer; return t.svg = "data:image/svg+xml," + encodeURIComponent(r.serializeToString(e)), t.intrinsicWidth = e.width.baseVal.value, t.intrinsicHeight = e.height.baseVal.value, Ne.getInstance().addImage(t.svg), t } return e(t, A), t }(Tr), Vr = function (A) { function t(e) { var t = A.call(this, e) || this; return t.value = e.value, t } return e(t, A), t }(Tr), zr = function (A) { function t(e) { var t = A.call(this, e) || this; return t.start = e.start, t.reversed = "boolean" == typeof e.reversed && !0 === e.reversed, t } return e(t, A), t }(Tr), Xr = [{ type: u.DIMENSION_TOKEN, flags: 0, unit: "px", number: 3 }], Jr = [{ type: u.PERCENTAGE_TOKEN, flags: 0, number: 50 }], Gr = function (A) { return A.width > A.height ? new B(A.left + (A.width - A.height) / 2, A.top, A.height, A.height) : A.width < A.height ? new B(A.left, A.top + (A.height - A.width) / 2, A.width, A.width) : A }, kr = function (A) { var e = A.type === qr ? new Array(A.value.length + 1).join("•") : A.value; return 0 === e.length ? A.placeholder || "" : e }, Wr = "checkbox", Yr = "radio", qr = "password", Zr = function (A) { function t(e) { var t = A.call(this, e) || this; switch (t.type = e.type.toLowerCase(), t.checked = e.checked, t.value = kr(e), t.type !== Wr && t.type !== Yr || (t.styles.backgroundColor = 3739148031, t.styles.borderTopColor = t.styles.borderRightColor = t.styles.borderBottomColor = t.styles.borderLeftColor = 2779096575, t.styles.borderTopWidth = t.styles.borderRightWidth = t.styles.borderBottomWidth = t.styles.borderLeftWidth = 1, t.styles.borderTopStyle = t.styles.borderRightStyle = t.styles.borderBottomStyle = t.styles.borderLeftStyle = ke.SOLID, t.styles.backgroundClip = [oe.BORDER_BOX], t.styles.backgroundOrigin = [0], t.bounds = Gr(t.bounds)), t.type) { case Wr: t.styles.borderTopRightRadius = t.styles.borderTopLeftRadius = t.styles.borderBottomRightRadius = t.styles.borderBottomLeftRadius = Xr; break; case Yr: t.styles.borderTopRightRadius = t.styles.borderTopLeftRadius = t.styles.borderBottomRightRadius = t.styles.borderBottomLeftRadius = Jr }return t } return e(t, A), t }(Tr), jr = function (A) { function t(e) { var t = A.call(this, e) || this, r = e.options[e.selectedIndex || 0]; return t.value = r && r.text || "", t } return e(t, A), t }(Tr), $r = function (A) { function t(e) { var t = A.call(this, e) || this; return t.value = e.value, t } return e(t, A), t }(Tr), An = function (A) { return $A(LA.create(A).parseComponentValue()) }, en = function (A) { function t(e) { var t = A.call(this, e) || this; t.src = e.src, t.width = parseInt(e.width, 10) || 0, t.height = parseInt(e.height, 10) || 0, t.backgroundColor = t.styles.backgroundColor; try { if (e.contentWindow && e.contentWindow.document && e.contentWindow.document.documentElement) { t.tree = Bn(e.contentWindow.document.documentElement); var r = e.contentWindow.document.documentElement ? An(getComputedStyle(e.contentWindow.document.documentElement).backgroundColor) : ce.TRANSPARENT, n = e.contentWindow.document.body ? An(getComputedStyle(e.contentWindow.document.body).backgroundColor) : ce.TRANSPARENT; t.backgroundColor = Ae(r) ? Ae(n) ? t.styles.backgroundColor : n : r } } catch (A) { } return t } return e(t, A), t }(Tr), tn = ["OL", "UL", "MENU"], rn = function (A, e, t) { for (var r = A.firstChild, n = void 0; r; r = n)if (n = r.nextSibling, an(r) && r.data.trim().length > 0) e.textNodes.push(new br(r, e.styles)); else if (cn(r)) { var B = nn(r); B.styles.isVisible() && (sn(r, B, t) ? B.flags |= 4 : on(B.styles) && (B.flags |= 2), -1 !== tn.indexOf(r.tagName) && (B.flags |= 8), e.elements.push(B), fn(r) || Cn(r) || pn(r) || rn(r, B, t)) } }, nn = function (A) { return Fn(A) ? new _r(A) : En(A) ? new Pr(A) : Cn(A) ? new xr(A) : wn(A) ? new Vr(A) : Un(A) ? new zr(A) : ln(A) ? new Zr(A) : pn(A) ? new jr(A) : fn(A) ? new $r(A) : hn(A) ? new en(A) : new Tr(A) }, Bn = function (A) { var e = nn(A); return e.flags |= 4, rn(A, e, e), e }, sn = function (A, e, t) { return e.styles.isPositionedWithZIndex() || e.styles.opacity < 1 || e.styles.isTransformed() || gn(A) && t.styles.isTransparent() }, on = function (A) { return A.isPositioned() || A.isFloating() }, an = function (A) { return A.nodeType === Node.TEXT_NODE }, cn = function (A) { return A.nodeType === Node.ELEMENT_NODE }, Qn = function (A) { return cn(A) && void 0 !== A.style && !un(A) }, un = function (A) { return "object" == typeof A.className }, wn = function (A) { return "LI" === A.tagName }, Un = function (A) { return "OL" === A.tagName }, ln = function (A) { return "INPUT" === A.tagName }, Cn = function (A) { return "svg" === A.tagName }, gn = function (A) { return "BODY" === A.tagName }, En = function (A) { return "CANVAS" === A.tagName }, Fn = function (A) { return "IMG" === A.tagName }, hn = function (A) { return "IFRAME" === A.tagName }, Hn = function (A) { return "STYLE" === A.tagName }, dn = function (A) { return "SCRIPT" === A.tagName }, fn = function (A) { return "TEXTAREA" === A.tagName }, pn = function (A) { return "SELECT" === A.tagName }, Nn = function () { function A() { this.counters = {} } return A.prototype.getCounterValue = function (A) { var e = this.counters[A]; return e && e.length ? e[e.length - 1] : 1 }, A.prototype.getCounterValues = function (A) { var e = this.counters[A]; return e || [] }, A.prototype.pop = function (A) { var e = this; A.forEach(function (A) { return e.counters[A].pop() }) }, A.prototype.parse = function (A) { var e = this, t = A.counterIncrement, r = A.counterReset, n = !0; null !== t && t.forEach(function (A) { var t = e.counters[A.counter]; t && 0 !== A.increment && (n = !1, t[Math.max(0, t.length - 1)] += A.increment) }); var B = []; return n && r.forEach(function (A) { var t = e.counters[A.counter]; B.push(A.counter), t || (t = e.counters[A.counter] = []), t.push(A.reset) }), B }, A }(), Kn = { integers: [1e3, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1], values: ["M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"] }, In = { integers: [9e3, 8e3, 7e3, 6e3, 5e3, 4e3, 3e3, 2e3, 1e3, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1], values: ["Ք", "Փ", "Ւ", "Ց", "Ր", "Տ", "Վ", "Ս", "Ռ", "Ջ", "Պ", "Չ", "Ո", "Շ", "Ն", "Յ", "Մ", "Ճ", "Ղ", "Ձ", "Հ", "Կ", "Ծ", "Խ", "Լ", "Ի", "Ժ", "Թ", "Ը", "Է", "Զ", "Ե", "Դ", "Գ", "Բ", "Ա"] }, Tn = { integers: [1e4, 9e3, 8e3, 7e3, 6e3, 5e3, 4e3, 3e3, 2e3, 1e3, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 19, 18, 17, 16, 15, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1], values: ["י׳", "ט׳", "ח׳", "ז׳", "ו׳", "ה׳", "ד׳", "ג׳", "ב׳", "א׳", "ת", "ש", "ר", "ק", "צ", "פ", "ע", "ס", "נ", "מ", "ל", "כ", "יט", "יח", "יז", "טז", "טו", "י", "ט", "ח", "ז", "ו", "ה", "ד", "ג", "ב", "א"] }, mn = { integers: [1e4, 9e3, 8e3, 7e3, 6e3, 5e3, 4e3, 3e3, 2e3, 1e3, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1], values: ["ჵ", "ჰ", "ჯ", "ჴ", "ხ", "ჭ", "წ", "ძ", "ც", "ჩ", "შ", "ყ", "ღ", "ქ", "ფ", "ჳ", "ტ", "ს", "რ", "ჟ", "პ", "ო", "ჲ", "ნ", "მ", "ლ", "კ", "ი", "თ", "ჱ", "ზ", "ვ", "ე", "დ", "გ", "ბ", "ა"] }, Rn = function (A, e, t, r, n, B) { return A < e || A > t ? bn(A, n, B.length > 0) : r.integers.reduce(function (e, t, n) { for (; A >= t;)A -= t, e += r.values[n]; return e }, "") + B }, Ln = function (A, e, t, r) { var n = ""; do { t || A--, n = r(A) + n, A /= e } while (A * e >= e); return n }, On = function (A, e, t, r, n) { var B = t - e + 1; return (A < 0 ? "-" : "") + (Ln(Math.abs(A), B, r, function (A) { return i(Math.floor(A % B) + e) }) + n) }, vn = function (A, e, t) { void 0 === t && (t = ". "); var r = e.length; return Ln(Math.abs(A), r, !1, function (A) { return e[Math.floor(A % r)] }) + t }, Dn = function (A, e, t, r, n, B) { if (A < -9999 || A > 9999) return bn(A, It.CJK_DECIMAL, n.length > 0); var s = Math.abs(A), o = n; if (0 === s) return e[0] + o; for (var i = 0; s > 0 && i <= 4; i++) { var a = s % 10; 0 === a && gr(B, 1) && "" !== o ? o = e[a] + o : a > 1 || 1 === a && 0 === i || 1 === a && 1 === i && gr(B, 2) || 1 === a && 1 === i && gr(B, 4) && A > 100 || 1 === a && i > 1 && gr(B, 8) ? o = e[a] + (i > 0 ? t[i - 1] : "") + o : 1 === a && i > 0 && (o = t[i - 1] + o), s = Math.floor(s / 10) } return (A < 0 ? r : "") + o }, bn = function (A, e, t) { var r = t ? ". " : "", n = t ? "、" : "", B = t ? ", " : "", s = t ? " " : ""; switch (e) { case It.DISC: return "•" + s; case It.CIRCLE: return "◦" + s; case It.SQUARE: return "◾" + s; case It.DECIMAL_LEADING_ZERO: var o = On(A, 48, 57, !0, r); return o.length < 4 ? "0" + o : o; case It.CJK_DECIMAL: return vn(A, "〇一二三四五六七八九", n); case It.LOWER_ROMAN: return Rn(A, 1, 3999, Kn, It.DECIMAL, r).toLowerCase(); case It.UPPER_ROMAN: return Rn(A, 1, 3999, Kn, It.DECIMAL, r); case It.LOWER_GREEK: return On(A, 945, 969, !1, r); case It.LOWER_ALPHA: return On(A, 97, 122, !1, r); case It.UPPER_ALPHA: return On(A, 65, 90, !1, r); case It.ARABIC_INDIC: return On(A, 1632, 1641, !0, r); case It.ARMENIAN: case It.UPPER_ARMENIAN: return Rn(A, 1, 9999, In, It.DECIMAL, r); case It.LOWER_ARMENIAN: return Rn(A, 1, 9999, In, It.DECIMAL, r).toLowerCase(); case It.BENGALI: return On(A, 2534, 2543, !0, r); case It.CAMBODIAN: case It.KHMER: return On(A, 6112, 6121, !0, r); case It.CJK_EARTHLY_BRANCH: return vn(A, "子丑寅卯辰巳午未申酉戌亥", n); case It.CJK_HEAVENLY_STEM: return vn(A, "甲乙丙丁戊己庚辛壬癸", n); case It.CJK_IDEOGRAPHIC: case It.TRAD_CHINESE_INFORMAL: return Dn(A, "零一二三四五六七八九", "十百千萬", "負", n, 14); case It.TRAD_CHINESE_FORMAL: return Dn(A, "零壹貳參肆伍陸柒捌玖", "拾佰仟萬", "負", n, 15); case It.SIMP_CHINESE_INFORMAL: return Dn(A, "零一二三四五六七八九", "十百千萬", "负", n, 14); case It.SIMP_CHINESE_FORMAL: return Dn(A, "零壹贰叁肆伍陆柒捌玖", "拾佰仟萬", "负", n, 15); case It.JAPANESE_INFORMAL: return Dn(A, "〇一二三四五六七八九", "十百千万", "マイナス", n, 0); case It.JAPANESE_FORMAL: return Dn(A, "零壱弐参四伍六七八九", "拾百千万", "マイナス", n, 7); case It.KOREAN_HANGUL_FORMAL: return Dn(A, "영일이삼사오육칠팔구", "십백천만", "마이너스", B, 7); case It.KOREAN_HANJA_INFORMAL: return Dn(A, "零一二三四五六七八九", "十百千萬", "마이너스", B, 0); case It.KOREAN_HANJA_FORMAL: return Dn(A, "零壹貳參四五六七八九", "拾百千", "마이너스", B, 7); case It.DEVANAGARI: return On(A, 2406, 2415, !0, r); case It.GEORGIAN: return Rn(A, 1, 19999, mn, It.DECIMAL, r); case It.GUJARATI: return On(A, 2790, 2799, !0, r); case It.GURMUKHI: return On(A, 2662, 2671, !0, r); case It.HEBREW: return Rn(A, 1, 10999, Tn, It.DECIMAL, r); case It.HIRAGANA: return vn(A, "あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん"); case It.HIRAGANA_IROHA: return vn(A, "いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす"); case It.KANNADA: return On(A, 3302, 3311, !0, r); case It.KATAKANA: return vn(A, "アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン", n); case It.KATAKANA_IROHA: return vn(A, "イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス", n); case It.LAO: return On(A, 3792, 3801, !0, r); case It.MONGOLIAN: return On(A, 6160, 6169, !0, r); case It.MYANMAR: return On(A, 4160, 4169, !0, r); case It.ORIYA: return On(A, 2918, 2927, !0, r); case It.PERSIAN: return On(A, 1776, 1785, !0, r); case It.TAMIL: return On(A, 3046, 3055, !0, r); case It.TELUGU: return On(A, 3174, 3183, !0, r); case It.THAI: return On(A, 3664, 3673, !0, r); case It.TIBETAN: return On(A, 3872, 3881, !0, r); case It.DECIMAL: default: return On(A, 48, 57, !0, r) } }, Sn = function () { function A(A, e) { if (this.options = e, this.scrolledElements = [], this.referenceElement = A, this.counters = new Nn, this.quoteDepth = 0, !A.ownerDocument) throw new Error("Cloned element does not have an owner document"); this.documentElement = this.cloneNode(A.ownerDocument.documentElement) } return A.prototype.toIFrame = function (A, e) { var t = this, B = yn(A, e); if (!B.contentWindow) return Promise.reject("Unable to find iframe window"); var s = A.defaultView.pageXOffset, o = A.defaultView.pageYOffset, i = B.contentWindow, a = i.document, c = _n(B).then(function () { return r(t, void 0, void 0, function () { var A; return n(this, function (t) { switch (t.label) { case 0: return this.scrolledElements.forEach(zn), i && (i.scrollTo(e.left, e.top), !/(iPad|iPhone|iPod)/g.test(navigator.userAgent) || i.scrollY === e.top && i.scrollX === e.left || (a.documentElement.style.top = -e.top + "px", a.documentElement.style.left = -e.left + "px", a.documentElement.style.position = "absolute")), A = this.options.onclone, void 0 === this.clonedReferenceElement ? [2, Promise.reject("Error finding the " + this.referenceElement.nodeName + " in the cloned document")] : a.fonts && a.fonts.ready ? [4, a.fonts.ready] : [3, 2]; case 1: t.sent(), t.label = 2; case 2: return "function" == typeof A ? [2, Promise.resolve().then(function () { return A(a) }).then(function () { return B })] : [2, B] } }) }) }); return a.open(), a.write(xn(document.doctype) + "<html></html>"), Vn(this.referenceElement.ownerDocument, s, o), a.replaceChild(a.adoptNode(this.documentElement), a.documentElement), a.close(), c }, A.prototype.createElementClone = function (A) { if (En(A)) return this.createCanvasClone(A); if (Hn(A)) return this.createStyleClone(A); var e = A.cloneNode(!1); return Fn(e) && "lazy" === e.loading && (e.loading = "eager"), e }, A.prototype.createStyleClone = function (A) { try { var e = A.sheet; if (e && e.cssRules) { var t = [].slice.call(e.cssRules, 0).reduce(function (A, e) { return e && "string" == typeof e.cssText ? A + e.cssText : A }, ""), r = A.cloneNode(!1); return r.textContent = t, r } } catch (A) { if (pe.getInstance(this.options.id).error("Unable to access cssRules property", A), "SecurityError" !== A.name) throw A } return A.cloneNode(!1) }, A.prototype.createCanvasClone = function (A) { if (this.options.inlineImages && A.ownerDocument) { var e = A.ownerDocument.createElement("img"); try { return e.src = A.toDataURL(), e } catch (A) { pe.getInstance(this.options.id).info("Unable to clone canvas contents, canvas is tainted") } } var t = A.cloneNode(!1); try { t.width = A.width, t.height = A.height; var r = A.getContext("2d"), n = t.getContext("2d"); return n && (r ? n.putImageData(r.getImageData(0, 0, A.width, A.height), 0, 0) : n.drawImage(A, 0, 0)), t } catch (A) { } return t }, A.prototype.cloneNode = function (A) { if (an(A)) return document.createTextNode(A.data); if (!A.ownerDocument) return A.cloneNode(!1); var e = A.ownerDocument.defaultView; if (e && cn(A) && (Qn(A) || un(A))) { var t = this.createElementClone(A), r = e.getComputedStyle(A), n = e.getComputedStyle(A, ":before"), B = e.getComputedStyle(A, ":after"); this.referenceElement === A && Qn(t) && (this.clonedReferenceElement = t), gn(t) && Gn(t); for (var s = this.counters.parse(new Kr(r)), o = this.resolvePseudoContent(A, t, n, lr.BEFORE), i = A.firstChild; i; i = i.nextSibling)cn(i) && (dn(i) || i.hasAttribute("data-html2canvas-ignore") || "function" == typeof this.options.ignoreElements && this.options.ignoreElements(i)) || this.options.copyStyles && cn(i) && Hn(i) || t.appendChild(this.cloneNode(i)); o && t.insertBefore(o, t.firstChild); var a = this.resolvePseudoContent(A, t, B, lr.AFTER); return a && t.appendChild(a), this.counters.pop(s), r && (this.options.copyStyles || un(A)) && !hn(A) && Pn(r, t), 0 === A.scrollTop && 0 === A.scrollLeft || this.scrolledElements.push([t, A.scrollLeft, A.scrollTop]), (fn(A) || pn(A)) && (fn(t) || pn(t)) && (t.value = A.value), t } return A.cloneNode(!1) }, A.prototype.resolvePseudoContent = function (A, e, t, r) { var n = this; if (t) { var B = t.content, s = e.ownerDocument; if (s && B && "none" !== B && "-moz-alt-content" !== B && "none" !== t.display) { this.counters.parse(new Kr(t)); var o = new Nr(t), i = s.createElement("html2canvaspseudoelement"); Pn(t, i), o.content.forEach(function (e) { if (e.type === u.STRING_TOKEN) i.appendChild(s.createTextNode(e.value)); else if (e.type === u.URL_TOKEN) { var t = s.createElement("img"); t.src = e.value, t.style.opacity = "1", i.appendChild(t) } else if (e.type === u.FUNCTION) { if ("attr" === e.name) { var r = e.values.filter(DA); r.length && i.appendChild(s.createTextNode(A.getAttribute(r[0].value) || "")) } else if ("counter" === e.name) { var B = e.values.filter(yA), a = B[0], c = B[1]; if (a && DA(a)) { var Q = n.counters.getCounterValue(a.value), w = c && DA(c) ? Rt.parse(c.value) : It.DECIMAL; i.appendChild(s.createTextNode(bn(Q, w, !1))) } } else if ("counters" === e.name) { var U = e.values.filter(yA), l = (a = U[0], U[1]); c = U[2]; if (a && DA(a)) { var C = n.counters.getCounterValues(a.value), g = c && DA(c) ? Rt.parse(c.value) : It.DECIMAL, E = l && l.type === u.STRING_TOKEN ? l.value : "", F = C.map(function (A) { return bn(A, g, !1) }).join(E); i.appendChild(s.createTextNode(F)) } } } else if (e.type === u.IDENT_TOKEN) switch (e.value) { case "open-quote": i.appendChild(s.createTextNode(dr(o.quotes, n.quoteDepth++, !0))); break; case "close-quote": i.appendChild(s.createTextNode(dr(o.quotes, --n.quoteDepth, !1))); break; default: i.appendChild(s.createTextNode(e.value)) } }), i.className = Xn + " " + Jn; var a = r === lr.BEFORE ? " " + Xn : " " + Jn; return un(e) ? e.className.baseValue += a : e.className += a, i } } }, A.destroy = function (A) { return !!A.parentNode && (A.parentNode.removeChild(A), !0) }, A }(); !function (A) { A[A.BEFORE = 0] = "BEFORE", A[A.AFTER = 1] = "AFTER" }(lr || (lr = {})); var Mn, yn = function (A, e) { var t = A.createElement("iframe"); return t.className = "html2canvas-container", t.style.visibility = "hidden", t.style.position = "fixed", t.style.left = "-10000px", t.style.top = "0px", t.style.border = "0", t.width = e.width.toString(), t.height = e.height.toString(), t.scrolling = "no", t.setAttribute("data-html2canvas-ignore", "true"), A.body.appendChild(t), t }, _n = function (A) { return new Promise(function (e, t) { var r = A.contentWindow; if (!r) return t("No window assigned for iframe"); var n = r.document; r.onload = A.onload = n.onreadystatechange = function () { r.onload = A.onload = n.onreadystatechange = null; var t = setInterval(function () { n.body.childNodes.length > 0 && "complete" === n.readyState && (clearInterval(t), e(A)) }, 50) } }) }, Pn = function (A, e) { for (var t = A.length - 1; t >= 0; t--) { var r = A.item(t); "content" !== r && e.style.setProperty(r, A.getPropertyValue(r)) } return e }, xn = function (A) { var e = ""; return A && (e += "<!DOCTYPE ", A.name && (e += A.name), A.internalSubset && (e += A.internalSubset), A.publicId && (e += '"' + A.publicId + '"'), A.systemId && (e += '"' + A.systemId + '"'), e += ">"), e }, Vn = function (A, e, t) { A && A.defaultView && (e !== A.defaultView.pageXOffset || t !== A.defaultView.pageYOffset) && A.defaultView.scrollTo(e, t) }, zn = function (A) { var e = A[0], t = A[1], r = A[2]; e.scrollLeft = t, e.scrollTop = r }, Xn = "___html2canvas___pseudoelement_before", Jn = "___html2canvas___pseudoelement_after", Gn = function (A) { kn(A, "." + Xn + ':before{\n    content: "" !important;\n    display: none !important;\n}\n         .' + Jn + ':after{\n    content: "" !important;\n    display: none !important;\n}') }, kn = function (A, e) { var t = A.ownerDocument; if (t) { var r = t.createElement("style"); r.textContent = e, A.appendChild(r) } }; !function (A) { A[A.VECTOR = 0] = "VECTOR", A[A.BEZIER_CURVE = 1] = "BEZIER_CURVE" }(Mn || (Mn = {})); var Wn, Yn = function (A, e) { return A.length === e.length && A.some(function (A, t) { return A === e[t] }) }, qn = function () { function A(A, e) { this.type = Mn.VECTOR, this.x = A, this.y = e } return A.prototype.add = function (e, t) { return new A(this.x + e, this.y + t) }, A }(), Zn = function (A, e, t) { return new qn(A.x + (e.x - A.x) * t, A.y + (e.y - A.y) * t) }, jn = function () { function A(A, e, t, r) { this.type = Mn.BEZIER_CURVE, this.start = A, this.startControl = e, this.endControl = t, this.end = r } return A.prototype.subdivide = function (e, t) { var r = Zn(this.start, this.startControl, e), n = Zn(this.startControl, this.endControl, e), B = Zn(this.endControl, this.end, e), s = Zn(r, n, e), o = Zn(n, B, e), i = Zn(s, o, e); return t ? new A(this.start, r, s, i) : new A(i, o, B, this.end) }, A.prototype.add = function (e, t) { return new A(this.start.add(e, t), this.startControl.add(e, t), this.endControl.add(e, t), this.end.add(e, t)) }, A.prototype.reverse = function () { return new A(this.end, this.endControl, this.startControl, this.start) }, A }(), $n = function (A) { return A.type === Mn.BEZIER_CURVE }, AB = function () { return function (A) { var e = A.styles, t = A.bounds, r = kA(e.borderTopLeftRadius, t.width, t.height), n = r[0], B = r[1], s = kA(e.borderTopRightRadius, t.width, t.height), o = s[0], i = s[1], a = kA(e.borderBottomRightRadius, t.width, t.height), c = a[0], Q = a[1], u = kA(e.borderBottomLeftRadius, t.width, t.height), w = u[0], U = u[1], l = []; l.push((n + o) / t.width), l.push((w + c) / t.width), l.push((B + U) / t.height), l.push((i + Q) / t.height); var C = Math.max.apply(Math, l); C > 1 && (n /= C, B /= C, o /= C, i /= C, c /= C, Q /= C, w /= C, U /= C); var g = t.width - o, E = t.height - Q, F = t.width - c, h = t.height - U, H = e.borderTopWidth, d = e.borderRightWidth, f = e.borderBottomWidth, p = e.borderLeftWidth, N = WA(e.paddingTop, A.bounds.width), K = WA(e.paddingRight, A.bounds.width), I = WA(e.paddingBottom, A.bounds.width), T = WA(e.paddingLeft, A.bounds.width); this.topLeftBorderBox = n > 0 || B > 0 ? eB(t.left, t.top, n, B, Wn.TOP_LEFT) : new qn(t.left, t.top), this.topRightBorderBox = o > 0 || i > 0 ? eB(t.left + g, t.top, o, i, Wn.TOP_RIGHT) : new qn(t.left + t.width, t.top), this.bottomRightBorderBox = c > 0 || Q > 0 ? eB(t.left + F, t.top + E, c, Q, Wn.BOTTOM_RIGHT) : new qn(t.left + t.width, t.top + t.height), this.bottomLeftBorderBox = w > 0 || U > 0 ? eB(t.left, t.top + h, w, U, Wn.BOTTOM_LEFT) : new qn(t.left, t.top + t.height), this.topLeftPaddingBox = n > 0 || B > 0 ? eB(t.left + p, t.top + H, Math.max(0, n - p), Math.max(0, B - H), Wn.TOP_LEFT) : new qn(t.left + p, t.top + H), this.topRightPaddingBox = o > 0 || i > 0 ? eB(t.left + Math.min(g, t.width + p), t.top + H, g > t.width + p ? 0 : o - p, i - H, Wn.TOP_RIGHT) : new qn(t.left + t.width - d, t.top + H), this.bottomRightPaddingBox = c > 0 || Q > 0 ? eB(t.left + Math.min(F, t.width - p), t.top + Math.min(E, t.height + H), Math.max(0, c - d), Q - f, Wn.BOTTOM_RIGHT) : new qn(t.left + t.width - d, t.top + t.height - f), this.bottomLeftPaddingBox = w > 0 || U > 0 ? eB(t.left + p, t.top + h, Math.max(0, w - p), U - f, Wn.BOTTOM_LEFT) : new qn(t.left + p, t.top + t.height - f), this.topLeftContentBox = n > 0 || B > 0 ? eB(t.left + p + T, t.top + H + N, Math.max(0, n - (p + T)), Math.max(0, B - (H + N)), Wn.TOP_LEFT) : new qn(t.left + p + T, t.top + H + N), this.topRightContentBox = o > 0 || i > 0 ? eB(t.left + Math.min(g, t.width + p + T), t.top + H + N, g > t.width + p + T ? 0 : o - p + T, i - (H + N), Wn.TOP_RIGHT) : new qn(t.left + t.width - (d + K), t.top + H + N), this.bottomRightContentBox = c > 0 || Q > 0 ? eB(t.left + Math.min(F, t.width - (p + T)), t.top + Math.min(E, t.height + H + N), Math.max(0, c - (d + K)), Q - (f + I), Wn.BOTTOM_RIGHT) : new qn(t.left + t.width - (d + K), t.top + t.height - (f + I)), this.bottomLeftContentBox = w > 0 || U > 0 ? eB(t.left + p + T, t.top + h, Math.max(0, w - (p + T)), U - (f + I), Wn.BOTTOM_LEFT) : new qn(t.left + p + T, t.top + t.height - (f + I)) } }(); !function (A) { A[A.TOP_LEFT = 0] = "TOP_LEFT", A[A.TOP_RIGHT = 1] = "TOP_RIGHT", A[A.BOTTOM_RIGHT = 2] = "BOTTOM_RIGHT", A[A.BOTTOM_LEFT = 3] = "BOTTOM_LEFT" }(Wn || (Wn = {})); var eB = function (A, e, t, r, n) { var B = (Math.sqrt(2) - 1) / 3 * 4, s = t * B, o = r * B, i = A + t, a = e + r; switch (n) { case Wn.TOP_LEFT: return new jn(new qn(A, a), new qn(A, a - o), new qn(i - s, e), new qn(i, e)); case Wn.TOP_RIGHT: return new jn(new qn(A, e), new qn(A + s, e), new qn(i, a - o), new qn(i, a)); case Wn.BOTTOM_RIGHT: return new jn(new qn(i, e), new qn(i, e + o), new qn(A + s, a), new qn(A, a)); case Wn.BOTTOM_LEFT: default: return new jn(new qn(i, a), new qn(i - s, a), new qn(A, e + o), new qn(A, e)) } }, tB = function (A) { return [A.topLeftBorderBox, A.topRightBorderBox, A.bottomRightBorderBox, A.bottomLeftBorderBox] }, rB = function (A) { return [A.topLeftPaddingBox, A.topRightPaddingBox, A.bottomRightPaddingBox, A.bottomLeftPaddingBox] }, nB = function () { return function (A, e, t) { this.type = 0, this.offsetX = A, this.offsetY = e, this.matrix = t, this.target = 6 } }(), BB = function () { return function (A, e) { this.type = 1, this.target = e, this.path = A } }(), sB = function () { return function (A) { this.element = A, this.inlineLevel = [], this.nonInlineLevel = [], this.negativeZIndex = [], this.zeroOrAutoZIndexOrTransformedOrOpacity = [], this.positiveZIndex = [], this.nonPositionedFloats = [], this.nonPositionedInlineLevel = [] } }(), oB = function () { function A(A, e) { if (this.container = A, this.effects = e.slice(0), this.curves = new AB(A), null !== A.styles.transform) { var t = A.bounds.left + A.styles.transformOrigin[0].number, r = A.bounds.top + A.styles.transformOrigin[1].number, n = A.styles.transform; this.effects.push(new nB(t, r, n)) } if (A.styles.overflowX !== mt.VISIBLE) { var B = tB(this.curves), s = rB(this.curves); Yn(B, s) ? this.effects.push(new BB(B, 6)) : (this.effects.push(new BB(B, 2)), this.effects.push(new BB(s, 4))) } } return A.prototype.getParentEffects = function () { var A = this.effects.slice(0); if (this.container.styles.overflowX !== mt.VISIBLE) { var e = tB(this.curves), t = rB(this.curves); Yn(e, t) || A.push(new BB(t, 6)) } return A }, A }(), iB = function (A, e, t, r) { A.container.elements.forEach(function (n) { var B = gr(n.flags, 4), s = gr(n.flags, 2), o = new oB(n, A.getParentEffects()); gr(n.styles.display, 2048) && r.push(o); var i = gr(n.flags, 8) ? [] : r; if (B || s) { var a = B || n.styles.isPositioned() ? t : e, c = new sB(o); if (n.styles.isPositioned() || n.styles.opacity < 1 || n.styles.isTransformed()) { var Q = n.styles.zIndex.order; if (Q < 0) { var u = 0; a.negativeZIndex.some(function (A, e) { return Q > A.element.container.styles.zIndex.order ? (u = e, !1) : u > 0 }), a.negativeZIndex.splice(u, 0, c) } else if (Q > 0) { var w = 0; a.positiveZIndex.some(function (A, e) { return Q >= A.element.container.styles.zIndex.order ? (w = e + 1, !1) : w > 0 }), a.positiveZIndex.splice(w, 0, c) } else a.zeroOrAutoZIndexOrTransformedOrOpacity.push(c) } else n.styles.isFloating() ? a.nonPositionedFloats.push(c) : a.nonPositionedInlineLevel.push(c); iB(o, c, B ? c : t, i) } else n.styles.isInlineLevel() ? e.inlineLevel.push(o) : e.nonInlineLevel.push(o), iB(o, e, t, i); gr(n.flags, 8) && aB(n, i) }) }, aB = function (A, e) { for (var t = A instanceof zr ? A.start : 1, r = A instanceof zr && A.reversed, n = 0; n < e.length; n++) { var B = e[n]; B.container instanceof Vr && "number" == typeof B.container.value && 0 !== B.container.value && (t = B.container.value), B.listValue = bn(t, B.container.styles.listStyleType, !0), t += r ? -1 : 1 } }, cB = function (A, e, t, r) { var n = []; return $n(A) ? n.push(A.subdivide(.5, !1)) : n.push(A), $n(t) ? n.push(t.subdivide(.5, !0)) : n.push(t), $n(r) ? n.push(r.subdivide(.5, !0).reverse()) : n.push(r), $n(e) ? n.push(e.subdivide(.5, !1).reverse()) : n.push(e), n }, QB = function (A) { var e = A.bounds, t = A.styles; return e.add(t.borderLeftWidth, t.borderTopWidth, -(t.borderRightWidth + t.borderLeftWidth), -(t.borderTopWidth + t.borderBottomWidth)) }, uB = function (A) { var e = A.styles, t = A.bounds, r = WA(e.paddingLeft, t.width), n = WA(e.paddingRight, t.width), B = WA(e.paddingTop, t.width), s = WA(e.paddingBottom, t.width); return t.add(r + e.borderLeftWidth, B + e.borderTopWidth, -(e.borderRightWidth + e.borderLeftWidth + r + n), -(e.borderTopWidth + e.borderBottomWidth + B + s)) }, wB = function (A, e, t) { var r, n, B = (r = gB(A.styles.backgroundOrigin, e), n = A, 0 === r ? n.bounds : 2 === r ? uB(n) : QB(n)), s = function (A, e) { return A === oe.BORDER_BOX ? e.bounds : A === oe.CONTENT_BOX ? uB(e) : QB(e) }(gB(A.styles.backgroundClip, e), A), o = CB(gB(A.styles.backgroundSize, e), t, B), i = o[0], a = o[1], c = kA(gB(A.styles.backgroundPosition, e), B.width - i, B.height - a); return [EB(gB(A.styles.backgroundRepeat, e), c, o, B, s), Math.round(B.left + c[0]), Math.round(B.top + c[1]), i, a] }, UB = function (A) { return DA(A) && A.value === Xe.AUTO }, lB = function (A) { return "number" == typeof A }, CB = function (A, e, t) { var r = e[0], n = e[1], B = e[2], s = A[0], o = A[1]; if (VA(s) && o && VA(o)) return [WA(s, t.width), WA(o, t.height)]; var i = lB(B); if (DA(s) && (s.value === Xe.CONTAIN || s.value === Xe.COVER)) return lB(B) ? t.width / t.height < B != (s.value === Xe.COVER) ? [t.width, t.width / B] : [t.height * B, t.height] : [t.width, t.height]; var a = lB(r), c = lB(n), Q = a || c; if (UB(s) && (!o || UB(o))) return a && c ? [r, n] : i || Q ? Q && i ? [a ? r : n * B, c ? n : r / B] : [a ? r : t.width, c ? n : t.height] : [t.width, t.height]; if (i) { var u = 0, w = 0; return VA(s) ? u = WA(s, t.width) : VA(o) && (w = WA(o, t.height)), UB(s) ? u = w * B : o && !UB(o) || (w = u / B), [u, w] } var U = null, l = null; if (VA(s) ? U = WA(s, t.width) : o && VA(o) && (l = WA(o, t.height)), null === U || o && !UB(o) || (l = a && c ? U / r * n : t.height), null !== l && UB(s) && (U = a && c ? l / n * r : t.width), null !== U && null !== l) return [U, l]; throw new Error("Unable to calculate background-size for element") }, gB = function (A, e) { var t = A[e]; return void 0 === t ? A[0] : t }, EB = function (A, e, t, r, n) { var B = e[0], s = e[1], o = t[0], i = t[1]; switch (A) { case _e.REPEAT_X: return [new qn(Math.round(r.left), Math.round(r.top + s)), new qn(Math.round(r.left + r.width), Math.round(r.top + s)), new qn(Math.round(r.left + r.width), Math.round(i + r.top + s)), new qn(Math.round(r.left), Math.round(i + r.top + s))]; case _e.REPEAT_Y: return [new qn(Math.round(r.left + B), Math.round(r.top)), new qn(Math.round(r.left + B + o), Math.round(r.top)), new qn(Math.round(r.left + B + o), Math.round(r.height + r.top)), new qn(Math.round(r.left + B), Math.round(r.height + r.top))]; case _e.NO_REPEAT: return [new qn(Math.round(r.left + B), Math.round(r.top + s)), new qn(Math.round(r.left + B + o), Math.round(r.top + s)), new qn(Math.round(r.left + B + o), Math.round(r.top + s + i)), new qn(Math.round(r.left + B), Math.round(r.top + s + i))]; default: return [new qn(Math.round(n.left), Math.round(n.top)), new qn(Math.round(n.left + n.width), Math.round(n.top)), new qn(Math.round(n.left + n.width), Math.round(n.height + n.top)), new qn(Math.round(n.left), Math.round(n.height + n.top))] } }, FB = function () { function A(A) { this._data = {}, this._document = A } return A.prototype.parseMetrics = function (A, e) { var t = this._document.createElement("div"), r = this._document.createElement("img"), n = this._document.createElement("span"), B = this._document.body; t.style.visibility = "hidden", t.style.fontFamily = A, t.style.fontSize = e, t.style.margin = "0", t.style.padding = "0", B.appendChild(t), r.src = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", r.width = 1, r.height = 1, r.style.margin = "0", r.style.padding = "0", r.style.verticalAlign = "baseline", n.style.fontFamily = A, n.style.fontSize = e, n.style.margin = "0", n.style.padding = "0", n.appendChild(this._document.createTextNode("Hidden Text")), t.appendChild(n), t.appendChild(r); var s = r.offsetTop - n.offsetTop + 2; t.removeChild(n), t.appendChild(this._document.createTextNode("Hidden Text")), t.style.lineHeight = "normal", r.style.verticalAlign = "super"; var o = r.offsetTop - t.offsetTop + 2; return B.removeChild(t), { baseline: s, middle: o } }, A.prototype.getMetrics = function (A, e) { var t = A + " " + e; return void 0 === this._data[t] && (this._data[t] = this.parseMetrics(A, e)), this._data[t] }, A }(), hB = function () { function A(A) { this._activeEffects = [], this.canvas = A.canvas ? A.canvas : document.createElement("canvas"), this.ctx = this.canvas.getContext("2d"), this.options = A, A.canvas || (this.canvas.width = Math.floor(A.width * A.scale), this.canvas.height = Math.floor(A.height * A.scale), this.canvas.style.width = A.width + "px", this.canvas.style.height = A.height + "px"), this.fontMetrics = new FB(document), this.ctx.scale(this.options.scale, this.options.scale), this.ctx.translate(-A.x + A.scrollX, -A.y + A.scrollY), this.ctx.textBaseline = "bottom", this._activeEffects = [], pe.getInstance(A.id).debug("Canvas renderer initialized (" + A.width + "x" + A.height + " at " + A.x + "," + A.y + ") with scale " + A.scale) } return A.prototype.applyEffects = function (A, e) { for (var t = this; this._activeEffects.length;)this.popEffect(); A.filter(function (A) { return gr(A.target, e) }).forEach(function (A) { return t.applyEffect(A) }) }, A.prototype.applyEffect = function (A) { this.ctx.save(), function (A) { return 0 === A.type }(A) && (this.ctx.translate(A.offsetX, A.offsetY), this.ctx.transform(A.matrix[0], A.matrix[1], A.matrix[2], A.matrix[3], A.matrix[4], A.matrix[5]), this.ctx.translate(-A.offsetX, -A.offsetY)), function (A) { return 1 === A.type }(A) && (this.path(A.path), this.ctx.clip()), this._activeEffects.push(A) }, A.prototype.popEffect = function () { this._activeEffects.pop(), this.ctx.restore() }, A.prototype.renderStack = function (A) { return r(this, void 0, void 0, function () { var e; return n(this, function (t) { switch (t.label) { case 0: return (e = A.element.container.styles).isVisible() ? (this.ctx.globalAlpha = e.opacity, [4, this.renderStackContent(A)]) : [3, 2]; case 1: t.sent(), t.label = 2; case 2: return [2] } }) }) }, A.prototype.renderNode = function (A) { return r(this, void 0, void 0, function () { return n(this, function (e) { switch (e.label) { case 0: return A.container.styles.isVisible() ? [4, this.renderNodeBackgroundAndBorders(A)] : [3, 3]; case 1: return e.sent(), [4, this.renderNodeContent(A)]; case 2: e.sent(), e.label = 3; case 3: return [2] } }) }) }, A.prototype.renderTextWithLetterSpacing = function (A, e) { var t = this; 0 === e ? this.ctx.fillText(A.text, A.bounds.left, A.bounds.top + A.bounds.height) : o(A.text).map(function (A) { return i(A) }).reduce(function (e, r) { return t.ctx.fillText(r, e, A.bounds.top + A.bounds.height), e + t.ctx.measureText(r).width }, A.bounds.left) }, A.prototype.createFontStyle = function (A) { var e = A.fontVariant.filter(function (A) { return "normal" === A || "small-caps" === A }).join(""), t = A.fontFamily.join(", "), r = OA(A.fontSize) ? "" + A.fontSize.number + A.fontSize.unit : A.fontSize.number + "px"; return [[A.fontStyle, e, A.fontWeight, r, t].join(" "), t, r] }, A.prototype.renderTextNode = function (A, e) { return r(this, void 0, void 0, function () { var t, r, B, s, o = this; return n(this, function (n) { return t = this.createFontStyle(e), r = t[0], B = t[1], s = t[2], this.ctx.font = r, A.textBounds.forEach(function (A) { o.ctx.fillStyle = ee(e.color), o.renderTextWithLetterSpacing(A, e.letterSpacing); var t = e.textShadow; t.length && A.text.trim().length && (t.slice(0).reverse().forEach(function (e) { o.ctx.shadowColor = ee(e.color), o.ctx.shadowOffsetX = e.offsetX.number * o.options.scale, o.ctx.shadowOffsetY = e.offsetY.number * o.options.scale, o.ctx.shadowBlur = e.blur.number, o.ctx.fillText(A.text, A.bounds.left, A.bounds.top + A.bounds.height) }), o.ctx.shadowColor = "", o.ctx.shadowOffsetX = 0, o.ctx.shadowOffsetY = 0, o.ctx.shadowBlur = 0), e.textDecorationLine.length && (o.ctx.fillStyle = ee(e.textDecorationColor || e.color), e.textDecorationLine.forEach(function (e) { switch (e) { case 1: var t = o.fontMetrics.getMetrics(B, s).baseline; o.ctx.fillRect(A.bounds.left, Math.round(A.bounds.top + t), A.bounds.width, 1); break; case 2: o.ctx.fillRect(A.bounds.left, Math.round(A.bounds.top), A.bounds.width, 1); break; case 3: var r = o.fontMetrics.getMetrics(B, s).middle; o.ctx.fillRect(A.bounds.left, Math.ceil(A.bounds.top + r), A.bounds.width, 1) } })) }), [2] }) }) }, A.prototype.renderReplacedElement = function (A, e, t) { if (t && A.intrinsicWidth > 0 && A.intrinsicHeight > 0) { var r = uB(A), n = rB(e); this.path(n), this.ctx.save(), this.ctx.clip(), this.ctx.drawImage(t, 0, 0, A.intrinsicWidth, A.intrinsicHeight, r.left, r.top, r.width, r.height), this.ctx.restore() } }, A.prototype.renderNodeContent = function (e) { return r(this, void 0, void 0, function () { var t, r, s, o, i, a, c, Q, w, U, l, C, g, E; return n(this, function (n) { switch (n.label) { case 0: this.applyEffects(e.effects, 4), t = e.container, r = e.curves, s = t.styles, o = 0, i = t.textNodes, n.label = 1; case 1: return o < i.length ? (a = i[o], [4, this.renderTextNode(a, s)]) : [3, 4]; case 2: n.sent(), n.label = 3; case 3: return o++, [3, 1]; case 4: if (!(t instanceof _r)) return [3, 8]; n.label = 5; case 5: return n.trys.push([5, 7, , 8]), [4, this.options.cache.match(t.src)]; case 6: return C = n.sent(), this.renderReplacedElement(t, r, C), [3, 8]; case 7: return n.sent(), pe.getInstance(this.options.id).error("Error loading image " + t.src), [3, 8]; case 8: if (t instanceof Pr && this.renderReplacedElement(t, r, t.canvas), !(t instanceof xr)) return [3, 12]; n.label = 9; case 9: return n.trys.push([9, 11, , 12]), [4, this.options.cache.match(t.svg)]; case 10: return C = n.sent(), this.renderReplacedElement(t, r, C), [3, 12]; case 11: return n.sent(), pe.getInstance(this.options.id).error("Error loading svg " + t.svg.substring(0, 255)), [3, 12]; case 12: return t instanceof en && t.tree ? [4, new A({ id: this.options.id, scale: this.options.scale, backgroundColor: t.backgroundColor, x: 0, y: 0, scrollX: 0, scrollY: 0, width: t.width, height: t.height, cache: this.options.cache, windowWidth: t.width, windowHeight: t.height }).render(t.tree)] : [3, 14]; case 13: c = n.sent(), t.width && t.height && this.ctx.drawImage(c, 0, 0, t.width, t.height, t.bounds.left, t.bounds.top, t.bounds.width, t.bounds.height), n.label = 14; case 14: if (t instanceof Zr && (Q = Math.min(t.bounds.width, t.bounds.height), t.type === Wr ? t.checked && (this.ctx.save(), this.path([new qn(t.bounds.left + .39363 * Q, t.bounds.top + .79 * Q), new qn(t.bounds.left + .16 * Q, t.bounds.top + .5549 * Q), new qn(t.bounds.left + .27347 * Q, t.bounds.top + .44071 * Q), new qn(t.bounds.left + .39694 * Q, t.bounds.top + .5649 * Q), new qn(t.bounds.left + .72983 * Q, t.bounds.top + .23 * Q), new qn(t.bounds.left + .84 * Q, t.bounds.top + .34085 * Q), new qn(t.bounds.left + .39363 * Q, t.bounds.top + .79 * Q)]), this.ctx.fillStyle = ee(707406591), this.ctx.fill(), this.ctx.restore()) : t.type === Yr && t.checked && (this.ctx.save(), this.ctx.beginPath(), this.ctx.arc(t.bounds.left + Q / 2, t.bounds.top + Q / 2, Q / 4, 0, 2 * Math.PI, !0), this.ctx.fillStyle = ee(707406591), this.ctx.fill(), this.ctx.restore())), HB(t) && t.value.length) { switch (this.ctx.font = this.createFontStyle(s)[0], this.ctx.fillStyle = ee(s.color), this.ctx.textBaseline = "middle", this.ctx.textAlign = fB(t.styles.textAlign), E = uB(t), w = 0, t.styles.textAlign) { case yt.CENTER: w += E.width / 2; break; case yt.RIGHT: w += E.width }U = E.add(w, 0, 0, -E.height / 2 + 1), this.ctx.save(), this.path([new qn(E.left, E.top), new qn(E.left + E.width, E.top), new qn(E.left + E.width, E.top + E.height), new qn(E.left, E.top + E.height)]), this.ctx.clip(), this.renderTextWithLetterSpacing(new mr(t.value, U), s.letterSpacing), this.ctx.restore(), this.ctx.textBaseline = "bottom", this.ctx.textAlign = "left" } if (!gr(t.styles.display, 2048)) return [3, 20]; if (null === t.styles.listStyleImage) return [3, 19]; if ((l = t.styles.listStyleImage).type !== Qe.URL) return [3, 18]; C = void 0, g = l.url, n.label = 15; case 15: return n.trys.push([15, 17, , 18]), [4, this.options.cache.match(g)]; case 16: return C = n.sent(), this.ctx.drawImage(C, t.bounds.left - (C.width + 10), t.bounds.top), [3, 18]; case 17: return n.sent(), pe.getInstance(this.options.id).error("Error loading list-style-image " + g), [3, 18]; case 18: return [3, 20]; case 19: e.listValue && t.styles.listStyleType !== It.NONE && (this.ctx.font = this.createFontStyle(s)[0], this.ctx.fillStyle = ee(s.color), this.ctx.textBaseline = "middle", this.ctx.textAlign = "right", E = new B(t.bounds.left, t.bounds.top + WA(t.styles.paddingTop, t.bounds.width), t.bounds.width, (F = s.lineHeight, h = s.fontSize.number, (DA(F) && "normal" === F.value ? 1.2 * h : F.type === u.NUMBER_TOKEN ? h * F.number : VA(F) ? WA(F, h) : h) / 2 + 1)), this.renderTextWithLetterSpacing(new mr(e.listValue, E), s.letterSpacing), this.ctx.textBaseline = "bottom", this.ctx.textAlign = "left"), n.label = 20; case 20: return [2] }var F, h }) }) }, A.prototype.renderStackContent = function (A) { return r(this, void 0, void 0, function () { var e, t, r, B, s, o, i, a, c, Q, u, w, U, l, C; return n(this, function (n) { switch (n.label) { case 0: return [4, this.renderNodeBackgroundAndBorders(A.element)]; case 1: n.sent(), e = 0, t = A.negativeZIndex, n.label = 2; case 2: return e < t.length ? (C = t[e], [4, this.renderStack(C)]) : [3, 5]; case 3: n.sent(), n.label = 4; case 4: return e++, [3, 2]; case 5: return [4, this.renderNodeContent(A.element)]; case 6: n.sent(), r = 0, B = A.nonInlineLevel, n.label = 7; case 7: return r < B.length ? (C = B[r], [4, this.renderNode(C)]) : [3, 10]; case 8: n.sent(), n.label = 9; case 9: return r++, [3, 7]; case 10: s = 0, o = A.nonPositionedFloats, n.label = 11; case 11: return s < o.length ? (C = o[s], [4, this.renderStack(C)]) : [3, 14]; case 12: n.sent(), n.label = 13; case 13: return s++, [3, 11]; case 14: i = 0, a = A.nonPositionedInlineLevel, n.label = 15; case 15: return i < a.length ? (C = a[i], [4, this.renderStack(C)]) : [3, 18]; case 16: n.sent(), n.label = 17; case 17: return i++, [3, 15]; case 18: c = 0, Q = A.inlineLevel, n.label = 19; case 19: return c < Q.length ? (C = Q[c], [4, this.renderNode(C)]) : [3, 22]; case 20: n.sent(), n.label = 21; case 21: return c++, [3, 19]; case 22: u = 0, w = A.zeroOrAutoZIndexOrTransformedOrOpacity, n.label = 23; case 23: return u < w.length ? (C = w[u], [4, this.renderStack(C)]) : [3, 26]; case 24: n.sent(), n.label = 25; case 25: return u++, [3, 23]; case 26: U = 0, l = A.positiveZIndex, n.label = 27; case 27: return U < l.length ? (C = l[U], [4, this.renderStack(C)]) : [3, 30]; case 28: n.sent(), n.label = 29; case 29: return U++, [3, 27]; case 30: return [2] } }) }) }, A.prototype.mask = function (A) { this.ctx.beginPath(), this.ctx.moveTo(0, 0), this.ctx.lineTo(this.canvas.width, 0), this.ctx.lineTo(this.canvas.width, this.canvas.height), this.ctx.lineTo(0, this.canvas.height), this.ctx.lineTo(0, 0), this.formatPath(A.slice(0).reverse()), this.ctx.closePath() }, A.prototype.path = function (A) { this.ctx.beginPath(), this.formatPath(A), this.ctx.closePath() }, A.prototype.formatPath = function (A) { var e = this; A.forEach(function (A, t) { var r = $n(A) ? A.start : A; 0 === t ? e.ctx.moveTo(r.x, r.y) : e.ctx.lineTo(r.x, r.y), $n(A) && e.ctx.bezierCurveTo(A.startControl.x, A.startControl.y, A.endControl.x, A.endControl.y, A.end.x, A.end.y) }) }, A.prototype.renderRepeat = function (A, e, t, r) { this.path(A), this.ctx.fillStyle = e, this.ctx.translate(t, r), this.ctx.fill(), this.ctx.translate(-t, -r) }, A.prototype.resizeImage = function (A, e, t) { if (A.width === e && A.height === t) return A; var r = this.canvas.ownerDocument.createElement("canvas"); return r.width = e, r.height = t, r.getContext("2d").drawImage(A, 0, 0, A.width, A.height, 0, 0, e, t), r }, A.prototype.renderBackgroundImage = function (A) { return r(this, void 0, void 0, function () { var e, t, r, B, s, o; return n(this, function (i) { switch (i.label) { case 0: e = A.styles.backgroundImage.length - 1, t = function (t) { var B, s, o, i, a, c, Q, u, w, U, l, C, g, E, F, h, H, d, f, p, N, K, I, T, m, R, L, O, v, D, b; return n(this, function (n) { switch (n.label) { case 0: if (t.type !== Qe.URL) return [3, 5]; B = void 0, s = t.url, n.label = 1; case 1: return n.trys.push([1, 3, , 4]), [4, r.options.cache.match(s)]; case 2: return B = n.sent(), [3, 4]; case 3: return n.sent(), pe.getInstance(r.options.id).error("Error loading background-image " + s), [3, 4]; case 4: return B && (o = wB(A, e, [B.width, B.height, B.width / B.height]), h = o[0], K = o[1], I = o[2], f = o[3], p = o[4], E = r.ctx.createPattern(r.resizeImage(B, f, p), "repeat"), r.renderRepeat(h, E, K, I)), [3, 6]; case 5: t.type === Qe.LINEAR_GRADIENT ? (i = wB(A, e, [null, null, null]), h = i[0], K = i[1], I = i[2], f = i[3], p = i[4], a = Ce(t.angle, f, p), c = a[0], Q = a[1], u = a[2], w = a[3], U = a[4], (l = document.createElement("canvas")).width = f, l.height = p, C = l.getContext("2d"), g = C.createLinearGradient(Q, w, u, U), le(t.stops, c).forEach(function (A) { return g.addColorStop(A.stop, ee(A.color)) }), C.fillStyle = g, C.fillRect(0, 0, f, p), f > 0 && p > 0 && (E = r.ctx.createPattern(l, "repeat"), r.renderRepeat(h, E, K, I))) : function (A) { return A.type === Qe.RADIAL_GRADIENT }(t) && (F = wB(A, e, [null, null, null]), h = F[0], H = F[1], d = F[2], f = F[3], p = F[4], N = 0 === t.position.length ? [JA] : t.position, K = WA(N[0], f), I = WA(N[N.length - 1], p), T = function (A, e, t, r, n) { var B = 0, s = 0; switch (A.size) { case Me.CLOSEST_SIDE: A.shape === Se.CIRCLE ? B = s = Math.min(Math.abs(e), Math.abs(e - r), Math.abs(t), Math.abs(t - n)) : A.shape === Se.ELLIPSE && (B = Math.min(Math.abs(e), Math.abs(e - r)), s = Math.min(Math.abs(t), Math.abs(t - n))); break; case Me.CLOSEST_CORNER: if (A.shape === Se.CIRCLE) B = s = Math.min(ge(e, t), ge(e, t - n), ge(e - r, t), ge(e - r, t - n)); else if (A.shape === Se.ELLIPSE) { var o = Math.min(Math.abs(t), Math.abs(t - n)) / Math.min(Math.abs(e), Math.abs(e - r)), i = Ee(r, n, e, t, !0), a = i[0], c = i[1]; s = o * (B = ge(a - e, (c - t) / o)) } break; case Me.FARTHEST_SIDE: A.shape === Se.CIRCLE ? B = s = Math.max(Math.abs(e), Math.abs(e - r), Math.abs(t), Math.abs(t - n)) : A.shape === Se.ELLIPSE && (B = Math.max(Math.abs(e), Math.abs(e - r)), s = Math.max(Math.abs(t), Math.abs(t - n))); break; case Me.FARTHEST_CORNER: if (A.shape === Se.CIRCLE) B = s = Math.max(ge(e, t), ge(e, t - n), ge(e - r, t), ge(e - r, t - n)); else if (A.shape === Se.ELLIPSE) { o = Math.max(Math.abs(t), Math.abs(t - n)) / Math.max(Math.abs(e), Math.abs(e - r)); var Q = Ee(r, n, e, t, !1); a = Q[0], c = Q[1], s = o * (B = ge(a - e, (c - t) / o)) } }return Array.isArray(A.size) && (B = WA(A.size[0], r), s = 2 === A.size.length ? WA(A.size[1], n) : B), [B, s] }(t, K, I, f, p), m = T[0], R = T[1], m > 0 && m > 0 && (L = r.ctx.createRadialGradient(H + K, d + I, 0, H + K, d + I, m), le(t.stops, 2 * m).forEach(function (A) { return L.addColorStop(A.stop, ee(A.color)) }), r.path(h), r.ctx.fillStyle = L, m !== R ? (O = A.bounds.left + .5 * A.bounds.width, v = A.bounds.top + .5 * A.bounds.height, b = 1 / (D = R / m), r.ctx.save(), r.ctx.translate(O, v), r.ctx.transform(1, 0, 0, D, 0, 0), r.ctx.translate(-O, -v), r.ctx.fillRect(H, b * (d - v) + v, f, p * b), r.ctx.restore()) : r.ctx.fill())), n.label = 6; case 6: return e--, [2] } }) }, r = this, B = 0, s = A.styles.backgroundImage.slice(0).reverse(), i.label = 1; case 1: return B < s.length ? (o = s[B], [5, t(o)]) : [3, 4]; case 2: i.sent(), i.label = 3; case 3: return B++, [3, 1]; case 4: return [2] } }) }) }, A.prototype.renderBorder = function (A, e, t) { return r(this, void 0, void 0, function () { return n(this, function (r) { return this.path(function (A, e) { switch (e) { case 0: return cB(A.topLeftBorderBox, A.topLeftPaddingBox, A.topRightBorderBox, A.topRightPaddingBox); case 1: return cB(A.topRightBorderBox, A.topRightPaddingBox, A.bottomRightBorderBox, A.bottomRightPaddingBox); case 2: return cB(A.bottomRightBorderBox, A.bottomRightPaddingBox, A.bottomLeftBorderBox, A.bottomLeftPaddingBox); case 3: default: return cB(A.bottomLeftBorderBox, A.bottomLeftPaddingBox, A.topLeftBorderBox, A.topLeftPaddingBox) } }(t, e)), this.ctx.fillStyle = ee(A), this.ctx.fill(), [2] }) }) }, A.prototype.renderNodeBackgroundAndBorders = function (A) { return r(this, void 0, void 0, function () { var e, t, r, B, s, o, i, a, c = this; return n(this, function (n) { switch (n.label) { case 0: return this.applyEffects(A.effects, 2), e = A.container.styles, t = !Ae(e.backgroundColor) || e.backgroundImage.length, r = [{ style: e.borderTopStyle, color: e.borderTopColor }, { style: e.borderRightStyle, color: e.borderRightColor }, { style: e.borderBottomStyle, color: e.borderBottomColor }, { style: e.borderLeftStyle, color: e.borderLeftColor }], B = dB(gB(e.backgroundClip, 0), A.curves), t || e.boxShadow.length ? (this.ctx.save(), this.path(B), this.ctx.clip(), Ae(e.backgroundColor) || (this.ctx.fillStyle = ee(e.backgroundColor), this.ctx.fill()), [4, this.renderBackgroundImage(A.container)]) : [3, 2]; case 1: n.sent(), this.ctx.restore(), e.boxShadow.slice(0).reverse().forEach(function (e) { c.ctx.save(); var t, r, n, B, s, o = tB(A.curves), i = e.inset ? 0 : 1e4, a = (t = o, r = -i + (e.inset ? 1 : -1) * e.spread.number, n = (e.inset ? 1 : -1) * e.spread.number, B = e.spread.number * (e.inset ? -2 : 2), s = e.spread.number * (e.inset ? -2 : 2), t.map(function (A, e) { switch (e) { case 0: return A.add(r, n); case 1: return A.add(r + B, n); case 2: return A.add(r + B, n + s); case 3: return A.add(r, n + s) }return A })); e.inset ? (c.path(o), c.ctx.clip(), c.mask(a)) : (c.mask(o), c.ctx.clip(), c.path(a)), c.ctx.shadowOffsetX = e.offsetX.number + i, c.ctx.shadowOffsetY = e.offsetY.number, c.ctx.shadowColor = ee(e.color), c.ctx.shadowBlur = e.blur.number, c.ctx.fillStyle = e.inset ? ee(e.color) : "rgba(0,0,0,1)", c.ctx.fill(), c.ctx.restore() }), n.label = 2; case 2: s = 0, o = 0, i = r, n.label = 3; case 3: return o < i.length ? (a = i[o]).style === ke.NONE || Ae(a.color) ? [3, 5] : [4, this.renderBorder(a.color, s, A.curves)] : [3, 7]; case 4: n.sent(), n.label = 5; case 5: s++, n.label = 6; case 6: return o++, [3, 3]; case 7: return [2] } }) }) }, A.prototype.render = function (A) { return r(this, void 0, void 0, function () { var e; return n(this, function (t) { switch (t.label) { case 0: return this.options.backgroundColor && (this.ctx.fillStyle = ee(this.options.backgroundColor), this.ctx.fillRect(this.options.x - this.options.scrollX, this.options.y - this.options.scrollY, this.options.width, this.options.height)), r = new oB(A, []), n = new sB(r), iB(r, n, n, B = []), aB(r.container, B), e = n, [4, this.renderStack(e)]; case 1: return t.sent(), this.applyEffects([], 2), [2, this.canvas] }var r, n, B }) }) }, A }(), HB = function (A) { return A instanceof $r || (A instanceof jr || A instanceof Zr && A.type !== Yr && A.type !== Wr) }, dB = function (A, e) { switch (A) { case oe.BORDER_BOX: return tB(e); case oe.CONTENT_BOX: return function (A) { return [A.topLeftContentBox, A.topRightContentBox, A.bottomRightContentBox, A.bottomLeftContentBox] }(e); case oe.PADDING_BOX: default: return rB(e) } }, fB = function (A) { switch (A) { case yt.CENTER: return "center"; case yt.RIGHT: return "right"; case yt.LEFT: default: return "left" } }, pB = function () { function A(A) { this.canvas = A.canvas ? A.canvas : document.createElement("canvas"), this.ctx = this.canvas.getContext("2d"), this.options = A, this.canvas.width = Math.floor(A.width * A.scale), this.canvas.height = Math.floor(A.height * A.scale), this.canvas.style.width = A.width + "px", this.canvas.style.height = A.height + "px", this.ctx.scale(this.options.scale, this.options.scale), this.ctx.translate(-A.x + A.scrollX, -A.y + A.scrollY), pe.getInstance(A.id).debug("EXPERIMENTAL ForeignObject renderer initialized (" + A.width + "x" + A.height + " at " + A.x + "," + A.y + ") with scale " + A.scale) } return A.prototype.render = function (A) { return r(this, void 0, void 0, function () { var e, t; return n(this, function (r) { switch (r.label) { case 0: return e = He(Math.max(this.options.windowWidth, this.options.width) * this.options.scale, Math.max(this.options.windowHeight, this.options.height) * this.options.scale, this.options.scrollX * this.options.scale, this.options.scrollY * this.options.scale, A), [4, NB(e)]; case 1: return t = r.sent(), this.options.backgroundColor && (this.ctx.fillStyle = ee(this.options.backgroundColor), this.ctx.fillRect(0, 0, this.options.width * this.options.scale, this.options.height * this.options.scale)), this.ctx.drawImage(t, -this.options.x * this.options.scale, -this.options.y * this.options.scale), [2, this.canvas] } }) }) }, A }(), NB = function (A) { return new Promise(function (e, t) { var r = new Image; r.onload = function () { e(r) }, r.onerror = t, r.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent((new XMLSerializer).serializeToString(A)) }) }, KB = function (A) { return $A(LA.create(A).parseComponentValue()) }; "undefined" != typeof window && Ne.setContext(window); var IB = function (A, e) { return r(void 0, void 0, void 0, function () { var r, o, i, a, c, Q, u, w, U, l, C, g, E, F, h, H, d, f, p, N, K, I, T; return n(this, function (n) { switch (n.label) { case 0: if (!(r = A.ownerDocument)) throw new Error("Element is not attached to a Document"); if (!(o = r.defaultView)) throw new Error("Document is not attached to a Window"); return i = (Math.round(1e3 * Math.random()) + Date.now()).toString(16), a = gn(A) || "HTML" === A.tagName ? function (A) { var e = A.body, t = A.documentElement; if (!e || !t) throw new Error("Unable to get document size"); var r = Math.max(Math.max(e.scrollWidth, t.scrollWidth), Math.max(e.offsetWidth, t.offsetWidth), Math.max(e.clientWidth, t.clientWidth)), n = Math.max(Math.max(e.scrollHeight, t.scrollHeight), Math.max(e.offsetHeight, t.offsetHeight), Math.max(e.clientHeight, t.clientHeight)); return new B(0, 0, r, n) }(r) : s(A), c = a.width, Q = a.height, u = a.left, w = a.top, U = t({}, { allowTaint: !1, imageTimeout: 15e3, proxy: void 0, useCORS: !1 }, e), l = { backgroundColor: "#ffffff", cache: e.cache ? e.cache : Ne.create(i, U), logging: !0, removeContainer: !0, foreignObjectRendering: !1, scale: o.devicePixelRatio || 1, windowWidth: o.innerWidth, windowHeight: o.innerHeight, scrollX: o.pageXOffset, scrollY: o.pageYOffset, x: u, y: w, width: Math.ceil(c), height: Math.ceil(Q), id: i }, C = t({}, l, U, e), g = new B(C.scrollX, C.scrollY, C.windowWidth, C.windowHeight), pe.create({ id: i, enabled: C.logging }), pe.getInstance(i).debug("Starting document clone"), E = new Sn(A, { id: i, onclone: C.onclone, ignoreElements: C.ignoreElements, inlineImages: C.foreignObjectRendering, copyStyles: C.foreignObjectRendering }), (F = E.clonedReferenceElement) ? [4, E.toIFrame(r, g)] : [2, Promise.reject("Unable to find element in cloned iframe")]; case 1: return h = n.sent(), H = r.documentElement ? KB(getComputedStyle(r.documentElement).backgroundColor) : ce.TRANSPARENT, d = r.body ? KB(getComputedStyle(r.body).backgroundColor) : ce.TRANSPARENT, f = e.backgroundColor, p = "string" == typeof f ? KB(f) : null === f ? ce.TRANSPARENT : 4294967295, N = A === r.documentElement ? Ae(H) ? Ae(d) ? p : d : H : p, K = { id: i, cache: C.cache, canvas: C.canvas, backgroundColor: N, scale: C.scale, x: C.x, y: C.y, scrollX: C.scrollX, scrollY: C.scrollY, width: C.width, height: C.height, windowWidth: C.windowWidth, windowHeight: C.windowHeight }, C.foreignObjectRendering ? (pe.getInstance(i).debug("Document cloned, using foreign object rendering"), [4, new pB(K).render(F)]) : [3, 3]; case 2: return I = n.sent(), [3, 5]; case 3: return pe.getInstance(i).debug("Document cloned, using computed rendering"), Ne.attachInstance(C.cache), pe.getInstance(i).debug("Starting DOM parsing"), T = Bn(F), Ne.detachInstance(), N === T.styles.backgroundColor && (T.styles.backgroundColor = ce.TRANSPARENT), pe.getInstance(i).debug("Starting renderer"), [4, new hB(K).render(T)]; case 4: I = n.sent(), n.label = 5; case 5: return !0 === C.removeContainer && (Sn.destroy(h) || pe.getInstance(i).error("Cannot detach cloned iframe as it is not in the DOM anymore")), pe.getInstance(i).debug("Finished rendering"), pe.destroy(i), Ne.destroy(i), [2, I] } }) }) }; return function (A, e) { return void 0 === e && (e = {}), IB(A, e) } });;
!function (t, e) { "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : t.jspdf = e() }(this, function () { "use strict"; var t = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t }, e = (function () { function t(t) { this.value = t } function e(e) { function n(i, o) { try { var s = e[i](o), a = s.value; a instanceof t ? Promise.resolve(a.value).then(function (t) { n("next", t) }, function (t) { n("throw", t) }) : r(s.done ? "return" : "normal", s.value) } catch (t) { r("throw", t) } } function r(t, e) { switch (t) { case "return": i.resolve({ value: e, done: !0 }); break; case "throw": i.reject(e); break; default: i.resolve({ value: e, done: !1 }) }(i = i.next) ? n(i.key, i.arg) : o = null } var i, o; this._invoke = function (t, e) { return new Promise(function (r, s) { var a = { key: t, arg: e, resolve: r, reject: s, next: null }; o ? o = o.next = a : (i = o = a, n(t, e)) }) }, "function" != typeof e.return && (this.return = void 0) } "function" == typeof Symbol && Symbol.asyncIterator && (e.prototype[Symbol.asyncIterator] = function () { return this }), e.prototype.next = function (t) { return this._invoke("next", t) }, e.prototype.throw = function (t) { return this._invoke("throw", t) }, e.prototype.return = function (t) { return this._invoke("return", t) } }(), function (e) { function n(t) { var n = {}; this.subscribe = function (t, e, r) { if ("function" != typeof e) return !1; n.hasOwnProperty(t) || (n[t] = {}); var i = Math.random().toString(35); return n[t][i] = [e, !!r], i }, this.unsubscribe = function (t) { for (var e in n) if (n[e][t]) return delete n[e][t], !0; return !1 }, this.publish = function (r) { if (n.hasOwnProperty(r)) { var i = Array.prototype.slice.call(arguments, 1), o = []; for (var s in n[r]) { var a = n[r][s]; try { a[0].apply(t, i) } catch (t) { e.console && console.error("jsPDF PubSub Error", t.message, t) } a[1] && o.push(s) } o.length && o.forEach(this.unsubscribe) } } } function r(c, l, u, h) { var f = {}; "object" === (void 0 === c ? "undefined" : t(c)) && (c = (f = c).orientation, l = f.unit || l, u = f.format || u, h = f.compress || f.compressPdf || h), l = l || "mm", u = u || "a4", c = ("" + (c || "P")).toLowerCase(); var d, p, g, m, w, y, v, b, x, k = (("" + u).toLowerCase(), !!h && "function" == typeof Uint8Array), _ = f.textColor || "0 g", C = f.drawColor || "0 G", A = f.fontSize || 16, S = f.lineHeight || 1.15, q = f.lineWidth || .200025, T = 2, I = !1, P = [], E = {}, O = {}, F = 0, R = [], B = [], D = [], j = [], z = [], N = 0, L = 0, M = 0, U = { title: "", subject: "", author: "", keywords: "", creator: "" }, H = {}, W = new n(H), X = function (t) { return t.toFixed(2) }, V = function (t) { return t.toFixed(3) }, Y = function (t) { return ("0" + parseInt(t)).slice(-2) }, G = function (t) { I ? R[m].push(t) : (M += t.length + 1, j.push(t)) }, J = function () { return P[++T] = M, G(T + " 0 obj"), T }, Q = function (t) { G("stream"), G(t), G("endstream") }, K = function () { var t, n, i, o, a, c, l, u, h, f = []; for (l = e.adler32cs || r.adler32cs, k && void 0 === l && (k = !1), t = 1; t <= F; t++) { if (f.push(J()), u = (w = D[t].width) * p, h = (y = D[t].height) * p, G("<</Type /Page"), G("/Parent 1 0 R"), G("/Resources 2 0 R"), G("/MediaBox [0 0 " + X(u) + " " + X(h) + "]"), W.publish("putPage", { pageNumber: t, page: R[t] }), G("/Contents " + (T + 1) + " 0 R"), G(">>"), G("endobj"), n = R[t].join("\n"), J(), k) { for (i = [], o = n.length; o--;)i[o] = n.charCodeAt(o); c = l.from(n), (a = new s(6)).append(new Uint8Array(i)), n = a.flush(), (i = new Uint8Array(n.length + 6)).set(new Uint8Array([120, 156])), i.set(n, 2), i.set(new Uint8Array([255 & c, c >> 8 & 255, c >> 16 & 255, c >> 24 & 255]), n.length + 2), n = String.fromCharCode.apply(null, i), G("<</Length " + n.length + " /Filter [/FlateDecode]>>") } else G("<</Length " + n.length + ">>"); Q(n), G("endobj") } P[1] = M, G("1 0 obj"), G("<</Type /Pages"); var d = "/Kids ["; for (o = 0; o < F; o++)d += f[o] + " 0 R "; G(d + "]"), G("/Count " + F), G(">>"), G("endobj"), W.publish("postPutPages") }, $ = function (t) { t.objectNumber = J(), G("<</BaseFont/" + t.PostScriptName + "/Type/Font"), "string" == typeof t.encoding && G("/Encoding/" + t.encoding), G("/Subtype/Type1>>"), G("endobj") }, Z = function () { for (var t in G("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"), G("/Font <<"), E) E.hasOwnProperty(t) && G("/" + t + " " + E[t].objectNumber + " 0 R"); G(">>"), G("/XObject <<"), W.publish("putXobjectDict"), G(">>") }, tt = function () { (function () { for (var t in E) E.hasOwnProperty(t) && $(E[t]) })(), W.publish("putResources"), P[2] = M, G("2 0 obj"), G("<<"), Z(), G(">>"), G("endobj"), W.publish("postPutResources") }, et = function (t, e, n) { O.hasOwnProperty(e) || (O[e] = {}), O[e][n] = t }, nt = function (t, e, n, r) { var i = "F" + (Object.keys(E).length + 1).toString(10), o = E[i] = { id: i, PostScriptName: t, fontName: e, fontStyle: n, encoding: r, metadata: {} }; return et(i, e, n), W.publish("addFont", o), i }, rt = function (t, e) { return function (t, e) { var n, r, i, o, s, a, c, l, u; if (i = (e = e || {}).sourceEncoding || "Unicode", s = e.outputEncoding, (e.autoencode || s) && E[d].metadata && E[d].metadata[i] && E[d].metadata[i].encoding && (o = E[d].metadata[i].encoding, !s && E[d].encoding && (s = E[d].encoding), !s && o.codePages && (s = o.codePages[0]), "string" == typeof s && (s = o[s]), s)) { for (c = !1, a = [], n = 0, r = t.length; n < r; n++)(l = s[t.charCodeAt(n)]) ? a.push(String.fromCharCode(l)) : a.push(t[n]), a[n].charCodeAt(0) >> 8 && (c = !0); t = a.join("") } for (n = t.length; void 0 === c && 0 !== n;)t.charCodeAt(n - 1) >> 8 && (c = !0), n--; if (!c) return t; for (a = e.noBOM ? [] : [254, 255], n = 0, r = t.length; n < r; n++) { if ((u = (l = t.charCodeAt(n)) >> 8) >> 8) throw new Error("Character at position " + n + " of string '" + t + "' exceeds 16bits. Cannot be encoded into UCS-2 BE"); a.push(u), a.push(l - (u << 8)) } return String.fromCharCode.apply(void 0, a) }(t, e).replace(/\\/g, "\\\\").replace(/\(/g, "\\(").replace(/\)/g, "\\)") }, it = function () { for (var t in G("/Producer (jsPDF " + r.version + ")"), U) U.hasOwnProperty(t) && U[t] && G("/" + t.substr(0, 1).toUpperCase() + t.substr(1) + " (" + rt(U[t]) + ")"); var e = new Date, n = e.getTimezoneOffset(), i = n < 0 ? "+" : "-", o = Math.floor(Math.abs(n / 60)), s = Math.abs(n % 60), a = [i, Y(o), "'", Y(s), "'"].join(""); G(["/CreationDate (D:", e.getFullYear(), Y(e.getMonth() + 1), Y(e.getDate()), Y(e.getHours()), Y(e.getMinutes()), Y(e.getSeconds()), a, ")"].join("")) }, ot = function () { (function (t, e) { var n = "string" == typeof e && e.toLowerCase(); if ("string" == typeof t) { var r = t.toLowerCase(); a.hasOwnProperty(r) && (t = a[r][0] / p, e = a[r][1] / p) } if (Array.isArray(t) && (e = t[1], t = t[0]), n) { switch (n.substr(0, 1)) { case "l": e > t && (n = "s"); break; case "p": t > e && (n = "s") }"s" === n && (g = t, t = e, e = g) } I = !0, R[++F] = [], D[F] = { width: Number(t) || w, height: Number(e) || y }, B[F] = {}, st(F) }).apply(this, arguments), G(X(q * p) + " w"), G(C), 0 !== N && G(N + " J"), 0 !== L && G(L + " j"), W.publish("addPage", { pageNumber: F }) }, st = function (t) { t > 0 && t <= F && (m = t, w = D[t].width, y = D[t].height) }, at = function (t, e) { var n; switch (t = void 0 !== t ? t : E[d].fontName, e = void 0 !== e ? e : E[d].fontStyle, void 0 !== t && (t = t.toLowerCase()), t) { case "sans-serif": case "verdana": case "arial": case "helvetica": t = "helvetica"; break; case "fixed": case "monospace": case "terminal": case "courier": t = "courier"; break; case "serif": case "cursive": case "fantasy": default: t = "times" }try { n = O[t][e] } catch (t) { } return n || null == (n = O.times[e]) && (n = O.times.normal), n }, ct = function () { I = !1, T = 2, M = 0, j = [], P = [], z = [], W.publish("buildDocument"), G("%PDF-" + o), K(), function () { W.publish("putAdditionalObjects"); for (var t = 0; t < z.length; t++) { var e = z[t]; P[e.objId] = M, G(e.objId + " 0 obj"), G(e.content), G("endobj") } T += z.length, W.publish("postPutAdditionalObjects") }(), tt(), J(), G("<<"), it(), G(">>"), G("endobj"), J(), G("<<"), function () { switch (G("/Type /Catalog"), G("/Pages 1 0 R"), b || (b = "fullwidth"), b) { case "fullwidth": G("/OpenAction [3 0 R /FitH null]"); break; case "fullheight": G("/OpenAction [3 0 R /FitV null]"); break; case "fullpage": G("/OpenAction [3 0 R /Fit]"); break; case "original": G("/OpenAction [3 0 R /XYZ null null 1]"); break; default: var t = "" + b; "%" === t.substr(t.length - 1) && (b = parseInt(b) / 100), "number" == typeof b && G("/OpenAction [3 0 R /XYZ null null " + X(b) + "]") }switch (x || (x = "continuous"), x) { case "continuous": G("/PageLayout /OneColumn"); break; case "single": G("/PageLayout /SinglePage"); break; case "two": case "twoleft": G("/PageLayout /TwoColumnLeft"); break; case "tworight": G("/PageLayout /TwoColumnRight") }v && G("/PageMode /" + v), W.publish("putCatalog") }(), G(">>"), G("endobj"); var t, e = M, n = "0000000000"; for (G("xref"), G("0 " + (T + 1)), G(n + " 65535 f "), t = 1; t <= T; t++) { var r = P[t]; G("function" == typeof r ? (n + P[t]()).slice(-10) + " 00000 n " : (n + P[t]).slice(-10) + " 00000 n ") } return G("trailer"), G("<<"), G("/Size " + (T + 1)), G("/Root " + T + " 0 R"), G("/Info " + (T - 1) + " 0 R"), G(">>"), G("startxref"), G("" + e), G("%%EOF"), I = !0, j.join("\n") }, lt = function (t) { var e = "S"; return "F" === t ? e = "f" : "FD" === t || "DF" === t ? e = "B" : "f" !== t && "f*" !== t && "B" !== t && "B*" !== t || (e = t), e }, ut = function () { for (var t = ct(), e = t.length, n = new ArrayBuffer(e), r = new Uint8Array(n); e--;)r[e] = t.charCodeAt(e); return n }, ht = function () { return new Blob([ut()], { type: "application/pdf" }) }, ft = function (t) { return t.foo = function () { try { return t.apply(this, arguments) } catch (t) { var n = t.stack || ""; ~n.indexOf(" at ") && (n = n.split(" at ")[1]); var r = "Error in function " + n.split("\n")[0].split("<")[0] + ": " + t.message; if (!e.console) throw new Error(r); e.console.error(r, t), e.alert && alert(r) } }, t.foo.bar = t, t.foo }(function (t, n) { var r = "dataur" === ("" + t).substr(0, 6) ? "data:application/pdf;base64," + btoa(ct()) : 0; switch (t) { case void 0: return ct(); case "save": if (navigator.getUserMedia && (void 0 === e.URL || void 0 === e.URL.createObjectURL)) return H.output("dataurlnewwindow"); i(ht(), n), "function" == typeof i.unload && e.setTimeout && setTimeout(i.unload, 911); break; case "arraybuffer": return ut(); case "blob": return ht(); case "bloburi": case "bloburl": return e.URL && e.URL.createObjectURL(ht()) || void 0; case "datauristring": case "dataurlstring": return r; case "dataurlnewwindow": var o = e.open(r); if (o || "undefined" == typeof safari) return o; case "datauri": case "dataurl": return e.document.location.href = r; default: throw new Error('Output type "' + t + '" is not supported.') } }); switch (l) { case "pt": p = 1; break; case "mm": p = 72 / 25.4000508; break; case "cm": p = 72 / 2.54000508; break; case "in": p = 72; break; case "px": p = 96 / 72; break; case "pc": case "em": p = 12; break; case "ex": p = 6; break; default: throw "Invalid unit: " + l }for (var dt in H.internal = { pdfEscape: rt, getStyle: lt, getFont: function () { return E[at.apply(H, arguments)] }, getFontSize: function () { return A }, getLineHeight: function () { return A * S }, write: function (t) { G(1 === arguments.length ? t : Array.prototype.join.call(arguments, " ")) }, getCoordinateString: function (t) { return X(t * p) }, getVerticalCoordinateString: function (t) { return X((y - t) * p) }, collections: {}, newObject: J, newAdditionalObject: function () { var t = 2 * R.length + 1, e = { objId: t += z.length, content: "" }; return z.push(e), e }, newObjectDeferred: function () { return P[++T] = function () { return M }, T }, newObjectDeferredBegin: function (t) { P[t] = M }, putStream: Q, events: W, scaleFactor: p, pageSize: { get width() { return w }, get height() { return y } }, output: function (t, e) { return ft(t, e) }, getNumberOfPages: function () { return R.length - 1 }, pages: R, out: G, f2: X, getPageInfo: function (t) { return { objId: 2 * (t - 1) + 3, pageNumber: t, pageContext: B[t] } }, getCurrentPageInfo: function () { return { objId: 2 * (m - 1) + 3, pageNumber: m, pageContext: B[m] } }, getPDFVersion: function () { return o } }, H.addPage = function () { return ot.apply(this, arguments), this }, H.setPage = function () { return st.apply(this, arguments), this }, H.insertPage = function (t) { return this.addPage(), this.movePage(m, t), this }, H.movePage = function (t, e) { if (t > e) { for (var n = R[t], r = D[t], i = B[t], o = t; o > e; o--)R[o] = R[o - 1], D[o] = D[o - 1], B[o] = B[o - 1]; R[e] = n, D[e] = r, B[e] = i, this.setPage(e) } else if (t < e) { for (n = R[t], r = D[t], i = B[t], o = t; o < e; o++)R[o] = R[o + 1], D[o] = D[o + 1], B[o] = B[o + 1]; R[e] = n, D[e] = r, B[e] = i, this.setPage(e) } return this }, H.deletePage = function () { return function (t) { t > 0 && t <= F && (R.splice(t, 1), D.splice(t, 1), m > --F && (m = F), this.setPage(m)) }.apply(this, arguments), this }, H.setDisplayMode = function (t, e, n) { b = t, x = e, v = n; if (-1 == [void 0, null, "UseNone", "UseOutlines", "UseThumbs", "FullScreen"].indexOf(n)) throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "' + n + '" is not recognized.'); return this }, H.text = function (t, e, n, r, i, o) { function s(t) { return t = t.split("\t").join(Array(f.TabLen || 9).join(" ")), rt(t, r) } "number" == typeof t && (g = n, n = e, e = t, t = g), "string" == typeof t && (t = t.match(/[\n\r]/) ? t.split(/\r\n|\r|\n/g) : [t]), "string" == typeof i && (o = i, i = null), "string" == typeof r && (o = r, r = null), "number" == typeof r && (i = r, r = null); var a = "", c = "Td"; if (i) { i *= Math.PI / 180; var l = Math.cos(i), u = Math.sin(i); a = [X(l), X(u), X(-1 * u), X(l), ""].join(" "), c = "Tm" } "noBOM" in (r = r || {}) || (r.noBOM = !0), "autoencode" in r || (r.autoencode = !0); var h, m = "", w = this.internal.getCurrentPageInfo().pageContext; if (!0 === r.stroke ? !0 !== w.lastTextWasStroke && (m = "1 Tr\n", w.lastTextWasStroke = !0) : (w.lastTextWasStroke && (m = "0 Tr\n"), w.lastTextWasStroke = !1), void 0 === this._runningPageHeight && (this._runningPageHeight = 0), "string" == typeof t) t = s(t); else { if ("[object Array]" !== Object.prototype.toString.call(t)) throw new Error('Type of text must be string or Array. "' + t + '" is not recognized.'); for (var v = t.concat(), b = [], x = v.length; x--;)b.push(s(v.shift())); var k = Math.ceil((y - n - this._runningPageHeight) * p / (A * S)); if (0 <= k && b.length, o) { var C, q, T, I = A * S, P = t.map(function (t) { return this.getStringUnitWidth(t) * A / p }, this); if (T = Math.max.apply(Math, P), "center" === o) C = e - T / 2, e -= P[0] / 2; else { if ("right" !== o) throw new Error('Unrecognized alignment option, use "center" or "right".'); C = e - T, e -= P[0] } q = e, t = b[0]; var E = 1; for (x = b.length; E < x; E++) { var O = T - P[E]; "center" === o && (O /= 2), t += ") Tj\n" + (C - q + O) + " -" + I + " Td (" + b[E], q = C + O } } else t = b.join(") Tj\nT* (") } return h = X((y - n) * p), G("BT\n/" + d + " " + A + " Tf\n" + A * S + " TL\n" + m + _ + "\n" + a + X(e * p) + " " + h + " " + c + "\n(" + t + ") Tj\nET"), this }, H.lstext = function (t, e, n, r) { console.warn("jsPDF.lstext is deprecated"); for (var i = 0, o = t.length; i < o; i++, e += r)this.text(t[i], e, n); return this }, H.line = function (t, e, n, r) { return this.lines([[n - t, r - e]], t, e) }, H.clip = function () { G("W"), G("S") }, H.clip_fixed = function (t) { G("evenodd" === t ? "W*" : "W"), G("n") }, H.lines = function (t, e, n, r, i, o) { var s, a, c, l, u, h, f, d, m, w, v; for ("number" == typeof t && (g = n, n = e, e = t, t = g), r = r || [1, 1], G(V(e * p) + " " + V((y - n) * p) + " m "), s = r[0], a = r[1], l = t.length, w = e, v = n, c = 0; c < l; c++)2 === (u = t[c]).length ? (w = u[0] * s + w, v = u[1] * a + v, G(V(w * p) + " " + V((y - v) * p) + " l")) : (h = u[0] * s + w, f = u[1] * a + v, d = u[2] * s + w, m = u[3] * a + v, w = u[4] * s + w, v = u[5] * a + v, G(V(h * p) + " " + V((y - f) * p) + " " + V(d * p) + " " + V((y - m) * p) + " " + V(w * p) + " " + V((y - v) * p) + " c")); return o && G(" h"), null !== i && G(lt(i)), this }, H.rect = function (t, e, n, r, i) { return lt(i), G([X(t * p), X((y - e) * p), X(n * p), X(-r * p), "re"].join(" ")), null !== i && G(lt(i)), this }, H.triangle = function (t, e, n, r, i, o, s) { return this.lines([[n - t, r - e], [i - n, o - r], [t - i, e - o]], t, e, [1, 1], s, !0), this }, H.roundedRect = function (t, e, n, r, i, o, s) { var a = 4 / 3 * (Math.SQRT2 - 1); return this.lines([[n - 2 * i, 0], [i * a, 0, i, o - o * a, i, o], [0, r - 2 * o], [0, o * a, -i * a, o, -i, o], [2 * i - n, 0], [-i * a, 0, -i, -o * a, -i, -o], [0, 2 * o - r], [0, -o * a, i * a, -o, i, -o]], t + i, e, [1, 1], s), this }, H.ellipse = function (t, e, n, r, i) { var o = 4 / 3 * (Math.SQRT2 - 1) * n, s = 4 / 3 * (Math.SQRT2 - 1) * r; return G([X((t + n) * p), X((y - e) * p), "m", X((t + n) * p), X((y - (e - s)) * p), X((t + o) * p), X((y - (e - r)) * p), X(t * p), X((y - (e - r)) * p), "c"].join(" ")), G([X((t - o) * p), X((y - (e - r)) * p), X((t - n) * p), X((y - (e - s)) * p), X((t - n) * p), X((y - e) * p), "c"].join(" ")), G([X((t - n) * p), X((y - (e + s)) * p), X((t - o) * p), X((y - (e + r)) * p), X(t * p), X((y - (e + r)) * p), "c"].join(" ")), G([X((t + o) * p), X((y - (e + r)) * p), X((t + n) * p), X((y - (e + s)) * p), X((t + n) * p), X((y - e) * p), "c"].join(" ")), null !== i && G(lt(i)), this }, H.circle = function (t, e, n, r) { return this.ellipse(t, e, n, n, r) }, H.setProperties = function (t) { for (var e in U) U.hasOwnProperty(e) && t[e] && (U[e] = t[e]); return this }, H.setFontSize = function (t) { return A = t, this }, H.setFont = function (t, e) { return d = at(t, e), this }, H.setFontStyle = H.setFontType = function (t) { return d = at(void 0, t), this }, H.getFontList = function () { var t, e, n, r = {}; for (t in O) if (O.hasOwnProperty(t)) for (e in r[t] = n = [], O[t]) O[t].hasOwnProperty(e) && n.push(e); return r }, H.addFont = function (t, e, n) { nt(t, e, n, "StandardEncoding") }, H.setLineWidth = function (t) { return G((t * p).toFixed(2) + " w"), this }, H.setDrawColor = function (t, e, n, r) { var i; return i = void 0 === e || void 0 === r && t === e === n ? "string" == typeof t ? t + " G" : X(t / 255) + " G" : void 0 === r ? "string" == typeof t ? [t, e, n, "RG"].join(" ") : [X(t / 255), X(e / 255), X(n / 255), "RG"].join(" ") : "string" == typeof t ? [t, e, n, r, "K"].join(" ") : [X(t), X(e), X(n), X(r), "K"].join(" "), G(i), this }, H.setFillColor = function (e, n, r, i) { var o; return void 0 === n || void 0 === i && e === n === r ? o = "string" == typeof e ? e + " g" : X(e / 255) + " g" : void 0 === i || "object" === (void 0 === i ? "undefined" : t(i)) ? (o = "string" == typeof e ? [e, n, r, "rg"].join(" ") : [X(e / 255), X(n / 255), X(r / 255), "rg"].join(" "), i && 0 === i.a && (o = ["255", "255", "255", "rg"].join(" "))) : o = "string" == typeof e ? [e, n, r, i, "k"].join(" ") : [X(e), X(n), X(r), X(i), "k"].join(" "), G(o), this }, H.setTextColor = function (t, e, n) { if ("string" == typeof t && /^#[0-9A-Fa-f]{6}$/.test(t)) { var r = parseInt(t.substr(1), 16); t = r >> 16 & 255, e = r >> 8 & 255, n = 255 & r } return _ = 0 === t && 0 === e && 0 === n || void 0 === e ? V(t / 255) + " g" : [V(t / 255), V(e / 255), V(n / 255), "rg"].join(" "), this }, H.CapJoinStyles = { 0: 0, butt: 0, but: 0, miter: 0, 1: 1, round: 1, rounded: 1, circle: 1, 2: 2, projecting: 2, project: 2, square: 2, bevel: 2 }, H.setLineCap = function (t) { var e = this.CapJoinStyles[t]; if (void 0 === e) throw new Error("Line cap style of '" + t + "' is not recognized. See or extend .CapJoinStyles property for valid styles"); return N = e, G(e + " J"), this }, H.setLineJoin = function (t) { var e = this.CapJoinStyles[t]; if (void 0 === e) throw new Error("Line join style of '" + t + "' is not recognized. See or extend .CapJoinStyles property for valid styles"); return L = e, G(e + " j"), this }, H.output = ft, H.save = function (t) { H.output("save", t) }, r.API) r.API.hasOwnProperty(dt) && ("events" === dt && r.API.events.length ? function (t, e) { var n, r, i; for (i = e.length - 1; -1 !== i; i--)n = e[i][0], r = e[i][1], t.subscribe.apply(t, [n].concat("function" == typeof r ? [r] : r)) }(W, r.API.events) : H[dt] = r.API[dt]); return function () { for (var t = "helvetica", e = "times", n = "courier", r = "normal", i = "bold", o = "italic", s = "bolditalic", a = [["Helvetica", t, r], ["Helvetica-Bold", t, i], ["Helvetica-Oblique", t, o], ["Helvetica-BoldOblique", t, s], ["Courier", n, r], ["Courier-Bold", n, i], ["Courier-Oblique", n, o], ["Courier-BoldOblique", n, s], ["Times-Roman", e, r], ["Times-Bold", e, i], ["Times-Italic", e, o], ["Times-BoldItalic", e, s], ["ZapfDingbats", "zapfdingbats"]], c = 0, l = a.length; c < l; c++) { var u = nt(a[c][0], a[c][1], a[c][2], "StandardEncoding"), h = a[c][0].split("-"); et(u, h[0], h[1] || "") } W.publish("addFonts", { fonts: E, dictionary: O }) }(), d = "F1", ot(u, c), W.publish("initialized"), H } var o = "1.3", a = { a0: [2383.94, 3370.39], a1: [1683.78, 2383.94], a2: [1190.55, 1683.78], a3: [841.89, 1190.55], a4: [595.28, 841.89], a5: [419.53, 595.28], a6: [297.64, 419.53], a7: [209.76, 297.64], a8: [147.4, 209.76], a9: [104.88, 147.4], a10: [73.7, 104.88], b0: [2834.65, 4008.19], b1: [2004.09, 2834.65], b2: [1417.32, 2004.09], b3: [1000.63, 1417.32], b4: [708.66, 1000.63], b5: [498.9, 708.66], b6: [354.33, 498.9], b7: [249.45, 354.33], b8: [175.75, 249.45], b9: [124.72, 175.75], b10: [87.87, 124.72], c0: [2599.37, 3676.54], c1: [1836.85, 2599.37], c2: [1298.27, 1836.85], c3: [918.43, 1298.27], c4: [649.13, 918.43], c5: [459.21, 649.13], c6: [323.15, 459.21], c7: [229.61, 323.15], c8: [161.57, 229.61], c9: [113.39, 161.57], c10: [79.37, 113.39], dl: [311.81, 623.62], letter: [612, 792], "government-letter": [576, 756], legal: [612, 1008], "junior-legal": [576, 360], ledger: [1224, 792], tabloid: [792, 1224], "credit-card": [153, 243] }; return r.API = { events: [] }, r.version = "1.x-master", "function" == typeof define && define.amd ? define("jsPDF", function () { return r }) : "undefined" != typeof module && module.exports ? module.exports = r : e.jsPDF = r, r }("undefined" != typeof self && self || "undefined" != typeof window && window || void 0)); (window.AcroForm = function (t) { var n = window.AcroForm; n.scale = function (t) { return t * (r.internal.scaleFactor / 1) }, n.antiScale = function (t) { return 1 / r.internal.scaleFactor * t }; var r = { fields: [], xForms: [], acroFormDictionaryRoot: null, printedOut: !1, internal: null }; e.API.acroformPlugin = r; var i = function () { for (var t in this.acroformPlugin.acroFormDictionaryRoot.Fields) { var e = this.acroformPlugin.acroFormDictionaryRoot.Fields[t]; e.hasAnnotation && o.call(this, e) } }, o = function (t) { var n = { type: "reference", object: t }; e.API.annotationPlugin.annotations[this.internal.getPageInfo(t.page).pageNumber].push(n) }, s = function (t) { this.acroformPlugin.printedOut && (this.acroformPlugin.printedOut = !1, this.acroformPlugin.acroFormDictionaryRoot = null), this.acroformPlugin.acroFormDictionaryRoot || function () { if (this.acroformPlugin.acroFormDictionaryRoot) throw new Error("Exception while creating AcroformDictionary"); this.acroformPlugin.acroFormDictionaryRoot = new n.AcroFormDictionary, this.acroformPlugin.internal = this.internal, this.acroformPlugin.acroFormDictionaryRoot._eventID = this.internal.events.subscribe("postPutResources", c), this.internal.events.subscribe("buildDocument", i), this.internal.events.subscribe("putCatalog", a), this.internal.events.subscribe("postPutPages", l) }.call(this), this.acroformPlugin.acroFormDictionaryRoot.Fields.push(t) }, a = function () { void 0 !== this.acroformPlugin.acroFormDictionaryRoot ? this.internal.write("/AcroForm " + this.acroformPlugin.acroFormDictionaryRoot.objId + " 0 R") : console.log("Root missing...") }, c = function () { this.internal.events.unsubscribe(this.acroformPlugin.acroFormDictionaryRoot._eventID), delete this.acroformPlugin.acroFormDictionaryRoot._eventID, this.acroformPlugin.printedOut = !0 }, l = function (t) { var e = !t; t || (this.internal.newObjectDeferredBegin(this.acroformPlugin.acroFormDictionaryRoot.objId), this.internal.out(this.acroformPlugin.acroFormDictionaryRoot.getString())); t = t || this.acroformPlugin.acroFormDictionaryRoot.Kids; for (var r in t) { var i = t[r], o = i.Rect; i.Rect && (i.Rect = n.internal.calculateCoordinates.call(this, i.Rect)), this.internal.newObjectDeferredBegin(i.objId); var s = ""; if (s += i.objId + " 0 obj\n", s += "<<\n" + i.getContent(), i.Rect = o, i.hasAppearanceStream && !i.appearanceStreamContent) { var a = n.internal.calculateAppearanceStream.call(this, i); s += "/AP << /N " + a + " >>\n", this.acroformPlugin.xForms.push(a) } if (i.appearanceStreamContent) { for (var c in s += "/AP << ", i.appearanceStreamContent) { var l = i.appearanceStreamContent[c]; if (s += "/" + c + " ", s += "<< ", Object.keys(l).length >= 1 || Array.isArray(l)) for (var r in l) { var h; "function" == typeof (h = l[r]) && (h = h.call(this, i)), s += "/" + r + " " + h + " ", this.acroformPlugin.xForms.indexOf(h) >= 0 || this.acroformPlugin.xForms.push(h) } else "function" == typeof (h = l) && (h = h.call(this, i)), s += "/" + r + " " + h + " \n", this.acroformPlugin.xForms.indexOf(h) >= 0 || this.acroformPlugin.xForms.push(h); s += " >>\n" } s += ">>\n" } s += ">>\nendobj\n", this.internal.out(s) } e && u.call(this, this.acroformPlugin.xForms) }, u = function (t) { for (var e in t) { var n = e, r = t[e]; this.internal.newObjectDeferredBegin(r && r.objId); var i = ""; i += r ? r.getString() : "", this.internal.out(i), delete t[n] } }; t.addField = function (t) { return t instanceof n.TextField ? f.call(this, t) : t instanceof n.ChoiceField ? d.call(this, t) : t instanceof n.Button ? h.call(this, t) : t instanceof n.ChildClass ? s.call(this, t) : t && s.call(this, t), t.page = this.acroformPlugin.internal.getCurrentPageInfo().pageNumber, this }; var h = function (t) { (t = t || new n.Field).FT = "/Btn"; var e = t.Ff || 0; t.pushbutton && (e = n.internal.setBitPosition(e, 17), delete t.pushbutton), t.radio && (e = n.internal.setBitPosition(e, 16), delete t.radio), t.noToggleToOff && (e = n.internal.setBitPosition(e, 15)), t.Ff = e, s.call(this, t) }, f = function (t) { (t = t || new n.Field).FT = "/Tx"; var e = t.Ff || 0; t.multiline && (e |= 4096), t.password && (e |= 8192), t.fileSelect && (e |= 1 << 20), t.doNotSpellCheck && (e |= 1 << 22), t.doNotScroll && (e |= 1 << 23), t.Ff = t.Ff || e, s.call(this, t) }, d = function (t) { var e = t || new n.Field; e.FT = "/Ch"; var r = e.Ff || 0; e.combo && (r = n.internal.setBitPosition(r, 18), delete e.combo), e.edit && (r = n.internal.setBitPosition(r, 19), delete e.edit), e.sort && (r = n.internal.setBitPosition(r, 20), delete e.sort), e.multiSelect && this.internal.getPDFVersion() >= 1.4 && (r = n.internal.setBitPosition(r, 22), delete e.multiSelect), e.doNotSpellCheck && this.internal.getPDFVersion() >= 1.4 && (r = n.internal.setBitPosition(r, 23), delete e.doNotSpellCheck), e.Ff = r, s.call(this, e) } })(e.API); var n = window.AcroForm; n.internal = {}, n.createFormXObject = function (t) { var e = new n.FormXObject, r = n.Appearance.internal.getHeight(t) || 0, i = n.Appearance.internal.getWidth(t) || 0; return e.BBox = [0, 0, i, r], e }, n.Appearance = { CheckBox: { createAppearanceStream: function () { return { N: { On: n.Appearance.CheckBox.YesNormal }, D: { On: n.Appearance.CheckBox.YesPushDown, Off: n.Appearance.CheckBox.OffPushDown } } }, createMK: function () { return "<< /CA (3)>>" }, YesPushDown: function (t) { var e = n.createFormXObject(t), r = ""; t.Q = 1; var i = n.internal.calculateX(t, "3", "ZapfDingbats", 50); return r += "0.749023 g\n             0 0 " + n.Appearance.internal.getWidth(t) + " " + n.Appearance.internal.getHeight(t) + " re\n             f\n             BMC\n             q\n             0 0 1 rg\n             /F13 " + i.fontSize + " Tf 0 g\n             BT\n", r += i.text, r += "ET\n             Q\n             EMC\n", e.stream = r, e }, YesNormal: function (t) { var e = n.createFormXObject(t), r = ""; t.Q = 1; var i = n.internal.calculateX(t, "3", "ZapfDingbats", .9 * n.Appearance.internal.getHeight(t)); return r += "1 g\n0 0 " + n.Appearance.internal.getWidth(t) + " " + n.Appearance.internal.getHeight(t) + " re\nf\nq\n0 0 1 rg\n0 0 " + (n.Appearance.internal.getWidth(t) - 1) + " " + (n.Appearance.internal.getHeight(t) - 1) + " re\nW\nn\n0 g\nBT\n/F13 " + i.fontSize + " Tf 0 g\n", r += i.text, r += "ET\n             Q\n", e.stream = r, e }, OffPushDown: function (t) { var e = n.createFormXObject(t), r = ""; return r += "0.749023 g\n            0 0 " + n.Appearance.internal.getWidth(t) + " " + n.Appearance.internal.getHeight(t) + " re\n            f\n", e.stream = r, e } }, RadioButton: { Circle: { createAppearanceStream: function (t) { var e = { D: { Off: n.Appearance.RadioButton.Circle.OffPushDown }, N: {} }; return e.N[t] = n.Appearance.RadioButton.Circle.YesNormal, e.D[t] = n.Appearance.RadioButton.Circle.YesPushDown, e }, createMK: function () { return "<< /CA (l)>>" }, YesNormal: function (t) { var e = n.createFormXObject(t), r = "", i = n.Appearance.internal.getWidth(t) <= n.Appearance.internal.getHeight(t) ? n.Appearance.internal.getWidth(t) / 4 : n.Appearance.internal.getHeight(t) / 4; i *= .9; var o = n.Appearance.internal.Bezier_C; return r += "q\n1 0 0 1 " + n.Appearance.internal.getWidth(t) / 2 + " " + n.Appearance.internal.getHeight(t) / 2 + " cm\n" + i + " 0 m\n" + i + " " + i * o + " " + i * o + " " + i + " 0 " + i + " c\n-" + i * o + " " + i + " -" + i + " " + i * o + " -" + i + " 0 c\n-" + i + " -" + i * o + " -" + i * o + " -" + i + " 0 -" + i + " c\n" + i * o + " -" + i + " " + i + " -" + i * o + " " + i + " 0 c\nf\nQ\n", e.stream = r, e }, YesPushDown: function (t) { var e = n.createFormXObject(t), r = "", i = n.Appearance.internal.getWidth(t) <= n.Appearance.internal.getHeight(t) ? n.Appearance.internal.getWidth(t) / 4 : n.Appearance.internal.getHeight(t) / 4, o = 2 * (i *= .9), s = o * n.Appearance.internal.Bezier_C, a = i * n.Appearance.internal.Bezier_C; return r += "0.749023 g\n            q\n           1 0 0 1 " + n.Appearance.internal.getWidth(t) / 2 + " " + n.Appearance.internal.getHeight(t) / 2 + " cm\n" + o + " 0 m\n" + o + " " + s + " " + s + " " + o + " 0 " + o + " c\n-" + s + " " + o + " -" + o + " " + s + " -" + o + " 0 c\n-" + o + " -" + s + " -" + s + " -" + o + " 0 -" + o + " c\n" + s + " -" + o + " " + o + " -" + s + " " + o + " 0 c\n            f\n            Q\n            0 g\n            q\n            1 0 0 1 " + n.Appearance.internal.getWidth(t) / 2 + " " + n.Appearance.internal.getHeight(t) / 2 + " cm\n" + i + " 0 m\n" + i + " " + a + " " + a + " " + i + " 0 " + i + " c\n-" + a + " " + i + " -" + i + " " + a + " -" + i + " 0 c\n-" + i + " -" + a + " -" + a + " -" + i + " 0 -" + i + " c\n" + a + " -" + i + " " + i + " -" + a + " " + i + " 0 c\n            f\n            Q\n", e.stream = r, e }, OffPushDown: function (t) { var e = n.createFormXObject(t), r = "", i = n.Appearance.internal.getWidth(t) <= n.Appearance.internal.getHeight(t) ? n.Appearance.internal.getWidth(t) / 4 : n.Appearance.internal.getHeight(t) / 4, o = 2 * (i *= .9), s = o * n.Appearance.internal.Bezier_C; return r += "0.749023 g\n            q\n 1 0 0 1 " + n.Appearance.internal.getWidth(t) / 2 + " " + n.Appearance.internal.getHeight(t) / 2 + " cm\n" + o + " 0 m\n" + o + " " + s + " " + s + " " + o + " 0 " + o + " c\n-" + s + " " + o + " -" + o + " " + s + " -" + o + " 0 c\n-" + o + " -" + s + " -" + s + " -" + o + " 0 -" + o + " c\n" + s + " -" + o + " " + o + " -" + s + " " + o + " 0 c\n            f\n            Q\n", e.stream = r, e } }, Cross: { createAppearanceStream: function (t) { var e = { D: { Off: n.Appearance.RadioButton.Cross.OffPushDown }, N: {} }; return e.N[t] = n.Appearance.RadioButton.Cross.YesNormal, e.D[t] = n.Appearance.RadioButton.Cross.YesPushDown, e }, createMK: function () { return "<< /CA (8)>>" }, YesNormal: function (t) { var e = n.createFormXObject(t), r = "", i = n.Appearance.internal.calculateCross(t); return r += "q\n            1 1 " + (n.Appearance.internal.getWidth(t) - 2) + " " + (n.Appearance.internal.getHeight(t) - 2) + " re\n            W\n            n\n            " + i.x1.x + " " + i.x1.y + " m\n            " + i.x2.x + " " + i.x2.y + " l\n            " + i.x4.x + " " + i.x4.y + " m\n            " + i.x3.x + " " + i.x3.y + " l\n            s\n            Q\n", e.stream = r, e }, YesPushDown: function (t) { var e = n.createFormXObject(t), r = n.Appearance.internal.calculateCross(t), i = ""; return i += "0.749023 g\n            0 0 " + n.Appearance.internal.getWidth(t) + " " + n.Appearance.internal.getHeight(t) + " re\n            f\n            q\n            1 1 " + (n.Appearance.internal.getWidth(t) - 2) + " " + (n.Appearance.internal.getHeight(t) - 2) + " re\n            W\n            n\n            " + r.x1.x + " " + r.x1.y + " m\n            " + r.x2.x + " " + r.x2.y + " l\n            " + r.x4.x + " " + r.x4.y + " m\n            " + r.x3.x + " " + r.x3.y + " l\n            s\n            Q\n", e.stream = i, e }, OffPushDown: function (t) { var e = n.createFormXObject(t), r = ""; return r += "0.749023 g\n            0 0 " + n.Appearance.internal.getWidth(t) + " " + n.Appearance.internal.getHeight(t) + " re\n            f\n", e.stream = r, e } } }, createDefaultAppearanceStream: function (t) { return "" + "/Helv 0 Tf 0 g" } }, n.Appearance.internal = { Bezier_C: .551915024494, calculateCross: function (t) { var e = n.Appearance.internal.getWidth(t), r = n.Appearance.internal.getHeight(t), i = function (t, e) { return t > e ? e : t }(e, r); return { x1: { x: (e - i) / 2, y: (r - i) / 2 + i }, x2: { x: (e - i) / 2 + i, y: (r - i) / 2 }, x3: { x: (e - i) / 2, y: (r - i) / 2 }, x4: { x: (e - i) / 2 + i, y: (r - i) / 2 + i } } } }, n.Appearance.internal.getWidth = function (t) { return t.Rect[2] }, n.Appearance.internal.getHeight = function (t) { return t.Rect[3] }, n.internal.inherit = function (t, e) { Object.create, t.prototype = Object.create(e.prototype), t.prototype.constructor = t }, n.internal.arrayToPdfArray = function (t) { if (Array.isArray(t)) { var e = " ["; for (var n in t) { e += t[n].toString(), e += n < t.length - 1 ? " " : "" } return e + "]" } }, n.internal.toPdfString = function (t) { return 0 !== (t = t || "").indexOf("(") && (t = "(" + t), ")" != t.substring(t.length - 1) && (t += "("), t }, n.PDFObject = function () { var t; Object.defineProperty(this, "objId", { get: function () { return t || (this.internal ? t = this.internal.newObjectDeferred() : e.API.acroformPlugin.internal && (t = e.API.acroformPlugin.internal.newObjectDeferred())), t || console.log("Couldn't create Object ID"), t }, configurable: !1 }) }, n.PDFObject.prototype.toString = function () { return this.objId + " 0 R" }, n.PDFObject.prototype.getString = function () { var t = this.objId + " 0 obj\n<<"; return t += this.getContent() + ">>\n", this.stream && (t += "stream\n", t += this.stream, t += "endstream\n"), t + "endobj\n" }, n.PDFObject.prototype.getContent = function () { return "" + function (t) { var e = "", r = Object.keys(t).filter(function (t) { return "content" != t && "appearanceStreamContent" != t && "_" != t.substring(0, 1) }); for (var i in r) { var o = r[i], s = t[o]; s && (e += Array.isArray(s) ? "/" + o + " " + n.internal.arrayToPdfArray(s) + "\n" : s instanceof n.PDFObject ? "/" + o + " " + s.objId + " 0 R\n" : "/" + o + " " + s + "\n") } return e }(this) }, n.FormXObject = function () { var t; n.PDFObject.call(this), this.Type = "/XObject", this.Subtype = "/Form", this.FormType = 1, this.BBox, this.Matrix, this.Resources = "2 0 R", this.PieceInfo, Object.defineProperty(this, "Length", { enumerable: !0, get: function () { return void 0 !== t ? t.length : 0 } }), Object.defineProperty(this, "stream", { enumerable: !1, set: function (e) { t = e }, get: function () { return t || null } }) }, n.internal.inherit(n.FormXObject, n.PDFObject), n.AcroFormDictionary = function () { n.PDFObject.call(this); var t = []; Object.defineProperty(this, "Kids", { enumerable: !1, configurable: !0, get: function () { return t.length > 0 ? t : void 0 } }), Object.defineProperty(this, "Fields", { enumerable: !0, configurable: !0, get: function () { return t } }), this.DA }, n.internal.inherit(n.AcroFormDictionary, n.PDFObject), n.Field = function () { var t; n.PDFObject.call(this), Object.defineProperty(this, "Rect", { enumerable: !0, configurable: !1, get: function () { if (t) return t }, set: function (e) { t = e } }); var e, r, i, o = ""; Object.defineProperty(this, "FT", { enumerable: !0, set: function (t) { o = t }, get: function () { return o } }), Object.defineProperty(this, "T", { enumerable: !0, configurable: !1, set: function (t) { e = t }, get: function () { if (!e || e.length < 1) { if (this instanceof n.ChildClass) return; return "(FieldObject" + n.Field.FieldNum++ + ")" } return "(" == e.substring(0, 1) && e.substring(e.length - 1) ? e : "(" + e + ")" } }), Object.defineProperty(this, "DA", { enumerable: !0, get: function () { if (r) return "(" + r + ")" }, set: function (t) { r = t } }), Object.defineProperty(this, "DV", { enumerable: !0, configurable: !0, get: function () { if (i) return i }, set: function (t) { i = t } }), Object.defineProperty(this, "Type", { enumerable: !0, get: function () { return this.hasAnnotation ? "/Annot" : null } }), Object.defineProperty(this, "Subtype", { enumerable: !0, get: function () { return this.hasAnnotation ? "/Widget" : null } }), this.BG, Object.defineProperty(this, "hasAnnotation", { enumerable: !1, get: function () { return !!(this.Rect || this.BC || this.BG) } }), Object.defineProperty(this, "hasAppearanceStream", { enumerable: !1, configurable: !0, writable: !0 }), Object.defineProperty(this, "page", { enumerable: !1, configurable: !0, writable: !0 }) }, n.Field.FieldNum = 0, n.internal.inherit(n.Field, n.PDFObject), n.ChoiceField = function () { n.Field.call(this), this.FT = "/Ch", this.Opt = [], this.V = "()", this.TI = 0, this.combo = !1, Object.defineProperty(this, "edit", { enumerable: !0, set: function (t) { 1 == t ? (this._edit = !0, this.combo = !0) : this._edit = !1 }, get: function () { return !!this._edit && this._edit }, configurable: !1 }), this.hasAppearanceStream = !0, Object.defineProperty(this, "V", { get: function () { n.internal.toPdfString() } }) }, n.internal.inherit(n.ChoiceField, n.Field), window.ChoiceField = n.ChoiceField, n.ListBox = function () { n.ChoiceField.call(this) }, n.internal.inherit(n.ListBox, n.ChoiceField), window.ListBox = n.ListBox, n.ComboBox = function () { n.ListBox.call(this), this.combo = !0 }, n.internal.inherit(n.ComboBox, n.ListBox), window.ComboBox = n.ComboBox, n.EditBox = function () { n.ComboBox.call(this), this.edit = !0 }, n.internal.inherit(n.EditBox, n.ComboBox), window.EditBox = n.EditBox, n.Button = function () { n.Field.call(this), this.FT = "/Btn" }, n.internal.inherit(n.Button, n.Field), window.Button = n.Button, n.PushButton = function () { n.Button.call(this), this.pushbutton = !0 }, n.internal.inherit(n.PushButton, n.Button), window.PushButton = n.PushButton, n.RadioButton = function () { n.Button.call(this), this.radio = !0; var t, e = []; Object.defineProperty(this, "Kids", { enumerable: !0, get: function () { if (e.length > 0) return e } }), Object.defineProperty(this, "__Kids", { get: function () { return e } }), Object.defineProperty(this, "noToggleToOff", { enumerable: !1, get: function () { return t }, set: function (e) { t = e } }) }, n.internal.inherit(n.RadioButton, n.Button), window.RadioButton = n.RadioButton, n.ChildClass = function (t, e) { n.Field.call(this), this.Parent = t, this._AppearanceType = n.Appearance.RadioButton.Circle, this.appearanceStreamContent = this._AppearanceType.createAppearanceStream(e), this.F = n.internal.setBitPosition(this.F, 3, 1), this.MK = this._AppearanceType.createMK(), this.AS = "/Off", this._Name = e }, n.internal.inherit(n.ChildClass, n.Field), n.RadioButton.prototype.setAppearance = function (t) { if ("createAppearanceStream" in t && "createMK" in t) for (var e in this.__Kids) { var n = this.__Kids[e]; n.appearanceStreamContent = t.createAppearanceStream(n._Name), n.MK = t.createMK() } else console.log("Couldn't assign Appearance to RadioButton. Appearance was Invalid!") }, n.RadioButton.prototype.createOption = function (t) { var r = (this.__Kids.length, new n.ChildClass(this, t)); return this.__Kids.push(r), e.API.addField(r), r }, n.CheckBox = function () { Button.call(this), this.appearanceStreamContent = n.Appearance.CheckBox.createAppearanceStream(), this.MK = n.Appearance.CheckBox.createMK(), this.AS = "/On", this.V = "/On" }, n.internal.inherit(n.CheckBox, n.Button), window.CheckBox = n.CheckBox, n.TextField = function () { var t, e; n.Field.call(this), this.DA = n.Appearance.createDefaultAppearanceStream(), this.F = 4, Object.defineProperty(this, "V", { get: function () { return t ? "(" + t + ")" : t }, enumerable: !0, set: function (e) { t = e } }), Object.defineProperty(this, "DV", { get: function () { return e ? "(" + e + ")" : e }, enumerable: !0, set: function (t) { e = t } }); var r = !1; Object.defineProperty(this, "multiline", { enumerable: !1, get: function () { return r }, set: function (t) { r = t } }); var i = !1; Object.defineProperty(this, "MaxLen", { enumerable: !0, get: function () { return i }, set: function (t) { i = t } }), Object.defineProperty(this, "hasAppearanceStream", { enumerable: !1, get: function () { return this.V || this.DV } }) }, n.internal.inherit(n.TextField, n.Field), window.TextField = n.TextField, n.PasswordField = function () { TextField.call(this), Object.defineProperty(this, "password", { value: !0, enumerable: !1, configurable: !1, writable: !1 }) }, n.internal.inherit(n.PasswordField, n.TextField), window.PasswordField = n.PasswordField, n.internal.calculateFontSpace = function (t, e, r) { r = r || "helvetica"; var i = n.internal.calculateFontSpace.canvas || (n.internal.calculateFontSpace.canvas = document.createElement("canvas")); (a = i.getContext("2d")).save(); var o = e + " " + r; a.font = o; var s = a.measureText(t); a.fontcolor = "black"; var a = i.getContext("2d"); return s.height = 1.5 * a.measureText("3").width, a.restore(), s.width, s }, n.internal.calculateX = function (t, e, r, i) { i = i || 12, r = r || "helvetica"; var o = { text: "", fontSize: "" }, s = (e = ")" == (e = "(" == e.substr(0, 1) ? e.substr(1) : e).substr(e.length - 1) ? e.substr(0, e.length - 1) : e).split(" "), a = i, c = n.Appearance.internal.getHeight(t) || 0; c = c < 0 ? -c : c; var l = n.Appearance.internal.getWidth(t) || 0; l = l < 0 ? -l : l; var u = function (t, e, i) { if (t + 1 < s.length) { var o = e + " " + s[t + 1]; return n.internal.calculateFontSpace(o, i + "px", r).width <= l - 4 } return !1 }; a++; t: for (; ;) { e = ""; a--; var h = n.internal.calculateFontSpace("3", a + "px", r).height, f = t.multiline ? c - a : (c - h) / 2, d = -2, p = f += 2, g = 0, m = 0, w = 0; if (0 == a) { a = 12, e = "(...) Tj\n", e += "% Width of Text: " + n.internal.calculateFontSpace(e, "1px").width + ", FieldWidth:" + l + "\n"; break } w = n.internal.calculateFontSpace(s[0] + " ", a + "px", r).width; var y = "", v = 0; for (var b in s) { y = " " == (y += s[b] + " ").substr(y.length - 1) ? y.substr(0, y.length - 1) : y; var x = parseInt(b); w = n.internal.calculateFontSpace(y + " ", a + "px", r).width; var k = u(x, y, a), _ = b >= s.length - 1; if (!k || _) { if (k || _) { if (_) m = x; else if (t.multiline && (h + 2) * (v + 2) + 2 > c) continue t } else { if (!t.multiline) continue t; if ((h + 2) * (v + 2) + 2 > c) continue t; m = x } for (var C = "", A = g; A <= m; A++)C += s[A] + " "; switch (C = " " == C.substr(C.length - 1) ? C.substr(0, C.length - 1) : C, w = n.internal.calculateFontSpace(C, a + "px", r).width, t.Q) { case 2: d = l - w - 2; break; case 1: d = (l - w) / 2; break; case 0: default: d = 2 }e += d + " " + p + " Td\n", e += "(" + C + ") Tj\n", e += -d + " 0 Td\n", p = -(a + 2), d, w = 0, g = m + 1, v++, y = "" } else y += " " } break } return o.text = e, o.fontSize = a, o }, n.internal.calculateAppearanceStream = function (t) { if (t.appearanceStreamContent) return t.appearanceStreamContent; if (t.V || t.DV) { var e = "", r = t.V || t.DV, i = n.internal.calculateX(t, r); e += "/Tx BMC\nq\n/F1 " + i.fontSize + " Tf\n1 0 0 1 0 0 Tm\n", e += "BT\n", e += i.text, e += "ET\n", e += "Q\nEMC\n"; var o = new n.createFormXObject(t); return o.stream = e, o } }, n.internal.calculateCoordinates = function (t, e, r, i) { var o = {}; if (this.internal) { var s = function (t) { return t * this.internal.scaleFactor }; Array.isArray(t) ? (t[0] = n.scale(t[0]), t[1] = n.scale(t[1]), t[2] = n.scale(t[2]), t[3] = n.scale(t[3]), o.lowerLeft_X = t[0] || 0, o.lowerLeft_Y = s.call(this, this.internal.pageSize.height) - t[3] - t[1] || 0, o.upperRight_X = t[0] + t[2] || 0, o.upperRight_Y = s.call(this, this.internal.pageSize.height) - t[1] || 0) : (t = n.scale(t), e = n.scale(e), r = n.scale(r), i = n.scale(i), o.lowerLeft_X = t || 0, o.lowerLeft_Y = this.internal.pageSize.height - e || 0, o.upperRight_X = t + r || 0, o.upperRight_Y = this.internal.pageSize.height - e + i || 0) } else Array.isArray(t) ? (o.lowerLeft_X = t[0] || 0, o.lowerLeft_Y = t[1] || 0, o.upperRight_X = t[0] + t[2] || 0, o.upperRight_Y = t[1] + t[3] || 0) : (o.lowerLeft_X = t || 0, o.lowerLeft_Y = e || 0, o.upperRight_X = t + r || 0, o.upperRight_Y = e + i || 0); return [o.lowerLeft_X, o.lowerLeft_Y, o.upperRight_X, o.upperRight_Y] }, n.internal.calculateColor = function (t, e, n) { var r = new Array(3); return r.r = 0 | t, r.g = 0 | e, r.b = 0 | n, r }, n.internal.getBitPosition = function (t, e) { var n = 1; return (t = t || 0) | (n <<= e - 1) }, n.internal.setBitPosition = function (t, e, n) { t = t || 0; var r = 1; if (r <<= e - 1, 1 == (n = n || 1)) t = t | r; else t = t & ~r; return t }, e.API.addHTML = function (t, e, n, r, i) { if ("undefined" == typeof html2canvas && "undefined" == typeof rasterizeHTML) throw new Error("You need either https://github.com/niklasvh/html2canvas or https://github.com/cburgmer/rasterizeHTML.js"); "number" != typeof e && (r = e, i = n), "function" == typeof r && (i = r, r = null); var o = this.internal, s = o.scaleFactor, a = o.pageSize.width, c = o.pageSize.height; if ((r = r || {}).onrendered = function (t) { e = parseInt(e) || 0, n = parseInt(n) || 0; var o = r.dim || {}, l = o.h || 0, u = o.w || Math.min(a, t.width / s) - e, h = "JPEG"; if (r.format && (h = r.format), t.height > c && r.pagesplit) { var f = function () { for (var r = 0; ;) { var o = document.createElement("canvas"); o.width = Math.min(a * s, t.width), o.height = Math.min(c * s, t.height - r), o.getContext("2d").drawImage(t, 0, r, t.width, o.height, 0, 0, o.width, o.height); var l = [o, e, r ? 0 : n, o.width / s, o.height / s, h, null, "SLOW"]; if (this.addImage.apply(this, l), (r += o.height) >= t.height) break; this.addPage() } i(u, r, null, l) }.bind(this); if ("CANVAS" === t.nodeName) { var d = new Image; d.onload = f, d.src = t.toDataURL("image/png"), t = d } else f() } else { var p = Math.random().toString(35), g = [t, e, n, u, l, h, p, "SLOW"]; this.addImage.apply(this, g), i(u, l, p, g) } }.bind(this), "undefined" != typeof html2canvas && !r.rstz) return html2canvas(t, r); if ("undefined" != typeof rasterizeHTML) { var l = "drawDocument"; return "string" == typeof t && (l = /^http/.test(t) ? "drawURL" : "drawHTML"), r.width = r.width || a * s, rasterizeHTML[l](t, void 0, r).then(function (t) { r.onrendered(t.image) }, function (t) { i(null, t) }) } return null }, function (e) { var n = "addImage_", r = ["jpeg", "jpg", "png"], i = function t(e) { var n = this.internal.newObject(), r = this.internal.write, i = this.internal.putStream; if (e.n = n, r("<</Type /XObject"), r("/Subtype /Image"), r("/Width " + e.w), r("/Height " + e.h), e.cs === this.color_spaces.INDEXED ? r("/ColorSpace [/Indexed /DeviceRGB " + (e.pal.length / 3 - 1) + " " + ("smask" in e ? n + 2 : n + 1) + " 0 R]") : (r("/ColorSpace /" + e.cs), e.cs === this.color_spaces.DEVICE_CMYK && r("/Decode [1 0 1 0 1 0 1 0]")), r("/BitsPerComponent " + e.bpc), "f" in e && r("/Filter /" + e.f), "dp" in e && r("/DecodeParms <<" + e.dp + ">>"), "trns" in e && e.trns.constructor == Array) { for (var o = "", s = 0, a = e.trns.length; s < a; s++)o += e.trns[s] + " " + e.trns[s] + " "; r("/Mask [" + o + "]") } if ("smask" in e && r("/SMask " + (n + 1) + " 0 R"), r("/Length " + e.data.length + ">>"), i(e.data), r("endobj"), "smask" in e) { var c = "/Predictor " + e.p + " /Colors 1 /BitsPerComponent " + e.bpc + " /Columns " + e.w, l = { w: e.w, h: e.h, cs: "DeviceGray", bpc: e.bpc, dp: c, data: e.smask }; "f" in e && (l.f = e.f), t.call(this, l) } e.cs === this.color_spaces.INDEXED && (this.internal.newObject(), r("<< /Length " + e.pal.length + ">>"), i(this.arrayBufferToBinaryString(new Uint8Array(e.pal))), r("endobj")) }, o = function () { var t = this.internal.collections[n + "images"]; for (var e in t) i.call(this, t[e]) }, s = function () { var t, e = this.internal.collections[n + "images"], r = this.internal.write; for (var i in e) r("/I" + (t = e[i]).i, t.n, "0", "R") }, a = function (t) { return t && "string" == typeof t && (t = t.toUpperCase()), t in e.image_compression ? t : e.image_compression.NONE }, c = function () { var t = this.internal.collections[n + "images"]; return t || (this.internal.collections[n + "images"] = t = {}, this.internal.events.subscribe("putResources", o), this.internal.events.subscribe("putXobjectDict", s)), t }, l = function (t) { return "string" == typeof t && e.sHashCode(t) }, u = function (t) { return "function" != typeof e["process" + t.toUpperCase()] }, h = function (e) { return "object" === (void 0 === e ? "undefined" : t(e)) && 1 === e.nodeType }, f = function (t, e) { var n; if (e) for (var r in e) if (t === e[r].alias) { n = e[r]; break } return n }; e.color_spaces = { DEVICE_RGB: "DeviceRGB", DEVICE_GRAY: "DeviceGray", DEVICE_CMYK: "DeviceCMYK", CAL_GREY: "CalGray", CAL_RGB: "CalRGB", LAB: "Lab", ICC_BASED: "ICCBased", INDEXED: "Indexed", PATTERN: "Pattern", SEPARATION: "Separation", DEVICE_N: "DeviceN" }, e.decode = { DCT_DECODE: "DCTDecode", FLATE_DECODE: "FlateDecode", LZW_DECODE: "LZWDecode", JPX_DECODE: "JPXDecode", JBIG2_DECODE: "JBIG2Decode", ASCII85_DECODE: "ASCII85Decode", ASCII_HEX_DECODE: "ASCIIHexDecode", RUN_LENGTH_DECODE: "RunLengthDecode", CCITT_FAX_DECODE: "CCITTFaxDecode" }, e.image_compression = { NONE: "NONE", FAST: "FAST", MEDIUM: "MEDIUM", SLOW: "SLOW" }, e.sHashCode = function (t) { return Array.prototype.reduce && t.split("").reduce(function (t, e) { return (t = (t << 5) - t + e.charCodeAt(0)) & t }, 0) }, e.isString = function (t) { return "string" == typeof t }, e.extractInfoFromBase64DataURI = function (t) { return /^data:([\w]+?\/([\w]+?));base64,(.+?)$/g.exec(t) }, e.supportsArrayBuffer = function () { return "undefined" != typeof ArrayBuffer && "undefined" != typeof Uint8Array }, e.isArrayBuffer = function (t) { return !!this.supportsArrayBuffer() && t instanceof ArrayBuffer }, e.isArrayBufferView = function (t) { return !!this.supportsArrayBuffer() && "undefined" != typeof Uint32Array && (t instanceof Int8Array || t instanceof Uint8Array || "undefined" != typeof Uint8ClampedArray && t instanceof Uint8ClampedArray || t instanceof Int16Array || t instanceof Uint16Array || t instanceof Int32Array || t instanceof Uint32Array || t instanceof Float32Array || t instanceof Float64Array) }, e.binaryStringToUint8Array = function (t) { for (var e = t.length, n = new Uint8Array(e), r = 0; r < e; r++)n[r] = t.charCodeAt(r); return n }, e.arrayBufferToBinaryString = function (t) { this.isArrayBuffer(t) && (t = new Uint8Array(t)); for (var e = "", n = t.byteLength, r = 0; r < n; r++)e += String.fromCharCode(t[r]); return e }, e.arrayBufferToBase64 = function (t) { for (var e, n = "", r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", i = new Uint8Array(t), o = i.byteLength, s = o % 3, a = o - s, c = 0; c < a; c += 3)n += r[(16515072 & (e = i[c] << 16 | i[c + 1] << 8 | i[c + 2])) >> 18] + r[(258048 & e) >> 12] + r[(4032 & e) >> 6] + r[63 & e]; return 1 == s ? n += r[(252 & (e = i[a])) >> 2] + r[(3 & e) << 4] + "==" : 2 == s && (n += r[(64512 & (e = i[a] << 8 | i[a + 1])) >> 10] + r[(1008 & e) >> 4] + r[(15 & e) << 2] + "="), n }, e.createImageInfo = function (t, e, n, r, i, o, s, a, c, l, u, h, f) { var d = { alias: a, w: e, h: n, cs: r, bpc: i, i: s, data: t }; return o && (d.f = o), c && (d.dp = c), l && (d.trns = l), u && (d.pal = u), h && (d.smask = h), f && (d.p = f), d }, e.addImage = function (e, n, i, o, s, d, p, g, m) { if ("string" != typeof n) { var w = d; d = s, s = o, o = i, i = n, n = w } if ("object" === (void 0 === e ? "undefined" : t(e)) && !h(e) && "imageData" in e) { var y = e; e = y.imageData, n = y.format || n, i = y.x || i || 0, o = y.y || o || 0, s = y.w || s, d = y.h || d, p = y.alias || p, g = y.compression || g, m = y.rotation || y.angle || m } if (isNaN(i) || isNaN(o)) throw console.error("jsPDF.addImage: Invalid coordinates", arguments), new Error("Invalid coordinates passed to jsPDF.addImage"); var v, b, x = c.call(this); if (!(v = f(e, x)) && (h(e) && (e = function (e, n, r) { if ("IMG" === e.nodeName && e.hasAttribute("src")) { var i = "" + e.getAttribute("src"); if (!r && 0 === i.indexOf("data:image/")) return i; !n && /\.png(?:[?#].*)?$/i.test(i) && (n = "png") } if ("CANVAS" === e.nodeName) var o = e; else { (o = document.createElement("canvas")).width = e.clientWidth || e.width, o.height = e.clientHeight || e.height; var s = o.getContext("2d"); if (!s) throw "addImage requires canvas to be supported by browser."; if (r) { var a, c, l, u, h, f, d, p, g = Math.PI / 180; "object" === (void 0 === r ? "undefined" : t(r)) && (a = r.x, c = r.y, l = r.bg, r = r.angle), p = r * g, u = Math.abs(Math.cos(p)), h = Math.abs(Math.sin(p)), f = o.width, d = o.height, o.width = d * h + f * u, o.height = d * u + f * h, isNaN(a) && (a = o.width / 2), isNaN(c) && (c = o.height / 2), s.clearRect(0, 0, o.width, o.height), s.fillStyle = l || "white", s.fillRect(0, 0, o.width, o.height), s.save(), s.translate(a, c), s.rotate(p), s.drawImage(e, -f / 2, -d / 2), s.rotate(-p), s.translate(-a, -c), s.restore() } else s.drawImage(e, 0, 0, o.width, o.height) } return o.toDataURL("png" == ("" + n).toLowerCase() ? "image/png" : "image/jpeg") }(e, n, m)), function (t) { return null == t }(p) && (p = l(e)), !(v = f(p, x)))) { if (this.isString(e)) { var k = this.extractInfoFromBase64DataURI(e); k ? (n = k[2], e = atob(k[3])) : 137 === e.charCodeAt(0) && 80 === e.charCodeAt(1) && 78 === e.charCodeAt(2) && 71 === e.charCodeAt(3) && (n = "png") } if (function (t) { return -1 === r.indexOf(t) }(n = (n || "JPEG").toLowerCase())) throw new Error("addImage currently only supports formats " + r + ", not '" + n + "'"); if (u(n)) throw new Error("please ensure that the plugin for '" + n + "' support is added"); if (this.supportsArrayBuffer() && (e instanceof Uint8Array || (b = e, e = this.binaryStringToUint8Array(e))), !(v = this["process" + n.toUpperCase()](e, function (t) { var e = 0; return t && (e = Object.keys ? Object.keys(t).length : function (t) { var e = 0; for (var n in t) t.hasOwnProperty(n) && e++; return e }(t)), e }(x), p, a(g), b))) throw new Error("An unkwown error occurred whilst processing the image") } return function (t, e, n, r, i, o, s) { var a = function (t, e, n) { return t || e || (t = -96, e = -96), t < 0 && (t = -1 * n.w * 72 / t / this.internal.scaleFactor), e < 0 && (e = -1 * n.h * 72 / e / this.internal.scaleFactor), 0 === t && (t = e * n.w / n.h), 0 === e && (e = t * n.h / n.w), [t, e] }.call(this, n, r, i), c = this.internal.getCoordinateString, l = this.internal.getVerticalCoordinateString; n = a[0], r = a[1], s[o] = i, this.internal.write("q", c(n), "0 0", c(r), c(t), l(e + r), "cm /I" + i.i, "Do Q") }.call(this, i, o, s, d, v, v.i, x), this }; var d = function (t, e) { return t.subarray(e, e + 5) }; e.processJPEG = function (t, e, n, r, i) { var o, s = this.color_spaces.DEVICE_RGB, a = this.decode.DCT_DECODE; return this.isString(t) ? (o = function (t) { var e; if (255 === !t.charCodeAt(0) || 216 === !t.charCodeAt(1) || 255 === !t.charCodeAt(2) || 224 === !t.charCodeAt(3) || !t.charCodeAt(6) === "J".charCodeAt(0) || !t.charCodeAt(7) === "F".charCodeAt(0) || !t.charCodeAt(8) === "I".charCodeAt(0) || !t.charCodeAt(9) === "F".charCodeAt(0) || 0 === !t.charCodeAt(10)) throw new Error("getJpegSize requires a binary string jpeg file"); for (var n = 256 * t.charCodeAt(4) + t.charCodeAt(5), r = 4, i = t.length; r < i;) { if (r += n, 255 !== t.charCodeAt(r)) throw new Error("getJpegSize could not find the size of the image"); if (192 === t.charCodeAt(r + 1) || 193 === t.charCodeAt(r + 1) || 194 === t.charCodeAt(r + 1) || 195 === t.charCodeAt(r + 1) || 196 === t.charCodeAt(r + 1) || 197 === t.charCodeAt(r + 1) || 198 === t.charCodeAt(r + 1) || 199 === t.charCodeAt(r + 1)) return e = 256 * t.charCodeAt(r + 5) + t.charCodeAt(r + 6), [256 * t.charCodeAt(r + 7) + t.charCodeAt(r + 8), e, t.charCodeAt(r + 9)]; r += 2, n = 256 * t.charCodeAt(r) + t.charCodeAt(r + 1) } }(t), this.createImageInfo(t, o[0], o[1], 1 == o[3] ? this.color_spaces.DEVICE_GRAY : s, 8, a, e, n)) : (this.isArrayBuffer(t) && (t = new Uint8Array(t)), this.isArrayBufferView(t) ? (o = function (t) { if (65496 != (t[0] << 8 | t[1])) throw new Error("Supplied data is not a JPEG"); for (var e, n = t.length, r = (t[4] << 8) + t[5], i = 4; i < n;) { if (r = ((e = d(t, i += r))[2] << 8) + e[3], (192 === e[1] || 194 === e[1]) && 255 === e[0] && r > 7) return { width: ((e = d(t, i + 5))[2] << 8) + e[3], height: (e[0] << 8) + e[1], numcomponents: e[4] }; i += 2 } throw new Error("getJpegSizeFromBytes could not find the size of the image") }(t), t = i || this.arrayBufferToBinaryString(t), this.createImageInfo(t, o.width, o.height, 1 == o.numcomponents ? this.color_spaces.DEVICE_GRAY : s, 8, a, e, n)) : null) }, e.processJPG = function () { return this.processJPEG.apply(this, arguments) } }(e.API), function (t) { var n = { annotations: [], f2: function (t) { return t.toFixed(2) }, notEmpty: function (t) { if (void 0 !== t && "" != t) return !0 } }; e.API.annotationPlugin = n, e.API.events.push(["addPage", function (t) { this.annotationPlugin.annotations[t.pageNumber] = [] }]), t.events.push(["putPage", function (t) { for (var e = this.annotationPlugin.annotations[t.pageNumber], r = !1, i = 0; i < e.length && !r; i++) { switch ((l = e[i]).type) { case "link": if (n.notEmpty(l.options.url) || n.notEmpty(l.options.pageNumber)) { r = !0; break } case "reference": case "text": case "freetext": r = !0 } } if (0 != r) { this.internal.write("/Annots ["); var o = this.annotationPlugin.f2, s = this.internal.scaleFactor, a = this.internal.pageSize.height, c = this.internal.getPageInfo(t.pageNumber); for (i = 0; i < e.length; i++) { var l; switch ((l = e[i]).type) { case "reference": this.internal.write(" " + l.object.objId + " 0 R "); break; case "text": var u = this.internal.newAdditionalObject(), h = this.internal.newAdditionalObject(), f = l.title || "Note"; w = "<</Type /Annot /Subtype /Text " + (p = "/Rect [" + o(l.bounds.x * s) + " " + o(a - (l.bounds.y + l.bounds.h) * s) + " " + o((l.bounds.x + l.bounds.w) * s) + " " + o((a - l.bounds.y) * s) + "] ") + "/Contents (" + l.contents + ")", w += " /Popup " + h.objId + " 0 R", w += " /P " + c.objId + " 0 R", w += " /T (" + f + ") >>", u.content = w; var d = u.objId + " 0 R"; w = "<</Type /Annot /Subtype /Popup " + (p = "/Rect [" + o((l.bounds.x + 30) * s) + " " + o(a - (l.bounds.y + l.bounds.h) * s) + " " + o((l.bounds.x + l.bounds.w + 30) * s) + " " + o((a - l.bounds.y) * s) + "] ") + " /Parent " + d, l.open && (w += " /Open true"), w += " >>", h.content = w, this.internal.write(u.objId, "0 R", h.objId, "0 R"); break; case "freetext": var p = "/Rect [" + o(l.bounds.x * s) + " " + o((a - l.bounds.y) * s) + " " + o(l.bounds.x + l.bounds.w * s) + " " + o(a - (l.bounds.y + l.bounds.h) * s) + "] ", g = l.color || "#000000"; w = "<</Type /Annot /Subtype /FreeText " + p + "/Contents (" + l.contents + ")", w += " /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#" + g + ")", w += " /Border [0 0 0]", w += " >>", this.internal.write(w); break; case "link": if (l.options.name) { var m = this.annotations._nameMap[l.options.name]; l.options.pageNumber = m.page, l.options.top = m.y } else l.options.top || (l.options.top = 0); p = "/Rect [" + o(l.x * s) + " " + o((a - l.y) * s) + " " + o(l.x + l.w * s) + " " + o(a - (l.y + l.h) * s) + "] "; var w = ""; if (l.options.url) w = "<</Type /Annot /Subtype /Link " + p + "/Border [0 0 0] /A <</S /URI /URI (" + l.options.url + ") >>"; else if (l.options.pageNumber) { switch (w = "<</Type /Annot /Subtype /Link " + p + "/Border [0 0 0] /Dest [" + (t = this.internal.getPageInfo(l.options.pageNumber)).objId + " 0 R", l.options.magFactor = l.options.magFactor || "XYZ", l.options.magFactor) { case "Fit": w += " /Fit]"; break; case "FitH": w += " /FitH " + l.options.top + "]"; break; case "FitV": l.options.left = l.options.left || 0, w += " /FitV " + l.options.left + "]"; break; case "XYZ": default: var y = o((a - l.options.top) * s); l.options.left = l.options.left || 0, void 0 === l.options.zoom && (l.options.zoom = 0), w += " /XYZ " + l.options.left + " " + y + " " + l.options.zoom + "]" } } "" != w && (w += " >>", this.internal.write(w)) } } this.internal.write("]") } }]), t.createAnnotation = function (t) { switch (t.type) { case "link": this.link(t.bounds.x, t.bounds.y, t.bounds.w, t.bounds.h, t); break; case "text": case "freetext": this.annotationPlugin.annotations[this.internal.getCurrentPageInfo().pageNumber].push(t) } }, t.link = function (t, e, n, r, i) { this.annotationPlugin.annotations[this.internal.getCurrentPageInfo().pageNumber].push({ x: t, y: e, w: n, h: r, options: i, type: "link" }) }, t.link = function (t, e, n, r, i) { this.annotationPlugin.annotations[this.internal.getCurrentPageInfo().pageNumber].push({ x: t, y: e, w: n, h: r, options: i, type: "link" }) }, t.textWithLink = function (t, e, n, r) { var i = this.getTextWidth(t), o = this.internal.getLineHeight(); return this.text(t, e, n), n += .2 * o, this.link(e, n - o, i, o, r), i }, t.getTextWidth = function (t) { var e = this.internal.getFontSize(); return this.getStringUnitWidth(t) * e / this.internal.scaleFactor }, t.getLineHeight = function () { return this.internal.getLineHeight() } }(e.API), e.API.autoPrint = function () { var t; return this.internal.events.subscribe("postPutResources", function () { t = this.internal.newObject(), this.internal.write("<< /S/Named /Type/Action /N/Print >>", "endobj") }), this.internal.events.subscribe("putCatalog", function () { this.internal.write("/OpenAction " + t + " 0 R") }), this }, function (t) { t.events.push(["initialized", function () { this.canvas.pdf = this }]), t.canvas = { getContext: function (t) { return this.pdf.context2d._canvas = this, this.pdf.context2d }, style: {} }, Object.defineProperty(t.canvas, "width", { get: function () { return this._width }, set: function (t) { this._width = t, this.getContext("2d").pageWrapX = t + 1 } }), Object.defineProperty(t.canvas, "height", { get: function () { return this._height }, set: function (t) { this._height = t, this.getContext("2d").pageWrapY = t + 1 } }) }(e.API), function (t) { var e, n, r, i, o = { x: void 0, y: void 0, w: void 0, h: void 0, ln: void 0 }, s = 1, a = function (t, e, n, r, i) { o = { x: t, y: e, w: n, h: r, ln: i } }, c = function () { return o }, l = { left: 0, top: 0, bottom: 0 }; t.setHeaderFunction = function (t) { i = t }, t.getTextDimensions = function (t) { e = this.internal.getFont().fontName, n = this.table_font_size || this.internal.getFontSize(), r = this.internal.getFont().fontStyle; var i, o, s = 19.049976 / 25.4; (o = document.createElement("font")).id = "jsPDFCell"; try { o.style.fontStyle = r } catch (t) { o.style.fontWeight = r } o.style.fontName = e, o.style.fontSize = n + "pt"; try { o.textContent = t } catch (e) { o.innerText = t } return document.body.appendChild(o), i = { w: (o.offsetWidth + 1) * s, h: (o.offsetHeight + 1) * s }, document.body.removeChild(o), i }, t.cellAddPage = function () { var t = this.margins || l; this.addPage(), a(t.left, t.top, void 0, void 0), s += 1 }, t.cellInitialize = function () { o = { x: void 0, y: void 0, w: void 0, h: void 0, ln: void 0 }, s = 1 }, t.cell = function (t, e, n, r, i, o, s) { var u = c(), h = !1; if (void 0 !== u.ln) if (u.ln === o) t = u.x + u.w, e = u.y; else { var f = this.margins || l; u.y + u.h + r + 13 >= this.internal.pageSize.height - f.bottom && (this.cellAddPage(), h = !0, this.printHeaders && this.tableHeaderRow && this.printHeaderRow(o, !0)), e = c().y + c().h, h && (e = 23) } if (void 0 !== i[0]) if (this.printingHeaderRow ? this.rect(t, e, n, r, "FD") : this.rect(t, e, n, r), "right" === s) { i instanceof Array || (i = [i]); for (var d = 0; d < i.length; d++) { var p = i[d], g = this.getStringUnitWidth(p) * this.internal.getFontSize(); this.text(p, t + n - g - 3, e + this.internal.getLineHeight() * (d + 1)) } } else this.text(i, t + 3, e + this.internal.getLineHeight()); return a(t, e, n, r, o), this }, t.arrayMax = function (t, e) { var n, r, i, o = t[0]; for (n = 0, r = t.length; n < r; n += 1)i = t[n], e ? -1 === e(o, i) && (o = i) : i > o && (o = i); return o }, t.table = function (e, n, r, i, a) { if (!r) throw "No data for PDF table"; var c, u, h, f, d, p, g, m, w, y, v = [], b = [], x = {}, k = {}, _ = [], C = [], A = !1, S = !0, q = 12, T = l; if (T.width = this.internal.pageSize.width, a && (!0 === a.autoSize && (A = !0), !1 === a.printHeaders && (S = !1), a.fontSize && (q = a.fontSize), a.css && void 0 !== a.css["font-size"] && (q = 16 * a.css["font-size"]), a.margins && (T = a.margins)), this.lnMod = 0, o = { x: void 0, y: void 0, w: void 0, h: void 0, ln: void 0 }, s = 1, this.printHeaders = S, this.margins = T, this.setFontSize(q), this.table_font_size = q, null == i) v = Object.keys(r[0]); else if (i[0] && "string" != typeof i[0]) { for (u = 0, h = i.length; u < h; u += 1)c = i[u], v.push(c.name), b.push(c.prompt), k[c.name] = c.width * (19.049976 / 25.4) } else v = i; if (A) for (y = function (t) { return t[c] }, u = 0, h = v.length; u < h; u += 1) { for (x[c = v[u]] = r.map(y), _.push(this.getTextDimensions(b[u] || c).w), g = 0, f = (p = x[c]).length; g < f; g += 1)d = p[g], _.push(this.getTextDimensions(d).w); k[c] = t.arrayMax(_), _ = [] } if (S) { var I = this.calculateLineHeight(v, k, b.length ? b : v); for (u = 0, h = v.length; u < h; u += 1)c = v[u], C.push([e, n, k[c], I, String(b.length ? b[u] : c)]); this.setTableHeaderRow(C), this.printHeaderRow(1, !1) } for (u = 0, h = r.length; u < h; u += 1) { for (m = r[u], I = this.calculateLineHeight(v, k, m), g = 0, w = v.length; g < w; g += 1)c = v[g], this.cell(e, n, k[c], I, m[c], u + 2, c.align) } return this.lastCellPos = o, this.table_x = e, this.table_y = n, this }, t.calculateLineHeight = function (t, e, n) { for (var r, i = 0, o = 0; o < t.length; o++) { n[r = t[o]] = this.splitTextToSize(String(n[r]), e[r] - 3); var s = this.internal.getLineHeight() * n[r].length + 3; s > i && (i = s) } return i }, t.setTableHeaderRow = function (t) { this.tableHeaderRow = t }, t.printHeaderRow = function (t, e) { if (!this.tableHeaderRow) throw "Property tableHeaderRow does not exist."; var n, r, o, c; if (this.printingHeaderRow = !0, void 0 !== i) { var l = i(this, s); a(l[0], l[1], l[2], l[3], -1) } this.setFontStyle("bold"); var u = []; for (o = 0, c = this.tableHeaderRow.length; o < c; o += 1)this.setFillColor(200, 200, 200), n = this.tableHeaderRow[o], e && (this.margins.top = 13, n[1] = this.margins && this.margins.top || 0, u.push(n)), r = [].concat(n), this.cell.apply(this, r.concat(t)); u.length > 0 && this.setTableHeaderRow(u), this.setFontStyle("normal"), this.printingHeaderRow = !1 } }(e.API), function (t) { function e() { this._isStrokeTransparent = !1, this._strokeOpacity = 1, this.strokeStyle = "#000000", this.fillStyle = "#000000", this._isFillTransparent = !1, this._fillOpacity = 1, this.font = "12pt times", this.textBaseline = "alphabetic", this.textAlign = "start", this.lineWidth = 1, this.lineJoin = "miter", this.lineCap = "butt", this._transform = [1, 0, 0, 1, 0, 0], this.globalCompositeOperation = "normal", this.globalAlpha = 1, this._clip_path = [], this.ignoreClearRect = !1, this.copy = function (t) { this._isStrokeTransparent = t._isStrokeTransparent, this._strokeOpacity = t._strokeOpacity, this.strokeStyle = t.strokeStyle, this._isFillTransparent = t._isFillTransparent, this._fillOpacity = t._fillOpacity, this.fillStyle = t.fillStyle, this.font = t.font, this.lineWidth = t.lineWidth, this.lineJoin = t.lineJoin, this.lineCap = t.lineCap, this.textBaseline = t.textBaseline, this.textAlign = t.textAlign, this._fontSize = t._fontSize, this._transform = t._transform.slice(0), this.globalCompositeOperation = t.globalCompositeOperation, this.globalAlpha = t.globalAlpha, this._clip_path = t._clip_path.slice(0), this.ignoreClearRect = t.ignoreClearRect } } t.events.push(["initialized", function () { this.context2d.pdf = this, this.context2d.internal.pdf = this, this.context2d.ctx = new e, this.context2d.ctxStack = [], this.context2d.path = [] }]), t.context2d = { pageWrapXEnabled: !1, pageWrapYEnabled: !1, pageWrapX: 9999999, pageWrapY: 9999999, ctx: new e, f2: function (t) { return t.toFixed(2) }, fillRect: function (t, e, n, r) { if (!this._isFillTransparent()) { t = this._wrapX(t), e = this._wrapY(e); var i = this._matrix_map_rect(this.ctx._transform, { x: t, y: e, w: n, h: r }); this.pdf.rect(i.x, i.y, i.w, i.h, "f") } }, strokeRect: function (t, e, n, r) { if (!this._isStrokeTransparent()) { t = this._wrapX(t), e = this._wrapY(e); var i = this._matrix_map_rect(this.ctx._transform, { x: t, y: e, w: n, h: r }); this.pdf.rect(i.x, i.y, i.w, i.h, "s") } }, clearRect: function (t, e, n, r) { if (!this.ctx.ignoreClearRect) { t = this._wrapX(t), e = this._wrapY(e); var i = this._matrix_map_rect(this.ctx._transform, { x: t, y: e, w: n, h: r }); this.save(), this.setFillStyle("#ffffff"), this.pdf.rect(i.x, i.y, i.w, i.h, "f"), this.restore() } }, save: function () { this.ctx._fontSize = this.pdf.internal.getFontSize(); var t = new e; t.copy(this.ctx), this.ctxStack.push(this.ctx), this.ctx = t }, restore: function () { this.ctx = this.ctxStack.pop(), this.setFillStyle(this.ctx.fillStyle), this.setStrokeStyle(this.ctx.strokeStyle), this.setFont(this.ctx.font), this.pdf.setFontSize(this.ctx._fontSize), this.setLineCap(this.ctx.lineCap), this.setLineWidth(this.ctx.lineWidth), this.setLineJoin(this.ctx.lineJoin) }, rect: function (t, e, n, r) { this.moveTo(t, e), this.lineTo(t + n, e), this.lineTo(t + n, e + r), this.lineTo(t, e + r), this.lineTo(t, e), this.closePath() }, beginPath: function () { this.path = [] }, closePath: function () { this.path.push({ type: "close" }) }, _getRgba: function (t) { var e = {}; if (this.internal.rxTransparent.test(t)) e.r = 0, e.g = 0, e.b = 0, e.a = 0; else { var n = this.internal.rxRgb.exec(t); null != n ? (e.r = parseInt(n[1]), e.g = parseInt(n[2]), e.b = parseInt(n[3]), e.a = 1) : null != (n = this.internal.rxRgba.exec(t)) ? (e.r = parseInt(n[1]), e.g = parseInt(n[2]), e.b = parseInt(n[3]), e.a = parseFloat(n[4])) : (e.a = 1, "#" != t.charAt(0) && ((t = o.colorNameToHex(t)) || (t = "#000000")), 4 === t.length ? (e.r = t.substring(1, 2), e.r += r, e.g = t.substring(2, 3), e.g += g, e.b = t.substring(3, 4), e.b += b) : (e.r = t.substring(1, 3), e.g = t.substring(3, 5), e.b = t.substring(5, 7)), e.r = parseInt(e.r, 16), e.g = parseInt(e.g, 16), e.b = parseInt(e.b, 16)) } return e.style = t, e }, setFillStyle: function (t) { var e, n, r, i; if (this.internal.rxTransparent.test(t)) e = 0, n = 0, r = 0, i = 0; else { var s = this.internal.rxRgb.exec(t); null != s ? (e = parseInt(s[1]), n = parseInt(s[2]), r = parseInt(s[3]), i = 1) : null != (s = this.internal.rxRgba.exec(t)) ? (e = parseInt(s[1]), n = parseInt(s[2]), r = parseInt(s[3]), i = parseFloat(s[4])) : (i = 1, "#" != t.charAt(0) && ((t = o.colorNameToHex(t)) || (t = "#000000")), 4 === t.length ? (e = t.substring(1, 2), e += e, n = t.substring(2, 3), n += n, r = t.substring(3, 4), r += r) : (e = t.substring(1, 3), n = t.substring(3, 5), r = t.substring(5, 7)), e = parseInt(e, 16), n = parseInt(n, 16), r = parseInt(r, 16)) } this.ctx.fillStyle = t, this.ctx._isFillTransparent = 0 == i, this.ctx._fillOpacity = i, this.pdf.setFillColor(e, n, r, { a: i }), this.pdf.setTextColor(e, n, r, { a: i }) }, setStrokeStyle: function (t) { var e = this._getRgba(t); this.ctx.strokeStyle = e.style, this.ctx._isStrokeTransparent = 0 == e.a, this.ctx._strokeOpacity = e.a, 0 === e.a ? this.pdf.setDrawColor(255, 255, 255) : (e.a, this.pdf.setDrawColor(e.r, e.g, e.b)) }, fillText: function (t, e, n, r) { if (!this._isFillTransparent()) { e = this._wrapX(e), n = this._wrapY(n); var i = this._matrix_map_point(this.ctx._transform, [e, n]); e = i[0], n = i[1]; var o, s = 57.2958 * this._matrix_rotation(this.ctx._transform); if (this.ctx._clip_path.length > 0) { var a; (a = window.outIntercept ? "group" === window.outIntercept.type ? window.outIntercept.stream : window.outIntercept : this.internal.getCurrentPage()).push("q"); var c = this.path; this.path = this.ctx._clip_path, this.ctx._clip_path = [], this._fill(null, !0), this.ctx._clip_path = this.path, this.path = c } if ((o = this.pdf.hotfix && this.pdf.hotfix.scale_text ? this._getTransform()[0] : 1) < .01) this.pdf.text(t, e, this._getBaseline(n), null, s); else { var l = this.pdf.internal.getFontSize(); this.pdf.setFontSize(l * o), this.pdf.text(t, e, this._getBaseline(n), null, s), this.pdf.setFontSize(l) } this.ctx._clip_path.length > 0 && a.push("Q") } }, strokeText: function (t, e, n, r) { if (!this._isStrokeTransparent()) { e = this._wrapX(e), n = this._wrapY(n); var i = this._matrix_map_point(this.ctx._transform, [e, n]); e = i[0], n = i[1]; var o, s = 57.2958 * this._matrix_rotation(this.ctx._transform); if (this.ctx._clip_path.length > 0) { var a; (a = window.outIntercept ? "group" === window.outIntercept.type ? window.outIntercept.stream : window.outIntercept : this.internal.getCurrentPage()).push("q"); var c = this.path; this.path = this.ctx._clip_path, this.ctx._clip_path = [], this._fill(null, !0), this.ctx._clip_path = this.path, this.path = c } if (1 === (o = this.pdf.hotfix && this.pdf.hotfix.scale_text ? this._getTransform()[0] : 1)) this.pdf.text(t, e, this._getBaseline(n), { stroke: !0 }, s); else { var l = this.pdf.internal.getFontSize(); this.pdf.setFontSize(l * o), this.pdf.text(t, e, this._getBaseline(n), { stroke: !0 }, s), this.pdf.setFontSize(l) } this.ctx._clip_path.length > 0 && a.push("Q") } }, setFont: function (t) { if (this.ctx.font = t, null != (c = /\s*(\w+)\s+(\w+)\s+(\w+)\s+([\d\.]+)(px|pt|em)\s+(.*)?/.exec(t))) { var e = c[1], n = (c[2], c[3]), r = c[4], i = c[5], o = c[6]; r = "px" === i ? Math.floor(parseFloat(r)) : "em" === i ? Math.floor(parseFloat(r) * this.pdf.getFontSize()) : Math.floor(parseFloat(r)), this.pdf.setFontSize(r), "bold" === n || "700" === n ? this.pdf.setFontStyle("bold") : "italic" === e ? this.pdf.setFontStyle("italic") : this.pdf.setFontStyle("normal"); var s, a = (h = o).toLowerCase().split(/\s*,\s*/); s = -1 != a.indexOf("arial") ? "Arial" : -1 != a.indexOf("verdana") ? "Verdana" : -1 != a.indexOf("helvetica") ? "Helvetica" : -1 != a.indexOf("sans-serif") ? "sans-serif" : -1 != a.indexOf("fixed") ? "Fixed" : -1 != a.indexOf("monospace") ? "Monospace" : -1 != a.indexOf("terminal") ? "Terminal" : -1 != a.indexOf("courier") ? "Courier" : -1 != a.indexOf("times") ? "Times" : -1 != a.indexOf("cursive") ? "Cursive" : -1 != a.indexOf("fantasy") ? "Fantasy" : (a.indexOf("serif"), "Serif"), l = "bold" === n ? "bold" : "normal", this.pdf.setFont(s, l) } else { var c = /(\d+)(pt|px|em)\s+(\w+)\s*(\w+)?/.exec(t); if (null != c) { var l, u = c[1], h = (c[2], c[3]); (l = c[4]) || (l = "normal"), u = "em" === i ? Math.floor(parseFloat(r) * this.pdf.getFontSize()) : Math.floor(parseFloat(u)), this.pdf.setFontSize(u), this.pdf.setFont(h, l) } } }, setTextBaseline: function (t) { this.ctx.textBaseline = t }, getTextBaseline: function () { return this.ctx.textBaseline }, setTextAlign: function (t) { this.ctx.textAlign = t }, getTextAlign: function () { return this.ctx.textAlign }, setLineWidth: function (t) { this.ctx.lineWidth = t, this.pdf.setLineWidth(t) }, setLineCap: function (t) { this.ctx.lineCap = t, this.pdf.setLineCap(t) }, setLineJoin: function (t) { this.ctx.lineJoin = t, this.pdf.setLineJoin(t) }, moveTo: function (t, e) { t = this._wrapX(t), e = this._wrapY(e); var n = this._matrix_map_point(this.ctx._transform, [t, e]), r = { type: "mt", x: t = n[0], y: e = n[1] }; this.path.push(r) }, _wrapX: function (t) { return this.pageWrapXEnabled ? t % this.pageWrapX : t }, _wrapY: function (t) { return this.pageWrapYEnabled ? (this._gotoPage(this._page(t)), (t - this.lastBreak) % this.pageWrapY) : t }, transform: function (t, e, n, r, i, o) { this.ctx._transform = [t, e, n, r, i, o] }, setTransform: function (t, e, n, r, i, o) { this.ctx._transform = [t, e, n, r, i, o] }, _getTransform: function () { return this.ctx._transform }, lastBreak: 0, pageBreaks: [], _page: function (t) { if (this.pageWrapYEnabled) { this.lastBreak = 0; for (var e = 0, n = 0, r = 0; r < this.pageBreaks.length; r++)if (t >= this.pageBreaks[r]) { e++, 0 === this.lastBreak && n++; var i = this.pageBreaks[r] - this.lastBreak; this.lastBreak = this.pageBreaks[r], n += Math.floor(i / this.pageWrapY) } if (0 === this.lastBreak) n += Math.floor(t / this.pageWrapY) + 1; return n + e } return this.pdf.internal.getCurrentPageInfo().pageNumber }, _gotoPage: function (t) { }, lineTo: function (t, e) { t = this._wrapX(t), e = this._wrapY(e); var n = this._matrix_map_point(this.ctx._transform, [t, e]), r = { type: "lt", x: t = n[0], y: e = n[1] }; this.path.push(r) }, bezierCurveTo: function (t, e, n, r, i, o) { var s; t = this._wrapX(t), e = this._wrapY(e), n = this._wrapX(n), r = this._wrapY(r), i = this._wrapX(i), o = this._wrapY(o), i = (s = this._matrix_map_point(this.ctx._transform, [i, o]))[0], o = s[1]; var a = { type: "bct", x1: t = (s = this._matrix_map_point(this.ctx._transform, [t, e]))[0], y1: e = s[1], x2: n = (s = this._matrix_map_point(this.ctx._transform, [n, r]))[0], y2: r = s[1], x: i, y: o }; this.path.push(a) }, quadraticCurveTo: function (t, e, n, r) { var i; t = this._wrapX(t), e = this._wrapY(e), n = this._wrapX(n), r = this._wrapY(r), n = (i = this._matrix_map_point(this.ctx._transform, [n, r]))[0], r = i[1]; var o = { type: "qct", x1: t = (i = this._matrix_map_point(this.ctx._transform, [t, e]))[0], y1: e = i[1], x: n, y: r }; this.path.push(o) }, arc: function (t, e, n, r, i, o) { if (t = this._wrapX(t), e = this._wrapY(e), !this._matrix_is_identity(this.ctx._transform)) { var s = this._matrix_map_point(this.ctx._transform, [t, e]); t = s[0], e = s[1]; var a = this._matrix_map_point(this.ctx._transform, [0, 0]), c = this._matrix_map_point(this.ctx._transform, [0, n]); n = Math.sqrt(Math.pow(c[0] - a[0], 2) + Math.pow(c[1] - a[1], 2)) } var l = { type: "arc", x: t, y: e, radius: n, startAngle: r, endAngle: i, anticlockwise: o }; this.path.push(l) }, drawImage: function (t, e, n, r, i, o, s, a, c) { void 0 !== o && (e = o, n = s, r = a, i = c), e = this._wrapX(e), n = this._wrapY(n); var l, u = this._matrix_map_rect(this.ctx._transform, { x: e, y: n, w: r, h: i }), h = (this._matrix_map_rect(this.ctx._transform, { x: o, y: s, w: a, h: c }), /data:image\/(\w+).*/i).exec(t); l = null != h ? h[1] : "png", this.pdf.addImage(t, l, u.x, u.y, u.w, u.h) }, _matrix_multiply: function (t, e) { var n = e[0], r = e[1], i = e[2], o = e[3], s = e[4], a = e[5], c = n * t[0] + r * t[2], l = i * t[0] + o * t[2], u = s * t[0] + a * t[2] + t[4]; return r = n * t[1] + r * t[3], o = i * t[1] + o * t[3], a = s * t[1] + a * t[3] + t[5], [n = c, r, i = l, o, s = u, a] }, _matrix_rotation: function (t) { return Math.atan2(t[2], t[0]) }, _matrix_decompose: function (t) { var e = t[0], n = t[1], r = t[2], i = t[3], o = Math.sqrt(e * e + n * n), s = (e /= o) * r + (n /= o) * i; r -= e * s, i -= n * s; var a = Math.sqrt(r * r + i * i); return s /= a, e * (i /= a) < n * (r /= a) && (e = -e, n = -n, s = -s, o = -o), { scale: [o, 0, 0, a, 0, 0], translate: [1, 0, 0, 1, t[4], t[5]], rotate: [e, n, -n, e, 0, 0], skew: [1, 0, s, 1, 0, 0] } }, _matrix_map_point: function (t, e) { var n = t[0], r = t[1], i = t[2], o = t[3], s = t[4], a = t[5], c = e[0], l = e[1]; return [c * n + l * i + s, c * r + l * o + a] }, _matrix_map_point_obj: function (t, e) { var n = this._matrix_map_point(t, [e.x, e.y]); return { x: n[0], y: n[1] } }, _matrix_map_rect: function (t, e) { var n = this._matrix_map_point(t, [e.x, e.y]), r = this._matrix_map_point(t, [e.x + e.w, e.y + e.h]); return { x: n[0], y: n[1], w: r[0] - n[0], h: r[1] - n[1] } }, _matrix_is_identity: function (t) { return 1 == t[0] && 0 == t[1] && 0 == t[2] && 1 == t[3] && 0 == t[4] && 0 == t[5] }, rotate: function (t) { var e = [Math.cos(t), Math.sin(t), -Math.sin(t), Math.cos(t), 0, 0]; this.ctx._transform = this._matrix_multiply(this.ctx._transform, e) }, scale: function (t, e) { var n = [t, 0, 0, e, 0, 0]; this.ctx._transform = this._matrix_multiply(this.ctx._transform, n) }, translate: function (t, e) { var n = [1, 0, 0, 1, t, e]; this.ctx._transform = this._matrix_multiply(this.ctx._transform, n) }, stroke: function () { if (this.ctx._clip_path.length > 0) { var t; (t = window.outIntercept ? "group" === window.outIntercept.type ? window.outIntercept.stream : window.outIntercept : this.internal.getCurrentPage()).push("q"); var e = this.path; this.path = this.ctx._clip_path, this.ctx._clip_path = [], this._stroke(!0), this.ctx._clip_path = this.path, this.path = e, this._stroke(!1), t.push("Q") } else this._stroke(!1) }, _stroke: function (t) { if (t || !this._isStrokeTransparent()) { for (var e = [], n = this.path, r = 0; r < n.length; r++) { var i = n[r]; switch (i.type) { case "mt": e.push({ start: i, deltas: [], abs: [] }); break; case "lt": var o = [i.x - n[r - 1].x, i.y - n[r - 1].y]; e[e.length - 1].deltas.push(o), e[e.length - 1].abs.push(i); break; case "bct": o = [i.x1 - n[r - 1].x, i.y1 - n[r - 1].y, i.x2 - n[r - 1].x, i.y2 - n[r - 1].y, i.x - n[r - 1].x, i.y - n[r - 1].y]; e[e.length - 1].deltas.push(o); break; case "qct": var s = n[r - 1].x + 2 / 3 * (i.x1 - n[r - 1].x), a = n[r - 1].y + 2 / 3 * (i.y1 - n[r - 1].y), c = i.x + 2 / 3 * (i.x1 - i.x), l = i.y + 2 / 3 * (i.y1 - i.y), u = i.x, h = i.y; o = [s - n[r - 1].x, a - n[r - 1].y, c - n[r - 1].x, l - n[r - 1].y, u - n[r - 1].x, h - n[r - 1].y]; e[e.length - 1].deltas.push(o); break; case "arc": 0 == e.length && e.push({ start: { x: 0, y: 0 }, deltas: [], abs: [] }), e[e.length - 1].arc = !0, e[e.length - 1].abs.push(i); break; case "close": !0 } } for (r = 0; r < e.length; r++) { var f; if (f = r == e.length - 1 ? "s" : null, e[r].arc) for (var d = e[r].abs, p = 0; p < d.length; p++) { var g = d[p], m = 360 * g.startAngle / (2 * Math.PI), w = 360 * g.endAngle / (2 * Math.PI), y = g.x, v = g.y; this.internal.arc2(this, y, v, g.radius, m, w, g.anticlockwise, f, t) } else { y = e[r].start.x, v = e[r].start.y; t ? (this.pdf.lines(e[r].deltas, y, v, null, null), this.pdf.clip_fixed()) : this.pdf.lines(e[r].deltas, y, v, null, f) } } } }, _isFillTransparent: function () { return this.ctx._isFillTransparent || 0 == this.globalAlpha }, _isStrokeTransparent: function () { return this.ctx._isStrokeTransparent || 0 == this.globalAlpha }, fill: function (t) { if (this.ctx._clip_path.length > 0) { var e; (e = window.outIntercept ? "group" === window.outIntercept.type ? window.outIntercept.stream : window.outIntercept : this.internal.getCurrentPage()).push("q"); var n = this.path; this.path = this.ctx._clip_path, this.ctx._clip_path = [], this._fill(t, !0), this.ctx._clip_path = this.path, this.path = n, this._fill(t, !1), e.push("Q") } else this._fill(t, !1) }, _fill: function (t, e) { if (!this._isFillTransparent()) { var r, i = "function" == typeof this.pdf.internal.newObject2; r = window.outIntercept ? "group" === window.outIntercept.type ? window.outIntercept.stream : window.outIntercept : this.internal.getCurrentPage(); var o = [], s = window.outIntercept; if (i) switch (this.ctx.globalCompositeOperation) { case "normal": case "source-over": break; case "destination-in": case "destination-out": var a = this.pdf.internal.newStreamObject(), c = this.pdf.internal.newObject2(); c.push("<</Type /ExtGState"), c.push("/SMask <</S /Alpha /G " + a.objId + " 0 R>>"), c.push(">>"); var l = "MASK" + c.objId; this.pdf.internal.addGraphicsState(l, c.objId); var u = "/" + l + " gs"; r.splice(0, 0, "q"), r.splice(1, 0, u), r.push("Q"), window.outIntercept = a; break; default: var h = "/" + this.pdf.internal.blendModeMap[this.ctx.globalCompositeOperation.toUpperCase()]; h && this.pdf.internal.out(h + " gs") }var f = this.ctx.globalAlpha; if (this.ctx._fillOpacity < 1 && (f = this.ctx._fillOpacity), i) { var d = this.pdf.internal.newObject2(); d.push("<</Type /ExtGState"), d.push("/CA " + f), d.push("/ca " + f), d.push(">>"); l = "GS_O_" + d.objId; this.pdf.internal.addGraphicsState(l, d.objId), this.pdf.internal.out("/" + l + " gs") } for (var p = this.path, g = 0; g < p.length; g++) { var m = p[g]; switch (m.type) { case "mt": o.push({ start: m, deltas: [], abs: [] }); break; case "lt": var w = [m.x - p[g - 1].x, m.y - p[g - 1].y]; o[o.length - 1].deltas.push(w), o[o.length - 1].abs.push(m); break; case "bct": w = [m.x1 - p[g - 1].x, m.y1 - p[g - 1].y, m.x2 - p[g - 1].x, m.y2 - p[g - 1].y, m.x - p[g - 1].x, m.y - p[g - 1].y]; o[o.length - 1].deltas.push(w); break; case "qct": var y = p[g - 1].x + 2 / 3 * (m.x1 - p[g - 1].x), v = p[g - 1].y + 2 / 3 * (m.y1 - p[g - 1].y), b = m.x + 2 / 3 * (m.x1 - m.x), x = m.y + 2 / 3 * (m.y1 - m.y), k = m.x, _ = m.y; w = [y - p[g - 1].x, v - p[g - 1].y, b - p[g - 1].x, x - p[g - 1].y, k - p[g - 1].x, _ - p[g - 1].y]; o[o.length - 1].deltas.push(w); break; case "arc": 0 === o.length && o.push({ deltas: [], abs: [] }), o[o.length - 1].arc = !0, o[o.length - 1].abs.push(m); break; case "close": o.push({ close: !0 }) } } for (g = 0; g < o.length; g++) { var C; if (g == o.length - 1 ? (C = "f", "evenodd" === t && (C += "*")) : C = null, o[g].close) this.pdf.internal.out("h"), this.pdf.internal.out("f"); else if (o[g].arc) { o[g].start && this.internal.move2(this, o[g].start.x, o[g].start.y); for (var A = o[g].abs, S = 0; S < A.length; S++) { var q = A[S]; if (void 0 !== q.startAngle) { var T = 360 * q.startAngle / (2 * Math.PI), I = 360 * q.endAngle / (2 * Math.PI), P = q.x, E = q.y; if (0 === S && this.internal.move2(this, P, E), this.internal.arc2(this, P, E, q.radius, T, I, q.anticlockwise, null, e), S === A.length - 1 && o[g].start) { P = o[g].start.x, E = o[g].start.y; this.internal.line2(n, P, E) } } else this.internal.line2(n, q.x, q.y) } } else { P = o[g].start.x, E = o[g].start.y; e ? (this.pdf.lines(o[g].deltas, P, E, null, null), this.pdf.clip_fixed()) : this.pdf.lines(o[g].deltas, P, E, null, C) } } window.outIntercept = s } }, pushMask: function () { if ("function" == typeof this.pdf.internal.newObject2) { var t = this.pdf.internal.newStreamObject(), e = this.pdf.internal.newObject2(); e.push("<</Type /ExtGState"), e.push("/SMask <</S /Alpha /G " + t.objId + " 0 R>>"), e.push(">>"); var n = "MASK" + e.objId; this.pdf.internal.addGraphicsState(n, e.objId); var r = "/" + n + " gs"; this.pdf.internal.out(r) } else console.log("jsPDF v2 not enabled") }, clip: function () { if (this.ctx._clip_path.length > 0) for (var t = 0; t < this.path.length; t++)this.ctx._clip_path.push(this.path[t]); else this.ctx._clip_path = this.path; this.path = [] }, measureText: function (t) { var e = this.pdf; return { getWidth: function () { var n = e.internal.getFontSize(); return 1.3333 * (e.getStringUnitWidth(t) * n / e.internal.scaleFactor) }, get width() { return this.getWidth(t) } } }, _getBaseline: function (t) { var e = parseInt(this.pdf.internal.getFontSize()), n = .25 * e; switch (this.ctx.textBaseline) { case "bottom": return t - n; case "top": return t + e; case "hanging": return t + e - n; case "middle": return t + e / 2 - n; case "ideographic": return t; case "alphabetic": default: return t } } }; var n = t.context2d; Object.defineProperty(n, "fillStyle", { set: function (t) { this.setFillStyle(t) }, get: function () { return this.ctx.fillStyle } }), Object.defineProperty(n, "strokeStyle", { set: function (t) { this.setStrokeStyle(t) }, get: function () { return this.ctx.strokeStyle } }), Object.defineProperty(n, "lineWidth", { set: function (t) { this.setLineWidth(t) }, get: function () { return this.ctx.lineWidth } }), Object.defineProperty(n, "lineCap", { set: function (t) { this.setLineCap(t) }, get: function () { return this.ctx.lineCap } }), Object.defineProperty(n, "lineJoin", { set: function (t) { this.setLineJoin(t) }, get: function () { return this.ctx.lineJoin } }), Object.defineProperty(n, "miterLimit", { set: function (t) { this.ctx.miterLimit = t }, get: function () { return this.ctx.miterLimit } }), Object.defineProperty(n, "textBaseline", { set: function (t) { this.setTextBaseline(t) }, get: function () { return this.getTextBaseline() } }), Object.defineProperty(n, "textAlign", { set: function (t) { this.setTextAlign(t) }, get: function () { return this.getTextAlign() } }), Object.defineProperty(n, "font", { set: function (t) { this.setFont(t) }, get: function () { return this.ctx.font } }), Object.defineProperty(n, "globalCompositeOperation", { set: function (t) { this.ctx.globalCompositeOperation = t }, get: function () { return this.ctx.globalCompositeOperation } }), Object.defineProperty(n, "globalAlpha", { set: function (t) { this.ctx.globalAlpha = t }, get: function () { return this.ctx.globalAlpha } }), Object.defineProperty(n, "ignoreClearRect", { set: function (t) { this.ctx.ignoreClearRect = t }, get: function () { return this.ctx.ignoreClearRect } }), n.internal = {}, n.internal.rxRgb = /rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/, n.internal.rxRgba = /rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d\.]+)\s*\)/, n.internal.rxTransparent = /transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/, n.internal.arc = function (t, e, n, r, i, o, s, a) { for (var c = this.pdf.internal.scaleFactor, l = this.pdf.internal.pageSize.height, u = this.pdf.internal.f2, h = i * (Math.PI / 180), f = o * (Math.PI / 180), d = this.createArc(r, h, f, s), p = 0; p < d.length; p++) { var g = d[p]; 0 === p ? this.pdf.internal.out([u((g.x1 + e) * c), u((l - (g.y1 + n)) * c), "m", u((g.x2 + e) * c), u((l - (g.y2 + n)) * c), u((g.x3 + e) * c), u((l - (g.y3 + n)) * c), u((g.x4 + e) * c), u((l - (g.y4 + n)) * c), "c"].join(" ")) : this.pdf.internal.out([u((g.x2 + e) * c), u((l - (g.y2 + n)) * c), u((g.x3 + e) * c), u((l - (g.y3 + n)) * c), u((g.x4 + e) * c), u((l - (g.y4 + n)) * c), "c"].join(" ")), t._lastPoint = { x: e, y: n } } null !== a && this.pdf.internal.out(this.pdf.internal.getStyle(a)) }, n.internal.arc2 = function (t, e, n, r, i, o, s, a, c) { var l = e, u = n; c ? (this.arc(t, l, u, r, i, o, s, null), this.pdf.clip_fixed()) : this.arc(t, l, u, r, i, o, s, a) }, n.internal.move2 = function (t, e, n) { var r = this.pdf.internal.scaleFactor, i = this.pdf.internal.pageSize.height, o = this.pdf.internal.f2; this.pdf.internal.out([o(e * r), o((i - n) * r), "m"].join(" ")), t._lastPoint = { x: e, y: n } }, n.internal.line2 = function (t, e, n) { var r = this.pdf.internal.scaleFactor, i = this.pdf.internal.pageSize.height, o = this.pdf.internal.f2, s = { x: e, y: n }; this.pdf.internal.out([o(s.x * r), o((i - s.y) * r), "l"].join(" ")), t._lastPoint = s }, n.internal.createArc = function (t, e, n, r) { var i = 2 * Math.PI, o = Math.PI / 2, s = e; for ((s < i || s > i) && (s %= i), s < 0 && (s = i + s); e > n;)e -= i; var a = Math.abs(n - e); a < i && r && (a = i - a); for (var c = [], l = r ? -1 : 1, u = s; a > 1e-5;) { var h = u + l * Math.min(a, o); c.push(this.createSmallArc(t, u, h)), a -= Math.abs(h - u), u = h } return c }, n.internal.getCurrentPage = function () { return this.pdf.internal.pages[this.pdf.internal.getCurrentPageInfo().pageNumber] }, n.internal.createSmallArc = function (t, e, n) { var r = (n - e) / 2, i = t * Math.cos(r), o = t * Math.sin(r), s = i, a = -o, c = s * s + a * a, l = c + s * i + a * o, u = 4 / 3 * (Math.sqrt(2 * c * l) - l) / (s * o - a * i), h = s - u * a, f = a + u * s, d = h, p = -f, g = r + e, m = Math.cos(g), w = Math.sin(g); return { x1: t * Math.cos(e), y1: t * Math.sin(e), x2: h * m - f * w, y2: h * w + f * m, x3: d * m - p * w, y3: d * w + p * m, x4: t * Math.cos(n), y4: t * Math.sin(n) } } }(e.API), function (e) { var n, r, i, s, a, c, l, u, h, f, d, p, g, m, w, y, v, b, x, k; n = function () { function t() { } return function (e) { return t.prototype = e, new t } }(), f = function (t) { var e, n, r, i, o, s, a; for (n = 0, r = t.length, e = void 0, i = !1, s = !1; !i && n !== r;)(e = t[n] = t[n].trimLeft()) && (i = !0), n++; for (n = r - 1; r && !s && -1 !== n;)(e = t[n] = t[n].trimRight()) && (s = !0), n--; for (o = /\s+$/g, a = !0, n = 0; n !== r;)"\u2028" != t[n] && (e = t[n].replace(/\s+/g, " "), a && (e = e.trimLeft()), e && (a = o.test(e)), t[n] = e), n++; return t }, d = function (t, e, n, r) { return this.pdf = t, this.x = e, this.y = n, this.settings = r, this.watchFunctions = [], this.init(), this }, p = function (t) { var e, n, r; for (e = void 0, n = (r = t.split(",")).shift(); !e && n;)e = i[n.trim().toLowerCase()], n = r.shift(); return e }, g = function (t) { var e; return (t = "auto" === t ? "0px" : t).indexOf("em") > -1 && !isNaN(Number(t.replace("em", ""))) && (t = 18.719 * Number(t.replace("em", "")) + "px"), t.indexOf("pt") > -1 && !isNaN(Number(t.replace("pt", ""))) && (t = 1.333 * Number(t.replace("pt", "")) + "px"), void 0, 16, (e = m[t]) ? e : void 0 !== (e = { "xx-small": 9, "x-small": 11, small: 13, medium: 16, large: 19, "x-large": 23, "xx-large": 28, auto: 0 }[{ css_line_height_string: t }]) ? m[t] = e / 16 : (e = parseFloat(t)) ? m[t] = e / 16 : 3 === (e = t.match(/([\d\.]+)(px)/)).length ? m[t] = parseFloat(e[1]) / 16 : m[t] = 1 }, h = function (t) { var e, n, r; return r = function (t) { var e; return e = function (t) { return document.defaultView && document.defaultView.getComputedStyle ? document.defaultView.getComputedStyle(t, null) : t.currentStyle ? t.currentStyle : t.style }(t), function (t) { return t = t.replace(/-\D/g, function (t) { return t.charAt(1).toUpperCase() }), e[t] } }(t), n = void 0, (e = {})["font-family"] = p(r("font-family")) || "times", e["font-style"] = s[r("font-style")] || "normal", e["text-align"] = a[r("text-align")] || "left", "bold" === (n = c[r("font-weight")] || "normal") && ("normal" === e["font-style"] ? e["font-style"] = n : e["font-style"] = n + e["font-style"]), e["font-size"] = g(r("font-size")) || 1, e["line-height"] = g(r("line-height")) || 1, e.display = "inline" === r("display") ? "inline" : "block", n = "block" === e.display, e["margin-top"] = n && g(r("margin-top")) || 0, e["margin-bottom"] = n && g(r("margin-bottom")) || 0, e["padding-top"] = n && g(r("padding-top")) || 0, e["padding-bottom"] = n && g(r("padding-bottom")) || 0, e["margin-left"] = n && g(r("margin-left")) || 0, e["margin-right"] = n && g(r("margin-right")) || 0, e["padding-left"] = n && g(r("padding-left")) || 0, e["padding-right"] = n && g(r("padding-right")) || 0, e["page-break-before"] = r("page-break-before") || "auto", e.float = l[r("cssFloat")] || "none", e.clear = u[r("clear")] || "none", e.color = r("color"), e }, w = function (t, e, n) { var r, i, o, s; if (o = !1, i = void 0, s = void 0, void 0, r = n["#" + t.id]) if ("function" == typeof r) o = r(t, e); else for (i = 0, s = r.length; !o && i !== s;)o = r[i](t, e), i++; if (r = n[t.nodeName], !o && r) if ("function" == typeof r) o = r(t, e); else for (i = 0, s = r.length; !o && i !== s;)o = r[i](t, e), i++; return o }, k = function (t, e) { var n, r, i, o, s, a, c, l, u; for (n = [], r = [], i = 0, u = t.rows[0].cells.length, c = t.clientWidth; i < u;)l = t.rows[0].cells[i], r[i] = { name: l.textContent.toLowerCase().replace(/\s+/g, ""), prompt: l.textContent.replace(/\r?\n/g, ""), width: l.clientWidth / c * e.pdf.internal.pageSize.width }, i++; for (i = 1; i < t.rows.length;) { for (a = t.rows[i], s = {}, o = 0; o < a.cells.length;)s[r[o].name] = a.cells[o].textContent.replace(/\r?\n/g, ""), o++; n.push(s), i++ } return { rows: n, headers: r } }; var _ = { SCRIPT: 1, STYLE: 1, NOSCRIPT: 1, OBJECT: 1, EMBED: 1, SELECT: 1 }, C = 1; r = function (e, i, o) { var s, a, c, l, u, f, d, p; for (a = e.childNodes, s = void 0, (u = "block" === (c = h(e)).display) && (i.setBlockBoundary(), i.setBlockStyle(c)), 19.049976 / 25.4, l = 0, f = a.length; l < f;) { if ("object" === (void 0 === (s = a[l]) ? "undefined" : t(s))) { if (i.executeWatchFunctions(s), 1 === s.nodeType && "HEADER" === s.nodeName) { var g = s, m = i.pdf.margins_doc.top; i.pdf.internal.events.subscribe("addPage", function (t) { i.y = m, r(g, i, o), i.pdf.margins_doc.top = i.y + 10, i.y += 10 }, !1) } if (8 === s.nodeType && "#comment" === s.nodeName) ~s.textContent.indexOf("ADD_PAGE") && (i.pdf.addPage(), i.y = i.pdf.margins_doc.top); else if (1 !== s.nodeType || _[s.nodeName]) if (3 === s.nodeType) { var v = s.nodeValue; if (s.nodeValue && "LI" === s.parentNode.nodeName) if ("OL" === s.parentNode.parentNode.nodeName) v = C++ + ". " + v; else { var b = c["font-size"], x = (3 - .75 * b) * i.pdf.internal.scaleFactor, A = .75 * b * i.pdf.internal.scaleFactor, S = 1.74 * b / i.pdf.internal.scaleFactor; p = function (t, e) { this.pdf.circle(t + x, e + A, S, "FD") } } 16 & s.ownerDocument.body.compareDocumentPosition(s) && i.addText(v, c) } else "string" == typeof s && i.addText(s, c); else { var q; if ("IMG" === s.nodeName) { var T = s.getAttribute("src"); q = y[i.pdf.sHashCode(T) || T] } if (q) { i.pdf.internal.pageSize.height - i.pdf.margins_doc.bottom < i.y + s.height && i.y > i.pdf.margins_doc.top && (i.pdf.addPage(), i.y = i.pdf.margins_doc.top, i.executeWatchFunctions(s)); var I = h(s), P = i.x, E = 12 / i.pdf.internal.scaleFactor, O = (I["margin-left"] + I["padding-left"]) * E, F = (I["margin-right"] + I["padding-right"]) * E, R = (I["margin-top"] + I["padding-top"]) * E, B = (I["margin-bottom"] + I["padding-bottom"]) * E; P += void 0 !== I.float && "right" === I.float ? i.settings.width - s.width - F : O, i.pdf.addImage(q, P, i.y + R, s.width, s.height), q = void 0, "right" === I.float || "left" === I.float ? (i.watchFunctions.push(function (t, e, n, r) { return i.y >= e ? (i.x += t, i.settings.width += n, !0) : !!(r && 1 === r.nodeType && !_[r.nodeName] && i.x + r.width > i.pdf.margins_doc.left + i.pdf.margins_doc.width) && (i.x += t, i.y = e, i.settings.width += n, !0) }.bind(this, "left" === I.float ? -s.width - O - F : 0, i.y + s.height + R + B, s.width)), i.watchFunctions.push(function (t, e, n) { return !(i.y < t && e === i.pdf.internal.getNumberOfPages()) || 1 === n.nodeType && "both" === h(n).clear && (i.y = t, !0) }.bind(this, i.y + s.height, i.pdf.internal.getNumberOfPages())), i.settings.width -= s.width + O + F, "left" === I.float && (i.x += s.width + O + F)) : i.y += s.height + R + B } else if ("TABLE" === s.nodeName) d = k(s, i), i.y += 10, i.pdf.table(i.x, i.y, d.rows, d.headers, { autoSize: !1, printHeaders: o.printHeaders, margins: i.pdf.margins_doc, css: h(s) }), i.y = i.pdf.lastCellPos.y + i.pdf.lastCellPos.h + 20; else if ("OL" === s.nodeName || "UL" === s.nodeName) C = 1, w(s, i, o) || r(s, i, o), i.y += 10; else if ("LI" === s.nodeName) { var D = i.x; i.x += 20 / i.pdf.internal.scaleFactor, i.y += 3, w(s, i, o) || r(s, i, o), i.x = D } else "BR" === s.nodeName ? (i.y += c["font-size"] * i.pdf.internal.scaleFactor, i.addText("\u2028", n(c))) : w(s, i, o) || r(s, i, o) } } l++ } if (o.outY = i.y, u) return i.setBlockBoundary(p) }, y = {}, v = function (t, e, n, r) { function i() { e.pdf.internal.events.publish("imagesLoaded"), r(s) } function o(t, n, r) { if (t) { var o = new Image; s = ++l, o.crossOrigin = "", o.onerror = o.onload = function () { if (o.complete && (0 === o.src.indexOf("data:image/") && (o.width = n || o.width || 0, o.height = r || o.height || 0), o.width + o.height)) { var s = e.pdf.sHashCode(t) || t; y[s] = y[s] || o } --l || i() }, o.src = t } } for (var s, a = t.getElementsByTagName("img"), c = a.length, l = 0; c--;)o(a[c].getAttribute("src"), a[c].width, a[c].height); return l || i() }, b = function (t, e, n) { var i = t.getElementsByTagName("footer"); if (i.length > 0) { i = i[0]; var o = e.pdf.internal.write, s = e.y; e.pdf.internal.write = function () { }, r(i, e, n); var a = Math.ceil(e.y - s) + 5; e.y = s, e.pdf.internal.write = o, e.pdf.margins_doc.bottom += a; for (var c = function (t) { var o = void 0 !== t ? t.pageNumber : 1, s = e.y; e.y = e.pdf.internal.pageSize.height - e.pdf.margins_doc.bottom, e.pdf.margins_doc.bottom -= a; for (var c = i.getElementsByTagName("span"), l = 0; l < c.length; ++l)(" " + c[l].className + " ").replace(/[\n\t]/g, " ").indexOf(" pageCounter ") > -1 && (c[l].innerHTML = o), (" " + c[l].className + " ").replace(/[\n\t]/g, " ").indexOf(" totalPages ") > -1 && (c[l].innerHTML = "###jsPDFVarTotalPages###"); r(i, e, n), e.pdf.margins_doc.bottom += a, e.y = s }, l = i.getElementsByTagName("span"), u = 0; u < l.length; ++u)(" " + l[u].className + " ").replace(/[\n\t]/g, " ").indexOf(" totalPages ") > -1 && e.pdf.internal.events.subscribe("htmlRenderingFinished", e.pdf.putTotalPages.bind(e.pdf, "###jsPDFVarTotalPages###"), !0); e.pdf.internal.events.subscribe("addPage", c, !1), c(), _.FOOTER = 1 } }, x = function (t, e, n, i, o, s) { if (!e) return !1; "string" == typeof e || e.parentNode || (e = "" + e.innerHTML), "string" == typeof e && (e = function (t) { var e, n, r; return r = "jsPDFhtmlText" + Date.now().toString() + (1e3 * Math.random()).toFixed(0), "position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;", (n = document.createElement("div")).style.cssText = "position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;", n.innerHTML = '<iframe style="height:1px;width:1px" name="' + r + '" />', document.body.appendChild(n), (e = window.frames[r]).document.open(), e.document.writeln(t), e.document.close(), e.document.body }(e.replace(/<\/?script[^>]*?>/gi, ""))); var a, c = new d(t, n, i, o); return v.call(this, e, c, o.elementHandlers, function (t) { b(e, c, o.elementHandlers), r(e, c, o.elementHandlers), c.pdf.internal.events.publish("htmlRenderingFinished"), a = c.dispose(), "function" == typeof s ? s(a) : t && console.error("jsPDF Warning: rendering issues? provide a callback to fromHTML!") }), a || { x: c.x, y: c.y } }, d.prototype.init = function () { return this.paragraph = { text: [], style: [] }, this.pdf.internal.write("q") }, d.prototype.dispose = function () { return this.pdf.internal.write("Q"), { x: this.x, y: this.y, ready: !0 } }, d.prototype.executeWatchFunctions = function (t) { var e = !1, n = []; if (this.watchFunctions.length > 0) { for (var r = 0; r < this.watchFunctions.length; ++r)!0 === this.watchFunctions[r](t) ? e = !0 : n.push(this.watchFunctions[r]); this.watchFunctions = n } return e }, d.prototype.splitFragmentsIntoLines = function (t, e) { var r, i, o, s, a, c, l, u, h, f, d, p, g, m; for (12, f = this.pdf.internal.scaleFactor, s = {}, i = void 0, h = void 0, o = void 0, a = void 0, m = void 0, u = void 0, l = void 0, c = void 0, p = [d = []], r = 0, g = this.settings.width; t.length;)if (a = t.shift(), m = e.shift(), a) if ((o = s[(i = m["font-family"]) + (h = m["font-style"])]) || (o = this.pdf.internal.getFont(i, h).metadata.Unicode, s[i + h] = o), u = { widths: o.widths, kerning: o.kerning, fontSize: 12 * m["font-size"], textIndent: r }, l = this.pdf.getStringUnitWidth(a, u) * u.fontSize / f, "\u2028" == a) d = [], p.push(d); else if (r + l > g) { for (c = this.pdf.splitTextToSize(a, g, u), d.push([c.shift(), m]); c.length;)d = [[c.shift(), m]], p.push(d); r = this.pdf.getStringUnitWidth(d[0][0], u) * u.fontSize / f } else d.push([a, m]), r += l; if (void 0 !== m["text-align"] && ("center" === m["text-align"] || "right" === m["text-align"] || "justify" === m["text-align"])) for (var w = 0; w < p.length; ++w) { var y = this.pdf.getStringUnitWidth(p[w][0][0], u) * u.fontSize / f; w > 0 && (p[w][0][1] = n(p[w][0][1])); var v = g - y; if ("right" === m["text-align"]) p[w][0][1]["margin-left"] = v; else if ("center" === m["text-align"]) p[w][0][1]["margin-left"] = v / 2; else if ("justify" === m["text-align"]) { var b = p[w][0][0].split(" ").length - 1; p[w][0][1]["word-spacing"] = v / b, w === p.length - 1 && (p[w][0][1]["word-spacing"] = 0) } } return p }, d.prototype.RenderTextFragment = function (t, e) { var n, r; r = 0, this.pdf.internal.pageSize.height - this.pdf.margins_doc.bottom < this.y + this.pdf.internal.getFontSize() && (this.pdf.internal.write("ET", "Q"), this.pdf.addPage(), this.y = this.pdf.margins_doc.top, this.pdf.internal.write("q", "BT 0 g", this.pdf.internal.getCoordinateString(this.x), this.pdf.internal.getVerticalCoordinateString(this.y), e.color, "Td"), r = Math.max(r, e["line-height"], e["font-size"]), this.pdf.internal.write(0, (-12 * r).toFixed(2), "Td")), n = this.pdf.internal.getFont(e["font-family"], e["font-style"]); var i = this.getPdfColor(e.color); i !== this.lastTextColor && (this.pdf.internal.write(i), this.lastTextColor = i), void 0 !== e["word-spacing"] && e["word-spacing"] > 0 && this.pdf.internal.write(e["word-spacing"].toFixed(2), "Tw"), this.pdf.internal.write("/" + n.id, (12 * e["font-size"]).toFixed(2), "Tf", "(" + this.pdf.internal.pdfEscape(t) + ") Tj"), void 0 !== e["word-spacing"] && this.pdf.internal.write(0, "Tw") }, d.prototype.getPdfColor = function (t) { var e, n, r, i = /rgb\s*\(\s*(\d+),\s*(\d+),\s*(\d+\s*)\)/.exec(t); if (null != i ? (e = parseInt(i[1]), n = parseInt(i[2]), r = parseInt(i[3])) : ("#" != t.charAt(0) && ((t = o.colorNameToHex(t)) || (t = "#000000")), e = t.substring(1, 3), e = parseInt(e, 16), n = t.substring(3, 5), n = parseInt(n, 16), r = t.substring(5, 7), r = parseInt(r, 16)), "string" == typeof e && /^#[0-9A-Fa-f]{6}$/.test(e)) { var s = parseInt(e.substr(1), 16); e = s >> 16 & 255, n = s >> 8 & 255, r = 255 & s } var a = this.f3; return 0 === e && 0 === n && 0 === r || void 0 === n ? a(e / 255) + " g" : [a(e / 255), a(n / 255), a(r / 255), "rg"].join(" ") }, d.prototype.f3 = function (t) { return t.toFixed(3) }, d.prototype.renderParagraph = function (t) { var e, n, r, i, o, s, a, c, l, u, h, d, p; if (r = f(this.paragraph.text), d = this.paragraph.style, e = this.paragraph.blockstyle, this.paragraph.priorblockstyle || {}, this.paragraph = { text: [], style: [], blockstyle: {}, priorblockstyle: e }, r.join("").trim()) { a = this.splitFragmentsIntoLines(r, d), s = void 0, c = void 0, 12, n = 12 / this.pdf.internal.scaleFactor, this.priorMarginBottom = this.priorMarginBottom || 0, h = (Math.max((e["margin-top"] || 0) - this.priorMarginBottom, 0) + (e["padding-top"] || 0)) * n, u = ((e["margin-bottom"] || 0) + (e["padding-bottom"] || 0)) * n, this.priorMarginBottom = e["margin-bottom"] || 0, "always" === e["page-break-before"] && (this.pdf.addPage(), this.y = 0, h = ((e["margin-top"] || 0) + (e["padding-top"] || 0)) * n), l = this.pdf.internal.write, i = void 0, o = void 0, this.y += h, l("q", "BT 0 g", this.pdf.internal.getCoordinateString(this.x), this.pdf.internal.getVerticalCoordinateString(this.y), "Td"); for (var g = 0; a.length;) { for (c = 0, i = 0, o = (s = a.shift()).length; i !== o;)s[i][0].trim() && (c = Math.max(c, s[i][1]["line-height"], s[i][1]["font-size"]), p = 7 * s[i][1]["font-size"]), i++; var m = 0, w = 0; for (void 0 !== s[0][1]["margin-left"] && s[0][1]["margin-left"] > 0 && (m = (w = this.pdf.internal.getCoordinateString(s[0][1]["margin-left"])) - g, g = w), l(m + Math.max(e["margin-left"] || 0, 0) * n, (-12 * c).toFixed(2), "Td"), i = 0, o = s.length; i !== o;)s[i][0] && this.RenderTextFragment(s[i][0], s[i][1]), i++; if (this.y += c * n, this.executeWatchFunctions(s[0][1]) && a.length > 0) { var y = [], v = []; a.forEach(function (t) { for (var e = 0, n = t.length; e !== n;)t[e][0] && (y.push(t[e][0] + " "), v.push(t[e][1])), ++e }), a = this.splitFragmentsIntoLines(f(y), v), l("ET", "Q"), l("q", "BT 0 g", this.pdf.internal.getCoordinateString(this.x), this.pdf.internal.getVerticalCoordinateString(this.y), "Td") } } return t && "function" == typeof t && t.call(this, this.x - 9, this.y - p / 2), l("ET", "Q"), this.y += u } }, d.prototype.setBlockBoundary = function (t) { return this.renderParagraph(t) }, d.prototype.setBlockStyle = function (t) { return this.paragraph.blockstyle = t }, d.prototype.addText = function (t, e) { return this.paragraph.text.push(t), this.paragraph.style.push(e) }, i = { helvetica: "helvetica", "sans-serif": "helvetica", "times new roman": "times", serif: "times", times: "times", monospace: "courier", courier: "courier" }, c = { 100: "normal", 200: "normal", 300: "normal", 400: "normal", 500: "bold", 600: "bold", 700: "bold", 800: "bold", 900: "bold", normal: "normal", bold: "bold", bolder: "bold", lighter: "normal" }, s = { normal: "normal", italic: "italic", oblique: "italic" }, a = { left: "left", right: "right", center: "center", justify: "justify" }, l = { none: "none", right: "right", left: "left" }, u = { none: "none", both: "both" }, m = { normal: 1 }, e.fromHTML = function (t, e, n, r, i, o) { return this.margins_doc = o || { top: 0, bottom: 0 }, r || (r = {}), r.elementHandlers || (r.elementHandlers = {}), x(this, t, isNaN(e) ? 4 : e, isNaN(n) ? 4 : n, r, i) } }(e.API), function (t) { var e, n, r; t.addJS = function (t) { return r = t, this.internal.events.subscribe("postPutResources", function (t) { e = this.internal.newObject(), this.internal.write("<< /Names [(EmbeddedJS) " + (e + 1) + " 0 R] >>", "endobj"), n = this.internal.newObject(), this.internal.write("<< /S /JavaScript /JS (", r, ") >>", "endobj") }), this.internal.events.subscribe("putCatalog", function () { void 0 !== e && void 0 !== n && this.internal.write("/Names <</JavaScript " + e + " 0 R>>") }), this } }(e.API), function (t) { t.events.push(["postPutResources", function () { var t = this, e = /^(\d+) 0 obj$/; if (this.outline.root.children.length > 0) for (var n = t.outline.render().split(/\r\n/), r = 0; r < n.length; r++) { var i = n[r], o = e.exec(i); if (null != o) { var s = o[1]; t.internal.newObjectDeferredBegin(s) } t.internal.write(i) } if (this.outline.createNamedDestinations) { var a = this.internal.pages.length, c = []; for (r = 0; r < a; r++) { var l = t.internal.newObject(); c.push(l); var u = t.internal.getPageInfo(r + 1); t.internal.write("<< /D[" + u.objId + " 0 R /XYZ null null null]>> endobj") } var h = t.internal.newObject(); t.internal.write("<< /Names [ "); for (r = 0; r < c.length; r++)t.internal.write("(page_" + (r + 1) + ")" + c[r] + " 0 R"); t.internal.write(" ] >>", "endobj"), t.internal.newObject(), t.internal.write("<< /Dests " + h + " 0 R"), t.internal.write(">>", "endobj") } }]), t.events.push(["putCatalog", function () { var t = this; t.outline.root.children.length > 0 && (t.internal.write("/Outlines", this.outline.makeRef(this.outline.root)), this.outline.createNamedDestinations && t.internal.write("/Names " + namesOid + " 0 R")) }]), t.events.push(["initialized", function () { var t = this; t.outline = { createNamedDestinations: !1, root: { children: [] } }, t.outline.add = function (t, e, n) { var r = { title: e, options: n, children: [] }; return null == t && (t = this.root), t.children.push(r), r }, t.outline.render = function () { return this.ctx = {}, this.ctx.val = "", this.ctx.pdf = t, this.genIds_r(this.root), this.renderRoot(this.root), this.renderItems(this.root), this.ctx.val }, t.outline.genIds_r = function (e) { e.id = t.internal.newObjectDeferred(); for (var n = 0; n < e.children.length; n++)this.genIds_r(e.children[n]) }, t.outline.renderRoot = function (t) { this.objStart(t), this.line("/Type /Outlines"), t.children.length > 0 && (this.line("/First " + this.makeRef(t.children[0])), this.line("/Last " + this.makeRef(t.children[t.children.length - 1]))), this.line("/Count " + this.count_r({ count: 0 }, t)), this.objEnd() }, t.outline.renderItems = function (e) { for (var n = 0; n < e.children.length; n++) { var r = e.children[n]; this.objStart(r), this.line("/Title " + this.makeString(r.title)), this.line("/Parent " + this.makeRef(e)), n > 0 && this.line("/Prev " + this.makeRef(e.children[n - 1])), n < e.children.length - 1 && this.line("/Next " + this.makeRef(e.children[n + 1])), r.children.length > 0 && (this.line("/First " + this.makeRef(r.children[0])), this.line("/Last " + this.makeRef(r.children[r.children.length - 1]))); var i = this.count = this.count_r({ count: 0 }, r); if (i > 0 && this.line("/Count " + i), r.options && r.options.pageNumber) { var o = t.internal.getPageInfo(r.options.pageNumber); this.line("/Dest [" + o.objId + " 0 R /XYZ 0 " + this.ctx.pdf.internal.pageSize.height + " 0]") } this.objEnd() } for (n = 0; n < e.children.length; n++) { r = e.children[n]; this.renderItems(r) } }, t.outline.line = function (t) { this.ctx.val += t + "\r\n" }, t.outline.makeRef = function (t) { return t.id + " 0 R" }, t.outline.makeString = function (e) { return "(" + t.internal.pdfEscape(e) + ")" }, t.outline.objStart = function (t) { this.ctx.val += "\r\n" + t.id + " 0 obj\r\n<<\r\n" }, t.outline.objEnd = function (t) { this.ctx.val += ">> \r\nendobj\r\n" }, t.outline.count_r = function (t, e) { for (var n = 0; n < e.children.length; n++)t.count++, this.count_r(t, e.children[n]); return t.count } }]) }(e.API), function (t) { var e = function () { return "function" != typeof PNG || "function" != typeof c }, n = function (e) { return e !== t.image_compression.NONE && r() }, r = function () { var t = "function" == typeof s; if (!t) throw new Error("requires deflate.js for compression"); return t }, i = function (e, n, r, i) { var c = 5, u = f; switch (i) { case t.image_compression.FAST: c = 3, u = h; break; case t.image_compression.MEDIUM: c = 6, u = d; break; case t.image_compression.SLOW: c = 9, u = p }e = l(e, n, r, u); var g = new Uint8Array(o(c)), m = a(e), w = new s(c), y = w.append(e), v = w.flush(), b = g.length + y.length + v.length, x = new Uint8Array(b + 4); return x.set(g), x.set(y, g.length), x.set(v, g.length + y.length), x[b++] = m >>> 24 & 255, x[b++] = m >>> 16 & 255, x[b++] = m >>> 8 & 255, x[b++] = 255 & m, t.arrayBufferToBinaryString(x) }, o = function (t, e) { var n = Math.LOG2E * Math.log(32768) - 8 << 4 | 8, r = n << 8; return r |= Math.min(3, (e - 1 & 255) >> 1) << 6, r |= 0, [n, 255 & (r += 31 - r % 31)] }, a = function (t, e) { for (var n, r = 1, i = 0, o = t.length, s = 0; o > 0;) { o -= n = o > e ? e : o; do { i += r += t[s++] } while (--n); r %= 65521, i %= 65521 } return (i << 16 | r) >>> 0 }, l = function (t, e, n, r) { for (var i, o, s, a = t.length / e, c = new Uint8Array(t.length + a), l = m(), u = 0; u < a; u++) { if (s = u * e, i = t.subarray(s, s + e), r) c.set(r(i, n, o), s + u); else { for (var h = 0, f = l.length, d = []; h < f; h++)d[h] = l[h](i, n, o); var p = w(d.concat()); c.set(d[p], s + u) } o = i } return c }, u = function (t, e, n) { var r = Array.apply([], t); return r.unshift(0), r }, h = function (t, e, n) { var r, i = [], o = 0, s = t.length; for (i[0] = 1; o < s; o++)r = t[o - e] || 0, i[o + 1] = t[o] - r + 256 & 255; return i }, f = function (t, e, n) { var r, i = [], o = 0, s = t.length; for (i[0] = 2; o < s; o++)r = n && n[o] || 0, i[o + 1] = t[o] - r + 256 & 255; return i }, d = function (t, e, n) { var r, i, o = [], s = 0, a = t.length; for (o[0] = 3; s < a; s++)r = t[s - e] || 0, i = n && n[s] || 0, o[s + 1] = t[s] + 256 - (r + i >>> 1) & 255; return o }, p = function (t, e, n) { var r, i, o, s, a = [], c = 0, l = t.length; for (a[0] = 4; c < l; c++)r = t[c - e] || 0, i = n && n[c] || 0, o = n && n[c - e] || 0, s = g(r, i, o), a[c + 1] = t[c] - s + 256 & 255; return a }, g = function (t, e, n) { var r = t + e - n, i = Math.abs(r - t), o = Math.abs(r - e), s = Math.abs(r - n); return i <= o && i <= s ? t : o <= s ? e : n }, m = function () { return [u, h, f, d, p] }, w = function (t) { for (var e, n, r, i = 0, o = t.length; i < o;)((e = y(t[i].slice(1))) < n || !n) && (n = e, r = i), i++; return r }, y = function (t) { for (var e = 0, n = t.length, r = 0; e < n;)r += Math.abs(t[e++]); return r }, v = function (e) { var n; switch (e) { case t.image_compression.FAST: n = 11; break; case t.image_compression.MEDIUM: n = 13; break; case t.image_compression.SLOW: n = 14; break; default: n = 12 }return n }; t.processPNG = function (t, r, o, s, a) { var c, l, u, h, f, d, p = this.color_spaces.DEVICE_RGB, g = this.decode.FLATE_DECODE, m = 8; if (this.isArrayBuffer(t) && (t = new Uint8Array(t)), this.isArrayBufferView(t)) { if (e()) throw new Error("PNG support requires png.js and zlib.js"); if (t = (c = new PNG(t)).imgData, m = c.bits, p = c.colorSpace, h = c.colors, -1 !== [4, 6].indexOf(c.colorType)) { if (8 === c.bits) for (var w, y = (P = 32 == c.pixelBitlength ? new Uint32Array(c.decodePixels().buffer) : 16 == c.pixelBitlength ? new Uint16Array(c.decodePixels().buffer) : new Uint8Array(c.decodePixels().buffer)).length, b = new Uint8Array(y * c.colors), x = new Uint8Array(y), k = c.pixelBitlength - c.bits, _ = 0, C = 0; _ < y; _++) { for (A = P[_], w = 0; w < k;)b[C++] = A >>> w & 255, w += c.bits; x[_] = A >>> w & 255 } if (16 === c.bits) { y = (P = new Uint32Array(c.decodePixels().buffer)).length, b = new Uint8Array(y * (32 / c.pixelBitlength) * c.colors), x = new Uint8Array(y * (32 / c.pixelBitlength)); for (var A, S = c.colors > 1, q = (_ = 0, C = 0, 0); _ < y;)A = P[_++], b[C++] = A >>> 0 & 255, S && (b[C++] = A >>> 16 & 255, A = P[_++], b[C++] = A >>> 0 & 255), x[q++] = A >>> 16 & 255; m = 8 } n(s) ? (t = i(b, c.width * c.colors, c.colors, s), d = i(x, c.width, 1, s)) : (t = b, d = x, g = null) } if (3 === c.colorType && (p = this.color_spaces.INDEXED, f = c.palette, c.transparency.indexed)) { var T = c.transparency.indexed, I = 0; for (_ = 0, y = T.length; _ < y; ++_)I += T[_]; if ((I /= 255) === y - 1 && -1 !== T.indexOf(0)) u = [T.indexOf(0)]; else if (I !== y) { var P = c.decodePixels(); for (x = new Uint8Array(P.length), _ = 0, y = P.length; _ < y; _++)x[_] = T[P[_]]; d = i(x, c.width, 1) } } var E = v(s); return l = g === this.decode.FLATE_DECODE ? "/Predictor " + E + " /Colors " + h + " /BitsPerComponent " + m + " /Columns " + c.width : "/Colors " + h + " /BitsPerComponent " + m + " /Columns " + c.width, (this.isArrayBuffer(t) || this.isArrayBufferView(t)) && (t = this.arrayBufferToBinaryString(t)), (d && this.isArrayBuffer(d) || this.isArrayBufferView(d)) && (d = this.arrayBufferToBinaryString(d)), this.createImageInfo(t, c.width, c.height, p, m, g, r, o, l, u, f, d, E) } throw new Error("Unsupported PNG image data, try using JPEG instead.") } }(e.API), e.API.autoPrint = function () { var t; return this.internal.events.subscribe("postPutResources", function () { t = this.internal.newObject(), this.internal.write("<< /S/Named /Type/Action /N/Print >>", "endobj") }), this.internal.events.subscribe("putCatalog", function () { this.internal.write("/OpenAction " + t + " 0 R") }), this }, function (t) { var e = t.getCharWidthsArray = function (t, e) { e || (e = {}); var n, r, i, o = e.widths ? e.widths : this.internal.getFont().metadata.Unicode.widths, s = o.fof ? o.fof : 1, a = e.kerning ? e.kerning : this.internal.getFont().metadata.Unicode.kerning, c = a.fof ? a.fof : 1, l = 0, u = o[0] || s, h = []; for (n = 0, r = t.length; n < r; n++)i = t.charCodeAt(n), h.push((o[i] || u) / s + (a[i] && a[i][l] || 0) / c), l = i; return h }, n = function (t) { for (var e = t.length, n = 0; e;)n += t[--e]; return n }, r = t.getStringUnitWidth = function (t, r) { return n(e.call(this, t, r)) }, i = function (t, e, n, r) { for (var i = [], o = 0, s = t.length, a = 0; o !== s && a + e[o] < n;)a += e[o], o++; i.push(t.slice(0, o)); var c = o; for (a = 0; o !== s;)a + e[o] > r && (i.push(t.slice(c, o)), a = 0, c = o), a += e[o], o++; return c !== o && i.push(t.slice(c, o)), i }, o = function (t, o, s) { s || (s = {}); var a, c, l, u, h, f, d = [], p = [d], g = s.textIndent || 0, m = 0, w = 0, y = t.split(" "), v = e(" ", s)[0]; if (f = -1 === s.lineIndent ? y[0].length + 2 : s.lineIndent || 0) { var b = Array(f).join(" "), x = []; y.map(function (t) { (t = t.split(/\s*\n/)).length > 1 ? x = x.concat(t.map(function (t, e) { return (e && t.length ? "\n" : "") + t })) : x.push(t[0]) }), y = x, f = r(b, s) } for (l = 0, u = y.length; l < u; l++) { var k = 0; if (a = y[l], f && "\n" == a[0] && (a = a.substr(1), k = 1), c = e(a, s), g + m + (w = n(c)) > o || k) { if (w > o) { for (h = i(a, c, o - (g + m), o), d.push(h.shift()), d = [h.pop()]; h.length;)p.push([h.shift()]); w = n(c.slice(a.length - d[0].length)) } else d = [a]; p.push(d), g = w + f, m = v } else d.push(a), g += m + w, m = v } if (f) var _ = function (t, e) { return (e ? b : "") + t.join(" ") }; else _ = function (t) { return t.join(" ") }; return p.map(_) }; t.splitTextToSize = function (t, e, n) { n || (n = {}); var r, i = n.fontSize || this.internal.getFontSize(), s = function (t) { var e = { 0: 1 }, n = {}; if (t.widths && t.kerning) return { widths: t.widths, kerning: t.kerning }; var r = this.internal.getFont(t.fontName, t.fontStyle), i = "Unicode"; return r.metadata[i] ? { widths: r.metadata[i].widths || e, kerning: r.metadata[i].kerning || n } : { widths: e, kerning: n } }.call(this, n); r = Array.isArray(t) ? t : t.split(/\r?\n/); var a = 1 * this.internal.scaleFactor * e / i; s.textIndent = n.textIndent ? 1 * n.textIndent * this.internal.scaleFactor / i : 0, s.lineIndent = n.lineIndent; var c, l, u = []; for (c = 0, l = r.length; c < l; c++)u = u.concat(o(r[c], a, s)); return u } }(e.API), function (t) { var e = function (t) { for (var e = "klmnopqrstuvwxyz", n = {}, r = 0; r < e.length; r++)n[e[r]] = "0123456789abcdef"[r]; var i, o, s, a, c, l = {}, u = 1, h = l, f = [], d = "", p = "", g = t.length - 1; for (r = 1; r != g;)c = t[r], r += 1, "'" == c ? o ? (a = o.join(""), o = i) : o = [] : o ? o.push(c) : "{" == c ? (f.push([h, a]), h = {}, a = i) : "}" == c ? ((s = f.pop())[0][s[1]] = h, a = i, h = s[0]) : "-" == c ? u = -1 : a === i ? n.hasOwnProperty(c) ? (d += n[c], a = parseInt(d, 16) * u, u = 1, d = "") : d += c : n.hasOwnProperty(c) ? (p += n[c], h[a] = parseInt(p, 16) * u, u = 1, a = i, p = "") : p += c; return l }, n = { codePages: ["WinAnsiEncoding"], WinAnsiEncoding: e("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}") }, r = { Unicode: { Courier: n, "Courier-Bold": n, "Courier-BoldOblique": n, "Courier-Oblique": n, Helvetica: n, "Helvetica-Bold": n, "Helvetica-BoldOblique": n, "Helvetica-Oblique": n, "Times-Roman": n, "Times-Bold": n, "Times-BoldItalic": n, "Times-Italic": n } }, i = { Unicode: { "Courier-Oblique": e("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"), "Times-BoldItalic": e("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"), "Helvetica-Bold": e("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"), Courier: e("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"), "Courier-BoldOblique": e("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"), "Times-Bold": e("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"), Helvetica: e("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"), "Helvetica-BoldOblique": e("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"), "Courier-Bold": e("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"), "Times-Italic": e("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"), "Times-Roman": e("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"), "Helvetica-Oblique": e("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}") } }; t.events.push(["addFont", function (t) { var e, n, o, s = "Unicode"; (e = i[s][t.PostScriptName]) && ((n = t.metadata[s] ? t.metadata[s] : t.metadata[s] = {}).widths = e.widths, n.kerning = e.kerning), (o = r[s][t.PostScriptName]) && ((n = t.metadata[s] ? t.metadata[s] : t.metadata[s] = {}).encoding = o, o.codePages && o.codePages.length && (t.encoding = o.codePages[0])) }]) }(e.API), e.API.addSVG = function (t, e, n, r, i) { function o(t) { for (var e = parseFloat(t[1]), n = parseFloat(t[2]), r = [], i = 3, o = t.length; i < o;)"c" === t[i] ? (r.push([parseFloat(t[i + 1]), parseFloat(t[i + 2]), parseFloat(t[i + 3]), parseFloat(t[i + 4]), parseFloat(t[i + 5]), parseFloat(t[i + 6])]), i += 7) : "l" === t[i] ? (r.push([parseFloat(t[i + 1]), parseFloat(t[i + 2])]), i += 3) : i += 1; return [e, n, r] } var s; if (e === s || n === s) throw new Error("addSVG needs values for 'x' and 'y'"); var a = function (t) { var e = t.createElement("iframe"); return function (t, e) { var n = e.createElement("style"); n.type = "text/css", n.styleSheet ? n.styleSheet.cssText = t : n.appendChild(e.createTextNode(t)), e.getElementsByTagName("head")[0].appendChild(n) }(".jsPDF_sillysvg_iframe {display:none;position:absolute;}", t), e.name = "childframe", e.setAttribute("width", 0), e.setAttribute("height", 0), e.setAttribute("frameborder", "0"), e.setAttribute("scrolling", "no"), e.setAttribute("seamless", "seamless"), e.setAttribute("class", "jsPDF_sillysvg_iframe"), t.body.appendChild(e), e }(document), c = function (t, e) { var n = (e.contentWindow || e.contentDocument).document; return n.write(t), n.close(), n.getElementsByTagName("svg")[0] }(t, a), l = [1, 1], u = parseFloat(c.getAttribute("width")), h = parseFloat(c.getAttribute("height")); u && h && (r && i ? l = [r / u, i / h] : r ? l = [r / u, r / u] : i && (l = [i / h, i / h])); var f, d, p, g, m = c.childNodes; for (f = 0, d = m.length; f < d; f++)(p = m[f]).tagName && "PATH" === p.tagName.toUpperCase() && ((g = o(p.getAttribute("d").split(" ")))[0] = g[0] * l[0] + e, g[1] = g[1] * l[1] + n, this.lines.call(this, g[2], g[0], g[1], l)); return this }, e.API.putTotalPages = function (t) { for (var e = new RegExp(t, "g"), n = 1; n <= this.internal.getNumberOfPages(); n++)for (var r = 0; r < this.internal.pages[n].length; r++)this.internal.pages[n][r] = this.internal.pages[n][r].replace(e, this.internal.getNumberOfPages()); return this }, function (t) { var e = "", n = "", r = ""; t.addMetadata = function (t, i) { return n = i || "http://jspdf.default.namespaceuri/", e = t, this.internal.events.subscribe("postPutResources", function () { if (e) { var t = '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="' + n + '"><jspdf:metadata>', i = unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')), o = unescape(encodeURIComponent(t)), s = unescape(encodeURIComponent(e)), a = unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")), c = unescape(encodeURIComponent("</x:xmpmeta>")), l = o.length + s.length + a.length + i.length + c.length; r = this.internal.newObject(), this.internal.write("<< /Type /Metadata /Subtype /XML /Length " + l + " >>"), this.internal.write("stream"), this.internal.write(i + o + s + a + c), this.internal.write("endstream"), this.internal.write("endobj") } else r = "" }), this.internal.events.subscribe("putCatalog", function () { r && this.internal.write("/Metadata " + r + " 0 R") }), this } }(e.API), function (t) { if (t.URL = t.URL || t.webkitURL, t.Blob && t.URL) try { return void new Blob } catch (t) { } var e = t.BlobBuilder || t.WebKitBlobBuilder || t.MozBlobBuilder || function (t) { var e = function (t) { return Object.prototype.toString.call(t).match(/^\[object\s(.*)\]$/)[1] }, n = function () { this.data = [] }, r = function (t, e, n) { this.data = t, this.size = t.length, this.type = e, this.encoding = n }, i = n.prototype, o = r.prototype, s = t.FileReaderSync, a = function (t) { this.code = this[this.name = t] }, c = "NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR".split(" "), l = c.length, u = t.URL || t.webkitURL || t, h = u.createObjectURL, f = u.revokeObjectURL, d = u, p = t.btoa, g = t.atob, m = t.ArrayBuffer, w = t.Uint8Array, y = /^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/; for (r.fake = o.fake = !0; l--;)a.prototype[c[l]] = l + 1; return u.createObjectURL || (d = t.URL = function (t) { var e, n = document.createElementNS("http://www.w3.org/1999/xhtml", "a"); return n.href = t, "origin" in n || ("data:" === n.protocol.toLowerCase() ? n.origin = null : (e = t.match(y), n.origin = e && e[1])), n }), d.createObjectURL = function (t) { var e, n = t.type; return null === n && (n = "application/octet-stream"), t instanceof r ? (e = "data:" + n, "base64" === t.encoding ? e + ";base64," + t.data : "URI" === t.encoding ? e + "," + decodeURIComponent(t.data) : p ? e + ";base64," + p(t.data) : e + "," + encodeURIComponent(t.data)) : h ? h.call(u, t) : void 0 }, d.revokeObjectURL = function (t) { "data:" !== t.substring(0, 5) && f && f.call(u, t) }, i.append = function (t) { var n = this.data; if (w && (t instanceof m || t instanceof w)) { for (var i = "", o = new w(t), c = 0, l = o.length; c < l; c++)i += String.fromCharCode(o[c]); n.push(i) } else if ("Blob" === e(t) || "File" === e(t)) { if (!s) throw new a("NOT_READABLE_ERR"); var u = new s; n.push(u.readAsBinaryString(t)) } else t instanceof r ? "base64" === t.encoding && g ? n.push(g(t.data)) : "URI" === t.encoding ? n.push(decodeURIComponent(t.data)) : "raw" === t.encoding && n.push(t.data) : ("string" != typeof t && (t += ""), n.push(unescape(encodeURIComponent(t)))) }, i.getBlob = function (t) { return arguments.length || (t = null), new r(this.data.join(""), t, "raw") }, i.toString = function () { return "[object BlobBuilder]" }, o.slice = function (t, e, n) { var i = arguments.length; return i < 3 && (n = null), new r(this.data.slice(t, i > 1 ? e : this.data.length), n, this.encoding) }, o.toString = function () { return "[object Blob]" }, o.close = function () { this.size = 0, delete this.data }, n }(t); t.Blob = function (t, n) { var r = n && n.type || "", i = new e; if (t) for (var o = 0, s = t.length; o < s; o++)Uint8Array && t[o] instanceof Uint8Array ? i.append(t[o].buffer) : i.append(t[o]); var a = i.getBlob(r); return !a.slice && a.webkitSlice && (a.slice = a.webkitSlice), a }; var n = Object.getPrototypeOf || function (t) { return t.__proto__ }; t.Blob.prototype = n(new t.Blob) }("undefined" != typeof self && self || "undefined" != typeof window && window || (void 0).content || void 0); var i = i || function (t) { if ("undefined" == typeof navigator || !/MSIE [1-9]\./.test(navigator.userAgent)) { var e = t.document, n = function () { return t.URL || t.webkitURL || t }, r = e.createElementNS("http://www.w3.org/1999/xhtml", "a"), i = "download" in r, o = /Version\/[\d\.]+.*Safari/.test(navigator.userAgent), s = t.webkitRequestFileSystem, a = t.requestFileSystem || s || t.mozRequestFileSystem, c = function (e) { (t.setImmediate || t.setTimeout)(function () { throw e }, 0) }, l = "application/octet-stream", u = 0, h = function (e) { var r = function () { "string" == typeof e ? n().revokeObjectURL(e) : e.remove() }; t.chrome ? r() : setTimeout(r, 500) }, f = function (t, e, n) { for (var r = (e = [].concat(e)).length; r--;) { var i = t["on" + e[r]]; if ("function" == typeof i) try { i.call(t, n || t) } catch (t) { c(t) } } }, d = function (t) { return /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type) ? new Blob(["\ufeff", t], { type: t.type }) : t }, p = function (e, c, p) { p || (e = d(e)); var g, m, w, y = this, v = e.type, b = !1, x = function () { f(y, "writestart progress write writeend".split(" ")) }, k = function () { if (m && o && "undefined" != typeof FileReader) { var r = new FileReader; return r.onloadend = function () { var t = r.result; m.location.href = "data:attachment/file" + t.slice(t.search(/[,;]/)), y.readyState = y.DONE, x() }, r.readAsDataURL(e), void (y.readyState = y.INIT) } (!b && g || (g = n().createObjectURL(e)), m) ? m.location.href = g : null == t.open(g, "_blank") && o && (t.location.href = g); y.readyState = y.DONE, x(), h(g) }, _ = function (t) { return function () { if (y.readyState !== y.DONE) return t.apply(this, arguments) } }, C = { create: !0, exclusive: !1 }; return y.readyState = y.INIT, c || (c = "download"), i ? (g = n().createObjectURL(e), void setTimeout(function () { var t, e; r.href = g, r.download = c, t = r, e = new MouseEvent("click"), t.dispatchEvent(e), x(), h(g), y.readyState = y.DONE })) : (t.chrome && v && v !== l && (w = e.slice || e.webkitSlice, e = w.call(e, 0, e.size, l), b = !0), s && "download" !== c && (c += ".download"), (v === l || s) && (m = t), a ? (u += e.size, void a(t.TEMPORARY, u, _(function (t) { t.root.getDirectory("saved", C, _(function (t) { var n = function () { t.getFile(c, C, _(function (t) { t.createWriter(_(function (n) { n.onwriteend = function (e) { m.location.href = t.toURL(), y.readyState = y.DONE, f(y, "writeend", e), h(t) }, n.onerror = function () { var t = n.error; t.code !== t.ABORT_ERR && k() }, "writestart progress write abort".split(" ").forEach(function (t) { n["on" + t] = y["on" + t] }), n.write(e), y.abort = function () { n.abort(), y.readyState = y.DONE }, y.readyState = y.WRITING }), k) }), k) }; t.getFile(c, { create: !1 }, _(function (t) { t.remove(), n() }), _(function (t) { t.code === t.NOT_FOUND_ERR ? n() : k() })) }), k) }), k)) : void k()) }, g = p.prototype; return "undefined" != typeof navigator && navigator.msSaveOrOpenBlob ? function (t, e, n) { return n || (t = d(t)), navigator.msSaveOrOpenBlob(t, e || "download") } : (g.abort = function () { var t = this; t.readyState = t.DONE, f(t, "abort") }, g.readyState = g.INIT = 0, g.WRITING = 1, g.DONE = 2, g.error = g.onwritestart = g.onprogress = g.onwrite = g.onabort = g.onerror = g.onwriteend = null, function (t, e, n) { return new p(t, e, n) }) } }("undefined" != typeof self && self || "undefined" != typeof window && window || (void 0).content); "undefined" != typeof module && module.exports ? module.exports.saveAs = i : "undefined" != typeof define && null !== define && null != define.amd && define([], function () { return i }), function (t, e) { "object" == typeof module ? module.exports = e() : "function" == typeof define ? define(e) : t.adler32cs = e() }(e, function () { var t = "function" == typeof ArrayBuffer && "function" == typeof Uint8Array, e = null, n = function () { if (!t) return function () { return !1 }; try { var n = {}; "function" == typeof n.Buffer && (e = n.Buffer) } catch (t) { } return function (t) { return t instanceof ArrayBuffer || null !== e && t instanceof e } }(), r = null !== e ? function (t) { return new e(t, "utf8").toString("binary") } : function (t) { return unescape(encodeURIComponent(t)) }, i = 65521, o = function (t, e) { for (var n = 65535 & t, r = t >>> 16, o = 0, s = e.length; o < s; o++)r = (r + (n = (n + (255 & e.charCodeAt(o))) % i)) % i; return (r << 16 | n) >>> 0 }, s = function (t, e) { for (var n = 65535 & t, r = t >>> 16, o = 0, s = e.length; o < s; o++)r = (r + (n = (n + e[o]) % i)) % i; return (r << 16 | n) >>> 0 }, a = {}, c = a.Adler32 = function () { var e = function (t) { if (!(this instanceof e)) throw new TypeError("Constructor cannot called be as a function."); if (!isFinite(t = null == t ? 1 : +t)) throw new Error("First arguments needs to be a finite number."); this.checksum = t >>> 0 }, i = e.prototype = {}; return i.constructor = e, e.from = function (t) { return t.prototype = i, t }(function (t) { if (!(this instanceof e)) throw new TypeError("Constructor cannot called be as a function."); if (null == t) throw new Error("First argument needs to be a string."); this.checksum = o(1, t.toString()) }), e.fromUtf8 = function (t) { return t.prototype = i, t }(function (t) { if (!(this instanceof e)) throw new TypeError("Constructor cannot called be as a function."); if (null == t) throw new Error("First argument needs to be a string."); var n = r(t.toString()); this.checksum = o(1, n) }), t && (e.fromBuffer = function (t) { return t.prototype = i, t }(function (t) { if (!(this instanceof e)) throw new TypeError("Constructor cannot called be as a function."); if (!n(t)) throw new Error("First argument needs to be ArrayBuffer."); var r = new Uint8Array(t); return this.checksum = s(1, r) })), i.update = function (t) { if (null == t) throw new Error("First argument needs to be a string."); return t = t.toString(), this.checksum = o(this.checksum, t) }, i.updateUtf8 = function (t) { if (null == t) throw new Error("First argument needs to be a string."); var e = r(t.toString()); return this.checksum = o(this.checksum, e) }, t && (i.updateBuffer = function (t) { if (!n(t)) throw new Error("First argument needs to be ArrayBuffer."); var e = new Uint8Array(t); return this.checksum = s(this.checksum, e) }), i.clone = function () { return new c(this.checksum) }, e }(); return a.from = function (t) { if (null == t) throw new Error("First argument needs to be a string."); return o(1, t.toString()) }, a.fromUtf8 = function (t) { if (null == t) throw new Error("First argument needs to be a string."); var e = r(t.toString()); return o(1, e) }, t && (a.fromBuffer = function (t) { if (!n(t)) throw new Error("First argument need to be ArrayBuffer."); var e = new Uint8Array(t); return s(1, e) }), a }); var o = { _colorsTable: { aliceblue: "#f0f8ff", antiquewhite: "#faebd7", aqua: "#00ffff", aquamarine: "#7fffd4", azure: "#f0ffff", beige: "#f5f5dc", bisque: "#ffe4c4", black: "#000000", blanchedalmond: "#ffebcd", blue: "#0000ff", blueviolet: "#8a2be2", brown: "#a52a2a", burlywood: "#deb887", cadetblue: "#5f9ea0", chartreuse: "#7fff00", chocolate: "#d2691e", coral: "#ff7f50", cornflowerblue: "#6495ed", cornsilk: "#fff8dc", crimson: "#dc143c", cyan: "#00ffff", darkblue: "#00008b", darkcyan: "#008b8b", darkgoldenrod: "#b8860b", darkgray: "#a9a9a9", darkgreen: "#006400", darkkhaki: "#bdb76b", darkmagenta: "#8b008b", darkolivegreen: "#556b2f", darkorange: "#ff8c00", darkorchid: "#9932cc", darkred: "#8b0000", darksalmon: "#e9967a", darkseagreen: "#8fbc8f", darkslateblue: "#483d8b", darkslategray: "#2f4f4f", darkturquoise: "#00ced1", darkviolet: "#9400d3", deeppink: "#ff1493", deepskyblue: "#00bfff", dimgray: "#696969", dodgerblue: "#1e90ff", firebrick: "#b22222", floralwhite: "#fffaf0", forestgreen: "#228b22", fuchsia: "#ff00ff", gainsboro: "#dcdcdc", ghostwhite: "#f8f8ff", gold: "#ffd700", goldenrod: "#daa520", gray: "#808080", green: "#008000", greenyellow: "#adff2f", honeydew: "#f0fff0", hotpink: "#ff69b4", "indianred ": "#cd5c5c", indigo: "#4b0082", ivory: "#fffff0", khaki: "#f0e68c", lavender: "#e6e6fa", lavenderblush: "#fff0f5", lawngreen: "#7cfc00", lemonchiffon: "#fffacd", lightblue: "#add8e6", lightcoral: "#f08080", lightcyan: "#e0ffff", lightgoldenrodyellow: "#fafad2", lightgrey: "#d3d3d3", lightgreen: "#90ee90", lightpink: "#ffb6c1", lightsalmon: "#ffa07a", lightseagreen: "#20b2aa", lightskyblue: "#87cefa", lightslategray: "#778899", lightsteelblue: "#b0c4de", lightyellow: "#ffffe0", lime: "#00ff00", limegreen: "#32cd32", linen: "#faf0e6", magenta: "#ff00ff", maroon: "#800000", mediumaquamarine: "#66cdaa", mediumblue: "#0000cd", mediumorchid: "#ba55d3", mediumpurple: "#9370d8", mediumseagreen: "#3cb371", mediumslateblue: "#7b68ee", mediumspringgreen: "#00fa9a", mediumturquoise: "#48d1cc", mediumvioletred: "#c71585", midnightblue: "#191970", mintcream: "#f5fffa", mistyrose: "#ffe4e1", moccasin: "#ffe4b5", navajowhite: "#ffdead", navy: "#000080", oldlace: "#fdf5e6", olive: "#808000", olivedrab: "#6b8e23", orange: "#ffa500", orangered: "#ff4500", orchid: "#da70d6", palegoldenrod: "#eee8aa", palegreen: "#98fb98", paleturquoise: "#afeeee", palevioletred: "#d87093", papayawhip: "#ffefd5", peachpuff: "#ffdab9", peru: "#cd853f", pink: "#ffc0cb", plum: "#dda0dd", powderblue: "#b0e0e6", purple: "#800080", red: "#ff0000", rosybrown: "#bc8f8f", royalblue: "#4169e1", saddlebrown: "#8b4513", salmon: "#fa8072", sandybrown: "#f4a460", seagreen: "#2e8b57", seashell: "#fff5ee", sienna: "#a0522d", silver: "#c0c0c0", skyblue: "#87ceeb", slateblue: "#6a5acd", slategray: "#708090", snow: "#fffafa", springgreen: "#00ff7f", steelblue: "#4682b4", tan: "#d2b48c", teal: "#008080", thistle: "#d8bfd8", tomato: "#ff6347", turquoise: "#40e0d0", violet: "#ee82ee", wheat: "#f5deb3", white: "#ffffff", whitesmoke: "#f5f5f5", yellow: "#ffff00", yellowgreen: "#9acd32" }, colorNameToHex: function (t) { return t = t.toLowerCase(), void 0 !== this._colorsTable[t] && this._colorsTable[t] } }, s = function (t) { function e() { function t(t) { var e, n, i, o, s, c, l = r.dyn_tree, u = r.stat_desc.static_tree, h = r.stat_desc.extra_bits, d = r.stat_desc.extra_base, p = r.stat_desc.max_length, g = 0; for (o = 0; o <= a; o++)t.bl_count[o] = 0; for (l[2 * t.heap[t.heap_max] + 1] = 0, e = t.heap_max + 1; e < f; e++)(o = l[2 * l[2 * (n = t.heap[e]) + 1] + 1] + 1) > p && (o = p, g++), l[2 * n + 1] = o, n > r.max_code || (t.bl_count[o]++, s = 0, n >= d && (s = h[n - d]), c = l[2 * n], t.opt_len += c * (o + s), u && (t.static_len += c * (u[2 * n + 1] + s))); if (0 !== g) { do { for (o = p - 1; 0 === t.bl_count[o];)o--; t.bl_count[o]--, t.bl_count[o + 1] += 2, t.bl_count[p]--, g -= 2 } while (g > 0); for (o = p; 0 !== o; o--)for (n = t.bl_count[o]; 0 !== n;)(i = t.heap[--e]) > r.max_code || (l[2 * i + 1] != o && (t.opt_len += (o - l[2 * i + 1]) * l[2 * i], l[2 * i + 1] = o), n--) } } function e(t, e) { var n = 0; do { n |= 1 & t, t >>>= 1, n <<= 1 } while (--e > 0); return n >>> 1 } function n(t, n, r) { var i, o, s, c = [], l = 0; for (i = 1; i <= a; i++)c[i] = l = l + r[i - 1] << 1; for (o = 0; o <= n; o++)0 !== (s = t[2 * o + 1]) && (t[2 * o] = e(c[s]++, s)) } var r = this; r.build_tree = function (e) { var i, o, s, a = r.dyn_tree, c = r.stat_desc.static_tree, l = r.stat_desc.elems, u = -1; for (e.heap_len = 0, e.heap_max = f, i = 0; i < l; i++)0 !== a[2 * i] ? (e.heap[++e.heap_len] = u = i, e.depth[i] = 0) : a[2 * i + 1] = 0; for (; e.heap_len < 2;)a[2 * (s = e.heap[++e.heap_len] = u < 2 ? ++u : 0)] = 1, e.depth[s] = 0, e.opt_len--, c && (e.static_len -= c[2 * s + 1]); for (r.max_code = u, i = Math.floor(e.heap_len / 2); i >= 1; i--)e.pqdownheap(a, i); s = l; do { i = e.heap[1], e.heap[1] = e.heap[e.heap_len--], e.pqdownheap(a, 1), o = e.heap[1], e.heap[--e.heap_max] = i, e.heap[--e.heap_max] = o, a[2 * s] = a[2 * i] + a[2 * o], e.depth[s] = Math.max(e.depth[i], e.depth[o]) + 1, a[2 * i + 1] = a[2 * o + 1] = s, e.heap[1] = s++, e.pqdownheap(a, 1) } while (e.heap_len >= 2); e.heap[--e.heap_max] = e.heap[1], t(e), n(a, r.max_code, e.bl_count) } } function n(t, e, n, r, i) { var o = this; o.static_tree = t, o.extra_bits = e, o.extra_base = n, o.elems = r, o.max_length = i } function r(t, e, n, r, i) { var o = this; o.good_length = t, o.max_lazy = e, o.nice_length = n, o.max_chain = r, o.func = i } function i(t, e, n, r) { var i = t[2 * e], o = t[2 * n]; return i < o || i == o && r[e] <= r[n] } function o() { function t() { var t; for (t = 0; t < h; t++)Ht[2 * t] = 0; for (t = 0; t < c; t++)Wt[2 * t] = 0; for (t = 0; t < l; t++)Xt[2 * t] = 0; Ht[2 * d] = 1, te.opt_len = te.static_len = 0, Gt = Qt = 0 } function r(t, e) { var n, r, i = -1, o = t[1], s = 0, a = 7, c = 4; for (0 === o && (a = 138, c = 3), t[2 * (e + 1) + 1] = 65535, n = 0; n <= e; n++)r = o, o = t[2 * (n + 1) + 1], ++s < a && r == o || (s < c ? Xt[2 * r] += s : 0 !== r ? (r != i && Xt[2 * r]++, Xt[2 * p]++) : s <= 10 ? Xt[2 * g]++ : Xt[2 * m]++, s = 0, i = r, 0 === o ? (a = 138, c = 3) : r == o ? (a = 6, c = 3) : (a = 7, c = 4)) } function o() { var t; for (r(Ht, ee.max_code), r(Wt, ne.max_code), re.build_tree(te), t = l - 1; t >= 3 && 0 === Xt[2 * e.bl_order[t] + 1]; t--); return te.opt_len += 3 * (t + 1) + 5 + 5 + 4, t } function s(t) { te.pending_buf[te.pending++] = t } function a(t) { s(255 & t), s(t >>> 8 & 255) } function f(t, e) { var n, r = e; Zt > w - r ? (a($t |= (n = t) << Zt & 65535), $t = n >>> w - Zt, Zt += r - w) : ($t |= t << Zt & 65535, Zt += r) } function O(t, e) { var n = 2 * t; f(65535 & e[n], 65535 & e[n + 1]) } function et(t, e) { var n, r, i = -1, o = t[1], s = 0, a = 7, c = 4; for (0 === o && (a = 138, c = 3), n = 0; n <= e; n++)if (r = o, o = t[2 * (n + 1) + 1], !(++s < a && r == o)) { if (s < c) do { O(r, Xt) } while (0 != --s); else 0 !== r ? (r != i && (O(r, Xt), s--), O(p, Xt), f(s - 3, 2)) : s <= 10 ? (O(g, Xt), f(s - 3, 3)) : (O(m, Xt), f(s - 11, 7)); s = 0, i = r, 0 === o ? (a = 138, c = 3) : r == o ? (a = 6, c = 3) : (a = 7, c = 4) } } function nt(t, n, r) { var i; for (f(t - 257, 5), f(n - 1, 5), f(r - 4, 4), i = 0; i < r; i++)f(Xt[2 * e.bl_order[i] + 1], 3); et(Ht, t - 1), et(Wt, n - 1) } function rt() { 16 == Zt ? (a($t), $t = 0, Zt = 0) : Zt >= 8 && (s(255 & $t), $t >>>= 8, Zt -= 8) } function it() { f(Q << 1, 3), O(d, n.static_ltree), rt(), 1 + Kt + 10 - Zt < 9 && (f(Q << 1, 3), O(d, n.static_ltree), rt()), Kt = 7 } function ot(t, n) { var r, i, o; if (te.pending_buf[Jt + 2 * Gt] = t >>> 8 & 255, te.pending_buf[Jt + 2 * Gt + 1] = 255 & t, te.pending_buf[Vt + Gt] = 255 & n, Gt++, 0 === t ? Ht[2 * n]++ : (Qt++, t--, Ht[2 * (e._length_code[n] + u + 1)]++, Wt[2 * e.d_code(t)]++), 0 == (8191 & Gt) && Nt > 2) { for (r = 8 * Gt, i = Ft - It, o = 0; o < c; o++)r += Wt[2 * o] * (5 + e.extra_dbits[o]); if (r >>>= 3, Qt < Math.floor(Gt / 2) && r < Math.floor(i / 2)) return !0 } return Gt == Yt - 1 } function st(t, n) { var r, i, o, s, a = 0; if (0 !== Gt) do { r = te.pending_buf[Jt + 2 * a] << 8 & 65280 | 255 & te.pending_buf[Jt + 2 * a + 1], i = 255 & te.pending_buf[Vt + a], a++, 0 === r ? O(i, t) : (O((o = e._length_code[i]) + u + 1, t), 0 !== (s = e.extra_lbits[o]) && f(i -= e.base_length[o], s), r--, O(o = e.d_code(r), n), 0 !== (s = e.extra_dbits[o]) && f(r -= e.base_dist[o], s)) } while (a < Gt); O(d, t), Kt = t[2 * d + 1] } function at() { Zt > 8 ? a($t) : Zt > 0 && s(255 & $t), $t = 0, Zt = 0 } function ct(t, e, n) { f((J << 1) + (n ? 1 : 0), 3), function (t, e, n) { at(), Kt = 8, n && (a(e), a(~e)), te.pending_buf.set(bt.subarray(t, t + e), te.pending), te.pending += e }(t, e, !0) } function lt(e) { (function (e, r, i) { var s, a, c = 0; Nt > 0 ? (ee.build_tree(te), ne.build_tree(te), c = o(), s = te.opt_len + 3 + 7 >>> 3, (a = te.static_len + 3 + 7 >>> 3) <= s && (s = a)) : s = a = r + 5, r + 4 <= s && -1 != e ? ct(e, r, i) : a == s ? (f((Q << 1) + (i ? 1 : 0), 3), st(n.static_ltree, n.static_dtree)) : (f((K << 1) + (i ? 1 : 0), 3), nt(ee.max_code + 1, ne.max_code + 1, c + 1), st(Ht, Wt)), t(), i && at() })(It >= 0 ? It : -1, Ft - It, e), It = Ft, dt.flush_pending() } function ut() { var t, e, n, r; do { if (0 === (r = xt - Bt - Ft) && 0 === Ft && 0 === Bt) r = wt; else if (-1 == r) r--; else if (Ft >= wt + wt - tt) { bt.set(bt.subarray(wt, wt + wt), 0), Rt -= wt, Ft -= wt, It -= wt, n = t = At; do { e = 65535 & _t[--n], _t[n] = e >= wt ? e - wt : 0 } while (0 != --t); n = t = wt; do { e = 65535 & kt[--n], kt[n] = e >= wt ? e - wt : 0 } while (0 != --t); r += wt } if (0 === dt.avail_in) return; t = dt.read_buf(bt, Ft + Bt, r), (Bt += t) >= $ && (Ct = ((Ct = 255 & bt[Ft]) << Tt ^ 255 & bt[Ft + 1]) & qt) } while (Bt < tt && 0 !== dt.avail_in) } function ht(t) { var e, n, r = jt, i = Ft, o = Dt, s = Ft > wt - tt ? Ft - (wt - tt) : 0, a = Ut, c = vt, l = Ft + Z, u = bt[i + o - 1], h = bt[i + o]; Dt >= Mt && (r >>= 2), a > Bt && (a = Bt); do { if (bt[(e = t) + o] == h && bt[e + o - 1] == u && bt[e] == bt[i] && bt[++e] == bt[i + 1]) { i += 2, e++; do { } while (bt[++i] == bt[++e] && bt[++i] == bt[++e] && bt[++i] == bt[++e] && bt[++i] == bt[++e] && bt[++i] == bt[++e] && bt[++i] == bt[++e] && bt[++i] == bt[++e] && bt[++i] == bt[++e] && i < l); if (n = Z - (l - i), i = l - Z, n > o) { if (Rt = t, o = n, n >= a) break; u = bt[i + o - 1], h = bt[i + o] } } } while ((t = 65535 & kt[t & c]) > s && 0 != --r); return o <= Bt ? o : Bt } function ft(e) { return e.total_in = e.total_out = 0, e.msg = null, te.pending = 0, te.pending_out = 0, pt = V, mt = k, ee.dyn_tree = Ht, ee.stat_desc = n.static_l_desc, ne.dyn_tree = Wt, ne.stat_desc = n.static_d_desc, re.dyn_tree = Xt, re.stat_desc = n.static_bl_desc, $t = 0, Zt = 0, Kt = 8, t(), function () { var t; for (xt = 2 * wt, _t[At - 1] = 0, t = 0; t < At - 1; t++)_t[t] = 0; zt = z[Nt].max_lazy, Mt = z[Nt].good_length, Ut = z[Nt].nice_length, jt = z[Nt].max_chain, Ft = 0, It = 0, Bt = 0, Pt = Dt = $ - 1, Ot = 0, Ct = 0 }(), S } var dt, pt, gt, mt, wt, yt, vt, bt, xt, kt, _t, Ct, At, St, qt, Tt, It, Pt, Et, Ot, Ft, Rt, Bt, Dt, jt, zt, Nt, Lt, Mt, Ut, Ht, Wt, Xt, Vt, Yt, Gt, Jt, Qt, Kt, $t, Zt, te = this, ee = new e, ne = new e, re = new e; te.depth = [], te.bl_count = [], te.heap = [], Ht = [], Wt = [], Xt = [], te.pqdownheap = function (t, e) { for (var n = te.heap, r = n[e], o = e << 1; o <= te.heap_len && (o < te.heap_len && i(t, n[o + 1], n[o], te.depth) && o++, !i(t, r, n[o], te.depth));)n[e] = n[o], e = o, o <<= 1; n[e] = r }, te.deflateInit = function (t, e, n, r, i, o) { return r || (r = G), i || (i = R), o || (o = x), t.msg = null, e == y && (e = 6), i < 1 || i > F || r != G || n < 9 || n > 15 || e < 0 || e > 9 || o < 0 || o > b ? I : (t.dstate = te, vt = (wt = 1 << (yt = n)) - 1, qt = (At = 1 << (St = i + 7)) - 1, Tt = Math.floor((St + $ - 1) / $), bt = new Uint8Array(2 * wt), kt = [], _t = [], Yt = 1 << i + 6, te.pending_buf = new Uint8Array(4 * Yt), gt = 4 * Yt, Jt = Math.floor(Yt / 2), Vt = 3 * Yt, Nt = e, Lt = o, 255 & r, ft(t)) }, te.deflateEnd = function () { return pt != X && pt != V && pt != Y ? I : (te.pending_buf = null, _t = null, kt = null, bt = null, te.dstate = null, pt == V ? P : S) }, te.deflateParams = function (t, e, n) { var r = S; return e == y && (e = 6), e < 0 || e > 9 || n < 0 || n > b ? I : (z[Nt].func != z[e].func && 0 !== t.total_in && (r = t.deflate(_)), Nt != e && (zt = z[Nt = e].max_lazy, Mt = z[Nt].good_length, Ut = z[Nt].nice_length, jt = z[Nt].max_chain), Lt = n, r) }, te.deflateSetDictionary = function (t, e, n) { var r, i = n, o = 0; if (!e || pt != X) return I; if (i < $) return S; for (i > wt - tt && (o = n - (i = wt - tt)), bt.set(e.subarray(o, o + i), 0), Ft = i, It = i, Ct = ((Ct = 255 & bt[0]) << Tt ^ 255 & bt[1]) & qt, r = 0; r <= i - $; r++)Ct = (Ct << Tt ^ 255 & bt[r + ($ - 1)]) & qt, kt[r & vt] = _t[Ct], _t[Ct] = r; return S }, te.deflate = function (t, e) { var n, r, i, o, a; if (e > A || e < 0) return I; if (!t.next_out || !t.next_in && 0 !== t.avail_in || pt == Y && e != A) return t.msg = N[T - I], I; if (0 === t.avail_out) return t.msg = N[T - E], E; if (dt = t, o = mt, mt = e, pt == X && (r = G + (yt - 8 << 4) << 8, (i = (Nt - 1 & 255) >> 1) > 3 && (i = 3), r |= i << 6, 0 !== Ft && (r |= W), pt = V, function (t) { s(t >> 8 & 255), s(255 & t) }(r += 31 - r % 31)), 0 !== te.pending) { if (dt.flush_pending(), 0 === dt.avail_out) return mt = -1, S } else if (0 === dt.avail_in && e <= o && e != A) return dt.msg = N[T - E], E; if (pt == Y && 0 !== dt.avail_in) return t.msg = N[T - E], E; if (0 !== dt.avail_in || 0 !== Bt || e != k && pt != Y) { switch (a = -1, z[Nt].func) { case B: a = function (t) { var e, n = 65535; for (n > gt - 5 && (n = gt - 5); ;) { if (Bt <= 1) { if (ut(), 0 === Bt && t == k) return L; if (0 === Bt) break } if (Ft += Bt, Bt = 0, e = It + n, (0 === Ft || Ft >= e) && (Bt = Ft - e, Ft = e, lt(!1), 0 === dt.avail_out)) return L; if (Ft - It >= wt - tt && (lt(!1), 0 === dt.avail_out)) return L } return lt(t == A), 0 === dt.avail_out ? t == A ? U : L : t == A ? H : M }(e); break; case D: a = function (t) { for (var e, n = 0; ;) { if (Bt < tt) { if (ut(), Bt < tt && t == k) return L; if (0 === Bt) break } if (Bt >= $ && (Ct = (Ct << Tt ^ 255 & bt[Ft + ($ - 1)]) & qt, n = 65535 & _t[Ct], kt[Ft & vt] = _t[Ct], _t[Ct] = Ft), 0 !== n && (Ft - n & 65535) <= wt - tt && Lt != b && (Pt = ht(n)), Pt >= $) if (e = ot(Ft - Rt, Pt - $), Bt -= Pt, Pt <= zt && Bt >= $) { Pt--; do { Ct = (Ct << Tt ^ 255 & bt[++Ft + ($ - 1)]) & qt, n = 65535 & _t[Ct], kt[Ft & vt] = _t[Ct], _t[Ct] = Ft } while (0 != --Pt); Ft++ } else Ft += Pt, Pt = 0, Ct = ((Ct = 255 & bt[Ft]) << Tt ^ 255 & bt[Ft + 1]) & qt; else e = ot(0, 255 & bt[Ft]), Bt--, Ft++; if (e && (lt(!1), 0 === dt.avail_out)) return L } return lt(t == A), 0 === dt.avail_out ? t == A ? U : L : t == A ? H : M }(e); break; case j: a = function (t) { for (var e, n, r = 0; ;) { if (Bt < tt) { if (ut(), Bt < tt && t == k) return L; if (0 === Bt) break } if (Bt >= $ && (Ct = (Ct << Tt ^ 255 & bt[Ft + ($ - 1)]) & qt, r = 65535 & _t[Ct], kt[Ft & vt] = _t[Ct], _t[Ct] = Ft), Dt = Pt, Et = Rt, Pt = $ - 1, 0 !== r && Dt < zt && (Ft - r & 65535) <= wt - tt && (Lt != b && (Pt = ht(r)), Pt <= 5 && (Lt == v || Pt == $ && Ft - Rt > 4096) && (Pt = $ - 1)), Dt >= $ && Pt <= Dt) { n = Ft + Bt - $, e = ot(Ft - 1 - Et, Dt - $), Bt -= Dt - 1, Dt -= 2; do { ++Ft <= n && (Ct = (Ct << Tt ^ 255 & bt[Ft + ($ - 1)]) & qt, r = 65535 & _t[Ct], kt[Ft & vt] = _t[Ct], _t[Ct] = Ft) } while (0 != --Dt); if (Ot = 0, Pt = $ - 1, Ft++, e && (lt(!1), 0 === dt.avail_out)) return L } else if (0 !== Ot) { if ((e = ot(0, 255 & bt[Ft - 1])) && lt(!1), Ft++, Bt--, 0 === dt.avail_out) return L } else Ot = 1, Ft++, Bt-- } return 0 !== Ot && (e = ot(0, 255 & bt[Ft - 1]), Ot = 0), lt(t == A), 0 === dt.avail_out ? t == A ? U : L : t == A ? H : M }(e) }if (a != U && a != H || (pt = Y), a == L || a == U) return 0 === dt.avail_out && (mt = -1), S; if (a == M) { if (e == _) it(); else if (ct(0, 0, !1), e == C) for (n = 0; n < At; n++)_t[n] = 0; if (dt.flush_pending(), 0 === dt.avail_out) return mt = -1, S } } return e != A ? S : q } } function s() { var t = this; t.next_in_index = 0, t.next_out_index = 0, t.avail_in = 0, t.total_in = 0, t.avail_out = 0, t.total_out = 0 } var a = 15, c = 30, l = 19, u = 256, h = u + 1 + 29, f = 2 * h + 1, d = 256, p = 16, g = 17, m = 18, w = 16, y = -1, v = 1, b = 2, x = 0, k = 0, _ = 1, C = 3, A = 4, S = 0, q = 1, T = 2, I = -2, P = -3, E = -5, O = [0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17, 18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29]; e._length_code = [0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28], e.base_length = [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 0], e.base_dist = [0, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576], e.d_code = function (t) { return t < 256 ? O[t] : O[256 + (t >>> 7)] }, e.extra_lbits = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0], e.extra_dbits = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13], e.extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], e.bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], n.static_ltree = [12, 8, 140, 8, 76, 8, 204, 8, 44, 8, 172, 8, 108, 8, 236, 8, 28, 8, 156, 8, 92, 8, 220, 8, 60, 8, 188, 8, 124, 8, 252, 8, 2, 8, 130, 8, 66, 8, 194, 8, 34, 8, 162, 8, 98, 8, 226, 8, 18, 8, 146, 8, 82, 8, 210, 8, 50, 8, 178, 8, 114, 8, 242, 8, 10, 8, 138, 8, 74, 8, 202, 8, 42, 8, 170, 8, 106, 8, 234, 8, 26, 8, 154, 8, 90, 8, 218, 8, 58, 8, 186, 8, 122, 8, 250, 8, 6, 8, 134, 8, 70, 8, 198, 8, 38, 8, 166, 8, 102, 8, 230, 8, 22, 8, 150, 8, 86, 8, 214, 8, 54, 8, 182, 8, 118, 8, 246, 8, 14, 8, 142, 8, 78, 8, 206, 8, 46, 8, 174, 8, 110, 8, 238, 8, 30, 8, 158, 8, 94, 8, 222, 8, 62, 8, 190, 8, 126, 8, 254, 8, 1, 8, 129, 8, 65, 8, 193, 8, 33, 8, 161, 8, 97, 8, 225, 8, 17, 8, 145, 8, 81, 8, 209, 8, 49, 8, 177, 8, 113, 8, 241, 8, 9, 8, 137, 8, 73, 8, 201, 8, 41, 8, 169, 8, 105, 8, 233, 8, 25, 8, 153, 8, 89, 8, 217, 8, 57, 8, 185, 8, 121, 8, 249, 8, 5, 8, 133, 8, 69, 8, 197, 8, 37, 8, 165, 8, 101, 8, 229, 8, 21, 8, 149, 8, 85, 8, 213, 8, 53, 8, 181, 8, 117, 8, 245, 8, 13, 8, 141, 8, 77, 8, 205, 8, 45, 8, 173, 8, 109, 8, 237, 8, 29, 8, 157, 8, 93, 8, 221, 8, 61, 8, 189, 8, 125, 8, 253, 8, 19, 9, 275, 9, 147, 9, 403, 9, 83, 9, 339, 9, 211, 9, 467, 9, 51, 9, 307, 9, 179, 9, 435, 9, 115, 9, 371, 9, 243, 9, 499, 9, 11, 9, 267, 9, 139, 9, 395, 9, 75, 9, 331, 9, 203, 9, 459, 9, 43, 9, 299, 9, 171, 9, 427, 9, 107, 9, 363, 9, 235, 9, 491, 9, 27, 9, 283, 9, 155, 9, 411, 9, 91, 9, 347, 9, 219, 9, 475, 9, 59, 9, 315, 9, 187, 9, 443, 9, 123, 9, 379, 9, 251, 9, 507, 9, 7, 9, 263, 9, 135, 9, 391, 9, 71, 9, 327, 9, 199, 9, 455, 9, 39, 9, 295, 9, 167, 9, 423, 9, 103, 9, 359, 9, 231, 9, 487, 9, 23, 9, 279, 9, 151, 9, 407, 9, 87, 9, 343, 9, 215, 9, 471, 9, 55, 9, 311, 9, 183, 9, 439, 9, 119, 9, 375, 9, 247, 9, 503, 9, 15, 9, 271, 9, 143, 9, 399, 9, 79, 9, 335, 9, 207, 9, 463, 9, 47, 9, 303, 9, 175, 9, 431, 9, 111, 9, 367, 9, 239, 9, 495, 9, 31, 9, 287, 9, 159, 9, 415, 9, 95, 9, 351, 9, 223, 9, 479, 9, 63, 9, 319, 9, 191, 9, 447, 9, 127, 9, 383, 9, 255, 9, 511, 9, 0, 7, 64, 7, 32, 7, 96, 7, 16, 7, 80, 7, 48, 7, 112, 7, 8, 7, 72, 7, 40, 7, 104, 7, 24, 7, 88, 7, 56, 7, 120, 7, 4, 7, 68, 7, 36, 7, 100, 7, 20, 7, 84, 7, 52, 7, 116, 7, 3, 8, 131, 8, 67, 8, 195, 8, 35, 8, 163, 8, 99, 8, 227, 8], n.static_dtree = [0, 5, 16, 5, 8, 5, 24, 5, 4, 5, 20, 5, 12, 5, 28, 5, 2, 5, 18, 5, 10, 5, 26, 5, 6, 5, 22, 5, 14, 5, 30, 5, 1, 5, 17, 5, 9, 5, 25, 5, 5, 5, 21, 5, 13, 5, 29, 5, 3, 5, 19, 5, 11, 5, 27, 5, 7, 5, 23, 5], n.static_l_desc = new n(n.static_ltree, e.extra_lbits, u + 1, h, a), n.static_d_desc = new n(n.static_dtree, e.extra_dbits, 0, c, a), n.static_bl_desc = new n(null, e.extra_blbits, 0, l, 7); var F = 9, R = 8, B = 0, D = 1, j = 2, z = [new r(0, 0, 0, 0, B), new r(4, 4, 8, 4, D), new r(4, 5, 16, 8, D), new r(4, 6, 32, 32, D), new r(4, 4, 16, 16, j), new r(8, 16, 32, 32, j), new r(8, 16, 128, 128, j), new r(8, 32, 128, 256, j), new r(32, 128, 258, 1024, j), new r(32, 258, 258, 4096, j)], N = ["need dictionary", "stream end", "", "", "stream error", "data error", "", "buffer error", "", ""], L = 0, M = 1, U = 2, H = 3, W = 32, X = 42, V = 113, Y = 666, G = 8, J = 0, Q = 1, K = 2, $ = 3, Z = 258, tt = Z + $ + 1; return s.prototype = { deflateInit: function (t, e) { var n = this; return n.dstate = new o, e || (e = a), n.dstate.deflateInit(n, t, e) }, deflate: function (t) { var e = this; return e.dstate ? e.dstate.deflate(e, t) : I }, deflateEnd: function () { var t = this; if (!t.dstate) return I; var e = t.dstate.deflateEnd(); return t.dstate = null, e }, deflateParams: function (t, e) { var n = this; return n.dstate ? n.dstate.deflateParams(n, t, e) : I }, deflateSetDictionary: function (t, e) { var n = this; return n.dstate ? n.dstate.deflateSetDictionary(n, t, e) : I }, read_buf: function (t, e, n) { var r = this, i = r.avail_in; return i > n && (i = n), 0 === i ? 0 : (r.avail_in -= i, t.set(r.next_in.subarray(r.next_in_index, r.next_in_index + i), e), r.next_in_index += i, r.total_in += i, i) }, flush_pending: function () { var t = this, e = t.dstate.pending; e > t.avail_out && (e = t.avail_out), 0 !== e && (t.next_out.set(t.dstate.pending_buf.subarray(t.dstate.pending_out, t.dstate.pending_out + e), t.next_out_index), t.next_out_index += e, t.dstate.pending_out += e, t.total_out += e, t.avail_out -= e, t.dstate.pending -= e, 0 === t.dstate.pending && (t.dstate.pending_out = 0)) } }, function (t) { var e = new s, n = 512, r = k, i = new Uint8Array(n); void 0 === t && (t = y), e.deflateInit(t), e.next_out = i, this.append = function (t, o) { var s, a = [], c = 0, l = 0, u = 0; if (t.length) { e.next_in_index = 0, e.next_in = t, e.avail_in = t.length; do { if (e.next_out_index = 0, e.avail_out = n, e.deflate(r) != S) throw "deflating: " + e.msg; e.next_out_index && (e.next_out_index == n ? a.push(new Uint8Array(i)) : a.push(new Uint8Array(i.subarray(0, e.next_out_index)))), u += e.next_out_index, o && e.next_in_index > 0 && e.next_in_index != c && (o(e.next_in_index), c = e.next_in_index) } while (e.avail_in > 0 || 0 === e.avail_out); return s = new Uint8Array(u), a.forEach(function (t) { s.set(t, l), l += t.length }), s } }, this.flush = function () { var t, r, o = [], s = 0, a = 0; do { if (e.next_out_index = 0, e.avail_out = n, (t = e.deflate(A)) != q && t != S) throw "deflating: " + e.msg; n - e.avail_out > 0 && o.push(new Uint8Array(i.subarray(0, e.next_out_index))), a += e.next_out_index } while (e.avail_in > 0 || 0 === e.avail_out); return e.deflateEnd(), r = new Uint8Array(a), o.forEach(function (t) { r.set(t, s), s += t.length }), r } } }(); !function (t) { if ("object" == typeof exports && "undefined" != typeof module) module.exports = t(); else if ("function" == typeof define && define.amd) define([], t); else { var e; "undefined" != typeof window ? e = window : "undefined" != typeof global ? e = global : "undefined" != typeof self && (e = self), e.html2canvas = t() } }(function () { return function t(e, n, r) { function i(s, a) { if (!n[s]) { if (!e[s]) { var c = "function" == typeof require && require; if (!a && c) return c(s, !0); if (o) return o(s, !0); var l = new Error("Cannot find module '" + s + "'"); throw l.code = "MODULE_NOT_FOUND", l } var u = n[s] = { exports: {} }; e[s][0].call(u.exports, function (t) { var n = e[s][1][t]; return i(n || t) }, u, u.exports, t, e, n, r) } return n[s].exports } for (var o = "function" == typeof require && require, s = 0; s < r.length; s++)i(r[s]); return i }({ 1: [function (t, e, n) { (function (t) { !function (r) { function i(t) { throw RangeError(E[t]) } function o(t, e) { for (var n = t.length; n--;)t[n] = e(t[n]); return t } function s(t, e) { return o(t.split(P), e).join(".") } function a(t) { for (var e, n, r = [], i = 0, o = t.length; i < o;)(e = t.charCodeAt(i++)) >= 55296 && e <= 56319 && i < o ? 56320 == (64512 & (n = t.charCodeAt(i++))) ? r.push(((1023 & e) << 10) + (1023 & n) + 65536) : (r.push(e), i--) : r.push(e); return r } function c(t) { return o(t, function (t) { var e = ""; return t > 65535 && (e += R((t -= 65536) >>> 10 & 1023 | 55296), t = 56320 | 1023 & t), e + R(t) }).join("") } function l(t) { return t - 48 < 10 ? t - 22 : t - 65 < 26 ? t - 65 : t - 97 < 26 ? t - 97 : b } function u(t, e) { return t + 22 + 75 * (t < 26) - ((0 != e) << 5) } function h(t, e, n) { var r = 0; for (t = n ? F(t / C) : t >> 1, t += F(t / e); t > O * k >> 1; r += b)t = F(t / O); return F(r + (O + 1) * t / (t + _)) } function f(t) { var e, n, r, o, s, a, u, f, d, p, g = [], m = t.length, w = 0, y = S, _ = A; for ((n = t.lastIndexOf(q)) < 0 && (n = 0), r = 0; r < n; ++r)t.charCodeAt(r) >= 128 && i("not-basic"), g.push(t.charCodeAt(r)); for (o = n > 0 ? n + 1 : 0; o < m;) { for (s = w, a = 1, u = b; o >= m && i("invalid-input"), ((f = l(t.charCodeAt(o++))) >= b || f > F((v - w) / a)) && i("overflow"), w += f * a, !(f < (d = u <= _ ? x : u >= _ + k ? k : u - _)); u += b)a > F(v / (p = b - d)) && i("overflow"), a *= p; _ = h(w - s, e = g.length + 1, 0 == s), F(w / e) > v - y && i("overflow"), y += F(w / e), w %= e, g.splice(w++, 0, y) } return c(g) } function d(t) { var e, n, r, o, s, c, l, f, d, p, g, m, w, y, _, C = []; for (m = (t = a(t)).length, e = S, n = 0, s = A, c = 0; c < m; ++c)(g = t[c]) < 128 && C.push(R(g)); for (r = o = C.length, o && C.push(q); r < m;) { for (l = v, c = 0; c < m; ++c)(g = t[c]) >= e && g < l && (l = g); for (l - e > F((v - n) / (w = r + 1)) && i("overflow"), n += (l - e) * w, e = l, c = 0; c < m; ++c)if ((g = t[c]) < e && ++n > v && i("overflow"), g == e) { for (f = n, d = b; !(f < (p = d <= s ? x : d >= s + k ? k : d - s)); d += b)_ = f - p, y = b - p, C.push(R(u(p + _ % y, 0))), f = F(_ / y); C.push(R(u(f, 0))), s = h(n, w, r == o), n = 0, ++r } ++n, ++e } return C.join("") } var p = "object" == typeof n && n, g = "object" == typeof e && e && e.exports == p && e, m = "object" == typeof t && t; m.global !== m && m.window !== m || (r = m); var w, y, v = 2147483647, b = 36, x = 1, k = 26, _ = 38, C = 700, A = 72, S = 128, q = "-", T = /^xn--/, I = /[^ -~]/, P = /\x2E|\u3002|\uFF0E|\uFF61/g, E = { overflow: "Overflow: input needs wider integers to process", "not-basic": "Illegal input >= 0x80 (not a basic code point)", "invalid-input": "Invalid input" }, O = b - x, F = Math.floor, R = String.fromCharCode; if (w = { version: "1.2.4", ucs2: { decode: a, encode: c }, decode: f, encode: d, toASCII: function (t) { return s(t, function (t) { return I.test(t) ? "xn--" + d(t) : t }) }, toUnicode: function (t) { return s(t, function (t) { return T.test(t) ? f(t.slice(4).toLowerCase()) : t }) } }, p && !p.nodeType) if (g) g.exports = w; else for (y in w) w.hasOwnProperty(y) && (p[y] = w[y]); else r.punycode = w }(this) }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}) }, {}], 2: [function (t, e, n) { function r(t, e) { for (var n = 3 === t.nodeType ? document.createTextNode(t.nodeValue) : t.cloneNode(!1), o = t.firstChild; o;)!0 !== e && 1 === o.nodeType && "SCRIPT" === o.nodeName || n.appendChild(r(o, e)), o = o.nextSibling; return 1 === t.nodeType && (n._scrollTop = t.scrollTop, n._scrollLeft = t.scrollLeft, "CANVAS" === t.nodeName ? function (t, e) { try { e && (e.width = t.width, e.height = t.height, e.getContext("2d").putImageData(t.getContext("2d").getImageData(0, 0, t.width, t.height), 0, 0)) } catch (e) { i("Unable to copy canvas content from", t, e) } }(t, n) : "TEXTAREA" !== t.nodeName && "SELECT" !== t.nodeName || (n.value = t.value)), n } var i = t("./log"); e.exports = function (t, e, n, i, o, s, a) { var c = r(t.documentElement, o.javascriptEnabled), l = e.createElement("iframe"); return l.className = "html2canvas-container", l.style.visibility = "hidden", l.style.position = "fixed", l.style.left = "-10000px", l.style.top = "0px", l.style.border = "0", l.width = n, l.height = i, l.scrolling = "no", e.body.appendChild(l), new Promise(function (e) { var n = l.contentWindow.document; l.contentWindow.onload = l.onload = function () { var t = setInterval(function () { n.body.childNodes.length > 0 && (function t(e) { if (1 === e.nodeType) { e.scrollTop = e._scrollTop, e.scrollLeft = e._scrollLeft; for (var n = e.firstChild; n;)t(n), n = n.nextSibling } }(n.documentElement), clearInterval(t), "view" === o.type && (l.contentWindow.scrollTo(s, a), !/(iPad|iPhone|iPod)/g.test(navigator.userAgent) || l.contentWindow.scrollY === a && l.contentWindow.scrollX === s || (n.documentElement.style.top = -a + "px", n.documentElement.style.left = -s + "px", n.documentElement.style.position = "absolute")), e(l)) }, 50) }, n.open(), n.write("<!DOCTYPE html><html></html>"), function (t, e, n) { !t.defaultView || e === t.defaultView.pageXOffset && n === t.defaultView.pageYOffset || t.defaultView.scrollTo(e, n) }(t, s, a), n.replaceChild(n.adoptNode(c), n.documentElement), n.close() }) } }, { "./log": 13 }], 3: [function (t, e, n) { function r(t) { this.r = 0, this.g = 0, this.b = 0, this.a = null, this.fromArray(t) || this.namedColor(t) || this.rgb(t) || this.rgba(t) || this.hex6(t) || this.hex3(t) } r.prototype.darken = function (t) { var e = 1 - t; return new r([Math.round(this.r * e), Math.round(this.g * e), Math.round(this.b * e), this.a]) }, r.prototype.isTransparent = function () { return 0 === this.a }, r.prototype.isBlack = function () { return 0 === this.r && 0 === this.g && 0 === this.b }, r.prototype.fromArray = function (t) { return Array.isArray(t) && (this.r = Math.min(t[0], 255), this.g = Math.min(t[1], 255), this.b = Math.min(t[2], 255), t.length > 3 && (this.a = t[3])), Array.isArray(t) }; var i = /^#([a-f0-9]{3})$/i; r.prototype.hex3 = function (t) { var e; return null !== (e = t.match(i)) && (this.r = parseInt(e[1][0] + e[1][0], 16), this.g = parseInt(e[1][1] + e[1][1], 16), this.b = parseInt(e[1][2] + e[1][2], 16)), null !== e }; var o = /^#([a-f0-9]{6})$/i; r.prototype.hex6 = function (t) { var e = null; return null !== (e = t.match(o)) && (this.r = parseInt(e[1].substring(0, 2), 16), this.g = parseInt(e[1].substring(2, 4), 16), this.b = parseInt(e[1].substring(4, 6), 16)), null !== e }; var s = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/; r.prototype.rgb = function (t) { var e; return null !== (e = t.match(s)) && (this.r = Number(e[1]), this.g = Number(e[2]), this.b = Number(e[3])), null !== e }; var a = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d?\.?\d+)\s*\)$/; r.prototype.rgba = function (t) { var e; return null !== (e = t.match(a)) && (this.r = Number(e[1]), this.g = Number(e[2]), this.b = Number(e[3]), this.a = Number(e[4])), null !== e }, r.prototype.toString = function () { return null !== this.a && 1 !== this.a ? "rgba(" + [this.r, this.g, this.b, this.a].join(",") + ")" : "rgb(" + [this.r, this.g, this.b].join(",") + ")" }, r.prototype.namedColor = function (t) { t = t.toLowerCase(); var e = c[t]; if (e) this.r = e[0], this.g = e[1], this.b = e[2]; else if ("transparent" === t) return this.r = this.g = this.b = this.a = 0, !0; return !!e }, r.prototype.isColor = !0; var c = { aliceblue: [240, 248, 255], antiquewhite: [250, 235, 215], aqua: [0, 255, 255], aquamarine: [127, 255, 212], azure: [240, 255, 255], beige: [245, 245, 220], bisque: [255, 228, 196], black: [0, 0, 0], blanchedalmond: [255, 235, 205], blue: [0, 0, 255], blueviolet: [138, 43, 226], brown: [165, 42, 42], burlywood: [222, 184, 135], cadetblue: [95, 158, 160], chartreuse: [127, 255, 0], chocolate: [210, 105, 30], coral: [255, 127, 80], cornflowerblue: [100, 149, 237], cornsilk: [255, 248, 220], crimson: [220, 20, 60], cyan: [0, 255, 255], darkblue: [0, 0, 139], darkcyan: [0, 139, 139], darkgoldenrod: [184, 134, 11], darkgray: [169, 169, 169], darkgreen: [0, 100, 0], darkgrey: [169, 169, 169], darkkhaki: [189, 183, 107], darkmagenta: [139, 0, 139], darkolivegreen: [85, 107, 47], darkorange: [255, 140, 0], darkorchid: [153, 50, 204], darkred: [139, 0, 0], darksalmon: [233, 150, 122], darkseagreen: [143, 188, 143], darkslateblue: [72, 61, 139], darkslategray: [47, 79, 79], darkslategrey: [47, 79, 79], darkturquoise: [0, 206, 209], darkviolet: [148, 0, 211], deeppink: [255, 20, 147], deepskyblue: [0, 191, 255], dimgray: [105, 105, 105], dimgrey: [105, 105, 105], dodgerblue: [30, 144, 255], firebrick: [178, 34, 34], floralwhite: [255, 250, 240], forestgreen: [34, 139, 34], fuchsia: [255, 0, 255], gainsboro: [220, 220, 220], ghostwhite: [248, 248, 255], gold: [255, 215, 0], goldenrod: [218, 165, 32], gray: [128, 128, 128], green: [0, 128, 0], greenyellow: [173, 255, 47], grey: [128, 128, 128], honeydew: [240, 255, 240], hotpink: [255, 105, 180], indianred: [205, 92, 92], indigo: [75, 0, 130], ivory: [255, 255, 240], khaki: [240, 230, 140], lavender: [230, 230, 250], lavenderblush: [255, 240, 245], lawngreen: [124, 252, 0], lemonchiffon: [255, 250, 205], lightblue: [173, 216, 230], lightcoral: [240, 128, 128], lightcyan: [224, 255, 255], lightgoldenrodyellow: [250, 250, 210], lightgray: [211, 211, 211], lightgreen: [144, 238, 144], lightgrey: [211, 211, 211], lightpink: [255, 182, 193], lightsalmon: [255, 160, 122], lightseagreen: [32, 178, 170], lightskyblue: [135, 206, 250], lightslategray: [119, 136, 153], lightslategrey: [119, 136, 153], lightsteelblue: [176, 196, 222], lightyellow: [255, 255, 224], lime: [0, 255, 0], limegreen: [50, 205, 50], linen: [250, 240, 230], magenta: [255, 0, 255], maroon: [128, 0, 0], mediumaquamarine: [102, 205, 170], mediumblue: [0, 0, 205], mediumorchid: [186, 85, 211], mediumpurple: [147, 112, 219], mediumseagreen: [60, 179, 113], mediumslateblue: [123, 104, 238], mediumspringgreen: [0, 250, 154], mediumturquoise: [72, 209, 204], mediumvioletred: [199, 21, 133], midnightblue: [25, 25, 112], mintcream: [245, 255, 250], mistyrose: [255, 228, 225], moccasin: [255, 228, 181], navajowhite: [255, 222, 173], navy: [0, 0, 128], oldlace: [253, 245, 230], olive: [128, 128, 0], olivedrab: [107, 142, 35], orange: [255, 165, 0], orangered: [255, 69, 0], orchid: [218, 112, 214], palegoldenrod: [238, 232, 170], palegreen: [152, 251, 152], paleturquoise: [175, 238, 238], palevioletred: [219, 112, 147], papayawhip: [255, 239, 213], peachpuff: [255, 218, 185], peru: [205, 133, 63], pink: [255, 192, 203], plum: [221, 160, 221], powderblue: [176, 224, 230], purple: [128, 0, 128], rebeccapurple: [102, 51, 153], red: [255, 0, 0], rosybrown: [188, 143, 143], royalblue: [65, 105, 225], saddlebrown: [139, 69, 19], salmon: [250, 128, 114], sandybrown: [244, 164, 96], seagreen: [46, 139, 87], seashell: [255, 245, 238], sienna: [160, 82, 45], silver: [192, 192, 192], skyblue: [135, 206, 235], slateblue: [106, 90, 205], slategray: [112, 128, 144], slategrey: [112, 128, 144], snow: [255, 250, 250], springgreen: [0, 255, 127], steelblue: [70, 130, 180], tan: [210, 180, 140], teal: [0, 128, 128], thistle: [216, 191, 216], tomato: [255, 99, 71], turquoise: [64, 224, 208], violet: [238, 130, 238], wheat: [245, 222, 179], white: [255, 255, 255], whitesmoke: [245, 245, 245], yellow: [255, 255, 0], yellowgreen: [154, 205, 50] }; e.exports = r }, {}], 4: [function (t, e, n) { function r(t, e) { var n = w++; if ((e = e || {}).logging && (h.options.logging = !0, h.options.start = Date.now()), e.async = void 0 === e.async || e.async, e.allowTaint = void 0 !== e.allowTaint && e.allowTaint, e.removeContainer = void 0 === e.removeContainer || e.removeContainer, e.javascriptEnabled = void 0 !== e.javascriptEnabled && e.javascriptEnabled, e.imageTimeout = void 0 === e.imageTimeout ? 1e4 : e.imageTimeout, e.renderer = "function" == typeof e.renderer ? e.renderer : a, e.strict = !!e.strict, "string" == typeof t) { if ("string" != typeof e.proxy) return Promise.reject("Proxy must be used when rendering url"); var r = null != e.width ? e.width : window.innerWidth, o = null != e.height ? e.height : window.innerHeight; return p(function (t) { var e = document.createElement("a"); return e.href = t, e.href = e.href, e }(t), e.proxy, document, r, o, e).then(function (t) { return i(t.contentWindow.document.documentElement, t, e, r, o) }) } var s = (void 0 === t ? [document.documentElement] : t.length ? t : [t])[0]; return s.setAttribute(m + n, n), function (t, e, n, r, o) { return d(t, t, n, r, e, t.defaultView.pageXOffset, t.defaultView.pageYOffset).then(function (s) { h("Document cloned"); var a = m + o, c = "[" + a + "='" + o + "']"; t.querySelector(c).removeAttribute(a); var l = s.contentWindow, u = l.document.querySelector(c), f = "function" == typeof e.onclone ? Promise.resolve(e.onclone(l.document)) : Promise.resolve(!0); return f.then(function () { return i(u, s, e, n, r) }) }) }(s.ownerDocument, e, s.ownerDocument.defaultView.innerWidth, s.ownerDocument.defaultView.innerHeight, n).then(function (t) { return "function" == typeof e.onrendered && (h("options.onrendered is deprecated, html2canvas returns a Promise containing the canvas"), e.onrendered(t)), t }) } function i(t, e, n, r, i) { var a = e.contentWindow, u = new s(a.document), f = new c(n, u), d = g(t), p = "view" === n.type ? r : function (t) { return Math.max(Math.max(t.body.scrollWidth, t.documentElement.scrollWidth), Math.max(t.body.offsetWidth, t.documentElement.offsetWidth), Math.max(t.body.clientWidth, t.documentElement.clientWidth)) }(a.document), m = "view" === n.type ? i : function (t) { return Math.max(Math.max(t.body.scrollHeight, t.documentElement.scrollHeight), Math.max(t.body.offsetHeight, t.documentElement.offsetHeight), Math.max(t.body.clientHeight, t.documentElement.clientHeight)) }(a.document), w = new n.renderer(p, m, f, n, document); return new l(t, w, u, f, n).ready.then(function () { var r; return h("Finished rendering"), r = "view" === n.type ? o(w.canvas, { width: w.canvas.width, height: w.canvas.height, top: 0, left: 0, x: 0, y: 0 }) : t === a.document.body || t === a.document.documentElement || null != n.canvas ? w.canvas : o(w.canvas, { width: null != n.width ? n.width : d.width, height: null != n.height ? n.height : d.height, top: d.top, left: d.left, x: 0, y: 0 }), function (t, e) { e.removeContainer && (t.parentNode.removeChild(t), h("Cleaned up container")) }(e, n), r }) } function o(t, e) { var n = document.createElement("canvas"), r = Math.min(t.width - 1, Math.max(0, e.left)), i = Math.min(t.width, Math.max(1, e.left + e.width)), o = Math.min(t.height - 1, Math.max(0, e.top)), s = Math.min(t.height, Math.max(1, e.top + e.height)); n.width = e.width, n.height = e.height; var a = i - r, c = s - o; return h("Cropping canvas at:", "left:", e.left, "top:", e.top, "width:", a, "height:", c), h("Resulting crop with width", e.width, "and height", e.height, "with x", r, "and y", o), n.getContext("2d").drawImage(t, r, o, a, c, e.x, e.y, a, c), n } var s = t("./support"), a = t("./renderers/canvas"), c = t("./imageloader"), l = t("./nodeparser"), u = t("./nodecontainer"), h = t("./log"), f = t("./utils"), d = t("./clone"), p = t("./proxy").loadUrlDocument, g = f.getBounds, m = "data-html2canvas-node", w = 0; r.CanvasRenderer = a, r.NodeContainer = u, r.log = h, r.utils = f; var y = "undefined" == typeof document || "function" != typeof Object.create || "function" != typeof document.createElement("canvas").getContext ? function () { return Promise.reject("No canvas support") } : r; e.exports = y }, { "./clone": 2, "./imageloader": 11, "./log": 13, "./nodecontainer": 14, "./nodeparser": 15, "./proxy": 16, "./renderers/canvas": 20, "./support": 22, "./utils": 26 }], 5: [function (t, e, n) { var r = t("./log"), i = t("./utils").smallImage; e.exports = function t(e) { if (this.src = e, r("DummyImageContainer for", e), !this.promise || !this.image) { r("Initiating DummyImageContainer"), t.prototype.image = new Image; var n = this.image; t.prototype.promise = new Promise(function (t, e) { n.onload = t, n.onerror = e, n.src = i(), !0 === n.complete && t(n) }) } } }, { "./log": 13, "./utils": 26 }], 6: [function (t, e, n) { var r = t("./utils").smallImage; e.exports = function (t, e) { var n, i, o = document.createElement("div"), s = document.createElement("img"), a = document.createElement("span"), c = "Hidden Text"; o.style.visibility = "hidden", o.style.fontFamily = t, o.style.fontSize = e, o.style.margin = 0, o.style.padding = 0, document.body.appendChild(o), s.src = r(), s.width = 1, s.height = 1, s.style.margin = 0, s.style.padding = 0, s.style.verticalAlign = "baseline", a.style.fontFamily = t, a.style.fontSize = e, a.style.margin = 0, a.style.padding = 0, a.appendChild(document.createTextNode(c)), o.appendChild(a), o.appendChild(s), n = s.offsetTop - a.offsetTop + 1, o.removeChild(a), o.appendChild(document.createTextNode(c)), o.style.lineHeight = "normal", s.style.verticalAlign = "super", i = s.offsetTop - o.offsetTop + 1, document.body.removeChild(o), this.baseline = n, this.lineWidth = 1, this.middle = i } }, { "./utils": 26 }], 7: [function (t, e, n) { function r() { this.data = {} } var i = t("./font"); r.prototype.getMetrics = function (t, e) { return void 0 === this.data[t + "-" + e] && (this.data[t + "-" + e] = new i(t, e)), this.data[t + "-" + e] }, e.exports = r }, { "./font": 6 }], 8: [function (t, e, n) { function r(e, n, r) { this.image = null, this.src = e; var o = this, s = i(e); this.promise = (n ? new Promise(function (t) { "about:blank" === e.contentWindow.document.URL || null == e.contentWindow.document.documentElement ? e.contentWindow.onload = e.onload = function () { t(e) } : t(e) }) : this.proxyLoad(r.proxy, s, r)).then(function (e) { return t("./core")(e.contentWindow.document.documentElement, { type: "view", width: e.width, height: e.height, proxy: r.proxy, javascriptEnabled: r.javascriptEnabled, removeContainer: r.removeContainer, allowTaint: r.allowTaint, imageTimeout: r.imageTimeout / 2 }) }).then(function (t) { return o.image = t }) } var i = t("./utils").getBounds, o = t("./proxy").loadUrlDocument; r.prototype.proxyLoad = function (t, e, n) { var r = this.src; return o(r.src, t, r.ownerDocument, e.width, e.height, n) }, e.exports = r }, { "./core": 4, "./proxy": 16, "./utils": 26 }], 9: [function (t, e, n) { function r(t) { this.src = t.value, this.colorStops = [], this.type = null, this.x0 = .5, this.y0 = .5, this.x1 = .5, this.y1 = .5, this.promise = Promise.resolve(!0) } r.TYPES = { LINEAR: 1, RADIAL: 2 }, r.REGEXP_COLORSTOP = /^\s*(rgba?\(\s*\d{1,3},\s*\d{1,3},\s*\d{1,3}(?:,\s*[0-9\.]+)?\s*\)|[a-z]{3,20}|#[a-f0-9]{3,6})(?:\s+(\d{1,3}(?:\.\d+)?)(%|px)?)?(?:\s|$)/i, e.exports = r }, {}], 10: [function (t, e, n) { e.exports = function (t, e) { this.src = t, this.image = new Image; var n = this; this.tainted = null, this.promise = new Promise(function (r, i) { n.image.onload = r, n.image.onerror = i, e && (n.image.crossOrigin = "anonymous"), n.image.src = t, !0 === n.image.complete && r(n.image) }) } }, {}], 11: [function (t, e, n) { function r(t, e) { this.link = null, this.options = t, this.support = e, this.origin = this.getOrigin(window.location.href) } var i = t("./log"), o = t("./imagecontainer"), s = t("./dummyimagecontainer"), a = t("./proxyimagecontainer"), c = t("./framecontainer"), l = t("./svgcontainer"), u = t("./svgnodecontainer"), h = t("./lineargradientcontainer"), f = t("./webkitgradientcontainer"), d = t("./utils").bind; r.prototype.findImages = function (t) { var e = []; return t.reduce(function (t, e) { switch (e.node.nodeName) { case "IMG": return t.concat([{ args: [e.node.src], method: "url" }]); case "svg": case "IFRAME": return t.concat([{ args: [e.node], method: e.node.nodeName }]) }return t }, []).forEach(this.addImage(e, this.loadImage), this), e }, r.prototype.findBackgroundImage = function (t, e) { return e.parseBackgroundImages().filter(this.hasImageBackground).forEach(this.addImage(t, this.loadImage), this), t }, r.prototype.addImage = function (t, e) { return function (n) { n.args.forEach(function (r) { this.imageExists(t, r) || (t.splice(0, 0, e.call(this, n)), i("Added image #" + t.length, "string" == typeof r ? r.substring(0, 100) : r)) }, this) } }, r.prototype.hasImageBackground = function (t) { return "none" !== t.method }, r.prototype.loadImage = function (t) { if ("url" === t.method) { var e = t.args[0]; return !this.isSVG(e) || this.support.svg || this.options.allowTaint ? e.match(/data:image\/.*;base64,/i) ? new o(e.replace(/url\(['"]{0,}|['"]{0,}\)$/gi, ""), !1) : this.isSameOrigin(e) || !0 === this.options.allowTaint || this.isSVG(e) ? new o(e, !1) : this.support.cors && !this.options.allowTaint && this.options.useCORS ? new o(e, !0) : this.options.proxy ? new a(e, this.options.proxy) : new s(e) : new l(e) } return "linear-gradient" === t.method ? new h(t) : "gradient" === t.method ? new f(t) : "svg" === t.method ? new u(t.args[0], this.support.svg) : "IFRAME" === t.method ? new c(t.args[0], this.isSameOrigin(t.args[0].src), this.options) : new s(t) }, r.prototype.isSVG = function (t) { return "svg" === t.substring(t.length - 3).toLowerCase() || l.prototype.isInline(t) }, r.prototype.imageExists = function (t, e) { return t.some(function (t) { return t.src === e }) }, r.prototype.isSameOrigin = function (t) { return this.getOrigin(t) === this.origin }, r.prototype.getOrigin = function (t) { var e = this.link || (this.link = document.createElement("a")); return e.href = t, e.href = e.href, e.protocol + e.hostname + e.port }, r.prototype.getPromise = function (t) { return this.timeout(t, this.options.imageTimeout).catch(function () { return new s(t.src).promise.then(function (e) { t.image = e }) }) }, r.prototype.get = function (t) { var e = null; return this.images.some(function (n) { return (e = n).src === t }) ? e : null }, r.prototype.fetch = function (t) { return this.images = t.reduce(d(this.findBackgroundImage, this), this.findImages(t)), this.images.forEach(function (t, e) { t.promise.then(function () { i("Succesfully loaded image #" + (e + 1), t) }, function (n) { i("Failed loading image #" + (e + 1), t, n) }) }), this.ready = Promise.all(this.images.map(this.getPromise, this)), i("Finished searching images"), this }, r.prototype.timeout = function (t, e) { var n, r = Promise.race([t.promise, new Promise(function (r, o) { n = setTimeout(function () { i("Timed out loading image", t), o(t) }, e) })]).then(function (t) { return clearTimeout(n), t }); return r.catch(function () { clearTimeout(n) }), r }, e.exports = r }, { "./dummyimagecontainer": 5, "./framecontainer": 8, "./imagecontainer": 10, "./lineargradientcontainer": 12, "./log": 13, "./proxyimagecontainer": 17, "./svgcontainer": 23, "./svgnodecontainer": 24, "./utils": 26, "./webkitgradientcontainer": 27 }], 12: [function (t, e, n) { function r(t) { i.apply(this, arguments), this.type = i.TYPES.LINEAR; var e = r.REGEXP_DIRECTION.test(t.args[0]) || !i.REGEXP_COLORSTOP.test(t.args[0]); e ? t.args[0].split(/\s+/).reverse().forEach(function (t, e) { switch (t) { case "left": this.x0 = 0, this.x1 = 1; break; case "top": this.y0 = 0, this.y1 = 1; break; case "right": this.x0 = 1, this.x1 = 0; break; case "bottom": this.y0 = 1, this.y1 = 0; break; case "to": var n = this.y0, r = this.x0; this.y0 = this.y1, this.x0 = this.x1, this.x1 = r, this.y1 = n; break; case "center": break; default: var i = .01 * parseFloat(t, 10); if (isNaN(i)) break; 0 === e ? (this.y0 = i, this.y1 = 1 - this.y0) : (this.x0 = i, this.x1 = 1 - this.x0) } }, this) : (this.y0 = 0, this.y1 = 1), this.colorStops = t.args.slice(e ? 1 : 0).map(function (t) { var e = t.match(i.REGEXP_COLORSTOP), n = +e[2], r = 0 === n ? "%" : e[3]; return { color: new o(e[1]), stop: "%" === r ? n / 100 : null } }), null === this.colorStops[0].stop && (this.colorStops[0].stop = 0), null === this.colorStops[this.colorStops.length - 1].stop && (this.colorStops[this.colorStops.length - 1].stop = 1), this.colorStops.forEach(function (t, e) { null === t.stop && this.colorStops.slice(e).some(function (n, r) { return null !== n.stop && (t.stop = (n.stop - this.colorStops[e - 1].stop) / (r + 1) + this.colorStops[e - 1].stop, !0) }, this) }, this) } var i = t("./gradientcontainer"), o = t("./color"); r.prototype = Object.create(i.prototype), r.REGEXP_DIRECTION = /^\s*(?:to|left|right|top|bottom|center|\d{1,3}(?:\.\d+)?%?)(?:\s|$)/i, e.exports = r }, { "./color": 3, "./gradientcontainer": 9 }], 13: [function (t, e, n) { var r = function () { r.options.logging && window.console && window.console.log && Function.prototype.bind.call(window.console.log, window.console).apply(window.console, [Date.now() - r.options.start + "ms", "html2canvas:"].concat([].slice.call(arguments, 0))) }; r.options = { logging: !1 }, e.exports = r }, {}], 14: [function (t, e, n) { function r(t, e) { this.node = t, this.parent = e, this.stack = null, this.bounds = null, this.borders = null, this.clip = [], this.backgroundClip = [], this.offsetBounds = null, this.visible = null, this.computedStyles = null, this.colors = {}, this.styles = {}, this.backgroundImages = null, this.transformData = null, this.transformMatrix = null, this.isPseudoElement = !1, this.opacity = null } function i(t) { return -1 !== t.toString().indexOf("%") } function o(t) { return t.replace("px", "") } function s(t) { return parseFloat(t) } var a = t("./color"), c = t("./utils"), l = c.getBounds, u = c.parseBackgrounds, h = c.offsetBounds; r.prototype.cloneTo = function (t) { t.visible = this.visible, t.borders = this.borders, t.bounds = this.bounds, t.clip = this.clip, t.backgroundClip = this.backgroundClip, t.computedStyles = this.computedStyles, t.styles = this.styles, t.backgroundImages = this.backgroundImages, t.opacity = this.opacity }, r.prototype.getOpacity = function () { return null === this.opacity ? this.opacity = this.cssFloat("opacity") : this.opacity }, r.prototype.assignStack = function (t) { this.stack = t, t.children.push(this) }, r.prototype.isElementVisible = function () { return this.node.nodeType === Node.TEXT_NODE ? this.parent.visible : "none" !== this.css("display") && "hidden" !== this.css("visibility") && !this.node.hasAttribute("data-html2canvas-ignore") && ("INPUT" !== this.node.nodeName || "hidden" !== this.node.getAttribute("type")) }, r.prototype.css = function (t) { return this.computedStyles || (this.computedStyles = this.isPseudoElement ? this.parent.computedStyle(this.before ? ":before" : ":after") : this.computedStyle(null)), this.styles[t] || (this.styles[t] = this.computedStyles[t]) }, r.prototype.prefixedCss = function (t) { var e = this.css(t); return void 0 === e && ["webkit", "moz", "ms", "o"].some(function (n) { return void 0 !== (e = this.css(n + t.substr(0, 1).toUpperCase() + t.substr(1))) }, this), void 0 === e ? null : e }, r.prototype.computedStyle = function (t) { return this.node.ownerDocument.defaultView.getComputedStyle(this.node, t) }, r.prototype.cssInt = function (t) { var e = parseInt(this.css(t), 10); return isNaN(e) ? 0 : e }, r.prototype.color = function (t) { return this.colors[t] || (this.colors[t] = new a(this.css(t))) }, r.prototype.cssFloat = function (t) { var e = parseFloat(this.css(t)); return isNaN(e) ? 0 : e }, r.prototype.fontWeight = function () { var t = this.css("fontWeight"); switch (parseInt(t, 10)) { case 401: t = "bold"; break; case 400: t = "normal" }return t }, r.prototype.parseClip = function () { var t = this.css("clip").match(this.CLIP); return t ? { top: parseInt(t[1], 10), right: parseInt(t[2], 10), bottom: parseInt(t[3], 10), left: parseInt(t[4], 10) } : null }, r.prototype.parseBackgroundImages = function () { return this.backgroundImages || (this.backgroundImages = u(this.css("backgroundImage"))) }, r.prototype.cssList = function (t, e) { var n = (this.css(t) || "").split(","); return 1 === (n = (n = n[e || 0] || n[0] || "auto").trim().split(" ")).length && (n = [n[0], i(n[0]) ? "auto" : n[0]]), n }, r.prototype.parseBackgroundSize = function (t, e, n) { var r, o, s = this.cssList("backgroundSize", n); if (i(s[0])) r = t.width * parseFloat(s[0]) / 100; else { if (/contain|cover/.test(s[0])) { var a = t.width / t.height, c = e.width / e.height; return a < c ^ "contain" === s[0] ? { width: t.height * c, height: t.height } : { width: t.width, height: t.width / c } } r = parseInt(s[0], 10) } return o = "auto" === s[0] && "auto" === s[1] ? e.height : "auto" === s[1] ? r / e.width * e.height : i(s[1]) ? t.height * parseFloat(s[1]) / 100 : parseInt(s[1], 10), "auto" === s[0] && (r = o / e.height * e.width), { width: r, height: o } }, r.prototype.parseBackgroundPosition = function (t, e, n, r) { var o, s, a = this.cssList("backgroundPosition", n); return o = i(a[0]) ? (t.width - (r || e).width) * (parseFloat(a[0]) / 100) : parseInt(a[0], 10), s = "auto" === a[1] ? o / e.width * e.height : i(a[1]) ? (t.height - (r || e).height) * parseFloat(a[1]) / 100 : parseInt(a[1], 10), "auto" === a[0] && (o = s / e.height * e.width), { left: o, top: s } }, r.prototype.parseBackgroundRepeat = function (t) { return this.cssList("backgroundRepeat", t)[0] }, r.prototype.parseTextShadows = function () { var t = this.css("textShadow"), e = []; if (t && "none" !== t) for (var n = t.match(this.TEXT_SHADOW_PROPERTY), r = 0; n && r < n.length; r++) { var i = n[r].match(this.TEXT_SHADOW_VALUES); e.push({ color: new a(i[0]), offsetX: i[1] ? parseFloat(i[1].replace("px", "")) : 0, offsetY: i[2] ? parseFloat(i[2].replace("px", "")) : 0, blur: i[3] ? i[3].replace("px", "") : 0 }) } return e }, r.prototype.parseTransform = function () { if (!this.transformData) if (this.hasTransform()) { var t = this.parseBounds(), e = this.prefixedCss("transformOrigin").split(" ").map(o).map(s); e[0] += t.left, e[1] += t.top, this.transformData = { origin: e, matrix: this.parseTransformMatrix() } } else this.transformData = { origin: [0, 0], matrix: [1, 0, 0, 1, 0, 0] }; return this.transformData }, r.prototype.parseTransformMatrix = function () { if (!this.transformMatrix) { var t = this.prefixedCss("transform"), e = t ? function (t) { if (t && "matrix" === t[1]) return t[2].split(",").map(function (t) { return parseFloat(t.trim()) }); if (t && "matrix3d" === t[1]) { var e = t[2].split(",").map(function (t) { return parseFloat(t.trim()) }); return [e[0], e[1], e[4], e[5], e[12], e[13]] } }(t.match(this.MATRIX_PROPERTY)) : null; this.transformMatrix = e || [1, 0, 0, 1, 0, 0] } return this.transformMatrix }, r.prototype.parseBounds = function () { return this.bounds || (this.bounds = this.hasTransform() ? h(this.node) : l(this.node)) }, r.prototype.hasTransform = function () { return "1,0,0,1,0,0" !== this.parseTransformMatrix().join(",") || this.parent && this.parent.hasTransform() }, r.prototype.getValue = function () { var t = this.node.value || ""; return "SELECT" === this.node.tagName ? t = function (t) { var e = t.options[t.selectedIndex || 0]; return e && e.text || "" }(this.node) : "password" === this.node.type && (t = Array(t.length + 1).join("•")), 0 === t.length ? this.node.placeholder || "" : t }, r.prototype.MATRIX_PROPERTY = /(matrix|matrix3d)\((.+)\)/, r.prototype.TEXT_SHADOW_PROPERTY = /((rgba|rgb)\([^\)]+\)(\s-?\d+px){0,})/g, r.prototype.TEXT_SHADOW_VALUES = /(-?\d+px)|(#.+)|(rgb\(.+\))|(rgba\(.+\))/g, r.prototype.CLIP = /^rect\((\d+)px,? (\d+)px,? (\d+)px,? (\d+)px\)$/, e.exports = r }, { "./color": 3, "./utils": 26 }], 15: [function (t, e, n) { function r(t, e, n, r, i) { E("Starting NodeParser"), this.renderer = e, this.options = i, this.range = null, this.support = n, this.renderQueue = [], this.stack = new z(!0, 1, t.ownerDocument, null); var o = new F(t, null); if (i.background && e.rectangle(0, 0, e.width, e.height, new j(i.background)), t === t.ownerDocument.documentElement) { var s = new F(o.color("backgroundColor").isTransparent() ? t.ownerDocument.body : t.ownerDocument.documentElement, null); e.rectangle(0, 0, e.width, e.height, s.color("backgroundColor")) } o.visibile = o.isElementVisible(), this.createPseudoHideStyles(t.ownerDocument), this.disableAnimations(t.ownerDocument), this.nodes = I([o].concat(this.getChildren(o)).filter(function (t) { return t.visible = t.isElementVisible() }).map(this.getPseudoElements, this)), this.fontMetrics = new D, E("Fetched nodes, total:", this.nodes.length), E("Calculate overflow clips"), this.calculateOverflowClips(), E("Start fetching images"), this.images = r.fetch(this.nodes.filter(_)), this.ready = this.images.ready.then(L(function () { return E("Images loaded, starting parsing"), E("Creating stacking contexts"), this.createStackingContexts(), E("Sorting stacking contexts"), this.sortStackingContexts(this.stack), this.parse(this.stack), E("Render queue created with " + this.renderQueue.length + " items"), new Promise(L(function (t) { i.async ? "function" == typeof i.async ? i.async.call(this, this.renderQueue, t) : this.renderQueue.length > 0 ? (this.renderIndex = 0, this.asyncRenderer(this.renderQueue, t)) : t() : (this.renderQueue.forEach(this.paint, this), t()) }, this)) }, this)) } function i(t) { return t.parent && t.parent.clip.length } function o(t) { return t.replace(/(\-[a-z])/g, function (t) { return t.toUpperCase().replace("-", "") }) } function s() { } function a(t, e, n, r) { return t.map(function (i, o) { if (i.width > 0) { var s = e.left, a = e.top, c = e.width, l = e.height - t[2].width; switch (o) { case 0: l = t[0].width, i.args = h({ c1: [s, a], c2: [s + c, a], c3: [s + c - t[1].width, a + l], c4: [s + t[3].width, a + l] }, r[0], r[1], n.topLeftOuter, n.topLeftInner, n.topRightOuter, n.topRightInner); break; case 1: s = e.left + e.width - t[1].width, c = t[1].width, i.args = h({ c1: [s + c, a], c2: [s + c, a + l + t[2].width], c3: [s, a + l], c4: [s, a + t[0].width] }, r[1], r[2], n.topRightOuter, n.topRightInner, n.bottomRightOuter, n.bottomRightInner); break; case 2: a = a + e.height - t[2].width, l = t[2].width, i.args = h({ c1: [s + c, a + l], c2: [s, a + l], c3: [s + t[3].width, a], c4: [s + c - t[3].width, a] }, r[2], r[3], n.bottomRightOuter, n.bottomRightInner, n.bottomLeftOuter, n.bottomLeftInner); break; case 3: c = t[3].width, i.args = h({ c1: [s, a + l + t[2].width], c2: [s, a], c3: [s + c, a + t[0].width], c4: [s + c, a + l] }, r[3], r[0], n.bottomLeftOuter, n.bottomLeftInner, n.topLeftOuter, n.topLeftInner) } } return i }) } function c(t, e, n, r) { var i = (Math.sqrt(2) - 1) / 3 * 4, o = n * i, s = r * i, a = t + n, c = e + r; return { topLeft: u({ x: t, y: c }, { x: t, y: c - s }, { x: a - o, y: e }, { x: a, y: e }), topRight: u({ x: t, y: e }, { x: t + o, y: e }, { x: a, y: c - s }, { x: a, y: c }), bottomRight: u({ x: a, y: e }, { x: a, y: e + s }, { x: t + o, y: c }, { x: t, y: c }), bottomLeft: u({ x: a, y: c }, { x: a - o, y: c }, { x: t, y: e + s }, { x: t, y: e }) } } function l(t, e, n) { var r = t.left, i = t.top, o = t.width, s = t.height, a = e[0][0] < o / 2 ? e[0][0] : o / 2, l = e[0][1] < s / 2 ? e[0][1] : s / 2, u = e[1][0] < o / 2 ? e[1][0] : o / 2, h = e[1][1] < s / 2 ? e[1][1] : s / 2, f = e[2][0] < o / 2 ? e[2][0] : o / 2, d = e[2][1] < s / 2 ? e[2][1] : s / 2, p = e[3][0] < o / 2 ? e[3][0] : o / 2, g = e[3][1] < s / 2 ? e[3][1] : s / 2, m = o - u, w = s - d, y = o - f, v = s - g; return { topLeftOuter: c(r, i, a, l).topLeft.subdivide(.5), topLeftInner: c(r + n[3].width, i + n[0].width, Math.max(0, a - n[3].width), Math.max(0, l - n[0].width)).topLeft.subdivide(.5), topRightOuter: c(r + m, i, u, h).topRight.subdivide(.5), topRightInner: c(r + Math.min(m, o + n[3].width), i + n[0].width, m > o + n[3].width ? 0 : u - n[3].width, h - n[0].width).topRight.subdivide(.5), bottomRightOuter: c(r + y, i + w, f, d).bottomRight.subdivide(.5), bottomRightInner: c(r + Math.min(y, o - n[3].width), i + Math.min(w, s + n[0].width), Math.max(0, f - n[1].width), d - n[2].width).bottomRight.subdivide(.5), bottomLeftOuter: c(r, i + v, p, g).bottomLeft.subdivide(.5), bottomLeftInner: c(r + n[3].width, i + v, Math.max(0, p - n[3].width), g - n[2].width).bottomLeft.subdivide(.5) } } function u(t, e, n, r) { var i = function (t, e, n) { return { x: t.x + (e.x - t.x) * n, y: t.y + (e.y - t.y) * n } }; return { start: t, startControl: e, endControl: n, end: r, subdivide: function (o) { var s = i(t, e, o), a = i(e, n, o), c = i(n, r, o), l = i(s, a, o), h = i(a, c, o), f = i(l, h, o); return [u(t, s, l, f), u(f, h, c, r)] }, curveTo: function (t) { t.push(["bezierCurve", e.x, e.y, n.x, n.y, r.x, r.y]) }, curveToReversed: function (r) { r.push(["bezierCurve", n.x, n.y, e.x, e.y, t.x, t.y]) } } } function h(t, e, n, r, i, o, s) { var a = []; return e[0] > 0 || e[1] > 0 ? (a.push(["line", r[1].start.x, r[1].start.y]), r[1].curveTo(a)) : a.push(["line", t.c1[0], t.c1[1]]), n[0] > 0 || n[1] > 0 ? (a.push(["line", o[0].start.x, o[0].start.y]), o[0].curveTo(a), a.push(["line", s[0].end.x, s[0].end.y]), s[0].curveToReversed(a)) : (a.push(["line", t.c2[0], t.c2[1]]), a.push(["line", t.c3[0], t.c3[1]])), e[0] > 0 || e[1] > 0 ? (a.push(["line", i[1].end.x, i[1].end.y]), i[1].curveToReversed(a)) : a.push(["line", t.c4[0], t.c4[1]]), a } function f(t, e, n, r, i, o, s) { e[0] > 0 || e[1] > 0 ? (t.push(["line", r[0].start.x, r[0].start.y]), r[0].curveTo(t), r[1].curveTo(t)) : t.push(["line", o, s]), (n[0] > 0 || n[1] > 0) && t.push(["line", i[0].start.x, i[0].start.y]) } function d(t) { return t.cssInt("zIndex") < 0 } function p(t) { return t.cssInt("zIndex") > 0 } function g(t) { return 0 === t.cssInt("zIndex") } function m(t) { return -1 !== ["inline", "inline-block", "inline-table"].indexOf(t.css("display")) } function w(t) { return t instanceof z } function y(t) { return t.node.data.trim().length > 0 } function v(t) { return t.nodeType === Node.TEXT_NODE || t.nodeType === Node.ELEMENT_NODE } function b(t) { return "static" !== t.css("position") } function x(t) { return "none" !== t.css("float") } function k(t) { var e = this; return function () { return !t.apply(e, arguments) } } function _(t) { return t.node.nodeType === Node.ELEMENT_NODE } function C(t) { return !0 === t.isPseudoElement } function A(t) { return t.node.nodeType === Node.TEXT_NODE } function S(t) { return parseInt(t, 10) } function q(t) { return t.width } function T(t) { return t.node.nodeType !== Node.ELEMENT_NODE || -1 === ["SCRIPT", "HEAD", "TITLE", "OBJECT", "BR", "OPTION"].indexOf(t.node.nodeName) } function I(t) { return [].concat.apply([], t) } function P(t) { return -1 !== [32, 13, 10, 9, 45].indexOf(t) } var E = t("./log"), O = t("punycode"), F = t("./nodecontainer"), R = t("./textcontainer"), B = t("./pseudoelementcontainer"), D = t("./fontmetrics"), j = t("./color"), z = t("./stackingcontext"), N = t("./utils"), L = N.bind, M = N.getBounds, U = N.parseBackgrounds, H = N.offsetBounds; r.prototype.calculateOverflowClips = function () { this.nodes.forEach(function (t) { if (_(t)) { C(t) && t.appendToDOM(), t.borders = this.parseBorders(t); var e = "hidden" === t.css("overflow") ? [t.borders.clip] : [], n = t.parseClip(); n && -1 !== ["absolute", "fixed"].indexOf(t.css("position")) && e.push([["rect", t.bounds.left + n.left, t.bounds.top + n.top, n.right - n.left, n.bottom - n.top]]), t.clip = i(t) ? t.parent.clip.concat(e) : e, t.backgroundClip = "hidden" !== t.css("overflow") ? t.clip.concat([t.borders.clip]) : t.clip, C(t) && t.cleanDOM() } else A(t) && (t.clip = i(t) ? t.parent.clip : []); C(t) || (t.bounds = null) }, this) }, r.prototype.asyncRenderer = function (t, e, n) { n = n || Date.now(), this.paint(t[this.renderIndex++]), t.length === this.renderIndex ? e() : n + 20 > Date.now() ? this.asyncRenderer(t, e, n) : setTimeout(L(function () { this.asyncRenderer(t, e) }, this), 0) }, r.prototype.createPseudoHideStyles = function (t) { this.createStyles(t, "." + B.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + ':before { content: "" !important; display: none !important; }.' + B.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER + ':after { content: "" !important; display: none !important; }') }, r.prototype.disableAnimations = function (t) { this.createStyles(t, "* { -webkit-animation: none !important; -moz-animation: none !important; -o-animation: none !important; animation: none !important; -webkit-transition: none !important; -moz-transition: none !important; -o-transition: none !important; transition: none !important;}") }, r.prototype.createStyles = function (t, e) { var n = t.createElement("style"); n.innerHTML = e, t.body.appendChild(n) }, r.prototype.getPseudoElements = function (t) { var e = [[t]]; if (t.node.nodeType === Node.ELEMENT_NODE) { var n = this.getPseudoElement(t, ":before"), r = this.getPseudoElement(t, ":after"); n && e.push(n), r && e.push(r) } return I(e) }, r.prototype.getPseudoElement = function (t, e) { var n = t.computedStyle(e); if (!n || !n.content || "none" === n.content || "-moz-alt-content" === n.content || "none" === n.display) return null; for (var r = function (t) { var e = t.substr(0, 1); return e === t.substr(t.length - 1) && e.match(/'|"/) ? t.substr(1, t.length - 2) : t }(n.content), i = "url" === r.substr(0, 3), s = document.createElement(i ? "img" : "html2canvaspseudoelement"), a = new B(s, t, e), c = n.length - 1; c >= 0; c--) { var l = o(n.item(c)); s.style[l] = n[l] } if (s.className = B.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + " " + B.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER, i) return s.src = U(r)[0].args[0], [a]; var u = document.createTextNode(r); return s.appendChild(u), [a, new R(u, a)] }, r.prototype.getChildren = function (t) { return I([].filter.call(t.node.childNodes, v).map(function (e) { var n = [e.nodeType === Node.TEXT_NODE ? new R(e, t) : new F(e, t)].filter(T); return e.nodeType === Node.ELEMENT_NODE && n.length && "TEXTAREA" !== e.tagName ? n[0].isElementVisible() ? n.concat(this.getChildren(n[0])) : [] : n }, this)) }, r.prototype.newStackingContext = function (t, e) { var n = new z(e, t.getOpacity(), t.node, t.parent); t.cloneTo(n), (e ? n.getParentStack(this) : n.parent.stack).contexts.push(n), t.stack = n }, r.prototype.createStackingContexts = function () { this.nodes.forEach(function (t) { _(t) && (this.isRootElement(t) || function (t) { return t.getOpacity() < 1 }(t) || function (t) { var e = t.css("position"); return "auto" !== (-1 !== ["absolute", "relative", "fixed"].indexOf(e) ? t.css("zIndex") : "auto") }(t) || this.isBodyWithTransparentRoot(t) || t.hasTransform()) ? this.newStackingContext(t, !0) : _(t) && (b(t) && g(t) || function (t) { return -1 !== ["inline-block", "inline-table"].indexOf(t.css("display")) }(t) || x(t)) ? this.newStackingContext(t, !1) : t.assignStack(t.parent.stack) }, this) }, r.prototype.isBodyWithTransparentRoot = function (t) { return "BODY" === t.node.nodeName && t.parent.color("backgroundColor").isTransparent() }, r.prototype.isRootElement = function (t) { return null === t.parent }, r.prototype.sortStackingContexts = function (t) { t.contexts.sort(function (t) { return function (e, n) { return e.cssInt("zIndex") + t.indexOf(e) / t.length - (n.cssInt("zIndex") + t.indexOf(n) / t.length) } }(t.contexts.slice(0))), t.contexts.forEach(this.sortStackingContexts, this) }, r.prototype.parseTextBounds = function (t) { return function (e, n, r) { if ("none" !== t.parent.css("textDecoration").substr(0, 4) || 0 !== e.trim().length) { if (this.support.rangeBounds && !t.parent.hasTransform()) { var i = r.slice(0, n).join("").length; return this.getRangeBounds(t.node, i, e.length) } if (t.node && "string" == typeof t.node.data) { var o = t.node.splitText(e.length), s = this.getWrapperBounds(t.node, t.parent.hasTransform()); return t.node = o, s } } else this.support.rangeBounds && !t.parent.hasTransform() || (t.node = t.node.splitText(e.length)); return {} } }, r.prototype.getWrapperBounds = function (t, e) { var n = t.ownerDocument.createElement("html2canvaswrapper"), r = t.parentNode, i = t.cloneNode(!0); n.appendChild(t.cloneNode(!0)), r.replaceChild(n, t); var o = e ? H(n) : M(n); return r.replaceChild(i, n), o }, r.prototype.getRangeBounds = function (t, e, n) { var r = this.range || (this.range = t.ownerDocument.createRange()); return r.setStart(t, e), r.setEnd(t, e + n), r.getBoundingClientRect() }, r.prototype.parse = function (t) { var e = t.contexts.filter(d), n = t.children.filter(_), r = n.filter(k(x)), i = r.filter(k(b)).filter(k(m)), o = n.filter(k(b)).filter(x), a = r.filter(k(b)).filter(m), c = t.contexts.concat(r.filter(b)).filter(g), l = t.children.filter(A).filter(y), u = t.contexts.filter(p); e.concat(i).concat(o).concat(a).concat(c).concat(l).concat(u).forEach(function (t) { this.renderQueue.push(t), w(t) && (this.parse(t), this.renderQueue.push(new s)) }, this) }, r.prototype.paint = function (t) { try { t instanceof s ? this.renderer.ctx.restore() : A(t) ? (C(t.parent) && t.parent.appendToDOM(), this.paintText(t), C(t.parent) && t.parent.cleanDOM()) : this.paintNode(t) } catch (t) { if (E(t), this.options.strict) throw t } }, r.prototype.paintNode = function (t) { w(t) && (this.renderer.setOpacity(t.opacity), this.renderer.ctx.save(), t.hasTransform() && this.renderer.setTransform(t.parseTransform())), "INPUT" === t.node.nodeName && "checkbox" === t.node.type ? this.paintCheckbox(t) : "INPUT" === t.node.nodeName && "radio" === t.node.type ? this.paintRadio(t) : this.paintElement(t) }, r.prototype.paintElement = function (t) { var e = t.parseBounds(); this.renderer.clip(t.backgroundClip, function () { this.renderer.renderBackground(t, e, t.borders.borders.map(q)) }, this), this.renderer.clip(t.clip, function () { this.renderer.renderBorders(t.borders.borders) }, this), this.renderer.clip(t.backgroundClip, function () { switch (t.node.nodeName) { case "svg": case "IFRAME": var n = this.images.get(t.node); n ? this.renderer.renderImage(t, e, t.borders, n) : E("Error loading <" + t.node.nodeName + ">", t.node); break; case "IMG": var r = this.images.get(t.node.src); r ? this.renderer.renderImage(t, e, t.borders, r) : E("Error loading <img>", t.node.src); break; case "CANVAS": this.renderer.renderImage(t, e, t.borders, { image: t.node }); break; case "SELECT": case "INPUT": case "TEXTAREA": this.paintFormValue(t) } }, this) }, r.prototype.paintCheckbox = function (t) { var e = t.parseBounds(), n = Math.min(e.width, e.height), r = { width: n - 1, height: n - 1, top: e.top, left: e.left }, i = [3, 3], o = [i, i, i, i], s = [1, 1, 1, 1].map(function (t) { return { color: new j("#A5A5A5"), width: t } }), c = l(r, o, s); this.renderer.clip(t.backgroundClip, function () { this.renderer.rectangle(r.left + 1, r.top + 1, r.width - 2, r.height - 2, new j("#DEDEDE")), this.renderer.renderBorders(a(s, r, c, o)), t.node.checked && (this.renderer.font(new j("#424242"), "normal", "normal", "bold", n - 3 + "px", "arial"), this.renderer.text("✔", r.left + n / 6, r.top + n - 1)) }, this) }, r.prototype.paintRadio = function (t) { var e = t.parseBounds(), n = Math.min(e.width, e.height) - 2; this.renderer.clip(t.backgroundClip, function () { this.renderer.circleStroke(e.left + 1, e.top + 1, n, new j("#DEDEDE"), 1, new j("#A5A5A5")), t.node.checked && this.renderer.circle(Math.ceil(e.left + n / 4) + 1, Math.ceil(e.top + n / 4) + 1, Math.floor(n / 2), new j("#424242")) }, this) }, r.prototype.paintFormValue = function (t) { var e = t.getValue(); if (e.length > 0) { var n = t.node.ownerDocument, r = n.createElement("html2canvaswrapper");["lineHeight", "textAlign", "fontFamily", "fontWeight", "fontSize", "color", "paddingLeft", "paddingTop", "paddingRight", "paddingBottom", "width", "height", "borderLeftStyle", "borderTopStyle", "borderLeftWidth", "borderTopWidth", "boxSizing", "whiteSpace", "wordWrap"].forEach(function (e) { try { r.style[e] = t.css(e) } catch (t) { E("html2canvas: Parse: Exception caught in renderFormValue: " + t.message) } }); var i = t.parseBounds(); r.style.position = "fixed", r.style.left = i.left + "px", r.style.top = i.top + "px", r.textContent = e, n.body.appendChild(r), this.paintText(new R(r.firstChild, t)), n.body.removeChild(r) } }, r.prototype.paintText = function (t) { t.applyTextTransform(); var e = O.ucs2.decode(t.node.data), n = this.options.letterRendering && !function (t) { return /^(normal|none|0px)$/.test(t.parent.css("letterSpacing")) }(t) || function (t) { return /[^\u0000-\u00ff]/.test(t) }(t.node.data) ? e.map(function (t) { return O.ucs2.encode([t]) }) : function (t) { for (var e, n = [], r = 0, i = !1; t.length;)P(t[r]) === i ? ((e = t.splice(0, r)).length && n.push(O.ucs2.encode(e)), i = !i, r = 0) : r++, r >= t.length && (e = t.splice(0, r)).length && n.push(O.ucs2.encode(e)); return n }(e), r = t.parent.fontWeight(), i = t.parent.css("fontSize"), o = t.parent.css("fontFamily"), s = t.parent.parseTextShadows(); this.renderer.font(t.parent.color("color"), t.parent.css("fontStyle"), t.parent.css("fontVariant"), r, i, o), s.length ? this.renderer.fontShadow(s[0].color, s[0].offsetX, s[0].offsetY, s[0].blur) : this.renderer.clearShadow(), this.renderer.clip(t.parent.clip, function () { n.map(this.parseTextBounds(t), this).forEach(function (e, r) { e && (this.renderer.text(n[r], e.left, e.bottom), this.renderTextDecoration(t.parent, e, this.fontMetrics.getMetrics(o, i))) }, this) }, this) }, r.prototype.renderTextDecoration = function (t, e, n) { switch (t.css("textDecoration").split(" ")[0]) { case "underline": this.renderer.rectangle(e.left, Math.round(e.top + n.baseline + n.lineWidth), e.width, 1, t.color("color")); break; case "overline": this.renderer.rectangle(e.left, Math.round(e.top), e.width, 1, t.color("color")); break; case "line-through": this.renderer.rectangle(e.left, Math.ceil(e.top + n.middle + n.lineWidth), e.width, 1, t.color("color")) } }; var W = { inset: [["darken", .6], ["darken", .1], ["darken", .1], ["darken", .6]] }; r.prototype.parseBorders = function (t) { var e = t.parseBounds(), n = function (t) { return ["TopLeft", "TopRight", "BottomRight", "BottomLeft"].map(function (e) { var n = t.css("border" + e + "Radius").split(" "); return n.length <= 1 && (n[1] = n[0]), n.map(S) }) }(t), r = ["Top", "Right", "Bottom", "Left"].map(function (e, n) { var r = t.css("border" + e + "Style"), i = t.color("border" + e + "Color"); "inset" === r && i.isBlack() && (i = new j([255, 255, 255, i.a])); var o = W[r] ? W[r][n] : null; return { width: t.cssInt("border" + e + "Width"), color: o ? i[o[0]](o[1]) : i, args: null } }), i = l(e, n, r); return { clip: this.parseBackgroundClip(t, i, r, n, e), borders: a(r, e, i, n) } }, r.prototype.parseBackgroundClip = function (t, e, n, r, i) { var o = []; switch (t.css("backgroundClip")) { case "content-box": case "padding-box": f(o, r[0], r[1], e.topLeftInner, e.topRightInner, i.left + n[3].width, i.top + n[0].width), f(o, r[1], r[2], e.topRightInner, e.bottomRightInner, i.left + i.width - n[1].width, i.top + n[0].width), f(o, r[2], r[3], e.bottomRightInner, e.bottomLeftInner, i.left + i.width - n[1].width, i.top + i.height - n[2].width), f(o, r[3], r[0], e.bottomLeftInner, e.topLeftInner, i.left + n[3].width, i.top + i.height - n[2].width); break; default: f(o, r[0], r[1], e.topLeftOuter, e.topRightOuter, i.left, i.top), f(o, r[1], r[2], e.topRightOuter, e.bottomRightOuter, i.left + i.width, i.top), f(o, r[2], r[3], e.bottomRightOuter, e.bottomLeftOuter, i.left + i.width, i.top + i.height), f(o, r[3], r[0], e.bottomLeftOuter, e.topLeftOuter, i.left, i.top + i.height) }return o }, e.exports = r }, { "./color": 3, "./fontmetrics": 7, "./log": 13, "./nodecontainer": 14, "./pseudoelementcontainer": 18, "./stackingcontext": 21, "./textcontainer": 25, "./utils": 26, punycode: 1 }], 16: [function (t, e, n) { function r(t, e, n) { var r = "withCredentials" in new XMLHttpRequest; if (!e) return Promise.reject("No proxy configured"); var c = o(r), l = s(e, t, c); return r ? a(l) : i(n, l, c).then(function (t) { return h(t.content) }) } function i(t, e, n) { return new Promise(function (r, i) { var o = t.createElement("script"), s = function () { delete window.html2canvas.proxy[n], t.body.removeChild(o) }; window.html2canvas.proxy[n] = function (t) { s(), r(t) }, o.src = e, o.onerror = function (t) { s(), i(t) }, t.body.appendChild(o) }) } function o(t) { return t ? "" : "html2canvas_" + Date.now() + "_" + ++f + "_" + Math.round(1e5 * Math.random()) } function s(t, e, n) { return t + "?url=" + encodeURIComponent(e) + (n.length ? "&callback=html2canvas.proxy." + n : "") } var a = t("./xhr"), c = t("./utils"), l = t("./log"), u = t("./clone"), h = c.decode64, f = 0; n.Proxy = r, n.ProxyURL = function (t, e, n) { var r = "crossOrigin" in new Image, a = o(r), c = s(e, t, a); return r ? Promise.resolve(c) : i(n, c, a).then(function (t) { return "data:" + t.type + ";base64," + t.content }) }, n.loadUrlDocument = function (t, e, n, i, o, s) { return new r(t, e, window.document).then(function (t) { return function (e) { var n, r = new DOMParser; try { n = r.parseFromString(e, "text/html") } catch (t) { l("DOMParser not supported, falling back to createHTMLDocument"), n = document.implementation.createHTMLDocument(""); try { n.open(), n.write(e), n.close() } catch (t) { l("createHTMLDocument write not supported, falling back to document.body.innerHTML"), n.body.innerHTML = e } } var i = n.querySelector("base"); if (!i || !i.href.host) { var o = n.createElement("base"); o.href = t, n.head.insertBefore(o, n.head.firstChild) } return n } }(t)).then(function (t) { return u(t, n, i, o, s, 0, 0) }) } }, { "./clone": 2, "./log": 13, "./utils": 26, "./xhr": 28 }], 17: [function (t, e, n) { var r = t("./proxy").ProxyURL; e.exports = function (t, e) { var n = document.createElement("a"); n.href = t, t = n.href, this.src = t, this.image = new Image; var i = this; this.promise = new Promise(function (n, o) { i.image.crossOrigin = "Anonymous", i.image.onload = n, i.image.onerror = o, new r(t, e, document).then(function (t) { i.image.src = t }).catch(o) }) } }, { "./proxy": 16 }], 18: [function (t, e, n) { function r(t, e, n) { i.call(this, t, e), this.isPseudoElement = !0, this.before = ":before" === n } var i = t("./nodecontainer"); r.prototype.cloneTo = function (t) { r.prototype.cloneTo.call(this, t), t.isPseudoElement = !0, t.before = this.before }, r.prototype = Object.create(i.prototype), r.prototype.appendToDOM = function () { this.before ? this.parent.node.insertBefore(this.node, this.parent.node.firstChild) : this.parent.node.appendChild(this.node), this.parent.node.className += " " + this.getHideClass() }, r.prototype.cleanDOM = function () { this.node.parentNode.removeChild(this.node), this.parent.node.className = this.parent.node.className.replace(this.getHideClass(), "") }, r.prototype.getHideClass = function () { return this["PSEUDO_HIDE_ELEMENT_CLASS_" + (this.before ? "BEFORE" : "AFTER")] }, r.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE = "___html2canvas___pseudoelement_before", r.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER = "___html2canvas___pseudoelement_after", e.exports = r }, { "./nodecontainer": 14 }], 19: [function (t, e, n) { function r(t, e, n, r, i) { this.width = t, this.height = e, this.images = n, this.options = r, this.document = i } var i = t("./log"); r.prototype.renderImage = function (t, e, n, r) { var i = t.cssInt("paddingLeft"), o = t.cssInt("paddingTop"), s = t.cssInt("paddingRight"), a = t.cssInt("paddingBottom"), c = n.borders, l = e.width - (c[1].width + c[3].width + i + s), u = e.height - (c[0].width + c[2].width + o + a); this.drawImage(r, 0, 0, r.image.width || l, r.image.height || u, e.left + i + c[3].width, e.top + o + c[0].width, l, u) }, r.prototype.renderBackground = function (t, e, n) { e.height > 0 && e.width > 0 && (this.renderBackgroundColor(t, e), this.renderBackgroundImage(t, e, n)) }, r.prototype.renderBackgroundColor = function (t, e) { var n = t.color("backgroundColor"); n.isTransparent() || this.rectangle(e.left, e.top, e.width, e.height, n) }, r.prototype.renderBorders = function (t) { t.forEach(this.renderBorder, this) }, r.prototype.renderBorder = function (t) { t.color.isTransparent() || null === t.args || this.drawShape(t.args, t.color) }, r.prototype.renderBackgroundImage = function (t, e, n) { t.parseBackgroundImages().reverse().forEach(function (r, o, s) { switch (r.method) { case "url": var a = this.images.get(r.args[0]); a ? this.renderBackgroundRepeating(t, e, a, s.length - (o + 1), n) : i("Error loading background-image", r.args[0]); break; case "linear-gradient": case "gradient": var c = this.images.get(r.value); c ? this.renderBackgroundGradient(c, e, n) : i("Error loading background-image", r.args[0]); break; case "none": break; default: i("Unknown background-image type", r.args[0]) } }, this) }, r.prototype.renderBackgroundRepeating = function (t, e, n, r, i) { var o = t.parseBackgroundSize(e, n.image, r), s = t.parseBackgroundPosition(e, n.image, r, o); switch (t.parseBackgroundRepeat(r)) { case "repeat-x": case "repeat no-repeat": this.backgroundRepeatShape(n, s, o, e, e.left + i[3], e.top + s.top + i[0], 99999, o.height, i); break; case "repeat-y": case "no-repeat repeat": this.backgroundRepeatShape(n, s, o, e, e.left + s.left + i[3], e.top + i[0], o.width, 99999, i); break; case "no-repeat": this.backgroundRepeatShape(n, s, o, e, e.left + s.left + i[3], e.top + s.top + i[0], o.width, o.height, i); break; default: this.renderBackgroundRepeat(n, s, o, { top: e.top, left: e.left }, i[3], i[0]) } }, e.exports = r }, { "./log": 13 }], 20: [function (t, e, n) { function r(t, e) { o.apply(this, arguments), this.canvas = this.options.canvas || this.document.createElement("canvas"), this.options.canvas || (this.canvas.width = t, this.canvas.height = e), this.ctx = this.canvas.getContext("2d"), this.taintCtx = this.document.createElement("canvas").getContext("2d"), this.ctx.textBaseline = "bottom", this.variables = {}, a("Initialized CanvasRenderer with size", t, "x", e) } function i(t) { return t.length > 0 } var o = t("../renderer"), s = t("../lineargradientcontainer"), a = t("../log"); r.prototype = Object.create(o.prototype), r.prototype.setFillStyle = function (t) { return this.ctx.fillStyle = "object" == typeof t && t.isColor ? t.toString() : t, this.ctx }, r.prototype.rectangle = function (t, e, n, r, i) { this.setFillStyle(i).fillRect(t, e, n, r) }, r.prototype.circle = function (t, e, n, r) { this.setFillStyle(r), this.ctx.beginPath(), this.ctx.arc(t + n / 2, e + n / 2, n / 2, 0, 2 * Math.PI, !0), this.ctx.closePath(), this.ctx.fill() }, r.prototype.circleStroke = function (t, e, n, r, i, o) { this.circle(t, e, n, r), this.ctx.strokeStyle = o.toString(), this.ctx.stroke() }, r.prototype.drawShape = function (t, e) { this.shape(t), this.setFillStyle(e).fill() }, r.prototype.taints = function (t) { if (null === t.tainted) { this.taintCtx.drawImage(t.image, 0, 0); try { this.taintCtx.getImageData(0, 0, 1, 1), t.tainted = !1 } catch (e) { this.taintCtx = document.createElement("canvas").getContext("2d"), t.tainted = !0 } } return t.tainted }, r.prototype.drawImage = function (t, e, n, r, i, o, s, a, c) { this.taints(t) && !this.options.allowTaint || this.ctx.drawImage(t.image, e, n, r, i, o, s, a, c) }, r.prototype.clip = function (t, e, n) { this.ctx.save(), t.filter(i).forEach(function (t) { this.shape(t).clip() }, this), e.call(n), this.ctx.restore() }, r.prototype.shape = function (t) { return this.ctx.beginPath(), t.forEach(function (t, e) { "rect" === t[0] ? this.ctx.rect.apply(this.ctx, t.slice(1)) : this.ctx[0 === e ? "moveTo" : t[0] + "To"].apply(this.ctx, t.slice(1)) }, this), this.ctx.closePath(), this.ctx }, r.prototype.font = function (t, e, n, r, i, o) { this.setFillStyle(t).font = [e, n, r, i, o].join(" ").split(",")[0] }, r.prototype.fontShadow = function (t, e, n, r) { this.setVariable("shadowColor", t.toString()).setVariable("shadowOffsetY", e).setVariable("shadowOffsetX", n).setVariable("shadowBlur", r) }, r.prototype.clearShadow = function () { this.setVariable("shadowColor", "rgba(0,0,0,0)") }, r.prototype.setOpacity = function (t) { this.ctx.globalAlpha = t }, r.prototype.setTransform = function (t) { this.ctx.translate(t.origin[0], t.origin[1]), this.ctx.transform.apply(this.ctx, t.matrix), this.ctx.translate(-t.origin[0], -t.origin[1]) }, r.prototype.setVariable = function (t, e) { return this.variables[t] !== e && (this.variables[t] = this.ctx[t] = e), this }, r.prototype.text = function (t, e, n) { this.ctx.fillText(t, e, n) }, r.prototype.backgroundRepeatShape = function (t, e, n, r, i, o, s, a, c) { var l = [["line", Math.round(i), Math.round(o)], ["line", Math.round(i + s), Math.round(o)], ["line", Math.round(i + s), Math.round(a + o)], ["line", Math.round(i), Math.round(a + o)]]; this.clip([l], function () { this.renderBackgroundRepeat(t, e, n, r, c[3], c[0]) }, this) }, r.prototype.renderBackgroundRepeat = function (t, e, n, r, i, o) { var s = Math.round(r.left + e.left + i), a = Math.round(r.top + e.top + o); this.setFillStyle(this.ctx.createPattern(this.resizeImage(t, n), "repeat")), this.ctx.translate(s, a), this.ctx.fill(), this.ctx.translate(-s, -a) }, r.prototype.renderBackgroundGradient = function (t, e) { if (t instanceof s) { var n = this.ctx.createLinearGradient(e.left + e.width * t.x0, e.top + e.height * t.y0, e.left + e.width * t.x1, e.top + e.height * t.y1); t.colorStops.forEach(function (t) { n.addColorStop(t.stop, t.color.toString()) }), this.rectangle(e.left, e.top, e.width, e.height, n) } }, r.prototype.resizeImage = function (t, e) { var n = t.image; if (n.width === e.width && n.height === e.height) return n; var r = document.createElement("canvas"); return r.width = e.width, r.height = e.height, r.getContext("2d").drawImage(n, 0, 0, n.width, n.height, 0, 0, e.width, e.height), r }, e.exports = r }, { "../lineargradientcontainer": 12, "../log": 13, "../renderer": 19 }], 21: [function (t, e, n) { function r(t, e, n, r) { i.call(this, n, r), this.ownStacking = t, this.contexts = [], this.children = [], this.opacity = (this.parent ? this.parent.stack.opacity : 1) * e } var i = t("./nodecontainer"); r.prototype = Object.create(i.prototype), r.prototype.getParentStack = function (t) { var e = this.parent ? this.parent.stack : null; return e ? e.ownStacking ? e : e.getParentStack(t) : t.stack }, e.exports = r }, { "./nodecontainer": 14 }], 22: [function (t, e, n) { function r(t) { this.rangeBounds = this.testRangeBounds(t), this.cors = this.testCORS(), this.svg = this.testSVG() } r.prototype.testRangeBounds = function (t) { var e, n, r = !1; return t.createRange && ((e = t.createRange()).getBoundingClientRect && ((n = t.createElement("boundtest")).style.height = "123px", n.style.display = "block", t.body.appendChild(n), e.selectNode(n), 123 === e.getBoundingClientRect().height && (r = !0), t.body.removeChild(n))), r }, r.prototype.testCORS = function () { return void 0 !== (new Image).crossOrigin }, r.prototype.testSVG = function () { var t = new Image, e = document.createElement("canvas"), n = e.getContext("2d"); t.src = "data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>"; try { n.drawImage(t, 0, 0), e.toDataURL() } catch (t) { return !1 } return !0 }, e.exports = r }, {}], 23: [function (t, e, n) { function r(t) { this.src = t, this.image = null; var e = this; this.promise = this.hasFabric().then(function () { return e.isInline(t) ? Promise.resolve(e.inlineFormatting(t)) : i(t) }).then(function (t) { return new Promise(function (n) { window.html2canvas.svg.fabric.loadSVGFromString(t, e.createCanvas.call(e, n)) }) }) } var i = t("./xhr"), o = t("./utils").decode64; r.prototype.hasFabric = function () { return window.html2canvas.svg && window.html2canvas.svg.fabric ? Promise.resolve() : Promise.reject(new Error("html2canvas.svg.js is not loaded, cannot render svg")) }, r.prototype.inlineFormatting = function (t) { return /^data:image\/svg\+xml;base64,/.test(t) ? this.decode64(this.removeContentType(t)) : this.removeContentType(t) }, r.prototype.removeContentType = function (t) { return t.replace(/^data:image\/svg\+xml(;base64)?,/, "") }, r.prototype.isInline = function (t) { return /^data:image\/svg\+xml/i.test(t) }, r.prototype.createCanvas = function (t) { var e = this; return function (n, r) { var i = new window.html2canvas.svg.fabric.StaticCanvas("c"); e.image = i.lowerCanvasEl, i.setWidth(r.width).setHeight(r.height).add(window.html2canvas.svg.fabric.util.groupSVGElements(n, r)).renderAll(), t(i.lowerCanvasEl) } }, r.prototype.decode64 = function (t) { return "function" == typeof window.atob ? window.atob(t) : o(t) }, e.exports = r }, { "./utils": 26, "./xhr": 28 }], 24: [function (t, e, n) { function r(t, e) { this.src = t, this.image = null; var n = this; this.promise = e ? new Promise(function (e, r) { n.image = new Image, n.image.onload = e, n.image.onerror = r, n.image.src = "data:image/svg+xml," + (new XMLSerializer).serializeToString(t), !0 === n.image.complete && e(n.image) }) : this.hasFabric().then(function () { return new Promise(function (e) { window.html2canvas.svg.fabric.parseSVGDocument(t, n.createCanvas.call(n, e)) }) }) } var i = t("./svgcontainer"); r.prototype = Object.create(i.prototype), e.exports = r }, { "./svgcontainer": 23 }], 25: [function (t, e, n) { function r(t, e) { o.call(this, t, e) } function i(t, e, n) { if (t.length > 0) return e + n.toUpperCase() } var o = t("./nodecontainer"); r.prototype = Object.create(o.prototype), r.prototype.applyTextTransform = function () { this.node.data = this.transform(this.parent.css("textTransform")) }, r.prototype.transform = function (t) { var e = this.node.data; switch (t) { case "lowercase": return e.toLowerCase(); case "capitalize": return e.replace(/(^|\s|:|-|\(|\))([a-z])/g, i); case "uppercase": return e.toUpperCase(); default: return e } }, e.exports = r }, { "./nodecontainer": 14 }], 26: [function (t, e, n) { n.smallImage = function () { return "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" }, n.bind = function (t, e) { return function () { return t.apply(e, arguments) } }, n.decode64 = function (t) { var e, n, r, i, o, s, a, c = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", l = t.length, u = ""; for (e = 0; e < l; e += 4)o = c.indexOf(t[e]) << 2 | (n = c.indexOf(t[e + 1])) >> 4, s = (15 & n) << 4 | (r = c.indexOf(t[e + 2])) >> 2, a = (3 & r) << 6 | (i = c.indexOf(t[e + 3])), u += 64 === r ? String.fromCharCode(o) : 64 === i || -1 === i ? String.fromCharCode(o, s) : String.fromCharCode(o, s, a); return u }, n.getBounds = function (t) { if (t.getBoundingClientRect) { var e = t.getBoundingClientRect(), n = null == t.offsetWidth ? e.width : t.offsetWidth; return { top: e.top, bottom: e.bottom || e.top + e.height, right: e.left + n, left: e.left, width: n, height: null == t.offsetHeight ? e.height : t.offsetHeight } } return {} }, n.offsetBounds = function (t) { var e = t.offsetParent ? n.offsetBounds(t.offsetParent) : { top: 0, left: 0 }; return { top: t.offsetTop + e.top, bottom: t.offsetTop + t.offsetHeight + e.top, right: t.offsetLeft + e.left + t.offsetWidth, left: t.offsetLeft + e.left, width: t.offsetWidth, height: t.offsetHeight } }, n.parseBackgrounds = function (t) { var e, n, r, i, o, s, a, c = [], l = 0, u = 0, h = function () { e && ('"' === n.substr(0, 1) && (n = n.substr(1, n.length - 2)), n && a.push(n), "-" === e.substr(0, 1) && (i = e.indexOf("-", 1) + 1) > 0 && (r = e.substr(0, i), e = e.substr(i)), c.push({ prefix: r, method: e.toLowerCase(), value: o, args: a, image: null })), a = [], e = r = n = o = "" }; return a = [], e = r = n = o = "", t.split("").forEach(function (t) { if (!(0 === l && " \r\n\t".indexOf(t) > -1)) { switch (t) { case '"': s ? s === t && (s = null) : s = t; break; case "(": if (s) break; if (0 === l) return l = 1, void (o += t); u++; break; case ")": if (s) break; if (1 === l) { if (0 === u) return l = 0, o += t, void h(); u-- } break; case ",": if (s) break; if (0 === l) return void h(); if (1 === l && 0 === u && !e.match(/^url$/i)) return a.push(n), n = "", void (o += t) }o += t, 0 === l ? e += t : n += t } }), h(), c } }, {}], 27: [function (t, e, n) { function r(t) { i.apply(this, arguments), this.type = "linear" === t.args[0] ? i.TYPES.LINEAR : i.TYPES.RADIAL } var i = t("./gradientcontainer"); r.prototype = Object.create(i.prototype), e.exports = r }, { "./gradientcontainer": 9 }], 28: [function (t, e, n) { e.exports = function (t) { return new Promise(function (e, n) { var r = new XMLHttpRequest; r.open("GET", t), r.onload = function () { 200 === r.status ? e(r.responseText) : n(new Error(r.statusText)) }, r.onerror = function () { n(new Error("Network Error")) }, r.send() }) } }, {}] }, {}, [4])(4) }), function (t) { var e; e = function () { function e(t) { var e, n, r, i, o, s, a, c, l, u, h, f, d, p; for (this.data = t, this.pos = 8, this.palette = [], this.imgData = [], this.transparency = {}, this.animation = null, this.text = {}, s = null; ;) { switch (e = this.readUInt32(), l = function () { var t, e; for (e = [], t = 0; t < 4; ++t)e.push(String.fromCharCode(this.data[this.pos++])); return e }.call(this).join("")) { case "IHDR": this.width = this.readUInt32(), this.height = this.readUInt32(), this.bits = this.data[this.pos++], this.colorType = this.data[this.pos++], this.compressionMethod = this.data[this.pos++], this.filterMethod = this.data[this.pos++], this.interlaceMethod = this.data[this.pos++]; break; case "acTL": this.animation = { numFrames: this.readUInt32(), numPlays: this.readUInt32() || 1 / 0, frames: [] }; break; case "PLTE": this.palette = this.read(e); break; case "fcTL": s && this.animation.frames.push(s), this.pos += 4, s = { width: this.readUInt32(), height: this.readUInt32(), xOffset: this.readUInt32(), yOffset: this.readUInt32() }, o = this.readUInt16(), i = this.readUInt16() || 100, s.delay = 1e3 * o / i, s.disposeOp = this.data[this.pos++], s.blendOp = this.data[this.pos++], s.data = []; break; case "IDAT": case "fdAT": for ("fdAT" === l && (this.pos += 4, e -= 4), t = (null != s ? s.data : void 0) || this.imgData, f = 0; 0 <= e ? f < e : f > e; 0 <= e ? ++f : --f)t.push(this.data[this.pos++]); break; case "tRNS": switch (this.transparency = {}, this.colorType) { case 3: if (r = this.palette.length / 3, this.transparency.indexed = this.read(e), this.transparency.indexed.length > r) throw new Error("More transparent colors than palette size"); if ((u = r - this.transparency.indexed.length) > 0) for (d = 0; 0 <= u ? d < u : d > u; 0 <= u ? ++d : --d)this.transparency.indexed.push(255); break; case 0: this.transparency.grayscale = this.read(e)[0]; break; case 2: this.transparency.rgb = this.read(e) }break; case "tEXt": a = (h = this.read(e)).indexOf(0), c = String.fromCharCode.apply(String, h.slice(0, a)), this.text[c] = String.fromCharCode.apply(String, h.slice(a + 1)); break; case "IEND": return s && this.animation.frames.push(s), this.colors = function () { switch (this.colorType) { case 0: case 3: case 4: return 1; case 2: case 6: return 3 } }.call(this), this.hasAlphaChannel = 4 === (p = this.colorType) || 6 === p, n = this.colors + (this.hasAlphaChannel ? 1 : 0), this.pixelBitlength = this.bits * n, this.colorSpace = function () { switch (this.colors) { case 1: return "DeviceGray"; case 3: return "DeviceRGB" } }.call(this), void (this.imgData = new Uint8Array(this.imgData)); default: this.pos += e }if (this.pos += 4, this.pos > this.data.length) throw new Error("Incomplete or corrupt PNG file") } } var n, r, i; e.load = function (t, n, r) { var i; return "function" == typeof n && (r = n), (i = new XMLHttpRequest).open("GET", t, !0), i.responseType = "arraybuffer", i.onload = function () { var t; return t = new e(new Uint8Array(i.response || i.mozResponseArrayBuffer)), "function" == typeof (null != n ? n.getContext : void 0) && t.render(n), "function" == typeof r ? r(t) : void 0 }, i.send(null) }, e.prototype.read = function (t) { var e, n; for (n = [], e = 0; 0 <= t ? e < t : e > t; 0 <= t ? ++e : --e)n.push(this.data[this.pos++]); return n }, e.prototype.readUInt32 = function () { return this.data[this.pos++] << 24 | this.data[this.pos++] << 16 | this.data[this.pos++] << 8 | this.data[this.pos++] }, e.prototype.readUInt16 = function () { return this.data[this.pos++] << 8 | this.data[this.pos++] }, e.prototype.decodePixels = function (t) { var e, n, r, i, o, s, a, l, u, h, f, d, p, g, m, w, y, v, b, x, k, _, C; if (null == t && (t = this.imgData), 0 === t.length) return new Uint8Array(0); for (t = (t = new c(t)).getBytes(), w = (d = this.pixelBitlength / 8) * this.width, p = new Uint8Array(w * this.height), s = t.length, m = 0, g = 0, n = 0; g < s;) { switch (t[g++]) { case 0: for (i = b = 0; b < w; i = b += 1)p[n++] = t[g++]; break; case 1: for (i = x = 0; x < w; i = x += 1)e = t[g++], o = i < d ? 0 : p[n - d], p[n++] = (e + o) % 256; break; case 2: for (i = k = 0; k < w; i = k += 1)e = t[g++], r = (i - i % d) / d, y = m && p[(m - 1) * w + r * d + i % d], p[n++] = (y + e) % 256; break; case 3: for (i = _ = 0; _ < w; i = _ += 1)e = t[g++], r = (i - i % d) / d, o = i < d ? 0 : p[n - d], y = m && p[(m - 1) * w + r * d + i % d], p[n++] = (e + Math.floor((o + y) / 2)) % 256; break; case 4: for (i = C = 0; C < w; i = C += 1)e = t[g++], r = (i - i % d) / d, o = i < d ? 0 : p[n - d], 0 === m ? y = v = 0 : (y = p[(m - 1) * w + r * d + i % d], v = r && p[(m - 1) * w + (r - 1) * d + i % d]), a = o + y - v, l = Math.abs(a - o), h = Math.abs(a - y), f = Math.abs(a - v), u = l <= h && l <= f ? o : h <= f ? y : v, p[n++] = (e + u) % 256; break; default: throw new Error("Invalid filter algorithm: " + t[g - 1]) }m++ } return p }, e.prototype.decodePalette = function () { var t, e, n, r, i, o, s, a, c; for (n = this.palette, o = this.transparency.indexed || [], i = new Uint8Array((o.length || 0) + n.length), r = 0, n.length, t = 0, e = s = 0, a = n.length; s < a; e = s += 3)i[r++] = n[e], i[r++] = n[e + 1], i[r++] = n[e + 2], i[r++] = null != (c = o[t++]) ? c : 255; return i }, e.prototype.copyToImageData = function (t, e) { var n, r, i, o, s, a, c, l, u, h, f; if (r = this.colors, u = null, n = this.hasAlphaChannel, this.palette.length && (u = null != (f = this._decodedPalette) ? f : this._decodedPalette = this.decodePalette(), r = 4, n = !0), l = (i = t.data || t).length, s = u || e, o = a = 0, 1 === r) for (; o < l;)c = u ? 4 * e[o / 4] : a, h = s[c++], i[o++] = h, i[o++] = h, i[o++] = h, i[o++] = n ? s[c++] : 255, a = c; else for (; o < l;)c = u ? 4 * e[o / 4] : a, i[o++] = s[c++], i[o++] = s[c++], i[o++] = s[c++], i[o++] = n ? s[c++] : 255, a = c }, e.prototype.decode = function () { var t; return t = new Uint8Array(this.width * this.height * 4), this.copyToImageData(t, this.decodePixels()), t }; try { r = t.document.createElement("canvas"), i = r.getContext("2d") } catch (t) { return -1 } return n = function (t) { var e; return i.width = t.width, i.height = t.height, i.clearRect(0, 0, t.width, t.height), i.putImageData(t, 0, 0), (e = new Image).src = r.toDataURL(), e }, e.prototype.decodeFrames = function (t) { var e, r, i, o, s, a, c, l; if (this.animation) { for (l = [], r = s = 0, a = (c = this.animation.frames).length; s < a; r = ++s)e = c[r], i = t.createImageData(e.width, e.height), o = this.decodePixels(new Uint8Array(e.data)), this.copyToImageData(i, o), e.imageData = i, l.push(e.image = n(i)); return l } }, e.prototype.renderFrame = function (t, e) { var n, r, i; return n = (r = this.animation.frames)[e], i = r[e - 1], 0 === e && t.clearRect(0, 0, this.width, this.height), 1 === (null != i ? i.disposeOp : void 0) ? t.clearRect(i.xOffset, i.yOffset, i.width, i.height) : 2 === (null != i ? i.disposeOp : void 0) && t.putImageData(i.imageData, i.xOffset, i.yOffset), 0 === n.blendOp && t.clearRect(n.xOffset, n.yOffset, n.width, n.height), t.drawImage(n.image, n.xOffset, n.yOffset) }, e.prototype.animate = function (t) { var e, n, r, i, o, s, a = this; return n = 0, s = this.animation, i = s.numFrames, r = s.frames, o = s.numPlays, (e = function () { var s, c; if (s = n++ % i, c = r[s], a.renderFrame(t, s), i > 1 && n / i < o) return a.animation._timeout = setTimeout(e, c.delay) })() }, e.prototype.stopAnimation = function () { var t; return clearTimeout(null != (t = this.animation) ? t._timeout : void 0) }, e.prototype.render = function (t) { var e, n; return t._png && t._png.stopAnimation(), t._png = this, t.width = this.width, t.height = this.height, e = t.getContext("2d"), this.animation ? (this.decodeFrames(e), this.animate(e)) : (n = e.createImageData(this.width, this.height), this.copyToImageData(n, this.decodePixels()), e.putImageData(n, 0, 0)) }, e }(), t.PNG = e }("undefined" != typeof window && window || void 0); var a = function () { function t() { this.pos = 0, this.bufferLength = 0, this.eof = !1, this.buffer = null } return t.prototype = { ensureBuffer: function (t) { var e = this.buffer, n = e ? e.byteLength : 0; if (t < n) return e; for (var r = 512; r < t;)r <<= 1; for (var i = new Uint8Array(r), o = 0; o < n; ++o)i[o] = e[o]; return this.buffer = i }, getByte: function () { for (var t = this.pos; this.bufferLength <= t;) { if (this.eof) return null; this.readBlock() } return this.buffer[this.pos++] }, getBytes: function (t) { var e = this.pos; if (t) { this.ensureBuffer(e + t); for (var n = e + t; !this.eof && this.bufferLength < n;)this.readBlock(); var r = this.bufferLength; n > r && (n = r) } else { for (; !this.eof;)this.readBlock(); n = this.bufferLength } return this.pos = n, this.buffer.subarray(e, n) }, lookChar: function () { for (var t = this.pos; this.bufferLength <= t;) { if (this.eof) return null; this.readBlock() } return String.fromCharCode(this.buffer[this.pos]) }, getChar: function () { for (var t = this.pos; this.bufferLength <= t;) { if (this.eof) return null; this.readBlock() } return String.fromCharCode(this.buffer[this.pos++]) }, makeSubStream: function (t, e, n) { for (var r = t + e; this.bufferLength <= r && !this.eof;)this.readBlock(); return new Stream(this.buffer, t, e, n) }, skip: function (t) { t || (t = 1), this.pos += t }, reset: function () { this.pos = 0 } }, t }(), c = function () { function t(t) { throw new Error(t) } function e(e) { var n = 0, r = e[n++], i = e[n++]; -1 != r && -1 != i || t("Invalid header in flate stream"), 8 != (15 & r) && t("Unknown compression method in flate stream"), ((r << 8) + i) % 31 != 0 && t("Bad FCHECK in flate stream"), 32 & i && t("FDICT bit set in flate stream"), this.bytes = e, this.bytesPos = 2, this.codeSize = 0, this.codeBuf = 0, a.call(this) } if ("undefined" != typeof Uint32Array) { var n = new Uint32Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), r = new Uint32Array([3, 4, 5, 6, 7, 8, 9, 10, 65547, 65549, 65551, 65553, 131091, 131095, 131099, 131103, 196643, 196651, 196659, 196667, 262211, 262227, 262243, 262259, 327811, 327843, 327875, 327907, 258, 258, 258]), i = new Uint32Array([1, 2, 3, 4, 65541, 65543, 131081, 131085, 196625, 196633, 262177, 262193, 327745, 327777, 393345, 393409, 459009, 459137, 524801, 525057, 590849, 591361, 657409, 658433, 724993, 727041, 794625, 798721, 868353, 876545]), o = [new Uint32Array([459008, 524368, 524304, 524568, 459024, 524400, 524336, 590016, 459016, 524384, 524320, 589984, 524288, 524416, 524352, 590048, 459012, 524376, 524312, 589968, 459028, 524408, 524344, 590032, 459020, 524392, 524328, 59e4, 524296, 524424, 524360, 590064, 459010, 524372, 524308, 524572, 459026, 524404, 524340, 590024, 459018, 524388, 524324, 589992, 524292, 524420, 524356, 590056, 459014, 524380, 524316, 589976, 459030, 524412, 524348, 590040, 459022, 524396, 524332, 590008, 524300, 524428, 524364, 590072, 459009, 524370, 524306, 524570, 459025, 524402, 524338, 590020, 459017, 524386, 524322, 589988, 524290, 524418, 524354, 590052, 459013, 524378, 524314, 589972, 459029, 524410, 524346, 590036, 459021, 524394, 524330, 590004, 524298, 524426, 524362, 590068, 459011, 524374, 524310, 524574, 459027, 524406, 524342, 590028, 459019, 524390, 524326, 589996, 524294, 524422, 524358, 590060, 459015, 524382, 524318, 589980, 459031, 524414, 524350, 590044, 459023, 524398, 524334, 590012, 524302, 524430, 524366, 590076, 459008, 524369, 524305, 524569, 459024, 524401, 524337, 590018, 459016, 524385, 524321, 589986, 524289, 524417, 524353, 590050, 459012, 524377, 524313, 589970, 459028, 524409, 524345, 590034, 459020, 524393, 524329, 590002, 524297, 524425, 524361, 590066, 459010, 524373, 524309, 524573, 459026, 524405, 524341, 590026, 459018, 524389, 524325, 589994, 524293, 524421, 524357, 590058, 459014, 524381, 524317, 589978, 459030, 524413, 524349, 590042, 459022, 524397, 524333, 590010, 524301, 524429, 524365, 590074, 459009, 524371, 524307, 524571, 459025, 524403, 524339, 590022, 459017, 524387, 524323, 589990, 524291, 524419, 524355, 590054, 459013, 524379, 524315, 589974, 459029, 524411, 524347, 590038, 459021, 524395, 524331, 590006, 524299, 524427, 524363, 590070, 459011, 524375, 524311, 524575, 459027, 524407, 524343, 590030, 459019, 524391, 524327, 589998, 524295, 524423, 524359, 590062, 459015, 524383, 524319, 589982, 459031, 524415, 524351, 590046, 459023, 524399, 524335, 590014, 524303, 524431, 524367, 590078, 459008, 524368, 524304, 524568, 459024, 524400, 524336, 590017, 459016, 524384, 524320, 589985, 524288, 524416, 524352, 590049, 459012, 524376, 524312, 589969, 459028, 524408, 524344, 590033, 459020, 524392, 524328, 590001, 524296, 524424, 524360, 590065, 459010, 524372, 524308, 524572, 459026, 524404, 524340, 590025, 459018, 524388, 524324, 589993, 524292, 524420, 524356, 590057, 459014, 524380, 524316, 589977, 459030, 524412, 524348, 590041, 459022, 524396, 524332, 590009, 524300, 524428, 524364, 590073, 459009, 524370, 524306, 524570, 459025, 524402, 524338, 590021, 459017, 524386, 524322, 589989, 524290, 524418, 524354, 590053, 459013, 524378, 524314, 589973, 459029, 524410, 524346, 590037, 459021, 524394, 524330, 590005, 524298, 524426, 524362, 590069, 459011, 524374, 524310, 524574, 459027, 524406, 524342, 590029, 459019, 524390, 524326, 589997, 524294, 524422, 524358, 590061, 459015, 524382, 524318, 589981, 459031, 524414, 524350, 590045, 459023, 524398, 524334, 590013, 524302, 524430, 524366, 590077, 459008, 524369, 524305, 524569, 459024, 524401, 524337, 590019, 459016, 524385, 524321, 589987, 524289, 524417, 524353, 590051, 459012, 524377, 524313, 589971, 459028, 524409, 524345, 590035, 459020, 524393, 524329, 590003, 524297, 524425, 524361, 590067, 459010, 524373, 524309, 524573, 459026, 524405, 524341, 590027, 459018, 524389, 524325, 589995, 524293, 524421, 524357, 590059, 459014, 524381, 524317, 589979, 459030, 524413, 524349, 590043, 459022, 524397, 524333, 590011, 524301, 524429, 524365, 590075, 459009, 524371, 524307, 524571, 459025, 524403, 524339, 590023, 459017, 524387, 524323, 589991, 524291, 524419, 524355, 590055, 459013, 524379, 524315, 589975, 459029, 524411, 524347, 590039, 459021, 524395, 524331, 590007, 524299, 524427, 524363, 590071, 459011, 524375, 524311, 524575, 459027, 524407, 524343, 590031, 459019, 524391, 524327, 589999, 524295, 524423, 524359, 590063, 459015, 524383, 524319, 589983, 459031, 524415, 524351, 590047, 459023, 524399, 524335, 590015, 524303, 524431, 524367, 590079]), 9], s = [new Uint32Array([327680, 327696, 327688, 327704, 327684, 327700, 327692, 327708, 327682, 327698, 327690, 327706, 327686, 327702, 327694, 0, 327681, 327697, 327689, 327705, 327685, 327701, 327693, 327709, 327683, 327699, 327691, 327707, 327687, 327703, 327695, 0]), 5]; return e.prototype = Object.create(a.prototype), e.prototype.getBits = function (e) { for (var n, r = this.codeSize, i = this.codeBuf, o = this.bytes, s = this.bytesPos; r < e;)void 0 === (n = o[s++]) && t("Bad encoding in flate stream"), i |= n << r, r += 8; return n = i & (1 << e) - 1, this.codeBuf = i >> e, this.codeSize = r -= e, this.bytesPos = s, n }, e.prototype.getCode = function (e) { for (var n = e[0], r = e[1], i = this.codeSize, o = this.codeBuf, s = this.bytes, a = this.bytesPos; i < r;) { var c; void 0 === (c = s[a++]) && t("Bad encoding in flate stream"), o |= c << i, i += 8 } var l = n[o & (1 << r) - 1], u = l >> 16, h = 65535 & l; return (0 == i || i < u || 0 == u) && t("Bad encoding in flate stream"), this.codeBuf = o >> u, this.codeSize = i - u, this.bytesPos = a, h }, e.prototype.generateHuffmanTable = function (t) { for (var e = t.length, n = 0, r = 0; r < e; ++r)t[r] > n && (n = t[r]); for (var i = 1 << n, o = new Uint32Array(i), s = 1, a = 0, c = 2; s <= n; ++s, a <<= 1, c <<= 1)for (var l = 0; l < e; ++l)if (t[l] == s) { var u = 0, h = a; for (r = 0; r < s; ++r)u = u << 1 | 1 & h, h >>= 1; for (r = u; r < i; r += c)o[r] = s << 16 | l; ++a } return [o, n] }, e.prototype.readBlock = function () { function e(t, e, n, r, i) { for (var o = t.getBits(n) + r; o-- > 0;)e[p++] = i } var a = this.getBits(3); if (1 & a && (this.eof = !0), 0 != (a >>= 1)) { var c, l; if (1 == a) c = o, l = s; else if (2 == a) { for (var u = this.getBits(5) + 257, h = this.getBits(5) + 1, f = this.getBits(4) + 4, d = Array(n.length), p = 0; p < f;)d[n[p++]] = this.getBits(3); for (var g = this.generateHuffmanTable(d), m = 0, w = (p = 0, u + h), y = new Array(w); p < w;) { var v = this.getCode(g); 16 == v ? e(this, y, 2, 3, m) : 17 == v ? e(this, y, 3, 3, m = 0) : 18 == v ? e(this, y, 7, 11, m = 0) : y[p++] = m = v } c = this.generateHuffmanTable(y.slice(0, u)), l = this.generateHuffmanTable(y.slice(u, w)) } else t("Unknown block type in flate stream"); for (var b = (O = this.buffer) ? O.length : 0, x = this.bufferLength; ;) { var k = this.getCode(c); if (k < 256) x + 1 >= b && (b = (O = this.ensureBuffer(x + 1)).length), O[x++] = k; else { if (256 == k) return void (this.bufferLength = x); var _ = (k = r[k -= 257]) >> 16; _ > 0 && (_ = this.getBits(_)); m = (65535 & k) + _; k = this.getCode(l), (_ = (k = i[k]) >> 16) > 0 && (_ = this.getBits(_)); var C = (65535 & k) + _; x + m >= b && (b = (O = this.ensureBuffer(x + m)).length); for (var A = 0; A < m; ++A, ++x)O[x] = O[x - C] } } } else { var S, q = this.bytes, T = this.bytesPos; void 0 === (S = q[T++]) && t("Bad block header in flate stream"); var I = S; void 0 === (S = q[T++]) && t("Bad block header in flate stream"), I |= S << 8, void 0 === (S = q[T++]) && t("Bad block header in flate stream"); var P = S; void 0 === (S = q[T++]) && t("Bad block header in flate stream"), (P |= S << 8) != (65535 & ~I) && t("Bad uncompressed block length in flate stream"), this.codeBuf = 0, this.codeSize = 0; var E = this.bufferLength, O = this.ensureBuffer(E + I), F = E + I; this.bufferLength = F; for (var R = E; R < F; ++R) { if (void 0 === (S = q[T++])) { this.eof = !0; break } O[R] = S } this.bytesPos = T } }, e } }(); return function (t) { var e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; void 0 === t.btoa && (t.btoa = function (t) { var n, r, i, o, s, a = 0, c = 0, l = "", u = []; if (!t) return t; do { n = (s = t.charCodeAt(a++) << 16 | t.charCodeAt(a++) << 8 | t.charCodeAt(a++)) >> 18 & 63, r = s >> 12 & 63, i = s >> 6 & 63, o = 63 & s, u[c++] = e.charAt(n) + e.charAt(r) + e.charAt(i) + e.charAt(o) } while (a < t.length); l = u.join(""); var h = t.length % 3; return (h ? l.slice(0, h - 3) : l) + "===".slice(h || 3) }), void 0 === t.atob && (t.atob = function (t) { var n, r, i, o, s, a, c = 0, l = 0, u = []; if (!t) return t; t += ""; do { n = (a = e.indexOf(t.charAt(c++)) << 18 | e.indexOf(t.charAt(c++)) << 12 | (o = e.indexOf(t.charAt(c++))) << 6 | (s = e.indexOf(t.charAt(c++)))) >> 16 & 255, r = a >> 8 & 255, i = 255 & a, u[l++] = 64 == o ? String.fromCharCode(n) : 64 == s ? String.fromCharCode(n, r) : String.fromCharCode(n, r, i) } while (c < t.length); return u.join("") }), Array.prototype.map || (Array.prototype.map = function (t) { if (null == this || "function" != typeof t) throw new TypeError; for (var e = Object(this), n = e.length >>> 0, r = new Array(n), i = arguments.length > 1 ? arguments[1] : void 0, o = 0; o < n; o++)o in e && (r[o] = t.call(i, e[o], o, e)); return r }), Array.isArray || (Array.isArray = function (t) { return "[object Array]" === Object.prototype.toString.call(t) }), Array.prototype.forEach || (Array.prototype.forEach = function (t, e) { if (null == this || "function" != typeof t) throw new TypeError; for (var n = Object(this), r = n.length >>> 0, i = 0; i < r; i++)i in n && t.call(e, n[i], i, n) }), Object.keys || (Object.keys = function () { var t = Object.prototype.hasOwnProperty, e = !{ toString: null }.propertyIsEnumerable("toString"), n = ["toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor"], r = n.length; return function (i) { if ("object" != typeof i && ("function" != typeof i || null === i)) throw new TypeError; var o, s, a = []; for (o in i) t.call(i, o) && a.push(o); if (e) for (s = 0; s < r; s++)t.call(i, n[s]) && a.push(n[s]); return a } }()), String.prototype.trim || (String.prototype.trim = function () { return this.replace(/^\s+|\s+$/g, "") }), String.prototype.trimLeft || (String.prototype.trimLeft = function () { return this.replace(/^\s+/g, "") }), String.prototype.trimRight || (String.prototype.trimRight = function () { return this.replace(/\s+$/g, "") }) }("undefined" != typeof self && self || "undefined" != typeof window && window || void 0), e });;
"use strict";

AccessConsciousness.appModule.factory("locationService", [
    "$http", "$q",
    function ($http, $q) {
        var getCountries = function () {
            var deferred = $q.defer();
            $http.post("/Location/GetCountries")
                .success(function (response) {
                    deferred.resolve(response.countries);
                });
            return deferred.promise;
        },

            getCountriesWithPaymentCompanies = function() {
                var deferred = $q.defer();
                $http.get("/Location/GetCountriesWithPaymentCompanies")
                    .success(function (response) {
                        deferred.resolve(response.countries);
                    });
                return deferred.promise;
            },

            getStatesForCountry = function (countryId) {
                var deferred = $q.defer();
                $http.post("/Location/GetStatesForCountry", { countryId: countryId })
                    .success(function (response) {
                        deferred.resolve(response.states);
                    });
                return deferred.promise;
            },
            getLanguages = function () {
                var deferred = $q.defer();
                $http.post("/Location/GetLanguages")
                    .success(function (response) {
                        deferred.resolve(response.languages);
                    });
                return deferred.promise;
            },
            getTimeZones = function () {
                var deferred = $q.defer();
                $http.post("/Location/GetTimeZones")
                    .success(function (response) {
                        deferred.resolve(response.timeZones);
                    });
                return deferred.promise;
            }
        return {
            getCountries: getCountries,
            getCountriesWithPaymentCompanies: getCountriesWithPaymentCompanies,
            getStatesForCountry: getStatesForCountry,
            getLanguages: getLanguages,
            getTimeZones: getTimeZones
        };
    }
]);;
"use strict";

AccessConsciousness.appModule.factory("priceService", [
    "$http", "$q",
    function ($http, $q) {
    	var convertListPriceToCurrency = function (classOccurrenceId, amount, fromCurrency, toCurrency) {
    		var deferred = $q.defer();
    		$http.post("/Price/ChangeClassCurrency", { classOccurrenceId: classOccurrenceId, price: amount, fromCurrency: fromCurrency, toCurrency: toCurrency})
			    .success(function (response) {
			    	deferred.resolve(response);
			    });
    		return deferred.promise;
    	};
    	return {
    		convertListPriceToCurrency: convertListPriceToCurrency
    	};
    }
]);;
"use strict";

AccessConsciousness.appModule.factory("reCaptchaService", [
    "$http", "$q",
    function ($http, $q) {
        var validateRecaptcha = function (token) {
                var deferred = $q.defer();
                $http.post("/Recaptcha/ValidateRecaptcha", {
                    token: token
                }).success(function (data) {
                    deferred.resolve(data);
                });
                return deferred.promise;
            }
            
        return {
            validateRecaptcha: validateRecaptcha
        };
    }
]);;
"use strict";

AccessConsciousness.getYearsForDropdown = function () {
    var years = [];
    var currentDate = new Date();
    for (var i = currentDate.getFullYear(); i > currentDate.getFullYear() - 100; i--)
        years.push(i);
    return years;
}

AccessConsciousness.getCreditCardYearsForDropdown = function() {
    var years = [];
    var currentDate = new Date();
    for (var i = currentDate.getFullYear() ; i < currentDate.getFullYear() + 11; i++)
        years.push(i);
    return years;
}

AccessConsciousness.getDaysForDropdown = function () {
    var days = [];
    for (var i = 1 ; i<=31; i++)
        days.push(i);
    return days;
}

AccessConsciousness.getMonthsForDropdown = function () {
    var months = [];
    for (var i = 1 ; i <= 12; i++)
        months.push(i);
    return months;
};
"use strict";

AccessConsciousness.appModule.controller("dependentsController", [
    "$scope", "dependentsService", "createAccountService",
    function ($scope, dependentsService, createAccountService) {

        $scope.years = AccessConsciousness.getYearsForDropdown();
        $scope.days = AccessConsciousness.getDaysForDropdown();
        $scope.months = AccessConsciousness.getMonthsForDropdown();
        $scope.dependentModel = {};
        $scope.birthdate = {};
        $scope.saving = false;
        $scope.emailLocal = "";
        $scope.emailSuggestion = "";
        $scope.hasSuggestion = false;
        $scope.emailChanged = true;
        $scope.source = $("#accountCreationSource").val();

        var emailInput = $('#email');

        $scope.correctEmail = function () {
            if ($scope.hasSuggestion) {
                $scope.dependentModel.Email = `${$scope.emailLocal}@${$scope.emailSuggestion}`;
                $scope.emailSuggestion = "";
                $scope.emailLocal = "";
                $scope.hasSuggestion = false;
                $scope.emailChanged = true;
                sendVerificationRequest();
            }
        }

        var sendVerificationRequest = function () {
            if ($scope.emailChanged) {
                createAccountService.verifyEmail($scope.customer.Email, $scope.source).then((data) => {
                    if (data.IsSuccess) {
                        $scope.dependentModel.Validity = data.Validity;
                        $scope.emailSuggestion = data.SuggestionPart;
                        $scope.emailLocal = data.LocalPart;
                        $scope.hasSuggestion = !!$scope.emailSuggestion && !!$scope.emailLocal;
                        $scope.errorMessageForRelease = data.ErrorMessage
                    } else {
                        $scope.validity = "Invalid";
                    }
                });
                $scope.emailChanged = false;
            }
        }

        var setIsUnder16FieldForDependent = function (dependent) {
            var currentDate = new Date();
            var birthdate = new Date(dependent.BirthdateYear,
                dependent.BirthdateMonth - 1,
                dependent.BirthdateDay);
            birthdate.setYear(birthdate.getFullYear() + 16);
            if (birthdate < currentDate) {
                dependent.isUnder16 = false;
            } else {
                dependent.isUnder16 = true;
            }
        }

        var setIsUnder16FieldForAll = function () {
            for (var i = 0; i < $scope.dependents.length; i++) {
                setIsUnder16FieldForDependent($scope.dependents[i]);
            }
        };

        var loadDependents = function () {
            dependentsService.loadDependents().then(function (dependents) {
                $scope.dependents = dependents;
                setIsUnder16FieldForAll();
            });
        };
        loadDependents();

        var editDependent = function (dependentModel) {
            $scope.saving = true;
            dependentsService.editDependent(dependentModel).then(function (response) {
                $scope.saving = false;
                if (response.success) {
                    for (var i = 0; i < $scope.dependents.length; i++) {
                        if ($scope.dependents[i].NetSuiteId == response.dependent.NetSuiteId) {
                            $scope.dependents[i] = response.dependent;
                            setIsUnder16FieldForDependent($scope.dependents[i]);
                        }
                    }
                    $scope.isEditMode = false;
                    $('#addDependent').modal('hide');
                    $scope.dependentModel = {};
                    $scope.birthdate = {};
                    $scope.dependentForm.$setPristine();
                } else {
                    $scope.errorMessage = response.message;
                }
            });
        };

        var isModelValid = function (model) {
            if (model.Password !== model.ConfirmPassword) {
                $scope.errorMessageForRelease = passwordsDoNotMatchErrorMessage;
                return false;
            }
            if (model.Password.length < 4) {
                $scope.errorMessageForRelease = passwordPatternErrorMessage;
                return false;
            }
            
            return true;
        };

        var addNewDependent = function (dependentModel) {
            $scope.saving = true;
            dependentsService.saveDependent(dependentModel).then(function (response) {
                $scope.saving = false;
                if (response.success) {
                    setIsUnder16FieldForDependent(response.dependent);
                    $scope.dependents.push(response.dependent);
                    $('#addDependent').modal('hide');
                    $scope.dependentModel = {};
                    $scope.birthdate = {};
                    $scope.dependentForm.$setPristine();
                } else {
                    $scope.errorMessage = response.message;
                }
            });
        };

        var localToUtc = function (dateToConvert) {
            if (!dateToConvert)
                return dateToConvert;
            var convertedDate = angular.copy(dateToConvert);

            var timezeoneOffset = convertedDate.getTimezoneOffset();
            convertedDate.setMinutes(convertedDate.getMinutes() - timezeoneOffset);
            return convertedDate;
        };

        $scope.saveDependent = function (dependentModel) {
            var birthday = new Date($scope.birthdate.Year, $scope.birthdate.Month - 1, $scope.birthdate.Day);
            dependentModel.Birthdate = localToUtc(birthday);
            if (!$scope.isEditMode) {
                addNewDependent(dependentModel);
            } else {
                editDependent(dependentModel);
            }
        };

        $scope.releaseDependent = function (dependentModel) {
            if (isModelValid(dependentModel)) {
                $scope.saving = true;
                dependentsService.releaseDependent(dependentModel).then(function (response) {
                    $scope.saving = false;
                    if (response.success) {
                        for (var i = $scope.dependents.length - 1; i >= 0 ; i--) {
                            if ($scope.dependents[i].NetSuiteId === response.dependent.NetSuiteId) {
                                $scope.dependents.splice(i, 1);
                            }
                        }
                        $('#releaseDependent').modal('hide');
                        loadDependents();
                        $scope.dependentModel = {};
                        $scope.birthdate = {};
                        $scope.dependentForm.$setPristine();
                    } else {
                        $scope.errorMessageForRelease = response.message;
                    }
                });
            }
        };

        $scope.populateForEdit = function (dependent) {
            $scope.isEditMode = true;
            $scope.dependentModel.FirstName = dependent.FirstName;
            $scope.dependentModel.LastName = dependent.LastName;
            $scope.dependentModel.Relationship = dependent.Relationship;
            $scope.dependentModel.RelationshipName = dependent.RelationshipName;
            $scope.dependentModel.NetSuiteId = dependent.NetSuiteId;
            $scope.birthdate.Day = dependent.BirthdateDay;
            $scope.birthdate.Month = dependent.BirthdateMonth;
            $scope.birthdate.Year = dependent.BirthdateYear;
            $scope.errorMessage = "";
            $('#addDependent').modal();
        };

        $scope.showModalDialogForAdd = function () {
            $scope.dependentModel = {};
            $scope.birthdate = {};
            $scope.dependentForm.$setPristine();
            $scope.dependentForm.$setUntouched();
            $scope.isEditMode = false;
            $scope.errorMessage = "";
            $('#addDependent').modal();
        };

        $scope.showModalDialogForRelease = function (dependent) {
            $scope.dependentModel.NetSuiteId = dependent.NetSuiteId;
            $('#releaseDependent').modal();
        };

        emailInput.on('blur', sendVerificationRequest);
    }
]);;
"use strict";

AccessConsciousness.appModule.factory("dependentsService", [
    "$http", "$q",
    function ($http, $q) {
        var loadDependents = function () {
            var deferred = $q.defer();
            $http.post("/DependentsBlock/LoadDependents")
                .success(function (data) {
                    deferred.resolve(data.dependents);
                });
            return deferred.promise;
        },
            saveDependent = function (dependentModel) {
                var deferred = $q.defer();
                $http.post("/DependentsBlock/SaveDependent", { dependent: dependentModel })
                    .success(function (data) {
                        deferred.resolve(data);
                    });
                return deferred.promise;
            },
            editDependent = function (dependentModel) {
                var deferred = $q.defer();
                $http.post("/DependentsBlock/EditDependent", { dependent: dependentModel })
                    .success(function (data) {
                        deferred.resolve(data);
                    });
                return deferred.promise;
            },
            releaseDependent = function (dependentModel) {
                var deferred = $q.defer();
                $http.post("/DependentsBlock/ReleaseDependent", { dependent: dependentModel })
                    .success(function (data) {
                        deferred.resolve(data);
                    });
                return deferred.promise;
            };
        return {
            loadDependents: loadDependents,
            saveDependent: saveDependent,
            editDependent: editDependent,
            releaseDependent: releaseDependent
        };
    }
]);
"use strict";

AccessConsciousness.appModule.controller("emailPreferencesController", [
    "$scope", "emailPreferencesService",
    function ($scope, emailPreferencesService) {
        $scope.userEmailPreferences = {};
        var loadEmailOfferings = function () {
            emailPreferencesService.loadEmailOfferings().then(function (results) {
                $scope.emailPreferences = {
                    adhocEmailsOptOut: results.userEmailPreferences.AdhocEmailsOptOut,
                    accessNewsletterOptOut: results.userEmailPreferences.AccessNewsletterOptOut,
                    removeFromAllEmailsOptOut: results.userEmailPreferences.RemoveFromAllEmailsOptOut,
                    tourOfConsciousness: results.userEmailPreferences.TourOfConsciousness,
                    bycwBookclub: results.userEmailPreferences.BYCWBookclub
                };

                $scope.emailOfferings = results.userEmailPreferences.EmailOfferings;
                $scope.emailPreferences.selectedEmails = results.selectedEmails;
                $scope.selectedEmailsOriginal = angular.copy($scope.emailPreferences.selectedEmails); // for determining changed items

                // Group the emails into rows of N items per row/group...
                var itemsPerGroup = 2;
                $scope.emailOfferingsGrouped = [];
                for (var i = 0; i < $scope.emailOfferings.length; i += itemsPerGroup) {
                    $scope.emailOfferingsGrouped.push($scope.emailOfferings.slice(i, i + itemsPerGroup));
                }
            });
        };

        var saveUserEmailPreferences = function () {
            $scope.errorMessage = "";
            emailPreferencesService.saveUserEmailPreferences($scope.emailOfferings, $scope.emailPreferences).then(function (response) {
                if (!response.success) {
                    $scope.errorMessage = response.errorMessage;
                } else {
                    $scope.showSuccess = true;
                }
                $scope.isLoadingEnabled = false;
                //alert('saved!');
            });
        };

        loadEmailOfferings();

        $scope.checkAll = function () {
            $scope.emailPreferences.selectedEmails = $scope.emailOfferings.map(function (item) { return item.Name; });
        };
        $scope.uncheckAll = function () {
            $scope.emailPreferences.selectedEmails = [];
        };
        $scope.saveUserEmailPreferences = function () {
            // check to see if any offerings were unselected...
            $scope.unselectedEmails = [];
            var unselectedEmailIds = [];
            angular.forEach($scope.selectedEmailsOriginal, function (value) {
                if ($scope.emailPreferences.selectedEmails.indexOf(value) === -1)
                    this.push(value);
            }, unselectedEmailIds);

            // get the description for each unselected email
            angular.forEach(unselectedEmailIds, function (value) {
                angular.forEach($scope.emailOfferings, function (offering) {
                    if (offering.Name === value)
                        this.push(offering.Description);
                }, $scope.unselectedEmails);
            });

            // if any emails have been unselected, show a confirmation dialog...
            if ($scope.unselectedEmails.length > 0)
                $scope.showConfirmationDialog();
            else
                saveUserEmailPreferences();
        };
        $scope.showConfirmationDialog = function () {
            $('#emailPreferencesConfirmModal').modal();
        };
        $scope.savePreferencesConfirmed = function () {
            $('#emailPreferencesConfirmModal').modal('hide');
            saveUserEmailPreferences();
        };
    }
]);;
"use strict";

AccessConsciousness.appModule.factory("emailPreferencesService", [
    "$http", "$q",
    function ($http, $q) {
        var loadEmailOfferings = function () {
            var deferred = $q.defer();
            $http.post("/EmailPreferencesBlock/LoadUserEmailOfferings")
            .success(function (data) {
                // Split up the returned data into two arrays:
                //    * data.userEmailOfferings - list of all email offerings (already returned from HTTP call)
                //    * data.selectedEmails - list of selected email offering names
                var selectedEmailOfferings = data.userEmailPreferences.EmailOfferings.filter(function (item) { return (item.Value === true); });
                var selectedEmailOfferingNames = selectedEmailOfferings.map(function(item) { return item.Name; });
                data.selectedEmails = selectedEmailOfferingNames;
                deferred.resolve(data);
            });
            return deferred.promise;
        },

        saveUserEmailPreferences = function (emailOfferings, emailPreferences) {
            // Combine the emailOfferings and selectedEmails arrays back into a single array (emailOfferings) for postback
            for (var i = 0; i < emailOfferings.length; i++) {
                emailOfferings[i].Value = (emailPreferences.selectedEmails.indexOf(emailOfferings[i].Name) > -1);
            }
            emailPreferences.EmailOfferings = emailOfferings;
            var deferred = $q.defer();
            $http.post("/EmailPreferencesBlock/SaveUserEmailPreferences", { userEmailPreferences: emailPreferences })
            .success(function (data) {
                deferred.resolve(data);
            });
            return deferred.promise;
        };

        return {
            loadEmailOfferings: loadEmailOfferings,
            saveUserEmailPreferences: saveUserEmailPreferences,
        };
    }
]);
"use strict";

AccessConsciousness.appModule.controller("upcomingClassesController", [
    "$scope", "$sce", "upcomingClassesService",
    function ($scope, $sce, upcomingClassesService) {
        $scope.prerequisitesClasses = [];
        $scope.noPrerequsitesClasses = [];
        $scope.sortBy = "date";
        $scope.descending = false;

        var resetShowDetails = function (classes) {
            for (var i = 0; i < classes.length; i++) {
                classes[i].Show = false;
            };
            $scope.prerequisitesClasses.length = 0;
            $scope.noPrerequsitesClasses.length = 0;
        }

        var loadClasses = function () {
            upcomingClassesService.getUpcomingClasses($scope.sortBy, $scope.descending).then(function (classes) {
                resetShowDetails(classes);
                for (var i = 0; i < classes.length; i++) {
                    classes[i].Show = false;
                    classes[i].PreClassNotes = $sce.trustAsHtml(classes[i].PreClassNotes);
                    classes[i].CallInDetails = $sce.trustAsHtml(classes[i].CallInDetails);
                    if (classes[i].NeedsPrerequisites) {
                        $scope.prerequisitesClasses.push(classes[i]);
                    } else {
                        $scope.noPrerequsitesClasses.push(classes[i]);
                    }
                }; 
            });
            
        };
       
        loadClasses();

        $scope.doSort = function (sortBy) {
            if ($scope.sortBy == sortBy) {
                $scope.descending = !$scope.descending;
            }
            $scope.sortBy = sortBy;
            loadClasses();
        }

        $scope.confirmDeleteOccasion = function() {
            $scope.$broadcast('cancelClass');
        }

    }
]);;
"use strict";

AccessConsciousness.appModule.factory("upcomingClassesService", [
    "$http", "$q",
    function ($http, $q) {
        var getUpcomingClasses = function (sortBy, descending) {
            var deferred = $q.defer();
            $http.post("/UpcomingClassesBlock/GetUpcomingClasses", { sortBy:sortBy, descending:descending })
            .success(function (data) {
                deferred.resolve(data.classes);
            });
            return deferred.promise;
        },
        cancelClass = function (currentClass) {
            var deferred = $q.defer();
            $http.post("/UpcomingClassesBlock/CancelClass", {currentClass:currentClass})
            .success(function (data) {
                deferred.resolve(data);
            });
            return deferred.promise;
        };
        return {
            getUpcomingClasses: getUpcomingClasses,
            cancelClass: cancelClass
        };
    }
]);
"use strict";

AccessConsciousness.appModule.controller("paymentsDueController", [
    "$scope", "paymentsDueService", "$window",
    function ($scope, paymentsDueService, $window) {
        $scope.amountApplied = 0.0;
        $scope.amountValidationMessage = "";
        $scope.prereqTooltipMessage = "";

        $scope.init = function (amountValidationMessage, prereqTooltipMessage) {
            $scope.amountValidationMessage = amountValidationMessage;
            $scope.prereqTooltipMessage = prereqTooltipMessage;
        }

        var loadClasses = function () {
            paymentsDueService.getPaymentsDueModel().then(function (model) {
                $scope.prerequisitesClasses = [];
                $scope.noPrerequisitesClasses = [];
                $scope.classLicenseFeeSalesOrders = [];

                model.Classes.forEach(function (classData) {
                    classData.StartDate = new Date(parseInt(classData.StartDate.substr(6)));
                    classData.EndDate = new Date(parseInt(classData.EndDate.substr(6)));
                    if (classData.NeedsPrerequisites) {
                        $scope.prerequisitesClasses.push(classData);
                    } else {
                        $scope.noPrerequisitesClasses.push(classData);
                    }
                });

                model.ClassLicenseFeeSalesOrders.forEach(function(salesOrder) {
                    $scope.classLicenseFeeSalesOrders.push(salesOrder);
                })

                $scope.isOnPaymentPlan = model.IsOnPaymentPlan;
            });
        };

        loadClasses();

        $scope.canPayForClass = function (classToCheck, isClass) {
            if (classToCheck && isClass) {
                if (!classToCheck.IsAdminClass) {
                    return false;
                }
                if (classToCheck.disabled) {
                    return false;
                }
                if ($scope.isOnPaymentPlan && !classToCheck.IsPaymentPlan) {
                    return false;
                }
                if (classToCheck.NeedsPrerequisites) {
                    return false;
                }
                return true;
            } else {
                if (classToCheck.disabled) {
                    return false;
                } else {
                    return true;
                }
            }
            return false;
        };

        $scope.disableOtherClasses = function (selectedClass) {
            $scope.noPrerequisitesClasses.forEach(function (item) {
                if (selectedClass.AmountToPay > 0 && item !== selectedClass)
                    item.disabled = true;

                if (!selectedClass.AmountToPay)
                    item.disabled = false;
            });

            $scope.classLicenseFeeSalesOrders.forEach(function(item) {
                if (selectedClass.AmountToPay > 0 && item !== selectedClass)
                    item.disabled = true;
                if (!selectedClass.AmountToPay)
                    item.disabled = false;
            });
        }

        $scope.goToCheckout = function (form) {
            if (form.$valid && !$scope.isSalesOrderPayment) {
                paymentsDueService.goToCheckout($scope.noPrerequisitesClasses, []).then(function(response) {
                    if (response.Success) {
                        $window.location.href = checkoutPageUrl;
                    } else {
                        $scope.errorMessage = response.Message;
                    }
                });
            } else {
                paymentsDueService.goToCheckout([], $scope.classLicenseFeeSalesOrders).then(function(response) {
                    if (response.Success) {
                        $window.location.href = checkoutPageUrl;
                    } else {
                        $scope.errorMessage = response.Message;
                    }
                });
            }
        };

        $scope.calculateAmountAppliedSum = function (isClass) {
            $scope.amountApplied = 0.0;
            $scope.amountAppliedFormatted = 0.0;
            $scope.isSalesOrderPayment = !isClass;

            if (isClass) {
                for (var i = 0; i < $scope.noPrerequisitesClasses.length; i++) {
                    if ($scope.noPrerequisitesClasses[i].AmountToPay != undefined) {
                        $scope.amountApplied += $scope.noPrerequisitesClasses[i].AmountToPay;
                    }
                }
            } else {
                for (var i = 0; i < $scope.classLicenseFeeSalesOrders.length; i++) {
                    if ($scope.classLicenseFeeSalesOrders[i].AmountToPay != undefined) {
                        $scope.amountApplied += $scope.classLicenseFeeSalesOrders[i].AmountToPay;
                    }
                }
            }

            $scope.amountAppliedFormatted = $scope.amountApplied;
        }

        $scope.selectCurrency = function (currency) {
            $scope.selectedCurrency = currency;
            if ($scope.amountApplied > 0) {
                angular.forEach($scope.noPrerequisitesClasses, function (elemClass) {
                    if (elemClass.Currency === $scope.selectedCurrency) {
                        elemClass.NotTheSameCurrency = false;
                    } else {
                        elemClass.NotTheSameCurrency = true;
                    }

                });
            } else {
                angular.forEach($scope.noPrerequisitesClasses, function (elemClass) {
                    elemClass.NotTheSameCurrency = false;
                });
            }
        }

        $scope.formatAmount = function () {
            if ($scope.amountApplied > 0) {
                var amountModel = { Amount: $scope.amountApplied, Currency: $scope.selectedCurrency }

                paymentsDueService.getAmountFormatted(amountModel).then(function (amountFormatted) {
                    $scope.amountAppliedFormatted = amountFormatted;
                });
            } else {
                $scope.amountAppliedFormatted = $scope.amountApplied;
            }
        }

        $scope.refreshPayments = function () {
            paymentsDueService.refreshCustomer().then(function (response) {
                if (response.success) {
                    loadClasses();
                } else {
                    alert(response.errorMessage);
                }
            });
        }
    }
]);;
"use strict";

AccessConsciousness.appModule.factory("paymentsDueService", [
    "$http", "$q",
    function ($http, $q) {
        var getPaymentsDueModel = function () {
            var deferred = $q.defer();
            $http.post("/PaymentsDueBlock/GetPaymentDueModel")
                    .success(function (data) {
                        deferred.resolve(data.model);
                    });
            return deferred.promise;
        },
            goToCheckout = function (classes, salesOrders) {
                var deferred = $q.defer();
                $http.post("/PaymentsDueBlock/GoToCheckout", { classes: classes, salesOrders: salesOrders })
                    .success(function (data) {
                        deferred.resolve(data.response);
                    });
                return deferred.promise;
            },
            getAmountFormatted = function (amount) {
                var deferred = $q.defer();
                $http.post("/PaymentsDueBlock/GetAmountFormatted", { amount: amount })
                    .success(function (data) {
                        deferred.resolve(data.amountFormatted);
                    });
                return deferred.promise;
            },
            refreshCustomer = function () {
                var deferred = $q.defer();
                $http.post("/PaymentsDueBlock/ReloadCurrentCustomer")
                    .success(function (data) {
                        deferred.resolve(data);
                    });
                return deferred.promise;
            };
        return {
            getPaymentsDueModel: getPaymentsDueModel,
            goToCheckout: goToCheckout,
            getAmountFormatted: getAmountFormatted,
            refreshCustomer: refreshCustomer
        };
    }
]);
"use strict";

AccessConsciousness.appModule.controller("classHistoryController", [
    "$scope", "classHistoryService", "$location","$anchorScroll",
    function ($scope, classHistoryService, $location, $anchorScroll) {
        $scope.currentPage = 1;
        $scope.sortBy = "date";
        $scope.descending = false;

        var resetShowDetails = function() {
            for (var i = 0; i < $scope.allClasses.length; i++) {
                $scope.allClasses[i].Show = false;
            };
        }

        var loadClasses = function () {
            classHistoryService.getAttendedClasses($scope.sortBy, $scope.descending).then(function (classes) {
                $scope.allClasses = classes;
                resetShowDetails();
                $scope.classes = $scope.allClasses.slice(0, 20);
                $scope.currentPage = 1;
                $scope.totalPages = parseInt(classes.length / 20);
                if (classes.length % 20 > 0) $scope.totalPages ++;
            });
        };
        loadClasses();

        $scope.selectPage = function (pageNo) {
            $scope.currentPage = pageNo;
            if (pageNo < 1) $scope.currentPage = 1;
            if (pageNo > $scope.totalPages) $scope.currentPage = $scope.totalPages;
            resetShowDetails();
            $scope.classes = $scope.allClasses.slice(($scope.currentPage - 1) * 20, ($scope.currentPage - 1) * 20 + 20);
            $location.hash('title');
            $anchorScroll();
        };

        $scope.doSort = function(sortBy) {
            if ($scope.sortBy == sortBy) {
                $scope.descending = !$scope.descending;
            }
            $scope.sortBy = sortBy;
            loadClasses();
        }
    }
]);;
"use strict";

AccessConsciousness.appModule.factory("classHistoryService", [
    "$http", "$q",
    function ($http, $q) {
        var getAttendedClasses = function (sortBy, descending) {
            var deferred = $q.defer();
            $http.post("/ClassHistoryBlock/GetAttendedClasses",{sortBy:sortBy, descending:descending})
            .success(function (data) {
                deferred.resolve(data.classes);
            });
            return deferred.promise;
        };
        return {
            getAttendedClasses: getAttendedClasses
        };
    }
]);
"use strict";

AccessConsciousness.appModule.controller("certificationsController", [
    "$scope", "certificationsService",
    function ($scope, certificationsService) {

        var loadCertifications = function () {
            certificationsService.loadCertifications().then(function (certifications) {
                $scope.certifications = certifications;
                initExpanseStatus();
                parseCertificationsExpirationDate($scope.certifications);
                $scope.finishedLoading = true;
            });
        };

        $scope.renewCertification = function (productUrl) {
            if (productUrl == null || productUrl === "")
                return;

            window.location.href = productUrl;
        };

        $scope.expand = function (certification) {
            certification.Expanded = true;
        };

        $scope.collapse = function (certification) {
            certification.Expanded = false;
        };

        var initExpanseStatus = function () {
            for (var i = 0; i < $scope.certifications.length; i++) {
                $scope.certifications[i].Expanded = false;
            }
        }

        var parseCertificationsExpirationDate = function (certifications) {
            for (var i = 0; i < certifications.length; i++) {
                if (certifications[i].ExpirationDate) {
                    certifications[i].ExpirationDate =
                        parseJsonDate(certifications[i].ExpirationDate);
                }
            }
        }

        var parseJsonDate = function (jsonDateString) {
            return new Date(parseInt(jsonDateString.replace('/Date(', '')));
        };

        $scope.displayLinks = function (certificationExpirationDate) {
            if (!certificationExpirationDate)
                return false;

            var currentDate = new Date();
            currentDate.setHours(0, 0, 0, 0);
            certificationExpirationDate.setHours(0, 0, 0, 0);
            if (certificationExpirationDate > currentDate)
                return true;

            return false;
        }

        loadCertifications();
    }
]);;
"use strict";

AccessConsciousness.appModule.factory("certificationsService", [
    "$http", "$q",
    function ($http, $q) {

        var loadCertifications = function () {
            var deferred = $q.defer();
            $http.post("/CertificationsBlock/LoadCertifications")
                .success(function (data) {
                    deferred.resolve(data.certifications);
                });

            return deferred.promise;
        };

        return {
            loadCertifications: loadCertifications
        };
    }
]);
"use strict";

AccessConsciousness.appModule.factory("languagesService", [
    "$http", "$q", function ($http, $q) {

        var getPreferredLanguages = function () {
            var deferred = $q.defer();
            $http.post("/PreferredLanguagesBlock/GetPreferredLanguages").success(function (data) {
                deferred.resolve(data);
            });
            return deferred.promise;
        }

        var savePreferredLanguages = function (model) {
            var deferred = $q.defer();
            $http.post("/PreferredLanguagesBlock/SavePreferredLanguages", model ).success(function (data) {
                deferred.resolve(data);
            });
            return deferred.promise;
        }

        //get preferred languages list from netsuite (cached)
        var getAllPreferredLanguages = function () {
            var deferred = $q.defer();
            $http.get("/Language/GetPreferredLanguages").success(function (data) {
                deferred.resolve(data);
            }).error(function(err) {
                console.log(err);
            });
            return deferred.promise;
        }

        //get corespondent languages list from netsuite (cached)
        var getAllCorrespondentLanguages = function () {
            var deferred = $q.defer();
            $http.get("/Language/GetCorrespondentLanguages").success(function (data) {
                deferred.resolve(data);
            }).error(function (err) {
                console.log(err);
            });
            return deferred.promise;
        }

        return {
            getPreferredLanguages: getPreferredLanguages,
            savePreferredLanguages: savePreferredLanguages,
            getAllPreferredLanguages: getAllPreferredLanguages,
            getAllCorrespondentLanguages: getAllCorrespondentLanguages
        }
    }
]);;
"use strict";

AccessConsciousness.appModule.controller("languagesController", [
    "$scope", "languagesService", "$sce", "$filter", function ($scope, languagesService, $sce, $filter) {

        var controller = this;

        (function init() {
            controller.preferredModel = { sectionId: "preferredLanguage", modalHeader: modalPreferredLanguageHeader, modalText: $sce.trustAsHtml(modalPreferredLanguageText) };
            controller.correspondentModel = { sectionId: "correspondentLanguage", modalHeader: modalCorrespondentLanguageHeader, modalText: $sce.trustAsHtml(modalCorrespondentLanguageText), DropdownText: selectALanguageText, AddButtonText: addCorrespondentLanguage };
            controller.acceptEnglishModel = { sectionId: "acceptEnglish", modalHeader: modalAcceptEnglishHeader, modalText: $sce.trustAsHtml(modalAcceptEnglishText) };
            controller.model = {};
            controller.model.enableModalTooltips = enableModalTooltips;
            languagesService.getPreferredLanguages().then(function (data) {
                controller.correspondentModel.SelectedItems = [];
                if (data) {
                    angular.forEach(data.preferredLanguages.CorrespondentLanguages, function (item) {
                        controller.correspondentModel.SelectedItems.push({ Value: item.Id, Text: item.Name });
                    });

                    controller.correspondentModel.SelectedItems = $filter('orderBy')(controller.correspondentModel.SelectedItems, 'Text');

                    controller.model.PreferredLanguageId = data.preferredLanguages.PreferredLanguageId.toString();
                    controller.model.AcceptEnglish = data.preferredLanguages.AcceptEnglish;
                }
            }).then(function () {
                languagesService.getAllPreferredLanguages().then(function (data) {
                    var allPreferredLanguages = data.allPreferredLanguages;
                    controller.preferredModel.Items = $filter('orderBy')(angular.copy(allPreferredLanguages), 'Text');

                    controller.acceptEnglishModel.Items = [{ Text: yesText, Value: true }, { Text: noText, Value: false }];
                }).then(function () {
                    languagesService.getAllCorrespondentLanguages().then(function (data) {
                        var allCorrespondentLanguages = data.allCorrespondentLanguages;
                        controller.correspondentModel.Items = $filter('orderBy')(angular.copy(allCorrespondentLanguages), 'Text');
                    });
                });

            });

        })();

        controller.save = function () {
            controller.isLoadingEnabled = true;
            if (!controller.correspondentModel.SelectedItems) {
                controller.model.CorrespondentLanguages = String.EMPTY;
                languagesService.savePreferredLanguages(controller.model).then(function (data) {
                    controller.isLoadingEnabled = false;
                    controller.showSuccess = true;
                });
            } else {
                controller.model.CorrespondentLanguages = [];
                angular.forEach(controller.correspondentModel.SelectedItems, function (item) {
                    controller.model.CorrespondentLanguages.push({ Id: item.Value, Name: item.Text });
                });
                languagesService.savePreferredLanguages(controller.model).then(function (data) {
                    controller.isLoadingEnabled = false;
                    controller.showSuccess = true;
                });
            }
        }


        controller.showModal = function (modalId) {
            $('#' + modalId).modal();
        }

        controller.closeModal = function (modalId) {
            $('#' + modalId).modal('hide');
        }
    }
]);;
"use strict";

AccessConsciousness.appModule.controller("checkoutController", [
    "$scope", "checkoutService", "locationService", "$location", "$anchorScroll", "$timeout", "$window", "ewayService", "stripeService", "payPalService",
    function ($scope, checkoutService, locationService, $location, $anchorScroll, $timeout, $window, ewayService, stripeService, payPalService) {
        $scope.dataLoaded = false;
        $scope.discountPaymentCompany = "DCP";

        var init = function () {
            $scope.initCheckoutModel();
            $scope.initPaymentConfirmationModelSubmit();
            $scope.isEuroPayment = $scope.isPaymentCurrency('EUR');
            $scope.isElLugarPaymentCompany = $scope.paymentCompany === "ELG";
            $scope.isAffPaymentCompany = $scope.paymentCompany === "AFF";
            $scope.isLicenseFeePayment = $scope.paymentCompany === "LFP";
            $scope.euroMissingCreditCardData = window.euroMissingCreditCardData;
            $scope.elLugarMissingCreditCardData = window.elLugarMissingCreditCardData;
            $scope.affMissingCreditCardData = window.affMissingCreditCardData;
            $scope.lfpMissingCreditCardData = window.lfpMissingCreditCardData;
        };

        $scope.initCheckoutModel = function () {
            $scope.checkoutModel = {};
            $scope.checkoutModel.paymentProcessed = false;
            $scope.checkoutModel.successMessage = "";

            //init PayPal
            selectPaymentMethod($scope.initCybersourcePayPal, $scope.initEwayPayPal, $scope.initEuroPayPal,
                $scope.initElLugarPayPal, $scope.initAffPayPal, $scope.initLicenseFeePayPal);
        };

        $scope.initCybersourcePayPal = function () {
            $scope.isPayPalPayment = $location.search().PayerID ? true : false;
            if ($scope.isPayPalPayment) {
                $scope.checkoutModel.paymentMethodProvided = true;
                $scope.hidePaymentSelection();
            } else {
                $scope.checkoutModel.paymentMethodProvided = false;
            }
        };

        $scope.initEwayPayPal = function () {
            $scope.ewayPayPalCancelled = window.ewayPayPalCancelled;
            var accessCode = ewayService.getQueryParams().AccessCode;
            $scope.isPayPalPayment = accessCode && !ewayPayPalCancelled;
            if ($scope.isPayPalPayment) {
                $scope.checkoutModel.paymentMethodProvided = true;
                $scope.hidePaymentSelection();

                // check if payment was already processed(for exapmple page is reloaded)
                ewayService.getAccessCodeResult(accessCode, true).then(function (response) {
                    $('#processingPaymentModal').modal('hide');
                    if (response.success) {
                        $scope.checkoutModel.paymentProcessed = true;
                        $scope.checkoutModel.successMessage = response.message;
                    }
                }, function () {
                    $('#processingPaymentModal').modal('hide');
                });
            }
        };

        var initPayPalForStripe = function () {
            $scope.isPayPalPayment = $location.search().PayerID && $location.search().paymentId ? true : false;
            if ($scope.isPayPalPayment) {
                $scope.checkoutModel.paymentMethodProvided = true;
                $scope.hidePaymentSelection();
            } else {
                $scope.checkoutModel.paymentMethodProvided = false;
            }
        };

        $scope.initEuroPayPal = function () {
            initPayPalForStripe();
        };

        $scope.initElLugarPayPal = function () {
            initPayPalForStripe();
        };

        $scope.initAffPayPal = function () {
            initPayPalForStripe();
        };

        $scope.initLicenseFeePayPal = function() {
            initPayPalForStripe();
        }

        $scope.scrollTo = function (id) {
            $timeout(function () {
                $location.hash(id);
                $anchorScroll();
                $timeout(function () {
                    $location.hash(id);
                    $anchorScroll();
                },
                    0);
            },
                0);
        };

        $scope.initPayByCCModel = function () {
            $scope.payByCCModel = {};
            $scope.payByCCModel.data = {};
            $scope.payByCCModel.years = AccessConsciousness.getCreditCardYearsForDropdown();
            $scope.payByCCModel.months = AccessConsciousness.getMonthsForDropdown();
            $scope.payByCCModel.errorMessage = "";
            $scope.payByCCModel.successMessage = "";
            $scope.payByCCModel.saveOnFile = false;
            $scope.payByCCModel.isLoadingEnabled = true;

            $scope.payByCCModel.saveAsBillingAddress = function () {
                $scope.payByCCModel.isLoadingEnabled = true;
                checkoutService.saveAsBillingAddress($scope.payByCCModel.data).then(function (response) {
                    $scope.payByCCModel.isLoadingEnabled = false;

                    if (response.Success) {
                        $scope.payByCCModel.successMessage = response.Message;
                    } else {
                        $scope.payByCCModel.errorMessage = response.Message;
                    }
                });
            };

            $scope.payByCCModel.addCCPayment = function (form) {
                $scope.creditCardHolderName = $scope.payByCCModel.data.NameOnCard;
                if (form.$valid) {
                    if ($scope.isEuroPayment && ($scope.cardInvalid === undefined || $scope.cardInvalid)) {
                        $scope.payByCCModel.errorMessage = $scope.euroMissingCreditCardData;
                    } else if ($scope.isElLugarPaymentCompany && ($scope.cardInvalid === undefined || $scope.cardInvalid)) {
                        $scope.payByCCModel.errorMessage = $scope.elLugarMissingCreditCardData;
                    } else if ($scope.isAffPaymentCompany && ($scope.cardInvalid === undefined || $scope.cardInvalid)) {
                        $scope.payByCCModel.errorMessage = $scope.affMissingCreditCardData;
                    } else if ($scope.isLicenseFeePayment && ($scope.cardInvalid === undefined || $scope.cardInvalid)) {
                        $scope.payByCCModel.errorMessage = $scope.lfpMissingCreditCardData;
                    } else {
                        $scope.payByCCModel.data.CountryName = checkoutService.getCountryName(
                            $scope.payByCCModel.countries,
                            $scope.payByCCModel.data.CountryId);
                        $scope.payByCCModel.data.StateName = checkoutService.getStateName($scope.payByCCModel.states,
                            $scope.payByCCModel.data.StateId);

                        var currentDate = new Date();
                        var currentMonth = currentDate.getMonth() + 1;
                        var currentYear = currentDate.getFullYear();
                        var ccExpired =
                            currentYear > $scope.payByCCModel.data.CardExpirationYear ||
                            (currentYear === $scope.payByCCModel.data.CardExpirationYear &&
                                currentMonth > $scope.payByCCModel.data.CardExpirationMonth);

                        $scope.payByCCModel.data.isLicenseFeePayment = $scope.isLicenseFeePayment;

                        if (!ccExpired) {
                            if ($scope.payByCCModel.saveOnFile) {
                                $scope.payByCCModel.saveAsBillingAddress();
                            }
                            $scope.checkoutModel.paymentMethodProvided = true;
                            $scope.payByCCModel.errorMessage = null;
                            $location.hash("paymentConfirmation");
                            $anchorScroll();
                        }
                    }
                } else {
                    $scope.payByCCModel.errorMessage = $scope.payByCCModel.CreditCardExpiredMessage;
                }
            };

            $scope.payByCCModel.loadStatesForCountry = function (countryId, clearSelectedState) {
                if (countryId > 0) {
                    locationService.getStatesForCountry(countryId).then(function (states) {
                        $scope.payByCCModel.states = states;
                        if (clearSelectedState) {
                            $scope.payByCCModel.data.State = null;
                            return;
                        }
                        if ($scope.isInEditMode) {
                            for (var i = 0; i < $scope.payByCCModel.states.length; i++) {
                                if ($scope.payByCCModel.states[i].Name == $scope.payByCCModel.data.State) {
                                    $scope.payByCCModel.data.State = $scope.payByCCModel.states[i].Id;
                                    break;
                                }
                            }
                        }
                    });
                } else {
                    $scope.payByCCModel.states = undefined;
                    if ($scope.payByCCModel.data != undefined) {
                        $scope.payByCCModel.data.State = undefined;
                    }
                }
            };

            checkoutService.loadBillingAddress().then(function (billingAddress) {
                checkoutService.populateBillingAddress($scope.payByCCModel, billingAddress);
                $scope.payByCCModel.isLoadingEnabled = false;
            });
        };

        $scope.initPaymentConfirmationModel = function () {
            $scope.paymentConfirmationModel = {};
            $scope.paymentConfirmationModel.data = {};
            $scope.paymentConfirmationModel.isLoadingEnabled = false;
            checkoutService.getConfirmationItems().then(function (data) {
                if (data.model) {
                    $scope.paymentConfirmationModel.data = data.model;
                    $scope.setPaymentInfo(data.model.Items[0]);
                    $scope.isClassPublishCost = data.model.IsPublishCostCheckout;
                    $scope.paymentConfirmationModel.data.showDueAmount = data.model.DueAmount !==
                        data.model.SubtotalAmountToPay;
                    $scope.paymentConfirmationModel.data.isAmountCoveredByDiscount = $scope.paymentCompany === $scope.discountPaymentCompany;
                    $scope.dataLoaded = true;
                    init();
                }
            });
        };

        $scope.initPaymentConfirmationModelSubmit = function () {
            $scope.paymentConfirmationModel.submitAndPay = function () {
                $scope.paymentConfirmationModel.isLoadingEnabled = true;
                $('#processingPaymentModal').modal('show');
                selectPaymentMethod($scope.submitCybersourcePayment,
                    $scope.submitEwayPayment,
                    $scope.submitEuroPayment,
                    $scope.submitElLugarPayment,
                    $scope.submitAffPayment,
                    $scope.submitLicenseFeePayment,
                    $scope.submitDiscountPayment);
            };
        };

        $scope.initStripeElements = function (isEuroPayment, isElLugarPayment, isAffPayment, isLicenseFeePayment) {
            $(document).ready(function () {
                setTimeout(function () {
                    if (isAffPayment) {
                        $scope.stripe = Stripe($window.AffStripeKey);
                    } else if (isElLugarPayment) {
                        $scope.stripe = Stripe($window.ElLugarStripeKey);
                    } else if (isLicenseFeePayment) {
                        $scope.stripe = Stripe($window.LfpStripeKey);
                    } else if (isEuroPayment) {
                        $scope.stripe = Stripe($window.StripeKey);
                    }

                    var elements = $scope.stripe.elements();
                    $scope.cardElement = elements.create('card', { hidePostalCode: true });
                    $scope.cardElement.mount('#card-element');
                    $scope.cardElement.on('change',
                        function (event) {
                            $scope.cardInvalid = !event.complete;
                        });
                }, 500);
            });
        };

        $scope.submitCybersourcePayment = function () {
            checkoutService.submitAndPay($scope.payByCCModel.data, $location.search().PayerID)
                .then(function (response) {
                    $scope.paymentConfirmationModel.isLoadingEnabled = false;
                    $('#processingPaymentModal').modal('hide');
                    $('.modal-backdrop').remove();
                    $scope.checkoutModel.paymentProcessed = response.success;

                    if (response.success) {
                        $scope.checkoutModel.successMessage = response.message;
                        $scope.payForClasses = response.payForClasses;
                    } else {
                        $scope.checkoutModel.paymentMethodProvided = false;
                        if ($scope.isPayPalPayment) {
                            $scope.hidePaymentMethodSelection = false;
                            $scope.payPalErrorMessage = response.message;
                        } else {
                            $scope.payByCCModel.errorMessage = response.message;
                            $scope.scrollTo('errorMessage');
                        }
                    }
                });
        };

        $scope.submitEwayPayment = function () {
            var deferred;
            if ($scope.isPayPalPayment) {
                var accessCode = ewayService.getQueryParams().AccessCode;
                deferred = ewayService.confirmPayPalPayment(accessCode)
                    .then(function () {
                        return ewayService.sendPayment(accessCode, true);
                    });
                deferred.then(onEwayPayPalPaymentSuccess)
                    .catch(onPaymentError)
                    .finally(onPaymentComplete);
            } else {
                deferred = ewayService.submitPayment($scope.amountToPay, $scope.currency,
                    $scope.payByCCModel.data);
                deferred.then(onPaymentSuccess)
                    .catch(onPaymentError)
                    .finally(onPaymentComplete);
            }
        };

        var submitStripePayment = function (isEuroPayment, isElLugarPayment, isAffPayment, isLicenseFeePayment) {
            var deferred;
            if ($scope.isPayPalPayment) {
                deferred =
                    payPalService.submitCheckoutPayment($location.search().paymentId,
                        $location.search().PayerID, isEuroPayment, isElLugarPayment, isAffPayment, isLicenseFeePayment);
                deferred.then(onPaymentSuccess)
                    .catch(onPaymentError)
                    .finally(onPaymentComplete);
            } else {
                deferred = stripeService.submitPayment($scope.payByCCModel.data,
                    $scope.amountToPay,
                    $scope.currency,
                    $scope.className,
                    undefined,
                    undefined,
                    undefined,
                    isEuroPayment, isElLugarPayment, isAffPayment, isLicenseFeePayment);
                deferred.then(executeStripeHandleCardPayment);
            }
        };

        $scope.submitEuroPayment = function () {
            submitStripePayment(true, false, false, false);
        };

        $scope.submitElLugarPayment = function () {
            submitStripePayment(false, true, false, false);
        };

        $scope.submitAffPayment = function () {
            submitStripePayment(false, false, true, false);
        };

        $scope.submitLicenseFeePayment = function () {
            submitStripePayment(false, false, false, true);
        };

        $scope.submitDiscountPayment = function() {
            checkoutService.submitDiscountPayment().then(function (response) {
                $scope.paymentConfirmationModel.isLoadingEnabled = false;
                $('#processingPaymentModal').modal('hide');
                $('.modal-backdrop').remove();
                $scope.checkoutModel.paymentProcessed = response.isSuccess;

                if (response.isSuccess) {
                    $scope.checkoutModel.successMessage = response.message;
                    $scope.payForClasses = response.payForClasses;
                } else {
                    $scope.checkoutModel.discountPaymentError = response.message;
                }
            });
        }

        $scope.applyCouponCode = function (couponCodeForm) {
            if (!couponCodeForm.$valid) {
                return;
            }

            $scope.couponCodeError = "";
            var couponCode = couponCodeForm.couponCode.$modelValue;

            checkoutService.applyCouponCode(couponCode).then(function (response) {
                if (response.isSuccess) {
                    updateCheckoutTotals();
                    $('#couponCodeForm').trigger("reset");
                } else {
                    $scope.couponCodeError = response.message;
                }
            });
        }

        $scope.removeCouponCode = function (couponCode) {
            checkoutService.removeCouponCode(couponCode).then(function(response) {
                if (response.isSuccess) {
                    updateCheckoutTotals();
                }
            })
        }

        var updateCheckoutTotals = function () {
            checkoutService.getConfirmationItems().then(function (data) {
                if (data.model) {
                    $scope.paymentConfirmationModel.data = data.model;
                    $scope.setPaymentInfo(data.model.Items[0]);

                    $scope.paymentConfirmationModel.data.showDueAmount = data.model.DueAmount !==
                        data.model.SubtotalAmountToPay;
                    $scope.paymentConfirmationModel.data.isAmountCoveredByDiscount = $scope.paymentCompany === $scope.discountPaymentCompany;
                }
            });
        }

        $scope.confirmDiscountPayment = function() {
            $scope.hidePaymentMethodSelection = true;
            $scope.checkoutModel.paymentMethodProvided = true;
            $scope.checkoutModel.isAmountCoveredByDiscount = true;
        }

        var executeStripeHandleCardPayment = function (response) {
            if (!response.success) {
                onStripePaymentError(response);
                return;
            }

            var deferred;
            var cardholderName = $scope.creditCardHolderName;
            var cardElement = $scope.cardElement;
            var stripe = $scope.stripe;
            $scope.responseSuccessMessage = response.message;
            deferred = stripeService.handleCardPayment(response.clientSecret, cardElement,
                cardholderName, stripe);
            deferred.then(onStripePaymentSuccess)
                .catch(onStripePaymentError);
        };

        var onStripePaymentSuccess = function (response) {
            stripeService.setNetSuitePayment($scope.payByCCModel.data).then(function (response) {
                if (response.success) {
                    $scope.checkoutModel.paymentProcessed = true;
                }

                $scope.checkoutModel.successMessage = response.message;
                onPaymentComplete();
            });
        };

        var onPaymentSuccess = function (response) {
            $scope.checkoutModel.paymentProcessed = true;
            $scope.checkoutModel.successMessage =
                $scope.responseSuccessMessage ? $scope.responseSuccessMessage : response;
        };

        var onEwayPayPalPaymentSuccess = function (response) {
            $scope.checkoutModel.paymentProcessed = true;
            $scope.checkoutModel.successMessage =
                $scope.responseSuccessMessage ? $scope.responseSuccessMessage : response.message;
        };

        var onStripePaymentError = function (error) {
            $scope.checkoutModel.paymentMethodProvided = false;
            $scope.checkoutModel.paymentProcessed = false;
            if (error && error.error) {
                $scope.payByCCModel.errorMessage = error.error.message;
            } else {
                $scope.payByCCModel.errorMessage =
                    error.message ? error.message : checkoutService.getErrorMessage(error);
            }

            $scope.scrollTo('errorMessage');
            onPaymentComplete();
        };

        var onPaymentError = function (error) {
            $scope.checkoutModel.paymentMethodProvided = false;
            $scope.checkoutModel.paymentProcessed = false;
            if ($scope.isPayPalPayment) {
                $scope.isPayPalPayment = false;
                $scope.payPalErrorMessage = checkoutService.getErrorMessage(error);
                $scope.hidePaymentMethodSelection = false;
            } else {
                $scope.payByCCModel.errorMessage = checkoutService.getErrorMessage(error);
                $scope.scrollTo('errorMessage');
            }
        };

        var onPaymentComplete = function () {
            $scope.paymentConfirmationModel.isLoadingEnabled = false;
            $('#processingPaymentModal').modal('hide');
            $('.modal-backdrop').remove();
        };

        $scope.payPalSelected = function () {
            selectPaymentMethod($scope.setCybersourcePayPal, $scope.setEwayPayPal, $scope.setEuroPayPal,
                $scope.setElLugarPayPal, $scope.setAffPayPal, $scope.setLicenseFeePayPal, $scope.submitDiscountPayment);
        };

        $scope.setCybersourcePayPal = function () {
            $scope.isLoadingEnabledForPayPal = true;
            checkoutService.setPayPal().then(function (response) {
                if (response.success) {
                    $window.location.href = response.redirectUrl;
                } else {
                    $scope.payPalErrorMessage = response.message;
                    $scope.isLoadingEnabledForPayPal = false;
                }
            });
        };

        $scope.setEwayPayPal = function () {
            $scope.isLoadingEnabledForPayPal = true;
            ewayService.buildPayPalForm($scope.amountToPay, $scope.currency)
                .then(function (form) {
                    document.body.appendChild(form);
                    form.submit();
                },
                    function (error) {
                        console.error(error);
                        $scope.payPalErrorMessage = error.message;
                        $scope.isLoadingEnabledForPayPal = false;
                    });
        };

        var setPayPalForStripe = function () {
            $scope.isLoadingEnabledForPayPal = true;
            payPalService.setCheckoutPayPal($scope.amountToPay, $scope.currency, $scope.className,
                $scope.isEuroPayment, $scope.isElLugarPaymentCompany, $scope.isAffPaymentCompany, $scope.isLicenseFeePayment)
                .then(function (response) {
                    if (response.success) {
                        $window.location.href = response.redirectUrl;
                    } else {
                        $scope.payPalErrorMessage = response.message;
                        $scope.isLoadingEnabledForPayPal = false;
                    }
                });
        };

        $scope.setEuroPayPal = function () {
            setPayPalForStripe();
        };

        $scope.setElLugarPayPal = function () {
            setPayPalForStripe();
        };

        $scope.setAffPayPal = function () {
            setPayPalForStripe();
        };

        $scope.setLicenseFeePayPal = function() {
            setPayPalForStripe();
        }

        $scope.setPaymentInfo = function (classItem) {
            $scope.amountToPay = classItem.AmountToPay;
            $scope.currency = classItem.Currency;
            $scope.paymentCompany = classItem.PaymentCompany;
            $scope.className = classItem.Name;
        };

        $scope.hidePaymentSelection = function () {
            $scope.hidePaymentMethodSelection = true;
            $scope.ewayPayPalCancelled = false;
            if ($scope.isEuroPayment) {
                $scope.initStripeElements(true, false, false);
            }
            if ($scope.isElLugarPaymentCompany) {
                $scope.initStripeElements(false, true, false);
            }
            if ($scope.isAffPaymentCompany) {
                $scope.initStripeElements(false, false, true);
            }
            if ($scope.isLicenseFeePayment) {
                $scope.initStripeElements(false, false, false, true);
            }
        };

        $scope.isPaymentCurrency = function (currency) {
            return $scope.paymentConfirmationModel.data.TotalAmountToPayFormatted.indexOf(currency) !== -1;
        };

        var selectPaymentMethod = function (usdCallBack, audCallBack, euroCallBack,
            elLugarCallBack, affCallBack, licenseFeeCallBack, discountCallBack) {
            switch ($scope.paymentCompany) {
                case "AC":
                    if (usdCallBack) usdCallBack();
                    break;

                case "ASA":
                    if (audCallBack) audCallBack();
                    break;

                case "ACI":
                    if (euroCallBack) euroCallBack();
                    break;

                case "ELG":
                    if (elLugarCallBack) elLugarCallBack();
                    break;

                case "AFF":
                    if (affCallBack) affCallBack();
                    break;
                case "LFP":
                    if (licenseFeeCallBack) licenseFeeCallBack();
                    break;
                case "DCP":
                    if (discountCallBack) discountCallBack();
                    break;
                default:
                    selectPaymentMethodOnCurrency(usdCallBack, audCallBack, euroCallBack,
                        elLugarCallBack, affCallBack);
                    break;
            }
        };

        var selectPaymentMethodOnCurrency = function (usdCallBack, audCallBack, euroCallBack,
            elLugarCallBack, affCallBack) {
            if ($scope.isPaymentCurrency('USD') && usdCallBack)
                usdCallBack();

            if ($scope.isPaymentCurrency('AUD') && audCallBack)
                audCallBack();

            if ($scope.isPaymentCurrency('EUR') && euroCallBack)
                euroCallBack();

            if ($scope.isPaymentCurrency('USD') && elLugarCallBack)
                elLugarCallBack();

            if ($scope.isPaymentCurrency('EUR') && affCallBack)
                affCallBack();
        };

        //init
        $scope.initPaymentConfirmationModel();
        $scope.initPayByCCModel();
    }
]);;
"use strict";

AccessConsciousness.appModule.factory("checkoutService", [
    "$http", "$q",
    function ($http, $q) {

        var getConfirmationItems = function () {
            var deferred = $q.defer();
            $http.post("/CheckoutBlock/GetConfirmationItems")
                .success(function (data) {
                    if (data.success) {
                        deferred.resolve(data);
                    } else {
                        deferred.resolve([]);
                    }
                });
            return deferred.promise;
        };

        var submitAndPay = function (payByCCModel, payerId) {
            var deferred = $q.defer();
            $http.post("/CheckoutBlock/SubmitAndPay", { payByCCViewModel: payByCCModel, payerId: payerId })
                .success(function (response) {
                    deferred.resolve(response);
                });
            return deferred.promise;
        };

        var loadBillingAddress = function () {
            var deferred = $q.defer();
            $http.post("/CheckoutBlock/GetCustomerBillingAddress")
                .success(function (response) {
                    if (response.success) {
                        deferred.resolve(response.billingAddress);
                    } else {
                        deferred.resolve(null);
                    }
                });
            return deferred.promise;
        }

        var applyCouponCode = function(couponCode) {
            var deferred = $q.defer();
            $http.post("/CheckoutBlock/ApplyCouponCode", { couponCode: couponCode })
                .success(function(response) {
                    deferred.resolve(response);
                });

            return deferred.promise;
        }

        var removeCouponCode = function (couponCode) {
            var deferred = $q.defer();
            $http.post("/CheckoutBlock/RemoveCouponCode", { couponCode: couponCode })
                .success(function(response) {
                    deferred.resolve(response);
                });

            return deferred.promise;
        }

        var submitDiscountPayment = function() {
            var deferred = $q.defer();
            $http.post("/CheckoutBlock/SubmitDiscountPayment")
                .success(function(response) {
                    deferred.resolve(response);
                });

            return deferred.promise;
        }

        var populateBillingAddress = function (payByCCModel, billingAddress) {
            if (billingAddress == null) return;

            payByCCModel.data.Address1 = billingAddress.Address1;
            payByCCModel.data.Address2 = billingAddress.Address2;
            payByCCModel.data.CountryId = billingAddress.CountryId;
            payByCCModel.data.StateId = billingAddress.StateId;
            payByCCModel.data.City = billingAddress.City;
            payByCCModel.data.Zip = billingAddress.Zip;
            payByCCModel.states = billingAddress.PreLoadedStates;
            payByCCModel.countries = billingAddress.PreLoadedCountries;
        }

        var saveAsBillingAddress = function (payByCCModel) {
            var deferred = $q.defer();
            $http.post("/CheckoutBlock/SaveAsCustomerBillingAddress", payByCCModel)
                .success(function (response) {
                    deferred.resolve(response);
                });
            return deferred.promise;
        }

        var setPayPal = function () {
            var deferred = $q.defer();
            $http.post("/CheckoutBlock/SetPayPal")
                .success(function (response) {
                    deferred.resolve(response);
                });
            return deferred.promise;
        }

        var getCountryName = function (countries, countryId) {
            for (var i = 0; i < countries.length; i++) {
                if (countries[i].Id === countryId && countries[i].Name) {
                    return countries[i].Name;
                }
            }
          
            return null;
        }

        var getStateName = function (states, stateId) {
            for (var i = 0; i < states.length; i++) {
                if (states[i].Id === stateId && states[i].Name) {
                    return states[i].Name;
                }
            }          

            return null;
        }

        var getErrorMessage = function (response) {
            if (response) {
                if (response.length) {
                    return response;
                }
                if (response.error) {
                    return response.error;
                }
                if (response.ExceptionMessage) {
                    return response.ExceptionMessage;
                }
                if (response.message) {
                    return response.message;
                }
            }
            return window.defaultErrorMessage;
        }

        return {
            getConfirmationItems: getConfirmationItems,
            submitAndPay: submitAndPay,
            loadBillingAddress: loadBillingAddress,
            populateBillingAddress: populateBillingAddress,
            saveAsBillingAddress: saveAsBillingAddress,
            setPayPal: setPayPal,
            getCountryName: getCountryName,
            getStateName: getStateName,
            getErrorMessage: getErrorMessage,
            applyCouponCode: applyCouponCode,
            removeCouponCode: removeCouponCode,
            submitDiscountPayment: submitDiscountPayment,
        };
    }
]);;
"use strict";

AccessConsciousness.appModule.controller("facilitatorScheduleController", [
    "$scope", "$http", "$location", "$anchorScroll", "$window",
    function ($scope, $http, $location, $anchorScroll, $window) {
        $scope.occasionId = $location.search().occasionId != undefined ? $location.search().occasionId : 0;
        var loadFacilitatorSchedule = function () {
            var pagingSorting = {
                CurrentPage: $scope.currentPage,
                PageSize: $scope.pageSize,
                Descending: $scope.descending,
                SortBy: $scope.sortBy
            };
            if (!$scope.currentPage) {
                pagingSorting = null;
            }
            $http.post("/FacilitatorScheduleBlock/LoadSchedule", { pagingSortingViewModel: pagingSorting, occasionId: $scope.occasionId }).success(function (data) {
                $scope.occasions = data.occasions;
                $scope.currentPage = data.pagingSorting.CurrentPage;
                $scope.pageSize = data.pagingSorting.PageSize;
                $scope.descending = data.pagingSorting.Descending;
                $scope.sortBy = data.pagingSorting.SortBy;
                $scope.totalCount = data.pagingSorting.TotalCount;
                $scope.totalPages = parseInt(($scope.totalCount + $scope.pageSize - 1) / $scope.pageSize);
            });
        };
        var deleteRelatedPodsAndChildMediums = function (occasionId) {
            var i = 0;
            while (i < $scope.occasions.length) {
                if ($scope.occasions[i].PodParentOccasionId === occasionId || $scope.occasions[i].MainMediumOccurenceId === occasionId) {
                    $scope.occasions.splice(i, 1);
                } else {
                    i++;
                }
            }
        }
        $scope.selectPage = function (pageNo) {
            $scope.currentPage = pageNo;
            if (pageNo < 1) $scope.currentPage = 1;
            if (pageNo > $scope.totalPages) $scope.currentPage = $scope.totalPages;
            loadFacilitatorSchedule();
            $anchorScroll();
        };
        $scope.doSort = function (sortBy) {
            if ($scope.sortBy === sortBy) {
                $scope.descending = !$scope.descending;
            }
            $scope.sortBy = sortBy;
            loadFacilitatorSchedule();
        };
        var getOccasion = function (ocasionId) {
            for (var i = 0; i < $scope.occasions.length; i++) {
                if ($scope.occasions[i].OccasionId === ocasionId)
                    return $scope.occasions[i];
            }
            return undefined;
        };

        $scope.deleteClassOccasion = function (occasion) {
            var deleteConfirmText = occasion.IsPop ? window.deletePopClassConfirmText : window.deleteClassConfirmText;
            document.getElementById("cancelModalBody").innerHTML = deleteConfirmText;
            $("#cancelClassModal").modal('toggle');
            $scope.selectedOccasion = occasion;
        };

        $scope.confirmDeleteOccasion = function () {
            $http.post("/FacilitatorScheduleBlock/DeleteClassOccurrence", { occasionId: $scope.selectedOccasion.OccasionId })
                .success(function (data) {
                    if (data.success) {
                        var deletedOccasion = getOccasion(data.occasionId);
                        var index = $scope.occasions.indexOf(deletedOccasion);
                        $scope.occasions.splice(index, 1);
                        if (deletedOccasion.PodParentOccasionId === 0) deleteRelatedPodsAndChildMediums(deletedOccasion.OccasionId);
                    } else {
                        document.getElementById("errorModalBody").innerHTML = data.message;
                        $("#errorModal").modal('toggle');
                    }
                })
                .error(function () {
                    document.getElementById("errorModalBody").innerHTML = "Unexpected error. Please contact an administrator.";
                    $("#errorModal").modal('toggle');
                });
        }

        $scope.togglePopDetails = function (occasion, forceClose) {
            for (var i = 0; i < $scope.occasions.length; i++) {
                if ($scope.occasions[i].OccasionId != occasion.OccasionId)
                    $scope.occasions[i].showDetails = false;
            }

            occasion.showDetails = forceClose ? false : !occasion.showDetails;
        };

        $scope.linkClick = function (url) {
            $window.location.href = url;
            $window.location.reload(true);
        };

        $scope.PageSize = 2;
        $scope.currentPage = 1;
        $scope.sortBy = "startDate";
        $scope.descending = true;
        loadFacilitatorSchedule();
    }
]);;
"use strict";

AccessConsciousness.appModule.controller("hostScheduleController", [
    "$scope", "$http", "$location", "$anchorScroll",
    function ($scope, $http, $location, $anchorScroll) {
    	var loadFacilitatorSchedule = function () {
    		var pagingSorting = {
    			CurrentPage: $scope.currentPage,
    			PageSize: $scope.pageSize,
    			Descending: $scope.descending,
    			SortBy: $scope.sortBy
    		};
    		if (!$scope.currentPage) {
    			pagingSorting = null;
    		}
    		$http.post("/HostScheduleBlock/LoadSchedule", pagingSorting).success(function (data) {
    			$scope.occasions = data.occasions;
    			$scope.currentPage = data.pagingSorting.CurrentPage;
    			$scope.pageSize = data.pagingSorting.PageSize;
    			$scope.descending = data.pagingSorting.Descending;
    			$scope.sortBy = data.pagingSorting.SortBy;
    			$scope.totalCount = data.pagingSorting.TotalCount;
    			$scope.totalPages = parseInt(($scope.totalCount + $scope.pageSize - 1) / $scope.pageSize);
    		});
    	};
    	var getOccasion = function (ocasionId) {
    	    for (var i = 0; i < $scope.occasions.length; i++) {
    	        if ($scope.occasions[i].OccasionId === ocasionId)
    	            return $scope.occasions[i];
    	    }
    	    return undefined;
    	};

    	$scope.selectPage = function (pageNo) {
    		$scope.currentPage = pageNo;
    		if (pageNo < 1) $scope.currentPage = 1;
    		if (pageNo > $scope.totalPages) $scope.currentPage = $scope.totalPages;
    		loadFacilitatorSchedule();
    		$location.hash('table');
	        $anchorScroll();
	    };
    	$scope.doSort = function (sortBy) {
    		if ($scope.sortBy === sortBy) {
    			$scope.descending = !$scope.descending;
    		}
    		$scope.sortBy = sortBy;
    		loadFacilitatorSchedule();
    	};

    	$scope.deleteClassOccasion = function (occasion) {
    	    if (confirm(window.deleteClassConfirmText)) {
    	        $http.post("/FacilitatorScheduleBlock/DeleteClassOccurrence", { occasionId: occasion.OccasionId })
				    .success(function (data) {
				        if (data.success) {
				            var deletedOccasion = getOccasion(data.occasionId);
				            var index = $scope.occasions.indexOf(deletedOccasion);
				            $scope.occasions.splice(index, 1);
				        } else {
				            alert(data.message);
				        }
				    })
				    .error(function () {
				        alert("Unexpected error. Please contact an administrator.");
				    });
    	    }
    	};


        $scope.PageSize = 2;
    	$scope.currentPage = 1;
    	$scope.sortBy = "startDate";
    	$scope.descending = true;
    	loadFacilitatorSchedule();
    }
]);;
AccessConsciousness.appModule.directive("payByCreditCard", function () {
    return {
        restrict: "AE",
        transclude: true,
        scope: {
            billingAddress: "=",
            onSubmit: "&",
            submitButtonText: "@",
            informationText: "@",
            payByCCModel: "=",
            loadingIndicator: "=",
            currency: "=",
            isEuroPayment: "=",
            isElLugarPayment: "=",
            isAffPayment: "=",
            cardInvalid: "="
        },
        templateUrl: "/SecureTemplateHelper/PayByCreditCardTemplate",
        controller: [
            "$scope", "$rootScope", "locationService", "checkoutService", function ($scope, $rootScope, locationService, checkoutService) {


                $scope.initPayByCCModel = function () {
                    $scope.payByCCModel.data = {}
                    $scope.payByCCModel.years = AccessConsciousness.getCreditCardYearsForDropdown();
                    $scope.payByCCModel.months = AccessConsciousness.getMonthsForDropdown();
                    $scope.payByCCModel.errorMessage = "";
                    $scope.euroMissingCreditCardData = window.euroMissingCreditCardData;
                    $scope.elLugarMissingCreditCardData = window.elLugarMissingCreditCardData;
                    $scope.payByCCModel.addCCPayment = function (form) {
                        if (form.$valid) {
                            $scope.checkoutModel.paymentMethodProvided = true;
                        }
                    };

                    $scope.payByCCModel.loadStatesForCountry = function (countryId, clearSelectedState) {
                        if (countryId > 0) {
                            locationService.getStatesForCountry(countryId).then(function (states) {
                                $scope.payByCCModel.states = states;
                                if (clearSelectedState) {
                                    $scope.payByCCModel.data.State = null;
                                    return;
                                }
                                if ($scope.isInEditMode) {
                                    for (var i = 0; i < $scope.payByCCModel.states.length; i++) {
                                        if ($scope.payByCCModel.states[i].Name === $scope.payByCCModel.data.State) {
                                            $scope.payByCCModel.data.State = $scope.payByCCModel.states[i].Id;
                                            break;
                                        }
                                    }
                                }
                            });
                        } else {
                            $scope.payByCCModel.states = undefined;
                            if ($scope.payByCCModel.data != undefined) {
                                $scope.payByCCModel.data.State = undefined;
                            }
                        }
                    };

                    locationService.getCountries().then(function (countries) {
                        $scope.payByCCModel.countries = countries;
                    });
                };

                $scope.payByCreditCardSubmit = function (form) {
                    if (form.$valid) {
                        if ($scope.isEuroPayment && ($scope.cardInvalid === undefined || $scope.cardInvalid)) {
                            $scope.payByCCModel.errorMessage = $scope.euroMissingCreditCardData;
                        } else if ($scope.isElLugarPayment && ($scope.cardInvalid === undefined || $scope.cardInvalid)) {
                            $scope.payByCCModel.errorMessage = $scope.elLugarMissingCreditCardData;
                        } else if ($scope.isAffPayment && ($scope.cardInvalid === undefined || $scope.cardInvalid)) {
                            $scope.payByCCModel.errorMessage = $scope.affMissingCreditCardData;
                        } else {
                            var currentDate = new Date();
                            var currentMonth = currentDate.getMonth() + 1;
                            var currentYear = currentDate.getFullYear();
                            var ccExpired = currentYear > $scope.payByCCModel.data.CardExpirationYear ||
                                (currentYear === $scope.payByCCModel.data.CardExpirationYear &&
                                    currentMonth > $scope.payByCCModel.data.CardExpirationMonth);
                            $scope.payByCCModel.data.CountryName = checkoutService.getCountryName(
                                $scope.payByCCModel.countries,
                                $scope.payByCCModel.data.CountryId);
                            $scope.payByCCModel.data.StateName = checkoutService.getStateName(
                                $scope.payByCCModel.states,
                                $scope.payByCCModel.data.StateId);
                            if ($scope.onSubmit && !ccExpired) {
                                $scope.onSubmit({ model: $scope.payByCCModel });
                            }

                            $scope.payByCCModel.errorMessage =
                                ccExpired ? $scope.payByCCModel.CreditCardExpiredMessage : "";
                        }
                    } else {
                        $scope.payByCCModel.errorMessage = $scope.payByCCModel.CreditCardExpiredMessage;
                    }
                }
                $scope.initPayByCCModel();
                $rootScope.$on('clearPayByCCModel', function () { $scope.payByCCForm.$setPristine(); });
            }
        ]
    };
});;
'use strict';

AccessConsciousness.appModule.controller('classRosterController', [
    '$rootScope', '$scope', '$http', '$window', '$q', '$location', 'ewayService', 'checkoutService', 'stripeService', "payPalService",
    function ($rootScope, $scope, $http, $window, $q, $location, ewayService, checkoutService, stripeService, payPalService) {

        //#region functions
        $scope.deferred = $q.defer();

        var countPresent = function () {
            $scope.checkedInCount = 0;
            angular.forEach($scope.allAttendees,
                function (att) {
                    if (att.SeminarAttendanceStatus === 'Attended') {
                        $scope.checkedInCount++;
                    }
                });
        };

        var resetErrorMessage = function () {
            $scope.errorMessage = '';
        };

        var populateScopeFromModel = function (data) {
            $scope.classOccasionId = data.model.ClassOccasionId;
            $scope.allAttendees = data.model.Attendees;
            $scope.filteredAttendees = data.model.Attendees;
            $scope.classStartDateTime = data.model.StartDateFormatted + ' ' + data.model.StartTimeFormatted;
            $scope.capacity = data.model.Capacity;
            $scope.medium = data.model.Medium;
            $scope.attendeeToPayFor = data.model.SelectedAttendee;
            $scope.partialAmountToPay = data.model.SelectedAttendeeAmountToPay;
            $scope.partialAmountToPayFormatted = data.model.SelectedAttendeeAmountToPayFormatted;
            $scope.dataLoaded = true;
            $scope.cancelPaymentUrl = data.CancelPaymentUrl;
            $scope.isAccessClass = data.model.IsAccessClass;
            $scope.spokenLanguages = data.model.SpokenLanguages;
            $scope.languages = data.model.Languages;
            $scope.selectedSpokenLanguage = data.model.SelectedSpokenLanguage;
            $scope.spokenLanguage = data.model.SelectedSpokenLanguage;
            $scope.spokenLanguagesSummary = data.model.SpokenLanguagesSummary;
            $scope.requestedLanguagesSummary = data.model.RequestedLanguagesSummary;
            $scope.estimatedSalesFormatted = data.model.EstimatedSalesFormatted;
            $scope.actualSalesFormatted = data.model.ActualSalesFormatted;
            $scope.showLanuagesModalButton = data.model.SpokenLanguages.length > 1;
            $scope.paymentCompany = data.model.PaymentCompany;
            $scope.isElLugarPayment = $scope.paymentCompany === "ELG";
            $scope.isAffPayment = $scope.paymentCompany === "AFF";
            $scope.showLicenseFees = data.model.LicenseFeeApplies;
            $scope.facilitators = data.model.Facilitators;
            $scope.salesOrders = data.model.SalesOrders;
            $scope.currentFacilitator = data.model.CurrentFacilitator;
            $scope.isPop = data.model.IsPop;
            $scope.hasPopAttendees = data.model.HasPopAttendees;
            $scope.isCheckInPopClosed = data.model.IsCheckInPopClosed;
        };

        var initPagination = function () {
            countPresent();
            $scope.currentPage = 1;
            $scope.itemsPerPage = 20;
            $scope.totalPages = Math.ceil($scope.allAttendees.length / $scope.itemsPerPage);
            $scope.goToPage(1);
        };

        var validatePartialAmount = function () {
            if (!$scope.partialAmountToPay ||
                $scope.partialAmountToPay <= 0 ||
                $scope.partialAmountToPay > $scope.attendeeToPayFor.AmountDue) {
                $scope.partialPaymentAmountErrorMessage =
                    'The amount to charge must be greater than 0 and less or equal to ' +
                    $scope.attendeeToPayFor.AmountDue;
                return false;
            }
            $scope.partialPaymentAmountErrorMessage = '';
            return true;
        };

        var payPalDataInitialization = function () {
            var attendeeToPayForId = $scope.attendeeToPayFor && $scope.attendeeToPayFor.SeminarAttendanceId;

            var attendeeToPayForIndex = -1;
            for (var i = 0; i < $scope.allAttendees.length; i++) {
                if ($scope.allAttendees[i].SeminarAttendanceId === attendeeToPayForId) {
                    attendeeToPayForIndex = i;
                    break;
                }
            }

            $scope.payPalCancelled = window.ewayPayPalCancelled && !window.payerId && !window.paymentId;

            if (attendeeToPayForIndex >= 0 && !$scope.payPalCancelled) {
                $scope.attendeeToPayFor = $scope.allAttendees[attendeeToPayForIndex];
                if ($scope.partialAmountToPay > 0 && window.payerId) {
                    $('#payByPayPalModal').modal('show');
                }
            }
        };

        var updateAttendees = function (attendees) {
            $scope.allAttendees.push(attendees);
            $scope.filteredAttendees = $scope.allAttendees;
            $scope.searchKeyword = '';
            $scope.totalPages = Math.ceil($scope.filteredAttendees.length / $scope.itemsPerPage);
            $scope.goToPage($scope.totalPages);
        };

        var deleteLanguagesSummaryReports = function (languages, languageName) {
            var index = -1;
            for (var i = 0; i < languages.length; i++) {
                if (languages[i].LanguageName === languageName) {
                    languages[i].NumberOfLanguages -= 1;
                    index = i;
                    break;
                }
            }

            if (index !== -1 && languages[index].NumberOfLanguages <= 0) {
                languages.splice(index, 1);
            }

            return languages;
        };

        var addLanguagesSummaryReports = function (languages, languageName) {
            var found = false;
            for (var i = 0; i < languages.length; i++) {
                if (languages[i].LanguageName === languageName && !languageName.startsWith('select')) {
                    languages[i].NumberOfLanguages += 1;
                    found = true;
                }
            }

            if (found === false && !languageName.startsWith('select')) {
                languages.push({
                    LanguageName: languageName,
                    NumberOfLanguages: 1
                });
            }

            return languages;
        };

        var checkEwayAccessCode = function () {
            var accessCode = ewayService.getQueryParams().AccessCode;
            if (accessCode && $scope.attendeeToPayFor && !$scope.payPalCancelled) {
                $scope.paymentLoading = true;

                ewayService.getAccessCodeResult(accessCode, true).then(function (response) {
                    if (response.incomplete) {
                        $('#payByPayPalModal').modal('show');
                    }
                }).finally(function () {
                    $scope.paymentLoading = false;
                });
            }
        };

        //#endregion

        //#region scope operations
        var populateLanguagesModalData = function () {
            $scope.customerFullName = '';
            $scope.selectedRequestedLanguage = undefined;
            $scope.languagesDropdownText = 'select requested language';
        };

        var attendeeAlreadyRegistered = function (netSuiteClientId) {
            for (var i = 0; i < $scope.allAttendees.length; i++) {
                if ($scope.allAttendees[i].NetSuiteClientId == netSuiteClientId) {
                    return true;
                }
            }

            return false;
        };

        $scope.loadClassRoster = function (forceReload) {
            var data = {
                classOccasionId: window.occasionId,
                forceReload: forceReload,
                isFromHost: window.isFromHost,
                podBaseId: window.podBaseId ? window.podBaseId : 0
            };
            $http.post('/ClassRoster/LoadRoster', data)
                .success(function (data) {
                    populateScopeFromModel(data);
                    initPagination();
                    payPalDataInitialization();
                    populateLanguagesModalData();
                    selectPaymentMethod(null, checkEwayAccessCode, null);
                });
        };

        $scope.showAddAttendeeModal = function () {
            $scope.searchCustomerKeyword = undefined;
            $scope.customers = {};
            $scope.showsSearchCustomerError = false;
            resetErrorMessage();
            $('#addAttendeeModal').modal('show');
        };

        $scope.openRegistrationModal = function () {
            resetErrorMessage();
            $('#addAttendeeModal').modal('hide');
            $('#createAttendeeModal').modal('show');
        };

        $scope.searchCustomers = function () {
            if (!$scope.searchCustomerKeyword || !$scope.searchCustomerKeyword.trim()) {
                $scope.showsSearchCustomerError = true;
                return;
            }

            $http.post('/CustomerSearch/SearchByName',
                { nameKeyword: $scope.searchCustomerKeyword, excludeAdmins: true }).success(function (data) {
                    $scope.customers = data;
                    resetErrorMessage();
                    $scope.disableOtherSelectButtons = false;
                });
            $scope.showsSearchCustomerError = false;
        };

        $scope.selectCustomer = function (customer) {
            $scope.disableOtherSelectButtons = true;
            $('#addAttendeeModal').data('bs.modal').options.backdrop = 'static';
            $scope.currentNetSuiteId = customer.netSuiteId;
            if (customer.isBlacklisted) {
                $scope.errorMessage = window.customerIsBlacklisted;
                $scope.disableOtherSelectButtons = false;
            } else if ($scope.allAttendees && attendeeAlreadyRegistered(customer.netSuiteId) == true) {
                $scope.errorMessage = window.attendeeAlreadyExistsResource;
                $scope.disableOtherSelectButtons = false;
            } else {
                $scope.customerFullName = customer.fullName;
                $scope.netSuiteClientId = customer.netSuiteId;
                $scope.selectedSpokenLanguageName = $scope.selectedSpokenLanguage;
                if ($scope.spokenLanguages.length > 1) {
                    $scope.selectedSpokenLanguage = $scope.spokenLanguage;
                    $scope.requestedSpokenLanguage = undefined;
                    $('#addAttendeeModal').modal('hide');
                    $('#selectLanguagesModal').modal('show');
                } else {
                    customer.selectLoading = true;
                    $scope.registerAttendee(false, customer);
                }
            }
        };

        $scope.openSummaryReport = function () {
            $('#viewLanguagesSummary').modal('show');
        };

        $scope.registerAttendee = function (showLanguagesModal, customer) {
            var requestedLanguageName = '';
            if ($scope.selectedRequestedLanguage !== undefined) {
                requestedLanguageName = $scope.selectedRequestedLanguage.LanguageName;
            }

            $scope.isLoadingEnabled = true;
            $http.post('/ClassRoster/AddCustomerToRoster',
                {
                    netSuiteClientId: $scope.netSuiteClientId,
                    occasionId: $scope.classOccasionId,
                    spokenLanguage: $scope.selectedSpokenLanguage.LanguageName,
                    requestedSpokenLanguage: requestedLanguageName,
                    paymentCompanyCode: $scope.paymentCompany
                }).success(function (data) {
                    $scope.disableOtherSelectButtons = false;
                    if (showLanguagesModal) {
                        $('#selectLanguagesModal').data('bs.modal').options.backdrop = true;
                    }
                    $scope.currentNetSuiteId = 0;
                    if (data.response === undefined) {
                        $scope.isLoadingEnabled = false;
                        if (customer !== undefined)
                        customer.selectLoading = false;
                    }

                    if (data.response.Success) {
                        if (showLanguagesModal) {
                            $('#selectLanguagesModal').modal('hide');
                        }
                        $scope.spokenLanguagesSummary = addLanguagesSummaryReports($scope.spokenLanguagesSummary, $scope.selectedSpokenLanguage.LanguageName);
                        if ($scope.selectedRequestedLanguage !== undefined) {
                            $scope.requestedLanguagesSummary = addLanguagesSummaryReports($scope.requestedLanguagesSummary, $scope.selectedRequestedLanguage.LanguageName);
                        }
                        $scope.estimatedSalesFormatted = data.EstimatedSalesFormatted;
                        $scope.actualSalesFormatted = data.ActualSalesFormatted;
                        updateAttendees(data.response.ClassAttendeeViewModel);
                        $('#addAttendeeModal').modal('hide');
                        $('#createAttendeeModal').modal('hide');
                    } else {
                        if (customer !== undefined)
                        {customer.selectLoading = false;}
                        $scope.errorMessage = data.response.Message;
                    }
                    $scope.isLoadingEnabled = false;
                    $scope.deferred.resolve();
                    $scope.deferred = $q.defer();
                }).error(function () {
                if (customer !== undefined)
                    { customer.selectLoading = false; }

                    $scope.disableOtherSelectButtons = false;
                    $scope.isLoadingEnabled = false;
                    $('#addAttendeeModal').data('bs.modal').options.backdrop = true;
                    $scope.currentNetSuiteId = 0;
                    $scope.deferred.reject();
                    $scope.deferred = $q.defer();
                });
        };

        $scope.addCustomerToRosterAfterCreate = function () {
            if ($scope.spokenLanguages.length > 1) {
                $('#createAttendeeModal').modal('hide');
                $scope.selectedSpokenLanguage = $scope.spokenLanguage;
                $scope.requestedSpokenLanguage = undefined;
                $('#selectLanguagesModal').modal('show');
                $scope.deferred.resolve();
                $scope.deferred = $q.defer();
            } else {
                $scope.registerAttendee(false);
            }

            return $scope.deferred.promise;
        };

        $scope.showAttendeeDetails = function (attendee) {
            attendee.hideComments = !attendee.hideComments;
        };

        $scope.editComment = function (attendant) {
            attendant.oldComment = attendant.FacilitatorComments;
            attendant.editComment = true;
        };

        $scope.cancelEditComment = function (attendant) {
            attendant.editComment = false;
            attendant.FacilitatorComments = attendant.oldComment;
        };

        $scope.saveComment = function (attendant) {
            $http.post('/ClassRoster/SaveComment', {
                classOccasionId: $scope.classOccasionId,
                classRegistrationId: attendant.ClassRegistrationId,
                comment: attendant.FacilitatorComments
            }).success(function () {
                attendant.editComment = false;
            }).error(function () {
                attendant.editComment = false;
            });
        };

        $scope.dropFromClass = function (attendant) {
            $scope.SelectedAttendee = attendant;
            $("#dropAttendeeModal").modal('toggle');
        };

        $scope.dropAttendee = function() {
            $http.post('/ClassRoster/DropAttendee', {
                classOccasionId: $scope.classOccasionId,
                seminarAttendanceId: $scope.SelectedAttendee.SeminarAttendanceId
            }).success(function (response) {
                if (response.Success) {
                    $scope.allAttendees = _.filter($scope.allAttendees, function (a) {
                        return a.SeminarAttendanceId !== $scope.SelectedAttendee.SeminarAttendanceId;
                    });
                    $scope.estimatedSalesFormatted = response.EstimatedSalesFormatted;
                    $scope.actualSalesFormatted = response.ActualSalesFormatted;
                    $scope.filteredAttendees = $scope.allAttendees;
                    $scope.totalPages = Math.ceil($scope.filteredAttendees.length / $scope.itemsPerPage);
                    if ($scope.totalPages < $scope.currentPage) $scope.currentPage = $scope.totalPages;
                    $scope.searchKeywordChanged();
                    $scope.goToPage($scope.currentPage);
                    $scope.spokenLanguagesSummary = deleteLanguagesSummaryReports($scope.spokenLanguagesSummary, response.SpokenLanguage);
                    if (response.RequestedSpokenLanguage !== undefined && response.RequestedSpokenLanguage !== '') {
                        $scope.requestedLanguagesSummary = deleteLanguagesSummaryReports($scope.requestedLanguagesSummary, response.RequestedSpokenLanguage);
                    }
                } else {
                    document.getElementById("errorModalBody").innerHTML = response.Message;
                    $("#errorModal").modal('toggle');
                }
            });
        }

        $scope.markAsAttended = function (attendant) {
            $scope.selectedCheckIn = attendant;
            $("#checkInModal").modal('toggle');
        };

        $scope.markAttendee = function() {
            $scope.selectedCheckIn.attending = true;
            $http.post('/ClassCheckIn/MarkAsAttended', {
                classOccasionId: $scope.classOccasionId,
                seminarAttendanceId: $scope.selectedCheckIn.SeminarAttendanceId
            }).success(function (response) {
                $scope.selectedCheckIn.attending = false;
                if (response.Success) {
                    $scope.selectedCheckIn.SeminarAttendanceStatus = 'Attended';
                    countPresent();
                    $scope.estimatedSalesFormatted = response.EstimatedSalesFormatted;
                    $scope.actualSalesFormatted = response.ActualSalesFormatted;
                } else {
                    document.getElementById("errorModalBody").innerHTML = response.Message;
                    $("#errorModal").modal('toggle');
                }
            }).error(function () {
                $scope.selectedCheckIn.attending = false;
            });
        }

        $scope.showPaymentOptions = function (attendee) {
            $scope.paymentErrorMessage = '';
            $scope.attendeeToPayFor = attendee;
            $scope.partialAmountToPay = 0;
            $('#paymentMethodModal').modal('show');
        };

        $scope.payByCreditCard = function () {
            if (validatePartialAmount()) {
                $scope.paymentSuccess = false;
                $scope.paymentErrorMessage = '';
                $scope.paymentModel.data = {};
                $scope.paymentModel.errorMessage = '';
                $scope.isEuroPayment = $scope.attendeeToPayFor.Currency === 'EUR';
                $scope.isElLugarPayment = $scope.paymentCompany === "ELG";
                $scope.isAffPayment = $scope.paymentCompany === "AFF";
                initStripeElements($scope.isEuroPayment, $scope.isElLugarPayment, $scope.isAffPayment);
                $rootScope.$emit('clearPayByCCModel');
                $('#paymentMethodModal').modal('hide');
                $('#payByCreditCardModal').modal('show');
            }
        };

        $scope.setPayPal = function () {
            if (validatePartialAmount()) {
                $scope.isLoadingEnabledForPayPal = true;
                selectPaymentMethod(setCybersourcePayPal, setEwayPayPal,
                    setEuroPayPal, setElLugarPayPal, setAffPayPal);
            }
        };

        var setCybersourcePayPal = function () {
            $http.post('/ClassRoster/SetPayPal', {
                netSuiteClientId: $scope.attendeeToPayFor.NetSuiteClientId,
                seminarAttendanceId: $scope.attendeeToPayFor.SeminarAttendanceId,
                occasionId: $scope.classOccasionId,
                partialAmountToPay: $scope.partialAmountToPay,
                isFromHost: window.isFromHost,
                podBaseId: window.podBaseId ? window.podBaseId : 0
            }).success(function (response) {
                if (response.Success) {
                    $window.location.href = response.redirectUrl;
                } else {
                    $scope.partialPaymentAmountErrorMessage = response.Message;
                    $scope.isLoadingEnabledForPayPal = false;
                }
            }).error(function () {
                $scope.partialPaymentAmountErrorMessage = 'An error occurred. Please try again.';
                $scope.isLoadingEnabledForPayPal = false;
            });
        };

        var setEwayPayPal = function () {
            ewayService.buildPayPalForm($scope.partialAmountToPay,
                $scope.attendeeToPayFor.Currency,
                $scope.attendeeToPayFor.SeminarAttendanceId,
                $scope.classOccasionId,
                window.isFromHost,
                window.podBaseId)
                .then(function (form) {
                    document.body.appendChild(form);
                    form.submit();
                },
                    function (error) {
                        $scope.partialPaymentAmountErrorMessage = error || 'An error occurred. Please try again.';
                        $scope.isLoadingEnabledForPayPal = false;
                    });
        };

        var setPayPalForStripe = function () {
            payPalService.setCheckInPayPal($scope.partialAmountToPay,
                $scope.attendeeToPayFor.SeminarAttendanceId,
                $scope.classOccasionId,
                window.isFromHost,
                window.podBaseId,
                $scope.isEuroPayment, $scope.isElLugarPayment, $scope.isAffPayment)
                .then(function (response) {
                    if (response.success) {
                        $window.location.href = response.redirectUrl;
                    } else {
                        $scope.partialPaymentAmountErrorMessage = response.message;
                        $scope.isLoadingEnabledForPayPal = false;
                    }
                })
                .catch(function (error) {
                    $scope.partialPaymentAmountErrorMessage = error;
                    $scope.isLoadingEnabledForPayPal = false;
                });
        };

        var setEuroPayPal = function () {
            setPayPalForStripe();
        };

        var setElLugarPayPal = function () {
            setPayPalForStripe();
        };

        var setAffPayPal = function () {
            setPayPalForStripe();
        };

        $scope.payByCheckOrCash = function () {
            if (validatePartialAmount()) {
                $scope.paymentSuccess = false;
                $scope.paymentModel.data = {};
                $('#paymentMethodModal').modal('hide');
                $('#payByCheckOrCashModal').modal('show');
            }
        };

        $scope.checkPrerequisites = function (attendant) {
            attendant.isCheckingPrerequisites = true;
            $http.post('/ClassRoster/CheckPrerequisites',
                {
                    occasionId: $scope.classOccasionId,
                    netSuiteClientId: attendant.NetSuiteClientId,
                    needToCheckStorePrerequisites: attendant.NeedToCheckStorePrerequisites
                }).success(function (response) {
                    attendant.isCheckingPrerequisites = false;
                    attendant.PrerequisitesRequired = response;
                }).error(function () {
                    attendant.isCheckingPrerequisites = false;
                });
        };

        var processSuccess = function (modalId, dueAmountFormatted) {
            $scope.paymentLoading = false;
            $scope.paymentSuccess = true;
            $scope.attendeeToPayFor.AmountDue = $scope.attendeeToPayFor.AmountDue - $scope.partialAmountToPay;
            if (dueAmountFormatted !== undefined) {
                $scope.attendeeToPayFor.AmountDueFormatted = dueAmountFormatted;
            }
            $scope.attendeeToPayFor.HasAmountDue = $scope.attendeeToPayFor.AmountDue > 0;
            $scope.paymentModel.data = {};

            var $bsModal = $(modalId).data('bs.modal');
            if ($bsModal) {
                $bsModal.options.backdrop = true;
            }
            $(modalId).modal('hide');
            $('#paymentSuccessModal').modal('show');
        };

        var processError = function (modalId, error) {
            $scope.paymentLoading = false;
            $scope.paymentSuccess = false;

            if (error && error.error) {
                $scope.paymentErrorMessage = error.error.message;
            } else {
                if (error && error.message) {
                    $scope.paymentErrorMessage = error.message;
                } else {
                    $scope.paymentErrorMessage = error;
                }
            }
            $(modalId).data('bs.modal').options.backdrop = true;
        };

        var onRequestError = function (modalId) {
            $scope.paymentLoading = false;
            $(modalId).data('bs.modal').options.backdrop = true;
            $scope.paymentSuccess = false;
        };

        $scope.submitPayByCreditCard = function (data) {
            $scope.paymentLoading = true;
            selectPaymentMethod(submitCybersourceCreditCard, submitEwayCreditCard,
                submitEuroCreditCard, submitElLugarCreditCard, submitAffCreditCard, data.data);
        };

        var submitCybersourceCreditCard = function (creditCardModel) {
            $scope.paymentLoading = true;
            $('#payByCreditCardModal').data('bs.modal').options.backdrop = 'static';
            $http.post('/ClassRoster/PayForClassByCreditCard', {
                netSuiteClientId: $scope.attendeeToPayFor.NetSuiteClientId,
                seminarAttendanceId: $scope.attendeeToPayFor.SeminarAttendanceId,
                occasionId: $scope.classOccasionId,
                paymentModel: creditCardModel,
                partialAmountToPay: $scope.partialAmountToPay
            }).success(function (response) {
                if (response.response.Success) {
                    processSuccess('#payByCreditCardModal', response.dueAmountFormatted);
                } else {
                    processError('#payByCreditCardModal', response.response.Message);
                }
            }).error(function () {
                onRequestError('#payByCreditCardModal');
            });
        };

        var submitEwayCreditCard = function (ccModel) {
            ewayService.submitPayment($scope.partialAmountToPay,
                $scope.attendeeToPayFor.Currency,
                ccModel,
                $scope.attendeeToPayFor.SeminarAttendanceId,
                $scope.classOccasionId,
                $scope.attendeeToPayFor.NetSuiteClientId)
                .then(function (response) {
                    processSuccess("#payByCreditCardModal", response.dueAmountFormatted);
                }).catch(function (error) {
                    processError("#payByCreditCardModal", error);
                });
        };

        var submitStripeCreditCard = function (ccModel, isEuroPayment, isElLugarPayment, isAffPayment) {
            $scope.intermitentCcModel = ccModel;
            $scope.creditCardHolderName = ccModel.NameOnCard;
            stripeService.submitPayment(ccModel,
                $scope.partialAmountToPay,
                $scope.attendeeToPayFor.Currency,
                null,
                $scope.attendeeToPayFor.NetSuiteClientId,
                $scope.attendeeToPayFor.SeminarAttendanceId,
                $scope.classOccasionId,
                isEuroPayment,
                isElLugarPayment,
                isAffPayment)
                .then(function (response) {
                    executeStripeHandleCardPayment(response);
                }).catch(function (error) {
                    processError("#payByCreditCardModal", error);
                });
        };

        var submitEuroCreditCard = function (ccModel) {
            submitStripeCreditCard(ccModel, true, false, false);
        };

        var submitElLugarCreditCard = function (ccModel) {
            submitStripeCreditCard(ccModel, false, true, false);
        };

        var submitAffCreditCard = function (ccModel) {
            submitStripeCreditCard(ccModel, false, false, true);
        };

        var executeStripeHandleCardPayment = function (response) {
            if (!response.success) {
                processError("#payByCreditCardModal", response);
                return;
            }

            var cardholderName = $scope.creditCardHolderName;
            var cardElement = $scope.cardElement;
            var stripe = $scope.stripe;
            stripeService.handleCardPayment(response.clientSecret, cardElement, cardholderName, stripe)
                .then(function (response) {
                    stripeIntermitentStep();
                })
                .catch(function (error) {
                    processError("#payByCreditCardModal", error);
                });
        };

        var stripeIntermitentStep = function () {
            var data = {
                amountToPay: $scope.partialAmountToPay,
                cardModel: $scope.intermitentCcModel,
                netSuiteClientId: $scope.attendeeToPayFor.NetSuiteClientId,
                seminarAttendanceId: $scope.attendeeToPayFor.SeminarAttendanceId,
                occasionId: $scope.classOccasionId
            }

            stripeService.setNetSuitePaymentRoster(data).then(function (response) {
                if (response.success) {
                    processSuccess("#payByCreditCardModal", response.dueAmountFormatted);
                }
            });
        };

        $scope.submitPayCashOrWithCheck = function () {
            $scope.paymentLoading = true;
            $('#payByCheckOrCashModal').data('bs.modal').options.backdrop = 'static';
            $http.post('/ClassRoster/PayForClassByCheckOrCash',
                {
                    netSuiteClientId: $scope.attendeeToPayFor.NetSuiteClientId,
                    seminarAttendanceId: $scope.attendeeToPayFor.SeminarAttendanceId,
                    occasionId: $scope.classOccasionId,
                    checkNumber: $scope.checkNumber,
                    partialAmountToPay: $scope.partialAmountToPay
                }).success(function (response) {
                    if (response.response.Success) {
                        processSuccess('#payByCheckOrCashModal', response.dueAmountFormatted);
                    } else {
                        processError('#payByCheckOrCashModal', response.response.Message);
                    }
                }).error(function () {
                    onRequestError('#payByCheckOrCashModal');
                });
        };

        $scope.submitPayPal = function () {
            $scope.paymentLoading = true;
            $('#payByPayPalModal').data('bs.modal').options.backdrop = 'static';
            selectPaymentMethod(submitCybersourcePayPal, submitEwayPayPal, submitEuroPayPal,
                submitElLugarPayPal, submitAffPayPal);
        };

        var submitCybersourcePayPal = function () {
            $http.post('/ClassRoster/PayForClassByPayPal',
                {
                    netSuiteClientId: $scope.attendeeToPayFor.NetSuiteClientId,
                    seminarAttendanceId: $scope.attendeeToPayFor.SeminarAttendanceId,
                    occasionId: $scope.classOccasionId,
                    payerId: window.payerId,
                    partialAmountToPay: $scope.partialAmountToPay
                }).success(function (response) {
                    if (response.response.Success) {
                        processSuccess('#payByPayPalModal', response.dueAmountFormatted);
                    } else {
                        processError('#payByPayPalModal', response.response.Message);
                    }
                    $scope.partialAmountToPay = 0;
                }).error(function () {
                    onRequestError('#payByPayPalModal');
                });
        };

        var submitEwayPayPal = function () {
            var accessCode = ewayService.getQueryParams().AccessCode;
            ewayService.confirmPayPalPayment(accessCode)
                .then(function () {
                    return ewayService.sendPayment(accessCode,
                        true,
                        null,
                        $scope.attendeeToPayFor.NetSuiteClientId,
                        $scope.attendeeToPayFor.SeminarAttendanceId,
                        $scope.classOccasionId,
                        $scope.partialAmountToPay);
                })
                .then(function (response) {
                    processSuccess('#payByPayPalModal', response.dueAmountFormatted);
                })
                .catch(function (error) {
                    processError('#payByPayPalModal', error);
                });
        };

        var submitPayPalForStripe = function () {
            payPalService.submitCheckInPayPal(
                $scope.attendeeToPayFor.NetSuiteClientId,
                $scope.attendeeToPayFor.SeminarAttendanceId,
                $scope.classOccasionId,
                $scope.partialAmountToPay,
                window.paymentId,
                window.payerId,
                $scope.isEuroPayment, $scope.isElLugarPayment, $scope.isAffPayment)
                .then(function (response) {
                    processSuccess('#payByPayPalModal', response.dueAmountFormatted);
                })
                .catch(function (error) {
                    processError('#payByPayPalModal', error);
                });
        };

        var submitEuroPayPal = function () {
            submitPayPalForStripe();
        };

        var submitElLugarPayPal = function () {
            submitPayPalForStripe();
        };

        var submitAffPayPal = function () {
            submitPayPalForStripe();
        };

        $scope.dateValid = function () {
            var oneDay = 24 * 60 * 60 * 1000;
            var startDate = new Date($scope.classStartDateTime);
            var currentDate = new Date();
            var diffDays = (startDate.getTime() - currentDate.getTime()) / (oneDay);
            return diffDays > 1;
        };

        $scope.showAddButton = function () {
            if ($scope.medium === 'Live' && $scope.capacity > 0 && $scope.allAttendees) {
                return $scope.capacity > $scope.allAttendees.length;
            }
            return true;
        };

        $scope.goToPage = function (pageNo) {
            if (pageNo < 1 || pageNo > $scope.totalPages) return;
            $scope.currentPage = pageNo;
            $scope.paginatedAttendees =
                $scope.filteredAttendees.slice((pageNo - 1) * $scope.itemsPerPage, $scope.filteredAttendees.length);
        };

        $scope.searchKeywordChanged = function () {
            if ($scope.searchKeyword) {
                $scope.filteredAttendees = _.filter($scope.allAttendees,
                    function (attendee) {
                        return attendee.Name.toLowerCase().indexOf($scope.searchKeyword.toLowerCase()) > -1;
                    }
                );
            } else {
                $scope.filteredAttendees = $scope.allAttendees;
            }
            $scope.totalPages = Math.ceil($scope.filteredAttendees.length / $scope.itemsPerPage);
            $scope.goToPage(1);
        };

        var selectPaymentMethod = function (usdCallBack, audCallBack, euroCallBack,
            elLugarCallBack, affCallBack, data) {
            switch ($scope.paymentCompany) {
                case "AC":
                    if (usdCallBack) usdCallBack(data);
                    break;

                case "ASA":
                    if (audCallBack) audCallBack(data);
                    break;

                case "ACI":
                    if (euroCallBack) euroCallBack(data);
                    break;

                case "ELG":
                    if (elLugarCallBack) elLugarCallBack(data);
                    break;
                case "AFF":
                    if (affCallBack) affCallBack(data);
                    break;

                default:
                    selectPaymentMethodOnCurrency(usdCallBack, audCallBack, euroCallBack,
                        elLugarCallBack, affCallBack, data);
                    break;
            }
        };

        var selectPaymentMethodOnCurrency = function (usdCallBack, audCallBack, euroCallBack,
            elLugarCallBack, affCallBack, data) {
            if ($scope.attendeeToPayFor && $scope.attendeeToPayFor.Currency === 'USD' && usdCallBack)
                usdCallBack(data);

            if ($scope.attendeeToPayFor && $scope.attendeeToPayFor.Currency === 'AUD' && audCallBack)
                audCallBack(data);

            if ($scope.attendeeToPayFor && $scope.attendeeToPayFor.Currency === 'EUR' && euroCallBack)
                euroCallBack(data);

            if ($scope.attendeeToPayFor && $scope.attendeeToPayFor.Currency === 'USD' && elLugarCallBack)
                elLugarCallBack(data);

            if ($scope.attendeeToPayFor && $scope.attendeeToPayFor.Currency === 'EUR' && affCallBack)
                affCallBack(data);
        };

        var initStripeElements = function (isEuroPayment, isElLugarPayment, isAffPayment) {
            $(document).ready(function () {
                setTimeout(function () {
                    if (isAffPayment) {
                        $scope.stripe = Stripe($window.AffStripeKey);
                    } else if (isElLugarPayment) {
                        $scope.stripe = Stripe($window.ElLugarStripeKey);
                    } else if (isEuroPayment) {
                        $scope.stripe = Stripe($window.StripeKey);
                    }

                    var elements = $scope.stripe.elements();
                    $scope.cardElement = elements.create('card', { hidePostalCode: true });
                    $scope.cardElement.mount('#card-element');
                    $scope.cardElement.on('change',
                        function (event) {
                            $scope.cardInvalid = !event.complete;
                        });
                },
                    500);
            });
        };

        $scope.openLicenseFeesModal = function () {
            $('#createLicenseFeesRequestModal').modal('show');
        }

        $scope.createLicenseFeesSalesOrder = function (facilitator) {
            if (!facilitator || facilitator.LicenseFees <= 0)
                return;

            $scope.createLicenseFeeLoading = true;

            $http.post('/ClassRoster/CreateLicenseFee',
                {
                    occasionId: $scope.classOccasionId,
                    contactId: facilitator.ContactId,
                    amount: facilitator.LicenseFees
                }).success(function (data) {
                    if (data.Success) {
                        $scope.loadClassRoster(true);
                        $scope.createLicenseFeeLoading = false;
                        $('#createLicenseFeesRequestModal').modal('hide');
                    }
                }).error(function () {
                    $scope.createLicenseFeeLoading = false;
                });
        }

        //#endregion

        //#region initialization
        $scope.currentPage = 1;
        $scope.dataLoaded = false;
        $scope.paymentModel = {};
        resetErrorMessage();
        $scope.loadClassRoster(false);
        $scope.isEuroPayment = false;
        $scope.isElLugarPayment = false;
        $scope.showLicenseFees = false;
        //#endregion
    }
]);;
AccessConsciousness.appModule.controller("digitalDownloadsController", [
    "$scope", "digitalDownloadsService",

    function ($scope, digitalDownloadsService) {

        var initView = function () {
            digitalDownloadsService.loadDigitalDownloads(0).then(function (response) {
                if (response.success) {
                    $scope.digitalDownloads = [];
                    $scope.chunkNumber = 0;
                    $scope.currentLoadingNumber = 10;
                    $scope.salesOrdersLength = response.salesOrdersLength;
                    if (response.digitalDownloads.length < 10 && $scope.salesOrdersLength > 10) {
                        $scope.tempDigitalDownloads = response.digitalDownloads;
                        $scope.loadMore();
                    } else {
                        $scope.digitalDownloads = response.digitalDownloads;
                        initExpanseStatus();
                        $scope.finishedLoading = true;
                    }
                }
            });
        };

        $scope.loadMore = function () {
            if ($scope.currentLoadingNumber >= $scope.salesOrdersLength) {
                if ($scope.tempDigitalDownloads) {
                    $scope.digitalDownloads = $scope.digitalDownloads.concat($scope.tempDigitalDownloads);
                }

                for (var i = 0; i < $scope.digitalDownloads.length; i++) {
                    $scope.digitalDownloads.Expanded = false;
                }
                $scope.finishedLoading = true;

                return;
            }

            $scope.chunkNumber = $scope.chunkNumber + 1;
            $scope.currentLoadingNumber = $scope.currentLoadingNumber + 10;
            digitalDownloadsService.loadDigitalDownloads($scope.chunkNumber).then(function (response) {
                if (response.success) {
                    if ($scope.tempDigitalDownloads) {
                        $scope.tempDigitalDownloads = $scope.tempDigitalDownloads.concat(response.digitalDownloads);
                    } else {
                        $scope.tempDigitalDownloads = response.digitalDownloads;
                    }

                    if ($scope.tempDigitalDownloads.length < 10) {
                        $scope.loadMore();
                    } else {
                        $scope.digitalDownloads = $scope.digitalDownloads.concat($scope.tempDigitalDownloads);
                        $scope.tempDigitalDownloads = null;
                        for (var i = 0; i < $scope.digitalDownloads.length; i++) {
                            $scope.digitalDownloads.Expanded = false;
                        }
                    }
                }
            });
        };

        $scope.expand = function (digitalDownload) {
            digitalDownload.Expanded = true;
        };

        $scope.collapse = function (digitalDownload) {
            digitalDownload.Expanded = false;
        };

        var initExpanseStatus = function () {
            for (var i = 0; i < $scope.digitalDownloads.length; i++) {
                $scope.digitalDownloads[i].Expanded = false;
            }
        }

        initView();
    }
]);;
"use strict";

AccessConsciousness.appModule.factory("digitalDownloadsService", [
    "$http", "$q",
    function ($http, $q) {
        var loadDigitalDownloads = function (chunkNumber) {
            var deferred = $q.defer();
            $http.post("/DigitalDownloadsBlock/GetDigitalDownloads", { chunkNumber: chunkNumber })
                .success(function (data) {
                    deferred.resolve(data);
                });

            return deferred.promise;
        }

        return {
            loadDigitalDownloads: loadDigitalDownloads
        }
    }
]);;
AccessConsciousness.appModule.controller("membershipsController", [
    "$scope", "membershipsService",

    function ($scope, membershipsService) {

        $scope.toggleUnsubscribeModal = function (membership) {
            $("#unsubscribeMembershipModal").modal('toggle');
            $scope.selectedMembership = membership;
        }

        $scope.unsubscribe = function () {
            if ($scope.selectedMembership) {
                membershipsService.unsubscribe($scope.selectedMembership).then(function (response) {
                    if (response.success) {
                        var index = -1;
                        for (var i = 0; i < $scope.memberships.length; i++) {
                            if ($scope.memberships[i].Id === response.membership.Id) {
                                index = i;
                                break;
                            }
                        }

                        if (index >= 0) {
                            $scope.memberships[index] = response.membership;
                        }
                    }
                });
            }
        }

        var initView = function () {
            membershipsService.getCustomerMemberships().then(function (response) {
                if (response.success) {
                    $scope.memberships = response.memberships;
                }
            });
        }

        $scope.toggleModal = function (paymentPlanId, productUrl) {
            $("#updateMembershipCreditCardModal").modal('toggle');
            $scope.selectedPaymentPlanId = paymentPlanId;
            $scope.selectedProductUrl = productUrl;
        }

        $scope.updateCreditCard = function () {
            if ($scope.selectedPaymentPlanId && $scope.selectedProductUrl) {
                membershipsService.updateCreditCardSubscription($scope.selectedPaymentPlanId)
                    .then(function (response) {
                        if (response.success) {
                            window.location.replace($scope.selectedProductUrl);
                        } else {
                            location.reload();
                        }
                    });
            }
        }

        initView();
    }
]);;
"use strict";
AccessConsciousness.appModule.directive('price', [function () {
    return {
        require: 'ngModel',
        link: function (scope, element, attrs, ngModel) {
            attrs.$set('ngTrim', "false");
            var minVal, maxVal;
            var isDefined = angular.isDefined;
            var isUndefined = angular.isUndefined;
            var isNumber = angular.isNumber;

            var formatter = function (str, isNum) {
                str = String(Number(str || 0) / (isNum ? 1 : 100));
                str = (str == '0' ? '0.0' : str).split('.');
                str[1] = str[1] || '0';
                return str[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,') + '.' + (str[1].length == 1 ? str[1] + '0' : str[1]);
            }

            var updateView = function (val) {
                scope.$applyAsync(function () {
                    if (val == "")
                        val = "0.00";
                    ngModel.$setViewValue(val || '');
                    ngModel.$render();
                });
            }

            var parseNumber = function (val) {
                var modelString = formatter(ngModel.$modelValue, true);

                if (!val || ngModel.$modelValue && Number(val) === 0) {
                    var newVal = (!val || ngModel.$modelValue && Number() === 0 ? '' : val);
                    if (ngModel.$modelValue !== newVal)
                        updateView(newVal);
                    return '';
                }
                else {
                    var valString = String(val || '');
                    var newVal = valString.replace(/[^0-9]/g, '');
                    var viewVal = formatter(angular.copy(newVal));

                    if (modelString !== valString)
                        updateView(viewVal);

                    return (Number(newVal) / 100) || 0;
                }
            }
            var formatNumber = function (val) {
                if (val) {
                    var str = String(val).split('.');
                    str[1] = str[1] || '0';
                    val = str[0] + '.' + (str[1].length == 1 ? str[1] + '0' : str[1]);
                }
                return parseNumber(val);
            }

            ///Max validation
            if (isDefined(attrs.max) || attrs.ngMax) {
                ngModel.$validators.max = function (value) {
                    return ngModel.$isEmpty(value) || isUndefined(maxVal) || value <= maxVal;
                };
                attrs.$observe('max', function (val) {
                    if (isDefined(val) && !isNumber(val)) {
                        val = parseFloat(val, 10);
                    }
                    maxVal = isNumber(val) && !isNaN(val) ? val : undefined;
                    ngModel.$validate();
                });
            }

            // Min validation
            ngModel.$validators.min = function (value) {
                return ngModel.$isEmpty(value) || isUndefined(minVal) || value >= minVal;
            };
            if (isDefined(attrs.min) || attrs.ngMin) {
                attrs.$observe('min', function (val) {
                    if (isDefined(val) && !isNumber(val)) {
                        val = parseFloat(val, 10);
                    }
                    minVal = isNumber(val) && !isNaN(val) ? val : undefined;
                    ngModel.$validate();
                });
            } else {
                minVal = 0;
            }
            ngModel.$parsers.push(parseNumber);
            ngModel.$formatters.push(formatNumber);
        }
    };
}]);

;
"use strict";

AccessConsciousness.appModule.factory("membershipsService", [
    "$http", "$q",
    function ($http, $q) {

        var getCustomerMemberships = function () {
            var deferred = $q.defer();

            $http.post("/MembershipsBlock/GetCustomerMemberships")
                .success(function (data) {
                    deferred.resolve(data);
                });

            return deferred.promise;
        }

        var unsubscribe = function (membership) {
            var deferred = $q.defer();

            $http.post("/MembershipsBlock/Unsubscribe", membership)
                .success(function (data) {
                    deferred.resolve(data);
                });

            return deferred.promise;
        }

        var updateCreditCardSubscription = function (paymentPlanId) {
            var deferred = $q.defer();

            $http.post("/MembershipsBlock/UpdateCreditCardSubscription", { paymentPlanId: paymentPlanId })
                .success(function (data) {
                    deferred.resolve(data);
                });

            return deferred.promise;
        }

        return {
            getCustomerMemberships: getCustomerMemberships,
            unsubscribe: unsubscribe,
            updateCreditCardSubscription: updateCreditCardSubscription
        }
    }
]);;
"use strict";

AccessConsciousness.appModule.controller("resetPasswordController", [
    "$scope", "$http", "$window", "loginService",
    function ($scope, $http, $window, loginService) {

        $scope.init = function (token, notmachMessage) {
            $scope.token = token;
            $scope.notmachMessage = notmachMessage;
            $scope.showSuccess = false;
        }
        $scope.resetPassword = function () {
            $scope.isLoadingEnabled = true;
            $scope.errorMessage = "";
            if ($scope.password != $scope.confirmPassword) {
                $scope.errorMessage = $scope.notmachMessage;
                $scope.isLoadingEnabled = false;
                return;
            }

            $http.post("/resetpassword/ResetPassword", {
                newPassword: $scope.password, token: $scope.token
            }).success(function (data) {
                $scope.errorMessage = data.errorMessage;
                $scope.showSuccess = data.success;
                if (data.success) {
                    loginService.login(data.model)
                        .then(function (response) {
                            if (!response.success) {
                                $scope.errorMessage = response.errorMessage;
                                $scope.isLoadingEnabled = false;
                            } else {
                                if (response.redirectUrl != "") {
                                    $window.location.href = response.redirectUrl;
                                } else {
                                    $window.location.reload();
                                }
                            }
                        });
                }
            });
            $scope.isLoadingEnabled = false;
        }
    }
]);;
"use strict";

AccessConsciousness.appModule.factory("ewayService", [
    "$http", "$q", "$sce", "endpoint",
    function ($http, $q, $sce, endpoint) {

        var processPayment = function (form) {
            var deferred = $q.defer();

            if (window.eWAY) {
                var params = {
                    autoRedirect: false,
                    onComplete: deferred.resolve,
                    onError: function () {
                        // runs on script load error; does not run if invalid data provided
                        deferred.reject('There was an error processing the request.');
                    },
                    onTimeout: function () {
                        deferred.reject('The request has timed out.');
                    }
                }

                window.eWAY.process(form, params);
            } else {
                deferred.reject('Could not find eWAY script.');
            }

            return deferred.promise;
        }

        var createAccessCode = function (amountToPay, currency, isPayPal, cardModel, isFromHost,
            seminarAttendanceId, occasionId, podBaseId) {

            var deferred = $q.defer();
            var data = {
                amountToPay: amountToPay,
                currency: currency,
                isPayPal: isPayPal,
                cardModel: cardModel,
                seminarAttendanceId: seminarAttendanceId,
                occasionId: occasionId,
                isFromHost: isFromHost,
                podBaseId: podBaseId ? podBaseId : 0
            };

            localStorage.removeItem("formActionUrl");

            var isCheckinRequest = isFromHost !== undefined &&
                seminarAttendanceId !== undefined &&
                occasionId !== undefined;

            var url = isCheckinRequest ? endpoint.CREATE_CHECKIN_ACCESS_CODE : endpoint.CREATE_CHECKOUT_ACCESS_CODE;

            $http.post(url, data)
                .success(function (response) {
                    if (isPayPal)
                        localStorage.setItem("formActionUrl", response.formActionUrl);
                    deferred.resolve(response);
                });
            return deferred.promise;
        }

        var getAccessCodeResult = function (accessCode, isPayPal, isPaymentSubmit) {
            var deferred = $q.defer();
            var data = {
                accessCode: accessCode,
                isPayPal: isPayPal
            };

            $http.post(endpoint.ACCESS_CODE_RESULT, data)
                .success(function (response) {
                    if (response.success || (response.incomplete && !isPaymentSubmit)) {
                        deferred.resolve(response);
                    } else {
                        deferred.reject(response.message);
                    }
                });
            return deferred.promise;
        }

        var sendPayment = function (accessCode, isPayPal, cardData, clientId, seminarAttendanceId, occasionId, amountToPay) {
            var deferred = $q.defer();
            var data = {
                accessCode: accessCode,
                netSuiteClientId: clientId,
                seminarAttendanceId: seminarAttendanceId,
                occasionId: occasionId,
                amountToPay: amountToPay,
                isPayPal: isPayPal,
                cardModel: cardData
            };

            var isCheckinRequest = clientId !== undefined &&
                seminarAttendanceId !== undefined &&
                occasionId !== undefined &&
                amountToPay !== undefined;

            var url = isCheckinRequest ? endpoint.SUBMIT_CHECKIN_AUD_PAYMENT : endpoint.SUBMIT_CHECKOUT_AUD_PAYMENT;

            $http.post(url, data)
                .success(function (response) {
                    if (response.success) {
                        deferred.resolve(response);
                    } else {
                        deferred.reject(response.message);
                    }
                });
            return deferred.promise;
        }

        var createInput = function (name, value) {
            var input = document.createElement("input");
            input.setAttribute('type', "text");
            input.setAttribute('name', name);
            input.value = value;
            return input;
        }

        var buildSubmitForm = function (url, accessCode, cardData) {
            var form = document.createElement('form');
            form.setAttribute('method', 'post');
            form.action = url;
            form.appendChild(createInput('EWAY_ACCESSCODE', accessCode));
            form.appendChild(createInput('EWAY_CARDNAME', cardData.NameOnCard));
            form.appendChild(createInput('EWAY_CARDNUMBER', cardData.CardNumber));
            form.appendChild(createInput('EWAY_CARDEXPIRYMONTH', cardData.CardExpirationMonth));
            form.appendChild(createInput('EWAY_CARDEXPIRYYEAR', cardData.CardExpirationYear));
            form.appendChild(createInput('EWAY_CARDCVN', cardData.CVV));
            return form;
        }

        var getPayPalForm = function (url, accessCode) {
            var form = document.createElement('form');
            form.setAttribute('method', 'post');
            form.action = $sce.trustAsResourceUrl(url);
            form.appendChild(createInput('EWAY_ACCESSCODE', accessCode));
            form.appendChild(createInput('EWAY_PAYMENTTYPE', 'PayPal'));
            return form;
        }

        var buildPayPalForm = function (amountToPay, currency, seminarAttendanceId, occasionId, isFromHost, podBaseId) {
            var deferred = $q.defer();
            createAccessCode(amountToPay, currency, true, null, isFromHost, seminarAttendanceId, occasionId, podBaseId).then(function (response) {
                if (response.errors) {
                    deferred.reject(response.errors);
                } else {
                    var form = getPayPalForm(response.formActionUrl, response.accessCode);
                    deferred.resolve(form);
                }
            }, deferred.reject);

            return deferred.promise;
        }

        var submitPayment = function (amountToPay, currency, cardData, seminarAttendanceId, occasionId, clientId) {
            var deferred = $q.defer();

            createAccessCode(amountToPay, currency, false, cardData, false, seminarAttendanceId, occasionId)
                .then(function (accessCodeData) {
                    if (accessCodeData.errors) {
                        deferred.reject(accessCodeData.errors);
                    } else {
                        var url = $sce.trustAsResourceUrl(accessCodeData.formActionUrl);
                        var form = buildSubmitForm(url, accessCodeData.accessCode, cardData);
                        processPayment(form).then(function (paymentResult) {
                            if (paymentResult.IsComplete) {
                                sendPayment(paymentResult.AccessCode, false, cardData, clientId, seminarAttendanceId, occasionId, amountToPay)
                                    .then(function (accessCodeResult) {
                                        if (accessCodeResult.success) {
                                            deferred.resolve(accessCodeResult.message);
                                        } else {
                                            deferred.reject(accessCodeResult.message);
                                        }
                                    },
                                    deferred.reject);
                            } else {
                                deferred.reject(paymentResult.Errors);
                            }
                        },
                            deferred.reject);
                    }
                }, deferred.reject);

            return deferred.promise;
        }

        var confirmPayPalPayment = function (accessCode) {
            var deferred = $q.defer();
            var url = localStorage.getItem("formActionUrl");
            var form = getPayPalForm(url, accessCode);
            var params = {
                autoRedirect: false,
                onComplete: deferred.resolve,
                onError: deferred.resolve,
                onTimeout: deferred.resolve
            };

            window.eWAY.process(form, params);

            return deferred.promise;
        }

        var getQueryParams = function () {
            var params = {};
            var queryPoint = window.location.href.indexOf('?') + 1;
            if (queryPoint > 0) {
                var hashes = window.location.href.slice(queryPoint).split('&');
                for (var i = 0; i < hashes.length; i++) {
                    var index = hashes[i].indexOf('=');
                    if (index > 0) {
                        params[hashes[i].substring(0, index)] = hashes[i].substring(index + 1);
                    }
                }
            }
            // AngularJS removes the == at the end of the AccessCode in the Url. Those need to be added back for the other requests to be validated. The AccessCode is not complete without them.
            if (params.AccessCode)
                params.AccessCode = params.AccessCode + "==";
            return params;
        }

        return {
            submitPayment: submitPayment,
            sendPayment: sendPayment,
            buildPayPalForm: buildPayPalForm,
            getAccessCodeResult: getAccessCodeResult,
            getQueryParams: getQueryParams,
            confirmPayPalPayment: confirmPayPalPayment
        };
    }
]);
;
"use strict";

AccessConsciousness.appModule.factory("stripeService", [
    "$http", "$q", "endpoint",
    function ($http, $q, endpoint) {

        var submitPayment = function (cardModel, amountToPay, currency,
            className, netSuiteClientId, seminarAttendanceId, occasionId,
            isEuroPayment, isElLugarPayment, isAffPayment, isLicenseFeePayment) {
            var deferred = $q.defer();

            var data = {
                amountToPay: amountToPay,
                currency: currency,
                cardModel: cardModel,
                className: className,
                netSuiteClientId: netSuiteClientId,
                seminarAttendanceId: seminarAttendanceId,
                occasionId: occasionId,
                isEuroPayment: isEuroPayment,
                isElLugarPayment: isElLugarPayment,
                isAffPayment: isAffPayment,
                isLicenseFeePayment: isLicenseFeePayment
            }

            var isCheckInPayment = netSuiteClientId !== undefined &&
                seminarAttendanceId !== undefined &&
                occasionId !== undefined;

            sendPayment(data, isCheckInPayment)
                .then(function (response) {
                    deferred.resolve(response);
                })
                .catch(function (error) {
                    deferred.reject(error);
                });

            return deferred.promise;
        };

        var sendPayment = function (data, isCheckInPayment) {
            var deferred = $q.defer();
            var url = isCheckInPayment ? endpoint.SEND_CHECKIN_PAYMENT :
                endpoint.SEND_CHECKOUT_PAYMENT;

            $http.post(url, data)
                .success(function (response) {
                    if (response.success)
                        deferred.resolve(response);
                    else
                        deferred.resolve(response);
                })
                .error(function (response) {
                    deferred.resolve(response);
                });

            return deferred.promise;
        }

        var handleCardPayment = function (clientSecret, cardElement, cardholderName, stripe) {
            var deferred = $q.defer();
            stripe.handleCardPayment(clientSecret, cardElement,
                {
                    payment_method_data: {
                        billing_details: { name: cardholderName.value }
                    }
                }
            ).then(function (result) {
                if (result.error) {
                    // The Payment failed.
                    deferred.reject(result);
                } else {
                    // The payment has succeeded.
                    deferred.resolve(result);
                }
            });

            return deferred.promise;
        };

        var setNetSuitePayment = function (data) {
            var deferred = $q.defer();
            var url = endpoint.SUBMIT_NETSUITE_PAY_FOR_STRIPE;

            $http.post(url, data)
                .success(function (response) {
                    if (response.success)
                        deferred.resolve(response);
                    else
                        deferred.reject(response);
                });

            return deferred.promise;
        };

        var setNetSuitePaymentRoster = function (data) {
            var deferred = $q.defer();
            var url = endpoint.SUBMIT_NETSUITE_PAY_FOR_STRIPE_ROSTER;

            $http.post(url, data)
                .success(function (response) {
                    if (response.success)
                        deferred.resolve(response);
                    else
                        deferred.reject(response);
                });

            return deferred.promise;
        };

        return {
            submitPayment: submitPayment,
            handleCardPayment: handleCardPayment,
            setNetSuitePayment: setNetSuitePayment,
            setNetSuitePaymentRoster: setNetSuitePaymentRoster
        };
    }
]);;
"use strict";

AccessConsciousness.appModule.factory("payPalService", [
    "$http", "$q", "endpoint",
    function ($http, $q, endpoint) {
        var setCheckoutPayPal = function (amountToPay, currency, className,
            isEuroPayment, isElLugarPaymentCompany, isAffPaymentCompany, isLicenseFeePayment) {
            var deferred = $q.defer();
            var data = {
                amountToPay: amountToPay,
                currency: currency,
                className: className,
                isEuroPayment: isEuroPayment,
                isElLugarPaymentCompany: isElLugarPaymentCompany,
                isAffPaymentCompany: isAffPaymentCompany,
                isLicenseFeePayment: isLicenseFeePayment
            };

            $http.post(endpoint.SET_CHECKOUT_PAYPAL, data)
                .success(function (response) {
                    deferred.resolve(response);
                })
                .catch(function (response) {
                    deferred.reject(response.message);
                });

            return deferred.promise;
        };

        var setCheckInPayPal = function (amountToPay, seminarAttendanceId, occasionId,
            isFromHost, podBaseId, isEuroPayment, isElLugarPaymentCompany, isAffPaymentCompany) {
            var deferred = $q.defer();
            var data = {
                amountToPay: amountToPay,
                seminarAttendanceId: seminarAttendanceId,
                occasionId: occasionId,
                isFromHost: isFromHost,
                podBaseId: podBaseId ? podBaseId : 0,
                isEuroPayment: isEuroPayment,
                isElLugarPaymentCompany: isElLugarPaymentCompany,
                isAffPaymentCompany: isAffPaymentCompany
            };

            $http.post(endpoint.SET_CHECKIN_PAYPAL, data)
                .success(function (response) {
                    deferred.resolve(response);
                })
                .catch(function (response) {
                    deferred.reject(response.message);
                });

            return deferred.promise;
        };

        var submitCheckoutPayment = function (paymentId, payerId, isEuroPayment,
            isElLugarPaymentCompany, isAffPaymentCompany, isLicenseFeePayment) {
            var deferred = $q.defer();
            var data = {
                paymentId: paymentId,
                payerId: payerId,
                isEuroPayment: isEuroPayment,
                isElLugarPaymentCompany: isElLugarPaymentCompany,
                isAffPaymentCompany: isAffPaymentCompany,
                isLicenseFeePayment: isLicenseFeePayment
            };

            $http.post(endpoint.SUBMIT_CHECKOUT_PAYPAL, data)
                .success(function (response) {
                    if (response.success) {
                        deferred.resolve(response.message);
                    } else {
                        deferred.reject(response.message);
                    }
                })
                .catch(function (response) {
                    deferred.reject(response.message);
                });

            return deferred.promise;
        };

        var submitCheckInPayPal =
            function (netSuiteClientId, seminarAttendanceId, occasionId, amountToPay, paymentId,
                payerId, isEuroPayment, isElLugarPaymentCompany, isAffPaymentCompany) {
                var deferred = $q.defer();
                var data = {
                    netSuiteClientId: netSuiteClientId,
                    seminarAttendanceId: seminarAttendanceId,
                    occasionId: occasionId,
                    amountToPay: amountToPay,
                    paymentId: paymentId,
                    payerId: payerId,
                    isEuroPayment: isEuroPayment,
                    isElLugarPaymentCompany: isElLugarPaymentCompany,
                    isAffPaymentCompany: isAffPaymentCompany
                };

                $http.post(endpoint.SUBMIT_CHECKIN_PAYPAL, data)
                    .success(function (response) {
                        if (response.success) {
                            deferred.resolve(response);
                        } else {
                            deferred.reject(response.message);
                        }
                    })
                    .catch(function (response) {
                        deferred.reject(response.message);
                    });

                return deferred.promise;
            };

        return {
            setCheckoutPayPal: setCheckoutPayPal,
            submitCheckoutPayment: submitCheckoutPayment,
            setCheckInPayPal: setCheckInPayPal,
            submitCheckInPayPal: submitCheckInPayPal
        };
    }
]);;
AccessConsciousness.appModule.controller("dpaController", [
    "$scope", "$window", "dpaService", "shoppingCartService",
    function ($scope, $window, dpaService, shoppingCartService) {
        $scope.checked = false;
        $scope.date = null;
        $scope.isBtnDisabled = false;

        window.onpageshow = function (event) {
            if (event.persisted) {
                window.location.reload();
            }
        };

        var setFields = function () {
            var dpaName = angular.element(".dpaName");
            dpaName.append($window.name);

            var dpaDate = angular.element('.dpaDate');
            var today = new Date();
            var dd = today.getDate();
            var mm = today.getMonth() + 1;
            var yyyy = today.getFullYear();

            if (dd < 10) {
                dd = '0' + dd;
            }
            if (mm < 10) {
                mm = '0' + mm;
            }

            $scope.date = mm + "/" + dd + "/" + yyyy;
            dpaDate.append($scope.date);
        };
        setFields();

        var disableSubmitButton = function () {
            var deleteCartItemsFromSession = false;
            shoppingCartService.getItemsFromSession(deleteCartItemsFromSession).then(function (response) {
                if (!response.success) {
                    $scope.isBtnDisabled = true;
                }
            });
        };
        disableSubmitButton();

        $scope.acceptDPA = function (event) {
            $scope.checked = event.target.checked;
        };

        $scope.signDPA = function () {
            var model = { IsDPASigned: $scope.checked, DateDPASigned: $scope.date };
            $scope.isLoadingEnabled = true;
            var deleteCartItemsFromSession = true;
            var isContractSigned = $window.sessionStorage.getItem("isContractSigned");
            var isPopHostContractSigned = $window.sessionStorage.getItem("isPopHostContractSigned");
            var isAutomaticCertification = $window.sessionStorage.getItem("isAutomaticCertification");
            var isPopHostCertificationFirstTimePurchase = $window.sessionStorage.getItem("isPopHostCertificationFirstTimePurchase");
            var isPractitionerCertification = $window.sessionStorage.getItem("isPractitionerCertification");

            dpaService.signDPA(model).then(function (response) {
                if (response.success) {
                    $scope.errorMessage = "";
                    $window.sessionStorage.setItem("isDPASigned", true);
                    shoppingCartService.getItemsFromSession(deleteCartItemsFromSession).then(function (response) {
                        if (response.success) {
                            if (isPopHostCertificationFirstTimePurchase === "true") {
                                var redirectPageUrl = isPopHostContractSigned === "true" ?
                                    $window.popHostApplicationPageUrl : $window.popHostContractPageUrl;

                                shoppingCartService.storeItemsOnSession(response.items).then(function (response) {
                                    if (response.success) {
                                        $window.location.href = redirectPageUrl;
                                    }
                                });
                            }
                            else if (isAutomaticCertification === "true" && isPractitionerCertification === "false" && isContractSigned === "false") {
                                shoppingCartService.storeItemsOnSession(response.items).then(function (response) {
                                    if (response.success) {
                                        $window.location.href = $window.contractPageUrl;
                                    }
                                });  
                            } else {
                                shoppingCartService.addItems(response.items).then(function (response) {
                                    if (response.success) {
                                        $scope.isLoadingEnabled = false;
                                        $window.location.href = $window.shoppingCartPageUrl;
                                    }
                                });
                            }
                        }
                    });
                } else {
                    $scope.errorMessage = response.message;
                    $scope.isLoadingEnabled = false;
                }
            });
        };
    }
]);;
"use strict";

AccessConsciousness.appModule.factory("dpaService", [
    "$http", "$q",
    function ($http, $q) {

        var signDPA = function (model) {
            var deferred = $q.defer();
            $http.post("/DPA/SignDPA", { signDpaViewModel: model })
                .success(function (data) {
                    deferred.resolve(data);
                });
            return deferred.promise;
        };

        return {
            signDPA: signDPA
        };
    }
]);;
AccessConsciousness.appModule.controller("contractController", [
    "$scope", "$window", "contractService", "shoppingCartService",
    function ($scope, $window, contractService, shoppingCartService) {
        $scope.checked = false;
        $scope.date = null;
        $scope.isBtnDisabled = false;

        window.onpageshow = function (event) {
            if (event.persisted) {
                window.location.reload();
            }
        };

        var setFields = function () {
            var contractName = angular.element(".contractName");
            contractName.append($window.name);

            var contractDate = angular.element('.contractDate');
            var today = new Date();
            var dd = today.getDate();
            var mm = today.getMonth() + 1;
            var yyyy = today.getFullYear();

            if (dd < 10) {
                dd = '0' + dd;
            }
            if (mm < 10) {
                mm = '0' + mm;
            }

            $scope.date = mm + "/" + dd + "/" + yyyy;
            contractDate.append($scope.date);
        };
        setFields();

        var disableSubmitButton = function () {
            var deleteCartItemsFromSession = false;
            shoppingCartService.getItemsFromSession(deleteCartItemsFromSession).then(function (response) {
                if (!response.success) {
                    $scope.isBtnDisabled = true;
                }
            });
        };
        disableSubmitButton();

        $scope.acceptContract = function (event) {
            $scope.checked = event.target.checked;
        };

        $scope.signContract = function () {
            var model = { IsContractSigned: $scope.checked, DateContractSigned: $scope.date };
            $scope.isLoadingEnabled = true;
            var deleteCartItemsFromSession = true;

            contractService.signContract(model).then(function (response) {
                if (response.success) {
                    $scope.errorMessage = "";
                    shoppingCartService.getItemsFromSession(deleteCartItemsFromSession).then(function (response) {
                        if (response.success) {
                            shoppingCartService.addItems(response.items).then(function (response) {
                                if (response.success) {
                                    $scope.isLoadingEnabled = false;
                                    $window.sessionStorage.setItem("isContractSigned", true);
                                    $window.location.href = $window.shoppingCartPageUrl;
                                }
                            });
                        }
                    });
                } else {
                    $scope.errorMessage = response.message;
                    $scope.isLoadingEnabled = false;
                }
            });
        };
    }
]);;
"use strict";

AccessConsciousness.appModule.factory("contractService", [
    "$http", "$q",
    function ($http, $q) {
        var signContract = function (model) {
            var deferred = $q.defer();
            $http.post("/Contract/SignContract", { signContractViewModel: model })
                .success(function (data) {
                    deferred.resolve(data);
                });
            return deferred.promise;
        };

        return {
            signContract: signContract
        };
    }
]);;
AccessConsciousness.appModule.controller("popHostContractController", [
    "$scope", "$window", "popHostContractService", "shoppingCartService",
    function ($scope, $window, popHostContractService, shoppingCartService) {
        $scope.checked = false;
        $scope.date = null;
        $scope.isBtnDisabled = false;

        window.onpageshow = function (event) {
            if (event.persisted) {
                window.location.reload();
            }
        };

        var setFields = function () {
            var contractName = angular.element(".contractName");
            contractName.append($window.name);

            var contractDate = angular.element('.contractDate');
            var today = new Date();
            var dd = today.getDate();
            var mm = today.getMonth() + 1;
            var yyyy = today.getFullYear();

            if (dd < 10) {
                dd = '0' + dd;
            }
            if (mm < 10) {
                mm = '0' + mm;
            }

            $scope.date = mm + "/" + dd + "/" + yyyy;
            contractDate.append($scope.date);
        };
        setFields();

        var disableSubmitButton = function () {
            var deleteCartItemsFromSession = false;
            shoppingCartService.getItemsFromSession(deleteCartItemsFromSession).then(function (response) {
                if (!response.success) {
                    $scope.isBtnDisabled = true;
                }
            });
        };
        disableSubmitButton();

        $scope.acceptContract = function (event) {
            $scope.checked = event.target.checked;
        };

        $scope.signContract = function () {
            var model = { IsContractSigned: $scope.checked, DateContractSigned: $scope.date };
            $scope.isLoadingEnabled = true;
            var deleteCartItemsFromSession = true;

            popHostContractService.signContract(model).then(function (response) {
                if (response.success) {
                    $scope.errorMessage = "";
                    shoppingCartService.getItemsFromSession(deleteCartItemsFromSession).then(function (response) {
                        if (response.success) {
                            shoppingCartService.storeItemsOnSession(response.items).then(function (response) {
                                if (response.success) {
                                    $scope.isLoadingEnabled = false;
                                    $window.sessionStorage.setItem("isPopHostContractSigned", true);
                                    $window.location.href = $window.popHostApplicationPage;
                                }
                            });
                        }
                    });
                } else {
                    $scope.errorMessage = response.message;
                    $scope.isLoadingEnabled = false;
                }
            });
        };
    }
]);;
"use strict";

AccessConsciousness.appModule.factory("popHostContractService", [
    "$http", "$q",
    function ($http, $q) {
        var signContract = function (model) {
            var deferred = $q.defer();
            $http.post("/PopHostContract/SignContract", { signContractViewModel: model })
                .success(function (data) {
                    deferred.resolve(data);
                });
            return deferred.promise;
        };

        return {
            signContract: signContract
        };
    }
]);;
AccessConsciousness.appModule.controller("popHostApplicationController", [
    "$scope", "$window", "popHostApplicationService", "shoppingCartService",
    function ($scope, $window, popHostApplicationService, shoppingCartService) {
        $scope.payPalEmail = window.popHostPayPalEmail;
        $scope.isBtnDisabled = false;

        var disableSubmitButton = function () {
            var isPopHostCertificationFirstTimePurchase = $window.sessionStorage.getItem("isPopHostCertificationFirstTimePurchase");

            if (isPopHostCertificationFirstTimePurchase) {
                var deleteCartItemsFromSession = false;
                shoppingCartService.getItemsFromSession(deleteCartItemsFromSession).then(function(response) {
                    if (!response.success) {
                        $scope.isBtnDisabled = true;
                    }
                });
            } else {
                $scope.isBtnDisabled = true;
            }
        };
        disableSubmitButton();

        $scope.submitApplication = function (form) {
            if (!form.$valid) return;

            var model = { payPalEmail: $scope.payPalEmail, taxFile: $scope.taxFile };
            $scope.isLoadingEnabled = true;

            popHostApplicationService.submitApplication(model).then(function (response) {
                if (response.success) {
                    $scope.errorMessage = "";
                    shoppingCartService.addItems(response.items).then(function (response) {
                        if (response.success) {
                            $scope.isLoadingEnabled = false;
                            $window.sessionStorage.setItem("isPopHostCertificationFirstTimePurchase", false);
                            $window.location.href = $window.shoppingCartPageUrl;
                        }
                    });
                } else {
                    $scope.errorMessage = response.message;
                    $scope.isLoadingEnabled = false;
                }
            });
        };
    }
]);;
"use strict";

AccessConsciousness.appModule.factory("popHostApplicationService", [
    "$http", "$q",
    function ($http, $q) {
        var submitApplication = function (model) {
            var deferred = $q.defer();

            var fd = new FormData();
            fd.append('payPalEmail', model.payPalEmail);
            fd.append('taxFile', model.taxFile);

            $http.post("/PopHostApplication/SubmitApplication", fd, {
                    transformRequest: angular.identity,
                    headers: { 'Content-Type': undefined }
                })
                .success(function (response) {
                    deferred.resolve(response);
                });

            return deferred.promise;
        };

        return {
            submitApplication: submitApplication
        };
    }
]);;
"use strict";

AccessConsciousness.appModule.factory("shoppingCartService", [
    "$http", "$q", "$rootScope", "shopEvents", "$window",
    function ($http, $q, $rootScope, shopEvents, $window) {

        var buildAddToCartNotificationMessage = function (variants) {
            var variantIds = [];
            for (var i = 0; i < variants.length; i++) {
                if (variants[i].Quantity > 0) {
                    variantIds.push(variants[i].Id);
                }
            }

            var message = "Product was added to shopping cart";
            if (variantIds.length > 1) {
                message = "Products were added to shopping cart";
            }

            return message;
        };

        var getShoppingCart = function () {
            var deferred = $q.defer();

            $http.post("/ShopShoppingCartPage/GetShoppingCart")
                .success(function (data) {
                    if (data.success) {
                        deferred.resolve(data);
                    } else {
                        deferred.resolve([]);
                    }
                });

            return deferred.promise;
        };

        var canAddItems = function (variants) {
            var deferred = $q.defer();

            $http.post("/ShopShoppingCartPage/CanAddItems", variants)
                .success(function (response) {
                    if (response.success) {
                        deferred.resolve(response);
                    } else {
                        if (response.productPrerequisites) {
                            var isAutomaticCertification = $window.sessionStorage.getItem("isAutomaticCertification");
                            if (isAutomaticCertification === "true") {
                                $("#prerequisitesModal").modal('toggle');
                            } else {
                                $rootScope.$emit(shopEvents.shoppingCart.ADD_TO_CART_ERROR, response.message);
                            }
                        } else {
                            $rootScope.$emit(shopEvents.shoppingCart.ADD_TO_CART_ERROR, response.message);
                        }
                    }
                });

            return deferred.promise;
        };

        var addItems = function (variants) {
            var deferred = $q.defer();

            $http.post("/ShopShoppingCartPage/AddItems", variants)
                .success(function (response) {
                    if (response.success) {
                        var gaTracking = new Function (response.gaObject);
                        gaTracking();
                        $rootScope.$emit(shopEvents.shoppingCart.ADD_TO_CART,buildAddToCartNotificationMessage(variants));
                        deferred.resolve(response);
                    } else {
                        $rootScope.$emit(shopEvents.shoppingCart.ADD_TO_CART_ERROR, response.message);
                    }
                });

            return deferred.promise;
        };

        var checkForDigitalItems = function (variants) {
            var deferred = $q.defer();

            $http.post("/ShopShoppingCartPage/checkForDigitalItems", variants)
                .success(function (response) {
                    deferred.resolve(response);
                });

            return deferred.promise;
        };

        var storeItemsOnSession = function (variants) {
            var deferred = $q.defer();

            $http.post("/ShopShoppingCartPage/StoreItemsOnSession", variants)
                .success(function (response) {
                    deferred.resolve(response);
                });

            return deferred.promise;
        };

        var getItemsFromSession = function (deleteFromSession) {
            var deferred = $q.defer();

            $http.post("/ShopShoppingCartPage/GetItemsFromSession", { deleteFromSession: deleteFromSession })
                .success(function (response) {
                    deferred.resolve(response);
                });

            return deferred.promise;
        };

        var removeItem = function (cartItem) {
            var deferred = $q.defer();
            var message = "Product was removed from shopping cart";

            $http.post("/ShopShoppingCartPage/RemoveItem", cartItem)
                .success(function (data) {
                    if (data.success) {
                        var gaTracking = new Function (data.gaObject);
                        gaTracking();

                        $rootScope.$emit(shopEvents.shoppingCart.REMOVE_FROM_CART, message);
                        deferred.resolve(data);
                    } else {
                        deferred.resolve([]);
                    }

                });

            return deferred.promise;
        };

        var updateQuantity = function (cartItem) {
            var deferred = $q.defer();
            var message = "Product quantity was updated";

            $http.post("/ShopShoppingCartPage/UpdateItem", cartItem)
                .success(function (data) {
                    if (data.success) {
                        $rootScope.$emit(shopEvents.shoppingCart.UPDATE_QUANTITY, message);
                        deferred.resolve(data);
                    } else {
                        deferred.resolve([]);
                    }

                });

            return deferred.promise;
        };

        return {
            getShoppingCart: getShoppingCart,
            canAddItems: canAddItems,
            checkForDigitalItems: checkForDigitalItems,
            addItems: addItems,
            storeItemsOnSession: storeItemsOnSession,
            getItemsFromSession: getItemsFromSession,
            removeItem: removeItem,
            updateQuantity: updateQuantity
        };
    }
]);;
