/* Minification failed. Returning unminified contents.
(174,31619-31626): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,32909-32916): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,33306-33313): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,33326-33333): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,34438-34445): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,34637-34644): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,34699-34706): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,34793-34800): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,35566-35573): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,35677-35684): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,35742-35749): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,36127-36134): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,36338-36345): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,36798-36805): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,36859-36866): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,36991-36998): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,37067-37074): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,37368-37375): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,37414-37421): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,37505-37512): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,37574-37581): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,37856-37863): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,37987-37994): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,38310-38317): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,39297-39304): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,40325-40332): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,40398-40405): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,40888-40895): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,41046-41053): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,41107-41114): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,41182-41189): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,41448-41455): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,41527-41534): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,41624-41631): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,41673-41680): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,41993-42000): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,42517-42524): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,42772-42779): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,43137-43144): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,43316-43323): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,43363-43370): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,43457-43464): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,43549-43556): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,43714-43721): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,43782-43789): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,43855-43862): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,44121-44128): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,44192-44199): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,44287-44294): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,44407-44414): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,44618-44625): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,45119-45126): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,45480-45487): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,46808-46815): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
(174,47024-47031): run-time error JS1137: 'default' is a new reserved word and should not be used as an identifier: default
 */
/*
 * International Telephone Input v10.0.0
 * https://github.com/jackocnr/intl-tel-input.git
 * Licensed under the MIT license
 */
//!function(a){"function"==typeof define&&define.amd?define(["jquery"],function(b){a(b,window,document)}):"object"==typeof module&&module.exports?module.exports=a(require("jquery"),window,document):a(jQuery,window,document)}(function(a,b,c,d){"use strict";function e(b,c){this.a=a(b),this.b=a.extend({},h,c),this.ns="."+f+g++,this.d=Boolean(b.setSelectionRange),this.e=Boolean(a(b).attr("placeholder"))}var f="intlTelInput",g=1,h={allowDropdown:!0,autoHideDialCode:!0,autoPlaceholder:"polite",customPlaceholder:null,dropdownContainer:"",excludeCountries:[],formatOnDisplay:!0,geoIpLookup:null,initialCountry:"",nationalMode:!0,placeholderNumberType:"MOBILE",onlyCountries:[],preferredCountries:["us","gb"],separateDialCode:!1,utilsScript:""},i={b:38,c:40,d:13,e:27,f:43,A:65,Z:90,j:32,k:9},j=["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"];a(b).on("load",function(){a.fn[f].windowLoaded=!0}),e.prototype={_a:function(){return this.b.nationalMode&&(this.b.autoHideDialCode=!1),this.b.separateDialCode&&(this.b.autoHideDialCode=this.b.nationalMode=!1),this.g=/Android.+Mobile|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),this.g&&(a("body").addClass("iti-mobile"),this.b.dropdownContainer||(this.b.dropdownContainer="body")),this.h=new a.Deferred,this.i=new a.Deferred,this._b(),this._f(),this._h(),this._i(),this._i2(),[this.h,this.i]},_b:function(){this._d(),this._d2(),this._e()},_c:function(a,b,c){b in this.q||(this.q[b]=[]);var d=c||0;this.q[b][d]=a},_c2:function(b,c){var d;for(d=0;d<b.length;d++)b[d]=b[d].toLowerCase();for(this.p=[],d=0;d<k.length;d++)c(a.inArray(k[d].iso2,b))&&this.p.push(k[d])},_d:function(){this.b.onlyCountries.length?this._c2(this.b.onlyCountries,function(a){return a!=-1}):this.b.excludeCountries.length?this._c2(this.b.excludeCountries,function(a){return a==-1}):this.p=k},_d2:function(){this.q={};for(var a=0;a<this.p.length;a++){var b=this.p[a];if(this._c(b.iso2,b.dialCode,b.priority),b.areaCodes)for(var c=0;c<b.areaCodes.length;c++)this._c(b.iso2,b.dialCode+b.areaCodes[c])}},_e:function(){this.preferredCountries=[];for(var a=0;a<this.b.preferredCountries.length;a++){var b=this.b.preferredCountries[a].toLowerCase(),c=this._y(b,!1,!0);c&&this.preferredCountries.push(c)}},_f:function(){this.a.attr("autocomplete","off");var b="intl-tel-input";this.b.allowDropdown&&(b+=" allow-dropdown"),this.b.separateDialCode&&(b+=" separate-dial-code"),this.a.wrap(a("<div>",{"class":b})),this.k=a("<div>",{"class":"flag-container"}).insertBefore(this.a);var c=a("<div>",{"class":"selected-flag"});c.appendTo(this.k),this.l=a("<div>",{"class":"iti-flag"}).appendTo(c),this.b.separateDialCode&&(this.t=a("<div>",{"class":"selected-dial-code"}).appendTo(c)),this.b.allowDropdown?(c.attr("tabindex","0"),a("<div>",{"class":"iti-arrow"}).appendTo(c),this.m=a("<ul>",{"class":"country-list hide"}),this.preferredCountries.length&&(this._g(this.preferredCountries,"preferred"),a("<li>",{"class":"divider"}).appendTo(this.m)),this._g(this.p,""),this.o=this.m.children(".country"),this.b.dropdownContainer?this.dropdown=a("<div>",{"class":"intl-tel-input iti-container"}).append(this.m):this.m.appendTo(this.k)):this.o=a()},_g:function(a,b){for(var c="",d=0;d<a.length;d++){var e=a[d];c+="<li class='country "+b+"' data-dial-code='"+e.dialCode+"' data-country-code='"+e.iso2+"'>",c+="<div class='flag-box'><div class='iti-flag "+e.iso2+"'></div></div>",c+="<span class='country-name'>"+e.name+"</span>",c+="<span class='dial-code'>+"+e.dialCode+"</span>",c+="</li>"}this.m.append(c)},_h:function(){var a=this.a.val();this._af(a)&&!this._isRegionlessNanp(a)?this._v(a,!0):"auto"!==this.b.initialCountry&&(this.b.initialCountry?this._z(this.b.initialCountry.toLowerCase(),!0):(this.j=this.preferredCountries.length?this.preferredCountries[0].iso2:this.p[0].iso2,a||this._z(this.j,!0)),a||this.b.nationalMode||this.b.autoHideDialCode||this.b.separateDialCode||this.a.val("+"+this.s.dialCode)),a&&this._u(a)},_i:function(){this._j(),this.b.autoHideDialCode&&this._l(),this.b.allowDropdown&&this._i1()},_i1:function(){var a=this,b=this.a.closest("label");b.length&&b.on("click"+this.ns,function(b){a.m.hasClass("hide")?a.a.focus():b.preventDefault()});var c=this.l.parent();c.on("click"+this.ns,function(b){!a.m.hasClass("hide")||a.a.prop("disabled")||a.a.prop("readonly")||a._n()}),this.k.on("keydown"+a.ns,function(b){var c=a.m.hasClass("hide");!c||b.which!=i.b&&b.which!=i.c&&b.which!=i.j&&b.which!=i.d||(b.preventDefault(),b.stopPropagation(),a._n()),b.which==i.k&&a._ac()})},_i2:function(){var c=this;this.b.utilsScript?a.fn[f].windowLoaded?a.fn[f].loadUtils(this.b.utilsScript,this.i):a(b).on("load",function(){a.fn[f].loadUtils(c.b.utilsScript,c.i)}):this.i.resolve(),"auto"===this.b.initialCountry?this._i3():this.h.resolve()},_i3:function(){a.fn[f].autoCountry?this.handleAutoCountry():a.fn[f].startedLoadingAutoCountry||(a.fn[f].startedLoadingAutoCountry=!0,"function"==typeof this.b.geoIpLookup&&this.b.geoIpLookup(function(b){a.fn[f].autoCountry=b.toLowerCase(),setTimeout(function(){a(".intl-tel-input input").intlTelInput("handleAutoCountry")})}))},_j:function(){var a=this;this.a.on("keyup"+this.ns,function(){a._v(a.a.val())}),this.a.on("cut"+this.ns+" paste"+this.ns,function(){setTimeout(function(){a._v(a.a.val())})})},_j2:function(a){var b=this.a.attr("maxlength");return b&&a.length>b?a.substr(0,b):a},_l:function(){var b=this;this.a.on("mousedown"+this.ns,function(a){b.a.is(":focus")||b.a.val()||(a.preventDefault(),b.a.focus())}),this.a.on("focus"+this.ns,function(a){b.a.val()||b.a.prop("readonly")||!b.s.dialCode||(b.a.val("+"+b.s.dialCode),b.a.one("keypress.plus"+b.ns,function(a){a.which==i.f&&b.a.val("")}),setTimeout(function(){var a=b.a[0];if(b.d){var c=b.a.val().length;a.setSelectionRange(c,c)}}))});var c=this.a.prop("form");c&&a(c).on("submit"+this.ns,function(){b._removeEmptyDialCode()}),this.a.on("blur"+this.ns,function(){b._removeEmptyDialCode()})},_removeEmptyDialCode:function(){var a=this.a.val(),b="+"==a.charAt(0);if(b){var c=this._m(a);c&&this.s.dialCode!=c||this.a.val("")}this.a.off("keypress.plus"+this.ns)},_m:function(a){return a.replace(/\D/g,"")},_n:function(){this._o();var a=this.m.children(".active");a.length&&(this._x(a),this._ad(a)),this._p(),this.l.children(".iti-arrow").addClass("up")},_o:function(){var c=this;if(this.b.dropdownContainer&&this.dropdown.appendTo(this.b.dropdownContainer),this.n=this.m.removeClass("hide").outerHeight(),!this.g){var d=this.a.offset(),e=d.top,f=a(b).scrollTop(),g=e+this.a.outerHeight()+this.n<f+a(b).height(),h=e-this.n>f;if(this.m.toggleClass("dropup",!g&&h),this.b.dropdownContainer){var i=!g&&h?0:this.a.innerHeight();this.dropdown.css({top:e+i,left:d.left}),a(b).on("scroll"+this.ns,function(){c._ac()})}}},_p:function(){var b=this;this.m.on("mouseover"+this.ns,".country",function(c){b._x(a(this))}),this.m.on("click"+this.ns,".country",function(c){b._ab(a(this))});var d=!0;a("html").on("click"+this.ns,function(a){d||b._ac(),d=!1});var e="",f=null;a(c).on("keydown"+this.ns,function(a){a.preventDefault(),a.which==i.b||a.which==i.c?b._q(a.which):a.which==i.d?b._r():a.which==i.e?b._ac():(a.which>=i.A&&a.which<=i.Z||a.which==i.j)&&(f&&clearTimeout(f),e+=String.fromCharCode(a.which),b._s(e),f=setTimeout(function(){e=""},1e3))})},_q:function(a){var b=this.m.children(".highlight").first(),c=a==i.b?b.prev():b.next();c.length&&(c.hasClass("divider")&&(c=a==i.b?c.prev():c.next()),this._x(c),this._ad(c))},_r:function(){var a=this.m.children(".highlight").first();a.length&&this._ab(a)},_s:function(a){for(var b=0;b<this.p.length;b++)if(this._t(this.p[b].name,a)){var c=this.m.children("[data-country-code="+this.p[b].iso2+"]").not(".preferred");this._x(c),this._ad(c,!0);break}},_t:function(a,b){return a.substr(0,b.length).toUpperCase()==b},_u:function(a){if(this.b.formatOnDisplay&&b.intlTelInputUtils&&this.s){var c=this.b.separateDialCode||!this.b.nationalMode&&"+"==a.charAt(0)?intlTelInputUtils.numberFormat.INTERNATIONAL:intlTelInputUtils.numberFormat.NATIONAL;a=intlTelInputUtils.formatNumber(a,this.s.iso2,c)}a=this._ah(a),this.a.val(a)},_v:function(b,c){b&&this.b.nationalMode&&this.s&&"1"==this.s.dialCode&&"+"!=b.charAt(0)&&("1"!=b.charAt(0)&&(b="1"+b),b="+"+b);var d=this._af(b),e=null,f=this._m(b);if(d){var g=this.q[this._m(d)],h=this.s&&a.inArray(this.s.iso2,g)!=-1,i="+1"==d&&f.length>=4;if((!h||i)&&!this._isRegionlessNanp(f))for(var j=0;j<g.length;j++)if(g[j]){e=g[j];break}}else"+"==b.charAt(0)&&f.length?e="":b&&"+"!=b||(e=this.j);null!==e&&this._z(e,c)},_isRegionlessNanp:function(a){var b=this._m(a).substr(1,3);return j.indexOf(b)>-1},_x:function(a){this.o.removeClass("highlight"),a.addClass("highlight")},_y:function(a,b,c){for(var d=b?k:this.p,e=0;e<d.length;e++)if(d[e].iso2==a)return d[e];if(c)return null;throw new Error("No country data for '"+a+"'")},_z:function(a,b){var c=this.s&&this.s.iso2?this.s:{};this.s=a?this._y(a,!1,!1):{},this.s.iso2&&(this.j=this.s.iso2),this.l.attr("class","iti-flag "+a);var d=a?this.s.name+": +"+this.s.dialCode:"Unknown";if(this.l.parent().attr("title",d),this.b.separateDialCode){var e=this.s.dialCode?"+"+this.s.dialCode:"",f=this.a.parent();c.dialCode&&f.removeClass("iti-sdc-"+(c.dialCode.length+1)),e&&f.addClass("iti-sdc-"+e.length),this.t.text(e)}this._aa(),this.o.removeClass("active"),a&&this.o.find(".iti-flag."+a).first().closest(".country").addClass("active"),b||c.iso2===a||this.a.trigger("countrychange",this.s)},_aa:function(){var a="aggressive"===this.b.autoPlaceholder||!this.e&&(this.b.autoPlaceholder===!0||"polite"===this.b.autoPlaceholder);if(b.intlTelInputUtils&&a&&this.s){var c=intlTelInputUtils.numberType[this.b.placeholderNumberType],d=this.s.iso2?intlTelInputUtils.getExampleNumber(this.s.iso2,this.b.nationalMode,c):"";d=this._ah(d),"function"==typeof this.b.customPlaceholder&&(d=this.b.customPlaceholder(d,this.s)),this.a.attr("placeholder",d)}},_ab:function(a){if(this._z(a.attr("data-country-code")),this._ac(),this._ae(a.attr("data-dial-code"),!0),this.a.focus(),this.d){var b=this.a.val().length;this.a[0].setSelectionRange(b,b)}},_ac:function(){this.m.addClass("hide"),this.l.children(".iti-arrow").removeClass("up"),a(c).off(this.ns),a("html").off(this.ns),this.m.off(this.ns),this.b.dropdownContainer&&(this.g||a(b).off("scroll"+this.ns),this.dropdown.detach())},_ad:function(a,b){var c=this.m,d=c.height(),e=c.offset().top,f=e+d,g=a.outerHeight(),h=a.offset().top,i=h+g,j=h-e+c.scrollTop(),k=d/2-g/2;if(h<e)b&&(j-=k),c.scrollTop(j);else if(i>f){b&&(j+=k);var l=d-g;c.scrollTop(j-l)}},_ae:function(a,b){var c,d=this.a.val();if(a="+"+a,"+"==d.charAt(0)){var e=this._af(d);c=e?d.replace(e,a):a}else{if(this.b.nationalMode||this.b.separateDialCode)return;if(d)c=a+d;else{if(!b&&this.b.autoHideDialCode)return;c=a}}this.a.val(c)},_af:function(b){var c="";if("+"==b.charAt(0))for(var d="",e=0;e<b.length;e++){var f=b.charAt(e);if(a.isNumeric(f)&&(d+=f,this.q[d]&&(c=b.substr(0,e+1)),4==d.length))break}return c},_ag:function(){var a,b=this.a.val(),c=this.s.dialCode;return a=this.b.separateDialCode?"+"+c:c&&"1"==c.charAt(0)&&4==c.length&&c.substr(1)!=b.substr(0,3)?c.substr(1):"",a+b},_ah:function(a){if(this.b.separateDialCode){var b=this._af(a);if(b){null!==this.s.areaCodes&&(b="+"+this.s.dialCode);var c=" "===a[b.length]||"-"===a[b.length]?b.length+1:b.length;a=a.substr(c)}}return this._j2(a)},handleAutoCountry:function(){"auto"===this.b.initialCountry&&(this.j=a.fn[f].autoCountry,this.a.val()||this.setCountry(this.j),this.h.resolve())},destroy:function(){if(this.allowDropdown&&(this._ac(),this.l.parent().off(this.ns),this.a.closest("label").off(this.ns)),this.b.autoHideDialCode){var b=this.a.prop("form");b&&a(b).off(this.ns)}this.a.off(this.ns);var c=this.a.parent();c.before(this.a).remove()},getExtension:function(){return b.intlTelInputUtils?intlTelInputUtils.getExtension(this._ag(),this.s.iso2):""},getNumber:function(a){return b.intlTelInputUtils?intlTelInputUtils.formatNumber(this._ag(),this.s.iso2,a):""},getNumberType:function(){return b.intlTelInputUtils?intlTelInputUtils.getNumberType(this._ag(),this.s.iso2):-99},getSelectedCountryData:function(){return this.s||{}},getValidationError:function(){return b.intlTelInputUtils?intlTelInputUtils.getValidationError(this._ag(),this.s.iso2):-99},isValidNumber:function(){var c=a.trim(this._ag()),d=this.b.nationalMode?this.s.iso2:"";return b.intlTelInputUtils?intlTelInputUtils.isValidNumber(c,d):null},setCountry:function(a){a=a.toLowerCase(),this.l.hasClass(a)||(this._z(a),this._ae(this.s.dialCode,!1))},setNumber:function(a){this._v(a),this._u(a)},handleUtils:function(){b.intlTelInputUtils&&(this.a.val()&&this._u(this.a.val()),this._aa()),this.i.resolve()}},a.fn[f]=function(b){var c=arguments;if(b===d||"object"==typeof b){var g=[];return this.each(function(){if(!a.data(this,"plugin_"+f)){var c=new e(this,b),d=c._a();g.push(d[0]),g.push(d[1]),a.data(this,"plugin_"+f,c)}}),a.when.apply(null,g)}if("string"==typeof b&&"_"!==b[0]){var h;return this.each(function(){var d=a.data(this,"plugin_"+f);d instanceof e&&"function"==typeof d[b]&&(h=d[b].apply(d,Array.prototype.slice.call(c,1))),"destroy"===b&&a.data(this,"plugin_"+f,null)}),h!==d?h:this}},a.fn[f].getCountryData=function(){return k},a.fn[f].loadUtils=function(b,c){a.fn[f].loadedUtilsScript?c&&c.resolve():(a.fn[f].loadedUtilsScript=!0,a.ajax({type:"GET",url:b,complete:function(){a(".intl-tel-input input").intlTelInput("handleUtils")},dataType:"script",cache:!0}))},a.fn[f].version="10.0.0",a.fn[f].defaults=h;for(var k=[["Afghanistan (‫افغانستان‬‎)","af","93"],["Albania (Shqipëri)","al","355"],["Algeria (‫الجزائر‬‎)","dz","213"],["American Samoa","as","1684"],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1264"],["Antigua and Barbuda","ag","1268"],["Argentina","ar","54"],["Armenia (Հայաստան)","am","374"],["Aruba","aw","297"],["Australia","au","61",0],["Austria (Österreich)","at","43"],["Azerbaijan (Azərbaycan)","az","994"],["Bahamas","bs","1242"],["Bahrain (‫البحرين‬‎)","bh","973"],["Bangladesh (বাংলাদেশ)","bd","880"],["Barbados","bb","1246"],["Belarus (Беларусь)","by","375"],["Belgium (België)","be","32"],["Belize","bz","501"],["Benin (Bénin)","bj","229"],["Bermuda","bm","1441"],["Bhutan (འབྲུག)","bt","975"],["Bolivia","bo","591"],["Bosnia and Herzegovina (Босна и Херцеговина)","ba","387"],["Botswana","bw","267"],["Brazil (Brasil)","br","55"],["British Indian Ocean Territory","io","246"],["British Virgin Islands","vg","1284"],["Brunei","bn","673"],["Bulgaria (България)","bg","359"],["Burkina Faso","bf","226"],["Burundi (Uburundi)","bi","257"],["Cambodia (កម្ពុជា)","kh","855"],["Cameroon (Cameroun)","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde (Kabu Verdi)","cv","238"],["Caribbean Netherlands","bq","599",1],["Cayman Islands","ky","1345"],["Central African Republic (République centrafricaine)","cf","236"],["Chad (Tchad)","td","235"],["Chile","cl","56"],["China (中国)","cn","86"],["Christmas Island","cx","61",2],["Cocos (Keeling) Islands","cc","61",1],["Colombia","co","57"],["Comoros (‫جزر القمر‬‎)","km","269"],["Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)","cd","243"],["Congo (Republic) (Congo-Brazzaville)","cg","242"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Côte d’Ivoire","ci","225"],["Croatia (Hrvatska)","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599",0],["Cyprus (Κύπρος)","cy","357"],["Czech Republic (Česká republika)","cz","420"],["Denmark (Danmark)","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1767"],["Dominican Republic (República Dominicana)","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt (‫مصر‬‎)","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea (Guinea Ecuatorial)","gq","240"],["Eritrea","er","291"],["Estonia (Eesti)","ee","372"],["Ethiopia","et","251"],["Falkland Islands (Islas Malvinas)","fk","500"],["Faroe Islands (Føroyar)","fo","298"],["Fiji","fj","679"],["Finland (Suomi)","fi","358",0],["France","fr","33"],["French Guiana (Guyane française)","gf","594"],["French Polynesia (Polynésie française)","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia (საქართველო)","ge","995"],["Germany (Deutschland)","de","49"],["Ghana (Gaana)","gh","233"],["Gibraltar","gi","350"],["Greece (Ελλάδα)","gr","30"],["Greenland (Kalaallit Nunaat)","gl","299"],["Grenada","gd","1473"],["Guadeloupe","gp","590",0],["Guam","gu","1671"],["Guatemala","gt","502"],["Guernsey","gg","44",1],["Guinea (Guinée)","gn","224"],["Guinea-Bissau (Guiné Bissau)","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong (香港)","hk","852"],["Hungary (Magyarország)","hu","36"],["Iceland (Ísland)","is","354"],["India (भारत)","in","91"],["Indonesia","id","62"],["Iran (‫ایران‬‎)","ir","98"],["Iraq (‫العراق‬‎)","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2],["Israel (‫ישראל‬‎)","il","972"],["Italy (Italia)","it","39",0],["Jamaica","jm","1876"],["Japan (日本)","jp","81"],["Jersey","je","44",3],["Jordan (‫الأردن‬‎)","jo","962"],["Kazakhstan (Казахстан)","kz","7",1],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait (‫الكويت‬‎)","kw","965"],["Kyrgyzstan (Кыргызстан)","kg","996"],["Laos (ລາວ)","la","856"],["Latvia (Latvija)","lv","371"],["Lebanon (‫لبنان‬‎)","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya (‫ليبيا‬‎)","ly","218"],["Liechtenstein","li","423"],["Lithuania (Lietuva)","lt","370"],["Luxembourg","lu","352"],["Macau (澳門)","mo","853"],["Macedonia (FYROM) (Македонија)","mk","389"],["Madagascar (Madagasikara)","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania (‫موريتانيا‬‎)","mr","222"],["Mauritius (Moris)","mu","230"],["Mayotte","yt","262",1],["Mexico (México)","mx","52"],["Micronesia","fm","691"],["Moldova (Republica Moldova)","md","373"],["Monaco","mc","377"],["Mongolia (Монгол)","mn","976"],["Montenegro (Crna Gora)","me","382"],["Montserrat","ms","1664"],["Morocco (‫المغرب‬‎)","ma","212",0],["Mozambique (Moçambique)","mz","258"],["Myanmar (Burma) (မြန်မာ)","mm","95"],["Namibia (Namibië)","na","264"],["Nauru","nr","674"],["Nepal (नेपाल)","np","977"],["Netherlands (Nederland)","nl","31"],["New Caledonia (Nouvelle-Calédonie)","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger (Nijar)","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea (조선 민주주의 인민 공화국)","kp","850"],["Northern Mariana Islands","mp","1670"],["Norway (Norge)","no","47",0],["Oman (‫عُمان‬‎)","om","968"],["Pakistan (‫پاکستان‬‎)","pk","92"],["Palau","pw","680"],["Palestine (‫فلسطين‬‎)","ps","970"],["Panama (Panamá)","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru (Perú)","pe","51"],["Philippines","ph","63"],["Poland (Polska)","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar (‫قطر‬‎)","qa","974"],["Réunion (La Réunion)","re","262",0],["Romania (România)","ro","40"],["Russia (Россия)","ru","7",0],["Rwanda","rw","250"],["Saint Barthélemy (Saint-Barthélemy)","bl","590",1],["Saint Helena","sh","290"],["Saint Kitts and Nevis","kn","1869"],["Saint Lucia","lc","1758"],["Saint Martin (Saint-Martin (partie française))","mf","590",2],["Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)","pm","508"],["Saint Vincent and the Grenadines","vc","1784"],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé and Príncipe (São Tomé e Príncipe)","st","239"],["Saudi Arabia (‫المملكة العربية السعودية‬‎)","sa","966"],["Senegal (Sénégal)","sn","221"],["Serbia (Србија)","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1721"],["Slovakia (Slovensko)","sk","421"],["Slovenia (Slovenija)","si","386"],["Solomon Islands","sb","677"],["Somalia (Soomaaliya)","so","252"],["South Africa","za","27"],["South Korea (대한민국)","kr","82"],["South Sudan (‫جنوب السودان‬‎)","ss","211"],["Spain (España)","es","34"],["Sri Lanka (ශ්‍රී ලංකාව)","lk","94"],["Sudan (‫السودان‬‎)","sd","249"],["Suriname","sr","597"],["Svalbard and Jan Mayen","sj","47",1],["Swaziland","sz","268"],["Sweden (Sverige)","se","46"],["Switzerland (Schweiz)","ch","41"],["Syria (‫سوريا‬‎)","sy","963"],["Taiwan (台灣)","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand (ไทย)","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad and Tobago","tt","1868"],["Tunisia (‫تونس‬‎)","tn","216"],["Turkey (Türkiye)","tr","90"],["Turkmenistan","tm","993"],["Turks and Caicos Islands","tc","1649"],["Tuvalu","tv","688"],["U.S. Virgin Islands","vi","1340"],["Uganda","ug","256"],["Ukraine (Україна)","ua","380"],["United Arab Emirates (‫الإمارات العربية المتحدة‬‎)","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["Uzbekistan (Oʻzbekiston)","uz","998"],["Vanuatu","vu","678"],["Vatican City (Città del Vaticano)","va","39",1],["Venezuela","ve","58"],["Vietnam (Việt Nam)","vn","84"],["Wallis and Futuna","wf","681"],["Western Sahara (‫الصحراء الغربية‬‎)","eh","212",1],["Yemen (‫اليمن‬‎)","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Åland Islands","ax","358",1]],l=0;l<k.length;l++){var m=k[l];k[l]={name:m[0],iso2:m[1],dialCode:m[2],priority:m[3]||0,areaCodes:m[4]||null}}});


/*
 * International Telephone Input v12.0.0
 * https://github.com/jackocnr/intl-tel-input.git
 * Licensed under the MIT license
 */
!function (a) { "function" == typeof define && define.amd ? define(["jquery"], function (b) { a(b, window, document) }) : "object" == typeof module && module.exports ? module.exports = a(require("jquery"), window, document) : a(jQuery, window, document) }(function (a, b, c, d) { "use strict"; function e(b, c) { this.a = a(b), this.b = a.extend({}, h, c), this.ns = "." + f + g++, this.d = Boolean(b.setSelectionRange), this.e = Boolean(a(b).attr("placeholder")) } var f = "intlTelInput", g = 1, h = { allowDropdown: !0, autoHideDialCode: !0, autoPlaceholder: "polite", customPlaceholder: null, dropdownContainer: "", excludeCountries: [], formatOnDisplay: !0, geoIpLookup: null, hiddenInput: "", initialCountry: "", nationalMode: !0, onlyCountries: [], placeholderNumberType: "MOBILE", preferredCountries: ["us", "gb"], separateDialCode: !1, utilsScript: "" }, i = { b: 38, c: 40, d: 13, e: 27, f: 43, A: 65, Z: 90, j: 32, k: 9 }, j = ["800", "822", "833", "844", "855", "866", "877", "880", "881", "882", "883", "884", "885", "886", "887", "888", "889"]; a(b).on("load", function () { a.fn[f].windowLoaded = !0 }), e.prototype = { _a: function () { return this.b.nationalMode && (this.b.autoHideDialCode = !1), this.b.separateDialCode && (this.b.autoHideDialCode = this.b.nationalMode = !1), this.g = /Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), this.g && (a("body").addClass("iti-mobile"), this.b.dropdownContainer || (this.b.dropdownContainer = "body")), this.h = new a.Deferred, this.i = new a.Deferred, this.s = {}, this._b(), this._f(), this._h(), this._i(), this._i2(), [this.h, this.i] }, _b: function () { this._d(), this._d2(), this._e() }, _c: function (a, b, c) { b in this.q || (this.q[b] = []); var d = c || 0; this.q[b][d] = a }, _d: function () { if (this.b.onlyCountries.length) { var a = this.b.onlyCountries.map(function (a) { return a.toLowerCase() }); this.p = k.filter(function (b) { return a.indexOf(b.iso2) > -1 }) } else if (this.b.excludeCountries.length) { var b = this.b.excludeCountries.map(function (a) { return a.toLowerCase() }); this.p = k.filter(function (a) { return b.indexOf(a.iso2) === -1 }) } else this.p = k }, _d2: function () { this.q = {}; for (var a = 0; a < this.p.length; a++) { var b = this.p[a]; if (this._c(b.iso2, b.dialCode, b.priority), b.areaCodes) for (var c = 0; c < b.areaCodes.length; c++) this._c(b.iso2, b.dialCode + b.areaCodes[c]) } }, _e: function () { this.preferredCountries = []; for (var a = 0; a < this.b.preferredCountries.length; a++) { var b = this.b.preferredCountries[a].toLowerCase(), c = this._y(b, !1, !0); c && this.preferredCountries.push(c) } }, _f: function () { this.a.attr("autocomplete", "off"); var b = "intl-tel-input"; this.b.allowDropdown && (b += " allow-dropdown"), this.b.separateDialCode && (b += " separate-dial-code"), this.a.wrap(a("<div>", { "class": b })), this.k = a("<div>", { "class": "flag-container" }).insertBefore(this.a); var c = a("<div>", { "class": "selected-flag" }); c.appendTo(this.k), this.l = a("<div>", { "class": "iti-flag" }).appendTo(c), this.b.separateDialCode && (this.t = a("<div>", { "class": "selected-dial-code" }).appendTo(c)), this.b.allowDropdown ? (c.attr("tabindex", "0"), a("<div>", { "class": "iti-arrow" }).appendTo(c), this.m = a("<ul>", { "class": "country-list hide" }), this.preferredCountries.length && (this._g(this.preferredCountries, "preferred"), a("<li>", { "class": "divider" }).appendTo(this.m)), this._g(this.p, ""), this.o = this.m.children(".country"), this.b.dropdownContainer ? this.dropdown = a("<div>", { "class": "intl-tel-input iti-container" }).append(this.m) : this.m.appendTo(this.k)) : this.o = a(), this.b.hiddenInput && (this.hiddenInput = a("<input>", { type: "hidden", name: this.b.hiddenInput }).insertBefore(this.a)) }, _g: function (a, b) { for (var c = "", d = 0; d < a.length; d++) { var e = a[d]; c += "<li class='country " + b + "' data-dial-code='" + e.dialCode + "' data-country-code='" + e.iso2 + "'>", c += "<div class='flag-box'><div class='iti-flag " + e.iso2 + "'></div></div>", c += "<span class='country-name'>" + e.name + "</span>", c += "<span class='dial-code'>+" + e.dialCode + "</span>", c += "</li>" } this.m.append(c) }, _h: function () { var a = this.a.val(); this._af(a) && (!this._isRegionlessNanp(a) || this.b.nationalMode && !this.b.initialCountry) ? this._v(a) : "auto" !== this.b.initialCountry && (this.b.initialCountry ? this._z(this.b.initialCountry.toLowerCase()) : (this.j = this.preferredCountries.length ? this.preferredCountries[0].iso2 : this.p[0].iso2, a || this._z(this.j)), a || this.b.nationalMode || this.b.autoHideDialCode || this.b.separateDialCode || this.a.val("+" + this.s.dialCode)), a && this._u(a) }, _i: function () { this._j(), this.b.autoHideDialCode && this._l(), this.b.allowDropdown && this._i1(), this.hiddenInput && this._initHiddenInputListener() }, _initHiddenInputListener: function () { var a = this, b = this.a.closest("form"); b.length && b.submit(function () { a.hiddenInput.val(a.getNumber()) }) }, _i1: function () { var a = this, b = this.a.closest("label"); b.length && b.on("click" + this.ns, function (b) { a.m.hasClass("hide") ? a.a.focus() : b.preventDefault() }), this.l.parent().on("click" + this.ns, function (b) { !a.m.hasClass("hide") || a.a.prop("disabled") || a.a.prop("readonly") || a._n() }), this.k.on("keydown" + a.ns, function (b) { !a.m.hasClass("hide") || b.which != i.b && b.which != i.c && b.which != i.j && b.which != i.d || (b.preventDefault(), b.stopPropagation(), a._n()), b.which == i.k && a._ac() }) }, _i2: function () { var c = this; this.b.utilsScript ? a.fn[f].windowLoaded ? a.fn[f].loadUtils(this.b.utilsScript, this.i) : a(b).on("load", function () { a.fn[f].loadUtils(c.b.utilsScript, c.i) }) : this.i.resolve(), "auto" === this.b.initialCountry ? this._i3() : this.h.resolve() }, _i3: function () { a.fn[f].autoCountry ? this.handleAutoCountry() : a.fn[f].startedLoadingAutoCountry || (a.fn[f].startedLoadingAutoCountry = !0, "function" == typeof this.b.geoIpLookup && this.b.geoIpLookup(function (b) { a.fn[f].autoCountry = b.toLowerCase(), setTimeout(function () { a(".intl-tel-input input").intlTelInput("handleAutoCountry") }) })) }, _j: function () { var a = this; this.a.on("keyup" + this.ns, function () { a._v(a.a.val()) && a._triggerCountryChange() }), this.a.on("cut" + this.ns + " paste" + this.ns, function () { setTimeout(function () { a._v(a.a.val()) && a._triggerCountryChange() }) }) }, _j2: function (a) { var b = this.a.attr("maxlength"); return b && a.length > b ? a.substr(0, b) : a }, _l: function () { var b = this; this.a.on("mousedown" + this.ns, function (a) { b.a.is(":focus") || b.a.val() || (a.preventDefault(), b.a.focus()) }), this.a.on("focus" + this.ns, function (a) { b.a.val() || b.a.prop("readonly") || !b.s.dialCode || (b.a.val("+" + b.s.dialCode), b.a.one("keypress.plus" + b.ns, function (a) { a.which == i.f && b.a.val("") }), setTimeout(function () { var a = b.a[0]; if (b.d) { var c = b.a.val().length; a.setSelectionRange(c, c) } })) }); var c = this.a.prop("form"); c && a(c).on("submit" + this.ns, function () { b._removeEmptyDialCode() }), this.a.on("blur" + this.ns, function () { b._removeEmptyDialCode() }) }, _removeEmptyDialCode: function () { var a = this.a.val(); if ("+" == a.charAt(0)) { var b = this._m(a); b && this.s.dialCode != b || this.a.val("") } this.a.off("keypress.plus" + this.ns) }, _m: function (a) { return a.replace(/\D/g, "") }, _n: function () { this._o(); var a = this.m.children(".active"); a.length && (this._x(a), this._ad(a)), this._p(), this.l.children(".iti-arrow").addClass("up"), this.a.trigger("open:countrydropdown") }, _o: function () { var c = this; if (this.b.dropdownContainer && this.dropdown.appendTo(this.b.dropdownContainer), this.n = this.m.removeClass("hide").outerHeight(), !this.g) { var d = this.a.offset(), e = d.top, f = a(b).scrollTop(), g = e + this.a.outerHeight() + this.n < f + a(b).height(), h = e - this.n > f; if (this.m.toggleClass("dropup", !g && h), this.b.dropdownContainer) { var i = !g && h ? 0 : this.a.innerHeight(); this.dropdown.css({ top: e + i, left: d.left }), a(b).on("scroll" + this.ns, function () { c._ac() }) } } }, _p: function () { var b = this; this.m.on("mouseover" + this.ns, ".country", function (c) { b._x(a(this)) }), this.m.on("click" + this.ns, ".country", function (c) { b._ab(a(this)) }); var d = !0; a("html").on("click" + this.ns, function (a) { d || b._ac(), d = !1 }); var e = "", f = null; a(c).on("keydown" + this.ns, function (a) { a.preventDefault(), a.which == i.b || a.which == i.c ? b._q(a.which) : a.which == i.d ? b._r() : a.which == i.e ? b._ac() : (a.which >= i.A && a.which <= i.Z || a.which == i.j) && (f && clearTimeout(f), e += String.fromCharCode(a.which), b._s(e), f = setTimeout(function () { e = "" }, 1e3)) }) }, _q: function (a) { var b = this.m.children(".highlight").first(), c = a == i.b ? b.prev() : b.next(); c.length && (c.hasClass("divider") && (c = a == i.b ? c.prev() : c.next()), this._x(c), this._ad(c)) }, _r: function () { var a = this.m.children(".highlight").first(); a.length && this._ab(a) }, _s: function (a) { for (var b = 0; b < this.p.length; b++) if (this._t(this.p[b].name, a)) { var c = this.m.children("[data-country-code=" + this.p[b].iso2 + "]").not(".preferred"); this._x(c), this._ad(c, !0); break } }, _t: function (a, b) { return a.substr(0, b.length).toUpperCase() == b }, _u: function (a) { if (this.b.formatOnDisplay && b.intlTelInputUtils && this.s) { var c = this.b.separateDialCode || !this.b.nationalMode && "+" == a.charAt(0) ? intlTelInputUtils.numberFormat.INTERNATIONAL : intlTelInputUtils.numberFormat.NATIONAL; a = intlTelInputUtils.formatNumber(a, this.s.iso2, c) } a = this._ah(a), this.a.val(a) }, _v: function (b) { b && this.b.nationalMode && "1" == this.s.dialCode && "+" != b.charAt(0) && ("1" != b.charAt(0) && (b = "1" + b), b = "+" + b); var c = this._af(b), d = null, e = this._m(b); if (c) { var f = this.q[this._m(c)], g = a.inArray(this.s.iso2, f) > -1, h = "+1" == c && e.length >= 4; if ((!("1" == this.s.dialCode) || !this._isRegionlessNanp(e)) && (!g || h)) for (var i = 0; i < f.length; i++) if (f[i]) { d = f[i]; break } } else "+" == b.charAt(0) && e.length ? d = "" : b && "+" != b || (d = this.j); return null !== d && this._z(d) }, _isRegionlessNanp: function (b) { var c = this._m(b); if ("1" == c.charAt(0)) { var d = c.substr(1, 3); return a.inArray(d, j) > -1 } return !1 }, _x: function (a) { this.o.removeClass("highlight"), a.addClass("highlight") }, _y: function (a, b, c) { for (var d = b ? k : this.p, e = 0; e < d.length; e++) if (d[e].iso2 == a) return d[e]; if (c) return null; throw new Error("No country data for '" + a + "'") }, _z: function (a) { var b = this.s.iso2 ? this.s : {}; this.s = a ? this._y(a, !1, !1) : {}, this.s.iso2 && (this.j = this.s.iso2), this.l.attr("class", "iti-flag " + a); var c = a ? this.s.name + ": +" + this.s.dialCode : "Unknown"; if (this.l.parent().attr("title", c), this.b.separateDialCode) { var d = this.s.dialCode ? "+" + this.s.dialCode : "", e = this.a.parent(); b.dialCode && e.removeClass("iti-sdc-" + (b.dialCode.length + 1)), d && e.addClass("iti-sdc-" + d.length), this.t.text(d) } return this._aa(), this.o.removeClass("active"), a && this.o.find(".iti-flag." + a).first().closest(".country").addClass("active"), b.iso2 !== a }, _aa: function () { var a = "aggressive" === this.b.autoPlaceholder || !this.e && (this.b.autoPlaceholder === !0 || "polite" === this.b.autoPlaceholder); if (b.intlTelInputUtils && a) { var c = intlTelInputUtils.numberType[this.b.placeholderNumberType], d = this.s.iso2 ? intlTelInputUtils.getExampleNumber(this.s.iso2, this.b.nationalMode, c) : ""; d = this._ah(d), "function" == typeof this.b.customPlaceholder && (d = this.b.customPlaceholder(d, this.s)), this.a.attr("placeholder", d) } }, _ab: function (a) { var b = this._z(a.attr("data-country-code")); if (this._ac(), this._ae(a.attr("data-dial-code"), !0), this.a.focus(), this.d) { var c = this.a.val().length; this.a[0].setSelectionRange(c, c) } b && this._triggerCountryChange() }, _ac: function () { this.m.addClass("hide"), this.l.children(".iti-arrow").removeClass("up"), a(c).off(this.ns), a("html").off(this.ns), this.m.off(this.ns), this.b.dropdownContainer && (this.g || a(b).off("scroll" + this.ns), this.dropdown.detach()), this.a.trigger("close:countrydropdown") }, _ad: function (a, b) { var c = this.m, d = c.height(), e = c.offset().top, f = e + d, g = a.outerHeight(), h = a.offset().top, i = h + g, j = h - e + c.scrollTop(), k = d / 2 - g / 2; if (h < e) b && (j -= k), c.scrollTop(j); else if (i > f) { b && (j += k); var l = d - g; c.scrollTop(j - l) } }, _ae: function (a, b) { var c, d = this.a.val(); if (a = "+" + a, "+" == d.charAt(0)) { var e = this._af(d); c = e ? d.replace(e, a) : a } else { if (this.b.nationalMode || this.b.separateDialCode) return; if (d) c = a + d; else { if (!b && this.b.autoHideDialCode) return; c = a } } this.a.val(c) }, _af: function (b) { var c = ""; if ("+" == b.charAt(0)) for (var d = "", e = 0; e < b.length; e++) { var f = b.charAt(e); if (a.isNumeric(f) && (d += f, this.q[d] && (c = b.substr(0, e + 1)), 4 == d.length)) break } return c }, _ag: function () { var b, c = a.trim(this.a.val()), d = this.s.dialCode, e = this._m(c), f = "1" == e.charAt(0) ? e : "1" + e; return b = this.b.separateDialCode ? "+" + d : "+" != c.charAt(0) && "1" != c.charAt(0) && d && "1" == d.charAt(0) && 4 == d.length && d != f.substr(0, 4) ? d.substr(1) : "", b + c }, _ah: function (a) { if (this.b.separateDialCode) { var b = this._af(a); if (b) { null !== this.s.areaCodes && (b = "+" + this.s.dialCode); var c = " " === a[b.length] || "-" === a[b.length] ? b.length + 1 : b.length; a = a.substr(c) } } return this._j2(a) }, _triggerCountryChange: function () { this.a.trigger("countrychange", this.s) }, handleAutoCountry: function () { "auto" === this.b.initialCountry && (this.j = a.fn[f].autoCountry, this.a.val() || this.setCountry(this.j), this.h.resolve()) }, handleUtils: function () { b.intlTelInputUtils && (this.a.val() && this._u(this.a.val()), this._aa()), this.i.resolve() }, destroy: function () { if (this.allowDropdown && (this._ac(), this.l.parent().off(this.ns), this.a.closest("label").off(this.ns)), this.b.autoHideDialCode) { var b = this.a.prop("form"); b && a(b).off(this.ns) } this.a.off(this.ns), this.a.parent().before(this.a).remove() }, getExtension: function () { return b.intlTelInputUtils ? intlTelInputUtils.getExtension(this._ag(), this.s.iso2) : "" }, getNumber: function (a) { return b.intlTelInputUtils ? intlTelInputUtils.formatNumber(this._ag(), this.s.iso2, a) : "" }, getNumberType: function () { return b.intlTelInputUtils ? intlTelInputUtils.getNumberType(this._ag(), this.s.iso2) : -99 }, getSelectedCountryData: function () { return this.s }, getValidationError: function () { return b.intlTelInputUtils ? intlTelInputUtils.getValidationError(this._ag(), this.s.iso2) : -99 }, isValidNumber: function () { var c = a.trim(this._ag()), d = this.b.nationalMode ? this.s.iso2 : ""; return b.intlTelInputUtils ? intlTelInputUtils.isValidNumber(c, d) : null }, setCountry: function (a) { a = a.toLowerCase(), this.l.hasClass(a) || (this._z(a), this._ae(this.s.dialCode, !1), this._triggerCountryChange()) }, setNumber: function (a) { var b = this._v(a); this._u(a), b && this._triggerCountryChange() } }, a.fn[f] = function (b) { var c = arguments; if (b === d || "object" == typeof b) { var g = []; return this.each(function () { if (!a.data(this, "plugin_" + f)) { var c = new e(this, b), d = c._a(); g.push(d[0]), g.push(d[1]), a.data(this, "plugin_" + f, c) } }), a.when.apply(null, g) } if ("string" == typeof b && "_" !== b[0]) { var h; return this.each(function () { var d = a.data(this, "plugin_" + f); d instanceof e && "function" == typeof d[b] && (h = d[b].apply(d, Array.prototype.slice.call(c, 1))), "destroy" === b && a.data(this, "plugin_" + f, null) }), h !== d ? h : this } }, a.fn[f].getCountryData = function () { return k }, a.fn[f].loadUtils = function (b, c) { a.fn[f].loadedUtilsScript ? c && c.resolve() : (a.fn[f].loadedUtilsScript = !0, a.ajax({ type: "GET", url: b, complete: function () { a(".intl-tel-input input").intlTelInput("handleUtils") }, dataType: "script", cache: !0 })) }, a.fn[f].defaults = h, a.fn[f].version = "12.0.0"; for (var k = [["Afghanistan (‫افغانستان‬‎)", "af", "93"], ["Albania (Shqipëri)", "al", "355"], ["Algeria (‫الجزائر‬‎)", "dz", "213"], ["American Samoa", "as", "1684"], ["Andorra", "ad", "376"], ["Angola", "ao", "244"], ["Anguilla", "ai", "1264"], ["Antigua and Barbuda", "ag", "1268"], ["Argentina", "ar", "54"], ["Armenia (Հայաստան)", "am", "374"], ["Aruba", "aw", "297"], ["Australia", "au", "61", 0], ["Austria (Österreich)", "at", "43"], ["Azerbaijan (Azərbaycan)", "az", "994"], ["Bahamas", "bs", "1242"], ["Bahrain (‫البحرين‬‎)", "bh", "973"], ["Bangladesh (বাংলাদেশ)", "bd", "880"], ["Barbados", "bb", "1246"], ["Belarus (Беларусь)", "by", "375"], ["Belgium (België)", "be", "32"], ["Belize", "bz", "501"], ["Benin (Bénin)", "bj", "229"], ["Bermuda", "bm", "1441"], ["Bhutan (འབྲུག)", "bt", "975"], ["Bolivia", "bo", "591"], ["Bosnia and Herzegovina (Босна и Херцеговина)", "ba", "387"], ["Botswana", "bw", "267"], ["Brazil (Brasil)", "br", "55"], ["British Indian Ocean Territory", "io", "246"], ["British Virgin Islands", "vg", "1284"], ["Brunei", "bn", "673"], ["Bulgaria (България)", "bg", "359"], ["Burkina Faso", "bf", "226"], ["Burundi (Uburundi)", "bi", "257"], ["Cambodia (កម្ពុជា)", "kh", "855"], ["Cameroon (Cameroun)", "cm", "237"], ["Canada", "ca", "1", 1, ["204", "226", "236", "249", "250", "289", "306", "343", "365", "387", "403", "416", "418", "431", "437", "438", "450", "506", "514", "519", "548", "579", "581", "587", "604", "613", "639", "647", "672", "705", "709", "742", "778", "780", "782", "807", "819", "825", "867", "873", "902", "905"]], ["Cape Verde (Kabu Verdi)", "cv", "238"], ["Caribbean Netherlands", "bq", "599", 1], ["Cayman Islands", "ky", "1345"], ["Central African Republic (République centrafricaine)", "cf", "236"], ["Chad (Tchad)", "td", "235"], ["Chile", "cl", "56"], ["China (中国)", "cn", "86"], ["Christmas Island", "cx", "61", 2], ["Cocos (Keeling) Islands", "cc", "61", 1], ["Colombia", "co", "57"], ["Comoros (‫جزر القمر‬‎)", "km", "269"], ["Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)", "cd", "243"], ["Congo (Republic) (Congo-Brazzaville)", "cg", "242"], ["Cook Islands", "ck", "682"], ["Costa Rica", "cr", "506"], ["Côte d’Ivoire", "ci", "225"], ["Croatia (Hrvatska)", "hr", "385"], ["Cuba", "cu", "53"], ["Curaçao", "cw", "599", 0], ["Cyprus (Κύπρος)", "cy", "357"], ["Czech Republic (Česká republika)", "cz", "420"], ["Denmark (Danmark)", "dk", "45"], ["Djibouti", "dj", "253"], ["Dominica", "dm", "1767"], ["Dominican Republic (República Dominicana)", "do", "1", 2, ["809", "829", "849"]], ["Ecuador", "ec", "593"], ["Egypt (‫مصر‬‎)", "eg", "20"], ["El Salvador", "sv", "503"], ["Equatorial Guinea (Guinea Ecuatorial)", "gq", "240"], ["Eritrea", "er", "291"], ["Estonia (Eesti)", "ee", "372"], ["Ethiopia", "et", "251"], ["Falkland Islands (Islas Malvinas)", "fk", "500"], ["Faroe Islands (Føroyar)", "fo", "298"], ["Fiji", "fj", "679"], ["Finland (Suomi)", "fi", "358", 0], ["France", "fr", "33"], ["French Guiana (Guyane française)", "gf", "594"], ["French Polynesia (Polynésie française)", "pf", "689"], ["Gabon", "ga", "241"], ["Gambia", "gm", "220"], ["Georgia (საქართველო)", "ge", "995"], ["Germany (Deutschland)", "de", "49"], ["Ghana (Gaana)", "gh", "233"], ["Gibraltar", "gi", "350"], ["Greece (Ελλάδα)", "gr", "30"], ["Greenland (Kalaallit Nunaat)", "gl", "299"], ["Grenada", "gd", "1473"], ["Guadeloupe", "gp", "590", 0], ["Guam", "gu", "1671"], ["Guatemala", "gt", "502"], ["Guernsey", "gg", "44", 1], ["Guinea (Guinée)", "gn", "224"], ["Guinea-Bissau (Guiné Bissau)", "gw", "245"], ["Guyana", "gy", "592"], ["Haiti", "ht", "509"], ["Honduras", "hn", "504"], ["Hong Kong (香港)", "hk", "852"], ["Hungary (Magyarország)", "hu", "36"], ["Iceland (Ísland)", "is", "354"], ["India (भारत)", "in", "91"], ["Indonesia", "id", "62"], ["Iran (‫ایران‬‎)", "ir", "98"], ["Iraq (‫العراق‬‎)", "iq", "964"], ["Ireland", "ie", "353"], ["Isle of Man", "im", "44", 2], ["Israel (‫ישראל‬‎)", "il", "972"], ["Italy (Italia)", "it", "39", 0], ["Jamaica", "jm", "1876"], ["Japan (日本)", "jp", "81"], ["Jersey", "je", "44", 3], ["Jordan (‫الأردن‬‎)", "jo", "962"], ["Kazakhstan (Казахстан)", "kz", "7", 1], ["Kenya", "ke", "254"], ["Kiribati", "ki", "686"], ["Kosovo", "xk", "383"], ["Kuwait (‫الكويت‬‎)", "kw", "965"], ["Kyrgyzstan (Кыргызстан)", "kg", "996"], ["Laos (ລາວ)", "la", "856"], ["Latvia (Latvija)", "lv", "371"], ["Lebanon (‫لبنان‬‎)", "lb", "961"], ["Lesotho", "ls", "266"], ["Liberia", "lr", "231"], ["Libya (‫ليبيا‬‎)", "ly", "218"], ["Liechtenstein", "li", "423"], ["Lithuania (Lietuva)", "lt", "370"], ["Luxembourg", "lu", "352"], ["Macau (澳門)", "mo", "853"], ["Macedonia (FYROM) (Македонија)", "mk", "389"], ["Madagascar (Madagasikara)", "mg", "261"], ["Malawi", "mw", "265"], ["Malaysia", "my", "60"], ["Maldives", "mv", "960"], ["Mali", "ml", "223"], ["Malta", "mt", "356"], ["Marshall Islands", "mh", "692"], ["Martinique", "mq", "596"], ["Mauritania (‫موريتانيا‬‎)", "mr", "222"], ["Mauritius (Moris)", "mu", "230"], ["Mayotte", "yt", "262", 1], ["Mexico (México)", "mx", "52"], ["Micronesia", "fm", "691"], ["Moldova (Republica Moldova)", "md", "373"], ["Monaco", "mc", "377"], ["Mongolia (Монгол)", "mn", "976"], ["Montenegro (Crna Gora)", "me", "382"], ["Montserrat", "ms", "1664"], ["Morocco (‫المغرب‬‎)", "ma", "212", 0], ["Mozambique (Moçambique)", "mz", "258"], ["Myanmar (Burma) (မြန်မာ)", "mm", "95"], ["Namibia (Namibië)", "na", "264"], ["Nauru", "nr", "674"], ["Nepal (नेपाल)", "np", "977"], ["Netherlands (Nederland)", "nl", "31"], ["New Caledonia (Nouvelle-Calédonie)", "nc", "687"], ["New Zealand", "nz", "64"], ["Nicaragua", "ni", "505"], ["Niger (Nijar)", "ne", "227"], ["Nigeria", "ng", "234"], ["Niue", "nu", "683"], ["Norfolk Island", "nf", "672"], ["North Korea (조선 민주주의 인민 공화국)", "kp", "850"], ["Northern Mariana Islands", "mp", "1670"], ["Norway (Norge)", "no", "47", 0], ["Oman (‫عُمان‬‎)", "om", "968"], ["Pakistan (‫پاکستان‬‎)", "pk", "92"], ["Palau", "pw", "680"], ["Palestine (‫فلسطين‬‎)", "ps", "970"], ["Panama (Panamá)", "pa", "507"], ["Papua New Guinea", "pg", "675"], ["Paraguay", "py", "595"], ["Peru (Perú)", "pe", "51"], ["Philippines", "ph", "63"], ["Poland (Polska)", "pl", "48"], ["Portugal", "pt", "351"], ["Puerto Rico", "pr", "1", 3, ["787", "939"]], ["Qatar (‫قطر‬‎)", "qa", "974"], ["Réunion (La Réunion)", "re", "262", 0], ["Romania (România)", "ro", "40"], ["Russia (Россия)", "ru", "7", 0], ["Rwanda", "rw", "250"], ["Saint Barthélemy", "bl", "590", 1], ["Saint Helena", "sh", "290"], ["Saint Kitts and Nevis", "kn", "1869"], ["Saint Lucia", "lc", "1758"], ["Saint Martin (Saint-Martin (partie française))", "mf", "590", 2], ["Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)", "pm", "508"], ["Saint Vincent and the Grenadines", "vc", "1784"], ["Samoa", "ws", "685"], ["San Marino", "sm", "378"], ["São Tomé and Príncipe (São Tomé e Príncipe)", "st", "239"], ["Saudi Arabia (‫المملكة العربية السعودية‬‎)", "sa", "966"], ["Senegal (Sénégal)", "sn", "221"], ["Serbia (Србија)", "rs", "381"], ["Seychelles", "sc", "248"], ["Sierra Leone", "sl", "232"], ["Singapore", "sg", "65"], ["Sint Maarten", "sx", "1721"], ["Slovakia (Slovensko)", "sk", "421"], ["Slovenia (Slovenija)", "si", "386"], ["Solomon Islands", "sb", "677"], ["Somalia (Soomaaliya)", "so", "252"], ["South Africa", "za", "27"], ["South Korea (대한민국)", "kr", "82"], ["South Sudan (‫جنوب السودان‬‎)", "ss", "211"], ["Spain (España)", "es", "34"], ["Sri Lanka (ශ්‍රී ලංකාව)", "lk", "94"], ["Sudan (‫السودان‬‎)", "sd", "249"], ["Suriname", "sr", "597"], ["Svalbard and Jan Mayen", "sj", "47", 1], ["Swaziland", "sz", "268"], ["Sweden (Sverige)", "se", "46"], ["Switzerland (Schweiz)", "ch", "41"], ["Syria (‫سوريا‬‎)", "sy", "963"], ["Taiwan (台灣)", "tw", "886"], ["Tajikistan", "tj", "992"], ["Tanzania", "tz", "255"], ["Thailand (ไทย)", "th", "66"], ["Timor-Leste", "tl", "670"], ["Togo", "tg", "228"], ["Tokelau", "tk", "690"], ["Tonga", "to", "676"], ["Trinidad and Tobago", "tt", "1868"], ["Tunisia (‫تونس‬‎)", "tn", "216"], ["Turkey (Türkiye)", "tr", "90"], ["Turkmenistan", "tm", "993"], ["Turks and Caicos Islands", "tc", "1649"], ["Tuvalu", "tv", "688"], ["U.S. Virgin Islands", "vi", "1340"], ["Uganda", "ug", "256"], ["Ukraine (Україна)", "ua", "380"], ["United Arab Emirates (‫الإمارات العربية المتحدة‬‎)", "ae", "971"], ["United Kingdom", "gb", "44", 0], ["United States", "us", "1", 0], ["Uruguay", "uy", "598"], ["Uzbekistan (Oʻzbekiston)", "uz", "998"], ["Vanuatu", "vu", "678"], ["Vatican City (Città del Vaticano)", "va", "39", 1], ["Venezuela", "ve", "58"], ["Vietnam (Việt Nam)", "vn", "84"], ["Wallis and Futuna (Wallis-et-Futuna)", "wf", "681"], ["Western Sahara (‫الصحراء الغربية‬‎)", "eh", "212", 1], ["Yemen (‫اليمن‬‎)", "ye", "967"], ["Zambia", "zm", "260"], ["Zimbabwe", "zw", "263"], ["Åland Islands", "ax", "358", 1]], l = 0; l < k.length; l++) { var m = k[l]; k[l] = { name: m[0], iso2: m[1], dialCode: m[2], priority: m[3] || 0, areaCodes: m[4] || null } } });;$(document).ready(function () {

    $.validator.addMethod("pattern", function (value, element, param) {
        //console.log('param: ' + param);
        if (this.optional(element)) {
            return true;
        }
        if (typeof param === "string") {
            //param = new RegExp(param);
            param = new RegExp("^(?:" + param + ")$");
        }
        //console.log('param: ' + param);
        //console.log('test: ' + param.test(value));
        return param.test(value);
    }, "Invalid format.");

    $.validator.addMethod('PID2', function (x, element) {
        if ($(element).hasClass("error"))
            return false;
        if ($(element).hasClass("valid"))
            return checkEmail();
    }, "");

    $.validator.addMethod("equalToIgnoreCase", function (value, element, options) {
        //$.validator.messages.equalToIgnoreCase = options.label + "do not match";
        $.validator.messages.equalToIgnoreCase = options.configMatchMsg;
        return this.optional(element) ||
             (value.toLowerCase() == $(options.el).val().toLowerCase());
    }, $.validator.messages.equalToIgnoreCase);

    $.validator.addMethod("equalToMobilePhoneValid", function (value, element, param) {
        var validConfMobile = false;
        if ($(element).intlTelInput("isValidNumber") && ($(element).intlTelInput("getNumber") == $(param).val())) {
            validConfMobile = true;
        }
        else if ($(element).intlTelInput("isValidNumber") && ($(element).intlTelInput("getNumber") != $(param).val())) {
            $.validator.messages.equalToMobilePhoneValid = "Mobile numbers do not match";
        }
        else if (!$(element).intlTelInput("isValidNumber")) {
            $.validator.messages.equalToMobilePhoneValid = "Please enter a valid phone number";
        }
        return validConfMobile;
    }, $.validator.messages.equalToMobilePhoneValid);

    jQuery.validator.addMethod("alphachar", function (value, element) {
        return this.optional(element) || /^[a-z]+$/i.test(value);
    }, "This field accepts alphabetical characters only");

    $.validator.addMethod('PostcodeAustralia', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/^((0[289][0-9]{2})|([1345689][0-9]{3})|(2[0-9][0-9]{2})|(7[0-9][0-9]{2}))$/);
        //return this.optional(element) || postalcode.match(/^(((2|8|9)\d{2})|((02|08|09)\d{2})|([1-9]\d{3}))$/);
    }, "Invalid postcode");
    $.validator.addMethod('PostcodeUSA', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{5}(-\d{4})?$)|(^[ABCEGHJKLMNPRSTVXYabceghjklmnpstvxy]{1}\d{1}[A-Za-z]{1} ?\d{1}[A-Za-z]{1}\d{1})$/);
    }, "");
    $.validator.addMethod('PostcodeArgentina', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^([A-HJ-TP-Z]{1}\d{4}[A-Z]{3}|[a-z]{1}\d{4}[a-hj-tp-z]{3})$)/);
    }, "");
    $.validator.addMethod('PostcodeBrazil', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{5}-\d{3}$)/);
    }, "");
    $.validator.addMethod('PostcodeCanada', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^((\d{5}-\d{4})|(\d{5})|([AaBbCcEeGgHhJjKkLlMmNnPpRrSsTtVvXxYy]\d[A-Za-z]\s?\d[A-Za-z]\d))$)/);
    }, "");
    $.validator.addMethod('PostcodeChina', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{6}$)/);
    }, "");
    $.validator.addMethod('PostcodeEngland', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^[Bb][Ff][Pp][Oo]\s*[0-9]{1,4})|(^[Gg][Ii][Rr]\s*0[Aa][Aa]$)|([Aa][Ss][Cc][Nn]|[Bb][Bb][Nn][Dd]|[Bb][Ii][Qq][Qq]|[Ff][Ii][Qq][Qq]|[Pp][Cc][Rr][Nn]|[Ss][Ii][Qq][Qq]|[Ss][Tt][Hh][Ll]|[Tt][Dd][Cc][Uu]\s*1[Zz][Zz])|(^([Aa][BLbl]|[Bb][ABDHLNRSTabdhlnrst]?|[Cc][ABFHMORTVWabfhmortvw]|[Dd][ADEGHLNTYadeghlnty]|[Ee][CHNXchnx]?|[Ff][KYky]|[Gg][LUYluy]?|[Hh][ADGPRSUXadgprsux]|[Ii][GMPVgmpv]|[JE]|[je]|[Kk][ATWYatwy]|[Ll][ADELNSUadelnsu]?|[Mm][EKLekl]?|[Nn][EGNPRWegnprw]?|[Oo][LXlx]|[Pp][AEHLORaehlor]|[Rr][GHMghm]|[Ss][AEGK-PRSTWYaegk-prstwy]?|[Tt][ADFNQRSWadfnqrsw]|[UB]|[ub]|[Ww][A-DFGHJKMNR-Wa-dfghjkmnr-w]?|[YO]|[yo]|[ZE]|[ze])[1-9][0-9]?[ABEHMNPRVWXYabehmnprvwxy]?\s*[0-9][ABD-HJLNP-UW-Zabd-hjlnp-uw-z]{2}$)/);
    }, "");
    $.validator.addMethod('PostcodeFinland', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{5}$)/);
    }, "");
    $.validator.addMethod('PostcodeFrance', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{5}$)/);
    }, "");
    $.validator.addMethod('PostcodeGermany', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{5}$)/);
    }, "");
    $.validator.addMethod('PostcodeGreece', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{3}\s{0,1}\d{2}$|\d{3}$)/);
        //return this.optional(element) || postalcode.match(/(^\d{3}$)/);
    }, "");
    $.validator.addMethod('PostcodeIndia', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{6}$)/);
    }, "");
    $.validator.addMethod('PostcodeMexico', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{5}$)/);
    }, "");
    $.validator.addMethod('PostcodeNewZealand', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{4}$)/);
    }, "");
    $.validator.addMethod('PostcodeSingapore', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{6}$)/);
    }, "");
    $.validator.addMethod('PostcodeSouthAfrica', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{4}$)/);
    }, "");
    $.validator.addMethod('PostcodeSpain', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{5}$)/);
    }, "");
    $.validator.addMethod('PostcodeTurkey', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{5}$)/);
    }, "");
    $.validator.addMethod('PostcodeUruguay', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{5}$)/);
    }, "");
    $.validator.addMethod('PostcodeNetherlands', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{4}\s{0,1}[A-Za-z]{2}$)/);
    }, "");
    $.validator.addMethod('PostcodeSwitzerland', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{4}$)/);
    }, "");
    $.validator.addMethod('PostcodeSaudiArabia', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{5}(-{1}\d{4})?$)/);
    }, "");
    $.validator.addMethod('PostcodeBahrain', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{3,4}$)/);
    }, "");
    $.validator.addMethod('PostcodeEthiopia', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{4}$)/);
    }, "");
    $.validator.addMethod('PostcodePortugal', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{4}$)/);
    }, "");
    $.validator.addMethod('PostcodeJordan', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{5}$)/);
    }, "");
    $.validator.addMethod('PostcodeEgypt', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{5}$)/);
    }, "");
    $.validator.addMethod('PostcodeIndonesia', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{5}$)/);
    }, "");
    $.validator.addMethod('PostcodeMalaysia', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{5}$)/);
    }, "");
    $.validator.addMethod('PostcodeBelgium', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{4}$)/);
    }, "");
    $.validator.addMethod('PostcodePhilippines', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{4}$)/);
    }, "");
    $.validator.addMethod('PostcodePanama', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{4}$)/);
    }, "");
    $.validator.addMethod('PostcodeColombia', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{6}$)/);
    }, "");
    $.validator.addMethod('PostcodeRussia', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{6}$)/);
    }, "");
    $.validator.addMethod('PostcodeThailand', function (postalcode, element) {
        return this.optional(element) || postalcode.match(/(^\d{5}$)/);
    }, "");
});;




!function (a) { function b() { return new Date(Date.UTC.apply(Date, arguments)) } var c = function (b, c) { var f = this; this.element = a(b), this.autoShow = void 0 == c.autoShow || c.autoShow, this.appendTo = c.appendTo || "body", this.closeButton = c.closeButton, this.language = c.language || this.element.data("date-language") || "en", this.language = this.language in d ? this.language : this.language.split("-")[0], this.language = this.language in d ? this.language : "en", this.isRTL = d[this.language].rtl || !1, this.format = e.parseFormat(c.format || this.element.data("date-format") || d[this.language].format || "mm/dd/yyyy"), this.formatText = c.format || this.element.data("date-format") || d[this.language].format || "mm/dd/yyyy", this.isInline = !1, this.isInput = this.element.is("input"), this.component = !!this.element.is(".date") && this.element.find(".prefix, .postfix"), this.hasInput = this.component && this.element.find("input").length, this.disableDblClickSelection = c.disableDblClickSelection, this.onRender = c.onRender || function () { }, this.component && 0 === this.component.length && (this.component = !1), this.linkField = c.linkField || this.element.data("link-field") || !1, this.linkFormat = e.parseFormat(c.linkFormat || this.element.data("link-format") || "yyyy-mm-dd hh:ii:ss"), this.minuteStep = c.minuteStep || this.element.data("minute-step") || 5, this.pickerPosition = c.pickerPosition || this.element.data("picker-position") || "bottom-right", this.initialDate = c.initialDate || null, this.faCSSprefix = c.faCSSprefix || "fa", this.leftArrow = c.leftArrow || '<i class="' + this.faCSSprefix + " " + this.faCSSprefix + '-chevron-left fi-arrow-left"/>', this.rightArrow = c.rightArrow || '<i class="' + this.faCSSprefix + " " + this.faCSSprefix + '-chevron-right fi-arrow-right"/>', this.closeIcon = c.closeIcon || '<i class="' + this.faCSSprefix + " " + this.faCSSprefix + "-remove " + this.faCSSprefix + '-times fi-x"></i>', this.minView = 0, "minView" in c ? this.minView = c.minView : "minView" in this.element.data() && (this.minView = this.element.data("min-view")), this.minView = e.convertViewMode(this.minView), this.maxView = e.modes.length - 1, "maxView" in c ? this.maxView = c.maxView : "maxView" in this.element.data() && (this.maxView = this.element.data("max-view")), this.maxView = e.convertViewMode(this.maxView), this.startViewMode = "month", "startView" in c ? this.startViewMode = c.startView : "startView" in this.element.data() && (this.startViewMode = this.element.data("start-view")), this.startViewMode = e.convertViewMode(this.startViewMode), this.viewMode = this.startViewMode, "minView" in c || "maxView" in c || this.element.data("min-view") || this.element.data("max-view") || (this.pickTime = !1, "pickTime" in c && (this.pickTime = c.pickTime), 1 == this.pickTime ? (this.minView = 0, this.maxView = 4) : (this.minView = 2, this.maxView = 4)), this.forceParse = !0, "forceParse" in c ? this.forceParse = c.forceParse : "dateForceParse" in this.element.data() && (this.forceParse = this.element.data("date-force-parse")), this.picker = a(e.template(this.leftArrow, this.rightArrow, this.closeIcon)).appendTo(this.isInline ? this.element : this.appendTo).on({ click: a.proxy(this.click, this), mousedown: a.proxy(this.mousedown, this) }), this.closeButton ? this.picker.find("a.datepicker-close").show() : this.picker.find("a.datepicker-close").hide(), this.isInline ? this.picker.addClass("datepicker-inline") : this.picker.addClass("datepicker-dropdown dropdown-menu"), this.isRTL && (this.picker.addClass("datepicker-rtl"), this.picker.find(".date-switch").each(function () { a(this).parent().prepend(a(this).siblings(".next")), a(this).parent().append(a(this).siblings(".prev")) }), this.picker.find(".prev, .next").toggleClass("prev next")), a(document).on("mousedown", function (b) { 0 === a(b.target).closest(".datepicker.datepicker-inline, .datepicker.datepicker-dropdown").length && f.hide() }), this.autoclose = !0, "autoclose" in c ? this.autoclose = c.autoclose : "dateAutoclose" in this.element.data() && (this.autoclose = this.element.data("date-autoclose")), this.keyboardNavigation = !0, "keyboardNavigation" in c ? this.keyboardNavigation = c.keyboardNavigation : "dateKeyboardNavigation" in this.element.data() && (this.keyboardNavigation = this.element.data("date-keyboard-navigation")), this.todayBtn = c.todayBtn || this.element.data("date-today-btn") || !1, this.todayHighlight = c.todayHighlight || this.element.data("date-today-highlight") || !1, this.calendarWeeks = !1, "calendarWeeks" in c ? this.calendarWeeks = c.calendarWeeks : "dateCalendarWeeks" in this.element.data() && (this.calendarWeeks = this.element.data("date-calendar-weeks")), this.calendarWeeks && this.picker.find("tfoot th.today").attr("colspan", function (a, b) { return parseInt(b) + 1 }), this.weekStart = (c.weekStart || this.element.data("date-weekstart") || d[this.language].weekStart || 0) % 7, this.weekEnd = (this.weekStart + 6) % 7, this.startDate = -(1 / 0), this.endDate = 1 / 0, this.daysOfWeekDisabled = [], this.datesDisabled = [], this.setStartDate(c.startDate || this.element.data("date-startdate")), this.setEndDate(c.endDate || this.element.data("date-enddate")), this.setDaysOfWeekDisabled(c.daysOfWeekDisabled || this.element.data("date-days-of-week-disabled")), this.setDatesDisabled(c.datesDisabled || this.element.data("dates-disabled")), this.fillDow(), this.fillMonths(), this.update(), this.showMode(), this.isInline && this.show(), this._attachEvents() }; c.prototype = { constructor: c, _events: [], _attachEvents: function () { this._detachEvents(), this.isInput ? this.keyboardNavigation ? this._events = [[this.element, { focus: this.autoShow ? a.proxy(this.show, this) : function () { }, keyup: a.proxy(this.update, this), keydown: a.proxy(this.keydown, this), click: this.element.attr("readonly") ? a.proxy(this.show, this) : function () { } }]] : this._events = [[this.element, { focus: this.autoShow ? a.proxy(this.show, this) : function () { } }]] : this.component && this.hasInput ? this._events = [[this.element.find("input"), { focus: this.autoShow ? a.proxy(this.show, this) : function () { }, keyup: a.proxy(this.update, this), keydown: a.proxy(this.keydown, this) }], [this.component, { click: a.proxy(this.show, this) }]] : this.element.is("div") ? this.isInline = !0 : this._events = [[this.element, { click: a.proxy(this.show, this) }]], this.disableDblClickSelection && (this._events[this._events.length] = [this.element, { dblclick: function (b) { b.preventDefault(), b.stopPropagation(), a(this).blur() } }]); for (var b, c, d = 0; d < this._events.length; d++) b = this._events[d][0], c = this._events[d][1], b.on(c) }, _detachEvents: function () { for (var a, b, c = 0; c < this._events.length; c++) a = this._events[c][0], b = this._events[c][1], a.off(b); this._events = [] }, show: function (b) { this.picker.show(), this.height = this.component ? this.component.outerHeight() : this.element.outerHeight(), this.update(), this.place(), a(window).on("resize", a.proxy(this.place, this)), b && (b.stopPropagation(), b.preventDefault()), this.element.trigger({ type: "show", date: this.date }) }, hide: function (b) { this.isInline || this.picker.is(":visible") && (this.picker.hide(), a(window).off("resize", this.place), this.viewMode = this.startViewMode, this.showMode(), this.isInput || a(document).off("mousedown", this.hide), this.forceParse && (this.isInput && this.element.val() || this.hasInput && this.element.find("input").val()) && this.setValue(), this.element.trigger({ type: "hide", date: this.date })) }, remove: function () { this._detachEvents(), this.picker.remove(), delete this.element.data().datepicker }, getDate: function () { var a = this.getUTCDate(); return new Date(a.getTime() + 6e4 * a.getTimezoneOffset()) }, getUTCDate: function () { return this.date }, setDate: function (a) { this.setUTCDate(new Date(a.getTime() - 6e4 * a.getTimezoneOffset())) }, setUTCDate: function (a) { this.date = a, this.setValue() }, setValue: function () { var a = this.getFormattedDate(); this.isInput ? this.element.val(a) : (this.component && this.element.find("input").val(a), this.element.data("date", a)) }, getFormattedDate: function (a) { return void 0 === a && (a = this.format), e.formatDate(this.date, a, this.language) }, setStartDate: function (a) { this.startDate = a || -(1 / 0), this.startDate !== -(1 / 0) && (this.startDate = e.parseDate(this.startDate, this.format, this.language)), this.update(), this.updateNavArrows() }, setEndDate: function (a) { this.endDate = a || 1 / 0, this.endDate !== 1 / 0 && (this.endDate = e.parseDate(this.endDate, this.format, this.language)), this.update(), this.updateNavArrows() }, setDaysOfWeekDisabled: function (b) { this.daysOfWeekDisabled = b || [], a.isArray(this.daysOfWeekDisabled) || (this.daysOfWeekDisabled = this.daysOfWeekDisabled.split(/,\s*/)), this.daysOfWeekDisabled = a.map(this.daysOfWeekDisabled, function (a) { return parseInt(a, 10) }), this.update(), this.updateNavArrows() }, setDatesDisabled: function (b) { this.datesDisabled = b || [], a.isArray(this.datesDisabled) || (this.datesDisabled = this.datesDisabled.split(/,\s*/)), this.datesDisabled = a.map(this.datesDisabled, function (a) { return e.parseDate(a, this.format, this.language).valueOf() }), this.update(), this.updateNavArrows() }, place: function () { if (!this.isInline) { var b = parseInt(this.element.parents().filter(function () { return "auto" != a(this).css("z-index") }).first().css("z-index")) + 10, c = this.component ? this.component : this.element, d = c.offset(), e = c.outerHeight() + parseInt(c.css("margin-top")), f = c.outerWidth() + parseInt(c.css("margin-left")), g = d.top + e, h = d.left; this.picker.removeClass("datepicker-top datepicker-bottom"), g + this.picker.outerHeight() >= a(window).scrollTop() + a(window).height() ? (g = d.top - this.picker.outerHeight(), this.picker.addClass("datepicker-top")) : this.picker.addClass("datepicker-bottom"), d.left + this.picker.width() >= a(window).width() && (h = d.left + f - this.picker.width()), this.picker.css({ top: g, left: h, zIndex: b }) } }, update: function () { var b, c = !1, d = this.isInput ? this.element.val() : this.element.data("date") || this.element.find("input").val(); return arguments && arguments.length && ("string" == typeof arguments[0] || arguments[0] instanceof Date) ? (b = arguments[0], c = !0) : b = d || null == this.initialDate ? this.isInput ? this.element.val() : this.element.data("date") || this.element.find("input").val() : this.initialDate, b.length > this.formatText.length ? (a(this.picker).addClass("is-invalid"), void a(this.element).addClass("is-invalid-input")) : (a(this.picker).removeClass("is-invalid"), a(this.element).removeClass("is-invalid-input"), this.date = e.parseDate(b, this.format, this.language), (c || null != this.initialDate) && this.setValue(), this.date < this.startDate ? this.viewDate = new Date(this.startDate.valueOf()) : this.date > this.endDate ? this.viewDate = new Date(this.endDate.valueOf()) : this.viewDate = new Date(this.date.valueOf()), void this.fill()) }, fillDow: function () { var a = this.weekStart, b = "<tr>"; if (this.calendarWeeks) { var c = '<th class="cw">&nbsp;</th>'; b += c, this.picker.find(".datepicker-days thead tr:first-child").prepend(c) } for (; a < this.weekStart + 7;) b += '<th class="dow">' + d[this.language].daysShort[a++ % 7] + "</th>"; b += "</tr>", this.picker.find(".datepicker-days thead").append(b) }, fillMonths: function () { for (var a = "", b = 0; b < 12;) a += '<span class="month">' + d[this.language].monthsShort[b++] + "</span>"; this.picker.find(".datepicker-months td").html(a) }, fill: function () { if (null != this.date && null != this.viewDate) { var c = new Date(this.viewDate.valueOf()), f = c.getUTCFullYear(), g = c.getUTCMonth(), h = c.getUTCDate(), i = c.getUTCHours(), j = c.getUTCMinutes(), k = this.startDate !== -(1 / 0) ? this.startDate.getUTCFullYear() : -(1 / 0), l = this.startDate !== -(1 / 0) ? this.startDate.getUTCMonth() : -(1 / 0), m = this.endDate !== 1 / 0 ? this.endDate.getUTCFullYear() : 1 / 0, n = this.endDate !== 1 / 0 ? this.endDate.getUTCMonth() : 1 / 0, o = this.date && b(this.date.getUTCFullYear(), this.date.getUTCMonth(), this.date.getUTCDate()).valueOf(), p = new Date; d[this.language].titleFormat || d.en.titleFormat; this.picker.find(".datepicker-days thead th:eq(1)").text(d[this.language].months[g] + " " + f), this.picker.find(".datepicker-hours thead th:eq(1)").text(h + " " + d[this.language].months[g] + " " + f), this.picker.find(".datepicker-minutes thead th:eq(1)").text(h + " " + d[this.language].months[g] + " " + f), this.picker.find("tfoot th.today").text(d[this.language].today).toggle(this.todayBtn !== !1), this.updateNavArrows(), this.fillMonths(); var q = b(f, g - 1, 28, 0, 0, 0, 0), r = e.getDaysInMonth(q.getUTCFullYear(), q.getUTCMonth()); q.setUTCDate(r), q.setUTCDate(r - (q.getUTCDay() - this.weekStart + 7) % 7); var s = new Date(q.valueOf()); s.setUTCDate(s.getUTCDate() + 42), s = s.valueOf(); for (var t, u = []; q.valueOf() < s;) { if (q.getUTCDay() == this.weekStart && (u.push("<tr>"), this.calendarWeeks)) { var v = new Date(q.getUTCFullYear(), q.getUTCMonth(), q.getUTCDate() - q.getDay() + 10 - (this.weekStart && this.weekStart % 7 < 5 && 7)), w = new Date(v.getFullYear(), 0, 4), x = ~~((v - w) / 864e5 / 7 + 1.5); u.push('<td class="cw">' + x + "</td>") } t = " " + this.onRender(q) + " ", q.getUTCFullYear() < f || q.getUTCFullYear() == f && q.getUTCMonth() < g ? t += " old" : (q.getUTCFullYear() > f || q.getUTCFullYear() == f && q.getUTCMonth() > g) && (t += " new"), this.todayHighlight && q.getUTCFullYear() == p.getFullYear() && q.getUTCMonth() == p.getMonth() && q.getUTCDate() == p.getDate() && (t += " today"), o && q.valueOf() == o && (t += " active"), (q.valueOf() < this.startDate || q.valueOf() > this.endDate || a.inArray(q.getUTCDay(), this.daysOfWeekDisabled) !== -1 || a.inArray(q.valueOf(), this.datesDisabled) !== -1) && (t += " disabled"), u.push('<td class="day' + t + '">' + q.getUTCDate() + "</td>"), q.getUTCDay() == this.weekEnd && u.push("</tr>"), q.setUTCDate(q.getUTCDate() + 1) } this.picker.find(".datepicker-days tbody").empty().append(u.join("")), u = []; for (var y = 0; y < 24; y++) { var z = b(f, g, h, y); t = "", z.valueOf() + 36e5 < this.startDate || z.valueOf() > this.endDate ? t += " disabled" : i == y && (t += " active"), u.push('<span class="hour' + t + '">' + y + ":00</span>") } this.picker.find(".datepicker-hours td").html(u.join("")), u = []; for (var y = 0; y < 60; y += this.minuteStep) { var z = b(f, g, h, i, y); t = "", z.valueOf() < this.startDate || z.valueOf() > this.endDate ? t += " disabled" : Math.floor(j / this.minuteStep) == Math.floor(y / this.minuteStep) && (t += " active"), u.push('<span class="minute' + t + '">' + i + ":" + (y < 10 ? "0" + y : y) + "</span>") } this.picker.find(".datepicker-minutes td").html(u.join("")); var A = this.date && this.date.getUTCFullYear(), B = this.picker.find(".datepicker-months").find("th:eq(1)").text(f).end().find("span").removeClass("active"); A && A == f && B.eq(this.date.getUTCMonth()).addClass("active"), (f < k || f > m) && B.addClass("disabled"), f == k && B.slice(0, l).addClass("disabled"), f == m && B.slice(n + 1).addClass("disabled"), u = "", f = 10 * parseInt(f / 10, 10); var C = this.picker.find(".datepicker-years").find("th:eq(1)").text(f + "-" + (f + 9)).end().find("td"); f -= 1; for (var y = -1; y < 11; y++) u += '<span class="year' + (y == -1 || 10 == y ? " old" : "") + (A == f ? " active" : "") + (f < k || f > m ? " disabled" : "") + '">' + f + "</span>", f += 1; C.html(u) } }, updateNavArrows: function () { var a = new Date(this.viewDate), b = a.getUTCFullYear(), c = a.getUTCMonth(), d = a.getUTCDate(), e = a.getUTCHours(); switch (this.viewMode) { case 0: this.startDate !== -(1 / 0) && b <= this.startDate.getUTCFullYear() && c <= this.startDate.getUTCMonth() && d <= this.startDate.getUTCDate() && e <= this.startDate.getUTCHours() ? this.picker.find(".prev").css({ visibility: "hidden" }) : this.picker.find(".prev").css({ visibility: "visible" }), this.endDate !== 1 / 0 && b >= this.endDate.getUTCFullYear() && c >= this.endDate.getUTCMonth() && d >= this.endDate.getUTCDate() && e >= this.endDate.getUTCHours() ? this.picker.find(".next").css({ visibility: "hidden" }) : this.picker.find(".next").css({ visibility: "visible" }); break; case 1: this.startDate !== -(1 / 0) && b <= this.startDate.getUTCFullYear() && c <= this.startDate.getUTCMonth() && d <= this.startDate.getUTCDate() ? this.picker.find(".prev").css({ visibility: "hidden" }) : this.picker.find(".prev").css({ visibility: "visible" }), this.endDate !== 1 / 0 && b >= this.endDate.getUTCFullYear() && c >= this.endDate.getUTCMonth() && d >= this.endDate.getUTCDate() ? this.picker.find(".next").css({ visibility: "hidden" }) : this.picker.find(".next").css({ visibility: "visible" }); break; case 2: this.startDate !== -(1 / 0) && b <= this.startDate.getUTCFullYear() && c <= this.startDate.getUTCMonth() ? this.picker.find(".prev").css({ visibility: "hidden" }) : this.picker.find(".prev").css({ visibility: "visible" }), this.endDate !== 1 / 0 && b >= this.endDate.getUTCFullYear() && c >= this.endDate.getUTCMonth() ? this.picker.find(".next").css({ visibility: "hidden" }) : this.picker.find(".next").css({ visibility: "visible" }); break; case 3: case 4: this.startDate !== -(1 / 0) && b <= this.startDate.getUTCFullYear() ? this.picker.find(".prev").css({ visibility: "hidden" }) : this.picker.find(".prev").css({ visibility: "visible" }), this.endDate !== 1 / 0 && b >= this.endDate.getUTCFullYear() ? this.picker.find(".next").css({ visibility: "hidden" }) : this.picker.find(".next").css({ visibility: "visible" }) } }, click: function (c) { c.stopPropagation(), c.preventDefault(), (a(c.target).hasClass("datepicker-close") || a(c.target).parent().hasClass("datepicker-close")) && this.hide(); var d = a(c.target).closest("span, td, th"); if (1 == d.length) { if (d.is(".disabled")) return void this.element.trigger({ type: "outOfRange", date: this.viewDate, startDate: this.startDate, endDate: this.endDate }); switch (d[0].nodeName.toLowerCase()) { case "th": switch (d[0].className) { case "date-switch": this.showMode(1); break; case "prev": case "next": var f = e.modes[this.viewMode].navStep * ("prev" == d[0].className ? -1 : 1); switch (this.viewMode) { case 0: this.viewDate = this.moveHour(this.viewDate, f); break; case 1: this.viewDate = this.moveDate(this.viewDate, f); break; case 2: this.viewDate = this.moveMonth(this.viewDate, f); break; case 3: case 4: this.viewDate = this.moveYear(this.viewDate, f) } this.fill(); break; case "today": var g = new Date; g = b(g.getFullYear(), g.getMonth(), g.getDate(), g.getHours(), g.getMinutes(), g.getSeconds()), this.viewMode = this.startViewMode, this.showMode(0), this._setDate(g) } break; case "span": if (!d.is(".disabled")) { if (d.is(".month")) if (3 === this.minView) { var h = d.parent().find("span").index(d) || 0, i = this.viewDate.getUTCFullYear(), j = 1, k = this.viewDate.getUTCHours(), l = this.viewDate.getUTCMinutes(), m = this.viewDate.getUTCSeconds(); this._setDate(b(i, h, j, k, l, m, 0)) } else { this.viewDate.setUTCDate(1); var h = d.parent().find("span").index(d); this.viewDate.setUTCMonth(h), this.element.trigger({ type: "changeMonth", date: this.viewDate }) } else if (d.is(".year")) if (4 === this.minView) { var i = parseInt(d.text(), 10) || 0, h = 0, j = 1, k = this.viewDate.getUTCHours(), l = this.viewDate.getUTCMinutes(), m = this.viewDate.getUTCSeconds(); this._setDate(b(i, h, j, k, l, m, 0)) } else { this.viewDate.setUTCDate(1); var i = parseInt(d.text(), 10) || 0; this.viewDate.setUTCFullYear(i), this.element.trigger({ type: "changeYear", date: this.viewDate }) } else if (d.is(".hour")) { var k = parseInt(d.text(), 10) || 0, i = this.viewDate.getUTCFullYear(), h = this.viewDate.getUTCMonth(), j = this.viewDate.getUTCDate(), l = this.viewDate.getUTCMinutes(), m = this.viewDate.getUTCSeconds(); this._setDate(b(i, h, j, k, l, m, 0)) } else if (d.is(".minute")) { var l = parseInt(d.text().substr(d.text().indexOf(":") + 1), 10) || 0, i = this.viewDate.getUTCFullYear(), h = this.viewDate.getUTCMonth(), j = this.viewDate.getUTCDate(), k = this.viewDate.getUTCHours(), m = this.viewDate.getUTCSeconds(); this._setDate(b(i, h, j, k, l, m, 0)) } if (0 != this.viewMode) { var n = this.viewMode; this.showMode(-1), this.fill(), n == this.viewMode && this.autoclose && this.hide() } else this.fill(), this.autoclose && this.hide() } break; case "td": if (d.is(".day") && !d.is(".disabled")) { var j = parseInt(d.text(), 10) || 1, i = this.viewDate.getUTCFullYear(), h = this.viewDate.getUTCMonth(), k = this.viewDate.getUTCHours(), l = this.viewDate.getUTCMinutes(), m = this.viewDate.getUTCSeconds(); d.is(".old") ? 0 === h ? (h = 11, i -= 1) : h -= 1 : d.is(".new") && (11 == h ? (h = 0, i += 1) : h += 1), this._setDate(b(i, h, j, k, l, m, 0)) } var n = this.viewMode; this.showMode(-1), this.fill(), n == this.viewMode && this.autoclose && this.hide() } } }, _setDate: function (a, b) { b && "date" != b || (this.date = a), b && "view" != b || (this.viewDate = a), this.fill(), this.setValue(), this.element.trigger({ type: "changeDate", date: this.date }); var c; this.isInput ? c = this.element : this.component && (c = this.element.find("input")), c && (c.change(), this.autoclose && (!b || "date" == b)) }, moveHour: function (a, b) { if (!b) return a; var c = new Date(a.valueOf()); return b = b > 0 ? 1 : -1, c.setUTCHours(c.getUTCHours() + b), c }, moveDate: function (a, b) { if (!b) return a; var c = new Date(a.valueOf()); return b = b > 0 ? 1 : -1, c.setUTCDate(c.getUTCDate() + b), c }, moveMonth: function (a, b) { if (!b) return a; var c, d, e = new Date(a.valueOf()), f = e.getUTCDate(), g = e.getUTCMonth(), h = Math.abs(b); if (b = b > 0 ? 1 : -1, 1 == h) d = b == -1 ? function () { return e.getUTCMonth() == g } : function () { return e.getUTCMonth() != c }, c = g + b, e.setUTCMonth(c), (c < 0 || c > 11) && (c = (c + 12) % 12); else { for (var i = 0; i < h; i++) e = this.moveMonth(e, b); c = e.getUTCMonth(), e.setUTCDate(f), d = function () { return c != e.getUTCMonth() } } for (; d() ;) e.setUTCDate(--f), e.setUTCMonth(c); return e }, moveYear: function (a, b) { return this.moveMonth(a, 12 * b) }, dateWithinRange: function (a) { return a >= this.startDate && a <= this.endDate }, keydown: function (a) { if (!this.keyboardNavigation) return !0; if (this.picker.is(":not(:visible)")) return void (27 == a.keyCode && this.show()); var b, c, d, e = !1; switch (a.keyCode) { case 27: this.hide(), a.preventDefault(); break; case 37: case 39: if (!this.keyboardNavigation) break; b = 37 == a.keyCode ? -1 : 1, a.ctrlKey ? (c = this.moveYear(this.date, b), d = this.moveYear(this.viewDate, b)) : a.shiftKey ? (c = this.moveMonth(this.date, b), d = this.moveMonth(this.viewDate, b)) : (c = new Date(this.date.valueOf()), c.setUTCDate(this.date.getUTCDate() + b), d = new Date(this.viewDate.valueOf()), d.setUTCDate(this.viewDate.getUTCDate() + b)), this.dateWithinRange(c) && (this.date = c, this.viewDate = d, this.setValue(), this.update(), a.preventDefault(), e = !0); break; case 38: case 40: if (!this.keyboardNavigation) break; b = 38 == a.keyCode ? -1 : 1, a.ctrlKey ? (c = this.moveYear(this.date, b), d = this.moveYear(this.viewDate, b)) : a.shiftKey ? (c = this.moveMonth(this.date, b), d = this.moveMonth(this.viewDate, b)) : (c = new Date(this.date.valueOf()), c.setUTCDate(this.date.getUTCDate() + 7 * b), d = new Date(this.viewDate.valueOf()), d.setUTCDate(this.viewDate.getUTCDate() + 7 * b)), this.dateWithinRange(c) && (this.date = c, this.viewDate = d, this.setValue(), this.update(), a.preventDefault(), e = !0); break; case 13: this.hide(), a.preventDefault(); break; case 9: this.hide() } if (e) { this.element.trigger({ type: "changeDate", date: this.date }); var f; this.isInput ? f = this.element : this.component && (f = this.element.find("input")), f && f.change() } }, showMode: function (a) { if (a) { var b = Math.max(0, Math.min(e.modes.length - 1, this.viewMode + a)); b >= this.minView && b <= this.maxView && (this.viewMode = b) } this.picker.find(">div").hide().filter(".datepicker-" + e.modes[this.viewMode].clsName).css("display", "block"), this.updateNavArrows() }, reset: function (a) { this._setDate(null, "date") } }, a.fn.fdatepicker = function (b) { var d = Array.apply(null, arguments); return d.shift(), this.each(function () { var e = a(this), f = e.data("datepicker"), g = "object" == typeof b && b; f || e.data("datepicker", f = new c(this, a.extend({}, a.fn.fdatepicker.defaults, g))), "string" == typeof b && "function" == typeof f[b] && f[b].apply(f, d) }) }, a.fn.fdatepicker.defaults = { onRender: function (a) { return "" } }, a.fn.fdatepicker.Constructor = c; var d = a.fn.fdatepicker.dates = { en: { days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"], months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], today: "Today", titleFormat: "MM yyyy" } }, e = { modes: [{ clsName: "minutes", navFnc: "Hours", navStep: 1 }, { clsName: "hours", navFnc: "Date", navStep: 1 }, { clsName: "days", navFnc: "Month", navStep: 1 }, { clsName: "months", navFnc: "FullYear", navStep: 1 }, { clsName: "years", navFnc: "FullYear", navStep: 10 }], isLeapYear: function (a) { return a % 4 === 0 && a % 100 !== 0 || a % 400 === 0 }, getDaysInMonth: function (a, b) { return [31, e.isLeapYear(a) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][b] }, validParts: /hh?|ii?|ss?|dd?|mm?|MM?|yy(?:yy)?/g, nonpunctuation: /[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g, parseFormat: function (a) { var b = a.replace(this.validParts, "\0").split("\0"), c = a.match(this.validParts); if (!b || !b.length || !c || 0 === c.length) throw new Error("Invalid date format."); return this.formatText = a, { separators: b, parts: c } }, parseDate: function (c, e, f) { if (c instanceof Date) return new Date(c.valueOf() - 6e4 * c.getTimezoneOffset()); if (/^\d{4}\-\d{1,2}\-\d{1,2}$/.test(c) && (e = this.parseFormat("yyyy-mm-dd")), /^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}$/.test(c) && (e = this.parseFormat("yyyy-mm-dd hh:ii")), /^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}\:\d{1,2}[Z]{0,1}$/.test(c) && (e = this.parseFormat("yyyy-mm-dd hh:ii:ss")), /^[-+]\d+[dmwy]([\s,]+[-+]\d+[dmwy])*$/.test(c)) { var g, h, i = /([-+]\d+)([dmwy])/, j = c.match(/([-+]\d+)([dmwy])/g); c = new Date; for (var k = 0; k < j.length; k++) switch (g = i.exec(j[k]), h = parseInt(g[1]), g[2]) { case "d": c.setUTCDate(c.getUTCDate() + h); break; case "m": c = Datetimepicker.prototype.moveMonth.call(Datetimepicker.prototype, c, h); break; case "w": c.setUTCDate(c.getUTCDate() + 7 * h); break; case "y": c = Datetimepicker.prototype.moveYear.call(Datetimepicker.prototype, c, h) } return b(c.getUTCFullYear(), c.getUTCMonth(), c.getUTCDate(), c.getUTCHours(), c.getUTCMinutes(), c.getUTCSeconds()) } var l, m, g, j = c && c.match(this.nonpunctuation) || [], c = new Date, n = {}, o = ["hh", "h", "ii", "i", "ss", "s", "yyyy", "yy", "M", "MM", "m", "mm", "d", "dd"], p = { hh: function (a, b) { return a.setUTCHours(b) }, h: function (a, b) { return a.setUTCHours(b) }, ii: function (a, b) { return a.setUTCMinutes(b) }, i: function (a, b) { return a.setUTCMinutes(b) }, ss: function (a, b) { return a.setUTCSeconds(b) }, s: function (a, b) { return a.setUTCSeconds(b) }, yyyy: function (a, b) { return a.setUTCFullYear(b) }, yy: function (a, b) { return a.setUTCFullYear(2e3 + b) }, m: function (a, b) { for (b -= 1; b < 0;) b += 12; for (b %= 12, a.setUTCMonth(b) ; a.getUTCMonth() != b;) a.setUTCDate(a.getUTCDate() - 1); return a }, d: function (a, b) { return a.setUTCDate(b) } }; if (p.M = p.MM = p.mm = p.m, p.dd = p.d, c = b(c.getFullYear(), c.getMonth(), c.getDate(), 0, 0, 0), j.length == e.parts.length) { for (var k = 0, q = e.parts.length; k < q; k++) { if (l = parseInt(j[k], 10), g = e.parts[k], isNaN(l)) switch (g) { case "MM": m = a(d[f].months).filter(function () { var a = this.slice(0, j[k].length), b = j[k].slice(0, a.length); return a == b }), l = a.inArray(m[0], d[f].months) + 1; break; case "M": m = a(d[f].monthsShort).filter(function () { var a = this.slice(0, j[k].length), b = j[k].slice(0, a.length); return a == b }), l = a.inArray(m[0], d[f].monthsShort) + 1 } n[g] = l } for (var r, k = 0; k < o.length; k++) r = o[k], r in n && !isNaN(n[r]) && p[r](c, n[r]) } return c }, formatDate: function (b, c, e) { if (null == b) return ""; var f = { h: b.getUTCHours(), i: b.getUTCMinutes(), s: b.getUTCSeconds(), d: b.getUTCDate(), m: b.getUTCMonth() + 1, M: d[e].monthsShort[b.getUTCMonth()], MM: d[e].months[b.getUTCMonth()], yy: b.getUTCFullYear().toString().substring(2), yyyy: b.getUTCFullYear() }; f.hh = (f.h < 10 ? "0" : "") + f.h, f.ii = (f.i < 10 ? "0" : "") + f.i, f.ss = (f.s < 10 ? "0" : "") + f.s, f.dd = (f.d < 10 ? "0" : "") + f.d, f.mm = (f.m < 10 ? "0" : "") + f.m; for (var b = [], g = a.extend([], c.separators), h = 0, i = c.parts.length; h < i; h++) g.length && b.push(g.shift()), b.push(f[c.parts[h]]); return b.join("") }, convertViewMode: function (a) { switch (a) { case 4: case "decade": a = 4; break; case 3: case "year": a = 3; break; case 2: case "month": a = 2; break; case 1: case "day": a = 1; break; case 0: case "hour": a = 0 } return a }, headTemplate: function (a, b) { return '<thead><tr><th class="prev">' + a + '</th><th colspan="5" class="date-switch"></th><th class="next">' + b + "</th></tr></thead>" }, contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>', footTemplate: '<tfoot><tr><th colspan="7" class="today"></th></tr></tfoot>' }; e.template = function (a, b, c) { return '<div class="datepicker"><div class="datepicker-minutes"><table class=" table-condensed">' + e.headTemplate(a, b) + e.contTemplate + e.footTemplate + '</table></div><div class="datepicker-hours"><table class=" table-condensed">' + e.headTemplate(a, b) + e.contTemplate + e.footTemplate + '</table></div><div class="datepicker-days"><table class=" table-condensed">' + e.headTemplate(a, b) + "<tbody></tbody>" + e.footTemplate + '</table></div><div class="datepicker-months"><table class="table-condensed">' + e.headTemplate(a, b) + e.contTemplate + e.footTemplate + '</table></div><div class="datepicker-years"><table class="table-condensed">' + e.headTemplate(a, b) + e.contTemplate + e.footTemplate + '</table></div><a class="button datepicker-close tiny alert right" style="width:auto;">' + c + "</a></div>" }, a.fn.fdatepicker.DPGlobal = e }(window.jQuery);;!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.dropkickjs=t():e.dropkickjs=t()}(this,function(){return function(e){function t(s){if(i[s])return i[s].exports;var a=i[s]={i:s,l:!1,exports:{}};return e[s].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var i={};return t.m=e,t.c=i,t.d=function(e,i,s){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:s})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,i){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=function(){function e(e,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}return function(t,i,s){return i&&e(t.prototype,i),s&&e(t,s),t}}(),o=i(1),d=s(o),r=i(2),c=s(r),h=i(3),u=s(h),f=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),p=window.parent!==window.self,p1 = window.self !== window.top,b=void 0,m=function(){function e(t,i){a(this,e),this.sel=t;var s=void 0,n=void 0,l=window.Dropkick;for("string"==typeof this.sel&&"#"===this.sel[0]&&(this.sel=document.getElementById(t.substr(1))),s=0;s<l.uid;s++)if((n=l.cache[s])instanceof e&&n.data.select===this.sel)return d.default.extend(n.data.settings,i),n;if(!this.sel)throw"You must pass a select to DropKick";if(this.sel.length<1)throw"You must have options inside your <select>: "+t;if("SELECT"===this.sel.nodeName)return this.init(this.sel,i)}return l(e,[{key:"init",value:function(t,i){var s,a=window.Dropkick,n=e.build(t,"dk"+a.uid);if(this.data={},this.data.select=t,this.data.elem=n.elem,this.data.settings=d.default.extend({},c.default,i),this.disabled=t.disabled,this.form=t.form,this.length=t.length,this.multiple=t.multiple,this.options=n.options.slice(0),this.selectedIndex=t.selectedIndex,this.selectedOptions=n.selected.slice(0),this.value=t.value,this.data.cacheID=a.uid,a.cache[this.data.cacheID]=this,this.data.settings.initialize.call(this),a.uid+=1,this._changeListener||(t.addEventListener("change",this),this._changeListener=!0),!f||this.data.settings.mobile){if(t.parentNode.insertBefore(this.data.elem,t),t.setAttribute("data-dkCacheId",this.data.cacheID),this.data.elem.addEventListener("click",this),this.data.elem.addEventListener("keydown",this),this.data.elem.addEventListener("keypress",this),this.form&&this.form.addEventListener("reset",this),!this.multiple)for(s=0;s<this.options.length;s++)this.options[s].addEventListener("mouseover",this);b||(document.addEventListener("click",e.onDocClick),p&&!p1&&parent.document.addEventListener("click",e.onDocClick),b=!0)}return this}},{key:"add",value:function(e,t){var i,s,a;"string"==typeof e&&(i=e,e=document.createElement("option"),e.text=i),"OPTION"===e.nodeName&&(s=d.default.create("li",{class:"dk-option","data-value":e.value,text:e.text,innerHTML:e.innerHTML,role:"option","aria-selected":"false",id:"dk"+this.data.cacheID+"-"+(e.id||e.value.replace(" ","-"))}),d.default.addClass(s,e.className),this.length+=1,e.disabled&&(d.default.addClass(s,"dk-option-disabled"),s.setAttribute("aria-disabled","true")),e.hidden&&(d.default.addClass(s,"dk-option-hidden"),s.setAttribute("aria-hidden","true")),this.data.select.add(e,t),"number"==typeof t&&(t=this.item(t)),a=this.options.indexOf(t),a>-1?(t.parentNode.insertBefore(s,t),this.options.splice(a,0,s)):(this.data.elem.lastChild.appendChild(s),this.options.push(s)),s.addEventListener("mouseover",this),e.selected&&this.select(a))}},{key:"item",value:function(e){return e=e<0?this.options.length+e:e,this.options[e]||null}},{key:"remove",value:function(e){var t=this.item(e);t.parentNode.removeChild(t),this.options.splice(e,1),this.data.select.remove(e),this.select(this.data.select.selectedIndex),this.length-=1}},{key:"close",value:function(){var e,t=this.data.elem;if(!this.isOpen||this.multiple)return!1;for(e=0;e<this.options.length;e++)d.default.removeClass(this.options[e],"dk-option-highlight");t.lastChild.setAttribute("aria-expanded","false"),d.default.removeClass(t.lastChild,"dk-select-options-highlight"),d.default.removeClass(t,"dk-select-open-(up|down)"),this.isOpen=!1,this.data.settings.close.call(this)}},{key:"open",value:function(){var e=void 0,t=void 0,i=void 0,s=void 0,a=void 0,n=void 0,l=this.data.elem,o=l.lastChild,r=void 0!==window.pageXOffset,c="CSS1Compat"===(document.compatMode||""),h=r?window.pageYOffset:c?document.documentElement.scrollTop:document.body.scrollTop;if(a=d.default.offset(l).top-h,n=window.innerHeight-(a+l.offsetHeight),this.isOpen||this.multiple)return!1;o.style.display="block",e=o.offsetHeight,o.style.display="",t=a>e,i=n>e,s=t&&!i?"-up":"-down",this.isOpen=!0,d.default.addClass(l,"dk-select-open"+s),o.setAttribute("aria-expanded","true"),this._scrollTo(this.options.length-1),this._scrollTo(this.selectedIndex),this.data.settings.open.call(this)}},{key:"disable",value:function(e,t){var i="dk-option-disabled";0!==arguments.length&&"boolean"!=typeof e||(t=void 0===e,e=this.data.elem,i="dk-select-disabled",this.disabled=t),void 0===t&&(t=!0),"number"==typeof e&&(e=this.item(e)),t?(e.setAttribute("aria-disabled",!0),d.default.addClass(e,i)):(e.setAttribute("aria-disabled",!1),d.default.removeClass(e,i))}},{key:"hide",value:function(e,t){void 0===t&&(t=!0),e=this.item(e),t?(e.setAttribute("aria-hidden",!0),d.default.addClass(e,"dk-option-hidden")):(e.setAttribute("aria-hidden",!1),d.default.removeClass(e,"dk-option-hidden"))}},{key:"select",value:function(e,t){var i,s,a,n,l=this.data.select;if("number"==typeof e&&(e=this.item(e)),"string"==typeof e)for(i=0;i<this.length;i++)this.options[i].getAttribute("data-value")===e&&(e=this.options[i]);return!(!e||"string"==typeof e||!t&&d.default.hasClass(e,"dk-option-disabled"))&&(d.default.hasClass(e,"dk-option")?(s=this.options.indexOf(e),a=l.options[s],this.multiple?(d.default.toggleClass(e,"dk-option-selected"),a.selected=!a.selected,d.default.hasClass(e,"dk-option-selected")?(e.setAttribute("aria-selected","true"),this.selectedOptions.push(e)):(e.setAttribute("aria-selected","false"),s=this.selectedOptions.indexOf(e),this.selectedOptions.splice(s,1))):(n=this.data.elem.firstChild,this.selectedOptions.length&&(d.default.removeClass(this.selectedOptions[0],"dk-option-selected"),this.selectedOptions[0].setAttribute("aria-selected","false")),d.default.addClass(e,"dk-option-selected"),e.setAttribute("aria-selected","true"),n.setAttribute("aria-activedescendant",e.id),n.className="dk-selected "+a.className,n.innerHTML=a.innerHTML,this.selectedOptions[0]=e,a.selected=!0),this.selectedIndex=l.selectedIndex,this.value=l.value,t||this.data.select.dispatchEvent(new u.default("change",{bubbles:this.data.settings.bubble})),e):void 0)}},{key:"selectOne",value:function(e,t){return this.reset(!0),this._scrollTo(e),this.select(e,t)}},{key:"search",value:function(e,t){var i,s,a,n,l,o,d,r,c=this.data.select.options,h=[];if(!e)return this.options;for(t=t?t.toLowerCase():"strict",t="fuzzy"===t?2:"partial"===t?1:0,r=new RegExp((t?"":"^")+e,"i"),i=0;i<c.length;i++)if(a=c[i].text.toLowerCase(),2==t){for(s=e.toLowerCase().split(""),n=l=o=d=0;l<a.length;)a[l]===s[n]?(o+=1+o,n++):o=0,d+=o,l++;n===s.length&&h.push({e:this.options[i],s:d,i:i})}else r.test(a)&&h.push(this.options[i]);return 2===t&&(h=h.sort(function(e,t){return t.s-e.s||e.i-t.i}).reduce(function(e,t){return e[e.length]=t.e,e},[])),h}},{key:"focus",value:function(){this.disabled||(this.multiple?this.data.elem:this.data.elem.children[0]).focus()}},{key:"reset",value:function(e){var t,i=this.data.select;for(this.selectedOptions.length=0,t=0;t<i.options.length;t++)i.options[t].selected=!1,d.default.removeClass(this.options[t],"dk-option-selected"),this.options[t].setAttribute("aria-selected","false"),!e&&i.options[t].defaultSelected&&this.select(t,!0);this.selectedOptions.length||this.multiple||this.select(0,!0)}},{key:"refresh",value:function(){Object.keys(this).length>0&&(!f||this.data.settings.mobile)&&this.dispose().init(this.data.select,this.data.settings)}},{key:"dispose",value:function(){var e=window.Dropkick;return Object.keys(this).length>0&&(!f||this.data.settings.mobile)&&(delete e.cache[this.data.cacheID],this.data.elem.parentNode.removeChild(this.data.elem),this.data.select.removeAttribute("data-dkCacheId")),this}},{key:"handleEvent",value:function(e){if(!this.disabled)switch(e.type){case"click":this._delegate(e);break;case"keydown":this._keyHandler(e);break;case"keypress":this._searchOptions(e);break;case"mouseover":this._highlight(e);break;case"reset":this.reset();break;case"change":this.data.settings.change.call(this)}}},{key:"_delegate",value:function(e){var t,i,s,a,n=e.target;if(d.default.hasClass(n,"dk-option-disabled"))return!1;if(this.multiple){if(d.default.hasClass(n,"dk-option"))if(t=window.getSelection(),"Range"===t.type&&t.collapseToStart(),e.shiftKey)if(s=this.options.indexOf(this.selectedOptions[0]),a=this.options.indexOf(this.selectedOptions[this.selectedOptions.length-1]),i=this.options.indexOf(n),i>s&&i<a&&(i=s),i>a&&a>s&&(a=s),this.reset(!0),a>i)for(;i<a+1;)this.select(i++);else for(;i>a-1;)this.select(i--);else e.ctrlKey||e.metaKey?this.select(n):(this.reset(!0),this.select(n))}else this[this.isOpen?"close":"open"](),d.default.hasClass(n,"dk-option")&&this.select(n)}},{key:"_highlight",value:function(e){var t,i=e.target;if(!this.multiple){for(t=0;t<this.options.length;t++)d.default.removeClass(this.options[t],"dk-option-highlight");d.default.addClass(this.data.elem.lastChild,"dk-select-options-highlight"),d.default.addClass(i,"dk-option-highlight")}}},{key:"_keyHandler",value:function(e){var t,i,s=this.selectedOptions,a=this.options,n=1,l={tab:9,enter:13,esc:27,space:32,up:38,down:40};switch(e.keyCode){case l.up:n=-1;case l.down:if(e.preventDefault(),t=s[s.length-1],d.default.hasClass(this.data.elem.lastChild,"dk-select-options-highlight"))for(d.default.removeClass(this.data.elem.lastChild,"dk-select-options-highlight"),i=0;i<a.length;i++)d.default.hasClass(a[i],"dk-option-highlight")&&(d.default.removeClass(a[i],"dk-option-highlight"),t=a[i]);n=a.indexOf(t)+n,n>a.length-1?n=a.length-1:n<0&&(n=0),this.data.select.options[n].disabled||(this.reset(!0),this.select(n),this._scrollTo(n));break;case l.space:if(!this.isOpen){e.preventDefault(),this.open();break}case l.tab:case l.enter:for(n=0;n<a.length;n++)d.default.hasClass(a[n],"dk-option-highlight")&&this.select(n);case l.esc:this.isOpen&&(e.preventDefault(),this.close())}}},{key:"_searchOptions",value:function(e){var t,i=this,s=String.fromCharCode(e.keyCode||e.which);void 0===this.data.searchString&&(this.data.searchString=""),function(){i.data.searchTimeout&&clearTimeout(i.data.searchTimeout),i.data.searchTimeout=setTimeout(function(){i.data.searchString=""},1e3)}(),this.data.searchString+=s,t=this.search(this.data.searchString,this.data.settings.search),t.length&&(d.default.hasClass(t[0],"dk-option-disabled")||this.selectOne(t[0]))}},{key:"_scrollTo",value:function(e){var t,i,s,a=this.data.elem.lastChild;if(-1===e||"number"!=typeof e&&!e||!this.isOpen&&!this.multiple)return!1;"number"==typeof e&&(e=this.item(e)),t=d.default.position(e,a).top,i=t-a.scrollTop,s=i+e.offsetHeight,s>a.offsetHeight?(t+=e.offsetHeight,a.scrollTop=t-a.offsetHeight):i<0&&(a.scrollTop=t)}}]),e}();window.Dropkick=m,window.Dropkick.cache={},window.Dropkick.uid=0,m.build=function(e,t){var i,s,a,n=[],l={elem:null,options:[],selected:[]},o=function e(i){var s,a,n,o,r=[];switch(i.nodeName){case"OPTION":s=d.default.create("li",{class:"dk-option ","data-value":i.value,text:i.text,innerHTML:i.innerHTML,role:"option","aria-selected":"false",id:t+"-"+(i.id||i.value.replace(" ","-"))}),d.default.addClass(s,i.className),i.disabled&&(d.default.addClass(s,"dk-option-disabled"),s.setAttribute("aria-disabled","true")),i.hidden&&(d.default.addClass(s,"dk-option-hidden"),s.setAttribute("aria-hidden","true")),i.selected&&(d.default.addClass(s,"dk-option-selected"),s.setAttribute("aria-selected","true"),l.selected.push(s)),l.options.push(this.appendChild(s));break;case"OPTGROUP":for(a=d.default.create("li",{class:"dk-optgroup"}),i.label&&a.appendChild(d.default.create("div",{class:"dk-optgroup-label",innerHTML:i.label})),n=d.default.create("ul",{class:"dk-optgroup-options"}),o=i.children.length;o--;r.unshift(i.children[o]));i.disabled&&(a.classList.add("dk-optgroup-disabled"),r.forEach(function(e){e.disabled=i.disabled})),r.forEach(e,n),this.appendChild(a).appendChild(n)}};for(l.elem=d.default.create("div",{class:"dk-select"+(e.multiple?"-multi":"")}),s=d.default.create("ul",{class:"dk-select-options",id:t+"-listbox",role:"listbox"}),e.disabled&&(d.default.addClass(l.elem,"dk-select-disabled"),l.elem.setAttribute("aria-disabled",!0)),l.elem.id=t+(e.id?"-"+e.id:""),d.default.addClass(l.elem,e.className),e.multiple?(l.elem.setAttribute("tabindex",e.getAttribute("tabindex")||"0"),s.setAttribute("aria-multiselectable","true")):(i=e.options[e.selectedIndex],l.elem.appendChild(d.default.create("div",{class:"dk-selected "+(i?i.className:""),tabindex:e.tabindex||0,innerHTML:i?i.text:"&nbsp;",id:t+"-combobox","aria-live":"assertive","aria-owns":s.id,role:"combobox"})),s.setAttribute("aria-expanded","false")),a=e.children.length;a--;n.unshift(e.children[a]));return n.forEach(o,l.elem.appendChild(s)),l},m.onDocClick=function(e){var t,i,s=window.Dropkick;if(1!==e.target.nodeType)return!1;null!==(t=e.target.getAttribute("data-dkcacheid"))&&s.cache[t].focus();for(i in s.cache)d.default.closest(e.target,s.cache[i].data.elem)||i===t||s.cache[i].disabled||s.cache[i].close()},void 0!==window.jQuery&&(window.jQuery.fn.dropkick=function(){var e=Array.prototype.slice.call(arguments);return jQuery(this).each(function(){e[0]&&"object"!==n(e[0])?"string"==typeof e[0]&&m.prototype[e[0]].apply(new m(this),e.slice(1)):new m(this,e[0]||{})})}),t.default=m},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=-1!==navigator.appVersion.indexOf("MSIE"),a={hasClass:function(e,t){var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");return e&&i.test(e.className)},addClass:function(e,t){e&&!this.hasClass(e,t)&&(e.className+=" "+t)},removeClass:function(e,t){var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");e&&(e.className=e.className.replace(i," "))},toggleClass:function(e,t){this[(this.hasClass(e,t)?"remove":"add")+"Class"](e,t)},extend:function(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){if(t)for(var i in t)e[i]=t[i]}),e},offset:function(e){var t=e.getBoundingClientRect()||{top:0,left:0},i=document.documentElement,a=s?i.scrollTop:window.pageYOffset,n=s?i.scrollLeft:window.pageXOffset;return{top:t.top+a-i.clientTop,left:t.left+n-i.clientLeft}},position:function(e,t){for(var i={top:0,left:0};e&&e!==t;)i.top+=e.offsetTop,i.left+=e.offsetLeft,e=e.parentNode;return i},closest:function(e,t){for(;e;){if(e===t)return e;e=e.parentNode}return!1},create:function(e,t){var i=void 0,s=document.createElement(e);t||(t={});for(i in t)t.hasOwnProperty(i)&&("innerHTML"===i?s.innerHTML=t[i]:s.setAttribute(i,t[i]));return s},deferred:function(e){return function(){var t=this,i=arguments;window.setTimeout(function(){e.apply(t,i)},1)}}};t.default=a},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s={initialize:function(){},mobile:!0,change:function(){},open:function(){},close:function(){},search:"strict",bubble:!0};t.default=s},function(e,t,i){(function(t){var i=t.CustomEvent;e.exports=function(){try{var e=new i("cat",{detail:{foo:"bar"}});return"cat"===e.type&&"bar"===e.detail.foo}catch(e){}return!1}()?i:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(e,t){var i=document.createEvent("CustomEvent");return t?i.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):i.initCustomEvent(e,!1,!1,void 0),i}:function(e,t){var i=document.createEventObject();return i.type=e,t?(i.bubbles=Boolean(t.bubbles),i.cancelable=Boolean(t.cancelable),i.detail=t.detail):(i.bubbles=!1,i.cancelable=!1,i.detail=void 0),i}}).call(t,i(4))},function(e,t){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(i=window)}e.exports=i}])});;function screenShot(formID, formGUID) {
    
    //WORK IN PROGRESS
    var pdfName = 'Test' + ' Report';
    // Convert the DOM element to a drawing using kendo.drawing.drawDOM
    kendo.drawing.drawDOM($("#genericForm"))
        .then(function (group) {
            // Render the result as a PDF file
            return kendo.drawing.exportPDF(group, {
                paperSize: "auto",
                margin: { left: "1cm", top: "1cm", right: "1cm", bottom: "1cm" }
            });
        })
        .done(function (data) {
            $.ajax({
                type: "POST",
                url: "/Form/Screenshot",
                data: { base64: data, formID: formID, guid: formGUID },
                //contentType: "application/json",
                cache: false,
                //success: function (data) {
                //},
                //error: function (jqXHR, ex) {
                //    $('#submissionResult').html("An unexpected error has occurred");
                //    moveToNextPage(currentPage,false);
                //    //$("#formResponseInfo").empty().html(data.Message).show().addClass("warn");
                //    //$("#regSubmit").removeAttr('disabled').val(bText);
                //    logex(jqXHR, "Stream Form Post error xhr");
                //    logex(jqXHR.responseText, "Stream Form Post error xhr.rt");
                //    logex(ex, "Stream Form Post error ex");
                //}
            });
                
            //// Save the PDF file
            //kendo.saveAs({
            //    dataURI: data,
            //    fileName: @Model.FormID,
            //    proxyURL: '@Url.Action("Screenshot", "Form")', //"/Form/Screenshot/",
            //    forceProxy: true
            //});
        });
}

function buildFormResult() {
    var result = new Object();
    result.elements = [];

    $('input, select, textarea').each(function() {
        var element = $(this);
        if (!element.prop('disabled')) {
            var item = new Object();
            item.id = $(this).attr('id');
            item.name = $(this).attr('name');
            item.eid = $(this).data('elementid');
            item.tid = $(this).data('etypeid');

            var formGroupItem = element.closest('.formGroupItem');

            if (formGroupItem.length > 0) {
                item.groupItemId = $(formGroupItem[0]).attr('id');
                item.groupType = $(formGroupItem[0]).data('grouptype');
            };

            if ($(this).is('select')) {
                if ($(this).is(":not([multiple])")) {
                    var selected = $(this).children("option").filter(":selected");
                    item.text = selected.text();
                    item.value = $(this).val();
                    item.oid = selected.data('optionid');
                    item.score = selected.data('score');
                    item.isKnockout = selected.data('isknockout');
                    item.isPrime = selected.data('isprime');
                } else {
                    item.values = [];

                    $(this).children("option").filter(":selected").each(function(index, option) {
                        var slctdOption = new Object();
                        var opVal = $(option).val();
                        slctdOption.text = $(option).text();
                        slctdOption.value = opVal;
                        if (msMap) {
                            var msEl = msMap[item.eid];
                            if (msEl) {
                                var option = msEl[opVal];
                                if (option) {
                                    slctdOption.oid = option.FormQuestionOptionID;
                                    slctdOption.score = option.Score;
                                    slctdOption.isKnockout = option.IsKnockout;
                                    slctdOption.isPrime = option.IsPrime;
                                }
                            }
                        }

                        //slctdOption.oid = $(option).data('optionid');
                        item.values.push(slctdOption);
                    });
                    //console.log(item.selected);
                }
            } else {
                if ($(this).hasClass('mobilePhone')) {
                    item.value = $(this).intlTelInput("getNumber");
                } else {
                    if (item.id == "g-recaptcha-response") {
                        item.recaptchaToken = $(this).val();
                    } else {
                        item.value = $(this).val();
                    }
                }
            }


            if ($(this).is(':radio') || $(this).is(':checkbox')) {
                var checked = $(this).is(":checked");
                item.isChecked = checked;

                if (checked) {
                    item.Score = $(this).data('score');
                    var isknockout = $(this).data('isknockout');
                    var isprime = $(this).data('isprime');
                    if (isknockout === true) {
                        item.isKnockout = true;
                    }
                    if (isprime === true) {
                        item.isPrime = true;
                    }
                }
                
            }

            result.elements.push(item);
        }
    });

    return result;
}

function saveForm(formID, formTypeID, page) {
    
    try {

        var modelData = {
            model: {
                FormID: formID,
                FormTypeID: formTypeID
            },
            page: page,
            formResult: buildFormResult()
        };

        $.ajax({
            type: "POST",
            // url: "/Register/register",
            url: '/Form/SaveProgress',
            data: JSON.stringify(modelData), //{ _formdata: fd, formID: @Model.FormID, listID: @(Model.ListID.HasValue ? Model.ListID.Value : 0 ) },
            contentType: "application/json",
            cache: false,
            success: function (data) {
            }/*,
            error: function (jqXHR, ex) {
            },
            complete: function() {
            }*/
        });
    } catch (e) {
    }
}

function switchChange(e) {
    var name = $(e.sender.element[0])[0].name;
    var hidden = name.replace("switch", "");
    var el = $('[name=' + hidden + ']');
    if (name.startsWith("PID10") || name.startsWith("PID29")) {
        $(el).val(e.checked ? 'false' : 'true');
    } else {
        $(el).val(e.checked ? 'true' : 'false');
    }
}


function send2faCode(sid, msisdn, callback) {
    var modelData = {
        sid: sid,
        msisdn: msisdn
    };
    $.ajax({
        type: "POST",
        url: '/Form/SendVerificationCode',
        data: JSON.stringify(modelData),
        contentType: "application/json",
        cache: false,
        success: function (data) {
            if (callback) {
                callback(data.Success);
            }
        },
        error: function (jqXHR, ex) {
            if (callback) {
                callback(false);
            }
        }
    });
}
 ;