/*

  Author - Rudolf Naprstek
  Website - http://www.thimbleopensource.com/tutorials-snippets/jquery-plugin-filter-text-input
  Version - 1.5.3
  Release - 12th February 2014

  Thanks to Niko Halink from ARGH!media for bugfix!
 
  Remy Blom: Added a callback function when the filter surpresses a keypress in order to give user feedback

  Don Myers: Added extension for using predefined filter masks

  Richard Eddy: Added extension for using negative number
  

*/

(function($){  
  
    $.fn.extend({   

        filter_input: function(options) {

          var defaults = {  
              regex:".",
              negkey: false, // use "-" if you want to allow minus sign at the beginning of the string
              live:false,
              events:'keypress paste'
          }  
                
          var options =  $.extend(defaults, options);  
          
          function filter_input_function(event) {

            var input = (event.input) ? event.input : $(this);
            if (event.ctrlKey || event.altKey) return;
            if (event.type=='keypress') {

              var key = event.charCode ? event.charCode : event.keyCode ? event.keyCode : 0;

              // 8 = backspace, 9 = tab, 13 = enter, 35 = end, 36 = home, 37 = left, 39 = right, 46 = delete
              if (key == 8 || key == 9 || key == 13 || key == 35 || key == 36|| key == 37 || key == 39 || key == 46) {

                // if charCode = key & keyCode = 0
                // 35 = #, 36 = $, 37 = %, 39 = ', 46 = .
         
                if (event.charCode == 0 && event.keyCode == key) {
                  return true;                                             
                }
              }
              var string = String.fromCharCode(key);
              // if they pressed the defined negative key
              if (options.negkey && string == options.negkey) {
                // if there is already one at the beginning, remove it
                if (input.val().substr(0, 1) == string) {
                  input.val(input.val().substring(1, input.val().length)).change();
                } else {
                  // it isn't there so add it to the beginning of the string
                  input.val(string + input.val()).change();
                }
                return false;
              }
              var regex = new RegExp(options.regex);
            } else if (event.type=='paste') {
              input.data('value_before_paste', event.target.value);
              setTimeout(function(){
                filter_input_function({type:'after_paste', input:input});
              }, 1);
              return true;
            } else if (event.type=='after_paste') {
              var string = input.val();
              var regex = new RegExp('^('+options.regex+')+$');
            } else {
              return false;
            }

            if (regex.test(string)) {
              return true;
            } else if (typeof(options.feedback) == 'function') {
              options.feedback.call(this, string);
            }
            if (event.type=='after_paste') input.val(input.data('value_before_paste'));
            return false;
          }
          
          var jquery_version = $.fn.jquery.split('.');
          if (options.live) {
            if (parseInt(jquery_version[0]) >= 1 && parseInt(jquery_version[1]) >= 7) {
              $(this).on(options.events, filter_input_function); 
            } else {
              $(this).live(options.events, filter_input_function); 
            }
          } else {
            return this.each(function() {  
              var input = $(this);
              if (parseInt(jquery_version[0]) >= 1 && parseInt(jquery_version[1]) >= 7) {
                input.off(options.events).on(options.events, filter_input_function);
              } else {
                input.unbind(options.events).bind(options.events, filter_input_function);
              }
            });  
          }
          
        }  
    });  
      
})(jQuery); 

/*
  Author - Don Myers
  Version - 0.1.0
  Release - March 1st 2013
*/

  /*
  use any of these filters or regular expression in some cases the regular expression is shorter but for some people the "names" might be easier

  ie.
   <input type="text" name="first_name" value="" data-mask="[a-zA-Z ]" placeholder="eg. John"/>
   <input type="text" name="last_name" value="" data-mask="int" placeholder="eg. Smith"/>

*/

/*
jQuery(document).ready(function() {

  var masks = {
    'int':     /[\d]/,
    'float':     /[\d\.]/,
    'money':    /[\d\.\s,]/,
    'num':      /[\d\-\.]/,
    'hex':      /[0-9a-f]/i,
    'email':    /[a-z0-9_\.\-@]/i,
    'alpha':    /[a-z_]/i,
    'alphanum': /[a-z0-9_]/i,
    'alphanumlower':/[a-z0-9_]/,
    'alphaspace':    /[a-z ]/i,
    'alphanumspace': /[a-z0-9_ ]/i,
    'alphanumspacelower':/[a-z0-9_ ]/
  };

  jQuery('input[data-mask]').each(function(idx) {
    var mask = jQuery(this).data('mask');
    var regex = (masks[mask]) ? masks[mask] : mask;

    jQuery(this).filter_input({ regex: regex, live: true }); 
  });
});

*/
/*
    jQuery Masked Input Plugin
    Copyright (c) 2007 - 2015 Josh Bush (digitalbush.com)
    Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license)
    Version: 1.4.1
*/
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b,c=navigator.userAgent,d=/iphone/i.test(c),e=/chrome/i.test(c),f=/android/i.test(c);a.mask={definitions:{9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},autoclear:!0,dataName:"rawMaskFn",placeholder:"_"},a.fn.extend({caret:function(a,b){var c;if(0!==this.length&&!this.is(":hidden"))return"number"==typeof a?(b="number"==typeof b?b:a,this.each(function(){this.setSelectionRange?this.setSelectionRange(a,b):this.createTextRange&&(c=this.createTextRange(),c.collapse(!0),c.moveEnd("character",b),c.moveStart("character",a),c.select())})):(this[0].setSelectionRange?(a=this[0].selectionStart,b=this[0].selectionEnd):document.selection&&document.selection.createRange&&(c=document.selection.createRange(),a=0-c.duplicate().moveStart("character",-1e5),b=a+c.text.length),{begin:a,end:b})},unmask:function(){return this.trigger("unmask")},mask:function(c,g){var h,i,j,k,l,m,n,o;if(!c&&this.length>0){h=a(this[0]);var p=h.data(a.mask.dataName);return p?p():void 0}return g=a.extend({autoclear:a.mask.autoclear,placeholder:a.mask.placeholder,completed:null},g),i=a.mask.definitions,j=[],k=n=c.length,l=null,a.each(c.split(""),function(a,b){"?"==b?(n--,k=a):i[b]?(j.push(new RegExp(i[b])),null===l&&(l=j.length-1),k>a&&(m=j.length-1)):j.push(null)}),this.trigger("unmask").each(function(){function h(){if(g.completed){for(var a=l;m>=a;a++)if(j[a]&&C[a]===p(a))return;g.completed.call(B)}}function p(a){return g.placeholder.charAt(a<g.placeholder.length?a:0)}function q(a){for(;++a<n&&!j[a];);return a}function r(a){for(;--a>=0&&!j[a];);return a}function s(a,b){var c,d;if(!(0>a)){for(c=a,d=q(b);n>c;c++)if(j[c]){if(!(n>d&&j[c].test(C[d])))break;C[c]=C[d],C[d]=p(d),d=q(d)}z(),B.caret(Math.max(l,a))}}function t(a){var b,c,d,e;for(b=a,c=p(a);n>b;b++)if(j[b]){if(d=q(b),e=C[b],C[b]=c,!(n>d&&j[d].test(e)))break;c=e}}function u(){var a=B.val(),b=B.caret();if(o&&o.length&&o.length>a.length){for(A(!0);b.begin>0&&!j[b.begin-1];)b.begin--;if(0===b.begin)for(;b.begin<l&&!j[b.begin];)b.begin++;B.caret(b.begin,b.begin)}else{for(A(!0);b.begin<n&&!j[b.begin];)b.begin++;B.caret(b.begin,b.begin)}h()}function v(){A(),B.val()!=E&&B.change()}function w(a){if(!B.prop("readonly")){var b,c,e,f=a.which||a.keyCode;o=B.val(),8===f||46===f||d&&127===f?(b=B.caret(),c=b.begin,e=b.end,e-c===0&&(c=46!==f?r(c):e=q(c-1),e=46===f?q(e):e),y(c,e),s(c,e-1),a.preventDefault()):13===f?v.call(this,a):27===f&&(B.val(E),B.caret(0,A()),a.preventDefault())}}function x(b){if(!B.prop("readonly")){var c,d,e,g=b.which||b.keyCode,i=B.caret();if(!(b.ctrlKey||b.altKey||b.metaKey||32>g)&&g&&13!==g){if(i.end-i.begin!==0&&(y(i.begin,i.end),s(i.begin,i.end-1)),c=q(i.begin-1),n>c&&(d=String.fromCharCode(g),j[c].test(d))){if(t(c),C[c]=d,z(),e=q(c),f){var k=function(){a.proxy(a.fn.caret,B,e)()};setTimeout(k,0)}else B.caret(e);i.begin<=m&&h()}b.preventDefault()}}}function y(a,b){var c;for(c=a;b>c&&n>c;c++)j[c]&&(C[c]=p(c))}function z(){B.val(C.join(""))}function A(a){var b,c,d,e=B.val(),f=-1;for(b=0,d=0;n>b;b++)if(j[b]){for(C[b]=p(b);d++<e.length;)if(c=e.charAt(d-1),j[b].test(c)){C[b]=c,f=b;break}if(d>e.length){y(b+1,n);break}}else C[b]===e.charAt(d)&&d++,k>b&&(f=b);return a?z():k>f+1?g.autoclear||C.join("")===D?(B.val()&&B.val(""),y(0,n)):z():(z(),B.val(B.val().substring(0,f+1))),k?b:l}var B=a(this),C=a.map(c.split(""),function(a,b){return"?"!=a?i[a]?p(b):a:void 0}),D=C.join(""),E=B.val();B.data(a.mask.dataName,function(){return a.map(C,function(a,b){return j[b]&&a!=p(b)?a:null}).join("")}),B.one("unmask",function(){B.off(".mask").removeData(a.mask.dataName)}).on("focus.mask",function(){if(!B.prop("readonly")){clearTimeout(b);var a;E=B.val(),a=A(),b=setTimeout(function(){B.get(0)===document.activeElement&&(z(),a==c.replace("?","").length?B.caret(0,a):B.caret(a))},10)}}).on("blur.mask",v).on("keydown.mask",w).on("keypress.mask",x).on("input.mask paste.mask",function(){B.prop("readonly")||setTimeout(function(){var a=A(!0);B.caret(a),h()},0)}),e&&f&&B.off("input.mask").on("input.mask",u),A()})}})});
/*
 *  jQuery StarRatingSvg v1.1.0
 *
 *  http://github.com/nashio/star-rating-svg
 *  Author: Ignacio Chavez
 *  Licensed under MIT
 */

;(function ( $, window, document, undefined ) {

  'use strict';

  // Create the defaults once
  var pluginName = 'starRating';
  var noop = function(){};
  var defaults = {
    totalStars: 5,
    useFullStars: false,
    starShape: 'straight',
    emptyColor: 'lightgray',
    hoverColor: 'orange',
    activeColor: 'gold',
    useGradient: true,
    readOnly: false,
    disableAfterRate: true,
    baseUrl: false,
    starGradient: {
      start: '#FEF7CD',
      end: '#FF9511'
    },
    strokeWidth: 4,
    fillColor: 'black',
	fillHovered:'black',
    initialRating: 0,
    starSize: 40,
    callback: noop,
    onHover: noop,
    onLeave: noop
  };

	// The actual plugin constructor
  var Plugin = function( element, options ) {
    var _rating;
    this.element = element;
    this.$el = $(element);
    this.settings = $.extend( {}, defaults, options );

    // grab rating if defined on the element
    _rating = this.$el.data('rating') || this.settings.initialRating;
    this._state = {
      // round to the nearest half
      rating: (Math.round( _rating * 2 ) / 2).toFixed(1)
    };

    // create unique id for stars
    this._uid = Math.floor( Math.random() * 999 );

    // override gradient if not used
    if( !options.starGradient && !this.settings.useGradient ){
      this.settings.starGradient.start = this.settings.starGradient.end = this.settings.activeColor;
    }

    this._defaults = defaults;
    this._name = pluginName;
    this.init();
  };

  var methods = {
    init: function () {
      this.renderMarkup();
      this.addListeners();
      this.initRating();
    },

    addListeners: function(){
      if( this.settings.readOnly ){ return; }
      this.$stars.on('mouseover', this.hoverRating.bind(this));
      this.$stars.on('mouseout', this.restoreState.bind(this));
      this.$stars.on('click', this.handleRating.bind(this));
    },

    // apply styles to hovered stars
    hoverRating: function (e) {    
      var index = this.getIndex(e);
      this.paintStars(index, 'hovered');
      this.settings.onHover(index + 1, this._state.rating, this.$el);
    },

    // clicked on a rate, apply style and state
    handleRating: function(e){
      var index = this.getIndex(e);
      var rating = index + 1;

      this.applyRating(rating, this.$el);
      this.executeCallback( rating, this.$el );

      if(this.settings.disableAfterRate){
        this.$stars.off();
      }
    },

    applyRating: function(rating){
      var index = rating - 1;
      // paint selected and remove hovered color
      this.paintStars(index, 'active');
      this._state.rating = index + 1;
    },

    restoreState: function (e) {     
      var index = this.getIndex(e);
      var rating = this._state.rating || -1;
      this.paintStars(rating - 1, 'active');
      this.settings.onLeave(index + 1, this._state.rating, this.$el);
    },

    getIndex: function(e){
      var $target = $(e.currentTarget);
      var width = $target.width();
      var side = $(e.target).attr('data-side');

      // hovered outside the star, calculate by pixel instead
      side = (!side) ? this.getOffsetByPixel(e, $target, width) : side;
      side = (this.settings.useFullStars) ? 'right' : side ;

      // get index for half or whole star
      var index = $target.index();// - ((side === 'left') ? 0.5 : 0);

      // pointer is way to the left, rating should be none
        // index = ( index < 0.5 && (e.offsetX < width / 4) ) ? -1 : index;
      return index;
    },

    getOffsetByPixel: function(e, $target, width){
      var leftX = e.pageX - $target.offset().left;
      return ( leftX <= (width / 2) && !this.settings.useFullStars) ? 'left' : 'right';
    },

    initRating: function(){
      this.paintStars(this._state.rating - 1, 'active');
    },

    paintStars: function(endIndex, stateClass){
      var $polygonLeft;
      var $polygonRight;
      var leftClass;
      var rightClass;

      $.each(this.$stars, function(index, star){
        $polygonLeft = $(star).find('[data-side="left"]');
        $polygonRight = $(star).find('[data-side="right"]');
        leftClass = rightClass = (index <= endIndex) ? stateClass : 'empty';

        // has another half rating, add half star
        leftClass = ( index - endIndex === 0.5 ) ? stateClass : leftClass;

        $polygonLeft.attr('class', 'svg-'  + leftClass + '-' + this._uid);
        $polygonRight.attr('class', 'svg-'  + rightClass + '-' + this._uid);

      }.bind(this));
    },

    renderMarkup: function () {
      var s = this.settings;
      var baseUrl = s.baseUrl ? location.href.split('#')[0] : '';

      // inject an svg manually to have control over attributes
      var star = '<div class="jq-star" style="width:' + s.starSize+ 'px;  height:' + s.starSize + 'px;"><svg version="1.0" class="jq-star-svg" xmlns="http://www.w3.org/2000/svg" ' + this.getSvgDimensions(s.starShape) +  '  xml:space="preserve"><style type="text/css">.svg-empty-' + this._uid + '{fill:'+s.fillColor+';}.svg-hovered-' + this._uid + '{fill:'+s.fillHovered+';}.svg-active-' + this._uid + '{fill:'+s.fillHovered+';}</style>' +	  
      this.getLinearGradient(this._uid + '_SVGID_1_', s.emptyColor, s.emptyColor, s.starShape) +
      this.getLinearGradient(this._uid + '_SVGID_2_', s.hoverColor, s.hoverColor, s.starShape) +
      this.getLinearGradient(this._uid + '_SVGID_3_', s.starGradient.start, s.starGradient.end, s.starShape) +
      this.getVectorPath(this._uid, {
        starShape: s.starShape,
        strokeWidth: s.strokeWidth,
        fillColor: s.fillColor
      } ) +
      '</svg></div>';

      // inject svg markup
      var starsMarkup = '';
      for( var i = 0; i < s.totalStars; i++){
        starsMarkup += star;
      }
      this.$el.append(starsMarkup);
      this.$stars = this.$el.find('.jq-star');
    },

    getVectorPath: function(id, attrs){
      return (attrs.starShape === 'rounded') ?
        this.getRoundedVectorPath(id, attrs) : this.getSpikeVectorPath(id, attrs);
    },

    getSpikeVectorPath: function(id, attrs){
      return '<polygon data-side="center" class="svg-empty-' + id + '" points="281.1,129.8 364,55.7 255.5,46.8 214,-59 172.5,46.8 64,55.4 146.8,129.7 121.1,241 212.9,181.1 213.9,181 306.5,241 " style="fill: transparent; stroke: ' + attrs.fillColor + ';" />' +
        '<polygon data-side="left" class="svg-empty-' + id + '" points="281.1,129.8 364,55.7 255.5,46.8 214,-59 172.5,46.8 64,55.4 146.8,129.7 121.1,241 213.9,181.1 213.9,181 306.5,241 " style="stroke-opacity: 1;" />';
    },

    getRoundedVectorPath: function(id, attrs){
      var fullPoints = 'M520.9,336.5c-3.8-11.8-14.2-20.5-26.5-22.2l-140.9-20.5l-63-127.7 c-5.5-11.2-16.8-18.2-29.3-18.2c-12.5,0-23.8,7-29.3,18.2l-63,127.7L28,314.2C15.7,316,5.4,324.7,1.6,336.5S1,361.3,9.9,370 l102,99.4l-24,140.3c-2.1,12.3,2.9,24.6,13,32c5.7,4.2,12.4,6.2,19.2,6.2c5.2,0,10.5-1.2,15.2-3.8l126-66.3l126,66.2 c4.8,2.6,10,3.8,15.2,3.8c6.8,0,13.5-2.1,19.2-6.2c10.1-7.3,15.1-19.7,13-32l-24-140.3l102-99.4 C521.6,361.3,524.8,348.3,520.9,336.5z';
	  fullPoints = 'M18.7,24c-0.2,0-0.4-0.1-0.6-0.2L12,20.1l-6.2,3.7c-0.6,0.3-0.9,0.2-1.2,0c-0.4-0.3-0.5-0.7-0.4-1.1l1.6-7	L0.3,11C0,10.7-0.1,10.1,0.1,9.7C0.3,9.3,0.6,9,1,9l7.2-0.6L11,1.7C11.2,1.3,11.6,1,12,1l0,0c0.4,0,0.8,0.3,1,0.7l2.8,6.7L23.1,9	c0.4,0,0.8,0.3,0.9,0.8c0.1,0.4,0,0.9-0.3,1.2l-5.4,4.7l1.6,7c0.1,0.4-0.1,0.9-0.4,1.1C19.2,23.9,19.1,24,18.7,24z M12,2L12,2L9,9	C8.9,9.2,8.8,9.3,8.6,9.3L1,10.1l0,0L6.7,15c0.1,0.1,0.2,0.3,0.2,0.5l-1.6,7.4v0l6.4-3.9c0.2-0.1,0.4-0.1,0.5,0l6.5,3.8l0,0L17,15.6	c0-0.2,0-0.3,0.2-0.5l5.7-5c0-0.1,0,0,0,0l-7.5-0.7c-0.2,0-0.3-0.1-0.4-0.3L12,2C12.1,2.1,12.1,2.1,12,2C12.1,2,12.1,2,12,2z';
 	  return '<path data-side="right" class="svg-empty-' + id + '" d="' + fullPoints + '"  />';
    },

    getSvgDimensions: function(starShape){
      return (starShape === 'rounded') ? 'x="0px" y="0px" viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;"' : 'x="0px" y="0px" width="305px" height="305px" viewBox="60 -62 309 309" style="enable-background:new 64 -59 305 305;';
    },

    getLinearGradient: function(id, startColor, endColor, starShape){
      var height = (starShape === 'rounded') ? 500 : 250;
      return '<linearGradient id="' + id + '" gradientUnits="userSpaceOnUse" x1="0" y1="-50" x2="0" y2="' + height + '"><stop  offset="0" style="stop-color:' + startColor + '"/><stop  offset="1" style="stop-color:' + endColor + '"/> </linearGradient>';
    },

    executeCallback: function(rating, $el){
      var callback = this.settings.callback;
      callback(rating, $el);
    }

  };

  var publicMethods = {

    unload: function() {
      var _name = 'plugin_' + pluginName;
      var $el = $(this);
      var $starSet = $el.data(_name).$stars;
      $starSet.off();
      $el.removeData(_name).remove();
    },

    setRating: function(rating, round) {
      var _name = 'plugin_' + pluginName;
      var $el = $(this);
      var $plugin = $el.data(_name);
      if( rating > $plugin.settings.totalStars || rating < 0 ) { return; }
      if( round ){
        rating = Math.round(rating);
      }
      $plugin.applyRating(rating);
    },

    getRating: function() {
      var _name = 'plugin_' + pluginName;
      var $el = $(this);
      var $starSet = $el.data(_name);
      return $starSet._state.rating;
    },

    resize: function(newSize) {
      var _name = 'plugin_' + pluginName;
      var $el = $(this);
      var $starSet = $el.data(_name);
      var $stars = $starSet.$stars;

      if(newSize <= 1 || newSize > 200) {
        console.log('star size out of bounds');
        return;
      }

      $stars = Array.prototype.slice.call($stars);
      $stars.forEach(function(star){
        $(star).css({
          'width': newSize + 'px',
          'height': newSize + 'px'
        });
      });
    },

    setReadOnly: function(flag) {
      var _name = 'plugin_' + pluginName;
      var $el = $(this);
      var $plugin = $el.data(_name);
      if(flag === true){
        $plugin.$stars.off('mouseover mouseout click');
      } else {
        $plugin.settings.readOnly = false;
        $plugin.addListeners();
      }
    }

  };


  // Avoid Plugin.prototype conflicts
  $.extend(Plugin.prototype, methods);

  $.fn[ pluginName ] = function ( options ) {

    // if options is a public method
    if( !$.isPlainObject(options) ){
      if( publicMethods.hasOwnProperty(options) ){
        return publicMethods[options].apply(this, Array.prototype.slice.call(arguments, 1));
      } else {
        $.error('Method '+ options +' does not exist on ' + pluginName + '.js');
      }
    }

    return this.each(function() {
      // preventing against multiple instantiations
      if ( !$.data( this, 'plugin_' + pluginName ) ) {
        $.data( this, 'plugin_' + pluginName, new Plugin( this, options ) );
      }
    });
  };

})( jQuery, window, document );



var MkbRuWeb=MkbRuWeb||{},ua;MkbRuWeb=$.extend(MkbRuWeb,{redirectPost:function(n,t){var i="";$.each(t,function(n,t){typeof t=="string"&&(t=t.split('"').join('"'));i+='<input type="hidden" name="'+n+'" value="'+t+'">'});$('<form action="'+n+'" method="POST">'+i+"<\/form>").appendTo($(document.body)).submit()},redirectGet:function(n,t){var i=$.param(t||{});document.location.href=n+(i&&""!==i?"?"+i:"")},sendAsync:function(n,t,i,r){$.ajax({type:"POST",url:n,data:t,success:function(n){n?n.IsSuccess?i?i(n):r?r(n):alert(n):r?r(n):alert(n.ErrorMessage):r?r(n):alert("При обработке запроса произошла внутренняя ошибка. Некорректные данные при получении ответа")},error:function(n){n&&n.responseJSON&&n.responseJSON.ErrorMessage?r?r(n.responseJSON.ErrorMessage):alert(n.responseJSON.ErrorMessage):r?r(n.responseCode):alert("При обработке запроса произошла внутренняя ошибка. Код ответа: "+n.responseCode)},complete:function(){}})},fixMobileVirtualPad:function(){window.isIPad&&$("html").addClass("overflow-auto")},redirectToMkbOnline:function(){$("button.btn_mkbonline").on("click",function(){window.open("//online.mkb.ru","_blank")})},getScrollableElement:function(){return window.isIPad?$("body"):$(window)},getCurrentScrollTop:function(){return window.isIPad?Math.abs($("#page").offset().top):$(window).scrollTop()},getClosestPoints:function(n,t,i,r){$.ajax({type:"POST",url:"/about/address/ClosestPointList",data:{id:t,ClosestPointType:n,PointType:i},success:function(n){r.append(n)}})},analyticsSendEventInit:function(){$("body").on("click","a,button,input, span",function(){var n=$(this);MkbRuWeb.analyticsSendEvent(n)});$("input").on("change",function(){var n=$(this);MkbRuWeb.analyticsSendEvent(n)});$(".slider__control").on("slidechange",function(){var n=$(this);MkbRuWeb.analyticsSendEvent(n)});$(".tabs__opener").on("click",function(){var n=$(this);MkbRuWeb.analyticsSendEvent(n)})},analyticsSendEvent:function(n){var t;if(window.ga||window.yaCounter44195019||yaCounter66187102){var r=n.attr("data-ga-eventCategory"),u=n.attr("data-ga-eventAction")||"elem_click",f=n.attr("data-ga-eventLabel")||"",i=n.attr("data-ya-eventLabel")||f||"";i=i.length>0?"_"+i:"";t=r+"_"+u+i;window.reachedGoals||(window.reachedGoals=[]);r&&window.reachedGoals.indexOf(t)===-1&&(window.reachedGoals.push(t),window.ga&&window.ga("send","event",r,u,f),window.yaCounter44195019&&window.yaCounter44195019.reachGoal(t),window.yaCounter66187102&&window.yaCounter66187102.reachGoal(t))}},captchaInit:function(n){$(".captcha__btn_refresh").each(function(){MkbRuWeb.captchaRefresh($(this),n);$(this).click(function(){MkbRuWeb.captchaRefresh($(this))})})},captchaRefresh:function(n,t){n.next().val("");var r=n.prev(".captcha__image-container").find("img").first(),i=t?"/en/home":"/page";i=i+"/CaptchaImage?r="+Math.random();r.attr("src",i)},ratingInit:function(n,t,i){$("."+n).starRating({totalStars:t||5,initialRating:0,starSize:38,useGradient:!1,disableAfterRate:!1,starShape:"rounded",fillColor:i||"#fff",fillHovered:"#f08205",callback:function(t){$("#"+n).val(t).trigger("change").valid()}})},initFileUpload:function(n,t,i,r,u,f,e,o,s){var w=Math.round(i/1048576),h=o||$(n).parents(".form__line"),a=h.find(".progressState"),v=h.find(".progressBar"),c=h.find("input[type=hidden], input[data-upload-hidden-field]"),b=h.find(".btn_download_light_dashed"),l=h.find(".progressText"),p=h.find(".progressArea"),y=s||h.find(".btn_del"),k=l.html();h.on("change","input[type=file]",function(){$(this).simpleUpload(t,{start:function(){l.html("");b.removeClass("hover");p.css("display","inline-block");a.css("display","inline-block");a.html("0%");v.width(0);v.show()},progress:function(n){a.html(Math.round(n)+"%");v.width(n+"%")},success:function(n){if(b.addClass("hover"),n.success){var t=n.Name.length>r?n.Name.substr(0,r)+"...":n.Name;l.html(t);a.html("");c.val(n.LinkId);c.valid();v.width(0);v.hide();a.hide();p.hide();e&&e();y&&y.toggle(!0)}else a.hide(),p.hide(),c.val(""),c.valid(),n.error&&n.error!==""?l.html("Ошибка загрузки!<br/>"+n.error):l.html("Ошибка загрузки!<br/>Требуемый формат: Word, PDF. Максимальный размер: "+w+"МБ")},error:function(n){a.hide();p.hide();c.val("");c.valid();n.name=="MaxFileSizeError"?l.html("Ошибка загрузки!<br/>Превышен допустимый лимит размера загружаемого файла ("+w+" МБ)"):l.html("Ошибка загрузки!<br/>Попробуйте загрузить файл еще раз")},allowedTypes:u,allowedExts:f,maxFileSize:i})});if(y)y.on("click",function(){l.html(k);c.val("");c.valid();y.toggle(!1)})},initTimer:function(n,t,i){var f=new Date,r,u;f.setSeconds(f.getSeconds()+t);var e=0,o=new Date,t=(f-o)/1e3;if(t>0){r=t/60;u=r/60;r=(u-Math.floor(u))*60;u=Math.floor(u);t=Math.floor((r-Math.floor(r))*60);r=Math.floor(r);n.html(r+":"+(t<10?"0"+t:t));function f(){t==0?r==0?u==0?(i&&i(),clearInterval(e)):(u--,r=59,t=59):(r--,t=59):t--;n.html(r+":"+(t<10?"0"+t:t))}return e=setInterval(f,1e3)}},getNameFromFullName:function(n){const i=n.replace(/\s{2,}/gi," ").trim();let t=i.split(" "),u=t[0],r=t.length>1?t[1]:"",f=t.length>2?i.substr(u.length+r.length+2):"";return(r+" "+f).trim()},transliterate:function(n){var t={"Ё":"E","Й":"I","Ц":"TS","У":"U","К":"K","Е":"E","Н":"N","Г":"G","Ш":"SH","Щ":"SHCH","З":"Z","Х":"KH","Ъ":"","ё":"e","й":"i","ц":"ts","у":"u","к":"k","е":"e","н":"n","г":"g","ш":"sh","щ":"shch","з":"z","х":"h","ъ":"","Ф":"F","Ы":"Y","В":"V","А":"A","П":"P","Р":"R","О":"O","Л":"L","Д":"D","Ж":"ZH","Э":"E","ф":"f","ы":"y","в":"v","а":"a","п":"p","р":"r","о":"o","л":"l","д":"d","ж":"zh","э":"e","Я":"IA","Ч":"CH","С":"S","М":"M","И":"I","Т":"T","Ь":"","Б":"B","Ю":"IU","я":"ia","ч":"ch","с":"s","м":"m","и":"i","т":"t","ь":"","б":"b","ю":"iu"};return n.split("").map(function(n){return t[n]==""?"":t[n]||n}).join("")},setHintEvents:function(n){var t="active",i="."+n;$(document).on("click",function(r){var o=this;if($(r.target).hasClass(n)){var f=$(r.target).offset().top+20,u=$(r.target).data("hint"),e=$(r.target).hasClass(t);$(window).width()>979?($(i).removeClass(t),$(".hint").filter("."+t).each(function(n,i){$(i).dialog("close");$(i).removeClass(t)}),e||$(u).dialog({closeOnEscape:!0,open:function(){$(r.target).toggleClass(t);$(u).toggleClass(t);$(u).closest(".ui-dialog").addClass("ui-dialog-hint");$(u).dialog("option","position","center");var n=$(r.target).offset().left-$(".hint.active").width();$(u).closest(".ui-dialog").css("top",f);$(u).closest(".ui-dialog").css("left",n)}})):($(r.target).toggleClass(t),$(u).toggleClass(t))}else $(r.target).closest(".hint").length==0&&($(i).removeClass(t),$(".hint").filter(".active").each(function(n,i){$(i).removeClass(t);$(i).closest(".ui-dialog").length!=0&&$(i).dialog("close")}))});$(window).on("resize",function(){$(window).width()<980&&$(i).length&&($(i).removeClass(t),$(".hint").filter("."+t).each(function(n,i){$(i).removeClass(t);$(i).closest(".ui-dialog").length!=0&&$(i).dialog("close")}))}.bind(this))},showCookiesUseInfo:function(){var n,t;try{if(window.cookieInfoName="mkbru_cookie_info",n=Cookies.get(window.cookieInfoName),n){t=JSON.parse(decodeURIComponent(n));t.presented||MkbRuWeb.openCookieUseInfo();return}Cookies.set("mkbru_cookie_info",{presented:!1},{expires:window.CookiePolicyExpirationDaysCount});Cookies.get(window.cookieInfoName)&&MkbRuWeb.openCookieUseInfo()}catch(i){}},openCookieUseInfo:function(){var n=".cookie-info";MkbRuWeb.openDialogInfo(n,null,function(){$(window).width()<980?($(n).closest(".ui-dialog").css("top",60),$(n).closest(".ui-dialog").css("left",20)):($(n).closest(".ui-dialog").css("top",64),$(n).closest(".ui-dialog").css("left",30))},function(){Cookies.set(window.cookieInfoName,{presented:!0},{expires:window.CookiePolicyExpirationDaysCount})},function(){$(".cookie-info a").on("click",function(){Cookies.set(window.cookieInfoName,{presented:!0},{expires:window.CookiePolicyExpirationDaysCount});$(n).dialog("close")})})},openDialogInfo:function(n,t,i,r,u){t=t?t:"";$.ui.dialog.prototype._focusTabbable=$.noop;$(n).dialog({closeOnEscape:!0,draggable:!1,open:function(){$(n).closest(".ui-dialog").addClass("ui-dialog__info");$(n).closest(".ui-dialog").find(".ui-dialog-title").text(t);i&&i();u&&u()},close:function(){r&&r()}})}});ua=window.navigator.userAgent;window.isIPad=ua.match(/iPad/i)!=null;MkbRuWeb.fixMobileVirtualPad();$(function(){MkbRuWeb.redirectToMkbOnline();MkbRuWeb.analyticsSendEventInit()});$(document).ready(function(){$("a.openinnermenu").click(function(n){n.preventDefault();n.stopPropagation();n.stopImmediatePropagation();$(".innermenu_cards").toggle("form__group_hidden")})});String.prototype.startsWith||Object.defineProperty(String.prototype,"startsWith",{enumerable:!1,configurable:!1,writable:!1,value:function(n,t){return t=t||0,this.indexOf(n,t)===t}})
var FormRequest=function(n,t,i,r,u,f,e,o){this.componentRequest_=n;this.tabsContent_=this.componentRequest_.find(".tabs__content_send-request");this.requestStatusError_=this.tabsContent_.find(".request-status_error");this.requestStatusSuccess_=this.tabsContent_.find(".request-status_success");this.requestStatusErrorHeader_=this.requestStatusError_.find(".request-status__text h3");this.requestStatusErrorMessage_=this.requestStatusError_.find(".request-status__text p");this.errorMessageText_=this.requestStatusErrorMessage_.html();this.errorHeaderText_=this.requestStatusErrorHeader_.html();this.btnResendRequest_=this.requestStatusError_.find(".btn_resend-request");this.form_=r||this.componentRequest_.find("form");this.showValidationSummary_=u==null?!0:u;this.callBack_=e;this.callBackError_=o;this.classes_=["success","error"];this.animation_;this.SuccessAnimation_=t;this.ErrorAnimation_=i;this.LoadingAnimation_=f;this.init_()};FormRequest.CLASS_SENT="sent";FormRequest.CLASS_ERROR="error";FormRequest.CLASS_SUCCESS="success";FormRequest.CLASS_SENDING="sending";FormRequest.CLASS_LOADING="loading";FormRequest.prototype.init_=function(){var n=this;new FormRequestValidationSummary(n.form_);n.showValidationSummary_||$(".validation-summary").hide();this.attachEvents_()};FormRequest.prototype.attachEvents_=function(){var n=this;n.form_.find("input[inputfilter]").each(function(){var n=$(this),t=n.attr("inputfilter");n.filter_input({regex:t})});n.form_.find("input[data-mask]").each(function(){let n=$(this),t=n.attr("data-mask");n.mask(t,{placeholder:" ",autoclear:!1});let i=n.attr("data-mask");if(i.substring(0,2)=="+7")n.on("focus click",function(){let t=n.val().substring(3,6).trim();t.length!=3&&n.get(0).setSelectionRange(3,3)})});"true"==n.form_.attr("data-EnterKeySubmitDisable")&&n.form_.find("input").keydown(function(n){if(n.keyCode==13)return n.preventDefault(),!1});n.form_.on("submit",function(t){var i;if(t.preventDefault(),i=$(this),i.valid()){if(n.requestStatusErrorMessage_.html(n.errorMessageText_),n.requestStatusErrorHeader_.html(n.errorHeaderText_),n.tabsContent_.hasClass(FormRequest.CLASS_SENDING))return;n.tabsContent_.addClass(FormRequest.CLASS_SENDING);n.tabsContent_.addClass(FormRequest.CLASS_LOADING);typeof n.LoadingAnimation_!="undefined"&&null!=n.LoadingAnimation_&&(n.animation_=new n.LoadingAnimation_);var u=i.attr("action"),f=i.serialize(),r=i.find(".captcha__btn_refresh");i.data("submitted")===!0?t.preventDefault():(i.data("submitted",!0),MkbRuWeb.sendAsync(u,f,function(t){n.tabsContent_.removeClass(FormRequest.CLASS_SENDING);n.tabsContent_.removeClass(FormRequest.CLASS_LOADING);n.animation_&&n.animation_.statusAnimation_&&n.animation_.statusAnimation_.anim_&&n.animation_.statusAnimation_.anim_.destroy();n.tabsContent_.addClass(FormRequest.CLASS_SENT+" "+FormRequest.CLASS_SUCCESS);n.SuccessAnimation_&&(n.animation_=new n.SuccessAnimation_);n.onSendFormComplete_(i,t)},function(t){i.data("submitted",!1);typeof t!="undefind"&&n.processErrorComplete_(t);n.tabsContent_.removeClass(FormRequest.CLASS_SENDING);n.tabsContent_.removeClass(FormRequest.CLASS_LOADING);n.tabsContent_.addClass(FormRequest.CLASS_SENT+" "+FormRequest.CLASS_ERROR);n.ErrorAnimation_&&(n.animation_=new n.ErrorAnimation_);r.length&&(n.processErrorComplete_(t),new MkbRuWeb.captchaRefresh(r,$(".isEnglish").length>0),r.next().valid());n.onSendFormError_(i,t)}))}});this.btnResendRequest_.on("click",function(t){var i=n.whichTransitionEvent_();n.tabsContent_.removeClass(FormRequest.CLASS_SENT+" "+FormRequest.CLASS_ERROR);n.requestStatusError_.one(i,function(){n.componentRequest_.trigger("resend")});n.scrollToElem_(n.componentRequest_);t.preventDefault()})};FormRequest.prototype.whichTransitionEvent_=function(){var n,i=document.createElement("fakeelement"),t={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(n in t)if(i.style[n]!==undefined)return t[n]};FormRequest.prototype.processErrorComplete_=function(n){var t,i,r;n!==undefined&&(t=n,n.ErrorMessage&&(t=n.ErrorMessage),i=this.requestStatusErrorMessage_.first(),i.length&&i.html(t),n.MessageHeader&&(r=this.requestStatusErrorHeader_.first(),r.length&&r.html(n.MessageHeader)))};FormRequest.prototype.onSendFormComplete_=function(n,t){var u=this;if(u.callBack_&&u.callBack_(t),n&&(window.ga||window.yaCounter44195019||yaCounter66187102)){var r=n.attr("data-ga-eventCategory"),f=n.attr("data-ga-eventAction")||"send_form",e=n.attr("data-ga-eventLabel")||"",i=n.attr("data-ya-eventLabel")||e||"";i=i.length>0?"_"+i:"";r&&(window.ga&&window.ga("send","event",r,f,e),window.yaCounter44195019&&window.yaCounter44195019.reachGoal(r+"_"+f+i),window.yaCounter66187102&&window.yaCounter66187102.reachGoal(r+"_"+f+i))}u.setSuccessWindow_();$('img[data-block="pixel"]').trigger("loadPixel")};FormRequest.prototype.onSendFormError_=function(n,t){var i=this;i.callBackError_&&i.callBackError_(t)};FormRequest.prototype.resetFields=function(){var n=this,t=n.componentRequest_.find(".field");t.find("input").each(function(){var n=$(this);n.val("").valid()});t.removeClass("error success");n.componentRequest_.find(".selector").each(function(){var n=$(this),t;n.find(".selector__list-option.selected").removeClass("selected");t=n.find(".selector__list-option[data-id='']");t.addClass("selected");n.find(".selector__opener").text(t.text().trim())})};FormRequest.prototype.setSuccessWindow_=function(){var n=this,t;n.requestStatusSuccess_.length&&(t=n.requestStatusSuccess_.height(),n.form_.height(t),n.scrollToElem_(n.componentRequest_))};FormRequest.prototype.scrollToElem_=function(n){var t,r=n.closest(".form__line"),i=r&&r.length>0?r.offset().top:n.offset().top;i<0||(window.isIPad?t=i+Math.abs($("#page").offset().top):(t=i,$(window).width()>=980&&(t=i-Math.abs($(".header").height()))),$("html, body").stop().animate({scrollTop:t},700))}
var FormRequestStep=function(n,t,i,r,u,f,e,o,s){var h={getFormSubmitData:undefined,setFormSubmitted:!0,getNextForm:undefined,onSendStep:undefined};this.options=$.extend({},h,o);this.componentRequest_=n;this.tabsContent_=this.componentRequest_.find(".tabs__content_send-request");this.requestStatusError_=this.tabsContent_.find(".request-status_error");this.requestStatusSuccess_=this.tabsContent_.find(".request-status_success");this.requestStatusErrorMessage_=this.requestStatusError_.find(".request-status__text p");this.errorMessageText_=this.requestStatusErrorMessage_.html();this.btnResendRequest_=this.requestStatusError_.find(".btn_resend-request");this.form_=u||this.componentRequest_.find("form");this.formHeight_=this.form_.height();this.classes_=["success","error"];this.nextStep_=f;this.nextStepDefault_=f;this.animation_;this.SuccessAnimation_=t;this.ErrorAnimation_=i;this.onSuccessComplete_=e;this.LoadingAnimation_=r;this.onErrorComplete_=s;this.init_()};FormRequestStep.CLASS_SENT="sent";FormRequestStep.CLASS_ERROR="error";FormRequestStep.CLASS_SUCCESS="success";FormRequestStep.CLASS_SENDING="sending";FormRequestStep.CLASS_LOADING="loading";FormRequestStep.prototype.init_=function(){var n=this;new FormRequestValidationSummary(n.form_);this.attachEvents_()};FormRequestStep.prototype.attachEvents_=function(){var n=this;n.form_.find("input[inputfilter]").each(function(){var n=$(this),t=n.attr("inputfilter");n.filter_input({regex:t})});n.form_.find("input[data-mask]").each(function(){let n=$(this),t=n.attr("data-mask");n.mask(t,{placeholder:" ",autoclear:!1});let i=n.attr("data-mask");if(i.substring(0,2)=="+7")n.on("focus click",function(){let t=n.val().substring(3,6).trim();t.length!=3&&n.get(0).setSelectionRange(3,3)})});"true"==n.form_.attr("data-EnterKeySubmitDisable")&&n.form_.find("input").keydown(function(n){if(n.keyCode==13)return n.preventDefault(),!1});n.form_.on("submit",function(t){function s(){return n.options.getFormSubmitData?n.options.getFormSubmitData():i.serialize()}function h(){if(u()&&n.options.getNextForm){let t=n.options.getNextForm();if(t)return t}return n.nextStepDefault_}function c(t){if(u()&&n.options.onSendStep)n.options.onSendStep(t,n.nextStep_);else if(n.onSuccessComplete_)n.onSuccessComplete_(t,n.nextStep_)}function u(){var t=n.componentRequest_.find(".tabs__openers_request .tabs__opener[data-next-step]");return t&&t.length>0}var i;if(t.preventDefault(),i=$(this),i.valid()){if(n.requestStatusErrorMessage_.html(n.errorMessageText_),n.tabsContent_.hasClass(FormRequestStep.CLASS_SENDING))return;n.tabsContent_.hasClass(FormRequestStep.CLASS_LOADING)||(n.tabsContent_.addClass(FormRequestStep.CLASS_LOADING),typeof n.LoadingAnimation_!="undefined"&&(n.animation_=new n.LoadingAnimation_));var f=i.attr("action"),e=s(),r=i.find(".captcha__btn_refresh"),o=n.form_.data("complete")||!1;n.nextStep_=h();i.data("submitted")===!0?t.preventDefault():(n.options.setFormSubmitted&&i.data("submitted",!0),MkbRuWeb.sendAsync(f,e,function(t){var r=n.form_.data("next-not-show")||!1;n.nextStep_&&!r&&(n.tabsContent_.removeClass(FormRequestStep.CLASS_SENDING),n.tabsContent_.removeClass(FormRequestStep.CLASS_LOADING),n.animation_&&n.animation_.statusAnimation_&&n.animation_.statusAnimation_.anim_&&n.animation_.statusAnimation_.anim_.destroy(),n.form_.hide(),n.nextStep_.show(),n.scrollToElem_(n.componentRequest_,!0));o&&(n.tabsContent_.removeClass(FormRequestStep.CLASS_SENDING),n.tabsContent_.removeClass(FormRequestStep.CLASS_LOADING),n.animation_&&n.animation_.statusAnimation_&&n.animation_.statusAnimation_.anim_&&n.animation_.statusAnimation_.anim_.destroy(),n.tabsContent_.addClass(FormRequest.CLASS_SENT+" "+FormRequest.CLASS_SUCCESS),n.SuccessAnimation_&&(n.animation_=new n.SuccessAnimation_),n.setStatusWindow_(n.requestStatusSuccess_));n.onSendFormComplete_(i);c(t)},function(t){if(i.data("submitted",!1),typeof t!="undefind"&&n.processErrorComplete_(t),n.tabsContent_.removeClass(FormRequestStep.CLASS_SENDING),n.tabsContent_.removeClass(FormRequestStep.CLASS_LOADING),n.tabsContent_.addClass(FormRequestStep.CLASS_SENT+" "+FormRequestStep.CLASS_ERROR),n.animation_=new n.ErrorAnimation_,r.length&&(n.processErrorComplete_(t),new MkbRuWeb.captchaRefresh(r,$(".isEnglish").length>0),r.next().valid()),n.onErrorComplete_)n.onErrorComplete_(t,n.form_)}))}});this.btnResendRequest_.on("click",function(t){var i=n.whichTransitionEvent_();n.tabsContent_.removeClass(FormRequestStep.CLASS_SENT+" "+FormRequestStep.CLASS_ERROR);n.requestStatusError_.one(i,function(){n.componentRequest_.trigger("resend")});n.scrollToElem_(n.componentRequest_);t.preventDefault()})};FormRequestStep.prototype.whichTransitionEvent_=function(){var n,i=document.createElement("fakeelement"),t={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(n in t)if(i.style[n]!==undefined)return t[n]};FormRequestStep.prototype.processErrorComplete_=function(n){var t,i,r;n!==undefined&&(t=n,n.ErrorMessage&&(t=n.ErrorMessage),i=this.requestStatusErrorMessage_.first(),i.length&&i.html(t),n.MessageHeader&&(r=this.requestStatusErrorHeader_.first(),r.length&&r.html(n.MessageHeader)))};FormRequestStep.prototype.onSendFormComplete_=function(n){var f=this;if(n&&(window.ga||window.yaCounter44195019||yaCounter66187102)){var i=n.attr("data-ga-eventCategory"),r=n.attr("data-ga-eventAction")||"send_form",u=n.attr("data-ga-eventLabel")||"",t=n.attr("data-ya-eventLabel")||u||"";t=t.length>0?"_"+t:"";i&&(window.ga&&window.ga("send","event",i,r,u),window.yaCounter44195019&&window.yaCounter44195019.reachGoal(i+"_"+r+t),window.yaCounter66187102&&window.yaCounter66187102.reachGoal(i+"_"+r+t))}};FormRequestStep.prototype.setStatusWindow_=function(n){var t=this,i;n.length&&(i=n.height(),t.form_.height(i),t.scrollToElem_(t.componentRequest_))};FormRequestStep.prototype.scrollToElem_=function(n,t){var i,r=n.offset().top,u=t||!1;(r!=0||u)&&(window.isIPad?i=r+Math.abs($("#page").offset().top):(i=r,$(window).width()>=980&&(i=r-Math.abs($(".header").height()))),$("html, body").stop().animate({scrollTop:i},300))}
var ComponentEmailSuggest=function(n,t,i){this.domainList_=i||["gmail.com","yandex.ru","mail.ru","rambler.ru","inbox.ru","list.ru","bk.ru","lenta.ru","autorambler.ru","myrambler.ru","ro.ru","live.ru","hotmail.com","live.com","msn.com","outlook.com","aol.com","yahoo.com"];this.selector_=n;this.input_=this.selector_.find("input[type!=hidden]");this.minlenght_=t|1;this.init_()};ComponentEmailSuggest.prototype.init_=function(){this.selector_.find(".selector-autocomplete").mCustomScrollbar();this.autocomplete_();this.attachEvents_()};ComponentEmailSuggest.prototype.autocomplete_=function(){var n=this,i="expanded",t=n.selector_,r=n.input_,u=n.domainList_,f=t.find(".selector-autocomplete .mCSB_container"),e=n.minlenght_;r.autocomplete({source:function(n,t){var e=[],r=n.term.toLowerCase(),i=r,f=r.indexOf("@"),o="";f>-1?(i=r.substring(0,f+1),f<r.length-1&&(o=r.substring(f+1,r.length))):i=i+"@";u.forEach(function(n){if(o!=""){var t=n.toLowerCase();t.indexOf(o)==0&&e.push({label:i+n,value:i+n})}else e.push({label:i+n,value:i+n})});t(e)},minLength:e,appendTo:f,open:function(){t.closest(".field__autocomplete").addClass(i)},close:function(){t.closest(".field__autocomplete").removeClass(i)},select:function(n,i){var u=i.item.value.toLowerCase();r.val(i.item.value).trigger("change").valid();t.trigger("selector_changed")}}).on("focus",function(){$(this).keydown()})};ComponentEmailSuggest.prototype.attachEvents_=function(){var n=this;n.input_.keydown(function(n){if(n.keyCode==13)return this.blur(),!1})}
var FormRequestValidationSummary=function(n){this.form_=n;this.validationSummary_;this.validationSummaryFields_;this.validationFields_=this.form_.find('[data-val="true"]');this.btnSendRequest_=this.form_.find('.btn[type="submit"]');this.init_()};FormRequestValidationSummary.prototype.init_=function(){var n=this;n.intiValidationSummary_();n.initFields_();n.updateButtonState_();n.attachEvents_()};FormRequestValidationSummary.HEADER_HEUGHT=80;FormRequestValidationSummary.prototype.attachEvents_=function(){var n=this;n.validationSummaryFields_.find(".validation-summary__field-link").on("click",function(){var i=$(this),t=n.form_.find("#"+i.data("field"));if(t.length==0&&(t=n.form_.find('[id="'+i.data("field")+'"]')),t.length!=0&&t.is(":hidden")){n.scrollToElem_(t);t.valid();return}var f=t.offset().top,r=MkbRuWeb.getScrollableElement(),u=f-FormRequestValidationSummary.HEADER_HEUGHT;u<$(r).scrollTop()&&$(r).scrollTop(u);t.focus()});n.form_.on("val_highlight",function(t,i){n.updateSummaryLink_($(i),!1)});n.form_.on("val_unhighlight",function(t,i){n.updateSummaryLink_($(i),!0)});n.validationFields_.filter(':checkbox, input[type="hidden"]').on("change",function(){var t=$(this);n.updateSummaryLink_(t,t.valid())})};FormRequestValidationSummary.prototype.intiValidationSummary_=function(){var n=this,i=$(".isEnglish").length>0?"Please fill in":"Осталось заполнить поля",t;n.validationSummary_=$('<div class="validation-summary"><span class="validation-summary__caption">'+i+': <\/span><div class="validation-summary__fields"><\/div>.<\/div>');t=n.btnSendRequest_.parents(".buttons");n.validationSummary_.insertAfter(t);n.validationSummaryFields_=n.validationSummary_.find(".validation-summary__fields")};FormRequestValidationSummary.FIELD_DATA_AGREEMENT="DataAgreement";FormRequestValidationSummary.prototype.initFields_=function(){var n=this;n.form_.data("val-dont-show-errors",!0);$.each(n.validationFields_,function(){var i=$(this),r=i.attr("id"),t=i.siblings("label"),u,f,e;t.length==0&&(t=i.parents(".form__line").find("label"));t.length>1&&(t=i.parents(".form__line").find('label[for="'+r+'"]'));u=t.data("field-text")?t.data("field-text"):t.find(".foldable__opener").length>0?t.find(".foldable__opener").text():t.text();FormRequestValidationSummary.FIELD_DATA_AGREEMENT==r&&(u="Согласие на обработку персональных данных");f=n.createFieldSeparator_();e=n.createFieldLink_(r,u);n.validationSummaryFields_.append(f);n.validationSummaryFields_.append(e);n.updateSummaryLink_(i,i.valid())});n.form_.data("val-dont-show-errors",!1)};FormRequestValidationSummary.prototype.updateSummaryLink_=function(n,t){var i=this,r=n.attr("id"),u=i.validationSummaryFields_.find('.validation-summary__field-link[data-field="'+r+'"]');t||i.validationSummary_.show();u.toggleClass("validation-summary__field-link_showed",!t);i.validationSummaryFields_.find(".validation-summary__field-sep").each(function(){var n=$(this);n.toggle(n.prev(".validation-summary__field-link").hasClass("validation-summary__field-link_showed")&&n.nextAll(".validation-summary__field-link").hasClass("validation-summary__field-link_showed"))});i.updateButtonState_()};FormRequestValidationSummary.prototype.updateButtonState_=function(){var n=this,t=n.validationSummaryFields_.find(".validation-summary__field-link_showed"),i=0!=t.length;$.each(t,function(n){$(this).toggleClass("first-child",n==0)});n.btnSendRequest_.prop("disabled",i);n.validationSummary_.toggle(i);n.btnSendRequest_.trigger("update-state")};FormRequestValidationSummary.prototype.createFieldLink_=function(n,t){var r=this,i=$('<span class="validation-summary__field-link pseudo" data-field="'+n+'"><\/span>');return i.text(t),i};FormRequestValidationSummary.prototype.createFieldSeparator_=function(){var n=this;return $('<span class="validation-summary__field-sep">,&nbsp;<\/span>')};FormRequestValidationSummary.prototype.scrollToElem_=function(n){var t,r=n.closest(".form__line"),i=r&&r.length>0?r.offset().top:n.offset().top;i!=0&&(window.isIPad?t=i+Math.abs($("#page").offset().top):(t=i,$(window).width()>=980&&(t=i-Math.abs($(".header").height()))),$("html, body").stop().animate({scrollTop:t},300))}
var MKBListViewModel=function(){this.items=ko.observableArray();this.totalCount=ko.observable(0);this.showMore=ko.computed(function(){return this.items().length<this.totalCount()},this)},MKBList=function(){(this.tabs_=$(".tabs_branches"),this.tabs_.length!==0)&&(this.tabsOpeners_=this.tabs_.find(".tabs__openers"),this.tabsOpener_=this.tabsOpeners_.find(".tabs__opener"),this.tabsOpenerSelected_=this.tabs_.find(".tabs__opener.selected"),this.tabsOpenerSelectedData_=this.tabsOpenerSelected_.data("tab"),this.branchesList_=$(".branches-list"),this.branchesList_.length!==0)&&(this.input_=$(".map-search-input"),this.branchOption_=$(".tabs_branches .branch-options__item"),this.branchOptionChbx_=this.branchOption_.find('input[type="checkbox"]'),this.selectorOkatoRegion=$(".selector.request_selector_okato_region"),this.branchesMap_=$("#branches-map"),this.dataHandler_,this.loadListInProcess=!1,this.init_())};MKBList.prototype.init_=function(){var n=this;this.attachEvents_();this.viewModel_=new Vue({el:".branches-list__wrapper",data:{type:"FeatureCollection",items:[],totalCount:null},computed:{showMore:function(){return this.items.length<this.totalCount}},updated:function(){this.$nextTick(function(){n.branchesList_.trigger("branches_list_changed")})}});this.refreshList(this.tabsOpenerSelectedData_);this.refreshListAsyncJob_(this)};MKBList.prototype.attachEvents_=function(){var n=this;this.tabsOpener_.on("click",function(){n.tabsOpenerSelectedData_=$(this).data("tab");n.refreshList(n.tabsOpenerSelectedData_)});this.tabs_.on("branches_markers_changed",function(t,i,r){n.refreshList(r)});this.selectorOkatoRegion.on("selector_changed",function(){n.refreshList(n.tabsOpenerSelectedData_)});this.branchOptionChbx_.on("click",function(){n.refreshList(n.tabsOpenerSelectedData_)});this.input_.on("search_start",function(){n.refreshList(n.tabsOpenerSelectedData_)});n.branchesList_.on("branches_list_changed",function(){n.branchesList_.find(".branches-list__item").hover(function(){n.branchesMap_.trigger("branch_hovered",this)},function(){n.branchesMap_.trigger("branch_unhovered")})})};MKBList.REFRESH_LIST_INTERVAL=1e3;MKBList.prototype.refreshListAsyncJob_=function(){var n=this,i,t;n.viewModel_.showMore&&(i=MkbRuWeb.getCurrentScrollTop(),t=n.branchesList_.outerHeight(),i>t-t/5&&n.refreshList(n.tabsOpenerSelectedData_,!0));setTimeout(function(){n.refreshListAsyncJob_()},MKBList.REFRESH_LIST_INTERVAL)};MKBList.prototype.refreshList=function(n,t){var i=this;i.loadListInProcess!=!0&&(i.loadListInProcess=!0,i.dataHandler_=i.getDataHandler(n),i.dataHandler_&&(t=t||!1,t||(i.viewModel_.items=[]),i.dataHandler_.loadListGeoPointList(function(n){n&&n.features&&(n.features.forEach(function(n){i.viewModel_.items.push(n)}),i.viewModel_.totalCount=n.totalCount||0);i.loadListInProcess=!1})))};MKBList.PROP_VAL_OFFICE="branch";MKBList.PROP_VAL_ATM="atm";MKBList.PROP_VAL_TERMINAL="terminal";MKBList.PROP_VAL_CASHDESK="cash-desk";MKBList.prototype.getDataHandler=function(n){var t=this;return n&&n===MKBList.PROP_VAL_OFFICE?new MKBMapDataOfficeHandler(null,t):n&&n===MKBList.PROP_VAL_ATM?new MKBMapDataAtmHandler(null,t):n&&n===MKBList.PROP_VAL_TERMINAL?new MKBMapDataTerminalHandler(null,t):n&&n===MKBList.PROP_VAL_CASHDESK?new MKBMapDataCashdeskHandler(null,t):new MKBMapDataDefaultHandler(null,t)};MKBList.prototype.getCurrentListCount=function(){var n=this;return n.viewModel_.items.length}
var MKBMetro=function(){function t(){var i=n.$metroMapContent,t={};return t.translateX=parseInt(i.attr("data-translate-x-initial")),t.translateY=parseInt(i.attr("data-translate-y-initial")),t.scale=1,t}var n=this;(this.tabs_=$(".tabs_branches"),this.tabs_.length!==0)&&(this.tabsOpeners_=this.tabs_.find(".tabs__openers"),this.tabsOpener_=this.tabsOpeners_.find(".tabs__opener"),this.tabsOpenerSelected_=this.tabs_.find(".tabs__opener.selected"),this.tabsOpenerSelectedData_=this.tabsOpenerSelected_.data("tab"),this.headerSearch_=$(".header__map-search"),this.headerSearchOpener_=this.headerSearch_.find(".header__map-search-opener"),this.headerMapSwitcher_=$(".header__map-switcher"),this.metroMap_=$(".metro-map"),this.$metroMapInner=$(".metro-map__inner"),this.$metroMapContent=$(".metro-map__content"),this.$unobstructedViewArea=$(".metro-map__unobstructed-view-area"),this.metroMapContentLinks_=this.metroMap_.find(".metro-map__content a"),this.input_=$(".map-search-input"),this.selectorOkatoRegion_=this.tabs_.find(".selector.request_selector_okato_region"),this.dataHandler_,this.panZoomModel=t(),this.panZoomModelAtPanStart=undefined,this.panZoomModelAtPinchStart=undefined,this.linksEnabled=!0,this.init_())};MKBMetro.DURATION=200;MKBMetro.prototype.init_=function(){this.attachEvents_();this.reactToPanZoomModel()};MKBMetro.prototype.attachEvents_=function(){function s(t){if(r&&n.linksEnabled){var i=$(t).attr("title");n.input_.val(i).trigger("search_start");n.headerSearchOpener_.trigger("click");n.headerMapSwitcher_.find('.tabs__opener[data-type="map"]').trigger("click")}}var n=this,r,i,u,o,t,f,e;this.tabsOpener_.on("click",function(){n.tabsOpenerSelectedData_=$(this).data("tab")});r=!0;this.metroMap_.on("metro_map_update",function(){n.refreshList(n.tabsOpenerSelectedData_)});this.input_.on("search_start",function(){n.refreshList(n.tabsOpenerSelectedData_)});this.tabs_.on("branches_markers_changed",function(){n.refreshList(n.tabsOpenerSelectedData_)});this.selectorOkatoRegion_.on("selector_changed",function(){n.refreshList(n.tabsOpenerSelectedData_)});$(document).on("mousedown",function(n){var t={x:n.clientX,y:n.clientY};i=t});$(document).on("selectstart",function(t){var r=n.$metroMapInner[0].getBoundingClientRect();r.width&&i&&i.x>=r.left&&i.x<=r.right&&i.y>=r.top&&i.y<=r.bottom&&$(t.target).is("div")&&t.preventDefault()});n.$metroMapInner.on("wheel",function(t){var i=t.originalEvent,u=i.deltaY,r;r=u<0?1.2:1/1.2;n.scaleAroundClientPoint(r,i.clientX,i.clientY);i.preventDefault()});n.$metroMapContent.on("dragstart",function(n){n.preventDefault()});u=!0;t=new Hammer.Manager(n.$metroMapInner[0]);t.add(new Hammer.Pinch);t.add(new Hammer.Pan({threshold:0}));f=new Hammer.Tap({event:"singletap"});e=new Hammer.Tap({event:"doubletap",taps:2});t.add([e,f]);e.recognizeWith(f);window.matchMedia&&window.matchMedia("(pointer:coarse)").matches&&f.requireFailure(e);t.on("pan",function(t){if(u){var i=n.panZoomModelAtPanStart,r=n.panZoomModel.scale;n.updatePanZoomModel({translateX:i.translateX+t.deltaX/r,translateY:i.translateY+t.deltaY/r})}});t.on("panstart",function(){n.panZoomModelAtPanStart=$.extend({},n.panZoomModel);r=!1});t.on("panend",function(){setTimeout(function(){r=!0},0)});t.on("pinch",function(t){var i=n.panZoomModelAtPinchStart;n.scaleAroundClientPoint(t.scale,n.pinchStartCenter.x,n.pinchStartCenter.y,i.scale)});t.on("pinchstart",function(t){clearTimeout(o);u=!1;n.panZoomModelAtPinchStart=$.extend({},n.panZoomModel);n.pinchStartCenter=t.center});t.on("pinchend",function(){o=setTimeout(function(){u=!0},100)});t.on("singletap",function(n){$(n.target).is(".metro-map__content a")&&s(n.target)});t.on("doubletap",function(t){var i=t.center;n.scaleAroundClientPoint(1.2,i.x,i.y)})};MKBMetro.prototype.refreshList=function(n){var t=this;t.dataHandler_=t.getDataHandler(n);t.metroMapContentLinks_.hide();t.dataHandler_&&t.dataHandler_.loadMetroGeoPointList(function(n){n&&t.refreshMetroMarkers(n||[])})};MKBMetro.prototype.refreshMetroMarkers=function(n){for(var i,r,u=this,t=0;t<n.length;t++)i=n[t].Name,r=u.metroMapContentLinks_.filter(function(){var n=$(this).attr("title");return i.toLowerCase()===n.toLowerCase()}),r.show()};MKBMetro.PROP_VAL_OFFICE="branch";MKBMetro.PROP_VAL_ATM="atm";MKBMetro.PROP_VAL_TERMINAL="terminal";MKBMetro.PROP_VAL_CASHDESK="cash-desk";MKBMetro.prototype.getDataHandler=function(n){var t=this;return n&&n===MKBMetro.PROP_VAL_OFFICE?new MKBMapDataOfficeHandler:n&&n===MKBMetro.PROP_VAL_ATM?new MKBMapDataAtmHandler:n&&n===MKBMetro.PROP_VAL_TERMINAL?new MKBMapDataTerminalHandler:n&&n===MKBMetro.PROP_VAL_CASHDESK?new MKBMapDataCashdeskHandler:new MKBMapDataDefaultHandler};MKBMetro.prototype.reactToPanZoomModel=function(){var t=this,n=t.panZoomModel,i="scale("+n.scale+") translate("+n.translateX+"px,"+n.translateY+"px)";t.$metroMapContent.css("transform",i)};MKBMetro.prototype.updatePanZoomModel=function(n){var i=this,t={};n&&(t.scale=n.scale,t.translateX=n.translateX,t.translateY=n.translateY);t=$.extend({},i.panZoomModel,t);var u=i.$metroMapInner.innerWidth(),f=i.$metroMapInner.innerHeight(),s=i.$metroMapContent.width(),h=i.$metroMapContent.height(),c=1/5,e=i.$metroMapInner[0].getBoundingClientRect(),o=i.$unobstructedViewArea[0].getBoundingClientRect(),r=t.scale,l=u-s*r,a=c*u,p=o.left-e.left,w=Math.max(l,p,a),b=o.right-e.right,k=Math.max(l,b,a),d=(w-u/2)/r,g=-s+(u/2-k)/r;t.translateX=Math.min(d,t.translateX);t.translateX=Math.max(g,t.translateX);var v=f-h*r,y=c*f,nt=o.top-e.top,tt=Math.max(v,nt,y),it=o.bottom-e.bottom,rt=Math.max(v,it,y),ut=(tt-f/2)/r,ft=-h+(f/2-rt)/r;t.translateY=Math.min(ut,t.translateY);t.translateY=Math.max(ft,t.translateY);$.extend(i.panZoomModel,t);i.reactToPanZoomModel()};MKBMetro.prototype.scaleAroundClientPoint=function(n,t,i,r){var f=this,u=f.$metroMapInner[0].getBoundingClientRect(),e=t-u.left,o=i-u.top;this.scaleAroundViewportPoint(n,e,o,r)};MKBMetro.prototype.scaleAroundViewportPoint=function(n,t,i,r){var u=this,o=u.panZoomModel.scale,f=u.calculateNewScale(n,r),s=t-u.$metroMapInner.innerWidth()/2,h=i-u.$metroMapInner.innerHeight()/2,e=f/o,c=u.panZoomModel.translateX+(1-e)*s/f,l=u.panZoomModel.translateY+(1-e)*h/f;u.updatePanZoomModel({scale:f,translateX:c,translateY:l})};MKBMetro.prototype.calculateNewScale=function(n,t){function u(){var n=i.$metroMapContent.width(),t=i.$metroMapContent.height(),r=i.$metroMapInner.innerWidth(),u=i.$metroMapInner.innerHeight(),f=r/n,e=u/t,o=Math.min(f,e);return Math.min(o,.5)}var i=this,f=t||i.panZoomModel.scale,r=f*n,e=u();return r=Math.max(r,e),Math.min(r,1)}
var MKBFilterCounters=function(){(this.tabs_=$(".tabs_branches"),this.tabs_.length!==0)&&(this.tabsOpeners_=this.tabs_.find(".tabs__openers"),this.tabsOpener_=this.tabsOpeners_.find(".tabs__opener"),this.tabsOpenerSelected_=this.tabs_.find(".tabs__opener.selected"),this.tabsOpenerSelectedData_=this.tabsOpenerSelected_.data("tab"),this.input_=$(".map-search-input"),this.branchOption_=$(".tabs_branches .branch-options__item"),this.branchOptionChbx_=this.branchOption_.find('input[type="checkbox"]'),this.selectorOkatoRegion=$(".selector.request_selector_okato_region"),this.branchesMap_=$("#branches-map"),this.dataHandler_,this.init_())};MKBFilterCounters.prototype.init_=function(){this.attachEvents_();this.refreshFilterCounters(this.tabsOpenerSelectedData_)};MKBFilterCounters.prototype.attachEvents_=function(){var n=this;this.tabsOpener_.on("click",function(){n.tabsOpenerSelectedData_=$(this).data("tab");n.refreshFilterCounters(n.tabsOpenerSelectedData_)});this.tabs_.on("branches_markers_changed",function(t,i,r){n.refreshFilterCounters(r)});this.selectorOkatoRegion.on("selector_changed",function(){n.refreshFilterCounters(n.tabsOpenerSelectedData_)});this.branchOptionChbx_.on("click",function(){n.refreshFilterCounters(n.tabsOpenerSelectedData_)});this.input_.on("search_start",function(){n.refreshFilterCounters(n.tabsOpenerSelectedData_)})};MKBFilterCounters.PROP_VAL_OFFICE="branch";MKBFilterCounters.PROP_VAL_ATM="atm";MKBFilterCounters.PROP_VAL_TERMINAL="terminal";MKBFilterCounters.PROP_VAL_CASHDESK="cash-desk";MKBFilterCounters.prototype.refreshFilterCounters=function(n){var t=this;$("sup").fadeTo(0,.01);t.dataHandler_=t.getDataHandler(n);t.dataHandler_&&t.dataHandler_.loadFilterCounters(function(n){n&&t.dataHandler_.processFilterCounters(n)})};MKBFilterCounters.prototype.getDataHandler=function(n){var t=this;return n&&n===MKBFilterCounters.PROP_VAL_OFFICE?new MKBMapDataOfficeHandler:n&&n===MKBFilterCounters.PROP_VAL_ATM?new MKBMapDataAtmHandler:n&&n===MKBFilterCounters.PROP_VAL_TERMINAL?new MKBMapDataTerminalHandler:n&&n===MKBFilterCounters.PROP_VAL_CASHDESK?new MKBMapDataCashdeskHandler:new MKBMapDataDefaultHandler}
var AddressOptions=function(){(this.branchesList_=$(".branches-list"),this.branchesListItem_=this.branchesList_.find(".branches-list__item"),this.branchOption_=$(".branch-options__item"),this.branchOption_.length!==0)&&(this.branchOptionChbx_=this.branchOption_.find('input[type="checkbox"]'),this.tabsBranches_=$(".tabs_branches"),this.tabsOpener_=this.tabsBranches_.find(".tabs__opener"),this.navFoldable_=$(".nav-foldable_branches"),this.navFoldableOption_=this.navFoldable_.find(".nav-foldable__list-option"),this.navFoldableBranchOption_=this.navFoldable_.find(".branch-options__item"),this.navFoldableSelectorOkatoRegion_=this.navFoldable_.find(".selector.request_selector_okato_region"),this.tabsBranchesSelectorOkatoRegion_=this.tabsBranches_.find(".selector.request_selector_okato_region"),this.navFoldableOptionChbx_=this.navFoldableBranchOption_.find('input[type="checkbox"]'),this.isChecked=!1,this.metroMap_=$(".metro-map"),this.init_())};AddressOptions.CLASS_SELECTED="selected";AddressOptions.prototype.init_=function(){this.attachEvents_()};AddressOptions.prototype.attachEvents_=function(){var n=this;this.branchOptionChbx_.on("click",function(){n.filterBranchesItems_($(this))});this.branchesList_.on("branches_list_filtered",function(t,i){var u=n.navFoldableBranchOption_.find('label[data-type="'+i+'"]'),r=u.prev('input[type="checkbox"]');n.isChecked===!0?r.prop("checked","checked"):r.prop("checked","");i=="partners-all"?n.updateOptionsPartners_(r):n.updateOptionsPartnersAll_(r)});this.navFoldableOption_.on("click",function(){var n=$(this).closest("li")});this.navFoldableOptionChbx_.on("click",function(){var r=$(this).next("label").data("type"),t=$(this).closest("li"),e=t.siblings("li"),u=t.find(".nav-foldable__list-option"),f=u.data("tab"),i=n.tabsBranches_.find('.tabs__opener[data-tab="'+f+'"]');n.tabsBranches_.find('label[data-type="'+r+'"]').prev("input").trigger("click");i.is("."+AddressOptions.CLASS_SELECTED)||i.trigger("click")});this.navFoldableSelectorOkatoRegion_.on("selector_changed",function(){var i=$(this),e=i.data("type"),r=i.closest("li"),l=r.siblings("li"),o=r.find(".nav-foldable__list-option"),s=o.data("tab"),u=n.tabsBranches_.find('.tabs__opener[data-tab="'+s+'"]'),f=i.find(".selector__list-option.selected"),h=f.data("id"),c=f.find("span").text(),t=n.tabsBranches_.find('.selector.request_selector_okato_region[data-type="'+e+'"]');t.find(".selector__list-option.selected").removeClass("selected");t.find('.selector__list-option[data-id="'+h+'"]').addClass("selected");t.find(".selector__opener").text(c);u.is("."+AddressOptions.CLASS_SELECTED)?t.trigger("selector_changed"):u.trigger("click")});this.tabsBranchesSelectorOkatoRegion_.on("selector_changed",function(){var i=$(this),u=i.data("type"),r=i.find(".selector__list-option.selected"),f=r.data("id"),e=r.find("span").text(),t=n.navFoldable_.find('.selector.request_selector_okato_region[data-type="'+u+'"]');t.find(".selector__list-option.selected").removeClass("selected");t.find('.selector__list-option[data-id="'+f+'"]').addClass("selected");t.find(".selector__opener").text(e)});this.tabsOpener_.on("click",function(t){var r,u,o,f;t.preventDefault();var e=$(this).data("tab"),i=n.tabsBranchesSelectorOkatoRegion_.filter('[data-type="terminal_okato_region"]'),s=i.find(".selector__list-option.selected").data("id");e=="terminal"&&i&&s.length==0&&(r=n.tabsBranchesSelectorOkatoRegion_.filter('[data-type="terminal_okato_region"]').find(".selector__list-option"),u=r.filter('[data-id="34"]'),r.removeClass("selected"),u.addClass("selected"),i.find(".selector__opener").html(u.html()));e=="atm"&&(o=n.navFoldableBranchOption_.find('label[data-type="partners-all"]'),f=o.prev('input[type="checkbox"]'),f.prop("checked",!0),n.updateOptionsPartners_(f))})};AddressOptions.prototype.filterBranchesItems_=function(n){var t=this.tabsBranches_.find(".tabs__content.active"),i=this.tabsBranches_.find(".tabs__opener.selected"),u=i.data("tab"),f=t.find('input[type="checkbox"]:checked'),r=n.next("label").data("type");this.isChecked=n.is(":checked")?!0:!1;this.branchesList_.trigger("branches_list_filtered",r);this.metroMap_.trigger("metro_map_update")};AddressOptions.prototype.updateOptionsPartners_=function(n){$(".branch-options__partners").find('input[type="checkbox"]').each(function(){n.is(":checked")?$(this).prop("checked",!0):$(this).prop("checked",!1)})};AddressOptions.prototype.updateOptionsPartnersAll_=function(n){var t=n.closest(".branch-options__partners"),i,r;t.length>0&&(i=t.find('input[type="checkbox"]:checked').length,r=t.find('input[type="checkbox"]').length,r==i?$('*[data-type="partners-all"]').prev('input[type="checkbox"]').prop("checked",!0):$('*[data-type="partners-all"]').prev('input[type="checkbox"]').prop("checked",!1))};AddressOptions.prototype.resetChbxs_=function(n){var i=n.siblings("li"),t=i.find('input[type="checkbox"]:checked');t.length>0&&t.trigger("click")}
function simpleUpload(n,t,i){function ii(){var bt,kt,n,o,ti,pt,y,wt,it,rt,p;if(typeof i=="object"&&i!==null){if(typeof i.forceIframe=="boolean"&&(ft=i.forceIframe),typeof i.init=="function"&&(ot=i.init),typeof i.start=="function"&&(st=i.start),typeof i.progress=="function"&&(ht=i.progress),typeof i.success=="function"&&(ct=i.success),typeof i.error=="function"&&(lt=i.error),typeof i.cancel=="function"&&(at=i.cancel),typeof i.complete=="function"&&(vt=i.complete),typeof i.finish=="function"&&(yt=i.finish),typeof i.hashWorker=="string"&&i.hashWorker!=""&&(d=i.hashWorker),typeof i.hashComplete=="function"&&(g=i.hashComplete),typeof i.data=="object"&&i.data!==null)for(n in i.data)nt[n]=i.data[n];if(typeof i.limit=="number"&&c(i.limit)&&i.limit>0&&(l=i.limit),typeof i.maxFileSize=="number"&&c(i.maxFileSize)&&i.maxFileSize>0&&(w=i.maxFileSize),typeof i.allowedExts=="object"&&i.allowedExts!==null)for(n in i.allowedExts)b.push(i.allowedExts[n]);if(typeof i.allowedTypes=="object"&&i.allowedTypes!==null)for(n in i.allowedTypes)k.push(i.allowedTypes[n]);if(typeof i.expect=="string"&&i.expect!=""){bt=i.expect.toLowerCase();kt=["auto","json","xml","html","script","text"];for(n in kt)if(kt[n]==bt){a=bt;break}}if(typeof i.xhrFields=="object"&&i.xhrFields!==null)for(n in i.xhrFields)et[n]=i.xhrFields[n]}if(typeof t=="object"&&t!==null&&t instanceof jQuery)if(t.length>0)t=t.get(0);else return!1;if(!ft&&window.File&&window.FileReader&&window.FileList&&window.Blob&&(typeof i=="object"&&i!==null&&typeof i.files=="object"&&i.files!==null?r=i.files:typeof t=="object"&&t!==null&&typeof t.files=="object"&&t.files!==null&&(r=t.files)),(typeof t!="object"||t===null)&&r==null)return!1;if(typeof i=="object"&&i!==null&&typeof i.name=="string"&&i.name!=""?v=i.name.replace(/\[\s*\]/g,"[0]"):typeof t=="object"&&t!==null&&typeof t.name=="string"&&t.name!=""&&(v=t.name.replace(/\[\s*\]/g,"[0]")),o=0,r!=null?r.length>0&&(o=r.length>1&&window.FormData&&$.ajaxSettings.xhr().upload?l>0&&r.length>l?l:r.length:1):t.value!=""&&(o=1),o>0){for(typeof t=="object"&&t!==null&&(ti=$(t),h=$("<form>").hide().attr("enctype","multipart/form-data").attr("method","post").appendTo("body"),ti.after(ti.clone(!0).val("")).removeAttr("onchange").off().removeAttr("id").attr("name",v).appendTo(h)),pt=0;pt<o;pt++)(function(n){u[n]={state:0,hashWorker:null,xhr:null,iframe:null};e[n]={upload:{index:n,state:"init",file:r!=null?r[n]:{name:t.value.split(/(\\|\/)/g).pop()},cancel:function(){if(f(n)==0)s(n,4);else if(f(n)==1)s(n,4),u[n].hashWorker!=null&&(u[n].hashWorker.terminate(),u[n].hashWorker=null),u[n].xhr!=null&&(u[n].xhr.abort(),u[n].xhr=null),u[n].iframe!=null&&($("iframe[name=simpleUpload_iframe_"+u[n].iframe+"]").attr("src","javascript:false;"),simpleUpload.dequeueIframe(u[n].iframe),u[n].iframe=null),ni(n);else return!1;return!0}}}})(pt);if(y=dt(o),y!==!1){if(wt=o,typeof y=="number"&&c(y)&&y>=0&&y<o)for(wt=y,p=wt;p<o;p++)s(p,4);for(it=[],rt=0;rt<wt;rt++)gt(rt,e[rt].upload.file)!==!1&&(it[it.length]=rt);it.length>0?(tt=it.length,simpleUpload.queueUpload(it,function(n){ri(n)}),simpleUpload.uploadNext()):ut()}else{for(p in e)s(p,4);ut()}}}function ri(n){if(f(n)==1){var i=null;if(r!=null)if(r[n]!=undefined&&r[n]!=null)i=r[n];else{o(n,{name:"InternalError",message:"There was an error uploading the file"});return}else if(t.value==""){o(n,{name:"InternalError",message:"There was an error uploading the file"});return}if(b.length>0&&!oi(b,i)){o(n,{name:"InvalidFileExtensionError",message:"That file format is not allowed"});return}if(k.length>0&&!si(k,i)){o(n,{name:"InvalidFileTypeError",message:"That file format is not allowed"});return}if(w>0&&!hi(w,i)){o(n,{name:"MaxFileSizeError",message:"That file is too big"});return}d!=null&&g!=null?ui(n):p(n)}}function ui(n){var t,f,s,i,o,e,l,h;if(r!=null&&r[n]!=undefined&&r[n]!=null&&window.Worker&&(t=r[n],t.size!=undefined&&t.size!=null&&t.size!=""&&c(t.size)&&(t.slice||t.webkitSlice||t.mozSlice)))try{f=new Worker(d);f.addEventListener("error",function(){f.terminate();u[n].hashWorker=null;p(n)},!1);f.addEventListener("message",function(t){if(t.data.result){var i=t.data.result;f.terminate();u[n].hashWorker=null;fi(n,i)}},!1);h=function(n){f.postMessage({message:n.target.result,block:i})};l=function(){i.end!==t.size&&(i.start+=s,i.end+=s,i.end>t.size&&(i.end=t.size),o=new FileReader,o.onload=h,t.slice?e=t.slice(i.start,i.end):t.webkitSlice?e=t.webkitSlice(i.start,i.end):t.mozSlice&&(e=t.mozSlice(i.start,i.end)),o.readAsArrayBuffer(e))};s=1048576;i={file_size:t.size,start:0};i.end=s>t.size?t.size:s;f.addEventListener("message",l,!1);o=new FileReader;o.onload=h;t.slice?e=t.slice(i.start,i.end):t.webkitSlice?e=t.webkitSlice(i.start,i.end):t.mozSlice&&(e=t.mozSlice(i.start,i.end));o.readAsArrayBuffer(e);u[n].hashWorker=f;return}catch(a){}p(n)}function fi(n,t){if(f(n)==1){var i=!1,r=function(t){return f(n)!=1?!1:i?!1:(i=!0,y(n,100),rt(n,t),!0)},u=function(){return f(n)!=1?!1:i?!1:(i=!0,p(n),!0)},s=function(t){return f(n)!=1?!1:i?!1:(i=!0,o(n,{name:"HashError",message:t}),!0)};g.call(e[n],t,{success:r,proceed:u,error:s})}}function p(i){var e,c,s,h;if(f(i)==1){if(r!=null)if(r[i]!=undefined&&r[i]!=null){if(window.FormData&&(e=$.ajaxSettings.xhr(),e.upload)){c=r[i];s=new FormData;bt(s,nt);s.append(v,c);h={url:n,data:s,type:"post",cache:!1,xhrFields:et,beforeSend:function(n){u[i].xhr=n},xhr:function(){return e.upload.addEventListener("progress",function(n){n.lengthComputable&&y(i,n.loaded/n.total*100)},!1),e},error:function(){u[i].xhr=null;o(i,{name:"RequestError",message:"Could not get response from server"})},success:function(n){u[i].xhr=null;y(i,100);rt(i,n)},contentType:!1,processData:!1};a!="auto"&&(h.dataType=a);$.ajax(h);return}}else{o(i,{name:"InternalError",message:"There was an error uploading the file"});return}typeof t=="object"&&t!==null?ei(i):o(i,{name:"UnsupportedError",message:"Your browser does not support this upload method"})}}function ei(t){var i,r;t==0?(i=simpleUpload.queueIframe({origin:ci(n),expect:a,complete:function(n){f(t)==1&&(u[t].iframe=null,simpleUpload.dequeueIframe(i),y(t,100),rt(t,n))},error:function(n){f(t)==1&&(u[t].iframe=null,simpleUpload.dequeueIframe(i),o(t,{name:"RequestError",message:n}))}}),u[t].iframe=i,r=wt(nt),h.attr("action",n+(n.lastIndexOf("?")==-1?"?":"&")+"_iframeUpload="+i+"&_="+(new Date).getTime()).attr("target","simpleUpload_iframe_"+i).prepend(r).submit()):o(t,{name:"UnsupportedError",message:"Multiple file uploads not supported"})}function wt(n,t){var r,i;(t===undefined||t===null||t==="")&&(t=null);r="";for(i in n)n[i]===undefined||n[i]===null?r+=$("<div>").append($('<input type="hidden">').attr("name",t==null?i+"":t+"["+i+"]").val("")).html():typeof n[i]=="object"?r+=wt(n[i],t==null?i+"":t+"["+i+"]"):typeof n[i]=="boolean"?r+=$("<div>").append($('<input type="hidden">').attr("name",t==null?i+"":t+"["+i+"]").val(n[i]?"true":"false")).html():typeof n[i]=="number"?r+=$("<div>").append($('<input type="hidden">').attr("name",t==null?i+"":t+"["+i+"]").val(n[i]+"")).html():typeof n[i]=="string"&&(r+=$("<div>").append($('<input type="hidden">').attr("name",t==null?i+"":t+"["+i+"]").val(n[i])).html());return r}function bt(n,t,i){(i===undefined||i===null||i==="")&&(i=null);for(var r in t)t[r]===undefined||t[r]===null?n.append(i==null?r+"":i+"["+r+"]",""):typeof t[r]=="object"?bt(n,t[r],i==null?r+"":i+"["+r+"]"):typeof t[r]=="boolean"?n.append(i==null?r+"":i+"["+r+"]",t[r]?"true":"false"):typeof t[r]=="number"?n.append(i==null?r+"":i+"["+r+"]",t[r]+""):typeof t[r]=="string"&&n.append(i==null?r+"":i+"["+r+"]",t[r])}function f(n){return u[n].state}function s(n,t){var i="";if(t==0)i="init";else if(t==1)i="uploading";else if(t==2)i="success";else if(t==3)i="error";else if(t==4)i="cancel";else return!1;u[n].state=t;e[n].upload.state=i}function kt(n){var t=n.lastIndexOf(".");return t!=-1?n.substr(t+1):""}function oi(n,i){var f,o,r,u,e;if(i!=undefined&&i!=null&&(f=i.name,f!=undefined&&f!=null&&f!="")){if(r=kt(f).toLowerCase(),r!=""){u=!1;for(e in n)if(n[e].toLowerCase()==r){u=!0;break}return u?!0:!1}return!1}if(typeof t=="object"&&t!==null){if(o=t.value,o!=""&&(r=kt(o).toLowerCase(),r!="")){u=!1;for(e in n)if(n[e].toLowerCase()==r){u=!0;break}if(u)return!0}}else return!0;return!1}function si(n,t){var i,r,u;if(t!=undefined&&t!=null&&(i=t.type,i!=undefined&&i!=null&&i!="")){i=i.toLowerCase();r=!1;for(u in n)if(n[u].toLowerCase()==i){r=!0;break}return r?!0:!1}return!0}function hi(n,t){if(t!=undefined&&t!=null){var i=t.size;if(i!=undefined&&i!=null&&i!=""&&c(i))return i<=n?!0:!1}return!0}function c(n){return!isNaN(n)&&parseInt(n)+""==n?!0:!1}function ci(n){var r=document.createElement("a"),i,t;return r.href=n,i=r.host,t=r.protocol,i==""&&(i=window.location.host),(t==""||t==":")&&(t=window.location.protocol),t.replace(/\:$/,"")+"://"+i}var ft=!1,r=null,l=0,w=0,b=[],k=[],a="auto",d=null,g=null,v="file",nt={},et={},ot=function(){},st=function(){},ht=function(){},ct=function(){},lt=function(){},at=function(){},vt=function(){},yt=function(){},e=[],u=[],pt={files:e},tt=0,h=null,it=function(n,t){ti(n,t);tt--;tt==0&&ut();simpleUpload.activeUploads--;simpleUpload.uploadNext()},dt=function(n){return ot.call(pt,n)},gt=function(n,t){if(f(n)>0)return!1;if(st.call(e[n],t)===!1)return s(n,4),!1;if(f(n)>0)return!1;s(n,1)},y=function(n,t){f(n)==1&&ht.call(e[n],t)},rt=function(n,t){f(n)==1&&(s(n,2),ct.call(e[n],t),it(n,"success"))},o=function(n,t){f(n)==1&&(s(n,3),lt.call(e[n],t),it(n,"error"))},ni=function(n){at.call(e[n]);it(n,"cancel")},ti=function(n,t){vt.call(e[n],t)},ut=function(){yt.call(pt);h!=null&&h.remove()};ii()}simpleUpload.maxUploads=10;simpleUpload.activeUploads=0;simpleUpload.uploads=[];simpleUpload.iframes={};simpleUpload.iframeCount=0;simpleUpload.queueUpload=function(n,t){simpleUpload.uploads[simpleUpload.uploads.length]={uploads:n,callback:t}};simpleUpload.uploadNext=function(){if(simpleUpload.uploads.length>0&&simpleUpload.activeUploads<simpleUpload.maxUploads){var n=simpleUpload.uploads[0],t=n.callback,i=n.uploads.splice(0,1)[0];n.uploads.length==0&&simpleUpload.uploads.splice(0,1);simpleUpload.activeUploads++;t(i);simpleUpload.uploadNext()}};simpleUpload.queueIframe=function(n){for(var t=0;t==0||t in simpleUpload.iframes;)t=Math.floor(Math.random()*999999999+1);return simpleUpload.iframes[t]=n,simpleUpload.iframeCount++,$("body").append('<iframe name="simpleUpload_iframe_'+t+'" style="display: none;"><\/iframe>'),t};simpleUpload.dequeueIframe=function(n){n in simpleUpload.iframes&&($("iframe[name=simpleUpload_iframe_"+n+"]").remove(),delete simpleUpload.iframes[n],simpleUpload.iframeCount--)};simpleUpload.convertDataType=function(n,t,i){var r="auto",u,f,e;if(n=="auto"){if(typeof t=="string"&&t!=""){u=t.toLowerCase();f=["json","xml","html","script","text"];for(e in f)if(f[e]==u){r=u;break}}}else r=n;if(r=="auto")return typeof i=="undefined"?"":typeof i=="object"?i:String(i);if(r=="json"){if(typeof i=="undefined"||i===null)return null;if(typeof i=="object")return i;if(typeof i=="string")try{return $.parseJSON(i)}catch(o){return!1}return!1}if(r=="xml"){if(typeof i=="undefined"||i===null)return null;if(typeof i=="string")try{return $.parseXML(i)}catch(o){return!1}return!1}if(r=="script"){if(typeof i=="undefined")return"";if(typeof i=="string")try{return $.globalEval(i),i}catch(o){return!1}return!1}return typeof i=="undefined"?"":String(i)};simpleUpload.iframeCallback=function(n){var t,i;typeof n=="object"&&n!==null&&(t=n.id,t in simpleUpload.iframes&&(i=simpleUpload.convertDataType(simpleUpload.iframes[t].expect,n.type,n.data),i!==!1?simpleUpload.iframes[t].complete(i):simpleUpload.iframes[t].error("Could not get response from server")))};simpleUpload.postMessageCallback=function(n){var u,t,i,r;try{u=n.message?"message":"data";t=n[u];typeof t=="string"&&t!=""&&(t=$.parseJSON(t),typeof t=="object"&&t!==null&&typeof t.namespace=="string"&&t.namespace=="simpleUpload"&&(i=t.id,i in simpleUpload.iframes&&n.origin===simpleUpload.iframes[i].origin&&(r=simpleUpload.convertDataType(simpleUpload.iframes[i].expect,t.type,t.data),r!==!1?simpleUpload.iframes[i].complete(r):simpleUpload.iframes[i].error("Could not get response from server"))))}catch(n){}};window.addEventListener?window.addEventListener("message",simpleUpload.postMessageCallback,!1):window.attachEvent("onmessage",simpleUpload.postMessageCallback),function(n){typeof define=="function"&&define.amd?define(["jquery"],n):typeof exports=="object"?module.exports=n(require("jquery")):n(jQuery)}(function(n){n.fn.simpleUpload=function(t,i){return n(this).length==0&&typeof i=="object"&&i!==null&&typeof i.files=="object"&&i.files!==null?(new simpleUpload(t,null,i),this):this.each(function(){new simpleUpload(t,this,i)})};n.fn.simpleUpload.maxSimultaneousUploads=function(n){return typeof n=="undefined"?simpleUpload.maxUploads:typeof n=="number"&&n>0?(simpleUpload.maxUploads=n,this):void 0}})
var MKBMapDataAtmHandler = function (MKBMap, MKBList) {

    this.MKBMap_ = MKBMap;
    this.MKBList_ = MKBList;

    this.tabsBranches_ = $('.tabs_branches');
};

MKBMapDataAtmHandler.prototype.loadGeoPointList = function (onCompleteCallback) {
    var that = this;

    var requestData = that.getCurrentFilterParams();

    $.ajax({
        type: 'POST',
        url: '/about/address/atm/MapGeoPointList',
        data: requestData,
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            that.MKBMap_.data_ = data;
        },
        error: function (xhr, str) {
            that.MKBMap_.data_ = {};
        },
        complete: function () {
            onCompleteCallback();
        }
    });
};

MKBMapDataAtmHandler.prototype.loadListGeoPointList = function (onCompleteCallback) {
    var that = this;

    var requestData = that.getCurrentFilterParams();
    $.ajax({
        type: 'POST',
        url: '/about/address/atm/ListGeoPointList',
        data: requestData,
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            onCompleteCallback(data);
        },
        error: function (xhr, str) {
            that.MKBList_.data_ = {};
            onCompleteCallback({});
        }
    });
};

MKBMapDataAtmHandler.prototype.loadMetroGeoPointList = function (onCompleteCallback) {
    var that = this;

    var requestData = that.getCurrentFilterParams();
    $.ajax({
        type: 'POST',
        url: '/about/address/atm/MetroGeoPointList',
        data: requestData,
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            onCompleteCallback(data);
        },
        error: function (xhr, str) {
            onCompleteCallback({});
        }
    });
};

MKBMapDataAtmHandler.prototype.loadFilterCounters = function (onCompleteCallback) {
    var that = this;

    var requestData = that.getCurrentFilterParams();
    $.ajax({
        type: 'POST',
        url: '/about/address/atm/FilterCounters',
        data: requestData,
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            onCompleteCallback(data);
        },
        error: function (xhr, str) {
            onCompleteCallback({});
        }
    });
};

MKBMapDataAtmHandler.prototype.getInfoWindowData = function (id, onCompleteCallback) {

    var result = {};

    var requestData = { id: id };
    $.ajax({
        type: 'POST',
        url: '/about/address/atm/InfoWindowData',
        data: requestData,
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            result = data;
        },
        error: function (xhr, str) {
            result = {};
        },
        complete: function () {
            onCompleteCallback(result);
        }
    });
};

MKBMapDataAtmHandler.prototype.getInfoWindowDataList = function (idList, onCompleteCallback) {
    var result = {};

    var requestData = { idList: idList };
    $.ajax({
        type: 'POST',
        url: '/about/address/atm/InfoWindowDataList',
        data: requestData,
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            result = data;
        },
        error: function (xhr, str) {
            result = {};
        },
        complete: function () {
            onCompleteCallback(result);
        }
    });
};

MKBMapDataAtmHandler.prototype.getItemLink = function (id) {

    return '/about/address/atm/' + id;
};

MKBMapDataAtmHandler.prototype.getCurrentFilterParams = function () {
    var that = this;

    var result = {};

    if (that.MKBMap_ && that.MKBMap_.id_)
        result.id = that.MKBMap_.id_ || null;

    result.SearchString = $('.map-search-input').val();
    if (that.MKBMap_ && $('.map-search-input').length > 1)
        result.SearchString = that.MKBMap_.getSearchString('.tabs__content_atm');  
    result.SkipRows = (that.MKBList_ && that.MKBList_.getCurrentListCount()) || 0;

    var $tabsContentActive = this.tabsBranches_.find('.tabs__content_atm');
    result.Work24Service = $tabsContentActive.find('input[type="checkbox"]:checked').next('label[data-type="work24"]').length !== 0 || null;
    result.OutRurService = $tabsContentActive.find('input[type="checkbox"]:checked').next('label[data-type="outrur"]').length !== 0 || null;
    result.OutUsdService = $tabsContentActive.find('input[type="checkbox"]:checked').next('label[data-type="outusd"]').length !== 0 || null;
    result.InCurrencyRubService = $tabsContentActive.find('input[type="checkbox"]:checked').next('label[data-type="currencyRub"]').length !== 0 || null;
    result.InCurrencyUsdService = $tabsContentActive.find('input[type="checkbox"]:checked').next('label[data-type="currencyUsd"]').length !== 0 || null;
    result.InCurrencyEurService = $tabsContentActive.find('input[type="checkbox"]:checked').next('label[data-type="currencyEur"]').length !== 0 || null;

    var allPartnersEnabled = $tabsContentActive.find('input.chbx_partners').first().prop("checked");

    result.PartnerAlfaEnabled = allPartnersEnabled || $tabsContentActive.find('input[type="checkbox"]:checked').next('label[data-type="alfa"]').length !== 0 || null;
    result.PartnerRaiffeisenEnabled = allPartnersEnabled || $tabsContentActive.find('input[type="checkbox"]:checked').next('label[data-type="raiffeisen"]').length !== 0 || null;
    result.PartnerUnicreditEnabled = allPartnersEnabled || $tabsContentActive.find('input[type="checkbox"]:checked').next('label[data-type="unicredit"]').length !== 0 || null;
    result.PartnerKuEnabled = allPartnersEnabled || $tabsContentActive.find('input[type="checkbox"]:checked').next('label[data-type="ku"]').length !== 0 || null;
    //для карты на главной странице
    result.OkatoRegionId = ($tabsContentActive.length == 0 ? $('.selector.request_selector_okato_region[data-type="atm"]').find(".selector__list-option.selected").data('id')
        : $tabsContentActive.find('.selector.request_selector_okato_region').find(".selector__list-option.selected").data('id')) || null;

    return result;
};

MKBMapDataAtmHandler.prototype.processFilterCounters = function (data) {
    $('label[data-type="work24"]').find('sup').html(data.Work24ServiceCount).fadeTo('fast', 0.5);
    $('label[data-type="outrur"]').find('sup').html(data.OutRurServiceCount).fadeTo('fast', 0.5);
    $('label[data-type="outusd"]').find('sup').html(data.OutUsdServiceCount).fadeTo('fast', 0.5);
    $('label[data-type="currencyRub"]').find('sup').html(data.InCurrencyRubService).fadeTo('fast', 0.5);
    $('label[data-type="currencyUsd"]').find('sup').html(data.InCurrencyUsdService).fadeTo('fast', 0.5);
    $('label[data-type="currencyEur"]').find('sup').html(data.InCurrencyEurService).fadeTo('fast', 0.5);
    $('label[data-type="alfa"]').find('sup').html(data.PartnerAlfaCount).fadeTo('fast', 0.5);
    $('label[data-type="raiffeisen"]').find('sup').html(data.PartnerRaiffeisenCount).fadeTo('fast', 0.5);
    $('label[data-type="unicredit"]').find('sup').html(data.PartnerUnicreditCount).fadeTo('fast', 0.5);
    $('label[data-type="ku"]').find('sup').html(data.PartnerKuCount).fadeTo('fast', 0.5);
}
var MKBMapDataAtmPartnerHandler = function (MKBMap, MKBList) {

    this.MKBMap_ = MKBMap;
    this.MKBList_ = MKBList;

    this.tabsBranches_ = $('.tabs_branches');
};

MKBMapDataAtmPartnerHandler.prototype.loadGeoPointList = function (onCompleteCallback) {
    var that = this;

    var requestData = that.getCurrentFilterParams();

    $.ajax({
        type: 'POST',
        url: '/about/address/atm-partner/MapGeoPointList',
        data: requestData,
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            that.MKBMap_.data_ = data;
        },
        error: function (xhr, str) {
            that.MKBMap_.data_ = {};
        },
        complete: function () {
            onCompleteCallback();
        }
    });
};

MKBMapDataAtmPartnerHandler.prototype.getInfoWindowData = function (id, onCompleteCallback) {

    var result = {};

    var requestData = { id: id };
    $.ajax({
        type: 'POST',
        url: '/about/address/atm-partner/InfoWindowData',
        data: requestData,
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            result = data;
        },
        error: function (xhr, str) {
            result = {};
        },
        complete: function () {
            onCompleteCallback(result);
        }
    });
};

MKBMapDataAtmPartnerHandler.prototype.getInfoWindowDataList = function (idList, onCompleteCallback) {

    var result = {};

    var requestData = { idList: idList };
    $.ajax({
        type: 'POST',
        url: '/about/address/atm-partner/InfoWindowDataList',
        data: requestData,
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            result = data;
        },
        error: function (xhr, str) {
            result = {};
        },
        complete: function () {
            onCompleteCallback(result);
        }
    });
};

MKBMapDataAtmPartnerHandler.prototype.getItemLink = function (id) {

    return '/about/address/atm-partner/' + id;
};

MKBMapDataAtmPartnerHandler.prototype.getCurrentFilterParams = function () {
    var that = this;

    var result = {};

    if (that.MKBMap_ && that.MKBMap_.id_)
        result.id = that.MKBMap_.id_ || null; 

    result.SearchString = $('.map-search-input').val();
    if (that.MKBMap_ && $('.map-search-input').length > 1)
        result.SearchString = that.MKBMap_.getSearchString('.tabs__content_atm');
    result.SkipRows = (that.MKBList_ && that.MKBList_.getCurrentListCount()) || 0;

    var $tabsContentActive = this.tabsBranches_.find('.tabs__content_atm');
    result.Work24Service = $tabsContentActive.find('input[type="checkbox"]:checked').next('label[data-type="work24"]').length !== 0 || null;
    result.OutRurService = $tabsContentActive.find('input[type="checkbox"]:checked').next('label[data-type="outrur"]').length !== 0 || null;
    result.OutUsdService = $tabsContentActive.find('input[type="checkbox"]:checked').next('label[data-type="outusd"]').length !== 0 || null;
    result.InCurrencyRubService = $tabsContentActive.find('input[type="checkbox"]:checked').next('label[data-type="currencyRub"]').length !== 0 || null;
    result.InCurrencyUsdService = $tabsContentActive.find('input[type="checkbox"]:checked').next('label[data-type="currencyUsd"]').length !== 0 || null;
    result.InCurrencyEurService = $tabsContentActive.find('input[type="checkbox"]:checked').next('label[data-type="currencyEur"]').length !== 0 || null;

    var allPartnersEnabled = $tabsContentActive.find('input.chbx_partners').first().prop("checked");

    result.PartnerAlfaEnabled = allPartnersEnabled || $tabsContentActive.find('input[type="checkbox"]:checked').next('label[data-type="alfa"]').length !== 0 || null;
    result.PartnerRaiffeisenEnabled = allPartnersEnabled || $tabsContentActive.find('input[type="checkbox"]:checked').next('label[data-type="raiffeisen"]').length !== 0 || null;
    result.PartnerUnicreditEnabled = allPartnersEnabled || $tabsContentActive.find('input[type="checkbox"]:checked').next('label[data-type="unicredit"]').length !== 0 || null;
    result.PartnerKuEnabled = allPartnersEnabled || $tabsContentActive.find('input[type="checkbox"]:checked').next('label[data-type="ku"]').length !== 0 || null;
 
    //для карты на главной странице
    result.OkatoRegionId = ($tabsContentActive.length == 0 ? $('.selector.request_selector_okato_region[data-type="atm"]').find(".selector__list-option.selected").data('id') 
        : $tabsContentActive.find('.selector.request_selector_okato_region').find(".selector__list-option.selected").data('id')) || null;

    return result;
};
var MKBMapDataBuildingHandler = function (MKBMap) {

    this.MKBMap_ = MKBMap;
};

MKBMapDataBuildingHandler.prototype.loadGeoPointList = function (onCompleteCallback) {
    var that = this;

    $.ajax({
        type: 'POST',
        url: '/personal/building/MapGeoPointList',
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            that.MKBMap_.data_ = data;
        },
        error: function (xhr, str) {
            that.MKBMap_.data_ = {};
        },
        complete: function () {
            onCompleteCallback();
        }
    });
};

MKBMapDataBuildingHandler.prototype.loadListGeoPointList = function (onCompleteCallback) {
    onCompleteCallback({});
};

MKBMapDataBuildingHandler.prototype.getInfoWindowData = function (id, onCompleteCallback) {

    var result = {};

    var requestData = { id: id };
    $.ajax({
        type: 'POST',
        url: '/personal/building/InfoWindowData',
        data: requestData,
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            result = data;
        },
        error: function (xhr, str) {
            result = {};
        },
        complete: function () {
            onCompleteCallback(result);
        }
    });
};

MKBMapDataBuildingHandler.prototype.getItemLink = function (id) {

    return null;
};
var MKBMapDataCashdeskHandler = function (MKBMap, MKBList) {

    this.MKBMap_ = MKBMap;
    this.MKBList_ = MKBList;

    this.tabsBranches_ = $('.tabs_branches');
};

MKBMapDataCashdeskHandler.prototype.loadGeoPointList = function (onCompleteCallback) {
    var that = this;

    var requestData = that.getCurrentFilterParams();

    $.ajax({
        type: 'POST',
        url: '/about/address/cash-desk/MapGeoPointList',
        data: requestData,
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            that.MKBMap_.data_ = data;
        },
        error: function (xhr, str) {
            that.MKBMap_.data_ = {};
        },
        complete: function () {
            onCompleteCallback();
        }
    });
};

MKBMapDataCashdeskHandler.prototype.loadListGeoPointList = function (onCompleteCallback) {
    var that = this;

    var requestData = that.getCurrentFilterParams();
    $.ajax({
        type: 'POST',
        url: '/about/address/cash-desk/ListGeoPointList',
        data: requestData,
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            onCompleteCallback(data);
        },
        error: function (xhr, str) {
            that.MKBList_.data_ = {};
            onCompleteCallback({});
        }
    });
};

MKBMapDataCashdeskHandler.prototype.loadMetroGeoPointList = function (onCompleteCallback) {
    var that = this;

    var requestData = that.getCurrentFilterParams();
    $.ajax({
        type: 'POST',
        url: '/about/address/cash-desk/MetroGeoPointList',
        data: requestData,
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            onCompleteCallback(data);
        },
        error: function (xhr, str) {
            onCompleteCallback({});
        }
    });
};

MKBMapDataCashdeskHandler.prototype.loadFilterCounters = function (onCompleteCallback) {
    var that = this;
};

MKBMapDataCashdeskHandler.prototype.getInfoWindowData = function (id, onCompleteCallback) {

    var result = {};

    var requestData = { id: id };
    $.ajax({
        type: 'POST',
        url: '/about/address/cash-desk/InfoWindowData',
        data: requestData,
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            result = data;
        },
        error: function (xhr, str) {
            result = {};
        },
        complete: function () {
            onCompleteCallback(result);
        }
    });
};

MKBMapDataCashdeskHandler.prototype.getInfoWindowDataList = function (idList, onCompleteCallback) {

    var result = {};

    var requestData = { idList: idList };
    $.ajax({
        type: 'POST',
        url: '/about/address/cash-desk/InfoWindowDataList',
        data: requestData,
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            result = data;
        },
        error: function (xhr, str) {
            result = {};
        },
        complete: function () {
            onCompleteCallback(result);
        }
    });
};

MKBMapDataCashdeskHandler.prototype.getItemLink = function (id) {

    return '/about/address/cash-desk/' + id;
};

MKBMapDataCashdeskHandler.prototype.getCurrentFilterParams = function () {
    var that = this;

    var result = {};

    if (that.MKBMap_ && that.MKBMap_.id_)
        result.id = that.MKBMap_.id_ || null;

    result.SearchString = $('.map-search-input').val();
    if (that.MKBMap_ && $('.map-search-input').length > 1)
        result.SearchString = that.MKBMap_.getSearchString('.tabs__content_cash-desk');
    result.SkipRows = (that.MKBList_ && that.MKBList_.getCurrentListCount()) || 0;

    return result;
};

MKBMapDataCashdeskHandler.prototype.processFilterCounters = function (data) {
}

var MKBMapDataDefaultHandler = function (MKBMap, MKBList) {

    this.MKBMap_ = MKBMap;
    this.MKBList_ = MKBList;
};

MKBMapDataDefaultHandler.prototype.loadGeoPointList = function (onCompleteCallback) {
    var that = this;

    that.MKBMap_.data_ = {};
};

MKBMapDataDefaultHandler.prototype.loadListGeoPointList = function (onCompleteCallback) {
    var that = this;

    onCompleteCallback({});
};

MKBMapDataDefaultHandler.prototype.loadMetroGeoPointList = function (onCompleteCallback) {
    var that = this;

    onCompleteCallback({});
};

MKBMapDataDefaultHandler.prototype.getInfoWindowData = function (id, onCompleteCallback) {

    return {};
};

MKBMapDataDefaultHandler.prototype.getItemLink = function (id) {

    return '#';
};
var MKBMapDataNonCoreAssetHandler = function (MKBMap) {

    this.MKBMap_ = MKBMap;
};

MKBMapDataNonCoreAssetHandler.prototype.loadGeoPointList = function (onCompleteCallback) {
    var that = this;

    $.ajax({
        type: 'POST',
        url: '/personal/NonCoreAsset/MapGeoPointList',
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            that.MKBMap_.data_ = data;
        },
        error: function (xhr, str) {
            that.MKBMap_.data_ = {};
        },
        complete: function () {
            onCompleteCallback();
        }
    });
};

MKBMapDataNonCoreAssetHandler.prototype.loadListGeoPointList = function (onCompleteCallback) {
    onCompleteCallback({});
};

MKBMapDataNonCoreAssetHandler.prototype.getInfoWindowData = function (id, onCompleteCallback) {

    var result = {};

    var requestData = { id: id };
    $.ajax({
        type: 'POST',
        url: '/personal/NonCoreAsset/InfoWindowData',
        data: requestData,
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            result = data;
        },
        error: function (xhr, str) {
            result = {};
        },
        complete: function () {
            onCompleteCallback(result);
        }
    });
};

MKBMapDataNonCoreAssetHandler.prototype.getItemLink = function (id) {

    return null;
};

var MKBMapDataOfficeHandler = function (MKBMap, MKBList) {

    this.MKBMap_ = MKBMap;
    this.MKBList_ = MKBList;

    this.tabsBranches_ = $('.tabs_branches');
};

MKBMapDataOfficeHandler.prototype.loadGeoPointList = function (onCompleteCallback) {
    var that = this;

    var requestData = that.getCurrentFilterParams();

    $.ajax({
        type: 'POST',
        url: '/about/address/branch/MapGeoPointList',
        data: requestData,
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            that.MKBMap_.data_ = data;
        },
        error: function (xhr, str) {
            that.MKBMap_.data_ = {};
        },
        complete: function () {
            onCompleteCallback();
        }
    });
};

MKBMapDataOfficeHandler.prototype.loadListGeoPointList = function (onCompleteCallback) {
    var that = this;

    var requestData = that.getCurrentFilterParams();
    $.ajax({
        type: 'POST',
        url: '/about/address/branch/ListGeoPointList',
        data: requestData,
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            onCompleteCallback(data);
        },
        error: function (xhr, str) {
            that.MKBList_.data_ = {};
            onCompleteCallback({});
        }
    });
};

MKBMapDataOfficeHandler.prototype.loadMetroGeoPointList = function (onCompleteCallback) {
    var that = this;

    var requestData = that.getCurrentFilterParams();
    $.ajax({
        type: 'POST',
        url: '/about/address/branch/MetroGeoPointList',
        data: requestData,
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            onCompleteCallback(data);
        },
        error: function (xhr, str) {
            onCompleteCallback({});
        }
    });
};

MKBMapDataOfficeHandler.prototype.loadFilterCounters = function (onCompleteCallback) {
    var that = this;

    var requestData = that.getCurrentFilterParams();
    $.ajax({
        type: 'POST',
        url: '/about/address/branch/FilterCounters',
        data: requestData,
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            onCompleteCallback(data);
        },
        error: function (xhr, str) {
            onCompleteCallback({});
        }
    });
};

MKBMapDataOfficeHandler.prototype.getInfoWindowData = function (id, onCompleteCallback) {

    var result = {};

    var requestData = { id: id };
    $.ajax({
        type: 'POST',
        url: '/about/address/branch/InfoWindowData',
        data: requestData,
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            result = data;
        },
        error: function (xhr, str) {
            result = {};
        },
        complete: function () {
            onCompleteCallback(result);
        }
    });
};

MKBMapDataOfficeHandler.prototype.getInfoWindowDataList = function (idList, onCompleteCallback) {

    var result = {};

    var requestData = { idList: idList };
    $.ajax({
        type: 'POST',
        url: '/about/address/branch/InfoWindowDataList',
        data: requestData,
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            result = data;
        },
        error: function (xhr, str) {
            result = {};
        },
        complete: function () {
            onCompleteCallback(result);
        }
    });
};

MKBMapDataOfficeHandler.prototype.getItemLink = function (id) {

    return '/about/address/branch/' + id;
};

MKBMapDataOfficeHandler.prototype.getCurrentFilterParams = function () {
    var that = this;

    var result = {};

    if (that.MKBMap_ && that.MKBMap_.id_)
        result.id = that.MKBMap_.id_ || null;

    result.SearchString = $('.map-search-input').val();
    if (that.MKBMap_ && $('.map-search-input').length > 1)
        result.SearchString = that.MKBMap_.getSearchString('.tabs__content_branch');
    result.SkipRows = (that.MKBList_ && that.MKBList_.getCurrentListCount()) || 0;

    var $tabsContentActive = this.tabsBranches_.length == 0 ? $('.tabs__content_branch') : this.tabsBranches_.find('.tabs__content_branch');
    result.IndService = $tabsContentActive.find('input[type="checkbox"]:checked').next('label[data-type="individuals"]').length !== 0 || null;
    result.CorpService = $tabsContentActive.find('input[type="checkbox"]:checked').next('label[data-type="business"]').length !== 0 || null;
    result.SafeService = $tabsContentActive.find('input[type="checkbox"]:checked').next('label[data-type="safes-rent"]').length !== 0 || null;
    result.PremiumService = $tabsContentActive.find('input[type="checkbox"]:checked').next('label[data-type="premium"]').length !== 0 || null;
    result.ForMainSite = true;
    //для карты на главной странице
    result.OkatoRegionId = ($tabsContentActive.length == 0 ? $('.selector.request_selector_okato_region[data-type="branch"]').find(".selector__list-option.selected").data('id')
        : $tabsContentActive.find('.selector.request_selector_okato_region').find(".selector__list-option.selected").data('id')) || null;
    result.GroupCode = $tabsContentActive.length == 0 ? null : $tabsContentActive.data('group-code') == "" ? null : $tabsContentActive.data('group-code');
    return result;
};


MKBMapDataOfficeHandler.prototype.processFilterCounters = function (data) {
    $('label[data-type="individuals"]').find('sup').html(data.IndWorkCount).fadeTo('fast', 0.5);
    $('label[data-type="business"]').find('sup').html(data.CorpWorkCount).fadeTo('fast', 0.5);
    $('label[data-type="safes-rent"]').find('sup').html(data.SafeServiceCount).fadeTo('fast', 0.5);
    $('label[data-type="premium"]').find('sup').html(data.PremiumServiceCount).fadeTo('fast', 0.5);
}
var MKBMapDataTerminalHandler = function (MKBMap, MKBList) {

    this.MKBMap_ = MKBMap;
    this.MKBList_ = MKBList;

    this.tabsBranches_ = $('.tabs_branches');
};

MKBMapDataTerminalHandler.prototype.loadGeoPointList = function (onCompleteCallback) {
    var that = this;
    
    var requestData = that.getCurrentFilterParams();
    
    $.ajax({
        type: 'POST',
        url: '/about/address/terminal/MapGeoPointList',
        data: requestData,
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            that.MKBMap_.data_ = data;
        },
        error: function (xhr, str) {
            that.MKBMap_.data_ = {};
        },
        complete: function () {
            onCompleteCallback();
        }
    });
};

MKBMapDataTerminalHandler.prototype.loadListGeoPointList = function (onCompleteCallback) {
    var that = this;
    
    var requestData = that.getCurrentFilterParams();
    $.ajax({
        type: 'POST',
        url: '/about/address/terminal/ListGeoPointList',
        data: requestData,
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            onCompleteCallback(data);
        },
        error: function (xhr, str) {
            that.MKBList_.data_ = {};
            onCompleteCallback({});
        }
    });
};

MKBMapDataTerminalHandler.prototype.loadMetroGeoPointList = function (onCompleteCallback) {
    var that = this;
    
    var requestData = that.getCurrentFilterParams();
    $.ajax({
        type: 'POST',
        url: '/about/address/terminal/MetroGeoPointList',
        data: requestData,
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            onCompleteCallback(data);
        },
        error: function (xhr, str) {
            onCompleteCallback({});
        }
    });
};

MKBMapDataTerminalHandler.prototype.loadFilterCounters = function (onCompleteCallback) {
    var that = this;
    
    var requestData = that.getCurrentFilterParams();
    $.ajax({
        type: 'POST',
        url: '/about/address/terminal/FilterCounters',
        data: requestData,
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            onCompleteCallback(data);
        },
        error: function (xhr, str) {
            onCompleteCallback({});
        }
    });
};

MKBMapDataTerminalHandler.prototype.getInfoWindowData = function (id, onCompleteCallback) {

    var result = {};
    
    var requestData = { id: id };
    $.ajax({
        type: 'POST',
        url: '/about/address/terminal/InfoWindowData',
        data: requestData,
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            result = data;
        },
        error: function (xhr, str) {
            result = {};
        },
        complete: function () {
            onCompleteCallback(result);
        }
    });
};

MKBMapDataTerminalHandler.prototype.getInfoWindowDataList = function (idList, onCompleteCallback) {

    var result = {};

    var requestData = { idList: idList };
    $.ajax({
        type: 'POST',
        url: '/about/address/terminal/InfoWindowDataList',
        data: requestData,
        cache: false,
        async: true,
        dataType: "json",
        success: function (data) {
            result = data;
        },
        error: function (xhr, str) {
            result = {};
        },
        complete: function () {
            onCompleteCallback(result);
        }
    });
};

MKBMapDataTerminalHandler.prototype.getItemLink = function (id) {

    return '/about/address/terminal/' + id;
};

MKBMapDataTerminalHandler.prototype.getCurrentFilterParams = function () {
    var that = this;

    var result = {};

    if (that.MKBMap_ && that.MKBMap_.id_)
        result.id = that.MKBMap_.id_ || null;

    
    result.SearchString = $('.map-search-input').val();
    if (that.MKBMap_ && $('.map-search-input').length > 1)
        result.SearchString = that.MKBMap_.getSearchString('.tabs__content_terminal');    
    result.SkipRows = (that.MKBList_ && that.MKBList_.getCurrentListCount()) || 0;

    var $tabsContentActive = this.tabsBranches_.find('.tabs__content_terminal');
    result.Work24 = $tabsContentActive.find('input[type="checkbox"]:checked').next('label[data-type="twenty-four-term"]').length !== 0 || null;
    result.CardAccept = $tabsContentActive.find('input[type="checkbox"]:checked').next('label[data-type="with-cards"]').length !== 0 || null;
    result.CardTroyka = $tabsContentActive.find('input[type="checkbox"]:checked').next('label[data-type="troyka"]').length !== 0 || null;
    //для карты на главной странице
    result.OkatoRegionId = ($tabsContentActive.length == 0 ? $('.selector.request_selector_okato_region[data-type="terminal"]').find(".selector__list-option.selected").data('id')
        : $tabsContentActive.find('.selector.request_selector_okato_region').find(".selector__list-option.selected").data('id')) || null;

    return result;
};

MKBMapDataTerminalHandler.prototype.processFilterCounters = function (data) {
    $('label[data-type="twenty-four-term"]').find('sup').html(data.Work24Count).fadeTo('fast', 0.5);
    $('label[data-type="with-cards"]').find('sup').html(data.CardAcceptCount).fadeTo('fast', 0.5);
    $('label[data-type="troyka"]').find('sup').html(data.CardTroykaCount).fadeTo('fast', 0.5);
}
// @author alizunov
// @created 31.10.2016
// @copyright https://mkb.ru

    var MKBMapSearch = function (root, input, distance, initMapError) {
        /**
         * @type {google.maps}
         * @private
         */
        this.map_ = root;

        this.hasMap_ = ($(this.map_).length !== 0);
        this.initMapError_ = initMapError;


        /**
         * @type {Object}
         * @private
         */
        this.distance_ = distance;


        /**
         * @type {*|{}|jQuery}
         * @private
         */
        this.input_ = input || $('.map-search-input');


        this.init_();
    };


    MKBMapSearch.prototype.init_ = function () {
      this.attachEvents_();
    };


    MKBMapSearch.prototype.attachEvents_ = function () {
      var that = this;

      this.input_.on('keydown', function (event) {
          if (event.which == 13) {
              if (that.hasMap_ || that.initMapError_) {
                  that.input_.trigger('search_start', { id: event.target.id });
              }
              else {
                  that.redirectToAddress_(this);
              }
        }
      });

      this.input_.on('search_end', function (event, feature) {
          that.zoomToFirstCoordinates_(feature);
      });
    };


    MKBMapSearch.prototype.redirectToAddress_ = function (input) {
        var tabs = $(input).parents('.tabs');
        var dataTab = tabs.find('.tabs__openers .tabs__opener.selected').data('tab');
        var url = '/about/address/' + dataTab; 
        url = url + '?SearchString=' + $(input).val();

        if (url)
            location.href = url;
    }

    MKBMapSearch.prototype.zoomToFirstCoordinates_ = function (feature) {
        var that = this;

        if (that.initMapError_)
            return;

        var latCurrent = null;
        var lngCurrent = null;

        if (feature) {
            var latCurrent = feature.geometry.coordinates[1];
            var lngCurrent = feature.geometry.coordinates[0];
        }

        if (!latCurrent)
            return;

        var coordinatesCurrent = [lngCurrent, latCurrent];
        that.map_.coordinatesCurrent = coordinatesCurrent;
        var bounds = that.map_.geoObjects.getBounds();
        that.map_.setBounds(bounds, { checkZoomRange: true });
    };
var UtmManager = function (cookieName,paramName,elemSelector) {
    var that = this;
    that.url = window.location.pathname;
    that.utm = decodeURIComponent(window.location.search.substring(1));
    that.guid = Cookies.get(cookieName);

    that.UtmSend = function () {
        $.ajax({
            url: '/Utm/UtmSend',
            dataType: "json",
            type: "POST",
            data: { url: that.url, utm: that.utm, param: paramName, cookieName: cookieName, guid: that.guid },
            cache: false,
            success: function (data) {
                if (data.IsSuccess) {
                    that.utm = data.Result.Utm;
                    $(elemSelector).val(that.utm);
                }
            }
        });

    }

    that.UtmSend();
};
/*************************
 * Croppie
 * Copyright 2016
 * Foliotek
 * Version: 2.4.0
 *************************/
(function (root, factory) {
    if (typeof define === 'function' && define.amd) {
        // AMD. Register as an anonymous module.
        define(['exports'], factory);
    } else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
        // CommonJS
        factory(exports);
    } else {
        // Browser globals
        factory((root.commonJsStrict = {}));
    }
}(this, function (exports) {

    /* Polyfills */
    if (typeof Promise !== 'function') {
        /*! promise-polyfill 3.1.0 */
        !function(a){function b(a,b){return function(){a.apply(b,arguments)}}function c(a){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof a)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],i(a,b(e,this),b(f,this))}function d(a){var b=this;return null===this._state?void this._deferreds.push(a):void k(function(){var c=b._state?a.onFulfilled:a.onRejected;if(null===c)return void(b._state?a.resolve:a.reject)(b._value);var d;try{d=c(b._value)}catch(e){return void a.reject(e)}a.resolve(d)})}function e(a){try{if(a===this)throw new TypeError("A promise cannot be resolved with itself.");if(a&&("object"==typeof a||"function"==typeof a)){var c=a.then;if("function"==typeof c)return void i(b(c,a),b(e,this),b(f,this))}this._state=!0,this._value=a,g.call(this)}catch(d){f.call(this,d)}}function f(a){this._state=!1,this._value=a,g.call(this)}function g(){for(var a=0,b=this._deferreds.length;b>a;a++)d.call(this,this._deferreds[a]);this._deferreds=null}function h(a,b,c,d){this.onFulfilled="function"==typeof a?a:null,this.onRejected="function"==typeof b?b:null,this.resolve=c,this.reject=d}function i(a,b,c){var d=!1;try{a(function(a){d||(d=!0,b(a))},function(a){d||(d=!0,c(a))})}catch(e){if(d)return;d=!0,c(e)}}var j=setTimeout,k="function"==typeof setImmediate&&setImmediate||function(a){j(a,1)},l=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};c.prototype["catch"]=function(a){return this.then(null,a)},c.prototype.then=function(a,b){var e=this;return new c(function(c,f){d.call(e,new h(a,b,c,f))})},c.all=function(){var a=Array.prototype.slice.call(1===arguments.length&&l(arguments[0])?arguments[0]:arguments);return new c(function(b,c){function d(f,g){try{if(g&&("object"==typeof g||"function"==typeof g)){var h=g.then;if("function"==typeof h)return void h.call(g,function(a){d(f,a)},c)}a[f]=g,0===--e&&b(a)}catch(i){c(i)}}if(0===a.length)return b([]);for(var e=a.length,f=0;f<a.length;f++)d(f,a[f])})},c.resolve=function(a){return a&&"object"==typeof a&&a.constructor===c?a:new c(function(b){b(a)})},c.reject=function(a){return new c(function(b,c){c(a)})},c.race=function(a){return new c(function(b,c){for(var d=0,e=a.length;e>d;d++)a[d].then(b,c)})},c._setImmediateFn=function(a){k=a},"undefined"!=typeof module&&module.exports?module.exports=c:a.Promise||(a.Promise=c)}(this);
    }

    if ( typeof window.CustomEvent !== "function" ) {
        (function(){
            function CustomEvent ( event, params ) {
                params = params || { bubbles: false, cancelable: false, detail: undefined };
                var evt = document.createEvent( 'CustomEvent' );
                evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );
                return evt;
            }
            CustomEvent.prototype = window.Event.prototype;
            window.CustomEvent = CustomEvent;
        }());
    }

    if (!HTMLCanvasElement.prototype.toBlob) {
        Object.defineProperty(HTMLCanvasElement.prototype, 'toBlob', {
            value: function (callback, type, quality) {
                var binStr = atob( this.toDataURL(type, quality).split(',')[1] ),
                len = binStr.length,
                arr = new Uint8Array(len);

                for (var i=0; i<len; i++ ) {
                    arr[i] = binStr.charCodeAt(i);
                }

                callback( new Blob( [arr], {type: type || 'image/png'} ) );
            }
        });
    }
    /* End Polyfills */

    var cssPrefixes = ['Webkit', 'Moz', 'ms'],
        emptyStyles = document.createElement('div').style,
        CSS_TRANS_ORG,
        CSS_TRANSFORM,
        CSS_USERSELECT;

    function vendorPrefix(prop) {
        if (prop in emptyStyles) {
            return prop;
        }

        var capProp = prop[0].toUpperCase() + prop.slice(1),
            i = cssPrefixes.length;

        while (i--) {
            prop = cssPrefixes[i] + capProp;
            if (prop in emptyStyles) {
                return prop;
            }
        }
    }

    CSS_TRANSFORM = vendorPrefix('transform');
    CSS_TRANS_ORG = vendorPrefix('transformOrigin');
    CSS_USERSELECT = vendorPrefix('userSelect');

    // Credits to : Andrew Dupont - http://andrewdupont.net/2009/08/28/deep-extending-objects-in-javascript/
    function deepExtend(destination, source) {
        destination = destination || {};
        for (var property in source) {
            if (source[property] && source[property].constructor && source[property].constructor === Object) {
                destination[property] = destination[property] || {};
                deepExtend(destination[property], source[property]);
            } else {
                destination[property] = source[property];
            }
        }
        return destination;
    }

    function debounce(func, wait, immediate) {
        var timeout;
        return function () {
            var context = this, args = arguments;
            var later = function () {
                timeout = null;
                if (!immediate) func.apply(context, args);
            };
            var callNow = immediate && !timeout;
            clearTimeout(timeout);
            timeout = setTimeout(later, wait);
            if (callNow) func.apply(context, args);
        };
    }

    function dispatchChange(element) {
        if ("createEvent" in document) {
            var evt = document.createEvent("HTMLEvents");
            evt.initEvent("change", false, true);
            element.dispatchEvent(evt);
        }
        else {
            element.fireEvent("onchange");
        }
    }

    //http://jsperf.com/vanilla-css
    function css(el, styles, val) {
        if (typeof (styles) === 'string') {
            var tmp = styles;
            styles = {};
            styles[tmp] = val;
        }
        
        for (var prop in styles) {el.style[prop] = styles[prop];
        }
    }

    function addClass(el, c) {
        if (el.classList) {
            el.classList.add(c);
        }
        else {
            el.className += ' ' + c;
        }
    }

    function removeClass(el, c) {
        if (el.classList) {
            el.classList.remove(c);
        }
        else {
            el.className = el.className.replace(c, '');
        }
    }

    function num(v) {
        return parseInt(v, 10);
    }

    /* Utilities */
    function loadImage(src, imageEl) {
        var img = imageEl || new Image();
        img.style.opacity = 0;

        return new Promise(function (resolve) {
            if (img.src === src) {
                // If image source hasn't changed resolve immediately
                resolve(img);
            } 
            else {
                img.removeAttribute('crossOrigin');
                if (src.match(/^https?:\/\/|^\/\//)) {
                    img.setAttribute('crossOrigin', 'anonymous');
                }
                img.onload = function () {
                    setTimeout(function () {
                        resolve(img);
                    }, 1);
                }
                img.src = src;
            }
        });
    }


    /* CSS Transform Prototype */
    var TRANSLATE_OPTS = {
        'translate3d': {
            suffix: ', 0px'
        },
        'translate': {
            suffix: ''
        }
    };
    var Transform = function (x, y, scale) {
        this.x = parseFloat(x);
        this.y = parseFloat(y);
        this.scale = parseFloat(scale);
    };

    Transform.parse = function (v) {
        if (v.style) {
            return Transform.parse(v.style[CSS_TRANSFORM]);
        }
        else if (v.indexOf('matrix') > -1 || v.indexOf('none') > -1) {
            return Transform.fromMatrix(v);
        }
        else {
            return Transform.fromString(v);
        }
    };

    Transform.fromMatrix = function (v) {
        var vals = v.substring(7).split(',');
        if (!vals.length || v === 'none') {
            vals = [1, 0, 0, 1, 0, 0];
        }

        return new Transform(num(vals[4]), num(vals[5]), parseFloat(vals[0]));
    };

    Transform.fromString = function (v) {
        var values = v.split(') '),
            translate = values[0].substring(Croppie.globals.translate.length + 1).split(','),
            scale = values.length > 1 ? values[1].substring(6) : 1,
            x = translate.length > 1 ? translate[0] : 0,
            y = translate.length > 1 ? translate[1] : 0;

        return new Transform(x, y, scale);
    };

    Transform.prototype.toString = function () {
        var suffix = TRANSLATE_OPTS[Croppie.globals.translate].suffix || '';
        return Croppie.globals.translate + '(' + this.x + 'px, ' + this.y + 'px' + suffix + ') scale(' + this.scale + ')';
    };

    var TransformOrigin = function (el) {
        if (!el || !el.style[CSS_TRANS_ORG]) {
            this.x = 0;
            this.y = 0;
            return;
        }
        var css = el.style[CSS_TRANS_ORG].split(' ');
        this.x = parseFloat(css[0]);
        this.y = parseFloat(css[1]);
    };

    TransformOrigin.prototype.toString = function () {
        return this.x + 'px ' + this.y + 'px';
    };

    function getExifOrientation (img, cb) {
        if (!window.EXIF) {
            cb(0);
        }

        EXIF.getData(img, function () {
            var orientation = EXIF.getTag(this, 'Orientation');
            cb(orientation);
        });
    }

    function drawCanvas(canvas, img, orientation) {
        var width = img.width,
            height = img.height,
            ctx = canvas.getContext('2d');

        canvas.width = img.width;
        canvas.height = img.height;

        ctx.save();
        switch (orientation) {
          case 2:
             ctx.translate(width, 0);
             ctx.scale(-1, 1);
             break;

          case 3:
              ctx.translate(width, height);
              ctx.rotate(180*Math.PI/180);
              break;

          case 4:
              ctx.translate(0, height);
              ctx.scale(1, -1);
              break;

          case 5:
              canvas.width = height;
              canvas.height = width;
              ctx.rotate(90*Math.PI/180);
              ctx.scale(1, -1);
              break;

          case 6:
              canvas.width = height;
              canvas.height = width;
              ctx.rotate(90*Math.PI/180);
              ctx.translate(0, -height);
              break;

          case 7:
              canvas.width = height;
              canvas.height = width;
              ctx.rotate(-90*Math.PI/180);
              ctx.translate(-width, height);
              ctx.scale(1, -1);
              break;

          case 8:
              canvas.width = height;
              canvas.height = width;
              ctx.translate(0, width);
              ctx.rotate(-90*Math.PI/180);
              break;
        }
        ctx.drawImage(img, 0,0, width, height);
        ctx.restore();
    }

    /* Private Methods */
    function _create() {
        var self = this,
            contClass = 'croppie-container',
            customViewportClass = self.options.viewport.type ? 'cr-vp-' + self.options.viewport.type : null,
            boundary, img, viewport, overlay, canvas, bw, bh;

        self.options.useCanvas = self.options.enableOrientation || _hasExif.call(self);
        // Properties on class
        self.data = {};
        self.elements = {};

        // Generating Markup
        boundary = self.elements.boundary = document.createElement('div');
        viewport = self.elements.viewport = document.createElement('div');
        img = self.elements.img = document.createElement('img');
        overlay = self.elements.overlay = document.createElement('div');

        if (self.options.useCanvas) {
            self.elements.canvas = document.createElement('canvas');
            self.elements.preview = self.elements.canvas;
        }
        else {
            self.elements.preview = self.elements.img;
        }

        addClass(boundary, 'cr-boundary');
        bw = self.options.boundary.width;
        bh = self.options.boundary.height;
        css(boundary, {
            width: (bw + (isNaN(bw) ? '' : 'px')),
            height: (bh + (isNaN(bh) ? '' : 'px'))
        });

        addClass(viewport, 'cr-viewport');
        if (customViewportClass) {
            addClass(viewport, customViewportClass);
        }
        css(viewport, {
            width: self.options.viewport.width + 'px',
            height: self.options.viewport.height + 'px'
        });
        viewport.setAttribute('tabindex', 0);

        addClass(self.elements.preview, 'cr-image');
        addClass(overlay, 'cr-overlay');

        self.element.appendChild(boundary);
        boundary.appendChild(self.elements.preview);
        boundary.appendChild(viewport);
        boundary.appendChild(overlay);

        addClass(self.element, contClass);
        if (self.options.customClass) {
            addClass(self.element, self.options.customClass);
        }

        _initDraggable.call(this);

        if (self.options.enableZoom) {
            _initializeZoom.call(self);
        }

        // if (self.options.enableOrientation) {
        //     _initRotationControls.call(self);
        // }
    }

    // function _initRotationControls () {
    //     var self = this,
    //         wrap, btnLeft, btnRight, iLeft, iRight;

    //     wrap = document.createElement('div');
    //     self.elements.orientationBtnLeft = btnLeft = document.createElement('button');
    //     self.elements.orientationBtnRight = btnRight = document.createElement('button');

    //     wrap.appendChild(btnLeft);
    //     wrap.appendChild(btnRight);

    //     iLeft = document.createElement('i');
    //     iRight = document.createElement('i');
    //     btnLeft.appendChild(iLeft);
    //     btnRight.appendChild(iRight);

    //     addClass(wrap, 'cr-rotate-controls');
    //     addClass(btnLeft, 'cr-rotate-l');
    //     addClass(btnRight, 'cr-rotate-r');

    //     self.elements.boundary.appendChild(wrap);

    //     btnLeft.addEventListener('click', function () {
    //         self.rotate(-90);
    //     });
    //     btnRight.addEventListener('click', function () {
    //         self.rotate(90);
    //     });
    // }

    function _hasExif() {
        return this.options.enableExif && window.EXIF;
    }

    function _setZoomerVal(v) {
        if (this.options.enableZoom) {
            var z = this.elements.zoomer,
                val = fix(v, 4);

            z.value = Math.max(z.min, Math.min(z.max, val));
        }
    }

    function _initializeZoom() {
        var self = this,
            wrap = self.elements.zoomerWrap = document.createElement('div'),
            zoomer = self.elements.zoomer = document.createElement('input');

        addClass(wrap, 'cr-slider-wrap');
        addClass(zoomer, 'cr-slider');
        zoomer.type = 'range';
        zoomer.step = '0.0001';
        zoomer.value = 1;
        zoomer.style.display = self.options.showZoomer ? '' : 'none';

        self.element.appendChild(wrap);
        wrap.appendChild(zoomer);

        self._currentZoom = 1;

        function change() {
            _onZoom.call(self, {
                value: parseFloat(zoomer.value),
                origin: new TransformOrigin(self.elements.preview),
                viewportRect: self.elements.viewport.getBoundingClientRect(),
                transform: Transform.parse(self.elements.preview)
            });
        }

        function scroll(ev) {
            var delta, targetZoom;

            if (ev.wheelDelta) {
                delta = ev.wheelDelta / 1200; //wheelDelta min: -120 max: 120 // max x 10 x 2
            } else if (ev.deltaY) {
                delta = ev.deltaY / 1060; //deltaY min: -53 max: 53 // max x 10 x 2
            } else if (ev.detail) {
                delta = ev.detail / -60; //delta min: -3 max: 3 // max x 10 x 2
            } else {
                delta = 0;
            }

            targetZoom = self._currentZoom + (delta * self._currentZoom);

            ev.preventDefault();
            _setZoomerVal.call(self, targetZoom);
            change.call(self);
        }

        self.elements.zoomer.addEventListener('input', change);// this is being fired twice on keypress
        self.elements.zoomer.addEventListener('change', change);

        if (self.options.mouseWheelZoom) {
            self.elements.boundary.addEventListener('mousewheel', scroll);
            self.elements.boundary.addEventListener('DOMMouseScroll', scroll);
        }
    }

    function _onZoom(ui) {
        var self = this,
            transform = ui ? ui.transform : Transform.parse(self.elements.preview),
            vpRect = ui ? ui.viewportRect : self.elements.viewport.getBoundingClientRect(),
            origin = ui ? ui.origin : new TransformOrigin(self.elements.preview),
            transCss = {};

        function applyCss() {
            var transCss = {};
            transCss[CSS_TRANSFORM] = transform.toString();
            transCss[CSS_TRANS_ORG] = origin.toString();
            css(self.elements.preview, transCss);
        }

        self._currentZoom = ui ? ui.value : self._currentZoom;
        transform.scale = self._currentZoom;
        applyCss();


        if (self.options.enforceBoundary) {
            var boundaries = _getVirtualBoundaries.call(self, vpRect),
                transBoundaries = boundaries.translate,
                oBoundaries = boundaries.origin;

            if (transform.x >= transBoundaries.maxX) {
                origin.x = oBoundaries.minX;
                transform.x = transBoundaries.maxX;
            }

            if (transform.x <= transBoundaries.minX) {
                origin.x = oBoundaries.maxX;
                transform.x = transBoundaries.minX;
            }

            if (transform.y >= transBoundaries.maxY) {
                origin.y = oBoundaries.minY;
                transform.y = transBoundaries.maxY;
            }

            if (transform.y <= transBoundaries.minY) {
                origin.y = oBoundaries.maxY;
                transform.y = transBoundaries.minY;
            }
        }
        applyCss();
        _debouncedOverlay.call(self);
        _triggerUpdate.call(self);
    }

    function _getVirtualBoundaries(viewport) {
        var self = this,
            scale = self._currentZoom,
            vpWidth = viewport.width,
            vpHeight = viewport.height,
            centerFromBoundaryX = self.elements.boundary.clientWidth / 2,
            centerFromBoundaryY = self.elements.boundary.clientHeight / 2,
            imgRect = self.elements.preview.getBoundingClientRect(),
            curImgWidth = imgRect.width,
            curImgHeight = imgRect.height,
            halfWidth = vpWidth / 2,
            halfHeight = vpHeight / 2;

        var maxX = ((halfWidth / scale) - centerFromBoundaryX) * -1;
        var minX = maxX - ((curImgWidth * (1 / scale)) - (vpWidth * (1 / scale)));

        var maxY = ((halfHeight / scale) - centerFromBoundaryY) * -1;
        var minY = maxY - ((curImgHeight * (1 / scale)) - (vpHeight * (1 / scale)));

        var originMinX = (1 / scale) * halfWidth;
        var originMaxX = (curImgWidth * (1 / scale)) - originMinX;

        var originMinY = (1 / scale) * halfHeight;
        var originMaxY = (curImgHeight * (1 / scale)) - originMinY;

        return {
            translate: {
                maxX: maxX,
                minX: minX,
                maxY: maxY,
                minY: minY
            },
            origin: {
                maxX: originMaxX,
                minX: originMinX,
                maxY: originMaxY,
                minY: originMinY
            }
        };
    }

    function _updateCenterPoint() {
        var self = this,
            scale = self._currentZoom,
            data = self.elements.preview.getBoundingClientRect(),
            vpData = self.elements.viewport.getBoundingClientRect(),
            transform = Transform.parse(self.elements.preview.style[CSS_TRANSFORM]),
            pc = new TransformOrigin(self.elements.preview),
            top = (vpData.top - data.top) + (vpData.height / 2),
            left = (vpData.left - data.left) + (vpData.width / 2),
            center = {},
            adj = {};

        center.y = top / scale;
        center.x = left / scale;

        adj.y = (center.y - pc.y) * (1 - scale);
        adj.x = (center.x - pc.x) * (1 - scale);

        transform.x -= adj.x;
        transform.y -= adj.y;

        var newCss = {};
        newCss[CSS_TRANS_ORG] = center.x + 'px ' + center.y + 'px';
        newCss[CSS_TRANSFORM] = transform.toString();
        css(self.elements.preview, newCss);
    }

    function _initDraggable() {
        var self = this,
            isDragging = false,
            originalX,
            originalY,
            originalDistance,
            vpRect,
            transform;

        function assignTransformCoordinates(deltaX, deltaY) {
            var imgRect = self.elements.preview.getBoundingClientRect(),
                top = transform.y + deltaY,
                left = transform.x + deltaX;

            if (self.options.enforceBoundary) {
                if (vpRect.top > imgRect.top + deltaY && vpRect.bottom < imgRect.bottom + deltaY) {
                    transform.y = top;
                }

                if (vpRect.left > imgRect.left + deltaX && vpRect.right < imgRect.right + deltaX) {
                    transform.x = left;
                }
            }
            else {
                transform.y = top;
                transform.x = left;
            }
        }

        function keyDown(ev) {
            var LEFT_ARROW  = 37,
                UP_ARROW    = 38,
                RIGHT_ARROW = 39,
                DOWN_ARROW  = 40;

            if (ev.shiftKey && (ev.keyCode == UP_ARROW || ev.keyCode == DOWN_ARROW)) {
                var zoom = 0.0;
                if (ev.keyCode == UP_ARROW) {
                    zoom = parseFloat(self.elements.zoomer.value, 10) + parseFloat(self.elements.zoomer.step, 10)
                }
                else {
                    zoom = parseFloat(self.elements.zoomer.value, 10) - parseFloat(self.elements.zoomer.step, 10)
                }
                self.setZoom(zoom);
            }
            else if (ev.keyCode >= 37 && ev.keyCode <= 40) {
                ev.preventDefault();
                var movement = parseKeyDown(ev.keyCode);

                transform = Transform.parse(self.elements.preview);
                document.body.style[CSS_USERSELECT] = 'none';
                vpRect = self.elements.viewport.getBoundingClientRect();
                keyMove(movement);
            };

            function parseKeyDown(key) {
                switch (key) {
                    case LEFT_ARROW:
                        return [1, 0];
                    case UP_ARROW:
                        return [0, 1];
                    case RIGHT_ARROW:
                        return [-1, 0];
                    case DOWN_ARROW:
                        return [0, -1];
                };
            };
        }

        function keyMove(movement) {
            var deltaX = movement[0],
                deltaY = movement[1],
                newCss = {};

            assignTransformCoordinates(deltaX, deltaY);

            newCss[CSS_TRANSFORM] = transform.toString();
            css(self.elements.preview, newCss);
            _updateOverlay.call(self);
            document.body.style[CSS_USERSELECT] = '';
            _updateCenterPoint.call(self);
            _triggerUpdate.call(self);
            originalDistance = 0;
        }

        function mouseDown(ev) {
            ev.preventDefault();
            if (isDragging) return;
            isDragging = true;
            originalX = ev.pageX;
            originalY = ev.pageY;

            if (ev.touches) {
                var touches = ev.touches[0];
                originalX = touches.pageX;
                originalY = touches.pageY;
            }

            transform = Transform.parse(self.elements.preview);
            window.addEventListener('mousemove', mouseMove);
            window.addEventListener('touchmove', mouseMove);
            window.addEventListener('mouseup', mouseUp);
            window.addEventListener('touchend', mouseUp);
            document.body.style[CSS_USERSELECT] = 'none';
            vpRect = self.elements.viewport.getBoundingClientRect();
        }

        function mouseMove(ev) {
            ev.preventDefault();
            var pageX = ev.pageX,
                pageY = ev.pageY;

            if (ev.touches) {
                var touches = ev.touches[0];
                pageX = touches.pageX;
                pageY = touches.pageY;
            }

            var deltaX = pageX - originalX,
                deltaY = pageY - originalY,
                newCss = {};

            if (ev.type == 'touchmove') {
                if (ev.touches.length > 1) {
                    var touch1 = ev.touches[0];
                    var touch2 = ev.touches[1];
                    var dist = Math.sqrt((touch1.pageX - touch2.pageX) * (touch1.pageX - touch2.pageX) + (touch1.pageY - touch2.pageY) * (touch1.pageY - touch2.pageY));

                    if (!originalDistance) {
                        originalDistance = dist / self._currentZoom;
                    }

                    var scale = dist / originalDistance;

                    _setZoomerVal.call(self, scale);
                    dispatchChange(self.elements.zoomer);
                    return;
                }
            }

            assignTransformCoordinates(deltaX, deltaY);

            newCss[CSS_TRANSFORM] = transform.toString();
            css(self.elements.preview, newCss);
            _updateOverlay.call(self);
            originalY = pageY;
            originalX = pageX;
        }

        function mouseUp() {
            isDragging = false;
            window.removeEventListener('mousemove', mouseMove);
            window.removeEventListener('touchmove', mouseMove);
            window.removeEventListener('mouseup', mouseUp);
            window.removeEventListener('touchend', mouseUp);
            document.body.style[CSS_USERSELECT] = '';
            _updateCenterPoint.call(self);
            _triggerUpdate.call(self);
            originalDistance = 0;
        }

        self.elements.overlay.addEventListener('mousedown', mouseDown);
        self.elements.viewport.addEventListener('keydown', keyDown);
        self.elements.overlay.addEventListener('touchstart', mouseDown);
    }

    function _updateOverlay() {
        var self = this,
            boundRect = self.elements.boundary.getBoundingClientRect(),
            imgData = self.elements.preview.getBoundingClientRect();

        css(self.elements.overlay, {
            width: imgData.width + 'px',
            height: imgData.height + 'px',
            top: (imgData.top - boundRect.top) + 'px',
            left: (imgData.left - boundRect.left) + 'px'
        });
    }
    var _debouncedOverlay = debounce(_updateOverlay, 500);

    function _triggerUpdate() {
        var self = this,
            data = self.get(),
            ev;

        if (!_isVisible.call(self)) {
            return;
        }

        self.options.update.call(self, data);
        if (self.$ && typeof Prototype == 'undefined') {
            self.$(self.element).trigger('update', data); 
        }
        else {
            var ev;
            if (window.CustomEvent) {
                ev = new CustomEvent('update', { detail: data });
            } else {
                ev = document.createEvent('CustomEvent');
                ev.initCustomEvent('update', true, true, data);
            }

            self.element.dispatchEvent(ev);
        }
    }

    function _isVisible() {
        return this.elements.preview.offsetHeight > 0 && this.elements.preview.offsetWidth > 0;
    }

    function _updatePropertiesFromImage() {
        var self = this,
            minZoom = 0,
            maxZoom = 1.5,
            initialZoom = 1,
            cssReset = {},
            img = self.elements.preview,
            zoomer = self.elements.zoomer,
            transformReset = new Transform(0, 0, initialZoom),
            originReset = new TransformOrigin(),
            isVisible = _isVisible.call(self),
            imgData,
            vpData,
            boundaryData,
            minW,
            minH;

        if (!isVisible || self.data.bound) {
            // if the croppie isn't visible or it doesn't need binding
            return;
        }

        self.data.bound = true;
        cssReset[CSS_TRANSFORM] = transformReset.toString();
        cssReset[CSS_TRANS_ORG] = originReset.toString();
        cssReset['opacity'] = 1;
        css(img, cssReset);

        imgData = img.getBoundingClientRect();
        vpData = self.elements.viewport.getBoundingClientRect();
        boundaryData = self.elements.boundary.getBoundingClientRect();
        self._originalImageWidth = imgData.width;
        self._originalImageHeight = imgData.height;

        if (self.options.enableZoom) {
            if (self.options.enforceBoundary) {
                minW = vpData.width / imgData.width;
                minH = vpData.height / imgData.height;
                minZoom = Math.max(minW, minH);
            }

            if (minZoom >= maxZoom) {
                maxZoom = minZoom + 1;
            }

            zoomer.min = fix(minZoom, 4);
            zoomer.max = fix(maxZoom, 4);
            var defaultInitialZoom = Math.max((boundaryData.width / imgData.width), (boundaryData.height / imgData.height));
            initialZoom = self.data.boundZoom !== null ? self.data.boundZoom : defaultInitialZoom;
            _setZoomerVal.call(self, initialZoom);
            dispatchChange(zoomer);
        }
        else {
            self._currentZoom = initialZoom;
        }

        transformReset.scale = self._currentZoom;
        cssReset[CSS_TRANSFORM] = transformReset.toString();
        css(img, cssReset);

        if (self.data.points.length) {
            _bindPoints.call(self, self.data.points);
        }
        else {
            _centerImage.call(self);
        }

        _updateCenterPoint.call(self);
        _updateOverlay.call(self);
    }

    function _bindPoints(points) {
        if (points.length != 4) {
            throw "Croppie - Invalid number of points supplied: " + points;
        }
        var self = this,
            pointsWidth = points[2] - points[0],
            // pointsHeight = points[3] - points[1],
            vpData = self.elements.viewport.getBoundingClientRect(),
            boundRect = self.elements.boundary.getBoundingClientRect(),
            vpOffset = {
                left: vpData.left - boundRect.left,
                top: vpData.top - boundRect.top
            },
            scale = vpData.width / pointsWidth,
            originTop = points[1],
            originLeft = points[0],
            transformTop = (-1 * points[1]) + vpOffset.top,
            transformLeft = (-1 * points[0]) + vpOffset.left,
            newCss = {};

        newCss[CSS_TRANS_ORG] = originLeft + 'px ' + originTop + 'px';
        newCss[CSS_TRANSFORM] = new Transform(transformLeft, transformTop, scale).toString();
        css(self.elements.preview, newCss);

        _setZoomerVal.call(self, scale);
        self._currentZoom = scale;
    }

    function _centerImage() {
        var self = this,
            imgDim = self.elements.preview.getBoundingClientRect(),
            vpDim = self.elements.viewport.getBoundingClientRect(),
            boundDim = self.elements.boundary.getBoundingClientRect(),
            vpLeft = vpDim.left - boundDim.left,
            vpTop = vpDim.top - boundDim.top,
            w = vpLeft - ((imgDim.width - vpDim.width) / 2),
            h = vpTop - ((imgDim.height - vpDim.height) / 2),
            transform = new Transform(w, h, self._currentZoom);

        css(self.elements.preview, CSS_TRANSFORM, transform.toString());
    }

    function _transferImageToCanvas(customOrientation) {
        var self = this,
            canvas = self.elements.canvas,
            img = self.elements.img,
            ctx = canvas.getContext('2d'),
            exif = _hasExif.call(self),
            customOrientation = self.options.enableOrientation && customOrientation;

        ctx.clearRect(0, 0, canvas.width, canvas.height);
        canvas.width = img.width;
        canvas.height = img.height;

        if (exif) {
            getExifOrientation(img, function (orientation) {
                drawCanvas(canvas, img, num(orientation, 10));
                if (customOrientation) {
                    drawCanvas(canvas, img, customOrientation);
                }
            });
        } else if (customOrientation) {
            drawCanvas(canvas, img, customOrientation);
        }
    }

    function _getCanvas(data) {
        var self = this,
            points = data.points,
            left = num(points[0]),
            top = num(points[1]),
            right = num(points[2]),
            bottom = num(points[3]),
            width = right-left,
            height = bottom-top,
            circle = data.circle,
            canvas = document.createElement('canvas'),
            ctx = canvas.getContext('2d'),
            outWidth = width,
            outHeight = height,
            startX = 0,
            startY = 0,
            canvasWidth = outWidth,
            canvasHeight = outHeight,
            customDimensions = (data.outputWidth && data.outputHeight),
            outputRatio = 1;

        if (customDimensions) {
            canvasWidth = data.outputWidth;
            canvasHeight = data.outputHeight;
            outputRatio = canvasWidth / outWidth;
        }

        canvas.width = canvasWidth;
        canvas.height = canvasHeight;

        if (data.backgroundColor) {
            ctx.fillStyle = data.backgroundColor;
            ctx.fillRect(0, 0, outWidth, outHeight);
        }
        // start fixing data to send to draw image for enforceBoundary: false
        if (left < 0) {
            startX = Math.abs(left);
            left = 0;
        }
        if (top < 0) {
            startY = Math.abs(top);
            top = 0;
        }
        if (right > self._originalImageWidth) {
            width = self._originalImageWidth - left;
            outWidth = width;
        }
        if (bottom > self._originalImageHeight) {
            height = self._originalImageHeight - top;
            outHeight = height;
        }

        if (outputRatio !== 1) {
            startX *= outputRatio;
            startY *= outputRatio;
            outWidth *= outputRatio;
            outHeight *= outputRatio;
        }

        ctx.drawImage(this.elements.preview, left, top, width, height, startX, startY, outWidth, outHeight);
        if (circle) {
            ctx.fillStyle = '#fff';
            ctx.globalCompositeOperation = 'destination-in';
            ctx.beginPath();
            ctx.arc(outWidth / 2, outHeight / 2, outWidth / 2, 0, Math.PI * 2, true);
            ctx.closePath();
            ctx.fill();
        }
        return canvas;
    }

    function _getHtmlResult(data) {
        var points = data.points,
            div = document.createElement('div'),
            img = document.createElement('img'),
            width = points[2] - points[0],
            height = points[3] - points[1];

        addClass(div, 'croppie-result');
        div.appendChild(img);
        css(img, {
            left: (-1 * points[0]) + 'px',
            top: (-1 * points[1]) + 'px'
        });
        img.src = data.url;
        css(div, {
            width: width + 'px',
            height: height + 'px'
        });

        return div;
    }

    function _getBase64Result(data) {
        return _getCanvas.call(this, data).toDataURL(data.format, data.quality);
    }

    function _getBlobResult(data) {
        var self = this;
        return new Promise(function (resolve, reject) {
            _getCanvas.call(self, data).toBlob(function (blob) {
                resolve(blob);
            }, data.format, data.quality);
        });
    }

    function _bind(options, cb) {
        var self = this,
            url,
            points = [],
            zoom = null;

        if (typeof (options) === 'string') {
            url = options;
            options = {};
        }
        else if (Array.isArray(options)) {
            points = options.slice();
        }
        else if (typeof (options) == 'undefined' && self.data.url) { //refreshing
            _updatePropertiesFromImage.call(self);
            _triggerUpdate.call(self);
            return null;
        }
        else {
            url = options.url;
            points = options.points || [];
            zoom = typeof(options.zoom) === 'undefined' ? null : options.zoom;
        }

        self.data.bound = false;
        self.data.url = url || self.data.url;
        self.data.boundZoom = zoom;

        return loadImage(url, self.elements.img).then(function (img) {
            if(!points.length){
                var iWidth = img.naturalWidth;
                var iHeight = img.naturalHeight;

                var rect = self.elements.viewport.getBoundingClientRect();
                var aspectRatio = rect.width / rect.height;
                var width, height;

                if( iWidth / iHeight > aspectRatio){
                    height = iHeight;
                    width = height * aspectRatio;
                }else{
                    width = iWidth;
                    height = width / aspectRatio;
                }

                var x0 = (iWidth - width) / 2;
                var y0 = (iHeight - height) / 2;
                var x1 = x0 + width;
                var y1 = y0 + height;

                self.data.points = [x0, y0, x1, y1];
            } else {
                if(self.options.relative){
                    // de-relative points
                    points = [
                        points[0] * img.naturalWidth / 100,
                        points[1] * img.naturalHeight / 100,
                        points[2] * img.naturalWidth / 100,
                        points[3] * img.naturalHeight / 100
                    ];
                }

                self.data.points = points.map(function (p) {
                    return parseFloat(p);
                });
            }

            if (self.options.useCanvas) {
                self.elements.img.exifdata = null;
                _transferImageToCanvas.call(self, options.orientation || 1);
            }
            _updatePropertiesFromImage.call(self);
            _triggerUpdate.call(self);
            cb && cb();
        });
    }

    function fix(v, decimalPoints) {
        return parseFloat(v).toFixed(decimalPoints || 0);
    }

    function _get() {
        var self = this,
            imgData = self.elements.preview.getBoundingClientRect(),
            vpData = self.elements.viewport.getBoundingClientRect(),
            x1 = vpData.left - imgData.left,
            y1 = vpData.top - imgData.top,
            widthDiff = (vpData.width - self.elements.viewport.offsetWidth) / 2,
            heightDiff = (vpData.height - self.elements.viewport.offsetHeight) / 2,
            x2 = x1 + self.elements.viewport.offsetWidth + widthDiff,
            y2 = y1 + self.elements.viewport.offsetHeight + heightDiff,
            scale = self._currentZoom;

        if (scale === Infinity || isNaN(scale)) {
            scale = 1;
        }

        var max = self.options.enforceBoundary ? 0 : Number.NEGATIVE_INFINITY;
        x1 = Math.max(max, x1 / scale);
        y1 = Math.max(max, y1 / scale);
        x2 = Math.max(max, x2 / scale);
        y2 = Math.max(max, y2 / scale);

        return {
            points: [fix(x1), fix(y1), fix(x2), fix(y2)],
            zoom: scale
        };
    }

    var RESULT_DEFAULTS = {
            type: 'canvas',
            format: 'png',
            quality: 1
        },
        RESULT_FORMATS = ['jpeg', 'webp', 'png'];

    function _result(options) {
        var self = this,
            data = _get.call(self),
            opts = deepExtend(RESULT_DEFAULTS, deepExtend({}, options)),
            resultType = (typeof (options) === 'string' ? options : (opts.type || 'base64')),
            size = opts.size,
            format = opts.format,
            quality = opts.quality,
            backgroundColor = opts.backgroundColor,
            circle = typeof opts.circle === 'boolean' ? opts.circle : (self.options.viewport.type === 'circle'),
            vpRect = self.elements.viewport.getBoundingClientRect(),
            ratio = vpRect.width / vpRect.height,
            prom;

        if (size === 'viewport') {
            data.outputWidth = vpRect.width;
            data.outputHeight = vpRect.height;
        } else if (typeof size === 'object') {
            if (size.width && size.height) {
                data.outputWidth = size.width;
                data.outputHeight = size.height;
            } else if (size.width) {
                data.outputWidth = size.width;
                data.outputHeight = size.width / ratio;
            } else if (size.height) {
                data.outputWidth = size.height * ratio;
                data.outputHeight = size.height;
            }
        }

        if (RESULT_FORMATS.indexOf(format) > -1) {
            data.format = 'image/' + format;
            data.quality = quality;
        }

        data.circle = circle;
        data.url = self.data.url;
        data.backgroundColor = backgroundColor;

        prom = new Promise(function (resolve, reject) {
            switch(resultType.toLowerCase())
            {
                case 'rawcanvas':
                    resolve(_getCanvas.call(self, data));
                    break;
                case 'canvas':
                case 'base64':
                    resolve(_getBase64Result.call(self, data));
                    break;
                case 'blob':
                    _getBlobResult.call(self, data).then(resolve);
                    break;
                default:
                    resolve(_getHtmlResult.call(self, data));
                    break;
            }
        });
        return prom;
    }

    function _refresh() {
        _updatePropertiesFromImage.call(this);
    }

    function _rotate(deg) {
        if (!this.options.useCanvas) {
            throw 'Croppie: Cannot rotate without enableOrientation';
        }

        var self = this,
            canvas = self.elements.canvas,
            img = self.elements.img,
            copy = document.createElement('canvas'),
            ornt = 1;

        copy.width = canvas.width;
        copy.height = canvas.height;
        var ctx = copy.getContext('2d');
        ctx.drawImage(canvas, 0, 0);

        if (deg === 90 || deg === -270) ornt = 6;
        if (deg === -90 || deg === 270) ornt = 8;
        if (deg === 180 || deg === -180) ornt = 3;

        drawCanvas(canvas, copy, ornt);
        _onZoom.call(self);
    }

    function _destroy() {
        var self = this;
        self.element.removeChild(self.elements.boundary);
        removeClass(self.element, 'croppie-container');
        if (self.options.enableZoom) {
            self.element.removeChild(self.elements.zoomerWrap);
        }
        delete self.elements;
    }

    if (window.jQuery) {
        var $ = window.jQuery;
        $.fn.croppie = function (opts) {
            var ot = typeof opts;

            if (ot === 'string') {
                var args = Array.prototype.slice.call(arguments, 1);
                var singleInst = $(this).data('croppie');

                if (opts === 'get') {
                    return singleInst.get();
                }
                else if (opts === 'result') {
                    return singleInst.result.apply(singleInst, args);
                }
                else if (opts === 'bind') {
                    return singleInst.bind.apply(singleInst, args);
                }

                return this.each(function () {
                    var i = $(this).data('croppie');
                    if (!i) return;

                    var method = i[opts];
                    if ($.isFunction(method)) {
                        method.apply(i, args);
                        if (opts === 'destroy') {
                            $(this).removeData('croppie');
                        }
                    }
                    else {
                        throw 'Croppie ' + opts + ' method not found';
                    }
                });
            }
            else {
                return this.each(function () {
                    var i = new Croppie(this, opts);
                    i.$ = $;
                    $(this).data('croppie', i);
                });
            }
        };
    }

    function Croppie(element, opts) {
        this.element = element;
        this.options = deepExtend(deepExtend({}, Croppie.defaults), opts);

        if (this.element.tagName.toLowerCase() === 'img') {
            var origImage = this.element;
            addClass(origImage, 'cr-original-image');
            var replacementDiv = document.createElement('div');
            this.element.parentNode.appendChild(replacementDiv);
            replacementDiv.appendChild(origImage);
            this.element = replacementDiv;
            this.options.url = this.options.url || origImage.src;
        }

        _create.call(this);
        if (this.options.url) {
            var bindOpts = {
                url: this.options.url,
                points: this.options.points
            };
            delete this.options['url'];
            delete this.options['points'];
            _bind.call(this, bindOpts);
        }
    }

    Croppie.defaults = {
        viewport: {
            width: 100,
            height: 100,
            type: 'square'
        },
        boundary: { },
        orientationControls: {
            enabled: true,
            leftClass: '',
            rightClass: ''
        },
        customClass: '',
        showZoomer: true,
        enableZoom: true,
        mouseWheelZoom: true,
        enableExif: false,
        enforceBoundary: true,
        enableOrientation: false,
        update: function () { }
    };

    Croppie.globals = {
        translate: 'translate3d'
    };

    deepExtend(Croppie.prototype, {
        bind: function (options, cb) {
            return _bind.call(this, options, cb);
        },
        get: function () {
            var data = _get.call(this);
            var points = data.points;
            if (this.options.relative) {
                //
                // Relativize points
                //
                points[0] /= this.elements.img.naturalWidth / 100;
                points[1] /= this.elements.img.naturalHeight / 100;
                points[2] /= this.elements.img.naturalWidth / 100;
                points[3] /= this.elements.img.naturalHeight / 100;
            }
            return data;
        },
        result: function (type) {
            return _result.call(this, type);
        },
        refresh: function () {
            return _refresh.call(this);
        },
        setZoom: function (v) {
            _setZoomerVal.call(this, v);
            dispatchChange(this.elements.zoomer);
        },
        rotate: function (deg) {
            _rotate.call(this, deg);
        },
        destroy: function () {
            return _destroy.call(this);
        }
    });

    exports.Croppie = window.Croppie = Croppie;

    if (typeof module === 'object' && !!module.exports) {
        module.exports = Croppie;
    }
}));

"use strict";!function(n){n.fn.circliful=function(t,i){var r=n.extend({foregroundColor:"#3498DB",backgroundColor:"#ccc",pointColor:"none",fillColor:"none",foregroundBorderWidth:15,backgroundBorderWidth:15,pointSize:28.5,fontColor:"#aaa",percent:75,animation:1,animationStep:5,icon:"none",iconSize:"30",iconColor:"#ccc",iconPosition:"top",target:0,start:0,showPercent:1,percentageTextSize:22,textAdditionalCss:"",targetPercent:0,targetTextSize:17,targetColor:"#2980B9",text:null,textStyle:null,textColor:"#666",multiPercentage:0,percentages:null,textBelow:!1,noPercentageSign:!1,replacePercentageByText:null,halfCircle:!1,animateInView:!1,decimals:0,alwaysDecimals:!1,title:"Circle Chart",description:""},t);return this.each(function(){function d(){var n=window.setInterval(function(){c>=k?(window.clearInterval(n),y=1,"function"==typeof i&&i.call(this)):(c+=et,p+=tt);c/3.6>=u&&1==y&&(c=3.6*u);p>r.target&&1==y&&(p=r.target);null==r.replacePercentageByText&&(h=r.halfCircle?parseFloat(100*c/180):parseFloat(100*c/360),h=h.toFixed(r.decimals),!r.alwaysDecimals&&(0==u||u>1&&1!=y)&&(h=parseInt(h)));s.attr("stroke-dasharray",c+", 20000");1==r.showPercent?l.find(".number").text(h):(l.find(".number").text(p),l.find(".percent").text(""))}.bind(s),ft)}function it(){var r=navigator.userAgent.toLowerCase().indexOf("webkit")!=-1?"body":"html",t=n(r).scrollTop(),u=t+n(window).height(),i=Math.round(s.offset().top),f=i+s.height();return i<u&&f>t}function rt(){s.hasClass("start")||it(s)&&(s.addClass("start"),setTimeout(d,250))}function ut(t,i){n.each(t,function(n){n.toLowerCase()in i&&(t[n]=i[n.toLowerCase()])})}var a=n(this),nt;ut(r,a.data());var g,t,w,u=r.percent,f=83,v=100,e=100,o=100,b=r.backgroundBorderWidth;(r.halfCircle?"left"==r.iconPosition?(v=80,f=100,o=117,e=100):r.halfCircle&&(f=80,e=100):"bottom"==r.iconPosition?(f=124,e=95):"left"==r.iconPosition?(v=80,f=110,o=117):"middle"==r.iconPosition?1==r.multiPercentage?"object"==typeof r.percentages?b=30:(f=110,t='<g stroke="'+("none"!=r.backgroundColor?r.backgroundColor:"#ccc")+'" ><line x1="133" y1="50" x2="140" y2="40" stroke-width="2"  /><\/g>',t+='<g stroke="'+("none"!=r.backgroundColor?r.backgroundColor:"#ccc")+'" ><line x1="140" y1="40" x2="200" y2="40" stroke-width="2"  /><\/g>',o=228,e=47):(f=110,t='<g stroke="'+("none"!=r.backgroundColor?r.backgroundColor:"#ccc")+'" ><line x1="133" y1="50" x2="140" y2="40" stroke-width="2"  /><\/g>',t+='<g stroke="'+("none"!=r.backgroundColor?r.backgroundColor:"#ccc")+'" ><line x1="140" y1="40" x2="200" y2="40" stroke-width="2"  /><\/g>',o=170,e=35):"right"==r.iconPosition&&(v=120,f=110,o=80),r.targetPercent>0&&(e=95,t='<g stroke="'+("none"!=r.backgroundColor?r.backgroundColor:"#ccc")+'" ><line x1="75" y1="101" x2="125" y2="101" stroke-width="1"  /><\/g>',t+='<text text-anchor="middle" x="'+o+'" y="120" style="font-size: '+r.targetTextSize+'px;" fill="'+r.targetColor+'">'+r.targetPercent+(r.noPercentageSign&&null==r.replacePercentageByText?"":"%")+"<\/text>",t+='<circle cx="100" cy="100" r="69" fill="none" stroke="'+r.backgroundColor+'" stroke-width="3" stroke-dasharray="450" transform="rotate(-90,100,100)" />',t+='<circle cx="100" cy="100" r="69" fill="none" stroke="'+r.targetColor+'" stroke-width="3" stroke-dasharray="'+3.6*r.targetPercent+', 20000" transform="rotate(-90,100,100)" />'),null!=r.text&&(r.halfCircle?r.textBelow?t+='<text text-anchor="middle" x="100" y="120" style="'+r.textStyle+'" fill="'+r.textColor+'">'+r.text+"<\/text>":0==r.multiPercentage?t+='<text text-anchor="middle" x="100" y="115" style="'+r.textStyle+'" fill="'+r.textColor+'">'+r.text+"<\/text>":1==r.multiPercentage&&(t+='<text text-anchor="middle" x="228" y="65" style="'+r.textStyle+'" fill="'+r.textColor+'">'+r.text+"<\/text>"):r.textBelow?t+='<text text-anchor="middle" x="100" y="190" style="'+r.textStyle+'" fill="'+r.textColor+'">'+r.text+"<\/text>":0==r.multiPercentage?t+='<text text-anchor="middle" x="100" y="115" style="'+r.textStyle+'" fill="'+r.textColor+'">'+r.text+"<\/text>":1==r.multiPercentage&&(t+='<text text-anchor="middle" x="228" y="65" style="'+r.textStyle+'" fill="'+r.textColor+'">'+r.text+"<\/text>")),"none"!=r.icon&&(w='<text text-anchor="middle" x="'+v+'" y="'+f+'" class="icon" style="font-size: '+r.iconSize+'px" fill="'+r.iconColor+'">&#x'+r.icon+"<\/text>"),r.halfCircle)?(nt='transform="rotate(-180,100,100)"',a.addClass("svg-container").append(n('<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 194 186" class="circliful" role="img" aria-labelledby="title  desc"><title id="title">'+r.title+'<\/title><desc id="desc">'+r.description+"<\/desc>"+t+'<clipPath id="cut-off-bottom"> <rect x="100" y="0" width="100" height="200" /> <\/clipPath><circle cx="100" cy="100" r="57" class="border" fill="'+r.fillColor+'" stroke="'+r.backgroundColor+'" stroke-width="'+b+'" stroke-dasharray="360" clip-path="url(#cut-off-bottom)" transform="rotate(-90,100,100)" /><circle class="circle" cx="100" cy="100" r="57" class="border" fill="none" stroke="'+r.foregroundColor+'" stroke-width="'+r.foregroundBorderWidth+'" stroke-dasharray="0,20000" '+nt+' /><circle cx="100" cy="100" r="'+r.pointSize+'" fill="'+r.pointColor+'" clip-path="url(#cut-off-bottom)" transform="rotate(-90,100,100)" />'+w+'<text class="timer" text-anchor="middle" x="'+o+'" y="'+e+'" style="font-size: '+r.percentageTextSize+"px; "+g+";"+r.textAdditionalCss+'" fill="'+r.fontColor+'"><tspan class="number">'+(null==r.replacePercentageByText?0:r.replacePercentageByText)+'<\/tspan><tspan class="percent">'+(r.noPercentageSign||null!=r.replacePercentageByText?"":"%")+"<\/tspan><\/text>"))):a.addClass("svg-container").append(n('<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 194 186" class="circliful" role="img" aria-labelledby="title  desc"><title id="title">'+r.title+'<\/title><desc id="desc">'+r.description+"<\/desc>"+t+'<circle cx="100" cy="100" r="57" class="border" fill="'+r.fillColor+'" stroke="'+r.backgroundColor+'" stroke-width="'+b+'" stroke-dasharray="360" transform="rotate(-90,100,100)" /><circle class="circle" cx="100" cy="100" r="57" class="border" fill="none" stroke="'+r.foregroundColor+'" stroke-width="'+r.foregroundBorderWidth+'" stroke-dasharray="0,20000" transform="rotate(-90,100,100)" /><circle cx="100" cy="100" r="'+r.pointSize+'" fill="'+r.pointColor+'" />'+w+'<text class="timer" text-anchor="middle" x="'+o+'" y="'+e+'" style="font-size: '+r.percentageTextSize+"px; "+g+";"+r.textAdditionalCss+'" fill="'+r.fontColor+'"><tspan class="number">'+(null==r.replacePercentageByText?0:r.replacePercentageByText)+'<\/tspan><tspan class="percent">'+(r.noPercentageSign||null!=r.replacePercentageByText?"":"%")+"<\/tspan><\/text>"));var s=a.find(".circle"),l=a.find(".timer"),ft=30,c=0,et=r.animationStep,y=0,p=0,tt=0,h=u,k=3.6*u;r.halfCircle&&(k=3.6*u/2);null!=r.replacePercentageByText&&(h=r.replacePercentageByText);r.start>0&&r.target>0&&(u=r.start/(r.target/100),tt=r.target/100);1==r.animation?r.animateInView?n(window).scroll(function(){rt()}):d():(s.attr("stroke-dasharray",k+", 20000"),1==r.showPercent?l.find(".number").text(h):(l.find(".number").text(r.target),l.find(".percent").text("")))})}}(jQuery)
var SlideEffect=function(){this.body_=$("body");this.page_=this.body_.find("#page");this.coverContainer_=this.page_.find(".cover-container");this.coverOverlay_=this.coverContainer_.find(".cover-overlay");this.contentContainerInner_=this.page_.find(".content-container__inner");this.contentAreas_=this.contentContainerInner_.find(".extra, .main");this.init_()};SlideEffect.CLASS_CHANGING="changing";SlideEffect.CLASS_CHANGED="changed";SlideEffect.prototype.init_=function(){this.attachEvents_()};SlideEffect.prototype.attachEvents_=function(){var n=this;n.page_.on("click","a",function(){var t=$(this),i,r;t.has("[target]")&&t.attr("target")=="_blank"||(i=t.attr("href"),r=/^\/.*$/i,i&&null==r.exec(i))||n.start()});$(window).bind("pageshow",function(t){t.originalEvent.persisted&&n.end()})};SlideEffect.prototype.start=function(n,t){var i=this;(i.body_.hasClass("level_1")||i.body_.hasClass("level_2")||i.body_.hasClass("level_3"))&&i.start_(n,t)};SlideEffect.prototype.startLevel3=function(n){var t=this;t.start_(n,"level_3")};SlideEffect.prototype.startLevel2=function(n){var t=this;t.start_(n,"level_2")};SlideEffect.prototype.end=function(){this.end_()};SlideEffect.prototype.start_=function(n,t){var i=this;i.coverContainer_.removeClass(SlideEffect.CLASS_CHANGED).addClass(SlideEffect.CLASS_CHANGING);i.contentContainerInner_.fadeTo(400,0,function(){null!=t&&(i.contentAreas_.hide(),i.body_.has("[class]")&&i.body_.attr("slide-effect-class",i.body_.attr("class")),i.body_.removeClass().addClass(t),i.page_.has("[class]")&&i.page_.attr("slide-effect-class",i.page_.attr("class")),i.page_.removeClass().addClass("page "+n));i.body_.trigger("layout_changed")})};SlideEffect.prototype.end_=function(){var n=this;n.body_.attr("slide-effect-class")&&n.body_.removeClass().addClass(n.body_.attr("slide-effect-class"));n.page_.attr("slide-effect-class")&&n.page_.removeClass().addClass(n.page_.attr("slide-effect-class"));this.contentContainerInner_.fadeTo(400,1,function(){n.coverContainer_.removeClass(SlideEffect.CLASS_CHANGING).addClass(SlideEffect.CLASS_CHANGED);n.contentAreas_.show()}.bind(this))},function(){(new SlideEffect).end()}(jQuery)
/*!
 * Vue.js v2.5.2
 * (c) 2014-2017 Evan You
 * Released under the MIT License.
 */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Vue=t()}(this,function(){"use strict";function e(e){return void 0===e||null===e}function t(e){return void 0!==e&&null!==e}function n(e){return!0===e}function r(e){return!1===e}function i(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e}function o(e){return null!==e&&"object"==typeof e}function a(e){return"[object Object]"===Ai.call(e)}function s(e){return"[object RegExp]"===Ai.call(e)}function c(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function u(e){return null==e?"":"object"==typeof e?JSON.stringify(e,null,2):String(e)}function l(e){var t=parseFloat(e);return isNaN(t)?e:t}function f(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i<r.length;i++)n[r[i]]=!0;return t?function(e){return n[e.toLowerCase()]}:function(e){return n[e]}}function d(e,t){if(e.length){var n=e.indexOf(t);if(n>-1)return e.splice(n,1)}}function p(e,t){return Ti.call(e,t)}function v(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}function h(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n}function m(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function y(e,t){for(var n in t)e[n]=t[n];return e}function g(e){for(var t={},n=0;n<e.length;n++)e[n]&&y(t,e[n]);return t}function _(e,t,n){}function b(e,t){if(e===t)return!0;var n=o(e),r=o(t);if(!n||!r)return!n&&!r&&String(e)===String(t);try{var i=Array.isArray(e),a=Array.isArray(t);if(i&&a)return e.length===t.length&&e.every(function(e,n){return b(e,t[n])});if(i||a)return!1;var s=Object.keys(e),c=Object.keys(t);return s.length===c.length&&s.every(function(n){return b(e[n],t[n])})}catch(e){return!1}}function $(e,t){for(var n=0;n<e.length;n++)if(b(e[n],t))return n;return-1}function C(e){var t=!1;return function(){t||(t=!0,e.apply(this,arguments))}}function w(e){var t=(e+"").charCodeAt(0);return 36===t||95===t}function x(e,t,n,r){Object.defineProperty(e,t,{value:n,enumerable:!!r,writable:!0,configurable:!0})}function k(e){if(!Ui.test(e)){var t=e.split(".");return function(e){for(var n=0;n<t.length;n++){if(!e)return;e=e[t[n]]}return e}}}function A(e){return"function"==typeof e&&/native code/.test(e.toString())}function O(e){so.target&&co.push(so.target),so.target=e}function S(){so.target=co.pop()}function T(e){return new uo(void 0,void 0,void 0,String(e))}function E(e,t){var n=new uo(e.tag,e.data,e.children,e.text,e.elm,e.context,e.componentOptions,e.asyncFactory);return n.ns=e.ns,n.isStatic=e.isStatic,n.key=e.key,n.isComment=e.isComment,n.isCloned=!0,t&&e.children&&(n.children=j(e.children)),n}function j(e,t){for(var n=e.length,r=new Array(n),i=0;i<n;i++)r[i]=E(e[i],t);return r}function L(e,t,n){e.__proto__=t}function N(e,t,n){for(var r=0,i=n.length;r<i;r++){var o=n[r];x(e,o,t[o])}}function I(e,t){if(o(e)&&!(e instanceof uo)){var n;return p(e,"__ob__")&&e.__ob__ instanceof yo?n=e.__ob__:mo.shouldConvert&&!no()&&(Array.isArray(e)||a(e))&&Object.isExtensible(e)&&!e._isVue&&(n=new yo(e)),t&&n&&n.vmCount++,n}}function M(e,t,n,r,i){var o=new so,a=Object.getOwnPropertyDescriptor(e,t);if(!a||!1!==a.configurable){var s=a&&a.get,c=a&&a.set,u=!i&&I(n);Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var t=s?s.call(e):n;return so.target&&(o.depend(),u&&(u.dep.depend(),Array.isArray(t)&&R(t))),t},set:function(t){var r=s?s.call(e):n;t===r||t!==t&&r!==r||(c?c.call(e,t):n=t,u=!i&&I(t),o.notify())}})}}function P(e,t,n){if(Array.isArray(e)&&c(t))return e.length=Math.max(e.length,t),e.splice(t,1,n),n;if(p(e,t))return e[t]=n,n;var r=e.__ob__;return e._isVue||r&&r.vmCount?n:r?(M(r.value,t,n),r.dep.notify(),n):(e[t]=n,n)}function D(e,t){if(Array.isArray(e)&&c(t))e.splice(t,1);else{var n=e.__ob__;e._isVue||n&&n.vmCount||p(e,t)&&(delete e[t],n&&n.dep.notify())}}function R(e){for(var t=void 0,n=0,r=e.length;n<r;n++)(t=e[n])&&t.__ob__&&t.__ob__.dep.depend(),Array.isArray(t)&&R(t)}function F(e,t){if(!t)return e;for(var n,r,i,o=Object.keys(t),s=0;s<o.length;s++)r=e[n=o[s]],i=t[n],p(e,n)?a(r)&&a(i)&&F(r,i):P(e,n,i);return e}function H(e,t,n){return n?e||t?function(){var r="function"==typeof t?t.call(n):t,i="function"==typeof e?e.call(n):e;return r?F(r,i):i}:void 0:t?e?function(){return F("function"==typeof t?t.call(this):t,"function"==typeof e?e.call(this):e)}:t:e}function B(e,t){return t?e?e.concat(t):Array.isArray(t)?t:[t]:e}function U(e,t,n,r){var i=Object.create(e||null);return t?y(i,t):i}function V(e,t){var n=e.props;if(n){var r,i,o={};if(Array.isArray(n))for(r=n.length;r--;)"string"==typeof(i=n[r])&&(o[ji(i)]={type:null});else if(a(n))for(var s in n)i=n[s],o[ji(s)]=a(i)?i:{type:i};e.props=o}}function z(e,t){var n=e.inject,r=e.inject={};if(Array.isArray(n))for(var i=0;i<n.length;i++)r[n[i]]={from:n[i]};else if(a(n))for(var o in n){var s=n[o];r[o]=a(s)?y({from:o},s):{from:s}}}function K(e){var t=e.directives;if(t)for(var n in t){var r=t[n];"function"==typeof r&&(t[n]={bind:r,update:r})}}function J(e,t,n){function r(r){var i=go[r]||$o;c[r]=i(e[r],t[r],n,r)}"function"==typeof t&&(t=t.options),V(t,n),z(t,n),K(t);var i=t.extends;if(i&&(e=J(e,i,n)),t.mixins)for(var o=0,a=t.mixins.length;o<a;o++)e=J(e,t.mixins[o],n);var s,c={};for(s in e)r(s);for(s in t)p(e,s)||r(s);return c}function q(e,t,n,r){if("string"==typeof n){var i=e[t];if(p(i,n))return i[n];var o=ji(n);if(p(i,o))return i[o];var a=Li(o);if(p(i,a))return i[a];var s=i[n]||i[o]||i[a];return s}}function W(e,t,n,r){var i=t[e],o=!p(n,e),a=n[e];if(Y(Boolean,i.type)&&(o&&!p(i,"default")?a=!1:Y(String,i.type)||""!==a&&a!==Ii(e)||(a=!0)),void 0===a){a=G(r,i,e);var s=mo.shouldConvert;mo.shouldConvert=!0,I(a),mo.shouldConvert=s}return a}function G(e,t,n){if(p(t,"default")){var r=t.default;return e&&e.$options.propsData&&void 0===e.$options.propsData[n]&&void 0!==e._props[n]?e._props[n]:"function"==typeof r&&"Function"!==Z(t.type)?r.call(e):r}}function Z(e){var t=e&&e.toString().match(/^\s*function (\w+)/);return t?t[1]:""}function Y(e,t){if(!Array.isArray(t))return Z(t)===Z(e);for(var n=0,r=t.length;n<r;n++)if(Z(t[n])===Z(e))return!0;return!1}function Q(e,t,n){if(t)for(var r=t;r=r.$parent;){var i=r.$options.errorCaptured;if(i)for(var o=0;o<i.length;o++)try{if(!1===i[o].call(r,e,t,n))return}catch(e){X(e,r,"errorCaptured hook")}}X(e,t,n)}function X(e,t,n){if(Hi.errorHandler)try{return Hi.errorHandler.call(null,e,t,n)}catch(e){ee(e,null,"config.errorHandler")}ee(e,t,n)}function ee(e,t,n){if(!zi||"undefined"==typeof console)throw e;console.error(e)}function te(){wo=!1;var e=Co.slice(0);Co.length=0;for(var t=0;t<e.length;t++)e[t]()}function ne(e){return e._withTask||(e._withTask=function(){xo=!0;var t=e.apply(null,arguments);return xo=!1,t})}function re(e,t){var n;if(Co.push(function(){if(e)try{e.call(t)}catch(e){Q(e,t,"nextTick")}else n&&n(t)}),wo||(wo=!0,xo?bo():_o()),!e&&"undefined"!=typeof Promise)return new Promise(function(e){n=e})}function ie(e){function t(){var e=arguments,n=t.fns;if(!Array.isArray(n))return n.apply(null,arguments);for(var r=n.slice(),i=0;i<r.length;i++)r[i].apply(null,e)}return t.fns=e,t}function oe(t,n,r,i,o){var a,s,c,u;for(a in t)s=t[a],c=n[a],u=To(a),e(s)||(e(c)?(e(s.fns)&&(s=t[a]=ie(s)),r(u.name,s,u.once,u.capture,u.passive)):s!==c&&(c.fns=s,t[a]=c));for(a in n)e(t[a])&&i((u=To(a)).name,n[a],u.capture)}function ae(r,i,o){function a(){o.apply(this,arguments),d(s.fns,a)}var s,c=r[i];e(c)?s=ie([a]):t(c.fns)&&n(c.merged)?(s=c).fns.push(a):s=ie([c,a]),s.merged=!0,r[i]=s}function se(n,r,i){var o=r.options.props;if(!e(o)){var a={},s=n.attrs,c=n.props;if(t(s)||t(c))for(var u in o){var l=Ii(u);ce(a,c,u,l,!0)||ce(a,s,u,l,!1)}return a}}function ce(e,n,r,i,o){if(t(n)){if(p(n,r))return e[r]=n[r],o||delete n[r],!0;if(p(n,i))return e[r]=n[i],o||delete n[i],!0}return!1}function ue(e){for(var t=0;t<e.length;t++)if(Array.isArray(e[t]))return Array.prototype.concat.apply([],e);return e}function le(e){return i(e)?[T(e)]:Array.isArray(e)?de(e):void 0}function fe(e){return t(e)&&t(e.text)&&r(e.isComment)}function de(r,o){var a,s,c,u,l=[];for(a=0;a<r.length;a++)e(s=r[a])||"boolean"==typeof s||(u=l[c=l.length-1],Array.isArray(s)?s.length>0&&(fe((s=de(s,(o||"")+"_"+a))[0])&&fe(u)&&(l[c]=T(u.text+s[0].text),s.shift()),l.push.apply(l,s)):i(s)?fe(u)?l[c]=T(u.text+s):""!==s&&l.push(T(s)):fe(s)&&fe(u)?l[c]=T(u.text+s.text):(n(r._isVList)&&t(s.tag)&&e(s.key)&&t(o)&&(s.key="__vlist"+o+"_"+a+"__"),l.push(s)));return l}function pe(e,t){return(e.__esModule||io&&"Module"===e[Symbol.toStringTag])&&(e=e.default),o(e)?t.extend(e):e}function ve(e,t,n,r,i){var o=fo();return o.asyncFactory=e,o.asyncMeta={data:t,context:n,children:r,tag:i},o}function he(r,i,a){if(n(r.error)&&t(r.errorComp))return r.errorComp;if(t(r.resolved))return r.resolved;if(n(r.loading)&&t(r.loadingComp))return r.loadingComp;if(!t(r.contexts)){var s=r.contexts=[a],c=!0,u=function(){for(var e=0,t=s.length;e<t;e++)s[e].$forceUpdate()},l=C(function(e){r.resolved=pe(e,i),c||u()}),f=C(function(e){t(r.errorComp)&&(r.error=!0,u())}),d=r(l,f);return o(d)&&("function"==typeof d.then?e(r.resolved)&&d.then(l,f):t(d.component)&&"function"==typeof d.component.then&&(d.component.then(l,f),t(d.error)&&(r.errorComp=pe(d.error,i)),t(d.loading)&&(r.loadingComp=pe(d.loading,i),0===d.delay?r.loading=!0:setTimeout(function(){e(r.resolved)&&e(r.error)&&(r.loading=!0,u())},d.delay||200)),t(d.timeout)&&setTimeout(function(){e(r.resolved)&&f(null)},d.timeout))),c=!1,r.loading?r.loadingComp:r.resolved}r.contexts.push(a)}function me(e){return e.isComment&&e.asyncFactory}function ye(e){if(Array.isArray(e))for(var n=0;n<e.length;n++){var r=e[n];if(t(r)&&(t(r.componentOptions)||me(r)))return r}}function ge(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&$e(e,t)}function _e(e,t,n){n?So.$once(e,t):So.$on(e,t)}function be(e,t){So.$off(e,t)}function $e(e,t,n){So=e,oe(t,n||{},_e,be,e)}function Ce(e,t){var n={};if(!e)return n;for(var r=[],i=0,o=e.length;i<o;i++){var a=e[i],s=a.data;if(s&&s.attrs&&s.attrs.slot&&delete s.attrs.slot,a.context!==t&&a.functionalContext!==t||!s||null==s.slot)r.push(a);else{var c=a.data.slot,u=n[c]||(n[c]=[]);"template"===a.tag?u.push.apply(u,a.children):u.push(a)}}return r.every(we)||(n.default=r),n}function we(e){return e.isComment||" "===e.text}function xe(e,t){t=t||{};for(var n=0;n<e.length;n++)Array.isArray(e[n])?xe(e[n],t):t[e[n].key]=e[n].fn;return t}function ke(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}function Ae(e,t,n){e.$el=t,e.$options.render||(e.$options.render=fo),je(e,"beforeMount");var r;return r=function(){e._update(e._render(),n)},e._watcher=new Ro(e,r,_),n=!1,null==e.$vnode&&(e._isMounted=!0,je(e,"mounted")),e}function Oe(e,t,n,r,i){var o=!!(i||e.$options._renderChildren||r.data.scopedSlots||e.$scopedSlots!==Bi);if(e.$options._parentVnode=r,e.$vnode=r,e._vnode&&(e._vnode.parent=r),e.$options._renderChildren=i,e.$attrs=r.data&&r.data.attrs||Bi,e.$listeners=n||Bi,t&&e.$options.props){mo.shouldConvert=!1;for(var a=e._props,s=e.$options._propKeys||[],c=0;c<s.length;c++){var u=s[c];a[u]=W(u,e.$options.props,t,e)}mo.shouldConvert=!0,e.$options.propsData=t}if(n){var l=e.$options._parentListeners;e.$options._parentListeners=n,$e(e,n,l)}o&&(e.$slots=Ce(i,r.context),e.$forceUpdate())}function Se(e){for(;e&&(e=e.$parent);)if(e._inactive)return!0;return!1}function Te(e,t){if(t){if(e._directInactive=!1,Se(e))return}else if(e._directInactive)return;if(e._inactive||null===e._inactive){e._inactive=!1;for(var n=0;n<e.$children.length;n++)Te(e.$children[n]);je(e,"activated")}}function Ee(e,t){if(!(t&&(e._directInactive=!0,Se(e))||e._inactive)){e._inactive=!0;for(var n=0;n<e.$children.length;n++)Ee(e.$children[n]);je(e,"deactivated")}}function je(e,t){var n=e.$options[t];if(n)for(var r=0,i=n.length;r<i;r++)try{n[r].call(e)}catch(n){Q(n,e,t+" hook")}e._hasHookEvent&&e.$emit("hook:"+t)}function Le(){Po=jo.length=Lo.length=0,No={},Io=Mo=!1}function Ne(){Mo=!0;var e,t;for(jo.sort(function(e,t){return e.id-t.id}),Po=0;Po<jo.length;Po++)t=(e=jo[Po]).id,No[t]=null,e.run();var n=Lo.slice(),r=jo.slice();Le(),Pe(n),Ie(r),ro&&Hi.devtools&&ro.emit("flush")}function Ie(e){for(var t=e.length;t--;){var n=e[t],r=n.vm;r._watcher===n&&r._isMounted&&je(r,"updated")}}function Me(e){e._inactive=!1,Lo.push(e)}function Pe(e){for(var t=0;t<e.length;t++)e[t]._inactive=!0,Te(e[t],!0)}function De(e){var t=e.id;if(null==No[t]){if(No[t]=!0,Mo){for(var n=jo.length-1;n>Po&&jo[n].id>e.id;)n--;jo.splice(n+1,0,e)}else jo.push(e);Io||(Io=!0,re(Ne))}}function Re(e){Fo.clear(),Fe(e,Fo)}function Fe(e,t){var n,r,i=Array.isArray(e);if((i||o(e))&&Object.isExtensible(e)){if(e.__ob__){var a=e.__ob__.dep.id;if(t.has(a))return;t.add(a)}if(i)for(n=e.length;n--;)Fe(e[n],t);else for(n=(r=Object.keys(e)).length;n--;)Fe(e[r[n]],t)}}function He(e,t,n){Ho.get=function(){return this[t][n]},Ho.set=function(e){this[t][n]=e},Object.defineProperty(e,n,Ho)}function Be(e){e._watchers=[];var t=e.$options;t.props&&Ue(e,t.props),t.methods&&We(e,t.methods),t.data?Ve(e):I(e._data={},!0),t.computed&&Ke(e,t.computed),t.watch&&t.watch!==Yi&&Ge(e,t.watch)}function Ue(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[],o=!e.$parent;mo.shouldConvert=o;for(var a in t)!function(o){i.push(o);var a=W(o,t,n,e);M(r,o,a),o in e||He(e,"_props",o)}(a);mo.shouldConvert=!0}function Ve(e){var t=e.$options.data;a(t=e._data="function"==typeof t?ze(t,e):t||{})||(t={});for(var n=Object.keys(t),r=e.$options.props,i=n.length;i--;){var o=n[i];r&&p(r,o)||w(o)||He(e,"_data",o)}I(t,!0)}function ze(e,t){try{return e.call(t,t)}catch(e){return Q(e,t,"data()"),{}}}function Ke(e,t){var n=e._computedWatchers=Object.create(null),r=no();for(var i in t){var o=t[i],a="function"==typeof o?o:o.get;r||(n[i]=new Ro(e,a||_,_,Bo)),i in e||Je(e,i,o)}}function Je(e,t,n){var r=!no();"function"==typeof n?(Ho.get=r?qe(t):n,Ho.set=_):(Ho.get=n.get?r&&!1!==n.cache?qe(t):n.get:_,Ho.set=n.set?n.set:_),Object.defineProperty(e,t,Ho)}function qe(e){return function(){var t=this._computedWatchers&&this._computedWatchers[e];if(t)return t.dirty&&t.evaluate(),so.target&&t.depend(),t.value}}function We(e,t){for(var n in t)e[n]=null==t[n]?_:h(t[n],e)}function Ge(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i<r.length;i++)Ze(e,n,r[i]);else Ze(e,n,r)}}function Ze(e,t,n,r){return a(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=e[n]),e.$watch(t,n,r)}function Ye(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}function Qe(e){var t=Xe(e.$options.inject,e);t&&(mo.shouldConvert=!1,Object.keys(t).forEach(function(n){M(e,n,t[n])}),mo.shouldConvert=!0)}function Xe(e,t){if(e){for(var n=Object.create(null),r=io?Reflect.ownKeys(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}):Object.keys(e),i=0;i<r.length;i++){for(var o=r[i],a=e[o].from,s=t;s;){if(s._provided&&a in s._provided){n[o]=s._provided[a];break}s=s.$parent}if(!s&&"default"in e[o]){var c=e[o].default;n[o]="function"==typeof c?c.call(t):c}}return n}}function et(e,n){var r,i,a,s,c;if(Array.isArray(e)||"string"==typeof e)for(r=new Array(e.length),i=0,a=e.length;i<a;i++)r[i]=n(e[i],i);else if("number"==typeof e)for(r=new Array(e),i=0;i<e;i++)r[i]=n(i+1,i);else if(o(e))for(s=Object.keys(e),r=new Array(s.length),i=0,a=s.length;i<a;i++)c=s[i],r[i]=n(e[c],c,i);return t(r)&&(r._isVList=!0),r}function tt(e,t,n,r){var i=this.$scopedSlots[e];if(i)return n=n||{},r&&(n=y(y({},r),n)),i(n)||t;var o=this.$slots[e];return o||t}function nt(e){return q(this.$options,"filters",e,!0)||Pi}function rt(e,t,n,r){var i=Hi.keyCodes[t]||n;return i?Array.isArray(i)?-1===i.indexOf(e):i!==e:r?Ii(r)!==t:void 0}function it(e,t,n,r,i){if(n)if(o(n)){Array.isArray(n)&&(n=g(n));var a;for(var s in n)!function(o){if("class"===o||"style"===o||Si(o))a=e;else{var s=e.attrs&&e.attrs.type;a=r||Hi.mustUseProp(t,s,o)?e.domProps||(e.domProps={}):e.attrs||(e.attrs={})}o in a||(a[o]=n[o],i&&((e.on||(e.on={}))["update:"+o]=function(e){n[o]=e}))}(s)}else;return e}function ot(e,t){var n=this.$options.staticRenderFns,r=n.cached||(n.cached=[]),i=r[e];return i&&!t?Array.isArray(i)?j(i):E(i):(i=r[e]=n[e].call(this._renderProxy,null,this),st(i,"__static__"+e,!1),i)}function at(e,t,n){return st(e,"__once__"+t+(n?"_"+n:""),!0),e}function st(e,t,n){if(Array.isArray(e))for(var r=0;r<e.length;r++)e[r]&&"string"!=typeof e[r]&&ct(e[r],t+"_"+r,n);else ct(e,t,n)}function ct(e,t,n){e.isStatic=!0,e.key=t,e.isOnce=n}function ut(e,t){if(t)if(a(t)){var n=e.on=e.on?y({},e.on):{};for(var r in t){var i=n[r],o=t[r];n[r]=i?[].concat(i,o):o}}else;return e}function lt(e){e._o=at,e._n=l,e._s=u,e._l=et,e._t=tt,e._q=b,e._i=$,e._m=ot,e._f=nt,e._k=rt,e._b=it,e._v=T,e._e=fo,e._u=xe,e._g=ut}function ft(e,t,r,i,o){var a=o.options;this.data=e,this.props=t,this.children=r,this.parent=i,this.listeners=e.on||Bi,this.injections=Xe(a.inject,i),this.slots=function(){return Ce(r,i)};var s=Object.create(i),c=n(a._compiled),u=!c;c&&(this.$options=a,this.$slots=this.slots(),this.$scopedSlots=e.scopedSlots||Bi),a._scopeId?this._c=function(e,t,n,r){var o=_t(s,e,t,n,r,u);return o&&(o.functionalScopeId=a._scopeId,o.functionalContext=i),o}:this._c=function(e,t,n,r){return _t(s,e,t,n,r,u)}}function dt(e,n,r,i,o){var a=e.options,s={},c=a.props;if(t(c))for(var u in c)s[u]=W(u,c,n||Bi);else t(r.attrs)&&pt(s,r.attrs),t(r.props)&&pt(s,r.props);var l=new ft(r,s,o,i,e),f=a.render.call(null,l._c,l);return f instanceof uo&&(f.functionalContext=i,f.functionalOptions=a,r.slot&&((f.data||(f.data={})).slot=r.slot)),f}function pt(e,t){for(var n in t)e[ji(n)]=t[n]}function vt(r,i,a,s,c){if(!e(r)){var u=a.$options._base;if(o(r)&&(r=u.extend(r)),"function"==typeof r){var l;if(e(r.cid)&&(l=r,void 0===(r=he(l,u,a))))return ve(l,i,a,s,c);i=i||{},xt(r),t(i.model)&&gt(r.options,i);var f=se(i,r,c);if(n(r.options.functional))return dt(r,f,i,a,s);var d=i.on;if(i.on=i.nativeOn,n(r.options.abstract)){var p=i.slot;i={},p&&(i.slot=p)}mt(i);var v=r.options.name||c;return new uo("vue-component-"+r.cid+(v?"-"+v:""),i,void 0,void 0,void 0,a,{Ctor:r,propsData:f,listeners:d,tag:c,children:s},l)}}}function ht(e,n,r,i){var o=e.componentOptions,a={_isComponent:!0,parent:n,propsData:o.propsData,_componentTag:o.tag,_parentVnode:e,_parentListeners:o.listeners,_renderChildren:o.children,_parentElm:r||null,_refElm:i||null},s=e.data.inlineTemplate;return t(s)&&(a.render=s.render,a.staticRenderFns=s.staticRenderFns),new o.Ctor(a)}function mt(e){e.hook||(e.hook={});for(var t=0;t<Vo.length;t++){var n=Vo[t],r=e.hook[n],i=Uo[n];e.hook[n]=r?yt(i,r):i}}function yt(e,t){return function(n,r,i,o){e(n,r,i,o),t(n,r,i,o)}}function gt(e,n){var r=e.model&&e.model.prop||"value",i=e.model&&e.model.event||"input";(n.props||(n.props={}))[r]=n.model.value;var o=n.on||(n.on={});t(o[i])?o[i]=[n.model.callback].concat(o[i]):o[i]=n.model.callback}function _t(e,t,r,o,a,s){return(Array.isArray(r)||i(r))&&(a=o,o=r,r=void 0),n(s)&&(a=Ko),bt(e,t,r,o,a)}function bt(e,n,r,i,o){if(t(r)&&t(r.__ob__))return fo();if(t(r)&&t(r.is)&&(n=r.is),!n)return fo();Array.isArray(i)&&"function"==typeof i[0]&&((r=r||{}).scopedSlots={default:i[0]},i.length=0),o===Ko?i=le(i):o===zo&&(i=ue(i));var a,s;if("string"==typeof n){var c;s=e.$vnode&&e.$vnode.ns||Hi.getTagNamespace(n),a=Hi.isReservedTag(n)?new uo(Hi.parsePlatformTagName(n),r,i,void 0,void 0,e):t(c=q(e.$options,"components",n))?vt(c,r,e,i,n):new uo(n,r,i,void 0,void 0,e)}else a=vt(n,r,e,i);return t(a)?(s&&$t(a,s),a):fo()}function $t(r,i,o){if(r.ns=i,"foreignObject"===r.tag&&(i=void 0,o=!0),t(r.children))for(var a=0,s=r.children.length;a<s;a++){var c=r.children[a];t(c.tag)&&(e(c.ns)||n(o))&&$t(c,i,o)}}function Ct(e){e._vnode=null;var t=e.$options,n=e.$vnode=t._parentVnode,r=n&&n.context;e.$slots=Ce(t._renderChildren,r),e.$scopedSlots=Bi,e._c=function(t,n,r,i){return _t(e,t,n,r,i,!1)},e.$createElement=function(t,n,r,i){return _t(e,t,n,r,i,!0)};var i=n&&n.data;M(e,"$attrs",i&&i.attrs||Bi,null,!0),M(e,"$listeners",t._parentListeners||Bi,null,!0)}function wt(e,t){var n=e.$options=Object.create(e.constructor.options);n.parent=t.parent,n.propsData=t.propsData,n._parentVnode=t._parentVnode,n._parentListeners=t._parentListeners,n._renderChildren=t._renderChildren,n._componentTag=t._componentTag,n._parentElm=t._parentElm,n._refElm=t._refElm,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}function xt(e){var t=e.options;if(e.super){var n=xt(e.super);if(n!==e.superOptions){e.superOptions=n;var r=kt(e);r&&y(e.extendOptions,r),(t=e.options=J(n,e.extendOptions)).name&&(t.components[t.name]=e)}}return t}function kt(e){var t,n=e.options,r=e.extendOptions,i=e.sealedOptions;for(var o in n)n[o]!==i[o]&&(t||(t={}),t[o]=At(n[o],r[o],i[o]));return t}function At(e,t,n){if(Array.isArray(e)){var r=[];n=Array.isArray(n)?n:[n],t=Array.isArray(t)?t:[t];for(var i=0;i<e.length;i++)(t.indexOf(e[i])>=0||n.indexOf(e[i])<0)&&r.push(e[i]);return r}return e}function Ot(e){this._init(e)}function St(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=m(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}function Tt(e){e.mixin=function(e){return this.options=J(this.options,e),this}}function Et(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,r=n.cid,i=e._Ctor||(e._Ctor={});if(i[r])return i[r];var o=e.name||n.options.name,a=function(e){this._init(e)};return a.prototype=Object.create(n.prototype),a.prototype.constructor=a,a.cid=t++,a.options=J(n.options,e),a.super=n,a.options.props&&jt(a),a.options.computed&&Lt(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,Ri.forEach(function(e){a[e]=n[e]}),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=e,a.sealedOptions=y({},a.options),i[r]=a,a}}function jt(e){var t=e.options.props;for(var n in t)He(e.prototype,"_props",n)}function Lt(e){var t=e.options.computed;for(var n in t)Je(e.prototype,n,t[n])}function Nt(e){Ri.forEach(function(t){e[t]=function(e,n){return n?("component"===t&&a(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}})}function It(e){return e&&(e.Ctor.options.name||e.tag)}function Mt(e,t){return Array.isArray(e)?e.indexOf(t)>-1:"string"==typeof e?e.split(",").indexOf(t)>-1:!!s(e)&&e.test(t)}function Pt(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=It(a.componentOptions);s&&!t(s)&&Dt(n,o,r,i)}}}function Dt(e,t,n,r){var i=e[t];i&&i!==r&&i.componentInstance.$destroy(),e[t]=null,d(n,t)}function Rt(e){for(var n=e.data,r=e,i=e;t(i.componentInstance);)(i=i.componentInstance._vnode).data&&(n=Ft(i.data,n));for(;t(r=r.parent);)r.data&&(n=Ft(n,r.data));return Ht(n.staticClass,n.class)}function Ft(e,n){return{staticClass:Bt(e.staticClass,n.staticClass),class:t(e.class)?[e.class,n.class]:n.class}}function Ht(e,n){return t(e)||t(n)?Bt(e,Ut(n)):""}function Bt(e,t){return e?t?e+" "+t:e:t||""}function Ut(e){return Array.isArray(e)?Vt(e):o(e)?zt(e):"string"==typeof e?e:""}function Vt(e){for(var n,r="",i=0,o=e.length;i<o;i++)t(n=Ut(e[i]))&&""!==n&&(r&&(r+=" "),r+=n);return r}function zt(e){var t="";for(var n in e)e[n]&&(t&&(t+=" "),t+=n);return t}function Kt(e){return va(e)?"svg":"math"===e?"math":void 0}function Jt(e){if("string"==typeof e){var t=document.querySelector(e);return t||document.createElement("div")}return e}function qt(e,t){var n=e.data.ref;if(n){var r=e.context,i=e.componentInstance||e.elm,o=r.$refs;t?Array.isArray(o[n])?d(o[n],i):o[n]===i&&(o[n]=void 0):e.data.refInFor?Array.isArray(o[n])?o[n].indexOf(i)<0&&o[n].push(i):o[n]=[i]:o[n]=i}}function Wt(r,i){return r.key===i.key&&(r.tag===i.tag&&r.isComment===i.isComment&&t(r.data)===t(i.data)&&Gt(r,i)||n(r.isAsyncPlaceholder)&&r.asyncFactory===i.asyncFactory&&e(i.asyncFactory.error))}function Gt(e,n){if("input"!==e.tag)return!0;var r,i=t(r=e.data)&&t(r=r.attrs)&&r.type,o=t(r=n.data)&&t(r=r.attrs)&&r.type;return i===o||ya(i)&&ya(o)}function Zt(e,n,r){var i,o,a={};for(i=n;i<=r;++i)t(o=e[i].key)&&(a[o]=i);return a}function Yt(e,t){(e.data.directives||t.data.directives)&&Qt(e,t)}function Qt(e,t){var n,r,i,o=e===ba,a=t===ba,s=Xt(e.data.directives,e.context),c=Xt(t.data.directives,t.context),u=[],l=[];for(n in c)r=s[n],i=c[n],r?(i.oldValue=r.value,tn(i,"update",t,e),i.def&&i.def.componentUpdated&&l.push(i)):(tn(i,"bind",t,e),i.def&&i.def.inserted&&u.push(i));if(u.length){var f=function(){for(var n=0;n<u.length;n++)tn(u[n],"inserted",t,e)};o?ae(t.data.hook||(t.data.hook={}),"insert",f):f()}if(l.length&&ae(t.data.hook||(t.data.hook={}),"postpatch",function(){for(var n=0;n<l.length;n++)tn(l[n],"componentUpdated",t,e)}),!o)for(n in s)c[n]||tn(s[n],"unbind",e,e,a)}function Xt(e,t){var n=Object.create(null);if(!e)return n;var r,i;for(r=0;r<e.length;r++)(i=e[r]).modifiers||(i.modifiers=wa),n[en(i)]=i,i.def=q(t.$options,"directives",i.name,!0);return n}function en(e){return e.rawName||e.name+"."+Object.keys(e.modifiers||{}).join(".")}function tn(e,t,n,r,i){var o=e.def&&e.def[t];if(o)try{o(n.elm,e,n,r,i)}catch(r){Q(r,n.context,"directive "+e.name+" "+t+" hook")}}function nn(n,r){var i=r.componentOptions;if(!(t(i)&&!1===i.Ctor.options.inheritAttrs||e(n.data.attrs)&&e(r.data.attrs))){var o,a,s=r.elm,c=n.data.attrs||{},u=r.data.attrs||{};t(u.__ob__)&&(u=r.data.attrs=y({},u));for(o in u)a=u[o],c[o]!==a&&rn(s,o,a);(qi||Wi)&&u.value!==c.value&&rn(s,"value",u.value);for(o in c)e(u[o])&&(ua(o)?s.removeAttributeNS(ca,la(o)):aa(o)||s.removeAttribute(o))}}function rn(e,t,n){sa(t)?fa(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):aa(t)?e.setAttribute(t,fa(n)||"false"===n?"false":"true"):ua(t)?fa(n)?e.removeAttributeNS(ca,la(t)):e.setAttributeNS(ca,t,n):fa(n)?e.removeAttribute(t):e.setAttribute(t,n)}function on(n,r){var i=r.elm,o=r.data,a=n.data;if(!(e(o.staticClass)&&e(o.class)&&(e(a)||e(a.staticClass)&&e(a.class)))){var s=Rt(r),c=i._transitionClasses;t(c)&&(s=Bt(s,Ut(c))),s!==i._prevClass&&(i.setAttribute("class",s),i._prevClass=s)}}function an(e){function t(){(a||(a=[])).push(e.slice(v,i).trim()),v=i+1}var n,r,i,o,a,s=!1,c=!1,u=!1,l=!1,f=0,d=0,p=0,v=0;for(i=0;i<e.length;i++)if(r=n,n=e.charCodeAt(i),s)39===n&&92!==r&&(s=!1);else if(c)34===n&&92!==r&&(c=!1);else if(u)96===n&&92!==r&&(u=!1);else if(l)47===n&&92!==r&&(l=!1);else if(124!==n||124===e.charCodeAt(i+1)||124===e.charCodeAt(i-1)||f||d||p){switch(n){case 34:c=!0;break;case 39:s=!0;break;case 96:u=!0;break;case 40:p++;break;case 41:p--;break;case 91:d++;break;case 93:d--;break;case 123:f++;break;case 125:f--}if(47===n){for(var h=i-1,m=void 0;h>=0&&" "===(m=e.charAt(h));h--);m&&Oa.test(m)||(l=!0)}}else void 0===o?(v=i+1,o=e.slice(0,i).trim()):t();if(void 0===o?o=e.slice(0,i).trim():0!==v&&t(),a)for(i=0;i<a.length;i++)o=sn(o,a[i]);return o}function sn(e,t){var n=t.indexOf("(");return n<0?'_f("'+t+'")('+e+")":'_f("'+t.slice(0,n)+'")('+e+","+t.slice(n+1)}function cn(e){console.error("[Vue compiler]: "+e)}function un(e,t){return e?e.map(function(e){return e[t]}).filter(function(e){return e}):[]}function ln(e,t,n){(e.props||(e.props=[])).push({name:t,value:n})}function fn(e,t,n){(e.attrs||(e.attrs=[])).push({name:t,value:n})}function dn(e,t,n,r,i,o){(e.directives||(e.directives=[])).push({name:t,rawName:n,value:r,arg:i,modifiers:o})}function pn(e,t,n,r,i,o){r&&r.capture&&(delete r.capture,t="!"+t),r&&r.once&&(delete r.once,t="~"+t),r&&r.passive&&(delete r.passive,t="&"+t);var a;r&&r.native?(delete r.native,a=e.nativeEvents||(e.nativeEvents={})):a=e.events||(e.events={});var s={value:n,modifiers:r},c=a[t];Array.isArray(c)?i?c.unshift(s):c.push(s):a[t]=c?i?[s,c]:[c,s]:s}function vn(e,t,n){var r=hn(e,":"+t)||hn(e,"v-bind:"+t);if(null!=r)return an(r);if(!1!==n){var i=hn(e,t);if(null!=i)return JSON.stringify(i)}}function hn(e,t,n){var r;if(null!=(r=e.attrsMap[t]))for(var i=e.attrsList,o=0,a=i.length;o<a;o++)if(i[o].name===t){i.splice(o,1);break}return n&&delete e.attrsMap[t],r}function mn(e,t,n){var r=n||{},i=r.number,o="$$v";r.trim&&(o="(typeof $$v === 'string'? $$v.trim(): $$v)"),i&&(o="_n("+o+")");var a=yn(t,o);e.model={value:"("+t+")",expression:'"'+t+'"',callback:"function ($$v) {"+a+"}"}}function yn(e,t){var n=gn(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function gn(e){if(Go=e.length,e.indexOf("[")<0||e.lastIndexOf("]")<Go-1)return(Qo=e.lastIndexOf("."))>-1?{exp:e.slice(0,Qo),key:'"'+e.slice(Qo+1)+'"'}:{exp:e,key:null};for(Zo=e,Qo=Xo=ea=0;!bn();)$n(Yo=_n())?wn(Yo):91===Yo&&Cn(Yo);return{exp:e.slice(0,Xo),key:e.slice(Xo+1,ea)}}function _n(){return Zo.charCodeAt(++Qo)}function bn(){return Qo>=Go}function $n(e){return 34===e||39===e}function Cn(e){var t=1;for(Xo=Qo;!bn();)if(e=_n(),$n(e))wn(e);else if(91===e&&t++,93===e&&t--,0===t){ea=Qo;break}}function wn(e){for(var t=e;!bn()&&(e=_n())!==t;);}function xn(e,t,n){var r=n&&n.number,i=vn(e,"value")||"null",o=vn(e,"true-value")||"true",a=vn(e,"false-value")||"false";ln(e,"checked","Array.isArray("+t+")?_i("+t+","+i+")>-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),pn(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+t+"=$$a.concat([$$v]))}else{$$i>-1&&("+t+"=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}}else{"+yn(t,"$$c")+"}",null,!0)}function kn(e,t,n){var r=n&&n.number,i=vn(e,"value")||"null";ln(e,"checked","_q("+t+","+(i=r?"_n("+i+")":i)+")"),pn(e,"change",yn(t,i),null,!0)}function An(e,t,n){var r="var $$selectedVal = "+('Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(n&&n.number?"_n(val)":"val")+"})")+";";pn(e,"change",r=r+" "+yn(t,"$event.target.multiple ? $$selectedVal : $$selectedVal[0]"),null,!0)}function On(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?Sa:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var f=yn(t,l);c&&(f="if($event.target.composing)return;"+f),ln(e,"value","("+t+")"),pn(e,u,f,null,!0),(s||a)&&pn(e,"blur","$forceUpdate()")}function Sn(e){if(t(e[Sa])){var n=Ji?"change":"input";e[n]=[].concat(e[Sa],e[n]||[]),delete e[Sa]}t(e[Ta])&&(e.change=[].concat(e[Ta],e.change||[]),delete e[Ta])}function Tn(e,t,n){var r=ta;return function i(){null!==e.apply(null,arguments)&&jn(t,i,n,r)}}function En(e,t,n,r,i){t=ne(t),n&&(t=Tn(t,e,r)),ta.addEventListener(e,t,Qi?{capture:r,passive:i}:r)}function jn(e,t,n,r){(r||ta).removeEventListener(e,t._withTask||t,n)}function Ln(t,n){if(!e(t.data.on)||!e(n.data.on)){var r=n.data.on||{},i=t.data.on||{};ta=n.elm,Sn(r),oe(r,i,En,jn,n.context)}}function Nn(n,r){if(!e(n.data.domProps)||!e(r.data.domProps)){var i,o,a=r.elm,s=n.data.domProps||{},c=r.data.domProps||{};t(c.__ob__)&&(c=r.data.domProps=y({},c));for(i in s)e(c[i])&&(a[i]="");for(i in c){if(o=c[i],"textContent"===i||"innerHTML"===i){if(r.children&&(r.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i){a._value=o;var u=e(o)?"":String(o);In(a,u)&&(a.value=u)}else a[i]=o}}}function In(e,t){return!e.composing&&("OPTION"===e.tagName||Mn(e,t)||Pn(e,t))}function Mn(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}function Pn(e,n){var r=e.value,i=e._vModifiers;return t(i)&&i.number?l(r)!==l(n):t(i)&&i.trim?r.trim()!==n.trim():r!==n}function Dn(e){var t=Rn(e.style);return e.staticStyle?y(e.staticStyle,t):t}function Rn(e){return Array.isArray(e)?g(e):"string"==typeof e?La(e):e}function Fn(e,t){var n,r={};if(t)for(var i=e;i.componentInstance;)(i=i.componentInstance._vnode).data&&(n=Dn(i.data))&&y(r,n);(n=Dn(e.data))&&y(r,n);for(var o=e;o=o.parent;)o.data&&(n=Dn(o.data))&&y(r,n);return r}function Hn(n,r){var i=r.data,o=n.data;if(!(e(i.staticStyle)&&e(i.style)&&e(o.staticStyle)&&e(o.style))){var a,s,c=r.elm,u=o.staticStyle,l=o.normalizedStyle||o.style||{},f=u||l,d=Rn(r.data.style)||{};r.data.normalizedStyle=t(d.__ob__)?y({},d):d;var p=Fn(r,!0);for(s in f)e(p[s])&&Ma(c,s,"");for(s in p)(a=p[s])!==f[s]&&Ma(c,s,null==a?"":a)}}function Bn(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(/\s+/).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function Un(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(/\s+/).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function Vn(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&y(t,Fa(e.name||"v")),y(t,e),t}return"string"==typeof e?Fa(e):void 0}}function zn(e){qa(function(){qa(e)})}function Kn(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),Bn(e,t))}function Jn(e,t){e._transitionClasses&&d(e._transitionClasses,t),Un(e,t)}function qn(e,t,n){var r=Wn(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===Ba?za:Ja,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c<a&&u()},o+1),e.addEventListener(s,l)}function Wn(e,t){var n,r=window.getComputedStyle(e),i=r[Va+"Delay"].split(", "),o=r[Va+"Duration"].split(", "),a=Gn(i,o),s=r[Ka+"Delay"].split(", "),c=r[Ka+"Duration"].split(", "),u=Gn(s,c),l=0,f=0;return t===Ba?a>0&&(n=Ba,l=a,f=o.length):t===Ua?u>0&&(n=Ua,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?Ba:Ua:null)?n===Ba?o.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===Ba&&Wa.test(r[Va+"Property"])}}function Gn(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max.apply(null,t.map(function(t,n){return Zn(t)+Zn(e[n])}))}function Zn(e){return 1e3*Number(e.slice(0,-1))}function Yn(n,r){var i=n.elm;t(i._leaveCb)&&(i._leaveCb.cancelled=!0,i._leaveCb());var a=Vn(n.data.transition);if(!e(a)&&!t(i._enterCb)&&1===i.nodeType){for(var s=a.css,c=a.type,u=a.enterClass,f=a.enterToClass,d=a.enterActiveClass,p=a.appearClass,v=a.appearToClass,h=a.appearActiveClass,m=a.beforeEnter,y=a.enter,g=a.afterEnter,_=a.enterCancelled,b=a.beforeAppear,$=a.appear,w=a.afterAppear,x=a.appearCancelled,k=a.duration,A=Eo,O=Eo.$vnode;O&&O.parent;)A=(O=O.parent).context;var S=!A._isMounted||!n.isRootInsert;if(!S||$||""===$){var T=S&&p?p:u,E=S&&h?h:d,j=S&&v?v:f,L=S?b||m:m,N=S&&"function"==typeof $?$:y,I=S?w||g:g,M=S?x||_:_,P=l(o(k)?k.enter:k),D=!1!==s&&!qi,R=er(N),F=i._enterCb=C(function(){D&&(Jn(i,j),Jn(i,E)),F.cancelled?(D&&Jn(i,T),M&&M(i)):I&&I(i),i._enterCb=null});n.data.show||ae(n.data.hook||(n.data.hook={}),"insert",function(){var e=i.parentNode,t=e&&e._pending&&e._pending[n.key];t&&t.tag===n.tag&&t.elm._leaveCb&&t.elm._leaveCb(),N&&N(i,F)}),L&&L(i),D&&(Kn(i,T),Kn(i,E),zn(function(){Kn(i,j),Jn(i,T),F.cancelled||R||(Xn(P)?setTimeout(F,P):qn(i,c,F))})),n.data.show&&(r&&r(),N&&N(i,F)),D||R||F()}}}function Qn(n,r){function i(){x.cancelled||(n.data.show||((a.parentNode._pending||(a.parentNode._pending={}))[n.key]=n),v&&v(a),b&&(Kn(a,f),Kn(a,p),zn(function(){Kn(a,d),Jn(a,f),x.cancelled||$||(Xn(w)?setTimeout(x,w):qn(a,u,x))})),h&&h(a,x),b||$||x())}var a=n.elm;t(a._enterCb)&&(a._enterCb.cancelled=!0,a._enterCb());var s=Vn(n.data.transition);if(e(s))return r();if(!t(a._leaveCb)&&1===a.nodeType){var c=s.css,u=s.type,f=s.leaveClass,d=s.leaveToClass,p=s.leaveActiveClass,v=s.beforeLeave,h=s.leave,m=s.afterLeave,y=s.leaveCancelled,g=s.delayLeave,_=s.duration,b=!1!==c&&!qi,$=er(h),w=l(o(_)?_.leave:_),x=a._leaveCb=C(function(){a.parentNode&&a.parentNode._pending&&(a.parentNode._pending[n.key]=null),b&&(Jn(a,d),Jn(a,p)),x.cancelled?(b&&Jn(a,f),y&&y(a)):(r(),m&&m(a)),a._leaveCb=null});g?g(i):i()}}function Xn(e){return"number"==typeof e&&!isNaN(e)}function er(n){if(e(n))return!1;var r=n.fns;return t(r)?er(Array.isArray(r)?r[0]:r):(n._length||n.length)>1}function tr(e,t){!0!==t.data.show&&Yn(t)}function nr(e,t,n){rr(e,t,n),(Ji||Wi)&&setTimeout(function(){rr(e,t,n)},0)}function rr(e,t,n){var r=t.value,i=e.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,c=e.options.length;s<c;s++)if(a=e.options[s],i)o=$(r,or(a))>-1,a.selected!==o&&(a.selected=o);else if(b(or(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function ir(e,t){return t.every(function(t){return!b(t,e)})}function or(e){return"_value"in e?e._value:e.value}function ar(e){e.target.composing=!0}function sr(e){e.target.composing&&(e.target.composing=!1,cr(e.target,"input"))}function cr(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function ur(e){return!e.componentInstance||e.data&&e.data.transition?e:ur(e.componentInstance._vnode)}function lr(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?lr(ye(t.children)):e}function fr(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[ji(o)]=i[o];return t}function dr(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}function pr(e){for(;e=e.parent;)if(e.data.transition)return!0}function vr(e,t){return t.key===e.key&&t.tag===e.tag}function hr(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function mr(e){e.data.newPos=e.elm.getBoundingClientRect()}function yr(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}function gr(e,t){var n=t?os(t):rs;if(n.test(e)){for(var r,i,o=[],a=n.lastIndex=0;r=n.exec(e);){(i=r.index)>a&&o.push(JSON.stringify(e.slice(a,i)));var s=an(r[1].trim());o.push("_s("+s+")"),a=i+r[0].length}return a<e.length&&o.push(JSON.stringify(e.slice(a))),o.join("+")}}function _r(e,t){var n=t?Ps:Ms;return e.replace(n,function(e){return Is[e]})}function br(e,t){function n(t){l+=t,e=e.substring(t)}function r(e,n,r){var i,s;if(null==n&&(n=l),null==r&&(r=l),e&&(s=e.toLowerCase()),e)for(i=a.length-1;i>=0&&a[i].lowerCasedTag!==s;i--);else i=0;if(i>=0){for(var c=a.length-1;c>=i;c--)t.end&&t.end(a[c].tag,n,r);a.length=i,o=i&&a[i-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,r):"p"===s&&(t.start&&t.start(e,[],!1,n,r),t.end&&t.end(e,n,r))}for(var i,o,a=[],s=t.expectHTML,c=t.isUnaryTag||Mi,u=t.canBeLeftOpenTag||Mi,l=0;e;){if(i=e,o&&Ls(o)){var f=0,d=o.toLowerCase(),p=Ns[d]||(Ns[d]=new RegExp("([\\s\\S]*?)(</"+d+"[^>]*>)","i")),v=e.replace(p,function(e,n,r){return f=r.length,Ls(d)||"noscript"===d||(n=n.replace(/<!--([\s\S]*?)-->/g,"$1").replace(/<!\[CDATA\[([\s\S]*?)]]>/g,"$1")),Rs(d,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""});l+=e.length-v.length,e=v,r(d,l-f,l)}else{var h=e.indexOf("<");if(0===h){if(_s.test(e)){var m=e.indexOf("--\x3e");if(m>=0){t.shouldKeepComment&&t.comment(e.substring(4,m)),n(m+3);continue}}if(bs.test(e)){var y=e.indexOf("]>");if(y>=0){n(y+2);continue}}var g=e.match(gs);if(g){n(g[0].length);continue}var _=e.match(ys);if(_){var b=l;n(_[0].length),r(_[1],b,l);continue}var $=function(){var t=e.match(hs);if(t){var r={tagName:t[1],attrs:[],start:l};n(t[0].length);for(var i,o;!(i=e.match(ms))&&(o=e.match(ds));)n(o[0].length),r.attrs.push(o);if(i)return r.unarySlash=i[1],n(i[0].length),r.end=l,r}}();if($){!function(e){var n=e.tagName,i=e.unarySlash;s&&("p"===o&&fs(n)&&r(o),u(n)&&o===n&&r(n));for(var l=c(n)||!!i,f=e.attrs.length,d=new Array(f),p=0;p<f;p++){var v=e.attrs[p];$s&&-1===v[0].indexOf('""')&&(""===v[3]&&delete v[3],""===v[4]&&delete v[4],""===v[5]&&delete v[5]);var h=v[3]||v[4]||v[5]||"";d[p]={name:v[1],value:_r(h,t.shouldDecodeNewlines)}}l||(a.push({tag:n,lowerCasedTag:n.toLowerCase(),attrs:d}),o=n),t.start&&t.start(n,d,l,e.start,e.end)}($),Rs(o,e)&&n(1);continue}}var C=void 0,w=void 0,x=void 0;if(h>=0){for(w=e.slice(h);!(ys.test(w)||hs.test(w)||_s.test(w)||bs.test(w)||(x=w.indexOf("<",1))<0);)h+=x,w=e.slice(h);C=e.substring(0,h),n(h)}h<0&&(C=e,e=""),t.chars&&C&&t.chars(C)}if(e===i){t.chars&&t.chars(e);break}}r()}function $r(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:Fr(t),parent:n,children:[]}}function Cr(e,t){function n(e){e.pre&&(s=!1),Os(e.tag)&&(c=!1)}Cs=t.warn||cn,Os=t.isPreTag||Mi,Ss=t.mustUseProp||Mi,Ts=t.getTagNamespace||Mi,xs=un(t.modules,"transformNode"),ks=un(t.modules,"preTransformNode"),As=un(t.modules,"postTransformNode"),ws=t.delimiters;var r,i,o=[],a=!1!==t.preserveWhitespace,s=!1,c=!1;return br(e,{warn:Cs,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldKeepComment:t.comments,start:function(e,a,u){var l=i&&i.ns||Ts(e);Ji&&"svg"===l&&(a=Ur(a));var f=$r(e,a,i);l&&(f.ns=l),Br(f)&&!no()&&(f.forbidden=!0);for(var d=0;d<ks.length;d++)f=ks[d](f,t)||f;if(s||(wr(f),f.pre&&(s=!0)),Os(f.tag)&&(c=!0),s?xr(f):f.processed||(Sr(f),Tr(f),Nr(f),kr(f,t)),r?o.length||r.if&&(f.elseif||f.else)&&Lr(r,{exp:f.elseif,block:f}):r=f,i&&!f.forbidden)if(f.elseif||f.else)Er(f,i);else if(f.slotScope){i.plain=!1;var p=f.slotTarget||'"default"';(i.scopedSlots||(i.scopedSlots={}))[p]=f}else i.children.push(f),f.parent=i;u?n(f):(i=f,o.push(f));for(var v=0;v<As.length;v++)As[v](f,t)},end:function(){var e=o[o.length-1],t=e.children[e.children.length-1];t&&3===t.type&&" "===t.text&&!c&&e.children.pop(),o.length-=1,i=o[o.length-1],n(e)},chars:function(e){if(i&&(!Ji||"textarea"!==i.tag||i.attrsMap.placeholder!==e)){var t=i.children;if(e=c||e.trim()?Hr(i)?e:Js(e):a&&t.length?" ":""){var n;!s&&" "!==e&&(n=gr(e,ws))?t.push({type:2,expression:n,text:e}):" "===e&&t.length&&" "===t[t.length-1].text||t.push({type:3,text:e})}}},comment:function(e){i.children.push({type:3,text:e,isComment:!0})}}),r}function wr(e){null!=hn(e,"v-pre")&&(e.pre=!0)}function xr(e){var t=e.attrsList.length;if(t)for(var n=e.attrs=new Array(t),r=0;r<t;r++)n[r]={name:e.attrsList[r].name,value:JSON.stringify(e.attrsList[r].value)};else e.pre||(e.plain=!0)}function kr(e,t){Ar(e),e.plain=!e.key&&!e.attrsList.length,Or(e),Ir(e),Mr(e);for(var n=0;n<xs.length;n++)e=xs[n](e,t)||e;Pr(e)}function Ar(e){var t=vn(e,"key");t&&(e.key=t)}function Or(e){var t=vn(e,"ref");t&&(e.ref=t,e.refInFor=Dr(e))}function Sr(e){var t;if(t=hn(e,"v-for")){var n=t.match(Bs);if(!n)return;e.for=n[2].trim();var r=n[1].trim(),i=r.match(Us);i?(e.alias=i[1].trim(),e.iterator1=i[2].trim(),i[3]&&(e.iterator2=i[3].trim())):e.alias=r}}function Tr(e){var t=hn(e,"v-if");if(t)e.if=t,Lr(e,{exp:t,block:e});else{null!=hn(e,"v-else")&&(e.else=!0);var n=hn(e,"v-else-if");n&&(e.elseif=n)}}function Er(e,t){var n=jr(t.children);n&&n.if&&Lr(n,{exp:e.elseif,block:e})}function jr(e){for(var t=e.length;t--;){if(1===e[t].type)return e[t];e.pop()}}function Lr(e,t){e.ifConditions||(e.ifConditions=[]),e.ifConditions.push(t)}function Nr(e){null!=hn(e,"v-once")&&(e.once=!0)}function Ir(e){if("slot"===e.tag)e.slotName=vn(e,"name");else{var t;"template"===e.tag?(t=hn(e,"scope"),e.slotScope=t||hn(e,"slot-scope")):(t=hn(e,"slot-scope"))&&(e.slotScope=t);var n=vn(e,"slot");n&&(e.slotTarget='""'===n?'"default"':n,e.slotScope||fn(e,"slot",n))}}function Mr(e){var t;(t=vn(e,"is"))&&(e.component=t),null!=hn(e,"inline-template")&&(e.inlineTemplate=!0)}function Pr(e){var t,n,r,i,o,a,s,c=e.attrsList;for(t=0,n=c.length;t<n;t++)if(r=i=c[t].name,o=c[t].value,Hs.test(r))if(e.hasBindings=!0,(a=Rr(r))&&(r=r.replace(Ks,"")),zs.test(r))r=r.replace(zs,""),o=an(o),s=!1,a&&(a.prop&&(s=!0,"innerHtml"===(r=ji(r))&&(r="innerHTML")),a.camel&&(r=ji(r)),a.sync&&pn(e,"update:"+ji(r),yn(o,"$event"))),s||!e.component&&Ss(e.tag,e.attrsMap.type,r)?ln(e,r,o):fn(e,r,o);else if(Fs.test(r))pn(e,r=r.replace(Fs,""),o,a,!1,Cs);else{var u=(r=r.replace(Hs,"")).match(Vs),l=u&&u[1];l&&(r=r.slice(0,-(l.length+1))),dn(e,r,i,o,l,a)}else fn(e,r,JSON.stringify(o))}function Dr(e){for(var t=e;t;){if(void 0!==t.for)return!0;t=t.parent}return!1}function Rr(e){var t=e.match(Ks);if(t){var n={};return t.forEach(function(e){n[e.slice(1)]=!0}),n}}function Fr(e){for(var t={},n=0,r=e.length;n<r;n++)t[e[n].name]=e[n].value;return t}function Hr(e){return"script"===e.tag||"style"===e.tag}function Br(e){return"style"===e.tag||"script"===e.tag&&(!e.attrsMap.type||"text/javascript"===e.attrsMap.type)}function Ur(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];qs.test(r.name)||(r.name=r.name.replace(Ws,""),t.push(r))}return t}function Vr(e){return $r(e.tag,e.attrsList.slice(),e.parent)}function zr(e,t,n){e.attrsMap[t]=n,e.attrsList.push({name:t,value:n})}function Kr(e,t){e&&(Es=Ys(t.staticKeys||""),js=t.isReservedTag||Mi,Jr(e),qr(e,!1))}function Jr(e){if(e.static=Wr(e),1===e.type){if(!js(e.tag)&&"slot"!==e.tag&&null==e.attrsMap["inline-template"])return;for(var t=0,n=e.children.length;t<n;t++){var r=e.children[t];Jr(r),r.static||(e.static=!1)}if(e.ifConditions)for(var i=1,o=e.ifConditions.length;i<o;i++){var a=e.ifConditions[i].block;Jr(a),a.static||(e.static=!1)}}}function qr(e,t){if(1===e.type){if((e.static||e.once)&&(e.staticInFor=t),e.static&&e.children.length&&(1!==e.children.length||3!==e.children[0].type))return void(e.staticRoot=!0);if(e.staticRoot=!1,e.children)for(var n=0,r=e.children.length;n<r;n++)qr(e.children[n],t||!!e.for);if(e.ifConditions)for(var i=1,o=e.ifConditions.length;i<o;i++)qr(e.ifConditions[i].block,t)}}function Wr(e){return 2!==e.type&&(3===e.type||!(!e.pre&&(e.hasBindings||e.if||e.for||Oi(e.tag)||!js(e.tag)||Gr(e)||!Object.keys(e).every(Es))))}function Gr(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}function Zr(e,t,n){var r=t?"nativeOn:{":"on:{";for(var i in e){var o=e[i];r+='"'+i+'":'+Yr(i,o)+","}return r.slice(0,-1)+"}"}function Yr(e,t){if(!t)return"function(){}";if(Array.isArray(t))return"["+t.map(function(t){return Yr(e,t)}).join(",")+"]";var n=Xs.test(t.value),r=Qs.test(t.value);if(t.modifiers){var i="",o="",a=[];for(var s in t.modifiers)if(nc[s])o+=nc[s],ec[s]&&a.push(s);else if("exact"===s){var c=t.modifiers;o+=tc(["ctrl","shift","alt","meta"].filter(function(e){return!c[e]}).map(function(e){return"$event."+e+"Key"}).join("||"))}else a.push(s);return a.length&&(i+=Qr(a)),o&&(i+=o),"function($event){"+i+(n?t.value+"($event)":r?"("+t.value+")($event)":t.value)+"}"}return n||r?t.value:"function($event){"+t.value+"}"}function Qr(e){return"if(!('button' in $event)&&"+e.map(Xr).join("&&")+")return null;"}function Xr(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=ec[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key)"}function ei(e,t){var n=new ic(t);return{render:"with(this){return "+(e?ti(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function ti(e,t){if(e.staticRoot&&!e.staticProcessed)return ni(e,t);if(e.once&&!e.onceProcessed)return ri(e,t);if(e.for&&!e.forProcessed)return ai(e,t);if(e.if&&!e.ifProcessed)return ii(e,t);if("template"!==e.tag||e.slotTarget){if("slot"===e.tag)return _i(e,t);var n;if(e.component)n=bi(e.component,e,t);else{var r=e.plain?void 0:si(e,t),i=e.inlineTemplate?null:pi(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o<t.transforms.length;o++)n=t.transforms[o](e,n);return n}return pi(e,t)||"void 0"}function ni(e,t){return e.staticProcessed=!0,t.staticRenderFns.push("with(this){return "+ti(e,t)+"}"),"_m("+(t.staticRenderFns.length-1)+(e.staticInFor?",true":"")+")"}function ri(e,t){if(e.onceProcessed=!0,e.if&&!e.ifProcessed)return ii(e,t);if(e.staticInFor){for(var n="",r=e.parent;r;){if(r.for){n=r.key;break}r=r.parent}return n?"_o("+ti(e,t)+","+t.onceId+++","+n+")":ti(e,t)}return ni(e,t)}function ii(e,t,n,r){return e.ifProcessed=!0,oi(e.ifConditions.slice(),t,n,r)}function oi(e,t,n,r){function i(e){return n?n(e,t):e.once?ri(e,t):ti(e,t)}if(!e.length)return r||"_e()";var o=e.shift();return o.exp?"("+o.exp+")?"+i(o.block)+":"+oi(e,t,n,r):""+i(o.block)}function ai(e,t,n,r){var i=e.for,o=e.alias,a=e.iterator1?","+e.iterator1:"",s=e.iterator2?","+e.iterator2:"";return e.forProcessed=!0,(r||"_l")+"(("+i+"),function("+o+a+s+"){return "+(n||ti)(e,t)+"})"}function si(e,t){var n="{",r=ci(e,t);r&&(n+=r+","),e.key&&(n+="key:"+e.key+","),e.ref&&(n+="ref:"+e.ref+","),e.refInFor&&(n+="refInFor:true,"),e.pre&&(n+="pre:true,"),e.component&&(n+='tag:"'+e.tag+'",');for(var i=0;i<t.dataGenFns.length;i++)n+=t.dataGenFns[i](e);if(e.attrs&&(n+="attrs:{"+$i(e.attrs)+"},"),e.props&&(n+="domProps:{"+$i(e.props)+"},"),e.events&&(n+=Zr(e.events,!1,t.warn)+","),e.nativeEvents&&(n+=Zr(e.nativeEvents,!0,t.warn)+","),e.slotTarget&&!e.slotScope&&(n+="slot:"+e.slotTarget+","),e.scopedSlots&&(n+=li(e.scopedSlots,t)+","),e.model&&(n+="model:{value:"+e.model.value+",callback:"+e.model.callback+",expression:"+e.model.expression+"},"),e.inlineTemplate){var o=ui(e,t);o&&(n+=o+",")}return n=n.replace(/,$/,"")+"}",e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function ci(e,t){var n=e.directives;if(n){var r,i,o,a,s="directives:[",c=!1;for(r=0,i=n.length;r<i;r++){o=n[r],a=!0;var u=t.directives[o.name];u&&(a=!!u(e,o,t.warn)),a&&(c=!0,s+='{name:"'+o.name+'",rawName:"'+o.rawName+'"'+(o.value?",value:("+o.value+"),expression:"+JSON.stringify(o.value):"")+(o.arg?',arg:"'+o.arg+'"':"")+(o.modifiers?",modifiers:"+JSON.stringify(o.modifiers):"")+"},")}return c?s.slice(0,-1)+"]":void 0}}function ui(e,t){var n=e.children[0];if(1===n.type){var r=ei(n,t.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map(function(e){return"function(){"+e+"}"}).join(",")+"]}"}}function li(e,t){return"scopedSlots:_u(["+Object.keys(e).map(function(n){return fi(n,e[n],t)}).join(",")+"])"}function fi(e,t,n){return t.for&&!t.forProcessed?di(e,t,n):"{key:"+e+",fn:"+("function("+String(t.slotScope)+"){return "+("template"===t.tag?t.if?t.if+"?"+(pi(t,n)||"undefined")+":undefined":pi(t,n)||"undefined":ti(t,n))+"}")+"}"}function di(e,t,n){var r=t.for,i=t.alias,o=t.iterator1?","+t.iterator1:"",a=t.iterator2?","+t.iterator2:"";return t.forProcessed=!0,"_l(("+r+"),function("+i+o+a+"){return "+fi(e,t,n)+"})"}function pi(e,t,n,r,i){var o=e.children;if(o.length){var a=o[0];if(1===o.length&&a.for&&"template"!==a.tag&&"slot"!==a.tag)return(r||ti)(a,t);var s=n?vi(o,t.maybeComponent):0,c=i||mi;return"["+o.map(function(e){return c(e,t)}).join(",")+"]"+(s?","+s:"")}}function vi(e,t){for(var n=0,r=0;r<e.length;r++){var i=e[r];if(1===i.type){if(hi(i)||i.ifConditions&&i.ifConditions.some(function(e){return hi(e.block)})){n=2;break}(t(i)||i.ifConditions&&i.ifConditions.some(function(e){return t(e.block)}))&&(n=1)}}return n}function hi(e){return void 0!==e.for||"template"===e.tag||"slot"===e.tag}function mi(e,t){return 1===e.type?ti(e,t):3===e.type&&e.isComment?gi(e):yi(e)}function yi(e){return"_v("+(2===e.type?e.expression:Ci(JSON.stringify(e.text)))+")"}function gi(e){return"_e("+JSON.stringify(e.text)+")"}function _i(e,t){var n=e.slotName||'"default"',r=pi(e,t),i="_t("+n+(r?","+r:""),o=e.attrs&&"{"+e.attrs.map(function(e){return ji(e.name)+":"+e.value}).join(",")+"}",a=e.attrsMap["v-bind"];return!o&&!a||r||(i+=",null"),o&&(i+=","+o),a&&(i+=(o?"":",null")+","+a),i+")"}function bi(e,t,n){var r=t.inlineTemplate?null:pi(t,n,!0);return"_c("+e+","+si(t,n)+(r?","+r:"")+")"}function $i(e){for(var t="",n=0;n<e.length;n++){var r=e[n];t+='"'+r.name+'":'+Ci(r.value)+","}return t.slice(0,-1)}function Ci(e){return e.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function wi(e,t){try{return new Function(e)}catch(n){return t.push({err:n,code:e}),_}}function xi(e){var t=Object.create(null);return function(n,r,i){delete(r=y({},r)).warn;var o=r.delimiters?String(r.delimiters)+n:n;if(t[o])return t[o];var a=e(n,r),s={},c=[];return s.render=wi(a.render,c),s.staticRenderFns=a.staticRenderFns.map(function(e){return wi(e,c)}),t[o]=s}}function ki(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}var Ai=Object.prototype.toString,Oi=f("slot,component",!0),Si=f("key,ref,slot,slot-scope,is"),Ti=Object.prototype.hasOwnProperty,Ei=/-(\w)/g,ji=v(function(e){return e.replace(Ei,function(e,t){return t?t.toUpperCase():""})}),Li=v(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),Ni=/\B([A-Z])/g,Ii=v(function(e){return e.replace(Ni,"-$1").toLowerCase()}),Mi=function(e,t,n){return!1},Pi=function(e){return e},Di="data-server-rendered",Ri=["component","directive","filter"],Fi=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured"],Hi={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:Mi,isReservedAttr:Mi,isUnknownElement:Mi,getTagNamespace:_,parsePlatformTagName:Pi,mustUseProp:Mi,_lifecycleHooks:Fi},Bi=Object.freeze({}),Ui=/[^\w.$]/,Vi="__proto__"in{},zi="undefined"!=typeof window,Ki=zi&&window.navigator.userAgent.toLowerCase(),Ji=Ki&&/msie|trident/.test(Ki),qi=Ki&&Ki.indexOf("msie 9.0")>0,Wi=Ki&&Ki.indexOf("edge/")>0,Gi=Ki&&Ki.indexOf("android")>0,Zi=Ki&&/iphone|ipad|ipod|ios/.test(Ki),Yi=(Ki&&/chrome\/\d+/.test(Ki),{}.watch),Qi=!1;if(zi)try{var Xi={};Object.defineProperty(Xi,"passive",{get:function(){Qi=!0}}),window.addEventListener("test-passive",null,Xi)}catch(e){}var eo,to,no=function(){return void 0===eo&&(eo=!zi&&"undefined"!=typeof global&&"server"===global.process.env.VUE_ENV),eo},ro=zi&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,io="undefined"!=typeof Symbol&&A(Symbol)&&"undefined"!=typeof Reflect&&A(Reflect.ownKeys);to="undefined"!=typeof Set&&A(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var oo=_,ao=0,so=function(){this.id=ao++,this.subs=[]};so.prototype.addSub=function(e){this.subs.push(e)},so.prototype.removeSub=function(e){d(this.subs,e)},so.prototype.depend=function(){so.target&&so.target.addDep(this)},so.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t<n;t++)e[t].update()},so.target=null;var co=[],uo=function(e,t,n,r,i,o,a,s){this.tag=e,this.data=t,this.children=n,this.text=r,this.elm=i,this.ns=void 0,this.context=o,this.functionalContext=void 0,this.functionalOptions=void 0,this.functionalScopeId=void 0,this.key=t&&t.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=s,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1},lo={child:{configurable:!0}};lo.child.get=function(){return this.componentInstance},Object.defineProperties(uo.prototype,lo);var fo=function(e){void 0===e&&(e="");var t=new uo;return t.text=e,t.isComment=!0,t},po=Array.prototype,vo=Object.create(po);["push","pop","shift","unshift","splice","sort","reverse"].forEach(function(e){var t=po[e];x(vo,e,function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];var i,o=t.apply(this,n),a=this.__ob__;switch(e){case"push":case"unshift":i=n;break;case"splice":i=n.slice(2)}return i&&a.observeArray(i),a.dep.notify(),o})});var ho=Object.getOwnPropertyNames(vo),mo={shouldConvert:!0},yo=function(e){this.value=e,this.dep=new so,this.vmCount=0,x(e,"__ob__",this),Array.isArray(e)?((Vi?L:N)(e,vo,ho),this.observeArray(e)):this.walk(e)};yo.prototype.walk=function(e){for(var t=Object.keys(e),n=0;n<t.length;n++)M(e,t[n],e[t[n]])},yo.prototype.observeArray=function(e){for(var t=0,n=e.length;t<n;t++)I(e[t])};var go=Hi.optionMergeStrategies;go.data=function(e,t,n){return n?H(e,t,n):t&&"function"!=typeof t?e:H.call(this,e,t)},Fi.forEach(function(e){go[e]=B}),Ri.forEach(function(e){go[e+"s"]=U}),go.watch=function(e,t,n,r){if(e===Yi&&(e=void 0),t===Yi&&(t=void 0),!t)return Object.create(e||null);if(!e)return t;var i={};y(i,e);for(var o in t){var a=i[o],s=t[o];a&&!Array.isArray(a)&&(a=[a]),i[o]=a?a.concat(s):Array.isArray(s)?s:[s]}return i},go.props=go.methods=go.inject=go.computed=function(e,t,n,r){if(!e)return t;var i=Object.create(null);return y(i,e),t&&y(i,t),i},go.provide=H;var _o,bo,$o=function(e,t){return void 0===t?e:t},Co=[],wo=!1,xo=!1;if("undefined"!=typeof setImmediate&&A(setImmediate))bo=function(){setImmediate(te)};else if("undefined"==typeof MessageChannel||!A(MessageChannel)&&"[object MessageChannelConstructor]"!==MessageChannel.toString())bo=function(){setTimeout(te,0)};else{var ko=new MessageChannel,Ao=ko.port2;ko.port1.onmessage=te,bo=function(){Ao.postMessage(1)}}if("undefined"!=typeof Promise&&A(Promise)){var Oo=Promise.resolve();_o=function(){Oo.then(te),Zi&&setTimeout(_)}}else _o=bo;var So,To=v(function(e){var t="&"===e.charAt(0),n="~"===(e=t?e.slice(1):e).charAt(0),r="!"===(e=n?e.slice(1):e).charAt(0);return e=r?e.slice(1):e,{name:e,once:n,capture:r,passive:t}}),Eo=null,jo=[],Lo=[],No={},Io=!1,Mo=!1,Po=0,Do=0,Ro=function(e,t,n,r){this.vm=e,e._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++Do,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new to,this.newDepIds=new to,this.expression="","function"==typeof t?this.getter=t:(this.getter=k(t),this.getter||(this.getter=function(){})),this.value=this.lazy?void 0:this.get()};Ro.prototype.get=function(){O(this);var e,t=this.vm;try{e=this.getter.call(t,t)}catch(e){if(!this.user)throw e;Q(e,t,'getter for watcher "'+this.expression+'"')}finally{this.deep&&Re(e),S(),this.cleanupDeps()}return e},Ro.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},Ro.prototype.cleanupDeps=function(){for(var e=this,t=this.deps.length;t--;){var n=e.deps[t];e.newDepIds.has(n.id)||n.removeSub(e)}var r=this.depIds;this.depIds=this.newDepIds,this.newDepIds=r,this.newDepIds.clear(),r=this.deps,this.deps=this.newDeps,this.newDeps=r,this.newDeps.length=0},Ro.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():De(this)},Ro.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||o(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){Q(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},Ro.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},Ro.prototype.depend=function(){for(var e=this,t=this.deps.length;t--;)e.deps[t].depend()},Ro.prototype.teardown=function(){var e=this;if(this.active){this.vm._isBeingDestroyed||d(this.vm._watchers,this);for(var t=this.deps.length;t--;)e.deps[t].removeSub(e);this.active=!1}};var Fo=new to,Ho={enumerable:!0,configurable:!0,get:_,set:_},Bo={lazy:!0};lt(ft.prototype);var Uo={init:function(e,t,n,r){if(!e.componentInstance||e.componentInstance._isDestroyed)(e.componentInstance=ht(e,Eo,n,r)).$mount(t?e.elm:void 0,t);else if(e.data.keepAlive){var i=e;Uo.prepatch(i,i)}},prepatch:function(e,t){var n=t.componentOptions;Oe(t.componentInstance=e.componentInstance,n.propsData,n.listeners,t,n.children)},insert:function(e){var t=e.context,n=e.componentInstance;n._isMounted||(n._isMounted=!0,je(n,"mounted")),e.data.keepAlive&&(t._isMounted?Me(n):Te(n,!0))},destroy:function(e){var t=e.componentInstance;t._isDestroyed||(e.data.keepAlive?Ee(t,!0):t.$destroy())}},Vo=Object.keys(Uo),zo=1,Ko=2,Jo=0;!function(e){e.prototype._init=function(e){var t=this;t._uid=Jo++,t._isVue=!0,e&&e._isComponent?wt(t,e):t.$options=J(xt(t.constructor),e||{},t),t._renderProxy=t,t._self=t,ke(t),ge(t),Ct(t),je(t,"beforeCreate"),Qe(t),Be(t),Ye(t),je(t,"created"),t.$options.el&&t.$mount(t.$options.el)}}(Ot),function(e){var t={};t.get=function(){return this._data};var n={};n.get=function(){return this._props},Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=P,e.prototype.$delete=D,e.prototype.$watch=function(e,t,n){var r=this;if(a(t))return Ze(r,e,t,n);(n=n||{}).user=!0;var i=new Ro(r,e,t,n);return n.immediate&&t.call(r,i.value),function(){i.teardown()}}}(Ot),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this,i=this;if(Array.isArray(e))for(var o=0,a=e.length;o<a;o++)r.$on(e[o],n);else(i._events[e]||(i._events[e]=[])).push(n),t.test(e)&&(i._hasHookEvent=!0);return i},e.prototype.$once=function(e,t){function n(){r.$off(e,n),t.apply(r,arguments)}var r=this;return n.fn=t,r.$on(e,n),r},e.prototype.$off=function(e,t){var n=this,r=this;if(!arguments.length)return r._events=Object.create(null),r;if(Array.isArray(e)){for(var i=0,o=e.length;i<o;i++)n.$off(e[i],t);return r}var a=r._events[e];if(!a)return r;if(1===arguments.length)return r._events[e]=null,r;if(t)for(var s,c=a.length;c--;)if((s=a[c])===t||s.fn===t){a.splice(c,1);break}return r},e.prototype.$emit=function(e){var t=this,n=t._events[e];if(n){n=n.length>1?m(n):n;for(var r=m(arguments,1),i=0,o=n.length;i<o;i++)try{n[i].apply(t,r)}catch(n){Q(n,t,'event handler for "'+e+'"')}}return t}}(Ot),function(e){e.prototype._update=function(e,t){var n=this;n._isMounted&&je(n,"beforeUpdate");var r=n.$el,i=n._vnode,o=Eo;Eo=n,n._vnode=e,i?n.$el=n.__patch__(i,e):(n.$el=n.__patch__(n.$el,e,t,!1,n.$options._parentElm,n.$options._refElm),n.$options._parentElm=n.$options._refElm=null),Eo=o,r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n),n.$vnode&&n.$parent&&n.$vnode===n.$parent._vnode&&(n.$parent.$el=n.$el)},e.prototype.$forceUpdate=function(){var e=this;e._watcher&&e._watcher.update()},e.prototype.$destroy=function(){var e=this;if(!e._isBeingDestroyed){je(e,"beforeDestroy"),e._isBeingDestroyed=!0;var t=e.$parent;!t||t._isBeingDestroyed||e.$options.abstract||d(t.$children,e),e._watcher&&e._watcher.teardown();for(var n=e._watchers.length;n--;)e._watchers[n].teardown();e._data.__ob__&&e._data.__ob__.vmCount--,e._isDestroyed=!0,e.__patch__(e._vnode,null),je(e,"destroyed"),e.$off(),e.$el&&(e.$el.__vue__=null),e.$vnode&&(e.$vnode.parent=null)}}}(Ot),function(e){lt(e.prototype),e.prototype.$nextTick=function(e){return re(e,this)},e.prototype._render=function(){var e=this,t=e.$options,n=t.render,r=t._parentVnode;if(e._isMounted)for(var i in e.$slots){var o=e.$slots[i];o._rendered&&(e.$slots[i]=j(o,!0))}e.$scopedSlots=r&&r.data.scopedSlots||Bi,e.$vnode=r;var a;try{a=n.call(e._renderProxy,e.$createElement)}catch(t){Q(t,e,"render"),a=e._vnode}return a instanceof uo||(a=fo()),a.parent=r,a}}(Ot);var qo=[String,RegExp,Array],Wo={KeepAlive:{name:"keep-alive",abstract:!0,props:{include:qo,exclude:qo,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){var e=this;for(var t in e.cache)Dt(e.cache,t,e.keys)},watch:{include:function(e){Pt(this,function(t){return Mt(e,t)})},exclude:function(e){Pt(this,function(t){return!Mt(e,t)})}},render:function(){var e=ye(this.$slots.default),t=e&&e.componentOptions;if(t){var n=It(t);if(n&&(this.include&&!Mt(this.include,n)||this.exclude&&Mt(this.exclude,n)))return e;var r=this,i=r.cache,o=r.keys,a=null==e.key?t.Ctor.cid+(t.tag?"::"+t.tag:""):e.key;i[a]?(e.componentInstance=i[a].componentInstance,d(o,a),o.push(a)):(i[a]=e,o.push(a),this.max&&o.length>parseInt(this.max)&&Dt(i,o[0],o,this._vnode)),e.data.keepAlive=!0}return e}}};!function(e){var t={};t.get=function(){return Hi},Object.defineProperty(e,"config",t),e.util={warn:oo,extend:y,mergeOptions:J,defineReactive:M},e.set=P,e.delete=D,e.nextTick=re,e.options=Object.create(null),Ri.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,y(e.options.components,Wo),St(e),Tt(e),Et(e),Nt(e)}(Ot),Object.defineProperty(Ot.prototype,"$isServer",{get:no}),Object.defineProperty(Ot.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Ot.version="2.5.2";var Go,Zo,Yo,Qo,Xo,ea,ta,na,ra=f("style,class"),ia=f("input,textarea,option,select,progress"),oa=function(e,t,n){return"value"===n&&ia(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},aa=f("contenteditable,draggable,spellcheck"),sa=f("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),ca="http://www.w3.org/1999/xlink",ua=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},la=function(e){return ua(e)?e.slice(6,e.length):""},fa=function(e){return null==e||!1===e},da={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},pa=f("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),va=f("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),ha=function(e){return pa(e)||va(e)},ma=Object.create(null),ya=f("text,number,password,search,email,tel,url"),ga=Object.freeze({createElement:function(e,t){var n=document.createElement(e);return"select"!==e?n:(t.data&&t.data.attrs&&void 0!==t.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)},createElementNS:function(e,t){return document.createElementNS(da[e],t)},createTextNode:function(e){return document.createTextNode(e)},createComment:function(e){return document.createComment(e)},insertBefore:function(e,t,n){e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},appendChild:function(e,t){e.appendChild(t)},parentNode:function(e){return e.parentNode},nextSibling:function(e){return e.nextSibling},tagName:function(e){return e.tagName},setTextContent:function(e,t){e.textContent=t},setAttribute:function(e,t,n){e.setAttribute(t,n)}}),_a={create:function(e,t){qt(t)},update:function(e,t){e.data.ref!==t.data.ref&&(qt(e,!0),qt(t))},destroy:function(e){qt(e,!0)}},ba=new uo("",{},[]),$a=["create","activate","update","remove","destroy"],Ca={create:Yt,update:Yt,destroy:function(e){Yt(e,ba)}},wa=Object.create(null),xa=[_a,Ca],ka={create:nn,update:nn},Aa={create:on,update:on},Oa=/[\w).+\-_$\]]/,Sa="__r",Ta="__c",Ea={create:Ln,update:Ln},ja={create:Nn,update:Nn},La=v(function(e){var t={},n=/;(?![^(]*\))/g,r=/:(.+)/;return e.split(n).forEach(function(e){if(e){var n=e.split(r);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}),Na=/^--/,Ia=/\s*!important$/,Ma=function(e,t,n){if(Na.test(t))e.style.setProperty(t,n);else if(Ia.test(n))e.style.setProperty(t,n.replace(Ia,""),"important");else{var r=Da(t);if(Array.isArray(n))for(var i=0,o=n.length;i<o;i++)e.style[r]=n[i];else e.style[r]=n}},Pa=["Webkit","Moz","ms"],Da=v(function(e){if(na=na||document.createElement("div").style,"filter"!==(e=ji(e))&&e in na)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<Pa.length;n++){var r=Pa[n]+t;if(r in na)return r}}),Ra={create:Hn,update:Hn},Fa=v(function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}}),Ha=zi&&!qi,Ba="transition",Ua="animation",Va="transition",za="transitionend",Ka="animation",Ja="animationend";Ha&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Va="WebkitTransition",za="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Ka="WebkitAnimation",Ja="webkitAnimationEnd"));var qa=zi?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()},Wa=/\b(transform|all)(,|$)/,Ga=function(r){function o(e){return new uo(j.tagName(e).toLowerCase(),{},[],void 0,e)}function a(e,t){function n(){0==--n.listeners&&s(e)}return n.listeners=t,n}function s(e){var n=j.parentNode(e);t(n)&&j.removeChild(n,e)}function c(e,r,i,o,a){if(e.isRootInsert=!a,!u(e,r,i,o)){var s=e.data,c=e.children,l=e.tag;t(l)?(e.elm=e.ns?j.createElementNS(e.ns,l):j.createElement(l,e),y(e),v(e,c,r),t(s)&&m(e,r),p(i,e.elm,o)):n(e.isComment)?(e.elm=j.createComment(e.text),p(i,e.elm,o)):(e.elm=j.createTextNode(e.text),p(i,e.elm,o))}}function u(e,r,i,o){var a=e.data;if(t(a)){var s=t(e.componentInstance)&&a.keepAlive;if(t(a=a.hook)&&t(a=a.init)&&a(e,!1,i,o),t(e.componentInstance))return l(e,r),n(s)&&d(e,r,i,o),!0}}function l(e,n){t(e.data.pendingInsert)&&(n.push.apply(n,e.data.pendingInsert),e.data.pendingInsert=null),e.elm=e.componentInstance.$el,h(e)?(m(e,n),y(e)):(qt(e),n.push(e))}function d(e,n,r,i){for(var o,a=e;a.componentInstance;)if(a=a.componentInstance._vnode,t(o=a.data)&&t(o=o.transition)){for(o=0;o<T.activate.length;++o)T.activate[o](ba,a);n.push(a);break}p(r,e.elm,i)}function p(e,n,r){t(e)&&(t(r)?r.parentNode===e&&j.insertBefore(e,n,r):j.appendChild(e,n))}function v(e,t,n){if(Array.isArray(t))for(var r=0;r<t.length;++r)c(t[r],n,e.elm,null,!0);else i(e.text)&&j.appendChild(e.elm,j.createTextNode(e.text))}function h(e){for(;e.componentInstance;)e=e.componentInstance._vnode;return t(e.tag)}function m(e,n){for(var r=0;r<T.create.length;++r)T.create[r](ba,e);t(O=e.data.hook)&&(t(O.create)&&O.create(ba,e),t(O.insert)&&n.push(e))}function y(e){var n;if(t(n=e.functionalScopeId))j.setAttribute(e.elm,n,"");else for(var r=e;r;)t(n=r.context)&&t(n=n.$options._scopeId)&&j.setAttribute(e.elm,n,""),r=r.parent;t(n=Eo)&&n!==e.context&&n!==e.functionalContext&&t(n=n.$options._scopeId)&&j.setAttribute(e.elm,n,"")}function g(e,t,n,r,i,o){for(;r<=i;++r)c(n[r],o,e,t)}function _(e){var n,r,i=e.data;if(t(i))for(t(n=i.hook)&&t(n=n.destroy)&&n(e),n=0;n<T.destroy.length;++n)T.destroy[n](e);if(t(n=e.children))for(r=0;r<e.children.length;++r)_(e.children[r])}function b(e,n,r,i){for(;r<=i;++r){var o=n[r];t(o)&&(t(o.tag)?($(o),_(o)):s(o.elm))}}function $(e,n){if(t(n)||t(e.data)){var r,i=T.remove.length+1;for(t(n)?n.listeners+=i:n=a(e.elm,i),t(r=e.componentInstance)&&t(r=r._vnode)&&t(r.data)&&$(r,n),r=0;r<T.remove.length;++r)T.remove[r](e,n);t(r=e.data.hook)&&t(r=r.remove)?r(e,n):n()}else s(e.elm)}function C(n,r,i,o,a){for(var s,u,l,f=0,d=0,p=r.length-1,v=r[0],h=r[p],m=i.length-1,y=i[0],_=i[m],$=!a;f<=p&&d<=m;)e(v)?v=r[++f]:e(h)?h=r[--p]:Wt(v,y)?(x(v,y,o),v=r[++f],y=i[++d]):Wt(h,_)?(x(h,_,o),h=r[--p],_=i[--m]):Wt(v,_)?(x(v,_,o),$&&j.insertBefore(n,v.elm,j.nextSibling(h.elm)),v=r[++f],_=i[--m]):Wt(h,y)?(x(h,y,o),$&&j.insertBefore(n,h.elm,v.elm),h=r[--p],y=i[++d]):(e(s)&&(s=Zt(r,f,p)),e(u=t(y.key)?s[y.key]:w(y,r,f,p))?c(y,o,n,v.elm):Wt(l=r[u],y)?(x(l,y,o),r[u]=void 0,$&&j.insertBefore(n,l.elm,v.elm)):c(y,o,n,v.elm),y=i[++d]);f>p?g(n,e(i[m+1])?null:i[m+1].elm,i,d,m,o):d>m&&b(n,r,f,p)}function w(e,n,r,i){for(var o=r;o<i;o++){var a=n[o];if(t(a)&&Wt(e,a))return o}}function x(r,i,o,a){if(r!==i){var s=i.elm=r.elm;if(n(r.isAsyncPlaceholder))t(i.asyncFactory.resolved)?A(r.elm,i,o):i.isAsyncPlaceholder=!0;else if(n(i.isStatic)&&n(r.isStatic)&&i.key===r.key&&(n(i.isCloned)||n(i.isOnce)))i.componentInstance=r.componentInstance;else{var c,u=i.data;t(u)&&t(c=u.hook)&&t(c=c.prepatch)&&c(r,i);var l=r.children,f=i.children;if(t(u)&&h(i)){for(c=0;c<T.update.length;++c)T.update[c](r,i);t(c=u.hook)&&t(c=c.update)&&c(r,i)}e(i.text)?t(l)&&t(f)?l!==f&&C(s,l,f,o,a):t(f)?(t(r.text)&&j.setTextContent(s,""),g(s,null,f,0,f.length-1,o)):t(l)?b(s,l,0,l.length-1):t(r.text)&&j.setTextContent(s,""):r.text!==i.text&&j.setTextContent(s,i.text),t(u)&&t(c=u.hook)&&t(c=c.postpatch)&&c(r,i)}}}function k(e,r,i){if(n(i)&&t(e.parent))e.parent.data.pendingInsert=r;else for(var o=0;o<r.length;++o)r[o].data.hook.insert(r[o])}function A(e,r,i){if(n(r.isComment)&&t(r.asyncFactory))return r.elm=e,r.isAsyncPlaceholder=!0,!0;r.elm=e;var o=r.tag,a=r.data,s=r.children;if(t(a)&&(t(O=a.hook)&&t(O=O.init)&&O(r,!0),t(O=r.componentInstance)))return l(r,i),!0;if(t(o)){if(t(s))if(e.hasChildNodes())if(t(O=a)&&t(O=O.domProps)&&t(O=O.innerHTML)){if(O!==e.innerHTML)return!1}else{for(var c=!0,u=e.firstChild,f=0;f<s.length;f++){if(!u||!A(u,s[f],i)){c=!1;break}u=u.nextSibling}if(!c||u)return!1}else v(r,s,i);if(t(a))for(var d in a)if(!L(d)){m(r,i);break}}else e.data!==r.text&&(e.data=r.text);return!0}var O,S,T={},E=r.modules,j=r.nodeOps;for(O=0;O<$a.length;++O)for(T[$a[O]]=[],S=0;S<E.length;++S)t(E[S][$a[O]])&&T[$a[O]].push(E[S][$a[O]]);var L=f("attrs,style,class,staticClass,staticStyle,key");return function(r,i,a,s,u,l){if(!e(i)){var f=!1,d=[];if(e(r))f=!0,c(i,d,u,l);else{var p=t(r.nodeType);if(!p&&Wt(r,i))x(r,i,d,s);else{if(p){if(1===r.nodeType&&r.hasAttribute(Di)&&(r.removeAttribute(Di),a=!0),n(a)&&A(r,i,d))return k(i,d,!0),r;r=o(r)}var v=r.elm,m=j.parentNode(v);if(c(i,d,v._leaveCb?null:m,j.nextSibling(v)),t(i.parent))for(var y=i.parent,g=h(i);y;){for(var $=0;$<T.destroy.length;++$)T.destroy[$](y);if(y.elm=i.elm,g){for(var C=0;C<T.create.length;++C)T.create[C](ba,y);var w=y.data.hook.insert;if(w.merged)for(var O=1;O<w.fns.length;O++)w.fns[O]()}else qt(y);y=y.parent}t(m)?b(m,[r],0,0):t(r.tag)&&_(r)}}return k(i,d,f),i.elm}t(r)&&_(r)}}({nodeOps:ga,modules:[ka,Aa,Ea,ja,Ra,zi?{create:tr,activate:tr,remove:function(e,t){!0!==e.data.show?Qn(e,t):t()}}:{}].concat(xa)});qi&&document.addEventListener("selectionchange",function(){var e=document.activeElement;e&&e.vmodel&&cr(e,"input")});var Za={model:{inserted:function(e,t,n){"select"===n.tag?(nr(e,t,n.context),e._vOptions=[].map.call(e.options,or)):("textarea"===n.tag||ya(e.type))&&(e._vModifiers=t.modifiers,t.modifiers.lazy||(e.addEventListener("change",sr),Gi||(e.addEventListener("compositionstart",ar),e.addEventListener("compositionend",sr)),qi&&(e.vmodel=!0)))},componentUpdated:function(e,t,n){if("select"===n.tag){nr(e,t,n.context);var r=e._vOptions,i=e._vOptions=[].map.call(e.options,or);i.some(function(e,t){return!b(e,r[t])})&&(e.multiple?t.value.some(function(e){return ir(e,i)}):t.value!==t.oldValue&&ir(t.value,i))&&cr(e,"change")}}},show:{bind:function(e,t,n){var r=t.value,i=(n=ur(n)).data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,Yn(n,function(){e.style.display=o})):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value;r!==t.oldValue&&((n=ur(n)).data&&n.data.transition?(n.data.show=!0,r?Yn(n,function(){e.style.display=e.__vOriginalDisplay}):Qn(n,function(){e.style.display="none"})):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}}},Ya={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]},Qa={name:"transition",props:Ya,abstract:!0,render:function(e){var t=this,n=this.$options._renderChildren;if(n&&(n=n.filter(function(e){return e.tag||me(e)})).length){var r=this.mode,o=n[0];if(pr(this.$vnode))return o;var a=lr(o);if(!a)return o;if(this._leaving)return dr(e,o);var s="__transition-"+this._uid+"-";a.key=null==a.key?a.isComment?s+"comment":s+a.tag:i(a.key)?0===String(a.key).indexOf(s)?a.key:s+a.key:a.key;var c=(a.data||(a.data={})).transition=fr(this),u=this._vnode,l=lr(u);if(a.data.directives&&a.data.directives.some(function(e){return"show"===e.name})&&(a.data.show=!0),l&&l.data&&!vr(a,l)&&!me(l)){var f=l.data.transition=y({},c);if("out-in"===r)return this._leaving=!0,ae(f,"afterLeave",function(){t._leaving=!1,t.$forceUpdate()}),dr(e,o);if("in-out"===r){if(me(a))return u;var d,p=function(){d()};ae(c,"afterEnter",p),ae(c,"enterCancelled",p),ae(f,"delayLeave",function(e){d=e})}}return o}}},Xa=y({tag:String,moveClass:String},Ya);delete Xa.mode;var es={Transition:Qa,TransitionGroup:{props:Xa,render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=fr(this),s=0;s<i.length;s++){var c=i[s];c.tag&&null!=c.key&&0!==String(c.key).indexOf("__vlist")&&(o.push(c),n[c.key]=c,(c.data||(c.data={})).transition=a)}if(r){for(var u=[],l=[],f=0;f<r.length;f++){var d=r[f];d.data.transition=a,d.data.pos=d.elm.getBoundingClientRect(),n[d.key]?u.push(d):l.push(d)}this.kept=e(t,null,u),this.removed=l}return e(t,null,o)},beforeUpdate:function(){this.__patch__(this._vnode,this.kept,!1,!0),this._vnode=this.kept},updated:function(){var e=this.prevChildren,t=this.moveClass||(this.name||"v")+"-move";e.length&&this.hasMove(e[0].elm,t)&&(e.forEach(hr),e.forEach(mr),e.forEach(yr),this._reflow=document.body.offsetHeight,e.forEach(function(e){if(e.data.moved){var n=e.elm,r=n.style;Kn(n,t),r.transform=r.WebkitTransform=r.transitionDuration="",n.addEventListener(za,n._moveCb=function e(r){r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(za,e),n._moveCb=null,Jn(n,t))})}}))},methods:{hasMove:function(e,t){if(!Ha)return!1;if(this._hasMove)return this._hasMove;var n=e.cloneNode();e._transitionClasses&&e._transitionClasses.forEach(function(e){Un(n,e)}),Bn(n,t),n.style.display="none",this.$el.appendChild(n);var r=Wn(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}}};Ot.config.mustUseProp=oa,Ot.config.isReservedTag=ha,Ot.config.isReservedAttr=ra,Ot.config.getTagNamespace=Kt,Ot.config.isUnknownElement=function(e){if(!zi)return!0;if(ha(e))return!1;if(e=e.toLowerCase(),null!=ma[e])return ma[e];var t=document.createElement(e);return e.indexOf("-")>-1?ma[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:ma[e]=/HTMLUnknownElement/.test(t.toString())},y(Ot.options.directives,Za),y(Ot.options.components,es),Ot.prototype.__patch__=zi?Ga:_,Ot.prototype.$mount=function(e,t){return e=e&&zi?Jt(e):void 0,Ae(this,e,t)},Ot.nextTick(function(){Hi.devtools&&ro&&ro.emit("init",Ot)},0);var ts,ns=!!zi&&function(e,t){var n=document.createElement("div");return n.innerHTML='<div a="'+e+'"/>',n.innerHTML.indexOf(t)>0}("\n","&#10;"),rs=/\{\{((?:.|\n)+?)\}\}/g,is=/[-.*+?^${}()|[\]\/\\]/g,os=v(function(e){var t=e[0].replace(is,"\\$&"),n=e[1].replace(is,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")}),as={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=hn(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=vn(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}},ss={staticKeys:["staticStyle"],transformNode:function(e,t){var n=hn(e,"style");n&&(e.staticStyle=JSON.stringify(La(n)));var r=vn(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},cs={decode:function(e){return ts=ts||document.createElement("div"),ts.innerHTML=e,ts.textContent}},us=f("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),ls=f("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),fs=f("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),ds=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ps="[a-zA-Z_][\\w\\-\\.]*",vs="((?:"+ps+"\\:)?"+ps+")",hs=new RegExp("^<"+vs),ms=/^\s*(\/?)>/,ys=new RegExp("^<\\/"+vs+"[^>]*>"),gs=/^<!DOCTYPE [^>]+>/i,_s=/^<!--/,bs=/^<!\[/,$s=!1;"x".replace(/x(.)?/g,function(e,t){$s=""===t});var Cs,ws,xs,ks,As,Os,Ss,Ts,Es,js,Ls=f("script,style,textarea",!0),Ns={},Is={"&lt;":"<","&gt;":">","&quot;":'"',"&amp;":"&","&#10;":"\n"},Ms=/&(?:lt|gt|quot|amp);/g,Ps=/&(?:lt|gt|quot|amp|#10);/g,Ds=f("pre,textarea",!0),Rs=function(e,t){return e&&Ds(e)&&"\n"===t[0]},Fs=/^@|^v-on:/,Hs=/^v-|^@|^:/,Bs=/(.*?)\s+(?:in|of)\s+(.*)/,Us=/\((\{[^}]*\}|[^,]*),([^,]*)(?:,([^,]*))?\)/,Vs=/:(.*)$/,zs=/^:|^v-bind:/,Ks=/\.[^.]+/g,Js=v(cs.decode),qs=/^xmlns:NS\d+/,Ws=/^NS\d+:/,Gs=[as,ss,{preTransformNode:function(e,t){if("input"===e.tag){var n=e.attrsMap;if(n["v-model"]&&(n["v-bind:type"]||n[":type"])){var r=vn(e,"type"),i=hn(e,"v-if",!0),o=i?"&&("+i+")":"",a=Vr(e);Sr(a),zr(a,"type","checkbox"),kr(a,t),a.processed=!0,a.if="("+r+")==='checkbox'"+o,Lr(a,{exp:a.if,block:a});var s=Vr(e);hn(s,"v-for",!0),zr(s,"type","radio"),kr(s,t),Lr(a,{exp:"("+r+")==='radio'"+o,block:s});var c=Vr(e);return hn(c,"v-for",!0),zr(c,":type",r),kr(c,t),Lr(a,{exp:i,block:c}),a}}}}],Zs={expectHTML:!0,modules:Gs,directives:{model:function(e,t,n){var r=t.value,i=t.modifiers,o=e.tag,a=e.attrsMap.type;if(e.component)return mn(e,r,i),!1;if("select"===o)An(e,r,i);else if("input"===o&&"checkbox"===a)xn(e,r,i);else if("input"===o&&"radio"===a)kn(e,r,i);else if("input"===o||"textarea"===o)On(e,r,i);else if(!Hi.isReservedTag(o))return mn(e,r,i),!1;return!0},text:function(e,t){t.value&&ln(e,"textContent","_s("+t.value+")")},html:function(e,t){t.value&&ln(e,"innerHTML","_s("+t.value+")")}},isPreTag:function(e){return"pre"===e},isUnaryTag:us,mustUseProp:oa,canBeLeftOpenTag:ls,isReservedTag:ha,getTagNamespace:Kt,staticKeys:function(e){return e.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(",")}(Gs)},Ys=v(function(e){return f("type,tag,attrsList,attrsMap,plain,parent,children,attrs"+(e?","+e:""))}),Qs=/^\s*([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/,Xs=/^\s*[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?']|\[".*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*\s*$/,ec={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},tc=function(e){return"if("+e+")return null;"},nc={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:tc("$event.target !== $event.currentTarget"),ctrl:tc("!$event.ctrlKey"),shift:tc("!$event.shiftKey"),alt:tc("!$event.altKey"),meta:tc("!$event.metaKey"),left:tc("'button' in $event && $event.button !== 0"),middle:tc("'button' in $event && $event.button !== 1"),right:tc("'button' in $event && $event.button !== 2")},rc={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:_},ic=function(e){this.options=e,this.warn=e.warn||cn,this.transforms=un(e.modules,"transformCode"),this.dataGenFns=un(e.modules,"genData"),this.directives=y(y({},rc),e.directives);var t=e.isReservedTag||Mi;this.maybeComponent=function(e){return!t(e.tag)},this.onceId=0,this.staticRenderFns=[]},oc=(new RegExp("\\b"+"do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,super,throw,while,yield,delete,export,import,return,switch,default,extends,finally,continue,debugger,function,arguments".split(",").join("\\b|\\b")+"\\b"),new RegExp("\\b"+"delete,typeof,void".split(",").join("\\s*\\([^\\)]*\\)|\\b")+"\\s*\\([^\\)]*\\)"),function(e){return function(t){function n(n,r){var i=Object.create(t),o=[],a=[];if(i.warn=function(e,t){(t?a:o).push(e)},r){r.modules&&(i.modules=(t.modules||[]).concat(r.modules)),r.directives&&(i.directives=y(Object.create(t.directives),r.directives));for(var s in r)"modules"!==s&&"directives"!==s&&(i[s]=r[s])}var c=e(n,i);return c.errors=o,c.tips=a,c}return{compile:n,compileToFunctions:xi(n)}}}(function(e,t){var n=Cr(e.trim(),t);Kr(n,t);var r=ei(n,t);return{ast:n,render:r.render,staticRenderFns:r.staticRenderFns}})(Zs).compileToFunctions),ac=v(function(e){var t=Jt(e);return t&&t.innerHTML}),sc=Ot.prototype.$mount;return Ot.prototype.$mount=function(e,t){if((e=e&&Jt(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=ac(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=ki(e));if(r){var i=oc(r,{shouldDecodeNewlines:ns,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return sc.call(this,e,t)},Ot.compile=oc,Ot});
(function ($, window) {
	$.kladr = {};

	(function () {
		var protocol = window.location.protocol == 'https:' ? 'https:' : 'http:';

		/**
		 * URL сервиса
		 *
		 * @type {string}
		 */
	  //  $.kladr.url = protocol + '//kladr-api.ru/api.php'; //КЛАДР-api
		$.kladr.url = '/kladrapi';
	})();

	/**
	 * Перечисление типов объектов
	 *
	 * @type {{region: string, district: string, city: string, street: string, building: string}}
	 */
	$.kladr.type = {
		region:   'region',   // Область
		district: 'district', // Район
        village: 'village', // Населенный пункт
		city:     'city',     // Город
		street:   'street',   // Улица
		building: 'building'  // Строение
	};

	/**
	 * Перечисление типов населённых пунктов
	 *
	 * @type {{city: number, settlement: number, village: number}}
	 */
	$.kladr.typeCode = {
		city:       1, // Город
		settlement: 2, // Посёлок
		village:    4  // Деревня
	};

	/**
	 * Проверяет корректность запроса
	 *
	 * @param {{}} query Запрос
	 * @returns {boolean}
	 */
	$.kladr.validate = function (query) {
	    var type = $.kladr.type;

		switch (query.type) {
			case type.region:
		    case type.district:
		    case type.village:
			case type.city:
				if (query.parentType && !query.parentId) {
					error('parentId undefined');
					return false;
				}
				break;
			case type.street:
				
			    if (query.parentType != type.city && query.parentType != type.village) {
					error('parentType must equal "city" or "village"');
					return false;
				}
				if (!query.parentId) {
					error('parentId undefined');
					return false;
				}
				break;
		    case type.building:
		        if (query.parentType != type.street) {
		            error('parentType must equal "street"');
		            return false;
		        }
				if (!query.zip) {
					if (!~$.inArray(query.parentType, [type.street, type.city])) {
						error('parentType must equal "street" or "city"');
						return false;
					}
					if (!query.parentId) {
						error('parentId undefined');
						return false;
					}
				}
				break;
			default:
				if (!query.oneString) {
					error('type incorrect');
					return false;
				}
				break;
		}

		if (query.oneString && query.parentType && !query.parentId) {
			error('parentId undefined');
			return false;
		}

		if (query.typeCode && (query.type != type.city)) {
			error('type must equal "city"');
			return false;
		}

		if (query.limit < 1) {
			error('limit must greater than 0');
			return false;
		}

		return true;
	};

	/**
	 * Отправляет запрос к сервису
	 *
	 * @param {{}} query Запрос
	 * @param {Function} callback Функция, которой будет передан массив полученных объектов
	 */
	$.kladr.api = function (query, callback) {
		if (!callback) {
			error('Callback undefined');
			return;
		}

		if (!$.kladr.validate(query)) {
			callback([]);
			return;
		}

		var timeout = setTimeout(function () {
			callback([]);
			timeout = null;
		}, 3000);
        $.ajax({
             //url: $.kladr.url + '?callback=?', //КЛАДР-api
            url: $.kladr.url + '/' + getActionName(query.type) + '?',
            type: 'get',
            data: toApiFormat(query),
            cache: false,
            dataType: 'json'
        }).done(function (data) {
            if (timeout) {
                callback(data.result || []);
                clearTimeout(timeout);
            }
        });
	};

	/**
	 * Проверяет существование объекта, соответствующего запросу
	 *
	 * @param {{}} query Запрос
	 * @param {Function} callback Функция, которой будет передан объект, если он существует, или
	 * false если не существует.
	 */
	$.kladr.check = function (query, callback) {
		if (!callback) {
			error('Callback undefined');
			return;
		}

		query.withParents = false;
		query.limit = 1;

		$.kladr.api(query, function (objs) {
			objs && objs.length
				? callback(objs[0])
				: callback(false);
		});
	};

	function getActionName(type)
	{
	    switch (type) {
	        case 'region':
	            return 'GetRegions';
	        case 'district':
	            return 'GetDistricts';
	        case 'village':
	            return 'GetVillages';
	        case 'city':
	            return 'GetCities';
	        case 'street':
	            return 'GetStreets';
	        case 'building':
	            return 'GetHouses';
	    }

	    return '';
	}

	/**
	 * Преобразует запрос из формата принятого в плагине в формат сервиса
	 *
	 * @param {{}} query Запрос в формате плагина
	 * @returns {{}} Запрос в формате сервиса
	 */
	function toApiFormat(query) {
		var params = {},
			fields = {
				type:        'contentType',
				name:        'query',
				withParents: 'withParent'
			};

		if (query.parentType && query.parentId) {
			params[query.parentType + 'Id'] = query.parentId;
		}

		for (var key in query) {
			if (hasOwn(query, key) && query[key]) {
				params[hasOwn(fields, key) ? fields[key] : key] = query[key];
			}
		}

		return params;
	}

	/**
	 * Проверяет принадлежит ли объекту свойство
	 *
	 * @param {{}} obj Объект
	 * @param {string} property Свойство
	 * @returns {boolean}
	 */
	function hasOwn(obj, property) {
		return obj.hasOwnProperty(property);
	}

	/**
	 * Выводит ошибку на консоль
	 *
	 * @param {string} error Текст ошибки
	 */
	function error(error) {	
	    console.log(error);
	}
})(jQuery, window);
(function ($, window, document, undefined) {

	/**
	 * Список значений параметров плагина по умолчанию
	 *
	 * @type {{token: null, key: null, type: null, typeCode: null, parentType: null, parentId: null, limit: number, oneString: boolean, withParents: boolean, parentInput: null, verify: boolean, spinner: boolean, open: null, close: null, send: null, receive: null, select: null, check: null, change: null, openBefore: null, closeBefore: null, sendBefore: null, selectBefore: null, checkBefore: null, source: Function, labelFormat: Function, valueFormat: Function, showSpinner: Function, hideSpinner: Function}}
	 */
	var defaultOptions = {

		token: null,        // Токен для доступа к сервису
		key: null,          // Ключ для доступа к сервису
		type: null,         // Тип подставляемых объектов
		typeCode: null,     // Тип подставляемых населённых пунктов
		parentType: null,   // Тип родительского объекта
		parentId: null,     // Идентификатор родительского объекта
		limit: 10,          // Количество отображаемых в выпадающем списке объектов
		oneString: false,   // Включить ввод адреса одной строкой
		withParents: false, // Получить объекты вместе с родительскими
		noResultText: null, // Текст для показа в выпадающем списке в случае отсутствия результатов поиска
		checkEmptyRespone: false, // Текст для показа в выпадающем списке в случае отсутствия результатов поиска
		strict: null,  // Включает строгий режим поиска для городов. Если не указан district, то поиск по домам у которых нет district

		parentInput: null, // Селектор для поиска родительских полей ввода
		verify: false,     // Проверять введённые данные
		spinner: true,     // Отображать ajax-крутилку

		open: null,    // Открыт выпадающий список объектов
		close: null,   // Закрыт выпадающий список объектов
		send: null,    // Отправлен запрос к сервису
		receive: null, // Получен ответ от сервиса
		select: null,  // Выбран объект в выпадающем списке
		check: null,   // Проверен введённый пользователем объект
		change: null,  // Изменился объект в поле ввода

		openBefore: null,   // Вызывается перед открытием выпадающего списка
		closeBefore: null,  // Вызывается перед закрытием выпадающего списка
		sendBefore: null,   // Вызывается перед отправкой запроса сервису
		selectBefore: null, // Вызывается перед выбором объекта в списке
		checkBefore: null,  // Вызывается перед проверкой введённого пользователем объекта

		/**
		 * Отправляет запрос сервису
		 *
		 * @param {{}} query
		 * @param {Function} callback
		 */
		source: function (query, callback) {
			$.kladr.api(query, callback);
		},

		/**
		 * Форматирует подписи для объектов в списке
		 *
		 * @param {{}} obj Объект КЛАДР
		 * @param {{}} query Запрос, по которому получен объект
		 * @returns {string}
		 */
		labelFormat: function (obj, query) {
			var objs;

			if (query.oneString) {
				if (obj.parents) {
					objs = [].concat(obj.parents);
					objs.push(obj);

					return $.kladr.buildAddress(objs);
				}

			    //return (obj.typeShort ? obj.typeShort + '. ' : '') + obj.name;
				return obj.name + (obj.typeShort ? obj.typeShort + '. ' : '').replace('..', '.');
			}

			var label = '',
				name,
				objName,
				queryName,
				start;

			//if (obj.typeShort) {
			//	label += obj.typeShort + '. ';
			//}

			name = obj.name;
			objName = name.toLowerCase();
			queryName = query.name.toLowerCase();
			start = objName.indexOf(queryName);
			start = ~start ? start : 0;

			if (queryName.length < objName.length) {
				label += name.substr(0, start);
				label += '<strong>';
				label += name.substr(start, queryName.length);
				label += '</strong>';
				label += name.substr(start + queryName.length);
			} else {
				label += '<strong>' + name + '</strong>';
			}

			if (obj.typeShort) {
			    label += ' ' + (obj.typeShort + '. ').replace('..', '.');
			}

			return label;
		},

		/**
		 * Форматирует подставляемое в поле ввода значение
		 *
		 * @param {{}} obj Объект КЛАДР
		 * @param {{}} query Запрос, по которому получен объект
		 * @returns {string}
		 */
		valueFormat: function (obj, query) {
			var objs;

			if (query.oneString) {
				if (obj.parents) {
					objs = [].concat(obj.parents);
					objs.push(obj);

					return $.kladr.buildAddress(objs);
				}

			    //return (obj.typeShort ? obj.typeShort + '. ' : '') + obj.name;
				return obj.name(obj.typeShort ? obj.typeShort + '. ' : '');
			}

			return obj.name;
		},

		/**
		 * Выводит ajax-крутилку
		 *
		 * @param {{}} $spinner jQuery объект ajax-крутилки
		 */
		showSpinner: function ($spinner) {
			var top = -0.2,
				spinnerInterval = setInterval(function () {
					if (!$spinner.is(':visible')) {
						clearInterval(spinnerInterval);
						spinnerInterval = null;
						return;
					}

					$spinner.css('background-position', '0% ' + top + '%');

					top += 5.555556;

					if (top > 95) {
						top = -0.2;
					}
				}, 30);

			$spinner.show();
		},

		/**
		 * Скрывает ajax-крутилку
		 *
		 * @param {{}} $spinner jQuery объект ajax-крутилки
		 */
		hideSpinner: function ($spinner) {
			$spinner.hide();
		}
	};

	/**
	 * Параметры только для чтения
	 *
	 * @type {{current: null, controller: null}}
	 */
	var readOnlyParams = {
		current: null,   // Текущий, выбранный объект КЛАДР
		controller: null // Контроллер для управления плагином
	};

	/**
	 * Коды отслеживаемых плагином клавиш
	 *
	 * @type {{up: number, down: number, enter: number}}
	 */
	var keys = {
		up: 38,
		down: 40,
		enter: 13
	};

	$.kladr = $.extend($.kladr, {

		/**
		 * Устанавливает значения по умолчанию для параметров плагина
		 *
		 * @param {{}|string} param1
		 * @param {*} param2
		 */
		setDefault: function (param1, param2) {
			var params = readParams(param1, param2);

			if (params.obj) {
				for (var i in params.obj) {
					if (hasOwn(defaultOptions, i)) {
						defaultOptions[i] = params.obj[i];
					}
				}
			}
			else if (params.str && !params.isGet && hasOwn(defaultOptions, params.str[0])) {
				defaultOptions[params.str[0]] = params.str[1];
			}
		},

		/**
		 * Возвращает значение по умолчанию для параметра плагина
		 *
		 * @param {string} param
		 * @returns {*}
		 */
		getDefault: function (param) {
			if (hasOwn(defaultOptions, param)) {
				return defaultOptions[param];
			}
		},

		/**
		 * Возращает jQuery коллекцию полей ввода,
		 * к которым был подключен плагин
		 *
		 * @param {*} selector Селектор, DOM элемент или jQuery объект, ограничивающий поиск полей ввода
		 * @returns {{}} jQuery коллекция полей ввода
		 */
		getInputs: function (selector) {
			var $source = $(selector || document.body),
				inputSelector = '[data-kladr-type]';

			return $source
				.filter(inputSelector)
				.add($source.find(inputSelector));
		},

		/**
		 * Устанавливает значения для полей, к которым
		 * был подключен плагин
		 *
		 * @param {{}|[]} values Список значений
		 * @param {*} selector Селектор, ограничивающий поиск полей ввода
		 */
		setValues: function (values, selector) {
			var changeEvent = 'kladr_change.setvalues',
				types = $.kladr.type,
				filtered = {},
				sorted = {},
				$inputs, t;

			if (!~$.inArray($.type(values), ['object', 'array'])) {
				return;
			}

			$.each(values, function (key, value) {
				if (!value) {
					return;
				}

				var type = value.contentType || value.type || key;

				if (hasOwn(types, type)) {
					filtered[type] = value;
				}
			});

			for (t in types) {
				if (hasOwn(types, t) && filtered[t]) {
					sorted[t] = filtered[t];
				}
			}

			$inputs = $.kladr.getInputs(selector);

			(function set() {
				var $input, type, value;

				for (type in sorted) {
					if (hasOwn(sorted, type)) {
						value = sorted[type];
						delete sorted[type];
						break;
					}
				}

				if (!type) {
					return;
				}

				$input = $inputs.filter('[data-kladr-type="' + type + '"]');

				if (!$input.length) {
					set();
					return;
				}

				$input
					.on(changeEvent, function () {
						$input.off(changeEvent);
						set();
					})
					.kladr('controller')
					.setValue(value);
			})();
		},

		/**
		 * Возвращает собранную на основании полей ввода строку адреса
		 *
		 * @param {*} selector Селектор, ограничивающий поиск полей ввода
		 * @param {Function} build Функция, строящая строку адреса из списка объектов КЛАДР
		 * @returns {string}
		 */
		getAddress: function (selector, build) {
			var $inputs = $.kladr.getInputs(selector),
				types = $.kladr.type,
				filtered = {},
				sorted = {},
				t;

			$inputs.each(function () {
				var $this = $(this),
					obj, objs, i;

				if ($this.attr('data-kladr-id')) {
					obj = $this.kladr('current');

					if ($this.attr('data-kladr-one-string') && obj.parents) {
						objs = [].concat(obj.parents);
						objs.push(obj);

						for (i = 0; i < objs.length; i++) {
							filtered[objs[i].contentType] = objs[i];
						}
					}
					else {
						filtered[$this.attr('data-kladr-type')] = obj;
					}
				}
				else {
					filtered[$this.attr('data-kladr-type')] = $this.val();
				}
			});

			for (t in types) {
				if (hasOwn(types, t) && filtered[t]) {
					sorted[t] = filtered[t];
				}
			}

			return (build || $.kladr.buildAddress)(sorted);
		},

		/**
		 * Строит строку адреса на основании списка объектов КЛАДР
		 *
		 * @param {{}|[]} objs Список объектов КЛАДР
		 * @returns {string}
		 */
		buildAddress: function (objs) {
			var lastIds = [],
				address = '',
				zip = '';

			$.each(objs, function (i, obj) {
				var name = '',
					type = '',
					j;

				if ($.type(obj) === 'object') {
					for (j = 0; j < lastIds.length; j++) {
						if (lastIds[j] == obj.id) {
							return;
						}
					}

					lastIds.push(obj.id);

					name = obj.name;
					type = (obj.typeShort + '. ').replace('..', '.');
					zip = obj.zip || zip;
				}
				else {
					name = obj;
				}

				if (address) address += ', ';
				address += type + name;
			});

			address = (zip ? zip + ', ' : '') + address;

			return address;
		}
	});

	$.fn.kladr = function (param1, param2) {
		var params = readParams(param1, param2),
			result = null;

		this.each(function () {
			var res = kladr($(this), params);

			if (params.isGet) {
				result = res;
				return false;
			}
		});

		if (params.isGet) {
			return result;
		}

		return this;
	};

	/**
	 * Подключает плагин к полю ввода
	 *
	 * @param {{}} $input jQuery объект поля ввода
	 * @param {{}} params Объект параметров
	 * @returns {*}
	 */
	function kladr($input, params) {

		/**
		 * Хранилище параметров плагина
		 *
		 * @type {{}}
		 */
		var options = (function () {
			var dataKey = 'kladr-data',
				data = $input.data(dataKey);

			if (!data) {
				data = $.extend({}, defaultOptions, readOnlyParams);
				$input.data(dataKey, data);
			}

			return {

				/**
				 * Устанавливает значение публичному параметру плагина
				 *
				 * @param {{}} params
				 */
				set: function (params) {
					if (params.obj) {
						for (var i in params.obj) {
							if (hasOwn(params.obj, i) && hasOwn(defaultOptions, i)) {
								data[i] = params.obj[i];
							}
						}
					}
					else if (params.str && !params.isGet && hasOwn(defaultOptions, params.str[0])) {
						data[params.str[0]] = params.str[1];
					}

					$input.data(dataKey, data);
				},

				/**
				 * Возвращает значение публичного параметра плагина
				 *
				 * @param {string} param
				 * @returns {*}
				 */
				get: function (param) {
					if (hasOwn(defaultOptions, param) || hasOwn(readOnlyParams, param)) {
						return data[param];
					}
				},

				/**
				 * Устанавливает значение параметра плагина
				 *
				 * @param {string} param
				 * @param {*} value
				 * @private
				 */
				_set: function (param, value) {
					data[param] = value;
					$input.data(dataKey, data);
				},

				/**
				 * Возвращает значение параметра плагина
				 *
				 * @param {string} param
				 * @returns {*}
				 * @private
				 */
				_get: function (param) {
					if (hasOwn(data, param)) {
						return data[param];
					}
				}
			};
		})();

		/**
		 * Инициализирует плагин
		 *
		 * @param {{}} params Объект параметров
		 * @param {Function} callback Функция, выполняемая после инициализации
		 * @returns {*}
		 */
		function init(params, callback) {
			if (params.isGet) {
				return options.get(params.str[0]);
			}

			options.set(params);
			callback();
		}

		return init(params, function () {
			var $ac = null, // jQuery объект выпадающего списка
				$spinner = null, // jQuery объект ajax-крутилки
				successSearch = false, // Состояние последнего запроса
				eventNamespace = '.kladr', // Пространство имён событий, на которые подписывается плагин
				triggerChangeFlag = 'kladrInputChange'; // Флаг, включающий эмуляцию события change для поля ввода

			create(function () {
				var isActive = false,   // Поле ввода активно
					canCheck = true,    // Поле ввода можно проверить
					lastChangeVal = ''; // Значение поля ввода при последнем событии change

				$input
					.attr('data-kladr-type', get('type') || '')
					.attr('data-kladr-one-string', get('oneString') || null)
					.on('keyup' + eventNamespace, open)
					.on('keydown' + eventNamespace, keySelect)
					.on('blur' + eventNamespace, function () {
						if (!isActive && $input.data(triggerChangeFlag) && (lastChangeVal != $input.val())) {
							$input.change();
						}
					})
					.on('blur' + eventNamespace + ' change' + eventNamespace, function (event) {
						if (isActive) return;

						if (event.type == 'change') {
							lastChangeVal = $input.val();
						}
						check();
						//if (canCheck) {
						//	canCheck = false;
						//	check();
						//}
						if(!successSearch && defaultOptions.checkEmptyRespone) { // Если запрос был неуспешных, т.е. не вернулись данные с сервера, то очищаем input  c вводом
							$input.val('');
						}
						close();
						return false;
					})
					.on('focus' + eventNamespace, function () {
						canCheck = true;
					});

				$ac
					.on('touchstart' + eventNamespace + ' mousedown' + eventNamespace, 'li, a', function (event) {
						event.preventDefault();

						isActive = true;
						mouseSelect(this);
						isActive = false;
					});

				$(window)
					.on('resize' + eventNamespace, position);
			});

			/**
			 * Создаёт DOM элементы плагина
			 *
			 * @param {Function} callback
			 */
			function create(callback) {
				var $container = $(document.getElementById('kladr_autocomplete'));

				if (!$container.length) {
					$container = $('<div id="kladr_autocomplete"></div>').appendTo(document.body);
				}

				var guid = get('guid');

				if (guid) {
					$ac = $container.find('.autocomplete' + guid);
					$spinner = $container.find('.spinner' + guid);

					$(window).off(eventNamespace);
					$input.off(eventNamespace);
					$ac.off(eventNamespace);
				}
				else {
					guid = getGuid();
					set('guid', guid);

					$input.attr('autocomplete', 'off');

					$ac = $('<ul class="autocomplete' + guid + ' autocomplete" style="display: none;"></ul>')
						.appendTo($container);

					$spinner = $('<div class="spinner' + guid + ' spinner" style="display: none;"></div>')
						.appendTo($container);

					createController();

					position();
					checkAutoFill();
				}

				callback();
			}

			/**
			 * Заполняет выпадающий список
			 *
			 * @param {[]} objs Массив объектов КЛАДР
			 * @param {{}} query Объект запроса к сервису
			 */
			function render(objs, query) {
				var obj, value, label, $a;

				$ac.empty();

				for (var i = 0; i < objs.length; i++) {
					obj = objs[i];
					value = get('valueFormat')(obj, query);
					label = get('labelFormat')(obj, query);

					$a = $('<a data-val="' + value + '" data-short-val="' + obj.typeShort + '">' + label + '</a>');
					$a.data('kladr-object', obj);

					$('<li></li>')
						.append($a)
						.appendTo($ac);
				}
			}

			/**
			 * Заполняет выпадающий список сообщением о пустом запросе
			 *
			 */
			function renderEmpty() {
				var obj, value, label, $a;
				$ac.empty();
				value = '';
				label = defaultOptions.noResultText;
				if(label == null || label == '')
					return;
				$a = $('<a data-val="' + value + '">' + label + '</a>');
				$a.data('kladr-object', {});

				$('<li></li>')
					.append($a)
					.appendTo($ac);
			}



			/**
			 * Позиционирует выпадающий список на странице
			 */
			function position() {
				var inputOffset = $input.offset(),
					inputWidth = $input.outerWidth(),
					inputHeight = $input.outerHeight();

				if (!inputOffset) {
					return;
				}

				if ((position.top == inputOffset.top)
					&& (position.left == inputOffset.left)
					&& (position.width == inputWidth)
					&& (position.height == inputHeight)) {
					return;
				}

				position.top = inputOffset.top;
				position.left = inputOffset.left;
				position.width = inputWidth;
				position.height = inputHeight;

				$ac.css({
					top: inputOffset.top + inputHeight + 'px',
					left: inputOffset.left
				});

				var differ = $ac.outerWidth() - $ac.width();
				$ac.width(inputWidth - differ);

				var spinnerWidth = $spinner.width(),
					spinnerHeight = $spinner.height();

				$spinner.css({
					top: inputOffset.top + (inputHeight - spinnerHeight) / 2 - 1,
					left: inputOffset.left + inputWidth - spinnerWidth - 2
				});
			}

			/**
			 * Открывает выпадающий список
			 *
			 * @param {{}} event jQuery объект события
			 */
			function open(event) {
				// return on control keys
				if ((event.which > 8) && (event.which < 46)) {
					return;
				}

				$input.data(triggerChangeFlag, false);

				if (!trigger('open_before')) {
					close();
					return;
				}

				setCurrent(null);

				var name = $input.val();

				if (!$.trim(name)) {
					error(false);
					close();
					return;
				}

				var query = getQuery(name);

				if (!trigger('send_before', query)) {
					close();
					return;
				}

				showSpinner();
				trigger('send');

				get('source')(query, function (objs) {
					trigger('receive', objs);

					if (!$input.is(':focus')) {
						hideSpinner();
						close();
						return;
					}

					if (!$.trim($input.val()) || !objs.length) {
						hideSpinner();
						setCurrent(null);
						renderEmpty();
						position();
						$ac.slideUp(0);
						trigger('open');
						successSearch = false;
						return;
					}
					successSearch = true;
					render(objs, query);
					position();
					hideSpinner();

					$ac.slideDown(50);
					trigger('open');
				});
			}

			/**
			 * Закрывает выпадающий список
			 */
			function close() {
				if (!trigger('close_before')) {
					return;
				}

				$ac.empty().hide();
				trigger('close');
			}

			/**
			 * Осуществляет активацию и выбор элемента выпадающего списка с клавиатуры
			 *
			 * @param {{}} event jQuery объект события
 			 */
			function keySelect(event) {
				var $active = $ac.find('li.active');

				switch (event.which) {
					case keys.up:
						if ($active.length) {
							$active.removeClass('active');
							if ($active.prev().length) $active = $active.prev();
						} else {
							$active = $ac.find('li').last();
						}

						(function () {
							var acScroll = $ac.scrollTop(),
								acOffset = $ac.offset(),
								activeHeight = $active.outerHeight(),
								activeOffset = $active.offset();

							if ((activeOffset.top - acOffset.top) < 0) {
								$ac.scrollTop(acScroll - activeHeight);
							}
						})();

						$active.addClass('active');
						select();
						break;

					case keys.down:
						if ($active.length) {
							$active.removeClass('active');
							if ($active.next().length) $active = $active.next();
						} else {
							$active = $ac.find('li').first();
						}

						if($active.length){
                                                    (function () {
							var acScroll = $ac.scrollTop(),
								acHeight = $ac.height(),
								acOffset = $ac.offset(),
								activeHeight = $active.outerHeight(),
								activeOffset = $active.offset();

							if ((activeOffset.top - acOffset.top + activeHeight) > acHeight) {
								$ac.scrollTop(acScroll + activeHeight);
							}
						    })();
                                                }

						$active.addClass('active');
						select();
						break;

					case keys.enter:
						close();
						break;
				}
			}

			/**
			 * Осуществляет активацию и выбор элемента выпадающего списка мышью
			 *
			 * @param {{}} element DOM элемент, который необходимо выбрать
			 */
			function mouseSelect(element) {
				var $li = $(element);

				if ($li.is('a')) {
					$li = $li.parents('li');
				}

				$li.addClass('active');

				select();
				close();
			}

			/**
			 * Осуществляет выбор активного элемента выпадающего списка
			 */
			function select() {
				if (!trigger('select_before')) {
					return;
				}

				var $a = $ac.find('.active a');
				if (!$a.length) {
					return;
				}

				var prefix = $a.attr('data-short-val');
				prefix = prefix.length > 0 && prefix != 'null' ? ' ' + (prefix + '.').replace('..','.') : '';

				var fullName = $a.attr('data-val')+ prefix;

				$input
					.val(fullName)
					.data(triggerChangeFlag, true);

				error(false);
				setCurrent($a.data('kladr-object'));
				trigger('select', get('current'));
			}

			/**
			 * Проверяет введённое пользователем значение в поле ввода
			 */
			function check() {
				if (!get('verify')) {
					return;
				}

				if (!trigger('check_before')) {
					return;
				}

				var name = $.trim($input.val());

				if (!name) {
					ret(null, false);
					return;
				}

				if (get('current')) {
					error(false);
					return;
				}

				var query = getQuery(name);

				query.withParents = false;
				query.limit = 10;

				if (!trigger('send_before', query)) {
					ret(null, false);
					trigger('check', null);
					return;
				}

				showSpinner();
				trigger('send');

				get('source')(query, function (objs) {
					trigger('receive');

					if (!$.trim($input.val())) {
						ret2(null, false);
						return;
					}

					var nameLowerCase = query.name.toLowerCase(),
						valueLowerCase = null,
						obj = null;

					for (var i = 0; i < objs.length; i++) {
						valueLowerCase = objs[i].name.toLowerCase();

						if (nameLowerCase == valueLowerCase) {
							obj = objs[i];
							break;
						}
					}
                    //Устанавливает значение при вводе + подтверждении
					if (obj) {
					    var inputVal = get('valueFormat')(obj, query);
					    if (obj.typeShort && obj.typeShort.length > 0)
					        inputVal += ' ' + (obj.typeShort + '.').replace('..', '.');

					    $input.val(inputVal);
					}

					ret2(obj, !obj);
					trigger('check', obj);

					function ret2(obj, er) {
						hideSpinner();
						ret(obj, er);
					}
				});

				function ret(obj, er) {
					error(er);
					setCurrent(obj);
				}
			}

			/**
			 * Создаёт контроллер плагина
			 */
			function createController() {
				var controller = {

					/**
					 * Устанавливает значение в поле ввода
					 *
					 * @param {*} value
					 * @returns {{}} Контроллер плагина
					 */
					setValue: function (value) {
						if ($.type(value) === 'object') {
							return controller.setValueByObject(value);
						}

						if ($.type(value) === 'number') {
							return controller.setValueById(value);
						}

						if ($.type(value) === 'string') {
							return controller.setValueByName(value);
						}

						if (!value) {
							return controller.clear();
						}

						return controller;
					},

					/**
					 * Устанавливает значение в поле ввода по названию
					 *
					 * @param {string} name Название объекта КЛАДР
					 * @returns {{}} Контроллер плагина
					 */
					setValueByName: function (name) {
						name = $.trim(name + '');

						if (name) {
							var query = getQuery('');

							query.name = fixName(name);
							query.withParents = false;
							query.limit = 10;

							if (!trigger('send_before', query)) {
								changeValue(null, query);
								return controller;
							}

							lock();
							trigger('send');

							get('source')(query, function (objs) {
								trigger('receive');

								var nameLowerCase = query.name.toLowerCase(),
									valueLowerCase = null,
									obj = null;

								for (var i = 0; i < objs.length; i++) {
									valueLowerCase = objs[i].name.toLowerCase();

									if (nameLowerCase == valueLowerCase) {
										obj = objs[i];
										break;
									}
								}

								changeValue(obj, query);
							});
						}

						return controller;
					},

					/**
					 * Устанавливает значение в поле ввода по идентификатору
					 *
					 * @param {number} id Идентификатор объекта КЛАДР
					 * @returns {{}} Контроллер плагина
					 */
					setValueById: function (id) {
						var query = getQuery('');

						query.parentType = query.type;
						query.parentId = id;
						query.limit = 1;

						lock();

						$.kladr.api(query, function (objs) {
							objs.length
								? changeValue(objs[0], query)
								: changeValue(null, query);
						});

						return controller;
					},

					/**
					 * Устанавливает объект КЛАДР как значение поля ввода
					 *
					 * @param {{}} obj Объект КЛАДР
					 * @returns {{}} Контроллер плагина
					 */
					setValueByObject: function (obj) {
						changeValue(obj, getQuery(''));
						return controller;
					},

					/**
					 * Очищает поле ввода
					 *
					 * @returns {{}} Контроллер плагина
					 */
					clear: function () {
						changeValue(null, null);
						return controller;
					}
				};

				var lockAttr = 'data-kladr-autofill-lock';

				/**
				 * Блокирует поле ввода для изменения функцией checkAutoFill
				 */
				function lock() {
					$input.attr(lockAttr, true);
				}

				/**
				 * Изменяет значение поля ввода
				 *
				 * @param {{}} obj Объект КЛАДР
				 * @param {{}} query Объект запроса к сервису
				 */
				function changeValue(obj, query) {
					obj ? $input.val(get('valueFormat')(obj, query)) : error(true);
					setCurrent(obj);
					$input.removeAttr(lockAttr);
				}

				set('controller', controller);
			}

			/**
			 * Проверяет автоматически установленное при автозаполнении браузером значение
			 */
			function checkAutoFill() {
				var count = 0;

				(function test() {
					if (++count > 5 || isFilled()) {
						return;
					}

					setTimeout(test, 100);
				})();

				function isFilled() {
					var name = $input.val();

					if (name) {
						var query = getQuery(name),
							queryType = query.type,
							queryParentType = query.parentType,
							type = $.kladr.type,
							parentFilled = true,
							setByName = get('controller').setValueByName,
							lock;

						// Костыль для полей ввода улиц
						if (queryType == type.street && queryParentType != type.city) {
							parentFilled = false;
						}

						// Костыль для полей ввода строений
						if (queryType == type.building && !~$.inArray(queryParentType, [type.street, type.city])) {
							parentFilled = false;
						}

						lock = $input.attr('data-kladr-autofill-lock');

						lock && get('current') && parentFilled && setByName(name);
						return !!get('current');
					}

					return false;
				}
			}

			/**
			 * Инициализирует событие плагина
			 *
			 * @param {string} event Имя события
			 * @param {{}} obj Объект передаваемый в событие
			 * @returns {boolean} Выполнить действие идущее после события
			 */
			function trigger(event, obj) {
				if (!event) {
					return true;
				}

				var eventProp = event.replace(/_([a-z])/ig, function (all, letter) {
					return letter.toUpperCase();
				});

				$input.trigger('kladr_' + event, obj);
				
				if ($.type(get(eventProp)) === 'function') {
					return get(eventProp).call($input.get(0), obj) !== false;
				}

				return true;
			}

			/**
			 * Отображает ajax-крутилку
			 */
			function showSpinner() {
				if (get('spinner')) {
					get('showSpinner')($spinner);
				}
			}

			/**
			 * Скрывает ajax-крутилку
			 */
			function hideSpinner() {
				if (get('spinner')) {
					get('hideSpinner')($spinner);
				}
			}

			/**
			 * Генерирует запрос к сервису
			 *
			 * @param {string} name Введённое в поле ввода пользователем значение
			 * @returns {{}}
			 */
			function getQuery(name) {
				var query = {},
					fields = [
						'token',
						'key',
						'type',
						'typeCode',
						'parentType',
						'parentId',
						'oneString',
						'withParents',
						'limit',
						'strict'
					],
					i;

				for (i = 0; i < fields.length; i++) {
					query[fields[i]] = get(fields[i]);
				}

				query.name = fixName(name);

				var parentInput = get('parentInput'),
					parent;

				if (parentInput) {
					parent = getParent(parentInput, query.type);

					if (parent) {
						query.parentType = parent.type;
						query.parentId = parent.id;
					}
				}

				// Костыль для поиска одной строкой
				if (query.oneString) {
					query.withParents = true;
				}

				return query;
			}

			/**
			 * Возвращает тип и идентификатор ближайшего родительского объекта
			 * среди заполненных пользователем полей ввода на странице
			 *
			 * @param {*} selector Селектор для ограничения поиска полей ввода
			 * @param {string} type Тип объектов в текущем поле ввода
			 * @returns {{}}
			 */
			function getParent(selector, type) {
				var $inputs = $.kladr.getInputs(selector),
					types = $.kladr.type,
					parents = {},
					parent = null,
					t;

				$inputs.each(function () {
					var $this = $(this),
						id;

					if (id = $this.attr('data-kladr-id')) {
						parents[$this.attr('data-kladr-type')] = id;
					}
				});

				for (t in types) {
					if (t == type) {
						return parent;
					}

					if (hasOwn(types, t) && parents[t]) {
						parent = {
							type: t,
							id: parents[t]
						}
					}
				}

				return parent;
			}

			/**
			 * Отображает ошибку при некорректном вводе
			 *
			 * @param {string} name Введённое пользователем значение
			 * @returns {string}
			 */
			function fixName(name) {
				var noCorrect = 'abcdefghijklmnopqrstuvwxyz',
					testName = name.toLowerCase();

				for (var i = 0; i < testName.length; i++) {
					if (~noCorrect.indexOf(testName[i])) {
						error(true);
						return name;
					}
				}

				error(false);
				return name;
			}

			/**
			 * Устанавливает текущий объект КЛАДР
			 *
			 * @param {{}} obj
			 */
			function setCurrent(obj) {
				var curr = get('current');

				if ((curr && curr.id) === (obj && obj.id)) {
					return;
				}

				set('current', obj);

				if (obj && obj.id) {
					$input.attr('data-kladr-id', obj.id);
				} else {
					$input.removeAttr('data-kladr-id');
				}

				if (get('oneString')) {
					if (obj && obj.contentType) {
						$input.attr('data-kladr-type', obj.contentType);
					}
				}

				if (obj)
				{
				    ///Проставляет код объекта для проверки на сервере
				    var $inputCode = $input.closest('form').find('input[name="' + $input.attr('name') + 'Code"]');
				    if ($inputCode && obj.id)
				        $inputCode.val(obj.id);

				    ///Проставляем индекс для пустого поля при заполнении дома
				    var $zip = $input.closest('.form__line').siblings('.form__line').find('[name$=ZipCode]');

				    if ($zip.length) {
				        if (!$zip.val() && obj.contentType == 'building' && obj.zip)
				        {
				            $zip.val(obj.zip);
				            $zip.valid();
				        }
				    }
				}
				else {
				    if ($input) {				        
				        var $inputCode = $input.closest('form').find('input[name="' + $input.attr('name') + 'Code"]');

				        if ($inputCode) {
				            $inputCode.val('');
				        }
				    }
				}

				trigger('change', obj);
			}

			/**
			 * Управляет выводом ошибки в поле ввода
			 *
			 * @param {boolean} error Если true, то вывести ошибку. Если false, то снять.
			 */
			function error(error) {
				error
					? $input.addClass('kladr-error')
					: $input.removeClass('kladr-error');
			}

			/**
			 * Возвращает значение параметра плагина
			 *
			 * @param {string} param
			 * @returns {*}
			 */
			function get(param) {
				return options._get(param);
			}

			/**
			 * Устанавливает значение параметра плагина
			 *
			 * @param {string} param
			 * @param {*} value
			 */
			function set(param, value) {
				options._set(param, value);
			}
		});
	}

	/**
	 * Считывает значение параметров в объект
	 * более удобного для использования формата
	 *
	 * @param {string|{}} param1
	 * @param {*} param2
	 * @returns {{obj: boolean|{}, str: boolean|{}, isGet: boolean}}
	 */
	function readParams(param1, param2) {
		var params = {
			obj: false,
			str: false,
			isGet: false
		};

		if ($.type(param1) === 'object') {
			params.obj = param1;
			return params;
		}

		if ($.type(param1) === 'string') {
			params.str = [param1, param2];
			params.isGet = (param2 === undefined);
		}

		return params;
	}

	/**
	 * Возвращает глобальный уникальный идентификатор
	 *
	 * @returns {number}
	 */
	function getGuid() {
		return getGuid.guid
			? ++getGuid.guid
			: getGuid.guid = 1;
	}

	/**
	 * Проверяет принадлежит ли свойство объекту
	 *
	 * @param {{}} obj
	 * @param {string} property
	 * @returns {boolean}
	 */
	function hasOwn(obj, property) {
		return obj.hasOwnProperty(property);
	}
})(jQuery, window, document);

/*! Hammer.JS - v2.0.8 - 2016-04-23
 * http://hammerjs.github.io/
 *
 * Copyright (c) 2016 Jorik Tangelder;
 * Licensed under the MIT license */
!function(a,b,c,d){"use strict";function e(a,b,c){return setTimeout(j(a,c),b)}function f(a,b,c){return Array.isArray(a)?(g(a,c[b],c),!0):!1}function g(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e<a.length;)b.call(c,a[e],e,a),e++;else for(e in a)a.hasOwnProperty(e)&&b.call(c,a[e],e,a)}function h(b,c,d){var e="DEPRECATED METHOD: "+c+"\n"+d+" AT \n";return function(){var c=new Error("get-stack-trace"),d=c&&c.stack?c.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",f=a.console&&(a.console.warn||a.console.log);return f&&f.call(a.console,e,d),b.apply(this,arguments)}}function i(a,b,c){var d,e=b.prototype;d=a.prototype=Object.create(e),d.constructor=a,d._super=e,c&&la(d,c)}function j(a,b){return function(){return a.apply(b,arguments)}}function k(a,b){return typeof a==oa?a.apply(b?b[0]||d:d,b):a}function l(a,b){return a===d?b:a}function m(a,b,c){g(q(b),function(b){a.addEventListener(b,c,!1)})}function n(a,b,c){g(q(b),function(b){a.removeEventListener(b,c,!1)})}function o(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1}function p(a,b){return a.indexOf(b)>-1}function q(a){return a.trim().split(/\s+/g)}function r(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;d<a.length;){if(c&&a[d][c]==b||!c&&a[d]===b)return d;d++}return-1}function s(a){return Array.prototype.slice.call(a,0)}function t(a,b,c){for(var d=[],e=[],f=0;f<a.length;){var g=b?a[f][b]:a[f];r(e,g)<0&&d.push(a[f]),e[f]=g,f++}return c&&(d=b?d.sort(function(a,c){return a[b]>c[b]}):d.sort()),d}function u(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g<ma.length;){if(c=ma[g],e=c?c+f:b,e in a)return e;g++}return d}function v(){return ua++}function w(b){var c=b.ownerDocument||b;return c.defaultView||c.parentWindow||a}function x(a,b){var c=this;this.manager=a,this.callback=b,this.element=a.element,this.target=a.options.inputTarget,this.domHandler=function(b){k(a.options.enable,[a])&&c.handler(b)},this.init()}function y(a){var b,c=a.options.inputClass;return new(b=c?c:xa?M:ya?P:wa?R:L)(a,z)}function z(a,b,c){var d=c.pointers.length,e=c.changedPointers.length,f=b&Ea&&d-e===0,g=b&(Ga|Ha)&&d-e===0;c.isFirst=!!f,c.isFinal=!!g,f&&(a.session={}),c.eventType=b,A(a,c),a.emit("hammer.input",c),a.recognize(c),a.session.prevInput=c}function A(a,b){var c=a.session,d=b.pointers,e=d.length;c.firstInput||(c.firstInput=D(b)),e>1&&!c.firstMultiple?c.firstMultiple=D(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=E(d);b.timeStamp=ra(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=I(h,i),b.distance=H(h,i),B(c,b),b.offsetDirection=G(b.deltaX,b.deltaY);var j=F(b.deltaTime,b.deltaX,b.deltaY);b.overallVelocityX=j.x,b.overallVelocityY=j.y,b.overallVelocity=qa(j.x)>qa(j.y)?j.x:j.y,b.scale=g?K(g.pointers,d):1,b.rotation=g?J(g.pointers,d):0,b.maxPointers=c.prevInput?b.pointers.length>c.prevInput.maxPointers?b.pointers.length:c.prevInput.maxPointers:b.pointers.length,C(c,b);var k=a.element;o(b.srcEvent.target,k)&&(k=b.srcEvent.target),b.target=k}function B(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};b.eventType!==Ea&&f.eventType!==Ga||(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function C(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Ha&&(i>Da||h.velocity===d)){var j=b.deltaX-h.deltaX,k=b.deltaY-h.deltaY,l=F(i,j,k);e=l.x,f=l.y,c=qa(l.x)>qa(l.y)?l.x:l.y,g=G(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g}function D(a){for(var b=[],c=0;c<a.pointers.length;)b[c]={clientX:pa(a.pointers[c].clientX),clientY:pa(a.pointers[c].clientY)},c++;return{timeStamp:ra(),pointers:b,center:E(b),deltaX:a.deltaX,deltaY:a.deltaY}}function E(a){var b=a.length;if(1===b)return{x:pa(a[0].clientX),y:pa(a[0].clientY)};for(var c=0,d=0,e=0;b>e;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:pa(c/b),y:pa(d/b)}}function F(a,b,c){return{x:b/a||0,y:c/a||0}}function G(a,b){return a===b?Ia:qa(a)>=qa(b)?0>a?Ja:Ka:0>b?La:Ma}function H(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function I(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function J(a,b){return I(b[1],b[0],Ra)+I(a[1],a[0],Ra)}function K(a,b){return H(b[0],b[1],Ra)/H(a[0],a[1],Ra)}function L(){this.evEl=Ta,this.evWin=Ua,this.pressed=!1,x.apply(this,arguments)}function M(){this.evEl=Xa,this.evWin=Ya,x.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function N(){this.evTarget=$a,this.evWin=_a,this.started=!1,x.apply(this,arguments)}function O(a,b){var c=s(a.touches),d=s(a.changedTouches);return b&(Ga|Ha)&&(c=t(c.concat(d),"identifier",!0)),[c,d]}function P(){this.evTarget=bb,this.targetIds={},x.apply(this,arguments)}function Q(a,b){var c=s(a.touches),d=this.targetIds;if(b&(Ea|Fa)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=s(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return o(a.target,i)}),b===Ea)for(e=0;e<f.length;)d[f[e].identifier]=!0,e++;for(e=0;e<g.length;)d[g[e].identifier]&&h.push(g[e]),b&(Ga|Ha)&&delete d[g[e].identifier],e++;return h.length?[t(f.concat(h),"identifier",!0),h]:void 0}function R(){x.apply(this,arguments);var a=j(this.handler,this);this.touch=new P(this.manager,a),this.mouse=new L(this.manager,a),this.primaryTouch=null,this.lastTouches=[]}function S(a,b){a&Ea?(this.primaryTouch=b.changedPointers[0].identifier,T.call(this,b)):a&(Ga|Ha)&&T.call(this,b)}function T(a){var b=a.changedPointers[0];if(b.identifier===this.primaryTouch){var c={x:b.clientX,y:b.clientY};this.lastTouches.push(c);var d=this.lastTouches,e=function(){var a=d.indexOf(c);a>-1&&d.splice(a,1)};setTimeout(e,cb)}}function U(a){for(var b=a.srcEvent.clientX,c=a.srcEvent.clientY,d=0;d<this.lastTouches.length;d++){var e=this.lastTouches[d],f=Math.abs(b-e.x),g=Math.abs(c-e.y);if(db>=f&&db>=g)return!0}return!1}function V(a,b){this.manager=a,this.set(b)}function W(a){if(p(a,jb))return jb;var b=p(a,kb),c=p(a,lb);return b&&c?jb:b||c?b?kb:lb:p(a,ib)?ib:hb}function X(){if(!fb)return!1;var b={},c=a.CSS&&a.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(d){b[d]=c?a.CSS.supports("touch-action",d):!0}),b}function Y(a){this.options=la({},this.defaults,a||{}),this.id=v(),this.manager=null,this.options.enable=l(this.options.enable,!0),this.state=nb,this.simultaneous={},this.requireFail=[]}function Z(a){return a&sb?"cancel":a&qb?"end":a&pb?"move":a&ob?"start":""}function $(a){return a==Ma?"down":a==La?"up":a==Ja?"left":a==Ka?"right":""}function _(a,b){var c=b.manager;return c?c.get(a):a}function aa(){Y.apply(this,arguments)}function ba(){aa.apply(this,arguments),this.pX=null,this.pY=null}function ca(){aa.apply(this,arguments)}function da(){Y.apply(this,arguments),this._timer=null,this._input=null}function ea(){aa.apply(this,arguments)}function fa(){aa.apply(this,arguments)}function ga(){Y.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ha(a,b){return b=b||{},b.recognizers=l(b.recognizers,ha.defaults.preset),new ia(a,b)}function ia(a,b){this.options=la({},ha.defaults,b||{}),this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=a,this.input=y(this),this.touchAction=new V(this,this.options.touchAction),ja(this,!0),g(this.options.recognizers,function(a){var b=this.add(new a[0](a[1]));a[2]&&b.recognizeWith(a[2]),a[3]&&b.requireFailure(a[3])},this)}function ja(a,b){var c=a.element;if(c.style){var d;g(a.options.cssProps,function(e,f){d=u(c.style,f),b?(a.oldCssProps[d]=c.style[d],c.style[d]=e):c.style[d]=a.oldCssProps[d]||""}),b||(a.oldCssProps={})}}function ka(a,c){var d=b.createEvent("Event");d.initEvent(a,!0,!0),d.gesture=c,c.target.dispatchEvent(d)}var la,ma=["","webkit","Moz","MS","ms","o"],na=b.createElement("div"),oa="function",pa=Math.round,qa=Math.abs,ra=Date.now;la="function"!=typeof Object.assign?function(a){if(a===d||null===a)throw new TypeError("Cannot convert undefined or null to object");for(var b=Object(a),c=1;c<arguments.length;c++){var e=arguments[c];if(e!==d&&null!==e)for(var f in e)e.hasOwnProperty(f)&&(b[f]=e[f])}return b}:Object.assign;var sa=h(function(a,b,c){for(var e=Object.keys(b),f=0;f<e.length;)(!c||c&&a[e[f]]===d)&&(a[e[f]]=b[e[f]]),f++;return a},"extend","Use `assign`."),ta=h(function(a,b){return sa(a,b,!0)},"merge","Use `assign`."),ua=1,va=/mobile|tablet|ip(ad|hone|od)|android/i,wa="ontouchstart"in a,xa=u(a,"PointerEvent")!==d,ya=wa&&va.test(navigator.userAgent),za="touch",Aa="pen",Ba="mouse",Ca="kinect",Da=25,Ea=1,Fa=2,Ga=4,Ha=8,Ia=1,Ja=2,Ka=4,La=8,Ma=16,Na=Ja|Ka,Oa=La|Ma,Pa=Na|Oa,Qa=["x","y"],Ra=["clientX","clientY"];x.prototype={handler:function(){},init:function(){this.evEl&&m(this.element,this.evEl,this.domHandler),this.evTarget&&m(this.target,this.evTarget,this.domHandler),this.evWin&&m(w(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&n(this.element,this.evEl,this.domHandler),this.evTarget&&n(this.target,this.evTarget,this.domHandler),this.evWin&&n(w(this.element),this.evWin,this.domHandler)}};var Sa={mousedown:Ea,mousemove:Fa,mouseup:Ga},Ta="mousedown",Ua="mousemove mouseup";i(L,x,{handler:function(a){var b=Sa[a.type];b&Ea&&0===a.button&&(this.pressed=!0),b&Fa&&1!==a.which&&(b=Ga),this.pressed&&(b&Ga&&(this.pressed=!1),this.callback(this.manager,b,{pointers:[a],changedPointers:[a],pointerType:Ba,srcEvent:a}))}});var Va={pointerdown:Ea,pointermove:Fa,pointerup:Ga,pointercancel:Ha,pointerout:Ha},Wa={2:za,3:Aa,4:Ba,5:Ca},Xa="pointerdown",Ya="pointermove pointerup pointercancel";a.MSPointerEvent&&!a.PointerEvent&&(Xa="MSPointerDown",Ya="MSPointerMove MSPointerUp MSPointerCancel"),i(M,x,{handler:function(a){var b=this.store,c=!1,d=a.type.toLowerCase().replace("ms",""),e=Va[d],f=Wa[a.pointerType]||a.pointerType,g=f==za,h=r(b,a.pointerId,"pointerId");e&Ea&&(0===a.button||g)?0>h&&(b.push(a),h=b.length-1):e&(Ga|Ha)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var Za={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},$a="touchstart",_a="touchstart touchmove touchend touchcancel";i(N,x,{handler:function(a){var b=Za[a.type];if(b===Ea&&(this.started=!0),this.started){var c=O.call(this,a,b);b&(Ga|Ha)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}}});var ab={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},bb="touchstart touchmove touchend touchcancel";i(P,x,{handler:function(a){var b=ab[a.type],c=Q.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}});var cb=2500,db=25;i(R,x,{handler:function(a,b,c){var d=c.pointerType==za,e=c.pointerType==Ba;if(!(e&&c.sourceCapabilities&&c.sourceCapabilities.firesTouchEvents)){if(d)S.call(this,b,c);else if(e&&U.call(this,c))return;this.callback(a,b,c)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var eb=u(na.style,"touchAction"),fb=eb!==d,gb="compute",hb="auto",ib="manipulation",jb="none",kb="pan-x",lb="pan-y",mb=X();V.prototype={set:function(a){a==gb&&(a=this.compute()),fb&&this.manager.element.style&&mb[a]&&(this.manager.element.style[eb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return g(this.manager.recognizers,function(b){k(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),W(a.join(" "))},preventDefaults:function(a){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=p(d,jb)&&!mb[jb],f=p(d,lb)&&!mb[lb],g=p(d,kb)&&!mb[kb];if(e){var h=1===a.pointers.length,i=a.distance<2,j=a.deltaTime<250;if(h&&i&&j)return}return g&&f?void 0:e||f&&c&Na||g&&c&Oa?this.preventSrc(b):void 0},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var nb=1,ob=2,pb=4,qb=8,rb=qb,sb=16,tb=32;Y.prototype={defaults:{},set:function(a){return la(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=_(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this)?this:(a=_(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=_(a,this),-1===r(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this))return this;a=_(a,this);var b=r(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(b,a)}var c=this,d=this.state;qb>d&&b(c.options.event+Z(d)),b(c.options.event),a.additionalEvent&&b(a.additionalEvent),d>=qb&&b(c.options.event+Z(d))},tryEmit:function(a){return this.canEmit()?this.emit(a):void(this.state=tb)},canEmit:function(){for(var a=0;a<this.requireFail.length;){if(!(this.requireFail[a].state&(tb|nb)))return!1;a++}return!0},recognize:function(a){var b=la({},a);return k(this.options.enable,[this,b])?(this.state&(rb|sb|tb)&&(this.state=nb),this.state=this.process(b),void(this.state&(ob|pb|qb|sb)&&this.tryEmit(b))):(this.reset(),void(this.state=tb))},process:function(a){},getTouchAction:function(){},reset:function(){}},i(aa,Y,{defaults:{pointers:1},attrTest:function(a){var b=this.options.pointers;return 0===b||a.pointers.length===b},process:function(a){var b=this.state,c=a.eventType,d=b&(ob|pb),e=this.attrTest(a);return d&&(c&Ha||!e)?b|sb:d||e?c&Ga?b|qb:b&ob?b|pb:ob:tb}}),i(ba,aa,{defaults:{event:"pan",threshold:10,pointers:1,direction:Pa},getTouchAction:function(){var a=this.options.direction,b=[];return a&Na&&b.push(lb),a&Oa&&b.push(kb),b},directionTest:function(a){var b=this.options,c=!0,d=a.distance,e=a.direction,f=a.deltaX,g=a.deltaY;return e&b.direction||(b.direction&Na?(e=0===f?Ia:0>f?Ja:Ka,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Ia:0>g?La:Ma,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return aa.prototype.attrTest.call(this,a)&&(this.state&ob||!(this.state&ob)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=$(a.direction);b&&(a.additionalEvent=this.options.event+b),this._super.emit.call(this,a)}}),i(ca,aa,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&ob)},emit:function(a){if(1!==a.scale){var b=a.scale<1?"in":"out";a.additionalEvent=this.options.event+b}this._super.emit.call(this,a)}}),i(da,Y,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[hb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime>b.time;if(this._input=a,!d||!c||a.eventType&(Ga|Ha)&&!f)this.reset();else if(a.eventType&Ea)this.reset(),this._timer=e(function(){this.state=rb,this.tryEmit()},b.time,this);else if(a.eventType&Ga)return rb;return tb},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===rb&&(a&&a.eventType&Ga?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=ra(),this.manager.emit(this.options.event,this._input)))}}),i(ea,aa,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&ob)}}),i(fa,aa,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Na|Oa,pointers:1},getTouchAction:function(){return ba.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;return c&(Na|Oa)?b=a.overallVelocity:c&Na?b=a.overallVelocityX:c&Oa&&(b=a.overallVelocityY),this._super.attrTest.call(this,a)&&c&a.offsetDirection&&a.distance>this.options.threshold&&a.maxPointers==this.options.pointers&&qa(b)>this.options.velocity&&a.eventType&Ga},emit:function(a){var b=$(a.offsetDirection);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),i(ga,Y,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ib]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime<b.time;if(this.reset(),a.eventType&Ea&&0===this.count)return this.failTimeout();if(d&&f&&c){if(a.eventType!=Ga)return this.failTimeout();var g=this.pTime?a.timeStamp-this.pTime<b.interval:!0,h=!this.pCenter||H(this.pCenter,a.center)<b.posThreshold;this.pTime=a.timeStamp,this.pCenter=a.center,h&&g?this.count+=1:this.count=1,this._input=a;var i=this.count%b.taps;if(0===i)return this.hasRequireFailures()?(this._timer=e(function(){this.state=rb,this.tryEmit()},b.interval,this),ob):rb}return tb},failTimeout:function(){return this._timer=e(function(){this.state=tb},this.options.interval,this),tb},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==rb&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),ha.VERSION="2.0.8",ha.defaults={domEvents:!1,touchAction:gb,enable:!0,inputTarget:null,inputClass:null,preset:[[ea,{enable:!1}],[ca,{enable:!1},["rotate"]],[fa,{direction:Na}],[ba,{direction:Na},["swipe"]],[ga],[ga,{event:"doubletap",taps:2},["tap"]],[da]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ub=1,vb=2;ia.prototype={set:function(a){return la(this.options,a),a.touchAction&&this.touchAction.update(),a.inputTarget&&(this.input.destroy(),this.input.target=a.inputTarget,this.input.init()),this},stop:function(a){this.session.stopped=a?vb:ub},recognize:function(a){var b=this.session;if(!b.stopped){this.touchAction.preventDefaults(a);var c,d=this.recognizers,e=b.curRecognizer;(!e||e&&e.state&rb)&&(e=b.curRecognizer=null);for(var f=0;f<d.length;)c=d[f],b.stopped===vb||e&&c!=e&&!c.canRecognizeWith(e)?c.reset():c.recognize(a),!e&&c.state&(ob|pb|qb)&&(e=b.curRecognizer=c),f++}},get:function(a){if(a instanceof Y)return a;for(var b=this.recognizers,c=0;c<b.length;c++)if(b[c].options.event==a)return b[c];return null},add:function(a){if(f(a,"add",this))return this;var b=this.get(a.options.event);return b&&this.remove(b),this.recognizers.push(a),a.manager=this,this.touchAction.update(),a},remove:function(a){if(f(a,"remove",this))return this;if(a=this.get(a)){var b=this.recognizers,c=r(b,a);-1!==c&&(b.splice(c,1),this.touchAction.update())}return this},on:function(a,b){if(a!==d&&b!==d){var c=this.handlers;return g(q(a),function(a){c[a]=c[a]||[],c[a].push(b)}),this}},off:function(a,b){if(a!==d){var c=this.handlers;return g(q(a),function(a){b?c[a]&&c[a].splice(r(c[a],b),1):delete c[a]}),this}},emit:function(a,b){this.options.domEvents&&ka(a,b);var c=this.handlers[a]&&this.handlers[a].slice();if(c&&c.length){b.type=a,b.preventDefault=function(){b.srcEvent.preventDefault()};for(var d=0;d<c.length;)c[d](b),d++}},destroy:function(){this.element&&ja(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},la(ha,{INPUT_START:Ea,INPUT_MOVE:Fa,INPUT_END:Ga,INPUT_CANCEL:Ha,STATE_POSSIBLE:nb,STATE_BEGAN:ob,STATE_CHANGED:pb,STATE_ENDED:qb,STATE_RECOGNIZED:rb,STATE_CANCELLED:sb,STATE_FAILED:tb,DIRECTION_NONE:Ia,DIRECTION_LEFT:Ja,DIRECTION_RIGHT:Ka,DIRECTION_UP:La,DIRECTION_DOWN:Ma,DIRECTION_HORIZONTAL:Na,DIRECTION_VERTICAL:Oa,DIRECTION_ALL:Pa,Manager:ia,Input:x,TouchAction:V,TouchInput:P,MouseInput:L,PointerEventInput:M,TouchMouseInput:R,SingleTouchInput:N,Recognizer:Y,AttrRecognizer:aa,Tap:ga,Pan:ba,Swipe:fa,Pinch:ca,Rotate:ea,Press:da,on:m,off:n,each:g,merge:ta,extend:sa,assign:la,inherit:i,bindFn:j,prefixed:u});var wb="undefined"!=typeof a?a:"undefined"!=typeof self?self:{};wb.Hammer=ha,"function"==typeof define&&define.amd?define(function(){return ha}):"undefined"!=typeof module&&module.exports?module.exports=ha:a[c]=ha}(window,document,"Hammer");
//# sourceMappingURL=hammer.min.js.map
var Draft=function(n,t,i){this.options_=n;this.form_=i||$("form");this.agreementField_=this.form_.find('input[name="DataAgreement"]');this.intervalId_;this.insertUrl_="/service/draft/insert";this.updateUrl_="/service/draft/update";this.product_=t;this.initial_=!0;this.statusModel_={dataAgreement:!0};this.draftId_=null;this.errorCount_=0;this.init_()};Draft.prototype.init_=function(){var n=this;n.form_.on("submit",function(){clearInterval(n.intervalId_)});n.intervalId_=setInterval(function(){n.getValues_()},n.options_.delay)};Draft.prototype.getValues_=function(){var n=this,t=n.options_.draftFields,o=n.options_.additionalFields,f=null!=t.name?t.name().trim().replace(/\s+/g," "):n.form_.find('input[name="Name"]').val().trim(),i=null!=t.phone?t.phone().trim():n.form_.find('input[name="Phone"]').val().trim(),r=null!=t.birthDay?t.birthDay():n.form_.find('input[name="BirthDay"]').val(),e=null!=t.email?t.email().trim():n.form_.find('input[name="Email"]').val(),h=n.agreementField_.length>0?n.agreementField_.is(":checked"):!0,c,s,u,l,a;if(i.length==15&&(f.length>0&&f!=n.statusModel_.name||i.length>0&&i!=n.statusModel_.phone||typeof r!="undefined"&&r.length>0&&n.statusModel_.birthDay!=r&&/\d+/.test(r)||typeof e!="undefined"&&e.length>0&&n.statusModel_.email!=e.trim()||n.statusModel_.dataAgreement!=h)){c=n.initial_?n.insertUrl_:n.updateUrl_;s={};for(u in o)l=null!=o[u]?o[u]():n.form_.find('input[name="'+u+'"]').val().trim(),s[u]=l;n.statusModel_.birthDay=r;n.statusModel_.email=e;n.statusModel_.dataAgreement=h;n.statusModel_.name=f;n.statusModel_.phone=i;a={Name:f,Phone:i,DraftId:n.draftId_,Product:n.product_,Fields:s,PageUrl:this.options_.sendPageUrl?window.location.href:"",QueryString:window.location.pathname+window.location.search,TimeZone:GetTimeZoneStamp()};n.errorCount_<n.options_.requestErrorMaxTryCount?n.requestSend_(a,c):clearInterval(n.intervalId_)}};Draft.prototype.requestSend_=function(n,t){var i=this;$.ajax({type:"POST",url:t,data:n,async:!1,success:function(n){n&&n.IsSuccess&&n.DraftId!==null?(i.draftId_=n.DraftId==null?i.draftId_:n.DraftId,i.errorCount_=0,i.initial_=!1):(i.draftId_=null,i.errorCount_++)},error:function(){i.errorCount_++}})}
var RequestAstral=function(n,t,i,r){this.componentRequest_=$(".component_request");this.tabsContent_=$(".tabs__content_send-request");this.requestDtatusError_=this.tabsContent_.find(".request-status_error");this.requestStatusErrorMessage_=this.requestDtatusError_.find(".request-status__text p");this.errorMessageText_=this.requestStatusErrorMessage_.html();this.btnResendRequest_=this.requestDtatusError_.find(".btn_resend-request");this.form_=this.tabsContent_.find("form");this.url_=r;this.classes_=["success","error"];this.animation_;this.SuccessAnimation_=n;this.ErrorAnimation_=t;this.LoadingAnimation_=i;this.init_()};RequestAstral.CLASS_SENT="sent";RequestAstral.CLASS_ERROR="error";RequestAstral.CLASS_SUCCESS="success";RequestAstral.CLASS_SENDING="sending";RequestAstral.CLASS_LOADING="loading";RequestAstral.prototype.init_=function(){var n=this;new FormRequestValidationSummary(n.form_);this.attachEvents_()};RequestAstral.prototype.attachEvents_=function(){var n=this;n.form_.find("input[inputfilter]").each(function(){var n=$(this),t=n.attr("inputfilter");n.filter_input({regex:t})});n.form_.find("input[data-mask]").each(function(){var n=$(this),t=n.attr("data-mask");n.mask(t,{placeholder:" ",autoclear:!1})});n.form_.on("submit",function(t){t.preventDefault();var i=$(this),r={HOST:"mkb.ru:443",UNAME_NEW:32,LIDP:window.location.href,NAME:$('input[name="Name"]').val(),PHONE:$('input[name="Phone"]').val(),EMAIL:$('input[name="Email"]').val()};if(i.valid()){if(n.requestStatusErrorMessage_.html(n.errorMessageText_),n.tabsContent_.hasClass(RequestAstral.CLASS_SENDING))return;n.externalSend_(r)}});this.btnResendRequest_.on("click",function(t){var i=n.whichTransitionEvent_();n.tabsContent_.removeClass(RequestAstral.CLASS_SENT+" "+RequestAstral.CLASS_ERROR);n.requestDtatusError_.one(i,function(){n.componentRequest_.trigger("resend")});t.preventDefault()})};RequestAstral.prototype.whichTransitionEvent_=function(){var n,i=document.createElement("fakeelement"),t={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(n in t)if(i.style[n]!==undefined)return t[n]};RequestAstral.prototype.processErrorComplete_=function(n){var t=this.requestStatusErrorMessage_.first();t.length&&t.html(n)};RequestAstral.prototype.onSendFormComplete_=function(n){if(n&&(window.ga||window.yaCounter44195019)){var t=n.attr("data-ga-eventCategory"),i=n.attr("data-ga-eventAction")||"send_form";t&&(window.ga&&window.ga("send","event",t,i),window.yaCounter44195019&&window.yaCounter44195019.reachGoal(t+"_"+i))}};RequestAstral.prototype.internalSend_=function(){var n=this,t=n.form_,r=t.attr("action"),u=t.serialize(),i=t.find(".captcha__btn_refresh");t.data("submitted")===!0?event.preventDefault():(t.data("submitted",!0),MkbRuWeb.sendAsync(r,u,function(){n.tabsContent_.removeClass(FormRequest.CLASS_SENDING);n.tabsContent_.removeClass(FormRequest.CLASS_LOADING);n.animation_&&n.animation_.statusAnimation_&&n.animation_.statusAnimation_.anim_&&n.animation_.statusAnimation_.anim_.destroy();n.tabsContent_.addClass(FormRequest.CLASS_SENT+" "+FormRequest.CLASS_SUCCESS);n.animation_=new n.SuccessAnimation_;n.onSendFormComplete_(t)},function(r){t.data("submitted",!1);typeof r!="undefind"&&n.processErrorComplete_(r);n.tabsContent_.removeClass(FormRequest.CLASS_SENDING);n.tabsContent_.removeClass(FormRequest.CLASS_LOADING);n.tabsContent_.addClass(FormRequest.CLASS_SENT+" "+FormRequest.CLASS_ERROR);n.animation_=new n.ErrorAnimation_;i.length&&(n.processErrorComplete_(r),new MkbRuWeb.captchaRefresh(i,$(".isEnglish").length>0),i.next().valid())}))};RequestAstral.prototype.externalSend_=function(n){var t=this;t.tabsContent_.addClass(RequestAstral.CLASS_SENDING+" "+RequestAstral.CLASS_LOADING);t.animation_=new t.LoadingAnimation_;$.ajax({type:"POST",url:t.url_,dataType:"jsonp",cache:!1,async:!1,data:n,success:function(n){n&&n.response?t.internalSend_():(t.tabsContent_.removeClass(RequestAstral.CLASS_SENDING),t.tabsContent_.removeClass(RequestAstral.CLASS_LOADING),t.tabsContent_.addClass(RequestAstral.CLASS_SENT+" "+RequestAstral.CLASS_ERROR),t.animation_=new t.ErrorAnimation_)},error:function(){t.animation_&&t.animation_.statusAnimation_&&t.animation_.statusAnimation_.anim_&&t.animation_.statusAnimation_.anim_.destroy();t.tabsContent_.removeClass(FormRequest.CLASS_SENDING);t.tabsContent_.removeClass(FormRequest.CLASS_LOADING);t.tabsContent_.addClass(RequestAstral.CLASS_SENT+" "+RequestAstral.CLASS_ERROR);t.animation_=new t.ErrorAnimation_}})}
var GeoLocationManager=function(){this._yaMapsApiGeolocationEnabled=window.yaMapsApiGeolocationEnabled;this.initYmaps_()};GeoLocationManager.prototype.initYmaps_=function(){var n=this,t,r,i;if(!n._yaMapsApiGeolocationEnabled){n.init_();return}t=0;r=5;try{typeof ymaps=="undefined"?i=setInterval(function(){if(t>r){clearInterval(i);return}typeof ymaps!="undefined"?(ymaps.ready(function(){n.init_()}),clearInterval(i)):t++},500):ymaps.ready(function(){n.init_()})}catch(u){console.log(u)}};GeoLocationManager.prototype.init_=function(){var n=this;n.getRegion_();n.setNavCurrentRegion_();n.attachEvents_()};GeoLocationManager.prototype.getRegion_=function(){var n=this,t,i;n._yaMapsApiGeolocationEnabled&&((t=Cookies.get(window.HomeRegionCookieName),t)||(i=ymaps.geolocation,i.get({provider:"yandex",mapStateAutoApply:!0}).then(function(t){if(t){var i=t.geoObjects.get(0);i&&n.setRegion_(i)}})))};GeoLocationManager.prototype.setRegion_=function(n){var r=this,t=n.getLocalities().length?n.getLocalities()[0]:n.getAdministrativeAreas()[0],i=n.getAdministrativeAreas().length?n.getAdministrativeAreas()[0]:null;$.ajax({type:"POST",url:"/homeregion/getbyname",data:{city:t,region:i},cache:!1,async:!0,dataType:"json",success:function(){window.CurrentRegionCoordinates=n.geometry._coordinates;window.CurrentRegionName=n.getAdministrativeAreas()[0];$(document).trigger("region-defined")}})};GeoLocationManager.prototype.setNavCurrentRegion_=function(){var i=this,n=Cookies.get(window.HomeRegionCookieName),t;if(n)t=$.parseJSON(decodeURIComponent(n)),t.RegionSet&&$(".homeregion-nav__opener span").html(i.getDecodedName_(t.Name));else $(document).on("region-defined",function(){if(n=Cookies.get(window.HomeRegionCookieName),n){var t=$.parseJSON(decodeURIComponent(n));t.RegionSet&&$(".homeregion-nav__opener span").html(i.getDecodedName_(t.Name))}})};GeoLocationManager.prototype.attachEvents_=function(){var n=this;$(document).on("set-current-region",function(t,i){n.setRegionByCode_(i)})};GeoLocationManager.prototype.setRegionByCode_=function(n){n&&$.ajax({type:"POST",url:"/homeregion/getbycode",data:{code:n},cache:!1,async:!0,dataType:"json",success:function(n){n.isSuccess&&n.homeRegion&&location.reload()}})};GeoLocationManager.prototype.getDecodedName_=function(n){return n?decodeURIComponent(n).replace(/\+/g," "):""};GeoLocationManager.prototype.getYaMapRegions_=function(){var t=[],n="[";ymaps.ready(function(){ymaps.regions.load("RU").then(function(i){lastCollection=i.geoObjects;lastCollection.each(function(i){t.push(i.properties.get("name"));n+="'"+i.properties.get("name")+"',"});n=n.substr(0,n.length-1)+"]";console.log(n);this.regionYaList_=t})})}
