HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: /var/www/html/shootinschool/wp-content/cache/wpfc-minified/89q9y18o/2orow.js
// source --> https://shootinschool.spericorn.com/wp-content/plugins/hashbar-wp-notification-bar/assets/js/frontend.js?ver=1.5.2 
;(function ($) {
    "use strict";

    $.fn.get_transparent_selector = function get_transparent_selector(){
        let transparent_header_selector = $(this).closest('.hthb-notification.hthb-pos--top[data-transparent_header_selector]').last().data('transparent_header_selector');
        if($(this).closest('.hthb-notification.hthb-pos--top').hasClass('hthb-transparent')){
            return transparent_header_selector;
        }

        return false;
    }

    $.fn.add_transparent_header_spacing = function add_transparent_header_spacing(top_notification_height){
        if( $('body').find('#wpadminbar').length ){
            top_notification_height = Number.parseInt(top_notification_height + $('body').find('#wpadminbar').height());
        }
    }

    function calculate_top_zero(){
        if( $('body').find('#wpadminbar').length ){
            return '32px';
        } else{
            return '0px';
        }
    }

    var timeout = 400;
    $(window).on('load',function(){
        var top_notification_height         = Number.parseInt($('.hthb-notification.hthb-pos--top').last().height()),
            bottom_notification_height      = $('.hthb-notification.hthb-pos--bottom').last().height(),
            left_wall_notification_width    = $('.hthb-notification.hthb-pos--left-wall').last().width(),
            right_wall_notification_width   = $('.hthb-notification.hthb-pos--right-wall').last().width();

        var position;

        // if load as minimized disabled
        $('.hthb-notification.hthb-state--open').each(function(){
            position = $(this).getPostion();

            if( position == 'top' ){
                $('body').addClass('hthb hthb-pt--' + top_notification_height );
                if( $(this).get_transparent_selector() ){

                    $($(this).get_transparent_selector()).addClass('hthb-top-unset');
                    $($(this).get_transparent_selector()).css( {'top':'unset'} );

                }
            } else if( position == 'bottom'){
                $('body').css('padding-bottom', bottom_notification_height + 'px');
            }

            // Implement how many time to show
            var time_to_show           = $(this).data('time_to_show'),
                id                     = $(this).data('id') ? '_' + $(this).data('id') : '', 
                coockie_count          = Cookies.get('hashbarpro_cookiecount' + id),
                hashbarpro_oldcookie   = Cookies.get('hashbarpro_oldcookie' + id);

            if( time_to_show && time_to_show > 0 ){

                if(document.cookie.indexOf("hashbarpro_oldcookie" + id) >= 0){
                    if(time_to_show == hashbarpro_oldcookie && coockie_count){
                        coockie_count++;
                        Cookies.set('hashbarpro_cookiecount' + id, coockie_count, { expires: 7 });
                    } else {
                        Cookies.set('hashbarpro_oldcookie' + id, time_to_show, { expires: 7 });
                        Cookies.set('hashbarpro_cookiecount' + id, 1, { expires: 7 });
                    }
                } else {
                    Cookies.set('hashbarpro_oldcookie' + id, time_to_show, { expires: 7 });
                    Cookies.set('hashbarpro_cookiecount' + id, 1, { expires: 7 });
                }
            }

            if( coockie_count > time_to_show ){
               $(this).css({'display': 'none'});
               $(this).removeClass('hthb-state--open').addClass('hthb-state--minimized');

               if( position == 'top' ){
                    $('body').removeClass('hthb');
               }
            }
            
        });

        // Load as mimimized if option is set to minimized
        $('.hthb-notification.hthb-state--minimized').each(function(){
             var position = $(this).getPostion();
             if( position == 'top' || position == 'top-promo' || position == 'bottom' || position == 'bottom-promo' ){
                $(this).find('.hthb-row').css('display', 'none');
             }
            
        });

        // Left/right wall
        $('.hthb-notification.hthb-state--minimized').each(function(){
            var position = $(this).getPostion();
            if( position == 'left-wall' ){
                  $(this).css('left', '-' + left_wall_notification_width + 'px' );
            } else if( position == 'right-wall' ){
                 $(this).css('right', '-' + right_wall_notification_width + 'px' );
            }
           
        });

        setTimeout(function(){
            $('.hthb-notification').addClass('hthb-loaded');
        }, timeout );

        $('.hthb-notification').each(function() {
            const delay_time = $(this).attr('data-delay_time');
            if(+delay_time) {
                setTimeout(() => {
                    $(this).showNotification( top_notification_height, bottom_notification_height, left_wall_notification_width, right_wall_notification_width );
                }, +delay_time*1000);
            }
        })

        // When click close button
        $('.hthb-close-toggle').on('click', function(){
            const $hthb_id = $(this).closest('.hthb-notification')[0].dataset.id;
            let $expire_time = +hashbar_localize.cookies_expire_time
            if(hashbar_localize.cookies_expire_type === 'hours') {
                $expire_time = $expire_time/24;
            }
            if(hashbar_localize.cookies_expire_type === 'minutes') {
                $expire_time = $expire_time/1440;
            }

            $(this).minimizeNotification( top_notification_height, bottom_notification_height, left_wall_notification_width, right_wall_notification_width);

            // Keep closed
            if( hashbar_localize.bar_keep_closed == '1' ){
                Cookies.set(`keep_closed_bar_${$hthb_id}`, '1', { expires: $expire_time, path: '/' });
            }

            // Don't show forever
            if( hashbar_localize.dont_show_bar_after_close == '1' ) {
                Cookies.set( `dont_show_bar_${$hthb_id}`, '1', { expires: $expire_time, path: '/' } );
            }
        });

        // When clicked open button
        $('.hthb-open-toggle').on('click', function(){
            $(this).showNotification( top_notification_height, bottom_notification_height, left_wall_notification_width, right_wall_notification_width );
        });

        // When scroll position matched with a notification
        // Show the notifications
        var window_inner_height             = $(window).height(),
            page_height                     = $('body').height();

        let current_scroll_position         = window.pageYOffset || document.documentElement.scrollTop,
            current_scroll_position_percent = current_scroll_position / scroll_pos_max * 100;
            current_scroll_position_percent = Number.parseInt(current_scroll_position_percent);

        var scroll_pos_max = $(document).height() - $(window).height();

        $(window).on('scroll', function(e){
            current_scroll_position         = $(window).scrollTop(),
            current_scroll_position_percent = current_scroll_position / scroll_pos_max * 100;
            current_scroll_position_percent = Number.parseInt(current_scroll_position_percent);

            $(`.hthb-scroll`).each(function(){
                let scroll_to_show = $(this).data('scroll_to_show'),
                    scroll_to_hide = $(this).data('scroll_to_hide'),
                    hthb_id = $(this)[0].dataset.id;

                $(this).trigger_notification_on_scroll(hthb_id, scroll_to_show, scroll_to_hide, current_scroll_position, scroll_pos_max);
            });
        });
    });
    
    /**
     * Calculate % of a given value.
     * For example, If the give value is 1000 & we want to know the 75% of it.
     * It will return 750 as the result.
     *
     * @param number percent_amount, % amount.
     * @param number percent_of, Total amount from where the % should be calculated.
     * @return number
     */
    function percent_of(percent_amount, percent_of){
        percent_of = Number.parseInt(percent_of);
        percent_amount = Number.parseInt(percent_amount);
        
        return percent_of * percent_amount / 100;
    }

    $.fn.getPostion = function(){
        if(this.closest('.hthb-notification').hasClass('hthb-pos--top')){
            return 'top';
        }

        if(this.closest('.hthb-notification').hasClass('hthb-pos--bottom')){
            return 'bottom';
        }

        if(this.closest('.hthb-notification').hasClass('hthb-pos--left-wall')){
            return 'left-wall';
        }

        if(this.closest('.hthb-notification').hasClass('hthb-pos--right-wall')){
            return 'right-wall';
        }

        if(this.closest('.hthb-notification').hasClass('hthb-pos--bottom-promo')){
            return 'bottom-promo';
        }

        if(this.closest('.hthb-notification').hasClass('hthb-pos--top-promo')){
            return 'top-promo';
        }
    }

    $.fn.minimizeNotification = function(top_notification_height, bottom_notification_height, left_wall_notification_width, right_wall_notification_width){
        var postion = this.getPostion(),
            left_wall_notification_width = this.closest('.hthb-notification').width(),
            right_wall_notification_width = this.closest('.hthb-notification').width();

        this.closest('.hthb-notification').removeClass('hthb-state--open');
        this.closest('.hthb-notification').addClass('hthb-state--minimized');

        if(postion != 'left-wall' && postion != 'right-wall'){
            this.closest('.hthb-notification').find('.hthb-row').slideToggle();
        }
        
        if( postion == 'top' ){
            $('body').removeClass('hthb');

            // for sticky
            if( this.get_transparent_selector() ){
                $(this.get_transparent_selector()).addClass('hthb-top-unset');
                $(this.get_transparent_selector()).css({'top': calculate_top_zero()});
            }
        } else if( postion == 'bottom' ){
            $('body').css('padding-bottom', '');
        } else if( postion == 'left-wall' ){
            this.closest('.hthb-notification').css('left', '-' + left_wall_notification_width + 'px' );
        } else if( postion == 'right-wall' ){
            this.closest('.hthb-notification').css('right', '-' + right_wall_notification_width + 'px' );
        }
    }

    $.fn.showNotification = function(top_notification_height, bottom_notification_height, left_wall_notification_width, right_wall_notification_width){
        var postion = this.getPostion(),
        left_wall_notification_width = this.closest('.hthb-notification').width(),
        right_wall_notification_width = this.closest('.hthb-notification').width();

        this.closest('.hthb-notification').removeClass('hthb-state--minimized');
        this.closest('.hthb-notification').addClass('hthb-state--open');

        if(postion != 'left-wall' && postion != 'right-wall'){
            this.closest('.hthb-notification').find('.hthb-row').slideToggle();
        }
        
        if( postion == 'top' ){
            $('body').addClass('hthb hthb-pt--'+ top_notification_height );

            // for sticky
            if( this.get_transparent_selector() ){
                $(this.get_transparent_selector()).addClass('hthb-top-unset');
                $(this.get_transparent_selector()).css({'top': 'unset'});
            }
        } else if( postion == 'bottom' ){
            $('body').css('padding-bottom', bottom_notification_height + 'px');
        } else if( postion == 'left-wall' ){
            this.closest('.hthb-notification').css('left', '');
        } else if( postion == 'right-wall' ){
            this.closest('.hthb-notification').css('right', '');
        }
    }

    $.fn.trigger_click_on_open_button = function(){
        $(this).addClass('hthb-trigger-open-clicked').removeClass('hthb-trigger-close-clicked');
        $(this).find('.hthb-open-toggle').trigger('click');
    }

    $.fn.trigger_click_on_close_button = function(){
        $(this).removeClass('hthb-trigger-open-clicked').addClass('hthb-trigger-close-clicked');
        $(this).find('.hthb-close-toggle').trigger('click');
    }

    $.fn.check_keep_close_bar = function(id){
        var keep_closed_bar = Cookies.get(`keep_closed_bar_${id}`);
        if( hashbar_localize.bar_keep_closed === '1' && keep_closed_bar){
            return false;
        }else{
            return true;
        }
    }

    $.fn.trigger_notification_on_scroll = function( id, scroll_to_show, scroll_to_hide, current_scroll_position, scroll_pos_max ){
        if( (scroll_to_show && typeof scroll_to_show == 'string' && scroll_to_show.indexOf('%')) > 0 && (scroll_to_hide && typeof scroll_to_hide == 'string' && scroll_to_hide.indexOf('%')) > 1 ){
            scroll_to_show = Number.parseInt(scroll_to_show);
            scroll_to_hide = Number.parseInt(scroll_to_hide);
            // 20% ,  80%
            // console.log(1,scroll_to_show,scroll_to_hide,current_scroll_position, percent_of(scroll_to_hide, scroll_pos_max));

            if(current_scroll_position > percent_of(scroll_to_show, scroll_pos_max) &&  current_scroll_position < percent_of(scroll_to_hide, scroll_pos_max) ){
                if( !$(this).is('.hthb-state--open') && !$(this).is('.hthb-trigger-open-clicked') ){
                    if($(this).check_keep_close_bar(id)){
                        $(this).trigger_click_on_open_button(); // show
                    }
                }
            } else{
                if( !$(this).is('.hthb-state--minimized') ){
                    $(this).trigger_click_on_close_button(); // hide
                }
            }
        } else if( (scroll_to_show && typeof scroll_to_show == 'string' && scroll_to_show.indexOf('%')) &&  (scroll_to_hide === '' || scroll_to_hide == undefined) ){
            scroll_to_show = Number.parseInt(scroll_to_show);
            // 20% , ''/undefined
            // console.log(2,scroll_to_show,scroll_to_hide,current_scroll_position, percent_of(scroll_to_hide, scroll_pos_max));

            if( current_scroll_position > percent_of(scroll_to_show, scroll_pos_max) ){
                if( !$(this).is('.hthb-state--open') && !$(this).is('.hthb-trigger-open-clicked') ){
                    if($(this).check_keep_close_bar(id)){
                        $(this).trigger_click_on_open_button(); // show
                    }
                }
            } else {
                if( !$(this).is('.hthb-state--minimized') ){
                    $(this).trigger_click_on_close_button(); // hide
                }
            }
        } else if( (scroll_to_show && typeof scroll_to_show == 'number') && (scroll_to_hide && typeof scroll_to_hide == 'string')){
            // 300 , 80%
            // console.log(3,scroll_to_show,scroll_to_hide,current_scroll_position, percent_of(scroll_to_hide, scroll_pos_max));

            if( current_scroll_position > scroll_to_show &&  current_scroll_position < percent_of(scroll_to_hide, scroll_pos_max) ){
                if( !$(this).is('.hthb-state--open') && !$(this).is('.hthb-trigger-open-clicked') ){
                    if($(this).check_keep_close_bar(id)){
                        $(this).trigger_click_on_open_button(); // show
                    }
                }
            } else{
                if( !$(this).is('.hthb-state--minimized') ){
                    $(this).trigger_click_on_close_button(); // hide
                }
            }

        } else if( (scroll_to_show === '' || scroll_to_show == undefined) && (scroll_to_hide && typeof scroll_to_hide == 'string' && scroll_to_hide.indexOf('%')) ){
            scroll_to_hide = Number.parseInt(scroll_to_hide);
            // empty / undefined , 90%
            // console.log(4,scroll_to_show,scroll_to_hide,current_scroll_position, percent_of(scroll_to_hide, scroll_pos_max));

            if( current_scroll_position > percent_of(scroll_to_hide, scroll_pos_max) ){
                if( !$(this).is('.hthb-state--minimized') ){
                    $(this).trigger_click_on_close_button(); // hide
                }
            } else{
                if( !$(this).is('.hthb-state--open') && !$(this).is('.hthb-trigger-open-clicked') ){
                    if($(this).check_keep_close_bar(id)){
                        $(this).trigger_click_on_open_button(); // show 
                    }
                }
            }

        } else if( (scroll_to_show && typeof scroll_to_show == 'number') && (scroll_to_hide === '' || scroll_to_hide == undefined) ){
            // 300 , empty/undefined 
            // console.log(5,scroll_to_show,scroll_to_hide,current_scroll_position, percent_of(scroll_to_hide, scroll_pos_max));
            if( current_scroll_position < scroll_to_show ){
                if( !$(this).is('.hthb-state--minimized') ){
                    $(this).trigger_click_on_close_button(); // hide
                }

            } else{
                if( !$(this).is('.hthb-state--open') && !$(this).is('.hthb-trigger-open-clicked') ){
                    if($(this).check_keep_close_bar(id)){
                        $(this).trigger_click_on_open_button(); // show
                    }
                }
            }
            
        } else {
            console.log(`Invalid formate  Scroll to show=${typeof scroll_to_show} ${scroll_to_show } scroll_to_hide=${typeof scroll_to_hide} ${scroll_to_hide}`);
        }
    }

    $(document).ready(function(){
        $(".hthb-countdown").each(function(){
            var countdown_id = "#"+$(this).attr('id')+" .hthb-countdown-section .hthb-countdown-wrap",
                finalDate    = $(countdown_id).data('countdown'),
                customLabel  = $(countdown_id).data('custom_label');
            $(countdown_id).countdown(finalDate, function (event) {
                $(countdown_id+' .countdown-day').html(event.strftime('%D'));
                $(countdown_id+' .countdown-day-text').html(customLabel.day);
                $(countdown_id+' .countdown-hour').html(event.strftime('%H'));
                $(countdown_id+' .countdown-hour-text').html(customLabel.hour);
                $(countdown_id+' .countdown-minute').html(event.strftime('%M'));
                $(countdown_id+' .countdown-minite-text').html(customLabel.min);
                $(countdown_id+' .countdown-second').html(event.strftime('%S'));
                $(countdown_id+' .countdown-second-text').html(customLabel.sec);
            });
        });

    });
})(jQuery);
// source --> https://shootinschool.spericorn.com/wp-content/plugins/hashbar-wp-notification-bar/assets/js/js.cookie.min.js?ver=1.5.2 
/**
 * Minified by jsDelivr using UglifyJS v3.4.4.
 * Original file: /npm/js-cookie@2.2.0/src/js.cookie.js
 * 
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
!function(e){var n=!1;if("function"==typeof define&&define.amd&&(define(e),n=!0),"object"==typeof exports&&(module.exports=e(),n=!0),!n){var o=window.Cookies,t=window.Cookies=e();t.noConflict=function(){return window.Cookies=o,t}}}(function(){function g(){for(var e=0,n={};e<arguments.length;e++){var o=arguments[e];for(var t in o)n[t]=o[t]}return n}return function e(l){function C(e,n,o){var t;if("undefined"!=typeof document){if(1<arguments.length){if("number"==typeof(o=g({path:"/"},C.defaults,o)).expires){var r=new Date;r.setMilliseconds(r.getMilliseconds()+864e5*o.expires),o.expires=r}o.expires=o.expires?o.expires.toUTCString():"";try{t=JSON.stringify(n),/^[\{\[]/.test(t)&&(n=t)}catch(e){}n=l.write?l.write(n,e):encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=(e=(e=encodeURIComponent(String(e))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape);var i="";for(var c in o)o[c]&&(i+="; "+c,!0!==o[c]&&(i+="="+o[c]));return document.cookie=e+"="+n+i}e||(t={});for(var a=document.cookie?document.cookie.split("; "):[],s=/(%[0-9A-Z]{2})+/g,f=0;f<a.length;f++){var p=a[f].split("="),d=p.slice(1).join("=");this.json||'"'!==d.charAt(0)||(d=d.slice(1,-1));try{var u=p[0].replace(s,decodeURIComponent);if(d=l.read?l.read(d,u):l(d,u)||d.replace(s,decodeURIComponent),this.json)try{d=JSON.parse(d)}catch(e){}if(e===u){t=d;break}e||(t[u]=d)}catch(e){}}return t}}return(C.set=C).get=function(e){return C.call(C,e)},C.getJSON=function(){return C.apply({json:!0},[].slice.call(arguments))},C.defaults={},C.remove=function(e,n){C(e,"",g(n,{expires:-1}))},C.withConverter=e,C}(function(){})});
//# sourceMappingURL=/sm/31d5cd1b58ce5e6231e4ea03a69b2801a53e76e98152bc29dc82a494ed0a1ee6.map;
// source --> https://shootinschool.spericorn.com/wp-content/plugins/login-as-user/public/js/public.min.js?ver=1.5.3 
jQuery(function(n){n(".w357-login-as-user-btn").bind("contextmenu",function(n){return alert("The right click is disabled. Please, just click on the button."),!1})});
// source --> https://shootinschool.spericorn.com/wp-content/plugins/shootin-school-plugin/includes/js/clockface.js?ver=1 
/**
* Clockface - v1.0.1
* Clockface timepicker for Twitter Bootstrap
*
* Confusion with noon and midnight: 
* http://en.wikipedia.org/wiki/12-hour_clock
* Here considered '00:00 am' as midnight and '12:00 pm' as noon.
*
* Author: Vitaliy Potapov
* Project page: http://github.com/vitalets/clockface
* Copyright (c) 2012 Vitaliy Potapov. Released under MIT License.
**/
(function ($) {

    var Clockface = function (element, options) {
        this.$element = $(element);
        this.options = $.extend({}, $.fn.clockface.defaults, options, this.$element.data());
        this.init();  
     };

    Clockface.prototype = {
        constructor: Clockface, 
        init: function () {
          //apply template
          this.$clockface = $($.fn.clockface.template);
          this.$clockface.find('.l1 .cell, .left.cell').html('<div class="outer"></div><div class="inner"></div>'); 
          this.$clockface.find('.l5 .cell, .right.cell').html('<div class="inner"></div><div class="outer"></div>'); 
          this.$clockface.hide();

          this.$outer = this.$clockface.find('.outer');
          this.$inner = this.$clockface.find('.inner');
          this.$ampm = this.$clockface.find('.ampm');

          //internal vars
          this.ampm = null;
          this.hour = null;
          this.minute = null;
          
          //click am/pm 
          this.$ampm.click($.proxy(this.clickAmPm, this));

          //click cell
          this.$clockface.on('click', '.cell', $.proxy(this.click, this));

          this.parseFormat();
          this.prepareRegexp();

          //set ampm text
          this.ampmtext = this.is24 ? {am: '12-23', pm: '0-11'} : {am: 'AM', pm: 'PM'};

          this.isInline = this.$element.is('div');
          if(this.isInline) {
            this.$clockface.addClass('clockface-inline').appendTo(this.$element);
          } else {
            this.$clockface.addClass('dropdown-menu').appendTo('body');
            if(this.options.trigger === 'focus') {
              this.$element.on('focus.clockface', $.proxy(function(e) { this.show(); }, this));
            }

            // Click outside hide it. Register single handler for all clockface widgets
            $(document).off('click.clockface').on('click.clockface', $.proxy(function (e) {
                var $target = $(e.target);
                //click inside some clockface --> do nothing
                if ($target.closest('.clockface').length) {
                  return;
                }
                //iterate all open clockface and close all except current
                $('.clockface-open').each(function(){
                  if(this === e.target) {
                    return;
                  }
                  $(this).clockface('hide');
                });
            }, this));
          }

          //fill minutes once
          this.fill('minute');
        },

        /*
        Displays widget with specified value
        */
        show: function(value) {
            if(this.$clockface.is(':visible')) {
              return;
            }
            if(!this.isInline) {
                if(value === undefined) {
                  value = this.$element.val();
                }
                this.$element.addClass('clockface-open');
                this.$element.on('keydown.clockface', $.proxy(this.keydown, this));
                this.place();
                $(window).on('resize.clockface', $.proxy(this.place, this));
            }
            this.$clockface.show();
            this.setTime(value);

            //trigger shown event
            this.$element.triggerHandler('shown.clockface', this.getTime(true));
        },
        /*
        hides widget
        */
        hide: function() {
            this.$clockface.hide();
            if(!this.isInline) {
              this.$element.removeClass('clockface-open');  
              this.$element.off('keydown.clockface');
              $(window).off('resize.clockface');
            }

            //trigger hidden event
            this.$element.triggerHandler('hidden.clockface', this.getTime(true));            
        },

        /*
        toggles show/hide
        */
        toggle: function(value) {
          if(this.$clockface.is(':visible')) {
            this.hide();
          } else {
            this.show(value);
          }
        },

         /*
        Set time of clockface. Am/pm will be set automatically.
        Value can be Date object or string
        */
        setTime: function(value) {
          var res, hour, minute, ampm = 'am';

          //no new value 
          if(value === undefined) {
            //if ampm null, it;s first showw, need to render hours ('am' by default)
            if(this.ampm === null) {
              this.setAmPm('am');
            }
            return;
          }

          //take value from Date object
          if(value instanceof Date) {
            hour = value.getHours();
            minute = value.getMinutes();
          }

          //parse value from string
          if(typeof value === 'string' && value.length) { 
            res = this.parseTime(value);

            //'24' always '0'
            if(res.hour === 24) {
              res.hour = 0;
            }

            hour = res.hour;             
            minute = res.minute;             
            ampm = res.ampm;             
          }

          //try to set ampm automatically
          if(hour > 11 && hour < 24) {
            ampm = 'pm';
            //for 12h format substract 12 from value 
            if(!this.is24 && hour > 12) {
              hour -= 12;
            }
          } else if(hour >= 0 && hour < 11) {
                //always set am for 24h and for '0' in 12h 
                if(this.is24 || hour === 0) {
                   ampm = 'am';
               } 
               //otherwise ampm should be defined in value itself and retrieved when parsing
          }      

          this.setAmPm(ampm);
          this.setHour(hour);
          this.setMinute(minute);
        },   

        /*
        Set ampm and re-fill hours
        */
        setAmPm: function(value) {
          if(value === this.ampm) {
             return;
          } else {
             this.ampm = value === 'am' ? 'am' : 'pm';
          }

          //set link's text
          this.$ampm.text(this.ampmtext[this.ampm]);

          //re-fill and highlight hour
          this.fill('hour');
          this.highlight('hour');
        },   
        /*
        Sets hour value and highlight if possible
        */
        setHour: function(value) {
          value = parseInt(value, 10);
          value = isNaN(value) ? null : value;
          if(value < 0 || value > 23) {
            value = null;
          }

          if(value === this.hour) {
            return;
          } else {
            this.hour = value;
          }

          this.highlight('hour');
        },

        /*
        Sets minute value and highlight
        */
        setMinute: function(value) {
          value = parseInt(value, 10);
          value = isNaN(value) ? null : value;
          if(value < 0 || value > 59) {
            value = null;
          }

          if(value === this.minute) {
            return;
          } else {
            this.minute = value;
          }

          this.highlight('minute');
        },        

        /*
        Highlights hour/minute
        */
        highlight: function(what) {
          var index,
              values = this.getValues(what),
              value = what === 'minute' ? this.minute : this.hour,
              $cells = what === 'minute' ? this.$outer : this.$inner;

          $cells.removeClass('active');

          //find index of value and highlight if possible
          index = $.inArray(value, values);
          if(index >= 0) {
            $cells.eq(index).addClass('active');
          }
        },

        /*
        Fill values around
        */ 
        fill: function(what) {
          var values = this.getValues(what),
              $cells = what === 'minute' ? this.$outer : this.$inner,
              leadZero = what === 'minute';           

          $cells.each(function(i){
            var v = values[i];
            if(leadZero && v < 10) {
              v = '0' + v;
            }
            $(this).text(v);
          });
        },          

        /*
        returns values of hours or minutes, depend on ampm and 24/12 format (0-11, 12-23, 00-55, etc)
        param what: 'hour'/'minute'
        */
        getValues: function(what) {
          var values = [11, 0, 1, 10, 2, 9, 3, 8, 4, 7, 6, 5],
              result = values.slice();

          //minutes
          if(what === 'minute') {
              $.each(values, function(i, v) { result[i] = v*5; });
          } else {
            //hours
            if(!this.is24) {
              result[1] = 12; //need this to show '12' instead of '00' for 12h am/pm
            }
            if(this.is24 && this.ampm === 'pm') {
              $.each(values, function(i, v) { result[i] = v+12; });
            }
          }
          return result;
        },

        /*
        Click cell handler.
        Stores hour/minute and highlights.
        On second click deselect value
        */
        click: function(e) {
          var $target = $(e.target),
              value = $target.hasClass('active') ? null : $target.text();
          if($target.hasClass('inner')) {
            this.setHour(value);
          } else {
            this.setMinute(value);
          }

          //update value in input
          if(!this.isInline) {
            this.$element.val(this.getTime());
          }          

          //trigger pick event
          this.$element.triggerHandler('pick.clockface', this.getTime(true));  
        },

        /*
        Click handler on ampm link
        */
        clickAmPm: function(e) {
          e.preventDefault();
          //toggle am/pm
          this.setAmPm(this.ampm === 'am' ? 'pm' : 'am');

          //update value in input
          if(!this.isInline && !this.is24) {
            this.$element.val(this.getTime());
          }    

          //trigger pick event
          this.$element.triggerHandler('pick.clockface', this.getTime(true));                  
        },
        

        /*
        Place widget below input
        */
        place: function(){
          var zIndex = parseInt(this.$element.parents().filter(function() {
                   return $(this).css('z-index') != 'auto';
             }).first().css('z-index'), 10)+10,
             offset = this.$element.offset();
          this.$clockface.css({
            top: offset.top + this.$element.outerHeight(),
            left: offset.left,
            zIndex: zIndex
          });
        },  

        /*
        keydown handler (for not inline mode)
        */
        keydown: function(e) {
          //tab, escape, enter --> hide
          if(/^(9|27|13)$/.test(e.which)) {
            this.hide();
            return;
          } 

          clearTimeout(this.timer);
          this.timer = setTimeout($.proxy(function(){
            this.setTime(this.$element.val());
          }, this), 500);
        },  

        /*
        Parse format from options and set this.is24
        */
        parseFormat: function() {
          var format = this.options.format,
              hFormat = 'HH',
              mFormat = 'mm';

          //hour format    
          $.each(['HH', 'hh', 'H', 'h'], function(i, f){
            if(format.indexOf(f) !== -1) {
              hFormat = f;
              return false;
            }
          });

          //minute format
          $.each(['mm', 'm'], function(i, f){
            if(format.indexOf(f) !== -1) {
              mFormat = f;
              return false;
            }
          });          

          //is 24 hour format
          this.is24 = hFormat.indexOf('H') !== -1; 

          this.hFormat = hFormat;
          this.mFormat = mFormat;
        },

       

        /*
        Parse value passed as string or Date object
        */
        parseTime: function(value) {
          var hour = null, 
              minute = null, 
              ampm = 'am', 
              parts = [], digits;

            value = $.trim(value);

            //try parse time from string assuming separator exist
            if(this.regexpSep) {
                parts = value.match(this.regexpSep);
            }

            if(parts && parts.length) {
              hour = parts[1] ? parseInt(parts[1], 10) : null;
              minute = parts[2] ? parseInt(parts[2], 10): null;
              ampm = (!parts[3] || parts[3].toLowerCase() === 'a') ? 'am' : 'pm';
            } else {
              //if parse with separator failed, search for 1,4-digit block and process it
              //use reversed string to start from end (usefull with full dates)
              //see http://stackoverflow.com/questions/141348/what-is-the-best-way-to-parse-a-time-into-a-date-object-from-user-input-in-javas
              value = value.split('').reverse().join('').replace(/\s/g, '');
              parts = value.match(this.regexpNoSep);
              if(parts && parts.length) {
                ampm = (!parts[1] || parts[1].toLowerCase() === 'a') ? 'am' : 'pm';
                //reverse back
                digits = parts[2].split('').reverse().join('');
                //use smart analyzing to detect hours and minutes
                switch(digits.length) {
                  case 1:
                    hour = parseInt(digits, 10); //e.g. '6'
                  break;
                  case 2:
                    hour = parseInt(digits, 10); //e.g. '16'
                    //if((this.is24 && hour > 24) || (!this.is24 && hour > 12)) { //e.g. 26
                    if(hour > 24) { //e.g. 26
                      hour = parseInt(digits[0], 10);
                      minute = parseInt(digits[1], 10);
                    }
                  break;
                  case 3:
                    hour = parseInt(digits[0], 10);  //e.g. 105
                    minute = parseInt(digits[1]+digits[2], 10); 
                    if(minute > 59) { 
                      hour = parseInt(digits[0]+digits[1], 10); //e.g. 195
                      minute = parseInt(digits[2], 10); 
                      if(hour > 24) {
                        hour = null;
                        minute = null;
                      }
                    }
                  break;
                  case 4:
                    hour = parseInt(digits[0]+digits[1], 10); //e.g. 2006
                    minute = parseInt(digits[2]+digits[3], 10);
                    if(hour > 24) {
                      hour = null;
                    }
                    if(minute > 59) {
                      minute = null;
                    }
                }
              }
            }

          return {hour: hour, minute: minute, ampm: ampm};
        },

        prepareRegexp: function() {
            //take separator from format
            var sep = this.options.format.match(/h\s*([^hm]?)\s*m/i); //HH-mm, HH:mm
            if(sep && sep.length) {
              sep = sep[1];
            } 

            //sep can be null for HH, and '' for HHmm 
            this.separator = sep;
    
            //parse from string
            //use reversed string and regexp to parse 2-digit minutes first
            //see http://stackoverflow.com/questions/141348/what-is-the-best-way-to-parse-a-time-into-a-date-object-from-user-input-in-javas
            //this.regexp = new RegExp('(a|p)?\\s*((\\d\\d?)' + sep + ')?(\\d\\d?)', 'i');

            //regexp, used with separator
            this.regexpSep = (this.separator && this.separator.length) ? new RegExp('(\\d\\d?)\\s*\\' + this.separator + '\\s*(\\d?\\d?)\\s*(a|p)?', 'i') : null;

            //second regexp applied if previous has no result or separator is empty (to reversed string)
            this.regexpNoSep = new RegExp('(a|p)?\\s*(\\d{1,4})', 'i');
        },

        /*
        Returns time as string in specified format
        */
        getTime: function(asObject) {
          if(asObject === true) {
            return {
              hour: this.hour,
              minute: this.minute,
              ampm: this.ampm
            };
          }

          var hour = this.hour !== null ? this.hour + '' : '',
              minute = this.minute !== null ? this.minute + '' : '',
              result = this.options.format;

          if(!hour.length && !minute.length) {
            return '';
          }   

          if(this.hFormat.length > 1 && hour.length === 1) {
            hour = '0' + hour;
          }   

          if(this.mFormat.length > 1 && minute.length === 1) {
            minute = '0' + minute;
          }

          //delete separator if no minutes
          if(!minute.length && this.separator) {
            result = result.replace(this.separator, '');
          }

          result = result.replace(this.hFormat, hour).replace(this.mFormat, minute);
          if(!this.is24) {
            if(result.indexOf('A') !== -1) {
               result = result.replace('A', this.ampm.toUpperCase());
            } else {
               result = result.replace('a', this.ampm);
            }
          }

          return result;
        },

        /*
        Removes widget and detach events
        */
        destroy: function() {
          this.hide();
          this.$clockface.remove();
          if(!this.isInline && this.options.trigger === 'focus') {
            this.$element.off('focus.clockface');
          }          
        }
    };

    $.fn.clockface = function ( option ) {
        var d, args = Array.apply(null, arguments);
        args.shift();

        //getTime returns string (not jQuery onject)
        if(option === 'getTime' && this.length && (d = this.eq(0).data('clockface'))) {
          return d.getTime.apply(d, args);
        }

        return this.each(function () {
            var $this = $(this),
            data = $this.data('clockface'),
            options = typeof option == 'object' && option;
            if (!data) {
                $this.data('clockface', (data = new Clockface(this, options)));
            }
            if (typeof option == 'string' && typeof data[option] == 'function') {
                data[option].apply(data, args);
            }
        });
    };  
    
    $.fn.clockface.defaults = {
        //see http://momentjs.com/docs/#/displaying/format/
        format: 'H:mm',
        trigger: 'focus' //focus|manual
    };
   

 $.fn.clockface.template = ''+
      '<div class="clockface">' +
          '<div class="l1">' +
              '<div class="cell"></div>' +
              '<div class="cell"></div>' +
              '<div class="cell"></div>' +
          '</div>' +
          '<div class="l2">' +
                '<div class="cell left"></div>' +
                '<div class="cell right"></div>' +
          '</div>'+
          '<div class="l3">' +
                '<div class="cell left"></div>' +
                '<div class="cell right"></div>' +
                '<div class="center"><a href="#" class="ampm"></a></div>' +
          '</div>'+
          '<div class="l4">' +
                '<div class="cell left"></div>' +
                '<div class="cell right"></div>' +
          '</div>'+
          '<div class="l5">' +
                '<div class="cell"></div>' +
                '<div class="cell"></div>' +
                '<div class="cell"></div>' +
          '</div>'+
      '</div>';  

}(window.jQuery));
// source --> https://shootinschool.spericorn.com/wp-content/plugins/shootin-school-plugin/includes/js/parsley.min.js?ver=1 
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):t.parsley=e(t.jQuery)}(this,function(h){"use strict";function r(t){return(r="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})(t)}function o(){return(o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t}).apply(this,arguments)}function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=[],n=!0,r=!1,s=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done)&&(i.push(a.value),!e||i.length!==e);n=!0);}catch(t){r=!0,s=t}finally{try{n||null==o.return||o.return()}finally{if(r)throw s}}return i}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function u(t){return function(t){if(Array.isArray(t)){for(var e=0,i=new Array(t.length);e<t.length;e++)i[e]=t[e];return i}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var i,t=1,e={},d={attr:function(t,e,i){var n,r,s,a=new RegExp("^"+e,"i");if(void 0===i)i={};else for(n in i)i.hasOwnProperty(n)&&delete i[n];if(!t)return i;for(n=(s=t.attributes).length;n--;)(r=s[n])&&r.specified&&a.test(r.name)&&(i[this.camelize(r.name.slice(e.length))]=this.deserializeValue(r.value));return i},checkAttr:function(t,e,i){return t.hasAttribute(e+i)},setAttr:function(t,e,i,n){t.setAttribute(this.dasherize(e+i),String(n))},getType:function(t){return t.getAttribute("type")||"text"},generateID:function(){return""+t++},deserializeValue:function(e){var t;try{return e?"true"==e||"false"!=e&&("null"==e?null:isNaN(t=Number(e))?/^[\[\{]/.test(e)?JSON.parse(e):e:t):e}catch(t){return e}},camelize:function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},dasherize:function(t){return t.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()},warn:function(){var t;window.console&&"function"==typeof window.console.warn&&(t=window.console).warn.apply(t,arguments)},warnOnce:function(t){e[t]||(e[t]=!0,this.warn.apply(this,arguments))},_resetWarnings:function(){e={}},trimString:function(t){return t.replace(/^\s+|\s+$/g,"")},parse:{date:function(t){var e=t.match(/^(\d{4,})-(\d\d)-(\d\d)$/);if(!e)return null;var i=l(e.map(function(t){return parseInt(t,10)}),4),n=(i[0],i[1]),r=i[2],s=i[3],a=new Date(n,r-1,s);return a.getFullYear()!==n||a.getMonth()+1!==r||a.getDate()!==s?null:a},string:function(t){return t},integer:function(t){return isNaN(t)?null:parseInt(t,10)},number:function(t){if(isNaN(t))throw null;return parseFloat(t)},boolean:function(t){return!/^\s*false\s*$/i.test(t)},object:function(t){return d.deserializeValue(t)},regexp:function(t){var e="";return t=/^\/.*\/(?:[gimy]*)$/.test(t)?(e=t.replace(/.*\/([gimy]*)$/,"$1"),t.replace(new RegExp("^/(.*?)/"+e+"$"),"$1")):"^"+t+"$",new RegExp(t,e)}},parseRequirement:function(t,e){var i=this.parse[t||"string"];if(!i)throw'Unknown requirement specification: "'+t+'"';var n=i(e);if(null===n)throw"Requirement is not a ".concat(t,': "').concat(e,'"');return n},namespaceEvents:function(t,e){return(t=this.trimString(t||"").split(/\s+/))[0]?h.map(t,function(t){return"".concat(t,".").concat(e)}).join(" "):""},difference:function(t,i){var n=[];return h.each(t,function(t,e){-1==i.indexOf(e)&&n.push(e)}),n},all:function(t){return h.when.apply(h,u(t).concat([42,42]))},objectCreate:Object.create||(i=function(){},function(t){if(1<arguments.length)throw Error("Second argument not supported");if("object"!=r(t))throw TypeError("Argument must be an object");i.prototype=t;var e=new i;return i.prototype=null,e}),_SubmitSelector:'input[type="submit"], button:submit'},n={namespace:"data-parsley-",inputs:"input, textarea, select",excluded:"input[type=button], input[type=submit], input[type=reset], input[type=hidden]",priorityEnabled:!0,multiple:null,group:null,uiEnabled:!0,validationThreshold:3,focus:"first",trigger:!1,triggerAfterFailure:"input",errorClass:"parsley-error",successClass:"parsley-success",classHandler:function(t){},errorsContainer:function(t){},errorsWrapper:'<ul class="parsley-errors-list"></ul>',errorTemplate:"<li></li>"},s=function(){this.__id__=d.generateID()};s.prototype={asyncSupport:!0,_pipeAccordingToValidationResult:function(){var e=this,t=function(){var t=h.Deferred();return!0!==e.validationResult&&t.reject(),t.resolve().promise()};return[t,t]},actualizeOptions:function(){return d.attr(this.element,this.options.namespace,this.domOptions),this.parent&&this.parent.actualizeOptions&&this.parent.actualizeOptions(),this},_resetOptions:function(t){for(var e in this.domOptions=d.objectCreate(this.parent.options),this.options=d.objectCreate(this.domOptions),t)t.hasOwnProperty(e)&&(this.options[e]=t[e]);this.actualizeOptions()},_listeners:null,on:function(t,e){return this._listeners=this._listeners||{},(this._listeners[t]=this._listeners[t]||[]).push(e),this},subscribe:function(t,e){h.listenTo(this,t.toLowerCase(),e)},off:function(t,e){var i=this._listeners&&this._listeners[t];if(i)if(e)for(var n=i.length;n--;)i[n]===e&&i.splice(n,1);else delete this._listeners[t];return this},unsubscribe:function(t,e){h.unsubscribeTo(this,t.toLowerCase())},trigger:function(t,e,i){e=e||this;var n,r=this._listeners&&this._listeners[t];if(r)for(var s=r.length;s--;)if(!1===(n=r[s].call(e,e,i)))return n;return!this.parent||this.parent.trigger(t,e,i)},asyncIsValid:function(t,e){return d.warnOnce("asyncIsValid is deprecated; please use whenValid instead"),this.whenValid({group:t,force:e})},_findRelated:function(){return this.options.multiple?h(this.parent.element.querySelectorAll("[".concat(this.options.namespace,'multiple="').concat(this.options.multiple,'"]'))):this.$element}};var c=function(t){h.extend(!0,this,t)};c.prototype={validate:function(t,e){if(this.fn)return 3<arguments.length&&(e=[].slice.call(arguments,1,-1)),this.fn(t,e);if(Array.isArray(t)){if(!this.validateMultiple)throw"Validator `"+this.name+"` does not handle multiple values";return this.validateMultiple.apply(this,arguments)}var i=arguments[arguments.length-1];if(this.validateDate&&i._isDateInput())return null!==(t=d.parse.date(t))&&this.validateDate.apply(this,arguments);if(this.validateNumber)return!t||!isNaN(t)&&(t=parseFloat(t),this.validateNumber.apply(this,arguments));if(this.validateString)return this.validateString.apply(this,arguments);throw"Validator `"+this.name+"` only handles multiple values"},parseRequirements:function(t,e){if("string"!=typeof t)return Array.isArray(t)?t:[t];var i=this.requirementType;if(Array.isArray(i)){for(var n=function(t,e){var i=t.match(/^\s*\[(.*)\]\s*$/);if(!i)throw'Requirement is not an array: "'+t+'"';var n=i[1].split(",").map(d.trimString);if(n.length!==e)throw"Requirement has "+n.length+" values when "+e+" are needed";return n}(t,i.length),r=0;r<n.length;r++)n[r]=d.parseRequirement(i[r],n[r]);return n}return h.isPlainObject(i)?function(t,e,i){var n=null,r={};for(var s in t)if(s){var a=i(s);"string"==typeof a&&(a=d.parseRequirement(t[s],a)),r[s]=a}else n=d.parseRequirement(t[s],e);return[n,r]}(i,t,e):[d.parseRequirement(i,t)]},requirementType:"string",priority:2};var a=function(t,e){this.__class__="ValidatorRegistry",this.locale="en",this.init(t||{},e||{})},p={email:/^((([a-zA-Z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-zA-Z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/,number:/^-?(\d*\.)?\d+(e[-+]?\d+)?$/i,integer:/^-?\d+$/,digits:/^\d+$/,alphanum:/^\w+$/i,date:{test:function(t){return null!==d.parse.date(t)}},url:new RegExp("^(?:(?:https?|ftp)://)?(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-zA-Z\\u00a1-\\uffff0-9]-*)*[a-zA-Z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-zA-Z\\u00a1-\\uffff0-9]-*)*[a-zA-Z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-zA-Z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:/\\S*)?$")};p.range=p.number;var f=function(t){var e=(""+t).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return e?Math.max(0,(e[1]?e[1].length:0)-(e[2]?+e[2]:0)):0},m=function(s,a){return function(t){for(var e=arguments.length,i=new Array(1<e?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return i.pop(),a.apply(void 0,[t].concat(u((r=s,i.map(d.parse[r])))));var r}},g=function(t){return{validateDate:m("date",t),validateNumber:m("number",t),requirementType:t.length<=2?"string":["string","string"],priority:30}};a.prototype={init:function(t,e){for(var i in this.catalog=e,this.validators=o({},this.validators),t)this.addValidator(i,t[i].fn,t[i].priority);window.Parsley.trigger("parsley:validator:init")},setLocale:function(t){if(void 0===this.catalog[t])throw new Error(t+" is not available in the catalog");return this.locale=t,this},addCatalog:function(t,e,i){return"object"===r(e)&&(this.catalog[t]=e),!0===i?this.setLocale(t):this},addMessage:function(t,e,i){return void 0===this.catalog[t]&&(this.catalog[t]={}),this.catalog[t][e]=i,this},addMessages:function(t,e){for(var i in e)this.addMessage(t,i,e[i]);return this},addValidator:function(t,e,i){if(this.validators[t])d.warn('Validator "'+t+'" is already defined.');else if(n.hasOwnProperty(t))return void d.warn('"'+t+'" is a restricted keyword and is not a valid validator name.');return this._setValidator.apply(this,arguments)},hasValidator:function(t){return!!this.validators[t]},updateValidator:function(t,e,i){return this.validators[t]?this._setValidator.apply(this,arguments):(d.warn('Validator "'+t+'" is not already defined.'),this.addValidator.apply(this,arguments))},removeValidator:function(t){return this.validators[t]||d.warn('Validator "'+t+'" is not defined.'),delete this.validators[t],this},_setValidator:function(t,e,i){for(var n in"object"!==r(e)&&(e={fn:e,priority:i}),e.validate||(e=new c(e)),(this.validators[t]=e).messages||{})this.addMessage(n,t,e.messages[n]);return this},getErrorMessage:function(t){var e;"type"===t.name?e=(this.catalog[this.locale][t.name]||{})[t.requirements]:e=this.formatMessage(this.catalog[this.locale][t.name],t.requirements);return e||this.catalog[this.locale].defaultMessage||this.catalog.en.defaultMessage},formatMessage:function(t,e){if("object"!==r(e))return"string"==typeof t?t.replace(/%s/i,e):"";for(var i in e)t=this.formatMessage(t,e[i]);return t},validators:{notblank:{validateString:function(t){return/\S/.test(t)},priority:2},required:{validateMultiple:function(t){return 0<t.length},validateString:function(t){return/\S/.test(t)},priority:512},type:{validateString:function(t,e){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},n=i.step,r=void 0===n?"any":n,s=i.base,a=void 0===s?0:s,o=p[e];if(!o)throw new Error("validator type `"+e+"` is not supported");if(!t)return!0;if(!o.test(t))return!1;if("number"===e&&!/^any$/i.test(r||"")){var l=Number(t),u=Math.max(f(r),f(a));if(f(l)>u)return!1;var d=function(t){return Math.round(t*Math.pow(10,u))};if((d(l)-d(a))%d(r)!=0)return!1}return!0},requirementType:{"":"string",step:"string",base:"number"},priority:256},pattern:{validateString:function(t,e){return!t||e.test(t)},requirementType:"regexp",priority:64},minlength:{validateString:function(t,e){return!t||t.length>=e},requirementType:"integer",priority:30},maxlength:{validateString:function(t,e){return t.length<=e},requirementType:"integer",priority:30},length:{validateString:function(t,e,i){return!t||t.length>=e&&t.length<=i},requirementType:["integer","integer"],priority:30},mincheck:{validateMultiple:function(t,e){return t.length>=e},requirementType:"integer",priority:30},maxcheck:{validateMultiple:function(t,e){return t.length<=e},requirementType:"integer",priority:30},check:{validateMultiple:function(t,e,i){return t.length>=e&&t.length<=i},requirementType:["integer","integer"],priority:30},min:g(function(t,e){return e<=t}),max:g(function(t,e){return t<=e}),range:g(function(t,e,i){return e<=t&&t<=i}),equalto:{validateString:function(t,e){if(!t)return!0;var i=h(e);return i.length?t===i.val():t===e},priority:256},euvatin:{validateString:function(t,e){if(!t)return!0;return/^[A-Z][A-Z][A-Za-z0-9 -]{2,}$/.test(t)},priority:30}}};var v={};v.Form={_actualizeTriggers:function(){var e=this;this.$element.on("submit.Parsley",function(t){e.onSubmitValidate(t)}),this.$element.on("click.Parsley",d._SubmitSelector,function(t){e.onSubmitButton(t)}),!1!==this.options.uiEnabled&&this.element.setAttribute("novalidate","")},focus:function(){if(!(this._focusedField=null)===this.validationResult||"none"===this.options.focus)return null;for(var t=0;t<this.fields.length;t++){var e=this.fields[t];if(!0!==e.validationResult&&0<e.validationResult.length&&void 0===e.options.noFocus&&(this._focusedField=e.$element,"first"===this.options.focus))break}return null===this._focusedField?null:this._focusedField.focus()},_destroyUI:function(){this.$element.off(".Parsley")}},v.Field={_reflowUI:function(){if(this._buildUI(),this._ui){var t=function t(e,i,n){for(var r=[],s=[],a=0;a<e.length;a++){for(var o=!1,l=0;l<i.length;l++)if(e[a].assert.name===i[l].assert.name){o=!0;break}o?s.push(e[a]):r.push(e[a])}return{kept:s,added:r,removed:n?[]:t(i,e,!0).added}}(this.validationResult,this._ui.lastValidationResult);this._ui.lastValidationResult=this.validationResult,this._manageStatusClass(),this._manageErrorsMessages(t),this._actualizeTriggers(),!t.kept.length&&!t.added.length||this._failedOnce||(this._failedOnce=!0,this._actualizeTriggers())}},getErrorsMessages:function(){if(!0===this.validationResult)return[];for(var t=[],e=0;e<this.validationResult.length;e++)t.push(this.validationResult[e].errorMessage||this._getErrorMessage(this.validationResult[e].assert));return t},addError:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=e.message,n=e.assert,r=e.updateClass,s=void 0===r||r;this._buildUI(),this._addError(t,{message:i,assert:n}),s&&this._errorClass()},updateError:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=e.message,n=e.assert,r=e.updateClass,s=void 0===r||r;this._buildUI(),this._updateError(t,{message:i,assert:n}),s&&this._errorClass()},removeError:function(t){var e=(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}).updateClass,i=void 0===e||e;this._buildUI(),this._removeError(t),i&&this._manageStatusClass()},_manageStatusClass:function(){this.hasConstraints()&&this.needsValidation()&&!0===this.validationResult?this._successClass():0<this.validationResult.length?this._errorClass():this._resetClass()},_manageErrorsMessages:function(t){if(void 0===this.options.errorsMessagesDisabled){if(void 0!==this.options.errorMessage)return t.added.length||t.kept.length?(this._insertErrorWrapper(),0===this._ui.$errorsWrapper.find(".parsley-custom-error-message").length&&this._ui.$errorsWrapper.append(h(this.options.errorTemplate).addClass("parsley-custom-error-message")),this._ui.$errorsWrapper.addClass("filled").find(".parsley-custom-error-message").html(this.options.errorMessage)):this._ui.$errorsWrapper.removeClass("filled").find(".parsley-custom-error-message").remove();for(var e=0;e<t.removed.length;e++)this._removeError(t.removed[e].assert.name);for(e=0;e<t.added.length;e++)this._addError(t.added[e].assert.name,{message:t.added[e].errorMessage,assert:t.added[e].assert});for(e=0;e<t.kept.length;e++)this._updateError(t.kept[e].assert.name,{message:t.kept[e].errorMessage,assert:t.kept[e].assert})}},_addError:function(t,e){var i=e.message,n=e.assert;this._insertErrorWrapper(),this._ui.$errorClassHandler.attr("aria-describedby",this._ui.errorsWrapperId),this._ui.$errorsWrapper.addClass("filled").append(h(this.options.errorTemplate).addClass("parsley-"+t).html(i||this._getErrorMessage(n)))},_updateError:function(t,e){var i=e.message,n=e.assert;this._ui.$errorsWrapper.addClass("filled").find(".parsley-"+t).html(i||this._getErrorMessage(n))},_removeError:function(t){this._ui.$errorClassHandler.removeAttr("aria-describedby"),this._ui.$errorsWrapper.removeClass("filled").find(".parsley-"+t).remove()},_getErrorMessage:function(t){var e=t.name+"Message";return void 0!==this.options[e]?window.Parsley.formatMessage(this.options[e],t.requirements):window.Parsley.getErrorMessage(t)},_buildUI:function(){if(!this._ui&&!1!==this.options.uiEnabled){var t={};this.element.setAttribute(this.options.namespace+"id",this.__id__),t.$errorClassHandler=this._manageClassHandler(),t.errorsWrapperId="parsley-id-"+(this.options.multiple?"multiple-"+this.options.multiple:this.__id__),t.$errorsWrapper=h(this.options.errorsWrapper).attr("id",t.errorsWrapperId),t.lastValidationResult=[],t.validationInformationVisible=!1,this._ui=t}},_manageClassHandler:function(){if("string"==typeof this.options.classHandler&&h(this.options.classHandler).length)return h(this.options.classHandler);var t=this.options.classHandler;if("string"==typeof this.options.classHandler&&"function"==typeof window[this.options.classHandler]&&(t=window[this.options.classHandler]),"function"==typeof t){var e=t.call(this,this);if(void 0!==e&&e.length)return e}else{if("object"===r(t)&&t instanceof jQuery&&t.length)return t;t&&d.warn("The class handler `"+t+"` does not exist in DOM nor as a global JS function")}return this._inputHolder()},_inputHolder:function(){return this.options.multiple&&"SELECT"!==this.element.nodeName?this.$element.parent():this.$element},_insertErrorWrapper:function(){var t=this.options.errorsContainer;if(0!==this._ui.$errorsWrapper.parent().length)return this._ui.$errorsWrapper.parent();if("string"==typeof t){if(h(t).length)return h(t).append(this._ui.$errorsWrapper);"function"==typeof window[t]?t=window[t]:d.warn("The errors container `"+t+"` does not exist in DOM nor as a global JS function")}return"function"==typeof t&&(t=t.call(this,this)),"object"===r(t)&&t.length?t.append(this._ui.$errorsWrapper):this._inputHolder().after(this._ui.$errorsWrapper)},_actualizeTriggers:function(){var t,e=this,i=this._findRelated();i.off(".Parsley"),this._failedOnce?i.on(d.namespaceEvents(this.options.triggerAfterFailure,"Parsley"),function(){e._validateIfNeeded()}):(t=d.namespaceEvents(this.options.trigger,"Parsley"))&&i.on(t,function(t){e._validateIfNeeded(t)})},_validateIfNeeded:function(t){var e=this;t&&/key|input/.test(t.type)&&(!this._ui||!this._ui.validationInformationVisible)&&this.getValue().length<=this.options.validationThreshold||(this.options.debounce?(window.clearTimeout(this._debounced),this._debounced=window.setTimeout(function(){return e.validate()},this.options.debounce)):this.validate())},_resetUI:function(){this._failedOnce=!1,this._actualizeTriggers(),void 0!==this._ui&&(this._ui.$errorsWrapper.removeClass("filled").children().remove(),this._resetClass(),this._ui.lastValidationResult=[],this._ui.validationInformationVisible=!1)},_destroyUI:function(){this._resetUI(),void 0!==this._ui&&this._ui.$errorsWrapper.remove(),delete this._ui},_successClass:function(){this._ui.validationInformationVisible=!0,this._ui.$errorClassHandler.removeClass(this.options.errorClass).addClass(this.options.successClass)},_errorClass:function(){this._ui.validationInformationVisible=!0,this._ui.$errorClassHandler.removeClass(this.options.successClass).addClass(this.options.errorClass)},_resetClass:function(){this._ui.$errorClassHandler.removeClass(this.options.successClass).removeClass(this.options.errorClass)}};var y=function(t,e,i){this.__class__="Form",this.element=t,this.$element=h(t),this.domOptions=e,this.options=i,this.parent=window.Parsley,this.fields=[],this.validationResult=null},_={pending:null,resolved:!0,rejected:!1};y.prototype={onSubmitValidate:function(t){var e=this;if(!0!==t.parsley){var i=this._submitSource||this.$element.find(d._SubmitSelector)[0];if(this._submitSource=null,this.$element.find(".parsley-synthetic-submit-button").prop("disabled",!0),!i||null===i.getAttribute("formnovalidate")){window.Parsley._remoteCache={};var n=this.whenValidate({event:t});"resolved"===n.state()&&!1!==this._trigger("submit")||(t.stopImmediatePropagation(),t.preventDefault(),"pending"===n.state()&&n.done(function(){e._submit(i)}))}}},onSubmitButton:function(t){this._submitSource=t.currentTarget},_submit:function(t){if(!1!==this._trigger("submit")){if(t){var e=this.$element.find(".parsley-synthetic-submit-button").prop("disabled",!1);0===e.length&&(e=h('<input class="parsley-synthetic-submit-button" type="hidden">').appendTo(this.$element)),e.attr({name:t.getAttribute("name"),value:t.getAttribute("value")})}this.$element.trigger(o(h.Event("submit"),{parsley:!0}))}},validate:function(t){if(1<=arguments.length&&!h.isPlainObject(t)){d.warnOnce("Calling validate on a parsley form without passing arguments as an object is deprecated.");var e=Array.prototype.slice.call(arguments);t={group:e[0],force:e[1],event:e[2]}}return _[this.whenValidate(t).state()]},whenValidate:function(){var t,e=this,i=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=i.group,r=i.force,s=i.event;(this.submitEvent=s)&&(this.submitEvent=o({},s,{preventDefault:function(){d.warnOnce("Using `this.submitEvent.preventDefault()` is deprecated; instead, call `this.validationResult = false`"),e.validationResult=!1}})),this.validationResult=!0,this._trigger("validate"),this._refreshFields();var a=this._withoutReactualizingFormOptions(function(){return h.map(e.fields,function(t){return t.whenValidate({force:r,group:n})})});return(t=d.all(a).done(function(){e._trigger("success")}).fail(function(){e.validationResult=!1,e.focus(),e._trigger("error")}).always(function(){e._trigger("validated")})).pipe.apply(t,u(this._pipeAccordingToValidationResult()))},isValid:function(t){if(1<=arguments.length&&!h.isPlainObject(t)){d.warnOnce("Calling isValid on a parsley form without passing arguments as an object is deprecated.");var e=Array.prototype.slice.call(arguments);t={group:e[0],force:e[1]}}return _[this.whenValid(t).state()]},whenValid:function(){var t=this,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},i=e.group,n=e.force;this._refreshFields();var r=this._withoutReactualizingFormOptions(function(){return h.map(t.fields,function(t){return t.whenValid({group:i,force:n})})});return d.all(r)},refresh:function(){return this._refreshFields(),this},reset:function(){for(var t=0;t<this.fields.length;t++)this.fields[t].reset();this._trigger("reset")},destroy:function(){this._destroyUI();for(var t=0;t<this.fields.length;t++)this.fields[t].destroy();this.$element.removeData("Parsley"),this._trigger("destroy")},_refreshFields:function(){return this.actualizeOptions()._bindFields()},_bindFields:function(){var r=this,t=this.fields;return this.fields=[],this.fieldsMappedById={},this._withoutReactualizingFormOptions(function(){r.$element.find(r.options.inputs).not(r.options.excluded).not("[".concat(r.options.namespace,"excluded=true]")).each(function(t,e){var i=new window.Parsley.Factory(e,{},r);if("Field"===i.__class__||"FieldMultiple"===i.__class__){var n=i.__class__+"-"+i.__id__;void 0===r.fieldsMappedById[n]&&(r.fieldsMappedById[n]=i,r.fields.push(i))}}),h.each(d.difference(t,r.fields),function(t,e){e.reset()})}),this},_withoutReactualizingFormOptions:function(t){var e=this.actualizeOptions;this.actualizeOptions=function(){return this};var i=t();return this.actualizeOptions=e,i},_trigger:function(t){return this.trigger("form:"+t)}};var w=function(t,e,i,n,r){var s=window.Parsley._validatorRegistry.validators[e],a=new c(s);o(this,{validator:a,name:e,requirements:i,priority:n=n||t.options[e+"Priority"]||a.priority,isDomConstraint:r=!0===r}),this._parseRequirements(t.options)},b=function(t,e,i,n){this.__class__="Field",this.element=t,this.$element=h(t),void 0!==n&&(this.parent=n),this.options=i,this.domOptions=e,this.constraints=[],this.constraintsByName={},this.validationResult=!0,this._bindConstraints()},F={pending:null,resolved:!0,rejected:!(w.prototype={validate:function(t,e){var i;return(i=this.validator).validate.apply(i,[t].concat(u(this.requirementList),[e]))},_parseRequirements:function(i){var n=this;this.requirementList=this.validator.parseRequirements(this.requirements,function(t){return i[n.name+(e=t,e[0].toUpperCase()+e.slice(1))];var e})}})};b.prototype={validate:function(t){1<=arguments.length&&!h.isPlainObject(t)&&(d.warnOnce("Calling validate on a parsley field without passing arguments as an object is deprecated."),t={options:t});var e=this.whenValidate(t);if(!e)return!0;switch(e.state()){case"pending":return null;case"resolved":return!0;case"rejected":return this.validationResult}},whenValidate:function(){var t,e=this,i=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=i.force,r=i.group;if(this.refresh(),!r||this._isInGroup(r))return this.value=this.getValue(),this._trigger("validate"),(t=this.whenValid({force:n,value:this.value,_refreshed:!0}).always(function(){e._reflowUI()}).done(function(){e._trigger("success")}).fail(function(){e._trigger("error")}).always(function(){e._trigger("validated")})).pipe.apply(t,u(this._pipeAccordingToValidationResult()))},hasConstraints:function(){return 0!==this.constraints.length},needsValidation:function(t){return void 0===t&&(t=this.getValue()),!(!t.length&&!this._isRequired()&&void 0===this.options.validateIfEmpty)},_isInGroup:function(t){return Array.isArray(this.options.group)?-1!==h.inArray(t,this.options.group):this.options.group===t},isValid:function(t){if(1<=arguments.length&&!h.isPlainObject(t)){d.warnOnce("Calling isValid on a parsley field without passing arguments as an object is deprecated.");var e=Array.prototype.slice.call(arguments);t={force:e[0],value:e[1]}}var i=this.whenValid(t);return!i||F[i.state()]},whenValid:function(){var n=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=t.force,i=void 0!==e&&e,r=t.value,s=t.group;if(t._refreshed||this.refresh(),!s||this._isInGroup(s)){if(this.validationResult=!0,!this.hasConstraints())return h.when();if(null==r&&(r=this.getValue()),!this.needsValidation(r)&&!0!==i)return h.when();var a=this._getGroupedConstraints(),o=[];return h.each(a,function(t,e){var i=d.all(h.map(e,function(t){return n._validateConstraint(r,t)}));if(o.push(i),"rejected"===i.state())return!1}),d.all(o)}},_validateConstraint:function(t,e){var i=this,n=e.validate(t,this);return!1===n&&(n=h.Deferred().reject()),d.all([n]).fail(function(t){i.validationResult instanceof Array||(i.validationResult=[]),i.validationResult.push({assert:e,errorMessage:"string"==typeof t&&t})})},getValue:function(){var t;return null==(t="function"==typeof this.options.value?this.options.value(this):void 0!==this.options.value?this.options.value:this.$element.val())?"":this._handleWhitespace(t)},reset:function(){return this._resetUI(),this._trigger("reset")},destroy:function(){this._destroyUI(),this.$element.removeData("Parsley"),this.$element.removeData("FieldMultiple"),this._trigger("destroy")},refresh:function(){return this._refreshConstraints(),this},_refreshConstraints:function(){return this.actualizeOptions()._bindConstraints()},refreshConstraints:function(){return d.warnOnce("Parsley's refreshConstraints is deprecated. Please use refresh"),this.refresh()},addConstraint:function(t,e,i,n){if(window.Parsley._validatorRegistry.validators[t]){var r=new w(this,t,e,i,n);"undefined"!==this.constraintsByName[r.name]&&this.removeConstraint(r.name),this.constraints.push(r),this.constraintsByName[r.name]=r}return this},removeConstraint:function(t){for(var e=0;e<this.constraints.length;e++)if(t===this.constraints[e].name){this.constraints.splice(e,1);break}return delete this.constraintsByName[t],this},updateConstraint:function(t,e,i){return this.removeConstraint(t).addConstraint(t,e,i)},_bindConstraints:function(){for(var t=[],e={},i=0;i<this.constraints.length;i++)!1===this.constraints[i].isDomConstraint&&(t.push(this.constraints[i]),e[this.constraints[i].name]=this.constraints[i]);for(var n in this.constraints=t,this.constraintsByName=e,this.options)this.addConstraint(n,this.options[n],void 0,!0);return this._bindHtml5Constraints()},_bindHtml5Constraints:function(){null!==this.element.getAttribute("required")&&this.addConstraint("required",!0,void 0,!0),null!==this.element.getAttribute("pattern")&&this.addConstraint("pattern",this.element.getAttribute("pattern"),void 0,!0);var t=this.element.getAttribute("min"),e=this.element.getAttribute("max");null!==t&&null!==e?this.addConstraint("range",[t,e],void 0,!0):null!==t?this.addConstraint("min",t,void 0,!0):null!==e&&this.addConstraint("max",e,void 0,!0),null!==this.element.getAttribute("minlength")&&null!==this.element.getAttribute("maxlength")?this.addConstraint("length",[this.element.getAttribute("minlength"),this.element.getAttribute("maxlength")],void 0,!0):null!==this.element.getAttribute("minlength")?this.addConstraint("minlength",this.element.getAttribute("minlength"),void 0,!0):null!==this.element.getAttribute("maxlength")&&this.addConstraint("maxlength",this.element.getAttribute("maxlength"),void 0,!0);var i=d.getType(this.element);return"number"===i?this.addConstraint("type",["number",{step:this.element.getAttribute("step")||"1",base:t||this.element.getAttribute("value")}],void 0,!0):/^(email|url|range|date)$/i.test(i)?this.addConstraint("type",i,void 0,!0):this},_isRequired:function(){return void 0!==this.constraintsByName.required&&!1!==this.constraintsByName.required.requirements},_trigger:function(t){return this.trigger("field:"+t)},_handleWhitespace:function(t){return!0===this.options.trimValue&&d.warnOnce('data-parsley-trim-value="true" is deprecated, please use data-parsley-whitespace="trim"'),"squish"===this.options.whitespace&&(t=t.replace(/\s{2,}/g," ")),"trim"!==this.options.whitespace&&"squish"!==this.options.whitespace&&!0!==this.options.trimValue||(t=d.trimString(t)),t},_isDateInput:function(){var t=this.constraintsByName.type;return t&&"date"===t.requirements},_getGroupedConstraints:function(){if(!1===this.options.priorityEnabled)return[this.constraints];for(var t=[],e={},i=0;i<this.constraints.length;i++){var n=this.constraints[i].priority;e[n]||t.push(e[n]=[]),e[n].push(this.constraints[i])}return t.sort(function(t,e){return e[0].priority-t[0].priority}),t}};var C=function(){this.__class__="FieldMultiple"};C.prototype={addElement:function(t){return this.$elements.push(t),this},_refreshConstraints:function(){var t;if(this.constraints=[],"SELECT"===this.element.nodeName)return this.actualizeOptions()._bindConstraints(),this;for(var e=0;e<this.$elements.length;e++)if(h("html").has(this.$elements[e]).length){t=this.$elements[e].data("FieldMultiple")._refreshConstraints().constraints;for(var i=0;i<t.length;i++)this.addConstraint(t[i].name,t[i].requirements,t[i].priority,t[i].isDomConstraint)}else this.$elements.splice(e,1);return this},getValue:function(){if("function"==typeof this.options.value)return this.options.value(this);if(void 0!==this.options.value)return this.options.value;if("INPUT"===this.element.nodeName){var t=d.getType(this.element);if("radio"===t)return this._findRelated().filter(":checked").val()||"";if("checkbox"===t){var e=[];return this._findRelated().filter(":checked").each(function(){e.push(h(this).val())}),e}}return"SELECT"===this.element.nodeName&&null===this.$element.val()?[]:this.$element.val()},_init:function(){return this.$elements=[this.$element],this}};var A=function(t,e,i){this.element=t,this.$element=h(t);var n=this.$element.data("Parsley");if(n)return void 0!==i&&n.parent===window.Parsley&&(n.parent=i,n._resetOptions(n.options)),"object"===r(e)&&o(n.options,e),n;if(!this.$element.length)throw new Error("You must bind Parsley on an existing element.");if(void 0!==i&&"Form"!==i.__class__)throw new Error("Parent instance must be a Form instance");return this.parent=i||window.Parsley,this.init(e)};A.prototype={init:function(t){return this.__class__="Parsley",this.__version__="2.9.1",this.__id__=d.generateID(),this._resetOptions(t),"FORM"===this.element.nodeName||d.checkAttr(this.element,this.options.namespace,"validate")&&!this.$element.is(this.options.inputs)?this.bind("parsleyForm"):this.isMultiple()?this.handleMultiple():this.bind("parsleyField")},isMultiple:function(){var t=d.getType(this.element);return"radio"===t||"checkbox"===t||"SELECT"===this.element.nodeName&&null!==this.element.getAttribute("multiple")},handleMultiple:function(){var t,e,n=this;if(this.options.multiple=this.options.multiple||(t=this.element.getAttribute("name"))||this.element.getAttribute("id"),"SELECT"===this.element.nodeName&&null!==this.element.getAttribute("multiple"))return this.options.multiple=this.options.multiple||this.__id__,this.bind("parsleyFieldMultiple");if(!this.options.multiple)return d.warn("To be bound by Parsley, a radio, a checkbox and a multiple select input must have either a name or a multiple option.",this.$element),this;this.options.multiple=this.options.multiple.replace(/(:|\.|\[|\]|\{|\}|\$)/g,""),t&&h('input[name="'+t+'"]').each(function(t,e){var i=d.getType(e);"radio"!==i&&"checkbox"!==i||e.setAttribute(n.options.namespace+"multiple",n.options.multiple)});for(var i=this._findRelated(),r=0;r<i.length;r++)if(void 0!==(e=h(i.get(r)).data("Parsley"))){this.$element.data("FieldMultiple")||e.addElement(this.$element);break}return this.bind("parsleyField",!0),e||this.bind("parsleyFieldMultiple")},bind:function(t,e){var i;switch(t){case"parsleyForm":i=h.extend(new y(this.element,this.domOptions,this.options),new s,window.ParsleyExtend)._bindFields();break;case"parsleyField":i=h.extend(new b(this.element,this.domOptions,this.options,this.parent),new s,window.ParsleyExtend);break;case"parsleyFieldMultiple":i=h.extend(new b(this.element,this.domOptions,this.options,this.parent),new C,new s,window.ParsleyExtend)._init();break;default:throw new Error(t+"is not a supported Parsley type")}return this.options.multiple&&d.setAttr(this.element,this.options.namespace,"multiple",this.options.multiple),void 0!==e?this.$element.data("FieldMultiple",i):(this.$element.data("Parsley",i),i._actualizeTriggers(),i._trigger("init")),i}};var E=h.fn.jquery.split(".");if(parseInt(E[0])<=1&&parseInt(E[1])<8)throw"The loaded version of jQuery is too old. Please upgrade to 1.8.x or better.";E.forEach||d.warn("Parsley requires ES5 to run properly. Please include https://github.com/es-shims/es5-shim");var x=o(new s,{element:document,$element:h(document),actualizeOptions:null,_resetOptions:null,Factory:A,version:"2.9.1"});o(b.prototype,v.Field,s.prototype),o(y.prototype,v.Form,s.prototype),o(A.prototype,s.prototype),h.fn.parsley=h.fn.psly=function(t){if(1<this.length){var e=[];return this.each(function(){e.push(h(this).parsley(t))}),e}if(0!=this.length)return new A(this[0],t)},void 0===window.ParsleyExtend&&(window.ParsleyExtend={}),x.options=o(d.objectCreate(n),window.ParsleyConfig),window.ParsleyConfig=x.options,window.Parsley=window.psly=x,x.Utils=d,window.ParsleyUtils={},h.each(d,function(t,e){"function"==typeof e&&(window.ParsleyUtils[t]=function(){return d.warnOnce("Accessing `window.ParsleyUtils` is deprecated. Use `window.Parsley.Utils` instead."),d[t].apply(d,arguments)})});var $=window.Parsley._validatorRegistry=new a(window.ParsleyConfig.validators,window.ParsleyConfig.i18n);window.ParsleyValidator={},h.each("setLocale addCatalog addMessage addMessages getErrorMessage formatMessage addValidator updateValidator removeValidator hasValidator".split(" "),function(t,e){window.Parsley[e]=function(){return $[e].apply($,arguments)},window.ParsleyValidator[e]=function(){var t;return d.warnOnce("Accessing the method '".concat(e,"' through Validator is deprecated. Simply call 'window.Parsley.").concat(e,"(...)'")),(t=window.Parsley)[e].apply(t,arguments)}}),window.Parsley.UI=v,window.ParsleyUI={removeError:function(t,e,i){var n=!0!==i;return d.warnOnce("Accessing UI is deprecated. Call 'removeError' on the instance directly. Please comment in issue 1073 as to your need to call this method."),t.removeError(e,{updateClass:n})},getErrorsMessages:function(t){return d.warnOnce("Accessing UI is deprecated. Call 'getErrorsMessages' on the instance directly."),t.getErrorsMessages()}},h.each("addError updateError".split(" "),function(t,a){window.ParsleyUI[a]=function(t,e,i,n,r){var s=!0!==r;return d.warnOnce("Accessing UI is deprecated. Call '".concat(a,"' on the instance directly. Please comment in issue 1073 as to your need to call this method.")),t[a](e,{message:i,assert:n,updateClass:s})}}),!1!==window.ParsleyConfig.autoBind&&h(function(){h("[data-parsley-validate]").length&&h("[data-parsley-validate]").parsley()});var V=h({}),P=function(){d.warnOnce("Parsley's pubsub module is deprecated; use the 'on' and 'off' methods on parsley instances or window.Parsley")};function O(e,i){return e.parsleyAdaptedCallback||(e.parsleyAdaptedCallback=function(){var t=Array.prototype.slice.call(arguments,0);t.unshift(this),e.apply(i||V,t)}),e.parsleyAdaptedCallback}var T="parsley:";function M(t){return 0===t.lastIndexOf(T,0)?t.substr(T.length):t}return h.listen=function(t,e){var i;if(P(),"object"===r(arguments[1])&&"function"==typeof arguments[2]&&(i=arguments[1],e=arguments[2]),"function"!=typeof e)throw new Error("Wrong parameters");window.Parsley.on(M(t),O(e,i))},h.listenTo=function(t,e,i){if(P(),!(t instanceof b||t instanceof y))throw new Error("Must give Parsley instance");if("string"!=typeof e||"function"!=typeof i)throw new Error("Wrong parameters");t.on(M(e),O(i))},h.unsubscribe=function(t,e){if(P(),"string"!=typeof t||"function"!=typeof e)throw new Error("Wrong arguments");window.Parsley.off(M(t),e.parsleyAdaptedCallback)},h.unsubscribeTo=function(t,e){if(P(),!(t instanceof b||t instanceof y))throw new Error("Must give Parsley instance");t.off(M(e))},h.unsubscribeAll=function(e){P(),window.Parsley.off(M(e)),h("form,input,textarea,select").each(function(){var t=h(this).data("Parsley");t&&t.off(M(e))})},h.emit=function(t,e){var i;P();var n=e instanceof b||e instanceof y,r=Array.prototype.slice.call(arguments,n?2:1);r.unshift(M(t)),n||(e=window.Parsley),(i=e).trigger.apply(i,u(r))},h.extend(!0,x,{asyncValidators:{default:{fn:function(t){return 200<=t.status&&t.status<300},url:!1},reverse:{fn:function(t){return t.status<200||300<=t.status},url:!1}},addAsyncValidator:function(t,e,i,n){return x.asyncValidators[t]={fn:e,url:i||!1,options:n||{}},this}}),x.addValidator("remote",{requirementType:{"":"string",validator:"string",reverse:"boolean",options:"object"},validateString:function(t,e,i,n){var r,s,a={},o=i.validator||(!0===i.reverse?"reverse":"default");if(void 0===x.asyncValidators[o])throw new Error("Calling an undefined async validator: `"+o+"`");-1<(e=x.asyncValidators[o].url||e).indexOf("{value}")?e=e.replace("{value}",encodeURIComponent(t)):a[n.element.getAttribute("name")||n.element.getAttribute("id")]=t;var l=h.extend(!0,i.options||{},x.asyncValidators[o].options);r=h.extend(!0,{},{url:e,data:a,type:"GET"},l),n.trigger("field:ajaxoptions",n,r),s=h.param(r),void 0===x._remoteCache&&(x._remoteCache={});var u=x._remoteCache[s]=x._remoteCache[s]||h.ajax(r),d=function(){var t=x.asyncValidators[o].fn.call(n,u,e,i);return t||(t=h.Deferred().reject()),h.when(t)};return u.then(d,d)},priority:-1}),x.on("form:submit",function(){x._remoteCache={}}),s.prototype.addAsyncValidator=function(){return d.warnOnce("Accessing the method `addAsyncValidator` through an instance is deprecated. Simply call `Parsley.addAsyncValidator(...)`"),x.addAsyncValidator.apply(x,arguments)},x.addMessages("en",{defaultMessage:"This value seems to be invalid.",type:{email:"This value should be a valid email.",url:"This value should be a valid url.",number:"This value should be a valid number.",integer:"This value should be a valid integer.",digits:"This value should be digits.",alphanum:"This value should be alphanumeric."},notblank:"This value should not be blank.",required:"This value is required.",pattern:"This value seems to be invalid.",min:"This value should be greater than or equal to %s.",max:"This value should be lower than or equal to %s.",range:"This value should be between %s and %s.",minlength:"This value is too short. It should have %s characters or more.",maxlength:"This value is too long. It should have %s characters or fewer.",length:"This value length is invalid. It should be between %s and %s characters long.",mincheck:"You must select at least %s choices.",maxcheck:"You must select %s choices or fewer.",check:"You must select between %s and %s choices.",equalto:"This value should be the same.",euvatin:"It's not a valid VAT Identification Number."}),x.setLocale("en"),(new function(){var n=this,r=window||global;o(this,{isNativeEvent:function(t){return t.originalEvent&&!1!==t.originalEvent.isTrusted},fakeInputEvent:function(t){n.isNativeEvent(t)&&h(t.target).trigger("input")},misbehaves:function(t){n.isNativeEvent(t)&&(n.behavesOk(t),h(document).on("change.inputevent",t.data.selector,n.fakeInputEvent),n.fakeInputEvent(t))},behavesOk:function(t){n.isNativeEvent(t)&&h(document).off("input.inputevent",t.data.selector,n.behavesOk).off("change.inputevent",t.data.selector,n.misbehaves)},install:function(){if(!r.inputEventPatched){r.inputEventPatched="0.0.3";for(var t=["select",'input[type="checkbox"]','input[type="radio"]','input[type="file"]'],e=0;e<t.length;e++){var i=t[e];h(document).on("input.inputevent",i,{selector:i},n.behavesOk).on("change.inputevent",i,{selector:i},n.misbehaves)}}},uninstall:function(){delete r.inputEventPatched,h(document).off(".inputevent")}})}).install(),x});
//# sourceMappingURL=parsley.min.js.map;