PK œqhYî¶J‚ßF ßF ) nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/
Dir : /home/trave494/hotebooking.site/wp-content/themes/traveler/dist/mobile/ |
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64 IP: 209.182.202.254 |
Dir : /home/trave494/hotebooking.site/wp-content/themes/traveler/dist/mobile/traveler.js |
window.Modernizr=function(e,t,n){function r(e){g.cssText=e}function o(e,t){return typeof e===t}function i(e,t){return!!~(""+e).indexOf(t)}function a(e,t){for(var r in e){var o=e[r];if(!i(o,"-")&&g[o]!==n)return"pfx"==t?o:!0}return!1}function c(e,t,r){for(var i in e){var a=t[e[i]];if(a!==n)return r===!1?e[i]:o(a,"function")?a.bind(r||t):a}return!1}function s(e,t,n){var r=e.charAt(0).toUpperCase()+e.slice(1),i=(e+" "+j.join(r+" ")+r).split(" ");return o(t,"string")||o(t,"undefined")?a(i,t):(i=(e+" "+C.join(r+" ")+r).split(" "),c(i,t,n))}var l,u,f,d="2.6.2",p={},m=!0,h=t.documentElement,y="modernizr",v=t.createElement(y),g=v.style,b=({}.toString," -webkit- -moz- -o- -ms- ".split(" ")),E="Webkit Moz O ms",j=E.split(" "),C=E.toLowerCase().split(" "),w={},x=[],S=x.slice,N=function(e,n,r,o){var i,a,c,s,l=t.createElement("div"),u=t.body,f=u||t.createElement("body");if(parseInt(r,10))for(;r--;)c=t.createElement("div"),c.id=o?o[r]:y+(r+1),l.appendChild(c);return i=["­",'<style id="s',y,'">',e,"</style>"].join(""),l.id=y,(u?l:f).innerHTML+=i,f.appendChild(l),u||(f.style.background="",f.style.overflow="hidden",s=h.style.overflow,h.style.overflow="hidden",h.appendChild(f)),a=n(l,e),u?l.parentNode.removeChild(l):(f.parentNode.removeChild(f),h.style.overflow=s),!!a},k={}.hasOwnProperty;f=o(k,"undefined")||o(k.call,"undefined")?function(e,t){return t in e&&o(e.constructor.prototype[t],"undefined")}:function(e,t){return k.call(e,t)},Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if("function"!=typeof t)throw new TypeError;var n=S.call(arguments,1),r=function(){if(this instanceof r){var o=function(){};o.prototype=t.prototype;var i=new o,a=t.apply(i,n.concat(S.call(arguments)));return Object(a)===a?a:i}return t.apply(e,n.concat(S.call(arguments)))};return r}),w.touch=function(){var n;return"ontouchstart"in e||e.DocumentTouch&&t instanceof DocumentTouch?n=!0:N(["@media (",b.join("touch-enabled),("),y,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(e){n=9===e.offsetTop}),n},w.backgroundsize=function(){return s("backgroundSize")},w.csstransforms3d=function(){var e=!!s("perspective");return e&&"webkitPerspective"in h.style&&N("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(t,n){e=9===t.offsetLeft&&3===t.offsetHeight}),e},w.csstransitions=function(){return s("transition")};for(var T in w)f(w,T)&&(u=T.toLowerCase(),p[u]=w[T](),x.push((p[u]?"":"no-")+u));return p.addTest=function(e,t){if("object"==typeof e)for(var r in e)f(e,r)&&p.addTest(r,e[r]);else{if(e=e.toLowerCase(),p[e]!==n)return p;t="function"==typeof t?t():t,"undefined"!=typeof m&&m&&(h.className+=" "+(t?"":"no-")+e),p[e]=t}return p},r(""),v=l=null,function(e,t){function n(e,t){var n=e.createElement("p"),r=e.getElementsByTagName("head")[0]||e.documentElement;return n.innerHTML="x<style>"+t+"</style>",r.insertBefore(n.lastChild,r.firstChild)}function r(){var e=v.elements;return"string"==typeof e?e.split(" "):e}function o(e){var t=y[e[m]];return t||(t={},h++,e[m]=h,y[h]=t),t}function i(e,n,r){if(n||(n=t),u)return n.createElement(e);r||(r=o(n));var i;return i=r.cache[e]?r.cache[e].cloneNode():p.test(e)?(r.cache[e]=r.createElem(e)).cloneNode():r.createElem(e),i.canHaveChildren&&!d.test(e)?r.frag.appendChild(i):i}function a(e,n){if(e||(e=t),u)return e.createDocumentFragment();n=n||o(e);for(var i=n.frag.cloneNode(),a=0,c=r(),s=c.length;s>a;a++)i.createElement(c[a]);return i}function c(e,t){t.cache||(t.cache={},t.createElem=e.createElement,t.createFrag=e.createDocumentFragment,t.frag=t.createFrag()),e.createElement=function(n){return v.shivMethods?i(n,e,t):t.createElem(n)},e.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+r().join().replace(/\w+/g,function(e){return t.createElem(e),t.frag.createElement(e),'c("'+e+'")'})+");return n}")(v,t.frag)}function s(e){e||(e=t);var r=o(e);return v.shivCSS&&!l&&!r.hasCSS&&(r.hasCSS=!!n(e,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),u||c(e,r),e}var l,u,f=e.html5||{},d=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,m="_html5shiv",h=0,y={};!function(){try{var e=t.createElement("a");e.innerHTML="<xyz></xyz>",l="hidden"in e,u=1==e.childNodes.length||function(){t.createElement("a");var e=t.createDocumentFragment();return"undefined"==typeof e.cloneNode||"undefined"==typeof e.createDocumentFragment||"undefined"==typeof e.createElement}()}catch(n){l=!0,u=!0}}();var v={elements:f.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:f.shivCSS!==!1,supportsUnknownElements:u,shivMethods:f.shivMethods!==!1,type:"default",shivDocument:s,createElement:i,createDocumentFragment:a};e.html5=v,s(t)}(this,t),p._version=d,p._prefixes=b,p._domPrefixes=C,p._cssomPrefixes=j,p.testProp=function(e){return a([e])},p.testAllProps=s,p.testStyles=N,p.prefixed=function(e,t,n){return t?s(e,t,n):s(e,"pfx")},h.className=h.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(m?" js "+x.join(" "):""),p}(this,this.document),function(e,t,n){function r(e){return"[object Function]"==y.call(e)}function o(e){return"string"==typeof e}function i(){}function a(e){return!e||"loaded"==e||"complete"==e||"uninitialized"==e}function c(){var e=v.shift();g=1,e?e.t?m(function(){("c"==e.t?d.injectCss:d.injectJs)(e.s,0,e.a,e.x,e.e,1)},0):(e(),c()):g=0}function s(e,n,r,o,i,s,l){function u(t){if(!p&&a(f.readyState)&&(b.r=p=1,!g&&c(),f.onload=f.onreadystatechange=null,t)){"img"!=e&&m(function(){j.removeChild(f)},50);for(var r in N[n])N[n].hasOwnProperty(r)&&N[n][r].onload()}}var l=l||d.errorTimeout,f=t.createElement(e),p=0,y=0,b={t:r,s:n,e:i,a:s,x:l};1===N[n]&&(y=1,N[n]=[]),"object"==e?f.data=n:(f.src=n,f.type=e),f.width=f.height="0",f.onerror=f.onload=f.onreadystatechange=function(){u.call(this,y)},v.splice(o,0,b),"img"!=e&&(y||2===N[n]?(j.insertBefore(f,E?null:h),m(u,l)):N[n].push(f))}function l(e,t,n,r,i){return g=0,t=t||"j",o(e)?s("c"==t?w:C,e,t,this.i++,n,r,i):(v.splice(this.i++,0,e),1==v.length&&c()),this}function u(){var e=d;return e.loader={load:l,i:0},e}var f,d,p=t.documentElement,m=e.setTimeout,h=t.getElementsByTagName("script")[0],y={}.toString,v=[],g=0,b="MozAppearance"in p.style,E=b&&!!t.createRange().compareNode,j=E?p:h.parentNode,p=e.opera&&"[object Opera]"==y.call(e.opera),p=!!t.attachEvent&&!p,C=b?"object":p?"script":"img",w=p?"script":C,x=Array.isArray||function(e){return"[object Array]"==y.call(e)},S=[],N={},k={timeout:function(e,t){return t.length&&(e.timeout=t[0]),e}};d=function(e){function t(e){var t,n,r,e=e.split("!"),o=S.length,i=e.pop(),a=e.length,i={url:i,origUrl:i,prefixes:e};for(n=0;a>n;n++)r=e[n].split("="),(t=k[r.shift()])&&(i=t(i,r));for(n=0;o>n;n++)i=S[n](i);return i}function a(e,o,i,a,c){var s=t(e),l=s.autoCallback;s.url.split(".").pop().split("?").shift(),s.bypass||(o&&(o=r(o)?o:o[e]||o[a]||o[e.split("/").pop().split("?")[0]]),s.instead?s.instead(e,o,i,a,c):(N[s.url]?s.noexec=!0:N[s.url]=1,i.load(s.url,s.forceCSS||!s.forceJS&&"css"==s.url.split(".").pop().split("?").shift()?"c":n,s.noexec,s.attrs,s.timeout),(r(o)||r(l))&&i.load(function(){u(),o&&o(s.origUrl,c,a),l&&l(s.origUrl,c,a),N[s.url]=2})))}function c(e,t){function n(e,n){if(e){if(o(e))n||(f=function(){var e=[].slice.call(arguments);d.apply(this,e),p()}),a(e,f,t,0,l);else if(Object(e)===e)for(s in c=function(){var t,n=0;for(t in e)e.hasOwnProperty(t)&&n++;return n}(),e)e.hasOwnProperty(s)&&(!n&&!--c&&(r(f)?f=function(){var e=[].slice.call(arguments);d.apply(this,e),p()}:f[s]=function(e){return function(){var t=[].slice.call(arguments);e&&e.apply(this,t),p()}}(d[s])),a(e[s],f,t,s,l))}else!n&&p()}var c,s,l=!!e.test,u=e.load||e.both,f=e.callback||i,d=f,p=e.complete||i;n(l?e.yep:e.nope,!!u),u&&n(u)}var s,l,f=this.yepnope.loader;if(o(e))a(e,0,f,0);else if(x(e))for(s=0;s<e.length;s++)l=e[s],o(l)?a(l,0,f,0):x(l)?d(l):Object(l)===l&&c(l,f);else Object(e)===e&&c(e,f)},d.addPrefix=function(e,t){k[e]=t},d.addFilter=function(e){S.push(e)},d.errorTimeout=1e4,null==t.readyState&&t.addEventListener&&(t.readyState="loading",t.addEventListener("DOMContentLoaded",f=function(){t.removeEventListener("DOMContentLoaded",f,0),t.readyState="complete"},0)),e.yepnope=u(),e.yepnope.executeStack=c,e.yepnope.injectJs=function(e,n,r,o,s,l){var u,f,p=t.createElement("script"),o=o||d.errorTimeout;p.src=e;for(f in r)p.setAttribute(f,r[f]);n=l?c:n||i,p.onreadystatechange=p.onload=function(){!u&&a(p.readyState)&&(u=1,n(),p.onload=p.onreadystatechange=null)},m(function(){u||(u=1,n(1))},o),s?p.onload():h.parentNode.insertBefore(p,h)},e.yepnope.injectCss=function(e,n,r,o,a,s){var l,o=t.createElement("link"),n=s?c:n||i;o.href=e,o.rel="stylesheet",o.type="text/css";for(l in r)o.setAttribute(l,r[l]);a||(h.parentNode.insertBefore(o,h),m(n,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};;/*! * Bootstrap v3.3.7 (http://getbootstrap.com) * Copyright 2011-2016 Twitter, Inc. * Licensed under the MIT license */ if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.7",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a("#"===f?[]:f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.7",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c).prop(c,!0)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c).prop(c,!1))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target).closest(".btn");b.call(d,"toggle"),a(c.target).is('input[type="radio"], input[type="checkbox"]')||(c.preventDefault(),d.is("input,button")?d.trigger("focus"):d.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(a>this.$items.length-1||a<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.7",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.7",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",c).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f,g.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var d=this,e=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){d.$element.one("mouseup.dismiss.bs.modal",function(b){a(b.target).is(d.$element)&&(d.ignoreBackdropClick=!0)})}),this.backdrop(function(){var e=a.support.transition&&d.$element.hasClass("fade");d.$element.parent().length||d.$element.appendTo(d.$body),d.$element.show().scrollTop(0),d.adjustDialog(),e&&d.$element[0].offsetWidth,d.$element.addClass("in"),d.enforceFocus();var f=a.Event("shown.bs.modal",{relatedTarget:b});e?d.$dialog.one("bsTransitionEnd",function(){d.$element.trigger("focus").trigger(f)}).emulateTransitionEnd(c.TRANSITION_DURATION):d.$element.trigger("focus").trigger(f)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){document===a.target||this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},c.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$body.removeClass("modal-open"),a.resetAdjustments(),a.resetScrollbar(),a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a(document.createElement("div")).addClass("modal-backdrop "+e).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.adjustDialog()},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth<a,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",a,b)};c.VERSION="3.3.7",c.TRANSITION_DURATION=150,c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);if(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),!c.isInStateTrue())return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-m<o.top?"bottom":"right"==h&&k.right+l>o.width?"left":"left"==h&&k.left-l<o.left?"right":h,f.removeClass(n).addClass(h)}var p=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(p,h);var q=function(){var a=e.hoverState;e.$element.trigger("shown.bs."+e.type),e.hoverState=null,"out"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",q).emulateTransitionEnd(c.TRANSITION_DURATION):q()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top+=g,b.left+=h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(m,d[0][n],l)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?"left":"top",50*(1-a/b)+"%").css(c?"top":"left","")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(b){function d(){"in"!=e.hoverState&&f.detach(),e.$element&&e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),b&&b()}var e=this,f=a(this.$tip),g=a.Event("hide.bs."+this.type);if(this.$element.trigger(g),!g.isDefaultPrevented())return f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",d).emulateTransitionEnd(c.TRANSITION_DURATION):d(),this.hoverState=null,this},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=window.SVGElement&&c instanceof window.SVGElement,g=d?{top:0,left:0}:f?null:b.offset(),h={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},i=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,h,i,g)},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null,a.$element=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.7",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.7",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<e[0])return this.activeTarget=null,this.clear();for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(void 0===e[a+1]||b<e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){ this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.7",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.7",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return e<c&&"top";if("bottom"==this.affixed)return null!=c?!(e+this.unpin<=f.top)&&"bottom":!(e+g<=a-d)&&"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&e<=c?"top":null!=d&&i+j>=a-d&&"bottom"},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); ;/*! Waypoints - 4.0.1 Copyright © 2011-2016 Caleb Troughton Licensed under the MIT license. https://github.com/imakewebthings/waypoints/blob/master/licenses.txt */ !function(){"use strict";function t(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");this.key="waypoint-"+e,this.options=t.Adapter.extend({},t.defaults,o),this.element=this.options.element,this.adapter=new t.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=t.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=t.Context.findOrCreateByElement(this.options.context),t.offsetAliases[this.options.offset]&&(this.options.offset=t.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeAll=function(t){var e=[];for(var o in i)e.push(i[o]);for(var n=0,r=e.length;r>n;n++)e[n][t]()},t.destroyAll=function(){t.invokeAll("destroy")},t.disableAll=function(){t.invokeAll("disable")},t.enableAll=function(){t.Context.refreshAll();for(var e in i)i[e].enabled=!0;return this},t.refreshAll=function(){t.Context.refreshAll()},t.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight},t.viewportWidth=function(){return document.documentElement.clientWidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=t}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}function e(t){this.element=t,this.Adapter=n.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+i,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,o[t.waypointContextKey]=this,i+=1,n.windowContext||(n.windowContext=!0,n.windowContext=new e(window)),this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}var i=0,o={},n=window.Waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical),i=this.element==this.element.window;t&&e&&!i&&(this.adapter.off(".waypoints"),delete o[this.key])},e.prototype.createThrottledResizeHandler=function(){function t(){e.handleResize(),e.didResize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didResize||(e.didResize=!0,n.requestAnimationFrame(t))})},e.prototype.createThrottledScrollHandler=function(){function t(){e.handleScroll(),e.didScroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didScroll||n.isTouch)&&(e.didScroll=!0,n.requestAnimationFrame(t))})},e.prototype.handleResize=function(){n.Context.refreshAll()},e.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:this.adapter.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.adapter.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll,r=n?o.forward:o.backward;for(var s in this.waypoints[i]){var a=this.waypoints[i][s];if(null!==a.triggerPoint){var l=o.oldScroll<a.triggerPoint,h=o.newScroll>=a.triggerPoint,p=l&&h,u=!l&&!h;(p||u)&&(a.queueTrigger(r),t[a.group.id]=a.group)}}}for(var c in t)t[c].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.innerHeight=function(){return this.element==this.element.window?n.viewportHeight():this.adapter.innerHeight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},e.prototype.innerWidth=function(){return this.element==this.element.window?n.viewportWidth():this.adapter.innerWidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;n>o;o++)t[o].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),o={};this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(var r in t){var s=t[r];for(var a in this.waypoints[r]){var l,h,p,u,c,d=this.waypoints[r][a],f=d.options.offset,w=d.triggerPoint,y=0,g=null==w;d.element!==d.element.window&&(y=d.adapter.offset()[s.offsetProp]),"function"==typeof f?f=f.apply(d):"string"==typeof f&&(f=parseFloat(f),d.options.offset.indexOf("%")>-1&&(f=Math.ceil(s.contextDimension*f/100))),l=s.contextScroll-s.contextOffset,d.triggerPoint=Math.floor(y+l-f),h=w<s.oldScroll,p=d.triggerPoint>=s.oldScroll,u=h&&p,c=!h&&!p,!g&&u?(d.queueTrigger(s.backward),o[d.group.id]=d.group):!g&&c?(d.queueTrigger(s.forward),o[d.group.id]=d.group):g&&s.oldScroll>=d.triggerPoint&&(d.queueTrigger(s.forward),o[d.group.id]=d.group)}}return n.requestAnimationFrame(function(){for(var t in o)o[t].flushTriggers()}),this},e.findOrCreateByElement=function(t){return e.findByElement(t)||new e(t)},e.refreshAll=function(){for(var t in o)o[t].refresh()},e.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){r&&r(),e.refreshAll()},n.requestAnimationFrame=function(e){var i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t;i.call(window,e)},n.Context=e}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),o[this.axis][this.name]=this}var o={vertical:{},horizontal:{}},n=window.Waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],right:[]}},i.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;s>r;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints),o=i===this.waypoints.length-1;return o?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=n.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},i.prototype.remove=function(t){var e=n.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findOrCreate=function(t){return o[t.axis][t.name]||new i(t)},n.Group=i}(),function(){"use strict";function t(t){this.$element=e(t)}var e=window.jQuery,i=window.Waypoint;e.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(e,i){t.prototype[i]=function(){var t=Array.prototype.slice.call(arguments);return this.$element[i].apply(this.$element,t)}}),e.each(["extend","inArray","isEmptyObject"],function(i,o){t[o]=e[o]}),i.adapters.push({name:"jquery",Adapter:t}),i.Adapter=t}(),function(){"use strict";function t(t){return function(){var i=[],o=arguments[0];return t.isFunction(arguments[0])&&(o=t.extend({},arguments[1]),o.handler=arguments[0]),this.each(function(){var n=t.extend({},o,{element:this});"string"==typeof n.context&&(n.context=t(this).closest(n.context)[0]),i.push(new e(n))}),i}}var e=window.Waypoint;window.jQuery&&(window.jQuery.fn.waypoint=t(window.jQuery)),window.Zepto&&(window.Zepto.fn.waypoint=t(window.Zepto))}();;!function(a,b,c,d){"use strict";function e(b,c){this.element=b,this.$elem=a(this.element),this.options=a.extend(h,c),this.init()}var f="slimmenu",g=0,h={resizeWidth:"767",initiallyVisible:!1,collapserTitle:"Main Menu",animSpeed:"medium",easingEffect:null,indentChildren:!1,childrenIndenter:" ",expandIcon:"<i>▼</i>",collapseIcon:"<i>▲</i>"};e.prototype={init:function(){var c,d=a(b),e=this.options,f=this.$elem,g='<div class="menu-collapser">'+e.collapserTitle+'<div class="collapse-button"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></div></div>';f.before(g),c=f.prev(".menu-collapser"),f.on("click",".sub-toggle",function(b){b.preventDefault(),b.stopPropagation();var c=a(this).closest("li");a(this).hasClass("expanded")?(a(this).removeClass("expanded").html(e.expandIcon),c.find(">ul").slideUp(e.animSpeed,e.easingEffect)):(a(this).addClass("expanded").html(e.collapseIcon),c.find(">ul").slideDown(e.animSpeed,e.easingEffect))}),c.on("click",".collapse-button",function(a){a.preventDefault(),f.slideToggle(e.animSpeed,e.easingEffect)}),this.resizeMenu(),d.on("resize",this.resizeMenu.bind(this)),d.trigger("resize")},resizeMenu:function(){var c=this,e=a(b),f=e.width(),h=this.options,i=a(this.element),j=a("body").find(".menu-collapser");b.innerWidth!==d&&b.innerWidth>f&&(f=b.innerWidth),f!=g&&(g=f,i.find("li").each(function(){a(this).has("ul").length&&(a(this).addClass("has-submenu").has(".sub-toggle").length?a(this).children(".sub-toggle").html(h.expandIcon):a(this).addClass("has-submenu").append('<span class="sub-toggle">'+h.expandIcon+"</span>")),a(this).children("ul").hide().end().find(".sub-toggle").removeClass("expanded").html(h.expandIcon)}),h.resizeWidth>=f?(h.indentChildren&&i.find("ul").each(function(){var b=a(this).parents("ul").length;a(this).children("li").children("a").has("i").length||a(this).children("li").children("a").prepend(c.indent(b,h))}),i.addClass("collapsed").find("li").has("ul").off("mouseenter mouseleave"),j.show(),h.initiallyVisible||i.hide()):(i.find("li").has("ul").on("mouseenter",function(){a(this).find(">ul").stop().slideDown(h.animSpeed,h.easingEffect)}).on("mouseleave",function(){a(this).find(">ul").stop().slideUp(h.animSpeed,h.easingEffect)}),i.find("li > a > i").remove(),i.removeClass("collapsed").show(),j.hide()))},indent:function(a,b){for(var c=0,d="";a>c;c++)d+=b.childrenIndenter;return"<i>"+d+"</i> "}},a.fn[f]=function(b){return this.each(function(){a.data(this,"plugin_"+f)||a.data(this,"plugin_"+f,new e(this,b))})}}(jQuery,window,document);;!function(a){var n,q,s,t,u,v,w,b="Close",c="BeforeClose",d="AfterClose",e="BeforeAppend",f="MarkupParse",g="Open",h="Change",i="mfp",j="."+i,k="mfp-ready",l="mfp-removing",m="mfp-prevent-close",o=function(){},p=!!window.jQuery,r=a(window),x=function(a,b){n.ev.on(i+a+j,b)},y=function(b,c,d,e){var f=document.createElement("div");return f.className="mfp-"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},z=function(b,c){n.ev.triggerHandler(i+b,c),n.st.callbacks&&(b=b.charAt(0).toLowerCase()+b.slice(1),n.st.callbacks[b]&&n.st.callbacks[b].apply(n,a.isArray(c)?c:[c]))},A=function(){(n.st.focus?n.content.find(n.st.focus).eq(0):n.wrap).trigger("focus")},B=function(b){return b===w&&n.currTemplate.closeBtn||(n.currTemplate.closeBtn=a(n.st.closeMarkup.replace("%title%",n.st.tClose)),w=b),n.currTemplate.closeBtn},C=function(){a.magnificPopup.instance||(n=new o,n.init(),a.magnificPopup.instance=n)},D=function(b){if(!a(b).hasClass(m)){var c=n.st.closeOnContentClick,d=n.st.closeOnBgClick;if(c&&d)return!0;if(!n.content||a(b).hasClass("mfp-close")||n.preloader&&b===n.preloader[0])return!0;if(b===n.content[0]||a.contains(n.content[0],b)){if(c)return!0}else if(d&&a.contains(document,b))return!0;return!1}},E=function(){var a=document.createElement("p").style,b=["ms","O","Moz","Webkit"];if(void 0!==a.transition)return!0;for(;b.length;)if(b.pop()+"Transition"in a)return!0;return!1};o.prototype={constructor:o,init:function(){var b=navigator.appVersion;n.isIE7=-1!==b.indexOf("MSIE 7."),n.isIE8=-1!==b.indexOf("MSIE 8."),n.isLowIE=n.isIE7||n.isIE8,n.isAndroid=/android/gi.test(b),n.isIOS=/iphone|ipad|ipod/gi.test(b),n.supportsTransition=E(),n.probablyMobile=n.isAndroid||n.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),s=a(document.body),t=a(document),n.popupsCache={}},open:function(b){var c;if(b.isObj===!1){n.items=b.items.toArray(),n.index=0;var e,d=b.items;for(c=0;c<d.length;c++)if(e=d[c],e.parsed&&(e=e.el[0]),e===b.el[0]){n.index=c;break}}else n.items=a.isArray(b.items)?b.items:[b.items],n.index=b.index||0;if(n.isOpen)return void n.updateItemHTML();n.types=[],v="",b.mainEl&&b.mainEl.length?n.ev=b.mainEl.eq(0):n.ev=t,b.key?(n.popupsCache[b.key]||(n.popupsCache[b.key]={}),n.currTemplate=n.popupsCache[b.key]):n.currTemplate={},n.st=a.extend(!0,{},a.magnificPopup.defaults,b),n.fixedContentPos="auto"===n.st.fixedContentPos?!n.probablyMobile:n.st.fixedContentPos,n.st.modal&&(n.st.closeOnContentClick=!1,n.st.closeOnBgClick=!1,n.st.showCloseBtn=!1,n.st.enableEscapeKey=!1),n.bgOverlay||(n.bgOverlay=y("bg").on("click"+j,function(){n.close()}),n.wrap=y("wrap").attr("tabindex",-1).on("click"+j,function(a){D(a.target)&&n.close()}),n.container=y("container",n.wrap)),n.contentContainer=y("content"),n.st.preloader&&(n.preloader=y("preloader",n.container,n.st.tLoading));var h=a.magnificPopup.modules;for(c=0;c<h.length;c++){var i=h[c];i=i.charAt(0).toUpperCase()+i.slice(1),n["init"+i].call(n)}z("BeforeOpen"),n.st.showCloseBtn&&(n.st.closeBtnInside?(x(f,function(a,b,c,d){c.close_replaceWith=B(d.type)}),v+=" mfp-close-btn-in"):n.wrap.append(B())),n.st.alignTop&&(v+=" mfp-align-top"),n.fixedContentPos?n.wrap.css({overflow:n.st.overflowY,overflowX:"hidden",overflowY:n.st.overflowY}):n.wrap.css({top:r.scrollTop(),position:"absolute"}),(n.st.fixedBgPos===!1||"auto"===n.st.fixedBgPos&&!n.fixedContentPos)&&n.bgOverlay.css({height:t.height(),position:"absolute"}),n.st.enableEscapeKey&&t.on("keyup"+j,function(a){27===a.keyCode&&n.close()}),r.on("resize"+j,function(){n.updateSize()}),n.st.closeOnContentClick||(v+=" mfp-auto-cursor"),v&&n.wrap.addClass(v);var l=n.wH=r.height(),m={},o=n.st.mainClass;n.isIE7&&(o+=" mfp-ie7"),o&&n._addClassToMFP(o),n.updateItemHTML(),z("BuildControls"),a("html").css(m),n.bgOverlay.add(n.wrap).prependTo(document.body),n._lastFocusedEl=document.activeElement,setTimeout(function(){n.content?(n._addClassToMFP(k),A()):n.bgOverlay.addClass(k),t.on("focusin"+j,function(b){return b.target===n.wrap[0]||a.contains(n.wrap[0],b.target)?void 0:(A(),!1)})},16),n.isOpen=!0,n.updateSize(l),z(g)},close:function(){n.isOpen&&(z(c),n.isOpen=!1,n.st.removalDelay&&!n.isLowIE&&n.supportsTransition?(n._addClassToMFP(l),setTimeout(function(){n._close()},n.st.removalDelay)):n._close())},_close:function(){z(b);var c=l+" "+k+" ";if(n.bgOverlay.detach(),n.wrap.detach(),n.container.empty(),n.st.mainClass&&(c+=n.st.mainClass+" "),n._removeClassFromMFP(c),n.fixedContentPos){var e={paddingRight:""};a("html").css(e)}t.off("keyup"+j+" focusin"+j),n.ev.off(j),n.wrap.attr("class","mfp-wrap").removeAttr("style"),n.bgOverlay.attr("class","mfp-bg"),n.container.attr("class","mfp-container"),!n.st.showCloseBtn||n.st.closeBtnInside&&n.currTemplate[n.currItem.type]!==!0||n.currTemplate.closeBtn&&n.currTemplate.closeBtn.detach(),n._lastFocusedEl&&a(n._lastFocusedEl).trigger("focus"),n.currItem=null,n.content=null,n.currTemplate=null,n.prevHeight=0,z(d)},updateSize:function(a){if(n.isIOS){var b=document.documentElement.clientWidth/window.innerWidth,c=window.innerHeight*b;n.wrap.css("height",c),n.wH=c}else n.wH=a||r.height();n.fixedContentPos||n.wrap.css("height",n.wH),z("Resize")},updateItemHTML:function(){var b=n.items[n.index];n.contentContainer.detach(),n.content&&n.content.detach(),b.parsed||(b=n.parseEl(n.index));var c=b.type;if(z("BeforeChange",[n.currItem?n.currItem.type:"",c]),n.currItem=b,!n.currTemplate[c]){var d=n.st[c]?n.st[c].markup:!1;z("FirstMarkupParse",d),d?n.currTemplate[c]=a(d):n.currTemplate[c]=!0}u&&u!==b.type&&n.container.removeClass("mfp-"+u+"-holder");var e=n["get"+c.charAt(0).toUpperCase()+c.slice(1)](b,n.currTemplate[c]);n.appendContent(e,c),b.preloaded=!0,z(h,b),u=b.type,n.container.prepend(n.contentContainer),z("AfterChange")},appendContent:function(a,b){n.content=a,a?n.st.showCloseBtn&&n.st.closeBtnInside&&n.currTemplate[b]===!0?n.content.find(".mfp-close").length||n.content.append(B()):n.content=a:n.content="",z(e),n.container.addClass("mfp-"+b+"-holder"),n.contentContainer.append(n.content)},parseEl:function(b){var c=n.items[b],d=c.type;if(c=c.tagName?{el:a(c)}:{data:c,src:c.src},c.el){for(var e=n.types,f=0;f<e.length;f++)if(c.el.hasClass("mfp-"+e[f])){d=e[f];break}c.src=c.el.attr("data-mfp-src"),c.src||(c.src=c.el.attr("href"))}return c.type=d||n.st.type||"inline",c.index=b,c.parsed=!0,n.items[b]=c,z("ElementParse",c),n.items[b]},addGroup:function(a,b){var c=function(c){c.mfpEl=this,n._openClick(c,a,b)};b||(b={});var d="click.magnificPopup";b.mainEl=a,b.items?(b.isObj=!0,a.off(d).on(d,c)):(b.isObj=!1,b.delegate?a.off(d).on(d,b.delegate,c):(b.items=a,a.off(d).on(d,c)))},_openClick:function(b,c,d){var e=void 0!==d.midClick?d.midClick:a.magnificPopup.defaults.midClick;if(e||2!==b.which&&!b.ctrlKey&&!b.metaKey){var f=void 0!==d.disableOn?d.disableOn:a.magnificPopup.defaults.disableOn;if(f)if(a.isFunction(f)){if(!f.call(n))return!0}else if(r.width()<f)return!0;b.type&&(b.preventDefault(),n.isOpen&&b.stopPropagation()),d.el=a(b.mfpEl),d.delegate&&(d.items=c.find(d.delegate)),n.open(d)}},updateStatus:function(a,b){if(n.preloader){q!==a&&n.container.removeClass("mfp-s-"+q),b||"loading"!==a||(b=n.st.tLoading);var c={status:a,text:b};z("UpdateStatus",c),a=c.status,b=c.text,n.preloader.html(b),n.preloader.find("a").on("click",function(a){a.stopImmediatePropagation()}),n.container.addClass("mfp-s-"+a),q=a}},_addClassToMFP:function(a){n.bgOverlay.addClass(a),n.wrap.addClass(a)},_removeClassFromMFP:function(a){this.bgOverlay.removeClass(a),n.wrap.removeClass(a)},_hasScrollBar:function(a){return(n.isIE7?t.height():document.body.scrollHeight)>(a||r.height())},_parseMarkup:function(b,c,d){var e;d.data&&(c=a.extend(d.data,c)),z(f,[b,c,d]),a.each(c,function(a,c){if(void 0===c||c===!1)return!0;if(e=a.split("_"),e.length>1){var d=b.find(j+"-"+e[0]);if(d.length>0){var f=e[1];"replaceWith"===f?d[0]!==c[0]&&d.replaceWith(c):"img"===f?d.is("img")?d.attr("src",c):d.replaceWith('<img src="'+c+'" class="'+d.attr("class")+'" />'):d.attr(e[1],c)}}else b.find(j+"-"+a).html(c)})},_getScrollbarSize:function(){if(void 0===n.scrollbarSize){var a=document.createElement("div");a.id="mfp-sbm",a.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(a),n.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return n.scrollbarSize}},a.magnificPopup={instance:null,proto:o.prototype,modules:[],open:function(a,b){return C(),a||(a={}),a.isObj=!0,a.index=b||0,this.instance.open(a)},close:function(){return a.magnificPopup.instance.close()},registerModule:function(b,c){c.options&&(a.magnificPopup.defaults[b]=c.options),a.extend(this.proto,c.proto),this.modules.push(b)},defaults:{disableOn:0,key:null,midClick:!0,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!1,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:300,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">×</button>',tClose:"Close (Esc)",tLoading:"Loading...",callbacks:{beforeOpen:function(){this.st.image.markup=this.st.image.markup.replace("mfp-figure","mfp-figure mfp-with-anim"),"undefined"!=typeof this.st&&"undefined"!=typeof this.st.el&&(this.st.mainClass=this.st.el.attr("data-effect"))}}}},a.fn.magnificPopup=function(b){C();var c=a(this);if("string"==typeof b)if("open"===b){var d,e=p?c.data("magnificPopup"):c[0].magnificPopup,f=parseInt(arguments[1],10)||0;e.items?d=e.items[f]:(d=c,e.delegate&&(d=d.find(e.delegate)),d=d.eq(f)),n._openClick({mfpEl:d},c,e)}else n.isOpen&&n[b].apply(n,Array.prototype.slice.call(arguments,1));else p?c.data("magnificPopup",b):c[0].magnificPopup=b,n.addGroup(c,b);return c};var G,H,I,F="inline",J=function(){I&&(H.after(I.addClass(G)).detach(),I=null)};a.magnificPopup.registerModule(F,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){n.types.push(F),x(b+"."+F,function(){J()})},getInline:function(b,c){if(J(),b.src){var d=n.st.inline,e=a(b.src);if(e.length){var f=e[0].parentNode;f&&f.tagName&&(H||(G=d.hiddenClass,H=y(G),G="mfp-"+G),I=e.after(H).detach().removeClass(G)),n.updateStatus("ready")}else n.updateStatus("error",d.tNotFound),e=a("<div>");return b.inlineElement=e,e}return n.updateStatus("ready"),n._parseMarkup(c,{},b),c}}});var L,K="ajax",M=function(){L&&s.removeClass(L)};a.magnificPopup.registerModule(K,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){n.types.push(K),L=n.st.ajax.cursor,x(b+"."+K,function(){M(),n.req&&n.req.abort()})},getAjax:function(b){L&&s.addClass(L),n.updateStatus("loading");var c=a.extend({url:b.src,success:function(c,d,e){var f={data:c,xhr:e};z("ParseAjax",f),n.appendContent(a(f.data),K),b.finished=!0,M(),A(),setTimeout(function(){n.wrap.addClass(k)},16),n.updateStatus("ready"),z("AjaxContentAdded")},error:function(){M(),b.finished=b.loadError=!0,n.updateStatus("error",n.st.ajax.tError.replace("%url%",b.src))}},n.st.ajax.settings);return n.req=a.ajax(c),""}}});var N,O=function(b){if(b.data&&void 0!==b.data.title)return b.data.title;var c=n.st.image.titleSrc;if(c){if(a.isFunction(c))return c.call(n,b);if(b.el)return b.el.attr(c)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><div class="mfp-img"></div><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var a=n.st.image,c=".image";n.types.push("image"),x(g+c,function(){"image"===n.currItem.type&&a.cursor&&s.addClass(a.cursor)}),x(b+c,function(){a.cursor&&s.removeClass(a.cursor),r.off("resize"+j)}),x("Resize"+c,n.resizeImage),n.isLowIE&&x("AfterChange",n.resizeImage)},resizeImage:function(){var a=n.currItem;if(a.img&&n.st.image.verticalFit){var b=0;n.isLowIE&&(b=parseInt(a.img.css("padding-top"),10)+parseInt(a.img.css("padding-bottom"),10)),a.img.css("max-height",n.wH-b)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,N&&clearInterval(N),a.isCheckingImgSize=!1,z("ImageHasSize",a),a.imgHidden&&(n.content&&n.content.removeClass("mfp-loading"),a.imgHidden=!1))},findImageSize:function(a){var b=0,c=a.img[0],d=function(e){N&&clearInterval(N),N=setInterval(function(){return c.naturalWidth>0?void n._onImageHasSize(a):(b>200&&clearInterval(N),b++,void(3===b?d(10):40===b?d(50):100===b&&d(500)))},e)};d(1)},getImage:function(b,c){var d=0,e=function(){b&&(b.img[0].complete?(b.img.off(".mfploader"),b===n.currItem&&(n._onImageHasSize(b),n.updateStatus("ready")),b.hasSize=!0,b.loaded=!0,z("ImageLoadComplete")):(d++,200>d?setTimeout(e,100):f()))},f=function(){b&&(b.img.off(".mfploader"),b===n.currItem&&(n._onImageHasSize(b),n.updateStatus("error",g.tError.replace("%url%",b.src))),b.hasSize=!0,b.loaded=!0,b.loadError=!0)},g=n.st.image,h=c.find(".mfp-img");if(h.length){var i=new Image;i.className="mfp-img",b.img=a(i).on("load.mfploader",e).on("error.mfploader",f),i.src=b.src,h.is("img")&&(b.img=b.img.clone()),b.img[0].naturalWidth>0&&(b.hasSize=!0)}return n._parseMarkup(c,{title:O(b),img_replaceWith:b.img},b),n.resizeImage(),b.hasSize?(N&&clearInterval(N),b.loadError?(c.addClass("mfp-loading"),n.updateStatus("error",g.tError.replace("%url%",b.src))):(c.removeClass("mfp-loading"),n.updateStatus("ready")),c):(n.updateStatus("loading"),b.loading=!0,b.hasSize||(b.imgHidden=!0,c.addClass("mfp-loading"),n.findImageSize(b)),c)}}});var P,Q=function(){return void 0===P&&(P=void 0!==document.createElement("p").style.MozTransform),P};a.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return a.is("img")?a:a.find("img")}},proto:{initZoom:function(){var a=n.st.zoom,d=".zoom";if(a.enabled&&n.supportsTransition){var h,i,e=a.duration,f=function(b){var c=b.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),d="all "+a.duration/1e3+"s "+a.easing,e={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,c.css(e),c},g=function(){n.content.css("visibility","visible")};x("BuildControls"+d,function(){if(n._allowZoom()){if(clearTimeout(h),n.content.css("visibility","hidden"),image=n._getItemToZoom(),!image)return void g();i=f(image),i.css(n._getOffset()),n.wrap.append(i),h=setTimeout(function(){i.css(n._getOffset(!0)),h=setTimeout(function(){g(),setTimeout(function(){i.remove(),image=i=null,z("ZoomAnimationEnded")},16)},e)},16)}}),x(c+d,function(){if(n._allowZoom()){if(clearTimeout(h),n.st.removalDelay=e,!image){if(image=n._getItemToZoom(),!image)return;i=f(image)}i.css(n._getOffset(!0)),n.wrap.append(i),n.content.css("visibility","hidden"),setTimeout(function(){i.css(n._getOffset())},16)}}),x(b+d,function(){n._allowZoom()&&(g(),i&&i.remove())})}},_allowZoom:function(){return"image"===n.currItem.type},_getItemToZoom:function(){return n.currItem.hasSize?n.currItem.img:!1},_getOffset:function(b){var c;c=b?n.currItem.img:n.st.zoom.opener(n.currItem.el||n.currItem);var d=c.offset(),e=parseInt(c.css("padding-top"),10),f=parseInt(c.css("padding-bottom"),10);d.top-=a(window).scrollTop()-e;var g={width:c.width(),height:(p?c.innerHeight():c[0].offsetHeight)-f-e};return Q()?g["-moz-transform"]=g.transform="translate("+d.left+"px,"+d.top+"px)":(g.left=d.left,g.top=d.top),g}}});var R="iframe",S="//about:blank",T=function(a){if(n.currTemplate[R]){var b=n.currTemplate[R].find("iframe");b.length&&(a||(b[0].src=S),n.isIE8&&b.css("display",a?"block":"none"))}};a.magnificPopup.registerModule(R,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){n.types.push(R),x("BeforeChange",function(a,b,c){b!==c&&(b===R?T():c===R&&T(!0))}),x(b+"."+R,function(){T()})},getIframe:function(b,c){var d=b.src,e=n.st.iframe;a.each(e.patterns,function(){return d.indexOf(this.index)>-1?(this.id&&(d="string"==typeof this.id?d.substr(d.lastIndexOf(this.id)+this.id.length,d.length):this.id.call(this,d)),d=this.src.replace("%id%",d),!1):void 0});var f={};return e.srcAction&&(f[e.srcAction]=d),n._parseMarkup(c,f,b),n.updateStatus("ready"),c}}});var U=function(a){var b=n.items.length;return a>b-1?a-b:0>a?b+a:a},V=function(a,b,c){return a.replace("%curr%",b+1).replace("%total%",c)};a.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var c=n.st.gallery,d=".mfp-gallery",e=Boolean(a.fn.mfpFastClick);return n.direction=!0,c&&c.enabled?(v+=" mfp-gallery",x(g+d,function(){c.navigateByImgClick&&n.wrap.on("click"+d,".mfp-img",function(){return n.items.length>1?(n.next(),!1):void 0}),t.on("keydown"+d,function(a){37===a.keyCode?n.prev():39===a.keyCode&&n.next()})}),x("UpdateStatus"+d,function(a,b){b.text&&(b.text=V(b.text,n.currItem.index,n.items.length))}),x(f+d,function(a,b,d,e){var f=n.items.length;d.counter=f>1?V(c.tCounter,e.index,f):""}),x("BuildControls"+d,function(){if(n.items.length>1&&c.arrows&&!n.arrowLeft){var b=c.arrowMarkup,d=n.arrowLeft=a(b.replace("%title%",c.tPrev).replace("%dir%","left")).addClass(m),f=n.arrowRight=a(b.replace("%title%",c.tNext).replace("%dir%","right")).addClass(m),g=e?"mfpFastClick":"click";d[g](function(){n.prev()}),f[g](function(){n.next()}),n.isIE7&&(y("b",d[0],!1,!0),y("a",d[0],!1,!0),y("b",f[0],!1,!0),y("a",f[0],!1,!0)),n.container.append(d.add(f))}}),x(h+d,function(){n._preloadTimeout&&clearTimeout(n._preloadTimeout),n._preloadTimeout=setTimeout(function(){n.preloadNearbyImages(),n._preloadTimeout=null},16)}),void x(b+d,function(){t.off(d),n.wrap.off("click"+d),n.arrowLeft&&e&&n.arrowLeft.add(n.arrowRight).destroyMfpFastClick(),n.arrowRight=n.arrowLeft=null})):!1},next:function(){n.direction=!0,n.index=U(n.index+1),n.updateItemHTML()},prev:function(){n.direction=!1,n.index=U(n.index-1),n.updateItemHTML()},goTo:function(a){n.direction=a>=n.index,n.index=a,n.updateItemHTML()},preloadNearbyImages:function(){var d,a=n.st.gallery.preload,b=Math.min(a[0],n.items.length),c=Math.min(a[1],n.items.length);for(d=1;d<=(n.direction?c:b);d++)n._preloadItem(n.index+d);for(d=1;d<=(n.direction?b:c);d++)n._preloadItem(n.index-d)},_preloadItem:function(b){if(b=U(b),!n.items[b].preloaded){var c=n.items[b];c.parsed||(c=n.parseEl(b)),z("LazyLoad",c),"image"===c.type&&(c.img=a('<img class="mfp-img" />').on("load.mfploader",function(){c.hasSize=!0}).on("error.mfploader",function(){c.hasSize=!0,c.loadError=!0}).attr("src",c.src)),c.preloaded=!0}}}});var W="retina";a.magnificPopup.registerModule(W,{options:{replaceSrc:function(a){return a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=n.st.retina,b=a.ratio;b=isNaN(b)?b():b,b>1&&(x("ImageHasSize."+W,function(a,c){c.img.css({"max-width":c.img[0].naturalWidth/b,width:"100%"})}),x("ElementParse."+W,function(c,d){d.src=a.replaceSrc(d,b)}))}}}}),function(){var b=1e3,c="ontouchstart"in window,d=function(){r.off("touchmove"+f+" touchend"+f)},e="mfpFastClick",f="."+e;a.fn.mfpFastClick=function(e){return a(this).each(function(){var h,g=a(this);if(c){var i,j,k,l,m,n;g.on("touchstart"+f,function(a){l=!1,n=1,m=a.originalEvent?a.originalEvent.touches[0]:a.touches[0],j=m.clientX,k=m.clientY,r.on("touchmove"+f,function(a){m=a.originalEvent?a.originalEvent.touches:a.touches,n=m.length,m=m[0],(Math.abs(m.clientX-j)>10||Math.abs(m.clientY-k)>10)&&(l=!0,d())}).on("touchend"+f,function(a){d(),l||n>1||(h=!0,a.preventDefault(),clearTimeout(i),i=setTimeout(function(){h=!1},b),e())})})}g.on("click"+f,function(){h||e()})})},a.fn.destroyMfpFastClick=function(){a(this).off("touchstart"+f+" click"+f),c&&r.off("touchmove"+f+" touchend"+f)}}()}(window.jQuery||window.Zepto);;/* ========================================================= * bootstrap-datepicker.js * Repo: https://github.com/uxsolutions/bootstrap-datepicker/ * Demo: https://uxsolutions.github.io/bootstrap-datepicker/ * Docs: https://bootstrap-datepicker.readthedocs.org/ * ========================================================= * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ========================================================= */ (function(factory){ if (typeof define === 'function' && define.amd) { define(['jquery'], factory); } else if (typeof exports === 'object') { factory(require('jquery')); } else { factory(jQuery); } }(function($, undefined){ function UTCDate(){ return new Date(Date.UTC.apply(Date, arguments)); } function UTCToday(){ var today = new Date(); return UTCDate(today.getFullYear(), today.getMonth(), today.getDate()); } function isUTCEquals(date1, date2) { return ( date1.getUTCFullYear() === date2.getUTCFullYear() && date1.getUTCMonth() === date2.getUTCMonth() && date1.getUTCDate() === date2.getUTCDate() ); } function alias(method, deprecationMsg){ return function(){ if (deprecationMsg !== undefined) { $.fn.datepicker.deprecated(deprecationMsg); } return this[method].apply(this, arguments); }; } function isValidDate(d) { return d && !isNaN(d.getTime()); } var DateArray = (function(){ var extras = { get: function(i){ return this.slice(i)[0]; }, contains: function(d){ // Array.indexOf is not cross-browser; // $.inArray doesn't work with Dates var val = d && d.valueOf(); for (var i=0, l=this.length; i < l; i++) // Use date arithmetic to allow dates with different times to match if (0 <= this[i].valueOf() - val && this[i].valueOf() - val < 1000*60*60*24) return i; return -1; }, remove: function(i){ this.splice(i,1); }, replace: function(new_array){ if (!new_array) return; if (!Array.isArray(new_array)) new_array = [new_array]; this.clear(); this.push.apply(this, new_array); }, clear: function(){ this.length = 0; }, copy: function(){ var a = new DateArray(); a.replace(this); return a; } }; return function(){ var a = []; a.push.apply(a, arguments); $.extend(a, extras); return a; }; })(); // Picker object var Datepicker = function(element, options){ $.data(element, 'datepicker', this); this._events = []; this._secondaryEvents = []; this._process_options(options); this.dates = new DateArray(); this.viewDate = this.o.defaultViewDate; this.focusDate = null; this.element = $(element); this.isInput = this.element.is('input'); this.inputField = this.isInput ? this.element : this.element.find('input'); this.component = this.element.hasClass('date') ? this.element.find('.add-on, .input-group-addon, .input-group-append, .input-group-prepend, .btn') : false; if (this.component && this.component.length === 0){ this.component = false; } if (this.o.isInline === null){ this.isInline = !this.component && !this.isInput; } else { this.isInline = this.o.isInline; } this.picker = $(DPGlobal.template); // Checking templates and inserting if (this._check_template(this.o.templates.leftArrow)) { this.picker.find('.prev').html(this.o.templates.leftArrow); } if (this._check_template(this.o.templates.rightArrow)) { this.picker.find('.next').html(this.o.templates.rightArrow); } this._buildEvents(); this._attachEvents(); if (this.isInline){ this.picker.addClass('datepicker-inline').appendTo(this.element); } else { this.picker.addClass('datepicker-dropdown dropdown-menu'); } if (this.o.rtl){ this.picker.addClass('datepicker-rtl'); } if (this.o.calendarWeeks) { this.picker.find('.datepicker-days .datepicker-switch, thead .datepicker-title, tfoot .today, tfoot .clear') .attr('colspan', function(i, val){ return Number(val) + 1; }); } this._process_options({ startDate: this._o.startDate, endDate: this._o.endDate, daysOfWeekDisabled: this.o.daysOfWeekDisabled, daysOfWeekHighlighted: this.o.daysOfWeekHighlighted, datesDisabled: this.o.datesDisabled }); this._allow_update = false; this.setViewMode(this.o.startView); this._allow_update = true; this.fillDow(); this.fillMonths(); this.update(); if (this.isInline){ this.show(); } }; Datepicker.prototype = { constructor: Datepicker, _resolveViewName: function(view){ $.each(DPGlobal.viewModes, function(i, viewMode){ if (view === i || $.inArray(view, viewMode.names) !== -1){ view = i; return false; } }); return view; }, _resolveDaysOfWeek: function(daysOfWeek){ if (!Array.isArray(daysOfWeek)) daysOfWeek = daysOfWeek.split(/[,\s]*/); return $.map(daysOfWeek, Number); }, _check_template: function(tmp){ try { // If empty if (tmp === undefined || tmp === "") { return false; } // If no html, everything ok if ((tmp.match(/[<>]/g) || []).length <= 0) { return true; } // Checking if html is fine var jDom = $(tmp); return jDom.length > 0; } catch (ex) { return false; } }, _process_options: function(opts){ // Store raw options for reference this._o = $.extend({}, this._o, opts); // Processed options var o = this.o = $.extend({}, this._o); // Check if "de-DE" style date is available, if not language should // fallback to 2 letter code eg "de" var lang = o.language; if (!dates[lang]){ lang = lang.split('-')[0]; if (!dates[lang]) lang = defaults.language; } o.language = lang; // Retrieve view index from any aliases o.startView = this._resolveViewName(o.startView); o.minViewMode = this._resolveViewName(o.minViewMode); o.maxViewMode = this._resolveViewName(o.maxViewMode); // Check view is between min and max o.startView = Math.max(this.o.minViewMode, Math.min(this.o.maxViewMode, o.startView)); // true, false, or Number > 0 if (o.multidate !== true){ o.multidate = Number(o.multidate) || false; if (o.multidate !== false) o.multidate = Math.max(0, o.multidate); } o.multidateSeparator = String(o.multidateSeparator); o.weekStart %= 7; o.weekEnd = (o.weekStart + 6) % 7; var format = DPGlobal.parseFormat(o.format); if (o.startDate !== -Infinity){ if (!!o.startDate){ if (o.startDate instanceof Date) o.startDate = this._local_to_utc(this._zero_time(o.startDate)); else o.startDate = DPGlobal.parseDate(o.startDate, format, o.language, o.assumeNearbyYear); } else { o.startDate = -Infinity; } } if (o.endDate !== Infinity){ if (!!o.endDate){ if (o.endDate instanceof Date) o.endDate = this._local_to_utc(this._zero_time(o.endDate)); else o.endDate = DPGlobal.parseDate(o.endDate, format, o.language, o.assumeNearbyYear); } else { o.endDate = Infinity; } } o.daysOfWeekDisabled = this._resolveDaysOfWeek(o.daysOfWeekDisabled||[]); o.daysOfWeekHighlighted = this._resolveDaysOfWeek(o.daysOfWeekHighlighted||[]); o.datesDisabled = o.datesDisabled||[]; if (!Array.isArray(o.datesDisabled)) { o.datesDisabled = o.datesDisabled.split(','); } o.datesDisabled = $.map(o.datesDisabled, function(d){ return DPGlobal.parseDate(d, format, o.language, o.assumeNearbyYear); }); var plc = String(o.orientation).toLowerCase().split(/\s+/g), _plc = o.orientation.toLowerCase(); plc = $.grep(plc, function(word){ return /^auto|left|right|top|bottom$/.test(word); }); o.orientation = {x: 'auto', y: 'auto'}; if (!_plc || _plc === 'auto') ; // no action else if (plc.length === 1){ switch (plc[0]){ case 'top': case 'bottom': o.orientation.y = plc[0]; break; case 'left': case 'right': o.orientation.x = plc[0]; break; } } else { _plc = $.grep(plc, function(word){ return /^left|right$/.test(word); }); o.orientation.x = _plc[0] || 'auto'; _plc = $.grep(plc, function(word){ return /^top|bottom$/.test(word); }); o.orientation.y = _plc[0] || 'auto'; } if (o.defaultViewDate instanceof Date || typeof o.defaultViewDate === 'string') { o.defaultViewDate = DPGlobal.parseDate(o.defaultViewDate, format, o.language, o.assumeNearbyYear); } else if (o.defaultViewDate) { var year = o.defaultViewDate.year || new Date().getFullYear(); var month = o.defaultViewDate.month || 0; var day = o.defaultViewDate.day || 1; o.defaultViewDate = UTCDate(year, month, day); } else { o.defaultViewDate = UTCToday(); } }, _applyEvents: function(evs){ for (var i=0, el, ch, ev; i < evs.length; i++){ el = evs[i][0]; if (evs[i].length === 2){ ch = undefined; ev = evs[i][1]; } else if (evs[i].length === 3){ ch = evs[i][1]; ev = evs[i][2]; } el.on(ev, ch); } }, _unapplyEvents: function(evs){ for (var i=0, el, ev, ch; i < evs.length; i++){ el = evs[i][0]; if (evs[i].length === 2){ ch = undefined; ev = evs[i][1]; } else if (evs[i].length === 3){ ch = evs[i][1]; ev = evs[i][2]; } el.off(ev, ch); } }, _buildEvents: function(){ var events = { keyup: $.proxy(function(e){ if ($.inArray(e.keyCode, [27, 37, 39, 38, 40, 32, 13, 9]) === -1) this.update(); }, this), keydown: $.proxy(this.keydown, this), paste: $.proxy(this.paste, this) }; if (this.o.showOnFocus === true) { events.focus = $.proxy(this.show, this); } if (this.isInput) { // single input this._events = [ [this.element, events] ]; } // component: input + button else if (this.component && this.inputField.length) { this._events = [ // For components that are not readonly, allow keyboard nav [this.inputField, events], [this.component, { click: $.proxy(this.show, this) }] ]; } else { this._events = [ [this.element, { click: $.proxy(this.show, this), keydown: $.proxy(this.keydown, this) }] ]; } this._events.push( // Component: listen for blur on element descendants [this.element, '*', { blur: $.proxy(function(e){ this._focused_from = e.target; }, this) }], // Input: listen for blur on element [this.element, { blur: $.proxy(function(e){ this._focused_from = e.target; }, this) }] ); if (this.o.immediateUpdates) { // Trigger input updates immediately on changed year/month this._events.push([this.element, { 'changeYear changeMonth': $.proxy(function(e){ this.update(e.date); }, this) }]); } this._secondaryEvents = [ [this.picker, { click: $.proxy(this.click, this) }], [this.picker, '.prev, .next', { click: $.proxy(this.navArrowsClick, this) }], [this.picker, '.day:not(.disabled)', { click: $.proxy(this.dayCellClick, this) }], [$(window), { resize: $.proxy(this.place, this) }], [$(document), { 'mousedown touchstart': $.proxy(function(e){ // Clicked outside the datepicker, hide it if (!( this.element.is(e.target) || this.element.find(e.target).length || this.picker.is(e.target) || this.picker.find(e.target).length || this.isInline )){ this.hide(); } }, this) }] ]; }, _attachEvents: function(){ this._detachEvents(); this._applyEvents(this._events); }, _detachEvents: function(){ this._unapplyEvents(this._events); }, _attachSecondaryEvents: function(){ this._detachSecondaryEvents(); this._applyEvents(this._secondaryEvents); }, _detachSecondaryEvents: function(){ this._unapplyEvents(this._secondaryEvents); }, _trigger: function(event, altdate){ var date = altdate || this.dates.get(-1), local_date = this._utc_to_local(date); this.element.trigger({ type: event, date: local_date, viewMode: this.viewMode, dates: $.map(this.dates, this._utc_to_local), format: $.proxy(function(ix, format){ if (arguments.length === 0){ ix = this.dates.length - 1; format = this.o.format; } else if (typeof ix === 'string'){ format = ix; ix = this.dates.length - 1; } format = format || this.o.format; var date = this.dates.get(ix); return DPGlobal.formatDate(date, format, this.o.language); }, this) }); }, show: function(){ if (this.inputField.is(':disabled') || (this.inputField.prop('readonly') && this.o.enableOnReadonly === false)) return; if (!this.isInline) this.picker.appendTo(this.o.container); this.place(); this.picker.show(); this._attachSecondaryEvents(); this._trigger('show'); if ((window.navigator.msMaxTouchPoints || 'ontouchstart' in document) && this.o.disableTouchKeyboard) { $(this.element).blur(); } return this; }, hide: function(){ if (this.isInline || !this.picker.is(':visible')) return this; this.focusDate = null; this.picker.hide().detach(); this._detachSecondaryEvents(); this.setViewMode(this.o.startView); if (this.o.forceParse && this.inputField.val()) this.setValue(); this._trigger('hide'); return this; }, destroy: function(){ this.hide(); this._detachEvents(); this._detachSecondaryEvents(); this.picker.remove(); delete this.element.data().datepicker; if (!this.isInput){ delete this.element.data().date; } return this; }, paste: function(e){ var dateString; if (e.originalEvent.clipboardData && e.originalEvent.clipboardData.types && $.inArray('text/plain', e.originalEvent.clipboardData.types) !== -1) { dateString = e.originalEvent.clipboardData.getData('text/plain'); } else if (window.clipboardData) { dateString = window.clipboardData.getData('Text'); } else { return; } this.setDate(dateString); this.update(); e.preventDefault(); }, _utc_to_local: function(utc){ if (!utc) { return utc; } var local = new Date(utc.getTime() + (utc.getTimezoneOffset() * 60000)); if (local.getTimezoneOffset() !== utc.getTimezoneOffset()) { local = new Date(utc.getTime() + (local.getTimezoneOffset() * 60000)); } return local; }, _local_to_utc: function(local){ return local && new Date(local.getTime() - (local.getTimezoneOffset()*60000)); }, _zero_time: function(local){ return local && new Date(local.getFullYear(), local.getMonth(), local.getDate()); }, _zero_utc_time: function(utc){ return utc && UTCDate(utc.getUTCFullYear(), utc.getUTCMonth(), utc.getUTCDate()); }, getDates: function(){ return $.map(this.dates, this._utc_to_local); }, getUTCDates: function(){ return $.map(this.dates, function(d){ return new Date(d); }); }, getDate: function(){ return this._utc_to_local(this.getUTCDate()); }, getUTCDate: function(){ var selected_date = this.dates.get(-1); if (selected_date !== undefined) { return new Date(selected_date); } else { return null; } }, clearDates: function(){ this.inputField.val(''); this._trigger('changeDate'); this.update(); if (this.o.autoclose) { this.hide(); } }, setDates: function(){ var args = Array.isArray(arguments[0]) ? arguments[0] : arguments; this.update.apply(this, args); this._trigger('changeDate'); this.setValue(); return this; }, setUTCDates: function(){ var args = Array.isArray(arguments[0]) ? arguments[0] : arguments; this.setDates.apply(this, $.map(args, this._utc_to_local)); return this; }, setDate: alias('setDates'), setUTCDate: alias('setUTCDates'), remove: alias('destroy', 'Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead'), setValue: function(){ var formatted = this.getFormattedDate(); this.inputField.val(formatted); return this; }, getFormattedDate: function(format){ if (format === undefined) format = this.o.format; var lang = this.o.language; return $.map(this.dates, function(d){ return DPGlobal.formatDate(d, format, lang); }).join(this.o.multidateSeparator); }, getStartDate: function(){ return this.o.startDate; }, setStartDate: function(startDate){ this._process_options({startDate: startDate}); this.update(); this.updateNavArrows(); return this; }, getEndDate: function(){ return this.o.endDate; }, setEndDate: function(endDate){ this._process_options({endDate: endDate}); this.update(); this.updateNavArrows(); return this; }, setDaysOfWeekDisabled: function(daysOfWeekDisabled){ this._process_options({daysOfWeekDisabled: daysOfWeekDisabled}); this.update(); return this; }, setDaysOfWeekHighlighted: function(daysOfWeekHighlighted){ this._process_options({daysOfWeekHighlighted: daysOfWeekHighlighted}); this.update(); return this; }, setDatesDisabled: function(datesDisabled){ this._process_options({datesDisabled: datesDisabled}); this.update(); return this; }, place: function(){ if (this.isInline) return this; var calendarWidth = this.picker.outerWidth(), calendarHeight = this.picker.outerHeight(), visualPadding = 10, container = $(this.o.container), windowWidth = container.width(), scrollTop = this.o.container === 'body' ? $(document).scrollTop() : container.scrollTop(), appendOffset = container.offset(); var parentsZindex = [0]; this.element.parents().each(function(){ var itemZIndex = $(this).css('z-index'); if (itemZIndex !== 'auto' && Number(itemZIndex) !== 0) parentsZindex.push(Number(itemZIndex)); }); var zIndex = Math.max.apply(Math, parentsZindex) + this.o.zIndexOffset; var offset = this.component ? this.component.parent().offset() : this.element.offset(); var height = this.component ? this.component.outerHeight(true) : this.element.outerHeight(false); var width = this.component ? this.component.outerWidth(true) : this.element.outerWidth(false); var left = offset.left - appendOffset.left; var top = offset.top - appendOffset.top; if (this.o.container !== 'body') { top += scrollTop; } this.picker.removeClass( 'datepicker-orient-top datepicker-orient-bottom '+ 'datepicker-orient-right datepicker-orient-left' ); if (this.o.orientation.x !== 'auto'){ this.picker.addClass('datepicker-orient-' + this.o.orientation.x); if (this.o.orientation.x === 'right') left -= calendarWidth - width; } // auto x orientation is best-placement: if it crosses a window // edge, fudge it sideways else { if (offset.left < 0) { // component is outside the window on the left side. Move it into visible range this.picker.addClass('datepicker-orient-left'); left -= offset.left - visualPadding; } else if (left + calendarWidth > windowWidth) { // the calendar passes the widow right edge. Align it to component right side this.picker.addClass('datepicker-orient-right'); left += width - calendarWidth; } else { if (this.o.rtl) { // Default to right this.picker.addClass('datepicker-orient-right'); } else { // Default to left this.picker.addClass('datepicker-orient-left'); } } } // auto y orientation is best-situation: top or bottom, no fudging, // decision based on which shows more of the calendar var yorient = this.o.orientation.y, top_overflow; if (yorient === 'auto'){ top_overflow = -scrollTop + top - calendarHeight; yorient = top_overflow < 0 ? 'bottom' : 'top'; } this.picker.addClass('datepicker-orient-' + yorient); if (yorient === 'top') top -= calendarHeight + parseInt(this.picker.css('padding-top')); else top += height; if (this.o.rtl) { var right = windowWidth - (left + width); this.picker.css({ top: top, right: right, zIndex: zIndex }); } else { this.picker.css({ top: top, left: left, zIndex: zIndex }); } return this; }, _allow_update: true, update: function(){ if (!this._allow_update) return this; var oldDates = this.dates.copy(), dates = [], fromArgs = false; if (arguments.length){ $.each(arguments, $.proxy(function(i, date){ if (date instanceof Date) date = this._local_to_utc(date); dates.push(date); }, this)); fromArgs = true; } else { dates = this.isInput ? this.element.val() : this.element.data('date') || this.inputField.val(); if (dates && this.o.multidate) dates = dates.split(this.o.multidateSeparator); else dates = [dates]; delete this.element.data().date; } dates = $.map(dates, $.proxy(function(date){ return DPGlobal.parseDate(date, this.o.format, this.o.language, this.o.assumeNearbyYear); }, this)); dates = $.grep(dates, $.proxy(function(date){ return ( !this.dateWithinRange(date) || !date ); }, this), true); this.dates.replace(dates); if (this.o.updateViewDate) { if (this.dates.length) this.viewDate = new Date(this.dates.get(-1)); else if (this.viewDate < this.o.startDate) this.viewDate = new Date(this.o.startDate); else if (this.viewDate > this.o.endDate) this.viewDate = new Date(this.o.endDate); else this.viewDate = this.o.defaultViewDate; } if (fromArgs){ // setting date by clicking this.setValue(); this.element.change(); } else if (this.dates.length){ // setting date by typing if (String(oldDates) !== String(this.dates) && fromArgs) { this._trigger('changeDate'); this.element.change(); } } if (!this.dates.length && oldDates.length) { this._trigger('clearDate'); this.element.change(); } this.fill(); return this; }, fillDow: function(){ if (this.o.showWeekDays) { var dowCnt = this.o.weekStart, html = '<tr>'; if (this.o.calendarWeeks){ html += '<th class="cw"> </th>'; } while (dowCnt < this.o.weekStart + 7){ html += '<th class="dow'; if ($.inArray(dowCnt, this.o.daysOfWeekDisabled) !== -1) html += ' disabled'; html += '">'+dates[this.o.language].daysMin[(dowCnt++)%7]+'</th>'; } html += '</tr>'; this.picker.find('.datepicker-days thead').append(html); } }, fillMonths: function(){ var localDate = this._utc_to_local(this.viewDate); var html = ''; var focused; for (var i = 0; i < 12; i++){ focused = localDate && localDate.getMonth() === i ? ' focused' : ''; html += '<span class="month' + focused + '">' + dates[this.o.language].monthsShort[i] + '</span>'; } this.picker.find('.datepicker-months td').html(html); }, setRange: function(range){ if (!range || !range.length) delete this.range; else this.range = $.map(range, function(d){ return d.valueOf(); }); this.fill(); }, getClassNames: function(date){ var cls = [], year = this.viewDate.getUTCFullYear(), month = this.viewDate.getUTCMonth(), today = UTCToday(); if (date.getUTCFullYear() < year || (date.getUTCFullYear() === year && date.getUTCMonth() < month)){ cls.push('old'); } else if (date.getUTCFullYear() > year || (date.getUTCFullYear() === year && date.getUTCMonth() > month)){ cls.push('new'); } if (this.focusDate && date.valueOf() === this.focusDate.valueOf()) cls.push('focused'); // Compare internal UTC date with UTC today, not local today if (this.o.todayHighlight && isUTCEquals(date, today)) { cls.push('today'); } if (this.dates.contains(date) !== -1) cls.push('active'); if (!this.dateWithinRange(date)){ cls.push('disabled'); } if (this.dateIsDisabled(date)){ cls.push('disabled', 'disabled-date'); } if ($.inArray(date.getUTCDay(), this.o.daysOfWeekHighlighted) !== -1){ cls.push('highlighted'); } if (this.range){ if (date > this.range[0] && date < this.range[this.range.length-1]){ cls.push('range'); } if ($.inArray(date.valueOf(), this.range) !== -1){ cls.push('selected'); } if (date.valueOf() === this.range[0]){ cls.push('range-start'); } if (date.valueOf() === this.range[this.range.length-1]){ cls.push('range-end'); } } return cls; }, _fill_yearsView: function(selector, cssClass, factor, year, startYear, endYear, beforeFn){ var html = ''; var step = factor / 10; var view = this.picker.find(selector); var startVal = Math.floor(year / factor) * factor; var endVal = startVal + step * 9; var focusedVal = Math.floor(this.viewDate.getFullYear() / step) * step; var selected = $.map(this.dates, function(d){ return Math.floor(d.getUTCFullYear() / step) * step; }); var classes, tooltip, before; for (var currVal = startVal - step; currVal <= endVal + step; currVal += step) { classes = [cssClass]; tooltip = null; if (currVal === startVal - step) { classes.push('old'); } else if (currVal === endVal + step) { classes.push('new'); } if ($.inArray(currVal, selected) !== -1) { classes.push('active'); } if (currVal < startYear || currVal > endYear) { classes.push('disabled'); } if (currVal === focusedVal) { classes.push('focused'); } if (beforeFn !== $.noop) { before = beforeFn(new Date(currVal, 0, 1)); if (before === undefined) { before = {}; } else if (typeof before === 'boolean') { before = {enabled: before}; } else if (typeof before === 'string') { before = {classes: before}; } if (before.enabled === false) { classes.push('disabled'); } if (before.classes) { classes = classes.concat(before.classes.split(/\s+/)); } if (before.tooltip) { tooltip = before.tooltip; } } html += '<span class="' + classes.join(' ') + '"' + (tooltip ? ' title="' + tooltip + '"' : '') + '>' + currVal + '</span>'; } view.find('.datepicker-switch').text(startVal + '-' + endVal); view.find('td').html(html); }, fill: function(){ var d = new Date(this.viewDate), year = d.getUTCFullYear(), month = d.getUTCMonth(), startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity, startMonth = this.o.startDate !== -Infinity ? this.o.startDate.getUTCMonth() : -Infinity, endYear = this.o.endDate !== Infinity ? this.o.endDate.getUTCFullYear() : Infinity, endMonth = this.o.endDate !== Infinity ? this.o.endDate.getUTCMonth() : Infinity, todaytxt = dates[this.o.language].today || dates['en'].today || '', cleartxt = dates[this.o.language].clear || dates['en'].clear || '', titleFormat = dates[this.o.language].titleFormat || dates['en'].titleFormat, todayDate = UTCToday(), titleBtnVisible = (this.o.todayBtn === true || this.o.todayBtn === 'linked') && todayDate >= this.o.startDate && todayDate <= this.o.endDate && !this.weekOfDateIsDisabled(todayDate), tooltip, before; if (isNaN(year) || isNaN(month)) return; this.picker.find('.datepicker-days .datepicker-switch') .text(DPGlobal.formatDate(d, titleFormat, this.o.language)); this.picker.find('tfoot .today') .text(todaytxt) .css('display', titleBtnVisible ? 'table-cell' : 'none'); this.picker.find('tfoot .clear') .text(cleartxt) .css('display', this.o.clearBtn === true ? 'table-cell' : 'none'); this.picker.find('thead .datepicker-title') .text(this.o.title) .css('display', typeof this.o.title === 'string' && this.o.title !== '' ? 'table-cell' : 'none'); this.updateNavArrows(); this.fillMonths(); var prevMonth = UTCDate(year, month, 0), day = prevMonth.getUTCDate(); prevMonth.setUTCDate(day - (prevMonth.getUTCDay() - this.o.weekStart + 7)%7); var nextMonth = new Date(prevMonth); if (prevMonth.getUTCFullYear() < 100){ nextMonth.setUTCFullYear(prevMonth.getUTCFullYear()); } nextMonth.setUTCDate(nextMonth.getUTCDate() + 42); nextMonth = nextMonth.valueOf(); var html = []; var weekDay, clsName; while (prevMonth.valueOf() < nextMonth){ weekDay = prevMonth.getUTCDay(); if (weekDay === this.o.weekStart){ html.push('<tr>'); if (this.o.calendarWeeks){ // ISO 8601: First week contains first thursday. // ISO also states week starts on Monday, but we can be more abstract here. var // Start of current week: based on weekstart/current date ws = new Date(+prevMonth + (this.o.weekStart - weekDay - 7) % 7 * 864e5), // Thursday of this week th = new Date(Number(ws) + (7 + 4 - ws.getUTCDay()) % 7 * 864e5), // First Thursday of year, year from thursday yth = new Date(Number(yth = UTCDate(th.getUTCFullYear(), 0, 1)) + (7 + 4 - yth.getUTCDay()) % 7 * 864e5), // Calendar week: ms between thursdays, div ms per day, div 7 days calWeek = (th - yth) / 864e5 / 7 + 1; html.push('<td class="cw">'+ calWeek +'</td>'); } } clsName = this.getClassNames(prevMonth); clsName.push('day'); var content = prevMonth.getUTCDate(); if (this.o.beforeShowDay !== $.noop){ before = this.o.beforeShowDay(this._utc_to_local(prevMonth)); if (before === undefined) before = {}; else if (typeof before === 'boolean') before = {enabled: before}; else if (typeof before === 'string') before = {classes: before}; if (before.enabled === false) clsName.push('disabled'); if (before.classes) clsName = clsName.concat(before.classes.split(/\s+/)); if (before.tooltip) tooltip = before.tooltip; if (before.content) content = before.content; } //Check if uniqueSort exists (supported by jquery >=1.12 and >=2.2) //Fallback to unique function for older jquery versions if (typeof $.uniqueSort === "function") { clsName = $.uniqueSort(clsName); } else { clsName = $.unique(clsName); } html.push('<td class="'+clsName.join(' ')+'"' + (tooltip ? ' title="'+tooltip+'"' : '') + ' data-date="' + prevMonth.getTime().toString() + '">' + content + '</td>'); tooltip = null; if (weekDay === this.o.weekEnd){ html.push('</tr>'); } prevMonth.setUTCDate(prevMonth.getUTCDate() + 1); } this.picker.find('.datepicker-days tbody').html(html.join('')); var monthsTitle = dates[this.o.language].monthsTitle || dates['en'].monthsTitle || 'Months'; var months = this.picker.find('.datepicker-months') .find('.datepicker-switch') .text(this.o.maxViewMode < 2 ? monthsTitle : year) .end() .find('tbody span').removeClass('active'); $.each(this.dates, function(i, d){ if (d.getUTCFullYear() === year) months.eq(d.getUTCMonth()).addClass('active'); }); if (year < startYear || year > endYear){ months.addClass('disabled'); } if (year === startYear){ months.slice(0, startMonth).addClass('disabled'); } if (year === endYear){ months.slice(endMonth+1).addClass('disabled'); } if (this.o.beforeShowMonth !== $.noop){ var that = this; $.each(months, function(i, month){ var moDate = new Date(year, i, 1); var before = that.o.beforeShowMonth(moDate); if (before === undefined) before = {}; else if (typeof before === 'boolean') before = {enabled: before}; else if (typeof before === 'string') before = {classes: before}; if (before.enabled === false && !$(month).hasClass('disabled')) $(month).addClass('disabled'); if (before.classes) $(month).addClass(before.classes); if (before.tooltip) $(month).prop('title', before.tooltip); }); } // Generating decade/years picker this._fill_yearsView( '.datepicker-years', 'year', 10, year, startYear, endYear, this.o.beforeShowYear ); // Generating century/decades picker this._fill_yearsView( '.datepicker-decades', 'decade', 100, year, startYear, endYear, this.o.beforeShowDecade ); // Generating millennium/centuries picker this._fill_yearsView( '.datepicker-centuries', 'century', 1000, year, startYear, endYear, this.o.beforeShowCentury ); }, updateNavArrows: function(){ if (!this._allow_update) return; var d = new Date(this.viewDate), year = d.getUTCFullYear(), month = d.getUTCMonth(), startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity, startMonth = this.o.startDate !== -Infinity ? this.o.startDate.getUTCMonth() : -Infinity, endYear = this.o.endDate !== Infinity ? this.o.endDate.getUTCFullYear() : Infinity, endMonth = this.o.endDate !== Infinity ? this.o.endDate.getUTCMonth() : Infinity, prevIsDisabled, nextIsDisabled, factor = 1; switch (this.viewMode){ case 4: factor *= 10; /* falls through */ case 3: factor *= 10; /* falls through */ case 2: factor *= 10; /* falls through */ case 1: prevIsDisabled = Math.floor(year / factor) * factor <= startYear; nextIsDisabled = Math.floor(year / factor) * factor + factor > endYear; break; case 0: prevIsDisabled = year <= startYear && month <= startMonth; nextIsDisabled = year >= endYear && month >= endMonth; break; } this.picker.find('.prev').toggleClass('disabled', prevIsDisabled); this.picker.find('.next').toggleClass('disabled', nextIsDisabled); }, click: function(e){ e.preventDefault(); e.stopPropagation(); var target, dir, day, year, month; target = $(e.target); // Clicked on the switch if (target.hasClass('datepicker-switch') && this.viewMode !== this.o.maxViewMode){ this.setViewMode(this.viewMode + 1); } // Clicked on today button if (target.hasClass('today') && !target.hasClass('day')){ this.setViewMode(0); this._setDate(UTCToday(), this.o.todayBtn === 'linked' ? null : 'view'); } // Clicked on clear button if (target.hasClass('clear')){ this.clearDates(); } if (!target.hasClass('disabled')){ // Clicked on a month, year, decade, century if (target.hasClass('month') || target.hasClass('year') || target.hasClass('decade') || target.hasClass('century')) { this.viewDate.setUTCDate(1); day = 1; if (this.viewMode === 1){ month = target.parent().find('span').index(target); year = this.viewDate.getUTCFullYear(); this.viewDate.setUTCMonth(month); } else { month = 0; year = Number(target.text()); this.viewDate.setUTCFullYear(year); } this._trigger(DPGlobal.viewModes[this.viewMode - 1].e, this.viewDate); if (this.viewMode === this.o.minViewMode){ this._setDate(UTCDate(year, month, day)); } else { this.setViewMode(this.viewMode - 1); this.fill(); } } } if (this.picker.is(':visible') && this._focused_from){ this._focused_from.focus(); } delete this._focused_from; }, dayCellClick: function(e){ var $target = $(e.currentTarget); var timestamp = $target.data('date'); var date = new Date(timestamp); if (this.o.updateViewDate) { if (date.getUTCFullYear() !== this.viewDate.getUTCFullYear()) { this._trigger('changeYear', this.viewDate); } if (date.getUTCMonth() !== this.viewDate.getUTCMonth()) { this._trigger('changeMonth', this.viewDate); } } this._setDate(date); }, // Clicked on prev or next navArrowsClick: function(e){ var $target = $(e.currentTarget); var dir = $target.hasClass('prev') ? -1 : 1; if (this.viewMode !== 0){ dir *= DPGlobal.viewModes[this.viewMode].navStep * 12; } this.viewDate = this.moveMonth(this.viewDate, dir); this._trigger(DPGlobal.viewModes[this.viewMode].e, this.viewDate); this.fill(); }, _toggle_multidate: function(date){ var ix = this.dates.contains(date); if (!date){ this.dates.clear(); } if (ix !== -1){ if (this.o.multidate === true || this.o.multidate > 1 || this.o.toggleActive){ this.dates.remove(ix); } } else if (this.o.multidate === false) { this.dates.clear(); this.dates.push(date); } else { this.dates.push(date); } if (typeof this.o.multidate === 'number') while (this.dates.length > this.o.multidate) this.dates.remove(0); }, _setDate: function(date, which){ if (!which || which === 'date') this._toggle_multidate(date && new Date(date)); if ((!which && this.o.updateViewDate) || which === 'view') this.viewDate = date && new Date(date); this.fill(); this.setValue(); if (!which || which !== 'view') { this._trigger('changeDate'); } this.inputField.trigger('change'); if (this.o.autoclose && (!which || which === 'date')){ this.hide(); } }, moveDay: function(date, dir){ var newDate = new Date(date); newDate.setUTCDate(date.getUTCDate() + dir); return newDate; }, moveWeek: function(date, dir){ return this.moveDay(date, dir * 7); }, moveMonth: function(date, dir){ if (!isValidDate(date)) return this.o.defaultViewDate; if (!dir) return date; var new_date = new Date(date.valueOf()), day = new_date.getUTCDate(), month = new_date.getUTCMonth(), mag = Math.abs(dir), new_month, test; dir = dir > 0 ? 1 : -1; if (mag === 1){ test = dir === -1 // If going back one month, make sure month is not current month // (eg, Mar 31 -> Feb 31 == Feb 28, not Mar 02) ? function(){ return new_date.getUTCMonth() === month; } // If going forward one month, make sure month is as expected // (eg, Jan 31 -> Feb 31 == Feb 28, not Mar 02) : function(){ return new_date.getUTCMonth() !== new_month; }; new_month = month + dir; new_date.setUTCMonth(new_month); // Dec -> Jan (12) or Jan -> Dec (-1) -- limit expected date to 0-11 new_month = (new_month + 12) % 12; } else { // For magnitudes >1, move one month at a time... for (var i=0; i < mag; i++) // ...which might decrease the day (eg, Jan 31 to Feb 28, etc)... new_date = this.moveMonth(new_date, dir); // ...then reset the day, keeping it in the new month new_month = new_date.getUTCMonth(); new_date.setUTCDate(day); test = function(){ return new_month !== new_date.getUTCMonth(); }; } // Common date-resetting loop -- if date is beyond end of month, make it // end of month while (test()){ new_date.setUTCDate(--day); new_date.setUTCMonth(new_month); } return new_date; }, moveYear: function(date, dir){ return this.moveMonth(date, dir*12); }, moveAvailableDate: function(date, dir, fn){ do { date = this[fn](date, dir); if (!this.dateWithinRange(date)) return false; fn = 'moveDay'; } while (this.dateIsDisabled(date)); return date; }, weekOfDateIsDisabled: function(date){ return $.inArray(date.getUTCDay(), this.o.daysOfWeekDisabled) !== -1; }, dateIsDisabled: function(date){ return ( this.weekOfDateIsDisabled(date) || $.grep(this.o.datesDisabled, function(d){ return isUTCEquals(date, d); }).length > 0 ); }, dateWithinRange: function(date){ return date >= this.o.startDate && date <= this.o.endDate; }, keydown: function(e){ if (!this.picker.is(':visible')){ if (e.keyCode === 40 || e.keyCode === 27) { // allow down to re-show picker this.show(); e.stopPropagation(); } return; } var dateChanged = false, dir, newViewDate, focusDate = this.focusDate || this.viewDate; switch (e.keyCode){ case 27: // escape if (this.focusDate){ this.focusDate = null; this.viewDate = this.dates.get(-1) || this.viewDate; this.fill(); } else this.hide(); e.preventDefault(); e.stopPropagation(); break; case 37: // left case 38: // up case 39: // right case 40: // down if (!this.o.keyboardNavigation || this.o.daysOfWeekDisabled.length === 7) break; dir = e.keyCode === 37 || e.keyCode === 38 ? -1 : 1; if (this.viewMode === 0) { if (e.ctrlKey){ newViewDate = this.moveAvailableDate(focusDate, dir, 'moveYear'); if (newViewDate) this._trigger('changeYear', this.viewDate); } else if (e.shiftKey){ newViewDate = this.moveAvailableDate(focusDate, dir, 'moveMonth'); if (newViewDate) this._trigger('changeMonth', this.viewDate); } else if (e.keyCode === 37 || e.keyCode === 39){ newViewDate = this.moveAvailableDate(focusDate, dir, 'moveDay'); } else if (!this.weekOfDateIsDisabled(focusDate)){ newViewDate = this.moveAvailableDate(focusDate, dir, 'moveWeek'); } } else if (this.viewMode === 1) { if (e.keyCode === 38 || e.keyCode === 40) { dir = dir * 4; } newViewDate = this.moveAvailableDate(focusDate, dir, 'moveMonth'); } else if (this.viewMode === 2) { if (e.keyCode === 38 || e.keyCode === 40) { dir = dir * 4; } newViewDate = this.moveAvailableDate(focusDate, dir, 'moveYear'); } if (newViewDate){ this.focusDate = this.viewDate = newViewDate; this.setValue(); this.fill(); e.preventDefault(); } break; case 13: // enter if (!this.o.forceParse) break; focusDate = this.focusDate || this.dates.get(-1) || this.viewDate; if (this.o.keyboardNavigation) { this._toggle_multidate(focusDate); dateChanged = true; } this.focusDate = null; this.viewDate = this.dates.get(-1) || this.viewDate; this.setValue(); this.fill(); if (this.picker.is(':visible')){ e.preventDefault(); e.stopPropagation(); if (this.o.autoclose) this.hide(); } break; case 9: // tab this.focusDate = null; this.viewDate = this.dates.get(-1) || this.viewDate; this.fill(); this.hide(); break; } if (dateChanged){ if (this.dates.length) this._trigger('changeDate'); else this._trigger('clearDate'); this.inputField.trigger('change'); } }, setViewMode: function(viewMode){ this.viewMode = viewMode; this.picker .children('div') .hide() .filter('.datepicker-' + DPGlobal.viewModes[this.viewMode].clsName) .show(); this.updateNavArrows(); this._trigger('changeViewMode', new Date(this.viewDate)); } }; var DateRangePicker = function(element, options){ $.data(element, 'datepicker', this); this.element = $(element); this.inputs = $.map(options.inputs, function(i){ return i.jquery ? i[0] : i; }); delete options.inputs; this.keepEmptyValues = options.keepEmptyValues; delete options.keepEmptyValues; datepickerPlugin.call($(this.inputs), options) .on('changeDate', $.proxy(this.dateUpdated, this)); this.pickers = $.map(this.inputs, function(i){ return $.data(i, 'datepicker'); }); this.updateDates(); }; DateRangePicker.prototype = { updateDates: function(){ this.dates = $.map(this.pickers, function(i){ return i.getUTCDate(); }); this.updateRanges(); }, updateRanges: function(){ var range = $.map(this.dates, function(d){ return d.valueOf(); }); $.each(this.pickers, function(i, p){ p.setRange(range); }); }, clearDates: function(){ $.each(this.pickers, function(i, p){ p.clearDates(); }); }, dateUpdated: function(e){ // `this.updating` is a workaround for preventing infinite recursion // between `changeDate` triggering and `setUTCDate` calling. Until // there is a better mechanism. if (this.updating) return; this.updating = true; var dp = $.data(e.target, 'datepicker'); if (dp === undefined) { return; } var new_date = dp.getUTCDate(), keep_empty_values = this.keepEmptyValues, i = $.inArray(e.target, this.inputs), j = i - 1, k = i + 1, l = this.inputs.length; if (i === -1) return; $.each(this.pickers, function(i, p){ if (!p.getUTCDate() && (p === dp || !keep_empty_values)) p.setUTCDate(new_date); }); if (new_date < this.dates[j]){ // Date being moved earlier/left while (j >= 0 && new_date < this.dates[j] && (this.pickers[j].element.val() || "").length > 0) { this.pickers[j--].setUTCDate(new_date); } } else if (new_date > this.dates[k]){ // Date being moved later/right while (k < l && new_date > this.dates[k] && (this.pickers[k].element.val() || "").length > 0) { this.pickers[k++].setUTCDate(new_date); } } this.updateDates(); delete this.updating; }, destroy: function(){ $.map(this.pickers, function(p){ p.destroy(); }); $(this.inputs).off('changeDate', this.dateUpdated); delete this.element.data().datepicker; }, remove: alias('destroy', 'Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead') }; function opts_from_el(el, prefix){ // Derive options from element data-attrs var data = $(el).data(), out = {}, inkey, replace = new RegExp('^' + prefix.toLowerCase() + '([A-Z])'); prefix = new RegExp('^' + prefix.toLowerCase()); function re_lower(_,a){ return a.toLowerCase(); } for (var key in data) if (prefix.test(key)){ inkey = key.replace(replace, re_lower); out[inkey] = data[key]; } return out; } function opts_from_locale(lang){ // Derive options from locale plugins var out = {}; // Check if "de-DE" style date is available, if not language should // fallback to 2 letter code eg "de" if (!dates[lang]){ lang = lang.split('-')[0]; if (!dates[lang]) return; } var d = dates[lang]; $.each(locale_opts, function(i,k){ if (k in d) out[k] = d[k]; }); return out; } var old = $.fn.datepicker; var datepickerPlugin = function(option){ var args = Array.apply(null, arguments); args.shift(); var internal_return; this.each(function(){ var $this = $(this), data = $this.data('datepicker'), options = typeof option === 'object' && option; if (!data){ var elopts = opts_from_el(this, 'date'), // Preliminary otions xopts = $.extend({}, defaults, elopts, options), locopts = opts_from_locale(xopts.language), // Options priority: js args, data-attrs, locales, defaults opts = $.extend({}, defaults, locopts, elopts, options); if ($this.hasClass('input-daterange') || opts.inputs){ $.extend(opts, { inputs: opts.inputs || $this.find('input').toArray() }); data = new DateRangePicker(this, opts); } else { data = new Datepicker(this, opts); } $this.data('datepicker', data); } if (typeof option === 'string' && typeof data[option] === 'function'){ internal_return = data[option].apply(data, args); } }); if ( internal_return === undefined || internal_return instanceof Datepicker || internal_return instanceof DateRangePicker ) return this; if (this.length > 1) throw new Error('Using only allowed for the collection of a single element (' + option + ' function)'); else return internal_return; }; $.fn.datepicker = datepickerPlugin; var defaults = $.fn.datepicker.defaults = { assumeNearbyYear: false, autoclose: false, beforeShowDay: $.noop, beforeShowMonth: $.noop, beforeShowYear: $.noop, beforeShowDecade: $.noop, beforeShowCentury: $.noop, calendarWeeks: false, clearBtn: false, toggleActive: false, daysOfWeekDisabled: [], daysOfWeekHighlighted: [], datesDisabled: [], endDate: Infinity, forceParse: true, format: 'mm/dd/yyyy', isInline: null, keepEmptyValues: false, keyboardNavigation: true, language: 'en', minViewMode: 0, maxViewMode: 4, multidate: false, multidateSeparator: ',', orientation: "auto", rtl: false, startDate: -Infinity, startView: 0, todayBtn: false, todayHighlight: false, updateViewDate: true, weekStart: 0, disableTouchKeyboard: false, enableOnReadonly: true, showOnFocus: true, zIndexOffset: 10, container: 'body', immediateUpdates: false, title: '', templates: { leftArrow: '«', rightArrow: '»' }, showWeekDays: true }; var locale_opts = $.fn.datepicker.locale_opts = [ 'format', 'rtl', 'weekStart' ]; $.fn.datepicker.Constructor = Datepicker; var dates = $.fn.datepicker.dates = { en: { days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], today: "Today", clear: "Clear", titleFormat: "MM yyyy" } }; var DPGlobal = { viewModes: [ { names: ['days', 'month'], clsName: 'days', e: 'changeMonth' }, { names: ['months', 'year'], clsName: 'months', e: 'changeYear', navStep: 1 }, { names: ['years', 'decade'], clsName: 'years', e: 'changeDecade', navStep: 10 }, { names: ['decades', 'century'], clsName: 'decades', e: 'changeCentury', navStep: 100 }, { names: ['centuries', 'millennium'], clsName: 'centuries', e: 'changeMillennium', navStep: 1000 } ], validParts: /dd?|DD?|mm?|MM?|yy(?:yy)?/g, nonpunctuation: /[^ -\/:-@\u5e74\u6708\u65e5\[-`{-~\t\n\r]+/g, parseFormat: function(format){ if (typeof format.toValue === 'function' && typeof format.toDisplay === 'function') return format; // IE treats \0 as a string end in inputs (truncating the value), // so it's a bad format delimiter, anyway var separators = format.replace(this.validParts, '\0').split('\0'), parts = format.match(this.validParts); if (!separators || !separators.length || !parts || parts.length === 0){ throw new Error("Invalid date format."); } return {separators: separators, parts: parts}; }, parseDate: function(date, format, language, assumeNearby){ if (!date) return undefined; if (date instanceof Date) return date; if (typeof format === 'string') format = DPGlobal.parseFormat(format); if (format.toValue) return format.toValue(date, format, language); var fn_map = { d: 'moveDay', m: 'moveMonth', w: 'moveWeek', y: 'moveYear' }, dateAliases = { yesterday: '-1d', today: '+0d', tomorrow: '+1d' }, parts, part, dir, i, fn; if (date in dateAliases){ date = dateAliases[date]; } if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/i.test(date)){ parts = date.match(/([\-+]\d+)([dmwy])/gi); date = new Date(); for (i=0; i < parts.length; i++){ part = parts[i].match(/([\-+]\d+)([dmwy])/i); dir = Number(part[1]); fn = fn_map[part[2].toLowerCase()]; date = Datepicker.prototype[fn](date, dir); } return Datepicker.prototype._zero_utc_time(date); } parts = date && date.match(this.nonpunctuation) || []; function applyNearbyYear(year, threshold){ if (threshold === true) threshold = 10; // if year is 2 digits or less, than the user most likely is trying to get a recent century if (year < 100){ year += 2000; // if the new year is more than threshold years in advance, use last century if (year > ((new Date()).getFullYear()+threshold)){ year -= 100; } } return year; } var parsed = {}, setters_order = ['yyyy', 'yy', 'M', 'MM', 'm', 'mm', 'd', 'dd'], setters_map = { yyyy: function(d,v){ return d.setUTCFullYear(assumeNearby ? applyNearbyYear(v, assumeNearby) : v); }, m: function(d,v){ if (isNaN(d)) return d; v -= 1; while (v < 0) v += 12; v %= 12; d.setUTCMonth(v); while (d.getUTCMonth() !== v) d.setUTCDate(d.getUTCDate()-1); return d; }, d: function(d,v){ return d.setUTCDate(v); } }, val, filtered; setters_map['yy'] = setters_map['yyyy']; setters_map['M'] = setters_map['MM'] = setters_map['mm'] = setters_map['m']; setters_map['dd'] = setters_map['d']; date = UTCToday(); var fparts = format.parts.slice(); // Remove noop parts if (parts.length !== fparts.length){ fparts = $(fparts).filter(function(i,p){ return $.inArray(p, setters_order) !== -1; }).toArray(); } // Process remainder function match_part(){ var m = this.slice(0, parts[i].length), p = parts[i].slice(0, m.length); return m.toLowerCase() === p.toLowerCase(); } if (parts.length === fparts.length){ var cnt; for (i=0, cnt = fparts.length; i < cnt; i++){ val = parseInt(parts[i], 10); part = fparts[i]; if (isNaN(val)){ switch (part){ case 'MM': filtered = $(dates[language].months).filter(match_part); val = $.inArray(filtered[0], dates[language].months) + 1; break; case 'M': filtered = $(dates[language].monthsShort).filter(match_part); val = $.inArray(filtered[0], dates[language].monthsShort) + 1; break; } } parsed[part] = val; } var _date, s; for (i=0; i < setters_order.length; i++){ s = setters_order[i]; if (s in parsed && !isNaN(parsed[s])){ _date = new Date(date); setters_map[s](_date, parsed[s]); if (!isNaN(_date)) date = _date; } } } return date; }, formatDate: function(date, format, language){ if (!date) return ''; if (typeof format === 'string') format = DPGlobal.parseFormat(format); if (format.toDisplay) return format.toDisplay(date, format, language); var val = { d: date.getUTCDate(), D: dates[language].daysShort[date.getUTCDay()], DD: dates[language].days[date.getUTCDay()], m: date.getUTCMonth() + 1, M: dates[language].monthsShort[date.getUTCMonth()], MM: dates[language].months[date.getUTCMonth()], yy: date.getUTCFullYear().toString().substring(2), yyyy: date.getUTCFullYear() }; val.dd = (val.d < 10 ? '0' : '') + val.d; val.mm = (val.m < 10 ? '0' : '') + val.m; date = []; var seps = $.extend([], format.separators); for (var i=0, cnt = format.parts.length; i <= cnt; i++){ if (seps.length) date.push(seps.shift()); date.push(val[format.parts[i]]); } return date.join(''); }, headTemplate: '<thead>'+ '<tr>'+ '<th colspan="7" class="datepicker-title"></th>'+ '</tr>'+ '<tr>'+ '<th class="prev">'+defaults.templates.leftArrow+'</th>'+ '<th colspan="5" class="datepicker-switch"></th>'+ '<th class="next">'+defaults.templates.rightArrow+'</th>'+ '</tr>'+ '</thead>', contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>', footTemplate: '<tfoot>'+ '<tr>'+ '<th colspan="7" class="today"></th>'+ '</tr>'+ '<tr>'+ '<th colspan="7" class="clear"></th>'+ '</tr>'+ '</tfoot>' }; DPGlobal.template = '<div class="datepicker">'+ '<div class="datepicker-days">'+ '<table class="table-condensed">'+ DPGlobal.headTemplate+ '<tbody></tbody>'+ DPGlobal.footTemplate+ '</table>'+ '</div>'+ '<div class="datepicker-months">'+ '<table class="table-condensed">'+ DPGlobal.headTemplate+ DPGlobal.contTemplate+ DPGlobal.footTemplate+ '</table>'+ '</div>'+ '<div class="datepicker-years">'+ '<table class="table-condensed">'+ DPGlobal.headTemplate+ DPGlobal.contTemplate+ DPGlobal.footTemplate+ '</table>'+ '</div>'+ '<div class="datepicker-decades">'+ '<table class="table-condensed">'+ DPGlobal.headTemplate+ DPGlobal.contTemplate+ DPGlobal.footTemplate+ '</table>'+ '</div>'+ '<div class="datepicker-centuries">'+ '<table class="table-condensed">'+ DPGlobal.headTemplate+ DPGlobal.contTemplate+ DPGlobal.footTemplate+ '</table>'+ '</div>'+ '</div>'; $.fn.datepicker.DPGlobal = DPGlobal; /* DATEPICKER NO CONFLICT * =================== */ $.fn.datepicker.noConflict = function(){ $.fn.datepicker = old; return this; }; /* DATEPICKER VERSION * =================== */ $.fn.datepicker.version = '1.9.0'; $.fn.datepicker.deprecated = function(msg){ var console = window.console; if (console && console.warn) { console.warn('DEPRECATED: ' + msg); } }; /* DATEPICKER DATA-API * ================== */ $(document).on( 'focus.datepicker.data-api click.datepicker.data-api', '[data-provide="datepicker"]', function(e){ var $this = $(this); if ($this.data('datepicker')) return; e.preventDefault(); // component click requires us to explicitly show it datepickerPlugin.call($this, 'show'); } ); $(function(){ datepickerPlugin.call($('[data-provide="datepicker-inline"]')); }); }));;!function(t,i,e,s){"use strict";var n=function(i,e){this.widget="",this.$element=t(i),this.defaultTime=e.defaultTime,this.disableFocus=e.disableFocus,this.disableMousewheel=e.disableMousewheel,this.isOpen=e.isOpen,this.minuteStep=e.minuteStep,this.modalBackdrop=e.modalBackdrop,this.orientation=e.orientation,this.secondStep=e.secondStep,this.showInputs=e.showInputs,this.showMeridian=e.showMeridian,this.showSeconds=e.showSeconds,this.template=e.template,this.appendWidgetTo=e.appendWidgetTo,this.showWidgetOnAddonClick=e.showWidgetOnAddonClick,this._init()};n.prototype={constructor:n,_init:function(){var i=this;this.showWidgetOnAddonClick&&(this.$element.parent().hasClass("input-append")||this.$element.parent().hasClass("input-prepend"))?(this.$element.parent(".input-append, .input-prepend").find(".add-on").on({"click.timepicker":t.proxy(this.showWidget,this)}),this.$element.on({"focus.timepicker":t.proxy(this.highlightUnit,this),"click.timepicker":t.proxy(this.highlightUnit,this),"keydown.timepicker":t.proxy(this.elementKeydown,this),"blur.timepicker":t.proxy(this.blurElement,this),"mousewheel.timepicker DOMMouseScroll.timepicker":t.proxy(this.mousewheel,this)})):this.template?this.$element.on({"focus.timepicker":t.proxy(this.showWidget,this),"click.timepicker":t.proxy(this.showWidget,this),"blur.timepicker":t.proxy(this.blurElement,this),"mousewheel.timepicker DOMMouseScroll.timepicker":t.proxy(this.mousewheel,this)}):this.$element.on({"focus.timepicker":t.proxy(this.highlightUnit,this),"click.timepicker":t.proxy(this.highlightUnit,this),"keydown.timepicker":t.proxy(this.elementKeydown,this),"blur.timepicker":t.proxy(this.blurElement,this),"mousewheel.timepicker DOMMouseScroll.timepicker":t.proxy(this.mousewheel,this)}),this.template!==!1?this.$widget=t(this.getTemplate()).on("click",t.proxy(this.widgetClick,this)):this.$widget=!1,this.showInputs&&this.$widget!==!1&&this.$widget.find("input").each(function(){t(this).on({"click.timepicker":function(){t(this).select()},"keydown.timepicker":t.proxy(i.widgetKeydown,i),"keyup.timepicker":t.proxy(i.widgetKeyup,i)})}),this.setDefaultTime(this.defaultTime)},blurElement:function(){this.highlightedUnit=null,this.updateFromElementVal()},clear:function(){this.hour="",this.minute="",this.second="",this.meridian="",this.$element.val("")},decrementHour:function(){if(this.showMeridian)if(1===this.hour)this.hour=12;else{if(12===this.hour)return this.hour--,this.toggleMeridian();if(0===this.hour)return this.hour=11,this.toggleMeridian();this.hour--}else this.hour<=0?this.hour=23:this.hour--},decrementMinute:function(t){var i;i=t?this.minute-t:this.minute-this.minuteStep,0>i?(this.decrementHour(),this.minute=i+60):this.minute=i},decrementSecond:function(){var t=this.second-this.secondStep;0>t?(this.decrementMinute(!0),this.second=t+60):this.second=t},elementKeydown:function(t){switch(t.keyCode){case 9:case 27:this.updateFromElementVal();break;case 37:t.preventDefault(),this.highlightPrevUnit();break;case 38:switch(t.preventDefault(),this.highlightedUnit){case"hour":this.incrementHour(),this.highlightHour();break;case"minute":this.incrementMinute(),this.highlightMinute();break;case"second":this.incrementSecond(),this.highlightSecond();break;case"meridian":this.toggleMeridian(),this.highlightMeridian()}this.update();break;case 39:t.preventDefault(),this.highlightNextUnit();break;case 40:switch(t.preventDefault(),this.highlightedUnit){case"hour":this.decrementHour(),this.highlightHour();break;case"minute":this.decrementMinute(),this.highlightMinute();break;case"second":this.decrementSecond(),this.highlightSecond();break;case"meridian":this.toggleMeridian(),this.highlightMeridian()}this.update()}},getCursorPosition:function(){var t=this.$element.get(0);if("selectionStart"in t)return t.selectionStart;if(e.selection){t.focus();var i=e.selection.createRange(),s=e.selection.createRange().text.length;return i.moveStart("character",-t.value.length),i.text.length-s}},getTemplate:function(){var t,i,e,s,n,h;switch(this.showInputs?(i='<input type="text" class="bootstrap-timepicker-hour" maxlength="2"/>',e='<input type="text" class="bootstrap-timepicker-minute" maxlength="2"/>',s='<input type="text" class="bootstrap-timepicker-second" maxlength="2"/>',n='<input type="text" class="bootstrap-timepicker-meridian" maxlength="2"/>'):(i='<span class="bootstrap-timepicker-hour"></span>',e='<span class="bootstrap-timepicker-minute"></span>',s='<span class="bootstrap-timepicker-second"></span>',n='<span class="bootstrap-timepicker-meridian"></span>'),h='<table><tr><td><a href="#" data-action="incrementHour"><i class="fa fa-angle-up"></i></a></td><td class="separator"> </td><td><a href="#" data-action="incrementMinute"><i class="fa fa-angle-up"></i></a></td>'+(this.showSeconds?'<td class="separator"> </td><td><a href="#" data-action="incrementSecond"><i class="fa fa-angle-up"></i></a></td>':"")+(this.showMeridian?'<td class="separator"> </td><td class="meridian-column"><a href="#" data-action="toggleMeridian"><i class="fa fa-angle-up"></i></a></td>':"")+"</tr><tr><td>"+i+'</td> <td class="separator">:</td><td>'+e+"</td> "+(this.showSeconds?'<td class="separator">:</td><td>'+s+"</td>":"")+(this.showMeridian?'<td class="separator"> </td><td>'+n+"</td>":"")+'</tr><tr><td><a href="#" data-action="decrementHour"><i class="fa fa-angle-down"></i></a></td><td class="separator"></td><td><a href="#" data-action="decrementMinute"><i class="fa fa-angle-down"></i></a></td>'+(this.showSeconds?'<td class="separator"> </td><td><a href="#" data-action="decrementSecond"><i class="fa fa-angle-down"></i></a></td>':"")+(this.showMeridian?'<td class="separator"> </td><td><a href="#" data-action="toggleMeridian"><i class="fa fa-angle-down"></i></a></td>':"")+"</tr></table>",this.template){case"modal":t='<div class="bootstrap-timepicker-widget modal hide fade in" data-backdrop="'+(this.modalBackdrop?"true":"false")+'"><div class="modal-header"><a href="#" class="close" data-dismiss="modal">×</a><h3>Pick a Time</h3></div><div class="modal-content">'+h+'</div><div class="modal-footer"><a href="#" class="btn btn-primary" data-dismiss="modal">OK</a></div></div>';break;case"dropdown":t='<div class="bootstrap-timepicker-widget dropdown-menu">'+h+"</div>"}return t},getTime:function(){return""===this.hour?"":this.hour+":"+(1===this.minute.toString().length?"0"+this.minute:this.minute)+(this.showSeconds?":"+(1===this.second.toString().length?"0"+this.second:this.second):"")+(this.showMeridian?" "+this.meridian:"")},hideWidget:function(){this.isOpen!==!1&&(this.$element.trigger({type:"hide.timepicker",time:{value:this.getTime(),hours:this.hour,minutes:this.minute,seconds:this.second,meridian:this.meridian}}),"modal"===this.template&&this.$widget.modal?this.$widget.modal("hide"):this.$widget.removeClass("open"),t(e).off("mousedown.timepicker, touchend.timepicker"),this.isOpen=!1,this.$widget.detach())},highlightUnit:function(){this.position=this.getCursorPosition(),this.position>=0&&this.position<=2?this.highlightHour():this.position>=3&&this.position<=5?this.highlightMinute():this.position>=6&&this.position<=8?this.showSeconds?this.highlightSecond():this.highlightMeridian():this.position>=9&&this.position<=11&&this.highlightMeridian()},highlightNextUnit:function(){switch(this.highlightedUnit){case"hour":this.highlightMinute();break;case"minute":this.showSeconds?this.highlightSecond():this.showMeridian?this.highlightMeridian():this.highlightHour();break;case"second":this.showMeridian?this.highlightMeridian():this.highlightHour();break;case"meridian":this.highlightHour()}},highlightPrevUnit:function(){switch(this.highlightedUnit){case"hour":this.showMeridian?this.highlightMeridian():this.showSeconds?this.highlightSecond():this.highlightMinute();break;case"minute":this.highlightHour();break;case"second":this.highlightMinute();break;case"meridian":this.showSeconds?this.highlightSecond():this.highlightMinute()}},highlightHour:function(){var t=this.$element.get(0),i=this;this.highlightedUnit="hour",t.setSelectionRange&&setTimeout(function(){i.hour<10?t.setSelectionRange(0,1):t.setSelectionRange(0,2)},0)},highlightMinute:function(){var t=this.$element.get(0),i=this;this.highlightedUnit="minute",t.setSelectionRange&&setTimeout(function(){i.hour<10?t.setSelectionRange(2,4):t.setSelectionRange(3,5)},0)},highlightSecond:function(){var t=this.$element.get(0),i=this;this.highlightedUnit="second",t.setSelectionRange&&setTimeout(function(){i.hour<10?t.setSelectionRange(5,7):t.setSelectionRange(6,8)},0)},highlightMeridian:function(){var t=this.$element.get(0),i=this;this.highlightedUnit="meridian",t.setSelectionRange&&(this.showSeconds?setTimeout(function(){i.hour<10?t.setSelectionRange(8,10):t.setSelectionRange(9,11)},0):setTimeout(function(){i.hour<10?t.setSelectionRange(5,7):t.setSelectionRange(6,8)},0))},incrementHour:function(){if(this.showMeridian){if(11===this.hour)return this.hour++,this.toggleMeridian();12===this.hour&&(this.hour=0)}return 23===this.hour?void(this.hour=0):void this.hour++},incrementMinute:function(t){var i;i=t?this.minute+t:this.minute+this.minuteStep-this.minute%this.minuteStep,i>59?(this.incrementHour(),this.minute=i-60):this.minute=i},incrementSecond:function(){var t=this.second+this.secondStep-this.second%this.secondStep;t>59?(this.incrementMinute(!0),this.second=t-60):this.second=t},mousewheel:function(i){if(!this.disableMousewheel){i.preventDefault(),i.stopPropagation();var e=i.originalEvent.wheelDelta||-i.originalEvent.detail,s=null;switch("mousewheel"===i.type?s=-1*i.originalEvent.wheelDelta:"DOMMouseScroll"===i.type&&(s=40*i.originalEvent.detail),s&&(i.preventDefault(),t(this).scrollTop(s+t(this).scrollTop())),this.highlightedUnit){case"minute":e>0?this.incrementMinute():this.decrementMinute(),this.highlightMinute();break;case"second":e>0?this.incrementSecond():this.decrementSecond(),this.highlightSecond();break;case"meridian":this.toggleMeridian(),this.highlightMeridian();break;default:e>0?this.incrementHour():this.decrementHour(),this.highlightHour()}return!1}},place:function(){if(!this.isInline){var e=this.$widget.outerWidth(),s=this.$widget.outerHeight(),n=10,h=t(i).width(),o=t(i).height(),a=t(i).scrollTop(),r=parseInt(this.$element.parents().filter(function(){}).first().css("z-index"),10)+10,d=this.component?this.component.parent().offset():this.$element.offset(),c=this.component?this.component.outerHeight(!0):this.$element.outerHeight(!1),l=this.component?this.component.outerWidth(!0):this.$element.outerWidth(!1),u=d.left,p=d.top;this.$widget.removeClass("timepicker-orient-top timepicker-orient-bottom timepicker-orient-right timepicker-orient-left"),"auto"!==this.orientation.x?(this.picker.addClass("datepicker-orient-"+this.orientation.x),"right"===this.orientation.x&&(u-=e-l)):(this.$widget.addClass("timepicker-orient-left"),d.left<0?u-=d.left-n:d.left+e>h&&(u=h-e-n));var m,g,f=this.orientation.y;"auto"===f&&(m=-a+d.top-s,g=a+o-(d.top+c+s),f=Math.max(m,g)===g?"top":"bottom"),this.$widget.addClass("timepicker-orient-"+f),"top"===f?p+=c:p-=s+parseInt(this.$widget.css("padding-top"),10),this.$widget.css({top:p,left:u,zIndex:r})}},remove:function(){t("document").off(".timepicker"),this.$widget&&this.$widget.remove(),delete this.$element.data().timepicker},setDefaultTime:function(t){if(this.$element.val())this.updateFromElementVal();else if("current"===t){var i=new Date,e=i.getHours(),s=i.getMinutes(),n=i.getSeconds(),h="AM";0!==n&&(n=Math.ceil(i.getSeconds()/this.secondStep)*this.secondStep,60===n&&(s+=1,n=0)),0!==s&&(s=Math.ceil(i.getMinutes()/this.minuteStep)*this.minuteStep,60===s&&(e+=1,s=0)),this.showMeridian&&(0===e?e=12:e>=12?(e>12&&(e-=12),h="PM"):h="AM"),this.hour=e,this.minute=s,this.second=n,this.meridian=h,this.update()}else t===!1?(this.hour=0,this.minute=0,this.second=0,this.meridian="AM"):this.setTime(t)},setTime:function(t,i){if(!t)return void this.clear();var e,s,n,h,o;"object"==typeof t&&t.getMonth?(s=t.getHours(),n=t.getMinutes(),h=t.getSeconds(),this.showMeridian&&(o="AM",s>12&&(o="PM",s%=12),12===s&&(o="PM"))):(o=null!==t.match(/p/i)?"PM":"AM",t=t.replace(/[^0-9\:]/g,""),e=t.split(":"),s=e[0]?e[0].toString():e.toString(),n=e[1]?e[1].toString():"",h=e[2]?e[2].toString():"",s.length>4&&(h=s.substr(4,2)),s.length>2&&(n=s.substr(2,2),s=s.substr(0,2)),n.length>2&&(h=n.substr(2,2),n=n.substr(0,2)),h.length>2&&(h=h.substr(2,2)),s=parseInt(s,10),n=parseInt(n,10),h=parseInt(h,10),isNaN(s)&&(s=0),isNaN(n)&&(n=0),isNaN(h)&&(h=0),this.showMeridian?1>s?s=1:s>12&&(s=12):(s>=24?s=23:0>s&&(s=0),13>s&&"PM"===o&&(s+=12)),0>n?n=0:n>=60&&(n=59),this.showSeconds&&(isNaN(h)?h=0:0>h?h=0:h>=60&&(h=59))),this.hour=s,this.minute=n,this.second=h,this.meridian=o,this.update(i)},showWidget:function(){if(!this.isOpen&&!this.$element.is(":disabled")){this.$widget.appendTo(this.appendWidgetTo);var i=this;t(e).on("mousedown.timepicker, touchend.timepicker",function(t){i.$element.parent().find(t.target).length||i.$widget.is(t.target)||i.$widget.find(t.target).length||i.hideWidget()}),this.$element.trigger({type:"show.timepicker",time:{value:this.getTime(),hours:this.hour,minutes:this.minute,seconds:this.second,meridian:this.meridian}}),this.place(),this.disableFocus&&this.$element.blur(),""===this.hour&&(this.defaultTime?this.setDefaultTime(this.defaultTime):this.setTime("0:0:0")),"modal"===this.template&&this.$widget.modal?this.$widget.modal("show").on("hidden",t.proxy(this.hideWidget,this)):this.isOpen===!1&&this.$widget.addClass("open"),this.isOpen=!0}},toggleMeridian:function(){this.meridian="AM"===this.meridian?"PM":"AM"},update:function(t){this.updateElement(),t||this.updateWidget(),this.$element.trigger({type:"changeTime.timepicker",time:{value:this.getTime(),hours:this.hour,minutes:this.minute,seconds:this.second,meridian:this.meridian}})},updateElement:function(){this.$element.val(this.getTime()).change()},updateFromElementVal:function(){this.setTime(this.$element.val())},updateWidget:function(){if(this.$widget!==!1){var t=this.hour,i=1===this.minute.toString().length?"0"+this.minute:this.minute,e=1===this.second.toString().length?"0"+this.second:this.second;this.showInputs?(this.$widget.find("input.bootstrap-timepicker-hour").val(t),this.$widget.find("input.bootstrap-timepicker-minute").val(i),this.showSeconds&&this.$widget.find("input.bootstrap-timepicker-second").val(e),this.showMeridian&&this.$widget.find("input.bootstrap-timepicker-meridian").val(this.meridian)):(this.$widget.find("span.bootstrap-timepicker-hour").text(t),this.$widget.find("span.bootstrap-timepicker-minute").text(i),this.showSeconds&&this.$widget.find("span.bootstrap-timepicker-second").text(e),this.showMeridian&&this.$widget.find("span.bootstrap-timepicker-meridian").text(this.meridian))}},updateFromWidgetInputs:function(){if(this.$widget!==!1){var t=this.$widget.find("input.bootstrap-timepicker-hour").val()+":"+this.$widget.find("input.bootstrap-timepicker-minute").val()+(this.showSeconds?":"+this.$widget.find("input.bootstrap-timepicker-second").val():"")+(this.showMeridian?this.$widget.find("input.bootstrap-timepicker-meridian").val():"");this.setTime(t,!0)}},widgetClick:function(i){i.stopPropagation(),i.preventDefault();var e=t(i.target),s=e.closest("a").data("action");s&&this[s](),this.update(),e.is("input")&&e.get(0).setSelectionRange(0,2)},widgetKeydown:function(i){var e=t(i.target),s=e.attr("class").replace("bootstrap-timepicker-","");switch(i.keyCode){case 9:if(this.showMeridian&&"meridian"===s||this.showSeconds&&"second"===s||!this.showMeridian&&!this.showSeconds&&"minute"===s)return this.hideWidget();break;case 27:this.hideWidget();break;case 38:switch(i.preventDefault(),s){case"hour":this.incrementHour();break;case"minute":this.incrementMinute();break;case"second":this.incrementSecond();break;case"meridian":this.toggleMeridian()}this.setTime(this.getTime()),e.get(0).setSelectionRange(0,2);break;case 40:switch(i.preventDefault(),s){case"hour":this.decrementHour();break;case"minute":this.decrementMinute();break;case"second":this.decrementSecond();break;case"meridian":this.toggleMeridian()}this.setTime(this.getTime()),e.get(0).setSelectionRange(0,2)}},widgetKeyup:function(t){(65===t.keyCode||77===t.keyCode||80===t.keyCode||46===t.keyCode||8===t.keyCode||t.keyCode>=46&&t.keyCode<=57)&&this.updateFromWidgetInputs()}},t.fn.timepicker=function(i){var e=Array.apply(null,arguments);return e.shift(),this.each(function(){var s=t(this),h=s.data("timepicker"),o="object"==typeof i&&i;h||s.data("timepicker",h=new n(this,t.extend({},t.fn.timepicker.defaults,o,t(this).data()))),"string"==typeof i&&h[i].apply(h,e)})},t.fn.timepicker.defaults={defaultTime:"current",disableFocus:!1,disableMousewheel:!1,isOpen:!1,minuteStep:15,modalBackdrop:!1,orientation:{x:"auto",y:"auto"},secondStep:15,showSeconds:!1,showInputs:!0,showMeridian:!0,template:"dropdown",appendWidgetTo:"body",showWidgetOnAddonClick:!0},t.fn.timepicker.Constructor=n}(jQuery,window,document);;!function(t,e,n,o,i){"use strict";function r(t){var e="bez_"+o.makeArray(arguments).join("_").replace(".","p");if("function"!=typeof o.easing[e]){var n=function(t,e){var n=[null,null],o=[null,null],i=[null,null],r=function(r,a){return i[a]=3*t[a],o[a]=3*(e[a]-t[a])-i[a],n[a]=1-i[a]-o[a],r*(i[a]+r*(o[a]+r*n[a]))},a=function(t){return i[0]+t*(2*o[0]+3*n[0]*t)},s=function(t){for(var e,n=t,o=0;++o<14&&(e=r(n,0)-t,!(Math.abs(e)<.001));)n-=e/a(n);return n};return function(t){return r(s(t),1)}};o.easing[e]=function(e,o,i,r,a){return r*n([t[0],t[1]],[t[2],t[3]])(o/a)+i}}return e}function a(){}function s(t,e,n){return Math.max(isNaN(e)?-1/0:e,Math.min(isNaN(n)?1/0:n,t))}function u(t){return t.match(/ma/)&&t.match(/-?\d+(?!d)/g)[t.match(/3d/)?12:4]}function c(t){return Pe?+u(t.css("transform")):+t.css("left").replace("px","")}function l(t,e){var n={};return Pe?n.transform="translate3d("+(t+(e?.001:0))+"px,0,0)":n.left=t,n}function f(t){return{"transition-duration":t+"ms"}}function d(t,e){return+String(t).replace(e||"px","")||i}function h(t){return/%$/.test(t)&&d(t,"%")}function m(t,e){return h(t)/100*e||d(t)}function p(t){return(!!d(t)||!!d(t,"%"))&&t}function v(t,e,n,o){return(t-(o||0))*(e+(n||0))}function g(t,e,n,o){return-Math.round(t/(e+(n||0))-(o||0))}function w(t){var e=t.data();if(!e.tEnd){var n=t[0],o={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",msTransition:"MSTransitionEnd",transition:"transitionend"};n.addEventListener(o[de.prefixed("transition")],function(t){e.tProp&&t.propertyName.match(e.tProp)&&e.onEndFn()},!1),e.tEnd=!0}}function y(t,e,n,o){var i,r=t.data();r&&(r.onEndFn=function(){i||(i=!0,clearTimeout(r.tT),n())},r.tProp=e,clearTimeout(r.tT),r.tT=setTimeout(function(){r.onEndFn()},1.5*o),w(t))}function x(t,e,n){if(t.length){var o=t.data();Pe?(t.css(f(0)),o.onEndFn=a,clearTimeout(o.tT)):t.stop();var i=b(e,function(){return c(t)});return t.css(l(i,n)),i}}function b(){for(var t,e=0,n=arguments.length;n>e&&(t=e?arguments[e]():arguments[e],"number"!=typeof t);e++);return t}function _(t,e){return Math.round(t+(e-t)/1.5)}function C(){return C.p=C.p||("https:"===n.protocol?"https://":"http://"),C.p}function T(t){var n=e.createElement("a");return n.href=t,n}function k(t,e){if("string"!=typeof t)return t;t=T(t);var n,o;if(t.host.match(/youtube\.com/)&&t.search){if(n=t.search.split("v=")[1]){var i=n.indexOf("&");-1!==i&&(n=n.substring(0,i)),o="youtube"}}else t.host.match(/youtube\.com|youtu\.be/)?(n=t.pathname.replace(/^\/(embed\/|v\/)?/,"").replace(/\/.*/,""),o="youtube"):t.host.match(/vimeo\.com/)&&(o="vimeo",n=t.pathname.replace(/^\/(video\/)?/,"").replace(/\/.*/,""));return n&&o||!e||(n=t.href,o="custom"),n?{id:n,type:o,s:t.search.replace(/^\?/,"")}:!1}function M(t,e,n){var i,r,a=t.video;return"youtube"===a.type?(r=C()+"img.youtube.com/vi/"+a.id+"/default.jpg",i=r.replace(/\/default.jpg$/,"/hqdefault.jpg"),t.thumbsReady=!0):"vimeo"===a.type?o.ajax({url:C()+"vimeo.com/api/v2/video/"+a.id+".json",dataType:"jsonp",success:function(o){t.thumbsReady=!0,S(e,{img:o[0].thumbnail_large,thumb:o[0].thumbnail_small},t.i,n)}}):t.thumbsReady=!0,{img:i,thumb:r}}function S(t,e,n,i){for(var r=0,a=t.length;a>r;r++){var s=t[r];if(s.i===n&&s.thumbsReady){var u={videoReady:!0};u[Ve]=u[Qe]=u[Xe]=!1,i.splice(r,1,o.extend({},s,u,e));break}}}function F(t){function e(t,e,i){var r=t.children("img").eq(0),a=t.attr("href"),s=t.attr("src"),u=r.attr("src"),c=e.video,l=i?k(a,c===!0):!1;l?a=!1:l=c,n(t,r,o.extend(e,{video:l,img:e.img||a||s||u,thumb:e.thumb||u||s||a}))}function n(t,e,n){var i=n.thumb&&n.img!==n.thumb,r=d(n.width||t.attr("width")),a=d(n.height||t.attr("height"));o.extend(n,{width:r,height:a,thumbratio:H(n.thumbratio||d(n.thumbwidth||e&&e.attr("width")||i||r)/d(n.thumbheight||e&&e.attr("height")||i||a))})}var i=[];return t.children().each(function(){var t=o(this),r=W(o.extend(t.data(),{id:t.attr("id")}));if(t.is("a, img"))e(t,r,!0);else{if(t.is(":empty"))return;n(t,null,o.extend(r,{html:this,_html:t.html()}))}i.push(r)}),i}function E(t){return 0===t.offsetWidth&&0===t.offsetHeight}function P(t){return!o.contains(e.documentElement,t)}function j(t,e,n){t()?e():setTimeout(function(){j(t,e)},n||100)}function N(t){n.replace(n.protocol+"//"+n.host+n.pathname.replace(/^\/?/,"/")+n.search+"#"+t)}function $(t,e,n){var o=t.data(),i=o.measures;if(i&&(!o.l||o.l.W!==i.width||o.l.H!==i.height||o.l.r!==i.ratio||o.l.w!==e.w||o.l.h!==e.h||o.l.m!==n)){var r=i.width,a=i.height,u=e.w/e.h,c=i.ratio>=u,l="scaledown"===n,f="contain"===n,d="cover"===n;c&&(l||f)||!c&&d?(r=s(e.w,0,l?r:1/0),a=r/i.ratio):(c&&d||!c&&(l||f))&&(a=s(e.h,0,l?a:1/0),r=a*i.ratio),t.css({width:Math.ceil(r),height:Math.ceil(a),marginLeft:Math.floor(-r/2),marginTop:Math.floor(-a/2)}),o.l={W:i.width,H:i.height,r:i.ratio,w:e.w,h:e.h,m:n}}return!0}function q(t,e){var n=t[0];n.styleSheet?n.styleSheet.cssText=e:t.html(e)}function L(t,e,n){return e===n?!1:e>=t?"left":t>=n?"right":"left right"}function z(t,e,n,o){if(!n)return!1;if(!isNaN(t))return t-(o?0:1);for(var i,r=0,a=e.length;a>r;r++){var s=e[r];if(s.id===t){i=r;break}}return i}function A(t,e,n){n=n||{},t.each(function(){var t,i=o(this),r=i.data();r.clickOn||(r.clickOn=!0,o.extend(U(i,{onStart:function(e){t=e,(n.onStart||a).call(this,e)},onMove:n.onMove||a,onTouchEnd:n.onTouchEnd||a,onEnd:function(n){n.moved||e.call(this,t)}}),{noMove:!0}))})}function O(t,e){return'<div class="'+t+'">'+(e||"")+"</div>"}function I(t){for(var e=t.length;e;){var n=Math.floor(Math.random()*e--),o=t[e];t[e]=t[n],t[n]=o}return t}function R(t){return"[object Array]"==Object.prototype.toString.call(t)&&o.map(t,function(t){return o.extend({},t)})}function D(t,e){Me.scrollLeft(t).scrollTop(e)}function W(t){if(t){var e={};return o.each(t,function(t,n){e[t.toLowerCase()]=n}),e}}function H(t){if(t){var e=+t;return isNaN(e)?(e=t.split("/"),+e[0]/+e[1]||i):e}}function K(t,e){t.preventDefault(),e&&t.stopPropagation()}function B(t){return t?">":"<"}function V(t,e){var n=t.data(),i=Math.round(e.pos),r=function(){n.sliding=!1,(e.onEnd||a)()};"undefined"!=typeof e.overPos&&e.overPos!==e.pos&&(i=e.overPos,r=function(){V(t,o.extend({},e,{overPos:e.pos,time:Math.max(Ie,e.time/2)}))});var s=o.extend(l(i,e._001),e.width&&{width:e.width});n.sliding=!0,Pe?(t.css(o.extend(f(e.time),s)),e.time>10?y(t,"transform",r,e.time):r()):t.stop().animate(s,e.time,Ue,r)}function X(t,e,n,i,r,s){var u="undefined"!=typeof s;if(u||(r.push(arguments),Array.prototype.push.call(arguments,r.length),!(r.length>1))){t=t||o(t),e=e||o(e);var c=t[0],l=e[0],f="crossfade"===i.method,d=function(){if(!d.done){d.done=!0;var t=(u||r.shift())&&r.shift();t&&X.apply(this,t),(i.onEnd||a)(!!t)}},h=i.time/(s||1);n.removeClass(zt+" "+Lt),t.stop().addClass(zt),e.stop().addClass(Lt),f&&l&&t.fadeTo(0,0),t.fadeTo(f?h:0,1,f&&d),e.fadeTo(h,0,d),c&&f||l||d()}}function Q(t){var e=(t.touches||[])[0]||t;t._x=e.pageX,t._y=e.clientY,t._now=o.now()}function U(n,i){function r(t){return h=o(t.target),b.checked=v=g=y=!1,f||b.flow||t.touches&&t.touches.length>1||t.which>1||_e&&_e.type!==t.type&&Te||(v=i.select&&h.is(i.select,x))?v:(p="touchstart"===t.type,g=h.is("a, a *",x),m=b.control,w=b.noMove||b.noSwipe||m?16:b.snap?0:4,Q(t),d=_e=t,Ce=t.type.replace(/down|start/,"move").replace(/Down/,"Move"),(i.onStart||a).call(x,t,{control:m,$target:h}),f=b.flow=!0,void((!p||b.go)&&K(t)))}function s(t){if(t.touches&&t.touches.length>1||ze&&!t.isPrimary||Ce!==t.type||!f)return f&&u(),void(i.onTouchEnd||a)();Q(t);var e=Math.abs(t._x-d._x),n=Math.abs(t._y-d._y),o=e-n,r=(b.go||b.x||o>=0)&&!b.noSwipe,s=0>o;p&&!b.checked?(f=r)&&K(t):(K(t),(i.onMove||a).call(x,t,{touch:p})),!y&&Math.sqrt(Math.pow(e,2)+Math.pow(n,2))>w&&(y=!0),b.checked=b.checked||r||s}function u(t){(i.onTouchEnd||a)();var e=f;b.control=f=!1,e&&(b.flow=!1),!e||g&&!b.checked||(t&&K(t),Te=!0,clearTimeout(ke),ke=setTimeout(function(){Te=!1},1e3),(i.onEnd||a).call(x,{moved:y,$target:h,control:m,touch:p,startEvent:d,aborted:!t||"MSPointerCancel"===t.type}))}function c(){b.flow||setTimeout(function(){b.flow=!0},10)}function l(){b.flow&&setTimeout(function(){b.flow=!1},Oe)}var f,d,h,m,p,v,g,w,y,x=n[0],b={};return ze?(x[Le]("MSPointerDown",r,!1),e[Le]("MSPointerMove",s,!1),e[Le]("MSPointerCancel",u,!1),e[Le]("MSPointerUp",u,!1)):(x[Le]&&(x[Le]("touchstart",r,!1),x[Le]("touchmove",s,!1),x[Le]("touchend",u,!1),e[Le]("touchstart",c,!1),e[Le]("touchend",l,!1),e[Le]("touchcancel",l,!1),t[Le]("scroll",l,!1)),n.on("mousedown",r),Se.on("mousemove",s).on("mouseup",u)),n.on("click","a",function(t){b.checked&&K(t)}),b}function Y(t,e){function n(n,o){M=!0,c=f=n._x,v=n._now,p=[[v,c]],d=h=E.noMove||o?0:x(t,(e.getPos||a)(),e._001),(e.onStart||a).call(S,n)}function i(t,e){w=E.min,y=E.max,b=E.snap,C=t.altKey,M=k=!1,T=e.control,T||F.sliding||n(t)}function r(o,i){E.noSwipe||(M||n(o),f=o._x,p.push([o._now,f]),h=d-(c-f),m=L(h,w,y),w>=h?h=_(h,w):h>=y&&(h=_(h,y)),E.noMove||(t.css(l(h,e._001)),k||(k=!0,i.touch||ze||t.addClass(Gt)),(e.onMove||a).call(S,o,{pos:h,edge:m})))}function u(i){if(!E.noSwipe||!i.moved){M||n(i.startEvent,!0),i.touch||ze||t.removeClass(Gt),g=o.now();for(var r,u,c,l,m,v,x,_,T,k=g-Oe,F=null,P=Ie,j=e.friction,N=p.length-1;N>=0;N--){if(r=p[N][0],u=Math.abs(r-k),null===F||c>u)F=r,l=p[N][1];else if(F===k||u>c)break;c=u}x=s(h,w,y);var $=l-f,q=$>=0,L=g-F,z=L>Oe,A=!z&&h!==d&&x===h;b&&(x=s(Math[A?q?"floor":"ceil":"round"](h/b)*b,w,y),w=y=x),A&&(b||x===h)&&(T=-($/L),P*=s(Math.abs(T),e.timeLow,e.timeHigh),m=Math.round(h+T*P/j),b||(x=m),(!q&&m>y||q&&w>m)&&(v=q?w:y,_=m-v,b||(x=v),_=s(x+.03*_,v-50,v+50),P=Math.abs((h-_)/(T/j)))),P*=C?10:1,(e.onEnd||a).call(S,o.extend(i,{moved:i.moved||z&&b,pos:h,newPos:x,overPos:_,time:P}))}}var c,f,d,h,m,p,v,g,w,y,b,C,T,k,M,S=t[0],F=t.data(),E={};return E=o.extend(U(e.$wrap,{onStart:i,onMove:r,onTouchEnd:e.onTouchEnd,onEnd:u,select:e.select}),E)}function G(t,e){var n,i,r,s=t[0],u={prevent:{}};return s[Le]&&s[Le](Ae,function(t){var s=t.wheelDeltaY||-1*t.deltaY||0,c=t.wheelDeltaX||-1*t.deltaX||0,l=Math.abs(c)>Math.abs(s),f=B(0>c),d=i===f,h=o.now(),m=Oe>h-r;i=f,r=h,l&&u.ok&&(!u.prevent[f]||n)&&(K(t,!0),n&&d&&m||(e.shift&&(n=!0,clearTimeout(u.t),u.t=setTimeout(function(){n=!1},Re)),(e.onEnd||a)(t,e.shift?f:c)))},!1),u}function J(){o.each(o.Fotorama.instances,function(t,e){e.index=t})}function Z(t){o.Fotorama.instances.push(t),J()}function tt(t){o.Fotorama.instances.splice(t.index,1),J()}var et="fotorama",nt="fullscreen",ot=et+"__wrap",it=ot+"--css2",rt=ot+"--css3",at=ot+"--video",st=ot+"--fade",ut=ot+"--slide",ct=ot+"--no-controls",lt=ot+"--no-shadows",ft=ot+"--pan-y",dt=ot+"--rtl",ht=ot+"--only-active",mt=ot+"--no-captions",pt=ot+"--toggle-arrows",vt=et+"__stage",gt=vt+"__frame",wt=gt+"--video",yt=vt+"__shaft",xt=et+"__grab",bt=et+"__pointer",_t=et+"__arr",Ct=_t+"--disabled",Tt=_t+"--prev",kt=_t+"--next",Mt=et+"__nav",St=Mt+"-wrap",Ft=Mt+"__shaft",Et=Mt+"--dots",Pt=Mt+"--thumbs",jt=Mt+"__frame",Nt=jt+"--dot",$t=jt+"--thumb",qt=et+"__fade",Lt=qt+"-front",zt=qt+"-rear",At=et+"__shadow",Ot=At+"s",It=Ot+"--left",Rt=Ot+"--right",Dt=et+"__active",Wt=et+"__select",Ht=et+"--hidden",Kt=et+"--fullscreen",Bt=et+"__fullscreen-icon",Vt=et+"__error",Xt=et+"__loading",Qt=et+"__loaded",Ut=Qt+"--full",Yt=Qt+"--img",Gt=et+"__grabbing",Jt=et+"__img",Zt=Jt+"--full",te=et+"__dot",ee=et+"__thumb",ne=ee+"-border",oe=et+"__html",ie=et+"__video",re=ie+"-play",ae=ie+"-close",se=et+"__caption",ue=et+"__caption__wrap",ce=et+"__spinner",le=o&&o.fn.jquery.split(".");if(!le||le[0]<1||1==le[0]&&le[1]<8)throw"Fotorama requires jQuery 1.8 or later and will not run without it.";var fe={},de=function(t,e,n){function o(t){g.cssText=t}function i(t,e){return typeof t===e}function r(t,e){return!!~(""+t).indexOf(e)}function a(t,e){for(var o in t){var i=t[o];if(!r(i,"-")&&g[i]!==n)return"pfx"==e?i:!0}return!1}function s(t,e,o){for(var r in t){var a=e[t[r]];if(a!==n)return o===!1?t[r]:i(a,"function")?a.bind(o||e):a}return!1}function u(t,e,n){var o=t.charAt(0).toUpperCase()+t.slice(1),r=(t+" "+x.join(o+" ")+o).split(" ");return i(e,"string")||i(e,"undefined")?a(r,e):(r=(t+" "+b.join(o+" ")+o).split(" "),s(r,e,n))}var c,l,f,d="2.6.2",h={},m=e.documentElement,p="modernizr",v=e.createElement(p),g=v.style,w=({}.toString," -webkit- -moz- -o- -ms- ".split(" ")),y="Webkit Moz O ms",x=y.split(" "),b=y.toLowerCase().split(" "),_={},C=[],T=C.slice,k=function(t,n,o,i){var r,a,s,u,c=e.createElement("div"),l=e.body,f=l||e.createElement("body");if(parseInt(o,10))for(;o--;)s=e.createElement("div"),s.id=i?i[o]:p+(o+1),c.appendChild(s);return r=["­",'<style id="s',p,'">',t,"</style>"].join(""),c.id=p,(l?c:f).innerHTML+=r,f.appendChild(c),l||(f.style.background="",f.style.overflow="hidden",u=m.style.overflow,m.style.overflow="hidden",m.appendChild(f)),a=n(c,t),l?c.parentNode.removeChild(c):(f.parentNode.removeChild(f),m.style.overflow=u),!!a},M={}.hasOwnProperty;f=i(M,"undefined")||i(M.call,"undefined")?function(t,e){return e in t&&i(t.constructor.prototype[e],"undefined")}:function(t,e){return M.call(t,e)},Function.prototype.bind||(Function.prototype.bind=function(t){var e=this;if("function"!=typeof e)throw new TypeError;var n=T.call(arguments,1),o=function(){if(this instanceof o){var i=function(){};i.prototype=e.prototype;var r=new i,a=e.apply(r,n.concat(T.call(arguments)));return Object(a)===a?a:r}return e.apply(t,n.concat(T.call(arguments)))};return o}),_.csstransforms3d=function(){var t=!!u("perspective");return t};for(var S in _)f(_,S)&&(l=S.toLowerCase(),h[l]=_[S](),C.push((h[l]?"":"no-")+l));return h.addTest=function(t,e){if("object"==typeof t)for(var o in t)f(t,o)&&h.addTest(o,t[o]);else{if(t=t.toLowerCase(),h[t]!==n)return h;e="function"==typeof e?e():e,"undefined"!=typeof enableClasses&&enableClasses&&(m.className+=" "+(e?"":"no-")+t),h[t]=e}return h},o(""),v=c=null,h._version=d,h._prefixes=w,h._domPrefixes=b,h._cssomPrefixes=x,h.testProp=function(t){return a([t])},h.testAllProps=u,h.testStyles=k,h.prefixed=function(t,e,n){return e?u(t,e,n):u(t,"pfx")},h}(t,e),he={ok:!1,is:function(){return!1},request:function(){},cancel:function(){},event:"",prefix:""},me="webkit moz o ms khtml".split(" ");if("undefined"!=typeof e.cancelFullScreen)he.ok=!0;else for(var pe=0,ve=me.length;ve>pe;pe++)if(he.prefix=me[pe],"undefined"!=typeof e[he.prefix+"CancelFullScreen"]){he.ok=!0;break}he.ok&&(he.event=he.prefix+"fullscreenchange",he.is=function(){switch(this.prefix){case"":return e.fullScreen;case"webkit":return e.webkitIsFullScreen;default:return e[this.prefix+"FullScreen"]}},he.request=function(t){return""===this.prefix?t.requestFullScreen():t[this.prefix+"RequestFullScreen"]()},he.cancel=function(){return""===this.prefix?e.cancelFullScreen():e[this.prefix+"CancelFullScreen"]()});var ge,we={lines:12,length:5,width:2,radius:7,corners:1,rotate:15,color:"rgba(128, 128, 128, .75)",hwaccel:!0},ye={top:"auto",left:"auto",className:""};!function(t,e){ge=e()}(this,function(){function t(t,n){var o,i=e.createElement(t||"div");for(o in n)i[o]=n[o];return i}function n(t){for(var e=1,n=arguments.length;n>e;e++)t.appendChild(arguments[e]);return t}function o(t,e,n,o){var i=["opacity",e,~~(100*t),n,o].join("-"),r=.01+n/o*100,a=Math.max(1-(1-t)/e*(100-r),t),s=d.substring(0,d.indexOf("Animation")).toLowerCase(),u=s&&"-"+s+"-"||"";return m[i]||(p.insertRule("@"+u+"keyframes "+i+"{0%{opacity:"+a+"}"+r+"%{opacity:"+t+"}"+(r+.01)+"%{opacity:1}"+(r+e)%100+"%{opacity:"+t+"}100%{opacity:"+a+"}}",p.cssRules.length),m[i]=1),i}function r(t,e){var n,o,r=t.style;for(e=e.charAt(0).toUpperCase()+e.slice(1),o=0;o<h.length;o++)if(n=h[o]+e,r[n]!==i)return n;return r[e]!==i?e:void 0}function a(t,e){for(var n in e)t.style[r(t,n)||n]=e[n];return t}function s(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)t[o]===i&&(t[o]=n[o])}return t}function u(t){for(var e={x:t.offsetLeft,y:t.offsetTop};t=t.offsetParent;)e.x+=t.offsetLeft,e.y+=t.offsetTop;return e}function c(t,e){return"string"==typeof t?t:t[e%t.length]}function l(t){return"undefined"==typeof this?new l(t):void(this.opts=s(t||{},l.defaults,v))}function f(){function e(e,n){return t("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',n)}p.addRule(".spin-vml","behavior:url(#default#VML)"),l.prototype.lines=function(t,o){function i(){return a(e("group",{coordsize:l+" "+l,coordorigin:-u+" "+-u}),{width:l,height:l})}function r(t,r,s){n(d,n(a(i(),{rotation:360/o.lines*t+"deg",left:~~r}),n(a(e("roundrect",{arcsize:o.corners}),{width:u,height:o.width,left:o.radius,top:-o.width>>1,filter:s}),e("fill",{color:c(o.color,t),opacity:o.opacity}),e("stroke",{opacity:0}))))}var s,u=o.length+o.width,l=2*u,f=2*-(o.width+o.length)+"px",d=a(i(),{position:"absolute",top:f,left:f});if(o.shadow)for(s=1;s<=o.lines;s++)r(s,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(s=1;s<=o.lines;s++)r(s);return n(t,d)},l.prototype.opacity=function(t,e,n,o){var i=t.firstChild;o=o.shadow&&o.lines||0,i&&e+o<i.childNodes.length&&(i=i.childNodes[e+o],i=i&&i.firstChild,i=i&&i.firstChild,i&&(i.opacity=n))}}var d,h=["webkit","Moz","ms","O"],m={},p=function(){var o=t("style",{type:"text/css"});return n(e.getElementsByTagName("head")[0],o),o.sheet||o.styleSheet}(),v={lines:12,length:7,width:5,radius:10,rotate:0,corners:1,color:"#000",direction:1,speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"auto",left:"auto",position:"relative"};l.defaults={},s(l.prototype,{spin:function(e){this.stop();var n,o,i=this,r=i.opts,s=i.el=a(t(0,{className:r.className}),{position:r.position,width:0,zIndex:r.zIndex}),c=r.radius+r.length+r.width;if(e&&(e.insertBefore(s,e.firstChild||null),o=u(e),n=u(s),a(s,{left:("auto"==r.left?o.x-n.x+(e.offsetWidth>>1):parseInt(r.left,10)+c)+"px",top:("auto"==r.top?o.y-n.y+(e.offsetHeight>>1):parseInt(r.top,10)+c)+"px"})),s.setAttribute("role","progressbar"),i.lines(s,i.opts),!d){var l,f=0,h=(r.lines-1)*(1-r.direction)/2,m=r.fps,p=m/r.speed,v=(1-r.opacity)/(p*r.trail/100),g=p/r.lines;!function w(){f++;for(var t=0;t<r.lines;t++)l=Math.max(1-(f+(r.lines-t)*g)%p*v,r.opacity),i.opacity(s,t*r.direction+h,l,r);i.timeout=i.el&&setTimeout(w,~~(1e3/m))}()}return i},stop:function(){var t=this.el;return t&&(clearTimeout(this.timeout),t.parentNode&&t.parentNode.removeChild(t),this.el=i),this},lines:function(e,i){function r(e,n){return a(t(),{position:"absolute",width:i.length+i.width+"px",height:i.width+"px",background:e,boxShadow:n,transformOrigin:"left",transform:"rotate("+~~(360/i.lines*u+i.rotate)+"deg) translate("+i.radius+"px,0)",borderRadius:(i.corners*i.width>>1)+"px"})}for(var s,u=0,l=(i.lines-1)*(1-i.direction)/2;u<i.lines;u++)s=a(t(),{position:"absolute",top:1+~(i.width/2)+"px",transform:i.hwaccel?"translate3d(0,0,0)":"",opacity:i.opacity,animation:d&&o(i.opacity,i.trail,l+u*i.direction,i.lines)+" "+1/i.speed+"s linear infinite"}),i.shadow&&n(s,a(r("#000","0 0 4px #000"),{top:"2px"})),n(e,n(s,r(c(i.color,u),"0 0 1px rgba(0,0,0,.1)")));return e},opacity:function(t,e,n){e<t.childNodes.length&&(t.childNodes[e].style.opacity=n)}});var g=a(t("group"),{behavior:"url(#default#VML)"});return!r(g,"transform")&&g.adj?f():d=r(g,"animation"),l});var xe,be,_e,Ce,Te,ke,Me=o(t),Se=o(e),Fe="quirks"===n.hash.replace("#",""),Ee=de.csstransforms3d,Pe=Ee&&!Fe,je=Ee||"CSS1Compat"===e.compatMode,Ne=he.ok,$e=navigator.userAgent.match(/Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone/i),qe=!Pe||$e,Le="addEventListener",ze=navigator.msPointerEnabled,Ae="onwheel"in e.createElement("div")?"wheel":e.onmousewheel!==i?"mousewheel":"DOMMouseScroll",Oe=250,Ie=300,Re=1400,De=5e3,We=2,He=64,Ke=500,Be=333,Ve="$stageFrame",Xe="$navDotFrame",Qe="$navThumbFrame",Ue=r([.1,0,.25,1]),Ye=99999,Ge={width:null,minwidth:null,maxwidth:"100%",height:null,minheight:null,maxheight:null,ratio:null,margin:We,glimpse:0,nav:"dots",navposition:"bottom",navwidth:null,thumbwidth:He,thumbheight:He,thumbmargin:We,thumbborderwidth:We,allowfullscreen:!1,fit:"contain",transition:"slide",clicktransition:null,transitionduration:Ie,captions:!0,hash:!1,startindex:0,loop:!1,autoplay:!1,stopautoplayontouch:!0,keyboard:!1,arrows:!0,click:!0,swipe:!0,trackpad:!0,shuffle:!1,direction:"ltr",shadows:!0,spinner:null},Je={left:!0,right:!0,down:!1,up:!1,space:!1,home:!1,end:!1};jQuery.Fotorama=function(t,i){function r(){o.each(vn,function(t,e){if(!e.i){e.i=oo++;var n=k(e.video,!0);if(n){var o={};e.video=n,e.img||e.thumb?e.thumbsReady=!0:o=M(e,vn,Zn),S(vn,{img:o.img,thumb:o.thumb},e.i,Zn)}}})}function a(t){return Wn[t]||Zn.fullScreen}function u(t){var e="keydown."+et,n="keydown."+et+to,o="resize."+et+to;t?(Se.on(n,function(t){var e,n;xn&&27===t.keyCode?(e=!0,an(xn,!0,!0)):(Zn.fullScreen||i.keyboard&&!Zn.index)&&(27===t.keyCode?(e=!0,Zn.cancelFullScreen()):t.shiftKey&&32===t.keyCode&&a("space")||37===t.keyCode&&a("left")||38===t.keyCode&&a("up")?n="<":32===t.keyCode&&a("space")||39===t.keyCode&&a("right")||40===t.keyCode&&a("down")?n=">":36===t.keyCode&&a("home")?n="<<":35===t.keyCode&&a("end")&&(n=">>")),(e||n)&&K(t),n&&Zn.show({index:n,slow:t.altKey,user:!0})}),Zn.index||Se.off(e).on(e,"textarea, input, select",function(t){!be.hasClass(nt)&&t.stopPropagation()}),Me.on(o,Zn.resize)):(Se.off(n),Me.off(o))}function c(e){e!==c.f&&(e?(t.html("").addClass(et+" "+eo).append(so).before(ro).before(ao),Z(Zn)):(so.detach(),ro.detach(),ao.detach(),t.html(io.urtext).removeClass(eo),tt(Zn)),u(e),c.f=e)}function h(){vn=Zn.data=vn||R(i.data)||F(t),gn=Zn.size=vn.length,!pn.ok&&i.shuffle&&I(vn),r(),So=T(So),gn&&c(!0)}function w(){var t=2>gn||xn;Po.noMove=t||Ln,Po.noSwipe=t||!i.swipe,!In&&co.toggleClass(xt,!Po.noMove&&!Po.noSwipe),ze&&so.toggleClass(ft,!Po.noSwipe)}function y(t){t===!0&&(t=""),i.autoplay=Math.max(+t||De,1.5*On)}function _(){function t(t,n){e[t?"add":"remove"].push(n)}Zn.options=i=W(i),Ln="crossfade"===i.transition||"dissolve"===i.transition,En=i.loop&&(gn>2||Ln)&&(!In||"slide"!==In),On=+i.transitionduration||Ie,Dn="rtl"===i.direction,Wn=o.extend({},i.keyboard&&Je,i.keyboard);var e={add:[],remove:[]};gn>1?(Pn=i.nav,Nn="top"===i.navposition,e.remove.push(Wt),mo.toggle(!!i.arrows)):(Pn=!1,mo.hide()),ie(),yn=new ge(o.extend(we,i.spinner,ye,{direction:Dn?-1:1})),Te(),ke(),i.autoplay&&y(i.autoplay),zn=d(i.thumbwidth)||He,An=d(i.thumbheight)||He,jo.ok=$o.ok=i.trackpad&&!qe,w(),Ue(i,[Eo]),jn="thumbs"===Pn,jn?(fe(gn,"navThumb"),wn=yo,Jn=Qe,q(ro,o.Fotorama.jst.style({w:zn,h:An,b:i.thumbborderwidth,m:i.thumbmargin,s:to,q:!je})),vo.addClass(Pt).removeClass(Et)):"dots"===Pn?(fe(gn,"navDot"),wn=wo,Jn=Xe,vo.addClass(Et).removeClass(Pt)):(Pn=!1,vo.removeClass(Pt+" "+Et)),Pn&&(Nn?po.insertBefore(uo):po.insertAfter(uo),ve.nav=!1,ve(wn,go,"nav")),$n=i.allowfullscreen,$n?(bo.appendTo(uo),qn=Ne&&"native"===$n):(bo.detach(),qn=!1),t(Ln,st),t(!Ln,ut),t(!i.captions,mt),t(Dn,dt),t("always"!==i.arrows,pt),Rn=i.shadows&&!qe,t(!Rn,lt),so.addClass(e.add.join(" ")).removeClass(e.remove.join(" ")),Fo=o.extend({},i)}function C(t){return 0>t?(gn+t%gn)%gn:t>=gn?t%gn:t}function T(t){return s(t,0,gn-1)}function E(t){return En?C(t):T(t)}function Q(t){return t>0||En?t-1:!1}function U(t){return gn-1>t||En?t+1:!1}function J(){Po.min=En?-1/0:-v(gn-1,Eo.w,i.margin,Cn),Po.max=En?1/0:-v(0,Eo.w,i.margin,Cn),Po.snap=Eo.w+i.margin}function qt(){No.min=Math.min(0,Eo.nw-go.width()),No.max=0,go.toggleClass(xt,!(No.noMove=No.min===No.max))}function Lt(t,e,n){if("number"==typeof t){t=new Array(t);var i=!0}return o.each(t,function(t,o){if(i&&(o=t),"number"==typeof o){var r=vn[C(o)];if(r){var a="$"+e+"Frame",s=r[a];n.call(this,t,o,r,s,a,s&&s.data())}}})}function zt(t,e,n,o){(!Hn||"*"===Hn&&o===Fn)&&(t=p(i.width)||p(t)||Ke,e=p(i.height)||p(e)||Be,Zn.resize({width:t,ratio:i.ratio||n||t/e},0,o===Fn?!0:"*"))}function At(t,e,n,r,a){Lt(t,e,function(t,s,u,c,l,f){function d(t){var e=C(s);Ge(t,{index:e,src:b,frame:vn[e]})}function h(){w.remove(),o.Fotorama.cache[b]="error",u.html&&"stage"===e||!_||_===b?(!b||u.html||v?"stage"===e&&(c.trigger("f:load").removeClass(Xt+" "+Vt).addClass(Qt),d("load"),zt()):(c.trigger("f:error").removeClass(Xt).addClass(Vt),d("error")),f.state="error",!(gn>1&&vn[s]===u)||u.html||u.deleted||u.video||v||(u.deleted=!0,Zn.splice(s,1))):(u[x]=b=_,At([s],e,n,r,!0))}function m(){o.Fotorama.measures[b]=y.measures=o.Fotorama.measures[b]||{width:g.width,height:g.height,ratio:g.width/g.height},zt(y.measures.width,y.measures.height,y.measures.ratio,s),w.off("load error").addClass(Jt+(v?" "+Zt:"")).prependTo(c),$(w,n||Eo,r||u.fit||i.fit),o.Fotorama.cache[b]=f.state="loaded",setTimeout(function(){c.trigger("f:load").removeClass(Xt+" "+Vt).addClass(Qt+" "+(v?Ut:Yt)),"stage"===e&&d("load")},5)}function p(){var t=10;j(function(){return!Yn||!t--&&!qe},function(){m()})}if(c){var v=Zn.fullScreen&&u.full&&u.full!==u.img&&!f.$full&&"stage"===e;if(!f.$img||a||v){var g=new Image,w=o(g),y=w.data();f[v?"$full":"$img"]=w;var x="stage"===e?v?"full":"img":"thumb",b=u[x],_=v?null:u["stage"===e?"thumb":"img"];if("navThumb"===e&&(c=f.$wrap),!b)return void h();o.Fotorama.cache[b]?!function T(){"error"===o.Fotorama.cache[b]?h():"loaded"===o.Fotorama.cache[b]?setTimeout(p,0):setTimeout(T,100)}():(o.Fotorama.cache[b]="*",w.on("load",p).on("error",h)),f.state="",g.src=b}}})}function Gt(t){Mo.append(yn.spin().el).appendTo(t)}function ie(){Mo.detach(),yn&&yn.stop()}function le(){var t=Zn.activeFrame[Ve];t&&!t.data().state&&(Gt(t),t.on("f:load f:error",function(){t.off("f:load f:error"),ie()}))}function fe(t,e){Lt(t,e,function(t,n,r,a,s,u){a||(a=r[s]=so[s].clone(),u=a.data(),u.data=r,"stage"===e?(r.html&&o('<div class="'+oe+'"></div>').append(r._html?o(r.html).removeAttr("id").html(r._html):r.html).appendTo(a),i.captions&&r.caption&&o(O(se,O(ue,r.caption))).appendTo(a),r.video&&a.addClass(wt).append(Co.clone()),lo=lo.add(a)):"navDot"===e?wo=wo.add(a):"navThumb"===e&&(u.$wrap=a.children(":first"),yo=yo.add(a),r.video&&a.append(Co.clone())))})}function de(t,e,n){return t&&t.length&&$(t,e,n)}function me(t){Lt(t,"stage",function(t,e,n,r,a,s){if(r){Lo[Ve][C(e)]=r.css(o.extend({left:Ln?0:v(e,Eo.w,i.margin,Cn)},Ln&&f(0))),P(r[0])&&(r.appendTo(co),an(n.$video));var u=n.fit||i.fit;de(s.$img,Eo,u),de(s.$full,Eo,u)}})}function pe(t,e){if("thumbs"===Pn&&!isNaN(t)){var n=-t,i=-t+Eo.nw;yo.each(function(){var t=o(this),r=t.data(),a=r.eq,s={h:An},u="cover";s.w=r.w,r.l+r.w<n||r.l>i||de(r.$img,s,u)||e&&At([a],"navThumb",s,u)})}}function ve(t,e,n){if(!ve[n]){var r="nav"===n&&jn,a=0;e.append(t.filter(function(){for(var t,e=o(this),n=e.data(),i=0,r=vn.length;r>i;i++)if(n.data===vn[i]){t=!0,n.eq=i;break}return t||e.remove()&&!1}).sort(function(t,e){return o(t).data().eq-o(e).data().eq}).each(function(){if(r){var t=o(this),e=t.data(),n=Math.round(An*e.data.thumbratio)||zn;e.l=a,e.w=n,t.css({width:n}),a+=n+i.thumbmargin}})),ve[n]=!0}}function _e(t){return t-zo>Eo.w/3}function Ce(t){return!(En||So+t&&So-gn+t||xn)}function Te(){fo.toggleClass(Ct,Ce(0)),ho.toggleClass(Ct,Ce(1))}function ke(){jo.ok&&(jo.prevent={"<":Ce(0),">":Ce(1)})}function Fe(t){var e,n,o=t.data();return jn?(e=o.l,n=o.w):(e=t.position().left,n=t.width()),{c:e+n/2,min:-e+10*i.thumbmargin,max:-e+Eo.w-n-10*i.thumbmargin}}function Ee(t){var e=Zn.activeFrame[Jn].data();V(xo,{time:.9*t,pos:e.l,width:e.w-2*i.thumbborderwidth})}function $e(t){var e=vn[t.guessIndex][Jn];if(e){var n=No.min!==No.max,o=n&&Fe(Zn.activeFrame[Jn]),i=n&&(t.keep&&$e.l?$e.l:s((t.coo||Eo.nw/2)-Fe(e).c,o.min,o.max)),r=n&&s(i,No.min,No.max),a=.9*t.time;V(go,{time:a,pos:r||0,onEnd:function(){pe(r,!0)}}),rn(vo,L(r,No.min,No.max)),$e.l=i}}function Le(){Ae(Jn),qo[Jn].push(Zn.activeFrame[Jn].addClass(Dt))}function Ae(t){for(var e=qo[t];e.length;)e.shift().removeClass(Dt)}function Re(t){var e=Lo[t];o.each(_n,function(t,n){delete e[C(n)]}),o.each(e,function(t,n){delete e[t],n.detach()})}function We(t){Cn=Tn=So;var e=Zn.activeFrame,n=e[Ve];n&&(Ae(Ve),qo[Ve].push(n.addClass(Dt)),t||Zn.show.onEnd(!0),x(co,0,!0),Re(Ve),me(_n),J(),qt())}function Ue(t,e){t&&o.each(e,function(e,n){n&&o.extend(n,{width:t.width||n.width,height:t.height,minwidth:t.minwidth,maxwidth:t.maxwidth,minheight:t.minheight,maxheight:t.maxheight,ratio:H(t.ratio)})})}function Ge(e,n){t.trigger(et+":"+e,[Zn,n])}function Ze(){clearTimeout(tn.t),Yn=1,i.stopautoplayontouch?Zn.stopAutoplay():Xn=!0}function tn(){i.stopautoplayontouch||(en(),nn()),tn.t=setTimeout(function(){Yn=0},Ie+Oe)}function en(){Xn=!(!xn&&!Qn)}function nn(){if(clearTimeout(nn.t),!i.autoplay||Xn)return void(Zn.autoplay&&(Zn.autoplay=!1,Ge("stopautoplay")));Zn.autoplay||(Zn.autoplay=!0,Ge("startautoplay"));var t=So,e=Zn.activeFrame[Ve].data();j(function(){return e.state||t!==So},function(){nn.t=setTimeout(function(){Xn||t!==So||Zn.show(En?B(!Dn):C(So+(Dn?-1:1)))},i.autoplay)})}function on(){Zn.fullScreen&&(Zn.fullScreen=!1,Ne&&he.cancel(no),be.removeClass(nt),xe.removeClass(nt),t.removeClass(Kt).insertAfter(ao),Eo=o.extend({},Un),an(xn,!0,!0),fn("x",!1),Zn.resize(),At(_n,"stage"),D(Bn,Kn),Ge("fullscreenexit"))}function rn(t,e){Rn&&(t.removeClass(It+" "+Rt),e&&!xn&&t.addClass(e.replace(/^|\s/g," "+Ot+"--")))}function an(t,e,n){e&&(so.removeClass(at),xn=!1,w()),t&&t!==xn&&(t.remove(),Ge("unloadvideo")),n&&(en(),nn())}function sn(t){so.toggleClass(ct,t)}function un(t){if(!Po.flow){var e=t?t.pageX:un.x,n=e&&!Ce(_e(e))&&i.click;un.p===n||!Ln&&i.swipe||!uo.toggleClass(bt,n)||(un.p=n,un.x=e)}}function cn(t){clearTimeout(cn.t),i.clicktransition&&i.clicktransition!==i.transition?(In=i.transition,Zn.setOptions({transition:i.clicktransition}),cn.t=setTimeout(function(){Zn.show(t)},10)):Zn.show(t)}function ln(t,e){var n=t.target,r=o(n);r.hasClass(re)?Zn.playVideo():n===_o?Zn[(Zn.fullScreen?"cancel":"request")+"FullScreen"]():xn?n===ko&&an(xn,!0,!0):e?sn():i.click&&cn({index:t.shiftKey||B(_e(t._x)),slow:t.altKey,user:!0})}function fn(t,e){Po[t]=No[t]=e}function dn(t,e){var n=o(this).data().eq;cn({index:n,slow:t.altKey,user:!0,coo:t._x-vo.offset().left,time:e})}function hn(){if(h(),_(),!hn.i){hn.i=!0;var t=i.startindex;(t||i.hash&&n.hash)&&(Fn=z(t||n.hash.replace(/^#/,""),vn,0===Zn.index||t,t)),So=Cn=Tn=kn=Fn=E(Fn)||0}if(gn){if(mn())return;xn&&an(xn,!0),_n=[],Re(Ve),Zn.show({index:So,time:0,reset:hn.ok}),Zn.resize()}else Zn.destroy();hn.ok=!0}function mn(){return!mn.f===Dn?(mn.f=Dn,So=gn-1-So,Zn.reverse(),!0):void 0}function pn(){pn.ok||(pn.ok=!0,Ge("ready"))}xe=xe||o("html"),be=be||o("body");var vn,gn,wn,yn,xn,bn,_n,Cn,Tn,kn,Mn,Sn,Fn,En,Pn,jn,Nn,$n,qn,Ln,zn,An,On,In,Rn,Dn,Wn,Hn,Kn,Bn,Vn,Xn,Qn,Un,Yn,Gn,Jn,Zn=this,to=o.now(),eo=et+to,no=t[0],oo=1,io=t.data(),ro=o("<style></style>"),ao=o(O(Ht)),so=o(O(ot)),uo=o(O(vt)).appendTo(so),co=(uo[0],o(O(yt)).appendTo(uo)),lo=o(),fo=o(O(_t+" "+Tt)),ho=o(O(_t+" "+kt)),mo=fo.add(ho).appendTo(uo),po=o(O(St)),vo=o(O(Mt)).appendTo(po),go=o(O(Ft)).appendTo(vo),wo=o(),yo=o(),xo=(co.data(),go.data(),o(O(ne)).appendTo(go)),bo=o(O(Bt)),_o=bo[0],Co=o(O(re)),To=o(O(ae)).appendTo(uo),ko=To[0],Mo=o(O(ce)),So=!1,Fo={},Eo={},Po={},jo={},No={},$o={},qo={},Lo={},zo=0,Ao=[];so[Ve]=o(O(gt)),so[Qe]=o(O(jt+" "+$t,O(ee))),so[Xe]=o(O(jt+" "+Nt,O(te))),qo[Ve]=[],qo[Qe]=[],qo[Xe]=[],Lo[Ve]={},so.addClass(Pe?rt:it),io.fotorama=this,Zn.startAutoplay=function(t){return Zn.autoplay?this:(Xn=Qn=!1,y(t||i.autoplay),nn(),this)},Zn.stopAutoplay=function(){return Zn.autoplay&&(Xn=Qn=!0,nn()),this},Zn.show=function(t){var e;"object"!=typeof t?(e=t,t={}):e=t.index,e=">"===e?Tn+1:"<"===e?Tn-1:"<<"===e?0:">>"===e?gn-1:e,e=isNaN(e)?z(e,vn,!0):e,e="undefined"==typeof e?So||0:e,Zn.activeIndex=So=E(e),Mn=Q(So),Sn=U(So),_n=[So,Mn,Sn],Tn=En?e:So;var n=Math.abs(kn-Tn),o=b(t.time,function(){return Math.min(On*(1+(n-1)/12),2*On)}),r=t.overPos;t.slow&&(o*=10),Zn.activeFrame=bn=vn[So],an(xn,bn.i!==vn[C(Cn)].i),fe(_n,"stage"),me(qe?[Tn]:[Tn,Q(Tn),U(Tn)]),fn("go",!0),t.reset||Ge("show",{user:t.user,time:o}),Xn=!0;var a=Zn.show.onEnd=function(e){if(!a.ok){if(a.ok=!0,e||We(!0),!t.reset&&(Ge("showend",{user:t.user}),!e&&In&&In!==i.transition))return Zn.setOptions({transition:In}),void(In=!1);le(),At(_n,"stage"),fn("go",!1),ke(),un(),en(),nn()}};if(Ln){var u=bn[Ve],c=So!==kn?vn[kn][Ve]:null;X(u,c,lo,{ time:o,method:i.transition,onEnd:a},Ao)}else V(co,{pos:-v(Tn,Eo.w,i.margin,Cn),overPos:r,time:o,onEnd:a,_001:!0});if(Te(),Pn){Le();var l=T(So+s(Tn-kn,-1,1));$e({time:o,coo:l!==So&&t.coo,guessIndex:"undefined"!=typeof t.coo?l:So,keep:t.reset}),jn&&Ee(o)}return Vn="undefined"!=typeof kn&&kn!==So,kn=So,i.hash&&Vn&&!Zn.eq&&N(bn.id||So+1),this},Zn.requestFullScreen=function(){return $n&&!Zn.fullScreen&&(Kn=Me.scrollTop(),Bn=Me.scrollLeft(),D(0,0),fn("x",!0),Un=o.extend({},Eo),t.addClass(Kt).appendTo(be.addClass(nt)),xe.addClass(nt),an(xn,!0,!0),Zn.fullScreen=!0,qn&&he.request(no),Zn.resize(),At(_n,"stage"),le(),Ge("fullscreenenter")),this},Zn.cancelFullScreen=function(){return qn&&he.is()?he.cancel(e):on(),this},e.addEventListener&&e.addEventListener(he.event,function(){!vn||he.is()||xn||on()},!1),Zn.resize=function(t){if(!vn)return this;Ue(Zn.fullScreen?{width:"100%",maxwidth:null,minwidth:null,height:"100%",maxheight:null,minheight:null}:W(t),[Eo,Zn.fullScreen||i]);var e=arguments[1]||0,n=arguments[2],o=Eo.width,r=Eo.height,a=Eo.ratio,u=Me.height()-(Pn?vo.height():0);return p(o)&&(so.addClass(ht).css({width:o,minWidth:Eo.minwidth||0,maxWidth:Eo.maxwidth||Ye}),o=Eo.W=Eo.w=so.width(),Eo.nw=Pn&&m(i.navwidth,o)||o,i.glimpse&&(Eo.w-=Math.round(2*(m(i.glimpse,o)||0))),co.css({width:Eo.w,marginLeft:(Eo.W-Eo.w)/2}),r=m(r,u),r=r||a&&o/a,r&&(o=Math.round(o),r=Eo.h=Math.round(s(r,m(Eo.minheight,u),m(Eo.maxheight,u))),uo.stop().animate({width:o,height:r},e,function(){so.removeClass(ht)}),We(),Pn&&(vo.stop().animate({width:Eo.nw},e),$e({guessIndex:So,time:e,keep:!0}),jn&&ve.nav&&Ee(e)),Hn=n||!0,pn())),zo=uo.offset().left,this},Zn.setOptions=function(t){return o.extend(i,t),hn(),this},Zn.shuffle=function(){return vn&&I(vn)&&hn(),this},Zn.destroy=function(){return Zn.cancelFullScreen(),Zn.stopAutoplay(),vn=Zn.data=null,c(),_n=[],Re(Ve),this},Zn.playVideo=function(){var t=Zn.activeFrame,e=t.video,n=So;return"object"==typeof e&&t.videoReady&&(qn&&Zn.fullScreen&&Zn.cancelFullScreen(),j(function(){return!he.is()||n!==So},function(){n===So&&(t.$video=t.$video||o(o.Fotorama.jst.video(e)),t.$video.appendTo(t[Ve]),so.addClass(at),xn=t.$video,w(),Ge("loadvideo"))})),this},Zn.stopVideo=function(){return an(xn,!0,!0),this},uo.on("mousemove",un),Po=Y(co,{onStart:Ze,onMove:function(t,e){rn(uo,e.edge)},onTouchEnd:tn,onEnd:function(t){rn(uo);var e=(ze&&!Gn||t.touch)&&i.arrows&&"always"!==i.arrows;if(t.moved||e&&t.pos!==t.newPos&&!t.control){var n=g(t.newPos,Eo.w,i.margin,Cn);Zn.show({index:n,time:Ln?On:t.time,overPos:t.overPos,user:!0})}else t.aborted||t.control||ln(t.startEvent,e)},_001:!0,timeLow:1,timeHigh:1,friction:2,select:"."+Wt+", ."+Wt+" *",$wrap:uo}),No=Y(go,{onStart:Ze,onMove:function(t,e){rn(vo,e.edge)},onTouchEnd:tn,onEnd:function(t){function e(){$e.l=t.newPos,en(),nn(),pe(t.newPos,!0)}if(t.moved)t.pos!==t.newPos?(Xn=!0,V(go,{time:t.time,pos:t.newPos,overPos:t.overPos,onEnd:e}),pe(t.newPos),Rn&&rn(vo,L(t.newPos,No.min,No.max))):e();else{var n=t.$target.closest("."+jt,go)[0];n&&dn.call(n,t.startEvent)}},timeLow:.5,timeHigh:2,friction:5,$wrap:vo}),jo=G(uo,{shift:!0,onEnd:function(t,e){Ze(),tn(),Zn.show({index:e,slow:t.altKey})}}),$o=G(vo,{onEnd:function(t,e){Ze(),tn();var n=x(go)+.25*e;go.css(l(s(n,No.min,No.max))),Rn&&rn(vo,L(n,No.min,No.max)),$o.prevent={"<":n>=No.max,">":n<=No.min},clearTimeout($o.t),$o.t=setTimeout(function(){pe(n,!0)},Oe),pe(n)}}),so.hover(function(){setTimeout(function(){Yn||(Gn=!0,sn(!Gn))},0)},function(){Gn&&(Gn=!1,sn(!Gn))}),A(mo,function(t){K(t),cn({index:mo.index(this)?">":"<",slow:t.altKey,user:!0})},{onStart:function(){Ze(),Po.control=!0},onTouchEnd:tn}),o.each("load push pop shift unshift reverse sort splice".split(" "),function(t,e){Zn[e]=function(){return vn=vn||[],"load"!==e?Array.prototype[e].apply(vn,arguments):arguments[0]&&"object"==typeof arguments[0]&&arguments[0].length&&(vn=R(arguments[0])),hn(),Zn}}),hn()},o.fn.fotorama=function(e){return this.each(function(){var n=this,i=o(this),r=i.data(),a=r.fotorama;a?a.setOptions(e):j(function(){return!E(n)},function(){r.urtext=i.html(),new o.Fotorama(i,o.extend({},Ge,t.fotoramaDefaults,e,r))})})},o.Fotorama.instances=[],o.Fotorama.cache={},o.Fotorama.measures={},o=o||{},o.Fotorama=o.Fotorama||{},o.Fotorama.jst=o.Fotorama.jst||{},o.Fotorama.jst.style=function(t){var e,n="";return fe.escape,n+=".fotorama"+(null==(e=t.s)?"":e)+" .fotorama__nav--thumbs .fotorama__nav__frame{\npadding:"+(null==(e=t.m)?"":e)+"px;\nheight:"+(null==(e=t.h)?"":e)+"px}\n.fotorama"+(null==(e=t.s)?"":e)+" .fotorama__thumb-border{\nheight:"+(null==(e=t.h-t.b*(t.q?0:2))?"":e)+"px;\nborder-width:"+(null==(e=t.b)?"":e)+"px;\nmargin-top:"+(null==(e=t.m)?"":e)+"px}"},o.Fotorama.jst.video=function(t){function e(){n+=o.call(arguments,"")}var n="",o=(fe.escape,Array.prototype.join);return n+='<div class="fotorama__video"><iframe src="',e(("youtube"==t.type?"http://youtube.com/embed/"+t.id+"?autoplay=1":"vimeo"==t.type?"http://player.vimeo.com/video/"+t.id+"?autoplay=1&badge=0":t.id)+(t.s&&"custom"!=t.type?"&"+t.s:"")),n+='" frameborder="0" allowfullscreen></iframe></div>'},o(function(){o("."+et+':not([data-auto="false"])').fotorama()})}(window,document,location,"undefined"!=typeof jQuery&&jQuery);;!function(t,n){function e(t){return"object"==typeof t}function o(t){return"string"==typeof t}function i(t){return"number"==typeof t}function a(t){return t===n}function r(){q=google.maps,A||(A={verbose:!1,queryLimit:{attempt:5,delay:250,random:250},classes:function(){var n={};return t.each("Map Marker InfoWindow Circle Rectangle OverlayView StreetViewPanorama KmlLayer TrafficLayer BicyclingLayer GroundOverlay StyledMapType ImageMapType".split(" "),function(t,e){n[e]=q[e]}),n}(),map:{mapTypeId:q.MapTypeId.ROADMAP,center:[46.578498,2.457275],zoom:2},overlay:{pane:"floatPane",content:"",offset:{x:0,y:0}},geoloc:{getCurrentPosition:{maximumAge:6e4,timeout:5e3}}})}function s(t,n){return a(t)?"gmap3_"+(n?Z+1:++Z):t}function u(t){var n,e=q.version.split(".");for(t=t.split("."),n=0;n<e.length;n++)e[n]=parseInt(e[n],10);for(n=0;n<t.length;n++){if(t[n]=parseInt(t[n],10),!e.hasOwnProperty(n))return!1;if(e[n]<t[n])return!1}return!0}function l(n,e,o,i,a){function r(e,i){e&&t.each(e,function(t,e){var r=n,s=e;R(e)&&(r=e[0],s=e[1]),i(o,t,function(t){s.apply(r,[a||o,t,u])})})}var s=e.td||{},u={id:i,data:s.data,tag:s.tag};r(s.events,q.event.addListener),r(s.onces,q.event.addListenerOnce)}function d(t){var n,e=[];for(n in t)t.hasOwnProperty(n)&&e.push(n);return e}function c(t,n){var e,o=arguments;for(e=2;e<o.length;e++)if(n in o[e]&&o[e].hasOwnProperty(n))return void(t[n]=o[e][n])}function p(n,e){var o,i,a=["data","tag","id","events","onces"],r={};if(n.td)for(o in n.td)n.td.hasOwnProperty(o)&&"options"!==o&&"values"!==o&&(r[o]=n.td[o]);for(i=0;i<a.length;i++)c(r,a[i],e,n.td);return r.options=t.extend({},n.opts||{},e.options||{}),r}function f(){if(A.verbose){var t,n=[];if(window.console&&z(console.error)){for(t=0;t<arguments.length;t++)n.push(arguments[t]);console.error.apply(console,n)}else{for(n="",t=0;t<arguments.length;t++)n+=arguments[t].toString()+" ";alert(n)}}}function g(t){return(i(t)||o(t))&&""!==t&&!isNaN(t)}function h(t){var n,o=[];if(!a(t))if(e(t))if(i(t.length))o=t;else for(n in t)o.push(t[n]);else o.push(t);return o}function v(n){return n?z(n)?n:(n=h(n),function(o){var i;if(a(o))return!1;if(e(o)){for(i=0;i<o.length;i++)if(t.inArray(o[i],n)>=0)return!0;return!1}return t.inArray(o,n)>=0}):void 0}function m(t,n,e){var i=n?t:null;return!t||o(t)?i:t.latLng?m(t.latLng):t instanceof q.LatLng?t:g(t.lat)?new q.LatLng(t.lat,t.lng):!e&&R(t)&&g(t[0])&&g(t[1])?new q.LatLng(t[0],t[1]):i}function y(t){var n,e;return!t||t instanceof q.LatLngBounds?t||null:(R(t)?2===t.length?(n=m(t[0]),e=m(t[1])):4===t.length&&(n=m([t[0],t[1]]),e=m([t[2],t[3]])):"ne"in t&&"sw"in t?(n=m(t.ne),e=m(t.sw)):"n"in t&&"e"in t&&"s"in t&&"w"in t&&(n=m([t.n,t.e]),e=m([t.s,t.w])),n&&e?new q.LatLngBounds(e,n):null)}function w(t,n,e,i,a){var r=e?m(i.td,!1,!0):!1,s=r?{latLng:r}:i.td.address?o(i.td.address)?{address:i.td.address}:i.td.address:!1,u=s?G.get(s):!1,l=this;s?(a=a||0,u?(i.latLng=u.results[0].geometry.location,i.results=u.results,i.status=u.status,n.apply(t,[i])):(s.location&&(s.location=m(s.location)),s.bounds&&(s.bounds=y(s.bounds)),M().geocode(s,function(o,r){r===q.GeocoderStatus.OK?(G.store(s,{results:o,status:r}),i.latLng=o[0].geometry.location,i.results=o,i.status=r,n.apply(t,[i])):r===q.GeocoderStatus.OVER_QUERY_LIMIT&&a<A.queryLimit.attempt?setTimeout(function(){w.apply(l,[t,n,e,i,a+1])},A.queryLimit.delay+Math.floor(Math.random()*A.queryLimit.random)):(f("geocode failed",r,s),i.latLng=i.results=!1,i.status=r,n.apply(t,[i]))}))):(i.latLng=m(i.td,!1,!0),n.apply(t,[i]))}function L(n,e,o,i){function a(){do s++;while(s<n.length&&!("address"in n[s]));return s>=n.length?void o.apply(e,[i]):void w(r,function(e){delete e.td,t.extend(n[s],e),a.apply(r,[])},!0,{td:n[s]})}var r=this,s=-1;a()}function b(t,n,e){var o=!1;navigator&&navigator.geolocation?navigator.geolocation.getCurrentPosition(function(i){o||(o=!0,e.latLng=new q.LatLng(i.coords.latitude,i.coords.longitude),n.apply(t,[e]))},function(){o||(o=!0,e.latLng=!1,n.apply(t,[e]))},e.opts.getCurrentPosition):(e.latLng=!1,n.apply(t,[e]))}function x(t){var n,o=!1;if(e(t)&&t.hasOwnProperty("get")){for(n in t)if("get"!==n)return!1;o=!t.get.hasOwnProperty("callback")}return o}function M(){return V.geocoder||(V.geocoder=new q.Geocoder),V.geocoder}function I(){var t=[];this.get=function(n){if(t.length){var o,i,a,r,s,u=d(n);for(o=0;o<t.length;o++){for(r=t[o],s=u.length===r.keys.length,i=0;i<u.length&&s;i++)a=u[i],s=a in r.request,s&&(s=e(n[a])&&"equals"in n[a]&&z(n[a])?n[a].equals(r.request[a]):n[a]===r.request[a]);if(s)return r.results}}},this.store=function(n,e){t.push({request:n,keys:d(n),results:e})}}function P(){var t=[],n=this;n.empty=function(){return!t.length},n.add=function(n){t.push(n)},n.get=function(){return t.length?t[0]:!1},n.ack=function(){t.shift()}}function k(){function n(t){return{id:t.id,name:t.name,object:t.obj,tag:t.tag,data:t.data}}function e(t){z(t.setMap)&&t.setMap(null),z(t.remove)&&t.remove(),z(t.free)&&t.free(),t=null}var o={},i={},r=this;r.add=function(t,n,e,a){var u=t.td||{},l=s(u.id);return o[n]||(o[n]=[]),l in i&&r.clearById(l),i[l]={obj:e,sub:a,name:n,id:l,tag:u.tag,data:u.data},o[n].push(l),l},r.getById=function(t,e,o){var a=!1;return t in i&&(a=e?i[t].sub:o?n(i[t]):i[t].obj),a},r.get=function(t,e,a,r){var s,u,l=v(a);if(!o[t]||!o[t].length)return null;for(s=o[t].length;s;)if(s--,u=o[t][e?s:o[t].length-s-1],u&&i[u]){if(l&&!l(i[u].tag))continue;return r?n(i[u]):i[u].obj}return null},r.all=function(t,e,r){var s=[],u=v(e),l=function(t){var e,a;for(e=0;e<o[t].length;e++)if(a=o[t][e],a&&i[a]){if(u&&!u(i[a].tag))continue;s.push(r?n(i[a]):i[a].obj)}};if(t in o)l(t);else if(a(t))for(t in o)l(t);return s},r.rm=function(t,n,e){var a,s;if(!o[t])return!1;if(n)if(e)for(a=o[t].length-1;a>=0&&(s=o[t][a],!n(i[s].tag));a--);else for(a=0;a<o[t].length&&(s=o[t][a],!n(i[s].tag));a++);else a=e?o[t].length-1:0;return a in o[t]?r.clearById(o[t][a],a):!1},r.clearById=function(t,n){if(t in i){var r,s=i[t].name;for(r=0;a(n)&&r<o[s].length;r++)t===o[s][r]&&(n=r);return e(i[t].obj),i[t].sub&&e(i[t].sub),delete i[t],o[s].splice(n,1),!0}return!1},r.objGetById=function(t){var n,e;if(o.clusterer)for(e in o.clusterer)if((n=i[o.clusterer[e]].obj.getById(t))!==!1)return n;return!1},r.objClearById=function(t){var n;if(o.clusterer)for(n in o.clusterer)if(i[o.clusterer[n]].obj.clearById(t))return!0;return null},r.clear=function(t,n,e,i){var a,s,u,l=v(i);if(t&&t.length)t=h(t);else{t=[];for(a in o)t.push(a)}for(s=0;s<t.length;s++)if(u=t[s],n)r.rm(u,l,!0);else if(e)r.rm(u,l,!1);else for(;r.rm(u,l,!1););},r.objClear=function(n,e,a,r){var s;if(o.clusterer&&(t.inArray("marker",n)>=0||!n.length))for(s in o.clusterer)i[o.clusterer[s]].obj.clear(e,a,r)}}function B(n,e,i){function a(t){var n={};return n[t]={},n}function r(){var t;for(t in i)if(i.hasOwnProperty(t)&&!u.hasOwnProperty(t))return t}var s,u={},l=this,d={latLng:{map:!1,marker:!1,infowindow:!1,circle:!1,overlay:!1,getlatlng:!1,getmaxzoom:!1,getelevation:!1,streetviewpanorama:!1,getaddress:!0},geoloc:{getgeoloc:!0}};o(i)&&(i=a(i)),l.run=function(){for(var o,a;o=r();){if(z(n[o]))return s=o,a=t.extend(!0,{},A[o]||{},i[o].options||{}),void(o in d.latLng?i[o].values?L(i[o].values,n,n[o],{td:i[o],opts:a,session:u}):w(n,n[o],d.latLng[o],{td:i[o],opts:a,session:u}):o in d.geoloc?b(n,n[o],{td:i[o],opts:a,session:u}):n[o].apply(n,[{td:i[o],opts:a,session:u}]));u[o]=null}e.apply(n,[i,u])},l.ack=function(t){u[s]=t,l.run.apply(l,[])}}function j(){return V.ds||(V.ds=new q.DirectionsService),V.ds}function O(){return V.dms||(V.dms=new q.DistanceMatrixService),V.dms}function C(){return V.mzs||(V.mzs=new q.MaxZoomService),V.mzs}function E(){return V.es||(V.es=new q.ElevationService),V.es}function S(t){function n(){var t=this;return t.onAdd=function(){},t.onRemove=function(){},t.draw=function(){},A.classes.OverlayView.apply(t,[])}n.prototype=A.classes.OverlayView.prototype;var e=new n;return e.setMap(t),e}function T(n,o,i){function a(t){T[t]||(delete _[t].options.map,T[t]=new A.classes.Marker(_[t].options),l(n,{td:_[t]},T[t],_[t].id))}function r(){return(y=U.getProjection())?(P=!0,j.push(q.event.addListener(o,"zoom_changed",f)),j.push(q.event.addListener(o,"bounds_changed",f)),void h()):void setTimeout(function(){r.apply(B,[])},25)}function u(t){e(O[t])?(z(O[t].obj.setMap)&&O[t].obj.setMap(null),z(O[t].obj.remove)&&O[t].obj.remove(),z(O[t].shadow.remove)&&O[t].obj.remove(),z(O[t].shadow.setMap)&&O[t].shadow.setMap(null),delete O[t].obj,delete O[t].shadow):T[t]&&T[t].setMap(null),delete O[t]}function d(){var t,n,e,o,i,a,r,s,u=Math.cos,l=Math.sin,d=arguments;return d[0]instanceof q.LatLng?(t=d[0].lat(),e=d[0].lng(),d[1]instanceof q.LatLng?(n=d[1].lat(),o=d[1].lng()):(n=d[1],o=d[2])):(t=d[0],e=d[1],d[2]instanceof q.LatLng?(n=d[2].lat(),o=d[2].lng()):(n=d[2],o=d[3])),i=Math.PI*t/180,a=Math.PI*e/180,r=Math.PI*n/180,s=Math.PI*o/180,6371e3*Math.acos(Math.min(u(i)*u(r)*u(a)*u(s)+u(i)*l(a)*u(r)*l(s)+l(i)*l(r),1))}function c(){var t=d(o.getCenter(),o.getBounds().getNorthEast()),n=new q.Circle({center:o.getCenter(),radius:1.25*t});return n.getBounds()}function p(){var t,n={};for(t in O)n[t]=!0;return n}function f(){clearTimeout(m),m=setTimeout(h,25)}function g(t){var n=y.fromLatLngToDivPixel(t),e=y.fromDivPixelToLatLng(new q.Point(n.x+i.radius,n.y-i.radius)),o=y.fromDivPixelToLatLng(new q.Point(n.x-i.radius,n.y+i.radius));return new q.LatLngBounds(o,e)}function h(){if(!x&&!I&&P){var n,e,a,r,s,l,d,f,h,v,m,y=!1,b=[],B={},j=o.getZoom(),C="maxZoom"in i&&j>i.maxZoom,E=p();for(M=!1,j>3&&(s=c(),y=s.getSouthWest().lng()<s.getNorthEast().lng()),n=0;n<_.length;n++)!_[n]||y&&!s.contains(_[n].options.position)||w&&!w(D[n])||b.push(n);for(;;){for(n=0;B[n]&&n<b.length;)n++;if(n===b.length)break;if(r=[],k&&!C){m=10;do for(f=r,r=[],m--,d=f.length?s.getCenter():_[b[n]].options.position,s=g(d),e=n;e<b.length;e++)B[e]||s.contains(_[b[e]].options.position)&&r.push(e);while(f.length<r.length&&r.length>1&&m)}else for(e=n;e<b.length;e++)if(!B[e]){r.push(e);break}for(l={indexes:[],ref:[]},h=v=0,a=0;a<r.length;a++)B[r[a]]=!0,l.indexes.push(b[r[a]]),l.ref.push(b[r[a]]),h+=_[b[r[a]]].options.position.lat(),v+=_[b[r[a]]].options.position.lng();h/=r.length,v/=r.length,l.latLng=new q.LatLng(h,v),l.ref=l.ref.join("-"),l.ref in E?delete E[l.ref]:(1===r.length&&(O[l.ref]=!0),L(l))}t.each(E,function(t){u(t)}),I=!1}}var m,y,w,L,b,x=!1,M=!1,I=!1,P=!1,k=!0,B=this,j=[],O={},C={},E={},T=[],_=[],D=[],U=S(o,i.radius);r(),B.getById=function(t){return t in C?(a(C[t]),T[C[t]]):!1},B.rm=function(t){var n=C[t];T[n]&&T[n].setMap(null),delete T[n],T[n]=!1,delete _[n],_[n]=!1,delete D[n],D[n]=!1,delete C[t],delete E[n],M=!0},B.clearById=function(t){return t in C?(B.rm(t),!0):void 0},B.clear=function(t,n,e){var o,i,a,r,s,u=[],l=v(e);for(t?(o=_.length-1,i=-1,a=-1):(o=0,i=_.length,a=1),r=o;r!==i&&(!_[r]||l&&!l(_[r].tag)||(u.push(E[r]),!n&&!t));r+=a);for(s=0;s<u.length;s++)B.rm(u[s])},B.add=function(t,n){t.id=s(t.id),B.clearById(t.id),C[t.id]=T.length,E[T.length]=t.id,T.push(null),_.push(t),D.push(n),M=!0},B.addMarker=function(t,e){e=e||{},e.id=s(e.id),B.clearById(e.id),e.options||(e.options={}),e.options.position=t.getPosition(),l(n,{td:e},t,e.id),C[e.id]=T.length,E[T.length]=e.id,T.push(t),_.push(e),D.push(e.data||{}),M=!0},B.td=function(t){return _[t]},B.value=function(t){return D[t]},B.marker=function(t){return t in T?(a(t),T[t]):!1},B.markerIsSet=function(t){return Boolean(T[t])},B.setMarker=function(t,n){T[t]=n},B.store=function(t,n,e){O[t.ref]={obj:n,shadow:e}},B.free=function(){var n;for(n=0;n<j.length;n++)q.event.removeListener(j[n]);j=[],t.each(O,function(t){u(t)}),O={},t.each(_,function(t){_[t]=null}),_=[],t.each(T,function(t){T[t]&&(T[t].setMap(null),delete T[t])}),T=[],t.each(D,function(t){delete D[t]}),D=[],C={},E={}},B.filter=function(t){w=t,h()},B.enable=function(t){k!==t&&(k=t,h())},B.display=function(t){L=t},B.error=function(t){b=t},B.beginUpdate=function(){x=!0},B.endUpdate=function(){x=!1,M&&h()},B.autofit=function(t){var n;for(n=0;n<_.length;n++)_[n]&&t.extend(_[n].options.position)}}function _(t,n){var e=this;e.id=function(){return t},e.filter=function(t){n.filter(t)},e.enable=function(){n.enable(!0)},e.disable=function(){n.enable(!1)},e.add=function(t,e,o){o||n.beginUpdate(),n.addMarker(t,e),o||n.endUpdate()},e.getById=function(t){return n.getById(t)},e.clearById=function(t,e){var o;return e||n.beginUpdate(),o=n.clearById(t),e||n.endUpdate(),o},e.clear=function(t,e,o,i){i||n.beginUpdate(),n.clear(t,e,o),i||n.endUpdate()}}function D(n,e,o,i){var a=this,r=[];A.classes.OverlayView.call(a),a.setMap(n),a.onAdd=function(){var n=a.getPanes();e.pane in n&&t(n[e.pane]).append(i),t.each("dblclick click mouseover mousemove mouseout mouseup mousedown".split(" "),function(n,e){r.push(q.event.addDomListener(i[0],e,function(n){t.Event(n).stopPropagation(),q.event.trigger(a,e,[n]),a.draw()}))}),r.push(q.event.addDomListener(i[0],"contextmenu",function(n){t.Event(n).stopPropagation(),q.event.trigger(a,"rightclick",[n]),a.draw()}))},a.getPosition=function(){return o},a.setPosition=function(t){o=t,a.draw()},a.draw=function(){var t=a.getProjection().fromLatLngToDivPixel(o);i.css("left",t.x+e.offset.x+"px").css("top",t.y+e.offset.y+"px")},a.onRemove=function(){var t;for(t=0;t<r.length;t++)q.event.removeListener(r[t]);i.remove()},a.hide=function(){i.hide()},a.show=function(){i.show()},a.toggle=function(){i&&(i.is(":visible")?a.show():a.hide())},a.toggleDOM=function(){a.setMap(a.getMap()?null:n)},a.getDOMElement=function(){return i[0]}}function U(i){function r(){!b&&(b=M.get())&&b.run()}function d(){b=null,M.ack(),r.call(x)}function c(t){var n,e=t.td.callback;e&&(n=Array.prototype.slice.call(arguments,1),z(e)?e.apply(i,n):R(e)&&z(e[1])&&e[1].apply(e[0],n))}function g(t,n,e){e&&l(i,t,n,e),c(t,n),b.ack(n)}function v(n,e){e=e||{};var o=e.td&&e.td.options?e.td.options:0;S?o&&(o.center&&(o.center=m(o.center)),S.setOptions(o)):(o=e.opts||t.extend(!0,{},A.map,o||{}),o.center=n||m(o.center),S=new A.classes.Map(i.get(0),o))}function w(e){var o,a,r=new T(i,S,e),s={},u={},d=[],c=/^[0-9]+$/;for(a in e)c.test(a)?(d.push(1*a),u[a]=e[a],u[a].width=u[a].width||0,u[a].height=u[a].height||0):s[a]=e[a];return d.sort(function(t,n){return t>n}),o=s.calculator?function(n){var e=[];return t.each(n,function(t,n){e.push(r.value(n))}),s.calculator.apply(i,[e])}:function(t){return t.length},r.error(function(){f.apply(x,arguments)}),r.display(function(a){var c,p,f,g,h,v,y=o(a.indexes);if(e.force||y>1)for(c=0;c<d.length;c++)d[c]<=y&&(p=u[d[c]]);p?(h=p.offset||[-p.width/2,-p.height/2],f=t.extend({},s),f.options=t.extend({pane:"overlayLayer",content:p.content?p.content.replace("CLUSTER_COUNT",y):"",offset:{x:("x"in h?h.x:h[0])||0,y:("y"in h?h.y:h[1])||0}},s.options||{}),g=x.overlay({td:f,opts:f.options,latLng:m(a)},!0),f.options.pane="floatShadow",f.options.content=t(document.createElement("div")).width(p.width+"px").height(p.height+"px").css({cursor:"pointer"}),v=x.overlay({td:f,opts:f.options,latLng:m(a)},!0),s.data={latLng:m(a),markers:[]},t.each(a.indexes,function(t,n){s.data.markers.push(r.value(n)),r.markerIsSet(n)&&r.marker(n).setMap(null)}),l(i,{td:s},v,n,{main:g,shadow:v}),r.store(a,g,v)):t.each(a.indexes,function(t,n){r.marker(n).setMap(S)})}),r}function L(n,e,o){var a=[],r="values"in n.td;return r||(n.td.values=[{options:n.opts}]),n.td.values.length?(v(),t.each(n.td.values,function(t,r){var s,u,d,c,f=p(n,r);if(f.options[o])if(f.options[o][0][0]&&R(f.options[o][0][0]))for(u=0;u<f.options[o].length;u++)for(d=0;d<f.options[o][u].length;d++)f.options[o][u][d]=m(f.options[o][u][d]);else for(u=0;u<f.options[o].length;u++)f.options[o][u]=m(f.options[o][u]);f.options.map=S,c=new q[e](f.options),a.push(c),s=I.add({td:f},e.toLowerCase(),c),l(i,{td:f},c,s)}),void g(n,r?a:a[0])):void g(n,!1)}var b,x=this,M=new P,I=new k,S=null;x._plan=function(t){var n;for(n=0;n<t.length;n++)M.add(new B(x,d,t[n]));r()},x.map=function(t){v(t.latLng,t),l(i,t,S),g(t,S)},x.destroy=function(t){I.clear(),i.empty(),S&&(S=null),g(t,!0)},x.overlay=function(n,e){var o=[],a="values"in n.td;return a||(n.td.values=[{latLng:n.latLng,options:n.opts}]),n.td.values.length?(D.__initialised||(D.prototype=new A.classes.OverlayView,D.__initialised=!0),t.each(n.td.values,function(a,r){var s,u,d=p(n,r),c=t(document.createElement("div")).css({border:"none",borderWidth:0,position:"absolute"});c.append(d.options.content),u=new D(S,d.options,m(d)||m(r),c),o.push(u),c=null,e||(s=I.add(n,"overlay",u),l(i,{td:d},u,s))}),e?o[0]:void g(n,a?o:o[0])):void g(n,!1)},x.marker=function(n){var e,o,a,r="values"in n.td,u=!S;return r||(n.opts.position=n.latLng||m(n.opts.position),n.td.values=[{options:n.opts}]),n.td.values.length?(u&&v(),n.td.cluster&&!S.getBounds()?void q.event.addListenerOnce(S,"bounds_changed",function(){x.marker.apply(x,[n])}):void(n.td.cluster?(n.td.cluster instanceof _?(o=n.td.cluster,a=I.getById(o.id(),!0)):(a=w(n.td.cluster),o=new _(s(n.td.id,!0),a),I.add(n,"clusterer",o,a)),a.beginUpdate(),t.each(n.td.values,function(t,e){var o=p(n,e);o.options.position=m(o.options.position?o.options.position:e),o.options.position&&(o.options.map=S,u&&(S.setCenter(o.options.position),u=!1),a.add(o,e))}),a.endUpdate(),g(n,o)):(e=[],t.each(n.td.values,function(t,o){var a,r,s=p(n,o);s.options.position=m(s.options.position?s.options.position:o),s.options.position&&(s.options.map=S,u&&(S.setCenter(s.options.position),u=!1),r=new A.classes.Marker(s.options),e.push(r),a=I.add({td:s},"marker",r),l(i,{td:s},r,a))}),g(n,r?e:e[0])))):void g(n,!1)},x.getroute=function(t){t.opts.origin=m(t.opts.origin,!0),t.opts.destination=m(t.opts.destination,!0),j().route(t.opts,function(n,e){c(t,e===q.DirectionsStatus.OK?n:!1,e),b.ack()})},x.getdistance=function(t){var n;for(t.opts.origins=h(t.opts.origins),n=0;n<t.opts.origins.length;n++)t.opts.origins[n]=m(t.opts.origins[n],!0);for(t.opts.destinations=h(t.opts.destinations),n=0;n<t.opts.destinations.length;n++)t.opts.destinations[n]=m(t.opts.destinations[n],!0);O().getDistanceMatrix(t.opts,function(n,e){c(t,e===q.DistanceMatrixStatus.OK?n:!1,e),b.ack()})},x.infowindow=function(e){var o=[],r="values"in e.td;r||(e.latLng&&(e.opts.position=e.latLng),e.td.values=[{options:e.opts}]),t.each(e.td.values,function(t,s){var u,d,c=p(e,s);c.options.position=m(c.options.position?c.options.position:s.latLng),S||v(c.options.position),d=new A.classes.InfoWindow(c.options),d&&(a(c.open)||c.open)&&(r?d.open(S,c.anchor||n):d.open(S,c.anchor||(e.latLng?n:e.session.marker?e.session.marker:n))),o.push(d),u=I.add({td:c},"infowindow",d),l(i,{td:c},d,u)}),g(e,r?o:o[0])},x.circle=function(n){var e=[],o="values"in n.td;return o||(n.opts.center=n.latLng||m(n.opts.center),n.td.values=[{options:n.opts}]),n.td.values.length?(t.each(n.td.values,function(t,o){var a,r,s=p(n,o);s.options.center=m(s.options.center?s.options.center:o),S||v(s.options.center),s.options.map=S,r=new A.classes.Circle(s.options),e.push(r),a=I.add({td:s},"circle",r),l(i,{td:s},r,a)}),void g(n,o?e:e[0])):void g(n,!1)},x.getaddress=function(t){c(t,t.results,t.status),b.ack()},x.getlatlng=function(t){c(t,t.results,t.status),b.ack()},x.getmaxzoom=function(t){C().getMaxZoomAtLatLng(t.latLng,function(n){c(t,n.status===q.MaxZoomStatus.OK?n.zoom:!1,status),b.ack()})},x.getelevation=function(t){var n,e=[],o=function(n,e){c(t,e===q.ElevationStatus.OK?n:!1,e),b.ack()};if(t.latLng)e.push(t.latLng);else for(e=h(t.td.locations||[]),n=0;n<e.length;n++)e[n]=m(e[n]);if(e.length)E().getElevationForLocations({locations:e},o);else{if(t.td.path&&t.td.path.length)for(n=0;n<t.td.path.length;n++)e.push(m(t.td.path[n]));e.length?E().getElevationAlongPath({path:e,samples:t.td.samples},o):b.ack()}},x.defaults=function(n){t.each(n.td,function(n,o){A[n]=e(A[n])?t.extend({},A[n],o):o}),b.ack(!0)},x.rectangle=function(n){var e=[],o="values"in n.td;return o||(n.td.values=[{options:n.opts}]),n.td.values.length?(t.each(n.td.values,function(t,o){var a,r,s=p(n,o);s.options.bounds=y(s.options.bounds?s.options.bounds:o),S||v(s.options.bounds.getCenter()),s.options.map=S,r=new A.classes.Rectangle(s.options),e.push(r),a=I.add({td:s},"rectangle",r),l(i,{td:s},r,a)}),void g(n,o?e:e[0])):void g(n,!1)},x.polyline=function(t){L(t,"Polyline","path")},x.polygon=function(t){L(t,"Polygon","paths")},x.trafficlayer=function(t){v();var n=I.get("trafficlayer");n||(n=new A.classes.TrafficLayer,n.setMap(S),I.add(t,"trafficlayer",n)),g(t,n)},x.bicyclinglayer=function(t){v();var n=I.get("bicyclinglayer");n||(n=new A.classes.BicyclingLayer,n.setMap(S),I.add(t,"bicyclinglayer",n)),g(t,n)},x.groundoverlay=function(t){t.opts.bounds=y(t.opts.bounds),t.opts.bounds&&v(t.opts.bounds.getCenter());var n,e=new A.classes.GroundOverlay(t.opts.url,t.opts.bounds,t.opts.opts);e.setMap(S),n=I.add(t,"groundoverlay",e),g(t,e,n)},x.streetviewpanorama=function(n){n.opts.opts||(n.opts.opts={}),n.latLng?n.opts.opts.position=n.latLng:n.opts.opts.position&&(n.opts.opts.position=m(n.opts.opts.position)),n.td.divId?n.opts.container=document.getElementById(n.td.divId):n.opts.container&&(n.opts.container=t(n.opts.container).get(0));var e,o=new A.classes.StreetViewPanorama(n.opts.container,n.opts.opts);o&&S.setStreetView(o),e=I.add(n,"streetviewpanorama",o),g(n,o,e)},x.kmllayer=function(n){var e=[],o="values"in n.td;return o||(n.td.values=[{options:n.opts}]),n.td.values.length?(t.each(n.td.values,function(t,o){var a,r,s,d=p(n,o);S||v(),s=d.options,d.options.opts&&(s=d.options.opts,d.options.url&&(s.url=d.options.url)),s.map=S,r=u("3.10")?new A.classes.KmlLayer(s):new A.classes.KmlLayer(s.url,s),e.push(r),a=I.add({td:d},"kmllayer",r),l(i,{td:d},r,a)}),void g(n,o?e:e[0])):void g(n,!1)},x.panel=function(n){v();var e,o,r=0,s=0,u=t(document.createElement("div"));u.css({position:"absolute",zIndex:1e3,visibility:"hidden"}),n.opts.content&&(o=t(n.opts.content),u.append(o),i.first().prepend(u),a(n.opts.left)?a(n.opts.right)?n.opts.center&&(r=(i.width()-o.width())/2):r=i.width()-o.width()-n.opts.right:r=n.opts.left,a(n.opts.top)?a(n.opts.bottom)?n.opts.middle&&(s=(i.height()-o.height())/2):s=i.height()-o.height()-n.opts.bottom:s=n.opts.top,u.css({top:s,left:r,visibility:"visible"})),e=I.add(n,"panel",u),g(n,u,e),u=null},x.directionsrenderer=function(n){n.opts.map=S;var e,o=new q.DirectionsRenderer(n.opts);n.td.divId?o.setPanel(document.getElementById(n.td.divId)):n.td.container&&o.setPanel(t(n.td.container).get(0)),e=I.add(n,"directionsrenderer",o),g(n,o,e)},x.getgeoloc=function(t){g(t,t.latLng)},x.styledmaptype=function(t){v();var n=new A.classes.StyledMapType(t.td.styles,t.opts);S.mapTypes.set(t.td.id,n),g(t,n)},x.imagemaptype=function(t){v();var n=new A.classes.ImageMapType(t.opts);S.mapTypes.set(t.td.id,n),g(t,n)},x.autofit=function(n){var e=new q.LatLngBounds;t.each(I.all(),function(t,n){n.getPosition?e.extend(n.getPosition()):n.getBounds?(e.extend(n.getBounds().getNorthEast()),e.extend(n.getBounds().getSouthWest())):n.getPaths?n.getPaths().forEach(function(t){t.forEach(function(t){e.extend(t)})}):n.getPath?n.getPath().forEach(function(t){e.extend(t)}):n.getCenter?e.extend(n.getCenter()):"function"==typeof _&&n instanceof _&&(n=I.getById(n.id(),!0),n&&n.autofit(e))}),e.isEmpty()||S.getBounds()&&S.getBounds().equals(e)||("maxZoom"in n.td&&q.event.addListenerOnce(S,"bounds_changed",function(){this.getZoom()>n.td.maxZoom&&this.setZoom(n.td.maxZoom)}),S.fitBounds(e)),g(n,!0)},x.clear=function(n){if(o(n.td)){if(I.clearById(n.td)||I.objClearById(n.td))return void g(n,!0);n.td={name:n.td}}n.td.id?t.each(h(n.td.id),function(t,n){I.clearById(n)||I.objClearById(n)}):(I.clear(h(n.td.name),n.td.last,n.td.first,n.td.tag),I.objClear(h(n.td.name),n.td.last,n.td.first,n.td.tag)),g(n,!0)},x.get=function(e,i,a){var r,s,u=i?e:e.td;return i||(a=u.full),o(u)?(s=I.getById(u,!1,a)||I.objGetById(u),s===!1&&(r=u,u={})):r=u.name,"map"===r&&(s=S),s||(s=[],u.id?(t.each(h(u.id),function(t,n){s.push(I.getById(n,!1,a)||I.objGetById(n))}),R(u.id)||(s=s[0])):(t.each(r?h(r):[n],function(n,e){var o;u.first?(o=I.get(e,!1,u.tag,a),o&&s.push(o)):u.all?t.each(I.all(e,u.tag,a),function(t,n){s.push(n)}):(o=I.get(e,!0,u.tag,a),o&&s.push(o))}),u.all||R(r)||(s=s[0]))),s=R(s)||!u.all?s:[s],i?s:void g(e,s)},x.exec=function(n){t.each(h(n.td.func),function(e,o){t.each(x.get(n.td,!0,n.td.hasOwnProperty("full")?n.td.full:!0),function(t,n){o.call(i,n)})}),g(n,!0)},x.trigger=function(n){if(o(n.td))q.event.trigger(S,n.td);else{var e=[S,n.td.eventName];n.td.var_args&&t.each(n.td.var_args,function(t,n){e.push(n)}),q.event.trigger.apply(q.event,e)}c(n),b.ack()}}var A,q,Z=0,z=t.isFunction,R=t.isArray,V={},G=new I;t.fn.gmap3=function(){var n,e=[],o=!0,i=[];for(r(),n=0;n<arguments.length;n++)arguments[n]&&e.push(arguments[n]);return e.length||e.push("map"),t.each(this,function(){var n=t(this),a=n.data("gmap3");o=!1,a||(a=new U(n),n.data("gmap3",a)),1!==e.length||"get"!==e[0]&&!x(e[0])?a._plan(e):i.push("get"===e[0]?a.get("map",!0):a.get(e[0].get,!0,e[0].get.full))}),i.length?1===i.length?i[0]:i:this}}(jQuery);;function MarkerClusterer(t,e,r){this.extend(MarkerClusterer,google.maps.OverlayView),this.map_=t,this.markers_=[],this.clusters_=[],this.sizes=[53,56,66,78,90],this.styles_=[],this.ready_=!1;var s=r||{};this.gridSize_=s.gridSize||60,this.minClusterSize_=s.minimumClusterSize||2,this.maxZoom_=s.maxZoom||null,this.styles_=s.styles||[],this.imagePath_=s.imagePath||this.MARKER_CLUSTER_IMAGE_PATH_,this.imageExtension_=s.imageExtension||this.MARKER_CLUSTER_IMAGE_EXTENSION_,this.zoomOnClick_=!0,void 0!=s.zoomOnClick&&(this.zoomOnClick_=s.zoomOnClick),this.averageCenter_=!1,void 0!=s.averageCenter&&(this.averageCenter_=s.averageCenter),this.setupStyles_(),this.setMap(t),this.prevZoom_=this.map_.getZoom();var o=this;google.maps.event.addListener(this.map_,"zoom_changed",function(){var t=o.map_.getZoom();o.prevZoom_!=t&&(o.prevZoom_=t,o.resetViewport())}),google.maps.event.addListener(this.map_,"idle",function(){o.redraw()}),e&&e.length&&this.addMarkers(e,!1)}function Cluster(t){this.markerClusterer_=t,this.map_=t.getMap(),this.gridSize_=t.getGridSize(),this.minClusterSize_=t.getMinClusterSize(),this.averageCenter_=t.isAverageCenter(),this.center_=null,this.markers_=[],this.bounds_=null,this.clusterIcon_=new ClusterIcon(this,t.getStyles(),t.getGridSize())}function ClusterIcon(t,e,r){t.getMarkerClusterer().extend(ClusterIcon,google.maps.OverlayView),this.styles_=e,this.padding_=r||0,this.cluster_=t,this.center_=null,this.map_=t.getMap(),this.div_=null,this.sums_=null,this.visible_=!1,this.setMap(this.map_)}MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/images/m",MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_EXTENSION_="png",MarkerClusterer.prototype.extend=function(t,e){return function(t){for(var e in t.prototype)this.prototype[e]=t.prototype[e];return this}.apply(t,[e])},MarkerClusterer.prototype.onAdd=function(){this.setReady_(!0)},MarkerClusterer.prototype.draw=function(){},MarkerClusterer.prototype.setupStyles_=function(){if(!this.styles_.length)for(var t,e=0;t=this.sizes[e];e++)this.styles_.push({url:this.imagePath_+(e+1)+"."+this.imageExtension_,height:t,width:t})},MarkerClusterer.prototype.fitMapToMarkers=function(){for(var t,e=this.getMarkers(),r=new google.maps.LatLngBounds,s=0;t=e[s];s++)r.extend(t.getPosition());this.map_.fitBounds(r)},MarkerClusterer.prototype.setStyles=function(t){this.styles_=t},MarkerClusterer.prototype.getStyles=function(){return this.styles_},MarkerClusterer.prototype.isZoomOnClick=function(){return this.zoomOnClick_},MarkerClusterer.prototype.isAverageCenter=function(){return this.averageCenter_},MarkerClusterer.prototype.getMarkers=function(){return this.markers_},MarkerClusterer.prototype.getTotalMarkers=function(){return this.markers_.length},MarkerClusterer.prototype.setMaxZoom=function(t){this.maxZoom_=t},MarkerClusterer.prototype.getMaxZoom=function(){return this.maxZoom_},MarkerClusterer.prototype.calculator_=function(t,e){for(var r=0,s=t.length,o=s;0!==o;)o=parseInt(o/10,10),r++;return r=Math.min(r,e),{text:s,index:r}},MarkerClusterer.prototype.setCalculator=function(t){this.calculator_=t},MarkerClusterer.prototype.getCalculator=function(){return this.calculator_},MarkerClusterer.prototype.addMarkers=function(t,e){for(var r,s=0;r=t[s];s++)this.pushMarkerTo_(r);e||this.redraw()},MarkerClusterer.prototype.pushMarkerTo_=function(t){if(t.isAdded=!1,t.draggable){var e=this;google.maps.event.addListener(t,"dragend",function(){t.isAdded=!1,e.repaint()})}this.markers_.push(t)},MarkerClusterer.prototype.addMarker=function(t,e){this.pushMarkerTo_(t),e||this.redraw()},MarkerClusterer.prototype.removeMarker_=function(t){var e=-1;if(this.markers_.indexOf)e=this.markers_.indexOf(t);else for(var r,s=0;r=this.markers_[s];s++)if(r==t){e=s;break}return-1==e?!1:(t.setMap(null),this.markers_.splice(e,1),!0)},MarkerClusterer.prototype.removeMarker=function(t,e){var r=this.removeMarker_(t);return!e&&r?(this.resetViewport(),this.redraw(),!0):!1},MarkerClusterer.prototype.removeMarkers=function(t,e){for(var r,s=!1,o=0;r=t[o];o++){var i=this.removeMarker_(r);s=s||i}return!e&&s?(this.resetViewport(),this.redraw(),!0):void 0},MarkerClusterer.prototype.setReady_=function(t){this.ready_||(this.ready_=t,this.createClusters_())},MarkerClusterer.prototype.getTotalClusters=function(){return this.clusters_.length},MarkerClusterer.prototype.getMap=function(){return this.map_},MarkerClusterer.prototype.setMap=function(t){this.map_=t},MarkerClusterer.prototype.getGridSize=function(){return this.gridSize_},MarkerClusterer.prototype.setGridSize=function(t){this.gridSize_=t},MarkerClusterer.prototype.getMinClusterSize=function(){return this.minClusterSize_},MarkerClusterer.prototype.setMinClusterSize=function(t){this.minClusterSize_=t},MarkerClusterer.prototype.getExtendedBounds=function(t){var e=this.getProjection(),r=new google.maps.LatLng(t.getNorthEast().lat(),t.getNorthEast().lng()),s=new google.maps.LatLng(t.getSouthWest().lat(),t.getSouthWest().lng()),o=e.fromLatLngToDivPixel(r);o.x+=this.gridSize_,o.y-=this.gridSize_;var i=e.fromLatLngToDivPixel(s);i.x-=this.gridSize_,i.y+=this.gridSize_;var n=e.fromDivPixelToLatLng(o),a=e.fromDivPixelToLatLng(i);return t.extend(n),t.extend(a),t},MarkerClusterer.prototype.isMarkerInBounds_=function(t,e){return e.contains(t.getPosition())},MarkerClusterer.prototype.clearMarkers=function(){this.resetViewport(!0),this.markers_=[]},MarkerClusterer.prototype.resetViewport=function(t){for(var e,r=0;e=this.clusters_[r];r++)e.remove();for(var s,r=0;s=this.markers_[r];r++)s.isAdded=!1,t&&s.setMap(null);this.clusters_=[]},MarkerClusterer.prototype.repaint=function(){var t=this.clusters_.slice();this.clusters_.length=0,this.resetViewport(),this.redraw(),window.setTimeout(function(){for(var e,r=0;e=t[r];r++)e.remove()},0)},MarkerClusterer.prototype.redraw=function(){this.createClusters_()},MarkerClusterer.prototype.distanceBetweenPoints_=function(t,e){if(!t||!e)return 0;var r=6371,s=(e.lat()-t.lat())*Math.PI/180,o=(e.lng()-t.lng())*Math.PI/180,i=Math.sin(s/2)*Math.sin(s/2)+Math.cos(t.lat()*Math.PI/180)*Math.cos(e.lat()*Math.PI/180)*Math.sin(o/2)*Math.sin(o/2),n=2*Math.atan2(Math.sqrt(i),Math.sqrt(1-i)),a=r*n;return a},MarkerClusterer.prototype.addToClosestCluster_=function(t){for(var e,r=4e4,s=null,o=(t.getPosition(),0);e=this.clusters_[o];o++){var i=e.getCenter();if(i){var n=this.distanceBetweenPoints_(i,t.getPosition());r>n&&(r=n,s=e)}}if(s&&s.isMarkerInClusterBounds(t))s.addMarker(t);else{var e=new Cluster(this);e.addMarker(t),this.clusters_.push(e)}},MarkerClusterer.prototype.createClusters_=function(){if(this.ready_)for(var t,e=new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(),this.map_.getBounds().getNorthEast()),r=this.getExtendedBounds(e),s=0;t=this.markers_[s];s++)!t.isAdded&&this.isMarkerInBounds_(t,r)&&this.addToClosestCluster_(t)},Cluster.prototype.isMarkerAlreadyAdded=function(t){if(this.markers_.indexOf)return-1!=this.markers_.indexOf(t);for(var e,r=0;e=this.markers_[r];r++)if(e==t)return!0;return!1},Cluster.prototype.addMarker=function(t){if(this.isMarkerAlreadyAdded(t))return!1;if(this.center_){if(this.averageCenter_){var e=this.markers_.length+1,r=(this.center_.lat()*(e-1)+t.getPosition().lat())/e,s=(this.center_.lng()*(e-1)+t.getPosition().lng())/e;this.center_=new google.maps.LatLng(r,s),this.calculateBounds_()}}else this.center_=t.getPosition(),this.calculateBounds_();t.isAdded=!0,this.markers_.push(t);var o=this.markers_.length;if(o<this.minClusterSize_&&t.getMap()!=this.map_&&t.setMap(this.map_),o==this.minClusterSize_)for(var i=0;o>i;i++)this.markers_[i].setMap(null);return o>=this.minClusterSize_&&t.setMap(null),this.updateIcon(),!0},Cluster.prototype.getMarkerClusterer=function(){return this.markerClusterer_},Cluster.prototype.getBounds=function(){for(var t,e=new google.maps.LatLngBounds(this.center_,this.center_),r=this.getMarkers(),s=0;t=r[s];s++)e.extend(t.getPosition());return e},Cluster.prototype.remove=function(){this.clusterIcon_.remove(),this.markers_.length=0,delete this.markers_},Cluster.prototype.getSize=function(){return this.markers_.length},Cluster.prototype.getMarkers=function(){return this.markers_},Cluster.prototype.getCenter=function(){return this.center_},Cluster.prototype.calculateBounds_=function(){var t=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(t)},Cluster.prototype.isMarkerInClusterBounds=function(t){return this.bounds_.contains(t.getPosition())},Cluster.prototype.getMap=function(){return this.map_},Cluster.prototype.updateIcon=function(){var t=this.map_.getZoom(),e=this.markerClusterer_.getMaxZoom();if(e&&t>e)for(var r,s=0;r=this.markers_[s];s++)r.setMap(this.map_);else{if(this.markers_.length<this.minClusterSize_)return void this.clusterIcon_.hide();var o=this.markerClusterer_.getStyles().length,i=this.markerClusterer_.getCalculator()(this.markers_,o);this.clusterIcon_.setCenter(this.center_),this.clusterIcon_.setSums(i),this.clusterIcon_.show()}},ClusterIcon.prototype.triggerClusterClick=function(){var t=this.cluster_.getMarkerClusterer();google.maps.event.trigger(t,"clusterclick",this.cluster_),t.isZoomOnClick()&&this.map_.fitBounds(this.cluster_.getBounds())},ClusterIcon.prototype.onAdd=function(){if(this.div_=document.createElement("DIV"),this.visible_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(t),this.div_.innerHTML=this.sums_.text}var e=this.getPanes();e.overlayMouseTarget.appendChild(this.div_);var r=this;google.maps.event.addDomListener(this.div_,"click",function(){r.triggerClusterClick()})},ClusterIcon.prototype.getPosFromLatLng_=function(t){var e=this.getProjection().fromLatLngToDivPixel(t);return"object"==typeof this.iconAnchor_&&2===this.iconAnchor_.length?(e.x-=this.iconAnchor_[0],e.y-=this.iconAnchor_[1]):(e.x-=parseInt(this.width_/2,10),e.y-=parseInt(this.height_/2,10)),e},ClusterIcon.prototype.draw=function(){if(this.visible_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.top=t.y+"px",this.div_.style.left=t.x+"px"}},ClusterIcon.prototype.hide=function(){this.div_&&(this.div_.style.display="none"),this.visible_=!1},ClusterIcon.prototype.show=function(){if(this.div_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(t),this.div_.style.display=""}this.visible_=!0},ClusterIcon.prototype.remove=function(){this.setMap(null)},ClusterIcon.prototype.onRemove=function(){this.div_&&this.div_.parentNode&&(this.hide(),this.div_.parentNode.removeChild(this.div_),this.div_=null)},ClusterIcon.prototype.setSums=function(t){this.sums_=t,this.text_=t.text,this.index_=t.index,this.div_&&(this.div_.innerHTML=t.text),this.useStyle()},ClusterIcon.prototype.useStyle=function(){var t=Math.max(0,this.sums_.index-1);t=Math.min(this.styles_.length-1,t);var e=this.styles_[t];this.url_=e.url,this.height_=e.height,this.width_=e.width,this.textColor_=e.textColor,this.anchor_=e.anchor,this.textSize_=e.textSize,this.backgroundPosition_=e.backgroundPosition,this.iconAnchor_=e.iconAnchor},ClusterIcon.prototype.setCenter=function(t){this.center_=t},ClusterIcon.prototype.createCss=function(t){var e=[];e.push("background-image:url("+this.url_+");");var r=this.backgroundPosition_?this.backgroundPosition_:"0 0";e.push("background-position:"+r+";"),"object"==typeof this.anchor_?("number"==typeof this.anchor_[0]&&this.anchor_[0]>0&&this.anchor_[0]<this.height_?e.push("height:"+(this.height_-this.anchor_[0])+"px; padding-top:"+this.anchor_[0]+"px;"):"number"==typeof this.anchor_[0]&&this.anchor_[0]<0&&-this.anchor_[0]<this.height_?e.push("height:"+this.height_+"px; line-height:"+(this.height_+this.anchor_[0])+"px;"):e.push("height:"+this.height_+"px; line-height:"+this.height_+"px;"),"number"==typeof this.anchor_[1]&&this.anchor_[1]>0&&this.anchor_[1]<this.width_?e.push("width:"+(this.width_-this.anchor_[1])+"px; padding-left:"+this.anchor_[1]+"px;"):e.push("width:"+this.width_+"px; text-align:center;")):e.push("height:"+this.height_+"px; line-height:"+this.height_+"px; width:"+this.width_+"px; text-align:center;");var s=this.textColor_?this.textColor_:"black",o=this.textSize_?this.textSize_:11;return e.push("cursor:pointer; top:"+t.y+"px; left:"+t.x+"px; color:"+s+"; position:absolute; font-size:"+o+"px; font-family:Arial,sans-serif; font-weight:bold"),e.join("")},window.MarkerClusterer=MarkerClusterer,MarkerClusterer.prototype.addMarker=MarkerClusterer.prototype.addMarker,MarkerClusterer.prototype.addMarkers=MarkerClusterer.prototype.addMarkers,MarkerClusterer.prototype.clearMarkers=MarkerClusterer.prototype.clearMarkers,MarkerClusterer.prototype.fitMapToMarkers=MarkerClusterer.prototype.fitMapToMarkers,MarkerClusterer.prototype.getCalculator=MarkerClusterer.prototype.getCalculator,MarkerClusterer.prototype.getGridSize=MarkerClusterer.prototype.getGridSize,MarkerClusterer.prototype.getExtendedBounds=MarkerClusterer.prototype.getExtendedBounds,MarkerClusterer.prototype.getMap=MarkerClusterer.prototype.getMap,MarkerClusterer.prototype.getMarkers=MarkerClusterer.prototype.getMarkers,MarkerClusterer.prototype.getMaxZoom=MarkerClusterer.prototype.getMaxZoom,MarkerClusterer.prototype.getStyles=MarkerClusterer.prototype.getStyles,MarkerClusterer.prototype.getTotalClusters=MarkerClusterer.prototype.getTotalClusters,MarkerClusterer.prototype.getTotalMarkers=MarkerClusterer.prototype.getTotalMarkers,MarkerClusterer.prototype.redraw=MarkerClusterer.prototype.redraw,MarkerClusterer.prototype.removeMarker=MarkerClusterer.prototype.removeMarker,MarkerClusterer.prototype.removeMarkers=MarkerClusterer.prototype.removeMarkers,MarkerClusterer.prototype.resetViewport=MarkerClusterer.prototype.resetViewport,MarkerClusterer.prototype.repaint=MarkerClusterer.prototype.repaint,MarkerClusterer.prototype.setCalculator=MarkerClusterer.prototype.setCalculator,MarkerClusterer.prototype.setGridSize=MarkerClusterer.prototype.setGridSize,MarkerClusterer.prototype.setMaxZoom=MarkerClusterer.prototype.setMaxZoom,MarkerClusterer.prototype.onAdd=MarkerClusterer.prototype.onAdd,MarkerClusterer.prototype.draw=MarkerClusterer.prototype.draw,Cluster.prototype.getCenter=Cluster.prototype.getCenter,Cluster.prototype.getSize=Cluster.prototype.getSize,Cluster.prototype.getMarkers=Cluster.prototype.getMarkers,ClusterIcon.prototype.onAdd=ClusterIcon.prototype.onAdd,ClusterIcon.prototype.draw=ClusterIcon.prototype.draw,ClusterIcon.prototype.onRemove=ClusterIcon.prototype.onRemove;;function closeGmapThumbItem(me) { jQuery(me).closest(".div_item_map").remove() } jQuery(function ($) { $(".st_list_map .div_item_map").hide(); $(".st_list_map .div_item_map").fadeIn(1E3) }); jQuery(function ($) { if ($(".st_detailed_map").length > 0) { var me = $(".st_detailed_map"); var my_div_map = jQuery("#list_map"); var data_show = me.data("data_show"); var map_height = me.data("map_height"); var style_map = me.data("style_map"); var type_map = me.data("type_map"); var street_views = me.data("street_views"); var height = me.data("height"); var location_center = me.data("location_center"); var zoom = me.data("zoom"); var range = me.data("range"); $(function () { var waypoint = new Waypoint({ element: document.getElementById('list_map'), handler: function () { init_list_map(my_div_map, data_show, location_center, zoom, style_map); this.destroy() }, offset: $(window).height() }); // init_list_map(my_div_map, data_show, location_center, // zoom, style_map); $("a[data-vc-tabs],a[data-vc-accordion]").on("click", function () { setTimeout(function () { /*var gmap_obj = my_div_map.gmap3("get"); google.maps.event.trigger(gmap_obj, "resize"); gmap_obj.setCenter(new google.maps.LatLng(location_center[0], location_center[1]))*/ if($('#list_map iframe').length) { var iframe = $('#list_map iframe').get(0); iframe.src = iframe.src; } }, 100) }); function init_list_map(div_map, data_map, map_center, data_zoom, style_map) { var map = div_map; var markers = []; var bounds = new google.maps.LatLngBounds; data_zoom = parseInt(data_zoom); var options = { map: { options: { center: map_center, zoom: data_zoom, mapTypeId: google.maps.MapTypeId.ROADMAP, navigationControl: !0, scrollwheel: !0, streetViewControl: !1, scaleControl: !0, mapTypeControl: !0, zoomControl: !0, zoomControlOptions: {style: google.maps.ZoomControlStyle.SMALL} }, events: { zoom_changed: function (map) { $(this).attr("data-zoom", map.getZoom()) }, tilesloaded: function (map) { jQuery("#st-gmap-loading").fadeOut(700); jQuery(".st-gmap-loading-bg").fadeOut(700); setTimeout(function () { $(div_map).find(".st-popup-gallery").each(function () { $(this).magnificPopup({ delegate: ".st-gp-item", type: "image", gallery: {enabled: !0} }) }) }, 200) } } }, circle: { options: { center: location_center, radius: range * 1E3, fillColor: "#A3D5CB", strokeColor: "#499195", strokeWidth: 1 } }, overlay: { latLng: location_center, options: {content: $(".data_content").html(), offset: {y: -210, x: 20}} } }; if (street_views == "on")options.map.options.streetViewControl = !0; map.gmap3(options); var gmap_obj = map.gmap3("get"); var tmp_map_type = "roadmap"; if (type_map != "")tmp_map_type = type_map; gmap_obj.setMapTypeId(tmp_map_type); for (var key in data_map) { var tmp_data = data_map[key]; var myLatLng = new google.maps.LatLng(tmp_data.lat, tmp_data.lng); bounds.extend(myLatLng); var marker = ST_addMarker(myLatLng, gmap_obj, tmp_data, map); markers.push(marker) } var mcOptions = { styles: [{height: 53, url: st_list_map_params.cluster_m1, width: 53}, { height: 56, url: st_list_map_params.cluster_m2, width: 56 }, {height: 66, url: st_list_map_params.cluster_m3, width: 66}, { height: 78, url: st_list_map_params.cluster_m4, width: 78 }, {height: 90, url: st_list_map_params.cluster_m5, width: 90}] }; var mc = new MarkerClusterer(gmap_obj, markers, mcOptions); if (map.data("fitbounds") == "on") { var gmap_object = map.gmap3("get"); gmap_object.fitBounds(bounds) } function ST_addMarker(location, gmap_object, tmp_data, map) { var marker = new google.maps.Marker({ position: location, options: {icon: tmp_data.icon_mk, animation: google.maps.Animation.DROP}, tag: "st_tag_" + tmp_data.id, data: tmp_data }); marker.addListener("click", function () { gmap_object.panTo(location); map.gmap3({clear: "overlay"}, { overlay: { pane: "floatPane", latLng: location, options: { content: tmp_data.content_html, offset: {x: 20, y: -210} } } }); setTimeout(function () { $(map).find(".st-popup-gallery").each(function () { $(this).magnificPopup({delegate: ".st-gp-item", type: "image", gallery: {enabled: !0}}) }) }, 200) }); return marker } return map } }) } }); jQuery(function ($) { if ($(".st_list_map_html").length > 0) { var me = $(".st_list_map_html"); var my_div_map = jQuery("#list_map"); var data_show = me.data("data_show"); var map_height = me.data("map_height"); var style_map = me.data("style_map"); var fit_bounds = me.data("fit_bounds"); var location_center = me.data("location_center"); var zoom = me.data("zoom"); $(function () { var filter_search_map = $(".search_list_map .filter_search_map"); $(".search_list_map .filter_search_map .btn_search").on('click', function () { var $this = $(this); var options = { url: st_params.ajax_url, dataType: "json", beforeSend: function () { jQuery("#st-gmap-loading").show(); jQuery(".st-gmap-loading-bg").show(); $this.html(st_params.text_loading); $(".data_list_map").css("opacity", "0.5") }, success: function (data) { $("#list_map").gmap3({action: "destroy"}); var container = $("#list_map").parent(); $("#list_map").remove(); container.append('<div id="list_map"></div>'); $("#list_map").height(map_height); $("#list_map").attr("data-fitbounds", fit_bounds); if (data.location_center == "[0,0]")$("#list_map").attr("data-fitbounds", "on"); location_center = [data.map_lat_center, data.map_lng_center]; init_list_map($("#list_map"), data.data_map, location_center, data.zoom, style_map); $(".data_list_map").html(""); var count = 0; for (var key in data.data_map) { var tmp_data = data.data_map[key]; var res = tmp_data.content_adv_html.replace("item_price_map", ""); $(".data_list_map").append('<div class="col-md-3 col-sm-6">' + res + "</div>"); count++ } $(".count_advan_saerch").html("(" + count + ")"); if (count == 0)$(".data_list_map").append('<div class="alert alert-warning"> <button data-dismiss="alert" type="button" class="close"><span aria-hidden="true">\u00d7</span> </button> <p class="text-small">' + st_list_map_params.text_no_result + "</p> </div>"); $(".data_list_map").css("opacity", "1"); $this.html($this.data("title")) }, complete: function () { jQuery("#st-gmap-loading").fadeOut(700); jQuery(".st-gmap-loading-bg").fadeOut(700) } }; filter_search_map.ajaxForm(options) }); $(".st_list_map .map-view").on('click', function () { if ($(this).hasClass("view")) { $(this).removeClass("view"); $(".st_list_map").find(".st-map-type").hide() } else { $(this).addClass("view"); $(".st_list_map").find(".st-map-type").show() } }); $(".st_list_map .st-map-type").on('click', function () { var name = $(this).data("name"); var style = ""; if (name == "style_normal")style = [{ featureType: "road.highway", elementType: "geometry", stylers: [{hue: "#ff0022"}, {saturation: 60}, {lightness: -20}] }]; if (name == "style_midnight")style = [{ "featureType": "all", "elementType": "labels.text.fill", "stylers": [{"saturation": 36}, {"color": "#000000"}, {"lightness": 40}] }, { "featureType": "all", "elementType": "labels.text.stroke", "stylers": [{"visibility": "on"}, {"color": "#000000"}, {"lightness": 16}] }, { "featureType": "all", "elementType": "labels.icon", "stylers": [{"visibility": "off"}] }, { "featureType": "administrative", "elementType": "geometry.fill", "stylers": [{"color": "#000000"}, {"lightness": 20}] }, { "featureType": "administrative", "elementType": "geometry.stroke", "stylers": [{"color": "#000000"}, {"lightness": 17}, {"weight": 1.2}] }, { "featureType": "administrative.country", "elementType": "labels", "stylers": [{"visibility": "on"}, {"lightness": "0"}] }, { "featureType": "administrative.country", "elementType": "labels.text.fill", "stylers": [{"visibility": "on"}, {"lightness": "13"}] }, { "featureType": "landscape", "elementType": "geometry", "stylers": [{"color": "#000000"}, {"lightness": 20}] }, { "featureType": "poi", "elementType": "geometry", "stylers": [{"color": "#000000"}, {"lightness": 21}] }, { "featureType": "road", "elementType": "all", "stylers": [{"visibility": "on"}, {"saturation": "-100"}, {"lightness": "-20"}, {"invert_lightness": !0}] }, {"featureType": "road", "elementType": "geometry.stroke", "stylers": [{"color": "#bebebe"}]}, { "featureType": "road", "elementType": "labels.text.fill", "stylers": [{"visibility": "on"}, {"lightness": "-47"}] }, { "featureType": "road", "elementType": "labels.text.stroke", "stylers": [{"lightness": "-33"}, {"weight": "0.52"}] }, { "featureType": "road.highway", "elementType": "all", "stylers": [{"visibility": "on"}] }, { "featureType": "road.highway", "elementType": "geometry", "stylers": [{"visibility": "on"}, {"color": "#b5b5b5"}, {"saturation": "-1"}, {"gamma": "0.00"}, {"weight": "2.22"}] }, { "featureType": "road.highway", "elementType": "geometry.fill", "stylers": [{"lightness": "0"}, {"visibility": "on"}, {"weight": "2.8"}, {"color": "#585858"}] }, { "featureType": "road.highway", "elementType": "geometry.stroke", "stylers": [{"color": "#909090"}, {"lightness": "2"}, {"weight": "0.2"}, {"visibility": "off"}] }, { "featureType": "road.highway", "elementType": "labels.text.fill", "stylers": [{"lightness": "16"}, {"color": "#595959"}] }, { "featureType": "road.highway", "elementType": "labels.text.stroke", "stylers": [{"lightness": "-63"}, {"weight": "1"}] }, { "featureType": "road.arterial", "elementType": "geometry", "stylers": [{"color": "#000000"}, {"lightness": 18}, {"visibility": "on"}] }, { "featureType": "road.arterial", "elementType": "geometry.fill", "stylers": [{"visibility": "on"}, {"lightness": "10"}] }, { "featureType": "road.arterial", "elementType": "labels.text.fill", "stylers": [{"visibility": "on"}, {"lightness": "28"}] }, { "featureType": "road.arterial", "elementType": "labels.text.stroke", "stylers": [{"visibility": "on"}, {"weight": "0.1"}, {"lightness": "-96"}] }, { "featureType": "road.local", "elementType": "geometry", "stylers": [{"color": "#000000"}, {"lightness": 16}] }, { "featureType": "transit", "elementType": "geometry", "stylers": [{"color": "#000000"}, {"lightness": 19}] }, { "featureType": "water", "elementType": "geometry", "stylers": [{"color": "#12161a"}, {"lightness": 17}] }]; if (name == "style_family_fest")style = [{ "featureType": "administrative", "elementType": "labels.text.fill", "stylers": [{"color": "#444444"}] }, { "featureType": "landscape", "elementType": "all", "stylers": [{"color": "#f2f2f2"}] }, {"featureType": "poi", "elementType": "all", "stylers": [{"visibility": "off"}]}, { "featureType": "poi", "elementType": "geometry.fill", "stylers": [{"visibility": "on"}, {"saturation": "-6"}] }, { "featureType": "poi", "elementType": "geometry.stroke", "stylers": [{"visibility": "on"}] }, { "featureType": "poi", "elementType": "labels", "stylers": [{"visibility": "on"}, {"weight": "1.30"}] }, { "featureType": "poi", "elementType": "labels.text", "stylers": [{"visibility": "on"}] }, { "featureType": "poi", "elementType": "labels.text.fill", "stylers": [{"visibility": "on"}] }, {"featureType": "poi", "elementType": "labels.icon", "stylers": [{"visibility": "on"}]}, { "featureType": "road", "elementType": "all", "stylers": [{"saturation": -100}, {"lightness": 45}] }, { "featureType": "road.highway", "elementType": "all", "stylers": [{"visibility": "simplified"}] }, { "featureType": "road.arterial", "elementType": "labels.icon", "stylers": [{"visibility": "off"}] }, { "featureType": "transit", "elementType": "all", "stylers": [{"visibility": "off"}] }, { "featureType": "water", "elementType": "all", "stylers": [{"color": "#52978e"}, {"visibility": "on"}] }]; if (name == "style_open_dark")style = [{ "featureType": "all", "elementType": "labels.text.fill", "stylers": [{"color": "#ffffff"}] }, { "featureType": "all", "elementType": "labels.text.stroke", "stylers": [{"visibility": "on"}, {"color": "#3e606f"}, {"weight": 2}, {"gamma": .84}] }, { "featureType": "all", "elementType": "labels.icon", "stylers": [{"visibility": "off"}] }, { "featureType": "administrative", "elementType": "all", "stylers": [{"visibility": "on"}] }, { "featureType": "administrative", "elementType": "geometry", "stylers": [{"weight": .6}, {"color": "#1a3541"}] }, { "featureType": "landscape", "elementType": "all", "stylers": [{"visibility": "on"}, {"color": "#293c4d"}] }, { "featureType": "landscape", "elementType": "geometry", "stylers": [{"color": "#2c5a71"}] }, { "featureType": "landscape", "elementType": "geometry.fill", "stylers": [{"color": "#293c4d"}] }, { "featureType": "poi", "elementType": "geometry", "stylers": [{"color": "#406d80"}] }, { "featureType": "poi.park", "elementType": "geometry", "stylers": [{"color": "#2c5a71"}] }, {"featureType": "road", "elementType": "all", "stylers": [{"visibility": "on"}]}, { "featureType": "road", "elementType": "geometry", "stylers": [{"color": "#1f3035"}, {"lightness": -37}] }, { "featureType": "road", "elementType": "labels", "stylers": [{"visibility": "on"}] }, { "featureType": "transit", "elementType": "all", "stylers": [{"visibility": "on"}] }, { "featureType": "transit", "elementType": "geometry", "stylers": [{"color": "#406d80"}] }, { "featureType": "transit", "elementType": "labels.icon", "stylers": [{"hue": "#00d1ff"}] }, {"featureType": "water", "elementType": "geometry", "stylers": [{"color": "#193341"}]}]; if (name == "style_riverside")style = [{ "featureType": "administrative", "elementType": "all", "stylers": [{"visibility": "off"}] }, { "featureType": "administrative", "elementType": "geometry.stroke", "stylers": [{"visibility": "on"}] }, { "featureType": "administrative", "elementType": "labels", "stylers": [{"visibility": "on"}, {"color": "#716464"}, {"weight": "0.01"}] }, { "featureType": "administrative.country", "elementType": "geometry", "stylers": [{"visibility": "on"}] }, { "featureType": "administrative.country", "elementType": "labels", "stylers": [{"visibility": "on"}] }, { "featureType": "administrative.country", "elementType": "labels.text", "stylers": [{"visibility": "off"}] }, { "featureType": "landscape", "elementType": "all", "stylers": [{"visibility": "simplified"}] }, { "featureType": "landscape.natural", "elementType": "geometry", "stylers": [{"visibility": "simplified"}] }, { "featureType": "landscape.natural.landcover", "elementType": "geometry", "stylers": [{"visibility": "simplified"}] }, { "featureType": "poi", "elementType": "all", "stylers": [{"visibility": "simplified"}] }, {"featureType": "poi", "elementType": "geometry.fill", "stylers": [{"visibility": "simplified"}]}, { "featureType": "poi", "elementType": "geometry.stroke", "stylers": [{"visibility": "simplified"}] }, { "featureType": "poi", "elementType": "labels.text", "stylers": [{"visibility": "simplified"}] }, { "featureType": "poi", "elementType": "labels.text.fill", "stylers": [{"visibility": "simplified"}] }, { "featureType": "poi", "elementType": "labels.text.stroke", "stylers": [{"visibility": "simplified"}] }, { "featureType": "poi.attraction", "elementType": "geometry", "stylers": [{"visibility": "on"}] }, { "featureType": "poi.business", "elementType": "geometry", "stylers": [{"visibility": "off"}] }, { "featureType": "poi.business", "elementType": "geometry.fill", "stylers": [{"visibility": "off"}] }, { "featureType": "poi.government", "elementType": "geometry", "stylers": [{"visibility": "off"}] }, { "featureType": "poi.park", "elementType": "geometry", "stylers": [{"visibility": "off"}] }, { "featureType": "poi.school", "elementType": "geometry", "stylers": [{"visibility": "off"}] }, {"featureType": "road", "elementType": "all", "stylers": [{"visibility": "on"}]}, { "featureType": "road.highway", "elementType": "all", "stylers": [{"visibility": "off"}] }, { "featureType": "road.highway", "elementType": "geometry", "stylers": [{"visibility": "on"}] }, { "featureType": "road.highway", "elementType": "geometry.fill", "stylers": [{"visibility": "on"}, {"color": "#787878"}] }, { "featureType": "road.highway", "elementType": "geometry.stroke", "stylers": [{"visibility": "simplified"}, {"color": "#a05519"}, {"saturation": "-13"}] }, { "featureType": "road.highway", "elementType": "labels.text", "stylers": [{"color": "#fcfcfc"}, {"visibility": "on"}] }, { "featureType": "road.highway", "elementType": "labels.text.fill", "stylers": [{"color": "#636363"}] }, { "featureType": "road.highway", "elementType": "labels.text.stroke", "stylers": [{"weight": "4.27"}, {"color": "#ffffff"}] }, { "featureType": "road.highway", "elementType": "labels.icon", "stylers": [{"visibility": "on"}, {"weight": "0.01"}] }, { "featureType": "road.local", "elementType": "all", "stylers": [{"visibility": "on"}] }, {"featureType": "transit", "elementType": "all", "stylers": [{"visibility": "simplified"}]}, { "featureType": "transit", "elementType": "geometry", "stylers": [{"visibility": "simplified"}] }, { "featureType": "transit.station", "elementType": "geometry", "stylers": [{"visibility": "on"}] }, { "featureType": "water", "elementType": "all", "stylers": [{"visibility": "simplified"}, {"color": "#84afa3"}, {"lightness": 52}] }, { "featureType": "water", "elementType": "geometry", "stylers": [{"visibility": "on"}] }, { "featureType": "water", "elementType": "geometry.fill", "stylers": [{"visibility": "on"}, {"color": "#7ca0a4"}] }, {"featureType": "water", "elementType": "labels.text.fill", "stylers": [{"color": "#ffffff"}]}]; if (name == "style_ozan")style = [{ "featureType": "administrative", "elementType": "labels.text.fill", "stylers": [{"visibility": "on"}, {"weight": 1}, {"color": "#003867"}] }, { "featureType": "administrative", "elementType": "labels.text.stroke", "stylers": [{"visibility": "on"}, {"weight": 8}] }, { "featureType": "road.highway", "elementType": "geometry", "stylers": [{"visibility": "on"}, {"color": "#E1001A"}, {"weight": .4}] }, { "featureType": "road.arterial", "elementType": "geometry", "stylers": [{"visibility": "on"}, {"color": "#edeff1"}, {"weight": .2}] }, { "featureType": "road.local", "elementType": "geometry", "stylers": [{"visibility": "on"}, {"color": "#edeff1"}, {"weight": .4}] }]; init_list_map(my_div_map, "", location_center, zoom, style); $(".st_list_map .map-view").removeClass("view"); $(".st-map-type").hide() }); init_list_map(my_div_map, data_show, location_center, zoom, style_map); function init_list_map(div_map, data_map, map_center, data_zoom, style_map) { var map = div_map; var markers = []; var bounds = new google.maps.LatLngBounds; data_zoom = parseInt(data_zoom); var options = { map: { options: { center: map_center, zoom: data_zoom, mapTypeId: google.maps.MapTypeId.TERRAIN, styles: style_map, navigationControl: !0, scrollwheel: !0, streetViewControl: !0, scaleControl: !0, mapTypeControl: !0, mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.DEFAULT, mapTypeIds: [google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.TERRAIN] }, draggable: !0, disableDefaultUI: !0, zoomControl: !1, zoomControlOptions: {style: google.maps.ZoomControlStyle.SMALL} }, events: { zoom_changed: function (map) { $(this).attr("data-zoom", map.getZoom()) }, tilesloaded: function (map) { jQuery("#st-gmap-loading").fadeOut(700); jQuery(".st-gmap-loading-bg").fadeOut(700) } } } }; var $container = $(window).width(); map.gmap3(options); var gmap_object = map.gmap3("get"); for (var key in data_map) { var tmp_data = data_map[key]; var myLatLng = new google.maps.LatLng(tmp_data.lat, tmp_data.lng); bounds.extend(myLatLng); var marker = ST_addMarker(myLatLng, gmap_object, tmp_data, map); markers.push(marker) } var mcOptions = { styles: [{ height: 53, url: st_list_map_params.cluster_m1, width: 53 }, {height: 56, url: st_list_map_params.cluster_m2, width: 56}, { height: 66, url: st_list_map_params.cluster_m3, width: 66 }, {height: 78, url: st_list_map_params.cluster_m4, width: 78}, { height: 90, url: st_list_map_params.cluster_m5, width: 90 }] }; var mc = new MarkerClusterer(gmap_object, markers, mcOptions); if (map.data("fitbounds") == "on") { var gmap_object = map.gmap3("get"); gmap_object.fitBounds(bounds) } } function ST_addMarker(location, gmap_object, tmp_data, map) { var marker = new google.maps.Marker({ position: location, options: { icon: tmp_data.icon_mk, animation: google.maps.Animation.DROP }, tag: "st_tag_" + tmp_data.id, data: tmp_data }); marker.addListener("click", function () { gmap_object.panTo(location); map.gmap3({clear: "overlay"}, { overlay: { pane: "floatPane", latLng: location, options: {content: tmp_data.content_html, offset: {x: 20, y: -210}} } }); setTimeout(function () { $(map).find(".st-popup-gallery").each(function () { $(this).magnificPopup({delegate: ".st-gp-item", type: "image", gallery: {enabled: !0}}) }) }, 200) }); return marker } }) } }); jQuery(function ($) { if ($(".st_list_map_new_data").length > 0) { var me = $(".st_list_map_new_data"); var my_div_map = jQuery("#list_map_new"); var data_show = me.data("data_show"); var map_height = me.data("map_height"); var style_map = me.data("style_map"); var type_map = me.data("type_map"); var street_views = me.data("street_views"); var height = me.data("height"); var location_center = me.data("location_center"); var zoom = me.data("zoom"); var range = me.data("range"); $(function () { $(".st_list_map_new .map-view").on('click', function () { if ($(this).hasClass("view")) { $(this).removeClass("view"); $(".st_list_map_new").find(".st-map-type").hide() } else { $(this).addClass("view"); $(".st_list_map_new").find(".st-map-type").show() } }); $(".st_list_map_new .st-map-type").on('click', function () { var name = $(this).data("name"); var style = ""; if (name == "style_normal")style = [{ featureType: "road.highway", elementType: "geometry", stylers: [{hue: "#ff0022"}, {saturation: 60}, {lightness: -20}] }]; if (name == "style_midnight")style = [{ "featureType": "all", "elementType": "labels.text.fill", "stylers": [{"saturation": 36}, {"color": "#000000"}, {"lightness": 40}] }, { "featureType": "all", "elementType": "labels.text.stroke", "stylers": [{"visibility": "on"}, {"color": "#000000"}, {"lightness": 16}] }, { "featureType": "all", "elementType": "labels.icon", "stylers": [{"visibility": "off"}] }, { "featureType": "administrative", "elementType": "geometry.fill", "stylers": [{"color": "#000000"}, {"lightness": 20}] }, { "featureType": "administrative", "elementType": "geometry.stroke", "stylers": [{"color": "#000000"}, {"lightness": 17}, {"weight": 1.2}] }, { "featureType": "administrative.country", "elementType": "labels", "stylers": [{"visibility": "on"}, {"lightness": "0"}] }, { "featureType": "administrative.country", "elementType": "labels.text.fill", "stylers": [{"visibility": "on"}, {"lightness": "13"}] }, { "featureType": "landscape", "elementType": "geometry", "stylers": [{"color": "#000000"}, {"lightness": 20}] }, { "featureType": "poi", "elementType": "geometry", "stylers": [{"color": "#000000"}, {"lightness": 21}] }, { "featureType": "road", "elementType": "all", "stylers": [{"visibility": "on"}, {"saturation": "-100"}, {"lightness": "-20"}, {"invert_lightness": !0}] }, { "featureType": "road", "elementType": "geometry.stroke", "stylers": [{"color": "#bebebe"}] }, { "featureType": "road", "elementType": "labels.text.fill", "stylers": [{"visibility": "on"}, {"lightness": "-47"}] }, { "featureType": "road", "elementType": "labels.text.stroke", "stylers": [{"lightness": "-33"}, {"weight": "0.52"}] }, {"featureType": "road.highway", "elementType": "all", "stylers": [{"visibility": "on"}]}, { "featureType": "road.highway", "elementType": "geometry", "stylers": [{"visibility": "on"}, {"color": "#b5b5b5"}, {"saturation": "-1"}, {"gamma": "0.00"}, {"weight": "2.22"}] }, { "featureType": "road.highway", "elementType": "geometry.fill", "stylers": [{"lightness": "0"}, {"visibility": "on"}, {"weight": "2.8"}, {"color": "#585858"}] }, { "featureType": "road.highway", "elementType": "geometry.stroke", "stylers": [{"color": "#909090"}, {"lightness": "2"}, {"weight": "0.2"}, {"visibility": "off"}] }, { "featureType": "road.highway", "elementType": "labels.text.fill", "stylers": [{"lightness": "16"}, {"color": "#595959"}] }, { "featureType": "road.highway", "elementType": "labels.text.stroke", "stylers": [{"lightness": "-63"}, {"weight": "1"}] }, { "featureType": "road.arterial", "elementType": "geometry", "stylers": [{"color": "#000000"}, {"lightness": 18}, {"visibility": "on"}] }, { "featureType": "road.arterial", "elementType": "geometry.fill", "stylers": [{"visibility": "on"}, {"lightness": "10"}] }, { "featureType": "road.arterial", "elementType": "labels.text.fill", "stylers": [{"visibility": "on"}, {"lightness": "28"}] }, { "featureType": "road.arterial", "elementType": "labels.text.stroke", "stylers": [{"visibility": "on"}, {"weight": "0.1"}, {"lightness": "-96"}] }, { "featureType": "road.local", "elementType": "geometry", "stylers": [{"color": "#000000"}, {"lightness": 16}] }, { "featureType": "transit", "elementType": "geometry", "stylers": [{"color": "#000000"}, {"lightness": 19}] }, { "featureType": "water", "elementType": "geometry", "stylers": [{"color": "#12161a"}, {"lightness": 17}] }]; if (name == "style_family_fest")style = [{ "featureType": "administrative", "elementType": "labels.text.fill", "stylers": [{"color": "#444444"}] }, { "featureType": "landscape", "elementType": "all", "stylers": [{"color": "#f2f2f2"}] }, { "featureType": "poi", "elementType": "all", "stylers": [{"visibility": "off"}] }, { "featureType": "poi", "elementType": "geometry.fill", "stylers": [{"visibility": "on"}, {"saturation": "-6"}] }, { "featureType": "poi", "elementType": "geometry.stroke", "stylers": [{"visibility": "on"}] }, { "featureType": "poi", "elementType": "labels", "stylers": [{"visibility": "on"}, {"weight": "1.30"}] }, {"featureType": "poi", "elementType": "labels.text", "stylers": [{"visibility": "on"}]}, { "featureType": "poi", "elementType": "labels.text.fill", "stylers": [{"visibility": "on"}] }, { "featureType": "poi", "elementType": "labels.icon", "stylers": [{"visibility": "on"}] }, { "featureType": "road", "elementType": "all", "stylers": [{"saturation": -100}, {"lightness": 45}] }, { "featureType": "road.highway", "elementType": "all", "stylers": [{"visibility": "simplified"}] }, { "featureType": "road.arterial", "elementType": "labels.icon", "stylers": [{"visibility": "off"}] }, {"featureType": "transit", "elementType": "all", "stylers": [{"visibility": "off"}]}, { "featureType": "water", "elementType": "all", "stylers": [{"color": "#52978e"}, {"visibility": "on"}] }]; if (name == "style_open_dark")style = [{ "featureType": "all", "elementType": "labels.text.fill", "stylers": [{"color": "#ffffff"}] }, { "featureType": "all", "elementType": "labels.text.stroke", "stylers": [{"visibility": "on"}, {"color": "#3e606f"}, {"weight": 2}, {"gamma": .84}] }, { "featureType": "all", "elementType": "labels.icon", "stylers": [{"visibility": "off"}] }, {"featureType": "administrative", "elementType": "all", "stylers": [{"visibility": "on"}]}, { "featureType": "administrative", "elementType": "geometry", "stylers": [{"weight": .6}, {"color": "#1a3541"}] }, { "featureType": "landscape", "elementType": "all", "stylers": [{"visibility": "on"}, {"color": "#293c4d"}] }, { "featureType": "landscape", "elementType": "geometry", "stylers": [{"color": "#2c5a71"}] }, { "featureType": "landscape", "elementType": "geometry.fill", "stylers": [{"color": "#293c4d"}] }, {"featureType": "poi", "elementType": "geometry", "stylers": [{"color": "#406d80"}]}, { "featureType": "poi.park", "elementType": "geometry", "stylers": [{"color": "#2c5a71"}] }, { "featureType": "road", "elementType": "all", "stylers": [{"visibility": "on"}] }, { "featureType": "road", "elementType": "geometry", "stylers": [{"color": "#1f3035"}, {"lightness": -37}] }, { "featureType": "road", "elementType": "labels", "stylers": [{"visibility": "on"}] }, { "featureType": "transit", "elementType": "all", "stylers": [{"visibility": "on"}] }, { "featureType": "transit", "elementType": "geometry", "stylers": [{"color": "#406d80"}] }, {"featureType": "transit", "elementType": "labels.icon", "stylers": [{"hue": "#00d1ff"}]}, {"featureType": "water", "elementType": "geometry", "stylers": [{"color": "#193341"}]}]; if (name == "style_riverside")style = [{ "featureType": "administrative", "elementType": "all", "stylers": [{"visibility": "off"}] }, { "featureType": "administrative", "elementType": "geometry.stroke", "stylers": [{"visibility": "on"}] }, { "featureType": "administrative", "elementType": "labels", "stylers": [{"visibility": "on"}, {"color": "#716464"}, {"weight": "0.01"}] }, { "featureType": "administrative.country", "elementType": "geometry", "stylers": [{"visibility": "on"}] }, { "featureType": "administrative.country", "elementType": "labels", "stylers": [{"visibility": "on"}] }, { "featureType": "administrative.country", "elementType": "labels.text", "stylers": [{"visibility": "off"}] }, { "featureType": "landscape", "elementType": "all", "stylers": [{"visibility": "simplified"}] }, { "featureType": "landscape.natural", "elementType": "geometry", "stylers": [{"visibility": "simplified"}] }, { "featureType": "landscape.natural.landcover", "elementType": "geometry", "stylers": [{"visibility": "simplified"}] }, { "featureType": "poi", "elementType": "all", "stylers": [{"visibility": "simplified"}] }, { "featureType": "poi", "elementType": "geometry.fill", "stylers": [{"visibility": "simplified"}] }, { "featureType": "poi", "elementType": "geometry.stroke", "stylers": [{"visibility": "simplified"}] }, { "featureType": "poi", "elementType": "labels.text", "stylers": [{"visibility": "simplified"}] }, { "featureType": "poi", "elementType": "labels.text.fill", "stylers": [{"visibility": "simplified"}] }, { "featureType": "poi", "elementType": "labels.text.stroke", "stylers": [{"visibility": "simplified"}] }, { "featureType": "poi.attraction", "elementType": "geometry", "stylers": [{"visibility": "on"}] }, { "featureType": "poi.business", "elementType": "geometry", "stylers": [{"visibility": "off"}] }, { "featureType": "poi.business", "elementType": "geometry.fill", "stylers": [{"visibility": "off"}] }, { "featureType": "poi.government", "elementType": "geometry", "stylers": [{"visibility": "off"}] }, {"featureType": "poi.park", "elementType": "geometry", "stylers": [{"visibility": "off"}]}, { "featureType": "poi.school", "elementType": "geometry", "stylers": [{"visibility": "off"}] }, { "featureType": "road", "elementType": "all", "stylers": [{"visibility": "on"}] }, { "featureType": "road.highway", "elementType": "all", "stylers": [{"visibility": "off"}] }, { "featureType": "road.highway", "elementType": "geometry", "stylers": [{"visibility": "on"}] }, { "featureType": "road.highway", "elementType": "geometry.fill", "stylers": [{"visibility": "on"}, {"color": "#787878"}] }, { "featureType": "road.highway", "elementType": "geometry.stroke", "stylers": [{"visibility": "simplified"}, {"color": "#a05519"}, {"saturation": "-13"}] }, { "featureType": "road.highway", "elementType": "labels.text", "stylers": [{"color": "#fcfcfc"}, {"visibility": "on"}] }, { "featureType": "road.highway", "elementType": "labels.text.fill", "stylers": [{"color": "#636363"}] }, { "featureType": "road.highway", "elementType": "labels.text.stroke", "stylers": [{"weight": "4.27"}, {"color": "#ffffff"}] }, { "featureType": "road.highway", "elementType": "labels.icon", "stylers": [{"visibility": "on"}, {"weight": "0.01"}] }, { "featureType": "road.local", "elementType": "all", "stylers": [{"visibility": "on"}] }, { "featureType": "transit", "elementType": "all", "stylers": [{"visibility": "simplified"}] }, { "featureType": "transit", "elementType": "geometry", "stylers": [{"visibility": "simplified"}] }, { "featureType": "transit.station", "elementType": "geometry", "stylers": [{"visibility": "on"}] }, { "featureType": "water", "elementType": "all", "stylers": [{"visibility": "simplified"}, {"color": "#84afa3"}, {"lightness": 52}] }, {"featureType": "water", "elementType": "geometry", "stylers": [{"visibility": "on"}]}, { "featureType": "water", "elementType": "geometry.fill", "stylers": [{"visibility": "on"}, {"color": "#7ca0a4"}] }, {"featureType": "water", "elementType": "labels.text.fill", "stylers": [{"color": "#ffffff"}]}]; if (name == "style_ozan")style = [{ "featureType": "administrative", "elementType": "labels.text.fill", "stylers": [{"visibility": "on"}, {"weight": 1}, {"color": "#003867"}] }, { "featureType": "administrative", "elementType": "labels.text.stroke", "stylers": [{"visibility": "on"}, {"weight": 8}] }, { "featureType": "road.highway", "elementType": "geometry", "stylers": [{"visibility": "on"}, {"color": "#E1001A"}, {"weight": .4}] }, { "featureType": "road.arterial", "elementType": "geometry", "stylers": [{"visibility": "on"}, {"color": "#edeff1"}, {"weight": .2}] }, { "featureType": "road.local", "elementType": "geometry", "stylers": [{"visibility": "on"}, {"color": "#edeff1"}, {"weight": .4}] }]; my_div_map.attr("data-circle-color", "transparent"); var map_g = my_div_map.gmap3("get"); var map_center = map_g.getCenter(); var map_zoom = map_g.getZoom(); init_list_map(my_div_map, "", map_center, map_zoom, style); map_g.panTo(map_center); map_g.setZoom(map_zoom); $(".st_list_map_new .map-view").removeClass("view"); $(".st-map-type").hide() }); init_list_map(my_div_map, data_show, location_center, zoom, type_map); $('.location_tab ul li a[data-toggle="tab"]').on("click", function () { setTimeout(function () { if($('#list_map_new iframe' ).length) { var iframe = $('#list_map_new iframe').get(0); iframe.src = iframe.src; } }, 1000); }); function init_list_map(div_map, data_map, map_center, data_zoom, style_map) { var map = div_map; var bounds = new google.maps.LatLngBounds; var markers = []; data_zoom = parseInt(data_zoom); var range = 10; var options = { map: { options: { center: location_center, zoom: data_zoom, mapTypeId: google.maps.MapTypeId.ROADMAP, styles: style_map, navigationControl: !0, scrollwheel: !1, streetViewControl: !0, scaleControl: !0, mapTypeControl: !0, mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.DEFAULT, mapTypeIds: [google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.TERRAIN] }, disableDefaultUI: !0, zoomControl: !1, zoomControlOptions: {style: google.maps.ZoomControlStyle.SMALL} }, events: { zoom_changed: function (map) { $(this).attr("data-zoom", map.getZoom()) }, tilesloaded: function (map) { var is_check_room = $(this).attr("data-check-zoom"); var tmp_zoom = map.getZoom(); if (tmp_zoom > data_zoom && is_check_room == "true")map.setZoom(data_zoom); $(this).attr("data-check-zoom", "false"); jQuery("#st-gmap-loading").fadeOut(700); jQuery(".st-gmap-loading-bg").fadeOut(700) } } }, circle: { options: { center: location_center, radius: range * 1E3, fillColor: map.attr("data-circle-color"), strokeColor: "transparent" } } }; var $container = $(window).width(); if ($container < 520) { options.map.options.draggable = !1 } map.gmap3(options); var gmap_object = map.gmap3("get"); for (var key in data_map) { var tmp_data = data_map[key]; var myLatLng = new google.maps.LatLng(tmp_data.lat, tmp_data.lng); bounds.extend(myLatLng); var marker = ST_addMarker(myLatLng, gmap_object, tmp_data, map); markers.push(marker) } var mcOptions = { styles: [{height: 53, url: st_list_map_params.cluster_m1, width: 53}, { height: 56, url: st_list_map_params.cluster_m2, width: 56 }, {height: 66, url: st_list_map_params.cluster_m3, width: 66}, { height: 78, url: st_list_map_params.cluster_m4, width: 78 }, { height: 90, url: st_list_map_params.cluster_m5, width: 90 }] }; var mc = new MarkerClusterer(gmap_object, markers, mcOptions); var gmap_object = map.gmap3("get"); gmap_object.fitBounds(bounds); function ST_addMarker(location, gmap_object, tmp_data, map) { var marker = new google.maps.Marker({ position: location, options: {icon: tmp_data.icon_mk, animation: google.maps.Animation.DROP}, tag: "st_tag_" + tmp_data.id, data: tmp_data }); marker.addListener("click", function () { gmap_object.panTo(location); map.gmap3({clear: "overlay"}, { overlay: { pane: "floatPane", latLng: location, options: { content: tmp_data.content_html, offset: {x: 20, y: -210} } } }); setTimeout(function () { $(map).find(".st-popup-gallery").each(function () { $(this).magnificPopup({delegate: ".st-gp-item", type: "image", gallery: {enabled: !0}}) }) }, 200) }); return marker } } }) } }); jQuery(function ($) { if ($(".st_list_half_map_before").length > 0) { var map_full_height = parseInt($(window).height()); if ($("#st_header_wrap").length)map_full_height -= $("#st_header_wrap").outerHeight(!0); if ($("body>.global-wrap.container").length)map_full_height -= parseInt($("body>.global-wrap.container").css("margin-bottom").replace("px", "")); if ($("#main-footer").length) { map_full_height -= $("#main-footer").outerHeight(); $("#main-footer").addClass("mt0") } if ($("#wpadminbar").length)map_full_height -= $("#wpadminbar").outerHeight(!0); if (map_full_height < 500)map_full_height = 480; var map_height = $(".st_list_half_map_before").data("map_height"); if (map_height == "map_full_height")map_height = map_full_height; $(".div_half_map, .half_map_container .st_gmap , .st_list_half_map , .content_map ,#list_half_map").height(map_height) } }); jQuery(function ($) { if ($(".st_list_half_map_data").length > 0)jQuery(function ($) { var me = $(".st_list_half_map_data"); var auto_height = me.data("auto_height"); var height = me.data("height"); var data_show = me.data("data_map"); var style_map = me.data("style_map"); var map_zoom = me.data("zoom"); var location_center = me.data("location_center"); var fit_bounds = me.data("fit_bounds"); var map_full_height = parseInt($(window).height()); if ($("#st_header_wrap").length)map_full_height -= $("#st_header_wrap").outerHeight(!0); if ($("#main-footer").length) { map_full_height -= $("#main-footer").outerHeight(); $("#main-footer").addClass("mt0") } if ($("#wpadminbar").length)map_full_height -= $("#wpadminbar").outerHeight(!0); var map_height = map_full_height; if (auto_height == "fixed")var map_height = height; var my_div_map = jQuery("#list_half_map"); var hotel_search_half_map = $("#hotel_search_half_map"); $("#hotel_search_half_map .btn_search").on('click', function () { var $this = $(this); var options = { url: st_params.ajax_url, dataType: "json", beforeSend: function () { jQuery("#st-gmap-loading").show(); jQuery(".st-gmap-loading-bg").show(); $this.html(st_params.text_loading); $(".data_list_hafl_map").css("opacity", "0.5"); $(".data_list_hafl_map").trigger("st_load_halfmap") }, success: function (data) { $("#list_half_map").gmap3({action: "destroy"}); var container = $("#list_half_map").parent(); $("#list_half_map").remove(); container.append('<div id="list_half_map"></div>'); $("#list_half_map").height(map_height); $("#list_half_map").attr("data-fitbounds", fit_bounds); if (data.location_center == "[0,0]")$("#list_map").attr("data-fitbounds", "on"); location_center = [data.map_lat_center, data.map_lng_center]; init_list_half_map($("#list_half_map"), data.data_map, location_center, data.zoom, style_map); $(".data_list_hafl_map .content").html(""); var count = 0; for (var key in data.data_map) { var tmp_data = data.data_map[key]; $(".data_list_hafl_map .content").append('<div class="col-md-6">' + tmp_data.content_adv_html + "</div>"); count++ } $(".count_advan_saerch").html("(" + count + ")"); if (count == 0)$(".data_list_hafl_map .content").append('<div class="alert alert-warning"> <button data-dismiss="alert" type="button" class="close"><span aria-hidden="true">\u00d7</span> </button> <p class="text-small">' + st_list_map_params.text_no_result + "</p> </div>"); setTimeout(function () { $(".data_list_hafl_map").css("opacity", "1") }, 500); $this.html($this.data("title")); }, complete: function () { jQuery("#st-gmap-loading").fadeOut(700); jQuery(".st-gmap-loading-bg").fadeOut(700) } }; hotel_search_half_map.ajaxForm(options) }); $(".st_list_half_map .map-view").on('click', function () { if ($(this).hasClass("view")) { $(this).removeClass("view"); $(".st_list_half_map").find(".st-map-type").hide() } else { $(this).addClass("view"); $(".st_list_half_map").find(".st-map-type").show() } }); $(".st_list_half_map .st-map-type").on('click', function () { var name = $(this).data("name"); var style = ""; if (name == "style_normal")style = [{ featureType: "road.highway", elementType: "geometry", stylers: [{hue: "#ff0022"}, {saturation: 60}, {lightness: -20}] }]; if (name == "style_midnight")style = [{ "featureType": "all", "elementType": "labels.text.fill", "stylers": [{"saturation": 36}, {"color": "#000000"}, {"lightness": 40}] }, { "featureType": "all", "elementType": "labels.text.stroke", "stylers": [{"visibility": "on"}, {"color": "#000000"}, {"lightness": 16}] }, { "featureType": "all", "elementType": "labels.icon", "stylers": [{"visibility": "off"}] }, { "featureType": "administrative", "elementType": "geometry.fill", "stylers": [{"color": "#000000"}, {"lightness": 20}] }, { "featureType": "administrative", "elementType": "geometry.stroke", "stylers": [{"color": "#000000"}, {"lightness": 17}, {"weight": 1.2}] }, { "featureType": "administrative.country", "elementType": "labels", "stylers": [{"visibility": "on"}, {"lightness": "0"}] }, { "featureType": "administrative.country", "elementType": "labels.text.fill", "stylers": [{"visibility": "on"}, {"lightness": "13"}] }, { "featureType": "landscape", "elementType": "geometry", "stylers": [{"color": "#000000"}, {"lightness": 20}] }, { "featureType": "poi", "elementType": "geometry", "stylers": [{"color": "#000000"}, {"lightness": 21}] }, { "featureType": "road", "elementType": "all", "stylers": [{"visibility": "on"}, {"saturation": "-100"}, {"lightness": "-20"}, {"invert_lightness": !0}] }, {"featureType": "road", "elementType": "geometry.stroke", "stylers": [{"color": "#bebebe"}]}, { "featureType": "road", "elementType": "labels.text.fill", "stylers": [{"visibility": "on"}, {"lightness": "-47"}] }, { "featureType": "road", "elementType": "labels.text.stroke", "stylers": [{"lightness": "-33"}, {"weight": "0.52"}] }, { "featureType": "road.highway", "elementType": "all", "stylers": [{"visibility": "on"}] }, { "featureType": "road.highway", "elementType": "geometry", "stylers": [{"visibility": "on"}, {"color": "#b5b5b5"}, {"saturation": "-1"}, {"gamma": "0.00"}, {"weight": "2.22"}] }, { "featureType": "road.highway", "elementType": "geometry.fill", "stylers": [{"lightness": "0"}, {"visibility": "on"}, {"weight": "2.8"}, {"color": "#585858"}] }, { "featureType": "road.highway", "elementType": "geometry.stroke", "stylers": [{"color": "#909090"}, {"lightness": "2"}, {"weight": "0.2"}, {"visibility": "off"}] }, { "featureType": "road.highway", "elementType": "labels.text.fill", "stylers": [{"lightness": "16"}, {"color": "#595959"}] }, { "featureType": "road.highway", "elementType": "labels.text.stroke", "stylers": [{"lightness": "-63"}, {"weight": "1"}] }, { "featureType": "road.arterial", "elementType": "geometry", "stylers": [{"color": "#000000"}, {"lightness": 18}, {"visibility": "on"}] }, { "featureType": "road.arterial", "elementType": "geometry.fill", "stylers": [{"visibility": "on"}, {"lightness": "10"}] }, { "featureType": "road.arterial", "elementType": "labels.text.fill", "stylers": [{"visibility": "on"}, {"lightness": "28"}] }, { "featureType": "road.arterial", "elementType": "labels.text.stroke", "stylers": [{"visibility": "on"}, {"weight": "0.1"}, {"lightness": "-96"}] }, { "featureType": "road.local", "elementType": "geometry", "stylers": [{"color": "#000000"}, {"lightness": 16}] }, { "featureType": "transit", "elementType": "geometry", "stylers": [{"color": "#000000"}, {"lightness": 19}] }, { "featureType": "water", "elementType": "geometry", "stylers": [{"color": "#12161a"}, {"lightness": 17}] }]; if (name == "style_family_fest")style = [{ "featureType": "administrative", "elementType": "labels.text.fill", "stylers": [{"color": "#444444"}] }, { "featureType": "landscape", "elementType": "all", "stylers": [{"color": "#f2f2f2"}] }, {"featureType": "poi", "elementType": "all", "stylers": [{"visibility": "off"}]}, { "featureType": "poi", "elementType": "geometry.fill", "stylers": [{"visibility": "on"}, {"saturation": "-6"}] }, { "featureType": "poi", "elementType": "geometry.stroke", "stylers": [{"visibility": "on"}] }, { "featureType": "poi", "elementType": "labels", "stylers": [{"visibility": "on"}, {"weight": "1.30"}] }, { "featureType": "poi", "elementType": "labels.text", "stylers": [{"visibility": "on"}] }, { "featureType": "poi", "elementType": "labels.text.fill", "stylers": [{"visibility": "on"}] }, {"featureType": "poi", "elementType": "labels.icon", "stylers": [{"visibility": "on"}]}, { "featureType": "road", "elementType": "all", "stylers": [{"saturation": -100}, {"lightness": 45}] }, { "featureType": "road.highway", "elementType": "all", "stylers": [{"visibility": "simplified"}] }, { "featureType": "road.arterial", "elementType": "labels.icon", "stylers": [{"visibility": "off"}] }, { "featureType": "transit", "elementType": "all", "stylers": [{"visibility": "off"}] }, { "featureType": "water", "elementType": "all", "stylers": [{"color": "#52978e"}, {"visibility": "on"}] }]; if (name == "style_open_dark")style = [{ "featureType": "all", "elementType": "labels.text.fill", "stylers": [{"color": "#ffffff"}] }, { "featureType": "all", "elementType": "labels.text.stroke", "stylers": [{"visibility": "on"}, {"color": "#3e606f"}, {"weight": 2}, {"gamma": .84}] }, { "featureType": "all", "elementType": "labels.icon", "stylers": [{"visibility": "off"}] }, { "featureType": "administrative", "elementType": "all", "stylers": [{"visibility": "on"}] }, { "featureType": "administrative", "elementType": "geometry", "stylers": [{"weight": .6}, {"color": "#1a3541"}] }, { "featureType": "landscape", "elementType": "all", "stylers": [{"visibility": "on"}, {"color": "#293c4d"}] }, { "featureType": "landscape", "elementType": "geometry", "stylers": [{"color": "#2c5a71"}] }, { "featureType": "landscape", "elementType": "geometry.fill", "stylers": [{"color": "#293c4d"}] }, { "featureType": "poi", "elementType": "geometry", "stylers": [{"color": "#406d80"}] }, { "featureType": "poi.park", "elementType": "geometry", "stylers": [{"color": "#2c5a71"}] }, {"featureType": "road", "elementType": "all", "stylers": [{"visibility": "on"}]}, { "featureType": "road", "elementType": "geometry", "stylers": [{"color": "#1f3035"}, {"lightness": -37}] }, { "featureType": "road", "elementType": "labels", "stylers": [{"visibility": "on"}] }, { "featureType": "transit", "elementType": "all", "stylers": [{"visibility": "on"}] }, { "featureType": "transit", "elementType": "geometry", "stylers": [{"color": "#406d80"}] }, { "featureType": "transit", "elementType": "labels.icon", "stylers": [{"hue": "#00d1ff"}] }, {"featureType": "water", "elementType": "geometry", "stylers": [{"color": "#193341"}]}]; if (name == "style_riverside")style = [{ "featureType": "administrative", "elementType": "all", "stylers": [{"visibility": "off"}] }, { "featureType": "administrative", "elementType": "geometry.stroke", "stylers": [{"visibility": "on"}] }, { "featureType": "administrative", "elementType": "labels", "stylers": [{"visibility": "on"}, {"color": "#716464"}, {"weight": "0.01"}] }, { "featureType": "administrative.country", "elementType": "geometry", "stylers": [{"visibility": "on"}] }, { "featureType": "administrative.country", "elementType": "labels", "stylers": [{"visibility": "on"}] }, { "featureType": "administrative.country", "elementType": "labels.text", "stylers": [{"visibility": "off"}] }, { "featureType": "landscape", "elementType": "all", "stylers": [{"visibility": "simplified"}] }, { "featureType": "landscape.natural", "elementType": "geometry", "stylers": [{"visibility": "simplified"}] }, { "featureType": "landscape.natural.landcover", "elementType": "geometry", "stylers": [{"visibility": "simplified"}] }, {"featureType": "poi", "elementType": "all", "stylers": [{"visibility": "simplified"}]}, { "featureType": "poi", "elementType": "geometry.fill", "stylers": [{"visibility": "simplified"}] }, { "featureType": "poi", "elementType": "geometry.stroke", "stylers": [{"visibility": "simplified"}] }, { "featureType": "poi", "elementType": "labels.text", "stylers": [{"visibility": "simplified"}] }, { "featureType": "poi", "elementType": "labels.text.fill", "stylers": [{"visibility": "simplified"}] }, { "featureType": "poi", "elementType": "labels.text.stroke", "stylers": [{"visibility": "simplified"}] }, { "featureType": "poi.attraction", "elementType": "geometry", "stylers": [{"visibility": "on"}] }, { "featureType": "poi.business", "elementType": "geometry", "stylers": [{"visibility": "off"}] }, { "featureType": "poi.business", "elementType": "geometry.fill", "stylers": [{"visibility": "off"}] }, { "featureType": "poi.government", "elementType": "geometry", "stylers": [{"visibility": "off"}] }, { "featureType": "poi.park", "elementType": "geometry", "stylers": [{"visibility": "off"}] }, {"featureType": "poi.school", "elementType": "geometry", "stylers": [{"visibility": "off"}]}, { "featureType": "road", "elementType": "all", "stylers": [{"visibility": "on"}] }, { "featureType": "road.highway", "elementType": "all", "stylers": [{"visibility": "off"}] }, { "featureType": "road.highway", "elementType": "geometry", "stylers": [{"visibility": "on"}] }, { "featureType": "road.highway", "elementType": "geometry.fill", "stylers": [{"visibility": "on"}, {"color": "#787878"}] }, { "featureType": "road.highway", "elementType": "geometry.stroke", "stylers": [{"visibility": "simplified"}, {"color": "#a05519"}, {"saturation": "-13"}] }, { "featureType": "road.highway", "elementType": "labels.text", "stylers": [{"color": "#fcfcfc"}, {"visibility": "on"}] }, { "featureType": "road.highway", "elementType": "labels.text.fill", "stylers": [{"color": "#636363"}] }, { "featureType": "road.highway", "elementType": "labels.text.stroke", "stylers": [{"weight": "4.27"}, {"color": "#ffffff"}] }, { "featureType": "road.highway", "elementType": "labels.icon", "stylers": [{"visibility": "on"}, {"weight": "0.01"}] }, {"featureType": "road.local", "elementType": "all", "stylers": [{"visibility": "on"}]}, { "featureType": "transit", "elementType": "all", "stylers": [{"visibility": "simplified"}] }, { "featureType": "transit", "elementType": "geometry", "stylers": [{"visibility": "simplified"}] }, { "featureType": "transit.station", "elementType": "geometry", "stylers": [{"visibility": "on"}] }, { "featureType": "water", "elementType": "all", "stylers": [{"visibility": "simplified"}, {"color": "#84afa3"}, {"lightness": 52}] }, {"featureType": "water", "elementType": "geometry", "stylers": [{"visibility": "on"}]}, { "featureType": "water", "elementType": "geometry.fill", "stylers": [{"visibility": "on"}, {"color": "#7ca0a4"}] }, {"featureType": "water", "elementType": "labels.text.fill", "stylers": [{"color": "#ffffff"}]}]; if (name == "style_ozan")style = [{ "featureType": "administrative", "elementType": "labels.text.fill", "stylers": [{"visibility": "on"}, {"weight": 1}, {"color": "#003867"}] }, { "featureType": "administrative", "elementType": "labels.text.stroke", "stylers": [{"visibility": "on"}, {"weight": 8}] }, { "featureType": "road.highway", "elementType": "geometry", "stylers": [{"visibility": "on"}, {"color": "#E1001A"}, {"weight": .4}] }, { "featureType": "road.arterial", "elementType": "geometry", "stylers": [{"visibility": "on"}, {"color": "#edeff1"}, {"weight": .2}] }, { "featureType": "road.local", "elementType": "geometry", "stylers": [{"visibility": "on"}, {"color": "#edeff1"}, {"weight": .4}] }]; init_list_half_map(my_div_map, "", location_center, map_zoom, style); $(".st_list_half_map .map-view").removeClass("view"); $(".st-map-type").hide() }); init_list_half_map($("#list_half_map"), data_show, location_center, map_zoom, style_map); function init_list_half_map(div_map, data_map, map_center, data_zoom, style) { var map = div_map; var list = []; var markers = []; data_zoom = parseInt(data_zoom); var bounds = new google.maps.LatLngBounds; var options = { map: { options: { center: map_center, zoom: data_zoom, mapTypeId: google.maps.MapTypeId.ROADMAP, styles: style, disableDefaultUI: !0, zoomControl: !1, navigationControl: !0, scrollwheel: !1, streetViewControl: !0, scaleControl: !0, mapTypeControl: !0 }, events: { zoom_changed: function (map) { $(this).attr("data-zoom", map.getZoom()) }, tilesloaded: function (map) { jQuery("#st-gmap-loading").fadeOut(700); jQuery(".st-gmap-loading-bg").fadeOut(700) } } }, marker: { values: list, events: { mouseover: function (marker, event, context) { }, mouseout: function (marker, event, context) { }, click: function (marker, event, context) { var zoom = parseInt(map.attr("data-zoom")); if (!zoom)zoom = data_zoom; var map_g = $(this).gmap3("get"); map_g.panTo(marker.getPosition()); $(this).gmap3({clear: "overlay"}, { overlay: { pane: "floatPane", latLng: marker.getPosition(), options: {content: context.data.content_html, offset: {x: 20, y: -210}} } }); setTimeout(function () { $(div_map).find(".st-popup-gallery").each(function () { $(this).magnificPopup({ delegate: ".st-gp-item", type: "image", gallery: {enabled: !0} }) }) }, 200) } } } }; var $container = $(window).width(); map.gmap3(options); var gmap_object = map.gmap3("get"); for (var key in data_map) { var tmp_data = data_map[key]; var myLatLng = new google.maps.LatLng(tmp_data.lat, tmp_data.lng); bounds.extend(myLatLng); list.push({ latLng: [tmp_data.lat, tmp_data.lng], options: {icon: tmp_data.icon_mk}, tag: "st_tag_" + tmp_data.id, data: tmp_data }); var marker = ST_addMarker(myLatLng, gmap_object, tmp_data, map); markers.push(marker) } if (map.data("fitbounds") == "on") { var gmap_object = map.gmap3("get"); gmap_object.fitBounds(bounds) } var mcOptions = { styles: [{height: 53, url: st_list_map_params.cluster_m1, width: 53}, { height: 56, url: st_list_map_params.cluster_m2, width: 56 }, {height: 66, url: st_list_map_params.cluster_m3, width: 66}, { height: 78, url: st_list_map_params.cluster_m4, width: 78 }, {height: 90, url: st_list_map_params.cluster_m5, width: 90}] }; var mc = new MarkerClusterer(gmap_object, markers, mcOptions); function ST_addMarker(location, gmap_object, tmp_data, map) { var marker = new google.maps.Marker({ position: location, options: {icon: tmp_data.icon_mk, animation: google.maps.Animation.DROP}, tag: "st_tag_" + tmp_data.id, data: tmp_data }); marker.addListener("click", function () { gmap_object.panTo(location); map.gmap3({clear: "overlay"}, { overlay: { pane: "floatPane", latLng: location, options: {content: tmp_data.content_html, offset: {x: 20, y: -210}} } }); setTimeout(function () { $(map).find(".st-popup-gallery").each(function () { $(this).magnificPopup({ delegate: ".st-gp-item", type: "image", gallery: {enabled: !0} }) }) }, 200) }); return marker } } }) }); jQuery(function ($) { var lat = $(".st-room-map").data("lat"); var lng = $(".st-room-map").data("lng"); var zoom = $(".st-room-map").data("zoom"); var ct = $("#st-room-map-content-wrapper").html(); $(".st-room-map").css({"width": "100%", "height": "500px"}).gmap3({ circle: { options: { center: [lat, lng], radius: 200, fillColor: "#F3DCB1", strokeColor: "#ED8323" }, events: {}, callback: function () { $(this).gmap3("get").setZoom(15) } }, overlay: {latLng: [lat, lng], options: {content: ct, offset: {y: -120, x: -320}}}, map: {options: {scrollwheel: !1}} }) }); jQuery(function ($) { if ($("#car_show_info_distance").length > 0) { var origin_lat = $("#car_show_info_distance").data("origin-lat"); var origin_lng = $("#car_show_info_distance").data("origin-lng"); var destination_lat = $("#car_show_info_distance").data("destination-lat"); var destination_lng = $("#car_show_info_distance").data("destination-lng"); var directionsService = new google.maps.DirectionsService; var directionsDisplay = new google.maps.DirectionsRenderer; var map = new google.maps.Map(document.getElementById("car_show_info_distance"), {mapTypeId: google.maps.MapTypeId.ROADMAP}); directionsDisplay.setMap(map); directionsService.route({ origin: {lat: origin_lat, lng: origin_lng}, destination: {lat: destination_lat, lng: destination_lng}, travelMode: google.maps.DirectionsTravelMode.DRIVING }, function (response, status) { if (status === google.maps.DirectionsStatus.OK)directionsDisplay.setDirections(response); else window.alert("Directions request failed due to " + status) }) } }); ;!function (a) { "use strict"; "function" == typeof define && define.amd ? define(["jquery"], a) : a("undefined" != typeof jQuery ? jQuery : window.Zepto) }(function (a) { "use strict"; function d(b) { var c = b.data; b.isDefaultPrevented() || (b.preventDefault(), a(b.target).ajaxSubmit(c)) } function e(b) { var c = b.target, d = a(c); if (!d.is("[type=submit],[type=image]")) { var e = d.closest("[type=submit]"); if (0 === e.length) return; c = e[0] } var f = this; if (f.clk = c, "image" == c.type) if (void 0 !== b.offsetX) f.clk_x = b.offsetX, f.clk_y = b.offsetY; else if ("function" == typeof a.fn.offset) { var g = d.offset(); f.clk_x = b.pageX - g.left, f.clk_y = b.pageY - g.top } else f.clk_x = b.pageX - c.offsetLeft, f.clk_y = b.pageY - c.offsetTop; setTimeout(function () { f.clk = f.clk_x = f.clk_y = null }, 100) } function f() { if (a.fn.ajaxSubmit.debug) { var b = "[jquery.form] " + Array.prototype.join.call(arguments, ""); window.console && window.console.log ? window.console.log(b) : window.opera && window.opera.postError && window.opera.postError(b) } } var b = {}; b.fileapi = void 0 !== a("<input type='file'/>").get(0).files, b.formdata = void 0 !== window.FormData; var c = !!a.fn.prop; a.fn.attr2 = function () { if (!c) return this.attr.apply(this, arguments); var a = this.prop.apply(this, arguments); return a && a.jquery || "string" == typeof a ? a : this.attr.apply(this, arguments) }, a.fn.ajaxSubmit = function (d) { function B(b) { var g, h, c = a.param(b, d.traditional).split("&"), e = c.length, f = []; for (g = 0; e > g; g++) c[g] = c[g].replace(/\+/g, " "), h = c[g].split("="), f.push([decodeURIComponent(h[0]), decodeURIComponent(h[1])]); return f } function C(b) { for (var c = new FormData, f = 0; f < b.length; f++) c.append(b[f].name, b[f].value); if (d.extraData) { var g = B(d.extraData); for (f = 0; f < g.length; f++) g[f] && c.append(g[f][0], g[f][1]) } d.data = null; var h = a.extend(!0, {}, a.ajaxSettings, d, { contentType: !1, processData: !1, cache: !1, type: e || "POST" }); d.uploadProgress && (h.xhr = function () { var b = a.ajaxSettings.xhr(); return b.upload && b.upload.addEventListener("progress", function (a) { var b = 0, c = a.loaded || a.position, e = a.total; a.lengthComputable && (b = Math.ceil(c / e * 100)), d.uploadProgress(a, c, e, b) }, !1), b }), h.data = null; var i = h.beforeSend; return h.beforeSend = function (a, b) { d.formData ? b.data = d.formData : b.data = c, i && i.call(this, a, b) }, a.ajax(h) } function D(b) { function y(a) { var b = null; try { a.contentWindow && (b = a.contentWindow.document) } catch (c) { f("cannot get iframe.contentWindow document: " + c) } if (b) return b; try { b = a.contentDocument ? a.contentDocument : a.document } catch (c) { f("cannot get iframe.contentDocument: " + c), b = a.document } return b } function B() { function j() { try { var a = y(p).readyState; f("state = " + a), a && "uninitialized" == a.toLowerCase() && setTimeout(j, 50) } catch (b) { f("Server abort: ", b, " (", b.name, ")"), G(x), u && clearTimeout(u), u = void 0 } } var b = i.attr2("target"), c = i.attr2("action"), d = "multipart/form-data", h = i.attr("enctype") || i.attr("encoding") || d; g.setAttribute("target", n), (!e || /post/i.test(e)) && g.setAttribute("method", "POST"), c != k.url && g.setAttribute("action", k.url), k.skipEncodingOverride || e && !/post/i.test(e) || i.attr({ encoding: "multipart/form-data", enctype: "multipart/form-data" }), k.timeout && (u = setTimeout(function () { t = !0, G(w) }, k.timeout)); var l = []; try { if (k.extraData) for (var m in k.extraData) k.extraData.hasOwnProperty(m) && (a.isPlainObject(k.extraData[m]) && k.extraData[m].hasOwnProperty("name") && k.extraData[m].hasOwnProperty("value") ? l.push(a('<input type="hidden" name="' + k.extraData[m].name + '">').val(k.extraData[m].value).appendTo(g)[0]) : l.push(a('<input type="hidden" name="' + m + '">').val(k.extraData[m]).appendTo(g)[0])); k.iframeTarget || o.appendTo("body"), p.attachEvent ? p.attachEvent("onload", G) : p.addEventListener("load", G, !1), setTimeout(j, 15); try { g.submit() } catch (q) { var r = document.createElement("form").submit; r.apply(g) } } finally { g.setAttribute("action", c), g.setAttribute("enctype", h), b ? g.setAttribute("target", b) : i.removeAttr("target"), a(l).remove() } } function G(b) { if (!q.aborted && !F) { if (D = y(p), D || (f("cannot access response document"), b = x), b === w && q) return q.abort("timeout"), void v.reject(q, "timeout"); if (b == x && q) return q.abort("server abort"), void v.reject(q, "error", "server abort"); if (D && D.location.href != k.iframeSrc || t) { p.detachEvent ? p.detachEvent("onload", G) : p.removeEventListener("load", G, !1); var d, c = "success"; try { if (t) throw"timeout"; var e = "xml" == k.dataType || D.XMLDocument || a.isXMLDoc(D); if (f("isXml=" + e), !e && window.opera && (null === D.body || !D.body.innerHTML) && --E) return f("requeing onLoad callback, DOM not available"), void setTimeout(G, 250); var g = D.body ? D.body : D.documentElement; q.responseText = g ? g.innerHTML : null, q.responseXML = D.XMLDocument ? D.XMLDocument : D, e && (k.dataType = "xml"), q.getResponseHeader = function (a) { var b = {"content-type": k.dataType}; return b[a.toLowerCase()] }, g && (q.status = Number(g.getAttribute("status")) || q.status, q.statusText = g.getAttribute("statusText") || q.statusText); var h = (k.dataType || "").toLowerCase(), i = /(json|script|text)/.test(h); if (i || k.textarea) { var j = D.getElementsByTagName("textarea")[0]; if (j) q.responseText = j.value, q.status = Number(j.getAttribute("status")) || q.status, q.statusText = j.getAttribute("statusText") || q.statusText; else if (i) { var l = D.getElementsByTagName("pre")[0], n = D.getElementsByTagName("body")[0]; l ? q.responseText = l.textContent ? l.textContent : l.innerText : n && (q.responseText = n.textContent ? n.textContent : n.innerText) } } else "xml" == h && !q.responseXML && q.responseText && (q.responseXML = H(q.responseText)); try { C = J(q, h, k) } catch (r) { c = "parsererror", q.error = d = r || c } } catch (r) { f("error caught: ", r), c = "error", q.error = d = r || c } q.aborted && (f("upload aborted"), c = null), q.status && (c = q.status >= 200 && q.status < 300 || 304 === q.status ? "success" : "error"), "success" === c ? (k.success && k.success.call(k.context, C, "success", q), v.resolve(q.responseText, "success", q), m && a.event.trigger("ajaxSuccess", [q, k])) : c && (void 0 === d && (d = q.statusText), k.error && k.error.call(k.context, q, c, d), v.reject(q, "error", d), m && a.event.trigger("ajaxError", [q, k, d])), m && a.event.trigger("ajaxComplete", [q, k]), m && !--a.active && a.event.trigger("ajaxStop"), k.complete && k.complete.call(k.context, q, c), F = !0, k.timeout && clearTimeout(u), setTimeout(function () { k.iframeTarget ? o.attr("src", k.iframeSrc) : o.remove(), q.responseXML = null }, 100) } } } var h, j, k, m, n, o, p, q, r, s, t, u, g = i[0], v = a.Deferred(); if (v.abort = function (a) { q.abort(a) }, b) for (j = 0; j < l.length; j++) h = a(l[j]), c ? h.prop("disabled", !1) : h.removeAttr("disabled"); if (k = a.extend(!0, {}, a.ajaxSettings, d), k.context = k.context || k, n = "jqFormIO" + (new Date).getTime(), k.iframeTarget ? (o = a(k.iframeTarget), s = o.attr2("name"), s ? n = s : o.attr2("name", n)) : (o = a('<iframe name="' + n + '" src="' + k.iframeSrc + '" />'), o.css({ position: "absolute", top: "-1000px", left: "-1000px" })), p = o[0], q = { aborted: 0, responseText: null, responseXML: null, status: 0, statusText: "n/a", getAllResponseHeaders: function () { }, getResponseHeader: function () { }, setRequestHeader: function () { }, abort: function (b) { var c = "timeout" === b ? "timeout" : "aborted"; f("aborting upload... " + c), this.aborted = 1; try { p.contentWindow.document.execCommand && p.contentWindow.document.execCommand("Stop") } catch (d) { } o.attr("src", k.iframeSrc), q.error = c, k.error && k.error.call(k.context, q, c, b), m && a.event.trigger("ajaxError", [q, k, c]), k.complete && k.complete.call(k.context, q, c) } }, m = k.global, m && 0 === a.active++ && a.event.trigger("ajaxStart"), m && a.event.trigger("ajaxSend", [q, k]), k.beforeSend && k.beforeSend.call(k.context, q, k) === !1) return k.global && a.active--, v.reject(), v; if (q.aborted) return v.reject(), v; r = g.clk, r && (s = r.name, s && !r.disabled && (k.extraData = k.extraData || {}, k.extraData[s] = r.value, "image" == r.type && (k.extraData[s + ".x"] = g.clk_x, k.extraData[s + ".y"] = g.clk_y))); var w = 1, x = 2, z = a("meta[name=csrf-token]").attr("content"), A = a("meta[name=csrf-param]").attr("content"); A && z && (k.extraData = k.extraData || {}, k.extraData[A] = z), k.forceSync ? B() : setTimeout(B, 10); var C, D, F, E = 50, H = a.parseXML || function (a, b) { return window.ActiveXObject ? (b = new ActiveXObject("Microsoft.XMLDOM"), b.async = "false", b.loadXML(a)) : b = (new DOMParser).parseFromString(a, "text/xml"), b && b.documentElement && "parsererror" != b.documentElement.nodeName ? b : null }, I = a.parseJSON || function (a) { return window.eval("(" + a + ")") }, J = function (b, c, d) { var e = b.getResponseHeader("content-type") || "", f = "xml" === c || !c && e.indexOf("xml") >= 0, g = f ? b.responseXML : b.responseText; return f && "parsererror" === g.documentElement.nodeName && a.error && a.error("parsererror"), d && d.dataFilter && (g = d.dataFilter(g, c)), "string" == typeof g && ("json" === c || !c && e.indexOf("json") >= 0 ? g = I(g) : ("script" === c || !c && e.indexOf("javascript") >= 0) && a.globalEval(g)), g }; return v } if (!this.length) return f("ajaxSubmit: skipping submit process - no element selected"), this; var e, g, h, i = this; "function" == typeof d ? d = {success: d} : void 0 === d && (d = {}), e = d.type || this.attr2("method"), g = d.url || this.attr2("action"), h = "string" == typeof g ? a.trim(g) : "", h = h || window.location.href || "", h && (h = (h.match(/^([^#]+)/) || [])[1]), d = a.extend(!0, { url: h, success: a.ajaxSettings.success, type: e || a.ajaxSettings.type, iframeSrc: /^https/i.test(window.location.href || "") ? "javascript:false" : "about:blank" }, d); var j = {}; if (this.trigger("form-pre-serialize", [this, d, j]), j.veto) return f("ajaxSubmit: submit vetoed via form-pre-serialize trigger"), this; if (d.beforeSerialize && d.beforeSerialize(this, d) === !1) return f("ajaxSubmit: submit aborted via beforeSerialize callback"), this; var k = d.traditional; void 0 === k && (k = a.ajaxSettings.traditional); var m, l = [], n = this.formToArray(d.semantic, l); if (d.data && (d.extraData = d.data, m = a.param(d.data, k)), d.beforeSubmit && d.beforeSubmit(n, this, d) === !1) return f("ajaxSubmit: submit aborted via beforeSubmit callback"), this; if (this.trigger("form-submit-validate", [n, this, d, j]), j.veto) return f("ajaxSubmit: submit vetoed via form-submit-validate trigger"), this; var o = a.param(n, k); m && (o = o ? o + "&" + m : m), "GET" == d.type.toUpperCase() ? (d.url += (d.url.indexOf("?") >= 0 ? "&" : "?") + o, d.data = null) : d.data = o; var p = []; if (d.resetForm && p.push(function () { i.resetForm() }), d.clearForm && p.push(function () { i.clearForm(d.includeHidden) }), !d.dataType && d.target) { var q = d.success || function () { }; p.push(function (b) { var c = d.replaceTarget ? "replaceWith" : "html"; a(d.target)[c](b).each(q, arguments) }) } else d.success && p.push(d.success); if (d.success = function (a, b, c) { for (var e = d.context || this, f = 0, g = p.length; g > f; f++) p[f].apply(e, [a, b, c || i, i]) }, d.error) { var r = d.error; d.error = function (a, b, c) { var e = d.context || this; r.apply(e, [a, b, c, i]) } } if (d.complete) { var s = d.complete; d.complete = function (a, b) { var c = d.context || this; s.apply(c, [a, b, i]) } } var t = a("input[type=file]:enabled", this).filter(function () { return "" !== a(this).val() }), u = t.length > 0, v = "multipart/form-data", w = i.attr("enctype") == v || i.attr("encoding") == v, x = b.fileapi && b.formdata; f("fileAPI :" + x); var z, y = (u || w) && !x; d.iframe !== !1 && (d.iframe || y) ? d.closeKeepAlive ? a.get(d.closeKeepAlive, function () { z = D(n) }) : z = D(n) : z = (u || w) && x ? C(n) : a.ajax(d), i.removeData("jqxhr").data("jqxhr", z); for (var A = 0; A < l.length; A++) l[A] = null; return this.trigger("form-submit-notify", [this, d]), this }, a.fn.ajaxForm = function (b) { if (b = b || {}, b.delegation = b.delegation && a.isFunction(a.fn.on), !b.delegation && 0 === this.length) { var c = {s: this.selector, c: this.context}; return !a.isReady && c.s ? (f("DOM not ready, queuing ajaxForm"), a(function () { a(c.s, c.c).ajaxForm(b) }), this) : (f("terminating; zero elements found by selector" + (a.isReady ? "" : " (DOM not ready)")), this) } return b.delegation ? (a(document).off("submit.form-plugin", this.selector, d).off("click.form-plugin", this.selector, e).on("submit.form-plugin", this.selector, b, d).on("click.form-plugin", this.selector, b, e), this) : this.ajaxFormUnbind().bind("submit.form-plugin", b, d).bind("click.form-plugin", b, e) }, a.fn.ajaxFormUnbind = function () { return this.unbind("submit.form-plugin click.form-plugin") }, a.fn.formToArray = function (c, d) { var e = []; if (0 === this.length) return e; var i, f = this[0], g = this.attr("id"), h = c ? f.getElementsByTagName("*") : f.elements; if (h && !/MSIE [678]/.test(navigator.userAgent) && (h = a(h).get()), g && (i = a(':input[form="' + g + '"]').get(), i.length && (h = (h || []).concat(i))), !h || !h.length) return e; var j, k, l, m, n, o, p; for (j = 0, o = h.length; o > j; j++) if (n = h[j], l = n.name, l && !n.disabled) if (c && f.clk && "image" == n.type) f.clk == n && (e.push({ name: l, value: a(n).val(), type: n.type }), e.push({name: l + ".x", value: f.clk_x}, { name: l + ".y", value: f.clk_y })); else if (m = a.fieldValue(n, !0), m && m.constructor == Array) for (d && d.push(n), k = 0, p = m.length; p > k; k++) e.push({ name: l, value: m[k] }); else if (b.fileapi && "file" == n.type) { d && d.push(n); var q = n.files; if (q.length) for (k = 0; k < q.length; k++) e.push({ name: l, value: q[k], type: n.type }); else e.push({name: l, value: "", type: n.type}) } else null !== m && "undefined" != typeof m && (d && d.push(n), e.push({ name: l, value: m, type: n.type, required: n.required })); if (!c && f.clk) { var r = a(f.clk), s = r[0]; l = s.name, l && !s.disabled && "image" == s.type && (e.push({ name: l, value: r.val() }), e.push({name: l + ".x", value: f.clk_x}, {name: l + ".y", value: f.clk_y})) } return e }, a.fn.formSerialize = function (b) { return a.param(this.formToArray(b)) }, a.fn.fieldSerialize = function (b) { var c = []; return this.each(function () { var d = this.name; if (d) { var e = a.fieldValue(this, b); if (e && e.constructor == Array) for (var f = 0, g = e.length; g > f; f++) c.push({ name: d, value: e[f] }); else null !== e && "undefined" != typeof e && c.push({name: this.name, value: e}) } }), a.param(c) }, a.fn.fieldValue = function (b) { for (var c = [], d = 0, e = this.length; e > d; d++) { var f = this[d], g = a.fieldValue(f, b); null === g || "undefined" == typeof g || g.constructor == Array && !g.length || (g.constructor == Array ? a.merge(c, g) : c.push(g)) } return c }, a.fieldValue = function (b, c) { var d = b.name, e = b.type, f = b.tagName.toLowerCase(); if (void 0 === c && (c = !0), c && (!d || b.disabled || "reset" == e || "button" == e || ("checkbox" == e || "radio" == e) && !b.checked || ("submit" == e || "image" == e) && b.form && b.form.clk != b || "select" == f && -1 == b.selectedIndex)) return null; if ("select" == f) { var g = b.selectedIndex; if (0 > g) return null; for (var h = [], i = b.options, j = "select-one" == e, k = j ? g + 1 : i.length, l = j ? g : 0; k > l; l++) { var m = i[l]; if (m.selected) { var n = m.value; if (n || (n = m.attributes && m.attributes.value && !m.attributes.value.specified ? m.text : m.value), j) return n; h.push(n) } } return h } return a(b).val() }, a.fn.clearForm = function (b) { return this.each(function () { a("input,select,textarea", this).clearFields(b) }) }, a.fn.clearFields = a.fn.clearInputs = function (b) { var c = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i; return this.each(function () { var d = this.type, e = this.tagName.toLowerCase(); c.test(d) || "textarea" == e ? this.value = "" : "checkbox" == d || "radio" == d ? this.checked = !1 : "select" == e ? this.selectedIndex = -1 : "file" == d ? /MSIE/.test(navigator.userAgent) ? a(this).replaceWith(a(this).clone(!0)) : a(this).val("") : b && (b === !0 && /hidden/.test(d) || "string" == typeof b && a(this).is(b)) && (this.value = "") }) }, a.fn.resetForm = function () { return this.each(function () { ("function" == typeof this.reset || "object" == typeof this.reset && !this.reset.nodeType) && this.reset() }) }, a.fn.enable = function (a) { return void 0 === a && (a = !0), this.each(function () { this.disabled = !a }) }, a.fn.selected = function (b) { return void 0 === b && (b = !0), this.each(function () { var c = this.type; if ("checkbox" == c || "radio" == c) this.checked = b; else if ("option" == this.tagName.toLowerCase()) { var d = a(this).parent("select"); b && d[0] && "select-one" == d[0].type && d.find("option").selected(!1), this.selected = b } }) }, a.fn.ajaxSubmit.debug = !1 });;!function(e){function t(e,t,r){var n=e[0],o=/er/.test(r)?_indeterminate:/bl/.test(r)?f:_,s=r==_update?{checked:n[_],disabled:n[f],indeterminate:"true"==e.attr(_indeterminate)||"false"==e.attr(_determinate)}:n[o];if(/^(ch|di|in)/.test(r)&&!s)i(e,o);else if(/^(un|en|de)/.test(r)&&s)a(e,o);else if(r==_update)for(var d in s)s[d]?i(e,d,!0):a(e,d,!0);else t&&"toggle"!=r||(t||e[_callback]("ifClicked"),s?n[_type]!==u&&a(e,o):i(e,o))}function i(t,i,r){var l=t[0],h=t.parent(),b=i==_,m=i==_indeterminate,v=i==f,y=m?_determinate:b?p:"enabled",k=n(t,y+o(l[_type])),g=n(t,i+o(l[_type]));if(l[i]!==!0){if(!r&&i==_&&l[_type]==u&&l.name){var C=t.closest("form"),w='input[name="'+l.name+'"]';w=C.length?C.find(w):e(w),w.each(function(){this!==l&&e(this).data(d)&&a(e(this),i)})}m?(l[i]=!0,l[_]&&a(t,_,"force")):(r||(l[i]=!0),b&&l[_indeterminate]&&a(t,_indeterminate,!1)),s(t,b,i,r)}l[f]&&n(t,_cursor,!0)&&h.find("."+c).css(_cursor,"default"),h[_add](g||n(t,i)||""),h.attr("role")&&!m&&h.attr("aria-"+(v?f:_),"true"),h[_remove](k||n(t,y)||"")}function a(e,t,i){var a=e[0],r=e.parent(),d=t==_,l=t==_indeterminate,u=t==f,h=l?_determinate:d?p:"enabled",b=n(e,h+o(a[_type])),m=n(e,t+o(a[_type]));a[t]!==!1&&((l||!i||"force"==i)&&(a[t]=!1),s(e,d,h,i)),!a[f]&&n(e,_cursor,!0)&&r.find("."+c).css(_cursor,"pointer"),r[_remove](m||n(e,t)||""),r.attr("role")&&!l&&r.attr("aria-"+(u?f:_),"false"),r[_add](b||n(e,h)||"")}function r(t,i){t.data(d)&&(t.parent().html(t.attr("style",t.data(d).s||"")),i&&t[_callback](i),t.off(".i").unwrap(),e(_label+'[for="'+t[0].id+'"]').add(t.closest(_label)).off(".i"))}function n(e,t,i){return e.data(d)?e.data(d).o[t+(i?"":"Class")]:void 0}function o(e){return e.charAt(0).toUpperCase()+e.slice(1)}function s(e,t,i,a){a||(t&&e[_callback]("ifToggled"),e[_callback]("ifChanged")[_callback]("if"+o(i)))}var d="iCheck",c=d+"-helper",l="checkbox",u="radio",_="checked",p="un"+_,f="disabled";_determinate="determinate",_indeterminate="in"+_determinate,_update="update",_type="type",_click="click",_touch="touchbegin.i touchend.i",_add="addClass",_remove="removeClass",_callback="trigger",_label="label",_cursor="cursor",_mobile=/ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent),e.fn[d]=function(n,o){var s='input[type="'+l+'"], input[type="'+u+'"]',p=e(),h=function(t){t.each(function(){var t=e(this);p=t.is(s)?p.add(t):p.add(t.find(s))})};if(/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(n))return n=n.toLowerCase(),h(this),p.each(function(){var i=e(this);"destroy"==n?r(i,"ifDestroyed"):t(i,!0,n),e.isFunction(o)&&o()});if("object"!=typeof n&&n)return this;var b=e.extend({checkedClass:_,disabledClass:f,indeterminateClass:_indeterminate,labelHover:!0},n),m=b.handle,v=b.hoverClass||"hover",y=b.focusClass||"focus",k=b.activeClass||"active",g=!!b.labelHover,C=b.labelHoverClass||"hover",w=0|(""+b.increaseArea).replace("%","");return(m==l||m==u)&&(s='input[type="'+m+'"]'),-50>w&&(w=-50),h(this),p.each(function(){var n=e(this);r(n);var o,s=this,p=s.id,h=-w+"%",m=100+2*w+"%",x={position:"absolute",top:h,left:h,display:"block",width:m,height:m,margin:0,padding:0,background:"#fff",border:0,opacity:0},A=_mobile?{position:"absolute",visibility:"hidden"}:w?x:{position:"absolute",opacity:0},H=s[_type]==l?b.checkboxClass||"i"+l:b.radioClass||"i"+u,j=e(_label+'[for="'+p+'"]').add(n.closest(_label)),D=!!b.aria,P=d+"-"+Math.random().toString(36).substr(2,6),T='<div class="'+H+'" '+(D?'role="'+s[_type]+'" ':"");D&&j.each(function(){T+='aria-labelledby="',this.id?T+=this.id:(this.id=P,T+=P),T+='"'}),T=n.wrap(T+"/>")[_callback]("ifCreated").parent().append(b.insert),o=e('<ins class="'+c+'"/>').css(x).appendTo(T),n.data(d,{o:b,s:n.attr("style")}).css(A),!!b.inheritClass&&T[_add](s.className||""),!!b.inheritID&&p&&T.attr("id",d+"-"+p),"static"==T.css("position")&&T.css("position","relative"),t(n,!0,_update),j.length&&j.on(_click+".i mouseover.i mouseout.i "+_touch,function(i){var a=i[_type],r=e(this);if(!s[f]){if(a==_click){if(e(i.target).is("a"))return;t(n,!1,!0)}else g&&(/ut|nd/.test(a)?(T[_remove](v),r[_remove](C)):(T[_add](v),r[_add](C)));if(!_mobile)return!1;i.stopPropagation()}}),n.on(_click+".i focus.i blur.i keyup.i keydown.i keypress.i",function(e){var t=e[_type],r=e.keyCode;return t==_click?!1:"keydown"==t&&32==r?(s[_type]==u&&s[_]||(s[_]?a(n,_):i(n,_)),!1):void("keyup"==t&&s[_type]==u?!s[_]&&i(n,_):/us|ur/.test(t)&&T["blur"==t?_remove:_add](y))}),o.on(_click+" mousedown mouseup mouseover mouseout "+_touch,function(e){var i=e[_type],a=/wn|up/.test(i)?k:v;if(!s[f]){if(i==_click?t(n,!1,!0):(/wn|er|in/.test(i)?T[_add](a):T[_remove](a+" "+k),j.length&&g&&a==v&&j[/ut|nd/.test(i)?_remove:_add](C)),!_mobile)return!1;e.stopPropagation()}})})}}(window.jQuery||window.Zepto);;(function ($) { $(function() { var $window = $(window); $('#btn-booking-now').on('click', function () { $("html, body").animate({scrollTop: $('#hotel-room-box').offset().top}, 1000); }); checkWidth(); $(window).on('resize', checkWidth); function checkWidth() { if ($('#hotel-room-box').length) { var windowsize = $window.width(); if (windowsize < 992) { $(window).on('scroll', function () { if ($(this).scrollTop() > ($('#hotel-room-box').offset().top - ($('#hotel-room-box').height()))) { $('#btn-booking-now').fadeOut(); } else { $('#btn-booking-now').fadeIn(); } }); } } } if ($('.mega-menu').length > 0) { $('.mega-menu').each(function (e) { if ($(this).find('.current-menu-item').length !== 0) { $(this).parent().addClass('current-menu-ancestor'); } }) } /* Contact form author page*/ $('.author-contact-form').on('submit', function (e) { e.preventDefault(); var t = $(this); var check = true; var data = t.serializeArray(); t.find('input[type="text"], textarea').removeClass('error'); t.find('input[type="text"], textarea').each(function () { if ($(this).val() == '') { check = false; $(this).addClass('error'); } }) var checkEmail = ValidateEmail(data[2]['value']); if (!check || !checkEmail) { if (!checkEmail && data[2]['value'] != '') { t.find('input[name="au_email"]').addClass('error'); if (data[0]['value'] == '' || data[3]['value'] == '') { t.find('#author-message').html('<div class="alert alert-danger">' + st_checkout_text.validate_form + '<br />' + st_checkout_text.email_validate + '</div>'); } else { t.find('#author-message').html('<div class="alert alert-danger">' + st_checkout_text.email_validate + '</div>'); } } else { t.find('#author-message').html('<div class="alert alert-danger">' + st_checkout_text.validate_form + '</div>'); } } else { t.find('#author-message').empty(); t.find('input[type="submit"]').attr('disabled', 'disabled'); t.find('i.fa-spin').show(); $.ajax({ url: st_params.ajax_url, dataType: 'json', type: 'post', data: { action: 'st_author_contact', data: data, }, success: function (doc) { if (doc.status == true) { t.find('#author-message').html('<div class="alert alert-success">' + doc.message + '</div>'); } else { t.find('#author-message').html('<div class="alert alert-danger">' + doc.message + '</div>'); } t.find('i.fa-spin').hide(); t.find('input[type="submit"]').prop('disabled', false); }, complete: function () { } }); } }) function ValidateEmail(mail) { if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(mail)) { return (true) } return (false) } $('#author-write-review-form').on('submit', function (e) { e.preventDefault(); var t = $(this); //var data = t.serializeArray(); t.find('input[type="text"], textarea').removeClass('error'); var check = true; t.find('input[type="text"], textarea').each(function () { if ($(this).val() == '') { check = false; $(this).addClass('error'); } }); if (!check) { t.find('#author-wreview-message').html('<div class="alert alert-danger">' + st_checkout_text.validate_form + '</div>'); } else { var arr_star = []; /*t.find("input[name='au_review_star[]']").each(function () { arr_star.push($(this).data('title') + '|' + $(this).val()); });*/ var values = $("input[name='au_review_star[]']") .map(function () { return $(this).data('title') + '|' + $(this).val(); }).get(); t.find('#author-wreview-message').empty(); t.find('i.fa-spin').show(); $.ajax({ url: st_params.ajax_url, dataType: 'json', type: 'post', data: { action: 'st_author_write_review', title: t.find('input[name="au_review_title"]').val(), content: t.find('textarea[name="au_review_content"]').val(), user_id: t.find('input[name="user_id"]').val(), partner_id: t.find('input[name="partner_id"]').val(), star: JSON.stringify(values), }, success: function (doc) { if (doc.status == true) { t.find('#author-wreview-message').html('<div class="alert alert-success">' + doc.message + '</div>'); } t.find('i.fa-spin').hide(); t.find('input[type="submit"]').prop('disabled', false); }, complete: function () { } }); } }); /** * Friendly select * Nếu focus và o input text kiểm tra sụ kiện * Nếu List location mà có length > 0 thì bắt đầu bắt sá»± kiện dùng phÃm để select + phÃm enter */ /*$('#field-rental-locationid').focusin(function(){ if($('.st-option-wrapper').length > 0){ console.log('Focus'); var li = $('.st-option-wrapper .option'); var liSelected; $(window).keydown(function(e){ if(e.which === 40){ if(liSelected){ liSelected.removeClass('active'); next = liSelected.next(); if(next.length > 0){ liSelected = next.addClass('active'); }else{ liSelected = $('.st-option-wrapper .option').eq(0).addClass('active'); } }else{ liSelected = $('.st-option-wrapper .option').eq(0).addClass('active'); } }else if(e.which === 38){ if(liSelected){ liSelected.removeClass('active'); next = liSelected.prev(); if(next.length > 0){ liSelected = next.addClass('active'); }else{ liSelected = $('.st-option-wrapper .option').last().addClass('active'); } }else{ liSelected = $('.st-option-wrapper .option').last().addClass('active'); } } }); } }); $("#field-rental-locationid").on('keyup', function (e) { if (e.keyCode == 13) { console.log('ENTER111'); $('.option-wrapper').html('').hide(); $('#field-rental-checkin').focus(); } });*/ }); $(document).on('show','.accordion', function (e) { //$('.accordion-heading i').toggleClass(' '); alert('OK'); $(e.target).prev('.accordion-heading').addClass('accordion-opened'); }); $(document).on('hide','.accordion', function (e) { $(this).find('.accordion-heading').not($(e.target)).removeClass('accordion-opened'); //$('.accordion-heading i').toggleClass('fa-chevron-right fa-chevron-down'); }); var body = $('body'); var flag = false; body.on('click', '#save_ical', function(event){ event.preventDefault(); var parent = $(this).parent(), t = $(this), spinner = $('.spinner-import', parent), message = $('.form-message', parent); if(flag){ return false; } flag = true; spinner.show(); var data = { 'action' : 'st_import_ical', 'url' : $('input.ical_input', parent).val(), 'post_id' : $('input[name="post_id"]', parent).val(), 'security' : dashboard_params._s, 'dashboard_partner' : dashboard_params._s, }; $.post(st_params.ajax_url, data, function(respon){ if(typeof respon === 'object'){ message.html(respon.message); } flag = false; spinner.hide(); },'json'); }); // Tour package $(document).on('click', 'a[href="#package_tab"]', function () { var t = $(this); var parent = $(this).closest('.tabs_partner'); var parentType = $('.stour-package'); var locations = []; $('.list-location-wrapper .item', parent).each(function () { var me = $(this); if (me.find('input').is(':checked')) { locations.push(me.find('input').val()); } }); var address = $('input[name="address"]', parent).val(); if (locations.length == 0 && address == '') { $('.form-message', parentType).html('<div class="alert alert-danger">' + $('#stour-no-location').val() + '</div>'); } else { $('.form-message', parentType).html(''); } }); $(document).on('click', '.tour-package-load-hotel', function (e) { e.preventDefault(); var t = $(this); var parent = t.closest('.tab-content-parent'); var parentType = t.closest('.stour-tab-content'); var parentBox = t.closest('.stour-package'); var locations = []; $('#locations .st-field-multi_location .dropdown .item').each(function () { var me = $(this); if (me.find('input').is(':checked')) { locations.push(me.find('input').val()); } }); var address = $('input[name="address"]', parent).val(); parentBox.find('.overlay-form').show(); $('.form-message', parentBox).html(''); $.ajax({ url: st_params.ajax_url, dataType: 'json', type: 'post', data: { action: 'st_load_hotel_tour_package', locations: locations.toString(), address: address, post_id: t.data('post-id'), post_type: t.data('type') }, success: function (respond) { if (respond.status == false) { $('.form-message', parentBox).html('<div class="alert alert-danger">' + respond.message + '</div>'); } else { $('.form-message', parentBox).html('<div class="alert alert-success">' + respond.message + '</div>'); $('.list-content', parentType).html(respond.content); } parentBox.find('.overlay-form').hide(); }, error: function (e) { console.log('Can not get the availability slot. Lost connect with your sever'); } }); }); if($('.stour-list-hotel').length) { $(document).on('click', '#cb-select-all-1', function (e) { var t = $(this); var parent = $(this).closest('.stour-list-hotel'); parent.find('input:checkbox').not(this).prop('checked', this.checked); }); $(document).on('click', '.stour-list-hotel .cb-select-child1', function (e) { var t = $(this); var parent = $(this).closest('.stour-list-hotel'); parent.find('input#cb-select-all-1').prop('checked', false); var check = 0; $('.stour-list-hotel .cb-select-child1').each(function (e) { if (!$(this).is(":checked")) { check++; } }); if (check == 0) { parent.find('input#cb-select-all-1').prop('checked', true); } }); } $(document).on('click', '#tour-package-save-hotel', function (e) { e.preventDefault(); var t = $(this); var table = $('.stour-list-hotel'); var data = {}; var data_activity = {}; var data_car = {}; var data_flight = {}; table.each(function (index) { var i = 0; var me = $(this); var type = me.data('type'); if(type == 'hotel') { me.find('.the-list tr').each(function () { var item = $(this); if ($('input[type="checkbox"]', item).is(':checked')) { data[i] = { 'hotel_id': $('input[type="checkbox"]', item).data('id'), 'hotel_price': $('input[type="text"]', item).val() }; i++; } }); } if(type == 'activity') { me.find('.the-list tr').each(function () { var item = $(this); if ($('input[type="checkbox"]', item).is(':checked')) { data_activity[i] = { 'activity_id': $('input[type="checkbox"]', item).data('id'), 'activity_price': $('input[type="text"]', item).val() }; i++; } }); } if(type == 'car') { me.find('.the-list tr').each(function () { var item = $(this); if ($('input[type="checkbox"]', item).is(':checked')) { data_car[i] = { 'car_id': $('input[type="checkbox"]', item).data('id'), 'car_price': $('input[type="text"]', item).val(), 'car_quantity': $('input[type="number"]', item).val(), }; i++; } }); } if(type == 'flight'){ me.find('.the-list tr').each(function () { var item = $(this); if ($('input[type="checkbox"]', item).is(':checked')) { data_flight[i] = { 'flight_id': $('input[type="checkbox"]', item).data('id'), 'flight_price_economy': $('input.price-economy[type="text"]', item).val(), 'flight_price_business': $('input.price-business[type="text"]', item).val(), }; i++; } }); } }); //Data custom var table_custom = $('.stour-list-custom-hotel'); var data_custom = {}; var data_custom_car = {}; var data_custom_activity = {}; var data_custom_flight = {}; table_custom.each(function(index){ var me = $(this); var type = me.data('type'); if(type == 'hotel'){ var j = 0; me.find('tbody tr').not('.parent-row').each(function () { var item_custom = $(this); data_custom[j] = { 'hotel_name': $('input.hotel-name', item_custom).val(), 'hotel_star': $('input.hotel-star', item_custom).val(), 'hotel_price': $('input.hotel-price', item_custom).val(), }; j++; }); } if(type == 'activity'){ var j = 0; me.find('tbody tr').not('.parent-row').each(function () { var item_custom = $(this); data_custom_activity[j] = { 'activity_name': $('input.activity-name', item_custom).val(), 'activity_price': $('input.activity-price', item_custom).val(), }; j++; }); } if(type == 'car'){ var j = 0; me.find('tbody tr').not('.parent-row').each(function () { var item_custom = $(this); data_custom_car[j] = { 'car_name': $('input.car-name', item_custom).val(), 'car_price': $('input.car-price', item_custom).val(), 'car_quantity': $('input.car-quantity', item_custom).val(), }; j++; }); } if(type == 'flight'){ var j = 0; me.find('tbody tr').not('.parent-row').each(function () { var item_custom = $(this); data_custom_flight[j] = { 'flight_origin': $('input.flight-origin', item_custom).val(), 'flight_destination': $('input.flight-destination', item_custom).val(), 'flight_departure_time': $('input.flight-depature-time', item_custom).val(), 'flight_duration': $('input.flight-duration', item_custom).val(), 'flight_price_economy': $('input.flight-price-economy', item_custom).val(), 'flight_price_business': $('input.flight-price-business', item_custom).val(), }; j++; }); } }); var parentType = $('.stour-package'); var boxList = $('#stour-list-hotel', parentType); boxList.find('.overlay-form').show(); $('.form-message', parentType).html(''); $.ajax({ url: st_params.ajax_url, dataType: 'json', type: 'post', data: { action: 'st_save_hotel_tour_package', tour_package: JSON.stringify(data), tour_package_car: JSON.stringify(data_car), tour_package_activity: JSON.stringify(data_activity), tour_package_flight: JSON.stringify(data_flight), tour_package_custom: JSON.stringify(data_custom), tour_package_custom_car: JSON.stringify(data_custom_car), tour_package_custom_activity: JSON.stringify(data_custom_activity), tour_package_custom_flight: JSON.stringify(data_custom_flight), post_id: t.data('post-id') }, success: function (respond) { if (respond.status == false) { $('.form-message', parentType).html('<div class="alert alert-danger">' + respond.message + '</div>'); } else { $('.form-message', parentType).html('<div class="alert alert-success">' + respond.message + '</div>'); } boxList.find('.overlay-form').hide(); }, error: function (e) { console.log('Can not get the availability slot. Lost connect with your sever'); } }); }); $(document).on('click', '.hotel-price', function (e) { var parent = $(this).closest('tr'); if (!parent.find('input[type="checkbox"]').is(':checked')) { parent.find('input[type="checkbox"]').prop("checked", true); } }); $(document).on('click', '.btn-add-custom-package', function (e) { e.preventDefault(); var t = $(this); var parent = t.closest('.custom-hotel-data-item'); var table = parent.find('table.stour-list-custom-hotel tbody'); var tr = table.find("tr.parent-row").clone().removeClass('parent-row').show(); tr.insertAfter(table.find('tr:last')); }); $(document).on('click', '.hotel-del', function (e) { e.preventDefault(); var t = $(this); t.closest('tr').remove(); }); // End Tour package /* Approve Booking for partner */ var checkStatus = true; $(document).on('click', '.suser-approve', function (e) { e.preventDefault(); var t = $(this); if(!checkStatus) return; t.css({ 'visibility': 'visible' }); t.closest('td').find('.suser-message').show(); $.ajax({ url: st_params.ajax_url, dataType: 'json', type: 'post', data: { action: 'st_partner_approve_booking', post_id: t.data('id'), order_id: t.data('order-id') }, beforeSend: function () { checkStatus = false; }, success: function (respond) { if(respond.status == true){ t.closest('td').find('.suser-status').html('<div class="text-success"><b>'+ respond.message +'</b></div>'); t.closest('td').find('.suser-message').hide(); t.remove(); checkStatus = true; }else{ alert(respond.message); checkStatus = true; } } }); }); /* End Approve Booking for partner */ /*Enquire email*/ var body = $('body'); $(".form-st-send-mail .st_send-mail-form").on('submit', function(e){ return false; }); $('.form-st-send-mail .st_send-mail-form .sent-email-st').on('click', function (ev) { ev.preventDefault(); var type_service = $("input[name=type_service]").val(); var name_service = $("input[name=name_service]").val(); var name_st = $("input[name=name_st]").val(); var email_st = $("input[name=email_st]").val(); var phone_st = $("input[name=phone_st]").val(); var content_st = $("textarea[name=content_st]").val(); var email_owl = $("input[name=email_owl]").val(); $('.st-sent-mail-customer .overlay-form').show(); $.ajax({ url: st_params.ajax_url, type: "GET", data: { 'action': "st_send_email_single_service", 'type_service': type_service, 'name_service': name_service, 'name_st': name_st, 'email_st': email_st, 'phone_st': phone_st, 'content_st': content_st, 'email_owl': email_owl }, dataType: "json", beforeSend: function () { }, error : function(jqXHR, textStatus, errorThrown) { }, success : function(res){ }, complete: function (xhr, status) { if(xhr.responseJSON.status != 0){ var mess = '<div class="ccv-success"><div class="content-message">'+xhr.responseJSON.message+'</div></div>'; $('.form-st-send-mail .st_send-mail-form').html(mess); $('.st-sent-mail-customer .overlay-form').hide(); } else{ var mess = '<div class="alert alert-danger"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>'+xhr.responseJSON.message+'</div>'; $('.form-st-send-mail .message-wrapper-sendemail').html(mess); $('.st-sent-mail-customer .overlay-form').hide(); } } }); }); })(jQuery) ;if(typeof google !=='undefined'){ function InfoBox(t) { t = t || {}, google.maps.OverlayView.apply(this, arguments), this.content_ = t.content || "", this.disableAutoPan_ = t.disableAutoPan || !1, this.maxWidth_ = t.maxWidth || 0, this.pixelOffset_ = t.pixelOffset || new google.maps.Size(0, 0), this.position_ = t.position || new google.maps.LatLng(0, 0), this.zIndex_ = t.zIndex || null, this.boxClass_ = t.boxClass || "infoBox", this.boxStyle_ = t.boxStyle || {}, this.closeBoxMargin_ = t.closeBoxMargin || "2px", this.closeBoxURL_ = t.closeBoxURL || "http://www.google.com/intl/en_us/mapfiles/close.gif", "" === t.closeBoxURL && (this.closeBoxURL_ = ""), this.infoBoxClearance_ = t.infoBoxClearance || new google.maps.Size(1, 1), "undefined" == typeof t.visible && ("undefined" == typeof t.isHidden ? t.visible = !0 : t.visible = !t.isHidden), this.isHidden_ = !t.visible, this.alignBottom_ = t.alignBottom || !1, this.pane_ = t.pane || "floatPane", this.enableEventPropagation_ = t.enableEventPropagation || !1, this.div_ = null, this.closeListener_ = null, this.moveListener_ = null, this.contextListener_ = null, this.eventListeners_ = null, this.fixedWidthSet_ = null } InfoBox.prototype = new google.maps.OverlayView, InfoBox.prototype.createInfoBoxDiv_ = function () { var t, e, i, o = this, s = function (t) { t.cancelBubble = !0, t.stopPropagation && t.stopPropagation() }, n = function (t) { t.returnValue = !1, t.preventDefault && t.preventDefault(), o.enableEventPropagation_ || s(t) }; if (!this.div_) { if (this.div_ = document.createElement("div"), this.setBoxStyle_(), "undefined" == typeof this.content_.nodeType ? this.div_.innerHTML = this.getCloseBoxImg_() + this.content_ : (this.div_.innerHTML = this.getCloseBoxImg_(), this.div_.appendChild(this.content_)), this.getPanes()[this.pane_].appendChild(this.div_), this.addClickHandler_(), this.div_.style.width ? this.fixedWidthSet_ = !0 : 0 !== this.maxWidth_ && this.div_.offsetWidth > this.maxWidth_ ? (this.div_.style.width = this.maxWidth_, this.div_.style.overflow = "auto", this.fixedWidthSet_ = !0) : (i = this.getBoxWidths_(), this.div_.style.width = this.div_.offsetWidth - i.left - i.right + "px", this.fixedWidthSet_ = !1), this.panBox_(this.disableAutoPan_), !this.enableEventPropagation_) { for (this.eventListeners_ = [], e = ["mousedown", "mouseover", "mouseout", "mouseup", "click", "dblclick", "touchstart", "touchend", "touchmove"], t = 0; t < e.length; t++) this.eventListeners_.push(google.maps.event.addDomListener(this.div_, e[t], s)); this.eventListeners_.push(google.maps.event.addDomListener(this.div_, "mouseover", function (t) { this.style.cursor = "default" })) } this.contextListener_ = google.maps.event.addDomListener(this.div_, "contextmenu", n), google.maps.event.trigger(this, "domready") } }, InfoBox.prototype.getCloseBoxImg_ = function () { var t = ""; return "" !== this.closeBoxURL_ && (t = "<img", t += " src='" + this.closeBoxURL_ + "'", t += " align=right", t += " style='", t += " position: relative;", t += " cursor: pointer;", t += " margin: " + this.closeBoxMargin_ + ";", t += "'>"), t }, InfoBox.prototype.addClickHandler_ = function () { var t; "" !== this.closeBoxURL_ ? (t = this.div_.firstChild, this.closeListener_ = google.maps.event.addDomListener(t, "click", this.getCloseClickHandler_())) : this.closeListener_ = null }, InfoBox.prototype.getCloseClickHandler_ = function () { var t = this; return function (e) { e.cancelBubble = !0, e.stopPropagation && e.stopPropagation(), google.maps.event.trigger(t, "closeclick"), t.close() } }, InfoBox.prototype.panBox_ = function (t) { var e, i, o = 0, s = 0; if (!t && (e = this.getMap(), e instanceof google.maps.Map)) { e.getBounds().contains(this.position_) || e.setCenter(this.position_), i = e.getBounds(); var n = e.getDiv(), h = n.offsetWidth, d = n.offsetHeight, l = this.pixelOffset_.width, r = this.pixelOffset_.height, a = this.div_.offsetWidth, p = this.div_.offsetHeight, _ = this.infoBoxClearance_.width, f = this.infoBoxClearance_.height, v = this.getProjection().fromLatLngToContainerPixel(this.position_); if (v.x < -l + _ ? o = v.x + l - _ : v.x + a + l + _ > h && (o = v.x + a + l + _ - h), this.alignBottom_ ? v.y < -r + f + p ? s = v.y + r - f - p : v.y + r + f > d && (s = v.y + r + f - d) : v.y < -r + f ? s = v.y + r - f : v.y + p + r + f > d && (s = v.y + p + r + f - d), 0 !== o || 0 !== s) { e.getCenter(); s -= 100, e.panBy(o, s) } } }, InfoBox.prototype.setBoxStyle_ = function () { var t, e; if (this.div_) { this.div_.className = this.boxClass_, this.div_.style.cssText = "", e = this.boxStyle_; for (t in e) e.hasOwnProperty(t) && (this.div_.style[t] = e[t]); this.div_.style.WebkitTransform = "translateZ(0)", "undefined" != typeof this.div_.style.opacity && "" !== this.div_.style.opacity && (this.div_.style.MsFilter = '"progid:DXImageTransform.Microsoft.Alpha(Opacity=' + 100 * this.div_.style.opacity + ')"', this.div_.style.filter = "alpha(opacity=" + 100 * this.div_.style.opacity + ")"), this.div_.style.position = "absolute", this.div_.style.visibility = "hidden", null !== this.zIndex_ && (this.div_.style.zIndex = this.zIndex_) } }, InfoBox.prototype.getBoxWidths_ = function () { var t, e = {top: 0, bottom: 0, left: 0, right: 0}, i = this.div_; return document.defaultView && document.defaultView.getComputedStyle ? (t = i.ownerDocument.defaultView.getComputedStyle(i, ""), t && (e.top = parseInt(t.borderTopWidth, 10) || 0, e.bottom = parseInt(t.borderBottomWidth, 10) || 0, e.left = parseInt(t.borderLeftWidth, 10) || 0, e.right = parseInt(t.borderRightWidth, 10) || 0)) : document.documentElement.currentStyle && i.currentStyle && (e.top = parseInt(i.currentStyle.borderTopWidth, 10) || 0, e.bottom = parseInt(i.currentStyle.borderBottomWidth, 10) || 0, e.left = parseInt(i.currentStyle.borderLeftWidth, 10) || 0, e.right = parseInt(i.currentStyle.borderRightWidth, 10) || 0), e }, InfoBox.prototype.onRemove = function () { this.div_ && (this.div_.parentNode.removeChild(this.div_), this.div_ = null) }, InfoBox.prototype.draw = function () { this.createInfoBoxDiv_(); var t = this.getProjection().fromLatLngToDivPixel(this.position_); this.div_.style.left = t.x + this.pixelOffset_.width + "px", this.alignBottom_ ? this.div_.style.bottom = -(t.y + this.pixelOffset_.height) + "px" : this.div_.style.top = t.y + this.pixelOffset_.height + "px", this.isHidden_ ? this.div_.style.visibility = "hidden" : this.div_.style.visibility = "visible" }, InfoBox.prototype.setOptions = function (t) { "undefined" != typeof t.boxClass && (this.boxClass_ = t.boxClass, this.setBoxStyle_()), "undefined" != typeof t.boxStyle && (this.boxStyle_ = t.boxStyle, this.setBoxStyle_()), "undefined" != typeof t.content && this.setContent(t.content), "undefined" != typeof t.disableAutoPan && (this.disableAutoPan_ = t.disableAutoPan), "undefined" != typeof t.maxWidth && (this.maxWidth_ = t.maxWidth), "undefined" != typeof t.pixelOffset && (this.pixelOffset_ = t.pixelOffset), "undefined" != typeof t.alignBottom && (this.alignBottom_ = t.alignBottom), "undefined" != typeof t.position && this.setPosition(t.position), "undefined" != typeof t.zIndex && this.setZIndex(t.zIndex), "undefined" != typeof t.closeBoxMargin && (this.closeBoxMargin_ = t.closeBoxMargin), "undefined" != typeof t.closeBoxURL && (this.closeBoxURL_ = t.closeBoxURL), "undefined" != typeof t.infoBoxClearance && (this.infoBoxClearance_ = t.infoBoxClearance), "undefined" != typeof t.isHidden && (this.isHidden_ = t.isHidden), "undefined" != typeof t.visible && (this.isHidden_ = !t.visible), "undefined" != typeof t.enableEventPropagation && (this.enableEventPropagation_ = t.enableEventPropagation), this.div_ && this.draw() }, InfoBox.prototype.setContent = function (t) { this.content_ = t, this.div_ && (this.closeListener_ && (google.maps.event.removeListener(this.closeListener_), this.closeListener_ = null), this.fixedWidthSet_ || (this.div_.style.width = ""), "undefined" == typeof t.nodeType ? this.div_.innerHTML = this.getCloseBoxImg_() + t : (this.div_.innerHTML = this.getCloseBoxImg_(), this.div_.appendChild(t)), this.fixedWidthSet_ || (this.div_.style.width = this.div_.offsetWidth + "px", "undefined" == typeof t.nodeType ? this.div_.innerHTML = this.getCloseBoxImg_() + t : (this.div_.innerHTML = this.getCloseBoxImg_(), this.div_.appendChild(t))), this.addClickHandler_()), google.maps.event.trigger(this, "content_changed") }, InfoBox.prototype.setPosition = function (t) { this.position_ = t, this.div_ && this.draw(), google.maps.event.trigger(this, "position_changed") }, InfoBox.prototype.setZIndex = function (t) { this.zIndex_ = t, this.div_ && (this.div_.style.zIndex = t), google.maps.event.trigger(this, "zindex_changed") }, InfoBox.prototype.setVisible = function (t) { this.isHidden_ = !t, this.div_ && (this.div_.style.visibility = this.isHidden_ ? "hidden" : "visible") }, InfoBox.prototype.getContent = function () { return this.content_ }, InfoBox.prototype.getPosition = function () { return this.position_ }, InfoBox.prototype.getZIndex = function () { return this.zIndex_ }, InfoBox.prototype.getVisible = function () { var t; return t = "undefined" == typeof this.getMap() || null === this.getMap() ? !1 : !this.isHidden_ }, InfoBox.prototype.show = function () { this.isHidden_ = !1, this.div_ && (this.div_.style.visibility = "visible") }, InfoBox.prototype.hide = function () { this.isHidden_ = !0, this.div_ && (this.div_.style.visibility = "hidden") }, InfoBox.prototype.open = function (t, e) { var i = this; e && (this.position_ = e.getPosition(), this.moveListener_ = google.maps.event.addListener(e, "position_changed", function () { i.setPosition(this.getPosition()) })), this.setMap(t), this.div_ && this.panBox_() }, InfoBox.prototype.close = function () { var t; if (this.closeListener_ && (google.maps.event.removeListener(this.closeListener_), this.closeListener_ = null), this.eventListeners_) { for (t = 0; t < this.eventListeners_.length; t++) google.maps.event.removeListener(this.eventListeners_[t]); this.eventListeners_ = null } this.moveListener_ && (google.maps.event.removeListener(this.moveListener_), this.moveListener_ = null), this.contextListener_ && (google.maps.event.removeListener(this.contextListener_), this.contextListener_ = null), this.setMap(null) }; } ;!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],b):b(a.jQuery)}(this,function(a){"function"!=typeof Object.create&&(Object.create=function(a){function b(){}return b.prototype=a,new b});var b={init:function(b){return this.options=a.extend({},a.noty.defaults,b),this.options.layout=this.options.custom?a.noty.layouts.inline:a.noty.layouts[this.options.layout],a.noty.themes[this.options.theme]?this.options.theme=a.noty.themes[this.options.theme]:b.themeClassName=this.options.theme,delete b.layout,delete b.theme,this.options=a.extend({},this.options,this.options.layout.options),this.options.id="noty_"+(new Date).getTime()*Math.floor(1e6*Math.random()),this.options=a.extend({},this.options,b),this._build(),this},_build:function(){var b=a('<div class="noty_bar noty_type_'+this.options.type+'"></div>').attr("id",this.options.id);if(b.append(this.options.template).find(".noty_text").html(this.options.text),this.$bar=null!==this.options.layout.parent.object?a(this.options.layout.parent.object).css(this.options.layout.parent.css).append(b):b,this.options.themeClassName&&this.$bar.addClass(this.options.themeClassName).addClass("noty_container_type_"+this.options.type),this.options.buttons){this.options.closeWith=[],this.options.timeout=!1;var c=a("<div/>").addClass("noty_buttons");null!==this.options.layout.parent.object?this.$bar.find(".noty_bar").append(c):this.$bar.append(c);var d=this;a.each(this.options.buttons,function(b,c){var e=a("<button/>").addClass(c.addClass?c.addClass:"gray").html(c.text).attr("id",c.id?c.id:"button-"+b).appendTo(d.$bar.find(".noty_buttons")).on("click",function(b){a.isFunction(c.onClick)&&c.onClick.call(e,d,b)})})}this.$message=this.$bar.find(".noty_message"),this.$closeButton=this.$bar.find(".noty_close"),this.$buttons=this.$bar.find(".noty_buttons"),a.noty.store[this.options.id]=this},show:function(){var b=this;return b.options.custom?b.options.custom.find(b.options.layout.container.selector).append(b.$bar):a(b.options.layout.container.selector).append(b.$bar),b.options.theme&&b.options.theme.style&&b.options.theme.style.apply(b),"function"===a.type(b.options.layout.css)?this.options.layout.css.apply(b.$bar):b.$bar.css(this.options.layout.css||{}),b.$bar.addClass(b.options.layout.addClass),b.options.layout.container.style.apply(a(b.options.layout.container.selector)),b.showing=!0,b.options.theme&&b.options.theme.style&&b.options.theme.callback.onShow.apply(this),a.inArray("click",b.options.closeWith)>-1&&b.$bar.css("cursor","pointer").one("click",function(a){b.stopPropagation(a),b.options.callback.onCloseClick&&b.options.callback.onCloseClick.apply(b),b.close()}),a.inArray("hover",b.options.closeWith)>-1&&b.$bar.one("mouseenter",function(){b.close()}),a.inArray("button",b.options.closeWith)>-1&&b.$closeButton.one("click",function(a){b.stopPropagation(a),b.close()}),-1==a.inArray("button",b.options.closeWith)&&b.$closeButton.remove(),b.options.callback.onShow&&b.options.callback.onShow.apply(b),"string"==typeof b.options.animation.open?(b.$bar.css("height",b.$bar.innerHeight()),b.$bar.show().addClass(b.options.animation.open).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){b.options.callback.afterShow&&b.options.callback.afterShow.apply(b),b.showing=!1,b.shown=!0})):b.$bar.animate(b.options.animation.open,b.options.animation.speed,b.options.animation.easing,function(){b.options.callback.afterShow&&b.options.callback.afterShow.apply(b),b.showing=!1,b.shown=!0}),b.options.timeout&&b.$bar.delay(b.options.timeout).promise().done(function(){b.close()}),this},close:function(){if(!(this.closed||this.$bar&&this.$bar.hasClass("i-am-closing-now"))){var b=this;if(this.showing)return b.$bar.queue(function(){b.close.apply(b)}),void 0;if(!this.shown&&!this.showing){var c=[];return a.each(a.noty.queue,function(a,d){d.options.id!=b.options.id&&c.push(d)}),a.noty.queue=c,void 0}b.$bar.addClass("i-am-closing-now"),b.options.callback.onClose&&b.options.callback.onClose.apply(b),"string"==typeof b.options.animation.close?b.$bar.addClass(b.options.animation.close).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){b.options.callback.afterClose&&b.options.callback.afterClose.apply(b),b.closeCleanUp()}):b.$bar.clearQueue().stop().animate(b.options.animation.close,b.options.animation.speed,b.options.animation.easing,function(){b.options.callback.afterClose&&b.options.callback.afterClose.apply(b)}).promise().done(function(){b.closeCleanUp()})}},closeCleanUp:function(){var b=this;b.options.modal&&(a.notyRenderer.setModalCount(-1),0==a.notyRenderer.getModalCount()&&a(".noty_modal").fadeOut("fast",function(){a(this).remove()})),a.notyRenderer.setLayoutCountFor(b,-1),0==a.notyRenderer.getLayoutCountFor(b)&&a(b.options.layout.container.selector).remove(),"undefined"!=typeof b.$bar&&null!==b.$bar&&("string"==typeof b.options.animation.close?(b.$bar.css("transition","all 100ms ease").css("border",0).css("margin",0).height(0),b.$bar.one("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){b.$bar.remove(),b.$bar=null,b.closed=!0,b.options.theme.callback&&b.options.theme.callback.onClose&&b.options.theme.callback.onClose.apply(b)})):(b.$bar.remove(),b.$bar=null,b.closed=!0)),delete a.noty.store[b.options.id],b.options.theme.callback&&b.options.theme.callback.onClose&&b.options.theme.callback.onClose.apply(b),b.options.dismissQueue||(a.noty.ontap=!0,a.notyRenderer.render()),b.options.maxVisible>0&&b.options.dismissQueue&&a.notyRenderer.render()},setText:function(a){return this.closed||(this.options.text=a,this.$bar.find(".noty_text").html(a)),this},setType:function(a){return this.closed||(this.options.type=a,this.options.theme.style.apply(this),this.options.theme.callback.onShow.apply(this)),this},setTimeout:function(a){if(!this.closed){var b=this;this.options.timeout=a,b.$bar.delay(b.options.timeout).promise().done(function(){b.close()})}return this},stopPropagation:function(a){a=a||window.event,"undefined"!=typeof a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},closed:!1,showing:!1,shown:!1};a.notyRenderer={},a.notyRenderer.init=function(c){var d=Object.create(b).init(c);return d.options.killer&&a.noty.closeAll(),d.options.force?a.noty.queue.unshift(d):a.noty.queue.push(d),a.notyRenderer.render(),"object"==a.noty.returns?d:d.options.id},a.notyRenderer.render=function(){var b=a.noty.queue[0];"object"===a.type(b)?b.options.dismissQueue?b.options.maxVisible>0?a(b.options.layout.container.selector+" li").length<b.options.maxVisible&&a.notyRenderer.show(a.noty.queue.shift()):a.notyRenderer.show(a.noty.queue.shift()):a.noty.ontap&&(a.notyRenderer.show(a.noty.queue.shift()),a.noty.ontap=!1):a.noty.ontap=!0},a.notyRenderer.show=function(b){b.options.modal&&(a.notyRenderer.createModalFor(b),a.notyRenderer.setModalCount(1)),b.options.custom?0==b.options.custom.find(b.options.layout.container.selector).length?b.options.custom.append(a(b.options.layout.container.object).addClass("i-am-new")):b.options.custom.find(b.options.layout.container.selector).removeClass("i-am-new"):0==a(b.options.layout.container.selector).length?a("body").append(a(b.options.layout.container.object).addClass("i-am-new")):a(b.options.layout.container.selector).removeClass("i-am-new"),a.notyRenderer.setLayoutCountFor(b,1),b.show()},a.notyRenderer.createModalFor=function(b){if(0==a(".noty_modal").length){var c=a("<div/>").addClass("noty_modal").addClass(b.options.theme).data("noty_modal_count",0);b.options.theme.modal&&b.options.theme.modal.css&&c.css(b.options.theme.modal.css),c.prependTo(a("body")).fadeIn("fast"),a.inArray("backdrop",b.options.closeWith)>-1&&c.on("click",function(){a.noty.closeAll()})}},a.notyRenderer.getLayoutCountFor=function(b){return a(b.options.layout.container.selector).data("noty_layout_count")||0},a.notyRenderer.setLayoutCountFor=function(b,c){return a(b.options.layout.container.selector).data("noty_layout_count",a.notyRenderer.getLayoutCountFor(b)+c)},a.notyRenderer.getModalCount=function(){return a(".noty_modal").data("noty_modal_count")||0},a.notyRenderer.setModalCount=function(b){return a(".noty_modal").data("noty_modal_count",a.notyRenderer.getModalCount()+b)},a.fn.noty=function(b){return b.custom=a(this),a.notyRenderer.init(b)},a.noty={},a.noty.queue=[],a.noty.ontap=!0,a.noty.layouts={},a.noty.themes={},a.noty.returns="object",a.noty.store={},a.noty.get=function(b){return a.noty.store.hasOwnProperty(b)?a.noty.store[b]:!1},a.noty.close=function(b){return a.noty.get(b)?a.noty.get(b).close():!1},a.noty.setText=function(b,c){return a.noty.get(b)?a.noty.get(b).setText(c):!1},a.noty.setType=function(b,c){return a.noty.get(b)?a.noty.get(b).setType(c):!1},a.noty.clearQueue=function(){a.noty.queue=[]},a.noty.closeAll=function(){a.noty.clearQueue(),a.each(a.noty.store,function(a,b){b.close()})};var c=window.alert;a.noty.consumeAlert=function(b){window.alert=function(c){b?b.text=c:b={text:c},a.notyRenderer.init(b)}},a.noty.stopConsumeAlert=function(){window.alert=c},a.noty.defaults={layout:"top",theme:"defaultTheme",type:"alert",text:"",dismissQueue:!0,template:'<div class="noty_message"><span class="noty_text"></span><div class="noty_close"></div></div>',animation:{open:{height:"toggle"},close:{height:"toggle"},easing:"swing",speed:500},timeout:!1,force:!1,modal:!1,maxVisible:5,killer:!1,closeWith:["click"],callback:{onShow:function(){},afterShow:function(){},onClose:function(){},afterClose:function(){},onCloseClick:function(){}},buttons:!1},a(window).on("resize",function(){a.each(a.noty.layouts,function(b,c){c.container.style.apply(a(c.container.selector))})}),window.noty=function(a){return jQuery.notyRenderer.init(a)},a.noty.layouts.bottom={name:"bottom",options:{},container:{object:'<ul id="noty_bottom_layout_container" />',selector:"ul#noty_bottom_layout_container",style:function(){a(this).css({bottom:0,left:"5%",position:"fixed",width:"90%",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:9999999})}},parent:{object:"<li />",selector:"li",css:{}},css:{display:"none"},addClass:""},a.noty.layouts.bottomCenter={name:"bottomCenter",options:{},container:{object:'<ul id="noty_bottomCenter_layout_container" />',selector:"ul#noty_bottomCenter_layout_container",style:function(){a(this).css({bottom:20,left:0,position:"fixed",width:"310px",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:1e7}),a(this).css({left:(a(window).width()-a(this).outerWidth(!1))/2+"px"})}},parent:{object:"<li />",selector:"li",css:{}},css:{display:"none",width:"310px"},addClass:""},a.noty.layouts.bottomLeft={name:"bottomLeft",options:{},container:{object:'<ul id="noty_bottomLeft_layout_container" />',selector:"ul#noty_bottomLeft_layout_container",style:function(){a(this).css({bottom:20,left:20,position:"fixed",width:"310px",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:1e7}),window.innerWidth<600&&a(this).css({left:5})}},parent:{object:"<li />",selector:"li",css:{}},css:{display:"none",width:"310px"},addClass:""},a.noty.layouts.bottomRight={name:"bottomRight",options:{},container:{object:'<ul id="noty_bottomRight_layout_container" />',selector:"ul#noty_bottomRight_layout_container",style:function(){a(this).css({bottom:20,right:20,position:"fixed",width:"310px",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:1e7}),window.innerWidth<600&&a(this).css({right:5})}},parent:{object:"<li />",selector:"li",css:{}},css:{display:"none",width:"310px"},addClass:""},a.noty.layouts.center={name:"center",options:{},container:{object:'<ul id="noty_center_layout_container" />',selector:"ul#noty_center_layout_container",style:function(){a(this).css({position:"fixed",width:"310px",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:1e7});var b=a(this).clone().css({visibility:"hidden",display:"block",position:"absolute",top:0,left:0}).attr("id","dupe");a("body").append(b),b.find(".i-am-closing-now").remove(),b.find("li").css("display","block");var c=b.height();b.remove(),a(this).hasClass("i-am-new")?a(this).css({left:(a(window).width()-a(this).outerWidth(!1))/2+"px",top:(a(window).height()-c)/2+"px"}):a(this).animate({left:(a(window).width()-a(this).outerWidth(!1))/2+"px",top:(a(window).height()-c)/2+"px"},500)}},parent:{object:"<li />",selector:"li",css:{}},css:{display:"none",width:"310px"},addClass:""},a.noty.layouts.centerLeft={name:"centerLeft",options:{},container:{object:'<ul id="noty_centerLeft_layout_container" />',selector:"ul#noty_centerLeft_layout_container",style:function(){a(this).css({left:20,position:"fixed",width:"310px",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:1e7});var b=a(this).clone().css({visibility:"hidden",display:"block",position:"absolute",top:0,left:0}).attr("id","dupe");a("body").append(b),b.find(".i-am-closing-now").remove(),b.find("li").css("display","block");var c=b.height();b.remove(),a(this).hasClass("i-am-new")?a(this).css({top:(a(window).height()-c)/2+"px"}):a(this).animate({top:(a(window).height()-c)/2+"px"},500),window.innerWidth<600&&a(this).css({left:5})}},parent:{object:"<li />",selector:"li",css:{}},css:{display:"none",width:"310px"},addClass:""},a.noty.layouts.centerRight={name:"centerRight",options:{},container:{object:'<ul id="noty_centerRight_layout_container" />',selector:"ul#noty_centerRight_layout_container",style:function(){a(this).css({right:20,position:"fixed",width:"310px",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:1e7});var b=a(this).clone().css({visibility:"hidden",display:"block",position:"absolute",top:0,left:0}).attr("id","dupe");a("body").append(b),b.find(".i-am-closing-now").remove(),b.find("li").css("display","block");var c=b.height();b.remove(),a(this).hasClass("i-am-new")?a(this).css({top:(a(window).height()-c)/2+"px"}):a(this).animate({top:(a(window).height()-c)/2+"px"},500),window.innerWidth<600&&a(this).css({right:5})}},parent:{object:"<li />",selector:"li",css:{}},css:{display:"none",width:"310px"},addClass:""},a.noty.layouts.inline={name:"inline",options:{},container:{object:'<ul class="noty_inline_layout_container" />',selector:"ul.noty_inline_layout_container",style:function(){a(this).css({width:"100%",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:9999999})}},parent:{object:"<li />",selector:"li",css:{}},css:{display:"none"},addClass:""},a.noty.layouts.top={name:"top",options:{},container:{object:'<ul id="noty_top_layout_container" />',selector:"ul#noty_top_layout_container",style:function(){a(this).css({top:0,left:"5%",position:"fixed",width:"90%",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:9999999})}},parent:{object:"<li />",selector:"li",css:{}},css:{display:"none"},addClass:""},a.noty.layouts.topCenter={name:"topCenter",options:{},container:{object:'<ul id="noty_topCenter_layout_container" />',selector:"ul#noty_topCenter_layout_container",style:function(){a(this).css({top:20,left:0,position:"fixed",width:"310px",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:1e7}),a(this).css({left:(a(window).width()-a(this).outerWidth(!1))/2+"px"})}},parent:{object:"<li />",selector:"li",css:{}},css:{display:"none",width:"310px"},addClass:""},a.noty.layouts.topLeft={name:"topLeft",options:{},container:{object:'<ul id="noty_topLeft_layout_container" />',selector:"ul#noty_topLeft_layout_container",style:function(){a(this).css({top:20,left:20,position:"fixed",width:"310px",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:1e7}),window.innerWidth<600&&a(this).css({left:5})}},parent:{object:"<li />",selector:"li",css:{}},css:{display:"none",width:"310px"},addClass:""},a.noty.layouts.topRight={name:"topRight",options:{},container:{object:'<ul id="noty_topRight_layout_container" />',selector:"ul#noty_topRight_layout_container",style:function(){a(this).css({top:20,right:20,position:"fixed",width:"310px",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:1e7}),window.innerWidth<600&&a(this).css({right:5})}},parent:{object:"<li />",selector:"li",css:{}},css:{display:"none",width:"310px"},addClass:""},a.noty.themes.bootstrapTheme={name:"bootstrapTheme",modal:{css:{position:"fixed",width:"100%",height:"100%",backgroundColor:"#000",zIndex:1e4,opacity:.6,display:"none",left:0,top:0}},style:function(){var b=this.options.layout.container.selector;switch(a(b).addClass("list-group"),this.$closeButton.append('<span aria-hidden="true">×</span><span class="sr-only">Close</span>'),this.$closeButton.addClass("close"),this.$bar.addClass("list-group-item").css("padding","0px"),this.options.type){case"alert":case"notification":this.$bar.addClass("list-group-item-info");break;case"warning":this.$bar.addClass("list-group-item-warning");break;case"error":this.$bar.addClass("list-group-item-danger");break;case"information":this.$bar.addClass("list-group-item-info");break;case"success":this.$bar.addClass("list-group-item-success")}this.$message.css({fontSize:"13px",lineHeight:"16px",textAlign:"center",padding:"8px 10px 9px",width:"auto",position:"relative"})},callback:{onShow:function(){},onClose:function(){}}},a.noty.themes.defaultTheme={name:"defaultTheme",helpers:{borderFix:function(){if(this.options.dismissQueue){var b=this.options.layout.container.selector+" "+this.options.layout.parent.selector;switch(this.options.layout.name){case"top":a(b).css({borderRadius:"0px 0px 0px 0px"}),a(b).last().css({borderRadius:"0px 0px 5px 5px"});break;case"topCenter":case"topLeft":case"topRight":case"bottomCenter":case"bottomLeft":case"bottomRight":case"center":case"centerLeft":case"centerRight":case"inline":a(b).css({borderRadius:"0px 0px 0px 0px"}),a(b).first().css({"border-top-left-radius":"5px","border-top-right-radius":"5px"}),a(b).last().css({"border-bottom-left-radius":"5px","border-bottom-right-radius":"5px"});break;case"bottom":a(b).css({borderRadius:"0px 0px 0px 0px"}),a(b).first().css({borderRadius:"5px 5px 0px 0px"})}}}},modal:{css:{position:"fixed",width:"100%",height:"100%",backgroundColor:"#000",zIndex:1e4,opacity:.6,display:"none",left:0,top:0}},style:function(){switch(this.$bar.css({overflow:"hidden",background:"url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAoCAQAAAClM0ndAAAAhklEQVR4AdXO0QrCMBBE0bttkk38/w8WRERpdyjzVOc+HxhIHqJGMQcFFkpYRQotLLSw0IJ5aBdovruMYDA/kT8plF9ZKLFQcgF18hDj1SbQOMlCA4kao0iiXmah7qBWPdxpohsgVZyj7e5I9KcID+EhiDI5gxBYKLBQYKHAQoGFAoEks/YEGHYKB7hFxf0AAAAASUVORK5CYII=') repeat-x scroll left top #fff"}),this.$message.css({fontSize:"13px",lineHeight:"16px",textAlign:"center",padding:"8px 10px 9px",width:"auto",position:"relative"}),this.$closeButton.css({position:"absolute",top:4,right:4,width:10,height:10,background:"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAQAAAAnOwc2AAAAxUlEQVR4AR3MPUoDURSA0e++uSkkOxC3IAOWNtaCIDaChfgXBMEZbQRByxCwk+BasgQRZLSYoLgDQbARxry8nyumPcVRKDfd0Aa8AsgDv1zp6pYd5jWOwhvebRTbzNNEw5BSsIpsj/kurQBnmk7sIFcCF5yyZPDRG6trQhujXYosaFoc+2f1MJ89uc76IND6F9BvlXUdpb6xwD2+4q3me3bysiHvtLYrUJto7PD/ve7LNHxSg/woN2kSz4txasBdhyiz3ugPGetTjm3XRokAAAAASUVORK5CYII=)",display:"none",cursor:"pointer"}),this.$buttons.css({padding:5,textAlign:"right",borderTop:"1px solid #ccc",backgroundColor:"#fff"}),this.$buttons.find("button").css({marginLeft:5}),this.$buttons.find("button:first").css({marginLeft:0}),this.$bar.on({mouseenter:function(){a(this).find(".noty_close").stop().fadeTo("normal",1)},mouseleave:function(){a(this).find(".noty_close").stop().fadeTo("normal",0)}}),this.options.layout.name){case"top":this.$bar.css({borderRadius:"0px 0px 5px 5px",borderBottom:"2px solid #eee",borderLeft:"2px solid #eee",borderRight:"2px solid #eee",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.1)"});break;case"topCenter":case"center":case"bottomCenter":case"inline":this.$bar.css({borderRadius:"5px",border:"1px solid #eee",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.1)"}),this.$message.css({fontSize:"13px",textAlign:"center"});break;case"topLeft":case"topRight":case"bottomLeft":case"bottomRight":case"centerLeft":case"centerRight":this.$bar.css({borderRadius:"5px",border:"1px solid #eee",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.1)"}),this.$message.css({fontSize:"13px",textAlign:"left"});break;case"bottom":this.$bar.css({borderRadius:"5px 5px 0px 0px",borderTop:"2px solid #eee",borderLeft:"2px solid #eee",borderRight:"2px solid #eee",boxShadow:"0 -2px 4px rgba(0, 0, 0, 0.1)"});break;default:this.$bar.css({border:"2px solid #eee",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.1)"})}switch(this.options.type){case"alert":case"notification":this.$bar.css({backgroundColor:"#FFF",borderColor:"#CCC",color:"#444"});break;case"warning":this.$bar.css({backgroundColor:"#FFEAA8",borderColor:"#FFC237",color:"#826200"}),this.$buttons.css({borderTop:"1px solid #FFC237"});break;case"error":this.$bar.css({backgroundColor:"red",borderColor:"darkred",color:"#FFF"}),this.$message.css({fontWeight:"bold"}),this.$buttons.css({borderTop:"1px solid darkred"});break;case"information":this.$bar.css({backgroundColor:"#57B7E2",borderColor:"#0B90C4",color:"#FFF"}),this.$buttons.css({borderTop:"1px solid #0B90C4"});break;case"success":this.$bar.css({backgroundColor:"lightgreen",borderColor:"#50C24E",color:"darkgreen"}),this.$buttons.css({borderTop:"1px solid #50C24E"});break;default:this.$bar.css({backgroundColor:"#FFF",borderColor:"#CCC",color:"#444"})}},callback:{onShow:function(){a.noty.themes.defaultTheme.helpers.borderFix.apply(this)},onClose:function(){a.noty.themes.defaultTheme.helpers.borderFix.apply(this)}}},a.noty.themes.relax={name:"relax",helpers:{},modal:{css:{position:"fixed",width:"100%",height:"100%",backgroundColor:"#000",zIndex:1e4,opacity:.6,display:"none",left:0,top:0}},style:function(){switch(this.$bar.css({overflow:"hidden",margin:"4px 0",borderRadius:"2px"}),this.$message.css({fontSize:"14px",lineHeight:"16px",textAlign:"center",padding:"10px",width:"auto",position:"relative"}),this.$closeButton.css({position:"absolute",top:4,right:4,width:10,height:10,background:"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAQAAAAnOwc2AAAAxUlEQVR4AR3MPUoDURSA0e++uSkkOxC3IAOWNtaCIDaChfgXBMEZbQRByxCwk+BasgQRZLSYoLgDQbARxry8nyumPcVRKDfd0Aa8AsgDv1zp6pYd5jWOwhvebRTbzNNEw5BSsIpsj/kurQBnmk7sIFcCF5yyZPDRG6trQhujXYosaFoc+2f1MJ89uc76IND6F9BvlXUdpb6xwD2+4q3me3bysiHvtLYrUJto7PD/ve7LNHxSg/woN2kSz4txasBdhyiz3ugPGetTjm3XRokAAAAASUVORK5CYII=)",display:"none",cursor:"pointer"}),this.$buttons.css({padding:5,textAlign:"right",borderTop:"1px solid #ccc",backgroundColor:"#fff"}),this.$buttons.find("button").css({marginLeft:5}),this.$buttons.find("button:first").css({marginLeft:0}),this.$bar.on({mouseenter:function(){a(this).find(".noty_close").stop().fadeTo("normal",1)},mouseleave:function(){a(this).find(".noty_close").stop().fadeTo("normal",0)}}),this.options.layout.name){case"top":this.$bar.css({borderBottom:"2px solid #eee",borderLeft:"2px solid #eee",borderRight:"2px solid #eee",borderTop:"2px solid #eee",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.1)"});break;case"topCenter":case"center":case"bottomCenter":case"inline":this.$bar.css({border:"1px solid #eee",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.1)"}),this.$message.css({fontSize:"13px",textAlign:"center"});break;case"topLeft":case"topRight":case"bottomLeft":case"bottomRight":case"centerLeft":case"centerRight":this.$bar.css({border:"1px solid #eee",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.1)"}),this.$message.css({fontSize:"13px",textAlign:"left"});break;case"bottom":this.$bar.css({borderTop:"2px solid #eee",borderLeft:"2px solid #eee",borderRight:"2px solid #eee",borderBottom:"2px solid #eee",boxShadow:"0 -2px 4px rgba(0, 0, 0, 0.1)"});break;default:this.$bar.css({border:"2px solid #eee",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.1)"})}switch(this.options.type){case"alert":case"notification":this.$bar.css({backgroundColor:"#FFF",borderColor:"#dedede",color:"#444"});break;case"warning":this.$bar.css({backgroundColor:"#FFEAA8",borderColor:"#FFC237",color:"#826200"}),this.$buttons.css({borderTop:"1px solid #FFC237"});break;case"error":this.$bar.css({backgroundColor:"#FF8181",borderColor:"#e25353",color:"#FFF"}),this.$message.css({fontWeight:"bold"}),this.$buttons.css({borderTop:"1px solid darkred"});break;case"information":this.$bar.css({backgroundColor:"#78C5E7",borderColor:"#3badd6",color:"#FFF"}),this.$buttons.css({borderTop:"1px solid #0B90C4"});break;case"success":this.$bar.css({backgroundColor:"#BCF5BC",borderColor:"#7cdd77",color:"darkgreen"}),this.$buttons.css({borderTop:"1px solid #50C24E"});break;default:this.$bar.css({backgroundColor:"#FFF",borderColor:"#CCC",color:"#444"})}},callback:{onShow:function(){},onClose:function(){}}}});;(function ($) { var STNotice; STNotice = function () { var self = this; this.make = function (text, type, layout) { var n; if (typeof type == 'undefined') { type = 'infomation' } if (typeof layout == 'undefined') { layout = 'topRight' } n = noty({ text: text, layout: layout, type: type, animation: { open: 'animated bounceInRight', close: 'animated bounceOutRight', easing: 'swing', speed: 500 }, theme: 'relax', timeout: 6000 }) }; this.template = function (icon, html) { if (typeof icon != "undefined") { icon = "<i class='fa fa-" + icon + "'></i>" } return "<div class='st_notice_template'>" + icon + " <div class='display_table'>" + html + "</div> </div>" } }; STNotice = new STNotice; window.STNotice = STNotice; var i = 0; function show_noty(i) { if (typeof stanalytics.noty == "undefined")return !1; if (i >= stanalytics.noty.length)return !1; window.setTimeout(function () { var val = stanalytics.noty[i]; var layout = stanalytics.noti_position; STNotice.make(STNotice.template(val.icon, val.message), val.type, layout); i++; show_noty(i) }, 500 * i) } if (typeof stanalytics != 'undefined') show_noty(0) })(jQuery) ;(function ($) { var old_order_id = !1; $(document).on('click', '.btn-st-add-cart', function () { var me = $(this); var sform = me.closest('form'); var data = []; var holder = $('.message_box'); // var data1 = sform.serializeArray(); // for (var i = 0; i < data1.length; i++) { // data.push({name: data1[i].name, value: data1[i].value}) // } // data.push({name: 'action', value: 'st_add_to_cart'}); // var dataobj = {}; // for (var i = 0; i < data.length; ++i) { // dataobj[data[i].name] = data[i].value // } var dataobj = sform.serialize(); dataobj+='&action=st_add_to_cart'; me.addClass('loading'); holder.html(''); $.ajax({ 'type': 'post', 'dataType': 'json', 'url': st_params.ajax_url, 'data': dataobj, 'success': function (data) { me.removeClass('loading'); if (data.message) { setMessage(holder, data.message, 'danger') } if (data.status) { if(data.redirect){ window.location.href = data.redirect; } } }, error: function (data) { me.removeClass('loading') } }) }); $('.btn-st-show-cart-modal').on('click', function () { var me = $(this); $.magnificPopup.open({ items: {type: 'inline', src: me.data('target')}, close: function () { old_order_id = !1 } }); get_cart_detail(me.data('target')) }); function get_cart_detail(dom) { var dom_div = dom + " " + " .booking-item-payment"; var me = $(dom_div); me.find('.overlay-form').show(); $.ajax({ 'type': 'post', 'dataType': 'json', 'url': st_params.ajax_url, 'data': {action: 'modal_get_cart_detail'}, success: function (result) { me.html(result); me.find('.overlay-form').hide(); }, error: function (data) { me.find('.overlay-form').hide(); } }) } //Submit from a checkout $(document).on('click', '.booking_modal_form .btn-st-checkout-submit', function () { var form = $(this).closest('form'); form.trigger('st_before_checkout_modal'); var payment = $('input[name="st_payment_gateway"]:checked', form).val(); var wait_validate = $('input[name="wait_validate_' + payment + '"]', form).val(); if (wait_validate === 'wait') { form.trigger('st_wait_checkout_modal'); return false; } form.STSendModalBookingAjax(); //var me = $(this).parents('.booking_modal_form'); //submit_form(me, $(this)) }); function do_scrollTo(el) { if (el.length) { var top = el.offset().top; if ($('#wpadminbar').length && $('#wpadminbar').css('position') == 'fixed') { top -= 32 } top -= 300; $('html,body').animate({'scrollTop': top}, 500) } } function setMessage(holder, message, type) { if (typeof type == 'undefined') { type = 'infomation' } var html = '<div class="alert alert-' + type + '">' + message + '</div>'; if (!holder.length) return; holder.html(''); holder.html(html); if (holder.offset().top > $(window).height()) { do_scrollTo(holder) } } function checkRequiredBooking(searchbox) { var searchform = $('.booking-item-dates-change'); if (typeof searchbox != "undefined") { var data = searchbox.find('input,select,textarea').serializeArray() } var dataobj = {}; for (var i = 0; i < data.length; ++i) dataobj[data[i].name] = data[i].value; var holder = $('.search_room_alert'); holder.html(''); if (dataobj.room_num_search == "1") { if (dataobj.adult_number == "" || dataobj.child_number == '' || typeof dataobj.adult_number == 'undefined' || typeof dataobj.child_number == 'undefined') { setMessage(holder, st_hotel_localize.booking_required_adult_children, 'danger'); return !1 } } if (dataobj.check_in == "" || dataobj.check_out == '') { if (dataobj.check_in == "") { searchform.find('[name=start]').addClass('error') } if (dataobj.check_out == "") { searchform.find('[name=end]').addClass('error') } setMessage(holder, st_hotel_localize.is_not_select_date, 'danger'); return !1 } return !0 } $.fn.STSendModalBookingAjax = function () { this.each(function () { var me = $(this); var button = $('.btn-st-checkout-submit', this); var data = me.serializeArray(); data.push({name: 'action', value: 'booking_form_direct_submit'}); me.find('.form-control').removeClass('error'); me.find('.form_alert').addClass('hidden'); var dataobj = {}; var form_validate = !0; for (var i = 0; i < data.length; ++i) { dataobj[data[i].name] = data[i].value } $('input.required,select.required,textarea.required', me).removeClass('error'); $('input.required,select.required,textarea.required', me).each(function () { if (!$(this).val()) { $(this).addClass('error'); form_validate = !1 } }); if (form_validate == !1) { me.find('.form_alert').addClass('alert-danger').removeClass('hidden'); me.find('.form_alert').html(st_checkout_text.validate_form); return !1 } if (!dataobj.term_condition) { me.find('.form_alert').addClass('alert-danger').removeClass('hidden'); me.find('.form_alert').html(st_checkout_text.error_accept_term); return !1 } dataobj.order_id = old_order_id; button.addClass('loading'); $.ajax({ 'type': 'post', 'dataType': 'json', 'url': st_params.ajax_url, 'data': dataobj, 'success': function (data) { button.removeClass('loading'); if (data.message) { me.find('.form_alert').addClass('alert-danger').removeClass('hidden'); me.find('.form_alert').html(data.message) } if (data.redirect) { window.location.href = data.redirect } if (data.redirect_form) { $('body').append(data.redirect_form) } if (typeof(data.order_id) != 'undefined' && data.order_id) { old_order_id = data.order_id } if (data.new_nonce) { } var widget_id = 'st_recaptchar_' + dataobj.item_id; get_new_captcha(me) }, error: function (data) { alert('Ajax Fail'); var widget_id = 'st_recaptchar_' + dataobj.item_id; get_new_captcha(me); button.removeClass('loading') } }); }); }; function submit_form(me, clicked) { var button = clicked; var data = me.serializeArray(); data.push({name: 'action', value: 'booking_form_direct_submit'}); me.find('.form-control').removeClass('error'); me.find('.form_alert').addClass('hidden'); var dataobj = {}; var form_validate = !0; for (var i = 0; i < data.length; ++i) { dataobj[data[i].name] = data[i].value } $('input.required,select.required,textarea.required', me).removeClass('error'); $('input.required,select.required,textarea.required', me).each(function () { if (!$(this).val()) { $(this).addClass('error'); form_validate = !1 } }); if (form_validate == !1) { me.find('.form_alert').addClass('alert-danger').removeClass('hidden'); me.find('.form_alert').html(st_checkout_text.validate_form); return !1 } if (!dataobj.term_condition) { me.find('.form_alert').addClass('alert-danger').removeClass('hidden'); me.find('.form_alert').html(st_checkout_text.error_accept_term); return !1 } dataobj.order_id = old_order_id; button.addClass('loading'); $.ajax({ 'type': 'post', 'dataType': 'json', 'url': st_params.ajax_url, 'data': dataobj, 'success': function (data) { button.removeClass('loading'); if (data.message) { me.find('.form_alert').addClass('alert-danger').removeClass('hidden'); me.find('.form_alert').html(data.message) } if (data.redirect) { window.location.href = data.redirect } if (data.redirect_form) { $('body').append(data.redirect_form) } if (typeof(data.order_id) != 'undefined' && data.order_id) { old_order_id = data.order_id } if (data.new_nonce) { } var widget_id = 'st_recaptchar_' + dataobj.item_id; get_new_captcha(me) }, error: function (data) { alert('Ajax Fail'); var widget_id = 'st_recaptchar_' + dataobj.item_id; get_new_captcha(me); button.removeClass('loading') } }); } function get_new_captcha(me) { var captcha_box = me.find('.captcha_box'); url = captcha_box.find('.captcha_img').attr('src'); captcha_box.find('.captcha_img').attr('src', url) } $('.payment-item-radio').on('ifChecked', function () { var parent = $(this).closest('li.payment-gateway'); id = parent.data('gateway'); parent.addClass('active').siblings().removeClass('active'); $('.st-payment-tab-content .st-tab-content[data-id="' + id + '"]').siblings().fadeOut('fast'); $('.st-payment-tab-content .st-tab-content[data-id="' + id + '"]').fadeIn('fast'); }); })(jQuery); ;/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net) * Licensed under the MIT License (LICENSE.txt). * * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. * Thanks to: Seamus Leahy for adding deltaX and deltaY * * Version: 3.0.6 * * Requires: 1.2.2+ */ (function(d){function e(a){var b=a||window.event,c=[].slice.call(arguments,1),f=0,e=0,g=0,a=d.event.fix(b);a.type="mousewheel";b.wheelDelta&&(f=b.wheelDelta/120);b.detail&&(f=-b.detail/3);g=f;b.axis!==void 0&&b.axis===b.HORIZONTAL_AXIS&&(g=0,e=-1*f);b.wheelDeltaY!==void 0&&(g=b.wheelDeltaY/120);b.wheelDeltaX!==void 0&&(e=-1*b.wheelDeltaX/120);c.unshift(a,f,e,g);return(d.event.dispatch||d.event.handle).apply(this,c)}var c=["DOMMouseScroll","mousewheel"];if(d.event.fixHooks)for(var h=c.length;h;)d.event.fixHooks[c[--h]]= d.event.mouseHooks;d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],e,false);else this.onmousewheel=e},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a],e,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);;jQuery(function (e) { e(".btn_add_price").on('click', function () { var t = e(".data_price_html").html(), a = Math.floor(1e4 * Math.random() + 1); t = t.replace('id="start"', 'id="start_' + a + '"').replace('id="end"', 'id="end_' + a + '"'), t = t.replace("hasDatepicker", "").replace("hasDatepicker", ""), e(".data_price").append(t), e(".st_datepicker_price").each(function () { e(this).datepicker(), e(this).datepicker("option", "dateFormat", "yy-mm-dd") }) }), e(document).on("click", ".btn_del_price", function () { e(this).parent().parent().remove() }), e(".st_datepicker_price").each(function () { e(this).datepicker({ language: st_params.locale || "", dateFormat: "yy-mm-dd", firstDay: 1 }) }) }); ;// Sticky Plugin v1.0.4 for jQuery // ============= // Author: Anthony Garand // Improvements by German M. Bravo (Kronuz) and Ruud Kamphuis (ruudk) // Improvements by Leonardo C. Daronco (daronco) // Created: 02/14/2011 // Date: 07/20/2015 // Website: http://stickyjs.com/ // Description: Makes an element on the page stick on the screen as you scroll // It will only set the 'top' and 'position' of your element, you // might need to adjust the width in some cases. (function (factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['jquery'], factory); } else if (typeof module === 'object' && module.exports) { // Node/CommonJS module.exports = factory(require('jquery')); } else { // Browser globals factory(jQuery); } }(function ($) { var slice = Array.prototype.slice; // save ref to original slice() var splice = Array.prototype.splice; // save ref to original slice() var defaults = { topSpacing: 0, bottomSpacing: 0, className: 'is-sticky', wrapperClassName: 'sticky-wrapper', center: false, getWidthFrom: '', widthFromWrapper: true, // works only when .getWidthFrom is empty responsiveWidth: false, zIndex: 'inherit' }, $window = $(window), $document = $(document), sticked = [], windowHeight = $window.height(), scroller = function() { var scrollTop = $window.scrollTop(), documentHeight = $document.height(), dwh = documentHeight - windowHeight, extra = (scrollTop > dwh) ? dwh - scrollTop : 0; for (var i = 0, l = sticked.length; i < l; i++) { var s = sticked[i], elementTop = s.stickyWrapper.offset().top, etse = elementTop - s.topSpacing - extra; //update height in case of dynamic content s.stickyWrapper.css('height', s.stickyElement.outerHeight()); if (scrollTop <= etse) { if (s.currentTop !== null) { s.stickyElement .css({ 'width': '', 'position': '', 'top': '', 'z-index': '' }); s.stickyElement.parent().removeClass(s.className); s.stickyElement.trigger('sticky-end', [s]); s.currentTop = null; } } else { var newTop = documentHeight - s.stickyElement.outerHeight() - s.topSpacing - s.bottomSpacing - scrollTop - extra; if (newTop < 0) { newTop = newTop + s.topSpacing; } else { newTop = s.topSpacing; } if (s.currentTop !== newTop) { var newWidth; if (s.getWidthFrom) { padding = s.stickyElement.innerWidth() - s.stickyElement.width(); newWidth = $(s.getWidthFrom).width() - padding || null; } else if (s.widthFromWrapper) { newWidth = s.stickyWrapper.width(); } if (newWidth == null) { newWidth = s.stickyElement.width(); } s.stickyElement .css('width', newWidth) .css('position', 'fixed') .css('top', newTop) .css('z-index', s.zIndex); s.stickyElement.parent().addClass(s.className); if (s.currentTop === null) { s.stickyElement.trigger('sticky-start', [s]); } else { // sticky is started but it have to be repositioned s.stickyElement.trigger('sticky-update', [s]); } if (s.currentTop === s.topSpacing && s.currentTop > newTop || s.currentTop === null && newTop < s.topSpacing) { // just reached bottom || just started to stick but bottom is already reached s.stickyElement.trigger('sticky-bottom-reached', [s]); } else if(s.currentTop !== null && newTop === s.topSpacing && s.currentTop < newTop) { // sticky is started && sticked at topSpacing && overflowing from top just finished s.stickyElement.trigger('sticky-bottom-unreached', [s]); } s.currentTop = newTop; } // Check if sticky has reached end of container and stop sticking var stickyWrapperContainer = s.stickyWrapper.parent(); var unstick = (s.stickyElement.offset().top + s.stickyElement.outerHeight() >= stickyWrapperContainer.offset().top + stickyWrapperContainer.outerHeight()) && (s.stickyElement.offset().top <= s.topSpacing); if( unstick ) { s.stickyElement .css('position', 'absolute') .css('top', '') .css('bottom', 0) .css('z-index', ''); } else { s.stickyElement .css('position', 'fixed') .css('top', newTop) .css('bottom', '') .css('z-index', s.zIndex); } } } }, resizer = function() { windowHeight = $window.height(); for (var i = 0, l = sticked.length; i < l; i++) { var s = sticked[i]; var newWidth = null; if (s.getWidthFrom) { if (s.responsiveWidth) { newWidth = $(s.getWidthFrom).width(); } } else if(s.widthFromWrapper) { newWidth = s.stickyWrapper.width(); } if (newWidth != null) { s.stickyElement.css('width', newWidth); } } }, methods = { init: function(options) { return this.each(function() { var o = $.extend({}, defaults, options); var stickyElement = $(this); var stickyId = stickyElement.attr('id'); var wrapperId = stickyId ? stickyId + '-' + defaults.wrapperClassName : defaults.wrapperClassName; var wrapper = $('<div></div>') .attr('id', wrapperId) .addClass(o.wrapperClassName); stickyElement.wrapAll(function() { if ($(this).parent("#" + wrapperId).length == 0) { return wrapper; } }); var stickyWrapper = stickyElement.parent(); if (o.center) { stickyWrapper.css({width:stickyElement.outerWidth(),marginLeft:"auto",marginRight:"auto"}); } if (stickyElement.css("float") === "right") { stickyElement.css({"float":"none"}).parent().css({"float":"right"}); } o.stickyElement = stickyElement; o.stickyWrapper = stickyWrapper; o.currentTop = null; sticked.push(o); methods.setWrapperHeight(this); methods.setupChangeListeners(this); }); }, setWrapperHeight: function(stickyElement) { var element = $(stickyElement); var stickyWrapper = element.parent(); if (stickyWrapper) { stickyWrapper.css('height', element.outerHeight()); } }, setupChangeListeners: function(stickyElement) { if (window.MutationObserver) { var mutationObserver = new window.MutationObserver(function(mutations) { if (mutations[0].addedNodes.length || mutations[0].removedNodes.length) { methods.setWrapperHeight(stickyElement); } }); mutationObserver.observe(stickyElement, {subtree: true, childList: true}); } else { if (window.addEventListener) { stickyElement.addEventListener('DOMNodeInserted', function() { methods.setWrapperHeight(stickyElement); }, false); stickyElement.addEventListener('DOMNodeRemoved', function() { methods.setWrapperHeight(stickyElement); }, false); } else if (window.attachEvent) { stickyElement.attachEvent('onDOMNodeInserted', function() { methods.setWrapperHeight(stickyElement); }); stickyElement.attachEvent('onDOMNodeRemoved', function() { methods.setWrapperHeight(stickyElement); }); } } }, update: scroller, unstick: function(options) { return this.each(function() { var that = this; var unstickyElement = $(that); var removeIdx = -1; var i = sticked.length; while (i-- > 0) { if (sticked[i].stickyElement.get(0) === that) { splice.call(sticked,i,1); removeIdx = i; } } if(removeIdx !== -1) { unstickyElement.unwrap(); unstickyElement .css({ 'width': '', 'position': '', 'top': '', 'float': '', 'z-index': '' }) ; } }); } }; // should be more efficient than using $window.scroll(scroller) and $window.resize(resizer): if (window.addEventListener) { window.addEventListener('scroll', scroller, false); window.addEventListener('resize', resizer, false); } else if (window.attachEvent) { window.attachEvent('onscroll', scroller); window.attachEvent('onresize', resizer); } $.fn.sticky = function(method) { if (methods[method]) { return methods[method].apply(this, slice.call(arguments, 1)); } else if (typeof method === 'object' || !method ) { return methods.init.apply( this, arguments ); } else { $.error('Method ' + method + ' does not exist on jQuery.sticky'); } }; $.fn.unstick = function(method) { if (methods[method]) { return methods[method].apply(this, slice.call(arguments, 1)); } else if (typeof method === 'object' || !method ) { return methods.unstick.apply( this, arguments ); } else { $.error('Method ' + method + ' does not exist on jQuery.sticky'); } }; $(function() { setTimeout(scroller, 0); }); })); ;!function(a,b){function c(a,b,c){return[parseFloat(a[0])*(n.test(a[0])?b/100:1),parseFloat(a[1])*(n.test(a[1])?c/100:1)]}function d(b,c){return parseInt(a.css(b,c),10)||0}function e(b){var c=b[0];return 9===c.nodeType?{width:b.width(),height:b.height(),offset:{top:0,left:0}}:a.isWindow(c)?{width:b.width(),height:b.height(),offset:{top:b.scrollTop(),left:b.scrollLeft()}}:c.preventDefault?{width:0,height:0,offset:{top:c.pageY,left:c.pageX}}:{width:b.outerWidth(),height:b.outerHeight(),offset:b.offset()}}a.ui=a.ui||{};var f,g=Math.max,h=Math.abs,i=Math.round,j=/left|center|right/,k=/top|center|bottom/,l=/[\+\-]\d+(\.[\d]+)?%?/,m=/^\w+/,n=/%$/,o=a.fn.pos;a.pos={scrollbarWidth:function(){if(f!==b)return f;var c,d,e=a("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),g=e.children()[0];return a("body").append(e),c=g.offsetWidth,e.css("overflow","scroll"),d=g.offsetWidth,c===d&&(d=e[0].clientWidth),e.remove(),f=c-d},getScrollInfo:function(b){var c=b.isWindow||b.isDocument?"":b.element.css("overflow-x"),d=b.isWindow||b.isDocument?"":b.element.css("overflow-y"),e="scroll"===c||"auto"===c&&b.width<b.element[0].scrollWidth,f="scroll"===d||"auto"===d&&b.height<b.element[0].scrollHeight;return{width:f?a.pos.scrollbarWidth():0,height:e?a.pos.scrollbarWidth():0}},getWithinInfo:function(b){var c=a(b||window),d=a.isWindow(c[0]),e=!!c[0]&&9===c[0].nodeType;return{element:c,isWindow:d,isDocument:e,offset:c.offset()||{left:0,top:0},scrollLeft:c.scrollLeft(),scrollTop:c.scrollTop(),width:d?c.width():c.outerWidth(),height:d?c.height():c.outerHeight()}}},a.fn.pos=function(b){if(!b||!b.of)return o.apply(this,arguments);b=a.extend({},b);var f,n,p,q,r,s,t=a(b.of),u=a.pos.getWithinInfo(b.within),v=a.pos.getScrollInfo(u),w=(b.collision||"flip").split(" "),x={};return s=e(t),t[0].preventDefault&&(b.at="left top"),n=s.width,p=s.height,q=s.offset,r=a.extend({},q),a.each(["my","at"],function(){var a,c,d=(b[this]||"").split(" ");1===d.length&&(d=j.test(d[0])?d.concat(["center"]):k.test(d[0])?["center"].concat(d):["center","center"]),d[0]=j.test(d[0])?d[0]:"center",d[1]=k.test(d[1])?d[1]:"center",a=l.exec(d[0]),c=l.exec(d[1]),x[this]=[a?a[0]:0,c?c[0]:0],b[this]=[m.exec(d[0])[0],m.exec(d[1])[0]]}),1===w.length&&(w[1]=w[0]),"right"===b.at[0]?r.left+=n:"center"===b.at[0]&&(r.left+=n/2),"bottom"===b.at[1]?r.top+=p:"center"===b.at[1]&&(r.top+=p/2),f=c(x.at,n,p),r.left+=f[0],r.top+=f[1],this.each(function(){var e,j,k=a(this),l=k.outerWidth(),m=k.outerHeight(),o=d(this,"marginLeft"),s=d(this,"marginTop"),y=l+o+d(this,"marginRight")+v.width,z=m+s+d(this,"marginBottom")+v.height,A=a.extend({},r),B=c(x.my,k.outerWidth(),k.outerHeight());"right"===b.my[0]?A.left-=l:"center"===b.my[0]&&(A.left-=l/2),"bottom"===b.my[1]?A.top-=m:"center"===b.my[1]&&(A.top-=m/2),A.left+=B[0],A.top+=B[1],a.support.offsetFractions||(A.left=i(A.left),A.top=i(A.top)),e={marginLeft:o,marginTop:s},a.each(["left","top"],function(c,d){a.ui.pos[w[c]]&&a.ui.pos[w[c]][d](A,{targetWidth:n,targetHeight:p,elemWidth:l,elemHeight:m,collisionPosition:e,collisionWidth:y,collisionHeight:z,offset:[f[0]+B[0],f[1]+B[1]],my:b.my,at:b.at,within:u,elem:k})}),b.using&&(j=function(a){var c=q.left-A.left,d=c+n-l,e=q.top-A.top,f=e+p-m,i={target:{element:t,left:q.left,top:q.top,width:n,height:p},element:{element:k,left:A.left,top:A.top,width:l,height:m},horizontal:0>d?"left":c>0?"right":"center",vertical:0>f?"top":e>0?"bottom":"middle"};l>n&&h(c+d)<n&&(i.horizontal="center"),m>p&&h(e+f)<p&&(i.vertical="middle"),i.important=g(h(c),h(d))>g(h(e),h(f))?"horizontal":"vertical",b.using.call(this,a,i)}),k.offset(a.extend(A,{using:j}))})},a.ui.pos={_trigger:function(a,b,c,d){b.elem&&b.elem.trigger({type:c,position:a,positionData:b,triggered:d})},fit:{left:function(b,c){a.ui.pos._trigger(b,c,"posCollide","fitLeft");var d,e=c.within,f=e.isWindow?e.scrollLeft:e.offset.left,h=e.width,i=b.left-c.collisionPosition.marginLeft,j=f-i,k=i+c.collisionWidth-h-f;c.collisionWidth>h?j>0&&0>=k?(d=b.left+j+c.collisionWidth-h-f,b.left+=j-d):b.left=k>0&&0>=j?f:j>k?f+h-c.collisionWidth:f:j>0?b.left+=j:k>0?b.left-=k:b.left=g(b.left-i,b.left),a.ui.pos._trigger(b,c,"posCollided","fitLeft")},top:function(b,c){a.ui.pos._trigger(b,c,"posCollide","fitTop");var d,e=c.within,f=e.isWindow?e.scrollTop:e.offset.top,h=c.within.height,i=b.top-c.collisionPosition.marginTop,j=f-i,k=i+c.collisionHeight-h-f;c.collisionHeight>h?j>0&&0>=k?(d=b.top+j+c.collisionHeight-h-f,b.top+=j-d):b.top=k>0&&0>=j?f:j>k?f+h-c.collisionHeight:f:j>0?b.top+=j:k>0?b.top-=k:b.top=g(b.top-i,b.top),a.ui.pos._trigger(b,c,"posCollided","fitTop")}},flip:{left:function(b,c){a.ui.pos._trigger(b,c,"posCollide","flipLeft");var d,e,f=c.within,g=f.offset.left+f.scrollLeft,i=f.width,j=f.isWindow?f.scrollLeft:f.offset.left,k=b.left-c.collisionPosition.marginLeft,l=k-j,m=k+c.collisionWidth-i-j,n="left"===c.my[0]?-c.elemWidth:"right"===c.my[0]?c.elemWidth:0,o="left"===c.at[0]?c.targetWidth:"right"===c.at[0]?-c.targetWidth:0,p=-2*c.offset[0];0>l?(d=b.left+n+o+p+c.collisionWidth-i-g,(0>d||d<h(l))&&(b.left+=n+o+p)):m>0&&(e=b.left-c.collisionPosition.marginLeft+n+o+p-j,(e>0||h(e)<m)&&(b.left+=n+o+p)),a.ui.pos._trigger(b,c,"posCollided","flipLeft")},top:function(b,c){a.ui.pos._trigger(b,c,"posCollide","flipTop");var d,e,f=c.within,g=f.offset.top+f.scrollTop,i=f.height,j=f.isWindow?f.scrollTop:f.offset.top,k=b.top-c.collisionPosition.marginTop,l=k-j,m=k+c.collisionHeight-i-j,n="top"===c.my[1],o=n?-c.elemHeight:"bottom"===c.my[1]?c.elemHeight:0,p="top"===c.at[1]?c.targetHeight:"bottom"===c.at[1]?-c.targetHeight:0,q=-2*c.offset[1];0>l?(e=b.top+o+p+q+c.collisionHeight-i-g,b.top+o+p+q>l&&(0>e||e<h(l))&&(b.top+=o+p+q)):m>0&&(d=b.top-c.collisionPosition.marginTop+o+p+q-j,b.top+o+p+q>m&&(d>0||h(d)<m)&&(b.top+=o+p+q)),a.ui.pos._trigger(b,c,"posCollided","flipTop")}},flipfit:{left:function(){a.ui.pos.flip.left.apply(this,arguments),a.ui.pos.fit.left.apply(this,arguments)},top:function(){a.ui.pos.flip.top.apply(this,arguments),a.ui.pos.fit.top.apply(this,arguments)}}},function(){var b,c,d,e,f,g=document.getElementsByTagName("body")[0],h=document.createElement("div");b=document.createElement(g?"div":"body"),d={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},g&&a.extend(d,{position:"absolute",left:"-1000px",top:"-1000px"});for(f in d)b.style[f]=d[f];b.appendChild(h),c=g||document.documentElement,c.insertBefore(b,c.firstChild),h.style.cssText="position: absolute; left: 10.7432222px;",e=a(h).offset().left,a.support.offsetFractions=e>10&&11>e,b.innerHTML="",c.removeChild(b)}()}(jQuery),function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):window.jQuery&&!window.jQuery.fn.iconpicker&&a(window.jQuery)}(function(a){"use strict";var b={isEmpty:function(a){return a===!1||""===a||null===a||void 0===a},isEmptyObject:function(a){return this.isEmpty(a)===!0||0===a.length},isElement:function(b){return a(b).length>0},isString:function(a){return"string"==typeof a||a instanceof String},isArray:function(b){return a.isArray(b)},inArray:function(b,c){return-1!==a.inArray(b,c)},throwError:function(a){throw"Font Awesome Icon Picker Exception: "+a}},c=function(d,e){this._id=c._idCounter++,this.element=a(d).addClass("iconpicker-element"),this._trigger("iconpickerCreate"),this.options=a.extend({},c.defaultOptions,this.element.data(),e),this.options.templates=a.extend({},c.defaultOptions.templates,this.options.templates),this.options.originalPlacement=this.options.placement,this.container=b.isElement(this.options.container)?a(this.options.container):!1,this.container===!1&&(this.container=this.element.is("input")?this.element.parent():this.element),this.container.addClass("iconpicker-container").is(".dropdown-menu")&&(this.options.placement="inline"),this.input=this.element.is("input")?this.element.addClass("iconpicker-input"):!1,this.input===!1&&(this.input=this.container.find(this.options.input)),this.component=this.container.find(this.options.component).addClass("iconpicker-component"),0===this.component.length?this.component=!1:this.component.find("i").addClass(this.options.iconComponentBaseClass),this._createPopover(),this._createIconpicker(),0===this.getAcceptButton().length&&(this.options.mustAccept=!1),this.container.is(".input-group")?this.container.parent().append(this.popover):this.container.append(this.popover),this._bindElementEvents(),this._bindWindowEvents(),this.update(this.options.selected),this.isInline()&&this.show(),this._trigger("iconpickerCreated")};c._idCounter=0,c.defaultOptions={title:!1,selected:!1,defaultValue:!1,placement:"bottom",collision:"none",animation:!0,hideOnSelect:!1,showFooter:!1,searchInFooter:!1,mustAccept:!1,selectedCustomClass:"bg-primary",icons:[],iconBaseClass:"fa",iconComponentBaseClass:"fa fa-fw",iconClassPrefix:"fa-",input:"input",component:".input-group-addon",container:!1,templates:{popover:'<div class="iconpicker-popover popover"><div class="arrow"></div><div class="popover-title"></div><div class="popover-content"></div></div>',footer:'<div class="popover-footer"></div>',buttons:'<button class="iconpicker-btn iconpicker-btn-cancel btn btn-default btn-sm">Cancel</button> <button class="iconpicker-btn iconpicker-btn-accept btn btn-primary btn-sm">Accept</button>',search:'<input type="search" class="form-control iconpicker-search" placeholder="Type to filter" />',iconpicker:'<div class="iconpicker"><div class="iconpicker-items"></div></div>',iconpickerItem:'<div class="iconpicker-item"><i></i></div>'}},c.batch=function(b,c){var d=Array.prototype.slice.call(arguments,2);return a(b).each(function(){var b=a(this).data("iconpicker");b&&b[c].apply(b,d)})},c.prototype={constructor:c,options:{},_id:0,_trigger:function(b,c){c=c||{},this.element.trigger(a.extend({type:b,iconpickerInstance:this},c))},_createPopover:function(){this.popover=a(this.options.templates.popover);var c=this.popover.find(".popover-title");if(this.options.title&&c.append(a('<div class="popover-title-text">'+this.options.title+"</div>")),this.options.searchInFooter||b.isEmpty(this.options.templates.buttons)?this.options.title||c.remove():c.append(this.options.templates.search),this.options.showFooter&&!b.isEmpty(this.options.templates.footer)){var d=a(this.options.templates.footer);!b.isEmpty(this.options.templates.search)&&this.options.searchInFooter&&d.append(a(this.options.templates.search)),b.isEmpty(this.options.templates.buttons)||d.append(a(this.options.templates.buttons)),this.popover.append(d)}return this.options.animation===!0&&this.popover.addClass("fade"),this.popover},_createIconpicker:function(){var b=this;this.iconpicker=a(this.options.templates.iconpicker);var c=function(){var c=a(this);c.is("."+b.options.iconBaseClass)&&(c=c.parent()),b._trigger("iconpickerSelect",{iconpickerItem:c,iconpickerValue:b.iconpickerValue}),b.options.mustAccept===!1?(b.update(c.data("iconpickerValue")),b._trigger("iconpickerSelected",{iconpickerItem:this,iconpickerValue:b.iconpickerValue})):b.update(c.data("iconpickerValue"),!0),b.options.hideOnSelect&&b.options.mustAccept===!1&&b.hide()};for(var d in this.options.icons){var e=a(this.options.templates.iconpickerItem);e.find("i").addClass(b.options.iconBaseClass+" "+this.options.iconClassPrefix+this.options.icons[d]),e.data("iconpickerValue",this.options.icons[d]).on("click.iconpicker",c),this.iconpicker.find(".iconpicker-items").append(e.attr("title","."+this.getValue(this.options.icons[d])))}return this.popover.find(".popover-content").append(this.iconpicker),this.iconpicker},_isEventInsideIconpicker:function(b){var c=a(b.target);return c.hasClass("iconpicker-element")&&(!c.hasClass("iconpicker-element")||c.is(this.element))||0!==c.parents(".iconpicker-popover").length?!0:!1},_bindElementEvents:function(){var c=this;this.getSearchInput().on("keyup",function(){c.filter(a(this).val().toLowerCase())}),this.getAcceptButton().on("click.iconpicker",function(){var a=c.iconpicker.find(".iconpicker-selected").get(0);c.update(c.iconpickerValue),c._trigger("iconpickerSelected",{iconpickerItem:a,iconpickerValue:c.iconpickerValue}),c.isInline()||c.hide()}),this.getCancelButton().on("click.iconpicker",function(){c.isInline()||c.hide()}),this.element.on("focus.iconpicker",function(a){c.show(),a.stopPropagation()}),this.hasComponent()&&this.component.on("click.iconpicker",function(){c.toggle()}),this.hasInput()&&this.input.on("keyup.iconpicker",function(a){b.inArray(a.keyCode,[38,40,37,39,16,17,18,9,8,91,93,20,46,186,190,46,78,188,44,86])?c._updateFormGroupStatus(c.getValid(this.value)!==!1):c.update()})},_bindWindowEvents:function(){var b=a(window.document),c=this,d=".iconpicker.inst"+this._id;return a(window).on("resize.iconpicker"+d+" orientationchange.iconpicker"+d,function(){c.popover.hasClass("in")&&c.updatePlacement()}),c.isInline()||b.on("mouseup"+d,function(a){return c._isEventInsideIconpicker(a)||c.isInline()||c.hide(),a.stopPropagation(),a.preventDefault(),!1}),!1},_unbindElementEvents:function(){this.popover.off(".iconpicker"),this.element.off(".iconpicker"),this.hasInput()&&this.input.off(".iconpicker"),this.hasComponent()&&this.component.off(".iconpicker"),this.hasContainer()&&this.container.off(".iconpicker")},_unbindWindowEvents:function(){a(window).off(".iconpicker.inst"+this._id),a(window.document).off(".iconpicker.inst"+this._id)},updatePlacement:function(b,c){b=b||this.options.placement,this.options.placement=b,c=c||this.options.collision,c=c===!0?"flip":c;var d={at:"right bottom",my:"right top",of:this.hasInput()?this.input:this.container,collision:c===!0?"flip":c,within:window};if(this.popover.removeClass("inline topLeftCorner topLeft top topRight topRightCorner rightTop right rightBottom bottomRight bottomRightCorner bottom bottomLeft bottomLeftCorner leftBottom left leftTop"),"object"==typeof b)return this.popover.pos(a.extend({},d,b));switch(b){case"inline":d=!1;break;case"topLeftCorner":d.my="right bottom",d.at="left top";break;case"topLeft":d.my="left bottom",d.at="left top";break;case"top":d.my="center bottom",d.at="center top";break;case"topRight":d.my="right bottom",d.at="right top";break;case"topRightCorner":d.my="left bottom",d.at="right top";break;case"rightTop":d.my="left bottom",d.at="right center";break;case"right":d.my="left center",d.at="right center";break;case"rightBottom":d.my="left top",d.at="right center";break;case"bottomRightCorner":d.my="left top",d.at="right bottom";break;case"bottomRight":d.my="right top",d.at="right bottom";break;case"bottom":d.my="center top",d.at="center bottom";break;case"bottomLeft":d.my="left top",d.at="left bottom";break;case"bottomLeftCorner":d.my="right top",d.at="left bottom";break;case"leftBottom":d.my="right top",d.at="left center";break;case"left":d.my="right center",d.at="left center";break;case"leftTop":d.my="right bottom",d.at="left center";break;default:return!1}return this.popover.css({display:"inline"===this.options.placement?"":"block"}),d!==!1?this.popover.pos(d).css("maxWidth",a(window).width()-this.container.offset().left-5):this.popover.css({top:"auto",right:"auto",bottom:"auto",left:"auto",maxWidth:"none"}),this.popover.addClass(this.options.placement),!0},_updateComponents:function(){if(this.iconpicker.find(".iconpicker-item.iconpicker-selected").removeClass("iconpicker-selected "+this.options.selectedCustomClass),this.iconpicker.find("."+this.options.iconBaseClass+"."+this.options.iconClassPrefix+this.iconpickerValue).parent().addClass("iconpicker-selected "+this.options.selectedCustomClass),this.hasComponent()){var a=this.component.find("i");a.length>0?a.attr("class",this.options.iconComponentBaseClass+" "+this.getValue()):this.component.html(this.getValueHtml())}},_updateFormGroupStatus:function(a){return this.hasInput()?(a!==!1?this.input.parents(".form-group:first").removeClass("has-error"):this.input.parents(".form-group:first").addClass("has-error"),!0):!1},getValid:function(c){b.isString(c)||(c="");var d=""===c;return c=a.trim(c.replace(this.options.iconClassPrefix,"")),b.inArray(c,this.options.icons)||d?c:!1},setValue:function(a){var b=this.getValid(a);return b!==!1?(this.iconpickerValue=b,this._trigger("iconpickerSetValue",{iconpickerValue:b}),this.iconpickerValue):(this._trigger("iconpickerInvalid",{iconpickerValue:a}),!1)},getValue:function(a){return this.options.iconClassPrefix+(a?a:this.iconpickerValue)},getValueHtml:function(){return'<i class="'+this.options.iconBaseClass+" "+this.getValue()+'"></i>'},setSourceValue:function(a){return a=this.setValue(a),a!==!1&&""!==a&&(this.hasInput()?this.input.val(this.getValue()):this.element.data("iconpickerValue",this.getValue()),this._trigger("iconpickerSetSourceValue",{iconpickerValue:a})),a},getSourceValue:function(a){a=a||this.options.defaultValue;var b=a;return b=this.hasInput()?this.input.val():this.element.data("iconpickerValue"),(void 0===b||""===b||null===b||b===!1)&&(b=a),b},hasInput:function(){return this.input!==!1},hasComponent:function(){return this.component!==!1},hasContainer:function(){return this.container!==!1},getAcceptButton:function(){return this.popover.find(".iconpicker-btn-accept")},getCancelButton:function(){return this.popover.find(".iconpicker-btn-cancel")},getSearchInput:function(){return this.popover.find(".iconpicker-search")},filter:function(c){if(b.isEmpty(c))return this.iconpicker.find(".iconpicker-item").show(),a(!1);var d=[];return this.iconpicker.find(".iconpicker-item").each(function(){var b=a(this),e=b.attr("title").toLowerCase(),f=!1;try{f=new RegExp(c,"g")}catch(g){f=!1}f!==!1&&e.match(f)?(d.push(b),b.show()):b.hide()}),d},show:function(){return this.popover.hasClass("in")?!1:(a.iconpicker.batch(a(".iconpicker-popover.in:not(.inline)").not(this.popover),"hide"),this._trigger("iconpickerShow"),this.updatePlacement(),this.popover.addClass("in"),void setTimeout(a.proxy(function(){this.popover.css("display",this.isInline()?"":"block"),this._trigger("iconpickerShown")},this),this.options.animation?300:1))},hide:function(){return this.popover.hasClass("in")?(this._trigger("iconpickerHide"),this.popover.removeClass("in"),void setTimeout(a.proxy(function(){this.popover.css("display","none"),this.getSearchInput().val(""),this.filter(""),this._trigger("iconpickerHidden")},this),this.options.animation?300:1)):!1},toggle:function(){this.popover.is(":visible")?this.hide():this.show(!0)},update:function(a,b){return a=a?a:this.getSourceValue(this.iconpickerValue),this._trigger("iconpickerUpdate"),b===!0?a=this.setValue(a):(a=this.setSourceValue(a),this._updateFormGroupStatus(a!==!1)),a!==!1&&this._updateComponents(),this._trigger("iconpickerUpdated"),a},destroy:function(){this._trigger("iconpickerDestroy"),this.element.removeData("iconpicker").removeData("iconpickerValue").removeClass("iconpicker-element"),this._unbindElementEvents(),this._unbindWindowEvents(),a(this.popover).remove(),this._trigger("iconpickerDestroyed")},disable:function(){return this.hasInput()?(this.input.prop("disabled",!0),!0):!1},enable:function(){return this.hasInput()?(this.input.prop("disabled",!1),!0):!1},isDisabled:function(){return this.hasInput()?this.input.prop("disabled")===!0:!1},isInline:function(){return"inline"===this.options.placement||this.popover.hasClass("inline")}},a.iconpicker=c,a.fn.iconpicker=function(b){return this.each(function(){var d=a(this);d.data("iconpicker")||d.data("iconpicker",new c(this,"object"==typeof b?b:{}))})},c.defaultOptions.icons=["adjust","adn","align-center","align-justify","align-left","align-right","ambulance","anchor","android","angle-double-down","angle-double-left","angle-double-right","angle-double-up","angle-down","angle-left","angle-right","angle-up","apple","archive","arrow-circle-down","arrow-circle-left","arrow-circle-o-down","arrow-circle-o-left","arrow-circle-o-right","arrow-circle-o-up","arrow-circle-right","arrow-circle-up","arrow-down","arrow-left","arrow-right","arrow-up","arrows","arrows-alt","arrows-h","arrows-v","asterisk","automobile","backward","ban","bank","bar-chart-o","barcode","bars","beer","behance","behance-square","bell","bell-o","bitbucket","bitbucket-square","bitcoin","bold","bolt","bomb","book","bookmark","bookmark-o","briefcase","btc","bug","building","building-o","bullhorn","bullseye","cab","calendar","calendar-o","camera","camera-retro","car","caret-down","caret-left","caret-right","caret-square-o-down","caret-square-o-left","caret-square-o-right","caret-square-o-up","caret-up","certificate","chain","chain-broken","check","check-circle","check-circle-o","check-square","check-square-o","chevron-circle-down","chevron-circle-left","chevron-circle-right","chevron-circle-up","chevron-down","chevron-left","chevron-right","chevron-up","child","circle","circle-o","circle-o-notch","circle-thin","clipboard","clock-o","cloud","cloud-download","cloud-upload","cny","code","code-fork","codepen","coffee","cog","cogs","columns","comment","comment-o","comments","comments-o","compass","compress","copy","credit-card","crop","crosshairs","css3","cube","cubes","cut","cutlery","dashboard","database","dedent","delicious","desktop","deviantart","digg","dollar","dot-circle-o","download","dribbble","dropbox","drupal","edit","eject","ellipsis-h","ellipsis-v","empire","envelope","envelope-o","envelope-square","eraser","eur","euro","exchange","exclamation","exclamation-circle","exclamation-triangle","expand","external-link","external-link-square","eye","eye-slash","facebook","facebook-square","fast-backward","fast-forward","fax","female","fighter-jet","file","file-archive-o","file-audio-o","file-code-o","file-excel-o","file-image-o","file-movie-o","file-o","file-pdf-o","file-photo-o","file-picture-o","file-powerpoint-o","file-sound-o","file-text","file-text-o","file-video-o","file-word-o","file-zip-o","files-o","film","filter","fire","fire-extinguisher","flag","flag-checkered","flag-o","flash","flask","flickr","floppy-o","folder","folder-o","folder-open","folder-open-o","font","forward","foursquare","frown-o","gamepad","gavel","gbp","ge","gear","gears","gift","git","git-square","github","github-alt","github-square","gittip","glass","globe","google","google-plus","google-plus-square","graduation-cap","group","h-square","hacker-news","hand-o-down","hand-o-left","hand-o-right","hand-o-up","hdd-o","header","headphones","heart","heart-o","history","home","hospital-o","html5","image","inbox","indent","info","info-circle","inr","instagram","institution","italic","joomla","jpy","jsfiddle","key","keyboard-o","krw","language","laptop","leaf","legal","lemon-o","level-down","level-up","life-bouy","life-ring","life-saver","lightbulb-o","link","linkedin","linkedin-square","linux","list","list-alt","list-ol","list-ul","location-arrow","lock","long-arrow-down","long-arrow-left","long-arrow-right","long-arrow-up","magic","magnet","mail-forward","mail-reply","mail-reply-all","male","map-marker","maxcdn","medkit","meh-o","microphone","microphone-slash","minus","minus-circle","minus-square","minus-square-o","mobile","mobile-phone","money","moon-o","mortar-board","music","navicon","openid","outdent","pagelines","paper-plane","paper-plane-o","paperclip","paragraph","paste","pause","paw","pencil","pencil-square","pencil-square-o","phone","phone-square","photo","picture-o","pied-piper","pied-piper-alt","pied-piper-square","pinterest","pinterest-square","plane","play","play-circle","play-circle-o","plus","plus-circle","plus-square","plus-square-o","power-off","print","puzzle-piece","qq","qrcode","question","question-circle","quote-left","quote-right","ra","random","rebel","recycle","reddit","reddit-square","refresh","renren","reorder","repeat","reply","reply-all","retweet","rmb","road","rocket","rotate-left","rotate-right","rouble","rss","rss-square","rub","ruble","rupee","save","scissors","search","search-minus","search-plus","send","send-o","share","share-alt","share-alt-square","share-square","share-square-o","shield","shopping-cart","sign-in","sign-out","signal","sitemap","skype","slack","sliders","smile-o","sort","sort-alpha-asc","sort-alpha-desc","sort-amount-asc","sort-amount-desc","sort-asc","sort-desc","sort-down","sort-numeric-asc","sort-numeric-desc","sort-up","soundcloud","space-shuttle","spinner","spoon","spotify","square","square-o","stack-exchange","stack-overflow","star","star-half","star-half-empty","star-half-full","star-half-o","star-o","steam","steam-square","step-backward","step-forward","stethoscope","stop","strikethrough","stumbleupon","stumbleupon-circle","subscript","suitcase","sun-o","superscript","support","table","tablet","tachometer","tag","tags","tasks","taxi","tencent-weibo","terminal","text-height","text-width","th","th-large","th-list","thumb-tack","thumbs-down","thumbs-o-down","thumbs-o-up","thumbs-up","ticket","times","times-circle","times-circle-o","tint","toggle-down","toggle-left","toggle-right","toggle-up","trash-o","tree","trello","trophy","truck","try","tumblr","tumblr-square","turkish-lira","twitter","twitter-square","umbrella","underline","undo","university","unlink","unlock","unlock-alt","unsorted","upload","usd","user","user-md","users","video-camera","vimeo-square","vine","vk","volume-down","volume-off","volume-up","warning","wechat","weibo","weixin","wheelchair","windows","won","wordpress","wrench","xing","xing-square","yahoo","yen","youtube","youtube-play","youtube-square"]});;/** * Copyright (c) 2007 Ariel Flesler - aflesler â—‹ gmail • com | https://github.com/flesler * Licensed under MIT * @author Ariel Flesler * @version 2.1.3 */ ;(function(factory){'use strict';if(typeof define==='function'&&define.amd){define(['jquery'],factory)}else if(typeof module!=='undefined'&&module.exports){module.exports=factory(require('jquery'))}else{factory(jQuery)}})(function($){'use strict';var $scrollTo=$.scrollTo=function(target,duration,settings){return $(window).scrollTo(target,duration,settings)};$scrollTo.defaults={axis:'xy',duration:0,limit:true};function isWin(elem){return!elem.nodeName||$.inArray(elem.nodeName.toLowerCase(),['iframe','#document','html','body'])!==-1}function isFunction(obj){return typeof obj==='function'}$.fn.scrollTo=function(target,duration,settings){if(typeof duration==='object'){settings=duration;duration=0}if(typeof settings==='function'){settings={onAfter:settings}}if(target==='max'){target=9e9}settings=$.extend({},$scrollTo.defaults,settings);duration=duration||settings.duration;var queue=settings.queue&&settings.axis.length>1;if(queue){duration/=2}settings.offset=both(settings.offset);settings.over=both(settings.over);return this.each(function(){if(target===null){return}var win=isWin(this),elem=win?this.contentWindow||window:this,$elem=$(elem),targ=target,attr={},toff;switch(typeof targ){case 'number':case 'string':if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break}targ=win?$(targ):$(targ,elem);case 'object':if(targ.length===0){return}if(targ.is||targ.style){toff=(targ=$(targ)).offset()}}var offset=isFunction(settings.offset)&&settings.offset(elem,targ)||settings.offset;$.each(settings.axis.split(''),function(i,axis){var Pos=axis==='x'?'Left':'Top',pos=Pos.toLowerCase(),key='scroll'+Pos,prev=$elem[key](),max=$scrollTo.max(elem,axis);if(toff){attr[key]=toff[pos]+(win?0:prev-$elem.offset()[pos]);if(settings.margin){attr[key]-=parseInt(targ.css('margin'+Pos),10)||0;attr[key]-=parseInt(targ.css('border'+Pos+'Width'),10)||0}attr[key]+=offset[pos]||0;if(settings.over[pos]){attr[key]+=targ[axis==='x'?'width':'height']()*settings.over[pos]}}else{var val=targ[pos];attr[key]=val.slice&&val.slice(-1)==='%'?parseFloat(val)/100*max:val}if(settings.limit&&/^\d+$/.test(attr[key])){attr[key]=attr[key]<=0?0:Math.min(attr[key],max)}if(!i&&settings.axis.length>1){if(prev===attr[key]){attr={}}else if(queue){animate(settings.onAfterFirst);attr={}}}});animate(settings.onAfter);function animate(callback){var opts=$.extend({},settings,{queue:true,duration:duration,complete:callback&&function(){callback.call(elem,targ,settings)}});$elem.animate(attr,opts)}})};$scrollTo.max=function(elem,axis){var Dim=axis==='x'?'Width':'Height',scroll='scroll'+Dim;if(!isWin(elem)){return elem[scroll]-$(elem)[Dim.toLowerCase()]()}var size='client'+Dim,doc=elem.ownerDocument||elem.document,html=doc.documentElement,body=doc.body;return Math.max(html[scroll],body[scroll])-Math.min(html[size],body[size])};function both(val){return isFunction(val)||$.isPlainObject(val)?val:{top:val,left:val}}$.Tween.propHooks.scrollLeft=$.Tween.propHooks.scrollTop={get:function(t){return $(t.elem)[t.prop]()},set:function(t){var curr=this.get(t);if(t.options.interrupt&&t._last&&t._last!==curr){return $(t.elem).stop()}var next=Math.round(t.now);if(curr!==next){$(t.elem)[t.prop](next);t._last=this.get(t)}}};return $scrollTo});;/** * Created by PA25072016 on 6/15/2017. */ jQuery(function($){ $(document).ready(function () { if($('.st-flight-search').length > 0){ var el = $('.st-flight-search'); el.find('.nav li').on('click', function () { if($(this).hasClass('one_way')){ el.addClass('one_way'); $('input[name="flight_type"]').val('one_way'); }else{ el.removeClass('one_way'); $('input[name="flight_type"]').val('return'); } }); } var flight_data = { price_depart: 0, price_depart_html: '', total_price_depart: 0, total_price_depart_html: '', tax_price_depart: '', enable_tax_depart: 'no', price_return: 0, price_return_html: '', total_price_return: 0, total_price_return_html: '', tax_price_return: '', enable_tax_return: 'no', total_price: 0, total_price_html: '', flight_type: $('.st-booking-list-flight').data('flight_type') }; $('input[name="flight1"]').iCheck('uncheck'); $('input[name="flight2"]').iCheck('uncheck'); $('.st-cal-flight-depart').each(function () { var t = $(this); //$(document).on('click', 'input[name="flight1"]', function(event){ $('input[name="flight1"]').on('ifChecked', function(event){ $('.st-cal-flight-depart').removeClass('active'); t.addClass('active'); var elink = $(this).closest('li').data('external-link'); var emode = $(this).closest('li').data('external'); if(emode == 'on'){ $('.flight-book-now').hide(); var emessage = $('.flight-message'); if($('.e-external-alter').length == 0) { $('.st-booking-select-depart, .st-booking-select-return, .st-flight-total-price').hide(); emessage.after('<p class="e-external-alter"><b>'+$(this).closest('li').data('external-text')+'</b></p>'); $('.e-external-alter').after('<a href="'+ elink +'" class="btn btn-primary btn-external-link">'+$('.flight-book-now').text()+'</a>'); }else{ $('.btn-external-link').attr('href', elink); } }else{ eftype = 'on_way'; var eftype = $('.st-booking-list-flight').data('flight_type'); if(eftype == 'on_way') { $('.flight-book-now').show(); $('.st-booking-select-depart, .st-booking-select-return, .st-flight-total-price').show(); if ($('.e-external-alter').length > 0) { $('.e-external-alter, .btn-external-link').remove(); } }else{ var echeck = 0; var eelink = '#'; $('input[name="flight2"]:checked').each(function (el) { if($(this).data('external') == 'on'){ echeck = 1; eelink = $(this).closest('li').data('external-link'); }else{ echeck = 2; } }); if(echeck == 0 || echeck == 2){ $('.flight-book-now').show(); $('.st-booking-select-depart, .st-booking-select-return, .st-flight-total-price').show(); if ($('.e-external-alter').length > 0) { $('.e-external-alter, .btn-external-link').remove(); } }else{ $('.flight-book-now').hide(); var emessage = $('.flight-message'); if($('.e-external-alter').length == 0) { $('.st-booking-select-depart, .st-booking-select-return, .st-flight-total-price').hide(); emessage.after('<p class="e-external-alter"><b>'+$(this).closest('li').data('external-text')+'</b></p>'); $('.e-external-alter').after('<a href="'+ eelink +'" class="btn btn-primary btn-external-link">'+$('.flight-book-now').text()+'</a>'); }else{ $('.btn-external-link').attr('href', eelink); } echeck = 0; } } } var price_depart = $(this).data('price'); if(price_depart){ flight_data.price_depart = price_depart; flight_data.total_price_depart = flight_data.price_depart; $('.st-booking-select-depart').removeClass('hidden'); $('.st-booking-select-depart').find('.fare .price').html(format_money(flight_data.price_depart )); var tax_enable = $(this).data('tax'); var tax_amount = $(this).data('tax_amount'); if(tax_enable != 'no'){ console.log(parseFloat(tax_amount)); tax_price = (parseFloat(tax_amount) * parseFloat(flight_data.price_depart))/100; if(tax_price > 0){ flight_data.total_price_depart = flight_data.price_depart + tax_price; $('.st-booking-select-depart').find('.tax').removeClass('hidden'); $('.st-booking-select-depart').find('.tax .price').html(format_money(tax_price)) }else{ $('.st-booking-select-depart').find('.tax').addClass('hidden'); } }else{ $('.st-booking-select-depart').find('.tax').addClass('hidden'); } $('.st-booking-select-depart').find('.total .price').html(format_money(flight_data.total_price_depart )); $('.booking-flight-form input[name="depart_id"]').val($(this).data('post_id')); if($(this).data('business') == 1){ $('.booking-flight-form input[name="price_class_depart"]').val('business_price'); }else{ $('.booking-flight-form input[name="price_class_depart"]').val('eco_price'); } } calculate_total_price(); }); }); $('.st-cal-flight-return').each(function () { var t = $(this); t.find('input[name="flight2"]').on('ifChecked', function(event){ $('.st-select-item-flight-return').removeClass('active'); t.addClass('active'); var elink = $(this).closest('li').data('external-link'); var emode = $(this).closest('li').data('external'); if(emode == 'on'){ $('.flight-book-now').hide(); var emessage = $('.flight-message'); if($('.e-external-alter').length == 0) { $('.st-booking-select-depart, .st-booking-select-return, .st-flight-total-price').hide(); emessage.after('<p class="e-external-alter"><b>'+$(this).closest('li').data('external-text')+'</b></p>'); $('.e-external-alter').after('<a href="'+ elink +'" class="btn btn-primary btn-external-link">'+$('.flight-book-now').text()+'</a>'); } }else{ var echeck = 0; var eelink = '#'; $('input[name="flight1"]:checked').each(function (el) { if($(this).data('external') == 'on'){ echeck = 1; eelink = $(this).closest('li').data('external-link'); }else{ echeck = 2; } }); if(echeck == 0 || echeck == 2){ $('.flight-book-now').show(); $('.st-booking-select-depart, .st-booking-select-return, .st-flight-total-price').show(); if ($('.e-external-alter').length > 0) { $('.e-external-alter, .btn-external-link').remove(); } }else{ $('.flight-book-now').hide(); var emessage = $('.flight-message'); if($('.e-external-alter').length == 0) { $('.st-booking-select-depart, .st-booking-select-return, .st-flight-total-price').hide(); emessage.after('<p class="e-external-alter"><b>'+$(this).closest('li').data('external-text')+'</b></p>'); $('.e-external-alter').after('<a href="'+ eelink +'" class="btn btn-primary btn-external-link">'+$('.flight-book-now').text()+'</a>'); }else{ $('.btn-external-link').attr('href', eelink); } echeck = 0; } } var price_return = $(this).data('price'); if(price_return){ flight_data.price_return = price_return; flight_data.total_price_return = price_return; $('.st-booking-select-return').removeClass('hidden'); $('.st-booking-select-return').find('.fare .price').html(format_money(flight_data.price_return )); var tax_enable = $(this).data('tax'); var tax_amount = $(this).data('tax_amount'); if(tax_enable != 'no'){ tax_price = (parseFloat(tax_amount) * flight_data.price_return)/100; if(tax_price > 0){ flight_data.total_price_return = flight_data.price_return + tax_price; $('.st-booking-select-return').find('.tax').removeClass('hidden'); $('.st-booking-select-return').find('.tax .price').html(format_money(tax_price)) }else{ $('.st-booking-select-return').find('.tax').addClass('hidden'); } }else{ $('.st-booking-select-return').find('.tax').addClass('hidden'); } $('.st-booking-select-return').find('.total .price').html(format_money(flight_data.total_price_return )); $('.booking-flight-form input[name="return_id"]').val($(this).data('post_id')); if($(this).data('business') == 1){ $('.booking-flight-form input[name="price_class_return"]').val('business_price'); }else{ $('.booking-flight-form input[name="price_class_return"]').val('eco_price'); } } calculate_total_price(); }); }); function calculate_total_price(){ var passenger = $('input[name="passenger"]').val(); if(parseInt(passenger) < 1){ passenger = 1; } if(flight_data.flight_type == 'on_way'){ flight_data.total_price = flight_data.total_price_depart * parseInt(passenger); flight_data.total_price_html = format_money(flight_data.total_price); }else{ if(parseFloat(flight_data.total_price_depart) > 0 && parseFloat(flight_data.total_price_return) > 0){ flight_data.total_price = (parseFloat(flight_data.total_price_depart) + parseFloat(flight_data.total_price_return))*parseInt(passenger); flight_data.total_price_html = format_money(flight_data.total_price); } } if(parseFloat(flight_data.total_price) > 0){ $('.st-flight-booking .st-flight-total-price .price').html(flight_data.total_price_html); } } function format_money($money) { if (!$money) { return st_params.free_text; } $money = st_number_format($money, st_params.booking_currency_precision, st_params.decimal_separator, st_params.thousand_separator); var $symbol = st_params.currency_symbol; var $money_string = ''; switch (st_params.currency_position) { case "right": $money_string = $money + $symbol; break; case "left_space": $money_string = $symbol + " " + $money; break; case "right_space": $money_string = $money + " " + $symbol; break; case "left": default: $money_string = $symbol + $money; break; } return $money_string; } function st_number_format(number, decimals, dec_point, thousands_sep) { number = (number + '') .replace(/[^0-9+\-Ee.]/g, ''); var n = !isFinite(+number) ? 0 : +number, prec = !isFinite(+decimals) ? 0 : Math.abs(decimals), sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep, dec = (typeof dec_point === 'undefined') ? '.' : dec_point, s = '', toFixedFix = function(n, prec) { var k = Math.pow(10, prec); return '' + (Math.round(n * k) / k) .toFixed(prec); }; // Fix for IE parseFloat(0.55).toFixed(0) = 0; s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)) .split('.'); if (s[0].length > 3) { s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep); } if ((s[1] || '') .length < prec) { s[1] = s[1] || ''; s[1] += new Array(prec - s[1].length + 1) .join('0'); } return s.join(dec); } var ww = $(window).width(); if($('.st-sticky').length > 0 && ww > 991) { var offset = $('.st-sticky').offset(); var topPadding = 15; $(window).on('scroll', function () { var header = $('.sticky-wrapper.is-sticky').height(); if(header == 0){ header = $('#top_toolbar').height() + 50; } var adminbar = $('#wpadminbar').height(); var list_height = $('.st-booking-list').height(); var booking_height = $('.st-flight-booking').height(); if (parseInt($(window).scrollTop()) > (parseInt(offset.top) - adminbar - header - topPadding)) { if (parseInt($(window).scrollTop()) < (list_height - booking_height)) { $('.st-sticky').stop().animate({ marginTop: ($(window).scrollTop() - offset.top) + adminbar + header + topPadding }); } } else { $('.st-sticky').stop().animate({ marginTop: 0 }); } }); } $('.flight-book-now').on( 'click', function(e){ var t = $(this); var form = $(this).closest('.booking-flight-form'); var data = form.serialize(); t.addClass('loading'); form.find('.flight-message').empty(); $.ajax({ dataType: 'json', type: 'post', data: data, url: st_params.ajax_url, success: function (res) { t.removeClass('loading'); if(typeof res.message != 'undefined'){ form.find('.flight-message').append(res.message); } if(typeof res.redirect != 'undefined'){ window.location = res.redirect; } }, error: function(e){ t.removeClass('loading'); console.log(e.responseText); } }); return false; }); $('.st-flight-search-form').on('submit', function(){ var check = false; $(this).find('.required').removeClass('input-error'); $(this).find('.required').each(function () { if($(this).val() == false){ $(this).addClass('input-error'); check = true; } }); var destination = $(this).find('input[name=destination_name]'); if($(this).find('input[name=origin_name]').val() == destination.val()){ check = true; destination.addClass('input-error'); } if(check) { return false; } }); }); }); ;/* Copyright 2014 Igor Vaynberg Version: 3.5.2 Timestamp: Sat Nov 1 14:43:36 EDT 2014 This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU General Public License version 2 (the "GPL License"). You may choose either license to govern your use of this software only upon the condition that you accept all of the terms of either the Apache License or the GPL License. You may obtain a copy of the Apache License and the GPL License at: http://www.apache.org/licenses/LICENSE-2.0 http://www.gnu.org/licenses/gpl-2.0.html Unless required by applicable law or agreed to in writing, software distributed under the Apache License or the GPL Licesnse is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License and the GPL License for the specific language governing permissions and limitations under the Apache License and the GPL License. */ !function(a){"undefined"==typeof a.fn.each2&&a.extend(a.fn,{each2:function(b){for(var c=a([0]),d=-1,e=this.length;++d<e&&(c.context=c[0]=this[d])&&b.call(c[0],d,c)!==!1;);return this}})}(jQuery),function(a,b){"use strict";function n(b){var c=a(document.createTextNode(""));b.before(c),c.before(b),c.remove()}function o(a){function b(a){return m[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function p(a,b){for(var c=0,d=b.length;d>c;c+=1)if(r(a,b[c]))return c;return-1}function q(){var b=a(l);b.appendTo(document.body);var c={width:b.width()-b[0].clientWidth,height:b.height()-b[0].clientHeight};return b.remove(),c}function r(a,c){return a===c?!0:a===b||c===b?!1:null===a||null===c?!1:a.constructor===String?a+""==c+"":c.constructor===String?c+""==a+"":!1}function s(a,b,c){var d,e,f;if(null===a||a.length<1)return[];for(d=a.split(b),e=0,f=d.length;f>e;e+=1)d[e]=c(d[e]);return d}function t(a){return a.outerWidth(!1)-a.width()}function u(c){var d="keyup-change-value";c.on("keydown",function(){a.data(c,d)===b&&a.data(c,d,c.val())}),c.on("keyup",function(){var e=a.data(c,d);e!==b&&c.val()!==e&&(a.removeData(c,d),c.trigger("keyup-change"))})}function v(c){c.on("mousemove",function(c){var d=h;(d===b||d.x!==c.pageX||d.y!==c.pageY)&&a(c.target).trigger("mousemove-filtered",c)})}function w(a,c,d){d=d||b;var e;return function(){var b=arguments;window.clearTimeout(e),e=window.setTimeout(function(){c.apply(d,b)},a)}}function x(a,b){var c=w(a,function(a){b.trigger("scroll-debounced",a)});b.on("scroll",function(a){p(a.target,b.get())>=0&&c(a)})}function y(a){a[0]!==document.activeElement&&window.setTimeout(function(){var d,b=a[0],c=a.val().length;a.focus();var e=b.offsetWidth>0||b.offsetHeight>0;e&&b===document.activeElement&&(b.setSelectionRange?b.setSelectionRange(c,c):b.createTextRange&&(d=b.createTextRange(),d.collapse(!1),d.select()))},0)}function z(b){b=a(b)[0];var c=0,d=0;if("selectionStart"in b)c=b.selectionStart,d=b.selectionEnd-c;else if("selection"in document){b.focus();var e=document.selection.createRange();d=document.selection.createRange().text.length,e.moveStart("character",-b.value.length),c=e.text.length-d}return{offset:c,length:d}}function A(a){a.preventDefault(),a.stopPropagation()}function B(a){a.preventDefault(),a.stopImmediatePropagation()}function C(b){if(!g){var c=b[0].currentStyle||window.getComputedStyle(b[0],null);g=a(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:c.fontSize,fontFamily:c.fontFamily,fontStyle:c.fontStyle,fontWeight:c.fontWeight,letterSpacing:c.letterSpacing,textTransform:c.textTransform,whiteSpace:"nowrap"}),g.attr("class","select2-sizer"),a(document.body).append(g)}return g.text(b.val()),g.width()}function D(b,c,d){var e,g,f=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each2(function(){0===this.indexOf("select2-")&&f.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each2(function(){0!==this.indexOf("select2-")&&(g=d(this),g&&f.push(g))})),b.attr("class",f.join(" "))}function E(a,b,c,d){var e=o(a.toUpperCase()).indexOf(o(b.toUpperCase())),f=b.length;return 0>e?(c.push(d(a)),void 0):(c.push(d(a.substring(0,e))),c.push("<span class='select2-match'>"),c.push(d(a.substring(e,e+f))),c.push("</span>"),c.push(d(a.substring(e+f,a.length))),void 0)}function F(a){var b={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})}function G(c){var d,e=null,f=c.quietMillis||100,g=c.url,h=this;return function(i){window.clearTimeout(d),d=window.setTimeout(function(){var d=c.data,f=g,j=c.transport||a.fn.select2.ajaxDefaults.transport,k={type:c.type||"GET",cache:c.cache||!1,jsonpCallback:c.jsonpCallback||b,dataType:c.dataType||"json"},l=a.extend({},a.fn.select2.ajaxDefaults.params,k);d=d?d.call(h,i.term,i.page,i.context):null,f="function"==typeof f?f.call(h,i.term,i.page,i.context):f,e&&"function"==typeof e.abort&&e.abort(),c.params&&(a.isFunction(c.params)?a.extend(l,c.params.call(h)):a.extend(l,c.params)),a.extend(l,{url:f,dataType:c.dataType,data:d,success:function(a){var b=c.results(a,i.page,i);i.callback(b)},error:function(a,b,c){var d={hasError:!0,jqXHR:a,textStatus:b,errorThrown:c};i.callback(d)}}),e=j.call(h,l)},f)}}function H(b){var d,e,c=b,f=function(a){return""+a.text};a.isArray(c)&&(e=c,c={results:e}),a.isFunction(c)===!1&&(e=c,c=function(){return e});var g=c();return g.text&&(f=g.text,a.isFunction(f)||(d=g.text,f=function(a){return a[d]})),function(b){var g,d=b.term,e={results:[]};return""===d?(b.callback(c()),void 0):(g=function(c,e){var h,i;if(c=c[0],c.children){h={};for(i in c)c.hasOwnProperty(i)&&(h[i]=c[i]);h.children=[],a(c.children).each2(function(a,b){g(b,h.children)}),(h.children.length||b.matcher(d,f(h),c))&&e.push(h)}else b.matcher(d,f(c),c)&&e.push(c)},a(c().results).each2(function(a,b){g(b,e.results)}),b.callback(e),void 0)}}function I(c){var d=a.isFunction(c);return function(e){var f=e.term,g={results:[]},h=d?c(e):c;a.isArray(h)&&(a(h).each(function(){var a=this.text!==b,c=a?this.text:this;(""===f||e.matcher(f,c))&&g.results.push(a?this:{id:this,text:this})}),e.callback(g))}}function J(b,c){if(a.isFunction(b))return!0;if(!b)return!1;if("string"==typeof b)return!0;throw new Error(c+" must be a string, function, or falsy value")}function K(b,c){if(a.isFunction(b)){var d=Array.prototype.slice.call(arguments,2);return b.apply(c,d)}return b}function L(b){var c=0;return a.each(b,function(a,b){b.children?c+=L(b.children):c++}),c}function M(a,c,d,e){var h,i,j,k,l,f=a,g=!1;if(!e.createSearchChoice||!e.tokenSeparators||e.tokenSeparators.length<1)return b;for(;;){for(i=-1,j=0,k=e.tokenSeparators.length;k>j&&(l=e.tokenSeparators[j],i=a.indexOf(l),!(i>=0));j++);if(0>i)break;if(h=a.substring(0,i),a=a.substring(i+l.length),h.length>0&&(h=e.createSearchChoice.call(this,h,c),h!==b&&null!==h&&e.id(h)!==b&&null!==e.id(h))){for(g=!1,j=0,k=c.length;k>j;j++)if(r(e.id(h),e.id(c[j]))){g=!0;break}g||d(h)}}return f!==a?a:void 0}function N(){var b=this;a.each(arguments,function(a,c){b[c].remove(),b[c]=null})}function O(b,c){var d=function(){};return d.prototype=new b,d.prototype.constructor=d,d.prototype.parent=b.prototype,d.prototype=a.extend(d.prototype,c),d}if(window.Select2===b){var c,d,e,f,g,i,j,h={x:0,y:0},k={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(a){switch(a=a.which?a.which:a){case k.LEFT:case k.RIGHT:case k.UP:case k.DOWN:return!0}return!1},isControl:function(a){var b=a.which;switch(b){case k.SHIFT:case k.CTRL:case k.ALT:return!0}return a.metaKey?!0:!1},isFunctionKey:function(a){return a=a.which?a.which:a,a>=112&&123>=a}},l="<div class='select2-measure-scrollbar'></div>",m={"\u24b6":"A","\uff21":"A","\xc0":"A","\xc1":"A","\xc2":"A","\u1ea6":"A","\u1ea4":"A","\u1eaa":"A","\u1ea8":"A","\xc3":"A","\u0100":"A","\u0102":"A","\u1eb0":"A","\u1eae":"A","\u1eb4":"A","\u1eb2":"A","\u0226":"A","\u01e0":"A","\xc4":"A","\u01de":"A","\u1ea2":"A","\xc5":"A","\u01fa":"A","\u01cd":"A","\u0200":"A","\u0202":"A","\u1ea0":"A","\u1eac":"A","\u1eb6":"A","\u1e00":"A","\u0104":"A","\u023a":"A","\u2c6f":"A","\ua732":"AA","\xc6":"AE","\u01fc":"AE","\u01e2":"AE","\ua734":"AO","\ua736":"AU","\ua738":"AV","\ua73a":"AV","\ua73c":"AY","\u24b7":"B","\uff22":"B","\u1e02":"B","\u1e04":"B","\u1e06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24b8":"C","\uff23":"C","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\xc7":"C","\u1e08":"C","\u0187":"C","\u023b":"C","\ua73e":"C","\u24b9":"D","\uff24":"D","\u1e0a":"D","\u010e":"D","\u1e0c":"D","\u1e10":"D","\u1e12":"D","\u1e0e":"D","\u0110":"D","\u018b":"D","\u018a":"D","\u0189":"D","\ua779":"D","\u01f1":"DZ","\u01c4":"DZ","\u01f2":"Dz","\u01c5":"Dz","\u24ba":"E","\uff25":"E","\xc8":"E","\xc9":"E","\xca":"E","\u1ec0":"E","\u1ebe":"E","\u1ec4":"E","\u1ec2":"E","\u1ebc":"E","\u0112":"E","\u1e14":"E","\u1e16":"E","\u0114":"E","\u0116":"E","\xcb":"E","\u1eba":"E","\u011a":"E","\u0204":"E","\u0206":"E","\u1eb8":"E","\u1ec6":"E","\u0228":"E","\u1e1c":"E","\u0118":"E","\u1e18":"E","\u1e1a":"E","\u0190":"E","\u018e":"E","\u24bb":"F","\uff26":"F","\u1e1e":"F","\u0191":"F","\ua77b":"F","\u24bc":"G","\uff27":"G","\u01f4":"G","\u011c":"G","\u1e20":"G","\u011e":"G","\u0120":"G","\u01e6":"G","\u0122":"G","\u01e4":"G","\u0193":"G","\ua7a0":"G","\ua77d":"G","\ua77e":"G","\u24bd":"H","\uff28":"H","\u0124":"H","\u1e22":"H","\u1e26":"H","\u021e":"H","\u1e24":"H","\u1e28":"H","\u1e2a":"H","\u0126":"H","\u2c67":"H","\u2c75":"H","\ua78d":"H","\u24be":"I","\uff29":"I","\xcc":"I","\xcd":"I","\xce":"I","\u0128":"I","\u012a":"I","\u012c":"I","\u0130":"I","\xcf":"I","\u1e2e":"I","\u1ec8":"I","\u01cf":"I","\u0208":"I","\u020a":"I","\u1eca":"I","\u012e":"I","\u1e2c":"I","\u0197":"I","\u24bf":"J","\uff2a":"J","\u0134":"J","\u0248":"J","\u24c0":"K","\uff2b":"K","\u1e30":"K","\u01e8":"K","\u1e32":"K","\u0136":"K","\u1e34":"K","\u0198":"K","\u2c69":"K","\ua740":"K","\ua742":"K","\ua744":"K","\ua7a2":"K","\u24c1":"L","\uff2c":"L","\u013f":"L","\u0139":"L","\u013d":"L","\u1e36":"L","\u1e38":"L","\u013b":"L","\u1e3c":"L","\u1e3a":"L","\u0141":"L","\u023d":"L","\u2c62":"L","\u2c60":"L","\ua748":"L","\ua746":"L","\ua780":"L","\u01c7":"LJ","\u01c8":"Lj","\u24c2":"M","\uff2d":"M","\u1e3e":"M","\u1e40":"M","\u1e42":"M","\u2c6e":"M","\u019c":"M","\u24c3":"N","\uff2e":"N","\u01f8":"N","\u0143":"N","\xd1":"N","\u1e44":"N","\u0147":"N","\u1e46":"N","\u0145":"N","\u1e4a":"N","\u1e48":"N","\u0220":"N","\u019d":"N","\ua790":"N","\ua7a4":"N","\u01ca":"NJ","\u01cb":"Nj","\u24c4":"O","\uff2f":"O","\xd2":"O","\xd3":"O","\xd4":"O","\u1ed2":"O","\u1ed0":"O","\u1ed6":"O","\u1ed4":"O","\xd5":"O","\u1e4c":"O","\u022c":"O","\u1e4e":"O","\u014c":"O","\u1e50":"O","\u1e52":"O","\u014e":"O","\u022e":"O","\u0230":"O","\xd6":"O","\u022a":"O","\u1ece":"O","\u0150":"O","\u01d1":"O","\u020c":"O","\u020e":"O","\u01a0":"O","\u1edc":"O","\u1eda":"O","\u1ee0":"O","\u1ede":"O","\u1ee2":"O","\u1ecc":"O","\u1ed8":"O","\u01ea":"O","\u01ec":"O","\xd8":"O","\u01fe":"O","\u0186":"O","\u019f":"O","\ua74a":"O","\ua74c":"O","\u01a2":"OI","\ua74e":"OO","\u0222":"OU","\u24c5":"P","\uff30":"P","\u1e54":"P","\u1e56":"P","\u01a4":"P","\u2c63":"P","\ua750":"P","\ua752":"P","\ua754":"P","\u24c6":"Q","\uff31":"Q","\ua756":"Q","\ua758":"Q","\u024a":"Q","\u24c7":"R","\uff32":"R","\u0154":"R","\u1e58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1e5a":"R","\u1e5c":"R","\u0156":"R","\u1e5e":"R","\u024c":"R","\u2c64":"R","\ua75a":"R","\ua7a6":"R","\ua782":"R","\u24c8":"S","\uff33":"S","\u1e9e":"S","\u015a":"S","\u1e64":"S","\u015c":"S","\u1e60":"S","\u0160":"S","\u1e66":"S","\u1e62":"S","\u1e68":"S","\u0218":"S","\u015e":"S","\u2c7e":"S","\ua7a8":"S","\ua784":"S","\u24c9":"T","\uff34":"T","\u1e6a":"T","\u0164":"T","\u1e6c":"T","\u021a":"T","\u0162":"T","\u1e70":"T","\u1e6e":"T","\u0166":"T","\u01ac":"T","\u01ae":"T","\u023e":"T","\ua786":"T","\ua728":"TZ","\u24ca":"U","\uff35":"U","\xd9":"U","\xda":"U","\xdb":"U","\u0168":"U","\u1e78":"U","\u016a":"U","\u1e7a":"U","\u016c":"U","\xdc":"U","\u01db":"U","\u01d7":"U","\u01d5":"U","\u01d9":"U","\u1ee6":"U","\u016e":"U","\u0170":"U","\u01d3":"U","\u0214":"U","\u0216":"U","\u01af":"U","\u1eea":"U","\u1ee8":"U","\u1eee":"U","\u1eec":"U","\u1ef0":"U","\u1ee4":"U","\u1e72":"U","\u0172":"U","\u1e76":"U","\u1e74":"U","\u0244":"U","\u24cb":"V","\uff36":"V","\u1e7c":"V","\u1e7e":"V","\u01b2":"V","\ua75e":"V","\u0245":"V","\ua760":"VY","\u24cc":"W","\uff37":"W","\u1e80":"W","\u1e82":"W","\u0174":"W","\u1e86":"W","\u1e84":"W","\u1e88":"W","\u2c72":"W","\u24cd":"X","\uff38":"X","\u1e8a":"X","\u1e8c":"X","\u24ce":"Y","\uff39":"Y","\u1ef2":"Y","\xdd":"Y","\u0176":"Y","\u1ef8":"Y","\u0232":"Y","\u1e8e":"Y","\u0178":"Y","\u1ef6":"Y","\u1ef4":"Y","\u01b3":"Y","\u024e":"Y","\u1efe":"Y","\u24cf":"Z","\uff3a":"Z","\u0179":"Z","\u1e90":"Z","\u017b":"Z","\u017d":"Z","\u1e92":"Z","\u1e94":"Z","\u01b5":"Z","\u0224":"Z","\u2c7f":"Z","\u2c6b":"Z","\ua762":"Z","\u24d0":"a","\uff41":"a","\u1e9a":"a","\xe0":"a","\xe1":"a","\xe2":"a","\u1ea7":"a","\u1ea5":"a","\u1eab":"a","\u1ea9":"a","\xe3":"a","\u0101":"a","\u0103":"a","\u1eb1":"a","\u1eaf":"a","\u1eb5":"a","\u1eb3":"a","\u0227":"a","\u01e1":"a","\xe4":"a","\u01df":"a","\u1ea3":"a","\xe5":"a","\u01fb":"a","\u01ce":"a","\u0201":"a","\u0203":"a","\u1ea1":"a","\u1ead":"a","\u1eb7":"a","\u1e01":"a","\u0105":"a","\u2c65":"a","\u0250":"a","\ua733":"aa","\xe6":"ae","\u01fd":"ae","\u01e3":"ae","\ua735":"ao","\ua737":"au","\ua739":"av","\ua73b":"av","\ua73d":"ay","\u24d1":"b","\uff42":"b","\u1e03":"b","\u1e05":"b","\u1e07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24d2":"c","\uff43":"c","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\xe7":"c","\u1e09":"c","\u0188":"c","\u023c":"c","\ua73f":"c","\u2184":"c","\u24d3":"d","\uff44":"d","\u1e0b":"d","\u010f":"d","\u1e0d":"d","\u1e11":"d","\u1e13":"d","\u1e0f":"d","\u0111":"d","\u018c":"d","\u0256":"d","\u0257":"d","\ua77a":"d","\u01f3":"dz","\u01c6":"dz","\u24d4":"e","\uff45":"e","\xe8":"e","\xe9":"e","\xea":"e","\u1ec1":"e","\u1ebf":"e","\u1ec5":"e","\u1ec3":"e","\u1ebd":"e","\u0113":"e","\u1e15":"e","\u1e17":"e","\u0115":"e","\u0117":"e","\xeb":"e","\u1ebb":"e","\u011b":"e","\u0205":"e","\u0207":"e","\u1eb9":"e","\u1ec7":"e","\u0229":"e","\u1e1d":"e","\u0119":"e","\u1e19":"e","\u1e1b":"e","\u0247":"e","\u025b":"e","\u01dd":"e","\u24d5":"f","\uff46":"f","\u1e1f":"f","\u0192":"f","\ua77c":"f","\u24d6":"g","\uff47":"g","\u01f5":"g","\u011d":"g","\u1e21":"g","\u011f":"g","\u0121":"g","\u01e7":"g","\u0123":"g","\u01e5":"g","\u0260":"g","\ua7a1":"g","\u1d79":"g","\ua77f":"g","\u24d7":"h","\uff48":"h","\u0125":"h","\u1e23":"h","\u1e27":"h","\u021f":"h","\u1e25":"h","\u1e29":"h","\u1e2b":"h","\u1e96":"h","\u0127":"h","\u2c68":"h","\u2c76":"h","\u0265":"h","\u0195":"hv","\u24d8":"i","\uff49":"i","\xec":"i","\xed":"i","\xee":"i","\u0129":"i","\u012b":"i","\u012d":"i","\xef":"i","\u1e2f":"i","\u1ec9":"i","\u01d0":"i","\u0209":"i","\u020b":"i","\u1ecb":"i","\u012f":"i","\u1e2d":"i","\u0268":"i","\u0131":"i","\u24d9":"j","\uff4a":"j","\u0135":"j","\u01f0":"j","\u0249":"j","\u24da":"k","\uff4b":"k","\u1e31":"k","\u01e9":"k","\u1e33":"k","\u0137":"k","\u1e35":"k","\u0199":"k","\u2c6a":"k","\ua741":"k","\ua743":"k","\ua745":"k","\ua7a3":"k","\u24db":"l","\uff4c":"l","\u0140":"l","\u013a":"l","\u013e":"l","\u1e37":"l","\u1e39":"l","\u013c":"l","\u1e3d":"l","\u1e3b":"l","\u017f":"l","\u0142":"l","\u019a":"l","\u026b":"l","\u2c61":"l","\ua749":"l","\ua781":"l","\ua747":"l","\u01c9":"lj","\u24dc":"m","\uff4d":"m","\u1e3f":"m","\u1e41":"m","\u1e43":"m","\u0271":"m","\u026f":"m","\u24dd":"n","\uff4e":"n","\u01f9":"n","\u0144":"n","\xf1":"n","\u1e45":"n","\u0148":"n","\u1e47":"n","\u0146":"n","\u1e4b":"n","\u1e49":"n","\u019e":"n","\u0272":"n","\u0149":"n","\ua791":"n","\ua7a5":"n","\u01cc":"nj","\u24de":"o","\uff4f":"o","\xf2":"o","\xf3":"o","\xf4":"o","\u1ed3":"o","\u1ed1":"o","\u1ed7":"o","\u1ed5":"o","\xf5":"o","\u1e4d":"o","\u022d":"o","\u1e4f":"o","\u014d":"o","\u1e51":"o","\u1e53":"o","\u014f":"o","\u022f":"o","\u0231":"o","\xf6":"o","\u022b":"o","\u1ecf":"o","\u0151":"o","\u01d2":"o","\u020d":"o","\u020f":"o","\u01a1":"o","\u1edd":"o","\u1edb":"o","\u1ee1":"o","\u1edf":"o","\u1ee3":"o","\u1ecd":"o","\u1ed9":"o","\u01eb":"o","\u01ed":"o","\xf8":"o","\u01ff":"o","\u0254":"o","\ua74b":"o","\ua74d":"o","\u0275":"o","\u01a3":"oi","\u0223":"ou","\ua74f":"oo","\u24df":"p","\uff50":"p","\u1e55":"p","\u1e57":"p","\u01a5":"p","\u1d7d":"p","\ua751":"p","\ua753":"p","\ua755":"p","\u24e0":"q","\uff51":"q","\u024b":"q","\ua757":"q","\ua759":"q","\u24e1":"r","\uff52":"r","\u0155":"r","\u1e59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1e5b":"r","\u1e5d":"r","\u0157":"r","\u1e5f":"r","\u024d":"r","\u027d":"r","\ua75b":"r","\ua7a7":"r","\ua783":"r","\u24e2":"s","\uff53":"s","\xdf":"s","\u015b":"s","\u1e65":"s","\u015d":"s","\u1e61":"s","\u0161":"s","\u1e67":"s","\u1e63":"s","\u1e69":"s","\u0219":"s","\u015f":"s","\u023f":"s","\ua7a9":"s","\ua785":"s","\u1e9b":"s","\u24e3":"t","\uff54":"t","\u1e6b":"t","\u1e97":"t","\u0165":"t","\u1e6d":"t","\u021b":"t","\u0163":"t","\u1e71":"t","\u1e6f":"t","\u0167":"t","\u01ad":"t","\u0288":"t","\u2c66":"t","\ua787":"t","\ua729":"tz","\u24e4":"u","\uff55":"u","\xf9":"u","\xfa":"u","\xfb":"u","\u0169":"u","\u1e79":"u","\u016b":"u","\u1e7b":"u","\u016d":"u","\xfc":"u","\u01dc":"u","\u01d8":"u","\u01d6":"u","\u01da":"u","\u1ee7":"u","\u016f":"u","\u0171":"u","\u01d4":"u","\u0215":"u","\u0217":"u","\u01b0":"u","\u1eeb":"u","\u1ee9":"u","\u1eef":"u","\u1eed":"u","\u1ef1":"u","\u1ee5":"u","\u1e73":"u","\u0173":"u","\u1e77":"u","\u1e75":"u","\u0289":"u","\u24e5":"v","\uff56":"v","\u1e7d":"v","\u1e7f":"v","\u028b":"v","\ua75f":"v","\u028c":"v","\ua761":"vy","\u24e6":"w","\uff57":"w","\u1e81":"w","\u1e83":"w","\u0175":"w","\u1e87":"w","\u1e85":"w","\u1e98":"w","\u1e89":"w","\u2c73":"w","\u24e7":"x","\uff58":"x","\u1e8b":"x","\u1e8d":"x","\u24e8":"y","\uff59":"y","\u1ef3":"y","\xfd":"y","\u0177":"y","\u1ef9":"y","\u0233":"y","\u1e8f":"y","\xff":"y","\u1ef7":"y","\u1e99":"y","\u1ef5":"y","\u01b4":"y","\u024f":"y","\u1eff":"y","\u24e9":"z","\uff5a":"z","\u017a":"z","\u1e91":"z","\u017c":"z","\u017e":"z","\u1e93":"z","\u1e95":"z","\u01b6":"z","\u0225":"z","\u0240":"z","\u2c6c":"z","\ua763":"z","\u0386":"\u0391","\u0388":"\u0395","\u0389":"\u0397","\u038a":"\u0399","\u03aa":"\u0399","\u038c":"\u039f","\u038e":"\u03a5","\u03ab":"\u03a5","\u038f":"\u03a9","\u03ac":"\u03b1","\u03ad":"\u03b5","\u03ae":"\u03b7","\u03af":"\u03b9","\u03ca":"\u03b9","\u0390":"\u03b9","\u03cc":"\u03bf","\u03cd":"\u03c5","\u03cb":"\u03c5","\u03b0":"\u03c5","\u03c9":"\u03c9","\u03c2":"\u03c3"};i=a(document),f=function(){var a=1;return function(){return a++}}(),c=O(Object,{bind:function(a){var b=this;return function(){a.apply(b,arguments)}},init:function(c){var d,e,g=".select2-results";this.opts=c=this.prepareOpts(c),this.id=c.id,c.element.data("select2")!==b&&null!==c.element.data("select2")&&c.element.data("select2").destroy(),this.container=this.createContainer(),this.liveRegion=a(".select2-hidden-accessible"),0==this.liveRegion.length&&(this.liveRegion=a("<span>",{role:"status","aria-live":"polite"}).addClass("select2-hidden-accessible").appendTo(document.body)),this.containerId="s2id_"+(c.element.attr("id")||"autogen"+f()),this.containerEventName=this.containerId.replace(/([.])/g,"_").replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.container.attr("title",c.element.attr("title")),this.body=a(document.body),D(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",c.element.attr("style")),this.container.css(K(c.containerCss,this.opts.element)),this.container.addClass(K(c.containerCssClass,this.opts.element)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",A),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),D(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(K(c.dropdownCssClass,this.opts.element)),this.dropdown.data("select2",this),this.dropdown.on("click",A),this.results=d=this.container.find(g),this.search=e=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),this.container.on("click",A),v(this.results),this.dropdown.on("mousemove-filtered",g,this.bind(this.highlightUnderEvent)),this.dropdown.on("touchstart touchmove touchend",g,this.bind(function(a){this._touchEvent=!0,this.highlightUnderEvent(a)})),this.dropdown.on("touchmove",g,this.bind(this.touchMoved)),this.dropdown.on("touchstart touchend",g,this.bind(this.clearTouchMoved)),this.dropdown.on("click",this.bind(function(){this._touchEvent&&(this._touchEvent=!1,this.selectHighlighted())})),x(80,this.results),this.dropdown.on("scroll-debounced",g,this.bind(this.loadMoreIfNeeded)),a(this.container).on("change",".select2-input",function(a){a.stopPropagation()}),a(this.dropdown).on("change",".select2-input",function(a){a.stopPropagation()}),a.fn.mousewheel&&d.mousewheel(function(a,b,c,e){var f=d.scrollTop();e>0&&0>=f-e?(d.scrollTop(0),A(a)):0>e&&d.get(0).scrollHeight-d.scrollTop()+e<=d.height()&&(d.scrollTop(d.get(0).scrollHeight-d.height()),A(a))}),u(e),e.on("keyup-change input paste",this.bind(this.updateResults)),e.on("focus",function(){e.addClass("select2-focused")}),e.on("blur",function(){e.removeClass("select2-focused")}),this.dropdown.on("mouseup",g,this.bind(function(b){a(b.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(b),this.selectHighlighted(b))})),this.dropdown.on("click mouseup mousedown touchstart touchend focusin",function(a){a.stopPropagation()}),this.nextSearchTerm=b,a.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==c.maximumInputLength&&this.search.attr("maxlength",c.maximumInputLength);var h=c.element.prop("disabled");h===b&&(h=!1),this.enable(!h);var i=c.element.prop("readonly");i===b&&(i=!1),this.readonly(i),j=j||q(),this.autofocus=c.element.prop("autofocus"),c.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.search.attr("placeholder",c.searchInputPlaceholder)},destroy:function(){var a=this.opts.element,c=a.data("select2"),d=this;this.close(),a.length&&a[0].detachEvent&&d._sync&&a.each(function(){d._sync&&this.detachEvent("onpropertychange",d._sync)}),this.propertyObserver&&(this.propertyObserver.disconnect(),this.propertyObserver=null),this._sync=null,c!==b&&(c.container.remove(),c.liveRegion.remove(),c.dropdown.remove(),a.show().removeData("select2").off(".select2").prop("autofocus",this.autofocus||!1),this.elementTabIndex?a.attr({tabindex:this.elementTabIndex}):a.removeAttr("tabindex"),a.show()),N.call(this,"container","liveRegion","dropdown","results","search")},optionToData:function(a){return a.is("option")?{id:a.prop("value"),text:a.text(),element:a.get(),css:a.attr("class"),disabled:a.prop("disabled"),locked:r(a.attr("locked"),"locked")||r(a.data("locked"),!0)}:a.is("optgroup")?{text:a.attr("label"),children:[],element:a.get(),css:a.attr("class")}:void 0},prepareOpts:function(c){var d,e,g,h,i=this;if(d=c.element,"select"===d.get(0).tagName.toLowerCase()&&(this.select=e=c.element),e&&a.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in c)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),c=a.extend({},{populateResults:function(d,e,g){var h,j=this.opts.id,k=this.liveRegion;h=function(d,e,l){var m,n,o,p,q,r,s,t,u,v;d=c.sortResults(d,e,g);var w=[];for(m=0,n=d.length;n>m;m+=1)o=d[m],q=o.disabled===!0,p=!q&&j(o)!==b,r=o.children&&o.children.length>0,s=a("<li></li>"),s.addClass("select2-results-dept-"+l),s.addClass("select2-result"),s.addClass(p?"select2-result-selectable":"select2-result-unselectable"),q&&s.addClass("select2-disabled"),r&&s.addClass("select2-result-with-children"),s.addClass(i.opts.formatResultCssClass(o)),s.attr("role","presentation"),t=a(document.createElement("div")),t.addClass("select2-result-label"),t.attr("id","select2-result-label-"+f()),t.attr("role","option"),v=c.formatResult(o,t,g,i.opts.escapeMarkup),v!==b&&(t.html(v),s.append(t)),r&&(u=a("<ul></ul>"),u.addClass("select2-result-sub"),h(o.children,u,l+1),s.append(u)),s.data("select2-data",o),w.push(s[0]);e.append(w),k.text(c.formatMatches(d.length))},h(e,d,0)}},a.fn.select2.defaults,c),"function"!=typeof c.id&&(g=c.id,c.id=function(a){return a[g]}),a.isArray(c.element.data("select2Tags"))){if("tags"in c)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+c.element.attr("id");c.tags=c.element.data("select2Tags")}if(e?(c.query=this.bind(function(a){var f,g,h,c={results:[],more:!1},e=a.term;h=function(b,c){var d;b.is("option")?a.matcher(e,b.text(),b)&&c.push(i.optionToData(b)):b.is("optgroup")&&(d=i.optionToData(b),b.children().each2(function(a,b){h(b,d.children)}),d.children.length>0&&c.push(d))},f=d.children(),this.getPlaceholder()!==b&&f.length>0&&(g=this.getPlaceholderOption(),g&&(f=f.not(g))),f.each2(function(a,b){h(b,c.results)}),a.callback(c)}),c.id=function(a){return a.id}):"query"in c||("ajax"in c?(h=c.element.data("ajax-url"),h&&h.length>0&&(c.ajax.url=h),c.query=G.call(c.element,c.ajax)):"data"in c?c.query=H(c.data):"tags"in c&&(c.query=I(c.tags),c.createSearchChoice===b&&(c.createSearchChoice=function(b){return{id:a.trim(b),text:a.trim(b)}}),c.initSelection===b&&(c.initSelection=function(b,d){var e=[];a(s(b.val(),c.separator,c.transformVal)).each(function(){var b={id:this,text:this},d=c.tags;a.isFunction(d)&&(d=d()),a(d).each(function(){return r(this.id,b.id)?(b=this,!1):void 0}),e.push(b)}),d(e)}))),"function"!=typeof c.query)throw"query function not defined for Select2 "+c.element.attr("id");if("top"===c.createSearchChoicePosition)c.createSearchChoicePosition=function(a,b){a.unshift(b)};else if("bottom"===c.createSearchChoicePosition)c.createSearchChoicePosition=function(a,b){a.push(b)};else if("function"!=typeof c.createSearchChoicePosition)throw"invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function";return c},monitorSource:function(){var d,c=this.opts.element,e=this;c.on("change.select2",this.bind(function(){this.opts.element.data("select2-change-triggered")!==!0&&this.initSelection()})),this._sync=this.bind(function(){var a=c.prop("disabled");a===b&&(a=!1),this.enable(!a);var d=c.prop("readonly");d===b&&(d=!1),this.readonly(d),this.container&&(D(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(K(this.opts.containerCssClass,this.opts.element))),this.dropdown&&(D(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(K(this.opts.dropdownCssClass,this.opts.element)))}),c.length&&c[0].attachEvent&&c.each(function(){this.attachEvent("onpropertychange",e._sync)}),d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,d!==b&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new d(function(b){a.each(b,e._sync)}),this.propertyObserver.observe(c.get(0),{attributes:!0,subtree:!1}))},triggerSelect:function(b){var c=a.Event("select2-selecting",{val:this.id(b),object:b,choice:b});return this.opts.element.trigger(c),!c.isDefaultPrevented()},triggerChange:function(b){b=b||{},b=a.extend({},b,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(b),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},isInterfaceEnabled:function(){return this.enabledInterface===!0},enableInterface:function(){var a=this._enabled&&!this._readonly,b=!a;return a===this.enabledInterface?!1:(this.container.toggleClass("select2-container-disabled",b),this.close(),this.enabledInterface=a,!0)},enable:function(a){a===b&&(a=!0),this._enabled!==a&&(this._enabled=a,this.opts.element.prop("disabled",!a),this.enableInterface())},disable:function(){this.enable(!1)},readonly:function(a){a===b&&(a=!1),this._readonly!==a&&(this._readonly=a,this.opts.element.prop("readonly",a),this.enableInterface())},opened:function(){return this.container?this.container.hasClass("select2-dropdown-open"):!1},positionDropdown:function(){var v,w,x,y,z,b=this.dropdown,c=this.container,d=c.offset(),e=c.outerHeight(!1),f=c.outerWidth(!1),g=b.outerHeight(!1),h=a(window),i=h.width(),k=h.height(),l=h.scrollLeft()+i,m=h.scrollTop()+k,n=d.top+e,o=d.left,p=m>=n+g,q=d.top-g>=h.scrollTop(),r=b.outerWidth(!1),s=function(){return l>=o+r},t=function(){return d.left+l+c.outerWidth(!1)>r},u=b.hasClass("select2-drop-above");u?(w=!0,!q&&p&&(x=!0,w=!1)):(w=!1,!p&&q&&(x=!0,w=!0)),x&&(b.hide(),d=this.container.offset(),e=this.container.outerHeight(!1),f=this.container.outerWidth(!1),g=b.outerHeight(!1),l=h.scrollLeft()+i,m=h.scrollTop()+k,n=d.top+e,o=d.left,r=b.outerWidth(!1),b.show(),this.focusSearch()),this.opts.dropdownAutoWidth?(z=a(".select2-results",b)[0],b.addClass("select2-drop-auto-width"),b.css("width",""),r=b.outerWidth(!1)+(z.scrollHeight===z.clientHeight?0:j.width),r>f?f=r:r=f,g=b.outerHeight(!1)):this.container.removeClass("select2-drop-auto-width"),"static"!==this.body.css("position")&&(v=this.body.offset(),n-=v.top,o-=v.left),!s()&&t()&&(o=d.left+this.container.outerWidth(!1)-r),y={left:o,width:f},w?(y.top=d.top-g,y.bottom="auto",this.container.addClass("select2-drop-above"),b.addClass("select2-drop-above")):(y.top=n,y.bottom="auto",this.container.removeClass("select2-drop-above"),b.removeClass("select2-drop-above")),y=a.extend(y,K(this.opts.dropdownCss,this.opts.element)),b.css(y)},shouldOpen:function(){var b;return this.opened()?!1:this._enabled===!1||this._readonly===!0?!1:(b=a.Event("select2-opening"),this.opts.element.trigger(b),!b.isDefaultPrevented())},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return this.shouldOpen()?(this.opening(),i.on("mousemove.select2Event",function(a){h.x=a.pageX,h.y=a.pageY}),!0):!1},opening:function(){var f,b=this.containerEventName,c="scroll."+b,d="resize."+b,e="orientationchange."+b;this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.clearDropdownAlignmentPreference(),this.dropdown[0]!==this.body.children().last()[0]&&this.dropdown.detach().appendTo(this.body),f=a("#select2-drop-mask"),0===f.length&&(f=a(document.createElement("div")),f.attr("id","select2-drop-mask").attr("class","select2-drop-mask"),f.hide(),f.appendTo(this.body),f.on("mousedown touchstart click",function(b){n(f);var d,c=a("#select2-drop");c.length>0&&(d=c.data("select2"),d.opts.selectOnBlur&&d.selectHighlighted({noFocus:!0}),d.close(),b.preventDefault(),b.stopPropagation())})),this.dropdown.prev()[0]!==f[0]&&this.dropdown.before(f),a("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),f.show(),this.positionDropdown(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active");var g=this;this.container.parents().add(window).each(function(){a(this).on(d+" "+c+" "+e,function(){g.opened()&&g.positionDropdown()})})},close:function(){if(this.opened()){var b=this.containerEventName,c="scroll."+b,d="resize."+b,e="orientationchange."+b;this.container.parents().add(window).each(function(){a(this).off(c).off(d).off(e)}),this.clearDropdownAlignmentPreference(),a("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active"),this.results.empty(),i.off("mousemove.select2Event"),this.clearSearch(),this.search.removeClass("select2-active"),this.opts.element.trigger(a.Event("select2-close"))}},externalSearch:function(a){this.open(),this.search.val(a),this.updateResults(!1)},clearSearch:function(){},getMaximumSelectionSize:function(){return K(this.opts.maximumSelectionSize,this.opts.element)},ensureHighlightVisible:function(){var c,d,e,f,g,h,i,j,b=this.results;if(d=this.highlight(),!(0>d)){if(0==d)return b.scrollTop(0),void 0;c=this.findHighlightableChoices().find(".select2-result-label"),e=a(c[d]),j=(e.offset()||{}).top||0,f=j+e.outerHeight(!0),d===c.length-1&&(i=b.find("li.select2-more-results"),i.length>0&&(f=i.offset().top+i.outerHeight(!0))),g=b.offset().top+b.outerHeight(!1),f>g&&b.scrollTop(b.scrollTop()+(f-g)),h=j-b.offset().top,0>h&&"none"!=e.css("display")&&b.scrollTop(b.scrollTop()+h)}},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)")},moveHighlight:function(b){for(var c=this.findHighlightableChoices(),d=this.highlight();d>-1&&d<c.length;){d+=b; var e=a(c[d]);if(e.hasClass("select2-result-selectable")&&!e.hasClass("select2-disabled")&&!e.hasClass("select2-selected")){this.highlight(d);break}}},highlight:function(b){var d,e,c=this.findHighlightableChoices();return 0===arguments.length?p(c.filter(".select2-highlighted")[0],c.get()):(b>=c.length&&(b=c.length-1),0>b&&(b=0),this.removeHighlight(),d=a(c[b]),d.addClass("select2-highlighted"),this.search.attr("aria-activedescendant",d.find(".select2-result-label").attr("id")),this.ensureHighlightVisible(),this.liveRegion.text(d.text()),e=d.data("select2-data"),e&&this.opts.element.trigger({type:"select2-highlight",val:this.id(e),choice:e}),void 0)},removeHighlight:function(){this.results.find(".select2-highlighted").removeClass("select2-highlighted")},touchMoved:function(){this._touchMoved=!0},clearTouchMoved:function(){this._touchMoved=!1},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(b){var c=a(b.target).closest(".select2-result-selectable");if(c.length>0&&!c.is(".select2-highlighted")){var d=this.findHighlightableChoices();this.highlight(d.index(c))}else 0==c.length&&this.removeHighlight()},loadMoreIfNeeded:function(){var c,a=this.results,b=a.find("li.select2-more-results"),d=this.resultsPage+1,e=this,f=this.search.val(),g=this.context;0!==b.length&&(c=b.offset().top-a.offset().top-a.height(),c<=this.opts.loadMorePadding&&(b.addClass("select2-active"),this.opts.query({element:this.opts.element,term:f,page:d,context:g,matcher:this.opts.matcher,callback:this.bind(function(c){e.opened()&&(e.opts.populateResults.call(this,a,c.results,{term:f,page:d,context:g}),e.postprocessResults(c,!1,!1),c.more===!0?(b.detach().appendTo(a).html(e.opts.escapeMarkup(K(e.opts.formatLoadMore,e.opts.element,d+1))),window.setTimeout(function(){e.loadMoreIfNeeded()},10)):b.remove(),e.positionDropdown(),e.resultsPage=d,e.context=c.context,this.opts.element.trigger({type:"select2-loaded",items:c}))})})))},tokenize:function(){},updateResults:function(c){function m(){d.removeClass("select2-active"),h.positionDropdown(),e.find(".select2-no-results,.select2-selection-limit,.select2-searching").length?h.liveRegion.text(e.text()):h.liveRegion.text(h.opts.formatMatches(e.find('.select2-result-selectable:not(".select2-selected")').length))}function n(a){e.html(a),m()}var g,i,l,d=this.search,e=this.results,f=this.opts,h=this,j=d.val(),k=a.data(this.container,"select2-last-term");if((c===!0||!k||!r(j,k))&&(a.data(this.container,"select2-last-term",j),c===!0||this.showSearchInput!==!1&&this.opened())){l=++this.queryCount;var o=this.getMaximumSelectionSize();if(o>=1&&(g=this.data(),a.isArray(g)&&g.length>=o&&J(f.formatSelectionTooBig,"formatSelectionTooBig")))return n("<li class='select2-selection-limit'>"+K(f.formatSelectionTooBig,f.element,o)+"</li>"),void 0;if(d.val().length<f.minimumInputLength)return J(f.formatInputTooShort,"formatInputTooShort")?n("<li class='select2-no-results'>"+K(f.formatInputTooShort,f.element,d.val(),f.minimumInputLength)+"</li>"):n(""),c&&this.showSearch&&this.showSearch(!0),void 0;if(f.maximumInputLength&&d.val().length>f.maximumInputLength)return J(f.formatInputTooLong,"formatInputTooLong")?n("<li class='select2-no-results'>"+K(f.formatInputTooLong,f.element,d.val(),f.maximumInputLength)+"</li>"):n(""),void 0;f.formatSearching&&0===this.findHighlightableChoices().length&&n("<li class='select2-searching'>"+K(f.formatSearching,f.element)+"</li>"),d.addClass("select2-active"),this.removeHighlight(),i=this.tokenize(),i!=b&&null!=i&&d.val(i),this.resultsPage=1,f.query({element:f.element,term:d.val(),page:this.resultsPage,context:null,matcher:f.matcher,callback:this.bind(function(g){var i;if(l==this.queryCount){if(!this.opened())return this.search.removeClass("select2-active"),void 0;if(g.hasError!==b&&J(f.formatAjaxError,"formatAjaxError"))return n("<li class='select2-ajax-error'>"+K(f.formatAjaxError,f.element,g.jqXHR,g.textStatus,g.errorThrown)+"</li>"),void 0;if(this.context=g.context===b?null:g.context,this.opts.createSearchChoice&&""!==d.val()&&(i=this.opts.createSearchChoice.call(h,d.val(),g.results),i!==b&&null!==i&&h.id(i)!==b&&null!==h.id(i)&&0===a(g.results).filter(function(){return r(h.id(this),h.id(i))}).length&&this.opts.createSearchChoicePosition(g.results,i)),0===g.results.length&&J(f.formatNoMatches,"formatNoMatches"))return n("<li class='select2-no-results'>"+K(f.formatNoMatches,f.element,d.val())+"</li>"),void 0;e.empty(),h.opts.populateResults.call(this,e,g.results,{term:d.val(),page:this.resultsPage,context:null}),g.more===!0&&J(f.formatLoadMore,"formatLoadMore")&&(e.append("<li class='select2-more-results'>"+f.escapeMarkup(K(f.formatLoadMore,f.element,this.resultsPage))+"</li>"),window.setTimeout(function(){h.loadMoreIfNeeded()},10)),this.postprocessResults(g,c),m(),this.opts.element.trigger({type:"select2-loaded",items:g})}})})}},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){y(this.search)},selectHighlighted:function(a){if(this._touchMoved)return this.clearTouchMoved(),void 0;var b=this.highlight(),c=this.results.find(".select2-highlighted"),d=c.closest(".select2-result").data("select2-data");d?(this.highlight(b),this.onSelect(d,a)):a&&a.noFocus&&this.close()},getPlaceholder:function(){var a;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||((a=this.getPlaceholderOption())!==b?a.text():b)},getPlaceholderOption:function(){if(this.select){var c=this.select.children("option").first();if(this.opts.placeholderOption!==b)return"first"===this.opts.placeholderOption&&c||"function"==typeof this.opts.placeholderOption&&this.opts.placeholderOption(this.select);if(""===a.trim(c.text())&&""===c.val())return c}},initContainerWidth:function(){function c(){var c,d,e,f,g,h;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px";if("copy"===this.opts.width||"resolve"===this.opts.width){if(c=this.opts.element.attr("style"),c!==b)for(d=c.split(";"),f=0,g=d.length;g>f;f+=1)if(h=d[f].replace(/\s/g,""),e=h.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i),null!==e&&e.length>=1)return e[1];return"resolve"===this.opts.width?(c=this.opts.element.css("width"),c.indexOf("%")>0?c:0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px"):null}return a.isFunction(this.opts.width)?this.opts.width():this.opts.width}var d=c.call(this);null!==d&&this.container.css("width",d)}}),d=O(c,{createContainer:function(){var b=a(document.createElement("div")).attr({"class":"select2-container"}).html(["<a href='javascript:void(0)' class='select2-choice' tabindex='-1'>"," <span class='select2-chosen'> </span><abbr class='select2-search-choice-close'></abbr>"," <span class='select2-arrow' role='presentation'><b role='presentation'></b></span>","</a>","<label for='' class='select2-offscreen'></label>","<input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' />","<div class='select2-drop select2-display-none'>"," <div class='select2-search'>"," <label for='' class='select2-offscreen'></label>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true'"," aria-autocomplete='list' />"," </div>"," <ul class='select2-results' role='listbox'>"," </ul>","</div>"].join(""));return b},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var c,d,e;this.opts.minimumResultsForSearch>=0&&this.showSearch(!0),this.parent.opening.apply(this,arguments),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.opts.shouldFocusInput(this)&&(this.search.focus(),c=this.search.get(0),c.createTextRange?(d=c.createTextRange(),d.collapse(!1),d.select()):c.setSelectionRange&&(e=this.search.val().length,c.setSelectionRange(e,e))),""===this.search.val()&&this.nextSearchTerm!=b&&(this.search.val(this.nextSearchTerm),this.search.select()),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger(a.Event("select2-open"))},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus()},destroy:function(){a("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),N.call(this,"selection","focusser")},initContainer:function(){var b,g,c=this.container,d=this.dropdown,e=f();this.opts.minimumResultsForSearch<0?this.showSearch(!1):this.showSearch(!0),this.selection=b=c.find(".select2-choice"),this.focusser=c.find(".select2-focusser"),b.find(".select2-chosen").attr("id","select2-chosen-"+e),this.focusser.attr("aria-labelledby","select2-chosen-"+e),this.results.attr("id","select2-results-"+e),this.search.attr("aria-owns","select2-results-"+e),this.focusser.attr("id","s2id_autogen"+e),g=a("label[for='"+this.opts.element.attr("id")+"']"),this.opts.element.focus(this.bind(function(){this.focus()})),this.focusser.prev().text(g.text()).attr("for",this.focusser.attr("id"));var h=this.opts.element.attr("title");this.opts.element.attr("title",h||g.text()),this.focusser.attr("tabindex",this.elementTabIndex),this.search.attr("id",this.focusser.attr("id")+"_search"),this.search.prev().text(a("label[for='"+this.focusser.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()&&229!=a.keyCode){if(a.which===k.PAGE_UP||a.which===k.PAGE_DOWN)return A(a),void 0;switch(a.which){case k.UP:case k.DOWN:return this.moveHighlight(a.which===k.UP?-1:1),A(a),void 0;case k.ENTER:return this.selectHighlighted(),A(a),void 0;case k.TAB:return this.selectHighlighted({noFocus:!0}),void 0;case k.ESC:return this.cancel(a),A(a),void 0}}})),this.search.on("blur",this.bind(function(){document.activeElement===this.body.get(0)&&window.setTimeout(this.bind(function(){this.opened()&&this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()&&a.which!==k.TAB&&!k.isControl(a)&&!k.isFunctionKey(a)&&a.which!==k.ESC){if(this.opts.openOnEnter===!1&&a.which===k.ENTER)return A(a),void 0;if(a.which==k.DOWN||a.which==k.UP||a.which==k.ENTER&&this.opts.openOnEnter){if(a.altKey||a.ctrlKey||a.shiftKey||a.metaKey)return;return this.open(),A(a),void 0}return a.which==k.DELETE||a.which==k.BACKSPACE?(this.opts.allowClear&&this.clear(),A(a),void 0):void 0}})),u(this.focusser),this.focusser.on("keyup-change input",this.bind(function(a){if(this.opts.minimumResultsForSearch>=0){if(a.stopPropagation(),this.opened())return;this.open()}})),b.on("mousedown touchstart","abbr",this.bind(function(a){this.isInterfaceEnabled()&&(this.clear(),B(a),this.close(),this.selection&&this.selection.focus())})),b.on("mousedown touchstart",this.bind(function(c){n(b),this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),A(c)})),d.on("mousedown touchstart",this.bind(function(){this.opts.shouldFocusInput(this)&&this.search.focus()})),b.on("focus",this.bind(function(a){A(a)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger(a.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.hide(),this.setPlaceholder()},clear:function(b){var c=this.selection.data("select2-data");if(c){var d=a.Event("select2-clearing");if(this.opts.element.trigger(d),d.isDefaultPrevented())return;var e=this.getPlaceholderOption();this.opts.element.val(e?e.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),b!==!1&&(this.opts.element.trigger({type:"select2-removed",val:this.id(c),choice:c}),this.triggerChange({removed:c}))}},initSelection:function(){if(this.isPlaceholderOptionSelected())this.updateSelection(null),this.close(),this.setPlaceholder();else{var c=this;this.opts.initSelection.call(null,this.opts.element,function(a){a!==b&&null!==a&&(c.updateSelection(a),c.close(),c.setPlaceholder(),c.nextSearchTerm=c.opts.nextSearchTerm(a,c.search.val()))})}},isPlaceholderOptionSelected:function(){var a;return this.getPlaceholder()===b?!1:(a=this.getPlaceholderOption())!==b&&a.prop("selected")||""===this.opts.element.val()||this.opts.element.val()===b||null===this.opts.element.val()},prepareOpts:function(){var b=this.parent.prepareOpts.apply(this,arguments),c=this;return"select"===b.element.get(0).tagName.toLowerCase()?b.initSelection=function(a,b){var d=a.find("option").filter(function(){return this.selected&&!this.disabled});b(c.optionToData(d))}:"data"in b&&(b.initSelection=b.initSelection||function(c,d){var e=c.val(),f=null;b.query({matcher:function(a,c,d){var g=r(e,b.id(d));return g&&(f=d),g},callback:a.isFunction(d)?function(){d(f)}:a.noop})}),b},getPlaceholder:function(){return this.select&&this.getPlaceholderOption()===b?b:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var a=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&a!==b){if(this.select&&this.getPlaceholderOption()===b)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(a)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},postprocessResults:function(a,b,c){var d=0,e=this;if(this.findHighlightableChoices().each2(function(a,b){return r(e.id(b.data("select2-data")),e.opts.element.val())?(d=a,!1):void 0}),c!==!1&&(b===!0&&d>=0?this.highlight(d):this.highlight(0)),b===!0){var g=this.opts.minimumResultsForSearch;g>=0&&this.showSearch(L(a.results)>=g)}},showSearch:function(b){this.showSearchInput!==b&&(this.showSearchInput=b,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!b),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!b),a(this.dropdown,this.container).toggleClass("select2-with-searchbox",b))},onSelect:function(a,b){if(this.triggerSelect(a)){var c=this.opts.element.val(),d=this.data();this.opts.element.val(this.id(a)),this.updateSelection(a),this.opts.element.trigger({type:"select2-selected",val:this.id(a),choice:a}),this.nextSearchTerm=this.opts.nextSearchTerm(a,this.search.val()),this.close(),b&&b.noFocus||!this.opts.shouldFocusInput(this)||this.focusser.focus(),r(c,this.id(a))||this.triggerChange({added:a,removed:d})}},updateSelection:function(a){var d,e,c=this.selection.find(".select2-chosen");this.selection.data("select2-data",a),c.empty(),null!==a&&(d=this.opts.formatSelection(a,c,this.opts.escapeMarkup)),d!==b&&c.append(d),e=this.opts.formatSelectionCssClass(a,c),e!==b&&c.addClass(e),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==b&&this.container.addClass("select2-allowclear")},val:function(){var a,c=!1,d=null,e=this,f=this.data();if(0===arguments.length)return this.opts.element.val();if(a=arguments[0],arguments.length>1&&(c=arguments[1]),this.select)this.select.val(a).find("option").filter(function(){return this.selected}).each2(function(a,b){return d=e.optionToData(b),!1}),this.updateSelection(d),this.setPlaceholder(),c&&this.triggerChange({added:d,removed:f});else{if(!a&&0!==a)return this.clear(c),void 0;if(this.opts.initSelection===b)throw new Error("cannot call val() if initSelection() is not defined");this.opts.element.val(a),this.opts.initSelection(this.opts.element,function(a){e.opts.element.val(a?e.id(a):""),e.updateSelection(a),e.setPlaceholder(),c&&e.triggerChange({added:a,removed:f})})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(a){var c,d=!1;return 0===arguments.length?(c=this.selection.data("select2-data"),c==b&&(c=null),c):(arguments.length>1&&(d=arguments[1]),a?(c=this.data(),this.opts.element.val(a?this.id(a):""),this.updateSelection(a),d&&this.triggerChange({added:a,removed:c})):this.clear(d),void 0)}}),e=O(c,{createContainer:function(){var b=a(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html(["<ul class='select2-choices'>"," <li class='select2-search-field'>"," <label for='' class='select2-offscreen'></label>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>"," </li>","</ul>","<div class='select2-drop select2-drop-multi select2-display-none'>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return b},prepareOpts:function(){var b=this.parent.prepareOpts.apply(this,arguments),c=this;return"select"===b.element.get(0).tagName.toLowerCase()?b.initSelection=function(a,b){var d=[];a.find("option").filter(function(){return this.selected&&!this.disabled}).each2(function(a,b){d.push(c.optionToData(b))}),b(d)}:"data"in b&&(b.initSelection=b.initSelection||function(c,d){var e=s(c.val(),b.separator,b.transformVal),f=[];b.query({matcher:function(c,d,g){var h=a.grep(e,function(a){return r(a,b.id(g))}).length;return h&&f.push(g),h},callback:a.isFunction(d)?function(){for(var a=[],c=0;c<e.length;c++)for(var g=e[c],h=0;h<f.length;h++){var i=f[h];if(r(g,b.id(i))){a.push(i),f.splice(h,1);break}}d(a)}:a.noop})}),b},selectChoice:function(a){var b=this.container.find(".select2-search-choice-focus");b.length&&a&&a[0]==b[0]||(b.length&&this.opts.element.trigger("choice-deselected",b),b.removeClass("select2-search-choice-focus"),a&&a.length&&(this.close(),a.addClass("select2-search-choice-focus"),this.opts.element.trigger("choice-selected",a)))},destroy:function(){a("label[for='"+this.search.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),N.call(this,"searchContainer","selection")},initContainer:function(){var c,b=".select2-choices";this.searchContainer=this.container.find(".select2-search-field"),this.selection=c=this.container.find(b);var d=this;this.selection.on("click",".select2-container:not(.select2-container-disabled) .select2-search-choice:not(.select2-locked)",function(){d.search[0].focus(),d.selectChoice(a(this))}),this.search.attr("id","s2id_autogen"+f()),this.search.prev().text(a("label[for='"+this.opts.element.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.opts.element.focus(this.bind(function(){this.focus()})),this.search.on("input paste",this.bind(function(){this.search.attr("placeholder")&&0==this.search.val().length||this.isInterfaceEnabled()&&(this.opened()||this.open())})),this.search.attr("tabindex",this.elementTabIndex),this.keydowns=0,this.search.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()){++this.keydowns;var b=c.find(".select2-search-choice-focus"),d=b.prev(".select2-search-choice:not(.select2-locked)"),e=b.next(".select2-search-choice:not(.select2-locked)"),f=z(this.search);if(b.length&&(a.which==k.LEFT||a.which==k.RIGHT||a.which==k.BACKSPACE||a.which==k.DELETE||a.which==k.ENTER)){var g=b;return a.which==k.LEFT&&d.length?g=d:a.which==k.RIGHT?g=e.length?e:null:a.which===k.BACKSPACE?this.unselect(b.first())&&(this.search.width(10),g=d.length?d:e):a.which==k.DELETE?this.unselect(b.first())&&(this.search.width(10),g=e.length?e:null):a.which==k.ENTER&&(g=null),this.selectChoice(g),A(a),g&&g.length||this.open(),void 0}if((a.which===k.BACKSPACE&&1==this.keydowns||a.which==k.LEFT)&&0==f.offset&&!f.length)return this.selectChoice(c.find(".select2-search-choice:not(.select2-locked)").last()),A(a),void 0;if(this.selectChoice(null),this.opened())switch(a.which){case k.UP:case k.DOWN:return this.moveHighlight(a.which===k.UP?-1:1),A(a),void 0;case k.ENTER:return this.selectHighlighted(),A(a),void 0;case k.TAB:return this.selectHighlighted({noFocus:!0}),this.close(),void 0;case k.ESC:return this.cancel(a),A(a),void 0}if(a.which!==k.TAB&&!k.isControl(a)&&!k.isFunctionKey(a)&&a.which!==k.BACKSPACE&&a.which!==k.ESC){if(a.which===k.ENTER){if(this.opts.openOnEnter===!1)return;if(a.altKey||a.ctrlKey||a.shiftKey||a.metaKey)return}this.open(),(a.which===k.PAGE_UP||a.which===k.PAGE_DOWN)&&A(a),a.which===k.ENTER&&A(a)}}})),this.search.on("keyup",this.bind(function(){this.keydowns=0,this.resizeSearch()})),this.search.on("blur",this.bind(function(b){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.selectChoice(null),this.opened()||this.clearSearch(),b.stopImmediatePropagation(),this.opts.element.trigger(a.Event("select2-blur"))})),this.container.on("click",b,this.bind(function(b){this.isInterfaceEnabled()&&(a(b.target).closest(".select2-search-choice").length>0||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.open(),this.focusSearch(),b.preventDefault()))})),this.container.on("focus",b,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.hide(),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var c=this;this.opts.initSelection.call(null,this.opts.element,function(a){a!==b&&null!==a&&(c.updateSelection(a),c.close(),c.clearSearch())})}},clearSearch:function(){var a=this.getPlaceholder(),c=this.getMaxSearchWidth();a!==b&&0===this.getVal().length&&this.search.hasClass("select2-focused")===!1?(this.search.val(a).addClass("select2-default"),this.search.width(c>0?c:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),""===this.search.val()&&this.nextSearchTerm!=b&&(this.search.val(this.nextSearchTerm),this.search.select()),this.updateResults(!0),this.opts.shouldFocusInput(this)&&this.search.focus(),this.opts.element.trigger(a.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(b){var c=[],d=[],e=this;a(b).each(function(){p(e.id(this),c)<0&&(c.push(e.id(this)),d.push(this))}),b=d,this.selection.find(".select2-search-choice").remove(),a(b).each(function(){e.addSelectedChoice(this)}),e.postprocessResults()},tokenize:function(){var a=this.search.val();a=this.opts.tokenizer.call(this,a,this.data(),this.bind(this.onSelect),this.opts),null!=a&&a!=b&&(this.search.val(a),a.length>0&&this.open())},onSelect:function(a,c){this.triggerSelect(a)&&""!==a.text&&(this.addSelectedChoice(a),this.opts.element.trigger({type:"selected",val:this.id(a),choice:a}),this.nextSearchTerm=this.opts.nextSearchTerm(a,this.search.val()),this.clearSearch(),this.updateResults(),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(a,!1,this.opts.closeOnSelect===!0),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()?this.updateResults(!0):this.nextSearchTerm!=b&&(this.search.val(this.nextSearchTerm),this.updateResults(),this.search.select()),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:a}),c&&c.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(c){var j,k,d=!c.locked,e=a("<li class='select2-search-choice'> <div></div> <a href='#' class='select2-search-choice-close' tabindex='-1'></a></li>"),f=a("<li class='select2-search-choice select2-locked'><div></div></li>"),g=d?e:f,h=this.id(c),i=this.getVal();j=this.opts.formatSelection(c,g.find("div"),this.opts.escapeMarkup),j!=b&&g.find("div").replaceWith(a("<div></div>").html(j)),k=this.opts.formatSelectionCssClass(c,g.find("div")),k!=b&&g.addClass(k),d&&g.find(".select2-search-choice-close").on("mousedown",A).on("click dblclick",this.bind(function(b){this.isInterfaceEnabled()&&(this.unselect(a(b.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),A(b),this.close(),this.focusSearch())})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),g.data("select2-data",c),g.insertBefore(this.searchContainer),i.push(h),this.setVal(i)},unselect:function(b){var d,e,c=this.getVal();if(b=b.closest(".select2-search-choice"),0===b.length)throw"Invalid argument: "+b+". Must be .select2-search-choice";if(d=b.data("select2-data")){var f=a.Event("select2-removing");if(f.val=this.id(d),f.choice=d,this.opts.element.trigger(f),f.isDefaultPrevented())return!1;for(;(e=p(this.id(d),c))>=0;)c.splice(e,1),this.setVal(c),this.select&&this.postprocessResults();return b.remove(),this.opts.element.trigger({type:"select2-removed",val:this.id(d),choice:d}),this.triggerChange({removed:d}),!0}},postprocessResults:function(a,b,c){var d=this.getVal(),e=this.results.find(".select2-result"),f=this.results.find(".select2-result-with-children"),g=this;e.each2(function(a,b){var c=g.id(b.data("select2-data"));p(c,d)>=0&&(b.addClass("select2-selected"),b.find(".select2-result-selectable").addClass("select2-selected"))}),f.each2(function(a,b){b.is(".select2-result-selectable")||0!==b.find(".select2-result-selectable:not(.select2-selected)").length||b.addClass("select2-selected")}),-1==this.highlight()&&c!==!1&&this.opts.closeOnSelect===!0&&g.highlight(0),!this.opts.createSearchChoice&&!e.filter(".select2-result:not(.select2-selected)").length>0&&(!a||a&&!a.more&&0===this.results.find(".select2-no-results").length)&&J(g.opts.formatNoMatches,"formatNoMatches")&&this.results.append("<li class='select2-no-results'>"+K(g.opts.formatNoMatches,g.opts.element,g.search.val())+"</li>")},getMaxSearchWidth:function(){return this.selection.width()-t(this.search)},resizeSearch:function(){var a,b,c,d,e,f=t(this.search);a=C(this.search)+10,b=this.search.offset().left,c=this.selection.width(),d=this.selection.offset().left,e=c-(b-d)-f,a>e&&(e=c-f),40>e&&(e=c-f),0>=e&&(e=a),this.search.width(Math.floor(e))},getVal:function(){var a;return this.select?(a=this.select.val(),null===a?[]:a):(a=this.opts.element.val(),s(a,this.opts.separator,this.opts.transformVal))},setVal:function(b){var c;this.select?this.select.val(b):(c=[],a(b).each(function(){p(this,c)<0&&c.push(this)}),this.opts.element.val(0===c.length?"":c.join(this.opts.separator)))},buildChangeDetails:function(a,b){for(var b=b.slice(0),a=a.slice(0),c=0;c<b.length;c++)for(var d=0;d<a.length;d++)r(this.opts.id(b[c]),this.opts.id(a[d]))&&(b.splice(c,1),c>0&&c--,a.splice(d,1),d--);return{added:b,removed:a}},val:function(c,d){var e,f=this;if(0===arguments.length)return this.getVal();if(e=this.data(),e.length||(e=[]),!c&&0!==c)return this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),d&&this.triggerChange({added:this.data(),removed:e}),void 0;if(this.setVal(c),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),d&&this.triggerChange(this.buildChangeDetails(e,this.data()));else{if(this.opts.initSelection===b)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(b){var c=a.map(b,f.id);f.setVal(c),f.updateSelection(b),f.clearSearch(),d&&f.triggerChange(f.buildChangeDetails(e,f.data()))})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var b=[],c=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){b.push(c.opts.id(a(this).data("select2-data")))}),this.setVal(b),this.triggerChange()},data:function(b,c){var e,f,d=this;return 0===arguments.length?this.selection.children(".select2-search-choice").map(function(){return a(this).data("select2-data")}).get():(f=this.data(),b||(b=[]),e=a.map(b,function(a){return d.opts.id(a)}),this.setVal(e),this.updateSelection(b),this.clearSearch(),c&&this.triggerChange(this.buildChangeDetails(f,this.data())),void 0)}}),a.fn.select2=function(){var d,e,f,g,h,c=Array.prototype.slice.call(arguments,0),i=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],j=["opened","isFocused","container","dropdown"],k=["val","data"],l={search:"externalSearch"};return this.each(function(){if(0===c.length||"object"==typeof c[0])d=0===c.length?{}:a.extend({},c[0]),d.element=a(this),"select"===d.element.get(0).tagName.toLowerCase()?h=d.element.prop("multiple"):(h=d.multiple||!1,"tags"in d&&(d.multiple=h=!0)),e=h?new window.Select2["class"].multi:new window.Select2["class"].single,e.init(d);else{if("string"!=typeof c[0])throw"Invalid arguments to select2 plugin: "+c;if(p(c[0],i)<0)throw"Unknown method: "+c[0];if(g=b,e=a(this).data("select2"),e===b)return;if(f=c[0],"container"===f?g=e.container:"dropdown"===f?g=e.dropdown:(l[f]&&(f=l[f]),g=e[f].apply(e,c.slice(1))),p(c[0],j)>=0||p(c[0],k)>=0&&1==c.length)return!1}}),g===b?this:g},a.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(a,b,c,d){var e=[];return E(this.text(a),c.term,e,d),e.join("")},transformVal:function(b){return a.trim(b)},formatSelection:function(a,c,d){return a?d(this.text(a)):b},sortResults:function(a){return a},formatResultCssClass:function(a){return a.css},formatSelectionCssClass:function(){return b},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(a){return a==b?null:a.id},text:function(b){return b&&this.data&&this.data.text?a.isFunction(this.data.text)?this.data.text(b):b[this.data.text]:b.text },matcher:function(a,b){return o(""+b).toUpperCase().indexOf(o(""+a).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:M,escapeMarkup:F,blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(a){return a},adaptDropdownCssClass:function(){return null},nextSearchTerm:function(){return b},searchInputPlaceholder:"",createSearchChoicePosition:"top",shouldFocusInput:function(a){var b="ontouchstart"in window||navigator.msMaxTouchPoints>0;return b?a.opts.minimumResultsForSearch<0?!1:!0:!0}},a.fn.select2.locales=[],a.fn.select2.locales.en={formatMatches:function(a){return 1===a?"One result is available, press enter to select it.":a+" results are available, use up and down arrow keys to navigate."},formatNoMatches:function(){return"No matches found"},formatAjaxError:function(){return"Loading failed"},formatInputTooShort:function(a,b){var c=b-a.length;return"Please enter "+c+" or more character"+(1==c?"":"s")},formatInputTooLong:function(a,b){var c=a.length-b;return"Please delete "+c+" character"+(1==c?"":"s")},formatSelectionTooBig:function(a){return"You can only select "+a+" item"+(1==a?"":"s")},formatLoadMore:function(){return"Loading more results\u2026"},formatSearching:function(){return"Searching\u2026"}},a.extend(a.fn.select2.defaults,a.fn.select2.locales.en),a.fn.select2.ajaxDefaults={transport:a.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window.Select2={query:{ajax:G,local:H,tags:I},util:{debounce:w,markMatch:E,escapeMarkup:F,stripDiacritics:o},"class":{"abstract":c,single:d,multi:e}}}}(jQuery);;!function(a,b){"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?module.exports=b():a.Handlebars=a.Handlebars||b()}(this,function(){var a=function(){"use strict";function b(a){this.string=a}var a;return b.prototype.toString=function(){return""+this.string},a=b}(),b=function(a){"use strict";function g(a){return d[a]}function h(a){for(var b=1;b<arguments.length;b++)for(var c in arguments[b])Object.prototype.hasOwnProperty.call(arguments[b],c)&&(a[c]=arguments[b][c]);return a}function l(a){return a instanceof c?a.toString():null==a?"":a?(a=""+a,f.test(a)?a.replace(e,g):a):a+""}function m(a){return a||0===a?k(a)&&0===a.length?!0:!1:!0}function n(a,b){return(a?a+".":"")+b}var b={},c=a,d={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},e=/[&<>"'`]/g,f=/[&<>"'`]/;b.extend=h;var i=Object.prototype.toString;b.toString=i;var j=function(a){return"function"==typeof a};j(/x/)&&(j=function(a){return"function"==typeof a&&"[object Function]"===i.call(a)});var j;b.isFunction=j;var k=Array.isArray||function(a){return a&&"object"==typeof a?"[object Array]"===i.call(a):!1};return b.isArray=k,b.escapeExpression=l,b.isEmpty=m,b.appendContextPath=n,b}(a),c=function(){"use strict";function c(a,c){var d;c&&c.firstLine&&(d=c.firstLine,a+=" - "+d+":"+c.firstColumn);for(var e=Error.prototype.constructor.call(this,a),f=0;f<b.length;f++)this[b[f]]=e[b[f]];d&&(this.lineNumber=d,this.column=c.firstColumn)}var a,b=["description","fileName","lineNumber","message","name","number","stack"];return c.prototype=new Error,a=c}(),d=function(a,b){"use strict";function m(a,b){this.helpers=a||{},this.partials=b||{},n(this)}function n(a){a.registerHelper("helperMissing",function(){if(1===arguments.length)return void 0;throw new e("Missing helper: '"+arguments[arguments.length-1].name+"'")}),a.registerHelper("blockHelperMissing",function(b,c){var e=c.inverse,f=c.fn;if(b===!0)return f(this);if(b===!1||null==b)return e(this);if(i(b))return b.length>0?(c.ids&&(c.ids=[c.name]),a.helpers.each(b,c)):e(this);if(c.data&&c.ids){var g=q(c.data);g.contextPath=d.appendContextPath(c.data.contextPath,c.name),c={data:g}}return f(b,c)}),a.registerHelper("each",function(a,b){if(!b)throw new e("Must pass iterator to #each");var k,l,c=b.fn,f=b.inverse,g=0,h="";if(b.data&&b.ids&&(l=d.appendContextPath(b.data.contextPath,b.ids[0])+"."),j(a)&&(a=a.call(this)),b.data&&(k=q(b.data)),a&&"object"==typeof a)if(i(a))for(var m=a.length;m>g;g++)k&&(k.index=g,k.first=0===g,k.last=g===a.length-1,l&&(k.contextPath=l+g)),h+=c(a[g],{data:k});else for(var n in a)a.hasOwnProperty(n)&&(k&&(k.key=n,k.index=g,k.first=0===g,l&&(k.contextPath=l+n)),h+=c(a[n],{data:k}),g++);return 0===g&&(h=f(this)),h}),a.registerHelper("if",function(a,b){return j(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||d.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})}),a.registerHelper("with",function(a,b){j(a)&&(a=a.call(this));var c=b.fn;if(d.isEmpty(a))return b.inverse(this);if(b.data&&b.ids){var e=q(b.data);e.contextPath=d.appendContextPath(b.data.contextPath,b.ids[0]),b={data:e}}return c(a,b)}),a.registerHelper("log",function(b,c){var d=c.data&&null!=c.data.level?parseInt(c.data.level,10):1;a.log(d,b)}),a.registerHelper("lookup",function(a,b){return a&&a[b]})}var c={},d=a,e=b,f="2.0.0";c.VERSION=f;var g=6;c.COMPILER_REVISION=g;var h={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1"};c.REVISION_CHANGES=h;var i=d.isArray,j=d.isFunction,k=d.toString,l="[object Object]";c.HandlebarsEnvironment=m,m.prototype={constructor:m,logger:o,log:p,registerHelper:function(a,b){if(k.call(a)===l){if(b)throw new e("Arg not supported with multiple helpers");d.extend(this.helpers,a)}else this.helpers[a]=b},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,b){k.call(a)===l?d.extend(this.partials,a):this.partials[a]=b},unregisterPartial:function(a){delete this.partials[a]}};var o={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(a,b){if(o.level<=a){var c=o.methodMap[a];"undefined"!=typeof console&&console[c]&&console[c].call(console,b)}}};c.logger=o;var p=o.log;c.log=p;var q=function(a){var b=d.extend({},a);return b._parent=a,b};return c.createFrame=q,c}(b,c),e=function(a,b,c){"use strict";function j(a){var b=a&&a[0]||1,c=g;if(b!==c){if(c>b){var d=h[c],e=h[b];throw new f("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new f("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function k(a,b){if(!b)throw new f("No environment passed to template");if(!a||!a.main)throw new f("Unknown template object: "+typeof a);b.VM.checkRevision(a.compiler);var c=function(c,d,g,h,i,j,k,l,m){i&&(h=e.extend({},h,i));var n=b.VM.invokePartial.call(this,c,g,h,j,k,l,m);if(null==n&&b.compile){var o={helpers:j,partials:k,data:l,depths:m};k[g]=b.compile(c,{data:void 0!==l,compat:a.compat},b),n=k[g](h,o)}if(null!=n){if(d){for(var p=n.split("\n"),q=0,r=p.length;r>q&&(p[q]||q+1!==r);q++)p[q]=d+p[q];n=p.join("\n")}return n}throw new f("The partial "+g+" could not be compiled when running in runtime-only mode")},d={lookup:function(a,b){for(var c=a.length,d=0;c>d;d++)if(a[d]&&null!=a[d][b])return a[d][b]},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:e.escapeExpression,invokePartial:c,fn:function(b){return a[b]},programs:[],program:function(a,b,c){var d=this.programs[a],e=this.fn(a);return b||c?d=l(this,a,e,b,c):d||(d=this.programs[a]=l(this,a,e)),d},data:function(a,b){for(;a&&b--;)a=a._parent;return a},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c=e.extend({},b,a)),c},noop:b.VM.noop,compilerInfo:a.compiler},g=function(b,c){c=c||{};var e=c.data;g._setup(c),!c.partial&&a.useData&&(e=o(b,e));var f;return a.useDepths&&(f=c.depths?[b].concat(c.depths):[b]),a.main.call(d,b,d.helpers,d.partials,e,f)};return g.isTop=!0,g._setup=function(c){c.partial?(d.helpers=c.helpers,d.partials=c.partials):(d.helpers=d.merge(c.helpers,b.helpers),a.usePartial&&(d.partials=d.merge(c.partials,b.partials)))},g._child=function(b,c,e){if(a.useDepths&&!e)throw new f("must pass parent depths");return l(d,b,a[b],c,e)},g}function l(a,b,c,d,e){var f=function(b,f){return f=f||{},c.call(a,b,a.helpers,a.partials,f.data||d,e&&[b].concat(e))};return f.program=b,f.depth=e?e.length:0,f}function m(a,b,c,d,e,g,h){var i={partial:!0,helpers:d,partials:e,data:g,depths:h};if(void 0===a)throw new f("The partial "+b+" could not be found");return a instanceof Function?a(c,i):void 0}function n(){return""}function o(a,b){return b&&"root"in b||(b=b?i(b):{},b.root=a),b}var d={},e=a,f=b,g=c.COMPILER_REVISION,h=c.REVISION_CHANGES,i=c.createFrame;return d.checkRevision=j,d.template=k,d.program=l,d.invokePartial=m,d.noop=n,d}(b,c,d),f=function(a,b,c,d,e){"use strict";var f,g=a,h=b,i=c,j=d,k=e,l=function(){var a=new g.HandlebarsEnvironment;return j.extend(a,g),a.SafeString=h,a.Exception=i,a.Utils=j,a.escapeExpression=j.escapeExpression,a.VM=k,a.template=function(b){return k.template(b,a)},a},m=l();return m.create=l,m["default"]=m,f=m}(d,a,c,b,e),g=function(a){"use strict";function d(a){a=a||{},this.firstLine=a.first_line,this.firstColumn=a.first_column,this.lastColumn=a.last_column,this.lastLine=a.last_line}var b,c=a,e={ProgramNode:function(a,b,c){d.call(this,c),this.type="program",this.statements=a,this.strip=b},MustacheNode:function(a,b,c,f,g){if(d.call(this,g),this.type="mustache",this.strip=f,null!=c&&c.charAt){var h=c.charAt(3)||c.charAt(2);this.escaped="{"!==h&&"&"!==h}else this.escaped=!!c;a instanceof e.SexprNode?this.sexpr=a:this.sexpr=new e.SexprNode(a,b),this.id=this.sexpr.id,this.params=this.sexpr.params,this.hash=this.sexpr.hash,this.eligibleHelper=this.sexpr.eligibleHelper,this.isHelper=this.sexpr.isHelper},SexprNode:function(a,b,c){d.call(this,c),this.type="sexpr",this.hash=b;var e=this.id=a[0],f=this.params=a.slice(1);this.isHelper=!(!f.length&&!b),this.eligibleHelper=this.isHelper||e.isSimple},PartialNode:function(a,b,c,e,f){d.call(this,f),this.type="partial",this.partialName=a,this.context=b,this.hash=c,this.strip=e,this.strip.inlineStandalone=!0},BlockNode:function(a,b,c,e,f){d.call(this,f),this.type="block",this.mustache=a,this.program=b,this.inverse=c,this.strip=e,c&&!b&&(this.isInverse=!0)},RawBlockNode:function(a,b,f,g){if(d.call(this,g),a.sexpr.id.original!==f)throw new c(a.sexpr.id.original+" doesn't match "+f,this);b=new e.ContentNode(b,g),this.type="block",this.mustache=a,this.program=new e.ProgramNode([b],{},g)},ContentNode:function(a,b){d.call(this,b),this.type="content",this.original=this.string=a},HashNode:function(a,b){d.call(this,b),this.type="hash",this.pairs=a},IdNode:function(a,b){d.call(this,b),this.type="ID";for(var e="",f=[],g=0,h="",i=0,j=a.length;j>i;i++){var k=a[i].part;if(e+=(a[i].separator||"")+k,".."===k||"."===k||"this"===k){if(f.length>0)throw new c("Invalid path: "+e,this);".."===k?(g++,h+="../"):this.isScoped=!0}else f.push(k)}this.original=e,this.parts=f,this.string=f.join("."),this.depth=g,this.idName=h+this.string,this.isSimple=1===a.length&&!this.isScoped&&0===g,this.stringModeValue=this.string},PartialNameNode:function(a,b){d.call(this,b),this.type="PARTIAL_NAME",this.name=a.original},DataNode:function(a,b){d.call(this,b),this.type="DATA",this.id=a,this.stringModeValue=a.stringModeValue,this.idName="@"+a.stringModeValue},StringNode:function(a,b){d.call(this,b),this.type="STRING",this.original=this.string=this.stringModeValue=a},NumberNode:function(a,b){d.call(this,b),this.type="NUMBER",this.original=this.number=a,this.stringModeValue=Number(a)},BooleanNode:function(a,b){d.call(this,b),this.type="BOOLEAN",this.bool=a,this.stringModeValue="true"===a},CommentNode:function(a,b){d.call(this,b),this.type="comment",this.comment=a,this.strip={inlineStandalone:!0}}};return b=e}(c),h=function(){"use strict";var a,b=function(){function c(){this.yy={}}var a={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,CONTENT:12,COMMENT:13,openRawBlock:14,END_RAW_BLOCK:15,OPEN_RAW_BLOCK:16,sexpr:17,CLOSE_RAW_BLOCK:18,openBlock:19,block_option0:20,closeBlock:21,openInverse:22,block_option1:23,OPEN_BLOCK:24,CLOSE:25,OPEN_INVERSE:26,inverseAndProgram:27,INVERSE:28,OPEN_ENDBLOCK:29,path:30,OPEN:31,OPEN_UNESCAPED:32,CLOSE_UNESCAPED:33,OPEN_PARTIAL:34,partialName:35,param:36,partial_option0:37,partial_option1:38,sexpr_repetition0:39,sexpr_option0:40,dataName:41,STRING:42,NUMBER:43,BOOLEAN:44,OPEN_SEXPR:45,CLOSE_SEXPR:46,hash:47,hash_repetition_plus0:48,hashSegment:49,ID:50,EQUALS:51,DATA:52,pathSegments:53,SEP:54,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",12:"CONTENT",13:"COMMENT",15:"END_RAW_BLOCK",16:"OPEN_RAW_BLOCK",18:"CLOSE_RAW_BLOCK",24:"OPEN_BLOCK",25:"CLOSE",26:"OPEN_INVERSE",28:"INVERSE",29:"OPEN_ENDBLOCK",31:"OPEN",32:"OPEN_UNESCAPED",33:"CLOSE_UNESCAPED",34:"OPEN_PARTIAL",42:"STRING",43:"NUMBER",44:"BOOLEAN",45:"OPEN_SEXPR",46:"CLOSE_SEXPR",50:"ID",51:"EQUALS",52:"DATA",54:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[10,3],[14,3],[9,4],[9,4],[19,3],[22,3],[27,2],[21,3],[8,3],[8,3],[11,5],[11,4],[17,3],[17,1],[36,1],[36,1],[36,1],[36,1],[36,1],[36,3],[47,1],[49,3],[35,1],[35,1],[35,1],[41,2],[30,1],[53,3],[53,1],[6,0],[6,2],[20,0],[20,1],[23,0],[23,1],[37,0],[37,1],[38,0],[38,1],[39,0],[39,2],[40,0],[40,1],[48,1],[48,2]],performAction:function(a,b,c,d,e,f,g){var h=f.length-1;switch(e){case 1:return d.prepareProgram(f[h-1].statements,!0),f[h-1];case 2:this.$=new d.ProgramNode(d.prepareProgram(f[h]),{},this._$);break;case 3:this.$=f[h];break;case 4:this.$=f[h];break;case 5:this.$=f[h];break;case 6:this.$=f[h];break;case 7:this.$=new d.ContentNode(f[h],this._$);break;case 8:this.$=new d.CommentNode(f[h],this._$);break;case 9:this.$=new d.RawBlockNode(f[h-2],f[h-1],f[h],this._$);break;case 10:this.$=new d.MustacheNode(f[h-1],null,"","",this._$);break;case 11:this.$=d.prepareBlock(f[h-3],f[h-2],f[h-1],f[h],!1,this._$);break;case 12:this.$=d.prepareBlock(f[h-3],f[h-2],f[h-1],f[h],!0,this._$);break;case 13:this.$=new d.MustacheNode(f[h-1],null,f[h-2],d.stripFlags(f[h-2],f[h]),this._$);break;case 14:this.$=new d.MustacheNode(f[h-1],null,f[h-2],d.stripFlags(f[h-2],f[h]),this._$);break;case 15:this.$={strip:d.stripFlags(f[h-1],f[h-1]),program:f[h]};break;case 16:this.$={path:f[h-1],strip:d.stripFlags(f[h-2],f[h])};break;case 17:this.$=new d.MustacheNode(f[h-1],null,f[h-2],d.stripFlags(f[h-2],f[h]),this._$);break;case 18:this.$=new d.MustacheNode(f[h-1],null,f[h-2],d.stripFlags(f[h-2],f[h]),this._$);break;case 19:this.$=new d.PartialNode(f[h-3],f[h-2],f[h-1],d.stripFlags(f[h-4],f[h]),this._$);break;case 20:this.$=new d.PartialNode(f[h-2],void 0,f[h-1],d.stripFlags(f[h-3],f[h]),this._$);break;case 21:this.$=new d.SexprNode([f[h-2]].concat(f[h-1]),f[h],this._$);break;case 22:this.$=new d.SexprNode([f[h]],null,this._$);break;case 23:this.$=f[h];break;case 24:this.$=new d.StringNode(f[h],this._$);break;case 25:this.$=new d.NumberNode(f[h],this._$);break;case 26:this.$=new d.BooleanNode(f[h],this._$);break;case 27:this.$=f[h];break;case 28:f[h-1].isHelper=!0,this.$=f[h-1];break;case 29:this.$=new d.HashNode(f[h],this._$);break;case 30:this.$=[f[h-2],f[h]];break;case 31:this.$=new d.PartialNameNode(f[h],this._$);break;case 32:this.$=new d.PartialNameNode(new d.StringNode(f[h],this._$),this._$);break;case 33:this.$=new d.PartialNameNode(new d.NumberNode(f[h],this._$));break;case 34:this.$=new d.DataNode(f[h],this._$);break;case 35:this.$=new d.IdNode(f[h],this._$);break;case 36:f[h-2].push({part:f[h],separator:f[h-1]}),this.$=f[h-2];break;case 37:this.$=[{part:f[h]}];break;case 38:this.$=[];break;case 39:f[h-1].push(f[h]);break;case 48:this.$=[];break;case 49:f[h-1].push(f[h]);break;case 52:this.$=[f[h]];break;case 53:f[h-1].push(f[h])}},table:[{3:1,4:2,5:[2,38],6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],31:[2,38],32:[2,38],34:[2,38]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:[1,10],13:[1,11],14:16,16:[1,20],19:14,22:15,24:[1,18],26:[1,19],28:[2,2],29:[2,2],31:[1,12],32:[1,13],34:[1,17]},{1:[2,1]},{5:[2,39],12:[2,39],13:[2,39],16:[2,39],24:[2,39],26:[2,39],28:[2,39],29:[2,39],31:[2,39],32:[2,39],34:[2,39]},{5:[2,3],12:[2,3],13:[2,3],16:[2,3],24:[2,3],26:[2,3],28:[2,3],29:[2,3],31:[2,3],32:[2,3],34:[2,3]},{5:[2,4],12:[2,4],13:[2,4],16:[2,4],24:[2,4],26:[2,4],28:[2,4],29:[2,4],31:[2,4],32:[2,4],34:[2,4]},{5:[2,5],12:[2,5],13:[2,5],16:[2,5],24:[2,5],26:[2,5],28:[2,5],29:[2,5],31:[2,5],32:[2,5],34:[2,5]},{5:[2,6],12:[2,6],13:[2,6],16:[2,6],24:[2,6],26:[2,6],28:[2,6],29:[2,6],31:[2,6],32:[2,6],34:[2,6]},{5:[2,7],12:[2,7],13:[2,7],16:[2,7],24:[2,7],26:[2,7],28:[2,7],29:[2,7],31:[2,7],32:[2,7],34:[2,7]},{5:[2,8],12:[2,8],13:[2,8],16:[2,8],24:[2,8],26:[2,8],28:[2,8],29:[2,8],31:[2,8],32:[2,8],34:[2,8]},{17:21,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:27,30:22,41:23,50:[1,26],52:[1,25],53:24},{4:28,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{4:29,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{12:[1,30]},{30:32,35:31,42:[1,33],43:[1,34],50:[1,26],53:24},{17:35,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:36,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:37,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[1,38]},{18:[2,48],25:[2,48],33:[2,48],39:39,42:[2,48],43:[2,48],44:[2,48],45:[2,48],46:[2,48],50:[2,48],52:[2,48]},{18:[2,22],25:[2,22],33:[2,22],46:[2,22]},{18:[2,35],25:[2,35],33:[2,35],42:[2,35],43:[2,35],44:[2,35],45:[2,35],46:[2,35],50:[2,35],52:[2,35],54:[1,40]},{30:41,50:[1,26],53:24},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],52:[2,37],54:[2,37]},{33:[1,42]},{20:43,27:44,28:[1,45],29:[2,40]},{23:46,27:47,28:[1,45],29:[2,42]},{15:[1,48]},{25:[2,46],30:51,36:49,38:50,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],47:57,48:58,49:60,50:[1,59],52:[1,25],53:24},{25:[2,31],42:[2,31],43:[2,31],44:[2,31],45:[2,31],50:[2,31],52:[2,31]},{25:[2,32],42:[2,32],43:[2,32],44:[2,32],45:[2,32],50:[2,32],52:[2,32]},{25:[2,33],42:[2,33],43:[2,33],44:[2,33],45:[2,33],50:[2,33],52:[2,33]},{25:[1,61]},{25:[1,62]},{18:[1,63]},{5:[2,17],12:[2,17],13:[2,17],16:[2,17],24:[2,17],26:[2,17],28:[2,17],29:[2,17],31:[2,17],32:[2,17],34:[2,17]},{18:[2,50],25:[2,50],30:51,33:[2,50],36:65,40:64,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],46:[2,50],47:66,48:58,49:60,50:[1,59],52:[1,25],53:24},{50:[1,67]},{18:[2,34],25:[2,34],33:[2,34],42:[2,34],43:[2,34],44:[2,34],45:[2,34],46:[2,34],50:[2,34],52:[2,34]},{5:[2,18],12:[2,18],13:[2,18],16:[2,18],24:[2,18],26:[2,18],28:[2,18],29:[2,18],31:[2,18],32:[2,18],34:[2,18]},{21:68,29:[1,69]},{29:[2,41]},{4:70,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{21:71,29:[1,69]},{29:[2,43]},{5:[2,9],12:[2,9],13:[2,9],16:[2,9],24:[2,9],26:[2,9],28:[2,9],29:[2,9],31:[2,9],32:[2,9],34:[2,9]},{25:[2,44],37:72,47:73,48:58,49:60,50:[1,74]},{25:[1,75]},{18:[2,23],25:[2,23],33:[2,23],42:[2,23],43:[2,23],44:[2,23],45:[2,23],46:[2,23],50:[2,23],52:[2,23]},{18:[2,24],25:[2,24],33:[2,24],42:[2,24],43:[2,24],44:[2,24],45:[2,24],46:[2,24],50:[2,24],52:[2,24]},{18:[2,25],25:[2,25],33:[2,25],42:[2,25],43:[2,25],44:[2,25],45:[2,25],46:[2,25],50:[2,25],52:[2,25]},{18:[2,26],25:[2,26],33:[2,26],42:[2,26],43:[2,26],44:[2,26],45:[2,26],46:[2,26],50:[2,26],52:[2,26]},{18:[2,27],25:[2,27],33:[2,27],42:[2,27],43:[2,27],44:[2,27],45:[2,27],46:[2,27],50:[2,27],52:[2,27]},{17:76,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[2,47]},{18:[2,29],25:[2,29],33:[2,29],46:[2,29],49:77,50:[1,74]},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],51:[1,78],52:[2,37],54:[2,37]},{18:[2,52],25:[2,52],33:[2,52],46:[2,52],50:[2,52]},{12:[2,13],13:[2,13],16:[2,13],24:[2,13],26:[2,13],28:[2,13],29:[2,13],31:[2,13],32:[2,13],34:[2,13]},{12:[2,14],13:[2,14],16:[2,14],24:[2,14],26:[2,14],28:[2,14],29:[2,14],31:[2,14],32:[2,14],34:[2,14]},{12:[2,10]},{18:[2,21],25:[2,21],33:[2,21],46:[2,21]},{18:[2,49],25:[2,49],33:[2,49],42:[2,49],43:[2,49],44:[2,49],45:[2,49],46:[2,49],50:[2,49],52:[2,49]},{18:[2,51],25:[2,51],33:[2,51],46:[2,51]},{18:[2,36],25:[2,36],33:[2,36],42:[2,36],43:[2,36],44:[2,36],45:[2,36],46:[2,36],50:[2,36],52:[2,36],54:[2,36]},{5:[2,11],12:[2,11],13:[2,11],16:[2,11],24:[2,11],26:[2,11],28:[2,11],29:[2,11],31:[2,11],32:[2,11],34:[2,11]},{30:79,50:[1,26],53:24},{29:[2,15]},{5:[2,12],12:[2,12],13:[2,12],16:[2,12],24:[2,12],26:[2,12],28:[2,12],29:[2,12],31:[2,12],32:[2,12],34:[2,12]},{25:[1,80]},{25:[2,45]},{51:[1,78]},{5:[2,20],12:[2,20],13:[2,20],16:[2,20],24:[2,20],26:[2,20],28:[2,20],29:[2,20],31:[2,20],32:[2,20],34:[2,20]},{46:[1,81]},{18:[2,53],25:[2,53],33:[2,53],46:[2,53],50:[2,53]},{30:51,36:82,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],50:[1,26],52:[1,25],53:24},{25:[1,83]},{5:[2,19],12:[2,19],13:[2,19],16:[2,19],24:[2,19],26:[2,19],28:[2,19],29:[2,19],31:[2,19],32:[2,19],34:[2,19]},{18:[2,28],25:[2,28],33:[2,28],42:[2,28],43:[2,28],44:[2,28],45:[2,28],46:[2,28],50:[2,28],52:[2,28]},{18:[2,30],25:[2,30],33:[2,30],46:[2,30],50:[2,30]},{5:[2,16],12:[2,16],13:[2,16],16:[2,16],24:[2,16],26:[2,16],28:[2,16],29:[2,16],31:[2,16],32:[2,16],34:[2,16]}],defaultActions:{4:[2,1],44:[2,41],47:[2,43],57:[2,47],63:[2,10],70:[2,15],73:[2,45]},parseError:function(a,b){throw new Error(a)},parse:function(a){function p(){var a;return a=b.lexer.lex()||1,"number"!=typeof a&&(a=b.symbols_[a]||a),a}var b=this,c=[0],d=[null],e=[],f=this.table,g="",h=0,i=0,j=0;this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var m=this.lexer.yylloc;e.push(m);var n=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var q,r,s,t,v,x,y,z,A,w={};;){if(s=c[c.length-1],this.defaultActions[s]?t=this.defaultActions[s]:((null===q||"undefined"==typeof q)&&(q=p()),t=f[s]&&f[s][q]),"undefined"==typeof t||!t.length||!t[0]){var B="";if(!j){A=[];for(x in f[s])this.terminals_[x]&&x>2&&A.push("'"+this.terminals_[x]+"'");B=this.lexer.showPosition?"Parse error on line "+(h+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[q]||q)+"'":"Parse error on line "+(h+1)+": Unexpected "+(1==q?"end of input":"'"+(this.terminals_[q]||q)+"'"),this.parseError(B,{text:this.lexer.match,token:this.terminals_[q]||q,line:this.lexer.yylineno,loc:m,expected:A})}}if(t[0]instanceof Array&&t.length>1)throw new Error("Parse Error: multiple actions possible at state: "+s+", token: "+q);switch(t[0]){case 1:c.push(q),d.push(this.lexer.yytext),e.push(this.lexer.yylloc),c.push(t[1]),q=null,r?(q=r,r=null):(i=this.lexer.yyleng,g=this.lexer.yytext,h=this.lexer.yylineno,m=this.lexer.yylloc,j>0&&j--);break;case 2:if(y=this.productions_[t[1]][1],w.$=d[d.length-y],w._$={first_line:e[e.length-(y||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(y||1)].first_column,last_column:e[e.length-1].last_column},n&&(w._$.range=[e[e.length-(y||1)].range[0],e[e.length-1].range[1]]),v=this.performAction.call(w,g,i,h,this.yy,t[1],d,e),"undefined"!=typeof v)return v;y&&(c=c.slice(0,-1*y*2),d=d.slice(0,-1*y),e=e.slice(0,-1*y)),c.push(this.productions_[t[1]][0]),d.push(w.$),e.push(w._$),z=f[c[c.length-2]][c[c.length-1]],c.push(z);break;case 3:return!0}}return!0}},b=function(){var a={EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var b=a.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this},more:function(){return this._more=!0,this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d,f;this._more||(this.yytext="",this.match="");for(var g=this._currentRules(),h=0;h<g.length&&(c=this._input.match(this.rules[g[h]]),!c||b&&!(c[0].length>b[0].length)||(b=c,d=h,this.options.flex));h++);return b?(f=b[0].match(/(?:\r\n?|\n).*/g),f&&(this.yylineno+=f.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:f?f[f.length-1].length-f[f.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],a=this.performAction.call(this,this.yy,this,g[d],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a?a:void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return"undefined"!=typeof a?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)}};return a.options={},a.performAction=function(a,b,c,d){function e(a,c){return b.yytext=b.yytext.substr(a,b.yyleng-c)}switch(c){case 0:if("\\\\"===b.yytext.slice(-2)?(e(0,1),this.begin("mu")):"\\"===b.yytext.slice(-1)?(e(0,1),this.begin("emu")):this.begin("mu"),b.yytext)return 12;break;case 1:return 12;case 2:return this.popState(),12;case 3:return b.yytext=b.yytext.substr(5,b.yyleng-9),this.popState(),15;case 4:return 12;case 5:return e(0,4),this.popState(),13;case 6:return 45;case 7:return 46;case 8:return 16;case 9:return this.popState(),this.begin("raw"),18;case 10:return 34;case 11:return 24;case 12:return 29;case 13:return this.popState(),28;case 14:return this.popState(),28;case 15:return 26;case 16:return 26;case 17:return 32;case 18:return 31;case 19:this.popState(),this.begin("com");break;case 20:return e(3,5),this.popState(),13;case 21:return 31;case 22:return 51;case 23:return 50;case 24:return 50;case 25:return 54;case 26:break;case 27:return this.popState(),33;case 28:return this.popState(),25;case 29:return b.yytext=e(1,2).replace(/\\"/g,'"'),42;case 30:return b.yytext=e(1,2).replace(/\\'/g,"'"),42;case 31:return 52;case 32:return 44;case 33:return 44;case 34:return 43;case 35:return 50;case 36:return b.yytext=e(1,2),50;case 37:return"INVALID";case 38:return 5}},a.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{\/)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/],a.conditions={mu:{rules:[6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[5],inclusive:!1},raw:{rules:[3,4],inclusive:!1},INITIAL:{rules:[0,1,38],inclusive:!0}},a}();return a.lexer=b,c.prototype=a,a.Parser=c,new c}();return a=b}(),i=function(a){"use strict";function d(a,b){return{left:"~"===a.charAt(2),right:"~"===b.charAt(b.length-3)}}function e(a,b,d,e,f,k){if(a.sexpr.id.original!==e.path.original)throw new c(a.sexpr.id.original+" doesn't match "+e.path.original,a);var l=d&&d.program,m={left:a.strip.left,right:e.strip.right,openStandalone:h(b.statements),closeStandalone:g((l||b).statements)};if(a.strip.right&&i(b.statements,null,!0),l){var n=d.strip;n.left&&j(b.statements,null,!0),n.right&&i(l.statements,null,!0),e.strip.left&&j(l.statements,null,!0),g(b.statements)&&h(l.statements)&&(j(b.statements),i(l.statements))}else e.strip.left&&j(b.statements,null,!0);return f?new this.BlockNode(a,l,b,m,k):new this.BlockNode(a,b,l,m,k)}function f(a,b){for(var c=0,d=a.length;d>c;c++){var e=a[c],f=e.strip;if(f){var k=g(a,c,b,"partial"===e.type),l=h(a,c,b),m=f.openStandalone&&k,n=f.closeStandalone&&l,o=f.inlineStandalone&&k&&l;f.right&&i(a,c,!0),f.left&&j(a,c,!0),o&&(i(a,c),j(a,c)&&"partial"===e.type&&(e.indent=/([ \t]+$)/.exec(a[c-1].original)?RegExp.$1:"")),m&&(i((e.program||e.inverse).statements),j(a,c)),n&&(i(a,c),j((e.inverse||e.program).statements))}}return a}function g(a,b,c){void 0===b&&(b=a.length);var d=a[b-1],e=a[b-2];return d?"content"===d.type?(e||!c?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(d.original):void 0:c}function h(a,b,c){void 0===b&&(b=-1);var d=a[b+1],e=a[b+2];return d?"content"===d.type?(e||!c?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(d.original):void 0:c}function i(a,b,c){var d=a[null==b?0:b+1];if(d&&"content"===d.type&&(c||!d.rightStripped)){var e=d.string;d.string=d.string.replace(c?/^\s+/:/^[ \t]*\r?\n?/,""),d.rightStripped=d.string!==e}}function j(a,b,c){var d=a[null==b?a.length-1:b-1];if(d&&"content"===d.type&&(c||!d.leftStripped)){var e=d.string;return d.string=d.string.replace(c?/\s+$/:/[ \t]+$/,""),d.leftStripped=d.string!==e,d.leftStripped}}var b={},c=a;return b.stripFlags=d,b.prepareBlock=e,b.prepareProgram=f,b}(c),j=function(a,b,c,d){"use strict";function k(a){return a.constructor===g.ProgramNode?a:(f.yy=j,f.parse(a))}var e={},f=a,g=b,h=c,i=d.extend;e.parser=f;var j={};return i(j,h,g),e.parse=k,e}(h,g,i,b),k=function(a,b){"use strict";function g(){}function h(a,b,c){if(null==a||"string"!=typeof a&&a.constructor!==c.AST.ProgramNode)throw new d("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+a);b=b||{},"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var e=c.parse(a),f=(new c.Compiler).compile(e,b);return(new c.JavaScriptCompiler).compile(f,b)}function i(a,b,c){function f(){var d=c.parse(a),e=(new c.Compiler).compile(d,b),f=(new c.JavaScriptCompiler).compile(e,b,void 0,!0);return c.template(f)}if(null==a||"string"!=typeof a&&a.constructor!==c.AST.ProgramNode)throw new d("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+a);b=b||{},"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var e,g=function(a,b){return e||(e=f()),e.call(this,a,b)};return g._setup=function(a){return e||(e=f()),e._setup(a)},g._child=function(a,b,c){return e||(e=f()),e._child(a,b,c)},g}function j(a,b){if(a===b)return!0;if(e(a)&&e(b)&&a.length===b.length){for(var c=0;c<a.length;c++)if(!j(a[c],b[c]))return!1;return!0}}var c={},d=a,e=b.isArray,f=[].slice;return c.Compiler=g,g.prototype={compiler:g,equals:function(a){var b=this.opcodes.length;if(a.opcodes.length!==b)return!1;for(var c=0;b>c;c++){var d=this.opcodes[c],e=a.opcodes[c];if(d.opcode!==e.opcode||!j(d.args,e.args))return!1}for(b=this.children.length,c=0;b>c;c++)if(!this.children[c].equals(a.children[c]))return!1;return!0},guid:0,compile:function(a,b){this.opcodes=[],this.children=[],this.depths={list:[]},this.options=b,this.stringParams=b.stringParams,this.trackIds=b.trackIds;var c=this.options.knownHelpers;if(this.options.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0,lookup:!0},c)for(var d in c)this.options.knownHelpers[d]=c[d];return this.accept(a)},accept:function(a){return this[a.type](a)},program:function(a){for(var b=a.statements,c=0,d=b.length;d>c;c++)this.accept(b[c]);return this.isSimple=1===d,this.depths.list=this.depths.list.sort(function(a,b){return a-b}), this},compileProgram:function(a){var d,b=(new this.compiler).compile(a,this.options),c=this.guid++;this.usePartial=this.usePartial||b.usePartial,this.children[c]=b;for(var e=0,f=b.depths.list.length;f>e;e++)d=b.depths.list[e],2>d||this.addDepth(d-1);return c},block:function(a){var b=a.mustache,c=a.program,d=a.inverse;c&&(c=this.compileProgram(c)),d&&(d=this.compileProgram(d));var e=b.sexpr,f=this.classifySexpr(e);"helper"===f?this.helperSexpr(e,c,d):"simple"===f?(this.simpleSexpr(e),this.opcode("pushProgram",c),this.opcode("pushProgram",d),this.opcode("emptyHash"),this.opcode("blockValue",e.id.original)):(this.ambiguousSexpr(e,c,d),this.opcode("pushProgram",c),this.opcode("pushProgram",d),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},hash:function(a){var c,d,b=a.pairs;for(this.opcode("pushHash"),c=0,d=b.length;d>c;c++)this.pushParam(b[c][1]);for(;c--;)this.opcode("assignToHash",b[c][0]);this.opcode("popHash")},partial:function(a){var b=a.partialName;this.usePartial=!0,a.hash?this.accept(a.hash):this.opcode("push","undefined"),a.context?this.accept(a.context):(this.opcode("getContext",0),this.opcode("pushContext")),this.opcode("invokePartial",b.name,a.indent||""),this.opcode("append")},content:function(a){a.string&&this.opcode("appendContent",a.string)},mustache:function(a){this.sexpr(a.sexpr),a.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},ambiguousSexpr:function(a,b,c){var d=a.id,e=d.parts[0],f=null!=b||null!=c;this.opcode("getContext",d.depth),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.ID(d),this.opcode("invokeAmbiguous",e,f)},simpleSexpr:function(a){var b=a.id;"DATA"===b.type?this.DATA(b):b.parts.length?this.ID(b):(this.addDepth(b.depth),this.opcode("getContext",b.depth),this.opcode("pushContext")),this.opcode("resolvePossibleLambda")},helperSexpr:function(a,b,c){var e=this.setupFullMustacheParams(a,b,c),f=a.id,g=f.parts[0];if(this.options.knownHelpers[g])this.opcode("invokeKnownHelper",e.length,g);else{if(this.options.knownHelpersOnly)throw new d("You specified knownHelpersOnly, but used the unknown helper "+g,a);f.falsy=!0,this.ID(f),this.opcode("invokeHelper",e.length,f.original,f.isSimple)}},sexpr:function(a){var b=this.classifySexpr(a);"simple"===b?this.simpleSexpr(a):"helper"===b?this.helperSexpr(a):this.ambiguousSexpr(a)},ID:function(a){this.addDepth(a.depth),this.opcode("getContext",a.depth);var b=a.parts[0];b?this.opcode("lookupOnContext",a.parts,a.falsy,a.isScoped):this.opcode("pushContext")},DATA:function(a){this.options.data=!0,this.opcode("lookupData",a.id.depth,a.id.parts)},STRING:function(a){this.opcode("pushString",a.string)},NUMBER:function(a){this.opcode("pushLiteral",a.number)},BOOLEAN:function(a){this.opcode("pushLiteral",a.bool)},comment:function(){},opcode:function(a){this.opcodes.push({opcode:a,args:f.call(arguments,1)})},addDepth:function(a){0!==a&&(this.depths[a]||(this.depths[a]=!0,this.depths.list.push(a)))},classifySexpr:function(a){var b=a.isHelper,c=a.eligibleHelper,d=this.options;if(c&&!b){var e=a.id.parts[0];d.knownHelpers[e]?b=!0:d.knownHelpersOnly&&(c=!1)}return b?"helper":c?"ambiguous":"simple"},pushParams:function(a){for(var b=0,c=a.length;c>b;b++)this.pushParam(a[b])},pushParam:function(a){this.stringParams?(a.depth&&this.addDepth(a.depth),this.opcode("getContext",a.depth||0),this.opcode("pushStringParam",a.stringModeValue,a.type),"sexpr"===a.type&&this.sexpr(a)):(this.trackIds&&this.opcode("pushId",a.type,a.idName||a.stringModeValue),this.accept(a))},setupFullMustacheParams:function(a,b,c){var d=a.params;return this.pushParams(d),this.opcode("pushProgram",b),this.opcode("pushProgram",c),a.hash?this.hash(a.hash):this.opcode("emptyHash"),d}},c.precompile=h,c.compile=i,c}(c,b),l=function(a,b){"use strict";function g(a){this.value=a}function h(){}var c,d=a.COMPILER_REVISION,e=a.REVISION_CHANGES,f=b;h.prototype={nameLookup:function(a,b){return h.isValidJavaScriptVariableName(b)?a+"."+b:a+"['"+b+"']"},depthedLookup:function(a){return this.aliases.lookup="this.lookup",'lookup(depths, "'+a+'")'},compilerInfo:function(){var a=d,b=e[a];return[a,b]},appendToBuffer:function(a){return this.environment.isSimple?"return "+a+";":{appendToBuffer:!0,content:a,toString:function(){return"buffer += "+a+";"}}},initializeBuffer:function(){return this.quotedString("")},namespace:"Handlebars",compile:function(a,b,c,d){this.environment=a,this.options=b,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!d,this.name=this.environment.name,this.isChild=!!c,this.context=c||{programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.compileChildren(a,b),this.useDepths=this.useDepths||a.depths.list.length||this.options.compat;var g,h,i,e=a.opcodes;for(h=0,i=e.length;i>h;h++)g=e[h],this[g.opcode].apply(this,g.args);if(this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new f("Compile completed with content left on stack");var j=this.createFunctionContext(d);if(this.isChild)return j;var k={compiler:this.compilerInfo(),main:j},l=this.context.programs;for(h=0,i=l.length;i>h;h++)l[h]&&(k[h]=l[h]);return this.environment.usePartial&&(k.usePartial=!0),this.options.data&&(k.useData=!0),this.useDepths&&(k.useDepths=!0),this.options.compat&&(k.compat=!0),d||(k.compiler=JSON.stringify(k.compiler),k=this.objectLiteral(k)),k},preamble:function(){this.lastContext=0,this.source=[]},createFunctionContext:function(a){var b="",c=this.stackVars.concat(this.registers.list);c.length>0&&(b+=", "+c.join(", "));for(var d in this.aliases)this.aliases.hasOwnProperty(d)&&(b+=", "+d+"="+this.aliases[d]);var e=["depth0","helpers","partials","data"];this.useDepths&&e.push("depths");var f=this.mergeSource(b);return a?(e.push(f),Function.apply(this,e)):"function("+e.join(",")+") {\n "+f+"}"},mergeSource:function(a){for(var c,e,b="",d=!this.forceBuffer,f=0,g=this.source.length;g>f;f++){var h=this.source[f];h.appendToBuffer?c=c?c+"\n + "+h.content:h.content:(c&&(b?b+="buffer += "+c+";\n ":(e=!0,b=c+";\n "),c=void 0),b+=h+"\n ",this.environment.isSimple||(d=!1))}return d?(c||!b)&&(b+="return "+(c||'""')+";\n"):(a+=", buffer = "+(e?"":this.initializeBuffer()),b+=c?"return buffer + "+c+";\n":"return buffer;\n"),a&&(b="var "+a.substring(2)+(e?"":";\n ")+b),b},blockValue:function(a){this.aliases.blockHelperMissing="helpers.blockHelperMissing";var b=[this.contextName(0)];this.setupParams(a,0,b);var c=this.popStack();b.splice(1,0,c),this.push("blockHelperMissing.call("+b.join(", ")+")")},ambiguousBlockValue:function(){this.aliases.blockHelperMissing="helpers.blockHelperMissing";var a=[this.contextName(0)];this.setupParams("",0,a,!0),this.flushInline();var b=this.topStack();a.splice(1,0,b),this.pushSource("if (!"+this.lastHelper+") { "+b+" = blockHelperMissing.call("+a.join(", ")+"); }")},appendContent:function(a){this.pendingContent&&(a=this.pendingContent+a),this.pendingContent=a},append:function(){this.flushInline();var a=this.popStack();this.pushSource("if ("+a+" != null) { "+this.appendToBuffer(a)+" }"),this.environment.isSimple&&this.pushSource("else { "+this.appendToBuffer("''")+" }")},appendEscaped:function(){this.aliases.escapeExpression="this.escapeExpression",this.pushSource(this.appendToBuffer("escapeExpression("+this.popStack()+")"))},getContext:function(a){this.lastContext=a},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(a,b,c){var d=0,e=a.length;for(c||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(a[d++]));e>d;d++)this.replaceStack(function(c){var e=this.nameLookup(c,a[d],"context");return b?" && "+e:" != null ? "+e+" : "+c})},lookupData:function(a,b){a?this.pushStackLiteral("this.data(data, "+a+")"):this.pushStackLiteral("data");for(var c=b.length,d=0;c>d;d++)this.replaceStack(function(a){return" && "+this.nameLookup(a,b[d],"data")})},resolvePossibleLambda:function(){this.aliases.lambda="this.lambda",this.push("lambda("+this.popStack()+", "+this.contextName(0)+")")},pushStringParam:function(a,b){this.pushContext(),this.pushString(b),"sexpr"!==b&&("string"==typeof a?this.pushString(a):this.pushStackLiteral(a))},emptyHash:function(){this.pushStackLiteral("{}"),this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}"))},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:[],types:[],contexts:[],ids:[]}},popHash:function(){var a=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push("{"+a.ids.join(",")+"}"),this.stringParams&&(this.push("{"+a.contexts.join(",")+"}"),this.push("{"+a.types.join(",")+"}")),this.push("{\n "+a.values.join(",\n ")+"\n }")},pushString:function(a){this.pushStackLiteral(this.quotedString(a))},push:function(a){return this.inlineStack.push(a),a},pushLiteral:function(a){this.pushStackLiteral(a)},pushProgram:function(a){null!=a?this.pushStackLiteral(this.programExpression(a)):this.pushStackLiteral(null)},invokeHelper:function(a,b,c){this.aliases.helperMissing="helpers.helperMissing";var d=this.popStack(),e=this.setupHelper(a,b),f=(c?e.name+" || ":"")+d+" || helperMissing";this.push("(("+f+").call("+e.callParams+"))")},invokeKnownHelper:function(a,b){var c=this.setupHelper(a,b);this.push(c.name+".call("+c.callParams+")")},invokeAmbiguous:function(a,b){this.aliases.functionType='"function"',this.aliases.helperMissing="helpers.helperMissing",this.useRegister("helper");var c=this.popStack();this.emptyHash();var d=this.setupHelper(0,a,b),e=this.lastHelper=this.nameLookup("helpers",a,"helper");this.push("((helper = (helper = "+e+" || "+c+") != null ? helper : helperMissing"+(d.paramsInit?"),("+d.paramsInit:"")+"),(typeof helper === functionType ? helper.call("+d.callParams+") : helper))")},invokePartial:function(a,b){var c=[this.nameLookup("partials",a,"partial"),"'"+b+"'","'"+a+"'",this.popStack(),this.popStack(),"helpers","partials"];this.options.data?c.push("data"):this.options.compat&&c.push("undefined"),this.options.compat&&c.push("depths"),this.push("this.invokePartial("+c.join(", ")+")")},assignToHash:function(a){var c,d,e,b=this.popStack();this.trackIds&&(e=this.popStack()),this.stringParams&&(d=this.popStack(),c=this.popStack());var f=this.hash;c&&f.contexts.push("'"+a+"': "+c),d&&f.types.push("'"+a+"': "+d),e&&f.ids.push("'"+a+"': "+e),f.values.push("'"+a+"': ("+b+")")},pushId:function(a,b){"ID"===a||"DATA"===a?this.pushString(b):"sexpr"===a?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:h,compileChildren:function(a,b){for(var d,e,c=a.children,f=0,g=c.length;g>f;f++){d=c[f],e=new this.compiler;var h=this.matchExistingProgram(d);null==h?(this.context.programs.push(""),h=this.context.programs.length,d.index=h,d.name="program"+h,this.context.programs[h]=e.compile(d,b,this.context,!this.precompile),this.context.environments[h]=d,this.useDepths=this.useDepths||e.useDepths):(d.index=h,d.name="program"+h)}},matchExistingProgram:function(a){for(var b=0,c=this.context.environments.length;c>b;b++){var d=this.context.environments[b];if(d&&d.equals(a))return b}},programExpression:function(a){var b=this.environment.children[a],d=(b.depths.list,this.useDepths),f=[b.index,"data"];return d&&f.push("depths"),"this.program("+f.join(", ")+")"},useRegister:function(a){this.registers[a]||(this.registers[a]=!0,this.registers.list.push(a))},pushStackLiteral:function(a){return this.push(new g(a))},pushSource:function(a){this.pendingContent&&(this.source.push(this.appendToBuffer(this.quotedString(this.pendingContent))),this.pendingContent=void 0),a&&this.source.push(a)},pushStack:function(a){this.flushInline();var b=this.incrStack();return this.pushSource(b+" = "+a+";"),this.compileStack.push(b),b},replaceStack:function(a){var d,e,h,b="";this.isInline();if(!this.isInline())throw new f("replaceStack on non-inline");var i=this.popStack(!0);if(i instanceof g)b=d=i.value,h=!0;else{e=!this.stackSlot;var j=e?this.incrStack():this.topStackName();b="("+this.push(j)+" = "+i+")",d=this.topStack()}var k=a.call(this,d);h||this.popStack(),e&&this.stackSlot--,this.push("("+b+k+")")},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var a=this.inlineStack;if(a.length){this.inlineStack=[];for(var b=0,c=a.length;c>b;b++){var d=a[b];d instanceof g?this.compileStack.push(d):this.pushStack(d)}}},isInline:function(){return this.inlineStack.length},popStack:function(a){var b=this.isInline(),c=(b?this.inlineStack:this.compileStack).pop();if(!a&&c instanceof g)return c.value;if(!b){if(!this.stackSlot)throw new f("Invalid stack pop");this.stackSlot--}return c},topStack:function(){var a=this.isInline()?this.inlineStack:this.compileStack,b=a[a.length-1];return b instanceof g?b.value:b},contextName:function(a){return this.useDepths&&a?"depths["+a+"]":"depth"+a},quotedString:function(a){return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(this.quotedString(c)+":"+a[c]);return"{"+b.join(",")+"}"},setupHelper:function(a,b,c){var d=[],e=this.setupParams(b,a,d,c),f=this.nameLookup("helpers",b,"helper");return{params:d,paramsInit:e,name:f,callParams:[this.contextName(0)].concat(d).join(", ")}},setupOptions:function(a,b,c){var h,i,j,d={},e=[],f=[],g=[];d.name=this.quotedString(a),d.hash=this.popStack(),this.trackIds&&(d.hashIds=this.popStack()),this.stringParams&&(d.hashTypes=this.popStack(),d.hashContexts=this.popStack()),i=this.popStack(),j=this.popStack(),(j||i)&&(j||(j="this.noop"),i||(i="this.noop"),d.fn=j,d.inverse=i);for(var k=b;k--;)h=this.popStack(),c[k]=h,this.trackIds&&(g[k]=this.popStack()),this.stringParams&&(f[k]=this.popStack(),e[k]=this.popStack());return this.trackIds&&(d.ids="["+g.join(",")+"]"),this.stringParams&&(d.types="["+f.join(",")+"]",d.contexts="["+e.join(",")+"]"),this.options.data&&(d.data="data"),d},setupParams:function(a,b,c,d){var e=this.objectLiteral(this.setupOptions(a,b,c));return d?(this.useRegister("options"),c.push("options"),"options="+e):(c.push(e),"")}};for(var i="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "),j=h.RESERVED_WORDS={},k=0,l=i.length;l>k;k++)j[i[k]]=!0;return h.isValidJavaScriptVariableName=function(a){return!h.RESERVED_WORDS[a]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(a)},c=h}(d,c),m=function(a,b,c,d,e){"use strict";var f,g=a,h=b,i=c.parser,j=c.parse,k=d.Compiler,l=d.compile,m=d.precompile,n=e,o=g.create,p=function(){var a=o();return a.compile=function(b,c){return l(b,c,a)},a.precompile=function(b,c){return m(b,c,a)},a.AST=h,a.Compiler=k,a.JavaScriptCompiler=n,a.Parser=i,a.parse=j,a};return g=p(),g.create=p,g["default"]=g,f=g}(f,g,j,k,l);return m});;!function(t){var e={isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:!1},isBlankString:function(t){return!t||/^\s*$/.test(t)},escapeRegExChars:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isArray:t.isArray,isFunction:t.isFunction,isObject:t.isPlainObject,isUndefined:function(t){return"undefined"==typeof t},bind:t.proxy,each:function(e,n){function i(t,e){return n(e,t)}t.each(e,i)},map:t.map,filter:t.grep,every:function(e,n){var i=!0;return e?(t.each(e,function(t,r){return(i=n.call(null,r,t,e))?void 0:!1}),!!i):i},some:function(e,n){var i=!1;return e?(t.each(e,function(t,r){return(i=n.call(null,r,t,e))?!1:void 0}),!!i):i},mixin:t.extend,getUniqueId:function(){var t=0;return function(){return t++}}(),templatify:function(e){function n(){return String(e)}return t.isFunction(e)?e:n},defer:function(t){setTimeout(t,0)},debounce:function(t,e,n){var i,r;return function(){var s,o,u=this,a=arguments;return s=function(){i=null,n||(r=t.apply(u,a))},o=n&&!i,clearTimeout(i),i=setTimeout(s,e),o&&(r=t.apply(u,a)),r}},throttle:function(t,e){var n,i,r,s,o,u;return o=0,u=function(){o=new Date,r=null,s=t.apply(n,i)},function(){var a=new Date,h=e-(a-o);return n=this,i=arguments,0>=h?(clearTimeout(r),r=null,o=a,s=t.apply(n,i)):r||(r=setTimeout(u,h)),s}},noop:function(){}},n="0.10.2",i=function(){function t(t){return t.split(/\s+/)}function e(t){return t.split(/\W+/)}function n(t){return function(e){return function(n){return t(n[e])}}}return{nonword:e,whitespace:t,obj:{nonword:n(e),whitespace:n(t)}}}(),r=function(){function t(t){this.maxSize=t||100,this.size=0,this.hash={},this.list=new n}function n(){this.head=this.tail=null}function i(t,e){this.key=t,this.val=e,this.prev=this.next=null}return e.mixin(t.prototype,{set:function(t,e){var n,r=this.list.tail;this.size>=this.maxSize&&(this.list.remove(r),delete this.hash[r.key]),(n=this.hash[t])?(n.val=e,this.list.moveToFront(n)):(n=new i(t,e),this.list.add(n),this.hash[t]=n,this.size++)},get:function(t){var e=this.hash[t];return e?(this.list.moveToFront(e),e.val):void 0}}),e.mixin(n.prototype,{add:function(t){this.head&&(t.next=this.head,this.head.prev=t),this.head=t,this.tail=this.tail||t},remove:function(t){t.prev?t.prev.next=t.next:this.head=t.next,t.next?t.next.prev=t.prev:this.tail=t.prev},moveToFront:function(t){this.remove(t),this.add(t)}}),t}(),s=function(){function t(t){this.prefix=["__",t,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+this.prefix)}function n(){return(new Date).getTime()}function i(t){return JSON.stringify(e.isUndefined(t)?null:t)}function r(t){return JSON.parse(t)}var s,o;try{s=window.localStorage,s.setItem("~~~","!"),s.removeItem("~~~")}catch(u){s=null}return o=s&&window.JSON?{_prefix:function(t){return this.prefix+t},_ttlKey:function(t){return this._prefix(t)+this.ttlKey},get:function(t){return this.isExpired(t)&&this.remove(t),r(s.getItem(this._prefix(t)))},set:function(t,r,o){return e.isNumber(o)?s.setItem(this._ttlKey(t),i(n()+o)):s.removeItem(this._ttlKey(t)),s.setItem(this._prefix(t),i(r))},remove:function(t){return s.removeItem(this._ttlKey(t)),s.removeItem(this._prefix(t)),this},clear:function(){var t,e,n=[],i=s.length;for(t=0;i>t;t++)(e=s.key(t)).match(this.keyMatcher)&&n.push(e.replace(this.keyMatcher,""));for(t=n.length;t--;)this.remove(n[t]);return this},isExpired:function(t){var i=r(s.getItem(this._ttlKey(t)));return e.isNumber(i)&&n()>i?!0:!1}}:{get:e.noop,set:e.noop,remove:e.noop,clear:e.noop,isExpired:e.noop},e.mixin(t.prototype,o),t}(),o=function(){function n(e){e=e||{},this._send=e.transport?i(e.transport):t.ajax,this._get=e.rateLimiter?e.rateLimiter(this._get):this._get}function i(n){return function(i,r){function s(t){e.defer(function(){u.resolve(t)})}function o(t){e.defer(function(){u.reject(t)})}var u=t.Deferred();return n(i,r,s,o),u}}var s=0,o={},u=6,a=new r(10);return n.setMaxPendingRequests=function(t){u=t},n.resetCache=function(){a=new r(10)},e.mixin(n.prototype,{_get:function(t,e,n){function i(e){n&&n(null,e),a.set(t,e)}function r(){n&&n(!0)}function h(){s--,delete o[t],l.onDeckRequestArgs&&(l._get.apply(l,l.onDeckRequestArgs),l.onDeckRequestArgs=null)}var c,l=this;(c=o[t])?c.done(i).fail(r):u>s?(s++,o[t]=this._send(t,e).done(i).fail(r).always(h)):this.onDeckRequestArgs=[].slice.call(arguments,0)},get:function(t,n,i){var r;return e.isFunction(n)&&(i=n,n={}),(r=a.get(t))?e.defer(function(){i&&i(null,r)}):this._get(t,n,i),!!r}}),n}(),u=function(){function n(e){e=e||{},e.datumTokenizer&&e.queryTokenizer||t.error("datumTokenizer and queryTokenizer are both required"),this.datumTokenizer=e.datumTokenizer,this.queryTokenizer=e.queryTokenizer,this.reset()}function i(t){return t=e.filter(t,function(t){return!!t}),t=e.map(t,function(t){return t.toLowerCase()})}function r(){return{ids:[],children:{}}}function s(t){for(var e={},n=[],i=0;i<t.length;i++)e[t[i]]||(e[t[i]]=!0,n.push(t[i]));return n}function o(t,e){function n(t,e){return t-e}var i=0,r=0,s=[];for(t=t.sort(n),e=e.sort(n);i<t.length&&r<e.length;)t[i]<e[r]?i++:t[i]>e[r]?r++:(s.push(t[i]),i++,r++);return s}return e.mixin(n.prototype,{bootstrap:function(t){this.datums=t.datums,this.trie=t.trie},add:function(t){var n=this;t=e.isArray(t)?t:[t],e.each(t,function(t){var s,o;s=n.datums.push(t)-1,o=i(n.datumTokenizer(t)),e.each(o,function(t){var e,i,o;for(e=n.trie,i=t.split("");o=i.shift();)e=e.children[o]||(e.children[o]=r()),e.ids.push(s)})})},get:function(t){var n,r,u=this;return n=i(this.queryTokenizer(t)),e.each(n,function(t){var e,n,i,s;if(r&&0===r.length)return!1;for(e=u.trie,n=t.split("");e&&(i=n.shift());)e=e.children[i];return e&&0===n.length?(s=e.ids.slice(0),void(r=r?o(r,s):s)):(r=[],!1)}),r?e.map(s(r),function(t){return u.datums[t]}):[]},reset:function(){this.datums=[],this.trie=r()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),n}(),a=function(){function i(t){return t.local||null}function r(i){var r,s;return s={url:null,thumbprint:"",ttl:864e5,filter:null,ajax:{}},(r=i.prefetch||null)&&(r=e.isString(r)?{url:r}:r,r=e.mixin(s,r),r.thumbprint=n+r.thumbprint,r.ajax.type=r.ajax.type||"GET",r.ajax.dataType=r.ajax.dataType||"json",!r.url&&t.error("prefetch requires url to be set")),r}function s(n){function i(t){return function(n){return e.debounce(n,t)}}function r(t){return function(n){return e.throttle(n,t)}}var s,o;return o={url:null,wildcard:"%QUERY",replace:null,rateLimitBy:"debounce",rateLimitWait:300,send:null,filter:null,ajax:{}},(s=n.remote||null)&&(s=e.isString(s)?{url:s}:s,s=e.mixin(o,s),s.rateLimiter=/^throttle$/i.test(s.rateLimitBy)?r(s.rateLimitWait):i(s.rateLimitWait),s.ajax.type=s.ajax.type||"GET",s.ajax.dataType=s.ajax.dataType||"json",delete s.rateLimitBy,delete s.rateLimitWait,!s.url&&t.error("remote requires url to be set")),s}return{local:i,prefetch:r,remote:s}}();!function(n){function r(e){e&&(e.local||e.prefetch||e.remote)||t.error("one of local, prefetch, or remote is required"),this.limit=e.limit||5,this.sorter=h(e.sorter),this.dupDetector=e.dupDetector||c,this.local=a.local(e),this.prefetch=a.prefetch(e),this.remote=a.remote(e),this.cacheKey=this.prefetch?this.prefetch.cacheKey||this.prefetch.url:null,this.index=new u({datumTokenizer:e.datumTokenizer,queryTokenizer:e.queryTokenizer}),this.storage=this.cacheKey?new s(this.cacheKey):null}function h(t){function n(e){return e.sort(t)}function i(t){return t}return e.isFunction(t)?n:i}function c(){return!1}var l,d;return l=n.Bloodhound,d={data:"data",protocol:"protocol",thumbprint:"thumbprint"},n.Bloodhound=r,r.noConflict=function(){return n.Bloodhound=l,r},r.tokenizers=i,e.mixin(r.prototype,{_loadPrefetch:function(e){function n(t){s.clear(),s.add(e.filter?e.filter(t):t),s._saveToStorage(s.index.serialize(),e.thumbprint,e.ttl)}var i,r,s=this;return(i=this._readFromStorage(e.thumbprint))?(this.index.bootstrap(i),r=t.Deferred().resolve()):r=t.ajax(e.url,e.ajax).done(n),r},_getFromRemote:function(t,e){function n(t,n){e(t?[]:s.remote.filter?s.remote.filter(n):n)}var i,r,s=this;return t=t||"",r=encodeURIComponent(t),i=this.remote.replace?this.remote.replace(this.remote.url,t):this.remote.url.replace(this.remote.wildcard,r),this.transport.get(i,this.remote.ajax,n)},_saveToStorage:function(t,e,n){this.storage&&(this.storage.set(d.data,t,n),this.storage.set(d.protocol,location.protocol,n),this.storage.set(d.thumbprint,e,n))},_readFromStorage:function(t){var e,n={};return this.storage&&(n.data=this.storage.get(d.data),n.protocol=this.storage.get(d.protocol),n.thumbprint=this.storage.get(d.thumbprint)),e=n.thumbprint!==t||n.protocol!==location.protocol,n.data&&!e?n.data:null},_initialize:function(){function n(){r.add(e.isFunction(s)?s():s)}var i,r=this,s=this.local;return i=this.prefetch?this._loadPrefetch(this.prefetch):t.Deferred().resolve(),s&&i.done(n),this.transport=this.remote?new o(this.remote):null,this.initPromise=i.promise()},initialize:function(t){return!this.initPromise||t?this._initialize():this.initPromise},add:function(t){this.index.add(t)},get:function(t,n){function i(t){var i=s.slice(0);e.each(t,function(t){var n;return n=e.some(i,function(e){return r.dupDetector(t,e)}),!n&&i.push(t),i.length<r.limit}),n&&n(r.sorter(i))}var r=this,s=[],o=!1;s=this.index.get(t),s=this.sorter(s).slice(0,this.limit),s.length<this.limit&&this.transport&&(o=this._getFromRemote(t,i)),o||(s.length>0||!this.transport)&&n&&n(s)},clear:function(){this.index.reset()},clearPrefetchCache:function(){this.storage&&this.storage.clear()},clearRemoteCache:function(){this.transport&&o.resetCache()},ttAdapter:function(){return e.bind(this.get,this)}}),r}(this);var h={wrapper:'<span class="twitter-typeahead"></span>',dropdown:'<span class="tt-dropdown-menu"></span>',dataset:'<div class="tt-dataset-%CLASS%"></div>',suggestions:'<span class="tt-suggestions"></span>',suggestion:'<div class="tt-suggestion"></div>'},c={wrapper:{position:"relative",display:"block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},dropdown:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},suggestions:{display:"block"},suggestion:{whiteSpace:"nowrap",cursor:"pointer"},suggestionChild:{whiteSpace:"normal"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};e.isMsie()&&e.mixin(c.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),e.isMsie()&&e.isMsie()<=7&&e.mixin(c.input,{marginTop:"-1px"});var l=function(){function n(e){e&&e.el||t.error("EventBus initialized without el"),this.$el=t(e.el)}var i="typeahead:";return e.mixin(n.prototype,{trigger:function(t){var e=[].slice.call(arguments,1);this.$el.trigger(i+t,e)}}),n}(),d=function(){function t(t,e,n,i){var r;if(!n)return this;for(e=e.split(a),n=i?u(n,i):n,this._callbacks=this._callbacks||{};r=e.shift();)this._callbacks[r]=this._callbacks[r]||{sync:[],async:[]},this._callbacks[r][t].push(n);return this}function e(e,n,i){return t.call(this,"async",e,n,i)}function n(e,n,i){return t.call(this,"sync",e,n,i)}function i(t){var e;if(!this._callbacks)return this;for(t=t.split(a);e=t.shift();)delete this._callbacks[e];return this}function r(t){var e,n,i,r,o;if(!this._callbacks)return this;for(t=t.split(a),i=[].slice.call(arguments,1);(e=t.shift())&&(n=this._callbacks[e]);)r=s(n.sync,this,[e].concat(i)),o=s(n.async,this,[e].concat(i)),r()&&h(o);return this}function s(t,e,n){function i(){for(var i,r=0;!i&&r<t.length;r+=1)i=t[r].apply(e,n)===!1;return!i}return i}function o(){var t;return t=window.setImmediate?function(t){setImmediate(function(){t()})}:function(t){setTimeout(function(){t()},0)}}function u(t,e){return t.bind?t.bind(e):function(){t.apply(e,[].slice.call(arguments,0))}}var a=/\s+/,h=o();return{onSync:n,onAsync:e,off:i,trigger:r}}(),p=function(t){function n(t,n,i){for(var r,s=[],o=0;o<t.length;o++)s.push(e.escapeRegExChars(t[o]));return r=i?"\\b("+s.join("|")+")\\b":"("+s.join("|")+")",n?new RegExp(r):new RegExp(r,"i")}var i={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function(r){function s(e){var n,i;return(n=u.exec(e.data))&&(wrapperNode=t.createElement(r.tagName),r.className&&(wrapperNode.className=r.className),i=e.splitText(n.index),i.splitText(n[0].length),wrapperNode.appendChild(i.cloneNode(!0)),e.parentNode.replaceChild(wrapperNode,i)),!!n}function o(t,e){for(var n,i=3,r=0;r<t.childNodes.length;r++)n=t.childNodes[r],n.nodeType===i?r+=e(n)?1:0:o(n,e)}var u;r=e.mixin({},i,r),r.node&&r.pattern&&(r.pattern=e.isArray(r.pattern)?r.pattern:[r.pattern],u=n(r.pattern,r.caseSensitive,r.wordsOnly),o(r.node,s))}}(window.document),f=function(){function n(n){var r,s,u,a,h=this;n=n||{},n.input||t.error("input is missing"),r=e.bind(this._onBlur,this),s=e.bind(this._onFocus,this),u=e.bind(this._onKeydown,this),a=e.bind(this._onInput,this),this.$hint=t(n.hint),this.$input=t(n.input).on("blur.tt",r).on("focus.tt",s).on("keydown.tt",u),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=e.noop),e.isMsie()?this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(t){o[t.which||t.keyCode]||e.defer(e.bind(h._onInput,h,t))}):this.$input.on("input.tt",a),this.query=this.$input.val(),this.$overflowHelper=i(this.$input)}function i(e){return t('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:e.css("font-family"),fontSize:e.css("font-size"),fontStyle:e.css("font-style"),fontVariant:e.css("font-variant"),fontWeight:e.css("font-weight"),wordSpacing:e.css("word-spacing"),letterSpacing:e.css("letter-spacing"),textIndent:e.css("text-indent"),textRendering:e.css("text-rendering"),textTransform:e.css("text-transform")}).insertAfter(e)}function r(t,e){return n.normalizeQuery(t)===n.normalizeQuery(e)}function s(t){return t.altKey||t.ctrlKey||t.metaKey||t.shiftKey}var o;return o={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},n.normalizeQuery=function(t){return(t||"").replace(/^\s*/g,"").replace(/\s{2,}/g," ")},e.mixin(n.prototype,d,{_onBlur:function(){this.resetInputValue(),this.trigger("blurred")},_onFocus:function(){this.trigger("focused")},_onKeydown:function(t){var e=o[t.which||t.keyCode];this._managePreventDefault(e,t),e&&this._shouldTrigger(e,t)&&this.trigger(e+"Keyed",t)},_onInput:function(){this._checkInputValue()},_managePreventDefault:function(t,e){var n,i,r;switch(t){case"tab":i=this.getHint(),r=this.getInputValue(),n=i&&i!==r&&!s(e);break;case"up":case"down":n=!s(e);break;default:n=!1}n&&e.preventDefault()},_shouldTrigger:function(t,e){var n;switch(t){case"tab":n=!s(e);break;default:n=!0}return n},_checkInputValue:function(){var t,e,n;t=this.getInputValue(),e=r(t,this.query),n=e?this.query.length!==t.length:!1,e?n&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query=t)},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getQuery:function(){return this.query},setQuery:function(t){this.query=t},getInputValue:function(){return this.$input.val()},setInputValue:function(t,e){this.$input.val(t),e?this.clearHint():this._checkInputValue()},resetInputValue:function(){this.setInputValue(this.query,!0)},getHint:function(){return this.$hint.val()},setHint:function(t){this.$hint.val(t)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var t,e,n,i;t=this.getInputValue(),e=this.getHint(),n=t!==e&&0===e.indexOf(t),i=""!==t&&n&&!this.hasOverflow(),!i&&this.clearHint()},getLanguageDirection:function(){return(this.$input.css("direction")||"ltr").toLowerCase()},hasOverflow:function(){var t=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=t},isCursorAtEnd:function(){var t,n,i;return t=this.$input.val().length,n=this.$input[0].selectionStart,e.isNumber(n)?n===t:document.selection?(i=document.selection.createRange(),i.moveStart("character",-t),t===i.text.length):!0},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$hint=this.$input=this.$overflowHelper=null}}),n}(),g=function(){function n(n){n=n||{},n.templates=n.templates||{},n.source||t.error("missing source"),n.name&&!s(n.name)&&t.error("invalid dataset name: "+n.name),this.query=null,this.highlight=!!n.highlight,this.name=n.name||e.getUniqueId(),this.source=n.source,this.displayFn=i(n.display||n.displayKey),this.templates=r(n.templates,this.displayFn),this.$el=t(h.dataset.replace("%CLASS%",this.name))}function i(t){function n(e){return e[t]}return t=t||"value",e.isFunction(t)?t:n}function r(t,n){function i(t){return"<p>"+n(t)+"</p>"}return{empty:t.empty&&e.templatify(t.empty),header:t.header&&e.templatify(t.header),footer:t.footer&&e.templatify(t.footer),suggestion:t.suggestion||i}}function s(t){return/^[_a-zA-Z0-9-]+$/.test(t)}var o="ttDataset",u="ttValue",a="ttDatum";return n.extractDatasetName=function(e){return t(e).data(o)},n.extractValue=function(e){return t(e).data(u)},n.extractDatum=function(e){return t(e).data(a)},e.mixin(n.prototype,d,{_render:function(n,i){function r(){return g.templates.empty({query:n,isEmpty:!0})}function s(){function r(e){var n;return n=t(h.suggestion).append(g.templates.suggestion(e)).data(o,g.name).data(u,g.displayFn(e)).data(a,e),n.children().each(function(){t(this).css(c.suggestionChild)}),n}var s,l;return s=t(h.suggestions).css(c.suggestions),l=e.map(i,r),s.append.apply(s,l),g.highlight&&p({node:s[0],pattern:n}),s}function l(){return g.templates.header({query:n,isEmpty:!f})}function d(){return g.templates.footer({query:n,isEmpty:!f})}if(this.$el){var f,g=this;this.$el.empty(),f=i&&i.length,!f&&this.templates.empty?this.$el.html(r()).prepend(g.templates.header?l():null).append(g.templates.footer?d():null):f&&this.$el.html(s()).prepend(g.templates.header?l():null).append(g.templates.footer?d():null),this.trigger("rendered")}},getRoot:function(){return this.$el},update:function(t){function e(e){n.canceled||t!==n.query||n._render(t,e)}var n=this;this.query=t,this.canceled=!1,this.source(t,e)},cancel:function(){this.canceled=!0},clear:function(){this.cancel(),this.$el.empty(),this.trigger("rendered")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=null}}),n}(),m=function(){function n(n){var r,s,o,u=this;n=n||{},n.menu||t.error("menu is required"),this.isOpen=!1,this.isEmpty=!0,this.datasets=e.map(n.datasets,i),r=e.bind(this._onSuggestionClick,this),s=e.bind(this._onSuggestionMouseEnter,this),o=e.bind(this._onSuggestionMouseLeave,this),this.$menu=t(n.menu).on("click.tt",".tt-suggestion",r).on("mouseenter.tt",".tt-suggestion",s).on("mouseleave.tt",".tt-suggestion",o),e.each(this.datasets,function(t){u.$menu.append(t.getRoot()),t.onSync("rendered",u._onRendered,u)})}function i(t){return new g(t)}return e.mixin(n.prototype,d,{_onSuggestionClick:function(e){this.trigger("suggestionClicked",t(e.currentTarget))},_onSuggestionMouseEnter:function(e){this._removeCursor(),this._setCursor(t(e.currentTarget),!0)},_onSuggestionMouseLeave:function(){this._removeCursor()},_onRendered:function(){function t(t){return t.isEmpty()}this.isEmpty=e.every(this.datasets,t),this.isEmpty?this._hide():this.isOpen&&this._show(),this.trigger("datasetRendered")},_hide:function(){this.$menu.hide()},_show:function(){this.$menu.css("display","block")},_getSuggestions:function(){return this.$menu.find(".tt-suggestion")},_getCursor:function(){return this.$menu.find(".tt-cursor").first()},_setCursor:function(t,e){t.first().addClass("tt-cursor"),!e&&this.trigger("cursorMoved")},_removeCursor:function(){this._getCursor().removeClass("tt-cursor")},_moveCursor:function(t){var e,n,i,r;if(this.isOpen){if(n=this._getCursor(),e=this._getSuggestions(),this._removeCursor(),i=e.index(n)+t,i=(i+1)%(e.length+1)-1,-1===i)return void this.trigger("cursorRemoved");-1>i&&(i=e.length-1),this._setCursor(r=e.eq(i)),this._ensureVisible(r)}},_ensureVisible:function(t){var e,n,i,r;e=t.position().top,n=e+t.outerHeight(!0),i=this.$menu.scrollTop(),r=this.$menu.height()+parseInt(this.$menu.css("paddingTop"),10)+parseInt(this.$menu.css("paddingBottom"),10),0>e?this.$menu.scrollTop(i+e):n>r&&this.$menu.scrollTop(i+(n-r))},close:function(){this.isOpen&&(this.isOpen=!1,this._removeCursor(),this._hide(),this.trigger("closed"))},open:function(){this.isOpen||(this.isOpen=!0,!this.isEmpty&&this._show(),this.trigger("opened"))},setLanguageDirection:function(t){this.$menu.css("ltr"===t?c.ltr:c.rtl)},moveCursorUp:function(){this._moveCursor(-1)},moveCursorDown:function(){this._moveCursor(1)},getDatumForSuggestion:function(t){var e=null;return t.length&&(e={raw:g.extractDatum(t),value:g.extractValue(t),datasetName:g.extractDatasetName(t)}),e},getDatumForCursor:function(){return this.getDatumForSuggestion(this._getCursor().first())},getDatumForTopSuggestion:function(){return this.getDatumForSuggestion(this._getSuggestions().first())},update:function(t){function n(e){e.update(t)}e.each(this.datasets,n)},empty:function(){function t(t){t.clear()}e.each(this.datasets,t),this.isEmpty=!0},isVisible:function(){return this.isOpen&&!this.isEmpty},destroy:function(){function t(t){t.destroy()}this.$menu.off(".tt"),this.$menu=null,e.each(this.datasets,t)}}),n}(),y=function(){function n(n){var r,s,o;n=n||{},n.input||t.error("missing input"),this.isActivated=!1,this.autoselect=!!n.autoselect,this.minLength=e.isNumber(n.minLength)?n.minLength:1,this.$node=i(n.input,n.withHint),r=this.$node.find(".tt-dropdown-menu"),s=this.$node.find(".tt-input"),o=this.$node.find(".tt-hint"),s.on("blur.tt",function(t){var n,i,o;n=document.activeElement,i=r.is(n),o=r.has(n).length>0,e.isMsie()&&(i||o)&&(t.preventDefault(),t.stopImmediatePropagation(),e.defer(function(){s.focus()}))}),r.on("mousedown.tt",function(t){t.preventDefault()}),this.eventBus=n.eventBus||new l({el:s}),this.dropdown=new m({menu:r,datasets:n.datasets}).onSync("suggestionClicked",this._onSuggestionClicked,this).onSync("cursorMoved",this._onCursorMoved,this).onSync("cursorRemoved",this._onCursorRemoved,this).onSync("opened",this._onOpened,this).onSync("closed",this._onClosed,this).onAsync("datasetRendered",this._onDatasetRendered,this),this.input=new f({input:s,hint:o}).onSync("focused",this._onFocused,this).onSync("blurred",this._onBlurred,this).onSync("enterKeyed",this._onEnterKeyed,this).onSync("tabKeyed",this._onTabKeyed,this).onSync("escKeyed",this._onEscKeyed,this).onSync("upKeyed",this._onUpKeyed,this).onSync("downKeyed",this._onDownKeyed,this).onSync("leftKeyed",this._onLeftKeyed,this).onSync("rightKeyed",this._onRightKeyed,this).onSync("queryChanged",this._onQueryChanged,this).onSync("whitespaceChanged",this._onWhitespaceChanged,this),this._setLanguageDirection()}function i(e,n){var i,s,u,a;i=t(e),s=t(h.wrapper).css(c.wrapper),u=t(h.dropdown).css(c.dropdown),a=i.clone().css(c.hint).css(r(i)),a.val("").removeData().addClass("tt-hint").removeAttr("id name placeholder").prop("disabled",!0).attr({autocomplete:"off",spellcheck:"false"}),i.data(o,{dir:i.attr("dir"),autocomplete:i.attr("autocomplete"),spellcheck:i.attr("spellcheck"),style:i.attr("style")}),i.addClass("tt-input").attr({autocomplete:"off",spellcheck:!1}).css(n?c.input:c.inputWithNoHint);try{!i.attr("dir")&&i.attr("dir","auto")}catch(l){}return i.wrap(s).parent().prepend(n?a:null).append(u)}function r(t){return{backgroundAttachment:t.css("background-attachment"),backgroundClip:t.css("background-clip"),backgroundColor:t.css("background-color"),backgroundImage:t.css("background-image"),backgroundOrigin:t.css("background-origin"),backgroundPosition:t.css("background-position"),backgroundRepeat:t.css("background-repeat"),backgroundSize:t.css("background-size")}}function s(t){var n=t.find(".tt-input");e.each(n.data(o),function(t,i){e.isUndefined(t)?n.removeAttr(i):n.attr(i,t)}),n.detach().removeData(o).removeClass("tt-input").insertAfter(t),t.remove()}var o="ttAttrs";return e.mixin(n.prototype,{_onSuggestionClicked:function(t,e){var n;(n=this.dropdown.getDatumForSuggestion(e))&&this._select(n)},_onCursorMoved:function(){var t=this.dropdown.getDatumForCursor();this.input.setInputValue(t.value,!0),this.eventBus.trigger("cursorchanged",t.raw,t.datasetName)},_onCursorRemoved:function(){this.input.resetInputValue(),this._updateHint()},_onDatasetRendered:function(){this._updateHint()},_onOpened:function(){this._updateHint(),this.eventBus.trigger("opened")},_onClosed:function(){this.input.clearHint(),this.eventBus.trigger("closed")},_onFocused:function(){this.isActivated=!0,this.dropdown.open()},_onBlurred:function(){this.isActivated=!1,this.dropdown.empty(),this.dropdown.close()},_onEnterKeyed:function(t,e){var n,i;n=this.dropdown.getDatumForCursor(),i=this.dropdown.getDatumForTopSuggestion(),n?(this._select(n),e.preventDefault()):this.autoselect&&i&&(this._select(i),e.preventDefault())},_onTabKeyed:function(t,e){var n;(n=this.dropdown.getDatumForCursor())?(this._select(n),e.preventDefault()):this._autocomplete(!0)},_onEscKeyed:function(){this.dropdown.close(),this.input.resetInputValue()},_onUpKeyed:function(){var t=this.input.getQuery();this.dropdown.isEmpty&&t.length>=this.minLength?this.dropdown.update(t):this.dropdown.moveCursorUp(),this.dropdown.open()},_onDownKeyed:function(){var t=this.input.getQuery();this.dropdown.isEmpty&&t.length>=this.minLength?this.dropdown.update(t):this.dropdown.moveCursorDown(),this.dropdown.open()},_onLeftKeyed:function(){"rtl"===this.dir&&this._autocomplete()},_onRightKeyed:function(){"ltr"===this.dir&&this._autocomplete()},_onQueryChanged:function(t,e){this.input.clearHintIfInvalid(),e.length>=this.minLength?this.dropdown.update(e):this.dropdown.empty(),this.dropdown.open(),this._setLanguageDirection()},_onWhitespaceChanged:function(){this._updateHint(),this.dropdown.open()},_setLanguageDirection:function(){var t;this.dir!==(t=this.input.getLanguageDirection())&&(this.dir=t,this.$node.css("direction",t),this.dropdown.setLanguageDirection(t))},_updateHint:function(){var t,n,i,r,s,o;t=this.dropdown.getDatumForTopSuggestion(),t&&this.dropdown.isVisible()&&!this.input.hasOverflow()?(n=this.input.getInputValue(),i=f.normalizeQuery(n),r=e.escapeRegExChars(i),s=new RegExp("^(?:"+r+")(.+$)","i"),o=s.exec(t.value),o?this.input.setHint(n+o[1]):this.input.clearHint()):this.input.clearHint()},_autocomplete:function(t){var e,n,i,r;e=this.input.getHint(),n=this.input.getQuery(),i=t||this.input.isCursorAtEnd(),e&&n!==e&&i&&(r=this.dropdown.getDatumForTopSuggestion(),r&&this.input.setInputValue(r.value),this.eventBus.trigger("autocompleted",r.raw,r.datasetName))},_select:function(t){this.input.setQuery(t.value),this.input.setInputValue(t.value,!0),this._setLanguageDirection(),this.eventBus.trigger("selected",t.raw,t.datasetName),this.dropdown.close(),e.defer(e.bind(this.dropdown.empty,this.dropdown))},open:function(){this.dropdown.open()},close:function(){this.dropdown.close()},setVal:function(t){this.isActivated?this.input.setInputValue(t):(this.input.setQuery(t),this.input.setInputValue(t,!0)),this._setLanguageDirection()},getVal:function(){return this.input.getQuery()},destroy:function(){this.input.destroy(),this.dropdown.destroy(),s(this.$node),this.$node=null}}),n}();!function(){var n,i,r;n=t.fn.typeahead,i="ttTypeahead",r={initialize:function(n,r){function s(){var s,o,u=t(this);e.each(r,function(t){t.highlight=!!n.highlight}),o=new y({input:u,eventBus:s=new l({el:u}),withHint:e.isUndefined(n.hint)?!0:!!n.hint,minLength:n.minLength,autoselect:n.autoselect,datasets:r}),u.data(i,o)}return r=e.isArray(r)?r:[].slice.call(arguments,1),n=n||{},this.each(s)},open:function(){function e(){var e,n=t(this);(e=n.data(i))&&e.open()}return this.each(e)},close:function(){function e(){var e,n=t(this);(e=n.data(i))&&e.close()}return this.each(e)},val:function(e){function n(){var n,r=t(this);(n=r.data(i))&&n.setVal(e)}function r(t){var e,n;return(e=t.data(i))&&(n=e.getVal()),n}return arguments.length?this.each(n):r(this.first())},destroy:function(){function e(){var e,n=t(this);(e=n.data(i))&&(e.destroy(),n.removeData(i))}return this.each(e)}},t.fn.typeahead=function(t){return r[t]?r[t].apply(this,[].slice.call(arguments,1)):r.initialize.apply(this,arguments)},t.fn.typeahead.noConflict=function(){return t.fn.typeahead=n,this}}()}(window.jQuery);;jQuery(function($) { var last_select_clicked=false; $('body').append('<div class="option-wrapper st-option-wrapper"></div>'); var t_temp; $('.st-location-name').each(function(index, el) { var form = $(this).parents('form'); var parent = $(this).parents('.st-select-wrapper'); var t = $(this); var flag = true; $('.option-wrapper',parent).remove(); t.on('keyup', function(event) { t_temp = t; last_select_clicked=t; if (event.which != 40 && event.which != 38 && event.which != 9) { val = $(this).val(); if (event.which != 13) { flag = false; if( val != '' ){ html = ''; $('select option', parent).prop('selected', false); $('select option', parent).each(function(index, el) { var country = $(this).data('country'); var text = $(this).text(); var text_split = text.split("||"); text_split = text_split[0]; var highlight = get_highlight(text, val); if (highlight.indexOf('</span>') > 0) { var current_country = $(this).parent('select').attr('data-current-country'); if (typeof current_country != 'undefined' && current_country != '') { if (country == current_country) { html += '<div style="'+ $(this).data('style') +'" data-text="' + text + '" data-country="' + country + '" data-value="' + $(this).val() + '" class="option">' + '<span class="label"><a href="#">' + text_split + '<i class="fa fa-map-marker"></i></a>' + '</div>'; } } else { html += '<div style="'+ $(this).data('style') +'" data-text="' + text + '" data-country="' + country + '" data-value="' + $(this).val() + '" class="option">' + '<span class="label"><a href="#">' + text_split + '<i class="fa fa-map-marker"></i></a>' + '</div>'; } } }); $('.option-wrapper').html(html).show(); t.caculatePosition($('.option-wrapper'),t); }else{ html = ''; $('select option', parent).prop('selected', false); $('select option', parent).each(function(index, el) { var country = $(this).data('country'); var text = $(this).text(); var text_split = text.split("||"); text_split = text_split[0]; if (text != '') { var current_country = $(this).parent('select').attr('data-current-country'); if (typeof current_country != 'undefined' && current_country != '') { if (country == current_country) { html += '<div style="'+ $(this).data('style') +'" data-text="' + text + '" data-country="' + country + '" data-value="' + $(this).val() + '" class="option">' + '<span class="label"><a href="#">' + text_split + '<i class="fa fa-map-marker"></i></a>' + '</div>'; } } else { html += '<div style="'+ $(this).data('style') +'" data-text="' + text + '" data-country="' + country + '" data-value="' + $(this).val() + '" class="option">' + '<span class="label"><a href="#">' + text_split + '<i class="fa fa-map-marker"></i></a>' + '</div>'; } } }); $('.option-wrapper').html(html).show(); t.caculatePosition($('.option-wrapper', parent),t); } } if (event.which == 13){ //$('.option-wrapper .option').trigger('click'); //console.log('Event2'); //return false; /*html = ''; $('select option', parent).prop('selected', false); $('select option', parent).each(function(index, el) { var country = $(this).data('country'); var text = $(this).text(); var text_split = text.split("||"); text_split = text_split[0]; if (text != '') { var current_country = $(this).parent('select').attr('data-current-country'); if (typeof current_country != 'undefined' && current_country != '') { if (country == current_country) { html += '<div data-text="' + text + '" data-country="' + country + '" data-value="' + $(this).val() + '" class="option">' + '<span class="label"><a href="#">' + text_split + '<i class="fa fa-map-marker"></i></a>' + '</div>'; } } else { html += '<div data-text="' + text + '" data-country="' + country + '" data-value="' + $(this).val() + '" class="option">' + '<span class="label"><a href="#">' + text_split + '<i class="fa fa-map-marker"></i></a>' + '</div>'; } } }); $('.option-wrapper').html(html).show(); t.caculatePosition($('.option-wrapper'),t);*/ } if (event.which == 13 && val != ""){ } if (typeof t.data('children') != 'undefined' && t.data('children') != "") { name = t.data('children'); $('select[name="' + name + '"]', form).attr('data-current-country', ''); $('input[name="drop-off"]', form).val(''); $('select[name="' + name + '"] option', form).prop('selected', false); } } }); var liSelected; t.on('keydown', function(event) { last_select_clicked=t; if (event.which == 13) { /*var text = t.val(); var val = $('div.option-wrapper .option.active').data('value'); var country = $('div.option-wrapper .option.active').data('country'); if( typeof text != 'undefined' && typeof val != 'undefined' ){ t.val(text); $('select option[value="' + val + '"]').prop('selected', true); $('.option-wrapper').html('').hide(); if (typeof t.data('children') != 'undefined' && t.data('children') != "") { name = t.data('children'); $('select[name="' + name + '"]', form).attr('data-current-country', country); } }*/ var form = last_select_clicked.closest('form'); $('.option-wrapper').html('').hide(); t.focusNextInputField(); return false; } if (event.which == 9) { var form = last_select_clicked.closest('form'); $('.option-wrapper').html('').hide(); t.focusNextInputField(); return false; } if (event.which == 40 || event.which == 38 || event.which == 9) { if(event.which === 40){ var index = $('.option-wrapper .option.active').index(); if(liSelected){ liSelected.removeClass('active'); next = liSelected.next(); if(next.length > 0){ liSelected = next.addClass('active'); }else{ if($('.option-wrapper .option.active').length > 0){ $('.st-option-wrapper .option').eq(index).removeClass('active'); if(($('.option-wrapper .option').length - 1) == index){ liSelected = $('.st-option-wrapper .option').eq(0).addClass('active'); }else{ liSelected = $('.st-option-wrapper .option').eq(index + 1).addClass('active'); } }else{ liSelected = $('.st-option-wrapper .option').eq(0).addClass('active'); } } }else{ liSelected = $('.st-option-wrapper .option').eq(0).addClass('active'); } }else if(event.which === 38){ var index = $('.option-wrapper .option.active').index(); if(liSelected){ liSelected.removeClass('active'); next = liSelected.prev(); if(next.length > 0){ liSelected = next.addClass('active'); }else{ if($('.option-wrapper .option.active').length > 0) { $('.st-option-wrapper .option').eq(index).removeClass('active'); liSelected = $('.st-option-wrapper .option').eq(index-1).addClass('active'); }else{ liSelected = $('.st-option-wrapper .option').last().addClass('active'); } } }else{ liSelected = $('.st-option-wrapper .option').last().addClass('active'); } } $('.option-wrapper').scrollTo($('.option-wrapper .option.active'), 400); event.preventDefault(); flag = true; var value = $('.option-wrapper .option.active').data('value'); var text = $('.option-wrapper .option.active').text(); var country = $('.option-wrapper .option.active').data('country'); t.val(text); $('select option[value="' + value + '"]', parent).prop('selected', true); if (typeof t.data('children') != 'undefined' && t.data('children') != "") { name = t.data('children'); $('select[name="' + name + '"]', form).attr('data-current-country', country); } } }); t.on('blur', function(event) { if (t.data('clear') == 'clear' && $('select option:selected', parent).val() == "") { t.val(''); } }); t.on("focus",function(event) { if(t.data('id') != 'location_origin' && t.data('id') != 'location_destination'){ last_select_clicked=t; } //last_select_clicked=t; //if (t.val() == '') { html = ''; $('select option', parent).prop('selected', false); $('select option', parent).each(function(index, el) { var country = $(this).data('country'); var text = $(this).text(); var text_split = text.split("||"); text_split = text_split[0]; var activeOption = ''; if (text != '') { var current_country = $(this).parent('select').attr('data-current-country'); if (typeof current_country != 'undefined' && current_country != '') { if (country == current_country) { html += '<div style="'+ $(this).data('style') +'" data-text="' + text + '" data-country="' + country + '" data-value="' + $(this).val() + '" class="option '+ activeOption +'">' + '<span class="label"><a href="#">' + text_split + '<i class="fa fa-map-marker"></i></a>' + '</div>'; } } else { html += '<div style="'+ $(this).data('style') +'" data-text="' + text + '" data-country="' + country + '" data-value="' + $(this).val() + '" class="option '+ activeOption +'">' + '<span class="label"><a href="#">' + text_split + '<i class="fa fa-map-marker"></i></a>' + '</div>'; } } }); if (typeof t.data('parent') != 'undefined' && t.data('parent') != "") { name = t.data('parent'); if ($('select[name="' + name + '"]', form).length) { var val = $('select[name="' + name + '"]', form).parent().find('input.st-location-name').val(); if (typeof val == 'undefined' || val == '') { t.val(''); $('select[name="' + name + '"]', form).parent().find('input.st-location-name').trigger('focus'); }else{ $('.option-wrapper').html(html).show(); } } }else{ $('.option-wrapper').html(html).show(); } //} t.caculatePosition(); }); $(document).on('click', '.option-wrapper .option', function(event) { if(last_select_clicked.length > 0) { var form = last_select_clicked.closest('form'); var parent = last_select_clicked.closest('.st-select-wrapper'); setTimeout(function () { if (typeof form.find('input[name="start"]').attr('value') != 'undefined') { var $tmp = form.find('input[name="start"]').attr('value'); if ($tmp.length <= 0) { form.find('input[name="start"]').datepicker('show'); } } }, 100); event.preventDefault(); flag = true; var value = $(this).data('value'); var text = $(this).text(); var country = $(this).data('country'); if (text != "") { last_select_clicked.val(text); $('select option[value="' + value + '"]', parent).prop('selected', true); $('.option-wrapper').html('').hide(); if (typeof t.data('children') != 'undefined' && t.data('children') != "") { var name = t.data('children'); $('select[name="' + name + '"]', form).attr('data-current-country', country); } } } last_select_clicked.focusNextInputField(); }); $(document).on('click', function(event) { if (!$(event.target).is('.st-location-name')) { $('.option-wrapper').html('').hide(); } }); t.caculatePosition=function(){ if(!last_select_clicked || !last_select_clicked.length) return; var wraper= $('.option-wrapper'); var input_tag= last_select_clicked; var offset=parent.offset(); var top=offset.top+parent.height(); var left=offset.left; var width=input_tag.outerWidth(); var wpadminbar = 0; if( $('#wpadminbar').length && $(window).width() >= 783 ){ wpadminbar = $('#wpadminbar').height(); }else{ wpadminbar = 0 } if($('body').hasClass('boxed')){ left = left - $('body').offset().left; } top = top - wpadminbar; var z_index = 99999; var position = 'absolute'; if( $('#search-dialog').length ){ position = 'fixed'; top = top + wpadminbar - $(window).scrollTop(); z_index = 99999; } wraper.css({ position:position, top:top, left:left, width:width, 'z-index': z_index }); }; $( window ).on('resize', function() { t.caculatePosition(); }); form.on('submit', function(event) { if (t.val() == "" && t.hasClass('required')) { t.trigger('focus'); return false; } else { if ($('input.required-field').length && $('input.required-field').prop('checked') == true) { var val = $('select[name="location_id_pick_up"] option:selected', form).val(); var text = $('input[name="pick-up"]', form).val(); $('select[name="location_id_drop_off"] option[value="' + val + '"]', form).prop('selected', true); $('input[name="drop-off"]', form).val(text); } if ($('input.required-field').length && $('input.required-field').prop('checked') == false && $('input[name="drop-off"]', form).val() == "") { $('input[name="drop-off"]', form).trigger('focus'); $('select[name="location_id_drop_off"] option', form).prop('selected', false); return false; } } }); }); function get_highlight(text, val) { var highlight = text.replace( new RegExp(val + '(?!([^<]+)?>)', 'gi'), '<span class="highlight">$&</span>' ); return highlight; } $.fn.focusNextInputField = function() { return this.each(function() { var fields = $(this).parents('form:eq(0),body').find('button:visible,input:visible,textarea:visible,select:visible'); var index = fields.index( this ); if ( index > -1 && ( index + 1 ) < fields.length ) { // fields.eq( index + 1 ).trigger('focus'); } return false; }); }; }); ;!function(t,i,s,o,e){"use strict";var h=0,r=function(){var i,s=o.userAgent,e=/msie\s\d+/i;return s.search(e)>0&&(i=e.exec(s).toString(),i=i.split(" ")[1],9>i)?(t("html").addClass("lt-ie9"),!0):!1}();Function.prototype.bind||(Function.prototype.bind=function(t){var i=this,s=[].slice;if("function"!=typeof i)throw new TypeError;var o=s.call(arguments,1),e=function(){if(this instanceof e){var h=function(){};h.prototype=i.prototype;var r=new h,a=i.apply(r,o.concat(s.call(arguments)));return Object(a)===a?a:r}return i.apply(t,o.concat(s.call(arguments)))};return e}),Array.prototype.indexOf||(Array.prototype.indexOf=function(t,i){var s;if(null==this)throw new TypeError('"this" is null or not defined');var o=Object(this),e=o.length>>>0;if(0===e)return-1;var h=+i||0;if(Math.abs(h)===1/0&&(h=0),h>=e)return-1;for(s=Math.max(h>=0?h:e-Math.abs(h),0);e>s;){if(s in o&&o[s]===t)return s;s++}return-1});var a='<span class="irs"><span class="irs-line" tabindex="-1"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min">0</span><span class="irs-max">1</span><span class="irs-from">0</span><span class="irs-to">0</span><span class="irs-single">0</span></span><span class="irs-grid"></span><span class="irs-bar"></span>',n='<span class="irs-bar-edge"></span><span class="irs-shadow shadow-single"></span><span class="irs-slider single"></span>',c='<span class="irs-shadow shadow-from"></span><span class="irs-shadow shadow-to"></span><span class="irs-slider from"></span><span class="irs-slider to"></span>',l='<span class="irs-disable-mask"></span>',p=function(o,e,h){this.VERSION="2.0.13",this.input=o,this.plugin_count=h,this.current_plugin=0,this.calc_count=0,this.update_tm=0,this.old_from=0,this.old_to=0,this.raf_id=null,this.dragging=!1,this.force_redraw=!1,this.is_key=!1,this.is_update=!1,this.is_start=!0,this.is_finish=!1,this.is_active=!1,this.is_resize=!1,this.is_click=!1,this.$cache={win:t(s),body:t(i.body),input:t(o),cont:null,rs:null,min:null,max:null,from:null,to:null,single:null,bar:null,line:null,s_single:null,s_from:null,s_to:null,shad_single:null,shad_from:null,shad_to:null,edge:null,grid:null,grid_labels:[]};var r=this.$cache.input,a={type:r.data("type"),min:r.data("min"),max:r.data("max"),from:r.data("from"),to:r.data("to"),step:r.data("step"),min_interval:r.data("minInterval"),max_interval:r.data("maxInterval"),drag_interval:r.data("dragInterval"),values:r.data("values"),from_fixed:r.data("fromFixed"),from_min:r.data("fromMin"),from_max:r.data("fromMax"),from_shadow:r.data("fromShadow"),to_fixed:r.data("toFixed"),to_min:r.data("toMin"),to_max:r.data("toMax"),to_shadow:r.data("toShadow"),prettify_enabled:r.data("prettifyEnabled"),prettify_separator:r.data("prettifySeparator"),force_edges:r.data("forceEdges"),keyboard:r.data("keyboard"),keyboard_step:r.data("keyboardStep"),grid:r.data("grid"),grid_margin:r.data("gridMargin"),grid_num:r.data("gridNum"),grid_snap:r.data("gridSnap"),hide_min_max:r.data("hideMinMax"),hide_from_to:r.data("hideFromTo"),prefix:r.data("prefix"),postfix:r.data("postfix"),max_postfix:r.data("maxPostfix"),decorate_both:r.data("decorateBoth"),values_separator:r.data("valuesSeparator"),disable:r.data("disable")};a.values=a.values&&a.values.split(",");var n=r.prop("value");n&&(n=n.split(";"),n[0]&&n[0]==+n[0]&&(n[0]=+n[0]),n[1]&&n[1]==+n[1]&&(n[1]=+n[1]),e&&e.values&&e.values.length?(a.from=n[0]&&e.values.indexOf(n[0]),a.to=n[1]&&e.values.indexOf(n[1])):(a.from=n[0]&&+n[0],a.to=n[1]&&+n[1])),e=t.extend(a,e),this.options=t.extend({type:"single",min:10,max:100,from:null,to:null,step:1,min_interval:0,max_interval:0,drag_interval:!1,values:[],p_values:[],from_fixed:!1,from_min:null,from_max:null,from_shadow:!1,to_fixed:!1,to_min:null,to_max:null,to_shadow:!1,prettify_enabled:!0,prettify_separator:" ",prettify:null,force_edges:!1,keyboard:!1,keyboard_step:5,grid:!1,grid_margin:!0,grid_num:4,grid_snap:!1,hide_min_max:!1,hide_from_to:!1,prefix:"",postfix:"",max_postfix:"",decorate_both:!0,values_separator:" — ",disable:!1,onStart:null,onChange:null,onFinish:null,onUpdate:null},e),this.validate(),this.result={input:this.$cache.input,slider:null,min:this.options.min,max:this.options.max,from:this.options.from,from_percent:0,from_value:null,to:this.options.to,to_percent:0,to_value:null},this.coords={x_gap:0,x_pointer:0,w_rs:0,w_rs_old:0,w_handle:0,p_gap:0,p_gap_left:0,p_gap_right:0,p_step:0,p_pointer:0,p_handle:0,p_single:0,p_single_real:0,p_from:0,p_from_real:0,p_to:0,p_to_real:0,p_bar_x:0,p_bar_w:0,grid_gap:0,big_num:0,big:[],big_w:[],big_p:[],big_x:[]},this.labels={w_min:0,w_max:0,w_from:0,w_to:0,w_single:0,p_min:0,p_max:0,p_from:0,p_from_left:0,p_to:0,p_to_left:0,p_single:0,p_single_left:0},this.init()};p.prototype={init:function(t){this.coords.p_step=this.options.step/((this.options.max-this.options.min)/100),this.target="base",this.toggleInput(),this.append(),this.setMinMax(),t?(this.force_redraw=!0,this.calc(!0),this.callOnUpdate()):(this.force_redraw=!0,this.calc(!0),this.callOnStart()),this.updateScene()},append:function(){var t='<span class="irs js-irs-'+this.plugin_count+'"></span>';this.$cache.input.before(t),this.$cache.input.prop("readonly",!0),this.$cache.cont=this.$cache.input.prev(),this.result.slider=this.$cache.cont,this.$cache.cont.html(a),this.$cache.rs=this.$cache.cont.find(".irs"),this.$cache.min=this.$cache.cont.find(".irs-min"),this.$cache.max=this.$cache.cont.find(".irs-max"),this.$cache.from=this.$cache.cont.find(".irs-from"),this.$cache.to=this.$cache.cont.find(".irs-to"),this.$cache.single=this.$cache.cont.find(".irs-single"),this.$cache.bar=this.$cache.cont.find(".irs-bar"),this.$cache.line=this.$cache.cont.find(".irs-line"),this.$cache.grid=this.$cache.cont.find(".irs-grid"),"single"===this.options.type?(this.$cache.cont.append(n),this.$cache.edge=this.$cache.cont.find(".irs-bar-edge"),this.$cache.s_single=this.$cache.cont.find(".single"),this.$cache.from[0].style.visibility="hidden",this.$cache.to[0].style.visibility="hidden",this.$cache.shad_single=this.$cache.cont.find(".shadow-single")):(this.$cache.cont.append(c),this.$cache.s_from=this.$cache.cont.find(".from"),this.$cache.s_to=this.$cache.cont.find(".to"),this.$cache.shad_from=this.$cache.cont.find(".shadow-from"),this.$cache.shad_to=this.$cache.cont.find(".shadow-to"),this.setTopHandler()),this.options.hide_from_to&&(this.$cache.from[0].style.display="none",this.$cache.to[0].style.display="none",this.$cache.single[0].style.display="none"),this.appendGrid(),this.options.disable?(this.appendDisableMask(),this.$cache.input[0].disabled=!0):(this.$cache.cont.removeClass("irs-disabled"),this.$cache.input[0].disabled=!1,this.bindEvents())},setTopHandler:function(){var t=this.options.min,i=this.options.max,s=this.options.from,o=this.options.to;s>t&&o===i?this.$cache.s_from.addClass("type_last"):i>o&&this.$cache.s_to.addClass("type_last")},appendDisableMask:function(){this.$cache.cont.append(l),this.$cache.cont.addClass("irs-disabled")},remove:function(){this.$cache.cont.remove(),this.$cache.cont=null,this.$cache.line.off("keydown.irs_"+this.plugin_count),this.$cache.body.off("touchmove.irs_"+this.plugin_count),this.$cache.body.off("mousemove.irs_"+this.plugin_count),this.$cache.win.off("touchend.irs_"+this.plugin_count),this.$cache.win.off("mouseup.irs_"+this.plugin_count),r&&(this.$cache.body.off("mouseup.irs_"+this.plugin_count),this.$cache.body.off("mouseleave.irs_"+this.plugin_count)),this.$cache.grid_labels=[],this.coords.big=[],this.coords.big_w=[],this.coords.big_p=[],this.coords.big_x=[],cancelAnimationFrame(this.raf_id)},bindEvents:function(){this.$cache.body.on("touchmove.irs_"+this.plugin_count,this.pointerMove.bind(this)),this.$cache.body.on("mousemove.irs_"+this.plugin_count,this.pointerMove.bind(this)),this.$cache.win.on("touchend.irs_"+this.plugin_count,this.pointerUp.bind(this)),this.$cache.win.on("mouseup.irs_"+this.plugin_count,this.pointerUp.bind(this)),this.$cache.line.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.line.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.options.drag_interval&&"double"===this.options.type?(this.$cache.bar.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"both")),this.$cache.bar.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"both"))):(this.$cache.bar.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.bar.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"))),"single"===this.options.type?(this.$cache.single.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.s_single.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.shad_single.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.single.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.s_single.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.edge.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.shad_single.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"))):(this.$cache.single.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.single.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.from.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.s_from.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.to.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.s_to.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.shad_from.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.shad_to.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.from.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.s_from.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.to.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.s_to.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.shad_from.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.shad_to.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"))),this.options.keyboard&&this.$cache.line.on("keydown.irs_"+this.plugin_count,this.key.bind(this,"keyboard")),r&&(this.$cache.body.on("mouseup.irs_"+this.plugin_count,this.pointerUp.bind(this)),this.$cache.body.on("mouseleave.irs_"+this.plugin_count,this.pointerUp.bind(this)))},pointerMove:function(t){if(this.dragging){var i=t.pageX||t.originalEvent.touches&&t.originalEvent.touches[0].pageX;this.coords.x_pointer=i-this.coords.x_gap,this.calc()}},pointerUp:function(i){this.current_plugin===this.plugin_count&&this.is_active&&(this.is_active=!1,(t.contains(this.$cache.cont[0],i.target)||this.dragging)&&(this.is_finish=!0,this.callOnFinish()),this.$cache.cont.find(".state_hover").removeClass("state_hover"),this.force_redraw=!0,this.dragging=!1,r&&t("*").prop("unselectable",!1),this.updateScene())},changeLevel:function(t){switch(t){case"single":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_single);break;case"from":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_from),this.$cache.s_from.addClass("state_hover"),this.$cache.s_from.addClass("type_last"),this.$cache.s_to.removeClass("type_last");break;case"to":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_to),this.$cache.s_to.addClass("state_hover"),this.$cache.s_to.addClass("type_last"),this.$cache.s_from.removeClass("type_last");break;case"both":this.coords.p_gap_left=this.toFixed(this.coords.p_pointer-this.coords.p_from),this.coords.p_gap_right=this.toFixed(this.coords.p_to-this.coords.p_pointer),this.$cache.s_to.removeClass("type_last"),this.$cache.s_from.removeClass("type_last")}},pointerDown:function(i,s){s.preventDefault();var o=s.pageX||s.originalEvent.touches&&s.originalEvent.touches[0].pageX;2!==s.button&&(this.current_plugin=this.plugin_count,this.target=i,this.is_active=!0,this.dragging=!0,this.coords.x_gap=this.$cache.rs.offset().left,this.coords.x_pointer=o-this.coords.x_gap,this.calcPointer(),this.changeLevel(i),r&&t("*").prop("unselectable",!0),this.$cache.line.trigger("focus"),this.updateScene())},pointerClick:function(t,i){i.preventDefault();var s=i.pageX||i.originalEvent.touches&&i.originalEvent.touches[0].pageX;2!==i.button&&(this.current_plugin=this.plugin_count,this.target=t,this.is_click=!0,this.coords.x_gap=this.$cache.rs.offset().left,this.coords.x_pointer=+(s-this.coords.x_gap).toFixed(),this.force_redraw=!0,this.calc(),this.$cache.line.trigger("focus"))},key:function(t,i){if(!(this.current_plugin!==this.plugin_count||i.altKey||i.ctrlKey||i.shiftKey||i.metaKey)){switch(i.which){case 83:case 65:case 40:case 37:i.preventDefault(),this.moveByKey(!1);break;case 87:case 68:case 38:case 39:i.preventDefault(),this.moveByKey(!0)}return!0}},moveByKey:function(t){var i=this.coords.p_pointer;t?i+=this.options.keyboard_step:i-=this.options.keyboard_step,this.coords.x_pointer=this.toFixed(this.coords.w_rs/100*i),this.is_key=!0,this.calc()},setMinMax:function(){if(this.options){if(this.options.hide_min_max)return this.$cache.min[0].style.display="none",void(this.$cache.max[0].style.display="none");this.options.values.length?(this.$cache.min.html(this.decorate(this.options.p_values[this.options.min])),this.$cache.max.html(this.decorate(this.options.p_values[this.options.max]))):(this.$cache.min.html(this.decorate(this._prettify(this.options.min),this.options.min)),this.$cache.max.html(this.decorate(this._prettify(this.options.max),this.options.max))),this.labels.w_min=this.$cache.min.outerWidth(!1),this.labels.w_max=this.$cache.max.outerWidth(!1)}},calc:function(t){if(this.options&&(this.calc_count++,(10===this.calc_count||t)&&(this.calc_count=0,this.coords.w_rs=this.$cache.rs.outerWidth(!1),"single"===this.options.type?this.coords.w_handle=this.$cache.s_single.outerWidth(!1):this.coords.w_handle=this.$cache.s_from.outerWidth(!1)),this.coords.w_rs)){this.calcPointer(),this.coords.p_handle=this.toFixed(this.coords.w_handle/this.coords.w_rs*100);var i=100-this.coords.p_handle,s=this.toFixed(this.coords.p_pointer-this.coords.p_gap);switch("click"===this.target&&(this.coords.p_gap=this.coords.p_handle/2,s=this.toFixed(this.coords.p_pointer-this.coords.p_gap),this.target=this.chooseHandle(s)),0>s?s=0:s>i&&(s=i),this.target){case"base":var o=(this.options.max-this.options.min)/100,e=(this.result.from-this.options.min)/o,h=(this.result.to-this.options.min)/o;this.coords.p_single_real=this.toFixed(e),this.coords.p_from_real=this.toFixed(e),this.coords.p_to_real=this.toFixed(h),this.coords.p_single_real=this.checkDiapason(this.coords.p_single_real,this.options.from_min,this.options.from_max),this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max),this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max),this.coords.p_single=this.toFixed(e-this.coords.p_handle/100*e),this.coords.p_from=this.toFixed(e-this.coords.p_handle/100*e),this.coords.p_to=this.toFixed(h-this.coords.p_handle/100*h),this.target=null;break;case"single":if(this.options.from_fixed)break;this.coords.p_single_real=this.calcWithStep(s/i*100),this.coords.p_single_real=this.checkDiapason(this.coords.p_single_real,this.options.from_min,this.options.from_max),this.coords.p_single=this.toFixed(this.coords.p_single_real/100*i);break;case"from":if(this.options.from_fixed)break;this.coords.p_from_real=this.calcWithStep(s/i*100),this.coords.p_from_real>this.coords.p_to_real&&(this.coords.p_from_real=this.coords.p_to_real),this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max),this.coords.p_from_real=this.checkMinInterval(this.coords.p_from_real,this.coords.p_to_real,"from"),this.coords.p_from_real=this.checkMaxInterval(this.coords.p_from_real,this.coords.p_to_real,"from"),this.coords.p_from=this.toFixed(this.coords.p_from_real/100*i);break;case"to":if(this.options.to_fixed)break;this.coords.p_to_real=this.calcWithStep(s/i*100),this.coords.p_to_real<this.coords.p_from_real&&(this.coords.p_to_real=this.coords.p_from_real),this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max),this.coords.p_to_real=this.checkMinInterval(this.coords.p_to_real,this.coords.p_from_real,"to"),this.coords.p_to_real=this.checkMaxInterval(this.coords.p_to_real,this.coords.p_from_real,"to"),this.coords.p_to=this.toFixed(this.coords.p_to_real/100*i);break;case"both":if(this.options.from_fixed||this.options.to_fixed)break;s=this.toFixed(s+.1*this.coords.p_handle),this.coords.p_from_real=this.calcWithStep((s-this.coords.p_gap_left)/i*100),this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max),this.coords.p_from_real=this.checkMinInterval(this.coords.p_from_real,this.coords.p_to_real,"from"),this.coords.p_from=this.toFixed(this.coords.p_from_real/100*i),this.coords.p_to_real=this.calcWithStep((s+this.coords.p_gap_right)/i*100),this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max),this.coords.p_to_real=this.checkMinInterval(this.coords.p_to_real,this.coords.p_from_real,"to"),this.coords.p_to=this.toFixed(this.coords.p_to_real/100*i)}"single"===this.options.type?(this.coords.p_bar_x=this.coords.p_handle/2,this.coords.p_bar_w=this.coords.p_single,this.result.from_percent=this.coords.p_single_real,this.result.from=this.calcReal(this.coords.p_single_real),this.options.values.length&&(this.result.from_value=this.options.values[this.result.from])):(this.coords.p_bar_x=this.toFixed(this.coords.p_from+this.coords.p_handle/2),this.coords.p_bar_w=this.toFixed(this.coords.p_to-this.coords.p_from),this.result.from_percent=this.coords.p_from_real,this.result.from=this.calcReal(this.coords.p_from_real),this.result.to_percent=this.coords.p_to_real,this.result.to=this.calcReal(this.coords.p_to_real),this.options.values.length&&(this.result.from_value=this.options.values[this.result.from],this.result.to_value=this.options.values[this.result.to])),this.calcMinMax(),this.calcLabels()}},calcPointer:function(){return this.coords.w_rs?(this.coords.x_pointer<0||isNaN(this.coords.x_pointer)?this.coords.x_pointer=0:this.coords.x_pointer>this.coords.w_rs&&(this.coords.x_pointer=this.coords.w_rs),void(this.coords.p_pointer=this.toFixed(this.coords.x_pointer/this.coords.w_rs*100))):void(this.coords.p_pointer=0)},chooseHandle:function(t){if("single"===this.options.type)return"single";var i=this.coords.p_from_real+(this.coords.p_to_real-this.coords.p_from_real)/2;return t>=i?this.options.to_fixed?"from":"to":this.options.from_fixed?"to":"from"},calcMinMax:function(){this.coords.w_rs&&(this.labels.p_min=this.labels.w_min/this.coords.w_rs*100,this.labels.p_max=this.labels.w_max/this.coords.w_rs*100)},calcLabels:function(){this.coords.w_rs&&!this.options.hide_from_to&&("single"===this.options.type?(this.labels.w_single=this.$cache.single.outerWidth(!1),this.labels.p_single=this.labels.w_single/this.coords.w_rs*100,this.labels.p_single_left=this.coords.p_single+this.coords.p_handle/2-this.labels.p_single/2,this.labels.p_single_left=this.checkEdges(this.labels.p_single_left,this.labels.p_single)):(this.labels.w_from=this.$cache.from.outerWidth(!1),this.labels.p_from=this.labels.w_from/this.coords.w_rs*100,this.labels.p_from_left=this.coords.p_from+this.coords.p_handle/2-this.labels.p_from/2,this.labels.p_from_left=this.toFixed(this.labels.p_from_left),this.labels.p_from_left=this.checkEdges(this.labels.p_from_left,this.labels.p_from),this.labels.w_to=this.$cache.to.outerWidth(!1),this.labels.p_to=this.labels.w_to/this.coords.w_rs*100,this.labels.p_to_left=this.coords.p_to+this.coords.p_handle/2-this.labels.p_to/2,this.labels.p_to_left=this.toFixed(this.labels.p_to_left),this.labels.p_to_left=this.checkEdges(this.labels.p_to_left,this.labels.p_to),this.labels.w_single=this.$cache.single.outerWidth(!1),this.labels.p_single=this.labels.w_single/this.coords.w_rs*100,this.labels.p_single_left=(this.labels.p_from_left+this.labels.p_to_left+this.labels.p_to)/2-this.labels.p_single/2,this.labels.p_single_left=this.toFixed(this.labels.p_single_left),this.labels.p_single_left=this.checkEdges(this.labels.p_single_left,this.labels.p_single)))},updateScene:function(){this.raf_id&&(cancelAnimationFrame(this.raf_id),this.raf_id=null),clearTimeout(this.update_tm),this.update_tm=null,this.options&&(this.drawHandles(),this.is_active?this.raf_id=requestAnimationFrame(this.updateScene.bind(this)):this.update_tm=setTimeout(this.updateScene.bind(this),300))},drawHandles:function(){this.coords.w_rs=this.$cache.rs.outerWidth(!1),this.coords.w_rs&&(this.coords.w_rs!==this.coords.w_rs_old&&(this.target="base",this.is_resize=!0),(this.coords.w_rs!==this.coords.w_rs_old||this.force_redraw)&&(this.setMinMax(),this.calc(!0),this.drawLabels(),this.options.grid&&(this.calcGridMargin(),this.calcGridLabels()),this.force_redraw=!0,this.coords.w_rs_old=this.coords.w_rs,this.drawShadow()),this.coords.w_rs&&(this.dragging||this.force_redraw||this.is_key)&&((this.old_from!==this.result.from||this.old_to!==this.result.to||this.force_redraw||this.is_key)&&(this.drawLabels(),this.$cache.bar[0].style.left=this.coords.p_bar_x+"%",this.$cache.bar[0].style.width=this.coords.p_bar_w+"%","single"===this.options.type?(this.$cache.s_single[0].style.left=this.coords.p_single+"%",this.$cache.single[0].style.left=this.labels.p_single_left+"%",this.options.values.length?(this.$cache.input.prop("value",this.result.from_value),this.$cache.input.data("from",this.result.from_value)):(this.$cache.input.prop("value",this.result.from),this.$cache.input.data("from",this.result.from))):(this.$cache.s_from[0].style.left=this.coords.p_from+"%",this.$cache.s_to[0].style.left=this.coords.p_to+"%",(this.old_from!==this.result.from||this.force_redraw)&&(this.$cache.from[0].style.left=this.labels.p_from_left+"%"),(this.old_to!==this.result.to||this.force_redraw)&&(this.$cache.to[0].style.left=this.labels.p_to_left+"%"),this.$cache.single[0].style.left=this.labels.p_single_left+"%",this.options.values.length?(this.$cache.input.prop("value",this.result.from_value+";"+this.result.to_value),this.$cache.input.data("from",this.result.from_value),this.$cache.input.data("to",this.result.to_value)):(this.$cache.input.prop("value",this.result.from+";"+this.result.to),this.$cache.input.data("from",this.result.from),this.$cache.input.data("to",this.result.to))),this.old_from===this.result.from&&this.old_to===this.result.to||this.is_start||this.$cache.input.trigger("change"),this.old_from=this.result.from,this.old_to=this.result.to,this.is_resize||this.is_update||this.is_start||this.is_finish||this.callOnChange(),(this.is_key||this.is_click)&&this.callOnFinish(),this.is_update=!1,this.is_resize=!1,this.is_finish=!1),this.is_start=!1,this.is_key=!1,this.is_click=!1,this.force_redraw=!1))},callOnStart:function(){this.options.onStart&&"function"==typeof this.options.onStart&&this.options.onStart(this.result)},callOnChange:function(){this.options.onChange&&"function"==typeof this.options.onChange&&this.options.onChange(this.result)},callOnFinish:function(){this.options.onFinish&&"function"==typeof this.options.onFinish&&this.options.onFinish(this.result)},callOnUpdate:function(){this.options.onUpdate&&"function"==typeof this.options.onUpdate&&this.options.onUpdate(this.result)},drawLabels:function(){if(this.options){var t,i,s,o=this.options.values.length,e=this.options.p_values;if(!this.options.hide_from_to)if("single"===this.options.type)o?(t=this.decorate(e[this.result.from]),this.$cache.single.html(t)):(t=this.decorate(this._prettify(this.result.from),this.result.from),this.$cache.single.html(t)),this.calcLabels(),this.labels.p_single_left<this.labels.p_min+1?this.$cache.min[0].style.visibility="hidden":this.$cache.min[0].style.visibility="visible",this.labels.p_single_left+this.labels.p_single>100-this.labels.p_max-1?this.$cache.max[0].style.visibility="hidden":this.$cache.max[0].style.visibility="visible";else{o?(this.options.decorate_both?(t=this.decorate(e[this.result.from]),t+=this.options.values_separator,t+=this.decorate(e[this.result.to])):t=this.decorate(e[this.result.from]+this.options.values_separator+e[this.result.to]),i=this.decorate(e[this.result.from]),s=this.decorate(e[this.result.to]),this.$cache.single.html(t),this.$cache.from.html(i),this.$cache.to.html(s)):(this.options.decorate_both?(t=this.decorate(this._prettify(this.result.from),this.result.from),t+=this.options.values_separator,t+=this.decorate(this._prettify(this.result.to),this.result.to)):t=this.decorate(this._prettify(this.result.from)+this.options.values_separator+this._prettify(this.result.to),this.result.to),i=this.decorate(this._prettify(this.result.from),this.result.from),s=this.decorate(this._prettify(this.result.to),this.result.to),this.$cache.single.html(t),this.$cache.from.html(i),this.$cache.to.html(s)),this.calcLabels();var h=Math.min(this.labels.p_single_left,this.labels.p_from_left),r=this.labels.p_single_left+this.labels.p_single,a=this.labels.p_to_left+this.labels.p_to,n=Math.max(r,a);this.labels.p_from_left+this.labels.p_from>=this.labels.p_to_left?(this.$cache.from[0].style.visibility="hidden",this.$cache.to[0].style.visibility="hidden",this.$cache.single[0].style.visibility="visible",this.result.from===this.result.to?(this.$cache.from[0].style.visibility="visible",this.$cache.single[0].style.visibility="hidden",n=a):(this.$cache.from[0].style.visibility="hidden",this.$cache.single[0].style.visibility="visible",n=Math.max(r,a))):(this.$cache.from[0].style.visibility="visible",this.$cache.to[0].style.visibility="visible",this.$cache.single[0].style.visibility="hidden"),h<this.labels.p_min+1?this.$cache.min[0].style.visibility="hidden":this.$cache.min[0].style.visibility="visible",n>100-this.labels.p_max-1?this.$cache.max[0].style.visibility="hidden":this.$cache.max[0].style.visibility="visible"}}},drawShadow:function(){var t,i,s,o,e=this.options,h=this.$cache,r="number"==typeof e.from_min&&!isNaN(e.from_min),a="number"==typeof e.from_max&&!isNaN(e.from_max),n="number"==typeof e.to_min&&!isNaN(e.to_min),c="number"==typeof e.to_max&&!isNaN(e.to_max);"single"===e.type?e.from_shadow&&(r||a)?(t=this.calcPercent(r?e.from_min:e.min),i=this.calcPercent(a?e.from_max:e.max)-t,t=this.toFixed(t-this.coords.p_handle/100*t),i=this.toFixed(i-this.coords.p_handle/100*i),t+=this.coords.p_handle/2,h.shad_single[0].style.display="block",h.shad_single[0].style.left=t+"%",h.shad_single[0].style.width=i+"%"):h.shad_single[0].style.display="none":(e.from_shadow&&(r||a)?(t=this.calcPercent(r?e.from_min:e.min),i=this.calcPercent(a?e.from_max:e.max)-t,t=this.toFixed(t-this.coords.p_handle/100*t),i=this.toFixed(i-this.coords.p_handle/100*i),t+=this.coords.p_handle/2,h.shad_from[0].style.display="block",h.shad_from[0].style.left=t+"%",h.shad_from[0].style.width=i+"%"):h.shad_from[0].style.display="none",e.to_shadow&&(n||c)?(s=this.calcPercent(n?e.to_min:e.min),o=this.calcPercent(c?e.to_max:e.max)-s,s=this.toFixed(s-this.coords.p_handle/100*s),o=this.toFixed(o-this.coords.p_handle/100*o),s+=this.coords.p_handle/2,h.shad_to[0].style.display="block",h.shad_to[0].style.left=s+"%",h.shad_to[0].style.width=o+"%"):h.shad_to[0].style.display="none")},toggleInput:function(){this.$cache.input.toggleClass("irs-hidden-input")},calcPercent:function(t){var i=(this.options.max-this.options.min)/100,s=(t-this.options.min)/i;return this.toFixed(s)},calcReal:function(t){var i,s,o=this.options.min,e=this.options.max,h=o.toString().split(".")[1],r=e.toString().split(".")[1],a=0,n=0;if(0===t)return this.options.min;if(100===t)return this.options.max;h&&(i=h.length,a=i),r&&(s=r.length,a=s),i&&s&&(a=i>=s?i:s),0>o&&(n=Math.abs(o),o=+(o+n).toFixed(a),e=+(e+n).toFixed(a));var c,l=(e-o)/100*t+o,p=this.options.step.toString().split(".")[1];return p?l=+l.toFixed(p.length):(l/=this.options.step,l*=this.options.step,l=+l.toFixed(0)),n&&(l-=n),c=p?+l.toFixed(p.length):this.toFixed(l),c<this.options.min?c=this.options.min:c>this.options.max&&(c=this.options.max),c},calcWithStep:function(t){var i=Math.round(t/this.coords.p_step)*this.coords.p_step;return i>100&&(i=100),100===t&&(i=100),this.toFixed(i)},checkMinInterval:function(t,i,s){var o,e,h=this.options;return h.min_interval?(o=this.calcReal(t),e=this.calcReal(i),"from"===s?e-o<h.min_interval&&(o=e-h.min_interval):o-e<h.min_interval&&(o=e+h.min_interval),this.calcPercent(o)):t},checkMaxInterval:function(t,i,s){var o,e,h=this.options;return h.max_interval?(o=this.calcReal(t),e=this.calcReal(i),"from"===s?e-o>h.max_interval&&(o=e-h.max_interval):o-e>h.max_interval&&(o=e+h.max_interval),this.calcPercent(o)):t},checkDiapason:function(t,i,s){var o=this.calcReal(t),e=this.options;return"number"!=typeof i&&(i=e.min),"number"!=typeof s&&(s=e.max),i>o&&(o=i),o>s&&(o=s),this.calcPercent(o)},toFixed:function(t){return t=t.toFixed(9),+t},_prettify:function(t){return this.options.prettify_enabled?this.options.prettify&&"function"==typeof this.options.prettify?this.options.prettify(t):this.prettify(t):t},prettify:function(t){var i=t.toString();return i.replace(/(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g,"$1"+this.options.prettify_separator)},checkEdges:function(t,i){return this.options.force_edges?(0>t?t=0:t>100-i&&(t=100-i),this.toFixed(t)):this.toFixed(t)},validate:function(){var t,i,s=this.options,o=this.result,e=s.values,h=e.length;if("string"==typeof s.min&&(s.min=+s.min),"string"==typeof s.max&&(s.max=+s.max),"string"==typeof s.from&&(s.from=+s.from),"string"==typeof s.to&&(s.to=+s.to),"string"==typeof s.step&&(s.step=+s.step),"string"==typeof s.from_min&&(s.from_min=+s.from_min),"string"==typeof s.from_max&&(s.from_max=+s.from_max),"string"==typeof s.to_min&&(s.to_min=+s.to_min),"string"==typeof s.to_max&&(s.to_max=+s.to_max),"string"==typeof s.keyboard_step&&(s.keyboard_step=+s.keyboard_step),"string"==typeof s.grid_num&&(s.grid_num=+s.grid_num),s.max<=s.min&&(s.min?s.max=2*s.min:s.max=s.min+1,s.step=1),h)for(s.p_values=[],s.min=0,s.max=h-1,s.step=1,s.grid_num=s.max,s.grid_snap=!0,i=0;h>i;i++)t=+e[i],isNaN(t)?t=e[i]:(e[i]=t,t=this._prettify(t)),s.p_values.push(t);("number"!=typeof s.from||isNaN(s.from))&&(s.from=s.min),("number"!=typeof s.to||isNaN(s.from))&&(s.to=s.max),"single"===s.type?(s.from<s.min&&(s.from=s.min),s.from>s.max&&(s.from=s.max)):((s.from<s.min||s.from>s.max)&&(s.from=s.min),(s.to>s.max||s.to<s.min)&&(s.to=s.max),s.from>s.to&&(s.from=s.to)),("number"!=typeof s.step||isNaN(s.step)||!s.step||s.step<0)&&(s.step=1),("number"!=typeof s.keyboard_step||isNaN(s.keyboard_step)||!s.keyboard_step||s.keyboard_step<0)&&(s.keyboard_step=5),"number"==typeof s.from_min&&s.from<s.from_min&&(s.from=s.from_min),"number"==typeof s.from_max&&s.from>s.from_max&&(s.from=s.from_max),"number"==typeof s.to_min&&s.to<s.to_min&&(s.to=s.to_min),"number"==typeof s.to_max&&s.from>s.to_max&&(s.to=s.to_max),o&&(o.min!==s.min&&(o.min=s.min),o.max!==s.max&&(o.max=s.max),(o.from<o.min||o.from>o.max)&&(o.from=s.from),(o.to<o.min||o.to>o.max)&&(o.to=s.to)),("number"!=typeof s.min_interval||isNaN(s.min_interval)||!s.min_interval||s.min_interval<0)&&(s.min_interval=0),("number"!=typeof s.max_interval||isNaN(s.max_interval)||!s.max_interval||s.max_interval<0)&&(s.max_interval=0),s.min_interval&&s.min_interval>s.max-s.min&&(s.min_interval=s.max-s.min),s.max_interval&&s.max_interval>s.max-s.min&&(s.max_interval=s.max-s.min); },decorate:function(t,i){var s="",o=this.options;return o.prefix&&(s+=o.prefix),s+=t,o.max_postfix&&(o.values.length&&t===o.p_values[o.max]?(s+=o.max_postfix,o.postfix&&(s+=" ")):i===o.max&&(s+=o.max_postfix,o.postfix&&(s+=" "))),o.postfix&&(s+=o.postfix),s},updateFrom:function(){this.result.from=this.options.from,this.result.from_percent=this.calcPercent(this.result.from),this.options.values&&(this.result.from_value=this.options.values[this.result.from])},updateTo:function(){this.result.to=this.options.to,this.result.to_percent=this.calcPercent(this.result.to),this.options.values&&(this.result.to_value=this.options.values[this.result.to])},updateResult:function(){this.result.min=this.options.min,this.result.max=this.options.max,this.updateFrom(),this.updateTo()},appendGrid:function(){if(this.options.grid){var t,i,s,o,e,h=this.options,r=h.max-h.min,a=h.grid_num,n=0,c=0,l=4,p=0,_="";for(this.calcGridMargin(),h.grid_snap?(a=r/h.step,n=this.toFixed(h.step/(r/100))):n=this.toFixed(100/a),a>4&&(l=3),a>7&&(l=2),a>14&&(l=1),a>28&&(l=0),t=0;a+1>t;t++){for(s=l,c=this.toFixed(n*t),c>100&&(c=100,s-=2,0>s&&(s=0)),this.coords.big[t]=c,o=(c-n*(t-1))/(s+1),i=1;s>=i&&0!==c;i++)p=this.toFixed(c-o*i),_+='<span class="irs-grid-pol small" style="left: '+p+'%"></span>';_+='<span class="irs-grid-pol" style="left: '+c+'%"></span>',e=this.calcReal(c),e=h.values.length?h.p_values[e]:this._prettify(e),_+='<span class="irs-grid-text js-grid-text-'+t+'" style="left: '+c+'%">'+e+"</span>"}this.coords.big_num=Math.ceil(a+1),this.$cache.cont.addClass("irs-with-grid"),this.$cache.grid.html(_),this.cacheGridLabels()}},cacheGridLabels:function(){var t,i,s=this.coords.big_num;for(i=0;s>i;i++)t=this.$cache.grid.find(".js-grid-text-"+i),this.$cache.grid_labels.push(t);this.calcGridLabels()},calcGridLabels:function(){var t,i,s=[],o=[],e=this.coords.big_num;for(t=0;e>t;t++)this.coords.big_w[t]=this.$cache.grid_labels[t].outerWidth(!1),this.coords.big_p[t]=this.toFixed(this.coords.big_w[t]/this.coords.w_rs*100),this.coords.big_x[t]=this.toFixed(this.coords.big_p[t]/2),s[t]=this.toFixed(this.coords.big[t]-this.coords.big_x[t]),o[t]=this.toFixed(s[t]+this.coords.big_p[t]);for(this.options.force_edges&&(s[0]<-this.coords.grid_gap&&(s[0]=-this.coords.grid_gap,o[0]=this.toFixed(s[0]+this.coords.big_p[0]),this.coords.big_x[0]=this.coords.grid_gap),o[e-1]>100+this.coords.grid_gap&&(o[e-1]=100+this.coords.grid_gap,s[e-1]=this.toFixed(o[e-1]-this.coords.big_p[e-1]),this.coords.big_x[e-1]=this.toFixed(this.coords.big_p[e-1]-this.coords.grid_gap))),this.calcGridCollision(2,s,o),this.calcGridCollision(4,s,o),t=0;e>t;t++)i=this.$cache.grid_labels[t][0],i.style.marginLeft=-this.coords.big_x[t]+"%"},calcGridCollision:function(t,i,s){var o,e,h,r=this.coords.big_num;for(o=0;r>o&&(e=o+t/2,!(e>=r));o+=t)h=this.$cache.grid_labels[e][0],s[o]<=i[e]?h.style.visibility="visible":h.style.visibility="hidden"},calcGridMargin:function(){this.options.grid_margin&&(this.coords.w_rs=this.$cache.rs.outerWidth(!1),this.coords.w_rs&&("single"===this.options.type?this.coords.w_handle=this.$cache.s_single.outerWidth(!1):this.coords.w_handle=this.$cache.s_from.outerWidth(!1),this.coords.p_handle=this.toFixed(this.coords.w_handle/this.coords.w_rs*100),this.coords.grid_gap=this.toFixed(this.coords.p_handle/2-.1),this.$cache.grid[0].style.width=this.toFixed(100-this.coords.p_handle)+"%",this.$cache.grid[0].style.left=this.coords.grid_gap+"%"))},update:function(i){this.input&&(this.is_update=!0,this.options.from=this.result.from,this.options.to=this.result.to,this.options=t.extend(this.options,i),this.validate(),this.updateResult(i),this.toggleInput(),this.remove(),this.init(!0))},reset:function(){this.input&&(this.updateResult(),this.update())},destroy:function(){this.input&&(this.toggleInput(),this.$cache.input.prop("readonly",!1),t.data(this.input,"ionRangeSlider",null),this.remove(),this.input=null,this.options=null)}},t.fn.ionRangeSlider=function(i){return this.each(function(){t.data(this,"ionRangeSlider")||t.data(this,"ionRangeSlider",new p(this,i,h++))})},function(){for(var t=0,i=["ms","moz","webkit","o"],o=0;o<i.length&&!s.requestAnimationFrame;++o)s.requestAnimationFrame=s[i[o]+"RequestAnimationFrame"],s.cancelAnimationFrame=s[i[o]+"CancelAnimationFrame"]||s[i[o]+"CancelRequestAnimationFrame"];s.requestAnimationFrame||(s.requestAnimationFrame=function(i,o){var e=(new Date).getTime(),h=Math.max(0,16-(e-t)),r=s.setTimeout(function(){i(e+h)},h);return t=e+h,r}),s.cancelAnimationFrame||(s.cancelAnimationFrame=function(t){clearTimeout(t)})}()}(jQuery,document,window,navigator);;/** * Created by PA25072016 on 6/14/2017. */ jQuery(function($) { var last_select_clicked = false; $('body').append('<div class="option-wrapper1 st-option-wrapper1 st-flight-location"></div>'); var j = 0; $('.st-flight-location-name').each(function(index, el) { var form = $(this).parents('form'); var parent = $(this).parents('.st-select-wrapper'); var t = $(this); var flag = true; $('.option-wrapper1',parent).remove(); t.on('keyup', function(event) { last_select_clicked=t; if (event.which != 40 && event.which != 38 && event.which != 9) { val = $(this).val(); if (event.which != 13) { flag = false; if( val != '' ){ html = ''; $('select option', parent).prop('selected', false); $('select option', parent).each(function(index, el) { var country = $(this).data('country'); var text = $(this).text(); var text_split = text.split("||"); text_split = text_split[0]; var highlight = get_highlight(text, val); if (highlight.indexOf('</span>') > 0) { var current_country = $(this).parent('select').attr('data-current-country'); if (typeof current_country != 'undefined' && current_country != '') { if (country == current_country) { html += '<div data-text="' + text + '" data-country="' + country + '" data-value="' + $(this).val() + '" class="option">' + '<span class="label"><a href="#">' + text_split + '<i class="fa fa-planer"></i></a>' + '</div>'; } } else { html += '<div data-text="' + text + '" data-country="' + country + '" data-value="' + $(this).val() + '" class="option">' + '<span class="label"><a href="#">' + text_split + '<i class="fa fa-plane"></i></a>' + '</div>'; } } }); $('.option-wrapper1').html(html).show(); t.caculatePosition($('.option-wrapper1'),t); }else{ html = ''; $('select option', parent).prop('selected', false); $('select option', parent).each(function(index, el) { var country = $(this).data('country'); var text = $(this).text(); var text_split = text.split("||"); text_split = text_split[0]; if (text != '') { var current_country = $(this).parent('select').attr('data-current-country'); if (typeof current_country != 'undefined' && current_country != '') { if (country == current_country) { html += '<div data-text="' + text + '" data-country="' + country + '" data-value="' + $(this).val() + '" class="option">' + '<span class="label"><a href="#">' + text_split + '<i class="fa fa-plane"></i></a>' + '</div>'; } } else { html += '<div data-text="' + text + '" data-country="' + country + '" data-value="' + $(this).val() + '" class="option">' + '<span class="label"><a href="#">' + text_split + '<i class="fa fa-plane"></i></a>' + '</div>'; } } }); $('.option-wrapper1').html(html).show(); t.caculatePosition($('.option-wrapper1', parent),t); } } if (event.which == 13 && val != ""){ } if (typeof t.data('children') != 'undefined' && t.data('children') != "") { name = t.data('children'); $('select[name="' + name + '"]', form).attr('data-current-country', ''); $('input[name="drop-off"]', form).val(''); $('select[name="' + name + '"] option', form).prop('selected', false); } } }); var liSelected; t.on('keydown', function(event) { last_select_clicked=t; if (event.which == 13) { var form = last_select_clicked.closest('form'); $('.option-wrapper1').html('').hide(); t.focusNextInputField(); return false; } if (event.which == 9) { var form = last_select_clicked.closest('form'); $('.option-wrapper1').html('').hide(); t.focusNextInputField(); return false; } if (event.which == 40 || event.which == 38) { if(event.which === 40){ var index = $('.option-wrapper1 .option.active').index(); if(liSelected){ liSelected.removeClass('active'); next = liSelected.next(); if(next.length > 0){ liSelected = next.addClass('active'); }else{ if($('.option-wrapper1 .option.active').length > 0){ $('.st-option-wrapper1 .option').eq(index).removeClass('active'); if(($('.option-wrapper1 .option').length - 1) == index){ liSelected = $('.st-option-wrapper1 .option').eq(0).addClass('active'); }else{ liSelected = $('.st-option-wrapper1 .option').eq(index + 1).addClass('active'); } }else{ liSelected = $('.st-option-wrapper1 .option').eq(0).addClass('active'); } } }else{ liSelected = $('.st-option-wrapper1 .option').eq(0).addClass('active'); } }else if(event.which === 38){ var index = $('.option-wrapper1 .option.active').index(); if(liSelected){ liSelected.removeClass('active'); next = liSelected.prev(); if(next.length > 0){ liSelected = next.addClass('active'); }else{ if($('.option-wrapper1 .option.active').length > 0) { $('.st-option-wrapper1 .option').eq(index).removeClass('active'); liSelected = $('.st-option-wrapper1 .option').eq(index-1).addClass('active'); }else{ liSelected = $('.st-option-wrapper1 .option').last().addClass('active'); } } }else{ liSelected = $('.st-option-wrapper1 .option').last().addClass('active'); } } $('.option-wrapper1').scrollTo($('.option-wrapper1 .option.active'), 400); event.preventDefault(); flag = true; var value = $('.option-wrapper1 .option.active').data('value'); var text = $('.option-wrapper1 .option.active').text(); var country = $('.option-wrapper1 .option.active').data('country'); t.val(text); $('select option[value="' + value + '"]', parent).prop('selected', true); if (typeof t.data('children') != 'undefined' && t.data('children') != "") { name = t.data('children'); $('select[name="' + name + '"]', form).attr('data-current-country', country); } } }); t.on('blur', function(event) { if (t.data('clear') == 'clear' && $('select option:selected', parent).val() == "") { t.val(''); } }); t.on("focus",function(event) { last_select_clicked=t; if (t.val() == '') { html = ''; $('select option', parent).prop('selected', false); $('select option', parent).each(function(index, el) { var country = $(this).data('country'); var text = $(this).text(); var text_split = text.split("||"); text_split = text_split[0]; if (text != '') { var current_country = $(this).parent('select').attr('data-current-country'); if (typeof current_country != 'undefined' && current_country != '') { if (country == current_country) { html += '<div data-text="' + text + '" data-country="' + country + '" data-value="' + $(this).val() + '" class="option">' + '<span class="label"><a href="#">' + text_split + '<i class="fa fa-plane"></i></a>' + '</div>'; } } else { html += '<div data-text="' + text + '" data-country="' + country + '" data-value="' + $(this).val() + '" class="option">' + '<span class="label"><a href="#">' + text_split + '<i class="fa fa-plane"></i></a>' + '</div>'; } } }); if (typeof t.data('parent') != 'undefined' && t.data('parent') != "") { name = t.data('parent'); if ($('select[name="' + name + '"]', form).length) { var val = $('select[name="' + name + '"]', form).parent().find('input.st-flight-location-name').val(); if (typeof val == 'undefined' || val == '') { t.val(''); $('select[name="' + name + '"]', form).parent().find('input.st-flight-location-name').trigger('focus'); }else{ $('.st-flight-location').html(html).show(); } } }else{ $('.st-flight-location').html(html).show(); } } t.caculatePosition(); }); $(document).on('click', '.option-wrapper1 .option', function(event) { if(last_select_clicked.length > 0) { var form = last_select_clicked.closest('form'); var parent = last_select_clicked.closest('.st-select-wrapper'); if(last_select_clicked.hasClass('destination')) { setTimeout(function () { if (typeof form.find('input[name="start"]').attr('value') != 'undefined') { var $tmp = form.find('input[name="start"]').attr('value'); if ($tmp.length <= 0) { form.find('input[name="start"]').datepicker('show'); } } }, 100); } event.preventDefault(); flag = true; var value = $(this).data('value'); var text = $(this).text(); var country = $(this).data('country'); if (text != "") { last_select_clicked.val(text); $('select option[value="' + value + '"]', parent).prop('selected', true); $('.option-wrapper1').html('').hide(); if (typeof t.data('children') != 'undefined' && t.data('children') != "") { name = t.data('children'); $('select[name="' + name + '"]', form).attr('data-current-country', country); } } } //last_select_clicked.focusNextInputField(); }); $(document).on('click', function(event) { if (!$(event.target).is('.st-flight-location-name')) { $('.option-wrapper1').html('').hide(); } }); t.caculatePosition=function(){ if(!last_select_clicked || !last_select_clicked.length) return; var wraper= $('.option-wrapper1'); var input_tag= last_select_clicked; var offset=parent.offset(); var top=offset.top+parent.height(); var left=offset.left; var width=input_tag.outerWidth(); var wpadminbar = 0; if( $('#wpadminbar').length && $(window).width() >= 783 ){ wpadminbar = $('#wpadminbar').height(); }else{ wpadminbar = 0 } if($('body').hasClass('boxed')){ left = left - $('body').offset().left; } top = top - wpadminbar; var z_index = 99999; var position = 'absolute'; if( $('#search-dialog').length ){ position = 'fixed'; top = top + wpadminbar - $(window).scrollTop(); z_index = 99999; } wraper.css({ position:position, top:top, left:left, width:width, 'z-index': z_index }); }; $( window ).on('resize', function() { t.caculatePosition(); }); form.on('submit', function(event) { if (t.val() == "" && t.hasClass('required')) { t.trigger('focus'); return false; } else { if ($('input.required-field').length && $('input.required-field').prop('checked') == true) { var val = $('select[name="location_id_pick_up"] option:selected', form).val(); var text = $('input[name="pick-up"]', form).val(); $('select[name="location_id_drop_off"] option[value="' + val + '"]', form).prop('selected', true); $('input[name="drop-off"]', form).val(text); } if ($('input.required-field').length && $('input.required-field').prop('checked') == false && $('input[name="drop-off"]', form).val() == "") { $('input[name="drop-off"]', form).trigger('focus'); $('select[name="location_id_drop_off"] option', form).prop('selected', false); return false; } } }); }); function get_highlight(text, val) { var highlight = text.replace( new RegExp(val + '(?!([^<]+)?>)', 'gi'), '<span class="highlight">$&</span>' ); return highlight; } $.fn.focusNextInputField = function() { return this.each(function() { var fields = $(this).parents('form:eq(0),body').find('button:visible,input:visible,textarea:visible,select:visible'); var index = fields.index( this ); if ( index > -1 && ( index + 1 ) < fields.length ) { fields.eq( index + 1 ).trigger('focus'); } return false; }); }; }); ;jQuery(function ($) { "use strict"; var last_select_clicked = !1; $('.tp-flight-location').each(function () { var t = $(this); var parent = t.closest('.tp-flight-wrapper'); $(this).on('keyup', function (event) { last_select_clicked = t; parent.find('.st-location-id').remove(); var name = t.attr('data-name'); var locale = t.attr('data-locale'); var val = t.val(); if (val.length >= 2) { $.getJSON("https://autocomplete.travelpayouts.com/jravia?locale=" + locale + "&with_countries=false&q=" + val, function (data) { if (typeof data == 'object') { var html = ''; html += '<select name="' + name + '" class="st-location-id st-hidden" tabindex="-1">'; $.each(data, function (key, value) { var f_name = ''; if (value.name != null) { f_name = '(' + value.name + ')' } html += '<option value="' + value.code + '">' + value.city_fullname + ' ' + f_name + ' - ' + value.code + '</option>' }); html += '</select>'; parent.find('.st-location-id').remove(); parent.append(html); html = ''; $('select option', parent).prop('selected', !1); $('select option', parent).each(function (index, el) { var country = $(this).data('country'); var text = $(this).text(); var text_split = text.split("||"); text_split = text_split[0]; var highlight = get_highlight(text, val); if (highlight.indexOf('</span>') >= 0) { var current_country = $(this).parent('select').attr('data-current-country'); if (typeof current_country != 'undefined' && current_country != '') { if (country == current_country) { html += '<div data-text="' + text + '" data-country="' + country + '" data-value="' + $(this).val() + '" class="option">' + '<span class="label"><a href="#">' + text_split + ' <i class="fa fa-plane"></i></a>' + '</div>' } } else { html += '<div data-text="' + text + '" data-country="' + country + '" data-value="' + $(this).val() + '" class="option">' + '<span class="label"><a href="#">' + text_split + ' <i class="fa fa-plane"></i></a>' + '</div>' } } }); $('.option-wrapper').html(html).show(); t.caculatePosition($('.option-wrapper'), t) } }) } }); t.caculatePosition = function () { if (!last_select_clicked || !last_select_clicked.length) return; var wraper = $('.option-wrapper'); var input_tag = last_select_clicked; var offset = parent.offset(); var top = offset.top + parent.height(); var left = offset.left; var width = input_tag.outerWidth(); var wpadminbar = 0; if ($('#wpadminbar').length && $(window).width() >= 783) { wpadminbar = $('#wpadminbar').height() } else { wpadminbar = 0 } top = top - wpadminbar; var z_index = 99999; var position = 'absolute'; if ($('#search-dialog').length) { position = 'fixed'; top = top + wpadminbar - $(window).scrollTop(); z_index = 99999 } wraper.css({position: position, top: top, left: left, width: width, 'z-index': z_index}) }; $(window).on('resize', function () { t.caculatePosition() }) }); function get_highlight(text, val) { var highlight = text.replace(new RegExp(val + '(?!([^<]+)?>)', 'gi'), '<span class="highlight">$&</span>'); return highlight } var flight_to = ''; $('.input-daterange .tp_depart_date').each(function () { var form = $(this).closest('form'); var p = $(this).parent(); var me = $(this); $(this).datepicker({ language: st_params.locale, autoclose: !0, todayHighlight: !0, startDate: 'today', format: p.data('tp-date-format'), weekStart: 1, }).on('changeDate', function (e) { var m = e.date.getMonth() + 1; if ((e.date.getMonth() + 1) < 10) { m = '0' + m } var d = e.date.getDate(); if (e.date.getDate() < 10) { d = '0' + d } $(this).parent().find('.tp-date-from').val(e.date.getFullYear() + '-' + (m) + '-' + d); var new_date = e.date; new_date.setDate(new_date.getDate() + 1); $('.input-daterange .tp_return_date', form).datepicker("remove"); $('.input-daterange .tp_return_date', form).datepicker({ language: st_params.locale, startDate: '+1d', format: p.data('tp-date-format'), autoclose: !0, todayHighlight: !0, weekStart: 1 }); $('.input-daterange .tp_return_date', form).datepicker('setDates', new_date); $('.input-daterange .tp_return_date', form).datepicker('setStartDate', new_date); update_link() }); $('.input-daterange .tp_return_date', form).datepicker({ language: st_params.locale, startDate: '+1d', format: p.data('tp-date-format'), autoclose: !0, todayHighlight: !0, weekStart: 1 }).on('changeDate', function (e) { var m = e.date.getMonth() + 1; if ((e.date.getMonth() + 1) < 10) { m = '0' + m } var d = e.date.getDate(); if (e.date.getDate() < 10) { d = '0' + d } flight_to = e.date.getFullYear() + '-' + (m) + '-' + d; $(this).parent().find('.tp-date-to').val(flight_to); var del_html = '<i class="fa fa-times tp-icon-return-del"></i>'; $('.input-daterange-return').append(del_html); update_link() }) }); $(document).on('click', '.tp-icon-return-del', function () { $('.input-daterange .tp_return_date').val(''); $('input.tp-date-to').val(''); $(this).remove(); update_link() }); $('.form-passengers-class .tp_group_display').on('click', function () { $(this).parent().find('.tp-form-passengers-class').toggleClass('none'); $(this).find('.fa').toggleClass('fa-chevron-up'); $(this).find('.fa').toggleClass('fa-chevron-down') }); $('.tp-checkbox-class .checkbox-class').on('ifChecked', function (event) { $('.tp-checkbox-class input[name=trip_class]').val('1'); var text = $('.form-passengers-class .display-class').data('business'); $('.form-passengers-class .display-class').text(text) }); $('.tp-checkbox-class .checkbox-class').on('ifUnchecked', function (event) { $('.tp-checkbox-class input[name=trip_class]').val('0'); var text = $('.form-passengers-class .display-class').data('economy'); $('.form-passengers-class .display-class').text(text) }); $(document).on('keyup mouseup', '.passengers-class input[name=adults]', function () { if ($(this).val() == '') { //$(this).val(1) } else { var infants = $('.twidget-age-group input[name=infants]').val(); if(infants == '') infants = 0; var children = $('.twidget-age-group input[name=children]').val(); if(children == '') children = 0; var total = parseInt(infants) + parseInt(children) + parseInt($(this).val()); if (total > 9) { var adults = 9 - (parseInt(infants) + parseInt(children)); $(this).val(adults); $('.tp-form-passengers-class .notice').fadeIn() } else { $('.tp_group_display .quantity-passengers').text(total); $('.tp-form-passengers-class .notice').fadeOut() } } }); $(document).on('keyup mouseup', '.passengers-class input[name=children]', function () { if ($(this).val() == '') { //$(this).val(0) } else { var infants = $('.twidget-age-group input[name=infants]').val(); if(infants == '') infants = 0; var adults = $('.twidget-age-group input[name=adults]').val(); if(adults == '') adults = 0; var total = parseInt(infants) + parseInt(adults) + parseInt($(this).val()); if (total > 9) { var children = 9 - (parseInt(infants) + parseInt(adults)); $(this).val(children); $('.tp-form-passengers-class .notice').fadeIn() } else { $('.tp_group_display .quantity-passengers').text(total); $('.tp-form-passengers-class .notice').fadeOut() } } }); $(document).on('keyup mouseup', '.passengers-class input[name=infants]', function () { if ($(this).val() == '') { //$(this).val(0) } else { var adults = $('.twidget-age-group input[name=adults]').val(); if(adults == '') adults = 0; var children = $('.twidget-age-group input[name=children]').val(); if(children == '') children = 0; var total = parseInt(adults) + parseInt(children) + parseInt($(this).val()); if (total > 9) { var infants = 9 - (parseInt(children) + parseInt(adults)); $(this).val(infants); $('.tp-form-passengers-class .notice').fadeIn() } else { $('.tp_group_display .quantity-passengers').text(total); $('.tp-form-passengers-class .notice').fadeOut() } } }); $(document).on('focusout', '.passengers-class input[name=adults]', function () { if ($(this).val() == '' || $(this).val() == 0) { $(this).val(1) } }); $(document).on('focusout', '.passengers-class input[name=children], .passengers-class input[name=infants]', function () { if ($(this).val() == '') { $(this).val(0) } }); var last_select_clicked = !1; $('.tp-hotel-destination').each(function () { var t = $(this); var parent = t.closest('.tp-hotel-wrapper'); $(this).on('keyup', function (event) { last_select_clicked = t; parent.find('.st-location-id').remove(); var name = t.attr('data-name'); var locale = t.attr('data-locale'); var val = t.val(); if (val.length >= 2) { $.getJSON("https://engine.hotellook.com/api/v2/lookup.json?query=" + val + "&lang=" + locale + "&limit=5", function (data) { if (typeof data == 'object') { var html = ''; html += '<select name="' + name + '" class="st-location-id st-hidden" tabindex="-1">'; $.each(data.results.locations, function (key, value) { html += '<option data-type="location" value="' + value.id + '">' + value.fullName + ' - ' + value.hotelsCount + ' ' + t.attr('data-text') + '</option>' }); $.each(data.results.hotels, function (key, value) { html += '<option data-type="hotel" value="' + value.id + '">' + value.fullName + '</option>' }); html += '</select>'; parent.find('.st-location-id').remove(); parent.append(html); html = ''; $('select option', parent).prop('selected', !1); $('select option', parent).each(function (index, el) { var country = $(this).data('country'); var text = $(this).text(); var text_split = text.split("||"); text_split = text_split[0]; var highlight = get_highlight(text, val); if (highlight.indexOf('</span>') >= 0) { if ($(this).data('type') == 'location') { html += '<div data-text="' + text + '" data-value="' + $(this).val() + '" class="option1">' + '<span class="label"><a href="#">' + text_split + '<i class="fa fa-map-marker"></i></a>' + '</div>' } else { html += '<div data-text="' + text + '" data-value="' + $(this).val() + '" class="option1">' + '<span class="label"><a href="#">' + text_split + '<i class="fa fa-building"></i></a>' + '</div>' } } }); $('.option-wrapper').html(html).show(); t.caculatePosition($('.option-wrapper'), t) } }) } }); $(document).on('click', '.option-wrapper .option1', function (event) { if (last_select_clicked.length > 0) { var parent = last_select_clicked.closest('.st-select-wrapper'); event.preventDefault(); var value = $(this).data('value'); var text = $(this).text(); if (text != "") { last_select_clicked.val(text); $('select option[value="' + value + '"]', parent).prop('selected', !0); $('.option-wrapper').html('').hide() } } }); t.caculatePosition = function () { if (!last_select_clicked || !last_select_clicked.length) return; var wraper = $('.option-wrapper'); var input_tag = last_select_clicked; var offset = parent.offset(); var top = offset.top + parent.height(); var left = offset.left; var width = input_tag.outerWidth(); var wpadminbar = 0; if ($('#wpadminbar').length && $(window).width() >= 783) { wpadminbar = $('#wpadminbar').height() } else { wpadminbar = 0 } top = top - wpadminbar; var z_index = 99999; var position = 'absolute'; if ($('#search-dialog').length) { position = 'fixed'; top = top + wpadminbar - $(window).scrollTop(); z_index = 99999 } wraper.css({position: position, top: top, left: left, width: width, 'z-index': z_index}) }; $(window).on('resize', function () { t.caculatePosition() }) }); $(document).on('keyup mouseup', '.guests input[name=adults]', function () { if ($(this).val() == '') { } else { var children = $('.guests .children').val(); if (parseInt($(this).val()) > 4) { $(this).val(4); $(this).closest('.tp-form-passengers-class').find('.notice').fadeIn() } else { var num_ad = parseInt($(this).val()); if (typeof num_ad != 'number') { num_ad = 1 } var total = parseInt(children) + num_ad; $('.tp_guests_field .quantity-guests').text(total); $(this).closest('.tp-form-passengers-class').find('.notice').fadeOut() } } }); var gl_index = 0; $(document).on('keyup mouseup', '.guests input.children', function () { if ($(this).val() == '') { gl_index = 0; $('.tp-children-group').empty() } else { var adults = $('.guests input[name=adults]').val(); if (parseInt($(this).val()) > 3) { $(this).val(0); $(this).closest('.tp-form-passengers-class').find('.notice').fadeIn(); gl_index = 0; $('.tp-children-group').empty(); var total = parseInt(adults); $('.tp_guests_field .quantity-guests').text(total) } else { var total = parseInt(adults) + parseInt($(this).val()); $('.tp_guests_field .quantity-guests').text(total); $(this).closest('.tp-form-passengers-class').find('.notice').fadeOut(); if (gl_index > parseInt($(this).val())) { for (var i = gl_index; i > parseInt($(this).val()); i--) { $('.tp-children-group').find('.children-input-' + (i - 1)).remove() } } if (gl_index < parseInt($(this).val())) { for (var i = gl_index; i < parseInt($(this).val()); i++) { var html = '<div class="children-input-' + i + '"><label>' + $(this).data('text') + ' ' + (i + 1) + ')</label><span><input type="number" class="" name="children[' + i + ']" value="7" max="17" min="0"></span></div>'; $('.tp-children-group').append(html) } } gl_index = parseInt($(this).val()) } } }); var last_select_clicked = !1; $('.ss-flight-location').each(function () { var t = $(this); var parent = t.closest('.ss-flight-wrapper'); $(this).on('keyup', function (event) { last_select_clicked = t; parent.find('.st-location-id').remove(); var locale = $('.skyscanner-search-flights-data').data('locale'); var name = t.attr('data-name'); var val = t.val(); if (val.length >= 2) { var l = locale.split('-'); var url = "https://autocomplete.travelpayouts.com/jravia?locale=" + l[0] + "&with_countries=false&q=" + val; $.getJSON(url, function (data) { if (typeof data == 'object') { if (typeof data == 'object') { var html = ''; html += '<select class="st-location-id st-hidden" tabindex="-1">'; $.each(data, function (key, value) { var n = value.name; if (value.name == null) { n = value.title } html += '<option value="' + value.code + '">' + value.city_fullname + ' (' + n + ') - ' + value.code + '</option>' }); html += '</select>'; parent.find('.st-location-id').remove(); parent.append(html); html = ''; $('select option', parent).prop('selected', !1); $('select option', parent).each(function (index, el) { var country = $(this).data('country'); var text = $(this).text(); var text_split = text.split("||"); text_split = text_split[0]; var highlight = get_highlight(text, val); if (highlight.indexOf('</span>') >= 0) { html += '<div data-text="' + text + '" data-value="' + $(this).val() + '" class="option2">' + '<span class="label"><a href="#">' + text_split + '</a>' + '</div>' } }); $('.option-wrapper').html(html).show(); t.caculatePosition($('.option-wrapper'), t) } } }) } }); $(document).on('click', '.option-wrapper .option2', function (event) { if (last_select_clicked.length > 0) { var parent = last_select_clicked.closest('.st-select-wrapper'); event.preventDefault(); var value = $(this).data('value'); var text = $(this).text(); if (text != "") { last_select_clicked.val(text); last_select_clicked.attr('data-value', $(this).data('value')); $('select option[value="' + value + '"]', parent).prop('selected', !0); $('.option-wrapper').html('').hide(); update_link() } } }); t.caculatePosition = function () { if (!last_select_clicked || !last_select_clicked.length) return; var wraper = $('.option-wrapper'); var input_tag = last_select_clicked; var offset = parent.offset(); var top = offset.top + parent.height(); var left = offset.left; var width = input_tag.outerWidth(); var wpadminbar = 0; if ($('#wpadminbar').length && $(window).width() >= 783) { wpadminbar = $('#wpadminbar').height() } else { wpadminbar = 0 } top = top - wpadminbar; var z_index = 99999; var position = 'absolute'; if ($('#search-dialog').length) { position = 'fixed'; top = top + wpadminbar - $(window).scrollTop(); z_index = 99999 } wraper.css({position: position, top: top, left: left, width: width, 'z-index': z_index}) }; $(window).on('resize', function () { t.caculatePosition() }) }); function update_link() { var locale = $('.skyscanner-search-flights-data').data('locale'); var market = $('.skyscanner-search-flights-data').data('country'); var currency = $('.skyscanner-search-flights-data').data('currency'); var old = 'http://partners.api.skyscanner.net/apiservices/referral/v1.0/' + market + '/' + currency + '/' + locale + '/'; var or = $('#ss_location_origin').attr('data-value'); var de = $('#ss_location_destination').attr('data-value'); var dp = $('.tp-date-from.ss_depart').attr('value'); var rt = ''; if ($('.tp-date-to.ss_return').attr('value') != null) { rt = '/' + $('.tp-date-to.ss_return').attr('value') } var key = $('.skyscanner-search-flights-data').data('api'); var new_url = old + or + '/' + de + '/' + dp + rt; $('.ss-search-flights-link').attr('action', new_url) } jQuery(function ($) { $(document).ready(function () { $(document).on('click', '.btn-tp-search-flights', function (e) { e.preventDefault(); var form = $(this).closest('form'); var required = !1; $('input', form).each(function () { if($(this).prop('required')){ if ($(this).val() == '') { required = !0; $(this).addClass('error') } else { $(this).removeClass('error') } } }); var marker = form.find('input[name="marker"]').val(); var origin_iata = form.find('select[name="origin_iata"] option:selected').val(); var destination_iata = form.find('select[name="destination_iata"] option:selected').val(); var depart_date = form.find('input[name="depart_date"]').val(); var return_date = form.find('input[name="return_date"]').val(); var adults = form.find('input[name="adults"]').val(); var children = form.find('input[name="children"]').val(); var infants = form.find('input[name="infants"]').val(); var trip_class = form.find('input[name="trip_class"]').val(); var with_request = form.find('input[name="with_request"]').val(); var param = 'marker=' + marker + '&origin_iata=' + origin_iata + '&destination_iata=' + destination_iata + '&depart_date=' + depart_date + '&return_date=' + return_date + '&adults=' + adults + '&children=' + children + '&infants=' + infants + '&trip_class=' + trip_class + '&with_request=' + with_request; var current_url = $('#current_url').val(); if (!required) { window.location.href = current_url + '?' + param } }); $(document).on('click', '.btn-tp-search-hotels', function (e) { e.preventDefault(); var form = $(this).closest('form'); var required = !1; if ($('#location_destination_h').val() == '') { required = !0; $('#location_destination_h').addClass('error') } else { required = !1; $('#location_destination_h').removeClass('error') } var marker = form.find('input[name="marker"]').val(); var destination = form.find('select[name="destination"] option:selected').val(); var checkIn = form.find('input[name="checkIn"]').val(); var checkOut = form.find('input[name="checkOut"]').val(); var adults = form.find('input[name="adults"]').val(); if ($('input[name="children[0]"]').length > 0) { var children = form.find('input[name="children[0]"]').val() } if ($('input[name="children[1]"]').length > 0) { var children1 = form.find('input[name="children[1]"]').val() } if ($('input[name="children[2]"]').length > 0) { var children2 = form.find('input[name="children[2]"]').val() } var param = 'marker=' + marker + '&destination=' + destination + '&checkIn=' + checkIn + '&checkOut=' + checkOut + '&adults=' + adults; if (children != undefined) { param += '&children%5B0%5D=' + children } if (children1 != undefined) { param += '&children%5B1%5D=' + children } if (children2 != undefined) { param += '&children%5B2%5D=' + children } var current_url = $('#current_url_hotel').val(); if (!required) { window.location.href = current_url + '/hotels/?' + param } }) }) }) }) ;/*! * Bootstrap-select v1.12.4 (https://silviomoreto.github.io/bootstrap-select) * * Copyright 2013-2018 bootstrap-select * Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE) */ (function (root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module unless amdModuleId is set define(["jquery"], function (a0) { return (factory(a0)); }); } else if (typeof module === 'object' && module.exports) { // Node. Does not work with strict CommonJS, but // only CommonJS-like environments that support module.exports, // like Node. module.exports = factory(require("jquery")); } else { factory(root["jQuery"]); } }(this, function (jQuery) { (function ($) { 'use strict'; //<editor-fold desc="Shims"> if (!String.prototype.includes) { (function () { 'use strict'; // needed to support `apply`/`call` with `undefined`/`null` var toString = {}.toString; var defineProperty = (function () { // IE 8 only supports `Object.defineProperty` on DOM elements try { var object = {}; var $defineProperty = Object.defineProperty; var result = $defineProperty(object, object, object) && $defineProperty; } catch (error) { } return result; }()); var indexOf = ''.indexOf; var includes = function (search) { if (this == null) { throw new TypeError(); } var string = String(this); if (search && toString.call(search) == '[object RegExp]') { throw new TypeError(); } var stringLength = string.length; var searchString = String(search); var searchLength = searchString.length; var position = arguments.length > 1 ? arguments[1] : undefined; // `ToInteger` var pos = position ? Number(position) : 0; if (pos != pos) { // better `isNaN` pos = 0; } var start = Math.min(Math.max(pos, 0), stringLength); // Avoid the `indexOf` call if no match is possible if (searchLength + start > stringLength) { return false; } return indexOf.call(string, searchString, pos) != -1; }; if (defineProperty) { defineProperty(String.prototype, 'includes', { 'value': includes, 'configurable': true, 'writable': true }); } else { String.prototype.includes = includes; } }()); } if (!String.prototype.startsWith) { (function () { 'use strict'; // needed to support `apply`/`call` with `undefined`/`null` var defineProperty = (function () { // IE 8 only supports `Object.defineProperty` on DOM elements try { var object = {}; var $defineProperty = Object.defineProperty; var result = $defineProperty(object, object, object) && $defineProperty; } catch (error) { } return result; }()); var toString = {}.toString; var startsWith = function (search) { if (this == null) { throw new TypeError(); } var string = String(this); if (search && toString.call(search) == '[object RegExp]') { throw new TypeError(); } var stringLength = string.length; var searchString = String(search); var searchLength = searchString.length; var position = arguments.length > 1 ? arguments[1] : undefined; // `ToInteger` var pos = position ? Number(position) : 0; if (pos != pos) { // better `isNaN` pos = 0; } var start = Math.min(Math.max(pos, 0), stringLength); // Avoid the `indexOf` call if no match is possible if (searchLength + start > stringLength) { return false; } var index = -1; while (++index < searchLength) { if (string.charCodeAt(start + index) != searchString.charCodeAt(index)) { return false; } } return true; }; if (defineProperty) { defineProperty(String.prototype, 'startsWith', { 'value': startsWith, 'configurable': true, 'writable': true }); } else { String.prototype.startsWith = startsWith; } }()); } if (!Object.keys) { Object.keys = function ( o, // object k, // key r // result array ){ // initialize object and result r=[]; // iterate over object keys for (k in o) // fill result array with non-prototypical keys r.hasOwnProperty.call(o, k) && r.push(k); // return result return r; }; } // set data-selected on select element if the value has been programmatically selected // prior to initialization of bootstrap-select // * consider removing or replacing an alternative method * var valHooks = { useDefault: false, _set: $.valHooks.select.set }; $.valHooks.select.set = function(elem, value) { if (value && !valHooks.useDefault) $(elem).data('selected', true); return valHooks._set.apply(this, arguments); }; var changed_arguments = null; var EventIsSupported = (function() { try { new Event('change'); return true; } catch (e) { return false; } })(); $.fn.triggerNative = function (eventName) { var el = this[0], event; if (el.dispatchEvent) { // for modern browsers & IE9+ if (EventIsSupported) { // For modern browsers event = new Event(eventName, { bubbles: true }); } else { // For IE since it doesn't support Event constructor event = document.createEvent('Event'); event.initEvent(eventName, true, false); } el.dispatchEvent(event); } else if (el.fireEvent) { // for IE8 event = document.createEventObject(); event.eventType = eventName; el.fireEvent('on' + eventName, event); } else { // fall back to jQuery.trigger this.trigger(eventName); } }; //</editor-fold> // Case insensitive contains search $.expr.pseudos.icontains = function (obj, index, meta) { var $obj = $(obj).find('a'); var haystack = ($obj.data('tokens') || $obj.text()).toString().toUpperCase(); return haystack.includes(meta[3].toUpperCase()); }; // Case insensitive begins search $.expr.pseudos.ibegins = function (obj, index, meta) { var $obj = $(obj).find('a'); var haystack = ($obj.data('tokens') || $obj.text()).toString().toUpperCase(); return haystack.startsWith(meta[3].toUpperCase()); }; // Case and accent insensitive contains search $.expr.pseudos.aicontains = function (obj, index, meta) { var $obj = $(obj).find('a'); var haystack = ($obj.data('tokens') || $obj.data('normalizedText') || $obj.text()).toString().toUpperCase(); return haystack.includes(meta[3].toUpperCase()); }; // Case and accent insensitive begins search $.expr.pseudos.aibegins = function (obj, index, meta) { var $obj = $(obj).find('a'); var haystack = ($obj.data('tokens') || $obj.data('normalizedText') || $obj.text()).toString().toUpperCase(); return haystack.startsWith(meta[3].toUpperCase()); }; /** * Remove all diatrics from the given text. * @access private * @param {String} text * @returns {String} */ function normalizeToBase(text) { var rExps = [ {re: /[\xC0-\xC6]/g, ch: "A"}, {re: /[\xE0-\xE6]/g, ch: "a"}, {re: /[\xC8-\xCB]/g, ch: "E"}, {re: /[\xE8-\xEB]/g, ch: "e"}, {re: /[\xCC-\xCF]/g, ch: "I"}, {re: /[\xEC-\xEF]/g, ch: "i"}, {re: /[\xD2-\xD6]/g, ch: "O"}, {re: /[\xF2-\xF6]/g, ch: "o"}, {re: /[\xD9-\xDC]/g, ch: "U"}, {re: /[\xF9-\xFC]/g, ch: "u"}, {re: /[\xC7-\xE7]/g, ch: "c"}, {re: /[\xD1]/g, ch: "N"}, {re: /[\xF1]/g, ch: "n"} ]; $.each(rExps, function () { text = text ? text.replace(this.re, this.ch) : ''; }); return text; } // List of HTML entities for escaping. var escapeMap = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''', '`': '`' }; var unescapeMap = { '&': '&', '<': '<', '>': '>', '"': '"', ''': "'", '`': '`' }; // Functions for escaping and unescaping strings to/from HTML interpolation. var createEscaper = function(map) { var escaper = function(match) { return map[match]; }; // Regexes for identifying a key that needs to be escaped. var source = '(?:' + Object.keys(map).join('|') + ')'; var testRegexp = RegExp(source); var replaceRegexp = RegExp(source, 'g'); return function(string) { string = string == null ? '' : '' + string; return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; }; }; var htmlEscape = createEscaper(escapeMap); var htmlUnescape = createEscaper(unescapeMap); var Selectpicker = function (element, options) { // bootstrap-select has been initialized - revert valHooks.select.set back to its original function if (!valHooks.useDefault) { $.valHooks.select.set = valHooks._set; valHooks.useDefault = true; } this.$element = $(element); this.$newElement = null; this.$button = null; this.$menu = null; this.$lis = null; this.options = options; // If we have no title yet, try to pull it from the html title attribute (jQuery doesnt' pick it up as it's not a // data-attribute) if (this.options.title === null) { this.options.title = this.$element.attr('title'); } // Format window padding var winPad = this.options.windowPadding; if (typeof winPad === 'number') { this.options.windowPadding = [winPad, winPad, winPad, winPad]; } //Expose public methods this.val = Selectpicker.prototype.val; this.render = Selectpicker.prototype.render; this.refresh = Selectpicker.prototype.refresh; this.setStyle = Selectpicker.prototype.setStyle; this.selectAll = Selectpicker.prototype.selectAll; this.deselectAll = Selectpicker.prototype.deselectAll; this.destroy = Selectpicker.prototype.destroy; this.remove = Selectpicker.prototype.remove; this.show = Selectpicker.prototype.show; this.hide = Selectpicker.prototype.hide; this.init(); }; Selectpicker.VERSION = '1.12.4'; // part of this is duplicated in i18n/defaults-en_US.js. Make sure to update both. Selectpicker.DEFAULTS = { noneSelectedText: 'Nothing selected', noneResultsText: 'No results matched {0}', addNewText: '<strong>Add new:</strong> {0}', countSelectedText: function (numSelected, numTotal) { return (numSelected == 1) ? "{0} item selected" : "{0} items selected"; }, maxOptionsText: function (numAll, numGroup) { return [ (numAll == 1) ? 'Limit reached ({n} item max)' : 'Limit reached ({n} items max)', (numGroup == 1) ? 'Group limit reached ({n} item max)' : 'Group limit reached ({n} items max)' ]; }, selectAllText: 'Select All', deselectAllText: 'Deselect All', doneButton: false, doneButtonText: 'Close', multipleSeparator: ', ', styleBase: 'btn', style: 'btn-default', size: 'auto', title: null, selectedTextFormat: 'values', width: false, container: false, hideDisabled: false, showSubtext: false, showIcon: true, showContent: true, dropupAuto: true, header: false, liveSearch: false, liveSearchPlaceholder: null, liveSearchNormalize: false, liveSearchStyle: 'contains', addResults: false, actionsBox: false, iconBase: 'glyphicon', tickIcon: 'glyphicon-ok', showTick: false, template: { caret: '<span class="caret"></span>' }, maxOptions: false, mobile: false, selectOnTab: false, dropdownAlignRight: false, windowPadding: 0 }; Selectpicker.prototype = { constructor: Selectpicker, init: function () { var that = this, id = this.$element.attr('id'); // remember that we are doing the init this.options.initInProcess = true; if (this.options.width === 'auto' && this.options.lazyLoadLiElements === true) { // creates a bit of a problem for us. we would need to render the LIs to figure out their width // that is what lazyLoading is all about avoiding. these options are incompatible // tell somebody and opt out of lazy load console.log('Selectpicker option lazyLoadLiElements=true is incompatible with option width="auto". Option \'lazyLoadLiElements\' has been reset to false, however this may cause serious performance degradation.'); this.options.lazyLoadLiElements = false; } this.$element.addClass('bs-select-hidden'); // store originalIndex (key) and newIndex (value) in this.liObj for fast accessibility // allows us to do this.$lis.eq(that.liObj[index]) instead of this.$lis.filter('[data-original-index="' + index + '"]') this.liObj = {}; this.multiple = this.$element.prop('multiple'); this.autofocus = this.$element.prop('autofocus'); this.$newElement = this.createView(); this.$element .after(this.$newElement) .appendTo(this.$newElement); this.$button = this.$newElement.children('button'); this.$menu = this.$newElement.children('.dropdown-menu'); this.$menuInner = this.$menu.children('.inner'); this.$searchbox = this.$menu.find('input'); this.$element.removeClass('bs-select-hidden'); if (this.options.dropdownAlignRight === true) this.$menu.addClass('dropdown-menu-right'); if (typeof id !== 'undefined') { this.$button.attr('data-id', id); $('label[for="' + id + '"]').click(function (e) { e.preventDefault(); that.$button.focus(); }); } this.checkDisabled(); this.clickListener(); // we lazy loaded this select picker, so we need to make sure // that we finish the rendering the first time someone actually activates // the menu if (this.options.lazyLoadLiElements === true) { this.$button.one('click.dropdown.data-api', function (e) { // render the menu that.$lis = null; that.liObj = {}; that.reloadLi(); that.render(); that.checkDisabled(); that.liHeight(true); that.setStyle(); that.setWidth(); }); } if (this.options.liveSearch) this.liveSearchListener(); this.render(); this.setStyle(); this.setWidth(); if (this.options.container) this.selectPosition(); this.$menu.data('this', this); this.$newElement.data('this', this); if (this.options.mobile) this.mobile(); this.$newElement.on({ 'hide.bs.dropdown': function (e) { that.$menuInner.attr('aria-expanded', false); that.$element.trigger('hide.bs.select', e); }, 'hidden.bs.dropdown': function (e) { that.$element.trigger('hidden.bs.select', e); }, 'show.bs.dropdown': function (e) { that.$menuInner.attr('aria-expanded', true); that.$element.trigger('show.bs.select', e); }, 'shown.bs.dropdown': function (e) { that.$element.trigger('shown.bs.select', e); } }); if (that.$element[0].hasAttribute('required')) { this.$element.on('invalid', function () { that.$button.addClass('bs-invalid'); that.$element.on({ 'focus.bs.select': function () { that.$button.focus(); that.$element.off('focus.bs.select'); }, 'shown.bs.select': function () { that.$element .val(that.$element.val()) // set the value to hide the validation message in Chrome when menu is opened .off('shown.bs.select'); }, 'rendered.bs.select': function () { // if select is no longer invalid, remove the bs-invalid class if (this.validity.valid) that.$button.removeClass('bs-invalid'); that.$element.off('rendered.bs.select'); } }); that.$button.on('blur.bs.select', function() { that.$element.focus().blur(); that.$button.off('blur.bs.select'); }); }); } setTimeout(function () { that.$element.trigger('loaded.bs.select'); }); this.options.initInProcess = false; }, createDropdown: function () { // Options // If we are multiple or showTick option is set, then add the show-tick class var showTick = (this.multiple || this.options.showTick) ? ' show-tick' : '', inputGroup = this.$element.parent().hasClass('input-group') ? ' input-group-btn' : '', autofocus = this.autofocus ? ' autofocus' : ''; // Elements var header = this.options.header ? '<div class="popover-title"><button type="button" class="close" aria-hidden="true">×</button>' + this.options.header + '</div>' : ''; var searchbox = this.options.liveSearch ? '<div class="bs-searchbox">' + '<input type="text" class="form-control" autocomplete="off"' + (null === this.options.liveSearchPlaceholder ? '' : ' placeholder="' + htmlEscape(this.options.liveSearchPlaceholder) + '"') + ' role="textbox" aria-label="Search">' + '</div>' : ''; var actionsbox = this.multiple && this.options.actionsBox ? '<div class="bs-actionsbox">' + '<div class="btn-group btn-group-sm btn-block">' + '<button type="button" class="actions-btn bs-select-all btn btn-default">' + this.options.selectAllText + '</button>' + '<button type="button" class="actions-btn bs-deselect-all btn btn-default">' + this.options.deselectAllText + '</button>' + '</div>' + '</div>' : ''; var donebutton = this.multiple && this.options.doneButton ? '<div class="bs-donebutton">' + '<div class="btn-group btn-block">' + '<button type="button" class="btn btn-sm btn-default">' + this.options.doneButtonText + '</button>' + '</div>' + '</div>' : ''; var drop = '<div class="btn-group bootstrap-select' + showTick + inputGroup + '">' + '<button type="button" class="' + this.options.styleBase + ' dropdown-toggle" data-toggle="dropdown"' + autofocus + ' role="button" aria-labelledby="'+this.$element.attr("aria-labelledby")+'">' + '<span class="filter-option pull-left"></span> ' + '<span class="bs-caret">' + this.options.template.caret + '</span>' + '</button>' + '<div class="dropdown-menu open" role="combobox">' + header + searchbox + actionsbox + '<ul class="dropdown-menu inner" role="listbox" aria-expanded="false">' + '</ul>' + donebutton + '</div>' + '</div>'; return $(drop); }, createView: function () { var $drop = this.createDropdown(), li = this.createLi(); $drop.find('ul')[0].innerHTML = li; return $drop; }, reloadLi: function () { // rebuild var li = this.createLi(); this.$menuInner[0].innerHTML = li; }, createLi: function () { var that = this, _li = [], optID = 0, titleOption = document.createElement('option'), liIndex = -1; // increment liIndex whenever a new <li> element is created to ensure liObj is correct // Helper functions /** * @param content * @param [index] * @param [classes] * @param [optgroup] * @returns {string} */ var generateLI = function (content, index, classes, optgroup) { return '<li' + ((typeof classes !== 'undefined' && '' !== classes) ? ' class="' + classes + '"' : '') + ((typeof index !== 'undefined' && null !== index) ? ' data-original-index="' + index + '"' : '') + ((typeof optgroup !== 'undefined' && null !== optgroup) ? 'data-optgroup="' + optgroup + '"' : '') + '>' + content + '</li>'; }; /** * @param text * @param [classes] * @param [inline] * @param [tokens] * @returns {string} */ var generateA = function (text, classes, inline, tokens) { return '<a tabindex="0"' + (typeof classes !== 'undefined' ? ' class="' + classes + '"' : '') + (inline ? ' style="' + inline + '"' : '') + (that.options.liveSearchNormalize ? ' data-normalized-text="' + normalizeToBase(htmlEscape($(text).html())) + '"' : '') + (typeof tokens !== 'undefined' || tokens !== null ? ' data-tokens="' + tokens + '"' : '') + ' role="option">' + text + '<span class="' + that.options.iconBase + ' ' + that.options.tickIcon + ' check-mark"></span>' + '</a>'; }; if (this.options.title && !this.multiple) { // this option doesn't create a new <li> element, but does add a new option, so liIndex is decreased // since liObj is recalculated on every refresh, liIndex needs to be decreased even if the titleOption is already appended liIndex--; if (!this.$element.find('.bs-title-option').length) { // Use native JS to prepend option (faster) var element = this.$element[0]; titleOption.className = 'bs-title-option'; titleOption.innerHTML = this.options.title; titleOption.value = ''; element.insertBefore(titleOption, element.firstChild); // Check if selected or data-selected attribute is already set on an option. If not, select the titleOption option. // the selected item may have been changed by user or programmatically before the bootstrap select plugin runs, // if so, the select will have the data-selected attribute var $opt = $(element.options[element.selectedIndex]); if ($opt.attr('selected') === undefined && this.$element.data('selected') === undefined) { titleOption.selected = true; } } } if (!this.options.initInProcess || this.options.lazyLoadLiElements !== true) { // skip LI creation when lazy loading var $selectOptions = this.$element.find('option'); $selectOptions.each(function (index) { var $this = $(this); liIndex++; if ($this.hasClass('bs-title-option')) return; // Get the class and text for the option var optionClass = this.className || '', inline = htmlEscape(this.style.cssText), text = $this.data('content') ? $this.data('content') : $this.html(), tokens = $this.data('tokens') ? $this.data('tokens') : null, subtext = typeof $this.data('subtext') !== 'undefined' ? '<small class="text-muted">' + $this.data('subtext') + '</small>' : '', icon = typeof $this.data('icon') !== 'undefined' ? '<span class="' + that.options.iconBase + ' ' + $this.data('icon') + '"></span> ' : '', $parent = $this.parent(), isOptgroup = $parent[0].tagName === 'OPTGROUP', isOptgroupDisabled = isOptgroup && $parent[0].disabled, isDisabled = this.disabled || isOptgroupDisabled, prevHiddenIndex; if (icon !== '' && isDisabled) { icon = '<span>' + icon + '</span>'; } if (that.options.hideDisabled && (isDisabled && !isOptgroup || isOptgroupDisabled)) { // set prevHiddenIndex - the index of the first hidden option in a group of hidden options // used to determine whether or not a divider should be placed after an optgroup if there are // hidden options between the optgroup and the first visible option prevHiddenIndex = $this.data('prevHiddenIndex'); $this.next().data('prevHiddenIndex', (prevHiddenIndex !== undefined ? prevHiddenIndex : index)); liIndex--; return; } if (!$this.data('content')) { // Prepend any icon and append any subtext to the main text. text = icon + '<span class="text">' + text + subtext + '</span>'; } if (isOptgroup && $this.data('divider') !== true) { if (that.options.hideDisabled && isDisabled) { if ($parent.data('allOptionsDisabled') === undefined) { var $options = $parent.children(); $parent.data('allOptionsDisabled', $options.filter(':disabled').length === $options.length); } if ($parent.data('allOptionsDisabled')) { liIndex--; return; } } var optGroupClass = ' ' + $parent[0].className || ''; if ($this.index() === 0) { // Is it the first option of the optgroup? optID += 1; // Get the opt group label var label = $parent[0].label, labelSubtext = typeof $parent.data('subtext') !== 'undefined' ? '<small class="text-muted">' + $parent.data('subtext') + '</small>' : '', labelIcon = $parent.data('icon') ? '<span class="' + that.options.iconBase + ' ' + $parent.data('icon') + '"></span> ' : ''; label = labelIcon + '<span class="text">' + htmlEscape(label) + labelSubtext + '</span>'; if (index !== 0 && _li.length > 0) { // Is it NOT the first option of the select && are there elements in the dropdown? liIndex++; _li.push(generateLI('', null, 'divider', optID + 'div')); } liIndex++; _li.push(generateLI(label, null, 'dropdown-header' + optGroupClass, optID)); } if (that.options.hideDisabled && isDisabled) { liIndex--; return; } _li.push(generateLI(generateA(text, 'opt ' + optionClass + optGroupClass, inline, tokens), index, '', optID)); } else if ($this.data('divider') === true) { _li.push(generateLI('', index, 'divider')); } else if ($this.data('hidden') === true) { // set prevHiddenIndex - the index of the first hidden option in a group of hidden options // used to determine whether or not a divider should be placed after an optgroup if there are // hidden options between the optgroup and the first visible option prevHiddenIndex = $this.data('prevHiddenIndex'); $this.next().data('prevHiddenIndex', (prevHiddenIndex !== undefined ? prevHiddenIndex : index)); _li.push(generateLI(generateA(text, optionClass, inline, tokens), index, 'hidden is-hidden')); } else { var showDivider = this.previousElementSibling && this.previousElementSibling.tagName === 'OPTGROUP'; // if previous element is not an optgroup and hideDisabled is true if (!showDivider && that.options.hideDisabled) { prevHiddenIndex = $this.data('prevHiddenIndex'); if (prevHiddenIndex !== undefined) { // select the element **before** the first hidden element in the group var prevHidden = $selectOptions.eq(prevHiddenIndex)[0].previousElementSibling; if (prevHidden && prevHidden.tagName === 'OPTGROUP' && !prevHidden.disabled) { showDivider = true; } } } if (showDivider) { liIndex++; _li.push(generateLI('', null, 'divider', optID + 'div')); } _li.push(generateLI(generateA(text, optionClass, inline, tokens), index)); } that.liObj[index] = liIndex; }); } // end if for skipping li creation when lazy loading //If we are not multiple, we don't have a selected item, and we don't have a title, select the first element so something is set in the button if (!this.multiple && this.$element.find('option:selected').length === 0 && !this.options.title) { this.$element.find('option').eq(0).prop('selected', true).attr('selected', 'selected'); } return _li.join(''); }, findLis: function () { if (this.$lis == null) this.$lis = this.$menu.find('li'); return this.$lis; }, /** * @param [updateLi] defaults to true */ render: function (updateLi) { var that = this, notDisabled, $selectOptions = this.$element.find('option'); //Update the LI to match the SELECT if (updateLi !== false && (!this.options.initInProcess || this.options.lazyLoadLiElements !== true)) { // skip this if we are lazy loading $selectOptions.each(function (index) { var $lis = that.findLis().eq(that.liObj[index]); that.setDisabled(index, this.disabled || this.parentNode.tagName === 'OPTGROUP' && this.parentNode.disabled, $lis); that.setSelected(index, this.selected, $lis); }); } this.togglePlaceholder(); this.tabIndex(); var createOptionText = function(opt){ if (that.options.hideDisabled && (opt.disabled || opt.parentNode.tagName === 'OPTGROUP' && opt.parentNode.disabled)) return; var $this = $(opt), icon = $this.data('icon') && that.options.showIcon ? '<i class="' + that.options.iconBase + ' ' + $this.data('icon') + '"></i> ' : '', subtext; if (that.options.showSubtext && $this.data('subtext') && !that.multiple) { subtext = ' <small class="text-muted">' + $this.data('subtext') + '</small>'; } else { subtext = ''; } if (typeof $this.attr('title') !== 'undefined') { return $this.attr('title'); } else if ($this.data('content') && that.options.showContent) { return $this.data('content').toString(); } else { return icon + $this.html() + subtext; } }; var selectedItems = (this.multiple || this.options.singleSelectPerfTweak !== true ? $selectOptions.map(function () { if (this.selected) { return createOptionText(this); } }).toArray() : // only single select - do not need to iterate every single option [ createOptionText(this.$element[0][this.$element[0].selectedIndex]) ] ); //Fixes issue in IE10 occurring when no default option is selected and at least one option is disabled //Convert all the values into a comma delimited string var title = !this.multiple ? selectedItems[0] : selectedItems.join(this.options.multipleSeparator); //If this is multi select, and the selectText type is count, the show 1 of 2 selected etc.. if (this.multiple && this.options.selectedTextFormat.indexOf('count') > -1) { var max = this.options.selectedTextFormat.split('>'); if ((max.length > 1 && selectedItems.length > max[1]) || (max.length == 1 && selectedItems.length >= 2)) { notDisabled = this.options.hideDisabled ? ', [disabled]' : ''; var totalCount = $selectOptions.not('[data-divider="true"], [data-hidden="true"]' + notDisabled).length, tr8nText = (typeof this.options.countSelectedText === 'function') ? this.options.countSelectedText(selectedItems.length, totalCount) : this.options.countSelectedText; title = tr8nText.replace('{0}', selectedItems.length.toString()).replace('{1}', totalCount.toString()); } } if (this.options.title == undefined) { this.options.title = this.$element.attr('title'); } if (this.options.selectedTextFormat == 'static') { title = this.options.title; } //If we dont have a title, then use the default, or if nothing is set at all, use the not selected text if (!title) { title = typeof this.options.title !== 'undefined' ? this.options.title : this.options.noneSelectedText; } //strip all HTML tags and trim the result, then unescape any escaped tags this.$button.attr('title', htmlUnescape($.trim(title.replace(/<[^>]*>?/g, '')))); this.$button.children('.filter-option').html(title); if (!this.options.initInProcess || this.options.lazyLoadLiElements !== true) { // this is very expensive on IE and we haven;t really rendered the select if we are lazy loading, so hold off on this event this.$element.trigger('rendered.bs.select'); } }, /** * @param [style] * @param [status] */ setStyle: function (style, status) { if (this.$element.attr('class')) { this.$newElement.addClass(this.$element.attr('class').replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi, '')); } var buttonClass = style ? style : this.options.style; if (status == 'add') { this.$button.addClass(buttonClass); } else if (status == 'remove') { this.$button.removeClass(buttonClass); } else { this.$button.removeClass(this.options.style); this.$button.addClass(buttonClass); } }, liHeight: function (refresh) { if (!refresh && (this.options.size === false || this.sizeInfo)) return; var newElement = document.createElement('div'), menu = document.createElement('div'), menuInner = document.createElement('ul'), divider = document.createElement('li'), li = document.createElement('li'), a = document.createElement('a'), text = document.createElement('span'), header = this.options.header && this.$menu.find('.popover-title').length > 0 ? this.$menu.find('.popover-title')[0].cloneNode(true) : null, search = this.options.liveSearch ? document.createElement('div') : null, actions = this.options.actionsBox && this.multiple && this.$menu.find('.bs-actionsbox').length > 0 ? this.$menu.find('.bs-actionsbox')[0].cloneNode(true) : null, doneButton = this.options.doneButton && this.multiple && this.$menu.find('.bs-donebutton').length > 0 ? this.$menu.find('.bs-donebutton')[0].cloneNode(true) : null; text.className = 'text'; newElement.className = this.$menu[0].parentNode.className + ' open'; menu.className = 'dropdown-menu open'; menuInner.className = 'dropdown-menu inner'; divider.className = 'divider'; text.appendChild(document.createTextNode('Inner text')); a.appendChild(text); li.appendChild(a); menuInner.appendChild(li); menuInner.appendChild(divider); if (header) menu.appendChild(header); if (search) { var input = document.createElement('input'); search.className = 'bs-searchbox'; input.className = 'form-control'; search.appendChild(input); menu.appendChild(search); } if (actions) menu.appendChild(actions); menu.appendChild(menuInner); if (doneButton) menu.appendChild(doneButton); newElement.appendChild(menu); document.body.appendChild(newElement); var liHeight = a.offsetHeight, headerHeight = header ? header.offsetHeight : 0, searchHeight = search ? search.offsetHeight : 0, actionsHeight = actions ? actions.offsetHeight : 0, doneButtonHeight = doneButton ? doneButton.offsetHeight : 0, dividerHeight = $(divider).outerHeight(true), // fall back to jQuery if getComputedStyle is not supported menuStyle = typeof getComputedStyle === 'function' ? getComputedStyle(menu) : false, $menu = menuStyle ? null : $(menu), menuPadding = { vert: parseInt(menuStyle ? menuStyle.paddingTop : $menu.css('paddingTop')) + parseInt(menuStyle ? menuStyle.paddingBottom : $menu.css('paddingBottom')) + parseInt(menuStyle ? menuStyle.borderTopWidth : $menu.css('borderTopWidth')) + parseInt(menuStyle ? menuStyle.borderBottomWidth : $menu.css('borderBottomWidth')), horiz: parseInt(menuStyle ? menuStyle.paddingLeft : $menu.css('paddingLeft')) + parseInt(menuStyle ? menuStyle.paddingRight : $menu.css('paddingRight')) + parseInt(menuStyle ? menuStyle.borderLeftWidth : $menu.css('borderLeftWidth')) + parseInt(menuStyle ? menuStyle.borderRightWidth : $menu.css('borderRightWidth')) }, menuExtras = { vert: menuPadding.vert + parseInt(menuStyle ? menuStyle.marginTop : $menu.css('marginTop')) + parseInt(menuStyle ? menuStyle.marginBottom : $menu.css('marginBottom')) + 2, horiz: menuPadding.horiz + parseInt(menuStyle ? menuStyle.marginLeft : $menu.css('marginLeft')) + parseInt(menuStyle ? menuStyle.marginRight : $menu.css('marginRight')) + 2 }; document.body.removeChild(newElement); this.sizeInfo = { liHeight: liHeight, headerHeight: headerHeight, searchHeight: searchHeight, actionsHeight: actionsHeight, doneButtonHeight: doneButtonHeight, dividerHeight: dividerHeight, menuPadding: menuPadding, menuExtras: menuExtras }; }, setSize: function () { this.findLis(); this.liHeight(); if (this.options.header) this.$menu.css('padding-top', 0); if (this.options.size === false) return; var that = this, $menu = this.$menu, $menuInner = this.$menuInner, $window = $(window), selectHeight = this.$newElement[0].offsetHeight, selectWidth = this.$newElement[0].offsetWidth, liHeight = this.sizeInfo.liHeight, headerHeight = this.sizeInfo.headerHeight, searchHeight = this.sizeInfo.searchHeight, actionsHeight = this.sizeInfo.actionsHeight, doneButtonHeight = this.sizeInfo.doneButtonHeight, divHeight = this.sizeInfo.dividerHeight, menuPadding = this.sizeInfo.menuPadding, menuExtras = this.sizeInfo.menuExtras, notDisabled = this.options.hideDisabled ? '.disabled' : '', menuHeight, menuWidth, getHeight, getWidth, selectOffsetTop, selectOffsetBot, selectOffsetLeft, selectOffsetRight, getPos = function() { var pos = that.$newElement.offset(), $container = $(that.options.container), containerPos; if (that.options.container && !$container.is('body')) { containerPos = $container.offset(); containerPos.top += parseInt($container.css('borderTopWidth')); containerPos.left += parseInt($container.css('borderLeftWidth')); } else { containerPos = { top: 0, left: 0 }; } var winPad = that.options.windowPadding; selectOffsetTop = pos.top - containerPos.top - $window.scrollTop(); selectOffsetBot = $window.height() - selectOffsetTop - selectHeight - containerPos.top - winPad[2]; selectOffsetLeft = pos.left - containerPos.left - $window.scrollLeft(); selectOffsetRight = $window.width() - selectOffsetLeft - selectWidth - containerPos.left - winPad[1]; selectOffsetTop -= winPad[0]; selectOffsetLeft -= winPad[3]; }; getPos(); if (this.options.size === 'auto') { var getSize = function () { var minHeight, hasClass = function (className, include) { return function (element) { if (include) { return (element.classList ? element.classList.contains(className) : $(element).hasClass(className)); } else { return !(element.classList ? element.classList.contains(className) : $(element).hasClass(className)); } }; }, lis = that.$menuInner[0].getElementsByTagName('li'), lisVisible = Array.prototype.filter ? Array.prototype.filter.call(lis, hasClass('hidden', false)) : that.$lis.not('.hidden'), optGroup = Array.prototype.filter ? Array.prototype.filter.call(lisVisible, hasClass('dropdown-header', true)) : lisVisible.filter('.dropdown-header'); getPos(); menuHeight = selectOffsetBot - menuExtras.vert; menuWidth = selectOffsetRight - menuExtras.horiz; if (that.options.container) { if (!$menu.data('height')) $menu.data('height', $menu.height()); getHeight = $menu.data('height'); if (!$menu.data('width')) $menu.data('width', $menu.width()); getWidth = $menu.data('width'); } else { getHeight = $menu.height(); getWidth = $menu.width(); } if (that.options.dropupAuto) { that.$newElement.toggleClass('dropup', selectOffsetTop > selectOffsetBot && (menuHeight - menuExtras.vert) < getHeight); } if (that.$newElement.hasClass('dropup')) { menuHeight = selectOffsetTop - menuExtras.vert; } if (that.options.dropdownAlignRight === 'auto') { $menu.toggleClass('dropdown-menu-right', selectOffsetLeft > selectOffsetRight && (menuWidth - menuExtras.horiz) < (getWidth - selectWidth)); } if ((lisVisible.length + optGroup.length) > 3) { minHeight = liHeight * 3 + menuExtras.vert - 2; } else { minHeight = 0; } $menu.css({ 'max-height': menuHeight + 'px', 'overflow': 'hidden', 'min-height': minHeight + headerHeight + searchHeight + actionsHeight + doneButtonHeight + 'px' }); $menuInner.css({ 'max-height': menuHeight - headerHeight - searchHeight - actionsHeight - doneButtonHeight - menuPadding.vert + 'px', 'overflow-y': 'auto', 'min-height': Math.max(minHeight - menuPadding.vert, 0) + 'px' }); }; getSize(); this.$searchbox.off('input.getSize propertychange.getSize').on('input.getSize propertychange.getSize', getSize); $window.off('resize.getSize scroll.getSize').on('resize.getSize scroll.getSize', getSize); } else if (this.options.size && this.options.size != 'auto' && this.$lis.not(notDisabled).length > this.options.size) { var optIndex = this.$lis.not('.divider').not(notDisabled).children().slice(0, this.options.size).last().parent().index(), divLength = this.$lis.slice(0, optIndex + 1).filter('.divider').length; menuHeight = liHeight * this.options.size + divLength * divHeight + menuPadding.vert; if (that.options.container) { if (!$menu.data('height')) $menu.data('height', $menu.height()); getHeight = $menu.data('height'); } else { getHeight = $menu.height(); } if (that.options.dropupAuto) { //noinspection JSUnusedAssignment this.$newElement.toggleClass('dropup', selectOffsetTop > selectOffsetBot && (menuHeight - menuExtras.vert) < getHeight); } $menu.css({ 'max-height': menuHeight + headerHeight + searchHeight + actionsHeight + doneButtonHeight + 'px', 'overflow': 'hidden', 'min-height': '' }); $menuInner.css({ 'max-height': menuHeight - menuPadding.vert + 'px', 'overflow-y': 'auto', 'min-height': '' }); } }, setWidth: function () { if (this.options.width === 'auto') { this.$menu.css('min-width', '0'); // Get correct width if element is hidden var $selectClone = this.$menu.parent().clone().appendTo('body'), $selectClone2 = this.options.container ? this.$newElement.clone().appendTo('body') : $selectClone, ulWidth = $selectClone.children('.dropdown-menu').outerWidth(), btnWidth = $selectClone2.css('width', 'auto').children('button').outerWidth(); $selectClone.remove(); $selectClone2.remove(); // Set width to whatever's larger, button title or longest option this.$newElement.css('width', Math.max(ulWidth, btnWidth) + 'px'); } else if (this.options.width === 'fit') { // Remove inline min-width so width can be changed from 'auto' this.$menu.css('min-width', ''); this.$newElement.css('width', '').addClass('fit-width'); } else if (this.options.width) { // Remove inline min-width so width can be changed from 'auto' this.$menu.css('min-width', ''); this.$newElement.css('width', this.options.width); } else { // Remove inline min-width/width so width can be changed this.$menu.css('min-width', ''); this.$newElement.css('width', ''); } // Remove fit-width class if width is changed programmatically if (this.$newElement.hasClass('fit-width') && this.options.width !== 'fit') { this.$newElement.removeClass('fit-width'); } }, selectPosition: function () { this.$bsContainer = $('<div class="bs-container" />'); var that = this, $container = $(this.options.container), pos, containerPos, actualHeight, getPlacement = function ($element) { that.$bsContainer.addClass($element.attr('class').replace(/form-control|fit-width/gi, '')).toggleClass('dropup', $element.hasClass('dropup')); pos = $element.offset(); if (!$container.is('body')) { containerPos = $container.offset(); containerPos.top += parseInt($container.css('borderTopWidth')) - $container.scrollTop(); containerPos.left += parseInt($container.css('borderLeftWidth')) - $container.scrollLeft(); } else { containerPos = { top: 0, left: 0 }; } actualHeight = $element.hasClass('dropup') ? 0 : $element[0].offsetHeight; that.$bsContainer.css({ 'top': pos.top - containerPos.top + actualHeight, 'left': pos.left - containerPos.left, 'width': $element[0].offsetWidth }); }; this.$button.on('click', function () { var $this = $(this); if (that.isDisabled()) { return; } getPlacement(that.$newElement); that.$bsContainer .appendTo(that.options.container) .toggleClass('open', !$this.hasClass('open')) .append(that.$menu); }); $(window).on('resize scroll', function () { getPlacement(that.$newElement); }); this.$element.on('hide.bs.select', function () { that.$menu.data('height', that.$menu.height()); that.$bsContainer.detach(); }); }, /** * @param {number} index - the index of the option that is being changed * @param {boolean} selected - true if the option is being selected, false if being deselected * @param {JQuery} $lis - the 'li' element that is being modified */ setSelected: function (index, selected, $lis) { if (!$lis) { this.togglePlaceholder(); // check if setSelected is being called by changing the value of the select $lis = this.findLis().eq(this.liObj[index]); } $lis.toggleClass('selected', selected).find('a').attr('aria-selected', selected); }, /** * @param {number} index - the index of the option that is being disabled * @param {boolean} disabled - true if the option is being disabled, false if being enabled * @param {JQuery} $lis - the 'li' element that is being modified */ setDisabled: function (index, disabled, $lis) { if (!$lis) { $lis = this.findLis().eq(this.liObj[index]); } if (disabled) { $lis.addClass('disabled').children('a').attr('href', '#').attr('tabindex', -1).attr('aria-disabled', true); } else { $lis.removeClass('disabled').children('a').removeAttr('href').attr('tabindex', 0).attr('aria-disabled', false); } }, isDisabled: function () { return this.$element[0].disabled; }, checkDisabled: function () { var that = this; if (this.isDisabled()) { this.$newElement.addClass('disabled'); this.$button.addClass('disabled').attr('tabindex', -1).attr('aria-disabled', true); } else { if (this.$button.hasClass('disabled')) { this.$newElement.removeClass('disabled'); this.$button.removeClass('disabled').attr('aria-disabled', false); } if (this.$button.attr('tabindex') == -1 && !this.$element.data('tabindex')) { this.$button.removeAttr('tabindex'); } } this.$button.click(function () { return !that.isDisabled(); }); }, togglePlaceholder: function () { var value = this.$element.val(); this.$button.toggleClass('bs-placeholder', value === null || value === '' || (value.constructor === Array && value.length === 0)); }, tabIndex: function () { if (this.$element.data('tabindex') !== this.$element.attr('tabindex') && (this.$element.attr('tabindex') !== -98 && this.$element.attr('tabindex') !== '-98')) { this.$element.data('tabindex', this.$element.attr('tabindex')); this.$button.attr('tabindex', this.$element.data('tabindex')); } this.$element.attr('tabindex', -98); }, clickListener: function () { var that = this, $document = $(document); $document.data('spaceSelect', false); this.$button.on('keyup', function (e) { if (/(32)/.test(e.keyCode.toString(10)) && $document.data('spaceSelect')) { e.preventDefault(); $document.data('spaceSelect', false); } }); //TODO: this should not happen before the list is initialised in case //lazy loading option is used. this.$button.on('click', function () { that.setSize(); }); this.$element.on('shown.bs.select', function () { if (!that.options.liveSearch && !that.multiple) { that.$menuInner.find('.selected a').focus(); } else if (!that.multiple) { var selectedIndex = that.liObj[that.$element[0].selectedIndex]; if (typeof selectedIndex !== 'number' || that.options.size === false) return; // scroll to selected option var offset = that.$lis.eq(selectedIndex)[0].offsetTop - that.$menuInner[0].offsetTop; offset = offset - that.$menuInner[0].offsetHeight/2 + that.sizeInfo.liHeight/2; that.$menuInner[0].scrollTop = offset; } }); this.$menuInner.on('click', 'li a', function (e) { var $this = $(this), clickedIndex = $this.parent().data('originalIndex'), prevValue = that.$element.val(), prevIndex = that.$element.prop('selectedIndex'), triggerChange = true; // Don't close on multi choice menu if (that.multiple && that.options.maxOptions !== 1) { e.stopPropagation(); } e.preventDefault(); //Don't run if we have been disabled if (!that.isDisabled() && !$this.parent().hasClass('disabled')) { var $options = that.$element.find('option'), $option = $options.eq(clickedIndex), state = $option.prop('selected'), $optgroup = $option.parent('optgroup'), maxOptions = that.options.maxOptions, maxOptionsGrp = $optgroup.data('maxOptions') || false; if (!that.multiple) { // Deselect all others if not multi select box $options.prop('selected', false); $option.prop('selected', true); that.$menuInner.find('.selected').removeClass('selected').find('a').attr('aria-selected', false); that.setSelected(clickedIndex, true); } else { // Toggle the one we have chosen if we are multi select. $option.prop('selected', !state); that.setSelected(clickedIndex, !state); $this.blur(); if (maxOptions !== false || maxOptionsGrp !== false) { var maxReached = maxOptions < $options.filter(':selected').length, maxReachedGrp = maxOptionsGrp < $optgroup.find('option:selected').length; if ((maxOptions && maxReached) || (maxOptionsGrp && maxReachedGrp)) { if (maxOptions && maxOptions == 1) { $options.prop('selected', false); $option.prop('selected', true); that.$menuInner.find('.selected').removeClass('selected'); that.setSelected(clickedIndex, true); } else if (maxOptionsGrp && maxOptionsGrp == 1) { $optgroup.find('option:selected').prop('selected', false); $option.prop('selected', true); var optgroupID = $this.parent().data('optgroup'); that.$menuInner.find('[data-optgroup="' + optgroupID + '"]').removeClass('selected'); that.setSelected(clickedIndex, true); } else { var maxOptionsText = typeof that.options.maxOptionsText === 'string' ? [that.options.maxOptionsText, that.options.maxOptionsText] : that.options.maxOptionsText, maxOptionsArr = typeof maxOptionsText === 'function' ? maxOptionsText(maxOptions, maxOptionsGrp) : maxOptionsText, maxTxt = maxOptionsArr[0].replace('{n}', maxOptions), maxTxtGrp = maxOptionsArr[1].replace('{n}', maxOptionsGrp), $notify = $('<div class="notify"></div>'); // If {var} is set in array, replace it /** @deprecated */ if (maxOptionsArr[2]) { maxTxt = maxTxt.replace('{var}', maxOptionsArr[2][maxOptions > 1 ? 0 : 1]); maxTxtGrp = maxTxtGrp.replace('{var}', maxOptionsArr[2][maxOptionsGrp > 1 ? 0 : 1]); } $option.prop('selected', false); that.$menu.append($notify); if (maxOptions && maxReached) { $notify.append($('<div>' + maxTxt + '</div>')); triggerChange = false; that.$element.trigger('maxReached.bs.select'); } if (maxOptionsGrp && maxReachedGrp) { $notify.append($('<div>' + maxTxtGrp + '</div>')); triggerChange = false; that.$element.trigger('maxReachedGrp.bs.select'); } setTimeout(function () { that.setSelected(clickedIndex, false); }, 10); $notify.delay(750).fadeOut(300, function () { $(this).remove(); }); } } } } if (!that.multiple || (that.multiple && that.options.maxOptions === 1)) { that.$button.focus(); } else if (that.options.liveSearch) { that.$searchbox.focus(); } // Trigger select 'change' if (triggerChange) { if ((prevValue != that.$element.val() && that.multiple) || (prevIndex != that.$element.prop('selectedIndex') && !that.multiple)) { // $option.prop('selected') is current option state (selected/unselected). state is previous option state. changed_arguments = [clickedIndex, $option.prop('selected'), state]; that.$element .triggerNative('change'); } } } }); this.$menu.on('click', 'li.disabled a, .popover-title, .popover-title :not(.close)', function (e) { if (e.currentTarget == this) { e.preventDefault(); e.stopPropagation(); if (that.options.liveSearch && !$(e.target).hasClass('close')) { that.$searchbox.focus(); } else { that.$button.focus(); } } }); this.$menuInner.on('click', '.divider, .dropdown-header', function (e) { e.preventDefault(); e.stopPropagation(); if (that.options.liveSearch) { that.$searchbox.focus(); } else { that.$button.focus(); } }); this.$menu.on('click', '.popover-title .close', function () { that.$button.click(); }); this.$searchbox.on('click', function (e) { e.stopPropagation(); }); this.$menu.on('click', '.actions-btn', function (e) { if (that.options.liveSearch) { that.$searchbox.focus(); } else { that.$button.focus(); } e.preventDefault(); e.stopPropagation(); if ($(this).hasClass('bs-select-all')) { that.selectAll(); } else { that.deselectAll(); } }); this.$element.change(function () { that.render(false); that.$element.trigger('changed.bs.select', changed_arguments); changed_arguments = null; }); }, liveSearchListener: function () { var that = this, $no_results = $('<li class="no-results"></li>'); this.$button.on('click.dropdown.data-api', function () { that.$menuInner.find('.active').removeClass('active'); if (!!that.$searchbox.val()) { that.$searchbox.val(''); that.$lis.not('.is-hidden').removeClass('hidden'); if (!!$no_results.parent().length) $no_results.remove(); } if (!that.multiple) that.$menuInner.find('.selected').addClass('active'); setTimeout(function () { that.$searchbox.focus(); }, 10); }); this.$searchbox.on('click.dropdown.data-api focus.dropdown.data-api touchend.dropdown.data-api', function (e) { e.stopPropagation(); }); this.$searchbox.on('input propertychange', function () { that.$lis.not('.is-hidden').removeClass('hidden'); that.$lis.filter('.active').removeClass('active'); $no_results.remove(); if (that.$searchbox.val()) { var $searchBase = that.$lis.not('.is-hidden, .divider, .dropdown-header'), $hideItems; if (that.options.liveSearchNormalize) { $hideItems = $searchBase.not(':a' + that._searchStyle() + '("' + normalizeToBase(that.$searchbox.val()) + '")'); } else { $hideItems = $searchBase.not(':' + that._searchStyle() + '("' + that.$searchbox.val() + '")'); } if ($hideItems.length === $searchBase.length) { $no_results.html(that.options.noneResultsText.replace('{0}', '"' + htmlEscape(that.$searchbox.val()) + '"')); that.$menuInner.append($no_results); that.$lis.addClass('hidden'); } else { $hideItems.addClass('hidden'); var $lisVisible = that.$lis.not('.hidden'), $foundDiv; // hide divider if first or last visible, or if followed by another divider $lisVisible.each(function (index) { var $this = $(this); if ($this.hasClass('divider')) { if ($foundDiv === undefined) { $this.addClass('hidden'); } else { if ($foundDiv) $foundDiv.addClass('hidden'); $foundDiv = $this; } } else if ($this.hasClass('dropdown-header') && $lisVisible.eq(index + 1).data('optgroup') !== $this.data('optgroup')) { $this.addClass('hidden'); } else { $foundDiv = null; } }); if ($foundDiv) $foundDiv.addClass('hidden'); $searchBase.not('.hidden').first().addClass('active'); that.$menuInner.scrollTop(0); } } }); }, _searchStyle: function () { var styles = { begins: 'ibegins', startsWith: 'ibegins' }; return styles[this.options.liveSearchStyle] || 'icontains'; }, val: function (value) { if (typeof value !== 'undefined') { this.$element.val(value); this.render(); return this.$element; } else { return this.$element.val(); } }, changeAll: function (status) { if (!this.multiple) return; if (typeof status === 'undefined') status = true; this.findLis(); var $options = this.$element.find('option'), $lisVisible = this.$lis.not('.divider, .dropdown-header, .disabled, .hidden'), lisVisLen = $lisVisible.length, selectedOptions = []; if (status) { if ($lisVisible.filter('.selected').length === $lisVisible.length) return; } else { if ($lisVisible.filter('.selected').length === 0) return; } $lisVisible.toggleClass('selected', status); for (var i = 0; i < lisVisLen; i++) { var origIndex = $lisVisible[i].getAttribute('data-original-index'); selectedOptions[selectedOptions.length] = $options.eq(origIndex)[0]; } $(selectedOptions).prop('selected', status); this.render(false); this.togglePlaceholder(); this.$element .triggerNative('change'); }, selectAll: function () { return this.changeAll(true); }, deselectAll: function () { return this.changeAll(false); }, toggle: function (e) { e = e || window.event; if (e) e.stopPropagation(); this.$button.trigger('click'); }, keydown: function (e) { var $this = $(this), $parent = $this.closest('div.dropdown-menu'), $items, that = $parent.data('this'), index, prevIndex, isActive, selector = ':not(.disabled, .hidden, .dropdown-header, .divider)', keyCodeMap = { 32: ' ', 48: '0', 49: '1', 50: '2', 51: '3', 52: '4', 53: '5', 54: '6', 55: '7', 56: '8', 57: '9', 59: ';', 65: 'a', 66: 'b', 67: 'c', 68: 'd', 69: 'e', 70: 'f', 71: 'g', 72: 'h', 73: 'i', 74: 'j', 75: 'k', 76: 'l', 77: 'm', 78: 'n', 79: 'o', 80: 'p', 81: 'q', 82: 'r', 83: 's', 84: 't', 85: 'u', 86: 'v', 87: 'w', 88: 'x', 89: 'y', 90: 'z', 96: '0', 97: '1', 98: '2', 99: '3', 100: '4', 101: '5', 102: '6', 103: '7', 104: '8', 105: '9' }; // we destroy the modal/popup using the ESC key and then turns out we get // here and the parent doesn't even exist anymore, in this case fail silently. // probably not the best idea, but works. if(!$parent.length) return false; isActive = that.$newElement.hasClass('open'); if (!isActive && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105 || e.keyCode >= 65 && e.keyCode <= 90)) { if (!that.options.container) { that.setSize(); that.$menu.parent().addClass('open'); isActive = true; } else { that.$button.trigger('click'); } that.$searchbox.focus(); return; } if (that.options.liveSearch) { if (/(^9$|27)/.test(e.keyCode.toString(10)) && isActive) { e.preventDefault(); e.stopPropagation(); that.$menuInner.click(); that.$button.focus(); } } if (/(38|40)/.test(e.keyCode.toString(10))) { $items = that.$lis.filter(selector); if (!$items.length) return; if (!that.options.liveSearch) { index = $items.index($items.find('a').filter(':focus').parent()); } else { index = $items.index($items.filter('.active')); } prevIndex = that.$menuInner.data('prevIndex'); if (e.keyCode == 38) { if ((that.options.liveSearch || index == prevIndex) && index != -1) index--; if (index < 0) index += $items.length; } else if (e.keyCode == 40) { if (that.options.liveSearch || index == prevIndex) index++; index = index % $items.length; } that.$menuInner.data('prevIndex', index); if (!that.options.liveSearch) { $items.eq(index).children('a').focus(); } else { e.preventDefault(); if (!$this.hasClass('dropdown-toggle')) { $items.removeClass('active').eq(index).addClass('active').children('a').focus(); $this.focus(); } } } else if (!$this.is('input')) { var keyIndex = [], count, prevKey; $items = that.$lis.filter(selector); $items.each(function (i) { if ($.trim($(this).children('a').text().toLowerCase()).substring(0, 1) == keyCodeMap[e.keyCode]) { keyIndex.push(i); } }); count = $(document).data('keycount'); count++; $(document).data('keycount', count); prevKey = $.trim($(':focus').text().toLowerCase()).substring(0, 1); if (prevKey != keyCodeMap[e.keyCode]) { count = 1; $(document).data('keycount', count); } else if (count >= keyIndex.length) { $(document).data('keycount', 0); if (count > keyIndex.length) count = 1; } $items.eq(keyIndex[count - 1]).children('a').focus(); } // Select focused option if "Enter", "Spacebar" or "Tab" (when selectOnTab is true) are pressed inside the menu. if ((/(13|32)/.test(e.keyCode.toString(10)) || (/(^9$)/.test(e.keyCode.toString(10)) && that.options.selectOnTab)) && isActive) { if (!/(32)/.test(e.keyCode.toString(10))) e.preventDefault(); if (!that.options.liveSearch) { var elem = $(':focus'); elem.click(); // Bring back focus for multiselects elem.focus(); // Prevent screen from scrolling if the user hit the spacebar e.preventDefault(); // Fixes spacebar selection of dropdown items in FF & IE $(document).data('spaceSelect', true); } else if (!/(32)/.test(e.keyCode.toString(10))) { that.$menuInner.find('.active a').click(); $this.focus(); } $(document).data('keycount', 0); } if ((/(^9$|27)/.test(e.keyCode.toString(10)) && isActive && (that.multiple || that.options.liveSearch)) || (/(27)/.test(e.keyCode.toString(10)) && !isActive)) { that.$menu.parent().removeClass('open'); if (that.options.container) that.$newElement.removeClass('open'); that.$button.focus(); } }, mobile: function () { this.$element.addClass('mobile-device'); }, refresh: function () { this.$lis = null; this.liObj = {}; this.reloadLi(); this.render(); this.checkDisabled(); this.liHeight(true); this.setStyle(); this.setWidth(); if (this.$lis) this.$searchbox.trigger('propertychange'); this.$element.trigger('refreshed.bs.select'); }, hide: function () { this.$newElement.hide(); }, show: function () { this.$newElement.show(); }, remove: function () { this.$newElement.remove(); this.$element.remove(); }, destroy: function () { this.$newElement.before(this.$element).remove(); if (this.$bsContainer) { this.$bsContainer.remove(); } else { this.$menu.remove(); } this.$element .off('.bs.select') .removeData('selectpicker') .removeClass('bs-select-hidden selectpicker'); } }; // SELECTPICKER PLUGIN DEFINITION // ============================== function Plugin(option) { // get the args of the outer function.. var args = arguments; // The arguments of the function are explicitly re-defined from the argument list, because the shift causes them // to get lost/corrupted in android 2.3 and IE9 #715 #775 var _option = option; [].shift.apply(args); var value; var chain = this.each(function () { var $this = $(this); if ($this.is('select')) { var data = $this.data('selectpicker'), options = typeof _option == 'object' && _option; if (!data) { var config = $.extend({}, Selectpicker.DEFAULTS, $.fn.selectpicker.defaults || {}, $this.data(), options); config.template = $.extend({}, Selectpicker.DEFAULTS.template, ($.fn.selectpicker.defaults ? $.fn.selectpicker.defaults.template : {}), $this.data().template, options.template); $this.data('selectpicker', (data = new Selectpicker(this, config))); } else if (options) { for (var i in options) { if (options.hasOwnProperty(i)) { data.options[i] = options[i]; } } } if (typeof _option == 'string') { if (data[_option] instanceof Function) { value = data[_option].apply(data, args); } else { value = data.options[_option]; } } } }); if (typeof value !== 'undefined') { //noinspection JSUnusedAssignment return value; } else { return chain; } } var old = $.fn.selectpicker; $.fn.selectpicker = Plugin; $.fn.selectpicker.Constructor = Selectpicker; // SELECTPICKER NO CONFLICT // ======================== $.fn.selectpicker.noConflict = function () { $.fn.selectpicker = old; return this; }; $(document) .data('keycount', 0) .on('keydown.bs.select', '.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role="listbox"], .bs-searchbox input', Selectpicker.prototype.keydown) .on('focusin.modal', '.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role="listbox"], .bs-searchbox input', function (e) { e.stopPropagation(); }); // SELECTPICKER DATA-API // ===================== $(window).on('load.bs.select.data-api', function () { $('.selectpicker').each(function () { var $selectpicker = $(this); Plugin.call($selectpicker, $selectpicker.data()); }); }); })(jQuery); }));;jQuery(function ($) { "use strict"; /* Select date */ var flight_to = ''; $('.input-daterange .amd_depart_date').each(function () { var form = $(this).closest('form'); var p = $(this).parent(); var me = $(this); $(this).datepicker({ language: st_params.locale, autoclose: !0, todayHighlight: !0, startDate: 'today', format: p.data('tp-date-format'), weekStart: 1, }).on('changeDate', function (e) { var m = e.date.getMonth() + 1; if ((e.date.getMonth() + 1) < 10) { m = '0' + m } var d = e.date.getDate(); if (e.date.getDate() < 10) { d = '0' + d } $(this).parent().find('.amd-date-from').val(e.date.getFullYear() + '-' + (m) + '-' + d); var new_date = e.date; new_date.setDate(new_date.getDate() + 0); $('.input-daterange .amd_return_date', form).datepicker("remove"); $('.input-daterange .amd_return_date', form).datepicker({ language: st_params.locale, startDate: '+0d', format: p.data('tp-date-format'), autoclose: !0, todayHighlight: !0, weekStart: 1 }); $('.input-daterange .amd_return_date', form).datepicker('setDates', new_date); $('.input-daterange .amd_return_date', form).datepicker('setStartDate', new_date); }); $('.input-daterange .amd_return_date', form).datepicker({ language: st_params.locale, startDate: '+0d', format: p.data('tp-date-format'), autoclose: !0, todayHighlight: !0, weekStart: 1 }).on('changeDate', function (e) { var m = e.date.getMonth() + 1; if ((e.date.getMonth() + 1) < 10) { m = '0' + m } var d = e.date.getDate(); if (e.date.getDate() < 10) { d = '0' + d } flight_to = e.date.getFullYear() + '-' + (m) + '-' + d; $(this).parent().find('.amd-date-to').val(flight_to); var del_html = '<i class="fa fa-times tp-icon-return-del"></i>'; if($('.input-daterange-return .tp-icon-return-del').length) $('.input-daterange-return .tp-icon-return-del').remove(); $('.input-daterange-return').append(del_html); }) }); $(document).on('click', '.tp-icon-return-del', function () { $('.input-daterange .amd_return_date').val(''); $('input.amd-date-to').val(''); $(this).remove(); }); /* End select date */ $('.amd-form-passengers .amd_group_display').on('click', function () { $(this).parent().find('.amd-form-passengers-class').toggleClass('none'); $(this).find('.fa').toggleClass('fa-chevron-up'); $(this).find('.fa').toggleClass('fa-chevron-down') }); $(document).on('keyup mouseup', '.amd-passengers-class input[name=adults]', function () { var sparent = $(this).closest('.amd-passengers-class'); if ($(this).val() == '') { //$(this).val(1) } else { var infants = $('input[name=infants]', sparent).val(); if(infants == '') infants = 0; var children = $('input[name=children]', sparent).val(); if(children == '') children = 0; var total = parseInt(infants) + parseInt(children) + parseInt($(this).val()); if (total > 9) { var adults = 9 - (parseInt(infants) + parseInt(children)); $(this).val(adults); $('.amd-form-passengers-class .notice').html($('.amd-form-passengers-class .notice').data('maxup')).fadeIn(); } else { $('.amd_group_display .quantity-passengers').text(total); $('.amd-form-passengers-class .notice').html('').fadeOut(); } } }); $(document).on('keyup mouseup', '.amd-passengers-class input[name=children]', function () { var sparent = $(this).closest('.amd-passengers-class'); if ($(this).val() == '') { //$(this).val(0) } else { var infants = $('input[name=infants]', sparent).val(); if(infants == '') infants = 0; var adults = $('input[name=adults]', sparent).val(); if(adults == '') adults = 0; var total = parseInt(infants) + parseInt(adults) + parseInt($(this).val()); if (total > 9) { var children = 9 - (parseInt(infants) + parseInt(adults)); $(this).val(children); $('.amd-form-passengers-class .notice').html($('.amd-form-passengers-class .notice').data('maxup')).fadeIn(); } else { $('.amd_group_display .quantity-passengers').text(total); $('.amd-form-passengers-class .notice').html('').fadeOut() } } }); $(document).on('keyup mouseup', '.amd-passengers-class input[name=infants]', function () { var sparent = $(this).closest('.amd-passengers-class'); if ($(this).val() == '') { //$(this).val(0) } else { var adults = $('input[name=adults]', sparent).val(); if(adults == '') adults = 0; var children = $('input[name=children]', sparent).val(); if(children == '') children = 0; var total = parseInt(adults) + parseInt(children) + parseInt($(this).val()); if (total > 9) { var infants = 9 - (parseInt(children) + parseInt(adults)); $(this).val(infants); $('.amd-form-passengers-class .notice').html($('.amd-form-passengers-class .notice').data('maxup')).fadeIn(); } else { if(parseInt($(this).val()) > adults){ $(this).val(adults); $('.amd-form-passengers-class .notice').html($('.amd-form-passengers-class .notice').data('maxinf')).fadeIn(); }else{ $('.amd_group_display .quantity-passengers').text(total); $('.amd-form-passengers-class .notice').html('').fadeOut() } } } }); $(document).on('focusout', '.amd-passengers-class input[name=adults]', function () { if ($(this).val() == '' || $(this).val() == 0) { $(this).val(1) } }); $(document).on('focusout', '.amd-passengers-class input[name=children], .amd-passengers-class input[name=infants]', function () { if ($(this).val() == '') { $(this).val(0) } }); /*var sparent = $('.amd-passengers-class'); var adults = $('input[name=adults]', sparent).val(); var children = $('input[name=children]', sparent).val(); var infants = $('input[name=infants]', sparent).val(); var total = parseInt(adults) + parseInt(children) + parseInt(infants); $('.amd_group_display .quantity-passengers').text(total);*/ var last_select_clicked = !1; $('.amd-flight-location').each(function () { var t = $(this); var parent = t.closest('.amd-flight-wrapper'); $(this).on('keyup', function (event) { last_select_clicked = t; parent.find('.st-location-id').remove(); var name = t.attr('data-name'); var locale = t.attr('data-locale'); var val = t.val(); if (val.length >= 2) { $.getJSON("https://api.sandbox.amadeus.com/v1.2/airports/autocomplete?apikey="+st_amadeus.apikey+"&term=" + val, function (data) { if (typeof data == 'object') { var html = ''; html += '<select name="' + name + '" class="st-location-id st-hidden" tabindex="-1">'; $.each(data, function (key, value) { var f_name = ''; if (value.label != null) { f_name = value.label; } html += '<option value="' + value.value + '">' + f_name + '</option>'; }); html += '</select>'; parent.find('.st-location-id').remove(); parent.append(html); html = ''; $('select option', parent).prop('selected', !1); $('select option', parent).each(function (index, el) { var text = $(this).text(); var highlight = get_highlight(text, val); if (highlight.indexOf('</span>') >= 0) { html += '<div data-text="' + text + '" data-value="' + $(this).val() + '" class="option">' + '<span class="label"><a href="#">' + text + ' <i class="fa fa-plane"></i></a>' + '</div>' } }); $('.option-wrapper').html(html).show(); t.caculatePosition($('.option-wrapper'), t) } }); } }); t.caculatePosition = function () { if (!last_select_clicked || !last_select_clicked.length) return; var wraper = $('.option-wrapper'); var input_tag = last_select_clicked; var offset = parent.offset(); var top = offset.top + parent.height(); var left = offset.left; var width = input_tag.outerWidth(); var wpadminbar = 0; if ($('#wpadminbar').length && $(window).width() >= 783) { wpadminbar = $('#wpadminbar').height() } else { wpadminbar = 0 } top = top - wpadminbar; var z_index = 99999; var position = 'absolute'; if ($('#search-dialog').length) { position = 'fixed'; top = top + wpadminbar - $(window).scrollTop(); z_index = 99999 } wraper.css({position: position, top: top, left: left, width: width, 'z-index': z_index}) }; $(window).on('resize', function () { t.caculatePosition() }) }); function get_highlight(text, val) { var highlight = text.replace(new RegExp(val + '(?!([^<]+)?>)', 'gi'), '<span class="highlight">$&</span>'); return highlight } jQuery(function ($) { $(document).ready(function () { $(document).on('click', '#tab-amadeus_aff_flight13 .btn-amd-search-flight', function (e) { e.preventDefault(); var form = $(this).closest('form'); var required = !1; $('input', form).each(function () { if($(this).prop('required')){ if ($(this).val() == '') { required = !0; $(this).addClass('error') } else { $(this).removeClass('error') } } }); if($('.amd-passengers-class input[name="adults"]').val() == 0 && $('.amd-passengers-class input[name="children"]').val() == 0 && $('.amd-passengers-class input[name="infants"]').val() == 0){ required = !0; $('.amd_group_display').addClass('error') }else{ $('.amd_group_display').removeClass('error') } if(!required) form.trigger('submit'); }); }); }); }); ;/** * Created by NASANJI on 12/20/2016. */ jQuery(function($){ //Upload Image $(document).on('click', '.wb-upload-fields .wb-upload-image', function(e){ e.preventDefault(); var media; var p = $(this).closest('.wb-upload-fields'); media = wp.media.frames.file_frame = wp.media({ title: 'Upload Image', button: { text: 'Select', }, multiple: false }); media.on('select', function(){ var attachment = media.state().get('selection').first().toJSON(); if( typeof attachment.url == 'string' && attachment.url != ''){ p.find('.wb-load-image').empty(); var html = ''; if(attachment.type == 'image') { p.find('.wb-load-image').removeClass('st-upload-media-type'); html = '<img src="' + attachment.url + '" alt="" class="frontend-image img-responsive">' + '<a class="delete" href="javascript:void(0);">×</a>'; }else if(attachment.type == 'application'){ html = '<div class="st-media-upload">'; html += '<span class="st-media-name">'+ attachment.filename +' (<small>'+ attachment.filesizeHumanReadable +'</small>)</span>'; html += '</div>'; html += '<a class="delete" href="javascript:void(0);">×</a>'; p.find('.wb-load-image').addClass('st-upload-media-type'); } p.find('.wb-load-image').append(html); } p.find('.wb-upload-image-save').val(attachment.id); }); media.open(); }); $(document).on('click', '.wb-load-image .delete', function (e) { e.preventDefault(); $(this).closest('.wb-upload-fields').find('.wb-load-image').empty(); $('.wb-upload-fields .wb-upload-image-save').val(''); }) }); ;"function"!=typeof Object.create&&(Object.create=function(t){function e(){}return e.prototype=t,new e}),function(t,e,o){var i={init:function(e,o){var i=this;i.$elem=t(o),i.options=t.extend({},t.fn.owlCarousel.options,i.$elem.data(),e),i.userOptions=e,i.loadContent()},loadContent:function(){function e(t){var e,o="";if("function"==typeof i.options.jsonSuccess)i.options.jsonSuccess.apply(this,[t]);else{for(e in t.owl)t.owl.hasOwnProperty(e)&&(o+=t.owl[e].item);i.$elem.html(o)}i.logIn()}var o,i=this;"function"==typeof i.options.beforeInit&&i.options.beforeInit.apply(this,[i.$elem]),"string"==typeof i.options.jsonPath?(o=i.options.jsonPath,t.getJSON(o,e)):i.logIn()},logIn:function(){var t=this;t.$elem.data({"owl-originalStyles":t.$elem.attr("style"),"owl-originalClasses":t.$elem.attr("class")}),t.$elem.css({opacity:0}),t.orignalItems=t.options.items,t.checkBrowser(),t.wrapperWidth=0,t.checkVisible=null,t.setVars()},setVars:function(){var t=this;return 0===t.$elem.children().length?!1:(t.baseClass(),t.eventTypes(),t.$userItems=t.$elem.children(),t.itemsAmount=t.$userItems.length,t.wrapItems(),t.$owlItems=t.$elem.find(".owl-item"),t.$owlWrapper=t.$elem.find(".owl-wrapper"),t.playDirection="next",t.prevItem=0,t.prevArr=[0],t.currentItem=0,t.customEvents(),void t.onStartup())},onStartup:function(){var t=this;t.updateItems(),t.calculateAll(),t.buildControls(),t.updateControls(),t.response(),t.moveEvents(),t.stopOnHover(),t.owlStatus(),t.options.transitionStyle!==!1&&t.transitionTypes(t.options.transitionStyle),t.options.autoPlay===!0&&(t.options.autoPlay=5e3),t.play(),t.$elem.find(".owl-wrapper").css("display","block"),t.$elem.is(":visible")?t.$elem.css("opacity",1):t.watchVisibility(),t.onstartup=!1,t.eachMoveUpdate(),"function"==typeof t.options.afterInit&&t.options.afterInit.apply(this,[t.$elem])},eachMoveUpdate:function(){var t=this;t.options.lazyLoad===!0&&t.lazyLoad(),t.options.autoHeight===!0&&t.autoHeight(),t.onVisibleItems(),"function"==typeof t.options.afterAction&&t.options.afterAction.apply(this,[t.$elem])},updateVars:function(){var t=this;"function"==typeof t.options.beforeUpdate&&t.options.beforeUpdate.apply(this,[t.$elem]),t.watchVisibility(),t.updateItems(),t.calculateAll(),t.updatePosition(),t.updateControls(),t.eachMoveUpdate(),"function"==typeof t.options.afterUpdate&&t.options.afterUpdate.apply(this,[t.$elem])},reload:function(){var t=this;e.setTimeout(function(){t.updateVars()},0)},watchVisibility:function(){var t=this;return t.$elem.is(":visible")!==!1?!1:(t.$elem.css({opacity:0}),e.clearInterval(t.autoPlayInterval),e.clearInterval(t.checkVisible),void(t.checkVisible=e.setInterval(function(){t.$elem.is(":visible")&&(t.reload(),t.$elem.animate({opacity:1},200),e.clearInterval(t.checkVisible))},500)))},wrapItems:function(){var t=this;t.$userItems.wrapAll('<div class="owl-wrapper">').wrap('<div class="owl-item"></div>'),t.$elem.find(".owl-wrapper").wrap('<div class="owl-wrapper-outer">'),t.wrapperOuter=t.$elem.find(".owl-wrapper-outer"),t.$elem.css("display","block")},baseClass:function(){var t=this,e=t.$elem.hasClass(t.options.baseClass),o=t.$elem.hasClass(t.options.theme);e||t.$elem.addClass(t.options.baseClass),o||t.$elem.addClass(t.options.theme)},updateItems:function(){var e,o,i=this;if(i.options.responsive===!1)return!1;if(i.options.singleItem===!0)return i.options.items=i.orignalItems=1,i.options.itemsCustom=!1,i.options.itemsDesktop=!1,i.options.itemsDesktopSmall=!1,i.options.itemsTablet=!1,i.options.itemsTabletSmall=!1,i.options.itemsMobile=!1,!1;if(e=t(i.options.responsiveBaseWidth).width(),e>(i.options.itemsDesktop[0]||i.orignalItems)&&(i.options.items=i.orignalItems),i.options.itemsCustom!==!1)for(i.options.itemsCustom.sort(function(t,e){return t[0]-e[0]}),o=0;o<i.options.itemsCustom.length;o+=1)i.options.itemsCustom[o][0]<=e&&(i.options.items=i.options.itemsCustom[o][1]);else e<=i.options.itemsDesktop[0]&&i.options.itemsDesktop!==!1&&(i.options.items=i.options.itemsDesktop[1]),e<=i.options.itemsDesktopSmall[0]&&i.options.itemsDesktopSmall!==!1&&(i.options.items=i.options.itemsDesktopSmall[1]),e<=i.options.itemsTablet[0]&&i.options.itemsTablet!==!1&&(i.options.items=i.options.itemsTablet[1]),e<=i.options.itemsTabletSmall[0]&&i.options.itemsTabletSmall!==!1&&(i.options.items=i.options.itemsTabletSmall[1]),e<=i.options.itemsMobile[0]&&i.options.itemsMobile!==!1&&(i.options.items=i.options.itemsMobile[1]);i.options.items>i.itemsAmount&&i.options.itemsScaleUp===!0&&(i.options.items=i.itemsAmount)},response:function(){var o,i,n=this;return n.options.responsive!==!0?!1:(i=t(e).width(),n.resizer=function(){t(e).width()!==i&&(n.options.autoPlay!==!1&&e.clearInterval(n.autoPlayInterval),e.clearTimeout(o),o=e.setTimeout(function(){i=t(e).width(),n.updateVars()},n.options.responsiveRefreshRate))},void t(e).resize(n.resizer))},updatePosition:function(){var t=this;t.jumpTo(t.currentItem),t.options.autoPlay!==!1&&t.checkAp()},appendItemsSizes:function(){var e=this,o=0,i=e.itemsAmount-e.options.items;e.$owlItems.each(function(n){var s=t(this);s.css({width:e.itemWidth}).data("owl-item",Number(n)),(n%e.options.items===0||n===i)&&(n>i||(o+=1)),s.data("owl-roundPages",o)})},appendWrapperSizes:function(){var t=this,e=t.$owlItems.length*t.itemWidth;t.$owlWrapper.css({width:2*e,left:0}),t.appendItemsSizes()},calculateAll:function(){var t=this;t.calculateWidth(),t.appendWrapperSizes(),t.loops(),t.max()},calculateWidth:function(){var t=this;t.itemWidth=Math.round(t.$elem.width()/t.options.items)},max:function(){var t=this,e=-1*(t.itemsAmount*t.itemWidth-t.options.items*t.itemWidth);return t.options.items>t.itemsAmount?(t.maximumItem=0,e=0,t.maximumPixels=0):(t.maximumItem=t.itemsAmount-t.options.items,t.maximumPixels=e),e},min:function(){return 0},loops:function(){var e,o,i,n=this,s=0,a=0;for(n.positionsInArray=[0],n.pagesInArray=[],e=0;e<n.itemsAmount;e+=1)a+=n.itemWidth,n.positionsInArray.push(-a),n.options.scrollPerPage===!0&&(o=t(n.$owlItems[e]),i=o.data("owl-roundPages"),i!==s&&(n.pagesInArray[s]=n.positionsInArray[e],s=i))},buildControls:function(){var e=this;(e.options.navigation===!0||e.options.pagination===!0)&&(e.owlControls=t('<div class="owl-controls"/>').toggleClass("clickable",!e.browser.isTouch).appendTo(e.$elem)),e.options.pagination===!0&&e.buildPagination(),e.options.navigation===!0&&e.buildButtons()},buildButtons:function(){var e=this,o=t('<div class="owl-buttons"/>');e.owlControls.append(o),e.buttonPrev=t("<div/>",{"class":"owl-prev",html:e.options.navigationText[0]||""}),e.buttonNext=t("<div/>",{"class":"owl-next",html:e.options.navigationText[1]||""}),o.append(e.buttonPrev).append(e.buttonNext),o.on("touchstart.owlControls mousedown.owlControls",'div[class^="owl"]',function(t){t.preventDefault()}),o.on("touchend.owlControls mouseup.owlControls",'div[class^="owl"]',function(o){o.preventDefault(),t(this).hasClass("owl-next")?e.next():e.prev()})},buildPagination:function(){var e=this;e.paginationWrapper=t('<div class="owl-pagination"/>'),e.owlControls.append(e.paginationWrapper),e.paginationWrapper.on("touchend.owlControls mouseup.owlControls",".owl-page",function(o){o.preventDefault(),Number(t(this).data("owl-page"))!==e.currentItem&&e.goTo(Number(t(this).data("owl-page")),!0)})},updatePagination:function(){var e,o,i,n,s,a,r=this;if(r.options.pagination===!1)return!1;for(r.paginationWrapper.html(""),e=0,o=r.itemsAmount-r.itemsAmount%r.options.items,n=0;n<r.itemsAmount;n+=1)n%r.options.items===0&&(e+=1,o===n&&(i=r.itemsAmount-r.options.items),s=t("<div/>",{"class":"owl-page"}),a=t("<span></span>",{text:r.options.paginationNumbers===!0?e:"","class":r.options.paginationNumbers===!0?"owl-numbers":""}),s.append(a),s.data("owl-page",o===n?i:n),s.data("owl-roundPages",e),r.paginationWrapper.append(s));r.checkPagination()},checkPagination:function(){var e=this;return e.options.pagination===!1?!1:void e.paginationWrapper.find(".owl-page").each(function(){t(this).data("owl-roundPages")===t(e.$owlItems[e.currentItem]).data("owl-roundPages")&&(e.paginationWrapper.find(".owl-page").removeClass("active"),t(this).addClass("active"))})},checkNavigation:function(){var t=this;return t.options.navigation===!1?!1:void(t.options.rewindNav===!1&&(0===t.currentItem&&0===t.maximumItem?(t.buttonPrev.addClass("disabled"),t.buttonNext.addClass("disabled")):0===t.currentItem&&0!==t.maximumItem?(t.buttonPrev.addClass("disabled"),t.buttonNext.removeClass("disabled")):t.currentItem===t.maximumItem?(t.buttonPrev.removeClass("disabled"),t.buttonNext.addClass("disabled")):0!==t.currentItem&&t.currentItem!==t.maximumItem&&(t.buttonPrev.removeClass("disabled"),t.buttonNext.removeClass("disabled"))))},updateControls:function(){var t=this;t.updatePagination(),t.checkNavigation(),t.owlControls&&(t.options.items>=t.itemsAmount?t.owlControls.hide():t.owlControls.show())},destroyControls:function(){var t=this;t.owlControls&&t.owlControls.remove()},next:function(t){var e=this;if(e.isTransition)return!1;if(e.currentItem+=e.options.scrollPerPage===!0?e.options.items:1,e.currentItem>e.maximumItem+(e.options.scrollPerPage===!0?e.options.items-1:0)){if(e.options.rewindNav!==!0)return e.currentItem=e.maximumItem,!1;e.currentItem=0,t="rewind"}e.goTo(e.currentItem,t)},prev:function(t){var e=this;if(e.isTransition)return!1;if(e.options.scrollPerPage===!0&&e.currentItem>0&&e.currentItem<e.options.items?e.currentItem=0:e.currentItem-=e.options.scrollPerPage===!0?e.options.items:1,e.currentItem<0){if(e.options.rewindNav!==!0)return e.currentItem=0,!1;e.currentItem=e.maximumItem,t="rewind"}e.goTo(e.currentItem,t)},goTo:function(t,o,i){var n,s=this;return s.isTransition?!1:("function"==typeof s.options.beforeMove&&s.options.beforeMove.apply(this,[s.$elem]),t>=s.maximumItem?t=s.maximumItem:0>=t&&(t=0),s.currentItem=s.owl.currentItem=t,s.options.transitionStyle!==!1&&"drag"!==i&&1===s.options.items&&s.browser.support3d===!0?(s.swapSpeed(0),s.browser.support3d===!0?s.transition3d(s.positionsInArray[t]):s.css2slide(s.positionsInArray[t],1),s.afterGo(),s.singleItemTransition(),!1):(n=s.positionsInArray[t],s.browser.support3d===!0?(s.isCss3Finish=!1,o===!0?(s.swapSpeed("paginationSpeed"),e.setTimeout(function(){s.isCss3Finish=!0},s.options.paginationSpeed)):"rewind"===o?(s.swapSpeed(s.options.rewindSpeed),e.setTimeout(function(){s.isCss3Finish=!0},s.options.rewindSpeed)):(s.swapSpeed("slideSpeed"),e.setTimeout(function(){s.isCss3Finish=!0},s.options.slideSpeed)),s.transition3d(n)):o===!0?s.css2slide(n,s.options.paginationSpeed):"rewind"===o?s.css2slide(n,s.options.rewindSpeed):s.css2slide(n,s.options.slideSpeed),void s.afterGo()))},jumpTo:function(t){var e=this;"function"==typeof e.options.beforeMove&&e.options.beforeMove.apply(this,[e.$elem]),t>=e.maximumItem||-1===t?t=e.maximumItem:0>=t&&(t=0),e.swapSpeed(0),e.browser.support3d===!0?e.transition3d(e.positionsInArray[t]):e.css2slide(e.positionsInArray[t],1),e.currentItem=e.owl.currentItem=t,e.afterGo()},afterGo:function(){var t=this;t.prevArr.push(t.currentItem),t.prevItem=t.owl.prevItem=t.prevArr[t.prevArr.length-2],t.prevArr.shift(0),t.prevItem!==t.currentItem&&(t.checkPagination(),t.checkNavigation(),t.eachMoveUpdate(),t.options.autoPlay!==!1&&t.checkAp()),"function"==typeof t.options.afterMove&&t.prevItem!==t.currentItem&&t.options.afterMove.apply(this,[t.$elem])},stop:function(){var t=this;t.apStatus="stop",e.clearInterval(t.autoPlayInterval)},checkAp:function(){var t=this;"stop"!==t.apStatus&&t.play()},play:function(){var t=this;return t.apStatus="play",t.options.autoPlay===!1?!1:(e.clearInterval(t.autoPlayInterval),void(t.autoPlayInterval=e.setInterval(function(){t.next(!0)},t.options.autoPlay)))},swapSpeed:function(t){var e=this;"slideSpeed"===t?e.$owlWrapper.css(e.addCssSpeed(e.options.slideSpeed)):"paginationSpeed"===t?e.$owlWrapper.css(e.addCssSpeed(e.options.paginationSpeed)):"string"!=typeof t&&e.$owlWrapper.css(e.addCssSpeed(t))},addCssSpeed:function(t){return{"-webkit-transition":"all "+t+"ms ease","-moz-transition":"all "+t+"ms ease","-o-transition":"all "+t+"ms ease",transition:"all "+t+"ms ease"}},removeTransition:function(){return{"-webkit-transition":"","-moz-transition":"","-o-transition":"",transition:""}},doTranslate:function(t){return{"-webkit-transform":"translate3d("+t+"px, 0px, 0px)","-moz-transform":"translate3d("+t+"px, 0px, 0px)","-o-transform":"translate3d("+t+"px, 0px, 0px)","-ms-transform":"translate3d("+t+"px, 0px, 0px)",transform:"translate3d("+t+"px, 0px,0px)"}},transition3d:function(t){var e=this;e.$owlWrapper.css(e.doTranslate(t))},css2move:function(t){var e=this;e.$owlWrapper.css({left:t})},css2slide:function(t,e){var o=this;o.isCssFinish=!1,o.$owlWrapper.stop(!0,!0).animate({left:t},{duration:e||o.options.slideSpeed,complete:function(){o.isCssFinish=!0}})},checkBrowser:function(){var t,i,n,s,a=this,r="translate3d(0px, 0px, 0px)",l=o.createElement("div");l.style.cssText=" -moz-transform:"+r+"; -ms-transform:"+r+"; -o-transform:"+r+"; -webkit-transform:"+r+"; transform:"+r,t=/translate3d\(0px, 0px, 0px\)/g,i=l.style.cssText.match(t),n=null!==i&&1===i.length,s="ontouchstart"in e||e.navigator.msMaxTouchPoints,a.browser={support3d:n,isTouch:s}},moveEvents:function(){var t=this;(t.options.mouseDrag!==!1||t.options.touchDrag!==!1)&&(t.gestures(),t.disabledEvents())},eventTypes:function(){var t=this,e=["s","e","x"];t.ev_types={},t.options.mouseDrag===!0&&t.options.touchDrag===!0?e=["touchstart.owl mousedown.owl","touchmove.owl mousemove.owl","touchend.owl touchcancel.owl mouseup.owl"]:t.options.mouseDrag===!1&&t.options.touchDrag===!0?e=["touchstart.owl","touchmove.owl","touchend.owl touchcancel.owl"]:t.options.mouseDrag===!0&&t.options.touchDrag===!1&&(e=["mousedown.owl","mousemove.owl","mouseup.owl"]),t.ev_types.start=e[0],t.ev_types.move=e[1],t.ev_types.end=e[2]},disabledEvents:function(){var e=this;e.$elem.on("dragstart.owl",function(t){t.preventDefault()}),e.$elem.on("mousedown.disableTextSelect",function(e){return t(e.target).is("input, textarea, select, option")})},gestures:function(){function i(t){if(void 0!==t.touches)return{x:t.touches[0].pageX,y:t.touches[0].pageY};if(void 0===t.touches){if(void 0!==t.pageX)return{x:t.pageX,y:t.pageY};if(void 0===t.pageX)return{x:t.clientX,y:t.clientY}}}function n(e){"on"===e?(t(o).on(l.ev_types.move,a),t(o).on(l.ev_types.end,r)):"off"===e&&(t(o).off(l.ev_types.move),t(o).off(l.ev_types.end))}function s(o){var s,a=o.originalEvent||o||e.event;if(3===a.which)return!1;if(!(l.itemsAmount<=l.options.items)){if(l.isCssFinish===!1&&!l.options.dragBeforeAnimFinish)return!1;if(l.isCss3Finish===!1&&!l.options.dragBeforeAnimFinish)return!1;l.options.autoPlay!==!1&&e.clearInterval(l.autoPlayInterval),l.browser.isTouch===!0||l.$owlWrapper.hasClass("grabbing")||l.$owlWrapper.addClass("grabbing"),l.newPosX=0,l.newRelativeX=0,t(this).css(l.removeTransition()),s=t(this).position(),p.relativePos=s.left,p.offsetX=i(a).x-s.left,p.offsetY=i(a).y-s.top,n("on"),p.sliding=!1,p.targetElement=a.target||a.srcElement}}function a(n){var s,a,r=n.originalEvent||n||e.event;l.newPosX=i(r).x-p.offsetX,l.newPosY=i(r).y-p.offsetY,l.newRelativeX=l.newPosX-p.relativePos,"function"==typeof l.options.startDragging&&p.dragging!==!0&&0!==l.newRelativeX&&(p.dragging=!0,l.options.startDragging.apply(l,[l.$elem])),(l.newRelativeX>8||l.newRelativeX<-8)&&l.browser.isTouch===!0&&(void 0!==r.preventDefault?r.preventDefault():r.returnValue=!1,p.sliding=!0),(l.newPosY>10||l.newPosY<-10)&&p.sliding===!1&&t(o).off("touchmove.owl"),s=function(){return l.newRelativeX/5},a=function(){return l.maximumPixels+l.newRelativeX/5},l.newPosX=Math.max(Math.min(l.newPosX,s()),a()),l.browser.support3d===!0?l.transition3d(l.newPosX):l.css2move(l.newPosX)}function r(o){var i,s,a,r=o.originalEvent||o||e.event;r.target=r.target||r.srcElement,p.dragging=!1,l.browser.isTouch!==!0&&l.$owlWrapper.removeClass("grabbing"),l.newRelativeX<0?l.dragDirection=l.owl.dragDirection="left":l.dragDirection=l.owl.dragDirection="right",0!==l.newRelativeX&&(i=l.getNewPosition(),l.goTo(i,!1,"drag"),p.targetElement===r.target&&l.browser.isTouch!==!0&&(t(r.target).on("click.disable",function(e){e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t(e.target).off("click.disable")}),s=t._data(r.target,"events").click,a=s.pop(),s.splice(0,0,a))),n("off")}var l=this,p={offsetX:0,offsetY:0,baseElWidth:0,relativePos:0,position:null,minSwipe:null,maxSwipe:null,sliding:null,dargging:null,targetElement:null};l.isCssFinish=!0,l.$elem.on(l.ev_types.start,".owl-wrapper",s)},getNewPosition:function(){var t=this,e=t.closestItem();return e>t.maximumItem?(t.currentItem=t.maximumItem,e=t.maximumItem):t.newPosX>=0&&(e=0,t.currentItem=0),e},closestItem:function(){var e=this,o=e.options.scrollPerPage===!0?e.pagesInArray:e.positionsInArray,i=e.newPosX,n=null;return t.each(o,function(s,a){i-e.itemWidth/20>o[s+1]&&i-e.itemWidth/20<a&&"left"===e.moveDirection()?(n=a,e.options.scrollPerPage===!0?e.currentItem=t.inArray(n,e.positionsInArray):e.currentItem=s):i+e.itemWidth/20<a&&i+e.itemWidth/20>(o[s+1]||o[s]-e.itemWidth)&&"right"===e.moveDirection()&&(e.options.scrollPerPage===!0?(n=o[s+1]||o[o.length-1],e.currentItem=t.inArray(n,e.positionsInArray)):(n=o[s+1],e.currentItem=s+1))}),e.currentItem},moveDirection:function(){var t,e=this;return e.newRelativeX<0?(t="right",e.playDirection="next"):(t="left",e.playDirection="prev"),t},customEvents:function(){var t=this;t.$elem.on("owl.next",function(){t.next()}),t.$elem.on("owl.prev",function(){t.prev()}),t.$elem.on("owl.play",function(e,o){t.options.autoPlay=o,t.play(),t.hoverStatus="play"}),t.$elem.on("owl.stop",function(){t.stop(),t.hoverStatus="stop"}),t.$elem.on("owl.goTo",function(e,o){t.goTo(o)}),t.$elem.on("owl.jumpTo",function(e,o){t.jumpTo(o)})},stopOnHover:function(){var t=this;t.options.stopOnHover===!0&&t.browser.isTouch!==!0&&t.options.autoPlay!==!1&&(t.$elem.on("mouseover",function(){t.stop()}),t.$elem.on("mouseout",function(){"stop"!==t.hoverStatus&&t.play()}))},lazyLoad:function(){var e,o,i,n,s,a=this;if(a.options.lazyLoad===!1)return!1;for(e=0;e<a.itemsAmount;e+=1)o=t(a.$owlItems[e]),"loaded"!==o.data("owl-loaded")&&(i=o.data("owl-item"),n=o.find(".lazyOwl"),"string"==typeof n.data("src")?(void 0===o.data("owl-loaded")&&(n.hide(),o.addClass("loading").data("owl-loaded","checked")),s=a.options.lazyFollow===!0?i>=a.currentItem:!0,s&&i<a.currentItem+a.options.items&&n.length&&n.each(function(){a.lazyPreload(o,t(this))})):o.data("owl-loaded","loaded"))},lazyPreload:function(t,o){function i(){t.data("owl-loaded","loaded").removeClass("loading"),o.removeAttr("data-src"),"fade"===a.options.lazyEffect?o.fadeIn(400):o.show(),"function"==typeof a.options.afterLazyLoad&&a.options.afterLazyLoad.apply(this,[a.$elem])}function n(){r+=1,a.completeImg(o.get(0))||s===!0?i():100>=r?e.setTimeout(n,100):i()}var s,a=this,r=0;"DIV"===o.prop("tagName")?(o.css("background-image","url("+o.data("src")+")"),s=!0):o[0].src=o.data("src"),n()},autoHeight:function(){function o(){var o=t(s.$owlItems[s.currentItem]).height();s.wrapperOuter.css("height",o+"px"),s.wrapperOuter.hasClass("autoHeight")||e.setTimeout(function(){s.wrapperOuter.addClass("autoHeight")},0)}function i(){n+=1,s.completeImg(a.get(0))?o():100>=n?e.setTimeout(i,100):s.wrapperOuter.css("height","")}var n,s=this,a=t(s.$owlItems[s.currentItem]).find("img");void 0!==a.get(0)?(n=0,i()):o()},completeImg:function(t){var e;return t.complete?(e=typeof t.naturalWidth,"undefined"!==e&&0===t.naturalWidth?!1:!0):!1},onVisibleItems:function(){var e,o=this;for(o.options.addClassActive===!0&&o.$owlItems.removeClass("active"),o.visibleItems=[],e=o.currentItem;e<o.currentItem+o.options.items;e+=1)o.visibleItems.push(e),o.options.addClassActive===!0&&t(o.$owlItems[e]).addClass("active");o.owl.visibleItems=o.visibleItems},transitionTypes:function(t){var e=this;e.outClass="owl-"+t+"-out",e.inClass="owl-"+t+"-in"},singleItemTransition:function(){function t(t){return{position:"relative",left:t+"px"}}var e=this,o=e.outClass,i=e.inClass,n=e.$owlItems.eq(e.currentItem),s=e.$owlItems.eq(e.prevItem),a=Math.abs(e.positionsInArray[e.currentItem])+e.positionsInArray[e.prevItem],r=Math.abs(e.positionsInArray[e.currentItem])+e.itemWidth/2,l="webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend";e.isTransition=!0,e.$owlWrapper.addClass("owl-origin").css({"-webkit-transform-origin":r+"px","-moz-perspective-origin":r+"px","perspective-origin":r+"px"}),s.css(t(a,10)).addClass(o).on(l,function(){e.endPrev=!0,s.off(l),e.clearTransStyle(s,o)}),n.addClass(i).on(l,function(){e.endCurrent=!0,n.off(l),e.clearTransStyle(n,i)})},clearTransStyle:function(t,e){var o=this;t.css({position:"",left:""}).removeClass(e),o.endPrev&&o.endCurrent&&(o.$owlWrapper.removeClass("owl-origin"),o.endPrev=!1,o.endCurrent=!1,o.isTransition=!1)},owlStatus:function(){var t=this;t.owl={userOptions:t.userOptions,baseElement:t.$elem,userItems:t.$userItems,owlItems:t.$owlItems,currentItem:t.currentItem,prevItem:t.prevItem,visibleItems:t.visibleItems,isTouch:t.browser.isTouch,browser:t.browser,dragDirection:t.dragDirection}},clearEvents:function(){var i=this;i.$elem.off(".owl owl mousedown.disableTextSelect"),t(o).off(".owl owl"),t(e).off("resize",i.resizer)},unWrap:function(){var t=this;0!==t.$elem.children().length&&(t.$owlWrapper.unwrap(),t.$userItems.unwrap().unwrap(),t.owlControls&&t.owlControls.remove()),t.clearEvents(),t.$elem.attr({style:t.$elem.data("owl-originalStyles")||"","class":t.$elem.data("owl-originalClasses")})},destroy:function(){var t=this;t.stop(),e.clearInterval(t.checkVisible),t.unWrap(),t.$elem.removeData()},reinit:function(e){var o=this,i=t.extend({},o.userOptions,e);o.unWrap(),o.init(i,o.$elem)},addItem:function(t,e){var o,i=this;return t?0===i.$elem.children().length?(i.$elem.append(t),i.setVars(),!1):(i.unWrap(),o=void 0===e||-1===e?-1:e,o>=i.$userItems.length||-1===o?i.$userItems.eq(-1).after(t):i.$userItems.eq(o).before(t),void i.setVars()):!1},removeItem:function(t){var e,o=this;return 0===o.$elem.children().length?!1:(e=void 0===t||-1===t?-1:t,o.unWrap(),o.$userItems.eq(e).remove(),void o.setVars())}};t.fn.owlCarousel=function(e){return this.each(function(){if(t(this).data("owl-init")===!0)return!1;t(this).data("owl-init",!0);var o=Object.create(i);o.init(e,this),t.data(this,"owlCarousel",o)})},t.fn.owlCarousel.options={items:5,itemsCustom:!1,itemsDesktop:[1199,4],itemsDesktopSmall:[979,3],itemsTablet:[768,2],itemsTabletSmall:!1,itemsMobile:[479,1],singleItem:!1,itemsScaleUp:!1,slideSpeed:200,paginationSpeed:800,rewindSpeed:1e3,autoPlay:!1,stopOnHover:!1,navigation:!1,navigationText:["prev","next"],rewindNav:!0,scrollPerPage:!1,pagination:!0,paginationNumbers:!1,responsive:!0,responsiveRefreshRate:200,responsiveBaseWidth:e,baseClass:"owl-carousel",theme:"owl-theme",lazyLoad:!1,lazyFollow:!0,lazyEffect:"fade",autoHeight:!1,jsonPath:!1,jsonSuccess:!1,dragBeforeAnimFinish:!0,mouseDrag:!0,touchDrag:!0,addClassActive:!1,transitionStyle:!1,beforeUpdate:!1,afterUpdate:!1,beforeInit:!1,afterInit:!1,beforeMove:!1,afterMove:!1,afterAction:!1,startDragging:!1,afterLazyLoad:!1}}(jQuery,window,document);;function RichMarker(e){var t=e||{};this.ready_=!1,this.dragging_=!1,void 0==e.visible&&(e.visible=!0),void 0==e.shadow&&(e.shadow="7px -3px 5px rgba(88,88,88,0.7)"),void 0==e.anchor&&(e.anchor=RichMarkerPosition.BOTTOM),this.setValues(t)}RichMarker.prototype=new google.maps.OverlayView,window.RichMarker=RichMarker,RichMarker.prototype.getVisible=function(){return this.get("visible")},RichMarker.prototype.getVisible=RichMarker.prototype.getVisible,RichMarker.prototype.setVisible=function(e){this.set("visible",e)},RichMarker.prototype.setVisible=RichMarker.prototype.setVisible,RichMarker.prototype.visible_changed=function(){this.ready_&&(this.markerWrapper_.style.display=this.getVisible()?"":"none",this.draw())},RichMarker.prototype.visible_changed=RichMarker.prototype.visible_changed,RichMarker.prototype.setFlat=function(e){this.set("flat",!!e)},RichMarker.prototype.setFlat=RichMarker.prototype.setFlat,RichMarker.prototype.getFlat=function(){return this.get("flat")},RichMarker.prototype.getFlat=RichMarker.prototype.getFlat,RichMarker.prototype.getWidth=function(){return this.get("width")},RichMarker.prototype.getWidth=RichMarker.prototype.getWidth,RichMarker.prototype.getHeight=function(){return this.get("height")},RichMarker.prototype.getHeight=RichMarker.prototype.getHeight,RichMarker.prototype.setShadow=function(e){this.set("shadow",e),this.flat_changed()},RichMarker.prototype.setShadow=RichMarker.prototype.setShadow,RichMarker.prototype.getShadow=function(){return this.get("shadow")},RichMarker.prototype.getShadow=RichMarker.prototype.getShadow,RichMarker.prototype.flat_changed=function(){this.ready_&&(this.markerWrapper_.style.boxShadow=this.markerWrapper_.style.webkitBoxShadow=this.markerWrapper_.style.MozBoxShadow=this.getFlat()?"":this.getShadow())},RichMarker.prototype.flat_changed=RichMarker.prototype.flat_changed,RichMarker.prototype.setZIndex=function(e){this.set("zIndex",e)},RichMarker.prototype.setZIndex=RichMarker.prototype.setZIndex,RichMarker.prototype.getZIndex=function(){return this.get("zIndex")},RichMarker.prototype.getZIndex=RichMarker.prototype.getZIndex,RichMarker.prototype.zIndex_changed=function(){this.getZIndex()&&this.ready_&&(this.markerWrapper_.style.zIndex=this.getZIndex())},RichMarker.prototype.zIndex_changed=RichMarker.prototype.zIndex_changed,RichMarker.prototype.getDraggable=function(){return this.get("draggable")},RichMarker.prototype.getDraggable=RichMarker.prototype.getDraggable,RichMarker.prototype.setDraggable=function(e){this.set("draggable",!!e)},RichMarker.prototype.setDraggable=RichMarker.prototype.setDraggable,RichMarker.prototype.draggable_changed=function(){this.ready_&&(this.getDraggable()?this.addDragging_(this.markerWrapper_):this.removeDragListeners_())},RichMarker.prototype.draggable_changed=RichMarker.prototype.draggable_changed,RichMarker.prototype.getPosition=function(){return this.get("position")},RichMarker.prototype.getPosition=RichMarker.prototype.getPosition,RichMarker.prototype.setPosition=function(e){this.set("position",e)},RichMarker.prototype.setPosition=RichMarker.prototype.setPosition,RichMarker.prototype.position_changed=function(){this.draw()},RichMarker.prototype.position_changed=RichMarker.prototype.position_changed,RichMarker.prototype.getAnchor=function(){return this.get("anchor")},RichMarker.prototype.getAnchor=RichMarker.prototype.getAnchor,RichMarker.prototype.setAnchor=function(e){this.set("anchor",e)},RichMarker.prototype.setAnchor=RichMarker.prototype.setAnchor,RichMarker.prototype.anchor_changed=function(){this.draw()},RichMarker.prototype.anchor_changed=RichMarker.prototype.anchor_changed,RichMarker.prototype.htmlToDocumentFragment_=function(e){var t=document.createElement("DIV");if(t.innerHTML=e,1==t.childNodes.length)return t.removeChild(t.firstChild);for(var r=document.createDocumentFragment();t.firstChild;)r.appendChild(t.firstChild);return r},RichMarker.prototype.removeChildren_=function(e){if(e)for(var t;t=e.firstChild;)e.removeChild(t)},RichMarker.prototype.setContent=function(e){this.set("content",e)},RichMarker.prototype.setContent=RichMarker.prototype.setContent,RichMarker.prototype.getContent=function(){return this.get("content")},RichMarker.prototype.getContent=RichMarker.prototype.getContent,RichMarker.prototype.content_changed=function(){if(this.markerContent_){this.removeChildren_(this.markerContent_);var e=this.getContent();if(e){"string"==typeof e&&(e=e.replace(/^\s*([\S\s]*)\b\s*$/,"$1"),e=this.htmlToDocumentFragment_(e)),this.markerContent_.appendChild(e);for(var t,r=this,i=this.markerContent_.getElementsByTagName("IMG"),o=0;t=i[o];o++)google.maps.event.addDomListener(t,"mousedown",function(e){r.getDraggable()&&(e.preventDefault&&e.preventDefault(),e.returnValue=!1)}),google.maps.event.addDomListener(t,"load",function(){r.draw()});google.maps.event.trigger(this,"domready")}this.ready_&&this.draw()}},RichMarker.prototype.content_changed=RichMarker.prototype.content_changed,RichMarker.prototype.setCursor_=function(e){if(this.ready_){var t="";-1!==navigator.userAgent.indexOf("Gecko/")?("dragging"==e&&(t="-moz-grabbing"),"dragready"==e&&(t="-moz-grab"),"draggable"==e&&(t="pointer")):(("dragging"==e||"dragready"==e)&&(t="move"),"draggable"==e&&(t="pointer")),this.markerWrapper_.style.cursor!=t&&(this.markerWrapper_.style.cursor=t)}},RichMarker.prototype.startDrag=function(e){if(this.getDraggable()&&!this.dragging_){this.dragging_=!0;var t=this.getMap();this.mapDraggable_=t.get("draggable"),t.set("draggable",!1),this.mouseX_=e.clientX,this.mouseY_=e.clientY,this.setCursor_("dragready"),this.markerWrapper_.style.MozUserSelect="none",this.markerWrapper_.style.KhtmlUserSelect="none",this.markerWrapper_.style.WebkitUserSelect="none",this.markerWrapper_.unselectable="on",this.markerWrapper_.onselectstart=function(){return!1},this.addDraggingListeners_(),google.maps.event.trigger(this,"dragstart")}},RichMarker.prototype.stopDrag=function(){this.getDraggable()&&this.dragging_&&(this.dragging_=!1,this.getMap().set("draggable",this.mapDraggable_),this.mouseX_=this.mouseY_=this.mapDraggable_=null,this.markerWrapper_.style.MozUserSelect="",this.markerWrapper_.style.KhtmlUserSelect="",this.markerWrapper_.style.WebkitUserSelect="",this.markerWrapper_.unselectable="off",this.markerWrapper_.onselectstart=function(){},this.removeDraggingListeners_(),this.setCursor_("draggable"),google.maps.event.trigger(this,"dragend"),this.draw())},RichMarker.prototype.drag=function(e){if(!this.getDraggable()||!this.dragging_)return void this.stopDrag();var t=this.mouseX_-e.clientX,r=this.mouseY_-e.clientY;this.mouseX_=e.clientX,this.mouseY_=e.clientY;var i=parseInt(this.markerWrapper_.style.left,10)-t,o=parseInt(this.markerWrapper_.style.top,10)-r;this.markerWrapper_.style.left=i+"px",this.markerWrapper_.style.top=o+"px";var a=this.getOffset_(),s=new google.maps.Point(i-a.width,o-a.height),n=this.getProjection();this.setPosition(n.fromDivPixelToLatLng(s)),this.setCursor_("dragging"),google.maps.event.trigger(this,"drag")},RichMarker.prototype.removeDragListeners_=function(){this.draggableListener_&&(google.maps.event.removeListener(this.draggableListener_),delete this.draggableListener_),this.setCursor_("")},RichMarker.prototype.addDragging_=function(e){if(e){var t=this;this.draggableListener_=google.maps.event.addDomListener(e,"mousedown",function(e){t.startDrag(e)}),this.setCursor_("draggable")}},RichMarker.prototype.addDraggingListeners_=function(){var e=this;this.markerWrapper_.setCapture?(this.markerWrapper_.setCapture(!0),this.draggingListeners_=[google.maps.event.addDomListener(this.markerWrapper_,"mousemove",function(t){e.drag(t)},!0),google.maps.event.addDomListener(this.markerWrapper_,"mouseup",function(){e.stopDrag(),e.markerWrapper_.releaseCapture()},!0)]):this.draggingListeners_=[google.maps.event.addDomListener(window,"mousemove",function(t){e.drag(t)},!0),google.maps.event.addDomListener(window,"mouseup",function(){e.stopDrag()},!0)]},RichMarker.prototype.removeDraggingListeners_=function(){if(this.draggingListeners_){for(var e,t=0;e=this.draggingListeners_[t];t++)google.maps.event.removeListener(e);this.draggingListeners_.length=0}},RichMarker.prototype.getOffset_=function(){var e=this.getAnchor();if("object"==typeof e)return e;var t=new google.maps.Size(0,0);if(!this.markerContent_)return t;var r=this.markerContent_.offsetWidth,i=this.markerContent_.offsetHeight;switch(e){case RichMarkerPosition.TOP_LEFT:break;case RichMarkerPosition.TOP:t.width=-r/2;break;case RichMarkerPosition.TOP_RIGHT:t.width=-r;break;case RichMarkerPosition.LEFT:t.height=-i/2;break;case RichMarkerPosition.MIDDLE:t.width=-r/2,t.height=-i/2;break;case RichMarkerPosition.RIGHT:t.width=-r,t.height=-i/2;break;case RichMarkerPosition.BOTTOM_LEFT:t.height=-i;break;case RichMarkerPosition.BOTTOM:t.width=-r/2,t.height=-i;break;case RichMarkerPosition.BOTTOM_RIGHT:t.width=-r,t.height=-i}return t},RichMarker.prototype.onAdd=function(){if(this.markerWrapper_||(this.markerWrapper_=document.createElement("DIV"),this.markerWrapper_.style.position="absolute"),this.getZIndex()&&(this.markerWrapper_.style.zIndex=this.getZIndex()),this.markerWrapper_.style.display=this.getVisible()?"":"none",!this.markerContent_){this.markerContent_=document.createElement("DIV"),this.markerWrapper_.appendChild(this.markerContent_);var e=this;google.maps.event.addDomListener(this.markerContent_,"click",function(t){google.maps.event.trigger(e,"click")}),google.maps.event.addDomListener(this.markerContent_,"mouseover",function(t){google.maps.event.trigger(e,"mouseover")}),google.maps.event.addDomListener(this.markerContent_,"mouseout",function(t){google.maps.event.trigger(e,"mouseout")})}this.ready_=!0,this.content_changed(),this.flat_changed(),this.draggable_changed();var t=this.getPanes();t&&t.overlayMouseTarget.appendChild(this.markerWrapper_),google.maps.event.trigger(this,"ready")},RichMarker.prototype.onAdd=RichMarker.prototype.onAdd,RichMarker.prototype.draw=function(){if(this.ready_&&!this.dragging_){var e=this.getProjection();if(e){var t=this.get("position"),r=e.fromLatLngToDivPixel(t),i=this.getOffset_();this.markerWrapper_.style.top=r.y+i.height+"px",this.markerWrapper_.style.left=r.x+i.width+"px";var o=this.markerContent_.offsetHeight,a=this.markerContent_.offsetWidth;a!=this.get("width")&&this.set("width",a),o!=this.get("height")&&this.set("height",o)}}},RichMarker.prototype.draw=RichMarker.prototype.draw,RichMarker.prototype.onRemove=function(){this.markerWrapper_&&this.markerWrapper_.parentNode&&this.markerWrapper_.parentNode.removeChild(this.markerWrapper_),this.removeDragListeners_()},RichMarker.prototype.onRemove=RichMarker.prototype.onRemove;var RichMarkerPosition={TOP_LEFT:1,TOP:2,TOP_RIGHT:3,LEFT:4,MIDDLE:5,RIGHT:6,BOTTOM_LEFT:7,BOTTOM:8,BOTTOM_RIGHT:9};window.RichMarkerPosition=RichMarkerPosition;;jQuery(function ($) { $('.comment-form .add_rating li').on('hover', function () { var index = $(this).index(); var sibling = $(this).siblings(); sibling.removeClass('active'); try { index = parseInt(index); for (i = 0; i <= index; i++) { $(this).parent().find('li:eq(' + i + ')').addClass('active') } $(this).parents('.form-group').find('.comment_rate').val(index + 1) } catch (ex) { console.log(ex) } }) }) ;//! moment.js //! version : 2.9.0 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com (function(a){function b(a,b,c){switch(arguments.length){case 2:return null!=a?a:b;case 3:return null!=a?a:null!=b?b:c;default:throw new Error("Implement me")}}function c(a,b){return Bb.call(a,b)}function d(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function e(a){vb.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+a)}function f(a,b){var c=!0;return o(function(){return c&&(e(a),c=!1),b.apply(this,arguments)},b)}function g(a,b){sc[a]||(e(b),sc[a]=!0)}function h(a,b){return function(c){return r(a.call(this,c),b)}}function i(a,b){return function(c){return this.localeData().ordinal(a.call(this,c),b)}}function j(a,b){var c,d,e=12*(b.year()-a.year())+(b.month()-a.month()),f=a.clone().add(e,"months");return 0>b-f?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)}function k(a,b,c){var d;return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&12>b&&(b+=12),d||12!==b||(b=0),b):b}function l(){}function m(a,b){b!==!1&&H(a),p(this,a),this._d=new Date(+a._d),uc===!1&&(uc=!0,vb.updateOffset(this),uc=!1)}function n(a){var b=A(a),c=b.year||0,d=b.quarter||0,e=b.month||0,f=b.week||0,g=b.day||0,h=b.hour||0,i=b.minute||0,j=b.second||0,k=b.millisecond||0;this._milliseconds=+k+1e3*j+6e4*i+36e5*h,this._days=+g+7*f,this._months=+e+3*d+12*c,this._data={},this._locale=vb.localeData(),this._bubble()}function o(a,b){for(var d in b)c(b,d)&&(a[d]=b[d]);return c(b,"toString")&&(a.toString=b.toString),c(b,"valueOf")&&(a.valueOf=b.valueOf),a}function p(a,b){var c,d,e;if("undefined"!=typeof b._isAMomentObject&&(a._isAMomentObject=b._isAMomentObject),"undefined"!=typeof b._i&&(a._i=b._i),"undefined"!=typeof b._f&&(a._f=b._f),"undefined"!=typeof b._l&&(a._l=b._l),"undefined"!=typeof b._strict&&(a._strict=b._strict),"undefined"!=typeof b._tzm&&(a._tzm=b._tzm),"undefined"!=typeof b._isUTC&&(a._isUTC=b._isUTC),"undefined"!=typeof b._offset&&(a._offset=b._offset),"undefined"!=typeof b._pf&&(a._pf=b._pf),"undefined"!=typeof b._locale&&(a._locale=b._locale),Kb.length>0)for(c in Kb)d=Kb[c],e=b[d],"undefined"!=typeof e&&(a[d]=e);return a}function q(a){return 0>a?Math.ceil(a):Math.floor(a)}function r(a,b,c){for(var d=""+Math.abs(a),e=a>=0;d.length<b;)d="0"+d;return(e?c?"+":"":"-")+d}function s(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function t(a,b){var c;return b=M(b,a),a.isBefore(b)?c=s(a,b):(c=s(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c}function u(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(g(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=vb.duration(c,d),v(this,e,a),this}}function v(a,b,c,d){var e=b._milliseconds,f=b._days,g=b._months;d=null==d?!0:d,e&&a._d.setTime(+a._d+e*c),f&&pb(a,"Date",ob(a,"Date")+f*c),g&&nb(a,ob(a,"Month")+g*c),d&&vb.updateOffset(a,f||g)}function w(a){return"[object Array]"===Object.prototype.toString.call(a)}function x(a){return"[object Date]"===Object.prototype.toString.call(a)||a instanceof Date}function y(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&C(a[d])!==C(b[d]))&&g++;return g+f}function z(a){if(a){var b=a.toLowerCase().replace(/(.)s$/,"$1");a=lc[a]||mc[b]||b}return a}function A(a){var b,d,e={};for(d in a)c(a,d)&&(b=z(d),b&&(e[b]=a[d]));return e}function B(b){var c,d;if(0===b.indexOf("week"))c=7,d="day";else{if(0!==b.indexOf("month"))return;c=12,d="month"}vb[b]=function(e,f){var g,h,i=vb._locale[b],j=[];if("number"==typeof e&&(f=e,e=a),h=function(a){var b=vb().utc().set(d,a);return i.call(vb._locale,b,e||"")},null!=f)return h(f);for(g=0;c>g;g++)j.push(h(g));return j}}function C(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=b>=0?Math.floor(b):Math.ceil(b)),c}function D(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function E(a,b,c){return jb(vb([a,11,31+b-c]),b,c).week}function F(a){return G(a)?366:365}function G(a){return a%4===0&&a%100!==0||a%400===0}function H(a){var b;a._a&&-2===a._pf.overflow&&(b=a._a[Db]<0||a._a[Db]>11?Db:a._a[Eb]<1||a._a[Eb]>D(a._a[Cb],a._a[Db])?Eb:a._a[Fb]<0||a._a[Fb]>24||24===a._a[Fb]&&(0!==a._a[Gb]||0!==a._a[Hb]||0!==a._a[Ib])?Fb:a._a[Gb]<0||a._a[Gb]>59?Gb:a._a[Hb]<0||a._a[Hb]>59?Hb:a._a[Ib]<0||a._a[Ib]>999?Ib:-1,a._pf._overflowDayOfYear&&(Cb>b||b>Eb)&&(b=Eb),a._pf.overflow=b)}function I(b){return null==b._isValid&&(b._isValid=!isNaN(b._d.getTime())&&b._pf.overflow<0&&!b._pf.empty&&!b._pf.invalidMonth&&!b._pf.nullInput&&!b._pf.invalidFormat&&!b._pf.userInvalidated,b._strict&&(b._isValid=b._isValid&&0===b._pf.charsLeftOver&&0===b._pf.unusedTokens.length&&b._pf.bigHour===a)),b._isValid}function J(a){return a?a.toLowerCase().replace("_","-"):a}function K(a){for(var b,c,d,e,f=0;f<a.length;){for(e=J(a[f]).split("-"),b=e.length,c=J(a[f+1]),c=c?c.split("-"):null;b>0;){if(d=L(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&y(e,c,!0)>=b-1)break;b--}f++}return null}function L(a){var b=null;if(!Jb[a]&&Lb)try{b=vb.locale(),require("./locale/"+a),vb.locale(b)}catch(c){}return Jb[a]}function M(a,b){var c,d;return b._isUTC?(c=b.clone(),d=(vb.isMoment(a)||x(a)?+a:+vb(a))-+c,c._d.setTime(+c._d+d),vb.updateOffset(c,!1),c):vb(a).local()}function N(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function O(a){var b,c,d=a.match(Pb);for(b=0,c=d.length;c>b;b++)d[b]=rc[d[b]]?rc[d[b]]:N(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function P(a,b){return a.isValid()?(b=Q(b,a.localeData()),nc[b]||(nc[b]=O(b)),nc[b](a)):a.localeData().invalidDate()}function Q(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(Qb.lastIndex=0;d>=0&&Qb.test(a);)a=a.replace(Qb,c),Qb.lastIndex=0,d-=1;return a}function R(a,b){var c,d=b._strict;switch(a){case"Q":return _b;case"DDDD":return bc;case"YYYY":case"GGGG":case"gggg":return d?cc:Tb;case"Y":case"G":case"g":return ec;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg":return d?dc:Ub;case"S":if(d)return _b;case"SS":if(d)return ac;case"SSS":if(d)return bc;case"DDD":return Sb;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return Wb;case"a":case"A":return b._locale._meridiemParse;case"x":return Zb;case"X":return $b;case"Z":case"ZZ":return Xb;case"T":return Yb;case"SSSS":return Vb;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return d?ac:Rb;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return Rb;case"Do":return d?b._locale._ordinalParse:b._locale._ordinalParseLenient;default:return c=new RegExp($(Z(a.replace("\\","")),"i"))}}function S(a){a=a||"";var b=a.match(Xb)||[],c=b[b.length-1]||[],d=(c+"").match(jc)||["-",0,0],e=+(60*d[1])+C(d[2]);return"+"===d[0]?e:-e}function T(a,b,c){var d,e=c._a;switch(a){case"Q":null!=b&&(e[Db]=3*(C(b)-1));break;case"M":case"MM":null!=b&&(e[Db]=C(b)-1);break;case"MMM":case"MMMM":d=c._locale.monthsParse(b,a,c._strict),null!=d?e[Db]=d:c._pf.invalidMonth=b;break;case"D":case"DD":null!=b&&(e[Eb]=C(b));break;case"Do":null!=b&&(e[Eb]=C(parseInt(b.match(/\d{1,2}/)[0],10)));break;case"DDD":case"DDDD":null!=b&&(c._dayOfYear=C(b));break;case"YY":e[Cb]=vb.parseTwoDigitYear(b);break;case"YYYY":case"YYYYY":case"YYYYYY":e[Cb]=C(b);break;case"a":case"A":c._meridiem=b;break;case"h":case"hh":c._pf.bigHour=!0;case"H":case"HH":e[Fb]=C(b);break;case"m":case"mm":e[Gb]=C(b);break;case"s":case"ss":e[Hb]=C(b);break;case"S":case"SS":case"SSS":case"SSSS":e[Ib]=C(1e3*("0."+b));break;case"x":c._d=new Date(C(b));break;case"X":c._d=new Date(1e3*parseFloat(b));break;case"Z":case"ZZ":c._useUTC=!0,c._tzm=S(b);break;case"dd":case"ddd":case"dddd":d=c._locale.weekdaysParse(b),null!=d?(c._w=c._w||{},c._w.d=d):c._pf.invalidWeekday=b;break;case"w":case"ww":case"W":case"WW":case"d":case"e":case"E":a=a.substr(0,1);case"gggg":case"GGGG":case"GGGGG":a=a.substr(0,2),b&&(c._w=c._w||{},c._w[a]=C(b));break;case"gg":case"GG":c._w=c._w||{},c._w[a]=vb.parseTwoDigitYear(b)}}function U(a){var c,d,e,f,g,h,i;c=a._w,null!=c.GG||null!=c.W||null!=c.E?(g=1,h=4,d=b(c.GG,a._a[Cb],jb(vb(),1,4).year),e=b(c.W,1),f=b(c.E,1)):(g=a._locale._week.dow,h=a._locale._week.doy,d=b(c.gg,a._a[Cb],jb(vb(),g,h).year),e=b(c.w,1),null!=c.d?(f=c.d,g>f&&++e):f=null!=c.e?c.e+g:g),i=kb(d,e,f,h,g),a._a[Cb]=i.year,a._dayOfYear=i.dayOfYear}function V(a){var c,d,e,f,g=[];if(!a._d){for(e=X(a),a._w&&null==a._a[Eb]&&null==a._a[Db]&&U(a),a._dayOfYear&&(f=b(a._a[Cb],e[Cb]),a._dayOfYear>F(f)&&(a._pf._overflowDayOfYear=!0),d=fb(f,0,a._dayOfYear),a._a[Db]=d.getUTCMonth(),a._a[Eb]=d.getUTCDate()),c=0;3>c&&null==a._a[c];++c)a._a[c]=g[c]=e[c];for(;7>c;c++)a._a[c]=g[c]=null==a._a[c]?2===c?1:0:a._a[c];24===a._a[Fb]&&0===a._a[Gb]&&0===a._a[Hb]&&0===a._a[Ib]&&(a._nextDay=!0,a._a[Fb]=0),a._d=(a._useUTC?fb:eb).apply(null,g),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[Fb]=24)}}function W(a){var b;a._d||(b=A(a._i),a._a=[b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],V(a))}function X(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:[b.getFullYear(),b.getMonth(),b.getDate()]}function Y(b){if(b._f===vb.ISO_8601)return void ab(b);b._a=[],b._pf.empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,j=0;for(e=Q(b._f,b._locale).match(Pb)||[],c=0;c<e.length;c++)f=e[c],d=(h.match(R(f,b))||[])[0],d&&(g=h.substr(0,h.indexOf(d)),g.length>0&&b._pf.unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),j+=d.length),rc[f]?(d?b._pf.empty=!1:b._pf.unusedTokens.push(f),T(f,d,b)):b._strict&&!d&&b._pf.unusedTokens.push(f);b._pf.charsLeftOver=i-j,h.length>0&&b._pf.unusedInput.push(h),b._pf.bigHour===!0&&b._a[Fb]<=12&&(b._pf.bigHour=a),b._a[Fb]=k(b._locale,b._a[Fb],b._meridiem),V(b),H(b)}function Z(a){return a.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e})}function $(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function _(a){var b,c,e,f,g;if(0===a._f.length)return a._pf.invalidFormat=!0,void(a._d=new Date(0/0));for(f=0;f<a._f.length;f++)g=0,b=p({},a),null!=a._useUTC&&(b._useUTC=a._useUTC),b._pf=d(),b._f=a._f[f],Y(b),I(b)&&(g+=b._pf.charsLeftOver,g+=10*b._pf.unusedTokens.length,b._pf.score=g,(null==e||e>g)&&(e=g,c=b));o(a,c||b)}function ab(a){var b,c,d=a._i,e=fc.exec(d);if(e){for(a._pf.iso=!0,b=0,c=hc.length;c>b;b++)if(hc[b][1].exec(d)){a._f=hc[b][0]+(e[6]||" ");break}for(b=0,c=ic.length;c>b;b++)if(ic[b][1].exec(d)){a._f+=ic[b][0];break}d.match(Xb)&&(a._f+="Z"),Y(a)}else a._isValid=!1}function bb(a){ab(a),a._isValid===!1&&(delete a._isValid,vb.createFromInputFallback(a))}function cb(a,b){var c,d=[];for(c=0;c<a.length;++c)d.push(b(a[c],c));return d}function db(b){var c,d=b._i;d===a?b._d=new Date:x(d)?b._d=new Date(+d):null!==(c=Mb.exec(d))?b._d=new Date(+c[1]):"string"==typeof d?bb(b):w(d)?(b._a=cb(d.slice(0),function(a){return parseInt(a,10)}),V(b)):"object"==typeof d?W(b):"number"==typeof d?b._d=new Date(d):vb.createFromInputFallback(b)}function eb(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 1970>a&&h.setFullYear(a),h}function fb(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function gb(a,b){if("string"==typeof a)if(isNaN(a)){if(a=b.weekdaysParse(a),"number"!=typeof a)return null}else a=parseInt(a,10);return a}function hb(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function ib(a,b,c){var d=vb.duration(a).abs(),e=Ab(d.as("s")),f=Ab(d.as("m")),g=Ab(d.as("h")),h=Ab(d.as("d")),i=Ab(d.as("M")),j=Ab(d.as("y")),k=e<oc.s&&["s",e]||1===f&&["m"]||f<oc.m&&["mm",f]||1===g&&["h"]||g<oc.h&&["hh",g]||1===h&&["d"]||h<oc.d&&["dd",h]||1===i&&["M"]||i<oc.M&&["MM",i]||1===j&&["y"]||["yy",j];return k[2]=b,k[3]=+a>0,k[4]=c,hb.apply({},k)}function jb(a,b,c){var d,e=c-b,f=c-a.day();return f>e&&(f-=7),e-7>f&&(f+=7),d=vb(a).add(f,"d"),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function kb(a,b,c,d,e){var f,g,h=fb(a,0,1).getUTCDay();return h=0===h?7:h,c=null!=c?c:e,f=e-h+(h>d?7:0)-(e>h?7:0),g=7*(b-1)+(c-e)+f+1,{year:g>0?a:a-1,dayOfYear:g>0?g:F(a-1)+g}}function lb(b){var c,d=b._i,e=b._f;return b._locale=b._locale||vb.localeData(b._l),null===d||e===a&&""===d?vb.invalid({nullInput:!0}):("string"==typeof d&&(b._i=d=b._locale.preparse(d)),vb.isMoment(d)?new m(d,!0):(e?w(e)?_(b):Y(b):db(b),c=new m(b),c._nextDay&&(c.add(1,"d"),c._nextDay=a),c))}function mb(a,b){var c,d;if(1===b.length&&w(b[0])&&(b=b[0]),!b.length)return vb();for(c=b[0],d=1;d<b.length;++d)b[d][a](c)&&(c=b[d]);return c}function nb(a,b){var c;return"string"==typeof b&&(b=a.localeData().monthsParse(b),"number"!=typeof b)?a:(c=Math.min(a.date(),D(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a)}function ob(a,b){return a._d["get"+(a._isUTC?"UTC":"")+b]()}function pb(a,b,c){return"Month"===b?nb(a,c):a._d["set"+(a._isUTC?"UTC":"")+b](c)}function qb(a,b){return function(c){return null!=c?(pb(this,a,c),vb.updateOffset(this,b),this):ob(this,a)}}function rb(a){return 400*a/146097}function sb(a){return 146097*a/400}function tb(a){vb.duration.fn[a]=function(){return this._data[a]}}function ub(a){"undefined"==typeof ender&&(wb=zb.moment,zb.moment=a?f("Accessing Moment through the global scope is deprecated, and will be removed in an upcoming release.",vb):vb)}for(var vb,wb,xb,yb="2.9.0",zb="undefined"==typeof global||"undefined"!=typeof window&&window!==global.window?this:global,Ab=Math.round,Bb=Object.prototype.hasOwnProperty,Cb=0,Db=1,Eb=2,Fb=3,Gb=4,Hb=5,Ib=6,Jb={},Kb=[],Lb="undefined"!=typeof module&&module&&module.exports,Mb=/^\/?Date\((\-?\d+)/i,Nb=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Ob=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,Pb=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|x|X|zz?|ZZ?|.)/g,Qb=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Rb=/\d\d?/,Sb=/\d{1,3}/,Tb=/\d{1,4}/,Ub=/[+\-]?\d{1,6}/,Vb=/\d+/,Wb=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Xb=/Z|[\+\-]\d\d:?\d\d/gi,Yb=/T/i,Zb=/[\+\-]?\d+/,$b=/[\+\-]?\d+(\.\d{1,3})?/,_b=/\d/,ac=/\d\d/,bc=/\d{3}/,cc=/\d{4}/,dc=/[+-]?\d{6}/,ec=/[+-]?\d+/,fc=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,gc="YYYY-MM-DDTHH:mm:ssZ",hc=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],ic=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],jc=/([\+\-]|\d\d)/gi,kc=("Date|Hours|Minutes|Seconds|Milliseconds".split("|"),{Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6}),lc={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",D:"date",w:"week",W:"isoWeek",M:"month",Q:"quarter",y:"year",DDD:"dayOfYear",e:"weekday",E:"isoWeekday",gg:"weekYear",GG:"isoWeekYear"},mc={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},nc={},oc={s:45,m:45,h:22,d:26,M:11},pc="DDD w W M D d".split(" "),qc="M D H h m s w W".split(" "),rc={M:function(){return this.month()+1},MMM:function(a){return this.localeData().monthsShort(this,a)},MMMM:function(a){return this.localeData().months(this,a)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(a){return this.localeData().weekdaysMin(this,a)},ddd:function(a){return this.localeData().weekdaysShort(this,a)},dddd:function(a){return this.localeData().weekdays(this,a)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return r(this.year()%100,2)},YYYY:function(){return r(this.year(),4)},YYYYY:function(){return r(this.year(),5)},YYYYYY:function(){var a=this.year(),b=a>=0?"+":"-";return b+r(Math.abs(a),6)},gg:function(){return r(this.weekYear()%100,2)},gggg:function(){return r(this.weekYear(),4)},ggggg:function(){return r(this.weekYear(),5)},GG:function(){return r(this.isoWeekYear()%100,2)},GGGG:function(){return r(this.isoWeekYear(),4)},GGGGG:function(){return r(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return C(this.milliseconds()/100)},SS:function(){return r(C(this.milliseconds()/10),2)},SSS:function(){return r(this.milliseconds(),3)},SSSS:function(){return r(this.milliseconds(),3)},Z:function(){var a=this.utcOffset(),b="+";return 0>a&&(a=-a,b="-"),b+r(C(a/60),2)+":"+r(C(a)%60,2)},ZZ:function(){var a=this.utcOffset(),b="+";return 0>a&&(a=-a,b="-"),b+r(C(a/60),2)+r(C(a)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},x:function(){return this.valueOf()},X:function(){return this.unix()},Q:function(){return this.quarter()}},sc={},tc=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"],uc=!1;pc.length;)xb=pc.pop(),rc[xb+"o"]=i(rc[xb],xb);for(;qc.length;)xb=qc.pop(),rc[xb+xb]=h(rc[xb],2);rc.DDDD=h(rc.DDD,3),o(l.prototype,{set:function(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(a){return this._months[a.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(a){return this._monthsShort[a.month()]},monthsParse:function(a,b,c){var d,e,f;for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),d=0;12>d;d++){if(e=vb.utc([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(a){return this._weekdays[a.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(a){return this._weekdaysShort[a.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(a){return this._weekdaysMin[a.day()]},weekdaysParse:function(a){var b,c,d;for(this._weekdaysParse||(this._weekdaysParse=[]),b=0;7>b;b++)if(this._weekdaysParse[b]||(c=vb([2e3,1]).day(b),d="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,""),this._weekdaysParse[b]=new RegExp(d.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b},_longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY LT",LLLL:"dddd, MMMM D, YYYY LT"},longDateFormat:function(a){var b=this._longDateFormat[a];return!b&&this._longDateFormat[a.toUpperCase()]&&(b=this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a]=b),b},isPM:function(a){return"p"===(a+"").toLowerCase().charAt(0)},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(a,b,c){var d=this._calendar[a];return"function"==typeof d?d.apply(b,[c]):d},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(a,b,c,d){var e=this._relativeTime[c];return"function"==typeof e?e(a,b,c,d):e.replace(/%d/i,a)},pastFuture:function(a,b){var c=this._relativeTime[a>0?"future":"past"];return"function"==typeof c?c(b):c.replace(/%s/i,b)},ordinal:function(a){return this._ordinal.replace("%d",a)},_ordinal:"%d",_ordinalParse:/\d{1,2}/,preparse:function(a){return a},postformat:function(a){return a},week:function(a){return jb(a,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},firstDayOfWeek:function(){return this._week.dow},firstDayOfYear:function(){return this._week.doy},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}}),vb=function(b,c,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._i=b,g._f=c,g._l=e,g._strict=f,g._isUTC=!1,g._pf=d(),lb(g)},vb.suppressDeprecationWarnings=!1,vb.createFromInputFallback=f("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}),vb.min=function(){var a=[].slice.call(arguments,0);return mb("isBefore",a)},vb.max=function(){var a=[].slice.call(arguments,0);return mb("isAfter",a)},vb.utc=function(b,c,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._useUTC=!0,g._isUTC=!0,g._l=e,g._i=b,g._f=c,g._strict=f,g._pf=d(),lb(g).utc()},vb.unix=function(a){return vb(1e3*a)},vb.duration=function(a,b){var d,e,f,g,h=a,i=null;return vb.isDuration(a)?h={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(h={},b?h[b]=a:h.milliseconds=a):(i=Nb.exec(a))?(d="-"===i[1]?-1:1,h={y:0,d:C(i[Eb])*d,h:C(i[Fb])*d,m:C(i[Gb])*d,s:C(i[Hb])*d,ms:C(i[Ib])*d}):(i=Ob.exec(a))?(d="-"===i[1]?-1:1,f=function(a){var b=a&&parseFloat(a.replace(",","."));return(isNaN(b)?0:b)*d},h={y:f(i[2]),M:f(i[3]),d:f(i[4]),h:f(i[5]),m:f(i[6]),s:f(i[7]),w:f(i[8])}):null==h?h={}:"object"==typeof h&&("from"in h||"to"in h)&&(g=t(vb(h.from),vb(h.to)),h={},h.ms=g.milliseconds,h.M=g.months),e=new n(h),vb.isDuration(a)&&c(a,"_locale")&&(e._locale=a._locale),e},vb.version=yb,vb.defaultFormat=gc,vb.ISO_8601=function(){},vb.momentProperties=Kb,vb.updateOffset=function(){},vb.relativeTimeThreshold=function(b,c){return oc[b]===a?!1:c===a?oc[b]:(oc[b]=c,!0)},vb.lang=f("moment.lang is deprecated. Use moment.locale instead.",function(a,b){return vb.locale(a,b)}),vb.locale=function(a,b){var c;return a&&(c="undefined"!=typeof b?vb.defineLocale(a,b):vb.localeData(a),c&&(vb.duration._locale=vb._locale=c)),vb._locale._abbr},vb.defineLocale=function(a,b){return null!==b?(b.abbr=a,Jb[a]||(Jb[a]=new l),Jb[a].set(b),vb.locale(a),Jb[a]):(delete Jb[a],null)},vb.langData=f("moment.langData is deprecated. Use moment.localeData instead.",function(a){return vb.localeData(a)}),vb.localeData=function(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return vb._locale;if(!w(a)){if(b=L(a))return b;a=[a]}return K(a)},vb.isMoment=function(a){return a instanceof m||null!=a&&c(a,"_isAMomentObject")},vb.isDuration=function(a){return a instanceof n};for(xb=tc.length-1;xb>=0;--xb)B(tc[xb]);vb.normalizeUnits=function(a){return z(a)},vb.invalid=function(a){var b=vb.utc(0/0);return null!=a?o(b._pf,a):b._pf.userInvalidated=!0,b},vb.parseZone=function(){return vb.apply(null,arguments).parseZone()},vb.parseTwoDigitYear=function(a){return C(a)+(C(a)>68?1900:2e3)},vb.isDate=x,o(vb.fn=m.prototype,{clone:function(){return vb(this)},valueOf:function(){return+this._d-6e4*(this._offset||0)},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var a=vb(this).utc();return 0<a.year()&&a.year()<=9999?"function"==typeof Date.prototype.toISOString?this.toDate().toISOString():P(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):P(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){var a=this;return[a.year(),a.month(),a.date(),a.hours(),a.minutes(),a.seconds(),a.milliseconds()]},isValid:function(){return I(this)},isDSTShifted:function(){return this._a?this.isValid()&&y(this._a,(this._isUTC?vb.utc(this._a):vb(this._a)).toArray())>0:!1},parsingFlags:function(){return o({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(a){return this.utcOffset(0,a)},local:function(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(this._dateUtcOffset(),"m")),this},format:function(a){var b=P(this,a||vb.defaultFormat);return this.localeData().postformat(b)},add:u(1,"add"),subtract:u(-1,"subtract"),diff:function(a,b,c){var d,e,f=M(a,this),g=6e4*(f.utcOffset()-this.utcOffset());return b=z(b),"year"===b||"month"===b||"quarter"===b?(e=j(this,f),"quarter"===b?e/=3:"year"===b&&(e/=12)):(d=this-f,e="second"===b?d/1e3:"minute"===b?d/6e4:"hour"===b?d/36e5:"day"===b?(d-g)/864e5:"week"===b?(d-g)/6048e5:d),c?e:q(e)},from:function(a,b){return vb.duration({to:this,from:a}).locale(this.locale()).humanize(!b)},fromNow:function(a){return this.from(vb(),a)},calendar:function(a){var b=a||vb(),c=M(b,this).startOf("day"),d=this.diff(c,"days",!0),e=-6>d?"sameElse":-1>d?"lastWeek":0>d?"lastDay":1>d?"sameDay":2>d?"nextDay":7>d?"nextWeek":"sameElse";return this.format(this.localeData().calendar(e,this,vb(b)))},isLeapYear:function(){return G(this.year())},isDST:function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},day:function(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=gb(a,this.localeData()),this.add(a-b,"d")):b},month:qb("Month",!0),startOf:function(a){switch(a=z(a)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===a?this.weekday(0):"isoWeek"===a&&this.isoWeekday(1),"quarter"===a&&this.month(3*Math.floor(this.month()/3)),this},endOf:function(b){return b=z(b),b===a||"millisecond"===b?this:this.startOf(b).add(1,"isoWeek"===b?"week":b).subtract(1,"ms")},isAfter:function(a,b){var c;return b=z("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=vb.isMoment(a)?a:vb(a),+this>+a):(c=vb.isMoment(a)?+a:+vb(a),c<+this.clone().startOf(b))},isBefore:function(a,b){var c;return b=z("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=vb.isMoment(a)?a:vb(a),+a>+this):(c=vb.isMoment(a)?+a:+vb(a),+this.clone().endOf(b)<c)},isBetween:function(a,b,c){return this.isAfter(a,c)&&this.isBefore(b,c)},isSame:function(a,b){var c;return b=z(b||"millisecond"),"millisecond"===b?(a=vb.isMoment(a)?a:vb(a),+this===+a):(c=+vb(a),+this.clone().startOf(b)<=c&&c<=+this.clone().endOf(b))},min:f("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(a){return a=vb.apply(null,arguments),this>a?this:a}),max:f("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(a){return a=vb.apply(null,arguments),a>this?this:a}),zone:f("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",function(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}),utcOffset:function(a,b){var c,d=this._offset||0;return null!=a?("string"==typeof a&&(a=S(a)),Math.abs(a)<16&&(a=60*a),!this._isUTC&&b&&(c=this._dateUtcOffset()),this._offset=a,this._isUTC=!0,null!=c&&this.add(c,"m"),d!==a&&(!b||this._changeInProgress?v(this,vb.duration(a-d,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,vb.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?d:this._dateUtcOffset()},isLocal:function(){return!this._isUTC},isUtcOffset:function(){return this._isUTC},isUtc:function(){return this._isUTC&&0===this._offset},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(S(this._i)),this},hasAlignedHourOffset:function(a){return a=a?vb(a).utcOffset():0,(this.utcOffset()-a)%60===0},daysInMonth:function(){return D(this.year(),this.month())},dayOfYear:function(a){var b=Ab((vb(this).startOf("day")-vb(this).startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")},quarter:function(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)},weekYear:function(a){var b=jb(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return null==a?b:this.add(a-b,"y")},isoWeekYear:function(a){var b=jb(this,1,4).year;return null==a?b:this.add(a-b,"y")},week:function(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")},isoWeek:function(a){var b=jb(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")},weekday:function(a){var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")},isoWeekday:function(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)},isoWeeksInYear:function(){return E(this.year(),1,4)},weeksInYear:function(){var a=this.localeData()._week;return E(this.year(),a.dow,a.doy)},get:function(a){return a=z(a),this[a]()},set:function(a,b){var c;if("object"==typeof a)for(c in a)this.set(c,a[c]);else a=z(a),"function"==typeof this[a]&&this[a](b);return this},locale:function(b){var c;return b===a?this._locale._abbr:(c=vb.localeData(b),null!=c&&(this._locale=c),this)},lang:f("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(b){return b===a?this.localeData():this.locale(b)}),localeData:function(){return this._locale},_dateUtcOffset:function(){return 15*-Math.round(this._d.getTimezoneOffset()/15)}}),vb.fn.millisecond=vb.fn.milliseconds=qb("Milliseconds",!1),vb.fn.second=vb.fn.seconds=qb("Seconds",!1),vb.fn.minute=vb.fn.minutes=qb("Minutes",!1),vb.fn.hour=vb.fn.hours=qb("Hours",!0),vb.fn.date=qb("Date",!0),vb.fn.dates=f("dates accessor is deprecated. Use date instead.",qb("Date",!0)),vb.fn.year=qb("FullYear",!0),vb.fn.years=f("years accessor is deprecated. Use year instead.",qb("FullYear",!0)),vb.fn.days=vb.fn.day,vb.fn.months=vb.fn.month,vb.fn.weeks=vb.fn.week,vb.fn.isoWeeks=vb.fn.isoWeek,vb.fn.quarters=vb.fn.quarter,vb.fn.toJSON=vb.fn.toISOString,vb.fn.isUTC=vb.fn.isUtc,o(vb.duration.fn=n.prototype,{_bubble:function(){var a,b,c,d=this._milliseconds,e=this._days,f=this._months,g=this._data,h=0;g.milliseconds=d%1e3,a=q(d/1e3),g.seconds=a%60,b=q(a/60),g.minutes=b%60,c=q(b/60),g.hours=c%24,e+=q(c/24),h=q(rb(e)),e-=q(sb(h)),f+=q(e/30),e%=30,h+=q(f/12),f%=12,g.days=e,g.months=f,g.years=h},abs:function(){return this._milliseconds=Math.abs(this._milliseconds),this._days=Math.abs(this._days),this._months=Math.abs(this._months),this._data.milliseconds=Math.abs(this._data.milliseconds),this._data.seconds=Math.abs(this._data.seconds),this._data.minutes=Math.abs(this._data.minutes),this._data.hours=Math.abs(this._data.hours),this._data.months=Math.abs(this._data.months),this._data.years=Math.abs(this._data.years),this},weeks:function(){return q(this.days()/7)},valueOf:function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*C(this._months/12) },humanize:function(a){var b=ib(this,!a,this.localeData());return a&&(b=this.localeData().pastFuture(+this,b)),this.localeData().postformat(b)},add:function(a,b){var c=vb.duration(a,b);return this._milliseconds+=c._milliseconds,this._days+=c._days,this._months+=c._months,this._bubble(),this},subtract:function(a,b){var c=vb.duration(a,b);return this._milliseconds-=c._milliseconds,this._days-=c._days,this._months-=c._months,this._bubble(),this},get:function(a){return a=z(a),this[a.toLowerCase()+"s"]()},as:function(a){var b,c;if(a=z(a),"month"===a||"year"===a)return b=this._days+this._milliseconds/864e5,c=this._months+12*rb(b),"month"===a?c:c/12;switch(b=this._days+Math.round(sb(this._months/12)),a){case"week":return b/7+this._milliseconds/6048e5;case"day":return b+this._milliseconds/864e5;case"hour":return 24*b+this._milliseconds/36e5;case"minute":return 24*b*60+this._milliseconds/6e4;case"second":return 24*b*60*60+this._milliseconds/1e3;case"millisecond":return Math.floor(24*b*60*60*1e3)+this._milliseconds;default:throw new Error("Unknown unit "+a)}},lang:vb.fn.lang,locale:vb.fn.locale,toIsoString:f("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",function(){return this.toISOString()}),toISOString:function(){var a=Math.abs(this.years()),b=Math.abs(this.months()),c=Math.abs(this.days()),d=Math.abs(this.hours()),e=Math.abs(this.minutes()),f=Math.abs(this.seconds()+this.milliseconds()/1e3);return this.asSeconds()?(this.asSeconds()<0?"-":"")+"P"+(a?a+"Y":"")+(b?b+"M":"")+(c?c+"D":"")+(d||e||f?"T":"")+(d?d+"H":"")+(e?e+"M":"")+(f?f+"S":""):"P0D"},localeData:function(){return this._locale},toJSON:function(){return this.toISOString()}}),vb.duration.fn.toString=vb.duration.fn.toISOString;for(xb in kc)c(kc,xb)&&tb(xb.toLowerCase());vb.duration.fn.asMilliseconds=function(){return this.as("ms")},vb.duration.fn.asSeconds=function(){return this.as("s")},vb.duration.fn.asMinutes=function(){return this.as("m")},vb.duration.fn.asHours=function(){return this.as("h")},vb.duration.fn.asDays=function(){return this.as("d")},vb.duration.fn.asWeeks=function(){return this.as("weeks")},vb.duration.fn.asMonths=function(){return this.as("M")},vb.duration.fn.asYears=function(){return this.as("y")},vb.locale("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===C(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),Lb?module.exports=vb:"function"==typeof define&&define.amd?(define(function(a,b,c){return c.config&&c.config()&&c.config().noGlobal===!0&&(zb.moment=wb),vb}),ub(!0)):ub()}).call(this);;Date.CultureInfo={name:"en-US",englishName:"English (United States)",nativeName:"English (United States)",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],shortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],firstLetterDayNames:["S","M","T","W","T","F","S"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],abbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],amDesignator:"AM",pmDesignator:"PM",firstDayOfWeek:0,twoDigitYearMax:2029,dateElementOrder:"mdy",formatPatterns:{shortDate:"M/d/yyyy",longDate:"dddd, MMMM dd, yyyy",shortTime:"h:mm tt",longTime:"h:mm:ss tt",fullDateTime:"dddd, MMMM dd, yyyy h:mm:ss tt",sortableDateTime:"yyyy-MM-ddTHH:mm:ss",universalSortableDateTime:"yyyy-MM-dd HH:mm:ssZ",rfc1123:"ddd, dd MMM yyyy HH:mm:ss GMT",monthDay:"MMMM dd",yearMonth:"MMMM, yyyy"},regexPatterns:{jan:/^jan(uary)?/i,feb:/^feb(ruary)?/i,mar:/^mar(ch)?/i,apr:/^apr(il)?/i,may:/^may/i,jun:/^jun(e)?/i,jul:/^jul(y)?/i,aug:/^aug(ust)?/i,sep:/^sep(t(ember)?)?/i,oct:/^oct(ober)?/i,nov:/^nov(ember)?/i,dec:/^dec(ember)?/i,sun:/^su(n(day)?)?/i,mon:/^mo(n(day)?)?/i,tue:/^tu(e(s(day)?)?)?/i,wed:/^we(d(nesday)?)?/i,thu:/^th(u(r(s(day)?)?)?)?/i,fri:/^fr(i(day)?)?/i,sat:/^sa(t(urday)?)?/i,future:/^next/i,past:/^last|past|prev(ious)?/i,add:/^(\+|aft(er)?|from|hence)/i,subtract:/^(\-|bef(ore)?|ago)/i,yesterday:/^yes(terday)?/i,today:/^t(od(ay)?)?/i,tomorrow:/^tom(orrow)?/i,now:/^n(ow)?/i,millisecond:/^ms|milli(second)?s?/i,second:/^sec(ond)?s?/i,minute:/^mn|min(ute)?s?/i,hour:/^h(our)?s?/i,week:/^w(eek)?s?/i,month:/^m(onth)?s?/i,day:/^d(ay)?s?/i,year:/^y(ear)?s?/i,shortMeridian:/^(a|p)/i,longMeridian:/^(a\.?m?\.?|p\.?m?\.?)/i,timezone:/^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt|utc)/i,ordinalSuffix:/^\s*(st|nd|rd|th)/i,timeContext:/^\s*(\:|a(?!u|p)|p)/i},timezones:[{name:"UTC",offset:"-000"},{name:"GMT",offset:"-000"},{name:"EST",offset:"-0500"},{name:"EDT",offset:"-0400"},{name:"CST",offset:"-0600"},{name:"CDT",offset:"-0500"},{name:"MST",offset:"-0700"},{name:"MDT",offset:"-0600"},{name:"PST",offset:"-0800"},{name:"PDT",offset:"-0700"}]},function(){var a=Date,b=a.prototype,c=a.CultureInfo,d=function(a,b){return b||(b=2),("000"+a).slice(b*-1)};b.clearTime=function(){return this.setHours(0),this.setMinutes(0),this.setSeconds(0),this.setMilliseconds(0),this},b.setTimeToNow=function(){var a=new Date;return this.setHours(a.getHours()),this.setMinutes(a.getMinutes()),this.setSeconds(a.getSeconds()),this.setMilliseconds(a.getMilliseconds()),this},a.today=function(){return(new Date).clearTime()},a.compare=function(a,b){if(isNaN(a)||isNaN(b))throw new Error(a+" - "+b);if(a instanceof Date&&b instanceof Date)return a<b?-1:a>b?1:0;throw new TypeError(a+" - "+b)},a.equals=function(a,b){return 0===a.compareTo(b)},a.getDayNumberFromName=function(a){for(var b=c.dayNames,d=c.abbreviatedDayNames,e=c.shortestDayNames,f=a.toLowerCase(),g=0;g<b.length;g++)if(b[g].toLowerCase()==f||d[g].toLowerCase()==f||e[g].toLowerCase()==f)return g;return-1},a.getMonthNumberFromName=function(a){for(var b=c.monthNames,d=c.abbreviatedMonthNames,e=a.toLowerCase(),f=0;f<b.length;f++)if(b[f].toLowerCase()==e||d[f].toLowerCase()==e)return f;return-1},a.isLeapYear=function(a){return a%4===0&&a%100!==0||a%400===0},a.getDaysInMonth=function(b,c){return[31,a.isLeapYear(b)?29:28,31,30,31,30,31,31,30,31,30,31][c]},a.getTimezoneAbbreviation=function(a){for(var b=c.timezones,e=0;e<b.length;e++)if(b[e].offset===a)return b[e].name;return null},a.getTimezoneOffset=function(a){for(var b=c.timezones,e=0;e<b.length;e++)if(b[e].name===a.toUpperCase())return b[e].offset;return null},b.clone=function(){return new Date(this.getTime())},b.compareTo=function(a){return Date.compare(this,a)},b.equals=function(a){return Date.equals(this,a||new Date)},b.between=function(a,b){return this.getTime()>=a.getTime()&&this.getTime()<=b.getTime()},b.isAfter=function(a){return 1===this.compareTo(a||new Date)},b.isBefore=function(a){return this.compareTo(a||new Date)===-1},b.isToday=function(){return this.isSameDay(new Date)},b.isSameDay=function(a){return this.clone().clearTime().equals(a.clone().clearTime())},b.addMilliseconds=function(a){return this.setMilliseconds(this.getMilliseconds()+a),this},b.addSeconds=function(a){return this.addMilliseconds(1e3*a)},b.addMinutes=function(a){return this.addMilliseconds(6e4*a)},b.addHours=function(a){return this.addMilliseconds(36e5*a)},b.addDays=function(a){return this.setDate(this.getDate()+a),this},b.addWeeks=function(a){return this.addDays(7*a)},b.addMonths=function(b){var c=this.getDate();return this.setDate(1),this.setMonth(this.getMonth()+b),this.setDate(Math.min(c,a.getDaysInMonth(this.getFullYear(),this.getMonth()))),this},b.addYears=function(a){return this.addMonths(12*a)},b.add=function(a){if("number"==typeof a)return this._orient=a,this;var b=a;return b.milliseconds&&this.addMilliseconds(b.milliseconds),b.seconds&&this.addSeconds(b.seconds),b.minutes&&this.addMinutes(b.minutes),b.hours&&this.addHours(b.hours),b.weeks&&this.addWeeks(b.weeks),b.months&&this.addMonths(b.months),b.years&&this.addYears(b.years),b.days&&this.addDays(b.days),this};var e,f,g;b.getWeek=function(){var a,b,c,d,h,i,j,k,l,m;return e=e?e:this.getFullYear(),f=f?f:this.getMonth()+1,g=g?g:this.getDate(),f<=2?(a=e-1,b=(a/4|0)-(a/100|0)+(a/400|0),c=((a-1)/4|0)-((a-1)/100|0)+((a-1)/400|0),l=b-c,h=0,i=g-1+31*(f-1)):(a=e,b=(a/4|0)-(a/100|0)+(a/400|0),c=((a-1)/4|0)-((a-1)/100|0)+((a-1)/400|0),l=b-c,h=l+1,i=g+(153*(f-3)+2)/5+58+l),j=(a+b)%7,d=(i+j-h)%7,k=i+3-d|0,m=k<0?53-((j-l)/5|0):k>364+l?1:(k/7|0)+1,e=f=g=null,m},b.getISOWeek=function(){return e=this.getUTCFullYear(),f=this.getUTCMonth()+1,g=this.getUTCDate(),d(this.getWeek())},b.setWeek=function(a){return this.moveToDayOfWeek(1).addWeeks(a-this.getWeek())},a._validate=function(a,b,c,d){if("undefined"==typeof a)return!1;if("number"!=typeof a)throw new TypeError(a+" is not a Number.");if(a<b||a>c)throw new RangeError(a+" is not a valid value for "+d+".");return!0},a.validateMillisecond=function(b){return a._validate(b,0,999,"millisecond")},a.validateSecond=function(b){return a._validate(b,0,59,"second")},a.validateMinute=function(b){return a._validate(b,0,59,"minute")},a.validateHour=function(b){return a._validate(b,0,23,"hour")},a.validateDay=function(b,c,d){return a._validate(b,1,a.getDaysInMonth(c,d),"day")},a.validateMonth=function(b){return a._validate(b,0,11,"month")},a.validateYear=function(b){return a._validate(b,0,9999,"year")},b.set=function(b){return a.validateMillisecond(b.millisecond)&&this.addMilliseconds(b.millisecond-this.getMilliseconds()),a.validateSecond(b.second)&&this.addSeconds(b.second-this.getSeconds()),a.validateMinute(b.minute)&&this.addMinutes(b.minute-this.getMinutes()),a.validateHour(b.hour)&&this.addHours(b.hour-this.getHours()),a.validateMonth(b.month)&&this.addMonths(b.month-this.getMonth()),a.validateYear(b.year)&&this.addYears(b.year-this.getFullYear()),a.validateDay(b.day,this.getFullYear(),this.getMonth())&&this.addDays(b.day-this.getDate()),b.timezone&&this.setTimezone(b.timezone),b.timezoneOffset&&this.setTimezoneOffset(b.timezoneOffset),b.week&&a._validate(b.week,0,53,"week")&&this.setWeek(b.week),this},b.moveToFirstDayOfMonth=function(){return this.set({day:1})},b.moveToLastDayOfMonth=function(){return this.set({day:a.getDaysInMonth(this.getFullYear(),this.getMonth())})},b.moveToNthOccurrence=function(a,b){var c=0;if(b>0)c=b-1;else if(b===-1)return this.moveToLastDayOfMonth(),this.getDay()!==a&&this.moveToDayOfWeek(a,-1),this;return this.moveToFirstDayOfMonth().addDays(-1).moveToDayOfWeek(a,1).addWeeks(c)},b.moveToDayOfWeek=function(a,b){var c=(a-this.getDay()+7*(b||1))%7;return this.addDays(0===c?c+=7*(b||1):c)},b.moveToMonth=function(a,b){var c=(a-this.getMonth()+12*(b||1))%12;return this.addMonths(0===c?c+=12*(b||1):c)},b.getOrdinalNumber=function(){return Math.ceil((this.clone().clearTime()-new Date(this.getFullYear(),0,1))/864e5)+1},b.getTimezone=function(){return a.getTimezoneAbbreviation(this.getUTCOffset())},b.setTimezoneOffset=function(a){var b=this.getTimezoneOffset(),c=Number(a)*-6/10;return this.addMinutes(c-b)},b.setTimezone=function(b){return this.setTimezoneOffset(a.getTimezoneOffset(b))},b.hasDaylightSavingTime=function(){return Date.today().set({month:0,day:1}).getTimezoneOffset()!==Date.today().set({month:6,day:1}).getTimezoneOffset()},b.isDaylightSavingTime=function(){return this.hasDaylightSavingTime()&&(new Date).getTimezoneOffset()===Date.today().set({month:6,day:1}).getTimezoneOffset()},b.getUTCOffset=function(){var b,a=this.getTimezoneOffset()*-10/6;return a<0?(b=(a-1e4).toString(),b.charAt(0)+b.substr(2)):(b=(a+1e4).toString(),"+"+b.substr(1))},b.getElapsed=function(a){return(a||new Date)-this},b.toISOString||(b.toISOString=function(){function a(a){return a<10?"0"+a:a}return'"'+this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+'Z"'}),b._toString=b.toString,b.toString=function(a){var b=this;if(a&&1==a.length){var e=c.formatPatterns;switch(b.t=b.toString,a){case"d":return b.t(e.shortDate);case"D":return b.t(e.longDate);case"F":return b.t(e.fullDateTime);case"m":return b.t(e.monthDay);case"r":return b.t(e.rfc1123);case"s":return b.t(e.sortableDateTime);case"t":return b.t(e.shortTime);case"T":return b.t(e.longTime);case"u":return b.t(e.universalSortableDateTime);case"y":return b.t(e.yearMonth)}}var f=function(a){switch(1*a){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th"}};return a?a.replace(/(\\)?(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|S)/g,function(a){if("\\"===a.charAt(0))return a.replace("\\","");switch(b.h=b.getHours,a){case"hh":return d(b.h()<13?0===b.h()?12:b.h():b.h()-12);case"h":return b.h()<13?0===b.h()?12:b.h():b.h()-12;case"HH":return d(b.h());case"H":return b.h();case"mm":return d(b.getMinutes());case"m":return b.getMinutes();case"ss":return d(b.getSeconds());case"s":return b.getSeconds();case"yyyy":return d(b.getFullYear(),4);case"yy":return d(b.getFullYear());case"dddd":return c.dayNames[b.getDay()];case"ddd":return c.abbreviatedDayNames[b.getDay()];case"dd":return d(b.getDate());case"d":return b.getDate();case"MMMM":return c.monthNames[b.getMonth()];case"MMM":return c.abbreviatedMonthNames[b.getMonth()];case"MM":return d(b.getMonth()+1);case"M":return b.getMonth()+1;case"t":return b.h()<12?c.amDesignator.substring(0,1):c.pmDesignator.substring(0,1);case"tt":return b.h()<12?c.amDesignator:c.pmDesignator;case"S":return f(b.getDate());default:return a}}):this._toString()}}(),function(){var a=Date,b=a.prototype,c=a.CultureInfo,d=Number.prototype;b._orient=1,b._nth=null,b._is=!1,b._same=!1,b._isSecond=!1,d._dateElement="day",b.next=function(){return this._orient=1,this},a.next=function(){return a.today().next()},b.last=b.prev=b.previous=function(){return this._orient=-1,this},a.last=a.prev=a.previous=function(){return a.today().last()},b.is=function(){return this._is=!0,this},b.same=function(){return this._same=!0,this._isSecond=!1,this},b.today=function(){return this.same().day()},b.weekday=function(){return!!this._is&&(this._is=!1,!this.is().sat()&&!this.is().sun())},b.at=function(b){return"string"==typeof b?a.parse(this.toString("d")+" "+b):this.set(b)},d.fromNow=d.after=function(a){var b={};return b[this._dateElement]=this,(a?a.clone():new Date).add(b)},d.ago=d.before=function(a){var b={};return b[this._dateElement]=this*-1,(a?a.clone():new Date).add(b)};var j,e="sunday monday tuesday wednesday thursday friday saturday".split(/\s/),f="january february march april may june july august september october november december".split(/\s/),g="Millisecond Second Minute Hour Day Week Month Year".split(/\s/),h="Milliseconds Seconds Minutes Hours Date Week Month FullYear".split(/\s/),i="final first second third fourth fifth".split(/\s/);b.toObject=function(){for(var a={},b=0;b<g.length;b++)a[g[b].toLowerCase()]=this["get"+h[b]]();return a},a.fromObject=function(a){return a.week=null,Date.today().set(a)};for(var k=function(b){return function(){if(this._is)return this._is=!1,this.getDay()==b;if(null!==this._nth){this._isSecond&&this.addSeconds(this._orient*-1),this._isSecond=!1;var c=this._nth;this._nth=null;var d=this.clone().moveToLastDayOfMonth();if(this.moveToNthOccurrence(b,c),this>d)throw new RangeError(a.getDayName(b)+" does not occur "+c+" times in the month of "+a.getMonthName(d.getMonth())+" "+d.getFullYear()+".");return this}return this.moveToDayOfWeek(b,this._orient)}},l=function(b){return function(){var d=a.today(),e=b-d.getDay();return 0===b&&1===c.firstDayOfWeek&&0!==d.getDay()&&(e+=7),d.addDays(e)}},m=0;m<e.length;m++)a[e[m].toUpperCase()]=a[e[m].toUpperCase().substring(0,3)]=m,a[e[m]]=a[e[m].substring(0,3)]=l(m),b[e[m]]=b[e[m].substring(0,3)]=k(m);for(var n=function(a){return function(){return this._is?(this._is=!1,this.getMonth()===a):this.moveToMonth(a,this._orient)}},o=function(b){return function(){return a.today().set({month:b,day:1})}},p=0;p<f.length;p++)a[f[p].toUpperCase()]=a[f[p].toUpperCase().substring(0,3)]=p,a[f[p]]=a[f[p].substring(0,3)]=o(p),b[f[p]]=b[f[p].substring(0,3)]=n(p);for(var q=function(a){return function(){if(this._isSecond)return this._isSecond=!1,this;if(this._same){this._same=this._is=!1;for(var b=this.toObject(),c=(arguments[0]||new Date).toObject(),d="",e=a.toLowerCase(),f=g.length-1;f>-1;f--){if(d=g[f].toLowerCase(),b[d]!=c[d])return!1;if(e==d)break}return!0}return"s"!=a.substring(a.length-1)&&(a+="s"),this["add"+a](this._orient)}},r=function(a){return function(){return this._dateElement=a,this}},s=0;s<g.length;s++)j=g[s].toLowerCase(),b[j]=b[j+"s"]=q(g[s]),d[j]=d[j+"s"]=r(j);b._ss=q("Second");for(var t=function(a){return function(b){return this._same?this._ss(arguments[0]):b||0===b?this.moveToNthOccurrence(b,a):(this._nth=a,2!==a||void 0!==b&&null!==b?this:(this._isSecond=!0,this.addSeconds(this._orient)))}},u=0;u<i.length;u++)b[i[u]]=t(0===u?-1:u)}(),function(){Date.Parsing={Exception:function(a){this.message="Parse error at '"+a.substring(0,10)+" ...'"}};for(var a=Date.Parsing,b=a.Operators={rtoken:function(b){return function(c){var d=c.match(b);if(d)return[d[0],c.substring(d[0].length)];throw new a.Exception(c)}},token:function(a){return function(a){return b.rtoken(new RegExp("^s*"+a+"s*"))(a)}},stoken:function(a){return b.rtoken(new RegExp("^"+a))},until:function(a){return function(b){for(var c=[],d=null;b.length;){try{d=a.call(this,b)}catch(a){c.push(d[0]),b=d[1];continue}break}return[c,b]}},many:function(a){return function(b){for(var c=[],d=null;b.length;){try{d=a.call(this,b)}catch(a){return[c,b]}c.push(d[0]),b=d[1]}return[c,b]}},optional:function(a){return function(b){var c=null;try{c=a.call(this,b)}catch(a){return[null,b]}return[c[0],c[1]]}},not:function(b){return function(c){try{b.call(this,c)}catch(a){return[null,c]}throw new a.Exception(c)}},ignore:function(a){return a?function(b){var c=null;return c=a.call(this,b),[null,c[1]]}:null},product:function(){for(var a=arguments[0],c=Array.prototype.slice.call(arguments,1),d=[],e=0;e<a.length;e++)d.push(b.each(a[e],c));return d},cache:function(b){var c={},d=null;return function(e){try{d=c[e]=c[e]||b.call(this,e)}catch(a){d=c[e]=a}if(d instanceof a.Exception)throw d;return d}},any:function(){var b=arguments;return function(c){for(var d=null,e=0;e<b.length;e++)if(null!=b[e]){try{d=b[e].call(this,c)}catch(a){d=null}if(d)return d}throw new a.Exception(c)}},each:function(){var b=arguments;return function(c){for(var d=[],e=null,f=0;f<b.length;f++)if(null!=b[f]){try{e=b[f].call(this,c)}catch(b){throw new a.Exception(c)}d.push(e[0]),c=e[1]}return[d,c]}},all:function(){var a=arguments,b=b;return b.each(b.optional(a))},sequence:function(c,d,e){return d=d||b.rtoken(/^\s*/),e=e||null,1==c.length?c[0]:function(b){for(var f=null,g=null,h=[],i=0;i<c.length;i++){try{f=c[i].call(this,b)}catch(a){break}h.push(f[0]);try{g=d.call(this,f[1])}catch(a){g=null;break}b=g[1]}if(!f)throw new a.Exception(b);if(g)throw new a.Exception(g[1]);if(e)try{f=e.call(this,f[1])}catch(b){throw new a.Exception(f[1])}return[h,f?f[1]:b]}},between:function(a,c,d){d=d||a;var e=b.each(b.ignore(a),c,b.ignore(d));return function(a){var b=e.call(this,a);return[[b[0][0],r[0][2]],b[1]]}},list:function(a,c,d){return c=c||b.rtoken(/^\s*/),d=d||null,a instanceof Array?b.each(b.product(a.slice(0,-1),b.ignore(c)),a.slice(-1),b.ignore(d)):b.each(b.many(b.each(a,b.ignore(c))),px,b.ignore(d))},set:function(c,d,e){return d=d||b.rtoken(/^\s*/),e=e||null,function(f){for(var g=null,h=null,i=null,j=null,k=[[],f],l=!1,m=0;m<c.length;m++){i=null,h=null,g=null,l=1==c.length;try{g=c[m].call(this,f)}catch(a){continue}if(j=[[g[0]],g[1]],g[1].length>0&&!l)try{i=d.call(this,g[1])}catch(a){l=!0}else l=!0;if(l||0!==i[1].length||(l=!0),!l){for(var n=[],o=0;o<c.length;o++)m!=o&&n.push(c[o]);h=b.set(n,d).call(this,i[1]),h[0].length>0&&(j[0]=j[0].concat(h[0]),j[1]=h[1])}if(j[1].length<k[1].length&&(k=j),0===k[1].length)break}if(0===k[0].length)return k;if(e){try{i=e.call(this,k[1])}catch(b){throw new a.Exception(k[1])}k[1]=i[1]}return k}},forward:function(a,b){return function(c){return a[b].call(this,c)}},replace:function(a,b){return function(c){var d=a.call(this,c);return[b,d[1]]}},process:function(a,b){return function(c){var d=a.call(this,c);return[b.call(this,d[0]),d[1]]}},min:function(b,c){return function(d){var e=c.call(this,d);if(e[0].length<b)throw new a.Exception(d);return e}}},c=function(a){return function(){var b=null,c=[];if(arguments.length>1?b=Array.prototype.slice.call(arguments):arguments[0]instanceof Array&&(b=arguments[0]),!b)return a.apply(null,arguments);for(var d=0,e=b.shift();d<e.length;d++)return b.unshift(e[d]),c.push(a.apply(null,b)),b.shift(),c}},d="optional not ignore cache".split(/\s/),e=0;e<d.length;e++)b[d[e]]=c(b[d[e]]);for(var f=function(a){return function(){return arguments[0]instanceof Array?a.apply(null,arguments[0]):a.apply(null,arguments)}},g="each any all".split(/\s/),h=0;h<g.length;h++)b[g[h]]=f(b[g[h]])}(),function(){var a=Date,c=(a.prototype,a.CultureInfo),d=function(a){for(var b=[],c=0;c<a.length;c++)a[c]instanceof Array?b=b.concat(d(a[c])):a[c]&&b.push(a[c]);return b};a.Grammar={},a.Translator={hour:function(a){return function(){this.hour=Number(a)}},minute:function(a){return function(){this.minute=Number(a)}},second:function(a){return function(){this.second=Number(a)}},meridian:function(a){return function(){this.meridian=a.slice(0,1).toLowerCase()}},timezone:function(a){return function(){var b=a.replace(/[^\d\+\-]/g,"");b.length?this.timezoneOffset=Number(b):this.timezone=a.toLowerCase()}},day:function(a){var b=a[0];return function(){this.day=Number(b.match(/\d+/)[0])}},month:function(a){return function(){this.month=3==a.length?"jan feb mar apr may jun jul aug sep oct nov dec".indexOf(a)/4:Number(a)-1}},year:function(a){return function(){var b=Number(a);this.year=a.length>2?b:b+(b+2e3<c.twoDigitYearMax?2e3:1900)}},rday:function(a){return function(){switch(a){case"yesterday":this.days=-1;break;case"tomorrow":this.days=1;break;case"today":this.days=0;break;case"now":this.days=0,this.now=!0}}},finishExact:function(b){b=b instanceof Array?b:[b];for(var c=0;c<b.length;c++)b[c]&&b[c].call(this);var d=new Date;if(!this.hour&&!this.minute||this.month||this.year||this.day||(this.day=d.getDate()),this.year||(this.year=d.getFullYear()),this.month||0===this.month||(this.month=d.getMonth()),this.day||(this.day=1),this.hour||(this.hour=0),this.minute||(this.minute=0),this.second||(this.second=0),this.meridian&&this.hour&&("p"==this.meridian&&this.hour<12?this.hour=this.hour+12:"a"==this.meridian&&12==this.hour&&(this.hour=0)),this.day>a.getDaysInMonth(this.year,this.month))throw new RangeError(this.day+" is not a valid value for days.");var e=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second);return this.timezone?e.set({timezone:this.timezone}):this.timezoneOffset&&e.set({timezoneOffset:this.timezoneOffset}),e},finish:function(b){if(b=b instanceof Array?d(b):[b],0===b.length)return null;for(var c=0;c<b.length;c++)"function"==typeof b[c]&&b[c].call(this);var e=a.today();if(this.now&&!this.unit&&!this.operator)return new Date;this.now&&(e=new Date);var g,h,i,f=!!(this.days&&null!==this.days||this.orient||this.operator);if(i="past"==this.orient||"subtract"==this.operator?-1:1,this.now||"hour minute second".indexOf(this.unit)==-1||e.setTimeToNow(),(this.month||0===this.month)&&"year day hour minute second".indexOf(this.unit)!=-1&&(this.value=this.month+1,this.month=null,f=!0),!f&&this.weekday&&!this.day&&!this.days){var j=Date[this.weekday]();this.day=j.getDate(),this.month||(this.month=j.getMonth()),this.year=j.getFullYear()}if(f&&this.weekday&&"month"!=this.unit&&(this.unit="day",g=a.getDayNumberFromName(this.weekday)-e.getDay(),h=7,this.days=g?(g+i*h)%h:i*h),this.month&&"day"==this.unit&&this.operator&&(this.value=this.month+1,this.month=null),null!=this.value&&null!=this.month&&null!=this.year&&(this.day=1*this.value),this.month&&!this.day&&this.value&&(e.set({day:1*this.value}),f||(this.day=1*this.value)),this.month||!this.value||"month"!=this.unit||this.now||(this.month=this.value,f=!0),f&&(this.month||0===this.month)&&"year"!=this.unit&&(this.unit="month",g=this.month-e.getMonth(),h=12,this.months=g?(g+i*h)%h:i*h,this.month=null),this.unit||(this.unit="day"),!this.value&&this.operator&&null!==this.operator&&this[this.unit+"s"]&&null!==this[this.unit+"s"]?this[this.unit+"s"]=this[this.unit+"s"]+("add"==this.operator?1:-1)+(this.value||0)*i:null!=this[this.unit+"s"]&&null==this.operator||(this.value||(this.value=1),this[this.unit+"s"]=this.value*i),this.meridian&&this.hour&&("p"==this.meridian&&this.hour<12?this.hour=this.hour+12:"a"==this.meridian&&12==this.hour&&(this.hour=0)),this.weekday&&!this.day&&!this.days){var j=Date[this.weekday]();this.day=j.getDate(),j.getMonth()!==e.getMonth()&&(this.month=j.getMonth())}return!this.month&&0!==this.month||this.day||(this.day=1),this.orient||this.operator||"week"!=this.unit||!this.value||this.day||this.month?(f&&this.timezone&&this.day&&this.days&&(this.day=this.days),f?e.add(this):e.set(this)):Date.today().setWeek(this.value)}};var h,e=a.Parsing.Operators,f=a.Grammar,g=a.Translator;f.datePartDelimiter=e.rtoken(/^([\s\-\.\,\/\x27]+)/),f.timePartDelimiter=e.stoken(":"),f.whiteSpace=e.rtoken(/^\s*/),f.generalDelimiter=e.rtoken(/^(([\s\,]|at|@|on)+)/);var i={};f.ctoken=function(a){var b=i[a];if(!b){for(var d=c.regexPatterns,f=a.split(/\s+/),g=[],h=0;h<f.length;h++)g.push(e.replace(e.rtoken(d[f[h]]),f[h]));b=i[a]=e.any.apply(null,g)}return b},f.ctoken2=function(a){return e.rtoken(c.regexPatterns[a])},f.h=e.cache(e.process(e.rtoken(/^(0[0-9]|1[0-2]|[1-9])/),g.hour)),f.hh=e.cache(e.process(e.rtoken(/^(0[0-9]|1[0-2])/),g.hour)),f.H=e.cache(e.process(e.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/),g.hour)),f.HH=e.cache(e.process(e.rtoken(/^([0-1][0-9]|2[0-3])/),g.hour)),f.m=e.cache(e.process(e.rtoken(/^([0-5][0-9]|[0-9])/),g.minute)),f.mm=e.cache(e.process(e.rtoken(/^[0-5][0-9]/),g.minute)),f.s=e.cache(e.process(e.rtoken(/^([0-5][0-9]|[0-9])/),g.second)),f.ss=e.cache(e.process(e.rtoken(/^[0-5][0-9]/),g.second)),f.hms=e.cache(e.sequence([f.H,f.m,f.s],f.timePartDelimiter)),f.t=e.cache(e.process(f.ctoken2("shortMeridian"),g.meridian)),f.tt=e.cache(e.process(f.ctoken2("longMeridian"),g.meridian)),f.z=e.cache(e.process(e.rtoken(/^((\+|\-)\s*\d\d\d\d)|((\+|\-)\d\d\:?\d\d)/),g.timezone)),f.zz=e.cache(e.process(e.rtoken(/^((\+|\-)\s*\d\d\d\d)|((\+|\-)\d\d\:?\d\d)/),g.timezone)),f.zzz=e.cache(e.process(f.ctoken2("timezone"),g.timezone)),f.timeSuffix=e.each(e.ignore(f.whiteSpace),e.set([f.tt,f.zzz])),f.time=e.each(e.optional(e.ignore(e.stoken("T"))),f.hms,f.timeSuffix),f.d=e.cache(e.process(e.each(e.rtoken(/^([0-2]\d|3[0-1]|\d)/),e.optional(f.ctoken2("ordinalSuffix"))),g.day)),f.dd=e.cache(e.process(e.each(e.rtoken(/^([0-2]\d|3[0-1])/),e.optional(f.ctoken2("ordinalSuffix"))),g.day)),f.ddd=f.dddd=e.cache(e.process(f.ctoken("sun mon tue wed thu fri sat"),function(a){return function(){this.weekday=a}})),f.M=e.cache(e.process(e.rtoken(/^(1[0-2]|0\d|\d)/),g.month)),f.MM=e.cache(e.process(e.rtoken(/^(1[0-2]|0\d)/),g.month)),f.MMM=f.MMMM=e.cache(e.process(f.ctoken("jan feb mar apr may jun jul aug sep oct nov dec"),g.month)),f.y=e.cache(e.process(e.rtoken(/^(\d\d?)/),g.year)),f.yy=e.cache(e.process(e.rtoken(/^(\d\d)/),g.year)),f.yyy=e.cache(e.process(e.rtoken(/^(\d\d?\d?\d?)/),g.year)),f.yyyy=e.cache(e.process(e.rtoken(/^(\d\d\d\d)/),g.year)),h=function(){return e.each(e.any.apply(null,arguments),e.not(f.ctoken2("timeContext")))},f.day=h(f.d,f.dd),f.month=h(f.M,f.MMM),f.year=h(f.yyyy,f.yy),f.orientation=e.process(f.ctoken("past future"),function(a){return function(){this.orient=a}}),f.operator=e.process(f.ctoken("add subtract"),function(a){return function(){this.operator=a}}),f.rday=e.process(f.ctoken("yesterday tomorrow today now"),g.rday),f.unit=e.process(f.ctoken("second minute hour day week month year"),function(a){return function(){this.unit=a}}),f.value=e.process(e.rtoken(/^\d\d?(st|nd|rd|th)?/),function(a){return function(){this.value=a.replace(/\D/g,"")}}),f.expression=e.set([f.rday,f.operator,f.value,f.unit,f.orientation,f.ddd,f.MMM]),h=function(){return e.set(arguments,f.datePartDelimiter)},f.mdy=h(f.ddd,f.month,f.day,f.year),f.ymd=h(f.ddd,f.year,f.month,f.day),f.dmy=h(f.ddd,f.day,f.month,f.year),f.date=function(a){return(f[c.dateElementOrder]||f.mdy).call(this,a)},f.format=e.process(e.many(e.any(e.process(e.rtoken(/^(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?)/),function(b){if(f[b])return f[b];throw a.Parsing.Exception(b)}),e.process(e.rtoken(/^[^dMyhHmstz]+/),function(a){return e.ignore(e.stoken(a))}))),function(a){return e.process(e.each.apply(null,a),g.finishExact)});var j={},k=function(a){return j[a]=j[a]||f.format(a)[0]};f.formats=function(a){if(a instanceof Array){for(var b=[],c=0;c<a.length;c++)b.push(k(a[c]));return e.any.apply(null,b)}return k(a)},f._formats=f.formats(['"yyyy-MM-ddTHH:mm:ssZ"',"yyyy-MM-ddTHH:mm:ssZ","yyyy-MM-ddTHH:mm:ssz","yyyy-MM-ddTHH:mm:ss","yyyy-MM-ddTHH:mmZ","yyyy-MM-ddTHH:mmz","yyyy-MM-ddTHH:mm","ddd, MMM dd, yyyy H:mm:ss tt","ddd MMM d yyyy HH:mm:ss zzz","MMddyyyy","ddMMyyyy","Mddyyyy","ddMyyyy","Mdyyyy","dMyyyy","yyyy","Mdyy","dMyy","d"]),f._start=e.process(e.set([f.date,f.time,f.expression],f.generalDelimiter,f.whiteSpace),g.finish),f.start=function(a){try{var b=f._formats.call({},a);if(0===b[1].length)return b}catch(a){}return f._start.call({},a)},a._parse=a.parse,a.parse=function(b){var c=null;if(!b)return null;if(b instanceof Date)return b;try{c=a.Grammar.start.call({},b.replace(/^\s*(\S*(\s+\S+)*)\s*$/,"$1"))}catch(a){return null}return 0===c[1].length?c[0]:null},a.getParseFunction=function(b){var c=a.Grammar.formats(b);return function(a){var b=null;try{b=c.call({},a)}catch(a){return null}return 0===b[1].length?b[0]:null}},a.parseExact=function(b,c){return a.getParseFunction(c)(b)}}();;jQuery(function ($) { $(document).on('click', '.btn_add_wishlist', function (event) { var $this = $(this); $.ajax({ url : st_params.ajax_url, type : "POST", data : {action: "st_add_wishlist", data_id: $(this).data('id'), data_type: $(this).data('type')}, dataType : "json", beforeSend: function () { } }).done(function (html) { $this.html(html.icon).attr("data-original-title", html.title) }) }); var st_loadding_wishlist = $('.infor-st-setting.st-wishlist-wrap .st-loadding-wishlist'); $(document).on('click', '.btn_remove_wishlist', function (event) { var $this = $(this); var item_remove = $(this).closest(); $.ajax({ url : st_params.ajax_url, type : "POST", data : {action: "st_remove_wishlist", data_id: $(this).data('id'), data_type: $(this).data('type')}, dataType : "json", beforeSend: function () { st_loadding_wishlist.show(); //$('.post-' + $this.attr('data-id') + ' .user_img_loading').show() } }).done(function (html) { st_loadding_wishlist.hide(); if (html.status == 'true') { $('.post-' + html.msg).html(console_msg(html.type, html.content)).attr("data-original-title", html.title) } else { $('.post-' + html.msg).append(console_msg(html.type, html.content)).attr("data-original-title", html.title) } window.location.reload(); }) }); $('.btn_load_more_wishlist').on('click', function () { var $this = $(this); var txt_me = $this.html(); $.ajax({ url : st_params.ajax_url, type : "GET", data : { action : "st_load_more_wishlist", data_per : $('.btn_load_more_wishlist').attr('data-per'), data_next: $('.btn_load_more_wishlist').attr('data-next') }, dataType : "json", beforeSend: function () { $this.html('Loading...') } }).done(function (html) { $this.html(txt_me); $('#data_whislist').append(html.msg); if (html.status == 'true') { $('.btn_load_more_wishlist').attr('data-per', html.data_per) } else { $('.btn_load_more_wishlist').attr('disabled', 'disabled'); $('.btn_load_more_wishlist').html('No More') } }) }); $('#btn_add_media').on('click', function () { $('#my_image_upload').trigger('click') }); $('#my_image_upload').on('change', function () { $('#submit_my_image_upload').trigger('click') }); $('.btn_remove_post_type').on('click', function () { var $this = $(this); $.ajax({ url : st_params.ajax_url, type : "POST", data : { action : "st_remove_post_type", data_id : $(this).attr('data-id'), data_id_user: $(this).attr('data-id-user') }, dataType : "json", beforeSend: function () { $('.post-' + $this.attr('data-id') + ' .user_img_loading').show() } }).done(function (html) { if (html.status == 'true') { $('.post-' + html.msg).html(console_msg(html.type, html.content)) } else { $('.post-' + html.msg).append(console_msg(html.type, html.content)) } }) }); function console_msg(type, content) { var txt = '<div class="alert alert-' + type + ' mt10"> <button data-dismiss="alert" type="button" class="close"><span aria-hidden="true">x</span> </button> <p class="text-small">' + content + '</p> </div>'; return txt } $('#btn_check_insert_post_type_hotel').on('click', function () { var dk = !0; if (dk == !0) { $('#btn_insert_post_type_hotel').trigger('click') } }); $('#btn_check_insert_post_type_room').on('click', function () { var dk = !0; if (kt_rong('title', 'Warning : Room Name could not left empty') != !0) { dk = !1 } if (kt_chieudai('title', 'Warning : Room Name no shorter than 4 characters', 4) != !0) { dk = !1 } if (dk == !0) { $('#btn_insert_post_type_room').trigger('click') } }); $(document).on('click', '.btn_del_price_custom', function () { $(this).parent().parent().remove() }); $('#btn_add_custom_price').on('click', function () { var $item = $('.data_price_html').html(); $('.content_data_price').append($item); $('input.date-pick, .input-daterange, .date-pick-inline').datepicker({language: st_params.locale || '',todayHighlight: !0, weekStart: 1}) }); $('#btn_add_custom_price_by_number').on('click', function () { var $item = $('.data_price_by_number_html').html(); $('.content_data_price_by_number').append($item) }); $('#btn_add_extra_price').on('click', function (event) { var $item = $('.data-extra-price-html').html(); $('.content_extra_price').append($item) }); $(document).on('click', '.btn_del_extra_price', function () { $(this).parents('.item').remove() }); $('#btn_check_insert_post_type_tours').on('click', function () { var dk = !0; if (dk == !0) { $('#btn_insert_post_type_tours').trigger('click') } }); $('#btn_check_insert_activity').on('click', function () { var dk = !0; if (dk == !0) { $('#btn_insert_post_type_activity').trigger('click') } }); $('#btn_check_insert_cars').on('click', function () { var dk = !0; if (dk == !0) { $('#btn_insert_post_type_cars').trigger('click') } }); $('#btn_check_insert_post_type_rental').on('click', function () { var dk = !0; if (dk == !0) { $('#btn_insert_post_type_rental').trigger('click') } }); $('#btn_check_insert_post_type_cruise').on('click', function () { var dk = !0; if (dk == !0) { $('#btn_insert_post_type_cruise').trigger('click') } }); $('#btn_check_insert_cruise_cabin').on('click', function () { var dk = !0; if (dk == !0) { $('#btn_insert_cruise_cabin').trigger('click') } }); $('#btn_check_insert_post_type_location').on('click', function () { var dk = !0; if (dk == !0) { $('#btn_insert_post_type_location').trigger('click') } }); function validate_fileupload(fileName, msg) { var allowed_extensions = new Array("jpg", "png", "gif"); var file_extension = fileName.split('.').pop(); for (var i = 0; i <= allowed_extensions.length; i++) { if (allowed_extensions[i] == file_extension) { $('.msg').html(''); return !0 } } $('.msg').html('<div class="alert alert-danger msg_image"> <button aria-label="" data-dismiss="alert" class="close" type="button"><span aria-hidden="true">�</span></button> <p>' + msg + '</p> </div>'); return !1 } function checkLinkUrl(div, thongbao) { var str = $('#' + div).val(); var pattern = new RegExp('^(https?:\/\/)?' + '((([a-z\d]([a-z\d-]*[a-z\d])*)\.)+[a-z]{2,}|' + '((\d{1,3}\.){3}\d{1,3}))' + '(\:\d+)?(\/[-a-z\d%_.~+]*)*' + '(\?[;&a-z\d%_.~+=-]*)?' + '(\#[-a-z\d_]*)?$', 'i'); if (!pattern.test(str)) { $('.console_msg_' + div).html(console_msg('danger', thongbao)); $('#' + div).css('borderColor', "red"); return !1 } else { $('.console_msg_' + div).html(''); $('#' + div).css('borderColor', "#C6DBE0"); return !0 } } function kt_rong(div, thongbao) { var value = $('#' + div).val(); if (value == "" || value == null) { $('.console_msg_' + div).html(console_msg('danger', thongbao)); $('#' + div).css('borderColor', "red"); return !1 } else { $('.console_msg_' + div).html(''); $('#' + div).css('borderColor', "#C6DBE0"); return !0 } } function kt_chieudai(div, thongbao, chieudai) { var value = $('#' + div).val(); if (value.length == chieudai || value.length < chieudai) { $('.console_msg_' + div).html(console_msg('danger', thongbao)); $('#' + div).css('borderColor', "red"); return !1 } else { $('.console_msg_' + div).html(''); $('#' + div).css('borderColor', "#C6DBE0"); return !0 } } function kt_so(div, thongbao) { var value = $('#' + div).val(); if (isNaN(value) == !0) { $('.console_msg_' + div).html(console_msg('danger', thongbao)); $('#' + div).css('borderColor', "red"); return !1 } else { $('.console_msg_' + div).html(''); $('#' + div).css('borderColor', "#C6DBE0"); return !0 } } function checkEmail(div, thongbao) { var value = $('#' + div).val(); if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(value)) { $('.console_msg_' + div).html(''); $('#' + div).css('borderColor', "#C6DBE0"); return !0 } else { $('.console_msg_' + div).html(console_msg('danger', thongbao)); $('#' + div).css('borderColor', "red"); return !1 } } $(document).on('change', '.btn-file :file', function () { var input = $(this), label = input.val().replace(/\\/g, '/').replace(/.*\//, ''); input.parent().parent().parent().find(".data_lable").val(label) }); $(document).on('change', '.btn-file.multiple :file', function () { var $this = $(this); var files = $this[0].files; var txt = ''; for (var i = 0; i < files.length; i++) { txt += files[i].name + " , " } $this.parent().parent().parent().find(".data_lable").val(txt) }); $('.btn_del_avatar').on('click', function () { $('#id_avatar_user_setting').val(''); $('.data_lable').val('') }); function str2num(val) { val = '0' + val; val = parseFloat(val); return val } $('.btn_load_his_withdrawal').on('click', function () { var $this = $(this); var txt_me = $this.html(); $.ajax({ url : st_params.ajax_url, type : "GET", data : {action: "st_load_more_list_withdrawal", paged: $this.attr('data-per'), show: "json",}, dataType : "json", beforeSend: function () { $this.html(st_params.text_loading) } }).done(function (html) { $this.html(txt_me); if (html.status == 'true') { $this.attr('data-per', html.data_per); $this.parent().find('#data_history_withdrawal').append(html.html) } else { $this.attr('disabled', 'disabled'); $this.html(st_params.text_no_more) } }) }); $('.btn_load_his_book').on('click', function () { var $this = $(this); var txt_me = $this.html(); $.ajax({ url : st_params.ajax_url, type : "GET", data : { action : "st_load_more_history_book", paged : $this.attr('data-per'), show : "json", data_type: $this.attr('data-type') }, dataType : "json", beforeSend: function () { $this.html(st_params.text_loading) } }).done(function (html) { $this.html(txt_me); if (html.status == 'true') { $this.attr('data-per', html.data_per); $this.parent().find('#data_history_book').append(html.html) } else { $this.attr('disabled', 'disabled'); $this.html(st_params.text_no_more) } }) }); $('#btn_add_program').on('click', function () { var html = $('#html_program').html(); $('#data_program').append(html) }); $('#btn_add_equipment_item').on('click', function () { var html = $('#html_equipment_item').html(); $('#data_equipment_item').append(html) }); $('#btn_add_features').on('click', function () { var html = $('#html_features').html(); $('#data_features').append(html) }); $('#btn_add_features_rental').on('click', function () { var html = $('#html_features_rental').html(); $('#data_features_rental').append(html) }); $(document).on('click', '.btn_del_program', function () { $(this).parent().parent().parent().remove() }); $('li.menu_partner a').on('click', function () { var type = $(this).next('.sub_partner').css('display'); if (type == "none") { $(this).next('.sub_partner').slideDown(500); $('.icon_partner', this).removeClass("fa-angle-left").addClass("fa-angle-down") } else { $(this).next('.sub_partner').slideUp(500); $('.icon_partner', this).removeClass("fa-angle-down").addClass("fa-angle-left") } }); $('.btn_on_off_post_type_partner').on('click', function () { var $this = $(this); $.ajax({ url : st_params.ajax_url, type : "POST", data : { action : "st_change_status_post_type", data_id : $(this).attr('data-id'), data_id_user: $(this).attr('data-id-user'), status : $(this).attr('data-status') }, dataType : "json", beforeSend: function () { $('.post-' + $this.attr('data-id') + ' .user_img_loading').show() } }).done(function (html) { $('.post-' + $this.attr('data-id') + ' .user_img_loading').hide(); if (html.status == 'true') { if ($this.attr('data-status') == 'on') { $this.attr('data-status', 'off'); $this.removeClass('fa-eye-slash').addClass('fa-eye') } else { $this.attr('data-status', 'on'); $this.removeClass('fa-eye').addClass('fa-eye-slash') } } else { } }) }); $('#add-new-facility').on('click', function (event) { var html = $('#template').html(); $('#facility-wrapper').append(html).find('.facility-item').show(); event.preventDefault() }); $('#facility-wrapper').on('click', '.btn_del_facility', function (event) { $(this).closest('.facility-item').remove() }); $('.btn_featured_image').on('click', function () { var $this = $(this); $this.parent().parent().find('#id_featured_image').val(''); $this.parent().parent().find('.data_lable').val(''); $this.parent().remove() }); $('.btn_del_logo').on('click', function () { var $this = $(this); $this.parent().parent().find('#id_logo').val(''); $this.parent().parent().find('.data_lable').val(''); $this.parent().remove() }); $('.btn_del_gallery').on('click', function () { var $this = $(this); $this.parent().parent().find('#id_gallery').val(''); $this.parent().parent().find('.data_lable').val(''); $this.parent().remove() }); $('#btn_add_custom_paid_options').on('click', function () { var html = $('.paid_options_html').html(); $('.content_data_paid_options').append(html) }); $('#btn_add_custom_add_new_facility').on('click', function () { var html = $('.add_new_facility_html').html(); $('.content_data_add_new_facility').append(html); $('.st_icon').each(function () { $(this).iconpicker({icons: st_icon_picker.icon_list, iconClassPrefix: ' '}) }) }); $(document).on('click', '.btn_del_custom_partner', function () { $(this).parent().parent().parent().remove() }); $('#btn_discount_by_adult').on('click', function () { var html = $('#html_discount_by_adult').html(); $('#data_discount_by_adult').append(html) }); $('#btn_discount_by_child').on('click', function () { var html = $('#html_discount_by_child').html(); $('#data_discount_by_child').append(html) }); $("#btn_hotel_policy").on('click', function () { var html = $("#html_hotel_policy").html(); $("#data_hotel_policy").append(html) }); $('#btn_add_social').on('click', function () { var html = $('#html_add_social').html(); $('#data_add_social').append(html) }); function fix_user_menu() { setTimeout(function () { var height_conent = $('.row_content_partner').height(); var content_width = $('body').width(); if (height_conent > 0 && content_width > 960) { $('.user-left-menu>.st-page-sidebar-new').css("min-height", height_conent) } }, 1500) } jQuery(window).on("load", function ($) { fix_user_menu() }); jQuery(window).on('resize', function ($) { fix_user_menu() }); $('#st_form_add_partner .number').each(function () { var $this = $(this); $this.on('change', function () { var number = $(this).val(); number = parseFloat(number); if (isNaN(number)) { number = 0 } $(this).val(number) }) }); $('#st_form_add_partner input.date-pick').each(function () { var form = $(this).closest('form'); $(this, form).datepicker('setStartDate', 'today') }); $('.check_all').on('ifClicked', function (event) { var $this = $(this); if ($this.prop('checked')) { $this.parent().parent().parent().parent().parent().find('.item_tanoxomy').iCheck('uncheck') } else { $this.parent().parent().parent().parent().parent().find('.item_tanoxomy').iCheck('check') } }); $('.item_tanoxomy').on('ifClicked', function (event) { var $this = $(this); var is_check = !0; $this.parent().parent().parent().parent().parent().find('.item_tanoxomy').each(function () { var $this2 = $(this); setTimeout(function () { if ($this2.prop('checked') == "") { is_check = !1 } }, 100) }); setTimeout(function () { if (is_check == !0) { $this.parent().parent().parent().parent().parent().find('.check_all').iCheck('check') } else { $this.parent().parent().parent().parent().parent().find('.check_all').iCheck('uncheck') } }, 200) }); check_show_hiden('is_sale_schedule', 'data_is_sale_schedule'); check_show_hiden('st_tour_external_booking', 'data_st_tour_external_booking'); check_show_hiden('st_rental_external_booking', 'data_st_rental_external_booking'); check_show_hiden('st_activity_external_booking', 'data_st_activity_external_booking'); check_show_hiden('st_room_external_booking', 'data_st_room_external_booking'); check_show_hiden('st_car_external_booking', 'data_st_car_external_booking'); check_show_hiden('best-price-guarantee', 'data_best-price-guarantee'); function check_show_hiden(div, div_data) { if ($("." + div).val() == 'on') { $('.' + div_data).fadeIn(500) } else { $('.' + div_data).fadeOut(500) } $('.' + div).on('change', function () { if ($(this).val() == 'on') { $('.' + div_data).fadeIn(500) } else { $('.' + div_data).fadeOut(500) } }) } if ($(".deposit_payment_status").val() != '') { $('.data_deposit_payment_status').fadeIn(500) } else { $('.data_deposit_payment_status').fadeOut(500) } $('.deposit_payment_status').on('change', function () { if ($(this).val() != '') { $('.data_deposit_payment_status').fadeIn(500) } else { $('.data_deposit_payment_status').fadeOut(500) } }); if ($(".is_auto_caculate").val() == 'off') { $('.data_is_auto_caculate').fadeIn(500) } else { $('.data_is_auto_caculate').fadeOut(500) } $('.is_auto_caculate').on('change', function () { if ($(this).val() == 'off') { $('.data_is_auto_caculate').fadeIn(500) } else { $('.data_is_auto_caculate').fadeOut(500) } }); if ($(".is_custom_price").val() == 'price_by_date') { $('.data_price_by_date').fadeIn(500); $('.data_price_by_number').fadeOut(0) } else { $('.data_price_by_date').fadeOut(0); $('.data_price_by_number').fadeIn(500) } $('.is_custom_price').on('change', function () { if ($(this).val() == 'price_by_date') { $('.data_price_by_date').fadeIn(500); $('.data_price_by_number').fadeOut(0) } else { $('.data_price_by_date').fadeOut(0); $('.data_price_by_number').fadeIn(500) } }); if($('#car_type').val() == 'car_transfer'){ $('.car-price-type').fadeIn(); $('.car-passengers').fadeIn(); $('.car-journey').fadeIn(); }else{ $('.car-price-type').fadeOut(); $('.car-passengers').fadeOut(); $('.car-journey').fadeOut(); } $('#car_type').on('change', function () { if ($(this).val() == 'car_transfer') { $('.car-price-type').fadeIn(); $('.car-passengers').fadeIn(); $('.car-journey').fadeIn(); } else { $('.car-price-type').fadeOut(); $('.car-passengers').fadeOut(); $('.car-journey').fadeOut(); } }); setTimeout(function () { $('.div_btn_submit input[type=submit]').prop('disabled', false) }, 5000) }); jQuery(function ($) { if ($("#st_form_add_partner").hasClass('success') == !0) { $("#st_form_add_partner input[type=text]").val(''); $("#st_form_add_partner input[type=email]").val(''); $("#st_form_add_partner input[type=number]").val('0'); $("#st_form_add_partner .st_content").val(''); $("#st_form_add_partner textarea").html(''); $("#st_form_add_partner .user-profile-avatar").html(''); $("#st_form_add_partner .id_featured_image").val(''); $("#st_form_add_partner .id_logo").val(''); $("#st_form_add_partner .data_lable").val(''); $("#st_form_add_partner .content_data_add_new_facility").html(''); $("#st_form_add_partner .content_data_paid_options").html(''); $("#st_form_add_partner .content_data_price").html(''); $("#st_form_add_partner .selectize-input").html(''); $('#st_form_add_partner select').prop('selectedIndex', 0); $("#st_form_add_partner").find('.item_tanoxomy').iCheck('uncheck') } $('.input-daterange input.st_date_start').each(function () { var form = $(this).closest('form'); var me = $(this); $(this).datepicker({ language : st_params.locale, autoclose : !0, todayHighlight: !0, startDate : 'today', format : $('[data-date-format]').data('date-format'), weekStart : 1 }).on('changeDate', function (e) { var new_date = e.date; new_date.setDate(new_date.getDate() + 1); $('.input-daterange input.st_date_end', form).datepicker('setDates', new_date); $('.input-daterange input.st_date_end', form).datepicker('setStartDate', new_date) }); $('.input-daterange input.st_date_end', form).datepicker({ language : st_params.locale, startDate : '+1d', format : $('[data-date-format]').data('date-format'), autoclose : !0, todayHighlight: !0 }) }) }); jQuery(function ($) { $(document).on('click', '.st_menu_new li.item', function () { var content = $(this).parent(); var $this = $(this); if ($this.hasClass('active') == !1) { content.find('li.item').removeClass("active").find('.sub-menu').css('display', 'none'); $this.find('.sub-menu').fadeIn(500); $this.addClass("active") } }); $('.input-date-start').each(function () { var form = $(this).closest('form'); var me = $(this); $(this).datepicker({ language : st_params.locale, autoclose : !0, todayHighlight: !0, todayBtn : !0, format : $(this).data('date-format'), weekStart : 1 }).on('changeDate', function (e) { var new_date = e.date; new_date.setDate(new_date.getDate() + 1); $('.input-date-end', form).datepicker('setDates', new_date) }); $('.input-date-end', form).datepicker({ language : st_params.locale, format : $(this).data('date-format'), autoclose : !0, todayBtn : !0, todayHighlight: !0, weekStart : 1 }) }); $(document).on('click', '.btn_show_custom_date', function () { var $this = $(this); if ($this.hasClass('open') == !0) { $(".div-custom-date").fadeOut(); $this.removeClass('open') } else { $(".div-custom-date").fadeIn(); $this.addClass('open') } }); $(document).on('click', '.btn_cancel', function () { $(".div-custom-date").fadeOut(); $('.btn_show_custom_date').removeClass('open') }); if ($('.custom_select_date').val() == 'custom_date||') { $('.data_custom_date').fadeIn() } else { $('.data_custom_date').fadeOut() } $(document).on('change', '.custom_select_date', function () { var type = $(this).val(); if (type == 'custom_date||') { $('.data_custom_date').fadeIn() } else { $('.data_custom_date').fadeOut() } }); $(document).on('click', '.btn_show_month_by_year', function () { var $content = $(this).parent().parent().parent(); $content.find('tr').removeClass('active'); $(this).parent().parent().addClass('active'); var $this = $(this); var $post_type = $this.data('post-type'); var $year = $this.data('year'); $.ajax({ url : st_params.ajax_url, type : "POST", data : {action: "st_load_month_by_year_partner", data_year: $year, data_post_type: $post_type}, dataType : "json", beforeSend: function () { $content.find('.active a.btn_show_month_by_year').html($this.data('loading')) } }).done(function (html) { $('.div_single_month .data_month').html(html.html); $('.div_single_month .bc_single').html(html.bc_title); $content.find('.active a.btn_show_month_by_year').html($this.data('title')); $('.div_single_year').hide(); $('.div_single_day').hide(); $('.div_single_month').fadeIn(); $('.div_single_custom').hide(); init_canvas_detail_post_type('st_div_item_canvas_month', html.id_rand, $post_type, html.js.lable, html.js.data) }).error(function (html) { console.error(html) }) }); $(document).on('click', '.btn_show_day_by_month_year_partner', function () { var $content = $(this).parent().parent().parent(); $content.find('tr').removeClass('active'); $(this).parent().parent().addClass('active'); var $this = $(this); var $post_type = $this.data('post-type'); var $year = $this.data('year'); var $month = $this.data('month'); $.ajax({ url : st_params.ajax_url, type : "POST", data : { action : "st_load_day_by_month_and_year_partner", data_year : $year, data_month : $month, data_post_type: $post_type }, dataType : "json", beforeSend: function () { $content.find('.active a.btn_show_day_by_month_year_partner').html($this.data('loading')) } }).done(function (html) { $('.div_single_day .data_day').html(html.html); $('.div_single_day .bc_single').html(html.bc_title); $content.find('.active a.btn_show_day_by_month_year_partner').html($this.data('title')); $('.div_single_year').hide(); $('.div_single_month').hide(); $('.div_single_day').fadeIn(); init_canvas_detail_post_type('st_div_item_canvas_day', html.id_rand, $post_type, html.js.lable, html.js.data) }).error(function (html) { console.error(html) }) }); $(document).on('click', '.btn_single_all_time', function () { $('.div_single_year').fadeIn(); $('.div_single_month').hide(); $('.div_single_day').hide() }); $(document).on('click', '.btn_single_year', function () { $('.div_single_year').hide(); $('.div_single_month').fadeIn(); $('.div_single_day').hide() }); $(document).on('click', '.btn_all_time_show_month_by_year', function () { var $content = $(this).parent().parent().parent(); $content.find('tr').removeClass('active'); $(this).parent().parent().addClass('active'); var $this = $(this); var $year = $this.data('year'); $.ajax({ url : st_params.ajax_url, type : "POST", data : {action: "st_load_month_all_time_by_year_partner", data_year: $year}, dataType : "json", beforeSend: function () { $content.find('.active a.btn_all_time_show_month_by_year').html($this.data('loading')) } }).done(function (html) { $('.div_all_time_month .data_all_time_month').html(html.html); $('.div_all_time_month .bc_all_time').html(html.bc_title); $content.find('.active a.btn_all_time_show_month_by_year').html($this.data('title')); $('.div_all_time_year').hide(); $('.div_all_time_day').hide(); $('.div_all_time_month').fadeIn(); $('.div_custom_month').hide(); init_canvas_detail_post_type('st_div_item_all_time_canvas_month', html.id_rand, 'st_hotel', html.js.lable, html.js.data) }).error(function (html) { console.error(html) }) }); $(document).on('click', '.btn_all_time_show_day_by_month_year_partner', function () { var $content = $(this).parent().parent().parent(); $content.find('tr').removeClass('active'); $(this).parent().parent().addClass('active'); var $this = $(this); var $year = $this.data('year'); var $month = $this.data('month'); $.ajax({ url : st_params.ajax_url, type : "POST", data : { action : "st_load_day_all_time_by_month_and_year_partner", data_year : $year, data_month: $month }, dataType : "json", beforeSend: function () { $content.find('.active a.btn_all_time_show_day_by_month_year_partner').html($this.data('loading')) } }).done(function (html) { $('.div_all_time_day .data_all_time_day').html(html.html); $('.div_all_time_day .bc_all_time').html(html.bc_title); $content.find('.active a.btn_all_time_show_day_by_month_year_partner').html($this.data('title')); $('.div_all_time_year').hide(); $('.div_all_time_month').hide(); $('.div_all_time_day').fadeIn(); init_canvas_detail_post_type('st_div_item_all_time_canvas_day', html.id_rand, 'st_hotel', html.js.lable, html.js.data) }).error(function (html) { console.error(html) }) }); $(document).on('click', '.btn_all_time', function () { $('.div_all_time_year').fadeIn(); $('.div_all_time_month').hide(); $('.div_all_time_day').hide() }); $(document).on('click', '.btn_all_time_year', function () { $('.div_all_time_year').hide(); $('.div_all_time_month').fadeIn(); $('.div_all_time_day').hide() }); function init_canvas_detail_post_type(div_content, id_rand, post_type, lable, data_item) { var id_div = 'canvas_detail_post_type_' + id_rand; var $content = $("." + div_content); $content.html('<canvas id="' + id_div + '" height="150"></canvas>'); lable = eval(lable); data_item = eval(data_item); var color = '237,​ 131,​ 35'; switch (post_type) { case "st_hotel": color = '81,145,250'; //color = '87, 142, 190'; break; case "st_rental": color = '81,145,250'; //color = '227, 91, 90'; break; case "st_cars": color = '81,145,250'; //color = '68, 182, 174'; break; case "st_tours": color = '81,145,250'; //color = '135, 117, 167'; break; case "st_activity": color = '81,145,250'; //color = '39, 174, 96'; break } var lineChartData = { labels : lable, datasets: [{ label : "My First", fillColor : "rgba(" + color + ", 0.8)", strokeColor : "rgba(" + color + ", 1)", pointColor : "rgba(" + color + ", 1)", pointStrokeColor : "#fff", pointHighlightFill : "#fff", pointHighlightStroke: "rgba(" + color + ", 1)", data : data_item, }], }; var ctx = document.getElementById(id_div).getContext("2d"); var stChart_year = new Chart(ctx, { type: 'line', data: { labels: lable, datasets: [{ data: data_item, lineTension:0, borderColor: "rgba(81,145,250, 1)", backgroundColor: "rgba(81,145,250, 0.4)", pointBackgroundColor: "rgba(81,145,250, 1)", pointBorderColor: "rgba(81,145,250, 1)", pointHoverBackgroundColor: "rgba(81,145,250, 1)", pointHoverBorderColor: "rgba(81,145,250, 1)", borderWidth: 2 }] }, options: { responsive: true, maintainAspectRatio: false, legend: { display: false }, scales: { yAxes: [{ ticks: { beginAtZero: true } }] } } }) $('canvas#' + id_div).css({height: 'auto', width: '100%', maxHeight: '100%'}); // new Chart(ctx).Line(lineChartData, {bezierCurve : false,responsive: !0, animationEasing: "easeOutBounce",}) } if ($('.st_timepicker').length) { var time_picker_arg = {timeFormat: "hh:mm tt", showMeridian: !1}; if (st_params.time_format == '12h') { time_picker_arg.showMeridian = !0 } else { time_picker_arg.showMeridian = !1 } $('.st_timepicker').timepicker(time_picker_arg) } $('.st_icon').each(function () { $(this).iconpicker({icons: st_icon_picker.icon_list, iconClassPrefix: ' '}) }) }); jQuery(function ($) { if ($(".register_form").data("reset") == !0) { $(".register_form .data_field :input[type=text]").each(function () { $(this).val('') }); $(".data_image_certificates").each(function () { $(this).html('') }) } $('.register_form .register_as').on('ifChecked', function (event) { var value = $(this).val(); if (value == "partner") { $(".content_partner").slideDown(1000) } if (value == "normal") { $(".content_partner").slideUp(1000) } }); if ($(".register_form .register_as:checked").val() == "partner") { $(".content_partner").show() } $(".register_form .st_certificates").on('change', function () { var post_type = $(this).data('type') }); function upload_certificates(post_type) { var formData = new FormData($('.register_form')[0]); formData.append('action', 'update_certificates'); formData.append('post_type', post_type); $(".div_" + post_type).find(".data_image_certificates").html("<img src=" + st_params.loading_url + " />"); $(".div_" + post_type).find(".i-check").iCheck('check'); $.ajax({ type : "POST", url : st_params.ajax_url, enctype : 'multipart/form-data', data : formData, processData: !1, contentType: !1, dataType : "json", xhr : function () { var xhr = new window.XMLHttpRequest(); xhr.addEventListener("progress", function (evt) { if (evt.lengthComputable) { var percentComplete = evt.loaded / evt.total; console.log(Math.round(percentComplete * 100)) } }, !1); return xhr }, success : function (data) { if (data.erro_msg == "") { $(".div_" + post_type).find(".data_lable.st_certificates_" + post_type + "_url").css("border-color", "#ccc"); $(".div_" + post_type).find(".data_image_certificates").html(data.html_image); $(".div_" + post_type).find(".st_certificates_" + post_type + "_url").val(data.image_url) } else { $(".div_" + post_type).find(".data_lable.st_certificates_" + post_type + "_url").css("border-color", "red"); $(".div_" + post_type).find(".data_lable.st_certificates_" + post_type + "_url").val(data.erro_msg); $(".div_" + post_type).find(".data_image_certificates").html('') } } }) } var register_form = $('.register_form'); $('.register_form').on('submit', function () { if ($(this).hasClass("update_info_partner") == !1) { if (!validate_register()) { return !1 } } }); function validate_register() { var validate = !0; try { if ($("#field-user_name").val() == "") { $("#field-user_name").css('border-color', 'red'); validate = !1 } else { $("#field-user_name").css('border-color', '#ccc') } ; if ($("#field-password").val() == "") { $("#field-password").css('border-color', 'red'); validate = !1 } else { $("#field-password").css('border-color', '#ccc') } ; if ($("#field-email").val() == "") { $("#field-email").css('border-color', 'red'); validate = !1 } else { $("#field-email").css('border-color', '#ccc') } ; if ($(".term_condition:checked").val() != "on") { $(".term_condition").parent().css('border-color', 'red'); validate = !1 } else { $(".term_condition").parent().css('border-color', '#ccc') } } catch (e) { console.log(e) } return validate } if ($('input#address').length) { var bt_ot_gmap_input_lat = $('input.bt_ot_gmap_input_lat'); var bt_ot_gmap_input_lng = $('input.bt_ot_gmap_input_lng'); var bt_ot_gmap_st_street_number = $('#bt_ot_gmap_st_street_number'); var bt_ot_gmap_st_locality = $('#bt_ot_gmap_st_locality'); var bt_ot_gmap_st_route = $('#bt_ot_gmap_st_route'); var bt_ot_gmap_st_sublocality_level_1 = $('#bt_ot_gmap_st_sublocality_level_1'); var bt_ot_gmap_st_administrative_area_level_2 = $('#bt_ot_gmap_st_administrative_area_level_2'); var bt_ot_gmap_st_administrative_area_level_1 = $('#bt_ot_gmap_st_administrative_area_level_1'); var bt_ot_gmap_st_country = $('#bt_ot_gmap_st_country'); var input = $('input#address').get(0); var autocomplete = new google.maps.places.Autocomplete(input); autocomplete.addListener('place_changed', function () { var places = autocomplete.getPlace(); if (places.length == 0) { return } bt_ot_gmap_input_lat.val(places.geometry.location.lat()); bt_ot_gmap_input_lng.val(places.geometry.location.lng()); bt_ot_gmap_st_street_number.val(''); bt_ot_gmap_st_locality.val(''); bt_ot_gmap_st_route.val(''); bt_ot_gmap_st_sublocality_level_1.val(''); bt_ot_gmap_st_administrative_area_level_2.val(''); bt_ot_gmap_st_administrative_area_level_1.val(''); bt_ot_gmap_st_country.val(''); $.each(places.address_components, function (index, names) { if ($.inArray('street_number', names.types) != -1) { bt_ot_gmap_st_street_number.val(names.long_name) } if ($.inArray('locality', names.types) != -1) { bt_ot_gmap_st_locality.val(names.long_name) } if ($.inArray('route', names.types) != -1) { bt_ot_gmap_st_route.val(names.long_name) } if ($.inArray('sublocality_level_1', names.types) != -1) { bt_ot_gmap_st_sublocality_level_1.val(names.long_name) } if ($.inArray('administrative_area_level_2', names.types) != -1) { bt_ot_gmap_st_administrative_area_level_2.val(names.long_name) } if ($.inArray('administrative_area_level_1', names.types) != -1) { bt_ot_gmap_st_administrative_area_level_1.val(names.long_name) } if ($.inArray('country', names.types) != -1) { bt_ot_gmap_st_country.val(names.long_name) } }) }) } $(document).on('click', '.paged_item_service', function () { var container = $(this).parent().parent().parent().parent(); var paged = $(this).data('page'); var user_id = $(this).data('user-id'); var post_type = $(this).data('post-type'); $.ajax({ url : st_params.ajax_url, type : "POST", data : { action : "get_list_item_service_available", data_page : paged, data_user_id : user_id, data_post_type: post_type, st_ajax : 1 }, dataType : "json", beforeSend: function () { container.find(".ajax_loader").show() } }).done(function (html) { container.find(".data_single_partner").html(html.data); container.find(".paging_single_partner").html(html.paging); container.find(".ajax_loader").hide(); $('.st-popup-gallery').each(function () { $(this).magnificPopup({delegate: '.st-gp-item', type: 'image', gallery: {enabled: !0}}) }) }) }); $('.car_location_pick_up').each(function (index, el) { var t = $(this); t.select2({ placeholder : t.data('placeholder'), minimumInputLength: 2, ajax : { url : ajaxurl, dataType: 'json', quietMillis: 250, data: function (term, page) { return {q: term, action: 'st_post_select_ajax', post_type: 'location'} }, results: function (data, page) { return {results: data.items} }, cache : !0 }, formatResult : function (state) { if (!state.id)return state.name; return state.name + '<p><em>' + state.description + '</em></p>' }, formatSelection : function (state) { if (!state.id)return state.name; return state.name + '<p><em>' + state.description + '</em></p>' }, escapeMarkup : function (m) { return m } }); t.on("change", function (e) { if (typeof e.added != 'undefined' && typeof e.added.name != 'undefined') { t.attr('data-name', e.added.name) } var location = e.val; var t2; if (location != '') { $('.car_location_drop_off').each(function (index, el) { t2 = $(this); t2.select2({ placeholder : t.data('placeholder'), ajax : { url : ajaxurl, dataType : 'json', quietMillis: 250, data : function (term, page) { return {action: 'st_get_location_childs', location_id: location} }, results : function (data, page) { return {results: data.items} }, cache : !0 }, formatResult : function (state) { if (!state.id)return state.name; return state.name + '<p><em>' + state.description + '</em></p>' }, formatSelection: function (state) { if (!state.id)return state.name; return state.name + '<p><em>' + state.description + '</em></p>' }, escapeMarkup : function (m) { return m } }); t2.on("change", function (e) { if (typeof e.added != 'undefined' && typeof e.added.name != 'undefined') { t2.attr('data-name', e.added.name) } }) }) } }) }); function add_list_location_selected(lists) { var string = ""; var data = ""; if (locations.length) { $.each(locations, function (index, val) { string += "<p class='item-location-from-to' data-index=" + index + " style='padding: 5px; margin-top: 5px; border-bottom: 1px solid #CCC; background: #EEE; font-weight: bold;'>" + val.pickup_text + " -> " + val.dropoff_text + " <span class='delete-item-location-from-to'>x</span></p>"; data += '<input type="hidden" name="locations_from_to[pickup][]" value="' + val.pickup + '"><input type="hidden" name="locations_from_to[dropoff][]" value="' + val.dropoff + '">' }) } $('#location-car-selected').html(string); $('.location-save-data').html(data) } var locations = st_location_from_to.lists; add_list_location_selected(locations); $('#add-location-from-to').on('click', function (event) { $('p.location-message').html(''); var pickup = $('input.car_location_pick_up').val(); var dropoff = $('input.car_location_drop_off').val(); if (pickup != '' && dropoff != '') { var pickup_text = $('input.car_location_pick_up').attr('data-name'); var dropoff_text = $('input.car_location_drop_off').attr('data-name'); locations.push({pickup: pickup, pickup_text: pickup_text, dropoff: dropoff, dropoff_text: dropoff_text}); $('.car_location_drop_off').select2('data', null) } else { $('p.location-message').html('Please select pick up and drop off location!') } add_list_location_selected(locations); return !1 }); $('body').on('click', '.delete-item-location-from-to', function (event) { var parent = $(this).parent('.item-location-from-to') var index = parent.data('index'); locations.splice(index, 1); add_list_location_selected(locations) }); if ($('select#location_type').length) { var val = $('select#location_type').val(); fadeLocation(val) } $('select#location_type').on('change', function (event) { var val = $(this).val(); fadeLocation(val) }); function fadeLocation(val) { if (val == 'multi_location') { $('.multi_location_wrapper').fadeIn(); $('.location_from_to_wrapper').fadeOut() } if (val == 'check_in_out') { $('.multi_location_wrapper').fadeOut(); $('.location_from_to_wrapper').fadeIn() } } if ($('.st-select-loction').length) { $('.st-select-loction').each(function (index, el) { var parent = $(this); var input = $('input[name="search"]', parent); var list = $('.list-location-wrapper', parent); var timeout; input.on('keyup', function (event) { clearTimeout(timeout); var t = $(this); timeout = setTimeout(function () { var text = t.val().toLowerCase(); if (text == '') { $('.item', list).show() } else { $('.item', list).hide(); $(".item", list).each(function () { var name = $(this).data("name").toLowerCase(); var reg = new RegExp(text, "g"); if (reg.test(name)) { $(this).show() } }) } }, 100) }) }) } $('#st_partner_payout').on('change', function () { var is_pay = $(this).val(); if (is_pay == "paypal") { $('.content_partner_paypal').show(); $('.content_partner_stripe').hide() } if (is_pay == "stripe") { $('.content_partner_paypal').hide(); $('.content_partner_stripe').show() } }); var is_pay = $('#st_partner_payout').val(); if (is_pay == "paypal") { $('.content_partner_paypal').show(); $('.content_partner_stripe').hide() } if (is_pay == "stripe") { $('.content_partner_paypal').hide(); $('.content_partner_stripe').show() } $(".st_partner_payout_item .item-pay").on('click', function () { $('.st_partner_payout_item').find('.item-pay').removeClass('active'); $(this).parent().find('.st_partner_payout').iCheck('check'); $(this).addClass('active'); var is_pay = $(this).parent().find('.st_partner_payout').val(); $('.item.st_partner_payout_item').hide(); $(".st_partner_payout_item_" + is_pay).fadeIn(500); $(".item.st_partner_payout_item.control").fadeIn(500) }); $(".st_partner_payout_item .item-pay").each(function () { var check = $(this).hasClass('active'); if (check) { var is_pay = $(this).parent().find('.st_partner_payout').val(); $(".st_partner_payout_item_" + is_pay).fadeIn(500); $(".item.st_partner_payout_item.control").fadeIn(500) } }); $(document).on('click', '.btn_del_withdrawal', function (event) { var $this = $(this); var btn_html = $this.parent().html(); var content = $this.parent().parent(); $.ajax({ url : st_params.ajax_url, type : "POST", data : { action : "st_remove_withdrawal", data_user_id : $(this).data('user-id'), data_date_create: $(this).data('date-create') }, dataType : "json", beforeSend: function () { $this.parent().html('<img src="' + st_params.loading_url + '" />') } }).done(function (html) { if (html.status == 'true') { content.fadeOut() } else { } }) }); $('body').on('click', '.confirm-cancel-booking', function (event) { event.preventDefault(); var el = $(this); $('#cancel-booking-modal').on('show.bs.modal', function (event) { var t = $(this); $('.modal-content-inner', t).empty(); $('.overlay-form', t).fadeIn() }); $('#cancel-booking-modal').on('shown.bs.modal', function (event) { var t = $(this); var data = { 'action' : 'st_get_cancel_booking_step_1', 'order_id' : el.data('order_id'), 'order_encrypt': el.data('order_encrypt') }; $.post(st_params.ajax_url, data, function (respon, textStatus, xhr) { if (typeof respon == 'object') { $('.modal-content-inner', t).html(respon.message); t.data('order_id', respon.order_id); t.data('order_encrypt', respon.order_encrypt); $('.modal-footer button.next', t).attr('id', respon.step) } $('.overlay-form', t).fadeOut() }, 'json') }) }); var flag_next_step = !1; $('body').on('click', '#next-to-step-2', function (event) { event.preventDefault(); var el = $(this); var parent = el.closest('#cancel-booking-modal'); if (flag_next_step) { return !1 } flag_next_step = !0; $('.overlay-form', parent).fadeIn(); el.addClass('hidden'); var data = { 'action' : 'st_get_cancel_booking_step_2', 'order_id' : parent.data('order_id'), 'order_encrypt': parent.data('order_encrypt'), 'why_cancel' : $('input[name="why_cancel"]', parent).val(), 'detail' : $('textarea', parent).val() }; $.post(st_params.ajax_url, data, function (respon, textStatus, xhr) { if (typeof respon == 'object') { $('.modal-content-inner', parent).html(respon.message); parent.data('order_id', respon.order_id); parent.data('order_encrypt', respon.order_encrypt); $('.modal-footer button.next', parent).attr('id', respon.step) } $('.overlay-form', parent).fadeOut(); flag_next_step = !1 }, 'json') }); var flag_refresh_page = !1; $('body').on('click', '#next-to-step-3', function (event) { event.preventDefault(); var el = $(this); var parent = el.closest('#cancel-booking-modal'); var form = $('form', parent); if (flag_next_step) { return !1 } flag_next_step = !0; flag_refresh_page = !1; $('.overlay-form', parent).fadeIn(); $validate = check_validate(form); if ($validate == !1) { $('.overlay-form', parent).fadeOut(); flag_next_step = !1; return !1 } var data = form.serializeArray(); data.push({name: 'action', value: 'st_get_cancel_booking_step_3'}, { name : 'order_id', value: parent.data('order_id') }, {name: 'order_encrypt', value: parent.data('order_encrypt')}); $.post(st_params.ajax_url, data, function (respon, textStatus, xhr) { if (typeof respon == 'object') { $('.modal-content-inner', parent).html(respon.message); $('.overlay-form', parent).fadeOut(); flag_next_step = !1; flag_refresh_page = !0; $('button.next', parent).attr('id', respon.step).addClass('hidden') } }, 'json') }); function check_validate(form) { var validate = !0; $('.required', form).each(function (index, el) { var val = $(this).val(); if (val == '') { validate = !1; $(this).addClass('error') } else { $(this).removeClass('error') } }); return validate } $('#cancel-booking-modal').on('hidden.bs.modal', function (event) { var t = $(this); t.off('show.bs.modal shown.bs.modal'); $('.overlay-form', t).fadeOut(); $('.modal-content-inner', t).empty(); t.data('order_id', ''); t.data('order_encrypt', ''); if (flag_refresh_page) { window.location.reload() } }); $('body').on('change', '#cancel-booking-modal input[name="why_cancel"]', function (event) { event.preventDefault(); var t = $(this); var parent = t.parents('form'); var modal = t.closest('#cancel-booking-modal'); var value = t.val(); var text = t.data('text'); if (typeof value != 'undefined' && value != '') { $('.modal-footer button.next').removeClass('hidden') } else { $('.modal-footer button.next').addClass('hidden') } if (value == 'other') { $('textarea', parent).val('').removeClass('hide') } else { $('textarea', parent).val(text).addClass('hide') } }); $('body').on('change', '#cancel-booking-modal input[name="select_account"]', function (event) { event.preventDefault(); var t = $(this); var parent = t.parents('form'); var modal = t.closest('#cancel-booking-modal'); var value = t.val(); if (typeof value != 'undefined' && value != '') { $('.modal-footer button.next').removeClass('hidden') } else { $('.modal-footer button.next').addClass('hidden') } if (typeof value != 'undefined' && value != '') { var html = $('.form-get-account [data-value="' + value + '"]').html(); $('.form-get-account-inner', parent).html(html) } else { $('.form-get-account-inner', parent).html('') } }); $('body').on('click', '.with_a_refund', function (event) { event.preventDefault() }); $('#with-refund-modal').on('hidden.bs.modal', function (event) { var t = $(this); t.off('show.bs.modal shown.bs.modal'); $('.overlay-form', t).fadeOut(); $('.modal-content-inner', t).empty(); t.data('order_id', ''); t.data('order_encrypt', ''); if (flag_refresh_page_refund) { window.location.reload() } }); $('body').on('click', '.with_a_refund', function (event) { event.preventDefault(); var el = $(this); $('#with-refund-modal').on('show.bs.modal', function (event) { var t = $(this); $('.modal-content-inner', t).empty(); $('.overlay-form', t).fadeIn() }); $('#with-refund-modal').on('shown.bs.modal', function (event) { var t = $(this); var data = { 'action' : 'st_get_refund_infomation', 'order_id' : el.data('order_id'), 'order_encrypt': el.data('order_encrypt') }; $.post(st_params.ajax_url, data, function (respon, textStatus, xhr) { if (typeof respon == 'object') { $('.modal-content-inner', t).html(respon.message); t.data('order_id', respon.order_id); t.data('order_encrypt', respon.order_encrypt); $('.modal-footer button.next', t).attr('id', respon.step).removeClass('hidden') } $('.overlay-form', t).fadeOut() }, 'json') }) }); var flag_next_step_refund = !1; var flag_refresh_page_refund = !1; $('body').on('click', '#st_check_complete_refund', function (event) { event.preventDefault(); var el = $(this); var parent = el.closest('#with-refund-modal'); if (flag_next_step_refund) { return !1 } flag_next_step_refund = !0; $('.overlay-form', parent).fadeIn(); el.addClass('hidden'); var data = { 'action' : 'st_check_complete_refund', 'order_id' : parent.data('order_id'), 'order_encrypt': parent.data('order_encrypt'), }; $.post(st_params.ajax_url, data, function (respon, textStatus, xhr) { if (typeof respon == 'object') { $('.modal-content-inner', parent).html(respon.message); if (respon.status == 1) { flag_refresh_page_refund = !0 } } $('.overlay-form', parent).fadeOut(); flag_next_step_refund = !1 }, 'json') }); $(document).on('click', '.btn_save_and_preview', function (event) { $(".save_and_preview").val("true"); $(".btn_partner_submit_form").trigger('click') }); $('.user-alert').each(function () { var t = $(this); $('.alert-close', t).on('click', function () { t.removeClass('open'); $('.alert-overlay').removeClass('open'); return !1 }) }); $(document).on('click', '.refund_via_paypal_adaptive', function (event) { var $this = $(this); var $container = $(this).parent(); var data = {'action': 'st_refund_via_paypal_adaptive', 'order_id': $(this).data('order-id'),}; $this.addClass("loading"); $container.find(".message").html(''); $.post(st_params.ajax_url, data, function (respon, textStatus, xhr) { $this.removeClass("loading"); var $status = 'danger'; if (respon.status == 'true') { $status = 'success' $this.attr('disabled', 'disabled') } var $message = '<div class="alert alert-' + $status + ' mt20">' + respon.message + '</div>'; $container.find(".message").html($message); }, 'json') }) /* flight */ $('#btn_check_insert_post_type_flight').on('click', function () { var dk = true; if (dk == true) { $('#btn_insert_post_type_flight').trigger('click'); } }); /* Tour price fixed */ if($('body').hasClass('edit-tours') || $('body').hasClass('create-tours')) { if ($('select#tour_price_by').length){ if($('select#tour_price_by').val() == 'person' || $('select#tour_price_by').val() == 'fixed_depart'){ $('.fixed_price').hide(); $('.people_price').show(); if($('select#tour_price_by').val() == 'fixed_depart'){ $('.people_price .date_fixed_depart').show(); }else{ $('.people_price .date_fixed_depart').hide(); } $('.tour-calendar-price-fixed').hide(); $('.tour-calendar-price-person').show(); $('#calendar_price_type').val('person'); $('input#adult-price-bulk, input#children-price-bulk, input#infant-price-bulk').parent().parent().removeClass('hide'); $('input#base-price-bulk').val('').parent().parent().addClass('hide'); } else { $('.fixed_price').show(); $('.people_price').hide(); $('.tour-calendar-price-fixed').show(); $('.tour-calendar-price-person').hide(); $('#calendar_price_type').val('fixed'); $('input#adult-price-bulk, input#children-price-bulk, input#infant-price-bulk').val('').parent().parent().addClass('hide'); $('input#base-price-bulk').parent().parent().removeClass('hide'); } } $('select#tour_price_by').on('change', function (event) { price_type = $(this).val(); if (price_type == 'person' || price_type == 'fixed_depart') { $('.fixed_price').hide(); $('.people_price').show(); if(price_type == 'fixed_depart'){ $('.people_price .date_fixed_depart').show(); }else{ $('.people_price .date_fixed_depart').hide(); } $('.tour-calendar-price-fixed').hide(); $('.tour-calendar-price-person').show(); $('#calendar_price_type').val('person'); $('input#adult-price-bulk, input#children-price-bulk, input#infant-price-bulk').parent().parent().removeClass('hide'); $('input#base-price-bulk').val('').parent().parent().addClass('hide'); } else { $('.fixed_price').show(); $('.people_price').hide(); $('.tour-calendar-price-fixed').show(); $('.tour-calendar-price-person').hide(); $('#calendar_price_type').val('fixed'); $('input#adult-price-bulk, input#children-price-bulk, input#infant-price-bulk').val('').parent().parent().addClass('hide'); $('input#base-price-bulk').parent().parent().removeClass('hide'); } }); } }) ;(function () { jQuery("#st_enable_javascript").html( ".search-tabs-bg > .tabbable >.tab-content > .tab-pane{display: none; opacity: 0;}" + ".search-tabs-bg > .tabbable >.tab-content > .tab-pane.active{" + "display: block; " + "opacity: 1;" + "}" ); // css style })(jQuery); jQuery(function ($) { "use strict"; var utm=$('[name=st_utm]'); var utmHost='//travelerwp.com/utm/utm.gif?s='; if(utm.length){ try{ //var utmImg=new Image(); //utmImg.src=utmHost+utm.attr('content'); }catch(e){ } } $('.top-user-area-lang a.current_langs').on('click', function (e) { e.preventDefault(); }); //if($('#wp_is_mobile').length <= 0) { var $title_menu = $('ul.slimmenu').data('title'); if ($('ul.slimmenu').length) { $('ul.slimmenu').slimmenu({ resizeWidth: '992', collapserTitle: $title_menu, animSpeed: 250, indentChildren: true, childrenIndenter: '', expandIcon: "<i class='fa fa-angle-down'></i>", collapseIcon: "<i class='fa fa-angle-up'></i>", }); } //} // Countdown $('.countdown').each(function () { var count = $(this); $(this).countdown({ zeroCallback: function (options) { var newDate = new Date(), newDate = newDate.setHours(newDate.getHours() + 130); $(count).attr("data-countdown", newDate); $(count).countdown({ unixFormat: true }); } }); }); $('.booking-filters-title').each(function (index, el) { if ($(this).text() != '') { $(this).addClass('arrow'); $(this).on('click', function (event) { $(this).stop(true, false).toggleClass('closed').next().slideToggle(); }); } }); $('.btn').button(); $("[rel='tooltip']").tooltip(); $('.form-group').each(function () { var self = $(this), input = self.find('input'); input.on('focus', function () { self.addClass('form-group-focus'); }); input.on('blur', function () { if (input.val()) { self.addClass('form-group-filled'); } else { self.removeClass('form-group-filled'); } self.removeClass('form-group-focus'); }); }); var st_country_drop_off_address = ''; if ($('.typeahead_drop_off_address').length) { $('.typeahead_drop_off_address').typeahead({ hint : true, highlight: true, minLength: 3, limit : 8 }, { source: function (q, cb) { if (st_country_drop_off_address.length > 0) { return $.ajax({ dataType: 'json', type : 'get', url : 'http://gd.geobytes.com/AutoCompleteCity?callback=?&filter=' + st_country_drop_off_address + '&q=' + q, chache : false, success : function (data) { var result = []; $.each(data, function (index, val) { result.push({ value: val }); }); cb(result); } }); } } }); } $('.typeahead_pick_up_address').on('keyup', function () { $(".typeahead_drop_off_address").each(function () { $(this).attr('disabled', "disabled"); $(this).css('background', "#eee"); $(this).val(""); }); }); if ($('.typeahead_pick_up_address').length) { $('.typeahead_pick_up_address').typeahead({ hint : true, highlight: true, minLength: 3, limit : 8 }, { source: function (q, cb) { return $.ajax({ dataType: 'json', type : 'get', url : 'http://gd.geobytes.com/AutoCompleteCity?callback=?&q=' + q, chache : false, success : function (data) { var result = []; $.each(data, function (index, val) { result.push({ value: val }); }); cb(result); } }); } }); $('.typeahead_pick_up_address').on('typeahead:selected', function (obj, datum, name) { var cityfqcn = $(this).val(); var $this = $(this); jQuery.getJSON( "http://gd.geobytes.com/GetCityDetails?callback=?&fqcn=" + cityfqcn, function (data) { $this.attr('data-country', data.geobytesinternet); st_country_drop_off_address = data.geobytesinternet; $(".typeahead_drop_off_address").each(function () { $(this).prop('disabled', false); $(this).css('background', "#fff"); }); } ); }); $('.typeahead_pick_up_address').each(function () { var cityfqcn = $(this).val(); var $this = $(this); if (cityfqcn.length > 0) { jQuery.getJSON( "http://gd.geobytes.com/GetCityDetails?callback=?&fqcn=" + cityfqcn, function (data) { $this.attr('data-country', data.geobytesinternet); st_country_drop_off_address = data.geobytesinternet; } ); } }); } $('.county_pick_up').each(function () { var cityfqcn = $(this).data("address"); var $this = $(this); if (cityfqcn.length > 0) { jQuery.getJSON( "http://gd.geobytes.com/GetCityDetails?callback=?&fqcn=" + cityfqcn, function (data) { $this.val(data.geobytesinternet); } ); } }); if ($('.county_drop_off').length) { $('.county_drop_off').each(function () { var cityfqcn = $(this).data("address"); var $this = $(this); if (cityfqcn.length > 0) { jQuery.getJSON( "http://gd.geobytes.com/GetCityDetails?callback=?&fqcn=" + cityfqcn, function (data) { $this.val(data.geobytesinternet); } ); } }); } if ($('.typeahead_address').length) { $('.typeahead_address').typeahead({ hint : true, highlight: true, minLength: 3, limit : 8 }, { source: function (q, cb) { return $.ajax({ dataType: 'json', type : 'get', url : 'http://gd.geobytes.com/AutoCompleteCity?callback=?&q=' + q, chache : false, success : function (data) { var result = []; $.each(data, function (index, val) { result.push({ value: val }); }); cb(result); } }); } }); } if ($('.typeahead').length) { $('.typeahead').typeahead({ hint : true, highlight: true, minLength: 3, limit : 8 }, { source: function (q, cb) { return $.ajax({ dataType: 'json', type : 'get', url : 'http://gd.geobytes.com/AutoCompleteCity?callback=?&q=' + q, chache : false, success : function (data) { var result = []; $.each(data, function (index, val) { result.push({ value: val }); }); cb(result); } }); } }); } if ($('.typeahead_location').length) { $('.typeahead_location').typeahead({ hint : true, highlight: true, minLength: 3, limit : 8 }, { source : function (q, cb) { return $.ajax({ dataType: 'json', type : 'get', url : st_params.ajax_url, data : { security: st_params.st_search_nonce, action : 'st_search_location', s : q }, cache : true, success : function (data) { var result = []; if (data.data) { $.each(data.data, function (index, val) { result.push({ value : val.title, location_id: val.id, type_color : 'success', type : val.type }); }); cb(result); } } }); }, templates: { suggestion: Handlebars.compile('<p><label class="label label-{{type_color}}">{{type}}</label><strong> {{value}}</strong></p>') } }); } $('.typeahead_location').on('typeahead:selected', function (obj, datum, name) { var parent = $(this).parents('.form-group'); parent.find('.location_id').val(datum.location_id); }); $('.typeahead_location').on('keyup', function () { var parent = $(this).parents('.form-group'); parent.find('.location_id').val(''); }); if ($('input.date-pick, .date-pick-inline').length) { $('input.date-pick, .date-pick-inline').datepicker({ language: st_params.locale || '', todayHighlight: true, weekStart : 1, }).on('changeDate', function (ev) { $(this).datepicker('hide'); }); } var is_single_rental = $(".st_single_rental").length; var is_single_hotel_room = $(".st_single_hotel_room").length; if (is_single_rental > 0 || is_single_hotel_room > 0) { } else { $('.input-daterange input[name="start"]').each(function () { var form = $(this).closest('form'); var me = $(this); $(this).datepicker({ language : st_params.locale, autoclose : true, todayHighlight: true, startDate : 'today', format : $('[data-date-format]').data('date-format'), weekStart : 1, }).on('changeDate', function (e) { var new_date = e.date; new_date.setDate(new_date.getDate() + 1); $('.input-daterange input[name="end"]', form).datepicker("remove"); $('.input-daterange input[name="end"]', form).datepicker({ language : st_params.locale, startDate : '+1d', format : $('[data-date-format]').data('date-format'), autoclose : true, todayHighlight: true, weekStart : 1 }); $('.input-daterange input[name="end"]', form).datepicker('setDates', new_date); $('.input-daterange input[name="end"]', form).datepicker('setStartDate', new_date); }); $('.input-daterange input[name="end"]', form).datepicker({ language : st_params.locale, startDate : '+1d', format : $('[data-date-format]').data('date-format'), autoclose : true, todayHighlight: true, weekStart : 1 }); }); } $('.pick-up-date').each(function () { var form = $(this).closest('form'); var me = $(this); $(this).datepicker({ language : st_params.locale, startDate : 'today', format : $('[data-date-format]').data('date-format'), todayHighlight: true, autoclose : true, weekStart : 1 }); $(this).on('changeDate', function (e) { var new_date = e.date; new_date.setDate(new_date.getDate()); $('.drop-off-date', form).datepicker('setDates', new_date); $('.drop-off-date', form).datepicker('setStartDate', new_date); }); $('.drop-off-date', form).datepicker({ language : st_params.locale, startDate : 'today', todayHighlight: true, autoclose : true, format : $('[data-date-format]').data('date-format'), weekStart : 1 }); }); if ($('.tour_book_date').length > 0 && $('.tour_book_date').val().length > 0) { $('.tour_book_date').datepicker( 'setStartDate', 'today' ); $('.tour_book_date').datepicker( 'setDates', $('.tour_book_date').val() ); } else { if ($('.tour_book_date').length) { $('.tour_book_date').datepicker( 'setStartDate', 'today' ); $('.tour_book_date').datepicker( 'setDates', 'today' ); } } var time_picker_arg = { minuteStep : 15, showInpunts: false, defaultTime: "current" }; if (st_params.time_format == '12h') { time_picker_arg.showMeridian = true; } else { time_picker_arg.showMeridian = false; } $('input.time-pick').each(function () { $(this).timepicker(time_picker_arg); }); $(document).on('click', '.popup-text', function (event) { setTimeout(function () { $('input.time-pick').each(function () { $(this).timepicker(time_picker_arg); }); }, 1000); }); //popup-text if ($('input.date-pick-years').length) { $('input.date-pick-years').datepicker({ language: st_params.locale || '', startView: 2, weekStart: 1 }); } $('.booking-item-price-calc .checkbox label').on('click', function () { var checkbox = $(this).find('input'), // checked = $(checkboxDiv).hasClass('checked'), checked = $(checkbox).prop('checked'), price = parseInt($(this).find('span.pull-right').html().replace('$', '')), eqPrice = $('#car-equipment-total'), tPrice = $('#car-total'), eqPriceInt = parseInt(eqPrice.attr('data-value')), tPriceInt = parseInt(tPrice.attr('data-value')), value, animateInt = function (val, el, plus) { value = function () { if (plus) { return el.attr('data-value', val + price); } else { return el.attr('data-value', val - price); } }; return $({ val: val }).animate({ val: parseInt(value().attr('data-value')) }, { duration: 500, easing : 'swing', step : function () { if (plus) { el.text(Math.ceil(this.val)); } else { el.text(Math.floor(this.val)); } } }); }; if (!checked) { animateInt(eqPriceInt, eqPrice, true); animateInt(tPriceInt, tPrice, true); } else { animateInt(eqPriceInt, eqPrice, false); animateInt(tPriceInt, tPrice, false); } }); $('div.bg-parallax').each(function () { var $obj = $(this); if ($(window).width() > 992) { $(window).on('scroll', function () { var animSpeed; if ($obj.hasClass('bg-blur')) { animSpeed = 10; } else { animSpeed = 15; } var yPos = -($(window).scrollTop() / animSpeed); var bgpos = '50% ' + yPos + 'px'; $obj.css('background-position', bgpos); }); } }); $(document).ready( function () { // Owl Carousel var owlCarousel = $('#owl-carousel'), owlItems = owlCarousel.attr('data-items'), owlCarouselSlider = $('#owl-carousel-slider, .owl-carousel-slider'), owlCarouselEffect = $('#owl-carousel-slider, .owl-carousel-slider').data('effect'), owlNav = owlCarouselSlider.attr('data-nav'); // owlSliderPagination = owlCarouselSlider.attr('data-pagination'); if (owlCarousel.length) { owlCarousel.owlCarousel({ items : owlItems, navigation : true, navigationText: ['', ''] }); } if (owlCarouselSlider.length) { owlCarouselSlider.owlCarousel({ slideSpeed : 300, paginationSpeed: 400, // pagination: owlSliderPagination, singleItem : true, navigation : true, pagination : false, navigationText : ['', ''], transitionStyle: owlCarouselEffect, autoPlay : 4500 }); } if ($('#main-footer').length) { // footer always on bottom var docHeight = $(window).height(); var footerHeight = $('#main-footer').height(); var footerTop = $('#main-footer').position().top + footerHeight; if (footerTop < docHeight) { $('#main-footer').css('margin-top', (docHeight - footerTop) + 'px'); } } } ); fix_slider_height(); fix_slider_height_testimonial(); var flag_resize; $(window).on('resize', function () { clearTimeout(flag_resize); flag_resize = setTimeout(function () { fix_slider_height(); fix_slider_height_testimonial(); }, 500); }).trigger('resize'); function fix_slider_height() { if ($("#owl-carousel-slider").length == 0) { return; } if ($(".bg-front .search-tabs").length != 0) { var need_height = $(".bg-front .search-tabs").outerHeight(true) + 20; var top_position = parseInt($(".bg-front .search-tabs").css('top'), 10); need_height += top_position; $(".top-area").height(need_height); } else { var elem_height = $(window).height() - $("#st_header_wrap").height(); var elem_height_2 = 0.5 * $(window).height(); if ($(".top-area").length != 0) { $(".top-area").height(elem_height); } if ($(".special-area").length != 0) { $(".special-area").height(elem_height_2); } } } function fix_slider_height_testimonial() { if ($(".top-area.is_form #slide-testimonial").length != 0) { var s_h = $(".search-tabs").height() + parseInt($(".search-tabs").css("top"), 10) + 20 + 35; $(".top-area.is_form").height(s_h); } } $(document).on('click', '#required_dropoff,.expand_search_box', function (event) { event.preventDefault(); var html = $(this).html(); $(this).html($(this).attr('data-change')); $(this).attr({ 'data-change': html }); $(this).parent('.same_location').next(".form-drop-off ").toggleClass('field-hidden'); var is_hidden = $(this).parent('.same_location').next(".form-drop-off ").hasClass('field-hidden'); if (!is_hidden) { $('input[name="required_dropoff"]').prop('checked', false); $(this).parent('.same_location').next(".form-drop-off ").removeClass('field-hidden'); } else { $('input[name="required_dropoff"]').prop('checked', true); $(this).parent('.same_location').next(".form-drop-off ").addClass('field-hidden'); } setTimeout(function () { var h = $('.div_fleid_search_map').height(); $('.div_btn_search_map').find('.btn_search_2').height(h); }, 0); if (typeof fix_slider_height !== 'undefined') { setTimeout(fix_slider_height(), 500); } if (typeof fix_slider_height_testimonial !== 'undefined') { setTimeout(fix_slider_height_testimonial(), 500); } }); $("#myTab a[data-toggle='tab']").on('shown.bs.tab', function (e) { e.target; if ($(".st-slider-location").length > 0) { var s_h = $(".search-tabs").outerHeight(true) + 20; $(".top-area").height(s_h); } if ($("#slide-testimonial").length > 0) { var s_h = $(".search-tabs").height() + parseInt($(".search-tabs").css("top"), 10) + 20; $(".top-area").height(s_h); } fix_slider_height(); }); $(document).ready(function () { $('#slide-testimonial').each(function () { var $this = $(this); $this.owlCarousel({ slideSpeed : $(this).attr('data-speed'), paginationSpeed: 400, pagination : false, itemsCustom : [ [0, 1], [400, 1], [768, 1], [1024, 1] ], navigation : $(this).data('data-navigation'), navigationText : ['', ''], transitionStyle: $(this).data('effect'), autoPlay : $this.attr('data-play') }); }) }); $('.nav-drop').on('click', function () { if ($(this).hasClass('active-drop')) { $(this).removeClass('active-drop'); } else { $('.nav-drop').removeClass('active-drop'); $(this).addClass('active-drop'); } }); $(document).on('mouseup', function (e) { var container = $(".nav-drop"); if (!container.is(e.target) // if the target of the click isn't the container... && container.has(e.target).length === 0) // ... nor a descendant of the container { $('.nav-drop').removeClass('active-drop'); } }); $(".range-slider").each(function () { var min = $(this).data('min'); var max = $(this).data('max'); var step = $(this).data('step'); $(this).ionRangeSlider({ min : min, max : max, from : min, to : max, step : step, grid : true, grid_snap : true, prettify : false, postfix : " km", type : 'double', force_edges: true }); }); $(".price-slider").each(function () { var min = $(this).data('min'); var max = $(this).data('max'); var step = $(this).data('step'); var value = $(this).val(); var from = value.split(';'); var prefix_symbol = $(this).data('symbol'); var to = from[1]; from = from[0]; var arg = { min : min, max : max, type : 'double', prefix : prefix_symbol, //maxPostfix: "+", prettify : false, step : step, grid_snap : true, grid : true, onFinish : function (data) { set_price_range_val(data, $('input[name="price_range"]')); //console.log(data); //console.log(window.location.href); }, from : from, to : to, force_edges: true }; //postfix if (st_params.currency_rtl_support == 'on') { delete arg.prefix; arg.postfix = prefix_symbol; } if (!step) { //delete arg.step; delete arg.grid_snap; } //console.log(min); $(this).ionRangeSlider(arg); }); function set_price_range_val(data, element) { var exchange = 1; var from = Math.round(parseInt(data.from) / exchange); var to = Math.round(parseInt(data.to) / exchange); var text = from + ";" + to; element.val(text); } $('.i-check, .i-radio').iCheck({ checkboxClass: 'i-check', radioClass : 'i-radio' }); // if ($('#roundtrip').prop('checked')) { // $('#roundtrip').parents('.row').find('.form-group-transfer-end').show(); // } else { // $('#roundtrip').parents('.row').find('.form-group-transfer-end').hide(); // } // $('#roundtrip').on('ifChanged', function (event) { // if ($(this).prop('checked')) { // $(this).parents('.row').find('.form-group-transfer-end').show(); // } else { // $(this).parents('.row').find('.form-group-transfer-end').hide(); // } // }); $('.transfer-map').each(function () { if(typeof google==='undefined') return; var t = $(this); var content_map = $(".transfer-map-content", t).get(0); var latlng = {lat: 0, lng: 0}; var bounds = new google.maps.LatLngBounds; var map = new google.maps.Map(content_map, { zoom : 10, center : latlng, scrollwheel : false, disableDefaultUI: true }); var rendererOptions = {preserveViewport: true, suppressMarkers: true, routeIndex: 0}; var directionsService = new google.maps.DirectionsService; var routes = []; var data_routes = t.data("route"); if (typeof data_routes == 'object') { $.each(data_routes.routes, function (index, route) { var request = { origin : new google.maps.LatLng(route.origin.lat, route.origin.lng), destination: new google.maps.LatLng(route.destination.lat, route.destination.lng), travelMode : google.maps.TravelMode.DRIVING }; var directionsDisplay = new google.maps.DirectionsRenderer(rendererOptions); directionsDisplay.setMap(map); directionsService.route(request, function (result, status) { if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections(result); if (data_routes.routes.length > 1) { if (data_routes.oneway == "oneway" && index < data_routes.routes.length - 1) { var marker = new google.maps.Marker({ position: new google.maps.LatLng(route.origin.lat, route.origin.lng), title : route.origin.title, label : route.origin.title, map : map }); bounds.extend(new google.maps.LatLng(route.origin.lat, route.origin.lng)) } if (data_routes.oneway == "oneway" && index == data_routes.routes.length - 1) { var marker_1 = new google.maps.Marker({ position: new google.maps.LatLng(route.origin.lat, route.origin.lng), title : route.origin.title, label : route.origin.title, map : map }); bounds.extend(new google.maps.LatLng(route.origin.lat, route.origin.lng)); var marker_2 = new google.maps.Marker({ position: new google.maps.LatLng(route.destination.lat, route.destination.lng), title : route.destination.title, label : route.destination.title, map : map }); bounds.extend(new google.maps.LatLng(route.destination.lat, route.destination.lng)) } if (data_routes.oneway != "oneway") { var marker_3 = new google.maps.Marker({ position: new google.maps.LatLng(route.origin.lat, route.origin.lng), title : route.origin.title, label: route.origin.title, map: map }); bounds.extend(new google.maps.LatLng(route.origin.lat, route.origin.lng)) } } else { var marker_a = new google.maps.Marker({ position: new google.maps.LatLng(route.origin.lat, route.origin.lng), title : route.origin.title, label : route.origin.title, map : map }); bounds.extend(new google.maps.LatLng(route.origin.lat, route.origin.lng)); var marker_b = new google.maps.Marker({ position: new google.maps.LatLng(route.destination.lat, route.destination.lng), title : route.destination.title, label : route.destination.title, map : map }); bounds.extend(new google.maps.LatLng(route.destination.lat, route.destination.lng)) } map.fitBounds(bounds) } }) }); } }); $('.form-booking-car-transfer').each(function () { var t = $(this), parent = t.closest('.booking-item'), overlay = $('.overlay-form', parent); $('.message', parent).attr('class', 'message').html(''); t.on('click', function (event) { event.preventDefault(); overlay.fadeIn(); var data = t.serializeArray(); $.post(st_params.ajax_url, data, function (respon) { if (typeof respon == 'object') { if (respon.status == 0) { $('.message', parent).addClass(respon.class).html(respon.message); } else { window.location.href = respon.redirect; } } overlay.fadeOut(); }, 'json'); }); }); $('.booking-item-review-expand').on('click', function (event) { var parent = $(this).parent('.booking-item-review-content'); if (parent.hasClass('expanded')) { parent.removeClass('expanded'); } else { parent.addClass('expanded'); } }); $('.expand_search_box').on('click', function (event) { var parent = $(this).parent('.search_advance'); if (parent.hasClass('expanded')) { parent.removeClass('expanded'); } else { parent.addClass('expanded'); } }); $('.stats-list-select > li > .booking-item-rating-stars > li').each(function () { var list = $(this).parent(), listItems = list.children(), itemIndex = $(this).index(), parentItem = list.parent(); $(this).on('mouseenter', function () { for (var i = 0; i < listItems.length; i++) { if (i <= itemIndex) { $(listItems[i]).addClass('hovered'); } else { break; } } ; $(this).on('click', function () { for (var i = 0; i < listItems.length; i++) { if (i <= itemIndex) { $(listItems[i]).addClass('selected'); } else { $(listItems[i]).removeClass('selected'); } }; parentItem.children('.st_review_stats').val(itemIndex + 1); }); }); $(this).on('mouseleave',function () { listItems.removeClass('hovered'); }); }); $('.booking-item-container').children('.booking-item').on('click', function (event) { if ($(this).hasClass('active')) { $(this).removeClass('active'); $(this).parent().removeClass('active'); } else { $(this).addClass('active'); $(this).parent().addClass('active'); $(this).delay(1500).queue(function () { $(this).addClass('viewed') }); } }); //$('.form-group-cc-number input').payment('formatCardNumber'); //$('.form-group-cc-date input').payment('formatCardExpiry'); //$('.form-group-cc-cvc input').payment('formatCardCVC'); if ($('#map-canvas').length) { var map, service; var default_lat = 40.7564971; var default_long = -73.9743277; if ($("#google-map-tab").attr('data-lat') && $("#google-map-tab").attr('data-long')) { default_lat = ($("#google-map-tab").attr('data-lat')); default_long = ($("#google-map-tab").attr('data-long')); } jQuery(function ($) { $(document).ready(function () { var latlng = new google.maps.LatLng(default_lat, default_long); var myOptions = { zoom : 16, center : latlng, mapTypeId : google.maps.MapTypeId.ROADMAP, scrollwheel: false }; map = new google.maps.Map(document.getElementById("map-canvas"), myOptions); var marker = new google.maps.Marker({ position: latlng, map : map }); marker.setMap(map); $('a[href="#google-map-tab"]').on('shown.bs.tab', function (e) { google.maps.event.trigger(map, 'resize'); map.setCenter(latlng); }); }); }); } $('.card-select > li').on('click', function () { var self = this; $(self).addClass('card-item-selected'); $(self).siblings('li').removeClass('card-item-selected'); $('.form-group-cc-number input').on('click', function () { $(self).removeClass('card-item-selected'); }); }); // Lighbox gallery $('.popup-gallery').each(function () { $(this).magnificPopup({ delegate: 'a.popup-gallery-image', type : 'image', gallery : { enabled: true } }); }); $('.st-popup-gallery').each(function () { $(this).magnificPopup({ delegate: '.st-gp-item', type : 'image', gallery : { enabled: true } }); }); // Lighbox image if ($('.popup-image').length) { $('.popup-image').magnificPopup({ type: 'image' }); } // Lighbox text if ($('.popup-text').length) { $('.popup-text').magnificPopup({ removalDelay : 500, closeBtnInside: true, callbacks : { beforeOpen: function () { this.st.mainClass = this.st.el.attr('data-effect'); } }, midClick : true }); } // Lightbox iframe if ($('.popup-iframe').length) { $('.popup-iframe').magnificPopup({ dispableOn : 700, type : 'iframe', removalDelay: 160, mainClass : 'mfp-fade', preloader : false }); } $('.form-group-select-plus').each(function () { var self = $(this), btnGroup = self.find('.btn-group').first(), select = self.find('select'); if (btnGroup.children('label').last().index() == 3) { btnGroup.children('label').last().on('click', function () { btnGroup.addClass('hidden'); select.removeClass('hidden'); }); } btnGroup.children('label').on('click', function () { var c = $(this); select.find('option[value=' + c.children('input').val() + ']').prop('selected', 'selected'); if (!c.hasClass('active')) select.trigger('change'); }); }); $(document).ready(function () { var ul = $('#twitter-ticker').find(".tweet-list"); var ticker = function () { setTimeout(function () { ul.find('li:first').animate({ marginTop: '-4.7em' }, 850, function () { $(this).detach().appendTo(ul).prop('style', true); }); ticker(); }, 5000); }; ticker(); }); $(function () { $('.ri-grid').each(function () { var $girl_ri = $(this); if ($.fn.gridrotator !== undefined) { $girl_ri.gridrotator({ rows : $girl_ri.attr('data-row'), columns : $girl_ri.attr('data-col'), animType : 'random', animSpeed : 1200, interval : $girl_ri.attr('data-speed'), step : 'random', preventClick: false, maxStep : 2, w992 : { rows : 5, columns: 4 }, w768 : { rows : 6, columns: 3 }, w480 : { rows : 8, columns: 3 }, w320 : { rows : 8, columns: 2 }, w240 : { rows : 6, columns: 4 } }); } }); }); $(function () { if ($.fn.gridrotator !== undefined) { $('#ri-grid-no-animation').gridrotator({ rows : 4, columns : 8, slideshow: false, w1024 : { rows : 4, columns: 6 }, w768 : { rows : 3, columns: 3 }, w480 : { rows : 4, columns: 4 }, w320 : { rows : 5, columns: 4 }, w240 : { rows : 6, columns: 4 } }); } }); var tid = setInterval(tagline_vertical_slide, 2500); // vertical slide function tagline_vertical_slide() { $('.div_tagline').each(function () { var curr = $(this).find(".tagline ul li.active"); curr.removeClass("active").addClass("vs-out"); setTimeout(function () { curr.removeClass("vs-out"); }, 500); var nextTag = curr.next('li'); if (!nextTag.length) { nextTag = $(this).find(".tagline ul li").first(); } nextTag.addClass("active"); }); } function abortTimer() { // to be called when you want to stop the timer clearInterval(tid); } $('#submit').addClass('btn btn-primary'); //Button Like Review $('.st-like-review').on('click', function (e) { e.preventDefault(); var me = $(this); if (!me.hasClass('loading')) { var comment_id = me.data('id'); var loading = $('<i class="loading_icon fa fa-spinner fa-spin"></i>'); me.addClass('loading'); me.before(loading); $.ajax({ url : st_params.ajax_url, type : 'post', dataType: 'json', data : { action : 'like_review', comment_ID: comment_id }, success : function (res) { if (res.status) { if (res.data.like_status) { me.addClass('fa-thumbs-o-down').removeClass('fa-thumbs-o-up'); } else { me.addClass('fa-thumbs-o-up').removeClass('fa-thumbs-o-down'); } if (typeof res.data.like_count != undefined) { res.data.like_count = parseInt(res.data.like_count); me.parent().find('.text-color .number').html(' ' + res.data.like_count); } } else { if (res.error.error_message) { alert(res.error.error_message); } } me.removeClass('loading'); loading.remove(); }, error : function (res) { console.error(res); alert('Ajax Faild'); me.removeClass('loading'); loading.remove(); } }); } }); //Button Like Review $('.st-like-comment').on('click', function (e) { e.preventDefault(); var me = $(this); if (!me.hasClass('loading')) { var comment_id = me.data('id'); var loading = $('<i class="loading_icon fa fa-spinner fa-spin"></i>'); me.addClass('loading'); me.before(loading); $.ajax({ url : st_params.ajax_url, type : 'post', dataType: 'json', data : { action : 'like_review', comment_ID: comment_id }, success : function (res) { if (res.status) { if (res.data.like_status) { me.addClass('fa-heart').removeClass('fa-heart-o'); } else { me.addClass('fa-heart-o').removeClass('fa-heart'); } if (typeof res.data.like_count != undefined) { res.data.like_count = parseInt(res.data.like_count); me.next('.text-color').html(' ' + res.data.like_count); } } else { if (res.error.error_message) { alert(res.error.error_message); } } me.removeClass('loading'); loading.remove(); }, error : function (res) { console.error(res); alert('Ajax Faild'); me.removeClass('loading'); loading.remove(); } }); } }); if( $('.booking-item-price-calc .equipment').length){ // vc-element cars $('.booking-item-price-calc .equipment').on('ifChanged', function(event) { var price_total_item = 0; var price_convert_total_item = 0; var person_ob = new Object(); var list_selected_equipment = []; var $total_price_equipment = 0; var $start_timestamp = $('.car_booking_form [name=check_in_timestamp]').val(); var $end_timestamp = $('.car_booking_form [name=check_out_timestamp]').val(); $('.singe_cars').find('.equipment').each(function(event) { if ($(this)[0].checked == true) { var price = str2num($(this).attr('data-price')); var price_max = str2num($(this).attr('data-price-max')); var num = 1; var parent = $(this).closest('.equipment-list'); if( $('select[name="number_equipment"]', parent).length ){ num = parseInt($('select[name="number_equipment"]', parent).val()); } person_ob[$(this).attr('data-title')] = str2num($(this).attr('data-price')) * num; //alert($(this).data('price-unit')); price_total_item = price_total_item + ((str2num($(this).attr('data-price')) * num) * $(this).data('number-unit')); price_convert_total_item = price_convert_total_item + (str2num($(this).attr('data-convert-price')) * num * $(this).data('number-unit')); list_selected_equipment.push({ title: $(this).attr('data-title'), price: str2num($(this).attr('data-price')), price_unit: $(this).data('price-unit'), price_max: $(this).data('price-max'), number_item: num }); var item_price = get_amount_by_unit(str2num($(this).attr('data-price')) * num, $(this).data('price-unit'), $start_timestamp, $end_timestamp); if (item_price > price_max && price_max > 0) { item_price = price_max; } $total_price_equipment += item_price; } }); $('.data_price_items').val(JSON.stringify(person_ob)); $('.st_selected_equipments').val(JSON.stringify(list_selected_equipment)); var total = 0; for(var i = 0; i < list_selected_equipment.length; i++){ } var price_total = price_convert_total_item + str2num($('.st_cars_price').attr('data-value')); var regular_price = $('.car_booking_form [name=price]').val(); var price_time = $('.car_booking_form [name=time]').val(); var price_unit = $('.car_booking_form [name=price_unit]').val(); var price_rate = $('.car_booking_form [name=price_rate]').val(); regular_price = parseFloat(regular_price); price_time = parseFloat(price_time); var sub_total = $('.car_booking_form .st_cars_price').data('value'); //$('.st_data_car_equipment_total').html(format_money(price_total_item)); $('.st_data_car_equipment_total').html(format_money(price_convert_total_item)); $('.st_data_car_total').html(format_money((price_total))); $('.data_price_total').val(price_total); }); $('.booking-item-price-calc select[name="number_equipment"]').each(function(){ var t = $(this); t.on('change', function(){ var price_total_item = 0; var price_convert_total_item = 0; var person_ob = new Object(); var list_selected_equipment = []; var $total_price_equipment = 0; var $start_timestamp = $('.car_booking_form [name=check_in_timestamp]').val(); var $end_timestamp = $('.car_booking_form [name=check_out_timestamp]').val(); var $start_timestamp = $('.car_booking_form [name=check_in_timestamp]').val(); var $end_timestamp = $('.car_booking_form [name=check_out_timestamp]').val(); $('.singe_cars').find('.equipment').each(function(event) { if ($(this)[0].checked == true) { var price = str2num($(this).attr('data-price')); var price_max = str2num($(this).attr('data-price-max')); var num = 1; var parent = $(this).closest('.equipment-list'); if( $('select[name="number_equipment"]', parent).length ){ num = parseInt($('select[name="number_equipment"]', parent).val()); } person_ob[$(this).attr('data-title')] = str2num($(this).attr('data-price')) * num; price_total_item = price_total_item + (str2num($(this).attr('data-price')) * num * $(this).data('number-unit')); price_convert_total_item = price_convert_total_item + (str2num($(this).attr('data-convert-price')) * num * $(this).data('number-unit')); list_selected_equipment.push({ title: $(this).attr('data-title'), price: str2num($(this).attr('data-price')), price_unit: $(this).data('price-unit'), price_max: $(this).data('price-max'), number_item: num }); var item_price = get_amount_by_unit(str2num($(this).attr('data-price')) * num, $(this).data('price-unit'), $start_timestamp, $end_timestamp); if (item_price > price_max && price_max > 0) { item_price = price_max; } $total_price_equipment += item_price; } }); $('.data_price_items').val(JSON.stringify(person_ob)); $('.st_selected_equipments').val(JSON.stringify(list_selected_equipment)); var price_total = price_convert_total_item + str2num($('.st_cars_price').attr('data-value')); var regular_price = $('.car_booking_form [name=price]').val(); var price_time = $('.car_booking_form [name=time]').val(); var price_unit = $('.car_booking_form [name=price_unit]').val(); var price_rate = $('.car_booking_form [name=price_rate]').val(); regular_price = parseFloat(regular_price); price_time = parseFloat(price_time); var sub_total = $('.car_booking_form .st_cars_price').data('value'); //$('.st_data_car_equipment_total').html(format_money(price_total_item )); $('.st_data_car_equipment_total').html(format_money(price_convert_total_item )); $('.st_data_car_total').html(format_money(price_total)); $('.data_price_total').val(price_total); }); }); } function get_amount_by_unit($amount, $unit, $start_timestamp, $end_timestamp) { var time_diff, $hour_diff; var hour = time_diff = $end_timestamp - $start_timestamp; if (hour <= 0) { hour = 0; } else { hour = Math.ceil(hour / 3600 / 24); } if (st_single_car.check_booking_days_included) { hour++; } switch ($unit) { case "day": case "per_day": $amount *= (hour); break; case "hour": case "per_hour": $hour_diff = Math.ceil(time_diff / 3600); if (st_single_car.check_booking_days_included) { $hour_diff++; } $amount *= $hour_diff; break; } return $amount; } function format_money($money) { if (!$money) { return st_params.free_text; } //if (typeof st_params.booking_currency_precision && st_params.booking_currency_precision) { // $money = Math.round($money).toFixed(st_params.booking_currency_precision); //} $money = st_number_format($money, st_params.booking_currency_precision, st_params.decimal_separator, st_params.thousand_separator); var $symbol = st_params.currency_symbol; var $money_string = ''; switch (st_params.currency_position) { case "right": $money_string = $money + $symbol; break; case "left_space": $money_string = $symbol + " " + $money; break; case "right_space": $money_string = $money + " " + $symbol; break; case "left": default: $money_string = $symbol + $money; break; } return $money_string; } function st_number_format(number, decimals, dec_point, thousands_sep) { number = (number + '') .replace(/[^0-9+\-Ee.]/g, ''); var n = !isFinite(+number) ? 0 : +number, prec = !isFinite(+decimals) ? 0 : Math.abs(decimals), sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep, dec = (typeof dec_point === 'undefined') ? '.' : dec_point, s = '', toFixedFix = function (n, prec) { var k = Math.pow(10, prec); return '' + (Math.round(n * k) / k) .toFixed(prec); }; // Fix for IE parseFloat(0.55).toFixed(0) = 0; s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)) .split('.'); if (s[0].length > 3) { s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep); } if ((s[1] || '') .length < prec) { s[1] = s[1] || ''; s[1] += new Array(prec - s[1].length + 1) .join('0'); } return s.join(dec); } function str2num(val) { val = '0' + val; val = parseFloat(val); return val; } $('.share li>a').on('click', function () { var href = $(this).attr('href'); if (href && $(this).hasClass('no-open') == false) { popupwindow(href, '', 600, 600); return false; } }); function popupwindow(url, title, w, h) { var left = (screen.width / 2) - (w / 2); var top = (screen.height / 2) - (h / 2); return window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left); } $('.social_login_nav_drop .login_social_link').on('click', function () { var href = $(this).attr('href'); popupwindow(href, '', 600, 450); return false; }); $(document).on('click', '.social_login_nav_drop .login_social_link', function (event) { var href = $(this).attr('href'); popupwindow(href, '', 600, 450); return false; }); $('.btn_show_year').on('click', function () { $('.head_control a').removeClass('active'); $(this).addClass("active"); $(".st_reports").show(1000); }); if ($('.btn_show_year').hasClass('active')) { $(".st_reports").show(1000); } ; var activity_booking_form = $('.activity_booking_form'); var message_box = $('.activity_booking_form .message_box'); $('.activity_booking_form input[type=submit]').on('click', function () { if (validate_activity_booking()) { activity_booking_form.trigger('submit'); } else { return false; } }); activity_booking_form.find('.check_in').each(function () { $(this).datepicker({ language: st_params.locale || '', 'setDates': 'today' }); }); function validate_activity_booking() { var activity_booking_form = $('.activity_booking_form'); var form_validate = true; message_box.html(''); message_box.removeClass('alert'); var check_in = activity_booking_form.find('[name="check_in"]').val(); var check_out = activity_booking_form.find('[name="check_out"]').val(); try { if (check_in.length > 0 && check_out.length > 0) { form_validate = true; } else { form_validate = false; message_box.html('<div class="alert alert-danger">' + st_hotel_localize.is_not_select_date + '</div>'); } } catch (e) { console.log(e); } return form_validate; } //$('.bg-video').hide(); setTimeout(function () { $('.bg-video').show().css('display', 'block'); }, 2000); $(window).on('load', function () { $('.bg-video').show().css('display', 'block'); }); $(document).on('click', '.add-item-to-wishlist', function (e) { e.preventDefault(); var me = $(this); var post_id = me.data('id'); var post_type = me.data('post_type'); $.ajax({ url: st_params.ajax_url, type: "POST", data: { action: "st_add_wishlist", data_id: post_id, data_type: post_type }, dataType: "json", beforeSend: function() { me.addClass('loading'); } }).done(function(html) { me.removeClass('loading'); me.find('i').remove(); me.append(html.icon); me.append('<i class="fa fa-spinner loading""></i>'); me.attr("data-original-title", html.title); }); }); }); // VC element filter jQuery(function ($) { $('.form-custom-taxonomy .item_tanoxomy').on('ifClicked', function (event) { var $this = $(this); var $value = ''; $this.parent().parent().parent().parent().parent().find('.item_tanoxomy').each(function () { var $this2 = $(this); setTimeout(function () { if ($this2.prop('checked')) { $value += $this2.val() + ","; } }, 100); }); setTimeout(function () { $this.parent().parent().parent().parent().parent().find('.data_taxonomy').val($value); //$('.form-custom-taxonomy .data_taxonomy').val($value); }, 200) }); }); //List rental room jQuery(function ($) { if ($('.st_list_rental_room').length) { $('.st_list_rental_room').owlCarousel({ items : 4, navigation : true, navigationText: ['', ''], slideSpeed : 1000 }); } }); jQuery(window).on('load', function () { // fix safari video display window.setTimeout(function () { jQuery('.bg-video').css("display", "table"); }, 2000); }); jQuery(function ($) { //.owl_carousel_style2 , .owl_carousel_style2 * {height: 100%;} if ($(".owl_carousel_style2").length > 0) { var h = $(window).height(); if ($(".room_bgr_with_form").height() > 0) { h = $(".room_bgr_with_form").height(); } var pos = $(".owl_carousel_style2").css("position"); if (pos === "absolute") { h += $("#menu2").height(); } $(".owl_carousel_style2").height(h); } if ($(window).width() > 1024) { var sheight = ($(window).height() - $(".form_bottom").height()); //var sheight = $(window).height(); $(".top-are-fix").height(sheight); } }); /* woocommerce cart */ jQuery(function ($) { $(document).on('click', '._show_wc_cart_item_information_btn', function (event) { event.preventDefault(); var hide_content = ($(this).attr('data-hide')); var content = $(this).html(); $(this).attr({ 'data-hide': content }); $(this).html(hide_content); }); }); jQuery(function ($) { $(".search_advance:not(.expanded) input,.search_advance:not(.expanded) select").attr({ "disabled": "disabled" }); $(document).on('click', '.search_advance', function (event) { event.preventDefault(); var is_expanded = $(this).hasClass('expanded'); if (is_expanded) { $(this).find("select, input").prop('disabled', false); } else { $(this).find("select, input").attr({ "disabled": "disabled" }); } }); /* Check required validate form search*/ $('form.main-search').on('click', function (event) { var validate = true; $('input.required, select.required, textarea.required', this).each(function (index, el) { if ($(this).val() == '') { $(this).addClass('error'); $(this).closest('.form-group').find('.bootstrap-select').addClass('error'); if (validate) validate = false; } else { $(this).removeClass('error'); $(this).closest('.form-group').find('.bootstrap-select').removeClass('error'); } }); if(!$('.transfer-selectpicker')){ if (!validate) { return false; } return true; } }); $('.register_form .st_register_service').on('ifChecked', function (event) { var $content = $(this).parent().parent().parent().parent().parent(); $content.find(".col-md-7").show(500); $content.find(".col-md-2").show(500); }); $('.register_form .st_register_service').on('ifUnchecked', function (event) { var $content = $(this).parent().parent().parent().parent().parent(); $content.find(".col-md-7").hide(500); $content.find(".col-md-2").hide(500); }); $('.register_form .st_register_service').on('ifClicked', function (event) { var $this = $(this); var is_check = false; $this.parent().parent().parent().parent().parent().parent().find('.st_register_service').each(function () { var $this2 = $(this); setTimeout(function () { if ($this2.prop('checked') == true) { is_check = true; } }, 100) }); setTimeout(function () { if (is_check == true) { $this.parent().parent().parent().parent().parent().parent().find('.col-md-8').show(); } else { $this.parent().parent().parent().parent().parent().parent().find('.col-md-8').hide(); } }, 200) }); var is_check = false; $('.register_form').find('.st_register_service').each(function () { var $this2 = $(this); setTimeout(function () { if ($this2.prop('checked') == true) { is_check = true; } }, 100) }); setTimeout(function () { //console.log(is_check); if (is_check == true) { $('.register_form').find('.col-md-8').show(); } else { $('.register_form').find('.col-md-8').hide(); } }, 200); $('.register_form').find('.st_register_service').each(function () { var $this2 = $(this); setTimeout(function () { if ($this2.prop('checked') == true) { var $content = $this2.parent().parent().parent().parent().parent(); $content.find(".col-md-7").show(500); $content.find(".col-md-2").show(500); } }, 100) }); $(".btn_partner_send_email_user").on('click', function () { var container = $(this).parent().parent().parent(); var name = container.find(".name").val(); var email = container.find(".email").val(); var content = container.find(".message").val(); var user_id = container.find(".user_id").val(); var check = true; if (name == "") { container.find(".name").css("border-color", 'red'); check = false; } else { container.find(".name").css("border-color", '#ccc'); check = true; } if (email == "") { check = false; container.find(".email").css("border-color", 'red'); } else { container.find(".email").css("border-color", '#ccc'); check = true; } if (content == "") { check = false; container.find(".message").css("border-color", 'red'); } else { container.find(".message").css("border-color", '#ccc'); check = true; } if (check == true) { container.find(".ajax_loader").show(); ; $.ajax({ url : st_params.ajax_url, type : 'post', dataType: 'json', data : { action : 'send_email_for_user_partner', st_name : name, st_email : email, st_content: content, user_id : user_id }, success : function (res) { container.find(".ajax_loader").hide(); ; container.find(".msg").html(res.msg); ; //me.removeClass('loading'); // loading.remove(); }, error : function (res) { } }); } }); if ($(".st_social_login_success_check").length > 0) { window.opener.location.reload(); window.close(); } ; $('.tours-filters input[type=checkbox],.hotel-filters input[type=checkbox],.hotel-filters input[type=checkbox],.tours-filters input[type=checkbox]').on('ifClicked', function (event) { var url = $(this).data('url'); if (url) { window.location.href = url; } }); $('.cars-filters input[type=checkbox]').on('ifClicked', function (event) { var url = $(this).attr('data-url'); if (url) { window.location.href = url; } }); //login $('.st_login_form_popup').on('submit', function (e) { e.preventDefault(); $.ajax({ url : st_params.ajax_url, type : "POST", data : { 'action' : 'st_login_popup', 'user_login' : $(this).find('#pop-login_name').val(), 'user_password': $(this).find('#pop-login_password').val() }, dataType : "json", beforeSend: function () { $('.btn-submit-form img').show(); }, complete : function (res) { var data = res.responseText; data = $.parseJSON(data); $('.btn-submit-form img').hide(); if (data.error) { $('.notice_login').html(data.message); $('.popup_forget_pass').show(); } else { window.location.href = data.need_link; } }, error : function (msg) { } }); }); function convert_arr(data, action) { var res = {}; res['action'] = action; $.each(data, function (index, item) { res[item.name] = item.value; }); return res; } //Register $('.register_form_popup').on('submit', function (e) { e.preventDefault(); var data_form = $('.register_form_popup').serializeArray(); var formData = new FormData($('.register_form_popup')[0]); $.ajax({ url : st_params.ajax_url, type : "POST", data : formData, dataType : "json", processData: false, contentType: false, beforeSend : function () { $('.btn-submit-form img').show(); }, complete : function (res) { var data = res.responseText; $('.btn-submit-form img').hide(); $('.notice_register').html(res.responseText); console.log(res); if (!data.error) { $(".register_form_popup .data_field :input[type=text]").each(function () { $(this).val(''); }); $(".register_form_popup .data_field :input[type=password]").each(function () { $(this).val(''); }); $(".data_image_certificates").each(function () { $(this).html(''); }); } }, error : function (msg) { } }); }); }); /*flick */ jQuery(function ($) { $('.flickr_items').each(function () { var user_id = $(this).data('uid'); var me = $(this); var num = $(this).data('num'); if (user_id) { $.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?id=" + user_id + "&format=json&jsoncallback=?", function (data) { for (var i = 0; i <= num; i++) { var pic = data.items[i]; var smallpic = pic.media.m.replace('_m.jpg', '_s.jpg'); var item = $("<li><a title='" + pic.title + "' href='" + pic.link + "' target='_blank'><img width=\"75px\" height=\"75px\" src='" + smallpic + "' /></a></li>"); me.append(item); } }); } }); }); jQuery(function ($) { /* Show mini cart */ $('#show-mini-cart-button').on('click', function (event) { /* Act on the event */ $(this).parent().find('.traveler-cart-mini').toggleClass('open'); return false; }); $('.i-check').on('ifChanged', function () { var t = $(this); setTimeout(function () { var url = t.data('url'); if (url) { window.location.href = url; } }, 500); }); }); jQuery(function ($) { $('input.required-field').each(function (index, el) { var form = $(this).parents('form'); //console.log($(this).prop('checked')); if ($(this).prop('checked') == true) { $('.form-drop-off', form).addClass('field-hidden'); } else { $('.form-drop-off', form).removeClass('field-hidden'); } }); jQuery(window).on("load", function ($) { fix_weather_(); }); jQuery(window).on('resize', function ($) { fix_weather_(); full_height_init(); full_width_init(); }); function fix_weather_() { var e = $(".top-user-area").parent(".get_location_weather"); e.remove(); if ($(window).width() <= 992) { $(".menu_div").after(e); } else { $(".slimmenu-menu-collapser").parent(".nav").parent(".col-lg-8").after(e); } } function full_width_init() { var ww = $(window).width(); var left = (ww - 1170 + 30) / 2; if (ww < 1380) { left = (ww - 1170 + 30) / 2; } if (ww < 1199) { left = (ww - 970 + 30) / 2; } if (ww < 991) { left = (ww - 750 + 30) / 2; } if (ww < 767) { left = 15; } $('.st-new-fullwidth').css({'width': ww + 'px', 'left': '-' + left + 'px', position: 'relative'}); } full_width_init(); function full_height_init() { var wh = $(window).height(); var hh = $('#st_header_wrap').height(); var full_height = wh - hh; if ($('#wpadminbar').length > 0) { full_height = full_height - $('#wpadminbar').height(); } if (full_height < 480) { full_height = 480; } $('.st-full-height').css({height: full_height + 'px'}); } full_height_init(); $(document).ready(function(){ if ($('.tour-gallery').length > 0) { var owl = $('.tour-gallery'); owl.owlCarousel({ items : 1, center : true, loop : true, autoPlay : 7000, itemsDesktop : [1199, 1], itemsDesktopSmall: [979, 1], itemsTablet : [768, 1], itemsTabletSmall : false, itemsMobile : [479, 1], dots : false }); owl.parent().find(".owl-prev").on('click', function () { owl.trigger('owl.prev'); }); owl.parent().find(".owl-next").on('click', function () { owl.trigger('owl.next'); }); } }); $('.on_the_map .btn-on-map').each(function () { $(this).on('click', function (e) { e.preventDefault(); var p = $(this).parent().parent(); $(this).toggleClass('active'); if ($(this).hasClass('active')) { $(this).text($(this).data('hide')); } else { $(this).text($(this).data('no-hide')); } p.find('.st-tour-map').toggleClass('st-hide'); p.find('.review-price').toggleClass('active'); }); }); //Map new function selectStyle(name) { var style = []; if (name == 'style_normal') { style = [{ featureType: "road.highway", elementType: "geometry", stylers : [{saturation: 60}, {lightness: -20}] }]; } if (name == 'style_midnight') { style = [{ "featureType": "all", "elementType": "labels.text.fill", "stylers" : [{"saturation": 36}, {"color": "#000000"}, {"lightness": 40}] }, { "featureType": "all", "elementType": "labels.text.stroke", "stylers" : [{"visibility": "on"}, {"color": "#000000"}, {"lightness": 16}] }, { "featureType": "all", "elementType": "labels.icon", "stylers" : [{"visibility": "off"}] }, { "featureType": "administrative", "elementType": "geometry.fill", "stylers" : [{"color": "#000000"}, {"lightness": 20}] }, { "featureType": "administrative", "elementType": "geometry.stroke", "stylers" : [{"color": "#000000"}, {"lightness": 17}, {"weight": 1.2}] }, { "featureType": "administrative.country", "elementType": "labels", "stylers" : [{"visibility": "on"}, {"lightness": "0"}] }, { "featureType": "administrative.country", "elementType": "labels.text.fill", "stylers" : [{"visibility": "on"}, {"lightness": "13"}] }, { "featureType": "landscape", "elementType": "geometry", "stylers" : [{"color": "#000000"}, {"lightness": 20}] }, { "featureType": "poi", "elementType": "geometry", "stylers" : [{"color": "#000000"}, {"lightness": 21}] }, { "featureType": "road", "elementType": "all", "stylers" : [{"visibility": "on"}, {"saturation": "-100"}, {"lightness": "-20"}, {"invert_lightness": true}] }, { "featureType": "road", "elementType": "geometry.stroke", "stylers" : [{"color": "#bebebe"}] }, { "featureType": "road", "elementType": "labels.text.fill", "stylers" : [{"visibility": "on"}, {"lightness": "-47"}] }, { "featureType": "road", "elementType": "labels.text.stroke", "stylers" : [{"lightness": "-33"}, {"weight": "0.52"}] }, { "featureType": "road.highway", "elementType": "all", "stylers" : [{"visibility": "on"}] }, { "featureType": "road.highway", "elementType": "geometry", "stylers" : [{"visibility": "on"}, {"color": "#b5b5b5"}, {"saturation": "-1"}, {"gamma": "0.00"}, {"weight": "2.22"}] }, { "featureType": "road.highway", "elementType": "geometry.fill", "stylers" : [{"lightness": "0"}, {"visibility": "on"}, {"weight": "2.8"}, {"color": "#585858"}] }, { "featureType": "road.highway", "elementType": "geometry.stroke", "stylers" : [{"color": "#909090"}, {"lightness": "2"}, {"weight": "0.2"}, {"visibility": "off"}] }, { "featureType": "road.highway", "elementType": "labels.text.fill", "stylers" : [{"lightness": "16"}, {"color": "#595959"}] }, { "featureType": "road.highway", "elementType": "labels.text.stroke", "stylers" : [{"lightness": "-63"}, {"weight": "1"}] }, { "featureType": "road.arterial", "elementType": "geometry", "stylers" : [{"color": "#000000"}, {"lightness": 18}, {"visibility": "on"}] }, { "featureType": "road.arterial", "elementType": "geometry.fill", "stylers" : [{"visibility": "on"}, {"lightness": "10"}] }, { "featureType": "road.arterial", "elementType": "labels.text.fill", "stylers" : [{"visibility": "on"}, {"lightness": "28"}] }, { "featureType": "road.arterial", "elementType": "labels.text.stroke", "stylers" : [{"visibility": "on"}, {"weight": "0.1"}, {"lightness": "-96"}] }, { "featureType": "road.local", "elementType": "geometry", "stylers" : [{"color": "#000000"}, {"lightness": 16}] }, { "featureType": "transit", "elementType": "geometry", "stylers" : [{"color": "#000000"}, {"lightness": 19}] }, { "featureType": "water", "elementType": "geometry", "stylers" : [{"color": "#12161a"}, {"lightness": 17}] }]; } if (name == 'style_family_fest') { style = [{ "featureType": "administrative", "elementType": "labels.text.fill", "stylers" : [{"color": "#444444"}] }, { "featureType": "landscape", "elementType": "all", "stylers" : [{"color": "#f2f2f2"}] }, {"featureType": "poi", "elementType": "all", "stylers": [{"visibility": "off"}]}, { "featureType": "poi", "elementType": "geometry.fill", "stylers" : [{"visibility": "on"}, {"saturation": "-6"}] }, { "featureType": "poi", "elementType": "geometry.stroke", "stylers" : [{"visibility": "on"}] }, { "featureType": "poi", "elementType": "labels", "stylers" : [{"visibility": "on"}, {"weight": "1.30"}] }, { "featureType": "poi", "elementType": "labels.text", "stylers" : [{"visibility": "on"}] }, { "featureType": "poi", "elementType": "labels.text.fill", "stylers" : [{"visibility": "on"}] }, { "featureType": "poi", "elementType": "labels.icon", "stylers" : [{"visibility": "on"}] }, { "featureType": "road", "elementType": "all", "stylers" : [{"saturation": -100}, {"lightness": 45}] }, { "featureType": "road.highway", "elementType": "all", "stylers" : [{"visibility": "simplified"}] }, { "featureType": "road.arterial", "elementType": "labels.icon", "stylers" : [{"visibility": "off"}] }, { "featureType": "transit", "elementType": "all", "stylers" : [{"visibility": "off"}] }, {"featureType": "water", "elementType": "all", "stylers": [{"color": "#52978e"}, {"visibility": "on"}]}]; } if (name == 'style_open_dark') { style = [{ "featureType": "all", "elementType": "labels.text.fill", "stylers" : [{"color": "#ffffff"}] }, { "featureType": "all", "elementType": "labels.text.stroke", "stylers" : [{"visibility": "on"}, {"color": "#3e606f"}, {"weight": 2}, {"gamma": 0.84}] }, { "featureType": "all", "elementType": "labels.icon", "stylers" : [{"visibility": "off"}] }, { "featureType": "administrative", "elementType": "all", "stylers" : [{"visibility": "on"}] }, { "featureType": "administrative", "elementType": "geometry", "stylers" : [{"weight": 0.6}, {"color": "#1a3541"}] }, { "featureType": "landscape", "elementType": "all", "stylers" : [{"visibility": "on"}, {"color": "#293c4d"}] }, { "featureType": "landscape", "elementType": "geometry", "stylers" : [{"color": "#2c5a71"}] }, { "featureType": "landscape", "elementType": "geometry.fill", "stylers" : [{"color": "#293c4d"}] }, { "featureType": "poi", "elementType": "geometry", "stylers" : [{"color": "#406d80"}] }, { "featureType": "poi.park", "elementType": "geometry", "stylers" : [{"color": "#2c5a71"}] }, {"featureType": "road", "elementType": "all", "stylers": [{"visibility": "on"}]}, { "featureType": "road", "elementType": "geometry", "stylers" : [{"color": "#1f3035"}, {"lightness": -37}] }, { "featureType": "road", "elementType": "labels", "stylers" : [{"visibility": "on"}] }, { "featureType": "transit", "elementType": "all", "stylers" : [{"visibility": "on"}] }, { "featureType": "transit", "elementType": "geometry", "stylers" : [{"color": "#406d80"}] }, { "featureType": "transit", "elementType": "labels.icon", "stylers" : [{"hue": "#00d1ff"}] }, {"featureType": "water", "elementType": "geometry", "stylers": [{"color": "#193341"}]}]; } if (name == 'style_riverside') { style = [{ "featureType": "administrative", "elementType": "all", "stylers" : [{"visibility": "off"}] }, { "featureType": "administrative", "elementType": "geometry.stroke", "stylers" : [{"visibility": "on"}] }, { "featureType": "administrative", "elementType": "labels", "stylers" : [{"visibility": "on"}, {"color": "#716464"}, {"weight": "0.01"}] }, { "featureType": "administrative.country", "elementType": "geometry", "stylers" : [{"visibility": "on"}] }, { "featureType": "administrative.country", "elementType": "labels", "stylers" : [{"visibility": "on"}] }, { "featureType": "administrative.country", "elementType": "labels.text", "stylers" : [{"visibility": "off"}] }, { "featureType": "landscape", "elementType": "all", "stylers" : [{"visibility": "simplified"}] }, { "featureType": "landscape.natural", "elementType": "geometry", "stylers" : [{"visibility": "simplified"}] }, { "featureType": "landscape.natural.landcover", "elementType": "geometry", "stylers" : [{"visibility": "simplified"}] }, { "featureType": "poi", "elementType": "all", "stylers" : [{"visibility": "simplified"}] }, { "featureType": "poi", "elementType": "geometry.fill", "stylers" : [{"visibility": "simplified"}] }, { "featureType": "poi", "elementType": "geometry.stroke", "stylers" : [{"visibility": "simplified"}] }, { "featureType": "poi", "elementType": "labels.text", "stylers" : [{"visibility": "simplified"}] }, { "featureType": "poi", "elementType": "labels.text.fill", "stylers" : [{"visibility": "simplified"}] }, { "featureType": "poi", "elementType": "labels.text.stroke", "stylers" : [{"visibility": "simplified"}] }, { "featureType": "poi.attraction", "elementType": "geometry", "stylers" : [{"visibility": "on"}] }, { "featureType": "poi.business", "elementType": "geometry", "stylers" : [{"visibility": "off"}] }, { "featureType": "poi.business", "elementType": "geometry.fill", "stylers" : [{"visibility": "off"}] }, { "featureType": "poi.government", "elementType": "geometry", "stylers" : [{"visibility": "off"}] }, { "featureType": "poi.park", "elementType": "geometry", "stylers" : [{"visibility": "off"}] }, { "featureType": "poi.school", "elementType": "geometry", "stylers" : [{"visibility": "off"}] }, { "featureType": "road", "elementType": "all", "stylers" : [{"visibility": "on"}] }, { "featureType": "road.highway", "elementType": "all", "stylers" : [{"visibility": "off"}] }, { "featureType": "road.highway", "elementType": "geometry", "stylers" : [{"visibility": "on"}] }, { "featureType": "road.highway", "elementType": "geometry.fill", "stylers" : [{"visibility": "on"}, {"color": "#787878"}] }, { "featureType": "road.highway", "elementType": "geometry.stroke", "stylers" : [{"visibility": "simplified"}, {"color": "#a05519"}, {"saturation": "-13"}] }, { "featureType": "road.highway", "elementType": "labels.text", "stylers" : [{"color": "#fcfcfc"}, {"visibility": "on"}] }, { "featureType": "road.highway", "elementType": "labels.text.fill", "stylers" : [{"color": "#636363"}] }, { "featureType": "road.highway", "elementType": "labels.text.stroke", "stylers" : [{"weight": "4.27"}, {"color": "#ffffff"}] }, { "featureType": "road.highway", "elementType": "labels.icon", "stylers" : [{"visibility": "on"}, {"weight": "0.01"}] }, { "featureType": "road.local", "elementType": "all", "stylers" : [{"visibility": "on"}] }, { "featureType": "transit", "elementType": "all", "stylers" : [{"visibility": "simplified"}] }, { "featureType": "transit", "elementType": "geometry", "stylers" : [{"visibility": "simplified"}] }, { "featureType": "transit.station", "elementType": "geometry", "stylers" : [{"visibility": "on"}] }, { "featureType": "water", "elementType": "all", "stylers" : [{"visibility": "simplified"}, {"color": "#84afa3"}, {"lightness": 52}] }, { "featureType": "water", "elementType": "geometry", "stylers" : [{"visibility": "on"}] }, { "featureType": "water", "elementType": "geometry.fill", "stylers" : [{"visibility": "on"}, {"color": "#7ca0a4"}] }, {"featureType": "water", "elementType": "labels.text.fill", "stylers": [{"color": "#ffffff"}]}]; } if (name == 'style_ozan') { style = [{ "featureType": "administrative", "elementType": "labels.text.fill", "stylers" : [{"visibility": "on"}, {"weight": 1}, {"color": "#003867"}] }, { "featureType": "administrative", "elementType": "labels.text.stroke", "stylers" : [{"visibility": "on"}, {"weight": 8}] }, { "featureType": "road.highway", "elementType": "geometry", "stylers" : [{"visibility": "on"}, {"color": "#E1001A"}, {"weight": 0.4}] }, { "featureType": "road.arterial", "elementType": "geometry", "stylers" : [{"visibility": "on"}, {"color": "#edeff1"}, {"weight": 0.2}] }, { "featureType": "road.local", "elementType": "geometry", "stylers" : [{"visibility": "on"}, {"color": "#edeff1"}, {"weight": 0.4}] }]; } if (name == 'style_icy_blue') { style = [{"stylers": [{"hue": "#2c3e50"}, {"saturation": 250}]}, { "featureType": "road", "elementType": "geometry", "stylers" : [{"lightness": 50}, {"visibility": "simplified"}] }, {"featureType": "road", "elementType": "labels", "stylers": [{"visibility": "off"}]}] } return style } window.__ = {}; var map_element = $('#st-tour-map-new'); if (map_element.length > 0 && typeof google === 'object') { var style = 'style_normal'; if (map_element.data('style') != undefined) { style = map_element.data('style'); } var autoload = true; if (map_element.data('autoload_map') == 0) { autoload = false } window.__.map_data = { map_element: map_element, location : map_element.data('location'), style : selectStyle(style), style_name : style, map : {}, map_width : 0, map_height : 0, marker : {}, marker_data: map_element.data('marker-data'), autoload : autoload, marker_icon: map_element.data('marker-icon') }; $('.on_the_map .btn-on-map').on('click', function (e) { e.preventDefault(); if (!__.map_data.autoload) { __.map_render.loadmap(); __.map_render.on(); __.map_render.responsive(); __.map_data.autoload = true; } }); $(window).on('load', function () { if (!__.map_data.autoload) { __.map_render.loadmap(); __.map_render.on(); __.map_render.responsive(); __.map_data.autoload = true; } }); var map_render = function () { }; map_render.prototype.init = function () { if (__.map_data.autoload) { __.map_render.loadmap(); __.map_render.on(); } }; var map; map_render.prototype.loadmap = function () { var scroll = false, draggable = false; __.map_data.map = new google.maps.Map(__.map_data.map_element[0], { scrollwheel : scroll, zoom : parseInt(__.map_data.location.zoom), center : new google.maps.LatLng(parseFloat(__.map_data.location.lat), parseFloat(__.map_data.location.lng)), styles : __.map_data.style, mapTypeId : google.maps.MapTypeId.ROADMAP, zoomControl : false, mapTypeControl : false, scaleControl : false, streetViewControl : false, rotateControl : false, fullscreenControl : false, mapTypeControlOptions: { style : google.maps.MapTypeControlStyle.DEFAULT, mapTypeIds: [ google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.TERRAIN ] } }); map = __.map_data.map; //Create marker if (__.map_data.marker_data != undefined && __.map_data.marker_data != '') { var class_dark = ''; if (__.map_data.style_name == 'style_midnight') { class_dark = 'dark'; } __.map_data.marker = new RichMarker({ position : new google.maps.LatLng(parseFloat(__.map_data.location.lat), parseFloat(__.map_data.location.lng)), map : __.map_data.map, draggable: draggable, shadow : 'none', animation: google.maps.Animation.DROP, content : '<div class="padding-bottom30 ' + class_dark + '"><div class="large-marker-hotel "><div class="bg-thumb" style="background: url(' + __.map_data.marker_data.thumb + ')"></div><div class="caption"><h3 class="title">' + __.map_data.marker_data.title + '</h3><span class="location">' + __.map_data.marker_data.in + '</span></div></div></div>' }); } else { var marker = new google.maps.Marker({ position : new google.maps.LatLng(parseFloat(__.map_data.location.lat), parseFloat(__.map_data.location.lng)), map : __.map_data.map, draggable: false, icon : __.map_data.marker_icon, animation: google.maps.Animation.DROP }); } this.loadmap.fullHeight = function () { var ww = $(window).width(); if (__.map_data.full_height) { var hw = $(window).height(); if (hw < 480) { hw = 480; } if ($('#wpadminbar').length > 0) { hw = hw - $('#wpadminbar').height(); } if ($('.topbar .no-transparent').length > 0 && ww > 991) { var ht = $('.topbar .no-transparent').height(); hw = hw - ht; } if (hw < 480) { hw = 480; } if (ww < parseInt(__.map_data.check_width) && parseInt(__.map_data.check_width) > 0) { hw = 300; } __.map_data.map_element.height(hw); } }; __.map_render.loadmap.fullHeight(); __.map_render.action(); }; map_render.prototype.responsive = function () { if (__.map_data.autoload) { __.map_render.loadmap.fullHeight(); } google.maps.event.trigger(__.map_data.map, "resize"); }; map_render.prototype.action = function (type, args) { this.action.clickZoomControl = function (type) { switch (type) { case 'my-location': var my_location = new google.maps.Marker({ clickable: false, //animation: google.maps.Animation.DROP, icon : new google.maps.MarkerImage('https://maps.gstatic.com/mapfiles/ms2/micons/green-dot.png'), shadow : null, zIndex : 999, map : __.map_data.map }); if (navigator.geolocation) navigator.geolocation.getCurrentPosition(function (pos) { var me = new google.maps.LatLng(pos.coords.latitude, pos.coords.longitude); my_location.setPosition(me); __.map_data.map.panTo(me); }, function (error) { }); break; case 'zoom-in': var zoom_in = __.map_data.map.getZoom(); __.map_data.map.setZoom(zoom_in + 1); break; case 'zoom-out': var zoom_out = __.map_data.map.getZoom(); __.map_data.map.setZoom(zoom_out - 1); break; } }; this.action.clickViewControl = function (type, args) { switch (type) { case 'full-screen': __.map_data.map_width = __.map_data.map_element.css('width'); __.map_data.map_height = __.map_data.map_element.css('height'); __.map_data.map_element.css({ position : 'fixed', top : 0, left : 0, width : '100%', height : '100%', backgroundColor: 'dark', 'z-index' : '9999999' }); $('.st-tour-map .zoom-control').css({ 'z-index': 10000000, position : 'fixed' }); $('.st-tour-map .view-control').css({ 'z-index': 10000000, position : 'fixed' }); __.map_data.map_element.closest('.st-tour-map').css({ position : 'fixed', top : 0, left : 0, 'z-index': '9999999' }); google.maps.event.trigger(__.map_data.map, "resize"); $('.full-screen').toggle(); $('.exit-full-screen').toggle(); break; case 'exit-full-screen': __.map_data.map_element.css({ position : 'relative', 'z-index' : 0, top : 0, width : __.map_data.map_width, height : __.map_data.map_height, backgroundColor: 'transparent' }); __.map_data.map_element.closest('.st-tour-map').css({ position : 'absolute', top : 0, left : 0, 'z-index': '2' }); $('.st-tour-map .zoom-control').css({ 'z-index': 1, position : 'absolute' }); var ww = $(window).width(); if (ww > 640) { $('.st-tour-map .view-control').css({ 'z-index': 1, position : 'absolute' }); } else { $('.st-tour-map .view-control').css({ 'z-index': 99, position : 'absolute' }); } $('.full-screen').toggle(); $('.exit-full-screen').toggle(); break; case 'view': if (!args.element.hasClass('active')) { args.element.addClass('active'); $('.st-tour-map .view-control .map_type').fadeIn(300); } else { args.element.removeClass('active'); $('.st-tour-map .view-control .map_type').fadeOut(300); } break; } }; this.action.clickMapType = function (type) { if (__.map_data.style_name != type) { __.map_data.style_name = type; __.map_data.style = selectStyle(type); var customMapType = new google.maps.StyledMapType(__.map_data.style); __.map_data.map.mapTypes.set('styled_map', customMapType); __.map_data.map.setMapTypeId('styled_map'); } }; }; map_render.prototype.on = function () { $('body').on('click', '.map-content-marker .icon_marker', function (e) { e.preventDefault(); __.map_render.action.clickMarker({element: $(this)}); }); $('.st-tour-map .zoom-control a').each(function () { $(this).on('click', function (e) { e.preventDefault(); __.map_render.action.clickZoomControl($(this).attr('class')); }); }); $('.st-tour-map .view-control a').each(function () { $(this).on('click', function (e) { e.preventDefault(); __.map_render.action.clickViewControl($(this).attr('data-class'), {element: $(this)}); }); }); $('.st-tour-map .view-control .map_type span').each(function () { $(this).on('click', function (e) { e.preventDefault(); __.map_render.action.clickMapType($(this).attr('data-map')); }); }); }; window.__.map_render = new map_render(); __.map_render.init(); $(window).on('resize', function () { __.map_render.responsive(); }) } if ($('.collapse-user').length) { $('.collapse-user').on('click', function (event) { /* Act on the event */ $('.user-nav-wrapper').toggleClass('open'); return false; }); } var width_window = $(window).width(); if (width_window < 768) { $('.st-elements-filters').each(function () { $(this).find('li .booking-filters-title').addClass('closed'); $(this).find('li > div').css('display', 'none'); }); } if ($('.transfer-selectpicker').length) { $('.transfer-selectpicker').selectpicker({ size: 10 }); //$('.transfer-selectpicker').tooltip('disable'); } }); // Custom 2 jQuery(function ($) { $("#st_enable_javascript").each(function () { if ($(this).hasClass("allow")) { $("#st_enable_javascript").html(".search-tabs-bg > .tabbable >.tab-content > .tab-pane{display: none; opacity: 0;}" + ".search-tabs-bg > .tabbable >.tab-content > .tab-pane.active{display: block;opacity: 1;}" + ".search-tabs-to-top { margin-top: -120px;}") } }) }); jQuery(function ($) { if (typeof $.fn.sticky != 'undefined') { var topSpacing = 0; if ($(window).width() > 481 && $('body').hasClass('admin-bar')) { topSpacing = $('#wpadminbar').height() } set_sticky() } function set_sticky() { var is_menu1 = $(".menu_style1").length; var is_menu2 = $(".menu_style2").length; var is_menu3 = $(".menu_style3").length; var is_menu4 = $(".menu_style4").length; var is_topbar = $("#top_toolbar").length; var sticky_topbar = $(".enable_sticky_topbar").length; var sticky_menu = $(".enable_sticky_menu").length; var sticky_header = $(".enable_sticky_header").length; if (sticky_header || (sticky_menu && sticky_topbar)) { $("#st_header_wrap_inner").sticky({topSpacing: topSpacing}); return } else { if (sticky_topbar && is_topbar) { $("#top_toolbar").sticky({topSpacing: topSpacing}) } if (sticky_menu && (is_menu1 || is_menu2 || is_menu3 || is_menu4)) { var topSpacing_topbar = topSpacing; if (is_topbar && sticky_topbar) { topSpacing_topbar += $("#top_toolbar").height() } $("#menu1").sticky({topSpacing: topSpacing_topbar}); $("#menu2").sticky({topSpacing: topSpacing_topbar}); $("#menu3").sticky({topSpacing: topSpacing_topbar}); $("#menu4").sticky({topSpacing: topSpacing_topbar}); return } } return } function other_sticky(spacing) { } if ($('body').hasClass('search_enable_preload')) { window.setTimeout(function () { $('.full-page-absolute').fadeOut().addClass('.hidden') }, 1000) } $('#gotop').on('click', function () { $("body,html").animate({scrollTop: 0}, 1000, function () { $('#gotop').fadeOut() }) }); $(window).on('scroll', function () { var scrolltop = $(window).scrollTop(); if (scrolltop > 200) { $('#gotop').fadeIn() } else { $('#gotop').fadeOut() } scroll_with_out_transparent() }); scroll_with_out_transparent(); function scroll_with_out_transparent() { var sdlfkjsdflksd_scrolltop = $(window).scrollTop(); var header_bgr_default = {'background-color': ""}; if ($("body").hasClass("menu_style2") && sdlfkjsdflksd_scrolltop != 0 && $('.enable_sticky_menu.header_transparent').length !== 0) { $(".header-top").css(st_params.header_bgr) } else { $(".header-top").css(header_bgr_default) } } var top_ajax_search = $('.st-top-ajax-search'); if (top_ajax_search.length) { top_ajax_search.typeahead({hint: !0, highlight: !0, minLength: 3, limit: 8}, { source: function (q, cb) { $('.st-top-ajax-search').parent().addClass('loading'); return $.ajax({ dataType: 'json', type: 'get', url: st_params.ajax_url, data: { security: st_params.st_search_nonce, action: 'st_top_ajax_search', s: q, lang: top_ajax_search.data('lang') }, cache: !0, success: function (data) { $('.st-top-ajax-search').parent().removeClass('loading'); var result = []; if (data.data) { $.each(data.data, function (index, val) { result.push({ value: val.title, location_id: val.id, type_color: 'success', type: val.type, url: val.url }) }); cb(result); } }, error: function (e) { $('.st-top-ajax-search').parent().removeClass('loading') } }) }, templates: {suggestion: Handlebars.compile('<p class="search-line-item"><label class="label label-{{type_color}}">{{type}}</label><strong> {{value}}</strong></p>')} }); top_ajax_search.on('typeahead:selected', function (obj, datum, name) { if (datum.url) { window.location.href = datum.url } }) } if ($.fn.chosen) { $(".chosen_select").chosen() } $('.woocommerce-ordering .posts_per_page').on('change', function () { $('.woocommerce-ordering').trigger('submit') }); var product_timeout; $('.woocommerce li.product').on('hover', function () { var me = $(this); product_timeout = window.setTimeout(function () { me.find('.product-info-hide').slideDown('fast') }, 250) }, function () { window.clearTimeout(product_timeout); var me = $(this); me.find('.product-info-hide').slideUp('fast') }); var menu3_resize = null; $(window).on('resize', function (event) { clearTimeout(menu3_resize); if ($('header#menu3').length) { menu3_resize = setTimeout(function () { if (window.matchMedia("(min-width: 1200px)").matches) { var container = $('#top_header .container').height(); var menu = $('#slimmenu').height(); $('header#menu3 .nav').css('margin-top', (container - menu) / 2) } }, 500) } }).trigger('resize'); $('#search-icon').on('click', function (event) { $('.main-header-search').fadeIn('fast'); return !1 }); $('#search-close').on('click', function (event) { $('.main-header-search').fadeOut('fast'); return !1 }); if ($('.st-slider-list-hotel').length) { $('.st-slider-list-hotel').owlCarousel({ items: 1, singleItem: !0, slideSpeed: 500, transitionStyle: $('.st-slider-list-hotel').data('effect'), autoHeight: !0 }) } if ($("#owl-twitter").length) { $("#owl-twitter").owlCarousel({ navigation: !0, slideSpeed: 300, paginationSpeed: 400, singleItem: !0, navigationText: ["", ""], pagination: !1, autoPlay: !0 }) } var st_list_partner = $(".st_list_partner"); setTimeout(function () { st_list_partner.each(function () { var items = $(this).data('items'); var speed = $(this).data('speed'); var autoplay = $(this).data('autoplay'); autoplay = (autoplay == 'yes') ? !0 : !1; $(this).owlCarousel({ slideSpeed: speed, paginationSpeed: 400, navigationText: ["", ""], pagination: !1, navigation: !1, autoPlay: autoplay, items: 4, itemsDesktop: [1000, 4], itemsDesktopSmall: [900, 3], itemsTablet: [600, 1], itemsMobile: !1 }) }) }, 500); $(".st_list_partner_nav .next").on('click', function () { st_list_partner.trigger('owl.next') }); $(".st_list_partner_nav .prev").on('click', function () { st_list_partner.trigger('owl.prev') }); $(".st_tour_ver_countdown").each(function () { $(this).syotimer({ year: parseInt($(this).data('year')), month: parseInt($(this).data('month')), day: parseInt($(this).data('day')), hour: 0, minute: 0, lang: ($(this).data('lang')), }) }) if ($('.st_tour_ver_fotorama').length) { $('.st_tour_ver_fotorama').fotorama({nav: !1,}) } var flag_ajax_coupon = !1; $('body').on('click', '.add-coupon-ajax', function () { var t = $(this), overlay = t.closest('.booking-item-payment').find('.overlay-form'), form = t.closest('form'), alert = $('.alert', form), data = form.serializeArray(); if (flag_ajax_coupon) { return !1 } flag_ajax_coupon = !0; overlay.fadeIn(); alert.addClass('hidden').html(''); $.post(st_params.ajax_url, data, function (respon, textStatus, xhr) { if (respon.status == 1) { overlay.fadeIn(); var data = {'action': 'modal_get_cart_detail'}; $.post(st_params.ajax_url, data, function (respon, textStatus, xhr) { t.closest('.booking-item-payment').html(respon); overlay.fadeOut(); flag_ajax_coupon = !1 }, 'json') } else { alert.removeClass('hidden').html(respon.message); overlay.fadeOut(); flag_ajax_coupon = !1 } }, 'json'); return !1 }); var flagApplyCoupon = 1; $('body').on('click', '.booking-item-coupon form button', function (e) { if (!$(this).hasClass('add-coupon-ajax')) { if(flagApplyCoupon == 0){ return false; } flagApplyCoupon = 0; e.preventDefault(); var form = $(this).closest('form'); $(this).append('<i class="fa fa-spinner fa-spin"></i>'); var data = { 'action': 'apply_mdcoupon_function', 'code': $('#field-coupon_code', form).val() }; $.post(st_params.ajax_url, data, function (respon, textStatus, xhr) { if (respon.status == 1) { form.trigger('submit'); } }, 'json'); } }); $('body').on('click', '.ajax-remove-coupon', function (event) { event.preventDefault(); var t = $(this), overlay = t.closest('.booking-item-payment').find('.overlay-form'), form = t.closest('form'), alert = $('.alert', form); if (flag_ajax_coupon) { return !1 } flag_ajax_coupon = !0; overlay.fadeIn(); var data = {'action': 'ajax_remove_coupon', 'coupon': $(this).data('coupon')}; $.post(st_params.ajax_url, data, function (respon, textStatus, xhr) { overlay.fadeIn(); var data = {'action': 'modal_get_cart_detail'}; $.post(st_params.ajax_url, data, function (respon, textStatus, xhr) { t.closest('.booking-item-payment').html(respon); overlay.fadeOut(); flag_ajax_coupon = !1 }, 'json') }, 'json') }); $('#myModal').modal('show') }); jQuery(function ($) { $('.extra-collapse a').on('click', function (e) { e.preventDefault(); var p = $(this).closest('.extra-price'); if (p.find('.extra-collapse-control').hasClass('extra-none')) { $(this).find('i').removeClass('fa-angle-double-down'); $(this).find('i').addClass('fa-angle-double-up'); p.find('.extra-collapse-control').removeClass('extra-none') } else { $(this).find('i').removeClass('fa-angle-double-up'); $(this).find('i').addClass('fa-angle-double-down'); p.find('.extra-collapse-control').addClass('extra-none') } }); if ($('.has-matchHeight', 'body').length) { $('.has-matchHeight', 'body').matchHeight() } }); jQuery(function ($) { $('.ac-gallery').each(function () { var owl1 = $(this); owl1.owlCarousel({ items: 1, loop: true, autoplay: false, dots: false, pagination: false }); $(this).parent().find(".owl-prev").on('click', function () { owl1.trigger('owl.prev'); }); $(this).parent().find(".owl-next").on('click', function () { owl1.trigger('owl.next'); }); }); $('.accommodation-single-map .st_list_map .content_map #list_map').each(function () { var wh = $(window).height(); var hh = $('#st_header_wrap').height(); var full_height = wh - hh; if ($('#wpadminbar').length > 0) { full_height = full_height - $('#wpadminbar').height(); } if (full_height < 480) { full_height = 480; } $(this).css({height: full_height + 'px'}); }); $('.on_the_map .btn-on-map').each(function () { $(this).on('click', function (e) { e.preventDefault(); var p = $(this).parent().parent(); $(this).toggleClass('active'); if ($(this).hasClass('active')) { $(this).text($(this).data('hide')); } else { $(this).text($(this).data('no-hide')); } p.find('.accommodation-single-map').toggleClass('active'); p.find('.review-price').toggleClass('active'); }); }); //Inbox $('.st-inbox-send').on('click', function(e){ e.preventDefault(); var p = $(this).closest('.st-form-inbox'); var t = $(this); if(p.find('input[name="inbox-title"]').val() == ''){ p.find('input[name="inbox-title"]').addClass('wb-error'); }else if(p.find('textarea[name="inbox-message"]').val() == '' ){ p.find('textarea[name="inbox-message"]').addClass('wb-error'); }else{ var id = p.find('input[name="post_id"]').val(); var to_user = p.find('input[name="to_user"]').val(); var title = p.find('input[name="inbox-title"]').val(); var message = p.find('textarea[name="inbox-message"]').val(); t.addClass('loading'); p.find('input[name="inbox-title"]').removeClass('wb-error'); p.find('textarea[name="inbox-message"]').removeClass('wb-error'); $.ajax({ url: st_params.ajax_url, data: { action: 'send_message_partner', id: id, title: title, message: message, to_user: to_user, st_send_message : p.find('input[name="st_send_message"]').val(), _wp_http_referer : p.find('input[name="_wp_http_referer"]').val(), }, dataType: 'json', type: 'POST', success: function(msg){ if(msg.status == 1){ p.find('.inbox-group').hide(); p.find('.inbox-notice').addClass('success'); p.find('.inbox-notice').text(p.find('.inbox-notice').data('success')); p.find('.detail-message').attr('href', msg.link_detail); p.find('.detail-message').removeClass('hide'); p.find('.inbox-notice').addClass('alert-success').removeClass('hide').removeClass('alert-danger'); }else{ if(msg.message.length < 0){ p.find('.inbox-notice').text(p.find('.inbox-notice').data('error')); }else{ p.find('.inbox-notice').html(msg.message); } p.find('.inbox-notice').addClass('alert-danger').removeClass('hide'); } t.removeClass('loading'); }, error: function(e){ console.error(e); } }); } }); $('.inbox-reply-btn').on('click', function (e) { e.preventDefault(); var p = $(this).closest('.form-reply'); var t = $(this); if(p.find('textarea[name="reply-content"]').val() == ''){ p.find('textarea[name="reply-content"]').addClass('wb-error'); }else{ var content = p.find('textarea[name="reply-content"]').val(); t.addClass('loading'); $.ajax({ url: st_params.ajax_url, data:{ action: 'inbox_reply_message', content: content, to_user: p.find('input[name="to_user"]').val(), parent_id: p.find('input[name="message_id"]').val(), post_id: p.find('input[name="post_id"]').val() }, dataType: 'json', type: 'POST', success: function(msg){ if(msg.status == 1){ var html = '<div class="message-item from">' + '<div class="user-avatar">' +msg.data.avatar+ '<span>'+msg.data.username+'</span>' + '</div>' + '<div class="message-item-content">' +'<span>'+msg.data.content+'</span>' +'<span>'+msg.data.created_at+'</span>' + '</div>' +'</div>'; $('.st-inbox-body-detail .message-box').append(html); p.find('textarea[name="reply-content"]').val(''); p.find('textarea[name="reply-content"]').removeClass('wb-error'); if(jQuery().niceScroll){ $('.st-inbox-body-detail .message-box').niceScroll(); } // var pos = $('.message-box .message-item').last().position().top; // $('.st-inbox-body-detail .message-box').animate({scrollTop: pos}, 'slow'); var objDiv = document.getElementById("message-box"); objDiv.scrollTop = objDiv.scrollHeight; } t.removeClass('loading'); }, error: function(e){ console.error(e); } }); } }); $('.btn_remove_message').on('click', function () { var container = $(this).closest('.st-inbox-body'); var p = $(this).closest('.message-item'); var t = $(this); t.addClass('loading'); $.ajax({ url: st_params.ajax_url, data:{ action: 'inbox_remove_message', message_id: t.data('message-id'), }, dataType: 'json', type: 'POST', success: function(msg){ p.remove(); container.find('.count_message').html(msg.total_message); }, error: function(e){ t.removeClass('loading'); } }); }); $('.message-box').each(function(){ if(jQuery().niceScroll){ $('.st-inbox-body-detail .message-box').niceScroll(); } /*if($('.message-box .message-item').length > 0) { var pos = $('.message-box .message-item').last().position().top; $('.st-inbox-body-detail .message-box').animate({scrollTop: pos}, 'slow'); }*/ }); $('.st_last_message_id').each(function(){ var $this = $(this); var container = $(this).closest('.st-inbox-body-detail'); var is_get_data = true; setInterval(function(){ var last_message_id = $this.val(); if(is_get_data == false ) return false; is_get_data = false; $.ajax({ url: st_params.ajax_url, data:{ action: 'inbox_get_last_message', last_message_id: last_message_id, message_id: $this.data('message_id'), user_id: $this.data('user_id'), post_id: $this.data('post_id') }, dataType: 'json', type: 'POST', success: function(msg){ is_get_data = true; if(msg.length > 0){ for (var key in msg){ var attrValue = msg[key]; var html = '<div class="message-item to">' + '<div class="user-avatar">' +attrValue.avatar+ '<span>'+attrValue.username+'</span>' + '</div>' + '<div class="message-item-content">' +'<span>'+attrValue.content+'</span>' +'<span>'+attrValue.created_at+'</span>' + '</div>' +'</div>'; container.find('.message-box').append(html); container.find('.st_last_message_id').val(attrValue.id); } } if(jQuery().niceScroll){ container.find('.message-box').niceScroll(); } //var pos = $('.message-box .message-item').last().position().top; //container.find('.message-box').animate({scrollTop: pos}, 'slow'); }, error: function(e){ } }); },10000); }); $.ajax({ url: st_params.ajax_url, data: { action: 'check_inbox_notification' }, dataType: 'json', type: 'POST', success: function (msg) { if(msg.status == 1 && (msg.old_count === undefined || msg.new_message != msg.old_count)){ var html = "<a href='"+msg.inbox_link+"' target='_blank' ><div class='st_notice_template'><i class='fa fa-comment'></i> <div class='display_table'>" + msg.message + "</div> </div></a>"; noty({ text: html, layout: 'topRight', type: 'info', closeWith: ['click', 'button'], animation: { open: 'animated bounceInRight', close: 'animated bounceOutRight', easing: 'swing', speed: 500 }, theme: 'relax', progressBar: true, timeout: 6000 }) } }, error: function (e) { console.error(e); } }); $('.st-inbox').on('click', function () { $(this).find('.st-form-inbox').addClass('active'); }); $('.st-hotel-tabs-content .nav-tabs li a, .st-tour-tabs-content .nav-tabs li a').on('click', function () { var href = $(this).attr('href'); window.location.replace(href); }); $('.st-hotel-tabs-content,.st-tour-tabs-content').each(function () { if(window.location.href.indexOf('#') > 0 ){ var hashes = window.location.href.slice(window.location.href.indexOf('#') + 1).split('&'); var hash = hashes[0]; var check_comment = hash.split('-'); if(hash.length > 0 && check_comment[0] == 'comment'){ hash = 'review'; } if(hash.length > 0){ $(this).find('li').removeClass('active'); $(this).find('.tab-pane').removeClass('active').removeClass('in'); $(this).find('a[href=#'+hash+']').parent().addClass('active'); $(this).find('#'+hash).addClass('active').addClass('in'); } } }); }); jQuery(function ($) { $(document).on('click', '.btn-info-booking', function(event) { var modal = $(this).data('target'); modal = $(modal); modal.find('.modal-content-inner').empty(); modal.find('.overlay-form').fadeIn(); $.ajax({ url: st_params.ajax_url, data: { action: 'st_get_info_booking_history', order_id: $(this).data('order_id'), service_id: $(this).data('service_id') }, dataType: 'json', type: 'POST', success: function (res) { if(res.status == 1){ modal.find('.modal-content-inner').html(res.html); } if(res.msg != ""){ modal.find('.modal-content-inner').html(res.msg); } modal.find('.overlay-form').fadeOut(); }, error: function (e) { console.error(e); } }); }); $('.btn-user-update-to-partner').on('click', function(e){ var data = confirm($(this).data('confirm')); if(data == false) e.preventDefault(); }); /* Send email to customer by date */ if($('.booking-email-form').length) { $('#cb-select-all').on('click', function () { var t = $(this); var parent = $(this).closest('.booking-email-form'); parent.find('input:checkbox').not(this).prop('checked', this.checked); }); $('.cb-select-child').on('click', function () { var t = $(this); var parent = $(this).closest('.booking-email-form'); parent.find('input#cb-select-all').prop('checked', false); var check = 0; $('.cb-select-child').each(function (e) { if (!$(this).is(":checked")) { check++; } }); if (check == 0) { parent.find('input#cb-select-all').prop('checked', true); } }); } $('#booking-email-form-btn').on('click', function (e) { e.preventDefault(); var t = $(this).closest('.booking-email-form'); var data = t.serializeArray(); t.find('.form-message').html('').hide(); $.ajax({ url: st_params.ajax_url, type: "POST", data: data, dataType: "json", beforeSend: function () { t.find('.overlay-form').show(); } }).done(function (respond) { if(respond.status == true){ t.find('.form-message').html('<div class="alert alert-success">'+ respond.message +'</div>').show(); }else{ t.find('.form-message').html('<div class="alert alert-danger">'+ respond.message +'</div>').show(); } t.find('.overlay-form').hide(); }) }); if($('input.flight_package').length) { $('input.flight_package').on('ifClicked', function (event) { var me = $(this); if (this.checked) { setTimeout(function () { me.iCheck('uncheck'); }, 1); } }); } }); //End Custom 2 // nicescroll jQuery(function($){ $.fn.niceScroll && $('html').niceScroll({ cursorcolor: "#000", cursorborder: "0px solid #fff", railpadding: { top: 0, right: 0, left: 0, bottom: 0 }, cursorwidth: "10px", cursorborderradius: "0px", cursoropacitymin: 0.2, cursoropacitymax: 0.8, boxzoom: true, horizrailenabled: false, zindex: 9999 }); if( $('.traveler-cart-mini .traveler-cart-content').length ){ $.fn.niceScroll && $('.traveler-cart-mini .traveler-cart-content').niceScroll(); } }); ;var last_search_room_error; jQuery(function ($) { var last_error = ''; $('.btn-do-search-room').on('click', function () { var searchbox = $(this).parents('.booking-item-dates-change'); do_search_room(searchbox) }); $(".btn-show-price").on('click', function () { var searchbox = $('.booking-item-dates-change'); do_search_room(searchbox) }); $('.btn-clr-search-room').on('click', function () { var searchbox = $(this).parents('.booking-item-dates-change'); do_clear_search_form(searchbox); do_search_room(searchbox) }); function do_clear_search_form(searchbox) { searchbox.find('input[type=text]').val(''); searchbox.find('select').each(function (i, v) { v.selectedIndex = 0 }); searchbox.find('.btn-group-select-num .btn-primary').removeClass('active'); $('.search_room_alert').html(''); $('.age_of_child_input').removeClass('error'); searchbox.find('.form-control').removeClass('error') } function do_search_room(searchbox) { var me = $('.booking-list.loop-room'); var data = {'nonce': $('input[name=room_search]').val()}; if (typeof searchbox != "undefined") { data = searchbox.find('input,select,textarea').serializeArray() } var dataobj = {}; for (var i = 0; i < data.length; i++) { dataobj[data[i].name] = data[i].value } var holder = $('.search_room_alert'); holder.html(''); searchbox.find('.age_of_child_input').removeClass('error'); searchbox.find('.form-control').removeClass('error'); searchbox.find('.form_input').removeClass('error'); if (dataobj.start == "" && dataobj.end == "") { if (dataobj.start == "") { searchbox.find('[name=start]').addClass('error') } if (dataobj.end == "") { searchbox.find('[name=end]').addClass('error') } setMessage(holder, st_hotel_localize.is_not_select_date, 'danger'); return !1 } if (dataobj.start == "") { if (dataobj.start == "") { searchbox.find('[name=start]').addClass('error') } setMessage(holder, st_hotel_localize.is_not_select_check_in_date, 'danger'); return !1 } if (dataobj.end == '') { if (dataobj.end == "") { searchbox.find('[name=end]').addClass('error') } setMessage(holder, st_hotel_localize.is_not_select_check_out_date, 'danger'); return !1 } if (dataobj.room_num_search == 1) { if (dataobj.adult_num == "" || dataobj.child_num == '') { setMessage(holder, st_hotel_localize.booking_required_adult_children, 'danger'); return !1 } } else { var is_aoc_fail = !1; searchbox.find('.room_num_children_input').each(function () { if ($(this).val() > 0) { $(this).closest('tr').find('.age_of_child_input').each(function () { if ($(this).val() == '-1') { $(this).addClass('error'); is_aoc_fail = !0 } else { $(this).removeClass('error') } }) } }); if (is_aoc_fail) { setMessage(holder, st_hotel_localize.is_aoc_fail, 'danger'); return !1 } var is_host_name_fail = !1; searchbox.find('.room_num_host_name_input').each(function () { if ($(this).val() == '') { $(this).addClass('error'); is_host_name_fail = !0 } else { $(this).removeClass('error') } }); if (is_host_name_fail) { setMessage(holder, st_hotel_localize.is_host_name_fail, 'danger'); return !1 } } if (me.hasClass('loading')) { alert('Still loading'); return } me.addClass('loading'); $.ajax({ 'type': 'post', 'dataType': 'json', 'url': "", 'data': data, 'success': function (data) { me.removeClass('loading'); if (data.status) { if (typeof data.data != "undefined" && data.data) { me.html(data.data) } else { me.html('') } $('body').tooltip({selector: '[rel=tooltip]'}); $('.i-check, .i-radio').iCheck({checkboxClass: 'i-check', radioClass: 'i-radio'}) } if (data.message) { setMessage(holder, data.message, 'danger'); me.html('') } $('.div_paged_room').html(data.paging); $('.booking-item-dates-change .paged_room').val(1) }, error: function (data) { me.removeClass('loading') } }) } function setMessage(holder, message, type) { if (typeof type == 'undefined') { type = 'infomation' } var html = '<div class="alert alert-' + type + '">' + message + '</div>'; if (!holder.length) return; holder.html(''); holder.html(html); do_scrollTo(holder) } $(document).on('change', '.room_num_children_input', function () { var val = $(this).val(); var parent = $(this).closest('tr'); show_child_age_col(); if (val == 0) { parent.find('.room_num_age_of_children').html('') } else { parent.find('.room_num_age_of_children').html(''); var room_num = $(this).closest('.room-item').data('room-num'); for (i = 1; i <= val; i++) { var html = $('#example_age_of_child').clone(); html.prop('id', false); html.removeClass('hidden'); html.addClass('required'); html.attr('name', 'room_data[' + room_num + '][age_of_children][' + i + ']'); parent.find('.room_num_age_of_children').append(html) } } }); function show_child_age_col() { $('.room_num_config tbody tr').each(function () { var select = $(this).find('.room_num_children_input'); if (select.val() > 0) { $('.age_of_children_col').removeClass('hidden') } }) } show_child_age_col(); function do_scrollTo(el) { if (el.length) { var top = el.offset().top; if ($('#wpadminbar').length && $('#wpadminbar').css('position') == 'fixed') { top -= 32 } top -= 50; $('html,body').animate({'scrollTop': top}, 500) } } }) ;jQuery(function($) { if ($(".st_single_hotel").length < 1) return; $('ul.paged_room a.paged_room').each(function() { $(this).attr('data-page', $(this).html()) }); $(document).on('click', '.paged_item_room', function() { var paged = $(this).data('page'); $('.booking-item-dates-change .paged_room').val(paged); $('.btn-do-search-room').trigger('click'); }); if ($('#field-hotel-start, #field-hotel-end').length) { var check_in = $('#field-hotel-start'); var check_out = $('#field-hotel-end'); $('#field-hotel-start, #field-hotel-end').datepicker({ language: st_params.locale, autoclose: !0, todayHighlight: !0, startDate: 'today', format: $('[data-date-format]').data('date-format'), weekStart: 1, }); check_in.on('changeDate', function(e) { var new_date = e.date; new_date.setDate(new_date.getDate() + 1); check_out.datepicker('setDates', new_date); check_out.datepicker('setStartDate', new_date); check_out.datepicker('show') }) } if ($('.st-slider-list-room').length) { $('.st-slider-list-room').owlCarousel({ items: 3, itemsDesktop: [1200, 3], itemsDesktopSmall: [992, 3], itemsTablet: [768, 2], itemsMobile: [320, 1], slideSpeed: 1000, paginationSpeed: 1000, pagination: !1, }); var slider = $(".st-slider-list-room").data('owlCarousel'); $('.st-slider-list-room-wrapper .control-left').on('click', function(event) { slider.prev(); return !1 }); $('.st-slider-list-room-wrapper .control-right').on('click', function(event) { slider.next(); return !1 }) } function $_GET(param) { var vars = {}; window.location.href.replace(location.hash, '').replace(/[?&]+([^=&]+)=?([^&]*)?/gi, function(m, key, value) { vars[key] = value !== undefined ? value : '' }); if (param) { return vars[param] ? vars[param] : null } return vars } var booking_period = $('.booking-item-dates-change').data('booking-period'); $('input.checkin_hotel, input.checkout_hotel').datepicker('setStartDate','+'+(booking_period+1)+'d'); $('.overlay-form').fadeOut(500); }) ;jQuery(function ($) { //Booking now in single hotel /*$(document).on('click', '.btn_hotel_booking', function (e) { e.preventDefault(); $('#bookingRoomNow').modal('show'); }); $('#bookingRoomNow').modal('show');*/ $('.bookingdc-num-children').on('change', function () { var t = $(this); var af = $('.bookingdc-age-children'); var number_child = t.val(); if (number_child > 0) { var te = ''; for (var i = 0; i < number_child; i++) { te += '<select name="age">'; for (var j = 0; j < 18; j++) { te += '<option value="' + j + '">' + j + '</option>'; } te += '</select>'; } af.show().children('#bookingdc-age-select').html(te); } else { af.hide().children('#bookingdc-age-select').html(''); } }); $('.bookingdc-start').on('change', function () { $('input[name="checkin_monthday"]').remove(); $('input[name="checkin_month"]').remove(); $('input[name="checkin_year"]').remove(); var start = $(this).datepicker("getDate"); var ci_dd = start.getDate(); var ci_mm = start.getMonth() + 1; var ci_yy = start.getFullYear(); var ci_te = ''; if ($('input[name="checkin_monthday"]').length == 0 && $('input[name="checkin_month"]').length == 0 && $('input[name="checkin_year"]').length == 0) { ci_te += '<input type="hidden" name="checkin_monthday" value="' + ci_dd + '"/>'; ci_te += '<input type="hidden" name="checkin_month" value="' + ci_mm + '"/>'; ci_te += '<input type="hidden" name="checkin_year" value="' + ci_yy + '"/>'; $('.main-bookingdc-search').append(ci_te); } }); $('.bookingdc-end').on('change', function () { $('input[name="checkout_monthday"]').remove(); $('input[name="checkout_month"]').remove(); $('input[name="checkout_year"]').remove(); var end = $(this).datepicker("getDate"); var co_dd = end.getDate(); var co_mm = end.getMonth() + 1; var co_yy = end.getFullYear(); var co_te = ''; if ($('input[name="checkout_monthday"]').length == 0 && $('input[name="checkout_month"]').length == 0 && $('input[name="checkout_year"]').length == 0) { co_te += '<input type="hidden" name="checkout_monthday" value="' + co_dd + '"/>'; co_te += '<input type="hidden" name="checkout_month" value="' + co_mm + '"/>'; co_te += '<input type="hidden" name="checkout_year" value="' + co_yy + '"/>'; $('.main-bookingdc-search').append(co_te); } }); }); ;jQuery(function ($) { if(!$('body').hasClass('single-st_rental')) return; var month_start=''; var year_start=''; var is_group = 'off'; if ($('#rental_is_groupday').length) { if ($('#rental_is_groupday').val() == 'on') { is_group = 'on'; } else { is_group = 'off'; } } if (is_group == 'off') { $('#form-booking-inpage .form-group.form-group-icon-left .form-control.checkin_rental').css('background', 'transparent'); $('#form-booking-inpage .form-group.form-group-icon-left .form-control.checkout_rental').css('background', 'transparent'); var disabled_dates = []; var fist_half_day = []; var last_half_day = []; var startDate=$('.booking-item-dates-change').data('period'); if(!startDate){ startDate='today'; } $('input.checkin_rental, input.checkout_rental').each(function () { var $this = $(this); $this.datepicker({ language: st_params.locale, format: $('[data-date-format]').data('date-format'), todayHighlight: !0, autoclose: !0, startDate: startDate, weekStart: 1, setRefresh: !0, beforeShowDay: function (date) { var d = date; var curr_date = d.getDate(); if (curr_date < 10) { curr_date = "0" + curr_date } var curr_month = d.getMonth() + 1; if (curr_month < 10) { curr_month = "0" + curr_month } var curr_year = d.getFullYear(); var key = 'st_calendar_' + curr_date + "_" + curr_month + "_" + curr_year; return {classes: key} } }); $this.on('click', function () { if (fist_half_day.length > 0) { for (var i = 0; i < fist_half_day.length; i++) { var $key = 'st_calendar_' + fist_half_day[i]; $('.' + $key).addClass('st_fist_half_day') } } if (last_half_day.length > 0) { for (var i = 0; i < last_half_day.length; i++) { var $key = 'st_calendar_' + last_half_day[i]; $('.' + $key).addClass('st_last_half_day') } } if (disabled_dates.length > 0) { for (var i = 0; i < disabled_dates.length; i++) { var $key = 'st_calendar_' + disabled_dates[i]; $('.' + $key).addClass('disabled disabled-date booked day st_booked') } } }); $('.date-overlay').addClass('open'); var date_start = $(this).datepicker('getDate'); if (date_start == null) date_start = new Date(); year_start = date_start.getFullYear(); month_start = date_start.getMonth() + 1; }); ajaxGetRentalOrder(month_start, year_start); $('input.checkin_rental').on('changeMonth', function (e) { year_start = new Date(e.date).getFullYear(); month_start = new Date(e.date).getMonth() + 1; ajaxGetRentalOrder(month_start, year_start, $(this)) }); $('input.checkin_rental').on('changeDate', function (e) { var new_date = e.date; new_date.setDate(new_date.getDate() + 1); $('input.checkout_rental').datepicker('setStartDate', new_date) }); $('input.checkin_rental, input.checkout_rental').on('keyup', function (e) { setTimeout(function () { if (fist_half_day.length > 0) { for (var i = 0; i < fist_half_day.length; i++) { var $key = 'st_calendar_' + fist_half_day[i]; $('.' + $key).addClass('st_fist_half_day') } } if (last_half_day.length > 0) { for (var i = 0; i < last_half_day.length; i++) { var $key = 'st_calendar_' + last_half_day[i]; $('.' + $key).addClass('st_last_half_day') } } if (disabled_dates.length > 0) { for (var i = 0; i < disabled_dates.length; i++) { var $key = 'st_calendar_' + disabled_dates[i]; $('.' + $key).addClass('disabled disabled-date booked day st_booked') } } }, 200) }); $('input.checkout_rental').on('changeMonth', function (e) { year_start = new Date(e.date).getFullYear(); month_start = new Date(e.date).getMonth() + 1; ajaxGetRentalOrder(month_start, year_start, $(this)) }); function ajaxGetRentalOrder(month, year) { post_id = $('.booking-item-dates-change').data('post-id'); $('.date-overlay').addClass('open'); if (!typeof post_id != 'undefined' || parseInt(post_id) > 0) { var data = { rental_id: post_id, month: month, year: year, security: st_params.st_search_nonce, action: 'st_get_disable_date_rental', }; $.post(st_params.ajax_url, data, function (respon) { disabled_dates = Object.keys(respon.disable).map(function (key) { return respon.disable[key] }); fist_half_day = Object.keys(respon.fist_half_day).map(function (key) { return respon.fist_half_day[key] }); last_half_day = Object.keys(respon.last_half_day).map(function (key) { return respon.last_half_day[key] }); if (fist_half_day.length > 0) { for (var i = 0; i < fist_half_day.length; i++) { var $key = 'st_calendar_' + fist_half_day[i]; $('.' + $key).addClass('st_fist_half_day') } } if (last_half_day.length > 0) { for (var i = 0; i < last_half_day.length; i++) { var $key = 'st_calendar_' + last_half_day[i]; $('.' + $key).addClass('st_last_half_day') } } if (disabled_dates.length > 0) { for (var i = 0; i < disabled_dates.length; i++) { var $key = 'st_calendar_' + disabled_dates[i]; $('.' + $key).addClass('disabled disabled-date booked day st_booked') } } $('.date-overlay').removeClass('open') }, 'json') } else { $('.date-overlay').removeClass('open') } } } else { $('#form-booking-inpage .form-group.form-group-icon-left .form-control.checkin_rental').css('background', '#dfdfdf'); $('#form-booking-inpage .form-group.form-group-icon-left .form-control.checkout_rental').css('background', '#dfdfdf'); } }); ;jQuery(function ($) { if($('.single-room-form').length > 0) { var ci = 0; $('#field-hotelroom-room, .extra-service-select, #field-hotelroom-checkout, #field-hotelroom-checkin').on('change', function (e) { if (ci == 0) { changeServiceSelect(); } ci++; }); var flag = false; if ($('#field-hotelroom-room').val() != '1' && $('#field-hotelroom-room').length > 0) { flag = true; } if ($('.extra-price').length > 0) { $('.extra-price .extra-service-select').each(function () { if ($(this).val() != '0') { flag = true; } }); } if (flag) { changeServiceSelect(); } function changeServiceSelect() { var basePrice = $('#st-base-price').data('base-price'); var originPrice = 0; if ($('#st-origin-price').length > 0) { originPrice = $('#st-origin-price').data('origin-price'); } var roomNumber = $('#field-hotelroom-room').val(); var roomCheckIn = $('#field-hotelroom-checkin').val(); var roomCheckOut = $('#field-hotelroom-checkout').val(); var adultNumber = $('#field-hotelroom-adult').val() || 0; var childNumber = $('#field-hotelroom-children').val() || 0; var totalExtraPrice = 0; if ($('.extra-price').length > 0) { $('.extra-price .extra-service-select').each(function () { var totalItem; var numberItem = $(this).val(); var priceItem = $(this).data('extra-price'); totalItem = Number(getNumber(priceItem.toString())) * Number(numberItem); totalExtraPrice = totalExtraPrice + totalItem; }); } renderHtml(basePrice, originPrice, roomNumber, totalExtraPrice, roomCheckIn, roomCheckOut, adultNumber, childNumber); } function renderHtml(basePrice, originPrice, roomNumber, totalExtraPrice, checkIn, checkOut, adultNumber, childNumber) { /* var total = Number(getNumber(basePrice.toString())) * Number(roomNumber) + (totalExtraPrice * Number(roomNumber)); var totalOrigin = Number(getNumber(originPrice.toString())) * Number(roomNumber) + (totalExtraPrice * Number(roomNumber)); if ($('#st-base-price').length > 0) { $('#st-base-price').html(format_money(total * nightNumber)); $('#st-base-price').html(format_money(disCountTotalByPackage(total, nightNumber, renderDiscountPackage()))); console.log('No D: ' + total * nightNumber); } if ($('#st-origin-price').length > 0) { $('#st-origin-price').html(format_money(totalOrigin * nightNumber)); $('#st-origin-price').html(format_money(disCountTotalByPackage(totalOrigin, nightNumber, renderDiscountPackage()))); console.log('No DO: ' + totalOrigin * nightNumber); } disCountTotalByPackage(total, nightNumber, renderDiscountPackage()); */ $('.message_box').html(''); var overlay = $('#hotel-room-box .overlay-form'); $.ajax({ method: "POST", url: st_params.ajax_url, data: { base_price: basePrice, origin_price: originPrice, post_id: $('#field-hotelroom-checkin').data('post-id'), number_room: roomNumber, check_in: checkIn, check_out: checkOut, total_extra: totalExtraPrice, adult_number: adultNumber, child_number: childNumber, action: 'st_format_real_price' }, beforeSend: function () { overlay.show(); }, success: function (response) { if (response.status == true) { if ($('#st-base-price').length > 0) { $('#st-base-price').html(response.sale); } if ($('#st-origin-price').length > 0) { $('#st-origin-price').html(response.origin); } if ($('#st-number-day').length > 0) { $('#st-number-day').html(response.numberday); } $('.message_box').html(''); ci = 0; overlay.hide(); } else { if (response.message != '') { $('.message_box').html('<div class="alert alert-danger">' + response.message + '</div>'); ci = 0; overlay.hide(); return false; } } } }); } } function getNumber(str) { return str.replace(/([^\d|^\.])*/g, ''); } function format_money($money) { if (!$money) { return st_params.free_text; } //if (typeof st_params.booking_currency_precision && st_params.booking_currency_precision) { // $money = Math.round($money).toFixed(st_params.booking_currency_precision); //} $money = st_number_format($money, st_params.booking_currency_precision, st_params.decimal_separator, st_params.thousand_separator); var $symbol = st_params.currency_symbol; var $money_string = ''; switch (st_params.currency_position) { case "right": $money_string = $money + $symbol; break; case "left_space": $money_string = $symbol + " " + $money; break; case "right_space": $money_string = $money + " " + $symbol; break; case "left": default: $money_string = $symbol + $money; break; } return $money_string; } function st_number_format(number, decimals, dec_point, thousands_sep) { number = (number + '') .replace(/[^0-9+\-Ee.]/g, ''); var n = !isFinite(+number) ? 0 : +number, prec = !isFinite(+decimals) ? 0 : Math.abs(decimals), sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep, dec = (typeof dec_point === 'undefined') ? '.' : dec_point, s = '', toFixedFix = function (n, prec) { var k = Math.pow(10, prec); return '' + (Math.round(n * k) / k) .toFixed(prec); }; // Fix for IE parseFloat(0.55).toFixed(0) = 0; s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)) .split('.'); if (s[0].length > 3) { s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep); } if ((s[1] || '') .length < prec) { s[1] = s[1] || ''; s[1] += new Array(prec - s[1].length + 1) .join('0'); } return s.join(dec); } function getNightRoom(start, end){ var dateNumber = daydiff(parseDate(formatD(start)), parseDate(formatD(end))); if(dateNumber <= 0){ dateNumber = 1; } return dateNumber; } function parseDate(str) { var mdy = str.split('/'); return new Date(mdy[2], mdy[0]-1, mdy[1]); } function daydiff(first, second) { return Math.round((second-first)/(1000*60*60*24)); } function formatD(inputDate) { var d = new Date(inputDate.split("/").reverse().join("-")); var dd = d.getDate(); var mm = d.getMonth()+1; var yy = d.getFullYear(); var newdate = mm + "/" + dd + "/" + yy; return newdate; } function renderDiscountPackage(){ var discountObj = []; if($('#discount-package').length > 0){ $('#discount-package .discount-package-item').each(function(index, value){ discountObj.push([$(this).val(), $(this).data('discount')]) }); } return discountObj; } function disCountTotalByPackage(total, nightNumber, discountObj){ //console.log(discountObj.length); var result = total * nightNumber; for(var i = 0; i < discountObj.length; i++){ var dayRange = discountObj[i][0].split('-'); var discount = parseInt(discountObj[i][1] + ''.replace(/[^0-9\.]/g, ''), 10); dayRangeNumArr = []; for(var j = 0; j < dayRange.length; j++){ var dayRangeNum = parseInt(dayRange[j] + ''.replace(/[^0-9\.]/g, ''), 10) dayRangeNumArr.push(dayRangeNum); } if(dayRangeNumArr.length == 1){ if(nightNumber == dayRangeNumArr[0]){ result = total * nightNumber * (100 - discount) / 100; } } if(dayRangeNumArr.length == 2){ if(nightNumber >= dayRangeNumArr[0] && nightNumber <= dayRangeNumArr[1]){ result = total * nightNumber * (100 - discount) / 100; } } } return result; } /** * User Verify */ $('.btn-connect-facebook').on('click',function () { var me = $(this); var input = $(this).closest('.form-group').find('.input_id'); var input_name = $(this).closest('.form-group').find('.input_name'); var connected = $(this).closest('.form-group').find('.connected'); if(typeof FB === 'undefined'){ console.log('Facebook api is not ready'); return; } connected.addClass('hidden'); FB.login(function(response){ // Handle the response object, like in statusChangeCallback() in our demo // code. if (response.status === 'connected') { // Logged into your app and Facebook. FB.api('/me?fields=id,name', function(response) { input.val(response.id); input_name.val(response.name); connected.removeClass('hidden').find('span').html(response.name); }); } else { // The person is not logged into this app or we are unable to tell. alert(st_params.text_process_cancel) } }); }); function validateEmail(email) { var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(String(email).toLowerCase()); } $('.st-js-validate').on('submit',function (e) { var inputs = $(this).find('[data-rules]'); if(inputs.length){ var check = true; inputs.each(function () { $(this).trigger('clear-error'); var $this = $(this); var val = $(this).val(); var rules = $(this).data('rules'); var field_check = true; var rules_errors =[]; rules.split(',').map(function (v) { switch (v.trim()) { case "required": if(!val){ field_check = false; rules_errors.push(v.trim()); if($this[0].name === '_passport_photos'){ $('.verify_photo_inputs').addClass('error'); } } break; case "email": if(!validateEmail(val)) { field_check = false; rules_errors.push(v.trim()) } break; } }); //Focus on first error field if(check && !field_check){ $(this).trigger('focus'); } if(!field_check){ check = false; $(this).trigger('on-error',rules_errors); } }); if(check) { e.target.submit(); }else{ e.preventDefault(); } } }); $('.st-js-validate *').on('clear-error',function (e) { var parent = $(this).closest('.form-group'); if(parent.length){ $(this).removeClass('error'); parent.removeClass('error'); } }).on('on-error',function (e,rules) { var parent = $(this).closest('.form-group'); if(parent.length){ $(this).addClass('error'); parent.addClass('error'); } }); $('.verify_photo_inputs').on('change', function () { var me = $(this); var input = $(this).closest('.form-group').find("input[type='hidden']"); var btn = $(this).closest('.btn'); var files = $(this).get(0).files; var album = $(this).closest('.form-group').find('.lists-photo'); var notes = $(this).closest('.form-group').find('.upload-notes'); notes.html(''); if(files.length) { var max_files = 5; var formData = new FormData(); formData.append('action','st_user_add_photo'); formData.append('_s',st_params._s); for (var i = 0; i < files.length; ++i) { if(i >= max_files) continue; formData.append('image['+i+']',files[i]); } btn.addClass('loading'); me.val(''); $.ajax({ url: st_params.ajax_url, type: "POST", data: formData, dataType: "json", processData: false, contentType: false, success:function (json) { btn.removeClass('loading'); if(json.rows) { for( var i = 0;i< json.rows.length ; i++) { var d = $('<div/>'); d.addClass('passport-photo-item'); d.attr('data-url',json.rows[i].url); d.append('<span class="icon-remove"><i class="fa fa-minus-circle"></i></span>'); d.append('<img src="'+json.rows[i].url+'">'); album.append(d) } } var val = []; album.find('[data-url]').each(function(){ val.push($(this).attr('data-url')); }); input.val(val.join(',')); if(json.message) { notes.html(json.message); } }, error:function (e) { btn.removeClass('loading'); } }) } }); $(document).on('click','.passport-photo-item .icon-remove',function () { var album = $(this).closest('.form-group').find('.lists-photo'); var input = $(this).closest('.form-group').find("input[type='hidden']"); var val = []; album.find('[data-url]').each(function(){ val.push($(this).data('url')); }); input.val(val.join(',')); $(this).closest('.passport-photo-item').remove(); }); $('.has-datepicker').datepicker({ language: st_params.locale || '', autoclose:true }); //----------End User verify---------------------------- var bottomSpacing = $('#main-footer').height(); $('.sticky-box').each(function(){ var args={ topSpacing:60, bottomSpacing:bottomSpacing, widthFromWrapper:true, getWidthFrom:'' }; args.getWidthFrom = $(this).data('width-from'); $(this).sticky(args); }); //-------------Add Service Step-------------------------- var prevTab = $('.add-service-progress ul li:first-child'); $('.add-service-progress ul li').on('click', function () { var validated = true; var me = $(this); if(prevTab) { var form = $(prevTab.data('step')); validated = validateStep(form); if(validated){ prevTab.addClass('success').removeClass('error'); }else{ prevTab.addClass('error').removeClass('success'); } } if(validated) { prevTab = me; var newForm=$($(this).data('step')); newForm.show().siblings().hide(); me.addClass('selected').siblings().removeClass('selected'); } }); if($('#st_form_add_partner').length) { $('#st_form_add_partner').on('submit', function (e) { //e.preventDefault(); var notSuccess = $('.add-service-progress ul li[data-step]:not(.success)'); var check = true; if(notSuccess.length) { notSuccess.each(function(){ var form_id = $(this).data('step'); var form =$(form_id); if(!validateStep(form)) { check = false; form.show().siblings().hide(); $(this).addClass('selected error').siblings().removeClass('selected'); $(this).removeClass('success'); //return false; }else{ $(this).addClass('success').removeClass('error'); } }); if(!check) { //$(this).submit(); e.preventDefault(); } } }); } function validateStep(form) { if(typeof tinyMCE !='undefined') { tinyMCE.triggerSave(); } var inputs = form.find('[data-rules]'); if(inputs.length){ var check = true; inputs.each(function () { $(this).trigger('clear-error'); var val = $(this).val(); var rules = $(this).data('rules'); var field_check = true; var rules_errors =[]; var inputType = $(this).attr('type'); var name = $(this).attr('name'); rules.split(',').map(function (v) { switch (v.trim()) { case "required": switch (inputType){ case "checkbox": if(form.find("[name='"+name+"']:checked").length < 1){ field_check = false; rules_errors.push(v.trim()); } break; default: if(!val){ field_check = false; rules_errors.push(v.trim()); } break; } break; case "email": if(!validateEmail(val)) { field_check = false; rules_errors.push(v.trim()) } break; } }); //Focus on first error field if(check && !field_check){ $(this).trigger('focus'); } if(!field_check){ check = false; $(this).trigger('on-error',rules_errors); } }); return check; } return true; } $('.add_service_step [data-rules]').on('on-error',function (e,rules) { $(this).closest('.form-group').addClass('error'); // if(rules.length) // { // for(var i = 0;i<rules.length;i++){ // $(this).closest('.form-group').addClass('rule-'+rules[i]); // } // // } if(typeof rules !='undefined'){ $(this).closest('.form-group').addClass('rule-'+rules); } }) .on('clear-error',function () { $(this).closest('.form-group').removeClass('error').alterClass('rule-*'); }); //-------------End Add Service Step-------------------------- //--------------- Guest Name Inputs ------------------------- var adultNumber = $('.form-has-guest-name .adult_number'); var childrenNumber = $('.form-has-guest-name .child_number'); var infantNumber = $('.form-has-guest-name .infant_number'); var guestNameInput = $('.form-has-guest-name .guest_name_input'); adultNumber.on('change',triggerGuestInputChange); childrenNumber.on('change',triggerGuestInputChange); infantNumber.on('change',triggerGuestInputChange); function triggerGuestInputChange(e) { guestNameInput.trigger('guest-change', { 'adult': parseInt(adultNumber.val()), 'children': parseInt(childrenNumber.val()), 'infant': parseInt(infantNumber.val()) }); }; guestNameInput.on('guest-change',function(e,number){ var adult = number.adult; var children = number.children; var infant = number.infant; var hideAdult = $(this).data('hide-adult'); var hideChildren = $(this).data('hide-children'); var hideInfant = $(this).data('hide-infant'); var controlWraps = $(this).find('.guest_name_control'); var controls = controlWraps.find('.control-item'); if(isNaN(infant)) infant=0; if(isNaN(children)) children=0; if(hideAdult=='on'){ adult = 0; } if(typeof hideChildren=='undefined' || hideChildren!='on') adult += children; if(typeof hideInfant=='undefined' || hideInfant!='on') adult += infant; //adult-=1;// Only input guest >=2 name if(adult<=0){ $(this).addClass('hidden'); }else{ // Append for(var i = controls.length?(controls.length):0;i<adult;i++) { var div = $($('#guest_name_control_item').clone().html()); var p = div.find('input').attr('placeholder'); div.find('input').attr('placeholder',p.replace('%d',i+2)); controlWraps.append(div); } // Remove controls.each(function () { if($(this).index() > adult -1) { $(this).remove(); } }); $(this).removeClass('hidden'); } }); triggerGuestInputChange(); //------------------End Guest Name Inputs ------------------- }); (function ( $ ) { $.fn.alterClass = function ( removals, additions ) { var self = this; if ( removals.indexOf( '*' ) === -1 ) { // Use native jQuery methods if there is no wildcard matching self.removeClass( removals ); return !additions ? self : self.addClass( additions ); } var patt = new RegExp( '\\s' + removals. replace( /\*/g, '[A-Za-z0-9-_]+' ). split( ' ' ). join( '\\s|\\s' ) + '\\s', 'g' ); self.each( function ( i, it ) { var cn = ' ' + it.className + ' '; while ( patt.test( cn ) ) { cn = cn.replace( patt, ' ' ); } it.className = $.trim( cn ); }); return !additions ? self : self.addClass( additions ); }; })( jQuery ); ;(function ($) { "use strict"; $(document).ready(function () { if($('#wp_is_mobile').length){ $('#slimmenu .menu-item.menu-item-has-children>a').append("<span class=\"sub-toggle\"><i class=\"fa fa-angle-down\"></i></span>"); $(document).on('click', '.menu-item .sub-toggle', function (e) { e.preventDefault(); var me = $(this); me.parent().next('.sub-menu').stop(true, true).slideToggle(); var faicon = me.find('i'); if(faicon.hasClass('fa-angle-down')){ faicon.removeClass('fa-angle-down').addClass('fa-angle-up'); }else{ faicon.removeClass('fa-angle-up').addClass('fa-angle-down'); } }); $('.collapse-button').on('click', function () { $('#slimmenu').stop(true, true).slideToggle(); $('.sub-menu').slideUp(); if($('.sub-toggle i').hasClass('fa-angle-up')){ $('.sub-toggle i').removeClass('fa-angle-up').addClass('fa-angle-down'); } }); } if (typeof $.fn.sticky != 'undefined') { var topSpacing = 0; if ($(window).width() > 481 && $('body').hasClass('admin-bar')) { topSpacing = $('#wpadminbar').height() } set_sticky() } function set_sticky() { var is_menu1 = $(".menu_style1").length; var is_menu2 = $(".menu_style2").length; var is_topbar = $("#top_toolbar").length; var sticky_topbar = $(".enable_sticky_topbar").length; var sticky_menu = $(".enable_sticky_menu").length; var sticky_header = $(".enable_sticky_header").length; if (sticky_header || (sticky_menu && sticky_topbar)) { $("#st_header_wrap_inner").sticky({topSpacing: topSpacing}); return } else { if (sticky_topbar && is_topbar) { $("#top_toolbar").sticky({topSpacing: topSpacing}) } if (sticky_menu && (is_menu1 || is_menu2 || is_menu3 || is_menu4)) { var topSpacing_topbar = topSpacing; if (is_topbar && sticky_topbar) { topSpacing_topbar += $("#top_toolbar").height() } $("#menu1").sticky({topSpacing: topSpacing_topbar}); $("#menu2").sticky({topSpacing: topSpacing_topbar}); return } } return } //if($('#wp_is_mobile').length && $('.single ').length){ if($('#wp_is_mobile').length){ if($('.st_above_on_mobile').length && $('.st_below_on_mobile').length) { var elAbove = $('.st_above_on_mobile'); var elBelow = $('.st_below_on_mobile'); var elBelow_clone = elBelow.clone(); elBelow.remove(); elBelow_clone.css({ 'margin-top': '30px' }); elAbove.parent().append(elBelow_clone); } } }); })(jQuery); ;(function ($) { "use strict"; $(document).ready(function () { if($('.st_lazy_load').length){ $('.st_lazy_load').each(function() { var me = $(this); new Waypoint({ element: me, handler: function () { var stLazy = me.find('.st-lazy'); stLazy.each(function () { var imgItem = $(this); var imgSRC = imgItem.data('src'); me.find('.layzyload-wrapper .layzyload-item').fadeOut(10, 'linear', function () { me.find('.layzyload-wrapper').addClass('layzyload-noafter'); imgItem.attr('src', imgSRC).show(); }); }); this.destroy() }, offset: $(window).height() }); }); } if($('.fotorama').length){ $('.fotorama').each(function () { var me = $(this); if(me.data('auto') == false){ new Waypoint({ element: me, handler: function () { me.fotorama(); this.destroy() }, offset: $(window).height() }); } }); } }); })(jQuery);